diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index b18fd293..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: 'github-actions' - directory: '/' - schedule: - interval: 'weekly' diff --git a/.github/workflows/fallow.yml b/.github/workflows/fallow.yml index f06ec10e..62b3d1fa 100644 --- a/.github/workflows/fallow.yml +++ b/.github/workflows/fallow.yml @@ -43,6 +43,6 @@ jobs: - name: Upload SARIF to Code Scanning if: always() - uses: github/codeql-action/upload-sarif@v4.37.9 + uses: github/codeql-action/upload-sarif@v4.38.0 with: sarif_file: fallow-results.sarif diff --git a/CHANGELOG.md b/CHANGELOG.md index 740b2cfd..cfae598f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.29.1] - 2026-09-28 + +### Changed + +- **deps**: bump Pi to v0.87.1 + +### Fixed + +- add opt-out for model auto refresh +- get_ci_status uses the current PR head by default (#417) +- refresh model catalog from pi.dev at startup (#416) + +## [2.29.0] - 2026-09-22 + +### Added + +- add cache_warming input and summarize_text tool + +### Changed + +- **deps**: bump Pi sdk to v0.87.0 + +### Fixed + +- **README.md**: add checkout action to interactive workflow sample (#414) +- **deps**: bump Pi sdk to v0.86.0, remove obsolete patchSDKLoaderSource +- ensure yaml is properly formatted + +## [2.28.1] - 2026-09-15 + +### Changed + +- **deps-ci**: bump github/codeql-action from 4.37.9 to 4.38.0 (#412) +- **deps-dev**: bump vitest from 4.1.10 to 4.1.11 (#410) + +### Fixed + +- **opengist**: add default TTL for opengist uploads + ## [2.28.0] - 2026-09-08 ### Added @@ -662,7 +701,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - README link corrections - Codecov action updated, removed double build -[unreleased]: https://github.com/shaftoe/pi-coding-agent-action/compare/v2.28.0...HEAD +[unreleased]: https://github.com/shaftoe/pi-coding-agent-action/compare/v2.29.1...HEAD +[2.29.1]: https://github.com/shaftoe/pi-coding-agent-action/compare/v2.29.0...v2.29.1 +[2.29.0]: https://github.com/shaftoe/pi-coding-agent-action/compare/v2.28.1...v2.29.0 +[2.28.1]: https://github.com/shaftoe/pi-coding-agent-action/compare/v2.28.0...v2.28.1 [2.28.0]: https://github.com/shaftoe/pi-coding-agent-action/compare/v2.27.1...v2.28.0 [2.27.1]: https://github.com/shaftoe/pi-coding-agent-action/compare/v2.27.0...v2.27.1 [2.27.0]: https://github.com/shaftoe/pi-coding-agent-action/compare/v2.26.0...v2.27.0 diff --git a/README.md b/README.md index c6aa38f6..4faf244a 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Create a workflow file, e.g., `.github/workflows/pi-agent.yml`. See the [interac The `develop` branch is in constant development while the `v2` branch is considered stable, if you don't want the bleeding edge you can pin to a specific release, e.g. ```yaml - uses: shaftoe/pi-coding-agent-action@v2.28.0 + uses: shaftoe/pi-coding-agent-action@v2.29.1 ``` > [!NOTE] @@ -65,7 +65,7 @@ The `develop` branch is in constant development while the `v2` branch is conside The action is bundled into a single `dist/index.js` via [esbuild](https://esbuild.github.io/) so no `node_modules` are needed at runtime. Non-code Pi SDK assets (HTML templates, theme JSON) are copied to `dist/pi-sdk/` and resolved via the `PI_PACKAGE_DIR` environment variable. -Dependencies (including Pi itself) are [updated regularly](./.github/workflows/daily-deps-update.yml) to keep up with new releases. +Dependencies (including Pi itself) are kept up to date via the [Renovate](https://github.com/apps/renovate) GitHub app. If you need to pin to a specific Pi SDK version check out previous release tags and refer to the following table to find the correct version: @@ -75,9 +75,9 @@ If you need to pin to a specific Pi SDK version check out previous release tags |---|---|---| | `@actions/core` | `3.0.1` | GitHub Actions core I/O (inputs, outputs, logging) | | `@actions/github` | `9.1.1` | GitHub API client (Octokit wrapper) | -| `@earendil-works/pi-agent-core` | `0.85.1` | Pi Agent Core — agent orchestration primitives | -| `@earendil-works/pi-ai` | `0.85.1` | Pi AI — AI model abstractions and providers | -| `@earendil-works/pi-coding-agent` | `0.85.1` | Pi SDK — AI coding agent runtime | +| `@earendil-works/pi-agent-core` | `0.87.1` | Pi Agent Core — agent orchestration primitives | +| `@earendil-works/pi-ai` | `0.87.1` | Pi AI — AI model abstractions and providers | +| `@earendil-works/pi-coding-agent` | `0.87.1` | Pi SDK — AI coding agent runtime | | `@js-temporal/polyfill` | `0.5.1` | Temporal API polyfill | | `@octokit/core` | `7.0.6` | Octokit REST API client core | | `@octokit/plugin-rest-endpoint-methods` | `17.0.0` | Octokit REST API endpoint methods | @@ -120,6 +120,10 @@ jobs: if: startsWith(github.event.comment.body, '/pi ') runs-on: ubuntu-latest steps: + + - name: Clone repository to work on + uses: actions/checkout@v7 + - name: Setup Node uses: actions/setup-node@v6 with: @@ -166,7 +170,9 @@ jobs: review: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + + - name: Clone the repository to work on + uses: actions/checkout@v7 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 @@ -223,7 +229,9 @@ jobs: review: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + + - name: Clone the repository to work on + uses: actions/checkout@v7 with: fetch-depth: 0 @@ -273,7 +281,9 @@ jobs: review: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + + - name: Clone the repository to work on + uses: actions/checkout@v7 with: fetch-depth: 0 @@ -325,7 +335,9 @@ jobs: dependency-audit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + + - name: Clone the repository to work on + uses: actions/checkout@v7 with: fetch-depth: 0 @@ -366,7 +378,9 @@ jobs: docs-sync: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + + - name: Clone the repository to work on + uses: actions/checkout@v7 with: fetch-depth: 0 @@ -418,7 +432,9 @@ jobs: if: github.event.assignee.login == 'my-pi-bot' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + + - name: Clone the repository to work on + uses: actions/checkout@v7 with: fetch-depth: 0 # Check out the PR head branch when triggered from a PR @@ -633,6 +649,21 @@ You can customize the auto-generated branch names used when Pi creates pull requ | `fix/{number}` | `fix/42` | | `{title}-{number}-{timestamp}` | `fix-auth-bug-42-1716543210000` | +### Pull Requests from a Fork + +If there are insufficient rights to push to the repository, agent will open a PR from its own fork. The agent creates the fork automatically on first use and reuses it afterwards. + +1. On first use the agent creates a fork of the repository under the account that owns `github_token`; subsequent runs reuse it. +2. The generated branch is pushed to that fork. +3. The pull request is opened on the repository with the cross-repository head `fork-owner:branch`. `update_pull_request` pushes follow-up commits to the fork as well. + +This mirrors how human contributors work and keeps agent branches out of the repository's branch list. + +> [!IMPORTANT] +> **Fork-based PRs need a token that can create forks.** When the token cannot push (e.g. a read-only PAT on someone else's repository, or a workflow whose `GITHUB_TOKEN` is restricted to `contents: read`), the default `secrets.GITHUB_TOKEN` authenticates as the repository's `github-actions[bot]`, which cannot own forks — `create_pull_request` fails with an actionable error in that case. Provide a classic PAT (with the `repo` scope) or a fine-grained PAT (with repository read/write + fork permissions) via the `github_token` input. +> +> When the token's owner already owns the repository (e.g. running the agent against your own repository with your PAT), a fork is impossible and unnecessary — the branch is pushed to the repository itself and a same-repository pull request is opened instead. + ### Injecting Environment Variables Pi extensions often require environment variables for authentication or configuration. Use the native `env:` step key to pass variables from your workflow's secrets or configuration into the Pi session: @@ -794,6 +825,7 @@ Because the pi.dev viewer **cannot** read non-GitHub gists (it hardcodes `api.gi share_gist_provider: opengist share_gist_api_url: https://gist.l3x.in/api/gists # Opengist REST API lives under /api/, not /api/v1/ share_gist_token: ${{ secrets.OPENGIST_TOKEN }} # Opengist access token (og_…) with gist:write scope + # share_gist_expiration: 7days # default; use `never` to keep gists forever provider: openai model: gpt-5.4 token: ${{ secrets.OPENAI_API_KEY }} @@ -806,6 +838,7 @@ Because the pi.dev viewer **cannot** read non-GitHub gists (it hardcodes `api.gi Notes: - The Opengist REST API create endpoint is `POST /api/gists`. Create an access token in **Settings → Access Tokens** (it starts with `og_`) and grant it the `gist:write` scope. See the [Opengist API docs](https://opengist.io/docs). - Gists are created as `unlisted` (not listed publicly, but readable via the unguessable URL) — the closest analogue of a GitHub "secret" gist. +- Shared gists **expire after 7 days** by default via Opengist's server-side TTL (`share_gist_expiration`, one of `1hour`, `12hours`, `1day`, `7days`, `15days`, or `never`). Shared sessions are ephemeral CI artifacts, so they're cleaned up automatically unless you set `share_gist_expiration: never` (or use the `github` provider, which has no expiry support). - `share_gist_token` is required for the opengist provider (an `og_…` access token with `gist:write` scope). Unlike the `github` provider, there is **no fallback to `github_token`** — a GitHub token can never authenticate against a self-hosted Opengist instance, so without `share_gist_token` the share is skipped with a clear notice. - The `share_url` uses the gist's **raw route** (`/raw/HEAD/session.html`), which Opengist serves as `text/html` so the self-contained session renders directly in a browser. The `HEAD` revision resolves to the latest commit (see the [Opengist docs](https://opengist.io/docs)). Because this raw-route behaviour is instance-specific, **verify it after upgrading Opengist** by creating a shared session and opening the link in a fresh browser — if your version doesn't accept `HEAD` on the raw route, share links will 404. - Set `PI_SHARE_VIEWER_URL` to a custom (non-pi.dev) viewer to instead build a `#` link that a self-hosted viewer can render (see [Custom viewer](#custom-viewer)). @@ -854,12 +887,31 @@ For complex, multi-step tasks that generate a lot of context (e.g. large code re auto_compaction: true ``` +### Prompt Cache Warming + +Providers expire prompt-cache entries after a period of inactivity, so a pause — for example a long tool execution in the middle of a code review — makes the next provider request pay full input price again. Cache warming re-sends the last request with a one-token output budget shortly before the cache entry expires, keeping the (much cheaper) cached prefix alive. + +The SDK's `streaming` mode (the default) protects prefixes during long tool executions. Set `cache_warming: idle` to also keep caches warm between prompts — useful when the action processes multiple comment-triggered prompts in one job. Refreshes are billed as a cache read plus one output token and only fire when the expected avoided cache-miss cost exceeds the refresh cost, so they never run at a loss: + +```yaml +- uses: shaftoe/pi-coding-agent-action@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + provider: anthropic + model: claude-sonnet-4-5 + token: ${{ secrets.ANTHROPIC_API_KEY }} + cache_warming: idle +``` + +Set `cache_warming: off` to disable warming entirely. Warming requires a known cache lifetime for the model (built in for direct Anthropic; custom models can declare `promptCache` in `models.json`). + ## Inputs | Input | Description | Required | Default | |-------|-------------|----------|---------| | `auto_compaction` | Enable automatic context compaction when the conversation grows too large for the model's context window. Pi summarizes older messages to free up context space | No | `false` | | `base_url` | Optional override for the provider base URL (e.g., to route traffic through a proxy or use an OpenAI-compatible gateway) | No | - | +| `cache_warming` | Prompt cache-warming mode: `off`, `streaming` (protect cache prefixes during long tool executions), or `idle` (also refresh between prompts). Refreshes cost a cache read + one output token and only fire when expected savings exceed the cost | No | `streaming` (SDK default) | | `branch_name_template` | Template for auto-generated branch names in `create_pull_request`. Supports variables: `{number}` (issue/PR number), `{timestamp}` (epoch ms), `{title}` (slugified PR title). Default: `pi/issue{number}-{timestamp}` | No | - | | `diff_ignore_patterns` | Space-separated list of file patterns to exclude from PR diffs by default (e.g. `dist/ package-lock.json`). The agent can still provide additional patterns at call time | No | - | | `diff_max_bytes` | Maximum diff size in bytes returned by the `get_pr_diff` tool | No | `102400` | @@ -875,10 +927,12 @@ For complex, multi-step tasks that generate a lot of context (e.g. large code re | `pr_number` | Pull request number to target. Use with `workflow_dispatch` to run the agent on a specific PR without a triggering event. When set, the action fetches PR context from the API and targets all operations at the specified PR | No | - | | `prompt` | Optional prompt to send to the agent (skips comment extraction) | No | - | | `provider` | LLM provider (openai, google, anthropic, amazon-bedrock, etc.) | Yes | - | +| `refresh_model_catalog` | Refresh the provider's model catalog from pi.dev at startup so models newer than the bundled SDK resolve. Set to `false` to skip the network round-trip and shorten boot time (the bundled model list is used instead) | No | `true` | | `share_session` | Share the session like pi's `/share` command: upload the exported HTML to a gist and surface a viewer link. Uses GitHub Gists by default (`share_gist_provider: github`) or a self-hosted Opengist instance. Auto-enables `export_session_html` | No | `false` | | `share_gist_provider` | Storage backend for `share_session`: `github` (GitHub Gists + pi.dev viewer) or `opengist` (self-hosted instance; requires `share_gist_api_url`) | No | `github` | | `share_gist_api_url` | API URL for the share gist provider. Required for `opengist` (e.g. `https://gist.l3x.in/api/gists`); optional override for `github` | No | - | | `share_gist_token` | Token used to create the shared gist. Opengist access token (`og_…`, `gist:write` scope) for `opengist` (required — no `github_token` fallback); optional GitHub PAT for the `github` provider (falls back to `github_token`) | No | - | +| `share_gist_expiration` | Time-to-live for shared gists (`opengist` provider only): `1hour`, `12hours`, `1day`, `7days`, `15days`, or `never`. Defaults to `7days` | No | `7days` | | `server_url` | Override the forge server URL (e.g. `https://git.example.com`) when the runner-advertised `GITHUB_SERVER_URL` points at an internally-reachable host (e.g. `http://localhost:3000` on a Forgejo runner behind Docker). Affects user-facing links (commits, PRs, action runs) only — the API client keeps using the runner's `GITHUB_API_URL`, and platform selection is controlled by the `platform` input. | No | - | | `thinking_level` | Model thinking level | No | off | | `token` | Provider API token. Required for most providers, but can be omitted when using providers that support alternative auth mechanisms (e.g., `google-vertex` with Application Default Credentials) | No | - | @@ -915,12 +969,13 @@ The action extends Pi with the following built-in GitHub tools: | Tool | Description | |------|-------------| | `create_pull_request_review` | Creates a pull request review with a summary body, inline comments anchored to specific diff lines, or both. Posts a GitHub Pull Request Review using the `pulls.createReview` API. Supports summary-only reviews, multi-line comments, diff side selection (LEFT/RIGHT), and review events (COMMENT, APPROVE, REQUEST_CHANGES). | -| `create_pull_request` | Creates a new pull request by detecting file changes, creating a branch, committing changes via GitHub API, and opening the PR. Supports `dry_run` mode for testing without actual PR creation. | +| `create_pull_request` | Creates a new pull request by detecting file changes, creating a branch, committing changes via GitHub API, and opening the PR. Supports `dry_run` mode for testing without actual PR creation. If there are insufficient rights to push to the repository, it will open a PR from its own fork. The tool creates the fork automatically on first use and reuses it afterwards. | | `get_ci_status` | Checks the CI/CD status for a pull request or commit ref. Returns both check runs and workflow runs with their statuses, conclusions, and URLs. Accepts optional `pull_number`, `ref`, `status`, and `conclusion` filters. For failed workflow runs, use the returned `run_id` with `get_workflow_run_logs` to fetch detailed job logs. | | `get_issue_or_pr_thread` | Retrieves the full thread of an issue or pull request including title, body, state, labels, branch info (for PRs), all comments, and review comments (inline comments on specific lines of the diff) for PRs. Useful for understanding the full context before making changes. | | `get_pr_diff` | Fetches the diff of a pull request on demand. Useful when the agent needs to understand what changed in a PR, e.g. for code reviews or addressing review feedback. Supports configurable `max_lines` truncation (default: 1000), max byte size cap (default: 100KB), and ignore patterns to filter out noisy paths. | | `get_workflow_run_logs` | Fetches job logs for a specific GitHub Actions workflow run to diagnose CI failures. Lists all jobs for a run and downloads their logs, truncated to 50KB by default (configurable via `max_bytes`). | -| `update_pull_request` | Updates an existing pull request by pushing new commits to the PR branch and optionally updating the title and/or description. Supports `dry_run` mode for testing without actual modifications. | +| `summarize_text` | Summarizes very long text (CI logs, large threads, file dumps) with a separate one-shot LLM call using the current session model, returning only the summary — keeping the raw text out of the conversation context. Accepts `text`, an optional `focus` instruction, and `max_words`. | +| `update_pull_request` | Updates an existing pull request by pushing new commits to the PR branch (in the fork for fork-based PRs, in the repository otherwise) and optionally updating the title and/or description. Supports `dry_run` mode for testing without actual modifications. | > [!TIP] > Set `load_builtin_extensions` input to `false` to disable custom tool auto loading. diff --git a/action.yml b/action.yml index 346456a5..bdcebd30 100644 --- a/action.yml +++ b/action.yml @@ -6,7 +6,7 @@ branding: inputs: github_token: - description: 'GitHub token for API access. The default `GITHUB_TOKEN` works for all standard operations. To use `share_session`, provide a classic PAT (`gist` scope), fine-grained PAT (Account → Gists: read/write), or GitHub App token instead — the default `GITHUB_TOKEN` cannot create gists.' + description: 'GitHub token for API access. The default `GITHUB_TOKEN` works for all standard operations. To use `share_session`, provide a classic PAT (`gist` scope), fine-grained PAT (Account → Gists: read/write), or GitHub App token instead — the default `GITHUB_TOKEN` cannot create gists. To open pull requests from the agent''s own fork, a personal access token needs to be classic PAT with `repo` scope, or a fine-grained PAT with repository read/write + fork permissions.' required: true provider: @@ -105,11 +105,26 @@ inputs: required: false default: '' + share_gist_expiration: + description: 'Time-to-live for shared gists (opengist provider only; GitHub Gists have no expiry). One of `1hour`, `12hours`, `1day`, `7days`, `15days`, or `never`. Defaults to `7days` — shared sessions are ephemeral CI artifacts. Set to `never` to keep them indefinitely.' + required: false + default: '' + auto_compaction: description: 'Enable automatic context compaction when the conversation grows too large for the model context window. When enabled, Pi will summarize older messages to free up context space, allowing longer sessions without hitting context limits.' required: false default: 'false' + cache_warming: + description: 'Prompt cache-warming mode. Keeps expensive prompt-cache prefixes alive with cost-aware one-token refreshes so pauses (e.g. long tool runs) don''t pay full input price again. One of `off`, `streaming` (refresh during long tool executions; the default), or `idle` (also refresh between prompts). Refreshes are billed as a cache read plus one output token and only fire when expected savings exceed the cost.' + required: false + default: '' + + refresh_model_catalog: + description: 'Whether to refresh the provider''s model catalog from pi.dev at startup so models newer than the bundled SDK resolve. Set to `false` to skip the network round-trip and shorten boot time (the bundled model list is used instead).' + required: false + default: 'true' + pr_number: description: 'Pull request number to target. Use this with workflow_dispatch to run the agent on a specific PR without a triggering event. When set, the action fetches PR context and posts the result as a comment on the specified PR.' required: false diff --git a/dist/index.js b/dist/index.js index fa74fb22..cb663879 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,98 +1,98 @@ -"use strict";var xVn=Object.create;var Xre=Object.defineProperty;var wVn=Object.getOwnPropertyDescriptor;var TVn=Object.getOwnPropertyNames;var vVn=Object.getPrototypeOf,RVn=Object.prototype.hasOwnProperty;var V=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var ee=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Ir=(t,e)=>{for(var n in e)Xre(t,n,{get:e[n],enumerable:!0})},xut=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of TVn(e))!RVn.call(t,s)&&s!==n&&Xre(t,s,{get:()=>e[s],enumerable:!(r=wVn(e,s))||r.enumerable});return t};var Gt=(t,e,n)=>(n=t!=null?xVn(vVn(t)):{},xut(e||!t||!t.__esModule?Xre(n,"default",{value:t,enumerable:!0}):n,t)),Un=t=>xut(Xre({},"__esModule",{value:!0}),t);var _,p=V(()=>{"use strict";_=require("url").pathToFileURL(__filename).href});var Put=ee(TQ=>{"use strict";p();var QKs=require("net"),BVn=require("tls"),PRe=require("http"),Nut=require("https"),PVn=require("events"),UKs=require("assert"),OVn=require("util");TQ.httpOverHttp=MVn;TQ.httpsOverHttp=LVn;TQ.httpOverHttps=FVn;TQ.httpsOverHttps=QVn;function MVn(t){var e=new rx(t);return e.request=PRe.request,e}function LVn(t){var e=new rx(t);return e.request=PRe.request,e.createSocket=Dut,e.defaultPort=443,e}function FVn(t){var e=new rx(t);return e.request=Nut.request,e}function QVn(t){var e=new rx(t);return e.request=Nut.request,e.createSocket=Dut,e.defaultPort=443,e}function rx(t){var e=this;e.options=t||{},e.proxyOptions=e.options.proxy||{},e.maxSockets=e.options.maxSockets||PRe.Agent.defaultMaxSockets,e.requests=[],e.sockets=[],e.on("free",function(r,s,i,o){for(var a=But(s,i,o),c=0,u=e.requests.length;c=this.maxSockets){i.requests.push(o);return}i.createSocket(o,function(a){a.on("free",c),a.on("close",u),a.on("agentRemove",u),e.onSocket(a);function c(){i.emit("free",a,o)}function u(l){i.removeSocket(a),a.removeListener("free",c),a.removeListener("close",u),a.removeListener("agentRemove",u)}})};rx.prototype.createSocket=function(e,n){var r=this,s={};r.sockets.push(s);var i=ORe({},r.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),Av("making CONNECT request");var o=r.request(i);o.useChunkedEncodingByDefault=!1,o.once("response",a),o.once("upgrade",c),o.once("connect",u),o.once("error",l),o.end();function a(d){d.upgrade=!0}function c(d,h,m){process.nextTick(function(){u(d,h,m)})}function u(d,h,m){if(o.removeAllListeners(),h.removeAllListeners(),d.statusCode!==200){Av("tunneling socket could not be established, statusCode=%d",d.statusCode),h.destroy();var f=new Error("tunneling socket could not be established, statusCode="+d.statusCode);f.code="ECONNRESET",e.request.emit("error",f),r.removeSocket(s);return}if(m.length>0){Av("got illegal response body from proxy"),h.destroy();var f=new Error("got illegal response body from proxy");f.code="ECONNRESET",e.request.emit("error",f),r.removeSocket(s);return}return Av("tunneling connection has established"),r.sockets[r.sockets.indexOf(s)]=h,n(h)}function l(d){o.removeAllListeners(),Av(`tunneling socket could not be established, cause=%s -`,d.message,d.stack);var h=new Error("tunneling socket could not be established, cause="+d.message);h.code="ECONNRESET",e.request.emit("error",h),r.removeSocket(s)}};rx.prototype.removeSocket=function(e){var n=this.sockets.indexOf(e);if(n!==-1){this.sockets.splice(n,1);var r=this.requests.shift();r&&this.createSocket(r,function(s){r.request.onSocket(s)})}};function Dut(t,e){var n=this;rx.prototype.createSocket.call(n,t,function(r){var s=t.request.getHeader("host"),i=ORe({},n.options,{socket:r,servername:s?s.replace(/:.*$/,""):t.host}),o=BVn.connect(0,i);n.sockets[n.sockets.indexOf(r)]=o,e(o)})}function But(t,e,n){return typeof t=="string"?{host:t,port:e,localAddress:n}:t}function ORe(t){for(var e=1,n=arguments.length;e{p();Out.exports=Put()});var Nc=ee((HKs,Mut)=>{p();Mut.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}});var Do=ee((jKs,adt)=>{"use strict";p();var Lut=Symbol.for("undici.error.UND_ERR"),Dc=class extends Error{constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[Lut]===!0}[Lut]=!0},Fut=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),LRe=class extends Dc{constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[Fut]===!0}[Fut]=!0},Qut=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),FRe=class extends Dc{constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[Qut]===!0}[Qut]=!0},Uut=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),QRe=class extends Dc{constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[Uut]===!0}[Uut]=!0},$ut=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),URe=class extends Dc{constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[$ut]===!0}[$ut]=!0},Gut=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),$Re=class extends Dc{constructor(e,n,r,s){super(e),this.name="ResponseStatusCodeError",this.message=e||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=s,this.status=n,this.statusCode=n,this.headers=r}static[Symbol.hasInstance](e){return e&&e[Gut]===!0}[Gut]=!0},Wut=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),GRe=class extends Dc{constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[Wut]===!0}[Wut]=!0},qut=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),WRe=class extends Dc{constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[qut]===!0}[qut]=!0},Hut=Symbol.for("undici.error.UND_ERR_ABORT"),nse=class extends Dc{constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[Hut]===!0}[Hut]=!0},Vut=Symbol.for("undici.error.UND_ERR_ABORTED"),qRe=class extends nse{constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[Vut]===!0}[Vut]=!0},jut=Symbol.for("undici.error.UND_ERR_INFO"),HRe=class extends Dc{constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[jut]===!0}[jut]=!0},Yut=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),VRe=class extends Dc{constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[Yut]===!0}[Yut]=!0},Kut=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),jRe=class extends Dc{constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[Kut]===!0}[Kut]=!0},zut=Symbol.for("undici.error.UND_ERR_DESTROYED"),YRe=class extends Dc{constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[zut]===!0}[zut]=!0},Jut=Symbol.for("undici.error.UND_ERR_CLOSED"),KRe=class extends Dc{constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[Jut]===!0}[Jut]=!0},Xut=Symbol.for("undici.error.UND_ERR_SOCKET"),zRe=class extends Dc{constructor(e,n){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=n}static[Symbol.hasInstance](e){return e&&e[Xut]===!0}[Xut]=!0},Zut=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),JRe=class extends Dc{constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[Zut]===!0}[Zut]=!0},edt=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),XRe=class extends Dc{constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[edt]===!0}[edt]=!0},tdt=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),ZRe=class extends Error{constructor(e,n,r){super(e),this.name="HTTPParserError",this.code=n?`HPE_${n}`:void 0,this.data=r?r.toString():void 0}static[Symbol.hasInstance](e){return e&&e[tdt]===!0}[tdt]=!0},ndt=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),eke=class extends Dc{constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[ndt]===!0}[ndt]=!0},rdt=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),tke=class extends Dc{constructor(e,n,{headers:r,data:s}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=n,this.data=s,this.headers=r}static[Symbol.hasInstance](e){return e&&e[rdt]===!0}[rdt]=!0},sdt=Symbol.for("undici.error.UND_ERR_RESPONSE"),nke=class extends Dc{constructor(e,n,{headers:r,data:s}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=n,this.data=s,this.headers=r}static[Symbol.hasInstance](e){return e&&e[sdt]===!0}[sdt]=!0},idt=Symbol.for("undici.error.UND_ERR_PRX_TLS"),rke=class extends Dc{constructor(e,n,r){super(n,{cause:e,...r??{}}),this.name="SecureProxyConnectionError",this.message=n||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[idt]===!0}[idt]=!0},odt=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),ske=class extends Dc{constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[odt]===!0}get[odt](){return!0}};adt.exports={AbortError:nse,HTTPParserError:ZRe,UndiciError:Dc,HeadersTimeoutError:FRe,HeadersOverflowError:QRe,BodyTimeoutError:URe,RequestContentLengthMismatchError:VRe,ConnectTimeoutError:LRe,ResponseStatusCodeError:$Re,InvalidArgumentError:GRe,InvalidReturnValueError:WRe,RequestAbortedError:qRe,ClientDestroyedError:YRe,ClientClosedError:KRe,InformationalError:HRe,SocketError:zRe,NotSupportedError:JRe,ResponseContentLengthMismatchError:jRe,BalancedPoolMissingUpstreamError:XRe,ResponseExceededMaxSizeError:eke,RequestRetryError:tke,ResponseError:nke,SecureProxyConnectionError:rke,MessageSizeExceededError:ske}});var sse=ee((KKs,cdt)=>{"use strict";p();var rse={},ike=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let t=0;t{"use strict";p();var{wellknownHeaderNames:ldt,headerNameLowerCasedRecord:UVn}=sse(),oke=class t{value=null;left=null;middle=null;right=null;code;constructor(e,n,r){if(r===void 0||r>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(r))>127)throw new TypeError("key must be ascii string");e.length!==++r?this.middle=new t(e,n,r):this.value=n}add(e,n){let r=e.length;if(r===0)throw new TypeError("Unreachable");let s=0,i=this;for(;;){let o=e.charCodeAt(s);if(o>127)throw new TypeError("key must be ascii string");if(i.code===o)if(r===++s){i.value=n;break}else if(i.middle!==null)i=i.middle;else{i.middle=new t(e,n,s);break}else if(i.code=65&&(i|=32);s!==null;){if(i===s.code){if(n===++r)return s;s=s.middle;break}s=s.code{"use strict";p();var _j=require("node:assert"),{kDestroyed:mdt,kBodyUsed:vQ,kListeners:ake,kBody:hdt}=Nc(),{IncomingMessage:$Vn}=require("node:http"),cse=require("node:stream"),GVn=require("node:net"),{Blob:WVn}=require("node:buffer"),qVn=require("node:util"),{stringify:HVn}=require("node:querystring"),{EventEmitter:VVn}=require("node:events"),{InvalidArgumentError:Bd}=Do(),{headerNameLowerCasedRecord:jVn}=sse(),{tree:fdt}=pdt(),[YVn,KVn]=process.versions.node.split(".").map(t=>Number(t)),ase=class{constructor(e){this[hdt]=e,this[vQ]=!1}async*[Symbol.asyncIterator](){_j(!this[vQ],"disturbed"),this[vQ]=!0,yield*this[hdt]}};function zVn(t){return lse(t)?(bdt(t)===0&&t.on("data",function(){_j(!1)}),typeof t.readableDidRead!="boolean"&&(t[vQ]=!1,VVn.prototype.on.call(t,"data",function(){this[vQ]=!0})),t):t&&typeof t.pipeTo=="function"?new ase(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&Edt(t)?new ase(t):t}function JVn(){}function lse(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}function gdt(t){if(t===null)return!1;if(t instanceof WVn)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}function XVn(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let n=HVn(e);return n&&(t+="?"+n),t}function Adt(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}function ose(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}function ydt(t){if(typeof t=="string"){if(t=new URL(t),!ose(t.origin||t.protocol))throw new Bd("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Bd("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&Adt(t.port)===!1)throw new Bd("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new Bd("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Bd("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Bd("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Bd("Invalid URL origin: the origin must be a string or null/undefined.");if(!ose(t.origin||t.protocol))throw new Bd("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,n=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,r=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return n[n.length-1]==="/"&&(n=n.slice(0,n.length-1)),r&&r[0]!=="/"&&(r=`/${r}`),new URL(`${n}${r}`)}if(!ose(t.origin||t.protocol))throw new Bd("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}function ZVn(t){if(t=ydt(t),t.pathname!=="/"||t.search||t.hash)throw new Bd("invalid url");return t}function ejn(t){if(t[0]==="["){let n=t.indexOf("]");return _j(n!==-1),t.substring(1,n)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}function tjn(t){if(!t)return null;_j(typeof t=="string");let e=ejn(t);return GVn.isIP(e)?"":e}function njn(t){return JSON.parse(JSON.stringify(t))}function rjn(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}function Edt(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}function bdt(t){if(t==null)return 0;if(lse(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(gdt(t))return t.size!=null?t.size:null;if(Cdt(t))return t.byteLength}return null}function _dt(t){return t&&!!(t.destroyed||t[mdt]||cse.isDestroyed?.(t))}function sjn(t,e){t==null||!lse(t)||_dt(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===$Vn&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[mdt]=!0))}var ijn=/timeout=(\d+)/;function ojn(t){let e=t.toString().match(ijn);return e?parseInt(e[1],10)*1e3:null}function Sdt(t){return typeof t=="string"?jVn[t]??t.toLowerCase():fdt.lookup(t)??t.toString("latin1").toLowerCase()}function ajn(t){return fdt.lookup(t)??t.toString("latin1").toLowerCase()}function cjn(t,e){e===void 0&&(e={});for(let n=0;no.toString("utf8")):i.toString("utf8")}}return"content-length"in e&&"content-disposition"in e&&(e["content-disposition"]=Buffer.from(e["content-disposition"]).toString("latin1")),e}function ljn(t){let e=t.length,n=new Array(e),r=!1,s=-1,i,o,a=0;for(let c=0;c{n.close(),n.byobRequest?.respond(0)});else{let i=Buffer.isBuffer(s)?s:Buffer.from(s);i.byteLength&&n.enqueue(new Uint8Array(i))}return n.desiredSize>0},async cancel(n){await e.return()},type:"bytes"})}function gjn(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}function Ajn(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.addListener("abort",e),()=>t.removeListener("abort",e))}var yjn=typeof String.prototype.toWellFormed=="function",Ejn=typeof String.prototype.isWellFormed=="function";function Idt(t){return yjn?`${t}`.toWellFormed():qVn.toUSVString(t)}function bjn(t){return Ejn?`${t}`.isWellFormed():Idt(t)===`${t}`}function xdt(t){switch(t){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return t>=33&&t<=126}}function _jn(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var zo=require("node:diagnostics_channel"),uke=require("node:util"),use=uke.debuglog("undici"),lke=uke.debuglog("fetch"),T1=uke.debuglog("websocket"),Rdt=!1,vjn={beforeConnect:zo.channel("undici:client:beforeConnect"),connected:zo.channel("undici:client:connected"),connectError:zo.channel("undici:client:connectError"),sendHeaders:zo.channel("undici:client:sendHeaders"),create:zo.channel("undici:request:create"),bodySent:zo.channel("undici:request:bodySent"),headers:zo.channel("undici:request:headers"),trailers:zo.channel("undici:request:trailers"),error:zo.channel("undici:request:error"),open:zo.channel("undici:websocket:open"),close:zo.channel("undici:websocket:close"),socketError:zo.channel("undici:websocket:socket_error"),ping:zo.channel("undici:websocket:ping"),pong:zo.channel("undici:websocket:pong")};if(use.enabled||lke.enabled){let t=lke.enabled?lke:use;zo.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:s,host:i}}=e;t("connecting to %s using %s%s",`${i}${s?`:${s}`:""}`,r,n)}),zo.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:s,host:i}}=e;t("connected to %s using %s%s",`${i}${s?`:${s}`:""}`,r,n)}),zo.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:s,host:i},error:o}=e;t("connection to %s using %s%s errored - %s",`${i}${s?`:${s}`:""}`,r,n,o.message)}),zo.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:n,path:r,origin:s}}=e;t("sending request to %s %s/%s",n,s,r)}),zo.channel("undici:request:headers").subscribe(e=>{let{request:{method:n,path:r,origin:s},response:{statusCode:i}}=e;t("received response to %s %s/%s - HTTP %d",n,s,r,i)}),zo.channel("undici:request:trailers").subscribe(e=>{let{request:{method:n,path:r,origin:s}}=e;t("trailers received from %s %s/%s",n,s,r)}),zo.channel("undici:request:error").subscribe(e=>{let{request:{method:n,path:r,origin:s},error:i}=e;t("request to %s %s/%s errored - %s",n,s,r,i.message)}),Rdt=!0}if(T1.enabled){if(!Rdt){let t=use.enabled?use:T1;zo.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:s,host:i}}=e;t("connecting to %s%s using %s%s",i,s?`:${s}`:"",r,n)}),zo.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:s,host:i}}=e;t("connected to %s%s using %s%s",i,s?`:${s}`:"",r,n)}),zo.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:s,host:i},error:o}=e;t("connection to %s%s using %s%s errored - %s",i,s?`:${s}`:"",r,n,o.message)}),zo.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:n,path:r,origin:s}}=e;t("sending request to %s %s/%s",n,s,r)})}zo.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:n}}=t;T1("connection opened %s%s",e,n?`:${n}`:"")}),zo.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:n,reason:r}=t;T1("closed connection to %s - %s %s",e.url,n,r)}),zo.channel("undici:websocket:socket_error").subscribe(t=>{T1("connection errored - %s",t.message)}),zo.channel("undici:websocket:ping").subscribe(t=>{T1("ping received")}),zo.channel("undici:websocket:pong").subscribe(t=>{T1("pong received")})}kdt.exports={channels:vjn}});var Pdt=ee((rzs,Bdt)=>{"use strict";p();var{InvalidArgumentError:Wa,NotSupportedError:Rjn}=Do(),sx=require("node:assert"),{isValidHTTPToken:Ddt,isValidHeaderValue:dke,isStream:kjn,destroy:Njn,isBuffer:Djn,isFormDataLike:Bjn,isIterable:Pjn,isBlobLike:Ojn,buildURL:Mjn,validateHandler:Ljn,getServerName:Fjn,normalizedMethodRecords:Qjn}=Wi(),{channels:Z0}=RQ(),{headerNameLowerCasedRecord:Ndt}=sse(),Ujn=/[^\u0021-\u00ff]/,Dy=Symbol("handler"),pke=class{constructor(e,{path:n,method:r,body:s,headers:i,query:o,idempotent:a,blocking:c,upgrade:u,headersTimeout:l,bodyTimeout:d,reset:h,throwOnError:m,expectContinue:f,servername:g},A){if(typeof n!="string")throw new Wa("path must be a string");if(n[0]!=="/"&&!(n.startsWith("http://")||n.startsWith("https://"))&&r!=="CONNECT")throw new Wa("path must be an absolute URL or start with a slash");if(Ujn.test(n))throw new Wa("invalid request path");if(typeof r!="string")throw new Wa("method must be a string");if(Qjn[r]===void 0&&!Ddt(r))throw new Wa("invalid request method");if(u&&typeof u!="string")throw new Wa("upgrade must be a string");if(u&&!dke(u))throw new Wa("invalid upgrade header");if(l!=null&&(!Number.isFinite(l)||l<0))throw new Wa("invalid headersTimeout");if(d!=null&&(!Number.isFinite(d)||d<0))throw new Wa("invalid bodyTimeout");if(h!=null&&typeof h!="boolean")throw new Wa("invalid reset");if(f!=null&&typeof f!="boolean")throw new Wa("invalid expectContinue");if(this.headersTimeout=l,this.bodyTimeout=d,this.throwOnError=m===!0,this.method=r,this.abort=null,s==null)this.body=null;else if(kjn(s)){this.body=s;let y=this.body._readableState;(!y||!y.autoDestroy)&&(this.endHandler=function(){Njn(this)},this.body.on("end",this.endHandler)),this.errorHandler=b=>{this.abort?this.abort(b):this.error=b},this.body.on("error",this.errorHandler)}else if(Djn(s))this.body=s.byteLength?s:null;else if(ArrayBuffer.isView(s))this.body=s.buffer.byteLength?Buffer.from(s.buffer,s.byteOffset,s.byteLength):null;else if(s instanceof ArrayBuffer)this.body=s.byteLength?Buffer.from(s):null;else if(typeof s=="string")this.body=s.length?Buffer.from(s):null;else if(Bjn(s)||Pjn(s)||Ojn(s))this.body=s;else throw new Wa("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=u||null,this.path=o?Mjn(n,o):n,this.origin=e,this.idempotent=a??(r==="HEAD"||r==="GET"),this.blocking=c??!1,this.reset=h??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=f??!1,Array.isArray(i)){if(i.length%2!==0)throw new Wa("headers array must be even");for(let y=0;y{"use strict";p();var $jn=require("node:events"),pse=class extends $jn{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let n=Array.isArray(e[0])?e[0]:e,r=this.dispatch.bind(this);for(let s of n)if(s!=null){if(typeof s!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof s}`);if(r=s(r),r==null||typeof r!="function"||r.length!==2)throw new TypeError("invalid interceptor")}return new hke(this,r)}},hke=class extends pse{#e=null;#t=null;constructor(e,n){super(),this.#e=e,this.#t=n}dispatch(...e){this.#t(...e)}close(...e){return this.#e.close(...e)}destroy(...e){return this.#e.destroy(...e)}};Odt.exports=pse});var BQ=ee((azs,Mdt)=>{"use strict";p();var Gjn=Sj(),{ClientDestroyedError:mke,ClientClosedError:Wjn,InvalidArgumentError:kQ}=Do(),{kDestroy:qjn,kClose:Hjn,kClosed:Cj,kDestroyed:NQ,kDispatch:fke,kInterceptors:v1}=Nc(),ix=Symbol("onDestroyed"),DQ=Symbol("onClosed"),hse=Symbol("Intercepted Dispatch"),gke=Symbol("webSocketOptions"),Ake=class extends Gjn{constructor(e){super(),this[NQ]=!1,this[ix]=null,this[Cj]=!1,this[DQ]=[],this[gke]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[gke].maxFragments??131072,maxPayloadSize:this[gke].maxPayloadSize??128*1024*1024}}get destroyed(){return this[NQ]}get closed(){return this[Cj]}get interceptors(){return this[v1]}set interceptors(e){if(e){for(let n=e.length-1;n>=0;n--)if(typeof this[v1][n]!="function")throw new kQ("interceptor must be an function")}this[v1]=e}close(e){if(e===void 0)return new Promise((r,s)=>{this.close((i,o)=>i?s(i):r(o))});if(typeof e!="function")throw new kQ("invalid callback");if(this[NQ]){queueMicrotask(()=>e(new mke,null));return}if(this[Cj]){this[DQ]?this[DQ].push(e):queueMicrotask(()=>e(null,null));return}this[Cj]=!0,this[DQ].push(e);let n=()=>{let r=this[DQ];this[DQ]=null;for(let s=0;sthis.destroy()).then(()=>{queueMicrotask(n)})}destroy(e,n){if(typeof e=="function"&&(n=e,e=null),n===void 0)return new Promise((s,i)=>{this.destroy(e,(o,a)=>o?i(o):s(a))});if(typeof n!="function")throw new kQ("invalid callback");if(this[NQ]){this[ix]?this[ix].push(n):queueMicrotask(()=>n(null,null));return}e||(e=new mke),this[NQ]=!0,this[ix]=this[ix]||[],this[ix].push(n);let r=()=>{let s=this[ix];this[ix]=null;for(let i=0;i{queueMicrotask(r)})}[hse](e,n){if(!this[v1]||this[v1].length===0)return this[hse]=this[fke],this[fke](e,n);let r=this[fke].bind(this);for(let s=this[v1].length-1;s>=0;s--)r=this[v1][s](r);return this[hse]=r,r(e,n)}dispatch(e,n){if(!n||typeof n!="object")throw new kQ("handler must be an object");try{if(!e||typeof e!="object")throw new kQ("opts must be an object.");if(this[NQ]||this[ix])throw new mke;if(this[Cj])throw new Wjn;return this[hse](e,n)}catch(r){if(typeof n.onError!="function")throw new kQ("invalid onError method");return n.onError(r),!1}}};Mdt.exports=Ake});var Ike=ee((lzs,Udt)=>{"use strict";p();var PQ=0,yke=1e3,Eke=(yke>>1)-1,ox,bke=Symbol("kFastTimer"),ax=[],_ke=-2,Ske=-1,Fdt=0,Ldt=1;function Cke(){PQ+=Eke;let t=0,e=ax.length;for(;t=n._idleStart+n._idleTimeout&&(n._state=Ske,n._idleStart=-1,n._onTimeout(n._timerArg)),n._state===Ske?(n._state=_ke,--e!==0&&(ax[t]=ax[e])):++t}ax.length=e,ax.length!==0&&Qdt()}function Qdt(){ox?ox.refresh():(clearTimeout(ox),ox=setTimeout(Cke,Eke),ox.unref&&ox.unref())}var mse=class{[bke]=!0;_state=_ke;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,n,r){this._onTimeout=e,this._idleTimeout=n,this._timerArg=r,this.refresh()}refresh(){this._state===_ke&&ax.push(this),(!ox||ax.length===1)&&Qdt(),this._state=Fdt}clear(){this._state=Ske,this._idleStart=-1}};Udt.exports={setTimeout(t,e,n){return e<=yke?setTimeout(t,e,n):new mse(t,e,n)},clearTimeout(t){t[bke]?t.clear():clearTimeout(t)},setFastTimeout(t,e,n){return new mse(t,e,n)},clearFastTimeout(t){t.clear()},now(){return PQ},tick(t=0){PQ+=t-yke+1,Cke(),Cke()},reset(){PQ=0,ax.length=0,clearTimeout(ox),ox=null},kFastTimer:bke}});var Ij=ee((hzs,Hdt)=>{"use strict";p();var Vjn=require("node:net"),$dt=require("node:assert"),qdt=Wi(),{InvalidArgumentError:jjn,ConnectTimeoutError:Yjn}=Do(),fse=Ike();function Gdt(){}var xke,wke;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?wke=class{constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(n=>{if(this._sessionCache.size=this._maxCachedSessions){let{value:r}=this._sessionCache.keys().next();this._sessionCache.delete(r)}this._sessionCache.set(e,n)}}};function Kjn({allowH2:t,maxCachedSessions:e,socketPath:n,timeout:r,session:s,...i}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new jjn("maxCachedSessions must be a positive integer or zero");let o={path:n,...i},a=new wke(e??100);return r=r??1e4,t=t??!1,function({hostname:u,host:l,protocol:d,port:h,servername:m,localAddress:f,httpSocket:g},A){let y;if(d==="https:"){xke||(xke=require("node:tls")),m=m||o.servername||qdt.getServerName(l)||null;let S=m||u;$dt(S);let C=s||a.get(S)||null;h=h||443,y=xke.connect({highWaterMark:16384,...o,servername:m,session:C,localAddress:f,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:g,port:h,host:u}),y.on("session",function(I){a.set(S,I)})}else $dt(!g,"httpSocket can only be sent on TLS update"),h=h||80,y=Vjn.connect({highWaterMark:64*1024,...o,localAddress:f,port:h,host:u});if(o.keepAlive==null||o.keepAlive){let S=o.keepAliveInitialDelay===void 0?6e4:o.keepAliveInitialDelay;y.setKeepAlive(!0,S)}let b=zjn(new WeakRef(y),{timeout:r,hostname:u,port:h});return y.setNoDelay(!0).once(d==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(b),A){let S=A;A=null,S(null,this)}}).on("error",function(S){if(queueMicrotask(b),A){let C=A;A=null,C(S)}}),y}}var zjn=process.platform==="win32"?(t,e)=>{if(!e.timeout)return Gdt;let n=null,r=null,s=fse.setFastTimeout(()=>{n=setImmediate(()=>{r=setImmediate(()=>Wdt(t.deref(),e))})},e.timeout);return()=>{fse.clearFastTimeout(s),clearImmediate(n),clearImmediate(r)}}:(t,e)=>{if(!e.timeout)return Gdt;let n=null,r=fse.setFastTimeout(()=>{n=setImmediate(()=>{Wdt(t.deref(),e)})},e.timeout);return()=>{fse.clearFastTimeout(r),clearImmediate(n)}};function Wdt(t,e){if(t==null)return;let n="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?n+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:n+=` (attempted address: ${e.hostname}:${e.port},`,n+=` timeout: ${e.timeout}ms)`,qdt.destroy(t,new Yjn(n))}Hdt.exports=Kjn});var Vdt=ee(gse=>{"use strict";p();Object.defineProperty(gse,"__esModule",{value:!0});gse.enumToMap=void 0;function Jjn(t){let e={};return Object.keys(t).forEach(n=>{let r=t[n];typeof r=="number"&&(e[n]=r)}),e}gse.enumToMap=Jjn});var jdt=ee(kn=>{"use strict";p();Object.defineProperty(kn,"__esModule",{value:!0});kn.SPECIAL_HEADERS=kn.HEADER_STATE=kn.MINOR=kn.MAJOR=kn.CONNECTION_TOKEN_CHARS=kn.HEADER_CHARS=kn.TOKEN=kn.STRICT_TOKEN=kn.HEX=kn.URL_CHAR=kn.STRICT_URL_CHAR=kn.USERINFO_CHARS=kn.MARK=kn.ALPHANUM=kn.NUM=kn.HEX_MAP=kn.NUM_MAP=kn.ALPHA=kn.FINISH=kn.H_METHOD_MAP=kn.METHOD_MAP=kn.METHODS_RTSP=kn.METHODS_ICE=kn.METHODS_HTTP=kn.METHODS=kn.LENIENT_FLAGS=kn.FLAGS=kn.TYPE=kn.ERROR=void 0;var Xjn=Vdt(),Zjn;(function(t){t[t.OK=0]="OK",t[t.INTERNAL=1]="INTERNAL",t[t.STRICT=2]="STRICT",t[t.LF_EXPECTED=3]="LF_EXPECTED",t[t.UNEXPECTED_CONTENT_LENGTH=4]="UNEXPECTED_CONTENT_LENGTH",t[t.CLOSED_CONNECTION=5]="CLOSED_CONNECTION",t[t.INVALID_METHOD=6]="INVALID_METHOD",t[t.INVALID_URL=7]="INVALID_URL",t[t.INVALID_CONSTANT=8]="INVALID_CONSTANT",t[t.INVALID_VERSION=9]="INVALID_VERSION",t[t.INVALID_HEADER_TOKEN=10]="INVALID_HEADER_TOKEN",t[t.INVALID_CONTENT_LENGTH=11]="INVALID_CONTENT_LENGTH",t[t.INVALID_CHUNK_SIZE=12]="INVALID_CHUNK_SIZE",t[t.INVALID_STATUS=13]="INVALID_STATUS",t[t.INVALID_EOF_STATE=14]="INVALID_EOF_STATE",t[t.INVALID_TRANSFER_ENCODING=15]="INVALID_TRANSFER_ENCODING",t[t.CB_MESSAGE_BEGIN=16]="CB_MESSAGE_BEGIN",t[t.CB_HEADERS_COMPLETE=17]="CB_HEADERS_COMPLETE",t[t.CB_MESSAGE_COMPLETE=18]="CB_MESSAGE_COMPLETE",t[t.CB_CHUNK_HEADER=19]="CB_CHUNK_HEADER",t[t.CB_CHUNK_COMPLETE=20]="CB_CHUNK_COMPLETE",t[t.PAUSED=21]="PAUSED",t[t.PAUSED_UPGRADE=22]="PAUSED_UPGRADE",t[t.PAUSED_H2_UPGRADE=23]="PAUSED_H2_UPGRADE",t[t.USER=24]="USER"})(Zjn=kn.ERROR||(kn.ERROR={}));var eYn;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(eYn=kn.TYPE||(kn.TYPE={}));var tYn;(function(t){t[t.CONNECTION_KEEP_ALIVE=1]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=2]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=4]="CONNECTION_UPGRADE",t[t.CHUNKED=8]="CHUNKED",t[t.UPGRADE=16]="UPGRADE",t[t.CONTENT_LENGTH=32]="CONTENT_LENGTH",t[t.SKIPBODY=64]="SKIPBODY",t[t.TRAILING=128]="TRAILING",t[t.TRANSFER_ENCODING=512]="TRANSFER_ENCODING"})(tYn=kn.FLAGS||(kn.FLAGS={}));var nYn;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(nYn=kn.LENIENT_FLAGS||(kn.LENIENT_FLAGS={}));var ps;(function(t){t[t.DELETE=0]="DELETE",t[t.GET=1]="GET",t[t.HEAD=2]="HEAD",t[t.POST=3]="POST",t[t.PUT=4]="PUT",t[t.CONNECT=5]="CONNECT",t[t.OPTIONS=6]="OPTIONS",t[t.TRACE=7]="TRACE",t[t.COPY=8]="COPY",t[t.LOCK=9]="LOCK",t[t.MKCOL=10]="MKCOL",t[t.MOVE=11]="MOVE",t[t.PROPFIND=12]="PROPFIND",t[t.PROPPATCH=13]="PROPPATCH",t[t.SEARCH=14]="SEARCH",t[t.UNLOCK=15]="UNLOCK",t[t.BIND=16]="BIND",t[t.REBIND=17]="REBIND",t[t.UNBIND=18]="UNBIND",t[t.ACL=19]="ACL",t[t.REPORT=20]="REPORT",t[t.MKACTIVITY=21]="MKACTIVITY",t[t.CHECKOUT=22]="CHECKOUT",t[t.MERGE=23]="MERGE",t[t["M-SEARCH"]=24]="M-SEARCH",t[t.NOTIFY=25]="NOTIFY",t[t.SUBSCRIBE=26]="SUBSCRIBE",t[t.UNSUBSCRIBE=27]="UNSUBSCRIBE",t[t.PATCH=28]="PATCH",t[t.PURGE=29]="PURGE",t[t.MKCALENDAR=30]="MKCALENDAR",t[t.LINK=31]="LINK",t[t.UNLINK=32]="UNLINK",t[t.SOURCE=33]="SOURCE",t[t.PRI=34]="PRI",t[t.DESCRIBE=35]="DESCRIBE",t[t.ANNOUNCE=36]="ANNOUNCE",t[t.SETUP=37]="SETUP",t[t.PLAY=38]="PLAY",t[t.PAUSE=39]="PAUSE",t[t.TEARDOWN=40]="TEARDOWN",t[t.GET_PARAMETER=41]="GET_PARAMETER",t[t.SET_PARAMETER=42]="SET_PARAMETER",t[t.REDIRECT=43]="REDIRECT",t[t.RECORD=44]="RECORD",t[t.FLUSH=45]="FLUSH"})(ps=kn.METHODS||(kn.METHODS={}));kn.METHODS_HTTP=[ps.DELETE,ps.GET,ps.HEAD,ps.POST,ps.PUT,ps.CONNECT,ps.OPTIONS,ps.TRACE,ps.COPY,ps.LOCK,ps.MKCOL,ps.MOVE,ps.PROPFIND,ps.PROPPATCH,ps.SEARCH,ps.UNLOCK,ps.BIND,ps.REBIND,ps.UNBIND,ps.ACL,ps.REPORT,ps.MKACTIVITY,ps.CHECKOUT,ps.MERGE,ps["M-SEARCH"],ps.NOTIFY,ps.SUBSCRIBE,ps.UNSUBSCRIBE,ps.PATCH,ps.PURGE,ps.MKCALENDAR,ps.LINK,ps.UNLINK,ps.PRI,ps.SOURCE];kn.METHODS_ICE=[ps.SOURCE];kn.METHODS_RTSP=[ps.OPTIONS,ps.DESCRIBE,ps.ANNOUNCE,ps.SETUP,ps.PLAY,ps.PAUSE,ps.TEARDOWN,ps.GET_PARAMETER,ps.SET_PARAMETER,ps.REDIRECT,ps.RECORD,ps.FLUSH,ps.GET,ps.POST];kn.METHOD_MAP=Xjn.enumToMap(ps);kn.H_METHOD_MAP={};Object.keys(kn.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(kn.H_METHOD_MAP[t]=kn.METHOD_MAP[t])});var rYn;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(rYn=kn.FINISH||(kn.FINISH={}));kn.ALPHA=[];for(let t=65;t<=90;t++)kn.ALPHA.push(String.fromCharCode(t)),kn.ALPHA.push(String.fromCharCode(t+32));kn.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};kn.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};kn.NUM=["0","1","2","3","4","5","6","7","8","9"];kn.ALPHANUM=kn.ALPHA.concat(kn.NUM);kn.MARK=["-","_",".","!","~","*","'","(",")"];kn.USERINFO_CHARS=kn.ALPHANUM.concat(kn.MARK).concat(["%",";",":","&","=","+","$",","]);kn.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(kn.ALPHANUM);kn.URL_CHAR=kn.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)kn.URL_CHAR.push(t);kn.HEX=kn.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);kn.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(kn.ALPHANUM);kn.TOKEN=kn.STRICT_TOKEN.concat([" "]);kn.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&kn.HEADER_CHARS.push(t);kn.CONNECTION_TOKEN_CHARS=kn.HEADER_CHARS.filter(t=>t!==44);kn.MAJOR=kn.NUM_MAP;kn.MINOR=kn.MAJOR;var OQ;(function(t){t[t.GENERAL=0]="GENERAL",t[t.CONNECTION=1]="CONNECTION",t[t.CONTENT_LENGTH=2]="CONTENT_LENGTH",t[t.TRANSFER_ENCODING=3]="TRANSFER_ENCODING",t[t.UPGRADE=4]="UPGRADE",t[t.CONNECTION_KEEP_ALIVE=5]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=6]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=7]="CONNECTION_UPGRADE",t[t.TRANSFER_ENCODING_CHUNKED=8]="TRANSFER_ENCODING_CHUNKED"})(OQ=kn.HEADER_STATE||(kn.HEADER_STATE={}));kn.SPECIAL_HEADERS={connection:OQ.CONNECTION,"content-length":OQ.CONTENT_LENGTH,"proxy-connection":OQ.CONNECTION,"transfer-encoding":OQ.TRANSFER_ENCODING,upgrade:OQ.UPGRADE}});var Tke=ee((Ezs,Ydt)=>{"use strict";p();var{Buffer:sYn}=require("node:buffer");Ydt.exports=sYn.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv","base64")});var zdt=ee((_zs,Kdt)=>{"use strict";p();var{Buffer:iYn}=require("node:buffer");Kdt.exports=iYn.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==","base64")});var xj=ee((Czs,spt)=>{"use strict";p();var Jdt=["GET","HEAD","POST"],oYn=new Set(Jdt),aYn=[101,204,205,304],Xdt=[301,302,303,307,308],cYn=new Set(Xdt),Zdt=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],lYn=new Set(Zdt),ept=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],uYn=new Set(ept),dYn=["follow","manual","error"],tpt=["GET","HEAD","OPTIONS","TRACE"],pYn=new Set(tpt),hYn=["navigate","same-origin","no-cors","cors"],mYn=["omit","same-origin","include"],fYn=["default","no-store","reload","no-cache","force-cache","only-if-cached"],gYn=["content-encoding","content-language","content-location","content-type","content-length"],AYn=["half"],npt=["CONNECT","TRACE","TRACK"],yYn=new Set(npt),rpt=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],EYn=new Set(rpt);spt.exports={subresource:rpt,forbiddenMethods:npt,requestBodyHeader:gYn,referrerPolicy:ept,requestRedirect:dYn,requestMode:hYn,requestCredentials:mYn,requestCache:fYn,redirectStatus:Xdt,corsSafeListedMethods:Jdt,nullBodyStatus:aYn,safeMethods:tpt,badPorts:Zdt,requestDuplex:AYn,subresourceSet:EYn,badPortsSet:lYn,redirectStatusSet:cYn,corsSafeListedMethodsSet:oYn,safeMethodsSet:pYn,forbiddenMethodsSet:yYn,referrerPolicySet:uYn}});var Rke=ee((xzs,ipt)=>{"use strict";p();var vke=Symbol.for("undici.globalOrigin.1");function bYn(){return globalThis[vke]}function _Yn(t){if(t===void 0){Object.defineProperty(globalThis,vke,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,vke,{value:e,writable:!0,enumerable:!1,configurable:!1})}ipt.exports={getGlobalOrigin:bYn,setGlobalOrigin:_Yn}});var yf=ee((Tzs,ppt)=>{"use strict";p();var yse=require("node:assert"),SYn=new TextEncoder,wj=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,CYn=/[\u000A\u000D\u0009\u0020]/,IYn=/[\u0009\u000A\u000C\u000D\u0020]/g,xYn=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function wYn(t){yse(t.protocol==="data:");let e=cpt(t,!0);e=e.slice(5);let n={position:0},r=MQ(",",e,n),s=r.length;if(r=DYn(r,!0,!0),n.position>=e.length)return"failure";n.position++;let i=e.slice(s+1),o=lpt(i);if(/;(\u0020){0,}base64$/i.test(r)){let c=dpt(o);if(o=vYn(c),o==="failure")return"failure";r=r.slice(0,-6),r=r.replace(/(\u0020)+$/,""),r=r.slice(0,-1)}r.startsWith(";")&&(r="text/plain"+r);let a=kke(r);return a==="failure"&&(a=kke("text/plain;charset=US-ASCII")),{mimeType:a,body:o}}function cpt(t,e=!1){if(!e)return t.href;let n=t.href,r=t.hash.length,s=r===0?n:n.substring(0,n.length-r);return!r&&n.endsWith("#")?s.slice(0,-1):s}function Ese(t,e,n){let r="";for(;n.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function apt(t){return t>=48&&t<=57?t-48:(t&223)-55}function TYn(t){let e=t.length,n=new Uint8Array(e),r=0;for(let s=0;st.length)return"failure";e.position++;let r=MQ(";",t,e);if(r=Ase(r,!1,!0),r.length===0||!wj.test(r))return"failure";let s=n.toLowerCase(),i=r.toLowerCase(),o={type:s,subtype:i,parameters:new Map,essence:`${s}/${i}`};for(;e.positionCYn.test(u),t,e);let a=Ese(u=>u!==";"&&u!=="=",t,e);if(a=a.toLowerCase(),e.positiont.length)break;let c=null;if(t[e.position]==='"')c=upt(t,e,!0),MQ(";",t,e);else if(c=MQ(";",t,e),c=Ase(c,!1,!0),c.length===0)continue;a.length!==0&&wj.test(a)&&(c.length===0||xYn.test(c))&&!o.parameters.has(a)&&o.parameters.set(a,c)}return o}function vYn(t){t=t.replace(IYn,"");let e=t.length;if(e%4===0&&t.charCodeAt(e-1)===61&&(--e,t.charCodeAt(e-1)===61&&--e),e%4===1||/[^+/0-9A-Za-z]/.test(t.length===e?t:t.substring(0,e)))return"failure";let n=Buffer.from(t,"base64");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}function upt(t,e,n){let r=e.position,s="";for(yse(t[e.position]==='"'),e.position++;s+=Ese(o=>o!=='"'&&o!=="\\",t,e),!(e.position>=t.length);){let i=t[e.position];if(e.position++,i==="\\"){if(e.position>=t.length){s+="\\";break}s+=t[e.position],e.position++}else{yse(i==='"');break}}return n?s:t.slice(r,e.position)}function RYn(t){yse(t!=="failure");let{parameters:e,essence:n}=t,r=n;for(let[s,i]of e.entries())r+=";",r+=s,r+="=",wj.test(i)||(i=i.replace(/(\\|")/g,"\\$1"),i='"'+i,i+='"'),r+=i;return r}function kYn(t){return t===13||t===10||t===9||t===32}function Ase(t,e=!0,n=!0){return Nke(t,e,n,kYn)}function NYn(t){return t===13||t===10||t===9||t===12||t===32}function DYn(t,e=!0,n=!0){return Nke(t,e,n,NYn)}function Nke(t,e,n,r){let s=0,i=t.length-1;if(e)for(;s0&&r(t.charCodeAt(i));)i--;return s===0&&i===t.length-1?t:t.slice(s,i+1)}function dpt(t){let e=t.length;if(65535>e)return String.fromCharCode.apply(null,t);let n="",r=0,s=65535;for(;re&&(s=e-r),n+=String.fromCharCode.apply(null,t.subarray(r,r+=s));return n}function BYn(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}ppt.exports={dataURLProcessor:wYn,URLSerializer:cpt,collectASequenceOfCodePoints:Ese,collectASequenceOfCodePointsFast:MQ,stringPercentDecode:lpt,parseMIMEType:kke,collectAnHTTPQuotedString:upt,serializeAMimeType:RYn,removeChars:Nke,removeHTTPWhitespace:Ase,minimizeSupportedMimeType:BYn,HTTP_TOKEN_CODEPOINTS:wj,isomorphicDecode:dpt}});var Cp=ee((Rzs,hpt)=>{"use strict";p();var{types:eS,inspect:PYn}=require("node:util"),{markAsUncloneable:OYn}=require("node:worker_threads"),{toUSVString:MYn}=Wi(),vn={};vn.converters={};vn.util={};vn.errors={};vn.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};vn.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",n=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return vn.errors.exception({header:t.prefix,message:n})};vn.errors.invalidArgument=function(t){return vn.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};vn.brandCheck=function(t,e,n){if(n?.strict!==!1){if(!(t instanceof e)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}}else if(t?.[Symbol.toStringTag]!==e.prototype[Symbol.toStringTag]){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};vn.argumentLengthCheck=function({length:t},e,n){if(t{});vn.util.ConvertToInt=function(t,e,n,r){let s,i;e===64?(s=Math.pow(2,53)-1,n==="unsigned"?i=0:i=Math.pow(-2,53)+1):n==="unsigned"?(i=0,s=Math.pow(2,e)-1):(i=Math.pow(-2,e)-1,s=Math.pow(2,e-1)-1);let o=Number(t);if(o===0&&(o=0),r?.enforceRange===!0){if(Number.isNaN(o)||o===Number.POSITIVE_INFINITY||o===Number.NEGATIVE_INFINITY)throw vn.errors.exception({header:"Integer conversion",message:`Could not convert ${vn.util.Stringify(t)} to an integer.`});if(o=vn.util.IntegerPart(o),os)throw vn.errors.exception({header:"Integer conversion",message:`Value must be between ${i}-${s}, got ${o}.`});return o}return!Number.isNaN(o)&&r?.clamp===!0?(o=Math.min(Math.max(o,i),s),Math.floor(o)%2===0?o=Math.floor(o):o=Math.ceil(o),o):Number.isNaN(o)||o===0&&Object.is(0,o)||o===Number.POSITIVE_INFINITY||o===Number.NEGATIVE_INFINITY?0:(o=vn.util.IntegerPart(o),o=o%Math.pow(2,e),n==="signed"&&o>=Math.pow(2,e)-1?o-Math.pow(2,e):o)};vn.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};vn.util.Stringify=function(t){switch(vn.util.Type(t)){case"Symbol":return`Symbol(${t.description})`;case"Object":return PYn(t);case"String":return`"${t}"`;default:return`${t}`}};vn.sequenceConverter=function(t){return(e,n,r,s)=>{if(vn.util.Type(e)!=="Object")throw vn.errors.exception({header:n,message:`${r} (${vn.util.Stringify(e)}) is not iterable.`});let i=typeof s=="function"?s():e?.[Symbol.iterator]?.(),o=[],a=0;if(i===void 0||typeof i.next!="function")throw vn.errors.exception({header:n,message:`${r} is not iterable.`});for(;;){let{done:c,value:u}=i.next();if(c)break;o.push(t(u,n,`${r}[${a++}]`))}return o}};vn.recordConverter=function(t,e){return(n,r,s)=>{if(vn.util.Type(n)!=="Object")throw vn.errors.exception({header:r,message:`${s} ("${vn.util.Type(n)}") is not an Object.`});let i={};if(!eS.isProxy(n)){let a=[...Object.getOwnPropertyNames(n),...Object.getOwnPropertySymbols(n)];for(let c of a){let u=t(c,r,s),l=e(n[c],r,s);i[u]=l}return i}let o=Reflect.ownKeys(n);for(let a of o)if(Reflect.getOwnPropertyDescriptor(n,a)?.enumerable){let u=t(a,r,s),l=e(n[a],r,s);i[u]=l}return i}};vn.interfaceConverter=function(t){return(e,n,r,s)=>{if(s?.strict!==!1&&!(e instanceof t))throw vn.errors.exception({header:n,message:`Expected ${r} ("${vn.util.Stringify(e)}") to be an instance of ${t.name}.`});return e}};vn.dictionaryConverter=function(t){return(e,n,r)=>{let s=vn.util.Type(e),i={};if(s==="Null"||s==="Undefined")return i;if(s!=="Object")throw vn.errors.exception({header:n,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let o of t){let{key:a,defaultValue:c,required:u,converter:l}=o;if(u===!0&&!Object.hasOwn(e,a))throw vn.errors.exception({header:n,message:`Missing required key "${a}".`});let d=e[a],h=Object.hasOwn(o,"defaultValue");if(h&&d!==null&&(d??=c()),u||h||d!==void 0){if(d=l(d,n,`${r}.${a}`),o.allowedValues&&!o.allowedValues.includes(d))throw vn.errors.exception({header:n,message:`${d} is not an accepted type. Expected one of ${o.allowedValues.join(", ")}.`});i[a]=d}}return i}};vn.nullableConverter=function(t){return(e,n,r)=>e===null?e:t(e,n,r)};vn.converters.DOMString=function(t,e,n,r){if(t===null&&r?.legacyNullToEmptyString)return"";if(typeof t=="symbol")throw vn.errors.exception({header:e,message:`${n} is a symbol, which cannot be converted to a DOMString.`});return String(t)};vn.converters.ByteString=function(t,e,n){let r=vn.converters.DOMString(t,e,n);for(let s=0;s255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${s} has a value of ${r.charCodeAt(s)} which is greater than 255.`);return r};vn.converters.USVString=MYn;vn.converters.boolean=function(t){return!!t};vn.converters.any=function(t){return t};vn.converters["long long"]=function(t,e,n){return vn.util.ConvertToInt(t,64,"signed",void 0,e,n)};vn.converters["unsigned long long"]=function(t,e,n){return vn.util.ConvertToInt(t,64,"unsigned",void 0,e,n)};vn.converters["unsigned long"]=function(t,e,n){return vn.util.ConvertToInt(t,32,"unsigned",void 0,e,n)};vn.converters["unsigned short"]=function(t,e,n,r){return vn.util.ConvertToInt(t,16,"unsigned",r,e,n)};vn.converters.ArrayBuffer=function(t,e,n,r){if(vn.util.Type(t)!=="Object"||!eS.isAnyArrayBuffer(t))throw vn.errors.conversionFailed({prefix:e,argument:`${n} ("${vn.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(r?.allowShared===!1&&eS.isSharedArrayBuffer(t))throw vn.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.resizable||t.growable)throw vn.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};vn.converters.TypedArray=function(t,e,n,r,s){if(vn.util.Type(t)!=="Object"||!eS.isTypedArray(t)||t.constructor.name!==e.name)throw vn.errors.conversionFailed({prefix:n,argument:`${r} ("${vn.util.Stringify(t)}")`,types:[e.name]});if(s?.allowShared===!1&&eS.isSharedArrayBuffer(t.buffer))throw vn.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw vn.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};vn.converters.DataView=function(t,e,n,r){if(vn.util.Type(t)!=="Object"||!eS.isDataView(t))throw vn.errors.exception({header:e,message:`${n} is not a DataView.`});if(r?.allowShared===!1&&eS.isSharedArrayBuffer(t.buffer))throw vn.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw vn.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};vn.converters.BufferSource=function(t,e,n,r){if(eS.isAnyArrayBuffer(t))return vn.converters.ArrayBuffer(t,e,n,{...r,allowShared:!1});if(eS.isTypedArray(t))return vn.converters.TypedArray(t,t.constructor,e,n,{...r,allowShared:!1});if(eS.isDataView(t))return vn.converters.DataView(t,e,n,{...r,allowShared:!1});throw vn.errors.conversionFailed({prefix:e,argument:`${n} ("${vn.util.Stringify(t)}")`,types:["BufferSource"]})};vn.converters["sequence"]=vn.sequenceConverter(vn.converters.ByteString);vn.converters["sequence>"]=vn.sequenceConverter(vn.converters["sequence"]);vn.converters["record"]=vn.recordConverter(vn.converters.ByteString,vn.converters.ByteString);hpt.exports={webidl:vn}});var Bg=ee((Nzs,Tpt)=>{"use strict";p();var{Transform:LYn}=require("node:stream"),mpt=require("node:zlib"),{redirectStatusSet:FYn,referrerPolicySet:QYn,badPortsSet:UYn}=xj(),{getGlobalOrigin:fpt}=Rke(),{collectASequenceOfCodePoints:R1,collectAnHTTPQuotedString:$Yn,removeChars:GYn,parseMIMEType:WYn}=yf(),{performance:qYn}=require("node:perf_hooks"),{isBlobLike:HYn,ReadableStreamFrom:VYn,isValidHTTPToken:gpt,normalizedMethodRecordsBase:jYn}=Wi(),k1=require("node:assert"),{isUint8Array:YYn}=require("node:util/types"),{webidl:Tj}=Cp(),Apt=[],_se;try{_se=require("node:crypto");let t=["sha256","sha384","sha512"];Apt=_se.getHashes().filter(e=>t.includes(e))}catch{}function ypt(t){let e=t.urlList,n=e.length;return n===0?null:e[n-1].toString()}function KYn(t,e){if(!FYn.has(t.status))return null;let n=t.headersList.get("location",!0);return n!==null&&bpt(n)&&(Ept(n)||(n=zYn(n)),n=new URL(n,ypt(t))),n&&!n.hash&&(n.hash=e),n}function Ept(t){for(let e=0;e126||n<32)return!1}return!0}function zYn(t){return Buffer.from(t,"binary").toString("utf8")}function Rj(t){return t.urlList[t.urlList.length-1]}function JYn(t){let e=Rj(t);return xpt(e)&&UYn.has(e.port)?"blocked":"allowed"}function XYn(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}function ZYn(t){for(let e=0;e=32&&n<=126||n>=128&&n<=255))return!1}return!0}var e6n=gpt;function bpt(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}function t6n(t,e){let{headersList:n}=e,r=(n.get("referrer-policy",!0)??"").split(","),s="";if(r.length>0)for(let i=r.length;i!==0;i--){let o=r[i-1].trim();if(QYn.has(o)){s=o;break}}s!==""&&(t.referrerPolicy=s)}function n6n(){return"allowed"}function r6n(){return"success"}function s6n(){return"success"}function i6n(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}function o6n(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&Bke(t.origin)&&!Bke(Rj(t))&&(e=null);break;case"same-origin":Sse(t,Rj(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}function LQ(t,e){return t}function a6n(t,e,n){return!t?.startTime||t.startTime4096&&(r=s);let i=Sse(t,r),o=vj(r)&&!vj(t.url);switch(e){case"origin":return s??Dke(n,!0);case"unsafe-url":return r;case"same-origin":return i?s:"no-referrer";case"origin-when-cross-origin":return i?r:s;case"strict-origin-when-cross-origin":{let a=Rj(t);return Sse(r,a)?r:vj(r)&&!vj(a)?"no-referrer":s}default:return o?"no-referrer":s}}function Dke(t,e){return k1(t instanceof URL),t=new URL(t),t.protocol==="file:"||t.protocol==="about:"||t.protocol==="blank:"?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}function vj(t){if(!(t instanceof URL))return!1;if(t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="file:")return!0;return e(t.origin);function e(n){if(n==null||n==="null")return!1;let r=new URL(n);return!!(r.protocol==="https:"||r.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(r.hostname)||r.hostname==="localhost"||r.hostname.includes("localhost.")||r.hostname.endsWith(".localhost"))}}function p6n(t,e){if(_se===void 0)return!0;let n=Spt(e);if(n==="no metadata"||n.length===0)return!0;let r=m6n(n),s=f6n(n,r);for(let i of s){let o=i.algo,a=i.hash,c=_se.createHash(o).update(t).digest("base64");if(c[c.length-1]==="="&&(c[c.length-2]==="="?c=c.slice(0,-2):c=c.slice(0,-1)),g6n(c,a))return!0}return!1}var h6n=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function Spt(t){let e=[],n=!0;for(let r of t.split(" ")){n=!1;let s=h6n.exec(r);if(s===null||s.groups===void 0||s.groups.algo===void 0)continue;let i=s.groups.algo.toLowerCase();Apt.includes(i)&&e.push(s.groups)}return n===!0?"no metadata":e}function m6n(t){let e=t[0].algo;if(e[3]==="5")return e;for(let n=1;n{t=r,e=s}),resolve:t,reject:e}}function E6n(t){return t.controller.state==="aborted"}function b6n(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}function _6n(t){return jYn[t.toLowerCase()]??t}function S6n(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return k1(typeof e=="string"),e}var C6n=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function Cpt(t,e,n=0,r=1){class s{#e;#t;#n;constructor(o,a){this.#e=o,this.#t=a,this.#n=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let o=this.#n,a=this.#e[e],c=a.length;if(o>=c)return{value:void 0,done:!0};let{[n]:u,[r]:l}=a[o];this.#n=o+1;let d;switch(this.#t){case"key":d=u;break;case"value":d=l;break;case"key+value":d=[u,l];break}return{value:d,done:!1}}}return delete s.prototype.constructor,Object.setPrototypeOf(s.prototype,C6n),Object.defineProperties(s.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(i,o){return new s(i,o)}}function I6n(t,e,n,r=0,s=1){let i=Cpt(t,n,r,s),o={keys:{writable:!0,enumerable:!0,configurable:!0,value:function(){return Tj.brandCheck(this,e),i(this,"key")}},values:{writable:!0,enumerable:!0,configurable:!0,value:function(){return Tj.brandCheck(this,e),i(this,"value")}},entries:{writable:!0,enumerable:!0,configurable:!0,value:function(){return Tj.brandCheck(this,e),i(this,"key+value")}},forEach:{writable:!0,enumerable:!0,configurable:!0,value:function(c,u=globalThis){if(Tj.brandCheck(this,e),Tj.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof c!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:l,1:d}of i(this,"key+value"))c.call(u,d,l,this)}}};return Object.defineProperties(e.prototype,{...o,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:o.entries.value}})}async function x6n(t,e,n){let r=e,s=n,i;try{i=t.stream.getReader()}catch(o){s(o);return}try{r(await Ipt(i))}catch(o){s(o)}}function w6n(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}function T6n(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}var v6n=/[^\x00-\xFF]/;function bse(t){return k1(!v6n.test(t)),t}async function Ipt(t){let e=[],n=0;for(;;){let{done:r,value:s}=await t.read();if(r)return Buffer.concat(e,n);if(!YYn(s))throw new TypeError("Received non-Uint8Array chunk");e.push(s),n+=s.length}}function R6n(t){k1("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}function Bke(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}function xpt(t){k1("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}function k6n(t,e){let n=t;if(!n.startsWith("bytes"))return"failure";let r={position:5};if(e&&R1(c=>c===" "||c===" ",n,r),n.charCodeAt(r.position)!==61)return"failure";r.position++,e&&R1(c=>c===" "||c===" ",n,r);let s=R1(c=>{let u=c.charCodeAt(0);return u>=48&&u<=57},n,r),i=s.length?Number(s):null;if(e&&R1(c=>c===" "||c===" ",n,r),n.charCodeAt(r.position)!==45)return"failure";r.position++,e&&R1(c=>c===" "||c===" ",n,r);let o=R1(c=>{let u=c.charCodeAt(0);return u>=48&&u<=57},n,r),a=o.length?Number(o):null;return r.positiona?"failure":{rangeStartValue:i,rangeEndValue:a}}function N6n(t,e,n){let r="bytes ";return r+=bse(`${t}`),r+="-",r+=bse(`${e}`),r+="/",r+=bse(`${n}`),r}var Pke=class extends LYn{#e;constructor(e){super(),this.#e=e}_transform(e,n,r){if(!this._inflateStream){if(e.length===0){r();return}this._inflateStream=(e[0]&15)===8?mpt.createInflate(this.#e):mpt.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",s=>this.destroy(s))}this._inflateStream.write(e,n,r)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function D6n(t){return new Pke(t)}function B6n(t){let e=null,n=null,r=null,s=wpt("content-type",t);if(s===null)return"failure";for(let i of s){let o=WYn(i);o==="failure"||o.essence==="*/*"||(r=o,r.essence!==n?(e=null,r.parameters.has("charset")&&(e=r.parameters.get("charset")),n=r.essence):!r.parameters.has("charset")&&e!==null&&r.parameters.set("charset",e))}return r??"failure"}function P6n(t){let e=t,n={position:0},r=[],s="";for(;n.positioni!=='"'&&i!==",",e,n),n.positioni===9||i===32),r.push(s),s=""}return r}function wpt(t,e){let n=e.get(t,!0);return n===null?null:P6n(n)}var O6n=new TextDecoder;function M6n(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),O6n.decode(t))}var Oke=class{get baseUrl(){return fpt()}get origin(){return this.baseUrl?.origin}policyContainer=_pt()},Mke=class{settingsObject=new Oke},L6n=new Mke;Tpt.exports={isAborted:E6n,isCancelled:b6n,isValidEncodedURL:Ept,createDeferredPromise:y6n,ReadableStreamFrom:VYn,tryUpgradeRequestToAPotentiallyTrustworthyURL:A6n,clampAndCoarsenConnectionTimingInfo:a6n,coarsenedSharedCurrentTime:c6n,determineRequestsReferrer:d6n,makePolicyContainer:_pt,clonePolicyContainer:u6n,appendFetchMetadata:i6n,appendRequestOriginHeader:o6n,TAOCheck:s6n,corsCheck:r6n,crossOriginResourcePolicyCheck:n6n,createOpaqueTimingInfo:l6n,setRequestReferrerPolicyOnRedirect:t6n,isValidHTTPToken:gpt,requestBadPort:JYn,requestCurrentURL:Rj,responseURL:ypt,responseLocationURL:KYn,isBlobLike:HYn,isURLPotentiallyTrustworthy:vj,isValidReasonPhrase:ZYn,sameOrigin:Sse,normalizeMethod:_6n,serializeJavascriptValueToJSONString:S6n,iteratorMixin:I6n,createIterator:Cpt,isValidHeaderName:e6n,isValidHeaderValue:bpt,isErrorLike:XYn,fullyReadBody:x6n,bytesMatch:p6n,isReadableStreamLike:w6n,readableStreamClose:T6n,isomorphicEncode:bse,urlIsLocal:R6n,urlHasHttpsScheme:Bke,urlIsHttpHttpsScheme:xpt,readAllBytes:Ipt,simpleRangeHeaderValue:k6n,buildContentRange:N6n,parseMetadata:Spt,createInflate:D6n,extractMimeType:B6n,getDecodeSplit:wpt,utf8DecodeBytes:M6n,environmentSettingsObject:L6n}});var yv=ee((Bzs,vpt)=>{"use strict";p();vpt.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var Fke=ee((Ozs,Rpt)=>{"use strict";p();var{Blob:F6n,File:Q6n}=require("node:buffer"),{kState:cx}=yv(),{webidl:tS}=Cp(),Lke=class t{constructor(e,n,r={}){let s=n,i=r.type,o=r.lastModified??Date.now();this[cx]={blobLike:e,name:s,type:i,lastModified:o}}stream(...e){return tS.brandCheck(this,t),this[cx].blobLike.stream(...e)}arrayBuffer(...e){return tS.brandCheck(this,t),this[cx].blobLike.arrayBuffer(...e)}slice(...e){return tS.brandCheck(this,t),this[cx].blobLike.slice(...e)}text(...e){return tS.brandCheck(this,t),this[cx].blobLike.text(...e)}get size(){return tS.brandCheck(this,t),this[cx].blobLike.size}get type(){return tS.brandCheck(this,t),this[cx].blobLike.type}get name(){return tS.brandCheck(this,t),this[cx].name}get lastModified(){return tS.brandCheck(this,t),this[cx].lastModified}get[Symbol.toStringTag](){return"File"}};tS.converters.Blob=tS.interfaceConverter(F6n);function U6n(t){return t instanceof Q6n||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}Rpt.exports={FileLike:Lke,isFileLike:U6n}});var Nj=ee((Lzs,Ppt)=>{"use strict";p();var{isBlobLike:Cse,iteratorMixin:$6n}=Bg(),{kState:lm}=yv(),{kEnumerableProperty:FQ}=Wi(),{FileLike:kpt,isFileLike:G6n}=Fke(),{webidl:qa}=Cp(),{File:Bpt}=require("node:buffer"),Npt=require("node:util"),Dpt=globalThis.File??Bpt,kj=class t{constructor(e){if(qa.util.markAsUncloneable(this),e!==void 0)throw qa.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[lm]=[]}append(e,n,r=void 0){qa.brandCheck(this,t);let s="FormData.append";if(qa.argumentLengthCheck(arguments,2,s),arguments.length===3&&!Cse(n))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=qa.converters.USVString(e,s,"name"),n=Cse(n)?qa.converters.Blob(n,s,"value",{strict:!1}):qa.converters.USVString(n,s,"value"),r=arguments.length===3?qa.converters.USVString(r,s,"filename"):void 0;let i=Qke(e,n,r);this[lm].push(i)}delete(e){qa.brandCheck(this,t);let n="FormData.delete";qa.argumentLengthCheck(arguments,1,n),e=qa.converters.USVString(e,n,"name"),this[lm]=this[lm].filter(r=>r.name!==e)}get(e){qa.brandCheck(this,t);let n="FormData.get";qa.argumentLengthCheck(arguments,1,n),e=qa.converters.USVString(e,n,"name");let r=this[lm].findIndex(s=>s.name===e);return r===-1?null:this[lm][r].value}getAll(e){qa.brandCheck(this,t);let n="FormData.getAll";return qa.argumentLengthCheck(arguments,1,n),e=qa.converters.USVString(e,n,"name"),this[lm].filter(r=>r.name===e).map(r=>r.value)}has(e){qa.brandCheck(this,t);let n="FormData.has";return qa.argumentLengthCheck(arguments,1,n),e=qa.converters.USVString(e,n,"name"),this[lm].findIndex(r=>r.name===e)!==-1}set(e,n,r=void 0){qa.brandCheck(this,t);let s="FormData.set";if(qa.argumentLengthCheck(arguments,2,s),arguments.length===3&&!Cse(n))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=qa.converters.USVString(e,s,"name"),n=Cse(n)?qa.converters.Blob(n,s,"name",{strict:!1}):qa.converters.USVString(n,s,"name"),r=arguments.length===3?qa.converters.USVString(r,s,"name"):void 0;let i=Qke(e,n,r),o=this[lm].findIndex(a=>a.name===e);o!==-1?this[lm]=[...this[lm].slice(0,o),i,...this[lm].slice(o+1).filter(a=>a.name!==e)]:this[lm].push(i)}[Npt.inspect.custom](e,n){let r=this[lm].reduce((i,o)=>(i[o.name]?Array.isArray(i[o.name])?i[o.name].push(o.value):i[o.name]=[i[o.name],o.value]:i[o.name]=o.value,i),{__proto__:null});n.depth??=e,n.colors??=!0;let s=Npt.formatWithOptions(n,r);return`FormData ${s.slice(s.indexOf("]")+2)}`}};$6n("FormData",kj,lm,"name","value");Object.defineProperties(kj.prototype,{append:FQ,delete:FQ,get:FQ,getAll:FQ,has:FQ,set:FQ,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function Qke(t,e,n){if(typeof e!="string"){if(G6n(e)||(e=e instanceof Blob?new Dpt([e],"blob",{type:e.type}):new kpt(e,"blob",{type:e.type})),n!==void 0){let r={type:e.type,lastModified:e.lastModified};e=e instanceof Bpt?new Dpt([e],n,r):new kpt(e,n,r)}}return{name:t,value:e}}Ppt.exports={FormData:kj,makeEntry:Qke}});var Upt=ee((Qzs,Qpt)=>{"use strict";p();var{isUSVString:Opt,bufferToLowerCasedHeaderName:W6n}=Wi(),{utf8DecodeBytes:q6n}=Bg(),{HTTP_TOKEN_CODEPOINTS:H6n,isomorphicDecode:Mpt}=yf(),{isFileLike:V6n}=Fke(),{makeEntry:j6n}=Nj(),Ise=require("node:assert"),{File:Y6n}=require("node:buffer"),K6n=globalThis.File??Y6n,z6n=Buffer.from('form-data; name="'),Lpt=Buffer.from("; filename"),J6n=Buffer.from("--"),X6n=Buffer.from(`--\r -`);function Z6n(t){for(let e=0;e70)return!1;for(let n=0;n=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===39||r===45||r===95))return!1}return!0}function t8n(t,e){Ise(e!=="failure"&&e.essence==="multipart/form-data");let n=e.parameters.get("boundary");if(n===void 0)return"failure";let r=Buffer.from(`--${n}`,"utf8"),s=[],i={position:0};for(;t[i.position]===13&&t[i.position+1]===10;)i.position+=2;let o=t.length;for(;t[o-1]===10&&t[o-2]===13;)o-=2;for(o!==t.length&&(t=t.subarray(0,o));;){if(t.subarray(i.position,i.position+r.length).equals(r))i.position+=r.length;else return"failure";if(i.position===t.length-2&&xse(t,J6n,i)||i.position===t.length-4&&xse(t,X6n,i))return s;if(t[i.position]!==13||t[i.position+1]!==10)return"failure";i.position+=2;let a=n8n(t,i);if(a==="failure")return"failure";let{name:c,filename:u,contentType:l,encoding:d}=a;i.position+=2;let h;{let f=t.indexOf(r.subarray(2),i.position);if(f===-1)return"failure";h=t.subarray(i.position,f-4),i.position+=h.length,d==="base64"&&(h=Buffer.from(h.toString(),"base64"))}if(t[i.position]!==13||t[i.position+1]!==10)return"failure";i.position+=2;let m;u!==null?(l??="text/plain",Z6n(l)||(l=""),m=new K6n([h],u,{type:l})):m=q6n(Buffer.from(h)),Ise(Opt(c)),Ise(typeof m=="string"&&Opt(m)||V6n(m)),s.push(j6n(c,m,u))}}function n8n(t,e){let n=null,r=null,s=null,i=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10)return n===null?"failure":{name:n,filename:r,contentType:s,encoding:i};let o=QQ(a=>a!==10&&a!==13&&a!==58,t,e);if(o=Uke(o,!0,!0,a=>a===9||a===32),!H6n.test(o.toString())||t[e.position]!==58)return"failure";switch(e.position++,QQ(a=>a===32||a===9,t,e),W6n(o)){case"content-disposition":{if(n=r=null,!xse(t,z6n,e)||(e.position+=17,n=Fpt(t,e),n===null))return"failure";if(xse(t,Lpt,e)){let a=e.position+Lpt.length;if(t[a]===42&&(e.position+=1,a+=1),t[a]!==61||t[a+1]!==34||(e.position+=12,r=Fpt(t,e),r===null))return"failure"}break}case"content-type":{let a=QQ(c=>c!==10&&c!==13,t,e);a=Uke(a,!1,!0,c=>c===9||c===32),s=Mpt(a);break}case"content-transfer-encoding":{let a=QQ(c=>c!==10&&c!==13,t,e);a=Uke(a,!1,!0,c=>c===9||c===32),i=Mpt(a);break}default:QQ(a=>a!==10&&a!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}function Fpt(t,e){Ise(t[e.position-1]===34);let n=QQ(r=>r!==10&&r!==13&&r!==34,t,e);return t[e.position]!==34?null:(e.position++,n=new TextDecoder().decode(n).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),n)}function QQ(t,e,n){let r=n.position;for(;r0&&r(t[i]);)i--;return s===0&&i===t.length-1?t:t.subarray(s,i+1)}function xse(t,e,n){if(t.length{"use strict";p();var Dj=Wi(),{ReadableStreamFrom:r8n,isBlobLike:$pt,isReadableStreamLike:s8n,readableStreamClose:i8n,createDeferredPromise:o8n,fullyReadBody:a8n,extractMimeType:c8n,utf8DecodeBytes:qpt}=Bg(),{FormData:Gpt}=Nj(),{kState:$Q}=yv(),{webidl:l8n}=Cp(),{Blob:u8n}=require("node:buffer"),$ke=require("node:assert"),{isErrored:Hpt,isDisturbed:d8n}=require("node:stream"),{isArrayBuffer:p8n}=require("node:util/types"),{serializeAMimeType:h8n}=yf(),{multipartFormDataParser:m8n}=Upt(),Gke;try{let t=require("node:crypto");Gke=e=>t.randomInt(0,e)}catch{Gke=t=>Math.floor(Math.random(t))}var wse=new TextEncoder;function f8n(){}var Vpt=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,jpt;Vpt&&(jpt=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!d8n(e)&&!Hpt(e)&&e.cancel("Response object has been garbage collected").catch(f8n)}));function Ypt(t,e=!1){let n=null;t instanceof ReadableStream?n=t:$pt(t)?n=t.stream():n=new ReadableStream({async pull(c){let u=typeof s=="string"?wse.encode(s):s;u.byteLength&&c.enqueue(u),queueMicrotask(()=>i8n(c))},start(){},type:"bytes"}),$ke(s8n(n));let r=null,s=null,i=null,o=null;if(typeof t=="string")s=t,o="text/plain;charset=UTF-8";else if(t instanceof URLSearchParams)s=t.toString(),o="application/x-www-form-urlencoded;charset=UTF-8";else if(p8n(t))s=new Uint8Array(t.slice());else if(ArrayBuffer.isView(t))s=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));else if(Dj.isFormDataLike(t)){let c=`----formdata-undici-0${`${Gke(1e11)}`.padStart(11,"0")}`,u=`--${c}\r +"use strict";var h0r=Object.create;var Gle=Object.defineProperty;var f0r=Object.getOwnPropertyDescriptor;var g0r=Object.getOwnPropertyNames;var A0r=Object.getPrototypeOf,y0r=Object.prototype.hasOwnProperty;var v=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var re=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},br=(t,e)=>{for(var n in e)Gle(t,n,{get:e[n],enumerable:!0})},bCt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of g0r(e))!y0r.call(t,i)&&i!==n&&Gle(t,i,{get:()=>e[i],enumerable:!(r=f0r(e,i))||r.enumerable});return t};var Ot=(t,e,n)=>(n=t!=null?h0r(A0r(t)):{},bCt(e||!t||!t.__esModule?Gle(n,"default",{value:t,enumerable:!0}):n,t)),wr=t=>bCt(Gle({},"__esModule",{value:!0}),t);var x,p=v(()=>{"use strict";x=require("url").pathToFileURL(__filename).href});var RCt=re(KG=>{"use strict";p();var t1s=require("net"),x0r=require("tls"),tLe=require("http"),wCt=require("https"),S0r=require("events"),n1s=require("assert"),C0r=require("util");KG.httpOverHttp=I0r;KG.httpsOverHttp=w0r;KG.httpOverHttps=T0r;KG.httpsOverHttps=v0r;function I0r(t){var e=new IT(t);return e.request=tLe.request,e}function w0r(t){var e=new IT(t);return e.request=tLe.request,e.createSocket=TCt,e.defaultPort=443,e}function T0r(t){var e=new IT(t);return e.request=wCt.request,e}function v0r(t){var e=new IT(t);return e.request=wCt.request,e.createSocket=TCt,e.defaultPort=443,e}function IT(t){var e=this;e.options=t||{},e.proxyOptions=e.options.proxy||{},e.maxSockets=e.options.maxSockets||tLe.Agent.defaultMaxSockets,e.requests=[],e.sockets=[],e.on("free",function(r,i,s,o){for(var a=vCt(i,s,o),c=0,u=e.requests.length;c=this.maxSockets){s.requests.push(o);return}s.createSocket(o,function(a){a.on("free",c),a.on("close",u),a.on("agentRemove",u),e.onSocket(a);function c(){s.emit("free",a,o)}function u(l){s.removeSocket(a),a.removeListener("free",c),a.removeListener("close",u),a.removeListener("agentRemove",u)}})};IT.prototype.createSocket=function(e,n){var r=this,i={};r.sockets.push(i);var s=nLe({},r.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(s.localAddress=e.localAddress),s.proxyAuth&&(s.headers=s.headers||{},s.headers["Proxy-Authorization"]="Basic "+new Buffer(s.proxyAuth).toString("base64")),Zk("making CONNECT request");var o=r.request(s);o.useChunkedEncodingByDefault=!1,o.once("response",a),o.once("upgrade",c),o.once("connect",u),o.once("error",l),o.end();function a(d){d.upgrade=!0}function c(d,m,h){process.nextTick(function(){u(d,m,h)})}function u(d,m,h){if(o.removeAllListeners(),m.removeAllListeners(),d.statusCode!==200){Zk("tunneling socket could not be established, statusCode=%d",d.statusCode),m.destroy();var f=new Error("tunneling socket could not be established, statusCode="+d.statusCode);f.code="ECONNRESET",e.request.emit("error",f),r.removeSocket(i);return}if(h.length>0){Zk("got illegal response body from proxy"),m.destroy();var f=new Error("got illegal response body from proxy");f.code="ECONNRESET",e.request.emit("error",f),r.removeSocket(i);return}return Zk("tunneling connection has established"),r.sockets[r.sockets.indexOf(i)]=m,n(m)}function l(d){o.removeAllListeners(),Zk(`tunneling socket could not be established, cause=%s +`,d.message,d.stack);var m=new Error("tunneling socket could not be established, cause="+d.message);m.code="ECONNRESET",e.request.emit("error",m),r.removeSocket(i)}};IT.prototype.removeSocket=function(e){var n=this.sockets.indexOf(e);if(n!==-1){this.sockets.splice(n,1);var r=this.requests.shift();r&&this.createSocket(r,function(i){r.request.onSocket(i)})}};function TCt(t,e){var n=this;IT.prototype.createSocket.call(n,t,function(r){var i=t.request.getHeader("host"),s=nLe({},n.options,{socket:r,servername:i?i.replace(/:.*$/,""):t.host}),o=x0r.connect(0,s);n.sockets[n.sockets.indexOf(r)]=o,e(o)})}function vCt(t,e,n){return typeof t=="string"?{host:t,port:e,localAddress:n}:t}function nLe(t){for(var e=1,n=arguments.length;e{p();kCt.exports=RCt()});var bl=re((a1s,BCt)=>{p();BCt.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}});var Jo=re((l1s,nIt)=>{"use strict";p();var NCt=Symbol.for("undici.error.UND_ERR"),_l=class extends Error{constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[NCt]===!0}[NCt]=!0},DCt=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),iLe=class extends _l{constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[DCt]===!0}[DCt]=!0},PCt=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),sLe=class extends _l{constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[PCt]===!0}[PCt]=!0},MCt=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),oLe=class extends _l{constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[MCt]===!0}[MCt]=!0},OCt=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),aLe=class extends _l{constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[OCt]===!0}[OCt]=!0},LCt=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),cLe=class extends _l{constructor(e,n,r,i){super(e),this.name="ResponseStatusCodeError",this.message=e||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=i,this.status=n,this.statusCode=n,this.headers=r}static[Symbol.hasInstance](e){return e&&e[LCt]===!0}[LCt]=!0},FCt=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),lLe=class extends _l{constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[FCt]===!0}[FCt]=!0},QCt=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),uLe=class extends _l{constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[QCt]===!0}[QCt]=!0},UCt=Symbol.for("undici.error.UND_ERR_ABORT"),qle=class extends _l{constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[UCt]===!0}[UCt]=!0},GCt=Symbol.for("undici.error.UND_ERR_ABORTED"),dLe=class extends qle{constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[GCt]===!0}[GCt]=!0},$Ct=Symbol.for("undici.error.UND_ERR_INFO"),pLe=class extends _l{constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[$Ct]===!0}[$Ct]=!0},WCt=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),mLe=class extends _l{constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[WCt]===!0}[WCt]=!0},HCt=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),hLe=class extends _l{constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[HCt]===!0}[HCt]=!0},qCt=Symbol.for("undici.error.UND_ERR_DESTROYED"),fLe=class extends _l{constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[qCt]===!0}[qCt]=!0},jCt=Symbol.for("undici.error.UND_ERR_CLOSED"),gLe=class extends _l{constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[jCt]===!0}[jCt]=!0},VCt=Symbol.for("undici.error.UND_ERR_SOCKET"),ALe=class extends _l{constructor(e,n){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=n}static[Symbol.hasInstance](e){return e&&e[VCt]===!0}[VCt]=!0},YCt=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),yLe=class extends _l{constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[YCt]===!0}[YCt]=!0},zCt=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),ELe=class extends _l{constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[zCt]===!0}[zCt]=!0},KCt=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),bLe=class extends Error{constructor(e,n,r){super(e),this.name="HTTPParserError",this.code=n?`HPE_${n}`:void 0,this.data=r?r.toString():void 0}static[Symbol.hasInstance](e){return e&&e[KCt]===!0}[KCt]=!0},JCt=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),_Le=class extends _l{constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[JCt]===!0}[JCt]=!0},XCt=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),xLe=class extends _l{constructor(e,n,{headers:r,data:i}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=n,this.data=i,this.headers=r}static[Symbol.hasInstance](e){return e&&e[XCt]===!0}[XCt]=!0},ZCt=Symbol.for("undici.error.UND_ERR_RESPONSE"),SLe=class extends _l{constructor(e,n,{headers:r,data:i}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=n,this.data=i,this.headers=r}static[Symbol.hasInstance](e){return e&&e[ZCt]===!0}[ZCt]=!0},eIt=Symbol.for("undici.error.UND_ERR_PRX_TLS"),CLe=class extends _l{constructor(e,n,r){super(n,{cause:e,...r??{}}),this.name="SecureProxyConnectionError",this.message=n||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[eIt]===!0}[eIt]=!0},tIt=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),ILe=class extends _l{constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[tIt]===!0}get[tIt](){return!0}};nIt.exports={AbortError:qle,HTTPParserError:bLe,UndiciError:_l,HeadersTimeoutError:sLe,HeadersOverflowError:oLe,BodyTimeoutError:aLe,RequestContentLengthMismatchError:mLe,ConnectTimeoutError:iLe,ResponseStatusCodeError:cLe,InvalidArgumentError:lLe,InvalidReturnValueError:uLe,RequestAbortedError:dLe,ClientDestroyedError:fLe,ClientClosedError:gLe,InformationalError:pLe,SocketError:ALe,NotSupportedError:yLe,ResponseContentLengthMismatchError:hLe,BalancedPoolMissingUpstreamError:ELe,ResponseExceededMaxSizeError:_Le,RequestRetryError:xLe,ResponseError:SLe,SecureProxyConnectionError:CLe,MessageSizeExceededError:ILe}});var Vle=re((d1s,rIt)=>{"use strict";p();var jle={},wLe=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let t=0;t{"use strict";p();var{wellknownHeaderNames:iIt,headerNameLowerCasedRecord:R0r}=Vle(),TLe=class t{value=null;left=null;middle=null;right=null;code;constructor(e,n,r){if(r===void 0||r>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(r))>127)throw new TypeError("key must be ascii string");e.length!==++r?this.middle=new t(e,n,r):this.value=n}add(e,n){let r=e.length;if(r===0)throw new TypeError("Unreachable");let i=0,s=this;for(;;){let o=e.charCodeAt(i);if(o>127)throw new TypeError("key must be ascii string");if(s.code===o)if(r===++i){s.value=n;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,n,i);break}else if(s.code=65&&(s|=32);i!==null;){if(s===i.code){if(n===++r)return i;i=i.middle;break}i=i.code{"use strict";p();var b6=require("node:assert"),{kDestroyed:lIt,kBodyUsed:JG,kListeners:vLe,kBody:cIt}=bl(),{IncomingMessage:k0r}=require("node:http"),Jle=require("node:stream"),B0r=require("node:net"),{Blob:N0r}=require("node:buffer"),D0r=require("node:util"),{stringify:P0r}=require("node:querystring"),{EventEmitter:M0r}=require("node:events"),{InvalidArgumentError:Rp}=Jo(),{headerNameLowerCasedRecord:O0r}=Vle(),{tree:uIt}=aIt(),[L0r,F0r]=process.versions.node.split(".").map(t=>Number(t)),Kle=class{constructor(e){this[cIt]=e,this[JG]=!1}async*[Symbol.asyncIterator](){b6(!this[JG],"disturbed"),this[JG]=!0,yield*this[cIt]}};function Q0r(t){return Xle(t)?(fIt(t)===0&&t.on("data",function(){b6(!1)}),typeof t.readableDidRead!="boolean"&&(t[JG]=!1,M0r.prototype.on.call(t,"data",function(){this[JG]=!0})),t):t&&typeof t.pipeTo=="function"?new Kle(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&hIt(t)?new Kle(t):t}function U0r(){}function Xle(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}function dIt(t){if(t===null)return!1;if(t instanceof N0r)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}function G0r(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let n=P0r(e);return n&&(t+="?"+n),t}function pIt(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}function zle(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}function mIt(t){if(typeof t=="string"){if(t=new URL(t),!zle(t.origin||t.protocol))throw new Rp("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Rp("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&pIt(t.port)===!1)throw new Rp("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new Rp("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Rp("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Rp("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Rp("Invalid URL origin: the origin must be a string or null/undefined.");if(!zle(t.origin||t.protocol))throw new Rp("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,n=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,r=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return n[n.length-1]==="/"&&(n=n.slice(0,n.length-1)),r&&r[0]!=="/"&&(r=`/${r}`),new URL(`${n}${r}`)}if(!zle(t.origin||t.protocol))throw new Rp("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}function $0r(t){if(t=mIt(t),t.pathname!=="/"||t.search||t.hash)throw new Rp("invalid url");return t}function W0r(t){if(t[0]==="["){let n=t.indexOf("]");return b6(n!==-1),t.substring(1,n)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}function H0r(t){if(!t)return null;b6(typeof t=="string");let e=W0r(t);return B0r.isIP(e)?"":e}function q0r(t){return JSON.parse(JSON.stringify(t))}function j0r(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}function hIt(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}function fIt(t){if(t==null)return 0;if(Xle(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(dIt(t))return t.size!=null?t.size:null;if(yIt(t))return t.byteLength}return null}function gIt(t){return t&&!!(t.destroyed||t[lIt]||Jle.isDestroyed?.(t))}function V0r(t,e){t==null||!Xle(t)||gIt(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===k0r&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[lIt]=!0))}var Y0r=/timeout=(\d+)/;function z0r(t){let e=t.toString().match(Y0r);return e?parseInt(e[1],10)*1e3:null}function AIt(t){return typeof t=="string"?O0r[t]??t.toLowerCase():uIt.lookup(t)??t.toString("latin1").toLowerCase()}function K0r(t){return uIt.lookup(t)??t.toString("latin1").toLowerCase()}function J0r(t,e){e===void 0&&(e={});for(let n=0;no.toString("utf8")):s.toString("utf8")}}return"content-length"in e&&"content-disposition"in e&&(e["content-disposition"]=Buffer.from(e["content-disposition"]).toString("latin1")),e}function X0r(t){let e=t.length,n=new Array(e),r=!1,i=-1,s,o,a=0;for(let c=0;c{n.close(),n.byobRequest?.respond(0)});else{let s=Buffer.isBuffer(i)?i:Buffer.from(i);s.byteLength&&n.enqueue(new Uint8Array(s))}return n.desiredSize>0},async cancel(n){await e.return()},type:"bytes"})}function sbr(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}function obr(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.addListener("abort",e),()=>t.removeListener("abort",e))}var abr=typeof String.prototype.toWellFormed=="function",cbr=typeof String.prototype.isWellFormed=="function";function EIt(t){return abr?`${t}`.toWellFormed():D0r.toUSVString(t)}function lbr(t){return cbr?`${t}`.isWellFormed():EIt(t)===`${t}`}function bIt(t){switch(t){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return t>=33&&t<=126}}function ubr(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Aa=require("node:diagnostics_channel"),BLe=require("node:util"),Zle=BLe.debuglog("undici"),kLe=BLe.debuglog("fetch"),vM=BLe.debuglog("websocket"),CIt=!1,Abr={beforeConnect:Aa.channel("undici:client:beforeConnect"),connected:Aa.channel("undici:client:connected"),connectError:Aa.channel("undici:client:connectError"),sendHeaders:Aa.channel("undici:client:sendHeaders"),create:Aa.channel("undici:request:create"),bodySent:Aa.channel("undici:request:bodySent"),headers:Aa.channel("undici:request:headers"),trailers:Aa.channel("undici:request:trailers"),error:Aa.channel("undici:request:error"),open:Aa.channel("undici:websocket:open"),close:Aa.channel("undici:websocket:close"),socketError:Aa.channel("undici:websocket:socket_error"),ping:Aa.channel("undici:websocket:ping"),pong:Aa.channel("undici:websocket:pong")};if(Zle.enabled||kLe.enabled){let t=kLe.enabled?kLe:Zle;Aa.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:i,host:s}}=e;t("connecting to %s using %s%s",`${s}${i?`:${i}`:""}`,r,n)}),Aa.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:i,host:s}}=e;t("connected to %s using %s%s",`${s}${i?`:${i}`:""}`,r,n)}),Aa.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:i,host:s},error:o}=e;t("connection to %s using %s%s errored - %s",`${s}${i?`:${i}`:""}`,r,n,o.message)}),Aa.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:n,path:r,origin:i}}=e;t("sending request to %s %s/%s",n,i,r)}),Aa.channel("undici:request:headers").subscribe(e=>{let{request:{method:n,path:r,origin:i},response:{statusCode:s}}=e;t("received response to %s %s/%s - HTTP %d",n,i,r,s)}),Aa.channel("undici:request:trailers").subscribe(e=>{let{request:{method:n,path:r,origin:i}}=e;t("trailers received from %s %s/%s",n,i,r)}),Aa.channel("undici:request:error").subscribe(e=>{let{request:{method:n,path:r,origin:i},error:s}=e;t("request to %s %s/%s errored - %s",n,i,r,s.message)}),CIt=!0}if(vM.enabled){if(!CIt){let t=Zle.enabled?Zle:vM;Aa.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:i,host:s}}=e;t("connecting to %s%s using %s%s",s,i?`:${i}`:"",r,n)}),Aa.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:i,host:s}}=e;t("connected to %s%s using %s%s",s,i?`:${i}`:"",r,n)}),Aa.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:n,protocol:r,port:i,host:s},error:o}=e;t("connection to %s%s using %s%s errored - %s",s,i?`:${i}`:"",r,n,o.message)}),Aa.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:n,path:r,origin:i}}=e;t("sending request to %s %s/%s",n,i,r)})}Aa.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:n}}=t;vM("connection opened %s%s",e,n?`:${n}`:"")}),Aa.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:n,reason:r}=t;vM("closed connection to %s - %s %s",e.url,n,r)}),Aa.channel("undici:websocket:socket_error").subscribe(t=>{vM("connection errored - %s",t.message)}),Aa.channel("undici:websocket:ping").subscribe(t=>{vM("ping received")}),Aa.channel("undici:websocket:pong").subscribe(t=>{vM("pong received")})}IIt.exports={channels:Abr}});var RIt=re((E1s,vIt)=>{"use strict";p();var{InvalidArgumentError:Cc,NotSupportedError:ybr}=Jo(),wT=require("node:assert"),{isValidHTTPToken:TIt,isValidHeaderValue:NLe,isStream:Ebr,destroy:bbr,isBuffer:_br,isFormDataLike:xbr,isIterable:Sbr,isBlobLike:Cbr,buildURL:Ibr,validateHandler:wbr,getServerName:Tbr,normalizedMethodRecords:vbr}=to(),{channels:zS}=XG(),{headerNameLowerCasedRecord:wIt}=Vle(),Rbr=/[^\u0021-\u00ff]/,r0=Symbol("handler"),DLe=class{constructor(e,{path:n,method:r,body:i,headers:s,query:o,idempotent:a,blocking:c,upgrade:u,headersTimeout:l,bodyTimeout:d,reset:m,throwOnError:h,expectContinue:f,servername:g},A){if(typeof n!="string")throw new Cc("path must be a string");if(n[0]!=="/"&&!(n.startsWith("http://")||n.startsWith("https://"))&&r!=="CONNECT")throw new Cc("path must be an absolute URL or start with a slash");if(Rbr.test(n))throw new Cc("invalid request path");if(typeof r!="string")throw new Cc("method must be a string");if(vbr[r]===void 0&&!TIt(r))throw new Cc("invalid request method");if(u&&typeof u!="string")throw new Cc("upgrade must be a string");if(u&&!NLe(u))throw new Cc("invalid upgrade header");if(l!=null&&(!Number.isFinite(l)||l<0))throw new Cc("invalid headersTimeout");if(d!=null&&(!Number.isFinite(d)||d<0))throw new Cc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Cc("invalid reset");if(f!=null&&typeof f!="boolean")throw new Cc("invalid expectContinue");if(this.headersTimeout=l,this.bodyTimeout=d,this.throwOnError=h===!0,this.method=r,this.abort=null,i==null)this.body=null;else if(Ebr(i)){this.body=i;let y=this.body._readableState;(!y||!y.autoDestroy)&&(this.endHandler=function(){bbr(this)},this.body.on("end",this.endHandler)),this.errorHandler=E=>{this.abort?this.abort(E):this.error=E},this.body.on("error",this.errorHandler)}else if(_br(i))this.body=i.byteLength?i:null;else if(ArrayBuffer.isView(i))this.body=i.buffer.byteLength?Buffer.from(i.buffer,i.byteOffset,i.byteLength):null;else if(i instanceof ArrayBuffer)this.body=i.byteLength?Buffer.from(i):null;else if(typeof i=="string")this.body=i.length?Buffer.from(i):null;else if(xbr(i)||Sbr(i)||Cbr(i))this.body=i;else throw new Cc("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=u||null,this.path=o?Ibr(n,o):n,this.origin=e,this.idempotent=a??(r==="HEAD"||r==="GET"),this.blocking=c??!1,this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=f??!1,Array.isArray(s)){if(s.length%2!==0)throw new Cc("headers array must be even");for(let y=0;y{"use strict";p();var kbr=require("node:events"),tue=class extends kbr{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let n=Array.isArray(e[0])?e[0]:e,r=this.dispatch.bind(this);for(let i of n)if(i!=null){if(typeof i!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof i}`);if(r=i(r),r==null||typeof r!="function"||r.length!==2)throw new TypeError("invalid interceptor")}return new PLe(this,r)}},PLe=class extends tue{#e=null;#t=null;constructor(e,n){super(),this.#e=e,this.#t=n}dispatch(...e){this.#t(...e)}close(...e){return this.#e.close(...e)}destroy(...e){return this.#e.destroy(...e)}};kIt.exports=tue});var n$=re((S1s,BIt)=>{"use strict";p();var Bbr=_6(),{ClientDestroyedError:MLe,ClientClosedError:Nbr,InvalidArgumentError:ZG}=Jo(),{kDestroy:Dbr,kClose:Pbr,kClosed:x6,kDestroyed:e$,kDispatch:OLe,kInterceptors:RM}=bl(),TT=Symbol("onDestroyed"),t$=Symbol("onClosed"),nue=Symbol("Intercepted Dispatch"),LLe=Symbol("webSocketOptions"),FLe=class extends Bbr{constructor(e){super(),this[e$]=!1,this[TT]=null,this[x6]=!1,this[t$]=[],this[LLe]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[LLe].maxFragments??131072,maxPayloadSize:this[LLe].maxPayloadSize??128*1024*1024}}get destroyed(){return this[e$]}get closed(){return this[x6]}get interceptors(){return this[RM]}set interceptors(e){if(e){for(let n=e.length-1;n>=0;n--)if(typeof this[RM][n]!="function")throw new ZG("interceptor must be an function")}this[RM]=e}close(e){if(e===void 0)return new Promise((r,i)=>{this.close((s,o)=>s?i(s):r(o))});if(typeof e!="function")throw new ZG("invalid callback");if(this[e$]){queueMicrotask(()=>e(new MLe,null));return}if(this[x6]){this[t$]?this[t$].push(e):queueMicrotask(()=>e(null,null));return}this[x6]=!0,this[t$].push(e);let n=()=>{let r=this[t$];this[t$]=null;for(let i=0;ithis.destroy()).then(()=>{queueMicrotask(n)})}destroy(e,n){if(typeof e=="function"&&(n=e,e=null),n===void 0)return new Promise((i,s)=>{this.destroy(e,(o,a)=>o?s(o):i(a))});if(typeof n!="function")throw new ZG("invalid callback");if(this[e$]){this[TT]?this[TT].push(n):queueMicrotask(()=>n(null,null));return}e||(e=new MLe),this[e$]=!0,this[TT]=this[TT]||[],this[TT].push(n);let r=()=>{let i=this[TT];this[TT]=null;for(let s=0;s{queueMicrotask(r)})}[nue](e,n){if(!this[RM]||this[RM].length===0)return this[nue]=this[OLe],this[OLe](e,n);let r=this[OLe].bind(this);for(let i=this[RM].length-1;i>=0;i--)r=this[RM][i](r);return this[nue]=r,r(e,n)}dispatch(e,n){if(!n||typeof n!="object")throw new ZG("handler must be an object");try{if(!e||typeof e!="object")throw new ZG("opts must be an object.");if(this[e$]||this[TT])throw new MLe;if(this[x6])throw new Nbr;return this[nue](e,n)}catch(r){if(typeof n.onError!="function")throw new ZG("invalid onError method");return n.onError(r),!1}}};BIt.exports=FLe});var qLe=re((I1s,MIt)=>{"use strict";p();var r$=0,QLe=1e3,ULe=(QLe>>1)-1,vT,GLe=Symbol("kFastTimer"),RT=[],$Le=-2,WLe=-1,DIt=0,NIt=1;function HLe(){r$+=ULe;let t=0,e=RT.length;for(;t=n._idleStart+n._idleTimeout&&(n._state=WLe,n._idleStart=-1,n._onTimeout(n._timerArg)),n._state===WLe?(n._state=$Le,--e!==0&&(RT[t]=RT[e])):++t}RT.length=e,RT.length!==0&&PIt()}function PIt(){vT?vT.refresh():(clearTimeout(vT),vT=setTimeout(HLe,ULe),vT.unref&&vT.unref())}var rue=class{[GLe]=!0;_state=$Le;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,n,r){this._onTimeout=e,this._idleTimeout=n,this._timerArg=r,this.refresh()}refresh(){this._state===$Le&&RT.push(this),(!vT||RT.length===1)&&PIt(),this._state=DIt}clear(){this._state=WLe,this._idleStart=-1}};MIt.exports={setTimeout(t,e,n){return e<=QLe?setTimeout(t,e,n):new rue(t,e,n)},clearTimeout(t){t[GLe]?t.clear():clearTimeout(t)},setFastTimeout(t,e,n){return new rue(t,e,n)},clearFastTimeout(t){t.clear()},now(){return r$},tick(t=0){r$+=t-QLe+1,HLe(),HLe()},reset(){r$=0,RT.length=0,clearTimeout(vT),vT=null},kFastTimer:GLe}});var S6=re((R1s,UIt)=>{"use strict";p();var Mbr=require("node:net"),OIt=require("node:assert"),QIt=to(),{InvalidArgumentError:Obr,ConnectTimeoutError:Lbr}=Jo(),iue=qLe();function LIt(){}var jLe,VLe;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?VLe=class{constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(n=>{if(this._sessionCache.size=this._maxCachedSessions){let{value:r}=this._sessionCache.keys().next();this._sessionCache.delete(r)}this._sessionCache.set(e,n)}}};function Fbr({allowH2:t,maxCachedSessions:e,socketPath:n,timeout:r,session:i,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new Obr("maxCachedSessions must be a positive integer or zero");let o={path:n,...s},a=new VLe(e??100);return r=r??1e4,t=t??!1,function({hostname:u,host:l,protocol:d,port:m,servername:h,localAddress:f,httpSocket:g},A){let y;if(d==="https:"){jLe||(jLe=require("node:tls")),h=h||o.servername||QIt.getServerName(l)||null;let _=h||u;OIt(_);let S=i||a.get(_)||null;m=m||443,y=jLe.connect({highWaterMark:16384,...o,servername:h,session:S,localAddress:f,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:g,port:m,host:u}),y.on("session",function(C){a.set(_,C)})}else OIt(!g,"httpSocket can only be sent on TLS update"),m=m||80,y=Mbr.connect({highWaterMark:64*1024,...o,localAddress:f,port:m,host:u});if(o.keepAlive==null||o.keepAlive){let _=o.keepAliveInitialDelay===void 0?6e4:o.keepAliveInitialDelay;y.setKeepAlive(!0,_)}let E=Qbr(new WeakRef(y),{timeout:r,hostname:u,port:m});return y.setNoDelay(!0).once(d==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(E),A){let _=A;A=null,_(null,this)}}).on("error",function(_){if(queueMicrotask(E),A){let S=A;A=null,S(_)}}),y}}var Qbr=process.platform==="win32"?(t,e)=>{if(!e.timeout)return LIt;let n=null,r=null,i=iue.setFastTimeout(()=>{n=setImmediate(()=>{r=setImmediate(()=>FIt(t.deref(),e))})},e.timeout);return()=>{iue.clearFastTimeout(i),clearImmediate(n),clearImmediate(r)}}:(t,e)=>{if(!e.timeout)return LIt;let n=null,r=iue.setFastTimeout(()=>{n=setImmediate(()=>{FIt(t.deref(),e)})},e.timeout);return()=>{iue.clearFastTimeout(r),clearImmediate(n)}};function FIt(t,e){if(t==null)return;let n="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?n+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:n+=` (attempted address: ${e.hostname}:${e.port},`,n+=` timeout: ${e.timeout}ms)`,QIt.destroy(t,new Lbr(n))}UIt.exports=Fbr});var GIt=re(sue=>{"use strict";p();Object.defineProperty(sue,"__esModule",{value:!0});sue.enumToMap=void 0;function Ubr(t){let e={};return Object.keys(t).forEach(n=>{let r=t[n];typeof r=="number"&&(e[n]=r)}),e}sue.enumToMap=Ubr});var $It=re(Bn=>{"use strict";p();Object.defineProperty(Bn,"__esModule",{value:!0});Bn.SPECIAL_HEADERS=Bn.HEADER_STATE=Bn.MINOR=Bn.MAJOR=Bn.CONNECTION_TOKEN_CHARS=Bn.HEADER_CHARS=Bn.TOKEN=Bn.STRICT_TOKEN=Bn.HEX=Bn.URL_CHAR=Bn.STRICT_URL_CHAR=Bn.USERINFO_CHARS=Bn.MARK=Bn.ALPHANUM=Bn.NUM=Bn.HEX_MAP=Bn.NUM_MAP=Bn.ALPHA=Bn.FINISH=Bn.H_METHOD_MAP=Bn.METHOD_MAP=Bn.METHODS_RTSP=Bn.METHODS_ICE=Bn.METHODS_HTTP=Bn.METHODS=Bn.LENIENT_FLAGS=Bn.FLAGS=Bn.TYPE=Bn.ERROR=void 0;var Gbr=GIt(),$br;(function(t){t[t.OK=0]="OK",t[t.INTERNAL=1]="INTERNAL",t[t.STRICT=2]="STRICT",t[t.LF_EXPECTED=3]="LF_EXPECTED",t[t.UNEXPECTED_CONTENT_LENGTH=4]="UNEXPECTED_CONTENT_LENGTH",t[t.CLOSED_CONNECTION=5]="CLOSED_CONNECTION",t[t.INVALID_METHOD=6]="INVALID_METHOD",t[t.INVALID_URL=7]="INVALID_URL",t[t.INVALID_CONSTANT=8]="INVALID_CONSTANT",t[t.INVALID_VERSION=9]="INVALID_VERSION",t[t.INVALID_HEADER_TOKEN=10]="INVALID_HEADER_TOKEN",t[t.INVALID_CONTENT_LENGTH=11]="INVALID_CONTENT_LENGTH",t[t.INVALID_CHUNK_SIZE=12]="INVALID_CHUNK_SIZE",t[t.INVALID_STATUS=13]="INVALID_STATUS",t[t.INVALID_EOF_STATE=14]="INVALID_EOF_STATE",t[t.INVALID_TRANSFER_ENCODING=15]="INVALID_TRANSFER_ENCODING",t[t.CB_MESSAGE_BEGIN=16]="CB_MESSAGE_BEGIN",t[t.CB_HEADERS_COMPLETE=17]="CB_HEADERS_COMPLETE",t[t.CB_MESSAGE_COMPLETE=18]="CB_MESSAGE_COMPLETE",t[t.CB_CHUNK_HEADER=19]="CB_CHUNK_HEADER",t[t.CB_CHUNK_COMPLETE=20]="CB_CHUNK_COMPLETE",t[t.PAUSED=21]="PAUSED",t[t.PAUSED_UPGRADE=22]="PAUSED_UPGRADE",t[t.PAUSED_H2_UPGRADE=23]="PAUSED_H2_UPGRADE",t[t.USER=24]="USER"})($br=Bn.ERROR||(Bn.ERROR={}));var Wbr;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(Wbr=Bn.TYPE||(Bn.TYPE={}));var Hbr;(function(t){t[t.CONNECTION_KEEP_ALIVE=1]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=2]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=4]="CONNECTION_UPGRADE",t[t.CHUNKED=8]="CHUNKED",t[t.UPGRADE=16]="UPGRADE",t[t.CONTENT_LENGTH=32]="CONTENT_LENGTH",t[t.SKIPBODY=64]="SKIPBODY",t[t.TRAILING=128]="TRAILING",t[t.TRANSFER_ENCODING=512]="TRANSFER_ENCODING"})(Hbr=Bn.FLAGS||(Bn.FLAGS={}));var qbr;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(qbr=Bn.LENIENT_FLAGS||(Bn.LENIENT_FLAGS={}));var fi;(function(t){t[t.DELETE=0]="DELETE",t[t.GET=1]="GET",t[t.HEAD=2]="HEAD",t[t.POST=3]="POST",t[t.PUT=4]="PUT",t[t.CONNECT=5]="CONNECT",t[t.OPTIONS=6]="OPTIONS",t[t.TRACE=7]="TRACE",t[t.COPY=8]="COPY",t[t.LOCK=9]="LOCK",t[t.MKCOL=10]="MKCOL",t[t.MOVE=11]="MOVE",t[t.PROPFIND=12]="PROPFIND",t[t.PROPPATCH=13]="PROPPATCH",t[t.SEARCH=14]="SEARCH",t[t.UNLOCK=15]="UNLOCK",t[t.BIND=16]="BIND",t[t.REBIND=17]="REBIND",t[t.UNBIND=18]="UNBIND",t[t.ACL=19]="ACL",t[t.REPORT=20]="REPORT",t[t.MKACTIVITY=21]="MKACTIVITY",t[t.CHECKOUT=22]="CHECKOUT",t[t.MERGE=23]="MERGE",t[t["M-SEARCH"]=24]="M-SEARCH",t[t.NOTIFY=25]="NOTIFY",t[t.SUBSCRIBE=26]="SUBSCRIBE",t[t.UNSUBSCRIBE=27]="UNSUBSCRIBE",t[t.PATCH=28]="PATCH",t[t.PURGE=29]="PURGE",t[t.MKCALENDAR=30]="MKCALENDAR",t[t.LINK=31]="LINK",t[t.UNLINK=32]="UNLINK",t[t.SOURCE=33]="SOURCE",t[t.PRI=34]="PRI",t[t.DESCRIBE=35]="DESCRIBE",t[t.ANNOUNCE=36]="ANNOUNCE",t[t.SETUP=37]="SETUP",t[t.PLAY=38]="PLAY",t[t.PAUSE=39]="PAUSE",t[t.TEARDOWN=40]="TEARDOWN",t[t.GET_PARAMETER=41]="GET_PARAMETER",t[t.SET_PARAMETER=42]="SET_PARAMETER",t[t.REDIRECT=43]="REDIRECT",t[t.RECORD=44]="RECORD",t[t.FLUSH=45]="FLUSH"})(fi=Bn.METHODS||(Bn.METHODS={}));Bn.METHODS_HTTP=[fi.DELETE,fi.GET,fi.HEAD,fi.POST,fi.PUT,fi.CONNECT,fi.OPTIONS,fi.TRACE,fi.COPY,fi.LOCK,fi.MKCOL,fi.MOVE,fi.PROPFIND,fi.PROPPATCH,fi.SEARCH,fi.UNLOCK,fi.BIND,fi.REBIND,fi.UNBIND,fi.ACL,fi.REPORT,fi.MKACTIVITY,fi.CHECKOUT,fi.MERGE,fi["M-SEARCH"],fi.NOTIFY,fi.SUBSCRIBE,fi.UNSUBSCRIBE,fi.PATCH,fi.PURGE,fi.MKCALENDAR,fi.LINK,fi.UNLINK,fi.PRI,fi.SOURCE];Bn.METHODS_ICE=[fi.SOURCE];Bn.METHODS_RTSP=[fi.OPTIONS,fi.DESCRIBE,fi.ANNOUNCE,fi.SETUP,fi.PLAY,fi.PAUSE,fi.TEARDOWN,fi.GET_PARAMETER,fi.SET_PARAMETER,fi.REDIRECT,fi.RECORD,fi.FLUSH,fi.GET,fi.POST];Bn.METHOD_MAP=Gbr.enumToMap(fi);Bn.H_METHOD_MAP={};Object.keys(Bn.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(Bn.H_METHOD_MAP[t]=Bn.METHOD_MAP[t])});var jbr;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(jbr=Bn.FINISH||(Bn.FINISH={}));Bn.ALPHA=[];for(let t=65;t<=90;t++)Bn.ALPHA.push(String.fromCharCode(t)),Bn.ALPHA.push(String.fromCharCode(t+32));Bn.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Bn.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};Bn.NUM=["0","1","2","3","4","5","6","7","8","9"];Bn.ALPHANUM=Bn.ALPHA.concat(Bn.NUM);Bn.MARK=["-","_",".","!","~","*","'","(",")"];Bn.USERINFO_CHARS=Bn.ALPHANUM.concat(Bn.MARK).concat(["%",";",":","&","=","+","$",","]);Bn.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Bn.ALPHANUM);Bn.URL_CHAR=Bn.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)Bn.URL_CHAR.push(t);Bn.HEX=Bn.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Bn.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Bn.ALPHANUM);Bn.TOKEN=Bn.STRICT_TOKEN.concat([" "]);Bn.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Bn.HEADER_CHARS.push(t);Bn.CONNECTION_TOKEN_CHARS=Bn.HEADER_CHARS.filter(t=>t!==44);Bn.MAJOR=Bn.NUM_MAP;Bn.MINOR=Bn.MAJOR;var i$;(function(t){t[t.GENERAL=0]="GENERAL",t[t.CONNECTION=1]="CONNECTION",t[t.CONTENT_LENGTH=2]="CONTENT_LENGTH",t[t.TRANSFER_ENCODING=3]="TRANSFER_ENCODING",t[t.UPGRADE=4]="UPGRADE",t[t.CONNECTION_KEEP_ALIVE=5]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=6]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=7]="CONNECTION_UPGRADE",t[t.TRANSFER_ENCODING_CHUNKED=8]="TRANSFER_ENCODING_CHUNKED"})(i$=Bn.HEADER_STATE||(Bn.HEADER_STATE={}));Bn.SPECIAL_HEADERS={connection:i$.CONNECTION,"content-length":i$.CONTENT_LENGTH,"proxy-connection":i$.CONNECTION,"transfer-encoding":i$.TRANSFER_ENCODING,upgrade:i$.UPGRADE}});var YLe=re((M1s,WIt)=>{"use strict";p();var{Buffer:Vbr}=require("node:buffer");WIt.exports=Vbr.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv","base64")});var qIt=re((L1s,HIt)=>{"use strict";p();var{Buffer:Ybr}=require("node:buffer");HIt.exports=Ybr.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==","base64")});var C6=re((Q1s,ZIt)=>{"use strict";p();var jIt=["GET","HEAD","POST"],zbr=new Set(jIt),Kbr=[101,204,205,304],VIt=[301,302,303,307,308],Jbr=new Set(VIt),YIt=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],Xbr=new Set(YIt),zIt=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],Zbr=new Set(zIt),e_r=["follow","manual","error"],KIt=["GET","HEAD","OPTIONS","TRACE"],t_r=new Set(KIt),n_r=["navigate","same-origin","no-cors","cors"],r_r=["omit","same-origin","include"],i_r=["default","no-store","reload","no-cache","force-cache","only-if-cached"],s_r=["content-encoding","content-language","content-location","content-type","content-length"],o_r=["half"],JIt=["CONNECT","TRACE","TRACK"],a_r=new Set(JIt),XIt=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],c_r=new Set(XIt);ZIt.exports={subresource:XIt,forbiddenMethods:JIt,requestBodyHeader:s_r,referrerPolicy:zIt,requestRedirect:e_r,requestMode:n_r,requestCredentials:r_r,requestCache:i_r,redirectStatus:VIt,corsSafeListedMethods:jIt,nullBodyStatus:Kbr,safeMethods:KIt,badPorts:YIt,requestDuplex:o_r,subresourceSet:c_r,badPortsSet:Xbr,redirectStatusSet:Jbr,corsSafeListedMethodsSet:zbr,safeMethodsSet:t_r,forbiddenMethodsSet:a_r,referrerPolicySet:Zbr}});var KLe=re((G1s,ewt)=>{"use strict";p();var zLe=Symbol.for("undici.globalOrigin.1");function l_r(){return globalThis[zLe]}function u_r(t){if(t===void 0){Object.defineProperty(globalThis,zLe,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,zLe,{value:e,writable:!0,enumerable:!1,configurable:!1})}ewt.exports={getGlobalOrigin:l_r,setGlobalOrigin:u_r}});var Ug=re((W1s,awt)=>{"use strict";p();var aue=require("node:assert"),d_r=new TextEncoder,I6=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,p_r=/[\u000A\u000D\u0009\u0020]/,m_r=/[\u0009\u000A\u000C\u000D\u0020]/g,h_r=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function f_r(t){aue(t.protocol==="data:");let e=rwt(t,!0);e=e.slice(5);let n={position:0},r=s$(",",e,n),i=r.length;if(r=__r(r,!0,!0),n.position>=e.length)return"failure";n.position++;let s=e.slice(i+1),o=iwt(s);if(/;(\u0020){0,}base64$/i.test(r)){let c=owt(o);if(o=A_r(c),o==="failure")return"failure";r=r.slice(0,-6),r=r.replace(/(\u0020)+$/,""),r=r.slice(0,-1)}r.startsWith(";")&&(r="text/plain"+r);let a=JLe(r);return a==="failure"&&(a=JLe("text/plain;charset=US-ASCII")),{mimeType:a,body:o}}function rwt(t,e=!1){if(!e)return t.href;let n=t.href,r=t.hash.length,i=r===0?n:n.substring(0,n.length-r);return!r&&n.endsWith("#")?i.slice(0,-1):i}function cue(t,e,n){let r="";for(;n.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function nwt(t){return t>=48&&t<=57?t-48:(t&223)-55}function g_r(t){let e=t.length,n=new Uint8Array(e),r=0;for(let i=0;it.length)return"failure";e.position++;let r=s$(";",t,e);if(r=oue(r,!1,!0),r.length===0||!I6.test(r))return"failure";let i=n.toLowerCase(),s=r.toLowerCase(),o={type:i,subtype:s,parameters:new Map,essence:`${i}/${s}`};for(;e.positionp_r.test(u),t,e);let a=cue(u=>u!==";"&&u!=="=",t,e);if(a=a.toLowerCase(),e.positiont.length)break;let c=null;if(t[e.position]==='"')c=swt(t,e,!0),s$(";",t,e);else if(c=s$(";",t,e),c=oue(c,!1,!0),c.length===0)continue;a.length!==0&&I6.test(a)&&(c.length===0||h_r.test(c))&&!o.parameters.has(a)&&o.parameters.set(a,c)}return o}function A_r(t){t=t.replace(m_r,"");let e=t.length;if(e%4===0&&t.charCodeAt(e-1)===61&&(--e,t.charCodeAt(e-1)===61&&--e),e%4===1||/[^+/0-9A-Za-z]/.test(t.length===e?t:t.substring(0,e)))return"failure";let n=Buffer.from(t,"base64");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}function swt(t,e,n){let r=e.position,i="";for(aue(t[e.position]==='"'),e.position++;i+=cue(o=>o!=='"'&&o!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){i+="\\";break}i+=t[e.position],e.position++}else{aue(s==='"');break}}return n?i:t.slice(r,e.position)}function y_r(t){aue(t!=="failure");let{parameters:e,essence:n}=t,r=n;for(let[i,s]of e.entries())r+=";",r+=i,r+="=",I6.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),r+=s;return r}function E_r(t){return t===13||t===10||t===9||t===32}function oue(t,e=!0,n=!0){return XLe(t,e,n,E_r)}function b_r(t){return t===13||t===10||t===9||t===12||t===32}function __r(t,e=!0,n=!0){return XLe(t,e,n,b_r)}function XLe(t,e,n,r){let i=0,s=t.length-1;if(e)for(;i0&&r(t.charCodeAt(s));)s--;return i===0&&s===t.length-1?t:t.slice(i,s+1)}function owt(t){let e=t.length;if(65535>e)return String.fromCharCode.apply(null,t);let n="",r=0,i=65535;for(;re&&(i=e-r),n+=String.fromCharCode.apply(null,t.subarray(r,r+=i));return n}function x_r(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}awt.exports={dataURLProcessor:f_r,URLSerializer:rwt,collectASequenceOfCodePoints:cue,collectASequenceOfCodePointsFast:s$,stringPercentDecode:iwt,parseMIMEType:JLe,collectAnHTTPQuotedString:swt,serializeAMimeType:y_r,removeChars:XLe,removeHTTPWhitespace:oue,minimizeSupportedMimeType:x_r,HTTP_TOKEN_CODEPOINTS:I6,isomorphicDecode:owt}});var Sm=re((q1s,cwt)=>{"use strict";p();var{types:KS,inspect:S_r}=require("node:util"),{markAsUncloneable:C_r}=require("node:worker_threads"),{toUSVString:I_r}=to(),Rn={};Rn.converters={};Rn.util={};Rn.errors={};Rn.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};Rn.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",n=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return Rn.errors.exception({header:t.prefix,message:n})};Rn.errors.invalidArgument=function(t){return Rn.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};Rn.brandCheck=function(t,e,n){if(n?.strict!==!1){if(!(t instanceof e)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}}else if(t?.[Symbol.toStringTag]!==e.prototype[Symbol.toStringTag]){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};Rn.argumentLengthCheck=function({length:t},e,n){if(t{});Rn.util.ConvertToInt=function(t,e,n,r){let i,s;e===64?(i=Math.pow(2,53)-1,n==="unsigned"?s=0:s=Math.pow(-2,53)+1):n==="unsigned"?(s=0,i=Math.pow(2,e)-1):(s=Math.pow(-2,e)-1,i=Math.pow(2,e-1)-1);let o=Number(t);if(o===0&&(o=0),r?.enforceRange===!0){if(Number.isNaN(o)||o===Number.POSITIVE_INFINITY||o===Number.NEGATIVE_INFINITY)throw Rn.errors.exception({header:"Integer conversion",message:`Could not convert ${Rn.util.Stringify(t)} to an integer.`});if(o=Rn.util.IntegerPart(o),oi)throw Rn.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${i}, got ${o}.`});return o}return!Number.isNaN(o)&&r?.clamp===!0?(o=Math.min(Math.max(o,s),i),Math.floor(o)%2===0?o=Math.floor(o):o=Math.ceil(o),o):Number.isNaN(o)||o===0&&Object.is(0,o)||o===Number.POSITIVE_INFINITY||o===Number.NEGATIVE_INFINITY?0:(o=Rn.util.IntegerPart(o),o=o%Math.pow(2,e),n==="signed"&&o>=Math.pow(2,e)-1?o-Math.pow(2,e):o)};Rn.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};Rn.util.Stringify=function(t){switch(Rn.util.Type(t)){case"Symbol":return`Symbol(${t.description})`;case"Object":return S_r(t);case"String":return`"${t}"`;default:return`${t}`}};Rn.sequenceConverter=function(t){return(e,n,r,i)=>{if(Rn.util.Type(e)!=="Object")throw Rn.errors.exception({header:n,message:`${r} (${Rn.util.Stringify(e)}) is not iterable.`});let s=typeof i=="function"?i():e?.[Symbol.iterator]?.(),o=[],a=0;if(s===void 0||typeof s.next!="function")throw Rn.errors.exception({header:n,message:`${r} is not iterable.`});for(;;){let{done:c,value:u}=s.next();if(c)break;o.push(t(u,n,`${r}[${a++}]`))}return o}};Rn.recordConverter=function(t,e){return(n,r,i)=>{if(Rn.util.Type(n)!=="Object")throw Rn.errors.exception({header:r,message:`${i} ("${Rn.util.Type(n)}") is not an Object.`});let s={};if(!KS.isProxy(n)){let a=[...Object.getOwnPropertyNames(n),...Object.getOwnPropertySymbols(n)];for(let c of a){let u=t(c,r,i),l=e(n[c],r,i);s[u]=l}return s}let o=Reflect.ownKeys(n);for(let a of o)if(Reflect.getOwnPropertyDescriptor(n,a)?.enumerable){let u=t(a,r,i),l=e(n[a],r,i);s[u]=l}return s}};Rn.interfaceConverter=function(t){return(e,n,r,i)=>{if(i?.strict!==!1&&!(e instanceof t))throw Rn.errors.exception({header:n,message:`Expected ${r} ("${Rn.util.Stringify(e)}") to be an instance of ${t.name}.`});return e}};Rn.dictionaryConverter=function(t){return(e,n,r)=>{let i=Rn.util.Type(e),s={};if(i==="Null"||i==="Undefined")return s;if(i!=="Object")throw Rn.errors.exception({header:n,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let o of t){let{key:a,defaultValue:c,required:u,converter:l}=o;if(u===!0&&!Object.hasOwn(e,a))throw Rn.errors.exception({header:n,message:`Missing required key "${a}".`});let d=e[a],m=Object.hasOwn(o,"defaultValue");if(m&&d!==null&&(d??=c()),u||m||d!==void 0){if(d=l(d,n,`${r}.${a}`),o.allowedValues&&!o.allowedValues.includes(d))throw Rn.errors.exception({header:n,message:`${d} is not an accepted type. Expected one of ${o.allowedValues.join(", ")}.`});s[a]=d}}return s}};Rn.nullableConverter=function(t){return(e,n,r)=>e===null?e:t(e,n,r)};Rn.converters.DOMString=function(t,e,n,r){if(t===null&&r?.legacyNullToEmptyString)return"";if(typeof t=="symbol")throw Rn.errors.exception({header:e,message:`${n} is a symbol, which cannot be converted to a DOMString.`});return String(t)};Rn.converters.ByteString=function(t,e,n){let r=Rn.converters.DOMString(t,e,n);for(let i=0;i255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${i} has a value of ${r.charCodeAt(i)} which is greater than 255.`);return r};Rn.converters.USVString=I_r;Rn.converters.boolean=function(t){return!!t};Rn.converters.any=function(t){return t};Rn.converters["long long"]=function(t,e,n){return Rn.util.ConvertToInt(t,64,"signed",void 0,e,n)};Rn.converters["unsigned long long"]=function(t,e,n){return Rn.util.ConvertToInt(t,64,"unsigned",void 0,e,n)};Rn.converters["unsigned long"]=function(t,e,n){return Rn.util.ConvertToInt(t,32,"unsigned",void 0,e,n)};Rn.converters["unsigned short"]=function(t,e,n,r){return Rn.util.ConvertToInt(t,16,"unsigned",r,e,n)};Rn.converters.ArrayBuffer=function(t,e,n,r){if(Rn.util.Type(t)!=="Object"||!KS.isAnyArrayBuffer(t))throw Rn.errors.conversionFailed({prefix:e,argument:`${n} ("${Rn.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(r?.allowShared===!1&&KS.isSharedArrayBuffer(t))throw Rn.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.resizable||t.growable)throw Rn.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Rn.converters.TypedArray=function(t,e,n,r,i){if(Rn.util.Type(t)!=="Object"||!KS.isTypedArray(t)||t.constructor.name!==e.name)throw Rn.errors.conversionFailed({prefix:n,argument:`${r} ("${Rn.util.Stringify(t)}")`,types:[e.name]});if(i?.allowShared===!1&&KS.isSharedArrayBuffer(t.buffer))throw Rn.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Rn.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Rn.converters.DataView=function(t,e,n,r){if(Rn.util.Type(t)!=="Object"||!KS.isDataView(t))throw Rn.errors.exception({header:e,message:`${n} is not a DataView.`});if(r?.allowShared===!1&&KS.isSharedArrayBuffer(t.buffer))throw Rn.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Rn.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Rn.converters.BufferSource=function(t,e,n,r){if(KS.isAnyArrayBuffer(t))return Rn.converters.ArrayBuffer(t,e,n,{...r,allowShared:!1});if(KS.isTypedArray(t))return Rn.converters.TypedArray(t,t.constructor,e,n,{...r,allowShared:!1});if(KS.isDataView(t))return Rn.converters.DataView(t,e,n,{...r,allowShared:!1});throw Rn.errors.conversionFailed({prefix:e,argument:`${n} ("${Rn.util.Stringify(t)}")`,types:["BufferSource"]})};Rn.converters["sequence"]=Rn.sequenceConverter(Rn.converters.ByteString);Rn.converters["sequence>"]=Rn.sequenceConverter(Rn.converters["sequence"]);Rn.converters["record"]=Rn.recordConverter(Rn.converters.ByteString,Rn.converters.ByteString);cwt.exports={webidl:Rn}});var ey=re((V1s,xwt)=>{"use strict";p();var{Transform:w_r}=require("node:stream"),lwt=require("node:zlib"),{redirectStatusSet:T_r,referrerPolicySet:v_r,badPortsSet:R_r}=C6(),{getGlobalOrigin:uwt}=KLe(),{collectASequenceOfCodePoints:kM,collectAnHTTPQuotedString:k_r,removeChars:B_r,parseMIMEType:N_r}=Ug(),{performance:D_r}=require("node:perf_hooks"),{isBlobLike:P_r,ReadableStreamFrom:M_r,isValidHTTPToken:dwt,normalizedMethodRecordsBase:O_r}=to(),BM=require("node:assert"),{isUint8Array:L_r}=require("node:util/types"),{webidl:w6}=Sm(),pwt=[],uue;try{uue=require("node:crypto");let t=["sha256","sha384","sha512"];pwt=uue.getHashes().filter(e=>t.includes(e))}catch{}function mwt(t){let e=t.urlList,n=e.length;return n===0?null:e[n-1].toString()}function F_r(t,e){if(!T_r.has(t.status))return null;let n=t.headersList.get("location",!0);return n!==null&&fwt(n)&&(hwt(n)||(n=Q_r(n)),n=new URL(n,mwt(t))),n&&!n.hash&&(n.hash=e),n}function hwt(t){for(let e=0;e126||n<32)return!1}return!0}function Q_r(t){return Buffer.from(t,"binary").toString("utf8")}function v6(t){return t.urlList[t.urlList.length-1]}function U_r(t){let e=v6(t);return bwt(e)&&R_r.has(e.port)?"blocked":"allowed"}function G_r(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}function $_r(t){for(let e=0;e=32&&n<=126||n>=128&&n<=255))return!1}return!0}var W_r=dwt;function fwt(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}function H_r(t,e){let{headersList:n}=e,r=(n.get("referrer-policy",!0)??"").split(","),i="";if(r.length>0)for(let s=r.length;s!==0;s--){let o=r[s-1].trim();if(v_r.has(o)){i=o;break}}i!==""&&(t.referrerPolicy=i)}function q_r(){return"allowed"}function j_r(){return"success"}function V_r(){return"success"}function Y_r(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}function z_r(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&e2e(t.origin)&&!e2e(v6(t))&&(e=null);break;case"same-origin":due(t,v6(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}function o$(t,e){return t}function K_r(t,e,n){return!t?.startTime||t.startTime4096&&(r=i);let s=due(t,r),o=T6(r)&&!T6(t.url);switch(e){case"origin":return i??ZLe(n,!0);case"unsafe-url":return r;case"same-origin":return s?i:"no-referrer";case"origin-when-cross-origin":return s?r:i;case"strict-origin-when-cross-origin":{let a=v6(t);return due(r,a)?r:T6(r)&&!T6(a)?"no-referrer":i}default:return o?"no-referrer":i}}function ZLe(t,e){return BM(t instanceof URL),t=new URL(t),t.protocol==="file:"||t.protocol==="about:"||t.protocol==="blank:"?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}function T6(t){if(!(t instanceof URL))return!1;if(t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="file:")return!0;return e(t.origin);function e(n){if(n==null||n==="null")return!1;let r=new URL(n);return!!(r.protocol==="https:"||r.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(r.hostname)||r.hostname==="localhost"||r.hostname.includes("localhost.")||r.hostname.endsWith(".localhost"))}}function txr(t,e){if(uue===void 0)return!0;let n=Awt(e);if(n==="no metadata"||n.length===0)return!0;let r=rxr(n),i=ixr(n,r);for(let s of i){let o=s.algo,a=s.hash,c=uue.createHash(o).update(t).digest("base64");if(c[c.length-1]==="="&&(c[c.length-2]==="="?c=c.slice(0,-2):c=c.slice(0,-1)),sxr(c,a))return!0}return!1}var nxr=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function Awt(t){let e=[],n=!0;for(let r of t.split(" ")){n=!1;let i=nxr.exec(r);if(i===null||i.groups===void 0||i.groups.algo===void 0)continue;let s=i.groups.algo.toLowerCase();pwt.includes(s)&&e.push(i.groups)}return n===!0?"no metadata":e}function rxr(t){let e=t[0].algo;if(e[3]==="5")return e;for(let n=1;n{t=r,e=i}),resolve:t,reject:e}}function cxr(t){return t.controller.state==="aborted"}function lxr(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}function uxr(t){return O_r[t.toLowerCase()]??t}function dxr(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return BM(typeof e=="string"),e}var pxr=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function ywt(t,e,n=0,r=1){class i{#e;#t;#n;constructor(o,a){this.#e=o,this.#t=a,this.#n=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let o=this.#n,a=this.#e[e],c=a.length;if(o>=c)return{value:void 0,done:!0};let{[n]:u,[r]:l}=a[o];this.#n=o+1;let d;switch(this.#t){case"key":d=u;break;case"value":d=l;break;case"key+value":d=[u,l];break}return{value:d,done:!1}}}return delete i.prototype.constructor,Object.setPrototypeOf(i.prototype,pxr),Object.defineProperties(i.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,o){return new i(s,o)}}function mxr(t,e,n,r=0,i=1){let s=ywt(t,n,r,i),o={keys:{writable:!0,enumerable:!0,configurable:!0,value:function(){return w6.brandCheck(this,e),s(this,"key")}},values:{writable:!0,enumerable:!0,configurable:!0,value:function(){return w6.brandCheck(this,e),s(this,"value")}},entries:{writable:!0,enumerable:!0,configurable:!0,value:function(){return w6.brandCheck(this,e),s(this,"key+value")}},forEach:{writable:!0,enumerable:!0,configurable:!0,value:function(c,u=globalThis){if(w6.brandCheck(this,e),w6.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof c!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:l,1:d}of s(this,"key+value"))c.call(u,d,l,this)}}};return Object.defineProperties(e.prototype,{...o,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:o.entries.value}})}async function hxr(t,e,n){let r=e,i=n,s;try{s=t.stream.getReader()}catch(o){i(o);return}try{r(await Ewt(s))}catch(o){i(o)}}function fxr(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}function gxr(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}var Axr=/[^\x00-\xFF]/;function lue(t){return BM(!Axr.test(t)),t}async function Ewt(t){let e=[],n=0;for(;;){let{done:r,value:i}=await t.read();if(r)return Buffer.concat(e,n);if(!L_r(i))throw new TypeError("Received non-Uint8Array chunk");e.push(i),n+=i.length}}function yxr(t){BM("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}function e2e(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}function bwt(t){BM("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}function Exr(t,e){let n=t;if(!n.startsWith("bytes"))return"failure";let r={position:5};if(e&&kM(c=>c===" "||c===" ",n,r),n.charCodeAt(r.position)!==61)return"failure";r.position++,e&&kM(c=>c===" "||c===" ",n,r);let i=kM(c=>{let u=c.charCodeAt(0);return u>=48&&u<=57},n,r),s=i.length?Number(i):null;if(e&&kM(c=>c===" "||c===" ",n,r),n.charCodeAt(r.position)!==45)return"failure";r.position++,e&&kM(c=>c===" "||c===" ",n,r);let o=kM(c=>{let u=c.charCodeAt(0);return u>=48&&u<=57},n,r),a=o.length?Number(o):null;return r.positiona?"failure":{rangeStartValue:s,rangeEndValue:a}}function bxr(t,e,n){let r="bytes ";return r+=lue(`${t}`),r+="-",r+=lue(`${e}`),r+="/",r+=lue(`${n}`),r}var t2e=class extends w_r{#e;constructor(e){super(),this.#e=e}_transform(e,n,r){if(!this._inflateStream){if(e.length===0){r();return}this._inflateStream=(e[0]&15)===8?lwt.createInflate(this.#e):lwt.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",i=>this.destroy(i))}this._inflateStream.write(e,n,r)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function _xr(t){return new t2e(t)}function xxr(t){let e=null,n=null,r=null,i=_wt("content-type",t);if(i===null)return"failure";for(let s of i){let o=N_r(s);o==="failure"||o.essence==="*/*"||(r=o,r.essence!==n?(e=null,r.parameters.has("charset")&&(e=r.parameters.get("charset")),n=r.essence):!r.parameters.has("charset")&&e!==null&&r.parameters.set("charset",e))}return r??"failure"}function Sxr(t){let e=t,n={position:0},r=[],i="";for(;n.positions!=='"'&&s!==",",e,n),n.positions===9||s===32),r.push(i),i=""}return r}function _wt(t,e){let n=e.get(t,!0);return n===null?null:Sxr(n)}var Cxr=new TextDecoder;function Ixr(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),Cxr.decode(t))}var n2e=class{get baseUrl(){return uwt()}get origin(){return this.baseUrl?.origin}policyContainer=gwt()},r2e=class{settingsObject=new n2e},wxr=new r2e;xwt.exports={isAborted:cxr,isCancelled:lxr,isValidEncodedURL:hwt,createDeferredPromise:axr,ReadableStreamFrom:M_r,tryUpgradeRequestToAPotentiallyTrustworthyURL:oxr,clampAndCoarsenConnectionTimingInfo:K_r,coarsenedSharedCurrentTime:J_r,determineRequestsReferrer:exr,makePolicyContainer:gwt,clonePolicyContainer:Z_r,appendFetchMetadata:Y_r,appendRequestOriginHeader:z_r,TAOCheck:V_r,corsCheck:j_r,crossOriginResourcePolicyCheck:q_r,createOpaqueTimingInfo:X_r,setRequestReferrerPolicyOnRedirect:H_r,isValidHTTPToken:dwt,requestBadPort:U_r,requestCurrentURL:v6,responseURL:mwt,responseLocationURL:F_r,isBlobLike:P_r,isURLPotentiallyTrustworthy:T6,isValidReasonPhrase:$_r,sameOrigin:due,normalizeMethod:uxr,serializeJavascriptValueToJSONString:dxr,iteratorMixin:mxr,createIterator:ywt,isValidHeaderName:W_r,isValidHeaderValue:fwt,isErrorLike:G_r,fullyReadBody:hxr,bytesMatch:txr,isReadableStreamLike:fxr,readableStreamClose:gxr,isomorphicEncode:lue,urlIsLocal:yxr,urlHasHttpsScheme:e2e,urlIsHttpHttpsScheme:bwt,readAllBytes:Ewt,simpleRangeHeaderValue:Exr,buildContentRange:bxr,parseMetadata:Awt,createInflate:_xr,extractMimeType:xxr,getDecodeSplit:_wt,utf8DecodeBytes:Ixr,environmentSettingsObject:wxr}});var e1=re((z1s,Swt)=>{"use strict";p();Swt.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var s2e=re((J1s,Cwt)=>{"use strict";p();var{Blob:Txr,File:vxr}=require("node:buffer"),{kState:kT}=e1(),{webidl:JS}=Sm(),i2e=class t{constructor(e,n,r={}){let i=n,s=r.type,o=r.lastModified??Date.now();this[kT]={blobLike:e,name:i,type:s,lastModified:o}}stream(...e){return JS.brandCheck(this,t),this[kT].blobLike.stream(...e)}arrayBuffer(...e){return JS.brandCheck(this,t),this[kT].blobLike.arrayBuffer(...e)}slice(...e){return JS.brandCheck(this,t),this[kT].blobLike.slice(...e)}text(...e){return JS.brandCheck(this,t),this[kT].blobLike.text(...e)}get size(){return JS.brandCheck(this,t),this[kT].blobLike.size}get type(){return JS.brandCheck(this,t),this[kT].blobLike.type}get name(){return JS.brandCheck(this,t),this[kT].name}get lastModified(){return JS.brandCheck(this,t),this[kT].lastModified}get[Symbol.toStringTag](){return"File"}};JS.converters.Blob=JS.interfaceConverter(Txr);function Rxr(t){return t instanceof vxr||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}Cwt.exports={FileLike:i2e,isFileLike:Rxr}});var k6=re((Z1s,Rwt)=>{"use strict";p();var{isBlobLike:pue,iteratorMixin:kxr}=ey(),{kState:_f}=e1(),{kEnumerableProperty:a$}=to(),{FileLike:Iwt,isFileLike:Bxr}=s2e(),{webidl:Ic}=Sm(),{File:vwt}=require("node:buffer"),wwt=require("node:util"),Twt=globalThis.File??vwt,R6=class t{constructor(e){if(Ic.util.markAsUncloneable(this),e!==void 0)throw Ic.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[_f]=[]}append(e,n,r=void 0){Ic.brandCheck(this,t);let i="FormData.append";if(Ic.argumentLengthCheck(arguments,2,i),arguments.length===3&&!pue(n))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=Ic.converters.USVString(e,i,"name"),n=pue(n)?Ic.converters.Blob(n,i,"value",{strict:!1}):Ic.converters.USVString(n,i,"value"),r=arguments.length===3?Ic.converters.USVString(r,i,"filename"):void 0;let s=o2e(e,n,r);this[_f].push(s)}delete(e){Ic.brandCheck(this,t);let n="FormData.delete";Ic.argumentLengthCheck(arguments,1,n),e=Ic.converters.USVString(e,n,"name"),this[_f]=this[_f].filter(r=>r.name!==e)}get(e){Ic.brandCheck(this,t);let n="FormData.get";Ic.argumentLengthCheck(arguments,1,n),e=Ic.converters.USVString(e,n,"name");let r=this[_f].findIndex(i=>i.name===e);return r===-1?null:this[_f][r].value}getAll(e){Ic.brandCheck(this,t);let n="FormData.getAll";return Ic.argumentLengthCheck(arguments,1,n),e=Ic.converters.USVString(e,n,"name"),this[_f].filter(r=>r.name===e).map(r=>r.value)}has(e){Ic.brandCheck(this,t);let n="FormData.has";return Ic.argumentLengthCheck(arguments,1,n),e=Ic.converters.USVString(e,n,"name"),this[_f].findIndex(r=>r.name===e)!==-1}set(e,n,r=void 0){Ic.brandCheck(this,t);let i="FormData.set";if(Ic.argumentLengthCheck(arguments,2,i),arguments.length===3&&!pue(n))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=Ic.converters.USVString(e,i,"name"),n=pue(n)?Ic.converters.Blob(n,i,"name",{strict:!1}):Ic.converters.USVString(n,i,"name"),r=arguments.length===3?Ic.converters.USVString(r,i,"name"):void 0;let s=o2e(e,n,r),o=this[_f].findIndex(a=>a.name===e);o!==-1?this[_f]=[...this[_f].slice(0,o),s,...this[_f].slice(o+1).filter(a=>a.name!==e)]:this[_f].push(s)}[wwt.inspect.custom](e,n){let r=this[_f].reduce((s,o)=>(s[o.name]?Array.isArray(s[o.name])?s[o.name].push(o.value):s[o.name]=[s[o.name],o.value]:s[o.name]=o.value,s),{__proto__:null});n.depth??=e,n.colors??=!0;let i=wwt.formatWithOptions(n,r);return`FormData ${i.slice(i.indexOf("]")+2)}`}};kxr("FormData",R6,_f,"name","value");Object.defineProperties(R6.prototype,{append:a$,delete:a$,get:a$,getAll:a$,has:a$,set:a$,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function o2e(t,e,n){if(typeof e!="string"){if(Bxr(e)||(e=e instanceof Blob?new Twt([e],"blob",{type:e.type}):new Iwt(e,"blob",{type:e.type})),n!==void 0){let r={type:e.type,lastModified:e.lastModified};e=e instanceof vwt?new Twt([e],n,r):new Iwt(e,n,r)}}return{name:t,value:e}}Rwt.exports={FormData:R6,makeEntry:o2e}});var Mwt=re((tBs,Pwt)=>{"use strict";p();var{isUSVString:kwt,bufferToLowerCasedHeaderName:Nxr}=to(),{utf8DecodeBytes:Dxr}=ey(),{HTTP_TOKEN_CODEPOINTS:Pxr,isomorphicDecode:Bwt}=Ug(),{isFileLike:Mxr}=s2e(),{makeEntry:Oxr}=k6(),mue=require("node:assert"),{File:Lxr}=require("node:buffer"),Fxr=globalThis.File??Lxr,Qxr=Buffer.from('form-data; name="'),Nwt=Buffer.from("; filename"),Uxr=Buffer.from("--"),Gxr=Buffer.from(`--\r +`);function $xr(t){for(let e=0;e70)return!1;for(let n=0;n=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===39||r===45||r===95))return!1}return!0}function Hxr(t,e){mue(e!=="failure"&&e.essence==="multipart/form-data");let n=e.parameters.get("boundary");if(n===void 0)return"failure";let r=Buffer.from(`--${n}`,"utf8"),i=[],s={position:0};for(;t[s.position]===13&&t[s.position+1]===10;)s.position+=2;let o=t.length;for(;t[o-1]===10&&t[o-2]===13;)o-=2;for(o!==t.length&&(t=t.subarray(0,o));;){if(t.subarray(s.position,s.position+r.length).equals(r))s.position+=r.length;else return"failure";if(s.position===t.length-2&&hue(t,Uxr,s)||s.position===t.length-4&&hue(t,Gxr,s))return i;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let a=qxr(t,s);if(a==="failure")return"failure";let{name:c,filename:u,contentType:l,encoding:d}=a;s.position+=2;let m;{let f=t.indexOf(r.subarray(2),s.position);if(f===-1)return"failure";m=t.subarray(s.position,f-4),s.position+=m.length,d==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let h;u!==null?(l??="text/plain",$xr(l)||(l=""),h=new Fxr([m],u,{type:l})):h=Dxr(Buffer.from(m)),mue(kwt(c)),mue(typeof h=="string"&&kwt(h)||Mxr(h)),i.push(Oxr(c,h,u))}}function qxr(t,e){let n=null,r=null,i=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10)return n===null?"failure":{name:n,filename:r,contentType:i,encoding:s};let o=c$(a=>a!==10&&a!==13&&a!==58,t,e);if(o=a2e(o,!0,!0,a=>a===9||a===32),!Pxr.test(o.toString())||t[e.position]!==58)return"failure";switch(e.position++,c$(a=>a===32||a===9,t,e),Nxr(o)){case"content-disposition":{if(n=r=null,!hue(t,Qxr,e)||(e.position+=17,n=Dwt(t,e),n===null))return"failure";if(hue(t,Nwt,e)){let a=e.position+Nwt.length;if(t[a]===42&&(e.position+=1,a+=1),t[a]!==61||t[a+1]!==34||(e.position+=12,r=Dwt(t,e),r===null))return"failure"}break}case"content-type":{let a=c$(c=>c!==10&&c!==13,t,e);a=a2e(a,!1,!0,c=>c===9||c===32),i=Bwt(a);break}case"content-transfer-encoding":{let a=c$(c=>c!==10&&c!==13,t,e);a=a2e(a,!1,!0,c=>c===9||c===32),s=Bwt(a);break}default:c$(a=>a!==10&&a!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}function Dwt(t,e){mue(t[e.position-1]===34);let n=c$(r=>r!==10&&r!==13&&r!==34,t,e);return t[e.position]!==34?null:(e.position++,n=new TextDecoder().decode(n).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),n)}function c$(t,e,n){let r=n.position;for(;r0&&r(t[s]);)s--;return i===0&&s===t.length-1?t:t.subarray(i,s+1)}function hue(t,e,n){if(t.length{"use strict";p();var B6=to(),{ReadableStreamFrom:jxr,isBlobLike:Owt,isReadableStreamLike:Vxr,readableStreamClose:Yxr,createDeferredPromise:zxr,fullyReadBody:Kxr,extractMimeType:Jxr,utf8DecodeBytes:Qwt}=ey(),{FormData:Lwt}=k6(),{kState:u$}=e1(),{webidl:Xxr}=Sm(),{Blob:Zxr}=require("node:buffer"),c2e=require("node:assert"),{isErrored:Uwt,isDisturbed:eSr}=require("node:stream"),{isArrayBuffer:tSr}=require("node:util/types"),{serializeAMimeType:nSr}=Ug(),{multipartFormDataParser:rSr}=Mwt(),l2e;try{let t=require("node:crypto");l2e=e=>t.randomInt(0,e)}catch{l2e=t=>Math.floor(Math.random(t))}var fue=new TextEncoder;function iSr(){}var Gwt=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,$wt;Gwt&&($wt=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!eSr(e)&&!Uwt(e)&&e.cancel("Response object has been garbage collected").catch(iSr)}));function Wwt(t,e=!1){let n=null;t instanceof ReadableStream?n=t:Owt(t)?n=t.stream():n=new ReadableStream({async pull(c){let u=typeof i=="string"?fue.encode(i):i;u.byteLength&&c.enqueue(u),queueMicrotask(()=>Yxr(c))},start(){},type:"bytes"}),c2e(Vxr(n));let r=null,i=null,s=null,o=null;if(typeof t=="string")i=t,o="text/plain;charset=UTF-8";else if(t instanceof URLSearchParams)i=t.toString(),o="application/x-www-form-urlencoded;charset=UTF-8";else if(tSr(t))i=new Uint8Array(t.slice());else if(ArrayBuffer.isView(t))i=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));else if(B6.isFormDataLike(t)){let c=`----formdata-undici-0${`${l2e(1e11)}`.padStart(11,"0")}`,u=`--${c}\r Content-Disposition: form-data`;let l=A=>A.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),d=A=>A.replace(/\r?\n|\r/g,`\r -`),h=[],m=new Uint8Array([13,10]);i=0;let f=!1;for(let[A,y]of t)if(typeof y=="string"){let b=wse.encode(u+`; name="${l(d(A))}"\r +`),m=[],h=new Uint8Array([13,10]);s=0;let f=!1;for(let[A,y]of t)if(typeof y=="string"){let E=fue.encode(u+`; name="${l(d(A))}"\r \r ${d(y)}\r -`);h.push(b),i+=b.byteLength}else{let b=wse.encode(`${u}; name="${l(d(A))}"`+(y.name?`; filename="${l(y.name)}"`:"")+`\r +`);m.push(E),s+=E.byteLength}else{let E=fue.encode(`${u}; name="${l(d(A))}"`+(y.name?`; filename="${l(y.name)}"`:"")+`\r Content-Type: ${y.type||"application/octet-stream"}\r \r -`);h.push(b,y,m),typeof y.size=="number"?i+=b.byteLength+y.size+m.byteLength:f=!0}let g=wse.encode(`--${c}--\r -`);h.push(g),i+=g.byteLength,f&&(i=null),s=t,r=async function*(){for(let A of h)A.stream?yield*A.stream():yield A},o=`multipart/form-data; boundary=${c}`}else if($pt(t))s=t,i=t.size,t.type&&(o=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(Dj.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");n=t instanceof ReadableStream?t:r8n(t)}if((typeof s=="string"||Dj.isBuffer(s))&&(i=Buffer.byteLength(s)),r!=null){let c;n=new ReadableStream({async start(){c=r(t)[Symbol.asyncIterator]()},async pull(u){let{value:l,done:d}=await c.next();if(d)queueMicrotask(()=>{u.close(),u.byobRequest?.respond(0)});else if(!Hpt(n)){let h=new Uint8Array(l);h.byteLength&&u.enqueue(h)}return u.desiredSize>0},async cancel(u){await c.return()},type:"bytes"})}return[{stream:n,source:s,length:i},o]}function g8n(t,e=!1){return t instanceof ReadableStream&&($ke(!Dj.isDisturbed(t),"The body has already been consumed."),$ke(!t.locked,"The stream is locked.")),Ypt(t,e)}function A8n(t,e){let[n,r]=e.stream.tee();return e.stream=n,{stream:r,length:e.length,source:e.source}}function y8n(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}function E8n(t){return{blob(){return UQ(this,n=>{let r=Wpt(this);return r===null?r="":r&&(r=h8n(r)),new u8n([n],{type:r})},t)},arrayBuffer(){return UQ(this,n=>new Uint8Array(n).buffer,t)},text(){return UQ(this,qpt,t)},json(){return UQ(this,_8n,t)},formData(){return UQ(this,n=>{let r=Wpt(this);if(r!==null)switch(r.essence){case"multipart/form-data":{let s=m8n(n,r);if(s==="failure")throw new TypeError("Failed to parse body as FormData.");let i=new Gpt;return i[$Q]=s,i}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),i=new Gpt;for(let[o,a]of s)i.append(o,a);return i}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return UQ(this,n=>new Uint8Array(n),t)}}}function b8n(t){Object.assign(t.prototype,E8n(t))}async function UQ(t,e,n){if(l8n.brandCheck(t,n),Kpt(t))throw new TypeError("Body is unusable: Body has already been read");y8n(t[$Q]);let r=o8n(),s=o=>r.reject(o),i=o=>{try{r.resolve(e(o))}catch(a){s(a)}};return t[$Q].body==null?(i(Buffer.allocUnsafe(0)),r.promise):(await a8n(t[$Q].body,i,s),r.promise)}function Kpt(t){let e=t[$Q].body;return e!=null&&(e.stream.locked||Dj.isDisturbed(e.stream))}function _8n(t){return JSON.parse(qpt(t))}function Wpt(t){let e=t[$Q].headersList,n=c8n(e);return n==="failure"?null:n}zpt.exports={extractBody:Ypt,safelyExtractBody:g8n,cloneBody:A8n,mixinBody:b8n,streamRegistry:jpt,hasFinalizationRegistry:Vpt,bodyUnusable:Kpt}});var pht=ee((Wzs,dht)=>{"use strict";p();var ss=require("node:assert"),_s=Wi(),{channels:Jpt}=RQ(),Wke=Ike(),{RequestContentLengthMismatchError:N1,ResponseContentLengthMismatchError:Xpt,RequestAbortedError:oht,HeadersTimeoutError:S8n,HeadersOverflowError:C8n,SocketError:WQ,InformationalError:qQ,BodyTimeoutError:I8n,HTTPParserError:x8n,ResponseExceededMaxSizeError:w8n}=Do(),{kUrl:aht,kReset:Ef,kClient:kse,kParser:dc,kBlocking:Oj,kRunning:xu,kPending:cht,kSize:Zpt,kWriting:Ev,kQueue:Bb,kNoRef:Bj,kKeepAliveDefaultTimeout:T8n,kHostHeader:v8n,kPendingIdx:R8n,kRunningIdx:By,kError:um,kPipelining:Nse,kSocket:B1,kKeepAliveTimeoutValue:Bse,kMaxHeadersSize:qke,kKeepAliveMaxTimeout:k8n,kKeepAliveTimeoutThreshold:N8n,kHeadersTimeout:D8n,kBodyTimeout:B8n,kStrictContentLength:jke,kMaxRequests:eht,kCounter:P8n,kMaxResponseSize:O8n,kOnError:tht,kResume:lx,kHTTPContext:lht}=Nc(),Pg=jdt(),nht=Buffer.alloc(0),Tse=Buffer[Symbol.species],vse=_s.addListener,M8n=_s.removeAllListeners,P1=Symbol("kIdleSocketValidation"),D1=Symbol("kIdleSocketValidationTimeout"),Jke=Symbol("kSocketUsed"),Hke;async function L8n(){let t=process.env.JEST_WORKER_ID?Tke():void 0,e;try{e=await WebAssembly.compile(zdt())}catch{e=await WebAssembly.compile(t||Tke())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:(n,r,s)=>0,wasm_on_status:(n,r,s)=>{ss(Il.ptr===n);let i=r-rS+nS.byteOffset;return Il.onStatus(new Tse(nS.buffer,i,s))||0},wasm_on_message_begin:n=>(ss(Il.ptr===n),Il.onMessageBegin()||0),wasm_on_header_field:(n,r,s)=>{ss(Il.ptr===n);let i=r-rS+nS.byteOffset;return Il.onHeaderField(new Tse(nS.buffer,i,s))||0},wasm_on_header_value:(n,r,s)=>{ss(Il.ptr===n);let i=r-rS+nS.byteOffset;return Il.onHeaderValue(new Tse(nS.buffer,i,s))||0},wasm_on_headers_complete:(n,r,s,i)=>(ss(Il.ptr===n),Il.onHeadersComplete(r,!!s,!!i)||0),wasm_on_body:(n,r,s)=>{ss(Il.ptr===n);let i=r-rS+nS.byteOffset;return Il.onBody(new Tse(nS.buffer,i,s))||0},wasm_on_message_complete:n=>(ss(Il.ptr===n),Il.onMessageComplete()||0)}})}var Vke=null,Yke=L8n();Yke.catch();var Il=null,nS=null,Rse=0,rS=null,F8n=0,Pj=1,HQ=2|Pj,Dse=4|Pj,Kke=8|F8n,zke=class{constructor(e,n,{exports:r}){ss(Number.isFinite(e[qke])&&e[qke]>0),this.llhttp=r,this.ptr=this.llhttp.llhttp_alloc(Pg.TYPE.RESPONSE),this.client=e,this.socket=n,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[qke],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[O8n]}setTimeout(e,n){e!==this.timeoutValue||n&Pj^this.timeoutType&Pj?(this.timeout&&(Wke.clearTimeout(this.timeout),this.timeout=null),e&&(n&Pj?this.timeout=Wke.setFastTimeout(rht,e,new WeakRef(this)):(this.timeout=setTimeout(rht,e,new WeakRef(this)),this.timeout.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=n}resume(){this.socket.destroyed||!this.paused||(ss(this.ptr!=null),ss(Il==null),this.llhttp.llhttp_resume(this.ptr),ss(this.timeoutType===Dse),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||nht),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){ss(this.ptr!=null),ss(Il==null),ss(!this.paused);let{socket:n,llhttp:r}=this;e.length>Rse&&(rS&&r.free(rS),Rse=Math.ceil(e.length/4096)*4096,rS=r.malloc(Rse)),new Uint8Array(r.memory.buffer,rS,Rse).set(e);try{let s;try{nS=e,Il=this,s=r.llhttp_execute(this.ptr,rS,e.length)}catch(o){throw o}finally{Il=null,nS=null}let i=r.llhttp_get_error_pos(this.ptr)-rS;if(s!==Pg.ERROR.OK){let o=e.subarray(i);if(s===Pg.ERROR.PAUSED_UPGRADE)this.onUpgrade(o);else if(s===Pg.ERROR.PAUSED)this.paused=!0,n.unshift(o);else throw this.createError(s,o)}}catch(s){_s.destroy(n,s)}}finish(){ss(Il===null),ss(this.ptr!=null),ss(!this.paused);let{llhttp:e}=this,n;try{Il=this,n=e.llhttp_finish(this.ptr)}finally{Il=null}return n===Pg.ERROR.OK?null:n===Pg.ERROR.PAUSED||n===Pg.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(n,nht)}createError(e,n){let{llhttp:r,contentLength:s,bytesRead:i}=this;if(s&&i!==parseInt(s,10))return new Xpt;let o=r.llhttp_get_error_reason(this.ptr),a="";if(o){let c=new Uint8Array(r.memory.buffer,o).indexOf(0);a="Response does not match the HTTP/1.1 protocol ("+Buffer.from(r.memory.buffer,o,c).toString()+")"}return new x8n(a,Pg.ERROR[e],n)}destroy(){ss(this.ptr!=null),ss(Il==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Wke.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){this.statusText=e.toString()}onMessageBegin(){let{socket:e,client:n}=this;if(e.destroyed)return-1;if(n[xu]===0)return _s.destroy(e,new WQ("bad response",_s.getSocketInfo(e))),-1;let r=n[Bb][n[By]];if(!r)return-1;r.onResponseStarted()}onHeaderField(e){let n=this.headers.length;(n&1)===0?this.headers.push(e):this.headers[n-1]=Buffer.concat([this.headers[n-1],e]),this.trackHeader(e.length)}onHeaderValue(e){let n=this.headers.length;(n&1)===1?(this.headers.push(e),n+=1):this.headers[n-1]=Buffer.concat([this.headers[n-1],e]);let r=this.headers[n-2];if(r.length===10){let s=_s.bufferToLowerCasedHeaderName(r);s==="keep-alive"?this.keepAlive+=e.toString():s==="connection"&&(this.connection+=e.toString())}else r.length===14&&_s.bufferToLowerCasedHeaderName(r)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&_s.destroy(this.socket,new C8n)}onUpgrade(e){let{upgrade:n,client:r,socket:s,headers:i,statusCode:o}=this;ss(n),ss(r[B1]===s),ss(!s.destroyed),ss(!this.paused),ss((i.length&1)===0);let a=r[Bb][r[By]];ss(a),ss(a.upgrade||a.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,s.unshift(e),s[dc].destroy(),s[dc]=null,s[kse]=null,s[um]=null,M8n(s),r[B1]=null,r[lht]=null,r[Bb][r[By]++]=null,r.emit("disconnect",r[aht],[r],new qQ("upgrade"));try{a.onUpgrade(o,i,s)}catch(c){_s.destroy(s,c)}r[lx]()}onHeadersComplete(e,n,r){let{client:s,socket:i,headers:o,statusText:a}=this;if(i.destroyed)return-1;if(s[xu]===0)return _s.destroy(i,new WQ("bad response",_s.getSocketInfo(i))),-1;let c=s[Bb][s[By]];if(!c)return-1;if(ss(!this.upgrade),ss(this.statusCode<200),e===100)return _s.destroy(i,new WQ("bad response",_s.getSocketInfo(i))),-1;if(n&&!c.upgrade)return _s.destroy(i,new WQ("bad upgrade",_s.getSocketInfo(i))),-1;if(ss(this.timeoutType===HQ),this.statusCode=e,this.shouldKeepAlive=r||c.method==="HEAD"&&!i[Ef]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let l=c.bodyTimeout!=null?c.bodyTimeout:s[B8n];this.setTimeout(l,Dse)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(c.method==="CONNECT")return ss(s[xu]===1),this.upgrade=!0,2;if(n)return ss(s[xu]===1),this.upgrade=!0,2;if(ss((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&s[Nse]){let l=this.keepAlive?_s.parseKeepAliveTimeout(this.keepAlive):null;if(l!=null){let d=Math.min(l-s[N8n],s[k8n]);d<=0?i[Ef]=!0:s[Bse]=d}else s[Bse]=s[T8n]}else i[Ef]=!0;let u=c.onHeaders(e,o,this.resume,a)===!1;return c.aborted?-1:c.method==="HEAD"||e<200?1:(i[Oj]&&(i[Oj]=!1,s[lx]()),u?Pg.ERROR.PAUSED:0)}onBody(e){let{client:n,socket:r,statusCode:s,maxResponseSize:i}=this;if(r.destroyed)return-1;let o=n[Bb][n[By]];if(ss(o),ss(this.timeoutType===Dse),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),ss(s>=200),i>-1&&this.bytesRead+e.length>i)return _s.destroy(r,new w8n),-1;if(this.bytesRead+=e.length,o.onData(e)===!1)return Pg.ERROR.PAUSED}onMessageComplete(){let{client:e,socket:n,statusCode:r,upgrade:s,headers:i,contentLength:o,bytesRead:a,shouldKeepAlive:c}=this;if(n.destroyed&&(!r||c))return-1;if(s)return;ss(r>=100),ss((this.headers.length&1)===0);let u=e[Bb][e[By]];if(ss(u),this.statusCode=null,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,!(r<200)){if(u.method!=="HEAD"&&o&&a!==parseInt(o,10))return _s.destroy(n,new Xpt),-1;if(u.onComplete(i),e[Bb][e[By]++]=null,n[Jke]=!0,n[Ev])return ss(e[xu]===0),_s.destroy(n,new qQ("reset")),Pg.ERROR.PAUSED;if(c){if(n[Ef]&&e[xu]===0)return _s.destroy(n,new qQ("reset")),Pg.ERROR.PAUSED;e[Nse]==null||e[Nse]===1?setImmediate(()=>e[lx]()):e[lx]()}else return _s.destroy(n,new qQ("reset")),Pg.ERROR.PAUSED}}};function rht(t){let{socket:e,timeoutType:n,client:r,paused:s}=t.deref();n===HQ?(!e[Ev]||e.writableNeedDrain||r[xu]>1)&&(ss(!s,"cannot be paused while waiting for headers"),_s.destroy(e,new S8n)):n===Dse?s||_s.destroy(e,new I8n):n===Kke&&(ss(r[xu]===0&&r[Bse]),_s.destroy(e,new qQ("socket idle timeout")))}async function Q8n(t,e){t[B1]=e,Vke||(Vke=await Yke,Yke=null),e[Bj]=!1,e[Ev]=!1,e[Ef]=!1,e[Oj]=!1,e[P1]=0,e[D1]=null,e[Jke]=!1,e[dc]=new zke(t,e,Vke),vse(e,"error",function(r){ss(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let s=this[dc];if(r.code==="ECONNRESET"&&s.statusCode&&!s.shouldKeepAlive){let i=s.finish();i&&(this[um]=i,this[kse][tht](i));return}this[um]=r,this[kse][tht](r)}),vse(e,"readable",function(){let r=this[dc];r&&r.readMore()}),vse(e,"end",function(){let r=this[dc];if(r.statusCode&&!r.shouldKeepAlive){let s=r.finish();s&&_s.destroy(this,s);return}_s.destroy(this,new WQ("other side closed",_s.getSocketInfo(this)))}),vse(e,"close",function(){let r=this[kse],s=this[dc];uht(this),s&&(!this[um]&&s.statusCode&&!s.shouldKeepAlive&&(this[um]=s.finish()||this[um]),this[dc].destroy(),this[dc]=null);let i=this[um]||new WQ("closed",_s.getSocketInfo(this));if(r[B1]=null,r[lht]=null,r.destroyed){ss(r[cht]===0);let o=r[Bb].splice(r[By]);for(let a=0;a0&&i.code!=="UND_ERR_INFO"){let o=r[Bb][r[By]];r[Bb][r[By]++]=null,_s.errorRequest(r,o,i)}r[R8n]=r[By],ss(r[xu]===0),r.emit("disconnect",r[aht],[r],i),r[lx]()});let n=!1;return e.on("close",()=>{n=!0}),{version:"h1",defaultPipelining:1,write(...r){return W8n(t,...r)},resume(){$8n(t)},destroy(r,s){n?queueMicrotask(s):e.destroy(r).on("close",s)},get destroyed(){return e.destroyed},busy(r){return!!(e[Ev]||e[Ef]||e[Oj]||e[P1]===1||r&&(t[xu]>0&&!r.idempotent||t[xu]>0&&(r.upgrade||r.method==="CONNECT")||t[xu]>0&&_s.bodyLength(r.body)!==0&&(_s.isStream(r.body)||_s.isAsyncIterable(r.body)||_s.isFormDataLike(r.body))))}}}function uht(t){t[D1]&&(clearTimeout(t[D1]),t[D1]=null),t[P1]=0}function U8n(t,e){e[P1]=1,e[D1]=setTimeout(()=>{e[D1]=null,e[P1]=2,t[B1]===e&&!e.destroyed&&t[lx]()},0),e[D1].unref?.()}function $8n(t){let e=t[B1];if(e&&!e.destroyed){if(t[Zpt]===0?!e[Bj]&&e.unref&&(e.unref(),e[Bj]=!0):e[Bj]&&e.ref&&(e.ref(),e[Bj]=!1),t[xu]===0&&t[cht]>0&&e[Jke]){if(e[P1]===0)return U8n(t,e),e[dc].readMore(),e.destroyed,void 0;if(e[P1]===1)return e[dc].readMore(),e.destroyed,void 0}if(t[xu]===0&&(e[dc].readMore(),e.destroyed))return;if(t[Zpt]===0)e[dc].timeoutType!==Kke&&e[dc].setTimeout(t[Bse],Kke);else if(t[xu]>0&&e[dc].statusCode<200&&e[dc].timeoutType!==HQ){let n=t[Bb][t[By]],r=n.headersTimeout!=null?n.headersTimeout:t[D8n];e[dc].setTimeout(r,HQ)}}}function G8n(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}function W8n(t,e){let{method:n,path:r,host:s,upgrade:i,blocking:o,reset:a}=e,{body:c,headers:u,contentLength:l}=e,d=n==="PUT"||n==="POST"||n==="PATCH"||n==="QUERY"||n==="PROPFIND"||n==="PROPPATCH";if(_s.isFormDataLike(c)){Hke||(Hke=GQ().extractBody);let[A,y]=Hke(c);e.contentType==null&&u.push("content-type",y),c=A.stream,l=A.length}else _s.isBlobLike(c)&&e.contentType==null&&c.type&&u.push("content-type",c.type);c&&typeof c.read=="function"&&c.read(0);let h=_s.bodyLength(c);if(l=h??l,l===null&&(l=e.contentLength),l===0&&!d&&(l=null),G8n(n)&&l>0&&e.contentLength!==null&&e.contentLength!==l){if(t[jke])return _s.errorRequest(t,e,new N1),!1;process.emitWarning(new N1)}let m=t[B1];uht(m);let f=A=>{e.aborted||e.completed||(_s.errorRequest(t,e,A||new oht),_s.destroy(c),_s.destroy(m,new qQ("aborted")))};try{e.onConnect(f)}catch(A){_s.errorRequest(t,e,A)}if(e.aborted)return!1;n==="HEAD"&&(m[Ef]=!0),(i||n==="CONNECT")&&(m[Ef]=!0),a!=null&&(m[Ef]=a),t[eht]&&m[P8n]++>=t[eht]&&(m[Ef]=!0),o&&(m[Oj]=!0);let g=`${n} ${r} HTTP/1.1\r -`;if(typeof s=="string"?g+=`host: ${s}\r -`:g+=t[v8n],i?g+=`connection: upgrade\r -upgrade: ${i}\r -`:t[Nse]&&!m[Ef]?g+=`connection: keep-alive\r +`);m.push(E,y,h),typeof y.size=="number"?s+=E.byteLength+y.size+h.byteLength:f=!0}let g=fue.encode(`--${c}--\r +`);m.push(g),s+=g.byteLength,f&&(s=null),i=t,r=async function*(){for(let A of m)A.stream?yield*A.stream():yield A},o=`multipart/form-data; boundary=${c}`}else if(Owt(t))i=t,s=t.size,t.type&&(o=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(B6.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");n=t instanceof ReadableStream?t:jxr(t)}if((typeof i=="string"||B6.isBuffer(i))&&(s=Buffer.byteLength(i)),r!=null){let c;n=new ReadableStream({async start(){c=r(t)[Symbol.asyncIterator]()},async pull(u){let{value:l,done:d}=await c.next();if(d)queueMicrotask(()=>{u.close(),u.byobRequest?.respond(0)});else if(!Uwt(n)){let m=new Uint8Array(l);m.byteLength&&u.enqueue(m)}return u.desiredSize>0},async cancel(u){await c.return()},type:"bytes"})}return[{stream:n,source:i,length:s},o]}function sSr(t,e=!1){return t instanceof ReadableStream&&(c2e(!B6.isDisturbed(t),"The body has already been consumed."),c2e(!t.locked,"The stream is locked.")),Wwt(t,e)}function oSr(t,e){let[n,r]=e.stream.tee();return e.stream=n,{stream:r,length:e.length,source:e.source}}function aSr(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}function cSr(t){return{blob(){return l$(this,n=>{let r=Fwt(this);return r===null?r="":r&&(r=nSr(r)),new Zxr([n],{type:r})},t)},arrayBuffer(){return l$(this,n=>new Uint8Array(n).buffer,t)},text(){return l$(this,Qwt,t)},json(){return l$(this,uSr,t)},formData(){return l$(this,n=>{let r=Fwt(this);if(r!==null)switch(r.essence){case"multipart/form-data":{let i=rSr(n,r);if(i==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new Lwt;return s[u$]=i,s}case"application/x-www-form-urlencoded":{let i=new URLSearchParams(n.toString()),s=new Lwt;for(let[o,a]of i)s.append(o,a);return s}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return l$(this,n=>new Uint8Array(n),t)}}}function lSr(t){Object.assign(t.prototype,cSr(t))}async function l$(t,e,n){if(Xxr.brandCheck(t,n),Hwt(t))throw new TypeError("Body is unusable: Body has already been read");aSr(t[u$]);let r=zxr(),i=o=>r.reject(o),s=o=>{try{r.resolve(e(o))}catch(a){i(a)}};return t[u$].body==null?(s(Buffer.allocUnsafe(0)),r.promise):(await Kxr(t[u$].body,s,i),r.promise)}function Hwt(t){let e=t[u$].body;return e!=null&&(e.stream.locked||B6.isDisturbed(e.stream))}function uSr(t){return JSON.parse(Qwt(t))}function Fwt(t){let e=t[u$].headersList,n=Jxr(e);return n==="failure"?null:n}qwt.exports={extractBody:Wwt,safelyExtractBody:sSr,cloneBody:oSr,mixinBody:lSr,streamRegistry:$wt,hasFinalizationRegistry:Gwt,bodyUnusable:Hwt}});var aTt=re((sBs,oTt)=>{"use strict";p();var li=require("node:assert"),Ii=to(),{channels:jwt}=XG(),u2e=qLe(),{RequestContentLengthMismatchError:NM,ResponseContentLengthMismatchError:Vwt,RequestAbortedError:tTt,HeadersTimeoutError:dSr,HeadersOverflowError:pSr,SocketError:p$,InformationalError:m$,BodyTimeoutError:mSr,HTTPParserError:hSr,ResponseExceededMaxSizeError:fSr}=Jo(),{kUrl:nTt,kReset:Gg,kClient:Eue,kParser:Kc,kBlocking:P6,kRunning:Ed,kPending:rTt,kSize:Ywt,kWriting:t1,kQueue:b_,kNoRef:N6,kKeepAliveDefaultTimeout:gSr,kHostHeader:ASr,kPendingIdx:ySr,kRunningIdx:i0,kError:xf,kPipelining:bue,kSocket:PM,kKeepAliveTimeoutValue:xue,kMaxHeadersSize:d2e,kKeepAliveMaxTimeout:ESr,kKeepAliveTimeoutThreshold:bSr,kHeadersTimeout:_Sr,kBodyTimeout:xSr,kStrictContentLength:h2e,kMaxRequests:zwt,kCounter:SSr,kMaxResponseSize:CSr,kOnError:Kwt,kResume:BT,kHTTPContext:iTt}=bl(),ty=$It(),Jwt=Buffer.alloc(0),gue=Buffer[Symbol.species],Aue=Ii.addListener,ISr=Ii.removeAllListeners,MM=Symbol("kIdleSocketValidation"),DM=Symbol("kIdleSocketValidationTimeout"),y2e=Symbol("kSocketUsed"),p2e;async function wSr(){let t=process.env.JEST_WORKER_ID?YLe():void 0,e;try{e=await WebAssembly.compile(qIt())}catch{e=await WebAssembly.compile(t||YLe())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:(n,r,i)=>0,wasm_on_status:(n,r,i)=>{li(hu.ptr===n);let s=r-ZS+XS.byteOffset;return hu.onStatus(new gue(XS.buffer,s,i))||0},wasm_on_message_begin:n=>(li(hu.ptr===n),hu.onMessageBegin()||0),wasm_on_header_field:(n,r,i)=>{li(hu.ptr===n);let s=r-ZS+XS.byteOffset;return hu.onHeaderField(new gue(XS.buffer,s,i))||0},wasm_on_header_value:(n,r,i)=>{li(hu.ptr===n);let s=r-ZS+XS.byteOffset;return hu.onHeaderValue(new gue(XS.buffer,s,i))||0},wasm_on_headers_complete:(n,r,i,s)=>(li(hu.ptr===n),hu.onHeadersComplete(r,!!i,!!s)||0),wasm_on_body:(n,r,i)=>{li(hu.ptr===n);let s=r-ZS+XS.byteOffset;return hu.onBody(new gue(XS.buffer,s,i))||0},wasm_on_message_complete:n=>(li(hu.ptr===n),hu.onMessageComplete()||0)}})}var m2e=null,f2e=wSr();f2e.catch();var hu=null,XS=null,yue=0,ZS=null,TSr=0,D6=1,h$=2|D6,_ue=4|D6,g2e=8|TSr,A2e=class{constructor(e,n,{exports:r}){li(Number.isFinite(e[d2e])&&e[d2e]>0),this.llhttp=r,this.ptr=this.llhttp.llhttp_alloc(ty.TYPE.RESPONSE),this.client=e,this.socket=n,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[d2e],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[CSr]}setTimeout(e,n){e!==this.timeoutValue||n&D6^this.timeoutType&D6?(this.timeout&&(u2e.clearTimeout(this.timeout),this.timeout=null),e&&(n&D6?this.timeout=u2e.setFastTimeout(Xwt,e,new WeakRef(this)):(this.timeout=setTimeout(Xwt,e,new WeakRef(this)),this.timeout.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=n}resume(){this.socket.destroyed||!this.paused||(li(this.ptr!=null),li(hu==null),this.llhttp.llhttp_resume(this.ptr),li(this.timeoutType===_ue),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Jwt),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){li(this.ptr!=null),li(hu==null),li(!this.paused);let{socket:n,llhttp:r}=this;e.length>yue&&(ZS&&r.free(ZS),yue=Math.ceil(e.length/4096)*4096,ZS=r.malloc(yue)),new Uint8Array(r.memory.buffer,ZS,yue).set(e);try{let i;try{XS=e,hu=this,i=r.llhttp_execute(this.ptr,ZS,e.length)}catch(o){throw o}finally{hu=null,XS=null}let s=r.llhttp_get_error_pos(this.ptr)-ZS;if(i!==ty.ERROR.OK){let o=e.subarray(s);if(i===ty.ERROR.PAUSED_UPGRADE)this.onUpgrade(o);else if(i===ty.ERROR.PAUSED)this.paused=!0,n.unshift(o);else throw this.createError(i,o)}}catch(i){Ii.destroy(n,i)}}finish(){li(hu===null),li(this.ptr!=null),li(!this.paused);let{llhttp:e}=this,n;try{hu=this,n=e.llhttp_finish(this.ptr)}finally{hu=null}return n===ty.ERROR.OK?null:n===ty.ERROR.PAUSED||n===ty.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(n,Jwt)}createError(e,n){let{llhttp:r,contentLength:i,bytesRead:s}=this;if(i&&s!==parseInt(i,10))return new Vwt;let o=r.llhttp_get_error_reason(this.ptr),a="";if(o){let c=new Uint8Array(r.memory.buffer,o).indexOf(0);a="Response does not match the HTTP/1.1 protocol ("+Buffer.from(r.memory.buffer,o,c).toString()+")"}return new hSr(a,ty.ERROR[e],n)}destroy(){li(this.ptr!=null),li(hu==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&u2e.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){this.statusText=e.toString()}onMessageBegin(){let{socket:e,client:n}=this;if(e.destroyed)return-1;if(n[Ed]===0)return Ii.destroy(e,new p$("bad response",Ii.getSocketInfo(e))),-1;let r=n[b_][n[i0]];if(!r)return-1;r.onResponseStarted()}onHeaderField(e){let n=this.headers.length;(n&1)===0?this.headers.push(e):this.headers[n-1]=Buffer.concat([this.headers[n-1],e]),this.trackHeader(e.length)}onHeaderValue(e){let n=this.headers.length;(n&1)===1?(this.headers.push(e),n+=1):this.headers[n-1]=Buffer.concat([this.headers[n-1],e]);let r=this.headers[n-2];if(r.length===10){let i=Ii.bufferToLowerCasedHeaderName(r);i==="keep-alive"?this.keepAlive+=e.toString():i==="connection"&&(this.connection+=e.toString())}else r.length===14&&Ii.bufferToLowerCasedHeaderName(r)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ii.destroy(this.socket,new pSr)}onUpgrade(e){let{upgrade:n,client:r,socket:i,headers:s,statusCode:o}=this;li(n),li(r[PM]===i),li(!i.destroyed),li(!this.paused),li((s.length&1)===0);let a=r[b_][r[i0]];li(a),li(a.upgrade||a.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,i.unshift(e),i[Kc].destroy(),i[Kc]=null,i[Eue]=null,i[xf]=null,ISr(i),r[PM]=null,r[iTt]=null,r[b_][r[i0]++]=null,r.emit("disconnect",r[nTt],[r],new m$("upgrade"));try{a.onUpgrade(o,s,i)}catch(c){Ii.destroy(i,c)}r[BT]()}onHeadersComplete(e,n,r){let{client:i,socket:s,headers:o,statusText:a}=this;if(s.destroyed)return-1;if(i[Ed]===0)return Ii.destroy(s,new p$("bad response",Ii.getSocketInfo(s))),-1;let c=i[b_][i[i0]];if(!c)return-1;if(li(!this.upgrade),li(this.statusCode<200),e===100)return Ii.destroy(s,new p$("bad response",Ii.getSocketInfo(s))),-1;if(n&&!c.upgrade)return Ii.destroy(s,new p$("bad upgrade",Ii.getSocketInfo(s))),-1;if(li(this.timeoutType===h$),this.statusCode=e,this.shouldKeepAlive=r||c.method==="HEAD"&&!s[Gg]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let l=c.bodyTimeout!=null?c.bodyTimeout:i[xSr];this.setTimeout(l,_ue)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(c.method==="CONNECT")return li(i[Ed]===1),this.upgrade=!0,2;if(n)return li(i[Ed]===1),this.upgrade=!0,2;if(li((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&i[bue]){let l=this.keepAlive?Ii.parseKeepAliveTimeout(this.keepAlive):null;if(l!=null){let d=Math.min(l-i[bSr],i[ESr]);d<=0?s[Gg]=!0:i[xue]=d}else i[xue]=i[gSr]}else s[Gg]=!0;let u=c.onHeaders(e,o,this.resume,a)===!1;return c.aborted?-1:c.method==="HEAD"||e<200?1:(s[P6]&&(s[P6]=!1,i[BT]()),u?ty.ERROR.PAUSED:0)}onBody(e){let{client:n,socket:r,statusCode:i,maxResponseSize:s}=this;if(r.destroyed)return-1;let o=n[b_][n[i0]];if(li(o),li(this.timeoutType===_ue),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),li(i>=200),s>-1&&this.bytesRead+e.length>s)return Ii.destroy(r,new fSr),-1;if(this.bytesRead+=e.length,o.onData(e)===!1)return ty.ERROR.PAUSED}onMessageComplete(){let{client:e,socket:n,statusCode:r,upgrade:i,headers:s,contentLength:o,bytesRead:a,shouldKeepAlive:c}=this;if(n.destroyed&&(!r||c))return-1;if(i)return;li(r>=100),li((this.headers.length&1)===0);let u=e[b_][e[i0]];if(li(u),this.statusCode=null,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,!(r<200)){if(u.method!=="HEAD"&&o&&a!==parseInt(o,10))return Ii.destroy(n,new Vwt),-1;if(u.onComplete(s),e[b_][e[i0]++]=null,n[y2e]=!0,n[t1])return li(e[Ed]===0),Ii.destroy(n,new m$("reset")),ty.ERROR.PAUSED;if(c){if(n[Gg]&&e[Ed]===0)return Ii.destroy(n,new m$("reset")),ty.ERROR.PAUSED;e[bue]==null||e[bue]===1?setImmediate(()=>e[BT]()):e[BT]()}else return Ii.destroy(n,new m$("reset")),ty.ERROR.PAUSED}}};function Xwt(t){let{socket:e,timeoutType:n,client:r,paused:i}=t.deref();n===h$?(!e[t1]||e.writableNeedDrain||r[Ed]>1)&&(li(!i,"cannot be paused while waiting for headers"),Ii.destroy(e,new dSr)):n===_ue?i||Ii.destroy(e,new mSr):n===g2e&&(li(r[Ed]===0&&r[xue]),Ii.destroy(e,new m$("socket idle timeout")))}async function vSr(t,e){t[PM]=e,m2e||(m2e=await f2e,f2e=null),e[N6]=!1,e[t1]=!1,e[Gg]=!1,e[P6]=!1,e[MM]=0,e[DM]=null,e[y2e]=!1,e[Kc]=new A2e(t,e,m2e),Aue(e,"error",function(r){li(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let i=this[Kc];if(r.code==="ECONNRESET"&&i.statusCode&&!i.shouldKeepAlive){let s=i.finish();s&&(this[xf]=s,this[Eue][Kwt](s));return}this[xf]=r,this[Eue][Kwt](r)}),Aue(e,"readable",function(){let r=this[Kc];r&&r.readMore()}),Aue(e,"end",function(){let r=this[Kc];if(r.statusCode&&!r.shouldKeepAlive){let i=r.finish();i&&Ii.destroy(this,i);return}Ii.destroy(this,new p$("other side closed",Ii.getSocketInfo(this)))}),Aue(e,"close",function(){let r=this[Eue],i=this[Kc];sTt(this),i&&(!this[xf]&&i.statusCode&&!i.shouldKeepAlive&&(this[xf]=i.finish()||this[xf]),this[Kc].destroy(),this[Kc]=null);let s=this[xf]||new p$("closed",Ii.getSocketInfo(this));if(r[PM]=null,r[iTt]=null,r.destroyed){li(r[rTt]===0);let o=r[b_].splice(r[i0]);for(let a=0;a0&&s.code!=="UND_ERR_INFO"){let o=r[b_][r[i0]];r[b_][r[i0]++]=null,Ii.errorRequest(r,o,s)}r[ySr]=r[i0],li(r[Ed]===0),r.emit("disconnect",r[nTt],[r],s),r[BT]()});let n=!1;return e.on("close",()=>{n=!0}),{version:"h1",defaultPipelining:1,write(...r){return NSr(t,...r)},resume(){kSr(t)},destroy(r,i){n?queueMicrotask(i):e.destroy(r).on("close",i)},get destroyed(){return e.destroyed},busy(r){return!!(e[t1]||e[Gg]||e[P6]||e[MM]===1||r&&(t[Ed]>0&&!r.idempotent||t[Ed]>0&&(r.upgrade||r.method==="CONNECT")||t[Ed]>0&&Ii.bodyLength(r.body)!==0&&(Ii.isStream(r.body)||Ii.isAsyncIterable(r.body)||Ii.isFormDataLike(r.body))))}}}function sTt(t){t[DM]&&(clearTimeout(t[DM]),t[DM]=null),t[MM]=0}function RSr(t,e){e[MM]=1,e[DM]=setTimeout(()=>{e[DM]=null,e[MM]=2,t[PM]===e&&!e.destroyed&&t[BT]()},0),e[DM].unref?.()}function kSr(t){let e=t[PM];if(e&&!e.destroyed){if(t[Ywt]===0?!e[N6]&&e.unref&&(e.unref(),e[N6]=!0):e[N6]&&e.ref&&(e.ref(),e[N6]=!1),t[Ed]===0&&t[rTt]>0&&e[y2e]){if(e[MM]===0)return RSr(t,e),e[Kc].readMore(),e.destroyed,void 0;if(e[MM]===1)return e[Kc].readMore(),e.destroyed,void 0}if(t[Ed]===0&&(e[Kc].readMore(),e.destroyed))return;if(t[Ywt]===0)e[Kc].timeoutType!==g2e&&e[Kc].setTimeout(t[xue],g2e);else if(t[Ed]>0&&e[Kc].statusCode<200&&e[Kc].timeoutType!==h$){let n=t[b_][t[i0]],r=n.headersTimeout!=null?n.headersTimeout:t[_Sr];e[Kc].setTimeout(r,h$)}}}function BSr(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}function NSr(t,e){let{method:n,path:r,host:i,upgrade:s,blocking:o,reset:a}=e,{body:c,headers:u,contentLength:l}=e,d=n==="PUT"||n==="POST"||n==="PATCH"||n==="QUERY"||n==="PROPFIND"||n==="PROPPATCH";if(Ii.isFormDataLike(c)){p2e||(p2e=d$().extractBody);let[A,y]=p2e(c);e.contentType==null&&u.push("content-type",y),c=A.stream,l=A.length}else Ii.isBlobLike(c)&&e.contentType==null&&c.type&&u.push("content-type",c.type);c&&typeof c.read=="function"&&c.read(0);let m=Ii.bodyLength(c);if(l=m??l,l===null&&(l=e.contentLength),l===0&&!d&&(l=null),BSr(n)&&l>0&&e.contentLength!==null&&e.contentLength!==l){if(t[h2e])return Ii.errorRequest(t,e,new NM),!1;process.emitWarning(new NM)}let h=t[PM];sTt(h);let f=A=>{e.aborted||e.completed||(Ii.errorRequest(t,e,A||new tTt),Ii.destroy(c),Ii.destroy(h,new m$("aborted")))};try{e.onConnect(f)}catch(A){Ii.errorRequest(t,e,A)}if(e.aborted)return!1;n==="HEAD"&&(h[Gg]=!0),(s||n==="CONNECT")&&(h[Gg]=!0),a!=null&&(h[Gg]=a),t[zwt]&&h[SSr]++>=t[zwt]&&(h[Gg]=!0),o&&(h[P6]=!0);let g=`${n} ${r} HTTP/1.1\r +`;if(typeof i=="string"?g+=`host: ${i}\r +`:g+=t[ASr],s?g+=`connection: upgrade\r +upgrade: ${s}\r +`:t[bue]&&!h[Gg]?g+=`connection: keep-alive\r `:g+=`connection: close\r -`,Array.isArray(u))for(let A=0;A{e.removeListener("error",m)}),!c){let f=new oht;queueMicrotask(()=>m(f))}},m=function(f){if(!c){if(c=!0,ss(s.destroyed||s[Ev]&&n[xu]<=1),s.off("drain",d).off("error",m),e.removeListener("data",l).removeListener("end",m).removeListener("close",h),!f)try{u.end()}catch(g){f=g}u.destroy(f),f&&(f.code!=="UND_ERR_INFO"||f.message!=="reset")?_s.destroy(e,f):_s.destroy(e)}};e.on("data",l).on("end",m).on("error",m).on("close",h),e.resume&&e.resume(),s.on("drain",d).on("error",m),e.errorEmitted??e.errored?setImmediate(()=>m(e.errored)):(e.endEmitted??e.readableEnded)&&setImmediate(()=>m(null)),(e.closeEmitted??e.closed)&&setImmediate(h)}function sht(t,e,n,r,s,i,o,a){try{e?_s.isBuffer(e)&&(ss(i===e.byteLength,"buffer body must have content length"),s.cork(),s.write(`${o}content-length: ${i}\r +`,Array.isArray(u))for(let A=0;A{e.removeListener("error",h)}),!c){let f=new tTt;queueMicrotask(()=>h(f))}},h=function(f){if(!c){if(c=!0,li(i.destroyed||i[t1]&&n[Ed]<=1),i.off("drain",d).off("error",h),e.removeListener("data",l).removeListener("end",h).removeListener("close",m),!f)try{u.end()}catch(g){f=g}u.destroy(f),f&&(f.code!=="UND_ERR_INFO"||f.message!=="reset")?Ii.destroy(e,f):Ii.destroy(e)}};e.on("data",l).on("end",h).on("error",h).on("close",m),e.resume&&e.resume(),i.on("drain",d).on("error",h),e.errorEmitted??e.errored?setImmediate(()=>h(e.errored)):(e.endEmitted??e.readableEnded)&&setImmediate(()=>h(null)),(e.closeEmitted??e.closed)&&setImmediate(m)}function Zwt(t,e,n,r,i,s,o,a){try{e?Ii.isBuffer(e)&&(li(s===e.byteLength,"buffer body must have content length"),i.cork(),i.write(`${o}content-length: ${s}\r \r -`,"latin1"),s.write(e),s.uncork(),r.onBodySent(e),!a&&r.reset!==!1&&(s[Ef]=!0)):i===0?s.write(`${o}content-length: 0\r +`,"latin1"),i.write(e),i.uncork(),r.onBodySent(e),!a&&r.reset!==!1&&(i[Gg]=!0)):s===0?i.write(`${o}content-length: 0\r \r -`,"latin1"):(ss(i===null,"no body must not have content length"),s.write(`${o}\r -`,"latin1")),r.onRequestSent(),n[lx]()}catch(c){t(c)}}async function H8n(t,e,n,r,s,i,o,a){ss(i===e.size,"blob body must have content length");try{if(i!=null&&i!==e.size)throw new N1;let c=Buffer.from(await e.arrayBuffer());s.cork(),s.write(`${o}content-length: ${i}\r +`,"latin1"):(li(s===null,"no body must not have content length"),i.write(`${o}\r +`,"latin1")),r.onRequestSent(),n[BT]()}catch(c){t(c)}}async function PSr(t,e,n,r,i,s,o,a){li(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new NM;let c=Buffer.from(await e.arrayBuffer());i.cork(),i.write(`${o}content-length: ${s}\r \r -`,"latin1"),s.write(c),s.uncork(),r.onBodySent(c),r.onRequestSent(),!a&&r.reset!==!1&&(s[Ef]=!0),n[lx]()}catch(c){t(c)}}async function iht(t,e,n,r,s,i,o,a){ss(i!==0||n[xu]===0,"iterator body cannot be pipelined");let c=null;function u(){if(c){let h=c;c=null,h()}}let l=()=>new Promise((h,m)=>{ss(c===null),s[um]?m(s[um]):c=h});s.on("close",u).on("drain",u);let d=new Pse({abort:t,socket:s,request:r,contentLength:i,client:n,expectsPayload:a,header:o});try{for await(let h of e){if(s[um])throw s[um];d.write(h)||await l()}d.end()}catch(h){d.destroy(h)}finally{s.off("close",u).off("drain",u)}}var Pse=class{constructor({abort:e,socket:n,request:r,contentLength:s,client:i,expectsPayload:o,header:a}){this.socket=n,this.request=r,this.contentLength=s,this.client=i,this.bytesWritten=0,this.expectsPayload=o,this.header=a,this.abort=e,n[Ev]=!0}write(e){let{socket:n,request:r,contentLength:s,client:i,bytesWritten:o,expectsPayload:a,header:c}=this;if(n[um])throw n[um];if(n.destroyed)return!1;let u=Buffer.byteLength(e);if(!u)return!0;if(s!==null&&o+u>s){if(i[jke])throw new N1;process.emitWarning(new N1)}n.cork(),o===0&&(!a&&r.reset!==!1&&(n[Ef]=!0),s===null?n.write(`${c}transfer-encoding: chunked\r -`,"latin1"):n.write(`${c}content-length: ${s}\r +`,"latin1"),i.write(c),i.uncork(),r.onBodySent(c),r.onRequestSent(),!a&&r.reset!==!1&&(i[Gg]=!0),n[BT]()}catch(c){t(c)}}async function eTt(t,e,n,r,i,s,o,a){li(s!==0||n[Ed]===0,"iterator body cannot be pipelined");let c=null;function u(){if(c){let m=c;c=null,m()}}let l=()=>new Promise((m,h)=>{li(c===null),i[xf]?h(i[xf]):c=m});i.on("close",u).on("drain",u);let d=new Sue({abort:t,socket:i,request:r,contentLength:s,client:n,expectsPayload:a,header:o});try{for await(let m of e){if(i[xf])throw i[xf];d.write(m)||await l()}d.end()}catch(m){d.destroy(m)}finally{i.off("close",u).off("drain",u)}}var Sue=class{constructor({abort:e,socket:n,request:r,contentLength:i,client:s,expectsPayload:o,header:a}){this.socket=n,this.request=r,this.contentLength=i,this.client=s,this.bytesWritten=0,this.expectsPayload=o,this.header=a,this.abort=e,n[t1]=!0}write(e){let{socket:n,request:r,contentLength:i,client:s,bytesWritten:o,expectsPayload:a,header:c}=this;if(n[xf])throw n[xf];if(n.destroyed)return!1;let u=Buffer.byteLength(e);if(!u)return!0;if(i!==null&&o+u>i){if(s[h2e])throw new NM;process.emitWarning(new NM)}n.cork(),o===0&&(!a&&r.reset!==!1&&(n[Gg]=!0),i===null?n.write(`${c}transfer-encoding: chunked\r +`,"latin1"):n.write(`${c}content-length: ${i}\r \r -`,"latin1")),s===null&&n.write(`\r +`,"latin1")),i===null&&n.write(`\r ${u.toString(16)}\r -`,"latin1"),this.bytesWritten+=u;let l=n.write(e);return n.uncork(),r.onBodySent(e),l||n[dc].timeout&&n[dc].timeoutType===HQ&&n[dc].timeout.refresh&&n[dc].timeout.refresh(),l}end(){let{socket:e,contentLength:n,client:r,bytesWritten:s,expectsPayload:i,header:o,request:a}=this;if(a.onRequestSent(),e[Ev]=!1,e[um])throw e[um];if(!e.destroyed){if(s===0?i?e.write(`${o}content-length: 0\r +`,"latin1"),this.bytesWritten+=u;let l=n.write(e);return n.uncork(),r.onBodySent(e),l||n[Kc].timeout&&n[Kc].timeoutType===h$&&n[Kc].timeout.refresh&&n[Kc].timeout.refresh(),l}end(){let{socket:e,contentLength:n,client:r,bytesWritten:i,expectsPayload:s,header:o,request:a}=this;if(a.onRequestSent(),e[t1]=!1,e[xf])throw e[xf];if(!e.destroyed){if(i===0?s?e.write(`${o}content-length: 0\r \r `,"latin1"):e.write(`${o}\r `,"latin1"):n===null&&e.write(`\r 0\r \r -`,"latin1"),n!==null&&s!==n){if(r[jke])throw new N1;process.emitWarning(new N1)}e[dc].timeout&&e[dc].timeoutType===HQ&&e[dc].timeout.refresh&&e[dc].timeout.refresh(),r[lx]()}}destroy(e){let{socket:n,client:r,abort:s}=this;n[Ev]=!1,e&&(ss(r[xu]<=1,"pipeline should only contain this request"),s(e))}};dht.exports=Q8n});var bht=ee((Hzs,Eht)=>{"use strict";p();var Py=require("node:assert"),{pipeline:V8n}=require("node:stream"),so=Wi(),{RequestContentLengthMismatchError:Xke,RequestAbortedError:hht,SocketError:Mj,InformationalError:Zke}=Do(),{kUrl:Ose,kReset:Lse,kClient:VQ,kRunning:Fse,kPending:j8n,kQueue:bv,kPendingIdx:eNe,kRunningIdx:Pb,kError:Mb,kSocket:Pd,kStrictContentLength:Y8n,kOnError:tNe,kMaxConcurrentStreams:yht,kHTTP2Session:Ob,kResume:_v,kSize:K8n,kHTTPContext:z8n}=Nc(),ux=Symbol("open streams"),mht,fht=!1,Mse;try{Mse=require("node:http2")}catch{Mse={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:J8n,HTTP2_HEADER_METHOD:X8n,HTTP2_HEADER_PATH:Z8n,HTTP2_HEADER_SCHEME:e9n,HTTP2_HEADER_CONTENT_LENGTH:t9n,HTTP2_HEADER_EXPECT:n9n,HTTP2_HEADER_STATUS:r9n}}=Mse;function s9n(t){let e=[];for(let[n,r]of Object.entries(t))if(Array.isArray(r))for(let s of r)e.push(Buffer.from(n),Buffer.from(s));else e.push(Buffer.from(n),Buffer.from(r));return e}async function i9n(t,e){t[Pd]=e,fht||(fht=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let n=Mse.connect(t[Ose],{createConnection:()=>e,peerMaxConcurrentStreams:t[yht]});n[ux]=0,n[VQ]=t,n[Pd]=e,so.addListener(n,"error",a9n),so.addListener(n,"frameError",c9n),so.addListener(n,"end",l9n),so.addListener(n,"goaway",u9n),so.addListener(n,"close",function(){let{[VQ]:s}=this,{[Pd]:i}=s,o=this[Pd][Mb]||this[Mb]||new Mj("closed",so.getSocketInfo(i));if(s[Ob]=null,s.destroyed){Py(s[j8n]===0);let a=s[bv].splice(s[Pb]);for(let c=0;c{r=!0}),{version:"h2",defaultPipelining:1/0,write(...s){return p9n(t,...s)},resume(){o9n(t)},destroy(s,i){r?queueMicrotask(i):e.destroy(s).on("close",i)},get destroyed(){return e.destroyed},busy(){return!1}}}function o9n(t){let e=t[Pd];e?.destroyed===!1&&(t[K8n]===0&&t[yht]===0?(e.unref(),t[Ob].unref()):(e.ref(),t[Ob].ref()))}function a9n(t){Py(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Pd][Mb]=t,this[VQ][tNe](t)}function c9n(t,e,n){if(n===0){let r=new Zke(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[Pd][Mb]=r,this[VQ][tNe](r)}}function l9n(){let t=new Mj("other side closed",so.getSocketInfo(this[Pd]));this.destroy(t),so.destroy(this[Pd],t)}function u9n(t){let e=this[Mb]||new Mj(`HTTP/2: "GOAWAY" frame received with code ${t}`,so.getSocketInfo(this)),n=this[VQ];if(n[Pd]=null,n[z8n]=null,this[Ob]!=null&&(this[Ob].destroy(e),this[Ob]=null),so.destroy(this[Pd],e),n[Pb]{e.aborted||e.completed||(C=C||new hht,so.errorRequest(t,e,C),h!=null&&so.destroy(h,C),so.destroy(l,C),t[bv][t[Pb]++]=null,t[_v]())};try{e.onConnect(g)}catch(C){so.errorRequest(t,e,C)}if(e.aborted)return!1;if(r==="CONNECT")return n.ref(),h=n.request(d,{endStream:!1,signal:c}),h.id&&!h.pending?(e.onUpgrade(null,null,h),++n[ux],t[bv][t[Pb]++]=null):h.once("ready",()=>{e.onUpgrade(null,null,h),++n[ux],t[bv][t[Pb]++]=null}),h.once("close",()=>{n[ux]-=1,n[ux]===0&&n.unref()}),!0;d[Z8n]=s,d[e9n]="https";let A=r==="PUT"||r==="POST"||r==="PATCH";l&&typeof l.read=="function"&&l.read(0);let y=so.bodyLength(l);if(so.isFormDataLike(l)){mht??=GQ().extractBody;let[C,I]=mht(l);d["content-type"]=I,l=C.stream,y=C.length}if(y==null&&(y=e.contentLength),(y===0||!A)&&(y=null),d9n(r)&&y>0&&e.contentLength!=null&&e.contentLength!==y){if(t[Y8n])return so.errorRequest(t,e,new Xke),!1;process.emitWarning(new Xke)}y!=null&&(Py(l,"no body must not have content length"),d[t9n]=`${y}`),n.ref();let b=r==="GET"||r==="HEAD"||l===null;return a?(d[n9n]="100-continue",h=n.request(d,{endStream:b,signal:c}),h.once("continue",S)):(h=n.request(d,{endStream:b,signal:c}),S()),++n[ux],h.once("response",C=>{let{[r9n]:I,...x}=C;if(e.onResponseStarted(),e.aborted){let w=new hht;so.errorRequest(t,e,w),so.destroy(h,w);return}e.onHeaders(Number(I),s9n(x),h.resume.bind(h),"")===!1&&h.pause(),h.on("data",w=>{e.onData(w)===!1&&h.pause()})}),h.once("end",()=>{(h.state?.state==null||h.state.state<6)&&e.onComplete([]),n[ux]===0&&n.unref(),g(new Zke("HTTP/2: stream half-closed (remote)")),t[bv][t[Pb]++]=null,t[eNe]=t[Pb],t[_v]()}),h.once("close",()=>{n[ux]-=1,n[ux]===0&&n.unref()}),h.once("error",function(C){g(C)}),h.once("frameError",(C,I)=>{g(new Zke(`HTTP/2: "frameError" received - type ${C}, code ${I}`))}),!0;function S(){!l||y===0?ght(g,h,null,t,e,t[Pd],y,A):so.isBuffer(l)?ght(g,h,l,t,e,t[Pd],y,A):so.isBlobLike(l)?typeof l.stream=="function"?Aht(g,h,l.stream(),t,e,t[Pd],y,A):m9n(g,h,l,t,e,t[Pd],y,A):so.isStream(l)?h9n(g,t[Pd],A,h,l,t,e,y):so.isIterable(l)?Aht(g,h,l,t,e,t[Pd],y,A):Py(!1)}}function ght(t,e,n,r,s,i,o,a){try{n!=null&&so.isBuffer(n)&&(Py(o===n.byteLength,"buffer body must have content length"),e.cork(),e.write(n),e.uncork(),e.end(),s.onBodySent(n)),a||(i[Lse]=!0),s.onRequestSent(),r[_v]()}catch(c){t(c)}}function h9n(t,e,n,r,s,i,o,a){Py(a!==0||i[Fse]===0,"stream body cannot be pipelined");let c=V8n(s,r,l=>{l?(so.destroy(c,l),t(l)):(so.removeAllListeners(c),o.onRequestSent(),n||(e[Lse]=!0),i[_v]())});so.addListener(c,"data",u);function u(l){o.onBodySent(l)}}async function m9n(t,e,n,r,s,i,o,a){Py(o===n.size,"blob body must have content length");try{if(o!=null&&o!==n.size)throw new Xke;let c=Buffer.from(await n.arrayBuffer());e.cork(),e.write(c),e.uncork(),e.end(),s.onBodySent(c),s.onRequestSent(),a||(i[Lse]=!0),r[_v]()}catch(c){t(c)}}async function Aht(t,e,n,r,s,i,o,a){Py(o!==0||r[Fse]===0,"iterator body cannot be pipelined");let c=null;function u(){if(c){let d=c;c=null,d()}}let l=()=>new Promise((d,h)=>{Py(c===null),i[Mb]?h(i[Mb]):c=d});e.on("close",u).on("drain",u);try{for await(let d of n){if(i[Mb])throw i[Mb];let h=e.write(d);s.onBodySent(d),h||await l()}e.end(),s.onRequestSent(),a||(i[Lse]=!0),r[_v]()}catch(d){t(d)}finally{e.off("close",u).off("drain",u)}}Eht.exports=i9n});var Use=ee((jzs,Cht)=>{"use strict";p();var sS=Wi(),{kBodyUsed:Lj}=Nc(),rNe=require("node:assert"),{InvalidArgumentError:f9n}=Do(),g9n=require("node:events"),A9n=[300,301,302,303,307,308],_ht=Symbol("body"),Qse=class{constructor(e){this[_ht]=e,this[Lj]=!1}async*[Symbol.asyncIterator](){rNe(!this[Lj],"disturbed"),this[Lj]=!0,yield*this[_ht]}},nNe=class{constructor(e,n,r,s){if(n!=null&&(!Number.isInteger(n)||n<0))throw new f9n("maxRedirections must be a positive number");sS.validateHandler(s,r.method,r.upgrade),this.dispatch=e,this.location=null,this.abort=null,this.opts={...r,maxRedirections:0},this.maxRedirections=n,this.handler=s,this.history=[],this.redirectionLimitReached=!1,sS.isStream(this.opts.body)?(sS.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){rNe(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[Lj]=!1,g9n.prototype.on.call(this.opts.body,"data",function(){this[Lj]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Qse(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&sS.isIterable(this.opts.body)&&(this.opts.body=new Qse(this.opts.body))}onConnect(e){this.abort=e,this.handler.onConnect(e,{history:this.history})}onUpgrade(e,n,r){this.handler.onUpgrade(e,n,r)}onError(e){this.handler.onError(e)}onHeaders(e,n,r,s){if(this.location=this.history.length>=this.maxRedirections||sS.isDisturbed(this.opts.body)?null:y9n(e,n),this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections){this.request&&this.request.abort(new Error("max redirects")),this.redirectionLimitReached=!0,this.abort(new Error("max redirects"));return}if(this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(e,n,r,s);let{origin:i,pathname:o,search:a}=sS.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),c=a?`${o}${a}`:o;this.opts.headers=E9n(this.opts.headers,e===303,this.opts.origin!==i),this.opts.path=c,this.opts.origin=i,this.opts.maxRedirections=0,this.opts.query=null,e===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",this.opts.body=null)}onData(e){if(!this.location)return this.handler.onData(e)}onComplete(e){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(e)}onBodySent(e){this.handler.onBodySent&&this.handler.onBodySent(e)}};function y9n(t,e){if(A9n.indexOf(t)===-1)return null;for(let n=0;n{"use strict";p();var b9n=Use();function _9n({maxRedirections:t}){return e=>function(r,s){let{maxRedirections:i=t}=r;if(!i)return e(r,s);let o=new b9n(e,i,r,s);return r={...r,maxRedirections:0},e(r,o)}}Iht.exports=_9n});var KQ=ee((Jzs,Pht)=>{"use strict";p();var dx=require("node:assert"),kht=require("node:net"),S9n=require("node:http"),O1=Wi(),{channels:jQ}=RQ(),C9n=Pdt(),I9n=BQ(),{InvalidArgumentError:iu,InformationalError:x9n,ClientDestroyedError:w9n}=Do(),T9n=Ij(),{kUrl:iS,kServerName:Sv,kClient:v9n,kBusy:sNe,kConnect:R9n,kResuming:M1,kRunning:Gj,kPending:Wj,kSize:$j,kQueue:Lb,kConnected:k9n,kConnecting:YQ,kNeedDrain:Iv,kKeepAliveDefaultTimeout:xht,kHostHeader:N9n,kPendingIdx:Fb,kRunningIdx:px,kError:D9n,kPipelining:Gse,kKeepAliveTimeoutValue:B9n,kMaxHeadersSize:P9n,kKeepAliveMaxTimeout:O9n,kKeepAliveTimeoutThreshold:M9n,kHeadersTimeout:L9n,kBodyTimeout:F9n,kStrictContentLength:Q9n,kConnector:Fj,kMaxRedirections:U9n,kMaxRequests:iNe,kCounter:$9n,kClose:G9n,kDestroy:W9n,kDispatch:q9n,kInterceptors:wht,kLocalAddress:Qj,kMaxResponseSize:H9n,kOnError:V9n,kHTTPContext:ou,kMaxConcurrentStreams:j9n,kResume:Uj}=Nc(),Y9n=pht(),K9n=bht(),Tht=!1,Cv=Symbol("kClosedResolve"),vht=()=>{};function Nht(t){return t[Gse]??t[ou]?.defaultPipelining??1}var oNe=class extends I9n{constructor(e,{interceptors:n,maxHeaderSize:r,headersTimeout:s,socketTimeout:i,requestTimeout:o,connectTimeout:a,bodyTimeout:c,idleTimeout:u,keepAlive:l,keepAliveTimeout:d,maxKeepAliveTimeout:h,keepAliveMaxTimeout:m,keepAliveTimeoutThreshold:f,socketPath:g,pipelining:A,tls:y,strictContentLength:b,maxCachedSessions:S,maxRedirections:C,connect:I,maxRequestsPerClient:x,localAddress:w,maxResponseSize:R,autoSelectFamily:N,autoSelectFamilyAttemptTimeout:P,maxConcurrentStreams:G,allowH2:$,webSocket:Q}={}){if(super({webSocket:Q}),l!==void 0)throw new iu("unsupported keepAlive, use pipelining=0 instead");if(i!==void 0)throw new iu("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(o!==void 0)throw new iu("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new iu("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new iu("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null&&!Number.isFinite(r))throw new iu("invalid maxHeaderSize");if(g!=null&&typeof g!="string")throw new iu("invalid socketPath");if(a!=null&&(!Number.isFinite(a)||a<0))throw new iu("invalid connectTimeout");if(d!=null&&(!Number.isFinite(d)||d<=0))throw new iu("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new iu("invalid keepAliveMaxTimeout");if(f!=null&&!Number.isFinite(f))throw new iu("invalid keepAliveTimeoutThreshold");if(s!=null&&(!Number.isInteger(s)||s<0))throw new iu("headersTimeout must be a positive integer or zero");if(c!=null&&(!Number.isInteger(c)||c<0))throw new iu("bodyTimeout must be a positive integer or zero");if(I!=null&&typeof I!="function"&&typeof I!="object")throw new iu("connect must be a function or an object");if(C!=null&&(!Number.isInteger(C)||C<0))throw new iu("maxRedirections must be a positive number");if(x!=null&&(!Number.isInteger(x)||x<0))throw new iu("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||kht.isIP(w)===0))throw new iu("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new iu("maxResponseSize must be a positive number");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new iu("autoSelectFamilyAttemptTimeout must be a positive number");if($!=null&&typeof $!="boolean")throw new iu("allowH2 must be a valid boolean value");if(G!=null&&(typeof G!="number"||G<1))throw new iu("maxConcurrentStreams must be a positive integer, greater than 0");typeof I!="function"&&(I=T9n({...y,maxCachedSessions:S,allowH2:$,socketPath:g,timeout:a,...N?{autoSelectFamily:N,autoSelectFamilyAttemptTimeout:P}:void 0,...I})),n?.Client&&Array.isArray(n.Client)?(this[wht]=n.Client,Tht||(Tht=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[wht]=[z9n({maxRedirections:C})],this[iS]=O1.parseOrigin(e),this[Fj]=I,this[Gse]=A??1,this[P9n]=r||S9n.maxHeaderSize,this[xht]=d??4e3,this[O9n]=m??6e5,this[M9n]=f??2e3,this[B9n]=this[xht],this[Sv]=null,this[Qj]=w??null,this[M1]=0,this[Iv]=0,this[N9n]=`host: ${this[iS].hostname}${this[iS].port?`:${this[iS].port}`:""}\r -`,this[F9n]=c??3e5,this[L9n]=s??3e5,this[Q9n]=b??!0,this[U9n]=C,this[iNe]=x,this[Cv]=null,this[H9n]=R>-1?R:-1,this[j9n]=G??100,this[ou]=null,this[Lb]=[],this[px]=0,this[Fb]=0,this[Uj]=H=>aNe(this,H),this[V9n]=H=>Dht(this,H)}get pipelining(){return this[Gse]}set pipelining(e){this[Gse]=e,this[Uj](!0)}get[Wj](){return this[Lb].length-this[Fb]}get[Gj](){return this[Fb]-this[px]}get[$j](){return this[Lb].length-this[px]}get[k9n](){return!!this[ou]&&!this[YQ]&&!this[ou].destroyed}get[sNe](){return!!(this[ou]?.busy(null)||this[$j]>=(Nht(this)||1)||this[Wj]>0)}[R9n](e){Bht(this),this.once("connect",e)}[q9n](e,n){let r=e.origin||this[iS].origin,s=new C9n(r,e,n);return this[Lb].push(s),this[M1]||(O1.bodyLength(s.body)==null&&O1.isIterable(s.body)?(this[M1]=1,queueMicrotask(()=>aNe(this))):this[Uj](!0)),this[M1]&&this[Iv]!==2&&this[sNe]&&(this[Iv]=2),this[Iv]<2}async[G9n](){return new Promise(e=>{this[$j]?this[Cv]=e:e(null)})}async[W9n](e){return new Promise(n=>{let r=this[Lb].splice(this[Fb]);for(let i=0;i{this[Cv]&&(this[Cv](),this[Cv]=null),n(null)};this[ou]?(this[ou].destroy(e,s),this[ou]=null):queueMicrotask(s),this[Uj]()})}},z9n=$se();function Dht(t,e){if(t[Gj]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){dx(t[Fb]===t[px]);let n=t[Lb].splice(t[px]);for(let r=0;r{t[Fj]({host:e,hostname:n,protocol:r,port:s,servername:t[Sv],localAddress:t[Qj]},(c,u)=>{c?a(c):o(u)})});if(t.destroyed){O1.destroy(i.on("error",vht),new w9n);return}dx(i);try{t[ou]=i.alpnProtocol==="h2"?await K9n(t,i):await Y9n(t,i)}catch(o){throw i.destroy().on("error",vht),o}t[YQ]=!1,i[$9n]=0,i[iNe]=t[iNe],i[v9n]=t,i[D9n]=null,jQ.connected.hasSubscribers&&jQ.connected.publish({connectParams:{host:e,hostname:n,protocol:r,port:s,version:t[ou]?.version,servername:t[Sv],localAddress:t[Qj]},connector:t[Fj],socket:i}),t.emit("connect",t[iS],[t])}catch(i){if(t.destroyed)return;if(t[YQ]=!1,jQ.connectError.hasSubscribers&&jQ.connectError.publish({connectParams:{host:e,hostname:n,protocol:r,port:s,version:t[ou]?.version,servername:t[Sv],localAddress:t[Qj]},connector:t[Fj],error:i}),i.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(dx(t[Gj]===0);t[Wj]>0&&t[Lb][t[Fb]].servername===t[Sv];){let o=t[Lb][t[Fb]++];O1.errorRequest(t,o,i)}else Dht(t,i);t.emit("connectionError",t[iS],[t],i)}t[Uj]()}function Rht(t){t[Iv]=0,t.emit("drain",t[iS],[t])}function aNe(t,e){t[M1]!==2&&(t[M1]=2,J9n(t,e),t[M1]=0,t[px]>256&&(t[Lb].splice(0,t[px]),t[Fb]-=t[px],t[px]=0))}function J9n(t,e){for(;;){if(t.destroyed){dx(t[Wj]===0);return}if(t[Cv]&&!t[$j]){t[Cv](),t[Cv]=null;return}if(t[ou]&&t[ou].resume(),t[sNe])t[Iv]=2;else if(t[Iv]===2){e?(t[Iv]=1,queueMicrotask(()=>Rht(t))):Rht(t);continue}if(t[Wj]===0||t[Gj]>=(Nht(t)||1))return;let n=t[Lb][t[Fb]];if(t[iS].protocol==="https:"&&t[Sv]!==n.servername){if(t[Gj]>0)return;t[Sv]=n.servername,t[ou]?.destroy(new x9n("servername changed"),()=>{t[ou]=null,aNe(t)})}if(t[YQ])return;if(!t[ou]){Bht(t);return}if(t[ou].destroyed||t[ou].busy(n))return;!n.aborted&&t[ou].write(n)?t[Fb]++:t[Lb].splice(t[Fb],1)}}Pht.exports=oNe});var cNe=ee((e7s,Oht)=>{"use strict";p();var Wse=class{constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};Oht.exports=class{constructor(){this.head=this.tail=new Wse}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Wse),this.head.push(e)}shift(){let e=this.tail,n=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),n}}});var Lht=ee((n7s,Mht)=>{p();var{kFree:X9n,kConnected:Z9n,kPending:eKn,kQueued:tKn,kRunning:nKn,kSize:rKn}=Nc(),L1=Symbol("pool"),lNe=class{constructor(e){this[L1]=e}get connected(){return this[L1][Z9n]}get free(){return this[L1][X9n]}get pending(){return this[L1][eKn]}get queued(){return this[L1][tKn]}get running(){return this[L1][nKn]}get size(){return this[L1][rKn]}};Mht.exports=lNe});var fNe=ee((s7s,jht)=>{"use strict";p();var sKn=BQ(),iKn=cNe(),{kConnected:uNe,kSize:Fht,kRunning:Qht,kPending:Uht,kQueued:qj,kBusy:oKn,kFree:aKn,kUrl:cKn,kClose:lKn,kDestroy:uKn,kDispatch:dKn}=Nc(),pKn=Lht(),bf=Symbol("clients"),dm=Symbol("needDrain"),Hj=Symbol("queue"),dNe=Symbol("closed resolve"),pNe=Symbol("onDrain"),$ht=Symbol("onConnect"),Ght=Symbol("onDisconnect"),Wht=Symbol("onConnectionError"),hNe=Symbol("get dispatcher"),Hht=Symbol("add client"),Vht=Symbol("remove client"),qht=Symbol("stats"),mNe=class extends sKn{constructor(e){super(e),this[Hj]=new iKn,this[bf]=[],this[qj]=0;let n=this;this[pNe]=function(s,i){let o=n[Hj],a=!1;for(;!a;){let c=o.shift();if(!c)break;n[qj]--,a=!this.dispatch(c.opts,c.handler)}this[dm]=a,!this[dm]&&n[dm]&&(n[dm]=!1,n.emit("drain",s,[n,...i])),n[dNe]&&o.isEmpty()&&Promise.all(n[bf].map(c=>c.close())).then(n[dNe])},this[$ht]=(r,s)=>{n.emit("connect",r,[n,...s])},this[Ght]=(r,s,i)=>{n.emit("disconnect",r,[n,...s],i)},this[Wht]=(r,s,i)=>{n.emit("connectionError",r,[n,...s],i)},this[qht]=new pKn(this)}get[oKn](){return this[dm]}get[uNe](){return this[bf].filter(e=>e[uNe]).length}get[aKn](){return this[bf].filter(e=>e[uNe]&&!e[dm]).length}get[Uht](){let e=this[qj];for(let{[Uht]:n}of this[bf])e+=n;return e}get[Qht](){let e=0;for(let{[Qht]:n}of this[bf])e+=n;return e}get[Fht](){let e=this[qj];for(let{[Fht]:n}of this[bf])e+=n;return e}get stats(){return this[qht]}async[lKn](){this[Hj].isEmpty()?await Promise.all(this[bf].map(e=>e.close())):await new Promise(e=>{this[dNe]=e})}async[uKn](e){for(;;){let n=this[Hj].shift();if(!n)break;n.handler.onError(e)}await Promise.all(this[bf].map(n=>n.destroy(e)))}[dKn](e,n){let r=this[hNe]();return r?r.dispatch(e,n)||(r[dm]=!0,this[dm]=!this[hNe]()):(this[dm]=!0,this[Hj].push({opts:e,handler:n}),this[qj]++),!this[dm]}[Hht](e){return e.on("drain",this[pNe]).on("connect",this[$ht]).on("disconnect",this[Ght]).on("connectionError",this[Wht]),this[bf].push(e),this[dm]&&queueMicrotask(()=>{this[dm]&&this[pNe](e[cKn],[this,e])}),this}[Vht](e){e.close(()=>{let n=this[bf].indexOf(e);n!==-1&&this[bf].splice(n,1)}),this[dm]=this[bf].some(n=>!n[dm]&&n.closed!==!0&&n.destroyed!==!0)}};jht.exports={PoolBase:mNe,kClients:bf,kNeedDrain:dm,kAddClient:Hht,kRemoveClient:Vht,kGetDispatcher:hNe}});var zQ=ee((o7s,Jht)=>{"use strict";p();var{PoolBase:hKn,kClients:qse,kNeedDrain:mKn,kAddClient:fKn,kGetDispatcher:gKn}=fNe(),AKn=KQ(),{InvalidArgumentError:gNe}=Do(),Yht=Wi(),{kUrl:Kht,kInterceptors:yKn}=Nc(),EKn=Ij(),ANe=Symbol("options"),yNe=Symbol("connections"),zht=Symbol("factory");function bKn(t,e){return new AKn(t,e)}var ENe=class extends hKn{constructor(e,{connections:n,factory:r=bKn,connect:s,connectTimeout:i,tls:o,maxCachedSessions:a,socketPath:c,autoSelectFamily:u,autoSelectFamilyAttemptTimeout:l,allowH2:d,...h}={}){if(n!=null&&(!Number.isFinite(n)||n<0))throw new gNe("invalid connections");if(typeof r!="function")throw new gNe("factory must be a function.");if(s!=null&&typeof s!="function"&&typeof s!="object")throw new gNe("connect must be a function or an object");typeof s!="function"&&(s=EKn({...o,maxCachedSessions:a,allowH2:d,socketPath:c,timeout:i,...u?{autoSelectFamily:u,autoSelectFamilyAttemptTimeout:l}:void 0,...s})),super(h),this[yKn]=h.interceptors?.Pool&&Array.isArray(h.interceptors.Pool)?h.interceptors.Pool:[],this[yNe]=n||null,this[Kht]=Yht.parseOrigin(e),this[ANe]={...Yht.deepClone(h),connect:s,allowH2:d},this[ANe].interceptors=h.interceptors?{...h.interceptors}:void 0,this[zht]=r,this.on("connectionError",(m,f,g)=>{for(let A of f){let y=this[qse].indexOf(A);y!==-1&&this[qse].splice(y,1)}})}[gKn](){for(let e of this[qse])if(!e[mKn])return e;if(!this[yNe]||this[qse].length{"use strict";p();var{BalancedPoolMissingUpstreamError:_Kn,InvalidArgumentError:SKn}=Do(),{PoolBase:CKn,kClients:hh,kNeedDrain:Vj,kAddClient:IKn,kRemoveClient:xKn,kGetDispatcher:wKn}=fNe(),TKn=zQ(),{kUrl:bNe,kInterceptors:vKn}=Nc(),{parseOrigin:Xht}=Wi(),Zht=Symbol("factory"),Hse=Symbol("options"),emt=Symbol("kGreatestCommonDivisor"),F1=Symbol("kCurrentWeight"),Q1=Symbol("kIndex"),Oy=Symbol("kWeight"),Vse=Symbol("kMaxWeightPerServer"),jse=Symbol("kErrorPenalty");function RKn(t,e){if(t===0)return e;for(;e!==0;){let n=e;e=t%e,t=n}return t}function kKn(t,e){return new TKn(t,e)}var _Ne=class extends CKn{constructor(e=[],{factory:n=kKn,...r}={}){if(super(),this[Hse]=r,this[Q1]=-1,this[F1]=0,this[Vse]=this[Hse].maxWeightPerServer||100,this[jse]=this[Hse].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof n!="function")throw new SKn("factory must be a function.");this[vKn]=r.interceptors?.BalancedPool&&Array.isArray(r.interceptors.BalancedPool)?r.interceptors.BalancedPool:[],this[Zht]=n;for(let s of e)this.addUpstream(s);this._updateBalancedPoolStats()}addUpstream(e){let n=Xht(e).origin;if(this[hh].find(s=>s[bNe].origin===n&&s.closed!==!0&&s.destroyed!==!0))return this;let r=this[Zht](n,Object.assign({},this[Hse]));this[IKn](r),r.on("connect",()=>{r[Oy]=Math.min(this[Vse],r[Oy]+this[jse])}),r.on("connectionError",()=>{r[Oy]=Math.max(1,r[Oy]-this[jse]),this._updateBalancedPoolStats()}),r.on("disconnect",(...s)=>{let i=s[2];i&&i.code==="UND_ERR_SOCKET"&&(r[Oy]=Math.max(1,r[Oy]-this[jse]),this._updateBalancedPoolStats())});for(let s of this[hh])s[Oy]=this[Vse];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let n=0;ns[bNe].origin===n&&s.closed!==!0&&s.destroyed!==!0);return r&&this[xKn](r),this}get upstreams(){return this[hh].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[bNe].origin)}[wKn](){if(this[hh].length===0)throw new _Kn;if(!this[hh].find(i=>!i[Vj]&&i.closed!==!0&&i.destroyed!==!0)||this[hh].map(i=>i[Vj]).reduce((i,o)=>i&&o,!0))return;let r=0,s=this[hh].findIndex(i=>!i[Vj]);for(;r++this[hh][s][Oy]&&!i[Vj]&&(s=this[Q1]),this[Q1]===0&&(this[F1]=this[F1]-this[emt],this[F1]<=0&&(this[F1]=this[Vse])),i[Oy]>=this[F1]&&!i[Vj])return i}return this[F1]=this[hh][s][Oy],this[Q1]=s,this[hh][s]}};tmt.exports=_Ne});var JQ=ee((u7s,lmt)=>{"use strict";p();var{InvalidArgumentError:Yse}=Do(),{kClients:xv,kRunning:rmt,kClose:NKn,kDestroy:DKn,kDispatch:BKn,kInterceptors:PKn}=Nc(),OKn=BQ(),MKn=zQ(),LKn=KQ(),FKn=Wi(),QKn=$se(),smt=Symbol("onConnect"),imt=Symbol("onDisconnect"),omt=Symbol("onConnectionError"),UKn=Symbol("maxRedirections"),amt=Symbol("onDrain"),cmt=Symbol("factory"),SNe=Symbol("options");function $Kn(t,e){return e&&e.connections===1?new LKn(t,e):new MKn(t,e)}var CNe=class extends OKn{constructor({factory:e=$Kn,maxRedirections:n=0,connect:r,...s}={}){if(typeof e!="function")throw new Yse("factory must be a function.");if(r!=null&&typeof r!="function"&&typeof r!="object")throw new Yse("connect must be a function or an object");if(!Number.isInteger(n)||n<0)throw new Yse("maxRedirections must be a positive number");super(s),r&&typeof r!="function"&&(r={...r}),this[PKn]=s.interceptors?.Agent&&Array.isArray(s.interceptors.Agent)?s.interceptors.Agent:[QKn({maxRedirections:n})],this[SNe]={...FKn.deepClone(s),connect:r},this[SNe].interceptors=s.interceptors?{...s.interceptors}:void 0,this[UKn]=n,this[cmt]=e,this[xv]=new Map,this[amt]=(i,o)=>{this.emit("drain",i,[this,...o])},this[smt]=(i,o)=>{this.emit("connect",i,[this,...o])},this[imt]=(i,o,a)=>{this.emit("disconnect",i,[this,...o],a)},this[omt]=(i,o,a)=>{this.emit("connectionError",i,[this,...o],a)}}get[rmt](){let e=0;for(let n of this[xv].values())e+=n[rmt];return e}[BKn](e,n){let r;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))r=String(e.origin);else throw new Yse("opts.origin must be a non-empty string or URL.");let s=this[xv].get(r);return s||(s=this[cmt](e.origin,this[SNe]).on("drain",this[amt]).on("connect",this[smt]).on("disconnect",this[imt]).on("connectionError",this[omt]),this[xv].set(r,s)),s.dispatch(e,n)}async[NKn](){let e=[];for(let n of this[xv].values())e.push(n.close());this[xv].clear(),await Promise.all(e)}async[DKn](e){let n=[];for(let r of this[xv].values())n.push(r.destroy(e));this[xv].clear(),await Promise.all(n)}};lmt.exports=CNe});var vNe=ee((p7s,bmt)=>{"use strict";p();var{kProxy:INe,kClose:fmt,kDestroy:gmt,kDispatch:umt,kInterceptors:GKn}=Nc(),{URL:U1}=require("node:url"),WKn=JQ(),Amt=zQ(),ymt=BQ(),{InvalidArgumentError:XQ,RequestAbortedError:qKn,SecureProxyConnectionError:HKn}=Do(),dmt=Ij(),Emt=KQ(),Kse=Symbol("proxy agent"),zse=Symbol("proxy client"),wv=Symbol("proxy headers"),xNe=Symbol("request tls settings"),pmt=Symbol("proxy tls settings"),hmt=Symbol("connect endpoint function"),mmt=Symbol("tunnel proxy");function VKn(t){return t==="https:"?443:80}function jKn(t,e){return new Amt(t,e)}var YKn=()=>{};function KKn(t,e){return e.connections===1?new Emt(t,e):new Amt(t,e)}var wNe=class extends ymt{#e;constructor(e,{headers:n={},connect:r,factory:s}){if(super(),!e)throw new XQ("Proxy URL is mandatory");this[wv]=n,s?this.#e=s(e,{connect:r}):this.#e=new Emt(e,{connect:r})}[umt](e,n){let r=n.onHeaders;n.onHeaders=function(a,c,u){if(a===407){typeof n.onError=="function"&&n.onError(new XQ("Proxy Authentication Required (407)"));return}r&&r.call(this,a,c,u)};let{origin:s,path:i="/",headers:o={}}=e;if(e.path=s+i,!("host"in o)&&!("Host"in o)){let{host:a}=new U1(s);o.host=a}return e.headers={...this[wv],...o},this.#e[umt](e,n)}async[fmt](){return this.#e.close()}async[gmt](e){return this.#e.destroy(e)}},TNe=class extends ymt{constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof U1)&&!e.uri)throw new XQ("Proxy uri is mandatory");let{clientFactory:n=jKn}=e;if(typeof n!="function")throw new XQ("Proxy opts.clientFactory must be a function.");let{proxyTunnel:r=!0}=e,s=this.#e(e),{href:i,origin:o,port:a,protocol:c,username:u,password:l,hostname:d}=s;if(this[INe]={uri:i,protocol:c},this[GKn]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[xNe]=e.requestTls,this[pmt]=e.proxyTls,this[wv]=e.headers||{},this[mmt]=r,e.auth&&e.token)throw new XQ("opts.auth cannot be used in combination with opts.token");e.auth?this[wv]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[wv]["proxy-authorization"]=e.token:u&&l&&(this[wv]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(u)}:${decodeURIComponent(l)}`).toString("base64")}`);let h=dmt({...e.proxyTls});this[hmt]=dmt({...e.requestTls});let m=e.factory||KKn,f=(g,A)=>{let{protocol:y}=new U1(g);return!this[mmt]&&y==="http:"&&this[INe].protocol==="http:"?new wNe(this[INe].uri,{headers:this[wv],connect:h,factory:m}):m(g,A)};this[zse]=n(s,{connect:h}),this[Kse]=new WKn({...e,factory:f,connect:async(g,A)=>{let y=g.host;g.port||(y+=`:${VKn(g.protocol)}`);try{let{socket:b,statusCode:S}=await this[zse].connect({origin:o,port:a,path:y,signal:g.signal,headers:{...this[wv],host:g.host},servername:this[pmt]?.servername||d});if(S!==200&&(b.on("error",YKn).destroy(),A(new qKn(`Proxy response (${S}) !== 200 when HTTP Tunneling`))),g.protocol!=="https:"){A(null,b);return}let C;this[xNe]?C=this[xNe].servername:C=g.servername,this[hmt]({...g,servername:C,httpSocket:b},A)}catch(b){b.code==="ERR_TLS_CERT_ALTNAME_INVALID"?A(new HKn(b)):A(b)}}})}dispatch(e,n){let r=zKn(e.headers);if(JKn(r),r&&!("host"in r)&&!("Host"in r)){let{host:s}=new U1(e.origin);r.host=s}return this[Kse].dispatch({...e,headers:r},n)}#e(e){return typeof e=="string"?new U1(e):e instanceof U1?e:new U1(e.uri)}async[fmt](){await this[Kse].close(),await this[zse].close()}async[gmt](){await this[Kse].destroy(),await this[zse].destroy()}};function zKn(t){if(Array.isArray(t)){let e={};for(let n=0;nn.toLowerCase()==="proxy-authorization"))throw new XQ("Proxy-Authorization should be sent in ProxyAgent constructor")}bmt.exports=TNe});var wmt=ee((m7s,xmt)=>{"use strict";p();var XKn=BQ(),{kClose:ZKn,kDestroy:ezn,kClosed:_mt,kDestroyed:Smt,kDispatch:tzn,kNoProxyAgent:jj,kHttpProxyAgent:Tv,kHttpsProxyAgent:$1}=Nc(),Cmt=vNe(),nzn=JQ(),rzn={"http:":80,"https:":443},Imt=!1,RNe=class extends XKn{#e=null;#t=null;#n=null;constructor(e={}){super(),this.#n=e,Imt||(Imt=!0,process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.",{code:"UNDICI-EHPA"}));let{httpProxy:n,httpsProxy:r,noProxy:s,...i}=e;this[jj]=new nzn(i);let o=n??process.env.http_proxy??process.env.HTTP_PROXY;o?this[Tv]=new Cmt({...i,uri:o}):this[Tv]=this[jj];let a=r??process.env.https_proxy??process.env.HTTPS_PROXY;a?this[$1]=new Cmt({...i,uri:a}):this[$1]=this[Tv],this.#s()}[tzn](e,n){let r=new URL(e.origin);return this.#r(r).dispatch(e,n)}async[ZKn](){await this[jj].close(),this[Tv][_mt]||await this[Tv].close(),this[$1][_mt]||await this[$1].close()}async[ezn](e){await this[jj].destroy(e),this[Tv][Smt]||await this[Tv].destroy(e),this[$1][Smt]||await this[$1].destroy(e)}#r(e){let{protocol:n,host:r,port:s}=e;return r=r.replace(/:\d*$/,"").toLowerCase(),s=Number.parseInt(s,10)||rzn[n]||0,this.#i(r,s)?n==="https:"?this[$1]:this[Tv]:this[jj]}#i(e,n){if(this.#c&&this.#s(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let r=0;r{"use strict";p();var ZQ=require("node:assert"),{kRetryHandlerDefaultRetry:Tmt}=Nc(),{RequestRetryError:Yj}=Do(),{isDisturbed:vmt,parseHeaders:szn,parseRangeHeader:Rmt,wrapRequestBody:izn}=Wi();function ozn(t){let e=Date.now();return new Date(t).getTime()-e}var kNe=class t{constructor(e,n){let{retryOptions:r,...s}=e,{retry:i,maxRetries:o,maxTimeout:a,minTimeout:c,timeoutFactor:u,methods:l,errorCodes:d,retryAfter:h,statusCodes:m}=r??{};this.dispatch=n.dispatch,this.handler=n.handler,this.opts={...s,body:izn(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:i??t[Tmt],retryAfter:h??!0,maxTimeout:a??30*1e3,minTimeout:c??500,timeoutFactor:u??2,maxRetries:o??5,methods:l??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:m??[500,502,503,504,429],errorCodes:d??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(f=>{this.aborted=!0,this.abort?this.abort(f):this.reason=f})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,n,r){this.handler.onUpgrade&&this.handler.onUpgrade(e,n,r)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[Tmt](e,{state:n,opts:r},s){let{statusCode:i,code:o,headers:a}=e,{method:c,retryOptions:u}=r,{maxRetries:l,minTimeout:d,maxTimeout:h,timeoutFactor:m,statusCodes:f,errorCodes:g,methods:A}=u,{counter:y}=n;if(o&&o!=="UND_ERR_REQ_RETRY"&&!g.includes(o)){s(e);return}if(Array.isArray(A)&&!A.includes(c)){s(e);return}if(i!=null&&Array.isArray(f)&&!f.includes(i)){s(e);return}if(y>l){s(e);return}let b=a?.["retry-after"];b&&(b=Number(b),b=Number.isNaN(b)?ozn(b):b*1e3);let S=b>0?Math.min(b,h):Math.min(d*m**(y-1),h);setTimeout(()=>s(null),S)}onHeaders(e,n,r,s){let i=szn(n);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,n,r,s):(this.abort(new Yj("Request failed",e,{headers:i,data:{count:this.retryCount}})),!1);if(this.resume!=null){if(this.resume=null,e!==206&&(this.start>0||e!==200))return this.abort(new Yj("server does not support the range header and the payload was partially consumed",e,{headers:i,data:{count:this.retryCount}})),!1;let a=Rmt(i["content-range"]);if(!a)return this.abort(new Yj("Content-Range mismatch",e,{headers:i,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==i.etag)return this.abort(new Yj("ETag mismatch",e,{headers:i,data:{count:this.retryCount}})),!1;let{start:c,size:u,end:l=u-1}=a;return ZQ(this.start===c,"content-range mismatch"),ZQ(this.end==null||this.end===l,"content-range mismatch"),this.resume=r,!0}if(this.end==null){if(e===206){let a=Rmt(i["content-range"]);if(a==null)return this.handler.onHeaders(e,n,r,s);let{start:c,size:u,end:l=u-1}=a;ZQ(c!=null&&Number.isFinite(c),"content-range mismatch"),ZQ(l!=null&&Number.isFinite(l),"invalid content-length"),this.start=c,this.end=l}if(this.end==null){let a=i["content-length"];this.end=a!=null?Number(a)-1:null}return ZQ(Number.isFinite(this.start)),ZQ(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=r,this.etag=i.etag!=null?i.etag:null,this.etag!=null&&this.etag.startsWith("W/")&&(this.etag=null),this.handler.onHeaders(e,n,r,s)}let o=new Yj("Request failed",e,{headers:i,data:{count:this.retryCount}});return this.abort(o),!1}onData(e){return this.start+=e.length,this.handler.onData(e)}onComplete(e){return this.retryCount=0,this.handler.onComplete(e)}onError(e){if(this.aborted||vmt(this.opts.body))return this.handler.onError(e);this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},n.bind(this));function n(r){if(r!=null||this.aborted||vmt(this.opts.body))return this.handler.onError(r);if(this.start!==0){let s={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(s["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...s}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(s){this.handler.onError(s)}}}};kmt.exports=kNe});var Dmt=ee((y7s,Nmt)=>{"use strict";p();var azn=Sj(),czn=Jse(),NNe=class extends azn{#e=null;#t=null;constructor(e,n={}){super(n),this.#e=e,this.#t=n}dispatch(e,n){let r=new czn({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:n});return this.#e.dispatch(e,r)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};Nmt.exports=NNe});var LNe=ee((b7s,$mt)=>{"use strict";p();var Lmt=require("node:assert"),{Readable:lzn}=require("node:stream"),{RequestAbortedError:Fmt,NotSupportedError:uzn,InvalidArgumentError:dzn,AbortError:DNe}=Do(),Qmt=Wi(),{ReadableStreamFrom:pzn}=Wi(),Og=Symbol("kConsume"),Kj=Symbol("kReading"),vv=Symbol("kBody"),Bmt=Symbol("kAbort"),Umt=Symbol("kContentType"),Pmt=Symbol("kContentLength"),hzn=()=>{},BNe=class extends lzn{constructor({resume:e,abort:n,contentType:r="",contentLength:s,highWaterMark:i=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:i}),this._readableState.dataEmitted=!1,this[Bmt]=n,this[Og]=null,this[vv]=null,this[Umt]=r,this[Pmt]=s,this[Kj]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new Fmt),e&&this[Bmt](),super.destroy(e)}_destroy(e,n){this[Kj]?n(e):setImmediate(()=>{n(e)})}on(e,...n){return(e==="data"||e==="readable")&&(this[Kj]=!0),super.on(e,...n)}addListener(e,...n){return this.on(e,...n)}off(e,...n){let r=super.off(e,...n);return(e==="data"||e==="readable")&&(this[Kj]=this.listenerCount("data")>0||this.listenerCount("readable")>0),r}removeListener(e,...n){return this.off(e,...n)}push(e){return this[Og]&&e!==null?(ONe(this[Og],e),this[Kj]?super.push(e):!0):super.push(e)}async text(){return zj(this,"text")}async json(){return zj(this,"json")}async blob(){return zj(this,"blob")}async bytes(){return zj(this,"bytes")}async arrayBuffer(){return zj(this,"arrayBuffer")}async formData(){throw new uzn}get bodyUsed(){return Qmt.isDisturbed(this)}get body(){return this[vv]||(this[vv]=pzn(this),this[Og]&&(this[vv].getReader(),Lmt(this[vv].locked))),this[vv]}async dump(e){let n=Number.isFinite(e?.limit)?e.limit:131072,r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))throw new dzn("signal must be an AbortSignal");return r?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((s,i)=>{this[Pmt]>n&&this.destroy(new DNe);let o=()=>{this.destroy(r.reason??new DNe)};r?.addEventListener("abort",o),this.on("close",function(){r?.removeEventListener("abort",o),r?.aborted?i(r.reason??new DNe):s(null)}).on("error",hzn).on("data",function(a){n-=a.length,n<=0&&this.destroy()}).resume()})}};function mzn(t){return t[vv]&&t[vv].locked===!0||t[Og]}function fzn(t){return Qmt.isDisturbed(t)||mzn(t)}async function zj(t,e){return Lmt(!t[Og]),new Promise((n,r)=>{if(fzn(t)){let s=t._readableState;s.destroyed&&s.closeEmitted===!1?t.on("error",i=>{r(i)}).on("close",()=>{r(new TypeError("unusable"))}):r(s.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[Og]={type:e,stream:t,resolve:n,reject:r,length:0,body:[]},t.on("error",function(s){MNe(this[Og],s)}).on("close",function(){this[Og].body!==null&&MNe(this[Og],new Fmt)}),gzn(t[Og])})})}function gzn(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let n=e.bufferIndex,r=e.buffer.length;for(let s=n;s2&&n[0]===239&&n[1]===187&&n[2]===191?3:0;return n.utf8Slice(s,r)}function Omt(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let n=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),r=0;for(let s=0;s{p();var Azn=require("node:assert"),{ResponseStatusCodeError:Gmt}=Do(),{chunksDecode:Wmt}=LNe(),yzn=128*1024;async function Ezn({callback:t,body:e,contentType:n,statusCode:r,statusMessage:s,headers:i}){Azn(e);let o=[],a=0;try{for await(let d of e)if(o.push(d),a+=d.length,a>yzn){o=[],a=0;break}}catch{o=[],a=0}let c=`Response status code ${r}${s?`: ${s}`:""}`;if(r===204||!n||!a){queueMicrotask(()=>t(new Gmt(c,r,i)));return}let u=Error.stackTraceLimit;Error.stackTraceLimit=0;let l;try{qmt(n)?l=JSON.parse(Wmt(o,a)):Hmt(n)&&(l=Wmt(o,a))}catch{}finally{Error.stackTraceLimit=u}queueMicrotask(()=>t(new Gmt(c,r,i,l)))}var qmt=t=>t.length>15&&t[11]==="/"&&t[0]==="a"&&t[1]==="p"&&t[2]==="p"&&t[3]==="l"&&t[4]==="i"&&t[5]==="c"&&t[6]==="a"&&t[7]==="t"&&t[8]==="i"&&t[9]==="o"&&t[10]==="n"&&t[12]==="j"&&t[13]==="s"&&t[14]==="o"&&t[15]==="n",Hmt=t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t";Vmt.exports={getResolveErrorBodyCallback:Ezn,isContentTypeApplicationJson:qmt,isContentTypeText:Hmt}});var Kmt=ee((I7s,QNe)=>{"use strict";p();var bzn=require("node:assert"),{Readable:_zn}=LNe(),{InvalidArgumentError:eU,RequestAbortedError:jmt}=Do(),Mg=Wi(),{getResolveErrorBodyCallback:Szn}=FNe(),{AsyncResource:Czn}=require("node:async_hooks"),Xse=class extends Czn{constructor(e,n){if(!e||typeof e!="object")throw new eU("invalid opts");let{signal:r,method:s,opaque:i,body:o,onInfo:a,responseHeaders:c,throwOnError:u,highWaterMark:l}=e;try{if(typeof n!="function")throw new eU("invalid callback");if(l&&(typeof l!="number"||l<0))throw new eU("invalid highWaterMark");if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new eU("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new eU("invalid method");if(a&&typeof a!="function")throw new eU("invalid onInfo callback");super("UNDICI_REQUEST")}catch(d){throw Mg.isStream(o)&&Mg.destroy(o.on("error",Mg.nop),d),d}this.method=s,this.responseHeaders=c||null,this.opaque=i||null,this.callback=n,this.res=null,this.abort=null,this.body=o,this.trailers={},this.context=null,this.onInfo=a||null,this.throwOnError=u,this.highWaterMark=l,this.signal=r,this.reason=null,this.removeAbortListener=null,Mg.isStream(o)&&o.on("error",d=>{this.onError(d)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new jmt:this.removeAbortListener=Mg.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new jmt,this.res?Mg.destroy(this.res.on("error",Mg.nop),this.reason):this.abort&&this.abort(this.reason),this.removeAbortListener&&(this.res?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}))}onConnect(e,n){if(this.reason){e(this.reason);return}bzn(this.callback),this.abort=e,this.context=n}onHeaders(e,n,r,s){let{callback:i,opaque:o,abort:a,context:c,responseHeaders:u,highWaterMark:l}=this,d=u==="raw"?Mg.parseRawHeaders(n):Mg.parseHeaders(n);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:d});return}let h=u==="raw"?Mg.parseHeaders(n):d,m=h["content-type"],f=h["content-length"],g=new _zn({resume:r,abort:a,contentType:m,contentLength:this.method!=="HEAD"&&f?Number(f):null,highWaterMark:l});this.removeAbortListener&&g.on("close",this.removeAbortListener),this.callback=null,this.res=g,i!==null&&(this.throwOnError&&e>=400?this.runInAsyncScope(Szn,null,{callback:i,body:g,contentType:m,statusCode:e,statusMessage:s,headers:d}):this.runInAsyncScope(i,null,null,{statusCode:e,headers:d,trailers:this.trailers,opaque:o,body:g,context:c}))}onData(e){return this.res.push(e)}onComplete(e){Mg.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:n,callback:r,body:s,opaque:i}=this;r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:i})})),n&&(this.res=null,queueMicrotask(()=>{Mg.destroy(n,e)})),s&&(this.body=null,Mg.destroy(s,e)),this.removeAbortListener&&(n?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function Ymt(t,e){if(e===void 0)return new Promise((n,r)=>{Ymt.call(this,t,(s,i)=>s?r(s):n(i))});try{this.dispatch(t,new Xse(t,e))}catch(n){if(typeof e!="function")throw n;let r=t?.opaque;queueMicrotask(()=>e(n,{opaque:r}))}}QNe.exports=Ymt;QNe.exports.RequestHandler=Xse});var Jj=ee((w7s,Xmt)=>{p();var{addAbortListener:Izn}=Wi(),{RequestAbortedError:xzn}=Do(),tU=Symbol("kListener"),oS=Symbol("kSignal");function zmt(t){t.abort?t.abort(t[oS]?.reason):t.reason=t[oS]?.reason??new xzn,Jmt(t)}function wzn(t,e){if(t.reason=null,t[oS]=null,t[tU]=null,!!e){if(e.aborted){zmt(t);return}t[oS]=e,t[tU]=()=>{zmt(t)},Izn(t[oS],t[tU])}}function Jmt(t){t[oS]&&("removeEventListener"in t[oS]?t[oS].removeEventListener("abort",t[tU]):t[oS].removeListener("abort",t[tU]),t[oS]=null,t[tU]=null)}Xmt.exports={addSignal:wzn,removeSignal:Jmt}});var nft=ee((v7s,tft)=>{"use strict";p();var Tzn=require("node:assert"),{finished:vzn,PassThrough:Rzn}=require("node:stream"),{InvalidArgumentError:nU,InvalidReturnValueError:kzn}=Do(),Qb=Wi(),{getResolveErrorBodyCallback:Nzn}=FNe(),{AsyncResource:Dzn}=require("node:async_hooks"),{addSignal:Bzn,removeSignal:Zmt}=Jj(),UNe=class extends Dzn{constructor(e,n,r){if(!e||typeof e!="object")throw new nU("invalid opts");let{signal:s,method:i,opaque:o,body:a,onInfo:c,responseHeaders:u,throwOnError:l}=e;try{if(typeof r!="function")throw new nU("invalid callback");if(typeof n!="function")throw new nU("invalid factory");if(s&&typeof s.on!="function"&&typeof s.addEventListener!="function")throw new nU("signal must be an EventEmitter or EventTarget");if(i==="CONNECT")throw new nU("invalid method");if(c&&typeof c!="function")throw new nU("invalid onInfo callback");super("UNDICI_STREAM")}catch(d){throw Qb.isStream(a)&&Qb.destroy(a.on("error",Qb.nop),d),d}this.responseHeaders=u||null,this.opaque=o||null,this.factory=n,this.callback=r,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=a,this.onInfo=c||null,this.throwOnError=l||!1,Qb.isStream(a)&&a.on("error",d=>{this.onError(d)}),Bzn(this,s)}onConnect(e,n){if(this.reason){e(this.reason);return}Tzn(this.callback),this.abort=e,this.context=n}onHeaders(e,n,r,s){let{factory:i,opaque:o,context:a,callback:c,responseHeaders:u}=this,l=u==="raw"?Qb.parseRawHeaders(n):Qb.parseHeaders(n);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:l});return}this.factory=null;let d;if(this.throwOnError&&e>=400){let f=(u==="raw"?Qb.parseHeaders(n):l)["content-type"];d=new Rzn,this.callback=null,this.runInAsyncScope(Nzn,null,{callback:c,body:d,contentType:f,statusCode:e,statusMessage:s,headers:l})}else{if(i===null)return;if(d=this.runInAsyncScope(i,null,{statusCode:e,headers:l,opaque:o,context:a}),!d||typeof d.write!="function"||typeof d.end!="function"||typeof d.on!="function")throw new kzn("expected Writable");vzn(d,{readable:!1},m=>{let{callback:f,res:g,opaque:A,trailers:y,abort:b}=this;this.res=null,(m||!g.readable)&&Qb.destroy(g,m),this.callback=null,this.runInAsyncScope(f,null,m||null,{opaque:A,trailers:y}),m&&b()})}return d.on("drain",r),this.res=d,(d.writableNeedDrain!==void 0?d.writableNeedDrain:d._writableState?.needDrain)!==!0}onData(e){let{res:n}=this;return n?n.write(e):!0}onComplete(e){let{res:n}=this;Zmt(this),n&&(this.trailers=Qb.parseHeaders(e),n.end())}onError(e){let{res:n,callback:r,opaque:s,body:i}=this;Zmt(this),this.factory=null,n?(this.res=null,Qb.destroy(n,e)):r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:s})})),i&&(this.body=null,Qb.destroy(i,e))}};function eft(t,e,n){if(n===void 0)return new Promise((r,s)=>{eft.call(this,t,e,(i,o)=>i?s(i):r(o))});try{this.dispatch(t,new UNe(t,e,n))}catch(r){if(typeof n!="function")throw r;let s=t?.opaque;queueMicrotask(()=>n(r,{opaque:s}))}}tft.exports=eft});var oft=ee((k7s,ift)=>{"use strict";p();var{Readable:sft,Duplex:Pzn,PassThrough:Ozn}=require("node:stream"),{InvalidArgumentError:Xj,InvalidReturnValueError:Mzn,RequestAbortedError:$Ne}=Do(),My=Wi(),{AsyncResource:Lzn}=require("node:async_hooks"),{addSignal:Fzn,removeSignal:Qzn}=Jj(),rft=require("node:assert"),rU=Symbol("resume"),GNe=class extends sft{constructor(){super({autoDestroy:!0}),this[rU]=null}_read(){let{[rU]:e}=this;e&&(this[rU]=null,e())}_destroy(e,n){this._read(),n(e)}},WNe=class extends sft{constructor(e){super({autoDestroy:!0}),this[rU]=e}_read(){this[rU]()}_destroy(e,n){!e&&!this._readableState.endEmitted&&(e=new $Ne),n(e)}},qNe=class extends Lzn{constructor(e,n){if(!e||typeof e!="object")throw new Xj("invalid opts");if(typeof n!="function")throw new Xj("invalid handler");let{signal:r,method:s,opaque:i,onInfo:o,responseHeaders:a}=e;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new Xj("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Xj("invalid method");if(o&&typeof o!="function")throw new Xj("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=i||null,this.responseHeaders=a||null,this.handler=n,this.abort=null,this.context=null,this.onInfo=o||null,this.req=new GNe().on("error",My.nop),this.ret=new Pzn({readableObjectMode:e.objectMode,autoDestroy:!0,read:()=>{let{body:c}=this;c?.resume&&c.resume()},write:(c,u,l)=>{let{req:d}=this;d.push(c,u)||d._readableState.destroyed?l():d[rU]=l},destroy:(c,u)=>{let{body:l,req:d,res:h,ret:m,abort:f}=this;!c&&!m._readableState.endEmitted&&(c=new $Ne),f&&c&&f(),My.destroy(l,c),My.destroy(d,c),My.destroy(h,c),Qzn(this),u(c)}}).on("prefinish",()=>{let{req:c}=this;c.push(null)}),this.res=null,Fzn(this,r)}onConnect(e,n){let{ret:r,res:s}=this;if(this.reason){e(this.reason);return}rft(!s,"pipeline cannot be retried"),rft(!r.destroyed),this.abort=e,this.context=n}onHeaders(e,n,r){let{opaque:s,handler:i,context:o}=this;if(e<200){if(this.onInfo){let c=this.responseHeaders==="raw"?My.parseRawHeaders(n):My.parseHeaders(n);this.onInfo({statusCode:e,headers:c})}return}this.res=new WNe(r);let a;try{this.handler=null;let c=this.responseHeaders==="raw"?My.parseRawHeaders(n):My.parseHeaders(n);a=this.runInAsyncScope(i,null,{statusCode:e,headers:c,opaque:s,body:this.res,context:o})}catch(c){throw this.res.on("error",My.nop),c}if(!a||typeof a.on!="function")throw new Mzn("expected Readable");a.on("data",c=>{let{ret:u,body:l}=this;!u.push(c)&&l.pause&&l.pause()}).on("error",c=>{let{ret:u}=this;My.destroy(u,c)}).on("end",()=>{let{ret:c}=this;c.push(null)}).on("close",()=>{let{ret:c}=this;c._readableState.ended||My.destroy(c,new $Ne)}),this.body=a}onData(e){let{res:n}=this;return n.push(e)}onComplete(e){let{res:n}=this;n.push(null)}onError(e){let{ret:n}=this;this.handler=null,My.destroy(n,e)}};function Uzn(t,e){try{let n=new qNe(t,e);return this.dispatch({...t,body:n.req},n),n.ret}catch(n){return new Ozn().destroy(n)}}ift.exports=Uzn});var pft=ee((D7s,dft)=>{"use strict";p();var{InvalidArgumentError:HNe,SocketError:$zn}=Do(),{AsyncResource:Gzn}=require("node:async_hooks"),aft=Wi(),{addSignal:Wzn,removeSignal:cft}=Jj(),lft=require("node:assert"),VNe=class extends Gzn{constructor(e,n){if(!e||typeof e!="object")throw new HNe("invalid opts");if(typeof n!="function")throw new HNe("invalid callback");let{signal:r,opaque:s,responseHeaders:i}=e;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new HNe("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=i||null,this.opaque=s||null,this.callback=n,this.abort=null,this.context=null,Wzn(this,r)}onConnect(e,n){if(this.reason){e(this.reason);return}lft(this.callback),this.abort=e,this.context=null}onHeaders(){throw new $zn("bad upgrade",null)}onUpgrade(e,n,r){lft(e===101);let{callback:s,opaque:i,context:o}=this;cft(this),this.callback=null;let a=this.responseHeaders==="raw"?aft.parseRawHeaders(n):aft.parseHeaders(n);this.runInAsyncScope(s,null,null,{headers:a,socket:r,opaque:i,context:o})}onError(e){let{callback:n,opaque:r}=this;cft(this),n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:r})}))}};function uft(t,e){if(e===void 0)return new Promise((n,r)=>{uft.call(this,t,(s,i)=>s?r(s):n(i))});try{let n=new VNe(t,e);this.dispatch({...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"},n)}catch(n){if(typeof e!="function")throw n;let r=t?.opaque;queueMicrotask(()=>e(n,{opaque:r}))}}dft.exports=uft});var Aft=ee((P7s,gft)=>{"use strict";p();var qzn=require("node:assert"),{AsyncResource:Hzn}=require("node:async_hooks"),{InvalidArgumentError:jNe,SocketError:Vzn}=Do(),hft=Wi(),{addSignal:jzn,removeSignal:mft}=Jj(),YNe=class extends Hzn{constructor(e,n){if(!e||typeof e!="object")throw new jNe("invalid opts");if(typeof n!="function")throw new jNe("invalid callback");let{signal:r,opaque:s,responseHeaders:i}=e;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new jNe("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=s||null,this.responseHeaders=i||null,this.callback=n,this.abort=null,jzn(this,r)}onConnect(e,n){if(this.reason){e(this.reason);return}qzn(this.callback),this.abort=e,this.context=n}onHeaders(){throw new Vzn("bad connect",null)}onUpgrade(e,n,r){let{callback:s,opaque:i,context:o}=this;mft(this),this.callback=null;let a=n;a!=null&&(a=this.responseHeaders==="raw"?hft.parseRawHeaders(n):hft.parseHeaders(n)),this.runInAsyncScope(s,null,null,{statusCode:e,headers:a,socket:r,opaque:i,context:o})}onError(e){let{callback:n,opaque:r}=this;mft(this),n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:r})}))}};function fft(t,e){if(e===void 0)return new Promise((n,r)=>{fft.call(this,t,(s,i)=>s?r(s):n(i))});try{let n=new YNe(t,e);this.dispatch({...t,method:"CONNECT"},n)}catch(n){if(typeof e!="function")throw n;let r=t?.opaque;queueMicrotask(()=>e(n,{opaque:r}))}}gft.exports=fft});var yft=ee((M7s,sU)=>{"use strict";p();sU.exports.request=Kmt();sU.exports.stream=nft();sU.exports.pipeline=oft();sU.exports.upgrade=pft();sU.exports.connect=Aft()});var zNe=ee((F7s,bft)=>{"use strict";p();var{UndiciError:Yzn}=Do(),Eft=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),KNe=class t extends Yzn{constructor(e){super(e),Error.captureStackTrace(this,t),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[Eft]===!0}[Eft]=!0};bft.exports={MockNotMatchedError:KNe}});var iU=ee((U7s,_ft)=>{"use strict";p();_ft.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}});var Zj=ee((G7s,Dft)=>{"use strict";p();var{MockNotMatchedError:G1}=zNe(),{kDispatches:Zse,kMockAgent:Kzn,kOriginalDispatch:zzn,kOrigin:Jzn,kGetNetConnect:Xzn}=iU(),{buildURL:Zzn}=Wi(),{STATUS_CODES:e7n}=require("node:http"),{types:{isPromise:t7n}}=require("node:util");function hx(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}function Cft(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e.toLocaleLowerCase(),n]))}function Ift(t,e){if(Array.isArray(t)){for(let n=0;n"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[n,r]of Object.entries(t.headers)){let s=Ift(e,n);if(!hx(r,s))return!1}return!0}function Sft(t){if(typeof t!="string")return t;let e=t.split("?");if(e.length!==2)return t;let n=new URLSearchParams(e.pop());return n.sort(),[...e,n.toString()].join("?")}function n7n(t,{path:e,method:n,body:r,headers:s}){let i=hx(t.path,e),o=hx(t.method,n),a=typeof t.body<"u"?hx(t.body,r):!0,c=xft(t,s);return i&&o&&a&&c}function wft(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}function Tft(t,e){let n=e.query?Zzn(e.path,e.query):e.path,r=typeof n=="string"?Sft(n):n,s=t.filter(({consumed:i})=>!i).filter(({path:i})=>hx(Sft(i),r));if(s.length===0)throw new G1(`Mock dispatch not matched for path '${r}'`);if(s=s.filter(({method:i})=>hx(i,e.method)),s.length===0)throw new G1(`Mock dispatch not matched for method '${e.method}' on path '${r}'`);if(s=s.filter(({body:i})=>typeof i<"u"?hx(i,e.body):!0),s.length===0)throw new G1(`Mock dispatch not matched for body '${e.body}' on path '${r}'`);if(s=s.filter(i=>xft(i,e.headers)),s.length===0){let i=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new G1(`Mock dispatch not matched for headers '${i}' on path '${r}'`)}return s[0]}function r7n(t,e,n){let r={timesInvoked:0,times:1,persist:!1,consumed:!1},s=typeof n=="function"?{callback:n}:{...n},i={...r,...e,pending:!0,data:{error:null,...s}};return t.push(i),i}function JNe(t,e){let n=t.findIndex(r=>r.consumed?n7n(r,e):!1);n!==-1&&t.splice(n,1)}function vft(t){let{path:e,method:n,body:r,headers:s,query:i}=t;return{path:e,method:n,body:r,headers:s,query:i}}function XNe(t){let e=Object.keys(t),n=[];for(let r=0;r=h,r.pending=d0?setTimeout(()=>{m(this[Zse])},u):m(this[Zse]);function m(g,A=i){let y=Array.isArray(t.headers)?ZNe(t.headers):t.headers,b=typeof A=="function"?A({...t,headers:y}):A;if(t7n(b)){b.then(x=>m(g,x));return}let S=wft(b),C=XNe(o),I=XNe(a);e.onConnect?.(x=>e.onError(x),null),e.onHeaders?.(s,C,f,Rft(s)),e.onData?.(Buffer.from(S)),e.onComplete?.(I),JNe(g,n)}function f(){}return!0}function i7n(){let t=this[Kzn],e=this[Jzn],n=this[zzn];return function(s,i){if(t.isMockActive)try{kft.call(this,s,i)}catch(o){if(o instanceof G1){let a=t[Xzn]();if(a===!1)throw new G1(`${o.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(Nft(a,e))n.call(this,s,i);else throw new G1(`${o.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)`)}else throw o}else n.call(this,s,i)}}function Nft(t,e){let n=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(r=>hx(r,n.host)))}function o7n(t){if(t){let{agent:e,...n}=t;return n}}Dft.exports={getResponseData:wft,getMockDispatch:Tft,addMockDispatch:r7n,deleteMockDispatch:JNe,buildKey:vft,generateKeyValues:XNe,matchValue:hx,getResponse:s7n,getStatusText:Rft,mockDispatch:kft,buildMockDispatch:i7n,checkNetConnect:Nft,buildMockOptions:o7n,getHeaderByName:Ift,buildHeadersFromArray:ZNe}});var oDe=ee((q7s,iDe)=>{"use strict";p();var{getResponseData:a7n,buildKey:c7n,addMockDispatch:eDe}=Zj(),{kDispatches:eie,kDispatchKey:tie,kDefaultHeaders:tDe,kDefaultTrailers:nDe,kContentLength:rDe,kMockDispatch:nie}=iU(),{InvalidArgumentError:aS}=Do(),{buildURL:l7n}=Wi(),oU=class{constructor(e){this[nie]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new aS("waitInMs must be a valid integer > 0");return this[nie].delay=e,this}persist(){return this[nie].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new aS("repeatTimes must be a valid integer > 0");return this[nie].times=e,this}},sDe=class{constructor(e,n){if(typeof e!="object")throw new aS("opts must be an object");if(typeof e.path>"u")throw new aS("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=l7n(e.path,e.query);else{let r=new URL(e.path,"data://");e.path=r.pathname+r.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[tie]=c7n(e),this[eie]=n,this[tDe]={},this[nDe]={},this[rDe]=!1}createMockScopeDispatchData({statusCode:e,data:n,responseOptions:r}){let s=a7n(n),i=this[rDe]?{"content-length":s.length}:{},o={...this[tDe],...i,...r.headers},a={...this[nDe],...r.trailers};return{statusCode:e,data:n,headers:o,trailers:a}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new aS("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new aS("responseOptions must be an object")}reply(e){if(typeof e=="function"){let i=a=>{let c=e(a);if(typeof c!="object"||c===null)throw new aS("reply options callback must return an object");let u={data:"",responseOptions:{},...c};return this.validateReplyParameters(u),{...this.createMockScopeDispatchData(u)}},o=eDe(this[eie],this[tie],i);return new oU(o)}let n={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(n);let r=this.createMockScopeDispatchData(n),s=eDe(this[eie],this[tie],r);return new oU(s)}replyWithError(e){if(typeof e>"u")throw new aS("error must be defined");let n=eDe(this[eie],this[tie],{error:e});return new oU(n)}defaultReplyHeaders(e){if(typeof e>"u")throw new aS("headers must be defined");return this[tDe]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new aS("trailers must be defined");return this[nDe]=e,this}replyContentLength(){return this[rDe]=!0,this}};iDe.exports.MockInterceptor=sDe;iDe.exports.MockScope=oU});var lDe=ee((V7s,Qft)=>{"use strict";p();var{promisify:u7n}=require("node:util"),d7n=KQ(),{buildMockDispatch:p7n}=Zj(),{kDispatches:Bft,kMockAgent:Pft,kClose:Oft,kOriginalClose:Mft,kOrigin:Lft,kOriginalDispatch:h7n,kConnected:aDe}=iU(),{MockInterceptor:m7n}=oDe(),Fft=Nc(),{InvalidArgumentError:f7n}=Do(),cDe=class extends d7n{constructor(e,n){if(super(e,n),!n||!n.agent||typeof n.agent.dispatch!="function")throw new f7n("Argument opts.agent must implement Agent");this[Pft]=n.agent,this[Lft]=e,this[Bft]=[],this[aDe]=1,this[h7n]=this.dispatch,this[Mft]=this.close.bind(this),this.dispatch=p7n.call(this),this.close=this[Oft]}get[Fft.kConnected](){return this[aDe]}intercept(e){return new m7n(e,this[Bft])}async[Oft](){await u7n(this[Mft])(),this[aDe]=0,this[Pft][Fft.kClients].delete(this[Lft])}};Qft.exports=cDe});var pDe=ee((Y7s,Vft)=>{"use strict";p();var{promisify:g7n}=require("node:util"),A7n=zQ(),{buildMockDispatch:y7n}=Zj(),{kDispatches:Uft,kMockAgent:$ft,kClose:Gft,kOriginalClose:Wft,kOrigin:qft,kOriginalDispatch:E7n,kConnected:uDe}=iU(),{MockInterceptor:b7n}=oDe(),Hft=Nc(),{InvalidArgumentError:_7n}=Do(),dDe=class extends A7n{constructor(e,n){if(super(e,n),!n||!n.agent||typeof n.agent.dispatch!="function")throw new _7n("Argument opts.agent must implement Agent");this[$ft]=n.agent,this[qft]=e,this[Uft]=[],this[uDe]=1,this[E7n]=this.dispatch,this[Wft]=this.close.bind(this),this.dispatch=y7n.call(this),this.close=this[Gft]}get[Hft.kConnected](){return this[uDe]}intercept(e){return new b7n(e,this[Uft])}async[Gft](){await g7n(this[Wft])(),this[uDe]=0,this[$ft][Hft.kClients].delete(this[qft])}};Vft.exports=dDe});var Yft=ee((J7s,jft)=>{"use strict";p();var S7n={pronoun:"it",is:"is",was:"was",this:"this"},C7n={pronoun:"they",is:"are",was:"were",this:"these"};jft.exports=class{constructor(e,n){this.singular=e,this.plural=n}pluralize(e){let n=e===1,r=n?S7n:C7n,s=n?this.singular:this.plural;return{...r,count:e,noun:s}}}});var zft=ee((eJs,Kft)=>{"use strict";p();var{Transform:I7n}=require("node:stream"),{Console:x7n}=require("node:console"),w7n=process.versions.icu?"\u2705":"Y ",T7n=process.versions.icu?"\u274C":"N ";Kft.exports=class{constructor({disableColors:e}={}){this.transform=new I7n({transform(n,r,s){s(null,n)}}),this.logger=new x7n({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let n=e.map(({method:r,path:s,data:{statusCode:i},persist:o,times:a,timesInvoked:c,origin:u})=>({Method:r,Origin:u,Path:s,"Status code":i,Persistent:o?w7n:T7n,Invocations:c,Remaining:o?1/0:a-c}));return this.logger.table(n),this.transform.read().toString()}}});var egt=ee((nJs,Zft)=>{"use strict";p();var{kClients:W1}=Nc(),v7n=JQ(),{kAgent:hDe,kMockAgentSet:rie,kMockAgentGet:Jft,kDispatches:mDe,kIsMockActive:sie,kNetConnect:q1,kGetNetConnect:R7n,kOptions:iie,kFactory:oie}=iU(),k7n=lDe(),N7n=pDe(),{matchValue:D7n,buildMockOptions:B7n}=Zj(),{InvalidArgumentError:Xft,UndiciError:P7n}=Do(),O7n=Sj(),M7n=Yft(),L7n=zft(),fDe=class extends O7n{constructor(e){if(super(e),this[q1]=!0,this[sie]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new Xft("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new v7n(e);this[hDe]=n,this[W1]=n[W1],this[iie]=B7n(e)}get(e){let n=this[Jft](e);return n||(n=this[oie](e),this[rie](e,n)),n}dispatch(e,n){return this.get(e.origin),this[hDe].dispatch(e,n)}async close(){await this[hDe].close(),this[W1].clear()}deactivate(){this[sie]=!1}activate(){this[sie]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[q1])?this[q1].push(e):this[q1]=[e];else if(typeof e>"u")this[q1]=!0;else throw new Xft("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[q1]=!1}get isMockActive(){return this[sie]}[rie](e,n){this[W1].set(e,n)}[oie](e){let n=Object.assign({agent:this},this[iie]);return this[iie]&&this[iie].connections===1?new k7n(e,n):new N7n(e,n)}[Jft](e){let n=this[W1].get(e);if(n)return n;if(typeof e!="string"){let r=this[oie]("http://localhost:9999");return this[rie](e,r),r}for(let[r,s]of Array.from(this[W1]))if(s&&typeof r!="string"&&D7n(r,e)){let i=this[oie](e);return this[rie](e,i),i[mDe]=s[mDe],i}}[R7n](){return this[q1]}pendingInterceptors(){let e=this[W1];return Array.from(e.entries()).flatMap(([n,r])=>r[mDe].map(s=>({...s,origin:n}))).filter(({pending:n})=>n)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new L7n}={}){let n=this.pendingInterceptors();if(n.length===0)return;let r=new M7n("interceptor","interceptors").pluralize(n.length);throw new P7n(` +`,"latin1"),n!==null&&i!==n){if(r[h2e])throw new NM;process.emitWarning(new NM)}e[Kc].timeout&&e[Kc].timeoutType===h$&&e[Kc].timeout.refresh&&e[Kc].timeout.refresh(),r[BT]()}}destroy(e){let{socket:n,client:r,abort:i}=this;n[t1]=!1,e&&(li(r[Ed]<=1,"pipeline should only contain this request"),i(e))}};oTt.exports=vSr});var fTt=re((aBs,hTt)=>{"use strict";p();var s0=require("node:assert"),{pipeline:MSr}=require("node:stream"),yo=to(),{RequestContentLengthMismatchError:E2e,RequestAbortedError:cTt,SocketError:M6,InformationalError:b2e}=Jo(),{kUrl:Cue,kReset:wue,kClient:f$,kRunning:Tue,kPending:OSr,kQueue:n1,kPendingIdx:_2e,kRunningIdx:__,kError:S_,kSocket:kp,kStrictContentLength:LSr,kOnError:x2e,kMaxConcurrentStreams:mTt,kHTTP2Session:x_,kResume:r1,kSize:FSr,kHTTPContext:QSr}=bl(),NT=Symbol("open streams"),lTt,uTt=!1,Iue;try{Iue=require("node:http2")}catch{Iue={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:USr,HTTP2_HEADER_METHOD:GSr,HTTP2_HEADER_PATH:$Sr,HTTP2_HEADER_SCHEME:WSr,HTTP2_HEADER_CONTENT_LENGTH:HSr,HTTP2_HEADER_EXPECT:qSr,HTTP2_HEADER_STATUS:jSr}}=Iue;function VSr(t){let e=[];for(let[n,r]of Object.entries(t))if(Array.isArray(r))for(let i of r)e.push(Buffer.from(n),Buffer.from(i));else e.push(Buffer.from(n),Buffer.from(r));return e}async function YSr(t,e){t[kp]=e,uTt||(uTt=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let n=Iue.connect(t[Cue],{createConnection:()=>e,peerMaxConcurrentStreams:t[mTt]});n[NT]=0,n[f$]=t,n[kp]=e,yo.addListener(n,"error",KSr),yo.addListener(n,"frameError",JSr),yo.addListener(n,"end",XSr),yo.addListener(n,"goaway",ZSr),yo.addListener(n,"close",function(){let{[f$]:i}=this,{[kp]:s}=i,o=this[kp][S_]||this[S_]||new M6("closed",yo.getSocketInfo(s));if(i[x_]=null,i.destroyed){s0(i[OSr]===0);let a=i[n1].splice(i[__]);for(let c=0;c{r=!0}),{version:"h2",defaultPipelining:1/0,write(...i){return tCr(t,...i)},resume(){zSr(t)},destroy(i,s){r?queueMicrotask(s):e.destroy(i).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}function zSr(t){let e=t[kp];e?.destroyed===!1&&(t[FSr]===0&&t[mTt]===0?(e.unref(),t[x_].unref()):(e.ref(),t[x_].ref()))}function KSr(t){s0(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[kp][S_]=t,this[f$][x2e](t)}function JSr(t,e,n){if(n===0){let r=new b2e(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[kp][S_]=r,this[f$][x2e](r)}}function XSr(){let t=new M6("other side closed",yo.getSocketInfo(this[kp]));this.destroy(t),yo.destroy(this[kp],t)}function ZSr(t){let e=this[S_]||new M6(`HTTP/2: "GOAWAY" frame received with code ${t}`,yo.getSocketInfo(this)),n=this[f$];if(n[kp]=null,n[QSr]=null,this[x_]!=null&&(this[x_].destroy(e),this[x_]=null),yo.destroy(this[kp],e),n[__]{e.aborted||e.completed||(S=S||new cTt,yo.errorRequest(t,e,S),m!=null&&yo.destroy(m,S),yo.destroy(l,S),t[n1][t[__]++]=null,t[r1]())};try{e.onConnect(g)}catch(S){yo.errorRequest(t,e,S)}if(e.aborted)return!1;if(r==="CONNECT")return n.ref(),m=n.request(d,{endStream:!1,signal:c}),m.id&&!m.pending?(e.onUpgrade(null,null,m),++n[NT],t[n1][t[__]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++n[NT],t[n1][t[__]++]=null}),m.once("close",()=>{n[NT]-=1,n[NT]===0&&n.unref()}),!0;d[$Sr]=i,d[WSr]="https";let A=r==="PUT"||r==="POST"||r==="PATCH";l&&typeof l.read=="function"&&l.read(0);let y=yo.bodyLength(l);if(yo.isFormDataLike(l)){lTt??=d$().extractBody;let[S,C]=lTt(l);d["content-type"]=C,l=S.stream,y=S.length}if(y==null&&(y=e.contentLength),(y===0||!A)&&(y=null),eCr(r)&&y>0&&e.contentLength!=null&&e.contentLength!==y){if(t[LSr])return yo.errorRequest(t,e,new E2e),!1;process.emitWarning(new E2e)}y!=null&&(s0(l,"no body must not have content length"),d[HSr]=`${y}`),n.ref();let E=r==="GET"||r==="HEAD"||l===null;return a?(d[qSr]="100-continue",m=n.request(d,{endStream:E,signal:c}),m.once("continue",_)):(m=n.request(d,{endStream:E,signal:c}),_()),++n[NT],m.once("response",S=>{let{[jSr]:C,...I}=S;if(e.onResponseStarted(),e.aborted){let w=new cTt;yo.errorRequest(t,e,w),yo.destroy(m,w);return}e.onHeaders(Number(C),VSr(I),m.resume.bind(m),"")===!1&&m.pause(),m.on("data",w=>{e.onData(w)===!1&&m.pause()})}),m.once("end",()=>{(m.state?.state==null||m.state.state<6)&&e.onComplete([]),n[NT]===0&&n.unref(),g(new b2e("HTTP/2: stream half-closed (remote)")),t[n1][t[__]++]=null,t[_2e]=t[__],t[r1]()}),m.once("close",()=>{n[NT]-=1,n[NT]===0&&n.unref()}),m.once("error",function(S){g(S)}),m.once("frameError",(S,C)=>{g(new b2e(`HTTP/2: "frameError" received - type ${S}, code ${C}`))}),!0;function _(){!l||y===0?dTt(g,m,null,t,e,t[kp],y,A):yo.isBuffer(l)?dTt(g,m,l,t,e,t[kp],y,A):yo.isBlobLike(l)?typeof l.stream=="function"?pTt(g,m,l.stream(),t,e,t[kp],y,A):rCr(g,m,l,t,e,t[kp],y,A):yo.isStream(l)?nCr(g,t[kp],A,m,l,t,e,y):yo.isIterable(l)?pTt(g,m,l,t,e,t[kp],y,A):s0(!1)}}function dTt(t,e,n,r,i,s,o,a){try{n!=null&&yo.isBuffer(n)&&(s0(o===n.byteLength,"buffer body must have content length"),e.cork(),e.write(n),e.uncork(),e.end(),i.onBodySent(n)),a||(s[wue]=!0),i.onRequestSent(),r[r1]()}catch(c){t(c)}}function nCr(t,e,n,r,i,s,o,a){s0(a!==0||s[Tue]===0,"stream body cannot be pipelined");let c=MSr(i,r,l=>{l?(yo.destroy(c,l),t(l)):(yo.removeAllListeners(c),o.onRequestSent(),n||(e[wue]=!0),s[r1]())});yo.addListener(c,"data",u);function u(l){o.onBodySent(l)}}async function rCr(t,e,n,r,i,s,o,a){s0(o===n.size,"blob body must have content length");try{if(o!=null&&o!==n.size)throw new E2e;let c=Buffer.from(await n.arrayBuffer());e.cork(),e.write(c),e.uncork(),e.end(),i.onBodySent(c),i.onRequestSent(),a||(s[wue]=!0),r[r1]()}catch(c){t(c)}}async function pTt(t,e,n,r,i,s,o,a){s0(o!==0||r[Tue]===0,"iterator body cannot be pipelined");let c=null;function u(){if(c){let d=c;c=null,d()}}let l=()=>new Promise((d,m)=>{s0(c===null),s[S_]?m(s[S_]):c=d});e.on("close",u).on("drain",u);try{for await(let d of n){if(s[S_])throw s[S_];let m=e.write(d);i.onBodySent(d),m||await l()}e.end(),i.onRequestSent(),a||(s[wue]=!0),r[r1]()}catch(d){t(d)}finally{e.off("close",u).off("drain",u)}}hTt.exports=YSr});var Rue=re((lBs,yTt)=>{"use strict";p();var eC=to(),{kBodyUsed:O6}=bl(),C2e=require("node:assert"),{InvalidArgumentError:iCr}=Jo(),sCr=require("node:events"),oCr=[300,301,302,303,307,308],gTt=Symbol("body"),vue=class{constructor(e){this[gTt]=e,this[O6]=!1}async*[Symbol.asyncIterator](){C2e(!this[O6],"disturbed"),this[O6]=!0,yield*this[gTt]}},S2e=class{constructor(e,n,r,i){if(n!=null&&(!Number.isInteger(n)||n<0))throw new iCr("maxRedirections must be a positive number");eC.validateHandler(i,r.method,r.upgrade),this.dispatch=e,this.location=null,this.abort=null,this.opts={...r,maxRedirections:0},this.maxRedirections=n,this.handler=i,this.history=[],this.redirectionLimitReached=!1,eC.isStream(this.opts.body)?(eC.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){C2e(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[O6]=!1,sCr.prototype.on.call(this.opts.body,"data",function(){this[O6]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new vue(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&eC.isIterable(this.opts.body)&&(this.opts.body=new vue(this.opts.body))}onConnect(e){this.abort=e,this.handler.onConnect(e,{history:this.history})}onUpgrade(e,n,r){this.handler.onUpgrade(e,n,r)}onError(e){this.handler.onError(e)}onHeaders(e,n,r,i){if(this.location=this.history.length>=this.maxRedirections||eC.isDisturbed(this.opts.body)?null:aCr(e,n),this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections){this.request&&this.request.abort(new Error("max redirects")),this.redirectionLimitReached=!0,this.abort(new Error("max redirects"));return}if(this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(e,n,r,i);let{origin:s,pathname:o,search:a}=eC.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),c=a?`${o}${a}`:o;this.opts.headers=cCr(this.opts.headers,e===303,this.opts.origin!==s),this.opts.path=c,this.opts.origin=s,this.opts.maxRedirections=0,this.opts.query=null,e===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",this.opts.body=null)}onData(e){if(!this.location)return this.handler.onData(e)}onComplete(e){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(e)}onBodySent(e){this.handler.onBodySent&&this.handler.onBodySent(e)}};function aCr(t,e){if(oCr.indexOf(t)===-1)return null;for(let n=0;n{"use strict";p();var lCr=Rue();function uCr({maxRedirections:t}){return e=>function(r,i){let{maxRedirections:s=t}=r;if(!s)return e(r,i);let o=new lCr(e,s,r,i);return r={...r,maxRedirections:0},e(r,o)}}ETt.exports=uCr});var y$=re((mBs,RTt)=>{"use strict";p();var DT=require("node:assert"),ITt=require("node:net"),dCr=require("node:http"),OM=to(),{channels:g$}=XG(),pCr=RIt(),mCr=n$(),{InvalidArgumentError:zu,InformationalError:hCr,ClientDestroyedError:fCr}=Jo(),gCr=S6(),{kUrl:tC,kServerName:i1,kClient:ACr,kBusy:I2e,kConnect:yCr,kResuming:LM,kRunning:G6,kPending:$6,kSize:U6,kQueue:C_,kConnected:ECr,kConnecting:A$,kNeedDrain:o1,kKeepAliveDefaultTimeout:bTt,kHostHeader:bCr,kPendingIdx:I_,kRunningIdx:PT,kError:_Cr,kPipelining:Bue,kKeepAliveTimeoutValue:xCr,kMaxHeadersSize:SCr,kKeepAliveMaxTimeout:CCr,kKeepAliveTimeoutThreshold:ICr,kHeadersTimeout:wCr,kBodyTimeout:TCr,kStrictContentLength:vCr,kConnector:L6,kMaxRedirections:RCr,kMaxRequests:w2e,kCounter:kCr,kClose:BCr,kDestroy:NCr,kDispatch:DCr,kInterceptors:_Tt,kLocalAddress:F6,kMaxResponseSize:PCr,kOnError:MCr,kHTTPContext:Ku,kMaxConcurrentStreams:OCr,kResume:Q6}=bl(),LCr=aTt(),FCr=fTt(),xTt=!1,s1=Symbol("kClosedResolve"),STt=()=>{};function wTt(t){return t[Bue]??t[Ku]?.defaultPipelining??1}var T2e=class extends mCr{constructor(e,{interceptors:n,maxHeaderSize:r,headersTimeout:i,socketTimeout:s,requestTimeout:o,connectTimeout:a,bodyTimeout:c,idleTimeout:u,keepAlive:l,keepAliveTimeout:d,maxKeepAliveTimeout:m,keepAliveMaxTimeout:h,keepAliveTimeoutThreshold:f,socketPath:g,pipelining:A,tls:y,strictContentLength:E,maxCachedSessions:_,maxRedirections:S,connect:C,maxRequestsPerClient:I,localAddress:w,maxResponseSize:k,autoSelectFamily:N,autoSelectFamilyAttemptTimeout:O,maxConcurrentStreams:W,allowH2:$,webSocket:G}={}){if(super({webSocket:G}),l!==void 0)throw new zu("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new zu("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(o!==void 0)throw new zu("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new zu("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new zu("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null&&!Number.isFinite(r))throw new zu("invalid maxHeaderSize");if(g!=null&&typeof g!="string")throw new zu("invalid socketPath");if(a!=null&&(!Number.isFinite(a)||a<0))throw new zu("invalid connectTimeout");if(d!=null&&(!Number.isFinite(d)||d<=0))throw new zu("invalid keepAliveTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new zu("invalid keepAliveMaxTimeout");if(f!=null&&!Number.isFinite(f))throw new zu("invalid keepAliveTimeoutThreshold");if(i!=null&&(!Number.isInteger(i)||i<0))throw new zu("headersTimeout must be a positive integer or zero");if(c!=null&&(!Number.isInteger(c)||c<0))throw new zu("bodyTimeout must be a positive integer or zero");if(C!=null&&typeof C!="function"&&typeof C!="object")throw new zu("connect must be a function or an object");if(S!=null&&(!Number.isInteger(S)||S<0))throw new zu("maxRedirections must be a positive number");if(I!=null&&(!Number.isInteger(I)||I<0))throw new zu("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||ITt.isIP(w)===0))throw new zu("localAddress must be valid string IP address");if(k!=null&&(!Number.isInteger(k)||k<-1))throw new zu("maxResponseSize must be a positive number");if(O!=null&&(!Number.isInteger(O)||O<-1))throw new zu("autoSelectFamilyAttemptTimeout must be a positive number");if($!=null&&typeof $!="boolean")throw new zu("allowH2 must be a valid boolean value");if(W!=null&&(typeof W!="number"||W<1))throw new zu("maxConcurrentStreams must be a positive integer, greater than 0");typeof C!="function"&&(C=gCr({...y,maxCachedSessions:_,allowH2:$,socketPath:g,timeout:a,...N?{autoSelectFamily:N,autoSelectFamilyAttemptTimeout:O}:void 0,...C})),n?.Client&&Array.isArray(n.Client)?(this[_Tt]=n.Client,xTt||(xTt=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[_Tt]=[QCr({maxRedirections:S})],this[tC]=OM.parseOrigin(e),this[L6]=C,this[Bue]=A??1,this[SCr]=r||dCr.maxHeaderSize,this[bTt]=d??4e3,this[CCr]=h??6e5,this[ICr]=f??2e3,this[xCr]=this[bTt],this[i1]=null,this[F6]=w??null,this[LM]=0,this[o1]=0,this[bCr]=`host: ${this[tC].hostname}${this[tC].port?`:${this[tC].port}`:""}\r +`,this[TCr]=c??3e5,this[wCr]=i??3e5,this[vCr]=E??!0,this[RCr]=S,this[w2e]=I,this[s1]=null,this[PCr]=k>-1?k:-1,this[OCr]=W??100,this[Ku]=null,this[C_]=[],this[PT]=0,this[I_]=0,this[Q6]=q=>v2e(this,q),this[MCr]=q=>TTt(this,q)}get pipelining(){return this[Bue]}set pipelining(e){this[Bue]=e,this[Q6](!0)}get[$6](){return this[C_].length-this[I_]}get[G6](){return this[I_]-this[PT]}get[U6](){return this[C_].length-this[PT]}get[ECr](){return!!this[Ku]&&!this[A$]&&!this[Ku].destroyed}get[I2e](){return!!(this[Ku]?.busy(null)||this[U6]>=(wTt(this)||1)||this[$6]>0)}[yCr](e){vTt(this),this.once("connect",e)}[DCr](e,n){let r=e.origin||this[tC].origin,i=new pCr(r,e,n);return this[C_].push(i),this[LM]||(OM.bodyLength(i.body)==null&&OM.isIterable(i.body)?(this[LM]=1,queueMicrotask(()=>v2e(this))):this[Q6](!0)),this[LM]&&this[o1]!==2&&this[I2e]&&(this[o1]=2),this[o1]<2}async[BCr](){return new Promise(e=>{this[U6]?this[s1]=e:e(null)})}async[NCr](e){return new Promise(n=>{let r=this[C_].splice(this[I_]);for(let s=0;s{this[s1]&&(this[s1](),this[s1]=null),n(null)};this[Ku]?(this[Ku].destroy(e,i),this[Ku]=null):queueMicrotask(i),this[Q6]()})}},QCr=kue();function TTt(t,e){if(t[G6]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){DT(t[I_]===t[PT]);let n=t[C_].splice(t[PT]);for(let r=0;r{t[L6]({host:e,hostname:n,protocol:r,port:i,servername:t[i1],localAddress:t[F6]},(c,u)=>{c?a(c):o(u)})});if(t.destroyed){OM.destroy(s.on("error",STt),new fCr);return}DT(s);try{t[Ku]=s.alpnProtocol==="h2"?await FCr(t,s):await LCr(t,s)}catch(o){throw s.destroy().on("error",STt),o}t[A$]=!1,s[kCr]=0,s[w2e]=t[w2e],s[ACr]=t,s[_Cr]=null,g$.connected.hasSubscribers&&g$.connected.publish({connectParams:{host:e,hostname:n,protocol:r,port:i,version:t[Ku]?.version,servername:t[i1],localAddress:t[F6]},connector:t[L6],socket:s}),t.emit("connect",t[tC],[t])}catch(s){if(t.destroyed)return;if(t[A$]=!1,g$.connectError.hasSubscribers&&g$.connectError.publish({connectParams:{host:e,hostname:n,protocol:r,port:i,version:t[Ku]?.version,servername:t[i1],localAddress:t[F6]},connector:t[L6],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(DT(t[G6]===0);t[$6]>0&&t[C_][t[I_]].servername===t[i1];){let o=t[C_][t[I_]++];OM.errorRequest(t,o,s)}else TTt(t,s);t.emit("connectionError",t[tC],[t],s)}t[Q6]()}function CTt(t){t[o1]=0,t.emit("drain",t[tC],[t])}function v2e(t,e){t[LM]!==2&&(t[LM]=2,UCr(t,e),t[LM]=0,t[PT]>256&&(t[C_].splice(0,t[PT]),t[I_]-=t[PT],t[PT]=0))}function UCr(t,e){for(;;){if(t.destroyed){DT(t[$6]===0);return}if(t[s1]&&!t[U6]){t[s1](),t[s1]=null;return}if(t[Ku]&&t[Ku].resume(),t[I2e])t[o1]=2;else if(t[o1]===2){e?(t[o1]=1,queueMicrotask(()=>CTt(t))):CTt(t);continue}if(t[$6]===0||t[G6]>=(wTt(t)||1))return;let n=t[C_][t[I_]];if(t[tC].protocol==="https:"&&t[i1]!==n.servername){if(t[G6]>0)return;t[i1]=n.servername,t[Ku]?.destroy(new hCr("servername changed"),()=>{t[Ku]=null,v2e(t)})}if(t[A$])return;if(!t[Ku]){vTt(t);return}if(t[Ku].destroyed||t[Ku].busy(n))return;!n.aborted&&t[Ku].write(n)?t[I_]++:t[C_].splice(t[I_],1)}}RTt.exports=T2e});var R2e=re((gBs,kTt)=>{"use strict";p();var Nue=class{constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};kTt.exports=class{constructor(){this.head=this.tail=new Nue}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Nue),this.head.push(e)}shift(){let e=this.tail,n=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),n}}});var NTt=re((yBs,BTt)=>{p();var{kFree:GCr,kConnected:$Cr,kPending:WCr,kQueued:HCr,kRunning:qCr,kSize:jCr}=bl(),FM=Symbol("pool"),k2e=class{constructor(e){this[FM]=e}get connected(){return this[FM][$Cr]}get free(){return this[FM][GCr]}get pending(){return this[FM][WCr]}get queued(){return this[FM][HCr]}get running(){return this[FM][qCr]}get size(){return this[FM][jCr]}};BTt.exports=k2e});var O2e=re((bBs,$Tt)=>{"use strict";p();var VCr=n$(),YCr=R2e(),{kConnected:B2e,kSize:DTt,kRunning:PTt,kPending:MTt,kQueued:W6,kBusy:zCr,kFree:KCr,kUrl:JCr,kClose:XCr,kDestroy:ZCr,kDispatch:eIr}=bl(),tIr=NTt(),$g=Symbol("clients"),Sf=Symbol("needDrain"),H6=Symbol("queue"),N2e=Symbol("closed resolve"),D2e=Symbol("onDrain"),OTt=Symbol("onConnect"),LTt=Symbol("onDisconnect"),FTt=Symbol("onConnectionError"),P2e=Symbol("get dispatcher"),UTt=Symbol("add client"),GTt=Symbol("remove client"),QTt=Symbol("stats"),M2e=class extends VCr{constructor(e){super(e),this[H6]=new YCr,this[$g]=[],this[W6]=0;let n=this;this[D2e]=function(i,s){let o=n[H6],a=!1;for(;!a;){let c=o.shift();if(!c)break;n[W6]--,a=!this.dispatch(c.opts,c.handler)}this[Sf]=a,!this[Sf]&&n[Sf]&&(n[Sf]=!1,n.emit("drain",i,[n,...s])),n[N2e]&&o.isEmpty()&&Promise.all(n[$g].map(c=>c.close())).then(n[N2e])},this[OTt]=(r,i)=>{n.emit("connect",r,[n,...i])},this[LTt]=(r,i,s)=>{n.emit("disconnect",r,[n,...i],s)},this[FTt]=(r,i,s)=>{n.emit("connectionError",r,[n,...i],s)},this[QTt]=new tIr(this)}get[zCr](){return this[Sf]}get[B2e](){return this[$g].filter(e=>e[B2e]).length}get[KCr](){return this[$g].filter(e=>e[B2e]&&!e[Sf]).length}get[MTt](){let e=this[W6];for(let{[MTt]:n}of this[$g])e+=n;return e}get[PTt](){let e=0;for(let{[PTt]:n}of this[$g])e+=n;return e}get[DTt](){let e=this[W6];for(let{[DTt]:n}of this[$g])e+=n;return e}get stats(){return this[QTt]}async[XCr](){this[H6].isEmpty()?await Promise.all(this[$g].map(e=>e.close())):await new Promise(e=>{this[N2e]=e})}async[ZCr](e){for(;;){let n=this[H6].shift();if(!n)break;n.handler.onError(e)}await Promise.all(this[$g].map(n=>n.destroy(e)))}[eIr](e,n){let r=this[P2e]();return r?r.dispatch(e,n)||(r[Sf]=!0,this[Sf]=!this[P2e]()):(this[Sf]=!0,this[H6].push({opts:e,handler:n}),this[W6]++),!this[Sf]}[UTt](e){return e.on("drain",this[D2e]).on("connect",this[OTt]).on("disconnect",this[LTt]).on("connectionError",this[FTt]),this[$g].push(e),this[Sf]&&queueMicrotask(()=>{this[Sf]&&this[D2e](e[JCr],[this,e])}),this}[GTt](e){e.close(()=>{let n=this[$g].indexOf(e);n!==-1&&this[$g].splice(n,1)}),this[Sf]=this[$g].some(n=>!n[Sf]&&n.closed!==!0&&n.destroyed!==!0)}};$Tt.exports={PoolBase:M2e,kClients:$g,kNeedDrain:Sf,kAddClient:UTt,kRemoveClient:GTt,kGetDispatcher:P2e}});var E$=re((xBs,jTt)=>{"use strict";p();var{PoolBase:nIr,kClients:Due,kNeedDrain:rIr,kAddClient:iIr,kGetDispatcher:sIr}=O2e(),oIr=y$(),{InvalidArgumentError:L2e}=Jo(),WTt=to(),{kUrl:HTt,kInterceptors:aIr}=bl(),cIr=S6(),F2e=Symbol("options"),Q2e=Symbol("connections"),qTt=Symbol("factory");function lIr(t,e){return new oIr(t,e)}var U2e=class extends nIr{constructor(e,{connections:n,factory:r=lIr,connect:i,connectTimeout:s,tls:o,maxCachedSessions:a,socketPath:c,autoSelectFamily:u,autoSelectFamilyAttemptTimeout:l,allowH2:d,...m}={}){if(n!=null&&(!Number.isFinite(n)||n<0))throw new L2e("invalid connections");if(typeof r!="function")throw new L2e("factory must be a function.");if(i!=null&&typeof i!="function"&&typeof i!="object")throw new L2e("connect must be a function or an object");typeof i!="function"&&(i=cIr({...o,maxCachedSessions:a,allowH2:d,socketPath:c,timeout:s,...u?{autoSelectFamily:u,autoSelectFamilyAttemptTimeout:l}:void 0,...i})),super(m),this[aIr]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[Q2e]=n||null,this[HTt]=WTt.parseOrigin(e),this[F2e]={...WTt.deepClone(m),connect:i,allowH2:d},this[F2e].interceptors=m.interceptors?{...m.interceptors}:void 0,this[qTt]=r,this.on("connectionError",(h,f,g)=>{for(let A of f){let y=this[Due].indexOf(A);y!==-1&&this[Due].splice(y,1)}})}[sIr](){for(let e of this[Due])if(!e[rIr])return e;if(!this[Q2e]||this[Due].length{"use strict";p();var{BalancedPoolMissingUpstreamError:uIr,InvalidArgumentError:dIr}=Jo(),{PoolBase:pIr,kClients:Ah,kNeedDrain:q6,kAddClient:mIr,kRemoveClient:hIr,kGetDispatcher:fIr}=O2e(),gIr=E$(),{kUrl:G2e,kInterceptors:AIr}=bl(),{parseOrigin:VTt}=to(),YTt=Symbol("factory"),Pue=Symbol("options"),zTt=Symbol("kGreatestCommonDivisor"),QM=Symbol("kCurrentWeight"),UM=Symbol("kIndex"),o0=Symbol("kWeight"),Mue=Symbol("kMaxWeightPerServer"),Oue=Symbol("kErrorPenalty");function yIr(t,e){if(t===0)return e;for(;e!==0;){let n=e;e=t%e,t=n}return t}function EIr(t,e){return new gIr(t,e)}var $2e=class extends pIr{constructor(e=[],{factory:n=EIr,...r}={}){if(super(),this[Pue]=r,this[UM]=-1,this[QM]=0,this[Mue]=this[Pue].maxWeightPerServer||100,this[Oue]=this[Pue].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof n!="function")throw new dIr("factory must be a function.");this[AIr]=r.interceptors?.BalancedPool&&Array.isArray(r.interceptors.BalancedPool)?r.interceptors.BalancedPool:[],this[YTt]=n;for(let i of e)this.addUpstream(i);this._updateBalancedPoolStats()}addUpstream(e){let n=VTt(e).origin;if(this[Ah].find(i=>i[G2e].origin===n&&i.closed!==!0&&i.destroyed!==!0))return this;let r=this[YTt](n,Object.assign({},this[Pue]));this[mIr](r),r.on("connect",()=>{r[o0]=Math.min(this[Mue],r[o0]+this[Oue])}),r.on("connectionError",()=>{r[o0]=Math.max(1,r[o0]-this[Oue]),this._updateBalancedPoolStats()}),r.on("disconnect",(...i)=>{let s=i[2];s&&s.code==="UND_ERR_SOCKET"&&(r[o0]=Math.max(1,r[o0]-this[Oue]),this._updateBalancedPoolStats())});for(let i of this[Ah])i[o0]=this[Mue];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let n=0;ni[G2e].origin===n&&i.closed!==!0&&i.destroyed!==!0);return r&&this[hIr](r),this}get upstreams(){return this[Ah].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[G2e].origin)}[fIr](){if(this[Ah].length===0)throw new uIr;if(!this[Ah].find(s=>!s[q6]&&s.closed!==!0&&s.destroyed!==!0)||this[Ah].map(s=>s[q6]).reduce((s,o)=>s&&o,!0))return;let r=0,i=this[Ah].findIndex(s=>!s[q6]);for(;r++this[Ah][i][o0]&&!s[q6]&&(i=this[UM]),this[UM]===0&&(this[QM]=this[QM]-this[zTt],this[QM]<=0&&(this[QM]=this[Mue])),s[o0]>=this[QM]&&!s[q6])return s}return this[QM]=this[Ah][i][o0],this[UM]=i,this[Ah][i]}};KTt.exports=$2e});var b$=re((wBs,ivt)=>{"use strict";p();var{InvalidArgumentError:Lue}=Jo(),{kClients:a1,kRunning:XTt,kClose:bIr,kDestroy:_Ir,kDispatch:xIr,kInterceptors:SIr}=bl(),CIr=n$(),IIr=E$(),wIr=y$(),TIr=to(),vIr=kue(),ZTt=Symbol("onConnect"),evt=Symbol("onDisconnect"),tvt=Symbol("onConnectionError"),RIr=Symbol("maxRedirections"),nvt=Symbol("onDrain"),rvt=Symbol("factory"),W2e=Symbol("options");function kIr(t,e){return e&&e.connections===1?new wIr(t,e):new IIr(t,e)}var H2e=class extends CIr{constructor({factory:e=kIr,maxRedirections:n=0,connect:r,...i}={}){if(typeof e!="function")throw new Lue("factory must be a function.");if(r!=null&&typeof r!="function"&&typeof r!="object")throw new Lue("connect must be a function or an object");if(!Number.isInteger(n)||n<0)throw new Lue("maxRedirections must be a positive number");super(i),r&&typeof r!="function"&&(r={...r}),this[SIr]=i.interceptors?.Agent&&Array.isArray(i.interceptors.Agent)?i.interceptors.Agent:[vIr({maxRedirections:n})],this[W2e]={...TIr.deepClone(i),connect:r},this[W2e].interceptors=i.interceptors?{...i.interceptors}:void 0,this[RIr]=n,this[rvt]=e,this[a1]=new Map,this[nvt]=(s,o)=>{this.emit("drain",s,[this,...o])},this[ZTt]=(s,o)=>{this.emit("connect",s,[this,...o])},this[evt]=(s,o,a)=>{this.emit("disconnect",s,[this,...o],a)},this[tvt]=(s,o,a)=>{this.emit("connectionError",s,[this,...o],a)}}get[XTt](){let e=0;for(let n of this[a1].values())e+=n[XTt];return e}[xIr](e,n){let r;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))r=String(e.origin);else throw new Lue("opts.origin must be a non-empty string or URL.");let i=this[a1].get(r);return i||(i=this[rvt](e.origin,this[W2e]).on("drain",this[nvt]).on("connect",this[ZTt]).on("disconnect",this[evt]).on("connectionError",this[tvt]),this[a1].set(r,i)),i.dispatch(e,n)}async[bIr](){let e=[];for(let n of this[a1].values())e.push(n.close());this[a1].clear(),await Promise.all(e)}async[_Ir](e){let n=[];for(let r of this[a1].values())n.push(r.destroy(e));this[a1].clear(),await Promise.all(n)}};ivt.exports=H2e});var z2e=re((vBs,fvt)=>{"use strict";p();var{kProxy:q2e,kClose:uvt,kDestroy:dvt,kDispatch:svt,kInterceptors:BIr}=bl(),{URL:GM}=require("node:url"),NIr=b$(),pvt=E$(),mvt=n$(),{InvalidArgumentError:_$,RequestAbortedError:DIr,SecureProxyConnectionError:PIr}=Jo(),ovt=S6(),hvt=y$(),Fue=Symbol("proxy agent"),Que=Symbol("proxy client"),c1=Symbol("proxy headers"),j2e=Symbol("request tls settings"),avt=Symbol("proxy tls settings"),cvt=Symbol("connect endpoint function"),lvt=Symbol("tunnel proxy");function MIr(t){return t==="https:"?443:80}function OIr(t,e){return new pvt(t,e)}var LIr=()=>{};function FIr(t,e){return e.connections===1?new hvt(t,e):new pvt(t,e)}var V2e=class extends mvt{#e;constructor(e,{headers:n={},connect:r,factory:i}){if(super(),!e)throw new _$("Proxy URL is mandatory");this[c1]=n,i?this.#e=i(e,{connect:r}):this.#e=new hvt(e,{connect:r})}[svt](e,n){let r=n.onHeaders;n.onHeaders=function(a,c,u){if(a===407){typeof n.onError=="function"&&n.onError(new _$("Proxy Authentication Required (407)"));return}r&&r.call(this,a,c,u)};let{origin:i,path:s="/",headers:o={}}=e;if(e.path=i+s,!("host"in o)&&!("Host"in o)){let{host:a}=new GM(i);o.host=a}return e.headers={...this[c1],...o},this.#e[svt](e,n)}async[uvt](){return this.#e.close()}async[dvt](e){return this.#e.destroy(e)}},Y2e=class extends mvt{constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof GM)&&!e.uri)throw new _$("Proxy uri is mandatory");let{clientFactory:n=OIr}=e;if(typeof n!="function")throw new _$("Proxy opts.clientFactory must be a function.");let{proxyTunnel:r=!0}=e,i=this.#e(e),{href:s,origin:o,port:a,protocol:c,username:u,password:l,hostname:d}=i;if(this[q2e]={uri:s,protocol:c},this[BIr]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[j2e]=e.requestTls,this[avt]=e.proxyTls,this[c1]=e.headers||{},this[lvt]=r,e.auth&&e.token)throw new _$("opts.auth cannot be used in combination with opts.token");e.auth?this[c1]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[c1]["proxy-authorization"]=e.token:u&&l&&(this[c1]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(u)}:${decodeURIComponent(l)}`).toString("base64")}`);let m=ovt({...e.proxyTls});this[cvt]=ovt({...e.requestTls});let h=e.factory||FIr,f=(g,A)=>{let{protocol:y}=new GM(g);return!this[lvt]&&y==="http:"&&this[q2e].protocol==="http:"?new V2e(this[q2e].uri,{headers:this[c1],connect:m,factory:h}):h(g,A)};this[Que]=n(i,{connect:m}),this[Fue]=new NIr({...e,factory:f,connect:async(g,A)=>{let y=g.host;g.port||(y+=`:${MIr(g.protocol)}`);try{let{socket:E,statusCode:_}=await this[Que].connect({origin:o,port:a,path:y,signal:g.signal,headers:{...this[c1],host:g.host},servername:this[avt]?.servername||d});if(_!==200&&(E.on("error",LIr).destroy(),A(new DIr(`Proxy response (${_}) !== 200 when HTTP Tunneling`))),g.protocol!=="https:"){A(null,E);return}let S;this[j2e]?S=this[j2e].servername:S=g.servername,this[cvt]({...g,servername:S,httpSocket:E},A)}catch(E){E.code==="ERR_TLS_CERT_ALTNAME_INVALID"?A(new PIr(E)):A(E)}}})}dispatch(e,n){let r=QIr(e.headers);if(UIr(r),r&&!("host"in r)&&!("Host"in r)){let{host:i}=new GM(e.origin);r.host=i}return this[Fue].dispatch({...e,headers:r},n)}#e(e){return typeof e=="string"?new GM(e):e instanceof GM?e:new GM(e.uri)}async[uvt](){await this[Fue].close(),await this[Que].close()}async[dvt](){await this[Fue].destroy(),await this[Que].destroy()}};function QIr(t){if(Array.isArray(t)){let e={};for(let n=0;nn.toLowerCase()==="proxy-authorization"))throw new _$("Proxy-Authorization should be sent in ProxyAgent constructor")}fvt.exports=Y2e});var _vt=re((kBs,bvt)=>{"use strict";p();var GIr=n$(),{kClose:$Ir,kDestroy:WIr,kClosed:gvt,kDestroyed:Avt,kDispatch:HIr,kNoProxyAgent:j6,kHttpProxyAgent:l1,kHttpsProxyAgent:$M}=bl(),yvt=z2e(),qIr=b$(),jIr={"http:":80,"https:":443},Evt=!1,K2e=class extends GIr{#e=null;#t=null;#n=null;constructor(e={}){super(),this.#n=e,Evt||(Evt=!0,process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.",{code:"UNDICI-EHPA"}));let{httpProxy:n,httpsProxy:r,noProxy:i,...s}=e;this[j6]=new qIr(s);let o=n??process.env.http_proxy??process.env.HTTP_PROXY;o?this[l1]=new yvt({...s,uri:o}):this[l1]=this[j6];let a=r??process.env.https_proxy??process.env.HTTPS_PROXY;a?this[$M]=new yvt({...s,uri:a}):this[$M]=this[l1],this.#s()}[HIr](e,n){let r=new URL(e.origin);return this.#r(r).dispatch(e,n)}async[$Ir](){await this[j6].close(),this[l1][gvt]||await this[l1].close(),this[$M][gvt]||await this[$M].close()}async[WIr](e){await this[j6].destroy(e),this[l1][Avt]||await this[l1].destroy(e),this[$M][Avt]||await this[$M].destroy(e)}#r(e){let{protocol:n,host:r,port:i}=e;return r=r.replace(/:\d*$/,"").toLowerCase(),i=Number.parseInt(i,10)||jIr[n]||0,this.#i(r,i)?n==="https:"?this[$M]:this[l1]:this[j6]}#i(e,n){if(this.#o&&this.#s(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let r=0;r{"use strict";p();var x$=require("node:assert"),{kRetryHandlerDefaultRetry:xvt}=bl(),{RequestRetryError:V6}=Jo(),{isDisturbed:Svt,parseHeaders:VIr,parseRangeHeader:Cvt,wrapRequestBody:YIr}=to();function zIr(t){let e=Date.now();return new Date(t).getTime()-e}var J2e=class t{constructor(e,n){let{retryOptions:r,...i}=e,{retry:s,maxRetries:o,maxTimeout:a,minTimeout:c,timeoutFactor:u,methods:l,errorCodes:d,retryAfter:m,statusCodes:h}=r??{};this.dispatch=n.dispatch,this.handler=n.handler,this.opts={...i,body:YIr(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[xvt],retryAfter:m??!0,maxTimeout:a??30*1e3,minTimeout:c??500,timeoutFactor:u??2,maxRetries:o??5,methods:l??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:h??[500,502,503,504,429],errorCodes:d??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(f=>{this.aborted=!0,this.abort?this.abort(f):this.reason=f})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,n,r){this.handler.onUpgrade&&this.handler.onUpgrade(e,n,r)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[xvt](e,{state:n,opts:r},i){let{statusCode:s,code:o,headers:a}=e,{method:c,retryOptions:u}=r,{maxRetries:l,minTimeout:d,maxTimeout:m,timeoutFactor:h,statusCodes:f,errorCodes:g,methods:A}=u,{counter:y}=n;if(o&&o!=="UND_ERR_REQ_RETRY"&&!g.includes(o)){i(e);return}if(Array.isArray(A)&&!A.includes(c)){i(e);return}if(s!=null&&Array.isArray(f)&&!f.includes(s)){i(e);return}if(y>l){i(e);return}let E=a?.["retry-after"];E&&(E=Number(E),E=Number.isNaN(E)?zIr(E):E*1e3);let _=E>0?Math.min(E,m):Math.min(d*h**(y-1),m);setTimeout(()=>i(null),_)}onHeaders(e,n,r,i){let s=VIr(n);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,n,r,i):(this.abort(new V6("Request failed",e,{headers:s,data:{count:this.retryCount}})),!1);if(this.resume!=null){if(this.resume=null,e!==206&&(this.start>0||e!==200))return this.abort(new V6("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let a=Cvt(s["content-range"]);if(!a)return this.abort(new V6("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new V6("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:c,size:u,end:l=u-1}=a;return x$(this.start===c,"content-range mismatch"),x$(this.end==null||this.end===l,"content-range mismatch"),this.resume=r,!0}if(this.end==null){if(e===206){let a=Cvt(s["content-range"]);if(a==null)return this.handler.onHeaders(e,n,r,i);let{start:c,size:u,end:l=u-1}=a;x$(c!=null&&Number.isFinite(c),"content-range mismatch"),x$(l!=null&&Number.isFinite(l),"invalid content-length"),this.start=c,this.end=l}if(this.end==null){let a=s["content-length"];this.end=a!=null?Number(a)-1:null}return x$(Number.isFinite(this.start)),x$(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=r,this.etag=s.etag!=null?s.etag:null,this.etag!=null&&this.etag.startsWith("W/")&&(this.etag=null),this.handler.onHeaders(e,n,r,i)}let o=new V6("Request failed",e,{headers:s,data:{count:this.retryCount}});return this.abort(o),!1}onData(e){return this.start+=e.length,this.handler.onData(e)}onComplete(e){return this.retryCount=0,this.handler.onComplete(e)}onError(e){if(this.aborted||Svt(this.opts.body))return this.handler.onError(e);this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},n.bind(this));function n(r){if(r!=null||this.aborted||Svt(this.opts.body))return this.handler.onError(r);if(this.start!==0){let i={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(i["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...i}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(i){this.handler.onError(i)}}}};Ivt.exports=J2e});var Tvt=re((PBs,wvt)=>{"use strict";p();var KIr=_6(),JIr=Uue(),X2e=class extends KIr{#e=null;#t=null;constructor(e,n={}){super(n),this.#e=e,this.#t=n}dispatch(e,n){let r=new JIr({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:n});return this.#e.dispatch(e,r)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};wvt.exports=X2e});var iFe=re((OBs,Ovt)=>{"use strict";p();var Nvt=require("node:assert"),{Readable:XIr}=require("node:stream"),{RequestAbortedError:Dvt,NotSupportedError:ZIr,InvalidArgumentError:ewr,AbortError:Z2e}=Jo(),Pvt=to(),{ReadableStreamFrom:twr}=to(),ny=Symbol("kConsume"),Y6=Symbol("kReading"),u1=Symbol("kBody"),vvt=Symbol("kAbort"),Mvt=Symbol("kContentType"),Rvt=Symbol("kContentLength"),nwr=()=>{},eFe=class extends XIr{constructor({resume:e,abort:n,contentType:r="",contentLength:i,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[vvt]=n,this[ny]=null,this[u1]=null,this[Mvt]=r,this[Rvt]=i,this[Y6]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new Dvt),e&&this[vvt](),super.destroy(e)}_destroy(e,n){this[Y6]?n(e):setImmediate(()=>{n(e)})}on(e,...n){return(e==="data"||e==="readable")&&(this[Y6]=!0),super.on(e,...n)}addListener(e,...n){return this.on(e,...n)}off(e,...n){let r=super.off(e,...n);return(e==="data"||e==="readable")&&(this[Y6]=this.listenerCount("data")>0||this.listenerCount("readable")>0),r}removeListener(e,...n){return this.off(e,...n)}push(e){return this[ny]&&e!==null?(nFe(this[ny],e),this[Y6]?super.push(e):!0):super.push(e)}async text(){return z6(this,"text")}async json(){return z6(this,"json")}async blob(){return z6(this,"blob")}async bytes(){return z6(this,"bytes")}async arrayBuffer(){return z6(this,"arrayBuffer")}async formData(){throw new ZIr}get bodyUsed(){return Pvt.isDisturbed(this)}get body(){return this[u1]||(this[u1]=twr(this),this[ny]&&(this[u1].getReader(),Nvt(this[u1].locked))),this[u1]}async dump(e){let n=Number.isFinite(e?.limit)?e.limit:131072,r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))throw new ewr("signal must be an AbortSignal");return r?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((i,s)=>{this[Rvt]>n&&this.destroy(new Z2e);let o=()=>{this.destroy(r.reason??new Z2e)};r?.addEventListener("abort",o),this.on("close",function(){r?.removeEventListener("abort",o),r?.aborted?s(r.reason??new Z2e):i(null)}).on("error",nwr).on("data",function(a){n-=a.length,n<=0&&this.destroy()}).resume()})}};function rwr(t){return t[u1]&&t[u1].locked===!0||t[ny]}function iwr(t){return Pvt.isDisturbed(t)||rwr(t)}async function z6(t,e){return Nvt(!t[ny]),new Promise((n,r)=>{if(iwr(t)){let i=t._readableState;i.destroyed&&i.closeEmitted===!1?t.on("error",s=>{r(s)}).on("close",()=>{r(new TypeError("unusable"))}):r(i.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[ny]={type:e,stream:t,resolve:n,reject:r,length:0,body:[]},t.on("error",function(i){rFe(this[ny],i)}).on("close",function(){this[ny].body!==null&&rFe(this[ny],new Dvt)}),swr(t[ny])})})}function swr(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let n=e.bufferIndex,r=e.buffer.length;for(let i=n;i2&&n[0]===239&&n[1]===187&&n[2]===191?3:0;return n.utf8Slice(i,r)}function kvt(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let n=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),r=0;for(let i=0;i{p();var owr=require("node:assert"),{ResponseStatusCodeError:Lvt}=Jo(),{chunksDecode:Fvt}=iFe(),awr=128*1024;async function cwr({callback:t,body:e,contentType:n,statusCode:r,statusMessage:i,headers:s}){owr(e);let o=[],a=0;try{for await(let d of e)if(o.push(d),a+=d.length,a>awr){o=[],a=0;break}}catch{o=[],a=0}let c=`Response status code ${r}${i?`: ${i}`:""}`;if(r===204||!n||!a){queueMicrotask(()=>t(new Lvt(c,r,s)));return}let u=Error.stackTraceLimit;Error.stackTraceLimit=0;let l;try{Qvt(n)?l=JSON.parse(Fvt(o,a)):Uvt(n)&&(l=Fvt(o,a))}catch{}finally{Error.stackTraceLimit=u}queueMicrotask(()=>t(new Lvt(c,r,s,l)))}var Qvt=t=>t.length>15&&t[11]==="/"&&t[0]==="a"&&t[1]==="p"&&t[2]==="p"&&t[3]==="l"&&t[4]==="i"&&t[5]==="c"&&t[6]==="a"&&t[7]==="t"&&t[8]==="i"&&t[9]==="o"&&t[10]==="n"&&t[12]==="j"&&t[13]==="s"&&t[14]==="o"&&t[15]==="n",Uvt=t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t";Gvt.exports={getResolveErrorBodyCallback:cwr,isContentTypeApplicationJson:Qvt,isContentTypeText:Uvt}});var Hvt=re((UBs,oFe)=>{"use strict";p();var lwr=require("node:assert"),{Readable:uwr}=iFe(),{InvalidArgumentError:S$,RequestAbortedError:$vt}=Jo(),ry=to(),{getResolveErrorBodyCallback:dwr}=sFe(),{AsyncResource:pwr}=require("node:async_hooks"),Gue=class extends pwr{constructor(e,n){if(!e||typeof e!="object")throw new S$("invalid opts");let{signal:r,method:i,opaque:s,body:o,onInfo:a,responseHeaders:c,throwOnError:u,highWaterMark:l}=e;try{if(typeof n!="function")throw new S$("invalid callback");if(l&&(typeof l!="number"||l<0))throw new S$("invalid highWaterMark");if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new S$("signal must be an EventEmitter or EventTarget");if(i==="CONNECT")throw new S$("invalid method");if(a&&typeof a!="function")throw new S$("invalid onInfo callback");super("UNDICI_REQUEST")}catch(d){throw ry.isStream(o)&&ry.destroy(o.on("error",ry.nop),d),d}this.method=i,this.responseHeaders=c||null,this.opaque=s||null,this.callback=n,this.res=null,this.abort=null,this.body=o,this.trailers={},this.context=null,this.onInfo=a||null,this.throwOnError=u,this.highWaterMark=l,this.signal=r,this.reason=null,this.removeAbortListener=null,ry.isStream(o)&&o.on("error",d=>{this.onError(d)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new $vt:this.removeAbortListener=ry.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new $vt,this.res?ry.destroy(this.res.on("error",ry.nop),this.reason):this.abort&&this.abort(this.reason),this.removeAbortListener&&(this.res?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}))}onConnect(e,n){if(this.reason){e(this.reason);return}lwr(this.callback),this.abort=e,this.context=n}onHeaders(e,n,r,i){let{callback:s,opaque:o,abort:a,context:c,responseHeaders:u,highWaterMark:l}=this,d=u==="raw"?ry.parseRawHeaders(n):ry.parseHeaders(n);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:d});return}let m=u==="raw"?ry.parseHeaders(n):d,h=m["content-type"],f=m["content-length"],g=new uwr({resume:r,abort:a,contentType:h,contentLength:this.method!=="HEAD"&&f?Number(f):null,highWaterMark:l});this.removeAbortListener&&g.on("close",this.removeAbortListener),this.callback=null,this.res=g,s!==null&&(this.throwOnError&&e>=400?this.runInAsyncScope(dwr,null,{callback:s,body:g,contentType:h,statusCode:e,statusMessage:i,headers:d}):this.runInAsyncScope(s,null,null,{statusCode:e,headers:d,trailers:this.trailers,opaque:o,body:g,context:c}))}onData(e){return this.res.push(e)}onComplete(e){ry.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:n,callback:r,body:i,opaque:s}=this;r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:s})})),n&&(this.res=null,queueMicrotask(()=>{ry.destroy(n,e)})),i&&(this.body=null,ry.destroy(i,e)),this.removeAbortListener&&(n?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function Wvt(t,e){if(e===void 0)return new Promise((n,r)=>{Wvt.call(this,t,(i,s)=>i?r(i):n(s))});try{this.dispatch(t,new Gue(t,e))}catch(n){if(typeof e!="function")throw n;let r=t?.opaque;queueMicrotask(()=>e(n,{opaque:r}))}}oFe.exports=Wvt;oFe.exports.RequestHandler=Gue});var K6=re(($Bs,Vvt)=>{p();var{addAbortListener:mwr}=to(),{RequestAbortedError:hwr}=Jo(),C$=Symbol("kListener"),nC=Symbol("kSignal");function qvt(t){t.abort?t.abort(t[nC]?.reason):t.reason=t[nC]?.reason??new hwr,jvt(t)}function fwr(t,e){if(t.reason=null,t[nC]=null,t[C$]=null,!!e){if(e.aborted){qvt(t);return}t[nC]=e,t[C$]=()=>{qvt(t)},mwr(t[nC],t[C$])}}function jvt(t){t[nC]&&("removeEventListener"in t[nC]?t[nC].removeEventListener("abort",t[C$]):t[nC].removeListener("abort",t[C$]),t[nC]=null,t[C$]=null)}Vvt.exports={addSignal:fwr,removeSignal:jvt}});var Jvt=re((HBs,Kvt)=>{"use strict";p();var gwr=require("node:assert"),{finished:Awr,PassThrough:ywr}=require("node:stream"),{InvalidArgumentError:I$,InvalidReturnValueError:Ewr}=Jo(),w_=to(),{getResolveErrorBodyCallback:bwr}=sFe(),{AsyncResource:_wr}=require("node:async_hooks"),{addSignal:xwr,removeSignal:Yvt}=K6(),aFe=class extends _wr{constructor(e,n,r){if(!e||typeof e!="object")throw new I$("invalid opts");let{signal:i,method:s,opaque:o,body:a,onInfo:c,responseHeaders:u,throwOnError:l}=e;try{if(typeof r!="function")throw new I$("invalid callback");if(typeof n!="function")throw new I$("invalid factory");if(i&&typeof i.on!="function"&&typeof i.addEventListener!="function")throw new I$("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new I$("invalid method");if(c&&typeof c!="function")throw new I$("invalid onInfo callback");super("UNDICI_STREAM")}catch(d){throw w_.isStream(a)&&w_.destroy(a.on("error",w_.nop),d),d}this.responseHeaders=u||null,this.opaque=o||null,this.factory=n,this.callback=r,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=a,this.onInfo=c||null,this.throwOnError=l||!1,w_.isStream(a)&&a.on("error",d=>{this.onError(d)}),xwr(this,i)}onConnect(e,n){if(this.reason){e(this.reason);return}gwr(this.callback),this.abort=e,this.context=n}onHeaders(e,n,r,i){let{factory:s,opaque:o,context:a,callback:c,responseHeaders:u}=this,l=u==="raw"?w_.parseRawHeaders(n):w_.parseHeaders(n);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:l});return}this.factory=null;let d;if(this.throwOnError&&e>=400){let f=(u==="raw"?w_.parseHeaders(n):l)["content-type"];d=new ywr,this.callback=null,this.runInAsyncScope(bwr,null,{callback:c,body:d,contentType:f,statusCode:e,statusMessage:i,headers:l})}else{if(s===null)return;if(d=this.runInAsyncScope(s,null,{statusCode:e,headers:l,opaque:o,context:a}),!d||typeof d.write!="function"||typeof d.end!="function"||typeof d.on!="function")throw new Ewr("expected Writable");Awr(d,{readable:!1},h=>{let{callback:f,res:g,opaque:A,trailers:y,abort:E}=this;this.res=null,(h||!g.readable)&&w_.destroy(g,h),this.callback=null,this.runInAsyncScope(f,null,h||null,{opaque:A,trailers:y}),h&&E()})}return d.on("drain",r),this.res=d,(d.writableNeedDrain!==void 0?d.writableNeedDrain:d._writableState?.needDrain)!==!0}onData(e){let{res:n}=this;return n?n.write(e):!0}onComplete(e){let{res:n}=this;Yvt(this),n&&(this.trailers=w_.parseHeaders(e),n.end())}onError(e){let{res:n,callback:r,opaque:i,body:s}=this;Yvt(this),this.factory=null,n?(this.res=null,w_.destroy(n,e)):r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:i})})),s&&(this.body=null,w_.destroy(s,e))}};function zvt(t,e,n){if(n===void 0)return new Promise((r,i)=>{zvt.call(this,t,e,(s,o)=>s?i(s):r(o))});try{this.dispatch(t,new aFe(t,e,n))}catch(r){if(typeof n!="function")throw r;let i=t?.opaque;queueMicrotask(()=>n(r,{opaque:i}))}}Kvt.exports=zvt});var tRt=re((jBs,eRt)=>{"use strict";p();var{Readable:Zvt,Duplex:Swr,PassThrough:Cwr}=require("node:stream"),{InvalidArgumentError:J6,InvalidReturnValueError:Iwr,RequestAbortedError:cFe}=Jo(),a0=to(),{AsyncResource:wwr}=require("node:async_hooks"),{addSignal:Twr,removeSignal:vwr}=K6(),Xvt=require("node:assert"),w$=Symbol("resume"),lFe=class extends Zvt{constructor(){super({autoDestroy:!0}),this[w$]=null}_read(){let{[w$]:e}=this;e&&(this[w$]=null,e())}_destroy(e,n){this._read(),n(e)}},uFe=class extends Zvt{constructor(e){super({autoDestroy:!0}),this[w$]=e}_read(){this[w$]()}_destroy(e,n){!e&&!this._readableState.endEmitted&&(e=new cFe),n(e)}},dFe=class extends wwr{constructor(e,n){if(!e||typeof e!="object")throw new J6("invalid opts");if(typeof n!="function")throw new J6("invalid handler");let{signal:r,method:i,opaque:s,onInfo:o,responseHeaders:a}=e;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new J6("signal must be an EventEmitter or EventTarget");if(i==="CONNECT")throw new J6("invalid method");if(o&&typeof o!="function")throw new J6("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=a||null,this.handler=n,this.abort=null,this.context=null,this.onInfo=o||null,this.req=new lFe().on("error",a0.nop),this.ret=new Swr({readableObjectMode:e.objectMode,autoDestroy:!0,read:()=>{let{body:c}=this;c?.resume&&c.resume()},write:(c,u,l)=>{let{req:d}=this;d.push(c,u)||d._readableState.destroyed?l():d[w$]=l},destroy:(c,u)=>{let{body:l,req:d,res:m,ret:h,abort:f}=this;!c&&!h._readableState.endEmitted&&(c=new cFe),f&&c&&f(),a0.destroy(l,c),a0.destroy(d,c),a0.destroy(m,c),vwr(this),u(c)}}).on("prefinish",()=>{let{req:c}=this;c.push(null)}),this.res=null,Twr(this,r)}onConnect(e,n){let{ret:r,res:i}=this;if(this.reason){e(this.reason);return}Xvt(!i,"pipeline cannot be retried"),Xvt(!r.destroyed),this.abort=e,this.context=n}onHeaders(e,n,r){let{opaque:i,handler:s,context:o}=this;if(e<200){if(this.onInfo){let c=this.responseHeaders==="raw"?a0.parseRawHeaders(n):a0.parseHeaders(n);this.onInfo({statusCode:e,headers:c})}return}this.res=new uFe(r);let a;try{this.handler=null;let c=this.responseHeaders==="raw"?a0.parseRawHeaders(n):a0.parseHeaders(n);a=this.runInAsyncScope(s,null,{statusCode:e,headers:c,opaque:i,body:this.res,context:o})}catch(c){throw this.res.on("error",a0.nop),c}if(!a||typeof a.on!="function")throw new Iwr("expected Readable");a.on("data",c=>{let{ret:u,body:l}=this;!u.push(c)&&l.pause&&l.pause()}).on("error",c=>{let{ret:u}=this;a0.destroy(u,c)}).on("end",()=>{let{ret:c}=this;c.push(null)}).on("close",()=>{let{ret:c}=this;c._readableState.ended||a0.destroy(c,new cFe)}),this.body=a}onData(e){let{res:n}=this;return n.push(e)}onComplete(e){let{res:n}=this;n.push(null)}onError(e){let{ret:n}=this;this.handler=null,a0.destroy(n,e)}};function Rwr(t,e){try{let n=new dFe(t,e);return this.dispatch({...t,body:n.req},n),n.ret}catch(n){return new Cwr().destroy(n)}}eRt.exports=Rwr});var aRt=re((YBs,oRt)=>{"use strict";p();var{InvalidArgumentError:pFe,SocketError:kwr}=Jo(),{AsyncResource:Bwr}=require("node:async_hooks"),nRt=to(),{addSignal:Nwr,removeSignal:rRt}=K6(),iRt=require("node:assert"),mFe=class extends Bwr{constructor(e,n){if(!e||typeof e!="object")throw new pFe("invalid opts");if(typeof n!="function")throw new pFe("invalid callback");let{signal:r,opaque:i,responseHeaders:s}=e;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new pFe("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=i||null,this.callback=n,this.abort=null,this.context=null,Nwr(this,r)}onConnect(e,n){if(this.reason){e(this.reason);return}iRt(this.callback),this.abort=e,this.context=null}onHeaders(){throw new kwr("bad upgrade",null)}onUpgrade(e,n,r){iRt(e===101);let{callback:i,opaque:s,context:o}=this;rRt(this),this.callback=null;let a=this.responseHeaders==="raw"?nRt.parseRawHeaders(n):nRt.parseHeaders(n);this.runInAsyncScope(i,null,null,{headers:a,socket:r,opaque:s,context:o})}onError(e){let{callback:n,opaque:r}=this;rRt(this),n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:r})}))}};function sRt(t,e){if(e===void 0)return new Promise((n,r)=>{sRt.call(this,t,(i,s)=>i?r(i):n(s))});try{let n=new mFe(t,e);this.dispatch({...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"},n)}catch(n){if(typeof e!="function")throw n;let r=t?.opaque;queueMicrotask(()=>e(n,{opaque:r}))}}oRt.exports=sRt});var pRt=re((KBs,dRt)=>{"use strict";p();var Dwr=require("node:assert"),{AsyncResource:Pwr}=require("node:async_hooks"),{InvalidArgumentError:hFe,SocketError:Mwr}=Jo(),cRt=to(),{addSignal:Owr,removeSignal:lRt}=K6(),fFe=class extends Pwr{constructor(e,n){if(!e||typeof e!="object")throw new hFe("invalid opts");if(typeof n!="function")throw new hFe("invalid callback");let{signal:r,opaque:i,responseHeaders:s}=e;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new hFe("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=i||null,this.responseHeaders=s||null,this.callback=n,this.abort=null,Owr(this,r)}onConnect(e,n){if(this.reason){e(this.reason);return}Dwr(this.callback),this.abort=e,this.context=n}onHeaders(){throw new Mwr("bad connect",null)}onUpgrade(e,n,r){let{callback:i,opaque:s,context:o}=this;lRt(this),this.callback=null;let a=n;a!=null&&(a=this.responseHeaders==="raw"?cRt.parseRawHeaders(n):cRt.parseHeaders(n)),this.runInAsyncScope(i,null,null,{statusCode:e,headers:a,socket:r,opaque:s,context:o})}onError(e){let{callback:n,opaque:r}=this;lRt(this),n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:r})}))}};function uRt(t,e){if(e===void 0)return new Promise((n,r)=>{uRt.call(this,t,(i,s)=>i?r(i):n(s))});try{let n=new fFe(t,e);this.dispatch({...t,method:"CONNECT"},n)}catch(n){if(typeof e!="function")throw n;let r=t?.opaque;queueMicrotask(()=>e(n,{opaque:r}))}}dRt.exports=uRt});var mRt=re((XBs,T$)=>{"use strict";p();T$.exports.request=Hvt();T$.exports.stream=Jvt();T$.exports.pipeline=tRt();T$.exports.upgrade=aRt();T$.exports.connect=pRt()});var AFe=re((eNs,fRt)=>{"use strict";p();var{UndiciError:Lwr}=Jo(),hRt=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),gFe=class t extends Lwr{constructor(e){super(e),Error.captureStackTrace(this,t),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[hRt]===!0}[hRt]=!0};fRt.exports={MockNotMatchedError:gFe}});var v$=re((nNs,gRt)=>{"use strict";p();gRt.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}});var X6=re((iNs,TRt)=>{"use strict";p();var{MockNotMatchedError:WM}=AFe(),{kDispatches:$ue,kMockAgent:Fwr,kOriginalDispatch:Qwr,kOrigin:Uwr,kGetNetConnect:Gwr}=v$(),{buildURL:$wr}=to(),{STATUS_CODES:Wwr}=require("node:http"),{types:{isPromise:Hwr}}=require("node:util");function MT(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}function yRt(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e.toLocaleLowerCase(),n]))}function ERt(t,e){if(Array.isArray(t)){for(let n=0;n"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[n,r]of Object.entries(t.headers)){let i=ERt(e,n);if(!MT(r,i))return!1}return!0}function ARt(t){if(typeof t!="string")return t;let e=t.split("?");if(e.length!==2)return t;let n=new URLSearchParams(e.pop());return n.sort(),[...e,n.toString()].join("?")}function qwr(t,{path:e,method:n,body:r,headers:i}){let s=MT(t.path,e),o=MT(t.method,n),a=typeof t.body<"u"?MT(t.body,r):!0,c=bRt(t,i);return s&&o&&a&&c}function _Rt(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}function xRt(t,e){let n=e.query?$wr(e.path,e.query):e.path,r=typeof n=="string"?ARt(n):n,i=t.filter(({consumed:s})=>!s).filter(({path:s})=>MT(ARt(s),r));if(i.length===0)throw new WM(`Mock dispatch not matched for path '${r}'`);if(i=i.filter(({method:s})=>MT(s,e.method)),i.length===0)throw new WM(`Mock dispatch not matched for method '${e.method}' on path '${r}'`);if(i=i.filter(({body:s})=>typeof s<"u"?MT(s,e.body):!0),i.length===0)throw new WM(`Mock dispatch not matched for body '${e.body}' on path '${r}'`);if(i=i.filter(s=>bRt(s,e.headers)),i.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new WM(`Mock dispatch not matched for headers '${s}' on path '${r}'`)}return i[0]}function jwr(t,e,n){let r={timesInvoked:0,times:1,persist:!1,consumed:!1},i=typeof n=="function"?{callback:n}:{...n},s={...r,...e,pending:!0,data:{error:null,...i}};return t.push(s),s}function yFe(t,e){let n=t.findIndex(r=>r.consumed?qwr(r,e):!1);n!==-1&&t.splice(n,1)}function SRt(t){let{path:e,method:n,body:r,headers:i,query:s}=t;return{path:e,method:n,body:r,headers:i,query:s}}function EFe(t){let e=Object.keys(t),n=[];for(let r=0;r=m,r.pending=d0?setTimeout(()=>{h(this[$ue])},u):h(this[$ue]);function h(g,A=s){let y=Array.isArray(t.headers)?bFe(t.headers):t.headers,E=typeof A=="function"?A({...t,headers:y}):A;if(Hwr(E)){E.then(I=>h(g,I));return}let _=_Rt(E),S=EFe(o),C=EFe(a);e.onConnect?.(I=>e.onError(I),null),e.onHeaders?.(i,S,f,CRt(i)),e.onData?.(Buffer.from(_)),e.onComplete?.(C),yFe(g,n)}function f(){}return!0}function Ywr(){let t=this[Fwr],e=this[Uwr],n=this[Qwr];return function(i,s){if(t.isMockActive)try{IRt.call(this,i,s)}catch(o){if(o instanceof WM){let a=t[Gwr]();if(a===!1)throw new WM(`${o.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(wRt(a,e))n.call(this,i,s);else throw new WM(`${o.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)`)}else throw o}else n.call(this,i,s)}}function wRt(t,e){let n=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(r=>MT(r,n.host)))}function zwr(t){if(t){let{agent:e,...n}=t;return n}}TRt.exports={getResponseData:_Rt,getMockDispatch:xRt,addMockDispatch:jwr,deleteMockDispatch:yFe,buildKey:SRt,generateKeyValues:EFe,matchValue:MT,getResponse:Vwr,getStatusText:CRt,mockDispatch:IRt,buildMockDispatch:Ywr,checkNetConnect:wRt,buildMockOptions:zwr,getHeaderByName:ERt,buildHeadersFromArray:bFe}});var TFe=re((oNs,wFe)=>{"use strict";p();var{getResponseData:Kwr,buildKey:Jwr,addMockDispatch:_Fe}=X6(),{kDispatches:Wue,kDispatchKey:Hue,kDefaultHeaders:xFe,kDefaultTrailers:SFe,kContentLength:CFe,kMockDispatch:que}=v$(),{InvalidArgumentError:rC}=Jo(),{buildURL:Xwr}=to(),R$=class{constructor(e){this[que]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new rC("waitInMs must be a valid integer > 0");return this[que].delay=e,this}persist(){return this[que].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new rC("repeatTimes must be a valid integer > 0");return this[que].times=e,this}},IFe=class{constructor(e,n){if(typeof e!="object")throw new rC("opts must be an object");if(typeof e.path>"u")throw new rC("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=Xwr(e.path,e.query);else{let r=new URL(e.path,"data://");e.path=r.pathname+r.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[Hue]=Jwr(e),this[Wue]=n,this[xFe]={},this[SFe]={},this[CFe]=!1}createMockScopeDispatchData({statusCode:e,data:n,responseOptions:r}){let i=Kwr(n),s=this[CFe]?{"content-length":i.length}:{},o={...this[xFe],...s,...r.headers},a={...this[SFe],...r.trailers};return{statusCode:e,data:n,headers:o,trailers:a}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new rC("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new rC("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a=>{let c=e(a);if(typeof c!="object"||c===null)throw new rC("reply options callback must return an object");let u={data:"",responseOptions:{},...c};return this.validateReplyParameters(u),{...this.createMockScopeDispatchData(u)}},o=_Fe(this[Wue],this[Hue],s);return new R$(o)}let n={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(n);let r=this.createMockScopeDispatchData(n),i=_Fe(this[Wue],this[Hue],r);return new R$(i)}replyWithError(e){if(typeof e>"u")throw new rC("error must be defined");let n=_Fe(this[Wue],this[Hue],{error:e});return new R$(n)}defaultReplyHeaders(e){if(typeof e>"u")throw new rC("headers must be defined");return this[xFe]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new rC("trailers must be defined");return this[SFe]=e,this}replyContentLength(){return this[CFe]=!0,this}};wFe.exports.MockInterceptor=IFe;wFe.exports.MockScope=R$});var kFe=re((cNs,PRt)=>{"use strict";p();var{promisify:Zwr}=require("node:util"),eTr=y$(),{buildMockDispatch:tTr}=X6(),{kDispatches:vRt,kMockAgent:RRt,kClose:kRt,kOriginalClose:BRt,kOrigin:NRt,kOriginalDispatch:nTr,kConnected:vFe}=v$(),{MockInterceptor:rTr}=TFe(),DRt=bl(),{InvalidArgumentError:iTr}=Jo(),RFe=class extends eTr{constructor(e,n){if(super(e,n),!n||!n.agent||typeof n.agent.dispatch!="function")throw new iTr("Argument opts.agent must implement Agent");this[RRt]=n.agent,this[NRt]=e,this[vRt]=[],this[vFe]=1,this[nTr]=this.dispatch,this[BRt]=this.close.bind(this),this.dispatch=tTr.call(this),this.close=this[kRt]}get[DRt.kConnected](){return this[vFe]}intercept(e){return new rTr(e,this[vRt])}async[kRt](){await Zwr(this[BRt])(),this[vFe]=0,this[RRt][DRt.kClients].delete(this[NRt])}};PRt.exports=RFe});var DFe=re((uNs,GRt)=>{"use strict";p();var{promisify:sTr}=require("node:util"),oTr=E$(),{buildMockDispatch:aTr}=X6(),{kDispatches:MRt,kMockAgent:ORt,kClose:LRt,kOriginalClose:FRt,kOrigin:QRt,kOriginalDispatch:cTr,kConnected:BFe}=v$(),{MockInterceptor:lTr}=TFe(),URt=bl(),{InvalidArgumentError:uTr}=Jo(),NFe=class extends oTr{constructor(e,n){if(super(e,n),!n||!n.agent||typeof n.agent.dispatch!="function")throw new uTr("Argument opts.agent must implement Agent");this[ORt]=n.agent,this[QRt]=e,this[MRt]=[],this[BFe]=1,this[cTr]=this.dispatch,this[FRt]=this.close.bind(this),this.dispatch=aTr.call(this),this.close=this[LRt]}get[URt.kConnected](){return this[BFe]}intercept(e){return new lTr(e,this[MRt])}async[LRt](){await sTr(this[FRt])(),this[BFe]=0,this[ORt][URt.kClients].delete(this[QRt])}};GRt.exports=NFe});var WRt=re((mNs,$Rt)=>{"use strict";p();var dTr={pronoun:"it",is:"is",was:"was",this:"this"},pTr={pronoun:"they",is:"are",was:"were",this:"these"};$Rt.exports=class{constructor(e,n){this.singular=e,this.plural=n}pluralize(e){let n=e===1,r=n?dTr:pTr,i=n?this.singular:this.plural;return{...r,count:e,noun:i}}}});var qRt=re((gNs,HRt)=>{"use strict";p();var{Transform:mTr}=require("node:stream"),{Console:hTr}=require("node:console"),fTr=process.versions.icu?"\u2705":"Y ",gTr=process.versions.icu?"\u274C":"N ";HRt.exports=class{constructor({disableColors:e}={}){this.transform=new mTr({transform(n,r,i){i(null,n)}}),this.logger=new hTr({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let n=e.map(({method:r,path:i,data:{statusCode:s},persist:o,times:a,timesInvoked:c,origin:u})=>({Method:r,Origin:u,Path:i,"Status code":s,Persistent:o?fTr:gTr,Invocations:c,Remaining:o?1/0:a-c}));return this.logger.table(n),this.transform.read().toString()}}});var zRt=re((yNs,YRt)=>{"use strict";p();var{kClients:HM}=bl(),ATr=b$(),{kAgent:PFe,kMockAgentSet:jue,kMockAgentGet:jRt,kDispatches:MFe,kIsMockActive:Vue,kNetConnect:qM,kGetNetConnect:yTr,kOptions:Yue,kFactory:zue}=v$(),ETr=kFe(),bTr=DFe(),{matchValue:_Tr,buildMockOptions:xTr}=X6(),{InvalidArgumentError:VRt,UndiciError:STr}=Jo(),CTr=_6(),ITr=WRt(),wTr=qRt(),OFe=class extends CTr{constructor(e){if(super(e),this[qM]=!0,this[Vue]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new VRt("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new ATr(e);this[PFe]=n,this[HM]=n[HM],this[Yue]=xTr(e)}get(e){let n=this[jRt](e);return n||(n=this[zue](e),this[jue](e,n)),n}dispatch(e,n){return this.get(e.origin),this[PFe].dispatch(e,n)}async close(){await this[PFe].close(),this[HM].clear()}deactivate(){this[Vue]=!1}activate(){this[Vue]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[qM])?this[qM].push(e):this[qM]=[e];else if(typeof e>"u")this[qM]=!0;else throw new VRt("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[qM]=!1}get isMockActive(){return this[Vue]}[jue](e,n){this[HM].set(e,n)}[zue](e){let n=Object.assign({agent:this},this[Yue]);return this[Yue]&&this[Yue].connections===1?new ETr(e,n):new bTr(e,n)}[jRt](e){let n=this[HM].get(e);if(n)return n;if(typeof e!="string"){let r=this[zue]("http://localhost:9999");return this[jue](e,r),r}for(let[r,i]of Array.from(this[HM]))if(i&&typeof r!="string"&&_Tr(r,e)){let s=this[zue](e);return this[jue](e,s),s[MFe]=i[MFe],s}}[yTr](){return this[qM]}pendingInterceptors(){let e=this[HM];return Array.from(e.entries()).flatMap(([n,r])=>r[MFe].map(i=>({...i,origin:n}))).filter(({pending:n})=>n)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new wTr}={}){let n=this.pendingInterceptors();if(n.length===0)return;let r=new ITr("interceptor","interceptors").pluralize(n.length);throw new STr(` ${r.count} ${r.noun} ${r.is} pending: ${e.format(n)} -`.trim())}};Zft.exports=fDe});var aie=ee((sJs,sgt)=>{"use strict";p();var tgt=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:F7n}=Do(),Q7n=JQ();rgt()===void 0&&ngt(new Q7n);function ngt(t){if(!t||typeof t.dispatch!="function")throw new F7n("Argument agent must implement Agent");Object.defineProperty(globalThis,tgt,{value:t,writable:!0,enumerable:!1,configurable:!1})}function rgt(){return globalThis[tgt]}sgt.exports={setGlobalDispatcher:ngt,getGlobalDispatcher:rgt}});var cie=ee((aJs,igt)=>{"use strict";p();igt.exports=class{#e;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}});var agt=ee((lJs,ogt)=>{"use strict";p();var U7n=Use();ogt.exports=t=>{let e=t?.maxRedirections;return n=>function(s,i){let{maxRedirections:o=e,...a}=s;if(!o)return n(s,i);let c=new U7n(n,o,s,i);return n(a,c)}}});var lgt=ee((dJs,cgt)=>{"use strict";p();var $7n=Jse();cgt.exports=t=>e=>function(r,s){return e(r,new $7n({...r,retryOptions:{...t,...r.retryOptions}},{handler:s,dispatch:e}))}});var dgt=ee((hJs,ugt)=>{"use strict";p();var G7n=Wi(),{InvalidArgumentError:W7n,RequestAbortedError:q7n}=Do(),H7n=cie(),gDe=class extends H7n{#e=1024*1024;#t=null;#n=!1;#r=!1;#i=0;#s=null;#c=null;constructor({maxSize:e},n){if(super(n),e!=null&&(!Number.isFinite(e)||e<1))throw new W7n("maxSize must be a number greater than 0");this.#e=e??this.#e,this.#c=n}onConnect(e){this.#t=e,this.#c.onConnect(this.#o.bind(this))}#o(e){this.#r=!0,this.#s=e}onHeaders(e,n,r,s){let o=G7n.parseHeaders(n)["content-length"];if(o!=null&&o>this.#e)throw new q7n(`Response size (${o}) larger than maxSize (${this.#e})`);return this.#r?!0:this.#c.onHeaders(e,n,r,s)}onError(e){this.#n||(e=this.#s??e,this.#c.onError(e))}onData(e){return this.#i=this.#i+e.length,this.#i>=this.#e&&(this.#n=!0,this.#r?this.#c.onError(this.#s):this.#c.onComplete([])),!0}onComplete(e){if(!this.#n){if(this.#r){this.#c.onError(this.reason);return}this.#c.onComplete(e)}}};function V7n({maxSize:t}={maxSize:1024*1024}){return e=>function(r,s){let{dumpMaxSize:i=t}=r,o=new gDe({maxSize:i},s);return e(r,o)}}ugt.exports=V7n});var mgt=ee((fJs,hgt)=>{"use strict";p();var{isIP:j7n}=require("node:net"),{lookup:Y7n}=require("node:dns"),K7n=cie(),{InvalidArgumentError:aU,InformationalError:z7n}=Do(),pgt=Math.pow(2,31)-1,ADe=class{#e=0;#t=0;#n=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#i}get full(){return this.#n.size===this.#t}runLookup(e,n,r){let s=this.#n.get(e.hostname);if(s==null&&this.full){r(null,e.origin);return}let i={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...n.dns,maxTTL:this.#e,maxItems:this.#t};if(s==null)this.lookup(e,i,(o,a)=>{if(o||a==null||a.length===0){r(o??new z7n("No DNS entries found"));return}this.setRecords(e,a);let c=this.#n.get(e.hostname),u=this.pick(e,c,i.affinity),l;typeof u.port=="number"?l=`:${u.port}`:e.port!==""?l=`:${e.port}`:l="",r(null,`${e.protocol}//${u.family===6?`[${u.address}]`:u.address}${l}`)});else{let o=this.pick(e,s,i.affinity);if(o==null){this.#n.delete(e.hostname),this.runLookup(e,n,r);return}let a;typeof o.port=="number"?a=`:${o.port}`:e.port!==""?a=`:${e.port}`:a="",r(null,`${e.protocol}//${o.family===6?`[${o.address}]`:o.address}${a}`)}}#r(e,n,r){Y7n(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(s,i)=>{if(s)return r(s);let o=new Map;for(let a of i)o.set(`${a.address}:${a.family}`,a);r(null,o.values())})}#i(e,n,r){let s=null,{records:i,offset:o}=n,a;if(this.dualStack?(r==null&&(o==null||o===pgt?(n.offset=0,r=4):(n.offset++,r=(n.offset&1)===1?6:4)),i[r]!=null&&i[r].ips.length>0?a=i[r]:a=i[r===4?6:4]):a=i[r],a==null||a.ips.length===0)return s;a.offset==null||a.offset===pgt?a.offset=0:a.offset++;let c=a.offset%a.ips.length;return s=a.ips[c]??null,s==null?s:Date.now()-s.timestamp>s.ttl?(a.ips.splice(c,1),this.pick(e,n,r)):s}setRecords(e,n){let r=Date.now(),s={records:{4:null,6:null}};for(let i of n){i.timestamp=r,typeof i.ttl=="number"?i.ttl=Math.min(i.ttl,this.#e):i.ttl=this.#e;let o=s.records[i.family]??{ips:[]};o.ips.push(i),s.records[i.family]=o}this.#n.set(e.hostname,s)}getHandler(e,n){return new yDe(this,e,n)}},yDe=class extends K7n{#e=null;#t=null;#n=null;#r=null;#i=null;constructor(e,{origin:n,handler:r,dispatch:s},i){super(r),this.#i=n,this.#r=r,this.#t={...i},this.#e=e,this.#n=s}onError(e){switch(e.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(n,r)=>{if(n)return this.#r.onError(n);let s={...this.#t,origin:r};this.#n(s,this)});return}this.#r.onError(e);return}case"ENOTFOUND":this.#e.deleteRecord(this.#i);default:this.#r.onError(e);break}}};hgt.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new aU("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new aU("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new aU("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new aU("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new aU("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new aU("Invalid pick. Must be a function");let e=t?.dualStack??!0,n;e?n=t?.affinity??null:n=t?.affinity??4;let r={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:n,maxItems:t?.maxItems??1/0},s=new ADe(r);return i=>function(a,c){let u=a.origin.constructor===URL?a.origin:new URL(a.origin);return j7n(u.hostname)!==0?i(a,c):(s.runLookup(u,a,(l,d)=>{if(l)return c.onError(l);let h=null;h={...a,servername:u.hostname,origin:d,headers:{host:u.hostname,...a.headers}},i(h,s.getHandler({origin:u,dispatch:i,handler:c},a))}),!0)}}});var H1=ee((AJs,_gt)=>{"use strict";p();var{kConstruct:J7n}=Nc(),{kEnumerableProperty:cU}=Wi(),{iteratorMixin:X7n,isValidHeaderName:eY,isValidHeaderValue:ggt}=Bg(),{webidl:So}=Cp(),EDe=require("node:assert"),lie=require("node:util"),wu=Symbol("headers map"),Lg=Symbol("headers map sorted");function fgt(t){return t===10||t===13||t===9||t===32}function Agt(t){let e=0,n=t.length;for(;n>e&&fgt(t.charCodeAt(n-1));)--n;for(;n>e&&fgt(t.charCodeAt(e));)++e;return e===0&&n===t.length?t:t.substring(e,n)}function ygt(t,e){if(Array.isArray(e))for(let n=0;n>","record"]})}function bDe(t,e,n){if(n=Agt(n),eY(e)){if(!ggt(n))throw So.errors.invalidArgument({prefix:"Headers.append",value:n,type:"header value"})}else throw So.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(bgt(t)==="immutable")throw new TypeError("immutable");return _De(t).append(e,n,!1)}function Egt(t,e){return t[0]>1),n[u][0]<=l[0]?c=u+1:a=u;if(i!==u){for(o=i;o>c;)n[o]=n[--o];n[c]=l}}if(!r.next().done)throw new TypeError("Unreachable");return n}else{let r=0;for(let{0:s,1:{value:i}}of this[wu])n[r++]=[s,i],EDe(i!==null);return n.sort(Egt)}}},Ub=class t{#e;#t;constructor(e=void 0){So.util.markAsUncloneable(this),e!==J7n&&(this.#t=new uie,this.#e="none",e!==void 0&&(e=So.converters.HeadersInit(e,"Headers contructor","init"),ygt(this,e)))}append(e,n){So.brandCheck(this,t),So.argumentLengthCheck(arguments,2,"Headers.append");let r="Headers.append";return e=So.converters.ByteString(e,r,"name"),n=So.converters.ByteString(n,r,"value"),bDe(this,e,n)}delete(e){if(So.brandCheck(this,t),So.argumentLengthCheck(arguments,1,"Headers.delete"),e=So.converters.ByteString(e,"Headers.delete","name"),!eY(e))throw So.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){So.brandCheck(this,t),So.argumentLengthCheck(arguments,1,"Headers.get");let n="Headers.get";if(e=So.converters.ByteString(e,n,"name"),!eY(e))throw So.errors.invalidArgument({prefix:n,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){So.brandCheck(this,t),So.argumentLengthCheck(arguments,1,"Headers.has");let n="Headers.has";if(e=So.converters.ByteString(e,n,"name"),!eY(e))throw So.errors.invalidArgument({prefix:n,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,n){So.brandCheck(this,t),So.argumentLengthCheck(arguments,2,"Headers.set");let r="Headers.set";if(e=So.converters.ByteString(e,r,"name"),n=So.converters.ByteString(n,r,"value"),n=Agt(n),eY(e)){if(!ggt(n))throw So.errors.invalidArgument({prefix:r,value:n,type:"header value"})}else throw So.errors.invalidArgument({prefix:r,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,n,!1)}getSetCookie(){So.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[Lg](){if(this.#t[Lg])return this.#t[Lg];let e=[],n=this.#t.toSortedArray(),r=this.#t.cookies;if(r===null||r.length===1)return this.#t[Lg]=n;for(let s=0;s>"](t,e,n,r.bind(t)):So.converters["record"](t,e,n)}throw So.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};_gt.exports={fill:ygt,compareHeaderName:Egt,Headers:Ub,HeadersList:uie,getHeadersGuard:bgt,setHeadersGuard:Z7n,setHeadersList:eJn,getHeadersList:_De}});var nY=ee((EJs,Bgt)=>{"use strict";p();var{Headers:Tgt,HeadersList:Sgt,fill:tJn,getHeadersGuard:nJn,setHeadersGuard:vgt,setHeadersList:Rgt}=H1(),{extractBody:Cgt,cloneBody:rJn,mixinBody:sJn,hasFinalizationRegistry:kgt,streamRegistry:Ngt,bodyUnusable:iJn}=GQ(),SDe=Wi(),Igt=require("node:util"),{kEnumerableProperty:Fg}=SDe,{isValidReasonPhrase:oJn,isCancelled:aJn,isAborted:cJn,isBlobLike:lJn,serializeJavascriptValueToJSONString:uJn,isErrorLike:dJn,isomorphicEncode:pJn,environmentSettingsObject:hJn}=Bg(),{redirectStatusSet:mJn,nullBodyStatus:fJn}=xj(),{kState:Bc,kHeaders:mx}=yv(),{webidl:yi}=Cp(),{FormData:gJn}=Nj(),{URLSerializer:xgt}=yf(),{kConstruct:pie}=Nc(),CDe=require("node:assert"),{types:AJn}=require("node:util"),yJn=new TextEncoder("utf-8"),V1=class t{static error(){return tY(hie(),"immutable")}static json(e,n={}){yi.argumentLengthCheck(arguments,1,"Response.json"),n!==null&&(n=yi.converters.ResponseInit(n));let r=yJn.encode(uJn(e)),s=Cgt(r),i=tY(lU({}),"response");return wgt(i,n,{body:s[0],type:"application/json"}),i}static redirect(e,n=302){yi.argumentLengthCheck(arguments,1,"Response.redirect"),e=yi.converters.USVString(e),n=yi.converters["unsigned short"](n);let r;try{r=new URL(e,hJn.settingsObject.baseUrl)}catch(o){throw new TypeError(`Failed to parse URL from ${e}`,{cause:o})}if(!mJn.has(n))throw new RangeError(`Invalid status code ${n}`);let s=tY(lU({}),"immutable");s[Bc].status=n;let i=pJn(xgt(r));return s[Bc].headersList.append("location",i,!0),s}constructor(e=null,n={}){if(yi.util.markAsUncloneable(this),e===pie)return;e!==null&&(e=yi.converters.BodyInit(e)),n=yi.converters.ResponseInit(n),this[Bc]=lU({}),this[mx]=new Tgt(pie),vgt(this[mx],"response"),Rgt(this[mx],this[Bc].headersList);let r=null;if(e!=null){let[s,i]=Cgt(e);r={body:s,type:i}}wgt(this,n,r)}get type(){return yi.brandCheck(this,t),this[Bc].type}get url(){yi.brandCheck(this,t);let e=this[Bc].urlList,n=e[e.length-1]??null;return n===null?"":xgt(n,!0)}get redirected(){return yi.brandCheck(this,t),this[Bc].urlList.length>1}get status(){return yi.brandCheck(this,t),this[Bc].status}get ok(){return yi.brandCheck(this,t),this[Bc].status>=200&&this[Bc].status<=299}get statusText(){return yi.brandCheck(this,t),this[Bc].statusText}get headers(){return yi.brandCheck(this,t),this[mx]}get body(){return yi.brandCheck(this,t),this[Bc].body?this[Bc].body.stream:null}get bodyUsed(){return yi.brandCheck(this,t),!!this[Bc].body&&SDe.isDisturbed(this[Bc].body.stream)}clone(){if(yi.brandCheck(this,t),iJn(this))throw yi.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=IDe(this[Bc]);return kgt&&this[Bc].body?.stream&&Ngt.register(this,new WeakRef(this[Bc].body.stream)),tY(e,nJn(this[mx]))}[Igt.inspect.custom](e,n){n.depth===null&&(n.depth=2),n.colors??=!0;let r={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${Igt.formatWithOptions(n,r)}`}};sJn(V1);Object.defineProperties(V1.prototype,{type:Fg,url:Fg,status:Fg,ok:Fg,redirected:Fg,statusText:Fg,headers:Fg,clone:Fg,body:Fg,bodyUsed:Fg,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(V1,{json:Fg,redirect:Fg,error:Fg});function IDe(t){if(t.internalResponse)return Dgt(IDe(t.internalResponse),t.type);let e=lU({...t,body:null});return t.body!=null&&(e.body=rJn(e,t.body)),e}function lU(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new Sgt(t?.headersList):new Sgt,urlList:t?.urlList?[...t.urlList]:[]}}function hie(t){let e=dJn(t);return lU({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}function EJn(t){return t.type==="error"&&t.status===0}function die(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(n,r){return r in e?e[r]:n[r]},set(n,r,s){return CDe(!(r in e)),n[r]=s,!0}})}function Dgt(t,e){if(e==="basic")return die(t,{type:"basic",headersList:t.headersList});if(e==="cors")return die(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return die(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return die(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});CDe(!1)}function bJn(t,e=null){return CDe(aJn(t)),cJn(t)?hie(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):hie(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}function wgt(t,e,n){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!oJn(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Bc].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Bc].statusText=e.statusText),"headers"in e&&e.headers!=null&&tJn(t[mx],e.headers),n){if(fJn.includes(t.status))throw yi.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Bc].body=n.body,n.type!=null&&!t[Bc].headersList.contains("content-type",!0)&&t[Bc].headersList.append("content-type",n.type,!0)}}function tY(t,e){let n=new V1(pie);return n[Bc]=t,n[mx]=new Tgt(pie),Rgt(n[mx],t.headersList),vgt(n[mx],e),kgt&&t.body?.stream&&Ngt.register(n,new WeakRef(t.body.stream)),n}yi.converters.ReadableStream=yi.interfaceConverter(ReadableStream);yi.converters.FormData=yi.interfaceConverter(gJn);yi.converters.URLSearchParams=yi.interfaceConverter(URLSearchParams);yi.converters.XMLHttpRequestBodyInit=function(t,e,n){return typeof t=="string"?yi.converters.USVString(t,e,n):lJn(t)?yi.converters.Blob(t,e,n,{strict:!1}):ArrayBuffer.isView(t)||AJn.isArrayBuffer(t)?yi.converters.BufferSource(t,e,n):SDe.isFormDataLike(t)?yi.converters.FormData(t,e,n,{strict:!1}):t instanceof URLSearchParams?yi.converters.URLSearchParams(t,e,n):yi.converters.DOMString(t,e,n)};yi.converters.BodyInit=function(t,e,n){return t instanceof ReadableStream?yi.converters.ReadableStream(t,e,n):t?.[Symbol.asyncIterator]?t:yi.converters.XMLHttpRequestBodyInit(t,e,n)};yi.converters.ResponseInit=yi.dictionaryConverter([{key:"status",converter:yi.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:yi.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:yi.converters.HeadersInit}]);Bgt.exports={isNetworkError:EJn,makeNetworkError:hie,makeResponse:lU,makeAppropriateNetworkError:bJn,filterResponse:Dgt,Response:V1,cloneResponse:IDe,fromInnerResponse:tY}});var Lgt=ee((_Js,Mgt)=>{"use strict";p();var{kConnected:Pgt,kSize:Ogt}=Nc(),xDe=class{constructor(e){this.value=e}deref(){return this.value[Pgt]===0&&this.value[Ogt]===0?void 0:this.value}},wDe=class{constructor(e){this.finalizer=e}register(e,n){e.on&&e.on("disconnect",()=>{e[Pgt]===0&&e[Ogt]===0&&this.finalizer(n)})}unregister(e){}};Mgt.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:xDe,FinalizationRegistry:wDe}):{WeakRef,FinalizationRegistry}}});var uU=ee((CJs,Xgt)=>{"use strict";p();var{extractBody:_Jn,mixinBody:SJn,cloneBody:CJn,bodyUnusable:Fgt}=GQ(),{Headers:jgt,fill:IJn,HeadersList:Aie,setHeadersGuard:vDe,getHeadersGuard:xJn,setHeadersList:Ygt,getHeadersList:Qgt}=H1(),{FinalizationRegistry:wJn}=Lgt()(),fie=Wi(),Ugt=require("node:util"),{isValidHTTPToken:TJn,sameOrigin:$gt,environmentSettingsObject:mie}=Bg(),{forbiddenMethodsSet:vJn,corsSafeListedMethodsSet:RJn,referrerPolicy:kJn,requestRedirect:NJn,requestMode:DJn,requestCredentials:BJn,requestCache:PJn,requestDuplex:OJn}=xj(),{kEnumerableProperty:Tu,normalizedMethodRecordsBase:MJn,normalizedMethodRecords:LJn}=fie,{kHeaders:Qg,kSignal:gie,kState:pc,kDispatcher:TDe}=yv(),{webidl:Ss}=Cp(),{URLSerializer:FJn}=yf(),{kConstruct:yie}=Nc(),QJn=require("node:assert"),{getMaxListeners:Ggt,setMaxListeners:Wgt,getEventListeners:UJn,defaultMaxListeners:qgt}=require("node:events"),$Jn=Symbol("abortController"),Kgt=new wJn(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Eie=new WeakMap;function Hgt(t){return e;function e(){let n=t.deref();if(n!==void 0){Kgt.unregister(e),this.removeEventListener("abort",e),n.abort(this.reason);let r=Eie.get(n.signal);if(r!==void 0){if(r.size!==0){for(let s of r){let i=s.deref();i!==void 0&&i.abort(this.reason)}r.clear()}Eie.delete(n.signal)}}}}var Vgt=!1,Rv=class t{constructor(e,n={}){if(Ss.util.markAsUncloneable(this),e===yie)return;let r="Request constructor";Ss.argumentLengthCheck(arguments,1,r),e=Ss.converters.RequestInfo(e,r,"input"),n=Ss.converters.RequestInit(n,r,"init");let s=null,i=null,o=mie.settingsObject.baseUrl,a=null;if(typeof e=="string"){this[TDe]=n.dispatcher;let y;try{y=new URL(e,o)}catch(b){throw new TypeError("Failed to parse URL from "+e,{cause:b})}if(y.username||y.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);s=bie({urlList:[y]}),i="cors"}else this[TDe]=n.dispatcher||e[TDe],QJn(e instanceof t),s=e[pc],a=e[gie];let c=mie.settingsObject.origin,u="client";if(s.window?.constructor?.name==="EnvironmentSettingsObject"&&$gt(s.window,c)&&(u=s.window),n.window!=null)throw new TypeError(`'window' option '${u}' must be null`);"window"in n&&(u="no-window"),s=bie({method:s.method,headersList:s.headersList,unsafeRequest:s.unsafeRequest,client:mie.settingsObject,window:u,priority:s.priority,origin:s.origin,referrer:s.referrer,referrerPolicy:s.referrerPolicy,mode:s.mode,credentials:s.credentials,cache:s.cache,redirect:s.redirect,integrity:s.integrity,keepalive:s.keepalive,reloadNavigation:s.reloadNavigation,historyNavigation:s.historyNavigation,urlList:[...s.urlList]});let l=Object.keys(n).length!==0;if(l&&(s.mode==="navigate"&&(s.mode="same-origin"),s.reloadNavigation=!1,s.historyNavigation=!1,s.origin="client",s.referrer="client",s.referrerPolicy="",s.url=s.urlList[s.urlList.length-1],s.urlList=[s.url]),n.referrer!==void 0){let y=n.referrer;if(y==="")s.referrer="no-referrer";else{let b;try{b=new URL(y,o)}catch(S){throw new TypeError(`Referrer "${y}" is not a valid URL.`,{cause:S})}b.protocol==="about:"&&b.hostname==="client"||c&&!$gt(b,mie.settingsObject.baseUrl)?s.referrer="client":s.referrer=b}}n.referrerPolicy!==void 0&&(s.referrerPolicy=n.referrerPolicy);let d;if(n.mode!==void 0?d=n.mode:d=i,d==="navigate")throw Ss.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(d!=null&&(s.mode=d),n.credentials!==void 0&&(s.credentials=n.credentials),n.cache!==void 0&&(s.cache=n.cache),s.cache==="only-if-cached"&&s.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(n.redirect!==void 0&&(s.redirect=n.redirect),n.integrity!=null&&(s.integrity=String(n.integrity)),n.keepalive!==void 0&&(s.keepalive=!!n.keepalive),n.method!==void 0){let y=n.method,b=LJn[y];if(b!==void 0)s.method=b;else{if(!TJn(y))throw new TypeError(`'${y}' is not a valid HTTP method.`);let S=y.toUpperCase();if(vJn.has(S))throw new TypeError(`'${y}' HTTP method is unsupported.`);y=MJn[S]??y,s.method=y}!Vgt&&s.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),Vgt=!0)}n.signal!==void 0&&(a=n.signal),this[pc]=s;let h=new AbortController;if(this[gie]=h.signal,a!=null){if(!a||typeof a.aborted!="boolean"||typeof a.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(a.aborted)h.abort(a.reason);else{this[$Jn]=h;let y=new WeakRef(h),b=Hgt(y);try{(typeof Ggt=="function"&&Ggt(a)===qgt||UJn(a,"abort").length>=qgt)&&Wgt(1500,a)}catch{}fie.addAbortListener(a,b),Kgt.register(h,{signal:a,abort:b},b)}}if(this[Qg]=new jgt(yie),Ygt(this[Qg],s.headersList),vDe(this[Qg],"request"),d==="no-cors"){if(!RJn.has(s.method))throw new TypeError(`'${s.method} is unsupported in no-cors mode.`);vDe(this[Qg],"request-no-cors")}if(l){let y=Qgt(this[Qg]),b=n.headers!==void 0?n.headers:new Aie(y);if(y.clear(),b instanceof Aie){for(let{name:S,value:C}of b.rawValues())y.append(S,C,!1);y.cookies=b.cookies}else IJn(this[Qg],b)}let m=e instanceof t?e[pc].body:null;if((n.body!=null||m!=null)&&(s.method==="GET"||s.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let f=null;if(n.body!=null){let[y,b]=_Jn(n.body,s.keepalive);f=y,b&&!Qgt(this[Qg]).contains("content-type",!0)&&this[Qg].append("content-type",b)}let g=f??m;if(g!=null&&g.source==null){if(f!=null&&n.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(s.mode!=="same-origin"&&s.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');s.useCORSPreflightFlag=!0}let A=g;if(f==null&&m!=null){if(Fgt(e))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let y=new TransformStream;m.stream.pipeThrough(y),A={source:m.source,length:m.length,stream:y.readable}}this[pc].body=A}get method(){return Ss.brandCheck(this,t),this[pc].method}get url(){return Ss.brandCheck(this,t),FJn(this[pc].url)}get headers(){return Ss.brandCheck(this,t),this[Qg]}get destination(){return Ss.brandCheck(this,t),this[pc].destination}get referrer(){return Ss.brandCheck(this,t),this[pc].referrer==="no-referrer"?"":this[pc].referrer==="client"?"about:client":this[pc].referrer.toString()}get referrerPolicy(){return Ss.brandCheck(this,t),this[pc].referrerPolicy}get mode(){return Ss.brandCheck(this,t),this[pc].mode}get credentials(){return this[pc].credentials}get cache(){return Ss.brandCheck(this,t),this[pc].cache}get redirect(){return Ss.brandCheck(this,t),this[pc].redirect}get integrity(){return Ss.brandCheck(this,t),this[pc].integrity}get keepalive(){return Ss.brandCheck(this,t),this[pc].keepalive}get isReloadNavigation(){return Ss.brandCheck(this,t),this[pc].reloadNavigation}get isHistoryNavigation(){return Ss.brandCheck(this,t),this[pc].historyNavigation}get signal(){return Ss.brandCheck(this,t),this[gie]}get body(){return Ss.brandCheck(this,t),this[pc].body?this[pc].body.stream:null}get bodyUsed(){return Ss.brandCheck(this,t),!!this[pc].body&&fie.isDisturbed(this[pc].body.stream)}get duplex(){return Ss.brandCheck(this,t),"half"}clone(){if(Ss.brandCheck(this,t),Fgt(this))throw new TypeError("unusable");let e=zgt(this[pc]),n=new AbortController;if(this.signal.aborted)n.abort(this.signal.reason);else{let r=Eie.get(this.signal);r===void 0&&(r=new Set,Eie.set(this.signal,r));let s=new WeakRef(n);r.add(s),fie.addAbortListener(n.signal,Hgt(s))}return Jgt(e,n.signal,xJn(this[Qg]))}[Ugt.inspect.custom](e,n){n.depth===null&&(n.depth=2),n.colors??=!0;let r={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${Ugt.formatWithOptions(n,r)}`}};SJn(Rv);function bie(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new Aie(t.headersList):new Aie}}function zgt(t){let e=bie({...t,body:null});return t.body!=null&&(e.body=CJn(e,t.body)),e}function Jgt(t,e,n){let r=new Rv(yie);return r[pc]=t,r[gie]=e,r[Qg]=new jgt(yie),Ygt(r[Qg],t.headersList),vDe(r[Qg],n),r}Object.defineProperties(Rv.prototype,{method:Tu,url:Tu,headers:Tu,redirect:Tu,clone:Tu,signal:Tu,duplex:Tu,destination:Tu,body:Tu,bodyUsed:Tu,isHistoryNavigation:Tu,isReloadNavigation:Tu,keepalive:Tu,integrity:Tu,cache:Tu,credentials:Tu,attribute:Tu,referrerPolicy:Tu,referrer:Tu,mode:Tu,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Ss.converters.Request=Ss.interfaceConverter(Rv);Ss.converters.RequestInfo=function(t,e,n){return typeof t=="string"?Ss.converters.USVString(t,e,n):t instanceof Rv?Ss.converters.Request(t,e,n):Ss.converters.USVString(t,e,n)};Ss.converters.AbortSignal=Ss.interfaceConverter(AbortSignal);Ss.converters.RequestInit=Ss.dictionaryConverter([{key:"method",converter:Ss.converters.ByteString},{key:"headers",converter:Ss.converters.HeadersInit},{key:"body",converter:Ss.nullableConverter(Ss.converters.BodyInit)},{key:"referrer",converter:Ss.converters.USVString},{key:"referrerPolicy",converter:Ss.converters.DOMString,allowedValues:kJn},{key:"mode",converter:Ss.converters.DOMString,allowedValues:DJn},{key:"credentials",converter:Ss.converters.DOMString,allowedValues:BJn},{key:"cache",converter:Ss.converters.DOMString,allowedValues:PJn},{key:"redirect",converter:Ss.converters.DOMString,allowedValues:NJn},{key:"integrity",converter:Ss.converters.DOMString},{key:"keepalive",converter:Ss.converters.boolean},{key:"signal",converter:Ss.nullableConverter(t=>Ss.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:Ss.converters.any},{key:"duplex",converter:Ss.converters.DOMString,allowedValues:OJn},{key:"dispatcher",converter:Ss.converters.any}]);Xgt.exports={Request:Rv,makeRequest:bie,fromInnerRequest:Jgt,cloneRequest:zgt}});var sY=ee((xJs,hAt)=>{"use strict";p();var{makeNetworkError:ua,makeAppropriateNetworkError:_ie,filterResponse:RDe,makeResponse:Sie,fromInnerResponse:GJn}=nY(),{HeadersList:Zgt}=H1(),{Request:WJn,cloneRequest:qJn}=uU(),kv=require("node:zlib"),{bytesMatch:HJn,makePolicyContainer:VJn,clonePolicyContainer:jJn,requestBadPort:YJn,TAOCheck:KJn,appendRequestOriginHeader:zJn,responseLocationURL:JJn,requestCurrentURL:cS,setRequestReferrerPolicyOnRedirect:XJn,tryUpgradeRequestToAPotentiallyTrustworthyURL:ZJn,createOpaqueTimingInfo:PDe,appendFetchMetadata:eXn,corsCheck:tXn,crossOriginResourcePolicyCheck:nXn,determineRequestsReferrer:rXn,coarsenedSharedCurrentTime:rY,createDeferredPromise:sXn,isBlobLike:iXn,sameOrigin:BDe,isCancelled:j1,isAborted:eAt,isErrorLike:oXn,fullyReadBody:aXn,readableStreamClose:cXn,isomorphicEncode:Cie,urlIsLocal:lXn,urlIsHttpHttpsScheme:ODe,urlHasHttpsScheme:uXn,clampAndCoarsenConnectionTimingInfo:dXn,simpleRangeHeaderValue:pXn,buildContentRange:hXn,createInflate:mXn,extractMimeType:fXn}=Bg(),{kState:sAt,kDispatcher:gXn}=yv(),Y1=require("node:assert"),{safelyExtractBody:MDe,extractBody:tAt}=GQ(),{redirectStatusSet:iAt,nullBodyStatus:oAt,safeMethodsSet:AXn,requestBodyHeader:yXn,subresourceSet:EXn}=xj(),bXn=require("node:events"),{Readable:_Xn,pipeline:SXn,finished:CXn}=require("node:stream"),{addAbortListener:IXn,isErrored:xXn,isReadable:Iie,bufferToLowerCasedHeaderName:nAt}=Wi(),{dataURLProcessor:wXn,serializeAMimeType:TXn,minimizeSupportedMimeType:vXn}=yf(),{getGlobalDispatcher:RXn}=aie(),{webidl:kXn}=Cp(),{STATUS_CODES:NXn}=require("node:http"),DXn=["GET","HEAD"],BXn=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",kDe,xie=class extends bXn{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function PXn(t){aAt(t,"fetch")}function OXn(t,e=void 0){kXn.argumentLengthCheck(arguments,1,"globalThis.fetch");let n=sXn(),r;try{r=new WJn(t,e)}catch(l){return n.reject(l),n.promise}let s=r[sAt];if(r.signal.aborted)return NDe(n,s,null,r.signal.reason),n.promise;s.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(s.serviceWorkers="none");let o=null,a=!1,c=null;return IXn(r.signal,()=>{a=!0,Y1(c!=null),c.abort(r.signal.reason);let l=o?.deref();NDe(n,s,l,r.signal.reason)}),c=lAt({request:s,processResponseEndOfBody:PXn,processResponse:l=>{if(!a){if(l.aborted){NDe(n,s,o,c.serializedAbortReason);return}if(l.type==="error"){n.reject(new TypeError("fetch failed",{cause:l.error}));return}o=new WeakRef(GJn(l,"immutable")),n.resolve(o.deref()),n=null}},dispatcher:r[gXn]}),n.promise}function aAt(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let n=t.urlList[0],r=t.timingInfo,s=t.cacheState;ODe(n)&&r!==null&&(t.timingAllowPassed||(r=PDe({startTime:r.startTime}),s=""),r.endTime=rY(),t.timingInfo=r,cAt(r,n.href,e,globalThis,s))}var cAt=performance.markResourceTiming;function NDe(t,e,n,r){if(t&&t.reject(r),e.body!=null&&Iie(e.body?.stream)&&e.body.stream.cancel(r).catch(i=>{if(i.code!=="ERR_INVALID_STATE")throw i}),n==null)return;let s=n[sAt];s.body!=null&&Iie(s.body?.stream)&&s.body.stream.cancel(r).catch(i=>{if(i.code!=="ERR_INVALID_STATE")throw i})}function lAt({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:s,processResponseConsumeBody:i,useParallelQueue:o=!1,dispatcher:a=RXn()}){Y1(a);let c=null,u=!1;t.client!=null&&(c=t.client.globalObject,u=t.client.crossOriginIsolatedCapability);let l=rY(u),d=PDe({startTime:l}),h={controller:new xie(a),request:t,timingInfo:d,processRequestBodyChunkLength:e,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:i,processResponseEndOfBody:s,taskDestination:c,crossOriginIsolatedCapability:u};return Y1(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=jJn(t.client.policyContainer):t.policyContainer=VJn()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,EXn.has(t.destination),uAt(h).catch(m=>{h.controller.terminate(m)}),h.controller}async function uAt(t,e=!1){let n=t.request,r=null;if(n.localURLsOnly&&!lXn(cS(n))&&(r=ua("local URLs only")),ZJn(n),YJn(n)==="blocked"&&(r=ua("bad port")),n.referrerPolicy===""&&(n.referrerPolicy=n.policyContainer.referrerPolicy),n.referrer!=="no-referrer"&&(n.referrer=rXn(n)),r===null&&(r=await(async()=>{let i=cS(n);return BDe(i,n.url)&&n.responseTainting==="basic"||i.protocol==="data:"||n.mode==="navigate"||n.mode==="websocket"?(n.responseTainting="basic",await rAt(t)):n.mode==="same-origin"?ua('request mode cannot be "same-origin"'):n.mode==="no-cors"?n.redirect!=="follow"?ua('redirect mode cannot be "follow" for "no-cors" request'):(n.responseTainting="opaque",await rAt(t)):ODe(cS(n))?(n.responseTainting="cors",await dAt(t)):ua("URL scheme must be a HTTP(S) scheme")})()),e)return r;r.status!==0&&!r.internalResponse&&(n.responseTainting,n.responseTainting==="basic"?r=RDe(r,"basic"):n.responseTainting==="cors"?r=RDe(r,"cors"):n.responseTainting==="opaque"?r=RDe(r,"opaque"):Y1(!1));let s=r.status===0?r:r.internalResponse;if(s.urlList.length===0&&s.urlList.push(...n.urlList),n.timingAllowFailed||(r.timingAllowPassed=!0),r.type==="opaque"&&s.status===206&&s.rangeRequested&&!n.headers.contains("range",!0)&&(r=s=ua()),r.status!==0&&(n.method==="HEAD"||n.method==="CONNECT"||oAt.includes(s.status))&&(s.body=null,t.controller.dump=!0),n.integrity){let i=a=>DDe(t,ua(a));if(n.responseTainting==="opaque"||r.body==null){i(r.error);return}let o=a=>{if(!HJn(a,n.integrity)){i("integrity mismatch");return}r.body=MDe(a)[0],DDe(t,r)};await aXn(r.body,o,i)}else DDe(t,r)}function rAt(t){if(j1(t)&&t.request.redirectCount===0)return Promise.resolve(_ie(t));let{request:e}=t,{protocol:n}=cS(e);switch(n){case"about:":return Promise.resolve(ua("about scheme is not supported"));case"blob:":{kDe||(kDe=require("node:buffer").resolveObjectURL);let r=cS(e);if(r.search.length!==0)return Promise.resolve(ua("NetworkError when attempting to fetch resource."));let s=kDe(r.toString());if(e.method!=="GET"||!iXn(s))return Promise.resolve(ua("invalid method"));let i=Sie(),o=s.size,a=Cie(`${o}`),c=s.type;if(e.headersList.contains("range",!0)){i.rangeRequested=!0;let u=e.headersList.get("range",!0),l=pXn(u,!0);if(l==="failure")return Promise.resolve(ua("failed to fetch the data URL"));let{rangeStartValue:d,rangeEndValue:h}=l;if(d===null)d=o-h,h=d+h-1;else{if(d>=o)return Promise.resolve(ua("Range start is greater than the blob's size."));(h===null||h>=o)&&(h=o-1)}let m=s.slice(d,h,c),f=tAt(m);i.body=f[0];let g=Cie(`${m.size}`),A=hXn(d,h,o);i.status=206,i.statusText="Partial Content",i.headersList.set("content-length",g,!0),i.headersList.set("content-type",c,!0),i.headersList.set("content-range",A,!0)}else{let u=tAt(s);i.statusText="OK",i.body=u[0],i.headersList.set("content-length",a,!0),i.headersList.set("content-type",c,!0)}return Promise.resolve(i)}case"data:":{let r=cS(e),s=wXn(r);if(s==="failure")return Promise.resolve(ua("failed to fetch the data URL"));let i=TXn(s.mimeType);return Promise.resolve(Sie({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:i}]],body:MDe(s.body)[0]}))}case"file:":return Promise.resolve(ua("not implemented... yet..."));case"http:":case"https:":return dAt(t).catch(r=>ua(r));default:return Promise.resolve(ua("unknown scheme"))}}function MXn(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}function DDe(t,e){let n=t.timingInfo,r=()=>{let i=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=n),t.controller.reportTimingSteps=()=>{if(t.request.url.protocol!=="https:")return;n.endTime=i;let a=e.cacheState,c=e.bodyInfo;e.timingAllowPassed||(n=PDe(n),a="");let u=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){u=e.status;let l=fXn(e.headersList);l!=="failure"&&(c.contentType=vXn(l))}t.request.initiatorType!=null&&cAt(n,t.request.url.href,t.request.initiatorType,globalThis,a,c,u)};let o=()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()};queueMicrotask(()=>o())};t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let s=e.type==="error"?e:e.internalResponse??e;s.body==null?r():CXn(s.body.stream,()=>{r()})}async function dAt(t){let e=t.request,n=null,r=null,s=t.timingInfo;if(e.serviceWorkers,n===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),r=n=await pAt(t),e.responseTainting==="cors"&&tXn(e,n)==="failure")return ua("cors failure");KJn(e,n)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||n.type==="opaque")&&nXn(e.origin,e.client,e.destination,r)==="blocked"?ua("blocked"):(iAt.has(r.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?n=ua("unexpected redirect"):e.redirect==="manual"?n=r:e.redirect==="follow"?n=await LXn(t,n):Y1(!1)),n.timingInfo=s,n)}function LXn(t,e){let n=t.request,r=e.internalResponse?e.internalResponse:e,s;try{if(s=JJn(r,cS(n).hash),s==null)return e}catch(o){return Promise.resolve(ua(o))}if(!ODe(s))return Promise.resolve(ua("URL scheme must be a HTTP(S) scheme"));if(n.redirectCount===20)return Promise.resolve(ua("redirect count exceeded"));if(n.redirectCount+=1,n.mode==="cors"&&(s.username||s.password)&&!BDe(n,s))return Promise.resolve(ua('cross origin not allowed for request mode "cors"'));if(n.responseTainting==="cors"&&(s.username||s.password))return Promise.resolve(ua('URL cannot contain credentials for request mode "cors"'));if(r.status!==303&&n.body!=null&&n.body.source==null)return Promise.resolve(ua());if([301,302].includes(r.status)&&n.method==="POST"||r.status===303&&!DXn.includes(n.method)){n.method="GET",n.body=null;for(let o of yXn)n.headersList.delete(o)}BDe(cS(n),s)||(n.headersList.delete("authorization",!0),n.headersList.delete("proxy-authorization",!0),n.headersList.delete("cookie",!0),n.headersList.delete("host",!0)),n.body!=null&&(Y1(n.body.source!=null),n.body=MDe(n.body.source)[0]);let i=t.timingInfo;return i.redirectEndTime=i.postRedirectStartTime=rY(t.crossOriginIsolatedCapability),i.redirectStartTime===0&&(i.redirectStartTime=i.startTime),n.urlList.push(s),XJn(n,r),uAt(t,!0)}async function pAt(t,e=!1,n=!1){let r=t.request,s=null,i=null,o=null,a=null,c=!1;r.window==="no-window"&&r.redirect==="error"?(s=t,i=r):(i=qJn(r),s={...t},s.request=i);let u=r.credentials==="include"||r.credentials==="same-origin"&&r.responseTainting==="basic",l=i.body?i.body.length:null,d=null;if(i.body==null&&["POST","PUT"].includes(i.method)&&(d="0"),l!=null&&(d=Cie(`${l}`)),d!=null&&i.headersList.append("content-length",d,!0),l!=null&&i.keepalive,i.referrer instanceof URL&&i.headersList.append("referer",Cie(i.referrer.href),!0),zJn(i),eXn(i),i.headersList.contains("user-agent",!0)||i.headersList.append("user-agent",BXn),i.cache==="default"&&(i.headersList.contains("if-modified-since",!0)||i.headersList.contains("if-none-match",!0)||i.headersList.contains("if-unmodified-since",!0)||i.headersList.contains("if-match",!0)||i.headersList.contains("if-range",!0))&&(i.cache="no-store"),i.cache==="no-cache"&&!i.preventNoCacheCacheControlHeaderModification&&!i.headersList.contains("cache-control",!0)&&i.headersList.append("cache-control","max-age=0",!0),(i.cache==="no-store"||i.cache==="reload")&&(i.headersList.contains("pragma",!0)||i.headersList.append("pragma","no-cache",!0),i.headersList.contains("cache-control",!0)||i.headersList.append("cache-control","no-cache",!0)),i.headersList.contains("range",!0)&&i.headersList.append("accept-encoding","identity",!0),i.headersList.contains("accept-encoding",!0)||(uXn(cS(i))?i.headersList.append("accept-encoding","br, gzip, deflate",!0):i.headersList.append("accept-encoding","gzip, deflate",!0)),i.headersList.delete("host",!0),a==null&&(i.cache="no-store"),i.cache!=="no-store"&&i.cache,o==null){if(i.cache==="only-if-cached")return ua("only if cached");let h=await FXn(s,u,n);!AXn.has(i.method)&&h.status>=200&&h.status<=399,c&&h.status,o==null&&(o=h)}if(o.urlList=[...i.urlList],i.headersList.contains("range",!0)&&(o.rangeRequested=!0),o.requestIncludesCredentials=u,o.status===407)return r.window==="no-window"?ua():j1(t)?_ie(t):ua("proxy authentication required");if(o.status===421&&!n&&(r.body==null||r.body.source!=null)){if(j1(t))return _ie(t);t.controller.connection.destroy(),o=await pAt(t,e,!0)}return o}async function FXn(t,e=!1,n=!1){Y1(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(f,g=!0){this.destroyed||(this.destroyed=!0,g&&this.abort?.(f??new DOMException("The operation was aborted.","AbortError")))}};let r=t.request,s=null,i=t.timingInfo;null==null&&(r.cache="no-store");let a=n?"yes":"no";r.mode;let c=null;if(r.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(r.body!=null){let f=async function*(y){j1(t)||(yield y,t.processRequestBodyChunkLength?.(y.byteLength))},g=()=>{j1(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},A=y=>{j1(t)||(y.name==="AbortError"?t.controller.abort():t.controller.terminate(y))};c=(async function*(){try{for await(let y of r.body.stream)yield*f(y);g()}catch(y){A(y)}})()}try{let{body:f,status:g,statusText:A,headersList:y,socket:b}=await m({body:c});if(b)s=Sie({status:g,statusText:A,headersList:y,socket:b});else{let S=f[Symbol.asyncIterator]();t.controller.next=()=>S.next(),s=Sie({status:g,statusText:A,headersList:y})}}catch(f){return f.name==="AbortError"?(t.controller.connection.destroy(),_ie(t,f)):ua(f)}let u=async()=>{await t.controller.resume()},l=f=>{j1(t)||t.controller.abort(f)},d=new ReadableStream({async start(f){t.controller.controller=f},async pull(f){await u(f)},async cancel(f){await l(f)},type:"bytes"});s.body={stream:d,source:null,length:null},t.controller.onAborted=h,t.controller.on("terminated",h),t.controller.resume=async()=>{for(;;){let f,g;try{let{done:y,value:b}=await t.controller.next();if(eAt(t))break;f=y?void 0:b}catch(y){t.controller.ended&&!i.encodedBodySize?f=void 0:(f=y,g=!0)}if(f===void 0){cXn(t.controller.controller),MXn(t,s);return}if(i.decodedBodySize+=f?.byteLength??0,g){t.controller.terminate(f);return}let A=new Uint8Array(f);if(A.byteLength&&t.controller.controller.enqueue(A),xXn(d)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function h(f){eAt(t)?(s.aborted=!0,Iie(d)&&t.controller.controller.error(t.controller.serializedAbortReason)):Iie(d)&&t.controller.controller.error(new TypeError("terminated",{cause:oXn(f)?f:void 0})),t.controller.connection.destroy()}return s;function m({body:f}){let g=cS(r),A=t.controller.dispatcher;return new Promise((y,b)=>A.dispatch({path:g.pathname+g.search,origin:g.origin,method:r.method,body:A.isMockActive?r.body&&(r.body.source||r.body.stream):f,headers:r.headersList.entries,maxRedirections:0,upgrade:r.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(S){let{connection:C}=t.controller;i.finalConnectionTimingInfo=dXn(void 0,i.postRedirectStartTime,t.crossOriginIsolatedCapability),C.destroyed?S(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",S),this.abort=C.abort=S),i.finalNetworkRequestStartTime=rY(t.crossOriginIsolatedCapability)},onResponseStarted(){i.finalNetworkResponseStartTime=rY(t.crossOriginIsolatedCapability)},onHeaders(S,C,I,x){if(S<200)return;let w="",R=new Zgt;for(let $=0;$H)return b(new Error(`too many content-encodings in response: ${Q.length}, maximum allowed is ${H}`)),!0;for(let oe=Q.length-1;oe>=0;--oe){let re=Q[oe].trim();if(re==="x-gzip"||re==="gzip")N.push(kv.createGunzip({flush:kv.constants.Z_SYNC_FLUSH,finishFlush:kv.constants.Z_SYNC_FLUSH}));else if(re==="deflate")N.push(mXn({flush:kv.constants.Z_SYNC_FLUSH,finishFlush:kv.constants.Z_SYNC_FLUSH}));else if(re==="br")N.push(kv.createBrotliDecompress({flush:kv.constants.BROTLI_OPERATION_FLUSH,finishFlush:kv.constants.BROTLI_OPERATION_FLUSH}));else{N.length=0;break}}}let G=this.onError.bind(this);return y({status:S,statusText:x,headersList:R,body:N.length?SXn(this.body,...N,$=>{$&&this.onError($)}).on("error",G):this.body.on("error",G)}),!0},onData(S){if(t.controller.dump)return;let C=S;return i.encodedBodySize+=C.byteLength,this.body.push(C)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.onAborted&&t.controller.off("terminated",t.controller.onAborted),t.controller.ended=!0,this.body.push(null)},onError(S){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(S),t.controller.terminate(S),b(S)},onUpgrade(S,C,I){if(S!==101)return;let x=new Zgt;for(let w=0;w{"use strict";p();mAt.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var gAt=ee((RJs,fAt)=>{"use strict";p();var{webidl:Ug}=Cp(),wie=Symbol("ProgressEvent state"),FDe=class t extends Event{constructor(e,n={}){e=Ug.converters.DOMString(e,"ProgressEvent constructor","type"),n=Ug.converters.ProgressEventInit(n??{}),super(e,n),this[wie]={lengthComputable:n.lengthComputable,loaded:n.loaded,total:n.total}}get lengthComputable(){return Ug.brandCheck(this,t),this[wie].lengthComputable}get loaded(){return Ug.brandCheck(this,t),this[wie].loaded}get total(){return Ug.brandCheck(this,t),this[wie].total}};Ug.converters.ProgressEventInit=Ug.dictionaryConverter([{key:"lengthComputable",converter:Ug.converters.boolean,defaultValue:()=>!1},{key:"loaded",converter:Ug.converters["unsigned long long"],defaultValue:()=>0},{key:"total",converter:Ug.converters["unsigned long long"],defaultValue:()=>0},{key:"bubbles",converter:Ug.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:Ug.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:Ug.converters.boolean,defaultValue:()=>!1}]);fAt.exports={ProgressEvent:FDe}});var yAt=ee((NJs,AAt)=>{"use strict";p();function QXn(t){if(!t)return"failure";switch(t.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}AAt.exports={getEncoding:QXn}});var wAt=ee((BJs,xAt)=>{"use strict";p();var{kState:dU,kError:QDe,kResult:EAt,kAborted:iY,kLastProgressEventFired:UDe}=LDe(),{ProgressEvent:UXn}=gAt(),{getEncoding:bAt}=yAt(),{serializeAMimeType:$Xn,parseMIMEType:_At}=yf(),{types:GXn}=require("node:util"),{StringDecoder:SAt}=require("string_decoder"),{btoa:CAt}=require("node:buffer"),WXn={enumerable:!0,writable:!1,configurable:!1};function qXn(t,e,n,r){if(t[dU]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[dU]="loading",t[EAt]=null,t[QDe]=null;let i=e.stream().getReader(),o=[],a=i.read(),c=!0;(async()=>{for(;!t[iY];)try{let{done:u,value:l}=await a;if(c&&!t[iY]&&queueMicrotask(()=>{Nv("loadstart",t)}),c=!1,!u&&GXn.isUint8Array(l))o.push(l),(t[UDe]===void 0||Date.now()-t[UDe]>=50)&&!t[iY]&&(t[UDe]=Date.now(),queueMicrotask(()=>{Nv("progress",t)})),a=i.read();else if(u){queueMicrotask(()=>{t[dU]="done";try{let d=HXn(o,n,e.type,r);if(t[iY])return;t[EAt]=d,Nv("load",t)}catch(d){t[QDe]=d,Nv("error",t)}t[dU]!=="loading"&&Nv("loadend",t)});break}}catch(u){if(t[iY])return;queueMicrotask(()=>{t[dU]="done",t[QDe]=u,Nv("error",t),t[dU]!=="loading"&&Nv("loadend",t)});break}})()}function Nv(t,e){let n=new UXn(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(n)}function HXn(t,e,n,r){switch(e){case"DataURL":{let s="data:",i=_At(n||"application/octet-stream");i!=="failure"&&(s+=$Xn(i)),s+=";base64,";let o=new SAt("latin1");for(let a of t)s+=CAt(o.write(a));return s+=CAt(o.end()),s}case"Text":{let s="failure";if(r&&(s=bAt(r)),s==="failure"&&n){let i=_At(n);i!=="failure"&&(s=bAt(i.parameters.get("charset")))}return s==="failure"&&(s="UTF-8"),VXn(t,s)}case"ArrayBuffer":return IAt(t).buffer;case"BinaryString":{let s="",i=new SAt("latin1");for(let o of t)s+=i.write(o);return s+=i.end(),s}}}function VXn(t,e){let n=IAt(t),r=jXn(n),s=0;r!==null&&(e=r,s=r==="UTF-8"?3:2);let i=n.slice(s);return new TextDecoder(e).decode(i)}function jXn(t){let[e,n,r]=t;return e===239&&n===187&&r===191?"UTF-8":e===254&&n===255?"UTF-16BE":e===255&&n===254?"UTF-16LE":null}function IAt(t){let e=t.reduce((r,s)=>r+s.byteLength,0),n=0;return t.reduce((r,s)=>(r.set(s,n),n+=s.byteLength,r),new Uint8Array(e))}xAt.exports={staticPropertyDescriptors:WXn,readOperation:qXn,fireAProgressEvent:Nv}});var kAt=ee((OJs,RAt)=>{"use strict";p();var{staticPropertyDescriptors:pU,readOperation:Tie,fireAProgressEvent:TAt}=wAt(),{kState:K1,kError:vAt,kResult:vie,kEvents:$o,kAborted:YXn}=LDe(),{webidl:Ea}=Cp(),{kEnumerableProperty:_f}=Wi(),$b=class t extends EventTarget{constructor(){super(),this[K1]="empty",this[vie]=null,this[vAt]=null,this[$o]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){Ea.brandCheck(this,t),Ea.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=Ea.converters.Blob(e,{strict:!1}),Tie(this,e,"ArrayBuffer")}readAsBinaryString(e){Ea.brandCheck(this,t),Ea.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=Ea.converters.Blob(e,{strict:!1}),Tie(this,e,"BinaryString")}readAsText(e,n=void 0){Ea.brandCheck(this,t),Ea.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=Ea.converters.Blob(e,{strict:!1}),n!==void 0&&(n=Ea.converters.DOMString(n,"FileReader.readAsText","encoding")),Tie(this,e,"Text",n)}readAsDataURL(e){Ea.brandCheck(this,t),Ea.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=Ea.converters.Blob(e,{strict:!1}),Tie(this,e,"DataURL")}abort(){if(this[K1]==="empty"||this[K1]==="done"){this[vie]=null;return}this[K1]==="loading"&&(this[K1]="done",this[vie]=null),this[YXn]=!0,TAt("abort",this),this[K1]!=="loading"&&TAt("loadend",this)}get readyState(){switch(Ea.brandCheck(this,t),this[K1]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return Ea.brandCheck(this,t),this[vie]}get error(){return Ea.brandCheck(this,t),this[vAt]}get onloadend(){return Ea.brandCheck(this,t),this[$o].loadend}set onloadend(e){Ea.brandCheck(this,t),this[$o].loadend&&this.removeEventListener("loadend",this[$o].loadend),typeof e=="function"?(this[$o].loadend=e,this.addEventListener("loadend",e)):this[$o].loadend=null}get onerror(){return Ea.brandCheck(this,t),this[$o].error}set onerror(e){Ea.brandCheck(this,t),this[$o].error&&this.removeEventListener("error",this[$o].error),typeof e=="function"?(this[$o].error=e,this.addEventListener("error",e)):this[$o].error=null}get onloadstart(){return Ea.brandCheck(this,t),this[$o].loadstart}set onloadstart(e){Ea.brandCheck(this,t),this[$o].loadstart&&this.removeEventListener("loadstart",this[$o].loadstart),typeof e=="function"?(this[$o].loadstart=e,this.addEventListener("loadstart",e)):this[$o].loadstart=null}get onprogress(){return Ea.brandCheck(this,t),this[$o].progress}set onprogress(e){Ea.brandCheck(this,t),this[$o].progress&&this.removeEventListener("progress",this[$o].progress),typeof e=="function"?(this[$o].progress=e,this.addEventListener("progress",e)):this[$o].progress=null}get onload(){return Ea.brandCheck(this,t),this[$o].load}set onload(e){Ea.brandCheck(this,t),this[$o].load&&this.removeEventListener("load",this[$o].load),typeof e=="function"?(this[$o].load=e,this.addEventListener("load",e)):this[$o].load=null}get onabort(){return Ea.brandCheck(this,t),this[$o].abort}set onabort(e){Ea.brandCheck(this,t),this[$o].abort&&this.removeEventListener("abort",this[$o].abort),typeof e=="function"?(this[$o].abort=e,this.addEventListener("abort",e)):this[$o].abort=null}};$b.EMPTY=$b.prototype.EMPTY=0;$b.LOADING=$b.prototype.LOADING=1;$b.DONE=$b.prototype.DONE=2;Object.defineProperties($b.prototype,{EMPTY:pU,LOADING:pU,DONE:pU,readAsArrayBuffer:_f,readAsBinaryString:_f,readAsText:_f,readAsDataURL:_f,abort:_f,readyState:_f,result:_f,error:_f,onloadstart:_f,onprogress:_f,onload:_f,onabort:_f,onerror:_f,onloadend:_f,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties($b,{EMPTY:pU,LOADING:pU,DONE:pU});RAt.exports={FileReader:$b}});var Rie=ee((LJs,NAt)=>{"use strict";p();NAt.exports={kConstruct:Nc().kConstruct}});var PAt=ee((QJs,BAt)=>{"use strict";p();var KXn=require("node:assert"),{URLSerializer:DAt}=yf(),{isValidHeaderName:zXn}=Bg();function JXn(t,e,n=!1){let r=DAt(t,n),s=DAt(e,n);return r===s}function XXn(t){KXn(t!==null);let e=[];for(let n of t.split(","))n=n.trim(),zXn(n)&&e.push(n);return e}BAt.exports={urlEquals:JXn,getFieldValues:XXn}});var LAt=ee(($Js,MAt)=>{"use strict";p();var{kConstruct:ZXn}=Rie(),{urlEquals:eZn,getFieldValues:$De}=PAt(),{kEnumerableProperty:z1,isDisturbed:tZn}=Wi(),{webidl:es}=Cp(),{Response:nZn,cloneResponse:rZn,fromInnerResponse:sZn}=nY(),{Request:fx,fromInnerRequest:iZn}=uU(),{kState:Gb}=yv(),{fetching:oZn}=sY(),{urlIsHttpHttpsScheme:kie,createDeferredPromise:hU,readAllBytes:aZn}=Bg(),GDe=require("node:assert"),Nie=class t{#e;constructor(){arguments[0]!==ZXn&&es.illegalConstructor(),es.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,n={}){es.brandCheck(this,t);let r="Cache.match";es.argumentLengthCheck(arguments,1,r),e=es.converters.RequestInfo(e,r,"request"),n=es.converters.CacheQueryOptions(n,r,"options");let s=this.#i(e,n,1);if(s.length!==0)return s[0]}async matchAll(e=void 0,n={}){es.brandCheck(this,t);let r="Cache.matchAll";return e!==void 0&&(e=es.converters.RequestInfo(e,r,"request")),n=es.converters.CacheQueryOptions(n,r,"options"),this.#i(e,n)}async add(e){es.brandCheck(this,t);let n="Cache.add";es.argumentLengthCheck(arguments,1,n),e=es.converters.RequestInfo(e,n,"request");let r=[e];return await this.addAll(r)}async addAll(e){es.brandCheck(this,t);let n="Cache.addAll";es.argumentLengthCheck(arguments,1,n);let r=[],s=[];for(let h of e){if(h===void 0)throw es.errors.conversionFailed({prefix:n,argument:"Argument 1",types:["undefined is not allowed"]});if(h=es.converters.RequestInfo(h),typeof h=="string")continue;let m=h[Gb];if(!kie(m.url)||m.method!=="GET")throw es.errors.exception({header:n,message:"Expected http/s scheme when method is not GET."})}let i=[];for(let h of e){let m=new fx(h)[Gb];if(!kie(m.url))throw es.errors.exception({header:n,message:"Expected http/s scheme."});m.initiator="fetch",m.destination="subresource",s.push(m);let f=hU();i.push(oZn({request:m,processResponse(g){if(g.type==="error"||g.status===206||g.status<200||g.status>299)f.reject(es.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(g.headersList.contains("vary")){let A=$De(g.headersList.get("vary"));for(let y of A)if(y==="*"){f.reject(es.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let b of i)b.abort();return}}},processResponseEndOfBody(g){if(g.aborted){f.reject(new DOMException("aborted","AbortError"));return}f.resolve(g)}})),r.push(f.promise)}let a=await Promise.all(r),c=[],u=0;for(let h of a){let m={type:"put",request:s[u],response:h};c.push(m),u++}let l=hU(),d=null;try{this.#t(c)}catch(h){d=h}return queueMicrotask(()=>{d===null?l.resolve(void 0):l.reject(d)}),l.promise}async put(e,n){es.brandCheck(this,t);let r="Cache.put";es.argumentLengthCheck(arguments,2,r),e=es.converters.RequestInfo(e,r,"request"),n=es.converters.Response(n,r,"response");let s=null;if(e instanceof fx?s=e[Gb]:s=new fx(e)[Gb],!kie(s.url)||s.method!=="GET")throw es.errors.exception({header:r,message:"Expected an http/s scheme when method is not GET"});let i=n[Gb];if(i.status===206)throw es.errors.exception({header:r,message:"Got 206 status"});if(i.headersList.contains("vary")){let m=$De(i.headersList.get("vary"));for(let f of m)if(f==="*")throw es.errors.exception({header:r,message:"Got * vary field value"})}if(i.body&&(tZn(i.body.stream)||i.body.stream.locked))throw es.errors.exception({header:r,message:"Response body is locked or disturbed"});let o=rZn(i),a=hU();if(i.body!=null){let f=i.body.stream.getReader();aZn(f).then(a.resolve,a.reject)}else a.resolve(void 0);let c=[],u={type:"put",request:s,response:o};c.push(u);let l=await a.promise;o.body!=null&&(o.body.source=l);let d=hU(),h=null;try{this.#t(c)}catch(m){h=m}return queueMicrotask(()=>{h===null?d.resolve():d.reject(h)}),d.promise}async delete(e,n={}){es.brandCheck(this,t);let r="Cache.delete";es.argumentLengthCheck(arguments,1,r),e=es.converters.RequestInfo(e,r,"request"),n=es.converters.CacheQueryOptions(n,r,"options");let s=null;if(e instanceof fx){if(s=e[Gb],s.method!=="GET"&&!n.ignoreMethod)return!1}else GDe(typeof e=="string"),s=new fx(e)[Gb];let i=[],o={type:"delete",request:s,options:n};i.push(o);let a=hU(),c=null,u;try{u=this.#t(i)}catch(l){c=l}return queueMicrotask(()=>{c===null?a.resolve(!!u?.length):a.reject(c)}),a.promise}async keys(e=void 0,n={}){es.brandCheck(this,t);let r="Cache.keys";e!==void 0&&(e=es.converters.RequestInfo(e,r,"request")),n=es.converters.CacheQueryOptions(n,r,"options");let s=null;if(e!==void 0)if(e instanceof fx){if(s=e[Gb],s.method!=="GET"&&!n.ignoreMethod)return[]}else typeof e=="string"&&(s=new fx(e)[Gb]);let i=hU(),o=[];if(e===void 0)for(let a of this.#e)o.push(a[0]);else{let a=this.#n(s,n);for(let c of a)o.push(c[0])}return queueMicrotask(()=>{let a=[];for(let c of o){let u=iZn(c,new AbortController().signal,"immutable");a.push(u)}i.resolve(Object.freeze(a))}),i.promise}#t(e){let n=this.#e,r=[...n],s=[],i=[];try{for(let o of e){if(o.type!=="delete"&&o.type!=="put")throw es.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(o.type==="delete"&&o.response!=null)throw es.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#n(o.request,o.options,s).length)throw new DOMException("???","InvalidStateError");let a;if(o.type==="delete"){if(a=this.#n(o.request,o.options),a.length===0)return[];for(let c of a){let u=n.indexOf(c);GDe(u!==-1),n.splice(u,1)}}else if(o.type==="put"){if(o.response==null)throw es.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let c=o.request;if(!kie(c.url))throw es.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(c.method!=="GET")throw es.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(o.options!=null)throw es.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});a=this.#n(o.request);for(let u of a){let l=n.indexOf(u);GDe(l!==-1),n.splice(l,1)}n.push([o.request,o.response]),s.push([o.request,o.response])}i.push([o.request,o.response])}return i}catch(o){throw this.#e.length=0,this.#e=r,o}}#n(e,n,r){let s=[],i=r??this.#e;for(let o of i){let[a,c]=o;this.#r(e,a,c,n)&&s.push(o)}return s}#r(e,n,r=null,s){let i=new URL(e.url),o=new URL(n.url);if(s?.ignoreSearch&&(o.search="",i.search=""),!eZn(i,o,!0))return!1;if(r==null||s?.ignoreVary||!r.headersList.contains("vary"))return!0;let a=$De(r.headersList.get("vary"));for(let c of a){if(c==="*")return!1;let u=n.headersList.get(c),l=e.headersList.get(c);if(u!==l)return!1}return!0}#i(e,n,r=1/0){let s=null;if(e!==void 0)if(e instanceof fx){if(s=e[Gb],s.method!=="GET"&&!n.ignoreMethod)return[]}else typeof e=="string"&&(s=new fx(e)[Gb]);let i=[];if(e===void 0)for(let a of this.#e)i.push(a[1]);else{let a=this.#n(s,n);for(let c of a)i.push(c[1])}let o=[];for(let a of i){let c=sZn(a,"immutable");if(o.push(c.clone()),o.length>=r)break}return Object.freeze(o)}};Object.defineProperties(Nie.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:z1,matchAll:z1,add:z1,addAll:z1,put:z1,delete:z1,keys:z1});var OAt=[{key:"ignoreSearch",converter:es.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:es.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:es.converters.boolean,defaultValue:()=>!1}];es.converters.CacheQueryOptions=es.dictionaryConverter(OAt);es.converters.MultiCacheQueryOptions=es.dictionaryConverter([...OAt,{key:"cacheName",converter:es.converters.DOMString}]);es.converters.Response=es.interfaceConverter(nZn);es.converters["sequence"]=es.sequenceConverter(es.converters.RequestInfo);MAt.exports={Cache:Nie}});var QAt=ee((WJs,FAt)=>{"use strict";p();var{kConstruct:oY}=Rie(),{Cache:Die}=LAt(),{webidl:mh}=Cp(),{kEnumerableProperty:aY}=Wi(),Bie=class t{#e=new Map;constructor(){arguments[0]!==oY&&mh.illegalConstructor(),mh.util.markAsUncloneable(this)}async match(e,n={}){if(mh.brandCheck(this,t),mh.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=mh.converters.RequestInfo(e),n=mh.converters.MultiCacheQueryOptions(n),n.cacheName!=null){if(this.#e.has(n.cacheName)){let r=this.#e.get(n.cacheName);return await new Die(oY,r).match(e,n)}}else for(let r of this.#e.values()){let i=await new Die(oY,r).match(e,n);if(i!==void 0)return i}}async has(e){mh.brandCheck(this,t);let n="CacheStorage.has";return mh.argumentLengthCheck(arguments,1,n),e=mh.converters.DOMString(e,n,"cacheName"),this.#e.has(e)}async open(e){mh.brandCheck(this,t);let n="CacheStorage.open";if(mh.argumentLengthCheck(arguments,1,n),e=mh.converters.DOMString(e,n,"cacheName"),this.#e.has(e)){let s=this.#e.get(e);return new Die(oY,s)}let r=[];return this.#e.set(e,r),new Die(oY,r)}async delete(e){mh.brandCheck(this,t);let n="CacheStorage.delete";return mh.argumentLengthCheck(arguments,1,n),e=mh.converters.DOMString(e,n,"cacheName"),this.#e.delete(e)}async keys(){return mh.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Bie.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:aY,has:aY,open:aY,delete:aY,keys:aY});FAt.exports={CacheStorage:Bie}});var $At=ee((HJs,UAt)=>{"use strict";p();UAt.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var WDe=ee((jJs,VAt)=>{"use strict";p();function cZn(t){for(let e=0;e=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function GAt(t){for(let e=0;e126||n===34||n===40||n===41||n===60||n===62||n===64||n===44||n===59||n===58||n===92||n===47||n===91||n===93||n===63||n===61||n===123||n===125)throw new Error("Invalid cookie name")}}function WAt(t){let e=t.length,n=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++n}for(;n126||r===34||r===44||r===59||r===92)throw new Error("Invalid cookie value")}}function qAt(t){for(let e=0;ee.toString().padStart(2,"0"));function HAt(t){return typeof t=="number"&&(t=new Date(t)),`${uZn[t.getUTCDay()]}, ${Pie[t.getUTCDate()]} ${dZn[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Pie[t.getUTCHours()]}:${Pie[t.getUTCMinutes()]}:${Pie[t.getUTCSeconds()]} GMT`}function pZn(t){if(t<0)throw new Error("Invalid cookie max-age")}function hZn(t){if(t.name.length===0)return null;GAt(t.name),WAt(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(pZn(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(lZn(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(qAt(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${HAt(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let n of t.unparsed){if(!n.includes("="))throw new Error("Invalid unparsed");let[r,...s]=n.split("=");e.push(`${r.trim()}=${s.join("=")}`)}return e.join("; ")}VAt.exports={isCTLExcludingHtab:cZn,validateCookieName:GAt,validateCookiePath:qAt,validateCookieValue:WAt,toIMFDate:HAt,stringify:hZn}});var YAt=ee((KJs,jAt)=>{"use strict";p();var{maxNameValuePairSize:mZn,maxAttributeValueSize:fZn}=$At(),{isCTLExcludingHtab:gZn}=WDe(),{collectASequenceOfCodePointsFast:Oie}=yf(),AZn=require("node:assert");function yZn(t){if(gZn(t))return null;let e="",n="",r="",s="";if(t.includes(";")){let i={position:0};e=Oie(";",t,i),n=t.slice(i.position)}else e=t;if(!e.includes("="))s=e;else{let i={position:0};r=Oie("=",e,i),s=e.slice(i.position+1)}return r=r.trim(),s=s.trim(),r.length+s.length>mZn?null:{name:r,value:s,...mU(n)}}function mU(t,e={}){if(t.length===0)return e;AZn(t[0]===";"),t=t.slice(1);let n="";t.includes(";")?(n=Oie(";",t,{position:0}),t=t.slice(n.length)):(n=t,t="");let r="",s="";if(n.includes("=")){let o={position:0};r=Oie("=",n,o),s=n.slice(o.position+1)}else r=n;if(r=r.trim(),s=s.trim(),s.length>fZn)return mU(t,e);let i=r.toLowerCase();if(i==="expires"){let o=new Date(s);e.expires=o}else if(i==="max-age"){let o=s.charCodeAt(0);if((o<48||o>57)&&s[0]!=="-"||!/^\d+$/.test(s))return mU(t,e);let a=Number(s);e.maxAge=a}else if(i==="domain"){let o=s;o[0]==="."&&(o=o.slice(1)),o=o.toLowerCase(),e.domain=o}else if(i==="path"){let o="";s.length===0||s[0]!=="/"?o="/":o=s,e.path=o}else if(i==="secure")e.secure=!0;else if(i==="httponly")e.httpOnly=!0;else if(i==="samesite"){let o=s.toLowerCase();o==="none"?e.sameSite="None":o==="strict"?e.sameSite="Strict":o==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${r}=${s}`);return mU(t,e)}jAt.exports={parseSetCookie:yZn,parseUnparsedAttributes:mU}});var JAt=ee((JJs,zAt)=>{"use strict";p();var{parseSetCookie:EZn}=YAt(),{stringify:bZn}=WDe(),{webidl:io}=Cp(),{Headers:Mie}=H1();function _Zn(t){io.argumentLengthCheck(arguments,1,"getCookies"),io.brandCheck(t,Mie,{strict:!1});let e=t.get("cookie"),n={};if(!e)return n;for(let r of e.split(";")){let[s,...i]=r.split("=");n[s.trim()]=i.join("=")}return n}function SZn(t,e,n){io.brandCheck(t,Mie,{strict:!1});let r="deleteCookie";io.argumentLengthCheck(arguments,2,r),e=io.converters.DOMString(e,r,"name"),n=io.converters.DeleteCookieAttributes(n),KAt(t,{name:e,value:"",expires:new Date(0),...n})}function CZn(t){io.argumentLengthCheck(arguments,1,"getSetCookies"),io.brandCheck(t,Mie,{strict:!1});let e=t.getSetCookie();return e?e.map(n=>EZn(n)):[]}function KAt(t,e){io.argumentLengthCheck(arguments,2,"setCookie"),io.brandCheck(t,Mie,{strict:!1}),e=io.converters.Cookie(e);let n=bZn(e);n&&t.append("Set-Cookie",n)}io.converters.DeleteCookieAttributes=io.dictionaryConverter([{converter:io.nullableConverter(io.converters.DOMString),key:"path",defaultValue:()=>null},{converter:io.nullableConverter(io.converters.DOMString),key:"domain",defaultValue:()=>null}]);io.converters.Cookie=io.dictionaryConverter([{converter:io.converters.DOMString,key:"name"},{converter:io.converters.DOMString,key:"value"},{converter:io.nullableConverter(t=>typeof t=="number"?io.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:()=>null},{converter:io.nullableConverter(io.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:io.nullableConverter(io.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:io.nullableConverter(io.converters.DOMString),key:"path",defaultValue:()=>null},{converter:io.nullableConverter(io.converters.boolean),key:"secure",defaultValue:()=>null},{converter:io.nullableConverter(io.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:io.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:io.sequenceConverter(io.converters.DOMString),key:"unparsed",defaultValue:()=>new Array(0)}]);zAt.exports={getCookies:_Zn,deleteCookie:SZn,getSetCookies:CZn,setCookie:KAt}});var gU=ee((ZJs,ZAt)=>{"use strict";p();var{webidl:jr}=Cp(),{kEnumerableProperty:Sf}=Wi(),{kConstruct:XAt}=Nc(),{MessagePort:IZn}=require("node:worker_threads"),fU=class t extends Event{#e;constructor(e,n={}){if(e===XAt){super(arguments[1],arguments[2]),jr.util.markAsUncloneable(this);return}let r="MessageEvent constructor";jr.argumentLengthCheck(arguments,1,r),e=jr.converters.DOMString(e,r,"type"),n=jr.converters.MessageEventInit(n,r,"eventInitDict"),super(e,n),this.#e=n,jr.util.markAsUncloneable(this)}get data(){return jr.brandCheck(this,t),this.#e.data}get origin(){return jr.brandCheck(this,t),this.#e.origin}get lastEventId(){return jr.brandCheck(this,t),this.#e.lastEventId}get source(){return jr.brandCheck(this,t),this.#e.source}get ports(){return jr.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,n=!1,r=!1,s=null,i="",o="",a=null,c=[]){return jr.brandCheck(this,t),jr.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:n,cancelable:r,data:s,origin:i,lastEventId:o,source:a,ports:c})}static createFastMessageEvent(e,n){let r=new t(XAt,e,n);return r.#e=n,r.#e.data??=null,r.#e.origin??="",r.#e.lastEventId??="",r.#e.source??=null,r.#e.ports??=[],r}},{createFastMessageEvent:xZn}=fU;delete fU.createFastMessageEvent;var Lie=class t extends Event{#e;constructor(e,n={}){let r="CloseEvent constructor";jr.argumentLengthCheck(arguments,1,r),e=jr.converters.DOMString(e,r,"type"),n=jr.converters.CloseEventInit(n),super(e,n),this.#e=n,jr.util.markAsUncloneable(this)}get wasClean(){return jr.brandCheck(this,t),this.#e.wasClean}get code(){return jr.brandCheck(this,t),this.#e.code}get reason(){return jr.brandCheck(this,t),this.#e.reason}},Fie=class t extends Event{#e;constructor(e,n){let r="ErrorEvent constructor";jr.argumentLengthCheck(arguments,1,r),super(e,n),jr.util.markAsUncloneable(this),e=jr.converters.DOMString(e,r,"type"),n=jr.converters.ErrorEventInit(n??{}),this.#e=n}get message(){return jr.brandCheck(this,t),this.#e.message}get filename(){return jr.brandCheck(this,t),this.#e.filename}get lineno(){return jr.brandCheck(this,t),this.#e.lineno}get colno(){return jr.brandCheck(this,t),this.#e.colno}get error(){return jr.brandCheck(this,t),this.#e.error}};Object.defineProperties(fU.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:Sf,origin:Sf,lastEventId:Sf,source:Sf,ports:Sf,initMessageEvent:Sf});Object.defineProperties(Lie.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:Sf,code:Sf,wasClean:Sf});Object.defineProperties(Fie.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:Sf,filename:Sf,lineno:Sf,colno:Sf,error:Sf});jr.converters.MessagePort=jr.interfaceConverter(IZn);jr.converters["sequence"]=jr.sequenceConverter(jr.converters.MessagePort);var qDe=[{key:"bubbles",converter:jr.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:jr.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:jr.converters.boolean,defaultValue:()=>!1}];jr.converters.MessageEventInit=jr.dictionaryConverter([...qDe,{key:"data",converter:jr.converters.any,defaultValue:()=>null},{key:"origin",converter:jr.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:jr.converters.DOMString,defaultValue:()=>""},{key:"source",converter:jr.nullableConverter(jr.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:jr.converters["sequence"],defaultValue:()=>new Array(0)}]);jr.converters.CloseEventInit=jr.dictionaryConverter([...qDe,{key:"wasClean",converter:jr.converters.boolean,defaultValue:()=>!1},{key:"code",converter:jr.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:jr.converters.USVString,defaultValue:()=>""}]);jr.converters.ErrorEventInit=jr.dictionaryConverter([...qDe,{key:"message",converter:jr.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:jr.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:jr.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:jr.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:jr.converters.any}]);ZAt.exports={MessageEvent:fU,CloseEvent:Lie,ErrorEvent:Fie,createFastMessageEvent:xZn}});var J1=ee((tXs,eyt)=>{"use strict";p();var wZn="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",TZn={enumerable:!0,writable:!1,configurable:!1},vZn={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},RZn={NOT_SENT:0,PROCESSING:1,SENT:2},kZn={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},NZn=2**16-1,DZn={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},BZn=Buffer.allocUnsafe(0),PZn={string:1,typedArray:2,arrayBuffer:3,blob:4};eyt.exports={uid:wZn,sentCloseFrameState:RZn,staticPropertyDescriptors:TZn,states:vZn,opcodes:kZn,maxUnsigned16Bit:NZn,parserStates:DZn,emptyBuffer:BZn,sendHints:PZn}});var cY=ee((rXs,tyt)=>{"use strict";p();tyt.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var dY=ee((iXs,uyt)=>{"use strict";p();var{kReadyState:lY,kController:OZn,kResponse:MZn,kBinaryType:LZn,kWebSocketURL:FZn}=cY(),{states:uY,opcodes:Dv}=J1(),{ErrorEvent:QZn,createFastMessageEvent:UZn}=gU(),{isUtf8:$Zn}=require("node:buffer"),{collectASequenceOfCodePointsFast:GZn,removeHTTPWhitespace:nyt}=yf();function WZn(t){return t[lY]===uY.CONNECTING}function qZn(t){return t[lY]===uY.OPEN}function HZn(t){return t[lY]===uY.CLOSING}function VZn(t){return t[lY]===uY.CLOSED}function HDe(t,e,n=(s,i)=>new Event(s,i),r={}){let s=n(t,r);e.dispatchEvent(s)}function jZn(t,e,n){if(t[lY]!==uY.OPEN)return;let r;if(e===Dv.TEXT)try{r=lyt(n)}catch{syt(t,"Received invalid UTF-8 in text frame.");return}else e===Dv.BINARY&&(t[LZn]==="blob"?r=new Blob([n]):r=YZn(n));HDe("message",t,UZn,{origin:t[FZn].origin,data:r})}function YZn(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function KZn(t){if(t.length===0)return!1;for(let e=0;e126||n===34||n===40||n===41||n===44||n===47||n===58||n===59||n===60||n===61||n===62||n===63||n===64||n===91||n===92||n===93||n===123||n===125)return!1}return!0}function zZn(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}function syt(t,e){let{[OZn]:n,[MZn]:r}=t;n.abort(),r?.socket&&!r.socket.destroyed&&r.socket.destroy(),e&&HDe("error",t,(s,i)=>new QZn(s,i),{error:new Error(e),message:e})}function iyt(t){return t===Dv.CLOSE||t===Dv.PING||t===Dv.PONG}function oyt(t){return t===Dv.CONTINUATION}function ayt(t){return t===Dv.TEXT||t===Dv.BINARY}function JZn(t){return ayt(t)||oyt(t)||iyt(t)}function XZn(t){let e={position:0},n=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}var cyt=typeof process.versions.icu=="string",ryt=cyt?new TextDecoder("utf-8",{fatal:!0}):void 0,lyt=cyt?ryt.decode.bind(ryt):function(t){if($Zn(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};uyt.exports={isConnecting:WZn,isEstablished:qZn,isClosing:HZn,isClosed:VZn,fireEvent:HDe,isValidSubprotocol:KZn,isValidStatusCode:zZn,failWebsocketConnection:syt,websocketMessageReceived:jZn,utf8Decode:lyt,isControlFrame:iyt,isContinuationFrame:oyt,isTextBinaryFrame:ayt,isValidOpcode:JZn,parseExtensions:XZn,isValidClientWindowBits:ZZn}});var Uie=ee((aXs,dyt)=>{"use strict";p();var{maxUnsigned16Bit:eer}=J1(),Qie=16386,VDe,pY=null,AU=Qie;try{VDe=require("node:crypto")}catch{VDe={randomFillSync:function(e,n,r){for(let s=0;seer?(o+=8,i=127):s>125&&(o+=2,i=126);let a=Buffer.allocUnsafe(s+o);a[0]=a[1]=0,a[0]|=128,a[0]=(a[0]&240)+e;a[o-4]=r[0],a[o-3]=r[1],a[o-2]=r[2],a[o-1]=r[3],a[1]=i,i===126?a.writeUInt16BE(s,2):i===127&&(a[2]=a[3]=0,a.writeUIntBE(s,4,6)),a[1]|=128;for(let c=0;c{"use strict";p();var{uid:ner,states:hY,sentCloseFrameState:$ie,emptyBuffer:rer,opcodes:ser}=J1(),{kReadyState:mY,kSentClose:Gie,kByteParser:hyt,kReceivedClose:pyt,kResponse:myt}=cY(),{fireEvent:ier,failWebsocketConnection:Bv,isClosing:oer,isClosed:aer,isEstablished:cer,parseExtensions:ler}=dY(),{channels:yU}=RQ(),{CloseEvent:uer}=gU(),{makeRequest:der}=uU(),{fetching:per}=sY(),{Headers:her,getHeadersList:mer}=H1(),{getDecodeSplit:fer}=Bg(),{WebsocketFrameSend:ger}=Uie(),YDe;try{YDe=require("node:crypto")}catch{}function Aer(t,e,n,r,s,i){let o=t;o.protocol=t.protocol==="ws:"?"http:":"https:";let a=der({urlList:[o],client:n,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(i.headers){let d=mer(new her(i.headers));a.headersList=d}let c=YDe.randomBytes(16).toString("base64");a.headersList.append("sec-websocket-key",c),a.headersList.append("sec-websocket-version","13");for(let d of e)a.headersList.append("sec-websocket-protocol",d);return a.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits"),per({request:a,useParallelQueue:!0,dispatcher:i.dispatcher,processResponse(d){if(d.type==="error"||d.status!==101){Bv(r,"Received network error or non-101 status code.");return}if(e.length!==0&&!d.headersList.get("Sec-WebSocket-Protocol")){Bv(r,"Server did not respond with sent protocols.");return}if(d.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Bv(r,'Server did not set Upgrade header to "websocket".');return}if(d.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Bv(r,'Server did not set Connection header to "upgrade".');return}let h=d.headersList.get("Sec-WebSocket-Accept"),m=YDe.createHash("sha1").update(c+ner).digest("base64");if(h!==m){Bv(r,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let f=d.headersList.get("Sec-WebSocket-Extensions"),g;if(f!==null&&(g=ler(f),!g.has("permessage-deflate"))){Bv(r,"Sec-WebSocket-Extensions header does not match.");return}let A=d.headersList.get("Sec-WebSocket-Protocol");if(A!==null&&!fer("sec-websocket-protocol",a.headersList).includes(A)){Bv(r,"Protocol was not set in the opening handshake.");return}d.socket.on("data",fyt),d.socket.on("close",gyt),d.socket.on("error",Ayt),yU.open.hasSubscribers&&yU.open.publish({address:d.socket.address(),protocol:A,extensions:f}),s(d,g)}})}function yer(t,e,n,r){if(!(oer(t)||aer(t)))if(!cer(t))Bv(t,"Connection was closed before it was established."),t[mY]=hY.CLOSING;else if(t[Gie]===$ie.NOT_SENT){t[Gie]=$ie.PROCESSING;let s=new ger;e!==void 0&&n===void 0?(s.frameData=Buffer.allocUnsafe(2),s.frameData.writeUInt16BE(e,0)):e!==void 0&&n!==void 0?(s.frameData=Buffer.allocUnsafe(2+r),s.frameData.writeUInt16BE(e,0),s.frameData.write(n,2,"utf-8")):s.frameData=rer,t[myt].socket.write(s.createFrame(ser.CLOSE)),t[Gie]=$ie.SENT,t[mY]=hY.CLOSING}else t[mY]=hY.CLOSING}function fyt(t){this.ws[hyt].write(t)||this.pause()}function gyt(){let{ws:t}=this,{[myt]:e}=t;e.socket.off("data",fyt),e.socket.off("close",gyt),e.socket.off("error",Ayt);let n=t[Gie]===$ie.SENT&&t[pyt],r=1005,s="",i=t[hyt].closingInfo;i&&!i.error?(r=i.code??1005,s=i.reason):t[pyt]||(r=1006),t[mY]=hY.CLOSED,ier("close",t,(o,a)=>new uer(o,a),{wasClean:n,code:r,reason:s}),yU.close.hasSubscribers&&yU.close.publish({websocket:t,code:r,reason:s})}function Ayt(t){let{ws:e}=this;e[mY]=hY.CLOSING,yU.socketError.hasSubscribers&&yU.socketError.publish(t),this.destroy()}yyt.exports={establishWebSocketConnection:Aer,closeWebSocketConnection:yer}});var byt=ee((dXs,Eyt)=>{"use strict";p();var{createInflateRaw:Eer,Z_DEFAULT_WINDOWBITS:ber}=require("node:zlib"),{isValidClientWindowBits:_er}=dY(),{MessageSizeExceededError:Ser}=Do(),Cer=Buffer.from([0,0,255,255]),Wie=Symbol("kBuffer"),fY=Symbol("kLength"),zDe=class{#e;#t={};#n=0;constructor(e,n){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits"),this.#n=n.maxPayloadSize}decompress(e,n,r){if(!this.#e){let s=ber;if(this.#t.serverMaxWindowBits){if(!_er(this.#t.serverMaxWindowBits)){r(new Error("Invalid server_max_window_bits"));return}s=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=Eer({windowBits:s})}catch(i){r(i);return}this.#e[Wie]=[],this.#e[fY]=0,this.#e.on("data",i=>{if(this.#e[fY]+=i.length,this.#n>0&&this.#e[fY]>this.#n){r(new Ser),this.#e.removeAllListeners(),this.#e=null;return}this.#e[Wie].push(i)}),this.#e.on("error",i=>{this.#e=null,r(i)})}this.#e.write(e),n&&this.#e.write(Cer),this.#e.flush(()=>{if(!this.#e)return;let s=Buffer.concat(this.#e[Wie],this.#e[fY]);this.#e[Wie].length=0,this.#e[fY]=0,r(null,s)})}};Eyt.exports={PerMessageDeflate:zDe}});var kyt=ee((hXs,Ryt)=>{"use strict";p();var{Writable:Ier}=require("node:stream"),xer=require("node:assert"),{parserStates:Cf,opcodes:EU,states:wer,emptyBuffer:_yt,sentCloseFrameState:Syt}=J1(),{kReadyState:Ter,kSentClose:Cyt,kResponse:Iyt,kReceivedClose:xyt}=cY(),{channels:qie}=RQ(),{isValidStatusCode:ver,isValidOpcode:Rer,failWebsocketConnection:$g,websocketMessageReceived:wyt,utf8Decode:ker,isControlFrame:JDe,isTextBinaryFrame:XDe,isContinuationFrame:Ner}=dY(),{WebsocketFrameSend:Tyt}=Uie(),{closeWebSocketConnection:vyt}=KDe(),{PerMessageDeflate:Der}=byt(),{MessageSizeExceededError:ZDe}=Do();function gY(t,e,n){vyt(t,e,n,Buffer.byteLength(n)),$g(t,n)}var e1e=class extends Ier{#e=[];#t=0;#n=0;#r=!1;#i=Cf.INFO;#s={};#c=[];#o;#a;#l;constructor(e,n,r={}){super(),this.ws=e,this.#o=n??new Map,this.#a=r.maxFragments??0,this.#l=r.maxPayloadSize??0,this.#o.has("permessage-deflate")&&this.#o.set("permessage-deflate",new Der(n,r))}_write(e,n,r){this.#e.push(e),this.#n+=e.length,this.#r=!0,this.run(r)}#p(){return this.#l>0&&!JDe(this.#s.opcode)&&this.#s.payloadLength+this.#t>this.#l?(gY(this.ws,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#r;)if(this.#i===Cf.INFO){if(this.#n<2)return e();let n=this.consume(2),r=(n[0]&128)!==0,s=n[0]&15,i=(n[1]&128)===128,o=!r&&s!==EU.CONTINUATION,a=n[1]&127,c=n[0]&64,u=n[0]&32,l=n[0]&16;if(!Rer(s))return $g(this.ws,"Invalid opcode received"),e();if(i)return $g(this.ws,"Frame cannot be masked"),e();if(c!==0&&!this.#o.has("permessage-deflate")){$g(this.ws,"Expected RSV1 to be clear.");return}if(u!==0||l!==0){$g(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(o&&!XDe(s)){$g(this.ws,"Invalid frame type was fragmented.");return}if(XDe(s)&&this.#c.length>0){$g(this.ws,"Expected continuation frame");return}if(this.#s.fragmented&&o){$g(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((a>125||o)&&JDe(s)){$g(this.ws,"Control frame either too large or fragmented");return}if(Ner(s)&&this.#c.length===0&&!this.#s.compressed){$g(this.ws,"Unexpected continuation frame");return}if(a<=125){if(this.#s.payloadLength=a,this.#i=Cf.READ_DATA,!this.#p())return}else a===126?this.#i=Cf.PAYLOADLENGTH_16:a===127&&(this.#i=Cf.PAYLOADLENGTH_64);XDe(s)&&(this.#s.binaryType=s,this.#s.compressed=c!==0),this.#s.opcode=s,this.#s.masked=i,this.#s.fin=r,this.#s.fragmented=o}else if(this.#i===Cf.PAYLOADLENGTH_16){if(this.#n<2)return e();let n=this.consume(2);if(this.#s.payloadLength=n.readUInt16BE(0),this.#i=Cf.READ_DATA,!this.#p())return}else if(this.#i===Cf.PAYLOADLENGTH_64){if(this.#n<8)return e();let n=this.consume(8),r=n.readUInt32BE(0),s=n.readUInt32BE(4);if(r!==0||s>2**31-1){$g(this.ws,"Received payload length > 2^31 bytes.");return}if(this.#s.payloadLength=s,this.#i=Cf.READ_DATA,!this.#p())return}else if(this.#i===Cf.READ_DATA){if(this.#n{if(r){let i=r instanceof ZDe?1009:1007;gY(this.ws,i,r.message);return}if(this.writeFragments(s)){if(this.#l>0&&this.#t>this.#l){gY(this.ws,1009,new ZDe().message);return}if(!this.#s.fin){this.#i=Cf.INFO,this.#r=!0,this.run(e);return}wyt(this.ws,this.#s.binaryType,this.consumeFragments()),this.#r=!0,this.#i=Cf.INFO,this.run(e)}}),this.#r=!1;break}else{if(!this.writeFragments(n))return;if(this.#l>0&&this.#t>this.#l){gY(this.ws,1009,new ZDe().message);return}!this.#s.fragmented&&this.#s.fin&&wyt(this.ws,this.#s.binaryType,this.consumeFragments()),this.#i=Cf.INFO}}}consume(e){if(e>this.#n)throw new Error("Called consume() before buffers satiated.");if(e===0)return _yt;if(this.#e[0].length===e)return this.#n-=this.#e[0].length,this.#e.shift();let n=Buffer.allocUnsafe(e),r=0;for(;r!==e;){let s=this.#e[0],{length:i}=s;if(i+r===e){n.set(this.#e.shift(),r);break}else if(i+r>e){n.set(s.subarray(0,e-r),r),this.#e[0]=s.subarray(e-r);break}else n.set(this.#e.shift(),r),r+=s.length}return this.#n-=e,n}writeFragments(e){return this.#a>0&&this.#c.length===this.#a?(gY(this.ws,1008,"Too many message fragments"),!1):(this.#t+=e.length,this.#c.push(e),!0)}consumeFragments(){let e=this.#c;if(e.length===1)return this.#t=0,e.shift();let n=Buffer.concat(e,this.#t);return this.#c=[],this.#t=0,n}parseCloseBody(e){xer(e.length!==1);let n;if(e.length>=2&&(n=e.readUInt16BE(0)),n!==void 0&&!ver(n))return{code:1002,reason:"Invalid status code",error:!0};let r=e.subarray(2);r[0]===239&&r[1]===187&&r[2]===191&&(r=r.subarray(3));try{r=ker(r)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:n,reason:r,error:!1}}parseControlFrame(e){let{opcode:n,payloadLength:r}=this.#s;if(n===EU.CLOSE){if(r===1)return $g(this.ws,"Received close frame with a 1-byte body."),!1;if(this.#s.closeInfo=this.parseCloseBody(e),this.#s.closeInfo.error){let{code:s,reason:i}=this.#s.closeInfo;return vyt(this.ws,s,i,i.length),$g(this.ws,i),!1}if(this.ws[Cyt]!==Syt.SENT){let s=_yt;this.#s.closeInfo.code&&(s=Buffer.allocUnsafe(2),s.writeUInt16BE(this.#s.closeInfo.code,0));let i=new Tyt(s);this.ws[Iyt].socket.write(i.createFrame(EU.CLOSE),o=>{o||(this.ws[Cyt]=Syt.SENT)})}return this.ws[Ter]=wer.CLOSING,this.ws[xyt]=!0,!1}else if(n===EU.PING){if(!this.ws[xyt]){let s=new Tyt(e);this.ws[Iyt].socket.write(s.createFrame(EU.PONG)),qie.ping.hasSubscribers&&qie.ping.publish({payload:e})}}else n===EU.PONG&&qie.pong.hasSubscribers&&qie.pong.publish({payload:e});return!0}get closingInfo(){return this.#s.closeInfo}};Ryt.exports={ByteParser:e1e}});var Oyt=ee((fXs,Pyt)=>{"use strict";p();var{WebsocketFrameSend:Ber}=Uie(),{opcodes:Nyt,sendHints:bU}=J1(),Per=cNe(),Dyt=Buffer[Symbol.species],t1e=class{#e=new Per;#t=!1;#n;constructor(e){this.#n=e}add(e,n,r){if(r!==bU.blob){let i=Byt(e,r);if(!this.#t)this.#n.write(i,n);else{let o={promise:null,callback:n,frame:i};this.#e.push(o)}return}let s={promise:e.arrayBuffer().then(i=>{s.promise=null,s.frame=Byt(i,r)}),callback:n,frame:null};this.#e.push(s),this.#t||this.#r()}async#r(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let n=e.shift();n.promise!==null&&await n.promise,this.#n.write(n.frame,n.callback),n.callback=n.frame=null}this.#t=!1}};function Byt(t,e){return new Ber(Oer(t,e)).createFrame(e===bU.string?Nyt.TEXT:Nyt.BINARY)}function Oer(t,e){switch(e){case bU.string:return Buffer.from(t);case bU.arrayBuffer:case bU.blob:return new Dyt(t);case bU.typedArray:return new Dyt(t.buffer,t.byteOffset,t.byteLength)}}Pyt.exports={SendQueue:t1e}});var Hyt=ee((AXs,qyt)=>{"use strict";p();var{webidl:Us}=Cp(),{URLSerializer:Mer}=yf(),{environmentSettingsObject:Myt}=Bg(),{staticPropertyDescriptors:Pv,states:AY,sentCloseFrameState:Ler,sendHints:Hie}=J1(),{kWebSocketURL:Lyt,kReadyState:n1e,kController:Fyt,kBinaryType:Vie,kResponse:Qyt,kSentClose:Fer,kByteParser:Qer}=cY(),{isConnecting:Uer,isEstablished:$er,isClosing:Ger,isValidSubprotocol:Wer,fireEvent:Uyt}=dY(),{establishWebSocketConnection:qer,closeWebSocketConnection:$yt}=KDe(),{ByteParser:Her}=kyt(),{kEnumerableProperty:Ly,isBlobLike:Gyt}=Wi(),{getGlobalDispatcher:Ver}=aie(),{types:Wyt}=require("node:util"),{ErrorEvent:jer,CloseEvent:Yer}=gU(),{SendQueue:Ker}=Oyt(),Gg=class t extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n="";#r="";#i;constructor(e,n=[]){super(),Us.util.markAsUncloneable(this);let r="WebSocket constructor";Us.argumentLengthCheck(arguments,1,r);let s=Us.converters["DOMString or sequence or WebSocketInit"](n,r,"options");e=Us.converters.USVString(e,r,"url"),n=s.protocols;let i=Myt.settingsObject.baseUrl,o;try{o=new URL(e,i)}catch(c){throw new DOMException(c,"SyntaxError")}if(o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),o.protocol!=="ws:"&&o.protocol!=="wss:")throw new DOMException(`Expected a ws: or wss: protocol, got ${o.protocol}`,"SyntaxError");if(o.hash||o.href.endsWith("#"))throw new DOMException("Got fragment","SyntaxError");if(typeof n=="string"&&(n=[n]),n.length!==new Set(n.map(c=>c.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(n.length>0&&!n.every(c=>Wer(c)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[Lyt]=new URL(o.href);let a=Myt.settingsObject;this[Fyt]=qer(o,n,a,this,(c,u)=>this.#s(c,u),s),this[n1e]=t.CONNECTING,this[Fer]=Ler.NOT_SENT,this[Vie]="blob"}close(e=void 0,n=void 0){Us.brandCheck(this,t);let r="WebSocket.close";if(e!==void 0&&(e=Us.converters["unsigned short"](e,r,"code",{clamp:!0})),n!==void 0&&(n=Us.converters.USVString(n,r,"reason")),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new DOMException("invalid code","InvalidAccessError");let s=0;if(n!==void 0&&(s=Buffer.byteLength(n),s>123))throw new DOMException(`Reason must be less than 123 bytes; received ${s}`,"SyntaxError");$yt(this,e,n,s)}send(e){Us.brandCheck(this,t);let n="WebSocket.send";if(Us.argumentLengthCheck(arguments,1,n),e=Us.converters.WebSocketSendData(e,n,"data"),Uer(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!$er(this)||Ger(this)))if(typeof e=="string"){let r=Buffer.byteLength(e);this.#t+=r,this.#i.add(e,()=>{this.#t-=r},Hie.string)}else Wyt.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Hie.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Hie.typedArray)):Gyt(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Hie.blob))}get readyState(){return Us.brandCheck(this,t),this[n1e]}get bufferedAmount(){return Us.brandCheck(this,t),this.#t}get url(){return Us.brandCheck(this,t),Mer(this[Lyt])}get extensions(){return Us.brandCheck(this,t),this.#r}get protocol(){return Us.brandCheck(this,t),this.#n}get onopen(){return Us.brandCheck(this,t),this.#e.open}set onopen(e){Us.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return Us.brandCheck(this,t),this.#e.error}set onerror(e){Us.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return Us.brandCheck(this,t),this.#e.close}set onclose(e){Us.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return Us.brandCheck(this,t),this.#e.message}set onmessage(e){Us.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return Us.brandCheck(this,t),this[Vie]}set binaryType(e){Us.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[Vie]="blob":this[Vie]=e}#s(e,n){this[Qyt]=e;let r=this[Fyt]?.dispatcher?.webSocketOptions,s=r?.maxFragments,i=r?.maxPayloadSize,o=new Her(this,n,{maxFragments:s,maxPayloadSize:i});o.on("drain",zer),o.on("error",Jer.bind(this)),e.socket.ws=this,this[Qer]=o,this.#i=new Ker(e.socket),this[n1e]=AY.OPEN;let a=e.headersList.get("sec-websocket-extensions");a!==null&&(this.#r=a);let c=e.headersList.get("sec-websocket-protocol");c!==null&&(this.#n=c),Uyt("open",this)}};Gg.CONNECTING=Gg.prototype.CONNECTING=AY.CONNECTING;Gg.OPEN=Gg.prototype.OPEN=AY.OPEN;Gg.CLOSING=Gg.prototype.CLOSING=AY.CLOSING;Gg.CLOSED=Gg.prototype.CLOSED=AY.CLOSED;Object.defineProperties(Gg.prototype,{CONNECTING:Pv,OPEN:Pv,CLOSING:Pv,CLOSED:Pv,url:Ly,readyState:Ly,bufferedAmount:Ly,onopen:Ly,onerror:Ly,onclose:Ly,close:Ly,onmessage:Ly,binaryType:Ly,send:Ly,extensions:Ly,protocol:Ly,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Gg,{CONNECTING:Pv,OPEN:Pv,CLOSING:Pv,CLOSED:Pv});Us.converters["sequence"]=Us.sequenceConverter(Us.converters.DOMString);Us.converters["DOMString or sequence"]=function(t,e,n){return Us.util.Type(t)==="Object"&&Symbol.iterator in t?Us.converters["sequence"](t):Us.converters.DOMString(t,e,n)};Us.converters.WebSocketInit=Us.dictionaryConverter([{key:"protocols",converter:Us.converters["DOMString or sequence"],defaultValue:()=>new Array(0)},{key:"dispatcher",converter:Us.converters.any,defaultValue:()=>Ver()},{key:"headers",converter:Us.nullableConverter(Us.converters.HeadersInit)}]);Us.converters["DOMString or sequence or WebSocketInit"]=function(t){return Us.util.Type(t)==="Object"&&!(Symbol.iterator in t)?Us.converters.WebSocketInit(t):{protocols:Us.converters["DOMString or sequence"](t)}};Us.converters.WebSocketSendData=function(t){if(Us.util.Type(t)==="Object"){if(Gyt(t))return Us.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||Wyt.isArrayBuffer(t))return Us.converters.BufferSource(t)}return Us.converters.USVString(t)};function zer(){this.ws[Qyt].socket.resume()}function Jer(t){let e,n;t instanceof Yer?(e=t.reason,n=t.code):e=t.message,Uyt("error",this,()=>new jer("error",{error:t,message:e})),$yt(this,n)}qyt.exports={WebSocket:Gg}});var r1e=ee((EXs,Vyt)=>{"use strict";p();function Xer(t){return t.indexOf("\0")===-1}function Zer(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}function etr(t){return new Promise(e=>{setTimeout(e,t).unref()})}Vyt.exports={isValidLastEventId:Xer,isASCIINumber:Zer,delay:etr}});var zyt=ee((_Xs,Kyt)=>{"use strict";p();var{Transform:ttr}=require("node:stream"),{isASCIINumber:jyt,isValidLastEventId:Yyt}=r1e(),gx=[239,187,191],s1e=10,jie=13,ntr=58,rtr=32,i1e=class extends ttr{state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,n,r){if(e.length===0){r();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===gx[0]){r();return}this.checkBOM=!1,r();return;case 2:if(this.buffer[0]===gx[0]&&this.buffer[1]===gx[1]){r();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===gx[0]&&this.buffer[1]===gx[1]&&this.buffer[2]===gx[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,r();return}this.checkBOM=!1;break;default:this.buffer[0]===gx[0]&&this.buffer[1]===gx[1]&&this.buffer[2]===gx[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(n[s]=i);break}}processEvent(e){e.retry&&jyt(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&Yyt(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};Kyt.exports={EventSourceStream:i1e}});var sEt=ee((CXs,rEt)=>{"use strict";p();var{pipeline:str}=require("node:stream"),{fetching:itr}=sY(),{makeRequest:otr}=uU(),{webidl:Ax}=Cp(),{EventSourceStream:atr}=zyt(),{parseMIMEType:ctr}=yf(),{createFastMessageEvent:ltr}=gU(),{isNetworkError:Jyt}=nY(),{delay:utr}=r1e(),{kEnumerableProperty:X1}=Wi(),{environmentSettingsObject:Xyt}=Bg(),Zyt=!1,eEt=3e3,yY=0,tEt=1,EY=2,dtr="anonymous",ptr="use-credentials",_U=class t extends EventTarget{#e={open:null,error:null,message:null};#t=null;#n=!1;#r=yY;#i=null;#s=null;#c;#o;constructor(e,n={}){super(),Ax.util.markAsUncloneable(this);let r="EventSource constructor";Ax.argumentLengthCheck(arguments,1,r),Zyt||(Zyt=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=Ax.converters.USVString(e,r,"url"),n=Ax.converters.EventSourceInitDict(n,r,"eventSourceInitDict"),this.#c=n.dispatcher,this.#o={lastEventId:"",reconnectionTime:eEt};let s=Xyt,i;try{i=new URL(e,s.settingsObject.baseUrl),this.#o.origin=i.origin}catch(c){throw new DOMException(c,"SyntaxError")}this.#t=i.href;let o=dtr;n.withCredentials&&(o=ptr,this.#n=!0);let a={redirect:"follow",keepalive:!0,mode:"cors",credentials:o==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};a.client=Xyt.settingsObject,a.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],a.cache="no-store",a.initiator="other",a.urlList=[new URL(this.#t)],this.#i=otr(a),this.#a()}get readyState(){return this.#r}get url(){return this.#t}get withCredentials(){return this.#n}#a(){if(this.#r===EY)return;this.#r=yY;let e={request:this.#i,dispatcher:this.#c},n=r=>{Jyt(r)&&(this.dispatchEvent(new Event("error")),this.close()),this.#l()};e.processResponseEndOfBody=n,e.processResponse=r=>{if(Jyt(r))if(r.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#l();return}let s=r.headersList.get("content-type",!0),i=s!==null?ctr(s):"failure",o=i!=="failure"&&i.essence==="text/event-stream";if(r.status!==200||o===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#r=tEt,this.dispatchEvent(new Event("open")),this.#o.origin=r.urlList[r.urlList.length-1].origin;let a=new atr({eventSourceSettings:this.#o,push:c=>{this.dispatchEvent(ltr(c.type,c.options))}});str(r.body.stream,a,c=>{c?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#s=itr(e)}async#l(){this.#r!==EY&&(this.#r=yY,this.dispatchEvent(new Event("error")),await utr(this.#o.reconnectionTime),this.#r===yY&&(this.#o.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#o.lastEventId,!0),this.#a()))}close(){Ax.brandCheck(this,t),this.#r!==EY&&(this.#r=EY,this.#s.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}},nEt={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:yY,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:tEt,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:EY,writable:!1}};Object.defineProperties(_U,nEt);Object.defineProperties(_U.prototype,nEt);Object.defineProperties(_U.prototype,{close:X1,onerror:X1,onmessage:X1,onopen:X1,readyState:X1,url:X1,withCredentials:X1});Ax.converters.EventSourceInitDict=Ax.dictionaryConverter([{key:"withCredentials",converter:Ax.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:Ax.converters.any}]);rEt.exports={EventSource:_U,defaultReconnectionTime:eEt}});var zie=ee((xXs,Rs)=>{"use strict";p();var htr=KQ(),iEt=Sj(),mtr=zQ(),ftr=nmt(),gtr=JQ(),Atr=vNe(),ytr=wmt(),Etr=Dmt(),oEt=Do(),Kie=Wi(),{InvalidArgumentError:Yie}=oEt,SU=yft(),btr=Ij(),_tr=lDe(),Str=egt(),Ctr=pDe(),Itr=zNe(),xtr=Jse(),{getGlobalDispatcher:aEt,setGlobalDispatcher:wtr}=aie(),Ttr=cie(),vtr=Use(),Rtr=$se();Object.assign(iEt.prototype,SU);Rs.exports.Dispatcher=iEt;Rs.exports.Client=htr;Rs.exports.Pool=mtr;Rs.exports.BalancedPool=ftr;Rs.exports.Agent=gtr;Rs.exports.ProxyAgent=Atr;Rs.exports.EnvHttpProxyAgent=ytr;Rs.exports.RetryAgent=Etr;Rs.exports.RetryHandler=xtr;Rs.exports.DecoratorHandler=Ttr;Rs.exports.RedirectHandler=vtr;Rs.exports.createRedirectInterceptor=Rtr;Rs.exports.interceptors={redirect:agt(),retry:lgt(),dump:dgt(),dns:mgt()};Rs.exports.buildConnector=btr;Rs.exports.errors=oEt;Rs.exports.util={parseHeaders:Kie.parseHeaders,headerNameToString:Kie.headerNameToString};function bY(t){return(e,n,r)=>{if(typeof n=="function"&&(r=n,n=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new Yie("invalid url");if(n!=null&&typeof n!="object")throw new Yie("invalid opts");if(n&&n.path!=null){if(typeof n.path!="string")throw new Yie("invalid opts.path");let o=n.path;n.path.startsWith("/")||(o=`/${o}`),e=new URL(Kie.parseOrigin(e).origin+o)}else n||(n=typeof e=="object"?e:{}),e=Kie.parseURL(e);let{agent:s,dispatcher:i=aEt()}=n;if(s)throw new Yie("unsupported opts.agent. Did you mean opts.client?");return t.call(i,{...n,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:n.method||(n.body?"PUT":"GET")},r)}}Rs.exports.setGlobalDispatcher=wtr;Rs.exports.getGlobalDispatcher=aEt;var ktr=sY().fetch;Rs.exports.fetch=async function(e,n=void 0){try{return await ktr(e,n)}catch(r){throw r&&typeof r=="object"&&Error.captureStackTrace(r),r}};Rs.exports.Headers=H1().Headers;Rs.exports.Response=nY().Response;Rs.exports.Request=uU().Request;Rs.exports.FormData=Nj().FormData;Rs.exports.File=globalThis.File??require("node:buffer").File;Rs.exports.FileReader=kAt().FileReader;var{setGlobalOrigin:Ntr,getGlobalOrigin:Dtr}=Rke();Rs.exports.setGlobalOrigin=Ntr;Rs.exports.getGlobalOrigin=Dtr;var{CacheStorage:Btr}=QAt(),{kConstruct:Ptr}=Rie();Rs.exports.caches=new Btr(Ptr);var{deleteCookie:Otr,getCookies:Mtr,getSetCookies:Ltr,setCookie:Ftr}=JAt();Rs.exports.deleteCookie=Otr;Rs.exports.getCookies=Mtr;Rs.exports.getSetCookies=Ltr;Rs.exports.setCookie=Ftr;var{parseMIMEType:Qtr,serializeAMimeType:Utr}=yf();Rs.exports.parseMIMEType=Qtr;Rs.exports.serializeAMimeType=Utr;var{CloseEvent:$tr,ErrorEvent:Gtr,MessageEvent:Wtr}=gU();Rs.exports.WebSocket=Hyt().WebSocket;Rs.exports.CloseEvent=$tr;Rs.exports.ErrorEvent=Gtr;Rs.exports.MessageEvent=Wtr;Rs.exports.request=bY(SU.request);Rs.exports.stream=bY(SU.stream);Rs.exports.pipeline=bY(SU.pipeline);Rs.exports.connect=bY(SU.connect);Rs.exports.upgrade=bY(SU.upgrade);Rs.exports.MockClient=_tr;Rs.exports.MockPool=Ctr;Rs.exports.MockAgent=Str;Rs.exports.mockErrors=Itr;var{EventSource:qtr}=sEt();Rs.exports.EventSource=qtr});var bEt=ee(ioe=>{"use strict";p();Object.defineProperty(ioe,"__esModule",{value:!0});ioe.getProxyUrl=hnr;ioe.checkBypass=EEt;function hnr(t){let e=t.protocol==="https:";if(EEt(t))return;let n=e?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(n)try{return new soe(n)}catch{if(!n.startsWith("http://")&&!n.startsWith("https://"))return new soe(`http://${n}`)}else return}function EEt(t){if(!t.hostname)return!1;let e=t.hostname;if(mnr(e))return!0;let n=process.env.no_proxy||process.env.NO_PROXY||"";if(!n)return!1;let r;t.port?r=Number(t.port):t.protocol==="http:"?r=80:t.protocol==="https:"&&(r=443);let s=[t.hostname.toUpperCase()];typeof r=="number"&&s.push(`${s[0]}:${r}`);for(let i of n.split(",").map(o=>o.trim().toUpperCase()).filter(o=>o))if(i==="*"||s.some(o=>o===i||o.endsWith(`.${i}`)||i.startsWith(".")&&o.endsWith(`${i}`)))return!0;return!1}function mnr(t){let e=t.toLowerCase();return e==="localhost"||e.startsWith("127.")||e.startsWith("[::1]")||e.startsWith("[0:0:0:0:0:0:0:1]")}var soe=class extends URL{constructor(e,n){super(e,n),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}});var SEt=ee(Oc=>{"use strict";p();var fnr=Oc&&Oc.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),gnr=Oc&&Oc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),loe=Oc&&Oc.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[r.length]=s);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),s=0;sau(this,void 0,void 0,function*(){let n=Buffer.alloc(0);this.message.on("data",r=>{n=Buffer.concat([n,r])}),this.message.on("end",()=>{e(n.toString())})}))})}readBodyBuffer(){return au(this,void 0,void 0,function*(){return new Promise(e=>au(this,void 0,void 0,function*(){let n=[];this.message.on("data",r=>{n.push(r)}),this.message.on("end",()=>{e(Buffer.concat(n))})}))})}};Oc.HttpClientResponse=coe;function Inr(t){return new URL(t).protocol==="https:"}var f1e=class{constructor(e,n,r){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=this._getUserAgentWithOrchestrationId(e),this.handlers=n||[],this.requestOptions=r,r&&(r.ignoreSslError!=null&&(this._ignoreSslError=r.ignoreSslError),this._socketTimeout=r.socketTimeout,r.allowRedirects!=null&&(this._allowRedirects=r.allowRedirects),r.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=r.allowRedirectDowngrade),r.maxRedirects!=null&&(this._maxRedirects=Math.max(r.maxRedirects,0)),r.keepAlive!=null&&(this._keepAlive=r.keepAlive),r.allowRetries!=null&&(this._allowRetries=r.allowRetries),r.maxRetries!=null&&(this._maxRetries=r.maxRetries))}options(e,n){return au(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,n||{})})}get(e,n){return au(this,void 0,void 0,function*(){return this.request("GET",e,null,n||{})})}del(e,n){return au(this,void 0,void 0,function*(){return this.request("DELETE",e,null,n||{})})}post(e,n,r){return au(this,void 0,void 0,function*(){return this.request("POST",e,n,r||{})})}patch(e,n,r){return au(this,void 0,void 0,function*(){return this.request("PATCH",e,n,r||{})})}put(e,n,r){return au(this,void 0,void 0,function*(){return this.request("PUT",e,n,r||{})})}head(e,n){return au(this,void 0,void 0,function*(){return this.request("HEAD",e,null,n||{})})}sendStream(e,n,r,s){return au(this,void 0,void 0,function*(){return this.request(e,n,r,s)})}getJson(e){return au(this,arguments,void 0,function*(n,r={}){r[pm.Accept]=this._getExistingOrDefaultHeader(r,pm.Accept,yx.ApplicationJson);let s=yield this.get(n,r);return this._processResponse(s,this.requestOptions)})}postJson(e,n){return au(this,arguments,void 0,function*(r,s,i={}){let o=JSON.stringify(s,null,2);i[pm.Accept]=this._getExistingOrDefaultHeader(i,pm.Accept,yx.ApplicationJson),i[pm.ContentType]=this._getExistingOrDefaultContentTypeHeader(i,yx.ApplicationJson);let a=yield this.post(r,o,i);return this._processResponse(a,this.requestOptions)})}putJson(e,n){return au(this,arguments,void 0,function*(r,s,i={}){let o=JSON.stringify(s,null,2);i[pm.Accept]=this._getExistingOrDefaultHeader(i,pm.Accept,yx.ApplicationJson),i[pm.ContentType]=this._getExistingOrDefaultContentTypeHeader(i,yx.ApplicationJson);let a=yield this.put(r,o,i);return this._processResponse(a,this.requestOptions)})}patchJson(e,n){return au(this,arguments,void 0,function*(r,s,i={}){let o=JSON.stringify(s,null,2);i[pm.Accept]=this._getExistingOrDefaultHeader(i,pm.Accept,yx.ApplicationJson),i[pm.ContentType]=this._getExistingOrDefaultContentTypeHeader(i,yx.ApplicationJson);let a=yield this.patch(r,o,i);return this._processResponse(a,this.requestOptions)})}request(e,n,r,s){return au(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let i=new URL(n),o=this._prepareRequest(e,i,s),a=this._allowRetries&&_nr.includes(e)?this._maxRetries+1:1,c=0,u;do{if(u=yield this.requestRaw(o,r),u&&u.message&&u.message.statusCode===Fy.Unauthorized){let d;for(let h of this.handlers)if(h.canHandleAuthentication(u)){d=h;break}return d?d.handleAuthentication(this,o,r):u}let l=this._maxRedirects;for(;u.message.statusCode&&Enr.includes(u.message.statusCode)&&this._allowRedirects&&l>0;){let d=u.message.headers.location;if(!d)break;let h=new URL(d);if(i.protocol==="https:"&&i.protocol!==h.protocol&&!this._allowRedirectDowngrade)throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(yield u.readBody(),h.hostname!==i.hostname)for(let m in s)m.toLowerCase()==="authorization"&&delete s[m];o=this._prepareRequest(e,h,s),u=yield this.requestRaw(o,r),l--}if(!u.message.statusCode||!bnr.includes(u.message.statusCode))return u;c+=1,c{function i(o,a){o?s(o):a?r(a):s(new Error("Unknown error"))}this.requestRawWithCallback(e,n,i)})})}requestRawWithCallback(e,n,r){typeof n=="string"&&(e.options.headers||(e.options.headers={}),e.options.headers["Content-Length"]=Buffer.byteLength(n,"utf8"));let s=!1;function i(c,u){s||(s=!0,r(c,u))}let o=e.httpModule.request(e.options,c=>{let u=new coe(c);i(void 0,u)}),a;o.on("socket",c=>{a=c}),o.setTimeout(this._socketTimeout||3*6e4,()=>{a&&a.end(),i(new Error(`Request timeout: ${e.options.path}`))}),o.on("error",function(c){i(c)}),n&&typeof n=="string"&&o.write(n,"utf8"),n&&typeof n!="string"?(n.on("close",function(){o.end()}),n.pipe(o)):o.end()}getAgent(e){let n=new URL(e);return this._getAgent(n)}getAgentDispatcher(e){let n=new URL(e),r=m1e.getProxyUrl(n);if(r&&r.hostname)return this._getProxyAgentDispatcher(n,r)}_prepareRequest(e,n,r){let s={};s.parsedUrl=n;let i=s.parsedUrl.protocol==="https:";s.httpModule=i?_Et:h1e;let o=i?443:80;if(s.options={},s.options.host=s.parsedUrl.hostname,s.options.port=s.parsedUrl.port?parseInt(s.parsedUrl.port):o,s.options.path=(s.parsedUrl.pathname||"")+(s.parsedUrl.search||""),s.options.method=e,s.options.headers=this._mergeHeaders(r),this.userAgent!=null&&(s.options.headers["user-agent"]=this.userAgent),s.options.agent=this._getAgent(s.parsedUrl),this.handlers)for(let a of this.handlers)a.prepareRequest(s.options);return s}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},CY(this.requestOptions.headers),CY(e||{})):CY(e||{})}_getExistingOrDefaultHeader(e,n,r){let s;if(this.requestOptions&&this.requestOptions.headers){let o=CY(this.requestOptions.headers)[n];o&&(s=typeof o=="number"?o.toString():o)}let i=e[n];return i!==void 0?typeof i=="number"?i.toString():i:s!==void 0?s:r}_getExistingOrDefaultContentTypeHeader(e,n){let r;if(this.requestOptions&&this.requestOptions.headers){let i=CY(this.requestOptions.headers)[pm.ContentType];i&&(typeof i=="number"?r=String(i):Array.isArray(i)?r=i.join(", "):r=i)}let s=e[pm.ContentType];return s!==void 0?typeof s=="number"?String(s):Array.isArray(s)?s.join(", "):s:r!==void 0?r:n}_getAgent(e){let n,r=m1e.getProxyUrl(e),s=r&&r.hostname;if(this._keepAlive&&s&&(n=this._proxyAgent),s||(n=this._agent),n)return n;let i=e.protocol==="https:",o=100;if(this.requestOptions&&(o=this.requestOptions.maxSockets||h1e.globalAgent.maxSockets),r&&r.hostname){let a={maxSockets:o,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})},c,u=r.protocol==="https:";i?c=u?ooe.httpsOverHttps:ooe.httpsOverHttp:c=u?ooe.httpOverHttps:ooe.httpOverHttp,n=c(a),this._proxyAgent=n}if(!n){let a={keepAlive:this._keepAlive,maxSockets:o};n=i?new _Et.Agent(a):new h1e.Agent(a),this._agent=n}return i&&this._ignoreSslError&&(n.options=Object.assign(n.options||{},{rejectUnauthorized:!1})),n}_getProxyAgentDispatcher(e,n){let r;if(this._keepAlive&&(r=this._proxyAgentDispatcher),r)return r;let s=e.protocol==="https:";return r=new Anr.ProxyAgent(Object.assign({uri:n.href,pipelining:this._keepAlive?1:0},(n.username||n.password)&&{token:`Basic ${Buffer.from(`${n.username}:${n.password}`).toString("base64")}`})),this._proxyAgentDispatcher=r,s&&this._ignoreSslError&&(r.options=Object.assign(r.options.requestTls||{},{rejectUnauthorized:!1})),r}_getUserAgentWithOrchestrationId(e){let n=e||"actions/http-client",r=process.env.ACTIONS_ORCHESTRATION_ID;if(r){let s=r.replace(/[^a-z0-9_.-]/gi,"_");return`${n} actions_orchestration_id/${s}`}return n}_performExponentialBackoff(e){return au(this,void 0,void 0,function*(){e=Math.min(Snr,e);let n=Cnr*Math.pow(2,e);return new Promise(r=>setTimeout(()=>r(),n))})}_processResponse(e,n){return au(this,void 0,void 0,function*(){return new Promise((r,s)=>au(this,void 0,void 0,function*(){let i=e.message.statusCode||0,o={statusCode:i,result:null,headers:{}};i===Fy.NotFound&&r(o);function a(l,d){if(typeof d=="string"){let h=new Date(d);if(!isNaN(h.valueOf()))return h}return d}let c,u;try{u=yield e.readBody(),u&&u.length>0&&(n&&n.deserializeDates?c=JSON.parse(u,a):c=JSON.parse(u),o.result=c),o.headers=e.message.headers}catch{}if(i>299){let l;c&&c.message?l=c.message:u&&u.length>0?l=u:l=`Failed request: (${i})`;let d=new aoe(l,i);d.result=o.result,s(d)}else r(o)}))})}};Oc.HttpClient=f1e;var CY=t=>Object.keys(t).reduce((e,n)=>(e[n.toLowerCase()]=t[n],e),{})});var jEt=ee(doe=>{"use strict";p();Object.defineProperty(doe,"__esModule",{value:!0});doe.format=Vnr;doe.parse=jnr;var Wnr=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,GEt=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,qnr=/[\\"]/g,Hnr=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,WEt=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function Vnr(t){let{type:e,parameters:n}=t;if(!e||!Hnr.test(e))throw new TypeError(`Invalid type: ${e}`);let r=e;if(n)for(let s of Object.keys(n)){if(!GEt.test(s))throw new TypeError(`Invalid parameter name: ${s}`);r+=`; ${s}=${Jnr(n[s])}`}return r}function jnr(t,e){let n=t.length,r=_1e(t,0,n),s=r;r=b1e(t,r,n);let i=S1e(t,s,r),o=t.slice(s,i).toLowerCase(),a=e?.parameters===!1?new WEt:znr(t,r,n);return{type:o,parameters:a}}var qEt=32,HEt=9,VEt=59,Ynr=61,$Et=34,Knr=92;function znr(t,e,n){let r=new WEt;e:for(;ee;){let r=t.charCodeAt(n-1);if(r!==qEt&&r!==HEt)break;n--}return n}function Jnr(t){if(GEt.test(t))return t;if(Wnr.test(t))return`"${t.replace(qnr,"\\$&")}"`;throw new TypeError(`Invalid parameter value: ${t}`)}});var wY,uS,ybt=V(()=>{p();wY={warningEmitted:!1},uS=t=>{if(t&&!wY.warningEmitted){if(process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED==="true"){wY.warningEmitted=!0;return}let e=parseInt(t.substring(1,t.indexOf("."))),n=22;e{"use strict";p();var KRt=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:TTr}=Jo(),vTr=b$();XRt()===void 0&&JRt(new vTr);function JRt(t){if(!t||typeof t.dispatch!="function")throw new TTr("Argument agent must implement Agent");Object.defineProperty(globalThis,KRt,{value:t,writable:!0,enumerable:!1,configurable:!1})}function XRt(){return globalThis[KRt]}ZRt.exports={setGlobalDispatcher:JRt,getGlobalDispatcher:XRt}});var Jue=re((SNs,ekt)=>{"use strict";p();ekt.exports=class{#e;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}});var nkt=re((INs,tkt)=>{"use strict";p();var RTr=Rue();tkt.exports=t=>{let e=t?.maxRedirections;return n=>function(i,s){let{maxRedirections:o=e,...a}=i;if(!o)return n(i,s);let c=new RTr(n,o,i,s);return n(a,c)}}});var ikt=re((TNs,rkt)=>{"use strict";p();var kTr=Uue();rkt.exports=t=>e=>function(r,i){return e(r,new kTr({...r,retryOptions:{...t,...r.retryOptions}},{handler:i,dispatch:e}))}});var okt=re((RNs,skt)=>{"use strict";p();var BTr=to(),{InvalidArgumentError:NTr,RequestAbortedError:DTr}=Jo(),PTr=Jue(),LFe=class extends PTr{#e=1024*1024;#t=null;#n=!1;#r=!1;#i=0;#s=null;#o=null;constructor({maxSize:e},n){if(super(n),e!=null&&(!Number.isFinite(e)||e<1))throw new NTr("maxSize must be a number greater than 0");this.#e=e??this.#e,this.#o=n}onConnect(e){this.#t=e,this.#o.onConnect(this.#a.bind(this))}#a(e){this.#r=!0,this.#s=e}onHeaders(e,n,r,i){let o=BTr.parseHeaders(n)["content-length"];if(o!=null&&o>this.#e)throw new DTr(`Response size (${o}) larger than maxSize (${this.#e})`);return this.#r?!0:this.#o.onHeaders(e,n,r,i)}onError(e){this.#n||(e=this.#s??e,this.#o.onError(e))}onData(e){return this.#i=this.#i+e.length,this.#i>=this.#e&&(this.#n=!0,this.#r?this.#o.onError(this.#s):this.#o.onComplete([])),!0}onComplete(e){if(!this.#n){if(this.#r){this.#o.onError(this.reason);return}this.#o.onComplete(e)}}};function MTr({maxSize:t}={maxSize:1024*1024}){return e=>function(r,i){let{dumpMaxSize:s=t}=r,o=new LFe({maxSize:s},i);return e(r,o)}}skt.exports=MTr});var lkt=re((BNs,ckt)=>{"use strict";p();var{isIP:OTr}=require("node:net"),{lookup:LTr}=require("node:dns"),FTr=Jue(),{InvalidArgumentError:k$,InformationalError:QTr}=Jo(),akt=Math.pow(2,31)-1,FFe=class{#e=0;#t=0;#n=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#i}get full(){return this.#n.size===this.#t}runLookup(e,n,r){let i=this.#n.get(e.hostname);if(i==null&&this.full){r(null,e.origin);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...n.dns,maxTTL:this.#e,maxItems:this.#t};if(i==null)this.lookup(e,s,(o,a)=>{if(o||a==null||a.length===0){r(o??new QTr("No DNS entries found"));return}this.setRecords(e,a);let c=this.#n.get(e.hostname),u=this.pick(e,c,s.affinity),l;typeof u.port=="number"?l=`:${u.port}`:e.port!==""?l=`:${e.port}`:l="",r(null,`${e.protocol}//${u.family===6?`[${u.address}]`:u.address}${l}`)});else{let o=this.pick(e,i,s.affinity);if(o==null){this.#n.delete(e.hostname),this.runLookup(e,n,r);return}let a;typeof o.port=="number"?a=`:${o.port}`:e.port!==""?a=`:${e.port}`:a="",r(null,`${e.protocol}//${o.family===6?`[${o.address}]`:o.address}${a}`)}}#r(e,n,r){LTr(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(i,s)=>{if(i)return r(i);let o=new Map;for(let a of s)o.set(`${a.address}:${a.family}`,a);r(null,o.values())})}#i(e,n,r){let i=null,{records:s,offset:o}=n,a;if(this.dualStack?(r==null&&(o==null||o===akt?(n.offset=0,r=4):(n.offset++,r=(n.offset&1)===1?6:4)),s[r]!=null&&s[r].ips.length>0?a=s[r]:a=s[r===4?6:4]):a=s[r],a==null||a.ips.length===0)return i;a.offset==null||a.offset===akt?a.offset=0:a.offset++;let c=a.offset%a.ips.length;return i=a.ips[c]??null,i==null?i:Date.now()-i.timestamp>i.ttl?(a.ips.splice(c,1),this.pick(e,n,r)):i}setRecords(e,n){let r=Date.now(),i={records:{4:null,6:null}};for(let s of n){s.timestamp=r,typeof s.ttl=="number"?s.ttl=Math.min(s.ttl,this.#e):s.ttl=this.#e;let o=i.records[s.family]??{ips:[]};o.ips.push(s),i.records[s.family]=o}this.#n.set(e.hostname,i)}getHandler(e,n){return new QFe(this,e,n)}},QFe=class extends FTr{#e=null;#t=null;#n=null;#r=null;#i=null;constructor(e,{origin:n,handler:r,dispatch:i},s){super(r),this.#i=n,this.#r=r,this.#t={...s},this.#e=e,this.#n=i}onError(e){switch(e.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(n,r)=>{if(n)return this.#r.onError(n);let i={...this.#t,origin:r};this.#n(i,this)});return}this.#r.onError(e);return}case"ENOTFOUND":this.#e.deleteRecord(this.#i);default:this.#r.onError(e);break}}};ckt.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new k$("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new k$("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new k$("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new k$("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new k$("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new k$("Invalid pick. Must be a function");let e=t?.dualStack??!0,n;e?n=t?.affinity??null:n=t?.affinity??4;let r={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:n,maxItems:t?.maxItems??1/0},i=new FFe(r);return s=>function(a,c){let u=a.origin.constructor===URL?a.origin:new URL(a.origin);return OTr(u.hostname)!==0?s(a,c):(i.runLookup(u,a,(l,d)=>{if(l)return c.onError(l);let m=null;m={...a,servername:u.hostname,origin:d,headers:{host:u.hostname,...a.headers}},s(m,i.getHandler({origin:u,dispatch:s,handler:c},a))}),!0)}}});var jM=re((DNs,gkt)=>{"use strict";p();var{kConstruct:UTr}=bl(),{kEnumerableProperty:B$}=to(),{iteratorMixin:GTr,isValidHeaderName:Z6,isValidHeaderValue:dkt}=ey(),{webidl:$o}=Sm(),UFe=require("node:assert"),Xue=require("node:util"),bd=Symbol("headers map"),iy=Symbol("headers map sorted");function ukt(t){return t===10||t===13||t===9||t===32}function pkt(t){let e=0,n=t.length;for(;n>e&&ukt(t.charCodeAt(n-1));)--n;for(;n>e&&ukt(t.charCodeAt(e));)++e;return e===0&&n===t.length?t:t.substring(e,n)}function mkt(t,e){if(Array.isArray(e))for(let n=0;n>","record"]})}function GFe(t,e,n){if(n=pkt(n),Z6(e)){if(!dkt(n))throw $o.errors.invalidArgument({prefix:"Headers.append",value:n,type:"header value"})}else throw $o.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(fkt(t)==="immutable")throw new TypeError("immutable");return $Fe(t).append(e,n,!1)}function hkt(t,e){return t[0]>1),n[u][0]<=l[0]?c=u+1:a=u;if(s!==u){for(o=s;o>c;)n[o]=n[--o];n[c]=l}}if(!r.next().done)throw new TypeError("Unreachable");return n}else{let r=0;for(let{0:i,1:{value:s}}of this[bd])n[r++]=[i,s],UFe(s!==null);return n.sort(hkt)}}},T_=class t{#e;#t;constructor(e=void 0){$o.util.markAsUncloneable(this),e!==UTr&&(this.#t=new Zue,this.#e="none",e!==void 0&&(e=$o.converters.HeadersInit(e,"Headers contructor","init"),mkt(this,e)))}append(e,n){$o.brandCheck(this,t),$o.argumentLengthCheck(arguments,2,"Headers.append");let r="Headers.append";return e=$o.converters.ByteString(e,r,"name"),n=$o.converters.ByteString(n,r,"value"),GFe(this,e,n)}delete(e){if($o.brandCheck(this,t),$o.argumentLengthCheck(arguments,1,"Headers.delete"),e=$o.converters.ByteString(e,"Headers.delete","name"),!Z6(e))throw $o.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){$o.brandCheck(this,t),$o.argumentLengthCheck(arguments,1,"Headers.get");let n="Headers.get";if(e=$o.converters.ByteString(e,n,"name"),!Z6(e))throw $o.errors.invalidArgument({prefix:n,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){$o.brandCheck(this,t),$o.argumentLengthCheck(arguments,1,"Headers.has");let n="Headers.has";if(e=$o.converters.ByteString(e,n,"name"),!Z6(e))throw $o.errors.invalidArgument({prefix:n,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,n){$o.brandCheck(this,t),$o.argumentLengthCheck(arguments,2,"Headers.set");let r="Headers.set";if(e=$o.converters.ByteString(e,r,"name"),n=$o.converters.ByteString(n,r,"value"),n=pkt(n),Z6(e)){if(!dkt(n))throw $o.errors.invalidArgument({prefix:r,value:n,type:"header value"})}else throw $o.errors.invalidArgument({prefix:r,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,n,!1)}getSetCookie(){$o.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[iy](){if(this.#t[iy])return this.#t[iy];let e=[],n=this.#t.toSortedArray(),r=this.#t.cookies;if(r===null||r.length===1)return this.#t[iy]=n;for(let i=0;i>"](t,e,n,r.bind(t)):$o.converters["record"](t,e,n)}throw $o.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};gkt.exports={fill:mkt,compareHeaderName:hkt,Headers:T_,HeadersList:Zue,getHeadersGuard:fkt,setHeadersGuard:$Tr,setHeadersList:WTr,getHeadersList:$Fe}});var tz=re((MNs,vkt)=>{"use strict";p();var{Headers:xkt,HeadersList:Akt,fill:HTr,getHeadersGuard:qTr,setHeadersGuard:Skt,setHeadersList:Ckt}=jM(),{extractBody:ykt,cloneBody:jTr,mixinBody:VTr,hasFinalizationRegistry:Ikt,streamRegistry:wkt,bodyUnusable:YTr}=d$(),WFe=to(),Ekt=require("node:util"),{kEnumerableProperty:sy}=WFe,{isValidReasonPhrase:zTr,isCancelled:KTr,isAborted:JTr,isBlobLike:XTr,serializeJavascriptValueToJSONString:ZTr,isErrorLike:evr,isomorphicEncode:tvr,environmentSettingsObject:nvr}=ey(),{redirectStatusSet:rvr,nullBodyStatus:ivr}=C6(),{kState:xl,kHeaders:OT}=e1(),{webidl:Rs}=Sm(),{FormData:svr}=k6(),{URLSerializer:bkt}=Ug(),{kConstruct:tde}=bl(),HFe=require("node:assert"),{types:ovr}=require("node:util"),avr=new TextEncoder("utf-8"),VM=class t{static error(){return ez(nde(),"immutable")}static json(e,n={}){Rs.argumentLengthCheck(arguments,1,"Response.json"),n!==null&&(n=Rs.converters.ResponseInit(n));let r=avr.encode(ZTr(e)),i=ykt(r),s=ez(N$({}),"response");return _kt(s,n,{body:i[0],type:"application/json"}),s}static redirect(e,n=302){Rs.argumentLengthCheck(arguments,1,"Response.redirect"),e=Rs.converters.USVString(e),n=Rs.converters["unsigned short"](n);let r;try{r=new URL(e,nvr.settingsObject.baseUrl)}catch(o){throw new TypeError(`Failed to parse URL from ${e}`,{cause:o})}if(!rvr.has(n))throw new RangeError(`Invalid status code ${n}`);let i=ez(N$({}),"immutable");i[xl].status=n;let s=tvr(bkt(r));return i[xl].headersList.append("location",s,!0),i}constructor(e=null,n={}){if(Rs.util.markAsUncloneable(this),e===tde)return;e!==null&&(e=Rs.converters.BodyInit(e)),n=Rs.converters.ResponseInit(n),this[xl]=N$({}),this[OT]=new xkt(tde),Skt(this[OT],"response"),Ckt(this[OT],this[xl].headersList);let r=null;if(e!=null){let[i,s]=ykt(e);r={body:i,type:s}}_kt(this,n,r)}get type(){return Rs.brandCheck(this,t),this[xl].type}get url(){Rs.brandCheck(this,t);let e=this[xl].urlList,n=e[e.length-1]??null;return n===null?"":bkt(n,!0)}get redirected(){return Rs.brandCheck(this,t),this[xl].urlList.length>1}get status(){return Rs.brandCheck(this,t),this[xl].status}get ok(){return Rs.brandCheck(this,t),this[xl].status>=200&&this[xl].status<=299}get statusText(){return Rs.brandCheck(this,t),this[xl].statusText}get headers(){return Rs.brandCheck(this,t),this[OT]}get body(){return Rs.brandCheck(this,t),this[xl].body?this[xl].body.stream:null}get bodyUsed(){return Rs.brandCheck(this,t),!!this[xl].body&&WFe.isDisturbed(this[xl].body.stream)}clone(){if(Rs.brandCheck(this,t),YTr(this))throw Rs.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=qFe(this[xl]);return Ikt&&this[xl].body?.stream&&wkt.register(this,new WeakRef(this[xl].body.stream)),ez(e,qTr(this[OT]))}[Ekt.inspect.custom](e,n){n.depth===null&&(n.depth=2),n.colors??=!0;let r={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${Ekt.formatWithOptions(n,r)}`}};VTr(VM);Object.defineProperties(VM.prototype,{type:sy,url:sy,status:sy,ok:sy,redirected:sy,statusText:sy,headers:sy,clone:sy,body:sy,bodyUsed:sy,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(VM,{json:sy,redirect:sy,error:sy});function qFe(t){if(t.internalResponse)return Tkt(qFe(t.internalResponse),t.type);let e=N$({...t,body:null});return t.body!=null&&(e.body=jTr(e,t.body)),e}function N$(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new Akt(t?.headersList):new Akt,urlList:t?.urlList?[...t.urlList]:[]}}function nde(t){let e=evr(t);return N$({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}function cvr(t){return t.type==="error"&&t.status===0}function ede(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(n,r){return r in e?e[r]:n[r]},set(n,r,i){return HFe(!(r in e)),n[r]=i,!0}})}function Tkt(t,e){if(e==="basic")return ede(t,{type:"basic",headersList:t.headersList});if(e==="cors")return ede(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return ede(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return ede(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});HFe(!1)}function lvr(t,e=null){return HFe(KTr(t)),JTr(t)?nde(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):nde(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}function _kt(t,e,n){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!zTr(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[xl].status=e.status),"statusText"in e&&e.statusText!=null&&(t[xl].statusText=e.statusText),"headers"in e&&e.headers!=null&&HTr(t[OT],e.headers),n){if(ivr.includes(t.status))throw Rs.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[xl].body=n.body,n.type!=null&&!t[xl].headersList.contains("content-type",!0)&&t[xl].headersList.append("content-type",n.type,!0)}}function ez(t,e){let n=new VM(tde);return n[xl]=t,n[OT]=new xkt(tde),Ckt(n[OT],t.headersList),Skt(n[OT],e),Ikt&&t.body?.stream&&wkt.register(n,new WeakRef(t.body.stream)),n}Rs.converters.ReadableStream=Rs.interfaceConverter(ReadableStream);Rs.converters.FormData=Rs.interfaceConverter(svr);Rs.converters.URLSearchParams=Rs.interfaceConverter(URLSearchParams);Rs.converters.XMLHttpRequestBodyInit=function(t,e,n){return typeof t=="string"?Rs.converters.USVString(t,e,n):XTr(t)?Rs.converters.Blob(t,e,n,{strict:!1}):ArrayBuffer.isView(t)||ovr.isArrayBuffer(t)?Rs.converters.BufferSource(t,e,n):WFe.isFormDataLike(t)?Rs.converters.FormData(t,e,n,{strict:!1}):t instanceof URLSearchParams?Rs.converters.URLSearchParams(t,e,n):Rs.converters.DOMString(t,e,n)};Rs.converters.BodyInit=function(t,e,n){return t instanceof ReadableStream?Rs.converters.ReadableStream(t,e,n):t?.[Symbol.asyncIterator]?t:Rs.converters.XMLHttpRequestBodyInit(t,e,n)};Rs.converters.ResponseInit=Rs.dictionaryConverter([{key:"status",converter:Rs.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:Rs.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:Rs.converters.HeadersInit}]);vkt.exports={isNetworkError:cvr,makeNetworkError:nde,makeResponse:N$,makeAppropriateNetworkError:lvr,filterResponse:Tkt,Response:VM,cloneResponse:qFe,fromInnerResponse:ez}});var Nkt=re((LNs,Bkt)=>{"use strict";p();var{kConnected:Rkt,kSize:kkt}=bl(),jFe=class{constructor(e){this.value=e}deref(){return this.value[Rkt]===0&&this.value[kkt]===0?void 0:this.value}},VFe=class{constructor(e){this.finalizer=e}register(e,n){e.on&&e.on("disconnect",()=>{e[Rkt]===0&&e[kkt]===0&&this.finalizer(n)})}unregister(e){}};Bkt.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:jFe,FinalizationRegistry:VFe}):{WeakRef,FinalizationRegistry}}});var D$=re((QNs,Vkt)=>{"use strict";p();var{extractBody:uvr,mixinBody:dvr,cloneBody:pvr,bodyUnusable:Dkt}=d$(),{Headers:$kt,fill:mvr,HeadersList:ode,setHeadersGuard:zFe,getHeadersGuard:hvr,setHeadersList:Wkt,getHeadersList:Pkt}=jM(),{FinalizationRegistry:fvr}=Nkt()(),ide=to(),Mkt=require("node:util"),{isValidHTTPToken:gvr,sameOrigin:Okt,environmentSettingsObject:rde}=ey(),{forbiddenMethodsSet:Avr,corsSafeListedMethodsSet:yvr,referrerPolicy:Evr,requestRedirect:bvr,requestMode:_vr,requestCredentials:xvr,requestCache:Svr,requestDuplex:Cvr}=C6(),{kEnumerableProperty:_d,normalizedMethodRecordsBase:Ivr,normalizedMethodRecords:wvr}=ide,{kHeaders:oy,kSignal:sde,kState:Jc,kDispatcher:YFe}=e1(),{webidl:wi}=Sm(),{URLSerializer:Tvr}=Ug(),{kConstruct:ade}=bl(),vvr=require("node:assert"),{getMaxListeners:Lkt,setMaxListeners:Fkt,getEventListeners:Rvr,defaultMaxListeners:Qkt}=require("node:events"),kvr=Symbol("abortController"),Hkt=new fvr(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),cde=new WeakMap;function Ukt(t){return e;function e(){let n=t.deref();if(n!==void 0){Hkt.unregister(e),this.removeEventListener("abort",e),n.abort(this.reason);let r=cde.get(n.signal);if(r!==void 0){if(r.size!==0){for(let i of r){let s=i.deref();s!==void 0&&s.abort(this.reason)}r.clear()}cde.delete(n.signal)}}}}var Gkt=!1,d1=class t{constructor(e,n={}){if(wi.util.markAsUncloneable(this),e===ade)return;let r="Request constructor";wi.argumentLengthCheck(arguments,1,r),e=wi.converters.RequestInfo(e,r,"input"),n=wi.converters.RequestInit(n,r,"init");let i=null,s=null,o=rde.settingsObject.baseUrl,a=null;if(typeof e=="string"){this[YFe]=n.dispatcher;let y;try{y=new URL(e,o)}catch(E){throw new TypeError("Failed to parse URL from "+e,{cause:E})}if(y.username||y.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);i=lde({urlList:[y]}),s="cors"}else this[YFe]=n.dispatcher||e[YFe],vvr(e instanceof t),i=e[Jc],a=e[sde];let c=rde.settingsObject.origin,u="client";if(i.window?.constructor?.name==="EnvironmentSettingsObject"&&Okt(i.window,c)&&(u=i.window),n.window!=null)throw new TypeError(`'window' option '${u}' must be null`);"window"in n&&(u="no-window"),i=lde({method:i.method,headersList:i.headersList,unsafeRequest:i.unsafeRequest,client:rde.settingsObject,window:u,priority:i.priority,origin:i.origin,referrer:i.referrer,referrerPolicy:i.referrerPolicy,mode:i.mode,credentials:i.credentials,cache:i.cache,redirect:i.redirect,integrity:i.integrity,keepalive:i.keepalive,reloadNavigation:i.reloadNavigation,historyNavigation:i.historyNavigation,urlList:[...i.urlList]});let l=Object.keys(n).length!==0;if(l&&(i.mode==="navigate"&&(i.mode="same-origin"),i.reloadNavigation=!1,i.historyNavigation=!1,i.origin="client",i.referrer="client",i.referrerPolicy="",i.url=i.urlList[i.urlList.length-1],i.urlList=[i.url]),n.referrer!==void 0){let y=n.referrer;if(y==="")i.referrer="no-referrer";else{let E;try{E=new URL(y,o)}catch(_){throw new TypeError(`Referrer "${y}" is not a valid URL.`,{cause:_})}E.protocol==="about:"&&E.hostname==="client"||c&&!Okt(E,rde.settingsObject.baseUrl)?i.referrer="client":i.referrer=E}}n.referrerPolicy!==void 0&&(i.referrerPolicy=n.referrerPolicy);let d;if(n.mode!==void 0?d=n.mode:d=s,d==="navigate")throw wi.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(d!=null&&(i.mode=d),n.credentials!==void 0&&(i.credentials=n.credentials),n.cache!==void 0&&(i.cache=n.cache),i.cache==="only-if-cached"&&i.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(n.redirect!==void 0&&(i.redirect=n.redirect),n.integrity!=null&&(i.integrity=String(n.integrity)),n.keepalive!==void 0&&(i.keepalive=!!n.keepalive),n.method!==void 0){let y=n.method,E=wvr[y];if(E!==void 0)i.method=E;else{if(!gvr(y))throw new TypeError(`'${y}' is not a valid HTTP method.`);let _=y.toUpperCase();if(Avr.has(_))throw new TypeError(`'${y}' HTTP method is unsupported.`);y=Ivr[_]??y,i.method=y}!Gkt&&i.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),Gkt=!0)}n.signal!==void 0&&(a=n.signal),this[Jc]=i;let m=new AbortController;if(this[sde]=m.signal,a!=null){if(!a||typeof a.aborted!="boolean"||typeof a.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(a.aborted)m.abort(a.reason);else{this[kvr]=m;let y=new WeakRef(m),E=Ukt(y);try{(typeof Lkt=="function"&&Lkt(a)===Qkt||Rvr(a,"abort").length>=Qkt)&&Fkt(1500,a)}catch{}ide.addAbortListener(a,E),Hkt.register(m,{signal:a,abort:E},E)}}if(this[oy]=new $kt(ade),Wkt(this[oy],i.headersList),zFe(this[oy],"request"),d==="no-cors"){if(!yvr.has(i.method))throw new TypeError(`'${i.method} is unsupported in no-cors mode.`);zFe(this[oy],"request-no-cors")}if(l){let y=Pkt(this[oy]),E=n.headers!==void 0?n.headers:new ode(y);if(y.clear(),E instanceof ode){for(let{name:_,value:S}of E.rawValues())y.append(_,S,!1);y.cookies=E.cookies}else mvr(this[oy],E)}let h=e instanceof t?e[Jc].body:null;if((n.body!=null||h!=null)&&(i.method==="GET"||i.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let f=null;if(n.body!=null){let[y,E]=uvr(n.body,i.keepalive);f=y,E&&!Pkt(this[oy]).contains("content-type",!0)&&this[oy].append("content-type",E)}let g=f??h;if(g!=null&&g.source==null){if(f!=null&&n.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(i.mode!=="same-origin"&&i.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');i.useCORSPreflightFlag=!0}let A=g;if(f==null&&h!=null){if(Dkt(e))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let y=new TransformStream;h.stream.pipeThrough(y),A={source:h.source,length:h.length,stream:y.readable}}this[Jc].body=A}get method(){return wi.brandCheck(this,t),this[Jc].method}get url(){return wi.brandCheck(this,t),Tvr(this[Jc].url)}get headers(){return wi.brandCheck(this,t),this[oy]}get destination(){return wi.brandCheck(this,t),this[Jc].destination}get referrer(){return wi.brandCheck(this,t),this[Jc].referrer==="no-referrer"?"":this[Jc].referrer==="client"?"about:client":this[Jc].referrer.toString()}get referrerPolicy(){return wi.brandCheck(this,t),this[Jc].referrerPolicy}get mode(){return wi.brandCheck(this,t),this[Jc].mode}get credentials(){return this[Jc].credentials}get cache(){return wi.brandCheck(this,t),this[Jc].cache}get redirect(){return wi.brandCheck(this,t),this[Jc].redirect}get integrity(){return wi.brandCheck(this,t),this[Jc].integrity}get keepalive(){return wi.brandCheck(this,t),this[Jc].keepalive}get isReloadNavigation(){return wi.brandCheck(this,t),this[Jc].reloadNavigation}get isHistoryNavigation(){return wi.brandCheck(this,t),this[Jc].historyNavigation}get signal(){return wi.brandCheck(this,t),this[sde]}get body(){return wi.brandCheck(this,t),this[Jc].body?this[Jc].body.stream:null}get bodyUsed(){return wi.brandCheck(this,t),!!this[Jc].body&&ide.isDisturbed(this[Jc].body.stream)}get duplex(){return wi.brandCheck(this,t),"half"}clone(){if(wi.brandCheck(this,t),Dkt(this))throw new TypeError("unusable");let e=qkt(this[Jc]),n=new AbortController;if(this.signal.aborted)n.abort(this.signal.reason);else{let r=cde.get(this.signal);r===void 0&&(r=new Set,cde.set(this.signal,r));let i=new WeakRef(n);r.add(i),ide.addAbortListener(n.signal,Ukt(i))}return jkt(e,n.signal,hvr(this[oy]))}[Mkt.inspect.custom](e,n){n.depth===null&&(n.depth=2),n.colors??=!0;let r={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${Mkt.formatWithOptions(n,r)}`}};dvr(d1);function lde(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new ode(t.headersList):new ode}}function qkt(t){let e=lde({...t,body:null});return t.body!=null&&(e.body=pvr(e,t.body)),e}function jkt(t,e,n){let r=new d1(ade);return r[Jc]=t,r[sde]=e,r[oy]=new $kt(ade),Wkt(r[oy],t.headersList),zFe(r[oy],n),r}Object.defineProperties(d1.prototype,{method:_d,url:_d,headers:_d,redirect:_d,clone:_d,signal:_d,duplex:_d,destination:_d,body:_d,bodyUsed:_d,isHistoryNavigation:_d,isReloadNavigation:_d,keepalive:_d,integrity:_d,cache:_d,credentials:_d,attribute:_d,referrerPolicy:_d,referrer:_d,mode:_d,[Symbol.toStringTag]:{value:"Request",configurable:!0}});wi.converters.Request=wi.interfaceConverter(d1);wi.converters.RequestInfo=function(t,e,n){return typeof t=="string"?wi.converters.USVString(t,e,n):t instanceof d1?wi.converters.Request(t,e,n):wi.converters.USVString(t,e,n)};wi.converters.AbortSignal=wi.interfaceConverter(AbortSignal);wi.converters.RequestInit=wi.dictionaryConverter([{key:"method",converter:wi.converters.ByteString},{key:"headers",converter:wi.converters.HeadersInit},{key:"body",converter:wi.nullableConverter(wi.converters.BodyInit)},{key:"referrer",converter:wi.converters.USVString},{key:"referrerPolicy",converter:wi.converters.DOMString,allowedValues:Evr},{key:"mode",converter:wi.converters.DOMString,allowedValues:_vr},{key:"credentials",converter:wi.converters.DOMString,allowedValues:xvr},{key:"cache",converter:wi.converters.DOMString,allowedValues:Svr},{key:"redirect",converter:wi.converters.DOMString,allowedValues:bvr},{key:"integrity",converter:wi.converters.DOMString},{key:"keepalive",converter:wi.converters.boolean},{key:"signal",converter:wi.nullableConverter(t=>wi.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:wi.converters.any},{key:"duplex",converter:wi.converters.DOMString,allowedValues:Cvr},{key:"dispatcher",converter:wi.converters.any}]);Vkt.exports={Request:d1,makeRequest:lde,fromInnerRequest:jkt,cloneRequest:qkt}});var rz=re((GNs,c1t)=>{"use strict";p();var{makeNetworkError:Na,makeAppropriateNetworkError:ude,filterResponse:KFe,makeResponse:dde,fromInnerResponse:Bvr}=tz(),{HeadersList:Ykt}=jM(),{Request:Nvr,cloneRequest:Dvr}=D$(),p1=require("node:zlib"),{bytesMatch:Pvr,makePolicyContainer:Mvr,clonePolicyContainer:Ovr,requestBadPort:Lvr,TAOCheck:Fvr,appendRequestOriginHeader:Qvr,responseLocationURL:Uvr,requestCurrentURL:iC,setRequestReferrerPolicyOnRedirect:Gvr,tryUpgradeRequestToAPotentiallyTrustworthyURL:$vr,createOpaqueTimingInfo:tQe,appendFetchMetadata:Wvr,corsCheck:Hvr,crossOriginResourcePolicyCheck:qvr,determineRequestsReferrer:jvr,coarsenedSharedCurrentTime:nz,createDeferredPromise:Vvr,isBlobLike:Yvr,sameOrigin:eQe,isCancelled:YM,isAborted:zkt,isErrorLike:zvr,fullyReadBody:Kvr,readableStreamClose:Jvr,isomorphicEncode:pde,urlIsLocal:Xvr,urlIsHttpHttpsScheme:nQe,urlHasHttpsScheme:Zvr,clampAndCoarsenConnectionTimingInfo:eRr,simpleRangeHeaderValue:tRr,buildContentRange:nRr,createInflate:rRr,extractMimeType:iRr}=ey(),{kState:Zkt,kDispatcher:sRr}=e1(),zM=require("node:assert"),{safelyExtractBody:rQe,extractBody:Kkt}=d$(),{redirectStatusSet:e1t,nullBodyStatus:t1t,safeMethodsSet:oRr,requestBodyHeader:aRr,subresourceSet:cRr}=C6(),lRr=require("node:events"),{Readable:uRr,pipeline:dRr,finished:pRr}=require("node:stream"),{addAbortListener:mRr,isErrored:hRr,isReadable:mde,bufferToLowerCasedHeaderName:Jkt}=to(),{dataURLProcessor:fRr,serializeAMimeType:gRr,minimizeSupportedMimeType:ARr}=Ug(),{getGlobalDispatcher:yRr}=Kue(),{webidl:ERr}=Sm(),{STATUS_CODES:bRr}=require("node:http"),_Rr=["GET","HEAD"],xRr=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",JFe,hde=class extends lRr{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function SRr(t){n1t(t,"fetch")}function CRr(t,e=void 0){ERr.argumentLengthCheck(arguments,1,"globalThis.fetch");let n=Vvr(),r;try{r=new Nvr(t,e)}catch(l){return n.reject(l),n.promise}let i=r[Zkt];if(r.signal.aborted)return XFe(n,i,null,r.signal.reason),n.promise;i.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(i.serviceWorkers="none");let o=null,a=!1,c=null;return mRr(r.signal,()=>{a=!0,zM(c!=null),c.abort(r.signal.reason);let l=o?.deref();XFe(n,i,l,r.signal.reason)}),c=i1t({request:i,processResponseEndOfBody:SRr,processResponse:l=>{if(!a){if(l.aborted){XFe(n,i,o,c.serializedAbortReason);return}if(l.type==="error"){n.reject(new TypeError("fetch failed",{cause:l.error}));return}o=new WeakRef(Bvr(l,"immutable")),n.resolve(o.deref()),n=null}},dispatcher:r[sRr]}),n.promise}function n1t(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let n=t.urlList[0],r=t.timingInfo,i=t.cacheState;nQe(n)&&r!==null&&(t.timingAllowPassed||(r=tQe({startTime:r.startTime}),i=""),r.endTime=nz(),t.timingInfo=r,r1t(r,n.href,e,globalThis,i))}var r1t=performance.markResourceTiming;function XFe(t,e,n,r){if(t&&t.reject(r),e.body!=null&&mde(e.body?.stream)&&e.body.stream.cancel(r).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),n==null)return;let i=n[Zkt];i.body!=null&&mde(i.body?.stream)&&i.body.stream.cancel(r).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}function i1t({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:s,useParallelQueue:o=!1,dispatcher:a=yRr()}){zM(a);let c=null,u=!1;t.client!=null&&(c=t.client.globalObject,u=t.client.crossOriginIsolatedCapability);let l=nz(u),d=tQe({startTime:l}),m={controller:new hde(a),request:t,timingInfo:d,processRequestBodyChunkLength:e,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:s,processResponseEndOfBody:i,taskDestination:c,crossOriginIsolatedCapability:u};return zM(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=Ovr(t.client.policyContainer):t.policyContainer=Mvr()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,cRr.has(t.destination),s1t(m).catch(h=>{m.controller.terminate(h)}),m.controller}async function s1t(t,e=!1){let n=t.request,r=null;if(n.localURLsOnly&&!Xvr(iC(n))&&(r=Na("local URLs only")),$vr(n),Lvr(n)==="blocked"&&(r=Na("bad port")),n.referrerPolicy===""&&(n.referrerPolicy=n.policyContainer.referrerPolicy),n.referrer!=="no-referrer"&&(n.referrer=jvr(n)),r===null&&(r=await(async()=>{let s=iC(n);return eQe(s,n.url)&&n.responseTainting==="basic"||s.protocol==="data:"||n.mode==="navigate"||n.mode==="websocket"?(n.responseTainting="basic",await Xkt(t)):n.mode==="same-origin"?Na('request mode cannot be "same-origin"'):n.mode==="no-cors"?n.redirect!=="follow"?Na('redirect mode cannot be "follow" for "no-cors" request'):(n.responseTainting="opaque",await Xkt(t)):nQe(iC(n))?(n.responseTainting="cors",await o1t(t)):Na("URL scheme must be a HTTP(S) scheme")})()),e)return r;r.status!==0&&!r.internalResponse&&(n.responseTainting,n.responseTainting==="basic"?r=KFe(r,"basic"):n.responseTainting==="cors"?r=KFe(r,"cors"):n.responseTainting==="opaque"?r=KFe(r,"opaque"):zM(!1));let i=r.status===0?r:r.internalResponse;if(i.urlList.length===0&&i.urlList.push(...n.urlList),n.timingAllowFailed||(r.timingAllowPassed=!0),r.type==="opaque"&&i.status===206&&i.rangeRequested&&!n.headers.contains("range",!0)&&(r=i=Na()),r.status!==0&&(n.method==="HEAD"||n.method==="CONNECT"||t1t.includes(i.status))&&(i.body=null,t.controller.dump=!0),n.integrity){let s=a=>ZFe(t,Na(a));if(n.responseTainting==="opaque"||r.body==null){s(r.error);return}let o=a=>{if(!Pvr(a,n.integrity)){s("integrity mismatch");return}r.body=rQe(a)[0],ZFe(t,r)};await Kvr(r.body,o,s)}else ZFe(t,r)}function Xkt(t){if(YM(t)&&t.request.redirectCount===0)return Promise.resolve(ude(t));let{request:e}=t,{protocol:n}=iC(e);switch(n){case"about:":return Promise.resolve(Na("about scheme is not supported"));case"blob:":{JFe||(JFe=require("node:buffer").resolveObjectURL);let r=iC(e);if(r.search.length!==0)return Promise.resolve(Na("NetworkError when attempting to fetch resource."));let i=JFe(r.toString());if(e.method!=="GET"||!Yvr(i))return Promise.resolve(Na("invalid method"));let s=dde(),o=i.size,a=pde(`${o}`),c=i.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let u=e.headersList.get("range",!0),l=tRr(u,!0);if(l==="failure")return Promise.resolve(Na("failed to fetch the data URL"));let{rangeStartValue:d,rangeEndValue:m}=l;if(d===null)d=o-m,m=d+m-1;else{if(d>=o)return Promise.resolve(Na("Range start is greater than the blob's size."));(m===null||m>=o)&&(m=o-1)}let h=i.slice(d,m,c),f=Kkt(h);s.body=f[0];let g=pde(`${h.size}`),A=nRr(d,m,o);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",g,!0),s.headersList.set("content-type",c,!0),s.headersList.set("content-range",A,!0)}else{let u=Kkt(i);s.statusText="OK",s.body=u[0],s.headersList.set("content-length",a,!0),s.headersList.set("content-type",c,!0)}return Promise.resolve(s)}case"data:":{let r=iC(e),i=fRr(r);if(i==="failure")return Promise.resolve(Na("failed to fetch the data URL"));let s=gRr(i.mimeType);return Promise.resolve(dde({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:rQe(i.body)[0]}))}case"file:":return Promise.resolve(Na("not implemented... yet..."));case"http:":case"https:":return o1t(t).catch(r=>Na(r));default:return Promise.resolve(Na("unknown scheme"))}}function IRr(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}function ZFe(t,e){let n=t.timingInfo,r=()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=n),t.controller.reportTimingSteps=()=>{if(t.request.url.protocol!=="https:")return;n.endTime=s;let a=e.cacheState,c=e.bodyInfo;e.timingAllowPassed||(n=tQe(n),a="");let u=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){u=e.status;let l=iRr(e.headersList);l!=="failure"&&(c.contentType=ARr(l))}t.request.initiatorType!=null&&r1t(n,t.request.url.href,t.request.initiatorType,globalThis,a,c,u)};let o=()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()};queueMicrotask(()=>o())};t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let i=e.type==="error"?e:e.internalResponse??e;i.body==null?r():pRr(i.body.stream,()=>{r()})}async function o1t(t){let e=t.request,n=null,r=null,i=t.timingInfo;if(e.serviceWorkers,n===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),r=n=await a1t(t),e.responseTainting==="cors"&&Hvr(e,n)==="failure")return Na("cors failure");Fvr(e,n)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||n.type==="opaque")&&qvr(e.origin,e.client,e.destination,r)==="blocked"?Na("blocked"):(e1t.has(r.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?n=Na("unexpected redirect"):e.redirect==="manual"?n=r:e.redirect==="follow"?n=await wRr(t,n):zM(!1)),n.timingInfo=i,n)}function wRr(t,e){let n=t.request,r=e.internalResponse?e.internalResponse:e,i;try{if(i=Uvr(r,iC(n).hash),i==null)return e}catch(o){return Promise.resolve(Na(o))}if(!nQe(i))return Promise.resolve(Na("URL scheme must be a HTTP(S) scheme"));if(n.redirectCount===20)return Promise.resolve(Na("redirect count exceeded"));if(n.redirectCount+=1,n.mode==="cors"&&(i.username||i.password)&&!eQe(n,i))return Promise.resolve(Na('cross origin not allowed for request mode "cors"'));if(n.responseTainting==="cors"&&(i.username||i.password))return Promise.resolve(Na('URL cannot contain credentials for request mode "cors"'));if(r.status!==303&&n.body!=null&&n.body.source==null)return Promise.resolve(Na());if([301,302].includes(r.status)&&n.method==="POST"||r.status===303&&!_Rr.includes(n.method)){n.method="GET",n.body=null;for(let o of aRr)n.headersList.delete(o)}eQe(iC(n),i)||(n.headersList.delete("authorization",!0),n.headersList.delete("proxy-authorization",!0),n.headersList.delete("cookie",!0),n.headersList.delete("host",!0)),n.body!=null&&(zM(n.body.source!=null),n.body=rQe(n.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=nz(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),n.urlList.push(i),Gvr(n,r),s1t(t,!0)}async function a1t(t,e=!1,n=!1){let r=t.request,i=null,s=null,o=null,a=null,c=!1;r.window==="no-window"&&r.redirect==="error"?(i=t,s=r):(s=Dvr(r),i={...t},i.request=s);let u=r.credentials==="include"||r.credentials==="same-origin"&&r.responseTainting==="basic",l=s.body?s.body.length:null,d=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(d="0"),l!=null&&(d=pde(`${l}`)),d!=null&&s.headersList.append("content-length",d,!0),l!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",pde(s.referrer.href),!0),Qvr(s),Wvr(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",xRr),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(Zvr(iC(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),a==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,o==null){if(s.cache==="only-if-cached")return Na("only if cached");let m=await TRr(i,u,n);!oRr.has(s.method)&&m.status>=200&&m.status<=399,c&&m.status,o==null&&(o=m)}if(o.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(o.rangeRequested=!0),o.requestIncludesCredentials=u,o.status===407)return r.window==="no-window"?Na():YM(t)?ude(t):Na("proxy authentication required");if(o.status===421&&!n&&(r.body==null||r.body.source!=null)){if(YM(t))return ude(t);t.controller.connection.destroy(),o=await a1t(t,e,!0)}return o}async function TRr(t,e=!1,n=!1){zM(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(f,g=!0){this.destroyed||(this.destroyed=!0,g&&this.abort?.(f??new DOMException("The operation was aborted.","AbortError")))}};let r=t.request,i=null,s=t.timingInfo;null==null&&(r.cache="no-store");let a=n?"yes":"no";r.mode;let c=null;if(r.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(r.body!=null){let f=async function*(y){YM(t)||(yield y,t.processRequestBodyChunkLength?.(y.byteLength))},g=()=>{YM(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},A=y=>{YM(t)||(y.name==="AbortError"?t.controller.abort():t.controller.terminate(y))};c=(async function*(){try{for await(let y of r.body.stream)yield*f(y);g()}catch(y){A(y)}})()}try{let{body:f,status:g,statusText:A,headersList:y,socket:E}=await h({body:c});if(E)i=dde({status:g,statusText:A,headersList:y,socket:E});else{let _=f[Symbol.asyncIterator]();t.controller.next=()=>_.next(),i=dde({status:g,statusText:A,headersList:y})}}catch(f){return f.name==="AbortError"?(t.controller.connection.destroy(),ude(t,f)):Na(f)}let u=async()=>{await t.controller.resume()},l=f=>{YM(t)||t.controller.abort(f)},d=new ReadableStream({async start(f){t.controller.controller=f},async pull(f){await u(f)},async cancel(f){await l(f)},type:"bytes"});i.body={stream:d,source:null,length:null},t.controller.onAborted=m,t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let f,g;try{let{done:y,value:E}=await t.controller.next();if(zkt(t))break;f=y?void 0:E}catch(y){t.controller.ended&&!s.encodedBodySize?f=void 0:(f=y,g=!0)}if(f===void 0){Jvr(t.controller.controller),IRr(t,i);return}if(s.decodedBodySize+=f?.byteLength??0,g){t.controller.terminate(f);return}let A=new Uint8Array(f);if(A.byteLength&&t.controller.controller.enqueue(A),hRr(d)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(f){zkt(t)?(i.aborted=!0,mde(d)&&t.controller.controller.error(t.controller.serializedAbortReason)):mde(d)&&t.controller.controller.error(new TypeError("terminated",{cause:zvr(f)?f:void 0})),t.controller.connection.destroy()}return i;function h({body:f}){let g=iC(r),A=t.controller.dispatcher;return new Promise((y,E)=>A.dispatch({path:g.pathname+g.search,origin:g.origin,method:r.method,body:A.isMockActive?r.body&&(r.body.source||r.body.stream):f,headers:r.headersList.entries,maxRedirections:0,upgrade:r.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(_){let{connection:S}=t.controller;s.finalConnectionTimingInfo=eRr(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),S.destroyed?_(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",_),this.abort=S.abort=_),s.finalNetworkRequestStartTime=nz(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=nz(t.crossOriginIsolatedCapability)},onHeaders(_,S,C,I){if(_<200)return;let w="",k=new Ykt;for(let $=0;$q)return E(new Error(`too many content-encodings in response: ${G.length}, maximum allowed is ${q}`)),!0;for(let ce=G.length-1;ce>=0;--ce){let Y=G[ce].trim();if(Y==="x-gzip"||Y==="gzip")N.push(p1.createGunzip({flush:p1.constants.Z_SYNC_FLUSH,finishFlush:p1.constants.Z_SYNC_FLUSH}));else if(Y==="deflate")N.push(rRr({flush:p1.constants.Z_SYNC_FLUSH,finishFlush:p1.constants.Z_SYNC_FLUSH}));else if(Y==="br")N.push(p1.createBrotliDecompress({flush:p1.constants.BROTLI_OPERATION_FLUSH,finishFlush:p1.constants.BROTLI_OPERATION_FLUSH}));else{N.length=0;break}}}let W=this.onError.bind(this);return y({status:_,statusText:I,headersList:k,body:N.length?dRr(this.body,...N,$=>{$&&this.onError($)}).on("error",W):this.body.on("error",W)}),!0},onData(_){if(t.controller.dump)return;let S=_;return s.encodedBodySize+=S.byteLength,this.body.push(S)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.onAborted&&t.controller.off("terminated",t.controller.onAborted),t.controller.ended=!0,this.body.push(null)},onError(_){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(_),t.controller.terminate(_),E(_)},onUpgrade(_,S,C){if(_!==101)return;let I=new Ykt;for(let w=0;w{"use strict";p();l1t.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var d1t=re((qNs,u1t)=>{"use strict";p();var{webidl:ay}=Sm(),fde=Symbol("ProgressEvent state"),sQe=class t extends Event{constructor(e,n={}){e=ay.converters.DOMString(e,"ProgressEvent constructor","type"),n=ay.converters.ProgressEventInit(n??{}),super(e,n),this[fde]={lengthComputable:n.lengthComputable,loaded:n.loaded,total:n.total}}get lengthComputable(){return ay.brandCheck(this,t),this[fde].lengthComputable}get loaded(){return ay.brandCheck(this,t),this[fde].loaded}get total(){return ay.brandCheck(this,t),this[fde].total}};ay.converters.ProgressEventInit=ay.dictionaryConverter([{key:"lengthComputable",converter:ay.converters.boolean,defaultValue:()=>!1},{key:"loaded",converter:ay.converters["unsigned long long"],defaultValue:()=>0},{key:"total",converter:ay.converters["unsigned long long"],defaultValue:()=>0},{key:"bubbles",converter:ay.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:ay.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:ay.converters.boolean,defaultValue:()=>!1}]);u1t.exports={ProgressEvent:sQe}});var m1t=re((VNs,p1t)=>{"use strict";p();function vRr(t){if(!t)return"failure";switch(t.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}p1t.exports={getEncoding:vRr}});var _1t=re((zNs,b1t)=>{"use strict";p();var{kState:P$,kError:oQe,kResult:h1t,kAborted:iz,kLastProgressEventFired:aQe}=iQe(),{ProgressEvent:RRr}=d1t(),{getEncoding:f1t}=m1t(),{serializeAMimeType:kRr,parseMIMEType:g1t}=Ug(),{types:BRr}=require("node:util"),{StringDecoder:A1t}=require("string_decoder"),{btoa:y1t}=require("node:buffer"),NRr={enumerable:!0,writable:!1,configurable:!1};function DRr(t,e,n,r){if(t[P$]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[P$]="loading",t[h1t]=null,t[oQe]=null;let s=e.stream().getReader(),o=[],a=s.read(),c=!0;(async()=>{for(;!t[iz];)try{let{done:u,value:l}=await a;if(c&&!t[iz]&&queueMicrotask(()=>{m1("loadstart",t)}),c=!1,!u&&BRr.isUint8Array(l))o.push(l),(t[aQe]===void 0||Date.now()-t[aQe]>=50)&&!t[iz]&&(t[aQe]=Date.now(),queueMicrotask(()=>{m1("progress",t)})),a=s.read();else if(u){queueMicrotask(()=>{t[P$]="done";try{let d=PRr(o,n,e.type,r);if(t[iz])return;t[h1t]=d,m1("load",t)}catch(d){t[oQe]=d,m1("error",t)}t[P$]!=="loading"&&m1("loadend",t)});break}}catch(u){if(t[iz])return;queueMicrotask(()=>{t[P$]="done",t[oQe]=u,m1("error",t),t[P$]!=="loading"&&m1("loadend",t)});break}})()}function m1(t,e){let n=new RRr(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(n)}function PRr(t,e,n,r){switch(e){case"DataURL":{let i="data:",s=g1t(n||"application/octet-stream");s!=="failure"&&(i+=kRr(s)),i+=";base64,";let o=new A1t("latin1");for(let a of t)i+=y1t(o.write(a));return i+=y1t(o.end()),i}case"Text":{let i="failure";if(r&&(i=f1t(r)),i==="failure"&&n){let s=g1t(n);s!=="failure"&&(i=f1t(s.parameters.get("charset")))}return i==="failure"&&(i="UTF-8"),MRr(t,i)}case"ArrayBuffer":return E1t(t).buffer;case"BinaryString":{let i="",s=new A1t("latin1");for(let o of t)i+=s.write(o);return i+=s.end(),i}}}function MRr(t,e){let n=E1t(t),r=ORr(n),i=0;r!==null&&(e=r,i=r==="UTF-8"?3:2);let s=n.slice(i);return new TextDecoder(e).decode(s)}function ORr(t){let[e,n,r]=t;return e===239&&n===187&&r===191?"UTF-8":e===254&&n===255?"UTF-16BE":e===255&&n===254?"UTF-16LE":null}function E1t(t){let e=t.reduce((r,i)=>r+i.byteLength,0),n=0;return t.reduce((r,i)=>(r.set(i,n),n+=i.byteLength,r),new Uint8Array(e))}b1t.exports={staticPropertyDescriptors:NRr,readOperation:DRr,fireAProgressEvent:m1}});var I1t=re((JNs,C1t)=>{"use strict";p();var{staticPropertyDescriptors:M$,readOperation:gde,fireAProgressEvent:x1t}=_1t(),{kState:KM,kError:S1t,kResult:Ade,kEvents:sa,kAborted:LRr}=iQe(),{webidl:Ha}=Sm(),{kEnumerableProperty:Wg}=to(),v_=class t extends EventTarget{constructor(){super(),this[KM]="empty",this[Ade]=null,this[S1t]=null,this[sa]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=Ha.converters.Blob(e,{strict:!1}),gde(this,e,"ArrayBuffer")}readAsBinaryString(e){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=Ha.converters.Blob(e,{strict:!1}),gde(this,e,"BinaryString")}readAsText(e,n=void 0){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=Ha.converters.Blob(e,{strict:!1}),n!==void 0&&(n=Ha.converters.DOMString(n,"FileReader.readAsText","encoding")),gde(this,e,"Text",n)}readAsDataURL(e){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=Ha.converters.Blob(e,{strict:!1}),gde(this,e,"DataURL")}abort(){if(this[KM]==="empty"||this[KM]==="done"){this[Ade]=null;return}this[KM]==="loading"&&(this[KM]="done",this[Ade]=null),this[LRr]=!0,x1t("abort",this),this[KM]!=="loading"&&x1t("loadend",this)}get readyState(){switch(Ha.brandCheck(this,t),this[KM]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return Ha.brandCheck(this,t),this[Ade]}get error(){return Ha.brandCheck(this,t),this[S1t]}get onloadend(){return Ha.brandCheck(this,t),this[sa].loadend}set onloadend(e){Ha.brandCheck(this,t),this[sa].loadend&&this.removeEventListener("loadend",this[sa].loadend),typeof e=="function"?(this[sa].loadend=e,this.addEventListener("loadend",e)):this[sa].loadend=null}get onerror(){return Ha.brandCheck(this,t),this[sa].error}set onerror(e){Ha.brandCheck(this,t),this[sa].error&&this.removeEventListener("error",this[sa].error),typeof e=="function"?(this[sa].error=e,this.addEventListener("error",e)):this[sa].error=null}get onloadstart(){return Ha.brandCheck(this,t),this[sa].loadstart}set onloadstart(e){Ha.brandCheck(this,t),this[sa].loadstart&&this.removeEventListener("loadstart",this[sa].loadstart),typeof e=="function"?(this[sa].loadstart=e,this.addEventListener("loadstart",e)):this[sa].loadstart=null}get onprogress(){return Ha.brandCheck(this,t),this[sa].progress}set onprogress(e){Ha.brandCheck(this,t),this[sa].progress&&this.removeEventListener("progress",this[sa].progress),typeof e=="function"?(this[sa].progress=e,this.addEventListener("progress",e)):this[sa].progress=null}get onload(){return Ha.brandCheck(this,t),this[sa].load}set onload(e){Ha.brandCheck(this,t),this[sa].load&&this.removeEventListener("load",this[sa].load),typeof e=="function"?(this[sa].load=e,this.addEventListener("load",e)):this[sa].load=null}get onabort(){return Ha.brandCheck(this,t),this[sa].abort}set onabort(e){Ha.brandCheck(this,t),this[sa].abort&&this.removeEventListener("abort",this[sa].abort),typeof e=="function"?(this[sa].abort=e,this.addEventListener("abort",e)):this[sa].abort=null}};v_.EMPTY=v_.prototype.EMPTY=0;v_.LOADING=v_.prototype.LOADING=1;v_.DONE=v_.prototype.DONE=2;Object.defineProperties(v_.prototype,{EMPTY:M$,LOADING:M$,DONE:M$,readAsArrayBuffer:Wg,readAsBinaryString:Wg,readAsText:Wg,readAsDataURL:Wg,abort:Wg,readyState:Wg,result:Wg,error:Wg,onloadstart:Wg,onprogress:Wg,onload:Wg,onabort:Wg,onerror:Wg,onloadend:Wg,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(v_,{EMPTY:M$,LOADING:M$,DONE:M$});C1t.exports={FileReader:v_}});var yde=re((ZNs,w1t)=>{"use strict";p();w1t.exports={kConstruct:bl().kConstruct}});var R1t=re((tDs,v1t)=>{"use strict";p();var FRr=require("node:assert"),{URLSerializer:T1t}=Ug(),{isValidHeaderName:QRr}=ey();function URr(t,e,n=!1){let r=T1t(t,n),i=T1t(e,n);return r===i}function GRr(t){FRr(t!==null);let e=[];for(let n of t.split(","))n=n.trim(),QRr(n)&&e.push(n);return e}v1t.exports={urlEquals:URr,getFieldValues:GRr}});var N1t=re((rDs,B1t)=>{"use strict";p();var{kConstruct:$Rr}=yde(),{urlEquals:WRr,getFieldValues:cQe}=R1t(),{kEnumerableProperty:JM,isDisturbed:HRr}=to(),{webidl:oi}=Sm(),{Response:qRr,cloneResponse:jRr,fromInnerResponse:VRr}=tz(),{Request:LT,fromInnerRequest:YRr}=D$(),{kState:R_}=e1(),{fetching:zRr}=rz(),{urlIsHttpHttpsScheme:Ede,createDeferredPromise:O$,readAllBytes:KRr}=ey(),lQe=require("node:assert"),bde=class t{#e;constructor(){arguments[0]!==$Rr&&oi.illegalConstructor(),oi.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,n={}){oi.brandCheck(this,t);let r="Cache.match";oi.argumentLengthCheck(arguments,1,r),e=oi.converters.RequestInfo(e,r,"request"),n=oi.converters.CacheQueryOptions(n,r,"options");let i=this.#i(e,n,1);if(i.length!==0)return i[0]}async matchAll(e=void 0,n={}){oi.brandCheck(this,t);let r="Cache.matchAll";return e!==void 0&&(e=oi.converters.RequestInfo(e,r,"request")),n=oi.converters.CacheQueryOptions(n,r,"options"),this.#i(e,n)}async add(e){oi.brandCheck(this,t);let n="Cache.add";oi.argumentLengthCheck(arguments,1,n),e=oi.converters.RequestInfo(e,n,"request");let r=[e];return await this.addAll(r)}async addAll(e){oi.brandCheck(this,t);let n="Cache.addAll";oi.argumentLengthCheck(arguments,1,n);let r=[],i=[];for(let m of e){if(m===void 0)throw oi.errors.conversionFailed({prefix:n,argument:"Argument 1",types:["undefined is not allowed"]});if(m=oi.converters.RequestInfo(m),typeof m=="string")continue;let h=m[R_];if(!Ede(h.url)||h.method!=="GET")throw oi.errors.exception({header:n,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let h=new LT(m)[R_];if(!Ede(h.url))throw oi.errors.exception({header:n,message:"Expected http/s scheme."});h.initiator="fetch",h.destination="subresource",i.push(h);let f=O$();s.push(zRr({request:h,processResponse(g){if(g.type==="error"||g.status===206||g.status<200||g.status>299)f.reject(oi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(g.headersList.contains("vary")){let A=cQe(g.headersList.get("vary"));for(let y of A)if(y==="*"){f.reject(oi.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let E of s)E.abort();return}}},processResponseEndOfBody(g){if(g.aborted){f.reject(new DOMException("aborted","AbortError"));return}f.resolve(g)}})),r.push(f.promise)}let a=await Promise.all(r),c=[],u=0;for(let m of a){let h={type:"put",request:i[u],response:m};c.push(h),u++}let l=O$(),d=null;try{this.#t(c)}catch(m){d=m}return queueMicrotask(()=>{d===null?l.resolve(void 0):l.reject(d)}),l.promise}async put(e,n){oi.brandCheck(this,t);let r="Cache.put";oi.argumentLengthCheck(arguments,2,r),e=oi.converters.RequestInfo(e,r,"request"),n=oi.converters.Response(n,r,"response");let i=null;if(e instanceof LT?i=e[R_]:i=new LT(e)[R_],!Ede(i.url)||i.method!=="GET")throw oi.errors.exception({header:r,message:"Expected an http/s scheme when method is not GET"});let s=n[R_];if(s.status===206)throw oi.errors.exception({header:r,message:"Got 206 status"});if(s.headersList.contains("vary")){let h=cQe(s.headersList.get("vary"));for(let f of h)if(f==="*")throw oi.errors.exception({header:r,message:"Got * vary field value"})}if(s.body&&(HRr(s.body.stream)||s.body.stream.locked))throw oi.errors.exception({header:r,message:"Response body is locked or disturbed"});let o=jRr(s),a=O$();if(s.body!=null){let f=s.body.stream.getReader();KRr(f).then(a.resolve,a.reject)}else a.resolve(void 0);let c=[],u={type:"put",request:i,response:o};c.push(u);let l=await a.promise;o.body!=null&&(o.body.source=l);let d=O$(),m=null;try{this.#t(c)}catch(h){m=h}return queueMicrotask(()=>{m===null?d.resolve():d.reject(m)}),d.promise}async delete(e,n={}){oi.brandCheck(this,t);let r="Cache.delete";oi.argumentLengthCheck(arguments,1,r),e=oi.converters.RequestInfo(e,r,"request"),n=oi.converters.CacheQueryOptions(n,r,"options");let i=null;if(e instanceof LT){if(i=e[R_],i.method!=="GET"&&!n.ignoreMethod)return!1}else lQe(typeof e=="string"),i=new LT(e)[R_];let s=[],o={type:"delete",request:i,options:n};s.push(o);let a=O$(),c=null,u;try{u=this.#t(s)}catch(l){c=l}return queueMicrotask(()=>{c===null?a.resolve(!!u?.length):a.reject(c)}),a.promise}async keys(e=void 0,n={}){oi.brandCheck(this,t);let r="Cache.keys";e!==void 0&&(e=oi.converters.RequestInfo(e,r,"request")),n=oi.converters.CacheQueryOptions(n,r,"options");let i=null;if(e!==void 0)if(e instanceof LT){if(i=e[R_],i.method!=="GET"&&!n.ignoreMethod)return[]}else typeof e=="string"&&(i=new LT(e)[R_]);let s=O$(),o=[];if(e===void 0)for(let a of this.#e)o.push(a[0]);else{let a=this.#n(i,n);for(let c of a)o.push(c[0])}return queueMicrotask(()=>{let a=[];for(let c of o){let u=YRr(c,new AbortController().signal,"immutable");a.push(u)}s.resolve(Object.freeze(a))}),s.promise}#t(e){let n=this.#e,r=[...n],i=[],s=[];try{for(let o of e){if(o.type!=="delete"&&o.type!=="put")throw oi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(o.type==="delete"&&o.response!=null)throw oi.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#n(o.request,o.options,i).length)throw new DOMException("???","InvalidStateError");let a;if(o.type==="delete"){if(a=this.#n(o.request,o.options),a.length===0)return[];for(let c of a){let u=n.indexOf(c);lQe(u!==-1),n.splice(u,1)}}else if(o.type==="put"){if(o.response==null)throw oi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let c=o.request;if(!Ede(c.url))throw oi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(c.method!=="GET")throw oi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(o.options!=null)throw oi.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});a=this.#n(o.request);for(let u of a){let l=n.indexOf(u);lQe(l!==-1),n.splice(l,1)}n.push([o.request,o.response]),i.push([o.request,o.response])}s.push([o.request,o.response])}return s}catch(o){throw this.#e.length=0,this.#e=r,o}}#n(e,n,r){let i=[],s=r??this.#e;for(let o of s){let[a,c]=o;this.#r(e,a,c,n)&&i.push(o)}return i}#r(e,n,r=null,i){let s=new URL(e.url),o=new URL(n.url);if(i?.ignoreSearch&&(o.search="",s.search=""),!WRr(s,o,!0))return!1;if(r==null||i?.ignoreVary||!r.headersList.contains("vary"))return!0;let a=cQe(r.headersList.get("vary"));for(let c of a){if(c==="*")return!1;let u=n.headersList.get(c),l=e.headersList.get(c);if(u!==l)return!1}return!0}#i(e,n,r=1/0){let i=null;if(e!==void 0)if(e instanceof LT){if(i=e[R_],i.method!=="GET"&&!n.ignoreMethod)return[]}else typeof e=="string"&&(i=new LT(e)[R_]);let s=[];if(e===void 0)for(let a of this.#e)s.push(a[1]);else{let a=this.#n(i,n);for(let c of a)s.push(c[1])}let o=[];for(let a of s){let c=VRr(a,"immutable");if(o.push(c.clone()),o.length>=r)break}return Object.freeze(o)}};Object.defineProperties(bde.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:JM,matchAll:JM,add:JM,addAll:JM,put:JM,delete:JM,keys:JM});var k1t=[{key:"ignoreSearch",converter:oi.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:oi.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:oi.converters.boolean,defaultValue:()=>!1}];oi.converters.CacheQueryOptions=oi.dictionaryConverter(k1t);oi.converters.MultiCacheQueryOptions=oi.dictionaryConverter([...k1t,{key:"cacheName",converter:oi.converters.DOMString}]);oi.converters.Response=oi.interfaceConverter(qRr);oi.converters["sequence"]=oi.sequenceConverter(oi.converters.RequestInfo);B1t.exports={Cache:bde}});var P1t=re((sDs,D1t)=>{"use strict";p();var{kConstruct:sz}=yde(),{Cache:_de}=N1t(),{webidl:yh}=Sm(),{kEnumerableProperty:oz}=to(),xde=class t{#e=new Map;constructor(){arguments[0]!==sz&&yh.illegalConstructor(),yh.util.markAsUncloneable(this)}async match(e,n={}){if(yh.brandCheck(this,t),yh.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=yh.converters.RequestInfo(e),n=yh.converters.MultiCacheQueryOptions(n),n.cacheName!=null){if(this.#e.has(n.cacheName)){let r=this.#e.get(n.cacheName);return await new _de(sz,r).match(e,n)}}else for(let r of this.#e.values()){let s=await new _de(sz,r).match(e,n);if(s!==void 0)return s}}async has(e){yh.brandCheck(this,t);let n="CacheStorage.has";return yh.argumentLengthCheck(arguments,1,n),e=yh.converters.DOMString(e,n,"cacheName"),this.#e.has(e)}async open(e){yh.brandCheck(this,t);let n="CacheStorage.open";if(yh.argumentLengthCheck(arguments,1,n),e=yh.converters.DOMString(e,n,"cacheName"),this.#e.has(e)){let i=this.#e.get(e);return new _de(sz,i)}let r=[];return this.#e.set(e,r),new _de(sz,r)}async delete(e){yh.brandCheck(this,t);let n="CacheStorage.delete";return yh.argumentLengthCheck(arguments,1,n),e=yh.converters.DOMString(e,n,"cacheName"),this.#e.delete(e)}async keys(){return yh.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(xde.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:oz,has:oz,open:oz,delete:oz,keys:oz});D1t.exports={CacheStorage:xde}});var O1t=re((aDs,M1t)=>{"use strict";p();M1t.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var uQe=re((lDs,G1t)=>{"use strict";p();function JRr(t){for(let e=0;e=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function L1t(t){for(let e=0;e126||n===34||n===40||n===41||n===60||n===62||n===64||n===44||n===59||n===58||n===92||n===47||n===91||n===93||n===63||n===61||n===123||n===125)throw new Error("Invalid cookie name")}}function F1t(t){let e=t.length,n=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++n}for(;n126||r===34||r===44||r===59||r===92)throw new Error("Invalid cookie value")}}function Q1t(t){for(let e=0;ee.toString().padStart(2,"0"));function U1t(t){return typeof t=="number"&&(t=new Date(t)),`${ZRr[t.getUTCDay()]}, ${Sde[t.getUTCDate()]} ${ekr[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Sde[t.getUTCHours()]}:${Sde[t.getUTCMinutes()]}:${Sde[t.getUTCSeconds()]} GMT`}function tkr(t){if(t<0)throw new Error("Invalid cookie max-age")}function nkr(t){if(t.name.length===0)return null;L1t(t.name),F1t(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(tkr(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(XRr(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(Q1t(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${U1t(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let n of t.unparsed){if(!n.includes("="))throw new Error("Invalid unparsed");let[r,...i]=n.split("=");e.push(`${r.trim()}=${i.join("=")}`)}return e.join("; ")}G1t.exports={isCTLExcludingHtab:JRr,validateCookieName:L1t,validateCookiePath:Q1t,validateCookieValue:F1t,toIMFDate:U1t,stringify:nkr}});var W1t=re((dDs,$1t)=>{"use strict";p();var{maxNameValuePairSize:rkr,maxAttributeValueSize:ikr}=O1t(),{isCTLExcludingHtab:skr}=uQe(),{collectASequenceOfCodePointsFast:Cde}=Ug(),okr=require("node:assert");function akr(t){if(skr(t))return null;let e="",n="",r="",i="";if(t.includes(";")){let s={position:0};e=Cde(";",t,s),n=t.slice(s.position)}else e=t;if(!e.includes("="))i=e;else{let s={position:0};r=Cde("=",e,s),i=e.slice(s.position+1)}return r=r.trim(),i=i.trim(),r.length+i.length>rkr?null:{name:r,value:i,...L$(n)}}function L$(t,e={}){if(t.length===0)return e;okr(t[0]===";"),t=t.slice(1);let n="";t.includes(";")?(n=Cde(";",t,{position:0}),t=t.slice(n.length)):(n=t,t="");let r="",i="";if(n.includes("=")){let o={position:0};r=Cde("=",n,o),i=n.slice(o.position+1)}else r=n;if(r=r.trim(),i=i.trim(),i.length>ikr)return L$(t,e);let s=r.toLowerCase();if(s==="expires"){let o=new Date(i);e.expires=o}else if(s==="max-age"){let o=i.charCodeAt(0);if((o<48||o>57)&&i[0]!=="-"||!/^\d+$/.test(i))return L$(t,e);let a=Number(i);e.maxAge=a}else if(s==="domain"){let o=i;o[0]==="."&&(o=o.slice(1)),o=o.toLowerCase(),e.domain=o}else if(s==="path"){let o="";i.length===0||i[0]!=="/"?o="/":o=i,e.path=o}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let o=i.toLowerCase();o==="none"?e.sameSite="None":o==="strict"?e.sameSite="Strict":o==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${r}=${i}`);return L$(t,e)}$1t.exports={parseSetCookie:akr,parseUnparsedAttributes:L$}});var j1t=re((mDs,q1t)=>{"use strict";p();var{parseSetCookie:ckr}=W1t(),{stringify:lkr}=uQe(),{webidl:Eo}=Sm(),{Headers:Ide}=jM();function ukr(t){Eo.argumentLengthCheck(arguments,1,"getCookies"),Eo.brandCheck(t,Ide,{strict:!1});let e=t.get("cookie"),n={};if(!e)return n;for(let r of e.split(";")){let[i,...s]=r.split("=");n[i.trim()]=s.join("=")}return n}function dkr(t,e,n){Eo.brandCheck(t,Ide,{strict:!1});let r="deleteCookie";Eo.argumentLengthCheck(arguments,2,r),e=Eo.converters.DOMString(e,r,"name"),n=Eo.converters.DeleteCookieAttributes(n),H1t(t,{name:e,value:"",expires:new Date(0),...n})}function pkr(t){Eo.argumentLengthCheck(arguments,1,"getSetCookies"),Eo.brandCheck(t,Ide,{strict:!1});let e=t.getSetCookie();return e?e.map(n=>ckr(n)):[]}function H1t(t,e){Eo.argumentLengthCheck(arguments,2,"setCookie"),Eo.brandCheck(t,Ide,{strict:!1}),e=Eo.converters.Cookie(e);let n=lkr(e);n&&t.append("Set-Cookie",n)}Eo.converters.DeleteCookieAttributes=Eo.dictionaryConverter([{converter:Eo.nullableConverter(Eo.converters.DOMString),key:"path",defaultValue:()=>null},{converter:Eo.nullableConverter(Eo.converters.DOMString),key:"domain",defaultValue:()=>null}]);Eo.converters.Cookie=Eo.dictionaryConverter([{converter:Eo.converters.DOMString,key:"name"},{converter:Eo.converters.DOMString,key:"value"},{converter:Eo.nullableConverter(t=>typeof t=="number"?Eo.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:()=>null},{converter:Eo.nullableConverter(Eo.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:Eo.nullableConverter(Eo.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:Eo.nullableConverter(Eo.converters.DOMString),key:"path",defaultValue:()=>null},{converter:Eo.nullableConverter(Eo.converters.boolean),key:"secure",defaultValue:()=>null},{converter:Eo.nullableConverter(Eo.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:Eo.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Eo.sequenceConverter(Eo.converters.DOMString),key:"unparsed",defaultValue:()=>new Array(0)}]);q1t.exports={getCookies:ukr,deleteCookie:dkr,getSetCookies:pkr,setCookie:H1t}});var Q$=re((fDs,Y1t)=>{"use strict";p();var{webidl:zr}=Sm(),{kEnumerableProperty:Hg}=to(),{kConstruct:V1t}=bl(),{MessagePort:mkr}=require("node:worker_threads"),F$=class t extends Event{#e;constructor(e,n={}){if(e===V1t){super(arguments[1],arguments[2]),zr.util.markAsUncloneable(this);return}let r="MessageEvent constructor";zr.argumentLengthCheck(arguments,1,r),e=zr.converters.DOMString(e,r,"type"),n=zr.converters.MessageEventInit(n,r,"eventInitDict"),super(e,n),this.#e=n,zr.util.markAsUncloneable(this)}get data(){return zr.brandCheck(this,t),this.#e.data}get origin(){return zr.brandCheck(this,t),this.#e.origin}get lastEventId(){return zr.brandCheck(this,t),this.#e.lastEventId}get source(){return zr.brandCheck(this,t),this.#e.source}get ports(){return zr.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,n=!1,r=!1,i=null,s="",o="",a=null,c=[]){return zr.brandCheck(this,t),zr.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:n,cancelable:r,data:i,origin:s,lastEventId:o,source:a,ports:c})}static createFastMessageEvent(e,n){let r=new t(V1t,e,n);return r.#e=n,r.#e.data??=null,r.#e.origin??="",r.#e.lastEventId??="",r.#e.source??=null,r.#e.ports??=[],r}},{createFastMessageEvent:hkr}=F$;delete F$.createFastMessageEvent;var wde=class t extends Event{#e;constructor(e,n={}){let r="CloseEvent constructor";zr.argumentLengthCheck(arguments,1,r),e=zr.converters.DOMString(e,r,"type"),n=zr.converters.CloseEventInit(n),super(e,n),this.#e=n,zr.util.markAsUncloneable(this)}get wasClean(){return zr.brandCheck(this,t),this.#e.wasClean}get code(){return zr.brandCheck(this,t),this.#e.code}get reason(){return zr.brandCheck(this,t),this.#e.reason}},Tde=class t extends Event{#e;constructor(e,n){let r="ErrorEvent constructor";zr.argumentLengthCheck(arguments,1,r),super(e,n),zr.util.markAsUncloneable(this),e=zr.converters.DOMString(e,r,"type"),n=zr.converters.ErrorEventInit(n??{}),this.#e=n}get message(){return zr.brandCheck(this,t),this.#e.message}get filename(){return zr.brandCheck(this,t),this.#e.filename}get lineno(){return zr.brandCheck(this,t),this.#e.lineno}get colno(){return zr.brandCheck(this,t),this.#e.colno}get error(){return zr.brandCheck(this,t),this.#e.error}};Object.defineProperties(F$.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:Hg,origin:Hg,lastEventId:Hg,source:Hg,ports:Hg,initMessageEvent:Hg});Object.defineProperties(wde.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:Hg,code:Hg,wasClean:Hg});Object.defineProperties(Tde.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:Hg,filename:Hg,lineno:Hg,colno:Hg,error:Hg});zr.converters.MessagePort=zr.interfaceConverter(mkr);zr.converters["sequence"]=zr.sequenceConverter(zr.converters.MessagePort);var dQe=[{key:"bubbles",converter:zr.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:zr.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:zr.converters.boolean,defaultValue:()=>!1}];zr.converters.MessageEventInit=zr.dictionaryConverter([...dQe,{key:"data",converter:zr.converters.any,defaultValue:()=>null},{key:"origin",converter:zr.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:zr.converters.DOMString,defaultValue:()=>""},{key:"source",converter:zr.nullableConverter(zr.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:zr.converters["sequence"],defaultValue:()=>new Array(0)}]);zr.converters.CloseEventInit=zr.dictionaryConverter([...dQe,{key:"wasClean",converter:zr.converters.boolean,defaultValue:()=>!1},{key:"code",converter:zr.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:zr.converters.USVString,defaultValue:()=>""}]);zr.converters.ErrorEventInit=zr.dictionaryConverter([...dQe,{key:"message",converter:zr.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:zr.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:zr.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:zr.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:zr.converters.any}]);Y1t.exports={MessageEvent:F$,CloseEvent:wde,ErrorEvent:Tde,createFastMessageEvent:hkr}});var XM=re((ADs,z1t)=>{"use strict";p();var fkr="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",gkr={enumerable:!0,writable:!1,configurable:!1},Akr={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},ykr={NOT_SENT:0,PROCESSING:1,SENT:2},Ekr={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},bkr=2**16-1,_kr={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},xkr=Buffer.allocUnsafe(0),Skr={string:1,typedArray:2,arrayBuffer:3,blob:4};z1t.exports={uid:fkr,sentCloseFrameState:ykr,staticPropertyDescriptors:gkr,states:Akr,opcodes:Ekr,maxUnsigned16Bit:bkr,parserStates:_kr,emptyBuffer:xkr,sendHints:Skr}});var az=re((EDs,K1t)=>{"use strict";p();K1t.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var uz=re((_Ds,sBt)=>{"use strict";p();var{kReadyState:cz,kController:Ckr,kResponse:Ikr,kBinaryType:wkr,kWebSocketURL:Tkr}=az(),{states:lz,opcodes:h1}=XM(),{ErrorEvent:vkr,createFastMessageEvent:Rkr}=Q$(),{isUtf8:kkr}=require("node:buffer"),{collectASequenceOfCodePointsFast:Bkr,removeHTTPWhitespace:J1t}=Ug();function Nkr(t){return t[cz]===lz.CONNECTING}function Dkr(t){return t[cz]===lz.OPEN}function Pkr(t){return t[cz]===lz.CLOSING}function Mkr(t){return t[cz]===lz.CLOSED}function pQe(t,e,n=(i,s)=>new Event(i,s),r={}){let i=n(t,r);e.dispatchEvent(i)}function Okr(t,e,n){if(t[cz]!==lz.OPEN)return;let r;if(e===h1.TEXT)try{r=iBt(n)}catch{Z1t(t,"Received invalid UTF-8 in text frame.");return}else e===h1.BINARY&&(t[wkr]==="blob"?r=new Blob([n]):r=Lkr(n));pQe("message",t,Rkr,{origin:t[Tkr].origin,data:r})}function Lkr(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function Fkr(t){if(t.length===0)return!1;for(let e=0;e126||n===34||n===40||n===41||n===44||n===47||n===58||n===59||n===60||n===61||n===62||n===63||n===64||n===91||n===92||n===93||n===123||n===125)return!1}return!0}function Qkr(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}function Z1t(t,e){let{[Ckr]:n,[Ikr]:r}=t;n.abort(),r?.socket&&!r.socket.destroyed&&r.socket.destroy(),e&&pQe("error",t,(i,s)=>new vkr(i,s),{error:new Error(e),message:e})}function eBt(t){return t===h1.CLOSE||t===h1.PING||t===h1.PONG}function tBt(t){return t===h1.CONTINUATION}function nBt(t){return t===h1.TEXT||t===h1.BINARY}function Ukr(t){return nBt(t)||tBt(t)||eBt(t)}function Gkr(t){let e={position:0},n=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}var rBt=typeof process.versions.icu=="string",X1t=rBt?new TextDecoder("utf-8",{fatal:!0}):void 0,iBt=rBt?X1t.decode.bind(X1t):function(t){if(kkr(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};sBt.exports={isConnecting:Nkr,isEstablished:Dkr,isClosing:Pkr,isClosed:Mkr,fireEvent:pQe,isValidSubprotocol:Fkr,isValidStatusCode:Qkr,failWebsocketConnection:Z1t,websocketMessageReceived:Okr,utf8Decode:iBt,isControlFrame:eBt,isContinuationFrame:tBt,isTextBinaryFrame:nBt,isValidOpcode:Ukr,parseExtensions:Gkr,isValidClientWindowBits:$kr}});var Rde=re((SDs,oBt)=>{"use strict";p();var{maxUnsigned16Bit:Wkr}=XM(),vde=16386,mQe,dz=null,U$=vde;try{mQe=require("node:crypto")}catch{mQe={randomFillSync:function(e,n,r){for(let i=0;iWkr?(o+=8,s=127):i>125&&(o+=2,s=126);let a=Buffer.allocUnsafe(i+o);a[0]=a[1]=0,a[0]|=128,a[0]=(a[0]&240)+e;a[o-4]=r[0],a[o-3]=r[1],a[o-2]=r[2],a[o-1]=r[3],a[1]=s,s===126?a.writeUInt16BE(i,2):s===127&&(a[2]=a[3]=0,a.writeUIntBE(i,4,6)),a[1]|=128;for(let c=0;c{"use strict";p();var{uid:qkr,states:pz,sentCloseFrameState:kde,emptyBuffer:jkr,opcodes:Vkr}=XM(),{kReadyState:mz,kSentClose:Bde,kByteParser:cBt,kReceivedClose:aBt,kResponse:lBt}=az(),{fireEvent:Ykr,failWebsocketConnection:f1,isClosing:zkr,isClosed:Kkr,isEstablished:Jkr,parseExtensions:Xkr}=uz(),{channels:G$}=XG(),{CloseEvent:Zkr}=Q$(),{makeRequest:e1r}=D$(),{fetching:t1r}=rz(),{Headers:n1r,getHeadersList:r1r}=jM(),{getDecodeSplit:i1r}=ey(),{WebsocketFrameSend:s1r}=Rde(),fQe;try{fQe=require("node:crypto")}catch{}function o1r(t,e,n,r,i,s){let o=t;o.protocol=t.protocol==="ws:"?"http:":"https:";let a=e1r({urlList:[o],client:n,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let d=r1r(new n1r(s.headers));a.headersList=d}let c=fQe.randomBytes(16).toString("base64");a.headersList.append("sec-websocket-key",c),a.headersList.append("sec-websocket-version","13");for(let d of e)a.headersList.append("sec-websocket-protocol",d);return a.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits"),t1r({request:a,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(d){if(d.type==="error"||d.status!==101){f1(r,"Received network error or non-101 status code.");return}if(e.length!==0&&!d.headersList.get("Sec-WebSocket-Protocol")){f1(r,"Server did not respond with sent protocols.");return}if(d.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){f1(r,'Server did not set Upgrade header to "websocket".');return}if(d.headersList.get("Connection")?.toLowerCase()!=="upgrade"){f1(r,'Server did not set Connection header to "upgrade".');return}let m=d.headersList.get("Sec-WebSocket-Accept"),h=fQe.createHash("sha1").update(c+qkr).digest("base64");if(m!==h){f1(r,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let f=d.headersList.get("Sec-WebSocket-Extensions"),g;if(f!==null&&(g=Xkr(f),!g.has("permessage-deflate"))){f1(r,"Sec-WebSocket-Extensions header does not match.");return}let A=d.headersList.get("Sec-WebSocket-Protocol");if(A!==null&&!i1r("sec-websocket-protocol",a.headersList).includes(A)){f1(r,"Protocol was not set in the opening handshake.");return}d.socket.on("data",uBt),d.socket.on("close",dBt),d.socket.on("error",pBt),G$.open.hasSubscribers&&G$.open.publish({address:d.socket.address(),protocol:A,extensions:f}),i(d,g)}})}function a1r(t,e,n,r){if(!(zkr(t)||Kkr(t)))if(!Jkr(t))f1(t,"Connection was closed before it was established."),t[mz]=pz.CLOSING;else if(t[Bde]===kde.NOT_SENT){t[Bde]=kde.PROCESSING;let i=new s1r;e!==void 0&&n===void 0?(i.frameData=Buffer.allocUnsafe(2),i.frameData.writeUInt16BE(e,0)):e!==void 0&&n!==void 0?(i.frameData=Buffer.allocUnsafe(2+r),i.frameData.writeUInt16BE(e,0),i.frameData.write(n,2,"utf-8")):i.frameData=jkr,t[lBt].socket.write(i.createFrame(Vkr.CLOSE)),t[Bde]=kde.SENT,t[mz]=pz.CLOSING}else t[mz]=pz.CLOSING}function uBt(t){this.ws[cBt].write(t)||this.pause()}function dBt(){let{ws:t}=this,{[lBt]:e}=t;e.socket.off("data",uBt),e.socket.off("close",dBt),e.socket.off("error",pBt);let n=t[Bde]===kde.SENT&&t[aBt],r=1005,i="",s=t[cBt].closingInfo;s&&!s.error?(r=s.code??1005,i=s.reason):t[aBt]||(r=1006),t[mz]=pz.CLOSED,Ykr("close",t,(o,a)=>new Zkr(o,a),{wasClean:n,code:r,reason:i}),G$.close.hasSubscribers&&G$.close.publish({websocket:t,code:r,reason:i})}function pBt(t){let{ws:e}=this;e[mz]=pz.CLOSING,G$.socketError.hasSubscribers&&G$.socketError.publish(t),this.destroy()}mBt.exports={establishWebSocketConnection:o1r,closeWebSocketConnection:a1r}});var fBt=re((TDs,hBt)=>{"use strict";p();var{createInflateRaw:c1r,Z_DEFAULT_WINDOWBITS:l1r}=require("node:zlib"),{isValidClientWindowBits:u1r}=uz(),{MessageSizeExceededError:d1r}=Jo(),p1r=Buffer.from([0,0,255,255]),Nde=Symbol("kBuffer"),hz=Symbol("kLength"),AQe=class{#e;#t={};#n=0;constructor(e,n){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits"),this.#n=n.maxPayloadSize}decompress(e,n,r){if(!this.#e){let i=l1r;if(this.#t.serverMaxWindowBits){if(!u1r(this.#t.serverMaxWindowBits)){r(new Error("Invalid server_max_window_bits"));return}i=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=c1r({windowBits:i})}catch(s){r(s);return}this.#e[Nde]=[],this.#e[hz]=0,this.#e.on("data",s=>{if(this.#e[hz]+=s.length,this.#n>0&&this.#e[hz]>this.#n){r(new d1r),this.#e.removeAllListeners(),this.#e=null;return}this.#e[Nde].push(s)}),this.#e.on("error",s=>{this.#e=null,r(s)})}this.#e.write(e),n&&this.#e.write(p1r),this.#e.flush(()=>{if(!this.#e)return;let i=Buffer.concat(this.#e[Nde],this.#e[hz]);this.#e[Nde].length=0,this.#e[hz]=0,r(null,i)})}};hBt.exports={PerMessageDeflate:AQe}});var IBt=re((RDs,CBt)=>{"use strict";p();var{Writable:m1r}=require("node:stream"),h1r=require("node:assert"),{parserStates:qg,opcodes:$$,states:f1r,emptyBuffer:gBt,sentCloseFrameState:ABt}=XM(),{kReadyState:g1r,kSentClose:yBt,kResponse:EBt,kReceivedClose:bBt}=az(),{channels:Dde}=XG(),{isValidStatusCode:A1r,isValidOpcode:y1r,failWebsocketConnection:cy,websocketMessageReceived:_Bt,utf8Decode:E1r,isControlFrame:yQe,isTextBinaryFrame:EQe,isContinuationFrame:b1r}=uz(),{WebsocketFrameSend:xBt}=Rde(),{closeWebSocketConnection:SBt}=gQe(),{PerMessageDeflate:_1r}=fBt(),{MessageSizeExceededError:bQe}=Jo();function fz(t,e,n){SBt(t,e,n,Buffer.byteLength(n)),cy(t,n)}var _Qe=class extends m1r{#e=[];#t=0;#n=0;#r=!1;#i=qg.INFO;#s={};#o=[];#a;#c;#l;constructor(e,n,r={}){super(),this.ws=e,this.#a=n??new Map,this.#c=r.maxFragments??0,this.#l=r.maxPayloadSize??0,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new _1r(n,r))}_write(e,n,r){this.#e.push(e),this.#n+=e.length,this.#r=!0,this.run(r)}#d(){return this.#l>0&&!yQe(this.#s.opcode)&&this.#s.payloadLength+this.#t>this.#l?(fz(this.ws,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#r;)if(this.#i===qg.INFO){if(this.#n<2)return e();let n=this.consume(2),r=(n[0]&128)!==0,i=n[0]&15,s=(n[1]&128)===128,o=!r&&i!==$$.CONTINUATION,a=n[1]&127,c=n[0]&64,u=n[0]&32,l=n[0]&16;if(!y1r(i))return cy(this.ws,"Invalid opcode received"),e();if(s)return cy(this.ws,"Frame cannot be masked"),e();if(c!==0&&!this.#a.has("permessage-deflate")){cy(this.ws,"Expected RSV1 to be clear.");return}if(u!==0||l!==0){cy(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(o&&!EQe(i)){cy(this.ws,"Invalid frame type was fragmented.");return}if(EQe(i)&&this.#o.length>0){cy(this.ws,"Expected continuation frame");return}if(this.#s.fragmented&&o){cy(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((a>125||o)&&yQe(i)){cy(this.ws,"Control frame either too large or fragmented");return}if(b1r(i)&&this.#o.length===0&&!this.#s.compressed){cy(this.ws,"Unexpected continuation frame");return}if(a<=125){if(this.#s.payloadLength=a,this.#i=qg.READ_DATA,!this.#d())return}else a===126?this.#i=qg.PAYLOADLENGTH_16:a===127&&(this.#i=qg.PAYLOADLENGTH_64);EQe(i)&&(this.#s.binaryType=i,this.#s.compressed=c!==0),this.#s.opcode=i,this.#s.masked=s,this.#s.fin=r,this.#s.fragmented=o}else if(this.#i===qg.PAYLOADLENGTH_16){if(this.#n<2)return e();let n=this.consume(2);if(this.#s.payloadLength=n.readUInt16BE(0),this.#i=qg.READ_DATA,!this.#d())return}else if(this.#i===qg.PAYLOADLENGTH_64){if(this.#n<8)return e();let n=this.consume(8),r=n.readUInt32BE(0),i=n.readUInt32BE(4);if(r!==0||i>2**31-1){cy(this.ws,"Received payload length > 2^31 bytes.");return}if(this.#s.payloadLength=i,this.#i=qg.READ_DATA,!this.#d())return}else if(this.#i===qg.READ_DATA){if(this.#n{if(r){let s=r instanceof bQe?1009:1007;fz(this.ws,s,r.message);return}if(this.writeFragments(i)){if(this.#l>0&&this.#t>this.#l){fz(this.ws,1009,new bQe().message);return}if(!this.#s.fin){this.#i=qg.INFO,this.#r=!0,this.run(e);return}_Bt(this.ws,this.#s.binaryType,this.consumeFragments()),this.#r=!0,this.#i=qg.INFO,this.run(e)}}),this.#r=!1;break}else{if(!this.writeFragments(n))return;if(this.#l>0&&this.#t>this.#l){fz(this.ws,1009,new bQe().message);return}!this.#s.fragmented&&this.#s.fin&&_Bt(this.ws,this.#s.binaryType,this.consumeFragments()),this.#i=qg.INFO}}}consume(e){if(e>this.#n)throw new Error("Called consume() before buffers satiated.");if(e===0)return gBt;if(this.#e[0].length===e)return this.#n-=this.#e[0].length,this.#e.shift();let n=Buffer.allocUnsafe(e),r=0;for(;r!==e;){let i=this.#e[0],{length:s}=i;if(s+r===e){n.set(this.#e.shift(),r);break}else if(s+r>e){n.set(i.subarray(0,e-r),r),this.#e[0]=i.subarray(e-r);break}else n.set(this.#e.shift(),r),r+=i.length}return this.#n-=e,n}writeFragments(e){return this.#c>0&&this.#o.length===this.#c?(fz(this.ws,1008,"Too many message fragments"),!1):(this.#t+=e.length,this.#o.push(e),!0)}consumeFragments(){let e=this.#o;if(e.length===1)return this.#t=0,e.shift();let n=Buffer.concat(e,this.#t);return this.#o=[],this.#t=0,n}parseCloseBody(e){h1r(e.length!==1);let n;if(e.length>=2&&(n=e.readUInt16BE(0)),n!==void 0&&!A1r(n))return{code:1002,reason:"Invalid status code",error:!0};let r=e.subarray(2);r[0]===239&&r[1]===187&&r[2]===191&&(r=r.subarray(3));try{r=E1r(r)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:n,reason:r,error:!1}}parseControlFrame(e){let{opcode:n,payloadLength:r}=this.#s;if(n===$$.CLOSE){if(r===1)return cy(this.ws,"Received close frame with a 1-byte body."),!1;if(this.#s.closeInfo=this.parseCloseBody(e),this.#s.closeInfo.error){let{code:i,reason:s}=this.#s.closeInfo;return SBt(this.ws,i,s,s.length),cy(this.ws,s),!1}if(this.ws[yBt]!==ABt.SENT){let i=gBt;this.#s.closeInfo.code&&(i=Buffer.allocUnsafe(2),i.writeUInt16BE(this.#s.closeInfo.code,0));let s=new xBt(i);this.ws[EBt].socket.write(s.createFrame($$.CLOSE),o=>{o||(this.ws[yBt]=ABt.SENT)})}return this.ws[g1r]=f1r.CLOSING,this.ws[bBt]=!0,!1}else if(n===$$.PING){if(!this.ws[bBt]){let i=new xBt(e);this.ws[EBt].socket.write(i.createFrame($$.PONG)),Dde.ping.hasSubscribers&&Dde.ping.publish({payload:e})}}else n===$$.PONG&&Dde.pong.hasSubscribers&&Dde.pong.publish({payload:e});return!0}get closingInfo(){return this.#s.closeInfo}};CBt.exports={ByteParser:_Qe}});var kBt=re((BDs,RBt)=>{"use strict";p();var{WebsocketFrameSend:x1r}=Rde(),{opcodes:wBt,sendHints:W$}=XM(),S1r=R2e(),TBt=Buffer[Symbol.species],xQe=class{#e=new S1r;#t=!1;#n;constructor(e){this.#n=e}add(e,n,r){if(r!==W$.blob){let s=vBt(e,r);if(!this.#t)this.#n.write(s,n);else{let o={promise:null,callback:n,frame:s};this.#e.push(o)}return}let i={promise:e.arrayBuffer().then(s=>{i.promise=null,i.frame=vBt(s,r)}),callback:n,frame:null};this.#e.push(i),this.#t||this.#r()}async#r(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let n=e.shift();n.promise!==null&&await n.promise,this.#n.write(n.frame,n.callback),n.callback=n.frame=null}this.#t=!1}};function vBt(t,e){return new x1r(C1r(t,e)).createFrame(e===W$.string?wBt.TEXT:wBt.BINARY)}function C1r(t,e){switch(e){case W$.string:return Buffer.from(t);case W$.arrayBuffer:case W$.blob:return new TBt(t);case W$.typedArray:return new TBt(t.buffer,t.byteOffset,t.byteLength)}}RBt.exports={SendQueue:xQe}});var UBt=re((DDs,QBt)=>{"use strict";p();var{webidl:Vi}=Sm(),{URLSerializer:I1r}=Ug(),{environmentSettingsObject:BBt}=ey(),{staticPropertyDescriptors:g1,states:gz,sentCloseFrameState:w1r,sendHints:Pde}=XM(),{kWebSocketURL:NBt,kReadyState:SQe,kController:DBt,kBinaryType:Mde,kResponse:PBt,kSentClose:T1r,kByteParser:v1r}=az(),{isConnecting:R1r,isEstablished:k1r,isClosing:B1r,isValidSubprotocol:N1r,fireEvent:MBt}=uz(),{establishWebSocketConnection:D1r,closeWebSocketConnection:OBt}=gQe(),{ByteParser:P1r}=IBt(),{kEnumerableProperty:c0,isBlobLike:LBt}=to(),{getGlobalDispatcher:M1r}=Kue(),{types:FBt}=require("node:util"),{ErrorEvent:O1r,CloseEvent:L1r}=Q$(),{SendQueue:F1r}=kBt(),ly=class t extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n="";#r="";#i;constructor(e,n=[]){super(),Vi.util.markAsUncloneable(this);let r="WebSocket constructor";Vi.argumentLengthCheck(arguments,1,r);let i=Vi.converters["DOMString or sequence or WebSocketInit"](n,r,"options");e=Vi.converters.USVString(e,r,"url"),n=i.protocols;let s=BBt.settingsObject.baseUrl,o;try{o=new URL(e,s)}catch(c){throw new DOMException(c,"SyntaxError")}if(o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),o.protocol!=="ws:"&&o.protocol!=="wss:")throw new DOMException(`Expected a ws: or wss: protocol, got ${o.protocol}`,"SyntaxError");if(o.hash||o.href.endsWith("#"))throw new DOMException("Got fragment","SyntaxError");if(typeof n=="string"&&(n=[n]),n.length!==new Set(n.map(c=>c.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(n.length>0&&!n.every(c=>N1r(c)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[NBt]=new URL(o.href);let a=BBt.settingsObject;this[DBt]=D1r(o,n,a,this,(c,u)=>this.#s(c,u),i),this[SQe]=t.CONNECTING,this[T1r]=w1r.NOT_SENT,this[Mde]="blob"}close(e=void 0,n=void 0){Vi.brandCheck(this,t);let r="WebSocket.close";if(e!==void 0&&(e=Vi.converters["unsigned short"](e,r,"code",{clamp:!0})),n!==void 0&&(n=Vi.converters.USVString(n,r,"reason")),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new DOMException("invalid code","InvalidAccessError");let i=0;if(n!==void 0&&(i=Buffer.byteLength(n),i>123))throw new DOMException(`Reason must be less than 123 bytes; received ${i}`,"SyntaxError");OBt(this,e,n,i)}send(e){Vi.brandCheck(this,t);let n="WebSocket.send";if(Vi.argumentLengthCheck(arguments,1,n),e=Vi.converters.WebSocketSendData(e,n,"data"),R1r(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!k1r(this)||B1r(this)))if(typeof e=="string"){let r=Buffer.byteLength(e);this.#t+=r,this.#i.add(e,()=>{this.#t-=r},Pde.string)}else FBt.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Pde.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Pde.typedArray)):LBt(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Pde.blob))}get readyState(){return Vi.brandCheck(this,t),this[SQe]}get bufferedAmount(){return Vi.brandCheck(this,t),this.#t}get url(){return Vi.brandCheck(this,t),I1r(this[NBt])}get extensions(){return Vi.brandCheck(this,t),this.#r}get protocol(){return Vi.brandCheck(this,t),this.#n}get onopen(){return Vi.brandCheck(this,t),this.#e.open}set onopen(e){Vi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return Vi.brandCheck(this,t),this.#e.error}set onerror(e){Vi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return Vi.brandCheck(this,t),this.#e.close}set onclose(e){Vi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return Vi.brandCheck(this,t),this.#e.message}set onmessage(e){Vi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return Vi.brandCheck(this,t),this[Mde]}set binaryType(e){Vi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[Mde]="blob":this[Mde]=e}#s(e,n){this[PBt]=e;let r=this[DBt]?.dispatcher?.webSocketOptions,i=r?.maxFragments,s=r?.maxPayloadSize,o=new P1r(this,n,{maxFragments:i,maxPayloadSize:s});o.on("drain",Q1r),o.on("error",U1r.bind(this)),e.socket.ws=this,this[v1r]=o,this.#i=new F1r(e.socket),this[SQe]=gz.OPEN;let a=e.headersList.get("sec-websocket-extensions");a!==null&&(this.#r=a);let c=e.headersList.get("sec-websocket-protocol");c!==null&&(this.#n=c),MBt("open",this)}};ly.CONNECTING=ly.prototype.CONNECTING=gz.CONNECTING;ly.OPEN=ly.prototype.OPEN=gz.OPEN;ly.CLOSING=ly.prototype.CLOSING=gz.CLOSING;ly.CLOSED=ly.prototype.CLOSED=gz.CLOSED;Object.defineProperties(ly.prototype,{CONNECTING:g1,OPEN:g1,CLOSING:g1,CLOSED:g1,url:c0,readyState:c0,bufferedAmount:c0,onopen:c0,onerror:c0,onclose:c0,close:c0,onmessage:c0,binaryType:c0,send:c0,extensions:c0,protocol:c0,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(ly,{CONNECTING:g1,OPEN:g1,CLOSING:g1,CLOSED:g1});Vi.converters["sequence"]=Vi.sequenceConverter(Vi.converters.DOMString);Vi.converters["DOMString or sequence"]=function(t,e,n){return Vi.util.Type(t)==="Object"&&Symbol.iterator in t?Vi.converters["sequence"](t):Vi.converters.DOMString(t,e,n)};Vi.converters.WebSocketInit=Vi.dictionaryConverter([{key:"protocols",converter:Vi.converters["DOMString or sequence"],defaultValue:()=>new Array(0)},{key:"dispatcher",converter:Vi.converters.any,defaultValue:()=>M1r()},{key:"headers",converter:Vi.nullableConverter(Vi.converters.HeadersInit)}]);Vi.converters["DOMString or sequence or WebSocketInit"]=function(t){return Vi.util.Type(t)==="Object"&&!(Symbol.iterator in t)?Vi.converters.WebSocketInit(t):{protocols:Vi.converters["DOMString or sequence"](t)}};Vi.converters.WebSocketSendData=function(t){if(Vi.util.Type(t)==="Object"){if(LBt(t))return Vi.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||FBt.isArrayBuffer(t))return Vi.converters.BufferSource(t)}return Vi.converters.USVString(t)};function Q1r(){this.ws[PBt].socket.resume()}function U1r(t){let e,n;t instanceof L1r?(e=t.reason,n=t.code):e=t.message,MBt("error",this,()=>new O1r("error",{error:t,message:e})),OBt(this,n)}QBt.exports={WebSocket:ly}});var CQe=re((MDs,GBt)=>{"use strict";p();function G1r(t){return t.indexOf("\0")===-1}function $1r(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}function W1r(t){return new Promise(e=>{setTimeout(e,t).unref()})}GBt.exports={isValidLastEventId:G1r,isASCIINumber:$1r,delay:W1r}});var qBt=re((LDs,HBt)=>{"use strict";p();var{Transform:H1r}=require("node:stream"),{isASCIINumber:$Bt,isValidLastEventId:WBt}=CQe(),FT=[239,187,191],IQe=10,Ode=13,q1r=58,j1r=32,wQe=class extends H1r{state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,n,r){if(e.length===0){r();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===FT[0]){r();return}this.checkBOM=!1,r();return;case 2:if(this.buffer[0]===FT[0]&&this.buffer[1]===FT[1]){r();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===FT[0]&&this.buffer[1]===FT[1]&&this.buffer[2]===FT[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,r();return}this.checkBOM=!1;break;default:this.buffer[0]===FT[0]&&this.buffer[1]===FT[1]&&this.buffer[2]===FT[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(n[i]=s);break}}processEvent(e){e.retry&&$Bt(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&WBt(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};HBt.exports={EventSourceStream:wQe}});var ZBt=re((QDs,XBt)=>{"use strict";p();var{pipeline:V1r}=require("node:stream"),{fetching:Y1r}=rz(),{makeRequest:z1r}=D$(),{webidl:QT}=Sm(),{EventSourceStream:K1r}=qBt(),{parseMIMEType:J1r}=Ug(),{createFastMessageEvent:X1r}=Q$(),{isNetworkError:jBt}=tz(),{delay:Z1r}=CQe(),{kEnumerableProperty:ZM}=to(),{environmentSettingsObject:VBt}=ey(),YBt=!1,zBt=3e3,Az=0,KBt=1,yz=2,eBr="anonymous",tBr="use-credentials",H$=class t extends EventTarget{#e={open:null,error:null,message:null};#t=null;#n=!1;#r=Az;#i=null;#s=null;#o;#a;constructor(e,n={}){super(),QT.util.markAsUncloneable(this);let r="EventSource constructor";QT.argumentLengthCheck(arguments,1,r),YBt||(YBt=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=QT.converters.USVString(e,r,"url"),n=QT.converters.EventSourceInitDict(n,r,"eventSourceInitDict"),this.#o=n.dispatcher,this.#a={lastEventId:"",reconnectionTime:zBt};let i=VBt,s;try{s=new URL(e,i.settingsObject.baseUrl),this.#a.origin=s.origin}catch(c){throw new DOMException(c,"SyntaxError")}this.#t=s.href;let o=eBr;n.withCredentials&&(o=tBr,this.#n=!0);let a={redirect:"follow",keepalive:!0,mode:"cors",credentials:o==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};a.client=VBt.settingsObject,a.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],a.cache="no-store",a.initiator="other",a.urlList=[new URL(this.#t)],this.#i=z1r(a),this.#c()}get readyState(){return this.#r}get url(){return this.#t}get withCredentials(){return this.#n}#c(){if(this.#r===yz)return;this.#r=Az;let e={request:this.#i,dispatcher:this.#o},n=r=>{jBt(r)&&(this.dispatchEvent(new Event("error")),this.close()),this.#l()};e.processResponseEndOfBody=n,e.processResponse=r=>{if(jBt(r))if(r.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#l();return}let i=r.headersList.get("content-type",!0),s=i!==null?J1r(i):"failure",o=s!=="failure"&&s.essence==="text/event-stream";if(r.status!==200||o===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#r=KBt,this.dispatchEvent(new Event("open")),this.#a.origin=r.urlList[r.urlList.length-1].origin;let a=new K1r({eventSourceSettings:this.#a,push:c=>{this.dispatchEvent(X1r(c.type,c.options))}});V1r(r.body.stream,a,c=>{c?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#s=Y1r(e)}async#l(){this.#r!==yz&&(this.#r=Az,this.dispatchEvent(new Event("error")),await Z1r(this.#a.reconnectionTime),this.#r===Az&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){QT.brandCheck(this,t),this.#r!==yz&&(this.#r=yz,this.#s.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}},JBt={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Az,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:KBt,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:yz,writable:!1}};Object.defineProperties(H$,JBt);Object.defineProperties(H$.prototype,JBt);Object.defineProperties(H$.prototype,{close:ZM,onerror:ZM,onmessage:ZM,onopen:ZM,readyState:ZM,url:ZM,withCredentials:ZM});QT.converters.EventSourceInitDict=QT.dictionaryConverter([{key:"withCredentials",converter:QT.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:QT.converters.any}]);XBt.exports={EventSource:H$,defaultReconnectionTime:zBt}});var Qde=re((GDs,Pi)=>{"use strict";p();var nBr=y$(),eNt=_6(),rBr=E$(),iBr=JTt(),sBr=b$(),oBr=z2e(),aBr=_vt(),cBr=Tvt(),tNt=Jo(),Fde=to(),{InvalidArgumentError:Lde}=tNt,q$=mRt(),lBr=S6(),uBr=kFe(),dBr=zRt(),pBr=DFe(),mBr=AFe(),hBr=Uue(),{getGlobalDispatcher:nNt,setGlobalDispatcher:fBr}=Kue(),gBr=Jue(),ABr=Rue(),yBr=kue();Object.assign(eNt.prototype,q$);Pi.exports.Dispatcher=eNt;Pi.exports.Client=nBr;Pi.exports.Pool=rBr;Pi.exports.BalancedPool=iBr;Pi.exports.Agent=sBr;Pi.exports.ProxyAgent=oBr;Pi.exports.EnvHttpProxyAgent=aBr;Pi.exports.RetryAgent=cBr;Pi.exports.RetryHandler=hBr;Pi.exports.DecoratorHandler=gBr;Pi.exports.RedirectHandler=ABr;Pi.exports.createRedirectInterceptor=yBr;Pi.exports.interceptors={redirect:nkt(),retry:ikt(),dump:okt(),dns:lkt()};Pi.exports.buildConnector=lBr;Pi.exports.errors=tNt;Pi.exports.util={parseHeaders:Fde.parseHeaders,headerNameToString:Fde.headerNameToString};function Ez(t){return(e,n,r)=>{if(typeof n=="function"&&(r=n,n=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new Lde("invalid url");if(n!=null&&typeof n!="object")throw new Lde("invalid opts");if(n&&n.path!=null){if(typeof n.path!="string")throw new Lde("invalid opts.path");let o=n.path;n.path.startsWith("/")||(o=`/${o}`),e=new URL(Fde.parseOrigin(e).origin+o)}else n||(n=typeof e=="object"?e:{}),e=Fde.parseURL(e);let{agent:i,dispatcher:s=nNt()}=n;if(i)throw new Lde("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...n,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:n.method||(n.body?"PUT":"GET")},r)}}Pi.exports.setGlobalDispatcher=fBr;Pi.exports.getGlobalDispatcher=nNt;var EBr=rz().fetch;Pi.exports.fetch=async function(e,n=void 0){try{return await EBr(e,n)}catch(r){throw r&&typeof r=="object"&&Error.captureStackTrace(r),r}};Pi.exports.Headers=jM().Headers;Pi.exports.Response=tz().Response;Pi.exports.Request=D$().Request;Pi.exports.FormData=k6().FormData;Pi.exports.File=globalThis.File??require("node:buffer").File;Pi.exports.FileReader=I1t().FileReader;var{setGlobalOrigin:bBr,getGlobalOrigin:_Br}=KLe();Pi.exports.setGlobalOrigin=bBr;Pi.exports.getGlobalOrigin=_Br;var{CacheStorage:xBr}=P1t(),{kConstruct:SBr}=yde();Pi.exports.caches=new xBr(SBr);var{deleteCookie:CBr,getCookies:IBr,getSetCookies:wBr,setCookie:TBr}=j1t();Pi.exports.deleteCookie=CBr;Pi.exports.getCookies=IBr;Pi.exports.getSetCookies=wBr;Pi.exports.setCookie=TBr;var{parseMIMEType:vBr,serializeAMimeType:RBr}=Ug();Pi.exports.parseMIMEType=vBr;Pi.exports.serializeAMimeType=RBr;var{CloseEvent:kBr,ErrorEvent:BBr,MessageEvent:NBr}=Q$();Pi.exports.WebSocket=UBt().WebSocket;Pi.exports.CloseEvent=kBr;Pi.exports.ErrorEvent=BBr;Pi.exports.MessageEvent=NBr;Pi.exports.request=Ez(q$.request);Pi.exports.stream=Ez(q$.stream);Pi.exports.pipeline=Ez(q$.pipeline);Pi.exports.connect=Ez(q$.connect);Pi.exports.upgrade=Ez(q$.upgrade);Pi.exports.MockClient=uBr;Pi.exports.MockPool=pBr;Pi.exports.MockAgent=dBr;Pi.exports.mockErrors=mBr;var{EventSource:DBr}=ZBt();Pi.exports.EventSource=DBr});var fNt=re(Vde=>{"use strict";p();Object.defineProperty(Vde,"__esModule",{value:!0});Vde.getProxyUrl=nNr;Vde.checkBypass=hNt;function nNr(t){let e=t.protocol==="https:";if(hNt(t))return;let n=e?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(n)try{return new jde(n)}catch{if(!n.startsWith("http://")&&!n.startsWith("https://"))return new jde(`http://${n}`)}else return}function hNt(t){if(!t.hostname)return!1;let e=t.hostname;if(rNr(e))return!0;let n=process.env.no_proxy||process.env.NO_PROXY||"";if(!n)return!1;let r;t.port?r=Number(t.port):t.protocol==="http:"?r=80:t.protocol==="https:"&&(r=443);let i=[t.hostname.toUpperCase()];typeof r=="number"&&i.push(`${i[0]}:${r}`);for(let s of n.split(",").map(o=>o.trim().toUpperCase()).filter(o=>o))if(s==="*"||i.some(o=>o===s||o.endsWith(`.${s}`)||s.startsWith(".")&&o.endsWith(`${s}`)))return!0;return!1}function rNr(t){let e=t.toLowerCase();return e==="localhost"||e.startsWith("127.")||e.startsWith("[::1]")||e.startsWith("[0:0:0:0:0:0:0:1]")}var jde=class extends URL{constructor(e,n){super(e,n),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}});var ANt=re(Sl=>{"use strict";p();var iNr=Sl&&Sl.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),sNr=Sl&&Sl.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Jde=Sl&&Sl.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;iJu(this,void 0,void 0,function*(){let n=Buffer.alloc(0);this.message.on("data",r=>{n=Buffer.concat([n,r])}),this.message.on("end",()=>{e(n.toString())})}))})}readBodyBuffer(){return Ju(this,void 0,void 0,function*(){return new Promise(e=>Ju(this,void 0,void 0,function*(){let n=[];this.message.on("data",r=>{n.push(r)}),this.message.on("end",()=>{e(Buffer.concat(n))})}))})}};Sl.HttpClientResponse=Kde;function mNr(t){return new URL(t).protocol==="https:"}var OQe=class{constructor(e,n,r){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=this._getUserAgentWithOrchestrationId(e),this.handlers=n||[],this.requestOptions=r,r&&(r.ignoreSslError!=null&&(this._ignoreSslError=r.ignoreSslError),this._socketTimeout=r.socketTimeout,r.allowRedirects!=null&&(this._allowRedirects=r.allowRedirects),r.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=r.allowRedirectDowngrade),r.maxRedirects!=null&&(this._maxRedirects=Math.max(r.maxRedirects,0)),r.keepAlive!=null&&(this._keepAlive=r.keepAlive),r.allowRetries!=null&&(this._allowRetries=r.allowRetries),r.maxRetries!=null&&(this._maxRetries=r.maxRetries))}options(e,n){return Ju(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,n||{})})}get(e,n){return Ju(this,void 0,void 0,function*(){return this.request("GET",e,null,n||{})})}del(e,n){return Ju(this,void 0,void 0,function*(){return this.request("DELETE",e,null,n||{})})}post(e,n,r){return Ju(this,void 0,void 0,function*(){return this.request("POST",e,n,r||{})})}patch(e,n,r){return Ju(this,void 0,void 0,function*(){return this.request("PATCH",e,n,r||{})})}put(e,n,r){return Ju(this,void 0,void 0,function*(){return this.request("PUT",e,n,r||{})})}head(e,n){return Ju(this,void 0,void 0,function*(){return this.request("HEAD",e,null,n||{})})}sendStream(e,n,r,i){return Ju(this,void 0,void 0,function*(){return this.request(e,n,r,i)})}getJson(e){return Ju(this,arguments,void 0,function*(n,r={}){r[Cf.Accept]=this._getExistingOrDefaultHeader(r,Cf.Accept,UT.ApplicationJson);let i=yield this.get(n,r);return this._processResponse(i,this.requestOptions)})}postJson(e,n){return Ju(this,arguments,void 0,function*(r,i,s={}){let o=JSON.stringify(i,null,2);s[Cf.Accept]=this._getExistingOrDefaultHeader(s,Cf.Accept,UT.ApplicationJson),s[Cf.ContentType]=this._getExistingOrDefaultContentTypeHeader(s,UT.ApplicationJson);let a=yield this.post(r,o,s);return this._processResponse(a,this.requestOptions)})}putJson(e,n){return Ju(this,arguments,void 0,function*(r,i,s={}){let o=JSON.stringify(i,null,2);s[Cf.Accept]=this._getExistingOrDefaultHeader(s,Cf.Accept,UT.ApplicationJson),s[Cf.ContentType]=this._getExistingOrDefaultContentTypeHeader(s,UT.ApplicationJson);let a=yield this.put(r,o,s);return this._processResponse(a,this.requestOptions)})}patchJson(e,n){return Ju(this,arguments,void 0,function*(r,i,s={}){let o=JSON.stringify(i,null,2);s[Cf.Accept]=this._getExistingOrDefaultHeader(s,Cf.Accept,UT.ApplicationJson),s[Cf.ContentType]=this._getExistingOrDefaultContentTypeHeader(s,UT.ApplicationJson);let a=yield this.patch(r,o,s);return this._processResponse(a,this.requestOptions)})}request(e,n,r,i){return Ju(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let s=new URL(n),o=this._prepareRequest(e,s,i),a=this._allowRetries&&uNr.includes(e)?this._maxRetries+1:1,c=0,u;do{if(u=yield this.requestRaw(o,r),u&&u.message&&u.message.statusCode===l0.Unauthorized){let d;for(let m of this.handlers)if(m.canHandleAuthentication(u)){d=m;break}return d?d.handleAuthentication(this,o,r):u}let l=this._maxRedirects;for(;u.message.statusCode&&cNr.includes(u.message.statusCode)&&this._allowRedirects&&l>0;){let d=u.message.headers.location;if(!d)break;let m=new URL(d);if(s.protocol==="https:"&&s.protocol!==m.protocol&&!this._allowRedirectDowngrade)throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(yield u.readBody(),m.hostname!==s.hostname)for(let h in i)h.toLowerCase()==="authorization"&&delete i[h];o=this._prepareRequest(e,m,i),u=yield this.requestRaw(o,r),l--}if(!u.message.statusCode||!lNr.includes(u.message.statusCode))return u;c+=1,c{function s(o,a){o?i(o):a?r(a):i(new Error("Unknown error"))}this.requestRawWithCallback(e,n,s)})})}requestRawWithCallback(e,n,r){typeof n=="string"&&(e.options.headers||(e.options.headers={}),e.options.headers["Content-Length"]=Buffer.byteLength(n,"utf8"));let i=!1;function s(c,u){i||(i=!0,r(c,u))}let o=e.httpModule.request(e.options,c=>{let u=new Kde(c);s(void 0,u)}),a;o.on("socket",c=>{a=c}),o.setTimeout(this._socketTimeout||3*6e4,()=>{a&&a.end(),s(new Error(`Request timeout: ${e.options.path}`))}),o.on("error",function(c){s(c)}),n&&typeof n=="string"&&o.write(n,"utf8"),n&&typeof n!="string"?(n.on("close",function(){o.end()}),n.pipe(o)):o.end()}getAgent(e){let n=new URL(e);return this._getAgent(n)}getAgentDispatcher(e){let n=new URL(e),r=MQe.getProxyUrl(n);if(r&&r.hostname)return this._getProxyAgentDispatcher(n,r)}_prepareRequest(e,n,r){let i={};i.parsedUrl=n;let s=i.parsedUrl.protocol==="https:";i.httpModule=s?gNt:PQe;let o=s?443:80;if(i.options={},i.options.host=i.parsedUrl.hostname,i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):o,i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||""),i.options.method=e,i.options.headers=this._mergeHeaders(r),this.userAgent!=null&&(i.options.headers["user-agent"]=this.userAgent),i.options.agent=this._getAgent(i.parsedUrl),this.handlers)for(let a of this.handlers)a.prepareRequest(i.options);return i}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},xz(this.requestOptions.headers),xz(e||{})):xz(e||{})}_getExistingOrDefaultHeader(e,n,r){let i;if(this.requestOptions&&this.requestOptions.headers){let o=xz(this.requestOptions.headers)[n];o&&(i=typeof o=="number"?o.toString():o)}let s=e[n];return s!==void 0?typeof s=="number"?s.toString():s:i!==void 0?i:r}_getExistingOrDefaultContentTypeHeader(e,n){let r;if(this.requestOptions&&this.requestOptions.headers){let s=xz(this.requestOptions.headers)[Cf.ContentType];s&&(typeof s=="number"?r=String(s):Array.isArray(s)?r=s.join(", "):r=s)}let i=e[Cf.ContentType];return i!==void 0?typeof i=="number"?String(i):Array.isArray(i)?i.join(", "):i:r!==void 0?r:n}_getAgent(e){let n,r=MQe.getProxyUrl(e),i=r&&r.hostname;if(this._keepAlive&&i&&(n=this._proxyAgent),i||(n=this._agent),n)return n;let s=e.protocol==="https:",o=100;if(this.requestOptions&&(o=this.requestOptions.maxSockets||PQe.globalAgent.maxSockets),r&&r.hostname){let a={maxSockets:o,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})},c,u=r.protocol==="https:";s?c=u?Yde.httpsOverHttps:Yde.httpsOverHttp:c=u?Yde.httpOverHttps:Yde.httpOverHttp,n=c(a),this._proxyAgent=n}if(!n){let a={keepAlive:this._keepAlive,maxSockets:o};n=s?new gNt.Agent(a):new PQe.Agent(a),this._agent=n}return s&&this._ignoreSslError&&(n.options=Object.assign(n.options||{},{rejectUnauthorized:!1})),n}_getProxyAgentDispatcher(e,n){let r;if(this._keepAlive&&(r=this._proxyAgentDispatcher),r)return r;let i=e.protocol==="https:";return r=new oNr.ProxyAgent(Object.assign({uri:n.href,pipelining:this._keepAlive?1:0},(n.username||n.password)&&{token:`Basic ${Buffer.from(`${n.username}:${n.password}`).toString("base64")}`})),this._proxyAgentDispatcher=r,i&&this._ignoreSslError&&(r.options=Object.assign(r.options.requestTls||{},{rejectUnauthorized:!1})),r}_getUserAgentWithOrchestrationId(e){let n=e||"actions/http-client",r=process.env.ACTIONS_ORCHESTRATION_ID;if(r){let i=r.replace(/[^a-z0-9_.-]/gi,"_");return`${n} actions_orchestration_id/${i}`}return n}_performExponentialBackoff(e){return Ju(this,void 0,void 0,function*(){e=Math.min(dNr,e);let n=pNr*Math.pow(2,e);return new Promise(r=>setTimeout(()=>r(),n))})}_processResponse(e,n){return Ju(this,void 0,void 0,function*(){return new Promise((r,i)=>Ju(this,void 0,void 0,function*(){let s=e.message.statusCode||0,o={statusCode:s,result:null,headers:{}};s===l0.NotFound&&r(o);function a(l,d){if(typeof d=="string"){let m=new Date(d);if(!isNaN(m.valueOf()))return m}return d}let c,u;try{u=yield e.readBody(),u&&u.length>0&&(n&&n.deserializeDates?c=JSON.parse(u,a):c=JSON.parse(u),o.result=c),o.headers=e.message.headers}catch{}if(s>299){let l;c&&c.message?l=c.message:u&&u.length>0?l=u:l=`Failed request: (${s})`;let d=new zde(l,s);d.result=o.result,i(d)}else r(o)}))})}};Sl.HttpClient=OQe;var xz=t=>Object.keys(t).reduce((e,n)=>(e[n.toLowerCase()]=t[n],e),{})});var $Nt=re(Zde=>{"use strict";p();Object.defineProperty(Zde,"__esModule",{value:!0});Zde.format=MNr;Zde.parse=ONr;var NNr=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,LNt=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,DNr=/[\\"]/g,PNr=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,FNt=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function MNr(t){let{type:e,parameters:n}=t;if(!e||!PNr.test(e))throw new TypeError(`Invalid type: ${e}`);let r=e;if(n)for(let i of Object.keys(n)){if(!LNt.test(i))throw new TypeError(`Invalid parameter name: ${i}`);r+=`; ${i}=${UNr(n[i])}`}return r}function ONr(t,e){let n=t.length,r=$Qe(t,0,n),i=r;r=GQe(t,r,n);let s=WQe(t,i,r),o=t.slice(i,s).toLowerCase(),a=e?.parameters===!1?new FNt:QNr(t,r,n);return{type:o,parameters:a}}var QNt=32,UNt=9,GNt=59,LNr=61,ONt=34,FNr=92;function QNr(t,e,n){let r=new FNt;e:for(;ee;){let r=t.charCodeAt(n-1);if(r!==QNt&&r!==UNt)break;n--}return n}function UNr(t){if(LNt.test(t))return t;if(NNr.test(t))return`"${t.replace(DNr,"\\$&")}"`;throw new TypeError(`Invalid parameter value: ${t}`)}});var Iz,oC,mDt=v(()=>{p();Iz={warningEmitted:!1},oC=t=>{if(t&&!Iz.warningEmitted){if(process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED==="true"){Iz.warningEmitted=!0;return}let e=parseInt(t.substring(1,t.indexOf("."))),n=22;e=${n}. You are running node ${t}. To continue receiving updates to AWS services, bug fixes, and security updates please upgrade to node >=${n}. -More information can be found at: https://a.co/c895JFp`))}}});var Drr,Brr,Ebt,bbt=V(()=>{p();Drr=()=>(t,e)=>async n=>(e.__retryLongPoll=!0,t(n)),Brr={name:"longPollMiddleware",tags:["RETRY"],step:"initialize",override:!0},Ebt=t=>({applyToStack:e=>{e.add(Drr(),Brr)}})});function Lv(t,e,n){return t.$source||(t.$source={}),t.$source[e]=n,t}var _bt=V(()=>{p()});var Sbt,L1e,Cbt=V(()=>{p();Sbt=require("node:stream"),L1e=t=>t?.body instanceof Sbt.Readable||typeof ReadableStream<"u"&&t?.body instanceof ReadableStream});var tB,Fv,Qv,Ibt,xbt,foe=V(()=>{p();tB=(t,e)=>{let n=[];if(t&&n.push(t),e)for(let r of e)n.push(r);return n},Fv=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,Qv=()=>{let t=[],e=[],n=!1,r=new Set,s=d=>d.sort((h,m)=>Ibt[m.step]-Ibt[h.step]||xbt[m.priority||"normal"]-xbt[h.priority||"normal"]),i=d=>{let h=!1,m=f=>{let g=tB(f.name,f.aliases);if(g.includes(d)){h=!0;for(let A of g)r.delete(A);return!1}return!0};return t=t.filter(m),e=e.filter(m),h},o=d=>{let h=!1,m=f=>{if(f.middleware===d){h=!0;for(let g of tB(f.name,f.aliases))r.delete(g);return!1}return!0};return t=t.filter(m),e=e.filter(m),h},a=d=>(t.forEach(h=>{d.add(h.middleware,{...h})}),e.forEach(h=>{d.addRelativeTo(h.middleware,{...h})}),d.identifyOnResolve?.(l.identifyOnResolve()),d),c=d=>{let h=[];return d.before.forEach(m=>{m.before.length===0&&m.after.length===0?h.push(m):h.push(...c(m))}),h.push(d),d.after.reverse().forEach(m=>{m.before.length===0&&m.after.length===0?h.push(m):h.push(...c(m))}),h},u=(d=!1)=>{let h=[],m=[],f={};return t.forEach(A=>{let y={...A,before:[],after:[]};for(let b of tB(y.name,y.aliases))f[b]=y;h.push(y)}),e.forEach(A=>{let y={...A,before:[],after:[]};for(let b of tB(y.name,y.aliases))f[b]=y;m.push(y)}),m.forEach(A=>{if(A.toMiddleware){let y=f[A.toMiddleware];if(y===void 0){if(d)return;throw new Error(`${A.toMiddleware} is not found when adding ${Fv(A.name,A.aliases)} middleware ${A.relation} ${A.toMiddleware}`)}A.relation==="after"&&y.after.push(A),A.relation==="before"&&y.before.push(A)}}),s(h).map(c).reduce((A,y)=>(A.push(...y),A),[])},l={add:(d,h={})=>{let{name:m,override:f,aliases:g}=h,A={step:"initialize",priority:"normal",middleware:d,...h},y=tB(m,g);if(y.length>0){if(y.some(b=>r.has(b))){if(!f)throw new Error(`Duplicate middleware name '${Fv(m,g)}'`);for(let b of y){let S=t.findIndex(I=>I.name===b||I.aliases?.some(x=>x===b));if(S===-1)continue;let C=t[S];if(C.step!==A.step||A.priority!==C.priority)throw new Error(`"${Fv(C.name,C.aliases)}" middleware with ${C.priority} priority in ${C.step} step cannot be overridden by "${Fv(m,g)}" middleware with ${A.priority} priority in ${A.step} step.`);t.splice(S,1)}}for(let b of y)r.add(b)}t.push(A)},addRelativeTo:(d,h)=>{let{name:m,override:f,aliases:g}=h,A={middleware:d,...h},y=tB(m,g);if(y.length>0){if(y.some(b=>r.has(b))){if(!f)throw new Error(`Duplicate middleware name '${Fv(m,g)}'`);for(let b of y){let S=e.findIndex(I=>I.name===b||I.aliases?.some(x=>x===b));if(S===-1)continue;let C=e[S];if(C.toMiddleware!==A.toMiddleware||C.relation!==A.relation)throw new Error(`"${Fv(C.name,C.aliases)}" middleware ${C.relation} "${C.toMiddleware}" middleware cannot be overridden by "${Fv(m,g)}" middleware ${A.relation} "${A.toMiddleware}" middleware.`);e.splice(S,1)}}for(let b of y)r.add(b)}e.push(A)},clone:()=>a(Qv()),use:d=>{d.applyToStack(l)},remove:d=>typeof d=="string"?i(d):o(d),removeByTag:d=>{let h=!1,m=f=>{let{tags:g,name:A,aliases:y}=f;if(g&&g.includes(d)){let b=tB(A,y);for(let S of b)r.delete(S);return h=!0,!1}return!0};return t=t.filter(m),e=e.filter(m),h},concat:d=>{let h=a(Qv());return h.use(d),h.identifyOnResolve(n||h.identifyOnResolve()||(d.identifyOnResolve?.()??!1)),h},applyToStack:a,identify:()=>u(!0).map(d=>{let h=d.step??d.relation+" "+d.toMiddleware;return Fv(d.name,d.aliases)+" - "+h}),identifyOnResolve(d){return typeof d=="boolean"&&(n=d),n},resolve:(d,h)=>{for(let m of u().map(f=>f.middleware).reverse())d=m(d,h);return n&&console.log(l.identify()),d}};return l},Ibt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},xbt={high:3,normal:2,low:1}});var dS=ee(qb=>{p();var F1e;(function(t){t.HEADER="header",t.QUERY="query"})(F1e||(F1e={}));var Q1e;(function(t){t.HEADER="header",t.QUERY="query"})(Q1e||(Q1e={}));var U1e;(function(t){t.HTTP="http",t.HTTPS="https"})(U1e||(U1e={}));var TY;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(TY||(TY={}));var Prr=t=>{let e=[];return t.sha256!==void 0&&e.push({algorithmId:()=>TY.SHA256,checksumConstructor:()=>t.sha256}),t.md5!=null&&e.push({algorithmId:()=>TY.MD5,checksumConstructor:()=>t.md5}),{addChecksumAlgorithm(n){e.push(n)},checksumAlgorithms(){return e}}},Orr=t=>{let e={};return t.checksumAlgorithms().forEach(n=>{e[n.algorithmId()]=n.checksumConstructor()}),e},Mrr=t=>Prr(t),Lrr=t=>Orr(t),$1e;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})($1e||($1e={}));var Frr="__smithy_context",G1e;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(G1e||(G1e={}));var W1e;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(W1e||(W1e={}));qb.AlgorithmId=TY;qb.EndpointURLScheme=U1e;qb.FieldPosition=$1e;qb.HttpApiKeyAuthLocation=Q1e;qb.HttpAuthLocation=F1e;qb.IniSectionType=G1e;qb.RequestHandlerProtocol=W1e;qb.SMITHY_CONTEXT_KEY=Frr;qb.getDefaultClientConfiguration=Mrr;qb.resolveDefaultRuntimeConfig=Lrr});var q1e,Ha,wbt=V(()=>{p();q1e=Gt(dS()),Ha=t=>t[q1e.SMITHY_CONTEXT_KEY]||(t[q1e.SMITHY_CONTEXT_KEY]={})});function Cs(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var H1e=V(()=>{p()});function Qrr(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];return{...e,[n]:Array.isArray(r)?[...r]:r}},{})}var qi,Tbt=V(()=>{p();qi=class t{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let n=new t({...e,headers:{...e.headers}});return n.query&&(n.query=Qrr(n.query)),n}static isInstance(e){if(!e)return!1;let n=e;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query=="object"&&typeof n.headers=="object"}clone(){return t.clone(this)}}});var Od,vbt=V(()=>{p();Od=class{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let n=e;return typeof n.statusCode=="number"&&typeof n.headers=="object"}}});var Urr,Hb,Rbt=V(()=>{p();Urr=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Hb=(t,e=!1)=>{if(!e)return Urr.test(t);let n=t.split(".");for(let r of n)if(!Hb(r))return!1;return!0}});function vY(t){return/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(t)}var kbt=V(()=>{p()});var ba,Nbt=V(()=>{p();ba=t=>{if(typeof t=="function")return t;let e=Promise.resolve(t);return()=>e}});function RY(t){let e={};if(t=t.replace(/^\?/,""),t)for(let n of t.split("&")){let[r,s=null]=n.split("=");r=decodeURIComponent(r),s&&(s=decodeURIComponent(s)),r in e?Array.isArray(e[r])?e[r].push(s):e[r]=[e[r],s]:e[r]=s}return e}var V1e=V(()=>{p()});var Ip,j1e=V(()=>{p();V1e();Ip=t=>{if(typeof t=="string")return Ip(new URL(t));let{hostname:e,pathname:n,port:r,protocol:s,search:i}=t,o;return i&&(o=RY(i)),{hostname:e,port:r?parseInt(r):void 0,protocol:s,path:n,query:o}}});var Wg,Dbt=V(()=>{p();H1e();j1e();Wg=t=>{if(typeof t=="object"){if("url"in t){let e=Ip(t.url);if(t.headers){e.headers={};for(let n in t.headers)Cs(t.headers,n)&&(e.headers[n.toLowerCase()]=t.headers[n].join(", "))}return e}return t}return Ip(t)}});var si=V(()=>{p();wbt();H1e();Tbt();vbt();Rbt();kbt();Nbt();V1e();j1e();Dbt()});var Bbt,Pbt=V(()=>{p();Bbt=t=>()=>{throw new Error(t)}});var Obt,Mbt=V(()=>{p();Obt=t=>()=>Promise.reject(t)});var TU,Y1e=V(()=>{p();TU=()=>{let t=new WeakSet;return(e,n)=>{if(typeof n=="object"&&n!==null){if(t.has(n))return"[Circular]";t.add(n)}return n}}});var Lbt,Fbt=V(()=>{p();Lbt=t=>new Promise(e=>setTimeout(e,t*1e3))});var goe,qg,Qbt,Aoe=V(()=>{p();Y1e();goe={minDelay:2,maxDelay:120};(function(t){t.ABORTED="ABORTED",t.FAILURE="FAILURE",t.SUCCESS="SUCCESS",t.RETRY="RETRY",t.TIMEOUT="TIMEOUT"})(qg||(qg={}));Qbt=t=>{if(t.state===qg.ABORTED){let e=new Error(`${JSON.stringify({...t,reason:"Request was aborted"},TU())}`);throw e.name="AbortError",e}else if(t.state===qg.TIMEOUT){let e=new Error(`${JSON.stringify({...t,reason:"Waiter has timed out"},TU())}`);throw e.name="TimeoutError",e}else if(t.state!==qg.SUCCESS)throw new Error(`${JSON.stringify(t,TU())}`);return t}});var Ubt,$rr,Grr,Wrr,qrr,$bt=V(()=>{p();Y1e();Fbt();Aoe();Ubt=async({minDelay:t,maxDelay:e,maxWaitTime:n,abortController:r,client:s,abortSignal:i},o,a)=>{let c={},[u,l]=[t*1e3,e*1e3],d=0,h=Date.now()+n*1e3,m=Date.now()+6e4,f=!1;for(;;){if(d>0){let y=Wrr(u,l,d,h);if(r?.signal?.aborted||i?.aborted){let b="AbortController signal aborted.";return c[b]|=0,c[b]+=1,{state:qg.ABORTED,observedResponses:c}}if(Date.now()+y>h)return{state:qg.TIMEOUT,observedResponses:c};await Lbt(y/1e3)}let{state:g,reason:A}=await a(s,o);if(A){let y=Grr(A);c[y]|=0,c[y]+=1}if(g!==qg.RETRY)return{state:g,reason:A,final:A,observedResponses:c};d+=1,!f&&Date.now()>=m&&($rr(c,s),f=!0)}},$rr=(t={},e)=>{let n=Object.keys(t),r=0,s=0;for(let a of n){let c=t[a]|0;r=Math.max(c,r),a.startsWith("403:")&&(s+=c)}let i=e?.config?.logger,o=typeof i?.warn=="function"&&!i.constructor?.name?.includes?.("NoOpLogger")?i:console;(s>=3||n[n.length-1]?.startsWith("403:"))&&o.warn("@smithy/util-waiter WARN - 403 status code encountered during waiter polling.")},Grr=t=>{let e=t?.$response?.statusCode??t?.$metadata?.httpStatusCode;return t?.$responseBodyText?`${e?e+": ":""}Deserialization error for body: ${t.$responseBodyText}`:e?t?.$response||t?.message?`${e??"Unknown"}: ${t?.message}`:`${e}: OK`:String(t?.message??JSON.stringify(t,TU())??"Unknown")},Wrr=(t,e,n,r)=>{let s=Math.log(e/t)/Math.log(2)+1;if(n>s)return e;let i=t*2**(n-1),o=Math.min(i,e),a=qrr(t,o);if(Date.now()+a>r){let c=r-Date.now();return Math.max(0,c-500)}return a},qrr=(t,e)=>t+Math.random()*(e-t)});var Gbt,Wbt=V(()=>{p();Gbt=t=>{if(t.maxWaitTime<=0)throw new Error("WaiterConfiguration.maxWaitTime must be greater than 0");if(t.minDelay<=0)throw new Error("WaiterConfiguration.minDelay must be greater than 0");if(t.maxDelay<=0)throw new Error("WaiterConfiguration.maxDelay must be greater than 0");if(t.maxWaitTime<=t.minDelay)throw new Error(`WaiterConfiguration.maxWaitTime [${t.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${t.minDelay}] for this waiter`);if(t.maxDelay{p();$bt();Wbt();Aoe();qbt=t=>{let e,n=new Promise(r=>{e=()=>r({state:qg.ABORTED}),typeof t.addEventListener=="function"?t.addEventListener("abort",e):t.onabort=e});return{clearListener(){typeof t.removeEventListener=="function"&&t.removeEventListener("abort",e)},aborted:n}},Hbt=async(t,e,n)=>{let r={...goe,...t};Gbt(r);let s=[Ubt(r,e,n)],i=[];if(t.abortSignal){let{aborted:o,clearListener:a}=qbt(t.abortSignal);i.push(a),s.push(o)}if(t.abortController?.signal){let{aborted:o,clearListener:a}=qbt(t.abortController.signal);i.push(a),s.push(o)}return Promise.race(s).then(o=>{for(let a of i)a();return o})}});var fh,jbt=V(()=>{p();foe();fh=class{config;middlewareStack=Qv();initConfig;handlers;constructor(e){this.config=e;let{protocol:n,protocolSettings:r}=e;r&&typeof n=="function"&&(e.protocol=new n(r))}send(e,n,r){let s=typeof n!="function"?n:void 0,i=typeof n=="function"?n:r,o=s===void 0&&this.config.cacheMiddleware===!0,a;if(o){this.handlers||(this.handlers=new WeakMap);let c=this.handlers;c.has(e.constructor)?a=c.get(e.constructor):(a=e.resolveMiddleware(this.middlewareStack,this.config,s),c.set(e.constructor,a))}else delete this.handlers,a=e.resolveMiddleware(this.middlewareStack,this.config,s);if(i)a(e).then(c=>i(null,c.output),c=>i(c)).catch(()=>{});else return a(e).then(c=>c.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}});var Qy,K1e=V(()=>{p();Qy=t=>typeof t=="function"?t():t});var vU,yoe=V(()=>{p();vU=(t,e,n,r,s)=>({name:e,namespace:t,traits:n,input:r,output:s})});var Ybt,z1e,Kbt=V(()=>{p();si();yoe();Ybt=t=>(e,n)=>async r=>{let{response:s}=await e(r),{operationSchema:i}=Ha(n),[,o,a,c,u,l]=i??[];try{let d=await t.protocol.deserializeResponse(vU(o,a,c,u,l),{...t,...n},s);return{response:s,output:d}}catch(d){if(Object.defineProperty(d,"$response",{value:s,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in d)){let h="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{d.message+=` - `+h}catch{!n.logger||n.logger?.constructor?.name==="NoOpLogger"?console.warn(h):n.logger?.warn?.(h)}typeof d.$responseBodyText<"u"&&d.$response&&(d.$response.body=d.$responseBodyText);try{if(Od.isInstance(s)){let{headers:m={},statusCode:f}=s,g=Object.entries(m);d.$metadata={httpStatusCode:f,requestId:z1e(/^x-[\w-]+-request-?id$/,g),extendedRequestId:z1e(/^x-[\w-]+-id-2$/,g),cfId:z1e(/^x-[\w-]+-cf-id$/,g)}}}catch{}}throw d}},z1e=(t,e)=>(e.find(([n])=>n.match(t))||[void 0,void 0])[1]});var zbt,Jbt=V(()=>{p();si();yoe();zbt=t=>(e,n)=>async r=>{let{operationSchema:s}=Ha(n),[,i,o,a,c,u]=s??[],l=n.endpointV2?async()=>Wg(n.endpointV2):t.endpoint,d=await t.protocol.serializeRequest(vU(i,o,a,c,u),r.input,{...t,...n,endpoint:l});return e({...r,request:d})}});function pS(t){return{applyToStack:e=>{e.add(zbt(t),X1e),e.add(Ybt(t),J1e),t.protocol.setSerdeContext(t)}}}var J1e,X1e,Xbt=V(()=>{p();Kbt();Jbt();J1e={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},X1e={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0}});var xl,Uv=V(()=>{p();xl=class{name;namespace;traits;static assign(e,n){return Object.assign(e,n)}static[Symbol.hasInstance](e){let n=this.prototype.isPrototypeOf(e);return!n&&typeof e=="object"&&e!==null?e.symbol===this.symbol:n}getName(){return this.namespace+"#"+this.name}}});var kY,Zbt,e_t=V(()=>{p();Uv();kY=class t extends xl{static symbol=Symbol.for("@smithy/lis");valueSchema;symbol=t.symbol},Zbt=(t,e,n,r)=>xl.assign(new kY,{name:e,namespace:t,traits:n,valueSchema:r})});var NY,t_t,n_t=V(()=>{p();Uv();NY=class t extends xl{static symbol=Symbol.for("@smithy/map");keySchema;valueSchema;symbol=t.symbol},t_t=(t,e,n,r,s)=>xl.assign(new NY,{name:e,namespace:t,traits:n,keySchema:r,valueSchema:s})});var DY,r_t,s_t=V(()=>{p();Uv();DY=class t extends xl{static symbol=Symbol.for("@smithy/ope");input;output;symbol=t.symbol},r_t=(t,e,n,r,s)=>xl.assign(new DY,{name:e,namespace:t,traits:n,input:r,output:s})});var nB,i_t,Z1e=V(()=>{p();Uv();nB=class t extends xl{static symbol=Symbol.for("@smithy/str");memberNames;memberList;symbol=t.symbol},i_t=(t,e,n,r,s)=>xl.assign(new nB,{name:e,namespace:t,traits:n,memberNames:r,memberList:s})});var BY,o_t,a_t=V(()=>{p();Uv();Z1e();BY=class t extends nB{static symbol=Symbol.for("@smithy/err");ctor;symbol=t.symbol},o_t=(t,e,n,r,s,i)=>xl.assign(new BY,{name:e,namespace:t,traits:n,memberNames:r,memberList:s,ctor:null})});function Vb(t){if(typeof t=="object")return t;if(t=t|0,PY[t])return PY[t];let e={},n=0;for(let r of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(t>>n++&1)===1&&(e[r]=1);return PY[t]=e}var PY,eBe=V(()=>{p();PY=[]});function MY(t,e){if(t instanceof qn)return Object.assign(t,{memberName:e,_isMemberSchema:!0});let n=qn;return new n(t,e)}var OY,LY,FY,qn,tBe,nBe,c_t=V(()=>{p();K1e();eBe();OY={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},LY=[],FY={},qn=class t{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=t.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,n){this.ref=e,this.memberName=n;let r=[],s=e,i=e;for(this._isMemberSchema=!1;tBe(s);)r.push(s[1]),s=s[0],i=Qy(s),this._isMemberSchema=!0;if(r.length>0){this.memberTraits={};for(let o=r.length-1;o>=0;--o){let a=r[o];Object.assign(this.memberTraits,Vb(a))}}else this.memberTraits=0;if(i instanceof t){let o=this.memberTraits;Object.assign(this,i),this.memberTraits=Object.assign({},o,i.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=n??i.memberName;return}if(this.schema=Qy(i),nBe(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(i),this.traits=0),this._isMemberSchema&&!n)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){let n=this.prototype.isPrototypeOf(e);return!n&&typeof e=="object"&&e!==null?e.symbol===this.symbol:n}static of(e){let n=typeof e=="function"||typeof e=="object"&&e!==null;if(typeof e=="number"){if(LY[e])return LY[e]}else if(typeof e=="string"){if(FY[e])return FY[e]}else if(n&&e[OY.ns])return e[OY.ns];let r=Qy(e);if(r instanceof t)return r;if(tBe(r)){let[i,o]=r;if(i instanceof t)return Object.assign(i.getMergedTraits(),Vb(o)),i;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}let s=new t(r);return n?e[OY.ns]=s:typeof r=="string"?FY[r]=s:typeof r=="number"?LY[r]=s:s}getSchema(){let e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=!1){let{name:n}=this;return!e&&n&&n.includes("#")?n.split("#")[1]:n||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){let e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){let e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){let e=this.getSchema();if(typeof e!="object")return!1;let n=e[0];return n===3||n===-3||n===4}isUnionSchema(){let e=this.getSchema();return typeof e!="object"?!1:e[0]===4}isBlobSchema(){let e=this.getSchema();return e===21||e===42}isTimestampSchema(){let e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){let{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return Vb(this.memberTraits)}getOwnTraits(){return Vb(this.traits)}getKeySchema(){let[e,n]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!n)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);let r=this.getSchema(),s=e?15:r[4]??0;return MY([s,0],"key")}getValueSchema(){let e=this.getSchema(),[n,r,s]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],i=typeof e=="number"?63&e:e&&typeof e=="object"&&(r||s)?e[3+e[0]]:n?15:void 0;if(i!=null)return MY([i,0],r?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){let n=this.getSchema();if(this.isStructSchema()&&n[4].includes(e)){let r=n[4].indexOf(e),s=n[5][r];return MY(tBe(s)?s:[s,0],e)}if(this.isDocumentSchema())return MY([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){let e={};try{for(let[n,r]of this.structIterator())e[n]=r}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(let[e,n]of this.structIterator())if(n.isStreaming()&&n.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");let e=this.getSchema(),n=e[4].length,r=e[OY.it];if(r&&n===r.length){yield*r;return}r=Array(n);for(let s=0;sArray.isArray(t)&&t.length===2,nBe=t=>Array.isArray(t)&&t.length>=5});var RU,l_t,u_t,d_t=V(()=>{p();Uv();RU=class t extends xl{static symbol=Symbol.for("@smithy/sim");schemaRef;symbol=t.symbol},l_t=(t,e,n,r)=>xl.assign(new RU,{name:e,namespace:t,traits:r,schemaRef:n}),u_t=(t,e,n,r)=>xl.assign(new RU,{name:e,namespace:t,traits:n,schemaRef:r})});var p_t,h_t=V(()=>{p();p_t={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128}});var Va,m_t=V(()=>{p();Va=class t{namespace;schemas;exceptions;static registries=new Map;constructor(e,n=new Map,r=new Map){this.namespace=e,this.schemas=n,this.exceptions=r}static for(e){return t.registries.has(e)||t.registries.set(e,new t(e)),t.registries.get(e)}copyFrom(e){let{schemas:n,exceptions:r}=this;for(let[s,i]of e.schemas)n.has(s)||n.set(s,i);for(let[s,i]of e.exceptions)r.has(s)||r.set(s,i)}register(e,n){let r=this.normalizeShapeId(e);for(let s of[this,t.for(r.split("#")[0])])s.schemas.set(r,n)}getSchema(e){let n=this.normalizeShapeId(e);if(!this.schemas.has(n)){if(!e.includes("#")){let r="#"+e,s=[];for(let[i,o]of this.schemas.entries())i.endsWith(r)&&s.push(o);if(s.length===1)return s[0]}throw new Error(`@smithy/core/schema - schema not found for ${n}`)}return this.schemas.get(n)}registerError(e,n){let r=e,s=r[1];for(let i of[this,t.for(s)])i.schemas.set(s+"#"+r[2],r),i.exceptions.set(r,n)}getErrorCtor(e){let n=e;return this.exceptions.has(n)?this.exceptions.get(n):t.for(n[1]).exceptions.get(n)}getBaseException(){for(let e of this.exceptions.keys())if(Array.isArray(e)){let[,n,r]=e,s=n+"#"+r;if(s.startsWith("smithy.ts.sdk.synthetic.")&&s.endsWith("ServiceException"))return e}}find(e){for(let n of this.schemas.values())if(e(n))return n}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}});var rBe={};Ir(rBe,{ErrorSchema:()=>BY,ListSchema:()=>kY,MapSchema:()=>NY,NormalizedSchema:()=>qn,OperationSchema:()=>DY,SCHEMA:()=>p_t,Schema:()=>xl,SimpleSchema:()=>RU,StructureSchema:()=>nB,TypeRegistry:()=>Va,deref:()=>Qy,deserializerMiddlewareOption:()=>J1e,error:()=>o_t,getSchemaSerdePlugin:()=>pS,isStaticSchema:()=>nBe,list:()=>Zbt,map:()=>t_t,op:()=>r_t,operation:()=>vU,serializerMiddlewareOption:()=>X1e,sim:()=>l_t,simAdapter:()=>u_t,simpleSchemaCacheN:()=>LY,simpleSchemaCacheS:()=>FY,struct:()=>i_t,traitsCache:()=>PY,translateTraits:()=>Vb});var Ki=V(()=>{p();K1e();Xbt();e_t();n_t();s_t();yoe();a_t();c_t();Uv();d_t();Z1e();h_t();eBe();m_t()});function kU(t,e){if(e==null)return e;let n=qn.of(t);if(n.getMergedTraits().sensitive)return sBe;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return sBe}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return sBe}else if(n.isStructSchema()&&typeof e=="object"){let r=e,s={};for(let[i,o]of n.structIterator())r[i]!=null&&(s[i]=kU(o,r[i]));return s}return e}var sBe,iBe=V(()=>{p();Ki();sBe="***SensitiveInformation***"});var f_t,hm,oBe,aBe=V(()=>{p();f_t=Gt(dS());foe();iBe();hm=class{middlewareStack=Qv();schema;static classBuilder(){return new oBe}resolveMiddlewareWithContext(e,n,r,{middlewareFn:s,clientName:i,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:c,smithyContext:u,additionalContext:l,CommandCtor:d}){for(let y of s.bind(this)(d,e,n,r))this.middlewareStack.use(y);let h=e.concat(this.middlewareStack),{logger:m}=n,f={logger:m,clientName:i,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:c,[f_t.SMITHY_CONTEXT_KEY]:{commandInstance:this,...u},...l},{requestHandler:g}=n,A=r??{};return u.eventStream&&(A={isEventStream:!0,...A}),h.resolve(y=>g.handle(y.request,A),f)}},oBe=class{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,n,r={}){return this._smithyContext={service:e,operation:n,...r},this}c(e={}){return this._additionalContext=e,this}n(e,n){return this._clientName=e,this._commandName=n,this}f(e=r=>r,n=r=>r){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=n,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){let e=this,n;return n=class extends hm{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[r]){super(),this.input=r??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(r,s,i){let o=e._operationSchema,a=o?.[4]??o?.input,c=o?.[5]??o?.output;return this.resolveMiddlewareWithContext(r,s,i,{CommandCtor:n,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(o?kU.bind(null,a):u=>u),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?kU.bind(null,c):u=>u),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}});var g_t,A_t=V(()=>{p();g_t="***SensitiveInformation***"});var hS,y_t=V(()=>{p();hS=(t,e,n)=>{for(let[i,o]of Object.entries(t)){let a=async function(u,l,d){let h=new o(u);if(typeof l=="function")this.send(h,l);else if(typeof d=="function"){if(typeof l!="object")throw new Error(`Expected http options but got ${typeof l}`);this.send(h,l||{},d)}else return this.send(h,l)},c=(i[0].toLowerCase()+i.slice(1)).replace(/Command$/,"");e.prototype[c]=a}let{paginators:r={},waiters:s={}}=n??{};for(let[i,o]of Object.entries(r))e.prototype[i]===void 0&&(e.prototype[i]=function(a={},c,...u){return o({...c,client:this},a,...u)});for(let[i,o]of Object.entries(s))e.prototype[i]===void 0&&(e.prototype[i]=async function(a={},c,...u){let l=c;return typeof c=="number"&&(l={maxWaitTime:c}),o({...l,client:this},a,...u)})}});var Uy,rB,cBe=V(()=>{p();Uy=class t extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;let n=e;return t.prototype.isPrototypeOf(n)||!!n.$fault&&!!n.$metadata&&(n.$fault==="client"||n.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;let n=e;return this===t?t.isInstance(e):t.isInstance(e)?n.name&&this.name?this.prototype.isPrototypeOf(e)||n.name===this.name:this.prototype.isPrototypeOf(e):!1}},rB=(t,e={})=>{Object.entries(e).filter(([,r])=>r!==void 0).forEach(([r,s])=>{(t[r]==null||t[r]==="")&&(t[r]=s)});let n=t.message||t.Message||"UnknownError";return t.message=n,delete t.Message,t}});var lBe,E_t,Hrr,b_t=V(()=>{p();cBe();lBe=({output:t,parsedBody:e,exceptionCtor:n,errorCode:r})=>{let s=Hrr(t),i=s.httpStatusCode?s.httpStatusCode+"":void 0,o=new n({name:e?.code||e?.Code||r||i||"UnknownError",$fault:"client",$metadata:s});throw rB(o,e)},E_t=t=>({output:e,parsedBody:n,errorCode:r})=>{lBe({output:e,parsedBody:n,exceptionCtor:t,errorCode:r})},Hrr=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]})});var mS,__t=V(()=>{p();mS=t=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}}});var S_t,fS,C_t=V(()=>{p();S_t=!1,fS=t=>{t&&!S_t&&parseInt(t.substring(1,t.indexOf(".")))<16&&(S_t=!0)}});var sB,I_t,Eoe,boe,uBe=V(()=>{p();si();sB=Gt(dS()),I_t=Object.values(sB.AlgorithmId),Eoe=t=>{let e=[];for(let n in sB.AlgorithmId){if(!Cs(sB.AlgorithmId,n))continue;let r=sB.AlgorithmId[n];t[r]!==void 0&&e.push({algorithmId:()=>r,checksumConstructor:()=>t[r]})}for(let[n,r]of Object.entries(t.checksumAlgorithms??{}))e.push({algorithmId:()=>n,checksumConstructor:()=>r});return{addChecksumAlgorithm(n){t.checksumAlgorithms=t.checksumAlgorithms??{};let r=n.algorithmId(),s=n.checksumConstructor();I_t.includes(r)?t.checksumAlgorithms[r.toUpperCase()]=s:t.checksumAlgorithms[r]=s,e.push(n)},checksumAlgorithms(){return e}}},boe=t=>{let e={};return t.checksumAlgorithms().forEach(n=>{let r=n.algorithmId();I_t.includes(r)&&(e[r]=n.checksumConstructor())}),e}});var _oe,Soe,dBe=V(()=>{p();_oe=t=>({setRetryStrategy(e){t.retryStrategy=e},retryStrategy(){return t.retryStrategy}}),Soe=t=>{let e={};return e.retryStrategy=t.retryStrategy(),e}});var jb,x_t,gS,w_t=V(()=>{p();uBe();dBe();jb=t=>Object.assign(Eoe(t),_oe(t)),x_t=jb,gS=t=>Object.assign(boe(t),Soe(t))});var T_t,v_t=V(()=>{p();T_t=t=>Array.isArray(t)?t:[t]});var iB,R_t=V(()=>{p();si();iB=t=>{let e="#text";for(let n in t)Cs(t,n)&&(t[n][e]!==void 0?t[n]=t[n][e]:typeof t[n]=="object"&&t[n]!==null&&(t[n]=iB(t[n])));return t}});var k_t,N_t=V(()=>{p();k_t=t=>t!=null});var If,D_t=V(()=>{p();If=class{trace(){}debug(){}info(){}warn(){}error(){}}});function pBe(t,e,n){let r,s,i;if(typeof e>"u"&&typeof n>"u")r={},i=t;else{if(r=t,typeof e=="function")return s=e,i=n,Vrr(r,s,i);i=e}for(let o in i)if(Cs(i,o)){if(!Array.isArray(i[o])){r[o]=i[o];continue}O_t(r,null,i,o)}return r}var B_t,P_t,Vrr,O_t,jrr,Yrr,M_t=V(()=>{p();si();B_t=t=>{let e={};for(let[n,r]of Object.entries(t||{}))e[n]=[,r];return e},P_t=(t,e)=>{let n={};for(let r in e)Cs(e,r)&&O_t(n,t,e,r);return n},Vrr=(t,e,n)=>pBe(t,Object.entries(n).reduce((r,[s,i])=>(Array.isArray(i)?r[s]=i:typeof i=="function"?r[s]=[e,i()]:r[s]=[e,i],r),{})),O_t=(t,e,n,r)=>{if(e!==null){let o=n[r];typeof o=="function"&&(o=[,o]);let[a=jrr,c=Yrr,u=r]=o;(typeof a=="function"&&a(e[u])||typeof a!="function"&&a)&&(t[r]=c(e[u]));return}let[s,i]=n[r];if(typeof i=="function"){let o,a=s===void 0&&(o=i())!=null,c=typeof s=="function"&&!!s(void 0)||typeof s!="function"&&!!s;a?t[r]=o:c&&(t[r]=i())}else{let o=s===void 0&&i!=null,a=typeof s=="function"&&!!s(i)||typeof s!="function"&&!!s;(o||a)&&(t[r]=i)}},jrr=t=>t!=null,Yrr=t=>t});var L_t,F_t,Q_t=V(()=>{p();L_t=t=>{if(t!==t)return"NaN";switch(t){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return t}},F_t=t=>t.toISOString().replace(".000Z","Z")});var Coe,U_t=V(()=>{p();si();Coe=t=>{if(t==null)return{};if(Array.isArray(t))return t.filter(e=>e!=null).map(Coe);if(typeof t=="object"){let e={};for(let n in t)Cs(t,n)&&t[n]!=null&&(e[n]=Coe(t[n]));return e}return t}});function AS(t,e,n,r){return function(i,o,a,c,u={}){let l=Object.assign({},t,i);return hm.classBuilder().ep(l).m(function(d,h,m,f){let g=o.call(this,d,h,m,f);return g.unshift(r(m,d.getEndpointParameterInstructions())),g}).s(e,a,u).n(n,a.charAt(0).toUpperCase()+a.slice(1)+"Command").sc(c).build()}}var $_t=V(()=>{p();aBe()});var oB={};Ir(oB,{AlgorithmId:()=>sB.AlgorithmId,Client:()=>fh,Command:()=>hm,NoOpLogger:()=>If,SENSITIVE_STRING:()=>g_t,ServiceException:()=>Uy,WaiterState:()=>qg,_json:()=>Coe,checkExceptions:()=>Qbt,constructStack:()=>Qv,convertMap:()=>B_t,createAggregatedClient:()=>hS,createWaiter:()=>Hbt,decorateServiceException:()=>rB,emitWarningIfUnsupportedVersion:()=>fS,getArrayIfSingleItem:()=>T_t,getChecksumConfiguration:()=>Eoe,getDefaultClientConfiguration:()=>x_t,getDefaultExtensionConfiguration:()=>jb,getRetryConfiguration:()=>_oe,getSmithyContext:()=>Ha,getValueFromTextNode:()=>iB,invalidFunction:()=>Bbt,invalidProvider:()=>Obt,isSerializableHeaderValue:()=>k_t,loadConfigsForDefaultMode:()=>mS,makeBuilder:()=>AS,map:()=>pBe,normalizeProvider:()=>ba,resolveChecksumRuntimeConfig:()=>boe,resolveDefaultRuntimeConfig:()=>gS,resolveRetryRuntimeConfig:()=>Soe,schemaLogFilter:()=>kU,serializeDateTime:()=>F_t,serializeFloat:()=>L_t,take:()=>P_t,throwDefaultError:()=>lBe,waiterServiceDefaults:()=>goe,withBaseException:()=>E_t});var Is=V(()=>{p();foe();si();si();Pbt();Mbt();Vbt();Aoe();jbt();aBe();A_t();y_t();b_t();__t();C_t();cBe();w_t();uBe();dBe();v_t();R_t();N_t();D_t();M_t();iBe();Q_t();U_t();$_t()});var Ioe,hBe=V(()=>{p();Ioe=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"});var Yb,$v,Gv=V(()=>{p();hBe();Yb=(t,e=0,n=t.byteLength-e)=>{if(!Ioe(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Buffer.from(t,e,n)},$v=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?Buffer.from(t,e):Buffer.from(t)}});var Krr,wl,G_t=V(()=>{p();Gv();Krr=/^[A-Za-z0-9+/]*={0,2}$/,wl=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Krr.exec(t))throw new TypeError("Invalid base64 string.");let e=$v(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}});var od,xoe=V(()=>{p();Gv();od=t=>{let e=$v(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)}});var ja,mBe=V(()=>{p();Gv();xoe();ja=t=>{let e;if(typeof t=="string"?e=od(t):e=t,typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return Yb(e.buffer,e.byteOffset,e.byteLength).toString("base64")}});function W_t(t,e,n,r){return class woe extends Uint8Array{static fromString(i,o="utf-8"){if(typeof i=="string")return o==="base64"?woe.mutate(r(i)):woe.mutate(e(i));throw new Error(`Unsupported conversion from ${typeof i} to Uint8ArrayBlobAdapter.`)}static mutate(i){return Object.setPrototypeOf(i,woe.prototype),i}transformToString(i="utf-8"){return i==="base64"?n(this):t(this)}}}var q_t=V(()=>{p()});var Jc,H_t=V(()=>{p();Gv();Jc=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return Yb(t.buffer,t.byteOffset,t.byteLength).toString("utf8")}});function V_t(t){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?()=>crypto.randomUUID():()=>{let e=new Uint8Array(16);return t(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,gh[e[0]]+gh[e[1]]+gh[e[2]]+gh[e[3]]+"-"+gh[e[4]]+gh[e[5]]+"-"+gh[e[6]]+gh[e[7]]+"-"+gh[e[8]]+gh[e[9]]+"-"+gh[e[10]]+gh[e[11]]+gh[e[12]]+gh[e[13]]+gh[e[14]]+gh[e[15]]}}var gh,j_t=V(()=>{p();gh=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"))});var Y_t,K_t=V(()=>{p();Y_t=(t,e,n=r=>r)=>t});var z_t,J_t,NU,zrr,QY,DU,X_t,Toe,voe,Roe,fBe,Jrr,Z_t,gBe,e0t,Noe,UY,t0t,Doe,Xrr,PU,Boe,n0t,r0t,s0t,i0t,ABe,o0t,a0t,Wv,Poe,koe,BU,yBe=V(()=>{p();si();z_t=t=>{switch(t){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${t}"`)}},J_t=t=>{if(t!=null){if(typeof t=="number"){if((t===0||t===1)&&BU.warn(koe(`Expected boolean, got ${typeof t}: ${t}`)),t===0)return!1;if(t===1)return!0}if(typeof t=="string"){let e=t.toLowerCase();if((e==="false"||e==="true")&&BU.warn(koe(`Expected boolean, got ${typeof t}: ${t}`)),e==="false")return!1;if(e==="true")return!0}if(typeof t=="boolean")return t;throw new TypeError(`Expected boolean, got ${typeof t}: ${t}`)}},NU=t=>{if(t!=null){if(typeof t=="string"){let e=parseFloat(t);if(!Number.isNaN(e))return String(e)!==String(t)&&BU.warn(koe(`Expected number but observed string: ${t}`)),e}if(typeof t=="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)}},zrr=Math.ceil(2**127*(2-2**-23)),QY=t=>{let e=NU(t);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0&&Math.abs(e)>zrr)throw new TypeError(`Expected 32-bit float, got ${t}`);return e},DU=t=>{if(t!=null){if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)}},X_t=DU,Toe=t=>fBe(t,32),voe=t=>fBe(t,16),Roe=t=>fBe(t,8),fBe=(t,e)=>{let n=DU(t);if(n!==void 0&&Jrr(n,e)!==n)throw new TypeError(`Expected ${e}-bit integer, got ${t}`);return n},Jrr=(t,e)=>{switch(e){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},Z_t=(t,e)=>{if(t==null)throw e?new TypeError(`Expected a non-null value for ${e}`):new TypeError("Expected a non-null value");return t},gBe=t=>{if(t==null)return;if(typeof t=="object"&&!Array.isArray(t))return t;let e=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${e}: ${t}`)},e0t=t=>{if(t!=null){if(typeof t=="string")return t;if(["boolean","number","bigint"].includes(typeof t))return BU.warn(koe(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)}},Noe=t=>{if(t==null)return;let e=gBe(t),n=[];for(let r in e)Cs(e,r)&&e[r]!=null&&n.push(r);if(n.length===0)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(n.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${n} were not null.`);return e},UY=t=>NU(typeof t=="string"?PU(t):t),t0t=UY,Doe=t=>QY(typeof t=="string"?PU(t):t),Xrr=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,PU=t=>{let e=t.match(Xrr);if(e===null||e[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)},Boe=t=>typeof t=="string"?i0t(t):NU(t),n0t=Boe,r0t=Boe,s0t=t=>typeof t=="string"?i0t(t):QY(t),i0t=t=>{switch(t){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${t}`)}},ABe=t=>DU(typeof t=="string"?PU(t):t),o0t=ABe,a0t=t=>Toe(typeof t=="string"?PU(t):t),Wv=t=>voe(typeof t=="string"?PU(t):t),Poe=t=>Roe(typeof t=="string"?PU(t):t),koe=t=>String(new TypeError(t).stack||t).split(` +More information can be found at: https://a.co/c895JFp`))}}});var _Dr,xDr,hDt,fDt=v(()=>{p();_Dr=()=>(t,e)=>async n=>(e.__retryLongPoll=!0,t(n)),xDr={name:"longPollMiddleware",tags:["RETRY"],step:"initialize",override:!0},hDt=t=>({applyToStack:e=>{e.add(_Dr(),xDr)}})});function E1(t,e,n){return t.$source||(t.$source={}),t.$source[e]=n,t}var gDt=v(()=>{p()});var ADt,iUe,yDt=v(()=>{p();ADt=require("node:stream"),iUe=t=>t?.body instanceof ADt.Readable||typeof ReadableStream<"u"&&t?.body instanceof ReadableStream});var nO,b1,_1,EDt,bDt,rpe=v(()=>{p();nO=(t,e)=>{let n=[];if(t&&n.push(t),e)for(let r of e)n.push(r);return n},b1=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,_1=()=>{let t=[],e=[],n=!1,r=new Set,i=d=>d.sort((m,h)=>EDt[h.step]-EDt[m.step]||bDt[h.priority||"normal"]-bDt[m.priority||"normal"]),s=d=>{let m=!1,h=f=>{let g=nO(f.name,f.aliases);if(g.includes(d)){m=!0;for(let A of g)r.delete(A);return!1}return!0};return t=t.filter(h),e=e.filter(h),m},o=d=>{let m=!1,h=f=>{if(f.middleware===d){m=!0;for(let g of nO(f.name,f.aliases))r.delete(g);return!1}return!0};return t=t.filter(h),e=e.filter(h),m},a=d=>(t.forEach(m=>{d.add(m.middleware,{...m})}),e.forEach(m=>{d.addRelativeTo(m.middleware,{...m})}),d.identifyOnResolve?.(l.identifyOnResolve()),d),c=d=>{let m=[];return d.before.forEach(h=>{h.before.length===0&&h.after.length===0?m.push(h):m.push(...c(h))}),m.push(d),d.after.reverse().forEach(h=>{h.before.length===0&&h.after.length===0?m.push(h):m.push(...c(h))}),m},u=(d=!1)=>{let m=[],h=[],f={};return t.forEach(A=>{let y={...A,before:[],after:[]};for(let E of nO(y.name,y.aliases))f[E]=y;m.push(y)}),e.forEach(A=>{let y={...A,before:[],after:[]};for(let E of nO(y.name,y.aliases))f[E]=y;h.push(y)}),h.forEach(A=>{if(A.toMiddleware){let y=f[A.toMiddleware];if(y===void 0){if(d)return;throw new Error(`${A.toMiddleware} is not found when adding ${b1(A.name,A.aliases)} middleware ${A.relation} ${A.toMiddleware}`)}A.relation==="after"&&y.after.push(A),A.relation==="before"&&y.before.push(A)}}),i(m).map(c).reduce((A,y)=>(A.push(...y),A),[])},l={add:(d,m={})=>{let{name:h,override:f,aliases:g}=m,A={step:"initialize",priority:"normal",middleware:d,...m},y=nO(h,g);if(y.length>0){if(y.some(E=>r.has(E))){if(!f)throw new Error(`Duplicate middleware name '${b1(h,g)}'`);for(let E of y){let _=t.findIndex(C=>C.name===E||C.aliases?.some(I=>I===E));if(_===-1)continue;let S=t[_];if(S.step!==A.step||A.priority!==S.priority)throw new Error(`"${b1(S.name,S.aliases)}" middleware with ${S.priority} priority in ${S.step} step cannot be overridden by "${b1(h,g)}" middleware with ${A.priority} priority in ${A.step} step.`);t.splice(_,1)}}for(let E of y)r.add(E)}t.push(A)},addRelativeTo:(d,m)=>{let{name:h,override:f,aliases:g}=m,A={middleware:d,...m},y=nO(h,g);if(y.length>0){if(y.some(E=>r.has(E))){if(!f)throw new Error(`Duplicate middleware name '${b1(h,g)}'`);for(let E of y){let _=e.findIndex(C=>C.name===E||C.aliases?.some(I=>I===E));if(_===-1)continue;let S=e[_];if(S.toMiddleware!==A.toMiddleware||S.relation!==A.relation)throw new Error(`"${b1(S.name,S.aliases)}" middleware ${S.relation} "${S.toMiddleware}" middleware cannot be overridden by "${b1(h,g)}" middleware ${A.relation} "${A.toMiddleware}" middleware.`);e.splice(_,1)}}for(let E of y)r.add(E)}e.push(A)},clone:()=>a(_1()),use:d=>{d.applyToStack(l)},remove:d=>typeof d=="string"?s(d):o(d),removeByTag:d=>{let m=!1,h=f=>{let{tags:g,name:A,aliases:y}=f;if(g&&g.includes(d)){let E=nO(A,y);for(let _ of E)r.delete(_);return m=!0,!1}return!0};return t=t.filter(h),e=e.filter(h),m},concat:d=>{let m=a(_1());return m.use(d),m.identifyOnResolve(n||m.identifyOnResolve()||(d.identifyOnResolve?.()??!1)),m},applyToStack:a,identify:()=>u(!0).map(d=>{let m=d.step??d.relation+" "+d.toMiddleware;return b1(d.name,d.aliases)+" - "+m}),identifyOnResolve(d){return typeof d=="boolean"&&(n=d),n},resolve:(d,m)=>{for(let h of u().map(f=>f.middleware).reverse())d=h(d,m);return n&&console.log(l.identify()),d}};return l},EDt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},bDt={high:3,normal:2,low:1}});var aC=re(B_=>{p();var sUe;(function(t){t.HEADER="header",t.QUERY="query"})(sUe||(sUe={}));var oUe;(function(t){t.HEADER="header",t.QUERY="query"})(oUe||(oUe={}));var aUe;(function(t){t.HTTP="http",t.HTTPS="https"})(aUe||(aUe={}));var wz;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(wz||(wz={}));var SDr=t=>{let e=[];return t.sha256!==void 0&&e.push({algorithmId:()=>wz.SHA256,checksumConstructor:()=>t.sha256}),t.md5!=null&&e.push({algorithmId:()=>wz.MD5,checksumConstructor:()=>t.md5}),{addChecksumAlgorithm(n){e.push(n)},checksumAlgorithms(){return e}}},CDr=t=>{let e={};return t.checksumAlgorithms().forEach(n=>{e[n.algorithmId()]=n.checksumConstructor()}),e},IDr=t=>SDr(t),wDr=t=>CDr(t),cUe;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(cUe||(cUe={}));var TDr="__smithy_context",lUe;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(lUe||(lUe={}));var uUe;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(uUe||(uUe={}));B_.AlgorithmId=wz;B_.EndpointURLScheme=aUe;B_.FieldPosition=cUe;B_.HttpApiKeyAuthLocation=oUe;B_.HttpAuthLocation=sUe;B_.IniSectionType=lUe;B_.RequestHandlerProtocol=uUe;B_.SMITHY_CONTEXT_KEY=TDr;B_.getDefaultClientConfiguration=IDr;B_.resolveDefaultRuntimeConfig=wDr});var dUe,wc,_Dt=v(()=>{p();dUe=Ot(aC()),wc=t=>t[dUe.SMITHY_CONTEXT_KEY]||(t[dUe.SMITHY_CONTEXT_KEY]={})});function Ti(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var pUe=v(()=>{p()});function vDr(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];return{...e,[n]:Array.isArray(r)?[...r]:r}},{})}var no,xDt=v(()=>{p();no=class t{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let n=new t({...e,headers:{...e.headers}});return n.query&&(n.query=vDr(n.query)),n}static isInstance(e){if(!e)return!1;let n=e;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query=="object"&&typeof n.headers=="object"}clone(){return t.clone(this)}}});var Bp,SDt=v(()=>{p();Bp=class{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let n=e;return typeof n.statusCode=="number"&&typeof n.headers=="object"}}});var RDr,N_,CDt=v(()=>{p();RDr=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),N_=(t,e=!1)=>{if(!e)return RDr.test(t);let n=t.split(".");for(let r of n)if(!N_(r))return!1;return!0}});function Tz(t){return/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(t)}var IDt=v(()=>{p()});var qa,wDt=v(()=>{p();qa=t=>{if(typeof t=="function")return t;let e=Promise.resolve(t);return()=>e}});function vz(t){let e={};if(t=t.replace(/^\?/,""),t)for(let n of t.split("&")){let[r,i=null]=n.split("=");r=decodeURIComponent(r),i&&(i=decodeURIComponent(i)),r in e?Array.isArray(e[r])?e[r].push(i):e[r]=[e[r],i]:e[r]=i}return e}var mUe=v(()=>{p()});var Cm,hUe=v(()=>{p();mUe();Cm=t=>{if(typeof t=="string")return Cm(new URL(t));let{hostname:e,pathname:n,port:r,protocol:i,search:s}=t,o;return s&&(o=vz(s)),{hostname:e,port:r?parseInt(r):void 0,protocol:i,path:n,query:o}}});var uy,TDt=v(()=>{p();pUe();hUe();uy=t=>{if(typeof t=="object"){if("url"in t){let e=Cm(t.url);if(t.headers){e.headers={};for(let n in t.headers)Ti(t.headers,n)&&(e.headers[n.toLowerCase()]=t.headers[n].join(", "))}return e}return t}return Cm(t)}});var ps=v(()=>{p();_Dt();pUe();xDt();SDt();CDt();IDt();wDt();mUe();hUe();TDt()});var vDt,RDt=v(()=>{p();vDt=t=>()=>{throw new Error(t)}});var kDt,BDt=v(()=>{p();kDt=t=>()=>Promise.reject(t)});var J$,fUe=v(()=>{p();J$=()=>{let t=new WeakSet;return(e,n)=>{if(typeof n=="object"&&n!==null){if(t.has(n))return"[Circular]";t.add(n)}return n}}});var NDt,DDt=v(()=>{p();NDt=t=>new Promise(e=>setTimeout(e,t*1e3))});var ipe,dy,PDt,spe=v(()=>{p();fUe();ipe={minDelay:2,maxDelay:120};(function(t){t.ABORTED="ABORTED",t.FAILURE="FAILURE",t.SUCCESS="SUCCESS",t.RETRY="RETRY",t.TIMEOUT="TIMEOUT"})(dy||(dy={}));PDt=t=>{if(t.state===dy.ABORTED){let e=new Error(`${JSON.stringify({...t,reason:"Request was aborted"},J$())}`);throw e.name="AbortError",e}else if(t.state===dy.TIMEOUT){let e=new Error(`${JSON.stringify({...t,reason:"Waiter has timed out"},J$())}`);throw e.name="TimeoutError",e}else if(t.state!==dy.SUCCESS)throw new Error(`${JSON.stringify(t,J$())}`);return t}});var MDt,kDr,BDr,NDr,DDr,ODt=v(()=>{p();fUe();DDt();spe();MDt=async({minDelay:t,maxDelay:e,maxWaitTime:n,abortController:r,client:i,abortSignal:s},o,a)=>{let c={},[u,l]=[t*1e3,e*1e3],d=0,m=Date.now()+n*1e3,h=Date.now()+6e4,f=!1;for(;;){if(d>0){let y=NDr(u,l,d,m);if(r?.signal?.aborted||s?.aborted){let E="AbortController signal aborted.";return c[E]|=0,c[E]+=1,{state:dy.ABORTED,observedResponses:c}}if(Date.now()+y>m)return{state:dy.TIMEOUT,observedResponses:c};await NDt(y/1e3)}let{state:g,reason:A}=await a(i,o);if(A){let y=BDr(A);c[y]|=0,c[y]+=1}if(g!==dy.RETRY)return{state:g,reason:A,final:A,observedResponses:c};d+=1,!f&&Date.now()>=h&&(kDr(c,i),f=!0)}},kDr=(t={},e)=>{let n=Object.keys(t),r=0,i=0;for(let a of n){let c=t[a]|0;r=Math.max(c,r),a.startsWith("403:")&&(i+=c)}let s=e?.config?.logger,o=typeof s?.warn=="function"&&!s.constructor?.name?.includes?.("NoOpLogger")?s:console;(i>=3||n[n.length-1]?.startsWith("403:"))&&o.warn("@smithy/util-waiter WARN - 403 status code encountered during waiter polling.")},BDr=t=>{let e=t?.$response?.statusCode??t?.$metadata?.httpStatusCode;return t?.$responseBodyText?`${e?e+": ":""}Deserialization error for body: ${t.$responseBodyText}`:e?t?.$response||t?.message?`${e??"Unknown"}: ${t?.message}`:`${e}: OK`:String(t?.message??JSON.stringify(t,J$())??"Unknown")},NDr=(t,e,n,r)=>{let i=Math.log(e/t)/Math.log(2)+1;if(n>i)return e;let s=t*2**(n-1),o=Math.min(s,e),a=DDr(t,o);if(Date.now()+a>r){let c=r-Date.now();return Math.max(0,c-500)}return a},DDr=(t,e)=>t+Math.random()*(e-t)});var LDt,FDt=v(()=>{p();LDt=t=>{if(t.maxWaitTime<=0)throw new Error("WaiterConfiguration.maxWaitTime must be greater than 0");if(t.minDelay<=0)throw new Error("WaiterConfiguration.minDelay must be greater than 0");if(t.maxDelay<=0)throw new Error("WaiterConfiguration.maxDelay must be greater than 0");if(t.maxWaitTime<=t.minDelay)throw new Error(`WaiterConfiguration.maxWaitTime [${t.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${t.minDelay}] for this waiter`);if(t.maxDelay{p();ODt();FDt();spe();QDt=t=>{let e,n=new Promise(r=>{e=()=>r({state:dy.ABORTED}),typeof t.addEventListener=="function"?t.addEventListener("abort",e):t.onabort=e});return{clearListener(){typeof t.removeEventListener=="function"&&t.removeEventListener("abort",e)},aborted:n}},UDt=async(t,e,n)=>{let r={...ipe,...t};LDt(r);let i=[MDt(r,e,n)],s=[];if(t.abortSignal){let{aborted:o,clearListener:a}=QDt(t.abortSignal);s.push(a),i.push(o)}if(t.abortController?.signal){let{aborted:o,clearListener:a}=QDt(t.abortController.signal);s.push(a),i.push(o)}return Promise.race(i).then(o=>{for(let a of s)a();return o})}});var Eh,$Dt=v(()=>{p();rpe();Eh=class{config;middlewareStack=_1();initConfig;handlers;constructor(e){this.config=e;let{protocol:n,protocolSettings:r}=e;r&&typeof n=="function"&&(e.protocol=new n(r))}send(e,n,r){let i=typeof n!="function"?n:void 0,s=typeof n=="function"?n:r,o=i===void 0&&this.config.cacheMiddleware===!0,a;if(o){this.handlers||(this.handlers=new WeakMap);let c=this.handlers;c.has(e.constructor)?a=c.get(e.constructor):(a=e.resolveMiddleware(this.middlewareStack,this.config,i),c.set(e.constructor,a))}else delete this.handlers,a=e.resolveMiddleware(this.middlewareStack,this.config,i);if(s)a(e).then(c=>s(null,c.output),c=>s(c)).catch(()=>{});else return a(e).then(c=>c.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}});var u0,gUe=v(()=>{p();u0=t=>typeof t=="function"?t():t});var X$,ope=v(()=>{p();X$=(t,e,n,r,i)=>({name:e,namespace:t,traits:n,input:r,output:i})});var WDt,AUe,HDt=v(()=>{p();ps();ope();WDt=t=>(e,n)=>async r=>{let{response:i}=await e(r),{operationSchema:s}=wc(n),[,o,a,c,u,l]=s??[];try{let d=await t.protocol.deserializeResponse(X$(o,a,c,u,l),{...t,...n},i);return{response:i,output:d}}catch(d){if(Object.defineProperty(d,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in d)){let m="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{d.message+=` + `+m}catch{!n.logger||n.logger?.constructor?.name==="NoOpLogger"?console.warn(m):n.logger?.warn?.(m)}typeof d.$responseBodyText<"u"&&d.$response&&(d.$response.body=d.$responseBodyText);try{if(Bp.isInstance(i)){let{headers:h={},statusCode:f}=i,g=Object.entries(h);d.$metadata={httpStatusCode:f,requestId:AUe(/^x-[\w-]+-request-?id$/,g),extendedRequestId:AUe(/^x-[\w-]+-id-2$/,g),cfId:AUe(/^x-[\w-]+-cf-id$/,g)}}}catch{}}throw d}},AUe=(t,e)=>(e.find(([n])=>n.match(t))||[void 0,void 0])[1]});var qDt,jDt=v(()=>{p();ps();ope();qDt=t=>(e,n)=>async r=>{let{operationSchema:i}=wc(n),[,s,o,a,c,u]=i??[],l=n.endpointV2?async()=>uy(n.endpointV2):t.endpoint,d=await t.protocol.serializeRequest(X$(s,o,a,c,u),r.input,{...t,...n,endpoint:l});return e({...r,request:d})}});function cC(t){return{applyToStack:e=>{e.add(qDt(t),EUe),e.add(WDt(t),yUe),t.protocol.setSerdeContext(t)}}}var yUe,EUe,VDt=v(()=>{p();HDt();jDt();yUe={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},EUe={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0}});var fu,x1=v(()=>{p();fu=class{name;namespace;traits;static assign(e,n){return Object.assign(e,n)}static[Symbol.hasInstance](e){let n=this.prototype.isPrototypeOf(e);return!n&&typeof e=="object"&&e!==null?e.symbol===this.symbol:n}getName(){return this.namespace+"#"+this.name}}});var Rz,YDt,zDt=v(()=>{p();x1();Rz=class t extends fu{static symbol=Symbol.for("@smithy/lis");valueSchema;symbol=t.symbol},YDt=(t,e,n,r)=>fu.assign(new Rz,{name:e,namespace:t,traits:n,valueSchema:r})});var kz,KDt,JDt=v(()=>{p();x1();kz=class t extends fu{static symbol=Symbol.for("@smithy/map");keySchema;valueSchema;symbol=t.symbol},KDt=(t,e,n,r,i)=>fu.assign(new kz,{name:e,namespace:t,traits:n,keySchema:r,valueSchema:i})});var Bz,XDt,ZDt=v(()=>{p();x1();Bz=class t extends fu{static symbol=Symbol.for("@smithy/ope");input;output;symbol=t.symbol},XDt=(t,e,n,r,i)=>fu.assign(new Bz,{name:e,namespace:t,traits:n,input:r,output:i})});var rO,ePt,bUe=v(()=>{p();x1();rO=class t extends fu{static symbol=Symbol.for("@smithy/str");memberNames;memberList;symbol=t.symbol},ePt=(t,e,n,r,i)=>fu.assign(new rO,{name:e,namespace:t,traits:n,memberNames:r,memberList:i})});var Nz,tPt,nPt=v(()=>{p();x1();bUe();Nz=class t extends rO{static symbol=Symbol.for("@smithy/err");ctor;symbol=t.symbol},tPt=(t,e,n,r,i,s)=>fu.assign(new Nz,{name:e,namespace:t,traits:n,memberNames:r,memberList:i,ctor:null})});function D_(t){if(typeof t=="object")return t;if(t=t|0,Dz[t])return Dz[t];let e={},n=0;for(let r of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(t>>n++&1)===1&&(e[r]=1);return Dz[t]=e}var Dz,_Ue=v(()=>{p();Dz=[]});function Mz(t,e){if(t instanceof jn)return Object.assign(t,{memberName:e,_isMemberSchema:!0});let n=jn;return new n(t,e)}var Pz,Oz,Lz,jn,xUe,SUe,rPt=v(()=>{p();gUe();_Ue();Pz={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},Oz=[],Lz={},jn=class t{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=t.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,n){this.ref=e,this.memberName=n;let r=[],i=e,s=e;for(this._isMemberSchema=!1;xUe(i);)r.push(i[1]),i=i[0],s=u0(i),this._isMemberSchema=!0;if(r.length>0){this.memberTraits={};for(let o=r.length-1;o>=0;--o){let a=r[o];Object.assign(this.memberTraits,D_(a))}}else this.memberTraits=0;if(s instanceof t){let o=this.memberTraits;Object.assign(this,s),this.memberTraits=Object.assign({},o,s.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=n??s.memberName;return}if(this.schema=u0(s),SUe(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(s),this.traits=0),this._isMemberSchema&&!n)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){let n=this.prototype.isPrototypeOf(e);return!n&&typeof e=="object"&&e!==null?e.symbol===this.symbol:n}static of(e){let n=typeof e=="function"||typeof e=="object"&&e!==null;if(typeof e=="number"){if(Oz[e])return Oz[e]}else if(typeof e=="string"){if(Lz[e])return Lz[e]}else if(n&&e[Pz.ns])return e[Pz.ns];let r=u0(e);if(r instanceof t)return r;if(xUe(r)){let[s,o]=r;if(s instanceof t)return Object.assign(s.getMergedTraits(),D_(o)),s;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}let i=new t(r);return n?e[Pz.ns]=i:typeof r=="string"?Lz[r]=i:typeof r=="number"?Oz[r]=i:i}getSchema(){let e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=!1){let{name:n}=this;return!e&&n&&n.includes("#")?n.split("#")[1]:n||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){let e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){let e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){let e=this.getSchema();if(typeof e!="object")return!1;let n=e[0];return n===3||n===-3||n===4}isUnionSchema(){let e=this.getSchema();return typeof e!="object"?!1:e[0]===4}isBlobSchema(){let e=this.getSchema();return e===21||e===42}isTimestampSchema(){let e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){let{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return D_(this.memberTraits)}getOwnTraits(){return D_(this.traits)}getKeySchema(){let[e,n]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!n)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);let r=this.getSchema(),i=e?15:r[4]??0;return Mz([i,0],"key")}getValueSchema(){let e=this.getSchema(),[n,r,i]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],s=typeof e=="number"?63&e:e&&typeof e=="object"&&(r||i)?e[3+e[0]]:n?15:void 0;if(s!=null)return Mz([s,0],r?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){let n=this.getSchema();if(this.isStructSchema()&&n[4].includes(e)){let r=n[4].indexOf(e),i=n[5][r];return Mz(xUe(i)?i:[i,0],e)}if(this.isDocumentSchema())return Mz([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){let e={};try{for(let[n,r]of this.structIterator())e[n]=r}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(let[e,n]of this.structIterator())if(n.isStreaming()&&n.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");let e=this.getSchema(),n=e[4].length,r=e[Pz.it];if(r&&n===r.length){yield*r;return}r=Array(n);for(let i=0;iArray.isArray(t)&&t.length===2,SUe=t=>Array.isArray(t)&&t.length>=5});var Z$,iPt,sPt,oPt=v(()=>{p();x1();Z$=class t extends fu{static symbol=Symbol.for("@smithy/sim");schemaRef;symbol=t.symbol},iPt=(t,e,n,r)=>fu.assign(new Z$,{name:e,namespace:t,traits:r,schemaRef:n}),sPt=(t,e,n,r)=>fu.assign(new Z$,{name:e,namespace:t,traits:n,schemaRef:r})});var aPt,cPt=v(()=>{p();aPt={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128}});var Tc,lPt=v(()=>{p();Tc=class t{namespace;schemas;exceptions;static registries=new Map;constructor(e,n=new Map,r=new Map){this.namespace=e,this.schemas=n,this.exceptions=r}static for(e){return t.registries.has(e)||t.registries.set(e,new t(e)),t.registries.get(e)}copyFrom(e){let{schemas:n,exceptions:r}=this;for(let[i,s]of e.schemas)n.has(i)||n.set(i,s);for(let[i,s]of e.exceptions)r.has(i)||r.set(i,s)}register(e,n){let r=this.normalizeShapeId(e);for(let i of[this,t.for(r.split("#")[0])])i.schemas.set(r,n)}getSchema(e){let n=this.normalizeShapeId(e);if(!this.schemas.has(n)){if(!e.includes("#")){let r="#"+e,i=[];for(let[s,o]of this.schemas.entries())s.endsWith(r)&&i.push(o);if(i.length===1)return i[0]}throw new Error(`@smithy/core/schema - schema not found for ${n}`)}return this.schemas.get(n)}registerError(e,n){let r=e,i=r[1];for(let s of[this,t.for(i)])s.schemas.set(i+"#"+r[2],r),s.exceptions.set(r,n)}getErrorCtor(e){let n=e;return this.exceptions.has(n)?this.exceptions.get(n):t.for(n[1]).exceptions.get(n)}getBaseException(){for(let e of this.exceptions.keys())if(Array.isArray(e)){let[,n,r]=e,i=n+"#"+r;if(i.startsWith("smithy.ts.sdk.synthetic.")&&i.endsWith("ServiceException"))return e}}find(e){for(let n of this.schemas.values())if(e(n))return n}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}});var uPt={};br(uPt,{ErrorSchema:()=>Nz,ListSchema:()=>Rz,MapSchema:()=>kz,NormalizedSchema:()=>jn,OperationSchema:()=>Bz,SCHEMA:()=>aPt,Schema:()=>fu,SimpleSchema:()=>Z$,StructureSchema:()=>rO,TypeRegistry:()=>Tc,deref:()=>u0,deserializerMiddlewareOption:()=>yUe,error:()=>tPt,getSchemaSerdePlugin:()=>cC,isStaticSchema:()=>SUe,list:()=>YDt,map:()=>KDt,op:()=>XDt,operation:()=>X$,serializerMiddlewareOption:()=>EUe,sim:()=>iPt,simAdapter:()=>sPt,simpleSchemaCacheN:()=>Oz,simpleSchemaCacheS:()=>Lz,struct:()=>ePt,traitsCache:()=>Dz,translateTraits:()=>D_});var bo=v(()=>{p();gUe();VDt();zDt();JDt();ZDt();ope();nPt();rPt();x1();oPt();bUe();cPt();_Ue();lPt()});function eW(t,e){if(e==null)return e;let n=jn.of(t);if(n.getMergedTraits().sensitive)return CUe;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return CUe}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return CUe}else if(n.isStructSchema()&&typeof e=="object"){let r=e,i={};for(let[s,o]of n.structIterator())r[s]!=null&&(i[s]=eW(o,r[s]));return i}return e}var CUe,IUe=v(()=>{p();bo();CUe="***SensitiveInformation***"});var dPt,If,wUe,TUe=v(()=>{p();dPt=Ot(aC());rpe();IUe();If=class{middlewareStack=_1();schema;static classBuilder(){return new wUe}resolveMiddlewareWithContext(e,n,r,{middlewareFn:i,clientName:s,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:c,smithyContext:u,additionalContext:l,CommandCtor:d}){for(let y of i.bind(this)(d,e,n,r))this.middlewareStack.use(y);let m=e.concat(this.middlewareStack),{logger:h}=n,f={logger:h,clientName:s,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:c,[dPt.SMITHY_CONTEXT_KEY]:{commandInstance:this,...u},...l},{requestHandler:g}=n,A=r??{};return u.eventStream&&(A={isEventStream:!0,...A}),m.resolve(y=>g.handle(y.request,A),f)}},wUe=class{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,n,r={}){return this._smithyContext={service:e,operation:n,...r},this}c(e={}){return this._additionalContext=e,this}n(e,n){return this._clientName=e,this._commandName=n,this}f(e=r=>r,n=r=>r){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=n,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){let e=this,n;return n=class extends If{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[r]){super(),this.input=r??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(r,i,s){let o=e._operationSchema,a=o?.[4]??o?.input,c=o?.[5]??o?.output;return this.resolveMiddlewareWithContext(r,i,s,{CommandCtor:n,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(o?eW.bind(null,a):u=>u),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?eW.bind(null,c):u=>u),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}});var pPt,mPt=v(()=>{p();pPt="***SensitiveInformation***"});var lC,hPt=v(()=>{p();lC=(t,e,n)=>{for(let[s,o]of Object.entries(t)){let a=async function(u,l,d){let m=new o(u);if(typeof l=="function")this.send(m,l);else if(typeof d=="function"){if(typeof l!="object")throw new Error(`Expected http options but got ${typeof l}`);this.send(m,l||{},d)}else return this.send(m,l)},c=(s[0].toLowerCase()+s.slice(1)).replace(/Command$/,"");e.prototype[c]=a}let{paginators:r={},waiters:i={}}=n??{};for(let[s,o]of Object.entries(r))e.prototype[s]===void 0&&(e.prototype[s]=function(a={},c,...u){return o({...c,client:this},a,...u)});for(let[s,o]of Object.entries(i))e.prototype[s]===void 0&&(e.prototype[s]=async function(a={},c,...u){let l=c;return typeof c=="number"&&(l={maxWaitTime:c}),o({...l,client:this},a,...u)})}});var d0,iO,vUe=v(()=>{p();d0=class t extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;let n=e;return t.prototype.isPrototypeOf(n)||!!n.$fault&&!!n.$metadata&&(n.$fault==="client"||n.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;let n=e;return this===t?t.isInstance(e):t.isInstance(e)?n.name&&this.name?this.prototype.isPrototypeOf(e)||n.name===this.name:this.prototype.isPrototypeOf(e):!1}},iO=(t,e={})=>{Object.entries(e).filter(([,r])=>r!==void 0).forEach(([r,i])=>{(t[r]==null||t[r]==="")&&(t[r]=i)});let n=t.message||t.Message||"UnknownError";return t.message=n,delete t.Message,t}});var RUe,fPt,PDr,gPt=v(()=>{p();vUe();RUe=({output:t,parsedBody:e,exceptionCtor:n,errorCode:r})=>{let i=PDr(t),s=i.httpStatusCode?i.httpStatusCode+"":void 0,o=new n({name:e?.code||e?.Code||r||s||"UnknownError",$fault:"client",$metadata:i});throw iO(o,e)},fPt=t=>({output:e,parsedBody:n,errorCode:r})=>{RUe({output:e,parsedBody:n,exceptionCtor:t,errorCode:r})},PDr=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]})});var uC,APt=v(()=>{p();uC=t=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}}});var yPt,dC,EPt=v(()=>{p();yPt=!1,dC=t=>{t&&!yPt&&parseInt(t.substring(1,t.indexOf(".")))<16&&(yPt=!0)}});var sO,bPt,ape,cpe,kUe=v(()=>{p();ps();sO=Ot(aC()),bPt=Object.values(sO.AlgorithmId),ape=t=>{let e=[];for(let n in sO.AlgorithmId){if(!Ti(sO.AlgorithmId,n))continue;let r=sO.AlgorithmId[n];t[r]!==void 0&&e.push({algorithmId:()=>r,checksumConstructor:()=>t[r]})}for(let[n,r]of Object.entries(t.checksumAlgorithms??{}))e.push({algorithmId:()=>n,checksumConstructor:()=>r});return{addChecksumAlgorithm(n){t.checksumAlgorithms=t.checksumAlgorithms??{};let r=n.algorithmId(),i=n.checksumConstructor();bPt.includes(r)?t.checksumAlgorithms[r.toUpperCase()]=i:t.checksumAlgorithms[r]=i,e.push(n)},checksumAlgorithms(){return e}}},cpe=t=>{let e={};return t.checksumAlgorithms().forEach(n=>{let r=n.algorithmId();bPt.includes(r)&&(e[r]=n.checksumConstructor())}),e}});var lpe,upe,BUe=v(()=>{p();lpe=t=>({setRetryStrategy(e){t.retryStrategy=e},retryStrategy(){return t.retryStrategy}}),upe=t=>{let e={};return e.retryStrategy=t.retryStrategy(),e}});var P_,_Pt,pC,xPt=v(()=>{p();kUe();BUe();P_=t=>Object.assign(ape(t),lpe(t)),_Pt=P_,pC=t=>Object.assign(cpe(t),upe(t))});var SPt,CPt=v(()=>{p();SPt=t=>Array.isArray(t)?t:[t]});var oO,IPt=v(()=>{p();ps();oO=t=>{let e="#text";for(let n in t)Ti(t,n)&&(t[n][e]!==void 0?t[n]=t[n][e]:typeof t[n]=="object"&&t[n]!==null&&(t[n]=oO(t[n])));return t}});var wPt,TPt=v(()=>{p();wPt=t=>t!=null});var jg,vPt=v(()=>{p();jg=class{trace(){}debug(){}info(){}warn(){}error(){}}});function NUe(t,e,n){let r,i,s;if(typeof e>"u"&&typeof n>"u")r={},s=t;else{if(r=t,typeof e=="function")return i=e,s=n,MDr(r,i,s);s=e}for(let o in s)if(Ti(s,o)){if(!Array.isArray(s[o])){r[o]=s[o];continue}BPt(r,null,s,o)}return r}var RPt,kPt,MDr,BPt,ODr,LDr,NPt=v(()=>{p();ps();RPt=t=>{let e={};for(let[n,r]of Object.entries(t||{}))e[n]=[,r];return e},kPt=(t,e)=>{let n={};for(let r in e)Ti(e,r)&&BPt(n,t,e,r);return n},MDr=(t,e,n)=>NUe(t,Object.entries(n).reduce((r,[i,s])=>(Array.isArray(s)?r[i]=s:typeof s=="function"?r[i]=[e,s()]:r[i]=[e,s],r),{})),BPt=(t,e,n,r)=>{if(e!==null){let o=n[r];typeof o=="function"&&(o=[,o]);let[a=ODr,c=LDr,u=r]=o;(typeof a=="function"&&a(e[u])||typeof a!="function"&&a)&&(t[r]=c(e[u]));return}let[i,s]=n[r];if(typeof s=="function"){let o,a=i===void 0&&(o=s())!=null,c=typeof i=="function"&&!!i(void 0)||typeof i!="function"&&!!i;a?t[r]=o:c&&(t[r]=s())}else{let o=i===void 0&&s!=null,a=typeof i=="function"&&!!i(s)||typeof i!="function"&&!!i;(o||a)&&(t[r]=s)}},ODr=t=>t!=null,LDr=t=>t});var DPt,PPt,MPt=v(()=>{p();DPt=t=>{if(t!==t)return"NaN";switch(t){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return t}},PPt=t=>t.toISOString().replace(".000Z","Z")});var dpe,OPt=v(()=>{p();ps();dpe=t=>{if(t==null)return{};if(Array.isArray(t))return t.filter(e=>e!=null).map(dpe);if(typeof t=="object"){let e={};for(let n in t)Ti(t,n)&&t[n]!=null&&(e[n]=dpe(t[n]));return e}return t}});function mC(t,e,n,r){return function(s,o,a,c,u={}){let l=Object.assign({},t,s);return If.classBuilder().ep(l).m(function(d,m,h,f){let g=o.call(this,d,m,h,f);return g.unshift(r(h,d.getEndpointParameterInstructions())),g}).s(e,a,u).n(n,a.charAt(0).toUpperCase()+a.slice(1)+"Command").sc(c).build()}}var LPt=v(()=>{p();TUe()});var ppe={};br(ppe,{AlgorithmId:()=>sO.AlgorithmId,Client:()=>Eh,Command:()=>If,NoOpLogger:()=>jg,SENSITIVE_STRING:()=>pPt,ServiceException:()=>d0,WaiterState:()=>dy,_json:()=>dpe,checkExceptions:()=>PDt,constructStack:()=>_1,convertMap:()=>RPt,createAggregatedClient:()=>lC,createWaiter:()=>UDt,decorateServiceException:()=>iO,emitWarningIfUnsupportedVersion:()=>dC,getArrayIfSingleItem:()=>SPt,getChecksumConfiguration:()=>ape,getDefaultClientConfiguration:()=>_Pt,getDefaultExtensionConfiguration:()=>P_,getRetryConfiguration:()=>lpe,getSmithyContext:()=>wc,getValueFromTextNode:()=>oO,invalidFunction:()=>vDt,invalidProvider:()=>kDt,isSerializableHeaderValue:()=>wPt,loadConfigsForDefaultMode:()=>uC,makeBuilder:()=>mC,map:()=>NUe,normalizeProvider:()=>qa,resolveChecksumRuntimeConfig:()=>cpe,resolveDefaultRuntimeConfig:()=>pC,resolveRetryRuntimeConfig:()=>upe,schemaLogFilter:()=>eW,serializeDateTime:()=>PPt,serializeFloat:()=>DPt,take:()=>kPt,throwDefaultError:()=>RUe,waiterServiceDefaults:()=>ipe,withBaseException:()=>fPt});var Yi=v(()=>{p();rpe();ps();ps();RDt();BDt();GDt();spe();$Dt();TUe();mPt();hPt();gPt();APt();EPt();vUe();xPt();kUe();BUe();CPt();IPt();TPt();vPt();NPt();IUe();MPt();OPt();LPt()});var mpe,DUe=v(()=>{p();mpe=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"});var M_,S1,C1=v(()=>{p();DUe();M_=(t,e=0,n=t.byteLength-e)=>{if(!mpe(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Buffer.from(t,e,n)},S1=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?Buffer.from(t,e):Buffer.from(t)}});var FDr,gu,FPt=v(()=>{p();C1();FDr=/^[A-Za-z0-9+/]*={0,2}$/,gu=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!FDr.exec(t))throw new TypeError("Invalid base64 string.");let e=S1(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}});var Jd,hpe=v(()=>{p();C1();Jd=t=>{let e=S1(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)}});var vc,PUe=v(()=>{p();C1();hpe();vc=t=>{let e;if(typeof t=="string"?e=Jd(t):e=t,typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return M_(e.buffer,e.byteOffset,e.byteLength).toString("base64")}});function QPt(t,e,n,r){return class fpe extends Uint8Array{static fromString(s,o="utf-8"){if(typeof s=="string")return o==="base64"?fpe.mutate(r(s)):fpe.mutate(e(s));throw new Error(`Unsupported conversion from ${typeof s} to Uint8ArrayBlobAdapter.`)}static mutate(s){return Object.setPrototypeOf(s,fpe.prototype),s}transformToString(s="utf-8"){return s==="base64"?n(this):t(this)}}}var UPt=v(()=>{p()});var $l,GPt=v(()=>{p();C1();$l=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return M_(t.buffer,t.byteOffset,t.byteLength).toString("utf8")}});function $Pt(t){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?()=>crypto.randomUUID():()=>{let e=new Uint8Array(16);return t(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,bh[e[0]]+bh[e[1]]+bh[e[2]]+bh[e[3]]+"-"+bh[e[4]]+bh[e[5]]+"-"+bh[e[6]]+bh[e[7]]+"-"+bh[e[8]]+bh[e[9]]+"-"+bh[e[10]]+bh[e[11]]+bh[e[12]]+bh[e[13]]+bh[e[14]]+bh[e[15]]}}var bh,WPt=v(()=>{p();bh=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"))});var HPt,qPt=v(()=>{p();HPt=(t,e,n=r=>r)=>t});var jPt,VPt,tW,QDr,Fz,nW,YPt,gpe,Ape,ype,MUe,UDr,zPt,OUe,KPt,bpe,Qz,JPt,_pe,GDr,iW,xpe,XPt,ZPt,eMt,tMt,LUe,nMt,rMt,I1,Spe,Epe,rW,FUe=v(()=>{p();ps();jPt=t=>{switch(t){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${t}"`)}},VPt=t=>{if(t!=null){if(typeof t=="number"){if((t===0||t===1)&&rW.warn(Epe(`Expected boolean, got ${typeof t}: ${t}`)),t===0)return!1;if(t===1)return!0}if(typeof t=="string"){let e=t.toLowerCase();if((e==="false"||e==="true")&&rW.warn(Epe(`Expected boolean, got ${typeof t}: ${t}`)),e==="false")return!1;if(e==="true")return!0}if(typeof t=="boolean")return t;throw new TypeError(`Expected boolean, got ${typeof t}: ${t}`)}},tW=t=>{if(t!=null){if(typeof t=="string"){let e=parseFloat(t);if(!Number.isNaN(e))return String(e)!==String(t)&&rW.warn(Epe(`Expected number but observed string: ${t}`)),e}if(typeof t=="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)}},QDr=Math.ceil(2**127*(2-2**-23)),Fz=t=>{let e=tW(t);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0&&Math.abs(e)>QDr)throw new TypeError(`Expected 32-bit float, got ${t}`);return e},nW=t=>{if(t!=null){if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)}},YPt=nW,gpe=t=>MUe(t,32),Ape=t=>MUe(t,16),ype=t=>MUe(t,8),MUe=(t,e)=>{let n=nW(t);if(n!==void 0&&UDr(n,e)!==n)throw new TypeError(`Expected ${e}-bit integer, got ${t}`);return n},UDr=(t,e)=>{switch(e){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},zPt=(t,e)=>{if(t==null)throw e?new TypeError(`Expected a non-null value for ${e}`):new TypeError("Expected a non-null value");return t},OUe=t=>{if(t==null)return;if(typeof t=="object"&&!Array.isArray(t))return t;let e=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${e}: ${t}`)},KPt=t=>{if(t!=null){if(typeof t=="string")return t;if(["boolean","number","bigint"].includes(typeof t))return rW.warn(Epe(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)}},bpe=t=>{if(t==null)return;let e=OUe(t),n=[];for(let r in e)Ti(e,r)&&e[r]!=null&&n.push(r);if(n.length===0)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(n.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${n} were not null.`);return e},Qz=t=>tW(typeof t=="string"?iW(t):t),JPt=Qz,_pe=t=>Fz(typeof t=="string"?iW(t):t),GDr=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,iW=t=>{let e=t.match(GDr);if(e===null||e[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)},xpe=t=>typeof t=="string"?tMt(t):tW(t),XPt=xpe,ZPt=xpe,eMt=t=>typeof t=="string"?tMt(t):Fz(t),tMt=t=>{switch(t){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${t}`)}},LUe=t=>nW(typeof t=="string"?iW(t):t),nMt=LUe,rMt=t=>gpe(typeof t=="string"?iW(t):t),I1=t=>Ape(typeof t=="string"?iW(t):t),Spe=t=>ype(typeof t=="string"?iW(t):t),Epe=t=>String(new TypeError(t).stack||t).split(` `).slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join(` -`),BU={warn:console.warn}});function Hg(t){let e=t.getUTCFullYear(),n=t.getUTCMonth(),r=t.getUTCDay(),s=t.getUTCDate(),i=t.getUTCHours(),o=t.getUTCMinutes(),a=t.getUTCSeconds(),c=s<10?`0${s}`:`${s}`,u=i<10?`0${i}`:`${i}`,l=o<10?`0${o}`:`${o}`,d=a<10?`0${a}`:`${a}`;return`${Zrr[r]}, ${c} ${bBe[n]} ${e} ${u}:${l}:${d} GMT`}var Zrr,bBe,esr,c0t,tsr,MU,nsr,rsr,ssr,qv,LU,$Y,isr,osr,asr,EBe,csr,lsr,usr,yS,dsr,psr,OU,l0t=V(()=>{p();yBe();Zrr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],bBe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];esr=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),c0t=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let e=esr.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");let[n,r,s,i,o,a,c,u]=e,l=Wv(OU(r)),d=yS(s,"month",1,12),h=yS(i,"day",1,31);return $Y(l,d,h,{hours:o,minutes:a,seconds:c,fractionalMilliseconds:u})},tsr=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}:\d{2})|[zZ])$/),MU=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let e=tsr.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");let[n,r,s,i,o,a,c,u,l]=e,d=Wv(OU(r)),h=yS(s,"month",1,12),m=yS(i,"day",1,31),f=$Y(d,h,m,{hours:o,minutes:a,seconds:c,fractionalMilliseconds:u});return l.toUpperCase()!="Z"&&f.setTime(f.getTime()-psr(l)),f},nsr=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),rsr=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),ssr=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),qv=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=nsr.exec(t);if(e){let[n,r,s,i,o,a,c,u]=e;return $Y(Wv(OU(i)),EBe(s),yS(r,"day",1,31),{hours:o,minutes:a,seconds:c,fractionalMilliseconds:u})}if(e=rsr.exec(t),e){let[n,r,s,i,o,a,c,u]=e;return asr($Y(isr(i),EBe(s),yS(r,"day",1,31),{hours:o,minutes:a,seconds:c,fractionalMilliseconds:u}))}if(e=ssr.exec(t),e){let[n,r,s,i,o,a,c,u]=e;return $Y(Wv(OU(u)),EBe(r),yS(s.trimLeft(),"day",1,31),{hours:i,minutes:o,seconds:a,fractionalMilliseconds:c})}throw new TypeError("Invalid RFC-7231 date-time value")},LU=t=>{if(t==null)return;let e;if(typeof t=="number")e=t;else if(typeof t=="string")e=UY(t);else if(typeof t=="object"&&t.tag===1)e=t.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},$Y=(t,e,n,r)=>{let s=e-1;return lsr(t,s,n),new Date(Date.UTC(t,s,n,yS(r.hours,"hour",0,23),yS(r.minutes,"minute",0,59),yS(r.seconds,"seconds",0,60),dsr(r.fractionalMilliseconds)))},isr=t=>{let e=new Date().getUTCFullYear(),n=Math.floor(e/100)*100+Wv(OU(t));return nt.getTime()-new Date().getTime()>osr?new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())):t,EBe=t=>{let e=bBe.indexOf(t);if(e<0)throw new TypeError(`Invalid month: ${t}`);return e+1},csr=[31,28,31,30,31,30,31,31,30,31,30,31],lsr=(t,e,n)=>{let r=csr[e];if(e===1&&usr(t)&&(r=29),n>r)throw new TypeError(`Invalid day for ${bBe[e]} in ${t}: ${n}`)},usr=t=>t%4===0&&(t%100!==0||t%400===0),yS=(t,e,n,r)=>{let s=Poe(OU(t));if(sr)throw new TypeError(`${e} must be between ${n} and ${r}, inclusive`);return s},dsr=t=>t==null?0:Doe("0."+t)*1e3,psr=t=>{let e=t[0],n=1;if(e=="+")n=1;else if(e=="-")n=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);let r=Number(t.substring(1,3)),s=Number(t.substring(4,6));return n*(r*60+s)*60*1e3},OU=t=>{let e=0;for(;e{p();vu=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};vu.from=t=>t&&typeof t=="object"&&(t instanceof vu||"deserializeJSON"in t)?t:typeof t=="string"||Object.getPrototypeOf(t)===String.prototype?vu(String(t)):vu(JSON.stringify(t));vu.fromObject=vu.from});function Ooe(t){return(t.includes(",")||t.includes('"'))&&(t=`"${t.replace(/"/g,'\\"')}"`),t}var d0t=V(()=>{p()});function Ex(t,e,n){let r=Number(t);if(rn)throw new Error(`Value ${r} out of range [${e}, ${n}]`)}var _Be,SBe,CBe,p0t,h0t,hsr,msr,fsr,gsr,Asr,Hv,Moe,Loe,m0t=V(()=>{p();_Be="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",SBe="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",CBe="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",p0t="(\\d?\\d)",h0t="(\\d{4})",hsr=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),msr=new RegExp(`^${_Be}, ${p0t} ${SBe} ${h0t} ${CBe} GMT$`),fsr=new RegExp(`^${_Be}, ${p0t}-${SBe}-(\\d\\d) ${CBe} GMT$`),gsr=new RegExp(`^${_Be} ${SBe} ( [1-9]|\\d\\d) ${CBe} ${h0t}$`),Asr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Hv=t=>{if(t==null)return;let e=NaN;if(typeof t=="number")e=t;else if(typeof t=="string"){if(!/^-?\d*\.?\d+$/.test(t))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(t)}else typeof t=="object"&&t.tag===1&&(e=t.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(e*1e3))},Moe=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC3339 timestamps must be strings");let e=hsr.exec(t);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${t}`);let[,n,r,s,i,o,a,,c,u]=e;Ex(r,1,12),Ex(s,1,31),Ex(i,0,23),Ex(o,0,59),Ex(a,0,60);let l=new Date(Date.UTC(Number(n),Number(r)-1,Number(s),Number(i),Number(o),Number(a),Number(c)?Math.round(parseFloat(`0.${c}`)*1e3):0));if(l.setUTCFullYear(Number(n)),u.toUpperCase()!="Z"){let[,d,h,m]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],f=d==="-"?1:-1;l.setTime(l.getTime()+f*(Number(h)*60*60*1e3+Number(m)*60*1e3))}return l},Loe=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC7231 timestamps must be strings.");let e,n,r,s,i,o,a,c;if((c=msr.exec(t))?[,e,n,r,s,i,o,a]=c:(c=fsr.exec(t))?([,e,n,r,s,i,o,a]=c,r=(Number(r)+1900).toString()):(c=gsr.exec(t))&&([,n,e,s,i,o,a,r]=c),r&&o){let u=Date.UTC(Number(r),Asr.indexOf(n),Number(e),Number(s),Number(i),Number(o),a?Math.round(parseFloat(`0.${a}`)*1e3):0);Ex(e,1,31),Ex(s,0,23),Ex(i,0,59),Ex(o,0,60);let l=new Date(u);return l.setUTCFullYear(Number(r)),l}throw new TypeError(`Invalid RFC7231 date-time value ${t}.`)}});function Foe(t,e,n){if(n<=0||!Number.isInteger(n))throw new Error("Invalid number of delimiters ("+n+") for splitEvery.");let r=t.split(e);if(n===1)return r;let s=[],i="";for(let o=0;o{p()});var FU,g0t=V(()=>{p();FU=t=>{let e=t.length,n=[],r=!1,s,i=0;for(let o=0;o{o=o.trim();let a=o.length;return a<2?o:(o[0]==='"'&&o[a-1]==='"'&&(o=o.slice(1,a-1)),o.replace(/\\"/g,'"'))})}});function Qoe(t){return new zi(String(t),"bigDecimal")}var A0t,zi,y0t=V(()=>{p();A0t=/^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/,zi=class t{string;type;constructor(e,n){if(this.string=e,this.type=n,!A0t.test(e))throw new Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${e}"`)}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;let n=e;return t.prototype.isPrototypeOf(e)||n.type==="bigDecimal"&&A0t.test(n.string)}}});function Uoe(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let e=new Uint8Array(t.length/2);for(let n=0;n{p();E0t={},IBe={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),E0t[t]=e,IBe[e]=t}});var QU,ES,b0t=V(()=>{p();QU=require("node:fs"),ES=t=>{if(!t)return 0;if(typeof t=="string")return Buffer.byteLength(t);if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size;if(typeof t.start=="number"&&typeof t.end=="number")return t.end+1-t.start;if(t instanceof QU.ReadStream){if(t.path!=null)return(0,QU.lstatSync)(t.path).size;if(typeof t.fd=="number")return(0,QU.fstatSync)(t.fd).size}throw new Error(`Body Length computation failed for ${t}`)}});var aB,wBe=V(()=>{p();xoe();aB=t=>t instanceof Uint8Array?t:typeof t=="string"?od(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)});function Vv(t,e){if(e===void 0){e=0;for(let s of t)e+=s.byteLength}let n=new Uint8Array(e),r=0;for(let s of t)n.set(s,r),r+=s.byteLength;return n}var GY=V(()=>{p()});var $oe,TBe,vBe=V(()=>{p();si();$oe=(t,e)=>(n,r)=>async s=>{let{response:i}=await n(s);try{let o=await e(i,t);return{response:i,output:o}}catch(o){if(Object.defineProperty(o,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in o)){let a="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{o.message+=` - `+a}catch{!r.logger||r.logger?.constructor?.name==="NoOpLogger"?console.warn(a):r.logger?.warn?.(a)}typeof o.$responseBodyText<"u"&&o.$response&&(o.$response.body=o.$responseBodyText);try{if(Od.isInstance(i)){let{headers:c={}}=i,u=Object.entries(c);o.$metadata={httpStatusCode:i.statusCode,requestId:TBe(/^x-[\w-]+-request-?id$/,u),extendedRequestId:TBe(/^x-[\w-]+-id-2$/,u),cfId:TBe(/^x-[\w-]+-cf-id$/,u)}}}catch{}}throw o}},TBe=(t,e)=>(e.find(([n])=>n.match(t))||[void 0,void 0])[1]});var Vg,WY=V(()=>{p();Vg=class t extends Error{name="ProviderError";tryNextLink;constructor(e,n=!0){let r,s=!0;typeof n=="boolean"?(r=void 0,s=n):n!=null&&typeof n=="object"&&(r=n.logger,s=n.tryNextLink??!0),super(e),this.tryNextLink=s,Object.setPrototypeOf(this,t.prototype),r?.debug?.(`@smithy/property-provider ${s?"->":"(!)"} ${e}`)}static from(e,n=!0){return Object.assign(new this(e.message,n),e)}}});var jv,Goe=V(()=>{p();WY();jv=class t extends Vg{name="CredentialsProviderError";constructor(e,n=!0){super(e,n),Object.setPrototypeOf(this,t.prototype)}}});var Woe,_0t=V(()=>{p();WY();Woe=class t extends Vg{name="TokenProviderError";constructor(e,n=!0){super(e,n),Object.setPrototypeOf(this,t.prototype)}}});var qoe,RBe=V(()=>{p();WY();qoe=(...t)=>async()=>{if(t.length===0)throw new Vg("No providers in chain");let e;for(let n of t)try{return await n()}catch(r){if(e=r,r?.tryNextLink)continue;throw r}throw e}});var Hoe,kBe=V(()=>{p();Hoe=t=>()=>Promise.resolve(t)});var UU,Voe=V(()=>{p();UU=(t,e,n)=>{let r,s,i,o=!1,a=async()=>{s||(s=t());try{r=await s,i=!0,o=!1}finally{s=void 0}return r};return e===void 0?async c=>((!i||c?.forceRefresh)&&(r=await a()),r):async c=>((!i||c?.forceRefresh)&&(r=await a()),o?r:n&&!n(r)?(o=!0,r):(e(r)&&await a(),r))}});var Md,joe=V(()=>{p();Md=(t,e,n)=>{if(e in t){if(t[e]==="true")return!0;if(t[e]==="false")return!1;throw new Error(`Cannot load ${n} "${e}". Expected "true" or "false", got ${t[e]}.`)}}});var S0t,C0t=V(()=>{p();S0t=(t,e,n)=>{if(!(e in t))return;let r=parseInt(t[e],10);if(Number.isNaN(r))throw new TypeError(`Cannot load ${n} '${e}'. Expected number, got '${t[e]}'.`);return r}});var Ru,Yoe=V(()=>{p();(function(t){t.ENV="env",t.CONFIG="shared config entry"})(Ru||(Ru={}))});var I0t,x0t,NBe,ysr,bS,$U=V(()=>{p();I0t=require("node:os"),x0t=require("node:path"),NBe={},ysr=()=>process&&process.geteuid?`${process.geteuid()}`:"DEFAULT",bS=()=>{let{HOME:t,USERPROFILE:e,HOMEPATH:n,HOMEDRIVE:r=`C:${x0t.sep}`}=process.env;if(t)return t;if(e)return e;if(n)return`${r}${n}`;let s=ysr();return NBe[s]||(NBe[s]=(0,I0t.homedir)()),NBe[s]}});var DBe,BBe,Koe,PBe=V(()=>{p();DBe="AWS_PROFILE",BBe="default",Koe=t=>t.profile||process.env[DBe]||BBe});var w0t,T0t,zoe,OBe=V(()=>{p();w0t=require("node:crypto"),T0t=require("node:path");$U();zoe=t=>{let n=(0,w0t.createHash)("sha1").update(t).digest("hex");return(0,T0t.join)(bS(),".aws","sso","cache",`${n}.json`)}});var v0t,qY,R0t,MBe=V(()=>{p();v0t=require("node:fs/promises");OBe();qY={},R0t=async t=>{if(qY[t])return qY[t];let e=zoe(t),n=await(0,v0t.readFile)(e,"utf8");return JSON.parse(n)}});var _S,k0t=V(()=>{p();_S="."});var LBe,N0t,D0t=V(()=>{p();LBe=Gt(dS()),N0t=t=>Object.entries(t).filter(([e])=>{let n=e.indexOf(".");return n===-1?!1:Object.values(LBe.IniSectionType).includes(e.substring(0,n))}).reduce((e,[n,r])=>{let s=n.indexOf("."),i=n.substring(0,s)===LBe.IniSectionType.PROFILE?n.substring(s+1):n;return e[i]=r,e},{...t.default&&{default:t.default}})});var B0t,Esr,Joe,FBe=V(()=>{p();B0t=require("node:path");$U();Esr="AWS_CONFIG_FILE",Joe=()=>process.env[Esr]||(0,B0t.join)(bS(),".aws","config")});var P0t,bsr,O0t,M0t=V(()=>{p();P0t=require("node:path");$U();bsr="AWS_SHARED_CREDENTIALS_FILE",O0t=()=>process.env[bsr]||(0,P0t.join)(bS(),".aws","credentials")});var L0t,_sr,Ssr,HY,QBe=V(()=>{p();L0t=Gt(dS()),_sr=/^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/,Ssr=["__proto__","profile __proto__"],HY=t=>{let e={},n,r;for(let s of t.split(/\r?\n/)){let i=s.split(/(^|\s)[;#]/)[0].trim();if(i[0]==="["&&i[i.length-1]==="]"){n=void 0,r=void 0;let a=i.substring(1,i.length-1),c=_sr.exec(a);if(c){let[,u,,l]=c;Object.values(L0t.IniSectionType).includes(u)&&(n=[u,l].join("."))}else n=a;if(Ssr.includes(a))throw new Error(`Found invalid profile name "${a}"`)}else if(n){let a=i.indexOf("=");if(![0,-1].includes(a)){let[c,u]=[i.substring(0,a).trim(),i.substring(a+1).trim()];if(u==="")r=c;else{r&&s.trimStart()===s&&(r=void 0),e[n]=e[n]||{};let l=r?[r,c].join("."):c;e[n][l]=u}}}}return e}});var F0t,UBe,VY,cB,jY=V(()=>{p();F0t=require("node:fs/promises"),UBe={},VY={},cB=(t,e)=>VY[t]!==void 0?VY[t]:((!UBe[t]||e?.ignoreCache)&&(UBe[t]=(0,F0t.readFile)(t,"utf8")),UBe[t])});var $Be,Q0t,GU,Xoe=V(()=>{p();$Be=require("node:path");D0t();FBe();M0t();$U();QBe();jY();Q0t=()=>({}),GU=async(t={})=>{let{filepath:e=O0t(),configFilepath:n=Joe()}=t,r=bS(),s="~/",i=e;e.startsWith(s)&&(i=(0,$Be.join)(r,e.slice(2)));let o=n;n.startsWith(s)&&(o=(0,$Be.join)(r,n.slice(2)));let a=await Promise.all([cB(o,{ignoreCache:t.ignoreCache}).then(HY).then(N0t).catch(Q0t),cB(i,{ignoreCache:t.ignoreCache}).then(HY).catch(Q0t)]);return{configFile:a[0],credentialsFile:a[1]}}});var U0t,$0t,G0t=V(()=>{p();U0t=Gt(dS()),$0t=t=>Object.entries(t).filter(([e])=>e.startsWith(U0t.IniSectionType.SSO_SESSION+".")).reduce((e,[n,r])=>({...e,[n.substring(n.indexOf(".")+1)]:r}),{})});var Csr,W0t,q0t=V(()=>{p();FBe();G0t();QBe();jY();Csr=()=>({}),W0t=async(t={})=>cB(t.configFilepath??Joe()).then(HY).then($0t).catch(Csr)});var H0t,V0t=V(()=>{p();H0t=(...t)=>{let e={};for(let n of t)for(let[r,s]of Object.entries(n))e[r]!==void 0?Object.assign(e[r],s):e[r]=s;return e}});var j0t,Y0t=V(()=>{p();Xoe();V0t();j0t=async t=>{let e=await GU(t);return H0t(e.configFile,e.credentialsFile)}});var K0t,z0t=V(()=>{p();MBe();jY();K0t={getFileRecord(){return VY},interceptFile(t,e){VY[t]=Promise.resolve(e)},getTokenRecord(){return qY},interceptToken(t,e){qY[t]=e}}});function Zoe(t){try{let e=new Set(Array.from(t.match(/([A-Z_]){3,}/g)??[]));return e.delete("CONFIG"),e.delete("CONFIG_PREFIX_SEPARATOR"),e.delete("ENV"),[...e].join(", ")}catch{return t}}var GBe=V(()=>{p()});var J0t,X0t=V(()=>{p();Goe();GBe();J0t=(t,e)=>async()=>{try{let n=t(process.env,e);if(n===void 0)throw new Error;return n}catch(n){throw new jv(n.message||`Not found in ENV: ${Zoe(t.toString())}`,{logger:e?.logger})}}});var Z0t,eSt=V(()=>{p();Goe();PBe();Xoe();GBe();Z0t=(t,{preferredFile:e="config",...n}={})=>async()=>{let r=Koe(n),{configFile:s,credentialsFile:i}=await GU(n),o=i[r]||{},a=s[r]||{},c=e==="config"?{...o,...a}:{...a,...o};try{let l=t(c,e==="config"?s:i);if(l===void 0)throw new Error;return l}catch(u){throw new jv(u.message||`Not found in config files w/ profile [${r}]: ${Zoe(t.toString())}`,{logger:n.logger})}}});var Isr,eae,WBe=V(()=>{p();kBe();Isr=t=>typeof t=="function",eae=t=>Isr(t)?async()=>await t():Hoe(t)});var ei,qBe=V(()=>{p();RBe();Voe();X0t();eSt();WBe();ei=({environmentVariableSelector:t,configFileSelector:e,default:n},r={})=>{let{signingName:s,logger:i}=r;return UU(qoe(J0t(t,{signingName:s,logger:i}),Z0t(e,r),eae(n)))}});var tae,nae,tSt,SS,nSt,rSt=V(()=>{p();joe();Yoe();tae="AWS_USE_DUALSTACK_ENDPOINT",nae="use_dualstack_endpoint",tSt=!1,SS={environmentVariableSelector:t=>Md(t,tae,Ru.ENV),configFileSelector:t=>Md(t,nae,Ru.CONFIG),default:!1},nSt={environmentVariableSelector:t=>Md(t,tae,Ru.ENV),configFileSelector:t=>Md(t,nae,Ru.CONFIG),default:void 0}});var rae,sae,sSt,CS,iSt,oSt=V(()=>{p();joe();Yoe();rae="AWS_USE_FIPS_ENDPOINT",sae="use_fips_endpoint",sSt=!1,CS={environmentVariableSelector:t=>Md(t,rae,Ru.ENV),configFileSelector:t=>Md(t,sae,Ru.CONFIG),default:!1},iSt={environmentVariableSelector:t=>Md(t,rae,Ru.ENV),configFileSelector:t=>Md(t,sae,Ru.CONFIG),default:void 0}});var aSt,cSt=V(()=>{p();Is();aSt=t=>{let{tls:e,endpoint:n,urlParser:r,useDualstackEndpoint:s}=t;return Object.assign(t,{tls:e??!0,endpoint:ba(typeof n=="string"?r(n):n),isCustomEndpoint:!0,useDualstackEndpoint:ba(s??!1)})}});var lSt,uSt=V(()=>{p();lSt=async t=>{let{tls:e=!0}=t,n=await t.region();if(!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(n))throw new Error("Invalid region in client config");let s=await t.useDualstackEndpoint(),i=await t.useFipsEndpoint(),{hostname:o}=await t.regionInfoProvider(n,{useDualstackEndpoint:s,useFipsEndpoint:i})??{};if(!o)throw new Error("Cannot resolve hostname from client config");return t.urlParser(`${e?"https:":"http:"}//${o}`)}});var dSt,pSt=V(()=>{p();Is();uSt();dSt=t=>{let e=ba(t.useDualstackEndpoint??!1),{endpoint:n,useFipsEndpoint:r,urlParser:s,tls:i}=t;return Object.assign(t,{tls:i??!0,endpoint:n?ba(typeof n=="string"?s(n):n):()=>lSt({...t,useDualstackEndpoint:e,useFipsEndpoint:r}),isCustomEndpoint:!!n,useDualstackEndpoint:e})}});var hSt,HBe,VBe,mSt,fSt,gSt,ASt,ySt,ESt,jBe=V(()=>{p();hSt="AWS_EXECUTION_ENV",HBe="AWS_REGION",VBe="AWS_DEFAULT_REGION",mSt="AWS_EC2_METADATA_DISABLED",fSt=["in-region","cross-region","mobile","standard","legacy"],gSt="/latest/meta-data/placement/region",ASt="/latest/api/token",ySt="x-aws-ec2-metadata-token",ESt="x-aws-ec2-metadata-token-ttl-seconds"});var bSt,xsr,CSt,iae,_St,wsr,SSt,YBe=V(()=>{p();jBe();bSt=1e3,xsr=6e4,CSt=0,iae=async()=>{if(!process.env[mSt]&&!(Date.now(){CSt=Date.now()+xsr},wsr=()=>{let t=process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;if(t){let e=new URL(t);return{hostname:e.hostname.replace(/^\[(.+)]$/,"$1"),port:e.port?Number(e.port):void 0}}return process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE==="IPv6"?{hostname:"fd00:ec2::254"}:{hostname:"169.254.169.254"}},SSt=async t=>{let{request:e}=await import("node:http");return new Promise((n,r)=>{let s=e({hostname:t.hostname,port:t.port,path:t.path,method:t.method,headers:t.headers,timeout:bSt,signal:AbortSignal.timeout(bSt)});s.on("error",i=>{r(i),s.destroy()}),s.on("timeout",()=>{r(new Error("TimeoutError from instance metadata service")),s.destroy()}),s.on("response",i=>{let{statusCode:o=400}=i;if(o<200||o>=300){r(Object.assign(new Error("Error response received from instance metadata service"),{statusCode:o})),s.destroy();return}let a=[];i.on("data",c=>a.push(c)),i.on("end",()=>{n(Buffer.concat(a)),s.destroy()})}),s.end()})}});var WU,qU,xp,mm,KBe=V(()=>{p();YBe();WU="AWS_REGION",qU="region",xp={environmentVariableSelector:t=>t[WU],configFileSelector:t=>t[qU],default:async()=>{let t=await iae();if(t)return t;throw new Error("Region is missing")}},mm={preferredFile:"credentials"}});var ISt,xSt,wSt=V(()=>{p();si();ISt=new Set,xSt=(t,e=Hb)=>{if(!ISt.has(t)&&!e(t))if(t==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${t}" is not a valid hostname component.`);else ISt.add(t)}});var oae,zBe=V(()=>{p();oae=t=>typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips"))});var TSt,vSt=V(()=>{p();zBe();TSt=t=>oae(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t});var jg,RSt=V(()=>{p();wSt();vSt();zBe();jg=t=>{let{region:e,useFipsEndpoint:n}=t;if(!e)throw new Error("Region is missing");return Object.assign(t,{region:async()=>{let r=typeof e=="function"?await e():e,s=TSt(r);return xSt(s),s},useFipsEndpoint:async()=>{let r=typeof e=="string"?e:await e();return oae(r)?!0:typeof n!="function"?Promise.resolve(!!n):n()}})}});var JBe,kSt=V(()=>{p();JBe=(t=[],{useFipsEndpoint:e,useDualstackEndpoint:n})=>t.find(({tags:r})=>e===r.includes("fips")&&n===r.includes("dualstack"))?.hostname});var NSt,DSt=V(()=>{p();NSt=(t,{regionHostname:e,partitionHostname:n})=>e||(n?n.replace("{region}",t):void 0)});var BSt,PSt=V(()=>{p();BSt=(t,{partitionHash:e})=>Object.keys(e||{}).find(n=>e[n].regions.includes(t))??"aws"});var OSt,MSt=V(()=>{p();OSt=(t,{signingRegion:e,regionRegex:n,useFipsEndpoint:r})=>{if(e)return e;if(r){let s=n.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),i=t.match(s);if(i)return i[0].slice(1,-1)}}});var LSt,FSt=V(()=>{p();kSt();DSt();PSt();MSt();LSt=(t,{useFipsEndpoint:e=!1,useDualstackEndpoint:n=!1,signingService:r,regionHash:s,partitionHash:i})=>{let o=BSt(t,{partitionHash:i}),a=t in s?t:i[o]?.endpoint??t,c={useFipsEndpoint:e,useDualstackEndpoint:n},u=JBe(s[a]?.variants,c),l=JBe(i[o]?.variants,c),d=NSt(a,{regionHostname:u,partitionHostname:l});if(d===void 0)throw new Error(`Endpoint resolution failed for: ${{resolvedRegion:a,useFipsEndpoint:e,useDualstackEndpoint:n}}`);let h=OSt(d,{signingRegion:s[a]?.signingRegion,regionRegex:i[o].regionRegex,useFipsEndpoint:e});return{partition:o,signingService:r,hostname:d,...h&&{signingRegion:h},...s[a]?.signingService&&{signingService:s[a].signingService}}}});var Tsr,vsr,QSt,USt=V(()=>{p();Tsr="AWS_DEFAULTS_MODE",vsr="defaults_mode",QSt={environmentVariableSelector:t=>t[Tsr],configFileSelector:t=>t[vsr],default:"legacy"}});var IS,Rsr,ksr,$St=V(()=>{p();KBe();YBe();qBe();Voe();jBe();USt();IS=({region:t=ei(xp),defaultsMode:e=ei(QSt)}={})=>UU(async()=>{let n=typeof e=="function"?await e():e;switch(n?.toLowerCase()){case"auto":return Rsr(t);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(n?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${fSt.join(", ")}, got ${n}`)}}),Rsr=async t=>{if(t){let e=typeof t=="function"?await t():t,n=await ksr();return n?e===n?"in-region":"cross-region":"standard"}return"standard"},ksr=async()=>process.env[hSt]&&(process.env[HBe]||process.env[VBe])?process.env[HBe]??process.env[VBe]:iae()});var xf={};Ir(xf,{CONFIG_PREFIX_SEPARATOR:()=>_S,CONFIG_USE_DUALSTACK_ENDPOINT:()=>nae,CONFIG_USE_FIPS_ENDPOINT:()=>sae,CredentialsProviderError:()=>jv,DEFAULT_PROFILE:()=>BBe,DEFAULT_USE_DUALSTACK_ENDPOINT:()=>tSt,DEFAULT_USE_FIPS_ENDPOINT:()=>sSt,ENV_PROFILE:()=>DBe,ENV_USE_DUALSTACK_ENDPOINT:()=>tae,ENV_USE_FIPS_ENDPOINT:()=>rae,NODE_REGION_CONFIG_FILE_OPTIONS:()=>mm,NODE_REGION_CONFIG_OPTIONS:()=>xp,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:()=>SS,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:()=>CS,ProviderError:()=>Vg,REGION_ENV_NAME:()=>WU,REGION_INI_NAME:()=>qU,SelectorType:()=>Ru,TokenProviderError:()=>Woe,booleanSelector:()=>Md,chain:()=>qoe,externalDataInterceptor:()=>K0t,fromStatic:()=>eae,fromValue:()=>Hoe,getHomeDir:()=>bS,getProfileName:()=>Koe,getRegionInfo:()=>LSt,getSSOTokenFilepath:()=>zoe,getSSOTokenFromFile:()=>R0t,loadConfig:()=>ei,loadSharedConfigFiles:()=>GU,loadSsoSessionData:()=>W0t,memoize:()=>UU,nodeDualstackConfigSelectors:()=>nSt,nodeFipsConfigSelectors:()=>iSt,numberSelector:()=>S0t,parseKnownFiles:()=>j0t,readFile:()=>cB,resolveCustomEndpointsConfig:()=>aSt,resolveDefaultsModeConfig:()=>IS,resolveEndpointsConfig:()=>dSt,resolveRegionConfig:()=>jg});var Jo=V(()=>{p();WY();Goe();_0t();RBe();kBe();Voe();joe();C0t();Yoe();$U();PBe();OBe();MBe();k0t();Xoe();q0t();Y0t();z0t();jY();qBe();WBe();rSt();oSt();cSt();pSt();KBe();RSt();FSt();$St()});var GSt,WSt,qSt,HSt=V(()=>{p();GSt="AWS_ENDPOINT_URL",WSt="endpoint_url",qSt=t=>({environmentVariableSelector:e=>{let n=t.split(" ").map(i=>i.toUpperCase()),r=e[[GSt,...n].join("_")];if(r)return r;let s=e[GSt];if(s)return s},configFileSelector:(e,n)=>{if(e.services){let s=["services",e.services].join(".");if(!n||!n[s])throw new Error(`The services section "${e.services}" specified in the profile is not present in the shared configuration file.`);let i=n[s],o=t.split(" ").map(c=>c.toLowerCase()),a=i[[o.join("_"),WSt].join(".")];if(a)return a}let r=e[WSt];if(r)return r},default:void 0})});var Nsr,Dsr,VSt,jSt=V(()=>{p();Jo();Nsr="AWS_IGNORE_CONFIGURED_ENDPOINT_URLS",Dsr="ignore_configured_endpoint_urls",VSt={environmentVariableSelector:t=>Md(t,Nsr,Ru.ENV),configFileSelector:t=>Md(t,Dsr,Ru.CONFIG),default:!1}});var YY,YSt=V(()=>{p();Jo();HSt();jSt();YY=async t=>{if(!await ei(VSt)())return ei(qSt(t??""))()}});var XBe,Bsr,Psr,Osr,KSt,zSt,JSt=V(()=>{p();XBe=async t=>{let e=t?.Bucket||"";if(typeof t.Bucket=="string"&&(t.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),zSt(e)){if(t.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!KSt(e)||e.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(t.ForcePathStyle=!0);return t.DisableMultiRegionAccessPoints&&(t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0),t},Bsr=/^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/,Psr=/(\d+\.){3}\d+/,Osr=/\.\./,KSt=t=>Bsr.test(t)&&!Psr.test(t)&&!Osr.test(t),zSt=t=>{let[e,n,r,,,s]=t.split(":"),i=e==="arn"&&t.split(":").length>=6,o=!!(i&&n&&r&&s);if(i&&!o)throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);return o}});var XSt=V(()=>{p();JSt()});var ZSt,eCt=V(()=>{p();ZSt=(t,e,n,r=!1)=>{let s=async()=>{let i;return r?i=n.clientContextParams?.[t]??n[t]??n[e]:i=n[t]??n[e],typeof i=="function"?i():i};return t==="credentialScope"||e==="CredentialScope"?async()=>{let i=typeof n.credentials=="function"?await n.credentials():n.credentials;return i?.credentialScope??i?.CredentialScope}:t==="accountId"||e==="AccountId"?async()=>{let i=typeof n.credentials=="function"?await n.credentials():n.credentials;return i?.accountId??i?.AccountId}:t==="endpoint"||e==="endpoint"?async()=>{if(n.isCustomEndpoint===!1)return;let i=await s();if(i&&typeof i=="object"){if("url"in i)return i.url.href;if("hostname"in i){let{protocol:o,hostname:a,port:c,path:u}=i;return`${o}//${a}${c?":"+c:""}${u}`}}return i}:s}});var aae=V(()=>{p();si()});function cae(t){return async(e,n,r,s)=>{if(!r.isCustomEndpoint&&!r.ignoreConfiguredEndpointUrls){let a;r.serviceConfiguredEndpoint?a=await r.serviceConfiguredEndpoint():a=await t(r.serviceId),a&&(r.endpoint=()=>Promise.resolve(Wg(a)),r.isCustomEndpoint=!0,s?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${a}`))}let i=await KY(e,n,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");let o=r.endpointProvider(i,s);if(r.isCustomEndpoint&&r.endpoint){let a=await r.endpoint();if(a?.headers){o.headers??={};for(let[c,u]of Object.entries(a.headers))o.headers[c]=Array.isArray(u)?u:[u]}}return o}}var KY,lae=V(()=>{p();XSt();eCt();aae();KY=async(t,e,n)=>{let r={},s=e?.getEndpointParameterInstructions?.()||{};for(let[i,o]of Object.entries(s))switch(o.type){case"staticContextParams":r[i]=o.value;break;case"contextParams":r[i]=t[o.name];break;case"clientContextParams":case"builtInParams":r[i]=await ZSt(o.name,i,n,o.type!=="builtInParams")();break;case"operationContextParams":r[i]=o.get(t);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(o))}return Object.keys(s).length===0&&Object.assign(r,n),String(n.serviceId).toLowerCase()==="s3"&&await XBe(r),r}});function Msr(t,e,n){t.__smithy_context?t.__smithy_context.features||(t.__smithy_context.features={}):t.__smithy_context={features:{}},t.__smithy_context.features[e]=n}function uae(t){let e=cae(t);return({config:n,instructions:r})=>(s,i)=>async o=>{n.isCustomEndpoint&&Msr(i,"ENDPOINT_OVERRIDE","N");let a=await e(o.input,{getEndpointParameterInstructions(){return r}},{...n},i);i.endpointV2=a,i.authSchemes=a.properties?.authSchemes;let c=i.authSchemes?.[0];if(c){i.signing_region=c.signingRegion,i.signing_service=c.signingName;let l=Ha(i)?.selectedHttpAuthScheme?.httpAuthOption;l&&(l.signingProperties=Object.assign(l.signingProperties||{},{signing_region:c.signingRegion,signingRegion:c.signingRegion,signing_service:c.signingName,signingName:c.signingName,signingRegionSet:c.signingRegionSet},c.properties))}return s({...o})}}var ZBe=V(()=>{p();si();lae()});function tCt(t){let e=uae(t);return(n,r)=>({applyToStack:s=>{s.addRelativeTo(e({config:n,instructions:r}),ePe)}})}var Lsr,ePe,tPe=V(()=>{p();ZBe();Lsr={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0},ePe={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Lsr.name}});function nCt(t){return e=>{let n=e.tls??!0,{endpoint:r,useDualstackEndpoint:s,useFipsEndpoint:i}=e,o=r!=null?async()=>Wg(await ba(r)()):void 0,c=Object.assign(e,{endpoint:o,tls:n,isCustomEndpoint:!!r,useDualstackEndpoint:ba(s??!1),useFipsEndpoint:ba(i??!1),ignoreConfiguredEndpointUrls:!!e.ignoreConfiguredEndpointUrls}),u;return c.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=t(e.serviceId)),u),c}}var rCt=V(()=>{p();si();aae()});var Gy,sCt=V(()=>{p();Gy=class t{nodes;root;conditions;results;constructor(e,n,r,s){this.nodes=e,this.root=n,this.conditions=r,this.results=s}static from(e,n,r,s){return new t(e,n,r,s)}}});var Wy,iCt=V(()=>{p();Wy=class{capacity;data=new Map;parameters=[];constructor({size:e,params:n}){this.capacity=e??50,n&&(this.parameters=n)}get(e,n){let r=this.hash(e);if(r===!1)return n();if(!this.data.has(r)){if(this.data.size>this.capacity+10){let s=this.data.keys(),i=0;for(;;){let{value:o,done:a}=s.next();if(this.data.delete(o),a||++i>10)break}}this.data.set(r,n())}return this.data.get(r)}size(){return this.data.size}hash(e){let n="",{parameters:r}=this;if(r.length===0)return!1;for(let s of r){let i=String(e[s]??"");if(i.includes("|;"))return!1;n+=i+"|;"}return n}}});var Co,oCt=V(()=>{p();Co=class extends Error{constructor(e){super(e),this.name="EndpointError"}}});var Yg=V(()=>{p();oCt()});var xS,aCt=V(()=>{p();xS="endpoints"});function Kg(t){return typeof t!="object"||t==null?t:"ref"in t?`$${Kg(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(Kg).join(", ")})`:JSON.stringify(t,null,2)}var cCt=V(()=>{p()});var zY=V(()=>{p();aCt();cCt()});var wf,nPe=V(()=>{p();wf={}});var rPe,lCt=V(()=>{p();rPe=(t,e)=>t===e});function sPe(...t){for(let e of t)if(e!=null)return e}var uCt=V(()=>{p()});var dCt,pCt=V(()=>{p();Yg();dCt=t=>{let e=t.split("."),n=[];for(let r of e){let s=r.indexOf("[");if(s!==-1){if(r.indexOf("]")!==r.length-1)throw new Co(`Path: '${t}' does not end with ']'`);let i=r.slice(s+1,-1);if(Number.isNaN(parseInt(i)))throw new Co(`Invalid array index: '${i}' in path: '${t}'`);s!==0&&n.push(r.slice(0,s)),n.push(i)}else n.push(r)}return n}});var JY,hCt=V(()=>{p();Yg();pCt();JY=(t,e)=>dCt(e).reduce((n,r)=>{if(typeof n!="object")throw new Co(`Index '${r}' in '${e}' not found in '${JSON.stringify(t)}'`);if(Array.isArray(n)){let s=parseInt(r);return n[s<0?n.length+s:s]}return n[r]},t)});var iPe,mCt=V(()=>{p();iPe=t=>t!=null});function oPe(t,e,n){return t?e:n}var fCt=V(()=>{p()});var aPe,gCt=V(()=>{p();aPe=t=>!t});var Fsr,bx,cPe=V(()=>{p();Fsr=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),bx=t=>Fsr.test(t)||t.startsWith("[")&&t.endsWith("]")});var dae,lPe,uPe,ACt=V(()=>{p();dae=Gt(dS());cPe();lPe={[dae.EndpointURLScheme.HTTP]:80,[dae.EndpointURLScheme.HTTPS]:443},uPe=t=>{let e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){let{hostname:h,port:m,protocol:f="",path:g="",query:A={}}=t,y=new URL(`${f}//${h}${m?`:${m}`:""}${g}`);return y.search=Object.entries(A).map(([b,S])=>`${b}=${S}`).join("&"),y}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;let n=e.href,{host:r,hostname:s,pathname:i,protocol:o,search:a}=e;if(a)return null;let c=o.slice(0,-1);if(!Object.values(dae.EndpointURLScheme).includes(c))return null;let u=bx(s),l=n.includes(`${r}:${lPe[c]}`)||typeof t=="string"&&t.includes(`${r}:${lPe[c]}`),d=`${r}${l?`:${lPe[c]}`:""}`;return{scheme:c,authority:d,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:u}}});function dPe(t,e,n){if(n===1)return[t];if(t==="")return[""];let r=t.split(e);return n===0?r:r.slice(0,n-1).concat(r.slice(1).join(e))}var yCt=V(()=>{p()});var pPe,ECt=V(()=>{p();pPe=(t,e)=>t===e});var hPe,bCt=V(()=>{p();hPe=(t,e,n,r)=>t==null||e>=n||t.length{p();mPe=t=>encodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)});var fPe=V(()=>{p();lCt();uCt();hCt();mCt();si();fCt();gCt();ACt();yCt();ECt();bCt();_Ct()});var SCt,CCt=V(()=>{p();fPe();SCt={booleanEquals:rPe,coalesce:sPe,getAttr:JY,isSet:iPe,isValidHostLabel:Hb,ite:oPe,not:aPe,parseURL:uPe,split:dPe,stringEquals:pPe,substring:hPe,uriEncode:mPe}});var pae,gPe=V(()=>{p();fPe();pae=(t,e)=>{let n=[],{referenceRecord:r,endpointParams:s}=e,i=0;for(;i{p();ICt=({ref:t},e)=>e.referenceRecord[t]??e.endpointParams[t]});var _x,hae,wCt,HU=V(()=>{p();Yg();nPe();CCt();gPe();xCt();_x=(t,e,n)=>{if(typeof t=="string")return pae(t,n);if(t.fn)return wCt.callFunction(t,n);if(t.ref)return ICt(t,n);throw new Co(`'${e}': ${String(t)} is not a string, function or reference.`)},hae=({fn:t,argv:e},n)=>{let r=Array(e.length);for(let o=0;o{p();HU()});var mae,APe=V(()=>{p();zY();Yg();TCt();mae=(t,e)=>{let{assign:n}=t;if(n&&n in e.referenceRecord)throw new Co(`'${n}' is already defined in Reference Record.`);let r=hae(t,e);e.logger?.debug?.(`${xS} evaluateCondition: ${Kg(t)} = ${Kg(r)}`);let s=r===""?!0:!!r;return n!=null?{result:s,toAssign:{name:n,value:r}}:{result:s}}});var fae,yPe=V(()=>{p();Yg();HU();fae=(t,e)=>Object.entries(t??{}).reduce((n,[r,s])=>(n[r]=s.map(i=>{let o=_x(i,"Header value entry",e);if(typeof o!="string")throw new Co(`Header '${r}' value '${o}' is not a string`);return o}),n),{})});var XY,vCt,RCt,EPe=V(()=>{p();Yg();gPe();XY=(t,e)=>Object.entries(t).reduce((n,[r,s])=>(n[r]=RCt.getEndpointProperty(s,e),n),{}),vCt=(t,e)=>{if(Array.isArray(t))return t.map(n=>vCt(n,e));switch(typeof t){case"string":return pae(t,e);case"object":if(t===null)throw new Co(`Unexpected endpoint property: ${t}`);return RCt.getEndpointProperties(t,e);case"boolean":return t;default:throw new Co(`Unexpected endpoint property type: ${typeof t}`)}},RCt={getEndpointProperty:vCt,getEndpointProperties:XY}});var gae,bPe=V(()=>{p();Yg();HU();gae=(t,e)=>{let n=_x(t,"Endpoint URL",e);if(typeof n=="string")try{return new URL(n)}catch(r){throw console.error(`Failed to construct URL with ${n}`,r),r}throw new Co(`Endpoint URL must be a string, got ${typeof n}`)}});var _Pe,wS,kCt=V(()=>{p();Yg();APe();HU();yPe();EPe();bPe();_Pe=1e8,wS=(t,e)=>{let{nodes:n,root:r,results:s,conditions:i}=t,o=r,a={},c={referenceRecord:a,endpointParams:e.endpointParams,logger:e.logger};for(;o!==1&&o!==-1&&o<_Pe;){let u=3*(Math.abs(o)-1),[l,d,h]=[n[u],n[u+1],n[u+2]],[m,f,g]=i[l],A=mae({fn:m,assign:g,argv:f},c);if(A.toAssign){let{name:y,value:b}=A.toAssign;a[y]=b}o=o>=0===A.result?d:h}if(o>=_Pe){let u=s[o-_Pe];if(u[0]===-1){let[,m]=u;throw new Co(_x(m,"Error",c))}let[l,d,h]=u;return{url:gae(l,c),properties:XY(d,c),headers:fae(h??{},c)}}throw new Co("No matching endpoint.")}});var VU,Aae=V(()=>{p();zY();APe();VU=(t=[],e)=>{let n={},r={...e,referenceRecord:{...e.referenceRecord}},s=!1;for(let i of t){let{result:o,toAssign:a}=mae(i,r);if(!o)return{result:o};a&&(s=!0,n[a.name]=a.value,r.referenceRecord[a.name]=a.value,e.logger?.debug?.(`${xS} assign: ${a.name} := ${Kg(a.value)}`))}return s?{result:!0,referenceRecord:n}:{result:!0}}});var NCt,DCt=V(()=>{p();zY();Aae();yPe();EPe();bPe();NCt=(t,e)=>{let{conditions:n,endpoint:r}=t,{result:s,referenceRecord:i}=VU(n,e);if(!s)return;let o=i?{...e,referenceRecord:{...e.referenceRecord,...i}}:e,{url:a,properties:c,headers:u}=r;e.logger?.debug?.(`${xS} Resolving endpoint from template: ${Kg(r)}`);let l={url:gae(a,o)};return u!=null&&(l.headers=fae(u,o)),c!=null&&(l.properties=XY(c,o)),l}});var BCt,PCt=V(()=>{p();Yg();Aae();HU();BCt=(t,e)=>{let{conditions:n,error:r}=t,{result:s,referenceRecord:i}=VU(n,e);if(!s)return;let o=i?{...e,referenceRecord:{...e.referenceRecord,...i}}:e;throw new Co(_x(r,"Error",o))}});var yae,OCt,SPe,MCt=V(()=>{p();Yg();Aae();DCt();PCt();yae=(t,e)=>{for(let n of t)if(n.type==="endpoint"){let r=NCt(n,e);if(r)return r}else if(n.type==="error")BCt(n,e);else if(n.type==="tree"){let r=SPe.evaluateTreeRule(n,e);if(r)return r}else throw new Co(`Unknown endpoint rule: ${n}`);throw new Co("Rules evaluation failed")},OCt=(t,e)=>{let{conditions:n,rules:r}=t,{result:s,referenceRecord:i}=VU(n,e);if(!s)return;let o=i?{...e,referenceRecord:{...e.referenceRecord,...i}}:e;return SPe.evaluateRules(r,o)},SPe={evaluateRules:yae,evaluateTreeRule:OCt}});var LCt=V(()=>{p();MCt()});var ZY,FCt=V(()=>{p();si();zY();Yg();LCt();ZY=(t,e)=>{let{endpointParams:n,logger:r}=e,{parameters:s,rules:i}=t;e.logger?.debug?.(`${xS} Initial EndpointParams: ${Kg(n)}`);for(let a in s){if(!Cs(s,a))continue;let c=s[a],u=n[a];if(u==null&&c.default!=null){n[a]=c.default;continue}if(c.required&&u==null)throw new Co(`Missing required parameter: '${a}'`)}let o=yae(i,{endpointParams:n,logger:r,referenceRecord:{}});return e.logger?.debug?.(`${xS} Resolved endpoint: ${Kg(o)}`),o}});var QCt,UCt=V(()=>{p();QCt=t=>{let{endpoint:e}=t;return e===void 0&&(t.endpoint=async()=>{throw new Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.")}),t}});var Eae={};Ir(Eae,{BinaryDecisionDiagram:()=>Gy,EndpointCache:()=>Wy,EndpointError:()=>Co,customEndpointFunctions:()=>wf,decideEndpoint:()=>wS,endpointMiddleware:()=>Usr,endpointMiddlewareOptions:()=>ePe,getEndpointFromInstructions:()=>Qsr,getEndpointPlugin:()=>Cx,isIpAddress:()=>bx,isValidHostLabel:()=>Hb,middlewareEndpointToEndpointV1:()=>Wg,resolveEndpoint:()=>ZY,resolveEndpointConfig:()=>Sx,resolveEndpointRequiredConfig:()=>QCt,resolveParams:()=>KY,toEndpointV1:()=>Wg});var Qsr,Sx,Usr,Cx,Ta=V(()=>{p();YSt();lae();ZBe();tPe();rCt();si();sCt();iCt();kCt();cPe();si();nPe();FCt();Yg();lae();aae();tPe();UCt();Qsr=cae(YY),Sx=nCt(YY),Usr=uae(YY),Cx=tCt(YY)});var bae,CPe=V(()=>{p();Ta();bae=(t,e)=>(n,r)=>async s=>{let i=t,o=r.endpointV2?async()=>Wg(r.endpointV2):i.endpoint;if(!o)throw new Error("No valid endpoint provider available.");let a=await e(s.input,{...t,endpoint:o});return n({...s,request:a})}});function $Ct(t,e,n){return{applyToStack:r=>{r.add($oe(t,n),IPe),r.add(bae(t,e),xPe)}}}var IPe,xPe,GCt=V(()=>{p();vBe();CPe();IPe={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},xPe={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0}});function WCt(t,e){return Buffer.isBuffer(t)?t:typeof t=="string"?$v(t,e):ArrayBuffer.isView(t)?Yb(t.buffer,t.byteOffset,t.byteLength):Yb(t)}var Sae,_ae,qCt=V(()=>{p();Sae=require("node:crypto");Gv();wBe();_ae=class{algorithmIdentifier;secret;hash;constructor(e,n){this.algorithmIdentifier=e,this.secret=n,this.reset()}update(e,n){this.hash.update(aB(WCt(e,n)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?(0,Sae.createHmac)(this.algorithmIdentifier,WCt(this.secret)):(0,Sae.createHash)(this.algorithmIdentifier)}}});var HCt,jU,wPe=V(()=>{p();HCt=require("node:stream");mBe();jU=class extends HCt.Readable{expectedChecksum;checksumSourceLocation;checksum;source;base64Encoder;constructor({expectedChecksum:e,checksum:n,source:r,checksumSourceLocation:s,base64Encoder:i}){if(super(),typeof r.pipe!="function")throw new Error(`@smithy/util-stream: unsupported source type ${r?.constructor?.name??r} in ChecksumStream.`);this.source=r,this.base64Encoder=i??ja,this.expectedChecksum=e,this.checksum=n,this.checksumSourceLocation=s,this.source.on("data",this.onSourceData),this.source.on("end",this.onSourceEnd),this.source.on("error",this.onSourceError),this.source.on("close",this.onSourceClose),this.source.pause()}onSourceData=e=>{if(!this.destroyed){try{this.checksum.update(e)}catch(n){this.destroy(n);return}this.push(e)||this.source.pause()}};onSourceEnd=async()=>{if(!this.destroyed){try{let e=await this.checksum.digest(),n=this.base64Encoder(e);if(this.expectedChecksum!==n){this.destroy(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${n}" in response header "${this.checksumSourceLocation}".`));return}}catch(e){this.destroy(e);return}this.push(null)}};onSourceError=e=>{this.destroy(e)};onSourceClose=()=>{!this.destroyed&&!this.source.readableEnded&&this.destroy(new Error("Connection lost or stream closed before all data was received."))};_read(e){this.source.resume()}_destroy(e,n){this.source?.removeListener("data",this.onSourceData),this.source?.removeListener("end",this.onSourceEnd),this.source?.removeListener("error",this.onSourceError),this.source?.removeListener("close",this.onSourceClose),this.source?.destroy(),n(e)}}});var ad,Yv,Kb=V(()=>{p();ad=t=>typeof ReadableStream=="function"&&(t?.constructor?.name===ReadableStream.name||t instanceof ReadableStream),Yv=t=>typeof Blob=="function"&&(t?.constructor?.name===Blob.name||t instanceof Blob)});var VCt,jCt=V(()=>{p();VCt=t=>new TextEncoder().encode(t)});var YCt,lhi,KCt,Cae,TPe,zCt,JCt=V(()=>{p();YCt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lhi=Object.entries(YCt).reduce((t,[e,n])=>(t[n]=Number(e),t),{}),KCt=YCt.split(""),Cae=6,TPe=8,zCt=63});function Iae(t){let e;typeof t=="string"?e=VCt(t):e=t;let n=typeof e=="object"&&typeof e.length=="number",r=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!n&&!r)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let s="";for(let i=0;i>l]}s+="==".slice(0,4-c)}return s}var vPe=V(()=>{p();jCt();JCt()});var $sr,xae,XCt=V(()=>{p();$sr=typeof ReadableStream=="function"?ReadableStream:function(){},xae=class extends $sr{}});var ZCt,eIt=V(()=>{p();vPe();Kb();XCt();ZCt=({expectedChecksum:t,checksum:e,source:n,checksumSourceLocation:r,base64Encoder:s})=>{if(!ad(n))throw new Error(`@smithy/util-stream: unsupported source type ${n?.constructor?.name??n} in ChecksumStream.`);let i=s??Iae;if(typeof TransformStream!="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let o=new TransformStream({start(){},async transform(c,u){e.update(c),u.enqueue(c)},async flush(c){let u=await e.digest(),l=i(u);if(t!==l){let d=new Error(`Checksum mismatch: expected "${t}" but received "${l}" in response header "${r}".`);c.error(d)}else c.terminate()}});n.pipeThrough(o);let a=o.readable;return Object.setPrototypeOf(a,xae.prototype),a}});function tIt(t){return typeof ReadableStream=="function"&&ad(t.source)?ZCt(t):new jU(t)}var nIt=V(()=>{p();Kb();wPe();eIt()});var lB,RPe=V(()=>{p();lB=class{allocByteArray;byteLength=0;byteArrays=[];constructor(e){this.allocByteArray=e}push(e){this.byteArrays.push(e),this.byteLength+=e.byteLength}flush(){if(this.byteArrays.length===1){let r=this.byteArrays[0];return this.reset(),r}let e=this.allocByteArray(this.byteLength),n=0;for(let r=0;rnew Uint8Array(u))],a=-1,c=async u=>{let{value:l,done:d}=await r.read(),h=l;if(d){if(a!==-1){let m=uB(o,a);Ix(m)>0&&u.enqueue(m)}u.close()}else{let m=NPe(h,!1);if(a!==m&&(a>=0&&u.enqueue(uB(o,a)),a=m),a===-1){u.enqueue(h);return}let f=Ix(h);i+=f;let g=Ix(o[a]);if(f>=e&&g===0)u.enqueue(h);else{let A=kPe(o,a,h);!s&&i>e*2&&(s=!0,n?.warn(`@smithy/util-stream - stream chunk size ${f} is below threshold of ${e}, automatically buffering.`)),A>=e?u.enqueue(uB(o,a)):await c(u)}}};return new ReadableStream({pull:c})}function kPe(t,e,n){switch(e){case 0:return t[0]+=n,Ix(t[0]);case 1:case 2:return t[e].push(n),Ix(t[e])}}function uB(t,e){switch(e){case 0:let n=t[0];return t[0]="",n;case 1:case 2:return t[e].flush()}throw new Error(`@smithy/util-stream - invalid index ${e} given to flush()`)}function Ix(t){return t?.byteLength??t?.length??0}function NPe(t,e=!0){return e&&typeof Buffer<"u"&&t instanceof Buffer?2:t instanceof Uint8Array?1:typeof t=="string"?0:-1}var sIt=V(()=>{p();RPe()});function oIt(t,e,n){if(ad(t))return rIt(t,e,n);let r=new iIt.Readable({read(){}}),s=!1,i=0,o=["",new lB(c=>new Uint8Array(c)),new lB(c=>Buffer.from(new Uint8Array(c)))],a=-1;return t.on("data",c=>{let u=NPe(c,!0);if(a!==u&&(a>=0&&r.push(uB(o,a)),a=u),a===-1){r.push(c);return}let l=Ix(c);i+=l;let d=Ix(o[a]);if(l>=e&&d===0)r.push(c);else{let h=kPe(o,a,c);!s&&i>e*2&&(s=!0,n?.warn(`@smithy/util-stream - stream chunk size ${l} is below threshold of ${e}, automatically buffering.`)),h>=e&&r.push(uB(o,a))}}),t.on("end",()=>{if(a!==-1){let c=uB(o,a);Ix(c)>0&&r.push(c)}r.push(null)}),r}var iIt,aIt=V(()=>{p();iIt=require("node:stream");RPe();sIt();Kb()});var cIt,lIt=V(()=>{p();cIt=(t,e)=>{let{base64Encoder:n,bodyLengthChecker:r,checksumAlgorithmFn:s,checksumLocationName:i,streamHasher:o}=e,a=n!==void 0&&r!==void 0&&s!==void 0&&i!==void 0&&o!==void 0,c=a?o(s,t):void 0,u=t.getReader();return new ReadableStream({async pull(l){let{value:d,done:h}=await u.read();if(h){if(l.enqueue(`0\r -`),a){let m=n(await c);l.enqueue(`${i}:${m}\r +`),rW={warn:console.warn}});function py(t){let e=t.getUTCFullYear(),n=t.getUTCMonth(),r=t.getUTCDay(),i=t.getUTCDate(),s=t.getUTCHours(),o=t.getUTCMinutes(),a=t.getUTCSeconds(),c=i<10?`0${i}`:`${i}`,u=s<10?`0${s}`:`${s}`,l=o<10?`0${o}`:`${o}`,d=a<10?`0${a}`:`${a}`;return`${$Dr[r]}, ${c} ${UUe[n]} ${e} ${u}:${l}:${d} GMT`}var $Dr,UUe,WDr,iMt,HDr,oW,qDr,jDr,VDr,w1,aW,Uz,YDr,zDr,KDr,QUe,JDr,XDr,ZDr,hC,ePr,tPr,sW,sMt=v(()=>{p();FUe();$Dr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],UUe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];WDr=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),iMt=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let e=WDr.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");let[n,r,i,s,o,a,c,u]=e,l=I1(sW(r)),d=hC(i,"month",1,12),m=hC(s,"day",1,31);return Uz(l,d,m,{hours:o,minutes:a,seconds:c,fractionalMilliseconds:u})},HDr=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}:\d{2})|[zZ])$/),oW=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let e=HDr.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");let[n,r,i,s,o,a,c,u,l]=e,d=I1(sW(r)),m=hC(i,"month",1,12),h=hC(s,"day",1,31),f=Uz(d,m,h,{hours:o,minutes:a,seconds:c,fractionalMilliseconds:u});return l.toUpperCase()!="Z"&&f.setTime(f.getTime()-tPr(l)),f},qDr=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),jDr=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),VDr=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),w1=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=qDr.exec(t);if(e){let[n,r,i,s,o,a,c,u]=e;return Uz(I1(sW(s)),QUe(i),hC(r,"day",1,31),{hours:o,minutes:a,seconds:c,fractionalMilliseconds:u})}if(e=jDr.exec(t),e){let[n,r,i,s,o,a,c,u]=e;return KDr(Uz(YDr(s),QUe(i),hC(r,"day",1,31),{hours:o,minutes:a,seconds:c,fractionalMilliseconds:u}))}if(e=VDr.exec(t),e){let[n,r,i,s,o,a,c,u]=e;return Uz(I1(sW(u)),QUe(r),hC(i.trimLeft(),"day",1,31),{hours:s,minutes:o,seconds:a,fractionalMilliseconds:c})}throw new TypeError("Invalid RFC-7231 date-time value")},aW=t=>{if(t==null)return;let e;if(typeof t=="number")e=t;else if(typeof t=="string")e=Qz(t);else if(typeof t=="object"&&t.tag===1)e=t.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},Uz=(t,e,n,r)=>{let i=e-1;return XDr(t,i,n),new Date(Date.UTC(t,i,n,hC(r.hours,"hour",0,23),hC(r.minutes,"minute",0,59),hC(r.seconds,"seconds",0,60),ePr(r.fractionalMilliseconds)))},YDr=t=>{let e=new Date().getUTCFullYear(),n=Math.floor(e/100)*100+I1(sW(t));return nt.getTime()-new Date().getTime()>zDr?new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())):t,QUe=t=>{let e=UUe.indexOf(t);if(e<0)throw new TypeError(`Invalid month: ${t}`);return e+1},JDr=[31,28,31,30,31,30,31,31,30,31,30,31],XDr=(t,e,n)=>{let r=JDr[e];if(e===1&&ZDr(t)&&(r=29),n>r)throw new TypeError(`Invalid day for ${UUe[e]} in ${t}: ${n}`)},ZDr=t=>t%4===0&&(t%100!==0||t%400===0),hC=(t,e,n,r)=>{let i=Spe(sW(t));if(ir)throw new TypeError(`${e} must be between ${n} and ${r}, inclusive`);return i},ePr=t=>t==null?0:_pe("0."+t)*1e3,tPr=t=>{let e=t[0],n=1;if(e=="+")n=1;else if(e=="-")n=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);let r=Number(t.substring(1,3)),i=Number(t.substring(4,6));return n*(r*60+i)*60*1e3},sW=t=>{let e=0;for(;e{p();xd=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};xd.from=t=>t&&typeof t=="object"&&(t instanceof xd||"deserializeJSON"in t)?t:typeof t=="string"||Object.getPrototypeOf(t)===String.prototype?xd(String(t)):xd(JSON.stringify(t));xd.fromObject=xd.from});function Cpe(t){return(t.includes(",")||t.includes('"'))&&(t=`"${t.replace(/"/g,'\\"')}"`),t}var aMt=v(()=>{p()});function GT(t,e,n){let r=Number(t);if(rn)throw new Error(`Value ${r} out of range [${e}, ${n}]`)}var GUe,$Ue,WUe,cMt,lMt,nPr,rPr,iPr,sPr,oPr,T1,Ipe,wpe,uMt=v(()=>{p();GUe="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",$Ue="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",WUe="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",cMt="(\\d?\\d)",lMt="(\\d{4})",nPr=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),rPr=new RegExp(`^${GUe}, ${cMt} ${$Ue} ${lMt} ${WUe} GMT$`),iPr=new RegExp(`^${GUe}, ${cMt}-${$Ue}-(\\d\\d) ${WUe} GMT$`),sPr=new RegExp(`^${GUe} ${$Ue} ( [1-9]|\\d\\d) ${WUe} ${lMt}$`),oPr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],T1=t=>{if(t==null)return;let e=NaN;if(typeof t=="number")e=t;else if(typeof t=="string"){if(!/^-?\d*\.?\d+$/.test(t))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(t)}else typeof t=="object"&&t.tag===1&&(e=t.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(e*1e3))},Ipe=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC3339 timestamps must be strings");let e=nPr.exec(t);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${t}`);let[,n,r,i,s,o,a,,c,u]=e;GT(r,1,12),GT(i,1,31),GT(s,0,23),GT(o,0,59),GT(a,0,60);let l=new Date(Date.UTC(Number(n),Number(r)-1,Number(i),Number(s),Number(o),Number(a),Number(c)?Math.round(parseFloat(`0.${c}`)*1e3):0));if(l.setUTCFullYear(Number(n)),u.toUpperCase()!="Z"){let[,d,m,h]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],f=d==="-"?1:-1;l.setTime(l.getTime()+f*(Number(m)*60*60*1e3+Number(h)*60*1e3))}return l},wpe=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC7231 timestamps must be strings.");let e,n,r,i,s,o,a,c;if((c=rPr.exec(t))?[,e,n,r,i,s,o,a]=c:(c=iPr.exec(t))?([,e,n,r,i,s,o,a]=c,r=(Number(r)+1900).toString()):(c=sPr.exec(t))&&([,n,e,i,s,o,a,r]=c),r&&o){let u=Date.UTC(Number(r),oPr.indexOf(n),Number(e),Number(i),Number(s),Number(o),a?Math.round(parseFloat(`0.${a}`)*1e3):0);GT(e,1,31),GT(i,0,23),GT(s,0,59),GT(o,0,60);let l=new Date(u);return l.setUTCFullYear(Number(r)),l}throw new TypeError(`Invalid RFC7231 date-time value ${t}.`)}});function Tpe(t,e,n){if(n<=0||!Number.isInteger(n))throw new Error("Invalid number of delimiters ("+n+") for splitEvery.");let r=t.split(e);if(n===1)return r;let i=[],s="";for(let o=0;o{p()});var cW,pMt=v(()=>{p();cW=t=>{let e=t.length,n=[],r=!1,i,s=0;for(let o=0;o{o=o.trim();let a=o.length;return a<2?o:(o[0]==='"'&&o[a-1]==='"'&&(o=o.slice(1,a-1)),o.replace(/\\"/g,'"'))})}});function vpe(t){return new co(String(t),"bigDecimal")}var mMt,co,hMt=v(()=>{p();mMt=/^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/,co=class t{string;type;constructor(e,n){if(this.string=e,this.type=n,!mMt.test(e))throw new Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${e}"`)}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;let n=e;return t.prototype.isPrototypeOf(e)||n.type==="bigDecimal"&&mMt.test(n.string)}}});function Rpe(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let e=new Uint8Array(t.length/2);for(let n=0;n{p();fMt={},HUe={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),fMt[t]=e,HUe[e]=t}});var lW,fC,gMt=v(()=>{p();lW=require("node:fs"),fC=t=>{if(!t)return 0;if(typeof t=="string")return Buffer.byteLength(t);if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size;if(typeof t.start=="number"&&typeof t.end=="number")return t.end+1-t.start;if(t instanceof lW.ReadStream){if(t.path!=null)return(0,lW.lstatSync)(t.path).size;if(typeof t.fd=="number")return(0,lW.fstatSync)(t.fd).size}throw new Error(`Body Length computation failed for ${t}`)}});var wf,jUe=v(()=>{p();hpe();wf=t=>t instanceof Uint8Array?t:typeof t=="string"?Jd(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)});function gC(t,e){if(e===void 0){e=0;for(let i of t)e+=i.byteLength}let n=new Uint8Array(e),r=0;for(let i of t)n.set(i,r),r+=i.byteLength;return n}var Gz=v(()=>{p()});var kpe,VUe,YUe=v(()=>{p();ps();kpe=(t,e)=>(n,r)=>async i=>{let{response:s}=await n(i);try{let o=await e(s,t);return{response:s,output:o}}catch(o){if(Object.defineProperty(o,"$response",{value:s,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in o)){let a="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{o.message+=` + `+a}catch{!r.logger||r.logger?.constructor?.name==="NoOpLogger"?console.warn(a):r.logger?.warn?.(a)}typeof o.$responseBodyText<"u"&&o.$response&&(o.$response.body=o.$responseBodyText);try{if(Bp.isInstance(s)){let{headers:c={}}=s,u=Object.entries(c);o.$metadata={httpStatusCode:s.statusCode,requestId:VUe(/^x-[\w-]+-request-?id$/,u),extendedRequestId:VUe(/^x-[\w-]+-id-2$/,u),cfId:VUe(/^x-[\w-]+-cf-id$/,u)}}}catch{}}throw o}},VUe=(t,e)=>(e.find(([n])=>n.match(t))||[void 0,void 0])[1]});var my,$z=v(()=>{p();my=class t extends Error{name="ProviderError";tryNextLink;constructor(e,n=!0){let r,i=!0;typeof n=="boolean"?(r=void 0,i=n):n!=null&&typeof n=="object"&&(r=n.logger,i=n.tryNextLink??!0),super(e),this.tryNextLink=i,Object.setPrototypeOf(this,t.prototype),r?.debug?.(`@smithy/property-provider ${i?"->":"(!)"} ${e}`)}static from(e,n=!0){return Object.assign(new this(e.message,n),e)}}});var v1,Bpe=v(()=>{p();$z();v1=class t extends my{name="CredentialsProviderError";constructor(e,n=!0){super(e,n),Object.setPrototypeOf(this,t.prototype)}}});var Npe,AMt=v(()=>{p();$z();Npe=class t extends my{name="TokenProviderError";constructor(e,n=!0){super(e,n),Object.setPrototypeOf(this,t.prototype)}}});var Dpe,zUe=v(()=>{p();$z();Dpe=(...t)=>async()=>{if(t.length===0)throw new my("No providers in chain");let e;for(let n of t)try{return await n()}catch(r){if(e=r,r?.tryNextLink)continue;throw r}throw e}});var Ppe,KUe=v(()=>{p();Ppe=t=>()=>Promise.resolve(t)});var uW,Mpe=v(()=>{p();uW=(t,e,n)=>{let r,i,s,o=!1,a=async()=>{i||(i=t());try{r=await i,s=!0,o=!1}finally{i=void 0}return r};return e===void 0?async c=>((!s||c?.forceRefresh)&&(r=await a()),r):async c=>((!s||c?.forceRefresh)&&(r=await a()),o?r:n&&!n(r)?(o=!0,r):(e(r)&&await a(),r))}});var Np,Ope=v(()=>{p();Np=(t,e,n)=>{if(e in t){if(t[e]==="true")return!0;if(t[e]==="false")return!1;throw new Error(`Cannot load ${n} "${e}". Expected "true" or "false", got ${t[e]}.`)}}});var yMt,EMt=v(()=>{p();yMt=(t,e,n)=>{if(!(e in t))return;let r=parseInt(t[e],10);if(Number.isNaN(r))throw new TypeError(`Cannot load ${n} '${e}'. Expected number, got '${t[e]}'.`);return r}});var Sd,Lpe=v(()=>{p();(function(t){t.ENV="env",t.CONFIG="shared config entry"})(Sd||(Sd={}))});var bMt,_Mt,JUe,aPr,AC,dW=v(()=>{p();bMt=require("node:os"),_Mt=require("node:path"),JUe={},aPr=()=>process&&process.geteuid?`${process.geteuid()}`:"DEFAULT",AC=()=>{let{HOME:t,USERPROFILE:e,HOMEPATH:n,HOMEDRIVE:r=`C:${_Mt.sep}`}=process.env;if(t)return t;if(e)return e;if(n)return`${r}${n}`;let i=aPr();return JUe[i]||(JUe[i]=(0,bMt.homedir)()),JUe[i]}});var XUe,ZUe,Fpe,eGe=v(()=>{p();XUe="AWS_PROFILE",ZUe="default",Fpe=t=>t.profile||process.env[XUe]||ZUe});var xMt,SMt,Qpe,tGe=v(()=>{p();xMt=require("node:crypto"),SMt=require("node:path");dW();Qpe=t=>{let n=(0,xMt.createHash)("sha1").update(t).digest("hex");return(0,SMt.join)(AC(),".aws","sso","cache",`${n}.json`)}});var CMt,Wz,IMt,nGe=v(()=>{p();CMt=require("node:fs/promises");tGe();Wz={},IMt=async t=>{if(Wz[t])return Wz[t];let e=Qpe(t),n=await(0,CMt.readFile)(e,"utf8");return JSON.parse(n)}});var yC,wMt=v(()=>{p();yC="."});var rGe,TMt,vMt=v(()=>{p();rGe=Ot(aC()),TMt=t=>Object.entries(t).filter(([e])=>{let n=e.indexOf(".");return n===-1?!1:Object.values(rGe.IniSectionType).includes(e.substring(0,n))}).reduce((e,[n,r])=>{let i=n.indexOf("."),s=n.substring(0,i)===rGe.IniSectionType.PROFILE?n.substring(i+1):n;return e[s]=r,e},{...t.default&&{default:t.default}})});var RMt,cPr,Upe,iGe=v(()=>{p();RMt=require("node:path");dW();cPr="AWS_CONFIG_FILE",Upe=()=>process.env[cPr]||(0,RMt.join)(AC(),".aws","config")});var kMt,lPr,BMt,NMt=v(()=>{p();kMt=require("node:path");dW();lPr="AWS_SHARED_CREDENTIALS_FILE",BMt=()=>process.env[lPr]||(0,kMt.join)(AC(),".aws","credentials")});var DMt,uPr,dPr,Hz,sGe=v(()=>{p();DMt=Ot(aC()),uPr=/^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/,dPr=["__proto__","profile __proto__"],Hz=t=>{let e={},n,r;for(let i of t.split(/\r?\n/)){let s=i.split(/(^|\s)[;#]/)[0].trim();if(s[0]==="["&&s[s.length-1]==="]"){n=void 0,r=void 0;let a=s.substring(1,s.length-1),c=uPr.exec(a);if(c){let[,u,,l]=c;Object.values(DMt.IniSectionType).includes(u)&&(n=[u,l].join("."))}else n=a;if(dPr.includes(a))throw new Error(`Found invalid profile name "${a}"`)}else if(n){let a=s.indexOf("=");if(![0,-1].includes(a)){let[c,u]=[s.substring(0,a).trim(),s.substring(a+1).trim()];if(u==="")r=c;else{r&&i.trimStart()===i&&(r=void 0),e[n]=e[n]||{};let l=r?[r,c].join("."):c;e[n][l]=u}}}}return e}});var PMt,oGe,qz,aO,jz=v(()=>{p();PMt=require("node:fs/promises"),oGe={},qz={},aO=(t,e)=>qz[t]!==void 0?qz[t]:((!oGe[t]||e?.ignoreCache)&&(oGe[t]=(0,PMt.readFile)(t,"utf8")),oGe[t])});var aGe,MMt,pW,Gpe=v(()=>{p();aGe=require("node:path");vMt();iGe();NMt();dW();sGe();jz();MMt=()=>({}),pW=async(t={})=>{let{filepath:e=BMt(),configFilepath:n=Upe()}=t,r=AC(),i="~/",s=e;e.startsWith(i)&&(s=(0,aGe.join)(r,e.slice(2)));let o=n;n.startsWith(i)&&(o=(0,aGe.join)(r,n.slice(2)));let a=await Promise.all([aO(o,{ignoreCache:t.ignoreCache}).then(Hz).then(TMt).catch(MMt),aO(s,{ignoreCache:t.ignoreCache}).then(Hz).catch(MMt)]);return{configFile:a[0],credentialsFile:a[1]}}});var OMt,LMt,FMt=v(()=>{p();OMt=Ot(aC()),LMt=t=>Object.entries(t).filter(([e])=>e.startsWith(OMt.IniSectionType.SSO_SESSION+".")).reduce((e,[n,r])=>({...e,[n.substring(n.indexOf(".")+1)]:r}),{})});var pPr,QMt,UMt=v(()=>{p();iGe();FMt();sGe();jz();pPr=()=>({}),QMt=async(t={})=>aO(t.configFilepath??Upe()).then(Hz).then(LMt).catch(pPr)});var GMt,$Mt=v(()=>{p();GMt=(...t)=>{let e={};for(let n of t)for(let[r,i]of Object.entries(n))e[r]!==void 0?Object.assign(e[r],i):e[r]=i;return e}});var WMt,HMt=v(()=>{p();Gpe();$Mt();WMt=async t=>{let e=await pW(t);return GMt(e.configFile,e.credentialsFile)}});var qMt,jMt=v(()=>{p();nGe();jz();qMt={getFileRecord(){return qz},interceptFile(t,e){qz[t]=Promise.resolve(e)},getTokenRecord(){return Wz},interceptToken(t,e){Wz[t]=e}}});function $pe(t){try{let e=new Set(Array.from(t.match(/([A-Z_]){3,}/g)??[]));return e.delete("CONFIG"),e.delete("CONFIG_PREFIX_SEPARATOR"),e.delete("ENV"),[...e].join(", ")}catch{return t}}var cGe=v(()=>{p()});var VMt,YMt=v(()=>{p();Bpe();cGe();VMt=(t,e)=>async()=>{try{let n=t(process.env,e);if(n===void 0)throw new Error;return n}catch(n){throw new v1(n.message||`Not found in ENV: ${$pe(t.toString())}`,{logger:e?.logger})}}});var zMt,KMt=v(()=>{p();Bpe();eGe();Gpe();cGe();zMt=(t,{preferredFile:e="config",...n}={})=>async()=>{let r=Fpe(n),{configFile:i,credentialsFile:s}=await pW(n),o=s[r]||{},a=i[r]||{},c=e==="config"?{...o,...a}:{...a,...o};try{let l=t(c,e==="config"?i:s);if(l===void 0)throw new Error;return l}catch(u){throw new v1(u.message||`Not found in config files w/ profile [${r}]: ${$pe(t.toString())}`,{logger:n.logger})}}});var mPr,Wpe,lGe=v(()=>{p();KUe();mPr=t=>typeof t=="function",Wpe=t=>mPr(t)?async()=>await t():Ppe(t)});var cs,uGe=v(()=>{p();zUe();Mpe();YMt();KMt();lGe();cs=({environmentVariableSelector:t,configFileSelector:e,default:n},r={})=>{let{signingName:i,logger:s}=r;return uW(Dpe(VMt(t,{signingName:i,logger:s}),zMt(e,r),Wpe(n)))}});var Hpe,qpe,JMt,EC,XMt,ZMt=v(()=>{p();Ope();Lpe();Hpe="AWS_USE_DUALSTACK_ENDPOINT",qpe="use_dualstack_endpoint",JMt=!1,EC={environmentVariableSelector:t=>Np(t,Hpe,Sd.ENV),configFileSelector:t=>Np(t,qpe,Sd.CONFIG),default:!1},XMt={environmentVariableSelector:t=>Np(t,Hpe,Sd.ENV),configFileSelector:t=>Np(t,qpe,Sd.CONFIG),default:void 0}});var jpe,Vpe,eOt,bC,tOt,nOt=v(()=>{p();Ope();Lpe();jpe="AWS_USE_FIPS_ENDPOINT",Vpe="use_fips_endpoint",eOt=!1,bC={environmentVariableSelector:t=>Np(t,jpe,Sd.ENV),configFileSelector:t=>Np(t,Vpe,Sd.CONFIG),default:!1},tOt={environmentVariableSelector:t=>Np(t,jpe,Sd.ENV),configFileSelector:t=>Np(t,Vpe,Sd.CONFIG),default:void 0}});var rOt,iOt=v(()=>{p();Yi();rOt=t=>{let{tls:e,endpoint:n,urlParser:r,useDualstackEndpoint:i}=t;return Object.assign(t,{tls:e??!0,endpoint:qa(typeof n=="string"?r(n):n),isCustomEndpoint:!0,useDualstackEndpoint:qa(i??!1)})}});var sOt,oOt=v(()=>{p();sOt=async t=>{let{tls:e=!0}=t,n=await t.region();if(!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(n))throw new Error("Invalid region in client config");let i=await t.useDualstackEndpoint(),s=await t.useFipsEndpoint(),{hostname:o}=await t.regionInfoProvider(n,{useDualstackEndpoint:i,useFipsEndpoint:s})??{};if(!o)throw new Error("Cannot resolve hostname from client config");return t.urlParser(`${e?"https:":"http:"}//${o}`)}});var aOt,cOt=v(()=>{p();Yi();oOt();aOt=t=>{let e=qa(t.useDualstackEndpoint??!1),{endpoint:n,useFipsEndpoint:r,urlParser:i,tls:s}=t;return Object.assign(t,{tls:s??!0,endpoint:n?qa(typeof n=="string"?i(n):n):()=>sOt({...t,useDualstackEndpoint:e,useFipsEndpoint:r}),isCustomEndpoint:!!n,useDualstackEndpoint:e})}});var lOt,dGe,pGe,uOt,dOt,pOt,mOt,hOt,fOt,mGe=v(()=>{p();lOt="AWS_EXECUTION_ENV",dGe="AWS_REGION",pGe="AWS_DEFAULT_REGION",uOt="AWS_EC2_METADATA_DISABLED",dOt=["in-region","cross-region","mobile","standard","legacy"],pOt="/latest/meta-data/placement/region",mOt="/latest/api/token",hOt="x-aws-ec2-metadata-token",fOt="x-aws-ec2-metadata-token-ttl-seconds"});var gOt,hPr,EOt,Ype,AOt,fPr,yOt,hGe=v(()=>{p();mGe();gOt=1e3,hPr=6e4,EOt=0,Ype=async()=>{if(!process.env[uOt]&&!(Date.now(){EOt=Date.now()+hPr},fPr=()=>{let t=process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;if(t){let e=new URL(t);return{hostname:e.hostname.replace(/^\[(.+)]$/,"$1"),port:e.port?Number(e.port):void 0}}return process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE==="IPv6"?{hostname:"fd00:ec2::254"}:{hostname:"169.254.169.254"}},yOt=async t=>{let{request:e}=await import("node:http");return new Promise((n,r)=>{let i=e({hostname:t.hostname,port:t.port,path:t.path,method:t.method,headers:t.headers,timeout:gOt,signal:AbortSignal.timeout(gOt)});i.on("error",s=>{r(s),i.destroy()}),i.on("timeout",()=>{r(new Error("TimeoutError from instance metadata service")),i.destroy()}),i.on("response",s=>{let{statusCode:o=400}=s;if(o<200||o>=300){r(Object.assign(new Error("Error response received from instance metadata service"),{statusCode:o})),i.destroy();return}let a=[];s.on("data",c=>a.push(c)),s.on("end",()=>{n(Buffer.concat(a)),i.destroy()})}),i.end()})}});var mW,hW,Im,Tf,fGe=v(()=>{p();hGe();mW="AWS_REGION",hW="region",Im={environmentVariableSelector:t=>t[mW],configFileSelector:t=>t[hW],default:async()=>{let t=await Ype();if(t)return t;throw new Error("Region is missing")}},Tf={preferredFile:"credentials"}});var bOt,_Ot,xOt=v(()=>{p();ps();bOt=new Set,_Ot=(t,e=N_)=>{if(!bOt.has(t)&&!e(t))if(t==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${t}" is not a valid hostname component.`);else bOt.add(t)}});var zpe,gGe=v(()=>{p();zpe=t=>typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips"))});var SOt,COt=v(()=>{p();gGe();SOt=t=>zpe(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t});var hy,IOt=v(()=>{p();xOt();COt();gGe();hy=t=>{let{region:e,useFipsEndpoint:n}=t;if(!e)throw new Error("Region is missing");return Object.assign(t,{region:async()=>{let r=typeof e=="function"?await e():e,i=SOt(r);return _Ot(i),i},useFipsEndpoint:async()=>{let r=typeof e=="string"?e:await e();return zpe(r)?!0:typeof n!="function"?Promise.resolve(!!n):n()}})}});var AGe,wOt=v(()=>{p();AGe=(t=[],{useFipsEndpoint:e,useDualstackEndpoint:n})=>t.find(({tags:r})=>e===r.includes("fips")&&n===r.includes("dualstack"))?.hostname});var TOt,vOt=v(()=>{p();TOt=(t,{regionHostname:e,partitionHostname:n})=>e||(n?n.replace("{region}",t):void 0)});var ROt,kOt=v(()=>{p();ROt=(t,{partitionHash:e})=>Object.keys(e||{}).find(n=>e[n].regions.includes(t))??"aws"});var BOt,NOt=v(()=>{p();BOt=(t,{signingRegion:e,regionRegex:n,useFipsEndpoint:r})=>{if(e)return e;if(r){let i=n.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),s=t.match(i);if(s)return s[0].slice(1,-1)}}});var DOt,POt=v(()=>{p();wOt();vOt();kOt();NOt();DOt=(t,{useFipsEndpoint:e=!1,useDualstackEndpoint:n=!1,signingService:r,regionHash:i,partitionHash:s})=>{let o=ROt(t,{partitionHash:s}),a=t in i?t:s[o]?.endpoint??t,c={useFipsEndpoint:e,useDualstackEndpoint:n},u=AGe(i[a]?.variants,c),l=AGe(s[o]?.variants,c),d=TOt(a,{regionHostname:u,partitionHostname:l});if(d===void 0)throw new Error(`Endpoint resolution failed for: ${{resolvedRegion:a,useFipsEndpoint:e,useDualstackEndpoint:n}}`);let m=BOt(d,{signingRegion:i[a]?.signingRegion,regionRegex:s[o].regionRegex,useFipsEndpoint:e});return{partition:o,signingService:r,hostname:d,...m&&{signingRegion:m},...i[a]?.signingService&&{signingService:i[a].signingService}}}});var gPr,APr,MOt,OOt=v(()=>{p();gPr="AWS_DEFAULTS_MODE",APr="defaults_mode",MOt={environmentVariableSelector:t=>t[gPr],configFileSelector:t=>t[APr],default:"legacy"}});var _C,yPr,EPr,LOt=v(()=>{p();fGe();hGe();uGe();Mpe();mGe();OOt();_C=({region:t=cs(Im),defaultsMode:e=cs(MOt)}={})=>uW(async()=>{let n=typeof e=="function"?await e():e;switch(n?.toLowerCase()){case"auto":return yPr(t);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(n?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${dOt.join(", ")}, got ${n}`)}}),yPr=async t=>{if(t){let e=typeof t=="function"?await t():t,n=await EPr();return n?e===n?"in-region":"cross-region":"standard"}return"standard"},EPr=async()=>process.env[lOt]&&(process.env[dGe]||process.env[pGe])?process.env[dGe]??process.env[pGe]:Ype()});var fy={};br(fy,{CONFIG_PREFIX_SEPARATOR:()=>yC,CONFIG_USE_DUALSTACK_ENDPOINT:()=>qpe,CONFIG_USE_FIPS_ENDPOINT:()=>Vpe,CredentialsProviderError:()=>v1,DEFAULT_PROFILE:()=>ZUe,DEFAULT_USE_DUALSTACK_ENDPOINT:()=>JMt,DEFAULT_USE_FIPS_ENDPOINT:()=>eOt,ENV_PROFILE:()=>XUe,ENV_USE_DUALSTACK_ENDPOINT:()=>Hpe,ENV_USE_FIPS_ENDPOINT:()=>jpe,NODE_REGION_CONFIG_FILE_OPTIONS:()=>Tf,NODE_REGION_CONFIG_OPTIONS:()=>Im,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:()=>EC,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:()=>bC,ProviderError:()=>my,REGION_ENV_NAME:()=>mW,REGION_INI_NAME:()=>hW,SelectorType:()=>Sd,TokenProviderError:()=>Npe,booleanSelector:()=>Np,chain:()=>Dpe,externalDataInterceptor:()=>qMt,fromStatic:()=>Wpe,fromValue:()=>Ppe,getHomeDir:()=>AC,getProfileName:()=>Fpe,getRegionInfo:()=>DOt,getSSOTokenFilepath:()=>Qpe,getSSOTokenFromFile:()=>IMt,loadConfig:()=>cs,loadSharedConfigFiles:()=>pW,loadSsoSessionData:()=>QMt,memoize:()=>uW,nodeDualstackConfigSelectors:()=>XMt,nodeFipsConfigSelectors:()=>tOt,numberSelector:()=>yMt,parseKnownFiles:()=>WMt,readFile:()=>aO,resolveCustomEndpointsConfig:()=>rOt,resolveDefaultsModeConfig:()=>_C,resolveEndpointsConfig:()=>aOt,resolveRegionConfig:()=>hy});var Da=v(()=>{p();$z();Bpe();AMt();zUe();KUe();Mpe();Ope();EMt();Lpe();dW();eGe();tGe();nGe();wMt();Gpe();UMt();HMt();jMt();jz();uGe();lGe();ZMt();nOt();iOt();cOt();fGe();IOt();POt();LOt()});var FOt,QOt,UOt,GOt=v(()=>{p();FOt="AWS_ENDPOINT_URL",QOt="endpoint_url",UOt=t=>({environmentVariableSelector:e=>{let n=t.split(" ").map(s=>s.toUpperCase()),r=e[[FOt,...n].join("_")];if(r)return r;let i=e[FOt];if(i)return i},configFileSelector:(e,n)=>{if(e.services){let i=["services",e.services].join(".");if(!n||!n[i])throw new Error(`The services section "${e.services}" specified in the profile is not present in the shared configuration file.`);let s=n[i],o=t.split(" ").map(c=>c.toLowerCase()),a=s[[o.join("_"),QOt].join(".")];if(a)return a}let r=e[QOt];if(r)return r},default:void 0})});var bPr,_Pr,$Ot,WOt=v(()=>{p();Da();bPr="AWS_IGNORE_CONFIGURED_ENDPOINT_URLS",_Pr="ignore_configured_endpoint_urls",$Ot={environmentVariableSelector:t=>Np(t,bPr,Sd.ENV),configFileSelector:t=>Np(t,_Pr,Sd.CONFIG),default:!1}});var Vz,HOt=v(()=>{p();Da();GOt();WOt();Vz=async t=>{if(!await cs($Ot)())return cs(UOt(t??""))()}});var yGe,xPr,SPr,CPr,qOt,jOt,VOt=v(()=>{p();yGe=async t=>{let e=t?.Bucket||"";if(typeof t.Bucket=="string"&&(t.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),jOt(e)){if(t.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!qOt(e)||e.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(t.ForcePathStyle=!0);return t.DisableMultiRegionAccessPoints&&(t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0),t},xPr=/^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/,SPr=/(\d+\.){3}\d+/,CPr=/\.\./,qOt=t=>xPr.test(t)&&!SPr.test(t)&&!CPr.test(t),jOt=t=>{let[e,n,r,,,i]=t.split(":"),s=e==="arn"&&t.split(":").length>=6,o=!!(s&&n&&r&&i);if(s&&!o)throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);return o}});var YOt=v(()=>{p();VOt()});var zOt,KOt=v(()=>{p();zOt=(t,e,n,r=!1)=>{let i=async()=>{let s;return r?s=n.clientContextParams?.[t]??n[t]??n[e]:s=n[t]??n[e],typeof s=="function"?s():s};return t==="credentialScope"||e==="CredentialScope"?async()=>{let s=typeof n.credentials=="function"?await n.credentials():n.credentials;return s?.credentialScope??s?.CredentialScope}:t==="accountId"||e==="AccountId"?async()=>{let s=typeof n.credentials=="function"?await n.credentials():n.credentials;return s?.accountId??s?.AccountId}:t==="endpoint"||e==="endpoint"?async()=>{if(n.isCustomEndpoint===!1)return;let s=await i();if(s&&typeof s=="object"){if("url"in s)return s.url.href;if("hostname"in s){let{protocol:o,hostname:a,port:c,path:u}=s;return`${o}//${a}${c?":"+c:""}${u}`}}return s}:i}});var Kpe=v(()=>{p();ps()});function Jpe(t){return async(e,n,r,i)=>{if(!r.isCustomEndpoint&&!r.ignoreConfiguredEndpointUrls){let a;r.serviceConfiguredEndpoint?a=await r.serviceConfiguredEndpoint():a=await t(r.serviceId),a&&(r.endpoint=()=>Promise.resolve(uy(a)),r.isCustomEndpoint=!0,i?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${a}`))}let s=await Yz(e,n,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");let o=r.endpointProvider(s,i);if(r.isCustomEndpoint&&r.endpoint){let a=await r.endpoint();if(a?.headers){o.headers??={};for(let[c,u]of Object.entries(a.headers))o.headers[c]=Array.isArray(u)?u:[u]}}return o}}var Yz,Xpe=v(()=>{p();YOt();KOt();Kpe();Yz=async(t,e,n)=>{let r={},i=e?.getEndpointParameterInstructions?.()||{};for(let[s,o]of Object.entries(i))switch(o.type){case"staticContextParams":r[s]=o.value;break;case"contextParams":r[s]=t[o.name];break;case"clientContextParams":case"builtInParams":r[s]=await zOt(o.name,s,n,o.type!=="builtInParams")();break;case"operationContextParams":r[s]=o.get(t);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(o))}return Object.keys(i).length===0&&Object.assign(r,n),String(n.serviceId).toLowerCase()==="s3"&&await yGe(r),r}});function IPr(t,e,n){t.__smithy_context?t.__smithy_context.features||(t.__smithy_context.features={}):t.__smithy_context={features:{}},t.__smithy_context.features[e]=n}function Zpe(t){let e=Jpe(t);return({config:n,instructions:r})=>(i,s)=>async o=>{n.isCustomEndpoint&&IPr(s,"ENDPOINT_OVERRIDE","N");let a=await e(o.input,{getEndpointParameterInstructions(){return r}},{...n},s);s.endpointV2=a,s.authSchemes=a.properties?.authSchemes;let c=s.authSchemes?.[0];if(c){s.signing_region=c.signingRegion,s.signing_service=c.signingName;let l=wc(s)?.selectedHttpAuthScheme?.httpAuthOption;l&&(l.signingProperties=Object.assign(l.signingProperties||{},{signing_region:c.signingRegion,signingRegion:c.signingRegion,signing_service:c.signingName,signingName:c.signingName,signingRegionSet:c.signingRegionSet},c.properties))}return i({...o})}}var EGe=v(()=>{p();ps();Xpe()});function JOt(t){let e=Zpe(t);return(n,r)=>({applyToStack:i=>{i.addRelativeTo(e({config:n,instructions:r}),bGe)}})}var wPr,bGe,_Ge=v(()=>{p();EGe();wPr={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0},bGe={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:wPr.name}});function XOt(t){return e=>{let n=e.tls??!0,{endpoint:r,useDualstackEndpoint:i,useFipsEndpoint:s}=e,o=r!=null?async()=>uy(await qa(r)()):void 0,c=Object.assign(e,{endpoint:o,tls:n,isCustomEndpoint:!!r,useDualstackEndpoint:qa(i??!1),useFipsEndpoint:qa(s??!1),ignoreConfiguredEndpointUrls:!!e.ignoreConfiguredEndpointUrls}),u;return c.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=t(e.serviceId)),u),c}}var ZOt=v(()=>{p();ps();Kpe()});var m0,eLt=v(()=>{p();m0=class t{nodes;root;conditions;results;constructor(e,n,r,i){this.nodes=e,this.root=n,this.conditions=r,this.results=i}static from(e,n,r,i){return new t(e,n,r,i)}}});var h0,tLt=v(()=>{p();h0=class{capacity;data=new Map;parameters=[];constructor({size:e,params:n}){this.capacity=e??50,n&&(this.parameters=n)}get(e,n){let r=this.hash(e);if(r===!1)return n();if(!this.data.has(r)){if(this.data.size>this.capacity+10){let i=this.data.keys(),s=0;for(;;){let{value:o,done:a}=i.next();if(this.data.delete(o),a||++s>10)break}}this.data.set(r,n())}return this.data.get(r)}size(){return this.data.size}hash(e){let n="",{parameters:r}=this;if(r.length===0)return!1;for(let i of r){let s=String(e[i]??"");if(s.includes("|;"))return!1;n+=s+"|;"}return n}}});var Wo,nLt=v(()=>{p();Wo=class extends Error{constructor(e){super(e),this.name="EndpointError"}}});var gy=v(()=>{p();nLt()});var xC,rLt=v(()=>{p();xC="endpoints"});function Ay(t){return typeof t!="object"||t==null?t:"ref"in t?`$${Ay(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(Ay).join(", ")})`:JSON.stringify(t,null,2)}var iLt=v(()=>{p()});var zz=v(()=>{p();rLt();iLt()});var Vg,xGe=v(()=>{p();Vg={}});var SGe,sLt=v(()=>{p();SGe=(t,e)=>t===e});function CGe(...t){for(let e of t)if(e!=null)return e}var oLt=v(()=>{p()});var aLt,cLt=v(()=>{p();gy();aLt=t=>{let e=t.split("."),n=[];for(let r of e){let i=r.indexOf("[");if(i!==-1){if(r.indexOf("]")!==r.length-1)throw new Wo(`Path: '${t}' does not end with ']'`);let s=r.slice(i+1,-1);if(Number.isNaN(parseInt(s)))throw new Wo(`Invalid array index: '${s}' in path: '${t}'`);i!==0&&n.push(r.slice(0,i)),n.push(s)}else n.push(r)}return n}});var Kz,lLt=v(()=>{p();gy();cLt();Kz=(t,e)=>aLt(e).reduce((n,r)=>{if(typeof n!="object")throw new Wo(`Index '${r}' in '${e}' not found in '${JSON.stringify(t)}'`);if(Array.isArray(n)){let i=parseInt(r);return n[i<0?n.length+i:i]}return n[r]},t)});var IGe,uLt=v(()=>{p();IGe=t=>t!=null});function wGe(t,e,n){return t?e:n}var dLt=v(()=>{p()});var TGe,pLt=v(()=>{p();TGe=t=>!t});var TPr,$T,vGe=v(()=>{p();TPr=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),$T=t=>TPr.test(t)||t.startsWith("[")&&t.endsWith("]")});var eme,RGe,kGe,mLt=v(()=>{p();eme=Ot(aC());vGe();RGe={[eme.EndpointURLScheme.HTTP]:80,[eme.EndpointURLScheme.HTTPS]:443},kGe=t=>{let e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){let{hostname:m,port:h,protocol:f="",path:g="",query:A={}}=t,y=new URL(`${f}//${m}${h?`:${h}`:""}${g}`);return y.search=Object.entries(A).map(([E,_])=>`${E}=${_}`).join("&"),y}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;let n=e.href,{host:r,hostname:i,pathname:s,protocol:o,search:a}=e;if(a)return null;let c=o.slice(0,-1);if(!Object.values(eme.EndpointURLScheme).includes(c))return null;let u=$T(i),l=n.includes(`${r}:${RGe[c]}`)||typeof t=="string"&&t.includes(`${r}:${RGe[c]}`),d=`${r}${l?`:${RGe[c]}`:""}`;return{scheme:c,authority:d,path:s,normalizedPath:s.endsWith("/")?s:`${s}/`,isIp:u}}});function BGe(t,e,n){if(n===1)return[t];if(t==="")return[""];let r=t.split(e);return n===0?r:r.slice(0,n-1).concat(r.slice(1).join(e))}var hLt=v(()=>{p()});var NGe,fLt=v(()=>{p();NGe=(t,e)=>t===e});var DGe,gLt=v(()=>{p();DGe=(t,e,n,r)=>t==null||e>=n||t.length{p();PGe=t=>encodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)});var MGe=v(()=>{p();sLt();oLt();lLt();uLt();ps();dLt();pLt();mLt();hLt();fLt();gLt();ALt()});var yLt,ELt=v(()=>{p();MGe();yLt={booleanEquals:SGe,coalesce:CGe,getAttr:Kz,isSet:IGe,isValidHostLabel:N_,ite:wGe,not:TGe,parseURL:kGe,split:BGe,stringEquals:NGe,substring:DGe,uriEncode:PGe}});var tme,OGe=v(()=>{p();MGe();tme=(t,e)=>{let n=[],{referenceRecord:r,endpointParams:i}=e,s=0;for(;s{p();bLt=({ref:t},e)=>e.referenceRecord[t]??e.endpointParams[t]});var WT,nme,xLt,fW=v(()=>{p();gy();xGe();ELt();OGe();_Lt();WT=(t,e,n)=>{if(typeof t=="string")return tme(t,n);if(t.fn)return xLt.callFunction(t,n);if(t.ref)return bLt(t,n);throw new Wo(`'${e}': ${String(t)} is not a string, function or reference.`)},nme=({fn:t,argv:e},n)=>{let r=Array(e.length);for(let o=0;o{p();fW()});var rme,LGe=v(()=>{p();zz();gy();SLt();rme=(t,e)=>{let{assign:n}=t;if(n&&n in e.referenceRecord)throw new Wo(`'${n}' is already defined in Reference Record.`);let r=nme(t,e);e.logger?.debug?.(`${xC} evaluateCondition: ${Ay(t)} = ${Ay(r)}`);let i=r===""?!0:!!r;return n!=null?{result:i,toAssign:{name:n,value:r}}:{result:i}}});var ime,FGe=v(()=>{p();gy();fW();ime=(t,e)=>Object.entries(t??{}).reduce((n,[r,i])=>(n[r]=i.map(s=>{let o=WT(s,"Header value entry",e);if(typeof o!="string")throw new Wo(`Header '${r}' value '${o}' is not a string`);return o}),n),{})});var Jz,CLt,ILt,QGe=v(()=>{p();gy();OGe();Jz=(t,e)=>Object.entries(t).reduce((n,[r,i])=>(n[r]=ILt.getEndpointProperty(i,e),n),{}),CLt=(t,e)=>{if(Array.isArray(t))return t.map(n=>CLt(n,e));switch(typeof t){case"string":return tme(t,e);case"object":if(t===null)throw new Wo(`Unexpected endpoint property: ${t}`);return ILt.getEndpointProperties(t,e);case"boolean":return t;default:throw new Wo(`Unexpected endpoint property type: ${typeof t}`)}},ILt={getEndpointProperty:CLt,getEndpointProperties:Jz}});var sme,UGe=v(()=>{p();gy();fW();sme=(t,e)=>{let n=WT(t,"Endpoint URL",e);if(typeof n=="string")try{return new URL(n)}catch(r){throw console.error(`Failed to construct URL with ${n}`,r),r}throw new Wo(`Endpoint URL must be a string, got ${typeof n}`)}});var GGe,SC,wLt=v(()=>{p();gy();LGe();fW();FGe();QGe();UGe();GGe=1e8,SC=(t,e)=>{let{nodes:n,root:r,results:i,conditions:s}=t,o=r,a={},c={referenceRecord:a,endpointParams:e.endpointParams,logger:e.logger};for(;o!==1&&o!==-1&&o=0===A.result?d:m}if(o>=GGe){let u=i[o-GGe];if(u[0]===-1){let[,h]=u;throw new Wo(WT(h,"Error",c))}let[l,d,m]=u;return{url:sme(l,c),properties:Jz(d,c),headers:ime(m??{},c)}}throw new Wo("No matching endpoint.")}});var gW,ome=v(()=>{p();zz();LGe();gW=(t=[],e)=>{let n={},r={...e,referenceRecord:{...e.referenceRecord}},i=!1;for(let s of t){let{result:o,toAssign:a}=rme(s,r);if(!o)return{result:o};a&&(i=!0,n[a.name]=a.value,r.referenceRecord[a.name]=a.value,e.logger?.debug?.(`${xC} assign: ${a.name} := ${Ay(a.value)}`))}return i?{result:!0,referenceRecord:n}:{result:!0}}});var TLt,vLt=v(()=>{p();zz();ome();FGe();QGe();UGe();TLt=(t,e)=>{let{conditions:n,endpoint:r}=t,{result:i,referenceRecord:s}=gW(n,e);if(!i)return;let o=s?{...e,referenceRecord:{...e.referenceRecord,...s}}:e,{url:a,properties:c,headers:u}=r;e.logger?.debug?.(`${xC} Resolving endpoint from template: ${Ay(r)}`);let l={url:sme(a,o)};return u!=null&&(l.headers=ime(u,o)),c!=null&&(l.properties=Jz(c,o)),l}});var RLt,kLt=v(()=>{p();gy();ome();fW();RLt=(t,e)=>{let{conditions:n,error:r}=t,{result:i,referenceRecord:s}=gW(n,e);if(!i)return;let o=s?{...e,referenceRecord:{...e.referenceRecord,...s}}:e;throw new Wo(WT(r,"Error",o))}});var ame,BLt,$Ge,NLt=v(()=>{p();gy();ome();vLt();kLt();ame=(t,e)=>{for(let n of t)if(n.type==="endpoint"){let r=TLt(n,e);if(r)return r}else if(n.type==="error")RLt(n,e);else if(n.type==="tree"){let r=$Ge.evaluateTreeRule(n,e);if(r)return r}else throw new Wo(`Unknown endpoint rule: ${n}`);throw new Wo("Rules evaluation failed")},BLt=(t,e)=>{let{conditions:n,rules:r}=t,{result:i,referenceRecord:s}=gW(n,e);if(!i)return;let o=s?{...e,referenceRecord:{...e.referenceRecord,...s}}:e;return $Ge.evaluateRules(r,o)},$Ge={evaluateRules:ame,evaluateTreeRule:BLt}});var DLt=v(()=>{p();NLt()});var Xz,PLt=v(()=>{p();ps();zz();gy();DLt();Xz=(t,e)=>{let{endpointParams:n,logger:r}=e,{parameters:i,rules:s}=t;e.logger?.debug?.(`${xC} Initial EndpointParams: ${Ay(n)}`);for(let a in i){if(!Ti(i,a))continue;let c=i[a],u=n[a];if(u==null&&c.default!=null){n[a]=c.default;continue}if(c.required&&u==null)throw new Wo(`Missing required parameter: '${a}'`)}let o=ame(s,{endpointParams:n,logger:r,referenceRecord:{}});return e.logger?.debug?.(`${xC} Resolved endpoint: ${Ay(o)}`),o}});var MLt,OLt=v(()=>{p();MLt=t=>{let{endpoint:e}=t;return e===void 0&&(t.endpoint=async()=>{throw new Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.")}),t}});var LLt={};br(LLt,{BinaryDecisionDiagram:()=>m0,EndpointCache:()=>h0,EndpointError:()=>Wo,customEndpointFunctions:()=>Vg,decideEndpoint:()=>SC,endpointMiddleware:()=>RPr,endpointMiddlewareOptions:()=>bGe,getEndpointFromInstructions:()=>vPr,getEndpointPlugin:()=>qT,isIpAddress:()=>$T,isValidHostLabel:()=>N_,middlewareEndpointToEndpointV1:()=>uy,resolveEndpoint:()=>Xz,resolveEndpointConfig:()=>HT,resolveEndpointRequiredConfig:()=>MLt,resolveParams:()=>Yz,toEndpointV1:()=>uy});var vPr,HT,RPr,qT,Xc=v(()=>{p();HOt();Xpe();EGe();_Ge();ZOt();ps();eLt();tLt();wLt();vGe();ps();xGe();PLt();gy();Xpe();Kpe();_Ge();OLt();vPr=Jpe(Vz),HT=XOt(Vz),RPr=Zpe(Vz),qT=JOt(Vz)});var cme,WGe=v(()=>{p();Xc();cme=(t,e)=>(n,r)=>async i=>{let s=t,o=r.endpointV2?async()=>uy(r.endpointV2):s.endpoint;if(!o)throw new Error("No valid endpoint provider available.");let a=await e(i.input,{...t,endpoint:o});return n({...i,request:a})}});function FLt(t,e,n){return{applyToStack:r=>{r.add(kpe(t,n),HGe),r.add(cme(t,e),qGe)}}}var HGe,qGe,QLt=v(()=>{p();YUe();WGe();HGe={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},qGe={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0}});function ULt(t,e){return Buffer.isBuffer(t)?t:typeof t=="string"?S1(t,e):ArrayBuffer.isView(t)?M_(t.buffer,t.byteOffset,t.byteLength):M_(t)}var ume,lme,GLt=v(()=>{p();ume=require("node:crypto");C1();jUe();lme=class{algorithmIdentifier;secret;hash;constructor(e,n){this.algorithmIdentifier=e,this.secret=n,this.reset()}update(e,n){this.hash.update(wf(ULt(e,n)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?(0,ume.createHmac)(this.algorithmIdentifier,ULt(this.secret)):(0,ume.createHash)(this.algorithmIdentifier)}}});var $Lt,AW,jGe=v(()=>{p();$Lt=require("node:stream");PUe();AW=class extends $Lt.Readable{expectedChecksum;checksumSourceLocation;checksum;source;base64Encoder;constructor({expectedChecksum:e,checksum:n,source:r,checksumSourceLocation:i,base64Encoder:s}){if(super(),typeof r.pipe!="function")throw new Error(`@smithy/util-stream: unsupported source type ${r?.constructor?.name??r} in ChecksumStream.`);this.source=r,this.base64Encoder=s??vc,this.expectedChecksum=e,this.checksum=n,this.checksumSourceLocation=i,this.source.on("data",this.onSourceData),this.source.on("end",this.onSourceEnd),this.source.on("error",this.onSourceError),this.source.on("close",this.onSourceClose),this.source.pause()}onSourceData=e=>{if(!this.destroyed){try{this.checksum.update(e)}catch(n){this.destroy(n);return}this.push(e)||this.source.pause()}};onSourceEnd=async()=>{if(!this.destroyed){try{let e=await this.checksum.digest(),n=this.base64Encoder(e);if(this.expectedChecksum!==n){this.destroy(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${n}" in response header "${this.checksumSourceLocation}".`));return}}catch(e){this.destroy(e);return}this.push(null)}};onSourceError=e=>{this.destroy(e)};onSourceClose=()=>{!this.destroyed&&!this.source.readableEnded&&this.destroy(new Error("Connection lost or stream closed before all data was received."))};_read(e){this.source.resume()}_destroy(e,n){this.source?.removeListener("data",this.onSourceData),this.source?.removeListener("end",this.onSourceEnd),this.source?.removeListener("error",this.onSourceError),this.source?.removeListener("close",this.onSourceClose),this.source?.destroy(),n(e)}}});var Xd,R1,O_=v(()=>{p();Xd=t=>typeof ReadableStream=="function"&&(t?.constructor?.name===ReadableStream.name||t instanceof ReadableStream),R1=t=>typeof Blob=="function"&&(t?.constructor?.name===Blob.name||t instanceof Blob)});var WLt,HLt=v(()=>{p();WLt=t=>new TextEncoder().encode(t)});var qLt,I3s,jLt,dme,VGe,VLt,YLt=v(()=>{p();qLt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I3s=Object.entries(qLt).reduce((t,[e,n])=>(t[n]=Number(e),t),{}),jLt=qLt.split(""),dme=6,VGe=8,VLt=63});function pme(t){let e;typeof t=="string"?e=WLt(t):e=t;let n=typeof e=="object"&&typeof e.length=="number",r=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!n&&!r)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let s=0;s>l]}i+="==".slice(0,4-c)}return i}var YGe=v(()=>{p();HLt();YLt()});var kPr,mme,zLt=v(()=>{p();kPr=typeof ReadableStream=="function"?ReadableStream:function(){},mme=class extends kPr{}});var KLt,JLt=v(()=>{p();YGe();O_();zLt();KLt=({expectedChecksum:t,checksum:e,source:n,checksumSourceLocation:r,base64Encoder:i})=>{if(!Xd(n))throw new Error(`@smithy/util-stream: unsupported source type ${n?.constructor?.name??n} in ChecksumStream.`);let s=i??pme;if(typeof TransformStream!="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let o=new TransformStream({start(){},async transform(c,u){e.update(c),u.enqueue(c)},async flush(c){let u=await e.digest(),l=s(u);if(t!==l){let d=new Error(`Checksum mismatch: expected "${t}" but received "${l}" in response header "${r}".`);c.error(d)}else c.terminate()}});n.pipeThrough(o);let a=o.readable;return Object.setPrototypeOf(a,mme.prototype),a}});function XLt(t){return typeof ReadableStream=="function"&&Xd(t.source)?KLt(t):new AW(t)}var ZLt=v(()=>{p();O_();jGe();JLt()});var cO,zGe=v(()=>{p();cO=class{allocByteArray;byteLength=0;byteArrays=[];constructor(e){this.allocByteArray=e}push(e){this.byteArrays.push(e),this.byteLength+=e.byteLength}flush(){if(this.byteArrays.length===1){let r=this.byteArrays[0];return this.reset(),r}let e=this.allocByteArray(this.byteLength),n=0;for(let r=0;rnew Uint8Array(u))],a=-1,c=async u=>{let{value:l,done:d}=await r.read(),m=l;if(d){if(a!==-1){let h=lO(o,a);jT(h)>0&&u.enqueue(h)}u.close()}else{let h=JGe(m,!1);if(a!==h&&(a>=0&&u.enqueue(lO(o,a)),a=h),a===-1){u.enqueue(m);return}let f=jT(m);s+=f;let g=jT(o[a]);if(f>=e&&g===0)u.enqueue(m);else{let A=KGe(o,a,m);!i&&s>e*2&&(i=!0,n?.warn(`@smithy/util-stream - stream chunk size ${f} is below threshold of ${e}, automatically buffering.`)),A>=e?u.enqueue(lO(o,a)):await c(u)}}};return new ReadableStream({pull:c})}function KGe(t,e,n){switch(e){case 0:return t[0]+=n,jT(t[0]);case 1:case 2:return t[e].push(n),jT(t[e])}}function lO(t,e){switch(e){case 0:let n=t[0];return t[0]="",n;case 1:case 2:return t[e].flush()}throw new Error(`@smithy/util-stream - invalid index ${e} given to flush()`)}function jT(t){return t?.byteLength??t?.length??0}function JGe(t,e=!0){return e&&typeof Buffer<"u"&&t instanceof Buffer?2:t instanceof Uint8Array?1:typeof t=="string"?0:-1}var t2t=v(()=>{p();zGe()});function r2t(t,e,n){if(Xd(t))return e2t(t,e,n);let r=new n2t.Readable({read(){}}),i=!1,s=0,o=["",new cO(c=>new Uint8Array(c)),new cO(c=>Buffer.from(new Uint8Array(c)))],a=-1;return t.on("data",c=>{let u=JGe(c,!0);if(a!==u&&(a>=0&&r.push(lO(o,a)),a=u),a===-1){r.push(c);return}let l=jT(c);s+=l;let d=jT(o[a]);if(l>=e&&d===0)r.push(c);else{let m=KGe(o,a,c);!i&&s>e*2&&(i=!0,n?.warn(`@smithy/util-stream - stream chunk size ${l} is below threshold of ${e}, automatically buffering.`)),m>=e&&r.push(lO(o,a))}}),t.on("end",()=>{if(a!==-1){let c=lO(o,a);jT(c)>0&&r.push(c)}r.push(null)}),r}var n2t,i2t=v(()=>{p();n2t=require("node:stream");zGe();t2t();O_()});var s2t,o2t=v(()=>{p();s2t=(t,e)=>{let{base64Encoder:n,bodyLengthChecker:r,checksumAlgorithmFn:i,checksumLocationName:s,streamHasher:o}=e,a=n!==void 0&&r!==void 0&&i!==void 0&&s!==void 0&&o!==void 0,c=a?o(i,t):void 0;Promise.resolve(c).catch(()=>{});let u=t.getReader();return new ReadableStream({async pull(l){let{value:d,done:m}=await u.read();if(m){if(l.enqueue(`0\r +`),a){let h=n(await c);l.enqueue(`${s}:${h}\r `),l.enqueue(`\r `)}l.close()}else l.enqueue(`${(r(d)||0).toString(16)}\r ${d}\r -`)}})}});function dIt(t,e){let n=t,r=t;if(ad(r))return cIt(r,e);let{base64Encoder:s,bodyLengthChecker:i,checksumAlgorithmFn:o,checksumLocationName:a,streamHasher:c}=e,u=s!==void 0&&o!==void 0&&a!==void 0&&c!==void 0,l=u?c(o,n):void 0,d=new uIt.Readable({read:()=>{}});return n.on("data",h=>{let m=i(h)||0;m!==0&&(d.push(`${m.toString(16)}\r -`),d.push(h),d.push(`\r -`))}),n.on("end",async()=>{if(d.push(`0\r -`),u){let h=s(await l);d.push(`${a}:${h}\r +`)}})}});function c2t(t,e){let n=t,r=t;if(Xd(r))return s2t(r,e);let{base64Encoder:i,bodyLengthChecker:s,checksumAlgorithmFn:o,checksumLocationName:a,streamHasher:c}=e,u=i!==void 0&&o!==void 0&&a!==void 0&&c!==void 0,l=u?c(o,n):void 0;Promise.resolve(l).catch(()=>{});let d=new a2t.Readable({read(){n.resume()}});return n.on("data",m=>{let h=s(m)||0;h!==0&&(d.push(`${h.toString(16)}\r +`),d.push(m),d.push(`\r +`)||n.pause())}),n.on("error",m=>{d.destroy(m)}),n.pause(),n.on("end",async()=>{try{if(d.push(`0\r +`),u){let m=i(await l);d.push(`${a}:${m}\r `),d.push(`\r -`)}d.push(null)}),d}var uIt,pIt=V(()=>{p();uIt=require("node:stream");lIt();Kb()});async function hIt(t,e){let n=0,r=[],s=t.getReader(),i=!1;for(;!i;){let{done:c,value:u}=await s.read();if(u&&(r.push(u),n+=u?.byteLength??0),n>=e)break;i=c}s.releaseLock();let o=new Uint8Array(Math.min(e,n)),a=0;for(let c of r){if(c.byteLength>o.byteLength-a){o.set(c.subarray(0,o.byteLength-a),a);break}else o.set(c,a);a+=c.length}return o}var mIt=V(()=>{p()});var fIt,gIt,DPe,AIt=V(()=>{p();fIt=require("node:stream");GY();mIt();Kb();gIt=(t,e)=>ad(t)?hIt(t,e):new Promise((n,r)=>{let s=new DPe;s.limit=e,t.pipe(s),t.on("error",i=>{s.end(),r(i)}),s.on("error",r),s.on("finish",function(){let i=Vv(this.buffers);n(i)})}),DPe=class extends fIt.Writable{buffers=[];limit=1/0;bytesBuffered=0;_write(e,n,r){if(this.buffers.push(e),this.bytesBuffered+=e.byteLength??0,this.bytesBuffered>=this.limit){let s=this.bytesBuffered-this.limit,i=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=i.subarray(0,i.byteLength-s),this.emit("finish")}r()}}});var yIt,EIt=V(()=>{p();yIt=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)}});async function BPe(t){return t.arrayBuffer().then(e=>new Uint8Array(e))}async function PPe(t){let e=[],n=t.getReader(),r=0;for(;;){let{done:s,value:i}=await n.read();if(i&&(e.push(i),r+=i.length),s)break}return Vv(e,r)}var bIt,OPe=V(()=>{p();GY();Kb();bIt=async t=>Yv(t)?BPe(t):PPe(t)});var _It,CIt,SIt,IIt=V(()=>{p();vPe();xBe();EIt();OPe();Kb();_It="The stream has already been transformed.",CIt=t=>{if(!SIt(t)&&!ad(t)){let s=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${s}`)}let e=!1,n=async()=>{if(e)throw new Error(_It);return e=!0,await bIt(t)},r=s=>{if(typeof s.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled. -If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return s.stream()};return Object.assign(t,{transformToByteArray:n,transformToString:async s=>{let i=await n();if(s==="base64")return Iae(i);if(s==="hex")return $y(i);if(s===void 0||s==="utf8"||s==="utf-8")return yIt(i);if(typeof TextDecoder=="function")return new TextDecoder(s).decode(i);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(e)throw new Error(_It);if(e=!0,SIt(t))return r(t);if(ad(t))return t;throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},SIt=t=>typeof Blob=="function"&&t instanceof Blob});var xIt,wae,MPe,LPe=V(()=>{p();xIt=require("node:stream");GY();OPe();Kb();wae=t=>Yv(t)?BPe(t):ad(t)?PPe(t):new Promise((e,n)=>{let r=new MPe,s=t;s.pipe(r),s.on("error",i=>{r.end(),n(i)}),r.on("error",n),r.on("finish",function(){let i=Vv(this.bufferedBytes);e(i)})}),MPe=class extends xIt.Writable{bufferedBytes=[];_write(e,n,r){this.bufferedBytes.push(e),r()}}});var Tae,wIt,vae,TIt=V(()=>{p();Tae=require("node:stream");Gv();IIt();LPe();wIt="The stream has already been transformed.",vae=t=>{if(!(t instanceof Tae.Readable))try{return CIt(t)}catch{let s=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${s}`)}let e=!1,n=async()=>{if(e)throw new Error(wIt);return e=!0,await wae(t)};return Object.assign(t,{transformToByteArray:n,transformToString:async r=>{let s=await n();return r===void 0||Buffer.isEncoding(r)?Yb(s.buffer,s.byteOffset,s.byteLength).toString(r):new TextDecoder(r).decode(s)},transformToWebStream:()=>{if(e)throw new Error(wIt);if(t.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Tae.Readable.toWeb!="function")throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return e=!0,Tae.Readable.toWeb(t)}})}});async function vIt(t){return typeof t.stream=="function"&&(t=t.stream()),t.tee()}var RIt=V(()=>{p()});async function kIt(t){if(ad(t)||Yv(t))return vIt(t);let e=new FPe.PassThrough,n=new FPe.PassThrough;return t.pipe(e),t.pipe(n),[e,n]}var FPe,NIt=V(()=>{p();FPe=require("node:stream");RIt();Kb()});var xx={};Ir(xx,{ChecksumStream:()=>jU,Hash:()=>_ae,LazyJsonString:()=>vu,NumericValue:()=>zi,Uint8ArrayBlobAdapter:()=>dB,_parseEpochTimestamp:()=>Hv,_parseRfc3339DateTimeWithOffset:()=>Moe,_parseRfc7231DateTime:()=>Loe,calculateBodyLength:()=>ES,concatBytes:()=>Vv,copyDocumentWithTransform:()=>Y_t,createBufferedReadable:()=>oIt,createChecksumStream:()=>tIt,dateToUtcString:()=>Hg,deserializerMiddleware:()=>$oe,deserializerMiddlewareOption:()=>IPe,expectBoolean:()=>J_t,expectByte:()=>Roe,expectFloat32:()=>QY,expectInt:()=>X_t,expectInt32:()=>Toe,expectLong:()=>DU,expectNonNull:()=>Z_t,expectNumber:()=>NU,expectObject:()=>gBe,expectShort:()=>voe,expectString:()=>e0t,expectUnion:()=>Noe,fromArrayBuffer:()=>Yb,fromBase64:()=>wl,fromHex:()=>Uoe,fromString:()=>$v,fromUtf8:()=>od,generateIdempotencyToken:()=>zg,getAwsChunkedEncodingStream:()=>dIt,getSerdePlugin:()=>$Ct,handleFloat:()=>n0t,hasOwn:()=>Cs,headStream:()=>gIt,isArrayBuffer:()=>Ioe,isBlob:()=>Yv,isReadableStream:()=>ad,limitedParseDouble:()=>Boe,limitedParseFloat:()=>r0t,limitedParseFloat32:()=>s0t,logger:()=>BU,nv:()=>Qoe,parseBoolean:()=>z_t,parseEpochTimestamp:()=>LU,parseRfc3339DateTime:()=>c0t,parseRfc3339DateTimeWithOffset:()=>MU,parseRfc7231DateTime:()=>qv,quoteHeader:()=>Ooe,sdkStreamMixin:()=>vae,serializerMiddleware:()=>bae,serializerMiddlewareOption:()=>xPe,splitEvery:()=>Foe,splitHeader:()=>FU,splitStream:()=>kIt,streamCollector:()=>wae,strictParseByte:()=>Poe,strictParseDouble:()=>UY,strictParseFloat:()=>t0t,strictParseFloat32:()=>Doe,strictParseInt:()=>o0t,strictParseInt32:()=>a0t,strictParseLong:()=>ABe,strictParseShort:()=>Wv,toBase64:()=>ja,toHex:()=>$y,toUint8Array:()=>aB,toUtf8:()=>Jc,v4:()=>YU});var DIt,dB,Gsr,YU,zg,js=V(()=>{p();DIt=require("node:crypto");G_t();mBe();q_t();xoe();H_t();j_t();K_t();l0t();u0t();yBe();d0t();m0t();f0t();g0t();y0t();xBe();b0t();wBe();GY();Gv();hBe();vBe();GCt();CPe();qCt();wPe();nIt();aIt();pIt();AIt();TIt();NIt();Kb();LPe();si();dB=class extends W_t(Jc,od,ja,wl){},Gsr=DIt.getRandomValues,YU=V_t(Gsr),zg=YU});var wp,Rae=V(()=>{p();js();wp=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return dB.mutate(t);if(!t)return dB.mutate(new Uint8Array);let n=e.streamCollector(t);return dB.mutate(await n)}});function zb(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}var kae=V(()=>{p()});var Ld,KU=V(()=>{p();Ld=class{serdeContext;setSerdeContext(e){this.serdeContext=e}}});var BIt,QPe,Nae,PIt=V(()=>{p();BIt=new Uint32Array(256);for(let t=0;t<256;++t){let e=t;for(let n=0;n<8;++n)e=e&1?3988292384^e>>>1:e>>>1;BIt[t]=e>>>0}QPe=4294967295,Nae=class{digestLength=4;checksum=QPe;update(e){for(let n=0;n>>8^BIt[(this.checksum^e[n])&255]}digestSync(){return(this.checksum^QPe)>>>0}async digest(){let e=this.digestSync(),n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!1),n}reset(){this.checksum=QPe}}});function Wsr(t){return class{digestLength=4;value=0;update(n){this.value=t(n,this.value)}digestSync(){return this.value>>>0}async digest(){let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,this.digestSync(),!1),n}reset(){this.value=0}}}var UPe,OIt,zU,MIt=V(()=>{p();UPe=Gt(require("node:zlib"));PIt();OIt=typeof UPe.crc32=="function"?UPe.crc32:void 0,zU=OIt?Wsr(OIt):Nae});var Tp,LIt,qsr,Dae,FIt,Hsr,QIt=V(()=>{p();js();Tp=64,LIt=32,qsr=2**53-1,Dae=class t{digestLength=LIt;state=Int32Array.from(FIt);w;buffer=new Uint8Array(64);bufferLength=0;bytesHashed=0;finished=!1;inner;outer;constructor(e){if(e){let n=t.normalizeKey(e);this.inner=new t,this.outer=new t;let{inner:r,outer:s}=this,i=new Uint8Array(Tp*2);for(let o=0;oqsr)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;s>0;)this.buffer[this.bufferLength++]=n[r++],s--,this.bufferLength===Tp&&(this.hashBuffer(),this.bufferLength=0)}async digest(){let{inner:e,outer:n}=this;if(e&&n){if(this.finished)throw new Error("Attempted to digest an already finished HMAC.");this.finished=!0;let r=e.digestSync();return n.update(r),n.digestSync()}return this.digestSync()}reset(){this.state=Int32Array.from(FIt),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0}digestSync(){let e=this.state.slice(),n=this.buffer.slice(),r=this.bufferLength,s=this.bytesHashed*8,i=new DataView(n.buffer,n.byteOffset,n.byteLength);if(i.setUint8(r++,128),(r-1)%Tp>=Tp-8){for(let a=r;a>>24&255,o[a*4+1]=e[a]>>>16&255,o[a*4+2]=e[a]>>>8&255,o[a*4+3]=e[a]>>>0&255;return o}static normalizeKey(e){let n=aB(e);if(n.byteLength>Tp){let r=new t;r.update(n);let s=r.digestSync(),i=new Uint8Array(Tp);return i.set(s),i}if(n.byteLength>>17|g<<15)^(g>>>19|g<<13)^g>>>10;g=r[h-15];let y=(g>>>7|g<<25)^(g>>>18|g<<14)^g>>>3;r[h]=(A+r[h-7]|0)+(y+r[h-16]|0)}let m=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&u^~c&l)|0)+(d+(Hsr[h]+r[h]|0)|0)|0,f=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&i^s&o^i&o)|0;d=l,l=u,u=c,c=a+m|0,a=o,o=i,i=s,s=m+f|0}e[0]+=s,e[1]+=i,e[2]+=o,e[3]+=a,e[4]+=c,e[5]+=u,e[6]+=l,e[7]+=d}},FIt=new Int32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Hsr=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])});function jsr(){return class{digestLength=32;secret;hash;isHmac;finished=!1;constructor(e){this.secret=e,this.isHmac=!!e,this.hash=this.createHash()}update(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");this.hash.update(e)}async digest(){let e;return this.isHmac?(this.finished=!0,e=this.hash.digest()):e=this.hash.copy().digest(),new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}reset(){this.hash=this.createHash(),this.finished=!1}createHash(){return this.secret?(0,e6.createHmac)("sha256",Ysr(this.secret)):(0,e6.createHash)("sha256")}}}function Ysr(t){return typeof t=="string"?t:ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):Buffer.from(t)}var e6,Vsr,TS,UIt=V(()=>{p();e6=require("node:crypto");QIt();Vsr=(()=>{try{return(0,e6.createHash)("sha256"),!0}catch{return!1}})(),TS=Vsr?jsr():Dae});var pB=V(()=>{p();MIt();UIt()});function $It(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}var Kv,$Pe=V(()=>{p();js();Kv=class t{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let n=new Uint8Array(8);for(let r=7,s=Math.abs(Math.round(e));r>-1&&s>0;r--,s/=256)n[r]=s;return e<0&&$It(n),new t(n)}valueOf(){let e=this.bytes.slice(0),n=e[0]&128;return n&&$It(e),parseInt($y(e),16)*(n?-1:1)}toString(){return String(this.valueOf())}}});var JU,GIt,WIt,Ksr,zsr,Jsr,Xsr,Zsr,eir,tir,nir,rir,GPe=V(()=>{p();si();js();$Pe();JU=class{toUtf8;fromUtf8;constructor(e,n){this.toUtf8=e,this.fromUtf8=n}format(e){let n=[];for(let i in e){if(!Cs(e,i))continue;let o=this.fromUtf8(i);n.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(e[i]))}let r=new Uint8Array(n.reduce((i,o)=>i+o.byteLength,0)),s=0;for(let i of n)r.set(i,s),s+=i.byteLength;return r}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let n=new DataView(new ArrayBuffer(3));return n.setUint8(0,3),n.setInt16(1,e.value,!1),new Uint8Array(n.buffer);case"integer":let r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,e.value,!1),new Uint8Array(r.buffer);case"long":let s=new Uint8Array(9);return s[0]=5,s.set(e.value.bytes,1),s;case"binary":let i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);let o=new Uint8Array(i.buffer);return o.set(e.value,3),o;case"string":let a=this.fromUtf8(e.value),c=new DataView(new ArrayBuffer(3+a.byteLength));c.setUint8(0,7),c.setUint16(1,a.byteLength,!1);let u=new Uint8Array(c.buffer);return u.set(a,3),u;case"timestamp":let l=new Uint8Array(9);return l[0]=8,l.set(Kv.fromNumber(e.value.valueOf()).bytes,1),l;case"uuid":if(!rir.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let d=new Uint8Array(17);return d[0]=9,d.set(Uoe(e.value.replace(/-/g,"")),1),d}}parse(e){let n={},r=0;for(;r{p();pB();qIt=4,zv=qIt*2,hB=4,sir=zv+hB*2});var XU,WPe=V(()=>{p();pB();GPe();VIt();XU=class{headerMarshaller;messageBuffer;isEndOfStream;constructor(e,n){this.headerMarshaller=new JU(e,n),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){let e=this.messageBuffer.pop(),n=this.isEndOfStream;return{getMessage(){return e},isEndOfStream(){return n}}}getAvailableMessages(){let e=this.messageBuffer;this.messageBuffer=[];let n=this.isEndOfStream;return{getMessages(){return e},isEndOfStream(){return n}}}encode({headers:e,body:n}){let r=this.headerMarshaller.format(e),s=r.byteLength+n.byteLength+16,i=new Uint8Array(s),o=new DataView(i.buffer,i.byteOffset,i.byteLength),a=new zU;return o.setUint32(0,s,!1),o.setUint32(4,r.byteLength,!1),a.update(i.subarray(0,8)),o.setUint32(8,a.digestSync(),!1),i.set(r,12),i.set(n,r.byteLength+12),a.update(i.subarray(8,s-4)),o.setUint32(s-4,a.digestSync(),!1),i}decode(e){let{headers:n,body:r}=HIt(e);return{headers:this.headerMarshaller.parse(n),body:r}}formatHeaders(e){return this.headerMarshaller.format(e)}}});var ZU,qPe=V(()=>{p();ZU=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.decoder.decode(e)}}});var e2,HPe=V(()=>{p();e2=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream)yield this.options.encoder.encode(e);this.options.includeEndFrame&&(yield new Uint8Array(0))}}});var t2,VPe=V(()=>{p();t2=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream){let n=await this.options.deserializer(e);n!==void 0&&(yield n)}}}});var n2,jPe=V(()=>{p();n2=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.serializer(e)}}});function Bae(t){let e=0,n=0,r=null,s=null,i=a=>{if(typeof a!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+a);e=a,n=4,r=new Uint8Array(a),new DataView(r.buffer).setUint32(0,a,!1)},o=async function*(){let a=t[Symbol.asyncIterator]();for(;;){let{value:c,done:u}=await a.next();if(u){if(e)if(e===n)yield r;else throw new Error("Truncated event message received.");else return;return}let l=c.length,d=0;for(;d{p()});function jIt(t,e){let n=t6(e.deserializer,e.toUtf8);return{[Symbol.asyncIterator]:async function*(){for await(let r of t){let s=e.eventStreamCodec.decode(r),i=await n(s);i!==void 0&&(yield i)}}}}function t6(t,e){return async function(n){let{value:r}=n.headers[":message-type"];if(r==="error"){let s=new Error(n.headers[":error-message"].value||"UnknownError");throw s.name=n.headers[":error-code"].value,s}else if(r==="exception"){let s=n.headers[":exception-type"].value,i={[s]:n},o=await t(i);if(o.$unknown){let a=new Error(e(n.body));throw a.name=s,a}throw o[s]}else if(r==="event"){let s={[n.headers[":event-type"].value]:n},i=await t(s);return i.$unknown?void 0:i}else throw Error(`Unrecognizable event type: ${n.headers[":event-type"].value}`)}}var KPe=V(()=>{p()});var mB,YIt,zPe=V(()=>{p();WPe();qPe();HPe();VPe();jPe();YPe();KPe();mB=class{eventStreamCodec;utfEncoder;constructor({utf8Encoder:e,utf8Decoder:n}){this.eventStreamCodec=new XU(e,n),this.utfEncoder=e}deserialize(e,n){let r=Bae(e);return new t2({messageStream:new ZU({inputStream:r,decoder:this.eventStreamCodec}),deserializer:t6(n,this.utfEncoder)})}serialize(e,n){return new e2({messageStream:new n2({inputStream:e,serializer:n}),encoder:this.eventStreamCodec,includeEndFrame:!0})}},YIt=t=>new mB(t)});async function*iir(t){let e=!1,n=!1,r=new Array;for(t.on("error",s=>{if(e||(e=!0),s)throw s}),t.on("data",s=>{r.push(s)}),t.on("end",()=>{e=!0});!n;){let s=await new Promise(i=>setTimeout(()=>i(r.shift()),0));s&&(yield s),n=e&&r.length===0}}var KIt,n6,zIt,JIt=V(()=>{p();KIt=require("node:stream");zPe();n6=class{universalMarshaller;constructor({utf8Encoder:e,utf8Decoder:n}){this.universalMarshaller=new mB({utf8Decoder:n,utf8Encoder:e})}deserialize(e,n){let r=typeof e[Symbol.asyncIterator]=="function"?e:iir(e);return this.universalMarshaller.deserialize(r,n)}serialize(e,n){return KIt.Readable.from(this.universalMarshaller.serialize(e,n))}},zIt=t=>new n6(t)});var XIt,ZIt,ext=V(()=>{p();XIt=t=>({[Symbol.asyncIterator]:async function*(){let e=t.getReader();try{for(;;){let{done:n,value:r}=await e.read();if(n)return;yield r}}finally{e.releaseLock()}}}),ZIt=t=>{let e=t[Symbol.asyncIterator]();return new ReadableStream({async pull(n){let{done:r,value:s}=await e.next();if(r)return n.close();n.enqueue(s)}})}});var txt,nxt=V(()=>{p();txt=t=>Object.assign(t,{eventStreamMarshaller:t.eventStreamSerdeProvider(t)})});var Pae,rxt=V(()=>{p();si();Ki();js();Pae=class{marshaller;serializer;deserializer;serdeContext;defaultContentType;compositeErrorRegistry;constructor({marshaller:e,serializer:n,deserializer:r,serdeContext:s,defaultContentType:i,compositeErrorRegistry:o}){this.marshaller=e,this.serializer=n,this.deserializer=r,this.serdeContext=s,this.defaultContentType=i,this.compositeErrorRegistry=o}async serializeEventStream({eventStream:e,requestSchema:n,initialRequest:r,initialMessageType:s}){let i=this.marshaller,o=n.getEventStreamMember(),a=n.getMemberSchema(o),c=this.serializer,u=this.defaultContentType,l=Symbol("initialRequestMarker"),d={async*[Symbol.asyncIterator](){if(r){let h={":event-type":{type:"string",value:s??"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:u}};c.write(n,r);let m=c.flush();yield{[l]:!0,headers:h,body:m}}for await(let h of e)yield h}};return i.serialize(d,h=>{if(h[l])return{headers:h.headers,body:h.body};let m="";for(let S in h)if(Cs(h,S)&&S!=="__type"){m=S;break}let{additionalHeaders:f,body:g,eventType:A,explicitPayloadContentType:y}=this.writeEventBody(m,a,h);return{headers:{":event-type":{type:"string",value:A},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:y??u},...f},body:g}})}async deserializeEventStream({response:e,responseSchema:n,initialResponseContainer:r,initialMessageType:s}){let i=this.marshaller,o=n.getEventStreamMember(),c=n.getMemberSchema(o).getMemberSchemas(),u=Symbol("initialResponseMarker"),l=i.deserialize(e.body,async m=>{let f="";for(let A in m)if(Cs(m,A)&&A!=="__type"){f=A;break}let g=m[f].body;if(f===(s??"initial-response")){let A=await this.deserializer.read(n,g);return delete A[o],{[u]:!0,...A}}else if(f in c){let A=c[f];if(A.isStructSchema()){let y={},b=!1;for(let[S,C]of A.structIterator()){let{eventHeader:I,eventPayload:x}=C.getMergedTraits();if(b=b||!!(I||x),x)C.isBlobSchema()?y[S]=g:C.isStringSchema()?y[S]=(this.serdeContext?.utf8Encoder??Jc)(g):C.isStructSchema()&&(y[S]=await this.deserializer.read(C,g));else if(I){let w=m[f].headers[S]?.value;w!=null&&(C.isNumericSchema()?w&&typeof w=="object"&&"bytes"in w?y[S]=BigInt(w.toString()):y[S]=Number(w):y[S]=w)}}return{[f]:await this.readEventMember(A,g,b,y)}}return{[f]:await this.deserializer.read(A,g)}}else return{$unknown:m}}),d=l[Symbol.asyncIterator](),h=await d.next();if(h.done)return l;if(h.value?.[u]){if(!n)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(let m in h.value)Cs(h.value,m)&&(r[m]=h.value[m])}return{async*[Symbol.asyncIterator](){for(h?.value?.[u]||(yield h.value);;){let{done:m,value:f}=await d.next();if(m)break;yield f}}}}async readEventMember(e,n,r,s){let i,o=e.getSchema();if(Array.isArray(o)&&o[0]===-3){let c=o[1],u=Va.for(c);this.compositeErrorRegistry?.copyFrom(u),i=(this.compositeErrorRegistry??u)?.getErrorCtor(o)}let a=r?s:n.byteLength===0?{}:await this.deserializer.read(e,n);if(i){let c=a.message??a.Message??"Unknown",u={},l=e.getMergedTraits().error;return l&&(u.$fault=l),Object.assign(new i({}),u,{message:c},a)}return a}writeEventBody(e,n,r){let s=this.serializer,i=e,o=null,a,c=n.getSchema()[4].includes(e),u={};if(c){let h=n.getMemberSchema(e);if(h.isStructSchema()){for(let[m,f]of h.structIterator()){let{eventHeader:g,eventPayload:A}=f.getMergedTraits();if(A)o=m;else if(g){let y=r[e][m],b="binary";f.isNumericSchema()?(-2)**31<=y&&y<=2**31-1?b="integer":b="long":f.isTimestampSchema()?b="timestamp":f.isStringSchema()?b="string":f.isBooleanSchema()&&(b="boolean"),y!=null&&(u[m]={type:b,value:y},delete r[e][m])}}if(o!==null){let m=h.getMemberSchema(o);m.isBlobSchema()?a="application/octet-stream":m.isStringSchema()&&(a="text/plain"),s.write(m,r[e][o])}else s.write(h,r[e])}else if(h.isUnitSchema())s.write(h,{});else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{let[h,m]=r[e];i=h,s.write(15,m)}let l=s.flush()??new Uint8Array;return{body:typeof l=="string"?(this.serdeContext?.utf8Decoder??od)(l):l,eventType:i,explicitPayloadContentType:a,additionalHeaders:u}}}});var r2={};Ir(r2,{EventStreamCodec:()=>XU,EventStreamMarshaller:()=>n6,EventStreamSerde:()=>Pae,HeaderMarshaller:()=>JU,Int64:()=>Kv,MessageDecoderStream:()=>ZU,MessageEncoderStream:()=>e2,SmithyMessageDecoderStream:()=>t2,SmithyMessageEncoderStream:()=>n2,UniversalEventStreamMarshaller:()=>mB,eventStreamSerdeProvider:()=>zIt,getChunkedStream:()=>Bae,getMessageUnmarshaller:()=>t6,getUnmarshalledStream:()=>jIt,iterableToReadableStream:()=>ZIt,readableStreamToIterable:()=>XIt,resolveEventStreamSerdeConfig:()=>txt,universalEventStreamSerdeProvider:()=>YIt});var s2=V(()=>{p();WPe();GPe();$Pe();qPe();HPe();VPe();jPe();JIt();ext();zPe();YPe();KPe();nxt();rxt()});var Jv,Oae=V(()=>{p();si();Ki();si();KU();Jv=class extends Ld{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=Va.for(e.defaultNamespace);for(let n of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(n)}getRequestType(){return qi}getResponseType(){return Od}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,n){if("url"in n){e.protocol=n.url.protocol,e.hostname=n.url.hostname,e.port=n.url.port?Number(n.url.port):void 0,e.path=n.url.pathname,e.fragment=n.url.hash||void 0,e.username=n.url.username||void 0,e.password=n.url.password||void 0,e.query||(e.query={});for(let[r,s]of n.url.searchParams.entries())e.query[r]=s;if(n.headers)for(let r in n.headers)Cs(n.headers,r)&&(e.headers[r]=n.headers[r].join(", "));return e}else{if(e.protocol=n.protocol,e.hostname=n.hostname,e.port=n.port?Number(n.port):void 0,e.path=n.path,e.query={...n.query},n.headers)for(let r in n.headers)Cs(n.headers,r)&&(e.headers[r]=n.headers[r]);return e}}setHostPrefix(e,n,r){if(this.serdeContext?.disableHostPrefix)return;let s=qn.of(n.input),i=Vb(n.traits??{});if(i.endpoint){let o=i.endpoint?.[0];if(typeof o=="string"){for(let[a,c]of s.structIterator()){if(!c.getMergedTraits().hostLabel)continue;let u=r[a];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${a} in input must be a string as hostLabel.`);o=o.replace(`{${a}}`,u)}if(e.hostname=o+e.hostname,!vY(e.hostname))throw new Error(`[${e.hostname}] is not a valid hostname.`)}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:n,initialRequest:r}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:n,initialRequest:r})}async deserializeEventStream({response:e,responseSchema:n,initialResponseContainer:r}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:n,initialResponseContainer:r})}async loadEventStreamCapability(){let{EventStreamSerde:e,eventStreamSerdeProvider:n}=await Promise.resolve().then(()=>(s2(),r2)),r=this.resolveEventStreamMarshaller(n);return new e({marshaller:r,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType(),compositeErrorRegistry:this.compositeErrorRegistry})}resolveEventStreamMarshaller(e){let n=this.serdeContext;return n.eventStreamMarshaller?n.eventStreamMarshaller:e(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,n,r,s,i){return[]}getEventStreamMarshaller(){let e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}});var Xv,sxt=V(()=>{p();si();Ki();js();si();Oae();Rae();kae();Xv=class extends Jv{async serializeRequest(e,n,r){let s=n&&typeof n=="object"?n:{},i=this.serializer,o={},a={},c=await r.endpoint(),u=qn.of(e?.input),l=[],d=[],h=!1,m,f=new qi({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:o,headers:a,body:void 0});if(c){this.updateServiceEndpoint(f,c),this.setHostPrefix(f,e,s);let g=Vb(e.traits);if(g.http){f.method=g.http[0];let[A,y]=g.http[1].split("?");f.path=="/"?f.path=A:f.path+=A;let b=new URLSearchParams(y??"");for(let[S,C]of b)o[S]=C}}for(let[g,A]of u.structIterator()){let y=A.getMergedTraits()??{},b=s[g];if(b==null&&!A.isIdempotencyToken()){if(y.httpLabel&&(f.path.includes(`{${g}+}`)||f.path.includes(`{${g}}`)))throw new Error(`No value provided for input HTTP label: ${g}.`);continue}if(y.httpPayload)A.isStreaming()?A.isStructSchema()?s[g]&&(m=await this.serializeEventStream({eventStream:s[g],requestSchema:u})):m=b:(i.write(A,b),m=i.flush());else if(y.httpLabel){i.write(A,b);let S=i.flush();f.path.includes(`{${g}+}`)?f.path=f.path.replace(`{${g}+}`,S.split("/").map(zb).join("/")):f.path.includes(`{${g}}`)&&(f.path=f.path.replace(`{${g}}`,zb(S)))}else if(y.httpHeader)i.write(A,b),a[y.httpHeader.toLowerCase()]=String(i.flush());else if(typeof y.httpPrefixHeaders=="string")for(let S in b){if(!Cs(b,S))continue;let C=b[S],I=y.httpPrefixHeaders+S;i.write([A.getValueSchema(),{httpHeader:I}],C),a[I.toLowerCase()]=i.flush()}else y.httpQuery||y.httpQueryParams?this.serializeQuery(A,b,o):(h=!0,l.push(g),d.push(A))}if(h&&s){let[g,A]=(u.getName(!0)??"#Unknown").split("#"),y=u.getSchema()[6],b=[3,g,A,u.getMergedTraits(),l,d,void 0];y?b[6]=y:b.pop(),i.write(b,s),m=i.flush()}return f.headers=a,f.query=o,f.body=m,f}serializeQuery(e,n,r){let s=this.serializer,i=e.getMergedTraits();if(i.httpQueryParams){for(let o in n)if(Cs(n,o)&&!(o in r)){let a=n[o],c=e.getValueSchema();Object.assign(c.getMergedTraits(),{...i,httpQuery:o,httpQueryParams:void 0}),this.serializeQuery(c,a,r)}return}if(e.isListSchema()){let o=!!e.getMergedTraits().sparse,a=[];for(let c of n){s.write([e.getValueSchema(),i],c);let u=s.flush();(o||u!==void 0)&&a.push(u)}r[i.httpQuery]=a}else s.write([e,i],n),r[i.httpQuery]=s.flush()}async deserializeResponse(e,n,r){let s=this.deserializer,i=qn.of(e.output),o={};if(r.statusCode>=300){let c=await wp(r.body,n);throw c.byteLength>0&&Object.assign(o,await s.read(15,c)),await this.handleError(e,n,r,o,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let c in r.headers){if(!Cs(r.headers,c))continue;let u=r.headers[c];delete r.headers[c],r.headers[c.toLowerCase()]=u}let a=await this.deserializeHttpMessage(i,n,r,o);if(a.length){let c=await wp(r.body,n);if(c.byteLength>0){let u=await s.read(i,c);for(let l of a)u[l]!=null&&(o[l]=u[l])}}else a.discardResponseBody&&await wp(r.body,n);return o.$metadata=this.deserializeMetadata(r),o}async deserializeHttpMessage(e,n,r,s,i){let o;s instanceof Set?o=i:o=s;let a=!0,c=this.deserializer,u=qn.of(e),l=[];for(let[d,h]of u.structIterator()){let m=h.getMemberTraits();if(m.httpPayload){if(a=!1,h.isStreaming())h.isStructSchema()?o[d]=await this.deserializeEventStream({response:r,responseSchema:u}):o[d]=vae(r.body);else if(r.body){let g=await wp(r.body,n);g.byteLength>0&&(o[d]=await c.read(h,g))}}else if(m.httpHeader){let f=String(m.httpHeader).toLowerCase(),g=r.headers[f];if(g!=null)if(h.isListSchema()){let A=h.getValueSchema();A.getMergedTraits().httpHeader=f;let y;A.isTimestampSchema()&&A.getSchema()===4?y=Foe(g,",",2):y=FU(g);let b=[];for(let S of y)b.push(await c.read(A,S.trim()));o[d]=b}else o[d]=await c.read(h,g)}else if(m.httpPrefixHeaders!==void 0){o[d]={};for(let f in r.headers)if(Cs(r.headers,f)&&f.startsWith(m.httpPrefixHeaders)){let g=r.headers[f],A=h.getValueSchema();A.getMergedTraits().httpHeader=f,o[d][f.slice(m.httpPrefixHeaders.length)]=await c.read(A,g)}}else m.httpResponseCode?o[d]=r.statusCode:l.push(d)}return l.discardResponseBody=a,l}}});var vS,ixt=V(()=>{p();si();Ki();si();Oae();Rae();vS=class extends Jv{async serializeRequest(e,n,r){let s=this.serializer,i={},o={},a=await r.endpoint(),c=qn.of(e?.input),u=c.getSchema(),l,d=n&&typeof n=="object"?n:{},h=new qi({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:i,headers:o,body:void 0});if(a&&(this.updateServiceEndpoint(h,a),this.setHostPrefix(h,e,d)),d){let m=c.getEventStreamMember();if(m){if(d[m]){let f={};for(let[g]of c.structIterator())g!==m&&d[g]!=null&&(f[g]=d[g]);l=await this.serializeEventStream({eventStream:d[m],requestSchema:c,initialRequest:f})}}else s.write(u,d),l=s.flush()}return h.headers=Object.assign(h.headers,o),h.query=i,h.body=l,h.method="POST",h}async deserializeResponse(e,n,r){let s=this.deserializer,i=qn.of(e.output),o={};if(r.statusCode>=300){let c=await wp(r.body,n);throw c.byteLength>0&&Object.assign(o,await s.read(15,c)),await this.handleError(e,n,r,o,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let c in r.headers){if(!Cs(r.headers,c))continue;let u=r.headers[c];delete r.headers[c],r.headers[c.toLowerCase()]=u}let a=i.getEventStreamMember();if(a)o[a]=await this.deserializeEventStream({response:r,responseSchema:i,initialResponseContainer:o});else{let c=await wp(r.body,n);c.byteLength>0&&Object.assign(o,await s.read(i,c))}return o.$metadata=this.deserializeMetadata(r),o}}});var Mae,JPe=V(()=>{p();kae();Mae=(t,e,n,r,s,i)=>{if(e!=null&&e[n]!==void 0){let o=r();if(o==null||o.length<=0)throw new Error("Empty value provided for input HTTP label: "+n+".");t=t.replace(s,i?o.split("/").map(a=>zb(a)).join("/"):zb(o))}else throw new Error("No value provided for input HTTP label: "+n+".");return t}});function Lae(t,e){return new r6(t,e)}var r6,oxt=V(()=>{p();si();JPe();r6=class{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(e,n){this.input=e,this.context=n}async build(){let{hostname:e,protocol:n="https",port:r,path:s}=await this.context.endpoint();this.path=s;for(let i of this.resolvePathStack)i(this.path);return new qi({protocol:n,hostname:this.hostname||e,port:r,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push(n=>{this.path=`${n?.endsWith("/")?n.slice(0,-1):n||""}`+e}),this}p(e,n,r,s){return this.resolvePathStack.push(i=>{this.path=Mae(i,this.input,e,n,r,s)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}});function Fd(t,e){if(e.timestampFormat.useTrait&&t.isTimestampSchema()&&(t.getSchema()===5||t.getSchema()===6||t.getSchema()===7))return t.getSchema();let{httpLabel:n,httpPrefixHeaders:r,httpHeader:s,httpQuery:i}=t.getMergedTraits();return(e.httpBindings?typeof r=="string"||s?6:i||n?5:void 0:void 0)??e.timestampFormat.default}var Fae=V(()=>{p()});var Zv,XPe=V(()=>{p();Ki();js();KU();Fae();Zv=class extends Ld{settings;constructor(e){super(),this.settings=e}read(e,n){let r=qn.of(e);if(r.isListSchema())return FU(n).map(s=>this.read(r.getValueSchema(),s));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??wl)(n);if(r.isTimestampSchema())switch(Fd(r,this.settings)){case 5:return Moe(n);case 6:return Loe(n);case 7:return Hv(n);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",n),new Date(n)}if(r.isStringSchema()){let s=r.getMergedTraits().mediaType,i=n;if(s)return r.getMergedTraits().httpHeader&&(i=this.base64ToUtf8(i)),(s==="application/json"||s.endsWith("+json"))&&(i=vu.from(i)),i}return r.isNumericSchema()?Number(n):r.isBigIntegerSchema()?BigInt(n):r.isBigDecimalSchema()?new zi(n,"bigDecimal"):r.isBooleanSchema()?String(n).toLowerCase()==="true":n}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??Jc)((this.serdeContext?.base64Decoder??wl)(e))}}});var eR,axt=V(()=>{p();Ki();js();KU();XPe();eR=class extends Ld{codecDeserializer;stringDeserializer;constructor(e,n){super(),this.codecDeserializer=e,this.stringDeserializer=new Zv(n)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,n){let r=qn.of(e),s=r.getMergedTraits(),i=this.serdeContext?.utf8Encoder??Jc;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(r,i(n));if(s.httpPayload){if(r.isBlobSchema()){let o=this.serdeContext?.utf8Decoder??od;return typeof n=="string"?o(n):n}else if(r.isStringSchema())return"byteLength"in n?i(n):n}return this.codecDeserializer.read(r,n)}}});var i2,ZPe=V(()=>{p();Ki();js();KU();Fae();i2=class extends Ld{settings;stringBuffer="";constructor(e){super(),this.settings=e}write(e,n){let r=qn.of(e);switch(typeof n){case"object":if(n===null){this.stringBuffer="null";return}if(r.isTimestampSchema()){if(!(n instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${n} when schema expected Date in ${r.getName(!0)}`);switch(Fd(r,this.settings)){case 5:this.stringBuffer=n.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=Hg(n);break;case 7:this.stringBuffer=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",n),this.stringBuffer=String(n.getTime()/1e3)}return}if(r.isBlobSchema()&&"byteLength"in n){this.stringBuffer=(this.serdeContext?.base64Encoder??ja)(n);return}if(r.isListSchema()&&Array.isArray(n)){let o="";for(let a of n){this.write([r.getValueSchema(),r.getMergedTraits()],a);let c=this.flush(),u=r.getValueSchema().isTimestampSchema()?c:Ooe(c);o!==""&&(o+=", "),o+=u}this.stringBuffer=o;return}this.stringBuffer=JSON.stringify(n,null,2);break;case"string":let s=r.getMergedTraits().mediaType,i=n;if(s&&((s==="application/json"||s.endsWith("+json"))&&(i=vu.from(i)),r.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??ja)(i.toString());return}this.stringBuffer=n;break;default:r.isIdempotencyToken()?this.stringBuffer=zg():this.stringBuffer=String(n)}}flush(){let e=this.stringBuffer;return this.stringBuffer="",e}}});var tR,cxt=V(()=>{p();Ki();ZPe();tR=class{codecSerializer;stringSerializer;buffer;constructor(e,n,r=new i2(n)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,n){let r=qn.of(e),s=r.getMergedTraits();if(s.httpHeader||s.httpLabel||s.httpQuery){this.stringSerializer.write(r,n),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(r,n)}flush(){if(this.buffer!==void 0){let e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}});var lxt,Qae,uxt=V(()=>{p();lxt=Gt(dS()),Qae=class{name;kind;values;constructor({name:e,kind:n=lxt.FieldPosition.HEADER,values:r=[]}){this.name=e,this.kind=n,this.values=r}add(e){this.values.push(e)}set(e){this.values=e}remove(e){this.values=this.values.filter(n=>n!==e)}toString(){return this.values.map(e=>e.includes(",")||e.includes(" ")?`"${e}"`:e).join(", ")}get(){return this.values}}});var Uae,dxt=V(()=>{p();Uae=class{entries={};encoding;constructor({fields:e=[],encoding:n="utf-8"}){e.forEach(this.setField.bind(this)),this.encoding=n}setField(e){this.entries[e.name.toLowerCase()]=e}getField(e){return this.entries[e.toLowerCase()]}removeField(e){delete this.entries[e.toLowerCase()]}getByType(e){return Object.values(this.entries).filter(n=>n.kind===e)}}});var RS,kS,pxt=V(()=>{p();RS=t=>(t.logger&&t.logger.constructor?.name!=="NoOpLogger"&&t.requestHandler?.updateHttpClientConfig?.(Symbol.for("logger"),t.logger),{setHttpHandler(e){t.requestHandler=e},httpHandler(){return t.requestHandler},updateHttpClientConfig(e,n){t.requestHandler?.updateHttpClientConfig(e,n)},httpHandlerConfigs(){return t.requestHandler.httpHandlerConfigs()}}),kS=t=>({requestHandler:t.httpHandler()})});function eOe(t){return e=>async n=>{let r=n.request;if(qi.isInstance(r)){let{body:s,headers:i}=r;if(s&&Object.keys(i).map(o=>o.toLowerCase()).indexOf(hxt)===-1)try{let o=t(s);o!=null&&(r.headers={...r.headers,[hxt]:String(o)})}catch{}}return e({...n,request:r})}}var hxt,tOe,NS,mxt=V(()=>{p();si();hxt="content-length";tOe={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},NS=t=>({applyToStack:e=>{e.add(eOe(t.bodyLengthChecker),tOe)}})});var nR,oir,$ae=V(()=>{p();nR=t=>encodeURIComponent(t).replace(/[!'()*]/g,oir),oir=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`});var fxt,gxt=V(()=>{p();$ae();fxt=t=>t.split("/").map(nR).join("/")});function Gae(t){let e=[];for(let n of Object.keys(t).sort()){let r=t[n];if(n=nR(n),Array.isArray(r))for(let s=0,i=r.length;s{p();$ae()});var qy={};Ir(qy,{Field:()=>Qae,Fields:()=>Uae,FromStringShapeDeserializer:()=>Zv,HttpBindingProtocol:()=>Xv,HttpInterceptingShapeDeserializer:()=>eR,HttpInterceptingShapeSerializer:()=>tR,HttpProtocol:()=>Jv,HttpRequest:()=>qi,HttpResponse:()=>Od,RequestBuilder:()=>r6,RpcProtocol:()=>vS,SerdeContext:()=>Ld,ToStringShapeSerializer:()=>i2,buildQueryString:()=>Gae,collectBody:()=>wp,contentLengthMiddleware:()=>eOe,contentLengthMiddlewareOptions:()=>tOe,determineTimestampFormat:()=>Fd,escapeUri:()=>nR,escapeUriPath:()=>fxt,extendedEncodeURIComponent:()=>zb,getContentLengthPlugin:()=>NS,getHttpHandlerExtensionConfiguration:()=>RS,isValidHostname:()=>vY,parseQueryString:()=>RY,parseUrl:()=>Ip,requestBuilder:()=>Lae,resolveHttpHandlerRuntimeConfig:()=>kS,resolvedPath:()=>Mae});var $r=V(()=>{p();Rae();kae();sxt();Oae();ixt();oxt();JPe();XPe();axt();cxt();ZPe();Fae();KU();uxt();dxt();si();si();si();pxt();mxt();$ae();gxt();Axt();si();si()});var yxt,Ext,bxt,_xt,Sxt,Cxt,Ixt=V(()=>{p();yxt=["AccessDeniedException","AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],Ext=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],bxt=["TimeoutError","RequestTimeout","RequestTimeoutException"],_xt=[500,502,503,504],Sxt=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Cxt=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"]});function sOe(t){return t.code==="ERR_HTTP2_STREAM_ERROR"&&t.message.includes("NGHTTP2_REFUSED_STREAM")}var s6,Wae,nOe,rOe,DS,rR,qae,o2=V(()=>{p();Ixt();s6=t=>t?.$retryable!==void 0,Wae=t=>yxt.includes(t.name),nOe=t=>t.$metadata?.clockSkewCorrected,rOe=t=>{let e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return t&&t instanceof TypeError?e.has(t.message):!1},DS=t=>t.$metadata?.httpStatusCode===429||Ext.includes(t.name)||t.$retryable?.throttling==!0,rR=(t,e=0)=>s6(t)||nOe(t)||t.name==="InvalidSignatureException"&&t.message?.includes("Signature expired")||bxt.includes(t.name)||Sxt.includes(t?.code||"")||Cxt.includes(t?.code||"")||_xt.includes(t.$metadata?.httpStatusCode||0)||rOe(t)||sOe(t)||t.cause!==void 0&&e<=10&&rR(t.cause,e+1),qae=t=>{if(t.$metadata?.httpStatusCode!==void 0){let e=t.$metadata.httpStatusCode;return 500<=e&&e<=599&&!rR(t)}return!1}});var Hae,i6,Vae,a2,iOe,oOe,jae,sR,iR,o6=V(()=>{p();Hae=100,i6=2e4,Vae=500,a2=500,iOe=5,oOe=10,jae=1,sR="amz-sdk-invocation-id",iR="amz-sdk-request"});function aOe(t,e){if(Od.isInstance(t))for(let n in t.headers){if(!Cs(t.headers,n))continue;let r=n.toLowerCase();if(r==="retry-after"){let s=t.headers[n],i=NaN;if(s.endsWith("GMT"))try{i=(qv(s).getTime()-Date.now())/1e3}catch(o){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(o)}else s.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?i=Number(s.match(/ GMT, ([\d.]+)$/)?.[1]):s.match(/^((\d+)|(\d+\.\d+))$/)?i=Number(s):Date.parse(s)>=Date.now()&&(i=(Date.parse(s)-Date.now())/1e3);return isNaN(i)?void 0:new Date(Date.now()+i*1e3)}else if(r==="x-amz-retry-after"){let s=t.headers[n],i=Number(s);if(isNaN(i)){e?.trace?.(`Failed to parse x-amz-retry-after=${s}`);return}return new Date(Date.now()+i)}}}function xxt(t,e){return aOe(t,e)}var cOe=V(()=>{p();si();$r();js()});var Yae,lOe=V(()=>{p();Yae=t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`)});function uOe(t){return e=>(n,r)=>async s=>{let i=await e.retryStrategy(),o=await e.maxAttempts();if(cir(i)){i=i;let a=await i.acquireInitialRetryToken((r.partition_id??"")+(r.__retryLongPoll?":longpoll":"")),c=new Error,u=0,l=0,{request:d}=s,h=qi.isInstance(d);for(h&&(d.headers[sR]=YU());;)try{h&&(d.headers[iR]=`attempt=${u+1}; max=${o}`);let{response:m,output:f}=await n(s);return i.recordSuccess(a),f.$metadata.attempts=u+1,f.$metadata.totalRetryDelay=l,{response:m,output:f}}catch(m){let f=lir(m,e.logger);if(c=Yae(m),h&&t(d))throw(r.logger instanceof If?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),c;try{a=await i.refreshRetryTokenForRetry(a,f)}catch{throw c.$metadata||(c.$metadata={}),c.$metadata.attempts=u+1,c.$metadata.totalRetryDelay=l,c}u=a.getRetryCount();let g=a.getRetryDelay();l+=(a?.$retryLog?.acquisitionDelay??0)+g,g>0&&await air(g)}}else return i=i,i?.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(n,s)}}function wxt(t){let e=uOe(t);return n=>({applyToStack:r=>{r.add(e(n),dOe)}})}var air,cir,lir,uir,dOe,pOe=V(()=>{p();Is();$r();js();o2();o6();cOe();lOe();air=t=>new Promise(e=>setTimeout(e,t)),cir=t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",lir=(t,e)=>{let n={error:t,errorType:uir(t)},r=aOe(t.$response,e);return r&&(n.retryAfterHint=r),n},uir=t=>DS(t)?"THROTTLING":rR(t)?"TRANSIENT":qae(t)?"SERVER_ERROR":"CLIENT_ERROR",dOe={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0}});var oR,Kae=V(()=>{p();o2();oR=class t{static setTimeoutFn=(e,n)=>setTimeout(e,n);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let n;this.updateMeasuredRate();let r=e;if(r?.errorType==="THROTTLING"||DS(r?.error??e)){let o=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=o,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),n=this.cubicThrottle(o),this.enableTokenBucket()}else this.calculateTimeWindow(),n=this.cubicSuccess(this.getCurrentTimeInSeconds());let i=Math.min(n,2*this.measuredTxRate);this.updateTokenBucketRate(i)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){let n=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(r=>t.setTimeoutFn(r,n)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){let e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}let n=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+n),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let e=this.getCurrentTimeInSeconds(),n=Math.floor(e*2)/2;if(this.requestCount++,n>this.lastTxRateBucket){let r=this.requestCount/(n-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(r*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=n}}getPrecise(e){return parseFloat(e.toFixed(8))}}});var cu,c2=V(()=>{p();cu=class t{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return t.v2026?50:100}static throttlingDelay(){return t.v2026?1e3:500}static cost(){return t.v2026?14:5}static throttlingCost(){return t.v2026?5:10}static modifiedCostType(){return t.v2026?"THROTTLING":"TRANSIENT"}}});var zae,Txt=V(()=>{p();c2();zae=class{x=cu.delay();computeNextBackoffDelay(e){let s=Math.random()*Math.min(this.x*2**e,2e4);return Math.floor(s)}setDelayBase(e){this.x=e}}});var a6,vxt=V(()=>{p();a6=class{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(e,n,r,s){this.delay=e,this.count=n,this.cost=r,this.longPoll=s}getRetryCount(){return this.count}getRetryDelay(){return Math.min(2e4,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}});var Qd,Jb,Hy,fB=V(()=>{p();(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(Qd||(Qd={}));Jb=3,Hy=Qd.STANDARD});var Jae,Xb,c6=V(()=>{p();Txt();vxt();fB();c2();Jae={incompatible:1,attempts:2,capacity:3},Xb=class{mode=Qd.STANDARD;retryBackoffStrategy;capacity=500;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>Jb,this.baseDelay??=cu.delay(),this.retryBackoffStrategy??=new zae}async acquireInitialRetryToken(e){return new a6(cu.delay(),0,void 0,cu.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,n){let r=await this.getMaxAttempts(),s=this.retryCode(e,n,r),i=s===0,o=e.isLongPoll?.();if(i||o){let a=n.errorType;this.retryBackoffStrategy.setDelayBase(a==="THROTTLING"?cu.throttlingDelay():this.baseDelay);let c=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),u=c;if(n.retryAfterHint instanceof Date&&(u=Math.max(c,Math.min(n.retryAfterHint.getTime()-Date.now(),c+5e3))),i){let l=this.getCapacityCost(a);this.capacity-=l;let d=new a6(0,e.getRetryCount()+1,l,e.isLongPoll?.()??!1);return await new Promise(h=>setTimeout(h,u)),d.$retryLog.acquisitionDelay=u,d}else{let l=cu.v2026&&s===Jae.capacity&&o?u:0;l>0&&await new Promise(d=>setTimeout(d,l))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${Jb}`),Jb}}retryCode(e,n,r){let s=e.getRetryCount()+1,i=this.isRetryableError(n.errorType)?0:Jae.incompatible,o=s=this.getCapacityCost(n.errorType)?0:Jae.capacity;return i||o||a}getCapacityCost(e){return e===cu.modifiedCostType()?cu.throttlingCost():cu.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}});var l2,hOe=V(()=>{p();Kae();c6();fB();l2=class{mode=Qd.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,n){let{rateLimiter:r}=n??{};this.rateLimiter=r??new oR,this.standardRetryStrategy=n?new Xb({maxAttempts:typeof e=="number"?e:3,...n}):new Xb(e)}async acquireInitialRetryToken(e){let n=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),n}async refreshRetryTokenForRetry(e,n){this.rateLimiter.updateClientSendingRate(n);let r=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,n);return await this.rateLimiter.getSendToken(),r}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}});var Xae,Rxt=V(()=>{p();c6();c2();Xae=class extends Xb{computeNextBackoffDelay;constructor(e,n=cu.delay()){super(typeof e=="function"?e:async()=>e),typeof n=="number"?this.computeNextBackoffDelay=()=>n:this.computeNextBackoffDelay=n,this.retryBackoffStrategy.computeNextBackoffDelay=r=>{let s=r+1;return this.computeNextBackoffDelay(s)}}}});var kxt,Nxt=V(()=>{p();kxt=(t,e)=>{let n=t,r=e?.noRetryIncrement??1,s=e?.retryCost??5,i=e?.timeoutRetryCost??10,o=t,a=d=>d.name==="TimeoutError"?i:s,c=d=>a(d)<=o;return Object.freeze({hasRetryTokens:c,retrieveRetryTokens:d=>{if(!c(d))throw new Error("No retry token available");let h=a(d);return o-=h,h},releaseRetryTokens:d=>{o+=d??r,o=Math.min(o,n)}})}});var Zae,mOe=V(()=>{p();Zae=(t,e)=>Math.floor(Math.min(2e4,Math.random()*2**e*t))});var ece,fOe=V(()=>{p();o2();ece=t=>t?s6(t)||Wae(t)||DS(t)||rR(t):!1});var u2,dir,gOe=V(()=>{p();$r();js();o2();fB();o6();lOe();Nxt();mOe();fOe();u2=class{maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=Qd.STANDARD;constructor(e,n){this.maxAttemptsProvider=e,this.retryDecider=n?.retryDecider??ece,this.delayDecider=n?.delayDecider??Zae,this.retryQuota=n?.retryQuota??kxt(500)}shouldRetry(e,n,r){return nsetTimeout(f,m));continue}throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=i,l.$metadata.totalRetryDelay=o,l}}},dir=t=>{if(!Od.isInstance(t))return;let e=Object.keys(t.headers).find(i=>i.toLowerCase()==="retry-after");if(!e)return;let n=t.headers[e],r=Number(n);if(!Number.isNaN(r))return Math.min(r*1e3,2e4);let s=new Date(n);return Math.min(s.getTime()-Date.now(),2e4)}});var tce,Dxt=V(()=>{p();Kae();fB();gOe();tce=class extends u2{rateLimiter;constructor(e,n){let{rateLimiter:r,...s}=n??{};super(e,s),this.rateLimiter=r??new oR,this.mode=Qd.ADAPTIVE}async retry(e,n){return super.retry(e,n,{beforeRequest:async()=>this.rateLimiter.getSendToken(),afterRequest:r=>{this.rateLimiter.updateClientSendingRate(r)}})}}});var nce,rce,BS,PS,AOe,yOe,OS,Bxt=V(()=>{p();Is();hOe();c6();fB();c2();nce="AWS_MAX_ATTEMPTS",rce="max_attempts",BS={environmentVariableSelector:t=>{let e=t[nce];if(!e)return;let n=parseInt(e);if(Number.isNaN(n))throw new Error(`Environment variable ${nce} mast be a number, got "${e}"`);return n},configFileSelector:t=>{let e=t[rce];if(!e)return;let n=parseInt(e);if(Number.isNaN(n))throw new Error(`Shared config file entry ${rce} mast be a number, got "${e}"`);return n},default:Jb},PS=(t,e)=>{let{retryStrategy:n,retryMode:r}=t,{defaultMaxAttempts:s=Jb,defaultBaseDelay:i=cu.delay()}=e??{},o=ba(t.maxAttempts??s),a=n?Promise.resolve(n):void 0,c=async()=>{let u=await o();return await ba(r)()===Qd.ADAPTIVE?new l2(o,{maxAttempts:u,baseDelay:i}):new Xb({maxAttempts:u,baseDelay:i})};return Object.assign(t,{maxAttempts:o,retryStrategy:()=>a??=c()})},AOe="AWS_RETRY_MODE",yOe="retry_mode",OS={environmentVariableSelector:t=>t[AOe],configFileSelector:t=>t[yOe],default:Hy}});var EOe,bOe,Pxt,Oxt=V(()=>{p();$r();o6();EOe=()=>t=>async e=>{let{request:n}=e;return qi.isInstance(n)&&(delete n.headers[sR],delete n.headers[iR]),t(e)},bOe={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},Pxt=t=>({applyToStack:e=>{e.addRelativeTo(EOe(),bOe)}})});var _Oe={};Ir(_Oe,{AdaptiveRetryStrategy:()=>l2,CONFIG_MAX_ATTEMPTS:()=>rce,CONFIG_RETRY_MODE:()=>yOe,ConfiguredRetryStrategy:()=>Xae,DEFAULT_MAX_ATTEMPTS:()=>Jb,DEFAULT_RETRY_DELAY_BASE:()=>Hae,DEFAULT_RETRY_MODE:()=>Hy,DefaultRateLimiter:()=>oR,DeprecatedAdaptiveRetryStrategy:()=>tce,DeprecatedStandardRetryStrategy:()=>u2,ENV_MAX_ATTEMPTS:()=>nce,ENV_RETRY_MODE:()=>AOe,INITIAL_RETRY_TOKENS:()=>a2,INVOCATION_ID_HEADER:()=>sR,MAXIMUM_RETRY_DELAY:()=>i6,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>BS,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>OS,NO_RETRY_INCREMENT:()=>jae,REQUEST_HEADER:()=>iR,RETRY_COST:()=>iOe,RETRY_MODES:()=>Qd,Retry:()=>cu,StandardRetryStrategy:()=>Xb,THROTTLING_RETRY_DELAY_BASE:()=>Vae,TIMEOUT_RETRY_COST:()=>oOe,defaultDelayDecider:()=>Zae,defaultRetryDecider:()=>ece,getOmitRetryHeadersPlugin:()=>Pxt,getRetryAfterHint:()=>xxt,getRetryPlugin:()=>wx,isBrowserNetworkError:()=>rOe,isClockSkewCorrectedError:()=>nOe,isClockSkewError:()=>Wae,isNodeJsHttp2TransientError:()=>sOe,isRetryableByTrait:()=>s6,isServerError:()=>qae,isThrottlingError:()=>DS,isTransientError:()=>rR,omitRetryHeadersMiddleware:()=>EOe,omitRetryHeadersMiddlewareOptions:()=>bOe,resolveRetryConfig:()=>PS,retryMiddleware:()=>pir,retryMiddlewareOptions:()=>dOe});var pir,wx,Jg=V(()=>{p();Cbt();pOe();o2();hOe();Rxt();Kae();c6();fB();o6();c2();Dxt();gOe();mOe();fOe();Bxt();Oxt();pOe();cOe();pir=uOe(L1e),wx=wxt(L1e)});function Vy(t,e,n){t.__aws_sdk_context?t.__aws_sdk_context.features||(t.__aws_sdk_context.features={}):t.__aws_sdk_context={features:{}},t.__aws_sdk_context.features[e]=n}var SOe=V(()=>{p();Jg();cu.v2026||=typeof process=="object"&&process.env?.AWS_NEW_RETRIES_2026==="true"});function Mxt(t,e,n){return t.$source||(t.$source={}),t.$source[e]=n,t}var Lxt=V(()=>{p()});function d2(t){return t}var COe,IOe,MS,Fxt=V(()=>{p();$r();COe=t=>e=>async n=>{if(!qi.isInstance(n.request))return e(n);let{request:r}=n,{handlerProtocol:s=""}=t.requestHandler.metadata||{};if(s.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let i=r.hostname;r.port!=null&&(i+=`:${r.port}`),r.headers.host=i}return e(n)},IOe={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},MS=t=>({applyToStack:e=>{e.add(COe(t),IOe)}})});var xOe,wOe,LS,Qxt=V(()=>{p();xOe=()=>(t,e)=>async n=>{try{let r=await t(n),{clientName:s,commandName:i,logger:o,dynamoDbDocumentClientOptions:a={}}=e,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:u}=a,l=c??e.inputFilterSensitiveLog,d=u??e.outputFilterSensitiveLog,{$metadata:h,...m}=r.output;return o?.info?.({clientName:s,commandName:i,input:l(n.input),output:d(m),metadata:h}),r}catch(r){let{clientName:s,commandName:i,logger:o,dynamoDbDocumentClientOptions:a={}}=e,{overrideInputFilterSensitiveLog:c}=a,u=c??e.inputFilterSensitiveLog;throw o?.error?.({clientName:s,commandName:i,input:u(n.input),error:r,metadata:r.$metadata}),r}},wOe={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},LS=t=>({applyToStack:e=>{e.add(xOe(),wOe)}})});var sce,TOe=V(()=>{p();sce={step:"build",tags:["RECURSION_DETECTION","TRACE_CONTEXT_PROPAGATION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"}});var aR,vOe,ice,ROe,kOe,l6,Uxt=V(()=>{p();aR={REQUEST_ID:Symbol.for("_AWS_LAMBDA_REQUEST_ID"),X_RAY_TRACE_ID:Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),TENANT_ID:Symbol.for("_AWS_LAMBDA_TENANT_ID"),TRACEPARENT:Symbol.for("_AWS_LAMBDA_TRACEPARENT"),TRACESTATE:Symbol.for("_AWS_LAMBDA_TRACESTATE"),BAGGAGE:Symbol.for("_AWS_LAMBDA_BAGGAGE")},vOe=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");vOe||(globalThis.awslambda=globalThis.awslambda||{});ice=class{static PROTECTED_KEYS=aR;isProtectedKey(e){return Object.values(aR).includes(e)}getRequestId(){return this.get(aR.REQUEST_ID)??"-"}getXRayTraceId(){return this.get(aR.X_RAY_TRACE_ID)}getTenantId(){return this.get(aR.TENANT_ID)}getTraceparent(){return this.get(aR.TRACEPARENT)}getTracestate(){return this.get(aR.TRACESTATE)}getBaggage(){return this.get(aR.BAGGAGE)}},ROe=class extends ice{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(e){return this.currentContext?.[e]}set(e,n){if(this.isProtectedKey(e))throw new Error(`Cannot modify protected Lambda context field: ${String(e)}`);this.currentContext=this.currentContext||{},this.currentContext[e]=n}run(e,n){return this.currentContext=e,n()}},kOe=class t extends ice{als;static async create(){let e=new t,n=await import("node:async_hooks");return e.als=new n.AsyncLocalStorage,e}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(e){return this.als.getStore()?.[e]}set(e,n){if(this.isProtectedKey(e))throw new Error(`Cannot modify protected Lambda context field: ${String(e)}`);let r=this.als.getStore();if(!r)throw new Error("No context available");r[e]=n}run(e,n){return this.als.run(e,n)}};(function(t){let e=null;async function n(r){return e||(e=(async()=>{let i=r===!0||"AWS_LAMBDA_MAX_CONCURRENCY"in process.env?await kOe.create():new ROe;return!vOe&&globalThis.awslambda?.InvokeStore?globalThis.awslambda.InvokeStore:(!vOe&&globalThis.awslambda&&(globalThis.awslambda.InvokeStore=i),i)})()),e}t.getInstanceAsync=n,t._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE==="1"?{reset:()=>{e=null,globalThis.awslambda?.InvokeStore&&delete globalThis.awslambda.InvokeStore,globalThis.awslambda={InvokeStore:void 0}}}:void 0})(l6||(l6={}))});function fir(t){for(let e of Object.keys(t)){let n=e.toLowerCase();e!==n&&(n===DOe||n===$xt||n===Gxt)&&(t[n]=t[e],delete t[e])}}var hir,mir,NOe,DOe,$xt,Gxt,oce,BOe=V(()=>{p();Uxt();$r();hir="AWS_LAMBDA_FUNCTION_NAME",mir="_X_AMZN_TRACE_ID",NOe="X-Amzn-Trace-Id",DOe="traceparent",$xt="tracestate",Gxt="baggage",oce=()=>t=>async e=>{let{request:n}=e;if(!qi.isInstance(n))return t(e);let r;{let s=Object.keys(n.headers??{}).find(i=>i.toLowerCase()===NOe.toLowerCase())??NOe;if(!n.headers.hasOwnProperty(s)){let i=process.env[hir],o=process.env[mir];r??=await l6.getInstanceAsync();let c=r?.getXRayTraceId()??o,u=l=>typeof l=="string"&&l.length>0;u(i)&&u(c)&&(n.headers[NOe]=c)}}if(fir(n.headers),!n.headers[DOe]){let i=(r??=await l6.getInstanceAsync())?.getTraceparent?.();if(i){n.headers[DOe]=i;let o=r?.getTracestate?.();o&&(n.headers[$xt]=o);let a=r?.getBaggage?.();a&&(n.headers[Gxt]=a)}}return t(e)}});var FS,Wxt=V(()=>{p();TOe();BOe();FS=t=>({applyToStack:e=>{e.add(oce(),sce)}})});var qxt,Hxt=V(()=>{p();qxt=(t,e)=>{if(!e||e.length===0)return t;let n=[];for(let r of e)for(let s of t)s.schemeId.split("#")[1]===r&&n.push(s);for(let r of t)n.find(({schemeId:s})=>s===r.schemeId)||n.push(r);return n}});function gir(t){let e=new Map;for(let n of t)e.set(n.schemeId,n);return e}var gB,ace=V(()=>{p();si();Hxt();gB=(t,e)=>(n,r)=>async s=>{let i=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,r,s.input)),o=t.authSchemePreference?await t.authSchemePreference():[],a=qxt(i,o),c=gir(t.httpAuthSchemes),u=Ha(r),l=[];for(let d of a){let h=c.get(d.schemeId);if(!h){l.push(`HttpAuthScheme \`${d.schemeId}\` was not enabled for this service.`);continue}let m=h.identityProvider(await e.identityProviderConfigProvider(t));if(!m){l.push(`HttpAuthScheme \`${d.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:f={},signingProperties:g={}}=d.propertiesExtractor?.(t,r)||{};d.identityProperties=Object.assign(d.identityProperties||{},f),d.signingProperties=Object.assign(d.signingProperties||{},g),u.selectedHttpAuthScheme={httpAuthOption:d,identity:await m(d.identityProperties),signer:h.signer};break}if(!u.selectedHttpAuthScheme)throw new Error(l.join(` -`));return n(s)}});var cce,Zb,Vxt=V(()=>{p();ace();cce={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},Zb=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(gB(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:n}),cce)}})});var lce,POe,jxt=V(()=>{p();ace();lce={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},POe=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(gB(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:n}),lce)}})});var Yxt=V(()=>{p();ace();Vxt();jxt()});var Air,yir,u6,OOe=V(()=>{p();$r();si();Air=t=>e=>{throw e},yir=(t,e)=>{},u6=t=>(e,n)=>async r=>{if(!qi.isInstance(r.request))return e(r);let i=Ha(n).selectedHttpAuthScheme;if(!i)throw new Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:o={}},identity:a,signer:c}=i,u=await e({...r,request:await c.sign(r.request,a,o)}).catch((c.errorHandler||Air)(o));return(c.successHandler||yir)(u.response,o),u}});var uce,e_,Kxt=V(()=>{p();OOe();uce={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},e_=t=>({applyToStack:e=>{e.addRelativeTo(u6(t),uce)}})});var zxt=V(()=>{p();OOe();Kxt()});var jy,Jxt=V(()=>{p();jy=t=>{if(typeof t=="function")return t;let e=Promise.resolve(t);return()=>e}});function Xxt(t,e,n,r,s){return async function*(o,a,...c){let u=a,l=o.startingToken??u[n],d=!0,h;for(;d;){if(u[n]=l,s&&(u[s]=u[s]??o.pageSize),o.client instanceof t)h=await Eir(e,o.client,a,o.withCommand,...c);else throw new Error(`Invalid client, expected instance of ${t.name}`);yield h;let m=l;l=bir(h,r),d=!!(l&&(!o.stopOnSameToken||l!==m))}return void 0}}var Eir,bir,Zxt=V(()=>{p();Eir=async(t,e,n,r=i=>i,...s)=>{let i=new t(n);return i=r(i)??i,await e.send(i,...s)};bir=(t,e)=>{let n=t,r=e.split(".");for(let s of r){if(!n||typeof n!="object")return;n=n[s]}return n}});function ewt(t,e,n){t.__smithy_context?t.__smithy_context.features||(t.__smithy_context.features={}):t.__smithy_context={features:{}},t.__smithy_context.features[e]=n}var twt=V(()=>{p()});var Xg,nwt=V(()=>{p();si();Xg=class{authSchemes=new Map;constructor(e){for(let n in e){if(!Cs(e,n))continue;let r=e[n];r!==void 0&&this.authSchemes.set(n,r)}}getIdentityProvider(e){return this.authSchemes.get(e)}}});var MOe,p2,rwt=V(()=>{p();$r();MOe=Gt(dS()),p2=class{async sign(e,n,r){if(!r)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!r.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!r.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!n.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let s=qi.clone(e);if(r.in===MOe.HttpApiKeyAuthLocation.QUERY)s.query[r.name]=n.apiKey;else if(r.in===MOe.HttpApiKeyAuthLocation.HEADER)s.headers[r.name]=r.scheme?`${r.scheme} ${n.apiKey}`:n.apiKey;else throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+r.in+"`");return s}}});var h2,swt=V(()=>{p();$r();h2=class{async sign(e,n,r){let s=qi.clone(e);if(!n.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return s.headers.Authorization=`Bearer ${n.token}`,s}}});var Ah,iwt=V(()=>{p();Ah=class{async sign(e,n,r){return e}}});var owt=V(()=>{p();rwt();swt();iwt()});var dce,LOe,d6,m2,p6,awt=V(()=>{p();dce=t=>function(n){return m2(n)&&n.expiration.getTime()-Date.now()t.expiration!==void 0,p6=(t,e,n)=>{if(t===void 0)return;let r=typeof t!="function"?async()=>Promise.resolve(t):t,s,i,o,a=!1,c=async u=>{i||(i=r(u));try{s=await i,o=!0,a=!1}finally{i=void 0}return s};return e===void 0?async u=>((!o||u?.forceRefresh)&&(s=await c(u)),s):async u=>((!o||u?.forceRefresh)&&(s=await c(u)),a?s:n(s)?(e(s)&&await c(u),s):(a=!0,s))}});var cwt=V(()=>{p();nwt();owt();awt()});var h6={};Ir(h6,{DefaultIdentityProviderConfig:()=>Xg,EXPIRATION_MS:()=>LOe,HttpApiKeyAuthSigner:()=>p2,HttpBearerAuthSigner:()=>h2,NoAuthSigner:()=>Ah,createIsIdentityExpiredFunction:()=>dce,createPaginator:()=>Xxt,doesIdentityRequireRefresh:()=>m2,getHttpAuthSchemeEndpointRuleSetPlugin:()=>Zb,getHttpAuthSchemePlugin:()=>POe,getHttpSigningPlugin:()=>e_,getSmithyContext:()=>Ha,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>cce,httpAuthSchemeMiddleware:()=>gB,httpAuthSchemeMiddlewareOptions:()=>lce,httpSigningMiddleware:()=>u6,httpSigningMiddlewareOptions:()=>uce,isIdentityExpired:()=>d6,memoizeIdentityProvider:()=>p6,normalizeProvider:()=>jy,requestBuilder:()=>Lae,setFeature:()=>ewt});var vp=V(()=>{p();si();Yxt();zxt();Jxt();Zxt();$r();twt();cwt()});function _ir(t){return t===void 0?!0:typeof t=="string"&&t.length<=50}function QS(t){let e=jy(t.userAgentAppId??m6),{customUserAgent:n}=t;return Object.assign(t,{customUserAgent:typeof n=="string"?[[n]]:n,userAgentAppId:async()=>{let r=await e();if(!_ir(r)){let s=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?console:t.logger;typeof r!="string"?s?.warn("userAgentAppId must be a string or undefined."):r.length>50&&s?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return r}})}var m6,FOe=V(()=>{p();vp();m6=void 0});var QOe,lwt=V(()=>{p();QOe={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],version:"1.1"}});var uwt,dwt,pce,UOe,pwt,hce,mce=V(()=>{p();lwt();uwt=QOe,dwt="",pce=t=>{let{partitions:e}=uwt;for(let r of e){let{regions:s,outputs:i}=r;for(let[o,a]of Object.entries(s))if(o===t)return{...i,...a}}for(let r of e){let{regionRegex:s,outputs:i}=r;if(new RegExp(s).test(t))return{...i}}let n=e.find(r=>r.id==="aws");if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},UOe=(t,e="")=>{uwt=t,dwt=e},pwt=()=>{UOe(QOe,"")},hce=()=>dwt});async function hwt(t,e,n){if(n.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Vy(t,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){let i=await e.retryStrategy();if(typeof i.mode=="string")switch(i.mode){case Qd.ADAPTIVE:Vy(t,"RETRY_MODE_ADAPTIVE","F");break;case Qd.STANDARD:Vy(t,"RETRY_MODE_STANDARD","E");break}}if(typeof e.accountIdEndpointMode=="function"){let i=t.endpointV2;switch(String(i?.url?.hostname).match(Sir)&&Vy(t,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":Vy(t,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Vy(t,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Vy(t,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let s=t.__smithy_context?.selectedHttpAuthScheme?.identity;if(s?.$source){let i=s;i.accountId&&Vy(t,"RESOLVED_ACCOUNT_ID","T");for(let[o,a]of Object.entries(i.$source??{}))Vy(t,o,a)}}var Sir,mwt=V(()=>{p();Jg();SOe();Sir=/\d{12}\.ddb/});var $Oe,fce,fwt,gwt,Awt=V(()=>{p();$Oe="user-agent",fce="x-amz-user-agent",fwt=/[^!$%&'*+\-.^_`|~\w]/g,gwt=/[^!$%&'*+\-.^_`|~\w#]/g});function ywt(t){let e="";for(let n in t){let r=t[n];if(e.length+r.length+1<=1024){e.length?e+=","+r:e+=r;continue}break}return e}var Ewt=V(()=>{p()});var WOe,gce,qOe,US,Swt=V(()=>{p();$r();mce();mwt();Awt();Ewt();WOe=t=>(e,n)=>async r=>{let{request:s}=r;if(!qi.isInstance(s))return e(r);let{headers:i}=s,o=n?.userAgent?.map(gce)||[],a=(await t.defaultUserAgentProvider()).map(gce);await hwt(n,t,r);let c=n;a.push(`m/${ywt(Object.assign({},n.__smithy_context?.features,c.__aws_sdk_context?.features))}`);let u=t?.customUserAgent?.map(gce)||[],l=await t.userAgentAppId();l&&a.push(gce(["app",`${l}`]));let d=hce(),h=(d?[d]:[]).concat([...a,...o,...u]).join(" "),m=[...a.filter(f=>f.startsWith("aws-sdk-")),...u].join(" ");return t.runtime!=="browser"?(m&&(i[fce]=i[fce]?`${i[$Oe]} ${m}`:m),i[$Oe]=h):i[fce]=h,e({...r,request:s})},gce=t=>{let e=t[0].split("/").map(o=>o.replace(fwt,"-")).join("/"),n=t[1]?.replace(gwt,"-"),r=e.indexOf("/"),s=e.substring(0,r),i=e.substring(r+1);return s==="api"&&(i=i.toLowerCase()),[s,i,n].filter(o=>o&&o.length>0).reduce((o,a,c)=>{switch(c){case 0:return a;case 1:return`${o}/${a}`;default:return`${o}#${a}`}},"")},qOe={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},US=t=>({applyToStack:e=>{e.add(WOe(t),qOe)}})});var Ace,Cwt,Iwt=V(()=>{p();Ace=require("node:process"),Cwt=()=>{let t=["deno","bun","llrt"];for(let e of t)if(Ace.versions[e])return[`md/${e}`,Ace.versions[e]];return["md/nodejs",Ace.versions.node]}});var f6,HOe=V(()=>{p();f6={isCrtAvailable:!1}});var xwt,wwt=V(()=>{p();HOe();xwt=()=>f6.isCrtAvailable?["md/crt-avail"]:null});var yce,VOe,t_,Twt,vwt=V(()=>{p();yce=require("node:os"),VOe=require("node:process");Iwt();wwt();HOe();t_=({serviceId:t,clientVersion:e})=>{let n=Cwt();return async r=>{let s=[["aws-sdk-js",e],["ua","2.1"],[`os/${(0,yce.platform)()}`,(0,yce.release)()],["lang/js"],n],i=xwt();i&&s.push(i),t&&s.push([`api/${t}`,e]),VOe.env.AWS_EXECUTION_ENV&&s.push([`exec-env/${VOe.env.AWS_EXECUTION_ENV}`]);let o=await r?.userAgentAppId?.();return o?[...s,[`app/${o}`]]:[...s]}},Twt=t_});var jOe,YOe,Cir,$S,Rwt=V(()=>{p();FOe();jOe="AWS_SDK_UA_APP_ID",YOe="sdk_ua_app_id",Cir="sdk-ua-app-id",$S={environmentVariableSelector:t=>t[jOe],configFileSelector:t=>t[YOe]??t[Cir],default:m6}});var kwt=ee((g6,KOe)=>{p();(function(t,e){typeof g6=="object"&&typeof KOe=="object"?KOe.exports=e():typeof define=="function"&&define.amd?define([],e):typeof g6=="object"?g6.bowser=e():t.bowser=e()})(g6,(function(){return(function(t){var e={};function n(r){if(e[r])return e[r].exports;var s=e[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(r,s,i){n.o(r,s)||Object.defineProperty(r,s,{enumerable:!0,get:i})},n.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,s){if(1&s&&(r=n(r)),8&s||4&s&&typeof r=="object"&&r&&r.__esModule)return r;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:r}),2&s&&typeof r!="string")for(var o in r)n.d(i,o,function(a){return r[a]}.bind(null,o));return i},n.n=function(r){var s=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(s,"a",s),s},n.o=function(r,s){return Object.prototype.hasOwnProperty.call(r,s)},n.p="",n(n.s=90)})({17:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=n(18),s=(function(){function i(){}return i.getFirstMatch=function(o,a){var c=a.match(o);return c&&c.length>0&&c[1]||""},i.getSecondMatch=function(o,a){var c=a.match(o);return c&&c.length>1&&c[2]||""},i.matchAndReturnConst=function(o,a,c){if(o.test(a))return c},i.getWindowsVersionName=function(o){switch(o){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},i.getMacOSVersionName=function(o){var a=o.split(".").splice(0,2).map((function(l){return parseInt(l,10)||0}));a.push(0);var c=a[0],u=a[1];if(c===10)switch(u){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(c){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}},i.getAndroidVersionName=function(o){var a=o.split(".").splice(0,2).map((function(c){return parseInt(c,10)||0}));if(a.push(0),!(a[0]===1&&a[1]<5))return a[0]===1&&a[1]<6?"Cupcake":a[0]===1&&a[1]>=6?"Donut":a[0]===2&&a[1]<2?"Eclair":a[0]===2&&a[1]===2?"Froyo":a[0]===2&&a[1]>2?"Gingerbread":a[0]===3?"Honeycomb":a[0]===4&&a[1]<1?"Ice Cream Sandwich":a[0]===4&&a[1]<4?"Jelly Bean":a[0]===4&&a[1]>=4?"KitKat":a[0]===5?"Lollipop":a[0]===6?"Marshmallow":a[0]===7?"Nougat":a[0]===8?"Oreo":a[0]===9?"Pie":void 0},i.getVersionPrecision=function(o){return o.split(".").length},i.compareVersions=function(o,a,c){c===void 0&&(c=!1);var u=i.getVersionPrecision(o),l=i.getVersionPrecision(a),d=Math.max(u,l),h=0,m=i.map([o,a],(function(f){var g=d-i.getVersionPrecision(f),A=f+new Array(g+1).join(".0");return i.map(A.split("."),(function(y){return new Array(20-y.length).join("0")+y})).reverse()}));for(c&&(h=d-Math.min(u,l)),d-=1;d>=h;){if(m[0][d]>m[1][d])return 1;if(m[0][d]===m[1][d]){if(d===h)return 0;d-=1}else if(m[0][d]1?l-1:0),h=1;h0){var b=Object.keys(f),S=a.default.find(b,(function(N){return m.isOS(N)}));if(S){var C=this.satisfies(f[S]);if(C!==void 0)return C}var I=a.default.find(b,(function(N){return m.isPlatform(N)}));if(I){var x=this.satisfies(f[I]);if(x!==void 0)return x}}if(y>0){var w=Object.keys(A),R=a.default.find(w,(function(N){return m.isBrowser(N,!0)}));if(R!==void 0)return this.compareVersion(A[R])}},d.isBrowser=function(h,m){m===void 0&&(m=!1);var f=this.getBrowserName().toLowerCase(),g=h.toLowerCase(),A=a.default.getBrowserTypeByAlias(g);return m&&A&&(g=A.toLowerCase()),g===f},d.compareVersion=function(h){var m=[0],f=h,g=!1,A=this.getBrowserVersion();if(typeof A=="string")return h[0]===">"||h[0]==="<"?(f=h.substr(1),h[1]==="="?(g=!0,f=h.substr(2)):m=[],h[0]===">"?m.push(1):m.push(-1)):h[0]==="="?f=h.substr(1):h[0]==="~"&&(g=!0,f=h.substr(1)),m.indexOf(a.default.compareVersions(A,f,g))>-1},d.isOS=function(h){return this.getOSName(!0)===String(h).toLowerCase()},d.isPlatform=function(h){return this.getPlatformType(!0)===String(h).toLowerCase()},d.isEngine=function(h){return this.getEngineName(!0)===String(h).toLowerCase()},d.is=function(h,m){return m===void 0&&(m=!1),this.isBrowser(h,m)||this.isOS(h)||this.isPlatform(h)},d.some=function(h){var m=this;return h===void 0&&(h=[]),h.some((function(f){return m.is(f)}))},l})();e.default=u,t.exports=e.default},92:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,s=(r=n(17))&&r.__esModule?r:{default:r},i=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/gptbot/i],describe:function(a){var c={name:"GPTBot"},u=s.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/chatgpt-user/i],describe:function(a){var c={name:"ChatGPT-User"},u=s.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/oai-searchbot/i],describe:function(a){var c={name:"OAI-SearchBot"},u=s.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(a){var c={name:"ClaudeBot"},u=s.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(a){var c={name:"Omgilibot"},u=s.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/diffbot/i],describe:function(a){var c={name:"Diffbot"},u=s.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/perplexitybot/i],describe:function(a){var c={name:"PerplexityBot"},u=s.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/perplexity-user/i],describe:function(a){var c={name:"Perplexity-User"},u=s.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/youbot/i],describe:function(a){var c={name:"YouBot"},u=s.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/meta-webindexer/i],describe:function(a){var c={name:"Meta-WebIndexer"},u=s.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/meta-externalads/i],describe:function(a){var c={name:"Meta-ExternalAds"},u=s.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/meta-externalagent/i],describe:function(a){var c={name:"Meta-ExternalAgent"},u=s.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/meta-externalfetcher/i],describe:function(a){var c={name:"Meta-ExternalFetcher"},u=s.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/googlebot/i],describe:function(a){var c={name:"Googlebot"},u=s.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/linespider/i],describe:function(a){var c={name:"Linespider"},u=s.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/amazonbot/i],describe:function(a){var c={name:"AmazonBot"},u=s.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/bingbot/i],describe:function(a){var c={name:"BingCrawler"},u=s.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/baiduspider/i],describe:function(a){var c={name:"BaiduSpider"},u=s.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/duckduckbot/i],describe:function(a){var c={name:"DuckDuckBot"},u=s.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/ia_archiver/i],describe:function(a){var c={name:"InternetArchiveCrawler"},u=s.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(a){var c={name:"SlackBot"},u=s.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{test:[/opera/i],describe:function(a){var c={name:"Opera"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/opr\/|opios/i],describe:function(a){var c={name:"Opera"},u=s.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/SamsungBrowser/i],describe:function(a){var c={name:"Samsung Internet for Android"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/Whale/i],describe:function(a){var c={name:"NAVER Whale Browser"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/PaleMoon/i],describe:function(a){var c={name:"Pale Moon"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/MZBrowser/i],describe:function(a){var c={name:"MZ Browser"},u=s.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/focus/i],describe:function(a){var c={name:"Focus"},u=s.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/swing/i],describe:function(a){var c={name:"Swing"},u=s.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/coast/i],describe:function(a){var c={name:"Opera Coast"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(a){var c={name:"Opera Touch"},u=s.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/yabrowser/i],describe:function(a){var c={name:"Yandex Browser"},u=s.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/ucbrowser/i],describe:function(a){var c={name:"UC Browser"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/Maxthon|mxios/i],describe:function(a){var c={name:"Maxthon"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/epiphany/i],describe:function(a){var c={name:"Epiphany"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/puffin/i],describe:function(a){var c={name:"Puffin"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/sleipnir/i],describe:function(a){var c={name:"Sleipnir"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/k-meleon/i],describe:function(a){var c={name:"K-Meleon"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/micromessenger/i],describe:function(a){var c={name:"WeChat"},u=s.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/qqbrowser/i],describe:function(a){var c={name:/qqbrowserlite/i.test(a)?"QQ Browser Lite":"QQ Browser"},u=s.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/msie|trident/i],describe:function(a){var c={name:"Internet Explorer"},u=s.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/\sedg\//i],describe:function(a){var c={name:"Microsoft Edge"},u=s.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/edg([ea]|ios)/i],describe:function(a){var c={name:"Microsoft Edge"},u=s.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/vivaldi/i],describe:function(a){var c={name:"Vivaldi"},u=s.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/seamonkey/i],describe:function(a){var c={name:"SeaMonkey"},u=s.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/sailfish/i],describe:function(a){var c={name:"Sailfish"},u=s.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,a);return u&&(c.version=u),c}},{test:[/silk/i],describe:function(a){var c={name:"Amazon Silk"},u=s.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/phantom/i],describe:function(a){var c={name:"PhantomJS"},u=s.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/slimerjs/i],describe:function(a){var c={name:"SlimerJS"},u=s.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(a){var c={name:"BlackBerry"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/(web|hpw)[o0]s/i],describe:function(a){var c={name:"WebOS Browser"},u=s.default.getFirstMatch(i,a)||s.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/bada/i],describe:function(a){var c={name:"Bada"},u=s.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/tizen/i],describe:function(a){var c={name:"Tizen"},u=s.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/qupzilla/i],describe:function(a){var c={name:"QupZilla"},u=s.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/librewolf/i],describe:function(a){var c={name:"LibreWolf"},u=s.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/firefox|iceweasel|fxios/i],describe:function(a){var c={name:"Firefox"},u=s.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/electron/i],describe:function(a){var c={name:"Electron"},u=s.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(a){var c={name:"Sogou Browser"},u=s.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,a),l=s.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a),d=s.default.getFirstMatch(/se ([\d.]+)x/i,a),h=u||l||d;return h&&(c.version=h),c}},{test:[/MiuiBrowser/i],describe:function(a){var c={name:"Miui"},u=s.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:function(a){return!!a.hasBrand("DuckDuckGo")||a.test(/\sDdg\/[\d.]+$/i)},describe:function(a,c){var u={name:"DuckDuckGo"};if(c){var l=c.getBrandVersion("DuckDuckGo");if(l)return u.version=l,u}var d=s.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,a);return d&&(u.version=d),u}},{test:function(a){return a.hasBrand("Brave")},describe:function(a,c){var u={name:"Brave"};if(c){var l=c.getBrandVersion("Brave");if(l)return u.version=l,u}return u}},{test:[/chromium/i],describe:function(a){var c={name:"Chromium"},u=s.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,a)||s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/chrome|crios|crmo/i],describe:function(a){var c={name:"Chrome"},u=s.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/GSA/i],describe:function(a){var c={name:"Google Search"},u=s.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:function(a){var c=!a.test(/like android/i),u=a.test(/android/i);return c&&u},describe:function(a){var c={name:"Android Browser"},u=s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/playstation 4/i],describe:function(a){var c={name:"PlayStation 4"},u=s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/safari|applewebkit/i],describe:function(a){var c={name:"Safari"},u=s.default.getFirstMatch(i,a);return u&&(c.version=u),c}},{test:[/.*/i],describe:function(a){var c=a.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:s.default.getFirstMatch(c,a),version:s.default.getSecondMatch(c,a)}}}];e.default=o,t.exports=e.default},93:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,s=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),o=[{test:[/Roku\/DVP/],describe:function(a){var c=s.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,a);return{name:i.OS_MAP.Roku,version:c}}},{test:[/windows phone/i],describe:function(a){var c=s.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.WindowsPhone,version:c}}},{test:[/windows /i],describe:function(a){var c=s.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,a),u=s.default.getWindowsVersionName(c);return{name:i.OS_MAP.Windows,version:c,versionName:u}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(a){var c={name:i.OS_MAP.iOS},u=s.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,a);return u&&(c.version=u),c}},{test:[/macintosh/i],describe:function(a){var c=s.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,a).replace(/[_\s]/g,"."),u=s.default.getMacOSVersionName(c),l={name:i.OS_MAP.MacOS,version:c};return u&&(l.versionName=u),l}},{test:[/(ipod|iphone|ipad)/i],describe:function(a){var c=s.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,a).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:c}}},{test:[/OpenHarmony/i],describe:function(a){var c=s.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.HarmonyOS,version:c}}},{test:function(a){var c=!a.test(/like android/i),u=a.test(/android/i);return c&&u},describe:function(a){var c=s.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,a),u=s.default.getAndroidVersionName(c),l={name:i.OS_MAP.Android,version:c};return u&&(l.versionName=u),l}},{test:[/(web|hpw)[o0]s/i],describe:function(a){var c=s.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,a),u={name:i.OS_MAP.WebOS};return c&&c.length&&(u.version=c),u}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(a){var c=s.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,a)||s.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,a)||s.default.getFirstMatch(/\bbb(\d+)/i,a);return{name:i.OS_MAP.BlackBerry,version:c}}},{test:[/bada/i],describe:function(a){var c=s.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.Bada,version:c}}},{test:[/tizen/i],describe:function(a){var c=s.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.Tizen,version:c}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(a){var c=s.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.PlayStation4,version:c}}}];e.default=o,t.exports=e.default},94:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,s=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/linespider/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(a){var c=s.default.getFirstMatch(/(can-l01)/i,a)&&"Nova",u={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return c&&(u.model=c),u}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(a){var c=a.test(/ipod|iphone/i),u=a.test(/like (ipod|iphone)/i);return c&&!u},describe:function(a){var c=s.default.getFirstMatch(/(ipod|iphone)/i,a);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:c}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(a){var c=s.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,a),u={type:i.PLATFORMS_MAP.mobile,vendor:"Nokia"};return c&&(u.model=c),u}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(a){return a.getBrowserName(!0)==="blackberry"},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(a){return a.getBrowserName(!0)==="bada"},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(a){return a.getBrowserName()==="windows phone"},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(a){var c=Number(String(a.getOSVersion()).split(".")[0]);return a.getOSName(!0)==="android"&&c>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(a){return a.getOSName(!0)==="android"},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:[/smart-?tv|smarttv/i],describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(a){return a.getOSName(!0)==="macos"},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(a){return a.getOSName(!0)==="windows"},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(a){return a.getOSName(!0)==="linux"},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(a){return a.getOSName(!0)==="playstation 4"},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(a){return a.getOSName(!0)==="roku"},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];e.default=o,t.exports=e.default},95:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,s=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),o=[{test:function(a){return a.getBrowserName(!0)==="microsoft edge"},describe:function(a){if(/\sedg\//i.test(a))return{name:i.ENGINE_MAP.Blink};var c=s.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,a);return{name:i.ENGINE_MAP.EdgeHTML,version:c}}},{test:[/trident/i],describe:function(a){var c={name:i.ENGINE_MAP.Trident},u=s.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:function(a){return a.test(/presto/i)},describe:function(a){var c={name:i.ENGINE_MAP.Presto},u=s.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:function(a){var c=a.test(/gecko/i),u=a.test(/like gecko/i);return c&&!u},describe:function(a){var c={name:i.ENGINE_MAP.Gecko},u=s.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(a){var c={name:i.ENGINE_MAP.WebKit},u=s.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}}];e.default=o,t.exports=e.default}})}))});var Nwt,Dwt=V(()=>{p();Nwt=({serviceId:t,clientVersion:e})=>async n=>{let r=await Promise.resolve().then(()=>Gt(kwt())),s=r.parse??r.default.parse??(()=>""),i=typeof window<"u"&&window?.navigator?.userAgent?s(window.navigator.userAgent):void 0,o=[["aws-sdk-js",e],["ua","2.1"],[`os/${i?.os?.name||"other"}`,i?.os?.version],["lang/js"],["md/browser",`${i?.browser?.name??"unknown"}_${i?.browser?.version??"unknown"}`]];t&&o.push([`api/${t}`,e]);let a=await n?.userAgentAppId?.();return a&&o.push([`app/${a}`]),o}});var Bwt,Pwt=V(()=>{p();Bwt={os(t){if(/iPhone|iPad|iPod/.test(t))return"iOS";if(/Macintosh|Mac OS X/.test(t))return"macOS";if(/Windows NT/.test(t))return"Windows";if(/Android/.test(t))return"Android";if(/Linux/.test(t))return"Linux"},browser(t){if(/EdgiOS|EdgA|Edg\//.test(t))return"Microsoft Edge";if(/Firefox\//.test(t))return"Firefox";if(/Chrome\//.test(t))return"Chrome";if(/Safari\//.test(t))return"Safari"}}});var zOe=V(()=>{p();Ta()});var A6,JOe=V(()=>{p();Ta();zOe();A6=(t,e=!1)=>{if(e){for(let n of t.split("."))if(!A6(n))return!1;return!0}return!(!Hb(t)||t.length<3||t.length>63||t!==t.toLowerCase()||bx(t))}});var Ece,XOe=V(()=>{p();Ece=t=>{let e=t.split(":");if(e.length<6)return null;let[n,r,s,i,o,...a]=e;if(n!=="arn"||r===""||s===""||a.join(":")==="")return null;let c=a.map(u=>u.split("/")).flat();return{partition:r,service:s,region:i,accountId:o,resourceId:c}}});var n_,Owt=V(()=>{p();Ta();JOe();XOe();mce();n_={isVirtualHostableS3Bucket:A6,parseArn:Ece,partition:pce};wf.aws=n_});var Mwt=V(()=>{p();Ta()});var Lwt,ZOe,Fwt=V(()=>{p();$r();Lwt=t=>{if(typeof t.endpointProvider!="function")throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.");let{endpoint:e}=t;return e===void 0&&(t.endpoint=async()=>ZOe(t.endpointProvider({Region:typeof t.region=="function"?await t.region():t.region,UseDualStack:typeof t.useDualstackEndpoint=="function"?await t.useDualstackEndpoint():t.useDualstackEndpoint,UseFIPS:typeof t.useFipsEndpoint=="function"?await t.useFipsEndpoint():t.useFipsEndpoint,Endpoint:void 0},{logger:t.logger}))),t},ZOe=t=>Ip(t.url)});var Qwt=V(()=>{p();Ta()});var Uwt=V(()=>{p();Jo();Jo()});function bce(t={}){return ei({...xp,async default(){return eMe.silence||console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."),"us-east-1"}},{...mm,...t})}var eMe,$wt=V(()=>{p();Jo();eMe={silence:!1}});var GS,WS,Gwt=V(()=>{p();GS=t=>({setRegion(e){t.region=e},region(){return t.region}}),WS=t=>({region:t.region()})});var Zg={};Ir(Zg,{DEFAULT_UA_APP_ID:()=>m6,EndpointError:()=>Co,NODE_APP_ID_CONFIG_OPTIONS:()=>$S,NODE_REGION_CONFIG_FILE_OPTIONS:()=>mm,NODE_REGION_CONFIG_OPTIONS:()=>xp,REGION_ENV_NAME:()=>WU,REGION_INI_NAME:()=>qU,UA_APP_ID_ENV_NAME:()=>jOe,UA_APP_ID_INI_NAME:()=>YOe,awsEndpointFunctions:()=>n_,createDefaultUserAgentProvider:()=>t_,createUserAgentStringParsingProvider:()=>Nwt,crtAvailability:()=>f6,defaultUserAgent:()=>Twt,emitWarningIfUnsupportedVersion:()=>uS,fallback:()=>Bwt,getAwsRegionExtensionConfiguration:()=>GS,getHostHeaderPlugin:()=>MS,getLoggerPlugin:()=>LS,getLongPollPlugin:()=>Ebt,getRecursionDetectionPlugin:()=>FS,getUserAgentMiddlewareOptions:()=>qOe,getUserAgentPlugin:()=>US,getUserAgentPrefix:()=>hce,hostHeaderMiddleware:()=>COe,hostHeaderMiddlewareOptions:()=>IOe,isIpAddress:()=>bx,isVirtualHostableS3Bucket:()=>A6,loggerMiddleware:()=>xOe,loggerMiddlewareOptions:()=>wOe,parseArn:()=>Ece,partition:()=>pce,recursionDetectionMiddleware:()=>oce,recursionDetectionMiddlewareOptions:()=>sce,resolveAwsRegionExtensionConfiguration:()=>WS,resolveDefaultAwsRegionalEndpointsConfig:()=>Lwt,resolveEndpoint:()=>ZY,resolveHostHeaderConfig:()=>d2,resolveRegionConfig:()=>jg,resolveUserAgentConfig:()=>QS,setCredentialFeature:()=>Lv,setFeature:()=>Vy,setPartitionInfo:()=>UOe,setTokenFeature:()=>Mxt,state:()=>wY,stsRegionDefaultResolver:()=>bce,stsRegionWarning:()=>eMe,toEndpointV1:()=>ZOe,useDefaultPartitionInfo:()=>pwt,userAgentMiddleware:()=>WOe});var Go=V(()=>{p();ybt();bbt();_bt();SOe();Lxt();Fxt();Qxt();TOe();Wxt();BOe();FOe();Swt();vwt();Rwt();Pwt();Dwt();Owt();Mwt();Fwt();zOe();JOe();XOe();mce();Qwt();Uwt();$wt();Gwt()});var Ywt=ee(AB=>{p();var{HttpRequest:Wwt}=($r(),Un(qy));function Iir(t){let e=t.signer,n=t.signer,r=Object.assign(t,{eventSigner:e,messageSigner:n}),s=r.eventStreamPayloadHandlerProvider(r);return Object.assign(r,{eventStreamPayloadHandler:s})}var qwt=t=>(e,n)=>async r=>{let{request:s}=r;return Wwt.isInstance(s)?t.eventStreamPayloadHandler.handle(e,r,n):e(r)},Hwt={tags:["EVENT_STREAM","SIGNATURE","HANDLE"],name:"eventStreamHandlingMiddleware",relation:"after",toMiddleware:"awsAuthMiddleware",override:!0},Vwt=t=>async e=>{let{request:n}=e;return Wwt.isInstance(n)?(n.headers={...n.headers,"content-type":"application/vnd.amazon.eventstream","x-amz-content-sha256":"STREAMING-AWS4-HMAC-SHA256-EVENTS"},t({...e,request:n})):t(e)},jwt={step:"build",tags:["EVENT_STREAM","HEADER","CONTENT_TYPE","CONTENT_SHA256"],name:"eventStreamHeaderMiddleware",override:!0},xir=t=>({applyToStack:e=>{e.addRelativeTo(qwt(t),Hwt),e.add(Vwt,jwt)}});AB.eventStreamHandlingMiddleware=qwt;AB.eventStreamHandlingMiddlewareOptions=Hwt;AB.eventStreamHeaderMiddleware=Vwt;AB.eventStreamHeaderMiddlewareOptions=jwt;AB.getEventStreamPlugin=xir;AB.resolveEventStreamConfig=Iir});var Kwt,zwt,Jwt,Xwt=V(()=>{p();Kwt=t=>typeof t=="string"&&t.indexOf("arn:")===0&&t.split(":").length>=6,zwt=t=>{let e=t.split(":");if(e.length<6||e[0]!=="arn")throw new Error("Malformed ARN");let[,n,r,s,i,...o]=e;return{partition:n,service:r,region:s,accountId:i,resource:o.join(":")}},Jwt=t=>{let{partition:e="aws",service:n,region:r,accountId:s,resource:i}=t;if([n,r,s,i].some(o=>typeof o!="string"))throw new Error("Input ARN object is invalid");return`arn:${e}:${n}:${r}:${s}:${i}`}});function Zwt(t){let{port:e,query:n}=t,{protocol:r,path:s,hostname:i}=t;r&&r.slice(-1)!==":"&&(r+=":"),e&&(i+=`:${e}`),s&&s.charAt(0)!=="/"&&(s=`/${s}`);let o=n?Gae(n):"";o&&o[0]!=="?"&&(o=`?${o}`);let a="";if(t.username!=null||t.password!=null){let u=t.username??"",l=t.password??"";a=`${u}:${l}@`}let c="";return t.fragment&&(c=`#${t.fragment}`),`${r}//${a}${i}${s}${o}${c}`}var eTt=V(()=>{p();$r()});var tTt={};Ir(tTt,{build:()=>Jwt,formatUrl:()=>Zwt,parse:()=>zwt,validate:()=>Kwt});var nTt=V(()=>{p();Xwt();eTt()});var oTt=ee(Sce=>{p();var{buildQueryString:wir,HttpResponse:rTt}=($r(),Un(qy)),{streamCollector:Tir}=(js(),Un(xx));Sce.streamCollector=Tir;function sTt(t,e){return new Request(t,e)}function vir(t=0){return new Promise((e,n)=>{t&&setTimeout(()=>{let r=new Error(`Request did not complete within ${t} ms`);r.name="TimeoutError",n(r)},t)})}var _ce={supported:void 0},tMe=class t{config;configProvider;static create(e){return typeof e?.handle=="function"?e:new t(e)}constructor(e){typeof e=="function"?this.configProvider=e().then(n=>n||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),_ce.supported===void 0&&(_ce.supported=typeof Request<"u"&&"keepalive"in sTt("https://[::1]"))}destroy(){}async handle(e,{abortSignal:n,requestTimeout:r}={}){this.config||(this.config=await this.configProvider);let s=r??this.config.requestTimeout,i=this.config.keepAlive===!0,o=this.config.credentials;if(n?.aborted){let b=iTt(n);return Promise.reject(b)}let a=e.path,c=wir(e.query||{});c&&(a+=`?${c}`),e.fragment&&(a+=`#${e.fragment}`);let u="";if(e.username!=null||e.password!=null){let b=e.username??"",S=e.password??"";u=`${b}:${S}@`}let{port:l,method:d}=e,h=`${e.protocol}//${u}${e.hostname}${l?`:${l}`:""}${a}`,m=d==="GET"||d==="HEAD"?void 0:e.body,f={body:m,headers:new Headers(e.headers),method:d,credentials:o};this.config?.cache&&(f.cache=this.config.cache),m&&(f.duplex="half"),typeof AbortController<"u"&&(f.signal=n),_ce.supported&&(f.keepalive=i),typeof this.config.requestInit=="function"&&Object.assign(f,this.config.requestInit(e));let g=()=>{},A=sTt(h,f),y=[fetch(A).then(b=>{let S=b.headers,C={};for(let x of S.entries())C[x[0]]=x[1];return b.body!=null?{response:new rTt({headers:C,reason:b.statusText,statusCode:b.status,body:b.body})}:b.blob().then(x=>({response:new rTt({headers:C,reason:b.statusText,statusCode:b.status,body:x})}))}),vir(s)];return n&&y.push(new Promise((b,S)=>{let C=()=>{let I=iTt(n);S(I)};if(typeof n.addEventListener=="function"){let I=n;I.addEventListener("abort",C,{once:!0}),g=()=>I.removeEventListener("abort",C)}else n.onabort=C})),Promise.race(y).finally(g)}updateHttpClientConfig(e,n){this.config=void 0,this.configProvider=this.configProvider.then(r=>(r[e]=n,r))}httpHandlerConfigs(){return this.config??{}}};function iTt(t){let e=t&&typeof t=="object"&&"reason"in t?t.reason:void 0;if(e){if(e instanceof Error){let s=new Error("Request aborted");return s.name="AbortError",s.cause=e,s}let r=new Error(String(e));return r.name="AbortError",r}let n=new Error("Request aborted");return n.name="AbortError",n}Sce.FetchHttpHandler=tMe;Sce.keepAliveSupport=_ce});var uTt=ee(y6=>{p();var{formatUrl:Rir}=(nTt(),Un(tTt)),{iterableToReadableStream:kir,readableStreamToIterable:Nir,EventStreamCodec:Dir}=(s2(),Un(r2)),{HttpResponse:Bir,HttpRequest:cTt}=($r(),Un(qy)),{fromBase64:Pir,fromHex:Oir}=(js(),Un(xx)),{FetchHttpHandler:aTt}=oTt(),lTt=t=>t.protocol==="ws:"||t.protocol==="wss:",Mir=3e3,nMe=class t{metadata={handlerProtocol:"websocket/h1.1"};config={};configPromise;httpHandler;sockets={};static create(e,n=new aTt){return typeof e?.handle=="function"?e:new t(e,n)}constructor(e,n=new aTt){this.httpHandler=n;let r=s=>(this.config={...s??{}},this.config);typeof e=="function"?(this.config={},this.configPromise=e().then(s=>r(s))):this.configPromise=Promise.resolve(r(e))}destroy(){for(let[e,n]of Object.entries(this.sockets)){for(let r of n)r.close(1e3,"Socket closed through destroy() call");delete this.sockets[e]}}async handle(e){this.config=await this.configPromise;let{logger:n}=this.config;if(!lTt(e))return n?.debug?.(`@aws-sdk - ws fetching ${e.protocol}${e.hostname}${e.path}`),this.httpHandler.handle(e);let r=Rir(e);n?.debug?.(`@aws-sdk - ws connecting ${r.split("?")[0]}`);let s=new WebSocket(r);this.sockets[r]||(this.sockets[r]=[]),this.sockets[r].push(s),s.binaryType="arraybuffer";let{connectionTimeout:i=Mir}=this.config;await this.waitForReady(s,i);let{body:o}=e,a=Lir(o),c=this.connect(s,a),u=Fir(c);return{response:new Bir({statusCode:200,body:u})}}updateHttpClientConfig(e,n){this.configPromise=this.configPromise.then(r=>(r[e]=n,r))}httpHandlerConfigs(){return this.config??{}}removeNotUsableSockets(e){this.sockets[e]=(this.sockets[e]??[]).filter(n=>![WebSocket.CLOSING,WebSocket.CLOSED].includes(n.readyState))}waitForReady(e,n){return new Promise((r,s)=>{let i=setTimeout(()=>{this.removeNotUsableSockets(e.url),s({$metadata:{httpStatusCode:500,websocketSynthetic500Error:!0}})},n);e.onopen=()=>{clearTimeout(i),r()}})}connect(e,n){let r=[],s=null,i=null,o=u=>{s?(u.error?i(u.error):s({done:u.done,value:u.value}),s=null,i=null):r.push(u)};e.onmessage=u=>{let{data:l}=u;o(typeof l=="string"?{done:!1,value:Pir(l)}:{done:!1,value:new Uint8Array(l)})},e.onerror=u=>{e.close(),o({done:!0,error:u})},e.onclose=()=>{this.removeNotUsableSockets(e.url),o({done:!0})};let a={[Symbol.asyncIterator]:()=>({async next(){if(r.length>0){let u=r.shift();if(u.error)throw u.error;return{done:u.done,value:u.value}}return new Promise((u,l)=>{s=u,i=l})}})};return(async()=>{try{for await(let u of n){if(e.readyState>=WebSocket.CLOSING)break;e.send(u)}}catch(u){o({done:!0,error:u})}finally{e.close(1e3)}})(),a}},Lir=t=>t[Symbol.asyncIterator]?t:Qir(t)?Nir(t):{[Symbol.asyncIterator]:async function*(){yield t}},Fir=t=>typeof ReadableStream=="function"?kir(t):t,Qir=t=>typeof ReadableStream=="function"&&t instanceof ReadableStream,Uir=(t,e)=>n=>r=>{let{request:s}=r;if(cTt.isInstance(s)&&t.requestHandler.metadata?.handlerProtocol?.toLowerCase().includes("websocket")){s.protocol="wss:",s.method="GET",s.path=`${s.path}-websocket`;let{headers:i}=s;delete i["content-type"],delete i["x-amz-content-sha256"];for(let o of Object.keys(i))if(o.indexOf(e.headerPrefix)===0){let a=o.replace(e.headerPrefix,"");s.query[a]=i[o]}i["x-amz-user-agent"]&&(s.query["user-agent"]=i["x-amz-user-agent"]),s.headers={host:i.host??s.hostname}}return n(r)},$ir={name:"websocketEndpointMiddleware",tags:["WEBSOCKET","EVENT_STREAM"],relation:"after",toMiddleware:"eventStreamHeaderMiddleware",override:!0},Gir=()=>t=>async e=>{let n={...e.input},r=await t(e),s=r.output;return n.SessionId&&s.SessionId==null&&(s.SessionId=n.SessionId),r},Wir={step:"initialize",name:"injectSessionIdMiddleware",tags:["WEBSOCKET","EVENT_STREAM"],override:!0},qir=(t,e)=>({applyToStack:n=>{n.addRelativeTo(Uir(t,e),$ir),n.add(Gir(),Wir)}}),rMe=class{signer;constructor(e){this.signer=e.signer}presign(e,n={}){return this.signer.presign(e,n)}async sign(e,n){return cTt.isInstance(e)&&lTt(e)?{...await this.signer.presign({...e,body:""},{...n,expiresIn:60,unsignableHeaders:new Set(Object.keys(e.headers).filter(s=>s!=="host"))}),body:e.body}:this.signer.sign(e,n)}signMessage(e,n){return this.signer.signMessage(e,n)}},Hir=t=>{let{signer:e}=t;return Object.assign(t,{signer:async n=>{let r=await e(n);if(Vir(r))return new rMe({signer:r});throw new Error("Expected WebsocketSignatureV4 signer, please check the client constructor.")}})},Vir=t=>!!t,sMe=class extends TransformStream{constructor(e,n,r,s,i){let o=e,a=i?.();super({start(){},async transform(c,u){try{let l=new Date(Date.now()+await s()),d={":date":{type:"timestamp",value:l}},h=await n.sign({message:{body:c,headers:d},priorSignature:o},{signingDate:l,eventStreamCredentials:await a});o=h.signature;let m=r.encode({headers:{...d,":chunk-signature":{type:"binary",value:Oir(h.signature)}},body:c});u.enqueue(m)}catch(l){u.error(l)}}})}},iMe=class{messageSigner;eventStreamCodec;systemClockOffsetProvider;credentials;constructor(e){this.messageSigner=e.messageSigner,this.eventStreamCodec=new Dir(e.utf8Encoder,e.utf8Decoder),this.systemClockOffsetProvider=async()=>e.systemClockOffset??0,this.credentials=e.credentials}async handle(e,n,r={}){let s=n.request,{body:i,headers:o,query:a}=s;if(!(i instanceof ReadableStream))throw new Error("Eventstream payload must be a ReadableStream.");let c=new TransformStream;s.body=c.readable;let l=((o?.authorization??"").match(/Signature=(\w+)$/)??[])[1]??(a&&a["X-Amz-Signature"])??"";r.__staticSignature&&(l="");let d=new sMe(l,await this.messageSigner(),this.eventStreamCodec,this.systemClockOffsetProvider,this.credentials);i.pipeThrough(d).pipeThrough(c);let h;try{h=await e(n)}catch(m){let f=i.cancel?.();throw f instanceof Promise&&f.catch(()=>{}),m}return h}},jir=t=>new iMe(t);y6.WebSocketFetchHandler=nMe;y6.eventStreamPayloadHandlerProvider=jir;y6.getWebSocketPlugin=qir;y6.resolveWebSocketConfig=Hir});var Cce,Ice,dTt=V(()=>{p();$r();Cce=t=>Od.isInstance(t)?t.headers?.date??t.headers?.Date:void 0,Ice=t=>Od.isInstance(t)?t.headers?.age??t.headers?.Age:void 0});var E6,pTt=V(()=>{p();E6=t=>new Date(Date.now()+t)});var xce,hTt=V(()=>{p();xce=(t,e,n,r)=>{if(r!==void 0)return e;let s=Date.parse(t),i=Date.now();return n!==void 0&&i-n>9e5?e:n!==void 0?s-(n+i)/2:s-i}});var oMe=V(()=>{p();dTt();pTt();hTt()});var b6,f2,Ud,aMe,cMe=V(()=>{p();$r();oMe();b6=(t,e)=>{if(!e)throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return e},f2=async t=>{let e=b6("context",t.context),n=b6("config",t.config),r=e.endpointV2?.properties?.authSchemes?.[0],i=await b6("signer",n.signer)(r),o=t?.signingRegion,a=t?.signingRegionSet,c=t?.signingName;return{config:n,signer:i,signingRegion:o,signingRegionSet:a,signingName:c}},Ud=class{async sign(e,n,r){if(!qi.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let s=await f2(r),{config:i,signer:o}=s,{signingRegion:a,signingName:c}=s,u=r.context;if(u?.authSchemes?.length??!1){let[h,m]=u.authSchemes;h?.name==="sigv4a"&&m?.name==="sigv4"&&(a=m?.signingRegion??a,c=m?.signingName??c)}let l=await i.disableClockSkewCorrection?.()===!0;return r._disableClockSkewCorrection=l,l||(r._preRequestSystemClockOffset=i.systemClockOffset,r._requestSentAt=Date.now()),await o.sign(e,{signingDate:l?new Date:E6(i.systemClockOffset),signingRegion:a,signingService:c})}errorHandler(e){return n=>{let r=n;if(!e._disableClockSkewCorrection){let s=r.ServerTime??Cce(r.$response);if(s){let i=b6("config",e.config),o=e._preRequestSystemClockOffset,a=e._requestSentAt,c=Ice(r.$response),u=xce(s,i.systemClockOffset,a,c);i.systemClockOffset=u,Math.abs(u)>=24e4&&(u!==o||o!==void 0&&o!==u)&&r.$metadata&&(r.$metadata.clockSkewCorrected=!0)}}throw n}}successHandler(e,n){if(n._disableClockSkewCorrection)return;let r=Cce(e);if(r){let s=b6("config",n.config),i=n._requestSentAt,o=Ice(e);s.systemClockOffset=xce(r,s.systemClockOffset,i,o)}}},aMe=Ud});var Tx,mTt=V(()=>{p();$r();oMe();cMe();Tx=class extends Ud{async sign(e,n,r){if(!qi.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:s,signer:i,signingRegion:o,signingRegionSet:a,signingName:c}=await f2(r),l=(await s.sigv4aSigningRegionSet?.()??a??[o]).join(","),d=await s.disableClockSkewCorrection?.()===!0;return r._disableClockSkewCorrection=d,d||(r._preRequestSystemClockOffset=s.systemClockOffset,r._requestSentAt=Date.now()),await i.sign(e,{signingDate:d?new Date:E6(s.systemClockOffset),signingRegion:l,signingService:c})}}});var lMe,fTt=V(()=>{p();lMe=t=>typeof t=="string"&&t.length>0?t.split(",").map(e=>e.trim()):[]});var wce,uMe=V(()=>{p();wce=t=>`AWS_BEARER_TOKEN_${t.replace(/[\s-]/g,"_").toUpperCase()}`});var gTt,ATt,r_,yTt=V(()=>{p();fTt();uMe();gTt="AWS_AUTH_SCHEME_PREFERENCE",ATt="auth_scheme_preference",r_={environmentVariableSelector:(t,e)=>{if(e?.signingName&&wce(e.signingName)in t)return["httpBearerAuth"];if(gTt in t)return lMe(t[gTt])},configFileSelector:t=>{if(ATt in t)return lMe(t[ATt])},default:[]}});var _6,S6,ETt=V(()=>{p();vp();Jo();_6=t=>(t.sigv4aSigningRegionSet=jy(t.sigv4aSigningRegionSet),t),S6={environmentVariableSelector(t){if(t.AWS_SIGV4A_SIGNING_REGION_SET)return t.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map(e=>e.trim());throw new Vg("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(t){if(t.sigv4a_signing_region_set)return(t.sigv4a_signing_region_set??"").split(",").map(e=>e.trim());throw new Vg("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0}});var SMe=ee(xi=>{p();var{hasOwn:A2,fromUtf8:bTt,fromHex:Yir,toHex:yB,toUint8Array:C6,isArrayBuffer:Kir}=(js(),Un(xx)),{normalizeProvider:_Tt}=(Is(),Un(oB)),{escapeUri:Tce,HttpRequest:xTt}=($r(),Un(qy)),dMe=class{format(e){let n=[];for(let i in e){if(!A2(e,i))continue;let o=bTt(i);n.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(e[i]))}let r=new Uint8Array(n.reduce((i,o)=>i+o.byteLength,0)),s=0;for(let i of n)r.set(i,s),s+=i.byteLength;return r}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let n=new DataView(new ArrayBuffer(3));return n.setUint8(0,3),n.setInt16(1,e.value,!1),new Uint8Array(n.buffer);case"integer":let r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,e.value,!1),new Uint8Array(r.buffer);case"long":let s=new Uint8Array(9);return s[0]=5,s.set(e.value.bytes,1),s;case"binary":let i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);let o=new Uint8Array(i.buffer);return o.set(e.value,3),o;case"string":let a=bTt(e.value),c=new DataView(new ArrayBuffer(3+a.byteLength));c.setUint8(0,7),c.setUint16(1,a.byteLength,!1);let u=new Uint8Array(c.buffer);return u.set(a,3),u;case"timestamp":let l=new Uint8Array(9);return l[0]=8,l.set(pMe.fromNumber(e.value.valueOf()).bytes,1),l;case"uuid":if(!zir.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let d=new Uint8Array(17);return d[0]=9,d.set(Yir(e.value.replace(/-/g,"")),1),d}}},STt;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(STt||(STt={}));var zir=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,pMe=class t{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let n=new Uint8Array(8);for(let r=7,s=Math.abs(Math.round(e));r>-1&&s>0;r--,s/=256)n[r]=s;return e<0&&CTt(n),new t(n)}valueOf(){let e=this.bytes.slice(0),n=e[0]&128;return n&&CTt(e),parseInt(yB(e),16)*(n?-1:1)}toString(){return String(this.valueOf())}};function CTt(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}var wTt="X-Amz-Algorithm",TTt="X-Amz-Credential",gMe="X-Amz-Date",vTt="X-Amz-SignedHeaders",RTt="X-Amz-Expires",AMe="X-Amz-Signature",yMe="X-Amz-Security-Token",Jir="X-Amz-Region-Set",EMe="authorization",bMe=gMe.toLowerCase(),kTt="date",NTt=[EMe,bMe,kTt],DTt=AMe.toLowerCase(),Dce="x-amz-content-sha256",BTt=yMe.toLowerCase(),Xir="host",PTt={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},OTt=/^proxy-/,MTt=/^sec-/,Zir=[/^proxy-/i,/^sec-/i],vce="AWS4-HMAC-SHA256",eor="AWS4-ECDSA-P256-SHA256",LTt="AWS4-HMAC-SHA256-PAYLOAD",FTt="UNSIGNED-PAYLOAD",QTt=50,_Me="aws4_request",UTt=3600*24*7,$Tt=({query:t={}})=>{let e=[],n={};for(let r in t){if(!A2(t,r)||r.toLowerCase()===DTt)continue;let s=Tce(r);e.push(s);let i=t[r];typeof i=="string"?n[s]=`${s}=${Tce(i)}`:Array.isArray(i)&&(n[s]=i.slice(0).reduce((o,a)=>o.concat([`${s}=${Tce(a)}`]),[]).sort().join("&"))}return e.sort().map(r=>n[r]).filter(r=>r).join("&")},tor=t=>nor(t).toISOString().replace(/\.\d{3}Z$/,"Z"),nor=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t,Bce=class{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:n,region:r,service:s,sha256:i,uriEscapePath:o=!0}){this.service=s,this.sha256=i,this.uriEscapePath=o,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=_Tt(r),this.credentialProvider=_Tt(n)}createCanonicalRequest(e,n,r){let s=Object.keys(n).sort();return`${e.method} +`)}d.push(null)}catch(m){d.destroy(m)}}),d}var a2t,l2t=v(()=>{p();a2t=require("node:stream");o2t();O_()});async function u2t(t,e){let n=0,r=[],i=t.getReader(),s=!1;for(;!s;){let{done:c,value:u}=await i.read();if(u&&(r.push(u),n+=u?.byteLength??0),n>=e)break;s=c}i.releaseLock();let o=new Uint8Array(Math.min(e,n)),a=0;for(let c of r){if(c.byteLength>o.byteLength-a){o.set(c.subarray(0,o.byteLength-a),a);break}else o.set(c,a);a+=c.length}return o}var d2t=v(()=>{p()});var p2t,m2t,XGe,h2t=v(()=>{p();p2t=require("node:stream");Gz();d2t();O_();m2t=(t,e)=>Xd(t)?u2t(t,e):new Promise((n,r)=>{let i=new XGe;i.limit=e,t.pipe(i),t.on("error",s=>{i.end(),r(s)}),i.on("error",r),i.on("finish",function(){let s=gC(this.buffers);n(s)})}),XGe=class extends p2t.Writable{buffers=[];limit=1/0;bytesBuffered=0;_write(e,n,r){if(this.buffers.push(e),this.bytesBuffered+=e.byteLength??0,this.bytesBuffered>=this.limit){let i=this.bytesBuffered-this.limit,s=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=s.subarray(0,s.byteLength-i),this.emit("finish")}r()}}});var f2t,g2t=v(()=>{p();f2t=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)}});async function ZGe(t){return t.arrayBuffer().then(e=>new Uint8Array(e))}async function e$e(t){let e=[],n=t.getReader(),r=0;for(;;){let{done:i,value:s}=await n.read();if(s&&(e.push(s),r+=s.length),i)break}return gC(e,r)}var A2t,t$e=v(()=>{p();Gz();O_();A2t=async t=>R1(t)?ZGe(t):e$e(t)});var y2t,b2t,E2t,_2t=v(()=>{p();YGe();qUe();g2t();t$e();O_();y2t="The stream has already been transformed.",b2t=t=>{if(!E2t(t)&&!Xd(t)){let i=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${i}`)}let e=!1,n=async()=>{if(e)throw new Error(y2t);return e=!0,await A2t(t)},r=i=>{if(typeof i.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled. +If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return i.stream()};return Object.assign(t,{transformToByteArray:n,transformToString:async i=>{let s=await n();if(i==="base64")return pme(s);if(i==="hex")return p0(s);if(i===void 0||i==="utf8"||i==="utf-8")return f2t(s);if(typeof TextDecoder=="function")return new TextDecoder(i).decode(s);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(e)throw new Error(y2t);if(e=!0,E2t(t))return r(t);if(Xd(t))return t;throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},E2t=t=>typeof Blob=="function"&&t instanceof Blob});var x2t,hme,n$e,r$e=v(()=>{p();x2t=require("node:stream");Gz();t$e();O_();hme=t=>R1(t)?ZGe(t):Xd(t)?e$e(t):new Promise((e,n)=>{let r=new n$e,i=t;i.pipe(r),i.on("error",s=>{r.end(),n(s)}),r.on("error",n),r.on("finish",function(){let s=gC(this.bufferedBytes);e(s)})}),n$e=class extends x2t.Writable{bufferedBytes=[];_write(e,n,r){this.bufferedBytes.push(e),r()}}});var fme,S2t,gme,C2t=v(()=>{p();fme=require("node:stream");C1();_2t();r$e();S2t="The stream has already been transformed.",gme=t=>{if(!(t instanceof fme.Readable))try{return b2t(t)}catch{let i=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${i}`)}let e=!1,n=async()=>{if(e)throw new Error(S2t);return e=!0,await hme(t)};return Object.assign(t,{transformToByteArray:n,transformToString:async r=>{let i=await n();return r===void 0||Buffer.isEncoding(r)?M_(i.buffer,i.byteOffset,i.byteLength).toString(r):new TextDecoder(r).decode(i)},transformToWebStream:()=>{if(e)throw new Error(S2t);if(t.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof fme.Readable.toWeb!="function")throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return e=!0,fme.Readable.toWeb(t)}})}});async function I2t(t){return typeof t.stream=="function"&&(t=t.stream()),t.tee()}var w2t=v(()=>{p()});async function T2t(t){if(Xd(t)||R1(t))return I2t(t);let e=new i$e.PassThrough,n=new i$e.PassThrough;return t.pipe(e),t.pipe(n),[e,n]}var i$e,v2t=v(()=>{p();i$e=require("node:stream");w2t();O_()});var k1={};br(k1,{ChecksumStream:()=>AW,Hash:()=>lme,LazyJsonString:()=>xd,NumericValue:()=>co,Uint8ArrayBlobAdapter:()=>uO,_parseEpochTimestamp:()=>T1,_parseRfc3339DateTimeWithOffset:()=>Ipe,_parseRfc7231DateTime:()=>wpe,calculateBodyLength:()=>fC,concatBytes:()=>gC,copyDocumentWithTransform:()=>HPt,createBufferedReadable:()=>r2t,createChecksumStream:()=>XLt,dateToUtcString:()=>py,deserializerMiddleware:()=>kpe,deserializerMiddlewareOption:()=>HGe,expectBoolean:()=>VPt,expectByte:()=>ype,expectFloat32:()=>Fz,expectInt:()=>YPt,expectInt32:()=>gpe,expectLong:()=>nW,expectNonNull:()=>zPt,expectNumber:()=>tW,expectObject:()=>OUe,expectShort:()=>Ape,expectString:()=>KPt,expectUnion:()=>bpe,fromArrayBuffer:()=>M_,fromBase64:()=>gu,fromHex:()=>Rpe,fromString:()=>S1,fromUtf8:()=>Jd,generateIdempotencyToken:()=>yy,getAwsChunkedEncodingStream:()=>c2t,getSerdePlugin:()=>FLt,handleFloat:()=>XPt,hasOwn:()=>Ti,headStream:()=>m2t,isArrayBuffer:()=>mpe,isBlob:()=>R1,isReadableStream:()=>Xd,limitedParseDouble:()=>xpe,limitedParseFloat:()=>ZPt,limitedParseFloat32:()=>eMt,logger:()=>rW,nv:()=>vpe,parseBoolean:()=>jPt,parseEpochTimestamp:()=>aW,parseRfc3339DateTime:()=>iMt,parseRfc3339DateTimeWithOffset:()=>oW,parseRfc7231DateTime:()=>w1,quoteHeader:()=>Cpe,sdkStreamMixin:()=>gme,serializerMiddleware:()=>cme,serializerMiddlewareOption:()=>qGe,splitEvery:()=>Tpe,splitHeader:()=>cW,splitStream:()=>T2t,streamCollector:()=>hme,strictParseByte:()=>Spe,strictParseDouble:()=>Qz,strictParseFloat:()=>JPt,strictParseFloat32:()=>_pe,strictParseInt:()=>nMt,strictParseInt32:()=>rMt,strictParseLong:()=>LUe,strictParseShort:()=>I1,toBase64:()=>vc,toHex:()=>p0,toUint8Array:()=>wf,toUtf8:()=>$l,v4:()=>yW});var R2t,uO,BPr,yW,yy,Mi=v(()=>{p();R2t=require("node:crypto");FPt();PUe();UPt();hpe();GPt();WPt();qPt();sMt();oMt();FUe();aMt();uMt();dMt();pMt();hMt();qUe();gMt();jUe();Gz();C1();DUe();YUe();QLt();WGe();GLt();jGe();ZLt();i2t();l2t();h2t();C2t();v2t();O_();r$e();ps();uO=class extends QPt($l,Jd,vc,gu){},BPr=R2t.getRandomValues,yW=$Pt(BPr),yy=yW});var wm,Ame=v(()=>{p();Mi();wm=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return uO.mutate(t);if(!t)return uO.mutate(new Uint8Array);let n=e.streamCollector(t);return uO.mutate(await n)}});function L_(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}var yme=v(()=>{p()});var Dp,EW=v(()=>{p();Dp=class{serdeContext;setSerdeContext(e){this.serdeContext=e}}});async function Eme(t,e,n=1024*1024){let r=t.size,i=0;for(;i{p()});var k2t,B2t=v(()=>{p();s$e();k2t=async function(e,n){let r=new e;return await Eme(n,i=>{r.update(i)}),r.digest()}});var N2t,bW,o$e=v(()=>{p();N2t=require("node:stream");Mi();bW=class extends N2t.Writable{hash;constructor(e,n){super(n),this.hash=e}_write(e,n,r){try{this.hash.update(wf(e))}catch(i){return r(i)}r()}}});var D2t,P2t,NPr,M2t=v(()=>{p();D2t=require("node:fs");o$e();P2t=(t,e)=>new Promise((n,r)=>{if(!NPr(e)){r(new Error("Unable to calculate hash for non-file streams."));return}let i=(0,D2t.createReadStream)(e.path,{start:e.start,end:e.end}),s=new t,o=new bW(s);i.pipe(o),i.on("error",a=>{o.end(),r(a)}),o.on("error",r),o.on("finish",function(){s.digest().then(n).catch(r)})}),NPr=t=>typeof t.path=="string"});var O2t,L2t=v(()=>{p();o$e();O2t=(t,e)=>{if(e.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");let n=new t,r=new bW(n);return e.pipe(r),new Promise((i,s)=>{e.on("error",o=>{r.end(),s(o)}),r.on("error",s),r.on("finish",()=>{n.digest().then(i).catch(s)})})}});function a$e(t,e){let n=t[0],r=t[1],i=t[2],s=t[3];for(let o=0;o<64;++o){let a,c;o<16?(a=r&i|~r&s,c=o):o<32?(a=s&r|i&~s,c=(5*o+1)%16):o<48?(a=r^i^s,c=(3*o+5)%16):(a=i^(r|~s),c=7*o%16);let u=e.getUint32(c*4,!0),l=s;s=i,i=r;let d=DPr[(o>>4)*4+(o&3)],m=(n+a&B1)+(u+PPr[o]&B1)&B1;r=r+((m<>>32-d)>>>0)&B1,n=l}t[0]=t[0]+n&B1,t[1]=t[1]+r&B1,t[2]=t[2]+i&B1,t[3]=t[3]+s&B1}var _W,F2t,B1,DPr,PPr,c$e=v(()=>{p();Mi();_W=class{digestLength=16;state=Uint32Array.from(F2t);writeBuffer=new DataView(new ArrayBuffer(64));bufferLength=0;bytesHashed=0;update(e){let n=wf(e),r=0,i=n.byteLength;for(this.bytesHashed+=i;i>0;)this.writeBuffer.setUint8(this.bufferLength++,n[r++]),--i,this.bufferLength===64&&(a$e(this.state,this.writeBuffer),this.bufferLength=0)}async digest(){let e=Uint32Array.from(this.state),n=new DataView(this.writeBuffer.buffer.slice(0)),r=this.bufferLength,i=this.bytesHashed*8;if(n.setUint8(r++,128),this.bufferLength%64>=56){for(let a=r;a<64;++a)n.setUint8(a,0);a$e(e,n),r=0}for(let a=r;a<56;++a)n.setUint8(a,0);n.setUint32(56,i>>>0,!0),n.setUint32(60,Math.floor(i/2**32),!0),a$e(e,n);let s=new Uint8Array(16),o=new DataView(s.buffer);for(let a=0;a<4;++a)o.setUint32(a*4,e[a],!0);return s}reset(){this.state.set(F2t),this.writeBuffer=new DataView(new ArrayBuffer(64)),this.bufferLength=0,this.bytesHashed=0}},F2t=[1732584193,4023233417,2562383102,271733878],B1=4294967295,DPr=Uint8Array.of(7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21),PPr=Array.from({length:64},(t,e)=>Math.abs(Math.sin(e+1))*2**32>>>0)});function OPr(){return class{digestLength=16;hash=(0,bme.createHash)("md5");update(e){this.hash.update(wf(e))}async digest(){let e=this.hash.copy().digest();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}reset(){this.hash=(0,bme.createHash)("md5")}}}var bme,MPr,l$e,Q2t=v(()=>{p();bme=require("node:crypto");Mi();c$e();MPr=(()=>{try{return(0,bme.createHash)("md5"),!0}catch{return!1}})(),l$e=MPr?OPr():_W});var U2t,u$e,xW,d$e=v(()=>{p();U2t=new Uint32Array(256);for(let t=0;t<256;++t){let e=t;for(let n=0;n<8;++n)e=e&1?3988292384^e>>>1:e>>>1;U2t[t]=e>>>0}u$e=4294967295,xW=class{digestLength=4;checksum=u$e;update(e){for(let n=0;n>>8^U2t[(this.checksum^e[n])&255]}digestSync(){return(this.checksum^u$e)>>>0}async digest(){let e=this.digestSync(),n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!1),n}reset(){this.checksum=u$e}}});function LPr(t){return class{digestLength=4;value=0;update(n){this.value=t(n,this.value)}digestSync(){return this.value>>>0}async digest(){let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,this.digestSync(),!1),n}reset(){this.value=0}}}var p$e,G2t,dO,$2t=v(()=>{p();p$e=Ot(require("node:zlib"));d$e();G2t=typeof p$e.crc32=="function"?p$e.crc32:void 0,dO=G2t?LPr(G2t):xW});var Tm,W2t,FPr,VT,H2t,QPr,_me=v(()=>{p();Mi();Tm=64,W2t=32,FPr=2**53-1,VT=class t{digestLength=W2t;state=Int32Array.from(H2t);w;buffer=new Uint8Array(64);bufferLength=0;bytesHashed=0;finished=!1;inner;outer;constructor(e){if(e){let n=t.normalizeKey(e);this.inner=new t,this.outer=new t;let{inner:r,outer:i}=this,s=new Uint8Array(Tm*2);for(let o=0;oFPr)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;i>0;)this.buffer[this.bufferLength++]=n[r++],i--,this.bufferLength===Tm&&(this.hashBuffer(),this.bufferLength=0)}async digest(){let{inner:e,outer:n}=this;if(e&&n){if(this.finished)throw new Error("Attempted to digest an already finished HMAC.");this.finished=!0;let r=e.digestSync();return n.update(r),n.digestSync()}return this.digestSync()}reset(){this.state=Int32Array.from(H2t),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0}digestSync(){let e=this.state.slice(),n=this.buffer.slice(),r=this.bufferLength,i=this.bytesHashed*8,s=new DataView(n.buffer,n.byteOffset,n.byteLength);if(s.setUint8(r++,128),(r-1)%Tm>=Tm-8){for(let a=r;a>>24&255,o[a*4+1]=e[a]>>>16&255,o[a*4+2]=e[a]>>>8&255,o[a*4+3]=e[a]>>>0&255;return o}static normalizeKey(e){let n=wf(e);if(n.byteLength>Tm){let r=new t;r.update(n);let i=r.digestSync(),s=new Uint8Array(Tm);return s.set(i),s}if(n.byteLength>>17|g<<15)^(g>>>19|g<<13)^g>>>10;g=r[m-15];let y=(g>>>7|g<<25)^(g>>>18|g<<14)^g>>>3;r[m]=(A+r[m-7]|0)+(y+r[m-16]|0)}let h=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&u^~c&l)|0)+(d+(QPr[m]+r[m]|0)|0)|0,f=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&s^i&o^s&o)|0;d=l,l=u,u=c,c=a+h|0,a=o,o=s,s=i,i=h+f|0}e[0]+=i,e[1]+=s,e[2]+=o,e[3]+=a,e[4]+=c,e[5]+=u,e[6]+=l,e[7]+=d}},H2t=new Int32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),QPr=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])});function GPr(){return class{digestLength=32;secret;hash;isHmac;finished=!1;constructor(e){this.secret=e,this.isHmac=!!e,this.hash=this.createHash()}update(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");this.hash.update(e)}async digest(){let e;return this.isHmac?(this.finished=!0,e=this.hash.digest()):e=this.hash.copy().digest(),new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}reset(){this.hash=this.createHash(),this.finished=!1}createHash(){return this.secret?(0,Zz.createHmac)("sha256",$Pr(this.secret)):(0,Zz.createHash)("sha256")}}}function $Pr(t){return typeof t=="string"?t:ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):Buffer.from(t)}var Zz,UPr,F_,q2t=v(()=>{p();Zz=require("node:crypto");_me();UPr=(()=>{try{return(0,Zz.createHash)("sha256"),!0}catch{return!1}})(),F_=UPr?GPr():VT});var WPr,HPr,qPr,xme,jPr,Sme,j2t=v(()=>{p();Mi();_me();({digest:WPr,sign:HPr,importKey:qPr}=globalThis?.crypto?.subtle??{}),xme=typeof WPr=="function"&&typeof HPr=="function"&&typeof qPr=="function"?globalThis.crypto.subtle:void 0,jPr=8*1024*1024,Sme=class{digestLength=32;secret;pending=[];pendingBytes=0;fallback;finished=!1;constructor(e){e&&(this.secret=wf(e))}update(e){if(this.finished)throw new Error("Attempted to update an already finished HMAC.");if(this.fallback){this.fallback.update(e);return}this.pending.push(e.slice()),this.pendingBytes+=e.byteLength,this.pendingBytes>=jPr&&this.switchToFallback()}async digest(){if(this.fallback)return this.fallback.digest();if(this.secret&&this.finished)throw new Error("Attempted to digest an already finished HMAC.");let e=gC(this.pending);if(xme){if(this.secret){this.finished=!0;let i=await xme.importKey("raw",this.secret,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),s=await xme.sign("HMAC",i,e);return new Uint8Array(s)}let r=await xme.digest("SHA-256",e);return new Uint8Array(r)}let n=new VT(this.secret);return n.update(e),n.digest()}reset(){this.pending=[],this.pendingBytes=0,this.fallback=void 0,this.finished=!1}switchToFallback(){let e=new VT(this.secret);for(let n of this.pending)e.update(n);this.fallback=e,this.pending=[],this.pendingBytes=0}}});var V2t={};br(V2t,{Crc32:()=>dO,Crc32Js:()=>xW,Crc32Node:()=>dO,Md5:()=>l$e,Md5Js:()=>_W,Md5Node:()=>l$e,Sha256:()=>F_,Sha256Js:()=>VT,Sha256Node:()=>F_,Sha256WebCrypto:()=>Sme,blobHasher:()=>k2t,blobReader:()=>Eme,fileStreamHasher:()=>P2t,readableStreamHasher:()=>O2t});var N1=v(()=>{p();B2t();M2t();L2t();c$e();Q2t();d$e();$2t();_me();q2t();j2t();s$e()});function Y2t(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}var D1,m$e=v(()=>{p();Mi();D1=class t{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let n=new Uint8Array(8);for(let r=7,i=Math.abs(Math.round(e));r>-1&&i>0;r--,i/=256)n[r]=i;return e<0&&Y2t(n),new t(n)}valueOf(){let e=this.bytes.slice(0),n=e[0]&128;return n&&Y2t(e),parseInt(p0(e),16)*(n?-1:1)}toString(){return String(this.valueOf())}}});var SW,z2t,K2t,VPr,YPr,zPr,KPr,JPr,XPr,ZPr,eMr,tMr,h$e=v(()=>{p();ps();Mi();m$e();SW=class{toUtf8;fromUtf8;constructor(e,n){this.toUtf8=e,this.fromUtf8=n}format(e){let n=[];for(let s in e){if(!Ti(e,s))continue;let o=this.fromUtf8(s);n.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(e[s]))}let r=new Uint8Array(n.reduce((s,o)=>s+o.byteLength,0)),i=0;for(let s of n)r.set(s,i),i+=s.byteLength;return r}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let n=new DataView(new ArrayBuffer(3));return n.setUint8(0,3),n.setInt16(1,e.value,!1),new Uint8Array(n.buffer);case"integer":let r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,e.value,!1),new Uint8Array(r.buffer);case"long":let i=new Uint8Array(9);return i[0]=5,i.set(e.value.bytes,1),i;case"binary":let s=new DataView(new ArrayBuffer(3+e.value.byteLength));s.setUint8(0,6),s.setUint16(1,e.value.byteLength,!1);let o=new Uint8Array(s.buffer);return o.set(e.value,3),o;case"string":let a=this.fromUtf8(e.value),c=new DataView(new ArrayBuffer(3+a.byteLength));c.setUint8(0,7),c.setUint16(1,a.byteLength,!1);let u=new Uint8Array(c.buffer);return u.set(a,3),u;case"timestamp":let l=new Uint8Array(9);return l[0]=8,l.set(D1.fromNumber(e.value.valueOf()).bytes,1),l;case"uuid":if(!tMr.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let d=new Uint8Array(17);return d[0]=9,d.set(Rpe(e.value.replace(/-/g,"")),1),d}}parse(e){let n={},r=0;for(;r{p();N1();J2t=4,P1=J2t*2,pO=4,nMr=P1+pO*2});var CW,f$e=v(()=>{p();N1();h$e();Z2t();CW=class{headerMarshaller;messageBuffer;isEndOfStream;constructor(e,n){this.headerMarshaller=new SW(e,n),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){let e=this.messageBuffer.pop(),n=this.isEndOfStream;return{getMessage(){return e},isEndOfStream(){return n}}}getAvailableMessages(){let e=this.messageBuffer;this.messageBuffer=[];let n=this.isEndOfStream;return{getMessages(){return e},isEndOfStream(){return n}}}encode({headers:e,body:n}){let r=this.headerMarshaller.format(e),i=r.byteLength+n.byteLength+16,s=new Uint8Array(i),o=new DataView(s.buffer,s.byteOffset,s.byteLength),a=new dO;return o.setUint32(0,i,!1),o.setUint32(4,r.byteLength,!1),a.update(s.subarray(0,8)),o.setUint32(8,a.digestSync(),!1),s.set(r,12),s.set(n,r.byteLength+12),a.update(s.subarray(8,i-4)),o.setUint32(i-4,a.digestSync(),!1),s}decode(e){let{headers:n,body:r}=X2t(e);return{headers:this.headerMarshaller.parse(n),body:r}}formatHeaders(e){return this.headerMarshaller.format(e)}}});var IW,g$e=v(()=>{p();IW=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.decoder.decode(e)}}});var wW,A$e=v(()=>{p();wW=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream)yield this.options.encoder.encode(e);this.options.includeEndFrame&&(yield new Uint8Array(0))}}});var TW,y$e=v(()=>{p();TW=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream){let n=await this.options.deserializer(e);n!==void 0&&(yield n)}}}});var vW,E$e=v(()=>{p();vW=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.serializer(e)}}});function Cme(t){let e=0,n=0,r=null,i=null,s=a=>{if(typeof a!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+a);e=a,n=4,r=new Uint8Array(a),new DataView(r.buffer).setUint32(0,a,!1)},o=async function*(){let a=t[Symbol.asyncIterator]();for(;;){let{value:c,done:u}=await a.next();if(u){if(e)if(e===n)yield r;else throw new Error("Truncated event message received.");else return;return}let l=c.length,d=0;for(;d{p()});function eFt(t,e){let n=e7(e.deserializer,e.toUtf8);return{[Symbol.asyncIterator]:async function*(){for await(let r of t){let i=e.eventStreamCodec.decode(r),s=await n(i);s!==void 0&&(yield s)}}}}function e7(t,e){return async function(n){let{value:r}=n.headers[":message-type"];if(r==="error"){let i=new Error(n.headers[":error-message"].value||"UnknownError");throw i.name=n.headers[":error-code"].value,i}else if(r==="exception"){let i=n.headers[":exception-type"].value,s={[i]:n},o=await t(s);if(o.$unknown){let a=new Error(e(n.body));throw a.name=i,a}throw o[i]}else if(r==="event"){let i={[n.headers[":event-type"].value]:n},s=await t(i);return s.$unknown?void 0:s}else throw Error(`Unrecognizable event type: ${n.headers[":event-type"].value}`)}}var _$e=v(()=>{p()});var mO,tFt,x$e=v(()=>{p();f$e();g$e();A$e();y$e();E$e();b$e();_$e();mO=class{eventStreamCodec;utfEncoder;constructor({utf8Encoder:e,utf8Decoder:n}){this.eventStreamCodec=new CW(e,n),this.utfEncoder=e}deserialize(e,n){let r=Cme(e);return new TW({messageStream:new IW({inputStream:r,decoder:this.eventStreamCodec}),deserializer:e7(n,this.utfEncoder)})}serialize(e,n){return new wW({messageStream:new vW({inputStream:e,serializer:n}),encoder:this.eventStreamCodec,includeEndFrame:!0})}},tFt=t=>new mO(t)});async function*rMr(t){let e=!1,n=!1,r=new Array;for(t.on("error",i=>{if(e||(e=!0),i)throw i}),t.on("data",i=>{r.push(i)}),t.on("end",()=>{e=!0});!n;){let i=await new Promise(s=>setTimeout(()=>s(r.shift()),0));i&&(yield i),n=e&&r.length===0}}var nFt,t7,rFt,iFt=v(()=>{p();nFt=require("node:stream");x$e();t7=class{universalMarshaller;constructor({utf8Encoder:e,utf8Decoder:n}){this.universalMarshaller=new mO({utf8Decoder:n,utf8Encoder:e})}deserialize(e,n){let r=typeof e[Symbol.asyncIterator]=="function"?e:rMr(e);return this.universalMarshaller.deserialize(r,n)}serialize(e,n){return nFt.Readable.from(this.universalMarshaller.serialize(e,n))}},rFt=t=>new t7(t)});var sFt,oFt,aFt=v(()=>{p();sFt=t=>({[Symbol.asyncIterator]:async function*(){let e=t.getReader();try{for(;;){let{done:n,value:r}=await e.read();if(n)return;yield r}}finally{e.releaseLock()}}}),oFt=t=>{let e=t[Symbol.asyncIterator]();return new ReadableStream({async pull(n){let{done:r,value:i}=await e.next();if(r)return n.close();n.enqueue(i)}})}});var cFt,lFt=v(()=>{p();cFt=t=>Object.assign(t,{eventStreamMarshaller:t.eventStreamSerdeProvider(t)})});var Ime,uFt=v(()=>{p();ps();bo();Mi();Ime=class{marshaller;serializer;deserializer;serdeContext;defaultContentType;compositeErrorRegistry;constructor({marshaller:e,serializer:n,deserializer:r,serdeContext:i,defaultContentType:s,compositeErrorRegistry:o}){this.marshaller=e,this.serializer=n,this.deserializer=r,this.serdeContext=i,this.defaultContentType=s,this.compositeErrorRegistry=o}async serializeEventStream({eventStream:e,requestSchema:n,initialRequest:r,initialMessageType:i}){let s=this.marshaller,o=n.getEventStreamMember(),a=n.getMemberSchema(o),c=this.serializer,u=this.defaultContentType,l=Symbol("initialRequestMarker"),d={async*[Symbol.asyncIterator](){if(r){let m={":event-type":{type:"string",value:i??"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:u}};c.write(n,r);let h=c.flush();yield{[l]:!0,headers:m,body:h}}for await(let m of e)yield m}};return s.serialize(d,m=>{if(m[l])return{headers:m.headers,body:m.body};let h="";for(let _ in m)if(Ti(m,_)&&_!=="__type"){h=_;break}let{additionalHeaders:f,body:g,eventType:A,explicitPayloadContentType:y}=this.writeEventBody(h,a,m);return{headers:{":event-type":{type:"string",value:A},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:y??u},...f},body:g}})}async deserializeEventStream({response:e,responseSchema:n,initialResponseContainer:r,initialMessageType:i}){let s=this.marshaller,o=n.getEventStreamMember(),c=n.getMemberSchema(o).getMemberSchemas(),u=Symbol("initialResponseMarker"),l=s.deserialize(e.body,async h=>{let f="";for(let A in h)if(Ti(h,A)&&A!=="__type"){f=A;break}let g=h[f].body;if(f===(i??"initial-response")){let A=await this.deserializer.read(n,g);return delete A[o],{[u]:!0,...A}}else if(f in c){let A=c[f];if(A.isStructSchema()){let y={},E=!1;for(let[_,S]of A.structIterator()){let{eventHeader:C,eventPayload:I}=S.getMergedTraits();if(E=E||!!(C||I),I)S.isBlobSchema()?y[_]=g:S.isStringSchema()?y[_]=(this.serdeContext?.utf8Encoder??$l)(g):S.isStructSchema()&&(y[_]=await this.deserializer.read(S,g));else if(C){let w=h[f].headers[_]?.value;w!=null&&(S.isNumericSchema()?w&&typeof w=="object"&&"bytes"in w?y[_]=BigInt(w.toString()):y[_]=Number(w):y[_]=w)}}return{[f]:await this.readEventMember(A,g,E,y)}}return{[f]:await this.deserializer.read(A,g)}}else return{$unknown:h}}),d=l[Symbol.asyncIterator](),m=await d.next();if(m.done)return l;if(m.value?.[u]){if(!n)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(let h in m.value)Ti(m.value,h)&&(r[h]=m.value[h])}return{async*[Symbol.asyncIterator](){for(m?.value?.[u]||(yield m.value);;){let{done:h,value:f}=await d.next();if(h)break;yield f}}}}async readEventMember(e,n,r,i){let s,o=e.getSchema();if(Array.isArray(o)&&o[0]===-3){let c=o[1],u=Tc.for(c);this.compositeErrorRegistry?.copyFrom(u),s=(this.compositeErrorRegistry??u)?.getErrorCtor(o)}let a=r?i:n.byteLength===0?{}:await this.deserializer.read(e,n);if(s){let c=a.message??a.Message??"Unknown",u={},l=e.getMergedTraits().error;return l&&(u.$fault=l),Object.assign(new s({}),u,{message:c},a)}return a}writeEventBody(e,n,r){let i=this.serializer,s=e,o=null,a,c=n.getSchema()[4].includes(e),u={};if(c){let m=n.getMemberSchema(e);if(m.isStructSchema()){for(let[h,f]of m.structIterator()){let{eventHeader:g,eventPayload:A}=f.getMergedTraits();if(A)o=h;else if(g){let y=r[e][h],E="binary";f.isNumericSchema()?(-2)**31<=y&&y<=2**31-1?E="integer":E="long":f.isTimestampSchema()?E="timestamp":f.isStringSchema()?E="string":f.isBooleanSchema()&&(E="boolean"),y!=null&&(u[h]={type:E,value:y},delete r[e][h])}}if(o!==null){let h=m.getMemberSchema(o);h.isBlobSchema()?a="application/octet-stream":h.isStringSchema()&&(a="text/plain"),i.write(h,r[e][o])}else i.write(m,r[e])}else if(m.isUnitSchema())i.write(m,{});else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{let[m,h]=r[e];s=m,i.write(15,h)}let l=i.flush()??new Uint8Array;return{body:typeof l=="string"?(this.serdeContext?.utf8Decoder??Jd)(l):l,eventType:s,explicitPayloadContentType:a,additionalHeaders:u}}}});var n7={};br(n7,{EventStreamCodec:()=>CW,EventStreamMarshaller:()=>t7,EventStreamSerde:()=>Ime,HeaderMarshaller:()=>SW,Int64:()=>D1,MessageDecoderStream:()=>IW,MessageEncoderStream:()=>wW,SmithyMessageDecoderStream:()=>TW,SmithyMessageEncoderStream:()=>vW,UniversalEventStreamMarshaller:()=>mO,eventStreamSerdeProvider:()=>rFt,getChunkedStream:()=>Cme,getMessageUnmarshaller:()=>e7,getUnmarshalledStream:()=>eFt,iterableToReadableStream:()=>oFt,readableStreamToIterable:()=>sFt,resolveEventStreamSerdeConfig:()=>cFt,universalEventStreamSerdeProvider:()=>tFt});var r7=v(()=>{p();f$e();h$e();m$e();g$e();A$e();y$e();E$e();iFt();aFt();x$e();b$e();_$e();lFt();uFt()});var M1,wme=v(()=>{p();ps();bo();ps();EW();M1=class extends Dp{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=Tc.for(e.defaultNamespace);for(let n of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(n)}getRequestType(){return no}getResponseType(){return Bp}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,n){if("url"in n){e.protocol=n.url.protocol,e.hostname=n.url.hostname,e.port=n.url.port?Number(n.url.port):void 0,e.path=n.url.pathname,e.fragment=n.url.hash||void 0,e.username=n.url.username||void 0,e.password=n.url.password||void 0,e.query||(e.query={});for(let[r,i]of n.url.searchParams.entries())e.query[r]=i;if(n.headers)for(let r in n.headers)Ti(n.headers,r)&&(e.headers[r]=n.headers[r].join(", "));return e}else{if(e.protocol=n.protocol,e.hostname=n.hostname,e.port=n.port?Number(n.port):void 0,e.path=n.path,e.query={...n.query},n.headers)for(let r in n.headers)Ti(n.headers,r)&&(e.headers[r]=n.headers[r]);return e}}setHostPrefix(e,n,r){if(this.serdeContext?.disableHostPrefix)return;let i=jn.of(n.input),s=D_(n.traits??{});if(s.endpoint){let o=s.endpoint?.[0];if(typeof o=="string"){for(let[a,c]of i.structIterator()){if(!c.getMergedTraits().hostLabel)continue;let u=r[a];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${a} in input must be a string as hostLabel.`);o=o.replace(`{${a}}`,u)}if(e.hostname=o+e.hostname,!Tz(e.hostname))throw new Error(`[${e.hostname}] is not a valid hostname.`)}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:n,initialRequest:r}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:n,initialRequest:r})}async deserializeEventStream({response:e,responseSchema:n,initialResponseContainer:r}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:n,initialResponseContainer:r})}async loadEventStreamCapability(){let{EventStreamSerde:e,eventStreamSerdeProvider:n}=await Promise.resolve().then(()=>(r7(),n7)),r=this.resolveEventStreamMarshaller(n);return new e({marshaller:r,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType(),compositeErrorRegistry:this.compositeErrorRegistry})}resolveEventStreamMarshaller(e){let n=this.serdeContext;return n.eventStreamMarshaller?n.eventStreamMarshaller:e(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,n,r,i,s){return[]}getEventStreamMarshaller(){let e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}});var O1,dFt=v(()=>{p();ps();bo();Mi();ps();wme();Ame();yme();O1=class extends M1{async serializeRequest(e,n,r){let i=n&&typeof n=="object"?n:{},s=this.serializer,o={},a={},c=await r.endpoint(),u=jn.of(e?.input),l=[],d=[],m=!1,h,f=new no({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:o,headers:a,body:void 0});if(c){this.updateServiceEndpoint(f,c),this.setHostPrefix(f,e,i);let g=D_(e.traits);if(g.http){f.method=g.http[0];let[A,y]=g.http[1].split("?");f.path=="/"?f.path=A:f.path+=A;let E=new URLSearchParams(y??"");for(let[_,S]of E)o[_]=S}}for(let[g,A]of u.structIterator()){let y=A.getMergedTraits()??{},E=i[g];if(E==null&&!A.isIdempotencyToken()){if(y.httpLabel&&(f.path.includes(`{${g}+}`)||f.path.includes(`{${g}}`)))throw new Error(`No value provided for input HTTP label: ${g}.`);continue}if(y.httpPayload)A.isStreaming()?A.isStructSchema()?i[g]&&(h=await this.serializeEventStream({eventStream:i[g],requestSchema:u})):h=E:(s.write(A,E),h=s.flush());else if(y.httpLabel){s.write(A,E);let _=s.flush();f.path.includes(`{${g}+}`)?f.path=f.path.replace(`{${g}+}`,_.split("/").map(L_).join("/")):f.path.includes(`{${g}}`)&&(f.path=f.path.replace(`{${g}}`,L_(_)))}else if(y.httpHeader)s.write(A,E),a[y.httpHeader.toLowerCase()]=String(s.flush());else if(typeof y.httpPrefixHeaders=="string")for(let _ in E){if(!Ti(E,_))continue;let S=E[_],C=y.httpPrefixHeaders+_;s.write([A.getValueSchema(),{httpHeader:C}],S),a[C.toLowerCase()]=s.flush()}else y.httpQuery||y.httpQueryParams?this.serializeQuery(A,E,o):(m=!0,l.push(g),d.push(A))}if(m&&i){let[g,A]=(u.getName(!0)??"#Unknown").split("#"),y=u.getSchema()[6],E=[3,g,A,u.getMergedTraits(),l,d,void 0];y?E[6]=y:E.pop(),s.write(E,i),h=s.flush()}return f.headers=a,f.query=o,f.body=h,f}serializeQuery(e,n,r){let i=this.serializer,s=e.getMergedTraits();if(s.httpQueryParams){for(let o in n)if(Ti(n,o)&&!(o in r)){let a=n[o],c=e.getValueSchema();Object.assign(c.getMergedTraits(),{...s,httpQuery:o,httpQueryParams:void 0}),this.serializeQuery(c,a,r)}return}if(e.isListSchema()){let o=!!e.getMergedTraits().sparse,a=[];for(let c of n){i.write([e.getValueSchema(),s],c);let u=i.flush();(o||u!==void 0)&&a.push(u)}r[s.httpQuery]=a}else i.write([e,s],n),r[s.httpQuery]=i.flush()}async deserializeResponse(e,n,r){let i=this.deserializer,s=jn.of(e.output),o={};if(r.statusCode>=300){let c=await wm(r.body,n);throw c.byteLength>0&&Object.assign(o,await i.read(15,c)),await this.handleError(e,n,r,o,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let c in r.headers){if(!Ti(r.headers,c))continue;let u=r.headers[c];delete r.headers[c],r.headers[c.toLowerCase()]=u}let a=await this.deserializeHttpMessage(s,n,r,o);if(a.length){let c=await wm(r.body,n);if(c.byteLength>0){let u=await i.read(s,c);for(let l of a)u[l]!=null&&(o[l]=u[l])}}else a.discardResponseBody&&await wm(r.body,n);return o.$metadata=this.deserializeMetadata(r),o}async deserializeHttpMessage(e,n,r,i,s){let o;i instanceof Set?o=s:o=i;let a=!0,c=this.deserializer,u=jn.of(e),l=[];for(let[d,m]of u.structIterator()){let h=m.getMemberTraits();if(h.httpPayload){if(a=!1,m.isStreaming())m.isStructSchema()?o[d]=await this.deserializeEventStream({response:r,responseSchema:u}):o[d]=gme(r.body);else if(r.body){let g=await wm(r.body,n);g.byteLength>0&&(o[d]=await c.read(m,g))}}else if(h.httpHeader){let f=String(h.httpHeader).toLowerCase(),g=r.headers[f];if(g!=null)if(m.isListSchema()){let A=m.getValueSchema();A.getMergedTraits().httpHeader=f;let y;A.isTimestampSchema()&&A.getSchema()===4?y=Tpe(g,",",2):y=cW(g);let E=[];for(let _ of y)E.push(await c.read(A,_.trim()));o[d]=E}else o[d]=await c.read(m,g)}else if(h.httpPrefixHeaders!==void 0){o[d]={};for(let f in r.headers)if(Ti(r.headers,f)&&f.startsWith(h.httpPrefixHeaders)){let g=r.headers[f],A=m.getValueSchema();A.getMergedTraits().httpHeader=f,o[d][f.slice(h.httpPrefixHeaders.length)]=await c.read(A,g)}}else h.httpResponseCode?o[d]=r.statusCode:l.push(d)}return l.discardResponseBody=a,l}}});var CC,pFt=v(()=>{p();ps();bo();ps();wme();Ame();CC=class extends M1{async serializeRequest(e,n,r){let i=this.serializer,s={},o={},a=await r.endpoint(),c=jn.of(e?.input),u=c.getSchema(),l,d=n&&typeof n=="object"?n:{},m=new no({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:s,headers:o,body:void 0});if(a&&(this.updateServiceEndpoint(m,a),this.setHostPrefix(m,e,d)),d){let h=c.getEventStreamMember();if(h){if(d[h]){let f={};for(let[g]of c.structIterator())g!==h&&d[g]!=null&&(f[g]=d[g]);l=await this.serializeEventStream({eventStream:d[h],requestSchema:c,initialRequest:f})}}else i.write(u,d),l=i.flush()}return m.headers=Object.assign(m.headers,o),m.query=s,m.body=l,m.method="POST",m}async deserializeResponse(e,n,r){let i=this.deserializer,s=jn.of(e.output),o={};if(r.statusCode>=300){let c=await wm(r.body,n);throw c.byteLength>0&&Object.assign(o,await i.read(15,c)),await this.handleError(e,n,r,o,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let c in r.headers){if(!Ti(r.headers,c))continue;let u=r.headers[c];delete r.headers[c],r.headers[c.toLowerCase()]=u}let a=s.getEventStreamMember();if(a)o[a]=await this.deserializeEventStream({response:r,responseSchema:s,initialResponseContainer:o});else{let c=await wm(r.body,n);c.byteLength>0&&Object.assign(o,await i.read(s,c))}return o.$metadata=this.deserializeMetadata(r),o}}});var Tme,S$e=v(()=>{p();yme();Tme=(t,e,n,r,i,s)=>{if(e!=null&&e[n]!==void 0){let o=r();if(o==null||o.length<=0)throw new Error("Empty value provided for input HTTP label: "+n+".");t=t.replace(i,s?o.split("/").map(a=>L_(a)).join("/"):L_(o))}else throw new Error("No value provided for input HTTP label: "+n+".");return t}});function vme(t,e){return new i7(t,e)}var i7,mFt=v(()=>{p();ps();S$e();i7=class{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(e,n){this.input=e,this.context=n}async build(){let{hostname:e,protocol:n="https",port:r,path:i}=await this.context.endpoint();this.path=i;for(let s of this.resolvePathStack)s(this.path);return new no({protocol:n,hostname:this.hostname||e,port:r,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push(n=>{this.path=`${n?.endsWith("/")?n.slice(0,-1):n||""}`+e}),this}p(e,n,r,i){return this.resolvePathStack.push(s=>{this.path=Tme(s,this.input,e,n,r,i)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}});function Pp(t,e){if(e.timestampFormat.useTrait&&t.isTimestampSchema()&&(t.getSchema()===5||t.getSchema()===6||t.getSchema()===7))return t.getSchema();let{httpLabel:n,httpPrefixHeaders:r,httpHeader:i,httpQuery:s}=t.getMergedTraits();return(e.httpBindings?typeof r=="string"||i?6:s||n?5:void 0:void 0)??e.timestampFormat.default}var Rme=v(()=>{p()});var L1,C$e=v(()=>{p();bo();Mi();EW();Rme();L1=class extends Dp{settings;constructor(e){super(),this.settings=e}read(e,n){let r=jn.of(e);if(r.isListSchema())return cW(n).map(i=>this.read(r.getValueSchema(),i));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??gu)(n);if(r.isTimestampSchema())switch(Pp(r,this.settings)){case 5:return Ipe(n);case 6:return wpe(n);case 7:return T1(n);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",n),new Date(n)}if(r.isStringSchema()){let i=r.getMergedTraits().mediaType,s=n;if(i)return r.getMergedTraits().httpHeader&&(s=this.base64ToUtf8(s)),(i==="application/json"||i.endsWith("+json"))&&(s=xd.from(s)),s}return r.isNumericSchema()?Number(n):r.isBigIntegerSchema()?BigInt(n):r.isBigDecimalSchema()?new co(n,"bigDecimal"):r.isBooleanSchema()?String(n).toLowerCase()==="true":n}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??$l)((this.serdeContext?.base64Decoder??gu)(e))}}});var F1,hFt=v(()=>{p();bo();Mi();EW();C$e();F1=class extends Dp{codecDeserializer;stringDeserializer;constructor(e,n){super(),this.codecDeserializer=e,this.stringDeserializer=new L1(n)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,n){let r=jn.of(e),i=r.getMergedTraits(),s=this.serdeContext?.utf8Encoder??$l;if(i.httpHeader||i.httpResponseCode)return this.stringDeserializer.read(r,s(n));if(i.httpPayload){if(r.isBlobSchema()){let o=this.serdeContext?.utf8Decoder??Jd;return typeof n=="string"?o(n):n}else if(r.isStringSchema())return"byteLength"in n?s(n):n}return this.codecDeserializer.read(r,n)}}});var RW,I$e=v(()=>{p();bo();Mi();EW();Rme();RW=class extends Dp{settings;stringBuffer="";constructor(e){super(),this.settings=e}write(e,n){let r=jn.of(e);switch(typeof n){case"object":if(n===null){this.stringBuffer="null";return}if(r.isTimestampSchema()){if(!(n instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${n} when schema expected Date in ${r.getName(!0)}`);switch(Pp(r,this.settings)){case 5:this.stringBuffer=n.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=py(n);break;case 7:this.stringBuffer=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",n),this.stringBuffer=String(n.getTime()/1e3)}return}if(r.isBlobSchema()&&"byteLength"in n){this.stringBuffer=(this.serdeContext?.base64Encoder??vc)(n);return}if(r.isListSchema()&&Array.isArray(n)){let o="";for(let a of n){this.write([r.getValueSchema(),r.getMergedTraits()],a);let c=this.flush(),u=r.getValueSchema().isTimestampSchema()?c:Cpe(c);o!==""&&(o+=", "),o+=u}this.stringBuffer=o;return}this.stringBuffer=JSON.stringify(n,null,2);break;case"string":let i=r.getMergedTraits().mediaType,s=n;if(i&&((i==="application/json"||i.endsWith("+json"))&&(s=xd.from(s)),r.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??vc)(s.toString());return}this.stringBuffer=n;break;default:r.isIdempotencyToken()?this.stringBuffer=yy():this.stringBuffer=String(n)}}flush(){let e=this.stringBuffer;return this.stringBuffer="",e}}});var Q1,fFt=v(()=>{p();bo();I$e();Q1=class{codecSerializer;stringSerializer;buffer;constructor(e,n,r=new RW(n)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,n){let r=jn.of(e),i=r.getMergedTraits();if(i.httpHeader||i.httpLabel||i.httpQuery){this.stringSerializer.write(r,n),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(r,n)}flush(){if(this.buffer!==void 0){let e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}});var gFt,kme,AFt=v(()=>{p();gFt=Ot(aC()),kme=class{name;kind;values;constructor({name:e,kind:n=gFt.FieldPosition.HEADER,values:r=[]}){this.name=e,this.kind=n,this.values=r}add(e){this.values.push(e)}set(e){this.values=e}remove(e){this.values=this.values.filter(n=>n!==e)}toString(){return this.values.map(e=>e.includes(",")||e.includes(" ")?`"${e}"`:e).join(", ")}get(){return this.values}}});var Bme,yFt=v(()=>{p();Bme=class{entries={};encoding;constructor({fields:e=[],encoding:n="utf-8"}){e.forEach(this.setField.bind(this)),this.encoding=n}setField(e){this.entries[e.name.toLowerCase()]=e}getField(e){return this.entries[e.toLowerCase()]}removeField(e){delete this.entries[e.toLowerCase()]}getByType(e){return Object.values(this.entries).filter(n=>n.kind===e)}}});var IC,wC,EFt=v(()=>{p();IC=t=>(t.logger&&t.logger.constructor?.name!=="NoOpLogger"&&t.requestHandler?.updateHttpClientConfig?.(Symbol.for("logger"),t.logger),{setHttpHandler(e){t.requestHandler=e},httpHandler(){return t.requestHandler},updateHttpClientConfig(e,n){t.requestHandler?.updateHttpClientConfig(e,n)},httpHandlerConfigs(){return t.requestHandler.httpHandlerConfigs()}}),wC=t=>({requestHandler:t.httpHandler()})});function w$e(t){return e=>async n=>{let r=n.request;if(no.isInstance(r)){let{body:i,headers:s}=r;if(i&&Object.keys(s).map(o=>o.toLowerCase()).indexOf(bFt)===-1)try{let o=t(i);o!=null&&(r.headers={...r.headers,[bFt]:String(o)})}catch{}}return e({...n,request:r})}}var bFt,T$e,TC,_Ft=v(()=>{p();ps();bFt="content-length";T$e={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},TC=t=>({applyToStack:e=>{e.add(w$e(t.bodyLengthChecker),T$e)}})});var U1,iMr,Nme=v(()=>{p();U1=t=>encodeURIComponent(t).replace(/[!'()*]/g,iMr),iMr=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`});var xFt,SFt=v(()=>{p();Nme();xFt=t=>t.split("/").map(U1).join("/")});function Dme(t){let e=[];for(let n of Object.keys(t).sort()){let r=t[n];if(n=U1(n),Array.isArray(r))for(let i=0,s=r.length;i{p();Nme()});var vC={};br(vC,{Field:()=>kme,Fields:()=>Bme,FromStringShapeDeserializer:()=>L1,HttpBindingProtocol:()=>O1,HttpInterceptingShapeDeserializer:()=>F1,HttpInterceptingShapeSerializer:()=>Q1,HttpProtocol:()=>M1,HttpRequest:()=>no,HttpResponse:()=>Bp,RequestBuilder:()=>i7,RpcProtocol:()=>CC,SerdeContext:()=>Dp,ToStringShapeSerializer:()=>RW,buildQueryString:()=>Dme,collectBody:()=>wm,contentLengthMiddleware:()=>w$e,contentLengthMiddlewareOptions:()=>T$e,determineTimestampFormat:()=>Pp,escapeUri:()=>U1,escapeUriPath:()=>xFt,extendedEncodeURIComponent:()=>L_,getContentLengthPlugin:()=>TC,getHttpHandlerExtensionConfiguration:()=>IC,isValidHostname:()=>Tz,parseQueryString:()=>vz,parseUrl:()=>Cm,requestBuilder:()=>vme,resolveHttpHandlerRuntimeConfig:()=>wC,resolvedPath:()=>Tme});var ti=v(()=>{p();Ame();yme();dFt();wme();pFt();mFt();S$e();C$e();hFt();fFt();I$e();Rme();EW();AFt();yFt();ps();ps();ps();EFt();_Ft();Nme();SFt();CFt();ps();ps()});var IFt,wFt,TFt,vFt,RFt,kFt,BFt=v(()=>{p();IFt=["AccessDeniedException","AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],wFt=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],TFt=["TimeoutError","RequestTimeout","RequestTimeoutException"],vFt=[500,502,503,504],RFt=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],kFt=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"]});function k$e(t){return t.code==="ERR_HTTP2_STREAM_ERROR"&&t.message.includes("NGHTTP2_REFUSED_STREAM")}var s7,Pme,v$e,R$e,RC,G1,Mme,kW=v(()=>{p();BFt();s7=t=>t?.$retryable!==void 0,Pme=t=>IFt.includes(t.name),v$e=t=>t.$metadata?.clockSkewCorrected,R$e=t=>{let e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return t&&t instanceof TypeError?e.has(t.message):!1},RC=t=>t.$metadata?.httpStatusCode===429||wFt.includes(t.name)||t.$retryable?.throttling==!0,G1=(t,e=0)=>t?.name!=="AbortError"&&(s7(t)||v$e(t)||t.name==="InvalidSignatureException"&&t.message?.includes("Signature expired")||TFt.includes(t.name)||RFt.includes(t?.code||"")||kFt.includes(t?.code||"")||vFt.includes(t.$metadata?.httpStatusCode||0)||R$e(t)||k$e(t)||t.cause!==void 0&&e<=10&&G1(t.cause,e+1)),Mme=t=>{if(t.$metadata?.httpStatusCode!==void 0){let e=t.$metadata.httpStatusCode;return 500<=e&&e<=599&&!G1(t)}return!1}});var Ome,o7,Lme,BW,B$e,N$e,Fme,$1,W1,a7=v(()=>{p();Ome=100,o7=2e4,Lme=500,BW=500,B$e=5,N$e=10,Fme=1,$1="amz-sdk-invocation-id",W1="amz-sdk-request"});function D$e(t,e){if(Bp.isInstance(t))for(let n in t.headers){if(!Ti(t.headers,n))continue;let r=n.toLowerCase();if(r==="retry-after"){let i=t.headers[n],s=NaN;if(i.endsWith("GMT"))try{s=(w1(i).getTime()-Date.now())/1e3}catch(o){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(o)}else i.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?s=Number(i.match(/ GMT, ([\d.]+)$/)?.[1]):i.match(/^((\d+)|(\d+\.\d+))$/)?s=Number(i):Date.parse(i)>=Date.now()&&(s=(Date.parse(i)-Date.now())/1e3);return isNaN(s)?void 0:new Date(Date.now()+s*1e3)}else if(r==="x-amz-retry-after"){let i=t.headers[n],s=Number(i);if(isNaN(s)){e?.trace?.(`Failed to parse x-amz-retry-after=${i}`);return}return new Date(Date.now()+s)}}}function NFt(t,e){return D$e(t,e)}var P$e=v(()=>{p();ps();ti();Mi()});var Qme,M$e=v(()=>{p();Qme=t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`)});function O$e(t){return e=>(n,r)=>async i=>{let s=await e.retryStrategy(),o=await e.maxAttempts();if(oMr(s)){s=s;let a=await s.acquireInitialRetryToken((r.partition_id??"")+(r.__retryLongPoll?":longpoll":"")),c=new Error,u=0,l=0,{request:d}=i,m=no.isInstance(d);for(m&&(d.headers[$1]=yW());;)try{m&&(d.headers[W1]=`attempt=${u+1}; max=${o}`);let{response:h,output:f}=await n(i);return s.recordSuccess(a),f.$metadata.attempts=u+1,f.$metadata.totalRetryDelay=l,{response:h,output:f}}catch(h){let f=aMr(h,e.logger);if(c=Qme(h),m&&t(d))throw(r.logger instanceof jg?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),c;try{a=await s.refreshRetryTokenForRetry(a,f)}catch{throw c.$metadata||(c.$metadata={}),c.$metadata.attempts=u+1,c.$metadata.totalRetryDelay=l,c}u=a.getRetryCount();let g=a.getRetryDelay();l+=(a?.$retryLog?.acquisitionDelay??0)+g,g>0&&await sMr(g)}}else return s=s,s?.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",s.mode]]),s.retry(n,i)}}function DFt(t){let e=O$e(t);return n=>({applyToStack:r=>{r.add(e(n),L$e)}})}var sMr,oMr,aMr,cMr,L$e,F$e=v(()=>{p();Yi();ti();Mi();kW();a7();P$e();M$e();sMr=t=>new Promise(e=>setTimeout(e,t)),oMr=t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",aMr=(t,e)=>{let n={error:t,errorType:cMr(t)},r=D$e(t.$response,e);return r&&(n.retryAfterHint=r),n},cMr=t=>RC(t)?"THROTTLING":G1(t)?"TRANSIENT":Mme(t)?"SERVER_ERROR":"CLIENT_ERROR",L$e={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0}});var H1,Ume=v(()=>{p();kW();H1=class t{static setTimeoutFn=(e,n)=>setTimeout(e,n);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let n;this.updateMeasuredRate();let r=e;if(r?.errorType==="THROTTLING"||RC(r?.error??e)){let o=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=o,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),n=this.cubicThrottle(o),this.enableTokenBucket()}else this.calculateTimeWindow(),n=this.cubicSuccess(this.getCurrentTimeInSeconds());let s=Math.min(n,2*this.measuredTxRate);this.updateTokenBucketRate(s)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){let n=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(r=>t.setTimeoutFn(r,n)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){let e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}let n=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+n),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let e=this.getCurrentTimeInSeconds(),n=Math.floor(e*2)/2;if(this.requestCount++,n>this.lastTxRateBucket){let r=this.requestCount/(n-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(r*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=n}}getPrecise(e){return parseFloat(e.toFixed(8))}}});var Xu,NW=v(()=>{p();Xu=class t{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return t.v2026?50:100}static throttlingDelay(){return t.v2026?1e3:500}static cost(){return t.v2026?14:5}static throttlingCost(){return t.v2026?5:10}static modifiedCostType(){return t.v2026?"THROTTLING":"TRANSIENT"}}});var Gme,PFt=v(()=>{p();NW();Gme=class{x=Xu.delay();computeNextBackoffDelay(e){let i=Math.random()*Math.min(this.x*2**e,2e4);return Math.floor(i)}setDelayBase(e){this.x=e}}});var c7,MFt=v(()=>{p();c7=class{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(e,n,r,i){this.delay=e,this.count=n,this.cost=r,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(2e4,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}});var Mp,Q_,f0,hO=v(()=>{p();(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(Mp||(Mp={}));Q_=3,f0=Mp.STANDARD});var $me,U_,l7=v(()=>{p();PFt();MFt();hO();NW();$me={incompatible:1,attempts:2,capacity:3},U_=class{mode=Mp.STANDARD;retryBackoffStrategy;capacity=500;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>Q_,this.baseDelay??=Xu.delay(),this.retryBackoffStrategy??=new Gme}async acquireInitialRetryToken(e){return new c7(Xu.delay(),0,void 0,Xu.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,n){let r=await this.getMaxAttempts(),i=this.retryCode(e,n,r),s=i===0,o=e.isLongPoll?.();if(s||o){let a=n.errorType;this.retryBackoffStrategy.setDelayBase(a==="THROTTLING"?Xu.throttlingDelay():this.baseDelay);let c=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),u=c;if(n.retryAfterHint instanceof Date&&(u=Math.max(c,Math.min(n.retryAfterHint.getTime()-Date.now(),c+5e3))),s){let l=this.getCapacityCost(a);this.capacity-=l;let d=new c7(0,e.getRetryCount()+1,l,e.isLongPoll?.()??!1);return await new Promise(m=>setTimeout(m,u)),d.$retryLog.acquisitionDelay=u,d}else{let l=Xu.v2026&&i===$me.capacity&&o?u:0;l>0&&await new Promise(d=>setTimeout(d,l))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${Q_}`),Q_}}retryCode(e,n,r){let i=e.getRetryCount()+1,s=this.isRetryableError(n.errorType)?0:$me.incompatible,o=i=this.getCapacityCost(n.errorType)?0:$me.capacity;return s||o||a}getCapacityCost(e){return e===Xu.modifiedCostType()?Xu.throttlingCost():Xu.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}});var DW,Q$e=v(()=>{p();Ume();l7();hO();DW=class{mode=Mp.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,n){let{rateLimiter:r}=n??{};this.rateLimiter=r??new H1,this.standardRetryStrategy=n?new U_({maxAttempts:typeof e=="number"?e:3,...n}):new U_(e)}async acquireInitialRetryToken(e){let n=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),n}async refreshRetryTokenForRetry(e,n){this.rateLimiter.updateClientSendingRate(n);let r=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,n);return await this.rateLimiter.getSendToken(),r}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}});var Wme,OFt=v(()=>{p();l7();NW();Wme=class extends U_{computeNextBackoffDelay;constructor(e,n=Xu.delay()){super(typeof e=="function"?e:async()=>e),typeof n=="number"?this.computeNextBackoffDelay=()=>n:this.computeNextBackoffDelay=n,this.retryBackoffStrategy.computeNextBackoffDelay=r=>{let i=r+1;return this.computeNextBackoffDelay(i)}}}});var LFt,FFt=v(()=>{p();LFt=(t,e)=>{let n=t,r=e?.noRetryIncrement??1,i=e?.retryCost??5,s=e?.timeoutRetryCost??10,o=t,a=d=>d.name==="TimeoutError"?s:i,c=d=>a(d)<=o;return Object.freeze({hasRetryTokens:c,retrieveRetryTokens:d=>{if(!c(d))throw new Error("No retry token available");let m=a(d);return o-=m,m},releaseRetryTokens:d=>{o+=d??r,o=Math.min(o,n)}})}});var Hme,U$e=v(()=>{p();Hme=(t,e)=>Math.floor(Math.min(2e4,Math.random()*2**e*t))});var qme,G$e=v(()=>{p();kW();qme=t=>t?s7(t)||Pme(t)||RC(t)||G1(t):!1});var PW,lMr,$$e=v(()=>{p();ti();Mi();kW();hO();a7();M$e();FFt();U$e();G$e();PW=class{maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=Mp.STANDARD;constructor(e,n){this.maxAttemptsProvider=e,this.retryDecider=n?.retryDecider??qme,this.delayDecider=n?.delayDecider??Hme,this.retryQuota=n?.retryQuota??LFt(500)}shouldRetry(e,n,r){return nsetTimeout(f,h));continue}throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=s,l.$metadata.totalRetryDelay=o,l}}},lMr=t=>{if(!Bp.isInstance(t))return;let e=Object.keys(t.headers).find(s=>s.toLowerCase()==="retry-after");if(!e)return;let n=t.headers[e],r=Number(n);if(!Number.isNaN(r))return Math.min(r*1e3,2e4);let i=new Date(n);return Math.min(i.getTime()-Date.now(),2e4)}});var jme,QFt=v(()=>{p();Ume();hO();$$e();jme=class extends PW{rateLimiter;constructor(e,n){let{rateLimiter:r,...i}=n??{};super(e,i),this.rateLimiter=r??new H1,this.mode=Mp.ADAPTIVE}async retry(e,n){return super.retry(e,n,{beforeRequest:async()=>this.rateLimiter.getSendToken(),afterRequest:r=>{this.rateLimiter.updateClientSendingRate(r)}})}}});var Vme,Yme,kC,BC,W$e,H$e,NC,UFt=v(()=>{p();Yi();Q$e();l7();hO();NW();Vme="AWS_MAX_ATTEMPTS",Yme="max_attempts",kC={environmentVariableSelector:t=>{let e=t[Vme];if(!e)return;let n=parseInt(e);if(Number.isNaN(n))throw new Error(`Environment variable ${Vme} mast be a number, got "${e}"`);return n},configFileSelector:t=>{let e=t[Yme];if(!e)return;let n=parseInt(e);if(Number.isNaN(n))throw new Error(`Shared config file entry ${Yme} mast be a number, got "${e}"`);return n},default:Q_},BC=(t,e)=>{let{retryStrategy:n,retryMode:r}=t,{defaultMaxAttempts:i=Q_,defaultBaseDelay:s=Xu.delay()}=e??{},o=qa(t.maxAttempts??i),a=n?Promise.resolve(n):void 0,c=async()=>{let u=await o();return await qa(r)()===Mp.ADAPTIVE?new DW(o,{maxAttempts:u,baseDelay:s}):new U_({maxAttempts:u,baseDelay:s})};return Object.assign(t,{maxAttempts:o,retryStrategy:()=>a??=c()})},W$e="AWS_RETRY_MODE",H$e="retry_mode",NC={environmentVariableSelector:t=>t[W$e],configFileSelector:t=>t[H$e],default:f0}});var q$e,j$e,GFt,$Ft=v(()=>{p();ti();a7();q$e=()=>t=>async e=>{let{request:n}=e;return no.isInstance(n)&&(delete n.headers[$1],delete n.headers[W1]),t(e)},j$e={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},GFt=t=>({applyToStack:e=>{e.addRelativeTo(q$e(),j$e)}})});var WFt={};br(WFt,{AdaptiveRetryStrategy:()=>DW,CONFIG_MAX_ATTEMPTS:()=>Yme,CONFIG_RETRY_MODE:()=>H$e,ConfiguredRetryStrategy:()=>Wme,DEFAULT_MAX_ATTEMPTS:()=>Q_,DEFAULT_RETRY_DELAY_BASE:()=>Ome,DEFAULT_RETRY_MODE:()=>f0,DefaultRateLimiter:()=>H1,DeprecatedAdaptiveRetryStrategy:()=>jme,DeprecatedStandardRetryStrategy:()=>PW,ENV_MAX_ATTEMPTS:()=>Vme,ENV_RETRY_MODE:()=>W$e,INITIAL_RETRY_TOKENS:()=>BW,INVOCATION_ID_HEADER:()=>$1,MAXIMUM_RETRY_DELAY:()=>o7,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>kC,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>NC,NO_RETRY_INCREMENT:()=>Fme,REQUEST_HEADER:()=>W1,RETRY_COST:()=>B$e,RETRY_MODES:()=>Mp,Retry:()=>Xu,StandardRetryStrategy:()=>U_,THROTTLING_RETRY_DELAY_BASE:()=>Lme,TIMEOUT_RETRY_COST:()=>N$e,defaultDelayDecider:()=>Hme,defaultRetryDecider:()=>qme,getOmitRetryHeadersPlugin:()=>GFt,getRetryAfterHint:()=>NFt,getRetryPlugin:()=>YT,isBrowserNetworkError:()=>R$e,isClockSkewCorrectedError:()=>v$e,isClockSkewError:()=>Pme,isNodeJsHttp2TransientError:()=>k$e,isRetryableByTrait:()=>s7,isServerError:()=>Mme,isThrottlingError:()=>RC,isTransientError:()=>G1,omitRetryHeadersMiddleware:()=>q$e,omitRetryHeadersMiddlewareOptions:()=>j$e,resolveRetryConfig:()=>BC,retryMiddleware:()=>uMr,retryMiddlewareOptions:()=>L$e});var uMr,YT,g0=v(()=>{p();yDt();F$e();kW();Q$e();OFt();Ume();l7();hO();a7();NW();QFt();$$e();U$e();G$e();UFt();$Ft();F$e();P$e();uMr=O$e(iUe),YT=DFt(iUe)});function A0(t,e,n){t.__aws_sdk_context?t.__aws_sdk_context.features||(t.__aws_sdk_context.features={}):t.__aws_sdk_context={features:{}},t.__aws_sdk_context.features[e]=n}var V$e=v(()=>{p();g0();Xu.v2026||=typeof process=="object"&&process.env?.AWS_NEW_RETRIES_2026==="true"});function HFt(t,e,n){return t.$source||(t.$source={}),t.$source[e]=n,t}var qFt=v(()=>{p()});function MW(t){return t}var Y$e,z$e,DC,jFt=v(()=>{p();ti();Y$e=t=>e=>async n=>{if(!no.isInstance(n.request))return e(n);let{request:r}=n,{handlerProtocol:i=""}=t.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let s=r.hostname;r.port!=null&&(s+=`:${r.port}`),r.headers.host=s}return e(n)},z$e={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},DC=t=>({applyToStack:e=>{e.add(Y$e(t),z$e)}})});var K$e,J$e,PC,VFt=v(()=>{p();K$e=()=>(t,e)=>async n=>{try{let r=await t(n),{clientName:i,commandName:s,logger:o,dynamoDbDocumentClientOptions:a={}}=e,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:u}=a,l=c??e.inputFilterSensitiveLog,d=u??e.outputFilterSensitiveLog,{$metadata:m,...h}=r.output;return o?.info?.({clientName:i,commandName:s,input:l(n.input),output:d(h),metadata:m}),r}catch(r){let{clientName:i,commandName:s,logger:o,dynamoDbDocumentClientOptions:a={}}=e,{overrideInputFilterSensitiveLog:c}=a,u=c??e.inputFilterSensitiveLog;throw o?.error?.({clientName:i,commandName:s,input:u(n.input),error:r,metadata:r.$metadata}),r}},J$e={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},PC=t=>({applyToStack:e=>{e.add(K$e(),J$e)}})});var zme,X$e=v(()=>{p();zme={step:"build",tags:["RECURSION_DETECTION","TRACE_CONTEXT_PROPAGATION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"}});var q1,Z$e,Kme,eWe,tWe,u7,YFt=v(()=>{p();q1={REQUEST_ID:Symbol.for("_AWS_LAMBDA_REQUEST_ID"),X_RAY_TRACE_ID:Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),TENANT_ID:Symbol.for("_AWS_LAMBDA_TENANT_ID"),TRACEPARENT:Symbol.for("_AWS_LAMBDA_TRACEPARENT"),TRACESTATE:Symbol.for("_AWS_LAMBDA_TRACESTATE"),BAGGAGE:Symbol.for("_AWS_LAMBDA_BAGGAGE")},Z$e=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");Z$e||(globalThis.awslambda=globalThis.awslambda||{});Kme=class{static PROTECTED_KEYS=q1;isProtectedKey(e){return Object.values(q1).includes(e)}getRequestId(){return this.get(q1.REQUEST_ID)??"-"}getXRayTraceId(){return this.get(q1.X_RAY_TRACE_ID)}getTenantId(){return this.get(q1.TENANT_ID)}getTraceparent(){return this.get(q1.TRACEPARENT)}getTracestate(){return this.get(q1.TRACESTATE)}getBaggage(){return this.get(q1.BAGGAGE)}},eWe=class extends Kme{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(e){return this.currentContext?.[e]}set(e,n){if(this.isProtectedKey(e))throw new Error(`Cannot modify protected Lambda context field: ${String(e)}`);this.currentContext=this.currentContext||{},this.currentContext[e]=n}run(e,n){return this.currentContext=e,n()}},tWe=class t extends Kme{als;static async create(){let e=new t,n=await import("node:async_hooks");return e.als=new n.AsyncLocalStorage,e}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(e){return this.als.getStore()?.[e]}set(e,n){if(this.isProtectedKey(e))throw new Error(`Cannot modify protected Lambda context field: ${String(e)}`);let r=this.als.getStore();if(!r)throw new Error("No context available");r[e]=n}run(e,n){return this.als.run(e,n)}};(function(t){let e=null;async function n(r){return e||(e=(async()=>{let s=r===!0||"AWS_LAMBDA_MAX_CONCURRENCY"in process.env?await tWe.create():new eWe;return!Z$e&&globalThis.awslambda?.InvokeStore?globalThis.awslambda.InvokeStore:(!Z$e&&globalThis.awslambda&&(globalThis.awslambda.InvokeStore=s),s)})()),e}t.getInstanceAsync=n,t._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE==="1"?{reset:()=>{e=null,globalThis.awslambda?.InvokeStore&&delete globalThis.awslambda.InvokeStore,globalThis.awslambda={InvokeStore:void 0}}}:void 0})(u7||(u7={}))});function mMr(t){for(let e of Object.keys(t)){let n=e.toLowerCase();e!==n&&(n===rWe||n===zFt||n===KFt)&&(t[n]=t[e],delete t[e])}}var dMr,pMr,nWe,rWe,zFt,KFt,Jme,iWe=v(()=>{p();YFt();ti();dMr="AWS_LAMBDA_FUNCTION_NAME",pMr="_X_AMZN_TRACE_ID",nWe="X-Amzn-Trace-Id",rWe="traceparent",zFt="tracestate",KFt="baggage",Jme=()=>t=>async e=>{let{request:n}=e;if(!no.isInstance(n))return t(e);let r;{let i=Object.keys(n.headers??{}).find(s=>s.toLowerCase()===nWe.toLowerCase())??nWe;if(!n.headers.hasOwnProperty(i)){let s=process.env[dMr],o=process.env[pMr];r??=await u7.getInstanceAsync();let c=r?.getXRayTraceId()??o,u=l=>typeof l=="string"&&l.length>0;u(s)&&u(c)&&(n.headers[nWe]=c)}}if(mMr(n.headers),!n.headers[rWe]){let s=(r??=await u7.getInstanceAsync())?.getTraceparent?.();if(s){n.headers[rWe]=s;let o=r?.getTracestate?.();o&&(n.headers[zFt]=o);let a=r?.getBaggage?.();a&&(n.headers[KFt]=a)}}return t(e)}});var MC,JFt=v(()=>{p();X$e();iWe();MC=t=>({applyToStack:e=>{e.add(Jme(),zme)}})});var XFt,ZFt=v(()=>{p();XFt=(t,e)=>{if(!e||e.length===0)return t;let n=[];for(let r of e)for(let i of t)i.schemeId.split("#")[1]===r&&n.push(i);for(let r of t)n.find(({schemeId:i})=>i===r.schemeId)||n.push(r);return n}});function hMr(t){let e=new Map;for(let n of t)e.set(n.schemeId,n);return e}var fO,Xme=v(()=>{p();ps();ZFt();fO=(t,e)=>(n,r)=>async i=>{let s=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,r,i.input)),o=t.authSchemePreference?await t.authSchemePreference():[],a=XFt(s,o),c=hMr(t.httpAuthSchemes),u=wc(r),l=[];for(let d of a){let m=c.get(d.schemeId);if(!m){l.push(`HttpAuthScheme \`${d.schemeId}\` was not enabled for this service.`);continue}let h=m.identityProvider(await e.identityProviderConfigProvider(t));if(!h){l.push(`HttpAuthScheme \`${d.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:f={},signingProperties:g={}}=d.propertiesExtractor?.(t,r)||{};d.identityProperties=Object.assign(d.identityProperties||{},f),d.signingProperties=Object.assign(d.signingProperties||{},g),u.selectedHttpAuthScheme={httpAuthOption:d,identity:await h(d.identityProperties),signer:m.signer};break}if(!u.selectedHttpAuthScheme)throw new Error(l.join(` +`));return n(i)}});var Zme,G_,eQt=v(()=>{p();Xme();Zme={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},G_=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(fO(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:n}),Zme)}})});var ehe,sWe,tQt=v(()=>{p();Xme();ehe={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},sWe=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(fO(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:n}),ehe)}})});var nQt=v(()=>{p();Xme();eQt();tQt()});var fMr,gMr,d7,oWe=v(()=>{p();ti();ps();fMr=t=>e=>{throw e},gMr=(t,e)=>{},d7=t=>(e,n)=>async r=>{if(!no.isInstance(r.request))return e(r);let s=wc(n).selectedHttpAuthScheme;if(!s)throw new Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:o={}},identity:a,signer:c}=s,u=await e({...r,request:await c.sign(r.request,a,o)}).catch((c.errorHandler||fMr)(o));return(c.successHandler||gMr)(u.response,o),u}});var the,$_,rQt=v(()=>{p();oWe();the={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},$_=t=>({applyToStack:e=>{e.addRelativeTo(d7(t),the)}})});var iQt=v(()=>{p();oWe();rQt()});var y0,sQt=v(()=>{p();y0=t=>{if(typeof t=="function")return t;let e=Promise.resolve(t);return()=>e}});function oQt(t,e,n,r,i){return async function*(o,a,...c){let u=a,l=o.startingToken??u[n],d=!0,m;for(;d;){if(u[n]=l,i&&(u[i]=u[i]??o.pageSize),o.client instanceof t)m=await AMr(e,o.client,a,o.withCommand,...c);else throw new Error(`Invalid client, expected instance of ${t.name}`);yield m;let h=l;l=yMr(m,r),d=!!(l&&(!o.stopOnSameToken||l!==h))}return void 0}}var AMr,yMr,aQt=v(()=>{p();AMr=async(t,e,n,r=s=>s,...i)=>{let s=new t(n);return s=r(s)??s,await e.send(s,...i)};yMr=(t,e)=>{let n=t,r=e.split(".");for(let i of r){if(!n||typeof n!="object")return;n=n[i]}return n}});function cQt(t,e,n){t.__smithy_context?t.__smithy_context.features||(t.__smithy_context.features={}):t.__smithy_context={features:{}},t.__smithy_context.features[e]=n}var lQt=v(()=>{p()});var Ey,uQt=v(()=>{p();ps();Ey=class{authSchemes=new Map;constructor(e){for(let n in e){if(!Ti(e,n))continue;let r=e[n];r!==void 0&&this.authSchemes.set(n,r)}}getIdentityProvider(e){return this.authSchemes.get(e)}}});var aWe,OW,dQt=v(()=>{p();ti();aWe=Ot(aC()),OW=class{async sign(e,n,r){if(!r)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!r.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!r.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!n.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let i=no.clone(e);if(r.in===aWe.HttpApiKeyAuthLocation.QUERY)i.query[r.name]=n.apiKey;else if(r.in===aWe.HttpApiKeyAuthLocation.HEADER)i.headers[r.name]=r.scheme?`${r.scheme} ${n.apiKey}`:n.apiKey;else throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+r.in+"`");return i}}});var LW,pQt=v(()=>{p();ti();LW=class{async sign(e,n,r){let i=no.clone(e);if(!n.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return i.headers.Authorization=`Bearer ${n.token}`,i}}});var _h,mQt=v(()=>{p();_h=class{async sign(e,n,r){return e}}});var hQt=v(()=>{p();dQt();pQt();mQt()});var nhe,cWe,p7,FW,m7,fQt=v(()=>{p();nhe=t=>function(n){return FW(n)&&n.expiration.getTime()-Date.now()t.expiration!==void 0,m7=(t,e,n)=>{if(t===void 0)return;let r=typeof t!="function"?async()=>Promise.resolve(t):t,i,s,o,a=!1,c=async u=>{s||(s=r(u));try{i=await s,o=!0,a=!1}finally{s=void 0}return i};return e===void 0?async u=>((!o||u?.forceRefresh)&&(i=await c(u)),i):async u=>((!o||u?.forceRefresh)&&(i=await c(u)),a?i:n(i)?(e(i)&&await c(u),i):(a=!0,i))}});var gQt=v(()=>{p();uQt();hQt();fQt()});var AQt={};br(AQt,{DefaultIdentityProviderConfig:()=>Ey,EXPIRATION_MS:()=>cWe,HttpApiKeyAuthSigner:()=>OW,HttpBearerAuthSigner:()=>LW,NoAuthSigner:()=>_h,createIsIdentityExpiredFunction:()=>nhe,createPaginator:()=>oQt,doesIdentityRequireRefresh:()=>FW,getHttpAuthSchemeEndpointRuleSetPlugin:()=>G_,getHttpAuthSchemePlugin:()=>sWe,getHttpSigningPlugin:()=>$_,getSmithyContext:()=>wc,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>Zme,httpAuthSchemeMiddleware:()=>fO,httpAuthSchemeMiddlewareOptions:()=>ehe,httpSigningMiddleware:()=>d7,httpSigningMiddlewareOptions:()=>the,isIdentityExpired:()=>p7,memoizeIdentityProvider:()=>m7,normalizeProvider:()=>y0,requestBuilder:()=>vme,setFeature:()=>cQt});var Yg=v(()=>{p();ps();nQt();iQt();sQt();aQt();ti();lQt();gQt()});function EMr(t){return t===void 0?!0:typeof t=="string"&&t.length<=50}function OC(t){let e=y0(t.userAgentAppId??h7),{customUserAgent:n}=t;return Object.assign(t,{customUserAgent:typeof n=="string"?[[n]]:n,userAgentAppId:async()=>{let r=await e();if(!EMr(r)){let i=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?console:t.logger;typeof r!="string"?i?.warn("userAgentAppId must be a string or undefined."):r.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return r}})}var h7,lWe=v(()=>{p();Yg();h7=void 0});var uWe,yQt=v(()=>{p();uWe={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],version:"1.1"}});var EQt,bQt,rhe,dWe,_Qt,ihe,she=v(()=>{p();yQt();EQt=uWe,bQt="",rhe=t=>{let{partitions:e}=EQt;for(let r of e){let{regions:i,outputs:s}=r;for(let[o,a]of Object.entries(i))if(o===t)return{...s,...a}}for(let r of e){let{regionRegex:i,outputs:s}=r;if(new RegExp(i).test(t))return{...s}}let n=e.find(r=>r.id==="aws");if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},dWe=(t,e="")=>{EQt=t,bQt=e},_Qt=()=>{dWe(uWe,"")},ihe=()=>bQt});async function xQt(t,e,n){if(n.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&A0(t,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){let s=await e.retryStrategy();if(typeof s.mode=="string")switch(s.mode){case Mp.ADAPTIVE:A0(t,"RETRY_MODE_ADAPTIVE","F");break;case Mp.STANDARD:A0(t,"RETRY_MODE_STANDARD","E");break}}if(typeof e.accountIdEndpointMode=="function"){let s=t.endpointV2;switch(String(s?.url?.hostname).match(bMr)&&A0(t,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":A0(t,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":A0(t,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":A0(t,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let i=t.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){let s=i;s.accountId&&A0(t,"RESOLVED_ACCOUNT_ID","T");for(let[o,a]of Object.entries(s.$source??{}))A0(t,o,a)}}var bMr,SQt=v(()=>{p();g0();V$e();bMr=/\d{12}\.ddb/});var pWe,ohe,CQt,IQt,wQt=v(()=>{p();pWe="user-agent",ohe="x-amz-user-agent",CQt=/[^!$%&'*+\-.^_`|~\w]/g,IQt=/[^!$%&'*+\-.^_`|~\w#]/g});function TQt(t){let e="";for(let n in t){let r=t[n];if(e.length+r.length+1<=1024){e.length?e+=","+r:e+=r;continue}break}return e}var vQt=v(()=>{p()});var hWe,ahe,fWe,LC,BQt=v(()=>{p();ti();she();SQt();wQt();vQt();hWe=t=>(e,n)=>async r=>{let{request:i}=r;if(!no.isInstance(i))return e(r);let{headers:s}=i,o=n?.userAgent?.map(ahe)||[],a=(await t.defaultUserAgentProvider()).map(ahe);await xQt(n,t,r);let c=n;a.push(`m/${TQt(Object.assign({},n.__smithy_context?.features,c.__aws_sdk_context?.features))}`);let u=t?.customUserAgent?.map(ahe)||[],l=await t.userAgentAppId();l&&a.push(ahe(["app",`${l}`]));let d=ihe(),m=(d?[d]:[]).concat([...a,...o,...u]).join(" "),h=[...a.filter(f=>f.startsWith("aws-sdk-")),...u].join(" ");return t.runtime!=="browser"?(h&&(s[ohe]=s[ohe]?`${s[pWe]} ${h}`:h),s[pWe]=m):s[ohe]=m,e({...r,request:i})},ahe=t=>{let e=t[0].split("/").map(o=>o.replace(CQt,"-")).join("/"),n=t[1]?.replace(IQt,"-"),r=e.indexOf("/"),i=e.substring(0,r),s=e.substring(r+1);return i==="api"&&(s=s.toLowerCase()),[i,s,n].filter(o=>o&&o.length>0).reduce((o,a,c)=>{switch(c){case 0:return a;case 1:return`${o}/${a}`;default:return`${o}#${a}`}},"")},fWe={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},LC=t=>({applyToStack:e=>{e.add(hWe(t),fWe)}})});var che,NQt,DQt=v(()=>{p();che=require("node:process"),NQt=()=>{let t=["deno","bun","llrt"];for(let e of t)if(che.versions[e])return[`md/${e}`,che.versions[e]];return["md/nodejs",che.versions.node]}});var f7,gWe=v(()=>{p();f7={isCrtAvailable:!1}});var PQt,MQt=v(()=>{p();gWe();PQt=()=>f7.isCrtAvailable?["md/crt-avail"]:null});var lhe,AWe,W_,OQt,LQt=v(()=>{p();lhe=require("node:os"),AWe=require("node:process");DQt();MQt();gWe();W_=({serviceId:t,clientVersion:e})=>{let n=NQt();return async r=>{let i=[["aws-sdk-js",e],["ua","2.1"],[`os/${(0,lhe.platform)()}`,(0,lhe.release)()],["lang/js"],n],s=PQt();s&&i.push(s),t&&i.push([`api/${t}`,e]),AWe.env.AWS_EXECUTION_ENV&&i.push([`exec-env/${AWe.env.AWS_EXECUTION_ENV}`]);let o=await r?.userAgentAppId?.();return o?[...i,[`app/${o}`]]:[...i]}},OQt=W_});var yWe,EWe,_Mr,FC,FQt=v(()=>{p();lWe();yWe="AWS_SDK_UA_APP_ID",EWe="sdk_ua_app_id",_Mr="sdk-ua-app-id",FC={environmentVariableSelector:t=>t[yWe],configFileSelector:t=>t[EWe]??t[_Mr],default:h7}});var QQt=re((g7,bWe)=>{p();(function(t,e){typeof g7=="object"&&typeof bWe=="object"?bWe.exports=e():typeof define=="function"&&define.amd?define([],e):typeof g7=="object"?g7.bowser=e():t.bowser=e()})(g7,(function(){return(function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(r,i,s){n.o(r,i)||Object.defineProperty(r,i,{enumerable:!0,get:s})},n.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,i){if(1&i&&(r=n(r)),8&i||4&i&&typeof r=="object"&&r&&r.__esModule)return r;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:r}),2&i&&typeof r!="string")for(var o in r)n.d(s,o,function(a){return r[a]}.bind(null,o));return s},n.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(i,"a",i),i},n.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},n.p="",n(n.s=90)})({17:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=n(18),i=(function(){function s(){}return s.getFirstMatch=function(o,a){var c=a.match(o);return c&&c.length>0&&c[1]||""},s.getSecondMatch=function(o,a){var c=a.match(o);return c&&c.length>1&&c[2]||""},s.matchAndReturnConst=function(o,a,c){if(o.test(a))return c},s.getWindowsVersionName=function(o){switch(o){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},s.getMacOSVersionName=function(o){var a=o.split(".").splice(0,2).map((function(l){return parseInt(l,10)||0}));a.push(0);var c=a[0],u=a[1];if(c===10)switch(u){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(c){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}},s.getAndroidVersionName=function(o){var a=o.split(".").splice(0,2).map((function(c){return parseInt(c,10)||0}));if(a.push(0),!(a[0]===1&&a[1]<5))return a[0]===1&&a[1]<6?"Cupcake":a[0]===1&&a[1]>=6?"Donut":a[0]===2&&a[1]<2?"Eclair":a[0]===2&&a[1]===2?"Froyo":a[0]===2&&a[1]>2?"Gingerbread":a[0]===3?"Honeycomb":a[0]===4&&a[1]<1?"Ice Cream Sandwich":a[0]===4&&a[1]<4?"Jelly Bean":a[0]===4&&a[1]>=4?"KitKat":a[0]===5?"Lollipop":a[0]===6?"Marshmallow":a[0]===7?"Nougat":a[0]===8?"Oreo":a[0]===9?"Pie":void 0},s.getVersionPrecision=function(o){return o.split(".").length},s.compareVersions=function(o,a,c){c===void 0&&(c=!1);var u=s.getVersionPrecision(o),l=s.getVersionPrecision(a),d=Math.max(u,l),m=0,h=s.map([o,a],(function(f){var g=d-s.getVersionPrecision(f),A=f+new Array(g+1).join(".0");return s.map(A.split("."),(function(y){return new Array(20-y.length).join("0")+y})).reverse()}));for(c&&(m=d-Math.min(u,l)),d-=1;d>=m;){if(h[0][d]>h[1][d])return 1;if(h[0][d]===h[1][d]){if(d===m)return 0;d-=1}else if(h[0][d]1?l-1:0),m=1;m0){var E=Object.keys(f),_=a.default.find(E,(function(N){return h.isOS(N)}));if(_){var S=this.satisfies(f[_]);if(S!==void 0)return S}var C=a.default.find(E,(function(N){return h.isPlatform(N)}));if(C){var I=this.satisfies(f[C]);if(I!==void 0)return I}}if(y>0){var w=Object.keys(A),k=a.default.find(w,(function(N){return h.isBrowser(N,!0)}));if(k!==void 0)return this.compareVersion(A[k])}},d.isBrowser=function(m,h){h===void 0&&(h=!1);var f=this.getBrowserName().toLowerCase(),g=m.toLowerCase(),A=a.default.getBrowserTypeByAlias(g);return h&&A&&(g=A.toLowerCase()),g===f},d.compareVersion=function(m){var h=[0],f=m,g=!1,A=this.getBrowserVersion();if(typeof A=="string")return m[0]===">"||m[0]==="<"?(f=m.substr(1),m[1]==="="?(g=!0,f=m.substr(2)):h=[],m[0]===">"?h.push(1):h.push(-1)):m[0]==="="?f=m.substr(1):m[0]==="~"&&(g=!0,f=m.substr(1)),h.indexOf(a.default.compareVersions(A,f,g))>-1},d.isOS=function(m){return this.getOSName(!0)===String(m).toLowerCase()},d.isPlatform=function(m){return this.getPlatformType(!0)===String(m).toLowerCase()},d.isEngine=function(m){return this.getEngineName(!0)===String(m).toLowerCase()},d.is=function(m,h){return h===void 0&&(h=!1),this.isBrowser(m,h)||this.isOS(m)||this.isPlatform(m)},d.some=function(m){var h=this;return m===void 0&&(m=[]),m.some((function(f){return h.is(f)}))},l})();e.default=u,t.exports=e.default},92:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/gptbot/i],describe:function(a){var c={name:"GPTBot"},u=i.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/chatgpt-user/i],describe:function(a){var c={name:"ChatGPT-User"},u=i.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/oai-searchbot/i],describe:function(a){var c={name:"OAI-SearchBot"},u=i.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(a){var c={name:"ClaudeBot"},u=i.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(a){var c={name:"Omgilibot"},u=i.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/diffbot/i],describe:function(a){var c={name:"Diffbot"},u=i.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/perplexitybot/i],describe:function(a){var c={name:"PerplexityBot"},u=i.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/perplexity-user/i],describe:function(a){var c={name:"Perplexity-User"},u=i.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/youbot/i],describe:function(a){var c={name:"YouBot"},u=i.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/meta-webindexer/i],describe:function(a){var c={name:"Meta-WebIndexer"},u=i.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/meta-externalads/i],describe:function(a){var c={name:"Meta-ExternalAds"},u=i.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/meta-externalagent/i],describe:function(a){var c={name:"Meta-ExternalAgent"},u=i.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/meta-externalfetcher/i],describe:function(a){var c={name:"Meta-ExternalFetcher"},u=i.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/googlebot/i],describe:function(a){var c={name:"Googlebot"},u=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/linespider/i],describe:function(a){var c={name:"Linespider"},u=i.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/amazonbot/i],describe:function(a){var c={name:"AmazonBot"},u=i.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/bingbot/i],describe:function(a){var c={name:"BingCrawler"},u=i.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/baiduspider/i],describe:function(a){var c={name:"BaiduSpider"},u=i.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/duckduckbot/i],describe:function(a){var c={name:"DuckDuckBot"},u=i.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/ia_archiver/i],describe:function(a){var c={name:"InternetArchiveCrawler"},u=i.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(a){var c={name:"SlackBot"},u=i.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{test:[/opera/i],describe:function(a){var c={name:"Opera"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/opr\/|opios/i],describe:function(a){var c={name:"Opera"},u=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/SamsungBrowser/i],describe:function(a){var c={name:"Samsung Internet for Android"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/Whale/i],describe:function(a){var c={name:"NAVER Whale Browser"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/PaleMoon/i],describe:function(a){var c={name:"Pale Moon"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/MZBrowser/i],describe:function(a){var c={name:"MZ Browser"},u=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/focus/i],describe:function(a){var c={name:"Focus"},u=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/swing/i],describe:function(a){var c={name:"Swing"},u=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/coast/i],describe:function(a){var c={name:"Opera Coast"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(a){var c={name:"Opera Touch"},u=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/yabrowser/i],describe:function(a){var c={name:"Yandex Browser"},u=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/ucbrowser/i],describe:function(a){var c={name:"UC Browser"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/Maxthon|mxios/i],describe:function(a){var c={name:"Maxthon"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/epiphany/i],describe:function(a){var c={name:"Epiphany"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/puffin/i],describe:function(a){var c={name:"Puffin"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/sleipnir/i],describe:function(a){var c={name:"Sleipnir"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/k-meleon/i],describe:function(a){var c={name:"K-Meleon"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/micromessenger/i],describe:function(a){var c={name:"WeChat"},u=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/qqbrowser/i],describe:function(a){var c={name:/qqbrowserlite/i.test(a)?"QQ Browser Lite":"QQ Browser"},u=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/msie|trident/i],describe:function(a){var c={name:"Internet Explorer"},u=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/\sedg\//i],describe:function(a){var c={name:"Microsoft Edge"},u=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/edg([ea]|ios)/i],describe:function(a){var c={name:"Microsoft Edge"},u=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/vivaldi/i],describe:function(a){var c={name:"Vivaldi"},u=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/seamonkey/i],describe:function(a){var c={name:"SeaMonkey"},u=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/sailfish/i],describe:function(a){var c={name:"Sailfish"},u=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,a);return u&&(c.version=u),c}},{test:[/silk/i],describe:function(a){var c={name:"Amazon Silk"},u=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/phantom/i],describe:function(a){var c={name:"PhantomJS"},u=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/slimerjs/i],describe:function(a){var c={name:"SlimerJS"},u=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(a){var c={name:"BlackBerry"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/(web|hpw)[o0]s/i],describe:function(a){var c={name:"WebOS Browser"},u=i.default.getFirstMatch(s,a)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/bada/i],describe:function(a){var c={name:"Bada"},u=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/tizen/i],describe:function(a){var c={name:"Tizen"},u=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/qupzilla/i],describe:function(a){var c={name:"QupZilla"},u=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/librewolf/i],describe:function(a){var c={name:"LibreWolf"},u=i.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/firefox|iceweasel|fxios/i],describe:function(a){var c={name:"Firefox"},u=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/electron/i],describe:function(a){var c={name:"Electron"},u=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(a){var c={name:"Sogou Browser"},u=i.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,a),l=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a),d=i.default.getFirstMatch(/se ([\d.]+)x/i,a),m=u||l||d;return m&&(c.version=m),c}},{test:[/MiuiBrowser/i],describe:function(a){var c={name:"Miui"},u=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:function(a){return!!a.hasBrand("DuckDuckGo")||a.test(/\sDdg\/[\d.]+$/i)},describe:function(a,c){var u={name:"DuckDuckGo"};if(c){var l=c.getBrandVersion("DuckDuckGo");if(l)return u.version=l,u}var d=i.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,a);return d&&(u.version=d),u}},{test:function(a){return a.hasBrand("Brave")},describe:function(a,c){var u={name:"Brave"};if(c){var l=c.getBrandVersion("Brave");if(l)return u.version=l,u}return u}},{test:[/chromium/i],describe:function(a){var c={name:"Chromium"},u=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,a)||i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/chrome|crios|crmo/i],describe:function(a){var c={name:"Chrome"},u=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/GSA/i],describe:function(a){var c={name:"Google Search"},u=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:function(a){var c=!a.test(/like android/i),u=a.test(/android/i);return c&&u},describe:function(a){var c={name:"Android Browser"},u=i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/playstation 4/i],describe:function(a){var c={name:"PlayStation 4"},u=i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/safari|applewebkit/i],describe:function(a){var c={name:"Safari"},u=i.default.getFirstMatch(s,a);return u&&(c.version=u),c}},{test:[/.*/i],describe:function(a){var c=a.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(c,a),version:i.default.getSecondMatch(c,a)}}}];e.default=o,t.exports=e.default},93:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:[/Roku\/DVP/],describe:function(a){var c=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,a);return{name:s.OS_MAP.Roku,version:c}}},{test:[/windows phone/i],describe:function(a){var c=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,a);return{name:s.OS_MAP.WindowsPhone,version:c}}},{test:[/windows /i],describe:function(a){var c=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,a),u=i.default.getWindowsVersionName(c);return{name:s.OS_MAP.Windows,version:c,versionName:u}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(a){var c={name:s.OS_MAP.iOS},u=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,a);return u&&(c.version=u),c}},{test:[/macintosh/i],describe:function(a){var c=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,a).replace(/[_\s]/g,"."),u=i.default.getMacOSVersionName(c),l={name:s.OS_MAP.MacOS,version:c};return u&&(l.versionName=u),l}},{test:[/(ipod|iphone|ipad)/i],describe:function(a){var c=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,a).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:c}}},{test:[/OpenHarmony/i],describe:function(a){var c=i.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,a);return{name:s.OS_MAP.HarmonyOS,version:c}}},{test:function(a){var c=!a.test(/like android/i),u=a.test(/android/i);return c&&u},describe:function(a){var c=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,a),u=i.default.getAndroidVersionName(c),l={name:s.OS_MAP.Android,version:c};return u&&(l.versionName=u),l}},{test:[/(web|hpw)[o0]s/i],describe:function(a){var c=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,a),u={name:s.OS_MAP.WebOS};return c&&c.length&&(u.version=c),u}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(a){var c=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,a)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,a)||i.default.getFirstMatch(/\bbb(\d+)/i,a);return{name:s.OS_MAP.BlackBerry,version:c}}},{test:[/bada/i],describe:function(a){var c=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,a);return{name:s.OS_MAP.Bada,version:c}}},{test:[/tizen/i],describe:function(a){var c=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,a);return{name:s.OS_MAP.Tizen,version:c}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(a){var c=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,a);return{name:s.OS_MAP.PlayStation4,version:c}}}];e.default=o,t.exports=e.default},94:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/linespider/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(a){var c=i.default.getFirstMatch(/(can-l01)/i,a)&&"Nova",u={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return c&&(u.model=c),u}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(a){var c=a.test(/ipod|iphone/i),u=a.test(/like (ipod|iphone)/i);return c&&!u},describe:function(a){var c=i.default.getFirstMatch(/(ipod|iphone)/i,a);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:c}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(a){var c=i.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,a),u={type:s.PLATFORMS_MAP.mobile,vendor:"Nokia"};return c&&(u.model=c),u}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(a){return a.getBrowserName(!0)==="blackberry"},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(a){return a.getBrowserName(!0)==="bada"},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(a){return a.getBrowserName()==="windows phone"},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(a){var c=Number(String(a.getOSVersion()).split(".")[0]);return a.getOSName(!0)==="android"&&c>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(a){return a.getOSName(!0)==="android"},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:[/smart-?tv|smarttv/i],describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(a){return a.getOSName(!0)==="macos"},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(a){return a.getOSName(!0)==="windows"},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(a){return a.getOSName(!0)==="linux"},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(a){return a.getOSName(!0)==="playstation 4"},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(a){return a.getOSName(!0)==="roku"},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];e.default=o,t.exports=e.default},95:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:function(a){return a.getBrowserName(!0)==="microsoft edge"},describe:function(a){if(/\sedg\//i.test(a))return{name:s.ENGINE_MAP.Blink};var c=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,a);return{name:s.ENGINE_MAP.EdgeHTML,version:c}}},{test:[/trident/i],describe:function(a){var c={name:s.ENGINE_MAP.Trident},u=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:function(a){return a.test(/presto/i)},describe:function(a){var c={name:s.ENGINE_MAP.Presto},u=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:function(a){var c=a.test(/gecko/i),u=a.test(/like gecko/i);return c&&!u},describe:function(a){var c={name:s.ENGINE_MAP.Gecko},u=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(a){var c={name:s.ENGINE_MAP.WebKit},u=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,a);return u&&(c.version=u),c}}];e.default=o,t.exports=e.default}})}))});var UQt,GQt=v(()=>{p();UQt=({serviceId:t,clientVersion:e})=>async n=>{let r=await Promise.resolve().then(()=>Ot(QQt())),i=r.parse??r.default.parse??(()=>""),s=typeof window<"u"&&window?.navigator?.userAgent?i(window.navigator.userAgent):void 0,o=[["aws-sdk-js",e],["ua","2.1"],[`os/${s?.os?.name||"other"}`,s?.os?.version],["lang/js"],["md/browser",`${s?.browser?.name??"unknown"}_${s?.browser?.version??"unknown"}`]];t&&o.push([`api/${t}`,e]);let a=await n?.userAgentAppId?.();return a&&o.push([`app/${a}`]),o}});var $Qt,WQt=v(()=>{p();$Qt={os(t){if(/iPhone|iPad|iPod/.test(t))return"iOS";if(/Macintosh|Mac OS X/.test(t))return"macOS";if(/Windows NT/.test(t))return"Windows";if(/Android/.test(t))return"Android";if(/Linux/.test(t))return"Linux"},browser(t){if(/EdgiOS|EdgA|Edg\//.test(t))return"Microsoft Edge";if(/Firefox\//.test(t))return"Firefox";if(/Chrome\//.test(t))return"Chrome";if(/Safari\//.test(t))return"Safari"}}});var _We=v(()=>{p();Xc()});var A7,xWe=v(()=>{p();Xc();_We();A7=(t,e=!1)=>{if(e){for(let n of t.split("."))if(!A7(n))return!1;return!0}return!(!N_(t)||t.length<3||t.length>63||t!==t.toLowerCase()||$T(t))}});var uhe,SWe=v(()=>{p();uhe=t=>{let e=t.split(":");if(e.length<6)return null;let[n,r,i,s,o,...a]=e;if(n!=="arn"||r===""||i===""||a.join(":")==="")return null;let c=a.map(u=>u.split("/")).flat();return{partition:r,service:i,region:s,accountId:o,resourceId:c}}});var H_,HQt=v(()=>{p();Xc();xWe();SWe();she();H_={isVirtualHostableS3Bucket:A7,parseArn:uhe,partition:rhe};Vg.aws=H_});var qQt=v(()=>{p();Xc()});var jQt,CWe,VQt=v(()=>{p();ti();jQt=t=>{if(typeof t.endpointProvider!="function")throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.");let{endpoint:e}=t;return e===void 0&&(t.endpoint=async()=>CWe(t.endpointProvider({Region:typeof t.region=="function"?await t.region():t.region,UseDualStack:typeof t.useDualstackEndpoint=="function"?await t.useDualstackEndpoint():t.useDualstackEndpoint,UseFIPS:typeof t.useFipsEndpoint=="function"?await t.useFipsEndpoint():t.useFipsEndpoint,Endpoint:void 0},{logger:t.logger}))),t},CWe=t=>Cm(t.url)});var YQt=v(()=>{p();Xc()});var zQt=v(()=>{p();Da();Da()});function dhe(t={}){return cs({...Im,async default(){return IWe.silence||console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."),"us-east-1"}},{...Tf,...t})}var IWe,KQt=v(()=>{p();Da();IWe={silence:!1}});var QC,UC,JQt=v(()=>{p();QC=t=>({setRegion(e){t.region=e},region(){return t.region}}),UC=t=>({region:t.region()})});var q_={};br(q_,{DEFAULT_UA_APP_ID:()=>h7,EndpointError:()=>Wo,NODE_APP_ID_CONFIG_OPTIONS:()=>FC,NODE_REGION_CONFIG_FILE_OPTIONS:()=>Tf,NODE_REGION_CONFIG_OPTIONS:()=>Im,REGION_ENV_NAME:()=>mW,REGION_INI_NAME:()=>hW,UA_APP_ID_ENV_NAME:()=>yWe,UA_APP_ID_INI_NAME:()=>EWe,awsEndpointFunctions:()=>H_,createDefaultUserAgentProvider:()=>W_,createUserAgentStringParsingProvider:()=>UQt,crtAvailability:()=>f7,defaultUserAgent:()=>OQt,emitWarningIfUnsupportedVersion:()=>oC,fallback:()=>$Qt,getAwsRegionExtensionConfiguration:()=>QC,getHostHeaderPlugin:()=>DC,getLoggerPlugin:()=>PC,getLongPollPlugin:()=>hDt,getRecursionDetectionPlugin:()=>MC,getUserAgentMiddlewareOptions:()=>fWe,getUserAgentPlugin:()=>LC,getUserAgentPrefix:()=>ihe,hostHeaderMiddleware:()=>Y$e,hostHeaderMiddlewareOptions:()=>z$e,isIpAddress:()=>$T,isVirtualHostableS3Bucket:()=>A7,loggerMiddleware:()=>K$e,loggerMiddlewareOptions:()=>J$e,parseArn:()=>uhe,partition:()=>rhe,recursionDetectionMiddleware:()=>Jme,recursionDetectionMiddlewareOptions:()=>zme,resolveAwsRegionExtensionConfiguration:()=>UC,resolveDefaultAwsRegionalEndpointsConfig:()=>jQt,resolveEndpoint:()=>Xz,resolveHostHeaderConfig:()=>MW,resolveRegionConfig:()=>hy,resolveUserAgentConfig:()=>OC,setCredentialFeature:()=>E1,setFeature:()=>A0,setPartitionInfo:()=>dWe,setTokenFeature:()=>HFt,state:()=>Iz,stsRegionDefaultResolver:()=>dhe,stsRegionWarning:()=>IWe,toEndpointV1:()=>CWe,useDefaultPartitionInfo:()=>_Qt,userAgentMiddleware:()=>hWe});var Pa=v(()=>{p();mDt();fDt();gDt();V$e();qFt();jFt();VFt();X$e();JFt();iWe();lWe();BQt();LQt();FQt();WQt();GQt();HQt();qQt();VQt();_We();xWe();SWe();she();YQt();zQt();KQt();JQt()});var rUt=re(gO=>{p();var{HttpRequest:XQt}=(ti(),wr(vC));function xMr(t){let e=t.signer,n=t.signer,r=Object.assign(t,{eventSigner:e,messageSigner:n}),i=r.eventStreamPayloadHandlerProvider(r);return Object.assign(r,{eventStreamPayloadHandler:i})}var ZQt=t=>(e,n)=>async r=>{let{request:i}=r;return XQt.isInstance(i)?t.eventStreamPayloadHandler.handle(e,r,n):e(r)},eUt={tags:["EVENT_STREAM","SIGNATURE","HANDLE"],name:"eventStreamHandlingMiddleware",relation:"after",toMiddleware:"awsAuthMiddleware",override:!0},tUt=t=>async e=>{let{request:n}=e;return XQt.isInstance(n)?(n.headers={...n.headers,"content-type":"application/vnd.amazon.eventstream","x-amz-content-sha256":"STREAMING-AWS4-HMAC-SHA256-EVENTS"},t({...e,request:n})):t(e)},nUt={step:"build",tags:["EVENT_STREAM","HEADER","CONTENT_TYPE","CONTENT_SHA256"],name:"eventStreamHeaderMiddleware",override:!0},SMr=t=>({applyToStack:e=>{e.addRelativeTo(ZQt(t),eUt),e.add(tUt,nUt)}});gO.eventStreamHandlingMiddleware=ZQt;gO.eventStreamHandlingMiddlewareOptions=eUt;gO.eventStreamHeaderMiddleware=tUt;gO.eventStreamHeaderMiddlewareOptions=nUt;gO.getEventStreamPlugin=SMr;gO.resolveEventStreamConfig=xMr});var iUt,sUt,oUt,aUt=v(()=>{p();iUt=t=>typeof t=="string"&&t.indexOf("arn:")===0&&t.split(":").length>=6,sUt=t=>{let e=t.split(":");if(e.length<6||e[0]!=="arn")throw new Error("Malformed ARN");let[,n,r,i,s,...o]=e;return{partition:n,service:r,region:i,accountId:s,resource:o.join(":")}},oUt=t=>{let{partition:e="aws",service:n,region:r,accountId:i,resource:s}=t;if([n,r,i,s].some(o=>typeof o!="string"))throw new Error("Input ARN object is invalid");return`arn:${e}:${n}:${r}:${i}:${s}`}});function cUt(t){let{port:e,query:n}=t,{protocol:r,path:i,hostname:s}=t;r&&r.slice(-1)!==":"&&(r+=":"),e&&(s+=`:${e}`),i&&i.charAt(0)!=="/"&&(i=`/${i}`);let o=n?Dme(n):"";o&&o[0]!=="?"&&(o=`?${o}`);let a="";if(t.username!=null||t.password!=null){let u=t.username??"",l=t.password??"";a=`${u}:${l}@`}let c="";return t.fragment&&(c=`#${t.fragment}`),`${r}//${a}${s}${i}${o}${c}`}var lUt=v(()=>{p();ti()});function uUt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var dUt=v(()=>{p()});var pUt={};br(pUt,{build:()=>oUt,formatUrl:()=>cUt,hasOwn:()=>uUt,parse:()=>sUt,validate:()=>iUt});var mUt=v(()=>{p();aUt();lUt();dUt()});var AUt=re(mhe=>{p();var{buildQueryString:CMr,HttpResponse:hUt}=(ti(),wr(vC)),{streamCollector:IMr}=(Mi(),wr(k1));mhe.streamCollector=IMr;function fUt(t,e){return new Request(t,e)}function wMr(t=0){return new Promise((e,n)=>{t&&setTimeout(()=>{let r=new Error(`Request did not complete within ${t} ms`);r.name="TimeoutError",n(r)},t)})}var phe={supported:void 0},wWe=class t{config;configProvider;static create(e){return typeof e?.handle=="function"?e:new t(e)}constructor(e){typeof e=="function"?this.configProvider=e().then(n=>n||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),phe.supported===void 0&&(phe.supported=typeof Request<"u"&&"keepalive"in fUt("https://[::1]"))}destroy(){}async handle(e,{abortSignal:n,requestTimeout:r}={}){this.config||(this.config=await this.configProvider);let i=r??this.config.requestTimeout,s=this.config.keepAlive===!0,o=this.config.credentials,a=this.config.customFetch??fetch;if(n?.aborted){let _=gUt(n);return Promise.reject(_)}let c=e.path,u=CMr(e.query||{});u&&(c+=`?${u}`),e.fragment&&(c+=`#${e.fragment}`);let l="";if(e.username!=null||e.password!=null){let _=e.username??"",S=e.password??"";l=`${_}:${S}@`}let{port:d,method:m}=e,h=`${e.protocol}//${l}${e.hostname}${d?`:${d}`:""}${c}`,f=m==="GET"||m==="HEAD"?void 0:e.body,g={body:f,headers:new Headers(e.headers),method:m,credentials:o};this.config?.cache&&(g.cache=this.config.cache),f&&(g.duplex="half"),typeof AbortController<"u"&&(g.signal=n),phe.supported&&(g.keepalive=s),typeof this.config.requestInit=="function"&&Object.assign(g,this.config.requestInit(e));let A=()=>{},y=fUt(h,g),E=[a(y).then(_=>{let S=_.headers,C={};for(let w of S.entries())C[w[0]]=w[1];return _.body!=null?{response:new hUt({headers:C,reason:_.statusText,statusCode:_.status,body:_.body})}:_.blob().then(w=>({response:new hUt({headers:C,reason:_.statusText,statusCode:_.status,body:w})}))}),wMr(i)];return n&&E.push(new Promise((_,S)=>{let C=()=>{let I=gUt(n);S(I)};if(typeof n.addEventListener=="function"){let I=n;I.addEventListener("abort",C,{once:!0}),A=()=>I.removeEventListener("abort",C)}else n.onabort=C})),Promise.race(E).finally(A)}updateHttpClientConfig(e,n){this.config=void 0,this.configProvider=this.configProvider.then(r=>(r[e]=n,r))}httpHandlerConfigs(){return this.config??{}}};function gUt(t){let e=t&&typeof t=="object"&&"reason"in t?t.reason:void 0;if(e){if(e instanceof Error){let i=new Error("Request aborted");return i.name="AbortError",i.cause=e,i}let r=new Error(String(e));return r.name="AbortError",r}let n=new Error("Request aborted");return n.name="AbortError",n}mhe.FetchHttpHandler=wWe;mhe.keepAliveSupport=phe});var _Ut=re(y7=>{p();var{formatUrl:TMr}=(mUt(),wr(pUt)),{iterableToReadableStream:vMr,readableStreamToIterable:RMr,EventStreamCodec:kMr}=(r7(),wr(n7)),{HttpResponse:BMr,HttpRequest:EUt}=(ti(),wr(vC)),{fromBase64:NMr,fromHex:DMr}=(Mi(),wr(k1)),{FetchHttpHandler:yUt}=AUt(),bUt=t=>t.protocol==="ws:"||t.protocol==="wss:",PMr=3e3,TWe=class t{metadata={handlerProtocol:"websocket/h1.1"};config={};configPromise;httpHandler;sockets={};static create(e,n=new yUt){return typeof e?.handle=="function"?e:new t(e,n)}constructor(e,n=new yUt){this.httpHandler=n;let r=i=>(this.config={...i??{}},this.config);typeof e=="function"?(this.config={},this.configPromise=e().then(i=>r(i))):this.configPromise=Promise.resolve(r(e))}destroy(){for(let[e,n]of Object.entries(this.sockets)){for(let r of n)r.close(1e3,"Socket closed through destroy() call");delete this.sockets[e]}}async handle(e){this.config=await this.configPromise;let{logger:n}=this.config;if(!bUt(e))return n?.debug?.(`@aws-sdk - ws fetching ${e.protocol}${e.hostname}${e.path}`),this.httpHandler.handle(e);let r=TMr(e);n?.debug?.(`@aws-sdk - ws connecting ${r.split("?")[0]}`);let i=new WebSocket(r);this.sockets[r]||(this.sockets[r]=[]),this.sockets[r].push(i),i.binaryType="arraybuffer";let{connectionTimeout:s=PMr}=this.config;await this.waitForReady(i,s);let{body:o}=e,a=MMr(o),c=this.connect(i,a),u=OMr(c);return{response:new BMr({statusCode:200,body:u})}}updateHttpClientConfig(e,n){this.configPromise=this.configPromise.then(r=>(r[e]=n,r))}httpHandlerConfigs(){return this.config??{}}removeNotUsableSockets(e){this.sockets[e]=(this.sockets[e]??[]).filter(n=>![WebSocket.CLOSING,WebSocket.CLOSED].includes(n.readyState))}waitForReady(e,n){return new Promise((r,i)=>{let s=setTimeout(()=>{this.removeNotUsableSockets(e.url),i({$metadata:{httpStatusCode:500,websocketSynthetic500Error:!0}})},n);e.onopen=()=>{clearTimeout(s),r()}})}connect(e,n){let r=[],i=null,s=null,o=u=>{i?(u.error?s(u.error):i({done:u.done,value:u.value}),i=null,s=null):r.push(u)};e.onmessage=u=>{let{data:l}=u;o(typeof l=="string"?{done:!1,value:NMr(l)}:{done:!1,value:new Uint8Array(l)})},e.onerror=u=>{e.close(),o({done:!0,error:u})},e.onclose=()=>{this.removeNotUsableSockets(e.url),o({done:!0})};let a={[Symbol.asyncIterator]:()=>({async next(){if(r.length>0){let u=r.shift();if(u.error)throw u.error;return{done:u.done,value:u.value}}return new Promise((u,l)=>{i=u,s=l})}})};return(async()=>{try{for await(let u of n){if(e.readyState>=WebSocket.CLOSING)break;e.send(u)}}catch(u){o({done:!0,error:u})}finally{e.close(1e3)}})(),a}},MMr=t=>t[Symbol.asyncIterator]?t:LMr(t)?RMr(t):{[Symbol.asyncIterator]:async function*(){yield t}},OMr=t=>typeof ReadableStream=="function"?vMr(t):t,LMr=t=>typeof ReadableStream=="function"&&t instanceof ReadableStream,FMr=(t,e)=>n=>r=>{let{request:i}=r;if(EUt.isInstance(i)&&t.requestHandler.metadata?.handlerProtocol?.toLowerCase().includes("websocket")){i.protocol="wss:",i.method="GET",i.path=`${i.path}-websocket`;let{headers:s}=i;delete s["content-type"],delete s["x-amz-content-sha256"];for(let o of Object.keys(s))if(o.indexOf(e.headerPrefix)===0){let a=o.replace(e.headerPrefix,"");i.query[a]=s[o]}s["x-amz-user-agent"]&&(i.query["user-agent"]=s["x-amz-user-agent"]),i.headers={host:s.host??i.hostname}}return n(r)},QMr={name:"websocketEndpointMiddleware",tags:["WEBSOCKET","EVENT_STREAM"],relation:"after",toMiddleware:"eventStreamHeaderMiddleware",override:!0},UMr=()=>t=>async e=>{let n={...e.input},r=await t(e),i=r.output;return n.SessionId&&i.SessionId==null&&(i.SessionId=n.SessionId),r},GMr={step:"initialize",name:"injectSessionIdMiddleware",tags:["WEBSOCKET","EVENT_STREAM"],override:!0},$Mr=(t,e)=>({applyToStack:n=>{n.addRelativeTo(FMr(t,e),QMr),n.add(UMr(),GMr)}}),vWe=class{signer;constructor(e){this.signer=e.signer}presign(e,n={}){return this.signer.presign(e,n)}async sign(e,n){return EUt.isInstance(e)&&bUt(e)?{...await this.signer.presign({...e,body:""},{...n,expiresIn:60,unsignableHeaders:new Set(Object.keys(e.headers).filter(i=>i!=="host"))}),body:e.body}:this.signer.sign(e,n)}signMessage(e,n){return this.signer.signMessage(e,n)}},WMr=t=>{let{signer:e}=t;return Object.assign(t,{signer:async n=>{let r=await e(n);if(HMr(r))return new vWe({signer:r});throw new Error("Expected WebsocketSignatureV4 signer, please check the client constructor.")}})},HMr=t=>!!t,RWe=class extends TransformStream{constructor(e,n,r,i,s){let o=e,a=s?.();super({start(){},async transform(c,u){try{let l=new Date(Date.now()+await i()),d={":date":{type:"timestamp",value:l}},m=await n.sign({message:{body:c,headers:d},priorSignature:o},{signingDate:l,eventStreamCredentials:await a});o=m.signature;let h=r.encode({headers:{...d,":chunk-signature":{type:"binary",value:DMr(m.signature)}},body:c});u.enqueue(h)}catch(l){u.error(l)}}})}},kWe=class{messageSigner;eventStreamCodec;systemClockOffsetProvider;credentials;constructor(e){this.messageSigner=e.messageSigner,this.eventStreamCodec=new kMr(e.utf8Encoder,e.utf8Decoder),this.systemClockOffsetProvider=async()=>e.systemClockOffset??0,this.credentials=e.credentials}async handle(e,n,r={}){let i=n.request,{body:s,headers:o,query:a}=i;if(!(s instanceof ReadableStream))throw new Error("Eventstream payload must be a ReadableStream.");let c=new TransformStream;i.body=c.readable;let l=((o?.authorization??"").match(/Signature=(\w+)$/)??[])[1]??(a&&a["X-Amz-Signature"])??"";r.__staticSignature&&(l="");let d=new RWe(l,await this.messageSigner(),this.eventStreamCodec,this.systemClockOffsetProvider,this.credentials);s.pipeThrough(d).pipeThrough(c);let m;try{m=await e(n)}catch(h){let f=s.cancel?.();throw f instanceof Promise&&f.catch(()=>{}),h}return m}},qMr=t=>new kWe(t);y7.WebSocketFetchHandler=TWe;y7.eventStreamPayloadHandlerProvider=qMr;y7.getWebSocketPlugin=$Mr;y7.resolveWebSocketConfig=WMr});var hhe,fhe,xUt=v(()=>{p();ti();hhe=t=>Bp.isInstance(t)?t.headers?.date??t.headers?.Date:void 0,fhe=t=>Bp.isInstance(t)?t.headers?.age??t.headers?.Age:void 0});var E7,SUt=v(()=>{p();E7=t=>new Date(Date.now()+t)});var ghe,CUt=v(()=>{p();ghe=(t,e,n,r)=>{if(r!==void 0)return e;let i=Date.parse(t),s=Date.now();return n!==void 0&&s-n>9e5?e:n!==void 0?i-(n+s)/2:i-s}});var BWe=v(()=>{p();xUt();SUt();CUt()});var b7,QW,Op,NWe,DWe=v(()=>{p();ti();BWe();b7=(t,e)=>{if(!e)throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return e},QW=async t=>{let e=b7("context",t.context),n=b7("config",t.config),r=e.endpointV2?.properties?.authSchemes?.[0],s=await b7("signer",n.signer)(r),o=t?.signingRegion,a=t?.signingRegionSet,c=t?.signingName;return{config:n,signer:s,signingRegion:o,signingRegionSet:a,signingName:c}},Op=class{async sign(e,n,r){if(!no.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let i=await QW(r),{config:s,signer:o}=i,{signingRegion:a,signingName:c}=i,u=r.context;if(u?.authSchemes?.length??!1){let[m,h]=u.authSchemes;m?.name==="sigv4a"&&h?.name==="sigv4"&&(a=h?.signingRegion??a,c=h?.signingName??c)}let l=await s.disableClockSkewCorrection?.()===!0;return r._disableClockSkewCorrection=l,l||(r._preRequestSystemClockOffset=s.systemClockOffset,r._requestSentAt=Date.now()),await o.sign(e,{signingDate:l?new Date:E7(s.systemClockOffset),signingRegion:a,signingService:c})}errorHandler(e){return n=>{let r=n;if(!e._disableClockSkewCorrection){let i=r.ServerTime??hhe(r.$response);if(i){let s=b7("config",e.config),o=e._preRequestSystemClockOffset,a=e._requestSentAt,c=fhe(r.$response),u=ghe(i,s.systemClockOffset,a,c);s.systemClockOffset=u,Math.abs(u)>=24e4&&(u!==o||o!==void 0&&o!==u)&&r.$metadata&&(r.$metadata.clockSkewCorrected=!0)}}throw n}}successHandler(e,n){if(n._disableClockSkewCorrection)return;let r=hhe(e);if(r){let i=b7("config",n.config),s=n._requestSentAt,o=fhe(e);i.systemClockOffset=ghe(r,i.systemClockOffset,s,o)}}},NWe=Op});var zT,IUt=v(()=>{p();ti();BWe();DWe();zT=class extends Op{async sign(e,n,r){if(!no.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:i,signer:s,signingRegion:o,signingRegionSet:a,signingName:c}=await QW(r),l=(await i.sigv4aSigningRegionSet?.()??a??[o]).join(","),d=await i.disableClockSkewCorrection?.()===!0;return r._disableClockSkewCorrection=d,d||(r._preRequestSystemClockOffset=i.systemClockOffset,r._requestSentAt=Date.now()),await s.sign(e,{signingDate:d?new Date:E7(i.systemClockOffset),signingRegion:l,signingService:c})}}});var PWe,wUt=v(()=>{p();PWe=t=>typeof t=="string"&&t.length>0?t.split(",").map(e=>e.trim()):[]});var Ahe,MWe=v(()=>{p();Ahe=t=>`AWS_BEARER_TOKEN_${t.replace(/[\s-]/g,"_").toUpperCase()}`});var TUt,vUt,j_,RUt=v(()=>{p();wUt();MWe();TUt="AWS_AUTH_SCHEME_PREFERENCE",vUt="auth_scheme_preference",j_={environmentVariableSelector:(t,e)=>{if(e?.signingName&&Ahe(e.signingName)in t)return["httpBearerAuth"];if(TUt in t)return PWe(t[TUt])},configFileSelector:t=>{if(vUt in t)return PWe(t[vUt])},default:[]}});var _7,x7,kUt=v(()=>{p();Yg();Da();_7=t=>(t.sigv4aSigningRegionSet=y0(t.sigv4aSigningRegionSet),t),x7={environmentVariableSelector(t){if(t.AWS_SIGV4A_SIGNING_REGION_SET)return t.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map(e=>e.trim());throw new my("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(t){if(t.sigv4a_signing_region_set)return(t.sigv4a_signing_region_set??"").split(",").map(e=>e.trim());throw new my("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0}});var VWe=re(Os=>{p();var{hasOwn:GW,fromUtf8:BUt,fromHex:jMr,toHex:AO,toUint8Array:S7,isArrayBuffer:VMr}=(Mi(),wr(k1)),{normalizeProvider:NUt}=(Yi(),wr(ppe)),{escapeUri:yhe,HttpRequest:OUt}=(ti(),wr(vC)),OWe=class{format(e){let n=[];for(let s in e){if(!GW(e,s))continue;let o=BUt(s);n.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(e[s]))}let r=new Uint8Array(n.reduce((s,o)=>s+o.byteLength,0)),i=0;for(let s of n)r.set(s,i),i+=s.byteLength;return r}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let n=new DataView(new ArrayBuffer(3));return n.setUint8(0,3),n.setInt16(1,e.value,!1),new Uint8Array(n.buffer);case"integer":let r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,e.value,!1),new Uint8Array(r.buffer);case"long":let i=new Uint8Array(9);return i[0]=5,i.set(e.value.bytes,1),i;case"binary":let s=new DataView(new ArrayBuffer(3+e.value.byteLength));s.setUint8(0,6),s.setUint16(1,e.value.byteLength,!1);let o=new Uint8Array(s.buffer);return o.set(e.value,3),o;case"string":let a=BUt(e.value),c=new DataView(new ArrayBuffer(3+a.byteLength));c.setUint8(0,7),c.setUint16(1,a.byteLength,!1);let u=new Uint8Array(c.buffer);return u.set(a,3),u;case"timestamp":let l=new Uint8Array(9);return l[0]=8,l.set(LWe.fromNumber(e.value.valueOf()).bytes,1),l;case"uuid":if(!YMr.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let d=new Uint8Array(17);return d[0]=9,d.set(jMr(e.value.replace(/-/g,"")),1),d}}},DUt;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(DUt||(DUt={}));var YMr=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,LWe=class t{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let n=new Uint8Array(8);for(let r=7,i=Math.abs(Math.round(e));r>-1&&i>0;r--,i/=256)n[r]=i;return e<0&&PUt(n),new t(n)}valueOf(){let e=this.bytes.slice(0),n=e[0]&128;return n&&PUt(e),parseInt(AO(e),16)*(n?-1:1)}toString(){return String(this.valueOf())}};function PUt(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}var LUt="X-Amz-Algorithm",FUt="X-Amz-Credential",GWe="X-Amz-Date",QUt="X-Amz-SignedHeaders",UUt="X-Amz-Expires",$We="X-Amz-Signature",WWe="X-Amz-Security-Token",zMr="X-Amz-Region-Set",HWe="authorization",qWe=GWe.toLowerCase(),GUt="date",$Ut=[HWe,qWe,GUt],WUt=$We.toLowerCase(),She="x-amz-content-sha256",HUt=WWe.toLowerCase(),KMr="host",qUt={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},jUt=/^proxy-/,VUt=/^sec-/,JMr=[/^proxy-/i,/^sec-/i],Ehe="AWS4-HMAC-SHA256",XMr="AWS4-ECDSA-P256-SHA256",YUt="AWS4-HMAC-SHA256-PAYLOAD",zUt="UNSIGNED-PAYLOAD",KUt=50,jWe="aws4_request",JUt=3600*24*7,XUt=({query:t={}})=>{let e=[],n={};for(let r in t){if(!GW(t,r)||r.toLowerCase()===WUt)continue;let i=yhe(r);e.push(i);let s=t[r];typeof s=="string"?n[i]=`${i}=${yhe(s)}`:Array.isArray(s)&&(n[i]=s.slice(0).reduce((o,a)=>o.concat([`${i}=${yhe(a)}`]),[]).sort().join("&"))}return e.sort().map(r=>n[r]).filter(r=>r).join("&")},ZMr=t=>eOr(t).toISOString().replace(/\.\d{3}Z$/,"Z"),eOr=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t,Che=class{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:n,region:r,service:i,sha256:s,uriEscapePath:o=!0}){this.service=i,this.sha256=s,this.uriEscapePath=o,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=NUt(r),this.credentialProvider=NUt(n)}createCanonicalRequest(e,n,r){let i=Object.keys(n).sort();return`${e.method} ${this.getCanonicalPath(e)} -${$Tt(e)} -${s.map(i=>`${i}:${n[i]}`).join(` +${XUt(e)} +${i.map(s=>`${s}:${n[s]}`).join(` `)} -${s.join(";")} -${r}`}async createStringToSign(e,n,r,s){let i=new this.sha256;i.update(C6(r));let o=await i.digest();return`${s} +${i.join(";")} +${r}`}async createStringToSign(e,n,r,i){let s=new this.sha256;s.update(S7(r));let o=await s.digest();return`${i} ${e} ${n} -${yB(o)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let n=[];for(let i of e.split("/"))i?.length!==0&&i!=="."&&(i===".."?n.pop():n.push(i));let r=`${e?.startsWith("/")?"/":""}${n.join("/")}${n.length>0&&e?.endsWith("/")?"/":""}`;return Tce(r).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){let n=tor(e).replace(/[-:]/g,"");return{longDate:n,shortDate:n.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}},g2={},Rce=[],kce=(t,e,n)=>`${t}/${e}/${n}/${_Me}`,GTt=async(t,e,n,r,s)=>{let i=await ITt(t,e.secretAccessKey,e.accessKeyId),o=`${n}:${r}:${s}:${yB(i)}:${e.sessionToken}`;if(o in g2)return g2[o];for(Rce.push(o);Rce.length>QTt;)delete g2[Rce.shift()];let a=`AWS4${e.secretAccessKey}`;for(let c of[n,r,s,_Me])a=await ITt(t,a,c);return g2[o]=a},ror=()=>{Rce.length=0,Object.keys(g2).forEach(t=>{delete g2[t]})},ITt=(t,e,n)=>{let r=new t(e);return r.update(C6(n)),r.digest()},hMe=({headers:t},e,n)=>{let r={};for(let s of Object.keys(t).sort()){if(t[s]==null)continue;let i=s.toLowerCase();(i in PTt||e?.has(i)||OTt.test(i)||MTt.test(i))&&(!n||n&&!n.has(i))||(r[i]=t[s].trim().replace(/\s+/g," "))}return r},Nce=async({headers:t,body:e},n)=>{for(let r in t)if(A2(t,r)&&r.toLowerCase()===Dce)return t[r];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||Kir(e)){let r=new n;return r.update(C6(e)),yB(await r.digest())}return FTt},WTt=(t,e)=>{t=t.toLowerCase();for(let n in e)if(A2(e,n)&&t===n.toLowerCase())return!0;return!1},qTt=(t,e={})=>{let{headers:n,query:r={}}=xTt.clone(t);for(let s in n){if(!A2(n,s))continue;let i=s.toLowerCase();(i.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(i)||e.hoistableHeaders?.has(i))&&(r[s]=n[s],delete n[s])}return{...t,headers:n,query:r}},mMe=t=>{t=xTt.clone(t);for(let e in t.headers)A2(t.headers,e)&&NTt.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t},fMe=class extends Bce{headerFormatter=new dMe;constructor({applyChecksum:e,credentials:n,region:r,service:s,sha256:i,uriEscapePath:o=!0}){super({applyChecksum:e,credentials:n,region:r,service:s,sha256:i,uriEscapePath:o})}async presign(e,n={}){let{signingDate:r=new Date,expiresIn:s=3600,unsignableHeaders:i,unhoistableHeaders:o,signableHeaders:a,hoistableHeaders:c,signingRegion:u,signingService:l}=n,d=await this.credentialProvider();this.validateResolvedCredentials(d);let h=u??await this.regionProvider(),{longDate:m,shortDate:f}=this.formatDate(r);if(s>UTt)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let g=kce(f,h,l??this.service),A=qTt(mMe(e),{unhoistableHeaders:o,hoistableHeaders:c});d.sessionToken&&(A.query[yMe]=d.sessionToken),A.query[wTt]=vce,A.query[TTt]=`${d.accessKeyId}/${g}`,A.query[gMe]=m,A.query[RTt]=s.toString(10);let y=hMe(A,i,a);return A.query[vTt]=this.getCanonicalHeaderList(y),A.query[AMe]=await this.getSignature(m,g,this.getSigningKey(d,h,f,l),this.createCanonicalRequest(A,y,await Nce(e,this.sha256))),A}async sign(e,n){return typeof e=="string"?this.signString(e,n):e.headers&&e.payload?this.signEvent(e,n):e.message?this.signMessage(e,n):this.signRequest(e,n)}async signEvent({headers:e,payload:n},{signingDate:r=new Date,priorSignature:s,signingRegion:i,signingService:o,eventStreamCredentials:a}){let c=i??await this.regionProvider(),{shortDate:u,longDate:l}=this.formatDate(r),d=kce(u,c,o??this.service),h=await Nce({headers:{},body:n},this.sha256),m=new this.sha256;m.update(e);let f=yB(await m.digest()),g=[LTt,l,d,s,f,h].join(` -`);return this.signString(g,{signingDate:r,signingRegion:c,signingService:o,eventStreamCredentials:a})}async signMessage(e,{signingDate:n=new Date,signingRegion:r,signingService:s,eventStreamCredentials:i}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:n,signingRegion:r,signingService:s,priorSignature:e.priorSignature,eventStreamCredentials:i}).then(a=>({message:e.message,signature:a}))}async signString(e,{signingDate:n=new Date,signingRegion:r,signingService:s,eventStreamCredentials:i}={}){let o=i??await this.credentialProvider();this.validateResolvedCredentials(o);let a=r??await this.regionProvider(),{shortDate:c}=this.formatDate(n),u=new this.sha256(await this.getSigningKey(o,a,c,s));return u.update(C6(e)),yB(await u.digest())}async signRequest(e,{signingDate:n=new Date,signableHeaders:r,unsignableHeaders:s,signingRegion:i,signingService:o}={}){let a=await this.credentialProvider();this.validateResolvedCredentials(a);let c=i??await this.regionProvider(),u=mMe(e),{longDate:l,shortDate:d}=this.formatDate(n),h=kce(d,c,o??this.service);u.headers[bMe]=l,a.sessionToken&&(u.headers[BTt]=a.sessionToken);let m=await Nce(u,this.sha256);!WTt(Dce,u.headers)&&this.applyChecksum&&(u.headers[Dce]=m);let f=hMe(u,s,r),g=await this.getSignature(l,h,this.getSigningKey(a,c,d,o),this.createCanonicalRequest(u,f,m));return u.headers[EMe]=`${vce} Credential=${a.accessKeyId}/${h}, SignedHeaders=${this.getCanonicalHeaderList(f)}, Signature=${g}`,u}async getSignature(e,n,r,s){let i=await this.createStringToSign(e,n,s,vce),o=new this.sha256(await r);return o.update(C6(i)),yB(await o.digest())}getSigningKey(e,n,r,s){return GTt(this.sha256,e,r,n,s||this.service)}},sor={SignatureV4a:null};xi.ALGORITHM_IDENTIFIER=vce;xi.ALGORITHM_IDENTIFIER_V4A=eor;xi.ALGORITHM_QUERY_PARAM=wTt;xi.ALWAYS_UNSIGNABLE_HEADERS=PTt;xi.AMZ_DATE_HEADER=bMe;xi.AMZ_DATE_QUERY_PARAM=gMe;xi.AUTH_HEADER=EMe;xi.CREDENTIAL_QUERY_PARAM=TTt;xi.DATE_HEADER=kTt;xi.EVENT_ALGORITHM_IDENTIFIER=LTt;xi.EXPIRES_QUERY_PARAM=RTt;xi.GENERATED_HEADERS=NTt;xi.HOST_HEADER=Xir;xi.KEY_TYPE_IDENTIFIER=_Me;xi.MAX_CACHE_SIZE=QTt;xi.MAX_PRESIGNED_TTL=UTt;xi.PROXY_HEADER_PATTERN=OTt;xi.REGION_SET_PARAM=Jir;xi.SEC_HEADER_PATTERN=MTt;xi.SHA256_HEADER=Dce;xi.SIGNATURE_HEADER=DTt;xi.SIGNATURE_QUERY_PARAM=AMe;xi.SIGNED_HEADERS_QUERY_PARAM=vTt;xi.SignatureV4=fMe;xi.SignatureV4Base=Bce;xi.TOKEN_HEADER=BTt;xi.TOKEN_QUERY_PARAM=yMe;xi.UNSIGNABLE_PATTERNS=Zir;xi.UNSIGNED_PAYLOAD=FTt;xi.clearCredentialCache=ror;xi.createScope=kce;xi.getCanonicalHeaders=hMe;xi.getCanonicalQuery=$Tt;xi.getPayloadHash=Nce;xi.getSigningKey=GTt;xi.hasHeader=WTt;xi.moveHeadersToQuery=qTt;xi.prepareRequest=mMe;xi.signatureV4aContainer=sor});function ior(t,{credentials:e,credentialDefaultProvider:n}){let r;return e?e?.memoized?r=e:r=p6(e,d6,m2):n?r=jy(n(Object.assign({},t,{parentClientConfig:t}))):r=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}function oor(t,e){if(e.configBound)return e;let n=async r=>e({...r,callerClientConfig:t});return n.memoized=e.memoized,n.configBound=!0,n}var CMe,IMe,HTt=V(()=>{p();Go();vp();CMe=Gt(SMe()),IMe=t=>e=>{let n=e.credentials,r=!!e.credentials,s;Object.defineProperty(e,"credentials",{set(l){l&&l!==n&&l!==s&&(r=!0),n=l;let d=ior(e,{credentials:n,credentialDefaultProvider:e.credentialDefaultProvider}),h=oor(e,d);if(r&&!h.attributed){let m=typeof n=="object"&&n!==null;s=async f=>{let A=await h(f);return m&&(!A.$source||Object.keys(A.$source).length===0)?Lv(A,"CREDENTIALS_CODE","e"):A},s.memoized=h.memoized,s.configBound=h.configBound,s.attributed=!0}else s=h},get(){return s},enumerable:!0,configurable:!0}),e.credentials=n;let{signingEscapePath:i=!0,systemClockOffset:o=e.systemClockOffset||0,sha256:a}=e,c;return e.signer?c=jy(e.signer):e.regionInfoProvider?c=()=>jy(e.region)().then(async l=>[await e.regionInfoProvider(l,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},l]).then(([l,d])=>{let{signingRegion:h,signingService:m}=l;e.signingRegion=e.signingRegion||h||d,e.signingName=e.signingName||m||e.serviceId;let f={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:a,uriEscapePath:i},g=e.signerConstructor||CMe.SignatureV4;return new g(f)}):c=async l=>{l=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await jy(e.region)(),properties:{}},l);let d=l.signingRegion,h=l.signingName;e.signingRegion=e.signingRegion||d,e.signingName=e.signingName||h||e.serviceId;let m={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:a,uriEscapePath:i},f=e.signerConstructor||CMe.SignatureV4;return new f(m)},Object.assign(e,{systemClockOffset:o,signingEscapePath:i,signer:c,disableClockSkewCorrection:jy(e.disableClockSkewCorrection??t)})}});var xMe=V(()=>{p();cMe();mTt();yTt();ETt();HTt()});var aor,cor,VTt,jTt=V(()=>{p();Jo();aor="AWS_DISABLE_CLOCK_SKEW_CORRECTION",cor="disable_clock_skew_correction",VTt={environmentVariableSelector:t=>Md(t,aor,Ru.ENV),configFileSelector:t=>Md(t,cor,Ru.CONFIG),default:!1}});var YTt,KTt=V(()=>{p();Jo();jTt();YTt=ei(VTt)});var y2={};Ir(y2,{AWSSDKSigV4Signer:()=>aMe,AwsSdkSigV4ASigner:()=>Tx,AwsSdkSigV4Signer:()=>Ud,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:()=>r_,NODE_SIGV4A_CONFIG_OPTIONS:()=>S6,getBearerTokenEnvKey:()=>wce,resolveAWSSDKSigV4Config:()=>lor,resolveAwsSdkSigV4AConfig:()=>_6,resolveAwsSdkSigV4Config:()=>qS,validateSigningProperties:()=>f2});var qS,lor,$d=V(()=>{p();xMe();uMe();xMe();KTt();qS=IMe(YTt),lor=qS});var vMe=ee(cR=>{"use strict";p();Object.defineProperty(cR,"__esModule",{value:!0});cR.resolveHttpAuthSchemeConfig=cR.defaultBedrockRuntimeHttpAuthSchemeProvider=cR.defaultBedrockRuntimeHttpAuthSchemeParametersProvider=void 0;var uor=($d(),Un(y2)),wMe=(vp(),Un(h6)),TMe=(Is(),Un(oB)),dor=async(t,e,n)=>({operation:(0,TMe.getSmithyContext)(e).operation,region:await(0,TMe.normalizeProvider)(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});cR.defaultBedrockRuntimeHttpAuthSchemeParametersProvider=dor;function por(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function hor(t){return{schemeId:"smithy.api#httpBearerAuth",propertiesExtractor:({profile:e,filepath:n,configFilepath:r,ignoreCache:s},i)=>({identityProperties:{profile:e,filepath:n,configFilepath:r,ignoreCache:s}})}}var mor=t=>{let e=[];switch(t.operation){default:e.push(por(t)),e.push(hor(t))}return e};cR.defaultBedrockRuntimeHttpAuthSchemeProvider=mor;var gor=t=>{let e=(0,wMe.memoizeIdentityProvider)(t.token,wMe.isIdentityExpired,wMe.doesIdentityRequireRefresh),n=(0,uor.resolveAwsSdkSigV4Config)(t);return Object.assign(n,{authSchemePreference:(0,TMe.normalizeProvider)(t.authSchemePreference??[]),token:e})};cR.resolveHttpAuthSchemeConfig=gor});var Cvt={};Ir(Cvt,{__addDisposableResource:()=>bvt,__assign:()=>Pce,__asyncDelegator:()=>pvt,__asyncGenerator:()=>dvt,__asyncValues:()=>hvt,__await:()=>E2,__awaiter:()=>ivt,__classPrivateFieldGet:()=>Avt,__classPrivateFieldIn:()=>Evt,__classPrivateFieldSet:()=>yvt,__createBinding:()=>Mce,__decorate:()=>XTt,__disposeResources:()=>_vt,__esDecorate:()=>evt,__exportStar:()=>avt,__extends:()=>zTt,__generator:()=>ovt,__importDefault:()=>gvt,__importStar:()=>fvt,__makeTemplateObject:()=>mvt,__metadata:()=>svt,__param:()=>ZTt,__propKey:()=>nvt,__read:()=>NMe,__rest:()=>JTt,__rewriteRelativeImportExtension:()=>Svt,__runInitializers:()=>tvt,__setFunctionName:()=>rvt,__spread:()=>cvt,__spreadArray:()=>uvt,__spreadArrays:()=>lvt,__values:()=>Oce,default:()=>Eor});function zTt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");RMe(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function JTt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s=0;a--)(o=t[a])&&(i=(s<3?o(i):s>3?o(e,n,i):o(e,n))||i);return s>3&&i&&Object.defineProperty(e,n,i),i}function ZTt(t,e){return function(n,r){e(n,r,t)}}function evt(t,e,n,r,s,i){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=r.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&t?r.static?t:t.prototype:null,l=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d,h=!1,m=n.length-1;m>=0;m--){var f={};for(var g in r)f[g]=g==="access"?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(y){if(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(y||null))};var A=(0,n[m])(a==="accessor"?{get:l.get,set:l.set}:l[c],f);if(a==="accessor"){if(A===void 0)continue;if(A===null||typeof A!="object")throw new TypeError("Object expected");(d=o(A.get))&&(l.get=d),(d=o(A.set))&&(l.set=d),(d=o(A.init))&&s.unshift(d)}else(d=o(A))&&(a==="field"?s.unshift(d):l[c]=d)}u&&Object.defineProperty(u,r.name,l),h=!0}function tvt(t,e,n){for(var r=arguments.length>2,s=0;s0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function NMe(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i}function cvt(){for(var t=[],e=0;e1||c(m,g)})},f&&(s[m]=f(s[m])))}function c(m,f){try{u(r[m](f))}catch(g){h(i[0][3],g)}}function u(m){m.value instanceof E2?Promise.resolve(m.value.v).then(l,d):h(i[0][2],m)}function l(m){c("next",m)}function d(m){c("throw",m)}function h(m,f){m(f),i.shift(),i.length&&c(i[0][0],i[0][1])}}function pvt(t){var e,n;return e={},r("next"),r("throw",function(s){throw s}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(s,i){e[s]=t[s]?function(o){return(n=!n)?{value:E2(t[s](o)),done:!1}:i?i(o):o}:i}}function hvt(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Oce=="function"?Oce(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=t[i]&&function(o){return new Promise(function(a,c){o=t[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}function mvt(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function fvt(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n=kMe(t),r=0;r{p();RMe=function(t,e){return RMe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},RMe(t,e)};Pce=function(){return Pce=Object.assign||function(e){for(var n,r=1,s=arguments.length;r{bor.exports={name:"@aws-sdk/client-bedrock-runtime",description:"AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",version:"3.1048.0",scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline client-bedrock-runtime","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo bedrock-runtime",test:"yarn g:vitest run --passWithNoTests","test:browser":"yarn g:vitest run -c vitest.config.browser.e2e.mts","test:browser:watch":"yarn g:vitest watch -c vitest.config.browser.e2e.mts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts","test:index":"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs","test:integration":"yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts","test:integration:watch":"yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts","test:watch":"yarn g:vitest watch --passWithNoTests"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"^3.974.11","@aws-sdk/credential-provider-node":"^3.972.42","@aws-sdk/eventstream-handler-node":"^3.972.16","@aws-sdk/middleware-eventstream":"^3.972.12","@aws-sdk/middleware-websocket":"^3.972.19","@aws-sdk/token-providers":"3.1048.0","@aws-sdk/types":"^3.973.8","@smithy/core":"^3.24.2","@smithy/fetch-http-handler":"^5.4.2","@smithy/node-http-handler":"^4.7.2","@smithy/types":"^4.14.1",tslib:"^2.6.2"},devDependencies:{"@smithy/snapshot-testing":"^2.1.2","@tsconfig/node20":"20.1.8","@types/node":"^20.14.8",concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3",vitest:"^4.0.17"},engines:{node:">=20.0.0"},typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-bedrock-runtime",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-bedrock-runtime"}}});var DMe=ee(lR=>{p();var{setCredentialFeature:_or}=(Go(),Un(Zg)),{CredentialsProviderError:Sor}=(Jo(),Un(xf)),wvt="AWS_ACCESS_KEY_ID",Tvt="AWS_SECRET_ACCESS_KEY",vvt="AWS_SESSION_TOKEN",Rvt="AWS_CREDENTIAL_EXPIRATION",kvt="AWS_CREDENTIAL_SCOPE",Nvt="AWS_ACCOUNT_ID",Cor=t=>async()=>{t?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let e=process.env[wvt],n=process.env[Tvt],r=process.env[vvt],s=process.env[Rvt],i=process.env[kvt],o=process.env[Nvt];if(e&&n){let a={accessKeyId:e,secretAccessKey:n,...r&&{sessionToken:r},...s&&{expiration:new Date(s)},...i&&{credentialScope:i},...o&&{accountId:o}};return _or(a,"CREDENTIALS_ENV_VARS","g"),a}throw new Sor("Unable to find environment variable credentials.",{logger:t?.logger})};lR.ENV_ACCOUNT_ID=Nvt;lR.ENV_CREDENTIAL_SCOPE=kvt;lR.ENV_EXPIRATION=Rvt;lR.ENV_KEY=wvt;lR.ENV_SECRET=Tvt;lR.ENV_SESSION=vvt;lR.fromEnv=Cor});var Fce=ee(Yy=>{p();var{ProviderError:BMe,CredentialsProviderError:uR,loadConfig:FMe}=(Jo(),Un(xf)),Ior=require("node:http"),{parseUrl:xor}=($r(),Un(qy)),Ovt=t=>!!t&&typeof t=="object"&&typeof t.AccessKeyId=="string"&&typeof t.SecretAccessKey=="string"&&typeof t.Token=="string"&&typeof t.Expiration=="string",Mvt=t=>({accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:new Date(t.Expiration),...t.AccountId&&{accountId:t.AccountId}}),Lvt=1e3,Fvt=0,QMe=({maxRetries:t=Fvt,timeout:e=Lvt})=>({maxRetries:t,timeout:e});function w6(t){return new Promise((e,n)=>{let r=Ior.request({method:"GET",...t,hostname:t.hostname?.replace(/^\[(.+)\]$/,"$1")});r.on("error",s=>{n(Object.assign(new BMe("Unable to connect to instance metadata service"),s)),r.destroy()}),r.on("timeout",()=>{n(new BMe("TimeoutError from instance metadata service")),r.destroy()}),r.on("response",s=>{let{statusCode:i=400}=s;(i<200||300<=i)&&(n(Object.assign(new BMe("Error response received from instance metadata service"),{statusCode:i})),r.destroy());let o=[];s.on("data",a=>{o.push(a)}),s.on("end",()=>{e(Buffer.concat(o)),r.destroy()})}),r.end()})}var OMe=(t,e)=>{let n=t();for(let r=0;r{let{timeout:e,maxRetries:n}=QMe(t);return()=>OMe(async()=>{let r=await Nor({logger:t.logger}),s=JSON.parse(await Tor(e,r));if(!Ovt(s))throw new uR("Invalid response received from instance metadata service.",{logger:t.logger});return Mvt(s)},n)},Tor=async(t,e)=>(process.env[MMe]&&(e.headers={...e.headers,Authorization:process.env[MMe]}),(await w6({...e,timeout:t})).toString()),vor="169.254.170.2",Ror=new Set(["localhost","127.0.0.1"]),kor=new Set(["http:","https:"]),Nor=async({logger:t})=>{if(process.env[Lce])return{hostname:vor,path:process.env[Lce]};if(process.env[I6]){let e;try{e=new URL(process.env[I6])}catch{throw new uR(`${process.env[I6]} is not a valid container metadata service URL`,{tryNextLink:!1,logger:t})}if(!e.hostname||!Ror.has(e.hostname))throw new uR(`${e.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:t});if(!e.protocol||!kor.has(e.protocol))throw new uR(`${e.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:t});return{protocol:e.protocol,hostname:e.hostname,path:e.pathname+e.search,port:e.port?parseInt(e.port,10):void 0}}throw new uR(`The container metadata credential provider cannot be used unless the ${Lce} or ${I6} environment variable is set`,{tryNextLink:!1,logger:t})},LMe=class t extends uR{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(e,n=!0){super(e,n),this.tryNextLink=n,Object.setPrototypeOf(this,t.prototype)}},x6;(function(t){t.IPv4="http://169.254.169.254",t.IPv6="http://[fd00:ec2::254]"})(x6||(x6={}));var Dor="AWS_EC2_METADATA_SERVICE_ENDPOINT",Bor="ec2_metadata_service_endpoint",Por={environmentVariableSelector:t=>t[Dor],configFileSelector:t=>t[Bor],default:void 0},b2;(function(t){t.IPv4="IPv4",t.IPv6="IPv6"})(b2||(b2={}));var Oor="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",Mor="ec2_metadata_service_endpoint_mode",Lor={environmentVariableSelector:t=>t[Oor],configFileSelector:t=>t[Mor],default:b2.IPv4},Qvt=async()=>xor(await For()||await Qor()),For=async()=>FMe(Por)(),Qor=async()=>{let t=await FMe(Lor)();switch(t){case b2.IPv4:return x6.IPv4;case b2.IPv6:return x6.IPv6;default:throw new Error(`Unsupported endpoint mode: ${t}. Select from ${Object.values(b2)}`)}},Uor=300,$or=300,Gor="https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html",Dvt=(t,e)=>{let n=Uor+Math.floor(Math.random()*$or),r=new Date(Date.now()+n*1e3);e.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(r)}. -For more information, please visit: `+Gor);let s=t.originalExpiration??t.expiration;return{...t,...s?{originalExpiration:s}:{},expiration:r}},Wor=(t,e={})=>{let n=e?.logger||console,r;return async()=>{let s;try{s=await t(),s.expiration&&s.expiration.getTime()Wor(Vor(t),{logger:t.logger}),Vor=(t={})=>{let e=!1,{logger:n,profile:r}=t,{timeout:s,maxRetries:i}=QMe(t),o=async(a,c)=>{if(e||c.headers?.[Pvt]==null){let d=!1,h=!1,m=await FMe({environmentVariableSelector:f=>{let g=f[PMe];if(h=!!g&&g!=="false",g===void 0)throw new uR(`${PMe} not set in env, checking config file next.`,{logger:t.logger});return h},configFileSelector:f=>{let g=f[Bvt];return d=!!g&&g!=="false",d},default:!1},{profile:r})();if(t.ec2MetadataV1Disabled||m){let f=[];throw t.ec2MetadataV1Disabled&&f.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"),d&&f.push(`config file profile (${Bvt})`),h&&f.push(`process environment variable (${PMe})`),new LMe(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${f.join(", ")}].`)}}let l=(await OMe(async()=>{let d;try{d=await Yor(c)}catch(h){throw h.statusCode===401&&(e=!1),h}return d},a)).trim();return OMe(async()=>{let d;try{d=await Kor(l,c,t)}catch(h){throw h.statusCode===401&&(e=!1),h}return d},a)};return async()=>{let a=await Qvt();if(e)return n?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),o(i,{...a,timeout:s});{let c;try{c=(await jor({...a,timeout:s})).toString()}catch(u){if(u?.statusCode===400)throw Object.assign(u,{message:"EC2 Metadata token request returned error"});return(u.message==="TimeoutError"||[403,404,405].includes(u.statusCode))&&(e=!0),n?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),o(i,{...a,timeout:s})}return o(i,{...a,headers:{[Pvt]:c},timeout:s})}}},jor=async t=>w6({...t,path:qor,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Yor=async t=>(await w6({...t,path:Uvt})).toString(),Kor=async(t,e,n)=>{let r=JSON.parse((await w6({...e,path:Uvt+t})).toString());if(!Ovt(r))throw new uR("Invalid response received from instance metadata service.",{logger:n.logger});return Mvt(r)};Yy.DEFAULT_MAX_RETRIES=Fvt;Yy.DEFAULT_TIMEOUT=Lvt;Yy.ENV_CMDS_AUTH_TOKEN=MMe;Yy.ENV_CMDS_FULL_URI=I6;Yy.ENV_CMDS_RELATIVE_URI=Lce;Yy.Endpoint=x6;Yy.fromContainerMetadata=wor;Yy.fromInstanceMetadata=Hor;Yy.getInstanceMetadataEndpoint=Qvt;Yy.httpRequest=w6;Yy.providerConfigFromInit=QMe});var EB=ee(v6=>{p();var{hasOwn:Vvt}=(js(),Un(xx)),{streamCollector:zor}=(js(),Un(xx));v6.streamCollector=zor;var{buildQueryString:jvt,HttpResponse:Yvt}=($r(),Un(qy)),Qce=require("node:https"),{Readable:Jor}=require("node:stream"),UMe=require("node:http2");function $ce(t){let e=t&&typeof t=="object"&&"reason"in t?t.reason:void 0;if(e){if(e instanceof Error){let s=new Error("Request aborted");return s.name="AbortError",s.cause=e,s}let r=new Error(String(e));return r.name="AbortError",r}let n=new Error("Request aborted");return n.name="AbortError",n}var Xor=["ECONNRESET","EPIPE","ETIMEDOUT"],Kvt=t=>{let e={};for(let n in t){if(!Vvt(t,n))continue;let r=t[n];e[n]=Array.isArray(r)?r.join(","):r}return e},Rp={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},$vt=1e3,Zor=(t,e,n=0)=>{if(!n)return-1;let r=s=>{let i=Rp.setTimeout(()=>{t.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${n} ms.`),{name:"TimeoutError"}))},n-s),o=a=>{a?.connecting?a.on("connect",()=>{Rp.clearTimeout(i)}):Rp.clearTimeout(i)};t.socket?o(t.socket):t.on("socket",o)};return n<2e3?(r(0),0):Rp.setTimeout(r.bind(null,$vt),$vt)},ear=(t,e,n=0,r,s)=>n?Rp.setTimeout(()=>{let i=`@smithy/node-http-handler - [${r?"ERROR":"WARN"}] a request has exceeded the configured ${n} ms requestTimeout.`;if(r){let o=Object.assign(new Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});t.destroy(o),e(o)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",s?.warn?.(i)},n):-1,tar=3e3,nar=(t,{keepAlive:e,keepAliveMsecs:n},r=tar)=>{if(e!==!0)return-1;let s=()=>{t.socket?t.socket.setKeepAlive(e,n||0):t.on("socket",i=>{i.setKeepAlive(e,n||0)})};return r===0?(s(),0):Rp.setTimeout(s,r)},Gvt=3e3,rar=(t,e,n=0)=>{let r=s=>{let i=n-s,o=()=>{t.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${n} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};t.socket?(t.socket.setTimeout(i,o),t.on("close",()=>t.socket?.removeListener("timeout",o))):t.setTimeout(i,o)};return 0{o=Number(Rp.setTimeout(()=>c(!0),Math.max(Wvt,n)))}),new Promise(c=>{t.on("continue",()=>{Rp.clearTimeout(o),c(!0)}),t.on("response",()=>{Rp.clearTimeout(o),c(!1)}),t.on("error",()=>{Rp.clearTimeout(o),c(!1)})})])),a&&sar(t,e.body)}function sar(t,e){if(e instanceof Jor){e.pipe(t);return}if(e){let n=Buffer.isBuffer(e);if(n||typeof e=="string"){n&&e.byteLength===0?t.end():t.end(e);return}let s=e;if(typeof s=="object"&&s.buffer&&typeof s.byteOffset=="number"&&typeof s.byteLength=="number"){t.end(Buffer.from(s.buffer,s.byteOffset,s.byteLength));return}t.end(Buffer.from(e));return}t.end()}var iar=0,Uce,qvt,$Me=class t{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){return typeof e?.handle=="function"?e:new t(e)}static checkSocketUsage(e,n,r=console){let{sockets:s,requests:i,maxSockets:o}=e;if(typeof o!="number"||o===1/0||Date.now()-15e3=o&&l>=2*o)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${l} additional requests are enqueued. +${AO(o)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let n=[];for(let s of e.split("/"))s?.length!==0&&s!=="."&&(s===".."?n.pop():n.push(s));let r=`${e?.startsWith("/")?"/":""}${n.join("/")}${n.length>0&&e?.endsWith("/")?"/":""}`;return yhe(r).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){let n=ZMr(e).replace(/[-:]/g,"");return{longDate:n,shortDate:n.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}},UW={},bhe=[],_he=(t,e,n)=>`${t}/${e}/${n}/${jWe}`,ZUt=async(t,e,n,r,i)=>{let s=await MUt(t,e.secretAccessKey,e.accessKeyId),o=`${n}:${r}:${i}:${AO(s)}:${e.sessionToken}`;if(o in UW)return UW[o];for(bhe.push(o);bhe.length>KUt;)delete UW[bhe.shift()];let a=`AWS4${e.secretAccessKey}`;for(let c of[n,r,i,jWe])a=await MUt(t,a,c);return UW[o]=a},tOr=()=>{bhe.length=0,Object.keys(UW).forEach(t=>{delete UW[t]})},MUt=(t,e,n)=>{let r=new t(e);return r.update(S7(n)),r.digest()},FWe=({headers:t},e,n)=>{let r={};for(let i of Object.keys(t).sort()){if(t[i]==null)continue;let s=i.toLowerCase();(s in qUt||e?.has(s)||jUt.test(s)||VUt.test(s))&&(!n||n&&!n.has(s))||(r[s]=t[i].trim().replace(/\s+/g," "))}return r},xhe=async({headers:t,body:e},n)=>{for(let r in t)if(GW(t,r)&&r.toLowerCase()===She)return t[r];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||VMr(e)){let r=new n;return r.update(S7(e)),AO(await r.digest())}return zUt},eGt=(t,e)=>{t=t.toLowerCase();for(let n in e)if(GW(e,n)&&t===n.toLowerCase())return!0;return!1},tGt=(t,e={})=>{let{headers:n,query:r={}}=OUt.clone(t);for(let i in n){if(!GW(n,i))continue;let s=i.toLowerCase();(s.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(s)||e.hoistableHeaders?.has(s))&&(r[i]=n[i],delete n[i])}return{...t,headers:n,query:r}},QWe=t=>{t=OUt.clone(t);for(let e in t.headers)GW(t.headers,e)&&$Ut.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t},UWe=class extends Che{headerFormatter=new OWe;constructor({applyChecksum:e,credentials:n,region:r,service:i,sha256:s,uriEscapePath:o=!0}){super({applyChecksum:e,credentials:n,region:r,service:i,sha256:s,uriEscapePath:o})}async presign(e,n={}){let{signingDate:r=new Date,expiresIn:i=3600,unsignableHeaders:s,unhoistableHeaders:o,signableHeaders:a,hoistableHeaders:c,signingRegion:u,signingService:l}=n,d=await this.credentialProvider();this.validateResolvedCredentials(d);let m=u??await this.regionProvider(),{longDate:h,shortDate:f}=this.formatDate(r);if(i>JUt)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let g=_he(f,m,l??this.service),A=tGt(QWe(e),{unhoistableHeaders:o,hoistableHeaders:c});d.sessionToken&&(A.query[WWe]=d.sessionToken),A.query[LUt]=Ehe,A.query[FUt]=`${d.accessKeyId}/${g}`,A.query[GWe]=h,A.query[UUt]=i.toString(10);let y=FWe(A,s,a);return A.query[QUt]=this.getCanonicalHeaderList(y),A.query[$We]=await this.getSignature(h,g,this.getSigningKey(d,m,f,l),this.createCanonicalRequest(A,y,await xhe(e,this.sha256))),A}async sign(e,n){return typeof e=="string"?this.signString(e,n):e.headers&&e.payload?this.signEvent(e,n):e.message?this.signMessage(e,n):this.signRequest(e,n)}async signEvent({headers:e,payload:n},{signingDate:r=new Date,priorSignature:i,signingRegion:s,signingService:o,eventStreamCredentials:a}){let c=s??await this.regionProvider(),{shortDate:u,longDate:l}=this.formatDate(r),d=_he(u,c,o??this.service),m=await xhe({headers:{},body:n},this.sha256),h=new this.sha256;h.update(e);let f=AO(await h.digest()),g=[YUt,l,d,i,f,m].join(` +`);return this.signString(g,{signingDate:r,signingRegion:c,signingService:o,eventStreamCredentials:a})}async signMessage(e,{signingDate:n=new Date,signingRegion:r,signingService:i,eventStreamCredentials:s}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:n,signingRegion:r,signingService:i,priorSignature:e.priorSignature,eventStreamCredentials:s}).then(a=>({message:e.message,signature:a}))}async signString(e,{signingDate:n=new Date,signingRegion:r,signingService:i,eventStreamCredentials:s}={}){let o=s??await this.credentialProvider();this.validateResolvedCredentials(o);let a=r??await this.regionProvider(),{shortDate:c}=this.formatDate(n),u=new this.sha256(await this.getSigningKey(o,a,c,i));return u.update(S7(e)),AO(await u.digest())}async signRequest(e,{signingDate:n=new Date,signableHeaders:r,unsignableHeaders:i,signingRegion:s,signingService:o}={}){let a=await this.credentialProvider();this.validateResolvedCredentials(a);let c=s??await this.regionProvider(),u=QWe(e),{longDate:l,shortDate:d}=this.formatDate(n),m=_he(d,c,o??this.service);u.headers[qWe]=l,a.sessionToken&&(u.headers[HUt]=a.sessionToken);let h=await xhe(u,this.sha256);!eGt(She,u.headers)&&this.applyChecksum&&(u.headers[She]=h);let f=FWe(u,i,r),g=await this.getSignature(l,m,this.getSigningKey(a,c,d,o),this.createCanonicalRequest(u,f,h));return u.headers[HWe]=`${Ehe} Credential=${a.accessKeyId}/${m}, SignedHeaders=${this.getCanonicalHeaderList(f)}, Signature=${g}`,u}async getSignature(e,n,r,i){let s=await this.createStringToSign(e,n,i,Ehe),o=new this.sha256(await r);return o.update(S7(s)),AO(await o.digest())}getSigningKey(e,n,r,i){return ZUt(this.sha256,e,r,n,i||this.service)}},nOr={SignatureV4a:null};Os.ALGORITHM_IDENTIFIER=Ehe;Os.ALGORITHM_IDENTIFIER_V4A=XMr;Os.ALGORITHM_QUERY_PARAM=LUt;Os.ALWAYS_UNSIGNABLE_HEADERS=qUt;Os.AMZ_DATE_HEADER=qWe;Os.AMZ_DATE_QUERY_PARAM=GWe;Os.AUTH_HEADER=HWe;Os.CREDENTIAL_QUERY_PARAM=FUt;Os.DATE_HEADER=GUt;Os.EVENT_ALGORITHM_IDENTIFIER=YUt;Os.EXPIRES_QUERY_PARAM=UUt;Os.GENERATED_HEADERS=$Ut;Os.HOST_HEADER=KMr;Os.KEY_TYPE_IDENTIFIER=jWe;Os.MAX_CACHE_SIZE=KUt;Os.MAX_PRESIGNED_TTL=JUt;Os.PROXY_HEADER_PATTERN=jUt;Os.REGION_SET_PARAM=zMr;Os.SEC_HEADER_PATTERN=VUt;Os.SHA256_HEADER=She;Os.SIGNATURE_HEADER=WUt;Os.SIGNATURE_QUERY_PARAM=$We;Os.SIGNED_HEADERS_QUERY_PARAM=QUt;Os.SignatureV4=UWe;Os.SignatureV4Base=Che;Os.TOKEN_HEADER=HUt;Os.TOKEN_QUERY_PARAM=WWe;Os.UNSIGNABLE_PATTERNS=JMr;Os.UNSIGNED_PAYLOAD=zUt;Os.clearCredentialCache=tOr;Os.createScope=_he;Os.getCanonicalHeaders=FWe;Os.getCanonicalQuery=XUt;Os.getPayloadHash=xhe;Os.getSigningKey=ZUt;Os.hasHeader=eGt;Os.moveHeadersToQuery=tGt;Os.prepareRequest=QWe;Os.signatureV4aContainer=nOr});function rOr(t,{credentials:e,credentialDefaultProvider:n}){let r;return e?e?.memoized?r=e:r=m7(e,p7,FW):n?r=y0(n(Object.assign({},t,{parentClientConfig:t}))):r=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}function iOr(t,e){if(e.configBound)return e;let n=async r=>e({...r,callerClientConfig:t});return n.memoized=e.memoized,n.configBound=!0,n}var YWe,zWe,nGt=v(()=>{p();Pa();Yg();YWe=Ot(VWe()),zWe=t=>e=>{let n=e.credentials,r=!!e.credentials,i;Object.defineProperty(e,"credentials",{set(l){l&&l!==n&&l!==i&&(r=!0),n=l;let d=rOr(e,{credentials:n,credentialDefaultProvider:e.credentialDefaultProvider}),m=iOr(e,d);if(r&&!m.attributed){let h=typeof n=="object"&&n!==null;i=async f=>{let A=await m(f);return h&&(!A.$source||Object.keys(A.$source).length===0)?E1(A,"CREDENTIALS_CODE","e"):A},i.memoized=m.memoized,i.configBound=m.configBound,i.attributed=!0}else i=m},get(){return i},enumerable:!0,configurable:!0}),e.credentials=n;let{signingEscapePath:s=!0,systemClockOffset:o=e.systemClockOffset||0,sha256:a}=e,c;return e.signer?c=y0(e.signer):e.regionInfoProvider?c=()=>y0(e.region)().then(async l=>[await e.regionInfoProvider(l,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},l]).then(([l,d])=>{let{signingRegion:m,signingService:h}=l;e.signingRegion=e.signingRegion||m||d,e.signingName=e.signingName||h||e.serviceId;let f={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:a,uriEscapePath:s},g=e.signerConstructor||YWe.SignatureV4;return new g(f)}):c=async l=>{l=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await y0(e.region)(),properties:{}},l);let d=l.signingRegion,m=l.signingName;e.signingRegion=e.signingRegion||d,e.signingName=e.signingName||m||e.serviceId;let h={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:a,uriEscapePath:s},f=e.signerConstructor||YWe.SignatureV4;return new f(h)},Object.assign(e,{systemClockOffset:o,signingEscapePath:s,signer:c,disableClockSkewCorrection:y0(e.disableClockSkewCorrection??t)})}});var KWe=v(()=>{p();DWe();IUt();RUt();kUt();nGt()});var sOr,oOr,rGt,iGt=v(()=>{p();Da();sOr="AWS_DISABLE_CLOCK_SKEW_CORRECTION",oOr="disable_clock_skew_correction",rGt={environmentVariableSelector:t=>Np(t,sOr,Sd.ENV),configFileSelector:t=>Np(t,oOr,Sd.CONFIG),default:!1}});var sGt,oGt=v(()=>{p();Da();iGt();sGt=cs(rGt)});var Ihe={};br(Ihe,{AWSSDKSigV4Signer:()=>NWe,AwsSdkSigV4ASigner:()=>zT,AwsSdkSigV4Signer:()=>Op,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:()=>j_,NODE_SIGV4A_CONFIG_OPTIONS:()=>x7,getBearerTokenEnvKey:()=>Ahe,resolveAWSSDKSigV4Config:()=>aOr,resolveAwsSdkSigV4AConfig:()=>_7,resolveAwsSdkSigV4Config:()=>GC,validateSigningProperties:()=>QW});var GC,aOr,xh=v(()=>{p();KWe();MWe();KWe();oGt();GC=zWe(sGt),aOr=GC});var JWe=re(j1=>{p();var{setCredentialFeature:cOr}=(Pa(),wr(q_)),{CredentialsProviderError:lOr}=(Da(),wr(fy)),aGt="AWS_ACCESS_KEY_ID",cGt="AWS_SECRET_ACCESS_KEY",lGt="AWS_SESSION_TOKEN",uGt="AWS_CREDENTIAL_EXPIRATION",dGt="AWS_CREDENTIAL_SCOPE",pGt="AWS_ACCOUNT_ID",uOr=t=>async()=>{t?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let e=process.env[aGt],n=process.env[cGt],r=process.env[lGt],i=process.env[uGt],s=process.env[dGt],o=process.env[pGt];if(e&&n){let a={accessKeyId:e,secretAccessKey:n,...r&&{sessionToken:r},...i&&{expiration:new Date(i)},...s&&{credentialScope:s},...o&&{accountId:o}};return cOr(a,"CREDENTIALS_ENV_VARS","g"),a}throw new lOr("Unable to find environment variable credentials.",{logger:t?.logger})};j1.ENV_ACCOUNT_ID=pGt;j1.ENV_CREDENTIAL_SCOPE=dGt;j1.ENV_EXPIRATION=uGt;j1.ENV_KEY=aGt;j1.ENV_SECRET=cGt;j1.ENV_SESSION=lGt;j1.fromEnv=uOr});var The=re(E0=>{p();var{ProviderError:XWe,CredentialsProviderError:V1,loadConfig:rHe}=(Da(),wr(fy)),dOr=require("node:http"),{parseUrl:pOr}=(ti(),wr(vC)),gGt=t=>!!t&&typeof t=="object"&&typeof t.AccessKeyId=="string"&&typeof t.SecretAccessKey=="string"&&typeof t.Token=="string"&&typeof t.Expiration=="string",AGt=t=>({accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:new Date(t.Expiration),...t.AccountId&&{accountId:t.AccountId}}),yGt=1e3,EGt=0,iHe=({maxRetries:t=EGt,timeout:e=yGt})=>({maxRetries:t,timeout:e});function w7(t){return new Promise((e,n)=>{let r=dOr.request({method:"GET",...t,hostname:t.hostname?.replace(/^\[(.+)\]$/,"$1")});r.on("error",i=>{n(Object.assign(new XWe("Unable to connect to instance metadata service"),i)),r.destroy()}),r.on("timeout",()=>{n(new XWe("TimeoutError from instance metadata service")),r.destroy()}),r.on("response",i=>{let{statusCode:s=400}=i;(s<200||300<=s)&&(n(Object.assign(new XWe("Error response received from instance metadata service"),{statusCode:s})),r.destroy());let o=[];i.on("data",a=>{o.push(a)}),i.on("end",()=>{e(Buffer.concat(o)),r.destroy()})}),r.end()})}var eHe=(t,e)=>{let n=t();for(let r=0;r{let{timeout:e,maxRetries:n}=iHe(t);return()=>eHe(async()=>{let r=await yOr({logger:t.logger}),i=JSON.parse(await hOr(e,r));if(!gGt(i))throw new V1("Invalid response received from instance metadata service.",{logger:t.logger});return AGt(i)},n)},hOr=async(t,e)=>(process.env[tHe]&&(e.headers={...e.headers,Authorization:process.env[tHe]}),(await w7({...e,timeout:t})).toString()),fOr="169.254.170.2",gOr=new Set(["localhost","127.0.0.1"]),AOr=new Set(["http:","https:"]),yOr=async({logger:t})=>{if(process.env[whe])return{hostname:fOr,path:process.env[whe]};if(process.env[C7]){let e;try{e=new URL(process.env[C7])}catch{throw new V1(`${process.env[C7]} is not a valid container metadata service URL`,{tryNextLink:!1,logger:t})}if(!e.hostname||!gOr.has(e.hostname))throw new V1(`${e.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:t});if(!e.protocol||!AOr.has(e.protocol))throw new V1(`${e.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:t});return{protocol:e.protocol,hostname:e.hostname,path:e.pathname+e.search,port:e.port?parseInt(e.port,10):void 0}}throw new V1(`The container metadata credential provider cannot be used unless the ${whe} or ${C7} environment variable is set`,{tryNextLink:!1,logger:t})},nHe=class t extends V1{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(e,n=!0){super(e,n),this.tryNextLink=n,Object.setPrototypeOf(this,t.prototype)}},I7;(function(t){t.IPv4="http://169.254.169.254",t.IPv6="http://[fd00:ec2::254]"})(I7||(I7={}));var EOr="AWS_EC2_METADATA_SERVICE_ENDPOINT",bOr="ec2_metadata_service_endpoint",_Or={environmentVariableSelector:t=>t[EOr],configFileSelector:t=>t[bOr],default:void 0},$W;(function(t){t.IPv4="IPv4",t.IPv6="IPv6"})($W||($W={}));var xOr="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",SOr="ec2_metadata_service_endpoint_mode",COr={environmentVariableSelector:t=>t[xOr],configFileSelector:t=>t[SOr],default:$W.IPv4},bGt=async()=>pOr(await IOr()||await wOr()),IOr=async()=>rHe(_Or)(),wOr=async()=>{let t=await rHe(COr)();switch(t){case $W.IPv4:return I7.IPv4;case $W.IPv6:return I7.IPv6;default:throw new Error(`Unsupported endpoint mode: ${t}. Select from ${Object.values($W)}`)}},TOr=300,vOr=300,ROr="https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html",mGt=(t,e)=>{let n=TOr+Math.floor(Math.random()*vOr),r=new Date(Date.now()+n*1e3);e.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(r)}. +For more information, please visit: `+ROr);let i=t.originalExpiration??t.expiration;return{...t,...i?{originalExpiration:i}:{},expiration:r}},kOr=(t,e={})=>{let n=e?.logger||console,r;return async()=>{let i;try{i=await t(),i.expiration&&i.expiration.getTime()kOr(DOr(t),{logger:t.logger}),DOr=(t={})=>{let e=!1,{logger:n,profile:r}=t,{timeout:i,maxRetries:s}=iHe(t),o=async(a,c)=>{if(e||c.headers?.[fGt]==null){let d=!1,m=!1,h=await rHe({environmentVariableSelector:f=>{let g=f[ZWe];if(m=!!g&&g!=="false",g===void 0)throw new V1(`${ZWe} not set in env, checking config file next.`,{logger:t.logger});return m},configFileSelector:f=>{let g=f[hGt];return d=!!g&&g!=="false",d},default:!1},{profile:r})();if(t.ec2MetadataV1Disabled||h){let f=[];throw t.ec2MetadataV1Disabled&&f.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"),d&&f.push(`config file profile (${hGt})`),m&&f.push(`process environment variable (${ZWe})`),new nHe(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${f.join(", ")}].`)}}let l=(await eHe(async()=>{let d;try{d=await MOr(c)}catch(m){throw m.statusCode===401&&(e=!1),m}return d},a)).trim();return eHe(async()=>{let d;try{d=await OOr(l,c,t)}catch(m){throw m.statusCode===401&&(e=!1),m}return d},a)};return async()=>{let a=await bGt();if(e)return n?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),o(s,{...a,timeout:i});{let c;try{c=(await POr({...a,timeout:i})).toString()}catch(u){if(u?.statusCode===400)throw Object.assign(u,{message:"EC2 Metadata token request returned error"});return(u.message==="TimeoutError"||[403,404,405].includes(u.statusCode))&&(e=!0),n?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),o(s,{...a,timeout:i})}return o(s,{...a,headers:{[fGt]:c},timeout:i})}}},POr=async t=>w7({...t,path:BOr,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),MOr=async t=>(await w7({...t,path:_Gt})).toString(),OOr=async(t,e,n)=>{let r=JSON.parse((await w7({...e,path:_Gt+t})).toString());if(!gGt(r))throw new V1("Invalid response received from instance metadata service.",{logger:n.logger});return AGt(r)};E0.DEFAULT_MAX_RETRIES=EGt;E0.DEFAULT_TIMEOUT=yGt;E0.ENV_CMDS_AUTH_TOKEN=tHe;E0.ENV_CMDS_FULL_URI=C7;E0.ENV_CMDS_RELATIVE_URI=whe;E0.Endpoint=I7;E0.fromContainerMetadata=mOr;E0.fromInstanceMetadata=NOr;E0.getInstanceMetadataEndpoint=bGt;E0.httpRequest=w7;E0.providerConfigFromInit=iHe});var Y1=re(v7=>{p();var{hasOwn:TGt}=(Mi(),wr(k1)),{streamCollector:LOr}=(Mi(),wr(k1));v7.streamCollector=LOr;var{buildQueryString:vGt,HttpResponse:RGt}=(ti(),wr(vC)),vhe=require("node:https"),{Readable:FOr}=require("node:stream"),sHe=require("node:http2");function khe(t){let e=t&&typeof t=="object"&&"reason"in t?t.reason:void 0;if(e){if(e instanceof Error){let i=new Error("Request aborted");return i.name="AbortError",i.cause=e,i}let r=new Error(String(e));return r.name="AbortError",r}let n=new Error("Request aborted");return n.name="AbortError",n}var QOr=["ECONNRESET","EPIPE","ETIMEDOUT"],kGt=t=>{let e={};for(let n in t){if(!TGt(t,n))continue;let r=t[n];e[n]=Array.isArray(r)?r.join(","):r}return e},vm={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},xGt=1e3,UOr=(t,e,n=0)=>{if(!n)return-1;let r=i=>{let s=vm.setTimeout(()=>{t.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${n} ms.`),{name:"TimeoutError"}))},n-i),o=a=>{a?.connecting?a.on("connect",()=>{vm.clearTimeout(s)}):vm.clearTimeout(s)};t.socket?o(t.socket):t.on("socket",o)};return n<2e3?(r(0),0):vm.setTimeout(r.bind(null,xGt),xGt)},GOr=(t,e,n=0,r,i)=>n?vm.setTimeout(()=>{let s=`@smithy/node-http-handler - [${r?"ERROR":"WARN"}] a request has exceeded the configured ${n} ms requestTimeout.`;if(r){let o=Object.assign(new Error(s),{name:"TimeoutError",code:"ETIMEDOUT"});t.destroy(o),e(o)}else s+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",i?.warn?.(s)},n):-1,$Or=3e3,WOr=(t,{keepAlive:e,keepAliveMsecs:n},r=$Or)=>{if(e!==!0)return-1;let i=()=>{t.socket?t.socket.setKeepAlive(e,n||0):t.on("socket",s=>{s.setKeepAlive(e,n||0)})};return r===0?(i(),0):vm.setTimeout(i,r)},SGt=3e3,HOr=(t,e,n=0)=>{let r=i=>{let s=n-i,o=()=>{t.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${n} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};t.socket?(t.socket.setTimeout(s,o),t.on("close",()=>t.socket?.removeListener("timeout",o))):t.setTimeout(s,o)};return 0{o=Number(vm.setTimeout(()=>c(!0),Math.max(CGt,n)))}),new Promise(c=>{t.on("continue",()=>{vm.clearTimeout(o),c(!0)}),t.on("response",()=>{vm.clearTimeout(o),c(!1)}),t.on("error",()=>{vm.clearTimeout(o),c(!1)})})])),a&&qOr(t,e.body)}function qOr(t,e){if(e instanceof FOr){e.pipe(t);return}if(e){let n=Buffer.isBuffer(e);if(n||typeof e=="string"){n&&e.byteLength===0?t.end():t.end(e);return}let i=e;if(typeof i=="object"&&i.buffer&&typeof i.byteOffset=="number"&&typeof i.byteLength=="number"){t.end(Buffer.from(i.buffer,i.byteOffset,i.byteLength));return}t.end(Buffer.from(e));return}t.end()}var jOr=0,Rhe,IGt,oHe=class t{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){return typeof e?.handle=="function"?e:new t(e)}static checkSocketUsage(e,n,r=console){let{sockets:i,requests:s,maxSockets:o}=e;if(typeof o!="number"||o===1/0||Date.now()-15e3=o&&l>=2*o)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${l} additional requests are enqueued. See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html -or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return n}constructor(e){this.configProvider=new Promise((n,r)=>{typeof e=="function"?e().then(s=>{n(this.resolveDefaultConfig(s))}).catch(r):n(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:n,requestTimeout:r}={}){this.config||(this.config=await this.configProvider);let s=this.config,i=s.logger,o=e.protocol==="https:";return!o&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((a,c)=>{let u,l=-1,d=-1,h=-1,m=-1,f=-1,g=()=>{Rp.clearTimeout(l),Rp.clearTimeout(d),Rp.clearTimeout(h),Rp.clearTimeout(m),Rp.clearTimeout(f)},A=async H=>{await u,g(),a(H)},y=async H=>{await u,g(),c(H)};if(n?.aborted){let H=$ce(n);y(H);return}let b=e.headers,S=b?(b.Expect??b.expect)==="100-continue":!1,C=o?s.httpsAgent:s.httpAgent;S&&!this.externalAgent&&(C=new(o?Qce.Agent:Uce)({keepAlive:!1,maxSockets:1/0})),l=Rp.setTimeout(()=>{this.socketWarningTimestamp=t.checkSocketUsage(C,this.socketWarningTimestamp,i)},s.socketAcquisitionWarningTimeout??(s.requestTimeout??2e3)+(s.connectionTimeout??1e3));let I=e.query?jvt(e.query):"",x;if(e.username!=null||e.password!=null){let H=e.username??"",oe=e.password??"";x=`${H}:${oe}`}let w=e.path;I&&(w+=`?${I}`),e.fragment&&(w+=`#${e.fragment}`);let R=e.hostname??"";R[0]==="["&&R.endsWith("]")?R=e.hostname.slice(1,-1):R=e.hostname;let N={headers:e.headers,host:R,method:e.method,path:w,port:e.port,agent:C,auth:x},G=(o?Qce.request:qvt)(N,H=>{let oe=new Yvt({statusCode:H.statusCode||-1,reason:H.statusMessage,headers:Kvt(H.headers),body:H});A({response:oe})});if(G.on("error",H=>{Xor.includes(H.code)?y(Object.assign(H,{name:"TimeoutError"})):y(H)}),n){let H=()=>{G.destroy();let oe=$ce(n);y(oe)};if(typeof n.addEventListener=="function"){let oe=n;oe.addEventListener("abort",H,{once:!0}),G.once("close",()=>oe.removeEventListener("abort",H))}else n.onabort=H}let $=r??s.requestTimeout;d=Zor(G,y,s.connectionTimeout),h=ear(G,y,$,s.throwOnRequestTimeout,i??console),m=rar(G,y,s.socketTimeout);let Q=N.agent;typeof Q=="object"&&"keepAlive"in Q&&(f=nar(G,{keepAlive:Q.keepAlive,keepAliveMsecs:Q.keepAliveMsecs})),u=zvt(G,e,$,this.externalAgent).catch(H=>(g(),c(H)))})}updateHttpClientConfig(e,n){this.config=void 0,this.configProvider=this.configProvider.then(r=>e===Symbol.for("logger")?{...r,logger:r.logger??n}:{...r,[e]:n})}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:n,connectionTimeout:r,socketTimeout:s,socketAcquisitionWarningTimeout:i,httpAgent:o,httpsAgent:a,throwOnRequestTimeout:c,logger:u}=e||{},l=!0,d=50;return{connectionTimeout:r,requestTimeout:n,socketTimeout:s,socketAcquisitionWarningTimeout:i,throwOnRequestTimeout:c,httpAgentProvider:async()=>{let h=require("node:http"),{Agent:m,request:f}=h.default??h;return qvt=f,Uce=m,o instanceof Uce||typeof o?.destroy=="function"?(this.externalAgent=!0,o):new Uce({keepAlive:l,maxSockets:d,...o})},httpsAgent:a instanceof Qce.Agent||typeof a?.destroy=="function"?(this.externalAgent=!0,a):new Qce.Agent({keepAlive:l,maxSockets:d,...a}),logger:u}}},oar=new Uint16Array(1),T6=class{id=oar[0]++;total=0;max=0;session;refs=0;constructor(e){e.unref(),this.session=e}retain(){if(this.session.destroyed)throw new Error("@smithy/node-http-handler - cannot acquire reference to destroyed session.");this.refs+=1,this.total+=1,this.max=Math.max(this.refs,this.max),this.session.ref()}free(){if(!this.session.destroyed&&(this.refs-=1,this.refs===0&&this.session.unref(),this.refs<0))throw new Error("@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement.")}deref(){return this.session}close(){this.session.closed||this.session.close()}destroy(){this.refs=0,this.session.destroyed||this.session.destroy()}useCount(){return this.refs}},GMe=class{sessions=[];maxConcurrency=0;constructor(e){this.sessions=(e??[]).map(n=>new T6(n))}poll(){let e=!1;for(let n of this.sessions){if(n.deref().destroyed){e=!0;continue}if(!this.maxConcurrency||n.useCount()-1&&this.sessions.splice(n,1)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}setMaxConcurrency(e){this.maxConcurrency=e}destroy(e){this.remove(e),e.destroy()}},WMe=class{config;connectOptions;connectionPools=new Map;constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(e,n){let r=this.getUrlString(e),s=this.getPool(r);if(!this.config.disableConcurrency&&!n.isEventStream){let u=s.poll();if(u)return u.retain(),u}let i=new T6(this.connect(r)),o=i.deref();this.config.maxConcurrency&&o.settings({maxConcurrentStreams:this.config.maxConcurrency},u=>{if(u)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+e.destination.toString())});let a=()=>{this.removeFromPoolAndClose(r,i)},c=()=>{this.removeFromPoolAndCheckedDestroy(r,i)};return o.on("goaway",a),o.on("error",c),o.on("frameError",c),o.on("close",c),n.requestTimeout&&o.setTimeout(n.requestTimeout,c),s.offerLast(i),i.retain(),i}release(e,n){n.free()}createIsolatedSession(e,n){let r=this.getUrlString(e),s=new T6(this.connect(r)),i=s.deref();i.settings({maxConcurrentStreams:1});let o=()=>{s.destroy()};return i.on("error",o),i.on("frameError",o),i.on("close",o),n.requestTimeout&&i.setTimeout(n.requestTimeout,o),s.retain(),s}destroy(){for(let[e,n]of this.connectionPools){for(let r of[...n])r.destroy();this.connectionPools.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=e;for(let n of this.connectionPools.values())n.setMaxConcurrency(e)}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}setNodeHttp2ConnectOptions(e){this.connectOptions=e}debug(){let e={};for(let[n,r]of this.connectionPools){let s=[];for(let i of r)s.push({id:i.id,active:i.useCount(),maxConcurrent:i.max,totalRequests:i.total});e[n]={sessions:s}}return e}removeFromPoolAndClose(e,n){this.connectionPools.get(e)?.remove(n),n.close()}removeFromPoolAndCheckedDestroy(e,n){this.connectionPools.get(e)?.remove(n),n.destroy()}getPool(e){if(!this.connectionPools.has(e)){let n=new GMe;this.config.maxConcurrency&&n.setMaxConcurrency(this.config.maxConcurrency),this.connectionPools.set(e,n)}return this.connectionPools.get(e)}getUrlString(e){return e.destination.toString()}connect(e){return this.connectOptions===void 0?UMe.connect(e):UMe.connect(e,this.connectOptions)}},{constants:Hvt}=UMe,qMe=class t{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new WMe({});static create(e){return typeof e?.handle=="function"?e:new t(e)}constructor(e){this.configProvider=new Promise((n,r)=>{typeof e=="function"?e().then(s=>{n(s||{})}).catch(r):n(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:n,requestTimeout:r,isEventStream:s}={}){if(!this.config){this.config=await this.configProvider;let{disableConcurrentStreams:u,maxConcurrentStreams:l,nodeHttp2ConnectOptions:d}=this.config;this.connectionManager.setDisableConcurrentStreams(u??!1),l&&this.connectionManager.setMaxConcurrentStreams(l),d&&this.connectionManager.setNodeHttp2ConnectOptions(d)}let{requestTimeout:i,disableConcurrentStreams:o}=this.config,a=o||s,c=r??i;return new Promise((u,l)=>{let d=!1,h,m=async H=>{await h,u(H)},f=async H=>{await h,l(H)};if(n?.aborted){d=!0;let H=$ce(n);f(H);return}let{hostname:g,method:A,port:y,protocol:b,query:S}=e,C="";if(e.username!=null||e.password!=null){let H=e.username??"",oe=e.password??"";C=`${H}:${oe}@`}let I=`${b}//${C}${g}${y?`:${y}`:""}`,x={destination:new URL(I)},w={requestTimeout:this.config?.sessionTimeout,isEventStream:s},R=a?this.connectionManager.createIsolatedSession(x,w):this.connectionManager.lease(x,w),N=R.deref(),P=H=>{a&&R.destroy(),d=!0,f(H)},G=S?jvt(S):"",$=e.path;G&&($+=`?${G}`),e.fragment&&($+=`#${e.fragment}`);let Q=N.request({...e.headers,[Hvt.HTTP2_HEADER_PATH]:$,[Hvt.HTTP2_HEADER_METHOD]:A});if(c&&Q.setTimeout(c,()=>{Q.close();let H=new Error(`Stream timed out because of no activity for ${c} ms`);H.name="TimeoutError",P(H)}),n){let H=()=>{Q.close();let oe=$ce(n);P(oe)};if(typeof n.addEventListener=="function"){let oe=n;oe.addEventListener("abort",H,{once:!0}),Q.once("close",()=>oe.removeEventListener("abort",H))}else n.onabort=H}Q.on("frameError",(H,oe,re)=>{P(new Error(`Frame type id ${H} in stream id ${re} has failed with code ${oe}.`))}),Q.on("error",P),Q.on("aborted",()=>{P(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${Q.rstCode}.`))}),Q.on("response",H=>{let oe=new Yvt({statusCode:H[":status"]??-1,headers:Kvt(H),body:Q});d=!0,m({response:oe}),a&&N.close()}),Q.on("close",()=>{a?R.destroy():this.connectionManager.release(x,R),d||P(new Error("Unexpected error: http2 request did not get a response"))}),h=zvt(Q,e,c)})}updateHttpClientConfig(e,n){this.config=void 0,this.configProvider=this.configProvider.then(r=>({...r,[e]:n}))}httpHandlerConfigs(){return this.config??{}}};v6.DEFAULT_REQUEST_TIMEOUT=iar;v6.NodeHttp2Handler=qMe;v6.NodeHttpHandler=$Me});var HMe=ee(Xvt=>{p();var{setCredentialFeature:aar}=(Go(),Un(Zg)),{CredentialsProviderError:bB}=(Jo(),Un(xf)),{NodeHttpHandler:car}=EB(),lar=require("node:fs/promises"),{HttpRequest:uar}=($r(),Un(qy)),{sdkStreamMixin:dar,parseRfc3339DateTime:par}=(js(),Un(xx)),har="169.254.170.2",mar="169.254.170.23",far="[fd00:ec2::23]",gar=(t,e)=>{if(t.protocol!=="https:"&&!(t.hostname===har||t.hostname===mar||t.hostname===far)){if(t.hostname.includes("[")){if(t.hostname==="[::1]"||t.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(t.hostname==="localhost")return;let n=t.hostname.split("."),r=s=>{let i=parseInt(s,10);return 0<=i&&i<=255};if(n[0]==="127"&&r(n[1])&&r(n[2])&&r(n[3])&&n.length===4)return}throw new bB(`URL not accepted. It must either be HTTPS or match one of the following: +or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return n}constructor(e){this.configProvider=new Promise((n,r)=>{typeof e=="function"?e().then(i=>{n(this.resolveDefaultConfig(i))}).catch(r):n(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:n,requestTimeout:r}={}){this.config||(this.config=await this.configProvider);let i=this.config,s=i.logger,o=e.protocol==="https:";return!o&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((a,c)=>{let u,l=-1,d=-1,m=-1,h=-1,f=-1,g=()=>{vm.clearTimeout(l),vm.clearTimeout(d),vm.clearTimeout(m),vm.clearTimeout(h),vm.clearTimeout(f)},A=async q=>{await u,g(),a(q)},y=async q=>{await u,g(),c(q)};if(n?.aborted){let q=khe(n);y(q);return}let E=e.headers,_=E?(E.Expect??E.expect)==="100-continue":!1,S=o?i.httpsAgent:i.httpAgent;_&&!this.externalAgent&&(S=new(o?vhe.Agent:Rhe)({keepAlive:!1,maxSockets:1/0})),l=vm.setTimeout(()=>{this.socketWarningTimestamp=t.checkSocketUsage(S,this.socketWarningTimestamp,s)},i.socketAcquisitionWarningTimeout??(i.requestTimeout??2e3)+(i.connectionTimeout??1e3));let C=e.query?vGt(e.query):"",I;if(e.username!=null||e.password!=null){let q=e.username??"",ce=e.password??"";I=`${q}:${ce}`}let w=e.path;C&&(w+=`?${C}`),e.fragment&&(w+=`#${e.fragment}`);let k=e.hostname??"";k[0]==="["&&k.endsWith("]")?k=e.hostname.slice(1,-1):k=e.hostname;let N={headers:e.headers,host:k,method:e.method,path:w,port:e.port,agent:S,auth:I},W=(o?vhe.request:IGt)(N,q=>{let ce=new RGt({statusCode:q.statusCode||-1,reason:q.statusMessage,headers:kGt(q.headers),body:q});A({response:ce})});if(W.on("error",q=>{QOr.includes(q.code)?y(Object.assign(q,{name:"TimeoutError"})):y(q)}),n){let q=()=>{W.destroy();let ce=khe(n);y(ce)};if(typeof n.addEventListener=="function"){let ce=n;ce.addEventListener("abort",q,{once:!0}),W.once("close",()=>ce.removeEventListener("abort",q))}else n.onabort=q}let $=r??i.requestTimeout;d=UOr(W,y,i.connectionTimeout),m=GOr(W,y,$,i.throwOnRequestTimeout,s??console),h=HOr(W,y,i.socketTimeout);let G=N.agent;typeof G=="object"&&"keepAlive"in G&&(f=WOr(W,{keepAlive:G.keepAlive,keepAliveMsecs:G.keepAliveMsecs})),u=BGt(W,e,$,this.externalAgent).catch(q=>(g(),c(q)))})}updateHttpClientConfig(e,n){this.config=void 0,this.configProvider=this.configProvider.then(r=>e===Symbol.for("logger")?{...r,logger:r.logger??n}:{...r,[e]:n})}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:n,connectionTimeout:r,socketTimeout:i,socketAcquisitionWarningTimeout:s,httpAgent:o,httpsAgent:a,throwOnRequestTimeout:c,logger:u}=e||{},l=!0,d=50;return{connectionTimeout:r,requestTimeout:n,socketTimeout:i,socketAcquisitionWarningTimeout:s,throwOnRequestTimeout:c,httpAgentProvider:async()=>{let m=require("node:http"),{Agent:h,request:f}=m.default??m;return IGt=f,Rhe=h,o instanceof Rhe||typeof o?.destroy=="function"?(this.externalAgent=!0,o):new Rhe({keepAlive:l,maxSockets:d,...o})},httpsAgent:a instanceof vhe.Agent||typeof a?.destroy=="function"?(this.externalAgent=!0,a):new vhe.Agent({keepAlive:l,maxSockets:d,...a}),logger:u}}},VOr=new Uint16Array(1),T7=class{id=VOr[0]++;total=0;max=0;session;refs=0;constructor(e){e.unref(),this.session=e}retain(){if(this.session.destroyed)throw new Error("@smithy/node-http-handler - cannot acquire reference to destroyed session.");this.refs+=1,this.total+=1,this.max=Math.max(this.refs,this.max),this.session.ref()}free(){if(!this.session.destroyed&&(this.refs-=1,this.refs===0&&this.session.unref(),this.refs<0))throw new Error("@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement.")}deref(){return this.session}close(){this.session.closed||this.session.close()}destroy(){this.refs=0,this.session.destroyed||(this.session.setTimeout(0),this.session.destroy())}useCount(){return this.refs}},aHe=class{sessions=[];maxConcurrency=0;constructor(e){this.sessions=(e??[]).map(n=>new T7(n))}poll(){let e=!1;for(let n of this.sessions){if(n.deref().destroyed){e=!0;continue}if(!this.maxConcurrency||n.useCount()-1&&this.sessions.splice(n,1)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}setMaxConcurrency(e){this.maxConcurrency=e}destroy(e){this.remove(e),e.destroy()}},cHe=class{config;connectOptions;connectionPools=new Map;constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(e,n){let r=this.getUrlString(e),i=this.getPool(r);if(!this.config.disableConcurrency&&!n.isEventStream){let u=i.poll();if(u)return u.retain(),u}let s=new T7(this.connect(r)),o=s.deref();this.config.maxConcurrency&&o.settings({maxConcurrentStreams:this.config.maxConcurrency},u=>{if(u)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+e.destination.toString())});let a=()=>{this.removeFromPoolAndClose(r,s)},c=()=>{this.removeFromPoolAndCheckedDestroy(r,s)};return o.on("goaway",a),o.on("error",c),o.on("frameError",c),o.on("close",c),n.requestTimeout&&o.setTimeout(n.requestTimeout,c),i.offerLast(s),s.retain(),s}release(e,n){n.free()}createIsolatedSession(e,n){let r=this.getUrlString(e),i=new T7(this.connect(r)),s=i.deref();s.settings({maxConcurrentStreams:1});let o=()=>{i.destroy()};s.on("error",o),s.on("frameError",o),s.on("close",o);let a=n.requestTimeout??3e5;return s.setTimeout(a,o),i.retain(),i}destroy(){for(let[e,n]of this.connectionPools){for(let r of[...n])r.destroy();this.connectionPools.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=e;for(let n of this.connectionPools.values())n.setMaxConcurrency(e)}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}setNodeHttp2ConnectOptions(e){this.connectOptions=e}debug(){let e={};for(let[n,r]of this.connectionPools){let i=[];for(let s of r)i.push({id:s.id,active:s.useCount(),maxConcurrent:s.max,totalRequests:s.total});e[n]={sessions:i}}return e}removeFromPoolAndClose(e,n){this.connectionPools.get(e)?.remove(n),n.close()}removeFromPoolAndCheckedDestroy(e,n){this.connectionPools.get(e)?.remove(n),n.destroy()}getPool(e){if(!this.connectionPools.has(e)){let n=new aHe;this.config.maxConcurrency&&n.setMaxConcurrency(this.config.maxConcurrency),this.connectionPools.set(e,n)}return this.connectionPools.get(e)}getUrlString(e){return e.destination.toString()}connect(e){return this.connectOptions===void 0?sHe.connect(e):sHe.connect(e,this.connectOptions)}},{constants:wGt}=sHe,lHe=class t{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new cHe({});static create(e){return typeof e?.handle=="function"?e:new t(e)}constructor(e){this.configProvider=new Promise((n,r)=>{typeof e=="function"?e().then(i=>{n(i||{})}).catch(r):n(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:n,requestTimeout:r,isEventStream:i}={}){if(!this.config){this.config=await this.configProvider;let{disableConcurrentStreams:u,maxConcurrentStreams:l,nodeHttp2ConnectOptions:d}=this.config;this.connectionManager.setDisableConcurrentStreams(u??!1),l&&this.connectionManager.setMaxConcurrentStreams(l),d&&this.connectionManager.setNodeHttp2ConnectOptions(d)}let{requestTimeout:s,disableConcurrentStreams:o}=this.config,a=o||i,c=r??s;return new Promise((u,l)=>{let d=!1,m,h=async q=>{await m,u(q)},f=async q=>{await m,l(q)};if(n?.aborted){d=!0;let q=khe(n);f(q);return}let{hostname:g,method:A,port:y,protocol:E,query:_}=e,S="";if(e.username!=null||e.password!=null){let q=e.username??"",ce=e.password??"";S=`${q}:${ce}@`}let C=`${E}//${S}${g}${y?`:${y}`:""}`,I={destination:new URL(C)},w={requestTimeout:this.config?.sessionTimeout,isEventStream:i},k=a?this.connectionManager.createIsolatedSession(I,w):this.connectionManager.lease(I,w),N=k.deref(),O=q=>{a&&k.destroy(),d=!0,f(q)},W=_?vGt(_):"",$=e.path;W&&($+=`?${W}`),e.fragment&&($+=`#${e.fragment}`);let G=N.request({...e.headers,[wGt.HTTP2_HEADER_PATH]:$,[wGt.HTTP2_HEADER_METHOD]:A});if(c&&G.setTimeout(c,()=>{G.close();let q=new Error(`Stream timed out because of no activity for ${c} ms`);q.name="TimeoutError",O(q)}),n){let q=()=>{G.close();let ce=khe(n);O(ce)};if(typeof n.addEventListener=="function"){let ce=n;ce.addEventListener("abort",q,{once:!0}),G.once("close",()=>ce.removeEventListener("abort",q))}else n.onabort=q}G.on("frameError",(q,ce,Y)=>{O(new Error(`Frame type id ${q} in stream id ${Y} has failed with code ${ce}.`))}),G.on("error",O),G.on("aborted",()=>{O(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${G.rstCode}.`))}),G.on("response",q=>{let ce=new RGt({statusCode:q[":status"]??-1,headers:kGt(q),body:G});d=!0,h({response:ce}),a&&(N.close(),G.on("end",()=>{k.destroy()}))}),G.on("close",()=>{if(a?k.destroy():this.connectionManager.release(I,k),!d){let q=new Error("Unexpected error: http2 request did not get a response");N.destroyed&&(q.name="TimeoutError"),O(q)}}),m=BGt(G,e,c)})}updateHttpClientConfig(e,n){this.config=void 0,this.configProvider=this.configProvider.then(r=>({...r,[e]:n}))}httpHandlerConfigs(){return this.config??{}}};v7.DEFAULT_REQUEST_TIMEOUT=jOr;v7.NodeHttp2Handler=lHe;v7.NodeHttpHandler=oHe});var uHe=re(DGt=>{p();var{setCredentialFeature:YOr}=(Pa(),wr(q_)),{CredentialsProviderError:yO}=(Da(),wr(fy)),{NodeHttpHandler:zOr}=Y1(),KOr=require("node:fs/promises"),{HttpRequest:JOr}=(ti(),wr(vC)),{sdkStreamMixin:XOr,parseRfc3339DateTime:ZOr}=(Mi(),wr(k1)),eLr="169.254.170.2",tLr="169.254.170.23",nLr="[fd00:ec2::23]",rLr=(t,e)=>{if(t.protocol!=="https:"&&!(t.hostname===eLr||t.hostname===tLr||t.hostname===nLr)){if(t.hostname.includes("[")){if(t.hostname==="[::1]"||t.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(t.hostname==="localhost")return;let n=t.hostname.split("."),r=i=>{let s=parseInt(i,10);return 0<=s&&s<=255};if(n[0]==="127"&&r(n[1])&&r(n[2])&&r(n[3])&&n.length===4)return}throw new yO(`URL not accepted. It must either be HTTPS or match one of the following: - loopback CIDR 127.0.0.0/8 or [::1/128] - ECS container host 169.254.170.2 - - EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:e})}};function Aar(t){return new uar({protocol:t.protocol,hostname:t.hostname,port:Number(t.port),path:t.pathname,query:Array.from(t.searchParams.entries()).reduce((e,[n,r])=>(e[n]=r,e),{}),fragment:t.hash})}async function yar(t,e){let r=await dar(t.body).transformToString();if(t.statusCode===200){let s=JSON.parse(r);if(typeof s.AccessKeyId!="string"||typeof s.SecretAccessKey!="string"||typeof s.Token!="string"||typeof s.Expiration!="string")throw new bB("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:e});return{accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,sessionToken:s.Token,expiration:par(s.Expiration)}}if(t.statusCode>=400&&t.statusCode<500){let s={};try{s=JSON.parse(r)}catch{}throw Object.assign(new bB(`Server responded with status: ${t.statusCode}`,{logger:e}),{Code:s.Code,Message:s.Message})}throw new bB(`Server responded with status: ${t.statusCode}`,{logger:e})}var Ear=(t,e,n)=>async()=>{for(let r=0;rsetTimeout(i,n))}return await t()},bar="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",_ar="http://169.254.170.2",Sar="AWS_CONTAINER_CREDENTIALS_FULL_URI",Car="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",Iar="AWS_CONTAINER_AUTHORIZATION_TOKEN",xar=(t={})=>{t.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let e,n=t.awsContainerCredentialsRelativeUri??process.env[bar],r=t.awsContainerCredentialsFullUri??process.env[Sar],s=t.awsContainerAuthorizationToken??process.env[Iar],i=t.awsContainerAuthorizationTokenFile??process.env[Car],o=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?.warn?console.warn:t.logger.warn.bind(t.logger);if(n&&r&&(o("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),o("awsContainerCredentialsRelativeUri will take precedence.")),s&&i&&(o("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),o("awsContainerAuthorizationTokenFile will take precedence.")),n)e=`${_ar}${n}`;else if(r)e=r;else throw new bB(`No HTTP credential provider host provided. -Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:t.logger});let a=new URL(e);gar(a,t.logger);let c=car.create({connectionTimeout:t.timeout??1e3}),u=t.timeout??1e3,l=Ear(async()=>{let d=Aar(a);i?d.headers.Authorization=Jvt((await lar.readFile(i)).toString()):s&&(d.headers.Authorization=Jvt(s));try{let h=await c.handle(d,{requestTimeout:u});return yar(h.response).then(m=>aar(m,"CREDENTIALS_HTTP","z"))}catch(h){throw new bB(String(h),{logger:t.logger})}},t.maxRetries??3,t.timeout??1e3);return async()=>{try{return await l()}finally{c.destroy?.()}}},Jvt=t=>{if(t.includes(`\r -`))throw new bB("Authorization token contains invalid \\r\\n sequence.");return t};Xvt.fromHttp=xar});function war(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function Tar(t){return{schemeId:"smithy.api#noAuth"}}var Zvt,eRt,tRt,VMe=V(()=>{p();$d();Is();Zvt=async(t,e,n)=>({operation:Ha(e).operation,region:await ba(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});eRt=t=>{let e=[];return t.operation==="CreateToken"?e.push(Tar(t)):e.push(war(t)),e},tRt=t=>{let e=qS(t);return Object.assign(e,{authSchemePreference:ba(t.authSchemePreference??[])})}});var nRt,rRt,jMe=V(()=>{p();nRt=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),rRt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var dR,R6=V(()=>{dR={name:"@aws-sdk/nested-clients",version:"3.997.44",description:"Nested clients for AWS SDK packages.",homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",license:"Apache-2.0",author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/sdk-for-javascript/"},repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/nested-clients"},files:["./cognito-identity.d.ts","./cognito-identity.js","./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sso.d.ts","./sso.js","./sts.d.ts","./sts.js","dist-*/**"],sideEffects:!1,main:"./dist-cjs/index.js",module:"./dist-es/index.js",browser:{"./dist-es/submodules/cognito-identity/runtimeConfig":"./dist-es/submodules/cognito-identity/runtimeConfig.browser","./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sso/runtimeConfig":"./dist-es/submodules/sso/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},types:"./dist-types/index.d.ts",typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"],"*":["dist-types/ts3.4/submodules/*/index.d.ts"]}},"react-native":{},exports:{"./package.json":"./package.json","./sso-oidc":{types:"./dist-types/submodules/sso-oidc/index.d.ts",module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{types:"./dist-types/submodules/sts/index.d.ts",module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js"},"./signin":{types:"./dist-types/submodules/signin/index.d.ts",module:"./dist-es/submodules/signin/index.js",node:"./dist-cjs/submodules/signin/index.js",import:"./dist-es/submodules/signin/index.js",require:"./dist-cjs/submodules/signin/index.js"},"./cognito-identity":{types:"./dist-types/submodules/cognito-identity/index.d.ts",module:"./dist-es/submodules/cognito-identity/index.js",node:"./dist-cjs/submodules/cognito-identity/index.js",import:"./dist-es/submodules/cognito-identity/index.js",require:"./dist-cjs/submodules/cognito-identity/index.js"},"./sso":{types:"./dist-types/submodules/sso/index.d.ts",module:"./dist-es/submodules/sso/index.js",node:"./dist-cjs/submodules/sso/index.js",import:"./dist-es/submodules/sso/index.js",require:"./dist-cjs/submodules/sso/index.js"}},scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline","build:es":"premove dist-es && tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"premove dist-types && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types",lint:"node ../../scripts/validation/submodules-linter.js",prebuild:"yarn lint",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},dependencies:{"@aws-sdk/core":"^3.977.9","@aws-sdk/signature-v4-multi-region":"^3.996.46","@aws-sdk/types":"^3.974.5","@smithy/core":"^3.33.3","@smithy/fetch-http-handler":"^5.7.2","@smithy/node-http-handler":"^4.11.3","@smithy/types":"^4.17.2",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~7.0.2"},engines:{node:">=20.0.0"}}});var YMe,sRt=V(()=>{p();YMe=Symbol("@smithy/core/cbor::tagSymbol")});var k6,KMe=V(()=>{p();si();k6=(t,e)=>{let n=s=>{let i=s;return typeof i=="number"&&(i=i.toString()),i.indexOf(",")>=0&&(i=i.split(",")[0]),i.indexOf(":")>=0&&(i=i.split(":")[0]),i.indexOf("#")>=0&&(i=i.split("#")[1]),i};if(e.__type!==void 0)return n(e.__type);let r;for(let s in e)if(Cs(e,s)&&s.toLowerCase()==="code"){r=s;break}if(r&&e[r]!==void 0)return n(e[r])}});function jce(t){let e=t.getSchema(),n=e[iRt];if(n)return n;let r=[],s=[];for(let[a,c]of t.structIterator())r.push(a),s.push(c);let i=new Array(r.length);for(let a=0;a>8,s[2]=n&255),s.set(e,r),s}function uRt(t){return Yce?Buffer.allocUnsafe(t):new Uint8Array(t)}function I2(t,e,n,r){if(e==null){if(e===void 0&&t.isIdempotencyToken()){HS(zg());return}da(1),Ai[Bs++]=246;return}if(t.isUnitSchema()){da(1),Gd(5,0);return}if(typeof e=="object"){if(t.isBlobSchema()&&e instanceof Uint8Array){Gce(e);return}if(t.isTimestampSchema()&&e instanceof Date){ZMe(e);return}if(t.isStructSchema()){Dar(t,e,r);return}if(Array.isArray(e)&&(t.isListSchema()||t.isDocumentSchema())){cRt(t,e,t.isDocumentSchema(),r);return}if(t.isMapSchema()){JMe(t,e,!1,r);return}if(e instanceof Date){ZMe(e);return}if(e instanceof Uint8Array){Gce(e);return}if(e instanceof zi){hRt(e);return}if(e[YMe]){let i=e;pRt(i.tag,i.value);return}if(t.isDocumentSchema()){Array.isArray(e)?cRt(t,e,!0,r):JMe(t,e,!0,r);return}if(t.isBigDecimalSchema()){x2(e);return}JMe(t,e,!0,r);return}if(typeof e=="string"){if(t.isBlobSchema()){let i=(r?.base64Decoder??wl)(e);Gce(i);return}HS(e);return}if(typeof e=="number"){da(9),Number.isInteger(e)&&e>=-9007199254740992&&e<=9007199254740991?Kce(e):oLe(e);return}if(typeof e=="boolean"){da(1),Ai[Bs++]=224|(e?21:20);return}if(typeof e=="bigint"){Hce(e);return}HS(String(e))}function Dar(t,e,n){if(t.isUnionSchema()){let d=!1;for(let[h,m]of t.structIterator()){let f=e[h];if(f!=null){da(9),Gd(5,1),HS(h),I2(m,f,t,n),d=!0;break}}if(!d){let{$unknown:h}=e;Array.isArray(h)?(da(9),Gd(5,1),HS(h[0]),x2(h[1])):(da(9),Gd(5,0))}return}let r=jce(t),{memberNames:s,memberSchemas:i,encodedKeys:o}=r,a=s.length,c;a<24?c=1:a<256?c=2:c=3,da(c);let u=Bs;Bs+=c;let l=0;for(let d=0;d>8,Ai[u+2]=l&255)}function cRt(t,e,n,r){let s=!!t.getMergedTraits().sparse,i=t.getValueSchema();if(n||s){let o=[];for(let a=0;a=-9007199254740992&&t<=9007199254740991?Kce(t):oLe(t);return}if(typeof t=="boolean"){da(1),Ai[Bs++]=224|(t?21:20);return}if(typeof t=="bigint"){Hce(t);return}if(t instanceof Uint8Array){Gce(t);return}if(t instanceof Date){ZMe(t);return}if(t instanceof zi){hRt(t);return}if(t[YMe]){let e=t;pRt(e.tag,e.value);return}if(Array.isArray(t)){da(9),Gd(4,t.length);for(let e=0;eAi.length){let e=Ai.length*2;for(;e>8,Ai[Bs++]=e&255;else if(e<4294967296)Ai[Bs++]=t<<5|26,SB.setUint32(Bs,e),Bs+=4;else{Ai[Bs++]=t<<5|27;let n=e/4294967296|0,r=e-n*4294967296|0;SB.setUint32(Bs,n),SB.setUint32(Bs+4,r),Bs+=8}}function dRt(t,e){let n=Number(e);if(n<4294967296){Gd(t,n);return}Ai[Bs++]=t<<5|27,SB.setBigUint64(Bs,e),Bs+=8}function HS(t){let e=t.length;if(e<=23){let n=_2.get(t);if(n){da(n.bytes.length),Ai.set(n.bytes,Bs),Bs+=n.bytes.length,n.epoch=zMe;return}let r=Bs;lRt(t,e);let s=Bs,i=Uint8Array.prototype.slice.call(Ai,r,s);if(_2.size>=oRt){if(aRt)return;let o=0;for(let[a,c]of _2){if(o>=1024)break;c.epoch!==zMe&&(_2.delete(a),++o)}if(o===0){aRt=!0;return}}_2.size=0,n=e?0:1,r=e?t:-t-1;Gd(n,r)}function Hce(t){let e=t>=0,n=e?0:1,r=e?t:-t-BigInt(1);if(r=0;--c)o[c]=Number(a&BigInt(255)),a>>=BigInt(8);da(i+16),Ai[Bs++]=e?194:195,Gd(2,i),Ai.set(o,Bs),Bs+=i}}function Gce(t){da(t.length+9),Gd(2,t.length),Ai.set(t,Bs),Bs+=t.length}function pRt(t,e){da(9),typeof t=="bigint"?dRt(6,t):Gd(6,t),x2(e)}function hRt(t){let e=t.string,n=BigInt(0),r=e.search(/[eE]/);r!==-1&&(n=BigInt(e.slice(r+1)),e=e.slice(0,r));let s=e.indexOf("."),i=s===-1?0:e.length-s-1,o=n-BigInt(i),a=BigInt(e.replace(".",""));da(9),Ai[Bs++]=196,Gd(4,2),da(9),o>=-0x20000000000000n&&o<=0x1fffffffffffffn?Kce(Number(o)):Hce(o),Hce(a)}function ZMe(t){da(18),Gd(6,1);let e=t.getTime()/1e3;Number.isInteger(e)?Kce(e):oLe(e)}var qce,iRt,Yce,Nar,XMe,Ai,SB,Bs,oRt,_2,zMe,aRt,aLe=V(()=>{p();si();$r();Ki();js();sRt();qce=class extends Ld{write(e,n){Bs=0;let r=qn.of(e);I2(r,n,void 0,this.serdeContext)}flush(){let e=Ai.subarray(0,Bs);return Bs=0,Ai=uRt(XMe),SB=new DataView(Ai.buffer,Ai.byteOffset,Ai.byteLength),e}},iRt=Symbol.for("@smithy/cbor-struct-cache");Yce=typeof Buffer<"u",Nar=new TextEncoder,XMe=2048,Ai=Yce?Buffer.allocUnsafe(XMe):new Uint8Array(XMe),SB=new DataView(Ai.buffer,Ai.byteOffset,Ai.byteLength),Bs=0,oRt=2048,_2=new Map,zMe=0,aRt=!1});function eA(t){if(wr>=Wd)throw new Error("unexpected end of CBOR payload.");let e=(Tl[wr]&224)>>5;if((Tl[wr]&31)===31&&e>=2&&e<=5)return Lar(t,e);switch(e){case 0:return Gar();case 1:return War();case 2:return ele();case 3:return w2();case 4:return Bar(t);case 5:return Par(t);case 6:return Mar(t);case 7:return Har();default:throw new Error(`unexpected CBOR major type ${e}.`)}}function Bar(t){let e=Zce(),n=t.isListSchema()?t.getValueSchema():t,r=Array(e);for(let s=0;s=0){f=A+1,f>=c&&(f=0);let y=eA(i[A]);y!=null&&(u[a[A]]=y)}else{let y=w2(),b=eA(qn.of(15));y==="__type"&&typeof b=="string"?m=!0:(l=y,d=b,++h)}}if(r){let g=!0;for(let A in u)if(Cs(u,A)){g=!1;break}g&&h===1&&(u.$unknown=[l,d])}else if(m){wr=n;let g=qn.of(15);for(let A=0;A=0){m=f+1,m>=a&&(m=0);let g=eA(s[f]);g!=null&&(u[o[f]]=g)}else{let g=w2(),A=eA(qn.of(15));g!=="__type"&&(l=g,d=A,++h)}}throw new Error("expected break marker.")}let e=t.isMapSchema()?t.getValueSchema():t,n={};for(;wr>>0&dLe-1,s=mRt[r];if(s!==void 0&&s.length===e){let o=!0;for(let a=0;a>7,r=(t&124)>>2,s=(t&3)<<8|e,i=n===0?1:-1;return r===0?s===0?0:i*(Math.pow(2,-14)*(s/1024)):r===31?s===0?i*(1/0):NaN:i*(Math.pow(2,r-15)*(1+s/1024))}function yRt(t){if(typeof t=="number")return t;let e=Number(t);return Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:t}function vx(t){throw new Error(`CBOR: length ${t} greater than remaining buffer length.`)}function zce(t,e){if(t.isTimestampSchema()){if(typeof e=="number")return Hv(e);if(typeof e=="object"&&e!==null&&e.tag===1&&"value"in e)return Hv(e.value)}if(t.isBlobSchema()||typeof e>"u"||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="bigint"||typeof e=="symbol"||typeof e!="object"||e===null||"byteLength"in e||e instanceof Date||e instanceof zi||t.isDocumentSchema())return e;if(t.isListSchema()){let r=t.getValueSchema(),s=[];for(let i of e)s.push(zce(r,i));return s}let n={};if(t.isMapSchema()){let r=t.getValueSchema();for(let s in e)Cs(e,s)&&(n[s]=zce(r,e[s]))}else if(t.isStructSchema()){let r=t.isUnionSchema(),s;if(r){s=new Set;for(let i in e)Cs(e,i)&&i!=="__type"&&s.add(i)}for(let[i,o]of t.structIterator())r&&s.delete(i),e[i]!=null&&(n[i]=zce(o,e[i]));if(r&&s?.size===1){let i=!0;for(let o in n)if(Cs(n,o)){i=!1;break}if(i){let o=s.values().next().value;n.$unknown=[o,e[o]]}}else if(typeof e.__type=="string")for(let i in e)Cs(e,i)&&(i in n||(n[i]=e[i]))}return n}var Jce,gRt,lLe,Tl,uLe,pR,wr,Wd,dLe,mRt,cLe,B6,ERt=V(()=>{p();si();$r();Ki();js();aLe();Jce=class extends Ld{read(e,n){return Tl=n,uLe=gRt&&n instanceof Buffer,pR=new DataView(n.buffer,n.byteOffset,n.byteLength),wr=0,Wd=n.length,B6=B6+1&65535,eA(qn.of(e))}readValue(e,n){return zce(qn.of(e),n)}},gRt=typeof Buffer<"u",lLe=new TextDecoder,Tl=new Uint8Array(0),uLe=!1,pR=new DataView(new ArrayBuffer(0)),wr=0,Wd=0,dLe=2048,mRt=new Array(dLe),cLe=new Uint16Array(dLe),B6=0});var tle,bRt=V(()=>{p();$r();aLe();ERt();tle=class extends Ld{createSerializer(){let e=new qce;return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new Jce;return e.setSerdeContext(this.serdeContext),e}}});var P6,_Rt=V(()=>{p();$r();Ki();si();bRt();KMe();P6=class extends vS{codec=new tle;serializer=this.codec.createSerializer();deserializer=this.codec.createDeserializer();constructor({defaultNamespace:e,errorTypeRegistries:n}){super({defaultNamespace:e,errorTypeRegistries:n})}getShapeId(){return"smithy.protocols#rpcv2Cbor"}getPayloadCodec(){return this.codec}async serializeRequest(e,n,r){let s=await super.serializeRequest(e,n,r);Object.assign(s.headers,{"content-type":this.getDefaultContentType(),"smithy-protocol":"rpc-v2-cbor",accept:this.getDefaultContentType()}),Qy(e.input)==="unit"?(delete s.body,delete s.headers["content-type"]):(s.body||(this.serializer.write(15,{}),s.body=this.serializer.flush()),s.body instanceof Uint8Array&&(s.headers["content-length"]=String(s.body.byteLength)));let{service:i,operation:o}=Ha(r),a=`/service/${i}/operation/${o}`;return s.path.endsWith("/")?s.path+=a.slice(1):s.path+=a,s}async deserializeResponse(e,n,r){return super.deserializeResponse(e,n,r)}async handleError(e,n,r,s,i){let o=k6(r,s)??"Unknown",a={$metadata:i,$fault:r.statusCode<=500?"client":"server"},c=this.options.defaultNamespace;o.includes("#")&&([c]=o.split("#"));let u=this.compositeErrorRegistry,l=Va.for(c);u.copyFrom(l);let d;try{d=u.getSchema(o)}catch{s.Message&&(s.message=s.Message);let b=Va.for("smithy.ts.sdk.synthetic."+c);u.copyFrom(b);let S=u.getBaseException();if(S){let C=u.getErrorCtor(S);throw Object.assign(new C({name:o}),a,s)}throw Object.assign(new Error(o),a,s)}let h=qn.of(d),m=u.getErrorCtor(d),f=s.message??s.Message??"Unknown",g=new m({}),A={};for(let[y,b]of h.structIterator())A[y]=this.deserializer.readValue(b,s[y]);throw Object.assign(g,a,{$fault:h.getMergedTraits().error,message:f},A)}getDefaultContentType(){return"application/cbor"}}});var SRt=V(()=>{p();KMe();_Rt()});var Ky,T2=V(()=>{p();Is();Ki();Ky=class{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,n){let r=n.getMemberSchemas(),s=Object.values(r).find(i=>!!i.getMergedTraits().httpPayload);if(s){let i=s.getMergedTraits().mediaType;return i||(s.isStringSchema()?"text/plain":s.isBlobSchema()?"application/octet-stream":e)}else if(!n.isUnitSchema()&&Object.values(r).find(o=>{let{httpQuery:a,httpQueryParams:c,httpHeader:u,httpLabel:l,httpPrefixHeaders:d}=o.getMergedTraits();return!a&&!c&&!u&&!l&&d===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,n,r,s,i,o){let a=e;e.includes("#")&&([,a]=e.split("#"));let c={$metadata:i,$fault:r.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:o?.(this.errorRegistry,a)??this.errorRegistry.getSchema(e),errorMetadata:c}}catch{s.message=s.message??s.Message??"UnknownError";let l=this.errorRegistry,d=l.getBaseException();if(d){let f=l.getErrorCtor(d)??Error;throw this.decorateServiceException(Object.assign(new f({name:a}),c),s)}let h=s,m=h?.message??h?.Message??h?.Error?.Message??h?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(m),{name:a},c),s)}}compose(e,n,r){let s=r;n.includes("#")&&([s]=n.split("#"));let i=Va.for(s),o=Va.for("smithy.ts.sdk.synthetic."+r);e.copyFrom(i),e.copyFrom(o),this.errorRegistry=e}decorateServiceException(e,n={}){if(this.queryCompat){let r=e.Message??n.Message,s=rB(e,n);r&&(s.message=r);let i=s.Error??{};i.Type=s.Error?.Type,i.Code=s.Error?.Code,i.Message=s.Error?.message??s.Error?.Message??r,s.Error=i;let o=s.$metadata.requestId;return o&&(s.RequestId=o),s}return rB(e,n)}setQueryCompatError(e,n){let r=n.headers?.["x-amzn-query-error"];if(e!==void 0&&r!=null){let[s,i]=r.split(";"),o=Object.keys(e),a={Code:s,Type:i};e.Code=s,e.Type=i;for(let c=0;cqn.of(s).getMergedTraits().awsQueryError?.[0]===n)}}}});var nle,CRt=V(()=>{p();SRt();Ki();T2();nle=class extends P6{awsQueryCompatible;mixin;constructor({defaultNamespace:e,errorTypeRegistries:n,awsQueryCompatible:r}){super({defaultNamespace:e,errorTypeRegistries:n}),this.awsQueryCompatible=!!r,this.mixin=new Ky(this.awsQueryCompatible)}async serializeRequest(e,n,r){let s=await super.serializeRequest(e,n,r);return this.awsQueryCompatible&&(s.headers["x-amzn-query-mode"]="true"),s}async handleError(e,n,r,s,i){this.awsQueryCompatible&&this.mixin.setQueryCompatError(s,r);let o=(()=>{let f=r.headers["x-amzn-query-error"];return f&&this.awsQueryCompatible?f.split(";")[0]:k6(r,s)??"Unknown"})();this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);let{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,s,i,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),u=qn.of(a),l=s.message??s.Message??"UnknownError",d=this.compositeErrorRegistry.getErrorCtor(a)??Error,h=new d({}),m={};for(let[f,g]of u.structIterator())s[f]!=null&&(m[f]=this.deserializer.readValue(g,s[f]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(s,m),this.mixin.decorateServiceException(Object.assign(h,c,{$fault:u.getMergedTraits().error,message:l},m),s)}}});var vl,i_=V(()=>{p();vl=class{serdeContext;setSerdeContext(e){this.serdeContext=e}}});var hR,rle=V(()=>{p();hR=class{from;to;keys;constructor(e,n){this.from=e,this.to=n;let r=Object.keys(this.from),s=new Set(r);s.delete("__type"),this.keys=s}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){let e=this.keys.values().next().value,n=this.from[e];this.to.$unknown=[e,n]}}}});function sle(){if(O6===void 0)try{if(typeof Buffer!="function")O6=!1;else{let t=JSON.parse(Buffer.from([123,125]));O6=t!==null&&typeof t=="object"}}catch{O6=!1}return O6}var O6,pLe=V(()=>{p()});function v2(t,e,n){if(n?.source){let r=n.source;if(typeof e=="number")return e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER?Yar(r,e)?e:new zi(r,"bigDecimal"):jar(r)?new zi(r,"bigDecimal"):/[eE]/.test(r)?Kar(r):BigInt(r)}return e}function jar(t){let e=t.indexOf(".");if(e===-1)return!1;let n=t.search(/[eE]/);if(n===-1)return!0;let r=n-e-1;return parseInt(t.slice(n+1),10)=c.length?s=c+"0".repeat(l-c.length):s=c.slice(0,l)+"."+c.slice(l)}return s.includes(".")&&(s=s.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")),(e?"-":"")+s}function Kar(t){let e=t.search(/[eE]/),n=parseInt(t.slice(e+1),10),r=t.startsWith("-"),s=t.slice(r?1:0,e),i=s.indexOf("."),o,a;if(i===-1)o=s,a=n;else{o=s.slice(0,i)+s.slice(i+1);let u=s.length-i-1;a=n-u}o=o.replace(/0+$/,"")||"0";let c=BigInt(o)*10n**BigInt(a+(s.replace(".","").length-o.length));return r?-c:c}var ile=V(()=>{p();js()});function R2(t){let e=qn.of(t),n=e.getSchema();if(Array.isArray(n)&&e.isStructSchema()){if(mLe in n)return n[mLe];let r=ole(e,new Set);return n[mLe]=r,r}return ole(e,new Set)}function ole(t,e){let n=t.getSchema();if(e.has(n))return!1;if(e.add(n),t.isBigIntegerSchema()||t.isBigDecimalSchema())return!0;if(t.isStructSchema()){for(let[,r]of t.structIterator())if(ole(r,e))return!0}else if(t.isListSchema()||t.isMapSchema()){if(ole(t.getValueSchema(),e))return!0}else if(t.isDocumentSchema())return!0;return!1}var mLe,ale=V(()=>{p();Ki();mLe=Symbol.for("@aws-sdk/reviver")});var cle,fLe=V(()=>{p();$r();js();cle=(t,e)=>wp(t,e).then(n=>(e?.utf8Encoder??Jc)(n))});async function CB(t,e,n){let r;if(sle()&&typeof t?.[Symbol.asyncIterator]=="function"){let i=await wp(t,e);typeof Buffer=="function"&&(Buffer.isBuffer(i)?r=i:r=Buffer.from(i.buffer,i.byteOffset,i.byteLength))}if(r||(r=await cle(t,e)),r.length===0)return{};let s=n&&R2(n)?v2:void 0;try{return JSON.parse(r,s)}catch(i){throw i?.name==="SyntaxError"&&Object.defineProperty(i,"$responseBodyText",{value:typeof r=="string"?r:r.toString("utf8")}),i}}var xRt,IRt,gLe,lle,ule,wRt,k2=V(()=>{p();$r();fLe();pLe();ile();ale();xRt=async(t,e)=>{let n=await CB(t,e);return n.message=n.message??n.Message,n},IRt=(t,e)=>Object.keys(t).find(n=>n.toLowerCase()===e.toLowerCase()),gLe=t=>{let e=t;return typeof e=="number"&&(e=e.toString()),e.indexOf(",")>=0&&(e=e.split(",")[0]),e.indexOf(":")>=0&&(e=e.split(":")[0]),e.indexOf("#")>=0&&(e=e.split("#")[1]),e},lle=(t,e)=>wRt(t,e,["header","code","type"]),ule=(t,e,n=!1)=>wRt(t,e,n?["code","header","type"]:["type","code","header"]),wRt=({headers:t},e,n)=>{for(;n.length>0;)switch(n.shift()){case"header":let s=IRt(t??{},"x-amzn-errortype");if(s!==void 0)return gLe(t[s]);break;case"code":let i=IRt(e??{},"code");if(i&&e[i]!==void 0)return gLe(e[i]);break;case"type":if(e?.__type!==void 0)return gLe(e.__type);break}}});function zy(t){Object.defineProperty(t,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}var M6=V(()=>{p()});var N2,ALe=V(()=>{p();$r();Ki();js();i_();rle();pLe();ile();ale();k2();M6();N2=class extends vl{settings;constructor(e){super(),this.settings=e}async read(e,n){let r=R2(e)?v2:void 0,s;if(typeof n=="string"){if(n.length===0)return{};s=JSON.parse(n,r)}else if(n instanceof Uint8Array&&sle()){if(n.byteLength===0)return{};let i=Buffer.isBuffer(n)?n:Buffer.from(n.buffer,n.byteOffset,n.byteLength);s=JSON.parse(i,r)}else s=await CB(n,this.serdeContext,e);return this._read(e,s)}readObject(e,n){return this._read(e,n)}_read(e,n){let r=n!==null&&typeof n=="object",s=qn.of(e);if(r){if(s.isStructSchema())return this._readStruct(s,n);if(Array.isArray(n)&&s.isListSchema()){let o=s.getValueSchema();if(this.needsTransform(o))for(let a=0;a{p();js();dle=class t extends Uint8Array{string=null;static allocUnsafe(e){if(typeof Buffer=="function"){let n=Buffer.allocUnsafe(e);return new t(n.buffer,n.byteOffset,n.byteLength)}return new t(e)}toString(){return this.s()}valueOf(){return this.s()}includes(e,n){return typeof e=="string"?this.s().includes(e,n):Uint8Array.prototype.includes.call(this,e,n)}indexOf(e,n){return typeof e=="string"?this.s().indexOf(e,n):Uint8Array.prototype.indexOf.call(this,e,n)}lastIndexOf(e,n){if(typeof e=="string")return this.s().lastIndexOf(e,n);let r=Uint8Array.prototype.lastIndexOf;return n!==void 0?r.call(this,e,n):r.call(this,e)}startsWith(e,n){return this.s().startsWith(e,n)}endsWith(e,n){return this.s().endsWith(e,n)}match(e){return this.s().match(e)}replace(e,n){return this.s().replace(e,n)}search(e){return this.s().search(e)}split(e,n){return this.s().split(e,n)}substring(e,n){return this.s().substring(e,n)}trim(){return this.s().trim()}trimStart(){return this.s().trimStart()}trimEnd(){return this.s().trimEnd()}charAt(e){return this.s().charAt(e)}charCodeAt(e){return this.s().charCodeAt(e)}padStart(e,n){return this.s().padStart(e,n)}padEnd(e,n){return this.s().padEnd(e,n)}repeat(e){return this.s().repeat(e)}toUpperCase(){return this.s().toUpperCase()}toLowerCase(){return this.s().toLowerCase()}s(){if(this.string==null){let e=Date.now();e>TRt+6e4&&(console.warn("@aws-sdk/core/protocols - WARN - JsonCodec2: you have called a string method on a Uint8Array request body. It has been automatically converted to string. In a future version this will throw an error."),TRt=e),this.string=Jc(this)}return this.string}},TRt=0});function yLe(t){return dle.allocUnsafe(t)}var ple,RRt,kRt,zar,Jar,D2,hle,mle,NRt,Xar,Zar,ecr,VS,DRt,B2,ELe=V(()=>{p();$r();Ki();js();i_();vRt();ple=new TextEncoder,RRt=123,kRt=125,zar=91,Jar=93,D2=34,hle=58,mle=44,NRt=92,Xar=new Uint8Array([116,114,117,101]),Zar=new Uint8Array([102,97,108,115,101]),ecr=new Uint8Array([110,117,108,108]),VS=new Array(128).fill(null);VS[8]="b";VS[9]="t";VS[10]="n";VS[12]="f";VS[13]="r";VS[34]='"';VS[92]="\\";for(let t=0;t<32;t++)VS[t]===null&&(VS[t]="u00"+t.toString(16).padStart(2,"0"));DRt=2048;B2=class t extends vl{settings;json;i=0;rootSchema;rawValue;passthrough=!1;constructor(e){super(),this.settings=e,this.json=yLe(DRt)}write(e,n){this.i=0,this.rawValue=n,this.rootSchema=qn.of(e),this.passthrough=this.rootSchema.isBlobSchema()||this.rootSchema.isStringSchema(),this.passthrough||this.writeValue(this.rootSchema,n,void 0)}writeDiscriminatedDocument(e,n){this.i=0,this.rootSchema=qn.of(e);let r=this.rootSchema;if(r.isStructSchema()&&n!=null&&typeof n=="object"){this.writeValue(r,n,void 0);let s=`"__type":"${r.getName(!0)??"Unknown"}",`,i=s.length;this.ensure(i),this.json.copyWithin(1+i,1,this.i),ple.encodeInto(s,this.json.subarray(1)),this.i+=i}else this.writeValue(r,n,void 0)}flush(){this.rootSchema=void 0;let e=this.i;this.i=0;let n=this.rawValue;if(this.rawValue=void 0,e===0)return n;let r=this.json.subarray(0,e);return this.json=yLe(DRt),r}ensure(e){let{i:n,json:r}=this;if(n+e>r.length){let s=r.length*2;for(;s34&&s<92)this.json[this.i++]=s;else if(s<128){let i=VS[s];if(i!==null){this.ensure(i.length+1),this.json[this.i++]=NRt;for(let o=0;o=55296&&s<=56319){let i=r+1=56320&&i<=57343){this.ensure(4);let{written:o}=ple.encodeInto(e.substring(r,r+2),this.json.subarray(this.i));this.i+=o,++r}else this.ensure(6),this.writeUnicodeEscape(s)}else if(s>=56320&&s<=57343)this.ensure(6),this.writeUnicodeEscape(s);else{let{i,json:o}=this;s<2048?(o[i++]=192|s>>6,o[i++]=128|s&63):(o[i++]=224|s>>12,o[i++]=128|s>>6&63,o[i++]=128|s&63),this.i=i}}this.json[this.i++]=D2}writeUnicodeEscape(e){let{json:n,i:r}=this;n[r++]=NRt,n[r++]=117;let s=e.toString(16).padStart(4,"0");for(let i=0;i<4;++i)n[r++]=s.charCodeAt(i);this.i=r}static B64=(()=>{let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(64);for(let r=0;r<64;++r)n[r]=e.charCodeAt(r);return n})();writeBase64(e){let n=Math.ceil(e.length/3)*4;this.ensure(n+2);let r=this.json,s=t.B64,i=this.i;r[i++]=D2;let o=e.length,a=o%3,c=o-a;for(let u=0;u>2],r[i++]=s[(l&3)<<4|d>>4],r[i++]=s[(d&15)<<2|h>>6],r[i++]=s[h&63]}if(a===2){let u=e[c],l=e[c+1];r[i++]=s[u>>2],r[i++]=s[(u&3)<<4|l>>4],r[i++]=s[(l&15)<<2],r[i++]=61}else if(a===1){let u=e[c];r[i++]=s[u>>2],r[i++]=s[(u&3)<<4],r[i++]=61,r[i++]=61}r[i++]=D2,this.i=i}writeValue(e,n,r){if(n==null){if(r?.isStructSchema()){if(n===void 0&&qn.of(e).isIdempotencyToken()){this.writeAsciiQuoted(zg());return}return}this.ensure(4),this.json.set(ecr,this.i),this.i+=4;return}let s=qn.of(e),i=typeof n=="object";if(s.isStringSchema()){let o=s.getMergedTraits().mediaType;if(o&&(o==="application/json"||o.endsWith("+json"))){this.writeJsonString(vu.from(n).toString());return}}if(i){if(s.isStructSchema()){this.writeStruct(s,n);return}if(Array.isArray(n)&&(s.isListSchema()||s.isDocumentSchema())){this.writeList(s,n,s.isDocumentSchema());return}if(s.isMapSchema()){this.writeMap(s,n,!1);return}if(n instanceof Uint8Array&&(s.isBlobSchema()||s.isDocumentSchema())){this.writeBase64(n);return}if(n instanceof Date&&(s.isTimestampSchema()||s.isDocumentSchema())){this.writeTimestamp(s,n);return}if(n instanceof zi){this.writeAscii(n.string);return}if(s.isDocumentSchema()){Array.isArray(n)?this.writeList(s,n,!0):this.writeMap(s,n,!0);return}let o=JSON.stringify(n);this.writeAscii(o);return}if(typeof n=="string"){if(s.isBlobSchema()){let o=(this.serdeContext?.base64Encoder??ja)(n);this.writeAsciiQuoted(o);return}this.writeJsonString(n);return}if(typeof n=="number"){if(Math.abs(n)===1/0||Number.isNaN(n)){this.writeAsciiQuoted(String(n));return}let o=String(n);this.writeAscii(o);return}if(typeof n=="boolean"){this.ensure(5);let{i:o,json:a}=this;n?(a.set(Xar,o),o+=4):(a.set(Zar,o),o+=5),this.i=o;return}if(typeof n=="bigint"){this.writeAscii(n.toString());return}this.writeAscii(String(n))}writeStruct(e,n){this.ensure(2),this.json[this.i++]=RRt;let r=!1,s=typeof n.__type=="string",i;s&&(i=new Set);for(let[o,a]of e.structIterator()){let c=n[o];if(c==null&&!a.isIdempotencyToken())continue;r&&(this.ensure(1),this.json[this.i++]=mle),r=!0;let u=this.settings.jsonName?a.getMergedTraits().jsonName??o:o;i&&(i.add(o),i.add(u)),this.writeAsciiQuoted(u),this.json[this.i++]=hle,this.writeValue(a,c,e)}if(!r&&e.isUnionSchema()){let{$unknown:o}=n;if(Array.isArray(o)){let[a,c]=o;this.writeAsciiQuoted(a),this.ensure(1),this.json[this.i++]=hle,this.writeValue(15,c,e)}}else if(s)for(let o in n){if(i.has(o))continue;i.add(o);let a=n[o];r&&(this.ensure(1),this.json[this.i++]=mle),r=!0,this.writeAsciiQuoted(o),this.ensure(1),this.json[this.i++]=hle,this.writeValue(15,a,void 0)}this.ensure(1),this.json[this.i++]=kRt}writeList(e,n,r){let s=!!e.getMergedTraits().sparse,i=e.getValueSchema();if(!r&&(i.isStringSchema()||i.isNumericSchema()||i.isBooleanSchema())){let a=!1;for(let u=0;u{p();i_();ALe();ELe();mR=class extends vl{settings;constructor(e){super(),this.settings=e}createSerializer(){let e=new B2(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new N2(this.settings);return e.setSerdeContext(this.serdeContext),e}}});var fR,gle=V(()=>{p();$r();Ki();T2();fle();k2();fR=class extends vS{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:n,serviceTarget:r,awsQueryCompatible:s,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:n}),this.serviceTarget=r,this.codec=i??new mR({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!s,this.mixin=new Ky(this.awsQueryCompatible)}async serializeRequest(e,n,r){let s=await super.serializeRequest(e,n,r);return s.path.endsWith("/")||(s.path+="/"),s.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,s.headers["x-amz-target"]=`${this.serviceTarget}.${e.name}`,this.awsQueryCompatible&&(s.headers["x-amzn-query-mode"]="true"),(Qy(e.input)==="unit"||!s.body)&&(s.body="{}"),s}getPayloadCodec(){return this.codec}async handleError(e,n,r,s,i){let{awsQueryCompatible:o}=this;o&&this.mixin.setQueryCompatError(s,r);let a=ule(r,s,o)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let{errorSchema:c,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,r,s,i,o?this.mixin.findQueryCompatibleError:void 0),l=qn.of(c),d=s.message??s.Message??"UnknownError",h=this.compositeErrorRegistry.getErrorCtor(c)??Error,m=new h({}),f={},g=this.codec.createDeserializer();for(let[A,y]of l.structIterator())s[A]!=null&&(f[A]=g.readObject(y,s[A]));throw o&&this.mixin.queryCompatOutput(s,f),this.mixin.decorateServiceException(Object.assign(m,u,{$fault:l.getMergedTraits().error,message:d},f),s)}}});var Ale,BRt=V(()=>{p();gle();Ale=class extends fR{constructor({defaultNamespace:e,errorTypeRegistries:n,serviceTarget:r,awsQueryCompatible:s,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:n,serviceTarget:r,awsQueryCompatible:s,jsonCodec:i})}getShapeId(){return"aws.protocols#awsJson1_0"}getJsonRpcVersion(){return"1.0"}getDefaultContentType(){return"application/x-amz-json-1.0"}}});var yle,PRt=V(()=>{p();gle();yle=class extends fR{constructor({defaultNamespace:e,errorTypeRegistries:n,serviceTarget:r,awsQueryCompatible:s,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:n,serviceTarget:r,awsQueryCompatible:s,jsonCodec:i})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}});var jS,ORt=V(()=>{p();$r();Ki();T2();fle();k2();jS=class extends Xv{serializer;deserializer;codec;mixin=new Ky;constructor({defaultNamespace:e,errorTypeRegistries:n,jsonCodec:r}){super({defaultNamespace:e,errorTypeRegistries:n});let s={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=r??new mR(s),this.serializer=new tR(this.codec.createSerializer(),s),this.deserializer=new eR(this.codec.createDeserializer(),s)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,n,r){let s=await super.serializeRequest(e,n,r),i=qn.of(e.input);if(!s.headers["content-type"]){let o=this.mixin.resolveRestContentType(this.getDefaultContentType(),i);o&&(s.headers["content-type"]=o)}return s.body==null&&s.headers["content-type"]===this.getDefaultContentType()&&(s.body="{}"),s}async deserializeResponse(e,n,r){let s=await super.deserializeResponse(e,n,r),i=qn.of(e.output);for(let[o,a]of i.structIterator())a.getMemberTraits().httpPayload&&!(o in s)&&(s[o]=null);return s}async handleError(e,n,r,s,i){let o=lle(r,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);let{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,s,i),u=qn.of(a),l=s.message??s.Message??"UnknownError",d=this.compositeErrorRegistry.getErrorCtor(a)??Error,h=new d({});await this.deserializeHttpMessage(a,n,r,s);let m={},f=this.codec.createDeserializer();for(let[g,A]of u.structIterator()){let y=A.getMergedTraits().jsonName??g;m[g]=f.readObject(A,s[y])}throw this.mixin.decorateServiceException(Object.assign(h,c,{$fault:u.getMergedTraits().error,message:l},m),s)}getDefaultContentType(){return"application/json"}}});var P2,bLe=V(()=>{p();$r();Ki();js();js();i_();rle();ile();ale();k2();M6();P2=class extends vl{settings;constructor(e){super(),this.settings=e}async read(e,n){let r=R2(e)?v2:void 0;return this._read(e,typeof n=="string"?JSON.parse(n,r):await CB(n,this.serdeContext,e))}readObject(e,n){return this._read(e,n)}_read(e,n){let r=n!==null&&typeof n=="object",s=qn.of(e);if(r){if(s.isStructSchema()){let o=n,a=s.isUnionSchema(),c={},u,{jsonName:l}=this.settings;l&&(u={});let d;a&&(d=new hR(o,c));for(let[h,m]of s.structIterator()){let f=h;l&&(f=m.getMergedTraits().jsonName??f,u[f]=h),a&&d.mark(f),o[f]!=null&&(c[h]=this._read(m,o[f]))}if(a)d.writeUnknown();else if(typeof o.__type=="string")for(let h in o){let m=o[h],f=l?u[h]??h:h;f in c||(c[f]=m)}return c}if(Array.isArray(n)&&s.isListSchema()){let o=s.getValueSchema(),a=[];for(let c of n)a.push(this._read(o,c));return a}if(s.isMapSchema()){let o=s.getValueSchema(),a={};for(let c in n)c==="__proto__"&&zy(a),a[c]=this._read(o,n[c]);return a}}if(s.isBlobSchema()&&typeof n=="string")return wl(n);let i=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof n=="string"&&i)return i==="application/json"||i.endsWith("+json")?vu.from(n):n;if(s.isTimestampSchema()&&n!=null)switch(Fd(s,this.settings)){case 5:return MU(n);case 6:return qv(n);case 7:return LU(n);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",n),new Date(n)}if(s.isBigIntegerSchema()&&(typeof n=="number"||typeof n=="string"))return BigInt(n);if(s.isBigDecimalSchema()&&n!=null){if(n instanceof zi)return n;let o=n;return o.type==="bigDecimal"&&"string"in o?new zi(o.string,o.type):new zi(String(n),"bigDecimal")}if(s.isNumericSchema()&&typeof n=="string"){switch(n){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return n}if(s.isDocumentSchema())if(r){let o=Array.isArray(n)?[]:{};for(let a in n){a==="__proto__"&&zy(o);let c=n[a];c instanceof zi?o[a]=c:o[a]=this._read(s,c)}return o}else return structuredClone(n);return n}}});var MRt,Ele,LRt=V(()=>{p();js();MRt="\u039D",Ele=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,n)=>{if(n instanceof zi){let r=`${MRt+"nv"+this.counter++}_`+n.string;return this.values.set(`"${r}"`,n.string),r}if(typeof n=="bigint"){let r=n.toString(),s=`${MRt+"b"+this.counter++}_`+r;return this.values.set(`"${s}"`,r),s}return n}}replaceInJson(e){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(let[n,r]of this.values)e=e.replace(n,r);return e}}});var O2,_Le=V(()=>{p();$r();Ki();js();i_();LRt();M6();O2=class extends vl{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,n){this.rootSchema=qn.of(e),this.buffer=this._write(this.rootSchema,n)}flush(){let{rootSchema:e,useReplacer:n}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!n)return JSON.stringify(this.buffer);let r=new Ele;return r.replaceInJson(JSON.stringify(this.buffer,r.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(e,n){this.write(e,n),typeof this.buffer=="object"&&(this.buffer.__type=qn.of(e).getName(!0))}_write(e,n,r){let s=n!==null&&typeof n=="object",i=qn.of(e);if(s){if(i.isStructSchema()){let o=n,a={},{jsonName:c}=this.settings,u;c&&(u={});let l=0;for(let[d,h]of i.structIterator()){let m=this._write(h,o[d],i);if(m!==void 0){let f=d;c&&(f=h.getMergedTraits().jsonName??d,u[d]=f),a[f]=m,l++}}if(i.isUnionSchema()&&l===0){let{$unknown:d}=o;if(Array.isArray(d)){let[h,m]=d;h==="__proto__"&&zy(a),a[h]=this._write(15,m)}}else if(typeof o.__type=="string")for(let d in o){let h=o[d],m=c?u[d]??d:d;m in a||(a[m]=this._write(15,h))}return a}if(Array.isArray(n)&&i.isListSchema()){let o=i.getValueSchema(),a=[],c=!!i.getMergedTraits().sparse;for(let u of n)(c||u!=null)&&a.push(this._write(o,u));return a}if(i.isMapSchema()){let o=i.getValueSchema(),a={},c=!!i.getMergedTraits().sparse;for(let u in n){let l=n[u];(c||l!=null)&&(u==="__proto__"&&zy(a),a[u]=this._write(o,l))}return a}if(n instanceof Uint8Array&&i.isBlobSchema())return i===this.rootSchema?n:(this.serdeContext?.base64Encoder??ja)(n);if(n instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema()))switch(Fd(i,this.settings)){case 5:return n.toISOString().replace(".000Z","Z");case 6:return Hg(n);case 7:return n.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",n),n.getTime()/1e3}n instanceof zi&&(this.useReplacer=!0)}if(!(n===null&&r?.isStructSchema())){if(i.isStringSchema()){if(typeof n>"u"&&i.isIdempotencyToken())return zg();let o=i.getMergedTraits().mediaType;return n!=null&&o&&(o==="application/json"||o.endsWith("+json"))?vu.from(n):n}if(typeof n=="number")return Math.abs(n)===1/0||isNaN(n)?String(n):n;if(typeof n=="string"&&i.isBlobSchema())return i===this.rootSchema?n:(this.serdeContext?.base64Encoder??ja)(n);if(typeof n=="bigint"&&(this.useReplacer=!0),i.isDocumentSchema())if(s){if(n instanceof Uint8Array)return(this.serdeContext?.base64Encoder??ja)(n);let o=Array.isArray(n)?[]:{};for(let a in n){let c=n[a];a==="__proto__"&&zy(o),c instanceof zi?(this.useReplacer=!0,o[a]=c):o[a]=this._write(i,c)}return o}else return structuredClone(n);return n}}}});var ble,FRt=V(()=>{p();i_();bLe();_Le();ble=class extends vl{settings;constructor(e){super(),this.settings=e}createSerializer(){let e=new O2(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new P2(this.settings);return e.setSerdeContext(this.serdeContext),e}}});var Cle=ee(Sle=>{p();var tcr=/[&<>"]/g,ncr={"&":"&","<":"<",">":">",'"':"""};function rcr(t){return t.replace(tcr,e=>ncr[e])}var scr=/[&"'<>\r\n\u0085\u2028]/g,icr={"&":"&",'"':""","'":"'","<":"<",">":">","\r":" ","\n":" ","\x85":"…","\u2028":"
"};function ocr(t){return t.replace(scr,e=>icr[e])}var _le=class{value;constructor(e){this.value=e}toString(){return ocr(""+this.value)}},CLe=class t{name;children;attributes={};static of(e,n,r){let s=new t(e);return n!==void 0&&s.addChildNode(new _le(n)),r!==void 0&&s.withName(r),s}constructor(e,n=[]){this.name=e,this.children=n}withName(e){return this.name=e,this}addAttribute(e,n){return this.attributes[e]=n,this}addChildNode(e){return this.children.push(e),this}removeAttribute(e){return delete this.attributes[e],this}n(e){return this.name=e,this}c(e){return this.children.push(e),this}a(e,n){return n!=null&&(this.attributes[e]=n),this}cc(e,n,r=n){if(e[n]!=null){let s=t.of(n,e[n]).withName(r);this.c(s)}}l(e,n,r,s){e[n]!=null&&s().map(o=>{o.withName(r),this.c(o)})}lc(e,n,r,s){if(e[n]!=null){let i=s(),o=new t(r);i.map(a=>{o.c(a)}),this.c(o)}}toString(){let e=!!this.children.length,n=`<${this.name}`,r=this.attributes;for(let s of Object.keys(r)){let i=r[s];i!=null&&(n+=` ${s}="${rcr(""+i)}"`)}return n+=e?`>${this.children.map(s=>s.toString()).join("")}`:"/>"}};function SLe(t){Object.defineProperty(t,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}function acr(t){return new ILe(t).parse()}var ILe=class t{x;i=0;z;constructor(e){this.x=e,this.x=e.replace(/\r\n?/g,` -`),this.z=this.x.length}parse(){let e=this,{z:n}=e;for(;e.i=n));)if(e.isNext(""),e.trim();else if(e.isNext(""),e.trim();else if(e.isNext("(e[n]=r,e),{}),fragment:t.hash})}async function sLr(t,e){let r=await XOr(t.body).transformToString();if(t.statusCode===200){let i=JSON.parse(r);if(typeof i.AccessKeyId!="string"||typeof i.SecretAccessKey!="string"||typeof i.Token!="string"||typeof i.Expiration!="string")throw new yO("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:e});return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.Token,expiration:ZOr(i.Expiration)}}if(t.statusCode>=400&&t.statusCode<500){let i={};try{i=JSON.parse(r)}catch{}throw Object.assign(new yO(`Server responded with status: ${t.statusCode}`,{logger:e}),{Code:i.Code,Message:i.Message})}throw new yO(`Server responded with status: ${t.statusCode}`,{logger:e})}var oLr=(t,e,n)=>async()=>{for(let r=0;rsetTimeout(s,n))}return await t()},aLr="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",cLr="http://169.254.170.2",lLr="AWS_CONTAINER_CREDENTIALS_FULL_URI",uLr="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",dLr="AWS_CONTAINER_AUTHORIZATION_TOKEN",pLr=(t={})=>{t.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let e,n=t.awsContainerCredentialsRelativeUri??process.env[aLr],r=t.awsContainerCredentialsFullUri??process.env[lLr],i=t.awsContainerAuthorizationToken??process.env[dLr],s=t.awsContainerAuthorizationTokenFile??process.env[uLr],o=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?.warn?console.warn:t.logger.warn.bind(t.logger);if(n&&r&&(o("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),o("awsContainerCredentialsRelativeUri will take precedence.")),i&&s&&(o("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),o("awsContainerAuthorizationTokenFile will take precedence.")),n)e=`${cLr}${n}`;else if(r)e=r;else throw new yO(`No HTTP credential provider host provided. +Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:t.logger});let a=new URL(e);rLr(a,t.logger);let c=zOr.create({connectionTimeout:t.timeout??1e3}),u=t.timeout??1e3,l=oLr(async()=>{let d=iLr(a);s?d.headers.Authorization=NGt((await KOr.readFile(s)).toString()):i&&(d.headers.Authorization=NGt(i));try{let m=await c.handle(d,{requestTimeout:u});return sLr(m.response).then(h=>YOr(h,"CREDENTIALS_HTTP","z"))}catch(m){throw new yO(String(m),{logger:t.logger})}},t.maxRetries??3,t.timeout??1e3);return async()=>{try{return await l()}finally{c.destroy?.()}}},NGt=t=>{if(t.includes(`\r +`))throw new yO("Authorization token contains invalid \\r\\n sequence.");return t};DGt.fromHttp=pLr});function mLr(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function hLr(t){return{schemeId:"smithy.api#noAuth"}}var PGt,MGt,OGt,dHe=v(()=>{p();xh();Yi();PGt=async(t,e,n)=>({operation:wc(e).operation,region:await qa(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});MGt=t=>{let e=[];return t.operation==="CreateToken"?e.push(hLr(t)):e.push(mLr(t)),e},OGt=t=>{let e=GC(t);return Object.assign(e,{authSchemePreference:qa(t.authSchemePreference??[])})}});var LGt,FGt,pHe=v(()=>{p();LGt=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),FGt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var z1,R7=v(()=>{z1={name:"@aws-sdk/nested-clients",version:"3.997.45",description:"Nested clients for AWS SDK packages.",homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",license:"Apache-2.0",author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/sdk-for-javascript/"},repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/nested-clients"},files:["./cognito-identity.d.ts","./cognito-identity.js","./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sso.d.ts","./sso.js","./sts.d.ts","./sts.js","dist-*/**"],sideEffects:!1,main:"./dist-cjs/index.js",module:"./dist-es/index.js",browser:{"./dist-es/submodules/cognito-identity/runtimeConfig":"./dist-es/submodules/cognito-identity/runtimeConfig.browser","./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sso/runtimeConfig":"./dist-es/submodules/sso/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},types:"./dist-types/index.d.ts",typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"],"*":["dist-types/ts3.4/submodules/*/index.d.ts"]}},"react-native":{},exports:{"./package.json":"./package.json","./sso-oidc":{types:"./dist-types/submodules/sso-oidc/index.d.ts",module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{types:"./dist-types/submodules/sts/index.d.ts",module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js"},"./signin":{types:"./dist-types/submodules/signin/index.d.ts",module:"./dist-es/submodules/signin/index.js",node:"./dist-cjs/submodules/signin/index.js",import:"./dist-es/submodules/signin/index.js",require:"./dist-cjs/submodules/signin/index.js"},"./cognito-identity":{types:"./dist-types/submodules/cognito-identity/index.d.ts",module:"./dist-es/submodules/cognito-identity/index.js",node:"./dist-cjs/submodules/cognito-identity/index.js",import:"./dist-es/submodules/cognito-identity/index.js",require:"./dist-cjs/submodules/cognito-identity/index.js"},"./sso":{types:"./dist-types/submodules/sso/index.d.ts",module:"./dist-es/submodules/sso/index.js",node:"./dist-cjs/submodules/sso/index.js",import:"./dist-es/submodules/sso/index.js",require:"./dist-cjs/submodules/sso/index.js"}},scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline","build:es":"premove dist-es && tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"premove dist-types && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types",lint:"node ../../scripts/validation/submodules-linter.js",prebuild:"yarn lint",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},dependencies:{"@aws-sdk/core":"^3.978.0","@aws-sdk/signature-v4-multi-region":"^3.996.46","@aws-sdk/types":"^3.974.5","@smithy/core":"^3.33.3","@smithy/fetch-http-handler":"^5.7.2","@smithy/node-http-handler":"^4.11.3","@smithy/types":"^4.17.2",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~7.0.2"},engines:{node:">=20.0.0"}}});var mHe,QGt=v(()=>{p();mHe=Symbol("@smithy/core/cbor::tagSymbol")});var k7,hHe=v(()=>{p();ps();k7=(t,e)=>{let n=i=>{let s=i;return typeof s=="number"&&(s=s.toString()),s.indexOf(",")>=0&&(s=s.split(",")[0]),s.indexOf(":")>=0&&(s=s.split(":")[0]),s.indexOf("#")>=0&&(s=s.split("#")[1]),s};if(e.__type!==void 0)return n(e.__type);let r;for(let i in e)if(Ti(e,i)&&i.toLowerCase()==="code"){r=i;break}if(r&&e[r]!==void 0)return n(e[r])}});function Ohe(t){let e=t.getSchema(),n=e[UGt];if(n)return n;let r=[],i=[];for(let[a,c]of t.structIterator())r.push(a),i.push(c);let s=new Array(r.length);for(let a=0;a>8,i[2]=n&255),i.set(e,r),i}function qGt(t){return Lhe?Buffer.allocUnsafe(t):new Uint8Array(t)}function jW(t,e,n,r){if(e==null){if(e===void 0&&t.isIdempotencyToken()){$C(yy());return}Ma(1),Is[Qi++]=246;return}if(t.isUnitSchema()){Ma(1),Lp(5,0);return}if(typeof e=="object"){if(t.isBlobSchema()&&e instanceof Uint8Array){Bhe(e);return}if(t.isTimestampSchema()&&e instanceof Date){yHe(e);return}if(t.isStructSchema()){yLr(t,e,r);return}if(Array.isArray(e)&&(t.isListSchema()||t.isDocumentSchema())){WGt(t,e,t.isDocumentSchema(),r);return}if(t.isMapSchema()){gHe(t,e,!1,r);return}if(e instanceof Date){yHe(e);return}if(e instanceof Uint8Array){Bhe(e);return}if(e instanceof co){YGt(e);return}if(e[mHe]){let s=e;VGt(s.tag,s.value);return}if(t.isDocumentSchema()){Array.isArray(e)?WGt(t,e,!0,r):gHe(t,e,!0,r);return}if(t.isBigDecimalSchema()){VW(e);return}gHe(t,e,!0,r);return}if(typeof e=="string"){if(t.isBlobSchema()){let s=(r?.base64Decoder??gu)(e);Bhe(s);return}$C(e);return}if(typeof e=="number"){Ma(9),Number.isInteger(e)&&e>=-9007199254740992&&e<=9007199254740991?Fhe(e):IHe(e);return}if(typeof e=="boolean"){Ma(1),Is[Qi++]=224|(e?21:20);return}if(typeof e=="bigint"){Phe(e);return}$C(String(e))}function yLr(t,e,n){if(t.isUnionSchema()){let d=!1;for(let[m,h]of t.structIterator()){let f=e[m];if(f!=null){Ma(9),Lp(5,1),$C(m),jW(h,f,t,n),d=!0;break}}if(!d){let{$unknown:m}=e;Array.isArray(m)?(Ma(9),Lp(5,1),$C(m[0]),VW(m[1])):(Ma(9),Lp(5,0))}return}let r=Ohe(t),{memberNames:i,memberSchemas:s,encodedKeys:o}=r,a=i.length,c;a<24?c=1:a<256?c=2:c=3,Ma(c);let u=Qi;Qi+=c;let l=0;for(let d=0;d>8,Is[u+2]=l&255)}function WGt(t,e,n,r){let i=!!t.getMergedTraits().sparse,s=t.getValueSchema();if(n||i){let o=[];for(let a=0;a=-9007199254740992&&t<=9007199254740991?Fhe(t):IHe(t);return}if(typeof t=="boolean"){Ma(1),Is[Qi++]=224|(t?21:20);return}if(typeof t=="bigint"){Phe(t);return}if(t instanceof Uint8Array){Bhe(t);return}if(t instanceof Date){yHe(t);return}if(t instanceof co){YGt(t);return}if(t[mHe]){let e=t;VGt(e.tag,e.value);return}if(Array.isArray(t)){Ma(9),Lp(4,t.length);for(let e=0;eIs.length){let e=Is.length*2;for(;e>8,Is[Qi++]=e&255;else if(e<4294967296)Is[Qi++]=t<<5|26,bO.setUint32(Qi,e),Qi+=4;else{Is[Qi++]=t<<5|27;let n=e/4294967296|0,r=e-n*4294967296|0;bO.setUint32(Qi,n),bO.setUint32(Qi+4,r),Qi+=8}}function jGt(t,e){let n=Number(e);if(n<4294967296){Lp(t,n);return}Is[Qi++]=t<<5|27,bO.setBigUint64(Qi,e),Qi+=8}function $C(t){let e=t.length;if(e<=23){let n=WW.get(t);if(n){Ma(n.bytes.length),Is.set(n.bytes,Qi),Qi+=n.bytes.length,n.epoch=fHe;return}let r=Qi;HGt(t,e);let i=Qi,s=Uint8Array.prototype.slice.call(Is,r,i);if(WW.size>=GGt){if($Gt)return;let o=0;for(let[a,c]of WW){if(o>=1024)break;c.epoch!==fHe&&(WW.delete(a),++o)}if(o===0){$Gt=!0;return}}WW.size=0,n=e?0:1,r=e?t:-t-1;Lp(n,r)}function Phe(t){let e=t>=0,n=e?0:1,r=e?t:-t-BigInt(1);if(r=0;--c)o[c]=Number(a&BigInt(255)),a>>=BigInt(8);Ma(s+16),Is[Qi++]=e?194:195,Lp(2,s),Is.set(o,Qi),Qi+=s}}function Bhe(t){Ma(t.length+9),Lp(2,t.length),Is.set(t,Qi),Qi+=t.length}function VGt(t,e){Ma(9),typeof t=="bigint"?jGt(6,t):Lp(6,t),VW(e)}function YGt(t){let e=t.string,n=BigInt(0),r=e.search(/[eE]/);r!==-1&&(n=BigInt(e.slice(r+1)),e=e.slice(0,r));let i=e.indexOf("."),s=i===-1?0:e.length-i-1,o=n-BigInt(s),a=BigInt(e.replace(".",""));Ma(9),Is[Qi++]=196,Lp(4,2),Ma(9),o>=-0x20000000000000n&&o<=0x1fffffffffffffn?Fhe(Number(o)):Phe(o),Phe(a)}function yHe(t){Ma(18),Lp(6,1);let e=t.getTime()/1e3;Number.isInteger(e)?Fhe(e):IHe(e)}var Dhe,UGt,Lhe,ALr,AHe,Is,bO,Qi,GGt,WW,fHe,$Gt,wHe=v(()=>{p();ps();ti();bo();Mi();QGt();Dhe=class extends Dp{write(e,n){Qi=0;let r=jn.of(e);jW(r,n,void 0,this.serdeContext)}flush(){let e=Is.subarray(0,Qi);return Qi=0,Is=qGt(AHe),bO=new DataView(Is.buffer,Is.byteOffset,Is.byteLength),e}},UGt=Symbol.for("@smithy/cbor-struct-cache");Lhe=typeof Buffer<"u",ALr=new TextEncoder,AHe=2048,Is=Lhe?Buffer.allocUnsafe(AHe):new Uint8Array(AHe),bO=new DataView(Is.buffer,Is.byteOffset,Is.byteLength),Qi=0,GGt=2048,WW=new Map,fHe=0,$Gt=!1});function by(t){if(vr>=Fp)throw new Error("unexpected end of CBOR payload.");let e=(Au[vr]&224)>>5;if((Au[vr]&31)===31&&e>=2&&e<=5)return SLr(t,e);switch(e){case 0:return vLr();case 1:return RLr();case 2:return Whe();case 3:return YW();case 4:return ELr(t);case 5:return bLr(t);case 6:return xLr(t);case 7:return BLr();default:throw new Error(`unexpected CBOR major type ${e}.`)}}function ELr(t){let e=$he(),n=t.isListSchema()?t.getValueSchema():t,r=Array(e);for(let i=0;i=0){f=A+1,f>=c&&(f=0);let y=by(s[A]);y!=null&&(u[a[A]]=y)}else{let y=YW(),E=by(jn.of(15));y==="__type"&&typeof E=="string"?h=!0:(l=y,d=E,++m)}}if(r){let g=!0;for(let A in u)if(Ti(u,A)){g=!1;break}g&&m===1&&(u.$unknown=[l,d])}else if(h){vr=n;let g=jn.of(15);for(let A=0;A=0){h=f+1,h>=a&&(h=0);let g=by(i[f]);g!=null&&(u[o[f]]=g)}else{let g=YW(),A=by(jn.of(15));g!=="__type"&&(l=g,d=A,++m)}}throw new Error("expected break marker.")}let e=t.isMapSchema()?t.getValueSchema():t,n={};for(;vr>>0&kHe-1,i=zGt[r];if(i!==void 0&&i.length===e){let o=!0;for(let a=0;a>7,r=(t&124)>>2,i=(t&3)<<8|e,s=n===0?1:-1;return r===0?i===0?0:s*(Math.pow(2,-14)*(i/1024)):r===31?i===0?s*(1/0):NaN:s*(Math.pow(2,r-15)*(1+i/1024))}function ZGt(t){if(typeof t=="number")return t;let e=Number(t);return Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:t}function KT(t){throw new Error(`CBOR: length ${t} greater than remaining buffer length.`)}function Qhe(t,e){if(t.isTimestampSchema()){if(typeof e=="number")return T1(e);if(typeof e=="object"&&e!==null&&e.tag===1&&"value"in e)return T1(e.value)}if(t.isBlobSchema()||typeof e>"u"||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="bigint"||typeof e=="symbol"||typeof e!="object"||e===null||"byteLength"in e||e instanceof Date||e instanceof co||t.isDocumentSchema())return e;if(t.isListSchema()){let r=t.getValueSchema(),i=[];for(let s of e)i.push(Qhe(r,s));return i}let n={};if(t.isMapSchema()){let r=t.getValueSchema();for(let i in e)Ti(e,i)&&(n[i]=Qhe(r,e[i]))}else if(t.isStructSchema()){let r=t.isUnionSchema(),i;if(r){i=new Set;for(let s in e)Ti(e,s)&&s!=="__type"&&i.add(s)}for(let[s,o]of t.structIterator())r&&i.delete(s),e[s]!=null&&(n[s]=Qhe(o,e[s]));if(r&&i?.size===1){let s=!0;for(let o in n)if(Ti(n,o)){s=!1;break}if(s){let o=i.values().next().value;n.$unknown=[o,e[o]]}}else if(typeof e.__type=="string")for(let s in e)Ti(e,s)&&(s in n||(n[s]=e[s]))}return n}var Uhe,JGt,vHe,Au,RHe,K1,vr,Fp,kHe,zGt,THe,D7,e$t=v(()=>{p();ps();ti();bo();Mi();wHe();Uhe=class extends Dp{read(e,n){return Au=n,RHe=JGt&&n instanceof Buffer,K1=new DataView(n.buffer,n.byteOffset,n.byteLength),vr=0,Fp=n.length,D7=D7+1&65535,by(jn.of(e))}readValue(e,n){return Qhe(jn.of(e),n)}},JGt=typeof Buffer<"u",vHe=new TextDecoder,Au=new Uint8Array(0),RHe=!1,K1=new DataView(new ArrayBuffer(0)),vr=0,Fp=0,kHe=2048,zGt=new Array(kHe),THe=new Uint16Array(kHe),D7=0});var Hhe,t$t=v(()=>{p();ti();wHe();e$t();Hhe=class extends Dp{createSerializer(){let e=new Dhe;return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new Uhe;return e.setSerdeContext(this.serdeContext),e}}});var P7,n$t=v(()=>{p();ti();bo();ps();t$t();hHe();P7=class extends CC{codec=new Hhe;serializer=this.codec.createSerializer();deserializer=this.codec.createDeserializer();constructor({defaultNamespace:e,errorTypeRegistries:n}){super({defaultNamespace:e,errorTypeRegistries:n})}getShapeId(){return"smithy.protocols#rpcv2Cbor"}getPayloadCodec(){return this.codec}async serializeRequest(e,n,r){let i=await super.serializeRequest(e,n,r);Object.assign(i.headers,{"content-type":this.getDefaultContentType(),"smithy-protocol":"rpc-v2-cbor",accept:this.getDefaultContentType()}),u0(e.input)==="unit"?(delete i.body,delete i.headers["content-type"]):(i.body||(this.serializer.write(15,{}),i.body=this.serializer.flush()),i.body instanceof Uint8Array&&(i.headers["content-length"]=String(i.body.byteLength)));let{service:s,operation:o}=wc(r),a=`/service/${s}/operation/${o}`;return i.path.endsWith("/")?i.path+=a.slice(1):i.path+=a,i}async deserializeResponse(e,n,r){return super.deserializeResponse(e,n,r)}async handleError(e,n,r,i,s){let o=k7(r,i)??"Unknown",a={$metadata:s,$fault:r.statusCode<=500?"client":"server"},c=this.options.defaultNamespace;o.includes("#")&&([c]=o.split("#"));let u=this.compositeErrorRegistry,l=Tc.for(c);u.copyFrom(l);let d;try{d=u.getSchema(o)}catch{i.Message&&(i.message=i.Message);let E=Tc.for("smithy.ts.sdk.synthetic."+c);u.copyFrom(E);let _=u.getBaseException();if(_){let S=u.getErrorCtor(_);throw Object.assign(new S({name:o}),a,i)}throw Object.assign(new Error(o),a,i)}let m=jn.of(d),h=u.getErrorCtor(d),f=i.message??i.Message??"Unknown",g=new h({}),A={};for(let[y,E]of m.structIterator())A[y]=this.deserializer.readValue(E,i[y]);throw Object.assign(g,a,{$fault:m.getMergedTraits().error,message:f},A)}getDefaultContentType(){return"application/cbor"}}});var r$t=v(()=>{p();hHe();n$t()});var b0,zW=v(()=>{p();Yi();bo();b0=class{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,n){let r=n.getMemberSchemas(),i=Object.values(r).find(s=>!!s.getMergedTraits().httpPayload);if(i){let s=i.getMergedTraits().mediaType;return s||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":e)}else if(!n.isUnitSchema()&&Object.values(r).find(o=>{let{httpQuery:a,httpQueryParams:c,httpHeader:u,httpLabel:l,httpPrefixHeaders:d}=o.getMergedTraits();return!a&&!c&&!u&&!l&&d===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,n,r,i,s,o){let a=e;e.includes("#")&&([,a]=e.split("#"));let c={$metadata:s,$fault:r.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:o?.(this.errorRegistry,a)??this.errorRegistry.getSchema(e),errorMetadata:c}}catch{i.message=i.message??i.Message??"UnknownError";let l=this.errorRegistry,d=l.getBaseException();if(d){let f=l.getErrorCtor(d)??Error;throw this.decorateServiceException(Object.assign(new f({name:a}),c),i)}let m=i,h=m?.message??m?.Message??m?.Error?.Message??m?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(h),{name:a},c),i)}}compose(e,n,r){let i=r;n.includes("#")&&([i]=n.split("#"));let s=Tc.for(i),o=Tc.for("smithy.ts.sdk.synthetic."+r);e.copyFrom(s),e.copyFrom(o),this.errorRegistry=e}decorateServiceException(e,n={}){if(this.queryCompat){let r=e.Message??n.Message,i=iO(e,n);r&&(i.message=r);let s=i.Error??{};s.Type=i.Error?.Type,s.Code=i.Error?.Code,s.Message=i.Error?.message??i.Error?.Message??r,i.Error=s;let o=i.$metadata.requestId;return o&&(i.RequestId=o),i}return iO(e,n)}setQueryCompatError(e,n){let r=n.headers?.["x-amzn-query-error"];if(e!==void 0&&r!=null){let[i,s]=r.split(";"),o=Object.keys(e),a={Code:i,Type:s};e.Code=i,e.Type=s;for(let c=0;cjn.of(i).getMergedTraits().awsQueryError?.[0]===n)}}}});var qhe,i$t=v(()=>{p();r$t();bo();zW();qhe=class extends P7{awsQueryCompatible;mixin;constructor({defaultNamespace:e,errorTypeRegistries:n,awsQueryCompatible:r}){super({defaultNamespace:e,errorTypeRegistries:n}),this.awsQueryCompatible=!!r,this.mixin=new b0(this.awsQueryCompatible)}async serializeRequest(e,n,r){let i=await super.serializeRequest(e,n,r);return this.awsQueryCompatible&&(i.headers["x-amzn-query-mode"]="true"),i}async handleError(e,n,r,i,s){this.awsQueryCompatible&&this.mixin.setQueryCompatError(i,r);let o=(()=>{let f=r.headers["x-amzn-query-error"];return f&&this.awsQueryCompatible?f.split(";")[0]:k7(r,i)??"Unknown"})();this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);let{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,i,s,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),u=jn.of(a),l=i.message??i.Message??"UnknownError",d=this.compositeErrorRegistry.getErrorCtor(a)??Error,m=new d({}),h={};for(let[f,g]of u.structIterator())i[f]!=null&&(h[f]=this.deserializer.readValue(g,i[f]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(i,h),this.mixin.decorateServiceException(Object.assign(m,c,{$fault:u.getMergedTraits().error,message:l},h),i)}}});var yu,Y_=v(()=>{p();yu=class{serdeContext;setSerdeContext(e){this.serdeContext=e}}});var J1,jhe=v(()=>{p();J1=class{from;to;keys;constructor(e,n){this.from=e,this.to=n;let r=Object.keys(this.from),i=new Set(r);i.delete("__type"),this.keys=i}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){let e=this.keys.values().next().value,n=this.from[e];this.to.$unknown=[e,n]}}}});function Vhe(){if(M7===void 0)try{if(typeof Buffer!="function")M7=!1;else{let t=JSON.parse(Buffer.from([123,125]));M7=t!==null&&typeof t=="object"}}catch{M7=!1}return M7}var M7,BHe=v(()=>{p()});function KW(t,e,n){if(n?.source){let r=n.source;if(typeof e=="number")return e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER?PLr(r,e)?e:new co(r,"bigDecimal"):DLr(r)?new co(r,"bigDecimal"):/[eE]/.test(r)?MLr(r):BigInt(r)}return e}function DLr(t){let e=t.indexOf(".");if(e===-1)return!1;let n=t.search(/[eE]/);if(n===-1)return!0;let r=n-e-1;return parseInt(t.slice(n+1),10)=c.length?i=c+"0".repeat(l-c.length):i=c.slice(0,l)+"."+c.slice(l)}return i.includes(".")&&(i=i.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")),(e?"-":"")+i}function MLr(t){let e=t.search(/[eE]/),n=parseInt(t.slice(e+1),10),r=t.startsWith("-"),i=t.slice(r?1:0,e),s=i.indexOf("."),o,a;if(s===-1)o=i,a=n;else{o=i.slice(0,s)+i.slice(s+1);let u=i.length-s-1;a=n-u}o=o.replace(/0+$/,"")||"0";let c=BigInt(o)*10n**BigInt(a+(i.replace(".","").length-o.length));return r?-c:c}var Yhe=v(()=>{p();Mi()});function JW(t){let e=jn.of(t),n=e.getSchema();if(Array.isArray(n)&&e.isStructSchema()){if(DHe in n)return n[DHe];let r=zhe(e,new Set);return n[DHe]=r,r}return zhe(e,new Set)}function zhe(t,e){let n=t.getSchema();if(e.has(n))return!1;if(e.add(n),t.isBigIntegerSchema()||t.isBigDecimalSchema())return!0;if(t.isStructSchema()){for(let[,r]of t.structIterator())if(zhe(r,e))return!0}else if(t.isListSchema()||t.isMapSchema()){if(zhe(t.getValueSchema(),e))return!0}else if(t.isDocumentSchema())return!0;return!1}var DHe,Khe=v(()=>{p();bo();DHe=Symbol.for("@aws-sdk/reviver")});var Jhe,PHe=v(()=>{p();ti();Mi();Jhe=(t,e)=>wm(t,e).then(n=>(e?.utf8Encoder??$l)(n))});async function _O(t,e,n){let r;if(Vhe()&&typeof t?.[Symbol.asyncIterator]=="function"){let s=await wm(t,e);typeof Buffer=="function"&&(Buffer.isBuffer(s)?r=s:r=Buffer.from(s.buffer,s.byteOffset,s.byteLength))}if(r||(r=await Jhe(t,e)),r.length===0)return{};let i=n&&JW(n)?KW:void 0;try{return JSON.parse(r,i)}catch(s){throw s?.name==="SyntaxError"&&Object.defineProperty(s,"$responseBodyText",{value:typeof r=="string"?r:r.toString("utf8")}),s}}var o$t,s$t,MHe,Xhe,Zhe,a$t,XW=v(()=>{p();ti();PHe();BHe();Yhe();Khe();o$t=async(t,e)=>{let n=await _O(t,e);return n.message=n.message??n.Message,n},s$t=(t,e)=>Object.keys(t).find(n=>n.toLowerCase()===e.toLowerCase()),MHe=t=>{let e=t;return typeof e=="number"&&(e=e.toString()),e.indexOf(",")>=0&&(e=e.split(",")[0]),e.indexOf(":")>=0&&(e=e.split(":")[0]),e.indexOf("#")>=0&&(e=e.split("#")[1]),e},Xhe=(t,e)=>a$t(t,e,["header","code","type"]),Zhe=(t,e,n=!1)=>a$t(t,e,n?["code","header","type"]:["type","code","header"]),a$t=({headers:t},e,n)=>{for(;n.length>0;)switch(n.shift()){case"header":let i=s$t(t??{},"x-amzn-errortype");if(i!==void 0)return MHe(t[i]);break;case"code":let s=s$t(e??{},"code");if(s&&e[s]!==void 0)return MHe(e[s]);break;case"type":if(e?.__type!==void 0)return MHe(e.__type);break}}});function _0(t){Object.defineProperty(t,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}var O7=v(()=>{p()});var ZW,OHe=v(()=>{p();ti();bo();Mi();Y_();jhe();BHe();Yhe();Khe();XW();O7();ZW=class extends yu{settings;constructor(e){super(),this.settings=e}async read(e,n){let r=JW(e)?KW:void 0,i;if(typeof n=="string"){if(n.length===0)return{};i=JSON.parse(n,r)}else if(n instanceof Uint8Array&&Vhe()){if(n.byteLength===0)return{};let s=Buffer.isBuffer(n)?n:Buffer.from(n.buffer,n.byteOffset,n.byteLength);i=JSON.parse(s,r)}else i=await _O(n,this.serdeContext,e);return this._read(e,i)}readObject(e,n){return this._read(e,n)}_read(e,n){let r=n!==null&&typeof n=="object",i=jn.of(e);if(r){if(i.isStructSchema())return this._readStruct(i,n);if(Array.isArray(n)&&i.isListSchema()){let o=i.getValueSchema();if(this.needsTransform(o))for(let a=0;a{p();Mi();efe=class t extends Uint8Array{string=null;static allocUnsafe(e){if(typeof Buffer=="function"){let n=Buffer.allocUnsafe(e);return new t(n.buffer,n.byteOffset,n.byteLength)}return new t(e)}toString(){return this.s()}valueOf(){return this.s()}includes(e,n){return typeof e=="string"?this.s().includes(e,n):Uint8Array.prototype.includes.call(this,e,n)}indexOf(e,n){return typeof e=="string"?this.s().indexOf(e,n):Uint8Array.prototype.indexOf.call(this,e,n)}lastIndexOf(e,n){if(typeof e=="string")return this.s().lastIndexOf(e,n);let r=Uint8Array.prototype.lastIndexOf;return n!==void 0?r.call(this,e,n):r.call(this,e)}startsWith(e,n){return this.s().startsWith(e,n)}endsWith(e,n){return this.s().endsWith(e,n)}match(e){return this.s().match(e)}replace(e,n){return this.s().replace(e,n)}search(e){return this.s().search(e)}split(e,n){return this.s().split(e,n)}substring(e,n){return this.s().substring(e,n)}trim(){return this.s().trim()}trimStart(){return this.s().trimStart()}trimEnd(){return this.s().trimEnd()}charAt(e){return this.s().charAt(e)}charCodeAt(e){return this.s().charCodeAt(e)}padStart(e,n){return this.s().padStart(e,n)}padEnd(e,n){return this.s().padEnd(e,n)}repeat(e){return this.s().repeat(e)}toUpperCase(){return this.s().toUpperCase()}toLowerCase(){return this.s().toLowerCase()}s(){if(this.string==null){let e=Date.now();e>c$t+6e4&&(console.warn("@aws-sdk/core/protocols - WARN - JsonCodec2: you have called a string method on a Uint8Array request body. It has been automatically converted to string. In a future version this will throw an error."),c$t=e),this.string=$l(this)}return this.string}},c$t=0});function LHe(t){return efe.allocUnsafe(t)}var tfe,u$t,d$t,OLr,LLr,eH,nfe,rfe,p$t,FLr,QLr,ULr,WC,m$t,tH,FHe=v(()=>{p();ti();bo();Mi();Y_();l$t();tfe=new TextEncoder,u$t=123,d$t=125,OLr=91,LLr=93,eH=34,nfe=58,rfe=44,p$t=92,FLr=new Uint8Array([116,114,117,101]),QLr=new Uint8Array([102,97,108,115,101]),ULr=new Uint8Array([110,117,108,108]),WC=new Array(128).fill(null);WC[8]="b";WC[9]="t";WC[10]="n";WC[12]="f";WC[13]="r";WC[34]='"';WC[92]="\\";for(let t=0;t<32;t++)WC[t]===null&&(WC[t]="u00"+t.toString(16).padStart(2,"0"));m$t=2048;tH=class t extends yu{settings;json;i=0;rootSchema;rawValue;passthrough=!1;constructor(e){super(),this.settings=e,this.json=LHe(m$t)}write(e,n){this.i=0,this.rawValue=n,this.rootSchema=jn.of(e),this.passthrough=this.rootSchema.isBlobSchema()||this.rootSchema.isStringSchema(),this.passthrough||this.writeValue(this.rootSchema,n,void 0)}writeDiscriminatedDocument(e,n){this.i=0,this.rootSchema=jn.of(e);let r=this.rootSchema;if(r.isStructSchema()&&n!=null&&typeof n=="object"){this.writeValue(r,n,void 0);let i=`"__type":"${r.getName(!0)??"Unknown"}",`,s=i.length;this.ensure(s),this.json.copyWithin(1+s,1,this.i),tfe.encodeInto(i,this.json.subarray(1)),this.i+=s}else this.writeValue(r,n,void 0)}flush(){this.rootSchema=void 0;let e=this.i;this.i=0;let n=this.rawValue;if(this.rawValue=void 0,e===0)return n;let r=this.json.subarray(0,e);return this.json=LHe(m$t),r}ensure(e){let{i:n,json:r}=this;if(n+e>r.length){let i=r.length*2;for(;i34&&i<92)this.json[this.i++]=i;else if(i<128){let s=WC[i];if(s!==null){this.ensure(s.length+1),this.json[this.i++]=p$t;for(let o=0;o=55296&&i<=56319){let s=r+1=56320&&s<=57343){this.ensure(4);let{written:o}=tfe.encodeInto(e.substring(r,r+2),this.json.subarray(this.i));this.i+=o,++r}else this.ensure(6),this.writeUnicodeEscape(i)}else if(i>=56320&&i<=57343)this.ensure(6),this.writeUnicodeEscape(i);else{let{i:s,json:o}=this;i<2048?(o[s++]=192|i>>6,o[s++]=128|i&63):(o[s++]=224|i>>12,o[s++]=128|i>>6&63,o[s++]=128|i&63),this.i=s}}this.json[this.i++]=eH}writeUnicodeEscape(e){let{json:n,i:r}=this;n[r++]=p$t,n[r++]=117;let i=e.toString(16).padStart(4,"0");for(let s=0;s<4;++s)n[r++]=i.charCodeAt(s);this.i=r}static B64=(()=>{let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(64);for(let r=0;r<64;++r)n[r]=e.charCodeAt(r);return n})();writeBase64(e){let n=Math.ceil(e.length/3)*4;this.ensure(n+2);let r=this.json,i=t.B64,s=this.i;r[s++]=eH;let o=e.length,a=o%3,c=o-a;for(let u=0;u>2],r[s++]=i[(l&3)<<4|d>>4],r[s++]=i[(d&15)<<2|m>>6],r[s++]=i[m&63]}if(a===2){let u=e[c],l=e[c+1];r[s++]=i[u>>2],r[s++]=i[(u&3)<<4|l>>4],r[s++]=i[(l&15)<<2],r[s++]=61}else if(a===1){let u=e[c];r[s++]=i[u>>2],r[s++]=i[(u&3)<<4],r[s++]=61,r[s++]=61}r[s++]=eH,this.i=s}writeValue(e,n,r){if(n==null){if(r?.isStructSchema()){if(n===void 0&&jn.of(e).isIdempotencyToken()){this.writeAsciiQuoted(yy());return}return}this.ensure(4),this.json.set(ULr,this.i),this.i+=4;return}let i=jn.of(e),s=typeof n=="object";if(i.isStringSchema()){let o=i.getMergedTraits().mediaType;if(o&&(o==="application/json"||o.endsWith("+json"))){this.writeJsonString(xd.from(n).toString());return}}if(s){if(i.isStructSchema()){this.writeStruct(i,n);return}if(Array.isArray(n)&&(i.isListSchema()||i.isDocumentSchema())){this.writeList(i,n,i.isDocumentSchema());return}if(i.isMapSchema()){this.writeMap(i,n,!1);return}if(n instanceof Uint8Array&&(i.isBlobSchema()||i.isDocumentSchema())){this.writeBase64(n);return}if(n instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema())){this.writeTimestamp(i,n);return}if(n instanceof co){this.writeAscii(n.string);return}if(i.isDocumentSchema()){Array.isArray(n)?this.writeList(i,n,!0):this.writeMap(i,n,!0);return}let o=JSON.stringify(n);this.writeAscii(o);return}if(typeof n=="string"){if(i.isBlobSchema()){let o=(this.serdeContext?.base64Encoder??vc)(n);this.writeAsciiQuoted(o);return}this.writeJsonString(n);return}if(typeof n=="number"){if(Math.abs(n)===1/0||Number.isNaN(n)){this.writeAsciiQuoted(String(n));return}let o=String(n);this.writeAscii(o);return}if(typeof n=="boolean"){this.ensure(5);let{i:o,json:a}=this;n?(a.set(FLr,o),o+=4):(a.set(QLr,o),o+=5),this.i=o;return}if(typeof n=="bigint"){this.writeAscii(n.toString());return}this.writeAscii(String(n))}writeStruct(e,n){this.ensure(2),this.json[this.i++]=u$t;let r=!1,i=typeof n.__type=="string",s;i&&(s=new Set);for(let[o,a]of e.structIterator()){let c=n[o];if(c==null&&!a.isIdempotencyToken())continue;r&&(this.ensure(1),this.json[this.i++]=rfe),r=!0;let u=this.settings.jsonName?a.getMergedTraits().jsonName??o:o;s&&(s.add(o),s.add(u)),this.writeAsciiQuoted(u),this.json[this.i++]=nfe,this.writeValue(a,c,e)}if(!r&&e.isUnionSchema()){let{$unknown:o}=n;if(Array.isArray(o)){let[a,c]=o;this.writeAsciiQuoted(a),this.ensure(1),this.json[this.i++]=nfe,this.writeValue(15,c,e)}}else if(i)for(let o in n){if(s.has(o))continue;s.add(o);let a=n[o];r&&(this.ensure(1),this.json[this.i++]=rfe),r=!0,this.writeAsciiQuoted(o),this.ensure(1),this.json[this.i++]=nfe,this.writeValue(15,a,void 0)}this.ensure(1),this.json[this.i++]=d$t}writeList(e,n,r){let i=!!e.getMergedTraits().sparse,s=e.getValueSchema();if(!r&&(s.isStringSchema()||s.isNumericSchema()||s.isBooleanSchema())){let a=!1;for(let u=0;u{p();Y_();OHe();FHe();X1=class extends yu{settings;constructor(e){super(),this.settings=e}createSerializer(){let e=new tH(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new ZW(this.settings);return e.setSerdeContext(this.serdeContext),e}}});var Z1,sfe=v(()=>{p();ti();bo();zW();ife();XW();Z1=class extends CC{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:n,serviceTarget:r,awsQueryCompatible:i,jsonCodec:s}){super({defaultNamespace:e,errorTypeRegistries:n}),this.serviceTarget=r,this.codec=s??new X1({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!i,this.mixin=new b0(this.awsQueryCompatible)}async serializeRequest(e,n,r){let i=await super.serializeRequest(e,n,r);return i.path.endsWith("/")||(i.path+="/"),i.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,i.headers["x-amz-target"]=`${this.serviceTarget}.${e.name}`,this.awsQueryCompatible&&(i.headers["x-amzn-query-mode"]="true"),(u0(e.input)==="unit"||!i.body)&&(i.body="{}"),i}getPayloadCodec(){return this.codec}async handleError(e,n,r,i,s){let{awsQueryCompatible:o}=this;o&&this.mixin.setQueryCompatError(i,r);let a=Zhe(r,i,o)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let{errorSchema:c,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,r,i,s,o?this.mixin.findQueryCompatibleError:void 0),l=jn.of(c),d=i.message??i.Message??"UnknownError",m=this.compositeErrorRegistry.getErrorCtor(c)??Error,h=new m({}),f={},g=this.codec.createDeserializer();for(let[A,y]of l.structIterator())i[A]!=null&&(f[A]=g.readObject(y,i[A]));throw o&&this.mixin.queryCompatOutput(i,f),this.mixin.decorateServiceException(Object.assign(h,u,{$fault:l.getMergedTraits().error,message:d},f),i)}}});var ofe,h$t=v(()=>{p();sfe();ofe=class extends Z1{constructor({defaultNamespace:e,errorTypeRegistries:n,serviceTarget:r,awsQueryCompatible:i,jsonCodec:s}){super({defaultNamespace:e,errorTypeRegistries:n,serviceTarget:r,awsQueryCompatible:i,jsonCodec:s})}getShapeId(){return"aws.protocols#awsJson1_0"}getJsonRpcVersion(){return"1.0"}getDefaultContentType(){return"application/x-amz-json-1.0"}}});var afe,f$t=v(()=>{p();sfe();afe=class extends Z1{constructor({defaultNamespace:e,errorTypeRegistries:n,serviceTarget:r,awsQueryCompatible:i,jsonCodec:s}){super({defaultNamespace:e,errorTypeRegistries:n,serviceTarget:r,awsQueryCompatible:i,jsonCodec:s})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}});var HC,g$t=v(()=>{p();ti();bo();zW();ife();XW();HC=class extends O1{serializer;deserializer;codec;mixin=new b0;constructor({defaultNamespace:e,errorTypeRegistries:n,jsonCodec:r}){super({defaultNamespace:e,errorTypeRegistries:n});let i={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=r??new X1(i),this.serializer=new Q1(this.codec.createSerializer(),i),this.deserializer=new F1(this.codec.createDeserializer(),i)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,n,r){let i=await super.serializeRequest(e,n,r),s=jn.of(e.input);if(!i.headers["content-type"]){let o=this.mixin.resolveRestContentType(this.getDefaultContentType(),s);o&&(i.headers["content-type"]=o)}return i.body==null&&i.headers["content-type"]===this.getDefaultContentType()&&(i.body="{}"),i}async deserializeResponse(e,n,r){let i=await super.deserializeResponse(e,n,r),s=jn.of(e.output);for(let[o,a]of s.structIterator())a.getMemberTraits().httpPayload&&!(o in i)&&(i[o]=null);return i}async handleError(e,n,r,i,s){let o=Xhe(r,i)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);let{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,i,s),u=jn.of(a),l=i.message??i.Message??"UnknownError",d=this.compositeErrorRegistry.getErrorCtor(a)??Error,m=new d({});await this.deserializeHttpMessage(a,n,r,i);let h={},f=this.codec.createDeserializer();for(let[g,A]of u.structIterator()){let y=A.getMergedTraits().jsonName??g;h[g]=f.readObject(A,i[y])}throw this.mixin.decorateServiceException(Object.assign(m,c,{$fault:u.getMergedTraits().error,message:l},h),i)}getDefaultContentType(){return"application/json"}}});var nH,QHe=v(()=>{p();ti();bo();Mi();Mi();Y_();jhe();Yhe();Khe();XW();O7();nH=class extends yu{settings;constructor(e){super(),this.settings=e}async read(e,n){let r=JW(e)?KW:void 0;return this._read(e,typeof n=="string"?JSON.parse(n,r):await _O(n,this.serdeContext,e))}readObject(e,n){return this._read(e,n)}_read(e,n){let r=n!==null&&typeof n=="object",i=jn.of(e);if(r){if(i.isStructSchema()){let o=n,a=i.isUnionSchema(),c={},u,{jsonName:l}=this.settings;l&&(u={});let d;a&&(d=new J1(o,c));for(let[m,h]of i.structIterator()){let f=m;l&&(f=h.getMergedTraits().jsonName??f,u[f]=m),a&&d.mark(f),o[f]!=null&&(c[m]=this._read(h,o[f]))}if(a)d.writeUnknown();else if(typeof o.__type=="string")for(let m in o){let h=o[m],f=l?u[m]??m:m;f in c||(c[f]=h)}return c}if(Array.isArray(n)&&i.isListSchema()){let o=i.getValueSchema(),a=[];for(let c of n)a.push(this._read(o,c));return a}if(i.isMapSchema()){let o=i.getValueSchema(),a={};for(let c in n)c==="__proto__"&&_0(a),a[c]=this._read(o,n[c]);return a}}if(i.isBlobSchema()&&typeof n=="string")return gu(n);let s=i.getMergedTraits().mediaType;if(i.isStringSchema()&&typeof n=="string"&&s)return s==="application/json"||s.endsWith("+json")?xd.from(n):n;if(i.isTimestampSchema()&&n!=null)switch(Pp(i,this.settings)){case 5:return oW(n);case 6:return w1(n);case 7:return aW(n);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",n),new Date(n)}if(i.isBigIntegerSchema()&&(typeof n=="number"||typeof n=="string"))return BigInt(n);if(i.isBigDecimalSchema()&&n!=null){if(n instanceof co)return n;let o=n;return o.type==="bigDecimal"&&"string"in o?new co(o.string,o.type):new co(String(n),"bigDecimal")}if(i.isNumericSchema()&&typeof n=="string"){switch(n){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return n}if(i.isDocumentSchema())if(r){let o=Array.isArray(n)?[]:{};for(let a in n){a==="__proto__"&&_0(o);let c=n[a];c instanceof co?o[a]=c:o[a]=this._read(i,c)}return o}else return structuredClone(n);return n}}});var A$t,cfe,y$t=v(()=>{p();Mi();A$t="\u039D",cfe=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,n)=>{if(n instanceof co){let r=`${A$t+"nv"+this.counter++}_`+n.string;return this.values.set(`"${r}"`,n.string),r}if(typeof n=="bigint"){let r=n.toString(),i=`${A$t+"b"+this.counter++}_`+r;return this.values.set(`"${i}"`,r),i}return n}}replaceInJson(e){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(let[n,r]of this.values)e=e.replace(n,r);return e}}});var rH,UHe=v(()=>{p();ti();bo();Mi();Y_();y$t();O7();rH=class extends yu{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,n){this.rootSchema=jn.of(e),this.buffer=this._write(this.rootSchema,n)}flush(){let{rootSchema:e,useReplacer:n}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!n)return JSON.stringify(this.buffer);let r=new cfe;return r.replaceInJson(JSON.stringify(this.buffer,r.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(e,n){this.write(e,n),typeof this.buffer=="object"&&(this.buffer.__type=jn.of(e).getName(!0))}_write(e,n,r){let i=n!==null&&typeof n=="object",s=jn.of(e);if(i){if(s.isStructSchema()){let o=n,a={},{jsonName:c}=this.settings,u;c&&(u={});let l=0;for(let[d,m]of s.structIterator()){let h=this._write(m,o[d],s);if(h!==void 0){let f=d;c&&(f=m.getMergedTraits().jsonName??d,u[d]=f),a[f]=h,l++}}if(s.isUnionSchema()&&l===0){let{$unknown:d}=o;if(Array.isArray(d)){let[m,h]=d;m==="__proto__"&&_0(a),a[m]=this._write(15,h)}}else if(typeof o.__type=="string")for(let d in o){let m=o[d],h=c?u[d]??d:d;h in a||(a[h]=this._write(15,m))}return a}if(Array.isArray(n)&&s.isListSchema()){let o=s.getValueSchema(),a=[],c=!!s.getMergedTraits().sparse;for(let u of n)(c||u!=null)&&a.push(this._write(o,u));return a}if(s.isMapSchema()){let o=s.getValueSchema(),a={},c=!!s.getMergedTraits().sparse;for(let u in n){let l=n[u];(c||l!=null)&&(u==="__proto__"&&_0(a),a[u]=this._write(o,l))}return a}if(n instanceof Uint8Array&&s.isBlobSchema())return s===this.rootSchema?n:(this.serdeContext?.base64Encoder??vc)(n);if(n instanceof Date&&(s.isTimestampSchema()||s.isDocumentSchema()))switch(Pp(s,this.settings)){case 5:return n.toISOString().replace(".000Z","Z");case 6:return py(n);case 7:return n.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",n),n.getTime()/1e3}n instanceof co&&(this.useReplacer=!0)}if(!(n===null&&r?.isStructSchema())){if(s.isStringSchema()){if(typeof n>"u"&&s.isIdempotencyToken())return yy();let o=s.getMergedTraits().mediaType;return n!=null&&o&&(o==="application/json"||o.endsWith("+json"))?xd.from(n):n}if(typeof n=="number")return Math.abs(n)===1/0||isNaN(n)?String(n):n;if(typeof n=="string"&&s.isBlobSchema())return s===this.rootSchema?n:(this.serdeContext?.base64Encoder??vc)(n);if(typeof n=="bigint"&&(this.useReplacer=!0),s.isDocumentSchema())if(i){if(n instanceof Uint8Array)return(this.serdeContext?.base64Encoder??vc)(n);let o=Array.isArray(n)?[]:{};for(let a in n){let c=n[a];a==="__proto__"&&_0(o),c instanceof co?(this.useReplacer=!0,o[a]=c):o[a]=this._write(s,c)}return o}else return structuredClone(n);return n}}}});var lfe,E$t=v(()=>{p();Y_();QHe();UHe();lfe=class extends yu{settings;constructor(e){super(),this.settings=e}createSerializer(){let e=new rH(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new nH(this.settings);return e.setSerdeContext(this.serdeContext),e}}});var pfe=re(dfe=>{p();var GLr=/[&<>"]/g,$Lr={"&":"&","<":"<",">":">",'"':"""};function WLr(t){return t.replace(GLr,e=>$Lr[e])}var HLr=/[&"'<>\r\n\u0085\u2028]/g,qLr={"&":"&",'"':""","'":"'","<":"<",">":">","\r":" ","\n":" ","\x85":"…","\u2028":"
"};function jLr(t){return t.replace(HLr,e=>qLr[e])}var ufe=class{value;constructor(e){this.value=e}toString(){return jLr(""+this.value)}},$He=class t{name;children;attributes={};static of(e,n,r){let i=new t(e);return n!==void 0&&i.addChildNode(new ufe(n)),r!==void 0&&i.withName(r),i}constructor(e,n=[]){this.name=e,this.children=n}withName(e){return this.name=e,this}addAttribute(e,n){return this.attributes[e]=n,this}addChildNode(e){return this.children.push(e),this}removeAttribute(e){return delete this.attributes[e],this}n(e){return this.name=e,this}c(e){return this.children.push(e),this}a(e,n){return n!=null&&(this.attributes[e]=n),this}cc(e,n,r=n){if(e[n]!=null){let i=t.of(n,e[n]).withName(r);this.c(i)}}l(e,n,r,i){e[n]!=null&&i().map(o=>{o.withName(r),this.c(o)})}lc(e,n,r,i){if(e[n]!=null){let s=i(),o=new t(r);s.map(a=>{o.c(a)}),this.c(o)}}toString(){let e=!!this.children.length,n=`<${this.name}`,r=this.attributes;for(let i of Object.keys(r)){let s=r[i];s!=null&&(n+=` ${i}="${WLr(""+s)}"`)}return n+=e?`>${this.children.map(i=>i.toString()).join("")}`:"/>"}};function GHe(t){Object.defineProperty(t,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}function VLr(t){return new WHe(t).parse()}var WHe=class t{x;i=0;z;constructor(e){this.x=e,this.x=e.replace(/\r\n?/g,` +`),this.z=this.x.length}parse(){let e=this,{z:n}=e;for(;e.i=n));)if(e.isNext(""),e.trim();else if(e.isNext(""),e.trim();else if(e.isNext("/`.includes(e.x[e.i]);)n+=e.x[e.i++];let r=!1,s={};for(;e.i/".includes(e.x[e.i]));){let l="";for(;e.i/?`.includes(e.x[e.i]);)l+=e.x[e.i++];if(e.trim(),e.x[e.i]!=="=")break;++e.i,e.trim(),l==="__proto__"&&SLe(s),s[l]=e.readAttrValue(),r=!0}if(e.i>=e.z)throw new Error("@aws-sdk XML parse error: unexpected end of input.");if(e.x[e.i]==="/"){if(++e.i,e.i>=e.z||e.x[e.i]!==">")throw new Error("@aws-sdk XML parse error: expected > at the end of self-closing tag.");return++e.i,{tag:n,value:r?s:""}}if(e.x[e.i]!==">")throw new Error("@aws-sdk XML parse error: expected > at the end of opening tag.");++e.i;let i=[],o=[],a=!1;for(;e.i"):e.isNext(""))):e.isNext(""):(a=!0,o.push(e.parseTag()));else{let l="";for(;e.i.`);e.i+=2;let c=e.readTo(">").trim();if(c!==n)throw new Error(`@aws-sdk XML parse error: mismatched tags <${n}> and .`);if(!r&&i.length===0&&!a)return{tag:n,value:""};if(!r&&!a){let l=i.length===1?i[0]:i.join("");return l.trim()===""&&l.includes(` -`)?{tag:n,value:""}:{tag:n,value:l}}let u={};for(let l of i)l.trim()===""&&l.includes(` -`)||(u["#text"]="#text"in u?u["#text"]+l:l);for(let l of o)l.tag==="__proto__"&&SLe(u),l.tag in u?Array.isArray(u[l.tag])?u[l.tag].push(l.value):u[l.tag]=[u[l.tag],l.value]:u[l.tag]=l.value;for(let[l,d]of Object.entries(s))l==="__proto__"&&SLe(u),u[l]=d;return{tag:n,value:u}}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};skipDoctype(){let e=this;e.i+=9;let n=0;for(;e.i"&&n===0){++e.i;return}++e.i}throw new Error("@aws-sdk XML parse error: unclosed DOCTYPE.")}decodeEntities(e){return e.replace(/&(?:#x([0-9a-fA-F]{1,6})|#(\d{1,7})|([a-zA-Z][a-zA-Z0-9]{0,30}));/g,(n,r,s,i)=>r?String.fromCharCode(parseInt(r,16)):s?String.fromCharCode(parseInt(s,10)):t.ENTITIES[i]??"")}};Sle.XmlNode=CLe;Sle.XmlText=_le;Sle.parseXML=acr});var QRt,gR,Ile=V(()=>{p();QRt=Gt(Cle());Is();$r();Ki();js();i_();rle();M6();gR=class extends vl{settings;stringDeserializer;constructor(e){super(),this.settings=e,this.stringDeserializer=new Zv(e)}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e)}read(e,n,r){let s=qn.of(e),i=s.getMemberSchemas();if(s.isStructSchema()&&s.isMemberSchema()&&!!Object.values(i).find(u=>!!u.getMemberTraits().eventPayload)){let u={},l=Object.keys(i)[0];return i[l].isBlobSchema()?u[l]=n:u[l]=this.read(i[l],n),u}let a=(this.serdeContext?.utf8Encoder??Jc)(n),c=this.parseXml(a);return this.readSchema(e,r?c[r]:c)}readSchema(e,n){let r=qn.of(e);if(r.isUnitSchema())return;let s=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(n))return this.readSchema(r,[n]);if(n==null)return n;if(typeof n=="object"){let i=!!s.xmlFlattened;if(r.isListSchema()){let a=r.getValueSchema(),c=[],u=a.getMergedTraits().xmlName??"member",l=i?n:(n[0]??n)[u];if(l==null)return c;let d=Array.isArray(l)?l:[l];for(let h of d)c.push(this.readSchema(a,h));return c}let o={};if(r.isMapSchema()){let a=r.getKeySchema(),c=r.getValueSchema(),u;i?u=Array.isArray(n)?n:[n]:u=Array.isArray(n.entry)?n.entry:[n.entry];let l=a.getMergedTraits().xmlName??"key",d=c.getMergedTraits().xmlName??"value";for(let h of u){let m=h[l],f=h[d];m==="__proto__"&&zy(o),o[m]=this.readSchema(c,f)}return o}if(r.isStructSchema()){let a=r.isUnionSchema(),c;a&&(c=new hR(n,o));for(let[u,l]of r.structIterator()){let d=l.getMergedTraits(),h=d.httpPayload?d.xmlName??l.getName():l.getMemberTraits().xmlName??u;a&&c.mark(h),n[h]!=null&&(o[u]=this.readSchema(l,n[h]))}return a&&c.writeUnknown(),o}if(r.isDocumentSchema())return n;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(!0)}`)}return r.isListSchema()?[]:r.isMapSchema()||r.isStructSchema()?{}:this.stringDeserializer.read(r,n)}parseXml(e){if(e.length){let n;try{n=(0,QRt.parseXML)(e)}catch(o){throw o&&typeof o=="object"&&Object.defineProperty(o,"$responseBodyText",{value:e}),o}let r="#text",s=Object.keys(n)[0],i=n[s];return i[r]&&(i[s]=i[r],delete i[r]),iB(i)}return{}}}});var M2,xLe=V(()=>{p();$r();Ki();js();js();i_();M2=class extends vl{settings;buffer;constructor(e){super(),this.settings=e}write(e,n,r=""){this.buffer===void 0&&(this.buffer="");let s=qn.of(e);if(r&&!r.endsWith(".")&&(r+="."),s.isBlobSchema())(typeof n=="string"||n instanceof Uint8Array)&&(this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??ja)(n)));else if(s.isBooleanSchema()||s.isNumericSchema()||s.isStringSchema())n!=null?(this.writeKey(r),this.writeValue(String(n))):s.isIdempotencyToken()&&(this.writeKey(r),this.writeValue(zg()));else if(s.isBigIntegerSchema())n!=null&&(this.writeKey(r),this.writeValue(String(n)));else if(s.isBigDecimalSchema())n!=null&&(this.writeKey(r),this.writeValue(n instanceof zi?n.string:String(n)));else if(s.isTimestampSchema()){if(n instanceof Date)switch(this.writeKey(r),Fd(s,this.settings)){case 5:this.writeValue(n.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(Hg(n));break;case 7:this.writeValue(String(n.getTime()/1e3));break}}else if(s.isDocumentSchema())Array.isArray(n)?this.write(79,n,r):n instanceof Date?this.write(4,n,r):n instanceof Uint8Array?this.write(21,n,r):n&&typeof n=="object"?this.write(143,n,r):(this.writeKey(r),this.writeValue(String(n)));else if(s.isListSchema()){if(Array.isArray(n))if(n.length===0)this.settings.serializeEmptyLists&&(this.writeKey(r),this.writeValue(""));else{let i=s.getValueSchema(),o=this.settings.flattenLists||s.getMergedTraits().xmlFlattened,a=1;for(let c of n){if(c==null)continue;let u=i.getMergedTraits(),l=this.getKey("member",u.xmlName,u.ec2QueryName),d=o?`${r}${a}`:`${r}${l}.${a}`;this.write(i,c,d),++a}}}else if(s.isMapSchema()){if(n&&typeof n=="object"){let i=s.getKeySchema(),o=s.getValueSchema(),a=s.getMergedTraits().xmlFlattened,c=1;for(let u in n){let l=n[u];if(l==null)continue;let d=i.getMergedTraits(),h=this.getKey("key",d.xmlName,d.ec2QueryName),m=a?`${r}${c}.${h}`:`${r}entry.${c}.${h}`,f=o.getMergedTraits(),g=this.getKey("value",f.xmlName,f.ec2QueryName),A=a?`${r}${c}.${g}`:`${r}entry.${c}.${g}`;this.write(i,u,m),this.write(o,l,A),++c}}}else if(s.isStructSchema()){if(n&&typeof n=="object"){let i=!1;for(let[o,a]of s.structIterator()){if(n[o]==null&&!a.isIdempotencyToken())continue;let c=a.getMergedTraits(),u=this.getKey(o,c.xmlName,c.ec2QueryName,"struct"),l=`${r}${u}`;this.write(a,n[o],l),i=!0}if(!i&&s.isUnionSchema()){let{$unknown:o}=n;if(Array.isArray(o)){let[a,c]=o,u=`${r}${a}`;this.write(15,c,u)}}}}else if(!s.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${s.getName(!0)}`)}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");let e=this.buffer;return delete this.buffer,e}getKey(e,n,r,s){let{ec2:i,capitalizeKeys:o}=this.settings;if(i&&r)return r;let a=n??e;return o&&s==="struct"?a[0].toUpperCase()+a.slice(1):a}writeKey(e){e.endsWith(".")&&(e=e.slice(0,e.length-1)),this.buffer+=`&${zb(e)}=`}writeValue(e){this.buffer+=zb(e)}}});var AR,wLe=V(()=>{p();$r();Ki();T2();Ile();xLe();AR=class extends vS{options;serializer;deserializer;mixin=new Ky;constructor(e){super({defaultNamespace:e.defaultNamespace,errorTypeRegistries:e.errorTypeRegistries}),this.options=e;let n={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:!0};this.serializer=new M2(n),this.deserializer=new gR(n)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(e,n,r){let s=await super.serializeRequest(e,n,r);s.path.endsWith("/")||(s.path+="/"),s.headers["content-type"]="application/x-www-form-urlencoded",(Qy(e.input)==="unit"||!s.body)&&(s.body="");let i=e.name.split("#")[1]??e.name;return s.body=`Action=${i}&Version=${this.options.version}`+s.body,s.body.endsWith("&")&&(s.body=s.body.slice(-1)),s}async deserializeResponse(e,n,r){let s=this.deserializer,i=qn.of(e.output),o={};if(r.statusCode>=300){let l=await wp(r.body,n);l.byteLength>0&&Object.assign(o,await s.read(15,l)),await this.handleError(e,n,r,o,this.deserializeMetadata(r))}for(let l in r.headers){let d=r.headers[l];delete r.headers[l],r.headers[l.toLowerCase()]=d}let a=e.name.split("#")[1]??e.name,c=i.isStructSchema()&&this.useNestedResult()?a+"Result":void 0,u=await wp(r.body,n);return u.byteLength>0&&Object.assign(o,await s.read(i,u,c)),o.$metadata=this.deserializeMetadata(r),o}useNestedResult(){return!0}async handleError(e,n,r,s,i){let o=this.loadQueryErrorCode(r,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);let a=this.loadQueryError(s)??{},c=this.loadQueryErrorMessage(s);a.message=c,a.Error={Type:a.Type,Code:a.Code,Message:c};let{errorSchema:u,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,a,i,this.mixin.findQueryCompatibleError),d=qn.of(u),h=this.compositeErrorRegistry.getErrorCtor(u)??Error,m=new h({}),f={Type:a.Error.Type,Code:a.Error.Code,Error:a.Error};for(let[g,A]of d.structIterator()){let y=A.getMergedTraits().xmlName??g,b=a[y]??s[y];f[g]=this.deserializer.readSchema(A,b)}throw this.mixin.decorateServiceException(Object.assign(m,l,{$fault:d.getMergedTraits().error,message:c},f),s)}loadQueryErrorCode(e,n){let r=(n.Errors?.[0]?.Error??n.Errors?.Error??n.Error)?.Code;if(r!==void 0)return r;if(e.statusCode==404)return"NotFound"}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){let n=this.loadQueryError(e);return n?.message??n?.Message??e.message??e.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}});var xle,URt=V(()=>{p();wLe();xle=class extends AR{options;constructor(e){super(e),this.options=e;let n={capitalizeKeys:!0,flattenLists:!0,serializeEmptyLists:!1,ec2:!0};Object.assign(this.serializer.settings,n)}getShapeId(){return"aws.protocols#ec2Query"}useNestedResult(){return!1}}});var $Rt,TLe,GRt,wle,vLe=V(()=>{p();$Rt=Gt(Cle());Is();fLe();TLe=(t,e)=>cle(t,e).then(n=>{if(n.length){let r;try{r=(0,$Rt.parseXML)(n)}catch(a){throw a&&typeof a=="object"&&Object.defineProperty(a,"$responseBodyText",{value:n}),a}let s="#text",i=Object.keys(r)[0],o=r[i];return o[s]&&(o[i]=o[s],delete o[s]),iB(o)}return{}}),GRt=async(t,e)=>{let n=await TLe(t,e);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n},wle=(t,e)=>{if(e?.Error?.Code!==void 0)return e.Error.Code;if(e?.Code!==void 0)return e.Code;if(t.statusCode==404)return"NotFound"}});var fm,L2,RLe=V(()=>{p();fm=Gt(Cle());$r();Ki();js();js();i_();L2=class extends vl{settings;stringBuffer;byteBuffer;buffer;constructor(e){super(),this.settings=e}write(e,n){let r=qn.of(e);if(r.isStringSchema()&&typeof n=="string")this.stringBuffer=n;else if(r.isBlobSchema())this.byteBuffer="byteLength"in n?n:(this.serdeContext?.base64Decoder??wl)(n);else{this.buffer=this.writeStruct(r,n,void 0);let s=r.getMergedTraits();s.httpPayload&&!s.xmlName&&this.buffer.withName(r.getName())}}flush(){if(this.byteBuffer!==void 0){let n=this.byteBuffer;return delete this.byteBuffer,n}if(this.stringBuffer!==void 0){let n=this.stringBuffer;return delete this.stringBuffer,n}let e=this.buffer;return this.settings.xmlNamespace&&(e?.attributes?.xmlns||e.addAttribute("xmlns",this.settings.xmlNamespace)),delete this.buffer,e.toString()}writeStruct(e,n,r){let s=e.getMergedTraits(),i=e.isMemberSchema()&&!s.httpPayload?e.getMemberTraits().xmlName??e.getMemberName():s.xmlName??e.getName();if(!i||!e.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${e.getName(!0)}.`);let o=fm.XmlNode.of(i),[a,c]=this.getXmlnsAttribute(e,r);for(let[l,d]of e.structIterator()){let h=n[l];if(h!=null||d.isIdempotencyToken()){if(d.getMergedTraits().xmlAttribute){o.addAttribute(d.getMergedTraits().xmlName??l,this.writeSimple(d,h));continue}if(d.isListSchema())this.writeList(d,h,o,c);else if(d.isMapSchema())this.writeMap(d,h,o,c);else if(d.isStructSchema())o.addChildNode(this.writeStruct(d,h,c));else{let m=fm.XmlNode.of(d.getMergedTraits().xmlName??d.getMemberName());this.writeSimpleInto(d,h,m,c),o.addChildNode(m)}}}let{$unknown:u}=n;if(u&&e.isUnionSchema()&&Array.isArray(u)&&Object.keys(n).length===1){let[l,d]=u,h=fm.XmlNode.of(l);if(typeof d!="string")if(n instanceof fm.XmlNode||n instanceof fm.XmlText)o.addChildNode(n);else throw new Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,d,h,c),o.addChildNode(h)}return c&&o.addAttribute(a,c),o}writeList(e,n,r,s){if(!e.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${e.getName(!0)}`);let i=e.getMergedTraits(),o=e.getValueSchema(),a=o.getMergedTraits(),c=!!a.sparse,u=!!i.xmlFlattened,[l,d]=this.getXmlnsAttribute(e,s),h=(m,f)=>{if(o.isListSchema())this.writeList(o,Array.isArray(f)?f:[f],m,d);else if(o.isMapSchema())this.writeMap(o,f,m,d);else if(o.isStructSchema()){let g=this.writeStruct(o,f,d);m.addChildNode(g.withName(u?i.xmlName??e.getMemberName():a.xmlName??"member"))}else{let g=fm.XmlNode.of(u?i.xmlName??e.getMemberName():a.xmlName??"member");this.writeSimpleInto(o,f,g,d),m.addChildNode(g)}};if(u)for(let m of n)(c||m!=null)&&h(r,m);else{let m=fm.XmlNode.of(i.xmlName??e.getMemberName());d&&m.addAttribute(l,d);for(let f of n)(c||f!=null)&&h(m,f);r.addChildNode(m)}}writeMap(e,n,r,s,i=!1){if(!e.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${e.getName(!0)}`);let o=e.getMergedTraits(),a=e.getKeySchema(),u=a.getMergedTraits().xmlName??"key",l=e.getValueSchema(),d=l.getMergedTraits(),h=d.xmlName??"value",m=!!d.sparse,f=!!o.xmlFlattened,[g,A]=this.getXmlnsAttribute(e,s),y=(b,S,C)=>{let I=fm.XmlNode.of(u,S),[x,w]=this.getXmlnsAttribute(a,A);w&&I.addAttribute(x,w),b.addChildNode(I);let R=fm.XmlNode.of(h);l.isListSchema()?this.writeList(l,C,R,A):l.isMapSchema()?this.writeMap(l,C,R,A,!0):l.isStructSchema()?R=this.writeStruct(l,C,A):this.writeSimpleInto(l,C,R,A),b.addChildNode(R)};if(f)for(let b in n){let S=n[b];if(m||S!=null){let C=fm.XmlNode.of(o.xmlName??e.getMemberName());y(C,b,S),r.addChildNode(C)}}else{let b;i||(b=fm.XmlNode.of(o.xmlName??e.getMemberName()),A&&b.addAttribute(g,A),r.addChildNode(b));for(let S in n){let C=n[S];if(m||C!=null){let I=fm.XmlNode.of("entry");y(I,S,C),(i?r:b).addChildNode(I)}}}}writeSimple(e,n){if(n===null)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");let r=qn.of(e),s=null;if(n&&typeof n=="object")if(r.isBlobSchema())s=(this.serdeContext?.base64Encoder??ja)(n);else if(r.isTimestampSchema()&&n instanceof Date)switch(Fd(r,this.settings)){case 5:s=n.toISOString().replace(".000Z","Z");break;case 6:s=Hg(n);break;case 7:s=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",n),s=Hg(n);break}else{if(r.isBigDecimalSchema()&&n)return n instanceof zi?n.string:String(n);throw r.isMapSchema()||r.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${r.getName(!0)}`)}if((r.isBooleanSchema()||r.isNumericSchema()||r.isBigIntegerSchema()||r.isBigDecimalSchema())&&(s=String(n)),r.isStringSchema()&&(n===void 0&&r.isIdempotencyToken()?s=zg():s=String(n)),s===null)throw new Error(`Unhandled schema-value pair ${r.getName(!0)}=${n}`);return s}writeSimpleInto(e,n,r,s){let i=this.writeSimple(e,n),o=qn.of(e),a=new fm.XmlText(i),[c,u]=this.getXmlnsAttribute(o,s);u&&r.addAttribute(c,u),r.addChildNode(a)}getXmlnsAttribute(e,n){let r=e.getMergedTraits(),[s,i]=r.xmlNamespace??[];return i&&i!==n?[s?`xmlns:${s}`:"xmlns",i]:[void 0,void 0]}}});var F2,kLe=V(()=>{p();i_();Ile();RLe();F2=class extends vl{settings;constructor(e){super(),this.settings=e}createSerializer(){let e=new L2(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new gR(this.settings);return e.setSerdeContext(this.serdeContext),e}}});var Tle,WRt=V(()=>{p();$r();Ki();T2();vLe();kLe();Tle=class extends Xv{codec;serializer;deserializer;mixin=new Ky;constructor(e){super(e);let n={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace};this.codec=new F2(n),this.serializer=new tR(this.codec.createSerializer(),n),this.deserializer=new eR(this.codec.createDeserializer(),n)}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(e,n,r){let s=await super.serializeRequest(e,n,r),i=qn.of(e.input);if(!s.headers["content-type"]){let o=this.mixin.resolveRestContentType(this.getDefaultContentType(),i);o&&(s.headers["content-type"]=o)}return typeof s.body=="string"&&s.headers["content-type"]===this.getDefaultContentType()&&!s.body.startsWith("'+s.body),s}async deserializeResponse(e,n,r){return super.deserializeResponse(e,n,r)}async handleError(e,n,r,s,i){let o=wle(r,s)??"Unknown";if(this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace),s.Error&&typeof s.Error=="object")for(let g of Object.keys(s.Error))s[g]=s.Error[g],g.toLowerCase()==="message"&&(s.message=s.Error[g]);s.RequestId&&!i.requestId&&(i.requestId=s.RequestId);let{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,s,i),u=qn.of(a),l=s.Error?.message??s.Error?.Message??s.message??s.Message??"UnknownError",d=this.compositeErrorRegistry.getErrorCtor(a)??Error,h=new d({});await this.deserializeHttpMessage(a,n,r,s);let m={},f=this.codec.createDeserializer();for(let[g,A]of u.structIterator()){let y=A.getMergedTraits().xmlName??g,b=s.Error?.[y]??s[y];m[g]=f.readSchema(A,b)}throw this.mixin.decorateServiceException(Object.assign(h,c,{$fault:u.getMergedTraits().error,message:l},m),s)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(e){for(let[,n]of e.structIterator())if(n.getMergedTraits().httpPayload)return!(n.isStructSchema()||n.isMapSchema()||n.isListSchema());return!1}}});var qRt,HRt=V(()=>{p();js();qRt=t=>{if(t!=null)return typeof t=="object"&&"__type"in t&&delete t.__type,Noe(t)}});var VRt,jRt,YRt,KRt=V(()=>{p();VRt=t=>{if(t==null)return t;if(typeof t=="number"||typeof t=="bigint"){let e=new Error(`Received number ${t} where a string was expected.`);return e.name="Warning",console.warn(e),String(t)}if(typeof t=="boolean"){let e=new Error(`Received boolean ${t} where a string was expected.`);return e.name="Warning",console.warn(e),String(t)}return t},jRt=t=>{if(t==null)return t;if(typeof t=="string"){let e=t.toLowerCase();if(t!==""&&e!=="false"&&e!=="true"){let n=new Error(`Received string "${t}" where a boolean was expected.`);n.name="Warning",console.warn(n)}return t!==""&&e!=="false"}return t},YRt=t=>{if(t==null)return t;if(typeof t=="string"){let e=Number(t);if(e.toString()!==t){let n=new Error(`Received string "${t}" where a number was expected.`);return n.name="Warning",console.warn(n),t}return e}return t}});var zRt={};Ir(zRt,{AwsEc2QueryProtocol:()=>xle,AwsJson1_0Protocol:()=>Ale,AwsJson1_1Protocol:()=>yle,AwsJsonRpcProtocol:()=>fR,AwsQueryProtocol:()=>AR,AwsRestJsonProtocol:()=>jS,AwsRestXmlProtocol:()=>Tle,AwsSmithyRpcV2CborProtocol:()=>nle,JsonCodec:()=>ble,JsonCodec2:()=>mR,JsonShapeDeserializer:()=>P2,JsonShapeDeserializer2:()=>N2,JsonShapeSerializer:()=>O2,JsonShapeSerializer2:()=>B2,QueryShapeSerializer:()=>M2,XmlCodec:()=>F2,XmlShapeDeserializer:()=>gR,XmlShapeSerializer:()=>L2,_toBool:()=>jRt,_toNum:()=>YRt,_toStr:()=>VRt,awsExpectUnion:()=>qRt,loadJsonRpcErrorCode:()=>ule,loadRestJsonErrorCode:()=>lle,loadRestXmlErrorCode:()=>wle,parseJsonBody:()=>CB,parseJsonErrorBody:()=>xRt,parseXmlBody:()=>TLe,parseXmlErrorBody:()=>GRt});var Q2=V(()=>{p();CRt();BRt();PRt();gle();ORt();FRt();bLe();_Le();fle();ALe();ELe();k2();URt();wLe();xLe();WRt();kLe();Ile();RLe();vLe();HRt();KRt()});var L6,IB,vle,JRt,tkt,Rle,NLe,XRt,DLe,U2,ZRt,ekt,ccr,Tf,lcr,nkt,rkt=V(()=>{p();Ta();L6="ref",IB=-1,vle=!0,JRt="isSet",tkt="PartitionResult",Rle="booleanEquals",NLe="getAttr",XRt={[L6]:"Endpoint"},DLe={[L6]:tkt},U2={},ZRt=[{[L6]:"Region"}],ekt={conditions:[[JRt,[XRt]],[JRt,ZRt],["aws.partition",ZRt,tkt],[Rle,[{[L6]:"UseFIPS"},vle]],[Rle,[{[L6]:"UseDualStack"},vle]],[Rle,[{fn:NLe,argv:[DLe,"supportsDualStack"]},vle]],[Rle,[{fn:NLe,argv:[DLe,"supportsFIPS"]},vle]],["stringEquals",[{fn:NLe,argv:[DLe,"name"]},"aws-us-gov"]]],results:[[IB],[IB,"Invalid Configuration: FIPS and custom endpoint are not supported"],[IB,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[XRt,U2],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",U2],[IB,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",U2],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",U2],[IB,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",U2],[IB,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",U2],[IB,"Invalid Configuration: Missing Region"]]},ccr=2,Tf=1e8,lcr=new Int32Array([-1,1,-1,0,13,3,1,4,Tf+12,2,5,Tf+12,3,8,6,4,7,Tf+11,5,Tf+9,Tf+10,4,11,9,6,10,Tf+8,7,Tf+6,Tf+7,5,12,Tf+5,6,Tf+4,Tf+5,3,Tf+1,14,4,Tf+2,Tf+3]),nkt=Gy.from(lcr,ccr,ekt.conditions,ekt.results)});var ucr,skt,ikt=V(()=>{p();Go();Ta();rkt();ucr=new Wy({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),skt=(t,e={})=>ucr.get(t,()=>wS(nkt,{endpointParams:t,logger:e.logger}));wf.aws=n_});var qd,kle=V(()=>{p();Is();qd=class t extends Uy{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var F6,Q6,U6,$6,G6,W6,q6,H6,V6,j6,Y6,BLe=V(()=>{p();kle();F6=class t extends qd{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}},Q6=class t extends qd{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},U6=class t extends qd{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},$6=class t extends qd{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},G6=class t extends qd{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},W6=class t extends qd{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},q6=class t extends qd{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}},H6=class t extends qd{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},V6=class t extends qd{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},j6=class t extends qd{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},Y6=class t extends qd{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}}});var dcr,pcr,hcr,mcr,fcr,gcr,Acr,ycr,Ecr,bcr,_cr,Scr,Ccr,Icr,xcr,wcr,Tcr,vcr,Rcr,kcr,YS,Ncr,Dcr,Bcr,Pcr,Ocr,Rl,Mcr,o_,Lcr,Fcr,a_,Qcr,okt,akt,Ucr,ckt,$cr,Gcr,Wcr,ku,lkt,ukt,Jy,dkt,pkt,hkt,mkt,fkt,gkt,Akt,ykt,Ekt,bkt,_kt,PLe,qcr,Hcr,Vcr,jcr,Skt,Ckt,Ikt,OLe,Nle=V(()=>{p();Ki();BLe();kle();dcr="AccessDeniedException",pcr="AuthorizationPendingException",hcr="AccessToken",mcr="ClientSecret",fcr="CreateToken",gcr="CreateTokenRequest",Acr="CreateTokenResponse",ycr="CodeVerifier",Ecr="ExpiredTokenException",bcr="InvalidClientException",_cr="InvalidGrantException",Scr="InvalidRequestException",Ccr="InternalServerException",Icr="InvalidScopeException",xcr="IdToken",wcr="RefreshToken",Tcr="SlowDownException",vcr="UnauthorizedClientException",Rcr="UnsupportedGrantTypeException",kcr="accessToken",YS="client",Ncr="clientId",Dcr="clientSecret",Bcr="codeVerifier",Pcr="code",Ocr="deviceCode",Rl="error",Mcr="expiresIn",o_="error_description",Lcr="grantType",Fcr="http",a_="httpError",Qcr="idToken",okt="reason",akt="refreshToken",Ucr="redirectUri",ckt="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",$cr="scope",Gcr="server",Wcr="tokenType",ku="com.amazonaws.ssooidc",lkt=Va.for(ckt),ukt=[-3,ckt,"SSOOIDCServiceException",0,[],[]];lkt.registerError(ukt,qd);Jy=Va.for(ku),dkt=[-3,ku,dcr,{[Rl]:YS,[a_]:400},[Rl,okt,o_],[0,0,0]];Jy.registerError(dkt,F6);pkt=[-3,ku,pcr,{[Rl]:YS,[a_]:400},[Rl,o_],[0,0]];Jy.registerError(pkt,Q6);hkt=[-3,ku,Ecr,{[Rl]:YS,[a_]:400},[Rl,o_],[0,0]];Jy.registerError(hkt,U6);mkt=[-3,ku,Ccr,{[Rl]:Gcr,[a_]:500},[Rl,o_],[0,0]];Jy.registerError(mkt,$6);fkt=[-3,ku,bcr,{[Rl]:YS,[a_]:401},[Rl,o_],[0,0]];Jy.registerError(fkt,G6);gkt=[-3,ku,_cr,{[Rl]:YS,[a_]:400},[Rl,o_],[0,0]];Jy.registerError(gkt,W6);Akt=[-3,ku,Scr,{[Rl]:YS,[a_]:400},[Rl,okt,o_],[0,0,0]];Jy.registerError(Akt,q6);ykt=[-3,ku,Icr,{[Rl]:YS,[a_]:400},[Rl,o_],[0,0]];Jy.registerError(ykt,H6);Ekt=[-3,ku,Tcr,{[Rl]:YS,[a_]:400},[Rl,o_],[0,0]];Jy.registerError(Ekt,V6);bkt=[-3,ku,vcr,{[Rl]:YS,[a_]:400},[Rl,o_],[0,0]];Jy.registerError(bkt,j6);_kt=[-3,ku,Rcr,{[Rl]:YS,[a_]:400},[Rl,o_],[0,0]];Jy.registerError(_kt,Y6);PLe=[lkt,Jy],qcr=[0,ku,hcr,8,0],Hcr=[0,ku,mcr,8,0],Vcr=[0,ku,ycr,8,0],jcr=[0,ku,xcr,8,0],Skt=[0,ku,wcr,8,0],Ckt=[3,ku,gcr,0,[Ncr,Dcr,Lcr,Ocr,Pcr,akt,$cr,Ucr,Bcr],[0,[()=>Hcr,0],0,0,0,[()=>Skt,0],64,0,[()=>Vcr,0]],3],Ikt=[3,ku,Acr,0,[kcr,Wcr,Mcr,akt,Qcr],[[()=>qcr,0],0,1,[()=>Skt,0],[()=>jcr,0]]],OLe=[9,ku,fcr,{[Fcr]:["POST","/token",200]},()=>Ckt,()=>Ikt]});var xkt,wkt=V(()=>{p();$d();Q2();vp();pB();Is();$r();js();VMe();ikt();Nle();xkt=t=>({apiVersion:"2019-06-10",base64Decoder:t?.base64Decoder??wl,base64Encoder:t?.base64Encoder??ja,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??skt,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??eRt,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Ud},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ah}],logger:t?.logger??new If,protocol:t?.protocol??jS,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:PLe,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:t?.serviceId??"SSO OIDC",sha256:t?.sha256??TS,urlParser:t?.urlParser??Ip,utf8Decoder:t?.utf8Decoder??od,utf8Encoder:t?.utf8Encoder??Jc})});var Dle,Tkt,vkt=V(()=>{p();R6();Go();$d();Is();Jo();Jg();js();Dle=Gt(EB());wkt();Tkt=t=>{fS(process.version);let e=IS(t),n=()=>e().then(mS),r=xkt(t);uS(process.version);let s={profile:t?.profile,logger:r.logger};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??ei(r_,s),bodyLengthChecker:t?.bodyLengthChecker??ES,defaultUserAgentProvider:t?.defaultUserAgentProvider??t_({serviceId:r.serviceId,clientVersion:dR.version}),maxAttempts:t?.maxAttempts??ei(BS,t),region:t?.region??ei(xp,{...mm,...s}),requestHandler:Dle.NodeHttpHandler.create(t?.requestHandler??n),retryMode:t?.retryMode??ei({...OS,default:async()=>(await n()).retryMode||Hy},t),streamCollector:t?.streamCollector??Dle.streamCollector,useDualstackEndpoint:t?.useDualstackEndpoint??ei(SS,s),useFipsEndpoint:t?.useFipsEndpoint??ei(CS,s),userAgentAppId:t?.userAgentAppId??ei($S,s)}}});var Rkt,kkt,Nkt=V(()=>{p();Rkt=t=>{let e=t.httpAuthSchemes,n=t.httpAuthSchemeProvider,r=t.credentials;return{setHttpAuthScheme(s){let i=e.findIndex(o=>o.schemeId===s.schemeId);i===-1?e.push(s):e.splice(i,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){r=s},credentials(){return r}}},kkt=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()})});var Dkt,Bkt=V(()=>{p();Go();Is();$r();Nkt();Dkt=(t,e)=>{let n=Object.assign(GS(t),jb(t),RS(t),Rkt(t));return e.forEach(r=>r.configure(n)),Object.assign(t,WS(n),gS(n),kS(n),kkt(n))}});var K6,MLe=V(()=>{p();Go();vp();Is();Jo();Ta();$r();Jg();Ki();VMe();jMe();vkt();Bkt();K6=class extends fh{config;constructor(...[e]){let n=Tkt(e||{});super(n),this.initConfig=n;let r=nRt(n),s=QS(r),i=PS(s),o=jg(i),a=o,c=Sx(a),u=tRt(c),l=Dkt(u,e?.extensions||[]);this.config=l,this.middlewareStack.use(pS(this.config)),this.middlewareStack.use(US(this.config)),this.middlewareStack.use(wx(this.config)),this.middlewareStack.use(NS(this.config)),this.middlewareStack.use(MS(this.config)),this.middlewareStack.use(LS(this.config)),this.middlewareStack.use(FS(this.config)),this.middlewareStack.use(Zb(this.config,{httpAuthSchemeParametersProvider:Zvt,identityProviderConfigProvider:async d=>new Xg({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use(e_(this.config))}destroy(){super.destroy()}}});var Pkt,Okt,Mkt,Lkt=V(()=>{p();Is();Ta();jMe();Pkt=AS(rRt,"AWSSSOOIDCService","SSOOIDCClient",Cx),Okt={},Mkt=(t,e,n,r)=>[]});var z6,LLe=V(()=>{p();Lkt();Nle();z6=class extends Pkt(Okt,Mkt,"CreateToken",OLe){}});var Ycr,Ble,Fkt=V(()=>{p();Is();LLe();MLe();Ycr={CreateTokenCommand:z6},Ble=class extends K6{};hS(Ycr,Ble)});var Qkt=V(()=>{p();LLe()});var Kcr,zcr,Ukt=V(()=>{p();Kcr={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},zcr={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"}});var $kt=V(()=>{p()});var J6={};Ir(J6,{$Command:()=>hm,AccessDeniedException:()=>F6,AccessDeniedException$:()=>dkt,AccessDeniedExceptionReason:()=>Kcr,AuthorizationPendingException:()=>Q6,AuthorizationPendingException$:()=>pkt,CreateToken$:()=>OLe,CreateTokenCommand:()=>z6,CreateTokenRequest$:()=>Ckt,CreateTokenResponse$:()=>Ikt,ExpiredTokenException:()=>U6,ExpiredTokenException$:()=>hkt,InternalServerException:()=>$6,InternalServerException$:()=>mkt,InvalidClientException:()=>G6,InvalidClientException$:()=>fkt,InvalidGrantException:()=>W6,InvalidGrantException$:()=>gkt,InvalidRequestException:()=>q6,InvalidRequestException$:()=>Akt,InvalidRequestExceptionReason:()=>zcr,InvalidScopeException:()=>H6,InvalidScopeException$:()=>ykt,SSOOIDC:()=>Ble,SSOOIDCClient:()=>K6,SSOOIDCServiceException:()=>qd,SSOOIDCServiceException$:()=>ukt,SlowDownException:()=>V6,SlowDownException$:()=>Ekt,UnauthorizedClientException:()=>j6,UnauthorizedClientException$:()=>bkt,UnsupportedGrantTypeException:()=>Y6,UnsupportedGrantTypeException$:()=>_kt,__Client:()=>fh,errorTypeRegistries:()=>PLe});var X6=V(()=>{p();MLe();Fkt();Qkt();Is();Nle();Ukt();BLe();$kt();kle()});var Hkt=ee(Z6=>{p();var{setTokenFeature:Jcr}=(Go(),Un(Zg)),{getBearerTokenEnvKey:Xcr}=($d(),Un(y2)),{TokenProviderError:c_,getSSOTokenFilepath:Zcr,parseKnownFiles:elr,getProfileName:tlr,loadSsoSessionData:nlr,getSSOTokenFromFile:rlr,memoize:slr,chain:ilr}=(Jo(),Un(xf)),{promises:olr}=require("node:fs"),alr=({logger:t,signingName:e}={})=>async()=>{if(t?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"),!e)throw new c_("Please pass 'signingName' to compute environment variable key",{logger:t});let n=Xcr(e);if(!(n in process.env))throw new c_(`Token not present in '${n}' environment variable`,{logger:t});let r={token:process.env[n]};return Jcr(r,"BEARER_SERVICE_ENV_VARS","3"),r},clr=300*1e3,FLe="To refresh this SSO session run 'aws sso login' with the corresponding profile.",llr=async(t,e={},n)=>{let{SSOOIDCClient:r}=(X6(),Un(J6)),s=o=>e.clientConfig?.[o]??e.parentClientConfig?.[o]??n?.[o];return new r(Object.assign({},e.clientConfig??{},{region:t??e.clientConfig?.region,logger:s("logger"),userAgentAppId:s("userAgentAppId")}))},ulr=async(t,e,n={},r)=>{let{CreateTokenCommand:s}=(X6(),Un(J6));return(await llr(e,n,r)).send(new s({clientId:t.clientId,clientSecret:t.clientSecret,refreshToken:t.refreshToken,grantType:"refresh_token"}))},Gkt=t=>{if(t.expiration&&t.expiration.getTime(){if(typeof e>"u")throw new c_(`Value not present for '${t}' in SSO Token${n?". Cannot refresh":""}. ${FLe}`,!1)},{writeFile:dlr}=olr,plr=(t,e)=>{let n=Zcr(t),r=JSON.stringify(e,null,2);return dlr(n,r)},Wkt=new Map,qkt=(t={})=>async({callerClientConfig:e}={})=>{t.logger?.debug("@aws-sdk/token-providers - fromSso");let n=await elr(t),r=tlr({profile:t.profile??e?.profile}),s=n[r];if(s){if(!s.sso_session)throw new c_(`Profile '${r}' is missing required property 'sso_session'.`)}else throw new c_(`Profile '${r}' could not be found in shared credentials file.`,!1);let i=s.sso_session,a=(await nlr(t))[i];if(!a)throw new c_(`Sso session '${i}' could not be found in shared credentials file.`,!1);for(let f of["sso_start_url","sso_region"])if(!a[f])throw new c_(`Sso session '${i}' is missing required property '${f}'.`,!1);a.sso_start_url;let c=a.sso_region,u;try{u=await rlr(i)}catch{throw new c_(`The SSO session token associated with profile=${r} was not found or is invalid. ${FLe}`,!1)}xB("accessToken",u.accessToken),xB("expiresAt",u.expiresAt);let{accessToken:l,expiresAt:d}=u,h={token:l,expiration:new Date(d)};if(h.expiration.getTime()-Date.now()>clr)return h;let m=Wkt.get(i)??0;if(Date.now()-m<30*1e3)return Gkt(h),h;xB("clientId",u.clientId,!0),xB("clientSecret",u.clientSecret,!0),xB("refreshToken",u.refreshToken,!0);try{Wkt.set(i,Date.now());let f=await ulr(u,c,t,e);xB("accessToken",f.accessToken),xB("expiresIn",f.expiresIn);let g=new Date(Date.now()+f.expiresIn*1e3);try{await plr(i,{...u,accessToken:f.accessToken,expiresAt:g.toISOString(),refreshToken:f.refreshToken})}catch{}return{token:f.accessToken,expiration:g}}catch{return Gkt(h),h}},hlr=({token:t,logger:e})=>async()=>{if(e?.debug("@aws-sdk/token-providers - fromStatic"),!t||!t.token)throw new c_("Please pass a valid token to fromStatic",!1);return t},mlr=(t={})=>slr(ilr(qkt(t),async()=>{throw new c_("Could not load token from any providers",!1)}),e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,e=>e.expiration!==void 0);Z6.fromEnvSigningName=alr;Z6.fromSso=qkt;Z6.fromStatic=hlr;Z6.nodeProvider=mlr});function flr(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function glr(t){return{schemeId:"smithy.api#noAuth"}}var Vkt,jkt,Ykt,QLe=V(()=>{p();$d();Is();Vkt=async(t,e,n)=>({operation:Ha(e).operation,region:await ba(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});jkt=t=>{let e=[];return t.operation==="GetRoleCredentials"?e.push(glr(t)):e.push(flr(t)),e},Ykt=t=>{let e=qS(t);return Object.assign(e,{authSchemePreference:ba(t.authSchemePreference??[])})}});var Kkt,zkt,ULe=V(()=>{p();Kkt=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}),zkt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var e8,wB,Ple,Jkt,tNt,Ole,$Le,Xkt,GLe,$2,Zkt,eNt,Alr,vf,ylr,nNt,rNt=V(()=>{p();Ta();e8="ref",wB=-1,Ple=!0,Jkt="isSet",tNt="PartitionResult",Ole="booleanEquals",$Le="getAttr",Xkt={[e8]:"Endpoint"},GLe={[e8]:tNt},$2={},Zkt=[{[e8]:"Region"}],eNt={conditions:[[Jkt,[Xkt]],[Jkt,Zkt],["aws.partition",Zkt,tNt],[Ole,[{[e8]:"UseFIPS"},Ple]],[Ole,[{[e8]:"UseDualStack"},Ple]],[Ole,[{fn:$Le,argv:[GLe,"supportsDualStack"]},Ple]],[Ole,[{fn:$Le,argv:[GLe,"supportsFIPS"]},Ple]],["stringEquals",[{fn:$Le,argv:[GLe,"name"]},"aws-us-gov"]]],results:[[wB],[wB,"Invalid Configuration: FIPS and custom endpoint are not supported"],[wB,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[Xkt,$2],["https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",$2],[wB,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://portal.sso.{Region}.amazonaws.com",$2],["https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",$2],[wB,"FIPS is enabled but this partition does not support FIPS"],["https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",$2],[wB,"DualStack is enabled but this partition does not support DualStack"],["https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",$2],[wB,"Invalid Configuration: Missing Region"]]},Alr=2,vf=1e8,ylr=new Int32Array([-1,1,-1,0,13,3,1,4,vf+12,2,5,vf+12,3,8,6,4,7,vf+11,5,vf+9,vf+10,4,11,9,6,10,vf+8,7,vf+6,vf+7,5,12,vf+5,6,vf+4,vf+5,3,vf+1,14,4,vf+2,vf+3]),nNt=Gy.from(ylr,Alr,eNt.conditions,eNt.results)});var Elr,sNt,iNt=V(()=>{p();Go();Ta();rNt();Elr=new Wy({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),sNt=(t,e={})=>Elr.get(t,()=>wS(nNt,{endpointParams:t,logger:e.logger}));wf.aws=n_});var l_,Mle=V(()=>{p();Is();l_=class t extends Uy{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var t8,n8,r8,s8,WLe=V(()=>{p();Mle();t8=class t extends l_{name="InvalidRequestException";$fault="client";constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},n8=class t extends l_{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},r8=class t extends l_{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},s8=class t extends l_{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}}});var blr,_lr,Slr,Clr,Ilr,xlr,wlr,Tlr,vlr,Rlr,klr,Nlr,Dlr,Blr,Plr,Lle,Fle,Olr,Mlr,Qle,Llr,oNt,Ule,Flr,Qlr,Ulr,aNt,$lr,Glr,Wlr,Xy,cNt,lNt,i8,uNt,dNt,pNt,hNt,qLe,qlr,Hlr,Vlr,mNt,fNt,gNt,HLe,$le=V(()=>{p();Ki();WLe();Mle();blr="AccessTokenType",_lr="GetRoleCredentials",Slr="GetRoleCredentialsRequest",Clr="GetRoleCredentialsResponse",Ilr="InvalidRequestException",xlr="RoleCredentials",wlr="ResourceNotFoundException",Tlr="SecretAccessKeyType",vlr="SessionTokenType",Rlr="TooManyRequestsException",klr="UnauthorizedException",Nlr="accountId",Dlr="accessKeyId",Blr="accessToken",Plr="account_id",Lle="client",Fle="error",Olr="expiration",Mlr="http",Qle="httpError",Llr="httpHeader",oNt="httpQuery",Ule="message",Flr="roleCredentials",Qlr="roleName",Ulr="role_name",aNt="smithy.ts.sdk.synthetic.com.amazonaws.sso",$lr="secretAccessKey",Glr="sessionToken",Wlr="x-amz-sso_bearer_token",Xy="com.amazonaws.sso",cNt=Va.for(aNt),lNt=[-3,aNt,"SSOServiceException",0,[],[]];cNt.registerError(lNt,l_);i8=Va.for(Xy),uNt=[-3,Xy,Ilr,{[Fle]:Lle,[Qle]:400},[Ule],[0]];i8.registerError(uNt,t8);dNt=[-3,Xy,wlr,{[Fle]:Lle,[Qle]:404},[Ule],[0]];i8.registerError(dNt,n8);pNt=[-3,Xy,Rlr,{[Fle]:Lle,[Qle]:429},[Ule],[0]];i8.registerError(pNt,r8);hNt=[-3,Xy,klr,{[Fle]:Lle,[Qle]:401},[Ule],[0]];i8.registerError(hNt,s8);qLe=[cNt,i8],qlr=[0,Xy,blr,8,0],Hlr=[0,Xy,Tlr,8,0],Vlr=[0,Xy,vlr,8,0],mNt=[3,Xy,Slr,0,[Qlr,Nlr,Blr],[[0,{[oNt]:Ulr}],[0,{[oNt]:Plr}],[()=>qlr,{[Llr]:Wlr}]],3],fNt=[3,Xy,Clr,0,[Flr],[[()=>gNt,0]]],gNt=[3,Xy,xlr,0,[Dlr,$lr,Glr,Olr],[0,[()=>Hlr,0],[()=>Vlr,0],1]],HLe=[9,Xy,_lr,{[Mlr]:["GET","/federation/credentials",200]},()=>mNt,()=>fNt]});var ANt,yNt=V(()=>{p();$d();Q2();vp();pB();Is();$r();js();QLe();iNt();$le();ANt=t=>({apiVersion:"2019-06-10",base64Decoder:t?.base64Decoder??wl,base64Encoder:t?.base64Encoder??ja,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??sNt,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??jkt,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Ud},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ah}],logger:t?.logger??new If,protocol:t?.protocol??jS,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sso",errorTypeRegistries:qLe,version:"2019-06-10",serviceTarget:"SWBPortalService"},serviceId:t?.serviceId??"SSO",sha256:t?.sha256??TS,urlParser:t?.urlParser??Ip,utf8Decoder:t?.utf8Decoder??od,utf8Encoder:t?.utf8Encoder??Jc})});var Gle,ENt,bNt=V(()=>{p();R6();Go();$d();Is();Jo();Jg();js();Gle=Gt(EB());yNt();ENt=t=>{fS(process.version);let e=IS(t),n=()=>e().then(mS),r=ANt(t);uS(process.version);let s={profile:t?.profile,logger:r.logger};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??ei(r_,s),bodyLengthChecker:t?.bodyLengthChecker??ES,defaultUserAgentProvider:t?.defaultUserAgentProvider??t_({serviceId:r.serviceId,clientVersion:dR.version}),maxAttempts:t?.maxAttempts??ei(BS,t),region:t?.region??ei(xp,{...mm,...s}),requestHandler:Gle.NodeHttpHandler.create(t?.requestHandler??n),retryMode:t?.retryMode??ei({...OS,default:async()=>(await n()).retryMode||Hy},t),streamCollector:t?.streamCollector??Gle.streamCollector,useDualstackEndpoint:t?.useDualstackEndpoint??ei(SS,s),useFipsEndpoint:t?.useFipsEndpoint??ei(CS,s),userAgentAppId:t?.userAgentAppId??ei($S,s)}}});var _Nt,SNt,CNt=V(()=>{p();_Nt=t=>{let e=t.httpAuthSchemes,n=t.httpAuthSchemeProvider,r=t.credentials;return{setHttpAuthScheme(s){let i=e.findIndex(o=>o.schemeId===s.schemeId);i===-1?e.push(s):e.splice(i,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){r=s},credentials(){return r}}},SNt=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()})});var INt,xNt=V(()=>{p();Go();Is();$r();CNt();INt=(t,e)=>{let n=Object.assign(GS(t),jb(t),RS(t),_Nt(t));return e.forEach(r=>r.configure(n)),Object.assign(t,WS(n),gS(n),kS(n),SNt(n))}});var o8,VLe=V(()=>{p();Go();vp();Is();Jo();Ta();$r();Jg();Ki();QLe();ULe();bNt();xNt();o8=class extends fh{config;constructor(...[e]){let n=ENt(e||{});super(n),this.initConfig=n;let r=Kkt(n),s=QS(r),i=PS(s),o=jg(i),a=o,c=Sx(a),u=Ykt(c),l=INt(u,e?.extensions||[]);this.config=l,this.middlewareStack.use(pS(this.config)),this.middlewareStack.use(US(this.config)),this.middlewareStack.use(wx(this.config)),this.middlewareStack.use(NS(this.config)),this.middlewareStack.use(MS(this.config)),this.middlewareStack.use(LS(this.config)),this.middlewareStack.use(FS(this.config)),this.middlewareStack.use(Zb(this.config,{httpAuthSchemeParametersProvider:Vkt,identityProviderConfigProvider:async d=>new Xg({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use(e_(this.config))}destroy(){super.destroy()}}});var wNt,TNt,vNt,RNt=V(()=>{p();Is();Ta();ULe();wNt=AS(zkt,"SWBPortalService","SSOClient",Cx),TNt={},vNt=(t,e,n,r)=>[]});var a8,jLe=V(()=>{p();RNt();$le();a8=class extends wNt(TNt,vNt,"GetRoleCredentials",HLe){}});var jlr,Wle,kNt=V(()=>{p();Is();jLe();VLe();jlr={GetRoleCredentialsCommand:a8},Wle=class extends o8{};hS(jlr,Wle)});var NNt=V(()=>{p();jLe()});var DNt=V(()=>{p()});var BNt={};Ir(BNt,{$Command:()=>hm,GetRoleCredentials$:()=>HLe,GetRoleCredentialsCommand:()=>a8,GetRoleCredentialsRequest$:()=>mNt,GetRoleCredentialsResponse$:()=>fNt,InvalidRequestException:()=>t8,InvalidRequestException$:()=>uNt,ResourceNotFoundException:()=>n8,ResourceNotFoundException$:()=>dNt,RoleCredentials$:()=>gNt,SSO:()=>Wle,SSOClient:()=>o8,SSOServiceException:()=>l_,SSOServiceException$:()=>lNt,TooManyRequestsException:()=>r8,TooManyRequestsException$:()=>pNt,UnauthorizedException:()=>s8,UnauthorizedException$:()=>hNt,__Client:()=>fh,errorTypeRegistries:()=>qLe});var PNt=V(()=>{p();VLe();kNt();NNt();Is();$le();WLe();DNt();Mle()});var ONt=ee(YLe=>{p();var{GetRoleCredentialsCommand:Ylr,SSOClient:Klr}=(PNt(),Un(BNt));YLe.GetRoleCredentialsCommand=Ylr;YLe.SSOClient=Klr});var KLe=ee(qle=>{p();var{CredentialsProviderError:u_,getSSOTokenFromFile:zlr,getProfileName:Jlr,parseKnownFiles:Xlr,loadSsoSessionData:Zlr}=(Jo(),Un(xf)),{setCredentialFeature:MNt}=(Go(),Un(Zg)),{fromSso:eur}=Hkt(),FNt=t=>t&&(typeof t.sso_start_url=="string"||typeof t.sso_account_id=="string"||typeof t.sso_session=="string"||typeof t.sso_region=="string"||typeof t.sso_role_name=="string"),c8=!1,LNt=async({ssoStartUrl:t,ssoSession:e,ssoAccountId:n,ssoRegion:r,ssoRoleName:s,ssoClient:i,clientConfig:o,parentClientConfig:a,callerClientConfig:c,profile:u,filepath:l,configFilepath:d,ignoreCache:h,logger:m})=>{let f,g="To refresh this SSO session run aws sso login with the corresponding profile.";if(e)try{let $=await eur({profile:u,filepath:l,configFilepath:d,ignoreCache:h,clientConfig:o,parentClientConfig:a,logger:m})({callerClientConfig:c});f={accessToken:$.token,expiresAt:new Date($.expiration).toISOString()}}catch($){throw new u_($.message,{tryNextLink:c8,logger:m})}else try{f=await zlr(t)}catch{throw new u_(`The SSO session associated with this profile is invalid. ${g}`,{tryNextLink:c8,logger:m})}if(new Date(f.expiresAt).getTime()-Date.now()<=0)throw new u_(`The SSO session associated with this profile has expired. ${g}`,{tryNextLink:c8,logger:m});let{accessToken:A}=f,{SSOClient:y,GetRoleCredentialsCommand:b}=ONt(),S=i||new y(Object.assign({},o??{},{logger:o?.logger??c?.logger??a?.logger,region:o?.region??r,userAgentAppId:o?.userAgentAppId??c?.userAgentAppId??a?.userAgentAppId})),C;try{C=await S.send(new b({accountId:n,roleName:s,accessToken:A}))}catch($){throw new u_($,{tryNextLink:c8,logger:m})}let{roleCredentials:{accessKeyId:I,secretAccessKey:x,sessionToken:w,expiration:R,credentialScope:N,accountId:P}={}}=C;if(!I||!x||!w||!R)throw new u_("SSO returns an invalid temporary credential.",{tryNextLink:c8,logger:m});let G={accessKeyId:I,secretAccessKey:x,sessionToken:w,expiration:new Date(R),...N&&{credentialScope:N},...P&&{accountId:P}};return e?MNt(G,"CREDENTIALS_SSO","s"):MNt(G,"CREDENTIALS_SSO_LEGACY","u"),G},QNt=(t,e)=>{let{sso_start_url:n,sso_account_id:r,sso_region:s,sso_role_name:i}=t;if(!n||!r||!s||!i)throw new u_(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(t).join(", ")} -Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:e});return t},tur=(t={})=>async({callerClientConfig:e}={})=>{t.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:n,ssoAccountId:r,ssoRegion:s,ssoRoleName:i,ssoSession:o}=t,{ssoClient:a}=t,c=Jlr({profile:t.profile??e?.profile});if(!n&&!r&&!s&&!i&&!o){let l=(await Xlr(t))[c];if(!l)throw new u_(`Profile ${c} was not found.`,{logger:t.logger});if(!FNt(l))throw new u_(`Profile ${c} is not configured with SSO credentials.`,{logger:t.logger});if(l?.sso_session){let y=(await Zlr(t))[l.sso_session],b=` configurations in profile ${c} and sso-session ${l.sso_session}`;if(s&&s!==y.sso_region)throw new u_("Conflicting SSO region"+b,{tryNextLink:!1,logger:t.logger});if(n&&n!==y.sso_start_url)throw new u_("Conflicting SSO start_url"+b,{tryNextLink:!1,logger:t.logger});l.sso_region=y.sso_region,l.sso_start_url=y.sso_start_url}let{sso_start_url:d,sso_account_id:h,sso_region:m,sso_role_name:f,sso_session:g}=QNt(l,t.logger);return LNt({ssoStartUrl:d,ssoSession:g,ssoAccountId:h,ssoRegion:m,ssoRoleName:f,ssoClient:a,clientConfig:t.clientConfig,parentClientConfig:t.parentClientConfig,callerClientConfig:t.callerClientConfig,profile:c,filepath:t.filepath,configFilepath:t.configFilepath,ignoreCache:t.ignoreCache,logger:t.logger})}else{if(!n||!r||!s||!i)throw new u_('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:t.logger});return LNt({ssoStartUrl:n,ssoSession:o,ssoAccountId:r,ssoRegion:s,ssoRoleName:i,ssoClient:a,clientConfig:t.clientConfig,parentClientConfig:t.parentClientConfig,callerClientConfig:t.callerClientConfig,profile:c,filepath:t.filepath,configFilepath:t.configFilepath,ignoreCache:t.ignoreCache,logger:t.logger})}};qle.fromSSO=tur;qle.isSsoProfile=FNt;qle.validateSsoProfile=QNt});var XLe=ee(Vle=>{p();var{SignatureV4:nur,signatureV4aContainer:UNt}=SMe(),l8={CrtSignerV4:null},zLe="X-Amz-S3session-Token",$Nt=zLe.toLowerCase(),Hle=class extends nur{async signWithCredentials(e,n,r){let s=GNt(n);e.headers[$Nt]=n.sessionToken;let i=this;return WNt(i,s),i.signRequest(e,r??{})}async presignWithCredentials(e,n,r){let s=GNt(n);return delete e.headers[$Nt],e.headers[zLe]=n.sessionToken,e.query=e.query??{},e.query[zLe]=n.sessionToken,WNt(this,s),this.presign(e,r)}};function GNt(t){return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,expiration:t.expiration}}function WNt(t,e){let n=t.credentialProvider;t.credentialProvider=()=>(t.credentialProvider=n,Promise.resolve(e))}var JLe=class{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){return typeof l8.CrtSignerV4=="function"?"crt":typeof UNt.SignatureV4a=="function"?"js":"none"}constructor(e){this.sigv4Signer=new Hle(e),this.signerOptions=e}async sign(e,n={}){return n.signingRegion==="*"?this.getSigv4aSigner().sign(e,n):this.sigv4Signer.sign(e,n)}async signWithCredentials(e,n,r={}){if(r.signingRegion==="*"){let s=this.getSigv4aSigner(),i=l8.CrtSignerV4;if(i&&s instanceof i)return s.signWithCredentials(e,n,r);throw new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(e,n,r)}async presign(e,n={}){if(n.signingRegion==="*"){let r=this.getSigv4aSigner(),s=l8.CrtSignerV4;if(s&&r instanceof s)return r.presign(e,n);throw new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(e,n)}async presignWithCredentials(e,n,r={}){if(r.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(e,n,r)}getSigv4aSigner(){if(!this.sigv4aSigner){let e=l8.CrtSignerV4,n=UNt.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!e&&!n)throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(e&&typeof e=="function")this.sigv4aSigner=new e({...this.signerOptions,signingAlgorithm:1});else if(n&&typeof n=="function")this.sigv4aSigner=new n({...this.signerOptions});else throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!n||typeof n!="function")throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new n({...this.signerOptions})}}return this.sigv4aSigner}};Vle.SignatureV4MultiRegion=JLe;Vle.SignatureV4SignWithCredentials=Hle;Vle.signatureV4CrtContainer=l8});var W2,TB,u8,qNt,XNt,d8,kp,ZLe,HNt,VNt,jNt,YNt,KNt,Np,eFe,G2,zNt,JNt,rur,Wo,sur,ZNt,eDt=V(()=>{p();Ta();W2="ref",TB=-1,u8=!0,qNt="isSet",XNt="PartitionResult",d8="booleanEquals",kp="stringEquals",ZLe="getAttr",HNt="us-east-1",VNt="sigv4",jNt="sts",YNt="https://sts.{Region}.{PartitionResult#dnsSuffix}",KNt={[W2]:"Endpoint"},Np={[W2]:"Region"},eFe={[W2]:XNt},G2={},zNt=[Np],JNt={conditions:[[qNt,[KNt]],[qNt,zNt],["aws.partition",zNt,XNt],[d8,[{[W2]:"UseFIPS"},u8]],[d8,[{[W2]:"UseDualStack"},u8]],[kp,[Np,"aws-global"]],[d8,[{[W2]:"UseGlobalEndpoint"},u8]],[kp,[Np,"eu-central-1"]],[d8,[{fn:ZLe,argv:[eFe,"supportsDualStack"]},u8]],[d8,[{fn:ZLe,argv:[eFe,"supportsFIPS"]},u8]],[kp,[Np,"ap-south-1"]],[kp,[Np,"eu-north-1"]],[kp,[Np,"eu-west-1"]],[kp,[Np,"eu-west-2"]],[kp,[Np,"eu-west-3"]],[kp,[Np,"sa-east-1"]],[kp,[Np,HNt]],[kp,[Np,"us-east-2"]],[kp,[Np,"us-west-2"]],[kp,[Np,"us-west-1"]],[kp,[Np,"ca-central-1"]],[kp,[Np,"ap-southeast-1"]],[kp,[Np,"ap-northeast-1"]],[kp,[Np,"ap-southeast-2"]],[kp,[{fn:ZLe,argv:[eFe,"name"]},"aws-us-gov"]]],results:[[TB],["https://sts.amazonaws.com",{authSchemes:[{name:VNt,signingName:jNt,signingRegion:HNt}]}],[YNt,{authSchemes:[{name:VNt,signingName:jNt,signingRegion:"{Region}"}]}],[TB,"Invalid Configuration: FIPS and custom endpoint are not supported"],[TB,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[KNt,G2],["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",G2],[TB,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://sts.{Region}.amazonaws.com",G2],["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",G2],[TB,"FIPS is enabled but this partition does not support FIPS"],["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",G2],[TB,"DualStack is enabled but this partition does not support DualStack"],[YNt,G2],[TB,"Invalid Configuration: Missing Region"]]},rur=2,Wo=1e8,sur=new Int32Array([-1,1,-1,0,30,3,1,4,Wo+14,2,5,Wo+14,3,25,6,4,24,7,5,Wo+1,8,6,9,Wo+13,7,Wo+1,10,10,Wo+1,11,11,Wo+1,12,12,Wo+1,13,13,Wo+1,14,14,Wo+1,15,15,Wo+1,16,16,Wo+1,17,17,Wo+1,18,18,Wo+1,19,19,Wo+1,20,20,Wo+1,21,21,Wo+1,22,22,Wo+1,23,23,Wo+1,Wo+2,8,Wo+11,Wo+12,4,28,26,9,27,Wo+10,24,Wo+8,Wo+9,8,29,Wo+7,9,Wo+6,Wo+7,3,Wo+3,31,4,Wo+4,Wo+5]),ZNt=Gy.from(sur,rur,JNt.conditions,JNt.results)});var iur,jle,tFe=V(()=>{p();Go();Ta();eDt();iur=new Wy({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),jle=(t,e={})=>iur.get(t,()=>wS(ZNt,{endpointParams:t,logger:e.logger}));wf.aws=n_});function rDt(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function nFe(t){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function sDt(t){return{schemeId:"smithy.api#noAuth"}}var tDt,our,aur,nDt,cur,lur,iDt,oDt,rFe=V(()=>{p();$d();tDt=Gt(XLe());Is();Ta();tFe();our=t=>async(e,n,r)=>{if(!r)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let s=await t(e,n,r),i=Ha(n)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!i)throw new Error(`getEndpointParameterInstructions() is not defined on '${n.commandName}'`);let o=await KY(r,{getEndpointParameterInstructions:i},e);return Object.assign(s,o)},aur=async(t,e,n)=>({operation:Ha(e).operation,region:await ba(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),nDt=our(aur);cur=(t,e,n)=>s=>{let o=t(s).properties?.authSchemes;if(!o)return e(s);let a=[];for(let c of o){let{name:u,properties:l={},...d}=c,h=u.toLowerCase();u!==h&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${u}' to '${h}'`);let m;if(h==="sigv4a"){m="aws.auth#sigv4a";let A=o.find(y=>{let b=y.name.toLowerCase();return b!=="sigv4a"&&b.startsWith("sigv4")});if(tDt.SignatureV4MultiRegion.sigv4aDependency()==="none"&&A)continue}else if(h.startsWith("sigv4"))m="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${h}'`);let f=n[m];if(!f)throw new Error(`Could not find HttpAuthOption create function for '${m}'`);let g=f(s);g.schemeId=m,g.signingProperties={...g.signingProperties||{},...d,...l},a.push(g)}return a},lur=t=>{let e=[];return t.operation==="AssumeRoleWithWebIdentity"?(e.push(sDt(t)),e.push(nFe(t))):(e.push(rDt(t)),e.push(nFe(t))),e},iDt=cur(jle,lur,{"aws.auth#sigv4":rDt,"aws.auth#sigv4a":nFe,"smithy.api#noAuth":sDt}),oDt=t=>{let e=qS(t),n=_6(e);return Object.assign(n,{authSchemePreference:ba(t.authSchemePreference??[])})}});var aDt,cDt,sFe=V(()=>{p();aDt=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,useGlobalEndpoint:t.useGlobalEndpoint??!1,defaultSigningName:"sts"}),cDt={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var Rf,Yle=V(()=>{p();Is();Rf=class t extends Uy{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var p8,h8,m8,f8,g8,A8,y8,iFe=V(()=>{p();Yle();p8=class t extends Rf{name="ExpiredTokenException";$fault="client";constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},h8=class t extends Rf{name="MalformedPolicyDocumentException";$fault="client";constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},m8=class t extends Rf{name="PackedPolicyTooLargeException";$fault="client";constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},f8=class t extends Rf{name="RegionDisabledException";$fault="client";constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},g8=class t extends Rf{name="IDPRejectedClaimException";$fault="client";constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},A8=class t extends Rf{name="InvalidIdentityTokenException";$fault="client";constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},y8=class t extends Rf{name="IDPCommunicationErrorException";$fault="client";$retryable={};constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}}});var uur,dur,pur,hur,mur,fur,oFe,gur,Aur,yur,Eur,aFe,bur,lDt,_ur,Sur,Cur,Iur,xur,wur,Tur,vur,uDt,dDt,Rur,kur,Nur,Dur,Bur,Pur,pDt,Our,Mur,hDt,Lur,mDt,Fur,Qur,cFe,Uur,$ur,Gur,Wur,qur,Hur,Vur,jur,Yur,Kur,vB,RB,zur,kB,NB,DB,Jur,fDt,Xur,Mc,gDt,ADt,yR,yDt,EDt,bDt,_Dt,SDt,CDt,IDt,lFe,Zur,edr,uFe,xDt,wDt,TDt,vDt,dFe,RDt,kDt,NDt,DDt,tdr,ndr,pFe,hFe,E8=V(()=>{p();Ki();iFe();Yle();uur="Arn",dur="AccessKeyId",pur="AssumeRole",hur="AssumedRoleId",mur="AssumeRoleRequest",fur="AssumeRoleResponse",oFe="AssumedRoleUser",gur="AssumeRoleWithWebIdentity",Aur="AssumeRoleWithWebIdentityRequest",yur="AssumeRoleWithWebIdentityResponse",Eur="Audience",aFe="Credentials",bur="ContextAssertion",lDt="DurationSeconds",_ur="Expiration",Sur="ExternalId",Cur="ExpiredTokenException",Iur="IDPCommunicationErrorException",xur="IDPRejectedClaimException",wur="InvalidIdentityTokenException",Tur="Key",vur="MalformedPolicyDocumentException",uDt="Policy",dDt="PolicyArns",Rur="ProviderArn",kur="ProvidedContexts",Nur="ProvidedContextsListType",Dur="ProvidedContext",Bur="PolicyDescriptorType",Pur="ProviderId",pDt="PackedPolicySize",Our="PackedPolicyTooLargeException",Mur="Provider",hDt="RoleArn",Lur="RegionDisabledException",mDt="RoleSessionName",Fur="SecretAccessKey",Qur="SubjectFromWebIdentityToken",cFe="SourceIdentity",Uur="SerialNumber",$ur="SessionToken",Gur="Tags",Wur="TokenCode",qur="TransitiveTagKeys",Hur="Tag",Vur="Value",jur="WebIdentityToken",Yur="arn",Kur="accessKeySecretType",vB="awsQueryError",RB="client",zur="clientTokenType",kB="error",NB="httpError",DB="message",Jur="policyDescriptorListType",fDt="smithy.ts.sdk.synthetic.com.amazonaws.sts",Xur="tagListType",Mc="com.amazonaws.sts",gDt=Va.for(fDt),ADt=[-3,fDt,"STSServiceException",0,[],[]];gDt.registerError(ADt,Rf);yR=Va.for(Mc),yDt=[-3,Mc,Cur,{[vB]:["ExpiredTokenException",400],[kB]:RB,[NB]:400},[DB],[0]];yR.registerError(yDt,p8);EDt=[-3,Mc,Iur,{[vB]:["IDPCommunicationError",400],[kB]:RB,[NB]:400},[DB],[0]];yR.registerError(EDt,y8);bDt=[-3,Mc,xur,{[vB]:["IDPRejectedClaim",403],[kB]:RB,[NB]:403},[DB],[0]];yR.registerError(bDt,g8);_Dt=[-3,Mc,wur,{[vB]:["InvalidIdentityToken",400],[kB]:RB,[NB]:400},[DB],[0]];yR.registerError(_Dt,A8);SDt=[-3,Mc,vur,{[vB]:["MalformedPolicyDocument",400],[kB]:RB,[NB]:400},[DB],[0]];yR.registerError(SDt,h8);CDt=[-3,Mc,Our,{[vB]:["PackedPolicyTooLarge",400],[kB]:RB,[NB]:400},[DB],[0]];yR.registerError(CDt,m8);IDt=[-3,Mc,Lur,{[vB]:["RegionDisabledException",403],[kB]:RB,[NB]:403},[DB],[0]];yR.registerError(IDt,f8);lFe=[gDt,yR],Zur=[0,Mc,Kur,8,0],edr=[0,Mc,zur,8,0],uFe=[3,Mc,oFe,0,[hur,uur],[0,0],2],xDt=[3,Mc,mur,0,[hDt,mDt,dDt,uDt,lDt,Gur,qur,Sur,Uur,Wur,cFe,kur],[0,0,()=>DDt,0,1,()=>ndr,64,0,0,0,0,()=>tdr],2],wDt=[3,Mc,fur,0,[aFe,oFe,pDt,cFe],[[()=>dFe,0],()=>uFe,1,0]],TDt=[3,Mc,Aur,0,[hDt,mDt,jur,Pur,dDt,uDt,lDt],[0,0,[()=>edr,0],0,()=>DDt,0,1],3],vDt=[3,Mc,yur,0,[aFe,Qur,oFe,pDt,Mur,Eur,cFe],[[()=>dFe,0],0,()=>uFe,1,0,0,0]],dFe=[3,Mc,aFe,0,[dur,Fur,$ur,_ur],[0,[()=>Zur,0],0,4],4],RDt=[3,Mc,Bur,0,[Yur],[0]],kDt=[3,Mc,Dur,0,[Rur,bur],[0,0]],NDt=[3,Mc,Hur,0,[Tur,Vur],[0,0],2],DDt=[1,Mc,Jur,0,()=>RDt],tdr=[1,Mc,Nur,0,()=>kDt],ndr=[1,Mc,Xur,0,()=>NDt],pFe=[9,Mc,pur,0,()=>xDt,()=>wDt],hFe=[9,Mc,gur,0,()=>TDt,()=>vDt]});var BDt,PDt,ODt=V(()=>{p();$d();Q2();BDt=Gt(XLe());vp();pB();Is();$r();js();rFe();tFe();E8();PDt=t=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??wl,base64Encoder:t?.base64Encoder??ja,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??jle,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??iDt,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Ud},{schemeId:"aws.auth#sigv4a",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4a"),signer:new Tx},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ah}],logger:t?.logger??new If,protocol:t?.protocol??AR,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:lFe,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:t?.serviceId??"STS",sha256:t?.sha256??TS,signerConstructor:t?.signerConstructor??BDt.SignatureV4MultiRegion,urlParser:t?.urlParser??Ip,utf8Decoder:t?.utf8Decoder??od,utf8Encoder:t?.utf8Encoder??Jc})});var Kle,MDt,LDt=V(()=>{p();R6();Go();$d();vp();Is();Jo();Jg();js();Kle=Gt(EB());ODt();MDt=t=>{fS(process.version);let e=IS(t),n=()=>e().then(mS),r=PDt(t);uS(process.version);let s={profile:t?.profile,logger:r.logger};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??ei(r_,s),bodyLengthChecker:t?.bodyLengthChecker??ES,defaultUserAgentProvider:t?.defaultUserAgentProvider??t_({serviceId:r.serviceId,clientVersion:dR.version}),httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:i=>i.getIdentityProvider("aws.auth#sigv4")||(async o=>await t.credentialDefaultProvider(o?.__config||{})()),signer:new Ud},{schemeId:"aws.auth#sigv4a",identityProvider:i=>i.getIdentityProvider("aws.auth#sigv4a"),signer:new Tx},{schemeId:"smithy.api#noAuth",identityProvider:i=>i.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ah}],maxAttempts:t?.maxAttempts??ei(BS,t),region:t?.region??ei(xp,{...mm,...s}),requestHandler:Kle.NodeHttpHandler.create(t?.requestHandler??n),retryMode:t?.retryMode??ei({...OS,default:async()=>(await n()).retryMode||Hy},t),sigv4aSigningRegionSet:t?.sigv4aSigningRegionSet??ei(S6,s),streamCollector:t?.streamCollector??Kle.streamCollector,useDualstackEndpoint:t?.useDualstackEndpoint??ei(SS,s),useFipsEndpoint:t?.useFipsEndpoint??ei(CS,s),userAgentAppId:t?.userAgentAppId??ei($S,s)}}});var FDt,QDt,UDt=V(()=>{p();FDt=t=>{let e=t.httpAuthSchemes,n=t.httpAuthSchemeProvider,r=t.credentials;return{setHttpAuthScheme(s){let i=e.findIndex(o=>o.schemeId===s.schemeId);i===-1?e.push(s):e.splice(i,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){r=s},credentials(){return r}}},QDt=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()})});var $Dt,GDt=V(()=>{p();Go();Is();$r();UDt();$Dt=(t,e)=>{let n=Object.assign(GS(t),jb(t),RS(t),FDt(t));return e.forEach(r=>r.configure(n)),Object.assign(t,WS(n),gS(n),kS(n),QDt(n))}});var ER,zle=V(()=>{p();Go();vp();Is();Jo();Ta();$r();Jg();Ki();rFe();sFe();LDt();GDt();ER=class extends fh{config;constructor(...[e]){let n=MDt(e||{});super(n),this.initConfig=n;let r=aDt(n),s=QS(r),i=PS(s),o=jg(i),a=o,c=Sx(a),u=oDt(c),l=$Dt(u,e?.extensions||[]);this.config=l,this.middlewareStack.use(pS(this.config)),this.middlewareStack.use(US(this.config)),this.middlewareStack.use(wx(this.config)),this.middlewareStack.use(NS(this.config)),this.middlewareStack.use(MS(this.config)),this.middlewareStack.use(LS(this.config)),this.middlewareStack.use(FS(this.config)),this.middlewareStack.use(Zb(this.config,{httpAuthSchemeParametersProvider:nDt,identityProviderConfigProvider:async d=>new Xg({"aws.auth#sigv4":d.credentials,"aws.auth#sigv4a":d.credentials})})),this.middlewareStack.use(e_(this.config))}destroy(){super.destroy()}}});var Jle,Xle,Zle,mFe=V(()=>{p();Is();Ta();sFe();Jle=AS(cDt,"AWSSecurityTokenServiceV20110615","STSClient",Cx),Xle={},Zle=(t,e,n,r)=>[]});var BB,eue=V(()=>{p();mFe();E8();BB=class extends Jle(Xle,Zle,"AssumeRole",pFe){}});var PB,tue=V(()=>{p();mFe();E8();PB=class extends Jle(Xle,Zle,"AssumeRoleWithWebIdentity",hFe){}});var rdr,nue,WDt=V(()=>{p();Is();eue();tue();zle();rdr={AssumeRoleCommand:BB,AssumeRoleWithWebIdentityCommand:PB},nue=class extends ER{};hS(rdr,nue)});var qDt=V(()=>{p();eue();tue()});var HDt=V(()=>{p()});var VDt,jDt,YDt,KDt,zDt,JDt=V(()=>{p();Go();eue();tue();VDt=t=>{if(typeof t?.Arn=="string"){let e=t.Arn.split(":");if(e.length>4&&e[4]!=="")return e[4]}},jDt=async(t,e,n,r={})=>{let s=typeof t=="function"?await t():t,i=typeof e=="function"?await e():e,o="",a=s??i??(o=await bce(r)());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${s} (credential provider clientConfig)`,`${i} (contextual client)`,`${o} (STS default: AWS_REGION, profile region, or us-east-1)`),a},YDt=(t,e)=>{let n,r;return async(s,i)=>{if(r=s,!n){let{logger:l=t?.parentClientConfig?.logger,profile:d=t?.parentClientConfig?.profile,region:h,requestHandler:m=t?.parentClientConfig?.requestHandler,credentialProviderLogger:f,userAgentAppId:g=t?.parentClientConfig?.userAgentAppId}=t,A=await jDt(h,t?.parentClientConfig?.region,f,{logger:l,profile:d}),y=!zDt(m);n=new e({...t,userAgentAppId:g,profile:d,credentialDefaultProvider:()=>async()=>r,region:A,requestHandler:y?m:void 0,logger:l})}let{Credentials:o,AssumedRoleUser:a}=await n.send(new BB(i));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${i.RoleArn}`);let c=VDt(a),u={accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...c&&{accountId:c}};return Lv(u,"CREDENTIALS_STS_ASSUME_ROLE","i"),u}},KDt=(t,e)=>{let n;return async r=>{if(!n){let{logger:c=t?.parentClientConfig?.logger,profile:u=t?.parentClientConfig?.profile,region:l,requestHandler:d=t?.parentClientConfig?.requestHandler,credentialProviderLogger:h,userAgentAppId:m=t?.parentClientConfig?.userAgentAppId}=t,f=await jDt(l,t?.parentClientConfig?.region,h,{logger:c,profile:u}),g=!zDt(d);n=new e({...t,userAgentAppId:m,profile:u,region:f,requestHandler:g?d:void 0,logger:c})}let{Credentials:s,AssumedRoleUser:i}=await n.send(new PB(r));if(!s||!s.AccessKeyId||!s.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);let o=VDt(i),a={accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,sessionToken:s.SessionToken,expiration:s.Expiration,...s.CredentialScope&&{credentialScope:s.CredentialScope},...o&&{accountId:o}};return o&&Lv(a,"RESOLVED_ACCOUNT_ID","T"),Lv(a,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),a}},zDt=t=>t?.metadata?.handlerProtocol==="h2"});var XDt,ZDt,e1t,sdr,t1t=V(()=>{p();JDt();zle();XDt=(t,e)=>e?class extends t{constructor(r){super(r);for(let s of e)this.middlewareStack.use(s)}}:t,ZDt=(t={},e)=>YDt(t,XDt(ER,e)),e1t=(t={},e)=>KDt(t,XDt(ER,e)),sdr=t=>e=>t({roleAssumer:ZDt(e),roleAssumerWithWebIdentity:e1t(e),...e})});var fFe={};Ir(fFe,{$Command:()=>hm,AssumeRole$:()=>pFe,AssumeRoleCommand:()=>BB,AssumeRoleRequest$:()=>xDt,AssumeRoleResponse$:()=>wDt,AssumeRoleWithWebIdentity$:()=>hFe,AssumeRoleWithWebIdentityCommand:()=>PB,AssumeRoleWithWebIdentityRequest$:()=>TDt,AssumeRoleWithWebIdentityResponse$:()=>vDt,AssumedRoleUser$:()=>uFe,Credentials$:()=>dFe,ExpiredTokenException:()=>p8,ExpiredTokenException$:()=>yDt,IDPCommunicationErrorException:()=>y8,IDPCommunicationErrorException$:()=>EDt,IDPRejectedClaimException:()=>g8,IDPRejectedClaimException$:()=>bDt,InvalidIdentityTokenException:()=>A8,InvalidIdentityTokenException$:()=>_Dt,MalformedPolicyDocumentException:()=>h8,MalformedPolicyDocumentException$:()=>SDt,PackedPolicyTooLargeException:()=>m8,PackedPolicyTooLargeException$:()=>CDt,PolicyDescriptorType$:()=>RDt,ProvidedContext$:()=>kDt,RegionDisabledException:()=>f8,RegionDisabledException$:()=>IDt,STS:()=>nue,STSClient:()=>ER,STSServiceException:()=>Rf,STSServiceException$:()=>ADt,Tag$:()=>NDt,__Client:()=>fh,decorateDefaultCredentialProvider:()=>sdr,errorTypeRegistries:()=>lFe,getDefaultRoleAssumer:()=>ZDt,getDefaultRoleAssumerWithWebIdentity:()=>e1t});var gFe=V(()=>{p();zle();WDt();qDt();Is();E8();iFe();HDt();t1t();Yle()});function idr(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function odr(t){return{schemeId:"smithy.api#noAuth"}}var n1t,r1t,s1t,AFe=V(()=>{p();$d();Is();n1t=async(t,e,n)=>({operation:Ha(e).operation,region:await ba(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});r1t=t=>{let e=[];return t.operation==="CreateOAuth2Token"?e.push(odr(t)):e.push(idr(t)),e},s1t=t=>{let e=qS(t);return Object.assign(e,{authSchemePreference:ba(t.authSchemePreference??[])})}});var i1t,o1t,yFe=V(()=>{p();i1t=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"signin"}),o1t={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var SR,bR,a1t,q2,c1t,H2,l1t,bFe,Rx,EFe,u1t,d1t,_R,f1t,p1t,rue,yh,h1t,m1t,adr,po,cdr,g1t,A1t=V(()=>{p();Ta();SR="ref",bR=-1,a1t=!1,q2=!0,c1t="isSet",H2="booleanEquals",l1t="coalesce",bFe="PartitionResult",Rx="stringEquals",EFe="getAttr",u1t="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",d1t={[SR]:"Endpoint"},_R={fn:EFe,argv:[{[SR]:bFe},"name"]},f1t={[SR]:"Region"},p1t={[SR]:bFe},rue={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},yh={},h1t=[f1t],m1t={conditions:[[c1t,h1t],[H2,[{fn:l1t,argv:[{[SR]:"IsControlPlane"},a1t]},q2]],[c1t,[d1t]],["aws.partition",h1t,bFe],[H2,[{[SR]:"UseFIPS"},q2]],[Rx,[_R,"aws"]],[H2,[{fn:l1t,argv:[{[SR]:"IsOAuthEndpoint"},a1t]},q2]],[H2,[{[SR]:"UseDualStack"},q2]],[Rx,[_R,"aws-cn"]],[Rx,[f1t,"us-gov-west-1"]],[Rx,[_R,"aws-us-gov"]],[H2,[{fn:EFe,argv:[p1t,"supportsFIPS"]},q2]],[Rx,[_R,"aws-iso"]],[Rx,[_R,"aws-iso-b"]],[Rx,[_R,"aws-iso-f"]],[Rx,[_R,"aws-iso-e"]],[Rx,[_R,"aws-eusc"]],[H2,[{fn:EFe,argv:[p1t,"supportsDualStack"]},q2]]],results:[[bR],["https://signin.{Region}.api.aws",rue],["https://signin.{Region}.api.amazonwebservices.com.cn",rue],[u1t,rue],[bR,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",rue],["https://{Region}.signin.aws.amazon.com",yh],["https://{Region}.signin.amazonaws.cn",yh],["https://{Region}.signin.amazonaws-us-gov.com",yh],["https://{Region}.signin.c2shome.ic.gov",yh],["https://{Region}.signin.sc2shome.sgov.gov",yh],["https://{Region}.signin.csphome.hci.ic.gov",yh],["https://{Region}.signin.csphome.adc-e.uk",yh],["https://{Region}.signin.amazonaws-eusc.eu",yh],["https://signin-fips.amazonaws-us-gov.com",yh],["https://{Region}.signin-fips.amazonaws-us-gov.com",yh],["https://{Region}.signin.{PartitionResult#dnsSuffix}",yh],[bR,"Invalid Configuration: FIPS and custom endpoint are not supported"],[bR,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[d1t,yh],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",yh],[bR,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",yh],[bR,"FIPS is enabled but this partition does not support FIPS"],[u1t,yh],[bR,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",yh],[bR,"Invalid Configuration: Missing Region"]]},adr=2,po=1e8,cdr=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,po+27,6,po+4,po+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,po+7,13,10,po+8,14,12,po+9,15,13,po+10,16,14,po+11,17,15,po+12,18,16,po+13,po+16,6,po+5,20,7,21,po+6,17,po+24,po+25,6,po+4,23,7,27,24,9,po+14,25,10,po+15,26,11,po+22,po+23,11,28,po+21,17,po+20,po+21,2,35,30,3,39,31,4,32,po+27,6,po+4,33,7,po+27,34,9,po+14,po+27,3,39,36,4,38,37,7,po+18,po+19,6,po+4,po+17,5,po+1,40,8,po+2,po+3]),g1t=Gy.from(cdr,adr,m1t.conditions,m1t.results)});var ldr,y1t,E1t=V(()=>{p();Go();Ta();A1t();ldr=new Wy({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),y1t=(t,e={})=>ldr.get(t,()=>wS(g1t,{endpointParams:t,logger:e.logger}));wf.aws=n_});var d_,sue=V(()=>{p();Is();d_=class t extends Uy{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var b8,_8,S8,C8,_Fe=V(()=>{p();sue();b8=class t extends d_{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error}},_8=class t extends d_{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error}},S8=class t extends d_{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error}},C8=class t extends d_{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error}}});var udr,ddr,pdr,hdr,mdr,fdr,gdr,Adr,ydr,Edr,bdr,_dr,Sdr,Cdr,Idr,b1t,SFe,xdr,wFe,_1t,S1t,wdr,CR,CFe,Tdr,IFe,vdr,T1t,TFe,C1t,Dp,oue,Rdr,iue,I1t,v1t,x1t,w1t,kdr,Ndr,Ddr,xFe,Bdr,Eh,R1t,k1t,I8,N1t,D1t,B1t,P1t,vFe,Pdr,O1t,M1t,L1t,F1t,Q1t,U1t,$1t,G1t,RFe,kFe,x8=V(()=>{p();Ki();_Fe();sue();udr="AccessDeniedException",ddr="AccessToken",pdr="CreateOAuth2Token",hdr="CreateOAuth2TokenRequest",mdr="CreateOAuth2TokenRequestBody",fdr="CreateOAuth2TokenResponseBody",gdr="CreateOAuth2TokenResponse",Adr="CreateOAuth2TokenWithIAM",ydr="CreateOAuth2TokenWithIAMRequest",Edr="CreateOAuth2TokenWithIAMResponse",bdr="InternalServerException",_dr="OAuthAccessToken",Sdr="RefreshToken",Cdr="TooManyRequestsError",Idr="ValidationException",b1t="accessKeyId",SFe="accessToken",xdr="access_token",wFe="client",_1t="clientId",S1t="codeVerifier",wdr="code",CR="error",CFe="expiresIn",Tdr="expires_in",IFe="grantType",vdr="grant_type",T1t="http",TFe="httpError",C1t="idToken",Dp="jsonName",oue="message",Rdr="resource",iue="refreshToken",I1t="redirectUri",v1t="smithy.ts.sdk.synthetic.com.amazonaws.signin",x1t="secretAccessKey",w1t="sessionToken",kdr="server",Ndr="tokenInput",Ddr="tokenOutput",xFe="tokenType",Bdr="token_type",Eh="com.amazonaws.signin",R1t=Va.for(v1t),k1t=[-3,v1t,"SigninServiceException",0,[],[]];R1t.registerError(k1t,d_);I8=Va.for(Eh),N1t=[-3,Eh,udr,{[CR]:wFe},[CR,oue],[0,0],2];I8.registerError(N1t,b8);D1t=[-3,Eh,bdr,{[CR]:kdr,[TFe]:500},[CR,oue],[0,0],2];I8.registerError(D1t,_8);B1t=[-3,Eh,Cdr,{[CR]:wFe,[TFe]:429},[CR,oue],[0,0],2];I8.registerError(B1t,S8);P1t=[-3,Eh,Idr,{[CR]:wFe,[TFe]:400},[CR,oue],[0,0],2];I8.registerError(P1t,C8);vFe=[R1t,I8],Pdr=[0,Eh,_dr,8,0],O1t=[0,Eh,Sdr,8,0],M1t=[3,Eh,ddr,8,[b1t,x1t,w1t],[[0,{[Dp]:b1t}],[0,{[Dp]:x1t}],[0,{[Dp]:w1t}]],3],L1t=[3,Eh,hdr,0,[Ndr],[[()=>F1t,16]],1],F1t=[3,Eh,mdr,0,[_1t,IFe,wdr,I1t,S1t,iue],[[0,{[Dp]:_1t}],[0,{[Dp]:IFe}],0,[0,{[Dp]:I1t}],[0,{[Dp]:S1t}],[()=>O1t,{[Dp]:iue}]],2],Q1t=[3,Eh,gdr,0,[Ddr],[[()=>U1t,16]],1],U1t=[3,Eh,fdr,0,[SFe,xFe,CFe,iue,C1t],[[()=>M1t,{[Dp]:SFe}],[0,{[Dp]:xFe}],[1,{[Dp]:CFe}],[()=>O1t,{[Dp]:iue}],[0,{[Dp]:C1t}]],4],$1t=[3,Eh,ydr,0,[IFe,Rdr],[[0,{[Dp]:vdr}],0],2],G1t=[3,Eh,Edr,0,[SFe,xFe,CFe],[[()=>Pdr,{[Dp]:xdr}],[0,{[Dp]:Bdr}],[1,{[Dp]:Tdr}]],3],RFe=[9,Eh,pdr,{[T1t]:["POST","/v1/token",200]},()=>L1t,()=>Q1t],kFe=[9,Eh,Adr,{[T1t]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>$1t,()=>G1t]});var W1t,q1t=V(()=>{p();$d();Q2();vp();pB();Is();$r();js();AFe();E1t();x8();W1t=t=>({apiVersion:"2023-01-01",base64Decoder:t?.base64Decoder??wl,base64Encoder:t?.base64Encoder??ja,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??y1t,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??r1t,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Ud},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ah}],logger:t?.logger??new If,protocol:t?.protocol??jS,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:vFe,version:"2023-01-01",serviceTarget:"Signin"},serviceId:t?.serviceId??"Signin",sha256:t?.sha256??TS,urlParser:t?.urlParser??Ip,utf8Decoder:t?.utf8Decoder??od,utf8Encoder:t?.utf8Encoder??Jc})});var aue,H1t,V1t=V(()=>{p();R6();Go();$d();Is();Jo();Jg();js();aue=Gt(EB());q1t();H1t=t=>{fS(process.version);let e=IS(t),n=()=>e().then(mS),r=W1t(t);uS(process.version);let s={profile:t?.profile,logger:r.logger};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??ei(r_,s),bodyLengthChecker:t?.bodyLengthChecker??ES,defaultUserAgentProvider:t?.defaultUserAgentProvider??t_({serviceId:r.serviceId,clientVersion:dR.version}),maxAttempts:t?.maxAttempts??ei(BS,t),region:t?.region??ei(xp,{...mm,...s}),requestHandler:aue.NodeHttpHandler.create(t?.requestHandler??n),retryMode:t?.retryMode??ei({...OS,default:async()=>(await n()).retryMode||Hy},t),streamCollector:t?.streamCollector??aue.streamCollector,useDualstackEndpoint:t?.useDualstackEndpoint??ei(SS,s),useFipsEndpoint:t?.useFipsEndpoint??ei(CS,s),userAgentAppId:t?.userAgentAppId??ei($S,s)}}});var j1t,Y1t,K1t=V(()=>{p();j1t=t=>{let e=t.httpAuthSchemes,n=t.httpAuthSchemeProvider,r=t.credentials;return{setHttpAuthScheme(s){let i=e.findIndex(o=>o.schemeId===s.schemeId);i===-1?e.push(s):e.splice(i,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){r=s},credentials(){return r}}},Y1t=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()})});var z1t,J1t=V(()=>{p();Go();Is();$r();K1t();z1t=(t,e)=>{let n=Object.assign(GS(t),jb(t),RS(t),j1t(t));return e.forEach(r=>r.configure(n)),Object.assign(t,WS(n),gS(n),kS(n),Y1t(n))}});var w8,NFe=V(()=>{p();Go();vp();Is();Jo();Ta();$r();Jg();Ki();AFe();yFe();V1t();J1t();w8=class extends fh{config;constructor(...[e]){let n=H1t(e||{});super(n),this.initConfig=n;let r=i1t(n),s=QS(r),i=PS(s),o=jg(i),a=o,c=Sx(a),u=s1t(c),l=z1t(u,e?.extensions||[]);this.config=l,this.middlewareStack.use(pS(this.config)),this.middlewareStack.use(US(this.config)),this.middlewareStack.use(wx(this.config)),this.middlewareStack.use(NS(this.config)),this.middlewareStack.use(MS(this.config)),this.middlewareStack.use(LS(this.config)),this.middlewareStack.use(FS(this.config)),this.middlewareStack.use(Zb(this.config,{httpAuthSchemeParametersProvider:n1t,identityProviderConfigProvider:async d=>new Xg({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use(e_(this.config))}destroy(){super.destroy()}}});var cue,X1t,Z1t,lue,DFe=V(()=>{p();Is();Ta();yFe();cue=AS(o1t,"Signin","SigninClient",Cx),X1t={IsControlPlane:{type:"staticContextParams",value:!1}},Z1t={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},lue=(t,e,n,r)=>[]});var T8,BFe=V(()=>{p();DFe();x8();T8=class extends cue(X1t,lue,"CreateOAuth2Token",RFe){}});var v8,PFe=V(()=>{p();DFe();x8();v8=class extends cue(Z1t,lue,"CreateOAuth2TokenWithIAM",kFe){}});var Odr,uue,eBt=V(()=>{p();Is();BFe();PFe();NFe();Odr={CreateOAuth2TokenCommand:T8,CreateOAuth2TokenWithIAMCommand:v8},uue=class extends w8{};hS(Odr,uue)});var tBt=V(()=>{p();BFe();PFe()});var Mdr,nBt=V(()=>{p();Mdr={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"}});var rBt=V(()=>{p()});var sBt={};Ir(sBt,{$Command:()=>hm,AccessDeniedException:()=>b8,AccessDeniedException$:()=>N1t,AccessToken$:()=>M1t,CreateOAuth2Token$:()=>RFe,CreateOAuth2TokenCommand:()=>T8,CreateOAuth2TokenRequest$:()=>L1t,CreateOAuth2TokenRequestBody$:()=>F1t,CreateOAuth2TokenResponse$:()=>Q1t,CreateOAuth2TokenResponseBody$:()=>U1t,CreateOAuth2TokenWithIAM$:()=>kFe,CreateOAuth2TokenWithIAMCommand:()=>v8,CreateOAuth2TokenWithIAMRequest$:()=>$1t,CreateOAuth2TokenWithIAMResponse$:()=>G1t,InternalServerException:()=>_8,InternalServerException$:()=>D1t,OAuth2ErrorCode:()=>Mdr,Signin:()=>uue,SigninClient:()=>w8,SigninServiceException:()=>d_,SigninServiceException$:()=>k1t,TooManyRequestsError:()=>S8,TooManyRequestsError$:()=>B1t,ValidationException:()=>C8,ValidationException$:()=>P1t,__Client:()=>fh,errorTypeRegistries:()=>vFe});var iBt=V(()=>{p();NFe();eBt();tBt();Is();x8();nBt();_Fe();rBt();sue()});var cBt=ee(aBt=>{p();var{setCredentialFeature:Ldr}=(Go(),Un(Zg)),{CredentialsProviderError:IR,parseKnownFiles:Fdr,getProfileName:Qdr}=(Jo(),Un(xf)),{HttpRequest:Udr}=($r(),Un(qy)),{createHash:$dr,createPrivateKey:Gdr,createPublicKey:Wdr,sign:qdr}=require("node:crypto"),{promises:OFe}=require("node:fs"),{homedir:Hdr}=require("node:os"),{dirname:Vdr,join:oBt}=require("node:path"),MFe=class t{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300*1e3;constructor(e,n,r){this.profileData=e,this.init=n,this.callerClientConfig=r}async loadCredentials(){let e=await this.loadToken();if(!e)throw new IR(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let n=e.accessToken,r=Date.now();return new Date(n.expiresAt).getTime()-r<=t.REFRESH_THRESHOLD?this.refresh(e):this.toCredentials(e.accessToken)}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}toCredentials(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken,accountId:e.accountId,expiration:new Date(e.expiresAt)}}async refresh(e){let n=await this.loadToken().catch(()=>e),r=Date.now(),s=new Date(n.accessToken.expiresAt).getTime(),i=new Date(e.accessToken.expiresAt).getTime(),o=s<=r&&i>r?e:n;if(new Date(o.accessToken.expiresAt).getTime()-Date.now()>t.REFRESH_THRESHOLD)return this.toCredentials(o.accessToken);let{SigninClient:c,CreateOAuth2TokenCommand:u}=(iBt(),Un(sBt)),{logger:l,userAgentAppId:d}=this.callerClientConfig??{},m=(y=>y?.metadata?.handlerProtocol==="h2")(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,f=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,g=new c({credentials:{accessKeyId:"",secretAccessKey:""},region:f,requestHandler:m,logger:l,userAgentAppId:d,...this.init?.clientConfig});this.createDPoPInterceptor(g.middlewareStack);let A={tokenInput:{clientId:o.clientId,refreshToken:o.refreshToken,grantType:"refresh_token"}};try{let y=await g.send(new u(A)),{accessKeyId:b,secretAccessKey:S,sessionToken:C}=y.tokenOutput?.accessToken??{},{refreshToken:I,expiresIn:x}=y.tokenOutput??{};if(!b||!S||!C||!I)throw new IR("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let w=(x??900)*1e3,R=new Date(Date.now()+w),N={...o,accessToken:{...o.accessToken,accessKeyId:b,secretAccessKey:S,sessionToken:C,expiresAt:R.toISOString()},refreshToken:I};return await this.saveToken(N),this.toCredentials(N.accessToken)}catch(y){if(y.name==="AccessDeniedException"){let S=y.error,C;switch(S){case"TOKEN_EXPIRED":C="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":C="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":C="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:C=`Failed to refresh token: ${String(y)}. Please re-authenticate using \`aws login\``}throw new IR(C,{logger:this.logger,tryNextLink:!1})}if(new Date(o.accessToken.expiresAt).getTime()>Date.now())return this.logger?.warn?.(`Failed to refresh token: ${String(y)}. Using existing token until expiry.`),this.toCredentials(o.accessToken);throw new IR(`Failed to refresh token: ${String(y)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let n=await OFe.readFile(e,"utf8"),r=JSON.parse(n),s=["accessToken","clientId","refreshToken","dpopKey"].filter(i=>!r[i]);if(r.accessToken?.accountId||s.push("accountId"),s.length>0)throw new IR(`Token validation failed, missing fields: ${s.join(", ")}`,{logger:this.logger,tryNextLink:!1});return r}catch(n){throw new IR(`Failed to load token from ${e}: ${String(n)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let n=this.getTokenFilePath(),r=Vdr(n);try{await OFe.mkdir(r,{recursive:!0})}catch{}await OFe.writeFile(n,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??oBt(Hdr(),".aws","login","cache"),n=Buffer.from(this.loginSession,"utf8"),r=$dr("sha256").update(n).digest("hex");return oBt(e,`${r}.json`)}derToRawSignature(e){let n=2;if(e[n]!==2)throw new Error("Invalid DER signature");n++;let r=e[n++],s=e.subarray(n,n+r);if(n+=r,e[n]!==2)throw new Error("Invalid DER signature");n++;let i=e[n++],o=e.subarray(n,n+i);s=s[0]===0?s.subarray(1):s,o=o[0]===0?o.subarray(1):o;let a=Buffer.concat([Buffer.alloc(32-s.length),s]),c=Buffer.concat([Buffer.alloc(32-o.length),o]);return Buffer.concat([a,c])}createDPoPInterceptor(e){e.add(n=>async r=>{if(Udr.isInstance(r.request)){let s=r.request,i=`${s.protocol}//${s.hostname}${s.port?`:${s.port}`:""}${s.path}`,o=await this.generateDpop(s.method,i);s.headers={...s.headers,DPoP:o}}return n(r)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",n){let r=await this.loadToken();try{let s=Gdr({key:r.dpopKey,format:"pem",type:"sec1"}),o=Wdr(s).export({format:"der",type:"spki"}),a=-1;for(let b=0;basync({callerClientConfig:e}={})=>{t?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let n=await Fdr(t||{}),r=Qdr({profile:t?.profile??e?.profile}),s=n[r];if(!s?.login_session)throw new IR(`Profile ${r} does not contain login_session.`,{tryNextLink:!0,logger:t?.logger});let o=await new MFe(s,t,e).loadCredentials();return Ldr(o,"CREDENTIALS_LOGIN","AD")};aBt.fromLoginCredentials=jdr});var FFe=ee(lBt=>{p();var{externalDataInterceptor:Ydr,CredentialsProviderError:LFe,parseKnownFiles:Kdr,getProfileName:zdr}=(Jo(),Un(xf)),{exec:Jdr}=require("node:child_process"),{promisify:Xdr}=require("node:util"),{setCredentialFeature:Zdr}=(Go(),Un(Zg)),epr=(t,e,n)=>{if(e.Version!==1)throw Error(`Profile ${t} credential_process did not return Version 1.`);if(e.AccessKeyId===void 0||e.SecretAccessKey===void 0)throw Error(`Profile ${t} credential_process returned invalid credentials.`);if(e.Expiration){let i=new Date;if(new Date(e.Expiration){let r=e[t];if(e[t]){let s=r.credential_process;if(s!==void 0){let i=Xdr(Ydr?.getTokenRecord?.().exec??Jdr);try{let{stdout:o}=await i(s),a;try{a=JSON.parse(o.trim())}catch{throw Error(`Profile ${t} credential_process returned invalid JSON.`)}return epr(t,a,e)}catch(o){throw new LFe(o.message,{logger:n})}}else throw new LFe(`Profile ${t} did not contain credential_process.`,{logger:n})}else throw new LFe(`Profile ${t} could not be found in shared credentials file.`,{logger:n})},npr=(t={})=>async({callerClientConfig:e}={})=>{t.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let n=await Kdr(t);return tpr(zdr({profile:t.profile??e?.profile}),n,t.logger)};lBt.fromProcess=npr});var UFe=ee(QFe=>{p();var{setCredentialFeature:rpr}=(Go(),Un(Zg)),{CredentialsProviderError:spr,externalDataInterceptor:ipr}=(Jo(),Un(xf)),{readFileSync:opr}=require("node:fs"),dBt=t=>async e=>{t.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:n,roleSessionName:r,webIdentityToken:s,providerId:i,policyArns:o,policy:a,durationSeconds:c}=t,{roleAssumerWithWebIdentity:u}=t;if(!u){let{getDefaultRoleAssumerWithWebIdentity:l}=(gFe(),Un(fFe));u=l({...t.clientConfig,credentialProviderLogger:t.logger,parentClientConfig:{...e?.callerClientConfig,...t.parentClientConfig}},t.clientPlugins)}return u({RoleArn:n,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:s,ProviderId:i,PolicyArns:o,Policy:a,DurationSeconds:c})},uBt="AWS_WEB_IDENTITY_TOKEN_FILE",apr="AWS_ROLE_ARN",cpr="AWS_ROLE_SESSION_NAME",lpr=(t={})=>async e=>{t.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let n=t?.webIdentityTokenFile??process.env[uBt],r=t?.roleArn??process.env[apr],s=t?.roleSessionName??process.env[cpr];if(!n||!r)throw new spr("Web identity configuration not specified",{logger:t.logger});let i=await dBt({...t,webIdentityToken:ipr?.getTokenRecord?.()[n]??opr(n,{encoding:"ascii"}),roleArn:r,roleSessionName:s})(e);return n===process.env[uBt]&&rpr(i,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h"),i};QFe.fromTokenFile=lpr;QFe.fromWebToken=dBt});var yBt=ee(ABt=>{p();var{CredentialsProviderError:due,chain:upr,getProfileName:fBt,parseKnownFiles:dpr}=(Jo(),Un(xf)),{setCredentialFeature:kx}=(Go(),Un(Zg)),ppr=(t,e,n)=>{let r={EcsContainer:async s=>{let{fromHttp:i}=HMe(),{fromContainerMetadata:o}=Fce();return n?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>upr(i(s??{}),o(s))().then($Fe)},Ec2InstanceMetadata:async s=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:i}=Fce();return async()=>i(s)().then($Fe)},Environment:async s=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:i}=DMe();return async()=>i(s)().then($Fe)}};if(t in r)return r[t];throw new due(`Unsupported credential source in profile ${e}. Got ${t}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:n})},$Fe=t=>kx(t,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p"),hpr=(t,{profile:e="default",logger:n}={})=>!!t&&typeof t=="object"&&typeof t.role_arn=="string"&&["undefined","string"].indexOf(typeof t.role_session_name)>-1&&["undefined","string"].indexOf(typeof t.external_id)>-1&&["undefined","string"].indexOf(typeof t.mfa_serial)>-1&&(mpr(t,{profile:e,logger:n})||fpr(t,{profile:e,logger:n})),mpr=(t,{profile:e,logger:n})=>{let r=typeof t.source_profile=="string"&&typeof t.credential_source>"u";return r&&n?.debug?.(` ${e} isAssumeRoleWithSourceProfile source_profile=${t.source_profile}`),r},fpr=(t,{profile:e,logger:n})=>{let r=typeof t.credential_source=="string"&&typeof t.source_profile>"u";return r&&n?.debug?.(` ${e} isCredentialSourceProfile credential_source=${t.credential_source}`),r},gpr=async(t,e,n,r,s={},i)=>{n.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");let o=e[t],{source_profile:a,region:c}=o;if(!n.roleAssumer){let{getDefaultRoleAssumer:l}=(gFe(),Un(fFe));n.roleAssumer=l({...n.clientConfig,credentialProviderLogger:n.logger,parentClientConfig:{...r,...n?.parentClientConfig,region:c??n?.parentClientConfig?.region??r?.region}},n.clientPlugins)}if(a&&a in s)throw new due(`Detected a cycle attempting to resolve credentials for profile ${fBt(n)}. Profiles visited: `+Object.keys(s).join(", "),{logger:n.logger});n.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${a?`source_profile=[${a}]`:`profile=[${t}]`}`);let u=a?i(a,e,n,r,{...s,[a]:!0},pBt(e[a]??{})):(await ppr(o.credential_source,t,n.logger)(n))();if(pBt(o))return u.then(l=>kx(l,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));{let l={RoleArn:o.role_arn,RoleSessionName:o.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:o.external_id,DurationSeconds:parseInt(o.duration_seconds||"3600",10)},{mfa_serial:d}=o;if(d){if(!n.mfaCodeProvider)throw new due(`Profile ${t} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:n.logger,tryNextLink:!1});l.SerialNumber=d,l.TokenCode=await n.mfaCodeProvider(d)}let h=await u;return n.roleAssumer(h,l).then(m=>kx(m,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},pBt=t=>!t.role_arn&&!!t.credential_source,Apr=t=>!!(t&&t.login_session),ypr=async(t,e,n)=>{let{fromLoginCredentials:r}=cBt(),s=await r({...e,profile:t})({callerClientConfig:n});return kx(s,"CREDENTIALS_PROFILE_LOGIN","AC")},Epr=t=>!!t&&typeof t=="object"&&typeof t.credential_process=="string",bpr=async(t,e)=>{let{fromProcess:n}=FFe(),r=await n({...t,profile:e})();return kx(r,"CREDENTIALS_PROFILE_PROCESS","v")},_pr=async(t,e,n={},r)=>{let{fromSSO:s}=KLe();return s({profile:t,logger:n.logger,parentClientConfig:n.parentClientConfig,clientConfig:n.clientConfig})({callerClientConfig:r}).then(i=>e.sso_session?kx(i,"CREDENTIALS_PROFILE_SSO","r"):kx(i,"CREDENTIALS_PROFILE_SSO_LEGACY","t"))},Spr=t=>t&&(typeof t.sso_start_url=="string"||typeof t.sso_account_id=="string"||typeof t.sso_session=="string"||typeof t.sso_region=="string"||typeof t.sso_role_name=="string"),hBt=t=>!!t&&typeof t=="object"&&typeof t.aws_access_key_id=="string"&&typeof t.aws_secret_access_key=="string"&&["undefined","string"].indexOf(typeof t.aws_session_token)>-1&&["undefined","string"].indexOf(typeof t.aws_account_id)>-1,mBt=async(t,e)=>{e?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");let n={accessKeyId:t.aws_access_key_id,secretAccessKey:t.aws_secret_access_key,sessionToken:t.aws_session_token,...t.aws_credential_scope&&{credentialScope:t.aws_credential_scope},...t.aws_account_id&&{accountId:t.aws_account_id}};return kx(n,"CREDENTIALS_PROFILE","n")},Cpr=t=>!!t&&typeof t=="object"&&typeof t.web_identity_token_file=="string"&&typeof t.role_arn=="string"&&["undefined","string"].indexOf(typeof t.role_session_name)>-1,Ipr=async(t,e,n)=>{let{fromTokenFile:r}=UFe(),s=await r({webIdentityTokenFile:t.web_identity_token_file,roleArn:t.role_arn,roleSessionName:t.role_session_name,roleAssumerWithWebIdentity:e.roleAssumerWithWebIdentity,logger:e.logger,parentClientConfig:e.parentClientConfig})({callerClientConfig:n});return kx(s,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")},gBt=async(t,e,n,r,s={},i=!1)=>{let o=e[t];if(Object.keys(s).length>0&&hBt(o))return mBt(o,n);if(i||hpr(o,{profile:t,logger:n.logger}))return gpr(t,e,n,r,s,gBt);if(hBt(o))return mBt(o,n);if(Cpr(o))return Ipr(o,n,r);if(Epr(o))return bpr(n,t);if(Spr(o))return await _pr(t,o,n,r);if(Apr(o))return ypr(t,n,r);throw new due(`Could not resolve credentials using profile: [${t}] in configuration/credentials file(s).`,{logger:n.logger})},xpr=(t={})=>async({callerClientConfig:e}={})=>{t.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");let n=await dpr(t);return gBt(fBt({profile:t.profile??e?.profile}),n,t,e)};ABt.fromIni=xpr});var SBt=ee(hue=>{p();var{ENV_KEY:wpr,ENV_SECRET:Tpr,fromEnv:vpr}=DMe(),{chain:Rpr,CredentialsProviderError:pue,ENV_PROFILE:kpr}=(Jo(),Un(xf)),EBt="AWS_EC2_METADATA_DISABLED",Npr=async t=>{let{ENV_CMDS_FULL_URI:e,ENV_CMDS_RELATIVE_URI:n,fromContainerMetadata:r,fromInstanceMetadata:s}=Fce();if(process.env[n]||process.env[e]){t.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:i}=HMe();return Rpr(i(t),r(t))}return process.env[EBt]&&process.env[EBt]!=="false"?async()=>{throw new pue("EC2 Instance Metadata Service access disabled",{logger:t.logger})}:(t.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),s(t))};function Dpr(t,e){let n=Bpr(t),r,s,i,o,a=async c=>{if(c?.forceRefresh)return o||(o=n(c).then(u=>{i=u}).finally(()=>{o=void 0})),await o,i;if(i?.expiration&&i?.expiration?.getTime(){i=u}).finally(()=>{s=void 0}));else return r=n(c).then(u=>{i=u}).finally(()=>{r=void 0}),a(c);return i};return a}var Bpr=t=>async e=>{let n;for(let r of t)try{return await r(e)}catch(s){if(n=s,s?.tryNextLink)continue;throw s}throw n},bBt=!1,Ppr=(t={})=>Dpr([async()=>{if(t.profile??process.env[kpr])throw process.env[wpr]&&process.env[Tpr]&&(bBt||((t.logger?.warn&&t.logger?.constructor?.name!=="NoOpLogger"?t.logger.warn.bind(t.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING: +>/`.includes(e.x[e.i]);)n+=e.x[e.i++];let r=!1,i={};for(;e.i/".includes(e.x[e.i]));){let l="";for(;e.i/?`.includes(e.x[e.i]);)l+=e.x[e.i++];if(e.trim(),e.x[e.i]!=="=")break;++e.i,e.trim(),l==="__proto__"&&GHe(i),i[l]=e.readAttrValue(),r=!0}if(e.i>=e.z)throw new Error("@aws-sdk XML parse error: unexpected end of input.");if(e.x[e.i]==="/"){if(++e.i,e.i>=e.z||e.x[e.i]!==">")throw new Error("@aws-sdk XML parse error: expected > at the end of self-closing tag.");return++e.i,{tag:n,value:r?i:""}}if(e.x[e.i]!==">")throw new Error("@aws-sdk XML parse error: expected > at the end of opening tag.");++e.i;let s=[],o=[],a=!1;for(;e.i"):e.isNext(""))):e.isNext(""):(a=!0,o.push(e.parseTag()));else{let l="";for(;e.i.`);e.i+=2;let c=e.readTo(">").trim();if(c!==n)throw new Error(`@aws-sdk XML parse error: mismatched tags <${n}> and .`);if(!r&&s.length===0&&!a)return{tag:n,value:""};if(!r&&!a){let l=s.length===1?s[0]:s.join("");return l.trim()===""&&l.includes(` +`)?{tag:n,value:""}:{tag:n,value:l}}let u={};for(let l of s)l.trim()===""&&l.includes(` +`)||(u["#text"]="#text"in u?u["#text"]+l:l);for(let l of o)l.tag==="__proto__"&&GHe(u),l.tag in u?Array.isArray(u[l.tag])?u[l.tag].push(l.value):u[l.tag]=[u[l.tag],l.value]:u[l.tag]=l.value;for(let[l,d]of Object.entries(i))l==="__proto__"&&GHe(u),u[l]=d;return{tag:n,value:u}}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};skipDoctype(){let e=this;e.i+=9;let n=0;for(;e.i"&&n===0){++e.i;return}++e.i}throw new Error("@aws-sdk XML parse error: unclosed DOCTYPE.")}decodeEntities(e){return e.replace(/&(?:#x([0-9a-fA-F]{1,6})|#(\d{1,7})|([a-zA-Z][a-zA-Z0-9]{0,30}));/g,(n,r,i,s)=>r?String.fromCharCode(parseInt(r,16)):i?String.fromCharCode(parseInt(i,10)):t.ENTITIES[s]??"")}};dfe.XmlNode=$He;dfe.XmlText=ufe;dfe.parseXML=VLr});var b$t,eB,mfe=v(()=>{p();b$t=Ot(pfe());Yi();ti();bo();Mi();Y_();jhe();O7();eB=class extends yu{settings;stringDeserializer;constructor(e){super(),this.settings=e,this.stringDeserializer=new L1(e)}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e)}read(e,n,r){let i=jn.of(e),s=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(s).find(u=>!!u.getMemberTraits().eventPayload)){let u={},l=Object.keys(s)[0];return s[l].isBlobSchema()?u[l]=n:u[l]=this.read(s[l],n),u}let a=(this.serdeContext?.utf8Encoder??$l)(n),c=this.parseXml(a);return this.readSchema(e,r?c[r]:c)}readSchema(e,n){let r=jn.of(e);if(r.isUnitSchema())return;let i=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(n))return this.readSchema(r,[n]);if(n==null)return n;if(typeof n=="object"){let s=!!i.xmlFlattened;if(r.isListSchema()){let a=r.getValueSchema(),c=[],u=a.getMergedTraits().xmlName??"member",l=s?n:(n[0]??n)[u];if(l==null)return c;let d=Array.isArray(l)?l:[l];for(let m of d)c.push(this.readSchema(a,m));return c}let o={};if(r.isMapSchema()){let a=r.getKeySchema(),c=r.getValueSchema(),u;s?u=Array.isArray(n)?n:[n]:u=Array.isArray(n.entry)?n.entry:[n.entry];let l=a.getMergedTraits().xmlName??"key",d=c.getMergedTraits().xmlName??"value";for(let m of u){let h=m[l],f=m[d];h==="__proto__"&&_0(o),o[h]=this.readSchema(c,f)}return o}if(r.isStructSchema()){let a=r.isUnionSchema(),c;a&&(c=new J1(n,o));for(let[u,l]of r.structIterator()){let d=l.getMergedTraits(),m=d.httpPayload?d.xmlName??l.getName():l.getMemberTraits().xmlName??u;a&&c.mark(m),n[m]!=null&&(o[u]=this.readSchema(l,n[m]))}return a&&c.writeUnknown(),o}if(r.isDocumentSchema())return n;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(!0)}`)}return r.isListSchema()?[]:r.isMapSchema()||r.isStructSchema()?{}:this.stringDeserializer.read(r,n)}parseXml(e){if(e.length){let n;try{n=(0,b$t.parseXML)(e)}catch(o){throw o&&typeof o=="object"&&Object.defineProperty(o,"$responseBodyText",{value:e}),o}let r="#text",i=Object.keys(n)[0],s=n[i];return s[r]&&(s[i]=s[r],delete s[r]),oO(s)}return{}}}});var iH,HHe=v(()=>{p();ti();bo();Mi();Mi();Y_();iH=class extends yu{settings;buffer;constructor(e){super(),this.settings=e}write(e,n,r=""){this.buffer===void 0&&(this.buffer="");let i=jn.of(e);if(r&&!r.endsWith(".")&&(r+="."),i.isBlobSchema())(typeof n=="string"||n instanceof Uint8Array)&&(this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??vc)(n)));else if(i.isBooleanSchema()||i.isNumericSchema()||i.isStringSchema())n!=null?(this.writeKey(r),this.writeValue(String(n))):i.isIdempotencyToken()&&(this.writeKey(r),this.writeValue(yy()));else if(i.isBigIntegerSchema())n!=null&&(this.writeKey(r),this.writeValue(String(n)));else if(i.isBigDecimalSchema())n!=null&&(this.writeKey(r),this.writeValue(n instanceof co?n.string:String(n)));else if(i.isTimestampSchema()){if(n instanceof Date)switch(this.writeKey(r),Pp(i,this.settings)){case 5:this.writeValue(n.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(py(n));break;case 7:this.writeValue(String(n.getTime()/1e3));break}}else if(i.isDocumentSchema())Array.isArray(n)?this.write(79,n,r):n instanceof Date?this.write(4,n,r):n instanceof Uint8Array?this.write(21,n,r):n&&typeof n=="object"?this.write(143,n,r):(this.writeKey(r),this.writeValue(String(n)));else if(i.isListSchema()){if(Array.isArray(n))if(n.length===0)this.settings.serializeEmptyLists&&(this.writeKey(r),this.writeValue(""));else{let s=i.getValueSchema(),o=this.settings.flattenLists||i.getMergedTraits().xmlFlattened,a=1;for(let c of n){if(c==null)continue;let u=s.getMergedTraits(),l=this.getKey("member",u.xmlName,u.ec2QueryName),d=o?`${r}${a}`:`${r}${l}.${a}`;this.write(s,c,d),++a}}}else if(i.isMapSchema()){if(n&&typeof n=="object"){let s=i.getKeySchema(),o=i.getValueSchema(),a=i.getMergedTraits().xmlFlattened,c=1;for(let u in n){let l=n[u];if(l==null)continue;let d=s.getMergedTraits(),m=this.getKey("key",d.xmlName,d.ec2QueryName),h=a?`${r}${c}.${m}`:`${r}entry.${c}.${m}`,f=o.getMergedTraits(),g=this.getKey("value",f.xmlName,f.ec2QueryName),A=a?`${r}${c}.${g}`:`${r}entry.${c}.${g}`;this.write(s,u,h),this.write(o,l,A),++c}}}else if(i.isStructSchema()){if(n&&typeof n=="object"){let s=!1;for(let[o,a]of i.structIterator()){if(n[o]==null&&!a.isIdempotencyToken())continue;let c=a.getMergedTraits(),u=this.getKey(o,c.xmlName,c.ec2QueryName,"struct"),l=`${r}${u}`;this.write(a,n[o],l),s=!0}if(!s&&i.isUnionSchema()){let{$unknown:o}=n;if(Array.isArray(o)){let[a,c]=o,u=`${r}${a}`;this.write(15,c,u)}}}}else if(!i.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${i.getName(!0)}`)}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");let e=this.buffer;return delete this.buffer,e}getKey(e,n,r,i){let{ec2:s,capitalizeKeys:o}=this.settings;if(s&&r)return r;let a=n??e;return o&&i==="struct"?a[0].toUpperCase()+a.slice(1):a}writeKey(e){e.endsWith(".")&&(e=e.slice(0,e.length-1)),this.buffer+=`&${L_(e)}=`}writeValue(e){this.buffer+=L_(e)}}});var tB,qHe=v(()=>{p();ti();bo();zW();mfe();HHe();tB=class extends CC{options;serializer;deserializer;mixin=new b0;constructor(e){super({defaultNamespace:e.defaultNamespace,errorTypeRegistries:e.errorTypeRegistries}),this.options=e;let n={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:!0};this.serializer=new iH(n),this.deserializer=new eB(n)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(e,n,r){let i=await super.serializeRequest(e,n,r);i.path.endsWith("/")||(i.path+="/"),i.headers["content-type"]="application/x-www-form-urlencoded",(u0(e.input)==="unit"||!i.body)&&(i.body="");let s=e.name.split("#")[1]??e.name;return i.body=`Action=${s}&Version=${this.options.version}`+i.body,i.body.endsWith("&")&&(i.body=i.body.slice(-1)),i}async deserializeResponse(e,n,r){let i=this.deserializer,s=jn.of(e.output),o={};if(r.statusCode>=300){let l=await wm(r.body,n);l.byteLength>0&&Object.assign(o,await i.read(15,l)),await this.handleError(e,n,r,o,this.deserializeMetadata(r))}for(let l in r.headers){let d=r.headers[l];delete r.headers[l],r.headers[l.toLowerCase()]=d}let a=e.name.split("#")[1]??e.name,c=s.isStructSchema()&&this.useNestedResult()?a+"Result":void 0,u=await wm(r.body,n);return u.byteLength>0&&Object.assign(o,await i.read(s,u,c)),o.$metadata=this.deserializeMetadata(r),o}useNestedResult(){return!0}async handleError(e,n,r,i,s){let o=this.loadQueryErrorCode(r,i)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);let a=this.loadQueryError(i)??{},c=this.loadQueryErrorMessage(i);a.message=c,a.Error={Type:a.Type,Code:a.Code,Message:c};let{errorSchema:u,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,a,s,this.mixin.findQueryCompatibleError),d=jn.of(u),m=this.compositeErrorRegistry.getErrorCtor(u)??Error,h=new m({}),f={Type:a.Error.Type,Code:a.Error.Code,Error:a.Error};for(let[g,A]of d.structIterator()){let y=A.getMergedTraits().xmlName??g,E=a[y]??i[y];f[g]=this.deserializer.readSchema(A,E)}throw this.mixin.decorateServiceException(Object.assign(h,l,{$fault:d.getMergedTraits().error,message:c},f),i)}loadQueryErrorCode(e,n){let r=(n.Errors?.[0]?.Error??n.Errors?.Error??n.Error)?.Code;if(r!==void 0)return r;if(e.statusCode==404)return"NotFound"}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){let n=this.loadQueryError(e);return n?.message??n?.Message??e.message??e.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}});var hfe,_$t=v(()=>{p();qHe();hfe=class extends tB{options;constructor(e){super(e),this.options=e;let n={capitalizeKeys:!0,flattenLists:!0,serializeEmptyLists:!1,ec2:!0};Object.assign(this.serializer.settings,n)}getShapeId(){return"aws.protocols#ec2Query"}useNestedResult(){return!1}}});var x$t,jHe,S$t,ffe,VHe=v(()=>{p();x$t=Ot(pfe());Yi();PHe();jHe=(t,e)=>Jhe(t,e).then(n=>{if(n.length){let r;try{r=(0,x$t.parseXML)(n)}catch(a){throw a&&typeof a=="object"&&Object.defineProperty(a,"$responseBodyText",{value:n}),a}let i="#text",s=Object.keys(r)[0],o=r[s];return o[i]&&(o[s]=o[i],delete o[i]),oO(o)}return{}}),S$t=async(t,e)=>{let n=await jHe(t,e);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n},ffe=(t,e)=>{if(e?.Error?.Code!==void 0)return e.Error.Code;if(e?.Code!==void 0)return e.Code;if(t.statusCode==404)return"NotFound"}});var vf,sH,YHe=v(()=>{p();vf=Ot(pfe());ti();bo();Mi();Mi();Y_();sH=class extends yu{settings;stringBuffer;byteBuffer;buffer;constructor(e){super(),this.settings=e}write(e,n){let r=jn.of(e);if(r.isStringSchema()&&typeof n=="string")this.stringBuffer=n;else if(r.isBlobSchema())this.byteBuffer="byteLength"in n?n:(this.serdeContext?.base64Decoder??gu)(n);else{this.buffer=this.writeStruct(r,n,void 0);let i=r.getMergedTraits();i.httpPayload&&!i.xmlName&&this.buffer.withName(r.getName())}}flush(){if(this.byteBuffer!==void 0){let n=this.byteBuffer;return delete this.byteBuffer,n}if(this.stringBuffer!==void 0){let n=this.stringBuffer;return delete this.stringBuffer,n}let e=this.buffer;return this.settings.xmlNamespace&&(e?.attributes?.xmlns||e.addAttribute("xmlns",this.settings.xmlNamespace)),delete this.buffer,e.toString()}writeStruct(e,n,r){let i=e.getMergedTraits(),s=e.isMemberSchema()&&!i.httpPayload?e.getMemberTraits().xmlName??e.getMemberName():i.xmlName??e.getName();if(!s||!e.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${e.getName(!0)}.`);let o=vf.XmlNode.of(s),[a,c]=this.getXmlnsAttribute(e,r);for(let[l,d]of e.structIterator()){let m=n[l];if(m!=null||d.isIdempotencyToken()){if(d.getMergedTraits().xmlAttribute){o.addAttribute(d.getMergedTraits().xmlName??l,this.writeSimple(d,m));continue}if(d.isListSchema())this.writeList(d,m,o,c);else if(d.isMapSchema())this.writeMap(d,m,o,c);else if(d.isStructSchema())o.addChildNode(this.writeStruct(d,m,c));else{let h=vf.XmlNode.of(d.getMergedTraits().xmlName??d.getMemberName());this.writeSimpleInto(d,m,h,c),o.addChildNode(h)}}}let{$unknown:u}=n;if(u&&e.isUnionSchema()&&Array.isArray(u)&&Object.keys(n).length===1){let[l,d]=u,m=vf.XmlNode.of(l);if(typeof d!="string")if(n instanceof vf.XmlNode||n instanceof vf.XmlText)o.addChildNode(n);else throw new Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,d,m,c),o.addChildNode(m)}return c&&o.addAttribute(a,c),o}writeList(e,n,r,i){if(!e.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${e.getName(!0)}`);let s=e.getMergedTraits(),o=e.getValueSchema(),a=o.getMergedTraits(),c=!!a.sparse,u=!!s.xmlFlattened,[l,d]=this.getXmlnsAttribute(e,i),m=(h,f)=>{if(o.isListSchema())this.writeList(o,Array.isArray(f)?f:[f],h,d);else if(o.isMapSchema())this.writeMap(o,f,h,d);else if(o.isStructSchema()){let g=this.writeStruct(o,f,d);h.addChildNode(g.withName(u?s.xmlName??e.getMemberName():a.xmlName??"member"))}else{let g=vf.XmlNode.of(u?s.xmlName??e.getMemberName():a.xmlName??"member");this.writeSimpleInto(o,f,g,d),h.addChildNode(g)}};if(u)for(let h of n)(c||h!=null)&&m(r,h);else{let h=vf.XmlNode.of(s.xmlName??e.getMemberName());d&&h.addAttribute(l,d);for(let f of n)(c||f!=null)&&m(h,f);r.addChildNode(h)}}writeMap(e,n,r,i,s=!1){if(!e.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${e.getName(!0)}`);let o=e.getMergedTraits(),a=e.getKeySchema(),u=a.getMergedTraits().xmlName??"key",l=e.getValueSchema(),d=l.getMergedTraits(),m=d.xmlName??"value",h=!!d.sparse,f=!!o.xmlFlattened,[g,A]=this.getXmlnsAttribute(e,i),y=(E,_,S)=>{let C=vf.XmlNode.of(u,_),[I,w]=this.getXmlnsAttribute(a,A);w&&C.addAttribute(I,w),E.addChildNode(C);let k=vf.XmlNode.of(m);l.isListSchema()?this.writeList(l,S,k,A):l.isMapSchema()?this.writeMap(l,S,k,A,!0):l.isStructSchema()?k=this.writeStruct(l,S,A):this.writeSimpleInto(l,S,k,A),E.addChildNode(k)};if(f)for(let E in n){let _=n[E];if(h||_!=null){let S=vf.XmlNode.of(o.xmlName??e.getMemberName());y(S,E,_),r.addChildNode(S)}}else{let E;s||(E=vf.XmlNode.of(o.xmlName??e.getMemberName()),A&&E.addAttribute(g,A),r.addChildNode(E));for(let _ in n){let S=n[_];if(h||S!=null){let C=vf.XmlNode.of("entry");y(C,_,S),(s?r:E).addChildNode(C)}}}}writeSimple(e,n){if(n===null)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");let r=jn.of(e),i=null;if(n&&typeof n=="object")if(r.isBlobSchema())i=(this.serdeContext?.base64Encoder??vc)(n);else if(r.isTimestampSchema()&&n instanceof Date)switch(Pp(r,this.settings)){case 5:i=n.toISOString().replace(".000Z","Z");break;case 6:i=py(n);break;case 7:i=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",n),i=py(n);break}else{if(r.isBigDecimalSchema()&&n)return n instanceof co?n.string:String(n);throw r.isMapSchema()||r.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${r.getName(!0)}`)}if((r.isBooleanSchema()||r.isNumericSchema()||r.isBigIntegerSchema()||r.isBigDecimalSchema())&&(i=String(n)),r.isStringSchema()&&(n===void 0&&r.isIdempotencyToken()?i=yy():i=String(n)),i===null)throw new Error(`Unhandled schema-value pair ${r.getName(!0)}=${n}`);return i}writeSimpleInto(e,n,r,i){let s=this.writeSimple(e,n),o=jn.of(e),a=new vf.XmlText(s),[c,u]=this.getXmlnsAttribute(o,i);u&&r.addAttribute(c,u),r.addChildNode(a)}getXmlnsAttribute(e,n){let r=e.getMergedTraits(),[i,s]=r.xmlNamespace??[];return s&&s!==n?[i?`xmlns:${i}`:"xmlns",s]:[void 0,void 0]}}});var oH,zHe=v(()=>{p();Y_();mfe();YHe();oH=class extends yu{settings;constructor(e){super(),this.settings=e}createSerializer(){let e=new sH(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new eB(this.settings);return e.setSerdeContext(this.serdeContext),e}}});var gfe,C$t=v(()=>{p();ti();bo();zW();VHe();zHe();gfe=class extends O1{codec;serializer;deserializer;mixin=new b0;constructor(e){super(e);let n={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace};this.codec=new oH(n),this.serializer=new Q1(this.codec.createSerializer(),n),this.deserializer=new F1(this.codec.createDeserializer(),n)}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(e,n,r){let i=await super.serializeRequest(e,n,r),s=jn.of(e.input);if(!i.headers["content-type"]){let o=this.mixin.resolveRestContentType(this.getDefaultContentType(),s);o&&(i.headers["content-type"]=o)}return typeof i.body=="string"&&i.headers["content-type"]===this.getDefaultContentType()&&!i.body.startsWith("'+i.body),i}async deserializeResponse(e,n,r){return super.deserializeResponse(e,n,r)}async handleError(e,n,r,i,s){let o=ffe(r,i)??"Unknown";if(this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace),i.Error&&typeof i.Error=="object")for(let g of Object.keys(i.Error))i[g]=i.Error[g],g.toLowerCase()==="message"&&(i.message=i.Error[g]);i.RequestId&&!s.requestId&&(s.requestId=i.RequestId);let{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,i,s),u=jn.of(a),l=i.Error?.message??i.Error?.Message??i.message??i.Message??"UnknownError",d=this.compositeErrorRegistry.getErrorCtor(a)??Error,m=new d({});await this.deserializeHttpMessage(a,n,r,i);let h={},f=this.codec.createDeserializer();for(let[g,A]of u.structIterator()){let y=A.getMergedTraits().xmlName??g,E=i.Error?.[y]??i[y];h[g]=f.readSchema(A,E)}throw this.mixin.decorateServiceException(Object.assign(m,c,{$fault:u.getMergedTraits().error,message:l},h),i)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(e){for(let[,n]of e.structIterator())if(n.getMergedTraits().httpPayload)return!(n.isStructSchema()||n.isMapSchema()||n.isListSchema());return!1}}});var I$t,w$t=v(()=>{p();Mi();I$t=t=>{if(t!=null)return typeof t=="object"&&"__type"in t&&delete t.__type,bpe(t)}});var T$t,v$t,R$t,k$t=v(()=>{p();T$t=t=>{if(t==null)return t;if(typeof t=="number"||typeof t=="bigint"){let e=new Error(`Received number ${t} where a string was expected.`);return e.name="Warning",console.warn(e),String(t)}if(typeof t=="boolean"){let e=new Error(`Received boolean ${t} where a string was expected.`);return e.name="Warning",console.warn(e),String(t)}return t},v$t=t=>{if(t==null)return t;if(typeof t=="string"){let e=t.toLowerCase();if(t!==""&&e!=="false"&&e!=="true"){let n=new Error(`Received string "${t}" where a boolean was expected.`);n.name="Warning",console.warn(n)}return t!==""&&e!=="false"}return t},R$t=t=>{if(t==null)return t;if(typeof t=="string"){let e=Number(t);if(e.toString()!==t){let n=new Error(`Received string "${t}" where a number was expected.`);return n.name="Warning",console.warn(n),t}return e}return t}});var B$t={};br(B$t,{AwsEc2QueryProtocol:()=>hfe,AwsJson1_0Protocol:()=>ofe,AwsJson1_1Protocol:()=>afe,AwsJsonRpcProtocol:()=>Z1,AwsQueryProtocol:()=>tB,AwsRestJsonProtocol:()=>HC,AwsRestXmlProtocol:()=>gfe,AwsSmithyRpcV2CborProtocol:()=>qhe,JsonCodec:()=>lfe,JsonCodec2:()=>X1,JsonShapeDeserializer:()=>nH,JsonShapeDeserializer2:()=>ZW,JsonShapeSerializer:()=>rH,JsonShapeSerializer2:()=>tH,QueryShapeSerializer:()=>iH,XmlCodec:()=>oH,XmlShapeDeserializer:()=>eB,XmlShapeSerializer:()=>sH,_toBool:()=>v$t,_toNum:()=>R$t,_toStr:()=>T$t,awsExpectUnion:()=>I$t,loadJsonRpcErrorCode:()=>Zhe,loadRestJsonErrorCode:()=>Xhe,loadRestXmlErrorCode:()=>ffe,parseJsonBody:()=>_O,parseJsonErrorBody:()=>o$t,parseXmlBody:()=>jHe,parseXmlErrorBody:()=>S$t});var aH=v(()=>{p();i$t();h$t();f$t();sfe();g$t();E$t();QHe();UHe();ife();OHe();FHe();XW();_$t();qHe();HHe();C$t();zHe();mfe();YHe();VHe();w$t();k$t()});var L7,xO,Afe,N$t,O$t,yfe,KHe,D$t,JHe,cH,P$t,M$t,YLr,zg,zLr,L$t,F$t=v(()=>{p();Xc();L7="ref",xO=-1,Afe=!0,N$t="isSet",O$t="PartitionResult",yfe="booleanEquals",KHe="getAttr",D$t={[L7]:"Endpoint"},JHe={[L7]:O$t},cH={},P$t=[{[L7]:"Region"}],M$t={conditions:[[N$t,[D$t]],[N$t,P$t],["aws.partition",P$t,O$t],[yfe,[{[L7]:"UseFIPS"},Afe]],[yfe,[{[L7]:"UseDualStack"},Afe]],[yfe,[{fn:KHe,argv:[JHe,"supportsDualStack"]},Afe]],[yfe,[{fn:KHe,argv:[JHe,"supportsFIPS"]},Afe]],["stringEquals",[{fn:KHe,argv:[JHe,"name"]},"aws-us-gov"]]],results:[[xO],[xO,"Invalid Configuration: FIPS and custom endpoint are not supported"],[xO,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[D$t,cH],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",cH],[xO,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",cH],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",cH],[xO,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",cH],[xO,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",cH],[xO,"Invalid Configuration: Missing Region"]]},YLr=2,zg=1e8,zLr=new Int32Array([-1,1,-1,0,13,3,1,4,zg+12,2,5,zg+12,3,8,6,4,7,zg+11,5,zg+9,zg+10,4,11,9,6,10,zg+8,7,zg+6,zg+7,5,12,zg+5,6,zg+4,zg+5,3,zg+1,14,4,zg+2,zg+3]),L$t=m0.from(zLr,YLr,M$t.conditions,M$t.results)});var KLr,Q$t,U$t=v(()=>{p();Pa();Xc();F$t();KLr=new h0({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Q$t=(t,e={})=>KLr.get(t,()=>SC(L$t,{endpointParams:t,logger:e.logger}));Vg.aws=H_});var Qp,Efe=v(()=>{p();Yi();Qp=class t extends d0{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var F7,Q7,U7,G7,$7,W7,H7,q7,j7,V7,Y7,XHe=v(()=>{p();Efe();F7=class t extends Qp{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}},Q7=class t extends Qp{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},U7=class t extends Qp{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},G7=class t extends Qp{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},$7=class t extends Qp{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},W7=class t extends Qp{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},H7=class t extends Qp{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}},q7=class t extends Qp{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},j7=class t extends Qp{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},V7=class t extends Qp{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}},Y7=class t extends Qp{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error,this.error_description=e.error_description}}});var JLr,XLr,ZLr,e2r,t2r,n2r,r2r,i2r,s2r,o2r,a2r,c2r,l2r,u2r,d2r,p2r,m2r,h2r,f2r,g2r,qC,A2r,y2r,E2r,b2r,_2r,Eu,x2r,z_,S2r,C2r,K_,I2r,G$t,$$t,w2r,W$t,T2r,v2r,R2r,Cd,H$t,q$t,x0,j$t,V$t,Y$t,z$t,K$t,J$t,X$t,Z$t,eWt,tWt,nWt,ZHe,k2r,B2r,N2r,D2r,rWt,iWt,sWt,eqe,bfe=v(()=>{p();bo();XHe();Efe();JLr="AccessDeniedException",XLr="AuthorizationPendingException",ZLr="AccessToken",e2r="ClientSecret",t2r="CreateToken",n2r="CreateTokenRequest",r2r="CreateTokenResponse",i2r="CodeVerifier",s2r="ExpiredTokenException",o2r="InvalidClientException",a2r="InvalidGrantException",c2r="InvalidRequestException",l2r="InternalServerException",u2r="InvalidScopeException",d2r="IdToken",p2r="RefreshToken",m2r="SlowDownException",h2r="UnauthorizedClientException",f2r="UnsupportedGrantTypeException",g2r="accessToken",qC="client",A2r="clientId",y2r="clientSecret",E2r="codeVerifier",b2r="code",_2r="deviceCode",Eu="error",x2r="expiresIn",z_="error_description",S2r="grantType",C2r="http",K_="httpError",I2r="idToken",G$t="reason",$$t="refreshToken",w2r="redirectUri",W$t="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",T2r="scope",v2r="server",R2r="tokenType",Cd="com.amazonaws.ssooidc",H$t=Tc.for(W$t),q$t=[-3,W$t,"SSOOIDCServiceException",0,[],[]];H$t.registerError(q$t,Qp);x0=Tc.for(Cd),j$t=[-3,Cd,JLr,{[Eu]:qC,[K_]:400},[Eu,G$t,z_],[0,0,0]];x0.registerError(j$t,F7);V$t=[-3,Cd,XLr,{[Eu]:qC,[K_]:400},[Eu,z_],[0,0]];x0.registerError(V$t,Q7);Y$t=[-3,Cd,s2r,{[Eu]:qC,[K_]:400},[Eu,z_],[0,0]];x0.registerError(Y$t,U7);z$t=[-3,Cd,l2r,{[Eu]:v2r,[K_]:500},[Eu,z_],[0,0]];x0.registerError(z$t,G7);K$t=[-3,Cd,o2r,{[Eu]:qC,[K_]:401},[Eu,z_],[0,0]];x0.registerError(K$t,$7);J$t=[-3,Cd,a2r,{[Eu]:qC,[K_]:400},[Eu,z_],[0,0]];x0.registerError(J$t,W7);X$t=[-3,Cd,c2r,{[Eu]:qC,[K_]:400},[Eu,G$t,z_],[0,0,0]];x0.registerError(X$t,H7);Z$t=[-3,Cd,u2r,{[Eu]:qC,[K_]:400},[Eu,z_],[0,0]];x0.registerError(Z$t,q7);eWt=[-3,Cd,m2r,{[Eu]:qC,[K_]:400},[Eu,z_],[0,0]];x0.registerError(eWt,j7);tWt=[-3,Cd,h2r,{[Eu]:qC,[K_]:400},[Eu,z_],[0,0]];x0.registerError(tWt,V7);nWt=[-3,Cd,f2r,{[Eu]:qC,[K_]:400},[Eu,z_],[0,0]];x0.registerError(nWt,Y7);ZHe=[H$t,x0],k2r=[0,Cd,ZLr,8,0],B2r=[0,Cd,e2r,8,0],N2r=[0,Cd,i2r,8,0],D2r=[0,Cd,d2r,8,0],rWt=[0,Cd,p2r,8,0],iWt=[3,Cd,n2r,0,[A2r,y2r,S2r,_2r,b2r,$$t,T2r,w2r,E2r],[0,[()=>B2r,0],0,0,0,[()=>rWt,0],64,0,[()=>N2r,0]],3],sWt=[3,Cd,r2r,0,[g2r,R2r,x2r,$$t,I2r],[[()=>k2r,0],0,1,[()=>rWt,0],[()=>D2r,0]]],eqe=[9,Cd,t2r,{[C2r]:["POST","/token",200]},()=>iWt,()=>sWt]});var oWt,aWt=v(()=>{p();xh();aH();Yg();N1();Yi();ti();Mi();dHe();U$t();bfe();oWt=t=>({apiVersion:"2019-06-10",base64Decoder:t?.base64Decoder??gu,base64Encoder:t?.base64Encoder??vc,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??Q$t,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??MGt,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Op},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _h}],logger:t?.logger??new jg,protocol:t?.protocol??HC,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:ZHe,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:t?.serviceId??"SSO OIDC",sha256:t?.sha256??F_,urlParser:t?.urlParser??Cm,utf8Decoder:t?.utf8Decoder??Jd,utf8Encoder:t?.utf8Encoder??$l})});var _fe,cWt,lWt=v(()=>{p();R7();Pa();xh();Yi();Da();g0();Mi();_fe=Ot(Y1());aWt();cWt=t=>{dC(process.version);let e=_C(t),n=()=>e().then(uC),r=oWt(t);oC(process.version);let i={profile:t?.profile,logger:r.logger};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??cs(j_,i),bodyLengthChecker:t?.bodyLengthChecker??fC,defaultUserAgentProvider:t?.defaultUserAgentProvider??W_({serviceId:r.serviceId,clientVersion:z1.version}),maxAttempts:t?.maxAttempts??cs(kC,t),region:t?.region??cs(Im,{...Tf,...i}),requestHandler:_fe.NodeHttpHandler.create(t?.requestHandler??n),retryMode:t?.retryMode??cs({...NC,default:async()=>(await n()).retryMode||f0},t),streamCollector:t?.streamCollector??_fe.streamCollector,useDualstackEndpoint:t?.useDualstackEndpoint??cs(EC,i),useFipsEndpoint:t?.useFipsEndpoint??cs(bC,i),userAgentAppId:t?.userAgentAppId??cs(FC,i)}}});var uWt,dWt,pWt=v(()=>{p();uWt=t=>{let e=t.httpAuthSchemes,n=t.httpAuthSchemeProvider,r=t.credentials;return{setHttpAuthScheme(i){let s=e.findIndex(o=>o.schemeId===i.schemeId);s===-1?e.push(i):e.splice(s,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){n=i},httpAuthSchemeProvider(){return n},setCredentials(i){r=i},credentials(){return r}}},dWt=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()})});var mWt,hWt=v(()=>{p();Pa();Yi();ti();pWt();mWt=(t,e)=>{let n=Object.assign(QC(t),P_(t),IC(t),uWt(t));return e.forEach(r=>r.configure(n)),Object.assign(t,UC(n),pC(n),wC(n),dWt(n))}});var z7,tqe=v(()=>{p();Pa();Yg();Yi();Da();Xc();ti();g0();bo();dHe();pHe();lWt();hWt();z7=class extends Eh{config;constructor(...[e]){let n=cWt(e||{});super(n),this.initConfig=n;let r=LGt(n),i=OC(r),s=BC(i),o=hy(s),a=o,c=HT(a),u=OGt(c),l=mWt(u,e?.extensions||[]);this.config=l,this.middlewareStack.use(cC(this.config)),this.middlewareStack.use(LC(this.config)),this.middlewareStack.use(YT(this.config)),this.middlewareStack.use(TC(this.config)),this.middlewareStack.use(DC(this.config)),this.middlewareStack.use(PC(this.config)),this.middlewareStack.use(MC(this.config)),this.middlewareStack.use(G_(this.config,{httpAuthSchemeParametersProvider:PGt,identityProviderConfigProvider:async d=>new Ey({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use($_(this.config))}destroy(){super.destroy()}}});var fWt,gWt,AWt,yWt=v(()=>{p();Yi();Xc();pHe();fWt=mC(FGt,"AWSSSOOIDCService","SSOOIDCClient",qT),gWt={},AWt=(t,e,n,r)=>[]});var K7,nqe=v(()=>{p();yWt();bfe();K7=class extends fWt(gWt,AWt,"CreateToken",eqe){}});var P2r,xfe,EWt=v(()=>{p();Yi();nqe();tqe();P2r={CreateTokenCommand:K7},xfe=class extends z7{};lC(P2r,xfe)});var bWt=v(()=>{p();nqe()});var M2r,O2r,_Wt=v(()=>{p();M2r={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},O2r={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"}});var xWt=v(()=>{p()});var J7={};br(J7,{$Command:()=>If,AccessDeniedException:()=>F7,AccessDeniedException$:()=>j$t,AccessDeniedExceptionReason:()=>M2r,AuthorizationPendingException:()=>Q7,AuthorizationPendingException$:()=>V$t,CreateToken$:()=>eqe,CreateTokenCommand:()=>K7,CreateTokenRequest$:()=>iWt,CreateTokenResponse$:()=>sWt,ExpiredTokenException:()=>U7,ExpiredTokenException$:()=>Y$t,InternalServerException:()=>G7,InternalServerException$:()=>z$t,InvalidClientException:()=>$7,InvalidClientException$:()=>K$t,InvalidGrantException:()=>W7,InvalidGrantException$:()=>J$t,InvalidRequestException:()=>H7,InvalidRequestException$:()=>X$t,InvalidRequestExceptionReason:()=>O2r,InvalidScopeException:()=>q7,InvalidScopeException$:()=>Z$t,SSOOIDC:()=>xfe,SSOOIDCClient:()=>z7,SSOOIDCServiceException:()=>Qp,SSOOIDCServiceException$:()=>q$t,SlowDownException:()=>j7,SlowDownException$:()=>eWt,UnauthorizedClientException:()=>V7,UnauthorizedClientException$:()=>tWt,UnsupportedGrantTypeException:()=>Y7,UnsupportedGrantTypeException$:()=>nWt,__Client:()=>Eh,errorTypeRegistries:()=>ZHe});var X7=v(()=>{p();tqe();EWt();bWt();Yi();bfe();_Wt();XHe();xWt();Efe()});var wWt=re(Z7=>{p();var{setTokenFeature:L2r}=(Pa(),wr(q_)),{getBearerTokenEnvKey:F2r}=(xh(),wr(Ihe)),{TokenProviderError:J_,getSSOTokenFilepath:Q2r,parseKnownFiles:U2r,getProfileName:G2r,loadSsoSessionData:$2r,getSSOTokenFromFile:W2r,memoize:H2r,chain:q2r}=(Da(),wr(fy)),{promises:j2r}=require("node:fs"),V2r=({logger:t,signingName:e}={})=>async()=>{if(t?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"),!e)throw new J_("Please pass 'signingName' to compute environment variable key",{logger:t});let n=F2r(e);if(!(n in process.env))throw new J_(`Token not present in '${n}' environment variable`,{logger:t});let r={token:process.env[n]};return L2r(r,"BEARER_SERVICE_ENV_VARS","3"),r},Y2r=300*1e3,rqe="To refresh this SSO session run 'aws sso login' with the corresponding profile.",z2r=async(t,e={},n)=>{let{SSOOIDCClient:r}=(X7(),wr(J7)),i=o=>e.clientConfig?.[o]??e.parentClientConfig?.[o]??n?.[o];return new r(Object.assign({},e.clientConfig??{},{region:t??e.clientConfig?.region,logger:i("logger"),userAgentAppId:i("userAgentAppId")}))},K2r=async(t,e,n={},r)=>{let{CreateTokenCommand:i}=(X7(),wr(J7));return(await z2r(e,n,r)).send(new i({clientId:t.clientId,clientSecret:t.clientSecret,refreshToken:t.refreshToken,grantType:"refresh_token"}))},SWt=t=>{if(t.expiration&&t.expiration.getTime(){if(typeof e>"u")throw new J_(`Value not present for '${t}' in SSO Token${n?". Cannot refresh":""}. ${rqe}`,!1)},{writeFile:J2r}=j2r,X2r=(t,e)=>{let n=Q2r(t),r=JSON.stringify(e,null,2);return J2r(n,r)},CWt=new Map,IWt=(t={})=>async({callerClientConfig:e}={})=>{t.logger?.debug("@aws-sdk/token-providers - fromSso");let n=await U2r(t),r=G2r({profile:t.profile??e?.profile}),i=n[r];if(i){if(!i.sso_session)throw new J_(`Profile '${r}' is missing required property 'sso_session'.`)}else throw new J_(`Profile '${r}' could not be found in shared credentials file.`,!1);let s=i.sso_session,a=(await $2r(t))[s];if(!a)throw new J_(`Sso session '${s}' could not be found in shared credentials file.`,!1);for(let f of["sso_start_url","sso_region"])if(!a[f])throw new J_(`Sso session '${s}' is missing required property '${f}'.`,!1);a.sso_start_url;let c=a.sso_region,u;try{u=await W2r(s)}catch{throw new J_(`The SSO session token associated with profile=${r} was not found or is invalid. ${rqe}`,!1)}SO("accessToken",u.accessToken),SO("expiresAt",u.expiresAt);let{accessToken:l,expiresAt:d}=u,m={token:l,expiration:new Date(d)};if(m.expiration.getTime()-Date.now()>Y2r)return m;let h=CWt.get(s)??0;if(Date.now()-h<30*1e3)return SWt(m),m;SO("clientId",u.clientId,!0),SO("clientSecret",u.clientSecret,!0),SO("refreshToken",u.refreshToken,!0);try{CWt.set(s,Date.now());let f=await K2r(u,c,t,e);SO("accessToken",f.accessToken),SO("expiresIn",f.expiresIn);let g=new Date(Date.now()+f.expiresIn*1e3);try{await X2r(s,{...u,accessToken:f.accessToken,expiresAt:g.toISOString(),refreshToken:f.refreshToken})}catch{}return{token:f.accessToken,expiration:g}}catch{return SWt(m),m}},Z2r=({token:t,logger:e})=>async()=>{if(e?.debug("@aws-sdk/token-providers - fromStatic"),!t||!t.token)throw new J_("Please pass a valid token to fromStatic",!1);return t},eFr=(t={})=>H2r(q2r(IWt(t),async()=>{throw new J_("Could not load token from any providers",!1)}),e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,e=>e.expiration!==void 0);Z7.fromEnvSigningName=V2r;Z7.fromSso=IWt;Z7.fromStatic=Z2r;Z7.nodeProvider=eFr});function tFr(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function nFr(t){return{schemeId:"smithy.api#noAuth"}}var TWt,vWt,RWt,iqe=v(()=>{p();xh();Yi();TWt=async(t,e,n)=>({operation:wc(e).operation,region:await qa(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});vWt=t=>{let e=[];return t.operation==="GetRoleCredentials"?e.push(nFr(t)):e.push(tFr(t)),e},RWt=t=>{let e=GC(t);return Object.assign(e,{authSchemePreference:qa(t.authSchemePreference??[])})}});var kWt,BWt,sqe=v(()=>{p();kWt=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}),BWt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var eK,CO,Sfe,NWt,OWt,Cfe,oqe,DWt,aqe,lH,PWt,MWt,rFr,Kg,iFr,LWt,FWt=v(()=>{p();Xc();eK="ref",CO=-1,Sfe=!0,NWt="isSet",OWt="PartitionResult",Cfe="booleanEquals",oqe="getAttr",DWt={[eK]:"Endpoint"},aqe={[eK]:OWt},lH={},PWt=[{[eK]:"Region"}],MWt={conditions:[[NWt,[DWt]],[NWt,PWt],["aws.partition",PWt,OWt],[Cfe,[{[eK]:"UseFIPS"},Sfe]],[Cfe,[{[eK]:"UseDualStack"},Sfe]],[Cfe,[{fn:oqe,argv:[aqe,"supportsDualStack"]},Sfe]],[Cfe,[{fn:oqe,argv:[aqe,"supportsFIPS"]},Sfe]],["stringEquals",[{fn:oqe,argv:[aqe,"name"]},"aws-us-gov"]]],results:[[CO],[CO,"Invalid Configuration: FIPS and custom endpoint are not supported"],[CO,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[DWt,lH],["https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",lH],[CO,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://portal.sso.{Region}.amazonaws.com",lH],["https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",lH],[CO,"FIPS is enabled but this partition does not support FIPS"],["https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",lH],[CO,"DualStack is enabled but this partition does not support DualStack"],["https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",lH],[CO,"Invalid Configuration: Missing Region"]]},rFr=2,Kg=1e8,iFr=new Int32Array([-1,1,-1,0,13,3,1,4,Kg+12,2,5,Kg+12,3,8,6,4,7,Kg+11,5,Kg+9,Kg+10,4,11,9,6,10,Kg+8,7,Kg+6,Kg+7,5,12,Kg+5,6,Kg+4,Kg+5,3,Kg+1,14,4,Kg+2,Kg+3]),LWt=m0.from(iFr,rFr,MWt.conditions,MWt.results)});var sFr,QWt,UWt=v(()=>{p();Pa();Xc();FWt();sFr=new h0({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),QWt=(t,e={})=>sFr.get(t,()=>SC(LWt,{endpointParams:t,logger:e.logger}));Vg.aws=H_});var X_,Ife=v(()=>{p();Yi();X_=class t extends d0{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var tK,nK,rK,iK,cqe=v(()=>{p();Ife();tK=class t extends X_{name="InvalidRequestException";$fault="client";constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},nK=class t extends X_{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},rK=class t extends X_{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},iK=class t extends X_{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}}});var oFr,aFr,cFr,lFr,uFr,dFr,pFr,mFr,hFr,fFr,gFr,AFr,yFr,EFr,bFr,wfe,Tfe,_Fr,xFr,vfe,SFr,GWt,Rfe,CFr,IFr,wFr,$Wt,TFr,vFr,RFr,S0,WWt,HWt,sK,qWt,jWt,VWt,YWt,lqe,kFr,BFr,NFr,zWt,KWt,JWt,uqe,kfe=v(()=>{p();bo();cqe();Ife();oFr="AccessTokenType",aFr="GetRoleCredentials",cFr="GetRoleCredentialsRequest",lFr="GetRoleCredentialsResponse",uFr="InvalidRequestException",dFr="RoleCredentials",pFr="ResourceNotFoundException",mFr="SecretAccessKeyType",hFr="SessionTokenType",fFr="TooManyRequestsException",gFr="UnauthorizedException",AFr="accountId",yFr="accessKeyId",EFr="accessToken",bFr="account_id",wfe="client",Tfe="error",_Fr="expiration",xFr="http",vfe="httpError",SFr="httpHeader",GWt="httpQuery",Rfe="message",CFr="roleCredentials",IFr="roleName",wFr="role_name",$Wt="smithy.ts.sdk.synthetic.com.amazonaws.sso",TFr="secretAccessKey",vFr="sessionToken",RFr="x-amz-sso_bearer_token",S0="com.amazonaws.sso",WWt=Tc.for($Wt),HWt=[-3,$Wt,"SSOServiceException",0,[],[]];WWt.registerError(HWt,X_);sK=Tc.for(S0),qWt=[-3,S0,uFr,{[Tfe]:wfe,[vfe]:400},[Rfe],[0]];sK.registerError(qWt,tK);jWt=[-3,S0,pFr,{[Tfe]:wfe,[vfe]:404},[Rfe],[0]];sK.registerError(jWt,nK);VWt=[-3,S0,fFr,{[Tfe]:wfe,[vfe]:429},[Rfe],[0]];sK.registerError(VWt,rK);YWt=[-3,S0,gFr,{[Tfe]:wfe,[vfe]:401},[Rfe],[0]];sK.registerError(YWt,iK);lqe=[WWt,sK],kFr=[0,S0,oFr,8,0],BFr=[0,S0,mFr,8,0],NFr=[0,S0,hFr,8,0],zWt=[3,S0,cFr,0,[IFr,AFr,EFr],[[0,{[GWt]:wFr}],[0,{[GWt]:bFr}],[()=>kFr,{[SFr]:RFr}]],3],KWt=[3,S0,lFr,0,[CFr],[[()=>JWt,0]]],JWt=[3,S0,dFr,0,[yFr,TFr,vFr,_Fr],[0,[()=>BFr,0],[()=>NFr,0],1]],uqe=[9,S0,aFr,{[xFr]:["GET","/federation/credentials",200]},()=>zWt,()=>KWt]});var XWt,ZWt=v(()=>{p();xh();aH();Yg();N1();Yi();ti();Mi();iqe();UWt();kfe();XWt=t=>({apiVersion:"2019-06-10",base64Decoder:t?.base64Decoder??gu,base64Encoder:t?.base64Encoder??vc,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??QWt,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??vWt,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Op},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _h}],logger:t?.logger??new jg,protocol:t?.protocol??HC,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sso",errorTypeRegistries:lqe,version:"2019-06-10",serviceTarget:"SWBPortalService"},serviceId:t?.serviceId??"SSO",sha256:t?.sha256??F_,urlParser:t?.urlParser??Cm,utf8Decoder:t?.utf8Decoder??Jd,utf8Encoder:t?.utf8Encoder??$l})});var Bfe,eHt,tHt=v(()=>{p();R7();Pa();xh();Yi();Da();g0();Mi();Bfe=Ot(Y1());ZWt();eHt=t=>{dC(process.version);let e=_C(t),n=()=>e().then(uC),r=XWt(t);oC(process.version);let i={profile:t?.profile,logger:r.logger};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??cs(j_,i),bodyLengthChecker:t?.bodyLengthChecker??fC,defaultUserAgentProvider:t?.defaultUserAgentProvider??W_({serviceId:r.serviceId,clientVersion:z1.version}),maxAttempts:t?.maxAttempts??cs(kC,t),region:t?.region??cs(Im,{...Tf,...i}),requestHandler:Bfe.NodeHttpHandler.create(t?.requestHandler??n),retryMode:t?.retryMode??cs({...NC,default:async()=>(await n()).retryMode||f0},t),streamCollector:t?.streamCollector??Bfe.streamCollector,useDualstackEndpoint:t?.useDualstackEndpoint??cs(EC,i),useFipsEndpoint:t?.useFipsEndpoint??cs(bC,i),userAgentAppId:t?.userAgentAppId??cs(FC,i)}}});var nHt,rHt,iHt=v(()=>{p();nHt=t=>{let e=t.httpAuthSchemes,n=t.httpAuthSchemeProvider,r=t.credentials;return{setHttpAuthScheme(i){let s=e.findIndex(o=>o.schemeId===i.schemeId);s===-1?e.push(i):e.splice(s,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){n=i},httpAuthSchemeProvider(){return n},setCredentials(i){r=i},credentials(){return r}}},rHt=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()})});var sHt,oHt=v(()=>{p();Pa();Yi();ti();iHt();sHt=(t,e)=>{let n=Object.assign(QC(t),P_(t),IC(t),nHt(t));return e.forEach(r=>r.configure(n)),Object.assign(t,UC(n),pC(n),wC(n),rHt(n))}});var oK,dqe=v(()=>{p();Pa();Yg();Yi();Da();Xc();ti();g0();bo();iqe();sqe();tHt();oHt();oK=class extends Eh{config;constructor(...[e]){let n=eHt(e||{});super(n),this.initConfig=n;let r=kWt(n),i=OC(r),s=BC(i),o=hy(s),a=o,c=HT(a),u=RWt(c),l=sHt(u,e?.extensions||[]);this.config=l,this.middlewareStack.use(cC(this.config)),this.middlewareStack.use(LC(this.config)),this.middlewareStack.use(YT(this.config)),this.middlewareStack.use(TC(this.config)),this.middlewareStack.use(DC(this.config)),this.middlewareStack.use(PC(this.config)),this.middlewareStack.use(MC(this.config)),this.middlewareStack.use(G_(this.config,{httpAuthSchemeParametersProvider:TWt,identityProviderConfigProvider:async d=>new Ey({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use($_(this.config))}destroy(){super.destroy()}}});var aHt,cHt,lHt,uHt=v(()=>{p();Yi();Xc();sqe();aHt=mC(BWt,"SWBPortalService","SSOClient",qT),cHt={},lHt=(t,e,n,r)=>[]});var aK,pqe=v(()=>{p();uHt();kfe();aK=class extends aHt(cHt,lHt,"GetRoleCredentials",uqe){}});var DFr,Nfe,dHt=v(()=>{p();Yi();pqe();dqe();DFr={GetRoleCredentialsCommand:aK},Nfe=class extends oK{};lC(DFr,Nfe)});var pHt=v(()=>{p();pqe()});var mHt=v(()=>{p()});var hHt={};br(hHt,{$Command:()=>If,GetRoleCredentials$:()=>uqe,GetRoleCredentialsCommand:()=>aK,GetRoleCredentialsRequest$:()=>zWt,GetRoleCredentialsResponse$:()=>KWt,InvalidRequestException:()=>tK,InvalidRequestException$:()=>qWt,ResourceNotFoundException:()=>nK,ResourceNotFoundException$:()=>jWt,RoleCredentials$:()=>JWt,SSO:()=>Nfe,SSOClient:()=>oK,SSOServiceException:()=>X_,SSOServiceException$:()=>HWt,TooManyRequestsException:()=>rK,TooManyRequestsException$:()=>VWt,UnauthorizedException:()=>iK,UnauthorizedException$:()=>YWt,__Client:()=>Eh,errorTypeRegistries:()=>lqe});var fHt=v(()=>{p();dqe();dHt();pHt();Yi();kfe();cqe();mHt();Ife()});var gHt=re(mqe=>{p();var{GetRoleCredentialsCommand:PFr,SSOClient:MFr}=(fHt(),wr(hHt));mqe.GetRoleCredentialsCommand=PFr;mqe.SSOClient=MFr});var hqe=re(Dfe=>{p();var{CredentialsProviderError:Z_,getSSOTokenFromFile:OFr,getProfileName:LFr,parseKnownFiles:FFr,loadSsoSessionData:QFr}=(Da(),wr(fy)),{setCredentialFeature:AHt}=(Pa(),wr(q_)),{fromSso:UFr}=wWt(),EHt=t=>t&&(typeof t.sso_start_url=="string"||typeof t.sso_account_id=="string"||typeof t.sso_session=="string"||typeof t.sso_region=="string"||typeof t.sso_role_name=="string"),cK=!1,yHt=async({ssoStartUrl:t,ssoSession:e,ssoAccountId:n,ssoRegion:r,ssoRoleName:i,ssoClient:s,clientConfig:o,parentClientConfig:a,callerClientConfig:c,profile:u,filepath:l,configFilepath:d,ignoreCache:m,logger:h})=>{let f,g="To refresh this SSO session run aws sso login with the corresponding profile.";if(e)try{let $=await UFr({profile:u,filepath:l,configFilepath:d,ignoreCache:m,clientConfig:o,parentClientConfig:a,logger:h})({callerClientConfig:c});f={accessToken:$.token,expiresAt:new Date($.expiration).toISOString()}}catch($){throw new Z_($.message,{tryNextLink:cK,logger:h})}else try{f=await OFr(t)}catch{throw new Z_(`The SSO session associated with this profile is invalid. ${g}`,{tryNextLink:cK,logger:h})}if(new Date(f.expiresAt).getTime()-Date.now()<=0)throw new Z_(`The SSO session associated with this profile has expired. ${g}`,{tryNextLink:cK,logger:h});let{accessToken:A}=f,{SSOClient:y,GetRoleCredentialsCommand:E}=gHt(),_=s||new y(Object.assign({},o??{},{logger:o?.logger??c?.logger??a?.logger,region:o?.region??r,userAgentAppId:o?.userAgentAppId??c?.userAgentAppId??a?.userAgentAppId})),S;try{S=await _.send(new E({accountId:n,roleName:i,accessToken:A}))}catch($){throw new Z_($,{tryNextLink:cK,logger:h})}let{roleCredentials:{accessKeyId:C,secretAccessKey:I,sessionToken:w,expiration:k,credentialScope:N,accountId:O}={}}=S;if(!C||!I||!w||!k)throw new Z_("SSO returns an invalid temporary credential.",{tryNextLink:cK,logger:h});let W={accessKeyId:C,secretAccessKey:I,sessionToken:w,expiration:new Date(k),...N&&{credentialScope:N},...O&&{accountId:O}};return e?AHt(W,"CREDENTIALS_SSO","s"):AHt(W,"CREDENTIALS_SSO_LEGACY","u"),W},bHt=(t,e)=>{let{sso_start_url:n,sso_account_id:r,sso_region:i,sso_role_name:s}=t;if(!n||!r||!i||!s)throw new Z_(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(t).join(", ")} +Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:e});return t},GFr=(t={})=>async({callerClientConfig:e}={})=>{t.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:n,ssoAccountId:r,ssoRegion:i,ssoRoleName:s,ssoSession:o}=t,{ssoClient:a}=t,c=LFr({profile:t.profile??e?.profile});if(!n&&!r&&!i&&!s&&!o){let l=(await FFr(t))[c];if(!l)throw new Z_(`Profile ${c} was not found.`,{logger:t.logger});if(!EHt(l))throw new Z_(`Profile ${c} is not configured with SSO credentials.`,{logger:t.logger});if(l?.sso_session){let y=(await QFr(t))[l.sso_session],E=` configurations in profile ${c} and sso-session ${l.sso_session}`;if(i&&i!==y.sso_region)throw new Z_("Conflicting SSO region"+E,{tryNextLink:!1,logger:t.logger});if(n&&n!==y.sso_start_url)throw new Z_("Conflicting SSO start_url"+E,{tryNextLink:!1,logger:t.logger});l.sso_region=y.sso_region,l.sso_start_url=y.sso_start_url}let{sso_start_url:d,sso_account_id:m,sso_region:h,sso_role_name:f,sso_session:g}=bHt(l,t.logger);return yHt({ssoStartUrl:d,ssoSession:g,ssoAccountId:m,ssoRegion:h,ssoRoleName:f,ssoClient:a,clientConfig:t.clientConfig,parentClientConfig:t.parentClientConfig,callerClientConfig:t.callerClientConfig,profile:c,filepath:t.filepath,configFilepath:t.configFilepath,ignoreCache:t.ignoreCache,logger:t.logger})}else{if(!n||!r||!i||!s)throw new Z_('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:t.logger});return yHt({ssoStartUrl:n,ssoSession:o,ssoAccountId:r,ssoRegion:i,ssoRoleName:s,ssoClient:a,clientConfig:t.clientConfig,parentClientConfig:t.parentClientConfig,callerClientConfig:t.callerClientConfig,profile:c,filepath:t.filepath,configFilepath:t.configFilepath,ignoreCache:t.ignoreCache,logger:t.logger})}};Dfe.fromSSO=GFr;Dfe.isSsoProfile=EHt;Dfe.validateSsoProfile=bHt});var Aqe=re(Mfe=>{p();var{SignatureV4:$Fr,signatureV4aContainer:_Ht}=VWe(),lK={CrtSignerV4:null},fqe="X-Amz-S3session-Token",xHt=fqe.toLowerCase(),Pfe=class extends $Fr{async signWithCredentials(e,n,r){let i=SHt(n);e.headers[xHt]=n.sessionToken;let s=this;return CHt(s,i),s.signRequest(e,r??{})}async presignWithCredentials(e,n,r){let i=SHt(n);return delete e.headers[xHt],e.headers[fqe]=n.sessionToken,e.query=e.query??{},e.query[fqe]=n.sessionToken,CHt(this,i),this.presign(e,r)}};function SHt(t){return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,expiration:t.expiration}}function CHt(t,e){let n=t.credentialProvider;t.credentialProvider=()=>(t.credentialProvider=n,Promise.resolve(e))}var gqe=class{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){return typeof lK.CrtSignerV4=="function"?"crt":typeof _Ht.SignatureV4a=="function"?"js":"none"}constructor(e){this.sigv4Signer=new Pfe(e),this.signerOptions=e}async sign(e,n={}){return n.signingRegion==="*"?this.getSigv4aSigner().sign(e,n):this.sigv4Signer.sign(e,n)}async signWithCredentials(e,n,r={}){if(r.signingRegion==="*"){let i=this.getSigv4aSigner(),s=lK.CrtSignerV4;if(s&&i instanceof s)return i.signWithCredentials(e,n,r);throw new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(e,n,r)}async presign(e,n={}){if(n.signingRegion==="*"){let r=this.getSigv4aSigner(),i=lK.CrtSignerV4;if(i&&r instanceof i)return r.presign(e,n);throw new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(e,n)}async presignWithCredentials(e,n,r={}){if(r.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(e,n,r)}getSigv4aSigner(){if(!this.sigv4aSigner){let e=lK.CrtSignerV4,n=_Ht.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!e&&!n)throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(e&&typeof e=="function")this.sigv4aSigner=new e({...this.signerOptions,signingAlgorithm:1});else if(n&&typeof n=="function")this.sigv4aSigner=new n({...this.signerOptions});else throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!n||typeof n!="function")throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new n({...this.signerOptions})}}return this.sigv4aSigner}};Mfe.SignatureV4MultiRegion=gqe;Mfe.SignatureV4SignWithCredentials=Pfe;Mfe.signatureV4CrtContainer=lK});var dH,IO,uK,IHt,DHt,dK,Rm,yqe,wHt,THt,vHt,RHt,kHt,km,Eqe,uH,BHt,NHt,WFr,oa,HFr,PHt,MHt=v(()=>{p();Xc();dH="ref",IO=-1,uK=!0,IHt="isSet",DHt="PartitionResult",dK="booleanEquals",Rm="stringEquals",yqe="getAttr",wHt="us-east-1",THt="sigv4",vHt="sts",RHt="https://sts.{Region}.{PartitionResult#dnsSuffix}",kHt={[dH]:"Endpoint"},km={[dH]:"Region"},Eqe={[dH]:DHt},uH={},BHt=[km],NHt={conditions:[[IHt,[kHt]],[IHt,BHt],["aws.partition",BHt,DHt],[dK,[{[dH]:"UseFIPS"},uK]],[dK,[{[dH]:"UseDualStack"},uK]],[Rm,[km,"aws-global"]],[dK,[{[dH]:"UseGlobalEndpoint"},uK]],[Rm,[km,"eu-central-1"]],[dK,[{fn:yqe,argv:[Eqe,"supportsDualStack"]},uK]],[dK,[{fn:yqe,argv:[Eqe,"supportsFIPS"]},uK]],[Rm,[km,"ap-south-1"]],[Rm,[km,"eu-north-1"]],[Rm,[km,"eu-west-1"]],[Rm,[km,"eu-west-2"]],[Rm,[km,"eu-west-3"]],[Rm,[km,"sa-east-1"]],[Rm,[km,wHt]],[Rm,[km,"us-east-2"]],[Rm,[km,"us-west-2"]],[Rm,[km,"us-west-1"]],[Rm,[km,"ca-central-1"]],[Rm,[km,"ap-southeast-1"]],[Rm,[km,"ap-northeast-1"]],[Rm,[km,"ap-southeast-2"]],[Rm,[{fn:yqe,argv:[Eqe,"name"]},"aws-us-gov"]]],results:[[IO],["https://sts.amazonaws.com",{authSchemes:[{name:THt,signingName:vHt,signingRegion:wHt}]}],[RHt,{authSchemes:[{name:THt,signingName:vHt,signingRegion:"{Region}"}]}],[IO,"Invalid Configuration: FIPS and custom endpoint are not supported"],[IO,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[kHt,uH],["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",uH],[IO,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://sts.{Region}.amazonaws.com",uH],["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",uH],[IO,"FIPS is enabled but this partition does not support FIPS"],["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",uH],[IO,"DualStack is enabled but this partition does not support DualStack"],[RHt,uH],[IO,"Invalid Configuration: Missing Region"]]},WFr=2,oa=1e8,HFr=new Int32Array([-1,1,-1,0,30,3,1,4,oa+14,2,5,oa+14,3,25,6,4,24,7,5,oa+1,8,6,9,oa+13,7,oa+1,10,10,oa+1,11,11,oa+1,12,12,oa+1,13,13,oa+1,14,14,oa+1,15,15,oa+1,16,16,oa+1,17,17,oa+1,18,18,oa+1,19,19,oa+1,20,20,oa+1,21,21,oa+1,22,22,oa+1,23,23,oa+1,oa+2,8,oa+11,oa+12,4,28,26,9,27,oa+10,24,oa+8,oa+9,8,29,oa+7,9,oa+6,oa+7,3,oa+3,31,4,oa+4,oa+5]),PHt=m0.from(HFr,WFr,NHt.conditions,NHt.results)});var qFr,Ofe,bqe=v(()=>{p();Pa();Xc();MHt();qFr=new h0({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Ofe=(t,e={})=>qFr.get(t,()=>SC(PHt,{endpointParams:t,logger:e.logger}));Vg.aws=H_});function FHt(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function _qe(t){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function QHt(t){return{schemeId:"smithy.api#noAuth"}}var OHt,jFr,VFr,LHt,YFr,zFr,UHt,GHt,xqe=v(()=>{p();xh();OHt=Ot(Aqe());Yi();Xc();bqe();jFr=t=>async(e,n,r)=>{if(!r)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let i=await t(e,n,r),s=wc(n)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!s)throw new Error(`getEndpointParameterInstructions() is not defined on '${n.commandName}'`);let o=await Yz(r,{getEndpointParameterInstructions:s},e);return Object.assign(i,o)},VFr=async(t,e,n)=>({operation:wc(e).operation,region:await qa(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),LHt=jFr(VFr);YFr=(t,e,n)=>i=>{let o=t(i).properties?.authSchemes;if(!o)return e(i);let a=[];for(let c of o){let{name:u,properties:l={},...d}=c,m=u.toLowerCase();u!==m&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${u}' to '${m}'`);let h;if(m==="sigv4a"){h="aws.auth#sigv4a";let A=o.find(y=>{let E=y.name.toLowerCase();return E!=="sigv4a"&&E.startsWith("sigv4")});if(OHt.SignatureV4MultiRegion.sigv4aDependency()==="none"&&A)continue}else if(m.startsWith("sigv4"))h="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${m}'`);let f=n[h];if(!f)throw new Error(`Could not find HttpAuthOption create function for '${h}'`);let g=f(i);g.schemeId=h,g.signingProperties={...g.signingProperties||{},...d,...l},a.push(g)}return a},zFr=t=>{let e=[];return t.operation==="AssumeRoleWithWebIdentity"?(e.push(QHt(t)),e.push(_qe(t))):(e.push(FHt(t)),e.push(_qe(t))),e},UHt=YFr(Ofe,zFr,{"aws.auth#sigv4":FHt,"aws.auth#sigv4a":_qe,"smithy.api#noAuth":QHt}),GHt=t=>{let e=GC(t),n=_7(e);return Object.assign(n,{authSchemePreference:qa(t.authSchemePreference??[])})}});var $Ht,WHt,Sqe=v(()=>{p();$Ht=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,useGlobalEndpoint:t.useGlobalEndpoint??!1,defaultSigningName:"sts"}),WHt={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var Jg,Lfe=v(()=>{p();Yi();Jg=class t extends d0{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var pK,mK,hK,fK,gK,AK,yK,Cqe=v(()=>{p();Lfe();pK=class t extends Jg{name="ExpiredTokenException";$fault="client";constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},mK=class t extends Jg{name="MalformedPolicyDocumentException";$fault="client";constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},hK=class t extends Jg{name="PackedPolicyTooLargeException";$fault="client";constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},fK=class t extends Jg{name="RegionDisabledException";$fault="client";constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},gK=class t extends Jg{name="IDPRejectedClaimException";$fault="client";constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},AK=class t extends Jg{name="InvalidIdentityTokenException";$fault="client";constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},yK=class t extends Jg{name="IDPCommunicationErrorException";$fault="client";$retryable={};constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}}});var KFr,JFr,XFr,ZFr,eQr,tQr,Iqe,nQr,rQr,iQr,sQr,wqe,oQr,HHt,aQr,cQr,lQr,uQr,dQr,pQr,mQr,hQr,qHt,jHt,fQr,gQr,AQr,yQr,EQr,bQr,VHt,_Qr,xQr,YHt,SQr,zHt,CQr,IQr,Tqe,wQr,TQr,vQr,RQr,kQr,BQr,NQr,DQr,PQr,MQr,wO,TO,OQr,vO,RO,kO,LQr,KHt,FQr,Cl,JHt,XHt,nB,ZHt,eqt,tqt,nqt,rqt,iqt,sqt,vqe,QQr,UQr,Rqe,oqt,aqt,cqt,lqt,kqe,uqt,dqt,pqt,mqt,GQr,$Qr,Bqe,Nqe,EK=v(()=>{p();bo();Cqe();Lfe();KFr="Arn",JFr="AccessKeyId",XFr="AssumeRole",ZFr="AssumedRoleId",eQr="AssumeRoleRequest",tQr="AssumeRoleResponse",Iqe="AssumedRoleUser",nQr="AssumeRoleWithWebIdentity",rQr="AssumeRoleWithWebIdentityRequest",iQr="AssumeRoleWithWebIdentityResponse",sQr="Audience",wqe="Credentials",oQr="ContextAssertion",HHt="DurationSeconds",aQr="Expiration",cQr="ExternalId",lQr="ExpiredTokenException",uQr="IDPCommunicationErrorException",dQr="IDPRejectedClaimException",pQr="InvalidIdentityTokenException",mQr="Key",hQr="MalformedPolicyDocumentException",qHt="Policy",jHt="PolicyArns",fQr="ProviderArn",gQr="ProvidedContexts",AQr="ProvidedContextsListType",yQr="ProvidedContext",EQr="PolicyDescriptorType",bQr="ProviderId",VHt="PackedPolicySize",_Qr="PackedPolicyTooLargeException",xQr="Provider",YHt="RoleArn",SQr="RegionDisabledException",zHt="RoleSessionName",CQr="SecretAccessKey",IQr="SubjectFromWebIdentityToken",Tqe="SourceIdentity",wQr="SerialNumber",TQr="SessionToken",vQr="Tags",RQr="TokenCode",kQr="TransitiveTagKeys",BQr="Tag",NQr="Value",DQr="WebIdentityToken",PQr="arn",MQr="accessKeySecretType",wO="awsQueryError",TO="client",OQr="clientTokenType",vO="error",RO="httpError",kO="message",LQr="policyDescriptorListType",KHt="smithy.ts.sdk.synthetic.com.amazonaws.sts",FQr="tagListType",Cl="com.amazonaws.sts",JHt=Tc.for(KHt),XHt=[-3,KHt,"STSServiceException",0,[],[]];JHt.registerError(XHt,Jg);nB=Tc.for(Cl),ZHt=[-3,Cl,lQr,{[wO]:["ExpiredTokenException",400],[vO]:TO,[RO]:400},[kO],[0]];nB.registerError(ZHt,pK);eqt=[-3,Cl,uQr,{[wO]:["IDPCommunicationError",400],[vO]:TO,[RO]:400},[kO],[0]];nB.registerError(eqt,yK);tqt=[-3,Cl,dQr,{[wO]:["IDPRejectedClaim",403],[vO]:TO,[RO]:403},[kO],[0]];nB.registerError(tqt,gK);nqt=[-3,Cl,pQr,{[wO]:["InvalidIdentityToken",400],[vO]:TO,[RO]:400},[kO],[0]];nB.registerError(nqt,AK);rqt=[-3,Cl,hQr,{[wO]:["MalformedPolicyDocument",400],[vO]:TO,[RO]:400},[kO],[0]];nB.registerError(rqt,mK);iqt=[-3,Cl,_Qr,{[wO]:["PackedPolicyTooLarge",400],[vO]:TO,[RO]:400},[kO],[0]];nB.registerError(iqt,hK);sqt=[-3,Cl,SQr,{[wO]:["RegionDisabledException",403],[vO]:TO,[RO]:403},[kO],[0]];nB.registerError(sqt,fK);vqe=[JHt,nB],QQr=[0,Cl,MQr,8,0],UQr=[0,Cl,OQr,8,0],Rqe=[3,Cl,Iqe,0,[ZFr,KFr],[0,0],2],oqt=[3,Cl,eQr,0,[YHt,zHt,jHt,qHt,HHt,vQr,kQr,cQr,wQr,RQr,Tqe,gQr],[0,0,()=>mqt,0,1,()=>$Qr,64,0,0,0,0,()=>GQr],2],aqt=[3,Cl,tQr,0,[wqe,Iqe,VHt,Tqe],[[()=>kqe,0],()=>Rqe,1,0]],cqt=[3,Cl,rQr,0,[YHt,zHt,DQr,bQr,jHt,qHt,HHt],[0,0,[()=>UQr,0],0,()=>mqt,0,1],3],lqt=[3,Cl,iQr,0,[wqe,IQr,Iqe,VHt,xQr,sQr,Tqe],[[()=>kqe,0],0,()=>Rqe,1,0,0,0]],kqe=[3,Cl,wqe,0,[JFr,CQr,TQr,aQr],[0,[()=>QQr,0],0,4],4],uqt=[3,Cl,EQr,0,[PQr],[0]],dqt=[3,Cl,yQr,0,[fQr,oQr],[0,0]],pqt=[3,Cl,BQr,0,[mQr,NQr],[0,0],2],mqt=[1,Cl,LQr,0,()=>uqt],GQr=[1,Cl,AQr,0,()=>dqt],$Qr=[1,Cl,FQr,0,()=>pqt],Bqe=[9,Cl,XFr,0,()=>oqt,()=>aqt],Nqe=[9,Cl,nQr,0,()=>cqt,()=>lqt]});var hqt,fqt,gqt=v(()=>{p();xh();aH();hqt=Ot(Aqe());Yg();N1();Yi();ti();Mi();xqe();bqe();EK();fqt=t=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??gu,base64Encoder:t?.base64Encoder??vc,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??Ofe,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??UHt,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Op},{schemeId:"aws.auth#sigv4a",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4a"),signer:new zT},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _h}],logger:t?.logger??new jg,protocol:t?.protocol??tB,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:vqe,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:t?.serviceId??"STS",sha256:t?.sha256??F_,signerConstructor:t?.signerConstructor??hqt.SignatureV4MultiRegion,urlParser:t?.urlParser??Cm,utf8Decoder:t?.utf8Decoder??Jd,utf8Encoder:t?.utf8Encoder??$l})});var Ffe,Aqt,yqt=v(()=>{p();R7();Pa();xh();Yg();Yi();Da();g0();Mi();Ffe=Ot(Y1());gqt();Aqt=t=>{dC(process.version);let e=_C(t),n=()=>e().then(uC),r=fqt(t);oC(process.version);let i={profile:t?.profile,logger:r.logger};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??cs(j_,i),bodyLengthChecker:t?.bodyLengthChecker??fC,defaultUserAgentProvider:t?.defaultUserAgentProvider??W_({serviceId:r.serviceId,clientVersion:z1.version}),httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:s=>s.getIdentityProvider("aws.auth#sigv4")||(async o=>await t.credentialDefaultProvider(o?.__config||{})()),signer:new Op},{schemeId:"aws.auth#sigv4a",identityProvider:s=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new zT},{schemeId:"smithy.api#noAuth",identityProvider:s=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _h}],maxAttempts:t?.maxAttempts??cs(kC,t),region:t?.region??cs(Im,{...Tf,...i}),requestHandler:Ffe.NodeHttpHandler.create(t?.requestHandler??n),retryMode:t?.retryMode??cs({...NC,default:async()=>(await n()).retryMode||f0},t),sigv4aSigningRegionSet:t?.sigv4aSigningRegionSet??cs(x7,i),streamCollector:t?.streamCollector??Ffe.streamCollector,useDualstackEndpoint:t?.useDualstackEndpoint??cs(EC,i),useFipsEndpoint:t?.useFipsEndpoint??cs(bC,i),userAgentAppId:t?.userAgentAppId??cs(FC,i)}}});var Eqt,bqt,_qt=v(()=>{p();Eqt=t=>{let e=t.httpAuthSchemes,n=t.httpAuthSchemeProvider,r=t.credentials;return{setHttpAuthScheme(i){let s=e.findIndex(o=>o.schemeId===i.schemeId);s===-1?e.push(i):e.splice(s,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){n=i},httpAuthSchemeProvider(){return n},setCredentials(i){r=i},credentials(){return r}}},bqt=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()})});var xqt,Sqt=v(()=>{p();Pa();Yi();ti();_qt();xqt=(t,e)=>{let n=Object.assign(QC(t),P_(t),IC(t),Eqt(t));return e.forEach(r=>r.configure(n)),Object.assign(t,UC(n),pC(n),wC(n),bqt(n))}});var rB,Qfe=v(()=>{p();Pa();Yg();Yi();Da();Xc();ti();g0();bo();xqe();Sqe();yqt();Sqt();rB=class extends Eh{config;constructor(...[e]){let n=Aqt(e||{});super(n),this.initConfig=n;let r=$Ht(n),i=OC(r),s=BC(i),o=hy(s),a=o,c=HT(a),u=GHt(c),l=xqt(u,e?.extensions||[]);this.config=l,this.middlewareStack.use(cC(this.config)),this.middlewareStack.use(LC(this.config)),this.middlewareStack.use(YT(this.config)),this.middlewareStack.use(TC(this.config)),this.middlewareStack.use(DC(this.config)),this.middlewareStack.use(PC(this.config)),this.middlewareStack.use(MC(this.config)),this.middlewareStack.use(G_(this.config,{httpAuthSchemeParametersProvider:LHt,identityProviderConfigProvider:async d=>new Ey({"aws.auth#sigv4":d.credentials,"aws.auth#sigv4a":d.credentials})})),this.middlewareStack.use($_(this.config))}destroy(){super.destroy()}}});var Ufe,Gfe,$fe,Dqe=v(()=>{p();Yi();Xc();Sqe();Ufe=mC(WHt,"AWSSecurityTokenServiceV20110615","STSClient",qT),Gfe={},$fe=(t,e,n,r)=>[]});var BO,Wfe=v(()=>{p();Dqe();EK();BO=class extends Ufe(Gfe,$fe,"AssumeRole",Bqe){}});var NO,Hfe=v(()=>{p();Dqe();EK();NO=class extends Ufe(Gfe,$fe,"AssumeRoleWithWebIdentity",Nqe){}});var WQr,qfe,Cqt=v(()=>{p();Yi();Wfe();Hfe();Qfe();WQr={AssumeRoleCommand:BO,AssumeRoleWithWebIdentityCommand:NO},qfe=class extends rB{};lC(WQr,qfe)});var Iqt=v(()=>{p();Wfe();Hfe()});var wqt=v(()=>{p()});var Tqt,vqt,Rqt,kqt,Bqt,Nqt=v(()=>{p();Pa();Wfe();Hfe();Tqt=t=>{if(typeof t?.Arn=="string"){let e=t.Arn.split(":");if(e.length>4&&e[4]!=="")return e[4]}},vqt=async(t,e,n,r={})=>{let i=typeof t=="function"?await t():t,s=typeof e=="function"?await e():e,o="",a=i??s??(o=await dhe(r)());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${i} (credential provider clientConfig)`,`${s} (contextual client)`,`${o} (STS default: AWS_REGION, profile region, or us-east-1)`),a},Rqt=(t,e)=>{let n,r;return async(i,s)=>{if(r=i,!n){let{logger:l=t?.parentClientConfig?.logger,profile:d=t?.parentClientConfig?.profile,region:m,requestHandler:h=t?.parentClientConfig?.requestHandler,credentialProviderLogger:f,userAgentAppId:g=t?.parentClientConfig?.userAgentAppId}=t,A=await vqt(m,t?.parentClientConfig?.region,f,{logger:l,profile:d}),y=!Bqt(h);n=new e({...t,userAgentAppId:g,profile:d,credentialDefaultProvider:()=>async()=>r,region:A,requestHandler:y?h:void 0,logger:l})}let{Credentials:o,AssumedRoleUser:a}=await n.send(new BO(s));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${s.RoleArn}`);let c=Tqt(a),u={accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...c&&{accountId:c}};return E1(u,"CREDENTIALS_STS_ASSUME_ROLE","i"),u}},kqt=(t,e)=>{let n;return async r=>{if(!n){let{logger:c=t?.parentClientConfig?.logger,profile:u=t?.parentClientConfig?.profile,region:l,requestHandler:d=t?.parentClientConfig?.requestHandler,credentialProviderLogger:m,userAgentAppId:h=t?.parentClientConfig?.userAgentAppId}=t,f=await vqt(l,t?.parentClientConfig?.region,m,{logger:c,profile:u}),g=!Bqt(d);n=new e({...t,userAgentAppId:h,profile:u,region:f,requestHandler:g?d:void 0,logger:c})}let{Credentials:i,AssumedRoleUser:s}=await n.send(new NO(r));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);let o=Tqt(s),a={accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,...i.CredentialScope&&{credentialScope:i.CredentialScope},...o&&{accountId:o}};return o&&E1(a,"RESOLVED_ACCOUNT_ID","T"),E1(a,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),a}},Bqt=t=>t?.metadata?.handlerProtocol==="h2"});var Dqt,Pqt,Mqt,HQr,Oqt=v(()=>{p();Nqt();Qfe();Dqt=(t,e)=>e?class extends t{constructor(r){super(r);for(let i of e)this.middlewareStack.use(i)}}:t,Pqt=(t={},e)=>Rqt(t,Dqt(rB,e)),Mqt=(t={},e)=>kqt(t,Dqt(rB,e)),HQr=t=>e=>t({roleAssumer:Pqt(e),roleAssumerWithWebIdentity:Mqt(e),...e})});var Pqe={};br(Pqe,{$Command:()=>If,AssumeRole$:()=>Bqe,AssumeRoleCommand:()=>BO,AssumeRoleRequest$:()=>oqt,AssumeRoleResponse$:()=>aqt,AssumeRoleWithWebIdentity$:()=>Nqe,AssumeRoleWithWebIdentityCommand:()=>NO,AssumeRoleWithWebIdentityRequest$:()=>cqt,AssumeRoleWithWebIdentityResponse$:()=>lqt,AssumedRoleUser$:()=>Rqe,Credentials$:()=>kqe,ExpiredTokenException:()=>pK,ExpiredTokenException$:()=>ZHt,IDPCommunicationErrorException:()=>yK,IDPCommunicationErrorException$:()=>eqt,IDPRejectedClaimException:()=>gK,IDPRejectedClaimException$:()=>tqt,InvalidIdentityTokenException:()=>AK,InvalidIdentityTokenException$:()=>nqt,MalformedPolicyDocumentException:()=>mK,MalformedPolicyDocumentException$:()=>rqt,PackedPolicyTooLargeException:()=>hK,PackedPolicyTooLargeException$:()=>iqt,PolicyDescriptorType$:()=>uqt,ProvidedContext$:()=>dqt,RegionDisabledException:()=>fK,RegionDisabledException$:()=>sqt,STS:()=>qfe,STSClient:()=>rB,STSServiceException:()=>Jg,STSServiceException$:()=>XHt,Tag$:()=>pqt,__Client:()=>Eh,decorateDefaultCredentialProvider:()=>HQr,errorTypeRegistries:()=>vqe,getDefaultRoleAssumer:()=>Pqt,getDefaultRoleAssumerWithWebIdentity:()=>Mqt});var Mqe=v(()=>{p();Qfe();Cqt();Iqt();Yi();EK();Cqe();wqt();Oqt();Lfe()});function qQr(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function jQr(t){return{schemeId:"smithy.api#noAuth"}}var Lqt,Fqt,Qqt,Oqe=v(()=>{p();xh();Yi();Lqt=async(t,e,n)=>({operation:wc(e).operation,region:await qa(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});Fqt=t=>{let e=[];return t.operation==="CreateOAuth2Token"?e.push(jQr(t)):e.push(qQr(t)),e},Qqt=t=>{let e=GC(t);return Object.assign(e,{authSchemePreference:qa(t.authSchemePreference??[])})}});var Uqt,Gqt,Lqe=v(()=>{p();Uqt=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"signin"}),Gqt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var oB,iB,$qt,pH,Wqt,mH,Hqt,Qqe,JT,Fqe,qqt,jqt,sB,Kqt,Vqt,jfe,Sh,Yqt,zqt,VQr,Ro,YQr,Jqt,Xqt=v(()=>{p();Xc();oB="ref",iB=-1,$qt=!1,pH=!0,Wqt="isSet",mH="booleanEquals",Hqt="coalesce",Qqe="PartitionResult",JT="stringEquals",Fqe="getAttr",qqt="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",jqt={[oB]:"Endpoint"},sB={fn:Fqe,argv:[{[oB]:Qqe},"name"]},Kqt={[oB]:"Region"},Vqt={[oB]:Qqe},jfe={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},Sh={},Yqt=[Kqt],zqt={conditions:[[Wqt,Yqt],[mH,[{fn:Hqt,argv:[{[oB]:"IsControlPlane"},$qt]},pH]],[Wqt,[jqt]],["aws.partition",Yqt,Qqe],[mH,[{[oB]:"UseFIPS"},pH]],[JT,[sB,"aws"]],[mH,[{fn:Hqt,argv:[{[oB]:"IsOAuthEndpoint"},$qt]},pH]],[mH,[{[oB]:"UseDualStack"},pH]],[JT,[sB,"aws-cn"]],[JT,[Kqt,"us-gov-west-1"]],[JT,[sB,"aws-us-gov"]],[mH,[{fn:Fqe,argv:[Vqt,"supportsFIPS"]},pH]],[JT,[sB,"aws-iso"]],[JT,[sB,"aws-iso-b"]],[JT,[sB,"aws-iso-f"]],[JT,[sB,"aws-iso-e"]],[JT,[sB,"aws-eusc"]],[mH,[{fn:Fqe,argv:[Vqt,"supportsDualStack"]},pH]]],results:[[iB],["https://signin.{Region}.api.aws",jfe],["https://signin.{Region}.api.amazonwebservices.com.cn",jfe],[qqt,jfe],[iB,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",jfe],["https://{Region}.signin.aws.amazon.com",Sh],["https://{Region}.signin.amazonaws.cn",Sh],["https://{Region}.signin.amazonaws-us-gov.com",Sh],["https://{Region}.signin.c2shome.ic.gov",Sh],["https://{Region}.signin.sc2shome.sgov.gov",Sh],["https://{Region}.signin.csphome.hci.ic.gov",Sh],["https://{Region}.signin.csphome.adc-e.uk",Sh],["https://{Region}.signin.amazonaws-eusc.eu",Sh],["https://signin-fips.amazonaws-us-gov.com",Sh],["https://{Region}.signin-fips.amazonaws-us-gov.com",Sh],["https://{Region}.signin.{PartitionResult#dnsSuffix}",Sh],[iB,"Invalid Configuration: FIPS and custom endpoint are not supported"],[iB,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[jqt,Sh],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Sh],[iB,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",Sh],[iB,"FIPS is enabled but this partition does not support FIPS"],[qqt,Sh],[iB,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",Sh],[iB,"Invalid Configuration: Missing Region"]]},VQr=2,Ro=1e8,YQr=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,Ro+27,6,Ro+4,Ro+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,Ro+7,13,10,Ro+8,14,12,Ro+9,15,13,Ro+10,16,14,Ro+11,17,15,Ro+12,18,16,Ro+13,Ro+16,6,Ro+5,20,7,21,Ro+6,17,Ro+24,Ro+25,6,Ro+4,23,7,27,24,9,Ro+14,25,10,Ro+15,26,11,Ro+22,Ro+23,11,28,Ro+21,17,Ro+20,Ro+21,2,35,30,3,39,31,4,32,Ro+27,6,Ro+4,33,7,Ro+27,34,9,Ro+14,Ro+27,3,39,36,4,38,37,7,Ro+18,Ro+19,6,Ro+4,Ro+17,5,Ro+1,40,8,Ro+2,Ro+3]),Jqt=m0.from(YQr,VQr,zqt.conditions,zqt.results)});var zQr,Zqt,e5t=v(()=>{p();Pa();Xc();Xqt();zQr=new h0({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),Zqt=(t,e={})=>zQr.get(t,()=>SC(Jqt,{endpointParams:t,logger:e.logger}));Vg.aws=H_});var ex,Vfe=v(()=>{p();Yi();ex=class t extends d0{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var bK,_K,xK,SK,Uqe=v(()=>{p();Vfe();bK=class t extends ex{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error}},_K=class t extends ex{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error}},xK=class t extends ex{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error}},SK=class t extends ex{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.error=e.error}}});var KQr,JQr,XQr,ZQr,eUr,tUr,nUr,rUr,iUr,sUr,oUr,aUr,cUr,lUr,uUr,t5t,Gqe,dUr,qqe,n5t,r5t,pUr,aB,$qe,mUr,Wqe,hUr,c5t,jqe,i5t,Bm,zfe,fUr,Yfe,s5t,l5t,o5t,a5t,gUr,AUr,yUr,Hqe,EUr,Ch,u5t,d5t,CK,p5t,m5t,h5t,f5t,Vqe,bUr,g5t,A5t,y5t,E5t,b5t,_5t,x5t,S5t,Yqe,zqe,IK=v(()=>{p();bo();Uqe();Vfe();KQr="AccessDeniedException",JQr="AccessToken",XQr="CreateOAuth2Token",ZQr="CreateOAuth2TokenRequest",eUr="CreateOAuth2TokenRequestBody",tUr="CreateOAuth2TokenResponseBody",nUr="CreateOAuth2TokenResponse",rUr="CreateOAuth2TokenWithIAM",iUr="CreateOAuth2TokenWithIAMRequest",sUr="CreateOAuth2TokenWithIAMResponse",oUr="InternalServerException",aUr="OAuthAccessToken",cUr="RefreshToken",lUr="TooManyRequestsError",uUr="ValidationException",t5t="accessKeyId",Gqe="accessToken",dUr="access_token",qqe="client",n5t="clientId",r5t="codeVerifier",pUr="code",aB="error",$qe="expiresIn",mUr="expires_in",Wqe="grantType",hUr="grant_type",c5t="http",jqe="httpError",i5t="idToken",Bm="jsonName",zfe="message",fUr="resource",Yfe="refreshToken",s5t="redirectUri",l5t="smithy.ts.sdk.synthetic.com.amazonaws.signin",o5t="secretAccessKey",a5t="sessionToken",gUr="server",AUr="tokenInput",yUr="tokenOutput",Hqe="tokenType",EUr="token_type",Ch="com.amazonaws.signin",u5t=Tc.for(l5t),d5t=[-3,l5t,"SigninServiceException",0,[],[]];u5t.registerError(d5t,ex);CK=Tc.for(Ch),p5t=[-3,Ch,KQr,{[aB]:qqe},[aB,zfe],[0,0],2];CK.registerError(p5t,bK);m5t=[-3,Ch,oUr,{[aB]:gUr,[jqe]:500},[aB,zfe],[0,0],2];CK.registerError(m5t,_K);h5t=[-3,Ch,lUr,{[aB]:qqe,[jqe]:429},[aB,zfe],[0,0],2];CK.registerError(h5t,xK);f5t=[-3,Ch,uUr,{[aB]:qqe,[jqe]:400},[aB,zfe],[0,0],2];CK.registerError(f5t,SK);Vqe=[u5t,CK],bUr=[0,Ch,aUr,8,0],g5t=[0,Ch,cUr,8,0],A5t=[3,Ch,JQr,8,[t5t,o5t,a5t],[[0,{[Bm]:t5t}],[0,{[Bm]:o5t}],[0,{[Bm]:a5t}]],3],y5t=[3,Ch,ZQr,0,[AUr],[[()=>E5t,16]],1],E5t=[3,Ch,eUr,0,[n5t,Wqe,pUr,s5t,r5t,Yfe],[[0,{[Bm]:n5t}],[0,{[Bm]:Wqe}],0,[0,{[Bm]:s5t}],[0,{[Bm]:r5t}],[()=>g5t,{[Bm]:Yfe}]],2],b5t=[3,Ch,nUr,0,[yUr],[[()=>_5t,16]],1],_5t=[3,Ch,tUr,0,[Gqe,Hqe,$qe,Yfe,i5t],[[()=>A5t,{[Bm]:Gqe}],[0,{[Bm]:Hqe}],[1,{[Bm]:$qe}],[()=>g5t,{[Bm]:Yfe}],[0,{[Bm]:i5t}]],4],x5t=[3,Ch,iUr,0,[Wqe,fUr],[[0,{[Bm]:hUr}],0],2],S5t=[3,Ch,sUr,0,[Gqe,Hqe,$qe],[[()=>bUr,{[Bm]:dUr}],[0,{[Bm]:EUr}],[1,{[Bm]:mUr}]],3],Yqe=[9,Ch,XQr,{[c5t]:["POST","/v1/token",200]},()=>y5t,()=>b5t],zqe=[9,Ch,rUr,{[c5t]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>x5t,()=>S5t]});var C5t,I5t=v(()=>{p();xh();aH();Yg();N1();Yi();ti();Mi();Oqe();e5t();IK();C5t=t=>({apiVersion:"2023-01-01",base64Decoder:t?.base64Decoder??gu,base64Encoder:t?.base64Encoder??vc,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??Zqt,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??Fqt,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Op},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _h}],logger:t?.logger??new jg,protocol:t?.protocol??HC,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:Vqe,version:"2023-01-01",serviceTarget:"Signin"},serviceId:t?.serviceId??"Signin",sha256:t?.sha256??F_,urlParser:t?.urlParser??Cm,utf8Decoder:t?.utf8Decoder??Jd,utf8Encoder:t?.utf8Encoder??$l})});var Kfe,w5t,T5t=v(()=>{p();R7();Pa();xh();Yi();Da();g0();Mi();Kfe=Ot(Y1());I5t();w5t=t=>{dC(process.version);let e=_C(t),n=()=>e().then(uC),r=C5t(t);oC(process.version);let i={profile:t?.profile,logger:r.logger};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??cs(j_,i),bodyLengthChecker:t?.bodyLengthChecker??fC,defaultUserAgentProvider:t?.defaultUserAgentProvider??W_({serviceId:r.serviceId,clientVersion:z1.version}),maxAttempts:t?.maxAttempts??cs(kC,t),region:t?.region??cs(Im,{...Tf,...i}),requestHandler:Kfe.NodeHttpHandler.create(t?.requestHandler??n),retryMode:t?.retryMode??cs({...NC,default:async()=>(await n()).retryMode||f0},t),streamCollector:t?.streamCollector??Kfe.streamCollector,useDualstackEndpoint:t?.useDualstackEndpoint??cs(EC,i),useFipsEndpoint:t?.useFipsEndpoint??cs(bC,i),userAgentAppId:t?.userAgentAppId??cs(FC,i)}}});var v5t,R5t,k5t=v(()=>{p();v5t=t=>{let e=t.httpAuthSchemes,n=t.httpAuthSchemeProvider,r=t.credentials;return{setHttpAuthScheme(i){let s=e.findIndex(o=>o.schemeId===i.schemeId);s===-1?e.push(i):e.splice(s,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){n=i},httpAuthSchemeProvider(){return n},setCredentials(i){r=i},credentials(){return r}}},R5t=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()})});var B5t,N5t=v(()=>{p();Pa();Yi();ti();k5t();B5t=(t,e)=>{let n=Object.assign(QC(t),P_(t),IC(t),v5t(t));return e.forEach(r=>r.configure(n)),Object.assign(t,UC(n),pC(n),wC(n),R5t(n))}});var wK,Kqe=v(()=>{p();Pa();Yg();Yi();Da();Xc();ti();g0();bo();Oqe();Lqe();T5t();N5t();wK=class extends Eh{config;constructor(...[e]){let n=w5t(e||{});super(n),this.initConfig=n;let r=Uqt(n),i=OC(r),s=BC(i),o=hy(s),a=o,c=HT(a),u=Qqt(c),l=B5t(u,e?.extensions||[]);this.config=l,this.middlewareStack.use(cC(this.config)),this.middlewareStack.use(LC(this.config)),this.middlewareStack.use(YT(this.config)),this.middlewareStack.use(TC(this.config)),this.middlewareStack.use(DC(this.config)),this.middlewareStack.use(PC(this.config)),this.middlewareStack.use(MC(this.config)),this.middlewareStack.use(G_(this.config,{httpAuthSchemeParametersProvider:Lqt,identityProviderConfigProvider:async d=>new Ey({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use($_(this.config))}destroy(){super.destroy()}}});var Jfe,D5t,P5t,Xfe,Jqe=v(()=>{p();Yi();Xc();Lqe();Jfe=mC(Gqt,"Signin","SigninClient",qT),D5t={IsControlPlane:{type:"staticContextParams",value:!1}},P5t={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},Xfe=(t,e,n,r)=>[]});var TK,Xqe=v(()=>{p();Jqe();IK();TK=class extends Jfe(D5t,Xfe,"CreateOAuth2Token",Yqe){}});var vK,Zqe=v(()=>{p();Jqe();IK();vK=class extends Jfe(P5t,Xfe,"CreateOAuth2TokenWithIAM",zqe){}});var _Ur,Zfe,M5t=v(()=>{p();Yi();Xqe();Zqe();Kqe();_Ur={CreateOAuth2TokenCommand:TK,CreateOAuth2TokenWithIAMCommand:vK},Zfe=class extends wK{};lC(_Ur,Zfe)});var O5t=v(()=>{p();Xqe();Zqe()});var xUr,L5t=v(()=>{p();xUr={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"}});var F5t=v(()=>{p()});var Q5t={};br(Q5t,{$Command:()=>If,AccessDeniedException:()=>bK,AccessDeniedException$:()=>p5t,AccessToken$:()=>A5t,CreateOAuth2Token$:()=>Yqe,CreateOAuth2TokenCommand:()=>TK,CreateOAuth2TokenRequest$:()=>y5t,CreateOAuth2TokenRequestBody$:()=>E5t,CreateOAuth2TokenResponse$:()=>b5t,CreateOAuth2TokenResponseBody$:()=>_5t,CreateOAuth2TokenWithIAM$:()=>zqe,CreateOAuth2TokenWithIAMCommand:()=>vK,CreateOAuth2TokenWithIAMRequest$:()=>x5t,CreateOAuth2TokenWithIAMResponse$:()=>S5t,InternalServerException:()=>_K,InternalServerException$:()=>m5t,OAuth2ErrorCode:()=>xUr,Signin:()=>Zfe,SigninClient:()=>wK,SigninServiceException:()=>ex,SigninServiceException$:()=>d5t,TooManyRequestsError:()=>xK,TooManyRequestsError$:()=>h5t,ValidationException:()=>SK,ValidationException$:()=>f5t,__Client:()=>Eh,errorTypeRegistries:()=>Vqe});var U5t=v(()=>{p();Kqe();M5t();O5t();Yi();IK();L5t();Uqe();F5t();Vfe()});var W5t=re($5t=>{p();var{setCredentialFeature:SUr}=(Pa(),wr(q_)),{CredentialsProviderError:cB,parseKnownFiles:CUr,getProfileName:IUr}=(Da(),wr(fy)),{HttpRequest:wUr}=(ti(),wr(vC)),{createHash:TUr,createPrivateKey:vUr,createPublicKey:RUr,sign:kUr}=require("node:crypto"),{promises:e5e}=require("node:fs"),{homedir:BUr}=require("node:os"),{dirname:NUr,join:G5t}=require("node:path"),t5e=class t{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300*1e3;constructor(e,n,r){this.profileData=e,this.init=n,this.callerClientConfig=r}async loadCredentials(){let e=await this.loadToken();if(!e)throw new cB(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let n=e.accessToken,r=Date.now();return new Date(n.expiresAt).getTime()-r<=t.REFRESH_THRESHOLD?this.refresh(e):this.toCredentials(e.accessToken)}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}toCredentials(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken,accountId:e.accountId,expiration:new Date(e.expiresAt)}}async refresh(e){let n=await this.loadToken().catch(()=>e),r=Date.now(),i=new Date(n.accessToken.expiresAt).getTime(),s=new Date(e.accessToken.expiresAt).getTime(),o=i<=r&&s>r?e:n;if(new Date(o.accessToken.expiresAt).getTime()-Date.now()>t.REFRESH_THRESHOLD)return this.toCredentials(o.accessToken);let{SigninClient:c,CreateOAuth2TokenCommand:u}=(U5t(),wr(Q5t)),{logger:l,userAgentAppId:d}=this.callerClientConfig??{},h=(y=>y?.metadata?.handlerProtocol==="h2")(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,f=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,g=new c({credentials:{accessKeyId:"",secretAccessKey:""},region:f,requestHandler:h,logger:l,userAgentAppId:d,...this.init?.clientConfig});this.createDPoPInterceptor(g.middlewareStack);let A={tokenInput:{clientId:o.clientId,refreshToken:o.refreshToken,grantType:"refresh_token"}};try{let y=await g.send(new u(A)),{accessKeyId:E,secretAccessKey:_,sessionToken:S}=y.tokenOutput?.accessToken??{},{refreshToken:C,expiresIn:I}=y.tokenOutput??{};if(!E||!_||!S||!C)throw new cB("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let w=(I??900)*1e3,k=new Date(Date.now()+w),N={...o,accessToken:{...o.accessToken,accessKeyId:E,secretAccessKey:_,sessionToken:S,expiresAt:k.toISOString()},refreshToken:C};return await this.saveToken(N),this.toCredentials(N.accessToken)}catch(y){if(y.name==="AccessDeniedException"){let _=y.error,S;switch(_){case"TOKEN_EXPIRED":S="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":S="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":S="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:S=`Failed to refresh token: ${String(y)}. Please re-authenticate using \`aws login\``}throw new cB(S,{logger:this.logger,tryNextLink:!1})}if(new Date(o.accessToken.expiresAt).getTime()>Date.now())return this.logger?.warn?.(`Failed to refresh token: ${String(y)}. Using existing token until expiry.`),this.toCredentials(o.accessToken);throw new cB(`Failed to refresh token: ${String(y)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let n=await e5e.readFile(e,"utf8"),r=JSON.parse(n),i=["accessToken","clientId","refreshToken","dpopKey"].filter(s=>!r[s]);if(r.accessToken?.accountId||i.push("accountId"),i.length>0)throw new cB(`Token validation failed, missing fields: ${i.join(", ")}`,{logger:this.logger,tryNextLink:!1});return r}catch(n){throw new cB(`Failed to load token from ${e}: ${String(n)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let n=this.getTokenFilePath(),r=NUr(n);try{await e5e.mkdir(r,{recursive:!0})}catch{}await e5e.writeFile(n,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??G5t(BUr(),".aws","login","cache"),n=Buffer.from(this.loginSession,"utf8"),r=TUr("sha256").update(n).digest("hex");return G5t(e,`${r}.json`)}derToRawSignature(e){let n=2;if(e[n]!==2)throw new Error("Invalid DER signature");n++;let r=e[n++],i=e.subarray(n,n+r);if(n+=r,e[n]!==2)throw new Error("Invalid DER signature");n++;let s=e[n++],o=e.subarray(n,n+s);i=i[0]===0?i.subarray(1):i,o=o[0]===0?o.subarray(1):o;let a=Buffer.concat([Buffer.alloc(32-i.length),i]),c=Buffer.concat([Buffer.alloc(32-o.length),o]);return Buffer.concat([a,c])}createDPoPInterceptor(e){e.add(n=>async r=>{if(wUr.isInstance(r.request)){let i=r.request,s=`${i.protocol}//${i.hostname}${i.port?`:${i.port}`:""}${i.path}`,o=await this.generateDpop(i.method,s);i.headers={...i.headers,DPoP:o}}return n(r)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",n){let r=await this.loadToken();try{let i=vUr({key:r.dpopKey,format:"pem",type:"sec1"}),o=RUr(i).export({format:"der",type:"spki"}),a=-1;for(let E=0;Easync({callerClientConfig:e}={})=>{t?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let n=await CUr(t||{}),r=IUr({profile:t?.profile??e?.profile}),i=n[r];if(!i?.login_session)throw new cB(`Profile ${r} does not contain login_session.`,{tryNextLink:!0,logger:t?.logger});let o=await new t5e(i,t,e).loadCredentials();return SUr(o,"CREDENTIALS_LOGIN","AD")};$5t.fromLoginCredentials=DUr});var r5e=re(H5t=>{p();var{externalDataInterceptor:PUr,CredentialsProviderError:n5e,parseKnownFiles:MUr,getProfileName:OUr}=(Da(),wr(fy)),{exec:LUr}=require("node:child_process"),{promisify:FUr}=require("node:util"),{setCredentialFeature:QUr}=(Pa(),wr(q_)),UUr=(t,e,n)=>{if(e.Version!==1)throw Error(`Profile ${t} credential_process did not return Version 1.`);if(e.AccessKeyId===void 0||e.SecretAccessKey===void 0)throw Error(`Profile ${t} credential_process returned invalid credentials.`);if(e.Expiration){let s=new Date;if(new Date(e.Expiration){let r=e[t];if(e[t]){let i=r.credential_process;if(i!==void 0){let s=FUr(PUr?.getTokenRecord?.().exec??LUr);try{let{stdout:o}=await s(i),a;try{a=JSON.parse(o.trim())}catch{throw Error(`Profile ${t} credential_process returned invalid JSON.`)}return UUr(t,a,e)}catch(o){throw new n5e(o.message,{logger:n})}}else throw new n5e(`Profile ${t} did not contain credential_process.`,{logger:n})}else throw new n5e(`Profile ${t} could not be found in shared credentials file.`,{logger:n})},$Ur=(t={})=>async({callerClientConfig:e}={})=>{t.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let n=await MUr(t);return GUr(OUr({profile:t.profile??e?.profile}),n,t.logger)};H5t.fromProcess=$Ur});var s5e=re(i5e=>{p();var{setCredentialFeature:WUr}=(Pa(),wr(q_)),{CredentialsProviderError:HUr,externalDataInterceptor:qUr}=(Da(),wr(fy)),{readFileSync:jUr}=require("node:fs"),j5t=t=>async e=>{t.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:n,roleSessionName:r,webIdentityToken:i,providerId:s,policyArns:o,policy:a,durationSeconds:c}=t,{roleAssumerWithWebIdentity:u}=t;if(!u){let{getDefaultRoleAssumerWithWebIdentity:l}=(Mqe(),wr(Pqe));u=l({...t.clientConfig,credentialProviderLogger:t.logger,parentClientConfig:{...e?.callerClientConfig,...t.parentClientConfig}},t.clientPlugins)}return u({RoleArn:n,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:s,PolicyArns:o,Policy:a,DurationSeconds:c})},q5t="AWS_WEB_IDENTITY_TOKEN_FILE",VUr="AWS_ROLE_ARN",YUr="AWS_ROLE_SESSION_NAME",zUr=(t={})=>async e=>{t.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let n=t?.webIdentityTokenFile??process.env[q5t],r=t?.roleArn??process.env[VUr],i=t?.roleSessionName??process.env[YUr];if(!n||!r)throw new HUr("Web identity configuration not specified",{logger:t.logger});let s=await j5t({...t,webIdentityToken:qUr?.getTokenRecord?.()[n]??jUr(n,{encoding:"ascii"}),roleArn:r,roleSessionName:i})(e);return n===process.env[q5t]&&WUr(s,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h"),s};i5e.fromTokenFile=zUr;i5e.fromWebToken=j5t});var Z5t=re(X5t=>{p();var{CredentialsProviderError:ege,chain:KUr,getProfileName:K5t,parseKnownFiles:JUr}=(Da(),wr(fy)),{setCredentialFeature:XT}=(Pa(),wr(q_)),XUr=(t,e,n)=>{let r={EcsContainer:async i=>{let{fromHttp:s}=uHe(),{fromContainerMetadata:o}=The();return n?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>KUr(s(i??{}),o(i))().then(o5e)},Ec2InstanceMetadata:async i=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:s}=The();return async()=>s(i)().then(o5e)},Environment:async i=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:s}=JWe();return async()=>s(i)().then(o5e)}};if(t in r)return r[t];throw new ege(`Unsupported credential source in profile ${e}. Got ${t}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:n})},o5e=t=>XT(t,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p"),ZUr=(t,{profile:e="default",logger:n}={})=>!!t&&typeof t=="object"&&typeof t.role_arn=="string"&&["undefined","string"].indexOf(typeof t.role_session_name)>-1&&["undefined","string"].indexOf(typeof t.external_id)>-1&&["undefined","string"].indexOf(typeof t.mfa_serial)>-1&&(eGr(t,{profile:e,logger:n})||tGr(t,{profile:e,logger:n})),eGr=(t,{profile:e,logger:n})=>{let r=typeof t.source_profile=="string"&&typeof t.credential_source>"u";return r&&n?.debug?.(` ${e} isAssumeRoleWithSourceProfile source_profile=${t.source_profile}`),r},tGr=(t,{profile:e,logger:n})=>{let r=typeof t.credential_source=="string"&&typeof t.source_profile>"u";return r&&n?.debug?.(` ${e} isCredentialSourceProfile credential_source=${t.credential_source}`),r},nGr=async(t,e,n,r,i={},s)=>{n.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");let o=e[t],{source_profile:a,region:c}=o;if(!n.roleAssumer){let{getDefaultRoleAssumer:l}=(Mqe(),wr(Pqe));n.roleAssumer=l({...n.clientConfig,credentialProviderLogger:n.logger,parentClientConfig:{...r,...n?.parentClientConfig,region:c??n?.parentClientConfig?.region??r?.region}},n.clientPlugins)}if(a&&a in i)throw new ege(`Detected a cycle attempting to resolve credentials for profile ${K5t(n)}. Profiles visited: `+Object.keys(i).join(", "),{logger:n.logger});n.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${a?`source_profile=[${a}]`:`profile=[${t}]`}`);let u=a?s(a,e,n,r,{...i,[a]:!0},V5t(e[a]??{})):(await XUr(o.credential_source,t,n.logger)(n))();if(V5t(o))return u.then(l=>XT(l,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));{let l={RoleArn:o.role_arn,RoleSessionName:o.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:o.external_id,DurationSeconds:parseInt(o.duration_seconds||"3600",10)},{mfa_serial:d}=o;if(d){if(!n.mfaCodeProvider)throw new ege(`Profile ${t} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:n.logger,tryNextLink:!1});l.SerialNumber=d,l.TokenCode=await n.mfaCodeProvider(d)}let m=await u;return n.roleAssumer(m,l).then(h=>XT(h,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},V5t=t=>!t.role_arn&&!!t.credential_source,rGr=t=>!!(t&&t.login_session),iGr=async(t,e,n)=>{let{fromLoginCredentials:r}=W5t(),i=await r({...e,profile:t})({callerClientConfig:n});return XT(i,"CREDENTIALS_PROFILE_LOGIN","AC")},sGr=t=>!!t&&typeof t=="object"&&typeof t.credential_process=="string",oGr=async(t,e)=>{let{fromProcess:n}=r5e(),r=await n({...t,profile:e})();return XT(r,"CREDENTIALS_PROFILE_PROCESS","v")},aGr=async(t,e,n={},r)=>{let{fromSSO:i}=hqe();return i({profile:t,logger:n.logger,parentClientConfig:n.parentClientConfig,clientConfig:n.clientConfig})({callerClientConfig:r}).then(s=>e.sso_session?XT(s,"CREDENTIALS_PROFILE_SSO","r"):XT(s,"CREDENTIALS_PROFILE_SSO_LEGACY","t"))},cGr=t=>t&&(typeof t.sso_start_url=="string"||typeof t.sso_account_id=="string"||typeof t.sso_session=="string"||typeof t.sso_region=="string"||typeof t.sso_role_name=="string"),Y5t=t=>!!t&&typeof t=="object"&&typeof t.aws_access_key_id=="string"&&typeof t.aws_secret_access_key=="string"&&["undefined","string"].indexOf(typeof t.aws_session_token)>-1&&["undefined","string"].indexOf(typeof t.aws_account_id)>-1,z5t=async(t,e)=>{e?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");let n={accessKeyId:t.aws_access_key_id,secretAccessKey:t.aws_secret_access_key,sessionToken:t.aws_session_token,...t.aws_credential_scope&&{credentialScope:t.aws_credential_scope},...t.aws_account_id&&{accountId:t.aws_account_id}};return XT(n,"CREDENTIALS_PROFILE","n")},lGr=t=>!!t&&typeof t=="object"&&typeof t.web_identity_token_file=="string"&&typeof t.role_arn=="string"&&["undefined","string"].indexOf(typeof t.role_session_name)>-1,uGr=async(t,e,n)=>{let{fromTokenFile:r}=s5e(),i=await r({webIdentityTokenFile:t.web_identity_token_file,roleArn:t.role_arn,roleSessionName:t.role_session_name,roleAssumerWithWebIdentity:e.roleAssumerWithWebIdentity,logger:e.logger,parentClientConfig:e.parentClientConfig})({callerClientConfig:n});return XT(i,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")},J5t=async(t,e,n,r,i={},s=!1)=>{let o=e[t];if(Object.keys(i).length>0&&Y5t(o))return z5t(o,n);if(s||ZUr(o,{profile:t,logger:n.logger}))return nGr(t,e,n,r,i,J5t);if(Y5t(o))return z5t(o,n);if(lGr(o))return uGr(o,n,r);if(sGr(o))return oGr(n,t);if(cGr(o))return await aGr(t,o,n,r);if(rGr(o))return iGr(t,n,r);throw new ege(`Could not resolve credentials using profile: [${t}] in configuration/credentials file(s).`,{logger:n.logger})},dGr=(t={})=>async({callerClientConfig:e}={})=>{t.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");let n=await JUr(t);return J5t(K5t({profile:t.profile??e?.profile}),n,t,e)};X5t.fromIni=dGr});var r3t=re(nge=>{p();var{ENV_KEY:pGr,ENV_SECRET:mGr,fromEnv:hGr}=JWe(),{chain:fGr,CredentialsProviderError:tge,ENV_PROFILE:gGr}=(Da(),wr(fy)),e3t="AWS_EC2_METADATA_DISABLED",AGr=async t=>{let{ENV_CMDS_FULL_URI:e,ENV_CMDS_RELATIVE_URI:n,fromContainerMetadata:r,fromInstanceMetadata:i}=The();if(process.env[n]||process.env[e]){t.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:s}=uHe();return fGr(s(t),r(t))}return process.env[e3t]&&process.env[e3t]!=="false"?async()=>{throw new tge("EC2 Instance Metadata Service access disabled",{logger:t.logger})}:(t.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),i(t))};function yGr(t,e){let n=EGr(t),r,i,s,o,a=async c=>{if(c?.forceRefresh)return o||(o=n(c).then(u=>{s=u}).finally(()=>{o=void 0})),await o,s;if(s?.expiration&&s?.expiration?.getTime(){s=u}).catch(()=>{}).finally(()=>{i=void 0}));else return r=n(c).then(u=>{s=u}).finally(()=>{r=void 0}),a(c);return s};return a}var EGr=t=>async e=>{let n;for(let r of t)try{return await r(e)}catch(i){if(n=i,i?.tryNextLink)continue;throw i}throw n},t3t=!1,bGr=(t={})=>yGr([async()=>{if(t.profile??process.env[gGr])throw process.env[pGr]&&process.env[mGr]&&(t3t||((t.logger?.warn&&t.logger?.constructor?.name!=="NoOpLogger"?t.logger.warn.bind(t.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING: Multiple credential sources detected: Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set. This SDK will proceed with the AWS_PROFILE value. @@ -100,46 +100,44 @@ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.ht However, a future version may change this behavior to prefer the ENV static credentials. Please ensure that your environment only sets either the AWS_PROFILE or the AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair. -`),bBt=!0)),new pue("AWS_PROFILE is set, skipping fromEnv provider.",{logger:t.logger,tryNextLink:!0});return t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),vpr(t)()},async e=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:n,ssoAccountId:r,ssoRegion:s,ssoRoleName:i,ssoSession:o}=t;if(!n&&!r&&!s&&!i&&!o)throw new pue("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:t.logger});let{fromSSO:a}=KLe();return a(t)(e)},async e=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:n}=yBt();return n(t)(e)},async e=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:n}=FFe();return n(t)(e)},async e=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:n}=UFe();return n(t)(e)},async()=>(t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await Npr(t))()),async()=>{throw new pue("Could not load credentials from any providers",{tryNextLink:!1,logger:t.logger})}],_Bt),Opr=t=>t?.expiration!==void 0,_Bt=t=>t?.expiration!==void 0&&t.expiration.getTime()-Date.now()<3e5;hue.credentialsTreatedAsExpired=_Bt;hue.credentialsWillNeedRefresh=Opr;hue.defaultProvider=Ppr});var IBt=ee(CBt=>{p();var{EventStreamCodec:Mpr}=(s2(),Un(r2)),{Transform:Lpr,Readable:Fpr,PassThrough:Qpr,pipeline:Upr}=require("node:stream"),GFe=class extends Lpr{priorSignature;messageSigner;eventStreamCodec;systemClockOffsetProvider;staticCredentials;constructor(e){super({autoDestroy:!0,readableObjectMode:!0,writableObjectMode:!0,...e}),this.priorSignature=e.priorSignature,this.eventStreamCodec=e.eventStreamCodec,this.messageSigner=e.messageSigner,this.systemClockOffsetProvider=e.systemClockOffsetProvider,this.staticCredentials=e.credentials?.()}async _transform(e,n,r){try{let s=new Date(Date.now()+await this.systemClockOffsetProvider()),i={":date":{type:"timestamp",value:s}},o=await this.messageSigner.sign({message:{body:e,headers:i},priorSignature:this.priorSignature},{signingDate:s,eventStreamCredentials:await this.staticCredentials});this.priorSignature=o.signature;let a=this.eventStreamCodec.encode({headers:{...i,":chunk-signature":{type:"binary",value:$pr(o.signature)}},body:e});return this.push(a),r()}catch(s){r(s)}}};function $pr(t){let e=Buffer.from(t,"hex");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)}var WFe=class{messageSigner;eventStreamCodec;systemClockOffsetProvider;credentials;constructor(e){this.messageSigner=e.messageSigner,this.eventStreamCodec=new Mpr(e.utf8Encoder,e.utf8Decoder),this.systemClockOffsetProvider=async()=>e.systemClockOffset??0,this.credentials=e.credentials}async handle(e,n,r={}){let s=n.request,{body:i,query:o}=s;if(!(i instanceof Fpr))throw new Error("Eventstream payload must be a Readable stream.");s.body=new Qpr({objectMode:!0});let c=s.headers?.authorization?.match(/Signature=([\w]+)$/)?.[1]??o?.["X-Amz-Signature"]??"";r.__staticSignature&&(c="");let u=new GFe({priorSignature:c,eventStreamCodec:this.eventStreamCodec,messageSigner:await this.messageSigner(),systemClockOffsetProvider:this.systemClockOffsetProvider,credentials:this.credentials}),l,d=new Promise((m,f)=>{l=()=>m(void 0),Upr(i,u,s.body,g=>{g&&f(new Error(`Pipeline error in @aws-sdk/eventstream-handler-node: ${g.message}`,{cause:g}))})}),h;try{h=await Promise.race([e(n),d])}catch(m){throw s.body.end(),m}finally{l()}return h}},Gpr=t=>new WFe(t);CBt.eventStreamPayloadHandlerProvider=Gpr});var vBt=ee(R8=>{"use strict";p();var Wpr=(Go(),Un(Zg)),qpr=($d(),Un(y2)),Hd=(Jo(),Un(xf)),Hpr=require("node:fs"),Vpr=({logger:t,signingName:e}={})=>async()=>{if(t?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"),!e)throw new Hd.TokenProviderError("Please pass 'signingName' to compute environment variable key",{logger:t});let n=qpr.getBearerTokenEnvKey(e);if(!(n in process.env))throw new Hd.TokenProviderError(`Token not present in '${n}' environment variable`,{logger:t});let r={token:process.env[n]};return Wpr.setTokenFeature(r,"BEARER_SERVICE_ENV_VARS","3"),r},jpr=300*1e3,qFe="To refresh this SSO session run 'aws sso login' with the corresponding profile.",Ypr=async(t,e={},n)=>{let{SSOOIDCClient:r}=await Promise.resolve().then(()=>(X6(),J6)),s=o=>e.clientConfig?.[o]??e.parentClientConfig?.[o]??n?.[o];return new r(Object.assign({},e.clientConfig??{},{region:t??e.clientConfig?.region,logger:s("logger"),userAgentAppId:s("userAgentAppId")}))},Kpr=async(t,e,n={},r)=>{let{CreateTokenCommand:s}=await Promise.resolve().then(()=>(X6(),J6));return(await Ypr(e,n,r)).send(new s({clientId:t.clientId,clientSecret:t.clientSecret,refreshToken:t.refreshToken,grantType:"refresh_token"}))},xBt=t=>{if(t.expiration&&t.expiration.getTime(){if(typeof e>"u")throw new Hd.TokenProviderError(`Value not present for '${t}' in SSO Token${n?". Cannot refresh":""}. ${qFe}`,!1)},{writeFile:zpr}=Hpr.promises,Jpr=(t,e)=>{let n=Hd.getSSOTokenFilepath(t),r=JSON.stringify(e,null,2);return zpr(n,r)},wBt=new Date(0),TBt=(t={})=>async({callerClientConfig:e}={})=>{t.logger?.debug("@aws-sdk/token-providers - fromSso");let n=await Hd.parseKnownFiles(t),r=Hd.getProfileName({profile:t.profile??e?.profile}),s=n[r];if(s){if(!s.sso_session)throw new Hd.TokenProviderError(`Profile '${r}' is missing required property 'sso_session'.`)}else throw new Hd.TokenProviderError(`Profile '${r}' could not be found in shared credentials file.`,!1);let i=s.sso_session,a=(await Hd.loadSsoSessionData(t))[i];if(!a)throw new Hd.TokenProviderError(`Sso session '${i}' could not be found in shared credentials file.`,!1);for(let m of["sso_start_url","sso_region"])if(!a[m])throw new Hd.TokenProviderError(`Sso session '${i}' is missing required property '${m}'.`,!1);a.sso_start_url;let c=a.sso_region,u;try{u=await Hd.getSSOTokenFromFile(i)}catch{throw new Hd.TokenProviderError(`The SSO session token associated with profile=${r} was not found or is invalid. ${qFe}`,!1)}OB("accessToken",u.accessToken),OB("expiresAt",u.expiresAt);let{accessToken:l,expiresAt:d}=u,h={token:l,expiration:new Date(d)};if(h.expiration.getTime()-Date.now()>jpr)return h;if(Date.now()-wBt.getTime()<30*1e3)return xBt(h),h;OB("clientId",u.clientId,!0),OB("clientSecret",u.clientSecret,!0),OB("refreshToken",u.refreshToken,!0);try{wBt.setTime(Date.now());let m=await Kpr(u,c,t,e);OB("accessToken",m.accessToken),OB("expiresIn",m.expiresIn);let f=new Date(Date.now()+m.expiresIn*1e3);try{await Jpr(i,{...u,accessToken:m.accessToken,expiresAt:f.toISOString(),refreshToken:m.refreshToken})}catch{}return{token:m.accessToken,expiration:f}}catch{return xBt(h),h}},Xpr=({token:t,logger:e})=>async()=>{if(e?.debug("@aws-sdk/token-providers - fromStatic"),!t||!t.token)throw new Hd.TokenProviderError("Please pass a valid token to fromStatic",!1);return t},Zpr=(t={})=>Hd.memoize(Hd.chain(TBt(t),async()=>{throw new Hd.TokenProviderError("Could not load token from any providers",!1)}),e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,e=>e.expiration!==void 0);R8.fromEnvSigningName=Vpr;R8.fromSso=TBt;R8.fromStatic=Xpr;R8.nodeProvider=Zpr});var MBt=ee(gue=>{"use strict";p();Object.defineProperty(gue,"__esModule",{value:!0});gue.bdd=void 0;var ehr=(Ta(),Un(Eae)),N8="ref",MB=-1,mue=!0,RBt="isSet",OBt="PartitionResult",fue="booleanEquals",kBt="getAttr",NBt={[N8]:"Endpoint"},DBt={[N8]:OBt},k8={},BBt=[{[N8]:"Region"}],PBt={conditions:[[RBt,[NBt]],[RBt,BBt],["aws.partition",BBt,OBt],[fue,[{[N8]:"UseFIPS"},mue]],[fue,[{[N8]:"UseDualStack"},mue]],[fue,[{fn:kBt,argv:[DBt,"supportsDualStack"]},mue]],[fue,[{fn:kBt,argv:[DBt,"supportsFIPS"]},mue]]],results:[[MB],[MB,"Invalid Configuration: FIPS and custom endpoint are not supported"],[MB,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[NBt,k8],["https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",k8],[MB,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}",k8],[MB,"FIPS is enabled but this partition does not support FIPS"],["https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}",k8],[MB,"DualStack is enabled but this partition does not support DualStack"],["https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}",k8],[MB,"Invalid Configuration: Missing Region"]]},thr=2,tA=1e8,nhr=new Int32Array([-1,1,-1,0,12,3,1,4,tA+11,2,5,tA+11,3,8,6,4,7,tA+10,5,tA+8,tA+9,4,10,9,6,tA+6,tA+7,5,11,tA+5,6,tA+4,tA+5,3,tA+1,13,4,tA+2,tA+3]);gue.bdd=ehr.BinaryDecisionDiagram.from(nhr,thr,PBt.conditions,PBt.results)});var LBt=ee(Aue=>{"use strict";p();Object.defineProperty(Aue,"__esModule",{value:!0});Aue.defaultEndpointResolver=void 0;var rhr=(Go(),Un(Zg)),HFe=(Ta(),Un(Eae)),shr=MBt(),ihr=new HFe.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),ohr=(t,e={})=>ihr.get(t,()=>(0,HFe.decideEndpoint)(shr.bdd,{endpointParams:t,logger:e.logger}));Aue.defaultEndpointResolver=ohr;HFe.customEndpointFunctions.aws=rhr.awsEndpointFunctions});var yue=ee(V2=>{"use strict";p();Object.defineProperty(V2,"__esModule",{value:!0});V2.BedrockRuntimeServiceException=V2.__ServiceException=void 0;var FBt=(Is(),Un(oB));Object.defineProperty(V2,"__ServiceException",{enumerable:!0,get:function(){return FBt.ServiceException}});var VFe=class t extends FBt.ServiceException{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};V2.BedrockRuntimeServiceException=VFe});var iQe=ee(Ya=>{"use strict";p();Object.defineProperty(Ya,"__esModule",{value:!0});Ya.ModelStreamErrorException=Ya.ModelTimeoutException=Ya.ModelNotReadyException=Ya.ModelErrorException=Ya.ServiceUnavailableException=Ya.ServiceQuotaExceededException=Ya.ResourceNotFoundException=Ya.ConflictException=Ya.ValidationException=Ya.ThrottlingException=Ya.InternalServerException=Ya.AccessDeniedException=void 0;var Zy=yue(),jFe=class t extends Zy.BedrockRuntimeServiceException{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}};Ya.AccessDeniedException=jFe;var YFe=class t extends Zy.BedrockRuntimeServiceException{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,t.prototype)}};Ya.InternalServerException=YFe;var KFe=class t extends Zy.BedrockRuntimeServiceException{name="ThrottlingException";$fault="client";constructor(e){super({name:"ThrottlingException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}};Ya.ThrottlingException=KFe;var zFe=class t extends Zy.BedrockRuntimeServiceException{name="ValidationException";$fault="client";constructor(e){super({name:"ValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}};Ya.ValidationException=zFe;var JFe=class t extends Zy.BedrockRuntimeServiceException{name="ConflictException";$fault="client";constructor(e){super({name:"ConflictException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}};Ya.ConflictException=JFe;var XFe=class t extends Zy.BedrockRuntimeServiceException{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}};Ya.ResourceNotFoundException=XFe;var ZFe=class t extends Zy.BedrockRuntimeServiceException{name="ServiceQuotaExceededException";$fault="client";constructor(e){super({name:"ServiceQuotaExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}};Ya.ServiceQuotaExceededException=ZFe;var eQe=class t extends Zy.BedrockRuntimeServiceException{name="ServiceUnavailableException";$fault="server";constructor(e){super({name:"ServiceUnavailableException",$fault:"server",...e}),Object.setPrototypeOf(this,t.prototype)}};Ya.ServiceUnavailableException=eQe;var tQe=class t extends Zy.BedrockRuntimeServiceException{name="ModelErrorException";$fault="client";originalStatusCode;resourceName;constructor(e){super({name:"ModelErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.originalStatusCode=e.originalStatusCode,this.resourceName=e.resourceName}};Ya.ModelErrorException=tQe;var nQe=class t extends Zy.BedrockRuntimeServiceException{name="ModelNotReadyException";$fault="client";$retryable={};constructor(e){super({name:"ModelNotReadyException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}};Ya.ModelNotReadyException=nQe;var rQe=class t extends Zy.BedrockRuntimeServiceException{name="ModelTimeoutException";$fault="client";constructor(e){super({name:"ModelTimeoutException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}};Ya.ModelTimeoutException=rQe;var sQe=class t extends Zy.BedrockRuntimeServiceException{name="ModelStreamErrorException";$fault="client";originalStatusCode;originalMessage;constructor(e){super({name:"ModelStreamErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.originalStatusCode=e.originalStatusCode,this.originalMessage=e.originalMessage}};Ya.ModelStreamErrorException=sQe});var PQe=ee(he=>{"use strict";p();Object.defineProperty(he,"__esModule",{value:!0});he.DocumentPageLocation$=he.DocumentChunkLocation$=he.DocumentCharLocation$=he.DocumentBlock$=he.CountTokensResponse$=he.CountTokensRequest$=he.ConverseTrace$=he.ConverseTokensRequest$=he.ConverseStreamTrace$=he.ConverseStreamResponse$=he.ConverseStreamRequest$=he.ConverseStreamMetrics$=he.ConverseStreamMetadataEvent$=he.ConverseResponse$=he.ConverseRequest$=he.ConverseMetrics$=he.ContentBlockStopEvent$=he.ContentBlockStartEvent$=he.ContentBlockDeltaEvent$=he.CitationSourceContentDelta$=he.CitationsDelta$=he.CitationsContentBlock$=he.CitationsConfig$=he.Citation$=he.CachePointBlock$=he.CacheDetail$=he.BidirectionalOutputPayloadPart$=he.BidirectionalInputPayloadPart$=he.AutoToolChoice$=he.AudioBlock$=he.AsyncInvokeSummary$=he.AsyncInvokeS3OutputDataConfig$=he.ApplyGuardrailResponse$=he.ApplyGuardrailRequest$=he.AppliedGuardrailDetails$=he.AnyToolChoice$=he.errorTypeRegistries=he.ValidationException$=he.ThrottlingException$=he.ServiceUnavailableException$=he.ServiceQuotaExceededException$=he.ResourceNotFoundException$=he.ModelTimeoutException$=he.ModelStreamErrorException$=he.ModelNotReadyException$=he.ModelErrorException$=he.InternalServerException$=he.ConflictException$=he.AccessDeniedException$=he.BedrockRuntimeServiceException$=void 0;he.InvokeModelResponse$=he.InvokeModelRequest$=he.InferenceConfiguration$=he.ImageBlockStart$=he.ImageBlockDelta$=he.ImageBlock$=he.GuardrailWordPolicyAssessment$=he.GuardrailUsage$=he.GuardrailTraceAssessment$=he.GuardrailTopicPolicyAssessment$=he.GuardrailTopic$=he.GuardrailTextCharactersCoverage$=he.GuardrailTextBlock$=he.GuardrailStreamConfiguration$=he.GuardrailSensitiveInformationPolicyAssessment$=he.GuardrailRegexFilter$=he.GuardrailPiiEntityFilter$=he.GuardrailOutputContent$=he.GuardrailManagedWord$=he.GuardrailInvocationMetrics$=he.GuardrailImageCoverage$=he.GuardrailImageBlock$=he.GuardrailCustomWord$=he.GuardrailCoverage$=he.GuardrailConverseTextBlock$=he.GuardrailConverseImageBlock$=he.GuardrailContextualGroundingPolicyAssessment$=he.GuardrailContextualGroundingFilter$=he.GuardrailContentPolicyAssessment$=he.GuardrailContentFilter$=he.GuardrailConfiguration$=he.GuardrailAutomatedReasoningValidFinding$=he.GuardrailAutomatedReasoningTranslationOption$=he.GuardrailAutomatedReasoningTranslationAmbiguousFinding$=he.GuardrailAutomatedReasoningTranslation$=he.GuardrailAutomatedReasoningTooComplexFinding$=he.GuardrailAutomatedReasoningStatement$=he.GuardrailAutomatedReasoningScenario$=he.GuardrailAutomatedReasoningSatisfiableFinding$=he.GuardrailAutomatedReasoningRule$=he.GuardrailAutomatedReasoningPolicyAssessment$=he.GuardrailAutomatedReasoningNoTranslationsFinding$=he.GuardrailAutomatedReasoningLogicWarning$=he.GuardrailAutomatedReasoningInvalidFinding$=he.GuardrailAutomatedReasoningInputTextReference$=he.GuardrailAutomatedReasoningImpossibleFinding$=he.GuardrailAssessment$=he.GetAsyncInvokeResponse$=he.GetAsyncInvokeRequest$=he.ErrorBlock$=void 0;he.DocumentSource$=he.DocumentContentBlock$=he.CountTokensInput$=he.ConverseStreamOutput$=he.ConverseOutput$=he.ContentBlockStart$=he.ContentBlockDelta$=he.ContentBlock$=he.CitationSourceContent$=he.CitationLocation$=he.CitationGeneratedContent$=he.AudioSource$=he.AsyncInvokeOutputDataConfig$=he.WebLocation$=he.VideoBlock$=he.ToolUseBlockStart$=he.ToolUseBlockDelta$=he.ToolUseBlock$=he.ToolSpecification$=he.ToolResultBlockStart$=he.ToolResultBlock$=he.ToolConfiguration$=he.TokenUsage$=he.Tag$=he.SystemTool$=he.StartAsyncInvokeResponse$=he.StartAsyncInvokeRequest$=he.SpecificToolChoice$=he.ServiceTier$=he.SearchResultLocation$=he.SearchResultContentBlock$=he.SearchResultBlock$=he.S3Location$=he.ReasoningTextBlock$=he.PromptRouterTrace$=he.PerformanceConfiguration$=he.PayloadPart$=he.OutputFormat$=he.OutputConfig$=he.MessageStopEvent$=he.MessageStartEvent$=he.Message$=he.ListAsyncInvokesResponse$=he.ListAsyncInvokesRequest$=he.JsonSchemaDefinition$=he.InvokeModelWithResponseStreamResponse$=he.InvokeModelWithResponseStreamRequest$=he.InvokeModelWithBidirectionalStreamResponse$=he.InvokeModelWithBidirectionalStreamRequest$=he.InvokeModelTokensRequest$=void 0;he.StartAsyncInvoke$=he.ListAsyncInvokes$=he.InvokeModelWithResponseStream$=he.InvokeModelWithBidirectionalStream$=he.InvokeModel$=he.GetAsyncInvoke$=he.CountTokens$=he.ConverseStream$=he.Converse$=he.ApplyGuardrail$=he.VideoSource$=he.ToolResultContentBlock$=he.ToolResultBlockDelta$=he.ToolInputSchema$=he.ToolChoice$=he.Tool$=he.SystemContentBlock$=he.ResponseStream$=he.ReasoningContentBlockDelta$=he.ReasoningContentBlock$=he.PromptVariableValues$=he.OutputFormatStructure$=he.InvokeModelWithBidirectionalStreamOutput$=he.InvokeModelWithBidirectionalStreamInput$=he.ImageSource$=he.GuardrailImageSource$=he.GuardrailConverseImageSource$=he.GuardrailConverseContentBlock$=he.GuardrailContentBlock$=he.GuardrailAutomatedReasoningFinding$=void 0;var ahr="Accept",chr="AudioBlock",lhr="AccessDeniedException",uhr="ApplyGuardrail",dhr="AppliedGuardrailDetails",phr="ApplyGuardrailRequest",hhr="ApplyGuardrailResponse",mhr="AsyncInvokeMessage",fhr="AsyncInvokeOutputDataConfig",ghr="AsyncInvokeSummary",Ahr="AsyncInvokeS3OutputDataConfig",yhr="AsyncInvokeSummaries",Ehr="AudioSource",bhr="AnyToolChoice",_hr="AutoToolChoice",Shr="Body",Chr="BidirectionalInputPayloadPart",Ihr="BidirectionalOutputPayloadPart",xhr="Citation",whr="ContentBlocks",Thr="ContentBlockDelta",vhr="ContentBlockDeltaEvent",Rhr="ContentBlockStart",khr="ContentBlockStartEvent",Nhr="ContentBlockStopEvent",Dhr="ContentBlock",Bhr="CitationsConfig",Phr="CitationsContentBlock",Ohr="CacheDetail",Mhr="CacheDetailsList",Lhr="CitationsDelta",Fhr="ConflictException",Qhr="CitationGeneratedContent",Uhr="CitationGeneratedContentList",$hr="CitationLocation",Ghr="ConverseMetrics",Whr="ConverseOutput",qhr="CachePointBlock",Hhr="ConverseRequest",Vhr="ConverseResponse",jhr="ConverseStream",Yhr="CitationSourceContent",Khr="CitationSourceContentDelta",zhr="CitationSourceContentList",Jhr="CitationSourceContentListDelta",Xhr="ConverseStreamMetrics",Zhr="ConverseStreamMetadataEvent",emr="ConverseStreamOutput",tmr="ConverseStreamRequest",nmr="ConverseStreamResponse",rmr="ConverseStreamTrace",smr="ConverseTrace",imr="CountTokensInput",omr="ConverseTokensRequest",amr="CountTokensRequest",cmr="CountTokensResponse",aQe="Content-Type",lmr="CountTokens",umr="Citations",dmr="Converse",pmr="DocumentBlock",hmr="DocumentContentBlocks",mmr="DocumentContentBlock",fmr="DocumentCharLocation",gmr="DocumentChunkLocation",Amr="DocumentPageLocation",ymr="DocumentSource",Emr="ErrorBlock",bmr="GuardrailAssessment",_mr="GetAsyncInvoke",Smr="GetAsyncInvokeRequest",Cmr="GetAsyncInvokeResponse",Imr="GuardrailAssessmentList",xmr="GuardrailAssessmentListMap",wmr="GuardrailAssessmentMap",Tmr="GuardrailAutomatedReasoningDifferenceScenarioList",vmr="GuardrailAutomatedReasoningFinding",Rmr="GuardrailAutomatedReasoningFindingList",kmr="GuardrailAutomatedReasoningImpossibleFinding",Nmr="GuardrailAutomatedReasoningInvalidFinding",Dmr="GuardrailAutomatedReasoningInputTextReference",Bmr="GuardrailAutomatedReasoningInputTextReferenceList",Pmr="GuardrailAutomatedReasoningLogicWarning",Omr="GuardrailAutomatedReasoningNoTranslationsFinding",Mmr="GuardrailAutomatedReasoningPolicyAssessment",Lmr="GuardrailAutomatedReasoningRule",Fmr="GuardrailAutomatedReasoningRuleList",Qmr="GuardrailAutomatedReasoningScenario",Umr="GuardrailAutomatedReasoningSatisfiableFinding",$mr="GuardrailAutomatedReasoningStatementList",Gmr="GuardrailAutomatedReasoningStatementLogicContent",Wmr="GuardrailAutomatedReasoningStatementNaturalLanguageContent",qmr="GuardrailAutomatedReasoningStatement",Hmr="GuardrailAutomatedReasoningTranslation",Vmr="GuardrailAutomatedReasoningTranslationAmbiguousFinding",jmr="GuardrailAutomatedReasoningTooComplexFinding",Ymr="GuardrailAutomatedReasoningTranslationList",Kmr="GuardrailAutomatedReasoningTranslationOption",zmr="GuardrailAutomatedReasoningTranslationOptionList",Jmr="GuardrailAutomatedReasoningValidFinding",Xmr="GuardrailConfiguration",Zmr="GuardrailContentBlock",efr="GuardrailContentBlockList",tfr="GuardrailConverseContentBlock",nfr="GuardrailContentFilter",rfr="GuardrailContentFilterList",sfr="GuardrailContextualGroundingFilter",ifr="GuardrailContextualGroundingFilters",ofr="GuardrailContextualGroundingPolicyAssessment",afr="GuardrailConverseImageBlock",cfr="GuardrailConverseImageSource",lfr="GuardrailContentPolicyAssessment",ufr="GuardrailConverseTextBlock",dfr="GuardrailCustomWord",pfr="GuardrailCustomWordList",hfr="GuardrailCoverage",mfr="GuardrailImageBlock",ffr="GuardrailImageCoverage",gfr="GuardrailInvocationMetrics",Afr="GuardrailImageSource",yfr="GuardrailManagedWord",Efr="GuardrailManagedWordList",bfr="GuardrailOutputContent",_fr="GuardrailOutputContentList",Sfr="GuardrailPiiEntityFilter",Cfr="GuardrailPiiEntityFilterList",Ifr="GuardrailRegexFilter",xfr="GuardrailRegexFilterList",wfr="GuardrailStreamConfiguration",Tfr="GuardrailSensitiveInformationPolicyAssessment",vfr="GuardrailTopic",Rfr="GuardrailTraceAssessment",kfr="GuardrailTextBlock",Nfr="GuardrailTextCharactersCoverage",Dfr="GuardrailTopicList",Bfr="GuardrailTopicPolicyAssessment",Pfr="GuardrailUsage",Ofr="GuardrailWordPolicyAssessment",Mfr="ImageBlock",Lfr="ImageBlockDelta",Ffr="ImageBlockStart",Qfr="InferenceConfiguration",Ufr="InvokeModel",$fr="InvokeModelRequest",Gfr="InvokeModelResponse",Wfr="InvokeModelTokensRequest",qfr="InvokeModelWithBidirectionalStream",Hfr="InvokeModelWithBidirectionalStreamInput",Vfr="InvokeModelWithBidirectionalStreamOutput",jfr="InvokeModelWithBidirectionalStreamRequest",Yfr="InvokeModelWithBidirectionalStreamResponse",Kfr="InvokeModelWithResponseStream",zfr="InvokeModelWithResponseStreamRequest",Jfr="InvokeModelWithResponseStreamResponse",Xfr="ImageSource",Zfr="InternalServerException",egr="JsonSchemaDefinition",tgr="ListAsyncInvokes",ngr="ListAsyncInvokesRequest",rgr="ListAsyncInvokesResponse",sgr="Message",igr="ModelErrorException",ogr="ModelInputPayload",agr="ModelNotReadyException",cgr="MessageStartEvent",lgr="ModelStreamErrorException",ugr="MessageStopEvent",dgr="ModelTimeoutException",pgr="Messages",hgr="OutputConfig",mgr="OutputFormat",fgr="OutputFormatStructure",ggr="PartBody",Agr="PerformanceConfiguration",ygr="PayloadPart",Egr="PromptRouterTrace",bgr="PromptVariableMap",_gr="PromptVariableValues",Sgr="ReasoningContentBlock",Cgr="ReasoningContentBlockDelta",Igr="RequestMetadata",xgr="ResourceNotFoundException",wgr="ResponseStream",Tgr="ReasoningTextBlock",vgr="StartAsyncInvoke",Rgr="StartAsyncInvokeRequest",kgr="StartAsyncInvokeResponse",Ngr="SystemContentBlocks",Dgr="SystemContentBlock",Bgr="S3Location",Pgr="ServiceQuotaExceededException",Ogr="SearchResultBlock",Mgr="SearchResultContentBlock",Lgr="SearchResultContentBlocks",Fgr="SearchResultLocation",Qgr="ServiceTier",Ugr="SpecificToolChoice",$gr="SystemTool",Ggr="ServiceUnavailableException",Wgr="Tag",qgr="ToolConfiguration",Hgr="ToolChoice",Vgr="ThrottlingException",jgr="ToolInputSchema",Ygr="TagList",Kgr="ToolResultBlock",zgr="ToolResultBlocksDelta",Jgr="ToolResultBlockDelta",Xgr="ToolResultBlockStart",Zgr="ToolResultContentBlocks",eAr="ToolResultContentBlock",tAr="ToolSpecification",nAr="TokenUsage",rAr="ToolUseBlock",sAr="ToolUseBlockDelta",iAr="ToolUseBlockStart",oAr="Tools",aAr="Tool",cAr="VideoBlock",lAr="ValidationException",uAr="VideoSource",dAr="WebLocation",pAr="X-Amzn-Bedrock-Accept",hAr="X-Amzn-Bedrock-Content-Type",VBt="X-Amzn-Bedrock-GuardrailIdentifier",jBt="X-Amzn-Bedrock-GuardrailVersion",Eue="X-Amzn-Bedrock-PerformanceConfig-Latency",bue="X-Amzn-Bedrock-Service-Tier",YBt="X-Amzn-Bedrock-Trace",xR="action",mAr="appliedGuardrailDetails",fAr="asyncInvokeSummaries",cQe="additionalModelRequestFields",KBt="additionalModelResponseFieldPaths",zBt="additionalModelResponseFields",JBt="actionReason",gAr="automatedReasoningPolicy",AAr="automatedReasoningPolicyUnits",yAr="automatedReasoningPolicies",XBt="accept",EAr="any",bAr="assessments",_Ar="audio",SAr="auto",Nx="bytes",ZBt="bucketOwner",FB="body",KS="client",CAr="contentBlockDelta",lQe="contentBlockIndex",IAr="contentBlockStart",xAr="contentBlockStop",wAr="citationsContent",TAr="cacheDetails",vAr="claimsFalseScenario",RAr="contextualGroundingPolicy",kAr="contextualGroundingPolicyUnits",NAr="contentPolicy",DAr="contentPolicyImageUnits",BAr="contentPolicyUnits",uQe="cachePoint",ePt="contradictingRules",PAr="cacheReadInputTokens",dQe="clientRequestToken",_ue="contentType",tPt="claimsTrueScenario",OAr="customWords",MAr="cacheWriteInputTokens",pQe="chunk",hQe="citations",LAr="citation",nPt="claims",j2="content",FAr="context",rPt="confidence",QAr="converse",UAr="delta",$Ar="documentChar",GAr="documentChunk",mQe="documentIndex",WAr="documentPage",qAr="differenceScenarios",QB="detected",sPt="description",HAr="domain",iPt="document",gm="error",oPt="endTime",VAr="enabled",Sue="end",UB="format",aPt="failureMessage",jAr="filterStrength",YAr="findings",cPt="filters",lPt="guardrail",KAr="guardrailArn",uPt="guardrailCoverage",dPt="guardrailConfig",pPt="guardContent",zAr="guardrailId",B8="guardrailIdentifier",JAr="guardrailOrigin",XAr="guardrailOwnership",ZAr="guardrailProcessingLatency",Y2="guardrailVersion",hPt="guarded",zS="http",eE="httpError",Nu="httpHeader",LB="httpQuery",fQe="input",Cue="invocationArn",eyr="inputAssessment",mPt="inferenceConfig",tyr="invocationMetrics",nyr="invokedModelId",ryr="invokeModel",syr="inputSchema",gQe="internalServerException",AQe="inputTokens",iyr="identifier",oyr="images",K2="image",ayr="impossible",cyr="invalid",yQe="json",lyr="jsonSchema",uyr="key",dyr="kmsKeyId",fPt="location",gPt="latencyMs",APt="lastModifiedTime",Iue="logicWarning",pyr="latency",hyr="logic",kf="message",yPt="modelArn",$B="modelId",myr="modelInput",fyr="modelOutput",QBt="maxResults",gyr="messageStart",EQe="modelStreamErrorException",Ayr="messageStop",yyr="maxTokens",EPt="modelTimeoutException",Eyr="managedWordLists",xue="match",bQe="messages",bPt="metrics",byr="metadata",Dx="name",_yr="naturalLanguage",oQe="nextToken",Syr="noTranslations",Cyr="outputs",Iyr="outputAssessments",_Pt="outputConfig",_Qe="outputDataConfig",xyr="originalMessage",wyr="outputScope",SPt="originalStatusCode",Tyr="outputTokens",vyr="options",Ryr="output",CPt="premises",wue="performanceConfig",Tue="performanceConfigLatency",kyr="piiEntities",IPt="promptRouter",xPt="promptVariables",Nyr="policyVersionArn",wPt="qualifiers",Dyr="regex",TPt="reasoningContent",vPt="redactedContent",RPt="requestMetadata",Byr="resourceName",Pyr="reasoningText",Oyr="regexes",kPt="role",NPt="smithy.ts.sdk.synthetic.com.amazonaws.bedrockruntime",UBt="sortBy",DPt="sourceContent",$Bt="statusEquals",Myr="sensitiveInformationPolicy",Lyr="sensitiveInformationPolicyFreeUnits",Fyr="sensitiveInformationPolicyUnits",vue="s3Location",GBt="sortOrder",Qyr="s3OutputDataConfig",Uyr="streamProcessingMode",BPt="stopReason",$yr="searchResultIndex",Gyr="searchResultLocation",PPt="searchResult",Wyr="supportingRules",qyr="stopSequences",OPt="submitTime",WBt="submitTimeAfter",qBt="submitTimeBefore",wR="serviceTier",Hyr="systemTool",Vyr="s3Uri",SQe="serviceUnavailableException",jyr="satisfiable",Yyr="score",Kyr="schema",MPt="server",LPt="signature",p_="source",Rue="status",P8="start",zyr="statements",Jyr="stream",kue="streaming",Xyr="strict",Zyr="structure",CQe="system",FPt="ttl",eEr="translationAmbiguous",IQe="toolConfig",tEr="textCharacters",nEr="toolChoice",rEr="tooComplex",xQe="throttlingException",sEr="textFormat",iEr="topicPolicy",oEr="topicPolicyUnits",aEr="topP",wQe="toolResult",cEr="toolSpec",lEr="totalTokens",TQe="toolUse",Nue="toolUseId",uEr="tags",Du="text",dEr="temperature",pEr="threshold",vQe="title",QPt="total",hEr="tools",mEr="tool",fEr="topics",z2="trace",Due="translation",gEr="translations",nA="type",Bue="usage",AEr="untranslatedClaims",yEr="untranslatedPremises",EEr="uri",bEr="url",_Er="value",RQe="validationException",SEr="valid",UPt="video",CEr="web",IEr="wordPolicy",xEr="wordPolicyUnits",ht="com.amazonaws.bedrockruntime",$Pt=(Ki(),Un(rBe)),wEr=yue(),tE=iQe(),GPt=$Pt.TypeRegistry.for(NPt);he.BedrockRuntimeServiceException$=[-3,NPt,"BedrockRuntimeServiceException",0,[],[]];GPt.registerError(he.BedrockRuntimeServiceException$,wEr.BedrockRuntimeServiceException);var rA=$Pt.TypeRegistry.for(ht);he.AccessDeniedException$=[-3,ht,lhr,{[gm]:KS,[eE]:403},[kf],[0]];rA.registerError(he.AccessDeniedException$,tE.AccessDeniedException);he.ConflictException$=[-3,ht,Fhr,{[gm]:KS,[eE]:400},[kf],[0]];rA.registerError(he.ConflictException$,tE.ConflictException);he.InternalServerException$=[-3,ht,Zfr,{[gm]:MPt,[eE]:500},[kf],[0]];rA.registerError(he.InternalServerException$,tE.InternalServerException);he.ModelErrorException$=[-3,ht,igr,{[gm]:KS,[eE]:424},[kf,SPt,Byr],[0,1,0]];rA.registerError(he.ModelErrorException$,tE.ModelErrorException);he.ModelNotReadyException$=[-3,ht,agr,{[gm]:KS,[eE]:429},[kf],[0]];rA.registerError(he.ModelNotReadyException$,tE.ModelNotReadyException);he.ModelStreamErrorException$=[-3,ht,lgr,{[gm]:KS,[eE]:424},[kf,SPt,xyr],[0,1,0]];rA.registerError(he.ModelStreamErrorException$,tE.ModelStreamErrorException);he.ModelTimeoutException$=[-3,ht,dgr,{[gm]:KS,[eE]:408},[kf],[0]];rA.registerError(he.ModelTimeoutException$,tE.ModelTimeoutException);he.ResourceNotFoundException$=[-3,ht,xgr,{[gm]:KS,[eE]:404},[kf],[0]];rA.registerError(he.ResourceNotFoundException$,tE.ResourceNotFoundException);he.ServiceQuotaExceededException$=[-3,ht,Pgr,{[gm]:KS,[eE]:400},[kf],[0]];rA.registerError(he.ServiceQuotaExceededException$,tE.ServiceQuotaExceededException);he.ServiceUnavailableException$=[-3,ht,Ggr,{[gm]:MPt,[eE]:503},[kf],[0]];rA.registerError(he.ServiceUnavailableException$,tE.ServiceUnavailableException);he.ThrottlingException$=[-3,ht,Vgr,{[gm]:KS,[eE]:429},[kf],[0]];rA.registerError(he.ThrottlingException$,tE.ThrottlingException);he.ValidationException$=[-3,ht,lAr,{[gm]:KS,[eE]:400},[kf],[0]];rA.registerError(he.ValidationException$,tE.ValidationException);he.errorTypeRegistries=[GPt,rA];var WPt=[0,ht,mhr,8,0],Pue=[0,ht,Shr,8,21],TEr=[0,ht,Gmr,8,0],qPt=[0,ht,Wmr,8,0],vEr=[0,ht,ogr,8,15],kQe=[0,ht,ggr,8,21];he.AnyToolChoice$=[3,ht,bhr,0,[],[]];he.AppliedGuardrailDetails$=[3,ht,dhr,0,[zAr,Y2,KAr,JAr,XAr],[0,0,0,64,0]];he.ApplyGuardrailRequest$=[3,ht,phr,0,[B8,Y2,p_,j2,wyr],[[0,1],[0,1],0,[()=>$Er,0],0],4];he.ApplyGuardrailResponse$=[3,ht,hhr,0,[Bue,xR,Cyr,bAr,JBt,uPt],[()=>he.GuardrailUsage$,0,()=>VEr,[()=>HPt,0],0,()=>he.GuardrailCoverage$],4];he.AsyncInvokeS3OutputDataConfig$=[3,ht,Ahr,0,[Vyr,dyr,ZBt],[0,0,0],1];he.AsyncInvokeSummary$=[3,ht,ghr,0,[Cue,yPt,OPt,_Qe,dQe,Rue,aPt,APt,oPt],[0,0,5,()=>he.AsyncInvokeOutputDataConfig$,0,0,[()=>WPt,0],5,5],4];he.AudioBlock$=[3,ht,chr,0,[UB,p_,gm],[0,[()=>he.AudioSource$,0],[()=>he.ErrorBlock$,0]],2];he.AutoToolChoice$=[3,ht,_hr,0,[],[]];he.BidirectionalInputPayloadPart$=[3,ht,Chr,8,[Nx],[[()=>kQe,0]]];he.BidirectionalOutputPayloadPart$=[3,ht,Ihr,8,[Nx],[[()=>kQe,0]]];he.CacheDetail$=[3,ht,Ohr,0,[FPt,AQe],[0,1],2];he.CachePointBlock$=[3,ht,qhr,0,[nA,FPt],[0,0],1];he.Citation$=[3,ht,xhr,0,[vQe,p_,DPt,fPt],[0,0,()=>BEr,()=>he.CitationLocation$]];he.CitationsConfig$=[3,ht,Bhr,0,[VAr],[2],1];he.CitationsContentBlock$=[3,ht,Phr,0,[j2,hQe],[()=>NEr,()=>DEr]];he.CitationsDelta$=[3,ht,Lhr,0,[vQe,p_,DPt,fPt],[0,0,()=>PEr,()=>he.CitationLocation$]];he.CitationSourceContentDelta$=[3,ht,Khr,0,[Du],[0]];he.ContentBlockDeltaEvent$=[3,ht,vhr,0,[UAr,lQe],[[()=>he.ContentBlockDelta$,0],1],2];he.ContentBlockStartEvent$=[3,ht,khr,0,[P8,lQe],[()=>he.ContentBlockStart$,1],2];he.ContentBlockStopEvent$=[3,ht,Nhr,0,[lQe],[1],1];he.ConverseMetrics$=[3,ht,Ghr,0,[gPt],[1],1];he.ConverseRequest$=[3,ht,Hhr,0,[$B,bQe,CQe,mPt,IQe,dPt,cQe,xPt,KBt,RPt,wue,wR,_Pt],[[0,1],[()=>DQe,0],[()=>BQe,0],()=>he.InferenceConfiguration$,()=>he.ToolConfiguration$,()=>he.GuardrailConfiguration$,15,[()=>VPt,0],64,[()=>jPt,0],()=>he.PerformanceConfiguration$,()=>he.ServiceTier$,[()=>he.OutputConfig$,0]],1];he.ConverseResponse$=[3,ht,Vhr,0,[Ryr,BPt,Bue,bPt,zBt,z2,wue,wR],[[()=>he.ConverseOutput$,0],0,()=>he.TokenUsage$,()=>he.ConverseMetrics$,15,[()=>he.ConverseTrace$,0],()=>he.PerformanceConfiguration$,()=>he.ServiceTier$],4];he.ConverseStreamMetadataEvent$=[3,ht,Zhr,0,[Bue,bPt,z2,wue,wR],[()=>he.TokenUsage$,()=>he.ConverseStreamMetrics$,[()=>he.ConverseStreamTrace$,0],()=>he.PerformanceConfiguration$,()=>he.ServiceTier$],2];he.ConverseStreamMetrics$=[3,ht,Xhr,0,[gPt],[1],1];he.ConverseStreamRequest$=[3,ht,tmr,0,[$B,bQe,CQe,mPt,IQe,dPt,cQe,xPt,KBt,RPt,wue,wR,_Pt],[[0,1],[()=>DQe,0],[()=>BQe,0],()=>he.InferenceConfiguration$,()=>he.ToolConfiguration$,()=>he.GuardrailStreamConfiguration$,15,[()=>VPt,0],64,[()=>jPt,0],()=>he.PerformanceConfiguration$,()=>he.ServiceTier$,[()=>he.OutputConfig$,0]],1];he.ConverseStreamResponse$=[3,ht,nmr,0,[Jyr],[[()=>he.ConverseStreamOutput$,16]]];he.ConverseStreamTrace$=[3,ht,rmr,0,[lPt,IPt],[[()=>he.GuardrailTraceAssessment$,0],()=>he.PromptRouterTrace$]];he.ConverseTokensRequest$=[3,ht,omr,0,[bQe,CQe,IQe,cQe],[[()=>DQe,0],[()=>BQe,0],()=>he.ToolConfiguration$,15]];he.ConverseTrace$=[3,ht,smr,0,[lPt,IPt],[[()=>he.GuardrailTraceAssessment$,0],()=>he.PromptRouterTrace$]];he.CountTokensRequest$=[3,ht,amr,0,[$B,fQe],[[0,1],[()=>he.CountTokensInput$,0]],2];he.CountTokensResponse$=[3,ht,cmr,0,[AQe],[1],1];he.DocumentBlock$=[3,ht,pmr,0,[Dx,p_,UB,FAr,hQe],[0,()=>he.DocumentSource$,0,0,()=>he.CitationsConfig$],2];he.DocumentCharLocation$=[3,ht,fmr,0,[mQe,P8,Sue],[1,1,1]];he.DocumentChunkLocation$=[3,ht,gmr,0,[mQe,P8,Sue],[1,1,1]];he.DocumentPageLocation$=[3,ht,Amr,0,[mQe,P8,Sue],[1,1,1]];he.ErrorBlock$=[3,ht,Emr,8,[kf],[0]];he.GetAsyncInvokeRequest$=[3,ht,Smr,0,[Cue],[[0,1]],1];he.GetAsyncInvokeResponse$=[3,ht,Cmr,0,[Cue,yPt,Rue,OPt,_Qe,dQe,aPt,APt,oPt],[0,0,0,5,()=>he.AsyncInvokeOutputDataConfig$,0,[()=>WPt,0],5,5],5];he.GuardrailAssessment$=[3,ht,bmr,0,[iEr,NAr,IEr,Myr,RAr,gAr,tyr,mAr],[()=>he.GuardrailTopicPolicyAssessment$,()=>he.GuardrailContentPolicyAssessment$,()=>he.GuardrailWordPolicyAssessment$,()=>he.GuardrailSensitiveInformationPolicyAssessment$,()=>he.GuardrailContextualGroundingPolicyAssessment$,[()=>he.GuardrailAutomatedReasoningPolicyAssessment$,0],()=>he.GuardrailInvocationMetrics$,()=>he.AppliedGuardrailDetails$]];he.GuardrailAutomatedReasoningImpossibleFinding$=[3,ht,kmr,0,[Due,ePt,Iue],[[()=>he.GuardrailAutomatedReasoningTranslation$,0],()=>NQe,[()=>he.GuardrailAutomatedReasoningLogicWarning$,0]]];he.GuardrailAutomatedReasoningInputTextReference$=[3,ht,Dmr,0,[Du],[[()=>qPt,0]]];he.GuardrailAutomatedReasoningInvalidFinding$=[3,ht,Nmr,0,[Due,ePt,Iue],[[()=>he.GuardrailAutomatedReasoningTranslation$,0],()=>NQe,[()=>he.GuardrailAutomatedReasoningLogicWarning$,0]]];he.GuardrailAutomatedReasoningLogicWarning$=[3,ht,Pmr,0,[nA,CPt,nPt],[0,[()=>D8,0],[()=>D8,0]]];he.GuardrailAutomatedReasoningNoTranslationsFinding$=[3,ht,Omr,0,[],[]];he.GuardrailAutomatedReasoningPolicyAssessment$=[3,ht,Mmr,0,[YAr],[[()=>FEr,0]]];he.GuardrailAutomatedReasoningRule$=[3,ht,Lmr,0,[iyr,Nyr],[0,0]];he.GuardrailAutomatedReasoningSatisfiableFinding$=[3,ht,Umr,0,[Due,tPt,vAr,Iue],[[()=>he.GuardrailAutomatedReasoningTranslation$,0],[()=>he.GuardrailAutomatedReasoningScenario$,0],[()=>he.GuardrailAutomatedReasoningScenario$,0],[()=>he.GuardrailAutomatedReasoningLogicWarning$,0]]];he.GuardrailAutomatedReasoningScenario$=[3,ht,Qmr,0,[zyr],[[()=>D8,0]]];he.GuardrailAutomatedReasoningStatement$=[3,ht,qmr,0,[hyr,_yr],[[()=>TEr,0],[()=>qPt,0]]];he.GuardrailAutomatedReasoningTooComplexFinding$=[3,ht,jmr,0,[],[]];he.GuardrailAutomatedReasoningTranslation$=[3,ht,Hmr,0,[CPt,nPt,yEr,AEr,rPt],[[()=>D8,0],[()=>D8,0],[()=>HBt,0],[()=>HBt,0],1]];he.GuardrailAutomatedReasoningTranslationAmbiguousFinding$=[3,ht,Vmr,0,[vyr,qAr],[[()=>UEr,0],[()=>LEr,0]]];he.GuardrailAutomatedReasoningTranslationOption$=[3,ht,Kmr,0,[gEr],[[()=>QEr,0]]];he.GuardrailAutomatedReasoningValidFinding$=[3,ht,Jmr,0,[Due,tPt,Wyr,Iue],[[()=>he.GuardrailAutomatedReasoningTranslation$,0],[()=>he.GuardrailAutomatedReasoningScenario$,0],()=>NQe,[()=>he.GuardrailAutomatedReasoningLogicWarning$,0]]];he.GuardrailConfiguration$=[3,ht,Xmr,0,[B8,Y2,z2],[0,0,0]];he.GuardrailContentFilter$=[3,ht,nfr,0,[nA,rPt,xR,jAr,QB],[0,0,0,0,2],3];he.GuardrailContentPolicyAssessment$=[3,ht,lfr,0,[cPt],[()=>GEr],1];he.GuardrailContextualGroundingFilter$=[3,ht,sfr,0,[nA,pEr,Yyr,xR,QB],[0,1,1,0,2],4];he.GuardrailContextualGroundingPolicyAssessment$=[3,ht,ofr,0,[cPt],[()=>WEr]];he.GuardrailConverseImageBlock$=[3,ht,afr,8,[UB,p_],[0,[()=>he.GuardrailConverseImageSource$,0]],2];he.GuardrailConverseTextBlock$=[3,ht,ufr,0,[Du,wPt],[0,64],1];he.GuardrailCoverage$=[3,ht,hfr,0,[tEr,oyr],[()=>he.GuardrailTextCharactersCoverage$,()=>he.GuardrailImageCoverage$]];he.GuardrailCustomWord$=[3,ht,dfr,0,[xue,xR,QB],[0,0,2],2];he.GuardrailImageBlock$=[3,ht,mfr,8,[UB,p_],[0,[()=>he.GuardrailImageSource$,0]],2];he.GuardrailImageCoverage$=[3,ht,ffr,0,[hPt,QPt],[1,1]];he.GuardrailInvocationMetrics$=[3,ht,gfr,0,[ZAr,Bue,uPt],[1,()=>he.GuardrailUsage$,()=>he.GuardrailCoverage$]];he.GuardrailManagedWord$=[3,ht,yfr,0,[xue,nA,xR,QB],[0,0,0,2],3];he.GuardrailOutputContent$=[3,ht,bfr,0,[Du],[0]];he.GuardrailPiiEntityFilter$=[3,ht,Sfr,0,[xue,nA,xR,QB],[0,0,0,2],3];he.GuardrailRegexFilter$=[3,ht,Ifr,0,[xR,Dx,xue,Dyr,QB],[0,0,0,0,2],1];he.GuardrailSensitiveInformationPolicyAssessment$=[3,ht,Tfr,0,[kyr,Oyr],[()=>jEr,()=>YEr],2];he.GuardrailStreamConfiguration$=[3,ht,wfr,0,[B8,Y2,z2,Uyr],[0,0,0,0]];he.GuardrailTextBlock$=[3,ht,kfr,0,[Du,wPt],[0,64],1];he.GuardrailTextCharactersCoverage$=[3,ht,Nfr,0,[hPt,QPt],[1,1]];he.GuardrailTopic$=[3,ht,vfr,0,[Dx,nA,xR,QB],[0,0,0,2],3];he.GuardrailTopicPolicyAssessment$=[3,ht,Bfr,0,[fEr],[()=>KEr],1];he.GuardrailTraceAssessment$=[3,ht,Rfr,0,[fyr,eyr,Iyr,JBt],[64,[()=>nbr,0],[()=>tbr,0],0]];he.GuardrailUsage$=[3,ht,Pfr,0,[oEr,BAr,xEr,Fyr,Lyr,kAr,DAr,AAr,yAr],[1,1,1,1,1,1,1,1,1],6];he.GuardrailWordPolicyAssessment$=[3,ht,Ofr,0,[OAr,Eyr],[()=>qEr,()=>HEr],2];he.ImageBlock$=[3,ht,Mfr,0,[UB,p_,gm],[0,[()=>he.ImageSource$,0],[()=>he.ErrorBlock$,0]],2];he.ImageBlockDelta$=[3,ht,Lfr,0,[p_,gm],[[()=>he.ImageSource$,0],[()=>he.ErrorBlock$,0]]];he.ImageBlockStart$=[3,ht,Ffr,0,[UB],[0],1];he.InferenceConfiguration$=[3,ht,Qfr,0,[yyr,dEr,aEr,qyr],[1,1,1,64]];he.InvokeModelRequest$=[3,ht,$fr,0,[$B,FB,_ue,XBt,z2,B8,Y2,Tue,wR],[[0,1],[()=>Pue,16],[0,{[Nu]:aQe}],[0,{[Nu]:ahr}],[0,{[Nu]:YBt}],[0,{[Nu]:VBt}],[0,{[Nu]:jBt}],[0,{[Nu]:Eue}],[0,{[Nu]:bue}]],1];he.InvokeModelResponse$=[3,ht,Gfr,0,[FB,_ue,Tue,wR],[[()=>Pue,16],[0,{[Nu]:aQe}],[0,{[Nu]:Eue}],[0,{[Nu]:bue}]],2];he.InvokeModelTokensRequest$=[3,ht,Wfr,0,[FB],[[()=>Pue,0]],1];he.InvokeModelWithBidirectionalStreamRequest$=[3,ht,jfr,0,[$B,FB],[[0,1],[()=>he.InvokeModelWithBidirectionalStreamInput$,16]],2];he.InvokeModelWithBidirectionalStreamResponse$=[3,ht,Yfr,0,[FB],[[()=>he.InvokeModelWithBidirectionalStreamOutput$,16]],1];he.InvokeModelWithResponseStreamRequest$=[3,ht,zfr,0,[$B,FB,_ue,XBt,z2,B8,Y2,Tue,wR],[[0,1],[()=>Pue,16],[0,{[Nu]:aQe}],[0,{[Nu]:pAr}],[0,{[Nu]:YBt}],[0,{[Nu]:VBt}],[0,{[Nu]:jBt}],[0,{[Nu]:Eue}],[0,{[Nu]:bue}]],1];he.InvokeModelWithResponseStreamResponse$=[3,ht,Jfr,0,[FB,_ue,Tue,wR],[[()=>he.ResponseStream$,16],[0,{[Nu]:hAr}],[0,{[Nu]:Eue}],[0,{[Nu]:bue}]],2];he.JsonSchemaDefinition$=[3,ht,egr,0,[Kyr,Dx,sPt],[0,0,0],1];he.ListAsyncInvokesRequest$=[3,ht,ngr,0,[WBt,qBt,$Bt,QBt,oQe,UBt,GBt],[[5,{[LB]:WBt}],[5,{[LB]:qBt}],[0,{[LB]:$Bt}],[1,{[LB]:QBt}],[0,{[LB]:oQe}],[0,{[LB]:UBt}],[0,{[LB]:GBt}]]];he.ListAsyncInvokesResponse$=[3,ht,rgr,0,[oQe,fAr],[0,[()=>REr,0]]];he.Message$=[3,ht,sgr,0,[kPt,j2],[0,[()=>OEr,0]],2];he.MessageStartEvent$=[3,ht,cgr,0,[kPt],[0],1];he.MessageStopEvent$=[3,ht,ugr,0,[BPt,zBt],[0,15],1];he.OutputConfig$=[3,ht,hgr,0,[sEr],[[()=>he.OutputFormat$,0]]];he.OutputFormat$=[3,ht,mgr,0,[nA,Zyr],[0,[()=>he.OutputFormatStructure$,0]],2];he.PayloadPart$=[3,ht,ygr,8,[Nx],[[()=>kQe,0]]];he.PerformanceConfiguration$=[3,ht,Agr,0,[pyr],[0]];he.PromptRouterTrace$=[3,ht,Egr,0,[nyr],[0]];he.ReasoningTextBlock$=[3,ht,Tgr,8,[Du,LPt],[0,0],1];he.S3Location$=[3,ht,Bgr,0,[EEr,ZBt],[0,0],1];he.SearchResultBlock$=[3,ht,Ogr,0,[p_,vQe,j2,hQe],[0,0,()=>zEr,()=>he.CitationsConfig$],3];he.SearchResultContentBlock$=[3,ht,Mgr,0,[Du],[0],1];he.SearchResultLocation$=[3,ht,Fgr,0,[$yr,P8,Sue],[1,1,1]];he.ServiceTier$=[3,ht,Qgr,0,[nA],[0],1];he.SpecificToolChoice$=[3,ht,Ugr,0,[Dx],[0],1];he.StartAsyncInvokeRequest$=[3,ht,Rgr,0,[$B,myr,_Qe,dQe,uEr],[0,[()=>vEr,0],()=>he.AsyncInvokeOutputDataConfig$,[0,4],()=>JEr],3];he.StartAsyncInvokeResponse$=[3,ht,kgr,0,[Cue],[0],1];he.SystemTool$=[3,ht,$gr,0,[Dx],[0],1];he.Tag$=[3,ht,Wgr,0,[uyr,_Er],[0,0],2];he.TokenUsage$=[3,ht,nAr,0,[AQe,Tyr,lEr,PAr,MAr,TAr],[1,1,1,1,1,()=>kEr],3];he.ToolConfiguration$=[3,ht,qgr,0,[hEr,nEr],[()=>ebr,()=>he.ToolChoice$],1];he.ToolResultBlock$=[3,ht,Kgr,0,[Nue,j2,Rue,nA],[0,[()=>ZEr,0],0,0],2];he.ToolResultBlockStart$=[3,ht,Xgr,0,[Nue,nA,Rue],[0,0,0],1];he.ToolSpecification$=[3,ht,tAr,0,[Dx,syr,sPt,Xyr],[0,()=>he.ToolInputSchema$,0,2],2];he.ToolUseBlock$=[3,ht,rAr,0,[Nue,Dx,fQe,nA],[0,0,15,0],3];he.ToolUseBlockDelta$=[3,ht,sAr,0,[fQe],[0],1];he.ToolUseBlockStart$=[3,ht,iAr,0,[Nue,Dx,nA],[0,0,0],2];he.VideoBlock$=[3,ht,cAr,0,[UB,p_],[0,()=>he.VideoSource$],2];he.WebLocation$=[3,ht,dAr,0,[bEr,HAr],[0,0]];var REr=[1,ht,yhr,0,[()=>he.AsyncInvokeSummary$,0]],kEr=[1,ht,Mhr,0,()=>he.CacheDetail$],NEr=[1,ht,Uhr,0,()=>he.CitationGeneratedContent$],DEr=[1,ht,umr,0,()=>he.Citation$],BEr=[1,ht,zhr,0,()=>he.CitationSourceContent$],PEr=[1,ht,Jhr,0,()=>he.CitationSourceContentDelta$],OEr=[1,ht,whr,0,[()=>he.ContentBlock$,0]],MEr=[1,ht,hmr,0,()=>he.DocumentContentBlock$],HPt=[1,ht,Imr,0,[()=>he.GuardrailAssessment$,0]],LEr=[1,ht,Tmr,0,[()=>he.GuardrailAutomatedReasoningScenario$,0]],FEr=[1,ht,Rmr,0,[()=>he.GuardrailAutomatedReasoningFinding$,0]],HBt=[1,ht,Bmr,0,[()=>he.GuardrailAutomatedReasoningInputTextReference$,0]],NQe=[1,ht,Fmr,0,()=>he.GuardrailAutomatedReasoningRule$],D8=[1,ht,$mr,0,[()=>he.GuardrailAutomatedReasoningStatement$,0]],QEr=[1,ht,Ymr,0,[()=>he.GuardrailAutomatedReasoningTranslation$,0]],UEr=[1,ht,zmr,0,[()=>he.GuardrailAutomatedReasoningTranslationOption$,0]],$Er=[1,ht,efr,0,[()=>he.GuardrailContentBlock$,0]],GEr=[1,ht,rfr,0,()=>he.GuardrailContentFilter$],WEr=[1,ht,ifr,0,()=>he.GuardrailContextualGroundingFilter$],qEr=[1,ht,pfr,0,()=>he.GuardrailCustomWord$],HEr=[1,ht,Efr,0,()=>he.GuardrailManagedWord$],VEr=[1,ht,_fr,0,()=>he.GuardrailOutputContent$],jEr=[1,ht,Cfr,0,()=>he.GuardrailPiiEntityFilter$],YEr=[1,ht,xfr,0,()=>he.GuardrailRegexFilter$],KEr=[1,ht,Dfr,0,()=>he.GuardrailTopic$],DQe=[1,ht,pgr,0,[()=>he.Message$,0]],zEr=[1,ht,Lgr,0,()=>he.SearchResultContentBlock$],BQe=[1,ht,Ngr,0,[()=>he.SystemContentBlock$,0]],JEr=[1,ht,Ygr,0,()=>he.Tag$],XEr=[1,ht,zgr,0,()=>he.ToolResultBlockDelta$],ZEr=[1,ht,Zgr,0,[()=>he.ToolResultContentBlock$,0]],ebr=[1,ht,oAr,0,()=>he.Tool$],tbr=[2,ht,xmr,0,[0,0],[()=>HPt,0]],nbr=[2,ht,wmr,0,[0,0],[()=>he.GuardrailAssessment$,0]],VPt=[2,ht,bgr,8,0,()=>he.PromptVariableValues$],jPt=[2,ht,Igr,8,0,0];he.AsyncInvokeOutputDataConfig$=[4,ht,fhr,0,[Qyr],[()=>he.AsyncInvokeS3OutputDataConfig$]];he.AudioSource$=[4,ht,Ehr,8,[Nx,vue],[21,()=>he.S3Location$]];he.CitationGeneratedContent$=[4,ht,Qhr,0,[Du],[0]];he.CitationLocation$=[4,ht,$hr,0,[CEr,$Ar,WAr,GAr,Gyr],[()=>he.WebLocation$,()=>he.DocumentCharLocation$,()=>he.DocumentPageLocation$,()=>he.DocumentChunkLocation$,()=>he.SearchResultLocation$]];he.CitationSourceContent$=[4,ht,Yhr,0,[Du],[0]];he.ContentBlock$=[4,ht,Dhr,0,[Du,K2,iPt,UPt,_Ar,TQe,wQe,pPt,uQe,TPt,wAr,PPt],[0,[()=>he.ImageBlock$,0],()=>he.DocumentBlock$,()=>he.VideoBlock$,[()=>he.AudioBlock$,0],()=>he.ToolUseBlock$,[()=>he.ToolResultBlock$,0],[()=>he.GuardrailConverseContentBlock$,0],()=>he.CachePointBlock$,[()=>he.ReasoningContentBlock$,0],()=>he.CitationsContentBlock$,()=>he.SearchResultBlock$]];he.ContentBlockDelta$=[4,ht,Thr,0,[Du,TQe,wQe,TPt,LAr,K2],[0,()=>he.ToolUseBlockDelta$,()=>XEr,[()=>he.ReasoningContentBlockDelta$,0],()=>he.CitationsDelta$,[()=>he.ImageBlockDelta$,0]]];he.ContentBlockStart$=[4,ht,Rhr,0,[TQe,wQe,K2],[()=>he.ToolUseBlockStart$,()=>he.ToolResultBlockStart$,()=>he.ImageBlockStart$]];he.ConverseOutput$=[4,ht,Whr,0,[kf],[[()=>he.Message$,0]]];he.ConverseStreamOutput$=[4,ht,emr,{[kue]:1},[gyr,IAr,CAr,xAr,Ayr,byr,gQe,EQe,RQe,xQe,SQe],[()=>he.MessageStartEvent$,()=>he.ContentBlockStartEvent$,[()=>he.ContentBlockDeltaEvent$,0],()=>he.ContentBlockStopEvent$,()=>he.MessageStopEvent$,[()=>he.ConverseStreamMetadataEvent$,0],[()=>he.InternalServerException$,0],[()=>he.ModelStreamErrorException$,0],[()=>he.ValidationException$,0],[()=>he.ThrottlingException$,0],[()=>he.ServiceUnavailableException$,0]]];he.CountTokensInput$=[4,ht,imr,0,[ryr,QAr],[[()=>he.InvokeModelTokensRequest$,0],[()=>he.ConverseTokensRequest$,0]]];he.DocumentContentBlock$=[4,ht,mmr,0,[Du],[0]];he.DocumentSource$=[4,ht,ymr,0,[Nx,vue,Du,j2],[21,()=>he.S3Location$,0,()=>MEr]];he.GuardrailAutomatedReasoningFinding$=[4,ht,vmr,0,[SEr,cyr,jyr,ayr,eEr,rEr,Syr],[[()=>he.GuardrailAutomatedReasoningValidFinding$,0],[()=>he.GuardrailAutomatedReasoningInvalidFinding$,0],[()=>he.GuardrailAutomatedReasoningSatisfiableFinding$,0],[()=>he.GuardrailAutomatedReasoningImpossibleFinding$,0],[()=>he.GuardrailAutomatedReasoningTranslationAmbiguousFinding$,0],()=>he.GuardrailAutomatedReasoningTooComplexFinding$,()=>he.GuardrailAutomatedReasoningNoTranslationsFinding$]];he.GuardrailContentBlock$=[4,ht,Zmr,0,[Du,K2],[()=>he.GuardrailTextBlock$,[()=>he.GuardrailImageBlock$,0]]];he.GuardrailConverseContentBlock$=[4,ht,tfr,0,[Du,K2],[()=>he.GuardrailConverseTextBlock$,[()=>he.GuardrailConverseImageBlock$,0]]];he.GuardrailConverseImageSource$=[4,ht,cfr,8,[Nx],[21]];he.GuardrailImageSource$=[4,ht,Afr,8,[Nx],[21]];he.ImageSource$=[4,ht,Xfr,8,[Nx,vue],[21,()=>he.S3Location$]];he.InvokeModelWithBidirectionalStreamInput$=[4,ht,Hfr,{[kue]:1},[pQe],[[()=>he.BidirectionalInputPayloadPart$,0]]];he.InvokeModelWithBidirectionalStreamOutput$=[4,ht,Vfr,{[kue]:1},[pQe,gQe,EQe,RQe,xQe,EPt,SQe],[[()=>he.BidirectionalOutputPayloadPart$,0],[()=>he.InternalServerException$,0],[()=>he.ModelStreamErrorException$,0],[()=>he.ValidationException$,0],[()=>he.ThrottlingException$,0],[()=>he.ModelTimeoutException$,0],[()=>he.ServiceUnavailableException$,0]]];he.OutputFormatStructure$=[4,ht,fgr,8,[lyr],[()=>he.JsonSchemaDefinition$]];he.PromptVariableValues$=[4,ht,_gr,0,[Du],[0]];he.ReasoningContentBlock$=[4,ht,Sgr,8,[Pyr,vPt],[[()=>he.ReasoningTextBlock$,0],21]];he.ReasoningContentBlockDelta$=[4,ht,Cgr,8,[Du,vPt,LPt],[0,21,0]];he.ResponseStream$=[4,ht,wgr,{[kue]:1},[pQe,gQe,EQe,RQe,xQe,EPt,SQe],[[()=>he.PayloadPart$,0],[()=>he.InternalServerException$,0],[()=>he.ModelStreamErrorException$,0],[()=>he.ValidationException$,0],[()=>he.ThrottlingException$,0],[()=>he.ModelTimeoutException$,0],[()=>he.ServiceUnavailableException$,0]]];he.SystemContentBlock$=[4,ht,Dgr,0,[Du,pPt,uQe],[0,[()=>he.GuardrailConverseContentBlock$,0],()=>he.CachePointBlock$]];he.Tool$=[4,ht,aAr,0,[cEr,Hyr,uQe],[()=>he.ToolSpecification$,()=>he.SystemTool$,()=>he.CachePointBlock$]];he.ToolChoice$=[4,ht,Hgr,0,[SAr,EAr,mEr],[()=>he.AutoToolChoice$,()=>he.AnyToolChoice$,()=>he.SpecificToolChoice$]];he.ToolInputSchema$=[4,ht,jgr,0,[yQe],[15]];he.ToolResultBlockDelta$=[4,ht,Jgr,0,[Du,yQe],[0,15]];he.ToolResultContentBlock$=[4,ht,eAr,0,[yQe,Du,K2,iPt,UPt,PPt],[15,0,[()=>he.ImageBlock$,0],()=>he.DocumentBlock$,()=>he.VideoBlock$,()=>he.SearchResultBlock$]];he.VideoSource$=[4,ht,uAr,0,[Nx,vue],[21,()=>he.S3Location$]];he.ApplyGuardrail$=[9,ht,uhr,{[zS]:["POST","/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply",200]},()=>he.ApplyGuardrailRequest$,()=>he.ApplyGuardrailResponse$];he.Converse$=[9,ht,dmr,{[zS]:["POST","/model/{modelId}/converse",200]},()=>he.ConverseRequest$,()=>he.ConverseResponse$];he.ConverseStream$=[9,ht,jhr,{[zS]:["POST","/model/{modelId}/converse-stream",200]},()=>he.ConverseStreamRequest$,()=>he.ConverseStreamResponse$];he.CountTokens$=[9,ht,lmr,{[zS]:["POST","/model/{modelId}/count-tokens",200]},()=>he.CountTokensRequest$,()=>he.CountTokensResponse$];he.GetAsyncInvoke$=[9,ht,_mr,{[zS]:["GET","/async-invoke/{invocationArn}",200]},()=>he.GetAsyncInvokeRequest$,()=>he.GetAsyncInvokeResponse$];he.InvokeModel$=[9,ht,Ufr,{[zS]:["POST","/model/{modelId}/invoke",200]},()=>he.InvokeModelRequest$,()=>he.InvokeModelResponse$];he.InvokeModelWithBidirectionalStream$=[9,ht,qfr,{[zS]:["POST","/model/{modelId}/invoke-with-bidirectional-stream",200]},()=>he.InvokeModelWithBidirectionalStreamRequest$,()=>he.InvokeModelWithBidirectionalStreamResponse$];he.InvokeModelWithResponseStream$=[9,ht,Kfr,{[zS]:["POST","/model/{modelId}/invoke-with-response-stream",200]},()=>he.InvokeModelWithResponseStreamRequest$,()=>he.InvokeModelWithResponseStreamResponse$];he.ListAsyncInvokes$=[9,ht,tgr,{[zS]:["GET","/async-invoke",200]},()=>he.ListAsyncInvokesRequest$,()=>he.ListAsyncInvokesResponse$];he.StartAsyncInvoke$=[9,ht,vgr,{[zS]:["POST","/async-invoke",200]},()=>he.StartAsyncInvokeRequest$,()=>he.StartAsyncInvokeResponse$]});var YPt=ee(Mue=>{"use strict";p();Object.defineProperty(Mue,"__esModule",{value:!0});Mue.getRuntimeConfig=void 0;var rbr=($d(),Un(y2)),sbr=(Q2(),Un(zRt)),ibr=(vp(),Un(h6)),obr=(Is(),Un(oB)),abr=($r(),Un(qy)),Oue=(js(),Un(xx)),cbr=vMe(),lbr=LBt(),ubr=PQe(),dbr=t=>({apiVersion:"2023-09-30",base64Decoder:t?.base64Decoder??Oue.fromBase64,base64Encoder:t?.base64Encoder??Oue.toBase64,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??lbr.defaultEndpointResolver,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??cbr.defaultBedrockRuntimeHttpAuthSchemeProvider,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new rbr.AwsSdkSigV4Signer},{schemeId:"smithy.api#httpBearerAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#httpBearerAuth"),signer:new ibr.HttpBearerAuthSigner}],logger:t?.logger??new obr.NoOpLogger,protocol:t?.protocol??sbr.AwsRestJsonProtocol,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.bedrockruntime",errorTypeRegistries:ubr.errorTypeRegistries,version:"2023-09-30",serviceTarget:"AmazonBedrockFrontendService"},serviceId:t?.serviceId??"Bedrock Runtime",urlParser:t?.urlParser??abr.parseUrl,utf8Decoder:t?.utf8Decoder??Oue.fromUtf8,utf8Encoder:t?.utf8Encoder??Oue.toUtf8});Mue.getRuntimeConfig=dbr});var eOt=ee(Lue=>{"use strict";p();Object.defineProperty(Lue,"__esModule",{value:!0});Lue.getRuntimeConfig=void 0;var pbr=(Ivt(),Un(Cvt)),hbr=pbr.__importDefault(xvt()),OQe=(Go(),Un(Zg)),KPt=($d(),Un(y2)),mbr=SBt(),fbr=IBt(),zPt=vBt(),gbr=(vp(),Un(h6)),JPt=(Is(),Un(oB)),nE=(Jo(),Un(xf)),Abr=(s2(),Un(r2)),MQe=(Jg(),Un(_Oe)),XPt=(js(),Un(xx)),ZPt=EB(),ybr=YPt(),Ebr=t=>{(0,JPt.emitWarningIfUnsupportedVersion)(process.version);let e=(0,nE.resolveDefaultsModeConfig)(t),n=()=>e().then(JPt.loadConfigsForDefaultMode),r=(0,ybr.getRuntimeConfig)(t);(0,OQe.emitWarningIfUnsupportedVersion)(process.version);let s={profile:t?.profile,logger:r.logger,signingName:"bedrock"};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??(0,nE.loadConfig)(KPt.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,s),bodyLengthChecker:t?.bodyLengthChecker??XPt.calculateBodyLength,credentialDefaultProvider:t?.credentialDefaultProvider??mbr.defaultProvider,defaultUserAgentProvider:t?.defaultUserAgentProvider??(0,OQe.createDefaultUserAgentProvider)({serviceId:r.serviceId,clientVersion:hbr.default.version}),eventStreamPayloadHandlerProvider:t?.eventStreamPayloadHandlerProvider??fbr.eventStreamPayloadHandlerProvider,eventStreamSerdeProvider:t?.eventStreamSerdeProvider??Abr.eventStreamSerdeProvider,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:i=>i.getIdentityProvider("aws.auth#sigv4"),signer:new KPt.AwsSdkSigV4Signer},{schemeId:"smithy.api#httpBearerAuth",identityProvider:i=>i.getIdentityProvider("smithy.api#httpBearerAuth")||(async o=>{try{return await(0,zPt.fromEnvSigningName)({signingName:"bedrock"})()}catch{return await(0,zPt.nodeProvider)(o)(o)}}),signer:new gbr.HttpBearerAuthSigner}],maxAttempts:t?.maxAttempts??(0,nE.loadConfig)(MQe.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,t),region:t?.region??(0,nE.loadConfig)(nE.NODE_REGION_CONFIG_OPTIONS,{...nE.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:ZPt.NodeHttp2Handler.create(t?.requestHandler??(async()=>({...await n(),disableConcurrentStreams:!0}))),retryMode:t?.retryMode??(0,nE.loadConfig)({...MQe.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await n()).retryMode||MQe.DEFAULT_RETRY_MODE},t),sha256:t?.sha256??XPt.Hash.bind(null,"sha256"),streamCollector:t?.streamCollector??ZPt.streamCollector,useDualstackEndpoint:t?.useDualstackEndpoint??(0,nE.loadConfig)(nE.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:t?.useFipsEndpoint??(0,nE.loadConfig)(nE.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:t?.userAgentAppId??(0,nE.loadConfig)(OQe.NODE_APP_ID_CONFIG_OPTIONS,s)}};Lue.getRuntimeConfig=Ebr});var oOt=ee(yr=>{"use strict";p();var TR=(Go(),Un(Zg)),rOt=Ywt(),sOt=uTt(),Fue=(vp(),Un(h6)),bh=(Is(),Un(oB)),bbr=(Jo(),Un(xf)),h_=(Ta(),Un(Eae)),_br=(s2(),Un(r2)),LQe=($r(),Un(qy)),tOt=(Jg(),Un(_Oe)),Sbr=(Ki(),Un(rBe)),nOt=vMe(),Cbr=eOt(),Nf=PQe(),Que=iQe(),Ibr=yue(),xbr=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"bedrock"}),JS={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},wbr=t=>{let e=t.httpAuthSchemes,n=t.httpAuthSchemeProvider,r=t.credentials,s=t.token;return{setHttpAuthScheme(i){let o=e.findIndex(a=>a.schemeId===i.schemeId);o===-1?e.push(i):e.splice(o,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){n=i},httpAuthSchemeProvider(){return n},setCredentials(i){r=i},credentials(){return r},setToken(i){s=i},token(){return s}}},Tbr=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials(),token:t.token()}),vbr=(t,e)=>{let n=Object.assign(TR.getAwsRegionExtensionConfiguration(t),bh.getDefaultExtensionConfiguration(t),LQe.getHttpHandlerExtensionConfiguration(t),wbr(t));return e.forEach(r=>r.configure(n)),Object.assign(t,TR.resolveAwsRegionExtensionConfiguration(n),bh.resolveDefaultRuntimeConfig(n),LQe.resolveHttpHandlerRuntimeConfig(n),Tbr(n))},O8=class extends bh.Client{config;constructor(...[e]){let n=Cbr.getRuntimeConfig(e||{});super(n),this.initConfig=n;let r=xbr(n),s=TR.resolveUserAgentConfig(r),i=tOt.resolveRetryConfig(s),o=bbr.resolveRegionConfig(i),a=TR.resolveHostHeaderConfig(o),c=h_.resolveEndpointConfig(a),u=_br.resolveEventStreamSerdeConfig(c),l=nOt.resolveHttpAuthSchemeConfig(u),d=rOt.resolveEventStreamConfig(l),h=sOt.resolveWebSocketConfig(d),m=vbr(h,e?.extensions||[]);this.config=m,this.middlewareStack.use(Sbr.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(TR.getUserAgentPlugin(this.config)),this.middlewareStack.use(tOt.getRetryPlugin(this.config)),this.middlewareStack.use(LQe.getContentLengthPlugin(this.config)),this.middlewareStack.use(TR.getHostHeaderPlugin(this.config)),this.middlewareStack.use(TR.getLoggerPlugin(this.config)),this.middlewareStack.use(TR.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(Fue.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:nOt.defaultBedrockRuntimeHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async f=>new Fue.DefaultIdentityProviderConfig({"aws.auth#sigv4":f.credentials,"smithy.api#httpBearerAuth":f.token})})),this.middlewareStack.use(Fue.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}},Uue=class extends bh.Command.classBuilder().ep(JS).m(function(e,n,r,s){return[h_.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","ApplyGuardrail",{}).n("BedrockRuntimeClient","ApplyGuardrailCommand").sc(Nf.ApplyGuardrail$).build(){},$ue=class extends bh.Command.classBuilder().ep(JS).m(function(e,n,r,s){return[h_.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","Converse",{}).n("BedrockRuntimeClient","ConverseCommand").sc(Nf.Converse$).build(){},Gue=class extends bh.Command.classBuilder().ep(JS).m(function(e,n,r,s){return[h_.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","ConverseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","ConverseStreamCommand").sc(Nf.ConverseStream$).build(){},Wue=class extends bh.Command.classBuilder().ep(JS).m(function(e,n,r,s){return[h_.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","CountTokens",{}).n("BedrockRuntimeClient","CountTokensCommand").sc(Nf.CountTokens$).build(){},que=class extends bh.Command.classBuilder().ep(JS).m(function(e,n,r,s){return[h_.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","GetAsyncInvoke",{}).n("BedrockRuntimeClient","GetAsyncInvokeCommand").sc(Nf.GetAsyncInvoke$).build(){},Hue=class extends bh.Command.classBuilder().ep(JS).m(function(e,n,r,s){return[h_.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModel",{}).n("BedrockRuntimeClient","InvokeModelCommand").sc(Nf.InvokeModel$).build(){},Vue=class extends bh.Command.classBuilder().ep(JS).m(function(e,n,r,s){return[h_.getEndpointPlugin(r,e.getEndpointParameterInstructions()),rOt.getEventStreamPlugin(r),sOt.getWebSocketPlugin(r,{headerPrefix:"x-amz-bedrock-"})]}).s("AmazonBedrockFrontendService","InvokeModelWithBidirectionalStream",{eventStream:{input:!0,output:!0}}).n("BedrockRuntimeClient","InvokeModelWithBidirectionalStreamCommand").sc(Nf.InvokeModelWithBidirectionalStream$).build(){},jue=class extends bh.Command.classBuilder().ep(JS).m(function(e,n,r,s){return[h_.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModelWithResponseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","InvokeModelWithResponseStreamCommand").sc(Nf.InvokeModelWithResponseStream$).build(){},M8=class extends bh.Command.classBuilder().ep(JS).m(function(e,n,r,s){return[h_.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","ListAsyncInvokes",{}).n("BedrockRuntimeClient","ListAsyncInvokesCommand").sc(Nf.ListAsyncInvokes$).build(){},Yue=class extends bh.Command.classBuilder().ep(JS).m(function(e,n,r,s){return[h_.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","StartAsyncInvoke",{}).n("BedrockRuntimeClient","StartAsyncInvokeCommand").sc(Nf.StartAsyncInvoke$).build(){},iOt=Fue.createPaginator(O8,M8,"nextToken","nextToken","maxResults"),Rbr={ApplyGuardrailCommand:Uue,ConverseCommand:$ue,ConverseStreamCommand:Gue,CountTokensCommand:Wue,GetAsyncInvokeCommand:que,InvokeModelCommand:Hue,InvokeModelWithBidirectionalStreamCommand:Vue,InvokeModelWithResponseStreamCommand:jue,ListAsyncInvokesCommand:M8,StartAsyncInvokeCommand:Yue},kbr={paginateListAsyncInvokes:iOt},Kue=class extends O8{};bh.createAggregatedClient(Rbr,Kue,{paginators:kbr});var Nbr={COMPLETED:"Completed",FAILED:"Failed",IN_PROGRESS:"InProgress"},Dbr={SUBMISSION_TIME:"SubmissionTime"},Bbr={ASCENDING:"Ascending",DESCENDING:"Descending"},Pbr={JPEG:"jpeg",PNG:"png"},Obr={GROUNDING_SOURCE:"grounding_source",GUARD_CONTENT:"guard_content",QUERY:"query"},Mbr={FULL:"FULL",INTERVENTIONS:"INTERVENTIONS"},Lbr={INPUT:"INPUT",OUTPUT:"OUTPUT"},Fbr={GUARDRAIL_INTERVENED:"GUARDRAIL_INTERVENED",NONE:"NONE"},Qbr={ACCOUNT_ENFORCED:"ACCOUNT_ENFORCED",ORGANIZATION_ENFORCED:"ORGANIZATION_ENFORCED",REQUEST:"REQUEST"},Ubr={CROSS_ACCOUNT:"CROSS_ACCOUNT",SELF:"SELF"},$br={ALWAYS_FALSE:"ALWAYS_FALSE",ALWAYS_TRUE:"ALWAYS_TRUE"},Gbr={BLOCKED:"BLOCKED",NONE:"NONE"},Wbr={HIGH:"HIGH",LOW:"LOW",MEDIUM:"MEDIUM",NONE:"NONE"},qbr={HIGH:"HIGH",LOW:"LOW",MEDIUM:"MEDIUM",NONE:"NONE"},Hbr={HATE:"HATE",INSULTS:"INSULTS",MISCONDUCT:"MISCONDUCT",PROMPT_ATTACK:"PROMPT_ATTACK",SEXUAL:"SEXUAL",VIOLENCE:"VIOLENCE"},Vbr={BLOCKED:"BLOCKED",NONE:"NONE"},jbr={GROUNDING:"GROUNDING",RELEVANCE:"RELEVANCE"},Ybr={ANONYMIZED:"ANONYMIZED",BLOCKED:"BLOCKED",NONE:"NONE"},Kbr={ADDRESS:"ADDRESS",AGE:"AGE",AWS_ACCESS_KEY:"AWS_ACCESS_KEY",AWS_SECRET_KEY:"AWS_SECRET_KEY",CA_HEALTH_NUMBER:"CA_HEALTH_NUMBER",CA_SOCIAL_INSURANCE_NUMBER:"CA_SOCIAL_INSURANCE_NUMBER",CREDIT_DEBIT_CARD_CVV:"CREDIT_DEBIT_CARD_CVV",CREDIT_DEBIT_CARD_EXPIRY:"CREDIT_DEBIT_CARD_EXPIRY",CREDIT_DEBIT_CARD_NUMBER:"CREDIT_DEBIT_CARD_NUMBER",DRIVER_ID:"DRIVER_ID",EMAIL:"EMAIL",INTERNATIONAL_BANK_ACCOUNT_NUMBER:"INTERNATIONAL_BANK_ACCOUNT_NUMBER",IP_ADDRESS:"IP_ADDRESS",LICENSE_PLATE:"LICENSE_PLATE",MAC_ADDRESS:"MAC_ADDRESS",NAME:"NAME",PASSWORD:"PASSWORD",PHONE:"PHONE",PIN:"PIN",SWIFT_CODE:"SWIFT_CODE",UK_NATIONAL_HEALTH_SERVICE_NUMBER:"UK_NATIONAL_HEALTH_SERVICE_NUMBER",UK_NATIONAL_INSURANCE_NUMBER:"UK_NATIONAL_INSURANCE_NUMBER",UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER:"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER",URL:"URL",USERNAME:"USERNAME",US_BANK_ACCOUNT_NUMBER:"US_BANK_ACCOUNT_NUMBER",US_BANK_ROUTING_NUMBER:"US_BANK_ROUTING_NUMBER",US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER:"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER",US_PASSPORT_NUMBER:"US_PASSPORT_NUMBER",US_SOCIAL_SECURITY_NUMBER:"US_SOCIAL_SECURITY_NUMBER",VEHICLE_IDENTIFICATION_NUMBER:"VEHICLE_IDENTIFICATION_NUMBER"},zbr={BLOCKED:"BLOCKED",NONE:"NONE"},Jbr={DENY:"DENY"},Xbr={BLOCKED:"BLOCKED",NONE:"NONE"},Zbr={PROFANITY:"PROFANITY"},e_r={DISABLED:"disabled",ENABLED:"enabled",ENABLED_FULL:"enabled_full"},t_r={AAC:"aac",FLAC:"flac",M4A:"m4a",MKA:"mka",MKV:"mkv",MP3:"mp3",MP4:"mp4",MPEG:"mpeg",MPGA:"mpga",OGG:"ogg",OPUS:"opus",PCM:"pcm",WAV:"wav",WEBM:"webm",X_AAC:"x-aac"},n_r={FIVE_MINUTES:"5m",ONE_HOUR:"1h"},r_r={DEFAULT:"default"},s_r={CSV:"csv",DOC:"doc",DOCX:"docx",HTML:"html",MD:"md",PDF:"pdf",TXT:"txt",XLS:"xls",XLSX:"xlsx"},i_r={JPEG:"jpeg",PNG:"png"},o_r={GROUNDING_SOURCE:"grounding_source",GUARD_CONTENT:"guard_content",QUERY:"query"},a_r={GIF:"gif",JPEG:"jpeg",PNG:"png",WEBP:"webp"},c_r={FLV:"flv",MKV:"mkv",MOV:"mov",MP4:"mp4",MPEG:"mpeg",MPG:"mpg",THREE_GP:"three_gp",WEBM:"webm",WMV:"wmv"},l_r={ERROR:"error",SUCCESS:"success"},u_r={SERVER_TOOL_USE:"server_tool_use"},d_r={ASSISTANT:"assistant",USER:"user"},p_r={JSON_SCHEMA:"json_schema"},h_r={OPTIMIZED:"optimized",STANDARD:"standard"},m_r={DEFAULT:"default",FLEX:"flex",PRIORITY:"priority",RESERVED:"reserved"},f_r={CONTENT_FILTERED:"content_filtered",END_TURN:"end_turn",GUARDRAIL_INTERVENED:"guardrail_intervened",MALFORMED_MODEL_OUTPUT:"malformed_model_output",MALFORMED_TOOL_USE:"malformed_tool_use",MAX_TOKENS:"max_tokens",MODEL_CONTEXT_WINDOW_EXCEEDED:"model_context_window_exceeded",STOP_SEQUENCE:"stop_sequence",TOOL_USE:"tool_use"},g_r={ASYNC:"async",SYNC:"sync"},A_r={DISABLED:"DISABLED",ENABLED:"ENABLED",ENABLED_FULL:"ENABLED_FULL"};yr.$Command=bh.Command;yr.__Client=bh.Client;yr.BedrockRuntimeServiceException=Ibr.BedrockRuntimeServiceException;yr.ApplyGuardrailCommand=Uue;yr.AsyncInvokeStatus=Nbr;yr.AudioFormat=t_r;yr.BedrockRuntime=Kue;yr.BedrockRuntimeClient=O8;yr.CachePointType=r_r;yr.CacheTTL=n_r;yr.ConversationRole=d_r;yr.ConverseCommand=$ue;yr.ConverseStreamCommand=Gue;yr.CountTokensCommand=Wue;yr.DocumentFormat=s_r;yr.GetAsyncInvokeCommand=que;yr.GuardrailAction=Fbr;yr.GuardrailAutomatedReasoningLogicWarningType=$br;yr.GuardrailContentFilterConfidence=Wbr;yr.GuardrailContentFilterStrength=qbr;yr.GuardrailContentFilterType=Hbr;yr.GuardrailContentPolicyAction=Gbr;yr.GuardrailContentQualifier=Obr;yr.GuardrailContentSource=Lbr;yr.GuardrailContextualGroundingFilterType=jbr;yr.GuardrailContextualGroundingPolicyAction=Vbr;yr.GuardrailConverseContentQualifier=o_r;yr.GuardrailConverseImageFormat=i_r;yr.GuardrailImageFormat=Pbr;yr.GuardrailManagedWordType=Zbr;yr.GuardrailOrigin=Qbr;yr.GuardrailOutputScope=Mbr;yr.GuardrailOwnership=Ubr;yr.GuardrailPiiEntityType=Kbr;yr.GuardrailSensitiveInformationPolicyAction=Ybr;yr.GuardrailStreamProcessingMode=g_r;yr.GuardrailTopicPolicyAction=zbr;yr.GuardrailTopicType=Jbr;yr.GuardrailTrace=e_r;yr.GuardrailWordPolicyAction=Xbr;yr.ImageFormat=a_r;yr.InvokeModelCommand=Hue;yr.InvokeModelWithBidirectionalStreamCommand=Vue;yr.InvokeModelWithResponseStreamCommand=jue;yr.ListAsyncInvokesCommand=M8;yr.OutputFormatType=p_r;yr.PerformanceConfigLatency=h_r;yr.ServiceTierType=m_r;yr.SortAsyncInvocationBy=Dbr;yr.SortOrder=Bbr;yr.StartAsyncInvokeCommand=Yue;yr.StopReason=f_r;yr.ToolResultStatus=l_r;yr.ToolUseType=u_r;yr.Trace=A_r;yr.VideoFormat=c_r;yr.paginateListAsyncInvokes=iOt;Object.prototype.hasOwnProperty.call(Nf,"__proto__")&&!Object.prototype.hasOwnProperty.call(yr,"__proto__")&&Object.defineProperty(yr,"__proto__",{enumerable:!0,value:Nf.__proto__});Object.keys(Nf).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(yr,t)&&(yr[t]=Nf[t])});Object.prototype.hasOwnProperty.call(Que,"__proto__")&&!Object.prototype.hasOwnProperty.call(yr,"__proto__")&&Object.defineProperty(yr,"__proto__",{enumerable:!0,value:Que.__proto__});Object.keys(Que).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(yr,t)&&(yr[t]=Que[t])})});var mOt=ee(F8=>{"use strict";p();var zue=require("node:https"),Xue=($r(),Un(qy)),dOt=require("node:stream"),Zue=require("node:http2");function ede(t){let e=t&&typeof t=="object"&&"reason"in t?t.reason:void 0;if(e){if(e instanceof Error){let s=new Error("Request aborted");return s.name="AbortError",s.cause=e,s}let r=new Error(String(e));return r.name="AbortError",r}let n=new Error("Request aborted");return n.name="AbortError",n}var y_r=["ECONNRESET","EPIPE","ETIMEDOUT"],pOt=t=>{let e={};for(let n in t){let r=t[n];e[n]=Array.isArray(r)?r.join(","):r}return e},Bp={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},aOt=1e3,E_r=(t,e,n=0)=>{if(!n)return-1;let r=s=>{let i=Bp.setTimeout(()=>{t.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${n} ms.`),{name:"TimeoutError"}))},n-s),o=a=>{a?.connecting?a.on("connect",()=>{Bp.clearTimeout(i)}):Bp.clearTimeout(i)};t.socket?o(t.socket):t.on("socket",o)};return n<2e3?(r(0),0):Bp.setTimeout(r.bind(null,aOt),aOt)},b_r=(t,e,n=0,r,s)=>n?Bp.setTimeout(()=>{let i=`@smithy/node-http-handler - [${r?"ERROR":"WARN"}] a request has exceeded the configured ${n} ms requestTimeout.`;if(r){let o=Object.assign(new Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});t.destroy(o),e(o)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",s?.warn?.(i)},n):-1,__r=3e3,S_r=(t,{keepAlive:e,keepAliveMsecs:n},r=__r)=>{if(e!==!0)return-1;let s=()=>{t.socket?t.socket.setKeepAlive(e,n||0):t.on("socket",i=>{i.setKeepAlive(e,n||0)})};return r===0?(s(),0):Bp.setTimeout(s,r)},cOt=3e3,C_r=(t,e,n=0)=>{let r=s=>{let i=n-s,o=()=>{t.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${n} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};t.socket?(t.socket.setTimeout(i,o),t.on("close",()=>t.socket?.removeListener("timeout",o))):t.setTimeout(i,o)};return 0{o=Number(Bp.setTimeout(()=>c(!0),Math.max(lOt,n)))}),new Promise(c=>{t.on("continue",()=>{Bp.clearTimeout(o),c(!0)}),t.on("response",()=>{Bp.clearTimeout(o),c(!1)}),t.on("error",()=>{Bp.clearTimeout(o),c(!1)})})])),a&&I_r(t,e.body)}function I_r(t,e){if(e instanceof dOt.Readable){e.pipe(t);return}if(e){let n=Buffer.isBuffer(e);if(n||typeof e=="string"){n&&e.byteLength===0?t.end():t.end(e);return}let s=e;if(typeof s=="object"&&s.buffer&&typeof s.byteOffset=="number"&&typeof s.byteLength=="number"){t.end(Buffer.from(s.buffer,s.byteOffset,s.byteLength));return}t.end(Buffer.from(e));return}t.end()}var x_r=0,Jue,uOt,FQe=class t{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){return typeof e?.handle=="function"?e:new t(e)}static checkSocketUsage(e,n,r=console){let{sockets:s,requests:i,maxSockets:o}=e;if(typeof o!="number"||o===1/0||Date.now()-15e3=o&&l>=2*o)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${l} additional requests are enqueued. -See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html -or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return n}constructor(e){this.configProvider=new Promise((n,r)=>{typeof e=="function"?e().then(s=>{n(this.resolveDefaultConfig(s))}).catch(r):n(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:n,requestTimeout:r}={}){this.config||(this.config=await this.configProvider);let s=this.config,i=e.protocol==="https:";return!i&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((o,a)=>{let c,u=-1,l=-1,d=-1,h=-1,m=-1,f=()=>{Bp.clearTimeout(u),Bp.clearTimeout(l),Bp.clearTimeout(d),Bp.clearTimeout(h),Bp.clearTimeout(m)},g=async Q=>{await c,f(),o(Q)},A=async Q=>{await c,f(),a(Q)};if(n?.aborted){let Q=ede(n);A(Q);return}let y=e.headers,b=y?(y.Expect??y.expect)==="100-continue":!1,S=i?s.httpsAgent:s.httpAgent;b&&!this.externalAgent&&(S=new(i?zue.Agent:Jue)({keepAlive:!1,maxSockets:1/0})),u=Bp.setTimeout(()=>{this.socketWarningTimestamp=t.checkSocketUsage(S,this.socketWarningTimestamp,s.logger)},s.socketAcquisitionWarningTimeout??(s.requestTimeout??2e3)+(s.connectionTimeout??1e3));let C=e.query?Xue.buildQueryString(e.query):"",I;if(e.username!=null||e.password!=null){let Q=e.username??"",H=e.password??"";I=`${Q}:${H}`}let x=e.path;C&&(x+=`?${C}`),e.fragment&&(x+=`#${e.fragment}`);let w=e.hostname??"";w[0]==="["&&w.endsWith("]")?w=e.hostname.slice(1,-1):w=e.hostname;let R={headers:e.headers,host:w,method:e.method,path:x,port:e.port,agent:S,auth:I},P=(i?zue.request:uOt)(R,Q=>{let H=new Xue.HttpResponse({statusCode:Q.statusCode||-1,reason:Q.statusMessage,headers:pOt(Q.headers),body:Q});g({response:H})});if(P.on("error",Q=>{y_r.includes(Q.code)?A(Object.assign(Q,{name:"TimeoutError"})):A(Q)}),n){let Q=()=>{P.destroy();let H=ede(n);A(H)};if(typeof n.addEventListener=="function"){let H=n;H.addEventListener("abort",Q,{once:!0}),P.once("close",()=>H.removeEventListener("abort",Q))}else n.onabort=Q}let G=r??s.requestTimeout;l=E_r(P,A,s.connectionTimeout),d=b_r(P,A,G,s.throwOnRequestTimeout,s.logger??console),h=C_r(P,A,s.socketTimeout);let $=R.agent;typeof $=="object"&&"keepAlive"in $&&(m=S_r(P,{keepAlive:$.keepAlive,keepAliveMsecs:$.keepAliveMsecs})),c=hOt(P,e,G,this.externalAgent).catch(Q=>(f(),a(Q)))})}updateHttpClientConfig(e,n){this.config=void 0,this.configProvider=this.configProvider.then(r=>({...r,[e]:n}))}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:n,connectionTimeout:r,socketTimeout:s,socketAcquisitionWarningTimeout:i,httpAgent:o,httpsAgent:a,throwOnRequestTimeout:c,logger:u}=e||{},l=!0,d=50;return{connectionTimeout:r,requestTimeout:n,socketTimeout:s,socketAcquisitionWarningTimeout:i,throwOnRequestTimeout:c,httpAgentProvider:async()=>{let{Agent:h,request:m}=await import("node:http");return uOt=m,Jue=h,o instanceof Jue||typeof o?.destroy=="function"?(this.externalAgent=!0,o):new Jue({keepAlive:l,maxSockets:d,...o})},httpsAgent:a instanceof zue.Agent||typeof a?.destroy=="function"?(this.externalAgent=!0,a):new zue.Agent({keepAlive:l,maxSockets:d,...a}),logger:u}}},w_r=new Uint16Array(1),L8=class{id=w_r[0]++;total=0;max=0;session;refs=0;constructor(e){e.unref(),this.session=e}retain(){if(this.session.destroyed)throw new Error("@smithy/node-http-handler - cannot acquire reference to destroyed session.");this.refs+=1,this.total+=1,this.max=Math.max(this.refs,this.max),this.session.ref()}free(){if(!this.session.destroyed&&(this.refs-=1,this.refs===0&&this.session.unref(),this.refs<0))throw new Error("@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement.")}deref(){return this.session}close(){this.session.closed||this.session.close()}destroy(){this.refs=0,this.session.destroyed||this.session.destroy()}useCount(){return this.refs}},QQe=class{sessions=[];maxConcurrency=0;constructor(e){this.sessions=(e??[]).map(n=>new L8(n))}poll(){let e=!1;for(let n of this.sessions){if(n.deref().destroyed){e=!0;continue}if(!this.maxConcurrency||n.useCount()-1&&this.sessions.splice(n,1)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}setMaxConcurrency(e){this.maxConcurrency=e}destroy(e){this.remove(e),e.destroy()}},UQe=class{config;connectOptions;connectionPools=new Map;constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(e,n){let r=this.getUrlString(e),s=this.getPool(r);if(!this.config.disableConcurrency&&!n.isEventStream){let u=s.poll();if(u)return u.retain(),u}let i=new L8(this.connect(r)),o=i.deref();this.config.maxConcurrency&&o.settings({maxConcurrentStreams:this.config.maxConcurrency},u=>{if(u)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+e.destination.toString())});let a=()=>{this.removeFromPoolAndClose(r,i)},c=()=>{this.removeFromPoolAndCheckedDestroy(r,i)};return o.on("goaway",a),o.on("error",c),o.on("frameError",c),o.on("close",c),n.requestTimeout&&o.setTimeout(n.requestTimeout,c),s.offerLast(i),i.retain(),i}release(e,n){n.free()}createIsolatedSession(e,n){let r=this.getUrlString(e),s=new L8(this.connect(r)),i=s.deref();i.settings({maxConcurrentStreams:1});let o=()=>{s.destroy()};return i.on("error",o),i.on("frameError",o),i.on("close",o),n.requestTimeout&&i.setTimeout(n.requestTimeout,o),s.retain(),s}destroy(){for(let[e,n]of this.connectionPools){for(let r of[...n])r.destroy();this.connectionPools.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=e;for(let n of this.connectionPools.values())n.setMaxConcurrency(e)}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}setNodeHttp2ConnectOptions(e){this.connectOptions=e}debug(){let e={};for(let[n,r]of this.connectionPools){let s=[];for(let i of r)s.push({id:i.id,active:i.useCount(),maxConcurrent:i.max,totalRequests:i.total});e[n]={sessions:s}}return e}removeFromPoolAndClose(e,n){this.connectionPools.get(e)?.remove(n),n.close()}removeFromPoolAndCheckedDestroy(e,n){this.connectionPools.get(e)?.remove(n),n.destroy()}getPool(e){if(!this.connectionPools.has(e)){let n=new QQe;this.config.maxConcurrency&&n.setMaxConcurrency(this.config.maxConcurrency),this.connectionPools.set(e,n)}return this.connectionPools.get(e)}getUrlString(e){return e.destination.toString()}connect(e){return this.connectOptions===void 0?Zue.connect(e):Zue.connect(e,this.connectOptions)}},$Qe=class t{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new UQe({});static create(e){return typeof e?.handle=="function"?e:new t(e)}constructor(e){this.configProvider=new Promise((n,r)=>{typeof e=="function"?e().then(s=>{n(s||{})}).catch(r):n(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:n,requestTimeout:r,isEventStream:s}={}){if(!this.config){this.config=await this.configProvider;let{disableConcurrentStreams:u,maxConcurrentStreams:l,nodeHttp2ConnectOptions:d}=this.config;this.connectionManager.setDisableConcurrentStreams(u??!1),l&&this.connectionManager.setMaxConcurrentStreams(l),d&&this.connectionManager.setNodeHttp2ConnectOptions(d)}let{requestTimeout:i,disableConcurrentStreams:o}=this.config,a=o||s,c=r??i;return new Promise((u,l)=>{let d=!1,h,m=async H=>{await h,u(H)},f=async H=>{await h,l(H)};if(n?.aborted){d=!0;let H=ede(n);f(H);return}let{hostname:g,method:A,port:y,protocol:b,query:S}=e,C="";if(e.username!=null||e.password!=null){let H=e.username??"",oe=e.password??"";C=`${H}:${oe}@`}let I=`${b}//${C}${g}${y?`:${y}`:""}`,x={destination:new URL(I)},w={requestTimeout:this.config?.sessionTimeout,isEventStream:s},R=a?this.connectionManager.createIsolatedSession(x,w):this.connectionManager.lease(x,w),N=R.deref(),P=H=>{a&&R.destroy(),d=!0,f(H)},G=S?Xue.buildQueryString(S):"",$=e.path;G&&($+=`?${G}`),e.fragment&&($+=`#${e.fragment}`);let Q=N.request({...e.headers,[Zue.constants.HTTP2_HEADER_PATH]:$,[Zue.constants.HTTP2_HEADER_METHOD]:A});if(c&&Q.setTimeout(c,()=>{Q.close();let H=new Error(`Stream timed out because of no activity for ${c} ms`);H.name="TimeoutError",P(H)}),n){let H=()=>{Q.close();let oe=ede(n);P(oe)};if(typeof n.addEventListener=="function"){let oe=n;oe.addEventListener("abort",H,{once:!0}),Q.once("close",()=>oe.removeEventListener("abort",H))}else n.onabort=H}Q.on("frameError",(H,oe,re)=>{P(new Error(`Frame type id ${H} in stream id ${re} has failed with code ${oe}.`))}),Q.on("error",P),Q.on("aborted",()=>{P(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${Q.rstCode}.`))}),Q.on("response",H=>{let oe=new Xue.HttpResponse({statusCode:H[":status"]??-1,headers:pOt(H),body:Q});d=!0,m({response:oe}),a&&N.close()}),Q.on("close",()=>{a?R.destroy():this.connectionManager.release(x,R),d||P(new Error("Unexpected error: http2 request did not get a response"))}),h=hOt(Q,e,c)})}updateHttpClientConfig(e,n){this.config=void 0,this.configProvider=this.configProvider.then(r=>({...r,[e]:n}))}httpHandlerConfigs(){return this.config??{}}},GQe=class extends dOt.Writable{bufferedBytes=[];_write(e,n,r){this.bufferedBytes.push(e),r()}},T_r=t=>v_r(t)?R_r(t):new Promise((e,n)=>{let r=new GQe;t.pipe(r),t.on("error",s=>{r.end(),n(s)}),r.on("error",n),r.on("finish",function(){let s=new Uint8Array(Buffer.concat(this.bufferedBytes));e(s)})}),v_r=t=>typeof ReadableStream=="function"&&t instanceof ReadableStream;async function R_r(t){let e=[],n=t.getReader(),r=!1,s=0;for(;!r;){let{done:a,value:c}=await n.read();c&&(e.push(c),s+=c.length),r=a}let i=new Uint8Array(s),o=0;for(let a of e)i.set(a,o),o+=a.length;return i}F8.DEFAULT_REQUEST_TIMEOUT=x_r;F8.NodeHttp2Handler=$Qe;F8.NodeHttpHandler=FQe;F8.streamCollector=T_r});var gOt=ee((AMi,fOt)=>{p();var J2=1e3,X2=J2*60,Z2=X2*60,GB=Z2*24,k_r=GB*7,N_r=GB*365.25;fOt.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return D_r(t);if(n==="number"&&isFinite(t))return e.long?P_r(t):B_r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function D_r(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*N_r;case"weeks":case"week":case"w":return n*k_r;case"days":case"day":case"d":return n*GB;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Z2;case"minutes":case"minute":case"mins":case"min":case"m":return n*X2;case"seconds":case"second":case"secs":case"sec":case"s":return n*J2;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function B_r(t){var e=Math.abs(t);return e>=GB?Math.round(t/GB)+"d":e>=Z2?Math.round(t/Z2)+"h":e>=X2?Math.round(t/X2)+"m":e>=J2?Math.round(t/J2)+"s":t+"ms"}function P_r(t){var e=Math.abs(t);return e>=GB?tde(t,e,GB,"day"):e>=Z2?tde(t,e,Z2,"hour"):e>=X2?tde(t,e,X2,"minute"):e>=J2?tde(t,e,J2,"second"):t+" ms"}function tde(t,e,n,r){var s=e>=n*1.5;return Math.round(t/n)+" "+r+(s?"s":"")}});var WQe=ee((EMi,AOt)=>{p();function O_r(t){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=s,n.enabled=a,n.humanize=gOt(),n.destroy=u,Object.keys(t).forEach(l=>{n[l]=t[l]}),n.names=[],n.skips=[],n.formatters={};function e(l){let d=0;for(let h=0;h{if(x==="%%")return"%";C++;let R=n.formatters[w];if(typeof R=="function"){let N=A[C];x=R.call(y,N),A.splice(C,1),C--}return x}),n.formatArgs.call(y,A),(y.log||n.log).apply(y,A)}return g.namespace=l,g.useColors=n.useColors(),g.color=n.selectColor(l),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(m!==n.namespaces&&(m=n.namespaces,f=n.enabled(l)),f),set:A=>{h=A}}),typeof n.init=="function"&&n.init(g),g}function r(l,d){let h=n(this.namespace+(typeof d>"u"?":":d)+l);return h.log=this.log,h}function s(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];let d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of d)h[0]==="-"?n.skips.push(h.slice(1)):n.names.push(h)}function i(l,d){let h=0,m=0,f=-1,g=0;for(;h"-"+d)].join(",");return n.enable(""),l}function a(l){for(let d of n.skips)if(i(l,d))return!1;for(let d of n.names)if(i(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}AOt.exports=O_r});var yOt=ee((Df,nde)=>{p();Df.formatArgs=L_r;Df.save=F_r;Df.load=Q_r;Df.useColors=M_r;Df.storage=U_r();Df.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Df.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function M_r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function L_r(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+nde.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(n++,s==="%c"&&(r=n))}),t.splice(r,0,e)}Df.log=console.debug||console.log||(()=>{});function F_r(t){try{t?Df.storage.setItem("debug",t):Df.storage.removeItem("debug")}catch{}}function Q_r(){let t;try{t=Df.storage.getItem("debug")||Df.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function U_r(){try{return localStorage}catch{}}nde.exports=WQe()(Df);var{formatters:$_r}=nde.exports;$_r.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var bOt=ee((SMi,EOt)=>{"use strict";p();EOt.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),s=e.indexOf("--");return r!==-1&&(s===-1||r{"use strict";p();var G_r=require("os"),_Ot=require("tty"),rE=bOt(),{env:Vd}=process,vR;rE("no-color")||rE("no-colors")||rE("color=false")||rE("color=never")?vR=0:(rE("color")||rE("colors")||rE("color=true")||rE("color=always"))&&(vR=1);"FORCE_COLOR"in Vd&&(Vd.FORCE_COLOR==="true"?vR=1:Vd.FORCE_COLOR==="false"?vR=0:vR=Vd.FORCE_COLOR.length===0?1:Math.min(parseInt(Vd.FORCE_COLOR,10),3));function qQe(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function HQe(t,e){if(vR===0)return 0;if(rE("color=16m")||rE("color=full")||rE("color=truecolor"))return 3;if(rE("color=256"))return 2;if(t&&!e&&vR===void 0)return 0;let n=vR||0;if(Vd.TERM==="dumb")return n;if(process.platform==="win32"){let r=G_r.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Vd)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Vd)||Vd.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Vd)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Vd.TEAMCITY_VERSION)?1:0;if(Vd.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Vd){let r=parseInt((Vd.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Vd.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Vd.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Vd.TERM)||"COLORTERM"in Vd?1:n}function W_r(t){let e=HQe(t,t&&t.isTTY);return qQe(e)}SOt.exports={supportsColor:W_r,stdout:qQe(HQe(!0,_Ot.isatty(1))),stderr:qQe(HQe(!0,_Ot.isatty(2)))}});var xOt=ee((jd,sde)=>{p();var q_r=require("tty"),rde=require("util");jd.init=J_r;jd.log=Y_r;jd.formatArgs=V_r;jd.save=K_r;jd.load=z_r;jd.useColors=H_r;jd.destroy=rde.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");jd.colors=[6,2,3,4,5,1];try{let t=COt();t&&(t.stderr||t).level>=2&&(jd.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}jd.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,i)=>i.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function H_r(){return"colors"in jd.inspectOpts?!!jd.inspectOpts.colors:q_r.isatty(process.stderr.fd)}function V_r(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,s="\x1B[3"+(r<8?r:"8;5;"+r),i=` ${s};1m${e} \x1B[0m`;t[0]=i+t[0].split(` +`),t3t=!0)),new tge("AWS_PROFILE is set, skipping fromEnv provider.",{logger:t.logger,tryNextLink:!0});return t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),hGr(t)()},async e=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:n,ssoAccountId:r,ssoRegion:i,ssoRoleName:s,ssoSession:o}=t;if(!n&&!r&&!i&&!s&&!o)throw new tge("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:t.logger});let{fromSSO:a}=hqe();return a(t)(e)},async e=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:n}=Z5t();return n(t)(e)},async e=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:n}=r5e();return n(t)(e)},async e=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:n}=s5e();return n(t)(e)},async()=>(t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await AGr(t))()),async()=>{throw new tge("Could not load credentials from any providers",{tryNextLink:!1,logger:t.logger})}],n3t),_Gr=t=>t?.expiration!==void 0,n3t=t=>t?.expiration!==void 0&&t.expiration.getTime()-Date.now()<3e5;nge.credentialsTreatedAsExpired=n3t;nge.credentialsWillNeedRefresh=_Gr;nge.defaultProvider=bGr});var s3t=re(i3t=>{p();var{EventStreamCodec:xGr}=(r7(),wr(n7)),{Transform:SGr,Readable:CGr,PassThrough:IGr,pipeline:wGr}=require("node:stream"),a5e=class extends SGr{priorSignature;messageSigner;eventStreamCodec;systemClockOffsetProvider;staticCredentials;constructor(e){super({autoDestroy:!0,readableObjectMode:!0,writableObjectMode:!0,...e}),this.priorSignature=e.priorSignature,this.eventStreamCodec=e.eventStreamCodec,this.messageSigner=e.messageSigner,this.systemClockOffsetProvider=e.systemClockOffsetProvider,this.staticCredentials=e.credentials?.()}async _transform(e,n,r){try{let i=new Date(Date.now()+await this.systemClockOffsetProvider()),s={":date":{type:"timestamp",value:i}},o=await this.messageSigner.sign({message:{body:e,headers:s},priorSignature:this.priorSignature},{signingDate:i,eventStreamCredentials:await this.staticCredentials});this.priorSignature=o.signature;let a=this.eventStreamCodec.encode({headers:{...s,":chunk-signature":{type:"binary",value:TGr(o.signature)}},body:e});return this.push(a),r()}catch(i){r(i)}}};function TGr(t){let e=Buffer.from(t,"hex");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)}var c5e=class{messageSigner;eventStreamCodec;systemClockOffsetProvider;credentials;constructor(e){this.messageSigner=e.messageSigner,this.eventStreamCodec=new xGr(e.utf8Encoder,e.utf8Decoder),this.systemClockOffsetProvider=async()=>e.systemClockOffset??0,this.credentials=e.credentials}async handle(e,n,r={}){let i=n.request,{body:s,query:o}=i;if(!(s instanceof CGr))throw new Error("Eventstream payload must be a Readable stream.");i.body=new IGr({objectMode:!0});let c=i.headers?.authorization?.match(/Signature=([\w]+)$/)?.[1]??o?.["X-Amz-Signature"]??"";r.__staticSignature&&(c="");let u=new a5e({priorSignature:c,eventStreamCodec:this.eventStreamCodec,messageSigner:await this.messageSigner(),systemClockOffsetProvider:this.systemClockOffsetProvider,credentials:this.credentials}),l,d=new Promise((h,f)=>{l=()=>h(void 0),wGr(s,u,i.body,g=>{g&&f(new Error(`Pipeline error in @aws-sdk/eventstream-handler-node: ${g.message}`,{cause:g}))})}),m;try{m=await Promise.race([e(n),d])}catch(h){throw i.body.end(),h}finally{l()}return m}},vGr=t=>new c5e(t);i3t.eventStreamPayloadHandlerProvider=vGr});var l3t=re(RK=>{p();var{setTokenFeature:RGr}=(Pa(),wr(q_)),{getBearerTokenEnvKey:kGr}=(xh(),wr(Ihe)),{TokenProviderError:tx,getSSOTokenFilepath:BGr,parseKnownFiles:NGr,getProfileName:DGr,loadSsoSessionData:PGr,getSSOTokenFromFile:MGr,memoize:OGr,chain:LGr}=(Da(),wr(fy)),{promises:FGr}=require("node:fs"),QGr=({logger:t,signingName:e}={})=>async()=>{if(t?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"),!e)throw new tx("Please pass 'signingName' to compute environment variable key",{logger:t});let n=kGr(e);if(!(n in process.env))throw new tx(`Token not present in '${n}' environment variable`,{logger:t});let r={token:process.env[n]};return RGr(r,"BEARER_SERVICE_ENV_VARS","3"),r},UGr=300*1e3,l5e="To refresh this SSO session run 'aws sso login' with the corresponding profile.",GGr=async(t,e={},n)=>{let{SSOOIDCClient:r}=(X7(),wr(J7)),i=o=>e.clientConfig?.[o]??e.parentClientConfig?.[o]??n?.[o];return new r(Object.assign({},e.clientConfig??{},{region:t??e.clientConfig?.region,logger:i("logger"),userAgentAppId:i("userAgentAppId")}))},$Gr=async(t,e,n={},r)=>{let{CreateTokenCommand:i}=(X7(),wr(J7));return(await GGr(e,n,r)).send(new i({clientId:t.clientId,clientSecret:t.clientSecret,refreshToken:t.refreshToken,grantType:"refresh_token"}))},o3t=t=>{if(t.expiration&&t.expiration.getTime(){if(typeof e>"u")throw new tx(`Value not present for '${t}' in SSO Token${n?". Cannot refresh":""}. ${l5e}`,!1)},{writeFile:WGr}=FGr,HGr=(t,e)=>{let n=BGr(t),r=JSON.stringify(e,null,2);return WGr(n,r)},a3t=new Map,c3t=(t={})=>async({callerClientConfig:e}={})=>{t.logger?.debug("@aws-sdk/token-providers - fromSso");let n=await NGr(t),r=DGr({profile:t.profile??e?.profile}),i=n[r];if(i){if(!i.sso_session)throw new tx(`Profile '${r}' is missing required property 'sso_session'.`)}else throw new tx(`Profile '${r}' could not be found in shared credentials file.`,!1);let s=i.sso_session,a=(await PGr(t))[s];if(!a)throw new tx(`Sso session '${s}' could not be found in shared credentials file.`,!1);for(let f of["sso_start_url","sso_region"])if(!a[f])throw new tx(`Sso session '${s}' is missing required property '${f}'.`,!1);a.sso_start_url;let c=a.sso_region,u;try{u=await MGr(s)}catch{throw new tx(`The SSO session token associated with profile=${r} was not found or is invalid. ${l5e}`,!1)}DO("accessToken",u.accessToken),DO("expiresAt",u.expiresAt);let{accessToken:l,expiresAt:d}=u,m={token:l,expiration:new Date(d)};if(m.expiration.getTime()-Date.now()>UGr)return m;let h=a3t.get(s)??0;if(Date.now()-h<30*1e3)return o3t(m),m;DO("clientId",u.clientId,!0),DO("clientSecret",u.clientSecret,!0),DO("refreshToken",u.refreshToken,!0);try{a3t.set(s,Date.now());let f=await $Gr(u,c,t,e);DO("accessToken",f.accessToken),DO("expiresIn",f.expiresIn);let g=new Date(Date.now()+f.expiresIn*1e3);try{await HGr(s,{...u,accessToken:f.accessToken,expiresAt:g.toISOString(),refreshToken:f.refreshToken})}catch{}return{token:f.accessToken,expiration:g}}catch{return o3t(m),m}},qGr=({token:t,logger:e})=>async()=>{if(e?.debug("@aws-sdk/token-providers - fromStatic"),!t||!t.token)throw new tx("Please pass a valid token to fromStatic",!1);return t},jGr=(t={})=>OGr(LGr(c3t(t),async()=>{throw new tx("Could not load token from any providers",!1)}),e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,e=>e.expiration!==void 0);RK.fromEnvSigningName=QGr;RK.fromSso=c3t;RK.fromStatic=qGr;RK.nodeProvider=jGr});var WVt=re(et=>{p();var{awsEndpointFunctions:VGr,emitWarningIfUnsupportedVersion:YGr,createDefaultUserAgentProvider:zGr,NODE_APP_ID_CONFIG_OPTIONS:KGr,getAwsRegionExtensionConfiguration:JGr,resolveAwsRegionExtensionConfiguration:XGr,resolveUserAgentConfig:ZGr,resolveHostHeaderConfig:e$r,getUserAgentPlugin:t$r,getHostHeaderPlugin:n$r,getLoggerPlugin:r$r,getRecursionDetectionPlugin:i$r}=(Pa(),wr(q_)),{resolveEventStreamConfig:s$r,getEventStreamPlugin:o$r}=rUt(),{resolveWebSocketConfig:a$r,getWebSocketPlugin:c$r}=_Ut(),{memoizeIdentityProvider:l$r,isIdentityExpired:u$r,doesIdentityRequireRefresh:d$r,HttpBearerAuthSigner:S3t,getHttpAuthSchemeEndpointRuleSetPlugin:p$r,DefaultIdentityProviderConfig:m$r,getHttpSigningPlugin:h$r,createPaginator:f$r}=(Yg(),wr(AQt)),{normalizeProvider:C3t,getSmithyContext:g$r,ServiceException:A$r,NoOpLogger:y$r,emitWarningIfUnsupportedVersion:E$r,loadConfigsForDefaultMode:b$r,getDefaultExtensionConfiguration:_$r,resolveDefaultRuntimeConfig:x$r,Client:I3t,makeBuilder:S$r,createAggregatedClient:C$r}=(Yi(),wr(ppe)),{Command:I$r}=(Yi(),wr(ppe));et.$Command=I$r;et.__Client=I3t;var{resolveDefaultsModeConfig:w$r,loadConfig:PO,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:T$r,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:v$r,NODE_REGION_CONFIG_OPTIONS:R$r,NODE_REGION_CONFIG_FILE_OPTIONS:k$r,resolveRegionConfig:B$r}=(Da(),wr(fy)),{BinaryDecisionDiagram:N$r,EndpointCache:D$r,decideEndpoint:P$r,customEndpointFunctions:M$r,resolveEndpointConfig:O$r,getEndpointPlugin:L$r}=(Xc(),wr(LLt)),{eventStreamSerdeProvider:F$r,resolveEventStreamSerdeConfig:Q$r}=(r7(),wr(n7)),{parseUrl:U$r,getHttpHandlerExtensionConfiguration:G$r,resolveHttpHandlerRuntimeConfig:$$r,getContentLengthPlugin:W$r}=(ti(),wr(vC)),{DEFAULT_RETRY_MODE:H$r,NODE_RETRY_MODE_CONFIG_OPTIONS:q$r,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:j$r,resolveRetryConfig:V$r,getRetryPlugin:Y$r}=(g0(),wr(WFt)),{TypeRegistry:w3t,getSchemaSerdePlugin:z$r}=(bo(),wr(uPt)),{resolveAwsSdkSigV4Config:K$r,AwsSdkSigV4Signer:T3t,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:J$r}=(xh(),wr(Ihe)),{defaultProvider:X$r}=r3t(),{eventStreamPayloadHandlerProvider:Z$r}=s3t(),{fromEnvSigningName:eWr,nodeProvider:tWr}=l3t(),{toUtf8:nWr,fromUtf8:rWr,toBase64:iWr,fromBase64:sWr,calculateBodyLength:oWr}=(Mi(),wr(k1)),{streamCollector:aWr,NodeHttp2Handler:cWr}=Y1(),{AwsRestJsonProtocol:lWr}=(aH(),wr(B$t)),{Sha256:uWr}=(N1(),wr(V2t)),dWr=async(t,e,n)=>({operation:g$r(e).operation,region:await C3t(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function pWr(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:t.region},propertiesExtractor:(e,n)=>({signingProperties:{config:e,context:n}})}}function mWr(t){return{schemeId:"smithy.api#httpBearerAuth",propertiesExtractor:({profile:e,filepath:n,configFilepath:r,ignoreCache:i},s)=>({identityProperties:{profile:e,filepath:n,configFilepath:r,ignoreCache:i}})}}var hWr=t=>{let e=[];switch(t.operation){default:e.push(pWr(t)),e.push(mWr())}return e},fWr=t=>{let e=l$r(t.token,u$r,d$r),n=K$r(t);return Object.assign(n,{authSchemePreference:C3t(t.authSchemePreference??[]),token:e})},gWr=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"bedrock"}),AWr={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},yWr="3.1126.0",EWr={version:yWr},BK="ref",MO=-1,rge=!0,u3t="isSet",v3t="PartitionResult",ige="booleanEquals",d3t="getAttr",p3t={[BK]:"Endpoint"},m3t={[BK]:v3t},kK={},h3t=[{[BK]:"Region"}],f3t={conditions:[[u3t,[p3t]],[u3t,h3t],["aws.partition",h3t,v3t],[ige,[{[BK]:"UseFIPS"},rge]],[ige,[{[BK]:"UseDualStack"},rge]],[ige,[{fn:d3t,argv:[m3t,"supportsDualStack"]},rge]],[ige,[{fn:d3t,argv:[m3t,"supportsFIPS"]},rge]]],results:[[MO],[MO,"Invalid Configuration: FIPS and custom endpoint are not supported"],[MO,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[p3t,kK],["https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",kK],[MO,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}",kK],[MO,"FIPS is enabled but this partition does not support FIPS"],["https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}",kK],[MO,"DualStack is enabled but this partition does not support DualStack"],["https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}",kK],[MO,"Invalid Configuration: Missing Region"]]},bWr=2,_y=1e8,_Wr=new Int32Array([-1,1,-1,0,12,3,1,4,_y+11,2,5,_y+11,3,8,6,4,7,_y+10,5,_y+8,_y+9,4,10,9,6,_y+6,_y+7,5,11,_y+5,6,_y+4,_y+5,3,_y+1,13,4,_y+2,_y+3]),xWr=N$r.from(_Wr,bWr,f3t.conditions,f3t.results),SWr=new D$r({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),CWr=(t,e={})=>SWr.get(t,()=>P$r(xWr,{endpointParams:t,logger:e.logger}));M$r.aws=VGr;var Ih=class t extends A$r{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}},sge=class t extends Ih{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},oge=class t extends Ih{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,t.prototype)}},age=class t extends Ih{name="ThrottlingException";$fault="client";constructor(e){super({name:"ThrottlingException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},cge=class t extends Ih{name="ValidationException";$fault="client";constructor(e){super({name:"ValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},lge=class t extends Ih{name="ConflictException";$fault="client";constructor(e){super({name:"ConflictException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},uge=class t extends Ih{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},dge=class t extends Ih{name="ServiceQuotaExceededException";$fault="client";constructor(e){super({name:"ServiceQuotaExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},pge=class t extends Ih{name="ServiceUnavailableException";$fault="server";constructor(e){super({name:"ServiceUnavailableException",$fault:"server",...e}),Object.setPrototypeOf(this,t.prototype)}},mge=class t extends Ih{name="ModelErrorException";$fault="client";originalStatusCode;resourceName;constructor(e){super({name:"ModelErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.originalStatusCode=e.originalStatusCode,this.resourceName=e.resourceName}},hge=class t extends Ih{name="ModelNotReadyException";$fault="client";$retryable={};constructor(e){super({name:"ModelNotReadyException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},fge=class t extends Ih{name="ModelTimeoutException";$fault="client";constructor(e){super({name:"ModelTimeoutException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype)}},gge=class t extends Ih{name="ModelStreamErrorException";$fault="client";originalStatusCode;originalMessage;constructor(e){super({name:"ModelStreamErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,t.prototype),this.originalStatusCode=e.originalStatusCode,this.originalMessage=e.originalMessage}},IWr="Accept",wWr="AudioBlock",TWr="AccessDeniedException",vWr="ApplyGuardrail",RWr="AppliedGuardrailDetails",kWr="ApplyGuardrailRequest",BWr="ApplyGuardrailResponse",NWr="AsyncInvokeMessage",DWr="AsyncInvokeOutputDataConfig",PWr="AsyncInvokeSummary",MWr="AsyncInvokeS3OutputDataConfig",OWr="AsyncInvokeSummaries",LWr="AudioSource",FWr="AnyToolChoice",QWr="AutoToolChoice",UWr="Body",GWr="BidirectionalInputPayloadPart",$Wr="BidirectionalOutputPayloadPart",WWr="Citation",HWr="ContentBlocks",qWr="ContentBlockDelta",jWr="ContentBlockDeltaEvent",VWr="ContentBlockStart",YWr="ContentBlockStartEvent",zWr="ContentBlockStopEvent",KWr="ContentBlock",JWr="CitationsConfig",XWr="CitationsContentBlock",ZWr="CacheDetail",eHr="CacheDetailsList",tHr="CitationsDelta",nHr="ConflictException",rHr="CitationGeneratedContent",iHr="CitationGeneratedContentList",sHr="CitationLocation",oHr="ConverseMetrics",aHr="ConverseOutput",cHr="CachePointBlock",lHr="ConverseRequest",uHr="ConverseResponse",dHr="ConverseStream",pHr="CitationSourceContent",mHr="CitationSourceContentDelta",hHr="CitationSourceContentList",fHr="CitationSourceContentListDelta",gHr="ConverseStreamMetrics",AHr="ConverseStreamMetadataEvent",yHr="ConverseStreamOutput",EHr="ConverseStreamRequest",bHr="ConverseStreamResponse",_Hr="ConverseStreamTrace",xHr="ConverseTrace",SHr="CountTokensInput",CHr="ConverseTokensRequest",IHr="CountTokensRequest",wHr="CountTokensResponse",d5e="Content-Type",THr="CountTokens",vHr="Citations",RHr="Converse",kHr="DocumentBlock",BHr="DocumentContentBlocks",NHr="DocumentContentBlock",DHr="DocumentCharLocation",PHr="DocumentChunkLocation",MHr="DocumentPageLocation",OHr="DocumentSource",LHr="ErrorBlock",FHr="GuardrailAssessment",QHr="GetAsyncInvoke",UHr="GetAsyncInvokeRequest",GHr="GetAsyncInvokeResponse",$Hr="GuardrailAssessmentList",WHr="GuardrailAssessmentListMap",HHr="GuardrailAssessmentMap",qHr="GuardrailAutomatedReasoningDifferenceScenarioList",jHr="GuardrailAutomatedReasoningFinding",VHr="GuardrailAutomatedReasoningFindingList",YHr="GuardrailAutomatedReasoningImpossibleFinding",zHr="GuardrailAutomatedReasoningInvalidFinding",KHr="GuardrailAutomatedReasoningInputTextReference",JHr="GuardrailAutomatedReasoningInputTextReferenceList",XHr="GuardrailAutomatedReasoningLogicWarning",ZHr="GuardrailAutomatedReasoningNoTranslationsFinding",eqr="GuardrailAutomatedReasoningPolicyAssessment",tqr="GuardrailAutomatedReasoningRule",nqr="GuardrailAutomatedReasoningRuleList",rqr="GuardrailAutomatedReasoningScenario",iqr="GuardrailAutomatedReasoningSatisfiableFinding",sqr="GuardrailAutomatedReasoningStatementList",oqr="GuardrailAutomatedReasoningStatementLogicContent",aqr="GuardrailAutomatedReasoningStatementNaturalLanguageContent",cqr="GuardrailAutomatedReasoningStatement",lqr="GuardrailAutomatedReasoningTranslation",uqr="GuardrailAutomatedReasoningTranslationAmbiguousFinding",dqr="GuardrailAutomatedReasoningTooComplexFinding",pqr="GuardrailAutomatedReasoningTranslationList",mqr="GuardrailAutomatedReasoningTranslationOption",hqr="GuardrailAutomatedReasoningTranslationOptionList",fqr="GuardrailAutomatedReasoningValidFinding",gqr="GuardrailConfiguration",Aqr="GuardrailContentBlock",yqr="GuardrailContentBlockList",Eqr="GuardrailChecksConfig",bqr="GuardrailChecksContentBlock",_qr="GuardrailChecksContentBlockList",xqr="GuardrailConverseContentBlock",Sqr="GuardrailChecksContentFilterConfig",Cqr="GuardrailChecksContentFilterCategoryConfig",Iqr="GuardrailChecksContentFilterCategoryConfigList",wqr="GuardrailChecksContentFilterResult",Tqr="GuardrailChecksContentFilterResultEntry",vqr="GuardrailChecksContentFilterResultList",Rqr="GuardrailChecksContentFilterUsage",kqr="GuardrailContentFilter",Bqr="GuardrailContentFilterList",Nqr="GuardrailContextualGroundingFilter",Dqr="GuardrailContextualGroundingFilters",Pqr="GuardrailContextualGroundingPolicyAssessment",Mqr="GuardrailConverseImageBlock",Oqr="GuardrailConverseImageSource",Lqr="GuardrailChecksMessage",Fqr="GuardrailChecksMessageList",Qqr="GuardrailContentPolicyAssessment",Uqr="GuardrailChecksPromptAttackConfig",Gqr="GuardrailChecksPromptAttackCategoryConfig",$qr="GuardrailChecksPromptAttackCategoryConfigList",Wqr="GuardrailChecksPromptAttackResult",Hqr="GuardrailChecksPromptAttackResultEntry",qqr="GuardrailChecksPromptAttackResultList",jqr="GuardrailChecksPromptAttackUsage",Vqr="GuardrailChecksResults",Yqr="GuardrailChecksSensitiveInformationConfig",zqr="GuardrailChecksSensitiveInformationEntityConfig",Kqr="GuardrailChecksSensitiveInformationEntityConfigList",Jqr="GuardrailChecksSensitiveInformationResult",Xqr="GuardrailChecksSensitiveInformationResultEntry",Zqr="GuardrailChecksSensitiveInformationResultList",e5r="GuardrailChecksSensitiveInformationUsage",t5r="GuardrailConverseTextBlock",n5r="GuardrailChecksTextContent",r5r="GuardrailChecksUsageResults",i5r="GuardrailCustomWord",s5r="GuardrailCustomWordList",o5r="GuardrailCoverage",a5r="GuardrailImageBlock",c5r="GuardrailImageCoverage",l5r="GuardrailInvocationMetrics",u5r="GuardrailImageSource",d5r="GuardrailManagedWord",p5r="GuardrailManagedWordList",m5r="GuardrailOutputContent",h5r="GuardrailOutputContentList",f5r="GuardrailPiiEntityFilter",g5r="GuardrailPiiEntityFilterList",A5r="GuardrailRegexFilter",y5r="GuardrailRegexFilterList",E5r="GuardrailStreamConfiguration",b5r="GuardrailSensitiveInformationPolicyAssessment",_5r="GuardrailTopic",x5r="GuardrailTraceAssessment",S5r="GuardrailTextBlock",C5r="GuardrailTextCharactersCoverage",I5r="GuardrailTopicList",w5r="GuardrailTopicPolicyAssessment",T5r="GuardrailUsage",v5r="GuardrailWordPolicyAssessment",R5r="ImageBlock",k5r="ImageBlockDelta",B5r="ImageBlockStart",N5r="InferenceConfiguration",D5r="InvokeGuardrailChecks",P5r="InvokeGuardrailChecksRequest",M5r="InvokeGuardrailChecksResponse",O5r="InvokeModel",L5r="InvokeModelRequest",F5r="InvokeModelResponse",Q5r="InvokeModelTokensRequest",U5r="InvokeModelWithBidirectionalStream",G5r="InvokeModelWithBidirectionalStreamInput",$5r="InvokeModelWithBidirectionalStreamOutput",W5r="InvokeModelWithBidirectionalStreamRequest",H5r="InvokeModelWithBidirectionalStreamResponse",q5r="InvokeModelWithResponseStream",j5r="InvokeModelWithResponseStreamRequest",V5r="InvokeModelWithResponseStreamResponse",Y5r="ImageSource",z5r="InternalServerException",K5r="JsonSchemaDefinition",J5r="ListAsyncInvokes",X5r="ListAsyncInvokesRequest",Z5r="ListAsyncInvokesResponse",e3r="Message",t3r="ModelErrorException",n3r="ModelInputPayload",r3r="ModelNotReadyException",i3r="MessageStartEvent",s3r="ModelStreamErrorException",o3r="MessageStopEvent",a3r="ModelTimeoutException",c3r="Messages",l3r="OutputConfig",u3r="OutputFormat",d3r="OutputFormatStructure",p3r="PartBody",m3r="PerformanceConfiguration",h3r="PayloadPart",f3r="PromptRouterTrace",g3r="PromptVariableMap",A3r="PromptVariableValues",y3r="ReasoningContentBlock",E3r="ReasoningContentBlockDelta",b3r="RequestMetadata",_3r="RequestMetadataJson",x3r="ResourceNotFoundException",S3r="ResponseStream",C3r="ReasoningTextBlock",I3r="StartAsyncInvoke",w3r="StartAsyncInvokeRequest",T3r="StartAsyncInvokeResponse",v3r="SystemContentBlocks",R3r="SystemContentBlock",k3r="S3Location",B3r="ServiceQuotaExceededException",N3r="SearchResultBlock",D3r="SearchResultContentBlock",P3r="SearchResultContentBlocks",M3r="SearchResultLocation",O3r="ServiceTier",L3r="SpecificToolChoice",F3r="SystemTool",Q3r="ServiceUnavailableException",U3r="Tag",G3r="ToolAdditionBlock",$3r="ToolConfiguration",W3r="ToolChoice",H3r="ThrottlingException",q3r="ToolInputSchema",j3r="TagList",V3r="ToolReference",Y3r="ToolRemovalBlock",z3r="ToolResultBlocksDelta",K3r="ToolResultBlockDelta",J3r="ToolResultBlockStart",X3r="ToolResultBlock",Z3r="ToolResultContentBlocks",e4r="ToolResultContentBlock",t4r="ToolSpecification",n4r="TokenUsage",r4r="ToolUseBlock",i4r="ToolUseBlockDelta",s4r="ToolUseBlockStart",o4r="Tools",a4r="Tool",c4r="VideoBlock",l4r="ValidationException",u4r="VideoSource",d4r="WebLocation",p4r="X-Amzn-Bedrock-Accept",m4r="X-Amzn-Bedrock-Content-Type",R3t="X-Amzn-Bedrock-GuardrailIdentifier",k3t="X-Amzn-Bedrock-GuardrailVersion",vge="X-Amzn-Bedrock-PerformanceConfig-Latency",B3t="X-Amzn-Bedrock-Request-Metadata",Rge="X-Amzn-Bedrock-Service-Tier",N3t="X-Amzn-Bedrock-Trace",lB="action",h4r="appliedGuardrailDetails",f4r="asyncInvokeSummaries",p5e="additionalModelRequestFields",D3t="additionalModelResponseFieldPaths",P3t="additionalModelResponseFields",M3t="actionReason",g4r="automatedReasoningPolicy",A4r="automatedReasoningPolicyUnits",y4r="automatedReasoningPolicies",O3t="accept",E4r="any",b4r="assessments",_4r="audio",x4r="auto",ZT="bytes",L3t="bucketOwner",S4r="beginOffset",LO="body",jC="client",C4r="contentBlockDelta",m5e="contentBlockIndex",I4r="contentBlockStart",w4r="contentBlockStop",T4r="citationsContent",v4r="cacheDetails",h5e="contentFilter",R4r="claimsFalseScenario",k4r="contextualGroundingPolicy",B4r="contextualGroundingPolicyUnits",N4r="contentIndex",D4r="contentPolicy",P4r="contentPolicyImageUnits",M4r="contentPolicyUnits",f5e="cachePoint",F3t="contradictingRules",O4r="cacheReadInputTokens",g5e="clientRequestToken",L4r="confidenceScore",kge="contentType",Q3t="claimsTrueScenario",F4r="customWords",Q4r="cacheWriteInputTokens",Bge="category",U3t="categories",U4r="checks",A5e="chunk",y5e="citations",G4r="citation",G3t="claims",FO="content",$4r="context",$3t="confidence",W4r="converse",H4r="delta",q4r="documentChar",j4r="documentChunk",E5e="documentIndex",V4r="documentPage",Y4r="differenceScenarios",QO="detected",W3t="description",z4r="domain",H3t="document",Rf="error",K4r="endOffset",q3t="endTime",J4r="effort",X4r="enabled",Nge="end",Z4r="entities",UO="format",j3t="failureMessage",e8r="filterStrength",t8r="findings",V3t="filters",Y3t="guardrail",n8r="guardrailArn",z3t="guardrailCoverage",K3t="guardrailConfig",J3t="guardContent",r8r="guardrailId",OK="guardrailIdentifier",i8r="guardrailOrigin",s8r="guardrailOwnership",o8r="guardrailProcessingLatency",hH="guardrailVersion",X3t="guarded",nx="http",C0="httpError",bu="httpHeader",OO="httpQuery",b5e="input",Dge="invocationArn",a8r="inputAssessment",Z3t="inferenceConfig",c8r="invocationMetrics",l8r="invokedModelId",u8r="invokeModel",d8r="inputSchema",_5e="internalServerException",x5e="inputTokens",p8r="identifier",m8r="images",fH="image",h8r="impossible",f8r="invalid",S5e="json",g8r="jsonSchema",A8r="key",y8r="kmsKeyId",e4t="location",t4t="latencyMs",n4t="lastModifiedTime",Pge="logicWarning",E8r="latency",b8r="logic",Xg="message",r4t="modelArn",GO="modelId",_8r="messageIndex",x8r="modelInput",S8r="modelOutput",g3t="maxResults",C8r="messageStart",C5e="modelStreamErrorException",I8r="messageStop",w8r="maxTokens",i4t="modelTimeoutException",T8r="managedWordLists",Mge="match",Oge="messages",s4t="metrics",v8r="metadata",VC="name",R8r="naturalLanguage",u5e="nextToken",k8r="noTranslations",B8r="outputs",N8r="outputAssessments",o4t="outputConfig",I5e="outputDataConfig",D8r="originalMessage",P8r="outputScope",a4t="originalStatusCode",M8r="outputTokens",O8r="options",L8r="output",c4t="premises",w5e="promptAttack",Lge="performanceConfig",Fge="performanceConfigLatency",F8r="piiEntities",l4t="promptRouter",u4t="promptVariables",Q8r="policyVersionArn",d4t="qualifiers",Qge="results",p4t="reasoningContent",m4t="redactedContent",Uge="requestMetadata",U8r="resourceName",G8r="reasoningText",$8r="regex",W8r="regexes",T5e="role",h4t="smithy.ts.sdk.synthetic.com.amazonaws.bedrockruntime",A3t="sortBy",f4t="sourceContent",y3t="statusEquals",v5e="sensitiveInformation",H8r="sensitiveInformationPolicy",q8r="sensitiveInformationPolicyFreeUnits",j8r="sensitiveInformationPolicyUnits",Gge="s3Location",V8r="serverName",E3t="sortOrder",Y8r="s3OutputDataConfig",z8r="streamProcessingMode",g4t="stopReason",K8r="searchResultIndex",J8r="searchResultLocation",A4t="searchResult",X8r="supportingRules",y4t="severityScore",Z8r="stopSequences",E4t="submitTime",b3t="submitTimeAfter",_3t="submitTimeBefore",uB="serviceTier",ejr="systemTool",tjr="s3Uri",R5e="serviceUnavailableException",njr="satisfiable",rjr="score",ijr="schema",b4t="server",_4t="signature",rx="source",$ge="status",LK="start",sjr="statements",ojr="stream",Wge="streaming",ajr="strict",cjr="structure",k5e="system",x4t="ttl",ljr="toolAddition",ujr="translationAmbiguous",B5e="toolConfig",djr="textCharacters",pjr="toolChoice",mjr="tooComplex",N5e="throttlingException",hjr="textFormat",fjr="topicPolicy",gjr="topicPolicyUnits",Ajr="topP",D5e="toolResult",yjr="toolRemoval",Ejr="toolSpec",bjr="totalTokens",P5e="textUnits",Hge="toolUseId",M5e="toolUse",_jr="tags",Zu="text",xjr="temperature",Sjr="threshold",O5e="title",S4t="total",L5e="tool",Cjr="tools",Ijr="topics",gH="trace",qge="translation",wjr="translations",Tjr="truncated",wh="type",FK="usage",vjr="untranslatedClaims",Rjr="untranslatedPremises",kjr="uri",Bjr="url",Njr="value",F5e="validationException",Djr="valid",C4t="video",Pjr="web",Mjr="wordPolicy",Ojr="wordPolicyUnits",at="com.amazonaws.bedrockruntime",I4t=w3t.for(h4t),w4t=[-3,h4t,"BedrockRuntimeServiceException",0,[],[]];I4t.registerError(w4t,Ih);var xy=w3t.for(at),T4t=[-3,at,TWr,{[Rf]:jC,[C0]:403},[Xg],[0]];xy.registerError(T4t,sge);var v4t=[-3,at,nHr,{[Rf]:jC,[C0]:400},[Xg],[0]];xy.registerError(v4t,lge);var QK=[-3,at,z5r,{[Rf]:b4t,[C0]:500},[Xg],[0]];xy.registerError(QK,oge);var R4t=[-3,at,t3r,{[Rf]:jC,[C0]:424},[Xg,a4t,U8r],[0,1,0]];xy.registerError(R4t,mge);var k4t=[-3,at,r3r,{[Rf]:jC,[C0]:429},[Xg],[0]];xy.registerError(k4t,hge);var UK=[-3,at,s3r,{[Rf]:jC,[C0]:424},[Xg,a4t,D8r],[0,1,0]];xy.registerError(UK,gge);var jge=[-3,at,a3r,{[Rf]:jC,[C0]:408},[Xg],[0]];xy.registerError(jge,fge);var B4t=[-3,at,x3r,{[Rf]:jC,[C0]:404},[Xg],[0]];xy.registerError(B4t,uge);var N4t=[-3,at,B3r,{[Rf]:jC,[C0]:400},[Xg],[0]];xy.registerError(N4t,dge);var GK=[-3,at,Q3r,{[Rf]:b4t,[C0]:503},[Xg],[0]];xy.registerError(GK,pge);var $K=[-3,at,H3r,{[Rf]:jC,[C0]:429},[Xg],[0]];xy.registerError($K,age);var WK=[-3,at,l4r,{[Rf]:jC,[C0]:400},[Xg],[0]];xy.registerError(WK,cge);var D4t=[I4t,xy],P4t=[0,at,NWr,8,0],Vge=[0,at,UWr,8,21],Ljr=[0,at,oqr,8,0],M4t=[0,at,aqr,8,0],Fjr=[0,at,n5r,8,0],Qjr=[0,at,n3r,8,15],Q5e=[0,at,p3r,8,21],O4t=[0,at,_3r,8,0],L4t=[3,at,FWr,0,[],[]],F4t=[3,at,RWr,0,[r8r,hH,n8r,i8r,s8r],[0,0,0,64,0]],Q4t=[3,at,kWr,0,[OK,hH,rx,FO,P8r],[[0,1],[0,1],0,[()=>oVr,0],0],4],U4t=[3,at,BWr,0,[FK,lB,B8r,b4r,M3t,z3t],[()=>q5e,0,()=>dVr,[()=>Xjt,0],0,()=>W5e],4],G4t=[3,at,MWr,0,[tjr,y8r,L3t],[0,0,0],1],$4t=[3,at,PWr,0,[Dge,r4t,E4t,I5e,g5e,$ge,j3t,n4t,q3t],[0,0,5,()=>Jge,0,0,[()=>P4t,0],5,5],4],W4t=[3,at,wWr,0,[UO,rx,Rf],[0,[()=>tVt,0],[()=>zge,0]],2],H4t=[3,at,QWr,0,[],[]],q4t=[3,at,GWr,8,[ZT],[[()=>Q5e,0]]],j4t=[3,at,$Wr,8,[ZT],[[()=>Q5e,0]]],V4t=[3,at,ZWr,0,[x4t,x5e],[0,1],2],Yge=[3,at,cHr,0,[wh,x4t],[0,0],1],Y4t=[3,at,WWr,0,[O5e,rx,f4t,e4t],[0,0,()=>Hjr,()=>i3e]],U5e=[3,at,JWr,0,[X4r],[2],1],z4t=[3,at,XWr,0,[FO,y5e],[()=>$jr,()=>Wjr]],K4t=[3,at,tHr,0,[O5e,rx,f4t,e4t],[0,0,()=>qjr,()=>i3e]],J4t=[3,at,mHr,0,[Zu],[0]],X4t=[3,at,jWr,0,[H4r,m5e],[[()=>sVt,0],1],2],Z4t=[3,at,YWr,0,[LK,m5e],[()=>oVt,1],2],e8t=[3,at,zWr,0,[m5e],[1],1],t8t=[3,at,oHr,0,[t4t],[1],1],n8t=[3,at,lHr,0,[GO,Oge,k5e,Z3t,B5e,K3t,p5e,u4t,D3t,Uge,Lge,uB,o4t],[[0,1],[()=>n3e,0],[()=>r3e,0],()=>V5e,()=>Kge,()=>z8t,15,[()=>Zjt,0],64,[()=>eVt,0],()=>qK,()=>VK,[()=>z5e,0]],1],r8t=[3,at,uHr,0,[L8r,g4t,FK,s4t,P3t,gH,Lge,uB],[[()=>aVt,0],0,()=>X5e,()=>t8t,15,[()=>u8t,0],()=>qK,()=>VK],4],i8t=[3,at,AHr,0,[FK,s4t,gH,Lge,uB],[()=>X5e,()=>s8t,[()=>c8t,0],()=>qK,()=>VK],2],s8t=[3,at,gHr,0,[t4t],[1],1],o8t=[3,at,EHr,0,[GO,Oge,k5e,Z3t,B5e,K3t,p5e,u4t,D3t,Uge,Lge,uB,o4t],[[0,1],[()=>n3e,0],[()=>r3e,0],()=>V5e,()=>Kge,()=>djt,15,[()=>Zjt,0],64,[()=>eVt,0],()=>qK,()=>VK,[()=>z5e,0]],1],a8t=[3,at,bHr,0,[ojr],[[()=>cVt,16]]],c8t=[3,at,_Hr,0,[Y3t,l4t],[[()=>H5e,0],()=>K5e]],l8t=[3,at,CHr,0,[Oge,k5e,B5e,p5e],[[()=>n3e,0],[()=>r3e,0],()=>Kge,15]],u8t=[3,at,xHr,0,[Y3t,l4t],[[()=>H5e,0],()=>K5e]],d8t=[3,at,IHr,0,[GO,b5e],[[0,1],[()=>lVt,0]],2],p8t=[3,at,wHr,0,[x5e],[1],1],G5e=[3,at,kHr,0,[VC,rx,UO,$4r,y5e],[0,()=>dVt,0,0,()=>U5e],2],m8t=[3,at,DHr,0,[E5e,LK,Nge],[1,1,1]],h8t=[3,at,PHr,0,[E5e,LK,Nge],[1,1,1]],f8t=[3,at,MHr,0,[E5e,LK,Nge],[1,1,1]],zge=[3,at,LHr,8,[Xg],[0]],g8t=[3,at,UHr,0,[Dge],[[0,1]],1],A8t=[3,at,GHr,0,[Dge,r4t,$ge,E4t,I5e,g5e,j3t,n4t,q3t],[0,0,0,5,()=>Jge,0,[()=>P4t,0],5,5],5],$5e=[3,at,FHr,0,[fjr,D4r,Mjr,H8r,k4r,g4r,c8r,h4r],[()=>fjt,()=>J8t,()=>gjt,()=>ujt,()=>Z8t,[()=>x8t,0],()=>sjt,()=>F4t]],y8t=[3,at,YHr,0,[qge,F3t,Pge],[[()=>AH,0],()=>t3e,[()=>HK,0]]],E8t=[3,at,KHr,0,[Zu],[[()=>M4t,0]]],b8t=[3,at,zHr,0,[qge,F3t,Pge],[[()=>AH,0],()=>t3e,[()=>HK,0]]],HK=[3,at,XHr,0,[wh,c4t,G3t],[0,[()=>DK,0],[()=>DK,0]]],_8t=[3,at,ZHr,0,[],[]],x8t=[3,at,eqr,0,[t8r],[[()=>zjr,0]]],S8t=[3,at,tqr,0,[p8r,Q8r],[0,0]],C8t=[3,at,iqr,0,[qge,Q3t,R4r,Pge],[[()=>AH,0],[()=>NK,0],[()=>NK,0],[()=>HK,0]]],NK=[3,at,rqr,0,[sjr],[[()=>DK,0]]],I8t=[3,at,cqr,0,[b8r,R8r],[[()=>Ljr,0],[()=>M4t,0]]],w8t=[3,at,dqr,0,[],[]],AH=[3,at,lqr,0,[c4t,G3t,Rjr,vjr,$3t],[[()=>DK,0],[()=>DK,0],[()=>x3t,0],[()=>x3t,0],1]],T8t=[3,at,uqr,0,[O8r,Y4r],[[()=>Jjr,0],[()=>Yjr,0]]],v8t=[3,at,mqr,0,[wjr],[[()=>Kjr,0]]],R8t=[3,at,fqr,0,[qge,Q3t,X8r,Pge],[[()=>AH,0],[()=>NK,0],()=>t3e,[()=>HK,0]]],k8t=[3,at,Eqr,0,[h5e,w5e,v5e],[()=>N8t,()=>F8t,()=>W8t]],B8t=[3,at,Cqr,0,[Bge],[0],1],N8t=[3,at,Sqr,0,[U3t],[()=>Zjr],1],D8t=[3,at,wqr,0,[Qge],[()=>eVr],1],P8t=[3,at,Tqr,0,[Bge,y4t],[0,1],2],M8t=[3,at,Rqr,0,[P5e],[1],1],O8t=[3,at,Lqr,0,[T5e,FO],[0,[()=>Xjr,0]],2],L8t=[3,at,Gqr,0,[Bge],[0],1],F8t=[3,at,Uqr,0,[U3t],[()=>nVr],1],Q8t=[3,at,Wqr,0,[Qge],[()=>rVr],1],U8t=[3,at,Hqr,0,[Bge,y4t],[0,1],2],G8t=[3,at,jqr,0,[P5e],[1],1],$8t=[3,at,Vqr,0,[h5e,w5e,v5e],[()=>D8t,()=>Q8t,()=>q8t]],W8t=[3,at,Yqr,0,[Z4r],[()=>iVr],1],H8t=[3,at,zqr,0,[wh],[0],1],q8t=[3,at,Jqr,0,[Qge,Tjr],[()=>sVr,2],1],j8t=[3,at,Xqr,0,[wh,L4r,S4r,K4r,_8r,N4r],[0,1,1,1,1,1],6],V8t=[3,at,e5r,0,[P5e],[1],1],Y8t=[3,at,r5r,0,[h5e,w5e,v5e],[()=>M8t,()=>G8t,()=>V8t]],z8t=[3,at,gqr,0,[OK,hH,gH],[0,0,0]],K8t=[3,at,kqr,0,[wh,$3t,lB,e8r,QO],[0,0,0,0,2],3],J8t=[3,at,Qqr,0,[V3t],[()=>aVr],1],X8t=[3,at,Nqr,0,[wh,Sjr,rjr,lB,QO],[0,1,1,0,2],4],Z8t=[3,at,Pqr,0,[V3t],[()=>cVr]],ejt=[3,at,Mqr,8,[UO,rx],[0,[()=>fVt,0]],2],tjt=[3,at,t5r,0,[Zu,d4t],[0,64],1],W5e=[3,at,o5r,0,[djr,m8r],[()=>mjt,()=>ijt]],njt=[3,at,i5r,0,[Mge,lB,QO],[0,0,2],2],rjt=[3,at,a5r,8,[UO,rx],[0,[()=>gVt,0]],2],ijt=[3,at,c5r,0,[X3t,S4t],[1,1]],sjt=[3,at,l5r,0,[o8r,FK,z3t],[1,()=>q5e,()=>W5e]],ojt=[3,at,d5r,0,[Mge,wh,lB,QO],[0,0,0,2],3],ajt=[3,at,m5r,0,[Zu],[0]],cjt=[3,at,f5r,0,[Mge,wh,lB,QO],[0,0,0,2],3],ljt=[3,at,A5r,0,[lB,VC,Mge,$8r,QO],[0,0,0,0,2],1],ujt=[3,at,b5r,0,[F8r,W8r],[()=>pVr,()=>mVr],2],djt=[3,at,E5r,0,[OK,hH,gH,z8r],[0,0,0,0]],pjt=[3,at,S5r,0,[Zu,d4t],[0,64],1],mjt=[3,at,C5r,0,[X3t,S4t],[1,1]],hjt=[3,at,_5r,0,[VC,wh,lB,QO],[0,0,0,2],3],fjt=[3,at,w5r,0,[Ijr],[()=>hVr],1],H5e=[3,at,x5r,0,[S8r,a8r,N8r,M3t],[64,[()=>_Vr,0],[()=>bVr,0],0]],q5e=[3,at,T5r,0,[gjr,M4r,Ojr,j8r,q8r,B4r,P4r,A4r,y4r],[1,1,1,1,1,1,1,1,1],6],gjt=[3,at,v5r,0,[F4r,T8r],[()=>lVr,()=>uVr],2],j5e=[3,at,R5r,0,[UO,rx,Rf],[0,[()=>o3e,0],[()=>zge,0]],2],Ajt=[3,at,k5r,0,[rx,Rf],[[()=>o3e,0],[()=>zge,0]]],yjt=[3,at,B5r,0,[UO],[0],1],V5e=[3,at,N5r,0,[w8r,xjr,Ajr,Z8r],[1,1,1,64]],Ejt=[3,at,P5r,0,[Oge,U4r],[[()=>tVr,0],()=>k8t],2],bjt=[3,at,M5r,0,[Qge,FK],[()=>$8t,()=>Y8t],2],_jt=[3,at,L5r,0,[GO,LO,kge,O3t,gH,OK,hH,Fge,uB,Uge],[[0,1],[()=>Vge,16],[0,{[bu]:d5e}],[0,{[bu]:IWr}],[0,{[bu]:N3t}],[0,{[bu]:R3t}],[0,{[bu]:k3t}],[0,{[bu]:vge}],[0,{[bu]:Rge}],[()=>O4t,{[bu]:B3t}]],1],xjt=[3,at,F5r,0,[LO,kge,Fge,uB],[[()=>Vge,16],[0,{[bu]:d5e}],[0,{[bu]:vge}],[0,{[bu]:Rge}]],2],Sjt=[3,at,Q5r,0,[LO],[[()=>Vge,0]],1],Cjt=[3,at,W5r,0,[GO,LO],[[0,1],[()=>AVt,16]],2],Ijt=[3,at,H5r,0,[LO],[[()=>yVt,16]],1],wjt=[3,at,j5r,0,[GO,LO,kge,O3t,gH,OK,hH,Fge,uB,Uge],[[0,1],[()=>Vge,16],[0,{[bu]:d5e}],[0,{[bu]:p4r}],[0,{[bu]:N3t}],[0,{[bu]:R3t}],[0,{[bu]:k3t}],[0,{[bu]:vge}],[0,{[bu]:Rge}],[()=>O4t,{[bu]:B3t}]],1],Tjt=[3,at,V5r,0,[LO,kge,Fge,uB],[[()=>SVt,16],[0,{[bu]:m4r}],[0,{[bu]:vge}],[0,{[bu]:Rge}]],2],vjt=[3,at,K5r,0,[ijr,VC,W3t],[0,0,0],1],Rjt=[3,at,X5r,0,[b3t,_3t,y3t,g3t,u5e,A3t,E3t],[[5,{[OO]:b3t}],[5,{[OO]:_3t}],[0,{[OO]:y3t}],[1,{[OO]:g3t}],[0,{[OO]:u5e}],[0,{[OO]:A3t}],[0,{[OO]:E3t}]]],kjt=[3,at,Z5r,0,[u5e,f4r],[0,[()=>Ujr,0]]],Y5e=[3,at,e3r,0,[T5e,FO],[0,[()=>jjr,0]],2],Bjt=[3,at,i3r,0,[T5e],[0],1],Njt=[3,at,o3r,0,[g4t,P3t],[0,15],1],z5e=[3,at,l3r,0,[hjr,J4r],[[()=>Djt,0],0]],Djt=[3,at,u3r,0,[wh,cjr],[0,[()=>EVt,0]],2],Pjt=[3,at,h3r,8,[ZT],[[()=>Q5e,0]]],qK=[3,at,m3r,0,[E8r],[0]],K5e=[3,at,f3r,0,[l8r],[0]],Mjt=[3,at,C3r,8,[Zu,_4t],[0,0],1],jK=[3,at,k3r,0,[kjr,L3t],[0,0],1],J5e=[3,at,N3r,0,[rx,O5e,FO,y5e],[0,0,()=>fVr,()=>U5e],3],Ojt=[3,at,D3r,0,[Zu],[0],1],Ljt=[3,at,M3r,0,[K8r,LK,Nge],[1,1,1]],VK=[3,at,O3r,0,[wh],[0],1],Fjt=[3,at,L3r,0,[VC],[0],1],Qjt=[3,at,w3r,0,[GO,x8r,I5e,g5e,_jr],[0,[()=>Qjr,0],()=>Jge,[0,4],()=>gVr],3],Ujt=[3,at,T3r,0,[Dge],[0],1],Gjt=[3,at,F3r,0,[VC],[0],1],$jt=[3,at,U3r,0,[A8r,Njr],[0,0],2],X5e=[3,at,n4r,0,[x5e,M8r,bjr,O4r,Q4r,v4r],[1,1,1,1,1,()=>Gjr],3],Wjt=[3,at,G3r,0,[L5e],[()=>Z5e],1],Kge=[3,at,$3r,0,[Cjr,pjr],[()=>EVr,()=>wVt],1],Z5e=[3,at,V3r,0,[wh,VC,V8r],[0,0,0]],Hjt=[3,at,Y3r,0,[L5e],[()=>Z5e],1],qjt=[3,at,X3r,0,[Hge,FO,$ge,wh],[0,[()=>yVr,0],0,0],2],jjt=[3,at,J3r,0,[Hge,wh,$ge],[0,0,0],1],Vjt=[3,at,t4r,0,[VC,d8r,W3t,ajr],[0,()=>TVt,0,2],2],Yjt=[3,at,r4r,0,[Hge,VC,b5e,wh],[0,0,15,0],3],zjt=[3,at,i4r,0,[b5e],[0],1],Kjt=[3,at,s4r,0,[Hge,VC,wh],[0,0,0],2],e3e=[3,at,c4r,0,[UO,rx],[0,()=>kVt],2],Jjt=[3,at,d4r,0,[Bjr,z4r],[0,0]],Ujr=[1,at,OWr,0,[()=>$4t,0]],Gjr=[1,at,eHr,0,()=>V4t],$jr=[1,at,iHr,0,()=>nVt],Wjr=[1,at,vHr,0,()=>Y4t],Hjr=[1,at,hHr,0,()=>rVt],qjr=[1,at,fHr,0,()=>J4t],jjr=[1,at,HWr,0,[()=>iVt,0]],Vjr=[1,at,BHr,0,()=>uVt],Xjt=[1,at,$Hr,0,[()=>$5e,0]],Yjr=[1,at,qHr,0,[()=>NK,0]],zjr=[1,at,VHr,0,[()=>pVt,0]],x3t=[1,at,JHr,0,[()=>E8t,0]],t3e=[1,at,nqr,0,()=>S8t],DK=[1,at,sqr,0,[()=>I8t,0]],Kjr=[1,at,pqr,0,[()=>AH,0]],Jjr=[1,at,hqr,0,[()=>v8t,0]],Xjr=[1,at,_qr,0,[()=>mVt,0]],Zjr=[1,at,Iqr,0,()=>B8t],eVr=[1,at,vqr,0,()=>P8t],tVr=[1,at,Fqr,0,[()=>O8t,0]],nVr=[1,at,$qr,0,()=>L8t],rVr=[1,at,qqr,0,()=>U8t],iVr=[1,at,Kqr,0,()=>H8t],sVr=[1,at,Zqr,0,()=>j8t],oVr=[1,at,yqr,0,[()=>hVt,0]],aVr=[1,at,Bqr,0,()=>K8t],cVr=[1,at,Dqr,0,()=>X8t],lVr=[1,at,s5r,0,()=>njt],uVr=[1,at,p5r,0,()=>ojt],dVr=[1,at,h5r,0,()=>ajt],pVr=[1,at,g5r,0,()=>cjt],mVr=[1,at,y5r,0,()=>ljt],hVr=[1,at,I5r,0,()=>hjt],n3e=[1,at,c3r,0,[()=>Y5e,0]],fVr=[1,at,P3r,0,()=>Ojt],r3e=[1,at,v3r,0,[()=>CVt,0]],gVr=[1,at,j3r,0,()=>$jt],AVr=[1,at,z3r,0,()=>vVt],yVr=[1,at,Z3r,0,[()=>RVt,0]],EVr=[1,at,o4r,0,()=>IVt],bVr=[2,at,WHr,0,[0,0],[()=>Xjt,0]],_Vr=[2,at,HHr,0,[0,0],[()=>$5e,0]],Zjt=[2,at,g3r,8,0,()=>bVt],eVt=[2,at,b3r,8,0,0],Jge=[4,at,DWr,0,[Y8r],[()=>G4t]],tVt=[4,at,LWr,8,[ZT,Gge],[21,()=>jK]],nVt=[4,at,rHr,0,[Zu],[0]],i3e=[4,at,sHr,0,[Pjr,q4r,V4r,j4r,J8r],[()=>Jjt,()=>m8t,()=>f8t,()=>h8t,()=>Ljt]],rVt=[4,at,pHr,0,[Zu],[0]],iVt=[4,at,KWr,0,[Zu,fH,H3t,C4t,_4r,M5e,D5e,J3t,f5e,p4t,T4r,A4t,ljr,yjr],[0,[()=>j5e,0],()=>G5e,()=>e3e,[()=>W4t,0],()=>Yjt,[()=>qjt,0],[()=>s3e,0],()=>Yge,[()=>_Vt,0],()=>z4t,()=>J5e,()=>Wjt,()=>Hjt]],sVt=[4,at,qWr,0,[Zu,M5e,D5e,p4t,G4r,fH],[0,()=>zjt,()=>AVr,[()=>xVt,0],()=>K4t,[()=>Ajt,0]]],oVt=[4,at,VWr,0,[M5e,D5e,fH],[()=>Kjt,()=>jjt,()=>yjt]],aVt=[4,at,aHr,0,[Xg],[[()=>Y5e,0]]],cVt=[4,at,yHr,{[Wge]:1},[C8r,I4r,C4r,w4r,I8r,v8r,_5e,C5e,F5e,N5e,R5e],[()=>Bjt,()=>Z4t,[()=>X4t,0],()=>e8t,()=>Njt,[()=>i8t,0],[()=>QK,0],[()=>UK,0],[()=>WK,0],[()=>$K,0],[()=>GK,0]]],lVt=[4,at,SHr,0,[u8r,W4r],[[()=>Sjt,0],[()=>l8t,0]]],uVt=[4,at,NHr,0,[Zu],[0]],dVt=[4,at,OHr,0,[ZT,Gge,Zu,FO],[21,()=>jK,0,()=>Vjr]],pVt=[4,at,jHr,0,[Djr,f8r,njr,h8r,ujr,mjr,k8r],[[()=>R8t,0],[()=>b8t,0],[()=>C8t,0],[()=>y8t,0],[()=>T8t,0],()=>w8t,()=>_8t]],mVt=[4,at,bqr,0,[Zu],[[()=>Fjr,0]]],hVt=[4,at,Aqr,0,[Zu,fH],[()=>pjt,[()=>rjt,0]]],s3e=[4,at,xqr,0,[Zu,fH],[()=>tjt,[()=>ejt,0]]],fVt=[4,at,Oqr,8,[ZT],[21]],gVt=[4,at,u5r,8,[ZT],[21]],o3e=[4,at,Y5r,8,[ZT,Gge],[21,()=>jK]],AVt=[4,at,G5r,{[Wge]:1},[A5e],[[()=>q4t,0]]],yVt=[4,at,$5r,{[Wge]:1},[A5e,_5e,C5e,F5e,N5e,i4t,R5e],[[()=>j4t,0],[()=>QK,0],[()=>UK,0],[()=>WK,0],[()=>$K,0],[()=>jge,0],[()=>GK,0]]],EVt=[4,at,d3r,8,[g8r],[()=>vjt]],bVt=[4,at,A3r,0,[Zu],[0]],_Vt=[4,at,y3r,8,[G8r,m4t],[[()=>Mjt,0],21]],xVt=[4,at,E3r,8,[Zu,m4t,_4t],[0,21,0]],SVt=[4,at,S3r,{[Wge]:1},[A5e,_5e,C5e,F5e,N5e,i4t,R5e],[[()=>Pjt,0],[()=>QK,0],[()=>UK,0],[()=>WK,0],[()=>$K,0],[()=>jge,0],[()=>GK,0]]],CVt=[4,at,R3r,0,[Zu,J3t,f5e],[0,[()=>s3e,0],()=>Yge]],IVt=[4,at,a4r,0,[Ejr,ejr,f5e],[()=>Vjt,()=>Gjt,()=>Yge]],wVt=[4,at,W3r,0,[x4r,E4r,L5e],[()=>H4t,()=>L4t,()=>Fjt]],TVt=[4,at,q3r,0,[S5e],[15]],vVt=[4,at,K3r,0,[Zu,S5e],[0,15]],RVt=[4,at,e4r,0,[S5e,Zu,fH,H3t,C4t,A4t],[15,0,[()=>j5e,0],()=>G5e,()=>e3e,()=>J5e]],kVt=[4,at,u4r,0,[ZT,Gge],[21,()=>jK]],BVt=[9,at,vWr,{[nx]:["POST","/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply",200]},()=>Q4t,()=>U4t],NVt=[9,at,RHr,{[nx]:["POST","/model/{modelId}/converse",200]},()=>n8t,()=>r8t],DVt=[9,at,dHr,{[nx]:["POST","/model/{modelId}/converse-stream",200]},()=>o8t,()=>a8t],PVt=[9,at,THr,{[nx]:["POST","/model/{modelId}/count-tokens",200]},()=>d8t,()=>p8t],MVt=[9,at,QHr,{[nx]:["GET","/async-invoke/{invocationArn}",200]},()=>g8t,()=>A8t],OVt=[9,at,D5r,{[nx]:["POST","/guardrail-checks/invoke",200]},()=>Ejt,()=>bjt],LVt=[9,at,O5r,{[nx]:["POST","/model/{modelId}/invoke",200]},()=>_jt,()=>xjt],FVt=[9,at,U5r,{[nx]:["POST","/model/{modelId}/invoke-with-bidirectional-stream",200]},()=>Cjt,()=>Ijt],QVt=[9,at,q5r,{[nx]:["POST","/model/{modelId}/invoke-with-response-stream",200]},()=>wjt,()=>Tjt],UVt=[9,at,J5r,{[nx]:["GET","/async-invoke",200]},()=>Rjt,()=>kjt],GVt=[9,at,I3r,{[nx]:["POST","/async-invoke",200]},()=>Qjt,()=>Ujt],xVr=t=>({apiVersion:"2023-09-30",base64Decoder:t?.base64Decoder??sWr,base64Encoder:t?.base64Encoder??iWr,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??CWr,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??hWr,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new T3t},{schemeId:"smithy.api#httpBearerAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#httpBearerAuth"),signer:new S3t}],logger:t?.logger??new y$r,protocol:t?.protocol??lWr,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.bedrockruntime",errorTypeRegistries:D4t,version:"2023-09-30",serviceTarget:"AmazonBedrockFrontendService"},serviceId:t?.serviceId??"Bedrock Runtime",sha256:t?.sha256??uWr,urlParser:t?.urlParser??U$r,utf8Decoder:t?.utf8Decoder??rWr,utf8Encoder:t?.utf8Encoder??nWr}),SVr=t=>{E$r(process.version);let e=w$r(t),n=()=>e().then(b$r),r=xVr(t);YGr(process.version);let i={profile:t?.profile,logger:r.logger,signingName:"bedrock"};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??PO(J$r,i),bodyLengthChecker:t?.bodyLengthChecker??oWr,credentialDefaultProvider:t?.credentialDefaultProvider??X$r,defaultUserAgentProvider:t?.defaultUserAgentProvider??zGr({serviceId:r.serviceId,clientVersion:EWr.version}),eventStreamPayloadHandlerProvider:t?.eventStreamPayloadHandlerProvider??Z$r,eventStreamSerdeProvider:t?.eventStreamSerdeProvider??F$r,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:s=>s.getIdentityProvider("aws.auth#sigv4"),signer:new T3t},{schemeId:"smithy.api#httpBearerAuth",identityProvider:s=>s.getIdentityProvider("smithy.api#httpBearerAuth")||(async o=>{try{return await eWr({signingName:"bedrock"})()}catch{return await tWr(o)(o)}}),signer:new S3t}],maxAttempts:t?.maxAttempts??PO(j$r,t),region:t?.region??PO(R$r,{...k$r,...i}),requestHandler:cWr.create(t?.requestHandler??(async()=>({...await n(),disableConcurrentStreams:!0}))),retryMode:t?.retryMode??PO({...q$r,default:async()=>(await n()).retryMode||H$r},t),streamCollector:t?.streamCollector??aWr,useDualstackEndpoint:t?.useDualstackEndpoint??PO(v$r,i),useFipsEndpoint:t?.useFipsEndpoint??PO(T$r,i),userAgentAppId:t?.userAgentAppId??PO(KGr,i)}},CVr=t=>{let e=t.httpAuthSchemes,n=t.httpAuthSchemeProvider,r=t.credentials,i=t.token;return{setHttpAuthScheme(s){let o=e.findIndex(a=>a.schemeId===s.schemeId);o===-1?e.push(s):e.splice(o,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){r=s},credentials(){return r},setToken(s){i=s},token(){return i}}},IVr=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials(),token:t.token()}),wVr=(t,e)=>{let n=Object.assign(JGr(t),_$r(t),G$r(t),CVr(t));return e.forEach(r=>r.configure(n)),Object.assign(t,XGr(n),x$r(n),$$r(n),IVr(n))},PK=class extends I3t{config;constructor(...[e]){let n=SVr(e||{});super(n),this.initConfig=n;let r=gWr(n),i=ZGr(r),s=V$r(i),o=B$r(s),a=e$r(o),c=O$r(a),u=Q$r(c),l=fWr(u),d=s$r(l),m=a$r(d),h=wVr(m,e?.extensions||[]);this.config=h,this.middlewareStack.use(z$r(this.config)),this.middlewareStack.use(t$r(this.config)),this.middlewareStack.use(Y$r(this.config)),this.middlewareStack.use(W$r(this.config)),this.middlewareStack.use(n$r(this.config)),this.middlewareStack.use(r$r(this.config)),this.middlewareStack.use(i$r(this.config)),this.middlewareStack.use(p$r(this.config,{httpAuthSchemeParametersProvider:dWr,identityProviderConfigProvider:async f=>new m$r({"aws.auth#sigv4":f.credentials,"smithy.api#httpBearerAuth":f.token})})),this.middlewareStack.use(h$r(this.config))}destroy(){super.destroy()}},ix=S$r(AWr,"AmazonBedrockFrontendService","BedrockRuntimeClient",L$r),sx={},YC=(t,e,n,r)=>[],TVr=(t,e,n,r)=>[o$r(n),c$r(n,{headerPrefix:"x-amz-bedrock-"})],Age=class extends ix(sx,YC,"ApplyGuardrail",BVt){},yge=class extends ix(sx,YC,"Converse",NVt){},Ege=class extends ix(sx,YC,"ConverseStream",DVt){},bge=class extends ix(sx,YC,"CountTokens",PVt){},_ge=class extends ix(sx,YC,"GetAsyncInvoke",MVt){},xge=class extends ix(sx,YC,"InvokeGuardrailChecks",OVt){},Sge=class extends ix(sx,YC,"InvokeModel",LVt){},Cge=class extends ix(sx,TVr,"InvokeModelWithBidirectionalStream",FVt){},Ige=class extends ix(sx,YC,"InvokeModelWithResponseStream",QVt){},MK=class extends ix(sx,YC,"ListAsyncInvokes",UVt){},wge=class extends ix(sx,YC,"StartAsyncInvoke",GVt){},$Vt=f$r(PK,MK,"nextToken","nextToken","maxResults"),vVr={ApplyGuardrailCommand:Age,ConverseCommand:yge,ConverseStreamCommand:Ege,CountTokensCommand:bge,GetAsyncInvokeCommand:_ge,InvokeGuardrailChecksCommand:xge,InvokeModelCommand:Sge,InvokeModelWithBidirectionalStreamCommand:Cge,InvokeModelWithResponseStreamCommand:Ige,ListAsyncInvokesCommand:MK,StartAsyncInvokeCommand:wge},RVr={paginateListAsyncInvokes:$Vt},Tge=class extends PK{};C$r(vVr,Tge,{paginators:RVr});var kVr={COMPLETED:"Completed",FAILED:"Failed",IN_PROGRESS:"InProgress"},BVr={SUBMISSION_TIME:"SubmissionTime"},NVr={ASCENDING:"Ascending",DESCENDING:"Descending"},DVr={JPEG:"jpeg",PNG:"png"},PVr={GROUNDING_SOURCE:"grounding_source",GUARD_CONTENT:"guard_content",QUERY:"query"},MVr={FULL:"FULL",INTERVENTIONS:"INTERVENTIONS"},OVr={INPUT:"INPUT",OUTPUT:"OUTPUT"},LVr={GUARDRAIL_INTERVENED:"GUARDRAIL_INTERVENED",NONE:"NONE"},FVr={ACCOUNT_ENFORCED:"ACCOUNT_ENFORCED",ORGANIZATION_ENFORCED:"ORGANIZATION_ENFORCED",REQUEST:"REQUEST"},QVr={CROSS_ACCOUNT:"CROSS_ACCOUNT",SELF:"SELF"},UVr={ALWAYS_FALSE:"ALWAYS_FALSE",ALWAYS_TRUE:"ALWAYS_TRUE"},GVr={BLOCKED:"BLOCKED",NONE:"NONE"},$Vr={HIGH:"HIGH",LOW:"LOW",MEDIUM:"MEDIUM",NONE:"NONE"},WVr={HIGH:"HIGH",LOW:"LOW",MEDIUM:"MEDIUM",NONE:"NONE"},HVr={HATE:"HATE",INSULTS:"INSULTS",MISCONDUCT:"MISCONDUCT",PROMPT_ATTACK:"PROMPT_ATTACK",SEXUAL:"SEXUAL",VIOLENCE:"VIOLENCE"},qVr={BLOCKED:"BLOCKED",NONE:"NONE"},jVr={GROUNDING:"GROUNDING",RELEVANCE:"RELEVANCE"},VVr={ANONYMIZED:"ANONYMIZED",BLOCKED:"BLOCKED",NONE:"NONE"},YVr={ADDRESS:"ADDRESS",AGE:"AGE",AWS_ACCESS_KEY:"AWS_ACCESS_KEY",AWS_SECRET_KEY:"AWS_SECRET_KEY",CA_HEALTH_NUMBER:"CA_HEALTH_NUMBER",CA_SOCIAL_INSURANCE_NUMBER:"CA_SOCIAL_INSURANCE_NUMBER",CREDIT_DEBIT_CARD_CVV:"CREDIT_DEBIT_CARD_CVV",CREDIT_DEBIT_CARD_EXPIRY:"CREDIT_DEBIT_CARD_EXPIRY",CREDIT_DEBIT_CARD_NUMBER:"CREDIT_DEBIT_CARD_NUMBER",DRIVER_ID:"DRIVER_ID",EMAIL:"EMAIL",INTERNATIONAL_BANK_ACCOUNT_NUMBER:"INTERNATIONAL_BANK_ACCOUNT_NUMBER",IP_ADDRESS:"IP_ADDRESS",LICENSE_PLATE:"LICENSE_PLATE",MAC_ADDRESS:"MAC_ADDRESS",NAME:"NAME",PASSWORD:"PASSWORD",PHONE:"PHONE",PIN:"PIN",SWIFT_CODE:"SWIFT_CODE",UK_NATIONAL_HEALTH_SERVICE_NUMBER:"UK_NATIONAL_HEALTH_SERVICE_NUMBER",UK_NATIONAL_INSURANCE_NUMBER:"UK_NATIONAL_INSURANCE_NUMBER",UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER:"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER",URL:"URL",USERNAME:"USERNAME",US_BANK_ACCOUNT_NUMBER:"US_BANK_ACCOUNT_NUMBER",US_BANK_ROUTING_NUMBER:"US_BANK_ROUTING_NUMBER",US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER:"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER",US_PASSPORT_NUMBER:"US_PASSPORT_NUMBER",US_SOCIAL_SECURITY_NUMBER:"US_SOCIAL_SECURITY_NUMBER",VEHICLE_IDENTIFICATION_NUMBER:"VEHICLE_IDENTIFICATION_NUMBER"},zVr={BLOCKED:"BLOCKED",NONE:"NONE"},KVr={DENY:"DENY"},JVr={BLOCKED:"BLOCKED",NONE:"NONE"},XVr={PROFANITY:"PROFANITY"},ZVr={HATE:"HATE",INSULTS:"INSULTS",MISCONDUCT:"MISCONDUCT",SEXUAL:"SEXUAL",VIOLENCE:"VIOLENCE"},eYr={JAILBREAK:"JAILBREAK",PROMPT_INJECTION:"PROMPT_INJECTION",PROMPT_LEAKAGE:"PROMPT_LEAKAGE"},tYr={ADDRESS:"ADDRESS",AGE:"AGE",AWS_ACCESS_KEY:"AWS_ACCESS_KEY",AWS_SECRET_KEY:"AWS_SECRET_KEY",CA_HEALTH_NUMBER:"CA_HEALTH_NUMBER",CA_SOCIAL_INSURANCE_NUMBER:"CA_SOCIAL_INSURANCE_NUMBER",CREDIT_DEBIT_CARD_CVV:"CREDIT_DEBIT_CARD_CVV",CREDIT_DEBIT_CARD_EXPIRY:"CREDIT_DEBIT_CARD_EXPIRY",CREDIT_DEBIT_CARD_NUMBER:"CREDIT_DEBIT_CARD_NUMBER",DRIVER_ID:"DRIVER_ID",EMAIL:"EMAIL",INTERNATIONAL_BANK_ACCOUNT_NUMBER:"INTERNATIONAL_BANK_ACCOUNT_NUMBER",IP_ADDRESS:"IP_ADDRESS",LICENSE_PLATE:"LICENSE_PLATE",MAC_ADDRESS:"MAC_ADDRESS",NAME:"NAME",PASSWORD:"PASSWORD",PHONE:"PHONE",PIN:"PIN",SWIFT_CODE:"SWIFT_CODE",UK_NATIONAL_HEALTH_SERVICE_NUMBER:"UK_NATIONAL_HEALTH_SERVICE_NUMBER",UK_NATIONAL_INSURANCE_NUMBER:"UK_NATIONAL_INSURANCE_NUMBER",UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER:"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER",URL:"URL",USERNAME:"USERNAME",US_BANK_ACCOUNT_NUMBER:"US_BANK_ACCOUNT_NUMBER",US_BANK_ROUTING_NUMBER:"US_BANK_ROUTING_NUMBER",US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER:"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER",US_PASSPORT_NUMBER:"US_PASSPORT_NUMBER",US_SOCIAL_SECURITY_NUMBER:"US_SOCIAL_SECURITY_NUMBER",VEHICLE_IDENTIFICATION_NUMBER:"VEHICLE_IDENTIFICATION_NUMBER"},nYr={ASSISTANT:"assistant",SYSTEM:"system",USER:"user"},rYr={DISABLED:"disabled",ENABLED:"enabled",ENABLED_FULL:"enabled_full"},iYr={AAC:"aac",FLAC:"flac",M4A:"m4a",MKA:"mka",MKV:"mkv",MP3:"mp3",MP4:"mp4",MPEG:"mpeg",MPGA:"mpga",OGG:"ogg",OPUS:"opus",PCM:"pcm",WAV:"wav",WEBM:"webm",X_AAC:"x-aac"},sYr={FIVE_MINUTES:"5m",ONE_HOUR:"1h"},oYr={DEFAULT:"default"},aYr={CSV:"csv",DOC:"doc",DOCX:"docx",HTML:"html",MD:"md",PDF:"pdf",TXT:"txt",XLS:"xls",XLSX:"xlsx"},cYr={JPEG:"jpeg",PNG:"png"},lYr={GROUNDING_SOURCE:"grounding_source",GUARD_CONTENT:"guard_content",QUERY:"query"},uYr={GIF:"gif",JPEG:"jpeg",PNG:"png",WEBP:"webp"},dYr={FLV:"flv",MKV:"mkv",MOV:"mov",MP4:"mp4",MPEG:"mpeg",MPG:"mpg",THREE_GP:"three_gp",WEBM:"webm",WMV:"wmv"},pYr={ERROR:"error",SUCCESS:"success"},mYr={SERVER_TOOL_USE:"server_tool_use"},hYr={ASSISTANT:"assistant",SYSTEM:"system",USER:"user"},fYr={JSON_SCHEMA:"json_schema"},gYr={OPTIMIZED:"optimized",STANDARD:"standard"},AYr={DEFAULT:"default",FLEX:"flex",PRIORITY:"priority",RESERVED:"reserved"},yYr={CONTENT_FILTERED:"content_filtered",END_TURN:"end_turn",GUARDRAIL_INTERVENED:"guardrail_intervened",MALFORMED_MODEL_OUTPUT:"malformed_model_output",MALFORMED_TOOL_USE:"malformed_tool_use",MAX_TOKENS:"max_tokens",MODEL_CONTEXT_WINDOW_EXCEEDED:"model_context_window_exceeded",STOP_SEQUENCE:"stop_sequence",TOOL_USE:"tool_use"},EYr={ASYNC:"async",SYNC:"sync"},bYr={DISABLED:"DISABLED",ENABLED:"ENABLED",ENABLED_FULL:"ENABLED_FULL"};et.AccessDeniedException=sge;et.AccessDeniedException$=T4t;et.AnyToolChoice$=L4t;et.AppliedGuardrailDetails$=F4t;et.ApplyGuardrail$=BVt;et.ApplyGuardrailCommand=Age;et.ApplyGuardrailRequest$=Q4t;et.ApplyGuardrailResponse$=U4t;et.AsyncInvokeOutputDataConfig$=Jge;et.AsyncInvokeS3OutputDataConfig$=G4t;et.AsyncInvokeStatus=kVr;et.AsyncInvokeSummary$=$4t;et.AudioBlock$=W4t;et.AudioFormat=iYr;et.AudioSource$=tVt;et.AutoToolChoice$=H4t;et.BedrockRuntime=Tge;et.BedrockRuntimeClient=PK;et.BedrockRuntimeServiceException=Ih;et.BedrockRuntimeServiceException$=w4t;et.BidirectionalInputPayloadPart$=q4t;et.BidirectionalOutputPayloadPart$=j4t;et.CacheDetail$=V4t;et.CachePointBlock$=Yge;et.CachePointType=oYr;et.CacheTTL=sYr;et.Citation$=Y4t;et.CitationGeneratedContent$=nVt;et.CitationLocation$=i3e;et.CitationSourceContent$=rVt;et.CitationSourceContentDelta$=J4t;et.CitationsConfig$=U5e;et.CitationsContentBlock$=z4t;et.CitationsDelta$=K4t;et.ConflictException=lge;et.ConflictException$=v4t;et.ContentBlock$=iVt;et.ContentBlockDelta$=sVt;et.ContentBlockDeltaEvent$=X4t;et.ContentBlockStart$=oVt;et.ContentBlockStartEvent$=Z4t;et.ContentBlockStopEvent$=e8t;et.ConversationRole=hYr;et.Converse$=NVt;et.ConverseCommand=yge;et.ConverseMetrics$=t8t;et.ConverseOutput$=aVt;et.ConverseRequest$=n8t;et.ConverseResponse$=r8t;et.ConverseStream$=DVt;et.ConverseStreamCommand=Ege;et.ConverseStreamMetadataEvent$=i8t;et.ConverseStreamMetrics$=s8t;et.ConverseStreamOutput$=cVt;et.ConverseStreamRequest$=o8t;et.ConverseStreamResponse$=a8t;et.ConverseStreamTrace$=c8t;et.ConverseTokensRequest$=l8t;et.ConverseTrace$=u8t;et.CountTokens$=PVt;et.CountTokensCommand=bge;et.CountTokensInput$=lVt;et.CountTokensRequest$=d8t;et.CountTokensResponse$=p8t;et.DocumentBlock$=G5e;et.DocumentCharLocation$=m8t;et.DocumentChunkLocation$=h8t;et.DocumentContentBlock$=uVt;et.DocumentFormat=aYr;et.DocumentPageLocation$=f8t;et.DocumentSource$=dVt;et.ErrorBlock$=zge;et.GetAsyncInvoke$=MVt;et.GetAsyncInvokeCommand=_ge;et.GetAsyncInvokeRequest$=g8t;et.GetAsyncInvokeResponse$=A8t;et.GuardrailAction=LVr;et.GuardrailAssessment$=$5e;et.GuardrailAutomatedReasoningFinding$=pVt;et.GuardrailAutomatedReasoningImpossibleFinding$=y8t;et.GuardrailAutomatedReasoningInputTextReference$=E8t;et.GuardrailAutomatedReasoningInvalidFinding$=b8t;et.GuardrailAutomatedReasoningLogicWarning$=HK;et.GuardrailAutomatedReasoningLogicWarningType=UVr;et.GuardrailAutomatedReasoningNoTranslationsFinding$=_8t;et.GuardrailAutomatedReasoningPolicyAssessment$=x8t;et.GuardrailAutomatedReasoningRule$=S8t;et.GuardrailAutomatedReasoningSatisfiableFinding$=C8t;et.GuardrailAutomatedReasoningScenario$=NK;et.GuardrailAutomatedReasoningStatement$=I8t;et.GuardrailAutomatedReasoningTooComplexFinding$=w8t;et.GuardrailAutomatedReasoningTranslation$=AH;et.GuardrailAutomatedReasoningTranslationAmbiguousFinding$=T8t;et.GuardrailAutomatedReasoningTranslationOption$=v8t;et.GuardrailAutomatedReasoningValidFinding$=R8t;et.GuardrailChecksConfig$=k8t;et.GuardrailChecksContentBlock$=mVt;et.GuardrailChecksContentFilterCategory=ZVr;et.GuardrailChecksContentFilterCategoryConfig$=B8t;et.GuardrailChecksContentFilterConfig$=N8t;et.GuardrailChecksContentFilterResult$=D8t;et.GuardrailChecksContentFilterResultEntry$=P8t;et.GuardrailChecksContentFilterUsage$=M8t;et.GuardrailChecksMessage$=O8t;et.GuardrailChecksPromptAttackCategory=eYr;et.GuardrailChecksPromptAttackCategoryConfig$=L8t;et.GuardrailChecksPromptAttackConfig$=F8t;et.GuardrailChecksPromptAttackResult$=Q8t;et.GuardrailChecksPromptAttackResultEntry$=U8t;et.GuardrailChecksPromptAttackUsage$=G8t;et.GuardrailChecksResults$=$8t;et.GuardrailChecksRole=nYr;et.GuardrailChecksSensitiveInformationConfig$=W8t;et.GuardrailChecksSensitiveInformationEntityConfig$=H8t;et.GuardrailChecksSensitiveInformationEntityType=tYr;et.GuardrailChecksSensitiveInformationResult$=q8t;et.GuardrailChecksSensitiveInformationResultEntry$=j8t;et.GuardrailChecksSensitiveInformationUsage$=V8t;et.GuardrailChecksUsageResults$=Y8t;et.GuardrailConfiguration$=z8t;et.GuardrailContentBlock$=hVt;et.GuardrailContentFilter$=K8t;et.GuardrailContentFilterConfidence=$Vr;et.GuardrailContentFilterStrength=WVr;et.GuardrailContentFilterType=HVr;et.GuardrailContentPolicyAction=GVr;et.GuardrailContentPolicyAssessment$=J8t;et.GuardrailContentQualifier=PVr;et.GuardrailContentSource=OVr;et.GuardrailContextualGroundingFilter$=X8t;et.GuardrailContextualGroundingFilterType=jVr;et.GuardrailContextualGroundingPolicyAction=qVr;et.GuardrailContextualGroundingPolicyAssessment$=Z8t;et.GuardrailConverseContentBlock$=s3e;et.GuardrailConverseContentQualifier=lYr;et.GuardrailConverseImageBlock$=ejt;et.GuardrailConverseImageFormat=cYr;et.GuardrailConverseImageSource$=fVt;et.GuardrailConverseTextBlock$=tjt;et.GuardrailCoverage$=W5e;et.GuardrailCustomWord$=njt;et.GuardrailImageBlock$=rjt;et.GuardrailImageCoverage$=ijt;et.GuardrailImageFormat=DVr;et.GuardrailImageSource$=gVt;et.GuardrailInvocationMetrics$=sjt;et.GuardrailManagedWord$=ojt;et.GuardrailManagedWordType=XVr;et.GuardrailOrigin=FVr;et.GuardrailOutputContent$=ajt;et.GuardrailOutputScope=MVr;et.GuardrailOwnership=QVr;et.GuardrailPiiEntityFilter$=cjt;et.GuardrailPiiEntityType=YVr;et.GuardrailRegexFilter$=ljt;et.GuardrailSensitiveInformationPolicyAction=VVr;et.GuardrailSensitiveInformationPolicyAssessment$=ujt;et.GuardrailStreamConfiguration$=djt;et.GuardrailStreamProcessingMode=EYr;et.GuardrailTextBlock$=pjt;et.GuardrailTextCharactersCoverage$=mjt;et.GuardrailTopic$=hjt;et.GuardrailTopicPolicyAction=zVr;et.GuardrailTopicPolicyAssessment$=fjt;et.GuardrailTopicType=KVr;et.GuardrailTrace=rYr;et.GuardrailTraceAssessment$=H5e;et.GuardrailUsage$=q5e;et.GuardrailWordPolicyAction=JVr;et.GuardrailWordPolicyAssessment$=gjt;et.ImageBlock$=j5e;et.ImageBlockDelta$=Ajt;et.ImageBlockStart$=yjt;et.ImageFormat=uYr;et.ImageSource$=o3e;et.InferenceConfiguration$=V5e;et.InternalServerException=oge;et.InternalServerException$=QK;et.InvokeGuardrailChecks$=OVt;et.InvokeGuardrailChecksCommand=xge;et.InvokeGuardrailChecksRequest$=Ejt;et.InvokeGuardrailChecksResponse$=bjt;et.InvokeModel$=LVt;et.InvokeModelCommand=Sge;et.InvokeModelRequest$=_jt;et.InvokeModelResponse$=xjt;et.InvokeModelTokensRequest$=Sjt;et.InvokeModelWithBidirectionalStream$=FVt;et.InvokeModelWithBidirectionalStreamCommand=Cge;et.InvokeModelWithBidirectionalStreamInput$=AVt;et.InvokeModelWithBidirectionalStreamOutput$=yVt;et.InvokeModelWithBidirectionalStreamRequest$=Cjt;et.InvokeModelWithBidirectionalStreamResponse$=Ijt;et.InvokeModelWithResponseStream$=QVt;et.InvokeModelWithResponseStreamCommand=Ige;et.InvokeModelWithResponseStreamRequest$=wjt;et.InvokeModelWithResponseStreamResponse$=Tjt;et.JsonSchemaDefinition$=vjt;et.ListAsyncInvokes$=UVt;et.ListAsyncInvokesCommand=MK;et.ListAsyncInvokesRequest$=Rjt;et.ListAsyncInvokesResponse$=kjt;et.Message$=Y5e;et.MessageStartEvent$=Bjt;et.MessageStopEvent$=Njt;et.ModelErrorException=mge;et.ModelErrorException$=R4t;et.ModelNotReadyException=hge;et.ModelNotReadyException$=k4t;et.ModelStreamErrorException=gge;et.ModelStreamErrorException$=UK;et.ModelTimeoutException=fge;et.ModelTimeoutException$=jge;et.OutputConfig$=z5e;et.OutputFormat$=Djt;et.OutputFormatStructure$=EVt;et.OutputFormatType=fYr;et.PayloadPart$=Pjt;et.PerformanceConfigLatency=gYr;et.PerformanceConfiguration$=qK;et.PromptRouterTrace$=K5e;et.PromptVariableValues$=bVt;et.ReasoningContentBlock$=_Vt;et.ReasoningContentBlockDelta$=xVt;et.ReasoningTextBlock$=Mjt;et.ResourceNotFoundException=uge;et.ResourceNotFoundException$=B4t;et.ResponseStream$=SVt;et.S3Location$=jK;et.SearchResultBlock$=J5e;et.SearchResultContentBlock$=Ojt;et.SearchResultLocation$=Ljt;et.ServiceQuotaExceededException=dge;et.ServiceQuotaExceededException$=N4t;et.ServiceTier$=VK;et.ServiceTierType=AYr;et.ServiceUnavailableException=pge;et.ServiceUnavailableException$=GK;et.SortAsyncInvocationBy=BVr;et.SortOrder=NVr;et.SpecificToolChoice$=Fjt;et.StartAsyncInvoke$=GVt;et.StartAsyncInvokeCommand=wge;et.StartAsyncInvokeRequest$=Qjt;et.StartAsyncInvokeResponse$=Ujt;et.StopReason=yYr;et.SystemContentBlock$=CVt;et.SystemTool$=Gjt;et.Tag$=$jt;et.ThrottlingException=age;et.ThrottlingException$=$K;et.TokenUsage$=X5e;et.Tool$=IVt;et.ToolAdditionBlock$=Wjt;et.ToolChoice$=wVt;et.ToolConfiguration$=Kge;et.ToolInputSchema$=TVt;et.ToolReference$=Z5e;et.ToolRemovalBlock$=Hjt;et.ToolResultBlock$=qjt;et.ToolResultBlockDelta$=vVt;et.ToolResultBlockStart$=jjt;et.ToolResultContentBlock$=RVt;et.ToolResultStatus=pYr;et.ToolSpecification$=Vjt;et.ToolUseBlock$=Yjt;et.ToolUseBlockDelta$=zjt;et.ToolUseBlockStart$=Kjt;et.ToolUseType=mYr;et.Trace=bYr;et.ValidationException=cge;et.ValidationException$=WK;et.VideoBlock$=e3e;et.VideoFormat=dYr;et.VideoSource$=kVt;et.WebLocation$=Jjt;et.errorTypeRegistries=D4t;et.paginateListAsyncInvokes=$Vt});var qVt=re((Kdo,HVt)=>{p();var yH=1e3,EH=yH*60,bH=EH*60,$O=bH*24,_Yr=$O*7,xYr=$O*365.25;HVt.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return SYr(t);if(n==="number"&&isFinite(t))return e.long?IYr(t):CYr(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function SYr(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*xYr;case"weeks":case"week":case"w":return n*_Yr;case"days":case"day":case"d":return n*$O;case"hours":case"hour":case"hrs":case"hr":case"h":return n*bH;case"minutes":case"minute":case"mins":case"min":case"m":return n*EH;case"seconds":case"second":case"secs":case"sec":case"s":return n*yH;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function CYr(t){var e=Math.abs(t);return e>=$O?Math.round(t/$O)+"d":e>=bH?Math.round(t/bH)+"h":e>=EH?Math.round(t/EH)+"m":e>=yH?Math.round(t/yH)+"s":t+"ms"}function IYr(t){var e=Math.abs(t);return e>=$O?Xge(t,e,$O,"day"):e>=bH?Xge(t,e,bH,"hour"):e>=EH?Xge(t,e,EH,"minute"):e>=yH?Xge(t,e,yH,"second"):t+" ms"}function Xge(t,e,n,r){var i=e>=n*1.5;return Math.round(t/n)+" "+r+(i?"s":"")}});var a3e=re((Xdo,jVt)=>{p();function wYr(t){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=a,n.humanize=qVt(),n.destroy=u,Object.keys(t).forEach(l=>{n[l]=t[l]}),n.names=[],n.skips=[],n.formatters={};function e(l){let d=0;for(let m=0;m{if(I==="%%")return"%";S++;let k=n.formatters[w];if(typeof k=="function"){let N=A[S];I=k.call(y,N),A.splice(S,1),S--}return I}),n.formatArgs.call(y,A),(y.log||n.log).apply(y,A)}return g.namespace=l,g.useColors=n.useColors(),g.color=n.selectColor(l),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(h!==n.namespaces&&(h=n.namespaces,f=n.enabled(l)),f),set:A=>{m=A}}),typeof n.init=="function"&&n.init(g),g}function r(l,d){let m=n(this.namespace+(typeof d>"u"?":":d)+l);return m.log=this.log,m}function i(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];let d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of d)m[0]==="-"?n.skips.push(m.slice(1)):n.names.push(m)}function s(l,d){let m=0,h=0,f=-1,g=0;for(;m"-"+d)].join(",");return n.enable(""),l}function a(l){for(let d of n.skips)if(s(l,d))return!1;for(let d of n.names)if(s(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}jVt.exports=wYr});var VVt=re((Zg,Zge)=>{p();Zg.formatArgs=vYr;Zg.save=RYr;Zg.load=kYr;Zg.useColors=TYr;Zg.storage=BYr();Zg.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Zg.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function TYr(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function vYr(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Zge.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(n++,i==="%c"&&(r=n))}),t.splice(r,0,e)}Zg.log=console.debug||console.log||(()=>{});function RYr(t){try{t?Zg.storage.setItem("debug",t):Zg.storage.removeItem("debug")}catch{}}function kYr(){let t;try{t=Zg.storage.getItem("debug")||Zg.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function BYr(){try{return localStorage}catch{}}Zge.exports=a3e()(Zg);var{formatters:NYr}=Zge.exports;NYr.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var zVt=re((tpo,YVt)=>{"use strict";p();YVt.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),i=e.indexOf("--");return r!==-1&&(i===-1||r{"use strict";p();var DYr=require("os"),KVt=require("tty"),I0=zVt(),{env:Up}=process,dB;I0("no-color")||I0("no-colors")||I0("color=false")||I0("color=never")?dB=0:(I0("color")||I0("colors")||I0("color=true")||I0("color=always"))&&(dB=1);"FORCE_COLOR"in Up&&(Up.FORCE_COLOR==="true"?dB=1:Up.FORCE_COLOR==="false"?dB=0:dB=Up.FORCE_COLOR.length===0?1:Math.min(parseInt(Up.FORCE_COLOR,10),3));function c3e(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function l3e(t,e){if(dB===0)return 0;if(I0("color=16m")||I0("color=full")||I0("color=truecolor"))return 3;if(I0("color=256"))return 2;if(t&&!e&&dB===void 0)return 0;let n=dB||0;if(Up.TERM==="dumb")return n;if(process.platform==="win32"){let r=DYr.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Up)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Up)||Up.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Up)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Up.TEAMCITY_VERSION)?1:0;if(Up.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Up){let r=parseInt((Up.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Up.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Up.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Up.TERM)||"COLORTERM"in Up?1:n}function PYr(t){let e=l3e(t,t&&t.isTTY);return c3e(e)}JVt.exports={supportsColor:PYr,stdout:c3e(l3e(!0,KVt.isatty(1))),stderr:c3e(l3e(!0,KVt.isatty(2)))}});var eYt=re((Gp,tAe)=>{p();var MYr=require("tty"),eAe=require("util");Gp.init=$Yr;Gp.log=QYr;Gp.formatArgs=LYr;Gp.save=UYr;Gp.load=GYr;Gp.useColors=OYr;Gp.destroy=eAe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Gp.colors=[6,2,3,4,5,1];try{let t=XVt();t&&(t.stderr||t).level>=2&&(Gp.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Gp.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function OYr(){return"colors"in Gp.inspectOpts?!!Gp.inspectOpts.colors:MYr.isatty(process.stderr.fd)}function LYr(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,i="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+i),t.push(s+"m+"+sde.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=j_r()+e+" "+t[0]}function j_r(){return jd.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Y_r(...t){return process.stderr.write(rde.formatWithOptions(jd.inspectOpts,...t)+` -`)}function K_r(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function z_r(){return process.env.DEBUG}function J_r(t){t.inspectOpts={};let e=Object.keys(jd.inspectOpts);for(let n=0;ne.trim()).join(" ")};IOt.O=function(t){return this.inspectOpts.colors=this.useColors,rde.inspect(t,this.inspectOpts)}});var e$=ee((TMi,VQe)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?VQe.exports=yOt():VQe.exports=xOt()});var vOt=ee(Bf=>{"use strict";p();var X_r=Bf&&Bf.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Z_r=Bf&&Bf.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wOt=Bf&&Bf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&X_r(e,t,n);return Z_r(e,t),e};Object.defineProperty(Bf,"__esModule",{value:!0});Bf.req=Bf.json=Bf.toBuffer=void 0;var e0r=wOt(require("http")),t0r=wOt(require("https"));async function TOt(t){let e=0,n=[];for await(let r of t)e+=r.length,n.push(r);return Buffer.concat(n,e)}Bf.toBuffer=TOt;async function n0r(t){let n=(await TOt(t)).toString("utf8");try{return JSON.parse(n)}catch(r){let s=r;throw s.message+=` (input: ${n})`,s}}Bf.json=n0r;function r0r(t,e={}){let r=((typeof t=="string"?t:t.href).startsWith("https:")?t0r:e0r).request(t,e),s=new Promise((i,o)=>{r.once("response",i).once("error",o).end()});return r.then=s.then.bind(s),r}Bf.req=r0r});var YQe=ee(sA=>{"use strict";p();var kOt=sA&&sA.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),s0r=sA&&sA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),NOt=sA&&sA.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&kOt(e,t,n);return s0r(e,t),e},i0r=sA&&sA.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&kOt(e,t,n)};Object.defineProperty(sA,"__esModule",{value:!0});sA.Agent=void 0;var o0r=NOt(require("net")),ROt=NOt(require("http")),a0r=require("https");i0r(vOt(),sA);var XS=Symbol("AgentBaseInternalState"),jQe=class extends ROt.Agent{constructor(e){super(e),this[XS]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(` -`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let n=new o0r.Socket({writable:!1});return this.sockets[e].push(n),this.totalSocketCount++,n}decrementSockets(e,n){if(!this.sockets[e]||n===null)return;let r=this.sockets[e],s=r.indexOf(n);s!==-1&&(r.splice(s,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?a0r.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,n,r){let s={...n,secureEndpoint:this.isSecureEndpoint(n)},i=this.getName(s),o=this.incrementSockets(i);Promise.resolve().then(()=>this.connect(e,s)).then(a=>{if(this.decrementSockets(i,o),a instanceof ROt.Agent)try{return a.addRequest(e,s)}catch(c){return r(c)}this[XS].currentSocket=a,super.createSocket(e,n,r)},a=>{this.decrementSockets(i,o),r(a)})}createConnection(){let e=this[XS].currentSocket;if(this[XS].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[XS].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[XS]&&(this[XS].defaultPort=e)}get protocol(){return this[XS].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[XS]&&(this[XS].protocol=e)}};sA.Agent=jQe});var POt=ee(sE=>{"use strict";p();var c0r=sE&&sE.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),l0r=sE&&sE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BOt=sE&&sE.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&c0r(e,t,n);return l0r(e,t),e},u0r=sE&&sE.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sE,"__esModule",{value:!0});sE.HttpProxyAgent=void 0;var d0r=BOt(require("net")),p0r=BOt(require("tls")),h0r=u0r(e$()),m0r=require("events"),f0r=YQe(),DOt=require("url"),t$=(0,h0r.default)("http-proxy-agent"),ide=class extends f0r.Agent{constructor(e,n){super(n),this.proxy=typeof e=="string"?new DOt.URL(e):e,this.proxyHeaders=n?.headers??{},t$("Creating new HttpProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...n?g0r(n,"headers"):null,host:r,port:s}}addRequest(e,n){e._header=null,this.setRequestProps(e,n),super.addRequest(e,n)}setRequestProps(e,n){let{proxy:r}=this,s=n.secureEndpoint?"https:":"http:",i=e.getHeader("host")||"localhost",o=`${s}//${i}`,a=new DOt.URL(e.path,o);n.port!==80&&(a.port=String(n.port)),e.path=String(a);let c=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let u=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;c["Proxy-Authorization"]=`Basic ${Buffer.from(u).toString("base64")}`}c["Proxy-Connection"]||(c["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let u of Object.keys(c)){let l=c[u];l&&e.setHeader(u,l)}}async connect(e,n){e._header=null,e.path.includes("://")||this.setRequestProps(e,n);let r,s;t$("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(t$("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,s=r.indexOf(`\r -\r -`)+4,e.outputData[0].data=e._header+r.substring(s),t$("Output buffer: %o",e.outputData[0].data));let i;return this.proxy.protocol==="https:"?(t$("Creating `tls.Socket`: %o",this.connectOpts),i=p0r.connect(this.connectOpts)):(t$("Creating `net.Socket`: %o",this.connectOpts),i=d0r.connect(this.connectOpts)),await(0,m0r.once)(i,"connect"),i}};ide.protocols=["http","https"];sE.HttpProxyAgent=ide;function g0r(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}});var OOt=ee(n$=>{"use strict";p();var A0r=n$&&n$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n$,"__esModule",{value:!0});n$.parseProxyResponse=void 0;var y0r=A0r(e$()),ode=(0,y0r.default)("https-proxy-agent:parse-proxy-response");function E0r(t){return new Promise((e,n)=>{let r=0,s=[];function i(){let l=t.read();l?u(l):t.once("readable",i)}function o(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("readable",i)}function a(){o(),ode("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(l){o(),ode("onerror %o",l),n(l)}function u(l){s.push(l),r+=l.length;let d=Buffer.concat(s,r),h=d.indexOf(`\r -\r -`);if(h===-1){ode("have not received end of HTTP headers yet..."),i();return}let m=d.slice(0,h).toString("ascii").split(`\r -`),f=m.shift();if(!f)return t.destroy(),n(new Error("No header received from proxy CONNECT response"));let g=f.split(" "),A=+g[1],y=g.slice(2).join(" "),b={};for(let S of m){if(!S)continue;let C=S.indexOf(":");if(C===-1)return t.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${S}"`));let I=S.slice(0,C).toLowerCase(),x=S.slice(C+1).trimStart(),w=b[I];typeof w=="string"?b[I]=[w,x]:Array.isArray(w)?w.push(x):b[I]=x}ode("got proxy server response: %o %o",f,b),o(),e({connect:{statusCode:A,statusText:y,headers:b},buffered:d})}t.on("error",c),t.on("end",a),i()})}n$.parseProxyResponse=E0r});var KQe=ee(iE=>{"use strict";p();var b0r=iE&&iE.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),_0r=iE&&iE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),QOt=iE&&iE.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&b0r(e,t,n);return _0r(e,t),e},UOt=iE&&iE.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(iE,"__esModule",{value:!0});iE.HttpsProxyAgent=void 0;var ade=QOt(require("net")),MOt=QOt(require("tls")),S0r=UOt(require("assert")),C0r=UOt(e$()),I0r=YQe(),x0r=require("url"),w0r=OOt(),Q8=(0,C0r.default)("https-proxy-agent"),LOt=t=>t.servername===void 0&&t.host&&!ade.isIP(t.host)?{...t,servername:t.host}:t,cde=class extends I0r.Agent{constructor(e,n){super(n),this.options={path:void 0},this.proxy=typeof e=="string"?new x0r.URL(e):e,this.proxyHeaders=n?.headers??{},Q8("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?FOt(n,"headers"):null,host:r,port:s}}async connect(e,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let s;r.protocol==="https:"?(Q8("Creating `tls.Socket`: %o",this.connectOpts),s=MOt.connect(LOt(this.connectOpts))):(Q8("Creating `net.Socket`: %o",this.connectOpts),s=ade.connect(this.connectOpts));let i=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=ade.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${o}:${n.port} HTTP/1.1\r -`;if(r.username||r.password){let h=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;i["Proxy-Authorization"]=`Basic ${Buffer.from(h).toString("base64")}`}i.Host=`${o}:${n.port}`,i["Proxy-Connection"]||(i["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let h of Object.keys(i))a+=`${h}: ${i[h]}\r -`;let c=(0,w0r.parseProxyResponse)(s);s.write(`${a}\r -`);let{connect:u,buffered:l}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",T0r),n.secureEndpoint?(Q8("Upgrading socket connection to TLS"),MOt.connect({...FOt(LOt(n),"host","path","port"),socket:s})):s;s.destroy();let d=new ade.Socket({writable:!1});return d.readable=!0,e.once("socket",h=>{Q8("Replaying proxy buffer for failed request"),(0,S0r.default)(h.listenerCount("data")>0),h.push(l),h.push(null)}),d}};cde.protocols=["http","https"];iE.HttpsProxyAgent=cde;function T0r(t){t.resume()}function FOt(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}});function lde(){return new Ka}var RR,Ka,Pf=V(()=>{p();RR=class{queue=[];waiting=[];done=!1;finalResultPromise;resolveFinalResult;isComplete;extractResult;constructor(e,n){this.isComplete=e,this.extractResult=n,this.finalResultPromise=new Promise(r=>{this.resolveFinalResult=r})}push(e){if(this.done)return;this.isComplete(e)&&(this.done=!0,this.resolveFinalResult(this.extractResult(e)));let n=this.waiting.shift();n?n({value:e,done:!1}):this.queue.push(e)}end(e){for(this.done=!0,e!==void 0&&this.resolveFinalResult(e);this.waiting.length>0;)this.waiting.shift()({value:void 0,done:!0})}async*[Symbol.asyncIterator](){for(;;)if(this.queue.length>0)yield this.queue.shift();else{if(this.done)return;{let e=await new Promise(n=>this.waiting.push(n));if(e.done)return;yield e.value}}}result(){return this.finalResultPromise}},Ka=class extends RR{constructor(){super(e=>e.type==="done"||e.type==="error",e=>{if(e.type==="done")return e.message;if(e.type==="error")return e.error;throw new Error("Unexpected event type for final result")})}}});function v0r(t,e){return{role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"error",errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()}}function R0r(t){return typeof t.result=="function"}async function k0r(t,e){for await(let n of e)t.push(n);t.end(R0r(e)?await e.result():void 0)}function _h(t,e){let n=new Ka;return e().then(r=>k0r(n,r)).catch(r=>{let s=v0r(t,r);n.push({type:"error",reason:"error",error:s}),n.end(s)}),n}function lu(t,e){let n={stream:(r,s,i)=>_h(r,async()=>(await t()).stream(r,s,i)),streamSimple:(r,s,i)=>_h(r,async()=>(await t()).streamSimple(r,s,i))};return e?.fetchDeferred&&(n.fetchDeferred=(r,s,i)=>_h(r,async()=>{let o=await t();if(!o.fetchDeferred)throw new Error("API does not support deferred responses");return o.fetchDeferred(r,s,i)})),e?.cancelDeferred&&(n.cancelDeferred=async(r,s,i)=>{let o=await t();if(!o.cancelDeferred)throw new Error("API cannot cancel deferred responses");await o.cancelDeferred(r,s,i)}),n}var iA=V(()=>{p();Pf()});function D0r(){return globalThis.process?.env}function U8(){return{async env(t){let e=D0r()?.[t];return typeof e=="string"&&e.trim().length>0?e:void 0},async fileExists(t){try{let e=await $Ot("node:fs/promises"),n=t;return n.startsWith("~")&&(n=(await $Ot("node:os")).homedir()+n.slice(1)),await e.access(n),!0}catch{return!1}}}}var N0r,$Ot,ude=V(()=>{p();N0r=function(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,s,i,o){return r?e?".jsx":".js":s&&(!i||!o)?n:s+i+"."+o.toLowerCase()+"js"}):t},$Ot=t=>import(N0r(t))});function GOt(t){if(t.reason!==void 0)return t.reason;let e=new Error("The operation was aborted");return e.name="AbortError",e}function m_(t){return t??new AbortController().signal}function f_(t,e){return e.aborted?(t.catch(()=>{}),Promise.reject(GOt(e))):new Promise((n,r)=>{let s=!1,i=()=>e.removeEventListener("abort",o),o=()=>{s||(s=!0,i(),r(GOt(e)))};e.addEventListener("abort",o,{once:!0}),t.then(a=>{s||(s=!0,i(),n(a))},a=>{s||(s=!0,i(),r(a))}),e.aborted&&o()})}var dde=V(()=>{p()});var WB,pde=V(()=>{p();dde();WB=class{credentials=new Map;chains=new Map;enqueue(e,n,r){let s=m_(r?.signal),i=this.chains.get(e)??Promise.resolve(),o=(async()=>(await i.catch(()=>{}),s.throwIfAborted(),n()))(),a=o.catch(()=>{});return this.chains.set(e,a),a.then(()=>{this.chains.get(e)===a&&this.chains.delete(e)}),f_(o,s)}async read(e,n){return n?.signal?.throwIfAborted(),this.credentials.get(e)}async list(e){return e?.signal?.throwIfAborted(),[...this.credentials].map(([n,r])=>({providerId:n,type:r.type}))}modify(e,n,r){return this.enqueue(e,async()=>{let s=this.credentials.get(e),i=await n(s);return r?.signal?.throwIfAborted(),i!==void 0&&this.credentials.set(e,i),i??s},r)}delete(e,n){return this.enqueue(e,async()=>{this.credentials.delete(e)},n)}}});function kR(t){return t instanceof Error?t.message||t.name:typeof t=="string"?t:String(t)}function WOt(t){if(!(t instanceof Error))return{name:"ThrownValue",message:kR(t)};let e=t.code;return{name:t.name||void 0,message:t.message||t.name,stack:t.stack,code:typeof e=="string"||typeof e=="number"?e:void 0}}function $8(t,e,n){return{type:t,timestamp:Date.now(),error:WOt(e),details:n}}function ZS(t,e){t.diagnostics=[...t.diagnostics??[],e]}var qB=V(()=>{p()});function B0r(t,e){if(e==null)return t;let n=kR(e).trim();return!n||t.includes(n)?t:`${t}: ${n}`}function G8(t,e,n,r){let s=m_(r?.signal);return f_(P0r(t,e,n,r,s),s)}async function P0r(t,e,n,r,s){s.throwIfAborted();let i=r?.env?O0r(n,r.env):n;if(r?.apiKey!==void 0&&t.auth.apiKey)return zQe(i,t.auth.apiKey,t.id,{type:"api_key",key:r.apiKey,env:r.env},s);let o=await Q0r(e,t.id,s);if(o){if(o.type==="oauth"&&t.auth.oauth)return F0r(e,t.id,t.auth.oauth,o,s,r?.minOAuthValidityMs);if(o.type==="api_key"&&t.auth.apiKey){let a=r?.env?{...o,env:{...o.env,...r.env}}:o;return zQe(i,t.auth.apiKey,t.id,a,s)}return}return t.auth.apiKey?zQe(i,t.auth.apiKey,t.id,void 0,s):void 0}function O0r(t,e){return{env:async n=>e[n]||await t.env(n),fileExists:n=>t.fileExists(n)}}async function F0r(t,e,n,r,s,i){let o=Math.max(M0r,i??0),a=u=>Date.now()+o>=u.expires,c=r;if(a(c)){let u;try{u=await t.modify(e,async l=>{if(l?.type==="oauth"&&a(l))try{let d=AbortSignal.any([s,AbortSignal.timeout(L0r)]);return await n.refresh(l,d)}catch(d){throw new ho("oauth",`OAuth refresh failed for ${e}`,{cause:d})}},{signal:s})}catch(l){throw l instanceof ho?l:new ho("auth",`Credential store modify failed for ${e}`,{cause:l})}if(u?.type!=="oauth")return;if(c=u,i!==void 0&&a(c))throw new ho("oauth",`OAuth refresh returned a token that expires too soon for ${e}`)}try{return{auth:await n.toAuth(c),source:"OAuth"}}catch(u){throw new ho("oauth",`OAuth auth derivation failed for ${e}`,{cause:u})}}async function zQe(t,e,n,r,s){try{return await e.resolve({ctx:t,credential:r,signal:s})}catch(i){throw new ho("auth",`API key auth failed for provider ${n}`,{cause:i})}}async function Q0r(t,e,n){try{return await t.read(e,{signal:n})}catch(r){throw new ho("auth",`Credential store read failed for ${e}`,{cause:r})}}var ho,M0r,L0r,hde=V(()=>{p();dde();qB();ho=class extends Error{code;constructor(e,n,r){super(B0r(n,r?.cause),r),this.name="ModelsError",this.code=e}};M0r=300*1e3,L0r=15e3});var W8,JQe=V(()=>{p();W8=class{entries=new Map;async read(e,n){n?.signal?.throwIfAborted();let r=this.entries.get(e);return r?structuredClone(r):void 0}async write(e,n,r){r?.signal?.throwIfAborted(),this.entries.set(e,structuredClone(n))}async delete(e,n){n?.signal?.throwIfAborted(),this.entries.delete(e)}}});function qOt(t,e){if(!t&&!e)return;let n={...t};for(let[r,s]of Object.entries(e??{})){let i=r.toLowerCase();for(let o of Object.keys(n))o.toLowerCase()===i&&delete n[o];n[r]=s}return n}function H8(t){return new XQe(t)}function Qn(t){let e=t.models,n=[],r=t.fetchModels,s=()=>{let d=[...e];for(let h of n){let m=d.findIndex(f=>f.id===h.id);m>=0?d[m]=h:d.push(h)}return d},i=typeof t.api.stream=="function"?t.api:void 0,o=i?void 0:t.api,a=d=>i??o?.[d.api],c=(d,h)=>{let m=a(d);return m?h(m):_h(d,async()=>{throw new ho("stream",`Provider ${t.id} has no API implementation for "${d.api}"`)})},u={id:t.id,name:t.name??t.id,baseUrl:t.baseUrl,headers:t.headers,auth:t.auth,getModels:s,refreshModels:r?async d=>{if(d.stored){let m=d.stored.models.filter(f=>f.provider===t.id).map(f=>f);if(!await d.publish({update:()=>{n=m}}))return}if(!d.allowNetwork||d.signal.aborted)return;let h=await r(d);d.signal.aborted||await d.publish({persist:{models:h,checkedAt:Date.now()},update:()=>{n=h}})}:void 0,filterModels:t.filterModels,stream:(d,h,m)=>c(d,f=>f.stream(d,h,m)),streamSimple:(d,h,m)=>c(d,f=>f.streamSimple(d,h,m))},l=i?[i]:Object.values(o??{}).filter(d=>d!==void 0);return l.some(d=>d.fetchDeferred!==void 0)&&(u.fetchDeferred=(d,h,m)=>_h(d,async()=>{let f=a(d);if(!f?.fetchDeferred)throw new ho("provider",`Provider ${t.id} does not support deferred responses for "${d.api}"`);return f.fetchDeferred(d,h,m)})),l.some(d=>d.cancelDeferred!==void 0)&&(u.cancelDeferred=async(d,h,m)=>{let f=a(d);if(!f?.cancelDeferred)throw new ho("provider",`Provider ${t.id} cannot cancel deferred responses for "${d.api}"`);await f.cancelDeferred(d,h,m)}),u}function U0r(t,e){return t.api===e}function Sh(t,e){let n=e.input+e.cacheRead+e.cacheWrite,r=t.cost,s=-1;for(let a of t.cost.tiers??[])n>a.inputTokensAbove&&a.inputTokensAbove>s&&(r=a,s=a.inputTokensAbove);let i=e.cacheWrite1h??0,o=e.cacheWrite-i;return e.cost.input=r.input/1e6*e.input,e.cost.output=r.output/1e6*e.output,e.cost.cacheRead=r.cacheRead/1e6*e.cacheRead,e.cost.cacheWrite=(r.cacheWrite*o+r.input*2*i)/1e6,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite,e.cost}function NR(t){return t.reasoning?q8.filter(e=>{let n=t.thinkingLevelMap?.[e];return n===null?!1:e==="xhigh"||e==="max"?n!==void 0:!0}):["off"]}function uu(t,e){let n=NR(t);if(n.includes(e))return e;let r=q8.indexOf(e);if(r===-1)return n[0]??"off";for(let s=r;s=0;s--){let i=q8[s];if(n.includes(i))return i}return n[0]??"off"}function cd(t,e){return!t||!e?!1:t.id===e.id&&t.provider===e.provider}var XQe,q8,is=V(()=>{p();iA();ude();pde();hde();JQe();dde();hde();XQe=class{providers=new Map;credentials;modelsStore;authContext;refreshGenerations=new Map;refreshControllers=new Map;publicationChains=new Map;constructor(e){this.credentials=e?.credentials??new WB,this.modelsStore=e?.modelsStore??new W8,this.authContext=e?.authContext??U8()}setProvider(e){this.supersedeProviderRefresh(e.id),this.providers.set(e.id,e)}deleteProvider(e){this.supersedeProviderRefresh(e),this.providers.delete(e)}clearProviders(){for(let e of new Set([...this.providers.keys(),...this.refreshControllers.keys()]))this.supersedeProviderRefresh(e);this.providers.clear()}getProviders(){return Array.from(this.providers.values())}getProvider(e){return this.providers.get(e)}getModels(e){if(e!==void 0){let r=this.providers.get(e);if(!r)return[];try{return r.getModels()}catch{return[]}}let n=[];for(let r of this.providers.values())try{n.push(...r.getModels())}catch{}return n}getModel(e,n){return this.getModels(e).find(r=>r.id===n)}supersedeProviderRefresh(e){let n=(this.refreshGenerations.get(e)??0)+1;this.refreshGenerations.set(e,n);let r=this.refreshControllers.get(e);return r&&(this.refreshControllers.delete(e),r.abort()),n}beginProviderRefresh(e){let n=this.supersedeProviderRefresh(e),r=new AbortController;return this.refreshControllers.set(e,r),{generation:n,controller:r}}publishProviderModels(e,n,r,s){let i=this.publicationChains.get(e)??Promise.resolve(),o=(async()=>(await i.catch(()=>{}),r.aborted||this.refreshGenerations.get(e)!==n||(s.persist===null?await this.modelsStore.delete(e,{signal:r}):s.persist!==void 0&&await this.modelsStore.write(e,structuredClone(s.persist),{signal:r}),r.aborted||this.refreshGenerations.get(e)!==n)?!1:(s.update?.(),!0)))(),a=o.catch(()=>{});return this.publicationChains.set(e,a),a.then(()=>{this.publicationChains.get(e)===a&&this.publicationChains.delete(e)}),f_(o,r)}async runProviderRefreshPhase(e,n,r,s,i,o){let a=await this.modelsStore.read(e.id,{signal:o});await e.refreshModels({credential:n,stored:a?structuredClone(a):void 0,publish:c=>this.publishProviderModels(e.id,i,o,c),allowNetwork:r,force:r?s:void 0,signal:o})}async refresh(e={}){let n=e.allowNetwork??!0,r=m_(e.signal),s=new Map;if(r.aborted)return{aborted:!0,errors:s};let i=e.providers?new Set(e.providers):void 0,o=Array.from(this.providers.values()).filter(c=>c.refreshModels!==void 0&&(!i||i.has(c.id))),a=Promise.all(o.map(async c=>{let{generation:u,controller:l}=this.beginProviderRefresh(c.id),d=AbortSignal.any([r,l.signal]),h=(async()=>{let m,f;try{m=await this.readCredential(c.id,d)}catch(A){f=A}if(await this.runProviderRefreshPhase(c,m,!1,void 0,u,d),f!==void 0)throw f;if(!n||d.aborted)return;let g=await this.resolveRefreshCredential(c,m,d);g&&await this.runProviderRefreshPhase(c,g,!0,e.force,u,d)})();try{await f_(h,d)}catch(m){d.aborted||s.set(c.id,m instanceof Error?m:new ho("model_source",`Model refresh failed for ${c.id}`,{cause:m}))}finally{this.refreshControllers.get(c.id)===l&&this.refreshControllers.delete(c.id)}}));try{await f_(a,r)}catch(c){if(!r.aborted)throw c}return{aborted:r.aborted,errors:new Map(s)}}async resolveRefreshCredential(e,n,r){if(n?.type==="oauth"){let a=e.auth.oauth;if(!a)return;if(Date.now(){if(!(u?.type!=="oauth"||Date.now(){r.throwIfAborted();let i=this.providers.get(e);if(i)return this.checkProviderAuth(i,await this.readCredential(e,r),r)})();return f_(s,r)}getAvailable(e,n){let r=m_(n?.signal),s=(async()=>{r.throwIfAborted();let i=e?[this.providers.get(e)].filter(a=>a!==void 0):this.getProviders();return(await Promise.all(i.map(async a=>{let c=await this.readCredential(a.id,r);return{provider:a,credential:c,auth:await this.checkProviderAuth(a,c,r)}}))).flatMap(({provider:a,credential:c,auth:u})=>{if(!u)return[];let l=a.getModels();return a.filterModels?.(l,c)??l})})();return f_(s,r)}async getAuth(e,n){let r=m_(n?.signal),s=typeof e=="string"?e:e.provider,i=this.providers.get(s);if(!i)return;let o=await G8(i,this.credentials,this.authContext,{...n,signal:r});return!o||typeof e=="string"||!e.headers?o:{...o,auth:{...o.auth,headers:qOt(o.auth.headers,e.headers)}}}async login(e,n,r){let s=m_(r.signal);s.throwIfAborted();let i=this.providers.get(e);if(!i)throw new ho("provider",`Unknown provider: ${e}`);let o=n==="oauth"?i.auth.oauth:i.auth.apiKey;if(!o?.login)throw new ho("auth",`${i.name} does not support ${n} login`);let a=o.login({...r,signal:s}),c=await f_(a,s),u=!1,l,d=new Promise(m=>{l=m}),h=this.credentials.modify(e,async()=>(u=!0,l?.(),c),{signal:s});h.catch(()=>{});try{await new Promise((m,f)=>{let g=()=>{u||f(s.reason)};s.addEventListener("abort",g,{once:!0}),Promise.race([d,h]).then(()=>{s.removeEventListener("abort",g),m()},A=>{s.removeEventListener("abort",g),f(A)}),s.aborted&&g()}),await h}catch(m){throw s.throwIfAborted(),new ho("auth",`Credential store modify failed for ${e}`,{cause:m})}return c}async logout(e,n){let r=m_(n?.signal);r.throwIfAborted();try{await this.credentials.delete(e,{signal:r})}catch(s){throw r.throwIfAborted(),new ho("auth",`Credential store delete failed for ${e}`,{cause:s})}}requireProvider(e){let n=this.providers.get(e.provider);if(!n)throw new ho("provider",`Unknown provider: ${e.provider}`);return n}async applyAuth(e,n){this.requireProvider(e);let r=await this.getAuth(e,{apiKey:n?.apiKey,env:n?.env,signal:n?.signal});if(!r)throw new ho("auth",`Provider is not configured: ${e.provider}`);let s=r.auth,i=n?.apiKey??s.apiKey,o=qOt(s.headers,n?.headers);n?.transformHeaders&&(o=await n.transformHeaders(o??{}));let a=r.env||n?.env?{...r.env??{},...n?.env??{}}:void 0,c=s.baseUrl?{...e,baseUrl:s.baseUrl}:e,{transformHeaders:u,...l}=n??{},d={...l,apiKey:i,headers:o,env:a};return{requestModel:c,requestOptions:d}}stream(e,n,r){return _h(e,async()=>{let s=this.requireProvider(e),{requestModel:i,requestOptions:o}=await this.applyAuth(e,r);return s.stream(i,n,o)})}async complete(e,n,r){return this.stream(e,n,r).result()}streamSimple(e,n,r){return _h(e,async()=>{let s=this.requireProvider(e),{requestModel:i,requestOptions:o}=await this.applyAuth(e,r);return s.streamSimple(i,n,o)})}async completeSimple(e,n,r){return this.streamSimple(e,n,r).result()}streamDeferred(e,n,r){return _h(e,async()=>{let s=this.requireProvider(e);if(!s.fetchDeferred)throw new ho("provider",`Provider ${e.provider} does not support deferred responses`);let{requestModel:i,requestOptions:o}=await this.applyAuth(e,r);return s.fetchDeferred(i,n,o)})}async fetchDeferred(e,n,r){return this.streamDeferred(e,n,r).result()}async cancelDeferred(e,n,r){let s=this.requireProvider(e);if(!s.cancelDeferred)throw new ho("provider",`Provider ${e.provider} does not support deferred responses`);let{requestModel:i,requestOptions:o}=await this.applyAuth(e,r);await s.cancelDeferred(i,n,o)}};q8=["off","minimal","low","medium","high","xhigh","max"]});function Ch(t){if(!(t instanceof Error))return{message:ZQe(t),messageCarriesBody:!1};let e=t,n=$0r(e),r=G0r(e),s=r===void 0||t.message.includes(r);return{status:n,body:r,message:t.message,messageCarriesBody:s}}function $0r(t){if(typeof t.statusCode=="number")return t.statusCode;if(typeof t.status=="number")return t.status;if(typeof t.$metadata?.httpStatusCode=="number")return t.$metadata.httpStatusCode;if(typeof t.$response?.statusCode=="number")return t.$response.statusCode}function G0r(t){let e=W0r(t);if(e===void 0)return;let n=e.trim();if(n.length!==0)return H0r(n,4e3)}function W0r(t){if(typeof t.body=="string")return t.body;if(HOt(t.error))return ZQe(t.error);let e=t.$response?.body;if(typeof e=="string")return e;if(!q0r(e)&&HOt(e))return ZQe(e)}function q0r(t){return typeof t=="object"&&t!==null&&"pipe"in t&&typeof t.pipe=="function"}function HOt(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return e!==Object.prototype&&e!==null?!1:Object.keys(t).length>0}function Of(t,e){return t.messageCarriesBody||t.status===void 0||t.body===void 0?e!==void 0&&t.status!==void 0?`${e} (${t.status}): ${t.message}`:t.message:e!==void 0?`${e} (${t.status}): ${t.body}`:`${t.status}: ${t.body}`}function H0r(t,e){return t.length<=e?t:`${t.slice(0,e)}... [truncated ${t.length-e} chars]`}function ZQe(t){try{let e=JSON.stringify(t);return e===void 0?String(t):e}catch{return String(t)}}var Bx=V(()=>{p()});function Pp(t){let e={};for(let[n,r]of t.entries())e[n]=r;return e}function eC(t){if(!t)return;let e={};for(let[n,r]of Object.entries(t))r!==null&&(e[n]=r);return Object.keys(e).length>0?e:void 0}var oE=V(()=>{p()});var eUe=ee(Tr=>{"use strict";p();Object.defineProperty(Tr,"__esModule",{value:!0});Tr.Allow=Tr.ALL=Tr.COLLECTION=Tr.ATOM=Tr.SPECIAL=Tr.INF=Tr._INFINITY=Tr.INFINITY=Tr.NAN=Tr.BOOL=Tr.NULL=Tr.OBJ=Tr.ARR=Tr.NUM=Tr.STR=void 0;Tr.STR=1;Tr.NUM=2;Tr.ARR=4;Tr.OBJ=8;Tr.NULL=16;Tr.BOOL=32;Tr.NAN=64;Tr.INFINITY=128;Tr._INFINITY=256;Tr.INF=Tr.INFINITY|Tr._INFINITY;Tr.SPECIAL=Tr.NULL|Tr.BOOL|Tr.INF|Tr.NAN;Tr.ATOM=Tr.STR|Tr.NUM|Tr.SPECIAL;Tr.COLLECTION=Tr.ARR|Tr.OBJ;Tr.ALL=Tr.ATOM|Tr.COLLECTION;Tr.Allow={STR:Tr.STR,NUM:Tr.NUM,ARR:Tr.ARR,OBJ:Tr.OBJ,NULL:Tr.NULL,BOOL:Tr.BOOL,NAN:Tr.NAN,INFINITY:Tr.INFINITY,_INFINITY:Tr._INFINITY,INF:Tr.INF,SPECIAL:Tr.SPECIAL,ATOM:Tr.ATOM,COLLECTION:Tr.COLLECTION,ALL:Tr.ALL};Tr.default=Tr.Allow});var jOt=ee(Op=>{"use strict";p();var V0r=Op&&Op.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),j0r=Op&&Op.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&V0r(e,t,n)};Object.defineProperty(Op,"__esModule",{value:!0});Op.Allow=Op.MalformedJSON=Op.PartialJSON=Op.parseJSON=Op.parse=void 0;var Am=eUe();Object.defineProperty(Op,"Allow",{enumerable:!0,get:function(){return Am.Allow}});j0r(eUe(),Op);var mde=class extends Error{};Op.PartialJSON=mde;var fde=class extends Error{};Op.MalformedJSON=fde;function VOt(t,e=Am.Allow.ALL){if(typeof t!="string")throw new TypeError(`expecting str, got ${typeof t}`);if(!t.trim())throw new Error(`${t} is empty`);return Y0r(t.trim(),e)}Op.parseJSON=VOt;var Y0r=(t,e)=>{let n=t.length,r=0,s=h=>{throw new mde(`${h} at position ${r}`)},i=h=>{throw new fde(`${h} at position ${r}`)},o=()=>(d(),r>=n&&s("Unexpected end of input"),t[r]==='"'?a():t[r]==="{"?c():t[r]==="["?u():t.substring(r,r+4)==="null"||Am.Allow.NULL&e&&n-r<4&&"null".startsWith(t.substring(r))?(r+=4,null):t.substring(r,r+4)==="true"||Am.Allow.BOOL&e&&n-r<4&&"true".startsWith(t.substring(r))?(r+=4,!0):t.substring(r,r+5)==="false"||Am.Allow.BOOL&e&&n-r<5&&"false".startsWith(t.substring(r))?(r+=5,!1):t.substring(r,r+8)==="Infinity"||Am.Allow.INFINITY&e&&n-r<8&&"Infinity".startsWith(t.substring(r))?(r+=8,1/0):t.substring(r,r+9)==="-Infinity"||Am.Allow._INFINITY&e&&1{let h=r,m=!1;for(r++;r{r++,d();let h={};try{for(;t[r]!=="}";){if(d(),r>=n&&Am.Allow.OBJ&e)return h;let m=a();d(),r++;try{let f=o();h[m]=f}catch(f){if(Am.Allow.OBJ&e)return h;throw f}d(),t[r]===","&&r++}}catch{if(Am.Allow.OBJ&e)return h;s("Expected '}' at end of object")}return r++,h},u=()=>{r++;let h=[];try{for(;t[r]!=="]";)h.push(o()),d(),t[r]===","&&r++}catch{if(Am.Allow.ARR&e)return h;s("Expected ']' at end of array")}return r++,h},l=()=>{if(r===0){t==="-"&&i("Not sure what '-' is");try{return JSON.parse(t)}catch(m){if(Am.Allow.NUM&e)try{return JSON.parse(t.substring(0,t.lastIndexOf("e")))}catch{}i(String(m))}}let h=r;for(t[r]==="-"&&r++;t[r]&&",]}".indexOf(t[r])===-1;)r++;r==n&&!(Am.Allow.NUM&e)&&s("Unterminated number literal");try{return JSON.parse(t.substring(h,r))}catch{t.substring(h,r)==="-"&&s("Not sure what '-' is");try{return JSON.parse(t.substring(h,t.lastIndexOf("e")))}catch(f){i(String(f))}}},d=()=>{for(;r=0&&e<=31}function X0r(t){switch(t){case"\b":return"\\b";case"\f":return"\\f";case` -`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return`\\u${t.codePointAt(0)?.toString(16).padStart(4,"0")??"0000"}`}}function nUe(t){let e="",n=!1;for(let r=0;r{p();tUe=Gt(jOt(),1),z0r=new Set(['"',"\\","/","b","f","n","r","t","u"])});function Z0r(t){if(!(typeof process>"u"||!process.versions?.bun||Object.keys(process.env).length>0)){if(Ade===null){Ade=new Map;try{let{readFileSync:e}=require("node:fs"),n=e("/proc/self/environ","utf-8");for(let r of n.split("\0")){let s=r.indexOf("=");s>0&&Ade.set(r.slice(0,s),r.slice(s+1))}}catch{}}return Ade.get(t)}}function Ps(t,e){return e?.[t]||(typeof process<"u"?process.env[t]:void 0)||Z0r(t)||void 0}var Ade,tC=V(()=>{p();Ade=null});function rUe(t,e){let n=t.toLowerCase(),r=t.toUpperCase();return e?.[n]||e?.[r]||Ps(n)||Ps(r)||""}function tSr(t){if(t instanceof URL)return t;try{return new URL(t)}catch{return}}function sUe(t){return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}function nSr(t){let e=t.trim().toLowerCase();if(!e)return;if(e.startsWith("[")){let r=e.indexOf("]");if(r!==-1){let s=e.slice(1,r),i=e.slice(r+1);if(i.startsWith(":")){let o=Number.parseInt(i.slice(1),10);return{host:s,port:Number.isNaN(o)?0:o}}return{host:s,port:0}}}if(e.includes(":")&&e.split(":").length>2)return{host:e,port:0};let n=e.lastIndexOf(":");if(n!==-1&&n===e.indexOf(":")){let r=e.slice(0,n),s=Number.parseInt(e.slice(n+1),10);if(!Number.isNaN(s))return{host:r,port:s}}return{host:e,port:0}}function rSr(t,e,n){let r=rUe("no_proxy",n).toLowerCase();if(!r)return!0;if(r==="*")return!1;let s=sUe(t.toLowerCase());return r.split(/[,\s]/).every(i=>{let o=nSr(i);if(!o||o.port&&o.port!==e)return!0;let a=sUe(o.host);return a.startsWith("*.")?a=a.slice(2):(a.startsWith(".")||a.startsWith("*"))&&(a=a.slice(1)),a?!(s===a||s.endsWith(`.${a}`)):!0})}function sSr(t,e){let n=tSr(t);if(!n?.protocol||!n.host)return"";let r=n.protocol.split(":",1)[0],s=sUe(n.hostname||n.host.replace(/:\d*$/,"")),i=Number.parseInt(n.port,10)||eSr[r]||0;if(!rSr(s,i,e))return"";let o=rUe(`${r}_proxy`,e)||rUe("all_proxy",e);return o&&!o.includes("://")&&(o=`${r}://${o}`),o}function yde(t,e){let n=sSr(t,e);if(!n)return;let r;try{r=new URL(n)}catch(s){throw new Error(`Invalid proxy URL ${JSON.stringify(n)}: ${s instanceof Error?s.message:String(s)}`)}if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error(`${iSr} Got ${r.protocol}`);return r}var eSr,iSr,iUe=V(()=>{p();tC();eSr={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};iSr="Unsupported proxy protocol. SOCKS and PAC proxy URLs are not supported; use an HTTP or HTTPS proxy URL."});function ts(t){return t.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?{p()});function V8(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function aSr(t){if(!V8(t))return!1;let e=typeof t.type=="string"?[t.type]:Array.isArray(t.type)?t.type:[];return e.includes("object")||e.includes("array")||t.properties!==void 0||t.items!==void 0}function YOt(t){return V8(t)?t.type==="null"||Array.isArray(t.type)&&t.type.includes("null")||t.const===null||Array.isArray(t.enum)&&t.enum.includes(null)?!0:Array.isArray(t.anyOf)&&t.anyOf.some(e=>YOt(e)):!1}function Ede(t){if(!V8(t))throw new ym("boolean schemas are unsupported");for(let i of oSr)if(t[i]!==void 0)throw new ym(`${i} schemas are unsupported`);if(t.anyOf!==void 0){if(!Array.isArray(t.anyOf)||t.anyOf.length===0)throw new ym("anyOf must contain at least one schema");for(let i of t.anyOf){if(aSr(i))throw new ym("object and array unions are unsupported");Ede(i)}}if(t.items!==void 0){if(Array.isArray(t.items))throw new ym("tuple schemas are unsupported");Ede(t.items)}let e=t.type==="object";if(t.properties!==void 0&&!e)throw new ym("properties require type object");if(!e)return;if(t.additionalProperties!==void 0&&t.additionalProperties!==!1)throw new ym("schema-valued or true additionalProperties is unsupported");if(t.properties!==void 0&&!V8(t.properties))throw new ym("object properties must be a schema map");if(t.required!==void 0&&(!Array.isArray(t.required)||t.required.some(i=>typeof i!="string")))throw new ym("object required must be a string array");let n=t.properties??{},r=Object.keys(n),s=new Set(Array.isArray(t.required)?t.required:[]);if([...s].some(i=>!r.includes(i)))throw new ym("required contains an unknown property");for(let[i,o]of Object.entries(n))Ede(o),!s.has(i)&&!YOt(o)&&(n[i]={anyOf:[o,{type:"null"}]});t.required=r,t.additionalProperties=!1}function KOt(t){let e=structuredClone(t);if(!V8(e))throw new ym("root schema must have type object");if(Ede(e),e.type!=="object")throw new ym("root schema must have type object");return e}function aE(t,e){return e===!0?KOt(t.parameters):t.parameters}function bde(t,e,n){let r=e[n];if(typeof r!="string")throw new Error(`Grammar tool call "${t}" requires argument "${n}" to be a string.`);return r}function _de(t,e,n,r){if(t.closed){if(r&&n===t.input)return;throw new Error(`grammar tool input for property "${e}" changed after it was closed`)}if(!n.startsWith(t.input))throw new Error(`grammar tool input for property "${e}" changed non-monotonically`);let s=n.slice(t.input.length);if(!r&&s.length===0)return;let i="";return t.started||(i+=`{${JSON.stringify(e)}:"`,t.started=!0),i+=JSON.stringify(s).slice(1,-1),t.input=n,r&&(i+='"}',t.closed=!0),i}function cSr(t){let e=t.parameters;if(e.type!=="object")throw new Error("grammar constrained sampling requires an object parameter schema");if(!Array.isArray(e.required)||e.required.length!==1||typeof e.required[0]!="string")throw new Error("grammar constrained sampling requires exactly one required string property");let n=e.required[0];if(!e.properties?.[n])throw new Error(`grammar constrained sampling requires a properties entry for ${n}`);if(e.properties[n]?.type!=="string")throw new Error(`grammar constrained sampling property ${n} must have type string`);return n}function oA(t,e){let n=t.constrainedSampling;if(!(!n||n.type!=="json_schema")){if(e)try{return KOt(t.parameters),!0}catch(r){if(!(r instanceof ym))throw r;if(n.strict!=="require")return;throw new Error(`Tool "${t.name}" requires JSON-schema constrained sampling, but ${r.message}.`)}if(n.strict==="require")throw new Error(`Tool "${t.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`)}}function j8(t,e){let n=t.constrainedSampling;if(!n||n.type!=="grammar"||!e)return;let r=n.variants.openai_lark,s=n.variants.openai_regex,i=typeof r=="string"&&r.trim().length>0,o=typeof s=="string"&&s.trim().length>0;if(!i&&!o)throw new Error(`Tool "${t.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`);try{return{format:i?"lark":"regex",definition:i?r:s,inputProperty:cSr(t)}}catch(a){let c=a instanceof Error?a.message:String(a);throw new Error(`Tool "${t.name}" cannot use grammar constrained sampling: ${c}.`)}}function cE(t,e){let n=new Map;for(let r of t??[]){let s=j8(r,e);s&&n.set(r.name,s.inputProperty)}return n}var ym,oSr,rC=V(()=>{p();ym=class extends Error{},oSr=["$ref","$defs","definitions","allOf","oneOf","patternProperties","dependentSchemas","dependencies","unevaluatedProperties","propertyNames","contains","prefixItems","not","if","then","else"]});function eMt(t){return t.totalTokens||t.input+t.output+t.cacheRead+t.cacheWrite}function tMt(t){try{return JSON.stringify(t)??"undefined"}catch{return"[unserializable]"}}function lSr(t){if(typeof t=="string")return t.length;let e=0;for(let n of t)e+=n.type==="text"?n.text.length:4800;return e}function nMt(t){return Math.ceil(t.length/4)}function zOt(t){return Math.ceil(lSr(t)/4)}function JOt(t){let e=0;if(t.role==="user"||t.role==="toolResult")return zOt(t.content);for(let n of t.content)n.type==="text"?e+=n.text.length:n.type==="thinking"?e+=n.thinking.length:e+=n.name.length+tMt(n.arguments).length;return Math.ceil(e/4)}function uSr(t){let e=Number.NEGATIVE_INFINITY,n;for(let r=0;r=e&&i.stopReason!=="aborted"&&i.stopReason!=="error"&&eMt(i.usage)>0&&(n={usage:i.usage,index:r})}e=Math.max(e,s.timestamp)}return n}function XOt(t){let e=uSr(t);if(e){let r=eMt(e.usage),s=0;for(let i=e.index+1;ii.role==="toolResult").flatMap(i=>i.addedToolNames??[])),s=ZOt(t.tools?.filter(i=>r.has(i.name)));return{tokens:e.tokens+s,usageTokens:e.usageTokens,trailingTokens:e.trailingTokens+s,lastUsageIndex:e.lastUsageIndex}}let n=(t.systemPrompt?nMt(t.systemPrompt):0)+ZOt(t.tools);return{tokens:e.tokens+n,usageTokens:e.usageTokens,trailingTokens:e.trailingTokens+n,lastUsageIndex:e.lastUsageIndex}}var sMt=V(()=>{p()});function Y8(t,e,n){if(t.contextWindow<=0)return Math.max(iMt,n);let r=t.contextWindow-rMt(e).tokens-pSr;return Math.min(n,Math.max(iMt,r))}function Yd(t,e,n,r){let s=t.samplingParams||n?.samplingParams?{...t.samplingParams,...n?.samplingParams}:void 0;return{temperature:n?.temperature,samplingParams:s,maxTokens:Y8(t,e,n?.maxTokens??t.maxTokens),signal:n?.signal,telemetryContext:n?.telemetryContext,apiKey:r||n?.apiKey,fetch:n?.fetch,transport:n?.transport,cacheRetention:n?.cacheRetention,sessionId:n?.sessionId,headers:n?.headers,onPayload:n?.onPayload,onResponse:n?.onResponse,timeoutMs:n?.timeoutMs,websocketConnectTimeoutMs:n?.websocketConnectTimeoutMs,maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,metadata:n?.metadata,env:n?.env}}function oUe(t){return t==="xhigh"||t==="max"?"high":t}function aUe(t,e){let n={...mSr,...e},r=oUe(t);return n[r]}function cUe(t,e){return Math.min(t,Math.max(0,e-hSr))}function Sde(t,e,n,r){let s=aUe(n,r),i=t===void 0?e:Math.min(t+s,e);return i<=s&&(s=cUe(s,i)),{maxTokens:i,thinkingBudget:s}}var pSr,iMt,hSr,mSr,sC=V(()=>{p();sMt();pSr=4096,iMt=1;hSr=1024,mSr={minimal:1024,low:2048,medium:8192,high:16384}});function oMt(t,e){let n=[],r=!1;for(let s of t){if(s.type==="image"){r||n.push({type:"text",text:e}),r=!0;continue}n.push(s),r=s.text===e}return n}function ASr(t,e){return e.input.includes("image")?t:t.map(n=>n.role==="user"&&Array.isArray(n.content)?{...n,content:oMt(n.content,fSr)}:n.role==="toolResult"?{...n,content:oMt(n.content,gSr)}:n)}function lE(t,e,n){let r=new Map,s=t.map(d=>d.content==null?{...d,content:[]}:d),o=ASr(s,e).map(d=>{if(d.role==="user")return d;if(d.role==="toolResult"){let h=r.get(d.toolCallId);return h&&h!==d.toolCallId?{...d,toolCallId:h}:d}if(d.role==="assistant"){let h=d,m=h.provider===e.provider&&h.api===e.api&&h.model===e.id,f=h.content.flatMap(g=>{if(g.type==="thinking")return g.redacted?m?g:[]:m&&g.thinkingSignature?g:!g.thinking||g.thinking.trim()===""?[]:m?g:{type:"text",text:g.thinking};if(g.type==="text")return m?g:{type:"text",text:g.text};if(g.type==="toolCall"){let A=g,y=A;if(!m&&A.thoughtSignature&&(y={...A},delete y.thoughtSignature),!m&&n){let b=n(A.id,e,h);b!==A.id&&(r.set(A.id,b),y={...y,id:b})}return y}return g});return{...h,content:f}}return d}),a=[],c=[],u=new Set,l=()=>{if(c.length>0){for(let d of c)u.has(d.id)||a.push({role:"toolResult",toolCallId:d.id,toolName:d.name,content:[{type:"text",text:"No result provided"}],isError:!0,timestamp:Date.now()});c=[],u=new Set}};for(let d=0;dg.type==="toolCall");f.length>0&&(c=f,u=new Set),a.push(h)}else h.role==="toolResult"?(u.add(h.toolCallId),a.push(h)):(h.role==="user"&&l(),a.push(h))}return l(),a}var fSr,gSr,HB=V(()=>{p();fSr="(image omitted: model does not support images)",gSr="(tool image omitted: model does not support images)"});function Wt(t,e,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n}function xe(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}var Em=V(()=>{p()});var s$,xde=V(()=>{p();s$=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return s$=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),n=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))}});function uE(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var VB,DR=V(()=>{p();VB=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{let e=Object.prototype.toString.call(t);if(e==="[object Error]"||e==="[object DOMException]"){let n=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(n.stack=t.stack),t.cause&&!n.cause&&(n.cause=t.cause),t.name&&(n.name=t.name),n}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)}});var gn,Xc,Mp,iC,i$,K8,o$,a$,c$,l$,u$,d$,p$,h$,Ra=V(()=>{p();DR();gn=class extends Error{},Xc=class t extends gn{constructor(e,n,r,s,i){super(`${t.makeMessage(e,n,r)}`),this.status=e,this.headers=s,this.requestID=s?.get("request-id"),this.workspaceID=s?.get("anthropic-workspace-id"),this.error=n,this.type=i??null}static makeMessage(e,n,r){let s=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return e&&s?`${e} ${s}`:e?`${e} status code (no body)`:s||"(no status code or body)"}static generate(e,n,r,s){if(!e||!s)return new iC({message:r,cause:VB(n)});let i=n,o=i?.error?.type;return e===400?new o$(e,i,r,s,o):e===401?new a$(e,i,r,s,o):e===403?new c$(e,i,r,s,o):e===404?new l$(e,i,r,s,o):e===409?new u$(e,i,r,s,o):e===422?new d$(e,i,r,s,o):e===429?new p$(e,i,r,s,o):e>=500?new h$(e,i,r,s,o):new t(e,i,r,s,o)}},Mp=class extends Xc{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},iC=class extends Xc{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}},i$=class extends iC{constructor({message:e}={}){super({message:e??"Request timed out."})}},K8=class extends gn{constructor(e,{cause:n}={}){super(e??"Retryable error."),n!==void 0&&(this.cause=n)}},o$=class extends Xc{},a$=class extends Xc{},c$=class extends Xc{},l$=class extends Xc{},u$=class extends Xc{},d$=class extends Xc{},p$=class extends Xc{},h$=class extends Xc{}});function z8(t){return typeof t!="object"?{}:t??{}}function gUe(t){if(!t)return!0;for(let e in t)return!1;return!0}function _Mt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function AUe(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var JSr,bMt,Ih,fUe,SMt,J8,bm=V(()=>{p();Ra();JSr=/^[a-z][a-z0-9+.-]*:/i,bMt=t=>JSr.test(t),Ih=t=>(Ih=Array.isArray,Ih(t)),fUe=Ih;SMt=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new gn(`${t} must be an integer`);if(e<0)throw new gn(`${t} must be a positive integer`);return e},J8=t=>{try{return JSON.parse(t)}catch{return}}});var g_,m$=V(()=>{p();g_=(t,e)=>new Promise(n=>{if(e?.aborted)return n();let r=()=>{clearTimeout(s),n()},s=setTimeout(()=>{e?.removeEventListener("abort",r),n()},t);e?.addEventListener("abort",r,{once:!0})})});var dE,X8=V(()=>{p();dE="0.123.0"});function XSr(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function eCr(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:n}of t){let r=n.exec(navigator.userAgent);if(r){let s=r[1]||0,i=r[2]||0,o=r[3]||0;return{browser:e,version:`${s}.${i}.${o}`}}}return null}var wMt,ZSr,CMt,IMt,xMt,Z8,wde=V(()=>{p();X8();wMt=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";ZSr=()=>{let t=XSr();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":dE,"X-Stainless-OS":IMt(Deno.build.os),"X-Stainless-Arch":CMt(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":dE,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":dE,"X-Stainless-OS":IMt(globalThis.process.platform??"unknown"),"X-Stainless-Arch":CMt(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=eCr();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":dE,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":dE,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};CMt=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",IMt=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),Z8=()=>xMt??(xMt=ZSr())});function tCr(t,e){return()=>t.removeEventListener("abort",e)}function vMt(t,e,n){Tde.set(t,tCr(e,n))}function RMt(t,e){Tde.has(e)&&TMt?.register(t,e,e)}function oC(t){let e=Tde.get(t);e&&(Tde.delete(t),TMt?.unregister(t),e())}var Tde,TMt,vde=V(()=>{p();Tde=new WeakMap,TMt=typeof globalThis.FinalizationRegistry=="function"?new globalThis.FinalizationRegistry(t=>oC(t)):null});function kMt(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function yUe(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function Rde(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return yUe({start(){},async pull(n){let{done:r,value:s}=await e.next();r?n.close():n.enqueue(s)},async cancel(){await e.return?.()}})}function e9(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){let n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function NMt(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),n=e.cancel();e.releaseLock(),await n}var f$=V(()=>{p()});var DMt,EUe=V(()=>{p();DMt=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)})});var bUe,_Ue,SUe,BMt,CUe=V(()=>{p();bUe="RFC3986",_Ue=t=>String(t),SUe={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:_Ue},BMt="RFC1738"});function OMt(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function xUe(t,e){if(Ih(t)){let n=[];for(let r=0;r{p();CUe();bm();kde=(t,e)=>(kde=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),kde(t,e)),aC=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),IUe=1024,PMt=(t,e,n,r,s)=>{if(t.length===0)return t;let i=t;if(typeof t=="symbol"?i=Symbol.prototype.toString.call(t):typeof t!="string"&&(i=String(t)),n==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let o="";for(let a=0;a=IUe?i.slice(a,a+IUe):i,u=[];for(let l=0;l=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||s===BMt&&(d===40||d===41)){u[u.length]=c.charAt(l);continue}if(d<128){u[u.length]=aC[d];continue}if(d<2048){u[u.length]=aC[192|d>>6]+aC[128|d&63];continue}if(d<55296||d>=57344){u[u.length]=aC[224|d>>12]+aC[128|d>>6&63]+aC[128|d&63];continue}l+=1,d=65536+((d&1023)<<10|c.charCodeAt(l)&1023),u[u.length]=aC[240|d>>18]+aC[128|d>>12&63]+aC[128|d>>6&63]+aC[128|d&63]}o+=u.join("")}return o}});function sCr(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function UMt(t,e,n,r,s,i,o,a,c,u,l,d,h,m,f,g,A,y){let b=t,S=y,C=0,I=!1;for(;(S=S.get(wUe))!==void 0&&!I;){let P=S.get(t);if(C+=1,typeof P<"u"){if(P===C)throw new RangeError("Cyclic object value");I=!0}typeof S.get(wUe)>"u"&&(C=0)}if(typeof u=="function"?b=u(e,b):b instanceof Date?b=h?.(b):n==="comma"&&Ih(b)&&(b=xUe(b,function(P){return P instanceof Date?h?.(P):P})),b===null){if(i)return c&&!g?c(e,ld.encoder,A,"key",m):e;b=""}if(sCr(b)||OMt(b)){if(c){let P=g?e:c(e,ld.encoder,A,"key",m);return[f?.(P)+"="+f?.(c(b,ld.encoder,A,"value",m))]}return[f?.(e)+"="+f?.(String(b))]}let x=[];if(typeof b>"u")return x;let w;if(n==="comma"&&Ih(b))g&&c&&(b=xUe(b,c)),w=[{value:b.length>0?b.join(",")||null:void 0}];else if(Ih(u))w=u;else{let P=Object.keys(b);w=l?P.sort(l):P}let R=a?String(e).replace(/\./g,"%2E"):String(e),N=r&&Ih(b)&&b.length===1?R+"[]":R;if(s&&Ih(b)&&b.length===0)return N+"[]";for(let P=0;P"u"?t.encodeDotInKeys?!0:ld.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:ld.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:ld.allowEmptyArrays,arrayFormat:i,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:ld.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?ld.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:ld.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:ld.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:ld.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:ld.encodeValuesOnly,filter:s,format:n,formatter:r,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:ld.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:ld.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:ld.strictNullHandling}}function $Mt(t,e={}){let n=t,r=iCr(e),s,i;typeof r.filter=="function"?(i=r.filter,n=i("",n)):Ih(r.filter)&&(i=r.filter,s=i);let o=[];if(typeof n!="object"||n===null)return"";let a=FMt[r.arrayFormat],c=a==="comma"&&r.commaRoundTrip;s||(s=Object.keys(n)),r.sort&&s.sort(r.sort);let u=new WeakMap;for(let h=0;h0?d+l:""}var FMt,QMt,LMt,ld,wUe,GMt=V(()=>{p();MMt();CUe();bm();FMt={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},QMt=function(t,e){Array.prototype.push.apply(t,Ih(e)?e:[e])},ld={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:PMt,encodeValuesOnly:!1,format:bUe,formatter:_Ue,indices:!1,serializeDate(t){return(LMt??(LMt=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};wUe={}});function WMt(t){return $Mt(t,{arrayFormat:"brackets"})}var TUe=V(()=>{p();GMt()});var cC={};Ir(cC,{child_process:()=>vUe,crypto:()=>BR,fs:()=>Ox,os:()=>aCr,path:()=>hs,stream:()=>Nde,util:()=>RUe});var vUe,BR,Ox,aCr,hs,Nde,RUe,Mf=V(()=>{p();vUe=Gt(require("node:child_process"),1),BR=Gt(require("node:crypto"),1),Ox=Gt(require("node:fs"),1),aCr=Gt(require("node:os"),1),hs=Gt(require("node:path"),1),Nde=Gt(require("node:stream"),1),RUe=Gt(require("node:util"),1)});function Bde(t){if(!t)return;let e;try{e=new URL(t)}catch(r){throw new Xo(`Invalid token endpoint base URL "${t}": ${r}`)}if(e.protocol==="https:")return;let n=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(n==="localhost"||n==="127.0.0.1"||n==="::1")))throw new Xo(`Refusing to send credential over non-https token endpoint "${t}"`)}async function Pde(t,e){let n=await lCr(t),r;try{r=JSON.parse(n)}catch{throw new Xo(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,Lf(n),e)}if(!r.access_token)throw new Xo(`Token endpoint response missing access_token: ${JSON.stringify(Lf(r))}`,t.status,Lf(r),e);if(r.token_type&&r.token_type.toLowerCase()!=="bearer")throw new Xo(`Token endpoint response: unsupported token_type "${r.token_type}" (want Bearer)`,t.status,Lf(r),e);return r}function Lf(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=kUe?t:t.slice(0,kUe)+`... <${t.length-kUe} more chars>`}return JSON.stringify(Lf(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[n,r]of Object.entries(t))cCr.has(n)&&(e[n]=r);return e}return null}async function Ode(t,e=n=>console.warn(`anthropic-sdk: ${n}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:n}=await Promise.resolve().then(()=>(Mf(),cC)),r=t,s;try{r=await n.promises.realpath(t),s=await n.promises.stat(r)}catch{return}let i=s.mode&511;if(i&18)throw new Xo(`Credentials file at ${r} is group/world-writable (mode 0o${i.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${r}\`.`);if(i&36)throw new Xo(`Credentials file at ${r} is group/world-readable (mode 0o${i.toString(8)}); run \`chmod 600 ${r}\` before retrying.`);typeof process.getuid=="function"&&s.uid!==process.getuid()&&e(`credentials file at ${r} is owned by uid ${s.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function Mde(t,e){let{fs:n,path:r}=await Promise.resolve().then(()=>(Mf(),cC)),s=r.dirname(t);await n.promises.mkdir(s,{recursive:!0,mode:448});let i=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let o=await n.promises.open(i,"w",384);try{await o.writeFile(JSON.stringify(e,null,2)),await o.sync()}finally{await o.close()}await n.promises.rename(i,t)}catch(o){throw await n.promises.unlink(i).catch(()=>{}),o}try{let o=await n.promises.open(s,"r");try{await o.sync()}finally{await o.close()}}catch{}}async function lCr(t){if(!t.body)return"";let e=t.body.getReader(),n=[],r=0;for(;;){let{done:i,value:o}=await e.read();if(i)break;if(r+o.length>qMt){let a=qMt-r;a>0&&n.push(o.subarray(0,a)),await e.cancel();break}n.push(o),r+=o.length}let s;if(n.length===1)s=n[0];else{s=new Uint8Array(n.reduce((o,a)=>o+a.length,0));let i=0;for(let o of n)s.set(o,i),i+=o.length}return new TextDecoder("utf-8").decode(s)}var HMt,VMt,Dde,jB,jMt,YMt,g$,KMt,qMt,kUe,cCr,Xo,A$=V(()=>{p();Ra();HMt="urn:ietf:params:oauth:grant-type:jwt-bearer",VMt="refresh_token",Dde="/v1/oauth/token",jB="oauth-2025-04-20",jMt="oidc-federation-2026-04-01",YMt=120,g$=30,KMt=5,qMt=1<<20;kUe=2e3,cCr=new Set(["error","error_description","error_uri"]);Xo=class extends gn{constructor(e,n=null,r=null,s=null){super(e),this.statusCode=n,this.body=r,this.requestId=s}}});function A_(){return Math.floor(Date.now()/1e3)}var t9=V(()=>{p()});var Lde,zMt=V(()=>{p();A$();t9();Lde=class{constructor(e,n){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=n}async getToken(){let e=this.nextForce;this.nextForce=!1;let n=this.cached;if(e||n==null)return(await this.refresh(e)).token;if(n.expiresAt==null)return n.token;let r=n.expiresAt-A_();return r>YMt?n.token:r>g$?(this.backgroundRefresh(),n.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||A_()-this.lastAdvisoryError{this.lastAdvisoryError=A_(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(n=>(this.cached=n,this.pendingRefresh=null,n),n=>{throw this.pendingRefresh=null,n}),this.pendingRefresh}}});var Di,y$=V(()=>{p();Di=t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0}});function ZMt(t){let e=0;for(let s of t)e+=s.length;let n=new Uint8Array(e),r=0;for(let s of t)n.set(s,r),r+=s.length;return n}function PR(t){let e;return(JMt??(e=new globalThis.TextEncoder,JMt=e.encode.bind(e)))(t)}function YB(t){let e;return(XMt??(e=new globalThis.TextDecoder,XMt=e.decode.bind(e)))(t)}var JMt,XMt,KB=V(()=>{p()});var eLt,NUe=V(()=>{p();Ra();KB();eLt=t=>{if(typeof globalThis.Buffer<"u"){let e=globalThis.Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(typeof atob<"u"){let e=atob(t),n=new Uint8Array(e.length);for(let r=0;rQde[n]?n9:e[t].bind(e)}function BUe(t,e){let n=tLt.get(t);if(n&&n[0]===e)return n[1];let r={error:Fde("error",t,e),warn:Fde("warn",t,e),info:Fde("info",t,e),debug:Fde("debug",t,e)};return tLt.set(t,[e,r]),r}function Ji(t){let e=t.logger,n=t.logLevel??"off";return e?BUe(e,n):uCr}function rLt(){let t=Di("ANTHROPIC_LOG");return(!DUe||t!==nLt)&&(nLt=t,DUe=BUe(console,Ude(t,"process.env['ANTHROPIC_LOG']",BUe(console,r9))??r9)),DUe}var r9,Qde,Ude,uCr,tLt,nLt,DUe,lC,y_=V(()=>{p();bm();y$();r9="warn",Qde={off:0,error:200,warn:300,info:400,debug:500},Ude=(t,e,n)=>{if(t){if(_Mt(Qde,t))return t;n.warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(Qde))}`)}};uCr={error:n9,warn:n9,info:n9,debug:n9},tLt=new WeakMap;lC=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,n])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t)});var PUe=V(()=>{p();bm();NUe();y$();y_();xde();m$();TUe()});function sLt(t){if(!t)throw new Error("profile name is empty");if(t==="."||t==="..")throw new Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw new Error(`profile name "${t}" must not contain path separators`);if(!dCr.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var $de,dCr,iLt,oLt,OUe,pCr,aLt,MUe=V(()=>{p();wde();PUe();$de="1.0",dCr=/^[A-Za-z0-9_.-]+$/;iLt=async t=>{var e,n;let r=await OUe();if(r===null)return null;let s=t??await aLt();if(s===null)return null;sLt(s);let{fs:i,path:o}=await Promise.resolve().then(()=>(Mf(),cC)),a=o.join(r,"configs",`${s}.json`),c;try{c=await i.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw new Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=Di("ANTHROPIC_ORGANIZATION_ID"),h=Di("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=Di("ANTHROPIC_FEDERATION_RULE_ID");return m&&d?{fromFile:!1,config:{organization_id:d,workspace_id:Di("ANTHROPIC_WORKSPACE_ID"),base_url:Di("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:Di("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:Di("ANTHROPIC_SCOPE")}}}:null}let u;try{u=JSON.parse(c)}catch(d){throw new Error(`failed to parse config file ${a}: ${d}`)}if(!u.authentication)throw new Error(`config file ${a} is missing "authentication"`);let l=u.authentication.type;if(l!=="oidc_federation"&&l!=="user_oauth")throw new Error(`authentication.type "${l}" is not a known authentication type`);if(u.organization_id??(u.organization_id=Di("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=Di("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=Di("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=Di("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let d=Di("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(u.authentication.identity_token={source:"file",path:d})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=Di("ANTHROPIC_FEDERATION_RULE_ID")??""),(n=u.authentication).service_account_id??(n.service_account_id=Di("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},oLt=async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let n=await OUe();if(!n)return null;let r=e??await aLt();if(!r)return null;sLt(r);let{path:s}=await Promise.resolve().then(()=>(Mf(),cC));return s.join(n,"credentials",`${r}.json`)},OUe=async()=>{if(!pCr())return null;let{path:t}=await Promise.resolve().then(()=>(Mf(),cC)),e=Di("ANTHROPIC_CONFIG_DIR");if(e)return e;if(Z8()["X-Stainless-OS"]==="Windows"){let i=Di("APPDATA");if(i)return t.join(i,"Anthropic");let o=Di("USERPROFILE");return o?t.join(o,"AppData","Roaming","Anthropic"):null}let r=Di("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let s=Di("HOME");return s?t.join(s,".config","anthropic"):null},pCr=()=>{let t=Z8()["X-Stainless-Runtime"];return t==="node"||t==="deno"},aLt=async()=>{let t=await OUe();if(!t)return null;let e=Di("ANTHROPIC_PROFILE");if(e)return e;let{fs:n,path:r}=await Promise.resolve().then(()=>(Mf(),cC)),s=r.join(t,"active_config");try{return(await n.promises.readFile(s,"utf-8")).trim()||"default"}catch(i){if(i?.code!=="ENOENT")throw new Error(`failed to read ${s}: ${i}`);return"default"}}});function LUe(t){if(!t)throw new gn("Identity token file path is empty");return async()=>{let{fs:e}=await Promise.resolve().then(()=>(Mf(),cC)),n;try{n=await e.promises.readFile(t,"utf-8")}catch(s){throw new gn(`Failed to read identity token file at ${t}: ${s}`)}let r=n.trim();if(!r)throw new gn(`Identity token file at ${t} is empty`);return r}}function cLt(t){if(!t)throw new gn("Identity token value is empty");return()=>t}var lLt=V(()=>{p();Ra()});function uLt(t){return async()=>{Bde(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new Xo(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let n={grant_type:HMt,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(n.service_account_id=t.serviceAccountId),t.workspaceId&&(n.workspace_id=t.workspaceId);let r=`${t.baseURL}${Dde}`,s;try{s=await t.fetch(r,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${jB},${jMt}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${dE} oidcFederationProvider`},body:JSON.stringify(n)})}catch(c){throw new Xo(`Failed to reach token endpoint ${r}: ${c}`)}let i=s.headers.get("Request-Id");if(!s.ok){let c=await s.text().catch(()=>""),u=Lf(c),l="";throw s.status===401&&(l=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new Xo(`Token exchange failed with status ${s.status}${i?` (request-id ${i})`:""}: ${u}${l}`,s.status,u,i)}let o=await Pde(s,i),a=Number(o.expires_in);if(!Number.isFinite(a))throw new Xo(`Token endpoint response missing required fields: ${JSON.stringify(Lf(o))}`,s.status,Lf(o),i);return{token:o.access_token,expiresAt:A_()+a}}}var dLt=V(()=>{p();A$();t9();X8()});function pLt(t){return async e=>{let{fs:n}=await Promise.resolve().then(()=>(Mf(),cC));await Ode(t.credentialsPath,t.onSafetyWarning);let r;try{r=await n.promises.readFile(t.credentialsPath,"utf-8")}catch(A){throw new Xo(`Credentials file not found at ${t.credentialsPath}: ${A}`)}let s;try{s=JSON.parse(r)}catch(A){throw new Xo(`Credentials file at ${t.credentialsPath} is not valid JSON: ${A}`)}let i=s.access_token;if(!i)throw new Xo(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let o=s.expires_at;if(!e?.forceRefresh&&(o==null||A_()"");throw new Xo(`User OAuth refresh failed (HTTP ${l.status}): ${Lf(A)}`,l.status,Lf(A),d)}let h=await Pde(l,d),m=Number(h.expires_in);if(!Number.isFinite(m))throw new Xo(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Lf(h))}`,l.status,Lf(h),d);let f=A_()+m,g=h.refresh_token||a;return await Mde(t.credentialsPath,{...s,version:$de,type:"oauth_token",access_token:h.access_token,expires_at:f,refresh_token:g}),{token:h.access_token,expiresAt:f}}}var hLt=V(()=>{p();MUe();A$();t9();X8()});function FUe(t,e){let n=t.authentication.credentials_path??null,r=(t.base_url||e.baseURL).replace(/\/+$/,""),s=hCr(t,n,r,e),i={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(i["anthropic-workspace-id"]=t.workspace_id),{provider:s,extraHeaders:i,baseURL:t.base_url||void 0}}async function mLt(t,e){let n=await iLt(e);if(!n)return null;let{config:r,fromFile:s}=n,i=r.authentication.credentials_path||!s?r:{...r,authentication:{...r.authentication,credentials_path:await oLt(r,e)??void 0}};return FUe(i,t)}function hCr(t,e,n,r){switch(t.authentication.type){case"oidc_federation":{let s=t.authentication,i=mCr(s);if(!i)throw new Xo("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!s.federation_rule_id)throw new Xo("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new Xo("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let o=uLt({identityTokenProvider:i,federationRuleId:s.federation_rule_id,organizationId:t.organization_id,serviceAccountId:s.service_account_id,workspaceId:t.workspace_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent});return e?fCr(o,e,r.onCacheWriteError,r.onSafetyWarning):o}case"user_oauth":{if(!e)throw new Xo("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return pLt({credentialsPath:e,clientId:t.authentication.client_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent,onSafetyWarning:r.onSafetyWarning})}default:{let s=t.authentication.type;throw new Xo(`authentication.type "${s}" is not a known authentication type`)}}}function mCr(t){if(t.identity_token){let r=t.identity_token.source;if(r!=="file")throw new Xo(`identity_token.source "${r}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Xo('identity_token.source "file" requires a non-empty path');return LUe(t.identity_token.path)}let e=Di("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return LUe(e);let n=Di("ANTHROPIC_IDENTITY_TOKEN");return n?cLt(n):null}function fCr(t,e,n,r){return async s=>{let{fs:i}=await Promise.resolve().then(()=>(Mf(),cC));await Ode(e,r);let o;try{let c=await i.promises.readFile(e,"utf-8");o=JSON.parse(c);let u=o?.access_token;if(u&&!s?.forceRefresh){let l=o?.expires_at;if(l==null||A_(){p();y$();MUe();A$();t9();lLt();dLt();hLt()});function gCr(t,e){for(let s=e??0;s{p();Em();KB();Mx=class{constructor(){aA.set(this,void 0),cA.set(this,void 0),Wt(this,aA,new Uint8Array,"f"),Wt(this,cA,null,"f")}decode(e){if(e==null)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?PR(e):e;Wt(this,aA,ZMt([xe(this,aA,"f"),n]),"f");let r=[],s;for(;(s=gCr(xe(this,aA,"f"),xe(this,cA,"f")))!=null;){if(s.carriage&&xe(this,cA,"f")==null){Wt(this,cA,s.index,"f");continue}if(xe(this,cA,"f")!=null&&(s.index!==xe(this,cA,"f")+1||s.carriage)){r.push(YB(xe(this,aA,"f").subarray(0,xe(this,cA,"f")-1))),Wt(this,aA,xe(this,aA,"f").subarray(xe(this,cA,"f")),"f"),Wt(this,cA,null,"f");continue}let i=xe(this,cA,"f")!==null?s.preceding-1:s.preceding,o=YB(xe(this,aA,"f").subarray(0,i));r.push(o),Wt(this,aA,xe(this,aA,"f").subarray(s.index),"f"),Wt(this,cA,null,"f")}return r}flush(){return xe(this,aA,"f").length?this.decode(` -`):[]}};aA=new WeakMap,cA=new WeakMap;Mx.NEWLINE_CHARS=new Set([` -`,"\r"]);Mx.NEWLINE_REGEXP=/\r\n|[\n\r]/g});async function*ALt(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new gn("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new gn("Attempted to iterate over a response with no body");let n=new UUe,r=new Mx,s=e9(t.body);for await(let i of ACr(s))for(let o of r.decode(i)){let a=n.decode(o);a&&(yield a)}for(let i of r.flush()){let o=n.decode(i);o&&(yield o)}}async function*ACr(t){let e=new Uint8Array;for await(let n of t){if(n==null)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?PR(n):n,s=new Uint8Array(e.length+r.length);s.set(e),s.set(r,e.length),e=s;let i;for(;(i=gLt(e))!==-1;)yield e.slice(0,i),e=e.slice(i)}e.length>0&&(yield e)}function yCr(t,e){let n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}var s9,lA,UUe,i9=V(()=>{p();Em();Ra();f$();QUe();f$();DR();bm();KB();y_();Ra();vde();lA=class t{constructor(e,n,r){this.iterator=e,s9.set(this,void 0),this.controller=n,Wt(this,s9,r,"f")}static rawEvents(e,n=new AbortController){return ALt(e,n)}static fromSSEResponse(e,n,r){let s=!1,i=r?Ji(r):console;async function*o(){if(s)throw new gn("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let a=!1;try{for await(let c of ALt(e,n)){if(c.event==="completion")try{yield JSON.parse(c.data)}catch(u){throw i.error("Could not parse message into JSON:",c.data),i.error("From chunk:",c.raw),u}if(c.event==="message_start"||c.event==="message_delta"||c.event==="message_stop"||c.event==="content_block_start"||c.event==="content_block_delta"||c.event==="content_block_stop"||c.event==="message"||c.event==="user.message"||c.event==="user.interrupt"||c.event==="user.tool_confirmation"||c.event==="user.custom_tool_result"||c.event==="user.tool_result"||c.event==="agent.message"||c.event==="agent.thinking"||c.event==="agent.tool_use"||c.event==="agent.tool_result"||c.event==="agent.mcp_tool_use"||c.event==="agent.mcp_tool_result"||c.event==="agent.custom_tool_use"||c.event==="agent.thread_context_compacted"||c.event==="session.status_running"||c.event==="session.status_idle"||c.event==="session.status_rescheduled"||c.event==="session.status_terminated"||c.event==="session.error"||c.event==="session.deleted"||c.event==="session.updated"||c.event==="span.model_request_start"||c.event==="span.model_request_end"||c.event==="span.outcome_evaluation_start"||c.event==="span.outcome_evaluation_ongoing"||c.event==="span.outcome_evaluation_end"||c.event==="user.define_outcome"||c.event==="agent.thread_message_received"||c.event==="agent.thread_message_sent"||c.event==="agent.session_thread_message_received"||c.event==="agent.session_thread_message_sent"||c.event==="session.thread_created"||c.event==="session.thread_status_created"||c.event==="session.thread_status_running"||c.event==="session.thread_status_idle"||c.event==="session.thread_status_rescheduled"||c.event==="session.thread_status_terminated"||c.event==="event_start"||c.event==="event_delta"||c.event==="system.message")try{yield JSON.parse(c.data)}catch(u){throw i.error("Could not parse message into JSON:",c.data),i.error("From chunk:",c.raw),u}if(c.event!=="ping"&&c.event==="error"){let u=J8(c.data)??c.data,l=u?.error?.type;throw new Xc(void 0,u,void 0,e.headers,l)}}a=!0}catch(c){if(uE(c))return;throw c}finally{a||n.abort(),oC(n)}}return new t(o,n,r)}static fromReadableStream(e,n,r){let s=!1;async function*i(){let a=new Mx,c=e9(e);for await(let u of c)for(let l of a.decode(u))yield l;for(let u of a.flush())yield u}async function*o(){if(s)throw new gn("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let a=!1;try{for await(let c of i())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(uE(c))return;throw c}finally{a||n.abort(),oC(n)}}return new t(o,n,r)}[(s9=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],n=[],r=this.iterator(),s=i=>({next:()=>{if(i.length===0){let o=r.next();e.push(o),n.push(o)}return i.shift()}});return[new t(()=>s(e),this.controller,xe(this,s9,"f")),new t(()=>s(n),this.controller,xe(this,s9,"f"))]}toReadableStream(){let e=this,n;return yUe({async start(){n=e[Symbol.asyncIterator]()},async pull(r){try{let{value:s,done:i}=await n.next();if(i)return r.close();let o=PR(JSON.stringify(s)+` -`);r.enqueue(o)}catch(s){r.error(s)}},async cancel(){await n.return?.()}})}};UUe=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let i={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],i}if(this.chunks.push(e),e.startsWith(":"))return null;let[n,r,s]=yCr(e,":");return s.startsWith(" ")&&(s=s.substring(1)),n==="event"?this.event=s:n==="data"&&this.data.push(s),null}}});async function Gde(t,e){let{response:n,requestLogID:r,retryOfRequestLogID:s,startTime:i}=e,o=await(async()=>{if(e.options.stream)return Ji(t).debug("response",n.status,n.url,n.headers,n.body),lA.fromSSEResponse(n,e.controller,t);if(n.status===204)return null;if(e.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let h=await n.json();return o9(h,n)}return await n.text()})().finally(()=>{!e.options.stream&&!e.options.__binaryResponse&&oC(e.controller)});return Ji(t).debug(`[${r}] response parsed`,lC({retryOfRequestLogID:s,url:n.url,status:n.status,body:o,durationMs:Date.now()-i})),o}function o9(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperties(t,{_request_id:{value:e.headers.get("request-id"),enumerable:!1},_workspace_id:{value:e.headers.get("anthropic-workspace-id"),enumerable:!1}})}var Wde=V(()=>{p();i9();y_();vde()});function $Ue(t){return typeof t=="object"&&t!==null&&ELt.has(t)}function bLt(t){let e=new Set;for(;typeof t=="object"&&t!==null&&!e.has(t);){if(e.add(t),$Ue(t)||uE(t)||t instanceof iC||t instanceof K8)return!0;t=t.cause}return!1}function GUe(t,e,n,r){return async(s,i={})=>{if(e.length===0)return t.call(void 0,s,i);let o=i.headers instanceof Headers?i.headers:new Headers(i.headers),a=await bCr(t,e,n,r)({...i,headers:o,url:typeof s=="string"?s:s instanceof URL?s.href:s.url});if(a.bodyUsed||a.body?.locked)throw new gn("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return a}}function ECr(t,e){let n=new WeakMap;return{options:t,logger:e?Ji(e):rLt(),parse(r){if(t?.stream&&r.ok)return yLt(r,t,e);let s=n.get(r);return s||(s=yLt(r,t,e),n.set(r,s)),s}}}async function yLt(t,e,n){if(t.bodyUsed||t.body?.locked)throw new gn("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(e?.stream&&t.ok)return lA.fromSSEResponse(t.clone(),new AbortController,n);if(t.status===204)return null;if(e?.__binaryResponse)return t;let s=t.headers.get("content-type")?.split(";")[0]?.trim();return s?.includes("application/json")||s?.endsWith("+json")?t.headers.get("content-length")==="0"?void 0:o9(await t.clone().json(),t):await t.clone().text()}function bCr(t,e,n,r){let s=async({url:o,...a})=>{try{return await t.call(void 0,o,a)}catch(c){let u=VB(c);throw ELt.add(u),u}},i=ECr(n,r);for(let o=e.length-1;o>=0;o--){let a=e[o],c=s;s=async u=>a(u,c,i)}return s}var ELt,_Lt=V(()=>{p();DR();Wde();y_();Ra();i9();ELt=new WeakSet});var a9,zB,qde=V(()=>{p();Em();Wde();zB=class t extends Promise{constructor(e,n,r=Gde){super(s=>{s(null)}),this.responsePromise=n,this.parseResponse=r,a9.set(this,void 0),Wt(this,a9,e,"f")}_thenUnwrap(e){return new t(xe(this,a9,"f"),this.responsePromise,async(n,r)=>o9(e(await this.parseResponse(n,r),r),r.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(xe(this,a9,"f"),e))),this.parsedPromise}then(e,n){return this.parse().then(e,n)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};a9=new WeakMap});var Hde,c9,l9,Bu,cr,Vde,$s=V(()=>{p();Em();Ra();Wde();qde();bm();c9=class{constructor(e,n,r,s){Hde.set(this,void 0),Wt(this,Hde,e,"f"),this.options=s,this.response=n,this.body=r}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new gn("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await xe(this,Hde,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(Hde=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let n of e.getPaginatedItems())yield n}},l9=class extends zB{constructor(e,n,r){super(e,n,async(s,i)=>new r(s,i.response,await Gde(s,i),i.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let n of e)yield n}},Bu=class extends c9{constructor(e,n,r,s){super(e,n,r,s),this.data=r.data||[],this.has_more=r.has_more||!1,this.first_id=r.first_id||null,this.last_id=r.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let n=this.first_id;return n?{...this.options,query:{...z8(this.options.query),before_id:n}}:null}let e=this.last_id;return e?{...this.options,query:{...z8(this.options.query),after_id:e}}:null}},cr=class extends c9{constructor(e,n,r,s){super(e,n,r,s),this.data=r.data||[],this.next_page=r.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...z8(this.options.query),page:e}}:null}},Vde=class extends c9{constructor(e,n,r,s){super(e,n,r,s),this.data=r.data||[],this.next_page=r.next_page||null,this.prev_page=r.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...z8(this.options.query),page:e}}:null}}});function JB(t,e,n){return qUe(),new File(t,e??"unknown_file",n)}function u9(t,e){let n=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?n.split(/[\\/]/).pop()||void 0:n}function SCr(t){let e=typeof t=="function"?t:t.fetch,n=SLt.get(e);if(n)return n;let r=(async()=>{try{let s="Response"in e?e.Response:(await e("data:,")).constructor,i=new FormData;return i.toString()!==await new s(i).text()}catch{return!0}})();return SLt.set(e,r),r}var qUe,HUe,pE,SLt,CCr,WUe,Lx=V(()=>{p();f$();qUe=()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};HUe=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function",pE=async(t,e,n=!0)=>({...t,body:await CCr(t.body,e,n)}),SLt=new WeakMap;CCr=async(t,e,n=!0)=>{if(!await SCr(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let r=new FormData;return await Promise.all(Object.entries(t||{}).map(([s,i])=>WUe(r,s,i,n))),r},WUe=async(t,e,n,r)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")t.append(e,String(n));else if(n instanceof Response){let s={},i=n.headers.get("Content-Type");i&&(s={type:i}),t.append(e,JB([await n.blob()],u9(n,r),s))}else if(HUe(n))t.append(e,JB([await new Response(Rde(n)).blob()],u9(n,r)));else if(n instanceof Blob)t.append(e,JB([n],u9(n,r)||void 0,{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(s=>WUe(t,e+"[]",s,r)));else{if(typeof n.then=="function")throw new TypeError(`Received a Promise for "${e}"; await it first, e.g. \`await toFile(...)\``);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))throw new TypeError(`Received ${n.constructor.name} for "${e}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);if(typeof n=="object")await Promise.all(Object.entries(n).map(([s,i])=>WUe(t,`${e}[${s}]`,i,r)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}}});async function jde(t,e,n){if(qUe(),t=await t,e||(e=u9(t,!0)),ICr(t))return t instanceof File&&e==null&&n==null?t:JB([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...n});if(xCr(t)){let s=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),JB(await VUe(s),e,n)}let r=await VUe(t);if(!n?.type){let s=r.find(i=>typeof i=="object"&&"type"in i&&i.type);typeof s=="string"&&(n={...n,type:s})}return JB(r,e,n)}async function VUe(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(CLt(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(HUe(t))for await(let n of t)e.push(...await VUe(n));else{let n=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${n?`; constructor: ${n}`:""}${wCr(t)}`)}return e}function wCr(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(n=>`"${n}"`).join(", ")}]`}var CLt,ICr,xCr,ILt=V(()=>{p();Lx();Lx();CLt=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",ICr=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&CLt(t),xCr=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function"});var jUe=V(()=>{p();ILt()});var xLt=V(()=>{p()});var En,os=V(()=>{p();En=class{constructor(e){this._client=e}}});function*vCr(t){if(!t)return;if(wLt in t){let{values:r,nulls:s}=t;yield*r.entries();for(let i of s)yield[i,null];return}let e=!1,n;t instanceof Headers?n=t.entries():fUe(t)?n=t:(e=!0,n=Object.entries(t??{}));for(let r of n){let s=r[0];if(typeof s!="string")throw new TypeError("expected header name to be a string");let i=fUe(r[1])?r[1]:[r[1]],o=!1;for(let a of i)a!==void 0&&(e&&!o&&(o=!0,yield[s,Yde]),yield[s,a])}}var wLt,Yde,RCr,TLt,gt,Ys=V(()=>{p();bm();wLt=Symbol.for("brand.privateNullableHeaders");Yde=Symbol("clear"),RCr=new Set(["x-stainless-helper"]),TLt=(t,e)=>{let n=t?t.split(",").map(r=>r.trim()).filter(Boolean):[];for(let r of e.split(",").map(s=>s.trim()))r&&!n.includes(r)&&n.push(r);return n.join(", ")},gt=t=>{let e=new Headers,n=new Set;for(let r of t){let s=new Set;for(let[i,o]of vCr(r)){let a=i.toLowerCase();if(RCr.has(a)){if(o===Yde)continue;o===null?(e.delete(i),n.add(a)):(e.set(i,TLt(e.get(i),o)),n.delete(a));continue}(o===Yde||!s.has(a))&&(e.delete(i),s.add(a),o===Yde)||(o===null?(e.delete(i),n.add(a)):(e.append(i,o),n.delete(a)))}}return{[wLt]:!0,values:e,nulls:n}}});function RLt(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var vLt,kCr,xt,ii=V(()=>{p();Ra();vLt=Object.freeze(Object.create(null)),kCr=(t=RLt)=>function(n,...r){if(n.length===1)return n[0];let s=!1,i=[],o=n.reduce((l,d,h)=>{/[?#]/.test(d)&&(s=!0);let m=r[h],f=(s?encodeURIComponent:t)(""+m);return h!==r.length&&(m==null||typeof m=="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??vLt)??vLt)?.toString)&&(f=m+"",i.push({start:l.length+d.length,length:f.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`})),l+d+(h===r.length?"":f)},""),a=o.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=c.exec(a))!==null;)i.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(i.sort((l,d)=>l.start-d.start),i.length>0){let l=0,d=i.reduce((h,m)=>{let f=" ".repeat(m.start-l),g="^".repeat(m.length);return l=m.start+m.length,h+f+g},"");throw new gn(`Path parameters result in path with invalid segments: -${i.map(h=>h.error).join(` +`+s),t.push(i+"m+"+tAe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=FYr()+e+" "+t[0]}function FYr(){return Gp.inspectOpts.hideDate?"":new Date().toISOString()+" "}function QYr(...t){return process.stderr.write(eAe.formatWithOptions(Gp.inspectOpts,...t)+` +`)}function UYr(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function GYr(){return process.env.DEBUG}function $Yr(t){t.inspectOpts={};let e=Object.keys(Gp.inspectOpts);for(let n=0;ne.trim()).join(" ")};ZVt.O=function(t){return this.inspectOpts.colors=this.useColors,eAe.inspect(t,this.inspectOpts)}});var pB=re((opo,u3e)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?u3e.exports=VVt():u3e.exports=eYt()});function oAe(){return new Rc}var sAe,mB,Rc,eA=v(()=>{p();sAe=class{incoming=[];outgoing=[];get length(){return this.incoming.length+this.outgoing.length}enqueue(e){this.incoming.push(e)}dequeue(){if(this.outgoing.length===0)for(;this.incoming.length>0;)this.outgoing.push(this.incoming.pop());return this.outgoing.pop()}},mB=class{queue=new sAe;waiting=new sAe;done=!1;finalResultPromise;resolveFinalResult;isComplete;extractResult;constructor(e,n){this.isComplete=e,this.extractResult=n,this.finalResultPromise=new Promise(r=>{this.resolveFinalResult=r})}push(e){if(this.done)return;this.isComplete(e)&&(this.done=!0,this.resolveFinalResult(this.extractResult(e)));let n=this.waiting.dequeue();n?n({value:e,done:!1}):this.queue.enqueue(e)}end(e){for(this.done=!0,e!==void 0&&this.resolveFinalResult(e);this.waiting.length>0;)this.waiting.dequeue()({value:void 0,done:!0})}async*[Symbol.asyncIterator](){for(;;)if(this.queue.length>0)yield this.queue.dequeue();else{if(this.done)return;{let e=await new Promise(n=>this.waiting.enqueue(n));if(e.done)return;yield e.value}}}result(){return this.finalResultPromise}},Rc=class extends mB{constructor(){super(e=>e.type==="done"||e.type==="error",e=>{if(e.type==="done")return e.message;if(e.type==="error")return e.error;throw new Error("Unexpected event type for final result")})}}});function HYr(t,e){return{role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"error",errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()}}function qYr(t){return typeof t.result=="function"}async function jYr(t,e){for await(let n of e)t.push(n);t.end(qYr(e)?await e.result():void 0)}function Th(t,e){let n=new Rc;return e().then(r=>jYr(n,r)).catch(r=>{let i=HYr(t,r);n.push({type:"error",reason:"error",error:i}),n.end(i)}),n}function ed(t,e){let n={stream:(r,i,s)=>Th(r,async()=>(await t()).stream(r,i,s)),streamSimple:(r,i,s)=>Th(r,async()=>(await t()).streamSimple(r,i,s))};return e?.fetchDeferred&&(n.fetchDeferred=(r,i,s)=>Th(r,async()=>{let o=await t();if(!o.fetchDeferred)throw new Error("API does not support deferred responses");return o.fetchDeferred(r,i,s)})),e?.cancelDeferred&&(n.cancelDeferred=async(r,i,s)=>{let o=await t();if(!o.cancelDeferred)throw new Error("API cannot cancel deferred responses");await o.cancelDeferred(r,i,s)}),n}var Sy=v(()=>{p();eA()});function YYr(){return globalThis.process?.env}function JK(){return{async env(t){let e=YYr()?.[t];return typeof e=="string"&&e.trim().length>0?e:void 0},async fileExists(t){try{let e=await mYt("node:fs/promises"),n=t;return n.startsWith("~")&&(n=(await mYt("node:os")).homedir()+n.slice(1)),await e.access(n),!0}catch{return!1}}}}var VYr,mYt,aAe=v(()=>{p();VYr=function(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,i,s,o){return r?e?".jsx":".js":i&&(!s||!o)?n:i+s+"."+o.toLowerCase()+"js"}):t},mYt=t=>import(VYr(t))});function hYt(t){if(t.reason!==void 0)return t.reason;let e=new Error("The operation was aborted");return e.name="AbortError",e}function ox(t){return t??new AbortController().signal}function ax(t,e){return e.aborted?(t.catch(()=>{}),Promise.reject(hYt(e))):new Promise((n,r)=>{let i=!1,s=()=>e.removeEventListener("abort",o),o=()=>{i||(i=!0,s(),r(hYt(e)))};e.addEventListener("abort",o,{once:!0}),t.then(a=>{i||(i=!0,s(),n(a))},a=>{i||(i=!0,s(),r(a))}),e.aborted&&o()})}var cAe=v(()=>{p()});var HO,lAe=v(()=>{p();cAe();HO=class{credentials=new Map;chains=new Map;enqueue(e,n,r){let i=ox(r?.signal),s=this.chains.get(e)??Promise.resolve(),o=(async()=>(await s.catch(()=>{}),i.throwIfAborted(),n()))(),a=o.catch(()=>{});return this.chains.set(e,a),a.then(()=>{this.chains.get(e)===a&&this.chains.delete(e)}),ax(o,i)}async read(e,n){return n?.signal?.throwIfAborted(),this.credentials.get(e)}async list(e){return e?.signal?.throwIfAborted(),[...this.credentials].map(([n,r])=>({providerId:n,type:r.type}))}modify(e,n,r){return this.enqueue(e,async()=>{let i=this.credentials.get(e),s=await n(i);return r?.signal?.throwIfAborted(),s!==void 0&&this.credentials.set(e,s),s??i},r)}delete(e,n){return this.enqueue(e,async()=>{this.credentials.delete(e)},n)}}});function hB(t){return t instanceof Error?t.message||t.name:typeof t=="string"?t:String(t)}function fYt(t){if(!(t instanceof Error))return{name:"ThrownValue",message:hB(t)};let e=t.code;return{name:t.name||void 0,message:t.message||t.name,stack:t.stack,code:typeof e=="string"||typeof e=="number"?e:void 0}}function XK(t,e,n){return{type:t,timestamp:Date.now(),error:fYt(e),details:n}}function JC(t,e){t.diagnostics=[...t.diagnostics??[],e]}var qO=v(()=>{p()});function zYr(t,e){if(e==null)return t;let n=hB(e).trim();return!n||t.includes(n)?t:`${t}: ${n}`}function ZK(t,e,n,r){let i=ox(r?.signal);return ax(KYr(t,e,n,r,i),i)}async function KYr(t,e,n,r,i){i.throwIfAborted();let s=r?.env?JYr(n,r.env):n;if(r?.apiKey!==void 0&&t.auth.apiKey)return h3e(s,t.auth.apiKey,t.id,{type:"api_key",key:r.apiKey,env:r.env},i);let o=await t9r(e,t.id,i);if(o){if(o.type==="oauth"&&t.auth.oauth)return e9r(e,t.id,t.auth.oauth,o,i,r?.minOAuthValidityMs);if(o.type==="api_key"&&t.auth.apiKey){let a=r?.env?{...o,env:{...o.env,...r.env}}:o;return h3e(s,t.auth.apiKey,t.id,a,i)}return}return t.auth.apiKey?h3e(s,t.auth.apiKey,t.id,void 0,i):void 0}function JYr(t,e){return{env:async n=>e[n]||await t.env(n),fileExists:n=>t.fileExists(n)}}async function e9r(t,e,n,r,i,s){let o=Math.max(XYr,s??0),a=u=>Date.now()+o>=u.expires,c=r;if(a(c)){let u;try{u=await t.modify(e,async l=>{if(l?.type==="oauth"&&a(l))try{let d=AbortSignal.any([i,AbortSignal.timeout(ZYr)]);return await n.refresh(l,d)}catch(d){throw new ko("oauth",`OAuth refresh failed for ${e}`,{cause:d})}},{signal:i})}catch(l){throw l instanceof ko?l:new ko("auth",`Credential store modify failed for ${e}`,{cause:l})}if(u?.type!=="oauth")return;if(c=u,s!==void 0&&a(c))throw new ko("oauth",`OAuth refresh returned a token that expires too soon for ${e}`)}try{return{auth:await n.toAuth(c),source:"OAuth"}}catch(u){throw new ko("oauth",`OAuth auth derivation failed for ${e}`,{cause:u})}}async function h3e(t,e,n,r,i){try{return await e.resolve({ctx:t,credential:r,signal:i})}catch(s){throw new ko("auth",`API key auth failed for provider ${n}`,{cause:s})}}async function t9r(t,e,n){try{return await t.read(e,{signal:n})}catch(r){throw new ko("auth",`Credential store read failed for ${e}`,{cause:r})}}var ko,XYr,ZYr,uAe=v(()=>{p();cAe();qO();ko=class extends Error{code;constructor(e,n,r){super(zYr(n,r?.cause),r),this.name="ModelsError",this.code=e}};XYr=300*1e3,ZYr=15e3});var eJ,f3e=v(()=>{p();eJ=class{entries=new Map;async read(e,n){n?.signal?.throwIfAborted();let r=this.entries.get(e);return r?structuredClone(r):void 0}async write(e,n,r){r?.signal?.throwIfAborted(),this.entries.set(e,structuredClone(n))}async delete(e,n){n?.signal?.throwIfAborted(),this.entries.delete(e)}}});function aa(t,e=` +`){return typeof t=="string"?t:t.filter(n=>n.type==="text").map(n=>n.text).join(e)}function kc(t){let e=[aa(t.content)];for(let n of Object.values(t.sections??{}))n!==null&&e.push(n);return e.filter(n=>n.length>0).join(` + +`)}function XC(t){let e=[],n=aa(t.content);n.length>0&&e.push(n);for(let[r,i]of Object.entries(t.sections??{}))e.push(i===null?`Removed system prompt section "${r}".`:`Updated system prompt section "${r}": + +${i}`);return e.join(` + +`)}var Cy=v(()=>{p()});function pAe(t,e){let n=t!==void 0&&t.length>0,r=e!==void 0&&e.length>0;if(!(!n&&!r))return{role:"system",content:t??"",...r?{toolsAdded:e}:{},timestamp:0}}function Id(t){let e=pAe(t.systemPrompt,t.tools);return{messages:e?[e,...t.messages]:t.messages}}function SH(t){return t.role==="system"}function Iy(t){let e=t[0];return e&&SH(e)?e:void 0}function tJ(t){return Iy(t)?t.slice(1):t}function Nm(t){let e=new Map;for(let n of t)if(SH(n)){for(let r of n.toolsRemoved??[])e.delete(r.name);for(let r of n.toolsAdded??[])e.set(r.name,r)}return[...e.values()]}function kf(t){let e=[],n=new Map,r;for(let s of t){if(!SH(s))continue;r??=s.timestamp;let o=aa(s.content);o.length>0&&e.push(o);for(let[a,c]of Object.entries(s.sections??{}))c===null?n.delete(a):n.set(a,c)}let i=Nm(t);if(!(r===void 0&&i.length===0))return{role:"system",content:e.join(` + +`),...n.size>0?{sections:Object.fromEntries(n)}:{},...i.length>0?{toolsAdded:i}:{},timestamp:r??0}}function g3e(t){let e=kf(t);return e?kc(e):""}function ZC(t){let e=kf(t.messages),n=t.messages.filter(r=>r.role!=="system");return{messages:e?[e,...n]:n}}function vh(t,e){return e?t:ZC(t)}function fB(t){return{name:t.name,description:t.description,parameters:JSON.parse(JSON.stringify(t.parameters)),...t.constrainedSampling===void 0?{}:{constrainedSampling:t.constrainedSampling}}}function dAe(t,e){return JSON.stringify(fB(t))===JSON.stringify(fB(e))}function A3e(t,e){let n=new Map(t.map(i=>[i.name,i])),r=new Map(e.map(i=>[i.name,i]));return{toolsAdded:e.filter(i=>{let s=n.get(i.name);return s===void 0||!dAe(s,i)}).map(fB),toolsRemoved:t.filter(i=>{let s=r.get(i.name);return s===void 0||!dAe(i,s)}).map(i=>({name:i.name}))}}function Bf(t){let e=new Map;for(let n of t)if(SH(n))for(let r of n.toolsAdded??[])e.set(r.name,r);return[...e.values()]}function y3e(t){let e=new Map;for(let n of t)if(SH(n))for(let r of n.toolsAdded??[]){let i=e.get(r.name);if(i!==void 0&&!dAe(i,r))return!0;e.set(r.name,r)}return!1}function gYt(t){let e=new Set;for(let n of t)if(SH(n)){if((n.toolsRemoved?.length??0)>0)return!0;for(let r of n.toolsAdded??[]){if(e.has(r.name))return!0;e.add(r.name)}}return!1}function w0(t,e){let n=e&&!gYt(t);return{requestTools:n?Iy(t)?.toolsAdded??[]:Nm(t),anchorsAdditions:n}}var Nf=v(()=>{p();Cy()});function AYt(t,e){if(!t&&!e)return;let n={...t};for(let[r,i]of Object.entries(e??{})){let s=r.toLowerCase();for(let o of Object.keys(n))o.toLowerCase()===s&&delete n[o];n[r]=i}return n}function rJ(t){return new E3e(t)}function Mn(t){let e=t.models,n=[],r=t.fetchModels,i=()=>{let d=[...e];for(let m of n){let h=d.findIndex(f=>f.id===m.id);h>=0?d[h]=m:d.push(m)}return d},s=typeof t.api.stream=="function"?t.api:void 0,o=s?void 0:t.api,a=d=>s??o?.[d.api],c=(d,m)=>{let h=a(d);return h?m(h):Th(d,async()=>{throw new ko("stream",`Provider ${t.id} has no API implementation for "${d.api}"`)})},u={id:t.id,name:t.name??t.id,baseUrl:t.baseUrl,headers:t.headers,auth:t.auth,getModels:i,refreshModels:r?async d=>{if(d.stored){let h=d.stored.models.filter(f=>f.provider===t.id).map(f=>f);if(!await d.publish({update:()=>{n=h}}))return}if(!d.allowNetwork||d.signal.aborted)return;let m=await r(d);d.signal.aborted||await d.publish({persist:{models:m,checkedAt:Date.now()},update:()=>{n=m}})}:void 0,filterModels:t.filterModels,stream:(d,m,h)=>c(d,f=>f.stream(d,m,h)),streamSimple:(d,m,h)=>c(d,f=>f.streamSimple(d,m,h))},l=s?[s]:Object.values(o??{}).filter(d=>d!==void 0);return l.some(d=>d.fetchDeferred!==void 0)&&(u.fetchDeferred=(d,m,h)=>Th(d,async()=>{let f=a(d);if(!f?.fetchDeferred)throw new ko("provider",`Provider ${t.id} does not support deferred responses for "${d.api}"`);return f.fetchDeferred(d,m,h)})),l.some(d=>d.cancelDeferred!==void 0)&&(u.cancelDeferred=async(d,m,h)=>{let f=a(d);if(!f?.cancelDeferred)throw new ko("provider",`Provider ${t.id} cannot cancel deferred responses for "${d.api}"`);await f.cancelDeferred(d,m,h)}),u}function n9r(t,e){return t.api===e}function $p(t,e){let n=e.input+e.cacheRead+e.cacheWrite,r=t.cost,i=-1;for(let a of t.cost.tiers??[])n>a.inputTokensAbove&&a.inputTokensAbove>i&&(r=a,i=a.inputTokensAbove);let s=e.cacheWrite1h??0,o=e.cacheWrite-s;return e.cost.input=r.input/1e6*e.input,e.cost.output=r.output/1e6*e.output,e.cost.cacheRead=r.cacheRead/1e6*e.cacheRead,e.cost.cacheWrite=(r.cacheWrite*o+r.input*2*s)/1e6,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite,e.cost}function gB(t){return t.reasoning?nJ.filter(e=>{let n=t.thinkingLevelMap?.[e];return n===null?!1:e==="xhigh"||e==="max"?n!==void 0:!0}):["off"]}function Wl(t,e){let n=gB(t);if(n.includes(e))return e;let r=nJ.indexOf(e);if(r===-1)return n[0]??"off";for(let i=r;i=0;i--){let s=nJ[i];if(n.includes(s))return s}return n[0]??"off"}function Zd(t,e){return!t||!e?!1:t.id===e.id&&t.provider===e.provider}var E3e,nJ,ni=v(()=>{p();Sy();aAe();lAe();uAe();f3e();cAe();Nf();uAe();E3e=class{providers=new Map;credentials;modelsStore;authContext;refreshGenerations=new Map;refreshControllers=new Map;publicationChains=new Map;constructor(e){this.credentials=e?.credentials??new HO,this.modelsStore=e?.modelsStore??new eJ,this.authContext=e?.authContext??JK()}setProvider(e){this.supersedeProviderRefresh(e.id),this.providers.set(e.id,e)}deleteProvider(e){this.supersedeProviderRefresh(e),this.providers.delete(e)}clearProviders(){for(let e of new Set([...this.providers.keys(),...this.refreshControllers.keys()]))this.supersedeProviderRefresh(e);this.providers.clear()}getProviders(){return Array.from(this.providers.values())}getProvider(e){return this.providers.get(e)}getModels(e){if(e!==void 0){let r=this.providers.get(e);if(!r)return[];try{return r.getModels()}catch{return[]}}let n=[];for(let r of this.providers.values())try{n.push(...r.getModels())}catch{}return n}getModel(e,n){return this.getModels(e).find(r=>r.id===n)}supersedeProviderRefresh(e){let n=(this.refreshGenerations.get(e)??0)+1;this.refreshGenerations.set(e,n);let r=this.refreshControllers.get(e);return r&&(this.refreshControllers.delete(e),r.abort()),n}beginProviderRefresh(e){let n=this.supersedeProviderRefresh(e),r=new AbortController;return this.refreshControllers.set(e,r),{generation:n,controller:r}}publishProviderModels(e,n,r,i){let s=this.publicationChains.get(e)??Promise.resolve(),o=(async()=>(await s.catch(()=>{}),r.aborted||this.refreshGenerations.get(e)!==n||(i.persist===null?await this.modelsStore.delete(e,{signal:r}):i.persist!==void 0&&await this.modelsStore.write(e,structuredClone(i.persist),{signal:r}),r.aborted||this.refreshGenerations.get(e)!==n)?!1:(i.update?.(),!0)))(),a=o.catch(()=>{});return this.publicationChains.set(e,a),a.then(()=>{this.publicationChains.get(e)===a&&this.publicationChains.delete(e)}),ax(o,r)}async runProviderRefreshPhase(e,n,r,i,s,o){let a=await this.modelsStore.read(e.id,{signal:o});await e.refreshModels({credential:n,stored:a?structuredClone(a):void 0,publish:c=>this.publishProviderModels(e.id,s,o,c),allowNetwork:r,force:r?i:void 0,signal:o})}async refresh(e={}){let n=e.allowNetwork??!0,r=ox(e.signal),i=new Map;if(r.aborted)return{aborted:!0,errors:i};let s=e.providers?new Set(e.providers):void 0,o=Array.from(this.providers.values()).filter(c=>c.refreshModels!==void 0&&(!s||s.has(c.id))),a=Promise.all(o.map(async c=>{let{generation:u,controller:l}=this.beginProviderRefresh(c.id),d=AbortSignal.any([r,l.signal]),m=(async()=>{let h,f;try{h=await this.readCredential(c.id,d)}catch(A){f=A}if(await this.runProviderRefreshPhase(c,h,!1,void 0,u,d),f!==void 0)throw f;if(!n||d.aborted)return;let g=await this.resolveRefreshCredential(c,h,d);g&&await this.runProviderRefreshPhase(c,g,!0,e.force,u,d)})();try{await ax(m,d)}catch(h){d.aborted||i.set(c.id,h instanceof Error?h:new ko("model_source",`Model refresh failed for ${c.id}`,{cause:h}))}finally{this.refreshControllers.get(c.id)===l&&this.refreshControllers.delete(c.id)}}));try{await ax(a,r)}catch(c){if(!r.aborted)throw c}return{aborted:r.aborted,errors:new Map(i)}}async resolveRefreshCredential(e,n,r){if(n?.type==="oauth"){let a=e.auth.oauth;if(!a)return;if(Date.now(){if(!(u?.type!=="oauth"||Date.now(){r.throwIfAborted();let s=this.providers.get(e);if(s)return this.checkProviderAuth(s,await this.readCredential(e,r),r)})();return ax(i,r)}getAvailable(e,n){let r=ox(n?.signal),i=(async()=>{r.throwIfAborted();let s=e?[this.providers.get(e)].filter(a=>a!==void 0):this.getProviders();return(await Promise.all(s.map(async a=>{let c=await this.readCredential(a.id,r);return{provider:a,credential:c,auth:await this.checkProviderAuth(a,c,r)}}))).flatMap(({provider:a,credential:c,auth:u})=>{if(!u)return[];let l=a.getModels();return a.filterModels?.(l,c)??l})})();return ax(i,r)}async getAuth(e,n){let r=ox(n?.signal),i=typeof e=="string"?e:e.provider,s=this.providers.get(i);if(!s)return;let o=await ZK(s,this.credentials,this.authContext,{...n,signal:r});return!o||typeof e=="string"||!e.headers?o:{...o,auth:{...o.auth,headers:AYt(o.auth.headers,e.headers)}}}async login(e,n,r){let i=ox(r.signal);i.throwIfAborted();let s=this.providers.get(e);if(!s)throw new ko("provider",`Unknown provider: ${e}`);let o=n==="oauth"?s.auth.oauth:s.auth.apiKey;if(!o?.login)throw new ko("auth",`${s.name} does not support ${n} login`);let a=o.login({...r,signal:i}),c=await ax(a,i),u=!1,l,d=new Promise(h=>{l=h}),m=this.credentials.modify(e,async()=>(u=!0,l?.(),c),{signal:i});m.catch(()=>{});try{await new Promise((h,f)=>{let g=()=>{u||f(i.reason)};i.addEventListener("abort",g,{once:!0}),Promise.race([d,m]).then(()=>{i.removeEventListener("abort",g),h()},A=>{i.removeEventListener("abort",g),f(A)}),i.aborted&&g()}),await m}catch(h){throw i.throwIfAborted(),new ko("auth",`Credential store modify failed for ${e}`,{cause:h})}return c}async logout(e,n){let r=ox(n?.signal);r.throwIfAborted();try{await this.credentials.delete(e,{signal:r})}catch(i){throw r.throwIfAborted(),new ko("auth",`Credential store delete failed for ${e}`,{cause:i})}}requireProvider(e){let n=this.providers.get(e.provider);if(!n)throw new ko("provider",`Unknown provider: ${e.provider}`);return n}async applyAuth(e,n){this.requireProvider(e);let r=await this.getAuth(e,{apiKey:n?.apiKey,env:n?.env,signal:n?.signal});if(!r)throw new ko("auth",`Provider is not configured: ${e.provider}`);let i=r.auth,s=n?.apiKey??i.apiKey,o=AYt(i.headers,n?.headers);n?.transformHeaders&&(o=await n.transformHeaders(o??{}));let a=r.env||n?.env?{...r.env??{},...n?.env??{}}:void 0,c=i.baseUrl?{...e,baseUrl:i.baseUrl}:e,{transformHeaders:u,...l}=n??{},d={...l,apiKey:s,headers:o,env:a};return{requestModel:c,requestOptions:d}}stream(e,n,r){let i=Id(n);return Th(e,async()=>{let s=this.requireProvider(e),{requestModel:o,requestOptions:a}=await this.applyAuth(e,r);return s.stream(o,i,a)})}async complete(e,n,r){return this.stream(e,n,r).result()}streamSimple(e,n,r){let i=Id(n);return Th(e,async()=>{let s=this.requireProvider(e),{requestModel:o,requestOptions:a}=await this.applyAuth(e,r);return s.streamSimple(o,i,a)})}async completeSimple(e,n,r){return this.streamSimple(e,n,r).result()}streamDeferred(e,n,r){return Th(e,async()=>{let i=this.requireProvider(e);if(!i.fetchDeferred)throw new ko("provider",`Provider ${e.provider} does not support deferred responses`);let{requestModel:s,requestOptions:o}=await this.applyAuth(e,r);return i.fetchDeferred(s,n,o)})}async fetchDeferred(e,n,r){return this.streamDeferred(e,n,r).result()}async cancelDeferred(e,n,r){let i=this.requireProvider(e);if(!i.cancelDeferred)throw new ko("provider",`Provider ${e.provider} does not support deferred responses`);let{requestModel:s,requestOptions:o}=await this.applyAuth(e,r);await i.cancelDeferred(s,n,o)}};nJ=["off","minimal","low","medium","high","xhigh","max"]});function Rh(t){if(!(t instanceof Error))return{message:b3e(t),messageCarriesBody:!1};let e=t,n=r9r(e),r=i9r(e),i=r===void 0||t.message.includes(r);return{status:n,body:r,message:t.message,messageCarriesBody:i}}function r9r(t){if(typeof t.statusCode=="number")return t.statusCode;if(typeof t.status=="number")return t.status;if(typeof t.$metadata?.httpStatusCode=="number")return t.$metadata.httpStatusCode;if(typeof t.$response?.statusCode=="number")return t.$response.statusCode}function i9r(t){let e=s9r(t);if(e===void 0)return;let n=e.trim();if(n.length!==0)return a9r(n,4e3)}function s9r(t){if(typeof t.body=="string")return t.body;if(yYt(t.error))return b3e(t.error);let e=t.$response?.body;if(typeof e=="string")return e;if(!o9r(e)&&yYt(e))return b3e(e)}function o9r(t){return typeof t=="object"&&t!==null&&"pipe"in t&&typeof t.pipe=="function"}function yYt(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return e!==Object.prototype&&e!==null?!1:Object.keys(t).length>0}function tA(t,e){return t.messageCarriesBody||t.status===void 0||t.body===void 0?e!==void 0&&t.status!==void 0?`${e} (${t.status}): ${t.message}`:t.message:e!==void 0?`${e} (${t.status}): ${t.body}`:`${t.status}: ${t.body}`}function a9r(t,e){return t.length<=e?t:`${t.slice(0,e)}... [truncated ${t.length-e} chars]`}function b3e(t){try{let e=JSON.stringify(t);return e===void 0?String(t):e}catch{return String(t)}}var ev=v(()=>{p()});function Dm(t){let e={};for(let[n,r]of t.entries())e[n]=r;return e}function eI(t){if(!t)return;let e={};for(let[n,r]of Object.entries(t))r!==null&&(e[n]=r);return Object.keys(e).length>0?e:void 0}var T0=v(()=>{p()});var _3e=re(Rr=>{"use strict";p();Object.defineProperty(Rr,"__esModule",{value:!0});Rr.Allow=Rr.ALL=Rr.COLLECTION=Rr.ATOM=Rr.SPECIAL=Rr.INF=Rr._INFINITY=Rr.INFINITY=Rr.NAN=Rr.BOOL=Rr.NULL=Rr.OBJ=Rr.ARR=Rr.NUM=Rr.STR=void 0;Rr.STR=1;Rr.NUM=2;Rr.ARR=4;Rr.OBJ=8;Rr.NULL=16;Rr.BOOL=32;Rr.NAN=64;Rr.INFINITY=128;Rr._INFINITY=256;Rr.INF=Rr.INFINITY|Rr._INFINITY;Rr.SPECIAL=Rr.NULL|Rr.BOOL|Rr.INF|Rr.NAN;Rr.ATOM=Rr.STR|Rr.NUM|Rr.SPECIAL;Rr.COLLECTION=Rr.ARR|Rr.OBJ;Rr.ALL=Rr.ATOM|Rr.COLLECTION;Rr.Allow={STR:Rr.STR,NUM:Rr.NUM,ARR:Rr.ARR,OBJ:Rr.OBJ,NULL:Rr.NULL,BOOL:Rr.BOOL,NAN:Rr.NAN,INFINITY:Rr.INFINITY,_INFINITY:Rr._INFINITY,INF:Rr.INF,SPECIAL:Rr.SPECIAL,ATOM:Rr.ATOM,COLLECTION:Rr.COLLECTION,ALL:Rr.ALL};Rr.default=Rr.Allow});var bYt=re(Pm=>{"use strict";p();var c9r=Pm&&Pm.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),l9r=Pm&&Pm.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&c9r(e,t,n)};Object.defineProperty(Pm,"__esModule",{value:!0});Pm.Allow=Pm.MalformedJSON=Pm.PartialJSON=Pm.parseJSON=Pm.parse=void 0;var Df=_3e();Object.defineProperty(Pm,"Allow",{enumerable:!0,get:function(){return Df.Allow}});l9r(_3e(),Pm);var mAe=class extends Error{};Pm.PartialJSON=mAe;var hAe=class extends Error{};Pm.MalformedJSON=hAe;function EYt(t,e=Df.Allow.ALL){if(typeof t!="string")throw new TypeError(`expecting str, got ${typeof t}`);if(!t.trim())throw new Error(`${t} is empty`);return u9r(t.trim(),e)}Pm.parseJSON=EYt;var u9r=(t,e)=>{let n=t.length,r=0,i=m=>{throw new mAe(`${m} at position ${r}`)},s=m=>{throw new hAe(`${m} at position ${r}`)},o=()=>(d(),r>=n&&i("Unexpected end of input"),t[r]==='"'?a():t[r]==="{"?c():t[r]==="["?u():t.substring(r,r+4)==="null"||Df.Allow.NULL&e&&n-r<4&&"null".startsWith(t.substring(r))?(r+=4,null):t.substring(r,r+4)==="true"||Df.Allow.BOOL&e&&n-r<4&&"true".startsWith(t.substring(r))?(r+=4,!0):t.substring(r,r+5)==="false"||Df.Allow.BOOL&e&&n-r<5&&"false".startsWith(t.substring(r))?(r+=5,!1):t.substring(r,r+8)==="Infinity"||Df.Allow.INFINITY&e&&n-r<8&&"Infinity".startsWith(t.substring(r))?(r+=8,1/0):t.substring(r,r+9)==="-Infinity"||Df.Allow._INFINITY&e&&1{let m=r,h=!1;for(r++;r{r++,d();let m={};try{for(;t[r]!=="}";){if(d(),r>=n&&Df.Allow.OBJ&e)return m;let h=a();d(),r++;try{let f=o();m[h]=f}catch(f){if(Df.Allow.OBJ&e)return m;throw f}d(),t[r]===","&&r++}}catch{if(Df.Allow.OBJ&e)return m;i("Expected '}' at end of object")}return r++,m},u=()=>{r++;let m=[];try{for(;t[r]!=="]";)m.push(o()),d(),t[r]===","&&r++}catch{if(Df.Allow.ARR&e)return m;i("Expected ']' at end of array")}return r++,m},l=()=>{if(r===0){t==="-"&&s("Not sure what '-' is");try{return JSON.parse(t)}catch(h){if(Df.Allow.NUM&e)try{return JSON.parse(t.substring(0,t.lastIndexOf("e")))}catch{}s(String(h))}}let m=r;for(t[r]==="-"&&r++;t[r]&&",]}".indexOf(t[r])===-1;)r++;r==n&&!(Df.Allow.NUM&e)&&i("Unterminated number literal");try{return JSON.parse(t.substring(m,r))}catch{t.substring(m,r)==="-"&&i("Not sure what '-' is");try{return JSON.parse(t.substring(m,t.lastIndexOf("e")))}catch(f){s(String(f))}}},d=()=>{for(;r=0&&e<=31}function h9r(t){switch(t){case"\b":return"\\b";case"\f":return"\\f";case` +`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return`\\u${t.codePointAt(0)?.toString(16).padStart(4,"0")??"0000"}`}}function S3e(t){let e="",n=!1;for(let r=0;r{p();x3e=Ot(bYt(),1),p9r=new Set(['"',"\\","/","b","f","n","r","t","u"])});function f9r(t){if(!(typeof process>"u"||!process.versions?.bun||Object.keys(process.env).length>0)){if(gAe===null){gAe=new Map;try{let{readFileSync:e}=require("node:fs"),n=e("/proc/self/environ","utf-8");for(let r of n.split("\0")){let i=r.indexOf("=");i>0&&gAe.set(r.slice(0,i),r.slice(i+1))}}catch{}}return gAe.get(t)}}function vi(t,e){return e?.[t]||(typeof process<"u"?process.env[t]:void 0)||f9r(t)||void 0}var gAe,cx=v(()=>{p();gAe=null});function C3e(t,e){let n=t.toLowerCase(),r=t.toUpperCase();return e?.[n]||e?.[r]||vi(n)||vi(r)||""}function A9r(t){if(t instanceof URL)return t;try{return new URL(t)}catch{return}}function I3e(t){return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}function y9r(t){let e=t.trim().toLowerCase();if(!e)return;if(e.startsWith("[")){let r=e.indexOf("]");if(r!==-1){let i=e.slice(1,r),s=e.slice(r+1);if(s.startsWith(":")){let o=Number.parseInt(s.slice(1),10);return{host:i,port:Number.isNaN(o)?0:o}}return{host:i,port:0}}}if(e.includes(":")&&e.split(":").length>2)return{host:e,port:0};let n=e.lastIndexOf(":");if(n!==-1&&n===e.indexOf(":")){let r=e.slice(0,n),i=Number.parseInt(e.slice(n+1),10);if(!Number.isNaN(i))return{host:r,port:i}}return{host:e,port:0}}function E9r(t,e,n){let r=C3e("no_proxy",n).toLowerCase();if(!r)return!0;if(r==="*")return!1;let i=I3e(t.toLowerCase());return r.split(/[,\s]/).every(s=>{let o=y9r(s);if(!o||o.port&&o.port!==e)return!0;let a=I3e(o.host);return a.startsWith("*.")?a=a.slice(2):(a.startsWith(".")||a.startsWith("*"))&&(a=a.slice(1)),a?!(i===a||i.endsWith(`.${a}`)):!0})}function b9r(t,e){let n=A9r(t);if(!n?.protocol||!n.host)return"";let r=n.protocol.split(":",1)[0],i=I3e(n.hostname||n.host.replace(/:\d*$/,"")),s=Number.parseInt(n.port,10)||g9r[r]||0;if(!E9r(i,s,e))return"";let o=C3e(`${r}_proxy`,e)||C3e("all_proxy",e);return o&&!o.includes("://")&&(o=`${r}://${o}`),o}function AAe(t,e){let n=b9r(t,e);if(!n)return;let r;try{r=new URL(n)}catch(i){throw new Error(`Invalid proxy URL ${JSON.stringify(n)}: ${i instanceof Error?i.message:String(i)}`)}if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error(`${_9r} Got ${r.protocol}`);return r}var g9r,_9r,w3e=v(()=>{p();cx();g9r={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};_9r="Unsupported proxy protocol. SOCKS and PAC proxy URLs are not supported; use an HTTP or HTTPS proxy URL."});function ri(t){return t.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?{p()});function iJ(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function S9r(t){if(!iJ(t))return!1;let e=typeof t.type=="string"?[t.type]:Array.isArray(t.type)?t.type:[];return e.includes("object")||e.includes("array")||t.properties!==void 0||t.items!==void 0}function _Yt(t){return iJ(t)?t.type==="null"||Array.isArray(t.type)&&t.type.includes("null")||t.const===null||Array.isArray(t.enum)&&t.enum.includes(null)?!0:Array.isArray(t.anyOf)&&t.anyOf.some(e=>_Yt(e)):!1}function yAe(t){if(!iJ(t))throw new Pf("boolean schemas are unsupported");for(let s of x9r)if(t[s]!==void 0)throw new Pf(`${s} schemas are unsupported`);if(t.anyOf!==void 0){if(!Array.isArray(t.anyOf)||t.anyOf.length===0)throw new Pf("anyOf must contain at least one schema");for(let s of t.anyOf){if(S9r(s))throw new Pf("object and array unions are unsupported");yAe(s)}}if(t.items!==void 0){if(Array.isArray(t.items))throw new Pf("tuple schemas are unsupported");yAe(t.items)}let e=t.type==="object";if(t.properties!==void 0&&!e)throw new Pf("properties require type object");if(!e)return;if(t.additionalProperties!==void 0&&t.additionalProperties!==!1)throw new Pf("schema-valued or true additionalProperties is unsupported");if(t.properties!==void 0&&!iJ(t.properties))throw new Pf("object properties must be a schema map");if(t.required!==void 0&&(!Array.isArray(t.required)||t.required.some(s=>typeof s!="string")))throw new Pf("object required must be a string array");let n=t.properties??{},r=Object.keys(n),i=new Set(Array.isArray(t.required)?t.required:[]);if([...i].some(s=>!r.includes(s)))throw new Pf("required contains an unknown property");for(let[s,o]of Object.entries(n))yAe(o),!i.has(s)&&!_Yt(o)&&(n[s]={anyOf:[o,{type:"null"}]});t.required=r,t.additionalProperties=!1}function xYt(t){let e=structuredClone(t);if(!iJ(e))throw new Pf("root schema must have type object");if(yAe(e),e.type!=="object")throw new Pf("root schema must have type object");return e}function v0(t,e){return e===!0?xYt(t.parameters):t.parameters}function EAe(t,e,n){let r=e[n];if(typeof r!="string")throw new Error(`Grammar tool call "${t}" requires argument "${n}" to be a string.`);return r}function bAe(t,e,n,r){if(t.closed){if(r&&n===t.input)return;throw new Error(`grammar tool input for property "${e}" changed after it was closed`)}if(!n.startsWith(t.input))throw new Error(`grammar tool input for property "${e}" changed non-monotonically`);let i=n.slice(t.input.length);if(!r&&i.length===0)return;let s="";return t.started||(s+=`{${JSON.stringify(e)}:"`,t.started=!0),s+=JSON.stringify(i).slice(1,-1),t.input=n,r&&(s+='"}',t.closed=!0),s}function C9r(t){let e=t.parameters;if(e.type!=="object")throw new Error("grammar constrained sampling requires an object parameter schema");if(!Array.isArray(e.required)||e.required.length!==1||typeof e.required[0]!="string")throw new Error("grammar constrained sampling requires exactly one required string property");let n=e.required[0];if(!e.properties?.[n])throw new Error(`grammar constrained sampling requires a properties entry for ${n}`);if(e.properties[n]?.type!=="string")throw new Error(`grammar constrained sampling property ${n} must have type string`);return n}function wy(t,e){let n=t.constrainedSampling;if(!(!n||n.type!=="json_schema")){if(e)try{return xYt(t.parameters),!0}catch(r){if(!(r instanceof Pf))throw r;if(n.strict!=="require")return;throw new Error(`Tool "${t.name}" requires JSON-schema constrained sampling, but ${r.message}.`)}if(n.strict==="require")throw new Error(`Tool "${t.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`)}}function sJ(t,e){let n=t.constrainedSampling;if(!n||n.type!=="grammar"||!e)return;let r=n.variants.openai_lark,i=n.variants.openai_regex,s=typeof r=="string"&&r.trim().length>0,o=typeof i=="string"&&i.trim().length>0;if(!s&&!o)throw new Error(`Tool "${t.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`);try{return{format:s?"lark":"regex",definition:s?r:i,inputProperty:C9r(t)}}catch(a){let c=a instanceof Error?a.message:String(a);throw new Error(`Tool "${t.name}" cannot use grammar constrained sampling: ${c}.`)}}function R0(t,e){let n=new Map;for(let r of t??[]){let i=sJ(r,e);i&&n.set(r.name,i.inputProperty)}return n}var Pf,x9r,nI=v(()=>{p();Pf=class extends Error{},x9r=["$ref","$defs","definitions","allOf","oneOf","patternProperties","dependentSchemas","dependencies","unevaluatedProperties","propertyNames","contains","prefixItems","not","if","then","else"]});function wYt(t){return t.totalTokens||t.input+t.output+t.cacheRead+t.cacheWrite}function TYt(t){try{return JSON.stringify(t)??"undefined"}catch{return"[unserializable]"}}function w9r(t){if(typeof t=="string")return t.length;let e=0;for(let n of t)e+=n.type==="text"?n.text.length:I9r;return e}function vYt(t){return Math.ceil(t.length/T3e)}function SYt(t){return Math.ceil(w9r(t)/T3e)}function CYt(t){let e=0;if(t.role==="system")return vYt(kc(t))+IYt(t.toolsAdded)+IYt(t.toolsRemoved);if(t.role==="user"||t.role==="toolResult")return SYt(t.content);for(let n of t.content)n.type==="text"?e+=n.text.length:n.type==="thinking"?e+=n.thinking.length:e+=n.name.length+TYt(n.arguments).length;return Math.ceil(e/T3e)}function T9r(t){let e=Number.NEGATIVE_INFINITY,n;for(let r=0;r=e&&s.stopReason!=="aborted"&&s.stopReason!=="error"&&wYt(s.usage)>0&&(n={usage:s.usage,index:r})}e=Math.max(e,i.timestamp)}return n}function RYt(t){let e="messages"in t?t.messages:t,n=T9r(e);if(n){let i=wYt(n.usage),s=0;for(let o=n.index+1;o{p();Cy();T3e=4,I9r=4800});function oJ(t,e,n){if(t.contextWindow<=0)return Math.max(BYt,n);let r=t.contextWindow-RYt(e).tokens-v9r;return Math.min(n,Math.max(BYt,r))}function Wp(t,e,n,r){let i=t.samplingParams||n?.samplingParams?{...t.samplingParams,...n?.samplingParams}:void 0;return{temperature:n?.temperature,samplingParams:i,maxTokens:oJ(t,e,n?.maxTokens??t.maxTokens),signal:n?.signal,telemetryContext:n?.telemetryContext,apiKey:r||n?.apiKey,fetch:n?.fetch,transport:n?.transport,cacheRetention:n?.cacheRetention,sessionId:n?.sessionId,headers:n?.headers,onPayload:n?.onPayload,onResponse:n?.onResponse,timeoutMs:n?.timeoutMs,websocketConnectTimeoutMs:n?.websocketConnectTimeoutMs,maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,metadata:n?.metadata,env:n?.env}}function v3e(t){return t==="xhigh"||t==="max"?"high":t}function R3e(t,e){let n={...k9r,...e},r=v3e(t);return n[r]}function k3e(t,e){return Math.min(t,Math.max(0,e-R9r))}function _Ae(t,e,n,r){let i=R3e(n,r),s=t===void 0?e:Math.min(t+i,e);return s<=i&&(i=k3e(i,s)),{maxTokens:s,thinkingBudget:i}}var v9r,BYt,R9r,k9r,rI=v(()=>{p();kYt();v9r=4096,BYt=1;R9r=1024,k9r={minimal:1024,low:2048,medium:8192,high:16384}});function NYt(t,e){let n=[],r=!1;for(let i of t){if(i.type==="image"){r||n.push({type:"text",text:e}),r=!0;continue}n.push(i),r=i.text===e}return n}function D9r(t,e){return e.input.includes("image")?t:t.map(n=>n.role==="user"&&Array.isArray(n.content)?{...n,content:NYt(n.content,B9r)}:n.role==="toolResult"?{...n,content:NYt(n.content,N9r)}:n)}function k0(t,e,n){let r=new Map,i=t.map(m=>m.content==null?{...m,content:[]}:m),o=D9r(i,e).map(m=>{if(m.role==="system"||m.role==="user")return m;if(m.role==="toolResult"){let h=r.get(m.toolCallId);return h&&h!==m.toolCallId?{...m,toolCallId:h}:m}if(m.role==="assistant"){let h=m,f=h.provider===e.provider&&h.api===e.api&&h.model===e.id,g=h.content.flatMap(A=>{if(A.type==="thinking")return A.redacted?f?A:[]:f&&A.thinkingSignature?A:!A.thinking||A.thinking.trim()===""?[]:f?A:{type:"text",text:A.thinking};if(A.type==="text")return f?A:{type:"text",text:A.text};if(A.type==="toolCall"){let y=A,E=y;if(!f&&y.thoughtSignature&&(E={...y},delete E.thoughtSignature),!f&&n){let _=n(y.id,e,h);_!==y.id&&(r.set(y.id,_),E={...E,id:_})}return E}return A});return{...h,content:g}}return m}),a=[],c=[],u=new Set,l=[],d=()=>{if(c.length>0){for(let m of c)u.has(m.id)||a.push({role:"toolResult",toolCallId:m.id,toolName:m.name,content:[{type:"text",text:"No result provided"}],isError:!0,timestamp:Date.now()});c=[],u=new Set}a.push(...l),l.length=0};for(let m=0;mA.type==="toolCall");g.length>0&&(c=g,u=new Set),a.push(h)}else h.role==="toolResult"?(u.add(h.toolCallId),a.push(h)):h.role==="system"?c.length>0?l.push(h):a.push(h):(h.role==="user"&&d(),a.push(h))}return d(),a}var B9r,N9r,jO=v(()=>{p();B9r="(image omitted: model does not support images)",N9r="(tool image omitted: model does not support images)"});function Ht(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n}function Ce(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}var Mf=v(()=>{p()});var IH,CAe=v(()=>{p();IH=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return IH=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),n=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))}});function B0(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var VO,AB=v(()=>{p();VO=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{let e=Object.prototype.toString.call(t);if(e==="[object Error]"||e==="[object DOMException]"){let n=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(n.stack=t.stack),t.cause&&!n.cause&&(n.cause=t.cause),t.name&&(n.name=t.name),n}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)}});var En,Hl,Mm,iI,wH,aJ,TH,vH,RH,kH,BH,NH,DH,PH,tc=v(()=>{p();AB();En=class extends Error{},Hl=class t extends En{constructor(e,n,r,i,s){super(`${t.makeMessage(e,n,r)}`),this.status=e,this.headers=i,this.requestID=i?.get("request-id"),this.workspaceID=i?.get("anthropic-workspace-id"),this.error=n,this.type=s??null}static makeMessage(e,n,r){let i=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return e&&i?`${e} ${i}`:e?`${e} status code (no body)`:i||"(no status code or body)"}static generate(e,n,r,i){if(!e||!i)return new iI({message:r,cause:VO(n)});let s=n,o=s?.error?.type;return e===400?new TH(e,s,r,i,o):e===401?new vH(e,s,r,i,o):e===403?new RH(e,s,r,i,o):e===404?new kH(e,s,r,i,o):e===409?new BH(e,s,r,i,o):e===422?new NH(e,s,r,i,o):e===429?new DH(e,s,r,i,o):e>=500?new PH(e,s,r,i,o):new t(e,s,r,i,o)}},Mm=class extends Hl{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},iI=class extends Hl{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}},wH=class extends iI{constructor({message:e}={}){super({message:e??"Request timed out."})}},aJ=class extends En{constructor(e,{cause:n}={}){super(e??"Retryable error."),n!==void 0&&(this.cause=n)}},TH=class extends Hl{},vH=class extends Hl{},RH=class extends Hl{},kH=class extends Hl{},BH=class extends Hl{},NH=class extends Hl{},DH=class extends Hl{},PH=class extends Hl{}});function cJ(t){return typeof t!="object"?{}:t??{}}function F3e(t){if(!t)return!0;for(let e in t)return!1;return!0}function qYt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Q3e(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var m6r,HYt,kh,L3e,jYt,lJ,Of=v(()=>{p();tc();m6r=/^[a-z][a-z0-9+.-]*:/i,HYt=t=>m6r.test(t),kh=t=>(kh=Array.isArray,kh(t)),L3e=kh;jYt=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new En(`${t} must be an integer`);if(e<0)throw new En(`${t} must be a positive integer`);return e},lJ=t=>{try{return JSON.parse(t)}catch{return}}});var lx,MH=v(()=>{p();lx=(t,e)=>new Promise(n=>{if(e?.aborted)return n();let r=()=>{clearTimeout(i),n()},i=setTimeout(()=>{e?.removeEventListener("abort",r),n()},t);e?.addEventListener("abort",r,{once:!0})})});var N0,uJ=v(()=>{p();N0="0.124.0"});function h6r(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function g6r(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:n}of t){let r=n.exec(navigator.userAgent);if(r){let i=r[1]||0,s=r[2]||0,o=r[3]||0;return{browser:e,version:`${i}.${s}.${o}`}}}return null}var KYt,f6r,VYt,YYt,zYt,dJ,IAe=v(()=>{p();uJ();KYt=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";f6r=()=>{let t=h6r();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N0,"X-Stainless-OS":YYt(Deno.build.os),"X-Stainless-Arch":VYt(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N0,"X-Stainless-OS":YYt(globalThis.process.platform??"unknown"),"X-Stainless-Arch":VYt(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=g6r();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};VYt=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",YYt=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),dJ=()=>zYt??(zYt=f6r())});function A6r(t,e){return()=>t.removeEventListener("abort",e)}function XYt(t,e,n){wAe.set(t,A6r(e,n))}function ZYt(t,e){wAe.has(e)&&JYt?.register(t,e,e)}function sI(t){let e=wAe.get(t);e&&(wAe.delete(t),JYt?.unregister(t),e())}var wAe,JYt,TAe=v(()=>{p();wAe=new WeakMap,JYt=typeof globalThis.FinalizationRegistry=="function"?new globalThis.FinalizationRegistry(t=>sI(t)):null});function e9t(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function U3e(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function vAe(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return U3e({start(){},async pull(n){let{done:r,value:i}=await e.next();r?n.close():n.enqueue(i)},async cancel(){await e.return?.()}})}function pJ(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){let n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function t9t(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),n=e.cancel();e.releaseLock(),await n}var OH=v(()=>{p()});var n9t,G3e=v(()=>{p();n9t=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)})});var $3e,W3e,H3e,r9t,q3e=v(()=>{p();$3e="RFC3986",W3e=t=>String(t),H3e={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:W3e},r9t="RFC1738"});function s9t(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function V3e(t,e){if(kh(t)){let n=[];for(let r=0;r{p();q3e();Of();RAe=(t,e)=>(RAe=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),RAe(t,e)),oI=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),j3e=1024,i9t=(t,e,n,r,i)=>{if(t.length===0)return t;let s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let o="";for(let a=0;a=j3e?s.slice(a,a+j3e):s,u=[];for(let l=0;l=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===r9t&&(d===40||d===41)){u[u.length]=c.charAt(l);continue}if(d<128){u[u.length]=oI[d];continue}if(d<2048){u[u.length]=oI[192|d>>6]+oI[128|d&63];continue}if(d<55296||d>=57344){u[u.length]=oI[224|d>>12]+oI[128|d>>6&63]+oI[128|d&63];continue}l+=1,d=65536+((d&1023)<<10|c.charCodeAt(l)&1023),u[u.length]=oI[240|d>>18]+oI[128|d>>12&63]+oI[128|d>>6&63]+oI[128|d&63]}o+=u.join("")}return o}});function b6r(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function u9t(t,e,n,r,i,s,o,a,c,u,l,d,m,h,f,g,A,y){let E=t,_=y,S=0,C=!1;for(;(_=_.get(Y3e))!==void 0&&!C;){let O=_.get(t);if(S+=1,typeof O<"u"){if(O===S)throw new RangeError("Cyclic object value");C=!0}typeof _.get(Y3e)>"u"&&(S=0)}if(typeof u=="function"?E=u(e,E):E instanceof Date?E=m?.(E):n==="comma"&&kh(E)&&(E=V3e(E,function(O){return O instanceof Date?m?.(O):O})),E===null){if(s)return c&&!g?c(e,ep.encoder,A,"key",h):e;E=""}if(b6r(E)||s9t(E)){if(c){let O=g?e:c(e,ep.encoder,A,"key",h);return[f?.(O)+"="+f?.(c(E,ep.encoder,A,"value",h))]}return[f?.(e)+"="+f?.(String(E))]}let I=[];if(typeof E>"u")return I;let w;if(n==="comma"&&kh(E))g&&c&&(E=V3e(E,c)),w=[{value:E.length>0?E.join(",")||null:void 0}];else if(kh(u))w=u;else{let O=Object.keys(E);w=l?O.sort(l):O}let k=a?String(e).replace(/\./g,"%2E"):String(e),N=r&&kh(E)&&E.length===1?k+"[]":k;if(i&&kh(E)&&E.length===0)return N+"[]";for(let O=0;O"u"?t.encodeDotInKeys?!0:ep.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:ep.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:ep.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:ep.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?ep.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:ep.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:ep.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:ep.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:ep.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:ep.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:ep.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:ep.strictNullHandling}}function d9t(t,e={}){let n=t,r=_6r(e),i,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):kh(r.filter)&&(s=r.filter,i=s);let o=[];if(typeof n!="object"||n===null)return"";let a=c9t[r.arrayFormat],c=a==="comma"&&r.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);let u=new WeakMap;for(let m=0;m0?d+l:""}var c9t,l9t,a9t,ep,Y3e,p9t=v(()=>{p();o9t();q3e();Of();c9t={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},l9t=function(t,e){Array.prototype.push.apply(t,kh(e)?e:[e])},ep={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:i9t,encodeValuesOnly:!1,format:$3e,formatter:W3e,indices:!1,serializeDate(t){return(a9t??(a9t=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};Y3e={}});function m9t(t){return d9t(t,{arrayFormat:"brackets"})}var z3e=v(()=>{p();p9t()});var aI={};br(aI,{child_process:()=>K3e,crypto:()=>yB,fs:()=>nv,os:()=>S6r,path:()=>gi,stream:()=>kAe,util:()=>J3e});var K3e,yB,nv,S6r,gi,kAe,J3e,nA=v(()=>{p();K3e=Ot(require("node:child_process"),1),yB=Ot(require("node:crypto"),1),nv=Ot(require("node:fs"),1),S6r=Ot(require("node:os"),1),gi=Ot(require("node:path"),1),kAe=Ot(require("node:stream"),1),J3e=Ot(require("node:util"),1)});function NAe(t){if(!t)return;let e;try{e=new URL(t)}catch(r){throw new ya(`Invalid token endpoint base URL "${t}": ${r}`)}if(e.protocol==="https:")return;let n=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(n==="localhost"||n==="127.0.0.1"||n==="::1")))throw new ya(`Refusing to send credential over non-https token endpoint "${t}"`)}async function DAe(t,e){let n=await I6r(t),r;try{r=JSON.parse(n)}catch{throw new ya(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,rA(n),e)}if(!r.access_token)throw new ya(`Token endpoint response missing access_token: ${JSON.stringify(rA(r))}`,t.status,rA(r),e);if(r.token_type&&r.token_type.toLowerCase()!=="bearer")throw new ya(`Token endpoint response: unsupported token_type "${r.token_type}" (want Bearer)`,t.status,rA(r),e);return r}function rA(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=X3e?t:t.slice(0,X3e)+`... <${t.length-X3e} more chars>`}return JSON.stringify(rA(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[n,r]of Object.entries(t))C6r.has(n)&&(e[n]=r);return e}return null}async function PAe(t,e=n=>console.warn(`anthropic-sdk: ${n}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:n}=await Promise.resolve().then(()=>(nA(),aI)),r=t,i;try{r=await n.promises.realpath(t),i=await n.promises.stat(r)}catch{return}let s=i.mode&511;if(s&18)throw new ya(`Credentials file at ${r} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${r}\`.`);if(s&36)throw new ya(`Credentials file at ${r} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${r}\` before retrying.`);typeof process.getuid=="function"&&i.uid!==process.getuid()&&e(`credentials file at ${r} is owned by uid ${i.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function MAe(t,e){let{fs:n,path:r}=await Promise.resolve().then(()=>(nA(),aI)),i=r.dirname(t);await n.promises.mkdir(i,{recursive:!0,mode:448});let s=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let o=await n.promises.open(s,"w",384);try{await o.writeFile(JSON.stringify(e,null,2)),await o.sync()}finally{await o.close()}await n.promises.rename(s,t)}catch(o){throw await n.promises.unlink(s).catch(()=>{}),o}try{let o=await n.promises.open(i,"r");try{await o.sync()}finally{await o.close()}}catch{}}async function I6r(t){if(!t.body)return"";let e=t.body.getReader(),n=[],r=0;for(;;){let{done:s,value:o}=await e.read();if(s)break;if(r+o.length>h9t){let a=h9t-r;a>0&&n.push(o.subarray(0,a)),await e.cancel();break}n.push(o),r+=o.length}let i;if(n.length===1)i=n[0];else{i=new Uint8Array(n.reduce((o,a)=>o+a.length,0));let s=0;for(let o of n)i.set(o,s),s+=o.length}return new TextDecoder("utf-8").decode(i)}var f9t,g9t,BAe,YO,A9t,y9t,LH,E9t,h9t,X3e,C6r,ya,FH=v(()=>{p();tc();f9t="urn:ietf:params:oauth:grant-type:jwt-bearer",g9t="refresh_token",BAe="/v1/oauth/token",YO="oauth-2025-04-20",A9t="oidc-federation-2026-04-01",y9t=120,LH=30,E9t=5,h9t=1<<20;X3e=2e3,C6r=new Set(["error","error_description","error_uri"]);ya=class extends En{constructor(e,n=null,r=null,i=null){super(e),this.statusCode=n,this.body=r,this.requestId=i}}});function ux(){return Math.floor(Date.now()/1e3)}var mJ=v(()=>{p()});var OAe,b9t=v(()=>{p();FH();mJ();OAe=class{constructor(e,n){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=n}async getToken(){let e=this.nextForce;this.nextForce=!1;let n=this.cached;if(e||n==null)return(await this.refresh(e)).token;if(n.expiresAt==null)return n.token;let r=n.expiresAt-ux();return r>y9t?n.token:r>LH?(this.backgroundRefresh(),n.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||ux()-this.lastAdvisoryError{this.lastAdvisoryError=ux(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(n=>(this.cached=n,this.pendingRefresh=null,n),n=>{throw this.pendingRefresh=null,n}),this.pendingRefresh}}});var qs,QH=v(()=>{p();qs=t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0}});function S9t(t){let e=0;for(let i of t)e+=i.length;let n=new Uint8Array(e),r=0;for(let i of t)n.set(i,r),r+=i.length;return n}function EB(t){let e;return(_9t??(e=new globalThis.TextEncoder,_9t=e.encode.bind(e)))(t)}function zO(t){let e;return(x9t??(e=new globalThis.TextDecoder,x9t=e.decode.bind(e)))(t)}var _9t,x9t,KO=v(()=>{p()});var C9t,Z3e=v(()=>{p();tc();KO();C9t=t=>{if(typeof globalThis.Buffer<"u"){let e=globalThis.Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(typeof atob<"u"){let e=atob(t),n=new Uint8Array(e.length);for(let r=0;rFAe[n]?hJ:e[t].bind(e)}function t4e(t,e){let n=I9t.get(t);if(n&&n[0]===e)return n[1];let r={error:LAe("error",t,e),warn:LAe("warn",t,e),info:LAe("info",t,e),debug:LAe("debug",t,e)};return I9t.set(t,[e,r]),r}function lo(t){let e=t.logger,n=t.logLevel??"off";return e?t4e(e,n):w6r}function T9t(){let t=qs("ANTHROPIC_LOG");return(!e4e||t!==w9t)&&(w9t=t,e4e=t4e(console,QAe(t,"process.env['ANTHROPIC_LOG']",t4e(console,fJ))??fJ)),e4e}var fJ,FAe,QAe,w6r,I9t,w9t,e4e,cI,dx=v(()=>{p();Of();QH();fJ="warn",FAe={off:0,error:200,warn:300,info:400,debug:500},QAe=(t,e,n)=>{if(t){if(qYt(FAe,t))return t;n.warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(FAe))}`)}};w6r={error:hJ,warn:hJ,info:hJ,debug:hJ},I9t=new WeakMap;cI=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,n])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t)});var n4e=v(()=>{p();Of();Z3e();QH();dx();CAe();MH();z3e()});function v9t(t){if(!t)throw new Error("profile name is empty");if(t==="."||t==="..")throw new Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw new Error(`profile name "${t}" must not contain path separators`);if(!T6r.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var UAe,T6r,R9t,k9t,r4e,v6r,B9t,i4e=v(()=>{p();IAe();n4e();UAe="1.0",T6r=/^[A-Za-z0-9_.-]+$/;R9t=async t=>{var e,n;let r=await r4e();if(r===null)return null;let i=t??await B9t();if(i===null)return null;v9t(i);let{fs:s,path:o}=await Promise.resolve().then(()=>(nA(),aI)),a=o.join(r,"configs",`${i}.json`),c;try{c=await s.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw new Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=qs("ANTHROPIC_ORGANIZATION_ID"),m=qs("ANTHROPIC_IDENTITY_TOKEN_FILE"),h=qs("ANTHROPIC_FEDERATION_RULE_ID");return h&&d?{fromFile:!1,config:{organization_id:d,workspace_id:qs("ANTHROPIC_WORKSPACE_ID"),base_url:qs("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:h,service_account_id:qs("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:qs("ANTHROPIC_SCOPE")}}}:null}let u;try{u=JSON.parse(c)}catch(d){throw new Error(`failed to parse config file ${a}: ${d}`)}if(!u.authentication)throw new Error(`config file ${a} is missing "authentication"`);let l=u.authentication.type;if(l!=="oidc_federation"&&l!=="user_oauth")throw new Error(`authentication.type "${l}" is not a known authentication type`);if(u.organization_id??(u.organization_id=qs("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=qs("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=qs("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=qs("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let d=qs("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(u.authentication.identity_token={source:"file",path:d})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=qs("ANTHROPIC_FEDERATION_RULE_ID")??""),(n=u.authentication).service_account_id??(n.service_account_id=qs("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},k9t=async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let n=await r4e();if(!n)return null;let r=e??await B9t();if(!r)return null;v9t(r);let{path:i}=await Promise.resolve().then(()=>(nA(),aI));return i.join(n,"credentials",`${r}.json`)},r4e=async()=>{if(!v6r())return null;let{path:t}=await Promise.resolve().then(()=>(nA(),aI)),e=qs("ANTHROPIC_CONFIG_DIR");if(e)return e;if(dJ()["X-Stainless-OS"]==="Windows"){let s=qs("APPDATA");if(s)return t.join(s,"Anthropic");let o=qs("USERPROFILE");return o?t.join(o,"AppData","Roaming","Anthropic"):null}let r=qs("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let i=qs("HOME");return i?t.join(i,".config","anthropic"):null},v6r=()=>{let t=dJ()["X-Stainless-Runtime"];return t==="node"||t==="deno"},B9t=async()=>{let t=await r4e();if(!t)return null;let e=qs("ANTHROPIC_PROFILE");if(e)return e;let{fs:n,path:r}=await Promise.resolve().then(()=>(nA(),aI)),i=r.join(t,"active_config");try{return(await n.promises.readFile(i,"utf-8")).trim()||"default"}catch(s){if(s?.code!=="ENOENT")throw new Error(`failed to read ${i}: ${s}`);return"default"}}});function s4e(t){if(!t)throw new En("Identity token file path is empty");return async()=>{let{fs:e}=await Promise.resolve().then(()=>(nA(),aI)),n;try{n=await e.promises.readFile(t,"utf-8")}catch(i){throw new En(`Failed to read identity token file at ${t}: ${i}`)}let r=n.trim();if(!r)throw new En(`Identity token file at ${t} is empty`);return r}}function N9t(t){if(!t)throw new En("Identity token value is empty");return()=>t}var D9t=v(()=>{p();tc()});function P9t(t){return async()=>{NAe(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new ya(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let n={grant_type:f9t,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(n.service_account_id=t.serviceAccountId),t.workspaceId&&(n.workspace_id=t.workspaceId);let r=`${t.baseURL}${BAe}`,i;try{i=await t.fetch(r,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${YO},${A9t}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${N0} oidcFederationProvider`},body:JSON.stringify(n)})}catch(c){throw new ya(`Failed to reach token endpoint ${r}: ${c}`)}let s=i.headers.get("Request-Id");if(!i.ok){let c=await i.text().catch(()=>""),u=rA(c),l="";throw i.status===401&&(l=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new ya(`Token exchange failed with status ${i.status}${s?` (request-id ${s})`:""}: ${u}${l}`,i.status,u,s)}let o=await DAe(i,s),a=Number(o.expires_in);if(!Number.isFinite(a))throw new ya(`Token endpoint response missing required fields: ${JSON.stringify(rA(o))}`,i.status,rA(o),s);return{token:o.access_token,expiresAt:ux()+a}}}var M9t=v(()=>{p();FH();mJ();uJ()});function O9t(t){return async e=>{let{fs:n}=await Promise.resolve().then(()=>(nA(),aI));await PAe(t.credentialsPath,t.onSafetyWarning);let r;try{r=await n.promises.readFile(t.credentialsPath,"utf-8")}catch(A){throw new ya(`Credentials file not found at ${t.credentialsPath}: ${A}`)}let i;try{i=JSON.parse(r)}catch(A){throw new ya(`Credentials file at ${t.credentialsPath} is not valid JSON: ${A}`)}let s=i.access_token;if(!s)throw new ya(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let o=i.expires_at;if(!e?.forceRefresh&&(o==null||ux()"");throw new ya(`User OAuth refresh failed (HTTP ${l.status}): ${rA(A)}`,l.status,rA(A),d)}let m=await DAe(l,d),h=Number(m.expires_in);if(!Number.isFinite(h))throw new ya(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(rA(m))}`,l.status,rA(m),d);let f=ux()+h,g=m.refresh_token||a;return await MAe(t.credentialsPath,{...i,version:UAe,type:"oauth_token",access_token:m.access_token,expires_at:f,refresh_token:g}),{token:m.access_token,expiresAt:f}}}var L9t=v(()=>{p();i4e();FH();mJ();uJ()});function o4e(t,e){let n=t.authentication.credentials_path??null,r=(t.base_url||e.baseURL).replace(/\/+$/,""),i=R6r(t,n,r,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:i,extraHeaders:s,baseURL:t.base_url||void 0}}async function F9t(t,e){let n=await R9t(e);if(!n)return null;let{config:r,fromFile:i}=n,s=r.authentication.credentials_path||!i?r:{...r,authentication:{...r.authentication,credentials_path:await k9t(r,e)??void 0}};return o4e(s,t)}function R6r(t,e,n,r){switch(t.authentication.type){case"oidc_federation":{let i=t.authentication,s=k6r(i);if(!s)throw new ya("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!i.federation_rule_id)throw new ya("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new ya("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let o=P9t({identityTokenProvider:s,federationRuleId:i.federation_rule_id,organizationId:t.organization_id,serviceAccountId:i.service_account_id,workspaceId:t.workspace_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent});return e?B6r(o,e,r.onCacheWriteError,r.onSafetyWarning):o}case"user_oauth":{if(!e)throw new ya("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return O9t({credentialsPath:e,clientId:t.authentication.client_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent,onSafetyWarning:r.onSafetyWarning})}default:{let i=t.authentication.type;throw new ya(`authentication.type "${i}" is not a known authentication type`)}}}function k6r(t){if(t.identity_token){let r=t.identity_token.source;if(r!=="file")throw new ya(`identity_token.source "${r}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new ya('identity_token.source "file" requires a non-empty path');return s4e(t.identity_token.path)}let e=qs("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return s4e(e);let n=qs("ANTHROPIC_IDENTITY_TOKEN");return n?N9t(n):null}function B6r(t,e,n,r){return async i=>{let{fs:s}=await Promise.resolve().then(()=>(nA(),aI));await PAe(e,r);let o;try{let c=await s.promises.readFile(e,"utf-8");o=JSON.parse(c);let u=o?.access_token;if(u&&!i?.forceRefresh){let l=o?.expires_at;if(l==null||ux(){p();QH();i4e();FH();mJ();D9t();M9t();L9t()});function N6r(t,e){for(let i=e??0;i{p();Mf();KO();rv=class{constructor(){Ty.set(this,void 0),vy.set(this,void 0),Ht(this,Ty,new Uint8Array,"f"),Ht(this,vy,null,"f")}decode(e){if(e==null)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?EB(e):e;Ht(this,Ty,S9t([Ce(this,Ty,"f"),n]),"f");let r=[],i;for(;(i=N6r(Ce(this,Ty,"f"),Ce(this,vy,"f")))!=null;){if(i.carriage&&Ce(this,vy,"f")==null){Ht(this,vy,i.index,"f");continue}if(Ce(this,vy,"f")!=null&&(i.index!==Ce(this,vy,"f")+1||i.carriage)){r.push(zO(Ce(this,Ty,"f").subarray(0,Ce(this,vy,"f")-1))),Ht(this,Ty,Ce(this,Ty,"f").subarray(Ce(this,vy,"f")),"f"),Ht(this,vy,null,"f");continue}let s=Ce(this,vy,"f")!==null?i.preceding-1:i.preceding,o=zO(Ce(this,Ty,"f").subarray(0,s));r.push(o),Ht(this,Ty,Ce(this,Ty,"f").subarray(i.index),"f"),Ht(this,vy,null,"f")}return r}flush(){return Ce(this,Ty,"f").length?this.decode(` +`):[]}};Ty=new WeakMap,vy=new WeakMap;rv.NEWLINE_CHARS=new Set([` +`,"\r"]);rv.NEWLINE_REGEXP=/\r\n|[\n\r]/g});async function*G9t(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new En("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new En("Attempted to iterate over a response with no body");let n=new c4e,r=new rv,i=pJ(t.body);for await(let s of D6r(i))for(let o of r.decode(s)){let a=n.decode(o);a&&(yield a)}for(let s of r.flush()){let o=n.decode(s);o&&(yield o)}}async function*D6r(t){let e=new Uint8Array;for await(let n of t){if(n==null)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?EB(n):n,i=new Uint8Array(e.length+r.length);i.set(e),i.set(r,e.length),e=i;let s;for(;(s=U9t(e))!==-1;)yield e.subarray(0,s),e=e.subarray(s)}e.length>0&&(yield e)}function P6r(t,e){let n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}var gJ,Ry,c4e,AJ=v(()=>{p();Mf();tc();OH();a4e();OH();AB();Of();KO();dx();tc();TAe();Ry=class t{constructor(e,n,r){this.iterator=e,gJ.set(this,void 0),this.controller=n,Ht(this,gJ,r,"f")}static rawEvents(e,n=new AbortController){return G9t(e,n)}static fromSSEResponse(e,n,r){let i=!1,s=r?lo(r):console;async function*o(){if(i)throw new En("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let a=!1;try{for await(let c of G9t(e,n)){if(c.event==="completion")try{yield JSON.parse(c.data)}catch(u){throw s.error("Could not parse message into JSON:",c.data),s.error("From chunk:",c.raw),u}if(c.event==="message_start"||c.event==="message_delta"||c.event==="message_stop"||c.event==="content_block_start"||c.event==="content_block_delta"||c.event==="content_block_stop"||c.event==="message"||c.event==="user.message"||c.event==="user.interrupt"||c.event==="user.tool_confirmation"||c.event==="user.custom_tool_result"||c.event==="user.tool_result"||c.event==="agent.message"||c.event==="agent.thinking"||c.event==="agent.tool_use"||c.event==="agent.tool_result"||c.event==="agent.mcp_tool_use"||c.event==="agent.mcp_tool_result"||c.event==="agent.custom_tool_use"||c.event==="agent.thread_context_compacted"||c.event==="session.status_running"||c.event==="session.status_idle"||c.event==="session.status_rescheduled"||c.event==="session.status_terminated"||c.event==="session.error"||c.event==="session.deleted"||c.event==="session.updated"||c.event==="span.model_request_start"||c.event==="span.model_request_end"||c.event==="span.outcome_evaluation_start"||c.event==="span.outcome_evaluation_ongoing"||c.event==="span.outcome_evaluation_end"||c.event==="user.define_outcome"||c.event==="agent.thread_message_received"||c.event==="agent.thread_message_sent"||c.event==="agent.session_thread_message_received"||c.event==="agent.session_thread_message_sent"||c.event==="session.thread_created"||c.event==="session.thread_status_created"||c.event==="session.thread_status_running"||c.event==="session.thread_status_idle"||c.event==="session.thread_status_rescheduled"||c.event==="session.thread_status_terminated"||c.event==="event_start"||c.event==="event_delta"||c.event==="system.message")try{yield JSON.parse(c.data)}catch(u){throw s.error("Could not parse message into JSON:",c.data),s.error("From chunk:",c.raw),u}if(c.event!=="ping"&&c.event==="error"){let u=lJ(c.data)??c.data,l=u?.error?.type;throw new Hl(void 0,u,void 0,e.headers,l)}}a=!0}catch(c){if(B0(c))return;throw c}finally{a||n.abort(),sI(n)}}return new t(o,n,r)}static fromReadableStream(e,n,r){let i=!1;async function*s(){let a=new rv,c=pJ(e);for await(let u of c)for(let l of a.decode(u))yield l;for(let u of a.flush())yield u}async function*o(){if(i)throw new En("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let a=!1;try{for await(let c of s())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(B0(c))return;throw c}finally{a||n.abort(),sI(n)}}return new t(o,n,r)}[(gJ=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],n=[],r=this.iterator(),i=s=>({next:()=>{if(s.length===0){let o=r.next();e.push(o),n.push(o)}return s.shift()}});return[new t(()=>i(e),this.controller,Ce(this,gJ,"f")),new t(()=>i(n),this.controller,Ce(this,gJ,"f"))]}toReadableStream(){let e=this,n;return U3e({async start(){n=e[Symbol.asyncIterator]()},async pull(r){try{let{value:i,done:s}=await n.next();if(s)return r.close();let o=EB(JSON.stringify(i)+` +`);r.enqueue(o)}catch(i){r.error(i)}},async cancel(){await n.return?.()}})}};c4e=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[n,r,i]=P6r(e,":");return i.startsWith(" ")&&(i=i.substring(1)),n==="event"?this.event=i:n==="data"&&this.data.push(i),null}}});async function GAe(t,e){let{response:n,requestLogID:r,retryOfRequestLogID:i,startTime:s}=e,o=await(async()=>{if(e.options.stream)return lo(t).debug("response",n.status,n.url,n.headers,n.body),Ry.fromSSEResponse(n,e.controller,t);if(n.status===204)return null;if(e.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let m=await n.json();return yJ(m,n)}return await n.text()})().finally(()=>{!e.options.stream&&!e.options.__binaryResponse&&sI(e.controller)});return lo(t).debug(`[${r}] response parsed`,cI({retryOfRequestLogID:i,url:n.url,status:n.status,body:o,durationMs:Date.now()-s})),o}function yJ(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperties(t,{_request_id:{value:e.headers.get("request-id"),enumerable:!1},_workspace_id:{value:e.headers.get("anthropic-workspace-id"),enumerable:!1}})}var $Ae=v(()=>{p();AJ();dx();TAe()});function l4e(t){return typeof t=="object"&&t!==null&&W9t.has(t)}function H9t(t){let e=new Set;for(;typeof t=="object"&&t!==null&&!e.has(t);){if(e.add(t),l4e(t)||B0(t)||t instanceof iI||t instanceof aJ)return!0;t=t.cause}return!1}function u4e(t,e,n,r){return async(i,s={})=>{if(e.length===0)return t.call(void 0,i,s);let o=s.headers instanceof Headers?s.headers:new Headers(s.headers),a=await O6r(t,e,n,r)({...s,headers:o,url:typeof i=="string"?i:i instanceof URL?i.href:i.url});if(a.bodyUsed||a.body?.locked)throw new En("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return a}}function M6r(t,e){let n=new WeakMap;return{options:t,logger:e?lo(e):T9t(),parse(r){if(t?.stream&&r.ok)return $9t(r,t,e);let i=n.get(r);return i||(i=$9t(r,t,e),n.set(r,i)),i}}}async function $9t(t,e,n){if(t.bodyUsed||t.body?.locked)throw new En("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(e?.stream&&t.ok)return Ry.fromSSEResponse(t.clone(),new AbortController,n);if(t.status===204)return null;if(e?.__binaryResponse)return t;let i=t.headers.get("content-type")?.split(";")[0]?.trim();return i?.includes("application/json")||i?.endsWith("+json")?t.headers.get("content-length")==="0"?void 0:yJ(await t.clone().json(),t):await t.clone().text()}function O6r(t,e,n,r){let i=async({url:o,...a})=>{try{return await t.call(void 0,o,a)}catch(c){let u=VO(c);throw W9t.add(u),u}},s=M6r(n,r);for(let o=e.length-1;o>=0;o--){let a=e[o],c=i;i=async u=>a(u,c,s)}return i}var W9t,q9t=v(()=>{p();AB();$Ae();dx();tc();AJ();W9t=new WeakSet});var EJ,JO,WAe=v(()=>{p();Mf();$Ae();JO=class t extends Promise{constructor(e,n,r=GAe){super(i=>{i(null)}),this.responsePromise=n,this.parseResponse=r,EJ.set(this,void 0),Ht(this,EJ,e,"f")}_thenUnwrap(e){return new t(Ce(this,EJ,"f"),this.responsePromise,async(n,r)=>yJ(e(await this.parseResponse(n,r),r),r.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(Ce(this,EJ,"f"),e))),this.parsedPromise}then(e,n){return this.parse().then(e,n)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};EJ=new WeakMap});var HAe,bJ,_J,wd,ur,qAe,zi=v(()=>{p();Mf();tc();$Ae();WAe();Of();bJ=class{constructor(e,n,r,i){HAe.set(this,void 0),Ht(this,HAe,e,"f"),this.options=i,this.response=n,this.body=r}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new En("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await Ce(this,HAe,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(HAe=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let n of e.getPaginatedItems())yield n}},_J=class extends JO{constructor(e,n,r){super(e,n,async(i,s)=>new r(i,s.response,await GAe(i,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let n of e)yield n}},wd=class extends bJ{constructor(e,n,r,i){super(e,n,r,i),this.data=r.data||[],this.has_more=r.has_more||!1,this.first_id=r.first_id||null,this.last_id=r.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let n=this.first_id;return n?{...this.options,query:{...cJ(this.options.query),before_id:n}}:null}let e=this.last_id;return e?{...this.options,query:{...cJ(this.options.query),after_id:e}}:null}},ur=class extends bJ{constructor(e,n,r,i){super(e,n,r,i),this.data=r.data||[],this.next_page=r.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...cJ(this.options.query),page:e}}:null}},qAe=class extends bJ{constructor(e,n,r,i){super(e,n,r,i),this.data=r.data||[],this.next_page=r.next_page||null,this.prev_page=r.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...cJ(this.options.query),page:e}}:null}}});function XO(t,e,n){return p4e(),new File(t,e??"unknown_file",n)}function xJ(t,e){let n=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?n.split(/[\\/]/).pop()||void 0:n}function F6r(t){let e=typeof t=="function"?t:t.fetch,n=j9t.get(e);if(n)return n;let r=(async()=>{try{let i="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new i(s).text()}catch{return!0}})();return j9t.set(e,r),r}var p4e,m4e,D0,j9t,Q6r,d4e,iv=v(()=>{p();OH();p4e=()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};m4e=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function",D0=async(t,e,n=!0)=>({...t,body:await Q6r(t.body,e,n)}),j9t=new WeakMap;Q6r=async(t,e,n=!0)=>{if(!await F6r(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let r=new FormData;return await Promise.all(Object.entries(t||{}).map(([i,s])=>d4e(r,i,s,n))),r},d4e=async(t,e,n,r)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")t.append(e,String(n));else if(n instanceof Response){let i={},s=n.headers.get("Content-Type");s&&(i={type:s}),t.append(e,XO([await n.blob()],xJ(n,r),i))}else if(m4e(n))t.append(e,XO([await new Response(vAe(n)).blob()],xJ(n,r)));else if(n instanceof Blob)t.append(e,XO([n],xJ(n,r)||void 0,{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(i=>d4e(t,e+"[]",i,r)));else{if(typeof n.then=="function")throw new TypeError(`Received a Promise for "${e}"; await it first, e.g. \`await toFile(...)\``);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))throw new TypeError(`Received ${n.constructor.name} for "${e}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);if(typeof n=="object")await Promise.all(Object.entries(n).map(([i,s])=>d4e(t,`${e}[${i}]`,s,r)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}}});async function jAe(t,e,n){if(p4e(),t=await t,e||(e=xJ(t,!0)),U6r(t))return t instanceof File&&e==null&&n==null?t:XO([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...n});if(G6r(t)){let i=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),XO(await h4e(i),e,n)}let r=await h4e(t);if(!n?.type){let i=r.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof i=="string"&&(n={...n,type:i})}return XO(r,e,n)}async function h4e(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(V9t(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(m4e(t))for await(let n of t)e.push(...await h4e(n));else{let n=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${n?`; constructor: ${n}`:""}${$6r(t)}`)}return e}function $6r(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(n=>`"${n}"`).join(", ")}]`}var V9t,U6r,G6r,Y9t=v(()=>{p();iv();iv();V9t=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",U6r=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&V9t(t),G6r=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function"});var f4e=v(()=>{p();Y9t()});var z9t=v(()=>{p()});var _n,ui=v(()=>{p();_n=class{constructor(e){this._client=e}}});function*H6r(t){if(!t)return;if(K9t in t){let{values:r,nulls:i}=t;yield*r.entries();for(let s of i)yield[s,null];return}let e=!1,n;t instanceof Headers?n=t.entries():L3e(t)?n=t:(e=!0,n=Object.entries(t??{}));for(let r of n){let i=r[0];if(typeof i!="string")throw new TypeError("expected header name to be a string");let s=L3e(r[1])?r[1]:[r[1]],o=!1;for(let a of s)a!==void 0&&(e&&!o&&(o=!0,yield[i,VAe]),yield[i,a])}}var K9t,VAe,q6r,J9t,pt,Ui=v(()=>{p();Of();K9t=Symbol.for("brand.privateNullableHeaders");VAe=Symbol("clear"),q6r=new Set(["x-stainless-helper"]),J9t=(t,e)=>{let n=t?t.split(",").map(r=>r.trim()).filter(Boolean):[];for(let r of e.split(",").map(i=>i.trim()))r&&!n.includes(r)&&n.push(r);return n.join(", ")},pt=t=>{let e=new Headers,n=new Set;for(let r of t){let i=new Set;for(let[s,o]of H6r(r)){let a=s.toLowerCase();if(q6r.has(a)){if(o===VAe)continue;o===null?(e.delete(s),n.add(a)):(e.set(s,J9t(e.get(s),o)),n.delete(a));continue}(o===VAe||!i.has(a))&&(e.delete(s),i.add(a),o===VAe)||(o===null?(e.delete(s),n.add(a)):(e.append(s,o),n.delete(a)))}}return{[K9t]:!0,values:e,nulls:n}}});function Z9t(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var X9t,j6r,wt,ms=v(()=>{p();tc();X9t=Object.freeze(Object.create(null)),j6r=(t=Z9t)=>function(n,...r){if(n.length===1)return n[0];let i=!1,s=[],o=n.reduce((l,d,m)=>{/[?#]/.test(d)&&(i=!0);let h=r[m],f=(i?encodeURIComponent:t)(""+h);return m!==r.length&&(h==null||typeof h=="object"&&h.toString===Object.getPrototypeOf(Object.getPrototypeOf(h.hasOwnProperty??X9t)??X9t)?.toString)&&(f=h+"",s.push({start:l.length+d.length,length:f.length,error:`Value of type ${Object.prototype.toString.call(h).slice(8,-1)} is not a valid path parameter`})),l+d+(m===r.length?"":f)},""),a=o.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=c.exec(a))!==null;)s.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(s.sort((l,d)=>l.start-d.start),s.length>0){let l=0,d=s.reduce((m,h)=>{let f=" ".repeat(h.start-l),g="^".repeat(h.length);return l=h.start+h.length,m+f+g},"");throw new En(`Path parameters result in path with invalid segments: +${s.map(m=>m.error).join(` `)} ${o} -${d}`)}return o},xt=kCr(RLt)});var E$,YUe=V(()=>{p();os();$s();Ys();ii();E$=class extends En{retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/deployment_runs/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",cr,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var b$,KUe=V(()=>{p();os();$s();Ys();ii();b$=class extends En{create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/deployments?beta=true",{body:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/deployments/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/deployments/${e}?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/deployments?beta=true",cr,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/deployments/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}pause(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/deployments/${e}/pause?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}run(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/deployments/${e}/run?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}unpause(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/deployments/${e}/unpause?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}});var _$,zUe=V(()=>{p();os();$s();Ys();ii();_$=class extends En{create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/dreams?beta=true",{body:s,...n,headers:gt([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString()},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/dreams/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"dreaming-2026-04-21"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/dreams?beta=true",cr,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString()},n?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/dreams/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"dreaming-2026-04-21"].toString()},r?.headers])})}cancel(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/dreams/${e}/cancel?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"dreaming-2026-04-21"].toString()},r?.headers])})}}});function p9(t){return{[OR]:t}}function Kde(t){return typeof t=="object"&&t!==null&&d9 in t}function JUe(t,e){let n=new Set;if(t)for(let r of t)Kde(r)&&n.add(r[d9]);if(e)for(let r of e){Kde(r)&&n.add(r[d9]);let s=r.content;if(Array.isArray(s))for(let i of s)Kde(i)&&n.add(i[d9])}return Array.from(n)}function Jde(t,e){let n=JUe(t,e);return n.length===0?{}:{[OR]:n.join(", ")}}function Xde(t){return Kde(t)?{[OR]:t[d9]}:{}}var OR,zde,d9,E_=V(()=>{p();OR="x-stainless-helper",zde="x-stainless-helper-method";d9=Symbol("anthropic.sdk.stainlessHelper")});var S$,XUe=V(()=>{p();os();$s();Ys();E_();Lx();ii();S$=class extends En{list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/files?beta=true",cr,{query:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}delete(e,n={},r){let{betas:s}=n??{};return this._client.delete(xt`/v1/files/${e}?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}download(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/files/${e}/content?beta=true`,{...r,headers:gt([{Accept:"application/binary",...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers]),__binaryResponse:!0})}retrieveMetadata(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/files/${e}?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}upload(e,n){let{betas:r,...s}=e;return this._client.post("/v1/files?beta=true",pE({body:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},Xde(s.file),n?.headers])},this._client))}}});var C$,ZUe=V(()=>{p();os();$s();Ys();ii();C$=class extends En{retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/models/${e}?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/models?beta=true",Bu,{query:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}}});var I$,e2e=V(()=>{p();os();$s();Ys();ii();I$=class extends En{create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/user_profiles?beta=true",{body:s,...n,headers:gt([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/user_profiles/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"user-profiles-2026-08-18"].toString()},r?.headers])})}update(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/user_profiles/${e}?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"user-profiles-2026-08-18"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",cr,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}createEnrollmentURL(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"user-profiles-2026-08-18"].toString()},r?.headers])})}}});var DLt=ee(uA=>{"use strict";p();var LCr=uA&&uA.__extends||(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)s.hasOwnProperty(i)&&(r[i]=s[i])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(uA,"__esModule",{value:!0});var Pu=256,t2e=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var n="",r=0;r>>18&63),n+=this._encodeByte(s>>>12&63),n+=this._encodeByte(s>>>6&63),n+=this._encodeByte(s>>>0&63)}var i=e.length-r;if(i>0){var s=e[r]<<16|(i===2?e[r+1]<<8:0);n+=this._encodeByte(s>>>18&63),n+=this._encodeByte(s>>>12&63),i===2?n+=this._encodeByte(s>>>6&63):n+=this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var n=this._getPaddingLength(e),r=e.length-n,s=new Uint8Array(this.maxDecodedLength(r)),i=0,o=0,a=0,c=0,u=0,l=0,d=0;o>>4,s[i++]=u<<4|l>>>2,s[i++]=l<<6|d,a|=c&Pu,a|=u&Pu,a|=l&Pu,a|=d&Pu;if(o>>4,a|=c&Pu,a|=u&Pu),o>>2,a|=l&Pu),o>>8&6,n+=51-e>>>8&-75,n+=61-e>>>8&-15,n+=62-e>>>8&3,String.fromCharCode(n)},t.prototype._decodeChar=function(e){var n=Pu;return n+=(42-e&e-44)>>>8&-Pu+e-43+62,n+=(46-e&e-48)>>>8&-Pu+e-47+63,n+=(47-e&e-58)>>>8&-Pu+e-48+52,n+=(64-e&e-91)>>>8&-Pu+e-65+0,n+=(96-e&e-123)>>>8&-Pu+e-97+26,n},t.prototype._getPaddingLength=function(e){var n=0;if(this._paddingCharacter){for(var r=e.length-1;r>=0&&e[r]===this._paddingCharacter;r--)n++;if(e.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},t})();uA.Coder=t2e;var h9=new t2e;function FCr(t){return h9.encode(t)}uA.encode=FCr;function QCr(t){return h9.decode(t)}uA.decode=QCr;var kLt=(function(t){LCr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._encodeByte=function(n){var r=n;return r+=65,r+=25-n>>>8&6,r+=51-n>>>8&-75,r+=61-n>>>8&-13,r+=62-n>>>8&49,String.fromCharCode(r)},e.prototype._decodeChar=function(n){var r=Pu;return r+=(44-n&n-46)>>>8&-Pu+n-45+62,r+=(94-n&n-96)>>>8&-Pu+n-95+63,r+=(47-n&n-58)>>>8&-Pu+n-48+52,r+=(64-n&n-91)>>>8&-Pu+n-65+0,r+=(96-n&n-123)>>>8&-Pu+n-97+26,r},e})(t2e);uA.URLSafeCoder=kLt;var NLt=new kLt;function UCr(t){return NLt.encode(t)}uA.encodeURLSafe=UCr;function $Cr(t){return NLt.decode(t)}uA.decodeURLSafe=$Cr;uA.encodedLength=function(t){return h9.encodedLength(t)};uA.maxDecodedLength=function(t){return h9.maxDecodedLength(t)};uA.decodedLength=function(t){return h9.decodedLength(t)}});var PLt=ee((BLt,Zde)=>{p();(function(t,e){var n={};e(n);var r=n.default;for(var s in n)r[s]=n[s];typeof Zde=="object"&&typeof Zde.exports=="object"?Zde.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):t.sha256=r})(BLt,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(d,h,m,f,g){for(var A,y,b,S,C,I,x,w,R,N,P,G,$;g>=64;){for(A=h[0],y=h[1],b=h[2],S=h[3],C=h[4],I=h[5],x=h[6],w=h[7],N=0;N<16;N++)P=f+N*4,d[N]=(m[P]&255)<<24|(m[P+1]&255)<<16|(m[P+2]&255)<<8|m[P+3]&255;for(N=16;N<64;N++)R=d[N-2],G=(R>>>17|R<<15)^(R>>>19|R<<13)^R>>>10,R=d[N-15],$=(R>>>7|R<<25)^(R>>>18|R<<14)^R>>>3,d[N]=(G+d[N-7]|0)+($+d[N-16]|0);for(N=0;N<64;N++)G=(((C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7))+(C&I^~C&x)|0)+(w+(e[N]+d[N]|0)|0)|0,$=((A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10))+(A&y^A&b^y&b)|0,w=x,x=I,I=C,C=S+G|0,S=b,b=y,y=A,A=G+$|0;h[0]+=A,h[1]+=y,h[2]+=b,h[3]+=S,h[4]+=C,h[5]+=I,h[6]+=x,h[7]+=w,f+=64,g-=64}return f}var r=(function(){function d(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var h=0;h0){for(;this.bufferLength<64&&m>0;)this.buffer[this.bufferLength++]=h[f++],m--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(m>=64&&(f=n(this.temp,this.state,h,f,m),m%=64);m>0;)this.buffer[this.bufferLength++]=h[f++],m--;return this},d.prototype.finish=function(h){if(!this.finished){var m=this.bytesHashed,f=this.bufferLength,g=m/536870912|0,A=m<<3,y=m%64<56?64:128;this.buffer[f]=128;for(var b=f+1;b>>24&255,this.buffer[y-7]=g>>>16&255,this.buffer[y-6]=g>>>8&255,this.buffer[y-5]=g>>>0&255,this.buffer[y-4]=A>>>24&255,this.buffer[y-3]=A>>>16&255,this.buffer[y-2]=A>>>8&255,this.buffer[y-1]=A>>>0&255,n(this.temp,this.state,this.buffer,0,y),this.finished=!0}for(var b=0;b<8;b++)h[b*4+0]=this.state[b]>>>24&255,h[b*4+1]=this.state[b]>>>16&255,h[b*4+2]=this.state[b]>>>8&255,h[b*4+3]=this.state[b]>>>0&255;return this},d.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},d.prototype._saveState=function(h){for(var m=0;mthis.blockSize)new r().update(h).finish(m).clean();else for(var f=0;f1&&h.update(d),m&&h.update(m),h.update(f),h.finish(d),f[0]++}var c=new Uint8Array(t.digestLength);function u(d,h,m,f){h===void 0&&(h=c),f===void 0&&(f=32);for(var g=new Uint8Array([1]),A=o(h,d),y=new s(A),b=new Uint8Array(y.digestLength),S=b.length,C=new Uint8Array(f),I=0;I>>24&255,y[1]=x>>>16&255,y[2]=x>>>8&255,y[3]=x>>>0&255,g.reset(),g.update(h),g.update(y),g.finish(S);for(var w=0;w{"use strict";p();Object.defineProperty(n2e,"__esModule",{value:!0});n2e.timingSafeEqual=GCr;function OLt(t,e=""){if(!t)throw new Error(e)}function GCr(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),OLt(t instanceof DataView),OLt(e instanceof DataView);let n=t.byteLength,r=0,s=-1;for(;++s{"use strict";p();Object.defineProperty(x$,"__esModule",{value:!0});x$.Webhook=x$.WebhookVerificationError=void 0;var LLt=DLt(),WCr=PLt(),qCr=MLt(),FLt=300,r2e=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},MR=class t extends r2e{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};x$.WebhookVerificationError=MR;var epe=class t{constructor(e,n){if(n?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,r=>r.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=LLt.decode(e)}if(this.key.length===0)throw new Error("Secret can't be empty.")}verify(e,n,r){var s;let i=(s=r?.jsonParse)!==null&&s!==void 0?s:!0,o={};for(let g of Object.keys(n))o[g.toLowerCase()]=n[g];let a=o["webhook-id"],c=o["webhook-signature"],u=o["webhook-timestamp"];if(!c||!a||!u)throw new MR("Missing required headers");let l=this.verifyTimestamp(u),h=this.sign(a,l,e).split(",")[1],m=c.split(" "),f=new globalThis.TextEncoder;for(let g of m){let[A,y]=g.split(",");if(A==="v1"&&(0,qCr.timingSafeEqual)(f.encode(y),f.encode(h))){let b=e.toString();return b===""?void 0:i?JSON.parse(b):void 0}}throw new MR("No matching signature found")}sign(e,n,r){if(typeof r!="string")if(r.constructor.name==="Buffer")r=r.toString();else throw new Error("Expected payload to be of type string or Buffer.");let s=new TextEncoder,i=Math.floor(n.getTime()/1e3),o=s.encode(`${e}.${i}.${r}`);return`v1,${LLt.encode(WCr.hmac(this.key,o))}`}verifyTimestamp(e){let n=Math.floor(Date.now()/1e3),r=parseInt(e,10);if(Number.isNaN(r))throw new MR("Invalid Signature Headers");if(n-r>FLt)throw new MR("Message timestamp too old");if(r>n+FLt)throw new MR("Message timestamp too new");return new Date(r*1e3)}};x$.Webhook=epe;epe.prefix="whsec_"});var ULt,w$,s2e=V(()=>{p();os();ULt=Gt(QLt(),1),w$=class extends En{parseUnverified(e){return JSON.parse(e)}unwrap(e,n){let r=n?.headers;if(r==null)throw new Error("Webhook headers are required in order to verify the signature");let s=n.key===void 0?this._client.webhookKey:n.key;if(!s)throw new Error("Webhook key must not be null or empty in order to unwrap");return new ULt.Webhook(s).verify(e,r),JSON.parse(e)}}});var T$,i2e=V(()=>{p();os();$s();Ys();ii();T$=class extends En{list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/agents/${e}/versions?beta=true`,cr,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}});var XB,o2e=V(()=>{p();os();i2e();i2e();$s();Ys();ii();XB=class extends En{constructor(){super(...arguments),this.versions=new T$(this._client)}create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/agents?beta=true",{body:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,n={},r){let{betas:s,...i}=n??{};return this._client.get(xt`/v1/agents/${e}?beta=true`,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/agents/${e}?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/agents?beta=true",cr,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/agents/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}};XB.Versions=T$});function LR(t,e){if(!t)return()=>{};if(t.aborted)return e.abort(),()=>{};let n=()=>e.abort();return t.addEventListener("abort",n),()=>t.removeEventListener("abort",n)}var tpe=V(()=>{p()});function Kd(t,e){return t instanceof Xc&&t.status===e}function $Lt(t){return t instanceof Xc&&typeof t.status=="number"&&t.status>=400&&t.status<500}function FR(t){return $Lt(t)&&!Kd(t,408)&&!Kd(t,409)&&!Kd(t,429)}function npe(t,e,n){return Math.min(e*2**t,n)}function a2e(t,e){return t+Math.random()*(e-t)}function rpe(t){return t*(1-Math.random()*.25)}var v$=V(()=>{p();Ra()});function spe(t,{authToken:e,helper:n}){if(!e)throw new gn(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(e)}`);let r=t,s=r._options.defaultHeaders,i=r._authState?.extraHeaders,o=i?Object.fromEntries(Object.entries(i).filter(([c])=>{let u=c.toLowerCase();return u!=="authorization"&&u!=="x-api-key"})):void 0,a=gt([o,s,{[OR]:n}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:a})}var c2e=V(()=>{p();Ra();Ys();E_()});function XCr(t){return npe(t,KCr,zCr)}function ZCr(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${s$()}`:s$()}var R$,ipe,hE,ope,ape,cpe,m9,f9,k$,N$,lpe,D$,g9,YCr,KCr,zCr,JCr,QR,l2e,upe=V(()=>{p();Em();Ra();y_();m$();xde();tpe();Ys();v$();c2e();v$();YCr=999,KCr=1e3,zCr=6e4,JCr=3e5,QR=class{constructor(e){R$.set(this,void 0),ipe.set(this,!1),hE.set(this,void 0),ope.set(this,void 0),ape.set(this,void 0),cpe.set(this,void 0),m9.set(this,void 0),f9.set(this,void 0),k$.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??ZCr(),Wt(this,R$,spe(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),Wt(this,ape,e.autoStop??!0,"f"),Wt(this,cpe,e.drain??!1,"f"),Wt(this,m9,e.blockMs===void 0?YCr:e.blockMs,"f"),Wt(this,f9,e.reclaimOlderThanMs??null,"f"),Wt(this,k$,e.requestOptions,"f"),Wt(this,hE,new AbortController,"f"),Wt(this,ope,LR(e.signal,xe(this,hE,"f")),"f")}get signal(){return xe(this,hE,"f").signal}abort(){xe(this,hE,"f").abort()}async*[(R$=new WeakMap,ipe=new WeakMap,hE=new WeakMap,ope=new WeakMap,ape=new WeakMap,cpe=new WeakMap,m9=new WeakMap,f9=new WeakMap,k$=new WeakMap,Symbol.asyncIterator)](){if(xe(this,ipe,"f"))throw new gn("Cannot iterate over a consumed WorkPoller");Wt(this,ipe,!0,"f");let e=Ji(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let n=new l2e(e,this.environmentId);try{let r=0;for(;!xe(this,hE,"f").signal.aborted;){let s;try{s=await xe(this,R$,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...xe(this,m9,"f")!==null?{block_ms:xe(this,m9,"f")}:{},...xe(this,f9,"f")!==null?{reclaim_older_than_ms:xe(this,f9,"f")}:{}},{headers:gt([xe(this,k$,"f")?.headers]),signal:xe(this,hE,"f").signal})}catch(i){if(xe(this,hE,"f").signal.aborted)return;if(FR(i))throw e.error("poll failed permanently, stopping poller",{error:String(i)}),i;let o=rpe(XCr(r));e.warn("poll failed, backing off",{error:String(i),backoff_ms:o}),r++,await g_(o,xe(this,hE,"f").signal);continue}if(r=0,s==null){if(xe(this,cpe,"f"))return;n.onEmptyPoll(),await g_(a2e(1e3,3e3),xe(this,hE,"f").signal);continue}n.onClaim(),e.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:s.id,work_type:s.data.type});try{await xe(this,R$,"f").beta.environments.work.ack(s.id,{environment_id:s.environment_id},{headers:gt([xe(this,k$,"f")?.headers]),signal:xe(this,hE,"f").signal})}catch(i){e.error("ack failed",{work_id:s.id,error:String(i)});continue}try{yield s}finally{if(xe(this,ape,"f"))try{await xe(this,R$,"f").beta.environments.work.stop(s.id,{environment_id:s.environment_id},{headers:gt([xe(this,k$,"f")?.headers])})}catch(i){Kd(i,409)||e.warn("stop failed",{work_id:s.id,error:String(i)})}}}}finally{xe(this,ope,"f").call(this)}}};l2e=class{constructor(e,n){N$.set(this,void 0),lpe.set(this,void 0),D$.set(this,void 0),g9.set(this,0),Wt(this,N$,e,"f"),Wt(this,lpe,n,"f")}onEmptyPoll(){let e=Date.now(),n={component:"work-poller",environment_id:xe(this,lpe,"f")};xe(this,D$,"f")===void 0?(Wt(this,D$,Wt(this,g9,e,"f"),"f"),xe(this,N$,"f").info("idle; polling for work",n)):e-xe(this,g9,"f")>=JCr?(Wt(this,g9,e,"f"),xe(this,N$,"f").info(`still polling; idle for ${Math.round((e-xe(this,D$,"f"))/1e3)}s`,n)):xe(this,N$,"f").debug("poll returned no work",n)}onClaim(){Wt(this,D$,void 0,"f")}};N$=new WeakMap,lpe=new WeakMap,D$=new WeakMap,g9=new WeakMap});var B$,UR,P$,dpe,GLt=V(()=>{p();Em();dpe=class{constructor(){B$.set(this,[]),UR.set(this,[]),P$.set(this,!1)}push(e){if(xe(this,P$,"f"))return!1;let n=xe(this,UR,"f").shift();return n?n({done:!1,value:e}):xe(this,B$,"f").push(e),!0}close(){if(!xe(this,P$,"f"))for(Wt(this,P$,!0,"f");xe(this,UR,"f").length>0;)xe(this,UR,"f").shift()({done:!0,value:void 0})}next(e){return xe(this,B$,"f").length>0?Promise.resolve({done:!1,value:xe(this,B$,"f").shift()}):xe(this,P$,"f")||e?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(n=>{let r=i=>{e?.removeEventListener("abort",s),n(i)},s=()=>{let i=xe(this,UR,"f").indexOf(r);i>=0&&xe(this,UR,"f").splice(i,1),n({done:!0,value:void 0})};xe(this,UR,"f").push(r),e?.addEventListener("abort",s,{once:!0})})}tryShift(){return xe(this,B$,"f").shift()}};B$=new WeakMap,UR=new WeakMap,P$=new WeakMap});var ks,ZB=V(()=>{p();ks=class extends Error{constructor(e){let n=typeof e=="string"?e:e.map(r=>r.type==="text"?r.text:`[${r.type}]`).join(" ");super(n),this.name="ToolError",this.content=e}}});function u2e(t){return"name"in t?t.name:"mcp_server_name"in t?t.mcp_server_name:t.type}function eIr(t){return t instanceof ks?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function WLt(t,e,n){try{let r=t.parse?t.parse(e):e;return{content:await t.run(r,n),isError:!1}}catch(r){return{content:eIr(r),isError:!0}}}var qLt=V(()=>{p();ZB()});function ZLt(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function cIr(t,e,n){return t.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:t.id,is_error:e,content:n}:{type:"user.tool_result",tool_use_id:t.id,is_error:e,content:n}}function lIr(t){if(typeof t=="string")return[{type:"text",text:t||"(no output)"}];let e=t.map(n=>n.type==="text"?{type:"text",text:n.text||"(no output)"}:n.type==="image"||n.type==="document"?n:n.type==="search_result"?{type:"search_result",source:n.source,title:n.title,content:n.content.map(r=>({type:"text",text:r.text})),citations:{enabled:n.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(n)});return e.length>0?e:[{type:"text",text:"(no output)"}]}var A9,Ape,O$,eP,b_,kl,ppe,Lp,hpe,y9,ype,Ou,L$,dA,F$,$R,M$,Fx,Epe,E9,mE,mpe,JLt,HLt,VLt,jLt,d2e,YLt,fpe,gpe,p2e,KLt,XLt,zLt,tIr,nIr,rIr,sIr,iIr,oIr,aIr,h2e,GR,bpe=V(()=>{p();Em();Ra();y_();m$();v$();tpe();GLt();Ys();E_();qLt();zLt=500,tIr=1e4,nIr=12e4,rIr=3e4,sIr=1e3,iIr=3e4,oIr=5*6e4,aIr=6e4;h2e=class{constructor(e,n){A9.set(this,void 0),Ape.set(this,void 0),O$.set(this,new Set),eP.set(this,!1),b_.set(this,void 0),Wt(this,A9,e,"f"),Wt(this,Ape,n,"f")}noteEvent(e){e.type!=="user.tool_confirmation"&&(ZLt(e)?this.arm():this.disarm())}block(e){xe(this,O$,"f").add(e),xe(this,b_,"f")!==void 0&&(Wt(this,eP,!0,"f"),clearTimeout(xe(this,b_,"f")),Wt(this,b_,void 0,"f"))}unblock(e){xe(this,O$,"f").delete(e),xe(this,O$,"f").size===0&&xe(this,eP,"f")&&this.arm()}arm(){if(!(xe(this,A9,"f")<=0)){if(xe(this,O$,"f").size>0){Wt(this,eP,!0,"f");return}Wt(this,eP,!1,"f"),xe(this,b_,"f")!==void 0&&clearTimeout(xe(this,b_,"f")),Wt(this,b_,setTimeout(xe(this,Ape,"f"),xe(this,A9,"f")),"f")}}disarm(){Wt(this,eP,!1,"f"),xe(this,b_,"f")!==void 0&&(clearTimeout(xe(this,b_,"f")),Wt(this,b_,void 0,"f"))}};A9=new WeakMap,Ape=new WeakMap,O$=new WeakMap,eP=new WeakMap,b_=new WeakMap;GR=class{constructor(e,n){kl.add(this),ppe.set(this,!1),Lp.set(this,void 0),hpe.set(this,void 0),y9.set(this,void 0),ype.set(this,void 0),Ou.set(this,void 0),L$.set(this,new Set),dA.set(this,new Set),F$.set(this,new Map),$R.set(this,new Map),M$.set(this,new dpe),Fx.set(this,0),Epe.set(this,oIr),E9.set(this,null),mE.set(this,void 0),this.client=n.client,this.sessionId=e,this.tools=n.tools,this.maxIdleMs=n.maxIdleMs??aIr,Wt(this,Ou,Ji(n.client),"f"),Wt(this,ype,new Map(n.tools.map(r=>[u2e(r),r])),"f"),Wt(this,Lp,new AbortController,"f"),Wt(this,hpe,LR(n.signal,xe(this,Lp,"f")),"f"),Wt(this,y9,n.requestOptions,"f"),Wt(this,mE,new h2e(this.maxIdleMs,()=>{xe(this,Ou,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),xe(this,Lp,"f").abort()}),"f")}get signal(){return xe(this,Lp,"f").signal}abort(){xe(this,Lp,"f").abort()}_setSendRetryWindow(e){Wt(this,Epe,e,"f")}async*[(ppe=new WeakMap,Lp=new WeakMap,hpe=new WeakMap,y9=new WeakMap,ype=new WeakMap,Ou=new WeakMap,L$=new WeakMap,dA=new WeakMap,F$=new WeakMap,$R=new WeakMap,M$=new WeakMap,Fx=new WeakMap,Epe=new WeakMap,E9=new WeakMap,mE=new WeakMap,kl=new WeakSet,Symbol.asyncIterator)](){if(xe(this,ppe,"f"))throw new gn("Cannot iterate over a consumed SessionToolRunner");Wt(this,ppe,!0,"f"),xe(this,Ou,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=xe(this,kl,"m",JLt).call(this).catch(n=>{xe(this,Lp,"f").signal.aborted||xe(this,Ou,"f").error("stream loop failed",{error:String(n)}),xe(this,Lp,"f").abort()});try{for(;;){let r=await xe(this,M$,"f").next(xe(this,Lp,"f").signal);if(r.done)break;yield r.value}await e;let n;for(;(n=xe(this,M$,"f").tryShift())!==void 0;)yield n}finally{xe(this,Lp,"f").abort(),xe(this,mE,"f").disarm(),await e;try{await xe(this,kl,"m",XLt).call(this)}catch(n){xe(this,Ou,"f").warn("drain failed",{error:String(n)})}xe(this,M$,"f").close();for(let n of this.tools)try{await n.close?.()}catch(r){xe(this,Ou,"f").warn("tool.close failed",{tool:u2e(n),error:String(r)})}xe(this,hpe,"f").call(this)}}};mpe=function(){return{...xe(this,y9,"f"),headers:gt([p9("session-tool-runner"),xe(this,y9,"f")?.headers]),signal:xe(this,Lp,"f").signal}},JLt=async function(){let e=xe(this,Lp,"f"),n=zLt;for(;!e.signal.aborted;){try{let r=await this.client.beta.sessions.events.stream(this.sessionId,{},xe(this,kl,"m",mpe).call(this));await xe(this,kl,"m",HLt).call(this);for await(let s of r)if(n=zLt,await xe(this,kl,"m",jLt).call(this,s))return}catch(r){if(e.signal.throwIfAborted(),FR(r))throw xe(this,Ou,"f").error("permanent stream failure, shutting down",{error:String(r)}),e.abort(),r;xe(this,Ou,"f").warn("stream disconnected, reconnecting",{error:String(r),backoff_ms:n})}e.signal.throwIfAborted(),await g_(n,e.signal),n=Math.min(n*2,tIr)}},HLt=async function(){let e=xe(this,Lp,"f"),n=[],r=!1;try{for await(let o of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},xe(this,kl,"m",mpe).call(this)))xe(this,kl,"m",VLt).call(this,o,n),r=ZLt(o)}catch(o){e.signal.throwIfAborted(),xe(this,Ou,"f").warn("reconcile list failed",{error:String(o)});for(let a of n)xe(this,L$,"f").delete(a.id);return}let s=n.filter(o=>!xe(this,dA,"f").has(o.id));xe(this,mE,"f").disarm();for(let o of s)await xe(this,kl,"m",d2e).call(this,o);for(let o of[...xe(this,$R,"f").values()]){let a=xe(this,F$,"f").get(o.id);a!==void 0&&await xe(this,kl,"m",fpe).call(this,o,a)}let i=s.filter(o=>!xe(this,dA,"f").has(o.id)&&!xe(this,$R,"f").has(o.id));r&&i.length===0?xe(this,mE,"f").arm():xe(this,mE,"f").disarm()},VLt=function(e,n){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(xe(this,L$,"f").add(e.id),xe(this,dA,"f").has(e.id)||n.push(e)):e.type==="user.tool_result"?xe(this,dA,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"?xe(this,dA,"f").add(e.custom_tool_use_id):e.type==="user.tool_confirmation"&&(xe(this,dA,"f").has(e.tool_use_id)||xe(this,F$,"f").set(e.tool_use_id,e.result))},jLt=async function(e){switch(xe(this,mE,"f").noteEvent(e),e.type){case"agent.tool_use":case"agent.custom_tool_use":return xe(this,L$,"f").has(e.id)||(xe(this,L$,"f").add(e.id),await xe(this,kl,"m",d2e).call(this,e)),!1;case"user.tool_confirmation":return await xe(this,kl,"m",YLt).call(this,e),!1;case"user.tool_result":return xe(this,dA,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return xe(this,dA,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return xe(this,Ou,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),xe(this,Lp,"f").abort(),!0;default:return!1}},d2e=async function(e){let n=e.evaluated_permission,r=n==="deny"?"deny":xe(this,F$,"f").get(e.id);if(r===void 0){n===void 0||n==="allow"?await xe(this,kl,"m",p2e).call(this,e,void 0):xe(this,$R,"f").has(e.id)||(xe(this,Ou,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),xe(this,$R,"f").set(e.id,e),xe(this,mE,"f").block(e.id));return}await xe(this,kl,"m",fpe).call(this,e,r)},YLt=async function(e){xe(this,F$,"f").set(e.tool_use_id,e.result);let n=xe(this,$R,"f").get(e.tool_use_id);n!==void 0&&await xe(this,kl,"m",fpe).call(this,n,e.result)},fpe=async function(e,n){let r=xe(this,$R,"f").delete(e.id);if(n==="allow"){xe(this,Ou,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),r||xe(this,mE,"f").block(e.id);try{await xe(this,kl,"m",p2e).call(this,e,"allow")}finally{xe(this,mE,"f").unblock(e.id)}return}r&&xe(this,mE,"f").unblock(e.id),xe(this,dA,"f").add(e.id),xe(this,Ou,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),xe(this,kl,"m",gpe).call(this,{event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1,confirmation:"deny"})},gpe=function(e){xe(this,M$,"f").push(e)},p2e=async function(e,n){var r,s;if(!xe(this,dA,"f").has(e.id)){xe(this,Ou,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Wt(this,Fx,(r=xe(this,Fx,"f"),r++,r),"f");try{let i=xe(this,ype,"f").get(e.name);if(!i){xe(this,Ou,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),xe(this,kl,"m",gpe).call(this,{event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1,confirmation:n});return}let o,a,c=new AbortController,u=LR(xe(this,Lp,"f").signal,c),l=setTimeout(()=>c.abort(),nIr);try{let m=await WLt(i,e.input,{toolUse:e,toolUseBlock:e,signal:c.signal});o=m.content,a=m.isError}finally{clearTimeout(l),u()}let d=cIr(e,a,lIr(o)),h=await xe(this,kl,"m",KLt).call(this,d,e.id);xe(this,kl,"m",gpe).call(this,{event:e,result:d,toolUseId:e.id,name:e.name,isError:a,posted:h,confirmation:n})}finally{Wt(this,Fx,(s=xe(this,Fx,"f"),s--,s),"f"),xe(this,Fx,"f")===0&&xe(this,E9,"f")?.call(this)}}},KLt=async function(e,n){let r=xe(this,Lp,"f"),s=Date.now(),i,o=0;for(;;){o++,r.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[e]},xe(this,kl,"m",mpe).call(this)),xe(this,dA,"f").add(n),!0}catch(a){if(i=a,FR(a))break;let c=xe(this,Epe,"f")-(Date.now()-s);if(c<=0)break;let u=Math.min(rpe(npe(o-1,sIr,iIr)),c);xe(this,Ou,"f").warn("tool result send failed; retrying",{tool_use_id:n,attempt:o,backoff_ms:u,error:String(a)}),await g_(u,r.signal)}}return xe(this,Ou,"f").error("failed to send tool result",{tool_use_id:n,attempts:o,error:String(i)}),!1},XLt=async function(){xe(this,Fx,"f")!==0&&(await Promise.race([new Promise(e=>Wt(this,E9,e,"f")),g_(rIr)]),Wt(this,E9,null,"f"),xe(this,Fx,"f")>0&&xe(this,Ou,"f").warn("drain timeout exceeded"))}});function _pe(t,e){if(!(t>=b9))throw new gn(`${e} must be at least ${b9}ms (got ${t}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`)}var _9,b9,Spe=V(()=>{p();Ra();_9=15e3,b9=5e3});var eFt=V(()=>{p();PUe()});function tP(t){if(t.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${t.name}" must be an object, but got ${t.inputSchema.type}`);return{type:"custom",name:t.name,input_schema:t.inputSchema,description:t.description,run:t.run,parse:e=>e,...t.close?{close:t.close}:{}}}var tFt=V(()=>{p();m2e();eFt()});function Q$(){let t,e;return{promise:new Promise((r,s)=>{t=r,e=s}),resolve:t,reject:e}}var f2e=V(()=>{p()});function Cpe(t,e){let n=hs.relative(t,e);return n===""||!n.startsWith(".."+hs.sep)&&n!==".."&&!hs.isAbsolute(n)}async function g2e(t,e){for(let n of t)if(Cpe(await S9(hs.resolve(n)),e))return n}function I9(t){let e=t?.code;return typeof e=="string"?e:void 0}async function S9(t){let e=[],n=t,r=0;for(;;){let s;try{s=await U$.realpath(n)}catch(i){let o;try{o=(await U$.lstat(n)).isSymbolicLink()}catch(a){let c=I9(a);if(c!=="ENOENT"&&c!=="ENOTDIR")throw a;let u=hs.dirname(n);if(u===n)throw a;e.push(hs.basename(n)),n=u;continue}if(!o)throw i;if(++r>dIr)throw Object.assign(new Error("too many levels of symbolic links"),{code:"ELOOP"});n=hs.resolve(hs.dirname(n),await U$.readlink(n));continue}return e.length?hs.join(s,...e.reverse()):s}}async function nFt(t,e,n){let r=n?.allowedRoots??[],s=await S9(hs.resolve(t)),i;try{i=await S9(hs.resolve(s,e))}catch(a){throw new ks($$(a,`path ${JSON.stringify(e)}`))}if(Cpe(s,i)||await g2e(r,i)!==void 0)return i;let o=r.length?"the session's working directory and its other permitted directories":"the session's working directory";throw new ks(`path ${JSON.stringify(e)} is outside ${o}`)}async function A2e(t,e){let n=hs.dirname(t),r=hs.join(n,`.tmp-${process.pid}-${BR.randomUUID()}`),s;try{s=await U$.open(r,"wx",uIr),await s.writeFile(e,"utf-8"),await s.sync(),await s.close(),s=void 0,await U$.rename(r,t)}catch(i){throw s&&await s.close().catch(()=>{}),await U$.unlink(r).catch(()=>{}),i}}function $$(t,e){let n=I9(t);switch(n){case"ENOENT":return`${e}: no such file or directory`;case"EACCES":case"EPERM":return`${e}: permission denied`;case"ENOTDIR":return`${e}: not a directory`;case"EISDIR":return`${e}: is a directory`;case"ELOOP":return`${e}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${e}: file name too long`;case"ENOSPC":return`${e}: no space left on device`;case"EMFILE":case"ENFILE":return`${e}: too many open files`;default:return`${e}: ${n!==void 0?`i/o error (${n})`:"i/o error"}`}}var U$,C9,uIr,dIr,y2e=V(()=>{p();Mf();ZB();U$=Ox.promises,C9=493,uIr=420;dIr=40});async function sFt(t){let{client:e,sessionId:n}=t;if(!e)return async()=>{};let r=Ji(e),s=t.session;if(!s){if(n===void 0)return async()=>{};r.warn("AgentToolContext.sessionId is deprecated and costs an extra session fetch; fetch the session once and set `session` instead",{component:"agent-tool-context"}),s=await e.beta.sessions.retrieve(n)}let i=hs.resolve(t.workdir,"skills"),o=[];for(let a of s.agent.skills)try{let c=await e.beta.skills.versions.retrieve(a.version,{skill_id:a.skill_id}),u=hs.basename(c.name.trim());(u===""||u==="."||u==="..")&&(u=a.skill_id);let l=hs.resolve(i,u);if(l!==i&&!l.startsWith(i+hs.sep)){r.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:c.name});continue}let d=await e.beta.skills.versions.download(c.id,{skill_id:a.skill_id});await fE.rm(l,{recursive:!0,force:!0}),await fE.mkdir(l,{recursive:!0,mode:C9}),o.push(l),await _2e(d,l),r.info("downloaded skill",{component:"agent-tool-context",skill_id:a.skill_id,version:c.id,dest:l})}catch(c){r.warn("failed to download skill",{component:"agent-tool-context",skill_id:a.skill_id,error:String(c)})}return async()=>{for(let a of o)await fE.rm(a,{recursive:!0,force:!0}).catch(c=>{r.warn("failed to clean up skill",{component:"agent-tool-context",dest:a,error:String(c)})})}}function hIr(t){for(let e of t){let n=e.trim();if(n&&(hs.isAbsolute(n)||n.split(/[\\/]/).includes("..")))throw new gn(`refusing to extract unsafe archive member: ${n}`)}}function rFt(t){let e=t.split(` -`);return e[e.length-1]===""&&e.pop(),e}function fIr(t,e){return/^[\x20-\x7E]+$/.test(e)&&!/[\\^#]/.test(e)&&!(t==="unzip"&&e.startsWith("-"))}function gIr(t,e,n){let r=rFt(e),s=rFt(n);if(r.length!==s.length)throw new gn(b2e);let i=[],o=[];return r.forEach((a,c)=>{if(mIr[t].has(s[c].charAt(0))){i.push(a);return}if(!fIr(t,a))throw new gn(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(a)}`);o.push(a)}),{plain:i,special:o}}async function iFt(t){for(let e of await fE.readdir(t,{withFileTypes:!0}))if(e.isDirectory())await iFt(hs.join(t,e.name));else if(!e.isFile())throw new gn(b2e)}async function E2e(t,e){try{let{stdout:n}=await pIr(t,e);return n}catch(n){throw I9(n)==="ENOENT"?new gn(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):n}}function AIr(t){let e,n=!1;for(let r of t){let s=r.trim().split("/").filter(o=>o!==""&&o!==".");if(s.length===0)continue;let i=s[0];if(e===void 0)e=i;else if(i!==e)return"";s.length>1&&(n=!0)}return e!==void 0&&n?e:""}async function _2e(t,e){let n=hs.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new gn("skill download response had no body");await Nde.promises.pipeline(Nde.Readable.fromWeb(t.body),Ox.createWriteStream(n));let r=hs.join(hs.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`),s=hs.join(hs.dirname(e),`.skill-exclude-${process.pid}-${Date.now()}`);try{let i=await EIr(n,4),o=i.length>=4&&i[0]===80&&i[1]===75&&i[2]===3&&i[3]===4,a=o?"unzip":"tar",c=await E2e(a,o?["-Z1",n]:["-tf",n]),u=await E2e(a,o?["-Z","--h","--t",n]:["-tvf",n]),{plain:l,special:d}=gIr(a,c,u);hIr([...l,...d]);let h=AIr(l);await fE.mkdir(r,{recursive:!0,mode:C9}),l.length>0&&await E2e(a,await yIr(a,n,r,d,s)),await iFt(r);let m=h?hs.join(r,h):r,f=await fE.readdir(m).catch(g=>{throw I9(g)==="ENOENT"?new gn(b2e):g});for(let g of f)await fE.rename(hs.join(m,g),hs.join(e,g))}finally{await fE.rm(n,{force:!0}),await fE.rm(s,{force:!0}),await fE.rm(r,{recursive:!0,force:!0})}}async function yIr(t,e,n,r,s){let i=r.map(o=>o.replace(/[*?[\\]/g,"\\$&"));return t==="unzip"?["-oq",e,"-d",n,...i.length>0?["-x",...i]:[]]:i.length===0?["-xf",e,"-C",n]:(await fE.writeFile(s,i.join(` +${d}`)}return o},wt=j6r(Z9t)});var UH,g4e=v(()=>{p();ui();zi();Ui();ms();UH=class extends _n{retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/deployment_runs/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",ur,{query:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}}});var GH,A4e=v(()=>{p();ui();zi();Ui();ms();GH=class extends _n{create(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/deployments?beta=true",{body:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/deployments/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}update(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/deployments/${e}?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/deployments?beta=true",ur,{query:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}archive(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/deployments/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}pause(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/deployments/${e}/pause?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}run(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/deployments/${e}/run?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}unpause(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/deployments/${e}/unpause?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}}});var $H,y4e=v(()=>{p();ui();zi();Ui();ms();$H=class extends _n{create(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/dreams?beta=true",{body:s,...n,headers:pt([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/dreams/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/dreams?beta=true",ur,{query:s,...n,headers:pt([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}archive(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/dreams/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}cancel(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/dreams/${e}/cancel?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}}});function CJ(t){return{[bB]:t}}function YAe(t){return typeof t=="object"&&t!==null&&SJ in t}function E4e(t,e){let n=new Set;if(t)for(let r of t)YAe(r)&&n.add(r[SJ]);if(e)for(let r of e){YAe(r)&&n.add(r[SJ]);let i=r.content;if(Array.isArray(i))for(let s of i)YAe(s)&&n.add(s[SJ])}return Array.from(n)}function KAe(t,e){let n=E4e(t,e);return n.length===0?{}:{[bB]:n.join(", ")}}function JAe(t){return YAe(t)?{[bB]:t[SJ]}:{}}var bB,zAe,SJ,px=v(()=>{p();bB="x-stainless-helper",zAe="x-stainless-helper-method";SJ=Symbol("anthropic.sdk.stainlessHelper")});var WH,b4e=v(()=>{p();ui();zi();Ui();px();iv();ms();WH=class extends _n{list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/files?beta=true",ur,{query:s,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.delete(wt`/v1/files/${e}?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}download(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/files/${e}/content?beta=true`,{...r,headers:pt([{Accept:"application/binary",...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__binaryResponse:!0})}retrieveMetadata(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/files/${e}?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}upload(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/files?beta=true",D0({body:s,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},JAe(s.file),n?.headers])},this._client))}}});var HH,_4e=v(()=>{p();ui();zi();Ui();ms();HH=class extends _n{retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/models/${e}?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/models?beta=true",wd,{query:s,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}}});var qH,x4e=v(()=>{p();ui();zi();Ui();ms();qH=class extends _n{create(e,n){let{betas:r,...i}=e;return this._client.post("/v1/user_profiles?beta=true",{body:i,...n,headers:pt([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}retrieve(e,n={},r){let{betas:i}=n??{};return this._client.get(wt`/v1/user_profiles/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},r?.headers])})}update(e,n,r){let{betas:i,...s}=n;return this._client.post(wt`/v1/user_profiles/${e}?beta=true`,{body:s,...r,headers:pt([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},r?.headers])})}list(e={},n){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",ur,{query:i,...n,headers:pt([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}createEnrollmentURL(e,n={},r){let{betas:i}=n??{};return this._client.post(wt`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},r?.headers])})}}});var n6t=re(ky=>{"use strict";p();var Z6r=ky&&ky.__extends||(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)i.hasOwnProperty(s)&&(r[s]=i[s])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(ky,"__esModule",{value:!0});var Td=256,S4e=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var n="",r=0;r>>18&63),n+=this._encodeByte(i>>>12&63),n+=this._encodeByte(i>>>6&63),n+=this._encodeByte(i>>>0&63)}var s=e.length-r;if(s>0){var i=e[r]<<16|(s===2?e[r+1]<<8:0);n+=this._encodeByte(i>>>18&63),n+=this._encodeByte(i>>>12&63),s===2?n+=this._encodeByte(i>>>6&63):n+=this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var n=this._getPaddingLength(e),r=e.length-n,i=new Uint8Array(this.maxDecodedLength(r)),s=0,o=0,a=0,c=0,u=0,l=0,d=0;o>>4,i[s++]=u<<4|l>>>2,i[s++]=l<<6|d,a|=c&Td,a|=u&Td,a|=l&Td,a|=d&Td;if(o>>4,a|=c&Td,a|=u&Td),o>>2,a|=l&Td),o>>8&6,n+=51-e>>>8&-75,n+=61-e>>>8&-15,n+=62-e>>>8&3,String.fromCharCode(n)},t.prototype._decodeChar=function(e){var n=Td;return n+=(42-e&e-44)>>>8&-Td+e-43+62,n+=(46-e&e-48)>>>8&-Td+e-47+63,n+=(47-e&e-58)>>>8&-Td+e-48+52,n+=(64-e&e-91)>>>8&-Td+e-65+0,n+=(96-e&e-123)>>>8&-Td+e-97+26,n},t.prototype._getPaddingLength=function(e){var n=0;if(this._paddingCharacter){for(var r=e.length-1;r>=0&&e[r]===this._paddingCharacter;r--)n++;if(e.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},t})();ky.Coder=S4e;var IJ=new S4e;function ezr(t){return IJ.encode(t)}ky.encode=ezr;function tzr(t){return IJ.decode(t)}ky.decode=tzr;var e6t=(function(t){Z6r(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._encodeByte=function(n){var r=n;return r+=65,r+=25-n>>>8&6,r+=51-n>>>8&-75,r+=61-n>>>8&-13,r+=62-n>>>8&49,String.fromCharCode(r)},e.prototype._decodeChar=function(n){var r=Td;return r+=(44-n&n-46)>>>8&-Td+n-45+62,r+=(94-n&n-96)>>>8&-Td+n-95+63,r+=(47-n&n-58)>>>8&-Td+n-48+52,r+=(64-n&n-91)>>>8&-Td+n-65+0,r+=(96-n&n-123)>>>8&-Td+n-97+26,r},e})(S4e);ky.URLSafeCoder=e6t;var t6t=new e6t;function nzr(t){return t6t.encode(t)}ky.encodeURLSafe=nzr;function rzr(t){return t6t.decode(t)}ky.decodeURLSafe=rzr;ky.encodedLength=function(t){return IJ.encodedLength(t)};ky.maxDecodedLength=function(t){return IJ.maxDecodedLength(t)};ky.decodedLength=function(t){return IJ.decodedLength(t)}});var i6t=re((r6t,XAe)=>{p();(function(t,e){var n={};e(n);var r=n.default;for(var i in n)r[i]=n[i];typeof XAe=="object"&&typeof XAe.exports=="object"?XAe.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):t.sha256=r})(r6t,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(d,m,h,f,g){for(var A,y,E,_,S,C,I,w,k,N,O,W,$;g>=64;){for(A=m[0],y=m[1],E=m[2],_=m[3],S=m[4],C=m[5],I=m[6],w=m[7],N=0;N<16;N++)O=f+N*4,d[N]=(h[O]&255)<<24|(h[O+1]&255)<<16|(h[O+2]&255)<<8|h[O+3]&255;for(N=16;N<64;N++)k=d[N-2],W=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,k=d[N-15],$=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,d[N]=(W+d[N-7]|0)+($+d[N-16]|0);for(N=0;N<64;N++)W=(((S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7))+(S&C^~S&I)|0)+(w+(e[N]+d[N]|0)|0)|0,$=((A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10))+(A&y^A&E^y&E)|0,w=I,I=C,C=S,S=_+W|0,_=E,E=y,y=A,A=W+$|0;m[0]+=A,m[1]+=y,m[2]+=E,m[3]+=_,m[4]+=S,m[5]+=C,m[6]+=I,m[7]+=w,f+=64,g-=64}return f}var r=(function(){function d(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var m=0;m0){for(;this.bufferLength<64&&h>0;)this.buffer[this.bufferLength++]=m[f++],h--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(h>=64&&(f=n(this.temp,this.state,m,f,h),h%=64);h>0;)this.buffer[this.bufferLength++]=m[f++],h--;return this},d.prototype.finish=function(m){if(!this.finished){var h=this.bytesHashed,f=this.bufferLength,g=h/536870912|0,A=h<<3,y=h%64<56?64:128;this.buffer[f]=128;for(var E=f+1;E>>24&255,this.buffer[y-7]=g>>>16&255,this.buffer[y-6]=g>>>8&255,this.buffer[y-5]=g>>>0&255,this.buffer[y-4]=A>>>24&255,this.buffer[y-3]=A>>>16&255,this.buffer[y-2]=A>>>8&255,this.buffer[y-1]=A>>>0&255,n(this.temp,this.state,this.buffer,0,y),this.finished=!0}for(var E=0;E<8;E++)m[E*4+0]=this.state[E]>>>24&255,m[E*4+1]=this.state[E]>>>16&255,m[E*4+2]=this.state[E]>>>8&255,m[E*4+3]=this.state[E]>>>0&255;return this},d.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},d.prototype._saveState=function(m){for(var h=0;hthis.blockSize)new r().update(m).finish(h).clean();else for(var f=0;f1&&m.update(d),h&&m.update(h),m.update(f),m.finish(d),f[0]++}var c=new Uint8Array(t.digestLength);function u(d,m,h,f){m===void 0&&(m=c),f===void 0&&(f=32);for(var g=new Uint8Array([1]),A=o(m,d),y=new i(A),E=new Uint8Array(y.digestLength),_=E.length,S=new Uint8Array(f),C=0;C>>24&255,y[1]=I>>>16&255,y[2]=I>>>8&255,y[3]=I>>>0&255,g.reset(),g.update(m),g.update(y),g.finish(_);for(var w=0;w{"use strict";p();Object.defineProperty(C4e,"__esModule",{value:!0});C4e.timingSafeEqual=izr;function s6t(t,e=""){if(!t)throw new Error(e)}function izr(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),s6t(t instanceof DataView),s6t(e instanceof DataView);let n=t.byteLength,r=0,i=-1;for(;++i{"use strict";p();Object.defineProperty(jH,"__esModule",{value:!0});jH.Webhook=jH.WebhookVerificationError=void 0;var a6t=n6t(),szr=i6t(),ozr=o6t(),c6t=300,I4e=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},_B=class t extends I4e{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};jH.WebhookVerificationError=_B;var ZAe=class t{constructor(e,n){if(n?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,r=>r.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=a6t.decode(e)}if(this.key.length===0)throw new Error("Secret can't be empty.")}verify(e,n,r){var i;let s=(i=r?.jsonParse)!==null&&i!==void 0?i:!0,o={};for(let g of Object.keys(n))o[g.toLowerCase()]=n[g];let a=o["webhook-id"],c=o["webhook-signature"],u=o["webhook-timestamp"];if(!c||!a||!u)throw new _B("Missing required headers");let l=this.verifyTimestamp(u),m=this.sign(a,l,e).split(",")[1],h=c.split(" "),f=new globalThis.TextEncoder;for(let g of h){let[A,y]=g.split(",");if(A==="v1"&&(0,ozr.timingSafeEqual)(f.encode(y),f.encode(m))){let E=e.toString();return E===""?void 0:s?JSON.parse(E):void 0}}throw new _B("No matching signature found")}sign(e,n,r){if(typeof r!="string")if(r.constructor.name==="Buffer")r=r.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,s=Math.floor(n.getTime()/1e3),o=i.encode(`${e}.${s}.${r}`);return`v1,${a6t.encode(szr.hmac(this.key,o))}`}verifyTimestamp(e){let n=Math.floor(Date.now()/1e3),r=parseInt(e,10);if(Number.isNaN(r))throw new _B("Invalid Signature Headers");if(n-r>c6t)throw new _B("Message timestamp too old");if(r>n+c6t)throw new _B("Message timestamp too new");return new Date(r*1e3)}};jH.Webhook=ZAe;ZAe.prefix="whsec_"});var u6t,VH,w4e=v(()=>{p();ui();u6t=Ot(l6t(),1),VH=class extends _n{parseUnverified(e){return JSON.parse(e)}unwrap(e,n){let r=n?.headers;if(r==null)throw new Error("Webhook headers are required in order to verify the signature");let i=n.key===void 0?this._client.webhookKey:n.key;if(!i)throw new Error("Webhook key must not be null or empty in order to unwrap");return new u6t.Webhook(i).verify(e,r),JSON.parse(e)}}});var YH,T4e=v(()=>{p();ui();zi();Ui();ms();YH=class extends _n{list(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.getAPIList(wt`/v1/agents/${e}/versions?beta=true`,ur,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}}});var ZO,v4e=v(()=>{p();ui();T4e();T4e();zi();Ui();ms();ZO=class extends _n{constructor(){super(...arguments),this.versions=new YH(this._client)}create(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/agents?beta=true",{body:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.get(wt`/v1/agents/${e}?beta=true`,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}update(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/agents/${e}?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/agents?beta=true",ur,{query:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}archive(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/agents/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}};ZO.Versions=YH});function xB(t,e){if(!t)return()=>{};if(t.aborted)return e.abort(),()=>{};let n=()=>e.abort();return t.addEventListener("abort",n),()=>t.removeEventListener("abort",n)}var eye=v(()=>{p()});function Hp(t,e){return t instanceof Hl&&t.status===e}function d6t(t){return t instanceof Hl&&typeof t.status=="number"&&t.status>=400&&t.status<500}function SB(t){return d6t(t)&&!Hp(t,408)&&!Hp(t,409)&&!Hp(t,429)}function tye(t,e,n){return Math.min(e*2**t,n)}function R4e(t,e){return t+Math.random()*(e-t)}function nye(t){return t*(1-Math.random()*.25)}var zH=v(()=>{p();tc()});function rye(t,{authToken:e,helper:n}){if(!e)throw new En(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(e)}`);let r=t,i=r._options.defaultHeaders,s=r._authState?.extraHeaders,o=s?Object.fromEntries(Object.entries(s).filter(([c])=>{let u=c.toLowerCase();return u!=="authorization"&&u!=="x-api-key"})):void 0,a=pt([o,i,{[bB]:n}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:a})}var k4e=v(()=>{p();tc();Ui();px()});function hzr(t){return tye(t,dzr,pzr)}function fzr(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${IH()}`:IH()}var KH,iye,P0,sye,oye,aye,wJ,TJ,JH,XH,cye,ZH,vJ,uzr,dzr,pzr,mzr,CB,B4e,lye=v(()=>{p();Mf();tc();dx();MH();CAe();eye();Ui();zH();k4e();zH();uzr=999,dzr=1e3,pzr=6e4,mzr=3e5,CB=class{constructor(e){KH.set(this,void 0),iye.set(this,!1),P0.set(this,void 0),sye.set(this,void 0),oye.set(this,void 0),aye.set(this,void 0),wJ.set(this,void 0),TJ.set(this,void 0),JH.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??fzr(),Ht(this,KH,rye(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),Ht(this,oye,e.autoStop??!0,"f"),Ht(this,aye,e.drain??!1,"f"),Ht(this,wJ,e.blockMs===void 0?uzr:e.blockMs,"f"),Ht(this,TJ,e.reclaimOlderThanMs??null,"f"),Ht(this,JH,e.requestOptions,"f"),Ht(this,P0,new AbortController,"f"),Ht(this,sye,xB(e.signal,Ce(this,P0,"f")),"f")}get signal(){return Ce(this,P0,"f").signal}abort(){Ce(this,P0,"f").abort()}async*[(KH=new WeakMap,iye=new WeakMap,P0=new WeakMap,sye=new WeakMap,oye=new WeakMap,aye=new WeakMap,wJ=new WeakMap,TJ=new WeakMap,JH=new WeakMap,Symbol.asyncIterator)](){if(Ce(this,iye,"f"))throw new En("Cannot iterate over a consumed WorkPoller");Ht(this,iye,!0,"f");let e=lo(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let n=new B4e(e,this.environmentId);try{let r=0;for(;!Ce(this,P0,"f").signal.aborted;){let i;try{i=await Ce(this,KH,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...Ce(this,wJ,"f")!==null?{block_ms:Ce(this,wJ,"f")}:{},...Ce(this,TJ,"f")!==null?{reclaim_older_than_ms:Ce(this,TJ,"f")}:{}},{headers:pt([Ce(this,JH,"f")?.headers]),signal:Ce(this,P0,"f").signal})}catch(s){if(Ce(this,P0,"f").signal.aborted)return;if(SB(s))throw e.error("poll failed permanently, stopping poller",{error:String(s)}),s;let o=nye(hzr(r));e.warn("poll failed, backing off",{error:String(s),backoff_ms:o}),r++,await lx(o,Ce(this,P0,"f").signal);continue}if(r=0,i==null){if(Ce(this,aye,"f"))return;n.onEmptyPoll(),await lx(R4e(1e3,3e3),Ce(this,P0,"f").signal);continue}n.onClaim(),e.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:i.id,work_type:i.data.type});try{await Ce(this,KH,"f").beta.environments.work.ack(i.id,{environment_id:i.environment_id},{headers:pt([Ce(this,JH,"f")?.headers]),signal:Ce(this,P0,"f").signal})}catch(s){e.error("ack failed",{work_id:i.id,error:String(s)});continue}try{yield i}finally{if(Ce(this,oye,"f"))try{await Ce(this,KH,"f").beta.environments.work.stop(i.id,{environment_id:i.environment_id},{headers:pt([Ce(this,JH,"f")?.headers])})}catch(s){Hp(s,409)||e.warn("stop failed",{work_id:i.id,error:String(s)})}}}}finally{Ce(this,sye,"f").call(this)}}};B4e=class{constructor(e,n){XH.set(this,void 0),cye.set(this,void 0),ZH.set(this,void 0),vJ.set(this,0),Ht(this,XH,e,"f"),Ht(this,cye,n,"f")}onEmptyPoll(){let e=Date.now(),n={component:"work-poller",environment_id:Ce(this,cye,"f")};Ce(this,ZH,"f")===void 0?(Ht(this,ZH,Ht(this,vJ,e,"f"),"f"),Ce(this,XH,"f").info("idle; polling for work",n)):e-Ce(this,vJ,"f")>=mzr?(Ht(this,vJ,e,"f"),Ce(this,XH,"f").info(`still polling; idle for ${Math.round((e-Ce(this,ZH,"f"))/1e3)}s`,n)):Ce(this,XH,"f").debug("poll returned no work",n)}onClaim(){Ht(this,ZH,void 0,"f")}};XH=new WeakMap,cye=new WeakMap,ZH=new WeakMap,vJ=new WeakMap});var eq,IB,tq,uye,p6t=v(()=>{p();Mf();uye=class{constructor(){eq.set(this,[]),IB.set(this,[]),tq.set(this,!1)}push(e){if(Ce(this,tq,"f"))return!1;let n=Ce(this,IB,"f").shift();return n?n({done:!1,value:e}):Ce(this,eq,"f").push(e),!0}close(){if(!Ce(this,tq,"f"))for(Ht(this,tq,!0,"f");Ce(this,IB,"f").length>0;)Ce(this,IB,"f").shift()({done:!0,value:void 0})}next(e){return Ce(this,eq,"f").length>0?Promise.resolve({done:!1,value:Ce(this,eq,"f").shift()}):Ce(this,tq,"f")||e?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(n=>{let r=s=>{e?.removeEventListener("abort",i),n(s)},i=()=>{let s=Ce(this,IB,"f").indexOf(r);s>=0&&Ce(this,IB,"f").splice(s,1),n({done:!0,value:void 0})};Ce(this,IB,"f").push(r),e?.addEventListener("abort",i,{once:!0})})}tryShift(){return Ce(this,eq,"f").shift()}};eq=new WeakMap,IB=new WeakMap,tq=new WeakMap});var Oi,eL=v(()=>{p();Oi=class extends Error{constructor(e){let n=typeof e=="string"?e:e.map(r=>r.type==="text"?r.text:`[${r.type}]`).join(" ");super(n),this.name="ToolError",this.content=e}}});function N4e(t){return"name"in t?t.name:"mcp_server_name"in t?t.mcp_server_name:t.type}function gzr(t){return t instanceof Oi?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function m6t(t,e,n){try{let r=t.parse?t.parse(e):e;return{content:await t.run(r,n),isError:!1}}catch(r){return{content:gzr(r),isError:!0}}}var h6t=v(()=>{p();eL()});function S6t(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function Czr(t,e,n){return t.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:t.id,is_error:e,content:n}:{type:"user.tool_result",tool_use_id:t.id,is_error:e,content:n}}function Izr(t){if(typeof t=="string")return[{type:"text",text:t||"(no output)"}];let e=t.map(n=>n.type==="text"?{type:"text",text:n.text||"(no output)"}:n.type==="image"||n.type==="document"?n:n.type==="search_result"?{type:"search_result",source:n.source,title:n.title,content:n.content.map(r=>({type:"text",text:r.text})),citations:{enabled:n.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(n)});return e.length>0?e:[{type:"text",text:"(no output)"}]}var RJ,gye,nq,tL,mx,_u,dye,Om,pye,kJ,Aye,vd,iq,By,sq,wB,rq,sv,yye,BJ,M0,mye,_6t,f6t,g6t,A6t,D4e,y6t,hye,fye,P4e,E6t,x6t,b6t,Azr,yzr,Ezr,bzr,_zr,xzr,Szr,M4e,TB,Eye=v(()=>{p();Mf();tc();dx();MH();zH();eye();p6t();Ui();px();h6t();b6t=500,Azr=1e4,yzr=12e4,Ezr=3e4,bzr=1e3,_zr=3e4,xzr=5*6e4,Szr=6e4;M4e=class{constructor(e,n){RJ.set(this,void 0),gye.set(this,void 0),nq.set(this,new Set),tL.set(this,!1),mx.set(this,void 0),Ht(this,RJ,e,"f"),Ht(this,gye,n,"f")}noteEvent(e){e.type!=="user.tool_confirmation"&&(S6t(e)?this.arm():this.disarm())}block(e){Ce(this,nq,"f").add(e),Ce(this,mx,"f")!==void 0&&(Ht(this,tL,!0,"f"),clearTimeout(Ce(this,mx,"f")),Ht(this,mx,void 0,"f"))}unblock(e){Ce(this,nq,"f").delete(e),Ce(this,nq,"f").size===0&&Ce(this,tL,"f")&&this.arm()}arm(){if(!(Ce(this,RJ,"f")<=0)){if(Ce(this,nq,"f").size>0){Ht(this,tL,!0,"f");return}Ht(this,tL,!1,"f"),Ce(this,mx,"f")!==void 0&&clearTimeout(Ce(this,mx,"f")),Ht(this,mx,setTimeout(Ce(this,gye,"f"),Ce(this,RJ,"f")),"f")}}disarm(){Ht(this,tL,!1,"f"),Ce(this,mx,"f")!==void 0&&(clearTimeout(Ce(this,mx,"f")),Ht(this,mx,void 0,"f"))}};RJ=new WeakMap,gye=new WeakMap,nq=new WeakMap,tL=new WeakMap,mx=new WeakMap;TB=class{constructor(e,n){_u.add(this),dye.set(this,!1),Om.set(this,void 0),pye.set(this,void 0),kJ.set(this,void 0),Aye.set(this,void 0),vd.set(this,void 0),iq.set(this,new Set),By.set(this,new Set),sq.set(this,new Map),wB.set(this,new Map),rq.set(this,new uye),sv.set(this,0),yye.set(this,xzr),BJ.set(this,null),M0.set(this,void 0),this.client=n.client,this.sessionId=e,this.tools=n.tools,this.maxIdleMs=n.maxIdleMs??Szr,Ht(this,vd,lo(n.client),"f"),Ht(this,Aye,new Map(n.tools.map(r=>[N4e(r),r])),"f"),Ht(this,Om,new AbortController,"f"),Ht(this,pye,xB(n.signal,Ce(this,Om,"f")),"f"),Ht(this,kJ,n.requestOptions,"f"),Ht(this,M0,new M4e(this.maxIdleMs,()=>{Ce(this,vd,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),Ce(this,Om,"f").abort()}),"f")}get signal(){return Ce(this,Om,"f").signal}abort(){Ce(this,Om,"f").abort()}_setSendRetryWindow(e){Ht(this,yye,e,"f")}async*[(dye=new WeakMap,Om=new WeakMap,pye=new WeakMap,kJ=new WeakMap,Aye=new WeakMap,vd=new WeakMap,iq=new WeakMap,By=new WeakMap,sq=new WeakMap,wB=new WeakMap,rq=new WeakMap,sv=new WeakMap,yye=new WeakMap,BJ=new WeakMap,M0=new WeakMap,_u=new WeakSet,Symbol.asyncIterator)](){if(Ce(this,dye,"f"))throw new En("Cannot iterate over a consumed SessionToolRunner");Ht(this,dye,!0,"f"),Ce(this,vd,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=Ce(this,_u,"m",_6t).call(this).catch(n=>{Ce(this,Om,"f").signal.aborted||Ce(this,vd,"f").error("stream loop failed",{error:String(n)}),Ce(this,Om,"f").abort()});try{for(;;){let r=await Ce(this,rq,"f").next(Ce(this,Om,"f").signal);if(r.done)break;yield r.value}await e;let n;for(;(n=Ce(this,rq,"f").tryShift())!==void 0;)yield n}finally{Ce(this,Om,"f").abort(),Ce(this,M0,"f").disarm(),await e;try{await Ce(this,_u,"m",x6t).call(this)}catch(n){Ce(this,vd,"f").warn("drain failed",{error:String(n)})}Ce(this,rq,"f").close();for(let n of this.tools)try{await n.close?.()}catch(r){Ce(this,vd,"f").warn("tool.close failed",{tool:N4e(n),error:String(r)})}Ce(this,pye,"f").call(this)}}};mye=function(){return{...Ce(this,kJ,"f"),headers:pt([CJ("session-tool-runner"),Ce(this,kJ,"f")?.headers]),signal:Ce(this,Om,"f").signal}},_6t=async function(){let e=Ce(this,Om,"f"),n=b6t;for(;!e.signal.aborted;){try{let r=await this.client.beta.sessions.events.stream(this.sessionId,{},Ce(this,_u,"m",mye).call(this));await Ce(this,_u,"m",f6t).call(this);for await(let i of r)if(n=b6t,await Ce(this,_u,"m",A6t).call(this,i))return}catch(r){if(e.signal.throwIfAborted(),SB(r))throw Ce(this,vd,"f").error("permanent stream failure, shutting down",{error:String(r)}),e.abort(),r;Ce(this,vd,"f").warn("stream disconnected, reconnecting",{error:String(r),backoff_ms:n})}e.signal.throwIfAborted(),await lx(n,e.signal),n=Math.min(n*2,Azr)}},f6t=async function(){let e=Ce(this,Om,"f"),n=[],r=!1;try{for await(let o of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},Ce(this,_u,"m",mye).call(this)))Ce(this,_u,"m",g6t).call(this,o,n),r=S6t(o)}catch(o){e.signal.throwIfAborted(),Ce(this,vd,"f").warn("reconcile list failed",{error:String(o)});for(let a of n)Ce(this,iq,"f").delete(a.id);return}let i=n.filter(o=>!Ce(this,By,"f").has(o.id));Ce(this,M0,"f").disarm();for(let o of i)await Ce(this,_u,"m",D4e).call(this,o);for(let o of[...Ce(this,wB,"f").values()]){let a=Ce(this,sq,"f").get(o.id);a!==void 0&&await Ce(this,_u,"m",hye).call(this,o,a)}let s=i.filter(o=>!Ce(this,By,"f").has(o.id)&&!Ce(this,wB,"f").has(o.id));r&&s.length===0?Ce(this,M0,"f").arm():Ce(this,M0,"f").disarm()},g6t=function(e,n){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(Ce(this,iq,"f").add(e.id),Ce(this,By,"f").has(e.id)||n.push(e)):e.type==="user.tool_result"?Ce(this,By,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"?Ce(this,By,"f").add(e.custom_tool_use_id):e.type==="user.tool_confirmation"&&(Ce(this,By,"f").has(e.tool_use_id)||Ce(this,sq,"f").set(e.tool_use_id,e.result))},A6t=async function(e){switch(Ce(this,M0,"f").noteEvent(e),e.type){case"agent.tool_use":case"agent.custom_tool_use":return Ce(this,iq,"f").has(e.id)||(Ce(this,iq,"f").add(e.id),await Ce(this,_u,"m",D4e).call(this,e)),!1;case"user.tool_confirmation":return await Ce(this,_u,"m",y6t).call(this,e),!1;case"user.tool_result":return Ce(this,By,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return Ce(this,By,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return Ce(this,vd,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),Ce(this,Om,"f").abort(),!0;default:return!1}},D4e=async function(e){let n=e.evaluated_permission,r=n==="deny"?"deny":Ce(this,sq,"f").get(e.id);if(r===void 0){n===void 0||n==="allow"?await Ce(this,_u,"m",P4e).call(this,e,void 0):Ce(this,wB,"f").has(e.id)||(Ce(this,vd,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Ce(this,wB,"f").set(e.id,e),Ce(this,M0,"f").block(e.id));return}await Ce(this,_u,"m",hye).call(this,e,r)},y6t=async function(e){Ce(this,sq,"f").set(e.tool_use_id,e.result);let n=Ce(this,wB,"f").get(e.tool_use_id);n!==void 0&&await Ce(this,_u,"m",hye).call(this,n,e.result)},hye=async function(e,n){let r=Ce(this,wB,"f").delete(e.id);if(n==="allow"){Ce(this,vd,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),r||Ce(this,M0,"f").block(e.id);try{await Ce(this,_u,"m",P4e).call(this,e,"allow")}finally{Ce(this,M0,"f").unblock(e.id)}return}r&&Ce(this,M0,"f").unblock(e.id),Ce(this,By,"f").add(e.id),Ce(this,vd,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Ce(this,_u,"m",fye).call(this,{event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1,confirmation:"deny"})},fye=function(e){Ce(this,rq,"f").push(e)},P4e=async function(e,n){var r,i;if(!Ce(this,By,"f").has(e.id)){Ce(this,vd,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Ht(this,sv,(r=Ce(this,sv,"f"),r++,r),"f");try{let s=Ce(this,Aye,"f").get(e.name);if(!s){Ce(this,vd,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Ce(this,_u,"m",fye).call(this,{event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1,confirmation:n});return}let o,a,c=new AbortController,u=xB(Ce(this,Om,"f").signal,c),l=setTimeout(()=>c.abort(),yzr);try{let h=await m6t(s,e.input,{toolUse:e,toolUseBlock:e,signal:c.signal});o=h.content,a=h.isError}finally{clearTimeout(l),u()}let d=Czr(e,a,Izr(o)),m=await Ce(this,_u,"m",E6t).call(this,d,e.id);Ce(this,_u,"m",fye).call(this,{event:e,result:d,toolUseId:e.id,name:e.name,isError:a,posted:m,confirmation:n})}finally{Ht(this,sv,(i=Ce(this,sv,"f"),i--,i),"f"),Ce(this,sv,"f")===0&&Ce(this,BJ,"f")?.call(this)}}},E6t=async function(e,n){let r=Ce(this,Om,"f"),i=Date.now(),s,o=0;for(;;){o++,r.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[e]},Ce(this,_u,"m",mye).call(this)),Ce(this,By,"f").add(n),!0}catch(a){if(s=a,SB(a))break;let c=Ce(this,yye,"f")-(Date.now()-i);if(c<=0)break;let u=Math.min(nye(tye(o-1,bzr,_zr)),c);Ce(this,vd,"f").warn("tool result send failed; retrying",{tool_use_id:n,attempt:o,backoff_ms:u,error:String(a)}),await lx(u,r.signal)}}return Ce(this,vd,"f").error("failed to send tool result",{tool_use_id:n,attempts:o,error:String(s)}),!1},x6t=async function(){Ce(this,sv,"f")!==0&&(await Promise.race([new Promise(e=>Ht(this,BJ,e,"f")),lx(Ezr)]),Ht(this,BJ,null,"f"),Ce(this,sv,"f")>0&&Ce(this,vd,"f").warn("drain timeout exceeded"))}});function bye(t,e){if(!(t>=NJ))throw new En(`${e} must be at least ${NJ}ms (got ${t}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`)}var DJ,NJ,_ye=v(()=>{p();tc();DJ=15e3,NJ=5e3});var C6t=v(()=>{p();n4e()});function nL(t){if(t.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${t.name}" must be an object, but got ${t.inputSchema.type}`);return{type:"custom",name:t.name,input_schema:t.inputSchema,description:t.description,run:t.run,parse:e=>e,...t.close?{close:t.close}:{}}}var I6t=v(()=>{p();O4e();C6t()});function oq(){let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}var L4e=v(()=>{p()});function xye(t,e){let n=gi.relative(t,e);return n===""||!n.startsWith(".."+gi.sep)&&n!==".."&&!gi.isAbsolute(n)}async function F4e(t,e){for(let n of t)if(xye(await PJ(gi.resolve(n)),e))return n}function OJ(t){let e=t?.code;return typeof e=="string"?e:void 0}async function PJ(t){let e=[],n=t,r=0;for(;;){let i;try{i=await rL.realpath(n)}catch(s){let o;try{o=(await rL.lstat(n)).isSymbolicLink()}catch(a){let c=OJ(a);if(c!=="ENOENT"&&c!=="ENOTDIR")throw a;let u=gi.dirname(n);if(u===n)throw a;e.push(gi.basename(n)),n=u;continue}if(!o)throw s;if(++r>Tzr)throw Object.assign(new Error("too many levels of symbolic links"),{code:"ELOOP"});n=gi.resolve(gi.dirname(n),await rL.readlink(n));continue}return e.length?gi.join(i,...e.reverse()):i}}async function w6t(t,e,n){let r=n?.allowedRoots??[],i=await PJ(gi.resolve(t)),s;try{s=await PJ(gi.resolve(i,e))}catch(a){throw new Oi(aq(a,`path ${JSON.stringify(e)}`))}if(xye(i,s)||await F4e(r,s)!==void 0)return s;let o=r.length?"the session's working directory and its other permitted directories":"the session's working directory";throw new Oi(`path ${JSON.stringify(e)} is outside ${o}`)}async function Q4e(t,e){let n=gi.dirname(t),r=gi.join(n,`.tmp-${process.pid}-${yB.randomUUID()}`),i=await rL.stat(t).then(o=>o.mode&511,()=>{}),s;try{s=await rL.open(r,"wx",wzr),i!==void 0&&await s.chmod(i),await s.writeFile(e,"utf-8"),await s.sync(),await s.close(),s=void 0,await rL.rename(r,t)}catch(o){throw s&&await s.close().catch(()=>{}),await rL.unlink(r).catch(()=>{}),o}}function aq(t,e){let n=OJ(t);switch(n){case"ENOENT":return`${e}: no such file or directory`;case"EACCES":case"EPERM":return`${e}: permission denied`;case"ENOTDIR":return`${e}: not a directory`;case"EISDIR":return`${e}: is a directory`;case"ELOOP":return`${e}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${e}: file name too long`;case"ENOSPC":return`${e}: no space left on device`;case"EMFILE":case"ENFILE":return`${e}: too many open files`;default:return`${e}: ${n!==void 0?`i/o error (${n})`:"i/o error"}`}}var rL,MJ,wzr,Tzr,U4e=v(()=>{p();nA();eL();rL=nv.promises,MJ=448,wzr=384;Tzr=40});async function v6t(t){let{client:e,sessionId:n}=t;if(!e)return async()=>{};let r=lo(e),i=t.session;if(!i){if(n===void 0)return async()=>{};r.warn("AgentToolContext.sessionId is deprecated and costs an extra session fetch; fetch the session once and set `session` instead",{component:"agent-tool-context"}),i=await e.beta.sessions.retrieve(n)}let s=gi.resolve(t.workdir,"skills"),o=[];for(let a of i.agent.skills)try{let c=await e.beta.skills.versions.retrieve(a.version,{skill_id:a.skill_id}),u=gi.basename(c.name.trim());(u===""||u==="."||u==="..")&&(u=a.skill_id);let l=gi.resolve(s,u);if(l!==s&&!l.startsWith(s+gi.sep)){r.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:c.name});continue}let d=await e.beta.skills.versions.download(c.id,{skill_id:a.skill_id});await O0.rm(l,{recursive:!0,force:!0}),await O0.mkdir(l,{recursive:!0,mode:MJ}),o.push(l),await W4e(d,l),r.info("downloaded skill",{component:"agent-tool-context",skill_id:a.skill_id,version:c.id,dest:l})}catch(c){r.warn("failed to download skill",{component:"agent-tool-context",skill_id:a.skill_id,error:String(c)})}return async()=>{for(let a of o)await O0.rm(a,{recursive:!0,force:!0}).catch(c=>{r.warn("failed to clean up skill",{component:"agent-tool-context",dest:a,error:String(c)})})}}function Rzr(t){for(let e of t){let n=e.trim();if(n&&(gi.isAbsolute(n)||n.split(/[\\/]/).includes("..")))throw new En(`refusing to extract unsafe archive member: ${n}`)}}function T6t(t){let e=t.split(` +`);return e[e.length-1]===""&&e.pop(),e}function Bzr(t,e){return/^[\x20-\x7E]+$/.test(e)&&!/[\\^#]/.test(e)&&!(t==="unzip"&&e.startsWith("-"))}function Nzr(t,e,n){let r=T6t(e),i=T6t(n);if(r.length!==i.length)throw new En($4e);let s=[],o=[];return r.forEach((a,c)=>{if(kzr[t].has(i[c].charAt(0))){s.push(a);return}if(!Bzr(t,a))throw new En(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(a)}`);o.push(a)}),{plain:s,special:o}}async function R6t(t){for(let e of await O0.readdir(t,{withFileTypes:!0}))if(e.isDirectory())await R6t(gi.join(t,e.name));else if(!e.isFile())throw new En($4e)}async function G4e(t,e){try{let{stdout:n}=await vzr(t,e);return n}catch(n){throw OJ(n)==="ENOENT"?new En(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):n}}function Dzr(t){let e,n=!1;for(let r of t){let i=r.trim().split("/").filter(o=>o!==""&&o!==".");if(i.length===0)continue;let s=i[0];if(e===void 0)e=s;else if(s!==e)return"";i.length>1&&(n=!0)}return e!==void 0&&n?e:""}async function W4e(t,e){let n=gi.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new En("skill download response had no body");await kAe.promises.pipeline(kAe.Readable.fromWeb(t.body),nv.createWriteStream(n));let r=gi.join(gi.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`),i=gi.join(gi.dirname(e),`.skill-exclude-${process.pid}-${Date.now()}`);try{let s=await Mzr(n,4),o=s.length>=4&&s[0]===80&&s[1]===75&&s[2]===3&&s[3]===4,a=o?"unzip":"tar",c=await G4e(a,o?["-Z1",n]:["-tf",n]),u=await G4e(a,o?["-Z","--h","--t",n]:["-tvf",n]),{plain:l,special:d}=Nzr(a,c,u);Rzr([...l,...d]);let m=Dzr(l);await O0.mkdir(r,{recursive:!0,mode:MJ}),l.length>0&&await G4e(a,await Pzr(a,n,r,d,i)),await R6t(r);let h=m?gi.join(r,m):r,f=await O0.readdir(h).catch(g=>{throw OJ(g)==="ENOENT"?new En($4e):g});for(let g of f)await O0.rename(gi.join(h,g),gi.join(e,g))}finally{await O0.rm(n,{force:!0}),await O0.rm(i,{force:!0}),await O0.rm(r,{recursive:!0,force:!0})}}async function Pzr(t,e,n,r,i){let s=r.map(o=>o.replace(/[*?[\\]/g,"\\$&"));return t==="unzip"?["-oq",e,"-d",n,...s.length>0?["-x",...s]:[]]:s.length===0?["-xf",e,"-C",n]:(await O0.writeFile(i,s.join(` `)+` -`,{flag:"wx",mode:384}),["-xf",e,"-C",n,"-X",s])}async function EIr(t,e){let n=await fE.open(t,"r");try{let r=Buffer.alloc(e),{bytesRead:s}=await n.read(r,0,e,0);return r.subarray(0,s)}finally{await n.close()}}var fE,pIr,b2e,mIr,oFt=V(()=>{p();Mf();Ra();y_();y2e();fE=Ox.promises,pIr=RUe.promisify(vUe.execFile);b2e="skill archive listing is inconsistent; refusing to extract",mIr={unzip:new Set(["-","d","?"]),tar:new Set(["-","d","C"])}});function C2e(t){return t.startsWith("/")&&!t.split("/").includes("..")}function CIr(){return S2e!==0}async function IIr(t){let e=[],n=t;for(;;){try{await ud.stat(n);break}catch(s){let i=s.code;if(i!=="ENOENT"&&i!=="ENOTDIR"&&i!=="ELOOP")throw s}e.push(n);let r=hs.dirname(n);if(r===n)break;n=r}for(let r of e.reverse())try{await ud.mkdir(r,{mode:uFt})}catch(s){if(s.code!=="EEXIST")throw s}}async function aFt(t,e){let n=hs.relative(t,e);if(n==="")return;let r=t;for(let s of n.split(hs.sep)){r=hs.join(r,s);try{await ud.mkdir(r,{mode:uFt})}catch(i){if(i.code!=="EEXIST")throw i}}}async function xIr(t,e,n){let r=n?_Ir:bIr,s=hs.join(hs.dirname(t),`.fs-${BR.randomBytes(8).toString("hex")}.tmp`),i;try{i=await ud.open(s,G$.O_WRONLY|G$.O_CREAT|G$.O_EXCL|S2e,r),await i.writeFile(e),await i.close(),i=void 0,await ud.rename(s,t)}catch(o){throw i&&await i.close().catch(()=>{}),await ud.unlink(s).catch(()=>{}),o}}async function dFt(t,e){let n;try{n=await ud.open(e,G$.O_RDONLY|S2e|SIr)}catch(r){let s=r.code;throw s==="ELOOP"||s==="EMLINK"?new oo(oo.IS_A_SYMLINK,t):r}try{if(!(await n.stat()).isFile())throw new oo(oo.NOT_A_FILE,t)}catch(r){throw await n.close().catch(()=>{}),r}return n}async function wIr(t){let e=BR.createHash("sha256"),n=await dFt(hs.basename(t),t),r=new Uint8Array(1024*1024);try{for(;;){let{bytesRead:s}=await n.read(r,0,r.length);if(s===0)break;e.update(r.subarray(0,s))}}finally{await n.close()}return e.digest("hex")}async function cFt(t,e,n){if(!await vIr(e,n))return[];let r=[];return await pFt(n,(s,i)=>{i.isFile()&&r.push([hs.relative(t,s).split(hs.sep).join("/"),s])}),r.sort(),r}async function TIr(t,e,n){let r=o=>hs.relative(t,o).split(hs.sep).join("/"),s;try{s=await ud.lstat(n,{bigint:!0})}catch(o){let a=o.code;if(a==="ENOENT"||a==="ENOTDIR")return new Set;throw o}if(s.isSymbolicLink())return new Set([r(n)]);if(!s.isDirectory())throw new oo(oo.NOT_A_DIRECTORY,e);let i=new Set;return await pFt(n,(o,a)=>{a.isSymbolicLink()&&i.add(r(o))}),i}async function vIr(t,e){let n;try{n=await ud.lstat(e,{bigint:!0})}catch(r){let s=r.code;if(s==="ENOENT"||s==="ENOTDIR")return!1;throw r}if(!n.isDirectory())throw new oo(oo.NOT_A_DIRECTORY,t);return!0}async function pFt(t,e){let n=[t];for(;n.length;){let r=n.pop(),s;try{s=await ud.readdir(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")continue;throw i}for(let i of s){let o=hs.join(r,i.name);e(o,i),i.isDirectory()&&!i.isSymbolicLink()&&n.push(o)}}}function RIr(t,e){return e.mtimeNs===t.mtimeNs&&e.ctimeNs===t.ctimeNs&&e.size===t.size}function kIr(t,e){return(t.mtimeNs>t.ctimeNs?t.mtimeNs:t.ctimeNs){p();Mf();KB();ud=Ox.promises,G$=Ox.constants,uFt=448,bIr=384,_Ir=448,S2e=G$.O_NOFOLLOW??0,SIr=G$.O_NONBLOCK??0,oo=class extends Error{constructor(e,n){super(`path ${JSON.stringify(n)} ${e}`),this.name="FileStoreError",this.reason=e,this.relPath=n}};oo.ESCAPES_ROOT="escapes the store root";oo.IS_A_SYMLINK="is a symlink";oo.NOT_A_FILE="is not a regular file";oo.NOT_A_DIRECTORY="is not a directory";oo.NOT_UTF8="is not valid utf-8";oo.MOVE_DESTINATION_EXISTS="already exists";W$=class t{constructor(e,n,r=!1){this.hashes=new Map,this.rootPath=e,this.removedOnDispose=n,this.decoder=r?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(e,n){if(!CIr())throw new Error("FileStore requires O_NOFOLLOW support on this platform");let r=!1;try{await ud.lstat(e)}catch(s){if(s.code!=="ENOENT")throw s;r=!0}return new t(hs.resolve(e),r,n?.utf8??!1)}async createRoot(){await IIr(this.rootPath)}root(){return{path:this.rootPath,removedOnDispose:this.removedOnDispose}}async dispose(){this.removedOnDispose&&await ud.rm(this.rootPath,{recursive:!0,force:!0})}async put(e,n,r){let s=e.replace(/\\/g,"/");if(s.endsWith("/")||s.endsWith("/.")||s===""||s===".")throw new oo(oo.NOT_A_FILE,e);let i=this.resolveUnderRoot(e),o=typeof n=="string"?PR(n):n;this.requireUtf8(e,o),await aFt(this.rootPath,hs.dirname(i)),await xIr(i,o,r?.executable??!1)}async get(e){let n=this.resolveUnderRoot(e),r;try{r=await dFt(e,n)}catch(i){if(i.code==="ENOENT")return null;throw i}let s;try{let i=await r.readFile();s=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}finally{await r.close()}return this.requireUtf8(e,s),s}async ls(e="/"){let n=this.resolveUnderRoot(e);return new Set((await cFt(this.rootPath,e,n)).map(([r])=>r))}async findSymlinks(e="/"){let n=this.resolveUnderRoot(e);return TIr(this.rootPath,e,n)}async hashtree(e="/"){let n=this.resolveUnderRoot(e),r=Ipe.nowNs(),s=Object.create(null);for(let[i,o]of await cFt(this.rootPath,e,n)){let a=await this.hashViaCache(i,o,r);a!==null&&(s[i]=a)}return s}async hashFile(e){let n=this.resolveUnderRoot(e),r;try{r=await ud.lstat(n,{bigint:!0})}catch(i){if(i.code==="ENOENT")return null;throw i}if(r.isSymbolicLink())throw new oo(oo.IS_A_SYMLINK,e);if(!r.isFile())throw new oo(oo.NOT_A_FILE,e);let s=hs.relative(this.rootPath,n).split(hs.sep).join("/");return this.hashViaCache(s,n,Ipe.nowNs())}async move(e,n){let r=this.resolveUnderRoot(e),s=this.resolveUnderRoot(n);if(r===this.rootPath||s===this.rootPath)return;if(await ud.stat(s).then(()=>!0,()=>!1))throw new oo(oo.MOVE_DESTINATION_EXISTS,n);await aFt(this.rootPath,hs.dirname(s)),await ud.rename(r,s)}async remove(e){let n=this.resolveUnderRoot(e);if(n===this.rootPath)return;let r;try{r=await ud.lstat(n,{bigint:!0})}catch(s){if(s.code==="ENOENT")return;throw s}if(r.isDirectory())await ud.rm(n,{recursive:!0,force:!0});else try{await ud.unlink(n)}catch(s){if(s.code!=="ENOENT")throw s}}resolveUnderRoot(e){let n=e.replace(/\\/g,"/").replace(/^\/+/,""),r=n.split("/").filter(s=>s!==""&&s!==".");if(hs.posix.isAbsolute(n)||r.includes(".."))throw new oo(oo.ESCAPES_ROOT,e);return r.length===0?this.rootPath:hs.join(this.rootPath,...r)}requireUtf8(e,n){if(this.decoder)try{this.decoder.decode(n)}catch{throw new oo(oo.NOT_UTF8,e)}}async hashViaCache(e,n,r){let s;try{s=await ud.lstat(n,{bigint:!0})}catch(a){if(a.code==="ENOENT")return null;throw a}if(!s.isFile())return null;let i=this.hashes.get(e),o;if(i!==void 0&&RIr(i,s))o=i.sha;else try{o=await Ipe.hashFile(n)}catch(a){let c=a.code;if(c==="ENOENT"||a instanceof oo||c==="ELOOP"||c==="EMLINK")return null;throw a}return kIr(s,r)&&this.hashes.set(e,{mtimeNs:s.mtimeNs,ctimeNs:s.ctimeNs,size:s.size,sha:o}),o}};W$.isPathLegal=C2e;NIr=2000000000n,Ipe={hashFile:wIr,timestampTrustMarginNs:NIr,nowNs:()=>BigInt(Date.now())*1000000n},hFt=W$,lFt=Symbol.asyncDispose;lFt&&Object.defineProperty(W$.prototype,lFt,{value:W$.prototype.dispose,configurable:!0,writable:!0})});function _Ft(t){return BR.createHash("sha256").update(`version ${wFt} -${t}`,"utf-8").digest("hex")}function H$(t){return typeof t=="object"&&t!==null&&typeof t.code=="string"}async function QIr(t,e){if(!e){await t;return}let n,r=new Promise(s=>{n=s,e.aborted&&s()});e.addEventListener("abort",n,{once:!0});try{await Promise.race([t,r])}finally{e.removeEventListener("abort",n)}}var ka,qR,Rpe,x9,kpe,qo,q$,Tpe,WR,SFt,vpe,CFt,IFt,I2e,w2e,fFt,gFt,x2e,AFt,yFt,xpe,wpe,EFt,bFt,xFt,nP,wFt,DIr,BIr,PIr,OIr,MIr,LIr,FIr,Qx,T2e,Npe,TFt=V(()=>{p();Em();Mf();Ra();y_();KB();v$();mFt();Spe();Spe();xFt=3e4,nP=".anthropic-memory-store",wFt=1;DIr=3e4,BIr=100,PIr=20,OIr=16,MIr=32,LIr=8,FIr=50,Qx=class extends gn{constructor(e,n){super(e),this.name="SessionMemoryError",n!==void 0&&(this.cause=n)}},T2e=class{constructor(e,n,r){this.mode=e,this.cap=n,this.waiveWindow=r,this.attempted=0,this.capped=0,this.suppressed=0}takeSlot(){return this.attempted>=this.cap?(this.capped++,!1):(this.attempted++,!0)}},Npe=class{constructor(e,n){ka.add(this),qR.set(this,void 0),Rpe.set(this,void 0),x9.set(this,void 0),kpe.set(this,void 0),qo.set(this,void 0),q$.set(this,void 0),Tpe.set(this,!1),WR.set(this,[]),Wt(this,qR,e,"f"),Wt(this,Rpe,n.workdir,"f"),Wt(this,x9,n.syncIntervalMs??_9,"f"),_pe(xe(this,x9,"f"),"syncIntervalMs"),Wt(this,kpe,n.syncDeletions??"enabled","f"),Wt(this,qo,Ji(e),"f"),Wt(this,q$,Date.now(),"f")}get roots(){return xe(this,WR,"f").map(e=>e.files.root().path)}get readOnlyRoots(){return xe(this,WR,"f").filter(e=>e.readOnly).map(e=>e.files.root().path)}async download(e){for(let n of e.resources){if(n.type!=="memory_store")continue;let r=xe(this,ka,"m",SFt).call(this,n),s;try{if(s={memoryStoreId:n.memory_store_id,files:await hFt.open(r,{utf8:!0}),readOnly:n.access==="read_only",baseline:new Map,refusedShas:new Map,pendingDeletes:new Map},!s.files.root().removedOnDispose)throw new Qx(`something already exists at the memory store's path: ${r} (memory_store_id=${n.memory_store_id}); it must not exist when the session starts`);try{await s.files.createRoot()}catch(i){throw H$(i)?new Qx(`cannot create the memory store's folder: ${r} (memory_store_id=${n.memory_store_id}): ${i}; the worker host must make this mount path writable`,i):i}await xe(this,ka,"m",w2e).call(this,s),xe(this,qo,"f").info("downloaded memories",{count:s.baseline.size,memory_store_id:s.memoryStoreId,dest:s.files.root().path}),xe(this,WR,"f").push(s)}catch(i){throw s&&await s.files.dispose().catch(()=>{}),i instanceof Qx?i:new Qx(`failed to download memory store memory_store_id=${n.memory_store_id}: ${i}`,i)}}Wt(this,q$,Date.now(),"f")}async finish(){if(xe(this,Tpe,"f"))throw new gn("finish() was already called: it is the session's last sync and runs once");Wt(this,Tpe,!0,"f"),await this.syncAll(!0)}async syncAll(e){await Promise.all(xe(this,WR,"f").map(n=>xe(this,ka,"m",CFt).call(this,n,e))),Wt(this,q$,Date.now(),"f")}async syncIfDue(){Date.now()-xe(this,q$,"f")xe(this,ka,"m",IFt).call(this,n,e)))}async dispose(){for(let e of xe(this,WR,"f")){let n=e.files.root();try{let r=await xe(this,ka,"m",vpe).call(this,e);if(!r.markerOk&&Object.keys(r.files).length>0){xe(this,qo,"f").warn(`${r.distrustReason}; leaving the memory store folder on disk`,{root:n.path,memory_store_id:e.memoryStoreId});continue}await e.files.dispose()}catch(r){if(!(r instanceof oo)&&!H$(r))throw r;xe(this,qo,"f").warn("failed to remove the memory store folder",{root:e.files.root().path,memory_store_id:e.memoryStoreId,error:String(r)});continue}n.removedOnDispose&&xe(this,qo,"f").info("removed memory store dir",{dest:n.path,memory_store_id:e.memoryStoreId})}}};qR=new WeakMap,Rpe=new WeakMap,x9=new WeakMap,kpe=new WeakMap,qo=new WeakMap,q$=new WeakMap,Tpe=new WeakMap,WR=new WeakMap,ka=new WeakSet,SFt=function(e){if(e.mount_path){if(!C2e(e.mount_path))throw new Qx(`memory store mount_path is not a clean absolute path: ${JSON.stringify(e.mount_path)} (memory_store_id=${e.memory_store_id})`);return e.mount_path}return hs.join(xe(this,Rpe,"f"),"memory",e.name||e.memory_store_id)},vpe=async function(e){let n=await e.files.hashtree(),r=n[nP];return delete n[nP],r===_Ft(e.memoryStoreId)?{files:n,markerOk:!0,distrustReason:null}:{files:n,markerOk:!1,distrustReason:r!==void 0?"the marker file does not match this store":"the marker file is gone"}},CFt=async function(e,n){try{let r=await xe(this,ka,"m",vpe).call(this,e),s=r.files;if(!r.markerOk){if(Object.keys(s).length>0){xe(this,qo,"f").warn(`${r.distrustReason}; leaving the memory store folder as found and not syncing`,{root:e.files.root().path,memory_store_id:e.memoryStoreId});return}await xe(this,ka,"m",I2e).call(this,e,"the folder or its marker is gone");return}if(Object.keys(s).length===0&&e.baseline.size>1){await xe(this,ka,"m",I2e).call(this,e,"every memory file is gone at once");return}let i=new Map;for await(let[l,d]of xe(this,ka,"m",xpe).call(this,e.memoryStoreId))i.set(l,d);let o=new T2e(xe(this,kpe,"f"),Math.max(LIr,Math.min(FIr,Math.floor(e.baseline.size/4))),n),a=[],c=new Map,u=[...new Set([...i.keys(),...Object.keys(s),...e.baseline.keys()])].sort();for(let l of u){let d=i.get(l),h=s[l],m=e.baseline.get(l),f;h===void 0&&m!==void 0&&d!==void 0&&d.content_sha256===m&&!e.readOnly?f=await xe(this,ka,"m",EFt).call(this,e,l,d,m,o):f=await xe(this,ka,"m",fFt).call(this,e,l,d,h,a),f!==void 0&&c.set(l,f)}e.baseline=c,await xe(this,ka,"m",AFt).call(this,e,a),o.suppressed>0&&xe(this,qo,"f").debug("remote deletes are disabled; locally deleted memories stay on the server",{count:o.suppressed,memory_store_id:e.memoryStoreId}),o.capped>0&&xe(this,qo,"f").warn(`delete cap reached: ${o.mode==="log_only"?"would send":"sent"} ${o.attempted} deletes, held ${o.capped} for later syncs`,{memory_store_id:e.memoryStoreId})}catch(r){xe(this,qo,"f").warn("memory sync failed",{memory_store_id:e.memoryStoreId,error:String(r)})}},IFt=async function(e,n){let r=new Map,s=new Set,i=async()=>{if(e.readOnly)return;let o=await xe(this,ka,"m",vpe).call(this,e);if(!o.markerOk){xe(this,qo,"f").warn(`${o.distrustReason}; not uploading anything from the memory store folder`,{root:e.files.root().path,memory_store_id:e.memoryStoreId});return}for(let[u,l]of Object.entries(o.files))l!==e.baseline.get(u)&&e.refusedShas.get(u)!==l&&(r.set(u,l),s.add(u));if(r.size===0||n?.aborted)return;let a=new Map;for await(let[u,l]of xe(this,ka,"m",xpe).call(this,e.memoryStoreId)){if(n?.aborted)return;a.set(u,l)}let c=[];for(let u of[...r.keys()].sort()){let l=r.get(u),d=e.baseline.get(u),h=a.get(u);if(h!==void 0&&h.content_sha256===l){e.baseline.set(u,h.content_sha256),s.delete(u);continue}if(h!==void 0&&h.content_sha256!==d){xe(this,qo,"f").warn("memory changed both locally and remotely; the flush leaves the remote version",{path:u,memory_store_id:e.memoryStoreId}),s.delete(u);continue}c.push([u,l,h])}await xe(this,ka,"m",yFt).call(this,e,c,s,n)};try{await QIr(i(),n),n?.aborted&&s.size>0&&xe(this,qo,"f").warn(`memory flush cut off part-way; ${s.size} of ${r.size} changed files had not finished uploading`,{memory_store_id:e.memoryStoreId})}catch(o){xe(this,qo,"f").warn("memory flush failed",{memory_store_id:e.memoryStoreId,error:String(o)})}},I2e=async function(e,n){xe(this,qo,"f").warn(`${n}; re-downloading the memory store folder instead of syncing`,{root:e.files.root().path,memory_store_id:e.memoryStoreId}),await e.files.createRoot(),await xe(this,ka,"m",w2e).call(this,e)},w2e=async function(e){e.baseline=new Map,e.pendingDeletes.clear(),await e.files.put(nP,`version ${wFt} -${e.memoryStoreId}`);for await(let[n,r]of xe(this,ka,"m",xpe).call(this,e.memoryStoreId,"full"))await xe(this,ka,"m",x2e).call(this,e,n,r.content??"")&&e.baseline.set(n,r.content_sha256)},fFt=async function(e,n,r,s,i){let o=e.baseline.get(n);if(s!==void 0&&e.pendingDeletes.delete(n),!r){if(s===void 0){e.pendingDeletes.delete(n);return}if(o!==void 0){if(s===o){let d=await xe(this,ka,"m",gFt).call(this,e,n,o);if(d===void 0)return;if(d===o)return o;s=d}e.readOnly?xe(this,qo,"f").warn("memory deleted remotely but edited locally; keeping the file, which a read-only store cannot push",{path:n,memory_store_id:e.memoryStoreId}):e.refusedShas.get(n)!==s&&xe(this,qo,"f").info("memory deleted remotely but edited locally; re-creating it from the file",{path:n,memory_store_id:e.memoryStoreId})}return e.readOnly||e.refusedShas.get(n)===s?void 0:await xe(this,ka,"m",wpe).call(this,e,n,s,void 0)}let a=r.content_sha256,c=a!==o,u=s!==void 0&&s!==o&&s!==a,l=!e.readOnly&&u;return s===void 0&&o!==void 0?(c&&(xe(this,qo,"f").warn("memory deleted locally but changed remotely; restoring the remote version",{path:n,memory_store_id:e.memoryStoreId}),e.pendingDeletes.delete(n),i.push([n,r])),o):c?s===a?a:(u&&xe(this,qo,"f").warn("memory changed both locally and remotely; keeping the remote version",{path:n,memory_store_id:e.memoryStoreId}),i.push([n,r]),o):l?e.refusedShas.get(n)===s?a:await xe(this,ka,"m",wpe).call(this,e,n,s,r)??a:a},gFt=async function(e,n,r){let s;try{s=await e.files.hashFile(n)}catch(i){if(!(i instanceof oo)&&!H$(i))throw i;return r}if(s!==null){if(s!==r)return s;try{await e.files.remove(n)}catch(i){if(!(i instanceof oo)&&!H$(i))throw i;return xe(this,qo,"f").warn("failed to remove memory deleted remotely",{path:n,memory_store_id:e.memoryStoreId,error:String(i)}),r}}},x2e=async function(e,n,r){try{await e.files.put(n,r)}catch(s){if(!(s instanceof oo)&&!H$(s))throw s;return xe(this,qo,"f").warn("failed to write memory",{path:n,memory_store_id:e.memoryStoreId,error:String(s)}),!1}return!0},AFt=async function(e,n){if(n.length===0)return;let r=async(o,a)=>{let c;try{c=await xe(this,qR,"f").beta.memoryStores.memories.retrieve(a.id,{memory_store_id:e.memoryStoreId,view:"full"})}catch(u){if(Kd(u,404))return;xe(this,qo,"f").warn("failed to fetch memory content",{path:o,memory_store_id:e.memoryStoreId,error:String(u)});return}await xe(this,ka,"m",x2e).call(this,e,o,c.content??"")&&e.baseline.set(o,c.content_sha256)},s=n[Symbol.iterator](),i=async()=>{for(let[o,a]of s)await r(o,a)};await Promise.all(Array.from({length:Math.min(OIr,n.length)},i))},yFt=async function(e,n,r,s){let i=n[Symbol.iterator](),o=async()=>{for(let[a,c,u]of i){if(s?.aborted)return;let l=await xe(this,ka,"m",wpe).call(this,e,a,c,u);r.delete(a),l!==void 0&&e.baseline.set(a,l)}};await Promise.all(Array.from({length:Math.min(MIr,n.length)},o))},xpe=async function*(e,n="basic"){let r=n==="basic"?BIr:PIr;for await(let s of xe(this,qR,"f").beta.memoryStores.memories.list(e,{view:n,limit:r})){if(s.type!=="memory")continue;let i=s.path.replace(/^\/+/,"");if(i===nP){xe(this,qo,"f").warn("the server listed the reserved marker path; skipping",{path:s.path,memory_store_id:e});continue}yield[i,s]}},wpe=async function t(e,n,r,s){try{let i=await e.files.get(n);if(i===null)return;let o=YB(i),a=s?await xe(this,qR,"f").beta.memoryStores.memories.update(s.id,{memory_store_id:e.memoryStoreId,content:o,precondition:{type:"content_sha256",content_sha256:s.content_sha256}}):await xe(this,qR,"f").beta.memoryStores.memories.create(e.memoryStoreId,{path:"/"+n,content:o});return e.refusedShas.delete(n),a.content_sha256}catch(i){if(s&&Kd(i,404))return await xe(this,ka,"m",t).call(this,e,n,r,void 0);let o=i instanceof oo||Kd(i,400)||Kd(i,413);s&&Kd(i,409)?xe(this,qo,"f").warn("memory changed both locally and remotely; the upload was refused and the local edit loses",{path:n,memory_store_id:e.memoryStoreId}):o&&r!==void 0?(e.refusedShas.set(n,r),xe(this,qo,"f").warn("the server rejected this memory file, so it stays un-synced until its content changes",{path:n,memory_store_id:e.memoryStoreId,rejection:String(i)})):xe(this,qo,"f").warn("failed to upload memory",{path:n,memory_store_id:e.memoryStoreId,error:String(i)});return}},EFt=async function(e,n,r,s,i){if(i.mode==="disabled")return i.suppressed++,s;let o=e.pendingDeletes.get(n);if(o===void 0&&(o=Date.now(),e.pendingDeletes.set(n,o)),!i.waiveWindow&&Date.now()-oLpe,BashTimeoutError:()=>Mpe,DEFAULT_MEMORY_SYNC_INTERVAL_MS:()=>_9,MARKER_PATH:()=>nP,MEMORY_FLUSH_TIMEOUT_MS:()=>xFt,MIN_MEMORY_SYNC_INTERVAL_MS:()=>b9,SessionMemoryError:()=>Qx,SessionMemoryStores:()=>Npe,betaAgentToolset20260401:()=>VIr,betaBashTool:()=>FFt,betaEditTool:()=>$Ft,betaGlobTool:()=>GFt,betaGrepTool:()=>WFt,betaReadTool:()=>QFt,betaWriteTool:()=>UFt,extractSkillArchive:()=>_2e,resolvePath:()=>j$,setupSkills:()=>sFt});function MFt(t){return t===void 0?UIr:t}function aP(t){if(t!==void 0)throw new gn("The `unrestrictedPaths` option you passed to the agent toolset (AgentToolContext) is no longer supported. The toolset's file tools (read, write, edit, glob, grep) are now always confined to the working directory plus the directories listed in `allowedRoots`. Remove `unrestrictedPaths` from your context; to let the file tools reach any other directory, add it to `allowedRoots`.")}function VIr(t){return[FFt(t),QFt(t),UFt(t),$Ft(t),GFt(t),WFt(t)]}async function j$(t,e){return aP(t.unrestrictedPaths),nFt(t.workdir,e,{allowedRoots:t.allowedRoots??[]})}function LFt(t,e){return g2e(t.readOnlyRoots??[],e)}function jIr(){let t={};for(let[e,n]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=n);return t}function FFt(t){aP(t.unrestrictedPaths);let e,n=Promise.resolve();return tP({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:r,restart:s,timeout_ms:i},o)=>{let a=n,c=Q$();n=c.promise;try{await a}catch{}try{if(s&&(e?.close(),e=void 0),!r){if(s)return"bash session restarted";throw new ks("bash: command is required")}e??(e=new Lpe(t.workdir,t.env));try{let{output:u,exitCode:l}=await e.exec(r,{timeoutMs:i??OFt,signal:o?.signal});if(l!==0)throw new ks(u||`exit ${l}`);return u}catch(u){throw u instanceof ks?u:(e.close(),e=void 0,new ks(`bash: ${u instanceof Error?u.message:String(u)}`))}}finally{c.resolve()}},close:()=>{e?.close(),e=void 0}})}function QFt(t){return aP(t.unrestrictedPaths),tP({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:e,view_range:n})=>{if(!e)throw new ks("read: file_path is required");let r=await j$(t,e);if(n?.length&&n.length!==2)throw new ks("read: view_range must be [start_line, end_line]");let s;try{let l=await zd.stat(r);if(!l.isFile())throw new ks(`read: ${e} is not a regular file`);let d=MFt(t.maxFileBytes);if(d!==null&&l.size>d){if(!n?.length)throw new ks(`read: ${e} is ${l.size} bytes, exceeds ${d}-byte limit. Use the view_range parameter to read specific line ranges, e.g. view_range: [1, 500].`);let[h,m]=n;return await YIr(r,e,h,m,d)}s=await zd.readFile(r,"utf8")}catch(l){throw l instanceof ks?l:new ks(`read: ${$$(l,e)}`)}if(!n?.length)return s;let[i,o]=n,a=s.split(` -`),c=Math.max(0,i-1),u=o>0?o:a.length;return a.slice(c,u).join(` -`)}})}async function YIr(t,e,n,r,s){let i=new R2e(e,n,r,s);if(i.rangeIsEmpty())return"";let o=k9.createReadStream(t,{highWaterMark:$Ir});try{for await(let a of o)if(i.collectFrom(a),i.rangeIsCollected())break}finally{o.destroy()}return i.text()}function UFt(t){return aP(t.unrestrictedPaths),tP({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:e,content:n})=>{if(!e)throw new ks("write: file_path is required");let r=await j$(t,e),s=await LFt(t,r);if(s!==void 0)throw new ks(`write: ${e} is inside read-only directory ${s}`);try{await zd.mkdir(Sm.dirname(r),{recursive:!0,mode:C9}),await A2e(r,n??"")}catch(i){throw new ks(`write: ${$$(i,e)}`)}return`wrote ${Buffer.byteLength(n??"")} bytes to ${e}`}})}function $Ft(t){return aP(t.unrestrictedPaths),tP({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:e,old_string:n,new_string:r,replace_all:s})=>{if(!e)throw new ks("edit: file_path is required");if(!n)throw new ks("edit: old_string is required");let i=await j$(t,e),o=await LFt(t,i);if(o!==void 0)throw new ks(`edit: ${e} is inside read-only directory ${o}`);let a;try{let l=await zd.stat(i);if(!l.isFile())throw new ks(`edit: ${e} is not a regular file`);let d=MFt(t.maxFileBytes);if(d!==null&&l.size>d)throw new ks(`edit: ${e} is ${l.size} bytes, exceeds ${d}-byte limit. The edit tool loads the whole file and cannot modify a file this large.`);a=await zd.readFile(i,"utf8")}catch(l){throw l instanceof ks?l:new ks(`edit: ${$$(l,e)}`)}let c=a.split(n).length-1;if(c===0)throw new ks(`edit: old_string not found in ${e}`);let u;if(s)u=a.split(n).join(r);else{if(c>1)throw new ks(`edit: old_string appears ${c} times in ${e} (must be unique)`);u=a.replace(n,()=>r)}try{await A2e(i,u)}catch(l){throw new ks(`edit: write: ${$$(l,e)}`)}return`edited ${e} (${s?c:1} replacement(s))`}})}function KIr(t){return t.split(/[\\/{},]/).includes("..")}function GFt(t){return aP(t.unrestrictedPaths),tP({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:e,path:n})=>{if(!e)throw new ks("glob: pattern is required");if(Sm.isAbsolute(e))throw new ks("glob: absolute pattern not permitted; pass a relative pattern (and optionally path)");if(KIr(e))throw new ks('glob: ".." is not permitted in the pattern');let r=n?await j$(t,n):Sm.resolve(t.workdir),s=n?r:await S9(r),i=[],o=qFt;try{for await(let a of HIr(e,{cwd:r,withFileTypes:!0,exclude:c=>c.name===".git"||c.name==="node_modules"})){if(o--<=0)break;if(!a.isFile())continue;let c=Sm.join(a.parentPath,a.name),u;try{u=await zd.realpath(c)}catch{continue}if(!Cpe(s,u))continue;let l=0;try{l=(await zd.stat(c)).mtimeMs}catch{}i.push({path:c,mtime:l})}}catch(a){throw new ks(`glob: ${a instanceof Error?a.message:String(a)}`)}return i.length===0?"no matches":(i.sort((a,c)=>c.mtime-a.mtime),i.slice(0,WIr).map(a=>a.path).join(` -`))}})}function WFt(t){return aP(t.unrestrictedPaths),tP({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:e,path:n},r)=>{if(!e)throw new ks("grep: pattern is required");let s=Sm.resolve(t.workdir);n&&(s=await j$(t,n));let i=await exr();return i?zIr(i,e,s,r?.signal):JIr(e,s,r?.signal)}})}function zIr(t,e,n,r){return new Promise((s,i)=>{let o=k2e.spawn(t,["-n","--no-heading","-e",e,"--",n],{...r?{signal:r}:{}}),a="",c="",u=!1;o.stdout.on("data",l=>{u||(a+=l,a.length>R9&&(u=!0,a=a.slice(0,R9),o.kill("SIGKILL")))}),o.stderr.on("data",l=>c+=l),o.on("close",l=>{if(r?.aborted)return i(new ks("grep: aborted"));if(u)return s(a+` -[output truncated at ${R9} bytes]`);if(l===0)return s(a);if(l===1)return s("no matches");i(new ks(`grep: rg failed: ${c||`exit ${l}`}`))}),o.on("error",l=>{if(r?.aborted)return i(new ks("grep: aborted"));i(new ks(`grep: rg failed: ${l.message}`))})})}async function JIr(t,e,n){let r;try{r=new RegExp(t)}catch(c){throw new ks(`grep: invalid regex: ${c instanceof Error?c.message:String(c)}`)}let s=[],i=R9,o=c=>(i-=c.length+1,i<0?(s.push(`[output truncated at ${R9} bytes]`),!1):(s.push(c),!0));if((await zd.stat(e).catch(()=>null))?.isFile()?await NFt(e,r,o):await ZIr(e,"",c=>NFt(Sm.join(e,c),r,o),n),n?.aborted)throw new ks("grep: aborted");return s.length===0?"no matches":s.join(` -`)}async function NFt(t,e,n){let r=k9.createReadStream(t,{encoding:"utf8"}),s=PFt.createInterface({input:r,crlfDelay:1/0}),i=0;try{for await(let o of s)if(i++,!(o.length>GIr)&&e.test(o)&&!n(`${t}:${i}:${o}`))return!1}catch{}finally{r.destroy()}return!0}async function ZIr(t,e,n,r){let s=qFt;async function i(o,a){if(a>XIr)return!0;if(r?.aborted)return!1;let c;try{c=await zd.readdir(Sm.join(t,o),{withFileTypes:!0})}catch{return!0}for(let u of c){if(u.name===".git"||u.name==="node_modules")continue;if(s--<=0||r?.aborted)return!1;let l=o?Sm.join(o,u.name):u.name;if(u.isDirectory()){if(!await i(l,a+1))return!1}else if(u.isFile()&&await n(l)===!1)return!1}return!0}await i(e,0)}async function exr(){let t=(process.env.PATH??"").split(Sm.delimiter);for(let e of t){let n=Sm.join(e,"rg");try{return await zd.access(n,k9.constants.X_OK),n}catch{}}return null}var zd,k9,Sm,k2e,BFt,PFt,Dpe,_m,Ff,w9,rP,gE,v2e,Bpe,T9,Ppe,Ope,iP,oP,V$,sP,v9,HR,DFt,vFt,RFt,OFt,UIr,$Ir,kFt,R9,GIr,WIr,Mpe,qIr,HIr,Lpe,R2e,XIr,qFt,VFt=V(()=>{p();Em();zd=Gt(require("node:fs/promises"),1),k9=Gt(require("node:fs"),1),Sm=Gt(require("node:path"),1),k2e=Gt(require("node:child_process"),1),BFt=Gt(require("node:crypto"),1),PFt=Gt(require("node:readline"),1);Ra();ZB();tFt();f2e();y2e();oFt();TFt();RFt=100*1024,OFt=12e4,UIr=256*1024,$Ir=64*1024,kFt=Buffer.from(` -`),R9=100*1024,GIr=2e3,WIr=200,Mpe=class extends gn{constructor(e){super(`bash command timed out after ${e}ms`),this.name="BashTimeoutError",this.timeoutMs=e}},qIr=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,HIr=zd.glob;Lpe=class{constructor(e,n=jIr()){Dpe.add(this),_m.set(this,void 0),Ff.set(this,""),w9.set(this,!1),rP.set(this,!1),gE.set(this,null),Wt(this,_m,k2e.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...n,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),xe(this,_m,"f").stdout.setEncoding("utf8"),xe(this,_m,"f").stderr.setEncoding("utf8"),xe(this,_m,"f").stdout.on("data",r=>xe(this,Dpe,"m",v2e).call(this,r)),xe(this,_m,"f").stderr.on("data",r=>xe(this,Dpe,"m",v2e).call(this,r)),xe(this,_m,"f").once("close",()=>{Wt(this,rP,!0,"f");let r=xe(this,gE,"f");Wt(this,gE,null,"f"),r?.resolve()})}get closed(){return xe(this,rP,"f")}async exec(e,n={}){if(xe(this,rP,"f"))throw new gn("bash session terminated");let r=n.timeoutMs??OFt,s=n.signal;s?.throwIfAborted(),Wt(this,Ff,"","f"),Wt(this,w9,!1,"f");let i=`__ANT_CMD_${BFt.randomUUID()}_DONE__`,o=`${i.slice(0,8)}''${i.slice(8)}`,a=`{ ${e} +`,{flag:"wx",mode:384}),["-xf",e,"-C",n,"-X",i])}async function Mzr(t,e){let n=await O0.open(t,"r");try{let r=Buffer.alloc(e),{bytesRead:i}=await n.read(r,0,e,0);return r.subarray(0,i)}finally{await n.close()}}var O0,vzr,$4e,kzr,k6t=v(()=>{p();nA();tc();dx();U4e();O0=nv.promises,vzr=J3e.promisify(K3e.execFile);$4e="skill archive listing is inconsistent; refusing to extract",kzr={unzip:new Set(["-","d","?"]),tar:new Set(["-","d","C"])}});function q4e(t){return t.startsWith("/")&&!t.split("/").includes("..")}function Qzr(){return H4e!==0}async function Uzr(t){let e=[],n=t;for(;;){try{await tp.stat(n);break}catch(i){let s=i.code;if(s!=="ENOENT"&&s!=="ENOTDIR"&&s!=="ELOOP")throw i}e.push(n);let r=gi.dirname(n);if(r===n)break;n=r}for(let r of e.reverse())try{await tp.mkdir(r,{mode:P6t})}catch(i){if(i.code!=="EEXIST")throw i}}async function B6t(t,e){let n=gi.relative(t,e);if(n==="")return;let r=t;for(let i of n.split(gi.sep)){r=gi.join(r,i);try{await tp.mkdir(r,{mode:P6t})}catch(s){if(s.code!=="EEXIST")throw s}}}async function Gzr(t,e,n){let r=n?Lzr:Ozr,i=gi.join(gi.dirname(t),`.fs-${yB.randomBytes(8).toString("hex")}.tmp`),s;try{s=await tp.open(i,cq.O_WRONLY|cq.O_CREAT|cq.O_EXCL|H4e,r),await s.writeFile(e),await s.close(),s=void 0,await tp.rename(i,t)}catch(o){throw s&&await s.close().catch(()=>{}),await tp.unlink(i).catch(()=>{}),o}}async function M6t(t,e){let n;try{n=await tp.open(e,cq.O_RDONLY|H4e|Fzr)}catch(r){let i=r.code;throw i==="ELOOP"||i==="EMLINK"?new _o(_o.IS_A_SYMLINK,t):r}try{if(!(await n.stat()).isFile())throw new _o(_o.NOT_A_FILE,t)}catch(r){throw await n.close().catch(()=>{}),r}return n}async function $zr(t){let e=yB.createHash("sha256"),n=await M6t(gi.basename(t),t),r=new Uint8Array(1024*1024);try{for(;;){let{bytesRead:i}=await n.read(r,0,r.length);if(i===0)break;e.update(r.subarray(0,i))}}finally{await n.close()}return e.digest("hex")}async function N6t(t,e,n){if(!await Hzr(e,n))return[];let r=[];return await O6t(n,(i,s)=>{s.isFile()&&r.push([gi.relative(t,i).split(gi.sep).join("/"),i])}),r.sort(),r}async function Wzr(t,e,n){let r=o=>gi.relative(t,o).split(gi.sep).join("/"),i;try{i=await tp.lstat(n,{bigint:!0})}catch(o){let a=o.code;if(a==="ENOENT"||a==="ENOTDIR")return new Set;throw o}if(i.isSymbolicLink())return new Set([r(n)]);if(!i.isDirectory())throw new _o(_o.NOT_A_DIRECTORY,e);let s=new Set;return await O6t(n,(o,a)=>{a.isSymbolicLink()&&s.add(r(o))}),s}async function Hzr(t,e){let n;try{n=await tp.lstat(e,{bigint:!0})}catch(r){let i=r.code;if(i==="ENOENT"||i==="ENOTDIR")return!1;throw r}if(!n.isDirectory())throw new _o(_o.NOT_A_DIRECTORY,t);return!0}async function O6t(t,e){let n=[t];for(;n.length;){let r=n.pop(),i;try{i=await tp.readdir(r,{withFileTypes:!0})}catch(s){if(s.code==="ENOENT")continue;throw s}for(let s of i){let o=gi.join(r,s.name);e(o,s),s.isDirectory()&&!s.isSymbolicLink()&&n.push(o)}}}function qzr(t,e){return e.mtimeNs===t.mtimeNs&&e.ctimeNs===t.ctimeNs&&e.size===t.size}function jzr(t,e){return(t.mtimeNs>t.ctimeNs?t.mtimeNs:t.ctimeNs){p();nA();KO();tp=nv.promises,cq=nv.constants,P6t=448,Ozr=384,Lzr=448,H4e=cq.O_NOFOLLOW??0,Fzr=cq.O_NONBLOCK??0,_o=class extends Error{constructor(e,n){super(`path ${JSON.stringify(n)} ${e}`),this.name="FileStoreError",this.reason=e,this.relPath=n}};_o.ESCAPES_ROOT="escapes the store root";_o.IS_A_SYMLINK="is a symlink";_o.NOT_A_FILE="is not a regular file";_o.NOT_A_DIRECTORY="is not a directory";_o.NOT_UTF8="is not valid utf-8";_o.MOVE_DESTINATION_EXISTS="already exists";lq=class t{constructor(e,n,r=!1){this.hashes=new Map,this.rootPath=e,this.removedOnDispose=n,this.decoder=r?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(e,n){if(!Qzr())throw new Error("FileStore requires O_NOFOLLOW support on this platform");let r=!1;try{await tp.lstat(e)}catch(i){if(i.code!=="ENOENT")throw i;r=!0}return new t(gi.resolve(e),r,n?.utf8??!1)}async createRoot(){await Uzr(this.rootPath)}root(){return{path:this.rootPath,removedOnDispose:this.removedOnDispose}}async dispose(){this.removedOnDispose&&await tp.rm(this.rootPath,{recursive:!0,force:!0})}async put(e,n,r){let i=e.replace(/\\/g,"/");if(i.endsWith("/")||i.endsWith("/.")||i===""||i===".")throw new _o(_o.NOT_A_FILE,e);let s=this.resolveUnderRoot(e),o=typeof n=="string"?EB(n):n;this.requireUtf8(e,o),await B6t(this.rootPath,gi.dirname(s)),await Gzr(s,o,r?.executable??!1)}async get(e){let n=this.resolveUnderRoot(e),r;try{r=await M6t(e,n)}catch(s){if(s.code==="ENOENT")return null;throw s}let i;try{let s=await r.readFile();i=new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}finally{await r.close()}return this.requireUtf8(e,i),i}async ls(e="/"){let n=this.resolveUnderRoot(e);return new Set((await N6t(this.rootPath,e,n)).map(([r])=>r))}async findSymlinks(e="/"){let n=this.resolveUnderRoot(e);return Wzr(this.rootPath,e,n)}async hashtree(e="/"){let n=this.resolveUnderRoot(e),r=Sye.nowNs(),i=Object.create(null);for(let[s,o]of await N6t(this.rootPath,e,n)){let a=await this.hashViaCache(s,o,r);a!==null&&(i[s]=a)}return i}async hashFile(e){let n=this.resolveUnderRoot(e),r;try{r=await tp.lstat(n,{bigint:!0})}catch(s){if(s.code==="ENOENT")return null;throw s}if(r.isSymbolicLink())throw new _o(_o.IS_A_SYMLINK,e);if(!r.isFile())throw new _o(_o.NOT_A_FILE,e);let i=gi.relative(this.rootPath,n).split(gi.sep).join("/");return this.hashViaCache(i,n,Sye.nowNs())}async move(e,n){let r=this.resolveUnderRoot(e),i=this.resolveUnderRoot(n);if(r===this.rootPath||i===this.rootPath)return;if(await tp.stat(i).then(()=>!0,()=>!1))throw new _o(_o.MOVE_DESTINATION_EXISTS,n);await B6t(this.rootPath,gi.dirname(i)),await tp.rename(r,i)}async remove(e){let n=this.resolveUnderRoot(e);if(n===this.rootPath)return;let r;try{r=await tp.lstat(n,{bigint:!0})}catch(i){if(i.code==="ENOENT")return;throw i}if(r.isDirectory())await tp.rm(n,{recursive:!0,force:!0});else try{await tp.unlink(n)}catch(i){if(i.code!=="ENOENT")throw i}}resolveUnderRoot(e){let n=e.replace(/\\/g,"/").replace(/^\/+/,""),r=n.split("/").filter(i=>i!==""&&i!==".");if(gi.posix.isAbsolute(n)||r.includes(".."))throw new _o(_o.ESCAPES_ROOT,e);return r.length===0?this.rootPath:gi.join(this.rootPath,...r)}requireUtf8(e,n){if(this.decoder)try{this.decoder.decode(n)}catch{throw new _o(_o.NOT_UTF8,e)}}async hashViaCache(e,n,r){let i;try{i=await tp.lstat(n,{bigint:!0})}catch(a){if(a.code==="ENOENT")return null;throw a}if(!i.isFile())return null;let s=this.hashes.get(e),o;if(s!==void 0&&qzr(s,i))o=s.sha;else try{o=await Sye.hashFile(n)}catch(a){let c=a.code;if(c==="ENOENT"||a instanceof _o||c==="ELOOP"||c==="EMLINK")return null;throw a}return jzr(i,r)&&this.hashes.set(e,{mtimeNs:i.mtimeNs,ctimeNs:i.ctimeNs,size:i.size,sha:o}),o}};lq.isPathLegal=q4e;Vzr=2000000000n,Sye={hashFile:$zr,timestampTrustMarginNs:Vzr,nowNs:()=>BigInt(Date.now())*1000000n},L6t=lq,D6t=Symbol.asyncDispose;D6t&&Object.defineProperty(lq.prototype,D6t,{value:lq.prototype.dispose,configurable:!0,writable:!0})});function q6t(t){return yB.createHash("sha256").update(`version ${K6t} +${t}`,"utf-8").digest("hex")}function dq(t){return typeof t=="object"&&t!==null&&typeof t.code=="string"}async function t7r(t,e){if(!e){await t;return}let n,r=new Promise(i=>{n=i,e.aborted&&i()});e.addEventListener("abort",n,{once:!0});try{await Promise.race([t,r])}finally{e.removeEventListener("abort",n)}}var nc,RB,vye,LJ,Rye,ca,uq,wye,vB,j6t,Tye,V6t,Y6t,j4e,Y4e,Q6t,U6t,V4e,G6t,$6t,Cye,Iye,W6t,H6t,z6t,iL,K6t,Yzr,zzr,Kzr,Jzr,Xzr,Zzr,e7r,ov,z4e,kye,J6t=v(()=>{p();Mf();nA();tc();dx();KO();zH();F6t();_ye();_ye();z6t=3e4,iL=".anthropic-memory-store",K6t=1;Yzr=3e4,zzr=100,Kzr=20,Jzr=16,Xzr=32,Zzr=8,e7r=50,ov=class extends En{constructor(e,n){super(e),this.name="SessionMemoryError",n!==void 0&&(this.cause=n)}},z4e=class{constructor(e,n,r){this.mode=e,this.cap=n,this.waiveWindow=r,this.attempted=0,this.capped=0,this.suppressed=0}takeSlot(){return this.attempted>=this.cap?(this.capped++,!1):(this.attempted++,!0)}},kye=class{constructor(e,n){nc.add(this),RB.set(this,void 0),vye.set(this,void 0),LJ.set(this,void 0),Rye.set(this,void 0),ca.set(this,void 0),uq.set(this,void 0),wye.set(this,!1),vB.set(this,[]),Ht(this,RB,e,"f"),Ht(this,vye,n.workdir,"f"),Ht(this,LJ,n.syncIntervalMs??DJ,"f"),bye(Ce(this,LJ,"f"),"syncIntervalMs"),Ht(this,Rye,n.syncDeletions??"enabled","f"),Ht(this,ca,lo(e),"f"),Ht(this,uq,Date.now(),"f")}get roots(){return Ce(this,vB,"f").map(e=>e.files.root().path)}get readOnlyRoots(){return Ce(this,vB,"f").filter(e=>e.readOnly).map(e=>e.files.root().path)}async download(e){for(let n of e.resources){if(n.type!=="memory_store")continue;let r=Ce(this,nc,"m",j6t).call(this,n),i;try{if(i={memoryStoreId:n.memory_store_id,files:await L6t.open(r,{utf8:!0}),readOnly:n.access==="read_only",baseline:new Map,refusedShas:new Map,pendingDeletes:new Map},!i.files.root().removedOnDispose)throw new ov(`something already exists at the memory store's path: ${r} (memory_store_id=${n.memory_store_id}); it must not exist when the session starts`);try{await i.files.createRoot()}catch(s){throw dq(s)?new ov(`cannot create the memory store's folder: ${r} (memory_store_id=${n.memory_store_id}): ${s}; the worker host must make this mount path writable`,s):s}await Ce(this,nc,"m",Y4e).call(this,i),Ce(this,ca,"f").info("downloaded memories",{count:i.baseline.size,memory_store_id:i.memoryStoreId,dest:i.files.root().path}),Ce(this,vB,"f").push(i)}catch(s){throw i&&await i.files.dispose().catch(()=>{}),s instanceof ov?s:new ov(`failed to download memory store memory_store_id=${n.memory_store_id}: ${s}`,s)}}Ht(this,uq,Date.now(),"f")}async finish(){if(Ce(this,wye,"f"))throw new En("finish() was already called: it is the session's last sync and runs once");Ht(this,wye,!0,"f"),await this.syncAll(!0)}async syncAll(e){await Promise.all(Ce(this,vB,"f").map(n=>Ce(this,nc,"m",V6t).call(this,n,e))),Ht(this,uq,Date.now(),"f")}async syncIfDue(){Date.now()-Ce(this,uq,"f")Ce(this,nc,"m",Y6t).call(this,n,e)))}async dispose(){for(let e of Ce(this,vB,"f")){let n=e.files.root();try{let r=await Ce(this,nc,"m",Tye).call(this,e);if(!r.markerOk&&Object.keys(r.files).length>0){Ce(this,ca,"f").warn(`${r.distrustReason}; leaving the memory store folder on disk`,{root:n.path,memory_store_id:e.memoryStoreId});continue}await e.files.dispose()}catch(r){if(!(r instanceof _o)&&!dq(r))throw r;Ce(this,ca,"f").warn("failed to remove the memory store folder",{root:e.files.root().path,memory_store_id:e.memoryStoreId,error:String(r)});continue}n.removedOnDispose&&Ce(this,ca,"f").info("removed memory store dir",{dest:n.path,memory_store_id:e.memoryStoreId})}}};RB=new WeakMap,vye=new WeakMap,LJ=new WeakMap,Rye=new WeakMap,ca=new WeakMap,uq=new WeakMap,wye=new WeakMap,vB=new WeakMap,nc=new WeakSet,j6t=function(e){if(e.mount_path){if(!q4e(e.mount_path))throw new ov(`memory store mount_path is not a clean absolute path: ${JSON.stringify(e.mount_path)} (memory_store_id=${e.memory_store_id})`);return e.mount_path}return gi.join(Ce(this,vye,"f"),"memory",e.name||e.memory_store_id)},Tye=async function(e){let n=await e.files.hashtree(),r=n[iL];return delete n[iL],r===q6t(e.memoryStoreId)?{files:n,markerOk:!0,distrustReason:null}:{files:n,markerOk:!1,distrustReason:r!==void 0?"the marker file does not match this store":"the marker file is gone"}},V6t=async function(e,n){try{let r=await Ce(this,nc,"m",Tye).call(this,e),i=r.files;if(!r.markerOk){if(Object.keys(i).length>0){Ce(this,ca,"f").warn(`${r.distrustReason}; leaving the memory store folder as found and not syncing`,{root:e.files.root().path,memory_store_id:e.memoryStoreId});return}await Ce(this,nc,"m",j4e).call(this,e,"the folder or its marker is gone");return}if(Object.keys(i).length===0&&e.baseline.size>1){await Ce(this,nc,"m",j4e).call(this,e,"every memory file is gone at once");return}let s=new Map;for await(let[l,d]of Ce(this,nc,"m",Cye).call(this,e.memoryStoreId))s.set(l,d);let o=new z4e(Ce(this,Rye,"f"),Math.max(Zzr,Math.min(e7r,Math.floor(e.baseline.size/4))),n),a=[],c=new Map,u=[...new Set([...s.keys(),...Object.keys(i),...e.baseline.keys()])].sort();for(let l of u){let d=s.get(l),m=i[l],h=e.baseline.get(l),f;m===void 0&&h!==void 0&&d!==void 0&&d.content_sha256===h&&!e.readOnly?f=await Ce(this,nc,"m",W6t).call(this,e,l,d,h,o):f=await Ce(this,nc,"m",Q6t).call(this,e,l,d,m,a),f!==void 0&&c.set(l,f)}e.baseline=c,await Ce(this,nc,"m",G6t).call(this,e,a),o.suppressed>0&&Ce(this,ca,"f").debug("remote deletes are disabled; locally deleted memories stay on the server",{count:o.suppressed,memory_store_id:e.memoryStoreId}),o.capped>0&&Ce(this,ca,"f").warn(`delete cap reached: ${o.mode==="log_only"?"would send":"sent"} ${o.attempted} deletes, held ${o.capped} for later syncs`,{memory_store_id:e.memoryStoreId})}catch(r){Ce(this,ca,"f").warn("memory sync failed",{memory_store_id:e.memoryStoreId,error:String(r)})}},Y6t=async function(e,n){let r=new Map,i=new Set,s=async()=>{if(e.readOnly)return;let o=await Ce(this,nc,"m",Tye).call(this,e);if(!o.markerOk){Ce(this,ca,"f").warn(`${o.distrustReason}; not uploading anything from the memory store folder`,{root:e.files.root().path,memory_store_id:e.memoryStoreId});return}for(let[u,l]of Object.entries(o.files))l!==e.baseline.get(u)&&e.refusedShas.get(u)!==l&&(r.set(u,l),i.add(u));if(r.size===0||n?.aborted)return;let a=new Map;for await(let[u,l]of Ce(this,nc,"m",Cye).call(this,e.memoryStoreId)){if(n?.aborted)return;a.set(u,l)}let c=[];for(let u of[...r.keys()].sort()){let l=r.get(u),d=e.baseline.get(u),m=a.get(u);if(m!==void 0&&m.content_sha256===l){e.baseline.set(u,m.content_sha256),i.delete(u);continue}if(m!==void 0&&m.content_sha256!==d){Ce(this,ca,"f").warn("memory changed both locally and remotely; the flush leaves the remote version",{path:u,memory_store_id:e.memoryStoreId}),i.delete(u);continue}c.push([u,l,m])}await Ce(this,nc,"m",$6t).call(this,e,c,i,n)};try{await t7r(s(),n),n?.aborted&&i.size>0&&Ce(this,ca,"f").warn(`memory flush cut off part-way; ${i.size} of ${r.size} changed files had not finished uploading`,{memory_store_id:e.memoryStoreId})}catch(o){Ce(this,ca,"f").warn("memory flush failed",{memory_store_id:e.memoryStoreId,error:String(o)})}},j4e=async function(e,n){Ce(this,ca,"f").warn(`${n}; re-downloading the memory store folder instead of syncing`,{root:e.files.root().path,memory_store_id:e.memoryStoreId}),await e.files.createRoot(),await Ce(this,nc,"m",Y4e).call(this,e)},Y4e=async function(e){e.baseline=new Map,e.pendingDeletes.clear(),await e.files.put(iL,`version ${K6t} +${e.memoryStoreId}`);for await(let[n,r]of Ce(this,nc,"m",Cye).call(this,e.memoryStoreId,"full"))await Ce(this,nc,"m",V4e).call(this,e,n,r.content??"")&&e.baseline.set(n,r.content_sha256)},Q6t=async function(e,n,r,i,s){let o=e.baseline.get(n);if(i!==void 0&&e.pendingDeletes.delete(n),!r){if(i===void 0){e.pendingDeletes.delete(n);return}if(o!==void 0){if(i===o){let d=await Ce(this,nc,"m",U6t).call(this,e,n,o);if(d===void 0)return;if(d===o)return o;i=d}e.readOnly?Ce(this,ca,"f").warn("memory deleted remotely but edited locally; keeping the file, which a read-only store cannot push",{path:n,memory_store_id:e.memoryStoreId}):e.refusedShas.get(n)!==i&&Ce(this,ca,"f").info("memory deleted remotely but edited locally; re-creating it from the file",{path:n,memory_store_id:e.memoryStoreId})}return e.readOnly||e.refusedShas.get(n)===i?void 0:await Ce(this,nc,"m",Iye).call(this,e,n,i,void 0)}let a=r.content_sha256,c=a!==o,u=i!==void 0&&i!==o&&i!==a,l=!e.readOnly&&u;return i===void 0&&o!==void 0?(c&&(Ce(this,ca,"f").warn("memory deleted locally but changed remotely; restoring the remote version",{path:n,memory_store_id:e.memoryStoreId}),e.pendingDeletes.delete(n),s.push([n,r])),o):c?i===a?a:(u&&Ce(this,ca,"f").warn("memory changed both locally and remotely; keeping the remote version",{path:n,memory_store_id:e.memoryStoreId}),s.push([n,r]),o):l?e.refusedShas.get(n)===i?a:await Ce(this,nc,"m",Iye).call(this,e,n,i,r)??a:a},U6t=async function(e,n,r){let i;try{i=await e.files.hashFile(n)}catch(s){if(!(s instanceof _o)&&!dq(s))throw s;return r}if(i!==null){if(i!==r)return i;try{await e.files.remove(n)}catch(s){if(!(s instanceof _o)&&!dq(s))throw s;return Ce(this,ca,"f").warn("failed to remove memory deleted remotely",{path:n,memory_store_id:e.memoryStoreId,error:String(s)}),r}}},V4e=async function(e,n,r){try{await e.files.put(n,r)}catch(i){if(!(i instanceof _o)&&!dq(i))throw i;return Ce(this,ca,"f").warn("failed to write memory",{path:n,memory_store_id:e.memoryStoreId,error:String(i)}),!1}return!0},G6t=async function(e,n){if(n.length===0)return;let r=async(o,a)=>{let c;try{c=await Ce(this,RB,"f").beta.memoryStores.memories.retrieve(a.id,{memory_store_id:e.memoryStoreId,view:"full"})}catch(u){if(Hp(u,404))return;Ce(this,ca,"f").warn("failed to fetch memory content",{path:o,memory_store_id:e.memoryStoreId,error:String(u)});return}await Ce(this,nc,"m",V4e).call(this,e,o,c.content??"")&&e.baseline.set(o,c.content_sha256)},i=n[Symbol.iterator](),s=async()=>{for(let[o,a]of i)await r(o,a)};await Promise.all(Array.from({length:Math.min(Jzr,n.length)},s))},$6t=async function(e,n,r,i){let s=n[Symbol.iterator](),o=async()=>{for(let[a,c,u]of s){if(i?.aborted)return;let l=await Ce(this,nc,"m",Iye).call(this,e,a,c,u);r.delete(a),l!==void 0&&e.baseline.set(a,l)}};await Promise.all(Array.from({length:Math.min(Xzr,n.length)},o))},Cye=async function*(e,n="basic"){let r=n==="basic"?zzr:Kzr;for await(let i of Ce(this,RB,"f").beta.memoryStores.memories.list(e,{view:n,limit:r})){if(i.type!=="memory")continue;let s=i.path.replace(/^\/+/,"");if(s===iL){Ce(this,ca,"f").warn("the server listed the reserved marker path; skipping",{path:i.path,memory_store_id:e});continue}yield[s,i]}},Iye=async function t(e,n,r,i){try{let s=await e.files.get(n);if(s===null)return;let o=zO(s),a=i?await Ce(this,RB,"f").beta.memoryStores.memories.update(i.id,{memory_store_id:e.memoryStoreId,content:o,precondition:{type:"content_sha256",content_sha256:i.content_sha256}}):await Ce(this,RB,"f").beta.memoryStores.memories.create(e.memoryStoreId,{path:"/"+n,content:o});return e.refusedShas.delete(n),a.content_sha256}catch(s){if(i&&Hp(s,404))return await Ce(this,nc,"m",t).call(this,e,n,r,void 0);let o=s instanceof _o||Hp(s,400)||Hp(s,413);i&&Hp(s,409)?Ce(this,ca,"f").warn("memory changed both locally and remotely; the upload was refused and the local edit loses",{path:n,memory_store_id:e.memoryStoreId}):o&&r!==void 0?(e.refusedShas.set(n,r),Ce(this,ca,"f").warn("the server rejected this memory file, so it stays un-synced until its content changes",{path:n,memory_store_id:e.memoryStoreId,rejection:String(s)})):Ce(this,ca,"f").warn("failed to upload memory",{path:n,memory_store_id:e.memoryStoreId,error:String(s)});return}},W6t=async function(e,n,r,i,s){if(s.mode==="disabled")return s.suppressed++,i;let o=e.pendingDeletes.get(n);if(o===void 0&&(o=Date.now(),e.pendingDeletes.set(n,o)),!s.waiveWindow&&Date.now()-oOye,BashTimeoutError:()=>Mye,DEFAULT_MEMORY_SYNC_INTERVAL_MS:()=>DJ,MARKER_PATH:()=>iL,MEMORY_FLUSH_TIMEOUT_MS:()=>z6t,MIN_MEMORY_SYNC_INTERVAL_MS:()=>NJ,SessionMemoryError:()=>ov,SessionMemoryStores:()=>kye,betaAgentToolset20260401:()=>c7r,betaBashTool:()=>czt,betaEditTool:()=>dzt,betaGlobTool:()=>pzt,betaGrepTool:()=>mzt,betaReadTool:()=>lzt,betaWriteTool:()=>uzt,extractSkillArchive:()=>W4e,resolvePath:()=>mq,setupSkills:()=>v6t});function ozt(t){return t===void 0?n7r:t}function lL(t){if(t!==void 0)throw new En("The `unrestrictedPaths` option you passed to the agent toolset (AgentToolContext) is no longer supported. The toolset's file tools (read, write, edit, glob, grep) are now always confined to the working directory plus the directories listed in `allowedRoots`. Remove `unrestrictedPaths` from your context; to let the file tools reach any other directory, add it to `allowedRoots`.")}function c7r(t){return[czt(t),lzt(t),uzt(t),dzt(t),pzt(t),mzt(t)]}async function mq(t,e){return lL(t.unrestrictedPaths),w6t(t.workdir,e,{allowedRoots:t.allowedRoots??[]})}function azt(t,e){return F4e(t.readOnlyRoots??[],e)}function l7r(){let t={};for(let[e,n]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=n);return t}function czt(t){lL(t.unrestrictedPaths);let e,n=Promise.resolve();return nL({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:r,restart:i,timeout_ms:s},o)=>{let a=n,c=oq();n=c.promise;try{await a}catch{}try{if(i&&(e?.close(),e=void 0),!r){if(i)return"bash session restarted";throw new Oi("bash: command is required")}e??(e=new Oye(t.workdir,t.env));try{let{output:u,exitCode:l}=await e.exec(r,{timeoutMs:s??szt,signal:o?.signal});if(l!==0)throw new Oi(u||`exit ${l}`);return u}catch(u){throw u instanceof Oi?u:(e.close(),e=void 0,new Oi(`bash: ${u instanceof Error?u.message:String(u)}`))}}finally{c.resolve()}},close:()=>{e?.close(),e=void 0}})}function lzt(t){return lL(t.unrestrictedPaths),nL({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:e,view_range:n})=>{if(!e)throw new Oi("read: file_path is required");let r=await mq(t,e);if(n?.length&&n.length!==2)throw new Oi("read: view_range must be [start_line, end_line]");let i;try{let l=await qp.stat(r);if(!l.isFile())throw new Oi(`read: ${e} is not a regular file`);let d=ozt(t.maxFileBytes);if(d!==null&&l.size>d){if(!n?.length)throw new Oi(`read: ${e} is ${l.size} bytes, exceeds ${d}-byte limit. Use the view_range parameter to read specific line ranges, e.g. view_range: [1, 500].`);let[m,h]=n;return await u7r(r,e,m,h,d)}i=await qp.readFile(r,"utf8")}catch(l){throw l instanceof Oi?l:new Oi(`read: ${aq(l,e)}`)}if(!n?.length)return i;let[s,o]=n,a=i.split(` +`),c=Math.max(0,s-1),u=o>0?o:a.length;return a.slice(c,u).join(` +`)}})}async function u7r(t,e,n,r,i){let s=new J4e(e,n,r,i);if(s.rangeIsEmpty())return"";let o=$J.createReadStream(t,{highWaterMark:r7r});try{for await(let a of o)if(s.collectFrom(a),s.rangeIsCollected())break}finally{o.destroy()}return s.text()}function uzt(t){return lL(t.unrestrictedPaths),nL({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:e,content:n})=>{if(!e)throw new Oi("write: file_path is required");let r=await mq(t,e),i=await azt(t,r);if(i!==void 0)throw new Oi(`write: ${e} is inside read-only directory ${i}`);try{await qp.mkdir(Ff.dirname(r),{recursive:!0,mode:MJ}),await Q4e(r,n??"")}catch(s){throw new Oi(`write: ${aq(s,e)}`)}return`wrote ${Buffer.byteLength(n??"")} bytes to ${e}`}})}function dzt(t){return lL(t.unrestrictedPaths),nL({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:e,old_string:n,new_string:r,replace_all:i})=>{if(!e)throw new Oi("edit: file_path is required");if(!n)throw new Oi("edit: old_string is required");let s=await mq(t,e),o=await azt(t,s);if(o!==void 0)throw new Oi(`edit: ${e} is inside read-only directory ${o}`);let a;try{let l=await qp.stat(s);if(!l.isFile())throw new Oi(`edit: ${e} is not a regular file`);let d=ozt(t.maxFileBytes);if(d!==null&&l.size>d)throw new Oi(`edit: ${e} is ${l.size} bytes, exceeds ${d}-byte limit. The edit tool loads the whole file and cannot modify a file this large.`);a=await qp.readFile(s,"utf8")}catch(l){throw l instanceof Oi?l:new Oi(`edit: ${aq(l,e)}`)}let c=a.split(n).length-1;if(c===0)throw new Oi(`edit: old_string not found in ${e}`);let u;if(i)u=a.split(n).join(r);else{if(c>1)throw new Oi(`edit: old_string appears ${c} times in ${e} (must be unique)`);u=a.replace(n,()=>r)}try{await Q4e(s,u)}catch(l){throw new Oi(`edit: write: ${aq(l,e)}`)}return`edited ${e} (${i?c:1} replacement(s))`}})}function d7r(t){return t.split(/[\\/{},]/).includes("..")}function pzt(t){return lL(t.unrestrictedPaths),nL({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:e,path:n})=>{if(!e)throw new Oi("glob: pattern is required");if(Ff.isAbsolute(e))throw new Oi("glob: absolute pattern not permitted; pass a relative pattern (and optionally path)");if(d7r(e))throw new Oi('glob: ".." is not permitted in the pattern');let r=n?await mq(t,n):Ff.resolve(t.workdir),i=n?r:await PJ(r),s=[],o=hzt;try{for await(let a of a7r(e,{cwd:r,withFileTypes:!0,exclude:c=>c.name===".git"||c.name==="node_modules"})){if(o--<=0)break;if(!a.isFile())continue;let c=Ff.join(a.parentPath,a.name),u;try{u=await qp.realpath(c)}catch{continue}if(!xye(i,u))continue;let l=0;try{l=(await qp.stat(c)).mtimeMs}catch{}s.push({path:c,mtime:l})}}catch(a){throw new Oi(`glob: ${a instanceof Error?a.message:String(a)}`)}return s.length===0?"no matches":(s.sort((a,c)=>c.mtime-a.mtime),s.slice(0,s7r).map(a=>a.path).join(` +`))}})}function mzt(t){return lL(t.unrestrictedPaths),nL({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:e,path:n},r)=>{if(!e)throw new Oi("grep: pattern is required");let i=Ff.resolve(t.workdir);n&&(i=await mq(t,n));let s=await g7r();return s?p7r(s,e,i,r?.signal):m7r(e,i,r?.signal)}})}function p7r(t,e,n,r){return new Promise((i,s)=>{let o=X4e.spawn(t,["-n","--no-heading","-e",e,"--",n],{...r?{signal:r}:{}}),a="",c="",u=!1;o.stdout.on("data",l=>{u||(a+=l,a.length>GJ&&(u=!0,a=a.slice(0,GJ),o.kill("SIGKILL")))}),o.stderr.on("data",l=>c+=l),o.on("close",l=>{if(r?.aborted)return s(new Oi("grep: aborted"));if(u)return i(a+` +[output truncated at ${GJ} bytes]`);if(l===0)return i(a);if(l===1)return i("no matches");s(new Oi(`grep: rg failed: ${c||`exit ${l}`}`))}),o.on("error",l=>{if(r?.aborted)return s(new Oi("grep: aborted"));s(new Oi(`grep: rg failed: ${l.message}`))})})}async function m7r(t,e,n){let r;try{r=new RegExp(t)}catch(c){throw new Oi(`grep: invalid regex: ${c instanceof Error?c.message:String(c)}`)}let i=[],s=GJ,o=c=>(s-=c.length+1,s<0?(i.push(`[output truncated at ${GJ} bytes]`),!1):(i.push(c),!0));if((await qp.stat(e).catch(()=>null))?.isFile()?await tzt(e,r,o):await f7r(e,"",c=>tzt(Ff.join(e,c),r,o),n),n?.aborted)throw new Oi("grep: aborted");return i.length===0?"no matches":i.join(` +`)}async function tzt(t,e,n){let r=$J.createReadStream(t,{encoding:"utf8"}),i=izt.createInterface({input:r,crlfDelay:1/0}),s=0;try{for await(let o of i)if(s++,!(o.length>i7r)&&e.test(o)&&!n(`${t}:${s}:${o}`))return!1}catch{}finally{r.destroy()}return!0}async function f7r(t,e,n,r){let i=hzt;async function s(o,a){if(a>h7r)return!0;if(r?.aborted)return!1;let c;try{c=await qp.readdir(Ff.join(t,o),{withFileTypes:!0})}catch{return!0}for(let u of c){if(u.name===".git"||u.name==="node_modules")continue;if(i--<=0||r?.aborted)return!1;let l=o?Ff.join(o,u.name):u.name;if(u.isDirectory()){if(!await s(l,a+1))return!1}else if(u.isFile()&&await n(l)===!1)return!1}return!0}await s(e,0)}async function g7r(){let t=(process.env.PATH??"").split(Ff.delimiter);for(let e of t){let n=Ff.join(e,"rg");try{return await qp.access(n,$J.constants.X_OK),n}catch{}}return null}var qp,$J,Ff,X4e,rzt,izt,Bye,Lf,iA,FJ,sL,L0,K4e,Nye,QJ,Dye,Pye,aL,cL,pq,oL,UJ,kB,nzt,X6t,Z6t,szt,n7r,r7r,ezt,GJ,i7r,s7r,Mye,o7r,a7r,Oye,J4e,h7r,hzt,gzt=v(()=>{p();Mf();qp=Ot(require("node:fs/promises"),1),$J=Ot(require("node:fs"),1),Ff=Ot(require("node:path"),1),X4e=Ot(require("node:child_process"),1),rzt=Ot(require("node:crypto"),1),izt=Ot(require("node:readline"),1);tc();eL();I6t();L4e();U4e();k6t();J6t();Z6t=100*1024,szt=12e4,n7r=256*1024,r7r=64*1024,ezt=Buffer.from(` +`),GJ=100*1024,i7r=2e3,s7r=200,Mye=class extends En{constructor(e){super(`bash command timed out after ${e}ms`),this.name="BashTimeoutError",this.timeoutMs=e}},o7r=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,a7r=qp.glob;Oye=class{constructor(e,n=l7r()){Bye.add(this),Lf.set(this,void 0),iA.set(this,""),FJ.set(this,!1),sL.set(this,!1),L0.set(this,null),Ht(this,Lf,X4e.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...n,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),Ce(this,Lf,"f").stdout.setEncoding("utf8"),Ce(this,Lf,"f").stderr.setEncoding("utf8"),Ce(this,Lf,"f").stdout.on("data",r=>Ce(this,Bye,"m",K4e).call(this,r)),Ce(this,Lf,"f").stderr.on("data",r=>Ce(this,Bye,"m",K4e).call(this,r)),Ce(this,Lf,"f").once("close",()=>{Ht(this,sL,!0,"f");let r=Ce(this,L0,"f");Ht(this,L0,null,"f"),r?.resolve()})}get closed(){return Ce(this,sL,"f")}async exec(e,n={}){if(Ce(this,sL,"f"))throw new En("bash session terminated");let r=n.timeoutMs??szt,i=n.signal;i?.throwIfAborted(),Ht(this,iA,"","f"),Ht(this,FJ,!1,"f");let s=`__ANT_CMD_${rzt.randomUUID()}_DONE__`,o=`${s.slice(0,8)}''${s.slice(8)}`,a=`{ ${e} } &1; printf '\\n${o}%d\\n' $? -`;if(xe(this,_m,"f").stdin.write(a),xe(this,Ff,"f").indexOf(i)<0){let{promise:m,resolve:f}=Q$();Wt(this,gE,{sentinel:i,resolve:f},"f");let g,A;try{await Promise.race([m,new Promise((y,b)=>{g=setTimeout(()=>b(new Mpe(r)),r)}),new Promise((y,b)=>{s&&(A=()=>b(s.reason),s.addEventListener("abort",A,{once:!0}))})])}finally{g&&clearTimeout(g),A&&s&&s.removeEventListener("abort",A),Wt(this,gE,null,"f")}}let c=xe(this,Ff,"f").indexOf(i);if(c<0)throw new gn("bash session terminated");let l=xe(this,Ff,"f").slice(c+i.length).match(/^(-?\d+)/),d=l?parseInt(l[1],10):-1,h=xe(this,Ff,"f").slice(0,c).replace(qIr,"").replace(/\n+$/,"");return xe(this,w9,"f")&&(h=`[output truncated] -${h}`),{output:h,exitCode:d}}close(){if(xe(this,rP,"f"))return;Wt(this,rP,!0,"f");let e=xe(this,gE,"f");Wt(this,gE,null,"f"),e?.resolve(),xe(this,_m,"f").stdout.destroy(),xe(this,_m,"f").stderr.destroy(),xe(this,_m,"f").stdin.destroy();try{process.kill(-xe(this,_m,"f").pid,"SIGKILL")}catch{xe(this,_m,"f").kill("SIGKILL")}xe(this,_m,"f").unref()}};_m=new WeakMap,Ff=new WeakMap,w9=new WeakMap,rP=new WeakMap,gE=new WeakMap,Dpe=new WeakSet,v2e=function(e){if(Wt(this,Ff,xe(this,Ff,"f")+e,"f"),xe(this,Ff,"f").length>RFt&&(Wt(this,Ff,xe(this,Ff,"f").slice(xe(this,Ff,"f").length-RFt),"f"),Wt(this,w9,!0,"f")),xe(this,gE,"f")&&xe(this,Ff,"f").indexOf(xe(this,gE,"f").sentinel)>=0){let n=xe(this,gE,"f");Wt(this,gE,null,"f"),n.resolve()}};R2e=class{constructor(e,n,r,s){Bpe.add(this),T9.set(this,void 0),Ppe.set(this,void 0),Ope.set(this,void 0),iP.set(this,void 0),oP.set(this,void 0),V$.set(this,void 0),sP.set(this,0),v9.set(this,[]),HR.set(this,0),Wt(this,T9,e,"f"),Wt(this,Ppe,n,"f"),Wt(this,Ope,r,"f"),Wt(this,iP,Math.max(0,n-1),"f"),Wt(this,oP,r>0?r:1/0,"f"),Wt(this,V$,s,"f")}rangeIsEmpty(){return xe(this,oP,"f")<=xe(this,iP,"f")}rangeIsCollected(){return xe(this,sP,"f")>=xe(this,oP,"f")}collectFrom(e){var n;let r=0;for(;r=xe(this,iP,"f")&&xe(this,Bpe,"m",DFt).call(this,e.subarray(r,i),s>=0),s<0)break;Wt(this,sP,(n=xe(this,sP,"f"),n++,n),"f"),r=s+1}}text(){return Buffer.concat(xe(this,v9,"f"),xe(this,HR,"f")).toString("utf8")}};T9=new WeakMap,Ppe=new WeakMap,Ope=new WeakMap,iP=new WeakMap,oP=new WeakMap,V$=new WeakMap,sP=new WeakMap,v9=new WeakMap,HR=new WeakMap,Bpe=new WeakSet,DFt=function(e,n){if(xe(this,v9,"f").push(e),Wt(this,HR,xe(this,HR,"f")+e.length,"f"),n&&xe(this,sP,"f")+1xe(this,V$,"f"))throw xe(this,Bpe,"m",vFt).call(this)},vFt=function(){return xe(this,oP,"f")-xe(this,iP,"f")===1?new ks(`read: line ${xe(this,iP,"f")+1} of ${xe(this,T9,"f")} alone exceeds ${xe(this,V$,"f")}-byte limit. The read tool cannot return part of a line, so view_range cannot narrow this further.`):new ks(`read: view_range [${xe(this,Ppe,"f")}, ${xe(this,Ope,"f")}] of ${xe(this,T9,"f")} exceeds ${xe(this,V$,"f")}-byte limit. Narrow the view_range to read a smaller portion.`)};XIr=40,qFt=5e4});function rxr(t){return t.resources.some(e=>e.type==="memory_store")}function sxr(t){if(!t)return null;let e;try{let r=t.replace(/-/g,"+").replace(/_/g,"/"),s=r.padEnd(Math.ceil(r.length/4)*4,"=");e=JSON.parse(YB(eLt(s)))}catch{return null}if(e===null||typeof e!="object"||Array.isArray(e))return null;let n=e.sessions_token;return typeof n=="string"&&n!==""?n:null}async function YFt(t,e){let n;try{return await Promise.race([t.then(()=>!1,()=>!1),new Promise(r=>{n=setTimeout(()=>r(!0),e)})])}finally{n!==void 0&&clearTimeout(n)}}async function ixr(t,e,n,r){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...r,headers:gt([r?.headers])})}catch(s){Kd(s,409)||n.error("force-stop on exit failed",{work_id:e.id,error:String(s)})}}function oxr(t){let e=t instanceof Xc?t.error:void 0;for(let n of["error","details","current_state"]){if(!AUe(e))return{};e=e[n]}return AUe(e)?e:{}}async function axr(t,e,n,r,s,i){let o=jFt,a=txr,c=Date.now(),u=nxr,l=async()=>{let d=new AbortController,h=LR(n.signal,d),m=setTimeout(()=>d.abort(),o);try{let f=await t.beta.environments.work.heartbeat(e.id,{environment_id:e.environment_id,expected_last_heartbeat:u},{...s,headers:gt([s?.headers]),signal:d.signal});c=Date.now(),u=f.last_heartbeat,f.ttl_seconds>0&&(a=f.ttl_seconds*1e3,o=Math.max(1e3,Math.min(a/2,jFt)),i?.(a)),(f.state==="stopping"||f.state==="stopped")&&(r.info("heartbeat signals shutdown",{work_id:e.id,state:f.state}),n.finish("control_plane_stop")),f.lease_extended||(r.warn("lease not extended, shutting down",{work_id:e.id}),n.finish("control_plane_stop"))}catch(f){if(n.signal.throwIfAborted(),Kd(f,412)){let g=oxr(f);r.error("lease lost: heartbeat precondition failed",{work_id:e.id,server_state:g.state,server_ttl_seconds:g.ttl_seconds,server_last_heartbeat:g.last_heartbeat}),n.finish("lease_lost");return}if(FR(f))throw r.error("permanent heartbeat failure",{work_id:e.id,error:String(f)}),n.finish("heartbeat_rejected"),f;if(Date.now()-c>a){r.error("lease assumed lost: no successful heartbeat in ttl",{work_id:e.id,ttl_ms:a,error:String(f)}),n.finish("assumed_lost");return}r.warn("transient heartbeat failure",{work_id:e.id,error:String(f)})}finally{clearTimeout(m),h()}};for(await l();!n.signal.aborted;)await g_(o,n.signal),n.signal.throwIfAborted(),await l()}var Fpe,N9,N2e,D9,Y$,jFt,txr,nxr,K$,D2e,B2e=V(()=>{p();Em();Ra();y_();NUe();KB();y$();m$();v$();tpe();bm();Ys();bpe();upe();c2e();Spe();jFt=3e4,txr=9e4,nxr="NO_HEARTBEAT";K$=class{constructor(e){if(Fpe.add(this),N9.set(this,void 0),e.unrestrictedPaths!==void 0)throw new gn("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory.");this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.tools=e.tools,this.workdir=e.workdir??process.cwd(),this.maxFileBytes=e.maxFileBytes,this.maxIdleMs=e.maxIdleMs,e.memorySyncIntervalMs!=null&&_pe(e.memorySyncIntervalMs,"memorySyncIntervalMs"),this.memorySyncIntervalMs=e.memorySyncIntervalMs,this.memorySyncDeletions=e.memorySyncDeletions??"enabled",this.workerId=e.workerId,this.requestOptions=e.requestOptions,Wt(this,N9,e.signal,"f")}async run(e){let{environmentId:n,environmentKey:r}=this;if(n===void 0||r===void 0)throw new gn("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let s=e??xe(this,N9,"f"),i=new QR({client:this.client,environmentId:n,environmentKey:r,...this.workerId!==void 0?{workerId:this.workerId}:{},...s?{signal:s}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let o of i)try{await xe(this,Fpe,"m",N2e).call(this,o,r,i.signal)}catch(a){if(i.signal?.aborted)throw a;Ji(this.client).error("work item failed",{work_id:o.id,error:String(a)})}}async handleItem(e){let n=e?.workId??Di("ANTHROPIC_WORK_ID"),r=e?.environmentId??Di("ANTHROPIC_ENVIRONMENT_ID"),s=e?.sessionId??Di("ANTHROPIC_SESSION_ID"),i=e?.environmentKey??this.environmentKey??Di("ANTHROPIC_ENVIRONMENT_KEY"),o=e?.workSecret||Di("ANTHROPIC_WORK_SECRET")||null;if(!n)throw new gn("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!r)throw new gn("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!s)throw new gn("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!i)throw new gn("handleItem: environmentKey is required \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let a={id:n,environment_id:r,secret:o,data:{type:"session",id:s}};await xe(this,Fpe,"m",N2e).call(this,a,i,e?.signal??xe(this,N9,"f"))}};N9=new WeakMap,Fpe=new WeakSet,N2e=async function(e,n,r){let s=Ji(this.client),i=sxr(e.secret);e.secret&&i===null&&s.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key",{work_id:e.id});let o=i??n,a=spe(this.client,{authToken:o,helper:"environments-worker"}),c=e.data.id,u=new AbortController,l=LR(r,u),d=new D2e(u),h=await Promise.resolve().then(()=>(VFt(),HFt)),m,f,g=axr(a,e,d,s,this.requestOptions,S=>{m=S,f?._setSendRetryWindow(S)}).catch(S=>{u.signal.aborted||s.error("heartbeat loop failed",{work_id:e.id,error:String(S)}),u.abort()}),A=async()=>{},y,b=!1;try{if(e.data.type!=="session"){s.debug("skipping non-session work item",{work_id:e.id,type:e.data.type});return}let S=await a.beta.sessions.retrieve(c);if(i===null&&this.memorySyncIntervalMs!==null&&rxr(S))throw new h.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${e.id}, session_id=${c}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`);let C={workdir:this.workdir,client:a,session:S,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{A=await h.setupSkills(C)}catch(x){s.warn("skill setup failed",{session_id:c,work_id:e.id,error:String(x)})}i!==null&&this.memorySyncIntervalMs!==null?(y=new h.SessionMemoryStores(a,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await y.download(S),C.allowedRoots=y.roots,C.readOnlyRoots=y.readOnlyRoots):s.debug("memory stores disabled for this item",{work_id:e.id});let I=typeof this.tools=="function"?this.tools(C):this.tools??h.betaAgentToolset20260401(C);f=new GR(c,{client:a,tools:I,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:u.signal}),m!==void 0&&f._setSendRetryWindow(m);for await(let x of f)y&&await y.syncIfDue();b=!u.signal.aborted}finally{try{await A().catch(S=>{s.warn("skill cleanup failed",{session_id:c,work_id:e.id,error:String(S)})})}finally{if(y){let S=h.MEMORY_FLUSH_TIMEOUT_MS;b&&await YFt(y.finish(),S)&&s.warn(`final memory sync cut off after ${S}ms; the flush that follows still uploads changed files`,{session_id:c,work_id:e.id});let C=new AbortController;await YFt(y.flushWrites(C.signal),S)&&(C.abort(),s.warn(`memory flush cut off after ${S}ms; changed files it had not uploaded yet are not saved`,{session_id:c,work_id:e.id})),await y.dispose().catch(x=>{s.warn("memory store cleanup failed",{session_id:c,work_id:e.id,error:String(x)})})}}d.finish("runner_done"),l(),await g,d.lost?s.info("lease lost; released without stopping it",{session_id:c,work_id:e.id}):await ixr(a,e,s,this.requestOptions)}};D2e=class{constructor(e){D9.set(this,void 0),Y$.set(this,void 0),Wt(this,D9,e,"f")}get signal(){return xe(this,D9,"f").signal}finish(e){Wt(this,Y$,xe(this,Y$,"f")??e,"f"),xe(this,D9,"f").abort()}get lost(){return xe(this,Y$,"f")==="lease_lost"||xe(this,Y$,"f")==="assumed_lost"}};D9=new WeakMap,Y$=new WeakMap});var VR,P2e=V(()=>{p();os();$s();Ys();ii();upe();B2e();upe();B2e();VR=class extends En{retrieve(e,n,r){let{environment_id:s,betas:i}=n;return this._client.get(xt`/v1/environments/${s}/work/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,n,r){let{environment_id:s,betas:i,...o}=n;return this._client.post(xt`/v1/environments/${s}/work/${e}?beta=true`,{body:o,...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/environments/${e}/work?beta=true`,cr,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}ack(e,n,r){let{environment_id:s,betas:i}=n;return this._client.post(xt`/v1/environments/${s}/work/${e}/ack?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}heartbeat(e,n,r){let{environment_id:s,desired_ttl_seconds:i,expected_last_heartbeat:o,betas:a}=n;return this._client.post(xt`/v1/environments/${s}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:i,expected_last_heartbeat:o},...r,headers:gt([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}poll(e,n={},r){let{betas:s,"Anthropic-Worker-ID":i,...o}=n??{};return this._client.get(xt`/v1/environments/${e}/work/poll?beta=true`,{query:o,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"Anthropic-Worker-ID":i}:void 0},r?.headers])})}stats(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/environments/${e}/work/stats?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}stop(e,n,r){let{environment_id:s,betas:i,...o}=n;return this._client.post(xt`/v1/environments/${s}/work/${e}/stop?beta=true`,{body:o,...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}poller(e){return new QR({...e,client:this._client})}worker(e){return new K$({...e,client:this._client})}};VR.WorkPoller=QR;VR.EnvironmentWorker=K$});var cP,O2e=V(()=>{p();os();P2e();P2e();$s();Ys();ii();cP=class extends En{constructor(){super(...arguments),this.work=new VR(this._client)}create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/environments?beta=true",{body:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/environments/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/environments/${e}?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/environments?beta=true",cr,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,n={},r){let{betas:s}=n??{};return this._client.delete(xt`/v1/environments/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/environments/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}};cP.Work=VR});var z$,M2e=V(()=>{p();os();$s();Ys();ii();z$=class extends En{create(e,n,r){let{view:s,betas:i,...o}=n;return this._client.post(xt`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:s},body:o,...r,headers:gt([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}retrieve(e,n,r){let{memory_store_id:s,betas:i,...o}=n;return this._client.get(xt`/v1/memory_stores/${s}/memories/${e}?beta=true`,{query:o,...r,headers:gt([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}update(e,n,r){let{memory_store_id:s,view:i,betas:o,...a}=n;return this._client.post(xt`/v1/memory_stores/${s}/memories/${e}?beta=true`,{query:{view:i},body:a,...r,headers:gt([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/memory_stores/${e}/memories?beta=true`,cr,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}delete(e,n,r){let{memory_store_id:s,expected_content_sha256:i,betas:o}=n;return this._client.delete(xt`/v1/memory_stores/${s}/memories/${e}?beta=true`,{query:{expected_content_sha256:i},...r,headers:gt([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}}});var J$,L2e=V(()=>{p();os();$s();Ys();ii();J$=class extends En{retrieve(e,n,r){let{memory_store_id:s,betas:i,...o}=n;return this._client.get(xt`/v1/memory_stores/${s}/memory_versions/${e}?beta=true`,{query:o,...r,headers:gt([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/memory_stores/${e}/memory_versions?beta=true`,cr,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}redact(e,n,r){let{memory_store_id:s,betas:i}=n;return this._client.post(xt`/v1/memory_stores/${s}/memory_versions/${e}/redact?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}}});var jR,F2e=V(()=>{p();os();M2e();M2e();L2e();L2e();$s();Ys();ii();jR=class extends En{constructor(){super(...arguments),this.memories=new z$(this._client),this.memoryVersions=new J$(this._client)}create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/memory_stores?beta=true",{body:s,...n,headers:gt([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/memory_stores/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}update(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/memory_stores/${e}?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",cr,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}delete(e,n={},r){let{betas:s}=n??{};return this._client.delete(xt`/v1/memory_stores/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/memory_stores/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}};jR.Memories=z$;jR.MemoryVersions=J$});var X$=V(()=>{p();Ra()});var Z$,Q2e=V(()=>{p();Ra();f$();QUe();Z$=class t{constructor(e,n){this.iterator=e,this.controller=n}async*decoder(){let e=new Mx;for await(let n of this.iterator)for(let r of e.decode(n))yield JSON.parse(r);for(let n of e.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,n){if(!e.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new gn("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new gn("Attempted to iterate over a response with no body");return new t(e9(e.body),n)}}});var eG,U2e=V(()=>{p();os();$s();Ys();Q2e();X$();ii();eG=class extends En{create(e,n){let{betas:r,user_profile_id:s,...i}=e;return this._client.post("/v1/messages/batches?beta=true",{body:i,...n,headers:gt([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...s!=null?{"anthropic-user-profile-id":s}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/messages/batches/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Bu,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}delete(e,n={},r){let{betas:s}=n??{};return this._client.delete(xt`/v1/messages/batches/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},r?.headers])})}cancel(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/messages/batches/${e}/cancel?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},r?.headers])})}async results(e,n={},r){let s=await this.retrieve(e);if(!s.results_url)throw new gn(`No batch \`results_url\`; Has it finished processing? ${s.processing_status} - ${s.id}`);let{betas:i}=n??{};return this._client.get(s.results_url,{...r,headers:gt([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,a)=>Z$.fromResponse(a.response,a.controller))}}});var Qpe,$2e=V(()=>{p();Qpe={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function KFt(t){return t?.output_format??t?.output_config?.format}function G2e(t,e,n){let r=KFt(e);return!e||!("parse"in(r??{}))?{...t,content:t.content.map(s=>{if(s.type==="text"){let i=Object.defineProperty({...s},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(i,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return s}),parsed_output:null}:W2e(t,e,n)}function W2e(t,e,n){let r=null,s=t.content.map(i=>{if(i.type==="text"){let o=mxr(e,i.text);r===null&&(r=o);let a=Object.defineProperty({...i},"parsed_output",{value:o,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),o},enumerable:!1})}return i});return{...t,content:s,parsed_output:r}}function mxr(t,e){let n=KFt(t);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(e):JSON.parse(e)}catch(r){throw new gn(`Failed to parse structured output: ${r}`)}}var q2e=V(()=>{p();Ra()});var H2e=V(()=>{p();i9()});var fxr,tG,gxr,Axr,zFt,JFt=V(()=>{p();fxr=t=>{let e=0,n=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),tG(t);break;case"number":let n=e.value[e.value.length-1];if(n==="."||n==="-"||n==="+"||n==="e"||n==="E")return t=t.slice(0,t.length-1),tG(t);case"string":let r=t[t.length-2];if(r?.type==="delimiter")return t=t.slice(0,t.length-1),tG(t);if(r?.type==="brace"&&r.value==="{")return t=t.slice(0,t.length-1),tG(t);break;case"delimiter":return t=t.slice(0,t.length-1),tG(t);break}return t},gxr=t=>{let e=[];return t.map(n=>{n.type==="brace"&&(n.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(n=>{n==="}"?t.push({type:"brace",value:"}"}):n==="]"&&t.push({type:"paren",value:"]"})}),t},Axr=t=>{let e="";return t.map(n=>{n.type==="string"?e+='"'+n.value+'"':e+=n.value}),e},zFt=t=>JSON.parse(Axr(gxr(tG(fxr(t)))))});function Upe(t,e){let n={};for(let i of Object.keys(t))i!=="input"&&(n[i]=t[i]);Object.defineProperty(n,YR,{value:e,enumerable:!1,writable:!0});let r,s=!1;return Object.defineProperty(n,"input",{enumerable:!0,configurable:!0,get(){return s||(r=e?zFt(e):{},s=!0),r}}),n}var YR,V2e=V(()=>{p();JFt();YR="__json_buf"});function X2e(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var Qf,KR,nG,B9,$pe,P9,O9,Gpe,M9,uC,L9,Wpe,qpe,lP,Hpe,Vpe,jpe,F9,j2e,XFt,Q9,Y2e,K2e,z2e,ZFt,J2e,Ype,tQt=V(()=>{p();Em();E_();X$();DR();bm();H2e();q2e();V2e();Ype=class t{constructor(e,n){Qf.add(this),this.messages=[],this.receivedMessages=[],KR.set(this,void 0),nG.set(this,null),this.controller=new AbortController,B9.set(this,void 0),$pe.set(this,()=>{}),P9.set(this,()=>{}),O9.set(this,void 0),Gpe.set(this,()=>{}),M9.set(this,()=>{}),uC.set(this,{}),L9.set(this,!1),Wpe.set(this,!1),qpe.set(this,!1),lP.set(this,!1),Hpe.set(this,void 0),Vpe.set(this,void 0),jpe.set(this,void 0),F9.set(this,void 0),Q9.set(this,r=>{if(Wt(this,Wpe,!0,"f"),uE(r)&&(r=new Mp),r instanceof Mp)return Wt(this,qpe,!0,"f"),this._emit("abort",r);if(r instanceof gn)return this._emit("error",r);if(r instanceof Error){let s=new gn(r.message);return s.cause=r,this._emit("error",s)}return this._emit("error",new gn(String(r)))}),Wt(this,B9,new Promise((r,s)=>{Wt(this,$pe,r,"f"),Wt(this,P9,s,"f")}),"f"),Wt(this,O9,new Promise((r,s)=>{Wt(this,Gpe,r,"f"),Wt(this,M9,s,"f")}),"f"),xe(this,B9,"f").catch(()=>{}),xe(this,O9,"f").catch(()=>{}),Wt(this,nG,e,"f"),Wt(this,F9,n?.logger??console,"f")}get response(){return xe(this,Hpe,"f")}get request_id(){return xe(this,Vpe,"f")}get workspace_id(){return xe(this,jpe,"f")}async withResponse(){Wt(this,lP,!0,"f");let e=await xe(this,B9,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id"),workspace_id:e.headers.get("anthropic-workspace-id")}}static fromReadableStream(e){let n=new t(null);return n._run(()=>n._fromReadableStream(e)),n}static createMessage(e,n,r,{logger:s}={}){let i=new t(n,{logger:s});for(let o of n.messages)i._addMessageParam(o);return Wt(i,nG,{...n,stream:!0},"f"),i._run(()=>i._createMessage(e,{...n,stream:!0},{...r,headers:{...r?.headers,[zde]:"stream"}})),i}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},xe(this,Q9,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,n=!0){this.receivedMessages.push(e),n&&this._emit("message",e)}async _createMessage(e,n,r){let s=r?.signal,i;s&&(s.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),s.addEventListener("abort",i));try{xe(this,Qf,"m",Y2e).call(this);let{response:o,data:a}=await e.create({...n,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(o);for await(let c of a)xe(this,Qf,"m",K2e).call(this,c);if(a.controller.signal?.aborted)throw new Mp;xe(this,Qf,"m",z2e).call(this)}finally{s&&i&&s.removeEventListener("abort",i)}}_connected(e){this.ended||(Wt(this,Hpe,e,"f"),Wt(this,Vpe,e?.headers.get("request-id"),"f"),Wt(this,jpe,e?.headers.get("anthropic-workspace-id"),"f"),xe(this,$pe,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,L9,"f")}get errored(){return xe(this,Wpe,"f")}get aborted(){return xe(this,qpe,"f")}abort(){this.controller.abort()}on(e,n){return(xe(this,uC,"f")[e]||(xe(this,uC,"f")[e]=[])).push({listener:n}),this}off(e,n){let r=xe(this,uC,"f")[e];if(!r)return this;let s=r.findIndex(i=>i.listener===n);return s>=0&&r.splice(s,1),this}once(e,n){return(xe(this,uC,"f")[e]||(xe(this,uC,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,r)=>{Wt(this,lP,!0,"f"),e!=="error"&&this.once("error",r),this.once(e,n)})}async done(){Wt(this,lP,!0,"f"),await xe(this,O9,"f")}get currentMessage(){return xe(this,KR,"f")}async finalMessage(){return await this.done(),xe(this,Qf,"m",j2e).call(this)}async finalText(){return await this.done(),xe(this,Qf,"m",XFt).call(this)}_emit(e,...n){if(xe(this,L9,"f"))return;e==="end"&&(Wt(this,L9,!0,"f"),xe(this,Gpe,"f").call(this));let r=xe(this,uC,"f")[e];if(r&&(xe(this,uC,"f")[e]=r.filter(s=>!s.once),r.forEach(({listener:s})=>s(...n))),e==="abort"){let s=n[0];!xe(this,lP,"f")&&!r?.length&&Promise.reject(s),xe(this,P9,"f").call(this,s),xe(this,M9,"f").call(this,s),this._emit("end");return}if(e==="error"){let s=n[0];!xe(this,lP,"f")&&!r?.length&&Promise.reject(s),xe(this,P9,"f").call(this,s),xe(this,M9,"f").call(this,s),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,Qf,"m",j2e).call(this))}async _fromReadableStream(e,n){let r=n?.signal,s;r&&(r.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),r.addEventListener("abort",s));try{xe(this,Qf,"m",Y2e).call(this),this._connected(null);let i=lA.fromReadableStream(e,this.controller);for await(let o of i)xe(this,Qf,"m",K2e).call(this,o);if(i.controller.signal?.aborted)throw new Mp;xe(this,Qf,"m",z2e).call(this)}finally{r&&s&&r.removeEventListener("abort",s)}}[(KR=new WeakMap,nG=new WeakMap,B9=new WeakMap,$pe=new WeakMap,P9=new WeakMap,O9=new WeakMap,Gpe=new WeakMap,M9=new WeakMap,uC=new WeakMap,L9=new WeakMap,Wpe=new WeakMap,qpe=new WeakMap,lP=new WeakMap,Hpe=new WeakMap,Vpe=new WeakMap,jpe=new WeakMap,F9=new WeakMap,Q9=new WeakMap,Qf=new WeakSet,j2e=function(){if(this.receivedMessages.length===0)throw new gn("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},XFt=function(){if(this.receivedMessages.length===0)throw new gn("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(n.length===0)throw new gn("stream ended without producing a content block with type=text");return n.join(" ")},Y2e=function(){this.ended||Wt(this,KR,void 0,"f")},K2e=function(n){if(this.ended)return;let r=xe(this,Qf,"m",ZFt).call(this,n);switch(this._emit("streamEvent",n,r),n.type){case"content_block_delta":{let s=r.content.at(-1);switch(n.delta.type){case"text_delta":{s.type==="text"&&this._emit("text",n.delta.text,s.text||"");break}case"citations_delta":{s.type==="text"&&this._emit("citation",n.delta.citation,s.citations??[]);break}case"input_json_delta":{if(X2e(s)&&xe(this,uC,"f").inputJson?.length){let i;try{i=s.input}catch(o){xe(this,Q9,"f").call(this,xe(this,Qf,"m",J2e).call(this,s,o));break}this._emit("inputJson",n.delta.partial_json,i)}break}case"thinking_delta":{s.type==="thinking"&&this._emit("thinking",n.delta.thinking,s.thinking);break}case"signature_delta":{s.type==="thinking"&&this._emit("signature",s.signature);break}case"compaction_delta":{s.type==="compaction"&&s.content&&this._emit("compaction",s.content);break}default:n.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(G2e(r,xe(this,nG,"f"),{logger:xe(this,F9,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{Wt(this,KR,r,"f");break}case"content_block_start":case"message_delta":break}},z2e=function(){if(this.ended)throw new gn("stream has ended, this shouldn't happen");let n=xe(this,KR,"f");if(!n)throw new gn("request ended without sending any chunks");return Wt(this,KR,void 0,"f"),G2e(n,xe(this,nG,"f"),{logger:xe(this,F9,"f")})},ZFt=function(n){let r=xe(this,KR,"f");if(n.type==="message_start"){if(r)throw new gn(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!r)throw new gn(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return r;case"message_delta":return r.stop_reason=n.delta.stop_reason,r.stop_sequence=n.delta.stop_sequence,r.stop_details=n.delta.stop_details,r.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(r.container=n.delta.container),n.context_management!=null&&(r.context_management=n.context_management),n.input_transformations!=null&&(r.input_transformations=n.input_transformations),n.usage.input_tokens!=null&&(r.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(r.usage.server_tool_use=n.usage.server_tool_use),n.usage.iterations!=null&&(r.usage.iterations=n.usage.iterations),n.usage.fallback_credit!=null&&(r.usage.fallback_credit=n.usage.fallback_credit),n.usage.output_tokens_details!=null&&(r.usage.output_tokens_details=n.usage.output_tokens_details),r;case"content_block_start":return r.content.push(n.content_block),n.content_block.type==="fallback"&&(r.model=n.content_block.to.model),r;case"content_block_delta":{let s=r.content.at(n.index);switch(n.delta.type){case"text_delta":{s?.type==="text"&&(r.content[n.index]={...s,text:(s.text||"")+n.delta.text});break}case"citations_delta":{s?.type==="text"&&(r.content[n.index]={...s,citations:[...s.citations??[],n.delta.citation]});break}case"input_json_delta":{if(s&&X2e(s)){let i=(s[YR]||"")+n.delta.partial_json;r.content[n.index]=Upe(s,i)}break}case"thinking_delta":{s?.type==="thinking"&&(r.content[n.index]={...s,thinking:s.thinking+n.delta.thinking});break}case"signature_delta":{s?.type==="thinking"&&(r.content[n.index]={...s,signature:n.delta.signature});break}case"compaction_delta":{s?.type==="compaction"&&(r.content[n.index]={...s,content:(s.content||"")+n.delta.content,encrypted_content:n.delta.encrypted_content});break}default:n.delta}return r}case"content_block_stop":{let s=r.content.at(n.index);if(s&&X2e(s)&&YR in s){let i;try{i=s.input}catch(o){i={},xe(this,Q9,"f").call(this,xe(this,Qf,"m",J2e).call(this,s,o))}Object.defineProperty(s,"input",{value:i,enumerable:!0,configurable:!0,writable:!0})}return r}}},J2e=function(n,r){let s=n[YR];return new gn(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${r}. JSON: ${s}`)},Symbol.asyncIterator)](){let e=[],n=[],r=!1;return this.on("streamEvent",s=>{let i=n.shift();i?i.resolve(s):e.push(s)}),this.on("end",()=>{r=!0;for(let s of n)s.resolve(void 0);n.length=0}),this.on("abort",s=>{r=!0;for(let i of n)i.reject(s);n.length=0}),this.on("error",s=>{r=!0;for(let i of n)i.reject(s);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((i,o)=>n.push({resolve:i,reject:o})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new lA(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var nQt,rQt=V(()=>{p();nQt=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: +`;if(Ce(this,Lf,"f").stdin.write(a),Ce(this,iA,"f").indexOf(s)<0){let{promise:h,resolve:f}=oq();Ht(this,L0,{sentinel:s,resolve:f},"f");let g,A;try{await Promise.race([h,new Promise((y,E)=>{g=setTimeout(()=>E(new Mye(r)),r)}),new Promise((y,E)=>{i&&(A=()=>E(i.reason),i.addEventListener("abort",A,{once:!0}))})])}finally{g&&clearTimeout(g),A&&i&&i.removeEventListener("abort",A),Ht(this,L0,null,"f")}}let c=Ce(this,iA,"f").indexOf(s);if(c<0)throw new En("bash session terminated");let l=Ce(this,iA,"f").slice(c+s.length).match(/^(-?\d+)/),d=l?parseInt(l[1],10):-1,m=Ce(this,iA,"f").slice(0,c).replace(o7r,"").replace(/\n+$/,"");return Ce(this,FJ,"f")&&(m=`[output truncated] +${m}`),{output:m,exitCode:d}}close(){if(Ce(this,sL,"f"))return;Ht(this,sL,!0,"f");let e=Ce(this,L0,"f");Ht(this,L0,null,"f"),e?.resolve(),Ce(this,Lf,"f").stdout.destroy(),Ce(this,Lf,"f").stderr.destroy(),Ce(this,Lf,"f").stdin.destroy();try{process.kill(-Ce(this,Lf,"f").pid,"SIGKILL")}catch{Ce(this,Lf,"f").kill("SIGKILL")}Ce(this,Lf,"f").unref()}};Lf=new WeakMap,iA=new WeakMap,FJ=new WeakMap,sL=new WeakMap,L0=new WeakMap,Bye=new WeakSet,K4e=function(e){if(Ht(this,iA,Ce(this,iA,"f")+e,"f"),Ce(this,iA,"f").length>Z6t&&(Ht(this,iA,Ce(this,iA,"f").slice(Ce(this,iA,"f").length-Z6t),"f"),Ht(this,FJ,!0,"f")),Ce(this,L0,"f")&&Ce(this,iA,"f").indexOf(Ce(this,L0,"f").sentinel)>=0){let n=Ce(this,L0,"f");Ht(this,L0,null,"f"),n.resolve()}};J4e=class{constructor(e,n,r,i){Nye.add(this),QJ.set(this,void 0),Dye.set(this,void 0),Pye.set(this,void 0),aL.set(this,void 0),cL.set(this,void 0),pq.set(this,void 0),oL.set(this,0),UJ.set(this,[]),kB.set(this,0),Ht(this,QJ,e,"f"),Ht(this,Dye,n,"f"),Ht(this,Pye,r,"f"),Ht(this,aL,Math.max(0,n-1),"f"),Ht(this,cL,r>0?r:1/0,"f"),Ht(this,pq,i,"f")}rangeIsEmpty(){return Ce(this,cL,"f")<=Ce(this,aL,"f")}rangeIsCollected(){return Ce(this,oL,"f")>=Ce(this,cL,"f")}collectFrom(e){var n;let r=0;for(;r=Ce(this,aL,"f")&&Ce(this,Nye,"m",nzt).call(this,e.subarray(r,s),i>=0),i<0)break;Ht(this,oL,(n=Ce(this,oL,"f"),n++,n),"f"),r=i+1}}text(){return Buffer.concat(Ce(this,UJ,"f"),Ce(this,kB,"f")).toString("utf8")}};QJ=new WeakMap,Dye=new WeakMap,Pye=new WeakMap,aL=new WeakMap,cL=new WeakMap,pq=new WeakMap,oL=new WeakMap,UJ=new WeakMap,kB=new WeakMap,Nye=new WeakSet,nzt=function(e,n){if(Ce(this,UJ,"f").push(e),Ht(this,kB,Ce(this,kB,"f")+e.length,"f"),n&&Ce(this,oL,"f")+1Ce(this,pq,"f"))throw Ce(this,Nye,"m",X6t).call(this)},X6t=function(){return Ce(this,cL,"f")-Ce(this,aL,"f")===1?new Oi(`read: line ${Ce(this,aL,"f")+1} of ${Ce(this,QJ,"f")} alone exceeds ${Ce(this,pq,"f")}-byte limit. The read tool cannot return part of a line, so view_range cannot narrow this further.`):new Oi(`read: view_range [${Ce(this,Dye,"f")}, ${Ce(this,Pye,"f")}] of ${Ce(this,QJ,"f")} exceeds ${Ce(this,pq,"f")}-byte limit. Narrow the view_range to read a smaller portion.`)};h7r=40,hzt=5e4});function E7r(t){return t.resources.some(e=>e.type==="memory_store")}function b7r(t){if(!t)return null;let e;try{let r=t.replace(/-/g,"+").replace(/_/g,"/"),i=r.padEnd(Math.ceil(r.length/4)*4,"=");e=JSON.parse(zO(C9t(i)))}catch{return null}if(e===null||typeof e!="object"||Array.isArray(e))return null;let n=e.sessions_token;return typeof n=="string"&&n!==""?n:null}async function yzt(t,e){let n;try{return await Promise.race([t.then(()=>!1,()=>!1),new Promise(r=>{n=setTimeout(()=>r(!0),e)})])}finally{n!==void 0&&clearTimeout(n)}}async function _7r(t,e,n,r){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...r,headers:pt([r?.headers])})}catch(i){Hp(i,409)||n.error("force-stop on exit failed",{work_id:e.id,error:String(i)})}}function x7r(t){let e=t instanceof Hl?t.error:void 0;for(let n of["error","details","current_state"]){if(!Q3e(e))return{};e=e[n]}return Q3e(e)?e:{}}async function S7r(t,e,n,r,i,s){let o=Azt,a=A7r,c=Date.now(),u=y7r,l=async()=>{let d=new AbortController,m=xB(n.signal,d),h=setTimeout(()=>d.abort(),o);try{let f=await t.beta.environments.work.heartbeat(e.id,{environment_id:e.environment_id,expected_last_heartbeat:u},{...i,headers:pt([i?.headers]),signal:d.signal});c=Date.now(),u=f.last_heartbeat,f.ttl_seconds>0&&(a=f.ttl_seconds*1e3,o=Math.max(1e3,Math.min(a/2,Azt)),s?.(a)),(f.state==="stopping"||f.state==="stopped")&&(r.info("heartbeat signals shutdown",{work_id:e.id,state:f.state}),n.finish("control_plane_stop")),f.lease_extended||(r.warn("lease not extended, shutting down",{work_id:e.id}),n.finish("control_plane_stop"))}catch(f){if(n.signal.throwIfAborted(),Hp(f,412)){let g=x7r(f);r.error("lease lost: heartbeat precondition failed",{work_id:e.id,server_state:g.state,server_ttl_seconds:g.ttl_seconds,server_last_heartbeat:g.last_heartbeat}),n.finish("lease_lost");return}if(SB(f))throw r.error("permanent heartbeat failure",{work_id:e.id,error:String(f)}),n.finish("heartbeat_rejected"),f;if(Date.now()-c>a){r.error("lease assumed lost: no successful heartbeat in ttl",{work_id:e.id,ttl_ms:a,error:String(f)}),n.finish("assumed_lost");return}r.warn("transient heartbeat failure",{work_id:e.id,error:String(f)})}finally{clearTimeout(h),m()}};for(await l();!n.signal.aborted;)await lx(o,n.signal),n.signal.throwIfAborted(),await l()}var Lye,WJ,Z4e,HJ,hq,Azt,A7r,y7r,fq,e8e,t8e=v(()=>{p();Mf();tc();dx();Z3e();KO();QH();MH();zH();eye();Of();Ui();Eye();lye();k4e();_ye();Azt=3e4,A7r=9e4,y7r="NO_HEARTBEAT";fq=class{constructor(e){if(Lye.add(this),WJ.set(this,void 0),e.unrestrictedPaths!==void 0)throw new En("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory.");this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.tools=e.tools,this.workdir=e.workdir??process.cwd(),this.maxFileBytes=e.maxFileBytes,this.maxIdleMs=e.maxIdleMs,e.memorySyncIntervalMs!=null&&bye(e.memorySyncIntervalMs,"memorySyncIntervalMs"),this.memorySyncIntervalMs=e.memorySyncIntervalMs,this.memorySyncDeletions=e.memorySyncDeletions??"enabled",this.workerId=e.workerId,this.requestOptions=e.requestOptions,Ht(this,WJ,e.signal,"f")}async run(e){let{environmentId:n,environmentKey:r}=this;if(n===void 0||r===void 0)throw new En("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let i=e??Ce(this,WJ,"f"),s=new CB({client:this.client,environmentId:n,environmentKey:r,...this.workerId!==void 0?{workerId:this.workerId}:{},...i?{signal:i}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let o of s)try{await Ce(this,Lye,"m",Z4e).call(this,o,r,s.signal)}catch(a){if(s.signal?.aborted)throw a;lo(this.client).error("work item failed",{work_id:o.id,error:String(a)})}}async handleItem(e){let n=e?.workId??qs("ANTHROPIC_WORK_ID"),r=e?.environmentId??qs("ANTHROPIC_ENVIRONMENT_ID"),i=e?.sessionId??qs("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??qs("ANTHROPIC_ENVIRONMENT_KEY"),o=e?.workSecret||qs("ANTHROPIC_WORK_SECRET")||null;if(!n)throw new En("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!r)throw new En("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!i)throw new En("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new En("handleItem: environmentKey is required \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let a={id:n,environment_id:r,secret:o,data:{type:"session",id:i}};await Ce(this,Lye,"m",Z4e).call(this,a,s,e?.signal??Ce(this,WJ,"f"))}};WJ=new WeakMap,Lye=new WeakSet,Z4e=async function(e,n,r){let i=lo(this.client),s=b7r(e.secret);e.secret&&s===null&&i.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key",{work_id:e.id});let o=s??n,a=rye(this.client,{authToken:o,helper:"environments-worker"}),c=e.data.id,u=new AbortController,l=xB(r,u),d=new e8e(u),m=await Promise.resolve().then(()=>(gzt(),fzt)),h,f,g=S7r(a,e,d,i,this.requestOptions,_=>{h=_,f?._setSendRetryWindow(_)}).catch(_=>{u.signal.aborted||i.error("heartbeat loop failed",{work_id:e.id,error:String(_)}),u.abort()}),A=async()=>{},y,E=!1;try{if(e.data.type!=="session"){i.debug("skipping non-session work item",{work_id:e.id,type:e.data.type});return}let _=await a.beta.sessions.retrieve(c);if(s===null&&this.memorySyncIntervalMs!==null&&E7r(_))throw new m.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${e.id}, session_id=${c}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`);let S={workdir:this.workdir,client:a,session:_,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{A=await m.setupSkills(S)}catch(I){i.warn("skill setup failed",{session_id:c,work_id:e.id,error:String(I)})}s!==null&&this.memorySyncIntervalMs!==null?(y=new m.SessionMemoryStores(a,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await y.download(_),S.allowedRoots=y.roots,S.readOnlyRoots=y.readOnlyRoots):i.debug("memory stores disabled for this item",{work_id:e.id});let C=typeof this.tools=="function"?this.tools(S):this.tools??m.betaAgentToolset20260401(S);f=new TB(c,{client:a,tools:C,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:u.signal}),h!==void 0&&f._setSendRetryWindow(h);for await(let I of f)y&&await y.syncIfDue();E=!u.signal.aborted}finally{try{await A().catch(_=>{i.warn("skill cleanup failed",{session_id:c,work_id:e.id,error:String(_)})})}finally{if(y){let _=m.MEMORY_FLUSH_TIMEOUT_MS;E&&await yzt(y.finish(),_)&&i.warn(`final memory sync cut off after ${_}ms; the flush that follows still uploads changed files`,{session_id:c,work_id:e.id});let S=new AbortController;await yzt(y.flushWrites(S.signal),_)&&(S.abort(),i.warn(`memory flush cut off after ${_}ms; changed files it had not uploaded yet are not saved`,{session_id:c,work_id:e.id})),await y.dispose().catch(I=>{i.warn("memory store cleanup failed",{session_id:c,work_id:e.id,error:String(I)})})}}d.finish("runner_done"),l(),await g,d.lost?i.info("lease lost; released without stopping it",{session_id:c,work_id:e.id}):await _7r(a,e,i,this.requestOptions)}};e8e=class{constructor(e){HJ.set(this,void 0),hq.set(this,void 0),Ht(this,HJ,e,"f")}get signal(){return Ce(this,HJ,"f").signal}finish(e){Ht(this,hq,Ce(this,hq,"f")??e,"f"),Ce(this,HJ,"f").abort()}get lost(){return Ce(this,hq,"f")==="lease_lost"||Ce(this,hq,"f")==="assumed_lost"}};HJ=new WeakMap,hq=new WeakMap});var BB,n8e=v(()=>{p();ui();zi();Ui();ms();lye();t8e();lye();t8e();BB=class extends _n{retrieve(e,n,r){let{environment_id:i,betas:s,workspace_id:o}=n;return this._client.get(wt`/v1/environments/${i}/work/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}update(e,n,r){let{environment_id:i,betas:s,workspace_id:o,...a}=n;return this._client.post(wt`/v1/environments/${i}/work/${e}?beta=true`,{body:a,...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(e,n={},r){let{betas:i,...s}=n??{};return this._client.getAPIList(wt`/v1/environments/${e}/work?beta=true`,ur,{query:s,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}ack(e,n,r){let{environment_id:i,betas:s}=n;return this._client.post(wt`/v1/environments/${i}/work/${e}/ack?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}heartbeat(e,n,r){let{environment_id:i,desired_ttl_seconds:s,expected_last_heartbeat:o,betas:a}=n;return this._client.post(wt`/v1/environments/${i}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:o},...r,headers:pt([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}poll(e,n={},r){let{betas:i,"Anthropic-Worker-ID":s,...o}=n??{};return this._client.get(wt`/v1/environments/${e}/work/poll?beta=true`,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"Anthropic-Worker-ID":s}:void 0},r?.headers])})}stats(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/environments/${e}/work/stats?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}stop(e,n,r){let{environment_id:i,betas:s,workspace_id:o,...a}=n;return this._client.post(wt`/v1/environments/${i}/work/${e}/stop?beta=true`,{body:a,...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}poller(e){return new CB({...e,client:this._client})}worker(e){return new fq({...e,client:this._client})}};BB.WorkPoller=CB;BB.EnvironmentWorker=fq});var uL,r8e=v(()=>{p();ui();n8e();n8e();zi();Ui();ms();uL=class extends _n{constructor(){super(...arguments),this.work=new BB(this._client)}create(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/environments?beta=true",{body:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/environments/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}update(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/environments/${e}?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/environments?beta=true",ur,{query:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.delete(wt`/v1/environments/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}archive(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/environments/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}};uL.Work=BB});var gq,i8e=v(()=>{p();ui();zi();Ui();ms();gq=class extends _n{create(e,n,r){let{view:i,betas:s,workspace_id:o,...a}=n;return this._client.post(wt`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:i},body:a,...r,headers:pt([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}retrieve(e,n,r){let{memory_store_id:i,betas:s,workspace_id:o,...a}=n;return this._client.get(wt`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:a,...r,headers:pt([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}update(e,n,r){let{memory_store_id:i,view:s,betas:o,workspace_id:a,...c}=n;return this._client.post(wt`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{view:s},body:c,...r,headers:pt([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},r?.headers])})}list(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.getAPIList(wt`/v1/memory_stores/${e}/memories?beta=true`,ur,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}delete(e,n,r){let{memory_store_id:i,expected_content_sha256:s,betas:o,workspace_id:a}=n;return this._client.delete(wt`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...r,headers:pt([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},r?.headers])})}}});var Aq,s8e=v(()=>{p();ui();zi();Ui();ms();Aq=class extends _n{retrieve(e,n,r){let{memory_store_id:i,betas:s,workspace_id:o,...a}=n;return this._client.get(wt`/v1/memory_stores/${i}/memory_versions/${e}?beta=true`,{query:a,...r,headers:pt([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.getAPIList(wt`/v1/memory_stores/${e}/memory_versions?beta=true`,ur,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}redact(e,n,r){let{memory_store_id:i,betas:s,workspace_id:o}=n;return this._client.post(wt`/v1/memory_stores/${i}/memory_versions/${e}/redact?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}}});var NB,o8e=v(()=>{p();ui();i8e();i8e();s8e();s8e();zi();Ui();ms();NB=class extends _n{constructor(){super(...arguments),this.memories=new gq(this._client),this.memoryVersions=new Aq(this._client)}create(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/memory_stores?beta=true",{body:s,...n,headers:pt([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/memory_stores/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}update(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/memory_stores/${e}?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",ur,{query:s,...n,headers:pt([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.delete(wt`/v1/memory_stores/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}archive(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/memory_stores/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}};NB.Memories=gq;NB.MemoryVersions=Aq});var yq=v(()=>{p();tc()});var Eq,a8e=v(()=>{p();tc();OH();a4e();Eq=class t{constructor(e,n){this.iterator=e,this.controller=n}async*decoder(){let e=new rv;for await(let n of this.iterator)for(let r of e.decode(n))yield JSON.parse(r);for(let n of e.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,n){if(!e.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new En("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new En("Attempted to iterate over a response with no body");return new t(pJ(e.body),n)}}});var bq,c8e=v(()=>{p();ui();zi();Ui();a8e();yq();ms();bq=class extends _n{create(e,n){let{betas:r,user_profile_id:i,workspace_id:s,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...n,headers:pt([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...i!=null?{"anthropic-user-profile-id":i}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/messages/batches/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",wd,{query:s,...n,headers:pt([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.delete(wt`/v1/messages/batches/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}cancel(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/messages/batches/${e}/cancel?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}async results(e,n={},r){let i=await this.retrieve(e,n,r);if(!i.results_url)throw new En(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:s,workspace_id:o}=n??{};return this._client.get(i.results_url,{...r,headers:pt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((a,c)=>Eq.fromResponse(c.response,c.controller))}}});var Fye,l8e=v(()=>{p();Fye={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function Ezt(t){return t?.output_format??t?.output_config?.format}function u8e(t,e,n){let r=Ezt(e);return!e||!("parse"in(r??{}))?{...t,content:t.content.map(i=>{if(i.type==="text"){let s=Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return i}),parsed_output:null}:d8e(t,e,n)}function d8e(t,e,n){let r=null,i=t.content.map(s=>{if(s.type==="text"){let o=k7r(e,s.text);r===null&&(r=o);let a=Object.defineProperty({...s},"parsed_output",{value:o,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),o},enumerable:!1})}return s});return{...t,content:i,parsed_output:r}}function k7r(t,e){let n=Ezt(t);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(e):JSON.parse(e)}catch(r){throw new En(`Failed to parse structured output: ${r}`)}}var p8e=v(()=>{p();tc()});var m8e=v(()=>{p();AJ()});var B7r,_q,N7r,D7r,bzt,_zt=v(()=>{p();B7r=t=>{let e=0,n=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),_q(t);break;case"number":let n=e.value[e.value.length-1];if(n==="."||n==="-"||n==="+"||n==="e"||n==="E")return t=t.slice(0,t.length-1),_q(t);case"string":let r=t[t.length-2];if(r?.type==="delimiter")return t=t.slice(0,t.length-1),_q(t);if(r?.type==="brace"&&r.value==="{")return t=t.slice(0,t.length-1),_q(t);break;case"delimiter":return t=t.slice(0,t.length-1),_q(t);break}return t},N7r=t=>{let e=[];return t.map(n=>{n.type==="brace"&&(n.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(n=>{n==="}"?t.push({type:"brace",value:"}"}):n==="]"&&t.push({type:"paren",value:"]"})}),t},D7r=t=>{let e="";return t.map(n=>{n.type==="string"?e+='"'+n.value+'"':e+=n.value}),e},bzt=t=>JSON.parse(D7r(N7r(_q(B7r(t)))))});function Qye(t,e){let n={};for(let s of Object.keys(t))s!=="input"&&(n[s]=t[s]);Object.defineProperty(n,DB,{value:e,enumerable:!1,writable:!0});let r,i=!1;return Object.defineProperty(n,"input",{enumerable:!0,configurable:!0,get(){return i||(r=e?bzt(e):{},i=!0),r}}),n}var DB,h8e=v(()=>{p();_zt();DB="__json_buf"});function b8e(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var sA,PB,xq,qJ,Uye,jJ,VJ,Gye,YJ,lI,zJ,$ye,Wye,dL,Hye,qye,jye,KJ,f8e,xzt,JJ,g8e,A8e,y8e,Szt,E8e,Vye,Izt=v(()=>{p();Mf();px();yq();AB();Of();m8e();p8e();h8e();Vye=class t{constructor(e,n){sA.add(this),this.messages=[],this.receivedMessages=[],PB.set(this,void 0),xq.set(this,null),this.controller=new AbortController,qJ.set(this,void 0),Uye.set(this,()=>{}),jJ.set(this,()=>{}),VJ.set(this,void 0),Gye.set(this,()=>{}),YJ.set(this,()=>{}),lI.set(this,{}),zJ.set(this,!1),$ye.set(this,!1),Wye.set(this,!1),dL.set(this,!1),Hye.set(this,void 0),qye.set(this,void 0),jye.set(this,void 0),KJ.set(this,void 0),JJ.set(this,r=>{if(Ht(this,$ye,!0,"f"),B0(r)&&(r=new Mm),r instanceof Mm)return Ht(this,Wye,!0,"f"),this._emit("abort",r);if(r instanceof En)return this._emit("error",r);if(r instanceof Error){let i=new En(r.message);return i.cause=r,this._emit("error",i)}return this._emit("error",new En(String(r)))}),Ht(this,qJ,new Promise((r,i)=>{Ht(this,Uye,r,"f"),Ht(this,jJ,i,"f")}),"f"),Ht(this,VJ,new Promise((r,i)=>{Ht(this,Gye,r,"f"),Ht(this,YJ,i,"f")}),"f"),Ce(this,qJ,"f").catch(()=>{}),Ce(this,VJ,"f").catch(()=>{}),Ht(this,xq,e,"f"),Ht(this,KJ,n?.logger??console,"f")}get response(){return Ce(this,Hye,"f")}get request_id(){return Ce(this,qye,"f")}get workspace_id(){return Ce(this,jye,"f")}async withResponse(){Ht(this,dL,!0,"f");let e=await Ce(this,qJ,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id"),workspace_id:e.headers.get("anthropic-workspace-id")}}static fromReadableStream(e){let n=new t(null);return n._run(()=>n._fromReadableStream(e)),n}static createMessage(e,n,r,{logger:i}={}){let s=new t(n,{logger:i});for(let o of n.messages)s._addMessageParam(o);return Ht(s,xq,{...n,stream:!0},"f"),s._run(()=>s._createMessage(e,{...n,stream:!0},{...r,headers:{...r?.headers,[zAe]:"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},Ce(this,JJ,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,n=!0){this.receivedMessages.push(e),n&&this._emit("message",e)}async _createMessage(e,n,r){let i=r?.signal,s;i&&(i.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),i.addEventListener("abort",s));try{Ce(this,sA,"m",g8e).call(this);let{response:o,data:a}=await e.create({...n,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(o);for await(let c of a)Ce(this,sA,"m",A8e).call(this,c);if(a.controller.signal?.aborted)throw new Mm;Ce(this,sA,"m",y8e).call(this)}finally{i&&s&&i.removeEventListener("abort",s)}}_connected(e){this.ended||(Ht(this,Hye,e,"f"),Ht(this,qye,e?.headers.get("request-id"),"f"),Ht(this,jye,e?.headers.get("anthropic-workspace-id"),"f"),Ce(this,Uye,"f").call(this,e),this._emit("connect"))}get ended(){return Ce(this,zJ,"f")}get errored(){return Ce(this,$ye,"f")}get aborted(){return Ce(this,Wye,"f")}abort(){this.controller.abort()}on(e,n){return(Ce(this,lI,"f")[e]||(Ce(this,lI,"f")[e]=[])).push({listener:n}),this}off(e,n){let r=Ce(this,lI,"f")[e];if(!r)return this;let i=r.findIndex(s=>s.listener===n);return i>=0&&r.splice(i,1),this}once(e,n){return(Ce(this,lI,"f")[e]||(Ce(this,lI,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,r)=>{Ht(this,dL,!0,"f"),e!=="error"&&this.once("error",r),this.once(e,n)})}async done(){Ht(this,dL,!0,"f"),await Ce(this,VJ,"f")}get currentMessage(){return Ce(this,PB,"f")}async finalMessage(){return await this.done(),Ce(this,sA,"m",f8e).call(this)}async finalText(){return await this.done(),Ce(this,sA,"m",xzt).call(this)}_emit(e,...n){if(Ce(this,zJ,"f"))return;e==="end"&&(Ht(this,zJ,!0,"f"),Ce(this,Gye,"f").call(this));let r=Ce(this,lI,"f")[e];if(r&&(Ce(this,lI,"f")[e]=r.filter(i=>!i.once),r.forEach(({listener:i})=>i(...n))),e==="abort"){let i=n[0];!Ce(this,dL,"f")&&!r?.length&&Promise.reject(i),Ce(this,jJ,"f").call(this,i),Ce(this,YJ,"f").call(this,i),this._emit("end");return}if(e==="error"){let i=n[0];!Ce(this,dL,"f")&&!r?.length&&Promise.reject(i),Ce(this,jJ,"f").call(this,i),Ce(this,YJ,"f").call(this,i),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Ce(this,sA,"m",f8e).call(this))}async _fromReadableStream(e,n){let r=n?.signal,i;r&&(r.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),r.addEventListener("abort",i));try{Ce(this,sA,"m",g8e).call(this),this._connected(null);let s=Ry.fromReadableStream(e,this.controller);for await(let o of s)Ce(this,sA,"m",A8e).call(this,o);if(s.controller.signal?.aborted)throw new Mm;Ce(this,sA,"m",y8e).call(this)}finally{r&&i&&r.removeEventListener("abort",i)}}[(PB=new WeakMap,xq=new WeakMap,qJ=new WeakMap,Uye=new WeakMap,jJ=new WeakMap,VJ=new WeakMap,Gye=new WeakMap,YJ=new WeakMap,lI=new WeakMap,zJ=new WeakMap,$ye=new WeakMap,Wye=new WeakMap,dL=new WeakMap,Hye=new WeakMap,qye=new WeakMap,jye=new WeakMap,KJ=new WeakMap,JJ=new WeakMap,sA=new WeakSet,f8e=function(){if(this.receivedMessages.length===0)throw new En("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},xzt=function(){if(this.receivedMessages.length===0)throw new En("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(n.length===0)throw new En("stream ended without producing a content block with type=text");return n.join(" ")},g8e=function(){this.ended||Ht(this,PB,void 0,"f")},A8e=function(n){if(this.ended)return;let r=Ce(this,sA,"m",Szt).call(this,n);switch(this._emit("streamEvent",n,r),n.type){case"content_block_delta":{let i=r.content.at(-1);switch(n.delta.type){case"text_delta":{i.type==="text"&&this._emit("text",n.delta.text,i.text||"");break}case"citations_delta":{i.type==="text"&&this._emit("citation",n.delta.citation,i.citations??[]);break}case"input_json_delta":{if(b8e(i)&&Ce(this,lI,"f").inputJson?.length){let s;try{s=i.input}catch(o){Ce(this,JJ,"f").call(this,Ce(this,sA,"m",E8e).call(this,i,o));break}this._emit("inputJson",n.delta.partial_json,s)}break}case"thinking_delta":{i.type==="thinking"&&this._emit("thinking",n.delta.thinking,i.thinking);break}case"signature_delta":{i.type==="thinking"&&this._emit("signature",i.signature);break}case"compaction_delta":{i.type==="compaction"&&i.content&&this._emit("compaction",i.content);break}default:n.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(u8e(r,Ce(this,xq,"f"),{logger:Ce(this,KJ,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{Ht(this,PB,r,"f");break}case"content_block_start":case"message_delta":break}},y8e=function(){if(this.ended)throw new En("stream has ended, this shouldn't happen");let n=Ce(this,PB,"f");if(!n)throw new En("request ended without sending any chunks");return Ht(this,PB,void 0,"f"),u8e(n,Ce(this,xq,"f"),{logger:Ce(this,KJ,"f")})},Szt=function(n){let r=Ce(this,PB,"f");if(n.type==="message_start"){if(r)throw new En(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!r)throw new En(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return r;case"message_delta":return r.stop_reason=n.delta.stop_reason,r.stop_sequence=n.delta.stop_sequence,r.stop_details=n.delta.stop_details,r.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(r.container=n.delta.container),n.context_management!=null&&(r.context_management=n.context_management),n.input_transformations!=null&&(r.input_transformations=n.input_transformations),n.usage.input_tokens!=null&&(r.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(r.usage.server_tool_use=n.usage.server_tool_use),n.usage.iterations!=null&&(r.usage.iterations=n.usage.iterations),n.usage.fallback_credit!=null&&(r.usage.fallback_credit=n.usage.fallback_credit),n.usage.output_tokens_details!=null&&(r.usage.output_tokens_details=n.usage.output_tokens_details),r;case"content_block_start":return r.content.push(n.content_block),n.content_block.type==="fallback"&&(r.model=n.content_block.to.model),r;case"content_block_delta":{let i=r.content.at(n.index);switch(n.delta.type){case"text_delta":{i?.type==="text"&&(r.content[n.index]={...i,text:(i.text||"")+n.delta.text});break}case"citations_delta":{i?.type==="text"&&(r.content[n.index]={...i,citations:[...i.citations??[],n.delta.citation]});break}case"input_json_delta":{if(i&&b8e(i)){let s=(i[DB]||"")+n.delta.partial_json;r.content[n.index]=Qye(i,s)}break}case"thinking_delta":{i?.type==="thinking"&&(r.content[n.index]={...i,thinking:i.thinking+n.delta.thinking});break}case"signature_delta":{i?.type==="thinking"&&(r.content[n.index]={...i,signature:n.delta.signature});break}case"compaction_delta":{i?.type==="compaction"&&(r.content[n.index]={...i,content:(i.content||"")+n.delta.content,encrypted_content:n.delta.encrypted_content});break}default:n.delta}return r}case"content_block_stop":{let i=r.content.at(n.index);if(i&&b8e(i)&&DB in i){let s;try{s=i.input}catch(o){s={},Ce(this,JJ,"f").call(this,Ce(this,sA,"m",E8e).call(this,i,o))}Object.defineProperty(i,"input",{value:s,enumerable:!0,configurable:!0,writable:!0})}return r}}},E8e=function(n,r){let i=n[DB];return new En(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${r}. JSON: ${i}`)},Symbol.asyncIterator)](){let e=[],n=[],r=!1;return this.on("streamEvent",i=>{let s=n.shift();s?s.resolve(i):e.push(i)}),this.on("end",()=>{r=!0;for(let i of n)i.resolve(void 0);n.length=0}),this.on("abort",i=>{r=!0;for(let s of n)s.reject(i);n.length=0}),this.on("error",i=>{r=!0;for(let s of n)s.reject(i);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((s,o)=>n.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Ry(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var wzt,Tzt=v(()=>{p();wzt=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -161,34 +159,34 @@ User preferences or style requirements Domain-specific details that aren't obvious Any promises made to the user Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags.`});async function Exr(t,e=t.messages.at(-1),n){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let r=e.content.filter(o=>o.type==="tool_use");if(r.length===0)return null;let s=_xr(t);return{role:"user",content:await Promise.all(r.map(async o=>{let a=t.tools.find(c=>("name"in c?c.name:"mcp_server_name"in c?c.mcp_server_name:c.type)===o.name);if(!a||!("run"in a)||!s.has(o.name))return bxr(o);try{let c=o.input;"parse"in a&&a.parse&&(c=a.parse(c));let u=await a.run(c,{toolUse:o,toolUseBlock:o,signal:n?.signal});return{type:"tool_result",tool_use_id:o.id,content:u}}catch(c){return{type:"tool_result",tool_use_id:o.id,content:c instanceof ks?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function bxr(t){return{type:"tool_result",tool_use_id:t.id,content:`Error: Tool '${t.name}' not found`,is_error:!0}}function _xr(t){let e=new Set;for(let n of t.tools)"run"in n&&e.add(n.name);for(let n of t.messages)if(!(n.role!=="system"||typeof n.content=="string"))for(let r of n.content)Sxr(r,e);return e}function Sxr(t,e){switch(t.type){case"tool_removal":case"tool_addition":Cxr(t,e);break}}function Cxr(t,e){let n=Ixr(t.tool);n!==void 0&&(t.type==="tool_removal"?e.delete(n):e.add(n))}function Ixr(t){if(t.type==="tool_reference")return t.name}function xxr(t){if(t===null)return"stop";switch(t){case"tool_use":return"run_tools";case"pause_turn":case"compaction":return"resume";case"end_turn":case"stop_sequence":case"max_tokens":case"model_context_window_exceeded":case"refusal":return"stop";default:return"stop"}}var U9,rG,uP,Nl,Uf,pA,Ux,zR,$9,sQt,Z2e,sG,e$e=V(()=>{p();Em();ZB();Ra();Ys();f2e();bm();rQt();E_();sG=class{constructor(e,n,r){U9.add(this),this.client=e,rG.set(this,!1),uP.set(this,!1),Nl.set(this,void 0),Uf.set(this,void 0),pA.set(this,void 0),Ux.set(this,void 0),zR.set(this,void 0),$9.set(this,0),Wt(this,Nl,{params:{...n,messages:structuredClone(n.messages)}},"f");let s=JUe(n.tools,n.messages);Wt(this,Uf,{...r,headers:gt([p9("BetaToolRunner"),s.length?{[OR]:s.join(", ")}:void 0,r?.headers])},"f"),Wt(this,zR,Q$(),"f"),n.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(rG=new WeakMap,uP=new WeakMap,Nl=new WeakMap,Uf=new WeakMap,pA=new WeakMap,Ux=new WeakMap,zR=new WeakMap,$9=new WeakMap,U9=new WeakSet,sQt=async function(){let n=xe(this,Nl,"f").params.compactionControl;if(!n||!n.enabled)return!1;let r=0;if(xe(this,pA,"f")!==void 0)try{let u=await xe(this,pA,"f");r=u.usage.input_tokens+(u.usage.cache_creation_input_tokens??0)+(u.usage.cache_read_input_tokens??0)+u.usage.output_tokens}catch{return!1}let s=n.contextTokenThreshold??1e5;if(rd.type!=="tool_use");l.length===0?a.pop():u.content=l}}let c=await this.client.beta.messages.create({model:i,messages:[...a,{role:"user",content:[{type:"text",text:o}]}],max_tokens:xe(this,Nl,"f").params.max_tokens},{signal:xe(this,Uf,"f").signal,headers:gt([xe(this,Uf,"f").headers,p9("compaction")])});if(c.content[0]?.type!=="text")throw new gn("Expected text response for compaction");return xe(this,Nl,"f").params.messages=[{role:"user",content:c.content}],!0},Symbol.asyncIterator)](){var e;if(xe(this,rG,"f"))throw new gn("Cannot iterate over a consumed stream");Wt(this,rG,!0,"f"),Wt(this,uP,!0,"f"),Wt(this,Ux,void 0,"f");try{for(;;){let n;try{if(xe(this,Nl,"f").params.max_iterations&&xe(this,$9,"f")>=xe(this,Nl,"f").params.max_iterations)break;Wt(this,uP,!1,"f"),Wt(this,Ux,void 0,"f"),Wt(this,$9,(e=xe(this,$9,"f"),e++,e),"f"),Wt(this,pA,void 0,"f");let{max_iterations:r,compactionControl:s,...i}=xe(this,Nl,"f").params;if(i.stream?(n=this.client.beta.messages.stream({...i},xe(this,Uf,"f")),Wt(this,pA,n.finalMessage(),"f"),xe(this,pA,"f").catch(()=>{}),yield n):(Wt(this,pA,this.client.beta.messages.create({...i,stream:!1},xe(this,Uf,"f")),"f"),yield xe(this,pA,"f")),!await xe(this,U9,"m",sQt).call(this)){if(!xe(this,uP,"f")){let c=await xe(this,pA,"f"),u=xxr(c.stop_reason);xe(this,Nl,"f").params.messages.push({role:c.role,content:c.content});let{container:l}=xe(this,Nl,"f").params;if(c.container&&(l==null?xe(this,Nl,"f").params.container=c.container.id:typeof l=="object"&&l.id==null&&(xe(this,Nl,"f").params.container={...l,id:c.container.id})),u==="stop")break;if(u==="resume")continue}let a=await xe(this,U9,"m",Z2e).call(this,xe(this,Nl,"f").params.messages.at(-1));if(a)xe(this,Nl,"f").params.messages.push(a);else if(!xe(this,uP,"f"))break}}finally{n&&n.abort()}}if(!xe(this,pA,"f"))throw new gn("ToolRunner concluded without a message from the server");xe(this,zR,"f").resolve(await xe(this,pA,"f"))}catch(n){throw Wt(this,rG,!1,"f"),xe(this,zR,"f").promise.catch(()=>{}),xe(this,zR,"f").reject(n),Wt(this,zR,Q$(),"f"),n}}setMessagesParams(e){typeof e=="function"?xe(this,Nl,"f").params=e(xe(this,Nl,"f").params):xe(this,Nl,"f").params=e,Wt(this,uP,!0,"f"),Wt(this,Ux,void 0,"f")}setRequestOptions(e){typeof e=="function"?Wt(this,Uf,e(xe(this,Uf,"f")),"f"):Wt(this,Uf,{...xe(this,Uf,"f"),...e},"f")}async generateToolResponse(e=xe(this,Uf,"f").signal){let n=await xe(this,pA,"f")??this.params.messages.at(-1);return n?xe(this,U9,"m",Z2e).call(this,n,e):null}done(){return xe(this,zR,"f").promise}async runUntilDone(){if(!xe(this,rG,"f"))for await(let e of this);return this.done()}get params(){return xe(this,Nl,"f").params}pushMessages(...e){this.setMessagesParams(n=>({...n,messages:[...n.messages,...e]}))}then(e,n){return this.runUntilDone().then(e,n)}};Z2e=async function(e,n=xe(this,Uf,"f").signal){return xe(this,Ux,"f")!==void 0?xe(this,Ux,"f"):(Wt(this,Ux,Exr(xe(this,Nl,"f").params,e,{...xe(this,Uf,"f"),signal:n}),"f"),xe(this,Ux,"f"))}});function oQt(t){if(!t.output_format)return t;if(t.output_config?.format)throw new gn("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...n}=t;return{...n,output_config:{...t.output_config,format:e}}}var iQt,wxr,$x,t$e=V(()=>{p();X$();U2e();os();$2e();Ys();E_();q2e();tQt();e$e();ZB();U2e();e$e();ZB();iQt={},wxr=["claude-mythos-preview","claude-opus-4-6"],$x=class extends En{constructor(){super(...arguments),this.batches=new eG(this._client)}create(e,n){let r=oQt(e),{betas:s,user_profile_id:i,...o}=r;o.model in iQt&&console.warn(`The model '${o.model}' is deprecated and will reach end-of-life on ${iQt[o.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),wxr.includes(o.model)&&o.thinking&&o.thinking.type==="enabled"&&console.warn(`Using Claude with ${o.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let a=n?.timeout??this._client._options.timeout;if(!o.stream&&a==null){let u=Qpe[o.model]??void 0;a=this._client.calculateNonstreamingTimeout(o.max_tokens,u)}let c=Jde(o.tools,o.messages);return this._client.post("/v1/messages?beta=true",{body:o,timeout:a??6e5,...n,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0,...i!=null?{"anthropic-user-profile-id":i}:void 0},c,n?.headers]),stream:r.stream??!1})}parse(e,n){return n={...n,headers:gt([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},n?.headers])},this.create(e,n).then(r=>W2e(r,e,{logger:this._client.logger??console}))}stream(e,n){return Ype.createMessage(this,e,n)}countTokens(e,n){let r=oQt(e),{betas:s,user_profile_id:i,...o}=r;return this._client.post("/v1/messages/count_tokens?beta=true",{body:o,...n,headers:gt([{"anthropic-beta":[...s??[],"token-counting-2024-11-01"].toString(),...i!=null?{"anthropic-user-profile-id":i}:void 0},n?.headers])})}toolRunner(e,n){return new sG(this._client,e,n)}};$x.Batches=eG;$x.BetaToolRunner=sG;$x.ToolError=ks});var iG,n$e=V(()=>{p();os();$s();ii();iG=class extends En{retrieve(e,n){return this._client.get(xt`/v1/organizations/api_keys/${e}?beta=true`,n)}update(e,n,r){return this._client.post(xt`/v1/organizations/api_keys/${e}?beta=true`,{body:n,...r})}list(e={},n){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",Bu,{query:e,...n})}}});var oG,r$e=V(()=>{p();os();oG=class extends En{retrieve(e){return this._client.get("/v1/organizations/compliance_settings?beta=true",e)}update(e,n){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:e,...n})}}});var aG,s$e=V(()=>{p();os();$s();ii();aG=class extends En{create(e,n){return this._client.post("/v1/organizations/external_keys?beta=true",{body:e,...n})}retrieve(e,n){return this._client.get(xt`/v1/organizations/external_keys/${e}?beta=true`,n)}update(e,n,r){return this._client.post(xt`/v1/organizations/external_keys/${e}?beta=true`,{body:n,...r})}list(e={},n){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",cr,{query:e,...n})}delete(e,n){return this._client.delete(xt`/v1/organizations/external_keys/${e}?beta=true`,n)}validate(e,n){return this._client.post(xt`/v1/organizations/external_keys/${e}/validate?beta=true`,n)}}});var cG,i$e=V(()=>{p();os();$s();ii();cG=class extends En{create(e,n){return this._client.post("/v1/organizations/invites?beta=true",{body:e,...n})}retrieve(e,n){return this._client.get(xt`/v1/organizations/invites/${e}?beta=true`,n)}list(e={},n){return this._client.getAPIList("/v1/organizations/invites?beta=true",Bu,{query:e,...n})}delete(e,n){return this._client.delete(xt`/v1/organizations/invites/${e}?beta=true`,n)}}});var lG,o$e=V(()=>{p();os();$s();lG=class extends En{list(e={},n){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",cr,{query:e,...n})}}});var uG,a$e=V(()=>{p();os();$s();ii();uG=class extends En{retrieve(e,n){return this._client.get(xt`/v1/organizations/users/${e}?beta=true`,n)}update(e,n,r){return this._client.post(xt`/v1/organizations/users/${e}?beta=true`,{body:n,...r})}list(e={},n){return this._client.getAPIList("/v1/organizations/users?beta=true",Bu,{query:e,...n})}remove(e,n){return this._client.delete(xt`/v1/organizations/users/${e}?beta=true`,n)}}});var dG,c$e=V(()=>{p();os();$s();Ys();ii();dG=class extends En{create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/organizations/federation_issuers/${e}?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}update(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/organizations/federation_issuers/${e}?beta=true`,{body:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",cr,{query:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/organizations/federation_issuers/${e}/archive?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}}});var pG,l$e=V(()=>{p();os();$s();Ys();ii();pG=class extends En{list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/organizations/federation_rules/${e}/workspaces?beta=true`,cr,{query:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}add(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/organizations/federation_rules/${e}/workspaces?beta=true`,{body:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}remove(e,n,r){let{federation_rule_id:s,betas:i}=n;return this._client.delete(xt`/v1/organizations/federation_rules/${s}/workspaces/${e}?beta=true`,{...r,headers:gt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}}});var dP,u$e=V(()=>{p();os();l$e();l$e();$s();Ys();ii();dP=class extends En{constructor(){super(...arguments),this.workspaces=new pG(this._client)}create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/organizations/federation_rules/${e}?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}update(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/organizations/federation_rules/${e}?beta=true`,{body:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",cr,{query:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/organizations/federation_rules/${e}/archive?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}};dP.Workspaces=pG});var JR,d$e=V(()=>{p();os();c$e();c$e();u$e();u$e();JR=class extends En{constructor(){super(...arguments),this.issuers=new dG(this._client),this.rules=new dP(this._client)}};JR.Issuers=dG;JR.Rules=dP});var hG,p$e=V(()=>{p();os();$s();Ys();ii();hG=class extends En{list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/organizations/service_accounts/${e}/workspaces?beta=true`,cr,{query:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}add(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/organizations/service_accounts/${e}/workspaces?beta=true`,{body:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}remove(e,n,r){let{service_account_id:s,betas:i}=n;return this._client.delete(xt`/v1/organizations/service_accounts/${s}/workspaces/${e}?beta=true`,{...r,headers:gt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}}});var pP,h$e=V(()=>{p();os();p$e();p$e();$s();Ys();ii();pP=class extends En{constructor(){super(...arguments),this.workspaces=new hG(this._client)}create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/organizations/service_accounts/${e}?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}update(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/organizations/service_accounts/${e}?beta=true`,{body:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",cr,{query:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/organizations/service_accounts/${e}/archive?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}};pP.Workspaces=hG});var mG,m$e=V(()=>{p();os();$s();ii();mG=class extends En{retrieve(e,n,r){let{workspace_id:s}=n;return this._client.get(xt`/v1/organizations/workspaces/${s}/members/${e}?beta=true`,r)}update(e,n,r){let{workspace_id:s,...i}=n;return this._client.post(xt`/v1/organizations/workspaces/${s}/members/${e}?beta=true`,{body:i,...r})}list(e,n={},r){return this._client.getAPIList(xt`/v1/organizations/workspaces/${e}/members?beta=true`,Bu,{query:n,...r})}add(e,n,r){return this._client.post(xt`/v1/organizations/workspaces/${e}/members?beta=true`,{body:n,...r})}remove(e,n,r){let{workspace_id:s}=n;return this._client.delete(xt`/v1/organizations/workspaces/${s}/members/${e}?beta=true`,r)}}});var fG,f$e=V(()=>{p();os();$s();ii();fG=class extends En{list(e,n={},r){return this._client.getAPIList(xt`/v1/organizations/workspaces/${e}/rate_limits?beta=true`,cr,{query:n,...r})}}});var gG,g$e=V(()=>{p();os();$s();Ys();ii();gG=class extends En{retrieve(e,n,r){let{workspace_id:s,betas:i}=n;return this._client.get(xt`/v1/organizations/workspaces/${s}/service_accounts/${e}?beta=true`,{...r,headers:gt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}update(e,n,r){let{workspace_id:s,betas:i,...o}=n;return this._client.post(xt`/v1/organizations/workspaces/${s}/service_accounts/${e}?beta=true`,{body:o,...r,headers:gt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/organizations/workspaces/${e}/service_accounts?beta=true`,cr,{query:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}add(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/organizations/workspaces/${e}/service_accounts?beta=true`,{body:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}remove(e,n,r){let{workspace_id:s,betas:i}=n;return this._client.delete(xt`/v1/organizations/workspaces/${s}/service_accounts/${e}?beta=true`,{...r,headers:gt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}}});var Gx,A$e=V(()=>{p();os();m$e();m$e();f$e();f$e();g$e();g$e();$s();Ys();ii();Gx=class extends En{constructor(){super(...arguments),this.rateLimits=new fG(this._client),this.members=new mG(this._client),this.serviceAccounts=new gG(this._client)}create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/organizations/workspaces?beta=true",{body:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}retrieve(e,n){return this._client.get(xt`/v1/organizations/workspaces/${e}?beta=true`,n)}update(e,n,r){return this._client.post(xt`/v1/organizations/workspaces/${e}?beta=true`,{body:n,...r})}list(e={},n){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",Bu,{query:e,...n})}archive(e,n){return this._client.post(xt`/v1/organizations/workspaces/${e}/archive?beta=true`,n)}};Gx.RateLimits=fG;Gx.Members=mG;Gx.ServiceAccounts=gG});var Cm,y$e=V(()=>{p();os();n$e();n$e();r$e();r$e();s$e();s$e();i$e();i$e();o$e();o$e();a$e();a$e();d$e();d$e();h$e();h$e();A$e();A$e();Cm=class extends En{constructor(){super(...arguments),this.apiKeys=new iG(this._client),this.externalKeys=new aG(this._client),this.federation=new JR(this._client),this.invites=new cG(this._client),this.serviceAccounts=new pP(this._client),this.users=new uG(this._client),this.workspaces=new Gx(this._client),this.rateLimits=new lG(this._client),this.complianceSettings=new oG(this._client)}retrieve(e){return this._client.get("/v1/organizations/me?beta=true",e)}};Cm.APIKeys=iG;Cm.ExternalKeys=aG;Cm.Federation=JR;Cm.Invites=cG;Cm.ServiceAccounts=pP;Cm.Users=uG;Cm.Workspaces=Gx;Cm.RateLimits=lG;Cm.ComplianceSettings=oG});var hP,E$e=V(()=>{p();os();$s();Ys();ii();bpe();bpe();hP=class extends En{list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/sessions/${e}/events?beta=true`,cr,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}send(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/sessions/${e}/events?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}stream(e,n={},r){let{betas:s,...i}=n??{};return this._client.get(xt`/v1/sessions/${e}/events/stream?beta=true`,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers]),stream:!0})}toolRunner(e,n){return new GR(e,{...n,client:this._client})}};hP.SessionToolRunner=GR});var AG,b$e=V(()=>{p();os();$s();Ys();ii();AG=class extends En{retrieve(e,n,r){let{session_id:s,betas:i}=n;return this._client.get(xt`/v1/sessions/${s}/resources/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,n,r){let{session_id:s,betas:i,...o}=n;return this._client.post(xt`/v1/sessions/${s}/resources/${e}?beta=true`,{body:o,...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/sessions/${e}/resources?beta=true`,cr,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,n,r){let{session_id:s,betas:i}=n;return this._client.delete(xt`/v1/sessions/${s}/resources/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}add(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/sessions/${e}/resources?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}});var yG,_$e=V(()=>{p();os();$s();Ys();ii();yG=class extends En{list(e,n,r){let{session_id:s,betas:i,...o}=n;return this._client.getAPIList(xt`/v1/sessions/${s}/threads/${e}/events?beta=true`,cr,{query:o,...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}stream(e,n,r){let{session_id:s,betas:i,...o}=n;return this._client.get(xt`/v1/sessions/${s}/threads/${e}/stream?beta=true`,{query:o,...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers]),stream:!0})}}});var mP,S$e=V(()=>{p();os();_$e();_$e();$s();Ys();ii();mP=class extends En{constructor(){super(...arguments),this.events=new yG(this._client)}retrieve(e,n,r){let{session_id:s,betas:i}=n;return this._client.get(xt`/v1/sessions/${s}/threads/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/sessions/${e}/threads?beta=true`,cr,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,n,r){let{session_id:s,betas:i}=n;return this._client.post(xt`/v1/sessions/${s}/threads/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}};mP.Events=yG});var Wx,C$e=V(()=>{p();os();E$e();E$e();b$e();b$e();S$e();S$e();$s();Ys();ii();Wx=class extends En{constructor(){super(...arguments),this.events=new hP(this._client),this.resources=new AG(this._client),this.threads=new mP(this._client)}create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/sessions?beta=true",{body:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/sessions/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/sessions/${e}?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",Vde,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,n={},r){let{betas:s}=n??{};return this._client.delete(xt`/v1/sessions/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/sessions/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}};Wx.Events=hP;Wx.Resources=AG;Wx.Threads=mP});var EG,I$e=V(()=>{p();os();$s();Ys();Lx();ii();EG=class extends En{create(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/skills/${e}/versions?beta=true`,pE({body:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])},this._client,!1))}retrieve(e,n,r){let{skill_id:s,betas:i}=n;return this._client.get(xt`/v1/skills/${s}/versions/${e}?beta=true`,{...r,headers:gt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/skills/${e}/versions?beta=true`,cr,{query:i,...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}delete(e,n,r){let{skill_id:s,betas:i}=n;return this._client.delete(xt`/v1/skills/${s}/versions/${e}?beta=true`,{...r,headers:gt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}download(e,n,r){let{skill_id:s,betas:i}=n;return this._client.get(xt`/v1/skills/${s}/versions/${e}/content?beta=true`,{...r,headers:gt([{Accept:"application/binary",...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__binaryResponse:!0})}}});var fP,x$e=V(()=>{p();os();I$e();I$e();$s();Ys();Lx();ii();fP=class extends En{constructor(){super(...arguments),this.versions=new EG(this._client)}create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/skills?beta=true",pE({body:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])},this._client,!1))}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/skills/${e}?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/skills?beta=true",cr,{query:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}delete(e,n={},r){let{betas:s}=n??{};return this._client.delete(xt`/v1/skills/${e}?beta=true`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}};fP.Versions=EG});var bG,w$e=V(()=>{p();os();$s();Ys();ii();bG=class extends En{create(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/tunnels/${e}/certificates?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},r?.headers])})}retrieve(e,n,r){let{tunnel_id:s,betas:i}=n;return this._client.get(xt`/v1/tunnels/${s}/certificates/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString()},r?.headers])})}list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/tunnels/${e}/certificates?beta=true`,cr,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},r?.headers])})}archive(e,n,r){let{tunnel_id:s,betas:i}=n;return this._client.post(xt`/v1/tunnels/${s}/certificates/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString()},r?.headers])})}}});var gP,T$e=V(()=>{p();os();w$e();w$e();$s();Ys();ii();gP=class extends En{constructor(){super(...arguments),this.certificates=new bG(this._client)}create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/tunnels?beta=true",{body:s,...n,headers:gt([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/tunnels/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/tunnels?beta=true",cr,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/tunnels/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},r?.headers])})}revealToken(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/tunnels/${e}/reveal_token?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},r?.headers])})}rotateToken(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/tunnels/${e}/rotate_token?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},r?.headers])})}};gP.Certificates=bG});var _G,v$e=V(()=>{p();os();$s();Ys();ii();_G=class extends En{create(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/vaults/${e}/credentials?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,n,r){let{vault_id:s,betas:i}=n;return this._client.get(xt`/v1/vaults/${s}/credentials/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,n,r){let{vault_id:s,betas:i,...o}=n;return this._client.post(xt`/v1/vaults/${s}/credentials/${e}?beta=true`,{body:o,...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e,n={},r){let{betas:s,...i}=n??{};return this._client.getAPIList(xt`/v1/vaults/${e}/credentials?beta=true`,cr,{query:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,n,r){let{vault_id:s,betas:i}=n;return this._client.delete(xt`/v1/vaults/${s}/credentials/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,n,r){let{vault_id:s,betas:i}=n;return this._client.post(xt`/v1/vaults/${s}/credentials/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}mcpOAuthValidate(e,n,r){let{vault_id:s,betas:i}=n;return this._client.post(xt`/v1/vaults/${s}/credentials/${e}/mcp_oauth_validate?beta=true`,{...r,headers:gt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}});var AP,R$e=V(()=>{p();os();v$e();v$e();$s();Ys();ii();AP=class extends En{constructor(){super(...arguments),this.credentials=new _G(this._client)}create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/vaults?beta=true",{body:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/vaults/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,n,r){let{betas:s,...i}=n;return this._client.post(xt`/v1/vaults/${e}?beta=true`,{body:i,...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",cr,{query:s,...n,headers:gt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,n={},r){let{betas:s}=n??{};return this._client.delete(xt`/v1/vaults/${e}?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,n={},r){let{betas:s}=n??{};return this._client.post(xt`/v1/vaults/${e}/archive?beta=true`,{...r,headers:gt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}};AP.Credentials=_G});var Zc,k$e=V(()=>{p();os();YUe();YUe();KUe();KUe();zUe();zUe();XUe();XUe();ZUe();ZUe();e2e();e2e();s2e();s2e();o2e();o2e();O2e();O2e();F2e();F2e();t$e();t$e();y$e();y$e();C$e();C$e();x$e();x$e();T$e();T$e();R$e();R$e();Zc=class extends En{constructor(){super(...arguments),this.models=new C$(this._client),this.messages=new $x(this._client),this.agents=new XB(this._client),this.environments=new cP(this._client),this.sessions=new Wx(this._client),this.deployments=new b$(this._client),this.deploymentRuns=new E$(this._client),this.vaults=new AP(this._client),this.memoryStores=new jR(this._client),this.files=new S$(this._client),this.skills=new fP(this._client),this.webhooks=new w$(this._client),this.userProfiles=new I$(this._client),this.dreams=new _$(this._client),this.tunnels=new gP(this._client),this.organization=new Cm(this._client)}};Zc.Models=C$;Zc.Messages=$x;Zc.Agents=XB;Zc.Environments=cP;Zc.Sessions=Wx;Zc.Deployments=b$;Zc.DeploymentRuns=E$;Zc.Vaults=AP;Zc.MemoryStores=jR;Zc.Files=S$;Zc.Skills=fP;Zc.Webhooks=w$;Zc.UserProfiles=I$;Zc.Dreams=_$;Zc.Tunnels=gP;Zc.Organization=Cm});var yP,N$e=V(()=>{p();os();Ys();yP=class extends En{create(e,n){let{betas:r,...s}=e;return this._client.post("/v1/complete",{body:s,timeout:this._client._options.timeout??6e5,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers]),stream:e.stream??!1})}}});var EP,D$e=V(()=>{p();os();$s();Ys();E_();Lx();ii();EP=class extends En{list(e={},n){return this._client.getAPIList("/v1/files",cr,{query:e,...n})}delete(e,n){return this._client.delete(xt`/v1/files/${e}`,n)}download(e,n){return this._client.get(xt`/v1/files/${e}/content`,{...n,headers:gt([{Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,n){return this._client.get(xt`/v1/files/${e}`,n)}upload(e,n){return this._client.post("/v1/files",pE({body:e,...n,headers:gt([Xde(e.file),n?.headers])},this._client))}}});function aQt(t){return t?.output_config?.format}function B$e(t,e,n){let r=aQt(e);return!e||!("parse"in(r??{}))?{...t,content:t.content.map(s=>s.type==="text"?Object.defineProperty({...s},"parsed_output",{value:null,enumerable:!1}):s),parsed_output:null}:P$e(t,e,n)}function P$e(t,e,n){let r=null,s=t.content.map(i=>{if(i.type==="text"){let o=nwr(e,i.text);return r===null&&(r=o),Object.defineProperty({...i},"parsed_output",{value:o,enumerable:!1})}return i});return{...t,content:s,parsed_output:r}}function nwr(t,e){let n=aQt(t);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(e):JSON.parse(e)}catch(r){throw new gn(`Failed to parse structured output: ${r}`)}}var O$e=V(()=>{p();Ra()});function $$e(t){return t.type==="tool_use"||t.type==="server_tool_use"}var AE,XR,SG,G9,Kpe,W9,q9,zpe,H9,dC,V9,Jpe,Xpe,bP,Zpe,ehe,the,j9,M$e,cQt,L$e,F$e,Q$e,U$e,lQt,nhe,uQt=V(()=>{p();Em();E_();DR();bm();X$();H2e();O$e();V2e();nhe=class t{constructor(e,n){AE.add(this),this.messages=[],this.receivedMessages=[],XR.set(this,void 0),SG.set(this,null),this.controller=new AbortController,G9.set(this,void 0),Kpe.set(this,()=>{}),W9.set(this,()=>{}),q9.set(this,void 0),zpe.set(this,()=>{}),H9.set(this,()=>{}),dC.set(this,{}),V9.set(this,!1),Jpe.set(this,!1),Xpe.set(this,!1),bP.set(this,!1),Zpe.set(this,void 0),ehe.set(this,void 0),the.set(this,void 0),j9.set(this,void 0),L$e.set(this,r=>{if(Wt(this,Jpe,!0,"f"),uE(r)&&(r=new Mp),r instanceof Mp)return Wt(this,Xpe,!0,"f"),this._emit("abort",r);if(r instanceof gn)return this._emit("error",r);if(r instanceof Error){let s=new gn(r.message);return s.cause=r,this._emit("error",s)}return this._emit("error",new gn(String(r)))}),Wt(this,G9,new Promise((r,s)=>{Wt(this,Kpe,r,"f"),Wt(this,W9,s,"f")}),"f"),Wt(this,q9,new Promise((r,s)=>{Wt(this,zpe,r,"f"),Wt(this,H9,s,"f")}),"f"),xe(this,G9,"f").catch(()=>{}),xe(this,q9,"f").catch(()=>{}),Wt(this,SG,e,"f"),Wt(this,j9,n?.logger??console,"f")}get response(){return xe(this,Zpe,"f")}get request_id(){return xe(this,ehe,"f")}get workspace_id(){return xe(this,the,"f")}async withResponse(){Wt(this,bP,!0,"f");let e=await xe(this,G9,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id"),workspace_id:e.headers.get("anthropic-workspace-id")}}static fromReadableStream(e){let n=new t(null);return n._run(()=>n._fromReadableStream(e)),n}static createMessage(e,n,r,{logger:s}={}){let i=new t(n,{logger:s});for(let o of n.messages)i._addMessageParam(o);return Wt(i,SG,{...n,stream:!0},"f"),i._run(()=>i._createMessage(e,{...n,stream:!0},{...r,headers:{...r?.headers,[zde]:"stream"}})),i}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},xe(this,L$e,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,n=!0){this.receivedMessages.push(e),n&&this._emit("message",e)}async _createMessage(e,n,r){let s=r?.signal,i;s&&(s.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),s.addEventListener("abort",i));try{xe(this,AE,"m",F$e).call(this);let{response:o,data:a}=await e.create({...n,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(o);for await(let c of a)xe(this,AE,"m",Q$e).call(this,c);if(a.controller.signal?.aborted)throw new Mp;xe(this,AE,"m",U$e).call(this)}finally{s&&i&&s.removeEventListener("abort",i)}}_connected(e){this.ended||(Wt(this,Zpe,e,"f"),Wt(this,ehe,e?.headers.get("request-id"),"f"),Wt(this,the,e?.headers.get("anthropic-workspace-id"),"f"),xe(this,Kpe,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,V9,"f")}get errored(){return xe(this,Jpe,"f")}get aborted(){return xe(this,Xpe,"f")}abort(){this.controller.abort()}on(e,n){return(xe(this,dC,"f")[e]||(xe(this,dC,"f")[e]=[])).push({listener:n}),this}off(e,n){let r=xe(this,dC,"f")[e];if(!r)return this;let s=r.findIndex(i=>i.listener===n);return s>=0&&r.splice(s,1),this}once(e,n){return(xe(this,dC,"f")[e]||(xe(this,dC,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,r)=>{Wt(this,bP,!0,"f"),e!=="error"&&this.once("error",r),this.once(e,n)})}async done(){Wt(this,bP,!0,"f"),await xe(this,q9,"f")}get currentMessage(){return xe(this,XR,"f")}async finalMessage(){return await this.done(),xe(this,AE,"m",M$e).call(this)}async finalText(){return await this.done(),xe(this,AE,"m",cQt).call(this)}_emit(e,...n){if(xe(this,V9,"f"))return;e==="end"&&(Wt(this,V9,!0,"f"),xe(this,zpe,"f").call(this));let r=xe(this,dC,"f")[e];if(r&&(xe(this,dC,"f")[e]=r.filter(s=>!s.once),r.forEach(({listener:s})=>s(...n))),e==="abort"){let s=n[0];!xe(this,bP,"f")&&!r?.length&&Promise.reject(s),xe(this,W9,"f").call(this,s),xe(this,H9,"f").call(this,s),this._emit("end");return}if(e==="error"){let s=n[0];!xe(this,bP,"f")&&!r?.length&&Promise.reject(s),xe(this,W9,"f").call(this,s),xe(this,H9,"f").call(this,s),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,AE,"m",M$e).call(this))}async _fromReadableStream(e,n){let r=n?.signal,s;r&&(r.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),r.addEventListener("abort",s));try{xe(this,AE,"m",F$e).call(this),this._connected(null);let i=lA.fromReadableStream(e,this.controller);for await(let o of i)xe(this,AE,"m",Q$e).call(this,o);if(i.controller.signal?.aborted)throw new Mp;xe(this,AE,"m",U$e).call(this)}finally{r&&s&&r.removeEventListener("abort",s)}}[(XR=new WeakMap,SG=new WeakMap,G9=new WeakMap,Kpe=new WeakMap,W9=new WeakMap,q9=new WeakMap,zpe=new WeakMap,H9=new WeakMap,dC=new WeakMap,V9=new WeakMap,Jpe=new WeakMap,Xpe=new WeakMap,bP=new WeakMap,Zpe=new WeakMap,ehe=new WeakMap,the=new WeakMap,j9=new WeakMap,L$e=new WeakMap,AE=new WeakSet,M$e=function(){if(this.receivedMessages.length===0)throw new gn("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},cQt=function(){if(this.receivedMessages.length===0)throw new gn("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(n.length===0)throw new gn("stream ended without producing a content block with type=text");return n.join(" ")},F$e=function(){this.ended||Wt(this,XR,void 0,"f")},Q$e=function(n){if(this.ended)return;let r=xe(this,AE,"m",lQt).call(this,n);switch(this._emit("streamEvent",n,r),n.type){case"content_block_delta":{let s=r.content.at(-1);switch(n.delta.type){case"text_delta":{s.type==="text"&&this._emit("text",n.delta.text,s.text||"");break}case"citations_delta":{s.type==="text"&&this._emit("citation",n.delta.citation,s.citations??[]);break}case"input_json_delta":{$$e(s)&&xe(this,dC,"f").inputJson?.length&&this._emit("inputJson",n.delta.partial_json,s.input);break}case"thinking_delta":{s.type==="thinking"&&this._emit("thinking",n.delta.thinking,s.thinking);break}case"signature_delta":{s.type==="thinking"&&this._emit("signature",s.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(B$e(r,xe(this,SG,"f"),{logger:xe(this,j9,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{Wt(this,XR,r,"f");break}case"content_block_start":case"message_delta":break}},U$e=function(){if(this.ended)throw new gn("stream has ended, this shouldn't happen");let n=xe(this,XR,"f");if(!n)throw new gn("request ended without sending any chunks");return Wt(this,XR,void 0,"f"),B$e(n,xe(this,SG,"f"),{logger:xe(this,j9,"f")})},lQt=function(n){let r=xe(this,XR,"f");if(n.type==="message_start"){if(r)throw new gn(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!r)throw new gn(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return r;case"message_delta":return r.stop_reason=n.delta.stop_reason,r.stop_sequence=n.delta.stop_sequence,r.stop_details=n.delta.stop_details,r.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(r.container=n.delta.container),n.usage.input_tokens!=null&&(r.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(r.usage.server_tool_use=n.usage.server_tool_use),n.usage.output_tokens_details!=null&&(r.usage.output_tokens_details=n.usage.output_tokens_details),r;case"content_block_start":return r.content.push({...n.content_block}),r;case"content_block_delta":{let s=r.content.at(n.index);switch(n.delta.type){case"text_delta":{s?.type==="text"&&(r.content[n.index]={...s,text:(s.text||"")+n.delta.text});break}case"citations_delta":{s?.type==="text"&&(r.content[n.index]={...s,citations:[...s.citations??[],n.delta.citation]});break}case"input_json_delta":{if(s&&$$e(s)){let i=(s[YR]||"")+n.delta.partial_json;r.content[n.index]=Upe(s,i)}break}case"thinking_delta":{s?.type==="thinking"&&(r.content[n.index]={...s,thinking:s.thinking+n.delta.thinking});break}case"signature_delta":{s?.type==="thinking"&&(r.content[n.index]={...s,signature:n.delta.signature});break}default:n.delta}return r}case"content_block_stop":{let s=r.content.at(n.index);return s&&$$e(s)&&YR in s&&Object.defineProperty(s,"input",{value:s.input,enumerable:!0,configurable:!0,writable:!0}),r}}},Symbol.asyncIterator)](){let e=[],n=[],r=!1;return this.on("streamEvent",s=>{let i=n.shift();i?i.resolve(s):e.push(s)}),this.on("end",()=>{r=!0;for(let s of n)s.resolve(void 0);n.length=0}),this.on("abort",s=>{r=!0;for(let i of n)i.reject(s);n.length=0}),this.on("error",s=>{r=!0;for(let i of n)i.reject(s);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((i,o)=>n.push({resolve:i,reject:o})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new lA(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var CG,G$e=V(()=>{p();os();$s();Ys();Q2e();X$();ii();CG=class extends En{create(e,n){let{user_profile_id:r,...s}=e;return this._client.post("/v1/messages/batches",{body:s,...n,headers:gt([{...r!=null?{"anthropic-user-profile-id":r}:void 0},n?.headers])})}retrieve(e,n){return this._client.get(xt`/v1/messages/batches/${e}`,n)}list(e={},n){return this._client.getAPIList("/v1/messages/batches",Bu,{query:e,...n})}delete(e,n){return this._client.delete(xt`/v1/messages/batches/${e}`,n)}cancel(e,n){return this._client.post(xt`/v1/messages/batches/${e}/cancel`,n)}async results(e,n){let r=await this.retrieve(e);if(!r.results_url)throw new gn(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);return this._client.get(r.results_url,{...n,headers:gt([{Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,i)=>Z$.fromResponse(i.response,i.controller))}}});var ZR,dQt,swr,W$e=V(()=>{p();os();Ys();E_();uQt();O$e();G$e();G$e();$2e();ZR=class extends En{constructor(){super(...arguments),this.batches=new CG(this._client)}create(e,n){let{user_profile_id:r,...s}=e;s.model in dQt&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${dQt[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),swr.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let i=n?.timeout??this._client._options.timeout;if(!s.stream&&i==null){let a=Qpe[s.model]??void 0;i=this._client.calculateNonstreamingTimeout(s.max_tokens,a)}let o=Jde(s.tools,s.messages);return this._client.post("/v1/messages",{body:s,timeout:i??6e5,...n,headers:gt([{...r!=null?{"anthropic-user-profile-id":r}:void 0},o,n?.headers]),stream:e.stream??!1})}parse(e,n){return this.create(e,n).then(r=>P$e(r,e,{logger:this._client.logger??console}))}stream(e,n){return nhe.createMessage(this,e,n,{logger:this._client.logger??console})}countTokens(e,n){let{user_profile_id:r,...s}=e;return this._client.post("/v1/messages/count_tokens",{body:s,...n,headers:gt([{...r!=null?{"anthropic-user-profile-id":r}:void 0},n?.headers])})}},dQt={},swr=["claude-mythos-preview","claude-opus-4-6"];ZR.Batches=CG});var _P,q$e=V(()=>{p();os();$s();Ys();ii();_P=class extends En{retrieve(e,n={},r){let{betas:s}=n??{};return this._client.get(xt`/v1/models/${e}`,{...r,headers:gt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}list(e={},n){let{betas:r,...s}=e??{};return this._client.getAPIList("/v1/models",Bu,{query:s,...n,headers:gt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}}});var IG,H$e=V(()=>{p();os();$s();Lx();ii();IG=class extends En{create(e,n,r){return this._client.post(xt`/v1/skills/${e}/versions`,pE({body:n,...r},this._client,!1))}retrieve(e,n,r){let{skill_id:s}=n;return this._client.get(xt`/v1/skills/${s}/versions/${e}`,r)}list(e,n={},r){return this._client.getAPIList(xt`/v1/skills/${e}/versions`,cr,{query:n,...r})}delete(e,n,r){let{skill_id:s}=n;return this._client.delete(xt`/v1/skills/${s}/versions/${e}`,r)}}});var ek,V$e=V(()=>{p();os();H$e();H$e();$s();Lx();ii();ek=class extends En{constructor(){super(...arguments),this.versions=new IG(this._client)}create(e,n){return this._client.post("/v1/skills",pE({body:e,...n},this._client,!1))}retrieve(e,n){return this._client.get(xt`/v1/skills/${e}`,n)}list(e={},n){return this._client.getAPIList("/v1/skills",cr,{query:e,...n})}delete(e,n){return this._client.delete(xt`/v1/skills/${e}`,n)}};ek.Versions=IG});var pQt=V(()=>{p();xLt();k$e();N$e();D$e();W$e();q$e();V$e()});var j$e,Y$e,rhe,hQt,mQt,fQt,el,$f,K$e=V(()=>{p();Em();xde();bm();m$();DR();wde();vde();f$();EUe();TUe();X8();Ra();A$();zMt();fLt();_Lt();$s();jUe();pQt();qde();N$e();D$e();q$e();k$e();W$e();V$e();wde();Ys();y$();y_();bm();mQt="\\n\\nHuman:",fQt="\\n\\nAssistant:",el=class{get credentials(){return this._authState.provider}constructor({baseURL:e=Di("ANTHROPIC_BASE_URL"),apiKey:n,authToken:r,webhookKey:s=Di("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...i}={}){if(j$e.add(this),this._requestAuthFlags=new WeakMap,rhe.set(this,void 0),n===void 0&&(n=i.profile!=null?null:Di("ANTHROPIC_API_KEY")??null),r===void 0&&(r=i.profile!=null?null:Di("ANTHROPIC_AUTH_TOKEN")??null),i.profile!=null&&(i.credentials!=null||i.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let o={apiKey:n,authToken:r,webhookKey:s,...i,baseURL:e||"https://api.anthropic.com"};if(!o.dangerouslyAllowBrowser&&wMt())throw new gn(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`});async function M7r(t,e=t.messages.at(-1),n){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let r=e.content.filter(o=>o.type==="tool_use");if(r.length===0)return null;let i=L7r(t);return{role:"user",content:await Promise.all(r.map(async o=>{let a=t.tools.find(c=>("name"in c?c.name:"mcp_server_name"in c?c.mcp_server_name:c.type)===o.name);if(!a||!("run"in a)||!i.has(o.name))return O7r(o);try{let c=o.input;"parse"in a&&a.parse&&(c=a.parse(c));let u=await a.run(c,{toolUse:o,toolUseBlock:o,signal:n?.signal});return{type:"tool_result",tool_use_id:o.id,content:u}}catch(c){return{type:"tool_result",tool_use_id:o.id,content:c instanceof Oi?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function O7r(t){return{type:"tool_result",tool_use_id:t.id,content:`Error: Tool '${t.name}' not found`,is_error:!0}}function L7r(t){let e=new Set;for(let n of t.tools)"run"in n&&e.add(n.name);for(let n of t.messages)if(!(n.role!=="system"||typeof n.content=="string"))for(let r of n.content)F7r(r,e);return e}function F7r(t,e){switch(t.type){case"tool_removal":case"tool_addition":Q7r(t,e);break}}function Q7r(t,e){let n=U7r(t.tool);n!==void 0&&(t.type==="tool_removal"?e.delete(n):e.add(n))}function U7r(t){if(t.type==="tool_reference")return t.name}function G7r(t){if(t===null)return"stop";switch(t){case"tool_use":return"run_tools";case"pause_turn":case"compaction":return"resume";case"end_turn":case"stop_sequence":case"max_tokens":case"model_context_window_exceeded":case"refusal":return"stop";default:return"stop"}}var XJ,Sq,pL,xu,oA,Ny,av,MB,ZJ,vzt,_8e,Cq,x8e=v(()=>{p();Mf();eL();tc();Ui();L4e();Of();Tzt();px();Cq=class{constructor(e,n,r){XJ.add(this),this.client=e,Sq.set(this,!1),pL.set(this,!1),xu.set(this,void 0),oA.set(this,void 0),Ny.set(this,void 0),av.set(this,void 0),MB.set(this,void 0),ZJ.set(this,0),Ht(this,xu,{params:{...n,messages:structuredClone(n.messages)}},"f");let i=E4e(n.tools,n.messages);Ht(this,oA,{...r,headers:pt([CJ("BetaToolRunner"),i.length?{[bB]:i.join(", ")}:void 0,r?.headers])},"f"),Ht(this,MB,oq(),"f"),n.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Sq=new WeakMap,pL=new WeakMap,xu=new WeakMap,oA=new WeakMap,Ny=new WeakMap,av=new WeakMap,MB=new WeakMap,ZJ=new WeakMap,XJ=new WeakSet,vzt=async function(){let n=Ce(this,xu,"f").params.compactionControl;if(!n||!n.enabled)return!1;let r=0;if(Ce(this,Ny,"f")!==void 0)try{let u=await Ce(this,Ny,"f");r=u.usage.input_tokens+(u.usage.cache_creation_input_tokens??0)+(u.usage.cache_read_input_tokens??0)+u.usage.output_tokens}catch{return!1}let i=n.contextTokenThreshold??1e5;if(rd.type!=="tool_use");l.length===0?a.pop():u.content=l}}let c=await this.client.beta.messages.create({model:s,messages:[...a,{role:"user",content:[{type:"text",text:o}]}],max_tokens:Ce(this,xu,"f").params.max_tokens},{signal:Ce(this,oA,"f").signal,headers:pt([Ce(this,oA,"f").headers,CJ("compaction")])});if(c.content[0]?.type!=="text")throw new En("Expected text response for compaction");return Ce(this,xu,"f").params.messages=[{role:"user",content:c.content}],!0},Symbol.asyncIterator)](){var e;if(Ce(this,Sq,"f"))throw new En("Cannot iterate over a consumed stream");Ht(this,Sq,!0,"f"),Ht(this,pL,!0,"f"),Ht(this,av,void 0,"f");try{for(;;){let n;try{if(Ce(this,xu,"f").params.max_iterations&&Ce(this,ZJ,"f")>=Ce(this,xu,"f").params.max_iterations)break;Ht(this,pL,!1,"f"),Ht(this,av,void 0,"f"),Ht(this,ZJ,(e=Ce(this,ZJ,"f"),e++,e),"f"),Ht(this,Ny,void 0,"f");let{max_iterations:r,compactionControl:i,...s}=Ce(this,xu,"f").params;if(s.stream?(n=this.client.beta.messages.stream({...s},Ce(this,oA,"f")),Ht(this,Ny,n.finalMessage(),"f"),Ce(this,Ny,"f").catch(()=>{}),yield n):(Ht(this,Ny,this.client.beta.messages.create({...s,stream:!1},Ce(this,oA,"f")),"f"),yield Ce(this,Ny,"f")),!await Ce(this,XJ,"m",vzt).call(this)){if(!Ce(this,pL,"f")){let c=await Ce(this,Ny,"f"),u=G7r(c.stop_reason);Ce(this,xu,"f").params.messages.push({role:c.role,content:c.content});let{container:l}=Ce(this,xu,"f").params;if(c.container&&(l==null?Ce(this,xu,"f").params.container=c.container.id:typeof l=="object"&&l.id==null&&(Ce(this,xu,"f").params.container={...l,id:c.container.id})),u==="stop")break;if(u==="resume")continue}let a=await Ce(this,XJ,"m",_8e).call(this,Ce(this,xu,"f").params.messages.at(-1));if(a)Ce(this,xu,"f").params.messages.push(a);else if(!Ce(this,pL,"f"))break}}finally{n&&n.abort()}}if(!Ce(this,Ny,"f"))throw new En("ToolRunner concluded without a message from the server");Ce(this,MB,"f").resolve(await Ce(this,Ny,"f"))}catch(n){throw Ht(this,Sq,!1,"f"),Ce(this,MB,"f").promise.catch(()=>{}),Ce(this,MB,"f").reject(n),Ht(this,MB,oq(),"f"),n}}setMessagesParams(e){typeof e=="function"?Ce(this,xu,"f").params=e(Ce(this,xu,"f").params):Ce(this,xu,"f").params=e,Ht(this,pL,!0,"f"),Ht(this,av,void 0,"f")}setRequestOptions(e){typeof e=="function"?Ht(this,oA,e(Ce(this,oA,"f")),"f"):Ht(this,oA,{...Ce(this,oA,"f"),...e},"f")}async generateToolResponse(e=Ce(this,oA,"f").signal){let n=await Ce(this,Ny,"f")??this.params.messages.at(-1);return n?Ce(this,XJ,"m",_8e).call(this,n,e):null}done(){return Ce(this,MB,"f").promise}async runUntilDone(){if(!Ce(this,Sq,"f"))for await(let e of this);return this.done()}get params(){return Ce(this,xu,"f").params}pushMessages(...e){this.setMessagesParams(n=>({...n,messages:[...n.messages,...e]}))}then(e,n){return this.runUntilDone().then(e,n)}};_8e=async function(e,n=Ce(this,oA,"f").signal){return Ce(this,av,"f")!==void 0?Ce(this,av,"f"):(Ht(this,av,M7r(Ce(this,xu,"f").params,e,{...Ce(this,oA,"f"),signal:n}),"f"),Ce(this,av,"f"))}});function kzt(t){if(!t.output_format)return t;if(t.output_config?.format)throw new En("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...n}=t;return{...n,output_config:{...t.output_config,format:e}}}var Rzt,$7r,cv,S8e=v(()=>{p();yq();c8e();ui();l8e();Ui();px();p8e();Izt();x8e();eL();c8e();x8e();eL();Rzt={},$7r=["claude-mythos-preview","claude-opus-4-6"],cv=class extends _n{constructor(){super(...arguments),this.batches=new bq(this._client)}create(e,n){let r=kzt(e),{betas:i,user_profile_id:s,workspace_id:o,...a}=r;a.model in Rzt&&console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${Rzt[a.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),$7r.includes(a.model)&&a.thinking&&a.thinking.type==="enabled"&&console.warn(`Using Claude with ${a.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=n?.timeout??this._client._options.timeout;if(!a.stream&&c==null){let l=Fye[a.model]??void 0;c=this._client.calculateNonstreamingTimeout(a.max_tokens,l)}let u=KAe(a.tools,a.messages);return this._client.post("/v1/messages?beta=true",{body:a,timeout:c??6e5,...n,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...s!=null?{"anthropic-user-profile-id":s}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},u,n?.headers]),stream:r.stream??!1})}parse(e,n){return n={...n,headers:pt([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},n?.headers])},this.create(e,n).then(r=>d8e(r,e,{logger:this._client.logger??console}))}stream(e,n){return Vye.createMessage(this,e,n)}countTokens(e,n){let r=kzt(e),{betas:i,user_profile_id:s,workspace_id:o,...a}=r;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...n,headers:pt([{"anthropic-beta":[...i??[],"token-counting-2024-11-01"].toString(),...s!=null?{"anthropic-user-profile-id":s}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},n?.headers])})}toolRunner(e,n){return new Cq(this._client,e,n)}};cv.Batches=bq;cv.BetaToolRunner=Cq;cv.ToolError=Oi});var Iq,C8e=v(()=>{p();ui();zi();ms();Iq=class extends _n{retrieve(e,n){return this._client.get(wt`/v1/organizations/api_keys/${e}?beta=true`,n)}update(e,n,r){return this._client.post(wt`/v1/organizations/api_keys/${e}?beta=true`,{body:n,...r})}list(e={},n){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",wd,{query:e,...n})}}});var wq,I8e=v(()=>{p();ui();wq=class extends _n{retrieve(e){return this._client.get("/v1/organizations/compliance_settings?beta=true",e)}update(e,n){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:e,...n})}}});var Tq,w8e=v(()=>{p();ui();zi();ms();Tq=class extends _n{create(e,n){return this._client.post("/v1/organizations/external_keys?beta=true",{body:e,...n})}retrieve(e,n){return this._client.get(wt`/v1/organizations/external_keys/${e}?beta=true`,n)}update(e,n,r){return this._client.post(wt`/v1/organizations/external_keys/${e}?beta=true`,{body:n,...r})}list(e={},n){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",ur,{query:e,...n})}delete(e,n){return this._client.delete(wt`/v1/organizations/external_keys/${e}?beta=true`,n)}validate(e,n){return this._client.post(wt`/v1/organizations/external_keys/${e}/validate?beta=true`,n)}}});var vq,T8e=v(()=>{p();ui();zi();ms();vq=class extends _n{create(e,n){return this._client.post("/v1/organizations/invites?beta=true",{body:e,...n})}retrieve(e,n){return this._client.get(wt`/v1/organizations/invites/${e}?beta=true`,n)}list(e={},n){return this._client.getAPIList("/v1/organizations/invites?beta=true",wd,{query:e,...n})}delete(e,n){return this._client.delete(wt`/v1/organizations/invites/${e}?beta=true`,n)}}});var Rq,v8e=v(()=>{p();ui();zi();Rq=class extends _n{list(e={},n){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",ur,{query:e,...n})}}});var kq,R8e=v(()=>{p();ui();zi();ms();kq=class extends _n{retrieve(e,n){return this._client.get(wt`/v1/organizations/users/${e}?beta=true`,n)}update(e,n,r){return this._client.post(wt`/v1/organizations/users/${e}?beta=true`,{body:n,...r})}list(e={},n){return this._client.getAPIList("/v1/organizations/users?beta=true",wd,{query:e,...n})}remove(e,n){return this._client.delete(wt`/v1/organizations/users/${e}?beta=true`,n)}}});var Bq,k8e=v(()=>{p();ui();zi();Ui();ms();Bq=class extends _n{create(e,n){let{betas:r,...i}=e;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:i,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i}=n??{};return this._client.get(wt`/v1/organizations/federation_issuers/${e}?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}update(e,n,r){let{betas:i,...s}=n;return this._client.post(wt`/v1/organizations/federation_issuers/${e}?beta=true`,{body:s,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}list(e={},n){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",ur,{query:i,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}archive(e,n={},r){let{betas:i}=n??{};return this._client.post(wt`/v1/organizations/federation_issuers/${e}/archive?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}}});var Nq,B8e=v(()=>{p();ui();zi();Ui();ms();Nq=class extends _n{list(e,n={},r){let{betas:i,...s}=n??{};return this._client.getAPIList(wt`/v1/organizations/federation_rules/${e}/workspaces?beta=true`,ur,{query:s,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}add(e,n,r){let{betas:i,...s}=n;return this._client.post(wt`/v1/organizations/federation_rules/${e}/workspaces?beta=true`,{body:s,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}remove(e,n,r){let{federation_rule_id:i,betas:s}=n;return this._client.delete(wt`/v1/organizations/federation_rules/${i}/workspaces/${e}?beta=true`,{...r,headers:pt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}}});var mL,N8e=v(()=>{p();ui();B8e();B8e();zi();Ui();ms();mL=class extends _n{constructor(){super(...arguments),this.workspaces=new Nq(this._client)}create(e,n){let{betas:r,...i}=e;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:i,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i}=n??{};return this._client.get(wt`/v1/organizations/federation_rules/${e}?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}update(e,n,r){let{betas:i,...s}=n;return this._client.post(wt`/v1/organizations/federation_rules/${e}?beta=true`,{body:s,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}list(e={},n){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",ur,{query:i,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}archive(e,n={},r){let{betas:i}=n??{};return this._client.post(wt`/v1/organizations/federation_rules/${e}/archive?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}};mL.Workspaces=Nq});var OB,D8e=v(()=>{p();ui();k8e();k8e();N8e();N8e();OB=class extends _n{constructor(){super(...arguments),this.issuers=new Bq(this._client),this.rules=new mL(this._client)}};OB.Issuers=Bq;OB.Rules=mL});var Dq,P8e=v(()=>{p();ui();zi();Ui();ms();Dq=class extends _n{list(e,n={},r){let{betas:i,...s}=n??{};return this._client.getAPIList(wt`/v1/organizations/service_accounts/${e}/workspaces?beta=true`,ur,{query:s,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}add(e,n,r){let{betas:i,...s}=n;return this._client.post(wt`/v1/organizations/service_accounts/${e}/workspaces?beta=true`,{body:s,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}remove(e,n,r){let{service_account_id:i,betas:s}=n;return this._client.delete(wt`/v1/organizations/service_accounts/${i}/workspaces/${e}?beta=true`,{...r,headers:pt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}}});var hL,M8e=v(()=>{p();ui();P8e();P8e();zi();Ui();ms();hL=class extends _n{constructor(){super(...arguments),this.workspaces=new Dq(this._client)}create(e,n){let{betas:r,...i}=e;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:i,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i}=n??{};return this._client.get(wt`/v1/organizations/service_accounts/${e}?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}update(e,n,r){let{betas:i,...s}=n;return this._client.post(wt`/v1/organizations/service_accounts/${e}?beta=true`,{body:s,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}list(e={},n){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",ur,{query:i,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}archive(e,n={},r){let{betas:i}=n??{};return this._client.post(wt`/v1/organizations/service_accounts/${e}/archive?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}};hL.Workspaces=Dq});var Pq,O8e=v(()=>{p();ui();zi();ms();Pq=class extends _n{retrieve(e,n,r){let{workspace_id:i}=n;return this._client.get(wt`/v1/organizations/workspaces/${i}/members/${e}?beta=true`,r)}update(e,n,r){let{workspace_id:i,...s}=n;return this._client.post(wt`/v1/organizations/workspaces/${i}/members/${e}?beta=true`,{body:s,...r})}list(e,n={},r){return this._client.getAPIList(wt`/v1/organizations/workspaces/${e}/members?beta=true`,wd,{query:n,...r})}add(e,n,r){return this._client.post(wt`/v1/organizations/workspaces/${e}/members?beta=true`,{body:n,...r})}remove(e,n,r){let{workspace_id:i}=n;return this._client.delete(wt`/v1/organizations/workspaces/${i}/members/${e}?beta=true`,r)}}});var Mq,L8e=v(()=>{p();ui();zi();ms();Mq=class extends _n{list(e,n={},r){return this._client.getAPIList(wt`/v1/organizations/workspaces/${e}/rate_limits?beta=true`,ur,{query:n,...r})}}});var Oq,F8e=v(()=>{p();ui();zi();Ui();ms();Oq=class extends _n{retrieve(e,n,r){let{workspace_id:i,betas:s}=n;return this._client.get(wt`/v1/organizations/workspaces/${i}/service_accounts/${e}?beta=true`,{...r,headers:pt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}update(e,n,r){let{workspace_id:i,betas:s,...o}=n;return this._client.post(wt`/v1/organizations/workspaces/${i}/service_accounts/${e}?beta=true`,{body:o,...r,headers:pt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}list(e,n={},r){let{betas:i,...s}=n??{};return this._client.getAPIList(wt`/v1/organizations/workspaces/${e}/service_accounts?beta=true`,ur,{query:s,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}add(e,n,r){let{betas:i,...s}=n;return this._client.post(wt`/v1/organizations/workspaces/${e}/service_accounts?beta=true`,{body:s,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}remove(e,n,r){let{workspace_id:i,betas:s}=n;return this._client.delete(wt`/v1/organizations/workspaces/${i}/service_accounts/${e}?beta=true`,{...r,headers:pt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},r?.headers])})}}});var lv,Q8e=v(()=>{p();ui();O8e();O8e();L8e();L8e();F8e();F8e();zi();Ui();ms();lv=class extends _n{constructor(){super(...arguments),this.rateLimits=new Mq(this._client),this.members=new Pq(this._client),this.serviceAccounts=new Oq(this._client)}create(e,n){let{betas:r,...i}=e;return this._client.post("/v1/organizations/workspaces?beta=true",{body:i,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}retrieve(e,n){return this._client.get(wt`/v1/organizations/workspaces/${e}?beta=true`,n)}update(e,n,r){return this._client.post(wt`/v1/organizations/workspaces/${e}?beta=true`,{body:n,...r})}list(e={},n){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",wd,{query:e,...n})}archive(e,n){return this._client.post(wt`/v1/organizations/workspaces/${e}/archive?beta=true`,n)}};lv.RateLimits=Mq;lv.Members=Pq;lv.ServiceAccounts=Oq});var Qf,U8e=v(()=>{p();ui();C8e();C8e();I8e();I8e();w8e();w8e();T8e();T8e();v8e();v8e();R8e();R8e();D8e();D8e();M8e();M8e();Q8e();Q8e();Qf=class extends _n{constructor(){super(...arguments),this.apiKeys=new Iq(this._client),this.externalKeys=new Tq(this._client),this.federation=new OB(this._client),this.invites=new vq(this._client),this.serviceAccounts=new hL(this._client),this.users=new kq(this._client),this.workspaces=new lv(this._client),this.rateLimits=new Rq(this._client),this.complianceSettings=new wq(this._client)}retrieve(e){return this._client.get("/v1/organizations/me?beta=true",e)}};Qf.APIKeys=Iq;Qf.ExternalKeys=Tq;Qf.Federation=OB;Qf.Invites=vq;Qf.ServiceAccounts=hL;Qf.Users=kq;Qf.Workspaces=lv;Qf.RateLimits=Rq;Qf.ComplianceSettings=wq});var fL,G8e=v(()=>{p();ui();zi();Ui();ms();Eye();Eye();fL=class extends _n{list(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.getAPIList(wt`/v1/sessions/${e}/events?beta=true`,ur,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}send(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/sessions/${e}/events?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}stream(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.get(wt`/v1/sessions/${e}/events/stream?beta=true`,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),stream:!0})}toolRunner(e,n){return new TB(e,{...n,client:this._client})}};fL.SessionToolRunner=TB});var Lq,$8e=v(()=>{p();ui();zi();Ui();ms();Lq=class extends _n{retrieve(e,n,r){let{session_id:i,betas:s,workspace_id:o}=n;return this._client.get(wt`/v1/sessions/${i}/resources/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}update(e,n,r){let{session_id:i,betas:s,workspace_id:o,...a}=n;return this._client.post(wt`/v1/sessions/${i}/resources/${e}?beta=true`,{body:a,...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.getAPIList(wt`/v1/sessions/${e}/resources?beta=true`,ur,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}delete(e,n,r){let{session_id:i,betas:s,workspace_id:o}=n;return this._client.delete(wt`/v1/sessions/${i}/resources/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}add(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/sessions/${e}/resources?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}}});var Fq,W8e=v(()=>{p();ui();zi();Ui();ms();Fq=class extends _n{list(e,n,r){let{session_id:i,betas:s,workspace_id:o,...a}=n;return this._client.getAPIList(wt`/v1/sessions/${i}/threads/${e}/events?beta=true`,ur,{query:a,...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}stream(e,n,r){let{session_id:i,betas:s,workspace_id:o,...a}=n;return this._client.get(wt`/v1/sessions/${i}/threads/${e}/stream?beta=true`,{query:a,...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),stream:!0})}}});var gL,H8e=v(()=>{p();ui();W8e();W8e();zi();Ui();ms();gL=class extends _n{constructor(){super(...arguments),this.events=new Fq(this._client)}retrieve(e,n,r){let{session_id:i,betas:s,workspace_id:o}=n;return this._client.get(wt`/v1/sessions/${i}/threads/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.getAPIList(wt`/v1/sessions/${e}/threads?beta=true`,ur,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}archive(e,n,r){let{session_id:i,betas:s,workspace_id:o}=n;return this._client.post(wt`/v1/sessions/${i}/threads/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}};gL.Events=Fq});var uv,q8e=v(()=>{p();ui();G8e();G8e();$8e();$8e();H8e();H8e();zi();Ui();ms();uv=class extends _n{constructor(){super(...arguments),this.events=new fL(this._client),this.resources=new Lq(this._client),this.threads=new gL(this._client)}create(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/sessions?beta=true",{body:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/sessions/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}update(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/sessions/${e}?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",qAe,{query:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.delete(wt`/v1/sessions/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}archive(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/sessions/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}};uv.Events=fL;uv.Resources=Lq;uv.Threads=gL});var Qq,j8e=v(()=>{p();ui();zi();Ui();iv();ms();Qq=class extends _n{create(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/skills/${e}/versions?beta=true`,D0({body:o,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])},this._client,!1))}retrieve(e,n,r){let{skill_id:i,betas:s,workspace_id:o}=n;return this._client.get(wt`/v1/skills/${i}/versions/${e}?beta=true`,{...r,headers:pt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.getAPIList(wt`/v1/skills/${e}/versions?beta=true`,ur,{query:o,...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}delete(e,n,r){let{skill_id:i,betas:s,workspace_id:o}=n;return this._client.delete(wt`/v1/skills/${i}/versions/${e}?beta=true`,{...r,headers:pt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}download(e,n,r){let{skill_id:i,betas:s,workspace_id:o}=n;return this._client.get(wt`/v1/skills/${i}/versions/${e}/content?beta=true`,{...r,headers:pt([{Accept:"application/binary",...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__binaryResponse:!0})}}});var AL,V8e=v(()=>{p();ui();j8e();j8e();zi();Ui();iv();ms();AL=class extends _n{constructor(){super(...arguments),this.versions=new Qq(this._client)}create(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/skills?beta=true",D0({body:s,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])},this._client,!1))}retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/skills/${e}?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/skills?beta=true",ur,{query:s,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.delete(wt`/v1/skills/${e}?beta=true`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}};AL.Versions=Qq});var Uq,Y8e=v(()=>{p();ui();zi();Ui();ms();Uq=class extends _n{create(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/tunnels/${e}/certificates?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}retrieve(e,n,r){let{tunnel_id:i,betas:s,workspace_id:o}=n;return this._client.get(wt`/v1/tunnels/${i}/certificates/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.getAPIList(wt`/v1/tunnels/${e}/certificates?beta=true`,ur,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}archive(e,n,r){let{tunnel_id:i,betas:s,workspace_id:o}=n;return this._client.post(wt`/v1/tunnels/${i}/certificates/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}}});var yL,z8e=v(()=>{p();ui();Y8e();Y8e();zi();Ui();ms();yL=class extends _n{constructor(){super(...arguments),this.certificates=new Uq(this._client)}create(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/tunnels?beta=true",{body:s,...n,headers:pt([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/tunnels/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/tunnels?beta=true",ur,{query:s,...n,headers:pt([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}archive(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/tunnels/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}revealToken(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/tunnels/${e}/reveal_token?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}rotateToken(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/tunnels/${e}/rotate_token?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}};yL.Certificates=Uq});var Gq,K8e=v(()=>{p();ui();zi();Ui();ms();Gq=class extends _n{create(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/vaults/${e}/credentials?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}retrieve(e,n,r){let{vault_id:i,betas:s,workspace_id:o}=n;return this._client.get(wt`/v1/vaults/${i}/credentials/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}update(e,n,r){let{vault_id:i,betas:s,workspace_id:o,...a}=n;return this._client.post(wt`/v1/vaults/${i}/credentials/${e}?beta=true`,{body:a,...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(e,n={},r){let{betas:i,workspace_id:s,...o}=n??{};return this._client.getAPIList(wt`/v1/vaults/${e}/credentials?beta=true`,ur,{query:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}delete(e,n,r){let{vault_id:i,betas:s,workspace_id:o}=n;return this._client.delete(wt`/v1/vaults/${i}/credentials/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}archive(e,n,r){let{vault_id:i,betas:s,workspace_id:o}=n;return this._client.post(wt`/v1/vaults/${i}/credentials/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}mcpOAuthValidate(e,n,r){let{vault_id:i,betas:s,workspace_id:o}=n;return this._client.post(wt`/v1/vaults/${i}/credentials/${e}/mcp_oauth_validate?beta=true`,{...r,headers:pt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}}});var EL,J8e=v(()=>{p();ui();K8e();K8e();zi();Ui();ms();EL=class extends _n{constructor(){super(...arguments),this.credentials=new Gq(this._client)}create(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/vaults?beta=true",{body:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/vaults/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}update(e,n,r){let{betas:i,workspace_id:s,...o}=n;return this._client.post(wt`/v1/vaults/${e}?beta=true`,{body:o,...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",ur,{query:s,...n,headers:pt([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.delete(wt`/v1/vaults/${e}?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}archive(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.post(wt`/v1/vaults/${e}/archive?beta=true`,{...r,headers:pt([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}};EL.Credentials=Gq});var ql,X8e=v(()=>{p();ui();g4e();g4e();A4e();A4e();y4e();y4e();b4e();b4e();_4e();_4e();x4e();x4e();w4e();w4e();v4e();v4e();r8e();r8e();o8e();o8e();S8e();S8e();U8e();U8e();q8e();q8e();V8e();V8e();z8e();z8e();J8e();J8e();ql=class extends _n{constructor(){super(...arguments),this.models=new HH(this._client),this.messages=new cv(this._client),this.agents=new ZO(this._client),this.environments=new uL(this._client),this.sessions=new uv(this._client),this.deployments=new GH(this._client),this.deploymentRuns=new UH(this._client),this.vaults=new EL(this._client),this.memoryStores=new NB(this._client),this.files=new WH(this._client),this.skills=new AL(this._client),this.webhooks=new VH(this._client),this.userProfiles=new qH(this._client),this.dreams=new $H(this._client),this.tunnels=new yL(this._client),this.organization=new Qf(this._client)}};ql.Models=HH;ql.Messages=cv;ql.Agents=ZO;ql.Environments=uL;ql.Sessions=uv;ql.Deployments=GH;ql.DeploymentRuns=UH;ql.Vaults=EL;ql.MemoryStores=NB;ql.Files=WH;ql.Skills=AL;ql.Webhooks=VH;ql.UserProfiles=qH;ql.Dreams=$H;ql.Tunnels=yL;ql.Organization=Qf});var bL,Z8e=v(()=>{p();ui();Ui();bL=class extends _n{create(e,n){let{betas:r,workspace_id:i,...s}=e;return this._client.post("/v1/complete",{body:s,timeout:this._client._options.timeout??6e5,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),stream:e.stream??!1})}}});var _L,eje=v(()=>{p();ui();zi();Ui();px();iv();ms();_L=class extends _n{list(e={},n){let{workspace_id:r,...i}=e??{};return this._client.getAPIList("/v1/files",ur,{query:i,...n,headers:pt([{...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(e,n={},r){let{workspace_id:i}=n??{};return this._client.delete(wt`/v1/files/${e}`,{...r,headers:pt([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}download(e,n={},r){let{workspace_id:i}=n??{};return this._client.get(wt`/v1/files/${e}/content`,{...r,headers:pt([{Accept:"application/binary",...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__binaryResponse:!0})}retrieveMetadata(e,n={},r){let{workspace_id:i}=n??{};return this._client.get(wt`/v1/files/${e}`,{...r,headers:pt([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}upload(e,n){let{workspace_id:r,...i}=e;return this._client.post("/v1/files",D0({body:i,...n,headers:pt([{...r!=null?{"anthropic-workspace-id":r}:void 0},JAe(i.file),n?.headers])},this._client))}}});function Bzt(t){return t?.output_config?.format}function tje(t,e,n){let r=Bzt(e);return!e||!("parse"in(r??{}))?{...t,content:t.content.map(i=>i.type==="text"?Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1}):i),parsed_output:null}:nje(t,e,n)}function nje(t,e,n){let r=null,i=t.content.map(s=>{if(s.type==="text"){let o=yKr(e,s.text);return r===null&&(r=o),Object.defineProperty({...s},"parsed_output",{value:o,enumerable:!1})}return s});return{...t,content:i,parsed_output:r}}function yKr(t,e){let n=Bzt(t);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(e):JSON.parse(e)}catch(r){throw new En(`Failed to parse structured output: ${r}`)}}var rje=v(()=>{p();tc()});function lje(t){return t.type==="tool_use"||t.type==="server_tool_use"}var F0,LB,$q,eX,Yye,tX,nX,zye,rX,uI,iX,Kye,Jye,xL,Xye,Zye,eEe,sX,ije,Nzt,sje,oje,aje,cje,Dzt,tEe,Pzt=v(()=>{p();Mf();px();AB();Of();yq();m8e();rje();h8e();tEe=class t{constructor(e,n){F0.add(this),this.messages=[],this.receivedMessages=[],LB.set(this,void 0),$q.set(this,null),this.controller=new AbortController,eX.set(this,void 0),Yye.set(this,()=>{}),tX.set(this,()=>{}),nX.set(this,void 0),zye.set(this,()=>{}),rX.set(this,()=>{}),uI.set(this,{}),iX.set(this,!1),Kye.set(this,!1),Jye.set(this,!1),xL.set(this,!1),Xye.set(this,void 0),Zye.set(this,void 0),eEe.set(this,void 0),sX.set(this,void 0),sje.set(this,r=>{if(Ht(this,Kye,!0,"f"),B0(r)&&(r=new Mm),r instanceof Mm)return Ht(this,Jye,!0,"f"),this._emit("abort",r);if(r instanceof En)return this._emit("error",r);if(r instanceof Error){let i=new En(r.message);return i.cause=r,this._emit("error",i)}return this._emit("error",new En(String(r)))}),Ht(this,eX,new Promise((r,i)=>{Ht(this,Yye,r,"f"),Ht(this,tX,i,"f")}),"f"),Ht(this,nX,new Promise((r,i)=>{Ht(this,zye,r,"f"),Ht(this,rX,i,"f")}),"f"),Ce(this,eX,"f").catch(()=>{}),Ce(this,nX,"f").catch(()=>{}),Ht(this,$q,e,"f"),Ht(this,sX,n?.logger??console,"f")}get response(){return Ce(this,Xye,"f")}get request_id(){return Ce(this,Zye,"f")}get workspace_id(){return Ce(this,eEe,"f")}async withResponse(){Ht(this,xL,!0,"f");let e=await Ce(this,eX,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id"),workspace_id:e.headers.get("anthropic-workspace-id")}}static fromReadableStream(e){let n=new t(null);return n._run(()=>n._fromReadableStream(e)),n}static createMessage(e,n,r,{logger:i}={}){let s=new t(n,{logger:i});for(let o of n.messages)s._addMessageParam(o);return Ht(s,$q,{...n,stream:!0},"f"),s._run(()=>s._createMessage(e,{...n,stream:!0},{...r,headers:{...r?.headers,[zAe]:"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},Ce(this,sje,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,n=!0){this.receivedMessages.push(e),n&&this._emit("message",e)}async _createMessage(e,n,r){let i=r?.signal,s;i&&(i.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),i.addEventListener("abort",s));try{Ce(this,F0,"m",oje).call(this);let{response:o,data:a}=await e.create({...n,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(o);for await(let c of a)Ce(this,F0,"m",aje).call(this,c);if(a.controller.signal?.aborted)throw new Mm;Ce(this,F0,"m",cje).call(this)}finally{i&&s&&i.removeEventListener("abort",s)}}_connected(e){this.ended||(Ht(this,Xye,e,"f"),Ht(this,Zye,e?.headers.get("request-id"),"f"),Ht(this,eEe,e?.headers.get("anthropic-workspace-id"),"f"),Ce(this,Yye,"f").call(this,e),this._emit("connect"))}get ended(){return Ce(this,iX,"f")}get errored(){return Ce(this,Kye,"f")}get aborted(){return Ce(this,Jye,"f")}abort(){this.controller.abort()}on(e,n){return(Ce(this,uI,"f")[e]||(Ce(this,uI,"f")[e]=[])).push({listener:n}),this}off(e,n){let r=Ce(this,uI,"f")[e];if(!r)return this;let i=r.findIndex(s=>s.listener===n);return i>=0&&r.splice(i,1),this}once(e,n){return(Ce(this,uI,"f")[e]||(Ce(this,uI,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,r)=>{Ht(this,xL,!0,"f"),e!=="error"&&this.once("error",r),this.once(e,n)})}async done(){Ht(this,xL,!0,"f"),await Ce(this,nX,"f")}get currentMessage(){return Ce(this,LB,"f")}async finalMessage(){return await this.done(),Ce(this,F0,"m",ije).call(this)}async finalText(){return await this.done(),Ce(this,F0,"m",Nzt).call(this)}_emit(e,...n){if(Ce(this,iX,"f"))return;e==="end"&&(Ht(this,iX,!0,"f"),Ce(this,zye,"f").call(this));let r=Ce(this,uI,"f")[e];if(r&&(Ce(this,uI,"f")[e]=r.filter(i=>!i.once),r.forEach(({listener:i})=>i(...n))),e==="abort"){let i=n[0];!Ce(this,xL,"f")&&!r?.length&&Promise.reject(i),Ce(this,tX,"f").call(this,i),Ce(this,rX,"f").call(this,i),this._emit("end");return}if(e==="error"){let i=n[0];!Ce(this,xL,"f")&&!r?.length&&Promise.reject(i),Ce(this,tX,"f").call(this,i),Ce(this,rX,"f").call(this,i),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Ce(this,F0,"m",ije).call(this))}async _fromReadableStream(e,n){let r=n?.signal,i;r&&(r.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),r.addEventListener("abort",i));try{Ce(this,F0,"m",oje).call(this),this._connected(null);let s=Ry.fromReadableStream(e,this.controller);for await(let o of s)Ce(this,F0,"m",aje).call(this,o);if(s.controller.signal?.aborted)throw new Mm;Ce(this,F0,"m",cje).call(this)}finally{r&&i&&r.removeEventListener("abort",i)}}[(LB=new WeakMap,$q=new WeakMap,eX=new WeakMap,Yye=new WeakMap,tX=new WeakMap,nX=new WeakMap,zye=new WeakMap,rX=new WeakMap,uI=new WeakMap,iX=new WeakMap,Kye=new WeakMap,Jye=new WeakMap,xL=new WeakMap,Xye=new WeakMap,Zye=new WeakMap,eEe=new WeakMap,sX=new WeakMap,sje=new WeakMap,F0=new WeakSet,ije=function(){if(this.receivedMessages.length===0)throw new En("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Nzt=function(){if(this.receivedMessages.length===0)throw new En("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(n.length===0)throw new En("stream ended without producing a content block with type=text");return n.join(" ")},oje=function(){this.ended||Ht(this,LB,void 0,"f")},aje=function(n){if(this.ended)return;let r=Ce(this,F0,"m",Dzt).call(this,n);switch(this._emit("streamEvent",n,r),n.type){case"content_block_delta":{let i=r.content.at(-1);switch(n.delta.type){case"text_delta":{i.type==="text"&&this._emit("text",n.delta.text,i.text||"");break}case"citations_delta":{i.type==="text"&&this._emit("citation",n.delta.citation,i.citations??[]);break}case"input_json_delta":{lje(i)&&Ce(this,uI,"f").inputJson?.length&&this._emit("inputJson",n.delta.partial_json,i.input);break}case"thinking_delta":{i.type==="thinking"&&this._emit("thinking",n.delta.thinking,i.thinking);break}case"signature_delta":{i.type==="thinking"&&this._emit("signature",i.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(tje(r,Ce(this,$q,"f"),{logger:Ce(this,sX,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{Ht(this,LB,r,"f");break}case"content_block_start":case"message_delta":break}},cje=function(){if(this.ended)throw new En("stream has ended, this shouldn't happen");let n=Ce(this,LB,"f");if(!n)throw new En("request ended without sending any chunks");return Ht(this,LB,void 0,"f"),tje(n,Ce(this,$q,"f"),{logger:Ce(this,sX,"f")})},Dzt=function(n){let r=Ce(this,LB,"f");if(n.type==="message_start"){if(r)throw new En(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!r)throw new En(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return r;case"message_delta":return r.stop_reason=n.delta.stop_reason,r.stop_sequence=n.delta.stop_sequence,r.stop_details=n.delta.stop_details,r.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(r.container=n.delta.container),n.usage.input_tokens!=null&&(r.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(r.usage.server_tool_use=n.usage.server_tool_use),n.usage.output_tokens_details!=null&&(r.usage.output_tokens_details=n.usage.output_tokens_details),r;case"content_block_start":return r.content.push({...n.content_block}),r;case"content_block_delta":{let i=r.content.at(n.index);switch(n.delta.type){case"text_delta":{i?.type==="text"&&(r.content[n.index]={...i,text:(i.text||"")+n.delta.text});break}case"citations_delta":{i?.type==="text"&&(r.content[n.index]={...i,citations:[...i.citations??[],n.delta.citation]});break}case"input_json_delta":{if(i&&lje(i)){let s=(i[DB]||"")+n.delta.partial_json;r.content[n.index]=Qye(i,s)}break}case"thinking_delta":{i?.type==="thinking"&&(r.content[n.index]={...i,thinking:i.thinking+n.delta.thinking});break}case"signature_delta":{i?.type==="thinking"&&(r.content[n.index]={...i,signature:n.delta.signature});break}default:n.delta}return r}case"content_block_stop":{let i=r.content.at(n.index);return i&&lje(i)&&DB in i&&Object.defineProperty(i,"input",{value:i.input,enumerable:!0,configurable:!0,writable:!0}),r}}},Symbol.asyncIterator)](){let e=[],n=[],r=!1;return this.on("streamEvent",i=>{let s=n.shift();s?s.resolve(i):e.push(i)}),this.on("end",()=>{r=!0;for(let i of n)i.resolve(void 0);n.length=0}),this.on("abort",i=>{r=!0;for(let s of n)s.reject(i);n.length=0}),this.on("error",i=>{r=!0;for(let s of n)s.reject(i);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((s,o)=>n.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Ry(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var Wq,uje=v(()=>{p();ui();zi();Ui();a8e();yq();ms();Wq=class extends _n{create(e,n){let{user_profile_id:r,workspace_id:i,...s}=e;return this._client.post("/v1/messages/batches",{body:s,...n,headers:pt([{...r!=null?{"anthropic-user-profile-id":r}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(e,n={},r){let{workspace_id:i}=n??{};return this._client.get(wt`/v1/messages/batches/${e}`,{...r,headers:pt([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}list(e={},n){let{workspace_id:r,...i}=e??{};return this._client.getAPIList("/v1/messages/batches",wd,{query:i,...n,headers:pt([{...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(e,n={},r){let{workspace_id:i}=n??{};return this._client.delete(wt`/v1/messages/batches/${e}`,{...r,headers:pt([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}cancel(e,n={},r){let{workspace_id:i}=n??{};return this._client.post(wt`/v1/messages/batches/${e}/cancel`,{...r,headers:pt([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}async results(e,n={},r){let i=await this.retrieve(e,n,r);if(!i.results_url)throw new En(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{workspace_id:s}=n??{};return this._client.get(i.results_url,{...r,headers:pt([{Accept:"application/binary",...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,a)=>Eq.fromResponse(a.response,a.controller))}}});var FB,Mzt,bKr,dje=v(()=>{p();ui();Ui();px();Pzt();rje();uje();uje();l8e();FB=class extends _n{constructor(){super(...arguments),this.batches=new Wq(this._client)}create(e,n){let{user_profile_id:r,workspace_id:i,...s}=e;s.model in Mzt&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${Mzt[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),bKr.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let o=n?.timeout??this._client._options.timeout;if(!s.stream&&o==null){let c=Fye[s.model]??void 0;o=this._client.calculateNonstreamingTimeout(s.max_tokens,c)}let a=KAe(s.tools,s.messages);return this._client.post("/v1/messages",{body:s,timeout:o??6e5,...n,headers:pt([{...r!=null?{"anthropic-user-profile-id":r}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},a,n?.headers]),stream:e.stream??!1})}parse(e,n){return this.create(e,n).then(r=>nje(r,e,{logger:this._client.logger??console}))}stream(e,n){return tEe.createMessage(this,e,n,{logger:this._client.logger??console})}countTokens(e,n){let{user_profile_id:r,workspace_id:i,...s}=e;return this._client.post("/v1/messages/count_tokens",{body:s,...n,headers:pt([{...r!=null?{"anthropic-user-profile-id":r}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}},Mzt={},bKr=["claude-mythos-preview","claude-opus-4-6"];FB.Batches=Wq});var SL,pje=v(()=>{p();ui();zi();Ui();ms();SL=class extends _n{retrieve(e,n={},r){let{betas:i,workspace_id:s}=n??{};return this._client.get(wt`/v1/models/${e}`,{...r,headers:pt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e={},n){let{betas:r,workspace_id:i,...s}=e??{};return this._client.getAPIList("/v1/models",wd,{query:s,...n,headers:pt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}}});var Hq,mje=v(()=>{p();ui();zi();Ui();iv();ms();Hq=class extends _n{create(e,n,r){let{workspace_id:i,...s}=n;return this._client.post(wt`/v1/skills/${e}/versions`,D0({body:s,...r,headers:pt([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])},this._client,!1))}retrieve(e,n,r){let{skill_id:i,workspace_id:s}=n;return this._client.get(wt`/v1/skills/${i}/versions/${e}`,{...r,headers:pt([{...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(e,n={},r){let{workspace_id:i,...s}=n??{};return this._client.getAPIList(wt`/v1/skills/${e}/versions`,ur,{query:s,...r,headers:pt([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}delete(e,n,r){let{skill_id:i,workspace_id:s}=n;return this._client.delete(wt`/v1/skills/${i}/versions/${e}`,{...r,headers:pt([{...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}}});var QB,hje=v(()=>{p();ui();mje();mje();zi();Ui();iv();ms();QB=class extends _n{constructor(){super(...arguments),this.versions=new Hq(this._client)}create(e,n){let{workspace_id:r,...i}=e;return this._client.post("/v1/skills",D0({body:i,...n,headers:pt([{...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])},this._client,!1))}retrieve(e,n={},r){let{workspace_id:i}=n??{};return this._client.get(wt`/v1/skills/${e}`,{...r,headers:pt([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}list(e={},n){let{workspace_id:r,...i}=e??{};return this._client.getAPIList("/v1/skills",ur,{query:i,...n,headers:pt([{...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(e,n={},r){let{workspace_id:i}=n??{};return this._client.delete(wt`/v1/skills/${e}`,{...r,headers:pt([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}};QB.Versions=Hq});var Ozt=v(()=>{p();z9t();X8e();Z8e();eje();dje();pje();hje()});var fje,gje,nEe,Lzt,Fzt,Qzt,jl,aA,Aje=v(()=>{p();Mf();CAe();Of();MH();AB();IAe();TAe();OH();G3e();z3e();uJ();tc();FH();b9t();Q9t();q9t();zi();f4e();Ozt();WAe();Z8e();eje();pje();X8e();dje();hje();IAe();Ui();QH();dx();Of();Fzt="\\n\\nHuman:",Qzt="\\n\\nAssistant:",jl=class{get credentials(){return this._authState.provider}constructor({baseURL:e=qs("ANTHROPIC_BASE_URL"),apiKey:n,authToken:r,webhookKey:i=qs("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(fje.add(this),this._requestAuthFlags=new WeakMap,nEe.set(this,void 0),n===void 0&&(n=s.profile!=null?null:qs("ANTHROPIC_API_KEY")??null),r===void 0&&(r=s.profile!=null?null:qs("ANTHROPIC_AUTH_TOKEN")??null),s.profile!=null&&(s.credentials!=null||s.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let o={apiKey:n,authToken:r,webhookKey:i,...s,baseURL:e||"https://api.anthropic.com"};if(!o.dangerouslyAllowBrowser&&KYt())throw new En(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=o.baseURL,this._baseURLIsExplicit=i.__baseURLIsExplicit??!!e,this.timeout=o.timeout??Y$e.DEFAULT_TIMEOUT,this.logger=o.logger??console,this.logLevel=r9,this.logLevel=Ude(o.logLevel,"ClientOptions.logLevel",Ji(this))??Ude(Di("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",Ji(this))??r9,this.fetchOptions=o.fetchOptions,this.maxRetries=o.maxRetries??2,this.fetch=o.fetch??kMt(),Wt(this,rhe,DMt,"f"),this.middleware=[...o.middleware??[]];let a=Di("ANTHROPIC_CUSTOM_HEADERS");if(a){let u={};for(let l of a.split(` -`)){let d=l.indexOf(":");d>=0&&(u[l.substring(0,d).trim()]=l.substring(d+1).trim())}o.defaultHeaders={...u,...o.defaultHeaders}}let c=i.__auth;if(delete o.__auth,delete o.__baseURLIsExplicit,this._options=o,this.apiKey=typeof n=="string"?n:null,this.authToken=r,this.webhookKey=s,c)this._authState=c,!this._baseURLIsExplicit&&c.baseURL&&(this.baseURL=c.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let u=o.credentials??null;if(u)this._authState.provider=u,this._authState.tokenCache=this._makeTokenCache(u);else if(o.config!=null){let l=FUe(o.config,this._credentialResolverOptions());this._authState.provider=l.provider,this._authState.tokenCache=this._makeTokenCache(l.provider),this._authState.extraHeaders=l.extraHeaders,this._applyCredentialBaseURL(l.baseURL)}else o.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(o.profile):this._shouldResolveDefaultCredentials()&&(this._authState.resolution=this._resolveDefaultCredentials())}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(e){if(!e)return;let n=e.replace(/\/+$/,"");this._authState.baseURL=n,this._baseURLIsExplicit||(this.baseURL=n)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:e=>{Ji(this).debug("credential cache write failed (best-effort)",e)},onSafetyWarning:e=>{Ji(this).warn(e)}}}_credentialsFetch(){return GUe(this.fetch,this.middleware,void 0,this)}_makeTokenCache(e){return new Lde(e,n=>{Ji(this).debug("advisory token refresh failed; serving cached token",n)})}withOptions(e){let n="credentials"in e||"config"in e||"profile"in e,r="apiKey"in e||"authToken"in e||n,s={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...n?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:r?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(s)}async _resolveDefaultCredentials(e){try{let n=await mLt(this._credentialResolverOptions(),e);if(n)this._authState.provider=n.provider,this._authState.tokenCache=this._makeTokenCache(n.provider),this._authState.extraHeaders=n.extraHeaders,this._applyCredentialBaseURL(n.baseURL);else if(e!=null)throw new gn(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(n){this._authState.error=n}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:n}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!n.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let n=this._requestAuthFlags.get(e);return n||(n={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,n)),n}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let n=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,gt([{Authorization:`Bearer ${n}`}])}return gt([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return gt([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return gt([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return WMt(e)}getUserAgent(){return`Anthropic/JS ${dE}`}defaultIdempotencyKey(){return`stainless-node-retry-${s$()}`}makeStatusError(e,n,r,s){return Xc.generate(e,n,r,s)}buildURL(e,n,r){let s=!xe(this,j$e,"m",hQt).call(this)&&r||this.baseURL,i=bMt(e)?new URL(e):new URL(s+(s.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery(),a=Object.fromEntries(i.searchParams);return(!gUe(o)||!gUe(a))&&(n={...a,...o,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(i.search=this.stringifyQuery(n)),i.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new gn("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:n,options:r}){if(this._authState.tokenCache&&this.apiKey==null){let s=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[o,a]of Object.entries(this._authState.extraHeaders))s.has(o)||s.set(o,a);s.get("anthropic-beta")?.split(",").map(o=>o.trim())?.includes(jB)||s.append("anthropic-beta",jB),e.headers=s}}backendMiddleware(){return[]}get(e,n){return this.methodRequest("get",e,n)}post(e,n){return this.methodRequest("post",e,n)}patch(e,n){return this.methodRequest("patch",e,n)}put(e,n){return this.methodRequest("put",e,n)}delete(e,n){return this.methodRequest("delete",e,n)}methodRequest(e,n,r){return this.request(Promise.resolve(r).then(s=>({method:e,path:n,...s})))}request(e,n=null){return new zB(this,this.makeRequest(e,n,void 0))}async makeRequest(e,n,r){let s=await e,i=s.maxRetries??this.maxRetries;n==null&&(n=i,this._requestAuthFlags.delete(s)),await this.prepareOptions(s);let{req:o,url:a,timeout:c}=await this.buildRequest(s,{retryCount:i-n}),u="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),l=r===void 0?"":`, retryOf: ${r}`,d=Date.now();if(s.signal?.aborted)throw new Mp;let h=new AbortController,m=await this.fetchWithTimeout(a,o,c,h,s,{requestLogID:u,retryOfRequestLogID:r}).catch(VB),f=Date.now();if(m instanceof globalThis.Error){oC(h);let y=`retrying, ${n} attempts remaining`;if(s.signal?.aborted)throw new Mp;let b=uE(m)||/timed? ?out/i.test(String(m)+("cause"in m?String(m.cause):"")),S=this.middleware.length>0||!!s.middleware?.length||this.backendMiddleware().length>0;if(S&&!b&&!bLt(m))throw Ji(this).info(`[${u}] middleware error (not retryable)`),Ji(this).debug(`[${u}] middleware error (not retryable)`,lC({retryOfRequestLogID:r,url:a,durationMs:f-d,message:m.message})),m;if(n)return Ji(this).info(`[${u}] connection ${b?"timed out":"failed"} - ${y}`),Ji(this).debug(`[${u}] connection ${b?"timed out":"failed"} (${y})`,lC({retryOfRequestLogID:r,url:a,durationMs:f-d,message:m.message})),this.retryRequest(s,n,r??u);throw Ji(this).info(`[${u}] connection ${b?"timed out":"failed"} - error; no more retries left`),Ji(this).debug(`[${u}] connection ${b?"timed out":"failed"} (error; no more retries left)`,lC({retryOfRequestLogID:r,url:a,durationMs:f-d,message:m.message})),b?new i$:S&&!$Ue(m)?m:new iC({cause:m})}let g=[...m.headers.entries()].filter(([y])=>y==="request-id"||y==="anthropic-workspace-id").map(([y,b])=>", "+y+": "+JSON.stringify(b)).join(""),A=`[${u}${l}${g}] ${o.method} ${a} ${m.ok?"succeeded":"failed"} with status ${m.status} in ${f-d}ms`;if(!m.ok){let y=await this.shouldRetry(m,s);if(n&&y){let w=`retrying, ${n} attempts remaining`;return await NMt(m.body),oC(h),Ji(this).info(`${A} - ${w}`),Ji(this).debug(`[${u}] response error (${w})`,lC({retryOfRequestLogID:r,url:m.url,status:m.status,headers:m.headers,durationMs:f-d})),this.retryRequest(s,n,r??u,m.headers)}let b=y?"error; no more retries left":"error; not retryable";Ji(this).info(`${A} - ${b}`);let S=await m.text().catch(w=>VB(w).message),C=J8(S),I=C?void 0:S;throw Ji(this).debug(`[${u}] response error (${b})`,lC({retryOfRequestLogID:r,url:m.url,status:m.status,headers:m.headers,message:I,durationMs:Date.now()-d})),oC(h),this.makeStatusError(m.status,C,I,m.headers)}return Ji(this).info(A),Ji(this).debug(`[${u}] response start`,lC({retryOfRequestLogID:r,url:m.url,status:m.status,headers:m.headers,durationMs:f-d})),RMt(m.body??m,h),{response:m,options:s,controller:h,requestLogID:u,retryOfRequestLogID:r,startTime:d}}getAPIList(e,n,r){return this.requestAPIList(n,r&&"then"in r?r.then(s=>({method:"get",path:e,...s})):{method:"get",path:e,...r})}requestAPIList(e,n){let r=this.makeRequest(n,null,void 0);return new l9(this,r,e)}async fetchWithTimeout(e,n,r,s,i,o){let{signal:a,method:c,...u}=n||{},l=this._makeAbort(s);a&&(a.addEventListener("abort",l,{once:!0}),vMt(s,a,l));let d=globalThis.ReadableStream&&u.body instanceof globalThis.ReadableStream||typeof u.body=="object"&&u.body!==null&&Symbol.asyncIterator in u.body,h={signal:s.signal,...d?{duplex:"half"}:{},method:"GET",...u};c&&(h.method=c.toUpperCase());let m=this.fetch,f=async(S,C)=>{let I=setTimeout(l,r);try{return await m.call(void 0,S,C)}finally{clearTimeout(I)}},g=i===void 0?f:(async(S,C={})=>{let I=typeof S=="string"?S:S instanceof URL?S.href:S.url;return C.headers=C.headers instanceof Headers?C.headers:new Headers(C.headers),await this.prepareRequest(C,{url:I,options:i}),o&&Ji(this).debug(`[${o.requestLogID}] sending request`,lC({retryOfRequestLogID:o.retryOfRequestLogID,method:C.method,url:I,options:i,headers:C.headers})),f(S,C)}),A=i?.middleware,y=this.backendMiddleware(),b=A?.length||y.length?[...this.middleware,...A??[],...y]:this.middleware;return await GUe(g,b,i,this)(e,h)}async shouldRetry(e,n){let r=this._authFlags(n);if(e.status===401&&this._authState.tokenCache&&r.usedTokenCache&&!r.didRefreshFor401)return r.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let s=e.headers.get("x-should-retry");return s==="true"?!0:s==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,n,r,s){let i,o=s?.get("retry-after-ms");if(o){let c=parseFloat(o);Number.isNaN(c)||(i=c)}let a=s?.get("retry-after");if(a&&!i){let c=parseFloat(a);Number.isNaN(c)?i=Date.parse(a)-Date.now():i=c*1e3}if(i===void 0){let c=e.maxRetries??this.maxRetries;i=this.calculateDefaultRetryTimeoutMillis(n,c)}return await g_(i),this.makeRequest(e,n-1,r)}calculateDefaultRetryTimeoutMillis(e,n){let i=n-e,o=Math.min(.5*Math.pow(2,i),8),a=1-Math.random()*.25;return o*a*1e3}calculateNonstreamingTimeout(e,n){if(36e5*e/128e3>6e5||n!=null&&e>n)throw new gn("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:n=0}={}){let r={...e},{method:s,path:i,query:o,defaultBaseURL:a}=r;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let c=this.buildURL(i,o,a);"timeout"in r&&SMt("timeout",r.timeout),r.timeout=r.timeout??this.timeout;let{bodyHeaders:u,body:l}=this.buildBody({options:r}),d=await this.buildHeaders({options:e,method:s,bodyHeaders:u,retryCount:n});return{req:{method:s,headers:d,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:"half"},...l&&{body:l},...this.fetchOptions??{},...r.fetchOptions??{}},url:c,timeout:r.timeout}}async buildHeaders({options:e,method:n,bodyHeaders:r,retryCount:s}){let i={};this.idempotencyHeader&&n!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);let o=gt([i,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(s),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...Z8(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,r,e.headers]);return this.validateHeaders(o),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:n}}){if(!e)return{bodyHeaders:void 0,body:void 0};let r=gt([n]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:Rde(e)}:typeof e=="object"&&r.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:xe(this,rhe,"f").call(this,{body:e,headers:r})}};Y$e=el,rhe=new WeakMap,j$e=new WeakSet,hQt=function(){return this.baseURL!=="https://api.anthropic.com"};el.Anthropic=Y$e;el.HUMAN_PROMPT=mQt;el.AI_PROMPT=fQt;el.DEFAULT_TIMEOUT=6e5;el.AnthropicError=gn;el.APIError=Xc;el.APIConnectionError=iC;el.APIConnectionTimeoutError=i$;el.APIUserAbortError=Mp;el.NotFoundError=l$;el.ConflictError=u$;el.RateLimitError=p$;el.BadRequestError=o$;el.AuthenticationError=a$;el.InternalServerError=h$;el.PermissionDeniedError=c$;el.UnprocessableEntityError=d$;el.toFile=jde;$f=class extends el{constructor(){super(...arguments),this.completions=new yP(this),this.messages=new ZR(this),this.models=new _P(this),this.files=new EP(this),this.skills=new ek(this),this.beta=new Zc(this)}};$f.Completions=yP;$f.Messages=ZR;$f.Models=_P;$f.Files=EP;$f.Skills=ek;$f.Beta=Zc});var RVi,gQt=V(()=>{p();Ra();i9();DR();Ys();E_();bm();EUe();RVi=new TextEncoder});var m2e=V(()=>{p();K$e();jUe();qde();gQt();K$e();$s();Ra()});function xG(t,e,n=cwr){let r=new Map;for(let c of t.tools??[])r.set(n(c.name),c);if(!e)return{immediate:[...r.values()],deferred:new Map};let s=new Set,i=new Set;for(let c of t.messages)if(c.role==="assistant")for(let u of c.content)u.type==="toolCall"&&i.add(n(u.name));else if(c.role==="toolResult")for(let u of c.addedToolNames??[]){let l=n(u);i.has(l)||s.add(l)}let o=[],a=new Map;for(let[c,u]of r)s.has(c)?a.set(c,u):o.push(u);return{immediate:o,deferred:a}}var cwr,she=V(()=>{p();cwr=t=>t});function lwr(){return typeof process>"u"||!(process.versions?.node||process.versions?.bun)?null:process.getBuiltinModule?.("node:os")??null}function xh(){return ihe?`pi (${ihe.platform()} ${ihe.release()}; ${ihe.arch()})`:"pi (browser)"}var ihe,qx=V(()=>{p();ihe=lwr()});function uwr(t){return!(t instanceof Error)||!("status"in t)||!("headers"in t)?!1:(t.status===void 0||typeof t.status=="number")&&(t.headers===void 0||t.headers instanceof Headers)}function dwr(t){let e=t.headers?.get("x-should-retry");return e==="true"?!0:e==="false"?!1:t.status===void 0?!0:t.status===408||t.status===409||t.status===429||typeof t.status=="number"&&t.status>=500}function AQt(t,e,n){let r=e??6e4;if(r>0&&t>r)throw new Error(`Server requested ${Math.ceil(t/1e3)}s retry delay (max: ${Math.ceil(r/1e3)}s). ${n}`);return t}function pwr(t,e,n){let r=t.headers?.get("retry-after-ms");if(r){let o=Number.parseFloat(r);if(!Number.isNaN(o))return AQt(o,n,t.message)}let s=t.headers?.get("retry-after");if(s){let o=Number.parseFloat(s),a=Number.isNaN(o)?Date.parse(s)-Date.now():o*1e3;return AQt(a,n,t.message)}return Math.min(.5*2**e,8)*1e3*(1-Math.random()*.25)}function z$e(){let t=new Error("Request aborted");return t.name="AbortError",t}function hwr(t,e){return new Promise((n,r)=>{if(e?.aborted){r(z$e());return}let s=()=>{clearTimeout(i),r(z$e())},i=setTimeout(()=>{e?.removeEventListener("abort",s),n()},Math.max(0,t));e?.addEventListener("abort",s,{once:!0})})}async function yE(t,e={}){let n=e.maxRetries??0,r=n;for(;;)try{return await t()}catch(s){if(e.signal?.aborted)throw z$e();if(r<=0||!uwr(s)||!dwr(s))throw s;let i=n-r;r--,await hwr(pwr(s,i,e.maxRetryDelayMs),e.signal)}}var SP=V(()=>{p()});function mwr(t){let e=t[t.length-1];return e&&e.role!=="user"?"agent":"user"}function wG(t){return t.some(e=>e.role==="user"&&Array.isArray(e.content)?e.content.some(n=>n.type==="image"):e.role==="toolResult"&&Array.isArray(e.content)?e.content.some(n=>n.type==="image"):!1)}function TG(t){let e={"X-Initiator":mwr(t.messages),"Openai-Intent":"conversation-edits"};return t.hasImages&&(e["Copilot-Vision-Request"]="true"),e}var ohe=V(()=>{p()});var SQt={};Ir(SQt,{stream:()=>che,streamSimple:()=>Pwr});function EQt(t,e){return t||(Ps("PI_CACHE_RETENTION",e)==="long"?"long":"short")}function fwr(t,e,n){let r=EQt(e,n);if(r==="none")return{retention:r};let s=r==="long"&&uhe(t).supportsLongCacheRetention?"1h":void 0;return{retention:r,cacheControl:{type:"ephemeral",...s&&{ttl:s}}}}function bwr(t){if(!t.some(s=>s.type==="image"))return ts(t.map(s=>s.text).join(` -`));let n=t.map(s=>s.type==="text"?{type:"text",text:ts(s.text)}:{type:"image",source:{type:"base64",media_type:s.mimeType,data:s.data}});return n.some(s=>s.type==="text")||n.unshift({type:"text",text:"(see attached image)"}),n}function wwr(t){return(t.compat?.allowedFallbackModels?.length??0)>0}function uhe(t){return{supportsEagerToolInputStreaming:t.compat?.supportsEagerToolInputStreaming??!0,supportsLongCacheRetention:t.compat?.supportsLongCacheRetention??!0,sendSessionAffinityHeaders:t.compat?.sendSessionAffinityHeaders??!1,supportsCacheControlOnTools:t.compat?.supportsCacheControlOnTools??!0,supportsTemperature:t.compat?.supportsTemperature??!0,allowEmptySignature:t.compat?.allowEmptySignature??!1,supportsStrictTools:t.compat?.supportsStrictTools??!1,supportsToolReferences:t.compat?.supportsToolReferences??Twr(t)}}function Twr(t){if(t.provider!=="anthropic"||t.id.includes("haiku"))return!1;let e=t.id.match(/^claude-(?:opus|sonnet|fable)-(\d+)(?:-(\d+))?(?:-|$)/);if(!e)return!1;let n=Number(e[1]),r=e[2]&&e[2].length<8?Number(e[2]):0;return n>4||n===4&&r>=5}function vwr(...t){let e={};for(let n of t)n&&Object.assign(e,n);return e}function J$e(...t){return vwr({"User-Agent":xh()},...t)}function X$e(t,e){if(!t)return!1;let n=e.toLowerCase();for(let[r,s]of Object.entries(t))if(r.toLowerCase()===n&&s!==null&&s.trim().length>0)return!0;return!1}function bQt(t,e,n){if(!e&&!(X$e(n,"authorization")||X$e(n,"x-api-key")||X$e(n,"cf-aig-authorization")))throw new Error(`No API key for provider: ${t}`)}function _Qt(t){if(!t.event&&t.data.length===0)return null;let e={event:t.event,data:t.data.join(` -`),raw:[...t.raw]};return t.event=null,t.data=[],t.raw=[],e}function Z$e(t,e){if(t==="")return _Qt(e);if(e.raw.push(t),t.startsWith(":"))return null;let n=t.indexOf(":"),r=n===-1?t:t.slice(0,n),s=n===-1?"":t.slice(n+1);return s.startsWith(" ")&&(s=s.slice(1)),r==="event"?e.event=s:r==="data"&&e.data.push(s),null}function kwr(t){let e=t.indexOf("\r"),n=t.indexOf(` -`);return e===-1?n:n===-1?e:Math.min(e,n)}function ahe(t){let e=kwr(t);if(e===-1)return null;let n=e+1;return t[e]==="\r"&&t[n]===` -`&&(n+=1),{line:t.slice(0,e),rest:t.slice(n)}}async function*Nwr(t,e){let n=t.getReader(),r=new TextDecoder,s={event:null,data:[],raw:[]},i="";try{for(;;){if(e?.aborted)throw new Error("Request was aborted");let{value:c,done:u}=await n.read();if(u)break;i+=r.decode(c,{stream:!0});let l=ahe(i);for(;l;){i=l.rest;let d=Z$e(l.line,s);d&&(yield d),l=ahe(i)}}i+=r.decode();let o=ahe(i);for(;o;){i=o.rest;let c=Z$e(o.line,s);c&&(yield c),o=ahe(i)}if(i.length>0){let c=Z$e(i,s);c&&(yield c)}let a=_Qt(s);a&&(yield a)}finally{n.releaseLock()}}async function*Dwr(t,e){if(!t.body)throw new Error("Attempted to iterate over an Anthropic response with no body");let n=!1,r=!1;for await(let s of Nwr(t.body,e)){if(s.event==="error")throw new Error(s.data);if(Rwr.has(s.event??""))try{let i=gde(s.data);i.type==="message_start"?n=!0:i.type==="message_stop"&&(r=!0),yield i}catch(i){let o=i instanceof Error?i.message:String(i);throw new Error(`Could not parse Anthropic SSE event ${s.event}: ${o}; data=${s.data}; raw=${s.raw.join("\\n")}`)}}if(n&&!r)throw new Error("Anthropic stream ended before message_stop")}function Bwr(t,e){let n=e?t.thinkingLevelMap?.[e]:void 0;if(typeof n=="string")return n;switch(e){case"minimal":case"low":return"low";case"medium":return"medium";case"high":return"high";default:return"high"}}function Owr(t){return t.includes("sk-ant-oat")}function Mwr(t,e,n,r,s,i){if(t.provider==="github-copilot")return{client:new $f({apiKey:null,authToken:e??null,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:J$e({accept:"application/json","anthropic-dangerous-direct-browser-access":"true"},t.headers,s,n)}),isOAuthToken:!1};if(e&&Owr(e))return{client:new $f({apiKey:null,authToken:e,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:J$e({accept:"application/json","anthropic-dangerous-direct-browser-access":"true","user-agent":`claude-cli/${gwr}`,"x-app":"cli"},t.headers,n)}),isOAuthToken:!0};let o=i&&uhe(t).sendSessionAffinityHeaders?{"x-session-affinity":i}:{},a=J$e({accept:"application/json","anthropic-dangerous-direct-browser-access":"true"},o,t.headers,n);return{client:new $f({apiKey:e??null,authToken:null,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:a}),isOAuthToken:!1}}function Lwr(t,e,n,r){let s;for(let o of[t.headers,r?.headers])for(let[a,c]of Object.entries(o??{}))a.toLowerCase()==="anthropic-beta"&&(s=c);if(s===null)return[];if(s!==void 0)return[...new Set(s.split(",").map(o=>o.trim()).filter(o=>o.length>0))];let i=[];return n&&i.push("claude-code-20250219","oauth-2025-04-20"),qwr(t,e)&&i.push(_wr),t.reasoning&&r?.thinkingEnabled===!0&&(r.interleavedThinking??!0)&&t.compat?.forceAdaptiveThinking!==!0&&i.push(Swr),wwr(t)&&i.push(Cwr),t.compat?.supportsMidConvoEffort===!0&&i.push(Iwr,xwr),[...new Set(i)]}function Fwr(t,e,n,r){let{cacheControl:s}=fwr(t,r?.cacheRetention,r?.env),i=uhe(t),o=lE(e.messages,t,Qwr),a=n?lhe:y=>y,c=xG({...e,messages:o},i.supportsToolReferences,a),u=c.immediate,l=[...c.deferred.values()];u.length===0&&l.length>0&&(u=l,l=[]);let d=new Set(l.map(y=>a(y.name))),h=$wr(o,n,s,i.allowEmptySignature,d,a,t.compat?.supportsMidConvoEffort===!0?t.provider:void 0),m=r?.effort??"high",f=Lwr(t,e,n,r),g={model:t.id,messages:t.compat?.supportsMidConvoEffort===!0?Wwr(h,m):h.messages,max_tokens:r?.maxTokens??t.maxTokens,stream:!0,...f.length>0?{betas:f}:{}};if(n?(g.system=[{type:"text",text:"You are Claude Code, Anthropic's official CLI for Claude.",...s?{cache_control:s}:{}}],e.systemPrompt&&g.system.push({type:"text",text:ts(e.systemPrompt),...s?{cache_control:s}:{}})):e.systemPrompt&&(g.system=[{type:"text",text:ts(e.systemPrompt),...s?{cache_control:s}:{}}]),r?.temperature!==void 0&&!r?.thinkingEnabled&&t.compat?.supportsMidConvoEffort!==!0&&i.supportsTemperature&&(g.temperature=r.temperature),(u.length>0||l.length>0)&&(g.tools=[...yQt(u,n,i.supportsEagerToolInputStreaming,i.supportsStrictTools,i.supportsCacheControlOnTools?s:void 0),...yQt(l,n,i.supportsEagerToolInputStreaming,i.supportsStrictTools,void 0,!0)]),t.compat?.supportsMidConvoEffort===!0)g.thinking={type:"adaptive",display:r?.thinkingDisplay??"summarized",block_binding:{prefix_mismatch_behavior:"drop_block"}},g.output_config={effort:"high"};else if(t.reasoning)if(r?.thinkingEnabled){let y=r.thinkingDisplay??"summarized";t.compat?.forceAdaptiveThinking===!0?(g.thinking={type:"adaptive",display:y},r.effort&&(g.output_config={effort:r.effort})):g.thinking={type:"enabled",budget_tokens:r.thinkingBudgetTokens||1024,display:y}}else r?.thinkingEnabled===!1&&t.thinkingLevelMap?.off!==null&&(g.thinking={type:"disabled"});if(r?.metadata){let y=r.metadata.user_id;typeof y=="string"&&(g.metadata={user_id:y})}r?.toolChoice&&(typeof r.toolChoice=="string"?g.tool_choice={type:r.toolChoice}:g.tool_choice=r.toolChoice);let A=t.compat?.allowedFallbackModels;return A&&A.length>0&&(g.fallbacks=A.map(y=>({model:y.model}))),g}function Qwr(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,64)}function Uwr(t,e,n,r,s){let i=[];for(let a of t.addedToolNames??[]){let c=s(a);!n.has(c)||r.has(c)||(r.add(c),i.push({type:"tool_reference",tool_name:e?lhe(a):a}))}let o=bwr(t.content);return{toolResult:{type:"tool_result",tool_use_id:t.toolCallId,content:i.length>0?i:o,is_error:t.isError},siblingContent:i.length===0?[]:typeof o=="string"?[{type:"text",text:o}]:o}}function $wr(t,e,n,r=!1,s=new Set,i=a=>a,o){let a=[],c=new Map,u=new Set;for(let l=0;l0&&a.push({role:"user",content:ts(d.content)});else{let m=d.content.map(f=>f.type==="text"?{type:"text",text:ts(f.text)}:{type:"image",source:{type:"base64",media_type:f.mimeType,data:f.data}}).filter(f=>f.type==="text"?f.text.trim().length>0:!0);if(m.length===0)continue;a.push({role:"user",content:m})}else if(d.role==="assistant"){let h=[];for(let f of d.content)if(f.type==="text"){if(f.text.trim().length===0)continue;h.push({type:"text",text:ts(f.text)})}else if(f.type==="thinking"){if(f.redacted){h.push({type:"redacted_thinking",data:f.thinkingSignature});continue}let g=f.thinkingSignature,A=!!g&&g.trim().length>0;if(f.thinking.trim().length===0&&!A)continue;A?h.push({type:"thinking",thinking:ts(f.thinking),signature:g}):h.push(r?{type:"thinking",thinking:ts(f.thinking),signature:""}:{type:"text",text:ts(f.thinking)})}else f.type==="toolCall"&&h.push({type:"tool_use",id:f.id,name:e?lhe(f.name):f.name,input:f.arguments??{}});if(h.length===0)continue;let m=a.length;a.push({role:"assistant",content:h}),o!==void 0&&d.api==="anthropic-messages"&&d.provider===o&&Gwr(d.providerThinkingLevel)&&c.set(m,d.providerThinkingLevel)}else if(d.role==="toolResult"){let h=[],m=[],f=l;for(;f0){let l=a[a.length-1];if(l.role==="user")if(Array.isArray(l.content)){let d=l.content[l.content.length-1];d&&(d.type==="text"||d.type==="image"||d.type==="tool_result")&&(d.cache_control=n)}else typeof l.content=="string"&&(l.content=[{type:"text",text:l.content,cache_control:n}])}return{messages:a,assistantLevels:c}}function Gwr(t){return t==="low"||t==="medium"||t==="high"||t==="xhigh"||t==="max"}function Wwr(t,e){let n=[];for(let r=0;r{let c=oA(o,r),u=aE(o,c),l=u,d={type:"object",properties:l.properties??{},required:l.required??[]},h=c===!0?{...u,...d}:d;return{name:e?lhe(o.name):o.name,description:o.description,...n?{eager_input_streaming:!0}:{},...c===!0?{strict:!0}:{},input_schema:h,...i?{defer_loading:!0}:{},...s&&a===t.length-1?{cache_control:s}:{}}}):[]}function Hwr(t,e){switch(t){case"end_turn":return{stopReason:"stop"};case"max_tokens":return{stopReason:"length"};case"tool_use":return{stopReason:"toolUse"};case"refusal":return{stopReason:"error",errorMessage:e?.explanation||"The model refused to complete the request"};case"pause_turn":return{stopReason:"stop"};case"stop_sequence":return{stopReason:"stop"};case"sensitive":return{stopReason:"error",errorMessage:"Provider stopped with: sensitive"};default:throw new Error(`Unhandled stop reason: ${t}`)}}var gwr,Awr,ywr,lhe,Ewr,_wr,Swr,Cwr,Iwr,xwr,Rwr,che,Pwr,CQt=V(()=>{p();m2e();is();she();qB();Pf();oE();Px();qx();tC();SP();nC();rC();ohe();sC();HB();gwr="2.1.251",Awr=["Read","Write","Edit","Bash","Grep","Glob","AskUserQuestion","EnterPlanMode","ExitPlanMode","KillShell","NotebookEdit","Skill","Task","TaskOutput","TodoWrite","WebFetch","WebSearch"],ywr=new Map(Awr.map(t=>[t.toLowerCase(),t])),lhe=t=>ywr.get(t.toLowerCase())??t,Ewr=(t,e)=>{if(e&&e.length>0){let n=t.toLowerCase(),r=e.find(s=>s.name.toLowerCase()===n);if(r)return r.name}return t};_wr="fine-grained-tool-streaming-2025-05-14",Swr="interleaved-thinking-2025-05-14",Cwr="server-side-fallback-2026-07-01",Iwr="mid-conversation-output-config-2026-07-01",xwr="thinking-binding-controls-2026-08-01";Rwr=new Set(["message_start","message_delta","message_stop","content_block_start","content_block_delta","content_block_stop"]);che=(t,e,n)=>{let r=new Ka;return(async()=>{let s=t.compat?.supportsMidConvoEffort?n?.effort??"high":void 0,i={role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,...s===void 0?{}:{providerThinkingLevel:s},usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let o,a,c=t,u;if(n?.client)o=n.client,a=!1;else{let g=n?.apiKey;bQt(t.provider,g,n?.headers);let A;if(t.provider==="github-copilot"){let C=wG(e.messages);A=TG({messages:e.messages,hasImages:C})}let b=EQt(n?.cacheRetention,n?.env)==="none"?void 0:n?.sessionId,S=Mwr(t,g,n?.headers,n?.fetch,A,b);o=S.client,a=S.isOAuthToken}let l=Fwr(t,e,a,n),d=await n?.onPayload?.(l,t);d!==void 0&&(l={...d,stream:!0});let h={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},m=await yE(()=>o.beta.messages.create(l,h).asResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});await n?.onResponse?.({status:m.status,headers:Pp(m.headers)},t),r.push({type:"start",partial:i});let f=i.content;for await(let g of Dwr(m,n?.signal))if(g.type==="message_start"){i.responseId=g.message.id;let A=g.message.input_transformations;Array.isArray(A)&&(u=A),i.model=g.message.model;let y=i.model===t.id?void 0:t.compat?.allowedFallbackModels?.find(b=>b.provider===t.provider&&b.model===i.model)?.cost;c=y?{...t,id:i.model,cost:y}:t,i.usage.input=g.message.usage.input_tokens||0,i.usage.output=g.message.usage.output_tokens||0,i.usage.cacheRead=g.message.usage.cache_read_input_tokens||0,i.usage.cacheWrite=g.message.usage.cache_creation_input_tokens||0,i.usage.cacheWrite1h=g.message.usage.cache_creation?.ephemeral_1h_input_tokens||0,i.usage.totalTokens=i.usage.input+i.usage.output+i.usage.cacheRead+i.usage.cacheWrite,Sh(c,i.usage)}else if(g.type==="content_block_start"){if(g.content_block.type==="fallback"){if(i.content.length>0)throw new Error("Anthropic performed an unsupported mid-output model fallback");continue}if(g.content_block.type==="text"){let A={type:"text",text:g.content_block.text??"",index:g.index};i.content.push(A),r.push({type:"text_start",contentIndex:i.content.length-1,partial:i})}else if(g.content_block.type==="thinking"){let A={type:"thinking",thinking:g.content_block.thinking??"",thinkingSignature:g.content_block.signature??"",index:g.index};i.content.push(A),r.push({type:"thinking_start",contentIndex:i.content.length-1,partial:i})}else if(g.content_block.type==="redacted_thinking"){let A={type:"thinking",thinking:"[Reasoning redacted]",thinkingSignature:g.content_block.data,redacted:!0,index:g.index};i.content.push(A),r.push({type:"thinking_start",contentIndex:i.content.length-1,partial:i})}else if(g.content_block.type==="tool_use"){let A={type:"toolCall",id:g.content_block.id,name:a?Ewr(g.content_block.name,e.tools):g.content_block.name,arguments:g.content_block.input??{},partialJson:"",index:g.index};i.content.push(A),r.push({type:"toolcall_start",contentIndex:i.content.length-1,partial:i})}}else if(g.type==="content_block_delta"){if(g.delta.type==="text_delta"){let A=f.findIndex(b=>b.index===g.index),y=f[A];y&&y.type==="text"&&(y.text+=g.delta.text,r.push({type:"text_delta",contentIndex:A,delta:g.delta.text,partial:i}))}else if(g.delta.type==="thinking_delta"){let A=f.findIndex(b=>b.index===g.index),y=f[A];y&&y.type==="thinking"&&(y.thinking+=g.delta.thinking,r.push({type:"thinking_delta",contentIndex:A,delta:g.delta.thinking,partial:i}))}else if(g.delta.type==="input_json_delta"){let A=f.findIndex(b=>b.index===g.index),y=f[A];y&&y.type==="toolCall"&&(y.partialJson+=g.delta.partial_json,y.arguments=va(y.partialJson),r.push({type:"toolcall_delta",contentIndex:A,delta:g.delta.partial_json,partial:i}))}else if(g.delta.type==="signature_delta"){let A=f.findIndex(b=>b.index===g.index),y=f[A];y&&y.type==="thinking"&&(y.thinkingSignature=y.thinkingSignature||"",y.thinkingSignature+=g.delta.signature)}}else if(g.type==="content_block_stop"){let A=f.findIndex(b=>b.index===g.index),y=f[A];y&&(delete y.index,y.type==="text"?r.push({type:"text_end",contentIndex:A,content:y.text,partial:i}):y.type==="thinking"?r.push({type:"thinking_end",contentIndex:A,content:y.thinking,partial:i}):y.type==="toolCall"&&(y.arguments=va(y.partialJson),delete y.partialJson,r.push({type:"toolcall_end",contentIndex:A,toolCall:y,partial:i})))}else if(g.type==="message_delta"){let A=g.input_transformations;if(Array.isArray(A)&&(u=A),g.delta.stop_reason){i.rawStopReason=g.delta.stop_reason;let y=Hwr(g.delta.stop_reason,g.delta.stop_details);i.stopReason=y.stopReason,y.errorMessage&&(i.errorMessage=y.errorMessage)}if(g.usage){g.usage.input_tokens!=null&&(i.usage.input=g.usage.input_tokens),g.usage.output_tokens!=null&&(i.usage.output=g.usage.output_tokens),g.usage.cache_read_input_tokens!=null&&(i.usage.cacheRead=g.usage.cache_read_input_tokens),g.usage.cache_creation_input_tokens!=null&&(i.usage.cacheWrite=g.usage.cache_creation_input_tokens);let y=g.usage.output_tokens_details?.thinking_tokens;y!=null&&(i.usage.reasoning=y)}i.usage.totalTokens=i.usage.input+i.usage.output+i.usage.cacheRead+i.usage.cacheWrite,Sh(c,i.usage)}if(n?.signal?.aborted)throw new Error("Request was aborted");if(i.stopReason==="pending")throw new Error("Anthropic stream ended without a stop reason");if(i.stopReason==="aborted"||i.stopReason==="error")throw new Error(i.errorMessage||"An unknown error occurred");u&&u.length>0&&ZS(i,{type:"anthropic_input_transformations",timestamp:Date.now(),details:{transformations:u.map(g=>({type:g.type??void 0,path:g.path??void 0,reason:g.reason??void 0}))}}),r.push({type:"done",reason:i.stopReason,message:i}),r.end()}catch(o){for(let a of i.content)delete a.index,delete a.partialJson;i.stopReason=n?.signal?.aborted?"aborted":"error",i.errorMessage=o instanceof Error?o.message:JSON.stringify(o),r.push({type:"error",reason:i.stopReason,error:i}),r.end()}})(),r};Pwr=(t,e,n)=>{bQt(t.provider,n?.apiKey,n?.headers);let r={...Yd(t,e,n,n?.apiKey),toolChoice:n?.toolChoice};if(!n?.reasoning)return che(t,e,{...r,thinkingEnabled:!1});if(t.compat?.forceAdaptiveThinking===!0){let o=Bwr(t,n.reasoning);return che(t,e,{...r,thinkingEnabled:!0,effort:o})}let s=Sde(r.maxTokens,t.maxTokens,n.reasoning,n.thinkingBudgets),i=Y8(t,e,s.maxTokens);return che(t,e,{...r,maxTokens:i,thinkingEnabled:!0,thinkingBudgetTokens:Math.min(s.thinkingBudget,Math.max(0,i-1024))})}});function Gr(t,e,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n}function Ft(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}var EE=V(()=>{p()});var eGe,tGe=V(()=>{p();eGe=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return eGe=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),n=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))}});function Y9(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var K9,dhe=V(()=>{p();K9=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)}});var Wn,Dl,Mu,tk,nk,vG,RG,kG,NG,DG,BG,PG,OG,MG,LG,pC,CP,z9,bE=V(()=>{p();dhe();Wn=class extends Error{},Dl=class t extends Wn{constructor(e,n,r,s){super(`${t.makeMessage(e,n,r)}`),this.status=e,this.headers=s,this.requestID=s?.get("x-request-id"),this.error=n;let i=n;this.code=i?.code,this.param=i?.param,this.type=i?.type}static makeMessage(e,n,r){let s=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return e&&s?`${e} ${s}`:e?`${e} status code (no body)`:s||"(no status code or body)"}static generate(e,n,r,s){if(!e||!s)return new tk({message:r,cause:K9(n)});let i=n?.error;return e===400?new vG(e,i,r,s):e===401?new RG(e,i,r,s):e===403?new kG(e,i,r,s):e===404?new NG(e,i,r,s):e===409?new DG(e,i,r,s):e===422?new BG(e,i,r,s):e===429?new PG(e,i,r,s):e>=500?new OG(e,i,r,s):new t(e,i,r,s)}},Mu=class extends Dl{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},tk=class extends Dl{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}},nk=class extends tk{constructor({message:e}={}){super({message:e??"Request timed out."})}},vG=class extends Dl{},RG=class extends Dl{},kG=class extends Dl{},NG=class extends Dl{},DG=class extends Dl{},BG=class extends Dl{},PG=class extends Dl{},OG=class extends Dl{},MG=class extends Wn{constructor(){super("Could not parse response content as the length limit was reached")}},LG=class extends Wn{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},pC=class extends Error{constructor(e){super(e)}},CP=class extends Dl{constructor(e,n,r){let s="OAuth2 authentication error",i;if(n&&typeof n=="object"){let o=n;i=o.error;let a=o.error_description;a&&typeof a=="string"?s=a:i&&(s=i)}super(e,n,s,r),this.error_code=i}},z9=class extends Wn{constructor(e,n,r){super(e),this.provider=n,this.cause=r}}});function phe(t){return typeof t!="object"?{}:t??{}}function rGe(t){if(!t)return!0;for(let e in t)return!1;return!0}function xQt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function FG(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var jwr,IQt,wh,nGe,wQt,TQt,Hx=V(()=>{p();bE();jwr=/^[a-z][a-z0-9+.-]*:/i,IQt=t=>jwr.test(t),wh=t=>(wh=Array.isArray,wh(t)),nGe=wh;wQt=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Wn(`${t} must be an integer`);if(e<0)throw new Wn(`${t} must be a positive integer`);return e},TQt=t=>{try{return JSON.parse(t)}catch{return}}});var hC,QG=V(()=>{p();hC=t=>new Promise(e=>setTimeout(e,t))});var rk,sGe=V(()=>{p();rk="6.40.0"});function Ywr(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function zwr(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:n}of t){let r=n.exec(navigator.userAgent);if(r){let s=r[1]||0,i=r[2]||0,o=r[3]||0;return{browser:e,version:`${s}.${i}.${o}`}}}return null}var NQt,Kwr,vQt,RQt,kQt,DQt,iGe=V(()=>{p();sGe();NQt=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";Kwr=()=>{let t=Ywr();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rk,"X-Stainless-OS":RQt(Deno.build.os),"X-Stainless-Arch":vQt(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rk,"X-Stainless-OS":RQt(globalThis.process.platform??"unknown"),"X-Stainless-Arch":vQt(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=zwr();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};vQt=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",RQt=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),DQt=()=>kQt??(kQt=Kwr())});function hhe(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function oGe(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function mhe(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return oGe({start(){},async pull(n){let{done:r,value:s}=await e.next();r?n.close():n.enqueue(s)},async cancel(){await e.return?.()}})}function aGe(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){let n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function cGe(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),n=e.cancel();e.releaseLock(),await n}var UG=V(()=>{p()});var PQt,OQt=V(()=>{p();PQt=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)})});var lGe,uGe,dGe,MQt,pGe=V(()=>{p();lGe="RFC3986",uGe=t=>String(t),dGe={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:uGe},MQt="RFC1738"});function FQt(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function mGe(t,e){if(wh(t)){let n=[];for(let r=0;r{p();pGe();Hx();fhe=(t,e)=>(fhe=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),fhe(t,e)),mC=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),hGe=1024,LQt=(t,e,n,r,s)=>{if(t.length===0)return t;let i=t;if(typeof t=="symbol"?i=Symbol.prototype.toString.call(t):typeof t!="string"&&(i=String(t)),n==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let o="";for(let a=0;a=hGe?i.slice(a,a+hGe):i,u=[];for(let l=0;l=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||s===MQt&&(d===40||d===41)){u[u.length]=c.charAt(l);continue}if(d<128){u[u.length]=mC[d];continue}if(d<2048){u[u.length]=mC[192|d>>6]+mC[128|d&63];continue}if(d<55296||d>=57344){u[u.length]=mC[224|d>>12]+mC[128|d>>6&63]+mC[128|d&63];continue}l+=1,d=65536+((d&1023)<<10|c.charCodeAt(l)&1023),u[u.length]=mC[240|d>>18]+mC[128|d>>12&63]+mC[128|d>>6&63]+mC[128|d&63]}o+=u.join("")}return o}});function Xwr(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function WQt(t,e,n,r,s,i,o,a,c,u,l,d,h,m,f,g,A,y){let b=t,S=y,C=0,I=!1;for(;(S=S.get(fGe))!==void 0&&!I;){let P=S.get(t);if(C+=1,typeof P<"u"){if(P===C)throw new RangeError("Cyclic object value");I=!0}typeof S.get(fGe)>"u"&&(C=0)}if(typeof u=="function"?b=u(e,b):b instanceof Date?b=h?.(b):n==="comma"&&wh(b)&&(b=mGe(b,function(P){return P instanceof Date?h?.(P):P})),b===null){if(i)return c&&!g?c(e,dd.encoder,A,"key",m):e;b=""}if(Xwr(b)||FQt(b)){if(c){let P=g?e:c(e,dd.encoder,A,"key",m);return[f?.(P)+"="+f?.(c(b,dd.encoder,A,"value",m))]}return[f?.(e)+"="+f?.(String(b))]}let x=[];if(typeof b>"u")return x;let w;if(n==="comma"&&wh(b))g&&c&&(b=mGe(b,c)),w=[{value:b.length>0?b.join(",")||null:void 0}];else if(wh(u))w=u;else{let P=Object.keys(b);w=l?P.sort(l):P}let R=a?String(e).replace(/\./g,"%2E"):String(e),N=r&&wh(b)&&b.length===1?R+"[]":R;if(s&&wh(b)&&b.length===0)return N+"[]";for(let P=0;P"u"?t.encodeDotInKeys?!0:dd.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:dd.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:dd.allowEmptyArrays,arrayFormat:i,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:dd.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?dd.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:dd.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:dd.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:dd.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:dd.encodeValuesOnly,filter:s,format:n,formatter:r,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:dd.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:dd.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:dd.strictNullHandling}}function qQt(t,e={}){let n=t,r=Zwr(e),s,i;typeof r.filter=="function"?(i=r.filter,n=i("",n)):wh(r.filter)&&(i=r.filter,s=i);let o=[];if(typeof n!="object"||n===null)return"";let a=$Qt[r.arrayFormat],c=a==="comma"&&r.commaRoundTrip;s||(s=Object.keys(n)),r.sort&&s.sort(r.sort);let u=new WeakMap;for(let h=0;h0?d+l:""}var $Qt,GQt,UQt,dd,fGe,HQt=V(()=>{p();QQt();pGe();Hx();$Qt={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},GQt=function(t,e){Array.prototype.push.apply(t,wh(e)?e:[e])},dd={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:LQt,encodeValuesOnly:!1,format:lGe,formatter:uGe,indices:!1,serializeDate(t){return(UQt??(UQt=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};fGe={}});function VQt(t){return qQt(t,{arrayFormat:"brackets"})}var gGe=V(()=>{p();HQt()});function KQt(t){let e=0;for(let s of t)e+=s.length;let n=new Uint8Array(e),r=0;for(let s of t)n.set(s,r),r+=s.length;return n}function $G(t){let e;return(jQt??(e=new globalThis.TextEncoder,jQt=e.encode.bind(e)))(t)}function AGe(t){let e;return(YQt??(e=new globalThis.TextDecoder,YQt=e.decode.bind(e)))(t)}var jQt,YQt,ghe=V(()=>{p()});function tTr(t,e){for(let s=e??0;s{p();EE();ghe();IP=class{constructor(){hA.set(this,void 0),mA.set(this,void 0),Gr(this,hA,new Uint8Array,"f"),Gr(this,mA,null,"f")}decode(e){if(e==null)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?$G(e):e;Gr(this,hA,KQt([Ft(this,hA,"f"),n]),"f");let r=[],s;for(;(s=tTr(Ft(this,hA,"f"),Ft(this,mA,"f")))!=null;){if(s.carriage&&Ft(this,mA,"f")==null){Gr(this,mA,s.index,"f");continue}if(Ft(this,mA,"f")!=null&&(s.index!==Ft(this,mA,"f")+1||s.carriage)){r.push(AGe(Ft(this,hA,"f").subarray(0,Ft(this,mA,"f")-1))),Gr(this,hA,Ft(this,hA,"f").subarray(Ft(this,mA,"f")),"f"),Gr(this,mA,null,"f");continue}let i=Ft(this,mA,"f")!==null?s.preceding-1:s.preceding,o=AGe(Ft(this,hA,"f").subarray(0,i));r.push(o),Gr(this,hA,Ft(this,hA,"f").subarray(s.index),"f"),Gr(this,mA,null,"f")}return r}flush(){return Ft(this,hA,"f").length?this.decode(` -`):[]}};hA=new WeakMap,mA=new WeakMap;IP.NEWLINE_CHARS=new Set([` -`,"\r"]);IP.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function J9(){}function Ahe(t,e,n){return!e||yhe[t]>yhe[n]?J9:e[t].bind(e)}function du(t){let e=t.logger,n=t.logLevel??"off";if(!e)return nTr;let r=XQt.get(e);if(r&&r[0]===n)return r[1];let s={error:Ahe("error",e,n),warn:Ahe("warn",e,n),info:Ahe("info",e,n),debug:Ahe("debug",e,n)};return XQt.set(e,[n,s]),s}var yhe,yGe,nTr,XQt,Vx,X9=V(()=>{p();Hx();yhe={off:0,error:200,warn:300,info:400,debug:500},yGe=(t,e,n)=>{if(t){if(xQt(yhe,t))return t;du(n).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(yhe))}`)}};nTr={error:J9,warn:J9,info:J9,debug:J9},XQt=new WeakMap;Vx=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,n])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t)});async function*rTr(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Wn("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Wn("Attempted to iterate over a response with no body");let n=new EGe,r=new IP,s=aGe(t.body);for await(let i of sTr(s))for(let o of r.decode(i)){let a=n.decode(o);a&&(yield a)}for(let i of r.flush()){let o=n.decode(i);o&&(yield o)}}async function*sTr(t){let e=new Uint8Array;for await(let n of t){if(n==null)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?$G(n):n,s=new Uint8Array(e.length+r.length);s.set(e),s.set(r,e.length),e=s;let i;for(;(i=zQt(e))!==-1;)yield e.slice(0,i),e=e.slice(i)}e.length>0&&(yield e)}function iTr(t,e){let n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}var Z9,fC,EGe,bGe=V(()=>{p();EE();bE();UG();JQt();UG();dhe();ghe();X9();bE();fC=class t{constructor(e,n,r){this.iterator=e,Z9.set(this,void 0),this.controller=n,Gr(this,Z9,r,"f")}static fromSSEResponse(e,n,r,s){let i=!1,o=r?du(r):console;async function*a(){if(i)throw new Wn("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let c=!1;try{for await(let u of rTr(e,n))if(!c){if(u.data.startsWith("[DONE]")){c=!0;continue}if(u.event===null||!u.event.startsWith("thread.")){let l;try{l=JSON.parse(u.data)}catch(d){throw o.error("Could not parse message into JSON:",u.data),o.error("From chunk:",u.raw),d}if(l&&l.error)throw new Dl(void 0,l.error,void 0,e.headers);yield s?{event:u.event,data:l}:l}else{let l;try{l=JSON.parse(u.data)}catch(d){throw console.error("Could not parse message into JSON:",u.data),console.error("From chunk:",u.raw),d}if(u.event=="error")throw new Dl(void 0,l.error,l.message,void 0);yield{event:u.event,data:l}}}c=!0}catch(u){if(Y9(u))return;throw u}finally{c||n.abort()}}return new t(a,n,r)}static fromReadableStream(e,n,r){let s=!1;async function*i(){let a=new IP,c=aGe(e);for await(let u of c)for(let l of a.decode(u))yield l;for(let u of a.flush())yield u}async function*o(){if(s)throw new Wn("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let a=!1;try{for await(let c of i())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(Y9(c))return;throw c}finally{a||n.abort()}}return new t(o,n,r)}[(Z9=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],n=[],r=this.iterator(),s=i=>({next:()=>{if(i.length===0){let o=r.next();e.push(o),n.push(o)}return i.shift()}});return[new t(()=>s(e),this.controller,Ft(this,Z9,"f")),new t(()=>s(n),this.controller,Ft(this,Z9,"f"))]}toReadableStream(){let e=this,n;return oGe({async start(){n=e[Symbol.asyncIterator]()},async pull(r){try{let{value:s,done:i}=await n.next();if(i)return r.close();let o=$G(JSON.stringify(s)+` -`);r.enqueue(o)}catch(s){r.error(s)}},async cancel(){await n.return?.()}})}};EGe=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let i={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],i}if(this.chunks.push(e),e.startsWith(":"))return null;let[n,r,s]=iTr(e,":");return s.startsWith(" ")&&(s=s.substring(1)),n==="event"?this.event=s:n==="data"&&this.data.push(s),null}}});async function Ehe(t,e){let{response:n,requestLogID:r,retryOfRequestLogID:s,startTime:i}=e,o=await(async()=>{if(e.options.stream)return du(t).debug("response",n.status,n.url,n.headers,n.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(n,e.controller,t,e.options.__synthesizeEventData):fC.fromSSEResponse(n,e.controller,t,e.options.__synthesizeEventData);if(n.status===204)return null;if(e.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let h=await n.json();return _Ge(h,n)}return await n.text()})();return du(t).debug(`[${r}] response parsed`,Vx({retryOfRequestLogID:s,url:n.url,status:n.status,body:o,durationMs:Date.now()-i})),o}function _Ge(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("x-request-id"),enumerable:!1})}var SGe=V(()=>{p();bGe();X9()});var eK,xP,bhe=V(()=>{p();EE();SGe();xP=class t extends Promise{constructor(e,n,r=Ehe){super(s=>{s(null)}),this.responsePromise=n,this.parseResponse=r,eK.set(this,void 0),Gr(this,eK,e,"f")}_thenUnwrap(e){return new t(Ft(this,eK,"f"),this.responsePromise,async(n,r)=>_Ge(e(await this.parseResponse(n,r),r),r.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:n,request_id:n.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(Ft(this,eK,"f"),e))),this.parsedPromise}then(e,n){return this.parse().then(e,n)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};eK=new WeakMap});var _he,GG,tK,Th,Gs,mo,Lu,Es=V(()=>{p();EE();bE();SGe();bhe();Hx();GG=class{constructor(e,n,r,s){_he.set(this,void 0),Gr(this,_he,e,"f"),this.options=s,this.response=n,this.body=r}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new Wn("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await Ft(this,_he,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(_he=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let n of e.getPaginatedItems())yield n}},tK=class extends xP{constructor(e,n,r){super(e,n,async(s,i)=>new r(s,i.response,await Ehe(s,i),i.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let n of e)yield n}},Th=class extends GG{constructor(e,n,r,s){super(e,n,r,s),this.data=r.data||[],this.object=r.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}},Gs=class extends GG{constructor(e,n,r,s){super(e,n,r,s),this.data=r.data||[],this.has_more=r.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let e=this.getPaginatedItems(),n=e[e.length-1]?.id;return n?{...this.options,query:{...phe(this.options.query),after:n}}:null}},mo=class extends GG{constructor(e,n,r,s){super(e,n,r,s),this.data=r.data||[],this.has_more=r.has_more||!1,this.last_id=r.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let e=this.last_id;return e?{...this.options,query:{...phe(this.options.query),after:e}}:null}},Lu=class extends GG{constructor(e,n,r,s){super(e,n,r,s),this.data=r.data||[],this.has_more=r.has_more||!1,this.next=r.next||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let e=this.next;return e?{...this.options,query:{...phe(this.options.query),after:e}}:null}}});var aTr,cTr,She,ZQt=V(()=>{p();UG();bE();aTr={jwt:"urn:ietf:params:oauth:token-type:jwt",id:"urn:ietf:params:oauth:token-type:id_token"},cTr="urn:ietf:params:oauth:grant-type:token-exchange",She=class{constructor(e,n){this.cachedToken=null,this.refreshPromise=null,this.tokenExchangeUrl="https://auth.openai.com/oauth/token",this.config=e,this.fetch=n??hhe()}async getToken(){if(!this.cachedToken||this.isTokenExpired(this.cachedToken)){if(this.refreshPromise)return await this.refreshPromise;this.refreshPromise=this.refreshToken();try{return await this.refreshPromise}finally{this.refreshPromise=null}}return this.needsRefresh(this.cachedToken)&&!this.refreshPromise&&(this.refreshPromise=this.refreshToken().finally(()=>{this.refreshPromise=null})),this.cachedToken.token}async refreshToken(){let e=await this.config.provider.getToken(),n={grant_type:cTr,subject_token:e,subject_token_type:aTr[this.config.provider.tokenType],identity_provider_id:this.config.identityProviderId,service_account_id:this.config.serviceAccountId};this.config.clientId&&(n.client_id=this.config.clientId);let r=await this.fetch(this.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok){let a=await r.text(),c;try{c=JSON.parse(a)}catch{}throw r.status===400||r.status===401||r.status===403?new CP(r.status,c,r.headers):Dl.generate(r.status,c,`Token exchange failed with status ${r.status}`,r.headers)}let s=await r.json(),i=s.expires_in||3600,o=Date.now()+i*1e3;return this.cachedToken={token:s.access_token,expiresAt:o},s.access_token}isTokenExpired(e){return Date.now()>=e.expiresAt}needsRefresh(e){let r=(this.config.refreshBufferSeconds??1200)*1e3;return Date.now()>=e.expiresAt-r}invalidateToken(){this.cachedToken=null,this.refreshPromise=null}}});function WG(t,e,n){return xGe(),new File(t,e??"unknown_file",n)}function nK(t){return(typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"").split(/[\\/]/).pop()||void 0}function lTr(t){let e=typeof t=="function"?t:t.fetch,n=eUt.get(e);if(n)return n;let r=(async()=>{try{let s="Response"in e?e.Response:(await e("data:,")).constructor,i=new FormData;return i.toString()!==await new s(i).text()}catch{return!0}})();return eUt.set(e,r),r}var xGe,Che,sk,vh,eUt,tUt,nUt,uTr,CGe,IGe,_E=V(()=>{p();UG();xGe=()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};Che=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function",sk=async(t,e)=>CGe(t.body)?{...t,body:await tUt(t.body,e)}:t,vh=async(t,e)=>({...t,body:await tUt(t.body,e)}),eUt=new WeakMap;tUt=async(t,e)=>{if(!await lTr(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([r,s])=>IGe(n,r,s))),n},nUt=t=>t instanceof Blob&&"name"in t,uTr=t=>typeof t=="object"&&t!==null&&(t instanceof Response||Che(t)||nUt(t)),CGe=t=>{if(uTr(t))return!0;if(Array.isArray(t))return t.some(CGe);if(t&&typeof t=="object"){for(let e in t)if(CGe(t[e]))return!0}return!1},IGe=async(t,e,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")t.append(e,String(n));else if(n instanceof Response)t.append(e,WG([await n.blob()],nK(n)));else if(Che(n))t.append(e,WG([await new Response(mhe(n)).blob()],nK(n)));else if(nUt(n))t.append(e,n,nK(n));else if(Array.isArray(n))await Promise.all(n.map(r=>IGe(t,e+"[]",r)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([r,s])=>IGe(t,`${e}[${r}]`,s)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}});async function Ihe(t,e,n){if(xGe(),t=await t,dTr(t))return t instanceof File?t:WG([await t.arrayBuffer()],t.name);if(pTr(t)){let s=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),WG(await wGe(s),e,n)}let r=await wGe(t);if(e||(e=nK(t)),!n?.type){let s=r.find(i=>typeof i=="object"&&"type"in i&&i.type);typeof s=="string"&&(n={...n,type:s})}return WG(r,e,n)}async function wGe(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(rUt(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(Che(t))for await(let n of t)e.push(...await wGe(n));else{let n=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${n?`; constructor: ${n}`:""}${hTr(t)}`)}return e}function hTr(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(n=>`"${n}"`).join(", ")}]`}var rUt,dTr,pTr,sUt=V(()=>{p();_E();_E();rUt=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",dTr=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&rUt(t),pTr=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function"});var TGe=V(()=>{p();sUt()});var kt,Rn=V(()=>{p();kt=class{constructor(e){this._client=e}}});function oUt(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var iUt,fTr,at,vr=V(()=>{p();bE();iUt=Object.freeze(Object.create(null)),fTr=(t=oUt)=>function(n,...r){if(n.length===1)return n[0];let s=!1,i=[],o=n.reduce((l,d,h)=>{/[?#]/.test(d)&&(s=!0);let m=r[h],f=(s?encodeURIComponent:t)(""+m);return h!==r.length&&(m==null||typeof m=="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??iUt)??iUt)?.toString)&&(f=m+"",i.push({start:l.length+d.length,length:f.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`})),l+d+(h===r.length?"":f)},""),a=o.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=c.exec(a))!==null;)i.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(i.sort((l,d)=>l.start-d.start),i.length>0){let l=0,d=i.reduce((h,m)=>{let f=" ".repeat(m.start-l),g="^".repeat(m.length);return l=m.start+m.length,h+f+g},"");throw new Wn(`Path parameters result in path with invalid segments: -${i.map(h=>h.error).join(` +`);this.baseURL=o.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!e,this.timeout=o.timeout??gje.DEFAULT_TIMEOUT,this.logger=o.logger??console,this.logLevel=fJ,this.logLevel=QAe(o.logLevel,"ClientOptions.logLevel",lo(this))??QAe(qs("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",lo(this))??fJ,this.fetchOptions=o.fetchOptions,this.maxRetries=o.maxRetries??2,this.fetch=o.fetch??e9t(),Ht(this,nEe,n9t,"f"),this.middleware=[...o.middleware??[]];let a=qs("ANTHROPIC_CUSTOM_HEADERS");if(a){let u={};for(let l of a.split(` +`)){let d=l.indexOf(":");d>=0&&(u[l.substring(0,d).trim()]=l.substring(d+1).trim())}o.defaultHeaders={...u,...o.defaultHeaders}}let c=s.__auth;if(delete o.__auth,delete o.__baseURLIsExplicit,this._options=o,this.apiKey=typeof n=="string"?n:null,this.authToken=r,this.webhookKey=i,c)this._authState=c,!this._baseURLIsExplicit&&c.baseURL&&(this.baseURL=c.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let u=o.credentials??null;if(u)this._authState.provider=u,this._authState.tokenCache=this._makeTokenCache(u);else if(o.config!=null){let l=o4e(o.config,this._credentialResolverOptions());this._authState.provider=l.provider,this._authState.tokenCache=this._makeTokenCache(l.provider),this._authState.extraHeaders=l.extraHeaders,this._applyCredentialBaseURL(l.baseURL)}else o.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(o.profile):this._shouldResolveDefaultCredentials()&&(this._authState.resolution=this._resolveDefaultCredentials())}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(e){if(!e)return;let n=e.replace(/\/+$/,"");this._authState.baseURL=n,this._baseURLIsExplicit||(this.baseURL=n)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:e=>{lo(this).debug("credential cache write failed (best-effort)",e)},onSafetyWarning:e=>{lo(this).warn(e)}}}_credentialsFetch(){return u4e(this.fetch,this.middleware,void 0,this)}_makeTokenCache(e){return new OAe(e,n=>{lo(this).debug("advisory token refresh failed; serving cached token",n)})}withOptions(e){let n="credentials"in e||"config"in e||"profile"in e,r="apiKey"in e||"authToken"in e||n,i={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...n?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:r?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(i)}async _resolveDefaultCredentials(e){try{let n=await F9t(this._credentialResolverOptions(),e);if(n)this._authState.provider=n.provider,this._authState.tokenCache=this._makeTokenCache(n.provider),this._authState.extraHeaders=n.extraHeaders,this._applyCredentialBaseURL(n.baseURL);else if(e!=null)throw new En(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(n){this._authState.error=n}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:n}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!n.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let n=this._requestAuthFlags.get(e);return n||(n={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,n)),n}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let n=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,pt([{Authorization:`Bearer ${n}`}])}return pt([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return pt([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return pt([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return m9t(e)}getUserAgent(){return`Anthropic/JS ${N0}`}defaultIdempotencyKey(){return`stainless-node-retry-${IH()}`}makeStatusError(e,n,r,i){return Hl.generate(e,n,r,i)}buildURL(e,n,r){let i=!Ce(this,fje,"m",Lzt).call(this)&&r||this.baseURL,s=HYt(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery(),a=Object.fromEntries(s.searchParams);return(!F3e(o)||!F3e(a))&&(n={...a,...o,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(s.search=this.stringifyQuery(n)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new En("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:n,options:r}){if(this._authState.tokenCache&&this.apiKey==null){let i=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[o,a]of Object.entries(this._authState.extraHeaders))i.has(o)||i.set(o,a);i.get("anthropic-beta")?.split(",").map(o=>o.trim())?.includes(YO)||i.append("anthropic-beta",YO),e.headers=i}}backendMiddleware(){return[]}get(e,n){return this.methodRequest("get",e,n)}post(e,n){return this.methodRequest("post",e,n)}patch(e,n){return this.methodRequest("patch",e,n)}put(e,n){return this.methodRequest("put",e,n)}delete(e,n){return this.methodRequest("delete",e,n)}methodRequest(e,n,r){return this.request(Promise.resolve(r).then(i=>({method:e,path:n,...i})))}request(e,n=null){return new JO(this,this.makeRequest(e,n,void 0))}async makeRequest(e,n,r){let i=await e,s=i.maxRetries??this.maxRetries;n==null&&(n=s,this._requestAuthFlags.delete(i)),await this.prepareOptions(i);let{req:o,url:a,timeout:c}=await this.buildRequest(i,{retryCount:s-n}),u="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),l=r===void 0?"":`, retryOf: ${r}`,d=Date.now();if(i.signal?.aborted)throw new Mm;let m=new AbortController,h=await this.fetchWithTimeout(a,o,c,m,i,{requestLogID:u,retryOfRequestLogID:r}).catch(VO),f=Date.now();if(h instanceof globalThis.Error){sI(m);let y=`retrying, ${n} attempts remaining`;if(i.signal?.aborted)throw new Mm;let E=B0(h)||/timed? ?out/i.test(String(h)+("cause"in h?String(h.cause):"")),_=this.middleware.length>0||!!i.middleware?.length||this.backendMiddleware().length>0;if(_&&!E&&!H9t(h))throw lo(this).info(`[${u}] middleware error (not retryable)`),lo(this).debug(`[${u}] middleware error (not retryable)`,cI({retryOfRequestLogID:r,url:a,durationMs:f-d,message:h.message})),h;if(n)return lo(this).info(`[${u}] connection ${E?"timed out":"failed"} - ${y}`),lo(this).debug(`[${u}] connection ${E?"timed out":"failed"} (${y})`,cI({retryOfRequestLogID:r,url:a,durationMs:f-d,message:h.message})),this.retryRequest(i,n,r??u);throw lo(this).info(`[${u}] connection ${E?"timed out":"failed"} - error; no more retries left`),lo(this).debug(`[${u}] connection ${E?"timed out":"failed"} (error; no more retries left)`,cI({retryOfRequestLogID:r,url:a,durationMs:f-d,message:h.message})),E?new wH:_&&!l4e(h)?h:new iI({cause:h})}let g=[...h.headers.entries()].filter(([y])=>y==="request-id"||y==="anthropic-workspace-id").map(([y,E])=>", "+y+": "+JSON.stringify(E)).join(""),A=`[${u}${l}${g}] ${o.method} ${a} ${h.ok?"succeeded":"failed"} with status ${h.status} in ${f-d}ms`;if(!h.ok){let y=await this.shouldRetry(h,i);if(n&&y){let w=`retrying, ${n} attempts remaining`;return await t9t(h.body),sI(m),lo(this).info(`${A} - ${w}`),lo(this).debug(`[${u}] response error (${w})`,cI({retryOfRequestLogID:r,url:h.url,status:h.status,headers:h.headers,durationMs:f-d})),this.retryRequest(i,n,r??u,h.headers)}let E=y?"error; no more retries left":"error; not retryable";lo(this).info(`${A} - ${E}`);let _=await h.text().catch(w=>VO(w).message),S=lJ(_),C=S?void 0:_;throw lo(this).debug(`[${u}] response error (${E})`,cI({retryOfRequestLogID:r,url:h.url,status:h.status,headers:h.headers,message:C,durationMs:Date.now()-d})),sI(m),this.makeStatusError(h.status,S,C,h.headers)}return lo(this).info(A),lo(this).debug(`[${u}] response start`,cI({retryOfRequestLogID:r,url:h.url,status:h.status,headers:h.headers,durationMs:f-d})),ZYt(h.body??h,m),{response:h,options:i,controller:m,requestLogID:u,retryOfRequestLogID:r,startTime:d}}getAPIList(e,n,r){return this.requestAPIList(n,r&&"then"in r?r.then(i=>({method:"get",path:e,...i})):{method:"get",path:e,...r})}requestAPIList(e,n){let r=this.makeRequest(n,null,void 0);return new _J(this,r,e)}async fetchWithTimeout(e,n,r,i,s,o){let{signal:a,method:c,...u}=n||{},l=this._makeAbort(i);a&&(a.addEventListener("abort",l,{once:!0}),XYt(i,a,l));let d=globalThis.ReadableStream&&u.body instanceof globalThis.ReadableStream||typeof u.body=="object"&&u.body!==null&&Symbol.asyncIterator in u.body,m={signal:i.signal,...d?{duplex:"half"}:{},method:"GET",...u};c&&(m.method=c.toUpperCase());let h=this.fetch,f=async(_,S)=>{let C=setTimeout(l,r);try{return await h.call(void 0,_,S)}finally{clearTimeout(C)}},g=s===void 0?f:(async(_,S={})=>{let C=typeof _=="string"?_:_ instanceof URL?_.href:_.url;return S.headers=S.headers instanceof Headers?S.headers:new Headers(S.headers),await this.prepareRequest(S,{url:C,options:s}),o&&lo(this).debug(`[${o.requestLogID}] sending request`,cI({retryOfRequestLogID:o.retryOfRequestLogID,method:S.method,url:C,options:s,headers:S.headers})),f(_,S)}),A=s?.middleware,y=this.backendMiddleware(),E=A?.length||y.length?[...this.middleware,...A??[],...y]:this.middleware;return await u4e(g,E,s,this)(e,m)}async shouldRetry(e,n){let r=this._authFlags(n);if(e.status===401&&this._authState.tokenCache&&r.usedTokenCache&&!r.didRefreshFor401)return r.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let i=e.headers.get("x-should-retry");return i==="true"?!0:i==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,n,r,i){let s,o=i?.get("retry-after-ms");if(o){let c=parseFloat(o);Number.isNaN(c)||(s=c)}let a=i?.get("retry-after");if(a&&!s){let c=parseFloat(a);Number.isNaN(c)?s=Date.parse(a)-Date.now():s=c*1e3}if(s===void 0){let c=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(n,c)}return await lx(s),this.makeRequest(e,n-1,r)}calculateDefaultRetryTimeoutMillis(e,n){let s=n-e,o=Math.min(.5*Math.pow(2,s),8),a=1-Math.random()*.25;return o*a*1e3}calculateNonstreamingTimeout(e,n){if(36e5*e/128e3>6e5||n!=null&&e>n)throw new En("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:n=0}={}){let r={...e},{method:i,path:s,query:o,defaultBaseURL:a}=r;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let c=this.buildURL(s,o,a);"timeout"in r&&jYt("timeout",r.timeout),r.timeout=r.timeout??this.timeout;let{bodyHeaders:u,body:l}=this.buildBody({options:r}),d=await this.buildHeaders({options:e,method:i,bodyHeaders:u,retryCount:n});return{req:{method:i,headers:d,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:"half"},...l&&{body:l},...this.fetchOptions??{},...r.fetchOptions??{}},url:c,timeout:r.timeout}}async buildHeaders({options:e,method:n,bodyHeaders:r,retryCount:i}){let s={};this.idempotencyHeader&&n!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let o=pt([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...dJ(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,r,e.headers]);return this.validateHeaders(o),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:n}}){if(!e)return{bodyHeaders:void 0,body:void 0};let r=pt([n]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:vAe(e)}:typeof e=="object"&&r.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:Ce(this,nEe,"f").call(this,{body:e,headers:r})}};gje=jl,nEe=new WeakMap,fje=new WeakSet,Lzt=function(){return this.baseURL!=="https://api.anthropic.com"};jl.Anthropic=gje;jl.HUMAN_PROMPT=Fzt;jl.AI_PROMPT=Qzt;jl.DEFAULT_TIMEOUT=6e5;jl.AnthropicError=En;jl.APIError=Hl;jl.APIConnectionError=iI;jl.APIConnectionTimeoutError=wH;jl.APIUserAbortError=Mm;jl.NotFoundError=kH;jl.ConflictError=BH;jl.RateLimitError=DH;jl.BadRequestError=TH;jl.AuthenticationError=vH;jl.InternalServerError=PH;jl.PermissionDeniedError=RH;jl.UnprocessableEntityError=NH;jl.toFile=jAe;aA=class extends jl{constructor(){super(...arguments),this.completions=new bL(this),this.messages=new FB(this),this.models=new SL(this),this.files=new _L(this),this.skills=new QB(this),this.beta=new ql(this)}};aA.Completions=bL;aA.Messages=FB;aA.Models=SL;aA.Files=_L;aA.Skills=QB;aA.Beta=ql});var RIo,Uzt=v(()=>{p();tc();AJ();AB();Ui();px();Of();G3e();RIo=new TextEncoder});var O4e=v(()=>{p();Aje();f4e();WAe();Uzt();Aje();zi();tc()});function CKr(){return typeof process>"u"||!(process.versions?.node||process.versions?.bun)?null:process.getBuiltinModule?.("node:os")??null}function Bh(){return rEe?`pi (${rEe.platform()} ${rEe.release()}; ${rEe.arch()})`:"pi (browser)"}var rEe,dv=v(()=>{p();rEe=CKr()});function IKr(t){return!(t instanceof Error)||!("status"in t)||!("headers"in t)?!1:(t.status===void 0||typeof t.status=="number")&&(t.headers===void 0||t.headers instanceof Headers)}function wKr(t){let e=t.headers?.get("x-should-retry");return e==="true"?!0:e==="false"?!1:t.status===void 0?!0:t.status===408||t.status===409||t.status===429||typeof t.status=="number"&&t.status>=500}function Gzt(t,e,n){let r=e??6e4;if(r>0&&t>r)throw new Error(`Server requested ${Math.ceil(t/1e3)}s retry delay (max: ${Math.ceil(r/1e3)}s). ${n}`);return t}function TKr(t,e,n){let r=t.headers?.get("retry-after-ms");if(r){let o=Number.parseFloat(r);if(!Number.isNaN(o))return Gzt(o,n,t.message)}let i=t.headers?.get("retry-after");if(i){let o=Number.parseFloat(i),a=Number.isNaN(o)?Date.parse(i)-Date.now():o*1e3;return Gzt(a,n,t.message)}return Math.min(.5*2**e,8)*1e3*(1-Math.random()*.25)}function yje(){let t=new Error("Request aborted");return t.name="AbortError",t}function vKr(t,e){return new Promise((n,r)=>{if(e?.aborted){r(yje());return}let i=()=>{clearTimeout(s),r(yje())},s=setTimeout(()=>{e?.removeEventListener("abort",i),n()},Math.max(0,t));e?.addEventListener("abort",i,{once:!0})})}async function Q0(t,e={}){let n=e.maxRetries??0,r=n;for(;;)try{return await t()}catch(i){if(e.signal?.aborted)throw yje();if(r<=0||!IKr(i)||!wKr(i))throw i;let s=n-r;r--,await vKr(TKr(i,s,e.maxRetryDelayMs),e.signal)}}var CL=v(()=>{p()});function RKr(t){let e=t[t.length-1];return e&&e.role!=="user"?"agent":"user"}function qq(t){return t.some(e=>e.role==="user"&&Array.isArray(e.content)?e.content.some(n=>n.type==="image"):e.role==="toolResult"&&Array.isArray(e.content)?e.content.some(n=>n.type==="image"):!1)}function jq(t){let e={"X-Initiator":RKr(t.messages),"Openai-Intent":"conversation-edits"};return t.hasImages&&(e["Copilot-Vision-Request"]="true"),e}var iEe=v(()=>{p()});var qzt={};br(qzt,{stream:()=>aEe,streamSimple:()=>KKr});function $zt(t,e){return t||(vi("PI_CACHE_RETENTION",e)==="long"?"long":"short")}function kKr(t,e,n){let r=$zt(e,n);if(r==="none")return{retention:r};let i=r==="long"&&oX(t).supportsLongCacheRetention?"1h":void 0;return{retention:r,cacheControl:{type:"ephemeral",...i&&{ttl:i}}}}function MKr(t){if(!t.some(i=>i.type==="image"))return ri(t.map(i=>i.text).join(` +`));let n=t.map(i=>i.type==="text"?{type:"text",text:ri(i.text)}:{type:"image",source:{type:"base64",media_type:i.mimeType,data:i.data}});return n.some(i=>i.type==="text")||n.unshift({type:"text",text:"(see attached image)"}),n}function WKr(t){return(t.compat?.allowedFallbackModels?.length??0)>0}function oX(t){let e=t.provider==="openrouter"||t.baseUrl.includes("openrouter.ai");return{supportsEagerToolInputStreaming:t.compat?.supportsEagerToolInputStreaming??!0,supportsLongCacheRetention:t.compat?.supportsLongCacheRetention??!0,sendSessionAffinityHeaders:t.compat?.sendSessionAffinityHeaders??e,sessionAffinityFormat:t.compat?.sessionAffinityFormat??(e?"openrouter":void 0),supportsCacheControlOnTools:t.compat?.supportsCacheControlOnTools??!0,supportsTemperature:t.compat?.supportsTemperature??!0,allowEmptySignature:t.compat?.allowEmptySignature??!1,supportsStrictTools:t.compat?.supportsStrictTools??!1,supportsMidConvoSystemMessages:t.compat?.supportsMidConvoSystemMessages??!1,supportsMidConvoToolChanges:t.compat?.supportsMidConvoToolChanges??!1}}function HKr(...t){let e={};for(let n of t)n&&Object.assign(e,n);return e}function Eje(...t){return HKr({"User-Agent":Bh()},...t)}function bje(t,e){if(!t)return!1;let n=e.toLowerCase();for(let[r,i]of Object.entries(t))if(r.toLowerCase()===n&&i!==null&&i.trim().length>0)return!0;return!1}function Wzt(t,e,n){if(!e&&!(bje(n,"authorization")||bje(n,"x-api-key")||bje(n,"cf-aig-authorization")))throw new Error(`No API key for provider: ${t}`)}function Hzt(t){if(!t.event&&t.data.length===0)return null;let e={event:t.event,data:t.data.join(` +`),raw:[...t.raw]};return t.event=null,t.data=[],t.raw=[],e}function _je(t,e){if(t==="")return Hzt(e);if(e.raw.push(t),t.startsWith(":"))return null;let n=t.indexOf(":"),r=n===-1?t:t.slice(0,n),i=n===-1?"":t.slice(n+1);return i.startsWith(" ")&&(i=i.slice(1)),r==="event"?e.event=i:r==="data"&&e.data.push(i),null}function jKr(t){let e=t.indexOf("\r"),n=t.indexOf(` +`);return e===-1?n:n===-1?e:Math.min(e,n)}function sEe(t){let e=jKr(t);if(e===-1)return null;let n=e+1;return t[e]==="\r"&&t[n]===` +`&&(n+=1),{line:t.slice(0,e),rest:t.slice(n)}}async function*VKr(t,e){let n=t.getReader(),r=new TextDecoder,i={event:null,data:[],raw:[]},s="";try{for(;;){if(e?.aborted)throw new Error("Request was aborted");let{value:c,done:u}=await n.read();if(u)break;s+=r.decode(c,{stream:!0});let l=sEe(s);for(;l;){s=l.rest;let d=_je(l.line,i);d&&(yield d),l=sEe(s)}}s+=r.decode();let o=sEe(s);for(;o;){s=o.rest;let c=_je(o.line,i);c&&(yield c),o=sEe(s)}if(s.length>0){let c=_je(s,i);c&&(yield c)}let a=Hzt(i);a&&(yield a)}finally{n.releaseLock()}}async function*YKr(t,e){if(!t.body)throw new Error("Attempted to iterate over an Anthropic response with no body");let n=!1,r=!1;for await(let i of VKr(t.body,e)){if(i.event==="error")throw new Error(i.data);if(qKr.has(i.event??""))try{let s=fAe(i.data);s.type==="message_start"?n=!0:s.type==="message_stop"&&(r=!0),yield s}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`Could not parse Anthropic SSE event ${i.event}: ${o}; data=${i.data}; raw=${i.raw.join("\\n")}`)}}if(n&&!r)throw new Error("Anthropic stream ended before message_stop")}function zKr(t,e){let n=e?t.thinkingLevelMap?.[e]:void 0;if(typeof n=="string")return n;switch(e){case"minimal":case"low":return"low";case"medium":return"medium";case"high":return"high";default:return"high"}}function JKr(t){return t.includes("sk-ant-oat")}function XKr(t,e,n,r,i,s){if(t.provider==="github-copilot")return{client:new aA({apiKey:null,authToken:e??null,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:Eje({accept:"application/json","anthropic-dangerous-direct-browser-access":"true"},t.headers,i,n)}),isOAuthToken:!1};if(e&&JKr(e))return{client:new aA({apiKey:null,authToken:e,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:Eje({accept:"application/json","anthropic-dangerous-direct-browser-access":"true","user-agent":`claude-cli/${BKr}`,"x-app":"cli"},t.headers,n)}),isOAuthToken:!0};let o=oX(t),a={};if(s&&o.sendSessionAffinityHeaders){let l=o.sessionAffinityFormat==="openrouter"?"x-session-id":"x-session-affinity";a[l]=s}let c=Eje({accept:"application/json","anthropic-dangerous-direct-browser-access":"true"},a,t.headers,n);return{client:new aA({apiKey:e??null,authToken:null,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:c}),isOAuthToken:!1}}function ZKr(t,e,n,r,i){let s;for(let a of[t.headers,i?.headers])for(let[c,u]of Object.entries(a??{}))c.toLowerCase()==="anthropic-beta"&&(s=u);if(s===null)return[];if(s!==void 0)return[...new Set(s.split(",").map(a=>a.trim()).filter(a=>a.length>0))];let o=[];return n&&o.push("claude-code-20250219","oauth-2025-04-20"),oJr(t,e)&&o.push(OKr),t.reasoning&&i?.thinkingEnabled===!0&&(i.interleavedThinking??!0)&&t.compat?.forceAdaptiveThinking!==!0&&o.push(LKr),WKr(t)&&o.push(FKr),t.compat?.supportsMidConvoEffort===!0&&o.push(QKr,UKr),r&&o.push(GKr),[...new Set(o)]}function eJr(t,e,n,r){let{cacheControl:i}=kKr(t,r?.cacheRetention,r?.env),s=oX(t),o=Iy(e.messages),a=o?kc(o):"",c=k0(e.messages,t,tJr),u=o?c.slice(1):c,l=o?.toolsAdded??[],d=s.supportsMidConvoSystemMessages&&s.supportsMidConvoToolChanges&&l.length>0&&!y3e(e.messages),m=rJr(u,n,i,s.allowEmptySignature,t.compat?.supportsMidConvoEffort===!0?t.provider:void 0,d),h=r?.effort??"high",f=ZKr(t,e,n,d,r),g={model:t.id,messages:t.compat?.supportsMidConvoEffort===!0?sJr(m,h):m.messages,max_tokens:r?.maxTokens??t.maxTokens,stream:!0,...f.length>0?{betas:f}:{}};n?(g.system=[{type:"text",text:"You are Claude Code, Anthropic's official CLI for Claude.",...i?{cache_control:i}:{}}],a&&g.system.push({type:"text",text:ri(a),...i?{cache_control:i}:{}})):a&&(g.system=[{type:"text",text:ri(a),...i?{cache_control:i}:{}}]),r?.temperature!==void 0&&!r?.thinkingEnabled&&t.compat?.supportsMidConvoEffort!==!0&&s.supportsTemperature&&(g.temperature=r.temperature);let A=s.supportsCacheControlOnTools?i:void 0;if(d){let E=new Set(l.map(S=>S.name)),_=Bf(e.messages).filter(S=>!E.has(S.name));g.tools=[...xje(l,n,s.supportsEagerToolInputStreaming,s.supportsStrictTools,A),$Kr,...xje(_,n,s.supportsEagerToolInputStreaming,s.supportsStrictTools).map(S=>({...S,defer_loading:!0}))]}else{let E=Nm(e.messages);E.length>0&&(g.tools=xje(E,n,s.supportsEagerToolInputStreaming,s.supportsStrictTools,A))}if(t.compat?.supportsMidConvoEffort===!0)g.thinking={type:"adaptive",display:r?.thinkingDisplay??"summarized",block_binding:{prefix_mismatch_behavior:"drop_block"}},g.output_config={effort:"high"};else if(t.reasoning)if(r?.thinkingEnabled){let E=r.thinkingDisplay??"summarized";t.compat?.forceAdaptiveThinking===!0?(g.thinking={type:"adaptive",display:E},r.effort&&(g.output_config={effort:r.effort})):g.thinking={type:"enabled",budget_tokens:r.thinkingBudgetTokens||1024,display:E}}else r?.thinkingEnabled===!1&&t.thinkingLevelMap?.off!==null&&(g.thinking={type:"disabled"});if(r?.metadata){let E=r.metadata.user_id;typeof E=="string"&&(g.metadata={user_id:E})}r?.toolChoice&&(typeof r.toolChoice=="string"?g.tool_choice={type:r.toolChoice}:g.tool_choice=r.toolChoice);let y=t.compat?.allowedFallbackModels;return y&&y.length>0&&(g.fallbacks=y.map(E=>({model:E.model}))),g}function tJr(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,64)}function nJr(t){return{type:"tool_result",tool_use_id:t.toolCallId,content:MKr(t.content),is_error:t.isError}}function rJr(t,e,n,r=!1,i,s=!1){let o=[],a=new Map,c=[],u=()=>{o.push(...c),c.length=0};for(let l=0;l0&&h.push({type:"text",text:ri(m)}),s){for(let f of d.toolsRemoved??[])h.push({type:"tool_removal",tool:{type:"tool_reference",name:e?oEe(f.name):f.name}});for(let f of d.toolsAdded??[])h.push({type:"tool_addition",tool:{type:"tool_reference",name:e?oEe(f.name):f.name}})}h.length>0&&c.push({role:"system",content:h})}else if(d.role==="user")if(typeof d.content=="string")d.content.trim().length>0&&o.push({role:"user",content:ri(d.content)});else{let h=d.content.map(f=>f.type==="text"?{type:"text",text:ri(f.text)}:{type:"image",source:{type:"base64",media_type:f.mimeType,data:f.data}}).filter(f=>f.type==="text"?f.text.trim().length>0:!0);if(h.length===0)continue;o.push({role:"user",content:h})}else if(d.role==="assistant"){u();let m=[];for(let f of d.content)if(f.type==="text"){if(f.text.trim().length===0)continue;m.push({type:"text",text:ri(f.text)})}else if(f.type==="thinking"){if(f.redacted){m.push({type:"redacted_thinking",data:f.thinkingSignature});continue}let g=f.thinkingSignature,A=!!g&&g.trim().length>0;if(f.thinking.trim().length===0&&!A)continue;A?m.push({type:"thinking",thinking:ri(f.thinking),signature:g}):m.push(r?{type:"thinking",thinking:ri(f.thinking),signature:""}:{type:"text",text:ri(f.thinking)})}else f.type==="toolCall"&&m.push({type:"tool_use",id:f.id,name:e?oEe(f.name):f.name,input:f.arguments??{}});if(m.length===0)continue;let h=o.length;o.push({role:"assistant",content:m}),i!==void 0&&d.api==="anthropic-messages"&&d.provider===i&&iJr(d.providerThinkingLevel)&&a.set(h,d.providerThinkingLevel)}else if(d.role==="toolResult"){let m=[],h=l;for(;h0){let l=o[o.length-1];if(l.role==="user"||l.role==="system")if(Array.isArray(l.content)){let d=l.content[l.content.length-1];d&&(d.type==="text"||d.type==="image"||d.type==="tool_result"||d.type==="tool_addition"||d.type==="tool_removal")&&(d.cache_control=n)}else typeof l.content=="string"&&(l.content=[{type:"text",text:l.content,cache_control:n}])}return{messages:o,assistantLevels:a}}function iJr(t){return t==="low"||t==="medium"||t==="high"||t==="xhigh"||t==="max"}function sJr(t,e){let n=[];for(let r=0;r0&&!oX(t).supportsEagerToolInputStreaming}function xje(t,e,n,r,i){return t?t.map((s,o)=>{let a=wy(s,r),c=v0(s,a),u=c,l={type:"object",properties:u.properties??{},required:u.required??[]},d=a===!0?{...c,...l}:l;return{name:e?oEe(s.name):s.name,description:s.description,...n?{eager_input_streaming:!0}:{},...a===!0?{strict:!0}:{},input_schema:d,...i&&o===t.length-1?{cache_control:i}:{}}}):[]}function aJr(t,e){switch(t){case"end_turn":return{stopReason:"stop"};case"max_tokens":return{stopReason:"length"};case"tool_use":return{stopReason:"toolUse"};case"refusal":return{stopReason:"error",errorMessage:e?.explanation||"The model refused to complete the request"};case"pause_turn":return{stopReason:"stop"};case"stop_sequence":return{stopReason:"stop"};case"sensitive":return{stopReason:"error",errorMessage:"Provider stopped with: sensitive"};default:throw new Error(`Unhandled stop reason: ${t}`)}}var BKr,NKr,DKr,oEe,PKr,OKr,LKr,FKr,QKr,UKr,GKr,$Kr,qKr,aEe,KKr,jzt=v(()=>{p();O4e();ni();qO();eA();T0();tv();dv();cx();CL();tI();Cy();Nf();nI();iEe();rI();jO();BKr="2.1.280",NKr=["Read","Write","Edit","Bash","Grep","Glob","AskUserQuestion","EnterPlanMode","ExitPlanMode","KillShell","NotebookEdit","Skill","Task","TaskOutput","TodoWrite","WebFetch","WebSearch"],DKr=new Map(NKr.map(t=>[t.toLowerCase(),t])),oEe=t=>DKr.get(t.toLowerCase())??t,PKr=(t,e)=>{if(e&&e.length>0){let n=t.toLowerCase(),r=e.find(i=>i.name.toLowerCase()===n);if(r)return r.name}return t};OKr="fine-grained-tool-streaming-2025-05-14",LKr="interleaved-thinking-2025-05-14",FKr="server-side-fallback-2026-07-01",QKr="mid-conversation-output-config-2026-07-01",UKr="thinking-binding-controls-2026-08-01",GKr="mid-conversation-tool-changes-2026-07-01",$Kr={name:"__pi_deferred_placeholder__",description:"Reserved placeholder. Never available. Never call this.",input_schema:{type:"object",properties:{},required:[]},defer_loading:!0};qKr=new Set(["message_start","message_delta","message_stop","content_block_start","content_block_delta","content_block_stop"]);aEe=(t,e,n)=>{let r=new Rc,i=vh(e,oX(t).supportsMidConvoSystemMessages),s=Nm(i.messages);return(async()=>{let o=t.compat?.supportsMidConvoEffort?n?.effort??"high":void 0,a={role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,...o===void 0?{}:{providerThinkingLevel:o},usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let c,u,l=t,d;if(n?.client)c=n.client,u=!1;else{let y=n?.apiKey;Wzt(t.provider,y,n?.headers);let E;if(t.provider==="github-copilot"){let I=qq(i.messages);E=jq({messages:i.messages,hasImages:I})}let S=$zt(n?.cacheRetention,n?.env)==="none"?void 0:n?.sessionId,C=XKr(t,y,n?.headers,n?.fetch,E,S);c=C.client,u=C.isOAuthToken}let m=eJr(t,i,u,n),h=await n?.onPayload?.(m,t);h!==void 0&&(m={...h,stream:!0});let f={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},g=await Q0(()=>c.beta.messages.create(m,f).asResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});await n?.onResponse?.({status:g.status,headers:Dm(g.headers)},t),r.push({type:"start",partial:a});let A=a.content;for await(let y of YKr(g,n?.signal))if(y.type==="message_start"){a.responseId=y.message.id;let E=y.message.input_transformations;Array.isArray(E)&&(d=E);let _=y.message.model;_!==t.id&&(a.responseModel=_);let S=_===t.id?void 0:t.compat?.allowedFallbackModels?.find(C=>C.provider===t.provider&&C.model===_)?.cost;l=S?{...t,id:_,cost:S}:t,a.usage.input=y.message.usage.input_tokens||0,a.usage.output=y.message.usage.output_tokens||0,a.usage.cacheRead=y.message.usage.cache_read_input_tokens||0,a.usage.cacheWrite=y.message.usage.cache_creation_input_tokens||0,a.usage.cacheWrite1h=y.message.usage.cache_creation?.ephemeral_1h_input_tokens||0,a.usage.totalTokens=a.usage.input+a.usage.output+a.usage.cacheRead+a.usage.cacheWrite,$p(l,a.usage)}else if(y.type==="content_block_start"){if(y.content_block.type==="fallback"){if(a.content.length>0)throw new Error("Anthropic performed an unsupported mid-output model fallback");continue}if(y.content_block.type==="text"){let E={type:"text",text:y.content_block.text??"",index:y.index};a.content.push(E),r.push({type:"text_start",contentIndex:a.content.length-1,partial:a})}else if(y.content_block.type==="thinking"){let E={type:"thinking",thinking:y.content_block.thinking??"",thinkingSignature:y.content_block.signature??"",index:y.index};a.content.push(E),r.push({type:"thinking_start",contentIndex:a.content.length-1,partial:a})}else if(y.content_block.type==="redacted_thinking"){let E={type:"thinking",thinking:"[Reasoning redacted]",thinkingSignature:y.content_block.data,redacted:!0,index:y.index};a.content.push(E),r.push({type:"thinking_start",contentIndex:a.content.length-1,partial:a})}else if(y.content_block.type==="tool_use"){let E={type:"toolCall",id:y.content_block.id,name:u?PKr(y.content_block.name,s):y.content_block.name,arguments:y.content_block.input??{},partialJson:"",index:y.index};a.content.push(E),r.push({type:"toolcall_start",contentIndex:a.content.length-1,partial:a})}}else if(y.type==="content_block_delta"){if(y.delta.type==="text_delta"){let E=A.findIndex(S=>S.index===y.index),_=A[E];_&&_.type==="text"&&(_.text+=y.delta.text,r.push({type:"text_delta",contentIndex:E,delta:y.delta.text,partial:a}))}else if(y.delta.type==="thinking_delta"){let E=A.findIndex(S=>S.index===y.index),_=A[E];_&&_.type==="thinking"&&(_.thinking+=y.delta.thinking,r.push({type:"thinking_delta",contentIndex:E,delta:y.delta.thinking,partial:a}))}else if(y.delta.type==="input_json_delta"){let E=A.findIndex(S=>S.index===y.index),_=A[E];_&&_.type==="toolCall"&&(_.partialJson+=y.delta.partial_json,_.arguments=ec(_.partialJson),r.push({type:"toolcall_delta",contentIndex:E,delta:y.delta.partial_json,partial:a}))}else if(y.delta.type==="signature_delta"){let E=A.findIndex(S=>S.index===y.index),_=A[E];_&&_.type==="thinking"&&(_.thinkingSignature=_.thinkingSignature||"",_.thinkingSignature+=y.delta.signature)}}else if(y.type==="content_block_stop"){let E=A.findIndex(S=>S.index===y.index),_=A[E];_&&(delete _.index,_.type==="text"?r.push({type:"text_end",contentIndex:E,content:_.text,partial:a}):_.type==="thinking"?r.push({type:"thinking_end",contentIndex:E,content:_.thinking,partial:a}):_.type==="toolCall"&&(_.arguments=ec(_.partialJson),delete _.partialJson,r.push({type:"toolcall_end",contentIndex:E,toolCall:_,partial:a})))}else if(y.type==="message_delta"){let E=y.input_transformations;if(Array.isArray(E)&&(d=E),y.delta.stop_reason){a.rawStopReason=y.delta.stop_reason;let _=aJr(y.delta.stop_reason,y.delta.stop_details);a.stopReason=_.stopReason,_.errorMessage&&(a.errorMessage=_.errorMessage)}if(y.usage){y.usage.input_tokens!=null&&(a.usage.input=y.usage.input_tokens),y.usage.output_tokens!=null&&(a.usage.output=y.usage.output_tokens),y.usage.cache_read_input_tokens!=null&&(a.usage.cacheRead=y.usage.cache_read_input_tokens),y.usage.cache_creation_input_tokens!=null&&(a.usage.cacheWrite=y.usage.cache_creation_input_tokens);let _=y.usage.output_tokens_details?.thinking_tokens;_!=null&&(a.usage.reasoning=_)}a.usage.totalTokens=a.usage.input+a.usage.output+a.usage.cacheRead+a.usage.cacheWrite,$p(l,a.usage)}if(n?.signal?.aborted)throw new Error("Request was aborted");if(a.stopReason==="pending")throw new Error("Anthropic stream ended without a stop reason");if(a.stopReason==="aborted"||a.stopReason==="error")throw new Error(a.errorMessage||"An unknown error occurred");d&&d.length>0&&JC(a,{type:"anthropic_input_transformations",timestamp:Date.now(),details:{transformations:d.map(y=>({type:y.type??void 0,path:y.path??void 0,reason:y.reason??void 0}))}}),r.push({type:"done",reason:a.stopReason,message:a}),r.end()}catch(c){for(let u of a.content)delete u.index,delete u.partialJson;a.stopReason=n?.signal?.aborted?"aborted":"error",a.errorMessage=c instanceof Error?c.message:JSON.stringify(c),r.push({type:"error",reason:a.stopReason,error:a}),r.end()}})(),r};KKr=(t,e,n)=>{Wzt(t.provider,n?.apiKey,n?.headers);let r={...Wp(t,e,n,n?.apiKey),toolChoice:n?.toolChoice};if(!n?.reasoning)return aEe(t,e,{...r,thinkingEnabled:!1});if(t.compat?.forceAdaptiveThinking===!0){let o=zKr(t,n.reasoning);return aEe(t,e,{...r,thinkingEnabled:!0,effort:o})}let i=_Ae(r.maxTokens,t.maxTokens,n.reasoning,n.thinkingBudgets),s=oJ(t,e,i.maxTokens);return aEe(t,e,{...r,maxTokens:s,thinkingEnabled:!0,thinkingBudgetTokens:Math.min(i.thinkingBudget,Math.max(0,s-1024))})}});var rc,Uf=v(()=>{p();Sy();rc=()=>ed(()=>Promise.resolve().then(()=>(jzt(),qzt)))});function Hr(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n}function Ut(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}var U0=v(()=>{p()});var Sje,Cje=v(()=>{p();Sje=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return Sje=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),n=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))}});function aX(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var cX,cEe=v(()=>{p();cX=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)}});var qn,Su,Rd,UB,GB,Vq,Yq,zq,Kq,Jq,Xq,Zq,e5,t5,n5,dI,IL,lX,G0=v(()=>{p();cEe();qn=class extends Error{},Su=class t extends qn{constructor(e,n,r,i){super(`${t.makeMessage(e,n,r)}`),this.status=e,this.headers=i,this.requestID=i?.get("x-request-id"),this.error=n;let s=n;this.code=s?.code,this.param=s?.param,this.type=s?.type}static makeMessage(e,n,r){let i=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return e&&i?`${e} ${i}`:e?`${e} status code (no body)`:i||"(no status code or body)"}static generate(e,n,r,i){if(!e||!i)return new UB({message:r,cause:cX(n)});let s=n?.error;return e===400?new Vq(e,s,r,i):e===401?new Yq(e,s,r,i):e===403?new zq(e,s,r,i):e===404?new Kq(e,s,r,i):e===409?new Jq(e,s,r,i):e===422?new Xq(e,s,r,i):e===429?new Zq(e,s,r,i):e>=500?new e5(e,s,r,i):new t(e,s,r,i)}},Rd=class extends Su{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},UB=class extends Su{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}},GB=class extends UB{constructor({message:e}={}){super({message:e??"Request timed out."})}},Vq=class extends Su{},Yq=class extends Su{},zq=class extends Su{},Kq=class extends Su{},Jq=class extends Su{},Xq=class extends Su{},Zq=class extends Su{},e5=class extends Su{},t5=class extends qn{constructor(){super("Could not parse response content as the length limit was reached")}},n5=class extends qn{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},dI=class extends Error{constructor(e){super(e)}},IL=class extends Su{constructor(e,n,r){let i="OAuth2 authentication error",s;if(n&&typeof n=="object"){let o=n;s=o.error;let a=o.error_description;a&&typeof a=="string"?i=a:s&&(i=s)}super(e,n,i,r),this.error_code=s}},lX=class extends qn{constructor(e,n,r){super(e),this.provider=n,this.cause=r}}});function lEe(t){return typeof t!="object"?{}:t??{}}function wje(t){if(!t)return!0;for(let e in t)return!1;return!0}function Yzt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function r5(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var lJr,Vzt,Nh,Ije,zzt,Kzt,pv=v(()=>{p();G0();lJr=/^[a-z][a-z0-9+.-]*:/i,Vzt=t=>lJr.test(t),Nh=t=>(Nh=Array.isArray,Nh(t)),Ije=Nh;zzt=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new qn(`${t} must be an integer`);if(e<0)throw new qn(`${t} must be a positive integer`);return e},Kzt=t=>{try{return JSON.parse(t)}catch{return}}});var pI,i5=v(()=>{p();pI=t=>new Promise(e=>setTimeout(e,t))});var $B,Tje=v(()=>{p();$B="6.40.0"});function uJr(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function pJr(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:n}of t){let r=n.exec(navigator.userAgent);if(r){let i=r[1]||0,s=r[2]||0,o=r[3]||0;return{browser:e,version:`${i}.${s}.${o}`}}}return null}var e7t,dJr,Jzt,Xzt,Zzt,t7t,vje=v(()=>{p();Tje();e7t=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";dJr=()=>{let t=uJr();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$B,"X-Stainless-OS":Xzt(Deno.build.os),"X-Stainless-Arch":Jzt(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$B,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$B,"X-Stainless-OS":Xzt(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Jzt(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=pJr();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$B,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$B,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};Jzt=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",Xzt=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),t7t=()=>Zzt??(Zzt=dJr())});function uEe(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Rje(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function dEe(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return Rje({start(){},async pull(n){let{done:r,value:i}=await e.next();r?n.close():n.enqueue(i)},async cancel(){await e.return?.()}})}function kje(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){let n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function Bje(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),n=e.cancel();e.releaseLock(),await n}var s5=v(()=>{p()});var r7t,i7t=v(()=>{p();r7t=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)})});var Nje,Dje,Pje,s7t,Mje=v(()=>{p();Nje="RFC3986",Dje=t=>String(t),Pje={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:Dje},s7t="RFC1738"});function a7t(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function Lje(t,e){if(Nh(t)){let n=[];for(let r=0;r{p();Mje();pv();pEe=(t,e)=>(pEe=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),pEe(t,e)),mI=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),Oje=1024,o7t=(t,e,n,r,i)=>{if(t.length===0)return t;let s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let o="";for(let a=0;a=Oje?s.slice(a,a+Oje):s,u=[];for(let l=0;l=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===s7t&&(d===40||d===41)){u[u.length]=c.charAt(l);continue}if(d<128){u[u.length]=mI[d];continue}if(d<2048){u[u.length]=mI[192|d>>6]+mI[128|d&63];continue}if(d<55296||d>=57344){u[u.length]=mI[224|d>>12]+mI[128|d>>6&63]+mI[128|d&63];continue}l+=1,d=65536+((d&1023)<<10|c.charCodeAt(l)&1023),u[u.length]=mI[240|d>>18]+mI[128|d>>12&63]+mI[128|d>>6&63]+mI[128|d&63]}o+=u.join("")}return o}});function hJr(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function p7t(t,e,n,r,i,s,o,a,c,u,l,d,m,h,f,g,A,y){let E=t,_=y,S=0,C=!1;for(;(_=_.get(Fje))!==void 0&&!C;){let O=_.get(t);if(S+=1,typeof O<"u"){if(O===S)throw new RangeError("Cyclic object value");C=!0}typeof _.get(Fje)>"u"&&(S=0)}if(typeof u=="function"?E=u(e,E):E instanceof Date?E=m?.(E):n==="comma"&&Nh(E)&&(E=Lje(E,function(O){return O instanceof Date?m?.(O):O})),E===null){if(s)return c&&!g?c(e,np.encoder,A,"key",h):e;E=""}if(hJr(E)||a7t(E)){if(c){let O=g?e:c(e,np.encoder,A,"key",h);return[f?.(O)+"="+f?.(c(E,np.encoder,A,"value",h))]}return[f?.(e)+"="+f?.(String(E))]}let I=[];if(typeof E>"u")return I;let w;if(n==="comma"&&Nh(E))g&&c&&(E=Lje(E,c)),w=[{value:E.length>0?E.join(",")||null:void 0}];else if(Nh(u))w=u;else{let O=Object.keys(E);w=l?O.sort(l):O}let k=a?String(e).replace(/\./g,"%2E"):String(e),N=r&&Nh(E)&&E.length===1?k+"[]":k;if(i&&Nh(E)&&E.length===0)return N+"[]";for(let O=0;O"u"?t.encodeDotInKeys?!0:np.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:np.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:np.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:np.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?np.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:np.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:np.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:np.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:np.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:np.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:np.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:np.strictNullHandling}}function m7t(t,e={}){let n=t,r=fJr(e),i,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):Nh(r.filter)&&(s=r.filter,i=s);let o=[];if(typeof n!="object"||n===null)return"";let a=u7t[r.arrayFormat],c=a==="comma"&&r.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);let u=new WeakMap;for(let m=0;m0?d+l:""}var u7t,d7t,l7t,np,Fje,h7t=v(()=>{p();c7t();Mje();pv();u7t={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},d7t=function(t,e){Array.prototype.push.apply(t,Nh(e)?e:[e])},np={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o7t,encodeValuesOnly:!1,format:Nje,formatter:Dje,indices:!1,serializeDate(t){return(l7t??(l7t=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};Fje={}});function f7t(t){return m7t(t,{arrayFormat:"brackets"})}var Qje=v(()=>{p();h7t()});function y7t(t){let e=0;for(let i of t)e+=i.length;let n=new Uint8Array(e),r=0;for(let i of t)n.set(i,r),r+=i.length;return n}function o5(t){let e;return(g7t??(e=new globalThis.TextEncoder,g7t=e.encode.bind(e)))(t)}function Uje(t){let e;return(A7t??(e=new globalThis.TextDecoder,A7t=e.decode.bind(e)))(t)}var g7t,A7t,mEe=v(()=>{p()});function AJr(t,e){for(let i=e??0;i{p();U0();mEe();wL=class{constructor(){Dy.set(this,void 0),Py.set(this,void 0),Hr(this,Dy,new Uint8Array,"f"),Hr(this,Py,null,"f")}decode(e){if(e==null)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?o5(e):e;Hr(this,Dy,y7t([Ut(this,Dy,"f"),n]),"f");let r=[],i;for(;(i=AJr(Ut(this,Dy,"f"),Ut(this,Py,"f")))!=null;){if(i.carriage&&Ut(this,Py,"f")==null){Hr(this,Py,i.index,"f");continue}if(Ut(this,Py,"f")!=null&&(i.index!==Ut(this,Py,"f")+1||i.carriage)){r.push(Uje(Ut(this,Dy,"f").subarray(0,Ut(this,Py,"f")-1))),Hr(this,Dy,Ut(this,Dy,"f").subarray(Ut(this,Py,"f")),"f"),Hr(this,Py,null,"f");continue}let s=Ut(this,Py,"f")!==null?i.preceding-1:i.preceding,o=Uje(Ut(this,Dy,"f").subarray(0,s));r.push(o),Hr(this,Dy,Ut(this,Dy,"f").subarray(i.index),"f"),Hr(this,Py,null,"f")}return r}flush(){return Ut(this,Dy,"f").length?this.decode(` +`):[]}};Dy=new WeakMap,Py=new WeakMap;wL.NEWLINE_CHARS=new Set([` +`,"\r"]);wL.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function uX(){}function hEe(t,e,n){return!e||fEe[t]>fEe[n]?uX:e[t].bind(e)}function td(t){let e=t.logger,n=t.logLevel??"off";if(!e)return yJr;let r=_7t.get(e);if(r&&r[0]===n)return r[1];let i={error:hEe("error",e,n),warn:hEe("warn",e,n),info:hEe("info",e,n),debug:hEe("debug",e,n)};return _7t.set(e,[n,i]),i}var fEe,Gje,yJr,_7t,mv,dX=v(()=>{p();pv();fEe={off:0,error:200,warn:300,info:400,debug:500},Gje=(t,e,n)=>{if(t){if(Yzt(fEe,t))return t;td(n).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(fEe))}`)}};yJr={error:uX,warn:uX,info:uX,debug:uX},_7t=new WeakMap;mv=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,n])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t)});async function*EJr(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new qn("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new qn("Attempted to iterate over a response with no body");let n=new $je,r=new wL,i=kje(t.body);for await(let s of bJr(i))for(let o of r.decode(s)){let a=n.decode(o);a&&(yield a)}for(let s of r.flush()){let o=n.decode(s);o&&(yield o)}}async function*bJr(t){let e=new Uint8Array;for await(let n of t){if(n==null)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?o5(n):n,i=new Uint8Array(e.length+r.length);i.set(e),i.set(r,e.length),e=i;let s;for(;(s=E7t(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function _Jr(t,e){let n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}var pX,hI,$je,Wje=v(()=>{p();U0();G0();s5();b7t();s5();cEe();mEe();dX();G0();hI=class t{constructor(e,n,r){this.iterator=e,pX.set(this,void 0),this.controller=n,Hr(this,pX,r,"f")}static fromSSEResponse(e,n,r,i){let s=!1,o=r?td(r):console;async function*a(){if(s)throw new qn("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let c=!1;try{for await(let u of EJr(e,n))if(!c){if(u.data.startsWith("[DONE]")){c=!0;continue}if(u.event===null||!u.event.startsWith("thread.")){let l;try{l=JSON.parse(u.data)}catch(d){throw o.error("Could not parse message into JSON:",u.data),o.error("From chunk:",u.raw),d}if(l&&l.error)throw new Su(void 0,l.error,void 0,e.headers);yield i?{event:u.event,data:l}:l}else{let l;try{l=JSON.parse(u.data)}catch(d){throw console.error("Could not parse message into JSON:",u.data),console.error("From chunk:",u.raw),d}if(u.event=="error")throw new Su(void 0,l.error,l.message,void 0);yield{event:u.event,data:l}}}c=!0}catch(u){if(aX(u))return;throw u}finally{c||n.abort()}}return new t(a,n,r)}static fromReadableStream(e,n,r){let i=!1;async function*s(){let a=new wL,c=kje(e);for await(let u of c)for(let l of a.decode(u))yield l;for(let u of a.flush())yield u}async function*o(){if(i)throw new qn("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let a=!1;try{for await(let c of s())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(aX(c))return;throw c}finally{a||n.abort()}}return new t(o,n,r)}[(pX=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],n=[],r=this.iterator(),i=s=>({next:()=>{if(s.length===0){let o=r.next();e.push(o),n.push(o)}return s.shift()}});return[new t(()=>i(e),this.controller,Ut(this,pX,"f")),new t(()=>i(n),this.controller,Ut(this,pX,"f"))]}toReadableStream(){let e=this,n;return Rje({async start(){n=e[Symbol.asyncIterator]()},async pull(r){try{let{value:i,done:s}=await n.next();if(s)return r.close();let o=o5(JSON.stringify(i)+` +`);r.enqueue(o)}catch(i){r.error(i)}},async cancel(){await n.return?.()}})}};$je=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[n,r,i]=_Jr(e,":");return i.startsWith(" ")&&(i=i.substring(1)),n==="event"?this.event=i:n==="data"&&this.data.push(i),null}}});async function gEe(t,e){let{response:n,requestLogID:r,retryOfRequestLogID:i,startTime:s}=e,o=await(async()=>{if(e.options.stream)return td(t).debug("response",n.status,n.url,n.headers,n.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(n,e.controller,t,e.options.__synthesizeEventData):hI.fromSSEResponse(n,e.controller,t,e.options.__synthesizeEventData);if(n.status===204)return null;if(e.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let m=await n.json();return Hje(m,n)}return await n.text()})();return td(t).debug(`[${r}] response parsed`,mv({retryOfRequestLogID:i,url:n.url,status:n.status,body:o,durationMs:Date.now()-s})),o}function Hje(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("x-request-id"),enumerable:!1})}var qje=v(()=>{p();Wje();dX()});var mX,TL,AEe=v(()=>{p();U0();qje();TL=class t extends Promise{constructor(e,n,r=gEe){super(i=>{i(null)}),this.responsePromise=n,this.parseResponse=r,mX.set(this,void 0),Hr(this,mX,e,"f")}_thenUnwrap(e){return new t(Ut(this,mX,"f"),this.responsePromise,async(n,r)=>Hje(e(await this.parseResponse(n,r),r),r.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:n,request_id:n.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(Ut(this,mX,"f"),e))),this.parsedPromise}then(e,n){return this.parse().then(e,n)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};mX=new WeakMap});var yEe,a5,hX,Dh,Ki,No,kd,xi=v(()=>{p();U0();G0();qje();AEe();pv();a5=class{constructor(e,n,r,i){yEe.set(this,void 0),Hr(this,yEe,e,"f"),this.options=i,this.response=n,this.body=r}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new qn("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await Ut(this,yEe,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(yEe=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let n of e.getPaginatedItems())yield n}},hX=class extends TL{constructor(e,n,r){super(e,n,async(i,s)=>new r(i,s.response,await gEe(i,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let n of e)yield n}},Dh=class extends a5{constructor(e,n,r,i){super(e,n,r,i),this.data=r.data||[],this.object=r.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}},Ki=class extends a5{constructor(e,n,r,i){super(e,n,r,i),this.data=r.data||[],this.has_more=r.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let e=this.getPaginatedItems(),n=e[e.length-1]?.id;return n?{...this.options,query:{...lEe(this.options.query),after:n}}:null}},No=class extends a5{constructor(e,n,r,i){super(e,n,r,i),this.data=r.data||[],this.has_more=r.has_more||!1,this.last_id=r.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let e=this.last_id;return e?{...this.options,query:{...lEe(this.options.query),after:e}}:null}},kd=class extends a5{constructor(e,n,r,i){super(e,n,r,i),this.data=r.data||[],this.has_more=r.has_more||!1,this.next=r.next||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let e=this.next;return e?{...this.options,query:{...lEe(this.options.query),after:e}}:null}}});var SJr,CJr,EEe,x7t=v(()=>{p();s5();G0();SJr={jwt:"urn:ietf:params:oauth:token-type:jwt",id:"urn:ietf:params:oauth:token-type:id_token"},CJr="urn:ietf:params:oauth:grant-type:token-exchange",EEe=class{constructor(e,n){this.cachedToken=null,this.refreshPromise=null,this.tokenExchangeUrl="https://auth.openai.com/oauth/token",this.config=e,this.fetch=n??uEe()}async getToken(){if(!this.cachedToken||this.isTokenExpired(this.cachedToken)){if(this.refreshPromise)return await this.refreshPromise;this.refreshPromise=this.refreshToken();try{return await this.refreshPromise}finally{this.refreshPromise=null}}return this.needsRefresh(this.cachedToken)&&!this.refreshPromise&&(this.refreshPromise=this.refreshToken().finally(()=>{this.refreshPromise=null})),this.cachedToken.token}async refreshToken(){let e=await this.config.provider.getToken(),n={grant_type:CJr,subject_token:e,subject_token_type:SJr[this.config.provider.tokenType],identity_provider_id:this.config.identityProviderId,service_account_id:this.config.serviceAccountId};this.config.clientId&&(n.client_id=this.config.clientId);let r=await this.fetch(this.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok){let a=await r.text(),c;try{c=JSON.parse(a)}catch{}throw r.status===400||r.status===401||r.status===403?new IL(r.status,c,r.headers):Su.generate(r.status,c,`Token exchange failed with status ${r.status}`,r.headers)}let i=await r.json(),s=i.expires_in||3600,o=Date.now()+s*1e3;return this.cachedToken={token:i.access_token,expiresAt:o},i.access_token}isTokenExpired(e){return Date.now()>=e.expiresAt}needsRefresh(e){let r=(this.config.refreshBufferSeconds??1200)*1e3;return Date.now()>=e.expiresAt-r}invalidateToken(){this.cachedToken=null,this.refreshPromise=null}}});function c5(t,e,n){return Yje(),new File(t,e??"unknown_file",n)}function fX(t){return(typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"").split(/[\\/]/).pop()||void 0}function IJr(t){let e=typeof t=="function"?t:t.fetch,n=S7t.get(e);if(n)return n;let r=(async()=>{try{let i="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new i(s).text()}catch{return!0}})();return S7t.set(e,r),r}var Yje,bEe,WB,Ph,S7t,C7t,I7t,wJr,jje,Vje,$0=v(()=>{p();s5();Yje=()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};bEe=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function",WB=async(t,e)=>jje(t.body)?{...t,body:await C7t(t.body,e)}:t,Ph=async(t,e)=>({...t,body:await C7t(t.body,e)}),S7t=new WeakMap;C7t=async(t,e)=>{if(!await IJr(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([r,i])=>Vje(n,r,i))),n},I7t=t=>t instanceof Blob&&"name"in t,wJr=t=>typeof t=="object"&&t!==null&&(t instanceof Response||bEe(t)||I7t(t)),jje=t=>{if(wJr(t))return!0;if(Array.isArray(t))return t.some(jje);if(t&&typeof t=="object"){for(let e in t)if(jje(t[e]))return!0}return!1},Vje=async(t,e,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")t.append(e,String(n));else if(n instanceof Response)t.append(e,c5([await n.blob()],fX(n)));else if(bEe(n))t.append(e,c5([await new Response(dEe(n)).blob()],fX(n)));else if(I7t(n))t.append(e,n,fX(n));else if(Array.isArray(n))await Promise.all(n.map(r=>Vje(t,e+"[]",r)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([r,i])=>Vje(t,`${e}[${r}]`,i)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}});async function _Ee(t,e,n){if(Yje(),t=await t,TJr(t))return t instanceof File?t:c5([await t.arrayBuffer()],t.name);if(vJr(t)){let i=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),c5(await zje(i),e,n)}let r=await zje(t);if(e||(e=fX(t)),!n?.type){let i=r.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof i=="string"&&(n={...n,type:i})}return c5(r,e,n)}async function zje(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(w7t(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(bEe(t))for await(let n of t)e.push(...await zje(n));else{let n=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${n?`; constructor: ${n}`:""}${RJr(t)}`)}return e}function RJr(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(n=>`"${n}"`).join(", ")}]`}var w7t,TJr,vJr,T7t=v(()=>{p();$0();$0();w7t=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",TJr=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&w7t(t),vJr=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function"});var Kje=v(()=>{p();T7t()});var Nt,kn=v(()=>{p();Nt=class{constructor(e){this._client=e}}});function R7t(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var v7t,BJr,ct,kr=v(()=>{p();G0();v7t=Object.freeze(Object.create(null)),BJr=(t=R7t)=>function(n,...r){if(n.length===1)return n[0];let i=!1,s=[],o=n.reduce((l,d,m)=>{/[?#]/.test(d)&&(i=!0);let h=r[m],f=(i?encodeURIComponent:t)(""+h);return m!==r.length&&(h==null||typeof h=="object"&&h.toString===Object.getPrototypeOf(Object.getPrototypeOf(h.hasOwnProperty??v7t)??v7t)?.toString)&&(f=h+"",s.push({start:l.length+d.length,length:f.length,error:`Value of type ${Object.prototype.toString.call(h).slice(8,-1)} is not a valid path parameter`})),l+d+(m===r.length?"":f)},""),a=o.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=c.exec(a))!==null;)s.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(s.sort((l,d)=>l.start-d.start),s.length>0){let l=0,d=s.reduce((m,h)=>{let f=" ".repeat(h.start-l),g="^".repeat(h.length);return l=h.start+h.length,m+f+g},"");throw new qn(`Path parameters result in path with invalid segments: +${s.map(m=>m.error).join(` `)} ${o} -${d}`)}return o},at=fTr(oUt)});var wP,xhe=V(()=>{p();Rn();Es();vr();wP=class extends kt{list(e,n={},r){return this._client.getAPIList(at`/chat/completions/${e}/messages`,Gs,{query:n,...r,__security:{bearerAuth:!0}})}}});var __=V(()=>{p();bE()});function rK(t){return t!==void 0&&"function"in t&&t.function!==void 0}function sK(t){return t?.$brand==="auto-parseable-response-format"}function TP(t){return t?.$brand==="auto-parseable-tool"}function aUt(t,e){return!e||!vGe(e)?{...t,choices:t.choices.map(n=>(lUt(n.message.tool_calls),{...n,message:{...n.message,parsed:null,...n.message.tool_calls?{tool_calls:n.message.tool_calls}:void 0}}))}:iK(t,e)}function iK(t,e){let n=t.choices.map(r=>{if(r.finish_reason==="length")throw new MG;if(r.finish_reason==="content_filter")throw new LG;return lUt(r.message.tool_calls),{...r,message:{...r.message,...r.message.tool_calls?{tool_calls:r.message.tool_calls?.map(s=>ETr(e,s))??void 0}:void 0,parsed:r.message.content&&!r.message.refusal?yTr(e,r.message.content):null}}});return{...t,choices:n}}function yTr(t,e){return t.response_format?.type!=="json_schema"?null:t.response_format?.type==="json_schema"?"$parseRaw"in t.response_format?t.response_format.$parseRaw(e):JSON.parse(e):null}function ETr(t,e){let n=t.tools?.find(r=>rK(r)&&r.function?.name===e.function.name);return{...e,function:{...e.function,parsed_arguments:TP(n)?n.$parseRaw(e.function.arguments):n?.function.strict?JSON.parse(e.function.arguments):null}}}function cUt(t,e){if(!t||!("tools"in t)||!t.tools)return!1;let n=t.tools?.find(r=>rK(r)&&r.function?.name===e.function.name);return rK(n)&&(TP(n)||n?.function.strict||!1)}function vGe(t){return sK(t.response_format)?!0:t.tools?.some(e=>TP(e)||e.type==="function"&&e.function.strict===!0)??!1}function lUt(t){for(let e of t||[])if(e.type!=="function")throw new Wn(`Currently only \`function\` tool calls are supported; Received \`${e.type}\``)}function uUt(t){for(let e of t??[]){if(e.type!=="function")throw new Wn(`Currently only \`function\` tool types support auto-parsing; Received \`${e.type}\``);if(e.function.strict!==!0)throw new Wn(`The \`${e.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var oK=V(()=>{p();__()});var qG,RGe,kGe=V(()=>{p();qG=t=>t?.role==="assistant",RGe=t=>t?.role==="tool"});var NGe,whe,The,aK,cK,vhe,lK,jx,uK,Rhe,khe,HG,dUt,ik,Nhe=V(()=>{p();EE();__();ik=class{constructor(){NGe.add(this),this.controller=new AbortController,whe.set(this,void 0),The.set(this,()=>{}),aK.set(this,()=>{}),cK.set(this,void 0),vhe.set(this,()=>{}),lK.set(this,()=>{}),jx.set(this,{}),uK.set(this,!1),Rhe.set(this,!1),khe.set(this,!1),HG.set(this,!1),Gr(this,whe,new Promise((e,n)=>{Gr(this,The,e,"f"),Gr(this,aK,n,"f")}),"f"),Gr(this,cK,new Promise((e,n)=>{Gr(this,vhe,e,"f"),Gr(this,lK,n,"f")}),"f"),Ft(this,whe,"f").catch(()=>{}),Ft(this,cK,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},Ft(this,NGe,"m",dUt).bind(this))},0)}_connected(){this.ended||(Ft(this,The,"f").call(this),this._emit("connect"))}get ended(){return Ft(this,uK,"f")}get errored(){return Ft(this,Rhe,"f")}get aborted(){return Ft(this,khe,"f")}abort(){this.controller.abort()}on(e,n){return(Ft(this,jx,"f")[e]||(Ft(this,jx,"f")[e]=[])).push({listener:n}),this}off(e,n){let r=Ft(this,jx,"f")[e];if(!r)return this;let s=r.findIndex(i=>i.listener===n);return s>=0&&r.splice(s,1),this}once(e,n){return(Ft(this,jx,"f")[e]||(Ft(this,jx,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,r)=>{Gr(this,HG,!0,"f"),e!=="error"&&this.once("error",r),this.once(e,n)})}async done(){Gr(this,HG,!0,"f"),await Ft(this,cK,"f")}_emit(e,...n){if(Ft(this,uK,"f"))return;e==="end"&&(Gr(this,uK,!0,"f"),Ft(this,vhe,"f").call(this));let r=Ft(this,jx,"f")[e];if(r&&(Ft(this,jx,"f")[e]=r.filter(s=>!s.once),r.forEach(({listener:s})=>s(...n))),e==="abort"){let s=n[0];!Ft(this,HG,"f")&&!r?.length&&Promise.reject(s),Ft(this,aK,"f").call(this,s),Ft(this,lK,"f").call(this,s),this._emit("end");return}if(e==="error"){let s=n[0];!Ft(this,HG,"f")&&!r?.length&&Promise.reject(s),Ft(this,aK,"f").call(this,s),Ft(this,lK,"f").call(this,s),this._emit("end")}}_emitFinal(){}};whe=new WeakMap,The=new WeakMap,aK=new WeakMap,cK=new WeakMap,vhe=new WeakMap,lK=new WeakMap,jx=new WeakMap,uK=new WeakMap,Rhe=new WeakMap,khe=new WeakMap,HG=new WeakMap,NGe=new WeakSet,dUt=function(e){if(Gr(this,Rhe,!0,"f"),e instanceof Error&&e.name==="AbortError"&&(e=new Mu),e instanceof Mu)return Gr(this,khe,!0,"f"),this._emit("abort",e);if(e instanceof Wn)return this._emit("error",e);if(e instanceof Error){let n=new Wn(e.message);return n.cause=e,this._emit("error",n)}return this._emit("error",new Wn(String(e)))}});function pUt(t){return typeof t.parse=="function"}var DGe=V(()=>{p()});var Im,BGe,Dhe,PGe,OGe,MGe,hUt,mUt,bTr,VG,LGe=V(()=>{p();EE();__();oK();kGe();Nhe();DGe();bTr=10,VG=class extends ik{constructor(){super(...arguments),Im.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);let n=e.choices[0]?.message;return n&&this._addMessage(n),e}_addMessage(e,n=!0){if("content"in e||(e.content=null),this.messages.push(e),n){if(this._emit("message",e),RGe(e)&&e.content)this._emit("functionToolCallResult",e.content);else if(qG(e)&&e.tool_calls)for(let r of e.tool_calls)r.type==="function"&&this._emit("functionToolCall",r.function)}}async finalChatCompletion(){await this.done();let e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new Wn("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),Ft(this,Im,"m",BGe).call(this)}async finalMessage(){return await this.done(),Ft(this,Im,"m",Dhe).call(this)}async finalFunctionToolCall(){return await this.done(),Ft(this,Im,"m",PGe).call(this)}async finalFunctionToolCallResult(){return await this.done(),Ft(this,Im,"m",OGe).call(this)}async totalUsage(){return await this.done(),Ft(this,Im,"m",MGe).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);let n=Ft(this,Im,"m",Dhe).call(this);n&&this._emit("finalMessage",n);let r=Ft(this,Im,"m",BGe).call(this);r&&this._emit("finalContent",r);let s=Ft(this,Im,"m",PGe).call(this);s&&this._emit("finalFunctionToolCall",s);let i=Ft(this,Im,"m",OGe).call(this);i!=null&&this._emit("finalFunctionToolCallResult",i),this._chatCompletions.some(o=>o.usage)&&this._emit("totalUsage",Ft(this,Im,"m",MGe).call(this))}async _createChatCompletion(e,n,r){let s=r?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),Ft(this,Im,"m",hUt).call(this,n);let i=await e.chat.completions.create({...n,stream:!1},{...r,signal:this.controller.signal});return this._connected(),this._addChatCompletion(iK(i,n))}async _runChatCompletion(e,n,r){for(let s of n.messages)this._addMessage(s,!1);return await this._createChatCompletion(e,n,r)}async _runTools(e,n,r){let s="tool",{tool_choice:i="auto",stream:o,...a}=n,c=typeof i!="string"&&i.type==="function"&&i?.function?.name,{maxChatCompletions:u=bTr}=r||{},l=n.tools.map(m=>{if(TP(m)){if(!m.$callback)throw new Wn("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:m.$callback,name:m.function.name,description:m.function.description||"",parameters:m.function.parameters,parse:m.$parseRaw,strict:!0}}}return m}),d={};for(let m of l)m.type==="function"&&(d[m.function.name||m.function.function.name]=m.function);let h="tools"in n?l.map(m=>m.type==="function"?{type:"function",function:{name:m.function.name||m.function.function.name,parameters:m.function.parameters,description:m.function.description,strict:m.function.strict}}:m):void 0;for(let m of n.messages)this._addMessage(m,!1);for(let m=0;mJSON.stringify(N)).join(", ")}. Please try again`;this._addMessage({role:s,tool_call_id:y,content:R});continue}let I;try{I=pUt(C)?await C.parse(S):S}catch(R){let N=R instanceof Error?R.message:String(R);this._addMessage({role:s,tool_call_id:y,content:N});continue}let x=await C.function(I,this),w=Ft(this,Im,"m",mUt).call(this,x);if(this._addMessage({role:s,tool_call_id:y,content:w}),c)return}}}};Im=new WeakSet,BGe=function(){return Ft(this,Im,"m",Dhe).call(this).content??null},Dhe=function(){let e=this.messages.length;for(;e-- >0;){let n=this.messages[e];if(qG(n))return{...n,content:n.content??null,refusal:n.refusal??null}}throw new Wn("stream ended without producing a ChatCompletionMessage with role=assistant")},PGe=function(){for(let e=this.messages.length-1;e>=0;e--){let n=this.messages[e];if(qG(n)&&n?.tool_calls?.length)return n.tool_calls.filter(r=>r.type==="function").at(-1)?.function}},OGe=function(){for(let e=this.messages.length-1;e>=0;e--){let n=this.messages[e];if(RGe(n)&&n.content!=null&&typeof n.content=="string"&&this.messages.some(r=>r.role==="assistant"&&r.tool_calls?.some(s=>s.type==="function"&&s.id===n.tool_call_id)))return n.content}},MGe=function(){let e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:n}of this._chatCompletions)n&&(e.completion_tokens+=n.completion_tokens,e.prompt_tokens+=n.prompt_tokens,e.total_tokens+=n.total_tokens);return e},hUt=function(e){if(e.n!=null&&e.n>1)throw new Wn("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},mUt=function(e){return typeof e=="string"?e:e===void 0?"undefined":JSON.stringify(e)}});var dK,FGe=V(()=>{p();LGe();kGe();dK=class t extends VG{static runTools(e,n,r){let s=new t,i={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runTools"}};return s._run(()=>s._runTools(e,n,i)),s}_addMessage(e,n=!0){super._addMessage(e,n),qG(e)&&e.content&&this._emit("content",e.content)}}});function _Tr(t,e=Jd.ALL){if(typeof t!="string")throw new TypeError(`expecting str, got ${typeof t}`);if(!t.trim())throw new Error(`${t} is empty`);return STr(t.trim(),e)}var Jd,QGe,UGe,STr,$Ge,fUt=V(()=>{p();Jd={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,INF:384,SPECIAL:496,ATOM:499,COLLECTION:12,ALL:511},QGe=class extends Error{},UGe=class extends Error{};STr=(t,e)=>{let n=t.length,r=0,s=h=>{throw new QGe(`${h} at position ${r}`)},i=h=>{throw new UGe(`${h} at position ${r}`)},o=()=>(d(),r>=n&&s("Unexpected end of input"),t[r]==='"'?a():t[r]==="{"?c():t[r]==="["?u():t.substring(r,r+4)==="null"||Jd.NULL&e&&n-r<4&&"null".startsWith(t.substring(r))?(r+=4,null):t.substring(r,r+4)==="true"||Jd.BOOL&e&&n-r<4&&"true".startsWith(t.substring(r))?(r+=4,!0):t.substring(r,r+5)==="false"||Jd.BOOL&e&&n-r<5&&"false".startsWith(t.substring(r))?(r+=5,!1):t.substring(r,r+8)==="Infinity"||Jd.INFINITY&e&&n-r<8&&"Infinity".startsWith(t.substring(r))?(r+=8,1/0):t.substring(r,r+9)==="-Infinity"||Jd.MINUS_INFINITY&e&&1{let h=r,m=!1;for(r++;r{r++,d();let h={};try{for(;t[r]!=="}";){if(d(),r>=n&&Jd.OBJ&e)return h;let m=a();d(),r++;try{let f=o();Object.defineProperty(h,m,{value:f,writable:!0,enumerable:!0,configurable:!0})}catch(f){if(Jd.OBJ&e)return h;throw f}d(),t[r]===","&&r++}}catch{if(Jd.OBJ&e)return h;s("Expected '}' at end of object")}return r++,h},u=()=>{r++;let h=[];try{for(;t[r]!=="]";)h.push(o()),d(),t[r]===","&&r++}catch{if(Jd.ARR&e)return h;s("Expected ']' at end of array")}return r++,h},l=()=>{if(r===0){t==="-"&&Jd.NUM&e&&s("Not sure what '-' is");try{return JSON.parse(t)}catch(m){if(Jd.NUM&e)try{return t[t.length-1]==="."?JSON.parse(t.substring(0,t.lastIndexOf("."))):JSON.parse(t.substring(0,t.lastIndexOf("e")))}catch{}i(String(m))}}let h=r;for(t[r]==="-"&&r++;t[r]&&!",]}".includes(t[r]);)r++;r==n&&!(Jd.NUM&e)&&s("Unterminated number literal");try{return JSON.parse(t.substring(h,r))}catch{t.substring(h,r)==="-"&&Jd.NUM&e&&s("Not sure what '-' is");try{return JSON.parse(t.substring(h,t.lastIndexOf("e")))}catch(f){i(String(f))}}},d=()=>{for(;r_Tr(t,Jd.ALL^Jd.NUM)});var GGe=V(()=>{p();bGe()});function CTr(t,e){let{id:n,choices:r,created:s,model:i,system_fingerprint:o,...a}=t,c={...a,id:n,choices:r.map(({message:u,finish_reason:l,index:d,logprobs:h,...m})=>{if(!l)throw new Wn(`missing finish_reason for choice ${d}`);let{content:f=null,function_call:g,tool_calls:A,...y}=u,b=u.role;if(!b)throw new Wn(`missing role for choice ${d}`);if(g){let{arguments:S,name:C}=g;if(S==null)throw new Wn(`missing function_call.arguments for choice ${d}`);if(!C)throw new Wn(`missing function_call.name for choice ${d}`);return{...m,message:{content:f,function_call:{arguments:S,name:C},role:b,refusal:u.refusal??null},finish_reason:l,index:d,logprobs:h}}return A?{...m,index:d,finish_reason:l,logprobs:h,message:{...y,role:b,content:f,refusal:u.refusal??null,tool_calls:A.map((S,C)=>{let{function:I,type:x,id:w,...R}=S,{arguments:N,name:P,...G}=I||{};if(w==null)throw new Wn(`missing choices[${d}].tool_calls[${C}].id -${Ohe(t)}`);if(x==null)throw new Wn(`missing choices[${d}].tool_calls[${C}].type -${Ohe(t)}`);if(P==null)throw new Wn(`missing choices[${d}].tool_calls[${C}].function.name -${Ohe(t)}`);if(N==null)throw new Wn(`missing choices[${d}].tool_calls[${C}].function.arguments -${Ohe(t)}`);return{...R,id:w,type:x,function:{...G,name:P,arguments:N}}})}}:{...m,message:{...y,content:f,role:b,refusal:u.refusal??null},finish_reason:l,index:d,logprobs:h}}),created:s,model:i,object:"chat.completion",...o?{system_fingerprint:o}:{}};return aUt(c,e)}function Ohe(t){return JSON.stringify(t)}var pd,Yx,jG,ok,WGe,Bhe,qGe,HGe,VGe,Phe,jGe,gUt,vP,Mhe=V(()=>{p();EE();fUt();__();oK();GGe();LGe();vP=class t extends VG{constructor(e){super(),pd.add(this),Yx.set(this,void 0),jG.set(this,void 0),ok.set(this,void 0),Gr(this,Yx,e,"f"),Gr(this,jG,[],"f")}get currentChatCompletionSnapshot(){return Ft(this,ok,"f")}static fromReadableStream(e){let n=new t(null);return n._run(()=>n._fromReadableStream(e)),n}static createChatCompletion(e,n,r){let s=new t(n);return s._run(()=>s._runChatCompletion(e,{...n,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),s}async _createChatCompletion(e,n,r){super._createChatCompletion;let s=r?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),Ft(this,pd,"m",WGe).call(this);let i=await e.chat.completions.create({...n,stream:!0},{...r,signal:this.controller.signal});this._connected();for await(let o of i)Ft(this,pd,"m",qGe).call(this,o);if(i.controller.signal?.aborted)throw new Mu;return this._addChatCompletion(Ft(this,pd,"m",Phe).call(this))}async _fromReadableStream(e,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),Ft(this,pd,"m",WGe).call(this),this._connected();let s=fC.fromReadableStream(e,this.controller),i;for await(let o of s)i&&i!==o.id&&this._addChatCompletion(Ft(this,pd,"m",Phe).call(this)),Ft(this,pd,"m",qGe).call(this,o),i=o.id;if(s.controller.signal?.aborted)throw new Mu;return this._addChatCompletion(Ft(this,pd,"m",Phe).call(this))}[(Yx=new WeakMap,jG=new WeakMap,ok=new WeakMap,pd=new WeakSet,WGe=function(){this.ended||Gr(this,ok,void 0,"f")},Bhe=function(n){let r=Ft(this,jG,"f")[n.index];return r||(r={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},Ft(this,jG,"f")[n.index]=r,r)},qGe=function(n){if(this.ended)return;let r=Ft(this,pd,"m",gUt).call(this,n);this._emit("chunk",n,r);for(let s of n.choices){let i=r.choices[s.index];s.delta.content!=null&&i.message?.role==="assistant"&&i.message?.content&&(this._emit("content",s.delta.content,i.message.content),this._emit("content.delta",{delta:s.delta.content,snapshot:i.message.content,parsed:i.message.parsed})),s.delta.refusal!=null&&i.message?.role==="assistant"&&i.message?.refusal&&this._emit("refusal.delta",{delta:s.delta.refusal,snapshot:i.message.refusal}),s.logprobs?.content!=null&&i.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:s.logprobs?.content,snapshot:i.logprobs?.content??[]}),s.logprobs?.refusal!=null&&i.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:s.logprobs?.refusal,snapshot:i.logprobs?.refusal??[]});let o=Ft(this,pd,"m",Bhe).call(this,i);i.finish_reason&&(Ft(this,pd,"m",VGe).call(this,i),o.current_tool_call_index!=null&&Ft(this,pd,"m",HGe).call(this,i,o.current_tool_call_index));for(let a of s.delta.tool_calls??[])o.current_tool_call_index!==a.index&&(Ft(this,pd,"m",VGe).call(this,i),o.current_tool_call_index!=null&&Ft(this,pd,"m",HGe).call(this,i,o.current_tool_call_index)),o.current_tool_call_index=a.index;for(let a of s.delta.tool_calls??[]){let c=i.message.tool_calls?.[a.index];c?.type&&(c?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:c.function?.name,index:a.index,arguments:c.function.arguments,parsed_arguments:c.function.parsed_arguments,arguments_delta:a.function?.arguments??""}):(c?.type,void 0))}}},HGe=function(n,r){if(Ft(this,pd,"m",Bhe).call(this,n).done_tool_calls.has(r))return;let i=n.message.tool_calls?.[r];if(!i)throw new Error("no tool call snapshot");if(!i.type)throw new Error("tool call snapshot missing `type`");if(i.type==="function"){let o=Ft(this,Yx,"f")?.tools?.find(a=>rK(a)&&a.function.name===i.function.name);this._emit("tool_calls.function.arguments.done",{name:i.function.name,index:r,arguments:i.function.arguments,parsed_arguments:TP(o)?o.$parseRaw(i.function.arguments):o?.function.strict?JSON.parse(i.function.arguments):null})}else i.type},VGe=function(n){let r=Ft(this,pd,"m",Bhe).call(this,n);if(n.message.content&&!r.content_done){r.content_done=!0;let s=Ft(this,pd,"m",jGe).call(this);this._emit("content.done",{content:n.message.content,parsed:s?s.$parseRaw(n.message.content):null})}n.message.refusal&&!r.refusal_done&&(r.refusal_done=!0,this._emit("refusal.done",{refusal:n.message.refusal})),n.logprobs?.content&&!r.logprobs_content_done&&(r.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:n.logprobs.content})),n.logprobs?.refusal&&!r.logprobs_refusal_done&&(r.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:n.logprobs.refusal}))},Phe=function(){if(this.ended)throw new Wn("stream has ended, this shouldn't happen");let n=Ft(this,ok,"f");if(!n)throw new Wn("request ended without sending any chunks");return Gr(this,ok,void 0,"f"),Gr(this,jG,[],"f"),CTr(n,Ft(this,Yx,"f"))},jGe=function(){let n=Ft(this,Yx,"f")?.response_format;return sK(n)?n:null},gUt=function(n){var r,s,i,o;let a=Ft(this,ok,"f"),{choices:c,...u}=n;a?Object.assign(a,u):a=Gr(this,ok,{...u,choices:[]},"f");for(let{delta:l,finish_reason:d,index:h,logprobs:m=null,...f}of n.choices){let g=a.choices[h];if(g||(g=a.choices[h]={finish_reason:d,index:h,message:{},logprobs:m,...f}),m)if(!g.logprobs)g.logprobs=Object.assign({},m);else{let{content:x,refusal:w,...R}=m;Object.assign(g.logprobs,R),x&&((r=g.logprobs).content??(r.content=[]),g.logprobs.content.push(...x)),w&&((s=g.logprobs).refusal??(s.refusal=[]),g.logprobs.refusal.push(...w))}if(d&&(g.finish_reason=d,Ft(this,Yx,"f")&&vGe(Ft(this,Yx,"f")))){if(d==="length")throw new MG;if(d==="content_filter")throw new LG}if(Object.assign(g,f),!l)continue;let{content:A,refusal:y,function_call:b,role:S,tool_calls:C,...I}=l;if(Object.assign(g.message,I),y&&(g.message.refusal=(g.message.refusal||"")+y),S&&(g.message.role=S),b&&(g.message.function_call?(b.name&&(g.message.function_call.name=b.name),b.arguments&&((i=g.message.function_call).arguments??(i.arguments=""),g.message.function_call.arguments+=b.arguments)):g.message.function_call=b),A&&(g.message.content=(g.message.content||"")+A,!g.message.refusal&&Ft(this,pd,"m",jGe).call(this)&&(g.message.parsed=$Ge(g.message.content))),C){g.message.tool_calls||(g.message.tool_calls=[]);for(let{index:x,id:w,type:R,function:N,...P}of C){let G=(o=g.message.tool_calls)[x]??(o[x]={});Object.assign(G,P),w&&(G.id=w),R&&(G.type=R),N&&(G.function??(G.function={name:N.name??"",arguments:""})),N?.name&&(G.function.name=N.name),N?.arguments&&(G.function.arguments+=N.arguments,cUt(Ft(this,Yx,"f"),G)&&(G.function.parsed_arguments=$Ge(G.function.arguments)))}}}return a},Symbol.asyncIterator)](){let e=[],n=[],r=!1;return this.on("chunk",s=>{let i=n.shift();i?i.resolve(s):e.push(s)}),this.on("end",()=>{r=!0;for(let s of n)s.resolve(void 0);n.length=0}),this.on("abort",s=>{r=!0;for(let i of n)i.reject(s);n.length=0}),this.on("error",s=>{r=!0;for(let i of n)i.reject(s);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((i,o)=>n.push({resolve:i,reject:o})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new fC(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var pK,YGe=V(()=>{p();Mhe();pK=class t extends vP{static fromReadableStream(e){let n=new t(null);return n._run(()=>n._fromReadableStream(e)),n}static runTools(e,n,r){let s=new t(n),i={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runTools"}};return s._run(()=>s._runTools(e,n,i)),s}}});var Kx,hK=V(()=>{p();Rn();xhe();xhe();Es();vr();FGe();YGe();Mhe();oK();YGe();DGe();Mhe();FGe();Kx=class extends kt{constructor(){super(...arguments),this.messages=new wP(this._client)}create(e,n){return this._client.post("/chat/completions",{body:e,...n,stream:e.stream??!1,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(at`/chat/completions/${e}`,{...n,__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(at`/chat/completions/${e}`,{body:n,...r,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/chat/completions",Gs,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/chat/completions/${e}`,{...n,__security:{bearerAuth:!0}})}parse(e,n){return uUt(e.tools),this._client.chat.completions.create(e,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(r=>iK(r,e))}runTools(e,n){return e.stream?pK.runTools(this._client,e,n):dK.runTools(this._client,e,n)}stream(e,n){return vP.createChatCompletion(this._client,e,n)}};Kx.Messages=wP});var ak,KGe=V(()=>{p();Rn();hK();hK();ak=class extends kt{constructor(){super(...arguments),this.completions=new Kx(this._client)}};ak.Completions=Kx});var AUt=V(()=>{p();hK();hK();xhe()});var yUt=V(()=>{p();KGe();AUt()});var EUt=V(()=>{p()});var YG,zGe=V(()=>{p();Rn();Es();vr();YG=class extends kt{create(e,n){return this._client.post("/organization/admin_api_keys",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n){return this._client.get(at`/organization/admin_api_keys/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/admin_api_keys",Gs,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(at`/organization/admin_api_keys/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}}});var KG,JGe=V(()=>{p();Rn();Es();KG=class extends kt{list(e={},n){return this._client.getAPIList("/organization/audit_logs",mo,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}}});var zG,XGe=V(()=>{p();Rn();Es();vr();zG=class extends kt{create(e,n){return this._client.post("/organization/certificates",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n={},r){return this._client.get(at`/organization/certificates/${e}`,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(at`/organization/certificates/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/certificates",mo,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(at`/organization/certificates/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}activate(e,n){return this._client.getAPIList("/organization/certificates/activate",Th,{body:e,method:"post",...n,__security:{adminAPIKeyAuth:!0}})}deactivate(e,n){return this._client.getAPIList("/organization/certificates/deactivate",Th,{body:e,method:"post",...n,__security:{adminAPIKeyAuth:!0}})}}});var JG,ZGe=V(()=>{p();Rn();JG=class extends kt{retrieve(e){return this._client.get("/organization/data_retention",{...e,__security:{adminAPIKeyAuth:!0}})}update(e,n){return this._client.post("/organization/data_retention",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}}});var XG,eWe=V(()=>{p();Rn();Es();vr();XG=class extends kt{create(e,n){return this._client.post("/organization/invites",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n){return this._client.get(at`/organization/invites/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/invites",mo,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(at`/organization/invites/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}}});var ZG,tWe=V(()=>{p();Rn();Es();vr();ZG=class extends kt{create(e,n){return this._client.post("/organization/roles",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n){return this._client.get(at`/organization/roles/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(at`/organization/roles/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/roles",Lu,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(at`/organization/roles/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}}});var eW,nWe=V(()=>{p();Rn();Es();vr();eW=class extends kt{create(e,n){return this._client.post("/organization/spend_alerts",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(at`/organization/spend_alerts/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/spend_alerts",mo,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(at`/organization/spend_alerts/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}}});var tW,rWe=V(()=>{p();Rn();tW=class extends kt{audioSpeeches(e,n){return this._client.get("/organization/usage/audio_speeches",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}audioTranscriptions(e,n){return this._client.get("/organization/usage/audio_transcriptions",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}codeInterpreterSessions(e,n){return this._client.get("/organization/usage/code_interpreter_sessions",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}completions(e,n){return this._client.get("/organization/usage/completions",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}costs(e,n){return this._client.get("/organization/costs",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}embeddings(e,n){return this._client.get("/organization/usage/embeddings",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}fileSearchCalls(e,n){return this._client.get("/organization/usage/file_search_calls",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}images(e,n){return this._client.get("/organization/usage/images",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}moderations(e,n){return this._client.get("/organization/usage/moderations",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}vectorStores(e,n){return this._client.get("/organization/usage/vector_stores",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}webSearchCalls(e,n){return this._client.get("/organization/usage/web_search_calls",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}}});var nW,sWe=V(()=>{p();Rn();Es();vr();nW=class extends kt{create(e,n,r){return this._client.post(at`/organization/groups/${e}/roles`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{group_id:s}=n;return this._client.get(at`/organization/groups/${s}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/organization/groups/${e}/roles`,Lu,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{group_id:s}=n;return this._client.delete(at`/organization/groups/${s}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var rW,iWe=V(()=>{p();Rn();Es();vr();rW=class extends kt{create(e,n,r){return this._client.post(at`/organization/groups/${e}/users`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{group_id:s}=n;return this._client.get(at`/organization/groups/${s}/users/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/organization/groups/${e}/users`,Lu,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{group_id:s}=n;return this._client.delete(at`/organization/groups/${s}/users/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var ck,oWe=V(()=>{p();Rn();sWe();sWe();iWe();iWe();Es();vr();ck=class extends kt{constructor(){super(...arguments),this.users=new rW(this._client),this.roles=new nW(this._client)}create(e,n){return this._client.post("/organization/groups",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n){return this._client.get(at`/organization/groups/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(at`/organization/groups/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/groups",Lu,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(at`/organization/groups/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}};ck.Users=rW;ck.Roles=nW});var sW,aWe=V(()=>{p();Rn();Es();vr();sW=class extends kt{retrieve(e,n,r){let{project_id:s}=n;return this._client.get(at`/organization/projects/${s}/api_keys/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/organization/projects/${e}/api_keys`,mo,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:s}=n;return this._client.delete(at`/organization/projects/${s}/api_keys/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var iW,cWe=V(()=>{p();Rn();Es();vr();iW=class extends kt{list(e,n={},r){return this._client.getAPIList(at`/organization/projects/${e}/certificates`,mo,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}activate(e,n,r){return this._client.getAPIList(at`/organization/projects/${e}/certificates/activate`,Th,{body:n,method:"post",...r,__security:{adminAPIKeyAuth:!0}})}deactivate(e,n,r){return this._client.getAPIList(at`/organization/projects/${e}/certificates/deactivate`,Th,{body:n,method:"post",...r,__security:{adminAPIKeyAuth:!0}})}}});var oW,lWe=V(()=>{p();Rn();vr();oW=class extends kt{retrieve(e,n){return this._client.get(at`/organization/projects/${e}/data_retention`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(at`/organization/projects/${e}/data_retention`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}}});var aW,uWe=V(()=>{p();Rn();vr();aW=class extends kt{retrieve(e,n){return this._client.get(at`/organization/projects/${e}/hosted_tool_permissions`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(at`/organization/projects/${e}/hosted_tool_permissions`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}}});var cW,dWe=V(()=>{p();Rn();vr();cW=class extends kt{retrieve(e,n){return this._client.get(at`/organization/projects/${e}/model_permissions`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(at`/organization/projects/${e}/model_permissions`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(at`/organization/projects/${e}/model_permissions`,{...n,__security:{adminAPIKeyAuth:!0}})}}});var lW,pWe=V(()=>{p();Rn();Es();vr();lW=class extends kt{listRateLimits(e,n={},r){return this._client.getAPIList(at`/organization/projects/${e}/rate_limits`,mo,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}updateRateLimit(e,n,r){let{project_id:s,...i}=n;return this._client.post(at`/organization/projects/${s}/rate_limits/${e}`,{body:i,...r,__security:{adminAPIKeyAuth:!0}})}}});var uW,hWe=V(()=>{p();Rn();Es();vr();uW=class extends kt{create(e,n,r){return this._client.post(at`/projects/${e}/roles`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:s}=n;return this._client.get(at`/projects/${s}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){let{project_id:s,...i}=n;return this._client.post(at`/projects/${s}/roles/${e}`,{body:i,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/projects/${e}/roles`,Lu,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:s}=n;return this._client.delete(at`/projects/${s}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var dW,mWe=V(()=>{p();Rn();Es();vr();dW=class extends kt{create(e,n,r){return this._client.post(at`/organization/projects/${e}/service_accounts`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:s}=n;return this._client.get(at`/organization/projects/${s}/service_accounts/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){let{project_id:s,...i}=n;return this._client.post(at`/organization/projects/${s}/service_accounts/${e}`,{body:i,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/organization/projects/${e}/service_accounts`,mo,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:s}=n;return this._client.delete(at`/organization/projects/${s}/service_accounts/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var pW,fWe=V(()=>{p();Rn();Es();vr();pW=class extends kt{create(e,n,r){return this._client.post(at`/organization/projects/${e}/spend_alerts`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){let{project_id:s,...i}=n;return this._client.post(at`/organization/projects/${s}/spend_alerts/${e}`,{body:i,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/organization/projects/${e}/spend_alerts`,mo,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:s}=n;return this._client.delete(at`/organization/projects/${s}/spend_alerts/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var hW,gWe=V(()=>{p();Rn();Es();vr();hW=class extends kt{create(e,n,r){let{project_id:s,...i}=n;return this._client.post(at`/projects/${s}/groups/${e}/roles`,{body:i,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:s,group_id:i}=n;return this._client.get(at`/projects/${s}/groups/${i}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n,r){let{project_id:s,...i}=n;return this._client.getAPIList(at`/projects/${s}/groups/${e}/roles`,Lu,{query:i,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:s,group_id:i}=n;return this._client.delete(at`/projects/${s}/groups/${i}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var RP,AWe=V(()=>{p();Rn();gWe();gWe();Es();vr();RP=class extends kt{constructor(){super(...arguments),this.roles=new hW(this._client)}create(e,n,r){return this._client.post(at`/organization/projects/${e}/groups`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:s,...i}=n;return this._client.get(at`/organization/projects/${s}/groups/${e}`,{query:i,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/organization/projects/${e}/groups`,Lu,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:s}=n;return this._client.delete(at`/organization/projects/${s}/groups/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}};RP.Roles=hW});var mW,yWe=V(()=>{p();Rn();Es();vr();mW=class extends kt{create(e,n,r){let{project_id:s,...i}=n;return this._client.post(at`/projects/${s}/users/${e}/roles`,{body:i,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:s,user_id:i}=n;return this._client.get(at`/projects/${s}/users/${i}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n,r){let{project_id:s,...i}=n;return this._client.getAPIList(at`/projects/${s}/users/${e}/roles`,Lu,{query:i,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:s,user_id:i}=n;return this._client.delete(at`/projects/${s}/users/${i}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var kP,EWe=V(()=>{p();Rn();yWe();yWe();Es();vr();kP=class extends kt{constructor(){super(...arguments),this.roles=new mW(this._client)}create(e,n,r){return this._client.post(at`/organization/projects/${e}/users`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:s}=n;return this._client.get(at`/organization/projects/${s}/users/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){let{project_id:s,...i}=n;return this._client.post(at`/organization/projects/${s}/users/${e}`,{body:i,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/organization/projects/${e}/users`,mo,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:s}=n;return this._client.delete(at`/organization/projects/${s}/users/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}};kP.Roles=mW});var Fp,bWe=V(()=>{p();Rn();aWe();aWe();cWe();cWe();lWe();lWe();uWe();uWe();dWe();dWe();pWe();pWe();hWe();hWe();mWe();mWe();fWe();fWe();AWe();AWe();EWe();EWe();Es();vr();Fp=class extends kt{constructor(){super(...arguments),this.users=new kP(this._client),this.serviceAccounts=new dW(this._client),this.apiKeys=new sW(this._client),this.rateLimits=new lW(this._client),this.modelPermissions=new cW(this._client),this.hostedToolPermissions=new aW(this._client),this.groups=new RP(this._client),this.roles=new uW(this._client),this.dataRetention=new oW(this._client),this.spendAlerts=new pW(this._client),this.certificates=new iW(this._client)}create(e,n){return this._client.post("/organization/projects",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n){return this._client.get(at`/organization/projects/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(at`/organization/projects/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/projects",mo,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}archive(e,n){return this._client.post(at`/organization/projects/${e}/archive`,{...n,__security:{adminAPIKeyAuth:!0}})}};Fp.Users=kP;Fp.ServiceAccounts=dW;Fp.APIKeys=sW;Fp.RateLimits=lW;Fp.ModelPermissions=cW;Fp.HostedToolPermissions=aW;Fp.Groups=RP;Fp.Roles=uW;Fp.DataRetention=oW;Fp.SpendAlerts=pW;Fp.Certificates=iW});var fW,_We=V(()=>{p();Rn();Es();vr();fW=class extends kt{create(e,n,r){return this._client.post(at`/organization/users/${e}/roles`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{user_id:s}=n;return this._client.get(at`/organization/users/${s}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/organization/users/${e}/roles`,Lu,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{user_id:s}=n;return this._client.delete(at`/organization/users/${s}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var NP,SWe=V(()=>{p();Rn();_We();_We();Es();vr();NP=class extends kt{constructor(){super(...arguments),this.roles=new fW(this._client)}retrieve(e,n){return this._client.get(at`/organization/users/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(at`/organization/users/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/users",mo,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(at`/organization/users/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}};NP.Roles=fW});var Qp,CWe=V(()=>{p();Rn();zGe();zGe();JGe();JGe();XGe();XGe();ZGe();ZGe();eWe();eWe();tWe();tWe();nWe();nWe();rWe();rWe();oWe();oWe();bWe();bWe();SWe();SWe();Qp=class extends kt{constructor(){super(...arguments),this.auditLogs=new KG(this._client),this.adminAPIKeys=new YG(this._client),this.usage=new tW(this._client),this.invites=new XG(this._client),this.users=new NP(this._client),this.groups=new ck(this._client),this.roles=new ZG(this._client),this.dataRetention=new JG(this._client),this.spendAlerts=new eW(this._client),this.certificates=new zG(this._client),this.projects=new Fp(this._client)}};Qp.AuditLogs=KG;Qp.AdminAPIKeys=YG;Qp.Usage=tW;Qp.Invites=XG;Qp.Users=NP;Qp.Groups=ck;Qp.Roles=ZG;Qp.DataRetention=JG;Qp.SpendAlerts=eW;Qp.Certificates=zG;Qp.Projects=Fp});var lk,IWe=V(()=>{p();Rn();CWe();CWe();lk=class extends kt{constructor(){super(...arguments),this.organization=new Qp(this._client)}};lk.Organization=Qp});function*ZTr(t){if(!t)return;if(bUt in t){let{values:r,nulls:s}=t;yield*r.entries();for(let i of s)yield[i,null];return}let e=!1,n;t instanceof Headers?n=t.entries():nGe(t)?n=t:(e=!0,n=Object.entries(t??{}));for(let r of n){let s=r[0];if(typeof s!="string")throw new TypeError("expected header name to be a string");let i=nGe(r[1])?r[1]:[r[1]],o=!1;for(let a of i)a!==void 0&&(e&&!o&&(o=!0,yield[s,null]),yield[s,a])}}var bUt,In,za=V(()=>{p();Hx();bUt=Symbol("brand.privateNullableHeaders");In=t=>{let e=new Headers,n=new Set;for(let r of t){let s=new Set;for(let[i,o]of ZTr(r)){let a=i.toLowerCase();s.has(a)||(e.delete(i),s.add(a)),o===null?(e.delete(i),n.add(a)):(e.append(i,o),n.delete(a))}}return{[bUt]:!0,values:e,nulls:n}}});var gW,xWe=V(()=>{p();Rn();za();gW=class extends kt{create(e,n){return this._client.post("/audio/speech",{body:e,...n,headers:In([{Accept:"application/octet-stream"},n?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}});var AW,wWe=V(()=>{p();Rn();_E();AW=class extends kt{create(e,n){return this._client.post("/audio/transcriptions",vh({body:e,...n,stream:e.stream??!1,__metadata:{model:e.model},__security:{bearerAuth:!0}},this._client))}}});var yW,TWe=V(()=>{p();Rn();_E();yW=class extends kt{create(e,n){return this._client.post("/audio/translations",vh({body:e,...n,__metadata:{model:e.model},__security:{bearerAuth:!0}},this._client))}}});var gC,vWe=V(()=>{p();Rn();xWe();xWe();wWe();wWe();TWe();TWe();gC=class extends kt{constructor(){super(...arguments),this.transcriptions=new AW(this._client),this.translations=new yW(this._client),this.speech=new gW(this._client)}};gC.Transcriptions=AW;gC.Translations=yW;gC.Speech=gW});var DP,RWe=V(()=>{p();Rn();Es();vr();DP=class extends kt{create(e,n){return this._client.post("/batches",{body:e,...n,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(at`/batches/${e}`,{...n,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/batches",Gs,{query:e,...n,__security:{bearerAuth:!0}})}cancel(e,n){return this._client.post(at`/batches/${e}/cancel`,{...n,__security:{bearerAuth:!0}})}}});var EW,kWe=V(()=>{p();Rn();Es();za();vr();EW=class extends kt{create(e,n){return this._client.post("/assistants",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(at`/assistants/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(at`/assistants/${e}`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/assistants",Gs,{query:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/assistants/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}}});var bW,NWe=V(()=>{p();Rn();za();bW=class extends kt{create(e,n){return this._client.post("/realtime/sessions",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}}});var _W,DWe=V(()=>{p();Rn();za();_W=class extends kt{create(e,n){return this._client.post("/realtime/transcription_sessions",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}}});var uk,BWe=V(()=>{p();Rn();NWe();NWe();DWe();DWe();uk=class extends kt{constructor(){super(...arguments),this.sessions=new bW(this._client),this.transcriptionSessions=new _W(this._client)}};uk.Sessions=bW;uk.TranscriptionSessions=_W});var SW,PWe=V(()=>{p();Rn();za();vr();SW=class extends kt{create(e,n){return this._client.post("/chatkit/sessions",{body:e,...n,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers]),__security:{bearerAuth:!0}})}cancel(e,n){return this._client.post(at`/chatkit/sessions/${e}/cancel`,{...n,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers]),__security:{bearerAuth:!0}})}}});var CW,OWe=V(()=>{p();Rn();Es();za();vr();CW=class extends kt{retrieve(e,n){return this._client.get(at`/chatkit/threads/${e}`,{...n,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers]),__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/chatkit/threads",mo,{query:e,...n,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers]),__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/chatkit/threads/${e}`,{...n,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers]),__security:{bearerAuth:!0}})}listItems(e,n={},r){return this._client.getAPIList(at`/chatkit/threads/${e}/items`,mo,{query:n,...r,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers]),__security:{bearerAuth:!0}})}}});var dk,MWe=V(()=>{p();Rn();PWe();PWe();OWe();OWe();dk=class extends kt{constructor(){super(...arguments),this.sessions=new SW(this._client),this.threads=new CW(this._client)}};dk.Sessions=SW;dk.Threads=CW});var IW,LWe=V(()=>{p();Rn();Es();za();vr();IW=class extends kt{create(e,n,r){return this._client.post(at`/threads/${e}/messages`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n,r){let{thread_id:s}=n;return this._client.get(at`/threads/${s}/messages/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){let{thread_id:s,...i}=n;return this._client.post(at`/threads/${s}/messages/${e}`,{body:i,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/threads/${e}/messages`,Gs,{query:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}delete(e,n,r){let{thread_id:s}=n;return this._client.delete(at`/threads/${s}/messages/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}}});var xW,FWe=V(()=>{p();Rn();Es();za();vr();xW=class extends kt{retrieve(e,n,r){let{thread_id:s,run_id:i,...o}=n;return this._client.get(at`/threads/${s}/runs/${i}/steps/${e}`,{query:o,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e,n,r){let{thread_id:s,...i}=n;return this._client.getAPIList(at`/threads/${s}/runs/${e}/steps`,Gs,{query:i,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}}});var _Ut,SUt=V(()=>{p();bE();ghe();_Ut=t=>{if(typeof Buffer<"u"){let e=Buffer.from(t,"base64");return Array.from(new Float32Array(e.buffer,e.byteOffset,e.length/Float32Array.BYTES_PER_ELEMENT))}else{let e=atob(t),n=e.length,r=new Uint8Array(n);for(let s=0;s{p();fA=t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0}});var mK=V(()=>{p();Hx();SUt();QWe();X9();tGe();QG();gGe()});var Up,PP,UWe,AC,Lhe,S_,OP,wW,BP,Uhe,gA,Fhe,Qhe,AK,fK,gK,CUt,IUt,xUt,wUt,TUt,vUt,RUt,zx,$We=V(()=>{p();EE();GGe();__();Nhe();mK();zx=class extends ik{constructor(){super(...arguments),Up.add(this),UWe.set(this,[]),AC.set(this,{}),Lhe.set(this,{}),S_.set(this,void 0),OP.set(this,void 0),wW.set(this,void 0),BP.set(this,void 0),Uhe.set(this,void 0),gA.set(this,void 0),Fhe.set(this,void 0),Qhe.set(this,void 0),AK.set(this,void 0)}[(UWe=new WeakMap,AC=new WeakMap,Lhe=new WeakMap,S_=new WeakMap,OP=new WeakMap,wW=new WeakMap,BP=new WeakMap,Uhe=new WeakMap,gA=new WeakMap,Fhe=new WeakMap,Qhe=new WeakMap,AK=new WeakMap,Up=new WeakSet,Symbol.asyncIterator)](){let e=[],n=[],r=!1;return this.on("event",s=>{let i=n.shift();i?i.resolve(s):e.push(s)}),this.on("end",()=>{r=!0;for(let s of n)s.resolve(void 0);n.length=0}),this.on("abort",s=>{r=!0;for(let i of n)i.reject(s);n.length=0}),this.on("error",s=>{r=!0;for(let i of n)i.reject(s);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((i,o)=>n.push({resolve:i,reject:o})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(e){let n=new PP;return n._run(()=>n._fromReadableStream(e)),n}async _fromReadableStream(e,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),this._connected();let s=fC.fromReadableStream(e,this.controller);for await(let i of s)Ft(this,Up,"m",fK).call(this,i);if(s.controller.signal?.aborted)throw new Mu;return this._addRun(Ft(this,Up,"m",gK).call(this))}toReadableStream(){return new fC(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(e,n,r,s){let i=new PP;return i._run(()=>i._runToolAssistantStream(e,n,r,{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),i}async _createToolAssistantStream(e,n,r,s){let i=s?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort()));let o={...r,stream:!0},a=await e.submitToolOutputs(n,o,{...s,signal:this.controller.signal});this._connected();for await(let c of a)Ft(this,Up,"m",fK).call(this,c);if(a.controller.signal?.aborted)throw new Mu;return this._addRun(Ft(this,Up,"m",gK).call(this))}static createThreadAssistantStream(e,n,r){let s=new PP;return s._run(()=>s._threadAssistantStream(e,n,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),s}static createAssistantStream(e,n,r,s){let i=new PP;return i._run(()=>i._runAssistantStream(e,n,r,{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),i}currentEvent(){return Ft(this,Fhe,"f")}currentRun(){return Ft(this,Qhe,"f")}currentMessageSnapshot(){return Ft(this,S_,"f")}currentRunStepSnapshot(){return Ft(this,AK,"f")}async finalRunSteps(){return await this.done(),Object.values(Ft(this,AC,"f"))}async finalMessages(){return await this.done(),Object.values(Ft(this,Lhe,"f"))}async finalRun(){if(await this.done(),!Ft(this,OP,"f"))throw Error("Final run was not received.");return Ft(this,OP,"f")}async _createThreadAssistantStream(e,n,r){let s=r?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort()));let i={...n,stream:!0},o=await e.createAndRun(i,{...r,signal:this.controller.signal});this._connected();for await(let a of o)Ft(this,Up,"m",fK).call(this,a);if(o.controller.signal?.aborted)throw new Mu;return this._addRun(Ft(this,Up,"m",gK).call(this))}async _createAssistantStream(e,n,r,s){let i=s?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort()));let o={...r,stream:!0},a=await e.create(n,o,{...s,signal:this.controller.signal});this._connected();for await(let c of a)Ft(this,Up,"m",fK).call(this,c);if(a.controller.signal?.aborted)throw new Mu;return this._addRun(Ft(this,Up,"m",gK).call(this))}static accumulateDelta(e,n){for(let[r,s]of Object.entries(n)){if(!e.hasOwnProperty(r)){e[r]=s;continue}let i=e[r];if(i==null){e[r]=s;continue}if(r==="index"||r==="type"){e[r]=s;continue}if(typeof i=="string"&&typeof s=="string")i+=s;else if(typeof i=="number"&&typeof s=="number")i+=s;else if(FG(i)&&FG(s))i=this.accumulateDelta(i,s);else if(Array.isArray(i)&&Array.isArray(s)){if(i.every(o=>typeof o=="string"||typeof o=="number")){i.push(...s);continue}for(let o of s){if(!FG(o))throw new Error(`Expected array delta entry to be an object but got: ${o}`);let a=o.index;if(a==null)throw console.error(o),new Error("Expected array delta entry to have an `index` property");if(typeof a!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${a}`);let c=i[a];c==null?i.push(o):i[a]=this.accumulateDelta(c,o)}continue}else throw Error(`Unhandled record type: ${r}, deltaValue: ${s}, accValue: ${i}`);e[r]=i}return e}_addRun(e){return e}async _threadAssistantStream(e,n,r){return await this._createThreadAssistantStream(n,e,r)}async _runAssistantStream(e,n,r,s){return await this._createAssistantStream(n,e,r,s)}async _runToolAssistantStream(e,n,r,s){return await this._createToolAssistantStream(n,e,r,s)}};PP=zx,fK=function(e){if(!this.ended)switch(Gr(this,Fhe,e,"f"),Ft(this,Up,"m",xUt).call(this,e),e.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":Ft(this,Up,"m",RUt).call(this,e);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":Ft(this,Up,"m",IUt).call(this,e);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":Ft(this,Up,"m",CUt).call(this,e);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier");default:}},gK=function(){if(this.ended)throw new Wn("stream has ended, this shouldn't happen");if(!Ft(this,OP,"f"))throw Error("Final run has not been received");return Ft(this,OP,"f")},CUt=function(e){let[n,r]=Ft(this,Up,"m",TUt).call(this,e,Ft(this,S_,"f"));Gr(this,S_,n,"f"),Ft(this,Lhe,"f")[n.id]=n;for(let s of r){let i=n.content[s.index];i?.type=="text"&&this._emit("textCreated",i.text)}switch(e.event){case"thread.message.created":this._emit("messageCreated",e.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",e.data.delta,n),e.data.delta.content)for(let s of e.data.delta.content){if(s.type=="text"&&s.text){let i=s.text,o=n.content[s.index];if(o&&o.type=="text")this._emit("textDelta",i,o.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(s.index!=Ft(this,wW,"f")){if(Ft(this,BP,"f"))switch(Ft(this,BP,"f").type){case"text":this._emit("textDone",Ft(this,BP,"f").text,Ft(this,S_,"f"));break;case"image_file":this._emit("imageFileDone",Ft(this,BP,"f").image_file,Ft(this,S_,"f"));break}Gr(this,wW,s.index,"f")}Gr(this,BP,n.content[s.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(Ft(this,wW,"f")!==void 0){let s=e.data.content[Ft(this,wW,"f")];if(s)switch(s.type){case"image_file":this._emit("imageFileDone",s.image_file,Ft(this,S_,"f"));break;case"text":this._emit("textDone",s.text,Ft(this,S_,"f"));break}}Ft(this,S_,"f")&&this._emit("messageDone",e.data),Gr(this,S_,void 0,"f")}},IUt=function(e){let n=Ft(this,Up,"m",wUt).call(this,e);switch(Gr(this,AK,n,"f"),e.event){case"thread.run.step.created":this._emit("runStepCreated",e.data);break;case"thread.run.step.delta":let r=e.data.delta;if(r.step_details&&r.step_details.type=="tool_calls"&&r.step_details.tool_calls&&n.step_details.type=="tool_calls")for(let i of r.step_details.tool_calls)i.index==Ft(this,Uhe,"f")?this._emit("toolCallDelta",i,n.step_details.tool_calls[i.index]):(Ft(this,gA,"f")&&this._emit("toolCallDone",Ft(this,gA,"f")),Gr(this,Uhe,i.index,"f"),Gr(this,gA,n.step_details.tool_calls[i.index],"f"),Ft(this,gA,"f")&&this._emit("toolCallCreated",Ft(this,gA,"f")));this._emit("runStepDelta",e.data.delta,n);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":Gr(this,AK,void 0,"f"),e.data.step_details.type=="tool_calls"&&Ft(this,gA,"f")&&(this._emit("toolCallDone",Ft(this,gA,"f")),Gr(this,gA,void 0,"f")),this._emit("runStepDone",e.data,n);break;case"thread.run.step.in_progress":break}},xUt=function(e){Ft(this,UWe,"f").push(e),this._emit("event",e)},wUt=function(e){switch(e.event){case"thread.run.step.created":return Ft(this,AC,"f")[e.data.id]=e.data,e.data;case"thread.run.step.delta":let n=Ft(this,AC,"f")[e.data.id];if(!n)throw Error("Received a RunStepDelta before creation of a snapshot");let r=e.data;if(r.delta){let s=PP.accumulateDelta(n,r.delta);Ft(this,AC,"f")[e.data.id]=s}return Ft(this,AC,"f")[e.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":Ft(this,AC,"f")[e.data.id]=e.data;break}if(Ft(this,AC,"f")[e.data.id])return Ft(this,AC,"f")[e.data.id];throw new Error("No snapshot available")},TUt=function(e,n){let r=[];switch(e.event){case"thread.message.created":return[e.data,r];case"thread.message.delta":if(!n)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let s=e.data;if(s.delta.content)for(let i of s.delta.content)if(i.index in n.content){let o=n.content[i.index];n.content[i.index]=Ft(this,Up,"m",vUt).call(this,i,o)}else n.content[i.index]=i,r.push(i);return[n,r];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(n)return[n,r];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},vUt=function(e,n){return PP.accumulateDelta(n,e)},RUt=function(e){switch(Gr(this,Qhe,e.data,"f"),e.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":Gr(this,OP,e.data,"f"),Ft(this,gA,"f")&&(this._emit("toolCallDone",Ft(this,gA,"f")),Gr(this,gA,void 0,"f"));break;case"thread.run.cancelling":break}}});var MP,GWe=V(()=>{p();Rn();FWe();FWe();Es();za();$We();QG();vr();MP=class extends kt{constructor(){super(...arguments),this.steps=new xW(this._client)}create(e,n,r){let{include:s,...i}=n;return this._client.post(at`/threads/${e}/runs`,{query:{include:s},body:i,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),stream:n.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}retrieve(e,n,r){let{thread_id:s}=n;return this._client.get(at`/threads/${s}/runs/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){let{thread_id:s,...i}=n;return this._client.post(at`/threads/${s}/runs/${e}`,{body:i,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/threads/${e}/runs`,Gs,{query:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}cancel(e,n,r){let{thread_id:s}=n;return this._client.post(at`/threads/${s}/runs/${e}/cancel`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}async createAndPoll(e,n,r){let s=await this.create(e,n,r);return await this.poll(s.id,{thread_id:e},r)}createAndStream(e,n,r){return zx.createAssistantStream(e,this._client.beta.threads.runs,n,r)}async poll(e,n,r){let s=In([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:i,response:o}=await this.retrieve(e,n,{...r,headers:{...r?.headers,...s}}).withResponse();switch(i.status){case"queued":case"in_progress":case"cancelling":let a=5e3;if(r?.pollIntervalMs)a=r.pollIntervalMs;else{let c=o.headers.get("openai-poll-after-ms");if(c){let u=parseInt(c);isNaN(u)||(a=u)}}await hC(a);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return i}}}stream(e,n,r){return zx.createAssistantStream(e,this._client.beta.threads.runs,n,r)}submitToolOutputs(e,n,r){let{thread_id:s,...i}=n;return this._client.post(at`/threads/${s}/runs/${e}/submit_tool_outputs`,{body:i,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),stream:n.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}async submitToolOutputsAndPoll(e,n,r){let s=await this.submitToolOutputs(e,n,r);return await this.poll(s.id,n,r)}submitToolOutputsStream(e,n,r){return zx.createToolAssistantStream(e,this._client.beta.threads.runs,n,r)}};MP.Steps=xW});var pk,WWe=V(()=>{p();Rn();LWe();LWe();GWe();GWe();za();$We();vr();pk=class extends kt{constructor(){super(...arguments),this.runs=new MP(this._client),this.messages=new IW(this._client)}create(e={},n){return this._client.post("/threads",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(at`/threads/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(at`/threads/${e}`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/threads/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}createAndRun(e,n){return this._client.post("/threads/runs",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),stream:e.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}async createAndRunPoll(e,n){let r=await this.createAndRun(e,n);return await this.runs.poll(r.id,{thread_id:r.thread_id},n)}createAndRunStream(e,n){return zx.createThreadAssistantStream(e,this._client.beta.threads,n)}};pk.Runs=MP;pk.Messages=IW});var C_,qWe=V(()=>{p();Rn();kWe();kWe();BWe();BWe();MWe();MWe();WWe();WWe();C_=class extends kt{constructor(){super(...arguments),this.realtime=new uk(this._client),this.chatkit=new dk(this._client),this.assistants=new EW(this._client),this.threads=new pk(this._client)}};C_.Realtime=uk;C_.ChatKit=dk;C_.Assistants=EW;C_.Threads=pk});var LP,HWe=V(()=>{p();Rn();LP=class extends kt{create(e,n){return this._client.post("/completions",{body:e,...n,stream:e.stream??!1,__security:{bearerAuth:!0}})}}});var TW,VWe=V(()=>{p();Rn();za();vr();TW=class extends kt{retrieve(e,n,r){let{container_id:s}=n;return this._client.get(at`/containers/${s}/files/${e}/content`,{...r,headers:In([{Accept:"application/binary"},r?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}});var FP,jWe=V(()=>{p();Rn();VWe();VWe();Es();za();_E();vr();FP=class extends kt{constructor(){super(...arguments),this.content=new TW(this._client)}create(e,n,r){return this._client.post(at`/containers/${e}/files`,sk({body:n,...r,__security:{bearerAuth:!0}},this._client))}retrieve(e,n,r){let{container_id:s}=n;return this._client.get(at`/containers/${s}/files/${e}`,{...r,__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/containers/${e}/files`,Gs,{query:n,...r,__security:{bearerAuth:!0}})}delete(e,n,r){let{container_id:s}=n;return this._client.delete(at`/containers/${s}/files/${e}`,{...r,headers:In([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}};FP.Content=TW});var hk,YWe=V(()=>{p();Rn();jWe();jWe();Es();za();vr();hk=class extends kt{constructor(){super(...arguments),this.files=new FP(this._client)}create(e,n){return this._client.post("/containers",{body:e,...n,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(at`/containers/${e}`,{...n,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/containers",Gs,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/containers/${e}`,{...n,headers:In([{Accept:"*/*"},n?.headers]),__security:{bearerAuth:!0}})}};hk.Files=FP});var vW,KWe=V(()=>{p();Rn();Es();vr();vW=class extends kt{create(e,n,r){let{include:s,...i}=n;return this._client.post(at`/conversations/${e}/items`,{query:{include:s},body:i,...r,__security:{bearerAuth:!0}})}retrieve(e,n,r){let{conversation_id:s,...i}=n;return this._client.get(at`/conversations/${s}/items/${e}`,{query:i,...r,__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/conversations/${e}/items`,mo,{query:n,...r,__security:{bearerAuth:!0}})}delete(e,n,r){let{conversation_id:s}=n;return this._client.delete(at`/conversations/${s}/items/${e}`,{...r,__security:{bearerAuth:!0}})}}});var mk,zWe=V(()=>{p();Rn();KWe();KWe();vr();mk=class extends kt{constructor(){super(...arguments),this.items=new vW(this._client)}create(e={},n){return this._client.post("/conversations",{body:e,...n,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(at`/conversations/${e}`,{...n,__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(at`/conversations/${e}`,{body:n,...r,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/conversations/${e}`,{...n,__security:{bearerAuth:!0}})}};mk.Items=vW});var QP,JWe=V(()=>{p();Rn();mK();QP=class extends kt{create(e,n){let r=!!e.encoding_format,s=r?e.encoding_format:"base64";r&&du(this._client).debug("embeddings/user defined encoding_format:",e.encoding_format);let i=this._client.post("/embeddings",{body:{...e,encoding_format:s},...n,__security:{bearerAuth:!0}});return r?i:(du(this._client).debug("embeddings/decoding base64 embeddings from base64"),i._thenUnwrap(o=>(o&&o.data&&o.data.forEach(a=>{let c=a.embedding;a.embedding=_Ut(c)}),o)))}}});var RW,XWe=V(()=>{p();Rn();Es();vr();RW=class extends kt{retrieve(e,n,r){let{eval_id:s,run_id:i}=n;return this._client.get(at`/evals/${s}/runs/${i}/output_items/${e}`,{...r,__security:{bearerAuth:!0}})}list(e,n,r){let{eval_id:s,...i}=n;return this._client.getAPIList(at`/evals/${s}/runs/${e}/output_items`,Gs,{query:i,...r,__security:{bearerAuth:!0}})}}});var UP,ZWe=V(()=>{p();Rn();XWe();XWe();Es();vr();UP=class extends kt{constructor(){super(...arguments),this.outputItems=new RW(this._client)}create(e,n,r){return this._client.post(at`/evals/${e}/runs`,{body:n,...r,__security:{bearerAuth:!0}})}retrieve(e,n,r){let{eval_id:s}=n;return this._client.get(at`/evals/${s}/runs/${e}`,{...r,__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/evals/${e}/runs`,Gs,{query:n,...r,__security:{bearerAuth:!0}})}delete(e,n,r){let{eval_id:s}=n;return this._client.delete(at`/evals/${s}/runs/${e}`,{...r,__security:{bearerAuth:!0}})}cancel(e,n,r){let{eval_id:s}=n;return this._client.post(at`/evals/${s}/runs/${e}`,{...r,__security:{bearerAuth:!0}})}};UP.OutputItems=RW});var fk,eqe=V(()=>{p();Rn();ZWe();ZWe();Es();vr();fk=class extends kt{constructor(){super(...arguments),this.runs=new UP(this._client)}create(e,n){return this._client.post("/evals",{body:e,...n,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(at`/evals/${e}`,{...n,__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(at`/evals/${e}`,{body:n,...r,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/evals",Gs,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/evals/${e}`,{...n,__security:{bearerAuth:!0}})}};fk.Runs=UP});var $P,tqe=V(()=>{p();Rn();Es();za();QG();__();_E();vr();$P=class extends kt{create(e,n){return this._client.post("/files",vh({body:e,...n,__security:{bearerAuth:!0}},this._client))}retrieve(e,n){return this._client.get(at`/files/${e}`,{...n,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/files",Gs,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/files/${e}`,{...n,__security:{bearerAuth:!0}})}content(e,n){return this._client.get(at`/files/${e}/content`,{...n,headers:In([{Accept:"application/binary"},n?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}async waitForProcessing(e,{pollInterval:n=5e3,maxWait:r=1800*1e3}={}){let s=new Set(["processed","error","deleted"]),i=Date.now(),o=await this.retrieve(e);for(;!o.status||!s.has(o.status);)if(await hC(n),o=await this.retrieve(e),Date.now()-i>r)throw new nk({message:`Giving up on waiting for file ${e} to finish processing after ${r} milliseconds.`});return o}}});var kW,nqe=V(()=>{p();Rn();kW=class extends kt{}});var NW,rqe=V(()=>{p();Rn();NW=class extends kt{run(e,n){return this._client.post("/fine_tuning/alpha/graders/run",{body:e,...n,__security:{bearerAuth:!0}})}validate(e,n){return this._client.post("/fine_tuning/alpha/graders/validate",{body:e,...n,__security:{bearerAuth:!0}})}}});var GP,sqe=V(()=>{p();Rn();rqe();rqe();GP=class extends kt{constructor(){super(...arguments),this.graders=new NW(this._client)}};GP.Graders=NW});var DW,iqe=V(()=>{p();Rn();Es();vr();DW=class extends kt{create(e,n,r){return this._client.getAPIList(at`/fine_tuning/checkpoints/${e}/permissions`,Th,{body:n,method:"post",...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n={},r){return this._client.get(at`/fine_tuning/checkpoints/${e}/permissions`,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/fine_tuning/checkpoints/${e}/permissions`,mo,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{fine_tuned_model_checkpoint:s}=n;return this._client.delete(at`/fine_tuning/checkpoints/${s}/permissions/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var WP,oqe=V(()=>{p();Rn();iqe();iqe();WP=class extends kt{constructor(){super(...arguments),this.permissions=new DW(this._client)}};WP.Permissions=DW});var BW,aqe=V(()=>{p();Rn();Es();vr();BW=class extends kt{list(e,n={},r){return this._client.getAPIList(at`/fine_tuning/jobs/${e}/checkpoints`,Gs,{query:n,...r,__security:{bearerAuth:!0}})}}});var qP,cqe=V(()=>{p();Rn();aqe();aqe();Es();vr();qP=class extends kt{constructor(){super(...arguments),this.checkpoints=new BW(this._client)}create(e,n){return this._client.post("/fine_tuning/jobs",{body:e,...n,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(at`/fine_tuning/jobs/${e}`,{...n,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/fine_tuning/jobs",Gs,{query:e,...n,__security:{bearerAuth:!0}})}cancel(e,n){return this._client.post(at`/fine_tuning/jobs/${e}/cancel`,{...n,__security:{bearerAuth:!0}})}listEvents(e,n={},r){return this._client.getAPIList(at`/fine_tuning/jobs/${e}/events`,Gs,{query:n,...r,__security:{bearerAuth:!0}})}pause(e,n){return this._client.post(at`/fine_tuning/jobs/${e}/pause`,{...n,__security:{bearerAuth:!0}})}resume(e,n){return this._client.post(at`/fine_tuning/jobs/${e}/resume`,{...n,__security:{bearerAuth:!0}})}};qP.Checkpoints=BW});var I_,lqe=V(()=>{p();Rn();nqe();nqe();sqe();sqe();oqe();oqe();cqe();cqe();I_=class extends kt{constructor(){super(...arguments),this.methods=new kW(this._client),this.jobs=new qP(this._client),this.checkpoints=new WP(this._client),this.alpha=new GP(this._client)}};I_.Methods=kW;I_.Jobs=qP;I_.Checkpoints=WP;I_.Alpha=GP});var PW,uqe=V(()=>{p();Rn();PW=class extends kt{}});var gk,dqe=V(()=>{p();Rn();uqe();uqe();gk=class extends kt{constructor(){super(...arguments),this.graderModels=new PW(this._client)}};gk.GraderModels=PW});var HP,pqe=V(()=>{p();Rn();_E();HP=class extends kt{createVariation(e,n){return this._client.post("/images/variations",vh({body:e,...n,__security:{bearerAuth:!0}},this._client))}edit(e,n){return this._client.post("/images/edits",vh({body:e,...n,stream:e.stream??!1,__security:{bearerAuth:!0}},this._client))}generate(e,n){return this._client.post("/images/generations",{body:e,...n,stream:e.stream??!1,__security:{bearerAuth:!0}})}}});var VP,hqe=V(()=>{p();Rn();Es();vr();VP=class extends kt{retrieve(e,n){return this._client.get(at`/models/${e}`,{...n,__security:{bearerAuth:!0}})}list(e){return this._client.getAPIList("/models",Th,{...e,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/models/${e}`,{...n,__security:{bearerAuth:!0}})}}});var jP,mqe=V(()=>{p();Rn();jP=class extends kt{create(e,n){return this._client.post("/moderations",{body:e,...n,__security:{bearerAuth:!0}})}}});var OW,fqe=V(()=>{p();Rn();za();vr();OW=class extends kt{accept(e,n,r){return this._client.post(at`/realtime/calls/${e}/accept`,{body:n,...r,headers:In([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}hangup(e,n){return this._client.post(at`/realtime/calls/${e}/hangup`,{...n,headers:In([{Accept:"*/*"},n?.headers]),__security:{bearerAuth:!0}})}refer(e,n,r){return this._client.post(at`/realtime/calls/${e}/refer`,{body:n,...r,headers:In([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}reject(e,n={},r){return this._client.post(at`/realtime/calls/${e}/reject`,{body:n,...r,headers:In([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}}});var MW,gqe=V(()=>{p();Rn();MW=class extends kt{create(e,n){return this._client.post("/realtime/client_secrets",{body:e,...n,__security:{bearerAuth:!0}})}}});var Jx,Aqe=V(()=>{p();Rn();fqe();fqe();gqe();gqe();Jx=class extends kt{constructor(){super(...arguments),this.clientSecrets=new MW(this._client),this.calls=new OW(this._client)}};Jx.ClientSecrets=MW;Jx.Calls=OW});function kUt(t,e){return!e||!kvr(e)?{...t,output_parsed:null,output:t.output.map(n=>n.type==="function_call"?{...n,parsed_arguments:null}:n.type==="message"?{...n,content:n.content.map(r=>({...r,parsed:null}))}:n)}:yqe(t,e)}function yqe(t,e){let n=t.output.map(s=>{if(s.type==="function_call")return{...s,parsed_arguments:Bvr(e,s)};if(s.type==="message"){let i=s.content.map(o=>o.type==="output_text"?{...o,parsed:Rvr(e,o.text)}:o);return{...s,content:i}}return s}),r=Object.assign({},t,{output:n});return Object.getOwnPropertyDescriptor(t,"output_text")||$he(r),Object.defineProperty(r,"output_parsed",{enumerable:!0,get(){for(let s of r.output)if(s.type==="message"){for(let i of s.content)if(i.type==="output_text"&&i.parsed!==null)return i.parsed}return null}}),r}function Rvr(t,e){return t.text?.format?.type!=="json_schema"?null:"$parseRaw"in t.text?.format?(t.text?.format).$parseRaw(e):JSON.parse(e)}function kvr(t){return!!sK(t.text?.format)}function Nvr(t){return t?.$brand==="auto-parseable-tool"}function Dvr(t,e){return t.find(n=>n.type==="function"&&n.name===e)}function Bvr(t,e){let n=Dvr(t.tools??[],e.name);return{...e,...e,parsed_arguments:Nvr(n)?n.$parseRaw(e.arguments):n?.strict?JSON.parse(e.arguments):null}}function $he(t){let e=[];for(let n of t.output)if(n.type==="message")for(let r of n.content)r.type==="output_text"&&e.push(r.text);t.output_text=e.join("")}var Eqe=V(()=>{p();__();oK()});function Pvr(t,e){return kUt(t,e)}var LW,Ghe,Ak,Whe,NUt,DUt,BUt,PUt,qhe,OUt=V(()=>{p();EE();__();Nhe();Eqe();qhe=class t extends ik{constructor(e){super(),LW.add(this),Ghe.set(this,void 0),Ak.set(this,void 0),Whe.set(this,void 0),Gr(this,Ghe,e,"f")}static createResponse(e,n,r){let s=new t(n);return s._run(()=>s._createOrRetrieveResponse(e,n,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),s}async _createOrRetrieveResponse(e,n,r){let s=r?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),Ft(this,LW,"m",NUt).call(this);let i,o=null;"response_id"in n?(i=await e.responses.retrieve(n.response_id,{stream:!0},{...r,signal:this.controller.signal,stream:!0}),o=n.starting_after??null):i=await e.responses.create({...n,stream:!0},{...r,signal:this.controller.signal}),this._connected();for await(let a of i)Ft(this,LW,"m",DUt).call(this,a,o);if(i.controller.signal?.aborted)throw new Mu;return Ft(this,LW,"m",BUt).call(this)}[(Ghe=new WeakMap,Ak=new WeakMap,Whe=new WeakMap,LW=new WeakSet,NUt=function(){this.ended||Gr(this,Ak,void 0,"f")},DUt=function(n,r){if(this.ended)return;let s=(o,a)=>{(r==null||a.sequence_number>r)&&this._emit(o,a)},i=Ft(this,LW,"m",PUt).call(this,n);switch(s("event",n),n.type){case"response.output_text.delta":{let o=i.output[n.output_index];if(!o)throw new Wn(`missing output at index ${n.output_index}`);if(o.type==="message"){let a=o.content[n.content_index];if(!a)throw new Wn(`missing content at index ${n.content_index}`);if(a.type!=="output_text")throw new Wn(`expected content to be 'output_text', got ${a.type}`);s("response.output_text.delta",{...n,snapshot:a.text})}break}case"response.function_call_arguments.delta":{let o=i.output[n.output_index];if(!o)throw new Wn(`missing output at index ${n.output_index}`);o.type==="function_call"&&s("response.function_call_arguments.delta",{...n,snapshot:o.arguments});break}default:s(n.type,n);break}},BUt=function(){if(this.ended)throw new Wn("stream has ended, this shouldn't happen");let n=Ft(this,Ak,"f");if(!n)throw new Wn("request ended without sending any events");Gr(this,Ak,void 0,"f");let r=Pvr(n,Ft(this,Ghe,"f"));return Gr(this,Whe,r,"f"),r},PUt=function(n){let r=Ft(this,Ak,"f");if(!r){if(n.type!=="response.created")throw new Wn(`When snapshot hasn't been set yet, expected 'response.created' event, got ${n.type}`);return r=Gr(this,Ak,n.response,"f"),r}switch(n.type){case"response.output_item.added":{r.output.push(n.item);break}case"response.content_part.added":{let s=r.output[n.output_index];if(!s)throw new Wn(`missing output at index ${n.output_index}`);let i=s.type,o=n.part;i==="message"&&o.type!=="reasoning_text"?s.content.push(o):i==="reasoning"&&o.type==="reasoning_text"&&(s.content||(s.content=[]),s.content.push(o));break}case"response.output_text.delta":{let s=r.output[n.output_index];if(!s)throw new Wn(`missing output at index ${n.output_index}`);if(s.type==="message"){let i=s.content[n.content_index];if(!i)throw new Wn(`missing content at index ${n.content_index}`);if(i.type!=="output_text")throw new Wn(`expected content to be 'output_text', got ${i.type}`);i.text+=n.delta}break}case"response.function_call_arguments.delta":{let s=r.output[n.output_index];if(!s)throw new Wn(`missing output at index ${n.output_index}`);s.type==="function_call"&&(s.arguments+=n.delta);break}case"response.reasoning_text.delta":{let s=r.output[n.output_index];if(!s)throw new Wn(`missing output at index ${n.output_index}`);if(s.type==="reasoning"){let i=s.content?.[n.content_index];if(!i)throw new Wn(`missing content at index ${n.content_index}`);if(i.type!=="reasoning_text")throw new Wn(`expected content to be 'reasoning_text', got ${i.type}`);i.text+=n.delta}break}case"response.completed":{Gr(this,Ak,n.response,"f");break}}return r},Symbol.asyncIterator)](){let e=[],n=[],r=!1;return this.on("event",s=>{let i=n.shift();i?i.resolve(s):e.push(s)}),this.on("end",()=>{r=!0;for(let s of n)s.resolve(void 0);n.length=0}),this.on("abort",s=>{r=!0;for(let i of n)i.reject(s);n.length=0}),this.on("error",s=>{r=!0;for(let i of n)i.reject(s);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((i,o)=>n.push({resolve:i,reject:o})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();let e=Ft(this,Whe,"f");if(!e)throw new Wn("stream ended without producing a ChatCompletion");return e}}});var FW,bqe=V(()=>{p();Rn();Es();vr();FW=class extends kt{list(e,n={},r){return this._client.getAPIList(at`/responses/${e}/input_items`,Gs,{query:n,...r,__security:{bearerAuth:!0}})}}});var QW,_qe=V(()=>{p();Rn();QW=class extends kt{count(e={},n){return this._client.post("/responses/input_tokens",{body:e,...n,__security:{bearerAuth:!0}})}}});var Xx,Sqe=V(()=>{p();Eqe();OUt();Rn();bqe();bqe();_qe();_qe();za();vr();Xx=class extends kt{constructor(){super(...arguments),this.inputItems=new FW(this._client),this.inputTokens=new QW(this._client)}create(e,n){return this._client.post("/responses",{body:e,...n,stream:e.stream??!1,__security:{bearerAuth:!0}})._thenUnwrap(r=>("object"in r&&r.object==="response"&&$he(r),r))}retrieve(e,n={},r){return this._client.get(at`/responses/${e}`,{query:n,...r,stream:n?.stream??!1,__security:{bearerAuth:!0}})._thenUnwrap(s=>("object"in s&&s.object==="response"&&$he(s),s))}delete(e,n){return this._client.delete(at`/responses/${e}`,{...n,headers:In([{Accept:"*/*"},n?.headers]),__security:{bearerAuth:!0}})}parse(e,n){return this._client.responses.create(e,n)._thenUnwrap(r=>yqe(r,e))}stream(e,n){return qhe.createResponse(this._client,e,n)}cancel(e,n){return this._client.post(at`/responses/${e}/cancel`,{...n,__security:{bearerAuth:!0}})}compact(e,n){return this._client.post("/responses/compact",{body:e,...n,__security:{bearerAuth:!0}})}};Xx.InputItems=FW;Xx.InputTokens=QW});var UW,Cqe=V(()=>{p();Rn();za();vr();UW=class extends kt{retrieve(e,n){return this._client.get(at`/skills/${e}/content`,{...n,headers:In([{Accept:"application/binary"},n?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}});var $W,Iqe=V(()=>{p();Rn();za();vr();$W=class extends kt{retrieve(e,n,r){let{skill_id:s}=n;return this._client.get(at`/skills/${s}/versions/${e}/content`,{...r,headers:In([{Accept:"application/binary"},r?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}});var YP,xqe=V(()=>{p();Rn();Iqe();Iqe();Es();_E();vr();YP=class extends kt{constructor(){super(...arguments),this.content=new $W(this._client)}create(e,n={},r){return this._client.post(at`/skills/${e}/versions`,sk({body:n,...r,__security:{bearerAuth:!0}},this._client))}retrieve(e,n,r){let{skill_id:s}=n;return this._client.get(at`/skills/${s}/versions/${e}`,{...r,__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/skills/${e}/versions`,Gs,{query:n,...r,__security:{bearerAuth:!0}})}delete(e,n,r){let{skill_id:s}=n;return this._client.delete(at`/skills/${s}/versions/${e}`,{...r,__security:{bearerAuth:!0}})}};YP.Content=$W});var Zx,wqe=V(()=>{p();Rn();Cqe();Cqe();xqe();xqe();Es();_E();vr();Zx=class extends kt{constructor(){super(...arguments),this.content=new UW(this._client),this.versions=new YP(this._client)}create(e={},n){return this._client.post("/skills",sk({body:e,...n,__security:{bearerAuth:!0}},this._client))}retrieve(e,n){return this._client.get(at`/skills/${e}`,{...n,__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(at`/skills/${e}`,{body:n,...r,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/skills",Gs,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/skills/${e}`,{...n,__security:{bearerAuth:!0}})}};Zx.Content=UW;Zx.Versions=YP});var GW,Tqe=V(()=>{p();Rn();_E();vr();GW=class extends kt{create(e,n,r){return this._client.post(at`/uploads/${e}/parts`,vh({body:n,...r,__security:{bearerAuth:!0}},this._client))}}});var yk,vqe=V(()=>{p();Rn();Tqe();Tqe();vr();yk=class extends kt{constructor(){super(...arguments),this.parts=new GW(this._client)}create(e,n){return this._client.post("/uploads",{body:e,...n,__security:{bearerAuth:!0}})}cancel(e,n){return this._client.post(at`/uploads/${e}/cancel`,{...n,__security:{bearerAuth:!0}})}complete(e,n,r){return this._client.post(at`/uploads/${e}/complete`,{body:n,...r,__security:{bearerAuth:!0}})}};yk.Parts=GW});var MUt,LUt=V(()=>{p();MUt=async t=>{let e=await Promise.allSettled(t),n=e.filter(s=>s.status==="rejected");if(n.length){for(let s of n)console.error(s.reason);throw new Error(`${n.length} promise(s) failed - see the above errors`)}let r=[];for(let s of e)s.status==="fulfilled"&&r.push(s.value);return r}});var WW,Rqe=V(()=>{p();Rn();Es();za();QG();LUt();vr();WW=class extends kt{create(e,n,r){return this._client.post(at`/vector_stores/${e}/file_batches`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n,r){let{vector_store_id:s}=n;return this._client.get(at`/vector_stores/${s}/file_batches/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}cancel(e,n,r){let{vector_store_id:s}=n;return this._client.post(at`/vector_stores/${s}/file_batches/${e}/cancel`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}async createAndPoll(e,n,r){let s=await this.create(e,n);return await this.poll(e,s.id,r)}listFiles(e,n,r){let{vector_store_id:s,...i}=n;return this._client.getAPIList(at`/vector_stores/${s}/file_batches/${e}/files`,Gs,{query:i,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}async poll(e,n,r){let s=In([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:i,response:o}=await this.retrieve(n,{vector_store_id:e},{...r,headers:s}).withResponse();switch(i.status){case"in_progress":let a=5e3;if(r?.pollIntervalMs)a=r.pollIntervalMs;else{let c=o.headers.get("openai-poll-after-ms");if(c){let u=parseInt(c);isNaN(u)||(a=u)}}await hC(a);break;case"failed":case"cancelled":case"completed":return i}}}async uploadAndPoll(e,{files:n,fileIds:r=[]},s){if(n==null||n.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let i=s?.maxConcurrency??5,o=Math.min(i,n.length),a=this._client,c=n.values(),u=[...r];async function l(h){for(let m of h){let f=await a.files.create({file:m,purpose:"assistants"},s);u.push(f.id)}}let d=Array(o).fill(c).map(l);return await MUt(d),await this.createAndPoll(e,{file_ids:u})}}});var qW,kqe=V(()=>{p();Rn();Es();za();mK();vr();qW=class extends kt{create(e,n,r){return this._client.post(at`/vector_stores/${e}/files`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n,r){let{vector_store_id:s}=n;return this._client.get(at`/vector_stores/${s}/files/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){let{vector_store_id:s,...i}=n;return this._client.post(at`/vector_stores/${s}/files/${e}`,{body:i,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(at`/vector_stores/${e}/files`,Gs,{query:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}delete(e,n,r){let{vector_store_id:s}=n;return this._client.delete(at`/vector_stores/${s}/files/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}async createAndPoll(e,n,r){let s=await this.create(e,n,r);return await this.poll(e,s.id,r)}async poll(e,n,r){let s=In([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let i=await this.retrieve(n,{vector_store_id:e},{...r,headers:s}).withResponse(),o=i.data;switch(o.status){case"in_progress":let a=5e3;if(r?.pollIntervalMs)a=r.pollIntervalMs;else{let c=i.response.headers.get("openai-poll-after-ms");if(c){let u=parseInt(c);isNaN(u)||(a=u)}}await hC(a);break;case"failed":case"completed":return o}}}async upload(e,n,r){let s=await this._client.files.create({file:n,purpose:"assistants"},r);return this.create(e,{file_id:s.id},r)}async uploadAndPoll(e,n,r){let s=await this.upload(e,n,r);return await this.poll(e,s.id,r)}content(e,n,r){let{vector_store_id:s}=n;return this._client.getAPIList(at`/vector_stores/${s}/files/${e}/content`,Th,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}}});var ew,Nqe=V(()=>{p();Rn();Rqe();Rqe();kqe();kqe();Es();za();vr();ew=class extends kt{constructor(){super(...arguments),this.files=new qW(this._client),this.fileBatches=new WW(this._client)}create(e,n){return this._client.post("/vector_stores",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(at`/vector_stores/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(at`/vector_stores/${e}`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/vector_stores",Gs,{query:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/vector_stores/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}search(e,n,r){return this._client.getAPIList(at`/vector_stores/${e}/search`,Th,{body:n,method:"post",...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}};ew.Files=qW;ew.FileBatches=WW});var KP,Dqe=V(()=>{p();Rn();Es();za();_E();vr();KP=class extends kt{create(e,n){return this._client.post("/videos",vh({body:e,...n,__security:{bearerAuth:!0}},this._client))}retrieve(e,n){return this._client.get(at`/videos/${e}`,{...n,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/videos",mo,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(at`/videos/${e}`,{...n,__security:{bearerAuth:!0}})}createCharacter(e,n){return this._client.post("/videos/characters",vh({body:e,...n,__security:{bearerAuth:!0}},this._client))}downloadContent(e,n={},r){return this._client.get(at`/videos/${e}/content`,{query:n,...r,headers:In([{Accept:"application/binary"},r?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}edit(e,n){return this._client.post("/videos/edits",vh({body:e,...n,__security:{bearerAuth:!0}},this._client))}extend(e,n){return this._client.post("/videos/extensions",vh({body:e,...n,__security:{bearerAuth:!0}},this._client))}getCharacter(e,n){return this._client.get(at`/videos/characters/${e}`,{...n,__security:{bearerAuth:!0}})}remix(e,n,r){return this._client.post(at`/videos/${e}/remix`,sk({body:n,...r,__security:{bearerAuth:!0}},this._client))}}});var HW,FUt,Hhe,zP,Bqe=V(()=>{p();EE();__();Rn();za();zP=class extends kt{constructor(){super(...arguments),HW.add(this)}async unwrap(e,n,r=this._client.webhookSecret,s=300){return await this.verifySignature(e,n,r,s),JSON.parse(e)}async verifySignature(e,n,r=this._client.webhookSecret,s=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!="function"||typeof crypto.subtle.verify!="function")throw new Error("Webhook signature verification is only supported when the `crypto` global is defined");Ft(this,HW,"m",FUt).call(this,r);let i=In([n]).values,o=Ft(this,HW,"m",Hhe).call(this,i,"webhook-signature"),a=Ft(this,HW,"m",Hhe).call(this,i,"webhook-timestamp"),c=Ft(this,HW,"m",Hhe).call(this,i,"webhook-id"),u=parseInt(a,10);if(isNaN(u))throw new pC("Invalid webhook timestamp format");let l=Math.floor(Date.now()/1e3);if(l-u>s)throw new pC("Webhook timestamp is too old");if(u>l+s)throw new pC("Webhook timestamp is too new");let d=o.split(" ").map(g=>g.startsWith("v1,")?g.substring(3):g),h=r.startsWith("whsec_")?Buffer.from(r.replace("whsec_",""),"base64"):Buffer.from(r,"utf-8"),m=c?`${c}.${a}.${e}`:`${a}.${e}`,f=await crypto.subtle.importKey("raw",h,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(let g of d)try{let A=Buffer.from(g,"base64");if(await crypto.subtle.verify("HMAC",f,A,new TextEncoder().encode(m)))return}catch{continue}throw new pC("The given webhook signature does not match the expected signature")}};HW=new WeakSet,FUt=function(e){if(typeof e!="string"||e.length===0)throw new Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},Hhe=function(e,n){if(!e)throw new Error("Headers are required");let r=e.get(n);if(r==null)throw new Error(`Missing required header: ${n}`);return r}});var QUt=V(()=>{p();Bqe()});var UUt=V(()=>{p();QUt()});var $Ut=V(()=>{p();yUt();EUt();IWe();vWe();RWe();qWe();HWe();YWe();zWe();JWe();eqe();tqe();lqe();dqe();pqe();hqe();mqe();Aqe();Sqe();wqe();vqe();Nqe();Dqe();UUt()});function Hvr(t){if(Vvr(t))return"Connection error. This may be caused by passing an undici dispatcher, such as ProxyAgent, that is incompatible with the fetch implementation. If you are using undici's ProxyAgent, pass the fetch implementation from the same undici package: import { fetch, ProxyAgent } from 'undici'; new OpenAI({ fetch, fetchOptions: { dispatcher: new ProxyAgent(...) } });"}function Vvr(t){let e=t;for(let n=0;n<8&&e&&typeof e=="object";n++){let r=e;if(r.code==="UND_ERR_INVALID_ARG"&&typeof r.message=="string"&&r.message.includes("invalid onRequestStart method"))return!0;e=r.cause}return!1}var Pqe,Oqe,Vhe,GUt,qvr,as,jhe=V(()=>{p();EE();tGe();Hx();QG();dhe();iGe();UG();OQt();gGe();sGe();bE();Es();ZQt();bE();TGe();$Ut();bhe();RWe();HWe();JWe();tqe();pqe();hqe();mqe();Dqe();IWe();vWe();qWe();KGe();YWe();zWe();eqe();lqe();dqe();Aqe();Sqe();wqe();vqe();Nqe();Bqe();iGe();za();QWe();X9();Hx();qvr="workload-identity-auth",as=class{constructor({baseURL:e=fA("OPENAI_BASE_URL"),apiKey:n=fA("OPENAI_API_KEY")??null,adminAPIKey:r=fA("OPENAI_ADMIN_KEY")??null,organization:s=fA("OPENAI_ORG_ID")??null,project:i=fA("OPENAI_PROJECT_ID")??null,webhookSecret:o=fA("OPENAI_WEBHOOK_SECRET")??null,workloadIdentity:a,...c}={}){Pqe.add(this),Vhe.set(this,void 0),this.completions=new LP(this),this.chat=new ak(this),this.embeddings=new QP(this),this.files=new $P(this),this.images=new HP(this),this.audio=new gC(this),this.moderations=new jP(this),this.models=new VP(this),this.fineTuning=new I_(this),this.graders=new gk(this),this.vectorStores=new ew(this),this.webhooks=new zP(this),this.beta=new C_(this),this.batches=new DP(this),this.uploads=new yk(this),this.admin=new lk(this),this.responses=new Xx(this),this.realtime=new Jx(this),this.conversations=new mk(this),this.evals=new fk(this),this.containers=new hk(this),this.skills=new Zx(this),this.videos=new KP(this);let u={apiKey:n,adminAPIKey:r,organization:s,project:i,webhookSecret:o,workloadIdentity:a,...c,baseURL:e||"https://api.openai.com/v1"};if(n&&a)throw new Wn("The `apiKey` and `workloadIdentity` options are mutually exclusive");if(!n&&!r&&!a)throw new Wn("Missing credentials. Please pass an `apiKey`, `workloadIdentity`, `adminAPIKey`, or set the `OPENAI_API_KEY` or `OPENAI_ADMIN_KEY` environment variable.");if(!u.dangerouslyAllowBrowser&&NQt())throw new Wn(`It looks like you're running in a browser-like environment. +${d}`)}return o},ct=BJr(R7t)});var vL,xEe=v(()=>{p();kn();xi();kr();vL=class extends Nt{list(e,n={},r){return this._client.getAPIList(ct`/chat/completions/${e}/messages`,Ki,{query:n,...r,__security:{bearerAuth:!0}})}}});var hx=v(()=>{p();G0()});function gX(t){return t!==void 0&&"function"in t&&t.function!==void 0}function AX(t){return t?.$brand==="auto-parseable-response-format"}function RL(t){return t?.$brand==="auto-parseable-tool"}function k7t(t,e){return!e||!Jje(e)?{...t,choices:t.choices.map(n=>(N7t(n.message.tool_calls),{...n,message:{...n.message,parsed:null,...n.message.tool_calls?{tool_calls:n.message.tool_calls}:void 0}}))}:yX(t,e)}function yX(t,e){let n=t.choices.map(r=>{if(r.finish_reason==="length")throw new t5;if(r.finish_reason==="content_filter")throw new n5;return N7t(r.message.tool_calls),{...r,message:{...r.message,...r.message.tool_calls?{tool_calls:r.message.tool_calls?.map(i=>MJr(e,i))??void 0}:void 0,parsed:r.message.content&&!r.message.refusal?PJr(e,r.message.content):null}}});return{...t,choices:n}}function PJr(t,e){return t.response_format?.type!=="json_schema"?null:t.response_format?.type==="json_schema"?"$parseRaw"in t.response_format?t.response_format.$parseRaw(e):JSON.parse(e):null}function MJr(t,e){let n=t.tools?.find(r=>gX(r)&&r.function?.name===e.function.name);return{...e,function:{...e.function,parsed_arguments:RL(n)?n.$parseRaw(e.function.arguments):n?.function.strict?JSON.parse(e.function.arguments):null}}}function B7t(t,e){if(!t||!("tools"in t)||!t.tools)return!1;let n=t.tools?.find(r=>gX(r)&&r.function?.name===e.function.name);return gX(n)&&(RL(n)||n?.function.strict||!1)}function Jje(t){return AX(t.response_format)?!0:t.tools?.some(e=>RL(e)||e.type==="function"&&e.function.strict===!0)??!1}function N7t(t){for(let e of t||[])if(e.type!=="function")throw new qn(`Currently only \`function\` tool calls are supported; Received \`${e.type}\``)}function D7t(t){for(let e of t??[]){if(e.type!=="function")throw new qn(`Currently only \`function\` tool types support auto-parsing; Received \`${e.type}\``);if(e.function.strict!==!0)throw new qn(`The \`${e.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var EX=v(()=>{p();hx()});var l5,Xje,Zje=v(()=>{p();l5=t=>t?.role==="assistant",Xje=t=>t?.role==="tool"});var eVe,SEe,CEe,bX,_X,IEe,xX,hv,SX,wEe,TEe,u5,P7t,HB,vEe=v(()=>{p();U0();hx();HB=class{constructor(){eVe.add(this),this.controller=new AbortController,SEe.set(this,void 0),CEe.set(this,()=>{}),bX.set(this,()=>{}),_X.set(this,void 0),IEe.set(this,()=>{}),xX.set(this,()=>{}),hv.set(this,{}),SX.set(this,!1),wEe.set(this,!1),TEe.set(this,!1),u5.set(this,!1),Hr(this,SEe,new Promise((e,n)=>{Hr(this,CEe,e,"f"),Hr(this,bX,n,"f")}),"f"),Hr(this,_X,new Promise((e,n)=>{Hr(this,IEe,e,"f"),Hr(this,xX,n,"f")}),"f"),Ut(this,SEe,"f").catch(()=>{}),Ut(this,_X,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},Ut(this,eVe,"m",P7t).bind(this))},0)}_connected(){this.ended||(Ut(this,CEe,"f").call(this),this._emit("connect"))}get ended(){return Ut(this,SX,"f")}get errored(){return Ut(this,wEe,"f")}get aborted(){return Ut(this,TEe,"f")}abort(){this.controller.abort()}on(e,n){return(Ut(this,hv,"f")[e]||(Ut(this,hv,"f")[e]=[])).push({listener:n}),this}off(e,n){let r=Ut(this,hv,"f")[e];if(!r)return this;let i=r.findIndex(s=>s.listener===n);return i>=0&&r.splice(i,1),this}once(e,n){return(Ut(this,hv,"f")[e]||(Ut(this,hv,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,r)=>{Hr(this,u5,!0,"f"),e!=="error"&&this.once("error",r),this.once(e,n)})}async done(){Hr(this,u5,!0,"f"),await Ut(this,_X,"f")}_emit(e,...n){if(Ut(this,SX,"f"))return;e==="end"&&(Hr(this,SX,!0,"f"),Ut(this,IEe,"f").call(this));let r=Ut(this,hv,"f")[e];if(r&&(Ut(this,hv,"f")[e]=r.filter(i=>!i.once),r.forEach(({listener:i})=>i(...n))),e==="abort"){let i=n[0];!Ut(this,u5,"f")&&!r?.length&&Promise.reject(i),Ut(this,bX,"f").call(this,i),Ut(this,xX,"f").call(this,i),this._emit("end");return}if(e==="error"){let i=n[0];!Ut(this,u5,"f")&&!r?.length&&Promise.reject(i),Ut(this,bX,"f").call(this,i),Ut(this,xX,"f").call(this,i),this._emit("end")}}_emitFinal(){}};SEe=new WeakMap,CEe=new WeakMap,bX=new WeakMap,_X=new WeakMap,IEe=new WeakMap,xX=new WeakMap,hv=new WeakMap,SX=new WeakMap,wEe=new WeakMap,TEe=new WeakMap,u5=new WeakMap,eVe=new WeakSet,P7t=function(e){if(Hr(this,wEe,!0,"f"),e instanceof Error&&e.name==="AbortError"&&(e=new Rd),e instanceof Rd)return Hr(this,TEe,!0,"f"),this._emit("abort",e);if(e instanceof qn)return this._emit("error",e);if(e instanceof Error){let n=new qn(e.message);return n.cause=e,this._emit("error",n)}return this._emit("error",new qn(String(e)))}});function M7t(t){return typeof t.parse=="function"}var tVe=v(()=>{p()});var Gf,nVe,REe,rVe,iVe,sVe,O7t,L7t,OJr,d5,oVe=v(()=>{p();U0();hx();EX();Zje();vEe();tVe();OJr=10,d5=class extends HB{constructor(){super(...arguments),Gf.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);let n=e.choices[0]?.message;return n&&this._addMessage(n),e}_addMessage(e,n=!0){if("content"in e||(e.content=null),this.messages.push(e),n){if(this._emit("message",e),Xje(e)&&e.content)this._emit("functionToolCallResult",e.content);else if(l5(e)&&e.tool_calls)for(let r of e.tool_calls)r.type==="function"&&this._emit("functionToolCall",r.function)}}async finalChatCompletion(){await this.done();let e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new qn("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),Ut(this,Gf,"m",nVe).call(this)}async finalMessage(){return await this.done(),Ut(this,Gf,"m",REe).call(this)}async finalFunctionToolCall(){return await this.done(),Ut(this,Gf,"m",rVe).call(this)}async finalFunctionToolCallResult(){return await this.done(),Ut(this,Gf,"m",iVe).call(this)}async totalUsage(){return await this.done(),Ut(this,Gf,"m",sVe).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);let n=Ut(this,Gf,"m",REe).call(this);n&&this._emit("finalMessage",n);let r=Ut(this,Gf,"m",nVe).call(this);r&&this._emit("finalContent",r);let i=Ut(this,Gf,"m",rVe).call(this);i&&this._emit("finalFunctionToolCall",i);let s=Ut(this,Gf,"m",iVe).call(this);s!=null&&this._emit("finalFunctionToolCallResult",s),this._chatCompletions.some(o=>o.usage)&&this._emit("totalUsage",Ut(this,Gf,"m",sVe).call(this))}async _createChatCompletion(e,n,r){let i=r?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort())),Ut(this,Gf,"m",O7t).call(this,n);let s=await e.chat.completions.create({...n,stream:!1},{...r,signal:this.controller.signal});return this._connected(),this._addChatCompletion(yX(s,n))}async _runChatCompletion(e,n,r){for(let i of n.messages)this._addMessage(i,!1);return await this._createChatCompletion(e,n,r)}async _runTools(e,n,r){let i="tool",{tool_choice:s="auto",stream:o,...a}=n,c=typeof s!="string"&&s.type==="function"&&s?.function?.name,{maxChatCompletions:u=OJr}=r||{},l=n.tools.map(h=>{if(RL(h)){if(!h.$callback)throw new qn("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:h.$callback,name:h.function.name,description:h.function.description||"",parameters:h.function.parameters,parse:h.$parseRaw,strict:!0}}}return h}),d={};for(let h of l)h.type==="function"&&(d[h.function.name||h.function.function.name]=h.function);let m="tools"in n?l.map(h=>h.type==="function"?{type:"function",function:{name:h.function.name||h.function.function.name,parameters:h.function.parameters,description:h.function.description,strict:h.function.strict}}:h):void 0;for(let h of n.messages)this._addMessage(h,!1);for(let h=0;hJSON.stringify(N)).join(", ")}. Please try again`;this._addMessage({role:i,tool_call_id:y,content:k});continue}let C;try{C=M7t(S)?await S.parse(_):_}catch(k){let N=k instanceof Error?k.message:String(k);this._addMessage({role:i,tool_call_id:y,content:N});continue}let I=await S.function(C,this),w=Ut(this,Gf,"m",L7t).call(this,I);if(this._addMessage({role:i,tool_call_id:y,content:w}),c)return}}}};Gf=new WeakSet,nVe=function(){return Ut(this,Gf,"m",REe).call(this).content??null},REe=function(){let e=this.messages.length;for(;e-- >0;){let n=this.messages[e];if(l5(n))return{...n,content:n.content??null,refusal:n.refusal??null}}throw new qn("stream ended without producing a ChatCompletionMessage with role=assistant")},rVe=function(){for(let e=this.messages.length-1;e>=0;e--){let n=this.messages[e];if(l5(n)&&n?.tool_calls?.length)return n.tool_calls.filter(r=>r.type==="function").at(-1)?.function}},iVe=function(){for(let e=this.messages.length-1;e>=0;e--){let n=this.messages[e];if(Xje(n)&&n.content!=null&&typeof n.content=="string"&&this.messages.some(r=>r.role==="assistant"&&r.tool_calls?.some(i=>i.type==="function"&&i.id===n.tool_call_id)))return n.content}},sVe=function(){let e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:n}of this._chatCompletions)n&&(e.completion_tokens+=n.completion_tokens,e.prompt_tokens+=n.prompt_tokens,e.total_tokens+=n.total_tokens);return e},O7t=function(e){if(e.n!=null&&e.n>1)throw new qn("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},L7t=function(e){return typeof e=="string"?e:e===void 0?"undefined":JSON.stringify(e)}});var CX,aVe=v(()=>{p();oVe();Zje();CX=class t extends d5{static runTools(e,n,r){let i=new t,s={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runTools"}};return i._run(()=>i._runTools(e,n,s)),i}_addMessage(e,n=!0){super._addMessage(e,n),l5(e)&&e.content&&this._emit("content",e.content)}}});function LJr(t,e=jp.ALL){if(typeof t!="string")throw new TypeError(`expecting str, got ${typeof t}`);if(!t.trim())throw new Error(`${t} is empty`);return FJr(t.trim(),e)}var jp,cVe,lVe,FJr,uVe,F7t=v(()=>{p();jp={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,INF:384,SPECIAL:496,ATOM:499,COLLECTION:12,ALL:511},cVe=class extends Error{},lVe=class extends Error{};FJr=(t,e)=>{let n=t.length,r=0,i=m=>{throw new cVe(`${m} at position ${r}`)},s=m=>{throw new lVe(`${m} at position ${r}`)},o=()=>(d(),r>=n&&i("Unexpected end of input"),t[r]==='"'?a():t[r]==="{"?c():t[r]==="["?u():t.substring(r,r+4)==="null"||jp.NULL&e&&n-r<4&&"null".startsWith(t.substring(r))?(r+=4,null):t.substring(r,r+4)==="true"||jp.BOOL&e&&n-r<4&&"true".startsWith(t.substring(r))?(r+=4,!0):t.substring(r,r+5)==="false"||jp.BOOL&e&&n-r<5&&"false".startsWith(t.substring(r))?(r+=5,!1):t.substring(r,r+8)==="Infinity"||jp.INFINITY&e&&n-r<8&&"Infinity".startsWith(t.substring(r))?(r+=8,1/0):t.substring(r,r+9)==="-Infinity"||jp.MINUS_INFINITY&e&&1{let m=r,h=!1;for(r++;r{r++,d();let m={};try{for(;t[r]!=="}";){if(d(),r>=n&&jp.OBJ&e)return m;let h=a();d(),r++;try{let f=o();Object.defineProperty(m,h,{value:f,writable:!0,enumerable:!0,configurable:!0})}catch(f){if(jp.OBJ&e)return m;throw f}d(),t[r]===","&&r++}}catch{if(jp.OBJ&e)return m;i("Expected '}' at end of object")}return r++,m},u=()=>{r++;let m=[];try{for(;t[r]!=="]";)m.push(o()),d(),t[r]===","&&r++}catch{if(jp.ARR&e)return m;i("Expected ']' at end of array")}return r++,m},l=()=>{if(r===0){t==="-"&&jp.NUM&e&&i("Not sure what '-' is");try{return JSON.parse(t)}catch(h){if(jp.NUM&e)try{return t[t.length-1]==="."?JSON.parse(t.substring(0,t.lastIndexOf("."))):JSON.parse(t.substring(0,t.lastIndexOf("e")))}catch{}s(String(h))}}let m=r;for(t[r]==="-"&&r++;t[r]&&!",]}".includes(t[r]);)r++;r==n&&!(jp.NUM&e)&&i("Unterminated number literal");try{return JSON.parse(t.substring(m,r))}catch{t.substring(m,r)==="-"&&jp.NUM&e&&i("Not sure what '-' is");try{return JSON.parse(t.substring(m,t.lastIndexOf("e")))}catch(f){s(String(f))}}},d=()=>{for(;rLJr(t,jp.ALL^jp.NUM)});var dVe=v(()=>{p();Wje()});function QJr(t,e){let{id:n,choices:r,created:i,model:s,system_fingerprint:o,...a}=t,c={...a,id:n,choices:r.map(({message:u,finish_reason:l,index:d,logprobs:m,...h})=>{if(!l)throw new qn(`missing finish_reason for choice ${d}`);let{content:f=null,function_call:g,tool_calls:A,...y}=u,E=u.role;if(!E)throw new qn(`missing role for choice ${d}`);if(g){let{arguments:_,name:S}=g;if(_==null)throw new qn(`missing function_call.arguments for choice ${d}`);if(!S)throw new qn(`missing function_call.name for choice ${d}`);return{...h,message:{content:f,function_call:{arguments:_,name:S},role:E,refusal:u.refusal??null},finish_reason:l,index:d,logprobs:m}}return A?{...h,index:d,finish_reason:l,logprobs:m,message:{...y,role:E,content:f,refusal:u.refusal??null,tool_calls:A.map((_,S)=>{let{function:C,type:I,id:w,...k}=_,{arguments:N,name:O,...W}=C||{};if(w==null)throw new qn(`missing choices[${d}].tool_calls[${S}].id +${NEe(t)}`);if(I==null)throw new qn(`missing choices[${d}].tool_calls[${S}].type +${NEe(t)}`);if(O==null)throw new qn(`missing choices[${d}].tool_calls[${S}].function.name +${NEe(t)}`);if(N==null)throw new qn(`missing choices[${d}].tool_calls[${S}].function.arguments +${NEe(t)}`);return{...k,id:w,type:I,function:{...W,name:O,arguments:N}}})}}:{...h,message:{...y,content:f,role:E,refusal:u.refusal??null},finish_reason:l,index:d,logprobs:m}}),created:i,model:s,object:"chat.completion",...o?{system_fingerprint:o}:{}};return k7t(c,e)}function NEe(t){return JSON.stringify(t)}var rp,fv,p5,qB,pVe,kEe,mVe,hVe,fVe,BEe,gVe,Q7t,kL,DEe=v(()=>{p();U0();F7t();hx();EX();dVe();oVe();kL=class t extends d5{constructor(e){super(),rp.add(this),fv.set(this,void 0),p5.set(this,void 0),qB.set(this,void 0),Hr(this,fv,e,"f"),Hr(this,p5,[],"f")}get currentChatCompletionSnapshot(){return Ut(this,qB,"f")}static fromReadableStream(e){let n=new t(null);return n._run(()=>n._fromReadableStream(e)),n}static createChatCompletion(e,n,r){let i=new t(n);return i._run(()=>i._runChatCompletion(e,{...n,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),i}async _createChatCompletion(e,n,r){super._createChatCompletion;let i=r?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort())),Ut(this,rp,"m",pVe).call(this);let s=await e.chat.completions.create({...n,stream:!0},{...r,signal:this.controller.signal});this._connected();for await(let o of s)Ut(this,rp,"m",mVe).call(this,o);if(s.controller.signal?.aborted)throw new Rd;return this._addChatCompletion(Ut(this,rp,"m",BEe).call(this))}async _fromReadableStream(e,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),Ut(this,rp,"m",pVe).call(this),this._connected();let i=hI.fromReadableStream(e,this.controller),s;for await(let o of i)s&&s!==o.id&&this._addChatCompletion(Ut(this,rp,"m",BEe).call(this)),Ut(this,rp,"m",mVe).call(this,o),s=o.id;if(i.controller.signal?.aborted)throw new Rd;return this._addChatCompletion(Ut(this,rp,"m",BEe).call(this))}[(fv=new WeakMap,p5=new WeakMap,qB=new WeakMap,rp=new WeakSet,pVe=function(){this.ended||Hr(this,qB,void 0,"f")},kEe=function(n){let r=Ut(this,p5,"f")[n.index];return r||(r={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},Ut(this,p5,"f")[n.index]=r,r)},mVe=function(n){if(this.ended)return;let r=Ut(this,rp,"m",Q7t).call(this,n);this._emit("chunk",n,r);for(let i of n.choices){let s=r.choices[i.index];i.delta.content!=null&&s.message?.role==="assistant"&&s.message?.content&&(this._emit("content",i.delta.content,s.message.content),this._emit("content.delta",{delta:i.delta.content,snapshot:s.message.content,parsed:s.message.parsed})),i.delta.refusal!=null&&s.message?.role==="assistant"&&s.message?.refusal&&this._emit("refusal.delta",{delta:i.delta.refusal,snapshot:s.message.refusal}),i.logprobs?.content!=null&&s.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:i.logprobs?.content,snapshot:s.logprobs?.content??[]}),i.logprobs?.refusal!=null&&s.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:i.logprobs?.refusal,snapshot:s.logprobs?.refusal??[]});let o=Ut(this,rp,"m",kEe).call(this,s);s.finish_reason&&(Ut(this,rp,"m",fVe).call(this,s),o.current_tool_call_index!=null&&Ut(this,rp,"m",hVe).call(this,s,o.current_tool_call_index));for(let a of i.delta.tool_calls??[])o.current_tool_call_index!==a.index&&(Ut(this,rp,"m",fVe).call(this,s),o.current_tool_call_index!=null&&Ut(this,rp,"m",hVe).call(this,s,o.current_tool_call_index)),o.current_tool_call_index=a.index;for(let a of i.delta.tool_calls??[]){let c=s.message.tool_calls?.[a.index];c?.type&&(c?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:c.function?.name,index:a.index,arguments:c.function.arguments,parsed_arguments:c.function.parsed_arguments,arguments_delta:a.function?.arguments??""}):(c?.type,void 0))}}},hVe=function(n,r){if(Ut(this,rp,"m",kEe).call(this,n).done_tool_calls.has(r))return;let s=n.message.tool_calls?.[r];if(!s)throw new Error("no tool call snapshot");if(!s.type)throw new Error("tool call snapshot missing `type`");if(s.type==="function"){let o=Ut(this,fv,"f")?.tools?.find(a=>gX(a)&&a.function.name===s.function.name);this._emit("tool_calls.function.arguments.done",{name:s.function.name,index:r,arguments:s.function.arguments,parsed_arguments:RL(o)?o.$parseRaw(s.function.arguments):o?.function.strict?JSON.parse(s.function.arguments):null})}else s.type},fVe=function(n){let r=Ut(this,rp,"m",kEe).call(this,n);if(n.message.content&&!r.content_done){r.content_done=!0;let i=Ut(this,rp,"m",gVe).call(this);this._emit("content.done",{content:n.message.content,parsed:i?i.$parseRaw(n.message.content):null})}n.message.refusal&&!r.refusal_done&&(r.refusal_done=!0,this._emit("refusal.done",{refusal:n.message.refusal})),n.logprobs?.content&&!r.logprobs_content_done&&(r.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:n.logprobs.content})),n.logprobs?.refusal&&!r.logprobs_refusal_done&&(r.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:n.logprobs.refusal}))},BEe=function(){if(this.ended)throw new qn("stream has ended, this shouldn't happen");let n=Ut(this,qB,"f");if(!n)throw new qn("request ended without sending any chunks");return Hr(this,qB,void 0,"f"),Hr(this,p5,[],"f"),QJr(n,Ut(this,fv,"f"))},gVe=function(){let n=Ut(this,fv,"f")?.response_format;return AX(n)?n:null},Q7t=function(n){var r,i,s,o;let a=Ut(this,qB,"f"),{choices:c,...u}=n;a?Object.assign(a,u):a=Hr(this,qB,{...u,choices:[]},"f");for(let{delta:l,finish_reason:d,index:m,logprobs:h=null,...f}of n.choices){let g=a.choices[m];if(g||(g=a.choices[m]={finish_reason:d,index:m,message:{},logprobs:h,...f}),h)if(!g.logprobs)g.logprobs=Object.assign({},h);else{let{content:I,refusal:w,...k}=h;Object.assign(g.logprobs,k),I&&((r=g.logprobs).content??(r.content=[]),g.logprobs.content.push(...I)),w&&((i=g.logprobs).refusal??(i.refusal=[]),g.logprobs.refusal.push(...w))}if(d&&(g.finish_reason=d,Ut(this,fv,"f")&&Jje(Ut(this,fv,"f")))){if(d==="length")throw new t5;if(d==="content_filter")throw new n5}if(Object.assign(g,f),!l)continue;let{content:A,refusal:y,function_call:E,role:_,tool_calls:S,...C}=l;if(Object.assign(g.message,C),y&&(g.message.refusal=(g.message.refusal||"")+y),_&&(g.message.role=_),E&&(g.message.function_call?(E.name&&(g.message.function_call.name=E.name),E.arguments&&((s=g.message.function_call).arguments??(s.arguments=""),g.message.function_call.arguments+=E.arguments)):g.message.function_call=E),A&&(g.message.content=(g.message.content||"")+A,!g.message.refusal&&Ut(this,rp,"m",gVe).call(this)&&(g.message.parsed=uVe(g.message.content))),S){g.message.tool_calls||(g.message.tool_calls=[]);for(let{index:I,id:w,type:k,function:N,...O}of S){let W=(o=g.message.tool_calls)[I]??(o[I]={});Object.assign(W,O),w&&(W.id=w),k&&(W.type=k),N&&(W.function??(W.function={name:N.name??"",arguments:""})),N?.name&&(W.function.name=N.name),N?.arguments&&(W.function.arguments+=N.arguments,B7t(Ut(this,fv,"f"),W)&&(W.function.parsed_arguments=uVe(W.function.arguments)))}}}return a},Symbol.asyncIterator)](){let e=[],n=[],r=!1;return this.on("chunk",i=>{let s=n.shift();s?s.resolve(i):e.push(i)}),this.on("end",()=>{r=!0;for(let i of n)i.resolve(void 0);n.length=0}),this.on("abort",i=>{r=!0;for(let s of n)s.reject(i);n.length=0}),this.on("error",i=>{r=!0;for(let s of n)s.reject(i);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((s,o)=>n.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new hI(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var IX,AVe=v(()=>{p();DEe();IX=class t extends kL{static fromReadableStream(e){let n=new t(null);return n._run(()=>n._fromReadableStream(e)),n}static runTools(e,n,r){let i=new t(n),s={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runTools"}};return i._run(()=>i._runTools(e,n,s)),i}}});var gv,wX=v(()=>{p();kn();xEe();xEe();xi();kr();aVe();AVe();DEe();EX();AVe();tVe();DEe();aVe();gv=class extends Nt{constructor(){super(...arguments),this.messages=new vL(this._client)}create(e,n){return this._client.post("/chat/completions",{body:e,...n,stream:e.stream??!1,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(ct`/chat/completions/${e}`,{...n,__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(ct`/chat/completions/${e}`,{body:n,...r,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/chat/completions",Ki,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/chat/completions/${e}`,{...n,__security:{bearerAuth:!0}})}parse(e,n){return D7t(e.tools),this._client.chat.completions.create(e,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(r=>yX(r,e))}runTools(e,n){return e.stream?IX.runTools(this._client,e,n):CX.runTools(this._client,e,n)}stream(e,n){return kL.createChatCompletion(this._client,e,n)}};gv.Messages=vL});var jB,yVe=v(()=>{p();kn();wX();wX();jB=class extends Nt{constructor(){super(...arguments),this.completions=new gv(this._client)}};jB.Completions=gv});var U7t=v(()=>{p();wX();wX();xEe()});var G7t=v(()=>{p();yVe();U7t()});var $7t=v(()=>{p()});var m5,EVe=v(()=>{p();kn();xi();kr();m5=class extends Nt{create(e,n){return this._client.post("/organization/admin_api_keys",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n){return this._client.get(ct`/organization/admin_api_keys/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/admin_api_keys",Ki,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(ct`/organization/admin_api_keys/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}}});var h5,bVe=v(()=>{p();kn();xi();h5=class extends Nt{list(e={},n){return this._client.getAPIList("/organization/audit_logs",No,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}}});var f5,_Ve=v(()=>{p();kn();xi();kr();f5=class extends Nt{create(e,n){return this._client.post("/organization/certificates",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n={},r){return this._client.get(ct`/organization/certificates/${e}`,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(ct`/organization/certificates/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/certificates",No,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(ct`/organization/certificates/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}activate(e,n){return this._client.getAPIList("/organization/certificates/activate",Dh,{body:e,method:"post",...n,__security:{adminAPIKeyAuth:!0}})}deactivate(e,n){return this._client.getAPIList("/organization/certificates/deactivate",Dh,{body:e,method:"post",...n,__security:{adminAPIKeyAuth:!0}})}}});var g5,xVe=v(()=>{p();kn();g5=class extends Nt{retrieve(e){return this._client.get("/organization/data_retention",{...e,__security:{adminAPIKeyAuth:!0}})}update(e,n){return this._client.post("/organization/data_retention",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}}});var A5,SVe=v(()=>{p();kn();xi();kr();A5=class extends Nt{create(e,n){return this._client.post("/organization/invites",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n){return this._client.get(ct`/organization/invites/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/invites",No,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(ct`/organization/invites/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}}});var y5,CVe=v(()=>{p();kn();xi();kr();y5=class extends Nt{create(e,n){return this._client.post("/organization/roles",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n){return this._client.get(ct`/organization/roles/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(ct`/organization/roles/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/roles",kd,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(ct`/organization/roles/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}}});var E5,IVe=v(()=>{p();kn();xi();kr();E5=class extends Nt{create(e,n){return this._client.post("/organization/spend_alerts",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(ct`/organization/spend_alerts/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/spend_alerts",No,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(ct`/organization/spend_alerts/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}}});var b5,wVe=v(()=>{p();kn();b5=class extends Nt{audioSpeeches(e,n){return this._client.get("/organization/usage/audio_speeches",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}audioTranscriptions(e,n){return this._client.get("/organization/usage/audio_transcriptions",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}codeInterpreterSessions(e,n){return this._client.get("/organization/usage/code_interpreter_sessions",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}completions(e,n){return this._client.get("/organization/usage/completions",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}costs(e,n){return this._client.get("/organization/costs",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}embeddings(e,n){return this._client.get("/organization/usage/embeddings",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}fileSearchCalls(e,n){return this._client.get("/organization/usage/file_search_calls",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}images(e,n){return this._client.get("/organization/usage/images",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}moderations(e,n){return this._client.get("/organization/usage/moderations",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}vectorStores(e,n){return this._client.get("/organization/usage/vector_stores",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}webSearchCalls(e,n){return this._client.get("/organization/usage/web_search_calls",{query:e,...n,__security:{adminAPIKeyAuth:!0}})}}});var _5,TVe=v(()=>{p();kn();xi();kr();_5=class extends Nt{create(e,n,r){return this._client.post(ct`/organization/groups/${e}/roles`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{group_id:i}=n;return this._client.get(ct`/organization/groups/${i}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/organization/groups/${e}/roles`,kd,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{group_id:i}=n;return this._client.delete(ct`/organization/groups/${i}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var x5,vVe=v(()=>{p();kn();xi();kr();x5=class extends Nt{create(e,n,r){return this._client.post(ct`/organization/groups/${e}/users`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{group_id:i}=n;return this._client.get(ct`/organization/groups/${i}/users/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/organization/groups/${e}/users`,kd,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{group_id:i}=n;return this._client.delete(ct`/organization/groups/${i}/users/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var VB,RVe=v(()=>{p();kn();TVe();TVe();vVe();vVe();xi();kr();VB=class extends Nt{constructor(){super(...arguments),this.users=new x5(this._client),this.roles=new _5(this._client)}create(e,n){return this._client.post("/organization/groups",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n){return this._client.get(ct`/organization/groups/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(ct`/organization/groups/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/groups",kd,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(ct`/organization/groups/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}};VB.Users=x5;VB.Roles=_5});var S5,kVe=v(()=>{p();kn();xi();kr();S5=class extends Nt{retrieve(e,n,r){let{project_id:i}=n;return this._client.get(ct`/organization/projects/${i}/api_keys/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/organization/projects/${e}/api_keys`,No,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:i}=n;return this._client.delete(ct`/organization/projects/${i}/api_keys/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var C5,BVe=v(()=>{p();kn();xi();kr();C5=class extends Nt{list(e,n={},r){return this._client.getAPIList(ct`/organization/projects/${e}/certificates`,No,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}activate(e,n,r){return this._client.getAPIList(ct`/organization/projects/${e}/certificates/activate`,Dh,{body:n,method:"post",...r,__security:{adminAPIKeyAuth:!0}})}deactivate(e,n,r){return this._client.getAPIList(ct`/organization/projects/${e}/certificates/deactivate`,Dh,{body:n,method:"post",...r,__security:{adminAPIKeyAuth:!0}})}}});var I5,NVe=v(()=>{p();kn();kr();I5=class extends Nt{retrieve(e,n){return this._client.get(ct`/organization/projects/${e}/data_retention`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(ct`/organization/projects/${e}/data_retention`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}}});var w5,DVe=v(()=>{p();kn();kr();w5=class extends Nt{retrieve(e,n){return this._client.get(ct`/organization/projects/${e}/hosted_tool_permissions`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(ct`/organization/projects/${e}/hosted_tool_permissions`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}}});var T5,PVe=v(()=>{p();kn();kr();T5=class extends Nt{retrieve(e,n){return this._client.get(ct`/organization/projects/${e}/model_permissions`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(ct`/organization/projects/${e}/model_permissions`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(ct`/organization/projects/${e}/model_permissions`,{...n,__security:{adminAPIKeyAuth:!0}})}}});var v5,MVe=v(()=>{p();kn();xi();kr();v5=class extends Nt{listRateLimits(e,n={},r){return this._client.getAPIList(ct`/organization/projects/${e}/rate_limits`,No,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}updateRateLimit(e,n,r){let{project_id:i,...s}=n;return this._client.post(ct`/organization/projects/${i}/rate_limits/${e}`,{body:s,...r,__security:{adminAPIKeyAuth:!0}})}}});var R5,OVe=v(()=>{p();kn();xi();kr();R5=class extends Nt{create(e,n,r){return this._client.post(ct`/projects/${e}/roles`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:i}=n;return this._client.get(ct`/projects/${i}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){let{project_id:i,...s}=n;return this._client.post(ct`/projects/${i}/roles/${e}`,{body:s,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/projects/${e}/roles`,kd,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:i}=n;return this._client.delete(ct`/projects/${i}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var k5,LVe=v(()=>{p();kn();xi();kr();k5=class extends Nt{create(e,n,r){return this._client.post(ct`/organization/projects/${e}/service_accounts`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:i}=n;return this._client.get(ct`/organization/projects/${i}/service_accounts/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){let{project_id:i,...s}=n;return this._client.post(ct`/organization/projects/${i}/service_accounts/${e}`,{body:s,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/organization/projects/${e}/service_accounts`,No,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:i}=n;return this._client.delete(ct`/organization/projects/${i}/service_accounts/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var B5,FVe=v(()=>{p();kn();xi();kr();B5=class extends Nt{create(e,n,r){return this._client.post(ct`/organization/projects/${e}/spend_alerts`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){let{project_id:i,...s}=n;return this._client.post(ct`/organization/projects/${i}/spend_alerts/${e}`,{body:s,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/organization/projects/${e}/spend_alerts`,No,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:i}=n;return this._client.delete(ct`/organization/projects/${i}/spend_alerts/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var N5,QVe=v(()=>{p();kn();xi();kr();N5=class extends Nt{create(e,n,r){let{project_id:i,...s}=n;return this._client.post(ct`/projects/${i}/groups/${e}/roles`,{body:s,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:i,group_id:s}=n;return this._client.get(ct`/projects/${i}/groups/${s}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n,r){let{project_id:i,...s}=n;return this._client.getAPIList(ct`/projects/${i}/groups/${e}/roles`,kd,{query:s,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:i,group_id:s}=n;return this._client.delete(ct`/projects/${i}/groups/${s}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var BL,UVe=v(()=>{p();kn();QVe();QVe();xi();kr();BL=class extends Nt{constructor(){super(...arguments),this.roles=new N5(this._client)}create(e,n,r){return this._client.post(ct`/organization/projects/${e}/groups`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:i,...s}=n;return this._client.get(ct`/organization/projects/${i}/groups/${e}`,{query:s,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/organization/projects/${e}/groups`,kd,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:i}=n;return this._client.delete(ct`/organization/projects/${i}/groups/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}};BL.Roles=N5});var D5,GVe=v(()=>{p();kn();xi();kr();D5=class extends Nt{create(e,n,r){let{project_id:i,...s}=n;return this._client.post(ct`/projects/${i}/users/${e}/roles`,{body:s,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:i,user_id:s}=n;return this._client.get(ct`/projects/${i}/users/${s}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n,r){let{project_id:i,...s}=n;return this._client.getAPIList(ct`/projects/${i}/users/${e}/roles`,kd,{query:s,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:i,user_id:s}=n;return this._client.delete(ct`/projects/${i}/users/${s}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var NL,$Ve=v(()=>{p();kn();GVe();GVe();xi();kr();NL=class extends Nt{constructor(){super(...arguments),this.roles=new D5(this._client)}create(e,n,r){return this._client.post(ct`/organization/projects/${e}/users`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{project_id:i}=n;return this._client.get(ct`/organization/projects/${i}/users/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){let{project_id:i,...s}=n;return this._client.post(ct`/organization/projects/${i}/users/${e}`,{body:s,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/organization/projects/${e}/users`,No,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{project_id:i}=n;return this._client.delete(ct`/organization/projects/${i}/users/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}};NL.Roles=D5});var Lm,WVe=v(()=>{p();kn();kVe();kVe();BVe();BVe();NVe();NVe();DVe();DVe();PVe();PVe();MVe();MVe();OVe();OVe();LVe();LVe();FVe();FVe();UVe();UVe();$Ve();$Ve();xi();kr();Lm=class extends Nt{constructor(){super(...arguments),this.users=new NL(this._client),this.serviceAccounts=new k5(this._client),this.apiKeys=new S5(this._client),this.rateLimits=new v5(this._client),this.modelPermissions=new T5(this._client),this.hostedToolPermissions=new w5(this._client),this.groups=new BL(this._client),this.roles=new R5(this._client),this.dataRetention=new I5(this._client),this.spendAlerts=new B5(this._client),this.certificates=new C5(this._client)}create(e,n){return this._client.post("/organization/projects",{body:e,...n,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n){return this._client.get(ct`/organization/projects/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(ct`/organization/projects/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/projects",No,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}archive(e,n){return this._client.post(ct`/organization/projects/${e}/archive`,{...n,__security:{adminAPIKeyAuth:!0}})}};Lm.Users=NL;Lm.ServiceAccounts=k5;Lm.APIKeys=S5;Lm.RateLimits=v5;Lm.ModelPermissions=T5;Lm.HostedToolPermissions=w5;Lm.Groups=BL;Lm.Roles=R5;Lm.DataRetention=I5;Lm.SpendAlerts=B5;Lm.Certificates=C5});var P5,HVe=v(()=>{p();kn();xi();kr();P5=class extends Nt{create(e,n,r){return this._client.post(ct`/organization/users/${e}/roles`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n,r){let{user_id:i}=n;return this._client.get(ct`/organization/users/${i}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/organization/users/${e}/roles`,kd,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{user_id:i}=n;return this._client.delete(ct`/organization/users/${i}/roles/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var DL,qVe=v(()=>{p();kn();HVe();HVe();xi();kr();DL=class extends Nt{constructor(){super(...arguments),this.roles=new P5(this._client)}retrieve(e,n){return this._client.get(ct`/organization/users/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}update(e,n,r){return this._client.post(ct`/organization/users/${e}`,{body:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e={},n){return this._client.getAPIList("/organization/users",No,{query:e,...n,__security:{adminAPIKeyAuth:!0}})}delete(e,n){return this._client.delete(ct`/organization/users/${e}`,{...n,__security:{adminAPIKeyAuth:!0}})}};DL.Roles=P5});var Fm,jVe=v(()=>{p();kn();EVe();EVe();bVe();bVe();_Ve();_Ve();xVe();xVe();SVe();SVe();CVe();CVe();IVe();IVe();wVe();wVe();RVe();RVe();WVe();WVe();qVe();qVe();Fm=class extends Nt{constructor(){super(...arguments),this.auditLogs=new h5(this._client),this.adminAPIKeys=new m5(this._client),this.usage=new b5(this._client),this.invites=new A5(this._client),this.users=new DL(this._client),this.groups=new VB(this._client),this.roles=new y5(this._client),this.dataRetention=new g5(this._client),this.spendAlerts=new E5(this._client),this.certificates=new f5(this._client),this.projects=new Lm(this._client)}};Fm.AuditLogs=h5;Fm.AdminAPIKeys=m5;Fm.Usage=b5;Fm.Invites=A5;Fm.Users=DL;Fm.Groups=VB;Fm.Roles=y5;Fm.DataRetention=g5;Fm.SpendAlerts=E5;Fm.Certificates=f5;Fm.Projects=Lm});var YB,VVe=v(()=>{p();kn();jVe();jVe();YB=class extends Nt{constructor(){super(...arguments),this.organization=new Fm(this._client)}};YB.Organization=Fm});function*fXr(t){if(!t)return;if(W7t in t){let{values:r,nulls:i}=t;yield*r.entries();for(let s of i)yield[s,null];return}let e=!1,n;t instanceof Headers?n=t.entries():Ije(t)?n=t:(e=!0,n=Object.entries(t??{}));for(let r of n){let i=r[0];if(typeof i!="string")throw new TypeError("expected header name to be a string");let s=Ije(r[1])?r[1]:[r[1]],o=!1;for(let a of s)a!==void 0&&(e&&!o&&(o=!0,yield[i,null]),yield[i,a])}}var W7t,In,Bc=v(()=>{p();pv();W7t=Symbol("brand.privateNullableHeaders");In=t=>{let e=new Headers,n=new Set;for(let r of t){let i=new Set;for(let[s,o]of fXr(r)){let a=s.toLowerCase();i.has(a)||(e.delete(s),i.add(a)),o===null?(e.delete(s),n.add(a)):(e.append(s,o),n.delete(a))}}return{[W7t]:!0,values:e,nulls:n}}});var M5,YVe=v(()=>{p();kn();Bc();M5=class extends Nt{create(e,n){return this._client.post("/audio/speech",{body:e,...n,headers:In([{Accept:"application/octet-stream"},n?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}});var O5,zVe=v(()=>{p();kn();$0();O5=class extends Nt{create(e,n){return this._client.post("/audio/transcriptions",Ph({body:e,...n,stream:e.stream??!1,__metadata:{model:e.model},__security:{bearerAuth:!0}},this._client))}}});var L5,KVe=v(()=>{p();kn();$0();L5=class extends Nt{create(e,n){return this._client.post("/audio/translations",Ph({body:e,...n,__metadata:{model:e.model},__security:{bearerAuth:!0}},this._client))}}});var fI,JVe=v(()=>{p();kn();YVe();YVe();zVe();zVe();KVe();KVe();fI=class extends Nt{constructor(){super(...arguments),this.transcriptions=new O5(this._client),this.translations=new L5(this._client),this.speech=new M5(this._client)}};fI.Transcriptions=O5;fI.Translations=L5;fI.Speech=M5});var PL,XVe=v(()=>{p();kn();xi();kr();PL=class extends Nt{create(e,n){return this._client.post("/batches",{body:e,...n,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(ct`/batches/${e}`,{...n,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/batches",Ki,{query:e,...n,__security:{bearerAuth:!0}})}cancel(e,n){return this._client.post(ct`/batches/${e}/cancel`,{...n,__security:{bearerAuth:!0}})}}});var F5,ZVe=v(()=>{p();kn();xi();Bc();kr();F5=class extends Nt{create(e,n){return this._client.post("/assistants",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(ct`/assistants/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(ct`/assistants/${e}`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/assistants",Ki,{query:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/assistants/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}}});var Q5,eYe=v(()=>{p();kn();Bc();Q5=class extends Nt{create(e,n){return this._client.post("/realtime/sessions",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}}});var U5,tYe=v(()=>{p();kn();Bc();U5=class extends Nt{create(e,n){return this._client.post("/realtime/transcription_sessions",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}}});var zB,nYe=v(()=>{p();kn();eYe();eYe();tYe();tYe();zB=class extends Nt{constructor(){super(...arguments),this.sessions=new Q5(this._client),this.transcriptionSessions=new U5(this._client)}};zB.Sessions=Q5;zB.TranscriptionSessions=U5});var G5,rYe=v(()=>{p();kn();Bc();kr();G5=class extends Nt{create(e,n){return this._client.post("/chatkit/sessions",{body:e,...n,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers]),__security:{bearerAuth:!0}})}cancel(e,n){return this._client.post(ct`/chatkit/sessions/${e}/cancel`,{...n,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers]),__security:{bearerAuth:!0}})}}});var $5,iYe=v(()=>{p();kn();xi();Bc();kr();$5=class extends Nt{retrieve(e,n){return this._client.get(ct`/chatkit/threads/${e}`,{...n,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers]),__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/chatkit/threads",No,{query:e,...n,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers]),__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/chatkit/threads/${e}`,{...n,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers]),__security:{bearerAuth:!0}})}listItems(e,n={},r){return this._client.getAPIList(ct`/chatkit/threads/${e}/items`,No,{query:n,...r,headers:In([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers]),__security:{bearerAuth:!0}})}}});var KB,sYe=v(()=>{p();kn();rYe();rYe();iYe();iYe();KB=class extends Nt{constructor(){super(...arguments),this.sessions=new G5(this._client),this.threads=new $5(this._client)}};KB.Sessions=G5;KB.Threads=$5});var W5,oYe=v(()=>{p();kn();xi();Bc();kr();W5=class extends Nt{create(e,n,r){return this._client.post(ct`/threads/${e}/messages`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n,r){let{thread_id:i}=n;return this._client.get(ct`/threads/${i}/messages/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){let{thread_id:i,...s}=n;return this._client.post(ct`/threads/${i}/messages/${e}`,{body:s,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/threads/${e}/messages`,Ki,{query:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}delete(e,n,r){let{thread_id:i}=n;return this._client.delete(ct`/threads/${i}/messages/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}}});var H5,aYe=v(()=>{p();kn();xi();Bc();kr();H5=class extends Nt{retrieve(e,n,r){let{thread_id:i,run_id:s,...o}=n;return this._client.get(ct`/threads/${i}/runs/${s}/steps/${e}`,{query:o,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e,n,r){let{thread_id:i,...s}=n;return this._client.getAPIList(ct`/threads/${i}/runs/${e}/steps`,Ki,{query:s,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}}});var H7t,q7t=v(()=>{p();G0();mEe();H7t=t=>{if(typeof Buffer<"u"){let e=Buffer.from(t,"base64");return Array.from(new Float32Array(e.buffer,e.byteOffset,e.length/Float32Array.BYTES_PER_ELEMENT))}else{let e=atob(t),n=e.length,r=new Uint8Array(n);for(let i=0;i{p();My=t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0}});var TX=v(()=>{p();pv();q7t();cYe();dX();Cje();i5();Qje()});var Qm,OL,lYe,gI,PEe,fx,LL,q5,ML,LEe,Oy,MEe,OEe,kX,vX,RX,j7t,V7t,Y7t,z7t,K7t,J7t,X7t,Av,uYe=v(()=>{p();U0();dVe();hx();vEe();TX();Av=class extends HB{constructor(){super(...arguments),Qm.add(this),lYe.set(this,[]),gI.set(this,{}),PEe.set(this,{}),fx.set(this,void 0),LL.set(this,void 0),q5.set(this,void 0),ML.set(this,void 0),LEe.set(this,void 0),Oy.set(this,void 0),MEe.set(this,void 0),OEe.set(this,void 0),kX.set(this,void 0)}[(lYe=new WeakMap,gI=new WeakMap,PEe=new WeakMap,fx=new WeakMap,LL=new WeakMap,q5=new WeakMap,ML=new WeakMap,LEe=new WeakMap,Oy=new WeakMap,MEe=new WeakMap,OEe=new WeakMap,kX=new WeakMap,Qm=new WeakSet,Symbol.asyncIterator)](){let e=[],n=[],r=!1;return this.on("event",i=>{let s=n.shift();s?s.resolve(i):e.push(i)}),this.on("end",()=>{r=!0;for(let i of n)i.resolve(void 0);n.length=0}),this.on("abort",i=>{r=!0;for(let s of n)s.reject(i);n.length=0}),this.on("error",i=>{r=!0;for(let s of n)s.reject(i);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((s,o)=>n.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(e){let n=new OL;return n._run(()=>n._fromReadableStream(e)),n}async _fromReadableStream(e,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),this._connected();let i=hI.fromReadableStream(e,this.controller);for await(let s of i)Ut(this,Qm,"m",vX).call(this,s);if(i.controller.signal?.aborted)throw new Rd;return this._addRun(Ut(this,Qm,"m",RX).call(this))}toReadableStream(){return new hI(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(e,n,r,i){let s=new OL;return s._run(()=>s._runToolAssistantStream(e,n,r,{...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"stream"}})),s}async _createToolAssistantStream(e,n,r,i){let s=i?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort()));let o={...r,stream:!0},a=await e.submitToolOutputs(n,o,{...i,signal:this.controller.signal});this._connected();for await(let c of a)Ut(this,Qm,"m",vX).call(this,c);if(a.controller.signal?.aborted)throw new Rd;return this._addRun(Ut(this,Qm,"m",RX).call(this))}static createThreadAssistantStream(e,n,r){let i=new OL;return i._run(()=>i._threadAssistantStream(e,n,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),i}static createAssistantStream(e,n,r,i){let s=new OL;return s._run(()=>s._runAssistantStream(e,n,r,{...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"stream"}})),s}currentEvent(){return Ut(this,MEe,"f")}currentRun(){return Ut(this,OEe,"f")}currentMessageSnapshot(){return Ut(this,fx,"f")}currentRunStepSnapshot(){return Ut(this,kX,"f")}async finalRunSteps(){return await this.done(),Object.values(Ut(this,gI,"f"))}async finalMessages(){return await this.done(),Object.values(Ut(this,PEe,"f"))}async finalRun(){if(await this.done(),!Ut(this,LL,"f"))throw Error("Final run was not received.");return Ut(this,LL,"f")}async _createThreadAssistantStream(e,n,r){let i=r?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort()));let s={...n,stream:!0},o=await e.createAndRun(s,{...r,signal:this.controller.signal});this._connected();for await(let a of o)Ut(this,Qm,"m",vX).call(this,a);if(o.controller.signal?.aborted)throw new Rd;return this._addRun(Ut(this,Qm,"m",RX).call(this))}async _createAssistantStream(e,n,r,i){let s=i?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort()));let o={...r,stream:!0},a=await e.create(n,o,{...i,signal:this.controller.signal});this._connected();for await(let c of a)Ut(this,Qm,"m",vX).call(this,c);if(a.controller.signal?.aborted)throw new Rd;return this._addRun(Ut(this,Qm,"m",RX).call(this))}static accumulateDelta(e,n){for(let[r,i]of Object.entries(n)){if(!e.hasOwnProperty(r)){e[r]=i;continue}let s=e[r];if(s==null){e[r]=i;continue}if(r==="index"||r==="type"){e[r]=i;continue}if(typeof s=="string"&&typeof i=="string")s+=i;else if(typeof s=="number"&&typeof i=="number")s+=i;else if(r5(s)&&r5(i))s=this.accumulateDelta(s,i);else if(Array.isArray(s)&&Array.isArray(i)){if(s.every(o=>typeof o=="string"||typeof o=="number")){s.push(...i);continue}for(let o of i){if(!r5(o))throw new Error(`Expected array delta entry to be an object but got: ${o}`);let a=o.index;if(a==null)throw console.error(o),new Error("Expected array delta entry to have an `index` property");if(typeof a!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${a}`);let c=s[a];c==null?s.push(o):s[a]=this.accumulateDelta(c,o)}continue}else throw Error(`Unhandled record type: ${r}, deltaValue: ${i}, accValue: ${s}`);e[r]=s}return e}_addRun(e){return e}async _threadAssistantStream(e,n,r){return await this._createThreadAssistantStream(n,e,r)}async _runAssistantStream(e,n,r,i){return await this._createAssistantStream(n,e,r,i)}async _runToolAssistantStream(e,n,r,i){return await this._createToolAssistantStream(n,e,r,i)}};OL=Av,vX=function(e){if(!this.ended)switch(Hr(this,MEe,e,"f"),Ut(this,Qm,"m",Y7t).call(this,e),e.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":Ut(this,Qm,"m",X7t).call(this,e);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":Ut(this,Qm,"m",V7t).call(this,e);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":Ut(this,Qm,"m",j7t).call(this,e);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier");default:}},RX=function(){if(this.ended)throw new qn("stream has ended, this shouldn't happen");if(!Ut(this,LL,"f"))throw Error("Final run has not been received");return Ut(this,LL,"f")},j7t=function(e){let[n,r]=Ut(this,Qm,"m",K7t).call(this,e,Ut(this,fx,"f"));Hr(this,fx,n,"f"),Ut(this,PEe,"f")[n.id]=n;for(let i of r){let s=n.content[i.index];s?.type=="text"&&this._emit("textCreated",s.text)}switch(e.event){case"thread.message.created":this._emit("messageCreated",e.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",e.data.delta,n),e.data.delta.content)for(let i of e.data.delta.content){if(i.type=="text"&&i.text){let s=i.text,o=n.content[i.index];if(o&&o.type=="text")this._emit("textDelta",s,o.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(i.index!=Ut(this,q5,"f")){if(Ut(this,ML,"f"))switch(Ut(this,ML,"f").type){case"text":this._emit("textDone",Ut(this,ML,"f").text,Ut(this,fx,"f"));break;case"image_file":this._emit("imageFileDone",Ut(this,ML,"f").image_file,Ut(this,fx,"f"));break}Hr(this,q5,i.index,"f")}Hr(this,ML,n.content[i.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(Ut(this,q5,"f")!==void 0){let i=e.data.content[Ut(this,q5,"f")];if(i)switch(i.type){case"image_file":this._emit("imageFileDone",i.image_file,Ut(this,fx,"f"));break;case"text":this._emit("textDone",i.text,Ut(this,fx,"f"));break}}Ut(this,fx,"f")&&this._emit("messageDone",e.data),Hr(this,fx,void 0,"f")}},V7t=function(e){let n=Ut(this,Qm,"m",z7t).call(this,e);switch(Hr(this,kX,n,"f"),e.event){case"thread.run.step.created":this._emit("runStepCreated",e.data);break;case"thread.run.step.delta":let r=e.data.delta;if(r.step_details&&r.step_details.type=="tool_calls"&&r.step_details.tool_calls&&n.step_details.type=="tool_calls")for(let s of r.step_details.tool_calls)s.index==Ut(this,LEe,"f")?this._emit("toolCallDelta",s,n.step_details.tool_calls[s.index]):(Ut(this,Oy,"f")&&this._emit("toolCallDone",Ut(this,Oy,"f")),Hr(this,LEe,s.index,"f"),Hr(this,Oy,n.step_details.tool_calls[s.index],"f"),Ut(this,Oy,"f")&&this._emit("toolCallCreated",Ut(this,Oy,"f")));this._emit("runStepDelta",e.data.delta,n);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":Hr(this,kX,void 0,"f"),e.data.step_details.type=="tool_calls"&&Ut(this,Oy,"f")&&(this._emit("toolCallDone",Ut(this,Oy,"f")),Hr(this,Oy,void 0,"f")),this._emit("runStepDone",e.data,n);break;case"thread.run.step.in_progress":break}},Y7t=function(e){Ut(this,lYe,"f").push(e),this._emit("event",e)},z7t=function(e){switch(e.event){case"thread.run.step.created":return Ut(this,gI,"f")[e.data.id]=e.data,e.data;case"thread.run.step.delta":let n=Ut(this,gI,"f")[e.data.id];if(!n)throw Error("Received a RunStepDelta before creation of a snapshot");let r=e.data;if(r.delta){let i=OL.accumulateDelta(n,r.delta);Ut(this,gI,"f")[e.data.id]=i}return Ut(this,gI,"f")[e.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":Ut(this,gI,"f")[e.data.id]=e.data;break}if(Ut(this,gI,"f")[e.data.id])return Ut(this,gI,"f")[e.data.id];throw new Error("No snapshot available")},K7t=function(e,n){let r=[];switch(e.event){case"thread.message.created":return[e.data,r];case"thread.message.delta":if(!n)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let i=e.data;if(i.delta.content)for(let s of i.delta.content)if(s.index in n.content){let o=n.content[s.index];n.content[s.index]=Ut(this,Qm,"m",J7t).call(this,s,o)}else n.content[s.index]=s,r.push(s);return[n,r];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(n)return[n,r];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},J7t=function(e,n){return OL.accumulateDelta(n,e)},X7t=function(e){switch(Hr(this,OEe,e.data,"f"),e.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":Hr(this,LL,e.data,"f"),Ut(this,Oy,"f")&&(this._emit("toolCallDone",Ut(this,Oy,"f")),Hr(this,Oy,void 0,"f"));break;case"thread.run.cancelling":break}}});var FL,dYe=v(()=>{p();kn();aYe();aYe();xi();Bc();uYe();i5();kr();FL=class extends Nt{constructor(){super(...arguments),this.steps=new H5(this._client)}create(e,n,r){let{include:i,...s}=n;return this._client.post(ct`/threads/${e}/runs`,{query:{include:i},body:s,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),stream:n.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}retrieve(e,n,r){let{thread_id:i}=n;return this._client.get(ct`/threads/${i}/runs/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){let{thread_id:i,...s}=n;return this._client.post(ct`/threads/${i}/runs/${e}`,{body:s,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/threads/${e}/runs`,Ki,{query:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}cancel(e,n,r){let{thread_id:i}=n;return this._client.post(ct`/threads/${i}/runs/${e}/cancel`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}async createAndPoll(e,n,r){let i=await this.create(e,n,r);return await this.poll(i.id,{thread_id:e},r)}createAndStream(e,n,r){return Av.createAssistantStream(e,this._client.beta.threads.runs,n,r)}async poll(e,n,r){let i=In([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:s,response:o}=await this.retrieve(e,n,{...r,headers:{...r?.headers,...i}}).withResponse();switch(s.status){case"queued":case"in_progress":case"cancelling":let a=5e3;if(r?.pollIntervalMs)a=r.pollIntervalMs;else{let c=o.headers.get("openai-poll-after-ms");if(c){let u=parseInt(c);isNaN(u)||(a=u)}}await pI(a);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return s}}}stream(e,n,r){return Av.createAssistantStream(e,this._client.beta.threads.runs,n,r)}submitToolOutputs(e,n,r){let{thread_id:i,...s}=n;return this._client.post(ct`/threads/${i}/runs/${e}/submit_tool_outputs`,{body:s,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),stream:n.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}async submitToolOutputsAndPoll(e,n,r){let i=await this.submitToolOutputs(e,n,r);return await this.poll(i.id,n,r)}submitToolOutputsStream(e,n,r){return Av.createToolAssistantStream(e,this._client.beta.threads.runs,n,r)}};FL.Steps=H5});var JB,pYe=v(()=>{p();kn();oYe();oYe();dYe();dYe();Bc();uYe();kr();JB=class extends Nt{constructor(){super(...arguments),this.runs=new FL(this._client),this.messages=new W5(this._client)}create(e={},n){return this._client.post("/threads",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(ct`/threads/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(ct`/threads/${e}`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/threads/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}createAndRun(e,n){return this._client.post("/threads/runs",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),stream:e.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}async createAndRunPoll(e,n){let r=await this.createAndRun(e,n);return await this.runs.poll(r.id,{thread_id:r.thread_id},n)}createAndRunStream(e,n){return Av.createThreadAssistantStream(e,this._client.beta.threads,n)}};JB.Runs=FL;JB.Messages=W5});var gx,mYe=v(()=>{p();kn();ZVe();ZVe();nYe();nYe();sYe();sYe();pYe();pYe();gx=class extends Nt{constructor(){super(...arguments),this.realtime=new zB(this._client),this.chatkit=new KB(this._client),this.assistants=new F5(this._client),this.threads=new JB(this._client)}};gx.Realtime=zB;gx.ChatKit=KB;gx.Assistants=F5;gx.Threads=JB});var QL,hYe=v(()=>{p();kn();QL=class extends Nt{create(e,n){return this._client.post("/completions",{body:e,...n,stream:e.stream??!1,__security:{bearerAuth:!0}})}}});var j5,fYe=v(()=>{p();kn();Bc();kr();j5=class extends Nt{retrieve(e,n,r){let{container_id:i}=n;return this._client.get(ct`/containers/${i}/files/${e}/content`,{...r,headers:In([{Accept:"application/binary"},r?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}});var UL,gYe=v(()=>{p();kn();fYe();fYe();xi();Bc();$0();kr();UL=class extends Nt{constructor(){super(...arguments),this.content=new j5(this._client)}create(e,n,r){return this._client.post(ct`/containers/${e}/files`,WB({body:n,...r,__security:{bearerAuth:!0}},this._client))}retrieve(e,n,r){let{container_id:i}=n;return this._client.get(ct`/containers/${i}/files/${e}`,{...r,__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/containers/${e}/files`,Ki,{query:n,...r,__security:{bearerAuth:!0}})}delete(e,n,r){let{container_id:i}=n;return this._client.delete(ct`/containers/${i}/files/${e}`,{...r,headers:In([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}};UL.Content=j5});var XB,AYe=v(()=>{p();kn();gYe();gYe();xi();Bc();kr();XB=class extends Nt{constructor(){super(...arguments),this.files=new UL(this._client)}create(e,n){return this._client.post("/containers",{body:e,...n,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(ct`/containers/${e}`,{...n,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/containers",Ki,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/containers/${e}`,{...n,headers:In([{Accept:"*/*"},n?.headers]),__security:{bearerAuth:!0}})}};XB.Files=UL});var V5,yYe=v(()=>{p();kn();xi();kr();V5=class extends Nt{create(e,n,r){let{include:i,...s}=n;return this._client.post(ct`/conversations/${e}/items`,{query:{include:i},body:s,...r,__security:{bearerAuth:!0}})}retrieve(e,n,r){let{conversation_id:i,...s}=n;return this._client.get(ct`/conversations/${i}/items/${e}`,{query:s,...r,__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/conversations/${e}/items`,No,{query:n,...r,__security:{bearerAuth:!0}})}delete(e,n,r){let{conversation_id:i}=n;return this._client.delete(ct`/conversations/${i}/items/${e}`,{...r,__security:{bearerAuth:!0}})}}});var ZB,EYe=v(()=>{p();kn();yYe();yYe();kr();ZB=class extends Nt{constructor(){super(...arguments),this.items=new V5(this._client)}create(e={},n){return this._client.post("/conversations",{body:e,...n,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(ct`/conversations/${e}`,{...n,__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(ct`/conversations/${e}`,{body:n,...r,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/conversations/${e}`,{...n,__security:{bearerAuth:!0}})}};ZB.Items=V5});var GL,bYe=v(()=>{p();kn();TX();GL=class extends Nt{create(e,n){let r=!!e.encoding_format,i=r?e.encoding_format:"base64";r&&td(this._client).debug("embeddings/user defined encoding_format:",e.encoding_format);let s=this._client.post("/embeddings",{body:{...e,encoding_format:i},...n,__security:{bearerAuth:!0}});return r?s:(td(this._client).debug("embeddings/decoding base64 embeddings from base64"),s._thenUnwrap(o=>(o&&o.data&&o.data.forEach(a=>{let c=a.embedding;a.embedding=H7t(c)}),o)))}}});var Y5,_Ye=v(()=>{p();kn();xi();kr();Y5=class extends Nt{retrieve(e,n,r){let{eval_id:i,run_id:s}=n;return this._client.get(ct`/evals/${i}/runs/${s}/output_items/${e}`,{...r,__security:{bearerAuth:!0}})}list(e,n,r){let{eval_id:i,...s}=n;return this._client.getAPIList(ct`/evals/${i}/runs/${e}/output_items`,Ki,{query:s,...r,__security:{bearerAuth:!0}})}}});var $L,xYe=v(()=>{p();kn();_Ye();_Ye();xi();kr();$L=class extends Nt{constructor(){super(...arguments),this.outputItems=new Y5(this._client)}create(e,n,r){return this._client.post(ct`/evals/${e}/runs`,{body:n,...r,__security:{bearerAuth:!0}})}retrieve(e,n,r){let{eval_id:i}=n;return this._client.get(ct`/evals/${i}/runs/${e}`,{...r,__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/evals/${e}/runs`,Ki,{query:n,...r,__security:{bearerAuth:!0}})}delete(e,n,r){let{eval_id:i}=n;return this._client.delete(ct`/evals/${i}/runs/${e}`,{...r,__security:{bearerAuth:!0}})}cancel(e,n,r){let{eval_id:i}=n;return this._client.post(ct`/evals/${i}/runs/${e}`,{...r,__security:{bearerAuth:!0}})}};$L.OutputItems=Y5});var eN,SYe=v(()=>{p();kn();xYe();xYe();xi();kr();eN=class extends Nt{constructor(){super(...arguments),this.runs=new $L(this._client)}create(e,n){return this._client.post("/evals",{body:e,...n,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(ct`/evals/${e}`,{...n,__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(ct`/evals/${e}`,{body:n,...r,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/evals",Ki,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/evals/${e}`,{...n,__security:{bearerAuth:!0}})}};eN.Runs=$L});var WL,CYe=v(()=>{p();kn();xi();Bc();i5();hx();$0();kr();WL=class extends Nt{create(e,n){return this._client.post("/files",Ph({body:e,...n,__security:{bearerAuth:!0}},this._client))}retrieve(e,n){return this._client.get(ct`/files/${e}`,{...n,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/files",Ki,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/files/${e}`,{...n,__security:{bearerAuth:!0}})}content(e,n){return this._client.get(ct`/files/${e}/content`,{...n,headers:In([{Accept:"application/binary"},n?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}async waitForProcessing(e,{pollInterval:n=5e3,maxWait:r=1800*1e3}={}){let i=new Set(["processed","error","deleted"]),s=Date.now(),o=await this.retrieve(e);for(;!o.status||!i.has(o.status);)if(await pI(n),o=await this.retrieve(e),Date.now()-s>r)throw new GB({message:`Giving up on waiting for file ${e} to finish processing after ${r} milliseconds.`});return o}}});var z5,IYe=v(()=>{p();kn();z5=class extends Nt{}});var K5,wYe=v(()=>{p();kn();K5=class extends Nt{run(e,n){return this._client.post("/fine_tuning/alpha/graders/run",{body:e,...n,__security:{bearerAuth:!0}})}validate(e,n){return this._client.post("/fine_tuning/alpha/graders/validate",{body:e,...n,__security:{bearerAuth:!0}})}}});var HL,TYe=v(()=>{p();kn();wYe();wYe();HL=class extends Nt{constructor(){super(...arguments),this.graders=new K5(this._client)}};HL.Graders=K5});var J5,vYe=v(()=>{p();kn();xi();kr();J5=class extends Nt{create(e,n,r){return this._client.getAPIList(ct`/fine_tuning/checkpoints/${e}/permissions`,Dh,{body:n,method:"post",...r,__security:{adminAPIKeyAuth:!0}})}retrieve(e,n={},r){return this._client.get(ct`/fine_tuning/checkpoints/${e}/permissions`,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/fine_tuning/checkpoints/${e}/permissions`,No,{query:n,...r,__security:{adminAPIKeyAuth:!0}})}delete(e,n,r){let{fine_tuned_model_checkpoint:i}=n;return this._client.delete(ct`/fine_tuning/checkpoints/${i}/permissions/${e}`,{...r,__security:{adminAPIKeyAuth:!0}})}}});var qL,RYe=v(()=>{p();kn();vYe();vYe();qL=class extends Nt{constructor(){super(...arguments),this.permissions=new J5(this._client)}};qL.Permissions=J5});var X5,kYe=v(()=>{p();kn();xi();kr();X5=class extends Nt{list(e,n={},r){return this._client.getAPIList(ct`/fine_tuning/jobs/${e}/checkpoints`,Ki,{query:n,...r,__security:{bearerAuth:!0}})}}});var jL,BYe=v(()=>{p();kn();kYe();kYe();xi();kr();jL=class extends Nt{constructor(){super(...arguments),this.checkpoints=new X5(this._client)}create(e,n){return this._client.post("/fine_tuning/jobs",{body:e,...n,__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(ct`/fine_tuning/jobs/${e}`,{...n,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/fine_tuning/jobs",Ki,{query:e,...n,__security:{bearerAuth:!0}})}cancel(e,n){return this._client.post(ct`/fine_tuning/jobs/${e}/cancel`,{...n,__security:{bearerAuth:!0}})}listEvents(e,n={},r){return this._client.getAPIList(ct`/fine_tuning/jobs/${e}/events`,Ki,{query:n,...r,__security:{bearerAuth:!0}})}pause(e,n){return this._client.post(ct`/fine_tuning/jobs/${e}/pause`,{...n,__security:{bearerAuth:!0}})}resume(e,n){return this._client.post(ct`/fine_tuning/jobs/${e}/resume`,{...n,__security:{bearerAuth:!0}})}};jL.Checkpoints=X5});var Ax,NYe=v(()=>{p();kn();IYe();IYe();TYe();TYe();RYe();RYe();BYe();BYe();Ax=class extends Nt{constructor(){super(...arguments),this.methods=new z5(this._client),this.jobs=new jL(this._client),this.checkpoints=new qL(this._client),this.alpha=new HL(this._client)}};Ax.Methods=z5;Ax.Jobs=jL;Ax.Checkpoints=qL;Ax.Alpha=HL});var Z5,DYe=v(()=>{p();kn();Z5=class extends Nt{}});var tN,PYe=v(()=>{p();kn();DYe();DYe();tN=class extends Nt{constructor(){super(...arguments),this.graderModels=new Z5(this._client)}};tN.GraderModels=Z5});var VL,MYe=v(()=>{p();kn();$0();VL=class extends Nt{createVariation(e,n){return this._client.post("/images/variations",Ph({body:e,...n,__security:{bearerAuth:!0}},this._client))}edit(e,n){return this._client.post("/images/edits",Ph({body:e,...n,stream:e.stream??!1,__security:{bearerAuth:!0}},this._client))}generate(e,n){return this._client.post("/images/generations",{body:e,...n,stream:e.stream??!1,__security:{bearerAuth:!0}})}}});var YL,OYe=v(()=>{p();kn();xi();kr();YL=class extends Nt{retrieve(e,n){return this._client.get(ct`/models/${e}`,{...n,__security:{bearerAuth:!0}})}list(e){return this._client.getAPIList("/models",Dh,{...e,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/models/${e}`,{...n,__security:{bearerAuth:!0}})}}});var zL,LYe=v(()=>{p();kn();zL=class extends Nt{create(e,n){return this._client.post("/moderations",{body:e,...n,__security:{bearerAuth:!0}})}}});var e3,FYe=v(()=>{p();kn();Bc();kr();e3=class extends Nt{accept(e,n,r){return this._client.post(ct`/realtime/calls/${e}/accept`,{body:n,...r,headers:In([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}hangup(e,n){return this._client.post(ct`/realtime/calls/${e}/hangup`,{...n,headers:In([{Accept:"*/*"},n?.headers]),__security:{bearerAuth:!0}})}refer(e,n,r){return this._client.post(ct`/realtime/calls/${e}/refer`,{body:n,...r,headers:In([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}reject(e,n={},r){return this._client.post(ct`/realtime/calls/${e}/reject`,{body:n,...r,headers:In([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}}});var t3,QYe=v(()=>{p();kn();t3=class extends Nt{create(e,n){return this._client.post("/realtime/client_secrets",{body:e,...n,__security:{bearerAuth:!0}})}}});var yv,UYe=v(()=>{p();kn();FYe();FYe();QYe();QYe();yv=class extends Nt{constructor(){super(...arguments),this.clientSecrets=new t3(this._client),this.calls=new e3(this._client)}};yv.ClientSecrets=t3;yv.Calls=e3});function Z7t(t,e){return!e||!jXr(e)?{...t,output_parsed:null,output:t.output.map(n=>n.type==="function_call"?{...n,parsed_arguments:null}:n.type==="message"?{...n,content:n.content.map(r=>({...r,parsed:null}))}:n)}:GYe(t,e)}function GYe(t,e){let n=t.output.map(i=>{if(i.type==="function_call")return{...i,parsed_arguments:zXr(e,i)};if(i.type==="message"){let s=i.content.map(o=>o.type==="output_text"?{...o,parsed:qXr(e,o.text)}:o);return{...i,content:s}}return i}),r=Object.assign({},t,{output:n});return Object.getOwnPropertyDescriptor(t,"output_text")||FEe(r),Object.defineProperty(r,"output_parsed",{enumerable:!0,get(){for(let i of r.output)if(i.type==="message"){for(let s of i.content)if(s.type==="output_text"&&s.parsed!==null)return s.parsed}return null}}),r}function qXr(t,e){return t.text?.format?.type!=="json_schema"?null:"$parseRaw"in t.text?.format?(t.text?.format).$parseRaw(e):JSON.parse(e)}function jXr(t){return!!AX(t.text?.format)}function VXr(t){return t?.$brand==="auto-parseable-tool"}function YXr(t,e){return t.find(n=>n.type==="function"&&n.name===e)}function zXr(t,e){let n=YXr(t.tools??[],e.name);return{...e,...e,parsed_arguments:VXr(n)?n.$parseRaw(e.arguments):n?.strict?JSON.parse(e.arguments):null}}function FEe(t){let e=[];for(let n of t.output)if(n.type==="message")for(let r of n.content)r.type==="output_text"&&e.push(r.text);t.output_text=e.join("")}var $Ye=v(()=>{p();hx();EX()});function KXr(t,e){return Z7t(t,e)}var n3,QEe,nN,UEe,eKt,tKt,nKt,rKt,GEe,iKt=v(()=>{p();U0();hx();vEe();$Ye();GEe=class t extends HB{constructor(e){super(),n3.add(this),QEe.set(this,void 0),nN.set(this,void 0),UEe.set(this,void 0),Hr(this,QEe,e,"f")}static createResponse(e,n,r){let i=new t(n);return i._run(()=>i._createOrRetrieveResponse(e,n,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),i}async _createOrRetrieveResponse(e,n,r){let i=r?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort())),Ut(this,n3,"m",eKt).call(this);let s,o=null;"response_id"in n?(s=await e.responses.retrieve(n.response_id,{stream:!0},{...r,signal:this.controller.signal,stream:!0}),o=n.starting_after??null):s=await e.responses.create({...n,stream:!0},{...r,signal:this.controller.signal}),this._connected();for await(let a of s)Ut(this,n3,"m",tKt).call(this,a,o);if(s.controller.signal?.aborted)throw new Rd;return Ut(this,n3,"m",nKt).call(this)}[(QEe=new WeakMap,nN=new WeakMap,UEe=new WeakMap,n3=new WeakSet,eKt=function(){this.ended||Hr(this,nN,void 0,"f")},tKt=function(n,r){if(this.ended)return;let i=(o,a)=>{(r==null||a.sequence_number>r)&&this._emit(o,a)},s=Ut(this,n3,"m",rKt).call(this,n);switch(i("event",n),n.type){case"response.output_text.delta":{let o=s.output[n.output_index];if(!o)throw new qn(`missing output at index ${n.output_index}`);if(o.type==="message"){let a=o.content[n.content_index];if(!a)throw new qn(`missing content at index ${n.content_index}`);if(a.type!=="output_text")throw new qn(`expected content to be 'output_text', got ${a.type}`);i("response.output_text.delta",{...n,snapshot:a.text})}break}case"response.function_call_arguments.delta":{let o=s.output[n.output_index];if(!o)throw new qn(`missing output at index ${n.output_index}`);o.type==="function_call"&&i("response.function_call_arguments.delta",{...n,snapshot:o.arguments});break}default:i(n.type,n);break}},nKt=function(){if(this.ended)throw new qn("stream has ended, this shouldn't happen");let n=Ut(this,nN,"f");if(!n)throw new qn("request ended without sending any events");Hr(this,nN,void 0,"f");let r=KXr(n,Ut(this,QEe,"f"));return Hr(this,UEe,r,"f"),r},rKt=function(n){let r=Ut(this,nN,"f");if(!r){if(n.type!=="response.created")throw new qn(`When snapshot hasn't been set yet, expected 'response.created' event, got ${n.type}`);return r=Hr(this,nN,n.response,"f"),r}switch(n.type){case"response.output_item.added":{r.output.push(n.item);break}case"response.content_part.added":{let i=r.output[n.output_index];if(!i)throw new qn(`missing output at index ${n.output_index}`);let s=i.type,o=n.part;s==="message"&&o.type!=="reasoning_text"?i.content.push(o):s==="reasoning"&&o.type==="reasoning_text"&&(i.content||(i.content=[]),i.content.push(o));break}case"response.output_text.delta":{let i=r.output[n.output_index];if(!i)throw new qn(`missing output at index ${n.output_index}`);if(i.type==="message"){let s=i.content[n.content_index];if(!s)throw new qn(`missing content at index ${n.content_index}`);if(s.type!=="output_text")throw new qn(`expected content to be 'output_text', got ${s.type}`);s.text+=n.delta}break}case"response.function_call_arguments.delta":{let i=r.output[n.output_index];if(!i)throw new qn(`missing output at index ${n.output_index}`);i.type==="function_call"&&(i.arguments+=n.delta);break}case"response.reasoning_text.delta":{let i=r.output[n.output_index];if(!i)throw new qn(`missing output at index ${n.output_index}`);if(i.type==="reasoning"){let s=i.content?.[n.content_index];if(!s)throw new qn(`missing content at index ${n.content_index}`);if(s.type!=="reasoning_text")throw new qn(`expected content to be 'reasoning_text', got ${s.type}`);s.text+=n.delta}break}case"response.completed":{Hr(this,nN,n.response,"f");break}}return r},Symbol.asyncIterator)](){let e=[],n=[],r=!1;return this.on("event",i=>{let s=n.shift();s?s.resolve(i):e.push(i)}),this.on("end",()=>{r=!0;for(let i of n)i.resolve(void 0);n.length=0}),this.on("abort",i=>{r=!0;for(let s of n)s.reject(i);n.length=0}),this.on("error",i=>{r=!0;for(let s of n)s.reject(i);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((s,o)=>n.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();let e=Ut(this,UEe,"f");if(!e)throw new qn("stream ended without producing a ChatCompletion");return e}}});var r3,WYe=v(()=>{p();kn();xi();kr();r3=class extends Nt{list(e,n={},r){return this._client.getAPIList(ct`/responses/${e}/input_items`,Ki,{query:n,...r,__security:{bearerAuth:!0}})}}});var i3,HYe=v(()=>{p();kn();i3=class extends Nt{count(e={},n){return this._client.post("/responses/input_tokens",{body:e,...n,__security:{bearerAuth:!0}})}}});var Ev,qYe=v(()=>{p();$Ye();iKt();kn();WYe();WYe();HYe();HYe();Bc();kr();Ev=class extends Nt{constructor(){super(...arguments),this.inputItems=new r3(this._client),this.inputTokens=new i3(this._client)}create(e,n){return this._client.post("/responses",{body:e,...n,stream:e.stream??!1,__security:{bearerAuth:!0}})._thenUnwrap(r=>("object"in r&&r.object==="response"&&FEe(r),r))}retrieve(e,n={},r){return this._client.get(ct`/responses/${e}`,{query:n,...r,stream:n?.stream??!1,__security:{bearerAuth:!0}})._thenUnwrap(i=>("object"in i&&i.object==="response"&&FEe(i),i))}delete(e,n){return this._client.delete(ct`/responses/${e}`,{...n,headers:In([{Accept:"*/*"},n?.headers]),__security:{bearerAuth:!0}})}parse(e,n){return this._client.responses.create(e,n)._thenUnwrap(r=>GYe(r,e))}stream(e,n){return GEe.createResponse(this._client,e,n)}cancel(e,n){return this._client.post(ct`/responses/${e}/cancel`,{...n,__security:{bearerAuth:!0}})}compact(e,n){return this._client.post("/responses/compact",{body:e,...n,__security:{bearerAuth:!0}})}};Ev.InputItems=r3;Ev.InputTokens=i3});var s3,jYe=v(()=>{p();kn();Bc();kr();s3=class extends Nt{retrieve(e,n){return this._client.get(ct`/skills/${e}/content`,{...n,headers:In([{Accept:"application/binary"},n?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}});var o3,VYe=v(()=>{p();kn();Bc();kr();o3=class extends Nt{retrieve(e,n,r){let{skill_id:i}=n;return this._client.get(ct`/skills/${i}/versions/${e}/content`,{...r,headers:In([{Accept:"application/binary"},r?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}});var KL,YYe=v(()=>{p();kn();VYe();VYe();xi();$0();kr();KL=class extends Nt{constructor(){super(...arguments),this.content=new o3(this._client)}create(e,n={},r){return this._client.post(ct`/skills/${e}/versions`,WB({body:n,...r,__security:{bearerAuth:!0}},this._client))}retrieve(e,n,r){let{skill_id:i}=n;return this._client.get(ct`/skills/${i}/versions/${e}`,{...r,__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/skills/${e}/versions`,Ki,{query:n,...r,__security:{bearerAuth:!0}})}delete(e,n,r){let{skill_id:i}=n;return this._client.delete(ct`/skills/${i}/versions/${e}`,{...r,__security:{bearerAuth:!0}})}};KL.Content=o3});var bv,zYe=v(()=>{p();kn();jYe();jYe();YYe();YYe();xi();$0();kr();bv=class extends Nt{constructor(){super(...arguments),this.content=new s3(this._client),this.versions=new KL(this._client)}create(e={},n){return this._client.post("/skills",WB({body:e,...n,__security:{bearerAuth:!0}},this._client))}retrieve(e,n){return this._client.get(ct`/skills/${e}`,{...n,__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(ct`/skills/${e}`,{body:n,...r,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/skills",Ki,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/skills/${e}`,{...n,__security:{bearerAuth:!0}})}};bv.Content=s3;bv.Versions=KL});var a3,KYe=v(()=>{p();kn();$0();kr();a3=class extends Nt{create(e,n,r){return this._client.post(ct`/uploads/${e}/parts`,Ph({body:n,...r,__security:{bearerAuth:!0}},this._client))}}});var rN,JYe=v(()=>{p();kn();KYe();KYe();kr();rN=class extends Nt{constructor(){super(...arguments),this.parts=new a3(this._client)}create(e,n){return this._client.post("/uploads",{body:e,...n,__security:{bearerAuth:!0}})}cancel(e,n){return this._client.post(ct`/uploads/${e}/cancel`,{...n,__security:{bearerAuth:!0}})}complete(e,n,r){return this._client.post(ct`/uploads/${e}/complete`,{body:n,...r,__security:{bearerAuth:!0}})}};rN.Parts=a3});var sKt,oKt=v(()=>{p();sKt=async t=>{let e=await Promise.allSettled(t),n=e.filter(i=>i.status==="rejected");if(n.length){for(let i of n)console.error(i.reason);throw new Error(`${n.length} promise(s) failed - see the above errors`)}let r=[];for(let i of e)i.status==="fulfilled"&&r.push(i.value);return r}});var c3,XYe=v(()=>{p();kn();xi();Bc();i5();oKt();kr();c3=class extends Nt{create(e,n,r){return this._client.post(ct`/vector_stores/${e}/file_batches`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n,r){let{vector_store_id:i}=n;return this._client.get(ct`/vector_stores/${i}/file_batches/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}cancel(e,n,r){let{vector_store_id:i}=n;return this._client.post(ct`/vector_stores/${i}/file_batches/${e}/cancel`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}async createAndPoll(e,n,r){let i=await this.create(e,n);return await this.poll(e,i.id,r)}listFiles(e,n,r){let{vector_store_id:i,...s}=n;return this._client.getAPIList(ct`/vector_stores/${i}/file_batches/${e}/files`,Ki,{query:s,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}async poll(e,n,r){let i=In([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:s,response:o}=await this.retrieve(n,{vector_store_id:e},{...r,headers:i}).withResponse();switch(s.status){case"in_progress":let a=5e3;if(r?.pollIntervalMs)a=r.pollIntervalMs;else{let c=o.headers.get("openai-poll-after-ms");if(c){let u=parseInt(c);isNaN(u)||(a=u)}}await pI(a);break;case"failed":case"cancelled":case"completed":return s}}}async uploadAndPoll(e,{files:n,fileIds:r=[]},i){if(n==null||n.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let s=i?.maxConcurrency??5,o=Math.min(s,n.length),a=this._client,c=n.values(),u=[...r];async function l(m){for(let h of m){let f=await a.files.create({file:h,purpose:"assistants"},i);u.push(f.id)}}let d=Array(o).fill(c).map(l);return await sKt(d),await this.createAndPoll(e,{file_ids:u})}}});var l3,ZYe=v(()=>{p();kn();xi();Bc();TX();kr();l3=class extends Nt{create(e,n,r){return this._client.post(ct`/vector_stores/${e}/files`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n,r){let{vector_store_id:i}=n;return this._client.get(ct`/vector_stores/${i}/files/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){let{vector_store_id:i,...s}=n;return this._client.post(ct`/vector_stores/${i}/files/${e}`,{body:s,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e,n={},r){return this._client.getAPIList(ct`/vector_stores/${e}/files`,Ki,{query:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}delete(e,n,r){let{vector_store_id:i}=n;return this._client.delete(ct`/vector_stores/${i}/files/${e}`,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}async createAndPoll(e,n,r){let i=await this.create(e,n,r);return await this.poll(e,i.id,r)}async poll(e,n,r){let i=In([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let s=await this.retrieve(n,{vector_store_id:e},{...r,headers:i}).withResponse(),o=s.data;switch(o.status){case"in_progress":let a=5e3;if(r?.pollIntervalMs)a=r.pollIntervalMs;else{let c=s.response.headers.get("openai-poll-after-ms");if(c){let u=parseInt(c);isNaN(u)||(a=u)}}await pI(a);break;case"failed":case"completed":return o}}}async upload(e,n,r){let i=await this._client.files.create({file:n,purpose:"assistants"},r);return this.create(e,{file_id:i.id},r)}async uploadAndPoll(e,n,r){let i=await this.upload(e,n,r);return await this.poll(e,i.id,r)}content(e,n,r){let{vector_store_id:i}=n;return this._client.getAPIList(ct`/vector_stores/${i}/files/${e}/content`,Dh,{...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}}});var _v,e9e=v(()=>{p();kn();XYe();XYe();ZYe();ZYe();xi();Bc();kr();_v=class extends Nt{constructor(){super(...arguments),this.files=new l3(this._client),this.fileBatches=new c3(this._client)}create(e,n){return this._client.post("/vector_stores",{body:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}retrieve(e,n){return this._client.get(ct`/vector_stores/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}update(e,n,r){return this._client.post(ct`/vector_stores/${e}`,{body:n,...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/vector_stores",Ki,{query:e,...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/vector_stores/${e}`,{...n,headers:In([{"OpenAI-Beta":"assistants=v2"},n?.headers]),__security:{bearerAuth:!0}})}search(e,n,r){return this._client.getAPIList(ct`/vector_stores/${e}/search`,Dh,{body:n,method:"post",...r,headers:In([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}};_v.Files=l3;_v.FileBatches=c3});var JL,t9e=v(()=>{p();kn();xi();Bc();$0();kr();JL=class extends Nt{create(e,n){return this._client.post("/videos",Ph({body:e,...n,__security:{bearerAuth:!0}},this._client))}retrieve(e,n){return this._client.get(ct`/videos/${e}`,{...n,__security:{bearerAuth:!0}})}list(e={},n){return this._client.getAPIList("/videos",No,{query:e,...n,__security:{bearerAuth:!0}})}delete(e,n){return this._client.delete(ct`/videos/${e}`,{...n,__security:{bearerAuth:!0}})}createCharacter(e,n){return this._client.post("/videos/characters",Ph({body:e,...n,__security:{bearerAuth:!0}},this._client))}downloadContent(e,n={},r){return this._client.get(ct`/videos/${e}/content`,{query:n,...r,headers:In([{Accept:"application/binary"},r?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}edit(e,n){return this._client.post("/videos/edits",Ph({body:e,...n,__security:{bearerAuth:!0}},this._client))}extend(e,n){return this._client.post("/videos/extensions",Ph({body:e,...n,__security:{bearerAuth:!0}},this._client))}getCharacter(e,n){return this._client.get(ct`/videos/characters/${e}`,{...n,__security:{bearerAuth:!0}})}remix(e,n,r){return this._client.post(ct`/videos/${e}/remix`,WB({body:n,...r,__security:{bearerAuth:!0}},this._client))}}});var u3,aKt,$Ee,XL,n9e=v(()=>{p();U0();hx();kn();Bc();XL=class extends Nt{constructor(){super(...arguments),u3.add(this)}async unwrap(e,n,r=this._client.webhookSecret,i=300){return await this.verifySignature(e,n,r,i),JSON.parse(e)}async verifySignature(e,n,r=this._client.webhookSecret,i=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!="function"||typeof crypto.subtle.verify!="function")throw new Error("Webhook signature verification is only supported when the `crypto` global is defined");Ut(this,u3,"m",aKt).call(this,r);let s=In([n]).values,o=Ut(this,u3,"m",$Ee).call(this,s,"webhook-signature"),a=Ut(this,u3,"m",$Ee).call(this,s,"webhook-timestamp"),c=Ut(this,u3,"m",$Ee).call(this,s,"webhook-id"),u=parseInt(a,10);if(isNaN(u))throw new dI("Invalid webhook timestamp format");let l=Math.floor(Date.now()/1e3);if(l-u>i)throw new dI("Webhook timestamp is too old");if(u>l+i)throw new dI("Webhook timestamp is too new");let d=o.split(" ").map(g=>g.startsWith("v1,")?g.substring(3):g),m=r.startsWith("whsec_")?Buffer.from(r.replace("whsec_",""),"base64"):Buffer.from(r,"utf-8"),h=c?`${c}.${a}.${e}`:`${a}.${e}`,f=await crypto.subtle.importKey("raw",m,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(let g of d)try{let A=Buffer.from(g,"base64");if(await crypto.subtle.verify("HMAC",f,A,new TextEncoder().encode(h)))return}catch{continue}throw new dI("The given webhook signature does not match the expected signature")}};u3=new WeakSet,aKt=function(e){if(typeof e!="string"||e.length===0)throw new Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},$Ee=function(e,n){if(!e)throw new Error("Headers are required");let r=e.get(n);if(r==null)throw new Error(`Missing required header: ${n}`);return r}});var cKt=v(()=>{p();n9e()});var lKt=v(()=>{p();cKt()});var uKt=v(()=>{p();G7t();$7t();VVe();JVe();XVe();mYe();hYe();AYe();EYe();bYe();SYe();CYe();NYe();PYe();MYe();OYe();LYe();UYe();qYe();zYe();JYe();e9e();t9e();lKt()});function aZr(t){if(cZr(t))return"Connection error. This may be caused by passing an undici dispatcher, such as ProxyAgent, that is incompatible with the fetch implementation. If you are using undici's ProxyAgent, pass the fetch implementation from the same undici package: import { fetch, ProxyAgent } from 'undici'; new OpenAI({ fetch, fetchOptions: { dispatcher: new ProxyAgent(...) } });"}function cZr(t){let e=t;for(let n=0;n<8&&e&&typeof e=="object";n++){let r=e;if(r.code==="UND_ERR_INVALID_ARG"&&typeof r.message=="string"&&r.message.includes("invalid onRequestStart method"))return!0;e=r.cause}return!1}var r9e,i9e,WEe,dKt,oZr,di,HEe=v(()=>{p();U0();Cje();pv();i5();cEe();vje();s5();i7t();Qje();Tje();G0();xi();x7t();G0();Kje();uKt();AEe();XVe();hYe();bYe();CYe();MYe();OYe();LYe();t9e();VVe();JVe();mYe();yVe();AYe();EYe();SYe();NYe();PYe();UYe();qYe();zYe();JYe();e9e();n9e();vje();Bc();cYe();dX();pv();oZr="workload-identity-auth",di=class{constructor({baseURL:e=My("OPENAI_BASE_URL"),apiKey:n=My("OPENAI_API_KEY")??null,adminAPIKey:r=My("OPENAI_ADMIN_KEY")??null,organization:i=My("OPENAI_ORG_ID")??null,project:s=My("OPENAI_PROJECT_ID")??null,webhookSecret:o=My("OPENAI_WEBHOOK_SECRET")??null,workloadIdentity:a,...c}={}){r9e.add(this),WEe.set(this,void 0),this.completions=new QL(this),this.chat=new jB(this),this.embeddings=new GL(this),this.files=new WL(this),this.images=new VL(this),this.audio=new fI(this),this.moderations=new zL(this),this.models=new YL(this),this.fineTuning=new Ax(this),this.graders=new tN(this),this.vectorStores=new _v(this),this.webhooks=new XL(this),this.beta=new gx(this),this.batches=new PL(this),this.uploads=new rN(this),this.admin=new YB(this),this.responses=new Ev(this),this.realtime=new yv(this),this.conversations=new ZB(this),this.evals=new eN(this),this.containers=new XB(this),this.skills=new bv(this),this.videos=new JL(this);let u={apiKey:n,adminAPIKey:r,organization:i,project:s,webhookSecret:o,workloadIdentity:a,...c,baseURL:e||"https://api.openai.com/v1"};if(n&&a)throw new qn("The `apiKey` and `workloadIdentity` options are mutually exclusive");if(!n&&!r&&!a)throw new qn("Missing credentials. Please pass an `apiKey`, `workloadIdentity`, `adminAPIKey`, or set the `OPENAI_API_KEY` or `OPENAI_ADMIN_KEY` environment variable.");if(!u.dangerouslyAllowBrowser&&e7t())throw new qn(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, @@ -197,372 +195,945 @@ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new OpenAI({ apiKey, dangerouslyAllowBrowser: true }); https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety -`);this.baseURL=u.baseURL,this.timeout=u.timeout??Oqe.DEFAULT_TIMEOUT,this.logger=u.logger??console;let l="warn";this.logLevel=l,this.logLevel=yGe(u.logLevel,"ClientOptions.logLevel",this)??yGe(fA("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??l,this.fetchOptions=u.fetchOptions,this.maxRetries=u.maxRetries??2,this.fetch=u.fetch??hhe(),Gr(this,Vhe,PQt,"f");let d=fA("OPENAI_CUSTOM_HEADERS");if(d){let h={};for(let m of d.split(` -`)){let f=m.indexOf(":");f>=0&&(h[m.substring(0,f).trim()]=m.substring(f+1).trim())}u.defaultHeaders=In([h,u.defaultHeaders])}this._options=u,a&&(this._workloadIdentityAuth=new She(a,this.fetch)),this.apiKey=typeof n=="string"?n:null,this.adminAPIKey=r,this.organization=s,this.project=i,this.webhookSecret=o}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this._options.apiKey,adminAPIKey:this.adminAPIKey,workloadIdentity:this._options.workloadIdentity,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:n},r={bearerAuth:!0,adminAPIKeyAuth:!0}){if(!(e.get("authorization")||e.get("api-key"))&&!(n.has("authorization")||n.has("api-key"))&&!(this._workloadIdentityAuth&&r.bearerAuth))throw new Error('Could not resolve authentication method. Expected either apiKey or adminAPIKey to be set. Or for one of the "Authorization" or "api-key" headers to be explicitly omitted')}async authHeaders(e,n={bearerAuth:!0,adminAPIKeyAuth:!0}){return In([n.bearerAuth?await this.bearerAuth(e):null,n.adminAPIKeyAuth?await this.adminAPIKeyAuth(e):null])}async bearerAuth(e){if(this._workloadIdentityAuth)return In([{Authorization:`Bearer ${await this._workloadIdentityAuth.getToken()}`}]);if(this.apiKey!=null)return In([{Authorization:`Bearer ${this.apiKey}`}])}async adminAPIKeyAuth(e){if(this.adminAPIKey!=null)return In([{Authorization:`Bearer ${this.adminAPIKey}`}])}stringifyQuery(e){return VQt(e)}getUserAgent(){return`${this.constructor.name}/JS ${rk}`}defaultIdempotencyKey(){return`stainless-node-retry-${eGe()}`}makeStatusError(e,n,r,s){return Dl.generate(e,n,r,s)}async _callApiKey(){let e=this._options.apiKey;if(typeof e!="function")return!1;let n;try{n=await e()}catch(r){throw r instanceof Wn?r:new Wn(`Failed to get token from 'apiKey' function: ${r.message}`,{cause:r})}if(typeof n!="string"||!n)throw new Wn(`Expected 'apiKey' function argument to return a string but it returned ${n}`);return this.apiKey=n,!0}buildURL(e,n,r){let s=!Ft(this,Pqe,"m",GUt).call(this)&&r||this.baseURL,i=IQt(e)?new URL(e):new URL(s+(s.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery(),a=Object.fromEntries(i.searchParams);return(!rGe(o)||!rGe(a))&&(n={...a,...o,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(i.search=this.stringifyQuery(n)),i.toString()}async prepareOptions(e){(e.__security??{bearerAuth:!0}).bearerAuth&&await this._callApiKey()}async prepareRequest(e,{url:n,options:r}){}get(e,n){return this.methodRequest("get",e,n)}post(e,n){return this.methodRequest("post",e,n)}patch(e,n){return this.methodRequest("patch",e,n)}put(e,n){return this.methodRequest("put",e,n)}delete(e,n){return this.methodRequest("delete",e,n)}methodRequest(e,n,r){return this.request(Promise.resolve(r).then(s=>({method:e,path:n,...s})))}request(e,n=null){return new xP(this,this.makeRequest(e,n,void 0))}async makeRequest(e,n,r){let s=await e,i=s.maxRetries??this.maxRetries;n==null&&(n=i),await this.prepareOptions(s);let{req:o,url:a,timeout:c}=await this.buildRequest(s,{retryCount:i-n});await this.prepareRequest(o,{url:a,options:s});let u="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),l=r===void 0?"":`, retryOf: ${r}`,d=Date.now();if(du(this).debug(`[${u}] sending request`,Vx({retryOfRequestLogID:r,method:s.method,url:a,options:s,headers:o.headers})),s.signal?.aborted)throw new Mu;let h=s.__security??{bearerAuth:!0},m=new AbortController,f=await this.fetchWithAuth(a,o,c,m,h).catch(K9),g=Date.now();if(f instanceof globalThis.Error){let b=`retrying, ${n} attempts remaining`;if(s.signal?.aborted)throw new Mu;let S=Y9(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):""));if(n)return du(this).info(`[${u}] connection ${S?"timed out":"failed"} - ${b}`),du(this).debug(`[${u}] connection ${S?"timed out":"failed"} (${b})`,Vx({retryOfRequestLogID:r,url:a,durationMs:g-d,message:f.message})),this.retryRequest(s,n,r??u);throw du(this).info(`[${u}] connection ${S?"timed out":"failed"} - error; no more retries left`),du(this).debug(`[${u}] connection ${S?"timed out":"failed"} (error; no more retries left)`,Vx({retryOfRequestLogID:r,url:a,durationMs:g-d,message:f.message})),f instanceof CP||f instanceof z9?f:S?new nk:new tk({message:Hvr(f),cause:f})}let A=[...f.headers.entries()].filter(([b])=>b==="x-request-id").map(([b,S])=>", "+b+": "+JSON.stringify(S)).join(""),y=`[${u}${l}${A}] ${o.method} ${a} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${g-d}ms`;if(!f.ok){if(f.status===401&&this._workloadIdentityAuth&&h.bearerAuth&&!s.__metadata?.hasStreamingBody&&!s.__metadata?.workloadIdentityTokenRefreshed)return await cGe(f.body),this._workloadIdentityAuth.invalidateToken(),this.makeRequest({...s,__metadata:{...s.__metadata,workloadIdentityTokenRefreshed:!0}},n,r??u);let b=await this.shouldRetry(f);if(n&&b){let R=`retrying, ${n} attempts remaining`;return await cGe(f.body),du(this).info(`${y} - ${R}`),du(this).debug(`[${u}] response error (${R})`,Vx({retryOfRequestLogID:r,url:f.url,status:f.status,headers:f.headers,durationMs:g-d})),this.retryRequest(s,n,r??u,f.headers)}let S=b?"error; no more retries left":"error; not retryable";du(this).info(`${y} - ${S}`);let C=await f.text().catch(R=>K9(R).message),I=TQt(C),x=I?void 0:C;throw du(this).debug(`[${u}] response error (${S})`,Vx({retryOfRequestLogID:r,url:f.url,status:f.status,headers:f.headers,message:x,durationMs:Date.now()-d})),this.makeStatusError(f.status,I,x,f.headers)}return du(this).info(y),du(this).debug(`[${u}] response start`,Vx({retryOfRequestLogID:r,url:f.url,status:f.status,headers:f.headers,durationMs:g-d})),{response:f,options:s,controller:m,requestLogID:u,retryOfRequestLogID:r,startTime:d}}getAPIList(e,n,r){return this.requestAPIList(n,r&&"then"in r?r.then(s=>({method:"get",path:e,...s})):{method:"get",path:e,...r})}requestAPIList(e,n){let r=this.makeRequest(n,null,void 0);return new tK(this,r,e)}async fetchWithAuth(e,n,r,s,i={bearerAuth:!0,adminAPIKeyAuth:!0}){if(this._workloadIdentityAuth&&i.bearerAuth){let a=n.headers,c=a.get("Authorization");if(!c||c===`Bearer ${qvr}`){let u=await this._workloadIdentityAuth.getToken();a.set("Authorization",`Bearer ${u}`)}}return await this.fetchWithTimeout(e,n,r,s)}async fetchWithTimeout(e,n,r,s){let{signal:i,method:o,...a}=n||{},c=this._makeAbort(s);i&&i.addEventListener("abort",c,{once:!0});let u=setTimeout(c,r),l=globalThis.ReadableStream&&a.body instanceof globalThis.ReadableStream||typeof a.body=="object"&&a.body!==null&&Symbol.asyncIterator in a.body,d={signal:s.signal,...l?{duplex:"half"}:{},method:"GET",...a};o&&(d.method=o.toUpperCase());try{return await this.fetch.call(void 0,e,d)}finally{clearTimeout(u)}}async shouldRetry(e){let n=e.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,n,r,s){let i,o=s?.get("retry-after-ms");if(o){let c=parseFloat(o);Number.isNaN(c)||(i=c)}let a=s?.get("retry-after");if(a&&!i){let c=parseFloat(a);Number.isNaN(c)?i=Date.parse(a)-Date.now():i=c*1e3}if(i===void 0){let c=e.maxRetries??this.maxRetries;i=this.calculateDefaultRetryTimeoutMillis(n,c)}return await hC(i),this.makeRequest(e,n-1,r)}calculateDefaultRetryTimeoutMillis(e,n){let i=n-e,o=Math.min(.5*Math.pow(2,i),8),a=1-Math.random()*.25;return o*a*1e3}async buildRequest(e,{retryCount:n=0}={}){let r={...e},{method:s,path:i,query:o,defaultBaseURL:a}=r,c=this.buildURL(i,o,a);"timeout"in r&&wQt("timeout",r.timeout),r.timeout=r.timeout??this.timeout;let{bodyHeaders:u,body:l,isStreamingBody:d}=this.buildBody({options:r});d&&(e.__metadata={...e.__metadata,hasStreamingBody:!0});let h=await this.buildHeaders({options:e,method:s,bodyHeaders:u,retryCount:n});return{req:{method:s,headers:h,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:"half"},...l&&{body:l},...this.fetchOptions??{},...r.fetchOptions??{}},url:c,timeout:r.timeout}}async buildHeaders({options:e,method:n,bodyHeaders:r,retryCount:s}){let i={};this.idempotencyHeader&&n!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);let o=In([i,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(s),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...DQt(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(e,e.__security??{bearerAuth:!0}),this._options.defaultHeaders,r,e.headers]);return this.validateHeaders(o,e.__security??{bearerAuth:!0}),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:n}}){if(!e)return{bodyHeaders:void 0,body:void 0,isStreamingBody:!1};let r=In([n]),s=typeof globalThis.ReadableStream<"u"&&e instanceof globalThis.ReadableStream,i=!s&&(typeof e=="string"||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof globalThis.Blob<"u"&&e instanceof globalThis.Blob||e instanceof URLSearchParams||e instanceof FormData);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||s?{bodyHeaders:void 0,body:e,isStreamingBody:!i}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:mhe(e),isStreamingBody:!0}:typeof e=="object"&&r.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e),isStreamingBody:!1}:{...Ft(this,Vhe,"f").call(this,{body:e,headers:r}),isStreamingBody:!1}}};Oqe=as,Vhe=new WeakMap,Pqe=new WeakSet,GUt=function(){return this.baseURL!=="https://api.openai.com/v1"};as.OpenAI=Oqe;as.DEFAULT_TIMEOUT=6e5;as.OpenAIError=Wn;as.APIError=Dl;as.APIConnectionError=tk;as.APIConnectionTimeoutError=nk;as.APIUserAbortError=Mu;as.NotFoundError=NG;as.ConflictError=DG;as.RateLimitError=PG;as.BadRequestError=vG;as.AuthenticationError=RG;as.InternalServerError=OG;as.PermissionDeniedError=kG;as.UnprocessableEntityError=BG;as.InvalidWebhookSignatureError=pC;as.toFile=Ihe;as.Completions=LP;as.Chat=ak;as.Embeddings=QP;as.Files=$P;as.Images=HP;as.Audio=gC;as.Moderations=jP;as.Models=VP;as.FineTuning=I_;as.Graders=gk;as.VectorStores=ew;as.Webhooks=zP;as.Beta=C_;as.Batches=DP;as.Uploads=yk;as.Admin=lk;as.Responses=Xx;as.Realtime=Jx;as.Conversations=mk;as.Evals=fk;as.Containers=hk;as.Skills=Zx;as.Videos=KP});var yK,jvr,WUt=V(()=>{p();za();__();mK();jhe();yK=class extends as{constructor({baseURL:e=fA("OPENAI_BASE_URL"),apiKey:n=fA("AZURE_OPENAI_API_KEY"),apiVersion:r=fA("OPENAI_API_VERSION"),endpoint:s,deployment:i,azureADTokenProvider:o,dangerouslyAllowBrowser:a,...c}={}){if(!r)throw new Wn("The OPENAI_API_VERSION environment variable is missing or empty; either provide it, or instantiate the AzureOpenAI client with an apiVersion option, like new AzureOpenAI({ apiVersion: 'My API Version' }).");if(typeof o=="function"&&(a=!0),!o&&!n)throw new Wn("Missing credentials. Please pass one of `apiKey` and `azureADTokenProvider`, or set the `AZURE_OPENAI_API_KEY` environment variable.");if(o&&n)throw new Wn("The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time.");if(c.defaultQuery={...c.defaultQuery,"api-version":r},e){if(s)throw new Wn("baseURL and endpoint are mutually exclusive")}else{if(s||(s=process.env.AZURE_OPENAI_ENDPOINT),!s)throw new Wn("Must provide one of the `baseURL` or `endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable");e=`${s}/openai`}super({apiKey:o??n,baseURL:e,...c,...a!==void 0?{dangerouslyAllowBrowser:a}:{}}),this.apiVersion="",this.apiVersion=r,this.deploymentName=i}async buildRequest(e,n={}){if(jvr.has(e.path)&&e.method==="post"&&e.body!==void 0){if(!FG(e.body))throw new Error("Expected request body to be an object");let r=this.deploymentName||e.body.model||e.__metadata?.model;r!==void 0&&!this.baseURL.includes("/deployments")&&(e.path=`/deployments/${r}${e.path}`)}return super.buildRequest(e,n)}async authHeaders(e,n){let r=n??{bearerAuth:!0,adminAPIKeyAuth:!0};return r.bearerAuth&&typeof this._options.apiKey=="string"?In([{"api-key":this.apiKey}]):super.authHeaders(e,r)}},jvr=new Set(["/completions","/chat/completions","/embeddings","/audio/transcriptions","/audio/translations","/audio/speech","/images/generations","/batches","/images/edits"])});var EK=V(()=>{p();jhe();TGe();bhe();jhe();Es();bE();WUt()});function Ek(t){if(t===void 0)return;let e=Array.from(t);return e.length<=64?t:e.slice(0,64).join("")}var bK=V(()=>{p()});function bk(t){let e=3735928559,n=1103547991;for(let r=0;r>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(e^e>>>13,3266489909),(n>>>0).toString(36)+(e>>>0).toString(36)}var Yhe=V(()=>{p()});function Yvr(t,e){let n={v:1,id:t};return e&&(n.phase=e),JSON.stringify(n)}function Kvr(t){if(t){if(t.startsWith("{"))try{let e=JSON.parse(t);if(e.v===1&&typeof e.id=="string")return e.phase==="commentary"||e.phase==="final_answer"?{id:e.id,phase:e.phase}:{id:e.id}}catch{}return{id:t}}}function zvr(t,e){let n=e.filter(o=>o.type==="text").map(o=>o.text).join(` -`),r=e.filter(o=>o.type==="image"),s=n.length>0;if(r.length===0||!t.input.includes("image"))return ts(s?n:r.length>0?"(see attached image)":"(no tool output)");let i=[];s&&i.push({type:"input_text",text:ts(n)});for(let o of r)i.push({type:"input_image",detail:"auto",image_url:`data:${o.mimeType};base64,${o.data}`});return i}function JP(t,e,n,r){let s=[],i=new Set,o=h=>{let m=h.replace(/[^a-zA-Z0-9_-]/g,"_");return(m.length>64?m.slice(0,64):m).replace(/_+$/,"")},a=h=>{let m=`fc_${bk(h)}`;return m.length>64?m.slice(0,64):m},c=(h,m,f)=>{if(!n.has(t.provider)||!h.includes("|"))return o(h);let[g,A]=h.split("|"),y=o(g),S=f.provider!==t.provider||f.api!==t.api?a(A):o(A);return S.startsWith("fc_")||(S=o(`fc_${S}`)),`${y}|${S}`},u=lE(e.messages,t,c);if((r?.includeSystemPrompt??!0)&&e.systemPrompt){let h=t.compat,m=t.reasoning&&h?.supportsDeveloperRole!==!1?"developer":"system";s.push({role:m,content:ts(e.systemPrompt)})}let d=0;for(let h of u){if(h.role==="user")if(typeof h.content=="string")s.push({role:"user",content:[{type:"input_text",text:ts(h.content)}]});else{let m=h.content.map(f=>f.type==="text"?{type:"input_text",text:ts(f.text)}:{type:"input_image",detail:"auto",image_url:`data:${f.mimeType};base64,${f.data}`});if(m.length===0)continue;s.push({role:"user",content:m})}else if(h.role==="assistant"){let m=[],f=h,g=f.provider===t.provider&&f.api===t.api,A=g&&f.model===t.id,y=g&&f.model!==t.id,b=0;for(let S of h.content)if(S.type==="thinking"){if(S.thinkingSignature){let C=JSON.parse(S.thinkingSignature);m.push(C)}}else if(S.type==="text"){let C=S,I=Kvr(C.textSignature),x=b===0?`msg_pi_${d}`:`msg_pi_${d}_${b}`;b++;let w=I?.id;w?w.length>64&&(w=`msg_${bk(w)}`):w=x,m.push({type:"message",role:"assistant",content:[{type:"output_text",text:ts(C.text),annotations:[]}],status:"completed",id:w,phase:I?.phase})}else if(S.type==="toolCall"){let C=S,[I,x]=C.id.split("|"),w=r?.grammarToolInputProperties?.get(C.name),R=x;(y&&R?.startsWith("fc_")||w===void 0&&!R?.startsWith("fc_"))&&(R=void 0);let N=A||r?.deferredTools?.has(C.name)===!0;w!==void 0?m.push({type:"custom_tool_call",id:R,call_id:I,name:C.name,input:ts(bde(C.name,C.arguments,w)),...N&&C.namespace!==void 0?{namespace:C.namespace}:{}}):m.push({type:"function_call",id:R,call_id:I,name:C.name,arguments:JSON.stringify(C.arguments),...N&&C.namespace!==void 0?{namespace:C.namespace}:{}})}if(m.length===0)continue;s.push(...m)}else if(h.role==="toolResult"){let[m]=h.toolCallId.split("|"),f=zvr(t,h.content);r?.grammarToolInputProperties?.has(h.toolName)?s.push({type:"custom_tool_call_output",call_id:m,output:f}):s.push({type:"function_call_output",call_id:m,output:f});let g=[];for(let A of h.addedToolNames??[]){let y=r?.deferredTools?.get(A);!y||i.has(A)||(i.add(A),g.push(y))}if(g.length>0&&r?.deferredToolsMode==="additional-tools")s.push({type:"additional_tools",role:"developer",tools:_k(g,r.toolOptions)});else if(g.length>0&&r?.deferredToolsMode==="tool-search"){let A=g.map(b=>b.name),y=`pi_tool_load_${bk(`${h.toolCallId}:${A.join(",")}`)}`;s.push({type:"tool_search_call",call_id:y,execution:"client",status:"completed",arguments:{query:A.join(" "),limit:A.length}}),s.push({type:"tool_search_output",call_id:y,execution:"client",status:"completed",tools:_k(g,{...r.toolOptions,deferLoading:!0})})}}d++}return s}function _k(t,e){let n=e?.strict===void 0?!1:e.strict,r=e?.supportsStrictMode??!0,s=e?.supportsOpenAIGrammarTools??!1;return t.map(i=>{let o=j8(i,s);if(o)return{type:"custom",name:i.name,description:i.description,format:{type:"grammar",syntax:o.format,definition:o.definition},...e?.deferLoading?{defer_loading:!0}:{}};let c=oA(i,r)??n,u={type:"function",name:i.name,description:i.description,parameters:aE(i,c===!0),...e?.deferLoading?{defer_loading:!0}:{}};return r&&(u.strict=c),u})}function qUt(t){let e=t.customInput?.property;if(e===void 0)return"";let n=t.arguments[e];return typeof n=="string"?n:""}function Mqe(t,e,n){let r=t.customInput;if(!r)return;let s=_de(r.jsonBuffer,r.property,e,n);return t.arguments={[r.property]:e},s}async function XP(t,e,n,r,s){let i=!1,o=new Map,a=new Map,c=g=>{g.type==="message"&&g.phase==="final_answer"&&(e.stopReason="stop")},u=(g,A)=>{let y=o.get(g);return y?.type===A?y:void 0},l=(g,A)=>{A!==void 0&&n.push({type:"toolcall_delta",contentIndex:g.contentIndex,delta:A,partial:e})},d=(g,A)=>{if(A.type==="reasoning"){let y={type:"thinking",thinking:""};e.content.push(y);let b={type:"thinking",block:y,contentIndex:e.content.length-1};return o.set(g,b),n.push({type:"thinking_start",contentIndex:b.contentIndex,partial:e}),b}if(A.type==="message"){c(A);let y={type:"text",text:""};e.content.push(y);let b={type:"text",block:y,contentIndex:e.content.length-1};return o.set(g,b),n.push({type:"text_start",contentIndex:b.contentIndex,partial:e}),b}if(A.type==="function_call"){let y={type:"toolCall",id:`${A.call_id}|${A.id}`,name:A.name,arguments:{},...A.namespace!==void 0?{namespace:A.namespace}:{},partialJson:A.arguments||""};e.content.push(y);let b={type:"toolCall",block:y,contentIndex:e.content.length-1};return o.set(g,b),n.push({type:"toolcall_start",contentIndex:b.contentIndex,partial:e}),b}if(A.type==="custom_tool_call"){let y=s?.grammarToolInputProperties?.get(A.name)??"input",b=A.input||"",S={type:"toolCall",id:`${A.call_id}|${A.id}`,name:A.name,arguments:{[y]:b},...A.namespace!==void 0?{namespace:A.namespace}:{},customInput:{property:y,jsonBuffer:{input:"",started:!1,closed:!1}}};e.content.push(S);let C={type:"toolCall",block:S,contentIndex:e.content.length-1};return o.set(g,C),n.push({type:"toolcall_start",contentIndex:C.contentIndex,partial:e}),C}},h=(g,A)=>o.get(g)??d(g,A),m=g=>{for(let A of g){if(A.type!=="reasoning"||!A.encrypted_content)continue;let y=a.get(A.id);if(!y?.thinkingSignature)continue;let b=JSON.parse(y.thinkingSignature);b.encrypted_content||(y.thinkingSignature=JSON.stringify({...b,encrypted_content:A.encrypted_content}))}},f=g=>{if(i=!0,m(g.output??[]),g?.id&&(e.responseId=g.id),g?.usage){let C=g.usage.input_tokens_details,I=C?.cached_tokens||0,x=C?.cache_write_tokens||0;e.usage={input:Math.max(0,(g.usage.input_tokens||0)-I-x),output:g.usage.output_tokens||0,cacheRead:I,cacheWrite:x,reasoning:g.usage.output_tokens_details?.reasoning_tokens||0,totalTokens:g.usage.total_tokens||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}if(Sh(r,e.usage),s?.applyServiceTierPricing){let C=s.resolveServiceTier?s.resolveServiceTier(g?.service_tier,s.serviceTier):g?.service_tier??s.serviceTier;s.applyServiceTierPricing(e.usage,C)}let A=g?.status,y=g?.incomplete_details,b=typeof y?.reason=="string"?y.reason:void 0;e.rawStopReason=b?`${A}.${b}`:A;let S=Jvr(A,b);e.stopReason=S.stopReason,S.errorMessage===void 0?delete e.errorMessage:e.errorMessage=S.errorMessage,e.content.some(C=>C.type==="toolCall")&&e.stopReason==="stop"&&(e.stopReason="toolUse")};for await(let g of t)if(g.type==="response.created")e.responseId=g.response.id;else if(g.type==="response.output_item.added")d(g.output_index,g.item);else if(g.type==="response.reasoning_summary_text.delta"){let A=u(g.output_index,"thinking");if(!A)continue;A.block.thinking+=g.delta,n.push({type:"thinking_delta",contentIndex:A.contentIndex,delta:g.delta,partial:e})}else if(g.type==="response.reasoning_summary_part.done"){let A=u(g.output_index,"thinking");if(!A)continue;A.block.thinking+=` +`);this.baseURL=u.baseURL,this.timeout=u.timeout??i9e.DEFAULT_TIMEOUT,this.logger=u.logger??console;let l="warn";this.logLevel=l,this.logLevel=Gje(u.logLevel,"ClientOptions.logLevel",this)??Gje(My("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??l,this.fetchOptions=u.fetchOptions,this.maxRetries=u.maxRetries??2,this.fetch=u.fetch??uEe(),Hr(this,WEe,r7t,"f");let d=My("OPENAI_CUSTOM_HEADERS");if(d){let m={};for(let h of d.split(` +`)){let f=h.indexOf(":");f>=0&&(m[h.substring(0,f).trim()]=h.substring(f+1).trim())}u.defaultHeaders=In([m,u.defaultHeaders])}this._options=u,a&&(this._workloadIdentityAuth=new EEe(a,this.fetch)),this.apiKey=typeof n=="string"?n:null,this.adminAPIKey=r,this.organization=i,this.project=s,this.webhookSecret=o}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this._options.apiKey,adminAPIKey:this.adminAPIKey,workloadIdentity:this._options.workloadIdentity,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:n},r={bearerAuth:!0,adminAPIKeyAuth:!0}){if(!(e.get("authorization")||e.get("api-key"))&&!(n.has("authorization")||n.has("api-key"))&&!(this._workloadIdentityAuth&&r.bearerAuth))throw new Error('Could not resolve authentication method. Expected either apiKey or adminAPIKey to be set. Or for one of the "Authorization" or "api-key" headers to be explicitly omitted')}async authHeaders(e,n={bearerAuth:!0,adminAPIKeyAuth:!0}){return In([n.bearerAuth?await this.bearerAuth(e):null,n.adminAPIKeyAuth?await this.adminAPIKeyAuth(e):null])}async bearerAuth(e){if(this._workloadIdentityAuth)return In([{Authorization:`Bearer ${await this._workloadIdentityAuth.getToken()}`}]);if(this.apiKey!=null)return In([{Authorization:`Bearer ${this.apiKey}`}])}async adminAPIKeyAuth(e){if(this.adminAPIKey!=null)return In([{Authorization:`Bearer ${this.adminAPIKey}`}])}stringifyQuery(e){return f7t(e)}getUserAgent(){return`${this.constructor.name}/JS ${$B}`}defaultIdempotencyKey(){return`stainless-node-retry-${Sje()}`}makeStatusError(e,n,r,i){return Su.generate(e,n,r,i)}async _callApiKey(){let e=this._options.apiKey;if(typeof e!="function")return!1;let n;try{n=await e()}catch(r){throw r instanceof qn?r:new qn(`Failed to get token from 'apiKey' function: ${r.message}`,{cause:r})}if(typeof n!="string"||!n)throw new qn(`Expected 'apiKey' function argument to return a string but it returned ${n}`);return this.apiKey=n,!0}buildURL(e,n,r){let i=!Ut(this,r9e,"m",dKt).call(this)&&r||this.baseURL,s=Vzt(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery(),a=Object.fromEntries(s.searchParams);return(!wje(o)||!wje(a))&&(n={...a,...o,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(s.search=this.stringifyQuery(n)),s.toString()}async prepareOptions(e){(e.__security??{bearerAuth:!0}).bearerAuth&&await this._callApiKey()}async prepareRequest(e,{url:n,options:r}){}get(e,n){return this.methodRequest("get",e,n)}post(e,n){return this.methodRequest("post",e,n)}patch(e,n){return this.methodRequest("patch",e,n)}put(e,n){return this.methodRequest("put",e,n)}delete(e,n){return this.methodRequest("delete",e,n)}methodRequest(e,n,r){return this.request(Promise.resolve(r).then(i=>({method:e,path:n,...i})))}request(e,n=null){return new TL(this,this.makeRequest(e,n,void 0))}async makeRequest(e,n,r){let i=await e,s=i.maxRetries??this.maxRetries;n==null&&(n=s),await this.prepareOptions(i);let{req:o,url:a,timeout:c}=await this.buildRequest(i,{retryCount:s-n});await this.prepareRequest(o,{url:a,options:i});let u="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),l=r===void 0?"":`, retryOf: ${r}`,d=Date.now();if(td(this).debug(`[${u}] sending request`,mv({retryOfRequestLogID:r,method:i.method,url:a,options:i,headers:o.headers})),i.signal?.aborted)throw new Rd;let m=i.__security??{bearerAuth:!0},h=new AbortController,f=await this.fetchWithAuth(a,o,c,h,m).catch(cX),g=Date.now();if(f instanceof globalThis.Error){let E=`retrying, ${n} attempts remaining`;if(i.signal?.aborted)throw new Rd;let _=aX(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):""));if(n)return td(this).info(`[${u}] connection ${_?"timed out":"failed"} - ${E}`),td(this).debug(`[${u}] connection ${_?"timed out":"failed"} (${E})`,mv({retryOfRequestLogID:r,url:a,durationMs:g-d,message:f.message})),this.retryRequest(i,n,r??u);throw td(this).info(`[${u}] connection ${_?"timed out":"failed"} - error; no more retries left`),td(this).debug(`[${u}] connection ${_?"timed out":"failed"} (error; no more retries left)`,mv({retryOfRequestLogID:r,url:a,durationMs:g-d,message:f.message})),f instanceof IL||f instanceof lX?f:_?new GB:new UB({message:aZr(f),cause:f})}let A=[...f.headers.entries()].filter(([E])=>E==="x-request-id").map(([E,_])=>", "+E+": "+JSON.stringify(_)).join(""),y=`[${u}${l}${A}] ${o.method} ${a} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${g-d}ms`;if(!f.ok){if(f.status===401&&this._workloadIdentityAuth&&m.bearerAuth&&!i.__metadata?.hasStreamingBody&&!i.__metadata?.workloadIdentityTokenRefreshed)return await Bje(f.body),this._workloadIdentityAuth.invalidateToken(),this.makeRequest({...i,__metadata:{...i.__metadata,workloadIdentityTokenRefreshed:!0}},n,r??u);let E=await this.shouldRetry(f);if(n&&E){let k=`retrying, ${n} attempts remaining`;return await Bje(f.body),td(this).info(`${y} - ${k}`),td(this).debug(`[${u}] response error (${k})`,mv({retryOfRequestLogID:r,url:f.url,status:f.status,headers:f.headers,durationMs:g-d})),this.retryRequest(i,n,r??u,f.headers)}let _=E?"error; no more retries left":"error; not retryable";td(this).info(`${y} - ${_}`);let S=await f.text().catch(k=>cX(k).message),C=Kzt(S),I=C?void 0:S;throw td(this).debug(`[${u}] response error (${_})`,mv({retryOfRequestLogID:r,url:f.url,status:f.status,headers:f.headers,message:I,durationMs:Date.now()-d})),this.makeStatusError(f.status,C,I,f.headers)}return td(this).info(y),td(this).debug(`[${u}] response start`,mv({retryOfRequestLogID:r,url:f.url,status:f.status,headers:f.headers,durationMs:g-d})),{response:f,options:i,controller:h,requestLogID:u,retryOfRequestLogID:r,startTime:d}}getAPIList(e,n,r){return this.requestAPIList(n,r&&"then"in r?r.then(i=>({method:"get",path:e,...i})):{method:"get",path:e,...r})}requestAPIList(e,n){let r=this.makeRequest(n,null,void 0);return new hX(this,r,e)}async fetchWithAuth(e,n,r,i,s={bearerAuth:!0,adminAPIKeyAuth:!0}){if(this._workloadIdentityAuth&&s.bearerAuth){let a=n.headers,c=a.get("Authorization");if(!c||c===`Bearer ${oZr}`){let u=await this._workloadIdentityAuth.getToken();a.set("Authorization",`Bearer ${u}`)}}return await this.fetchWithTimeout(e,n,r,i)}async fetchWithTimeout(e,n,r,i){let{signal:s,method:o,...a}=n||{},c=this._makeAbort(i);s&&s.addEventListener("abort",c,{once:!0});let u=setTimeout(c,r),l=globalThis.ReadableStream&&a.body instanceof globalThis.ReadableStream||typeof a.body=="object"&&a.body!==null&&Symbol.asyncIterator in a.body,d={signal:i.signal,...l?{duplex:"half"}:{},method:"GET",...a};o&&(d.method=o.toUpperCase());try{return await this.fetch.call(void 0,e,d)}finally{clearTimeout(u)}}async shouldRetry(e){let n=e.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,n,r,i){let s,o=i?.get("retry-after-ms");if(o){let c=parseFloat(o);Number.isNaN(c)||(s=c)}let a=i?.get("retry-after");if(a&&!s){let c=parseFloat(a);Number.isNaN(c)?s=Date.parse(a)-Date.now():s=c*1e3}if(s===void 0){let c=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(n,c)}return await pI(s),this.makeRequest(e,n-1,r)}calculateDefaultRetryTimeoutMillis(e,n){let s=n-e,o=Math.min(.5*Math.pow(2,s),8),a=1-Math.random()*.25;return o*a*1e3}async buildRequest(e,{retryCount:n=0}={}){let r={...e},{method:i,path:s,query:o,defaultBaseURL:a}=r,c=this.buildURL(s,o,a);"timeout"in r&&zzt("timeout",r.timeout),r.timeout=r.timeout??this.timeout;let{bodyHeaders:u,body:l,isStreamingBody:d}=this.buildBody({options:r});d&&(e.__metadata={...e.__metadata,hasStreamingBody:!0});let m=await this.buildHeaders({options:e,method:i,bodyHeaders:u,retryCount:n});return{req:{method:i,headers:m,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:"half"},...l&&{body:l},...this.fetchOptions??{},...r.fetchOptions??{}},url:c,timeout:r.timeout}}async buildHeaders({options:e,method:n,bodyHeaders:r,retryCount:i}){let s={};this.idempotencyHeader&&n!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let o=In([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...t7t(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(e,e.__security??{bearerAuth:!0}),this._options.defaultHeaders,r,e.headers]);return this.validateHeaders(o,e.__security??{bearerAuth:!0}),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:n}}){if(!e)return{bodyHeaders:void 0,body:void 0,isStreamingBody:!1};let r=In([n]),i=typeof globalThis.ReadableStream<"u"&&e instanceof globalThis.ReadableStream,s=!i&&(typeof e=="string"||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof globalThis.Blob<"u"&&e instanceof globalThis.Blob||e instanceof URLSearchParams||e instanceof FormData);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||i?{bodyHeaders:void 0,body:e,isStreamingBody:!s}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:dEe(e),isStreamingBody:!0}:typeof e=="object"&&r.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e),isStreamingBody:!1}:{...Ut(this,WEe,"f").call(this,{body:e,headers:r}),isStreamingBody:!1}}};i9e=di,WEe=new WeakMap,r9e=new WeakSet,dKt=function(){return this.baseURL!=="https://api.openai.com/v1"};di.OpenAI=i9e;di.DEFAULT_TIMEOUT=6e5;di.OpenAIError=qn;di.APIError=Su;di.APIConnectionError=UB;di.APIConnectionTimeoutError=GB;di.APIUserAbortError=Rd;di.NotFoundError=Kq;di.ConflictError=Jq;di.RateLimitError=Zq;di.BadRequestError=Vq;di.AuthenticationError=Yq;di.InternalServerError=e5;di.PermissionDeniedError=zq;di.UnprocessableEntityError=Xq;di.InvalidWebhookSignatureError=dI;di.toFile=_Ee;di.Completions=QL;di.Chat=jB;di.Embeddings=GL;di.Files=WL;di.Images=VL;di.Audio=fI;di.Moderations=zL;di.Models=YL;di.FineTuning=Ax;di.Graders=tN;di.VectorStores=_v;di.Webhooks=XL;di.Beta=gx;di.Batches=PL;di.Uploads=rN;di.Admin=YB;di.Responses=Ev;di.Realtime=yv;di.Conversations=ZB;di.Evals=eN;di.Containers=XB;di.Skills=bv;di.Videos=JL});var BX,lZr,pKt=v(()=>{p();Bc();hx();TX();HEe();BX=class extends di{constructor({baseURL:e=My("OPENAI_BASE_URL"),apiKey:n=My("AZURE_OPENAI_API_KEY"),apiVersion:r=My("OPENAI_API_VERSION"),endpoint:i,deployment:s,azureADTokenProvider:o,dangerouslyAllowBrowser:a,...c}={}){if(!r)throw new qn("The OPENAI_API_VERSION environment variable is missing or empty; either provide it, or instantiate the AzureOpenAI client with an apiVersion option, like new AzureOpenAI({ apiVersion: 'My API Version' }).");if(typeof o=="function"&&(a=!0),!o&&!n)throw new qn("Missing credentials. Please pass one of `apiKey` and `azureADTokenProvider`, or set the `AZURE_OPENAI_API_KEY` environment variable.");if(o&&n)throw new qn("The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time.");if(c.defaultQuery={...c.defaultQuery,"api-version":r},e){if(i)throw new qn("baseURL and endpoint are mutually exclusive")}else{if(i||(i=process.env.AZURE_OPENAI_ENDPOINT),!i)throw new qn("Must provide one of the `baseURL` or `endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable");e=`${i}/openai`}super({apiKey:o??n,baseURL:e,...c,...a!==void 0?{dangerouslyAllowBrowser:a}:{}}),this.apiVersion="",this.apiVersion=r,this.deploymentName=s}async buildRequest(e,n={}){if(lZr.has(e.path)&&e.method==="post"&&e.body!==void 0){if(!r5(e.body))throw new Error("Expected request body to be an object");let r=this.deploymentName||e.body.model||e.__metadata?.model;r!==void 0&&!this.baseURL.includes("/deployments")&&(e.path=`/deployments/${r}${e.path}`)}return super.buildRequest(e,n)}async authHeaders(e,n){let r=n??{bearerAuth:!0,adminAPIKeyAuth:!0};return r.bearerAuth&&typeof this._options.apiKey=="string"?In([{"api-key":this.apiKey}]):super.authHeaders(e,r)}},lZr=new Set(["/completions","/chat/completions","/embeddings","/audio/transcriptions","/audio/translations","/audio/speech","/images/generations","/batches","/images/edits"])});var NX=v(()=>{p();HEe();Kje();AEe();HEe();xi();G0();pKt()});function iN(t){if(t===void 0)return;let e=Array.from(t);return e.length<=64?t:e.slice(0,64).join("")}var DX=v(()=>{p()});function sN(t){let e=3735928559,n=1103547991;for(let r=0;r>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(e^e>>>13,3266489909),(n>>>0).toString(36)+(e>>>0).toString(36)}var qEe=v(()=>{p()});function uZr(t,e){let n={v:1,id:t};return e&&(n.phase=e),JSON.stringify(n)}function dZr(t){if(t){if(t.startsWith("{"))try{let e=JSON.parse(t);if(e.v===1&&typeof e.id=="string")return e.phase==="commentary"||e.phase==="final_answer"?{id:e.id,phase:e.phase}:{id:e.id}}catch{}return{id:t}}}function pZr(t,e){let n=e.filter(o=>o.type==="text").map(o=>o.text).join(` +`),r=e.filter(o=>o.type==="image"),i=n.length>0;if(r.length===0||!t.input.includes("image"))return ri(i?n:r.length>0?"(see attached image)":"(no tool output)");let s=[];i&&s.push({type:"input_text",text:ri(n)});for(let o of r)s.push({type:"input_image",detail:"auto",image_url:`data:${o.mimeType};base64,${o.data}`});return s}function ZL(t,e,n,r){let i=vh(e,r?.supportsMidConvoSystemMessages),s=[],o=y=>{let E=y.replace(/[^a-zA-Z0-9_-]/g,"_");return(E.length>64?E.slice(0,64):E).replace(/_+$/,"")},a=y=>{let E=`fc_${sN(y)}`;return E.length>64?E.slice(0,64):E},c=(y,E,_)=>{if(!n.has(t.provider)||!y.includes("|"))return o(y);let[S,C]=y.split("|"),I=o(S),k=_.provider!==t.provider||_.api!==t.api?a(C):o(C);return k.startsWith("fc_")||(k=o(`fc_${k}`)),`${I}|${k}`},u=k0(i.messages,t,c),l=w0(i.messages,(r?.supportsAdditionalTools??!1)||(r?.supportsToolSearch??!1)),d=(y,E)=>{let _=l.anchorsAdditions?y.toolsAdded??[]:[];if(_.length===0)return;if(r?.supportsAdditionalTools){s.push({type:"additional_tools",role:"developer",tools:oN(_,r.toolOptions)});return}if(!r?.supportsToolSearch)return;let S=_.map(I=>I.name),C=`pi_tool_load_${sN(`${E}:${S.join(",")}`)}`;s.push({type:"tool_search_call",call_id:C,execution:"client",status:"completed",arguments:{query:S.join(" "),limit:S.length}}),s.push({type:"tool_search_output",call_id:C,execution:"client",status:"completed",tools:oN(_,{...r.toolOptions,toolSearchResult:!0})})},m=r?.includeSystemPrompt??!0,h=t.compat,f=t.reasoning&&h?.supportsDeveloperRole!==!1?"developer":"system",g=0,A=0;for(let y of u){let E=A++===0&&y.role==="system";if(y.role==="system"){if(E||d(y,`system:${g}`),!E||m){let _=E?kc(y):XC(y);_.length>0&&s.push({role:f,content:ri(_)})}}else if(y.role==="user")if(typeof y.content=="string")s.push({role:"user",content:[{type:"input_text",text:ri(y.content)}]});else{let _=y.content.map(S=>S.type==="text"?{type:"input_text",text:ri(S.text)}:{type:"input_image",detail:"auto",image_url:`data:${S.mimeType};base64,${S.data}`});if(_.length===0)continue;s.push({role:"user",content:_})}else if(y.role==="assistant"){let _=[],S=y,C=S.provider===t.provider&&S.api===t.api,I=C&&S.model===t.id,w=C&&S.model!==t.id,k=0;for(let N of y.content)if(N.type==="thinking"){if(N.thinkingSignature){let O=JSON.parse(N.thinkingSignature);_.push(O)}}else if(N.type==="text"){let O=N,W=dZr(O.textSignature),$=k===0?`msg_pi_${g}`:`msg_pi_${g}_${k}`;k++;let G=W?.id;G?G.length>64&&(G=`msg_${sN(G)}`):G=$,_.push({type:"message",role:"assistant",content:[{type:"output_text",text:ri(O.text),annotations:[]}],status:"completed",id:G,phase:W?.phase})}else if(N.type==="toolCall"){let O=N,[W,$]=O.id.split("|"),G=r?.grammarToolInputProperties?.get(O.name),q=$;(w&&q?.startsWith("fc_")||G===void 0&&!q?.startsWith("fc_"))&&(q=void 0),G!==void 0?_.push({type:"custom_tool_call",id:q,call_id:W,name:O.name,input:ri(EAe(O.name,O.arguments,G)),...I&&O.namespace!==void 0?{namespace:O.namespace}:{}}):_.push({type:"function_call",id:q,call_id:W,name:O.name,arguments:JSON.stringify(O.arguments),...I&&O.namespace!==void 0?{namespace:O.namespace}:{}})}if(_.length===0)continue;s.push(..._)}else if(y.role==="toolResult"){let[_]=y.toolCallId.split("|"),S=pZr(t,y.content);r?.grammarToolInputProperties?.has(y.toolName)?s.push({type:"custom_tool_call_output",call_id:_,output:S}):s.push({type:"function_call_output",call_id:_,output:S})}E||g++}return s}function oN(t,e){let n=e?.strict===void 0?!1:e.strict,r=e?.supportsStrictMode??!0,i=e?.supportsOpenAIGrammarTools??!1;return t.map(s=>{let o=sJ(s,i);if(o)return{type:"custom",name:s.name,description:s.description,format:{type:"grammar",syntax:o.format,definition:o.definition},...e?.toolSearchResult?{defer_loading:!0}:{}};let c=wy(s,r)??n,u={type:"function",name:s.name,description:s.description,parameters:v0(s,c===!0),...e?.toolSearchResult?{defer_loading:!0}:{}};return r&&(u.strict=c),u})}function mKt(t){let e=t.customInput?.property;if(e===void 0)return"";let n=t.arguments[e];return typeof n=="string"?n:""}function s9e(t,e,n){let r=t.customInput;if(!r)return;let i=bAe(r.jsonBuffer,r.property,e,n);return t.arguments={[r.property]:e},i}async function e2(t,e,n,r,i){let s=!1,o=new Map,a=new Map,c=g=>{g.type==="message"&&g.phase==="final_answer"&&(e.stopReason="stop")},u=(g,A)=>{let y=o.get(g);return y?.type===A?y:void 0},l=(g,A)=>{A!==void 0&&n.push({type:"toolcall_delta",contentIndex:g.contentIndex,delta:A,partial:e})},d=(g,A)=>{if(A.type==="reasoning"){let y={type:"thinking",thinking:""};e.content.push(y);let E={type:"thinking",block:y,contentIndex:e.content.length-1};return o.set(g,E),n.push({type:"thinking_start",contentIndex:E.contentIndex,partial:e}),E}if(A.type==="message"){c(A);let y={type:"text",text:""};e.content.push(y);let E={type:"text",block:y,contentIndex:e.content.length-1};return o.set(g,E),n.push({type:"text_start",contentIndex:E.contentIndex,partial:e}),E}if(A.type==="function_call"){let y={type:"toolCall",id:`${A.call_id}|${A.id}`,name:A.name,arguments:{},...A.namespace!==void 0?{namespace:A.namespace}:{},partialJson:A.arguments||""};e.content.push(y);let E={type:"toolCall",block:y,contentIndex:e.content.length-1};return o.set(g,E),n.push({type:"toolcall_start",contentIndex:E.contentIndex,partial:e}),E}if(A.type==="custom_tool_call"){let y=i?.grammarToolInputProperties?.get(A.name)??"input",E=A.input||"",_={type:"toolCall",id:`${A.call_id}|${A.id}`,name:A.name,arguments:{[y]:E},...A.namespace!==void 0?{namespace:A.namespace}:{},customInput:{property:y,jsonBuffer:{input:"",started:!1,closed:!1}}};e.content.push(_);let S={type:"toolCall",block:_,contentIndex:e.content.length-1};return o.set(g,S),n.push({type:"toolcall_start",contentIndex:S.contentIndex,partial:e}),S}},m=(g,A)=>o.get(g)??d(g,A),h=g=>{for(let A of g){if(A.type!=="reasoning"||!A.encrypted_content)continue;let y=a.get(A.id);if(!y?.thinkingSignature)continue;let E=JSON.parse(y.thinkingSignature);E.encrypted_content||(y.thinkingSignature=JSON.stringify({...E,encrypted_content:A.encrypted_content}))}},f=g=>{if(s=!0,h(g.output??[]),g?.id&&(e.responseId=g.id),g?.usage){let S=g.usage.input_tokens_details,C=S?.cached_tokens||0,I=S?.cache_write_tokens||0;e.usage={input:Math.max(0,(g.usage.input_tokens||0)-C-I),output:g.usage.output_tokens||0,cacheRead:C,cacheWrite:I,reasoning:g.usage.output_tokens_details?.reasoning_tokens||0,totalTokens:g.usage.total_tokens||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}if($p(r,e.usage),i?.applyServiceTierPricing){let S=i.resolveServiceTier?i.resolveServiceTier(g?.service_tier,i.serviceTier):g?.service_tier??i.serviceTier;i.applyServiceTierPricing(e.usage,S)}let A=g?.status,y=g?.incomplete_details,E=typeof y?.reason=="string"?y.reason:void 0;e.rawStopReason=E?`${A}.${E}`:A;let _=mZr(A,E);e.stopReason=_.stopReason,_.errorMessage===void 0?delete e.errorMessage:e.errorMessage=_.errorMessage,e.content.some(S=>S.type==="toolCall")&&e.stopReason==="stop"&&(e.stopReason="toolUse")};for await(let g of t)if(g.type==="response.created")e.responseId=g.response.id;else if(g.type==="response.output_item.added")d(g.output_index,g.item);else if(g.type==="response.reasoning_summary_text.delta"){let A=u(g.output_index,"thinking");if(!A)continue;A.block.thinking+=g.delta,n.push({type:"thinking_delta",contentIndex:A.contentIndex,delta:g.delta,partial:e})}else if(g.type==="response.reasoning_summary_part.done"){let A=u(g.output_index,"thinking");if(!A)continue;A.block.thinking+=` `,n.push({type:"thinking_delta",contentIndex:A.contentIndex,delta:` -`,partial:e})}else if(g.type==="response.reasoning_text.delta"){let A=u(g.output_index,"thinking");if(!A)continue;A.block.thinking+=g.delta,n.push({type:"thinking_delta",contentIndex:A.contentIndex,delta:g.delta,partial:e})}else if(g.type==="response.output_text.delta"){let A=u(g.output_index,"text");if(!A)continue;A.block.text+=g.delta,n.push({type:"text_delta",contentIndex:A.contentIndex,delta:g.delta,partial:e})}else if(g.type==="response.refusal.delta"){let A=u(g.output_index,"text");if(!A)continue;A.block.text+=g.delta,n.push({type:"text_delta",contentIndex:A.contentIndex,delta:g.delta,partial:e})}else if(g.type==="response.function_call_arguments.delta"){let A=u(g.output_index,"toolCall");if(!A||A.block.partialJson===void 0)continue;A.block.partialJson+=g.delta,A.block.arguments=va(A.block.partialJson),l(A,g.delta)}else if(g.type==="response.function_call_arguments.done"){let A=u(g.output_index,"toolCall");if(!A||A.block.partialJson===void 0)continue;let y=A.block.partialJson;if(A.block.partialJson=g.arguments,A.block.arguments=va(A.block.partialJson),g.arguments.startsWith(y)){let b=g.arguments.slice(y.length);b.length>0&&l(A,b)}}else if(g.type==="response.custom_tool_call_input.delta"){let A=u(g.output_index,"toolCall");if(!A||!A.block.customInput)continue;l(A,Mqe(A.block,qUt(A.block)+g.delta,!1))}else if(g.type==="response.custom_tool_call_input.done"){let A=u(g.output_index,"toolCall");if(!A||!A.block.customInput)continue;l(A,Mqe(A.block,g.input,!0))}else if(g.type==="response.output_item.done"){let A=g.item;c(A);let y=h(g.output_index,A);if(A.type==="reasoning"&&y?.type==="thinking"){let b=A.summary?.map(C=>C.text).join(` +`,partial:e})}else if(g.type==="response.reasoning_text.delta"){let A=u(g.output_index,"thinking");if(!A)continue;A.block.thinking+=g.delta,n.push({type:"thinking_delta",contentIndex:A.contentIndex,delta:g.delta,partial:e})}else if(g.type==="response.output_text.delta"){let A=u(g.output_index,"text");if(!A)continue;A.block.text+=g.delta,n.push({type:"text_delta",contentIndex:A.contentIndex,delta:g.delta,partial:e})}else if(g.type==="response.refusal.delta"){let A=u(g.output_index,"text");if(!A)continue;A.block.text+=g.delta,n.push({type:"text_delta",contentIndex:A.contentIndex,delta:g.delta,partial:e})}else if(g.type==="response.function_call_arguments.delta"){let A=u(g.output_index,"toolCall");if(!A||A.block.partialJson===void 0)continue;A.block.partialJson+=g.delta,A.block.arguments=ec(A.block.partialJson),l(A,g.delta)}else if(g.type==="response.function_call_arguments.done"){let A=u(g.output_index,"toolCall");if(!A||A.block.partialJson===void 0)continue;let y=A.block.partialJson;if(A.block.partialJson=g.arguments,A.block.arguments=ec(A.block.partialJson),g.arguments.startsWith(y)){let E=g.arguments.slice(y.length);E.length>0&&l(A,E)}}else if(g.type==="response.custom_tool_call_input.delta"){let A=u(g.output_index,"toolCall");if(!A||!A.block.customInput)continue;l(A,s9e(A.block,mKt(A.block)+g.delta,!1))}else if(g.type==="response.custom_tool_call_input.done"){let A=u(g.output_index,"toolCall");if(!A||!A.block.customInput)continue;l(A,s9e(A.block,g.input,!0))}else if(g.type==="response.output_item.done"){let A=g.item;c(A);let y=m(g.output_index,A);if(A.type==="reasoning"&&y?.type==="thinking"){let E=A.summary?.map(S=>S.text).join(` -`)||"",S=A.content?.map(C=>C.text).join(` +`)||"",_=A.content?.map(S=>S.text).join(` -`)||"";y.block.thinking=b||S||y.block.thinking,y.block.thinkingSignature=JSON.stringify(A),a.set(A.id,y.block),n.push({type:"thinking_end",contentIndex:y.contentIndex,content:y.block.thinking,partial:e}),o.delete(g.output_index)}else A.type==="message"&&y?.type==="text"?(y.block.text=A.content?.map(b=>b.type==="output_text"?b.text:b.refusal).join("")||"",y.block.textSignature=Yvr(A.id,A.phase??void 0),n.push({type:"text_end",contentIndex:y.contentIndex,content:y.block.text,partial:e}),o.delete(g.output_index)):A.type==="function_call"&&y?.type==="toolCall"&&y.block.partialJson!==void 0?(y.block.arguments=va(A.arguments||y.block.partialJson||"{}"),A.namespace!==void 0&&(y.block.namespace=A.namespace),delete y.block.partialJson,n.push({type:"toolcall_end",contentIndex:y.contentIndex,toolCall:y.block,partial:e}),o.delete(g.output_index)):A.type==="custom_tool_call"&&y?.type==="toolCall"&&y.block.customInput&&(l(y,Mqe(y.block,A.input??qUt(y.block),!0)),A.namespace!==void 0&&(y.block.namespace=A.namespace),delete y.block.customInput,n.push({type:"toolcall_end",contentIndex:y.contentIndex,toolCall:y.block,partial:e}),o.delete(g.output_index))}else if(g.type==="response.completed"||g.type==="response.incomplete")f(g.response);else{if(g.type==="error")throw new Error(`Error Code ${g.code}: ${g.message}`||"Unknown error");if(g.type==="response.failed"){i=!0,e.rawStopReason=g.response?.status;let A=g.response?.error,y=g.response?.incomplete_details,b=A?`${A.code||"unknown"}: ${A.message||"no message"}`:y?.reason?`incomplete: ${y.reason}`:"Unknown error (no error details in response)";throw new Error(b)}}if(!i)throw new Error("OpenAI Responses stream ended before a terminal response event")}function Jvr(t,e){if(!t)return{stopReason:"stop"};switch(t){case"completed":return{stopReason:"stop"};case"incomplete":return e==="max_output_tokens"?{stopReason:"length"}:{stopReason:"error",errorMessage:e?`Response incomplete: ${e}`:"Response incomplete without a provider reason"};case"failed":case"cancelled":return{stopReason:"error"};case"in_progress":case"queued":return{stopReason:"stop"};default:{let n=t;throw new Error(`Unhandled stop reason: ${n}`)}}}var Khe=V(()=>{p();is();Yhe();Px();nC();rC();HB()});var VUt={};Ir(VUt,{stream:()=>HUt,streamSimple:()=>sRr});function tRr(t){let e=new Map;if(!t)return e;for(let n of t.split(",")){let r=n.trim();if(!r)continue;let[s,i]=r.split("=",2);!s||!i||e.set(s.trim(),i.trim())}return e}function nRr(t,e){return e?.azureDeploymentName?e.azureDeploymentName:tRr(Ps("AZURE_OPENAI_DEPLOYMENT_NAME_MAP",e?.env)).get(t.id)||t.id}function rRr(t){return Of(Ch(t),"Azure OpenAI API error")}function iRr(t){let e=t.trim().replace(/\/+$/,""),n;try{n=new URL(e)}catch{throw new Error(`Invalid Azure OpenAI base URL: ${t}`)}let r=n.hostname.endsWith(".openai.azure.com")||n.hostname.endsWith(".cognitiveservices.azure.com")||n.hostname.endsWith(".ai.azure.com"),s=n.pathname.replace(/\/+$/,"");return r&&(s===""||s==="/"||s==="/openai"||s==="/openai/v1/responses")&&(n.pathname="/openai/v1",n.search=""),n.toString().replace(/\/+$/,"")}function oRr(t){return`https://${t}.openai.azure.com/openai/v1`}function aRr(t,e){let n=e?.azureApiVersion||Ps("AZURE_OPENAI_API_VERSION",e?.env)||Xvr,r=e?.azureBaseUrl?.trim()||Ps("AZURE_OPENAI_BASE_URL",e?.env)?.trim()||void 0,s=e?.azureResourceName||Ps("AZURE_OPENAI_RESOURCE_NAME",e?.env),i=r;if(!i&&s&&(i=oRr(s)),!i&&t.baseUrl&&(i=t.baseUrl),!i)throw new Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return{baseUrl:iRr(i),apiVersion:n}}function cRr(t,e,n){let r={"User-Agent":xh(),...t.headers};n?.headers&&Object.assign(r,n.headers);let{baseUrl:s,apiVersion:i}=aRr(t,n);return new yK({apiKey:e,apiVersion:i,dangerouslyAllowBrowser:!0,fetch:n?.fetch,defaultHeaders:r,baseURL:s})}function lRr(t,e,n,r,s=cE(e.tools,t.compat?.supportsOpenAIGrammarTools??!1)){let i=JP(t,e,Zvr,{grammarToolInputProperties:s}),o={model:r,input:i,stream:!0,prompt_cache_key:Ek(n?.sessionId),store:!1};if(n?.maxTokens&&(o.max_output_tokens=Math.max(n.maxTokens,eRr)),n?.temperature!==void 0&&(o.temperature=n?.temperature),e.tools&&e.tools.length>0&&(o.tools=_k(e.tools,{supportsStrictMode:t.compat?.supportsStrictMode??!0,supportsOpenAIGrammarTools:t.compat?.supportsOpenAIGrammarTools??!1})),n?.toolChoice!==void 0&&(o.tool_choice=n.toolChoice),t.reasoning)if(n?.reasoningEffort||n?.reasoningSummary){let a=n?.reasoningEffort?t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort:"medium";o.reasoning={effort:a,summary:n?.reasoningSummary||"auto"},o.include=["reasoning.encrypted_content"]}else t.thinkingLevelMap?.off!==null&&(o.reasoning={effort:t.thinkingLevelMap?.off??"none"});return n?.samplingParams&&Object.assign(o,n.samplingParams),o}var Xvr,Zvr,eRr,HUt,sRr,jUt=V(()=>{p();EK();is();Bx();Pf();oE();qx();tC();SP();rC();bK();Khe();sC();Xvr="v1",Zvr=new Set(["openai","openai-codex","opencode","azure-openai-responses"]),eRr=16;HUt=(t,e,n)=>{let r=new Ka;return(async()=>{let s=nRr(t,n),i={role:"assistant",content:[],api:"azure-openai-responses",provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let o=n?.apiKey;if(!o)throw new Error(`No API key for provider: ${t.provider}`);let a=cRr(t,o,n),c=cE(e.tools,t.compat?.supportsOpenAIGrammarTools??!1),u=lRr(t,e,n,s,c),l=await n?.onPayload?.(u,t);l!==void 0&&(u=l);let d={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},{data:h,response:m}=await yE(()=>a.responses.create(u,d).withResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});if(await n?.onResponse?.({status:m.status,headers:Pp(m.headers)},t),r.push({type:"start",partial:i}),await XP(h,i,r,t,{grammarToolInputProperties:c}),n?.signal?.aborted)throw new Error("Request was aborted");if(i.stopReason==="pending")throw new Error("Azure OpenAI Responses stream ended without a stop reason");if(i.stopReason==="aborted"||i.stopReason==="error")throw new Error(i.errorMessage||"An unknown error occurred");r.push({type:"done",reason:i.stopReason,message:i}),r.end()}catch(o){for(let a of i.content)delete a.index,delete a.partialJson,delete a.customInput;i.stopReason=n?.signal?.aborted?"aborted":"error",i.errorMessage=rRr(o),r.push({type:"error",reason:i.stopReason,error:i}),r.end()}})(),r},sRr=(t,e,n)=>{let r=n?.apiKey;if(!r)throw new Error(`No API key for provider: ${t.provider}`);let s={...Yd(t,e,n,r),toolChoice:n?.toolChoice},i=n?.reasoning?uu(t,n.reasoning):void 0;return HUt(t,e,{...s,reasoningEffort:i==="off"?void 0:i})}});var zUt=ee((Pno,KUt)=>{p();function SE(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}KUt.exports=SE;SE.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};SE.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};SE.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0};SE.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};SE.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};SE.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};SE.prototype.start=SE.prototype.try;SE.prototype.errors=function(){return this._errors};SE.prototype.attempts=function(){return this._attempts};SE.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,n=0,r=0;r=n&&(e=s,n=o)}return e}});var JUt=ee(eO=>{p();var pRr=zUt();eO.operation=function(t){var e=eO.timeouts(t);return new pRr(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};eO.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)e[n]=t[n];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s{p();XUt.exports=JUt()});var t2t=ee((Uno,Jhe)=>{"use strict";p();var hRr=ZUt(),mRr=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],zhe=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},fRr=(t,e,n)=>{let r=n.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=r,t},gRr=t=>mRr.includes(t),e2t=(t,e)=>new Promise((n,r)=>{e={onFailedAttempt:()=>{},retries:10,...e};let s=hRr.operation(e);s.attempt(async i=>{try{n(await t(i))}catch(o){if(!(o instanceof Error)){r(new TypeError(`Non-error was thrown: "${o}". You should only throw errors.`));return}if(o instanceof zhe)s.stop(),r(o.originalError);else if(o instanceof TypeError&&!gRr(o.message))s.stop(),r(o);else{fRr(o,i,e);try{await e.onFailedAttempt(o)}catch(a){r(a);return}s.retry(o)||r(s.mainError())}}})});Jhe.exports=e2t;Jhe.exports.default=e2t;Jhe.exports.AbortError=zhe});var Fqe=ee((Gno,l2t)=>{"use strict";p();var Xhe=Object.prototype.hasOwnProperty,c2t=Object.prototype.toString,n2t=Object.defineProperty,r2t=Object.getOwnPropertyDescriptor,s2t=function(e){return typeof Array.isArray=="function"?Array.isArray(e):c2t.call(e)==="[object Array]"},i2t=function(e){if(!e||c2t.call(e)!=="[object Object]")return!1;var n=Xhe.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Xhe.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var s;for(s in e);return typeof s>"u"||Xhe.call(e,s)},o2t=function(e,n){n2t&&n.name==="__proto__"?n2t(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},a2t=function(e,n){if(n==="__proto__")if(Xhe.call(e,n)){if(r2t)return r2t(e,n).value}else return;return e[n]};l2t.exports=function t(){var e,n,r,s,i,o,a=arguments[0],c=1,u=arguments.length,l=!1;for(typeof a=="boolean"&&(l=a,a=arguments[1]||{},c=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});c{ARr.exports={name:"gaxios",version:"7.3.1",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/cjs/src/index.js",types:"build/cjs/src/index.d.ts",files:["build/"],exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},scripts:{lint:"gts check --no-inline-config",test:"c8 mocha build/esm/test","presystem-test":"npm run compile","system-test":"mocha build/esm/system-test --timeout 80000",compile:"tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"jsdoc -c .jsdoc.js","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean"},repository:{type:"git",directory:"core/packages/gaxios",url:"https://github.com/googleapis/google-cloud-node.git"},keywords:["google"],engines:{node:">=18"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/cors":"^2.8.6","@types/express":"^5.0.0","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/multiparty":"4.2.1","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/node":"^24.0.0","@types/sinon":"^21.0.0","@types/tmp":"^0.2.6",assert:"^2.0.0",browserify:"^17.0.0",c8:"^10.1.3",cors:"^2.8.5",express:"^5.0.0",gts:"^6.0.2","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.0",mocha:"^11.1.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"14.0.5","null-loader":"^4.0.1","pack-n-play":"^4.0.0",puppeteer:"^24.0.0",sinon:"21.0.3","stream-browserify":"^3.0.0",tmp:"0.2.7","ts-loader":"^9.5.2",typescript:"5.8.3","undici-types":"^7.24.1",webpack:"^5.97.1","webpack-cli":"^6.0.1"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","node-fetch":"^3.3.2"},homepage:"https://github.com/googleapis/google-cloud-node/tree/main/core/packages/gaxios"}});var p2t=ee((Hno,d2t)=>{"use strict";p();var yRr=u2t();d2t.exports={pkg:yRr}});var $qe=ee(CE=>{"use strict";p();var m2t=CE&&CE.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(CE,"__esModule",{value:!0});CE.GaxiosError=CE.GAXIOS_ERROR_SYMBOL=void 0;CE.defaultErrorRedactor=f2t;var h2t=m2t(Fqe()),ERr=m2t(p2t()),Qqe=ERr.default.pkg;CE.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Qqe.name}-gaxios-error`);var Uqe=class t extends Error{config;response;code;status;error;[CE.GAXIOS_ERROR_SYMBOL]=Qqe.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&CE.GAXIOS_ERROR_SYMBOL in e&&e[CE.GAXIOS_ERROR_SYMBOL]===Qqe.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,n,r,s){if(super(e,{cause:s}),this.config=n,this.response=r,this.error=s instanceof Error?s:void 0,this.config=(0,h2t.default)(!0,{},n),this.response&&(this.response.config=(0,h2t.default)(!0,{},this.response.config)),this.response){try{this.response.data=bRr(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}s instanceof DOMException?this.code=s.name:s&&typeof s=="object"&&"code"in s&&(typeof s.code=="string"||typeof s.code=="number")&&(this.code=s.code)}static extractAPIErrorFromResponse(e,n="The request failed"){let r=n;if(typeof e.data=="string"&&(r=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){r="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:r;let s="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,i="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let o=[];for(let a of e.data.error.errors)typeof a=="object"&&"message"in a&&typeof a.message=="string"&&o.push(a.message);return Object.assign({message:o.join(` -`)||r,code:i,status:s},e.data.error)}return Object.assign({message:r,code:i,status:s},e.data.error)}}return{message:r,code:e.status,status:e.statusText}}};CE.GaxiosError=Uqe;function bRr(t,e){switch(t){case"stream":return e;case"json":return JSON.parse(JSON.stringify(e));case"arraybuffer":return JSON.parse(Buffer.from(e).toString("utf8"));case"blob":return JSON.parse(e.text());default:return e}}function f2t(t){let e="< - See `errorRedactor` option in `gaxios` for configuration>.";function n(i){i&&i.forEach((o,a)=>{(/^authentication$/i.test(a)||/^authorization$/i.test(a)||/secret/i.test(a))&&i.set(a,e)})}function r(i,o){if(typeof i=="object"&&i!==null&&typeof i[o]=="string"){let a=i[o];(/grant_type=/i.test(a)||/assertion=/i.test(a)||/secret/i.test(a))&&(i[o]=e)}}function s(i){!i||typeof i!="object"||(i instanceof FormData||i instanceof URLSearchParams||"forEach"in i&&"set"in i?i.forEach((o,a)=>{(["grant_type","assertion"].includes(a)||/secret/.test(a))&&i.set(a,e)}):("grant_type"in i&&(i.grant_type=e),"assertion"in i&&(i.assertion=e),"client_secret"in i&&(i.client_secret=e)))}return t.config&&(n(t.config.headers),r(t.config,"data"),s(t.config.data),r(t.config,"body"),s(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(f2t({config:t.response.config}),n(t.response.headers),t.response.bodyUsed&&(r(t.response,"data"),s(t.response.data))),t}});var A2t=ee(Gqe=>{"use strict";p();Object.defineProperty(Gqe,"__esModule",{value:!0});Gqe.getRetryConfig=_Rr;async function _Rr(t){let e=g2t(t);if(!t||!t.config||!e&&!t.config.retry)return{shouldRetry:!1};e=e||{},e.currentRetryAttempt=e.currentRetryAttempt||0,e.retry=e.retry===void 0||e.retry===null?3:e.retry,e.httpMethodsToRetry=e.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],e.noResponseRetries=e.noResponseRetries===void 0||e.noResponseRetries===null?2:e.noResponseRetries,e.retryDelayMultiplier=e.retryDelayMultiplier?e.retryDelayMultiplier:2,e.timeOfFirstRequest=e.timeOfFirstRequest?e.timeOfFirstRequest:Date.now(),e.totalTimeout=e.totalTimeout?e.totalTimeout:Number.MAX_SAFE_INTEGER,e.maxRetryDelay=e.maxRetryDelay?e.maxRetryDelay:Number.MAX_SAFE_INTEGER;let n=[[100,199],[408,408],[429,429],[500,599]];if(e.statusCodesToRetry=e.statusCodesToRetry||n,t.config.retryConfig=e,!await(e.shouldRetry||SRr)(t))return{shouldRetry:!1,config:t.config};let s=CRr(e);t.config.retryConfig.currentRetryAttempt+=1;let i=e.retryBackoff?e.retryBackoff(t,s):new Promise(o=>{setTimeout(o,s)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await i,{shouldRetry:!0,config:t.config}}function SRr(t){let e=g2t(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let n=!1;for(let[r,s]of e.statusCodesToRetry){let i=t.response.status;if(i>=r&&i<=s){n=!0;break}}if(!n)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}function g2t(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}function CRr(t){let n=(t.currentRetryAttempt?0:t.retryDelay??100)+(Math.pow(t.retryDelayMultiplier,t.currentRetryAttempt)-1)/2*1e3,r=t.totalTimeout-(Date.now()-t.timeOfFirstRequest);return Math.min(n,r,t.maxRetryDelay)}});var qqe=ee(Zhe=>{"use strict";p();Object.defineProperty(Zhe,"__esModule",{value:!0});Zhe.GaxiosInterceptorManager=void 0;var Wqe=class extends Set{};Zhe.GaxiosInterceptorManager=Wqe});function IRr(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let n=t.substring(5,e).split(";"),r="",s=!1,i=n[0]||"text/plain",o=i;for(let l=1;l{p();y2t=IRr});var _2t=ee((eme,b2t)=>{p();(function(t,e){typeof eme=="object"&&typeof b2t<"u"?e(eme):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(eme,(function(t){"use strict";function e(){}function n(L){return typeof L=="object"&&L!==null||typeof L=="function"}let r=e;function s(L,K){try{Object.defineProperty(L,"name",{value:K,configurable:!0})}catch{}}let i=Promise,o=Promise.prototype.then,a=Promise.reject.bind(i);function c(L){return new i(L)}function u(L){return c(K=>K(L))}function l(L){return a(L)}function d(L,K,we){return o.call(L,K,we)}function h(L,K,we){d(d(L,K,we),void 0,r)}function m(L,K){h(L,K)}function f(L,K){h(L,void 0,K)}function g(L,K,we){return d(L,K,we)}function A(L){d(L,void 0,r)}let y=L=>{if(typeof queueMicrotask=="function")y=queueMicrotask;else{let K=u(void 0);y=we=>d(K,we)}return y(L)};function b(L,K,we){if(typeof L!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(L,K,we)}function S(L,K,we){try{return u(b(L,K,we))}catch(nt){return l(nt)}}let C=16384;class I{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(K){let we=this._back,nt=we;we._elements.length===C-1&&(nt={_elements:[],_next:void 0}),we._elements.push(K),nt!==we&&(this._back=nt,we._next=nt),++this._size}shift(){let K=this._front,we=K,nt=this._cursor,Et=nt+1,Kt=K._elements,an=Kt[nt];return Et===C&&(we=K._next,Et=0),--this._size,this._cursor=Et,K!==we&&(this._front=we),Kt[nt]=void 0,an}forEach(K){let we=this._cursor,nt=this._front,Et=nt._elements;for(;(we!==Et.length||nt._next!==void 0)&&!(we===Et.length&&(nt=nt._next,Et=nt._elements,we=0,Et.length===0));)K(Et[we]),++we}peek(){let K=this._front,we=this._cursor;return K._elements[we]}}let x=Symbol("[[AbortSteps]]"),w=Symbol("[[ErrorSteps]]"),R=Symbol("[[CancelSteps]]"),N=Symbol("[[PullSteps]]"),P=Symbol("[[ReleaseSteps]]");function G(L,K){L._ownerReadableStream=K,K._reader=L,K._state==="readable"?oe(L):K._state==="closed"?Z(L):re(L,K._storedError)}function $(L,K){let we=L._ownerReadableStream;return am(we,K)}function Q(L){let K=L._ownerReadableStream;K._state==="readable"?q(L,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):ce(L,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),K._readableStreamController[P](),K._reader=void 0,L._ownerReadableStream=void 0}function H(L){return new TypeError("Cannot "+L+" a stream using a released reader")}function oe(L){L._closedPromise=c((K,we)=>{L._closedPromise_resolve=K,L._closedPromise_reject=we})}function re(L,K){oe(L),q(L,K)}function Z(L){oe(L),be(L)}function q(L,K){L._closedPromise_reject!==void 0&&(A(L._closedPromise),L._closedPromise_reject(K),L._closedPromise_resolve=void 0,L._closedPromise_reject=void 0)}function ce(L,K){re(L,K)}function be(L){L._closedPromise_resolve!==void 0&&(L._closedPromise_resolve(void 0),L._closedPromise_resolve=void 0,L._closedPromise_reject=void 0)}let Be=Number.isFinite||function(L){return typeof L=="number"&&isFinite(L)},Me=Math.trunc||function(L){return L<0?Math.ceil(L):Math.floor(L)};function Re(L){return typeof L=="object"||typeof L=="function"}function se(L,K){if(L!==void 0&&!Re(L))throw new TypeError(`${K} is not an object.`)}function ie(L,K){if(typeof L!="function")throw new TypeError(`${K} is not a function.`)}function ne(L){return typeof L=="object"&&L!==null||typeof L=="function"}function J(L,K){if(!ne(L))throw new TypeError(`${K} is not an object.`)}function te(L,K,we){if(L===void 0)throw new TypeError(`Parameter ${K} is required in '${we}'.`)}function j(L,K,we){if(L===void 0)throw new TypeError(`${K} is required in '${we}'.`)}function X(L){return Number(L)}function ae(L){return L===0?0:L}function me(L){return ae(Me(L))}function Ae(L,K){let nt=Number.MAX_SAFE_INTEGER,Et=Number(L);if(Et=ae(Et),!Be(Et))throw new TypeError(`${K} is not a finite number`);if(Et=me(Et),Et<0||Et>nt)throw new TypeError(`${K} is outside the accepted range of 0 to ${nt}, inclusive`);return!Be(Et)||Et===0?0:Et}function ue(L,K){if(!z0(L))throw new TypeError(`${K} is not a ReadableStream.`)}function ye(L){return new z(L)}function Ie(L,K){L._reader._readRequests.push(K)}function Ee(L,K,we){let Et=L._reader._readRequests.shift();we?Et._closeSteps():Et._chunkSteps(K)}function Te(L){return L._reader._readRequests.length}function _e(L){let K=L._reader;return!(K===void 0||!We(K))}class z{constructor(K){if(te(K,1,"ReadableStreamDefaultReader"),ue(K,"First parameter"),J0(K))throw new TypeError("This stream has already been locked for exclusive reading by another reader");G(this,K),this._readRequests=new I}get closed(){return We(this)?this._closedPromise:l(ze("closed"))}cancel(K=void 0){return We(this)?this._ownerReadableStream===void 0?l(H("cancel")):$(this,K):l(ze("cancel"))}read(){if(!We(this))return l(ze("read"));if(this._ownerReadableStream===void 0)return l(H("read from"));let K,we,nt=c((Kt,an)=>{K=Kt,we=an});return He(this,{_chunkSteps:Kt=>K({value:Kt,done:!1}),_closeSteps:()=>K({value:void 0,done:!0}),_errorSteps:Kt=>we(Kt)}),nt}releaseLock(){if(!We(this))throw ze("releaseLock");this._ownerReadableStream!==void 0&&dt(this)}}Object.defineProperties(z.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),s(z.prototype.cancel,"cancel"),s(z.prototype.read,"read"),s(z.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(z.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function We(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_readRequests")?!1:L instanceof z}function He(L,K){let we=L._ownerReadableStream;we._disturbed=!0,we._state==="closed"?K._closeSteps():we._state==="errored"?K._errorSteps(we._storedError):we._readableStreamController[N](K)}function dt(L){Q(L);let K=new TypeError("Reader was released");it(L,K)}function it(L,K){let we=L._readRequests;L._readRequests=new I,we.forEach(nt=>{nt._errorSteps(K)})}function ze(L){return new TypeError(`ReadableStreamDefaultReader.prototype.${L} can only be used on a ReadableStreamDefaultReader`)}let rt=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Ct{constructor(K,we){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=K,this._preventCancel=we}next(){let K=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?g(this._ongoingPromise,K,K):K(),this._ongoingPromise}return(K){let we=()=>this._returnSteps(K);return this._ongoingPromise?g(this._ongoingPromise,we,we):we()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let K=this._reader,we,nt,Et=c((an,rr)=>{we=an,nt=rr});return He(K,{_chunkSteps:an=>{this._ongoingPromise=void 0,y(()=>we({value:an,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Q(K),we({value:void 0,done:!0})},_errorSteps:an=>{this._ongoingPromise=void 0,this._isFinished=!0,Q(K),nt(an)}}),Et}_returnSteps(K){if(this._isFinished)return Promise.resolve({value:K,done:!0});this._isFinished=!0;let we=this._reader;if(!this._preventCancel){let nt=$(we,K);return Q(we),g(nt,()=>({value:K,done:!0}))}return Q(we),u({value:K,done:!0})}}let sn={next(){return Lt(this)?this._asyncIteratorImpl.next():l(Pt("next"))},return(L){return Lt(this)?this._asyncIteratorImpl.return(L):l(Pt("return"))}};Object.setPrototypeOf(sn,rt);function Mt(L,K){let we=ye(L),nt=new Ct(we,K),Et=Object.create(sn);return Et._asyncIteratorImpl=nt,Et}function Lt(L){if(!n(L)||!Object.prototype.hasOwnProperty.call(L,"_asyncIteratorImpl"))return!1;try{return L._asyncIteratorImpl instanceof Ct}catch{return!1}}function Pt(L){return new TypeError(`ReadableStreamAsyncIterator.${L} can only be used on a ReadableSteamAsyncIterator`)}let Ze=Number.isNaN||function(L){return L!==L};var Pe,Xe,At;function Vt(L){return L.slice()}function un(L,K,we,nt,Et){new Uint8Array(L).set(new Uint8Array(we,nt,Et),K)}let mn=L=>(typeof L.transfer=="function"?mn=K=>K.transfer():typeof structuredClone=="function"?mn=K=>structuredClone(K,{transfer:[K]}):mn=K=>K,mn(L)),Mn=L=>(typeof L.detached=="boolean"?Mn=K=>K.detached:Mn=K=>K.byteLength===0,Mn(L));function Ve(L,K,we){if(L.slice)return L.slice(K,we);let nt=we-K,Et=new ArrayBuffer(nt);return un(Et,0,L,K,nt),Et}function pt(L,K){let we=L[K];if(we!=null){if(typeof we!="function")throw new TypeError(`${String(K)} is not a function`);return we}}function Xt(L){let K={[Symbol.iterator]:()=>L.iterator},we=(async function*(){return yield*K})(),nt=we.next;return{iterator:we,nextMethod:nt,done:!1}}let et=(At=(Pe=Symbol.asyncIterator)!==null&&Pe!==void 0?Pe:(Xe=Symbol.for)===null||Xe===void 0?void 0:Xe.call(Symbol,"Symbol.asyncIterator"))!==null&&At!==void 0?At:"@@asyncIterator";function ut(L,K="sync",we){if(we===void 0)if(K==="async"){if(we=pt(L,et),we===void 0){let Kt=pt(L,Symbol.iterator),an=ut(L,"sync",Kt);return Xt(an)}}else we=pt(L,Symbol.iterator);if(we===void 0)throw new TypeError("The object is not iterable");let nt=b(we,L,[]);if(!n(nt))throw new TypeError("The iterator method must return an object");let Et=nt.next;return{iterator:nt,nextMethod:Et,done:!1}}function mt(L){let K=b(L.nextMethod,L.iterator,[]);if(!n(K))throw new TypeError("The iterator.next() method must return an object");return K}function tt(L){return!!L.done}function Dt(L){return L.value}function Zt(L){return!(typeof L!="number"||Ze(L)||L<0)}function Ne(L){let K=Ve(L.buffer,L.byteOffset,L.byteOffset+L.byteLength);return new Uint8Array(K)}function $e(L){let K=L._queue.shift();return L._queueTotalSize-=K.size,L._queueTotalSize<0&&(L._queueTotalSize=0),K.value}function ct(L,K,we){if(!Zt(we)||we===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");L._queue.push({value:K,size:we}),L._queueTotalSize+=we}function Ge(L){return L._queue.peek().value}function wt(L){L._queue=new I,L._queueTotalSize=0}function Ot(L){return L===DataView}function Rt(L){return Ot(L.constructor)}function yn(L){return Ot(L)?1:L.BYTES_PER_ELEMENT}class fn{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Kn(this))throw Ko("view");return this._view}respond(K){if(!Kn(this))throw Ko("respond");if(te(K,1,"respond"),K=Ae(K,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Mn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");ys(this._associatedReadableByteStreamController,K)}respondWithNewView(K){if(!Kn(this))throw Ko("respondWithNewView");if(te(K,1,"respondWithNewView"),!ArrayBuffer.isView(K))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Mn(K.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");pn(this._associatedReadableByteStreamController,K)}}Object.defineProperties(fn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),s(fn.prototype.respond,"respond"),s(fn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(fn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class bn{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!tr(this))throw oa("byobRequest");return _r(this)}get desiredSize(){if(!tr(this))throw oa("desiredSize");return zn(this)}close(){if(!tr(this))throw oa("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let K=this._controlledReadableByteStream._state;if(K!=="readable")throw new TypeError(`The stream (in ${K} state) is not in the readable state and cannot be closed`);Dn(this)}enqueue(K){if(!tr(this))throw oa("enqueue");if(te(K,1,"enqueue"),!ArrayBuffer.isView(K))throw new TypeError("chunk must be an array buffer view");if(K.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(K.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let we=this._controlledReadableByteStream._state;if(we!=="readable")throw new TypeError(`The stream (in ${we} state) is not in the readable state and cannot be enqueued to`);$n(this,K)}error(K=void 0){if(!tr(this))throw oa("error");ar(this,K)}[R](K){dn(this),wt(this);let we=this._cancelAlgorithm(K);return Jt(this),we}[N](K){let we=this._controlledReadableByteStream;if(this._queueTotalSize>0){Lr(this,K);return}let nt=this._autoAllocateChunkSize;if(nt!==void 0){let Et;try{Et=new ArrayBuffer(nt)}catch(an){K._errorSteps(an);return}let Kt={buffer:Et,bufferByteLength:nt,byteOffset:0,byteLength:nt,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(Kt)}Ie(we,K),ns(this)}[P](){if(this._pendingPullIntos.length>0){let K=this._pendingPullIntos.peek();K.readerType="none",this._pendingPullIntos=new I,this._pendingPullIntos.push(K)}}}Object.defineProperties(bn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),s(bn.prototype.close,"close"),s(bn.prototype.enqueue,"enqueue"),s(bn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bn.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function tr(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_controlledReadableByteStream")?!1:L instanceof bn}function Kn(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_associatedReadableByteStreamController")?!1:L instanceof fn}function ns(L){if(!zt(L))return;if(L._pulling){L._pullAgain=!0;return}L._pulling=!0;let we=L._pullAlgorithm();h(we,()=>(L._pulling=!1,L._pullAgain&&(L._pullAgain=!1,ns(L)),null),nt=>(ar(L,nt),null))}function dn(L){us(L),L._pendingPullIntos=new I}function As(L,K){let we=!1;L._state==="closed"&&(we=!0);let nt=Jr(K);K.readerType==="default"?Ee(L,nt,we):Ep(L,nt,we)}function Jr(L){let K=L.bytesFilled,we=L.elementSize;return new L.viewConstructor(L.buffer,L.byteOffset,K/we)}function Ur(L,K,we,nt){L._queue.push({buffer:K,byteOffset:we,byteLength:nt}),L._queueTotalSize+=nt}function bo(L,K,we,nt){let Et;try{Et=Ve(K,we,we+nt)}catch(Kt){throw ar(L,Kt),Kt}Ur(L,Et,0,nt)}function Ci(L,K){K.bytesFilled>0&&bo(L,K.buffer,K.byteOffset,K.bytesFilled),Ua(L)}function hn(L,K){let we=Math.min(L._queueTotalSize,K.byteLength-K.bytesFilled),nt=K.bytesFilled+we,Et=we,Kt=!1,an=nt%K.elementSize,rr=nt-an;rr>=K.minimumFill&&(Et=rr-K.bytesFilled,Kt=!0);let Qs=L._queue;for(;Et>0;){let Xr=Qs.peek(),di=Math.min(Et,Xr.byteLength),Ni=K.byteOffset+K.bytesFilled;un(K.buffer,Ni,Xr.buffer,Xr.byteOffset,di),Xr.byteLength===di?Qs.shift():(Xr.byteOffset+=di,Xr.byteLength-=di),L._queueTotalSize-=di,Xs(L,di,K),Et-=di}return Kt}function Xs(L,K,we){we.bytesFilled+=K}function lo(L){L._queueTotalSize===0&&L._closeRequested?(Jt(L),ZI(L._controlledReadableByteStream)):ns(L)}function us(L){L._byobRequest!==null&&(L._byobRequest._associatedReadableByteStreamController=void 0,L._byobRequest._view=null,L._byobRequest=null)}function Vn(L){for(;L._pendingPullIntos.length>0;){if(L._queueTotalSize===0)return;let K=L._pendingPullIntos.peek();hn(L,K)&&(Ua(L),As(L._controlledReadableByteStream,K))}}function Td(L){let K=L._controlledReadableByteStream._reader;for(;K._readRequests.length>0;){if(L._queueTotalSize===0)return;let we=K._readRequests.shift();Lr(L,we)}}function nd(L,K,we,nt){let Et=L._controlledReadableByteStream,Kt=K.constructor,an=yn(Kt),{byteOffset:rr,byteLength:Qs}=K,Xr=we*an,di;try{di=mn(K.buffer)}catch(wa){nt._errorSteps(wa);return}let Ni={buffer:di,bufferByteLength:di.byteLength,byteOffset:rr,byteLength:Qs,bytesFilled:0,minimumFill:Xr,elementSize:an,viewConstructor:Kt,readerType:"byob"};if(L._pendingPullIntos.length>0){L._pendingPullIntos.push(Ni),Gn(Et,nt);return}if(Et._state==="closed"){let wa=new Kt(Ni.buffer,Ni.byteOffset,0);nt._closeSteps(wa);return}if(L._queueTotalSize>0){if(hn(L,Ni)){let wa=Jr(Ni);lo(L),nt._chunkSteps(wa);return}if(L._closeRequested){let wa=new TypeError("Insufficient bytes to fill elements in the given buffer");ar(L,wa),nt._errorSteps(wa);return}}L._pendingPullIntos.push(Ni),Gn(Et,nt),ns(L)}function Ap(L,K){K.readerType==="none"&&Ua(L);let we=L._controlledReadableByteStream;if(rs(we))for(;bp(we)>0;){let nt=Ua(L);As(we,nt)}}function rd(L,K,we){if(Xs(L,K,we),we.readerType==="none"){Ci(L,we),Vn(L);return}if(we.bytesFilled0){let Et=we.byteOffset+we.bytesFilled;bo(L,we.buffer,Et-nt,nt)}we.bytesFilled-=nt,As(L._controlledReadableByteStream,we),Vn(L)}function yp(L,K){let we=L._pendingPullIntos.peek();us(L),L._controlledReadableByteStream._state==="closed"?Ap(L,we):rd(L,K,we),ns(L)}function Ua(L){return L._pendingPullIntos.shift()}function zt(L){let K=L._controlledReadableByteStream;return K._state!=="readable"||L._closeRequested||!L._started?!1:!!(_e(K)&&Te(K)>0||rs(K)&&bp(K)>0||zn(L)>0)}function Jt(L){L._pullAlgorithm=void 0,L._cancelAlgorithm=void 0}function Dn(L){let K=L._controlledReadableByteStream;if(!(L._closeRequested||K._state!=="readable")){if(L._queueTotalSize>0){L._closeRequested=!0;return}if(L._pendingPullIntos.length>0){let we=L._pendingPullIntos.peek();if(we.bytesFilled%we.elementSize!==0){let nt=new TypeError("Insufficient bytes to fill elements in the given buffer");throw ar(L,nt),nt}}Jt(L),ZI(K)}}function $n(L,K){let we=L._controlledReadableByteStream;if(L._closeRequested||we._state!=="readable")return;let{buffer:nt,byteOffset:Et,byteLength:Kt}=K;if(Mn(nt))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let an=mn(nt);if(L._pendingPullIntos.length>0){let rr=L._pendingPullIntos.peek();if(Mn(rr.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");us(L),rr.buffer=mn(rr.buffer),rr.readerType==="none"&&Ci(L,rr)}if(_e(we))if(Td(L),Te(we)===0)Ur(L,an,Et,Kt);else{L._pendingPullIntos.length>0&&Ua(L);let rr=new Uint8Array(an,Et,Kt);Ee(we,rr,!1)}else rs(we)?(Ur(L,an,Et,Kt),Vn(L)):Ur(L,an,Et,Kt);ns(L)}function ar(L,K){let we=L._controlledReadableByteStream;we._state==="readable"&&(dn(L),wt(L),Jt(L),qre(we,K))}function Lr(L,K){let we=L._queue.shift();L._queueTotalSize-=we.byteLength,lo(L);let nt=new Uint8Array(we.buffer,we.byteOffset,we.byteLength);K._chunkSteps(nt)}function _r(L){if(L._byobRequest===null&&L._pendingPullIntos.length>0){let K=L._pendingPullIntos.peek(),we=new Uint8Array(K.buffer,K.byteOffset+K.bytesFilled,K.byteLength-K.bytesFilled),nt=Object.create(fn.prototype);Ii(nt,L,we),L._byobRequest=nt}return L._byobRequest}function zn(L){let K=L._controlledReadableByteStream._state;return K==="errored"?null:K==="closed"?0:L._strategyHWM-L._queueTotalSize}function ys(L,K){let we=L._pendingPullIntos.peek();if(L._controlledReadableByteStream._state==="closed"){if(K!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(K===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(we.bytesFilled+K>we.byteLength)throw new RangeError("bytesWritten out of range")}we.buffer=mn(we.buffer),yp(L,K)}function pn(L,K){let we=L._pendingPullIntos.peek();if(L._controlledReadableByteStream._state==="closed"){if(K.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(K.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(we.byteOffset+we.bytesFilled!==K.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(we.bufferByteLength!==K.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(we.bytesFilled+K.byteLength>we.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let Et=K.byteLength;we.buffer=mn(K.buffer),yp(L,Et)}function Ri(L,K,we,nt,Et,Kt,an){K._controlledReadableByteStream=L,K._pullAgain=!1,K._pulling=!1,K._byobRequest=null,K._queue=K._queueTotalSize=void 0,wt(K),K._closeRequested=!1,K._started=!1,K._strategyHWM=Kt,K._pullAlgorithm=nt,K._cancelAlgorithm=Et,K._autoAllocateChunkSize=an,K._pendingPullIntos=new I,L._readableStreamController=K;let rr=we();h(u(rr),()=>(K._started=!0,ns(K),null),Qs=>(ar(K,Qs),null))}function kr(L,K,we){let nt=Object.create(bn.prototype),Et,Kt,an;K.start!==void 0?Et=()=>K.start(nt):Et=()=>{},K.pull!==void 0?Kt=()=>K.pull(nt):Kt=()=>u(void 0),K.cancel!==void 0?an=Qs=>K.cancel(Qs):an=()=>u(void 0);let rr=K.autoAllocateChunkSize;if(rr===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Ri(L,nt,Et,Kt,an,we,rr)}function Ii(L,K,we){L._associatedReadableByteStreamController=K,L._view=we}function Ko(L){return new TypeError(`ReadableStreamBYOBRequest.prototype.${L} can only be used on a ReadableStreamBYOBRequest`)}function oa(L){return new TypeError(`ReadableByteStreamController.prototype.${L} can only be used on a ReadableByteStreamController`)}function Nr(L,K){se(L,K);let we=L?.mode;return{mode:we===void 0?void 0:aa(we,`${K} has member 'mode' that`)}}function aa(L,K){if(L=`${L}`,L!=="byob")throw new TypeError(`${K} '${L}' is not a valid enumeration value for ReadableStreamReaderMode`);return L}function ca(L,K){var we;se(L,K);let nt=(we=L?.min)!==null&&we!==void 0?we:1;return{min:Ae(nt,`${K} has member 'min' that`)}}function vd(L){return new Rd(L)}function Gn(L,K){L._reader._readIntoRequests.push(K)}function Ep(L,K,we){let Et=L._reader._readIntoRequests.shift();we?Et._closeSteps(K):Et._chunkSteps(K)}function bp(L){return L._reader._readIntoRequests.length}function rs(L){let K=L._reader;return!(K===void 0||!_p(K))}class Rd{constructor(K){if(te(K,1,"ReadableStreamBYOBReader"),ue(K,"First parameter"),J0(K))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!tr(K._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");G(this,K),this._readIntoRequests=new I}get closed(){return _p(this)?this._closedPromise:l(dh("closed"))}cancel(K=void 0){return _p(this)?this._ownerReadableStream===void 0?l(H("cancel")):$(this,K):l(dh("cancel"))}read(K,we={}){if(!_p(this))return l(dh("read"));if(!ArrayBuffer.isView(K))return l(new TypeError("view must be an array buffer view"));if(K.byteLength===0)return l(new TypeError("view must have non-zero byteLength"));if(K.buffer.byteLength===0)return l(new TypeError("view's buffer must have non-zero byteLength"));if(Mn(K.buffer))return l(new TypeError("view's buffer has been detached"));let nt;try{nt=ca(we,"options")}catch(Xr){return l(Xr)}let Et=nt.min;if(Et===0)return l(new TypeError("options.min must be greater than 0"));if(Rt(K)){if(Et>K.byteLength)return l(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(Et>K.length)return l(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return l(H("read from"));let Kt,an,rr=c((Xr,di)=>{Kt=Xr,an=di});return wb(this,K,Et,{_chunkSteps:Xr=>Kt({value:Xr,done:!1}),_closeSteps:Xr=>Kt({value:Xr,done:!0}),_errorSteps:Xr=>an(Xr)}),rr}releaseLock(){if(!_p(this))throw dh("releaseLock");this._ownerReadableStream!==void 0&&$a(this)}}Object.defineProperties(Rd.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),s(Rd.prototype.cancel,"cancel"),s(Rd.prototype.read,"read"),s(Rd.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rd.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function _p(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_readIntoRequests")?!1:L instanceof Rd}function wb(L,K,we,nt){let Et=L._ownerReadableStream;Et._disturbed=!0,Et._state==="errored"?nt._errorSteps(Et._storedError):nd(Et._readableStreamController,K,we,nt)}function $a(L){Q(L);let K=new TypeError("Reader was released");Cl(L,K)}function Cl(L,K){let we=L._readIntoRequests;L._readIntoRequests=new I,we.forEach(nt=>{nt._errorSteps(K)})}function dh(L){return new TypeError(`ReadableStreamBYOBReader.prototype.${L} can only be used on a ReadableStreamBYOBReader`)}function sd(L,K){let{highWaterMark:we}=L;if(we===void 0)return K;if(Ze(we)||we<0)throw new RangeError("Invalid highWaterMark");return we}function uc(L){let{size:K}=L;return K||(()=>1)}function im(L,K){se(L,K);let we=L?.highWaterMark,nt=L?.size;return{highWaterMark:we===void 0?void 0:X(we),size:nt===void 0?void 0:j0(nt,`${K} has member 'size' that`)}}function j0(L,K){return ie(L,K),we=>X(L(we))}function Ty(L,K){se(L,K);let we=L?.abort,nt=L?.close,Et=L?.start,Kt=L?.type,an=L?.write;return{abort:we===void 0?void 0:ru(we,L,`${K} has member 'abort' that`),close:nt===void 0?void 0:vy(nt,L,`${K} has member 'close' that`),start:Et===void 0?void 0:YI(Et,L,`${K} has member 'start' that`),write:an===void 0?void 0:Tb(an,L,`${K} has member 'write' that`),type:Kt}}function ru(L,K,we){return ie(L,we),nt=>S(L,K,[nt])}function vy(L,K,we){return ie(L,we),()=>S(L,K,[])}function YI(L,K,we){return ie(L,we),nt=>b(L,K,[nt])}function Tb(L,K,we){return ie(L,we),(nt,Et)=>S(L,K,[nt,Et])}function Su(L,K){if(!le(L))throw new TypeError(`${K} is not a WritableStream.`)}function Tg(L){if(typeof L!="object"||L===null)return!1;try{return typeof L.aborted=="boolean"}catch{return!1}}let iv=typeof AbortController=="function";function De(){if(iv)return new AbortController}class E{constructor(K={},we={}){K===void 0?K=null:J(K,"First parameter");let nt=im(we,"Second parameter"),Et=Ty(K,"First parameter");if(U(this),Et.type!==void 0)throw new RangeError("Invalid type is specified");let an=uc(nt),rr=sd(nt,1);om(this,Et,rr,an)}get locked(){if(!le(this))throw Nd("locked");return ve(this)}abort(K=void 0){return le(this)?ve(this)?l(new TypeError("Cannot abort a stream that already has a writer")):Le(this,K):l(Nd("abort"))}close(){return le(this)?ve(this)?l(new TypeError("Cannot close a stream that already has a writer")):Pr(this)?l(new TypeError("Cannot close an already-closing stream")):Ke(this):l(Nd("close"))}getWriter(){if(!le(this))throw Nd("getWriter");return v(this)}}Object.defineProperties(E.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),s(E.prototype.abort,"abort"),s(E.prototype.close,"close"),s(E.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(E.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function v(L){return new W(L)}function B(L,K,we,nt,Et=1,Kt=()=>1){let an=Object.create(E.prototype);U(an);let rr=Object.create(uo.prototype);return ff(an,rr,L,K,we,nt,Et,Kt),an}function U(L){L._state="writable",L._storedError=void 0,L._writer=void 0,L._writableStreamController=void 0,L._writeRequests=new I,L._inFlightWriteRequest=void 0,L._closeRequest=void 0,L._inFlightCloseRequest=void 0,L._pendingAbortRequest=void 0,L._backpressure=!1}function le(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_writableStreamController")?!1:L instanceof E}function ve(L){return L._writer!==void 0}function Le(L,K){var we;if(L._state==="closed"||L._state==="errored")return u(void 0);L._writableStreamController._abortReason=K,(we=L._writableStreamController._abortController)===null||we===void 0||we.abort(K);let nt=L._state;if(nt==="closed"||nt==="errored")return u(void 0);if(L._pendingAbortRequest!==void 0)return L._pendingAbortRequest._promise;let Et=!1;nt==="erroring"&&(Et=!0,K=void 0);let Kt=c((an,rr)=>{L._pendingAbortRequest={_promise:void 0,_resolve:an,_reject:rr,_reason:K,_wasAlreadyErroring:Et}});return L._pendingAbortRequest._promise=Kt,Et||on(L,K),Kt}function Ke(L){let K=L._state;if(K==="closed"||K==="errored")return l(new TypeError(`The stream (in ${K} state) is not in the writable state and cannot be closed`));let we=c((Et,Kt)=>{let an={_resolve:Et,_reject:Kt};L._closeRequest=an}),nt=L._writer;return nt!==void 0&&L._backpressure&&K==="writable"&&gQ(nt),Sp(L._writableStreamController),we}function Ye(L){return c((we,nt)=>{let Et={_resolve:we,_reject:nt};L._writeRequests.push(Et)})}function Tt(L,K){if(L._state==="writable"){on(L,K);return}nr(L)}function on(L,K){let we=L._writableStreamController;L._state="erroring",L._storedError=K;let nt=L._writer;nt!==void 0&&jt(nt,K),!la(L)&&we._started&&nr(L)}function nr(L){L._state="errored",L._writableStreamController[w]();let K=L._storedError;if(L._writeRequests.forEach(Et=>{Et._reject(K)}),L._writeRequests=new I,L._pendingAbortRequest===void 0){zI(L);return}let we=L._pendingAbortRequest;if(L._pendingAbortRequest=void 0,we._wasAlreadyErroring){we._reject(K),zI(L);return}let nt=L._writableStreamController[x](we._reason);h(nt,()=>(we._resolve(),zI(L),null),Et=>(we._reject(Et),zI(L),null))}function Nn(L){L._inFlightWriteRequest._resolve(void 0),L._inFlightWriteRequest=void 0}function Dr(L,K){L._inFlightWriteRequest._reject(K),L._inFlightWriteRequest=void 0,Tt(L,K)}function ji(L){L._inFlightCloseRequest._resolve(void 0),L._inFlightCloseRequest=void 0,L._state==="erroring"&&(L._storedError=void 0,L._pendingAbortRequest!==void 0&&(L._pendingAbortRequest._resolve(),L._pendingAbortRequest=void 0)),L._state="closed";let we=L._writer;we!==void 0&&Bre(we)}function No(L,K){L._inFlightCloseRequest._reject(K),L._inFlightCloseRequest=void 0,L._pendingAbortRequest!==void 0&&(L._pendingAbortRequest._reject(K),L._pendingAbortRequest=void 0),Tt(L,K)}function Pr(L){return!(L._closeRequest===void 0&&L._inFlightCloseRequest===void 0)}function la(L){return!(L._inFlightWriteRequest===void 0&&L._inFlightCloseRequest===void 0)}function ph(L){L._inFlightCloseRequest=L._closeRequest,L._closeRequest=void 0}function KI(L){L._inFlightWriteRequest=L._writeRequests.shift()}function zI(L){L._closeRequest!==void 0&&(L._closeRequest._reject(L._storedError),L._closeRequest=void 0);let K=L._writer;K!==void 0&&fQ(K,L._storedError)}function k(L,K){let we=L._writer;we!==void 0&&K!==L._backpressure&&(K?xRe(we):gQ(we)),L._backpressure=K}class W{constructor(K){if(te(K,1,"WritableStreamDefaultWriter"),Su(K,"First parameter"),ve(K))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=K,K._writer=this;let we=K._state;if(we==="writable")!Pr(K)&&K._backpressure?cv(this):vb(this),_1(this);else if(we==="erroring")id(this,K._storedError),_1(this);else if(we==="closed")vb(this),Dre(this);else{let nt=K._storedError;id(this,nt),Nre(this,nt)}}get closed(){return pe(this)?this._closedPromise:l(Rg("closed"))}get desiredSize(){if(!pe(this))throw Rg("desiredSize");if(this._ownerWritableStream===void 0)throw b1("desiredSize");return Fn(this)}get ready(){return pe(this)?this._readyPromise:l(Rg("ready"))}abort(K=void 0){return pe(this)?this._ownerWritableStream===void 0?l(b1("abort")):Ce(this,K):l(Rg("abort"))}close(){if(!pe(this))return l(Rg("close"));let K=this._ownerWritableStream;return K===void 0?l(b1("close")):Pr(K)?l(new TypeError("Cannot close an already-closing stream")):qe(this)}releaseLock(){if(!pe(this))throw Rg("releaseLock");this._ownerWritableStream!==void 0&&fr(this)}write(K=void 0){return pe(this)?this._ownerWritableStream===void 0?l(b1("write to")):Fr(this,K):l(Rg("write"))}}Object.defineProperties(W.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),s(W.prototype.abort,"abort"),s(W.prototype.close,"close"),s(W.prototype.releaseLock,"releaseLock"),s(W.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(W.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function pe(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_ownerWritableStream")?!1:L instanceof W}function Ce(L,K){let we=L._ownerWritableStream;return Le(we,K)}function qe(L){let K=L._ownerWritableStream;return Ke(K)}function ft(L){let K=L._ownerWritableStream,we=K._state;return Pr(K)||we==="closed"?u(void 0):we==="errored"?l(K._storedError):qe(L)}function vt(L,K){L._closedPromiseState==="pending"?fQ(L,K):IRe(L,K)}function jt(L,K){L._readyPromiseState==="pending"?S1(L,K):fj(L,K)}function Fn(L){let K=L._ownerWritableStream,we=K._state;return we==="errored"||we==="erroring"?null:we==="closed"?0:Yi(K._writableStreamController)}function fr(L){let K=L._ownerWritableStream,we=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");jt(L,we),vt(L,we),K._writer=void 0,L._ownerWritableStream=void 0}function Fr(L,K){let we=L._ownerWritableStream,nt=we._writableStreamController,Et=Sr(nt,K);if(we!==L._ownerWritableStream)return l(b1("write to"));let Kt=we._state;if(Kt==="errored")return l(we._storedError);if(Pr(we)||Kt==="closed")return l(new TypeError("The stream is closing or closed and cannot be written to"));if(Kt==="erroring")return l(we._storedError);let an=Ye(we);return _o(nt,K,Et),an}let ki={};class uo{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!vc(this))throw av("abortReason");return this._abortReason}get signal(){if(!vc(this))throw av("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(K=void 0){if(!vc(this))throw av("error");this._controlledWritableStream._state==="writable"&&gf(this,K)}[x](K){let we=this._abortAlgorithm(K);return kd(this),we}[w](){wt(this)}}Object.defineProperties(uo.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(uo.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function vc(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_controlledWritableStream")?!1:L instanceof uo}function ff(L,K,we,nt,Et,Kt,an,rr){K._controlledWritableStream=L,L._writableStreamController=K,K._queue=void 0,K._queueTotalSize=void 0,wt(K),K._abortReason=void 0,K._abortController=De(),K._started=!1,K._strategySizeAlgorithm=rr,K._strategyHWM=an,K._writeAlgorithm=nt,K._closeAlgorithm=Et,K._abortAlgorithm=Kt;let Qs=Iu(K);k(L,Qs);let Xr=we(),di=u(Xr);h(di,()=>(K._started=!0,Cu(K),null),Ni=>(K._started=!0,Tt(L,Ni),null))}function om(L,K,we,nt){let Et=Object.create(uo.prototype),Kt,an,rr,Qs;K.start!==void 0?Kt=()=>K.start(Et):Kt=()=>{},K.write!==void 0?an=Xr=>K.write(Xr,Et):an=()=>u(void 0),K.close!==void 0?rr=()=>K.close():rr=()=>u(void 0),K.abort!==void 0?Qs=Xr=>K.abort(Xr):Qs=()=>u(void 0),ff(L,Et,Kt,an,rr,Qs,we,nt)}function kd(L){L._writeAlgorithm=void 0,L._closeAlgorithm=void 0,L._abortAlgorithm=void 0,L._strategySizeAlgorithm=void 0}function Sp(L){ct(L,ki,0),Cu(L)}function Sr(L,K){try{return L._strategySizeAlgorithm(K)}catch(we){return Rc(L,we),1}}function Yi(L){return L._strategyHWM-L._queueTotalSize}function _o(L,K,we){try{ct(L,K,we)}catch(Et){Rc(L,Et);return}let nt=L._controlledWritableStream;if(!Pr(nt)&&nt._state==="writable"){let Et=Iu(L);k(nt,Et)}Cu(L)}function Cu(L){let K=L._controlledWritableStream;if(!L._started||K._inFlightWriteRequest!==void 0)return;if(K._state==="erroring"){nr(K);return}if(L._queue.length===0)return;let nt=Ge(L);nt===ki?ov(L):vg(L,nt)}function Rc(L,K){L._controlledWritableStream._state==="writable"&&gf(L,K)}function ov(L){let K=L._controlledWritableStream;ph(K),$e(L);let we=L._closeAlgorithm();kd(L),h(we,()=>(ji(K),null),nt=>(No(K,nt),null))}function vg(L,K){let we=L._controlledWritableStream;KI(we);let nt=L._writeAlgorithm(K);h(nt,()=>{Nn(we);let Et=we._state;if($e(L),!Pr(we)&&Et==="writable"){let Kt=Iu(L);k(we,Kt)}return Cu(L),null},Et=>(we._state==="writable"&&kd(L),Dr(we,Et),null))}function Iu(L){return Yi(L)<=0}function gf(L,K){let we=L._controlledWritableStream;kd(L),on(we,K)}function Nd(L){return new TypeError(`WritableStream.prototype.${L} can only be used on a WritableStream`)}function av(L){return new TypeError(`WritableStreamDefaultController.prototype.${L} can only be used on a WritableStreamDefaultController`)}function Rg(L){return new TypeError(`WritableStreamDefaultWriter.prototype.${L} can only be used on a WritableStreamDefaultWriter`)}function b1(L){return new TypeError("Cannot "+L+" a stream using a released writer")}function _1(L){L._closedPromise=c((K,we)=>{L._closedPromise_resolve=K,L._closedPromise_reject=we,L._closedPromiseState="pending"})}function Nre(L,K){_1(L),fQ(L,K)}function Dre(L){_1(L),Bre(L)}function fQ(L,K){L._closedPromise_reject!==void 0&&(A(L._closedPromise),L._closedPromise_reject(K),L._closedPromise_resolve=void 0,L._closedPromise_reject=void 0,L._closedPromiseState="rejected")}function IRe(L,K){Nre(L,K)}function Bre(L){L._closedPromise_resolve!==void 0&&(L._closedPromise_resolve(void 0),L._closedPromise_resolve=void 0,L._closedPromise_reject=void 0,L._closedPromiseState="resolved")}function cv(L){L._readyPromise=c((K,we)=>{L._readyPromise_resolve=K,L._readyPromise_reject=we}),L._readyPromiseState="pending"}function id(L,K){cv(L),S1(L,K)}function vb(L){cv(L),gQ(L)}function S1(L,K){L._readyPromise_reject!==void 0&&(A(L._readyPromise),L._readyPromise_reject(K),L._readyPromise_resolve=void 0,L._readyPromise_reject=void 0,L._readyPromiseState="rejected")}function xRe(L){cv(L)}function fj(L,K){id(L,K)}function gQ(L){L._readyPromise_resolve!==void 0&&(L._readyPromise_resolve(void 0),L._readyPromise_resolve=void 0,L._readyPromise_reject=void 0,L._readyPromiseState="fulfilled")}function wRe(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}let AQ=wRe();function gj(L){if(!(typeof L=="function"||typeof L=="object")||L.name!=="DOMException")return!1;try{return new L,!0}catch{return!1}}function but(){let L=AQ?.DOMException;return gj(L)?L:void 0}function TRe(){let L=function(we,nt){this.message=we||"",this.name=nt||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return s(L,"DOMException"),L.prototype=Object.create(Error.prototype),Object.defineProperty(L.prototype,"constructor",{value:L,writable:!0,configurable:!0}),L}let _ut=but()||TRe();function Aj(L,K,we,nt,Et,Kt){let an=ye(L),rr=v(K);L._disturbed=!0;let Qs=!1,Xr=u(void 0);return c((di,Ni)=>{let wa;if(Kt!==void 0){if(wa=()=>{let ds=Kt.reason!==void 0?Kt.reason:new _ut("Aborted","AbortError"),ro=[];nt||ro.push(()=>K._state==="writable"?Le(K,ds):u(void 0)),Et||ro.push(()=>L._state==="readable"?am(L,ds):u(void 0)),Af(()=>Promise.all(ro.map(Ga=>Ga())),!0,ds)},Kt.aborted){wa();return}Kt.addEventListener("abort",wa)}function Db(){return c((ds,ro)=>{function Ga(Dg){Dg?ds():d(CQ(),Ga,ro)}Ga(!1)})}function CQ(){return Qs?u(!0):d(rr._readyPromise,()=>c((ds,ro)=>{He(an,{_chunkSteps:Ga=>{Xr=d(Fr(rr,Ga),void 0,e),ds(!1)},_closeSteps:()=>ds(!0),_errorSteps:ro})}))}if(tx(L,an._closedPromise,ds=>(nt?Ny(!0,ds):Af(()=>Le(K,ds),!0,ds),null)),tx(K,rr._closedPromise,ds=>(Et?Ny(!0,ds):Af(()=>am(L,ds),!0,ds),null)),cm(L,an._closedPromise,()=>(we?Ny():Af(()=>ft(rr)),null)),Pr(K)||K._state==="closed"){let ds=new TypeError("the destination writable stream closed before all data could be piped to it");Et?Ny(!0,ds):Af(()=>am(L,ds),!0,ds)}A(Db());function mv(){let ds=Xr;return d(Xr,()=>ds!==Xr?mv():void 0)}function tx(ds,ro,Ga){ds._state==="errored"?Ga(ds._storedError):f(ro,Ga)}function cm(ds,ro,Ga){ds._state==="closed"?Ga():m(ro,Ga)}function Af(ds,ro,Ga){if(Qs)return;Qs=!0,K._state==="writable"&&!Pr(K)?m(mv(),Dg):Dg();function Dg(){return h(ds(),()=>nx(ro,Ga),IQ=>nx(!0,IQ)),null}}function Ny(ds,ro){Qs||(Qs=!0,K._state==="writable"&&!Pr(K)?m(mv(),()=>nx(ds,ro)):nx(ds,ro))}function nx(ds,ro){return fr(rr),Q(an),Kt!==void 0&&Kt.removeEventListener("abort",wa),ds?Ni(ro):di(void 0),null}})}class Rb{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!yQ(this))throw bQ("desiredSize");return Zs(this)}close(){if(!yQ(this))throw bQ("close");if(!Ng(this))throw new TypeError("The stream is not in a state that permits close");JI(this)}enqueue(K=void 0){if(!yQ(this))throw bQ("enqueue");if(!Ng(this))throw new TypeError("The stream is not in a state that permits enqueue");return lv(this,K)}error(K=void 0){if(!yQ(this))throw bQ("error");kg(this,K)}[R](K){wt(this);let we=this._cancelAlgorithm(K);return EQ(this),we}[N](K){let we=this._controlledReadableStream;if(this._queue.length>0){let nt=$e(this);this._closeRequested&&this._queue.length===0?(EQ(this),ZI(we)):C1(this),K._chunkSteps(nt)}else Ie(we,K),C1(this)}[P](){}}Object.defineProperties(Rb.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),s(Rb.prototype.close,"close"),s(Rb.prototype.enqueue,"enqueue"),s(Rb.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rb.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function yQ(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_controlledReadableStream")?!1:L instanceof Rb}function C1(L){if(!Pre(L))return;if(L._pulling){L._pullAgain=!0;return}L._pulling=!0;let we=L._pullAlgorithm();h(we,()=>(L._pulling=!1,L._pullAgain&&(L._pullAgain=!1,C1(L)),null),nt=>(kg(L,nt),null))}function Pre(L){let K=L._controlledReadableStream;return!Ng(L)||!L._started?!1:!!(J0(K)&&Te(K)>0||Zs(L)>0)}function EQ(L){L._pullAlgorithm=void 0,L._cancelAlgorithm=void 0,L._strategySizeAlgorithm=void 0}function JI(L){if(!Ng(L))return;let K=L._controlledReadableStream;L._closeRequested=!0,L._queue.length===0&&(EQ(L),ZI(K))}function lv(L,K){if(!Ng(L))return;let we=L._controlledReadableStream;if(J0(we)&&Te(we)>0)Ee(we,K,!1);else{let nt;try{nt=L._strategySizeAlgorithm(K)}catch(Et){throw kg(L,Et),Et}try{ct(L,K,nt)}catch(Et){throw kg(L,Et),Et}}C1(L)}function kg(L,K){let we=L._controlledReadableStream;we._state==="readable"&&(wt(L),EQ(L),qre(we,K))}function Zs(L){let K=L._controlledReadableStream._state;return K==="errored"?null:K==="closed"?0:L._strategyHWM-L._queueTotalSize}function Ore(L){return!Pre(L)}function Ng(L){let K=L._controlledReadableStream._state;return!L._closeRequested&&K==="readable"}function I1(L,K,we,nt,Et,Kt,an){K._controlledReadableStream=L,K._queue=void 0,K._queueTotalSize=void 0,wt(K),K._started=!1,K._closeRequested=!1,K._pullAgain=!1,K._pulling=!1,K._strategySizeAlgorithm=an,K._strategyHWM=Kt,K._pullAlgorithm=nt,K._cancelAlgorithm=Et,L._readableStreamController=K;let rr=we();h(u(rr),()=>(K._started=!0,C1(K),null),Qs=>(kg(K,Qs),null))}function Mre(L,K,we,nt){let Et=Object.create(Rb.prototype),Kt,an,rr;K.start!==void 0?Kt=()=>K.start(Et):Kt=()=>{},K.pull!==void 0?an=()=>K.pull(Et):an=()=>u(void 0),K.cancel!==void 0?rr=Qs=>K.cancel(Qs):rr=()=>u(void 0),I1(L,Et,Kt,an,rr,we,nt)}function bQ(L){return new TypeError(`ReadableStreamDefaultController.prototype.${L} can only be used on a ReadableStreamDefaultController`)}function vRe(L,K){return tr(L._readableStreamController)?Fre(L):Lre(L)}function Lre(L,K){let we=ye(L),nt=!1,Et=!1,Kt=!1,an=!1,rr,Qs,Xr,di,Ni,wa=c(cm=>{Ni=cm});function Db(){return nt?(Et=!0,u(void 0)):(nt=!0,He(we,{_chunkSteps:Af=>{y(()=>{Et=!1;let Ny=Af,nx=Af;Kt||lv(Xr._readableStreamController,Ny),an||lv(di._readableStreamController,nx),nt=!1,Et&&Db()})},_closeSteps:()=>{nt=!1,Kt||JI(Xr._readableStreamController),an||JI(di._readableStreamController),(!Kt||!an)&&Ni(void 0)},_errorSteps:()=>{nt=!1}}),u(void 0))}function CQ(cm){if(Kt=!0,rr=cm,an){let Af=Vt([rr,Qs]),Ny=am(L,Af);Ni(Ny)}return wa}function mv(cm){if(an=!0,Qs=cm,Kt){let Af=Vt([rr,Qs]),Ny=am(L,Af);Ni(Ny)}return wa}function tx(){}return Xr=Y0(tx,Db,CQ),di=Y0(tx,Db,mv),f(we._closedPromise,cm=>(kg(Xr._readableStreamController,cm),kg(di._readableStreamController,cm),(!Kt||!an)&&Ni(void 0),null)),[Xr,di]}function Fre(L){let K=ye(L),we=!1,nt=!1,Et=!1,Kt=!1,an=!1,rr,Qs,Xr,di,Ni,wa=c(ds=>{Ni=ds});function Db(ds){f(ds._closedPromise,ro=>(ds!==K||(ar(Xr._readableStreamController,ro),ar(di._readableStreamController,ro),(!Kt||!an)&&Ni(void 0)),null))}function CQ(){_p(K)&&(Q(K),K=ye(L),Db(K)),He(K,{_chunkSteps:ro=>{y(()=>{nt=!1,Et=!1;let Ga=ro,Dg=ro;if(!Kt&&!an)try{Dg=Ne(ro)}catch(IQ){ar(Xr._readableStreamController,IQ),ar(di._readableStreamController,IQ),Ni(am(L,IQ));return}Kt||$n(Xr._readableStreamController,Ga),an||$n(di._readableStreamController,Dg),we=!1,nt?tx():Et&&cm()})},_closeSteps:()=>{we=!1,Kt||Dn(Xr._readableStreamController),an||Dn(di._readableStreamController),Xr._readableStreamController._pendingPullIntos.length>0&&ys(Xr._readableStreamController,0),di._readableStreamController._pendingPullIntos.length>0&&ys(di._readableStreamController,0),(!Kt||!an)&&Ni(void 0)},_errorSteps:()=>{we=!1}})}function mv(ds,ro){We(K)&&(Q(K),K=vd(L),Db(K));let Ga=ro?di:Xr,Dg=ro?Xr:di;wb(K,ds,1,{_chunkSteps:xQ=>{y(()=>{nt=!1,Et=!1;let wQ=ro?an:Kt;if(ro?Kt:an)wQ||pn(Ga._readableStreamController,xQ);else{let Iut;try{Iut=Ne(xQ)}catch(NRe){ar(Ga._readableStreamController,NRe),ar(Dg._readableStreamController,NRe),Ni(am(L,NRe));return}wQ||pn(Ga._readableStreamController,xQ),$n(Dg._readableStreamController,Iut)}we=!1,nt?tx():Et&&cm()})},_closeSteps:xQ=>{we=!1;let wQ=ro?an:Kt,Jre=ro?Kt:an;wQ||Dn(Ga._readableStreamController),Jre||Dn(Dg._readableStreamController),xQ!==void 0&&(wQ||pn(Ga._readableStreamController,xQ),!Jre&&Dg._readableStreamController._pendingPullIntos.length>0&&ys(Dg._readableStreamController,0)),(!wQ||!Jre)&&Ni(void 0)},_errorSteps:()=>{we=!1}})}function tx(){if(we)return nt=!0,u(void 0);we=!0;let ds=_r(Xr._readableStreamController);return ds===null?CQ():mv(ds._view,!1),u(void 0)}function cm(){if(we)return Et=!0,u(void 0);we=!0;let ds=_r(di._readableStreamController);return ds===null?CQ():mv(ds._view,!0),u(void 0)}function Af(ds){if(Kt=!0,rr=ds,an){let ro=Vt([rr,Qs]),Ga=am(L,ro);Ni(Ga)}return wa}function Ny(ds){if(an=!0,Qs=ds,Kt){let ro=Vt([rr,Qs]),Ga=am(L,ro);Ni(Ga)}return wa}function nx(){}return Xr=K0(nx,tx,Af),di=K0(nx,cm,Ny),Db(K),[Xr,di]}function Qre(L){return n(L)&&typeof L.getReader<"u"}function kc(L){return Qre(L)?uv(L.getReader()):kb(L)}function kb(L){let K,we=ut(L,"async"),nt=e;function Et(){let an;try{an=mt(we)}catch(Qs){return l(Qs)}let rr=u(an);return g(rr,Qs=>{if(!n(Qs))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(tt(Qs))JI(K._readableStreamController);else{let di=Dt(Qs);lv(K._readableStreamController,di)}})}function Kt(an){let rr=we.iterator,Qs;try{Qs=pt(rr,"return")}catch(Ni){return l(Ni)}if(Qs===void 0)return u(void 0);let Xr;try{Xr=b(Qs,rr,[an])}catch(Ni){return l(Ni)}let di=u(Xr);return g(di,Ni=>{if(!n(Ni))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return K=Y0(nt,Et,Kt,0),K}function uv(L){let K,we=e;function nt(){let Kt;try{Kt=L.read()}catch(an){return l(an)}return g(Kt,an=>{if(!n(an))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(an.done)JI(K._readableStreamController);else{let rr=an.value;lv(K._readableStreamController,rr)}})}function Et(Kt){try{return u(L.cancel(Kt))}catch(an){return l(an)}}return K=Y0(we,nt,Et,0),K}function Ry(L,K){se(L,K);let we=L,nt=we?.autoAllocateChunkSize,Et=we?.cancel,Kt=we?.pull,an=we?.start,rr=we?.type;return{autoAllocateChunkSize:nt===void 0?void 0:Ae(nt,`${K} has member 'autoAllocateChunkSize' that`),cancel:Et===void 0?void 0:XI(Et,we,`${K} has member 'cancel' that`),pull:Kt===void 0?void 0:Ure(Kt,we,`${K} has member 'pull' that`),start:an===void 0?void 0:$re(an,we,`${K} has member 'start' that`),type:rr===void 0?void 0:dv(rr,`${K} has member 'type' that`)}}function XI(L,K,we){return ie(L,we),nt=>S(L,K,[nt])}function Ure(L,K,we){return ie(L,we),nt=>S(L,K,[nt])}function $re(L,K,we){return ie(L,we),nt=>b(L,K,[nt])}function dv(L,K){if(L=`${L}`,L!=="bytes")throw new TypeError(`${K} '${L}' is not a valid enumeration value for ReadableStreamType`);return L}function yj(L,K){return se(L,K),{preventCancel:!!L?.preventCancel}}function Gre(L,K){se(L,K);let we=L?.preventAbort,nt=L?.preventCancel,Et=L?.preventClose,Kt=L?.signal;return Kt!==void 0&&Wre(Kt,`${K} has member 'signal' that`),{preventAbort:!!we,preventCancel:!!nt,preventClose:!!Et,signal:Kt}}function Wre(L,K){if(!Tg(L))throw new TypeError(`${K} is not an AbortSignal.`)}function RRe(L,K){se(L,K);let we=L?.readable;j(we,"readable","ReadableWritablePair"),ue(we,`${K} has member 'readable' that`);let nt=L?.writable;return j(nt,"writable","ReadableWritablePair"),Su(nt,`${K} has member 'writable' that`),{readable:we,writable:nt}}class Dd{constructor(K={},we={}){K===void 0?K=null:J(K,"First parameter");let nt=im(we,"Second parameter"),Et=Ry(K,"First parameter");if(Ej(this),Et.type==="bytes"){if(nt.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let Kt=sd(nt,0);kr(this,Et,Kt)}else{let Kt=uc(nt),an=sd(nt,1);Mre(this,Et,an,Kt)}}get locked(){if(!z0(this))throw X0("locked");return J0(this)}cancel(K=void 0){return z0(this)?J0(this)?l(new TypeError("Cannot cancel a stream that already has a reader")):am(this,K):l(X0("cancel"))}getReader(K=void 0){if(!z0(this))throw X0("getReader");return Nr(K,"First parameter").mode===void 0?ye(this):vd(this)}pipeThrough(K,we={}){if(!z0(this))throw X0("pipeThrough");te(K,1,"pipeThrough");let nt=RRe(K,"First parameter"),Et=Gre(we,"Second parameter");if(J0(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(ve(nt.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let Kt=Aj(this,nt.writable,Et.preventClose,Et.preventAbort,Et.preventCancel,Et.signal);return A(Kt),nt.readable}pipeTo(K,we={}){if(!z0(this))return l(X0("pipeTo"));if(K===void 0)return l("Parameter 1 is required in 'pipeTo'.");if(!le(K))return l(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let nt;try{nt=Gre(we,"Second parameter")}catch(Et){return l(Et)}return J0(this)?l(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):ve(K)?l(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Aj(this,K,nt.preventClose,nt.preventAbort,nt.preventCancel,nt.signal)}tee(){if(!z0(this))throw X0("tee");let K=vRe(this);return Vt(K)}values(K=void 0){if(!z0(this))throw X0("values");let we=yj(K,"First parameter");return Mt(this,we.preventCancel)}[et](K){return this.values(K)}static from(K){return kc(K)}}Object.defineProperties(Dd,{from:{enumerable:!0}}),Object.defineProperties(Dd.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),s(Dd.from,"from"),s(Dd.prototype.cancel,"cancel"),s(Dd.prototype.getReader,"getReader"),s(Dd.prototype.pipeThrough,"pipeThrough"),s(Dd.prototype.pipeTo,"pipeTo"),s(Dd.prototype.tee,"tee"),s(Dd.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Dd.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Dd.prototype,et,{value:Dd.prototype.values,writable:!0,configurable:!0});function Y0(L,K,we,nt=1,Et=()=>1){let Kt=Object.create(Dd.prototype);Ej(Kt);let an=Object.create(Rb.prototype);return I1(Kt,an,L,K,we,nt,Et),Kt}function K0(L,K,we){let nt=Object.create(Dd.prototype);Ej(nt);let Et=Object.create(bn.prototype);return Ri(nt,Et,L,K,we,0,void 0),nt}function Ej(L){L._state="readable",L._reader=void 0,L._storedError=void 0,L._disturbed=!1}function z0(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_readableStreamController")?!1:L instanceof Dd}function J0(L){return L._reader!==void 0}function am(L,K){if(L._disturbed=!0,L._state==="closed")return u(void 0);if(L._state==="errored")return l(L._storedError);ZI(L);let we=L._reader;if(we!==void 0&&_p(we)){let Et=we._readIntoRequests;we._readIntoRequests=new I,Et.forEach(Kt=>{Kt._closeSteps(void 0)})}let nt=L._readableStreamController[R](K);return g(nt,e)}function ZI(L){L._state="closed";let K=L._reader;if(K!==void 0&&(be(K),We(K))){let we=K._readRequests;K._readRequests=new I,we.forEach(nt=>{nt._closeSteps()})}}function qre(L,K){L._state="errored",L._storedError=K;let we=L._reader;we!==void 0&&(q(we,K),We(we)?it(we,K):Cl(we,K))}function X0(L){return new TypeError(`ReadableStream.prototype.${L} can only be used on a ReadableStream`)}function T(L,K){se(L,K);let we=L?.highWaterMark;return j(we,"highWaterMark","QueuingStrategyInit"),{highWaterMark:X(we)}}let M=L=>L.byteLength;s(M,"size");class Y{constructor(K){te(K,1,"ByteLengthQueuingStrategy"),K=T(K,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=K.highWaterMark}get highWaterMark(){if(!ke(this))throw de("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!ke(this))throw de("size");return M}}Object.defineProperties(Y.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Y.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function de(L){return new TypeError(`ByteLengthQueuingStrategy.prototype.${L} can only be used on a ByteLengthQueuingStrategy`)}function ke(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_byteLengthQueuingStrategyHighWaterMark")?!1:L instanceof Y}let je=()=>1;s(je,"size");class Je{constructor(K){te(K,1,"CountQueuingStrategy"),K=T(K,"First parameter"),this._countQueuingStrategyHighWaterMark=K.highWaterMark}get highWaterMark(){if(!Qt(this))throw ot("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Qt(this))throw ot("size");return je}}Object.defineProperties(Je.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Je.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function ot(L){return new TypeError(`CountQueuingStrategy.prototype.${L} can only be used on a CountQueuingStrategy`)}function Qt(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_countQueuingStrategyHighWaterMark")?!1:L instanceof Je}function cn(L,K){se(L,K);let we=L?.cancel,nt=L?.flush,Et=L?.readableType,Kt=L?.start,an=L?.transform,rr=L?.writableType;return{cancel:we===void 0?void 0:Zr(we,L,`${K} has member 'cancel' that`),flush:nt===void 0?void 0:rn(nt,L,`${K} has member 'flush' that`),readableType:Et,start:Kt===void 0?void 0:Bn(Kt,L,`${K} has member 'start' that`),transform:an===void 0?void 0:Cn(an,L,`${K} has member 'transform' that`),writableType:rr}}function rn(L,K,we){return ie(L,we),nt=>S(L,K,[nt])}function Bn(L,K,we){return ie(L,we),nt=>b(L,K,[nt])}function Cn(L,K,we){return ie(L,we),(nt,Et)=>S(L,K,[nt,Et])}function Zr(L,K,we){return ie(L,we),nt=>S(L,K,[nt])}class Gi{constructor(K={},we={},nt={}){K===void 0&&(K=null);let Et=im(we,"Second parameter"),Kt=im(nt,"Third parameter"),an=cn(K,"First parameter");if(an.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(an.writableType!==void 0)throw new RangeError("Invalid writableType specified");let rr=sd(Kt,0),Qs=uc(Kt),Xr=sd(Et,1),di=uc(Et),Ni,wa=c(Db=>{Ni=Db});su(this,wa,Xr,di,rr,Qs),Hre(this,an),an.start!==void 0?Ni(an.start(this._transformStreamController)):Ni(void 0)}get readable(){if(!ui(this))throw Cut("readable");return this._readable}get writable(){if(!ui(this))throw Cut("writable");return this._writable}}Object.defineProperties(Gi.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Gi.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function su(L,K,we,nt,Et,Kt){function an(){return K}function rr(wa){return hv(L,wa)}function Qs(wa){return jre(L,wa)}function Xr(){return Yre(L)}L._writable=B(an,rr,Xr,Qs,we,nt);function di(){return Kre(L)}function Ni(wa){return IVn(L,wa)}L._readable=Y0(an,di,Ni,Et,Kt),L._backpressure=void 0,L._backpressureChangePromise=void 0,L._backpressureChangePromise_resolve=void 0,pv(L,!0),L._transformStreamController=void 0}function ui(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_transformStreamController")?!1:L instanceof Gi}function no(L,K){kg(L._readable._readableStreamController,K),Fs(L,K)}function Fs(L,K){x1(L._transformStreamController),Rc(L._writable._writableStreamController,K),Nb(L)}function Nb(L){L._backpressure&&pv(L,!1)}function pv(L,K){L._backpressureChangePromise!==void 0&&L._backpressureChangePromise_resolve(),L._backpressureChangePromise=c(we=>{L._backpressureChangePromise_resolve=we}),L._backpressure=K}class ky{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ex(this))throw zre("desiredSize");let K=this._controlledTransformStream._readable._readableStreamController;return Zs(K)}enqueue(K=void 0){if(!ex(this))throw zre("enqueue");Vre(this,K)}error(K=void 0){if(!ex(this))throw zre("error");w1(this,K)}terminate(){if(!ex(this))throw zre("terminate");Sut(this)}}Object.defineProperties(ky.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),s(ky.prototype.enqueue,"enqueue"),s(ky.prototype.error,"error"),s(ky.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ky.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ex(L){return!n(L)||!Object.prototype.hasOwnProperty.call(L,"_controlledTransformStream")?!1:L instanceof ky}function _Q(L,K,we,nt,Et){K._controlledTransformStream=L,L._transformStreamController=K,K._transformAlgorithm=we,K._flushAlgorithm=nt,K._cancelAlgorithm=Et,K._finishPromise=void 0,K._finishPromise_resolve=void 0,K._finishPromise_reject=void 0}function Hre(L,K){let we=Object.create(ky.prototype),nt,Et,Kt;K.transform!==void 0?nt=an=>K.transform(an,we):nt=an=>{try{return Vre(we,an),u(void 0)}catch(rr){return l(rr)}},K.flush!==void 0?Et=()=>K.flush(we):Et=()=>u(void 0),K.cancel!==void 0?Kt=an=>K.cancel(an):Kt=()=>u(void 0),_Q(L,we,nt,Et,Kt)}function x1(L){L._transformAlgorithm=void 0,L._flushAlgorithm=void 0,L._cancelAlgorithm=void 0}function Vre(L,K){let we=L._controlledTransformStream,nt=we._readable._readableStreamController;if(!Ng(nt))throw new TypeError("Readable side is not in a state that permits enqueue");try{lv(nt,K)}catch(Kt){throw Fs(we,Kt),we._readable._storedError}Ore(nt)!==we._backpressure&&pv(we,!0)}function w1(L,K){no(L._controlledTransformStream,K)}function bj(L,K){let we=L._transformAlgorithm(K);return g(we,void 0,nt=>{throw no(L._controlledTransformStream,nt),nt})}function Sut(L){let K=L._controlledTransformStream,we=K._readable._readableStreamController;JI(we);let nt=new TypeError("TransformStream terminated");Fs(K,nt)}function hv(L,K){let we=L._transformStreamController;if(L._backpressure){let nt=L._backpressureChangePromise;return g(nt,()=>{let Et=L._writable;if(Et._state==="erroring")throw Et._storedError;return bj(we,K)})}return bj(we,K)}function jre(L,K){let we=L._transformStreamController;if(we._finishPromise!==void 0)return we._finishPromise;let nt=L._readable;we._finishPromise=c((Kt,an)=>{we._finishPromise_resolve=Kt,we._finishPromise_reject=an});let Et=we._cancelAlgorithm(K);return x1(we),h(Et,()=>(nt._state==="errored"?SQ(we,nt._storedError):(kg(nt._readableStreamController,K),kRe(we)),null),Kt=>(kg(nt._readableStreamController,Kt),SQ(we,Kt),null)),we._finishPromise}function Yre(L){let K=L._transformStreamController;if(K._finishPromise!==void 0)return K._finishPromise;let we=L._readable;K._finishPromise=c((Et,Kt)=>{K._finishPromise_resolve=Et,K._finishPromise_reject=Kt});let nt=K._flushAlgorithm();return x1(K),h(nt,()=>(we._state==="errored"?SQ(K,we._storedError):(JI(we._readableStreamController),kRe(K)),null),Et=>(kg(we._readableStreamController,Et),SQ(K,Et),null)),K._finishPromise}function Kre(L){return pv(L,!1),L._backpressureChangePromise}function IVn(L,K){let we=L._transformStreamController;if(we._finishPromise!==void 0)return we._finishPromise;let nt=L._writable;we._finishPromise=c((Kt,an)=>{we._finishPromise_resolve=Kt,we._finishPromise_reject=an});let Et=we._cancelAlgorithm(K);return x1(we),h(Et,()=>(nt._state==="errored"?SQ(we,nt._storedError):(Rc(nt._writableStreamController,K),Nb(L),kRe(we)),null),Kt=>(Rc(nt._writableStreamController,Kt),Nb(L),SQ(we,Kt),null)),we._finishPromise}function zre(L){return new TypeError(`TransformStreamDefaultController.prototype.${L} can only be used on a TransformStreamDefaultController`)}function kRe(L){L._finishPromise_resolve!==void 0&&(L._finishPromise_resolve(),L._finishPromise_resolve=void 0,L._finishPromise_reject=void 0)}function SQ(L,K){L._finishPromise_reject!==void 0&&(A(L._finishPromise),L._finishPromise_reject(K),L._finishPromise_resolve=void 0,L._finishPromise_reject=void 0)}function Cut(L){return new TypeError(`TransformStream.prototype.${L} can only be used on a TransformStream`)}t.ByteLengthQueuingStrategy=Y,t.CountQueuingStrategy=Je,t.ReadableByteStreamController=bn,t.ReadableStream=Dd,t.ReadableStreamBYOBReader=Rd,t.ReadableStreamBYOBRequest=fn,t.ReadableStreamDefaultController=Rb,t.ReadableStreamDefaultReader=z,t.TransformStream=Gi,t.TransformStreamDefaultController=ky,t.WritableStream=E,t.WritableStreamDefaultController=uo,t.WritableStreamDefaultWriter=W}))});var S2t=ee(()=>{p();if(!globalThis.ReadableStream)try{let t=require("node:process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),t.emitWarning=e}catch(n){throw t.emitWarning=e,n}}catch{Object.assign(globalThis,_2t())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=function(n){let r=0,s=this;return new ReadableStream({type:"bytes",async pull(i){let a=await s.slice(r,Math.min(s.size,r+65536)).arrayBuffer();r+=a.byteLength,i.enqueue(new Uint8Array(a)),r===s.size&&i.close()}})})}catch{}});async function*Hqe(t,e=!0){for(let n of t)if("stream"in n)yield*n.stream();else if(ArrayBuffer.isView(n))if(e){let r=n.byteOffset,s=n.byteOffset+n.byteLength;for(;r!==s;){let i=Math.min(s-r,C2t),o=n.buffer.slice(r,r+i);r+=o.byteLength,yield new Uint8Array(o)}}else yield n;else{let r=0,s=n;for(;r!==s.size;){let o=await s.slice(r,Math.min(s.size,r+C2t)).arrayBuffer();r+=o.byteLength,yield new Uint8Array(o)}}}var iro,C2t,I2t,xRr,x_,SK=V(()=>{p();iro=Gt(S2t(),1);C2t=65536;I2t=class Vqe{#e=[];#t="";#n=0;#r="transparent";constructor(e=[],n={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof n!="object"&&typeof n!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");n===null&&(n={});let r=new TextEncoder;for(let i of e){let o;ArrayBuffer.isView(i)?o=new Uint8Array(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)):i instanceof ArrayBuffer?o=new Uint8Array(i.slice(0)):i instanceof Vqe?o=i:o=r.encode(`${i}`),this.#n+=ArrayBuffer.isView(o)?o.byteLength:o.size,this.#e.push(o)}this.#r=`${n.endings===void 0?"transparent":n.endings}`;let s=n.type===void 0?"":String(n.type);this.#t=/^[\x20-\x7E]*$/.test(s)?s:""}get size(){return this.#n}get type(){return this.#t}async text(){let e=new TextDecoder,n="";for await(let r of Hqe(this.#e,!1))n+=e.decode(r,{stream:!0});return n+=e.decode(),n}async arrayBuffer(){let e=new Uint8Array(this.size),n=0;for await(let r of Hqe(this.#e,!1))e.set(r,n),n+=r.length;return e.buffer}stream(){let e=Hqe(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(n){let r=await e.next();r.done?n.close():n.enqueue(r.value)},async cancel(){await e.return()}})}slice(e=0,n=this.size,r=""){let{size:s}=this,i=e<0?Math.max(s+e,0):Math.min(e,s),o=n<0?Math.max(s+n,0):Math.min(n,s),a=Math.max(o-i,0),c=this.#e,u=[],l=0;for(let h of c){if(l>=a)break;let m=ArrayBuffer.isView(h)?h.byteLength:h.size;if(i&&m<=i)i-=m,o-=m;else{let f;ArrayBuffer.isView(h)?(f=h.subarray(i,Math.min(m,o)),l+=f.byteLength):(f=h.slice(i,Math.min(m,o)),l+=f.size),o-=m,u.push(f),i=0}}let d=new Vqe([],{type:String(r).toLowerCase()});return d.#n=a,d.#e=u,d}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(I2t.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});xRr=I2t,x_=xRr});var wRr,TRr,Sk,jqe=V(()=>{p();SK();wRr=class extends x_{#e=0;#t="";constructor(e,n,r={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,r),r===null&&(r={});let s=r.lastModified===void 0?Date.now():Number(r.lastModified);Number.isNaN(s)||(this.#e=s),this.#t=String(n)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof x_&&/^(File)$/.test(e[Symbol.toStringTag])}},TRr=wRr,Sk=TRr});function T2t(t,e=x_){var n=`${x2t()}${x2t()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),r=[],s=`--${n}\r -Content-Disposition: form-data; name="`;return t.forEach((i,o)=>typeof i=="string"?r.push(s+Yqe(o)+`"\r +`)||"";y.block.thinking=E||_||y.block.thinking,y.block.thinkingSignature=JSON.stringify(A),a.set(A.id,y.block),n.push({type:"thinking_end",contentIndex:y.contentIndex,content:y.block.thinking,partial:e}),o.delete(g.output_index)}else A.type==="message"&&y?.type==="text"?(y.block.text=A.content?.map(E=>E.type==="output_text"?E.text:E.refusal).join("")||"",y.block.textSignature=uZr(A.id,A.phase??void 0),n.push({type:"text_end",contentIndex:y.contentIndex,content:y.block.text,partial:e}),o.delete(g.output_index)):A.type==="function_call"&&y?.type==="toolCall"&&y.block.partialJson!==void 0?(y.block.arguments=ec(A.arguments||y.block.partialJson||"{}"),A.namespace!==void 0&&(y.block.namespace=A.namespace),delete y.block.partialJson,n.push({type:"toolcall_end",contentIndex:y.contentIndex,toolCall:y.block,partial:e}),o.delete(g.output_index)):A.type==="custom_tool_call"&&y?.type==="toolCall"&&y.block.customInput&&(l(y,s9e(y.block,A.input??mKt(y.block),!0)),A.namespace!==void 0&&(y.block.namespace=A.namespace),delete y.block.customInput,n.push({type:"toolcall_end",contentIndex:y.contentIndex,toolCall:y.block,partial:e}),o.delete(g.output_index))}else if(g.type==="response.completed"||g.type==="response.incomplete")f(g.response);else{if(g.type==="error")throw new Error(`Error Code ${g.code}: ${g.message}`||"Unknown error");if(g.type==="response.failed"){s=!0,e.rawStopReason=g.response?.status;let A=g.response?.error,y=g.response?.incomplete_details,E=A?`${A.code||"unknown"}: ${A.message||"no message"}`:y?.reason?`incomplete: ${y.reason}`:"Unknown error (no error details in response)";throw new Error(E)}}if(!s)throw new Error("OpenAI Responses stream ended before a terminal response event")}function mZr(t,e){if(!t)return{stopReason:"stop"};switch(t){case"completed":return{stopReason:"stop"};case"incomplete":return e==="max_output_tokens"?{stopReason:"length"}:{stopReason:"error",errorMessage:e?`Response incomplete: ${e}`:"Response incomplete without a provider reason"};case"failed":case"cancelled":return{stopReason:"error"};case"in_progress":case"queued":return{stopReason:"stop"};default:{let n=t;throw new Error(`Unhandled stop reason: ${n}`)}}}var jEe=v(()=>{p();ni();qEe();tv();tI();Cy();Nf();nI();jO()});var fKt={};br(fKt,{stream:()=>hKt,streamSimple:()=>bZr});function AZr(t){let e=new Map;if(!t)return e;for(let n of t.split(",")){let r=n.trim();if(!r)continue;let[i,s]=r.split("=",2);!i||!s||e.set(i.trim(),s.trim())}return e}function yZr(t,e){return e?.azureDeploymentName?e.azureDeploymentName:AZr(vi("AZURE_OPENAI_DEPLOYMENT_NAME_MAP",e?.env)).get(t.id)||t.id}function EZr(t){return tA(Rh(t),"Azure OpenAI API error")}function _Zr(t){let e=t.trim().replace(/\/+$/,""),n;try{n=new URL(e)}catch{throw new Error(`Invalid Azure OpenAI base URL: ${t}`)}let r=n.hostname.endsWith(".openai.azure.com")||n.hostname.endsWith(".cognitiveservices.azure.com")||n.hostname.endsWith(".ai.azure.com"),i=n.pathname.replace(/\/+$/,"");return r&&(i===""||i==="/"||i==="/openai"||i==="/openai/v1/responses")&&(n.pathname="/openai/v1",n.search=""),n.toString().replace(/\/+$/,"")}function xZr(t){return`https://${t}.openai.azure.com/openai/v1`}function SZr(t,e){let n=e?.azureApiVersion||vi("AZURE_OPENAI_API_VERSION",e?.env)||hZr,r=e?.azureBaseUrl?.trim()||vi("AZURE_OPENAI_BASE_URL",e?.env)?.trim()||void 0,i=e?.azureResourceName||vi("AZURE_OPENAI_RESOURCE_NAME",e?.env),s=r;if(!s&&i&&(s=xZr(i)),!s&&t.baseUrl&&(s=t.baseUrl),!s)throw new Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return{baseUrl:_Zr(s),apiVersion:n}}function CZr(t,e,n){let r={"User-Agent":Bh(),...t.headers};n?.headers&&Object.assign(r,n.headers);let{baseUrl:i,apiVersion:s}=SZr(t,n);return new BX({apiKey:e,apiVersion:s,dangerouslyAllowBrowser:!0,fetch:n?.fetch,defaultHeaders:r,baseURL:i})}function IZr(t,e,n,r,i=R0(Bf(e.messages),t.compat?.supportsOpenAIGrammarTools??!1)){let s=t.compat?.supportsAdditionalTools??!1,o=t.compat?.supportsToolSearch??!1,a=w0(e.messages,s||o),c=ZL(t,e,fZr,{grammarToolInputProperties:i,supportsMidConvoSystemMessages:t.compat?.supportsMidConvoSystemMessages??!1,supportsAdditionalTools:s,supportsToolSearch:o,toolOptions:{supportsStrictMode:t.compat?.supportsStrictMode??!0,supportsOpenAIGrammarTools:t.compat?.supportsOpenAIGrammarTools??!1}}),u={model:r,input:c,stream:!0,prompt_cache_key:iN(n?.sessionId),store:!1};if(n?.maxTokens&&(u.max_output_tokens=Math.max(n.maxTokens,gZr)),n?.temperature!==void 0&&(u.temperature=n?.temperature),a.requestTools.length>0&&(u.tools=oN(a.requestTools,{supportsStrictMode:t.compat?.supportsStrictMode??!0,supportsOpenAIGrammarTools:t.compat?.supportsOpenAIGrammarTools??!1})),n?.toolChoice!==void 0&&(u.tool_choice=n.toolChoice),t.reasoning)if(n?.reasoningEffort||n?.reasoningSummary){let l=n?.reasoningEffort?t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort:"medium";u.reasoning={effort:l,summary:n?.reasoningSummary||"auto"},u.include=["reasoning.encrypted_content"]}else t.thinkingLevelMap?.off!==null&&(u.reasoning={effort:t.thinkingLevelMap?.off??"none"});return n?.samplingParams&&Object.assign(u,n.samplingParams),u}var hZr,fZr,gZr,hKt,bZr,gKt=v(()=>{p();NX();ni();ev();eA();T0();dv();cx();CL();Nf();nI();DX();jEe();rI();hZr="v1",fZr=new Set(["openai","openai-codex","opencode","azure-openai-responses"]),gZr=16;hKt=(t,e,n)=>{let r=new Rc,i=vh(e,t.compat?.supportsMidConvoSystemMessages);return(async()=>{let s=yZr(t,n),o={role:"assistant",content:[],api:"azure-openai-responses",provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let a=n?.apiKey;if(!a)throw new Error(`No API key for provider: ${t.provider}`);let c=CZr(t,a,n),u=R0(Bf(i.messages),t.compat?.supportsOpenAIGrammarTools??!1),l=IZr(t,i,n,s,u),d=await n?.onPayload?.(l,t);d!==void 0&&(l=d);let m={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},{data:h,response:f}=await Q0(()=>c.responses.create(l,m).withResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});if(await n?.onResponse?.({status:f.status,headers:Dm(f.headers)},t),r.push({type:"start",partial:o}),await e2(h,o,r,t,{grammarToolInputProperties:u}),n?.signal?.aborted)throw new Error("Request was aborted");if(o.stopReason==="pending")throw new Error("Azure OpenAI Responses stream ended without a stop reason");if(o.stopReason==="aborted"||o.stopReason==="error")throw new Error(o.errorMessage||"An unknown error occurred");r.push({type:"done",reason:o.stopReason,message:o}),r.end()}catch(a){for(let c of o.content)delete c.index,delete c.partialJson,delete c.customInput;o.stopReason=n?.signal?.aborted?"aborted":"error",o.errorMessage=EZr(a),r.push({type:"error",reason:o.stopReason,error:o}),r.end()}})(),r},bZr=(t,e,n)=>{let r=n?.apiKey;if(!r)throw new Error(`No API key for provider: ${t.provider}`);let i={...Wp(t,e,n,r),toolChoice:n?.toolChoice},s=n?.reasoning?Wl(t,n.reasoning):void 0;return hKt(t,e,{...i,reasoningEffort:s==="off"?void 0:s})}});var t2,PX=v(()=>{p();Sy();t2=()=>ed(()=>Promise.resolve().then(()=>(gKt(),fKt)))});function o9e(t){AKt=t}var wZr,TZr,AKt,MX,VEe=v(()=>{p();Sy();wZr=function(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,i,s,o){return r?e?".jsx":".js":i&&(!s||!o)?n:i+s+"."+o.toLowerCase()+"js"}):t},TZr=t=>{let e=x.endsWith(".js")?t.replace(/\.ts$/,".js"):t;return import(wZr(e))};MX=()=>ed(async()=>AKt??await TZr("./bedrock-converse-stream.ts"))});var EKt=re((O2o,yKt)=>{p();function W0(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}yKt.exports=W0;W0.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};W0.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};W0.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0};W0.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};W0.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};W0.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};W0.prototype.start=W0.prototype.try;W0.prototype.errors=function(){return this._errors};W0.prototype.attempts=function(){return this._attempts};W0.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,n=0,r=0;r=n&&(e=i,n=o)}return e}});var bKt=re(n2=>{p();var vZr=EKt();n2.operation=function(t){var e=n2.timeouts(t);return new vZr(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};n2.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)e[n]=t[n];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],i=0;i{p();_Kt.exports=bKt()});var CKt=re(($2o,zEe)=>{"use strict";p();var RZr=xKt(),kZr=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],YEe=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},BZr=(t,e,n)=>{let r=n.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=r,t},NZr=t=>kZr.includes(t),SKt=(t,e)=>new Promise((n,r)=>{e={onFailedAttempt:()=>{},retries:10,...e};let i=RZr.operation(e);i.attempt(async s=>{try{n(await t(s))}catch(o){if(!(o instanceof Error)){r(new TypeError(`Non-error was thrown: "${o}". You should only throw errors.`));return}if(o instanceof YEe)i.stop(),r(o.originalError);else if(o instanceof TypeError&&!NZr(o.message))i.stop(),r(o);else{BZr(o,s,e);try{await e.onFailedAttempt(o)}catch(a){r(a);return}i.retry(o)||r(i.mainError())}}})});zEe.exports=SKt;zEe.exports.default=SKt;zEe.exports.AbortError=YEe});var a9e=re((H2o,NKt)=>{"use strict";p();var KEe=Object.prototype.hasOwnProperty,BKt=Object.prototype.toString,IKt=Object.defineProperty,wKt=Object.getOwnPropertyDescriptor,TKt=function(e){return typeof Array.isArray=="function"?Array.isArray(e):BKt.call(e)==="[object Array]"},vKt=function(e){if(!e||BKt.call(e)!=="[object Object]")return!1;var n=KEe.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&KEe.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var i;for(i in e);return typeof i>"u"||KEe.call(e,i)},RKt=function(e,n){IKt&&n.name==="__proto__"?IKt(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},kKt=function(e,n){if(n==="__proto__")if(KEe.call(e,n)){if(wKt)return wKt(e,n).value}else return;return e[n]};NKt.exports=function t(){var e,n,r,i,s,o,a=arguments[0],c=1,u=arguments.length,l=!1;for(typeof a=="boolean"&&(l=a,a=arguments[1]||{},c=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});c{DZr.exports={name:"gaxios",version:"7.3.1",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/cjs/src/index.js",types:"build/cjs/src/index.d.ts",files:["build/"],exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},scripts:{lint:"gts check --no-inline-config",test:"c8 mocha build/esm/test","presystem-test":"npm run compile","system-test":"mocha build/esm/system-test --timeout 80000",compile:"tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"jsdoc -c .jsdoc.js","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean"},repository:{type:"git",directory:"core/packages/gaxios",url:"https://github.com/googleapis/google-cloud-node.git"},keywords:["google"],engines:{node:">=18"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/cors":"^2.8.6","@types/express":"^5.0.0","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/multiparty":"4.2.1","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/node":"^24.0.0","@types/sinon":"^21.0.0","@types/tmp":"^0.2.6",assert:"^2.0.0",browserify:"^17.0.0",c8:"^10.1.3",cors:"^2.8.5",express:"^5.0.0",gts:"^6.0.2","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.0",mocha:"^11.1.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"14.0.5","null-loader":"^4.0.1","pack-n-play":"^4.0.0",puppeteer:"^24.0.0",sinon:"21.0.3","stream-browserify":"^3.0.0",tmp:"0.2.7","ts-loader":"^9.5.2",typescript:"5.8.3","undici-types":"^7.24.1",webpack:"^5.97.1","webpack-cli":"^6.0.1"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","node-fetch":"^3.3.2"},homepage:"https://github.com/googleapis/google-cloud-node/tree/main/core/packages/gaxios"}});var MKt=re((V2o,PKt)=>{"use strict";p();var PZr=DKt();PKt.exports={pkg:PZr}});var u9e=re(H0=>{"use strict";p();var LKt=H0&&H0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(H0,"__esModule",{value:!0});H0.GaxiosError=H0.GAXIOS_ERROR_SYMBOL=void 0;H0.defaultErrorRedactor=FKt;var OKt=LKt(a9e()),MZr=LKt(MKt()),c9e=MZr.default.pkg;H0.GAXIOS_ERROR_SYMBOL=Symbol.for(`${c9e.name}-gaxios-error`);var l9e=class t extends Error{config;response;code;status;error;[H0.GAXIOS_ERROR_SYMBOL]=c9e.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&H0.GAXIOS_ERROR_SYMBOL in e&&e[H0.GAXIOS_ERROR_SYMBOL]===c9e.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,n,r,i){if(super(e,{cause:i}),this.config=n,this.response=r,this.error=i instanceof Error?i:void 0,this.config=(0,OKt.default)(!0,{},n),this.response&&(this.response.config=(0,OKt.default)(!0,{},this.response.config)),this.response){try{this.response.data=OZr(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,n="The request failed"){let r=n;if(typeof e.data=="string"&&(r=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){r="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:r;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let o=[];for(let a of e.data.error.errors)typeof a=="object"&&"message"in a&&typeof a.message=="string"&&o.push(a.message);return Object.assign({message:o.join(` +`)||r,code:s,status:i},e.data.error)}return Object.assign({message:r,code:s,status:i},e.data.error)}}return{message:r,code:e.status,status:e.statusText}}};H0.GaxiosError=l9e;function OZr(t,e){switch(t){case"stream":return e;case"json":return JSON.parse(JSON.stringify(e));case"arraybuffer":return JSON.parse(Buffer.from(e).toString("utf8"));case"blob":return JSON.parse(e.text());default:return e}}function FKt(t){let e="< - See `errorRedactor` option in `gaxios` for configuration>.";function n(s){s&&s.forEach((o,a)=>{(/^authentication$/i.test(a)||/^authorization$/i.test(a)||/secret/i.test(a))&&s.set(a,e)})}function r(s,o){if(typeof s=="object"&&s!==null&&typeof s[o]=="string"){let a=s[o];(/grant_type=/i.test(a)||/assertion=/i.test(a)||/secret/i.test(a))&&(s[o]=e)}}function i(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((o,a)=>{(["grant_type","assertion"].includes(a)||/secret/.test(a))&&s.set(a,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return t.config&&(n(t.config.headers),r(t.config,"data"),i(t.config.data),r(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(FKt({config:t.response.config}),n(t.response.headers),t.response.bodyUsed&&(r(t.response,"data"),i(t.response.data))),t}});var UKt=re(d9e=>{"use strict";p();Object.defineProperty(d9e,"__esModule",{value:!0});d9e.getRetryConfig=LZr;async function LZr(t){let e=QKt(t);if(!t||!t.config||!e&&!t.config.retry)return{shouldRetry:!1};e=e||{},e.currentRetryAttempt=e.currentRetryAttempt||0,e.retry=e.retry===void 0||e.retry===null?3:e.retry,e.httpMethodsToRetry=e.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],e.noResponseRetries=e.noResponseRetries===void 0||e.noResponseRetries===null?2:e.noResponseRetries,e.retryDelayMultiplier=e.retryDelayMultiplier?e.retryDelayMultiplier:2,e.timeOfFirstRequest=e.timeOfFirstRequest?e.timeOfFirstRequest:Date.now(),e.totalTimeout=e.totalTimeout?e.totalTimeout:Number.MAX_SAFE_INTEGER,e.maxRetryDelay=e.maxRetryDelay?e.maxRetryDelay:Number.MAX_SAFE_INTEGER;let n=[[100,199],[408,408],[429,429],[500,599]];if(e.statusCodesToRetry=e.statusCodesToRetry||n,t.config.retryConfig=e,!await(e.shouldRetry||FZr)(t))return{shouldRetry:!1,config:t.config};let i=QZr(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(o=>{setTimeout(o,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}function FZr(t){let e=QKt(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let n=!1;for(let[r,i]of e.statusCodesToRetry){let s=t.response.status;if(s>=r&&s<=i){n=!0;break}}if(!n)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}function QKt(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}function QZr(t){let n=(t.currentRetryAttempt?0:t.retryDelay??100)+(Math.pow(t.retryDelayMultiplier,t.currentRetryAttempt)-1)/2*1e3,r=t.totalTimeout-(Date.now()-t.timeOfFirstRequest);return Math.min(n,r,t.maxRetryDelay)}});var m9e=re(JEe=>{"use strict";p();Object.defineProperty(JEe,"__esModule",{value:!0});JEe.GaxiosInterceptorManager=void 0;var p9e=class extends Set{};JEe.GaxiosInterceptorManager=p9e});var WKt=re(cA=>{"use strict";p();var UZr=cA&&cA.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),GZr=cA&&cA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),GKt=cA&&cA.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&UZr(e,t,n);return GZr(e,t),e};Object.defineProperty(cA,"__esModule",{value:!0});cA.req=cA.json=cA.toBuffer=void 0;var $Zr=GKt(require("http")),WZr=GKt(require("https"));async function $Kt(t){let e=0,n=[];for await(let r of t)e+=r.length,n.push(r);return Buffer.concat(n,e)}cA.toBuffer=$Kt;async function HZr(t){let n=(await $Kt(t)).toString("utf8");try{return JSON.parse(n)}catch(r){let i=r;throw i.message+=` (input: ${n})`,i}}cA.json=HZr;function qZr(t,e={}){let r=((typeof t=="string"?t:t.href).startsWith("https:")?WZr:$Zr).request(t,e),i=new Promise((s,o)=>{r.once("response",s).once("error",o).end()});return r.then=i.then.bind(i),r}cA.req=qZr});var VKt=re(Ly=>{"use strict";p();var qKt=Ly&&Ly.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),jZr=Ly&&Ly.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jKt=Ly&&Ly.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&qKt(e,t,n);return jZr(e,t),e},VZr=Ly&&Ly.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&qKt(e,t,n)};Object.defineProperty(Ly,"__esModule",{value:!0});Ly.Agent=void 0;var YZr=jKt(require("net")),HKt=jKt(require("http")),zZr=require("https");VZr(WKt(),Ly);var AI=Symbol("AgentBaseInternalState"),h9e=class extends HKt.Agent{constructor(e){super(e),this[AI]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(` +`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let n=new YZr.Socket({writable:!1});return this.sockets[e].push(n),this.totalSocketCount++,n}decrementSockets(e,n){if(!this.sockets[e]||n===null)return;let r=this.sockets[e],i=r.indexOf(n);i!==-1&&(r.splice(i,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?zZr.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,n,r){let i={...n,secureEndpoint:this.isSecureEndpoint(n)},s=this.getName(i),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(a=>{if(this.decrementSockets(s,o),a instanceof HKt.Agent)try{return a.addRequest(e,i)}catch(c){return r(c)}this[AI].currentSocket=a,super.createSocket(e,n,r)},a=>{this.decrementSockets(s,o),r(a)})}createConnection(){let e=this[AI].currentSocket;if(this[AI].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[AI].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[AI]&&(this[AI].defaultPort=e)}get protocol(){return this[AI].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[AI]&&(this[AI].protocol=e)}};Ly.Agent=h9e});var YKt=re(d3=>{"use strict";p();var KZr=d3&&d3.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(d3,"__esModule",{value:!0});d3.parseProxyResponse=void 0;var JZr=KZr(pB()),XEe=(0,JZr.default)("https-proxy-agent:parse-proxy-response");function XZr(t){return new Promise((e,n)=>{let r=0,i=[];function s(){let l=t.read();l?u(l):t.once("readable",s)}function o(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("readable",s)}function a(){o(),XEe("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(l){o(),XEe("onerror %o",l),n(l)}function u(l){i.push(l),r+=l.length;let d=Buffer.concat(i,r),m=d.indexOf(`\r +\r +`);if(m===-1){XEe("have not received end of HTTP headers yet..."),s();return}let h=d.slice(0,m).toString("ascii").split(`\r +`),f=h.shift();if(!f)return t.destroy(),n(new Error("No header received from proxy CONNECT response"));let g=f.split(" "),A=+g[1],y=g.slice(2).join(" "),E={};for(let _ of h){if(!_)continue;let S=_.indexOf(":");if(S===-1)return t.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${_}"`));let C=_.slice(0,S).toLowerCase(),I=_.slice(S+1).trimStart(),w=E[C];typeof w=="string"?E[C]=[w,I]:Array.isArray(w)?w.push(I):E[C]=I}XEe("got proxy server response: %o %o",f,E),o(),e({connect:{statusCode:A,statusText:y,headers:E},buffered:d})}t.on("error",c),t.on("end",a),s()})}d3.parseProxyResponse=XZr});var eJt=re(q0=>{"use strict";p();var ZZr=q0&&q0.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),eei=q0&&q0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),XKt=q0&&q0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ZZr(e,t,n);return eei(e,t),e},ZKt=q0&&q0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(q0,"__esModule",{value:!0});q0.HttpsProxyAgent=void 0;var ZEe=XKt(require("net")),zKt=XKt(require("tls")),tei=ZKt(require("assert")),nei=ZKt(pB()),rei=VKt(),iei=require("url"),sei=YKt(),OX=(0,nei.default)("https-proxy-agent"),KKt=t=>t.servername===void 0&&t.host&&!ZEe.isIP(t.host)?{...t,servername:t.host}:t,e0e=class extends rei.Agent{constructor(e,n){super(n),this.options={path:void 0},this.proxy=typeof e=="string"?new iei.URL(e):e,this.proxyHeaders=n?.headers??{},OX("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?JKt(n,"headers"):null,host:r,port:i}}async connect(e,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let i;r.protocol==="https:"?(OX("Creating `tls.Socket`: %o",this.connectOpts),i=zKt.connect(KKt(this.connectOpts))):(OX("Creating `net.Socket`: %o",this.connectOpts),i=ZEe.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=ZEe.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${o}:${n.port} HTTP/1.1\r +`;if(r.username||r.password){let m=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(m).toString("base64")}`}s.Host=`${o}:${n.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let m of Object.keys(s))a+=`${m}: ${s[m]}\r +`;let c=(0,sei.parseProxyResponse)(i);i.write(`${a}\r +`);let{connect:u,buffered:l}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",oei),n.secureEndpoint?(OX("Upgrading socket connection to TLS"),zKt.connect({...JKt(KKt(n),"host","path","port"),socket:i})):i;i.destroy();let d=new ZEe.Socket({writable:!1});return d.readable=!0,e.once("socket",m=>{OX("Replaying proxy buffer for failed request"),(0,tei.default)(m.listenerCount("data")>0),m.push(l),m.push(null)}),d}};e0e.protocols=["http","https"];q0.HttpsProxyAgent=e0e;function oei(t){t.resume()}function JKt(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}});function aei(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let n=t.substring(5,e).split(";"),r="",i=!1,s=n[0]||"text/plain",o=s;for(let l=1;l{p();tJt=aei});var iJt=re((t0e,rJt)=>{p();(function(t,e){typeof t0e=="object"&&typeof rJt<"u"?e(t0e):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(t0e,(function(t){"use strict";function e(){}function n(Q){return typeof Q=="object"&&Q!==null||typeof Q=="function"}let r=e;function i(Q,J){try{Object.defineProperty(Q,"name",{value:J,configurable:!0})}catch{}}let s=Promise,o=Promise.prototype.then,a=Promise.reject.bind(s);function c(Q){return new s(Q)}function u(Q){return c(J=>J(Q))}function l(Q){return a(Q)}function d(Q,J,Ie){return o.call(Q,J,Ie)}function m(Q,J,Ie){d(d(Q,J,Ie),void 0,r)}function h(Q,J){m(Q,J)}function f(Q,J){m(Q,void 0,J)}function g(Q,J,Ie){return d(Q,J,Ie)}function A(Q){d(Q,void 0,r)}let y=Q=>{if(typeof queueMicrotask=="function")y=queueMicrotask;else{let J=u(void 0);y=Ie=>d(J,Ie)}return y(Q)};function E(Q,J,Ie){if(typeof Q!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(Q,J,Ie)}function _(Q,J,Ie){try{return u(E(Q,J,Ie))}catch(nt){return l(nt)}}let S=16384;class C{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(J){let Ie=this._back,nt=Ie;Ie._elements.length===S-1&&(nt={_elements:[],_next:void 0}),Ie._elements.push(J),nt!==Ie&&(this._back=nt,Ie._next=nt),++this._size}shift(){let J=this._front,Ie=J,nt=this._cursor,bt=nt+1,Kt=J._elements,cn=Kt[nt];return bt===S&&(Ie=J._next,bt=0),--this._size,this._cursor=bt,J!==Ie&&(this._front=Ie),Kt[nt]=void 0,cn}forEach(J){let Ie=this._cursor,nt=this._front,bt=nt._elements;for(;(Ie!==bt.length||nt._next!==void 0)&&!(Ie===bt.length&&(nt=nt._next,bt=nt._elements,Ie=0,bt.length===0));)J(bt[Ie]),++Ie}peek(){let J=this._front,Ie=this._cursor;return J._elements[Ie]}}let I=Symbol("[[AbortSteps]]"),w=Symbol("[[ErrorSteps]]"),k=Symbol("[[CancelSteps]]"),N=Symbol("[[PullSteps]]"),O=Symbol("[[ReleaseSteps]]");function W(Q,J){Q._ownerReadableStream=J,J._reader=Q,J._state==="readable"?ce(Q):J._state==="closed"?z(Q):Y(Q,J._storedError)}function $(Q,J){let Ie=Q._ownerReadableStream;return Ef(Ie,J)}function G(Q){let J=Q._ownerReadableStream;J._state==="readable"?j(Q,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):se(Q,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),J._readableStreamController[O](),J._reader=void 0,Q._ownerReadableStream=void 0}function q(Q){return new TypeError("Cannot "+Q+" a stream using a released reader")}function ce(Q){Q._closedPromise=c((J,Ie)=>{Q._closedPromise_resolve=J,Q._closedPromise_reject=Ie})}function Y(Q,J){ce(Q),j(Q,J)}function z(Q){ce(Q),Ae(Q)}function j(Q,J){Q._closedPromise_reject!==void 0&&(A(Q._closedPromise),Q._closedPromise_reject(J),Q._closedPromise_resolve=void 0,Q._closedPromise_reject=void 0)}function se(Q,J){Y(Q,J)}function Ae(Q){Q._closedPromise_resolve!==void 0&&(Q._closedPromise_resolve(void 0),Q._closedPromise_resolve=void 0,Q._closedPromise_reject=void 0)}let De=Number.isFinite||function(Q){return typeof Q=="number"&&isFinite(Q)},Pe=Math.trunc||function(Q){return Q<0?Math.ceil(Q):Math.floor(Q)};function we(Q){return typeof Q=="object"||typeof Q=="function"}function ie(Q,J){if(Q!==void 0&&!we(Q))throw new TypeError(`${J} is not an object.`)}function oe(Q,J){if(typeof Q!="function")throw new TypeError(`${J} is not a function.`)}function ne(Q){return typeof Q=="object"&&Q!==null||typeof Q=="function"}function Z(Q,J){if(!ne(Q))throw new TypeError(`${J} is not an object.`)}function te(Q,J,Ie){if(Q===void 0)throw new TypeError(`Parameter ${J} is required in '${Ie}'.`)}function V(Q,J,Ie){if(Q===void 0)throw new TypeError(`${J} is required in '${Ie}'.`)}function ee(Q){return Number(Q)}function ae(Q){return Q===0?0:Q}function me(Q){return ae(Pe(Q))}function ge(Q,J){let nt=Number.MAX_SAFE_INTEGER,bt=Number(Q);if(bt=ae(bt),!De(bt))throw new TypeError(`${J} is not a finite number`);if(bt=me(bt),bt<0||bt>nt)throw new TypeError(`${J} is outside the accepted range of 0 to ${nt}, inclusive`);return!De(bt)||bt===0?0:bt}function ue(Q,J){if(!jS(Q))throw new TypeError(`${J} is not a ReadableStream.`)}function ye(Q){return new X(Q)}function Se(Q,J){Q._reader._readRequests.push(J)}function be(Q,J,Ie){let bt=Q._reader._readRequests.shift();Ie?bt._closeSteps():bt._chunkSteps(J)}function Te(Q){return Q._reader._readRequests.length}function _e(Q){let J=Q._reader;return!(J===void 0||!$e(J))}class X{constructor(J){if(te(J,1,"ReadableStreamDefaultReader"),ue(J,"First parameter"),VS(J))throw new TypeError("This stream has already been locked for exclusive reading by another reader");W(this,J),this._readRequests=new C}get closed(){return $e(this)?this._closedPromise:l(ze("closed"))}cancel(J=void 0){return $e(this)?this._ownerReadableStream===void 0?l(q("cancel")):$(this,J):l(ze("cancel"))}read(){if(!$e(this))return l(ze("read"));if(this._ownerReadableStream===void 0)return l(q("read from"));let J,Ie,nt=c((Kt,cn)=>{J=Kt,Ie=cn});return He(this,{_chunkSteps:Kt=>J({value:Kt,done:!1}),_closeSteps:()=>J({value:void 0,done:!0}),_errorSteps:Kt=>Ie(Kt)}),nt}releaseLock(){if(!$e(this))throw ze("releaseLock");this._ownerReadableStream!==void 0&&mt(this)}}Object.defineProperties(X.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(X.prototype.cancel,"cancel"),i(X.prototype.read,"read"),i(X.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(X.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function $e(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_readRequests")?!1:Q instanceof X}function He(Q,J){let Ie=Q._ownerReadableStream;Ie._disturbed=!0,Ie._state==="closed"?J._closeSteps():Ie._state==="errored"?J._errorSteps(Ie._storedError):Ie._readableStreamController[N](J)}function mt(Q){G(Q);let J=new TypeError("Reader was released");st(Q,J)}function st(Q,J){let Ie=Q._readRequests;Q._readRequests=new C,Ie.forEach(nt=>{nt._errorSteps(J)})}function ze(Q){return new TypeError(`ReadableStreamDefaultReader.prototype.${Q} can only be used on a ReadableStreamDefaultReader`)}let rt=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Ct{constructor(J,Ie){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=J,this._preventCancel=Ie}next(){let J=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?g(this._ongoingPromise,J,J):J(),this._ongoingPromise}return(J){let Ie=()=>this._returnSteps(J);return this._ongoingPromise?g(this._ongoingPromise,Ie,Ie):Ie()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let J=this._reader,Ie,nt,bt=c((cn,or)=>{Ie=cn,nt=or});return He(J,{_chunkSteps:cn=>{this._ongoingPromise=void 0,y(()=>Ie({value:cn,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,G(J),Ie({value:void 0,done:!0})},_errorSteps:cn=>{this._ongoingPromise=void 0,this._isFinished=!0,G(J),nt(cn)}}),bt}_returnSteps(J){if(this._isFinished)return Promise.resolve({value:J,done:!0});this._isFinished=!0;let Ie=this._reader;if(!this._preventCancel){let nt=$(Ie,J);return G(Ie),g(nt,()=>({value:J,done:!0}))}return G(Ie),u({value:J,done:!0})}}let on={next(){return Qt(this)?this._asyncIteratorImpl.next():l(Mt("next"))},return(Q){return Qt(this)?this._asyncIteratorImpl.return(Q):l(Mt("return"))}};Object.setPrototypeOf(on,rt);function Ft(Q,J){let Ie=ye(Q),nt=new Ct(Ie,J),bt=Object.create(on);return bt._asyncIteratorImpl=nt,bt}function Qt(Q){if(!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_asyncIteratorImpl"))return!1;try{return Q._asyncIteratorImpl instanceof Ct}catch{return!1}}function Mt(Q){return new TypeError(`ReadableStreamAsyncIterator.${Q} can only be used on a ReadableSteamAsyncIterator`)}let Xe=Number.isNaN||function(Q){return Q!==Q};var Me,Je,yt;function Vt(Q){return Q.slice()}function dn(Q,J,Ie,nt,bt){new Uint8Array(Q).set(new Uint8Array(Ie,nt,bt),J)}let An=Q=>(typeof Q.transfer=="function"?An=J=>J.transfer():typeof structuredClone=="function"?An=J=>structuredClone(J,{transfer:[J]}):An=J=>J,An(Q)),Fn=Q=>(typeof Q.detached=="boolean"?Fn=J=>J.detached:Fn=J=>J.byteLength===0,Fn(Q));function qe(Q,J,Ie){if(Q.slice)return Q.slice(J,Ie);let nt=Ie-J,bt=new ArrayBuffer(nt);return dn(bt,0,Q,J,nt),bt}function ht(Q,J){let Ie=Q[J];if(Ie!=null){if(typeof Ie!="function")throw new TypeError(`${String(J)} is not a function`);return Ie}}function Zt(Q){let J={[Symbol.iterator]:()=>Q.iterator},Ie=(async function*(){return yield*J})(),nt=Ie.next;return{iterator:Ie,nextMethod:nt,done:!1}}let Ze=(yt=(Me=Symbol.asyncIterator)!==null&&Me!==void 0?Me:(Je=Symbol.for)===null||Je===void 0?void 0:Je.call(Symbol,"Symbol.asyncIterator"))!==null&&yt!==void 0?yt:"@@asyncIterator";function dt(Q,J="sync",Ie){if(Ie===void 0)if(J==="async"){if(Ie=ht(Q,Ze),Ie===void 0){let Kt=ht(Q,Symbol.iterator),cn=dt(Q,"sync",Kt);return Zt(cn)}}else Ie=ht(Q,Symbol.iterator);if(Ie===void 0)throw new TypeError("The object is not iterable");let nt=E(Ie,Q,[]);if(!n(nt))throw new TypeError("The iterator method must return an object");let bt=nt.next;return{iterator:nt,nextMethod:bt,done:!1}}function gt(Q){let J=E(Q.nextMethod,Q.iterator,[]);if(!n(J))throw new TypeError("The iterator.next() method must return an object");return J}function tt(Q){return!!Q.done}function Dt(Q){return Q.value}function en(Q){return!(typeof Q!="number"||Xe(Q)||Q<0)}function ke(Q){let J=qe(Q.buffer,Q.byteOffset,Q.byteOffset+Q.byteLength);return new Uint8Array(J)}function Ue(Q){let J=Q._queue.shift();return Q._queueTotalSize-=J.size,Q._queueTotalSize<0&&(Q._queueTotalSize=0),J.value}function lt(Q,J,Ie){if(!en(Ie)||Ie===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");Q._queue.push({value:J,size:Ie}),Q._queueTotalSize+=Ie}function Ge(Q){return Q._queue.peek().value}function vt(Q){Q._queue=new C,Q._queueTotalSize=0}function Lt(Q){return Q===DataView}function Bt(Q){return Lt(Q.constructor)}function bn(Q){return Lt(Q)?1:Q.BYTES_PER_ELEMENT}class yn{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Kn(this))throw ga("view");return this._view}respond(J){if(!Kn(this))throw ga("respond");if(te(J,1,"respond"),J=ge(J,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Fn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");_i(this._associatedReadableByteStreamController,J)}respondWithNewView(J){if(!Kn(this))throw ga("respondWithNewView");if(te(J,1,"respondWithNewView"),!ArrayBuffer.isView(J))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Fn(J.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");mn(this._associatedReadableByteStreamController,J)}}Object.defineProperties(yn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(yn.prototype.respond,"respond"),i(yn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(yn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class xn{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ir(this))throw va("byobRequest");return Sr(this)}get desiredSize(){if(!ir(this))throw va("desiredSize");return Jn(this)}close(){if(!ir(this))throw va("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let J=this._controlledReadableByteStream._state;if(J!=="readable")throw new TypeError(`The stream (in ${J} state) is not in the readable state and cannot be closed`);Dn(this)}enqueue(J){if(!ir(this))throw va("enqueue");if(te(J,1,"enqueue"),!ArrayBuffer.isView(J))throw new TypeError("chunk must be an array buffer view");if(J.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(J.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let Ie=this._controlledReadableByteStream._state;if(Ie!=="readable")throw new TypeError(`The stream (in ${Ie} state) is not in the readable state and cannot be enqueued to`);Wn(this,J)}error(J=void 0){if(!ir(this))throw va("error");lr(this,J)}[k](J){pn(this),vt(this);let Ie=this._cancelAlgorithm(J);return Xt(this),Ie}[N](J){let Ie=this._controlledReadableByteStream;if(this._queueTotalSize>0){Qr(this,J);return}let nt=this._autoAllocateChunkSize;if(nt!==void 0){let bt;try{bt=new ArrayBuffer(nt)}catch(cn){J._errorSteps(cn);return}let Kt={buffer:bt,bufferByteLength:nt,byteOffset:0,byteLength:nt,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(Kt)}Se(Ie,J),ai(this)}[O](){if(this._pendingPullIntos.length>0){let J=this._pendingPullIntos.peek();J.readerType="none",this._pendingPullIntos=new C,this._pendingPullIntos.push(J)}}}Object.defineProperties(xn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(xn.prototype.close,"close"),i(xn.prototype.enqueue,"enqueue"),i(xn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(xn.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function ir(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_controlledReadableByteStream")?!1:Q instanceof xn}function Kn(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_associatedReadableByteStreamController")?!1:Q instanceof yn}function ai(Q){if(!Jt(Q))return;if(Q._pulling){Q._pullAgain=!0;return}Q._pulling=!0;let Ie=Q._pullAlgorithm();m(Ie,()=>(Q._pulling=!1,Q._pullAgain&&(Q._pullAgain=!1,ai(Q)),null),nt=>(lr(Q,nt),null))}function pn(Q){mi(Q),Q._pendingPullIntos=new C}function bi(Q,J){let Ie=!1;Q._state==="closed"&&(Ie=!0);let nt=Zr(J);J.readerType==="default"?be(Q,nt,Ie):Em(Q,nt,Ie)}function Zr(Q){let J=Q.bytesFilled,Ie=Q.elementSize;return new Q.viewConstructor(Q.buffer,Q.byteOffset,J/Ie)}function Wr(Q,J,Ie,nt){Q._queue.push({buffer:J,byteOffset:Ie,byteLength:nt}),Q._queueTotalSize+=nt}function Uo(Q,J,Ie,nt){let bt;try{bt=qe(J,Ie,Ie+nt)}catch(Kt){throw lr(Q,Kt),Kt}Wr(Q,bt,0,nt)}function Ps(Q,J){J.bytesFilled>0&&Uo(Q,J.buffer,J.byteOffset,J.bytesFilled),_c(Q)}function fn(Q,J){let Ie=Math.min(Q._queueTotalSize,J.byteLength-J.bytesFilled),nt=J.bytesFilled+Ie,bt=Ie,Kt=!1,cn=nt%J.elementSize,or=nt-cn;or>=J.minimumFill&&(bt=or-J.bytesFilled,Kt=!0);let ji=Q._queue;for(;bt>0;){let ei=ji.peek(),bs=Math.min(bt,ei.byteLength),Hs=J.byteOffset+J.bytesFilled;dn(J.buffer,Hs,ei.buffer,ei.byteOffset,bs),ei.byteLength===bs?ji.shift():(ei.byteOffset+=bs,ei.byteLength-=bs),Q._queueTotalSize-=bs,os(Q,bs,J),bt-=bs}return Kt}function os(Q,J,Ie){Ie.bytesFilled+=J}function To(Q){Q._queueTotalSize===0&&Q._closeRequested?(Xt(Q),_T(Q._controlledReadableByteStream)):ai(Q)}function mi(Q){Q._byobRequest!==null&&(Q._byobRequest._associatedReadableByteStreamController=void 0,Q._byobRequest._view=null,Q._byobRequest=null)}function Yn(Q){for(;Q._pendingPullIntos.length>0;){if(Q._queueTotalSize===0)return;let J=Q._pendingPullIntos.peek();fn(Q,J)&&(_c(Q),bi(Q._controlledReadableByteStream,J))}}function Sp(Q){let J=Q._controlledReadableByteStream._reader;for(;J._readRequests.length>0;){if(Q._queueTotalSize===0)return;let Ie=J._readRequests.shift();Qr(Q,Ie)}}function Vd(Q,J,Ie,nt){let bt=Q._controlledReadableByteStream,Kt=J.constructor,cn=bn(Kt),{byteOffset:or,byteLength:ji}=J,ei=Ie*cn,bs;try{bs=An(J.buffer)}catch(Xa){nt._errorSteps(Xa);return}let Hs={buffer:bs,bufferByteLength:bs.byteLength,byteOffset:or,byteLength:ji,bytesFilled:0,minimumFill:ei,elementSize:cn,viewConstructor:Kt,readerType:"byob"};if(Q._pendingPullIntos.length>0){Q._pendingPullIntos.push(Hs),Hn(bt,nt);return}if(bt._state==="closed"){let Xa=new Kt(Hs.buffer,Hs.byteOffset,0);nt._closeSteps(Xa);return}if(Q._queueTotalSize>0){if(fn(Q,Hs)){let Xa=Zr(Hs);To(Q),nt._chunkSteps(Xa);return}if(Q._closeRequested){let Xa=new TypeError("Insufficient bytes to fill elements in the given buffer");lr(Q,Xa),nt._errorSteps(Xa);return}}Q._pendingPullIntos.push(Hs),Hn(bt,nt),ai(Q)}function Am(Q,J){J.readerType==="none"&&_c(Q);let Ie=Q._controlledReadableByteStream;if(ci(Ie))for(;bm(Ie)>0;){let nt=_c(Q);bi(Ie,nt)}}function Yd(Q,J,Ie){if(os(Q,J,Ie),Ie.readerType==="none"){Ps(Q,Ie),Yn(Q);return}if(Ie.bytesFilled0){let bt=Ie.byteOffset+Ie.bytesFilled;Uo(Q,Ie.buffer,bt-nt,nt)}Ie.bytesFilled-=nt,bi(Q._controlledReadableByteStream,Ie),Yn(Q)}function ym(Q,J){let Ie=Q._pendingPullIntos.peek();mi(Q),Q._controlledReadableByteStream._state==="closed"?Am(Q,Ie):Yd(Q,J,Ie),ai(Q)}function _c(Q){return Q._pendingPullIntos.shift()}function Jt(Q){let J=Q._controlledReadableByteStream;return J._state!=="readable"||Q._closeRequested||!Q._started?!1:!!(_e(J)&&Te(J)>0||ci(J)&&bm(J)>0||Jn(Q)>0)}function Xt(Q){Q._pullAlgorithm=void 0,Q._cancelAlgorithm=void 0}function Dn(Q){let J=Q._controlledReadableByteStream;if(!(Q._closeRequested||J._state!=="readable")){if(Q._queueTotalSize>0){Q._closeRequested=!0;return}if(Q._pendingPullIntos.length>0){let Ie=Q._pendingPullIntos.peek();if(Ie.bytesFilled%Ie.elementSize!==0){let nt=new TypeError("Insufficient bytes to fill elements in the given buffer");throw lr(Q,nt),nt}}Xt(Q),_T(J)}}function Wn(Q,J){let Ie=Q._controlledReadableByteStream;if(Q._closeRequested||Ie._state!=="readable")return;let{buffer:nt,byteOffset:bt,byteLength:Kt}=J;if(Fn(nt))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let cn=An(nt);if(Q._pendingPullIntos.length>0){let or=Q._pendingPullIntos.peek();if(Fn(or.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");mi(Q),or.buffer=An(or.buffer),or.readerType==="none"&&Ps(Q,or)}if(_e(Ie))if(Sp(Q),Te(Ie)===0)Wr(Q,cn,bt,Kt);else{Q._pendingPullIntos.length>0&&_c(Q);let or=new Uint8Array(cn,bt,Kt);be(Ie,or,!1)}else ci(Ie)?(Wr(Q,cn,bt,Kt),Yn(Q)):Wr(Q,cn,bt,Kt);ai(Q)}function lr(Q,J){let Ie=Q._controlledReadableByteStream;Ie._state==="readable"&&(pn(Q),vt(Q),Xt(Q),Dle(Ie,J))}function Qr(Q,J){let Ie=Q._queue.shift();Q._queueTotalSize-=Ie.byteLength,To(Q);let nt=new Uint8Array(Ie.buffer,Ie.byteOffset,Ie.byteLength);J._chunkSteps(nt)}function Sr(Q){if(Q._byobRequest===null&&Q._pendingPullIntos.length>0){let J=Q._pendingPullIntos.peek(),Ie=new Uint8Array(J.buffer,J.byteOffset+J.bytesFilled,J.byteLength-J.bytesFilled),nt=Object.create(yn.prototype);Ms(nt,Q,Ie),Q._byobRequest=nt}return Q._byobRequest}function Jn(Q){let J=Q._controlledReadableByteStream._state;return J==="errored"?null:J==="closed"?0:Q._strategyHWM-Q._queueTotalSize}function _i(Q,J){let Ie=Q._pendingPullIntos.peek();if(Q._controlledReadableByteStream._state==="closed"){if(J!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(J===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(Ie.bytesFilled+J>Ie.byteLength)throw new RangeError("bytesWritten out of range")}Ie.buffer=An(Ie.buffer),ym(Q,J)}function mn(Q,J){let Ie=Q._pendingPullIntos.peek();if(Q._controlledReadableByteStream._state==="closed"){if(J.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(J.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(Ie.byteOffset+Ie.bytesFilled!==J.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(Ie.bufferByteLength!==J.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(Ie.bytesFilled+J.byteLength>Ie.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let bt=J.byteLength;Ie.buffer=An(J.buffer),ym(Q,bt)}function $s(Q,J,Ie,nt,bt,Kt,cn){J._controlledReadableByteStream=Q,J._pullAgain=!1,J._pulling=!1,J._byobRequest=null,J._queue=J._queueTotalSize=void 0,vt(J),J._closeRequested=!1,J._started=!1,J._strategyHWM=Kt,J._pullAlgorithm=nt,J._cancelAlgorithm=bt,J._autoAllocateChunkSize=cn,J._pendingPullIntos=new C,Q._readableStreamController=J;let or=Ie();m(u(or),()=>(J._started=!0,ai(J),null),ji=>(lr(J,ji),null))}function Nr(Q,J,Ie){let nt=Object.create(xn.prototype),bt,Kt,cn;J.start!==void 0?bt=()=>J.start(nt):bt=()=>{},J.pull!==void 0?Kt=()=>J.pull(nt):Kt=()=>u(void 0),J.cancel!==void 0?cn=ji=>J.cancel(ji):cn=()=>u(void 0);let or=J.autoAllocateChunkSize;if(or===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");$s(Q,nt,bt,Kt,cn,Ie,or)}function Ms(Q,J,Ie){Q._associatedReadableByteStreamController=J,Q._view=Ie}function ga(Q){return new TypeError(`ReadableStreamBYOBRequest.prototype.${Q} can only be used on a ReadableStreamBYOBRequest`)}function va(Q){return new TypeError(`ReadableByteStreamController.prototype.${Q} can only be used on a ReadableByteStreamController`)}function Dr(Q,J){ie(Q,J);let Ie=Q?.mode;return{mode:Ie===void 0?void 0:Ra(Ie,`${J} has member 'mode' that`)}}function Ra(Q,J){if(Q=`${Q}`,Q!=="byob")throw new TypeError(`${J} '${Q}' is not a valid enumeration value for ReadableStreamReaderMode`);return Q}function ka(Q,J){var Ie;ie(Q,J);let nt=(Ie=Q?.min)!==null&&Ie!==void 0?Ie:1;return{min:ge(nt,`${J} has member 'min' that`)}}function Cp(Q){return new Ip(Q)}function Hn(Q,J){Q._reader._readIntoRequests.push(J)}function Em(Q,J,Ie){let bt=Q._reader._readIntoRequests.shift();Ie?bt._closeSteps(J):bt._chunkSteps(J)}function bm(Q){return Q._reader._readIntoRequests.length}function ci(Q){let J=Q._reader;return!(J===void 0||!_m(J))}class Ip{constructor(J){if(te(J,1,"ReadableStreamBYOBReader"),ue(J,"First parameter"),VS(J))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ir(J._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");W(this,J),this._readIntoRequests=new C}get closed(){return _m(this)?this._closedPromise:l(fh("closed"))}cancel(J=void 0){return _m(this)?this._ownerReadableStream===void 0?l(q("cancel")):$(this,J):l(fh("cancel"))}read(J,Ie={}){if(!_m(this))return l(fh("read"));if(!ArrayBuffer.isView(J))return l(new TypeError("view must be an array buffer view"));if(J.byteLength===0)return l(new TypeError("view must have non-zero byteLength"));if(J.buffer.byteLength===0)return l(new TypeError("view's buffer must have non-zero byteLength"));if(Fn(J.buffer))return l(new TypeError("view's buffer has been detached"));let nt;try{nt=ka(Ie,"options")}catch(ei){return l(ei)}let bt=nt.min;if(bt===0)return l(new TypeError("options.min must be greater than 0"));if(Bt(J)){if(bt>J.byteLength)return l(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(bt>J.length)return l(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return l(q("read from"));let Kt,cn,or=c((ei,bs)=>{Kt=ei,cn=bs});return m_(this,J,bt,{_chunkSteps:ei=>Kt({value:ei,done:!1}),_closeSteps:ei=>Kt({value:ei,done:!0}),_errorSteps:ei=>cn(ei)}),or}releaseLock(){if(!_m(this))throw fh("releaseLock");this._ownerReadableStream!==void 0&&xc(this)}}Object.defineProperties(Ip.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(Ip.prototype.cancel,"cancel"),i(Ip.prototype.read,"read"),i(Ip.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ip.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function _m(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_readIntoRequests")?!1:Q instanceof Ip}function m_(Q,J,Ie,nt){let bt=Q._ownerReadableStream;bt._disturbed=!0,bt._state==="errored"?nt._errorSteps(bt._storedError):Vd(bt._readableStreamController,J,Ie,nt)}function xc(Q){G(Q);let J=new TypeError("Reader was released");mu(Q,J)}function mu(Q,J){let Ie=Q._readIntoRequests;Q._readIntoRequests=new C,Ie.forEach(nt=>{nt._errorSteps(J)})}function fh(Q){return new TypeError(`ReadableStreamBYOBReader.prototype.${Q} can only be used on a ReadableStreamBYOBReader`)}function zd(Q,J){let{highWaterMark:Ie}=Q;if(Ie===void 0)return J;if(Xe(Ie)||Ie<0)throw new RangeError("Invalid highWaterMark");return Ie}function zc(Q){let{size:J}=Q;return J||(()=>1)}function Af(Q,J){ie(Q,J);let Ie=Q?.highWaterMark,nt=Q?.size;return{highWaterMark:Ie===void 0?void 0:ee(Ie),size:nt===void 0?void 0:WS(nt,`${J} has member 'size' that`)}}function WS(Q,J){return oe(Q,J),Ie=>ee(Q(Ie))}function XE(Q,J){ie(Q,J);let Ie=Q?.abort,nt=Q?.close,bt=Q?.start,Kt=Q?.type,cn=Q?.write;return{abort:Ie===void 0?void 0:Vu(Ie,Q,`${J} has member 'abort' that`),close:nt===void 0?void 0:ZE(nt,Q,`${J} has member 'close' that`),start:bt===void 0?void 0:gT(bt,Q,`${J} has member 'start' that`),write:cn===void 0?void 0:h_(cn,Q,`${J} has member 'write' that`),type:Kt}}function Vu(Q,J,Ie){return oe(Q,Ie),nt=>_(Q,J,[nt])}function ZE(Q,J,Ie){return oe(Q,Ie),()=>_(Q,J,[])}function gT(Q,J,Ie){return oe(Q,Ie),nt=>E(Q,J,[nt])}function h_(Q,J,Ie){return oe(Q,Ie),(nt,bt)=>_(Q,J,[nt,bt])}function gd(Q,J){if(!le(Q))throw new TypeError(`${J} is not a WritableStream.`)}function YA(Q){if(typeof Q!="object"||Q===null)return!1;try{return typeof Q.aborted=="boolean"}catch{return!1}}let Gk=typeof AbortController=="function";function Be(){if(Gk)return new AbortController}class b{constructor(J={},Ie={}){J===void 0?J=null:Z(J,"First parameter");let nt=Af(Ie,"Second parameter"),bt=XE(J,"First parameter");if(U(this),bt.type!==void 0)throw new RangeError("Invalid type is specified");let cn=zc(nt),or=zd(nt,1);yf(this,bt,or,cn)}get locked(){if(!le(this))throw Tp("locked");return ve(this)}abort(J=void 0){return le(this)?ve(this)?l(new TypeError("Cannot abort a stream that already has a writer")):Oe(this,J):l(Tp("abort"))}close(){return le(this)?ve(this)?l(new TypeError("Cannot close a stream that already has a writer")):Or(this)?l(new TypeError("Cannot close an already-closing stream")):Ye(this):l(Tp("close"))}getWriter(){if(!le(this))throw Tp("getWriter");return R(this)}}Object.defineProperties(b.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(b.prototype.abort,"abort"),i(b.prototype.close,"close"),i(b.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(b.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function R(Q){return new H(Q)}function P(Q,J,Ie,nt,bt=1,Kt=()=>1){let cn=Object.create(b.prototype);U(cn);let or=Object.create(vo.prototype);return Lg(cn,or,Q,J,Ie,nt,bt,Kt),cn}function U(Q){Q._state="writable",Q._storedError=void 0,Q._writer=void 0,Q._writableStreamController=void 0,Q._writeRequests=new C,Q._inFlightWriteRequest=void 0,Q._closeRequest=void 0,Q._inFlightCloseRequest=void 0,Q._pendingAbortRequest=void 0,Q._backpressure=!1}function le(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_writableStreamController")?!1:Q instanceof b}function ve(Q){return Q._writer!==void 0}function Oe(Q,J){var Ie;if(Q._state==="closed"||Q._state==="errored")return u(void 0);Q._writableStreamController._abortReason=J,(Ie=Q._writableStreamController._abortController)===null||Ie===void 0||Ie.abort(J);let nt=Q._state;if(nt==="closed"||nt==="errored")return u(void 0);if(Q._pendingAbortRequest!==void 0)return Q._pendingAbortRequest._promise;let bt=!1;nt==="erroring"&&(bt=!0,J=void 0);let Kt=c((cn,or)=>{Q._pendingAbortRequest={_promise:void 0,_resolve:cn,_reject:or,_reason:J,_wasAlreadyErroring:bt}});return Q._pendingAbortRequest._promise=Kt,bt||an(Q,J),Kt}function Ye(Q){let J=Q._state;if(J==="closed"||J==="errored")return l(new TypeError(`The stream (in ${J} state) is not in the writable state and cannot be closed`));let Ie=c((bt,Kt)=>{let cn={_resolve:bt,_reject:Kt};Q._closeRequest=cn}),nt=Q._writer;return nt!==void 0&&Q._backpressure&&J==="writable"&&QG(nt),xm(Q._writableStreamController),Ie}function Ve(Q){return c((Ie,nt)=>{let bt={_resolve:Ie,_reject:nt};Q._writeRequests.push(bt)})}function Rt(Q,J){if(Q._state==="writable"){an(Q,J);return}sr(Q)}function an(Q,J){let Ie=Q._writableStreamController;Q._state="erroring",Q._storedError=J;let nt=Q._writer;nt!==void 0&&Yt(nt,J),!Ba(Q)&&Ie._started&&sr(Q)}function sr(Q){Q._state="errored",Q._writableStreamController[w]();let J=Q._storedError;if(Q._writeRequests.forEach(bt=>{bt._reject(J)}),Q._writeRequests=new C,Q._pendingAbortRequest===void 0){yT(Q);return}let Ie=Q._pendingAbortRequest;if(Q._pendingAbortRequest=void 0,Ie._wasAlreadyErroring){Ie._reject(J),yT(Q);return}let nt=Q._writableStreamController[I](Ie._reason);m(nt,()=>(Ie._resolve(),yT(Q),null),bt=>(Ie._reject(bt),yT(Q),null))}function Nn(Q){Q._inFlightWriteRequest._resolve(void 0),Q._inFlightWriteRequest=void 0}function Pr(Q,J){Q._inFlightWriteRequest._reject(J),Q._inFlightWriteRequest=void 0,Rt(Q,J)}function oo(Q){Q._inFlightCloseRequest._resolve(void 0),Q._inFlightCloseRequest=void 0,Q._state==="erroring"&&(Q._storedError=void 0,Q._pendingAbortRequest!==void 0&&(Q._pendingAbortRequest._resolve(),Q._pendingAbortRequest=void 0)),Q._state="closed";let Ie=Q._writer;Ie!==void 0&&xle(Ie)}function Ko(Q,J){Q._inFlightCloseRequest._reject(J),Q._inFlightCloseRequest=void 0,Q._pendingAbortRequest!==void 0&&(Q._pendingAbortRequest._reject(J),Q._pendingAbortRequest=void 0),Rt(Q,J)}function Or(Q){return!(Q._closeRequest===void 0&&Q._inFlightCloseRequest===void 0)}function Ba(Q){return!(Q._inFlightWriteRequest===void 0&&Q._inFlightCloseRequest===void 0)}function gh(Q){Q._inFlightCloseRequest=Q._closeRequest,Q._closeRequest=void 0}function AT(Q){Q._inFlightWriteRequest=Q._writeRequests.shift()}function yT(Q){Q._closeRequest!==void 0&&(Q._closeRequest._reject(Q._storedError),Q._closeRequest=void 0);let J=Q._writer;J!==void 0&&FG(J,Q._storedError)}function B(Q,J){let Ie=Q._writer;Ie!==void 0&&J!==Q._backpressure&&(J?jOe(Ie):QG(Ie)),Q._backpressure=J}class H{constructor(J){if(te(J,1,"WritableStreamDefaultWriter"),gd(J,"First parameter"),ve(J))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=J,J._writer=this;let Ie=J._state;if(Ie==="writable")!Or(J)&&J._backpressure?Hk(this):f_(this),xM(this);else if(Ie==="erroring")Kd(this,J._storedError),xM(this);else if(Ie==="closed")f_(this),_le(this);else{let nt=J._storedError;Kd(this,nt),ble(this,nt)}}get closed(){return pe(this)?this._closedPromise:l(KA("closed"))}get desiredSize(){if(!pe(this))throw KA("desiredSize");if(this._ownerWritableStream===void 0)throw _M("desiredSize");return Gn(this)}get ready(){return pe(this)?this._readyPromise:l(KA("ready"))}abort(J=void 0){return pe(this)?this._ownerWritableStream===void 0?l(_M("abort")):xe(this,J):l(KA("abort"))}close(){if(!pe(this))return l(KA("close"));let J=this._ownerWritableStream;return J===void 0?l(_M("close")):Or(J)?l(new TypeError("Cannot close an already-closing stream")):We(this)}releaseLock(){if(!pe(this))throw KA("releaseLock");this._ownerWritableStream!==void 0&&yr(this)}write(J=void 0){return pe(this)?this._ownerWritableStream===void 0?l(_M("write to")):Ur(this,J):l(KA("write"))}}Object.defineProperties(H.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(H.prototype.abort,"abort"),i(H.prototype.close,"close"),i(H.prototype.releaseLock,"releaseLock"),i(H.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(H.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function pe(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_ownerWritableStream")?!1:Q instanceof H}function xe(Q,J){let Ie=Q._ownerWritableStream;return Oe(Ie,J)}function We(Q){let J=Q._ownerWritableStream;return Ye(J)}function At(Q){let J=Q._ownerWritableStream,Ie=J._state;return Or(J)||Ie==="closed"?u(void 0):Ie==="errored"?l(J._storedError):We(Q)}function kt(Q,J){Q._closedPromiseState==="pending"?FG(Q,J):qOe(Q,J)}function Yt(Q,J){Q._readyPromiseState==="pending"?SM(Q,J):h6(Q,J)}function Gn(Q){let J=Q._ownerWritableStream,Ie=J._state;return Ie==="errored"||Ie==="erroring"?null:Ie==="closed"?0:ao(J._writableStreamController)}function yr(Q){let J=Q._ownerWritableStream,Ie=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Yt(Q,Ie),kt(Q,Ie),J._writer=void 0,Q._ownerWritableStream=void 0}function Ur(Q,J){let Ie=Q._ownerWritableStream,nt=Ie._writableStreamController,bt=Cr(nt,J);if(Ie!==Q._ownerWritableStream)return l(_M("write to"));let Kt=Ie._state;if(Kt==="errored")return l(Ie._storedError);if(Or(Ie)||Kt==="closed")return l(new TypeError("The stream is closing or closed and cannot be written to"));if(Kt==="erroring")return l(Ie._storedError);let cn=Ve(Ie);return Go(nt,J,bt),cn}let Ws={};class vo{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Al(this))throw Wk("abortReason");return this._abortReason}get signal(){if(!Al(this))throw Wk("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(J=void 0){if(!Al(this))throw Wk("error");this._controlledWritableStream._state==="writable"&&Fg(this,J)}[I](J){let Ie=this._abortAlgorithm(J);return wp(this),Ie}[w](){vt(this)}}Object.defineProperties(vo.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(vo.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Al(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_controlledWritableStream")?!1:Q instanceof vo}function Lg(Q,J,Ie,nt,bt,Kt,cn,or){J._controlledWritableStream=Q,Q._writableStreamController=J,J._queue=void 0,J._queueTotalSize=void 0,vt(J),J._abortReason=void 0,J._abortController=Be(),J._started=!1,J._strategySizeAlgorithm=or,J._strategyHWM=cn,J._writeAlgorithm=nt,J._closeAlgorithm=bt,J._abortAlgorithm=Kt;let ji=yd(J);B(Q,ji);let ei=Ie(),bs=u(ei);m(bs,()=>(J._started=!0,Ad(J),null),Hs=>(J._started=!0,Rt(Q,Hs),null))}function yf(Q,J,Ie,nt){let bt=Object.create(vo.prototype),Kt,cn,or,ji;J.start!==void 0?Kt=()=>J.start(bt):Kt=()=>{},J.write!==void 0?cn=ei=>J.write(ei,bt):cn=()=>u(void 0),J.close!==void 0?or=()=>J.close():or=()=>u(void 0),J.abort!==void 0?ji=ei=>J.abort(ei):ji=()=>u(void 0),Lg(Q,bt,Kt,cn,or,ji,Ie,nt)}function wp(Q){Q._writeAlgorithm=void 0,Q._closeAlgorithm=void 0,Q._abortAlgorithm=void 0,Q._strategySizeAlgorithm=void 0}function xm(Q){lt(Q,Ws,0),Ad(Q)}function Cr(Q,J){try{return Q._strategySizeAlgorithm(J)}catch(Ie){return yl(Q,Ie),1}}function ao(Q){return Q._strategyHWM-Q._queueTotalSize}function Go(Q,J,Ie){try{lt(Q,J,Ie)}catch(bt){yl(Q,bt);return}let nt=Q._controlledWritableStream;if(!Or(nt)&&nt._state==="writable"){let bt=yd(Q);B(nt,bt)}Ad(Q)}function Ad(Q){let J=Q._controlledWritableStream;if(!Q._started||J._inFlightWriteRequest!==void 0)return;if(J._state==="erroring"){sr(J);return}if(Q._queue.length===0)return;let nt=Ge(Q);nt===Ws?$k(Q):zA(Q,nt)}function yl(Q,J){Q._controlledWritableStream._state==="writable"&&Fg(Q,J)}function $k(Q){let J=Q._controlledWritableStream;gh(J),Ue(Q);let Ie=Q._closeAlgorithm();wp(Q),m(Ie,()=>(oo(J),null),nt=>(Ko(J,nt),null))}function zA(Q,J){let Ie=Q._controlledWritableStream;AT(Ie);let nt=Q._writeAlgorithm(J);m(nt,()=>{Nn(Ie);let bt=Ie._state;if(Ue(Q),!Or(Ie)&&bt==="writable"){let Kt=yd(Q);B(Ie,Kt)}return Ad(Q),null},bt=>(Ie._state==="writable"&&wp(Q),Pr(Ie,bt),null))}function yd(Q){return ao(Q)<=0}function Fg(Q,J){let Ie=Q._controlledWritableStream;wp(Q),an(Ie,J)}function Tp(Q){return new TypeError(`WritableStream.prototype.${Q} can only be used on a WritableStream`)}function Wk(Q){return new TypeError(`WritableStreamDefaultController.prototype.${Q} can only be used on a WritableStreamDefaultController`)}function KA(Q){return new TypeError(`WritableStreamDefaultWriter.prototype.${Q} can only be used on a WritableStreamDefaultWriter`)}function _M(Q){return new TypeError("Cannot "+Q+" a stream using a released writer")}function xM(Q){Q._closedPromise=c((J,Ie)=>{Q._closedPromise_resolve=J,Q._closedPromise_reject=Ie,Q._closedPromiseState="pending"})}function ble(Q,J){xM(Q),FG(Q,J)}function _le(Q){xM(Q),xle(Q)}function FG(Q,J){Q._closedPromise_reject!==void 0&&(A(Q._closedPromise),Q._closedPromise_reject(J),Q._closedPromise_resolve=void 0,Q._closedPromise_reject=void 0,Q._closedPromiseState="rejected")}function qOe(Q,J){ble(Q,J)}function xle(Q){Q._closedPromise_resolve!==void 0&&(Q._closedPromise_resolve(void 0),Q._closedPromise_resolve=void 0,Q._closedPromise_reject=void 0,Q._closedPromiseState="resolved")}function Hk(Q){Q._readyPromise=c((J,Ie)=>{Q._readyPromise_resolve=J,Q._readyPromise_reject=Ie}),Q._readyPromiseState="pending"}function Kd(Q,J){Hk(Q),SM(Q,J)}function f_(Q){Hk(Q),QG(Q)}function SM(Q,J){Q._readyPromise_reject!==void 0&&(A(Q._readyPromise),Q._readyPromise_reject(J),Q._readyPromise_resolve=void 0,Q._readyPromise_reject=void 0,Q._readyPromiseState="rejected")}function jOe(Q){Hk(Q)}function h6(Q,J){Kd(Q,J)}function QG(Q){Q._readyPromise_resolve!==void 0&&(Q._readyPromise_resolve(void 0),Q._readyPromise_resolve=void 0,Q._readyPromise_reject=void 0,Q._readyPromiseState="fulfilled")}function VOe(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}let UG=VOe();function f6(Q){if(!(typeof Q=="function"||typeof Q=="object")||Q.name!=="DOMException")return!1;try{return new Q,!0}catch{return!1}}function fCt(){let Q=UG?.DOMException;return f6(Q)?Q:void 0}function YOe(){let Q=function(Ie,nt){this.message=Ie||"",this.name=nt||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return i(Q,"DOMException"),Q.prototype=Object.create(Error.prototype),Object.defineProperty(Q.prototype,"constructor",{value:Q,writable:!0,configurable:!0}),Q}let gCt=fCt()||YOe();function g6(Q,J,Ie,nt,bt,Kt){let cn=ye(Q),or=R(J);Q._disturbed=!0;let ji=!1,ei=u(void 0);return c((bs,Hs)=>{let Xa;if(Kt!==void 0){if(Xa=()=>{let hi=Kt.reason!==void 0?Kt.reason:new gCt("Aborted","AbortError"),Ao=[];nt||Ao.push(()=>J._state==="writable"?Oe(J,hi):u(void 0)),bt||Ao.push(()=>Q._state==="readable"?Ef(Q,hi):u(void 0)),Qg(()=>Promise.all(Ao.map(Sc=>Sc())),!0,hi)},Kt.aborted){Xa();return}Kt.addEventListener("abort",Xa)}function E_(){return c((hi,Ao)=>{function Sc(ZA){ZA?hi():d(jG(),Sc,Ao)}Sc(!1)})}function jG(){return ji?u(!0):d(or._readyPromise,()=>c((hi,Ao)=>{He(cn,{_chunkSteps:Sc=>{ei=d(Ur(or,Sc),void 0,e),hi(!1)},_closeSteps:()=>hi(!0),_errorSteps:Ao})}))}if(ST(Q,cn._closedPromise,hi=>(nt?n0(!0,hi):Qg(()=>Oe(J,hi),!0,hi),null)),ST(J,or._closedPromise,hi=>(bt?n0(!0,hi):Qg(()=>Ef(Q,hi),!0,hi),null)),bf(Q,cn._closedPromise,()=>(Ie?n0():Qg(()=>At(or)),null)),Or(J)||J._state==="closed"){let hi=new TypeError("the destination writable stream closed before all data could be piped to it");bt?n0(!0,hi):Qg(()=>Ef(Q,hi),!0,hi)}A(E_());function Kk(){let hi=ei;return d(ei,()=>hi!==ei?Kk():void 0)}function ST(hi,Ao,Sc){hi._state==="errored"?Sc(hi._storedError):f(Ao,Sc)}function bf(hi,Ao,Sc){hi._state==="closed"?Sc():h(Ao,Sc)}function Qg(hi,Ao,Sc){if(ji)return;ji=!0,J._state==="writable"&&!Or(J)?h(Kk(),ZA):ZA();function ZA(){return m(hi(),()=>CT(Ao,Sc),VG=>CT(!0,VG)),null}}function n0(hi,Ao){ji||(ji=!0,J._state==="writable"&&!Or(J)?h(Kk(),()=>CT(hi,Ao)):CT(hi,Ao))}function CT(hi,Ao){return yr(or),G(cn),Kt!==void 0&&Kt.removeEventListener("abort",Xa),hi?Hs(Ao):bs(void 0),null}})}class g_{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!GG(this))throw WG("desiredSize");return as(this)}close(){if(!GG(this))throw WG("close");if(!XA(this))throw new TypeError("The stream is not in a state that permits close");ET(this)}enqueue(J=void 0){if(!GG(this))throw WG("enqueue");if(!XA(this))throw new TypeError("The stream is not in a state that permits enqueue");return qk(this,J)}error(J=void 0){if(!GG(this))throw WG("error");JA(this,J)}[k](J){vt(this);let Ie=this._cancelAlgorithm(J);return $G(this),Ie}[N](J){let Ie=this._controlledReadableStream;if(this._queue.length>0){let nt=Ue(this);this._closeRequested&&this._queue.length===0?($G(this),_T(Ie)):CM(this),J._chunkSteps(nt)}else Se(Ie,J),CM(this)}[O](){}}Object.defineProperties(g_.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(g_.prototype.close,"close"),i(g_.prototype.enqueue,"enqueue"),i(g_.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(g_.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function GG(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_controlledReadableStream")?!1:Q instanceof g_}function CM(Q){if(!Sle(Q))return;if(Q._pulling){Q._pullAgain=!0;return}Q._pulling=!0;let Ie=Q._pullAlgorithm();m(Ie,()=>(Q._pulling=!1,Q._pullAgain&&(Q._pullAgain=!1,CM(Q)),null),nt=>(JA(Q,nt),null))}function Sle(Q){let J=Q._controlledReadableStream;return!XA(Q)||!Q._started?!1:!!(VS(J)&&Te(J)>0||as(Q)>0)}function $G(Q){Q._pullAlgorithm=void 0,Q._cancelAlgorithm=void 0,Q._strategySizeAlgorithm=void 0}function ET(Q){if(!XA(Q))return;let J=Q._controlledReadableStream;Q._closeRequested=!0,Q._queue.length===0&&($G(Q),_T(J))}function qk(Q,J){if(!XA(Q))return;let Ie=Q._controlledReadableStream;if(VS(Ie)&&Te(Ie)>0)be(Ie,J,!1);else{let nt;try{nt=Q._strategySizeAlgorithm(J)}catch(bt){throw JA(Q,bt),bt}try{lt(Q,J,nt)}catch(bt){throw JA(Q,bt),bt}}CM(Q)}function JA(Q,J){let Ie=Q._controlledReadableStream;Ie._state==="readable"&&(vt(Q),$G(Q),Dle(Ie,J))}function as(Q){let J=Q._controlledReadableStream._state;return J==="errored"?null:J==="closed"?0:Q._strategyHWM-Q._queueTotalSize}function Cle(Q){return!Sle(Q)}function XA(Q){let J=Q._controlledReadableStream._state;return!Q._closeRequested&&J==="readable"}function IM(Q,J,Ie,nt,bt,Kt,cn){J._controlledReadableStream=Q,J._queue=void 0,J._queueTotalSize=void 0,vt(J),J._started=!1,J._closeRequested=!1,J._pullAgain=!1,J._pulling=!1,J._strategySizeAlgorithm=cn,J._strategyHWM=Kt,J._pullAlgorithm=nt,J._cancelAlgorithm=bt,Q._readableStreamController=J;let or=Ie();m(u(or),()=>(J._started=!0,CM(J),null),ji=>(JA(J,ji),null))}function Ile(Q,J,Ie,nt){let bt=Object.create(g_.prototype),Kt,cn,or;J.start!==void 0?Kt=()=>J.start(bt):Kt=()=>{},J.pull!==void 0?cn=()=>J.pull(bt):cn=()=>u(void 0),J.cancel!==void 0?or=ji=>J.cancel(ji):or=()=>u(void 0),IM(Q,bt,Kt,cn,or,Ie,nt)}function WG(Q){return new TypeError(`ReadableStreamDefaultController.prototype.${Q} can only be used on a ReadableStreamDefaultController`)}function zOe(Q,J){return ir(Q._readableStreamController)?Tle(Q):wle(Q)}function wle(Q,J){let Ie=ye(Q),nt=!1,bt=!1,Kt=!1,cn=!1,or,ji,ei,bs,Hs,Xa=c(bf=>{Hs=bf});function E_(){return nt?(bt=!0,u(void 0)):(nt=!0,He(Ie,{_chunkSteps:Qg=>{y(()=>{bt=!1;let n0=Qg,CT=Qg;Kt||qk(ei._readableStreamController,n0),cn||qk(bs._readableStreamController,CT),nt=!1,bt&&E_()})},_closeSteps:()=>{nt=!1,Kt||ET(ei._readableStreamController),cn||ET(bs._readableStreamController),(!Kt||!cn)&&Hs(void 0)},_errorSteps:()=>{nt=!1}}),u(void 0))}function jG(bf){if(Kt=!0,or=bf,cn){let Qg=Vt([or,ji]),n0=Ef(Q,Qg);Hs(n0)}return Xa}function Kk(bf){if(cn=!0,ji=bf,Kt){let Qg=Vt([or,ji]),n0=Ef(Q,Qg);Hs(n0)}return Xa}function ST(){}return ei=HS(ST,E_,jG),bs=HS(ST,E_,Kk),f(Ie._closedPromise,bf=>(JA(ei._readableStreamController,bf),JA(bs._readableStreamController,bf),(!Kt||!cn)&&Hs(void 0),null)),[ei,bs]}function Tle(Q){let J=ye(Q),Ie=!1,nt=!1,bt=!1,Kt=!1,cn=!1,or,ji,ei,bs,Hs,Xa=c(hi=>{Hs=hi});function E_(hi){f(hi._closedPromise,Ao=>(hi!==J||(lr(ei._readableStreamController,Ao),lr(bs._readableStreamController,Ao),(!Kt||!cn)&&Hs(void 0)),null))}function jG(){_m(J)&&(G(J),J=ye(Q),E_(J)),He(J,{_chunkSteps:Ao=>{y(()=>{nt=!1,bt=!1;let Sc=Ao,ZA=Ao;if(!Kt&&!cn)try{ZA=ke(Ao)}catch(VG){lr(ei._readableStreamController,VG),lr(bs._readableStreamController,VG),Hs(Ef(Q,VG));return}Kt||Wn(ei._readableStreamController,Sc),cn||Wn(bs._readableStreamController,ZA),Ie=!1,nt?ST():bt&&bf()})},_closeSteps:()=>{Ie=!1,Kt||Dn(ei._readableStreamController),cn||Dn(bs._readableStreamController),ei._readableStreamController._pendingPullIntos.length>0&&_i(ei._readableStreamController,0),bs._readableStreamController._pendingPullIntos.length>0&&_i(bs._readableStreamController,0),(!Kt||!cn)&&Hs(void 0)},_errorSteps:()=>{Ie=!1}})}function Kk(hi,Ao){$e(J)&&(G(J),J=Cp(Q),E_(J));let Sc=Ao?bs:ei,ZA=Ao?ei:bs;m_(J,hi,1,{_chunkSteps:YG=>{y(()=>{nt=!1,bt=!1;let zG=Ao?cn:Kt;if(Ao?Kt:cn)zG||mn(Sc._readableStreamController,YG);else{let ECt;try{ECt=ke(YG)}catch(XOe){lr(Sc._readableStreamController,XOe),lr(ZA._readableStreamController,XOe),Hs(Ef(Q,XOe));return}zG||mn(Sc._readableStreamController,YG),Wn(ZA._readableStreamController,ECt)}Ie=!1,nt?ST():bt&&bf()})},_closeSteps:YG=>{Ie=!1;let zG=Ao?cn:Kt,Ule=Ao?Kt:cn;zG||Dn(Sc._readableStreamController),Ule||Dn(ZA._readableStreamController),YG!==void 0&&(zG||mn(Sc._readableStreamController,YG),!Ule&&ZA._readableStreamController._pendingPullIntos.length>0&&_i(ZA._readableStreamController,0)),(!zG||!Ule)&&Hs(void 0)},_errorSteps:()=>{Ie=!1}})}function ST(){if(Ie)return nt=!0,u(void 0);Ie=!0;let hi=Sr(ei._readableStreamController);return hi===null?jG():Kk(hi._view,!1),u(void 0)}function bf(){if(Ie)return bt=!0,u(void 0);Ie=!0;let hi=Sr(bs._readableStreamController);return hi===null?jG():Kk(hi._view,!0),u(void 0)}function Qg(hi){if(Kt=!0,or=hi,cn){let Ao=Vt([or,ji]),Sc=Ef(Q,Ao);Hs(Sc)}return Xa}function n0(hi){if(cn=!0,ji=hi,Kt){let Ao=Vt([or,ji]),Sc=Ef(Q,Ao);Hs(Sc)}return Xa}function CT(){}return ei=qS(CT,ST,Qg),bs=qS(CT,bf,n0),E_(J),[ei,bs]}function vle(Q){return n(Q)&&typeof Q.getReader<"u"}function El(Q){return vle(Q)?jk(Q.getReader()):A_(Q)}function A_(Q){let J,Ie=dt(Q,"async"),nt=e;function bt(){let cn;try{cn=gt(Ie)}catch(ji){return l(ji)}let or=u(cn);return g(or,ji=>{if(!n(ji))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(tt(ji))ET(J._readableStreamController);else{let bs=Dt(ji);qk(J._readableStreamController,bs)}})}function Kt(cn){let or=Ie.iterator,ji;try{ji=ht(or,"return")}catch(Hs){return l(Hs)}if(ji===void 0)return u(void 0);let ei;try{ei=E(ji,or,[cn])}catch(Hs){return l(Hs)}let bs=u(ei);return g(bs,Hs=>{if(!n(Hs))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return J=HS(nt,bt,Kt,0),J}function jk(Q){let J,Ie=e;function nt(){let Kt;try{Kt=Q.read()}catch(cn){return l(cn)}return g(Kt,cn=>{if(!n(cn))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(cn.done)ET(J._readableStreamController);else{let or=cn.value;qk(J._readableStreamController,or)}})}function bt(Kt){try{return u(Q.cancel(Kt))}catch(cn){return l(cn)}}return J=HS(Ie,nt,bt,0),J}function e0(Q,J){ie(Q,J);let Ie=Q,nt=Ie?.autoAllocateChunkSize,bt=Ie?.cancel,Kt=Ie?.pull,cn=Ie?.start,or=Ie?.type;return{autoAllocateChunkSize:nt===void 0?void 0:ge(nt,`${J} has member 'autoAllocateChunkSize' that`),cancel:bt===void 0?void 0:bT(bt,Ie,`${J} has member 'cancel' that`),pull:Kt===void 0?void 0:Rle(Kt,Ie,`${J} has member 'pull' that`),start:cn===void 0?void 0:kle(cn,Ie,`${J} has member 'start' that`),type:or===void 0?void 0:Vk(or,`${J} has member 'type' that`)}}function bT(Q,J,Ie){return oe(Q,Ie),nt=>_(Q,J,[nt])}function Rle(Q,J,Ie){return oe(Q,Ie),nt=>_(Q,J,[nt])}function kle(Q,J,Ie){return oe(Q,Ie),nt=>E(Q,J,[nt])}function Vk(Q,J){if(Q=`${Q}`,Q!=="bytes")throw new TypeError(`${J} '${Q}' is not a valid enumeration value for ReadableStreamType`);return Q}function A6(Q,J){return ie(Q,J),{preventCancel:!!Q?.preventCancel}}function Ble(Q,J){ie(Q,J);let Ie=Q?.preventAbort,nt=Q?.preventCancel,bt=Q?.preventClose,Kt=Q?.signal;return Kt!==void 0&&Nle(Kt,`${J} has member 'signal' that`),{preventAbort:!!Ie,preventCancel:!!nt,preventClose:!!bt,signal:Kt}}function Nle(Q,J){if(!YA(Q))throw new TypeError(`${J} is not an AbortSignal.`)}function KOe(Q,J){ie(Q,J);let Ie=Q?.readable;V(Ie,"readable","ReadableWritablePair"),ue(Ie,`${J} has member 'readable' that`);let nt=Q?.writable;return V(nt,"writable","ReadableWritablePair"),gd(nt,`${J} has member 'writable' that`),{readable:Ie,writable:nt}}class vp{constructor(J={},Ie={}){J===void 0?J=null:Z(J,"First parameter");let nt=Af(Ie,"Second parameter"),bt=e0(J,"First parameter");if(y6(this),bt.type==="bytes"){if(nt.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let Kt=zd(nt,0);Nr(this,bt,Kt)}else{let Kt=zc(nt),cn=zd(nt,1);Ile(this,bt,cn,Kt)}}get locked(){if(!jS(this))throw YS("locked");return VS(this)}cancel(J=void 0){return jS(this)?VS(this)?l(new TypeError("Cannot cancel a stream that already has a reader")):Ef(this,J):l(YS("cancel"))}getReader(J=void 0){if(!jS(this))throw YS("getReader");return Dr(J,"First parameter").mode===void 0?ye(this):Cp(this)}pipeThrough(J,Ie={}){if(!jS(this))throw YS("pipeThrough");te(J,1,"pipeThrough");let nt=KOe(J,"First parameter"),bt=Ble(Ie,"Second parameter");if(VS(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(ve(nt.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let Kt=g6(this,nt.writable,bt.preventClose,bt.preventAbort,bt.preventCancel,bt.signal);return A(Kt),nt.readable}pipeTo(J,Ie={}){if(!jS(this))return l(YS("pipeTo"));if(J===void 0)return l("Parameter 1 is required in 'pipeTo'.");if(!le(J))return l(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let nt;try{nt=Ble(Ie,"Second parameter")}catch(bt){return l(bt)}return VS(this)?l(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):ve(J)?l(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):g6(this,J,nt.preventClose,nt.preventAbort,nt.preventCancel,nt.signal)}tee(){if(!jS(this))throw YS("tee");let J=zOe(this);return Vt(J)}values(J=void 0){if(!jS(this))throw YS("values");let Ie=A6(J,"First parameter");return Ft(this,Ie.preventCancel)}[Ze](J){return this.values(J)}static from(J){return El(J)}}Object.defineProperties(vp,{from:{enumerable:!0}}),Object.defineProperties(vp.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(vp.from,"from"),i(vp.prototype.cancel,"cancel"),i(vp.prototype.getReader,"getReader"),i(vp.prototype.pipeThrough,"pipeThrough"),i(vp.prototype.pipeTo,"pipeTo"),i(vp.prototype.tee,"tee"),i(vp.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(vp.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(vp.prototype,Ze,{value:vp.prototype.values,writable:!0,configurable:!0});function HS(Q,J,Ie,nt=1,bt=()=>1){let Kt=Object.create(vp.prototype);y6(Kt);let cn=Object.create(g_.prototype);return IM(Kt,cn,Q,J,Ie,nt,bt),Kt}function qS(Q,J,Ie){let nt=Object.create(vp.prototype);y6(nt);let bt=Object.create(xn.prototype);return $s(nt,bt,Q,J,Ie,0,void 0),nt}function y6(Q){Q._state="readable",Q._reader=void 0,Q._storedError=void 0,Q._disturbed=!1}function jS(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_readableStreamController")?!1:Q instanceof vp}function VS(Q){return Q._reader!==void 0}function Ef(Q,J){if(Q._disturbed=!0,Q._state==="closed")return u(void 0);if(Q._state==="errored")return l(Q._storedError);_T(Q);let Ie=Q._reader;if(Ie!==void 0&&_m(Ie)){let bt=Ie._readIntoRequests;Ie._readIntoRequests=new C,bt.forEach(Kt=>{Kt._closeSteps(void 0)})}let nt=Q._readableStreamController[k](J);return g(nt,e)}function _T(Q){Q._state="closed";let J=Q._reader;if(J!==void 0&&(Ae(J),$e(J))){let Ie=J._readRequests;J._readRequests=new C,Ie.forEach(nt=>{nt._closeSteps()})}}function Dle(Q,J){Q._state="errored",Q._storedError=J;let Ie=Q._reader;Ie!==void 0&&(j(Ie,J),$e(Ie)?st(Ie,J):mu(Ie,J))}function YS(Q){return new TypeError(`ReadableStream.prototype.${Q} can only be used on a ReadableStream`)}function T(Q,J){ie(Q,J);let Ie=Q?.highWaterMark;return V(Ie,"highWaterMark","QueuingStrategyInit"),{highWaterMark:ee(Ie)}}let F=Q=>Q.byteLength;i(F,"size");class K{constructor(J){te(J,1,"ByteLengthQueuingStrategy"),J=T(J,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=J.highWaterMark}get highWaterMark(){if(!Re(this))throw de("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Re(this))throw de("size");return F}}Object.defineProperties(K.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(K.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function de(Q){return new TypeError(`ByteLengthQueuingStrategy.prototype.${Q} can only be used on a ByteLengthQueuingStrategy`)}function Re(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_byteLengthQueuingStrategyHighWaterMark")?!1:Q instanceof K}let je=()=>1;i(je,"size");class Ke{constructor(J){te(J,1,"CountQueuingStrategy"),J=T(J,"First parameter"),this._countQueuingStrategyHighWaterMark=J.highWaterMark}get highWaterMark(){if(!Gt(this))throw ot("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Gt(this))throw ot("size");return je}}Object.defineProperties(Ke.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ke.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function ot(Q){return new TypeError(`CountQueuingStrategy.prototype.${Q} can only be used on a CountQueuingStrategy`)}function Gt(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_countQueuingStrategyHighWaterMark")?!1:Q instanceof Ke}function ln(Q,J){ie(Q,J);let Ie=Q?.cancel,nt=Q?.flush,bt=Q?.readableType,Kt=Q?.start,cn=Q?.transform,or=Q?.writableType;return{cancel:Ie===void 0?void 0:si(Ie,Q,`${J} has member 'cancel' that`),flush:nt===void 0?void 0:sn(nt,Q,`${J} has member 'flush' that`),readableType:bt,start:Kt===void 0?void 0:Pn(Kt,Q,`${J} has member 'start' that`),transform:cn===void 0?void 0:Cn(cn,Q,`${J} has member 'transform' that`),writableType:or}}function sn(Q,J,Ie){return oe(Q,Ie),nt=>_(Q,J,[nt])}function Pn(Q,J,Ie){return oe(Q,Ie),nt=>E(Q,J,[nt])}function Cn(Q,J,Ie){return oe(Q,Ie),(nt,bt)=>_(Q,J,[nt,bt])}function si(Q,J,Ie){return oe(Q,Ie),nt=>_(Q,J,[nt])}class eo{constructor(J={},Ie={},nt={}){J===void 0&&(J=null);let bt=Af(Ie,"Second parameter"),Kt=Af(nt,"Third parameter"),cn=ln(J,"First parameter");if(cn.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(cn.writableType!==void 0)throw new RangeError("Invalid writableType specified");let or=zd(Kt,0),ji=zc(Kt),ei=zd(bt,1),bs=zc(bt),Hs,Xa=c(E_=>{Hs=E_});Yu(this,Xa,ei,bs,or,ji),Ple(this,cn),cn.start!==void 0?Hs(cn.start(this._transformStreamController)):Hs(void 0)}get readable(){if(!Es(this))throw yCt("readable");return this._readable}get writable(){if(!Es(this))throw yCt("writable");return this._writable}}Object.defineProperties(eo.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(eo.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function Yu(Q,J,Ie,nt,bt,Kt){function cn(){return J}function or(Xa){return zk(Q,Xa)}function ji(Xa){return Ole(Q,Xa)}function ei(){return Lle(Q)}Q._writable=P(cn,or,ei,ji,Ie,nt);function bs(){return Fle(Q)}function Hs(Xa){return m0r(Q,Xa)}Q._readable=HS(cn,bs,Hs,bt,Kt),Q._backpressure=void 0,Q._backpressureChangePromise=void 0,Q._backpressureChangePromise_resolve=void 0,Yk(Q,!0),Q._transformStreamController=void 0}function Es(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_transformStreamController")?!1:Q instanceof eo}function go(Q,J){JA(Q._readable._readableStreamController,J),qi(Q,J)}function qi(Q,J){wM(Q._transformStreamController),yl(Q._writable._writableStreamController,J),y_(Q)}function y_(Q){Q._backpressure&&Yk(Q,!1)}function Yk(Q,J){Q._backpressureChangePromise!==void 0&&Q._backpressureChangePromise_resolve(),Q._backpressureChangePromise=c(Ie=>{Q._backpressureChangePromise_resolve=Ie}),Q._backpressure=J}class t0{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!xT(this))throw Qle("desiredSize");let J=this._controlledTransformStream._readable._readableStreamController;return as(J)}enqueue(J=void 0){if(!xT(this))throw Qle("enqueue");Mle(this,J)}error(J=void 0){if(!xT(this))throw Qle("error");TM(this,J)}terminate(){if(!xT(this))throw Qle("terminate");ACt(this)}}Object.defineProperties(t0.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(t0.prototype.enqueue,"enqueue"),i(t0.prototype.error,"error"),i(t0.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(t0.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function xT(Q){return!n(Q)||!Object.prototype.hasOwnProperty.call(Q,"_controlledTransformStream")?!1:Q instanceof t0}function HG(Q,J,Ie,nt,bt){J._controlledTransformStream=Q,Q._transformStreamController=J,J._transformAlgorithm=Ie,J._flushAlgorithm=nt,J._cancelAlgorithm=bt,J._finishPromise=void 0,J._finishPromise_resolve=void 0,J._finishPromise_reject=void 0}function Ple(Q,J){let Ie=Object.create(t0.prototype),nt,bt,Kt;J.transform!==void 0?nt=cn=>J.transform(cn,Ie):nt=cn=>{try{return Mle(Ie,cn),u(void 0)}catch(or){return l(or)}},J.flush!==void 0?bt=()=>J.flush(Ie):bt=()=>u(void 0),J.cancel!==void 0?Kt=cn=>J.cancel(cn):Kt=()=>u(void 0),HG(Q,Ie,nt,bt,Kt)}function wM(Q){Q._transformAlgorithm=void 0,Q._flushAlgorithm=void 0,Q._cancelAlgorithm=void 0}function Mle(Q,J){let Ie=Q._controlledTransformStream,nt=Ie._readable._readableStreamController;if(!XA(nt))throw new TypeError("Readable side is not in a state that permits enqueue");try{qk(nt,J)}catch(Kt){throw qi(Ie,Kt),Ie._readable._storedError}Cle(nt)!==Ie._backpressure&&Yk(Ie,!0)}function TM(Q,J){go(Q._controlledTransformStream,J)}function E6(Q,J){let Ie=Q._transformAlgorithm(J);return g(Ie,void 0,nt=>{throw go(Q._controlledTransformStream,nt),nt})}function ACt(Q){let J=Q._controlledTransformStream,Ie=J._readable._readableStreamController;ET(Ie);let nt=new TypeError("TransformStream terminated");qi(J,nt)}function zk(Q,J){let Ie=Q._transformStreamController;if(Q._backpressure){let nt=Q._backpressureChangePromise;return g(nt,()=>{let bt=Q._writable;if(bt._state==="erroring")throw bt._storedError;return E6(Ie,J)})}return E6(Ie,J)}function Ole(Q,J){let Ie=Q._transformStreamController;if(Ie._finishPromise!==void 0)return Ie._finishPromise;let nt=Q._readable;Ie._finishPromise=c((Kt,cn)=>{Ie._finishPromise_resolve=Kt,Ie._finishPromise_reject=cn});let bt=Ie._cancelAlgorithm(J);return wM(Ie),m(bt,()=>(nt._state==="errored"?qG(Ie,nt._storedError):(JA(nt._readableStreamController,J),JOe(Ie)),null),Kt=>(JA(nt._readableStreamController,Kt),qG(Ie,Kt),null)),Ie._finishPromise}function Lle(Q){let J=Q._transformStreamController;if(J._finishPromise!==void 0)return J._finishPromise;let Ie=Q._readable;J._finishPromise=c((bt,Kt)=>{J._finishPromise_resolve=bt,J._finishPromise_reject=Kt});let nt=J._flushAlgorithm();return wM(J),m(nt,()=>(Ie._state==="errored"?qG(J,Ie._storedError):(ET(Ie._readableStreamController),JOe(J)),null),bt=>(JA(Ie._readableStreamController,bt),qG(J,bt),null)),J._finishPromise}function Fle(Q){return Yk(Q,!1),Q._backpressureChangePromise}function m0r(Q,J){let Ie=Q._transformStreamController;if(Ie._finishPromise!==void 0)return Ie._finishPromise;let nt=Q._writable;Ie._finishPromise=c((Kt,cn)=>{Ie._finishPromise_resolve=Kt,Ie._finishPromise_reject=cn});let bt=Ie._cancelAlgorithm(J);return wM(Ie),m(bt,()=>(nt._state==="errored"?qG(Ie,nt._storedError):(yl(nt._writableStreamController,J),y_(Q),JOe(Ie)),null),Kt=>(yl(nt._writableStreamController,Kt),y_(Q),qG(Ie,Kt),null)),Ie._finishPromise}function Qle(Q){return new TypeError(`TransformStreamDefaultController.prototype.${Q} can only be used on a TransformStreamDefaultController`)}function JOe(Q){Q._finishPromise_resolve!==void 0&&(Q._finishPromise_resolve(),Q._finishPromise_resolve=void 0,Q._finishPromise_reject=void 0)}function qG(Q,J){Q._finishPromise_reject!==void 0&&(A(Q._finishPromise),Q._finishPromise_reject(J),Q._finishPromise_resolve=void 0,Q._finishPromise_reject=void 0)}function yCt(Q){return new TypeError(`TransformStream.prototype.${Q} can only be used on a TransformStream`)}t.ByteLengthQueuingStrategy=K,t.CountQueuingStrategy=Ke,t.ReadableByteStreamController=xn,t.ReadableStream=vp,t.ReadableStreamBYOBReader=Ip,t.ReadableStreamBYOBRequest=yn,t.ReadableStreamDefaultController=g_,t.ReadableStreamDefaultReader=X,t.TransformStream=eo,t.TransformStreamDefaultController=t0,t.WritableStream=b,t.WritableStreamDefaultController=vo,t.WritableStreamDefaultWriter=H}))});var sJt=re(()=>{p();if(!globalThis.ReadableStream)try{let t=require("node:process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),t.emitWarning=e}catch(n){throw t.emitWarning=e,n}}catch{Object.assign(globalThis,iJt())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=function(n){let r=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let a=await i.slice(r,Math.min(i.size,r+65536)).arrayBuffer();r+=a.byteLength,s.enqueue(new Uint8Array(a)),r===i.size&&s.close()}})})}catch{}});async function*f9e(t,e=!0){for(let n of t)if("stream"in n)yield*n.stream();else if(ArrayBuffer.isView(n))if(e){let r=n.byteOffset,i=n.byteOffset+n.byteLength;for(;r!==i;){let s=Math.min(i-r,oJt),o=n.buffer.slice(r,r+s);r+=o.byteLength,yield new Uint8Array(o)}}else yield n;else{let r=0,i=n;for(;r!==i.size;){let o=await i.slice(r,Math.min(i.size,r+oJt)).arrayBuffer();r+=o.byteLength,yield new Uint8Array(o)}}}var fFo,oJt,aJt,cei,yx,LX=v(()=>{p();fFo=Ot(sJt(),1);oJt=65536;aJt=class g9e{#e=[];#t="";#n=0;#r="transparent";constructor(e=[],n={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof n!="object"&&typeof n!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");n===null&&(n={});let r=new TextEncoder;for(let s of e){let o;ArrayBuffer.isView(s)?o=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?o=new Uint8Array(s.slice(0)):s instanceof g9e?o=s:o=r.encode(`${s}`),this.#n+=ArrayBuffer.isView(o)?o.byteLength:o.size,this.#e.push(o)}this.#r=`${n.endings===void 0?"transparent":n.endings}`;let i=n.type===void 0?"":String(n.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#n}get type(){return this.#t}async text(){let e=new TextDecoder,n="";for await(let r of f9e(this.#e,!1))n+=e.decode(r,{stream:!0});return n+=e.decode(),n}async arrayBuffer(){let e=new Uint8Array(this.size),n=0;for await(let r of f9e(this.#e,!1))e.set(r,n),n+=r.length;return e.buffer}stream(){let e=f9e(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(n){let r=await e.next();r.done?n.close():n.enqueue(r.value)},async cancel(){await e.return()}})}slice(e=0,n=this.size,r=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),o=n<0?Math.max(i+n,0):Math.min(n,i),a=Math.max(o-s,0),c=this.#e,u=[],l=0;for(let m of c){if(l>=a)break;let h=ArrayBuffer.isView(m)?m.byteLength:m.size;if(s&&h<=s)s-=h,o-=h;else{let f;ArrayBuffer.isView(m)?(f=m.subarray(s,Math.min(h,o)),l+=f.byteLength):(f=m.slice(s,Math.min(h,o)),l+=f.size),o-=h,u.push(f),s=0}}let d=new g9e([],{type:String(r).toLowerCase()});return d.#n=a,d.#e=u,d}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(aJt.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});cei=aJt,yx=cei});var lei,uei,aN,A9e=v(()=>{p();LX();lei=class extends yx{#e=0;#t="";constructor(e,n,r={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,r),r===null&&(r={});let i=r.lastModified===void 0?Date.now():Number(r.lastModified);Number.isNaN(i)||(this.#e=i),this.#t=String(n)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof yx&&/^(File)$/.test(e[Symbol.toStringTag])}},uei=lei,aN=uei});function uJt(t,e=yx){var n=`${cJt()}${cJt()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),r=[],i=`--${n}\r +Content-Disposition: form-data; name="`;return t.forEach((s,o)=>typeof s=="string"?r.push(i+y9e(o)+`"\r \r -${i.replace(/\r(?!\n)|(?{p();SK();jqe();({toStringTag:CK,iterator:vRr,hasInstance:RRr}=Symbol),x2t=Math.random,kRr="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),w2t=(t,e,n)=>(t+="",/^(Blob|File)$/.test(e&&e[CK])?[(n=n!==void 0?n+"":e[CK]=="File"?e.name:"blob",t),e.name!==n||e[CK]=="blob"?new Sk([e],n,e):e]:[t,e+""]),Yqe=(t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r -`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),tO=(t,e,n)=>{if(e.lengthtypeof e[n]!="function")}append(...e){tO("append",arguments,2),this.#e.push(w2t(...e))}delete(e){tO("delete",arguments,1),e+="",this.#e=this.#e.filter(([n])=>n!==e)}get(e){tO("get",arguments,1),e+="";for(var n=this.#e,r=n.length,s=0;sr[0]===e&&n.push(r[1])),n}has(e){return tO("has",arguments,1),e+="",this.#e.some(n=>n[0]===e)}forEach(e,n){tO("forEach",arguments,1);for(var[r,s]of this)e.call(n,s,r,this)}set(...e){tO("set",arguments,2);var n=[],r=!0;e=w2t(...e),this.#e.forEach(s=>{s[0]===e[0]?r&&(r=!n.push(e)):n.push(s)}),r&&n.push(e),this.#e=n}*entries(){yield*this.#e}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}}});var tw,nme=V(()=>{p();tw=class extends Error{constructor(e,n){super(e),Error.captureStackTrace(this,this.constructor),this.type=n}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var xm,Kqe=V(()=>{p();nme();xm=class extends tw{constructor(e,n,r){super(e,n),r&&(this.code=this.errno=r.code,this.erroredSysCall=r.syscall)}}});var rme,zqe,IK,v2t,R2t,k2t,sme=V(()=>{p();rme=Symbol.toStringTag,zqe=t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[rme]==="URLSearchParams",IK=t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[rme]),v2t=t=>typeof t=="object"&&(t[rme]==="AbortSignal"||t[rme]==="EventTarget"),R2t=(t,e)=>{let n=new URL(e).hostname,r=new URL(t).hostname;return n===r||n.endsWith(`.${r}`)},k2t=(t,e)=>{let n=new URL(e).protocol,r=new URL(t).protocol;return n===r}});var D2t=ee((Iro,N2t)=>{p();if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),e=new t().port1,n=new ArrayBuffer;e.postMessage(n,[n,n])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}N2t.exports=globalThis.DOMException});var nO,B2t,P2t,Jqe,O2t,M2t,L2t,F2t,Q2t,U2t,ime,Xqe=V(()=>{p();nO=require("node:fs"),B2t=require("node:path"),P2t=Gt(D2t(),1);jqe();SK();({stat:Jqe}=nO.promises),O2t=(t,e)=>Q2t((0,nO.statSync)(t),t,e),M2t=(t,e)=>Jqe(t).then(n=>Q2t(n,t,e)),L2t=(t,e)=>Jqe(t).then(n=>U2t(n,t,e)),F2t=(t,e)=>U2t((0,nO.statSync)(t),t,e),Q2t=(t,e,n="")=>new x_([new ime({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:n}),U2t=(t,e,n="")=>new Sk([new ime({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,B2t.basename)(e),{type:n,lastModified:t.mtimeMs}),ime=class t{#e;#t;constructor(e){this.#e=e.path,this.#t=e.start,this.size=e.size,this.lastModified=e.lastModified}slice(e,n){return new t({path:this.#e,lastModified:this.lastModified,size:n-e,start:this.#t+e})}async*stream(){let{mtimeMs:e}=await Jqe(this.#e);if(e>this.lastModified)throw new P2t.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,nO.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var G2t={};Ir(G2t,{toFormData:()=>LRr});function MRr(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let n=e[2]||e[3]||"",r=n.slice(n.lastIndexOf("\\")+1);return r=r.replace(/%22/g,'"'),r=r.replace(/&#(\d{4});/g,(s,i)=>String.fromCharCode(i)),r}async function LRr(t,e){if(!/multipart/i.test(e))throw new TypeError("Failed to fetch");let n=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");let r=new Zqe(n[1]||n[2]),s,i,o,a,c,u,l=[],d=new Ck,h=y=>{o+=A.decode(y,{stream:!0})},m=y=>{l.push(y)},f=()=>{let y=new Sk(l,u,{type:c});d.append(a,y)},g=()=>{d.append(a,o)},A=new TextDecoder("utf-8");A.decode(),r.onPartBegin=function(){r.onPartData=h,r.onPartEnd=g,s="",i="",o="",a="",c="",u=null,l.length=0},r.onHeaderField=function(y){s+=A.decode(y,{stream:!0})},r.onHeaderValue=function(y){i+=A.decode(y,{stream:!0})},r.onHeaderEnd=function(){if(i+=A.decode(),s=s.toLowerCase(),s==="content-disposition"){let y=i.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);y&&(a=y[2]||y[3]||""),u=MRr(i),u&&(r.onPartData=m,r.onPartEnd=f)}else s==="content-type"&&(c=i);i="",s=""};for await(let y of t)r.write(y);return r.end(),d}var yC,Ja,$2t,Ik,ome,ame,NRr,xK,DRr,BRr,PRr,ORr,rO,Zqe,W2t=V(()=>{p();Xqe();tme();yC=0,Ja={START_BOUNDARY:yC++,HEADER_FIELD_START:yC++,HEADER_FIELD:yC++,HEADER_VALUE_START:yC++,HEADER_VALUE:yC++,HEADER_VALUE_ALMOST_DONE:yC++,HEADERS_ALMOST_DONE:yC++,PART_DATA_START:yC++,PART_DATA:yC++,END:yC++},$2t=1,Ik={PART_BOUNDARY:$2t,LAST_BOUNDARY:$2t*=2},ome=10,ame=13,NRr=32,xK=45,DRr=58,BRr=97,PRr=122,ORr=t=>t|32,rO=()=>{},Zqe=class{constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=rO,this.onHeaderField=rO,this.onHeadersEnd=rO,this.onHeaderValue=rO,this.onPartBegin=rO,this.onPartData=rO,this.onPartEnd=rO,this.boundaryChars={},e=`\r ---`+e;let n=new Uint8Array(e.length);for(let r=0;r{this[C+"Mark"]=n},y=C=>{delete this[C+"Mark"]},b=(C,I,x,w)=>{(I===void 0||I!==x)&&this[C](w&&w.subarray(I,x))},S=(C,I)=>{let x=C+"Mark";x in this&&(I?(b(C,this[x],n,e),delete this[x]):(b(C,this[x],e.length,e),this[x]=0))};for(n=0;nPRr)return;break;case Ja.HEADER_VALUE_START:if(f===NRr)break;A("onHeaderValue"),u=Ja.HEADER_VALUE;case Ja.HEADER_VALUE:f===ame&&(S("onHeaderValue",!0),b("onHeaderEnd"),u=Ja.HEADER_VALUE_ALMOST_DONE);break;case Ja.HEADER_VALUE_ALMOST_DONE:if(f!==ome)return;u=Ja.HEADER_FIELD_START;break;case Ja.HEADERS_ALMOST_DONE:if(f!==ome)return;b("onHeadersEnd"),u=Ja.PART_DATA_START;break;case Ja.PART_DATA_START:u=Ja.PART_DATA,A("onPartData");case Ja.PART_DATA:if(s=c,c===0){for(n+=h;n0)i[c-1]=f;else if(s>0){let C=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);b("onPartData",0,s,C),s=0,A("onPartData"),n--}break;case Ja.END:break;default:throw new Error(`Unexpected state entered: ${u}`)}S("onHeaderField"),S("onHeaderValue"),S("onPartData"),this.index=c,this.state=u,this.flags=l}end(){if(this.state===Ja.HEADER_FIELD_START&&this.index===0||this.state===Ja.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Ja.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});async function e3e(t){if(t[Gf].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Gf].disturbed=!0,t[Gf].error)throw t[Gf].error;let{body:e}=t;if(e===null)return AA.Buffer.alloc(0);if(!(e instanceof IE.default))return AA.Buffer.alloc(0);let n=[],r=0;try{for await(let s of e){if(t.size>0&&r+s.length>t.size){let i=new xm(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(i),i}r+=s.length,n.push(s)}}catch(s){throw s instanceof tw?s:new xm(`Invalid response body while trying to fetch ${t.url}: ${s.message}`,"system",s)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return n.every(s=>typeof s=="string")?AA.Buffer.from(n.join("")):AA.Buffer.concat(n,r)}catch(s){throw new xm(`Could not create Buffer from response body for ${t.url}: ${s.message}`,"system",s)}else throw new xm(`Premature close of server response while trying to fetch ${t.url}`)}var IE,nw,AA,FRr,Gf,EC,VW,QRr,cme,q2t,H2t,lme=V(()=>{p();IE=Gt(require("node:stream"),1),nw=require("node:util"),AA=require("node:buffer");SK();tme();Kqe();nme();sme();FRr=(0,nw.promisify)(IE.default.pipeline),Gf=Symbol("Body internals"),EC=class{constructor(e,{size:n=0}={}){let r=null;e===null?e=null:zqe(e)?e=AA.Buffer.from(e.toString()):IK(e)||AA.Buffer.isBuffer(e)||(nw.types.isAnyArrayBuffer(e)?e=AA.Buffer.from(e):ArrayBuffer.isView(e)?e=AA.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof IE.default||(e instanceof Ck?(e=T2t(e),r=e.type.split("=")[1]):e=AA.Buffer.from(String(e))));let s=e;AA.Buffer.isBuffer(e)?s=IE.default.Readable.from(e):IK(e)&&(s=IE.default.Readable.from(e.stream())),this[Gf]={body:e,stream:s,boundary:r,disturbed:!1,error:null},this.size=n,e instanceof IE.default&&e.on("error",i=>{let o=i instanceof tw?i:new xm(`Invalid response body while trying to fetch ${this.url}: ${i.message}`,"system",i);this[Gf].error=o})}get body(){return this[Gf].stream}get bodyUsed(){return this[Gf].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:n,byteLength:r}=await e3e(this);return e.slice(n,n+r)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let r=new Ck,s=new URLSearchParams(await this.text());for(let[i,o]of s)r.append(i,o);return r}let{toFormData:n}=await Promise.resolve().then(()=>(W2t(),G2t));return n(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Gf].body&&this[Gf].body.type||"",n=await this.arrayBuffer();return new x_([n],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await e3e(this);return new TextDecoder().decode(e)}buffer(){return e3e(this)}};EC.prototype.buffer=(0,nw.deprecate)(EC.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(EC.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,nw.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});VW=(t,e)=>{let n,r,{body:s}=t[Gf];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return s instanceof IE.default&&typeof s.getBoundary!="function"&&(n=new IE.PassThrough({highWaterMark:e}),r=new IE.PassThrough({highWaterMark:e}),s.pipe(n),s.pipe(r),t[Gf].stream=n,s=r),s},QRr=(0,nw.deprecate)(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),cme=(t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":zqe(t)?"application/x-www-form-urlencoded;charset=UTF-8":IK(t)?t.type||null:AA.Buffer.isBuffer(t)||nw.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Ck?`multipart/form-data; boundary=${e[Gf].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${QRr(t)}`:t instanceof IE.default?null:"text/plain;charset=UTF-8",q2t=t=>{let{body:e}=t[Gf];return e===null?0:IK(e)?e.size:AA.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},H2t=async(t,{body:e})=>{e===null?t.end():await FRr(e,t)}});function V2t(t=[]){return new Wf(t.reduce((e,n,r,s)=>(r%2===0&&e.push(s.slice(r,r+2)),e),[]).filter(([e,n])=>{try{return ume(e),n3e(e,String(n)),!0}catch{return!1}}))}var t3e,wK,ume,n3e,Wf,dme=V(()=>{p();t3e=require("node:util"),wK=Gt(require("node:http"),1),ume=typeof wK.default.validateHeaderName=="function"?wK.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},n3e=typeof wK.default.validateHeaderValue=="function"?wK.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let n=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}},Wf=class t extends URLSearchParams{constructor(e){let n=[];if(e instanceof t){let r=e.raw();for(let[s,i]of Object.entries(r))n.push(...i.map(o=>[s,o]))}else if(e!=null)if(typeof e=="object"&&!t3e.types.isBoxedPrimitive(e)){let r=e[Symbol.iterator];if(r==null)n.push(...Object.entries(e));else{if(typeof r!="function")throw new TypeError("Header pairs must be iterable");n=[...e].map(s=>{if(typeof s!="object"||t3e.types.isBoxedPrimitive(s))throw new TypeError("Each header pair must be an iterable object");return[...s]}).map(s=>{if(s.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...s]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence> or record)");return n=n.length>0?n.map(([r,s])=>(ume(r),n3e(r,String(s)),[String(r).toLowerCase(),String(s)])):void 0,super(n),new Proxy(this,{get(r,s,i){switch(s){case"append":case"set":return(o,a)=>(ume(o),n3e(o,String(a)),URLSearchParams.prototype[s].call(r,String(o).toLowerCase(),String(a)));case"delete":case"has":case"getAll":return o=>(ume(o),URLSearchParams.prototype[s].call(r,String(o).toLowerCase()));case"keys":return()=>(r.sort(),new Set(URLSearchParams.prototype.keys.call(r)).keys());default:return Reflect.get(r,s,i)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let n=this.getAll(e);if(n.length===0)return null;let r=n.join(", ");return/^content-encoding$/i.test(e)&&(r=r.toLowerCase()),r}forEach(e,n=void 0){for(let r of this.keys())Reflect.apply(e,n,[this.get(r),r,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,n)=>(e[n]=this.getAll(n),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,n)=>{let r=this.getAll(n);return n==="host"?e[n]=r[0]:e[n]=r.length>1?r:r[0],e},{})}};Object.defineProperties(Wf.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}))});var URr,TK,r3e=V(()=>{p();URr=new Set([301,302,303,307,308]),TK=t=>URr.has(t)});var w_,yA,j2t=V(()=>{p();dme();lme();r3e();w_=Symbol("Response internals"),yA=class t extends EC{constructor(e=null,n={}){super(e,n);let r=n.status!=null?n.status:200,s=new Wf(n.headers);if(e!==null&&!s.has("Content-Type")){let i=cme(e,this);i&&s.append("Content-Type",i)}this[w_]={type:"default",url:n.url,status:r,statusText:n.statusText||"",headers:s,counter:n.counter,highWaterMark:n.highWaterMark}}get type(){return this[w_].type}get url(){return this[w_].url||""}get status(){return this[w_].status}get ok(){return this[w_].status>=200&&this[w_].status<300}get redirected(){return this[w_].counter>0}get statusText(){return this[w_].statusText}get headers(){return this[w_].headers}get highWaterMark(){return this[w_].highWaterMark}clone(){return new t(VW(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,n=302){if(!TK(n))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:n})}static error(){let e=new t(null,{status:0,statusText:""});return e[w_].type="error",e}static json(e=void 0,n={}){let r=JSON.stringify(e);if(r===void 0)throw new TypeError("data is not JSON serializable");let s=new Wf(n&&n.headers);return s.has("content-type")||s.set("content-type","application/json"),new t(r,{...n,headers:s})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(yA.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var Y2t,K2t=V(()=>{p();Y2t=t=>{if(t.search)return t.search;let e=t.href.length-1,n=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-n.length]==="?"?"?":""}});function z2t(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}function e$t(t){if(!X2t.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function $Rr(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),n=(0,J2t.isIP)(e);return n===4&&/^127\./.test(e)||n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function jW(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:$Rr(t)}function t$t(t,{referrerURLCallback:e,referrerOriginCallback:n}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let r=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let s=t.referrer,i=z2t(s),o=z2t(s,!0);i.toString().length>4096&&(i=o),e&&(i=e(i)),n&&(o=n(o));let a=new URL(t.url);switch(r){case"no-referrer":return"no-referrer";case"origin":return o;case"unsafe-url":return i;case"strict-origin":return jW(i)&&!jW(a)?"no-referrer":o.toString();case"strict-origin-when-cross-origin":return i.origin===a.origin?i:jW(i)&&!jW(a)?"no-referrer":o;case"same-origin":return i.origin===a.origin?i:"no-referrer";case"origin-when-cross-origin":return i.origin===a.origin?i:o;case"no-referrer-when-downgrade":return jW(i)&&!jW(a)?"no-referrer":i;default:throw new TypeError(`Invalid referrerPolicy: ${r}`)}}function n$t(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),n="";for(let r of e)r&&X2t.has(r)&&(n=r);return n}var J2t,X2t,Z2t,s3e=V(()=>{p();J2t=require("node:net");X2t=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),Z2t="strict-origin-when-cross-origin"});var r$t,s$t,Xd,vK,GRr,xk,i$t,o$t=V(()=>{p();r$t=require("node:url"),s$t=require("node:util");dme();lme();sme();K2t();s3e();Xd=Symbol("Request internals"),vK=t=>typeof t=="object"&&typeof t[Xd]=="object",GRr=(0,s$t.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),xk=class t extends EC{constructor(e,n={}){let r;if(vK(e)?r=new URL(e.url):(r=new URL(e),e={}),r.username!==""||r.password!=="")throw new TypeError(`${r} is an url with embedded credentials.`);let s=n.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(s)&&(s=s.toUpperCase()),!vK(n)&&"data"in n&&GRr(),(n.body!=null||vK(e)&&e.body!==null)&&(s==="GET"||s==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let i=n.body?n.body:vK(e)&&e.body!==null?VW(e):null;super(i,{size:n.size||e.size||0});let o=new Wf(n.headers||e.headers||{});if(i!==null&&!o.has("Content-Type")){let u=cme(i,this);u&&o.set("Content-Type",u)}let a=vK(e)?e.signal:null;if("signal"in n&&(a=n.signal),a!=null&&!v2t(a))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let c=n.referrer==null?e.referrer:n.referrer;if(c==="")c="no-referrer";else if(c){let u=new URL(c);c=/^about:(\/\/)?client$/.test(u)?"client":u}else c=void 0;this[Xd]={method:s,redirect:n.redirect||e.redirect||"follow",headers:o,parsedURL:r,signal:a,referrer:c},this.follow=n.follow===void 0?e.follow===void 0?20:e.follow:n.follow,this.compress=n.compress===void 0?e.compress===void 0?!0:e.compress:n.compress,this.counter=n.counter||e.counter||0,this.agent=n.agent||e.agent,this.highWaterMark=n.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=n.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=n.referrerPolicy||e.referrerPolicy||""}get method(){return this[Xd].method}get url(){return(0,r$t.format)(this[Xd].parsedURL)}get headers(){return this[Xd].headers}get redirect(){return this[Xd].redirect}get signal(){return this[Xd].signal}get referrer(){if(this[Xd].referrer==="no-referrer")return"";if(this[Xd].referrer==="client")return"about:client";if(this[Xd].referrer)return this[Xd].referrer.toString()}get referrerPolicy(){return this[Xd].referrerPolicy}set referrerPolicy(e){this[Xd].referrerPolicy=e$t(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(xk.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});i$t=t=>{let{parsedURL:e}=t[Xd],n=new Wf(t[Xd].headers);n.has("Accept")||n.set("Accept","*/*");let r=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(r="0"),t.body!==null){let a=q2t(t);typeof a=="number"&&!Number.isNaN(a)&&(r=String(a))}r&&n.set("Content-Length",r),t.referrerPolicy===""&&(t.referrerPolicy=Z2t),t.referrer&&t.referrer!=="no-referrer"?t[Xd].referrer=t$t(t):t[Xd].referrer="no-referrer",t[Xd].referrer instanceof URL&&n.set("Referer",t.referrer),n.has("User-Agent")||n.set("User-Agent","node-fetch"),t.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip, deflate, br");let{agent:s}=t;typeof s=="function"&&(s=s(e));let i=Y2t(e),o={path:e.pathname+i,method:t.method,headers:n[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:s};return{parsedURL:e,options:o}}});var RK,a$t=V(()=>{p();nme();RK=class extends tw{constructor(e,n="aborted"){super(e,n)}}});var u$t={};Ir(u$t,{AbortError:()=>RK,Blob:()=>x_,FetchError:()=>xm,File:()=>Sk,FormData:()=>Ck,Headers:()=>Wf,Request:()=>xk,Response:()=>yA,blobFrom:()=>M2t,blobFromSync:()=>O2t,default:()=>i3e,fileFrom:()=>L2t,fileFromSync:()=>F2t,isRedirect:()=>TK});async function i3e(t,e){return new Promise((n,r)=>{let s=new xk(t,e),{parsedURL:i,options:o}=i$t(s);if(!WRr.has(i.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${i.protocol.replace(/:$/,"")}" is not supported.`);if(i.protocol==="data:"){let f=y2t(s.url),g=new yA(f,{headers:{"Content-Type":f.typeFull}});n(g);return}let a=(i.protocol==="https:"?l$t.default:c$t.default).request,{signal:c}=s,u=null,l=()=>{let f=new RK("The operation was aborted.");r(f),s.body&&s.body instanceof EA.default.Readable&&s.body.destroy(f),!(!u||!u.body)&&u.body.emit("error",f)};if(c&&c.aborted){l();return}let d=()=>{l(),m()},h=a(i.toString(),o);c&&c.addEventListener("abort",d);let m=()=>{h.abort(),c&&c.removeEventListener("abort",d)};h.on("error",f=>{r(new xm(`request to ${s.url} failed, reason: ${f.message}`,"system",f)),m()}),qRr(h,f=>{u&&u.body&&u.body.destroy(f)}),process.version<"v14"&&h.on("socket",f=>{let g;f.prependListener("end",()=>{g=f._eventsCount}),f.prependListener("close",A=>{if(u&&g{h.setTimeout(0);let g=V2t(f.rawHeaders);if(TK(f.statusCode)){let C=g.get("Location"),I=null;try{I=C===null?null:new URL(C,s.url)}catch{if(s.redirect!=="manual"){r(new xm(`uri requested responds with an invalid redirect URL: ${C}`,"invalid-redirect")),m();return}}switch(s.redirect){case"error":r(new xm(`uri requested responds with a redirect, redirect mode is set to error: ${s.url}`,"no-redirect")),m();return;case"manual":break;case"follow":{if(I===null)break;if(s.counter>=s.follow){r(new xm(`maximum redirect reached at: ${s.url}`,"max-redirect")),m();return}let x={headers:new Wf(s.headers),follow:s.follow,counter:s.counter+1,agent:s.agent,compress:s.compress,method:s.method,body:VW(s),signal:s.signal,size:s.size,referrer:s.referrer,referrerPolicy:s.referrerPolicy};if(!R2t(s.url,I)||!k2t(s.url,I))for(let R of["authorization","www-authenticate","cookie","cookie2"])x.headers.delete(R);if(f.statusCode!==303&&s.body&&e.body instanceof EA.default.Readable){r(new xm("Cannot follow redirect with body being a readable stream","unsupported-redirect")),m();return}(f.statusCode===303||(f.statusCode===301||f.statusCode===302)&&s.method==="POST")&&(x.method="GET",x.body=void 0,x.headers.delete("content-length"));let w=n$t(g);w&&(x.referrerPolicy=w),n(i3e(new xk(I,x))),m();return}default:return r(new TypeError(`Redirect option '${s.redirect}' is not a valid value of RequestRedirect`))}}c&&f.once("end",()=>{c.removeEventListener("abort",d)});let A=(0,EA.pipeline)(f,new EA.PassThrough,C=>{C&&r(C)});process.version<"v12.10"&&f.on("aborted",d);let y={url:s.url,status:f.statusCode,statusText:f.statusMessage,headers:g,size:s.size,counter:s.counter,highWaterMark:s.highWaterMark},b=g.get("Content-Encoding");if(!s.compress||s.method==="HEAD"||b===null||f.statusCode===204||f.statusCode===304){u=new yA(A,y),n(u);return}let S={flush:sO.default.Z_SYNC_FLUSH,finishFlush:sO.default.Z_SYNC_FLUSH};if(b==="gzip"||b==="x-gzip"){A=(0,EA.pipeline)(A,sO.default.createGunzip(S),C=>{C&&r(C)}),u=new yA(A,y),n(u);return}if(b==="deflate"||b==="x-deflate"){let C=(0,EA.pipeline)(f,new EA.PassThrough,I=>{I&&r(I)});C.once("data",I=>{(I[0]&15)===8?A=(0,EA.pipeline)(A,sO.default.createInflate(),x=>{x&&r(x)}):A=(0,EA.pipeline)(A,sO.default.createInflateRaw(),x=>{x&&r(x)}),u=new yA(A,y),n(u)}),C.once("end",()=>{u||(u=new yA(A,y),n(u))});return}if(b==="br"){A=(0,EA.pipeline)(A,sO.default.createBrotliDecompress(),C=>{C&&r(C)}),u=new yA(A,y),n(u);return}u=new yA(A,y),n(u)}),H2t(h,s).catch(r)})}function qRr(t,e){let n=kK.Buffer.from(`0\r +`,s,`\r +`)),r.push(`--${n}--`),new e(r,{type:"multipart/form-data; boundary="+n})}var FX,dei,pei,cJt,mei,lJt,y9e,r2,cN,n0e=v(()=>{p();LX();A9e();({toStringTag:FX,iterator:dei,hasInstance:pei}=Symbol),cJt=Math.random,mei="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),lJt=(t,e,n)=>(t+="",/^(Blob|File)$/.test(e&&e[FX])?[(n=n!==void 0?n+"":e[FX]=="File"?e.name:"blob",t),e.name!==n||e[FX]=="blob"?new aN([e],n,e):e]:[t,e+""]),y9e=(t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r +`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),r2=(t,e,n)=>{if(e.lengthtypeof e[n]!="function")}append(...e){r2("append",arguments,2),this.#e.push(lJt(...e))}delete(e){r2("delete",arguments,1),e+="",this.#e=this.#e.filter(([n])=>n!==e)}get(e){r2("get",arguments,1),e+="";for(var n=this.#e,r=n.length,i=0;ir[0]===e&&n.push(r[1])),n}has(e){return r2("has",arguments,1),e+="",this.#e.some(n=>n[0]===e)}forEach(e,n){r2("forEach",arguments,1);for(var[r,i]of this)e.call(n,i,r,this)}set(...e){r2("set",arguments,2);var n=[],r=!0;e=lJt(...e),this.#e.forEach(i=>{i[0]===e[0]?r&&(r=!n.push(e)):n.push(i)}),r&&n.push(e),this.#e=n}*entries(){yield*this.#e}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}}});var xv,r0e=v(()=>{p();xv=class extends Error{constructor(e,n){super(e),Error.captureStackTrace(this,this.constructor),this.type=n}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var $f,E9e=v(()=>{p();r0e();$f=class extends xv{constructor(e,n,r){super(e,n),r&&(this.code=this.errno=r.code,this.erroredSysCall=r.syscall)}}});var i0e,b9e,QX,dJt,pJt,mJt,s0e=v(()=>{p();i0e=Symbol.toStringTag,b9e=t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[i0e]==="URLSearchParams",QX=t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[i0e]),dJt=t=>typeof t=="object"&&(t[i0e]==="AbortSignal"||t[i0e]==="EventTarget"),pJt=(t,e)=>{let n=new URL(e).hostname,r=new URL(t).hostname;return n===r||n.endsWith(`.${r}`)},mJt=(t,e)=>{let n=new URL(e).protocol,r=new URL(t).protocol;return n===r}});var fJt=re((PFo,hJt)=>{p();if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),e=new t().port1,n=new ArrayBuffer;e.postMessage(n,[n,n])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}hJt.exports=globalThis.DOMException});var i2,gJt,AJt,_9e,yJt,EJt,bJt,_Jt,xJt,SJt,o0e,x9e=v(()=>{p();i2=require("node:fs"),gJt=require("node:path"),AJt=Ot(fJt(),1);A9e();LX();({stat:_9e}=i2.promises),yJt=(t,e)=>xJt((0,i2.statSync)(t),t,e),EJt=(t,e)=>_9e(t).then(n=>xJt(n,t,e)),bJt=(t,e)=>_9e(t).then(n=>SJt(n,t,e)),_Jt=(t,e)=>SJt((0,i2.statSync)(t),t,e),xJt=(t,e,n="")=>new yx([new o0e({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:n}),SJt=(t,e,n="")=>new aN([new o0e({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,gJt.basename)(e),{type:n,lastModified:t.mtimeMs}),o0e=class t{#e;#t;constructor(e){this.#e=e.path,this.#t=e.start,this.size=e.size,this.lastModified=e.lastModified}slice(e,n){return new t({path:this.#e,lastModified:this.lastModified,size:n-e,start:this.#t+e})}async*stream(){let{mtimeMs:e}=await _9e(this.#e);if(e>this.lastModified)throw new AJt.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,i2.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var IJt={};br(IJt,{toFormData:()=>bei});function Eei(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let n=e[2]||e[3]||"",r=n.slice(n.lastIndexOf("\\")+1);return r=r.replace(/%22/g,'"'),r=r.replace(/&#(\d{4});/g,(i,s)=>String.fromCharCode(s)),r}async function bei(t,e){if(!/multipart/i.test(e))throw new TypeError("Failed to fetch");let n=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");let r=new S9e(n[1]||n[2]),i,s,o,a,c,u,l=[],d=new cN,m=y=>{o+=A.decode(y,{stream:!0})},h=y=>{l.push(y)},f=()=>{let y=new aN(l,u,{type:c});d.append(a,y)},g=()=>{d.append(a,o)},A=new TextDecoder("utf-8");A.decode(),r.onPartBegin=function(){r.onPartData=m,r.onPartEnd=g,i="",s="",o="",a="",c="",u=null,l.length=0},r.onHeaderField=function(y){i+=A.decode(y,{stream:!0})},r.onHeaderValue=function(y){s+=A.decode(y,{stream:!0})},r.onHeaderEnd=function(){if(s+=A.decode(),i=i.toLowerCase(),i==="content-disposition"){let y=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);y&&(a=y[2]||y[3]||""),u=Eei(s),u&&(r.onPartData=h,r.onPartEnd=f)}else i==="content-type"&&(c=s);s="",i=""};for await(let y of t)r.write(y);return r.end(),d}var yI,Nc,CJt,lN,a0e,c0e,hei,UX,fei,gei,Aei,yei,s2,S9e,wJt=v(()=>{p();x9e();n0e();yI=0,Nc={START_BOUNDARY:yI++,HEADER_FIELD_START:yI++,HEADER_FIELD:yI++,HEADER_VALUE_START:yI++,HEADER_VALUE:yI++,HEADER_VALUE_ALMOST_DONE:yI++,HEADERS_ALMOST_DONE:yI++,PART_DATA_START:yI++,PART_DATA:yI++,END:yI++},CJt=1,lN={PART_BOUNDARY:CJt,LAST_BOUNDARY:CJt*=2},a0e=10,c0e=13,hei=32,UX=45,fei=58,gei=97,Aei=122,yei=t=>t|32,s2=()=>{},S9e=class{constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=s2,this.onHeaderField=s2,this.onHeadersEnd=s2,this.onHeaderValue=s2,this.onPartBegin=s2,this.onPartData=s2,this.onPartEnd=s2,this.boundaryChars={},e=`\r +--`+e;let n=new Uint8Array(e.length);for(let r=0;r{this[S+"Mark"]=n},y=S=>{delete this[S+"Mark"]},E=(S,C,I,w)=>{(C===void 0||C!==I)&&this[S](w&&w.subarray(C,I))},_=(S,C)=>{let I=S+"Mark";I in this&&(C?(E(S,this[I],n,e),delete this[I]):(E(S,this[I],e.length,e),this[I]=0))};for(n=0;nAei)return;break;case Nc.HEADER_VALUE_START:if(f===hei)break;A("onHeaderValue"),u=Nc.HEADER_VALUE;case Nc.HEADER_VALUE:f===c0e&&(_("onHeaderValue",!0),E("onHeaderEnd"),u=Nc.HEADER_VALUE_ALMOST_DONE);break;case Nc.HEADER_VALUE_ALMOST_DONE:if(f!==a0e)return;u=Nc.HEADER_FIELD_START;break;case Nc.HEADERS_ALMOST_DONE:if(f!==a0e)return;E("onHeadersEnd"),u=Nc.PART_DATA_START;break;case Nc.PART_DATA_START:u=Nc.PART_DATA,A("onPartData");case Nc.PART_DATA:if(i=c,c===0){for(n+=m;n0)s[c-1]=f;else if(i>0){let S=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);E("onPartData",0,i,S),i=0,A("onPartData"),n--}break;case Nc.END:break;default:throw new Error(`Unexpected state entered: ${u}`)}_("onHeaderField"),_("onHeaderValue"),_("onPartData"),this.index=c,this.state=u,this.flags=l}end(){if(this.state===Nc.HEADER_FIELD_START&&this.index===0||this.state===Nc.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Nc.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});async function C9e(t){if(t[lA].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[lA].disturbed=!0,t[lA].error)throw t[lA].error;let{body:e}=t;if(e===null)return Fy.Buffer.alloc(0);if(!(e instanceof j0.default))return Fy.Buffer.alloc(0);let n=[],r=0;try{for await(let i of e){if(t.size>0&&r+i.length>t.size){let s=new $f(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}r+=i.length,n.push(i)}}catch(i){throw i instanceof xv?i:new $f(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return n.every(i=>typeof i=="string")?Fy.Buffer.from(n.join("")):Fy.Buffer.concat(n,r)}catch(i){throw new $f(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new $f(`Premature close of server response while trying to fetch ${t.url}`)}var j0,Sv,Fy,_ei,lA,EI,p3,xei,l0e,TJt,vJt,u0e=v(()=>{p();j0=Ot(require("node:stream"),1),Sv=require("node:util"),Fy=require("node:buffer");LX();n0e();E9e();r0e();s0e();_ei=(0,Sv.promisify)(j0.default.pipeline),lA=Symbol("Body internals"),EI=class{constructor(e,{size:n=0}={}){let r=null;e===null?e=null:b9e(e)?e=Fy.Buffer.from(e.toString()):QX(e)||Fy.Buffer.isBuffer(e)||(Sv.types.isAnyArrayBuffer(e)?e=Fy.Buffer.from(e):ArrayBuffer.isView(e)?e=Fy.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof j0.default||(e instanceof cN?(e=uJt(e),r=e.type.split("=")[1]):e=Fy.Buffer.from(String(e))));let i=e;Fy.Buffer.isBuffer(e)?i=j0.default.Readable.from(e):QX(e)&&(i=j0.default.Readable.from(e.stream())),this[lA]={body:e,stream:i,boundary:r,disturbed:!1,error:null},this.size=n,e instanceof j0.default&&e.on("error",s=>{let o=s instanceof xv?s:new $f(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[lA].error=o})}get body(){return this[lA].stream}get bodyUsed(){return this[lA].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:n,byteLength:r}=await C9e(this);return e.slice(n,n+r)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let r=new cN,i=new URLSearchParams(await this.text());for(let[s,o]of i)r.append(s,o);return r}let{toFormData:n}=await Promise.resolve().then(()=>(wJt(),IJt));return n(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[lA].body&&this[lA].body.type||"",n=await this.arrayBuffer();return new yx([n],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await C9e(this);return new TextDecoder().decode(e)}buffer(){return C9e(this)}};EI.prototype.buffer=(0,Sv.deprecate)(EI.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(EI.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,Sv.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});p3=(t,e)=>{let n,r,{body:i}=t[lA];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof j0.default&&typeof i.getBoundary!="function"&&(n=new j0.PassThrough({highWaterMark:e}),r=new j0.PassThrough({highWaterMark:e}),i.pipe(n),i.pipe(r),t[lA].stream=n,i=r),i},xei=(0,Sv.deprecate)(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),l0e=(t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":b9e(t)?"application/x-www-form-urlencoded;charset=UTF-8":QX(t)?t.type||null:Fy.Buffer.isBuffer(t)||Sv.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof cN?`multipart/form-data; boundary=${e[lA].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${xei(t)}`:t instanceof j0.default?null:"text/plain;charset=UTF-8",TJt=t=>{let{body:e}=t[lA];return e===null?0:QX(e)?e.size:Fy.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},vJt=async(t,{body:e})=>{e===null?t.end():await _ei(e,t)}});function RJt(t=[]){return new uA(t.reduce((e,n,r,i)=>(r%2===0&&e.push(i.slice(r,r+2)),e),[]).filter(([e,n])=>{try{return d0e(e),w9e(e,String(n)),!0}catch{return!1}}))}var I9e,GX,d0e,w9e,uA,p0e=v(()=>{p();I9e=require("node:util"),GX=Ot(require("node:http"),1),d0e=typeof GX.default.validateHeaderName=="function"?GX.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},w9e=typeof GX.default.validateHeaderValue=="function"?GX.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let n=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}},uA=class t extends URLSearchParams{constructor(e){let n=[];if(e instanceof t){let r=e.raw();for(let[i,s]of Object.entries(r))n.push(...s.map(o=>[i,o]))}else if(e!=null)if(typeof e=="object"&&!I9e.types.isBoxedPrimitive(e)){let r=e[Symbol.iterator];if(r==null)n.push(...Object.entries(e));else{if(typeof r!="function")throw new TypeError("Header pairs must be iterable");n=[...e].map(i=>{if(typeof i!="object"||I9e.types.isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence> or record)");return n=n.length>0?n.map(([r,i])=>(d0e(r),w9e(r,String(i)),[String(r).toLowerCase(),String(i)])):void 0,super(n),new Proxy(this,{get(r,i,s){switch(i){case"append":case"set":return(o,a)=>(d0e(o),w9e(o,String(a)),URLSearchParams.prototype[i].call(r,String(o).toLowerCase(),String(a)));case"delete":case"has":case"getAll":return o=>(d0e(o),URLSearchParams.prototype[i].call(r,String(o).toLowerCase()));case"keys":return()=>(r.sort(),new Set(URLSearchParams.prototype.keys.call(r)).keys());default:return Reflect.get(r,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let n=this.getAll(e);if(n.length===0)return null;let r=n.join(", ");return/^content-encoding$/i.test(e)&&(r=r.toLowerCase()),r}forEach(e,n=void 0){for(let r of this.keys())Reflect.apply(e,n,[this.get(r),r,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,n)=>(e[n]=this.getAll(n),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,n)=>{let r=this.getAll(n);return n==="host"?e[n]=r[0]:e[n]=r.length>1?r:r[0],e},{})}};Object.defineProperties(uA.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}))});var Sei,$X,T9e=v(()=>{p();Sei=new Set([301,302,303,307,308]),$X=t=>Sei.has(t)});var Ex,Qy,kJt=v(()=>{p();p0e();u0e();T9e();Ex=Symbol("Response internals"),Qy=class t extends EI{constructor(e=null,n={}){super(e,n);let r=n.status!=null?n.status:200,i=new uA(n.headers);if(e!==null&&!i.has("Content-Type")){let s=l0e(e,this);s&&i.append("Content-Type",s)}this[Ex]={type:"default",url:n.url,status:r,statusText:n.statusText||"",headers:i,counter:n.counter,highWaterMark:n.highWaterMark}}get type(){return this[Ex].type}get url(){return this[Ex].url||""}get status(){return this[Ex].status}get ok(){return this[Ex].status>=200&&this[Ex].status<300}get redirected(){return this[Ex].counter>0}get statusText(){return this[Ex].statusText}get headers(){return this[Ex].headers}get highWaterMark(){return this[Ex].highWaterMark}clone(){return new t(p3(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,n=302){if(!$X(n))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:n})}static error(){let e=new t(null,{status:0,statusText:""});return e[Ex].type="error",e}static json(e=void 0,n={}){let r=JSON.stringify(e);if(r===void 0)throw new TypeError("data is not JSON serializable");let i=new uA(n&&n.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(r,{...n,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Qy.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var BJt,NJt=v(()=>{p();BJt=t=>{if(t.search)return t.search;let e=t.href.length-1,n=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-n.length]==="?"?"?":""}});function DJt(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}function LJt(t){if(!MJt.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function Cei(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),n=(0,PJt.isIP)(e);return n===4&&/^127\./.test(e)||n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function m3(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:Cei(t)}function FJt(t,{referrerURLCallback:e,referrerOriginCallback:n}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let r=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,s=DJt(i),o=DJt(i,!0);s.toString().length>4096&&(s=o),e&&(s=e(s)),n&&(o=n(o));let a=new URL(t.url);switch(r){case"no-referrer":return"no-referrer";case"origin":return o;case"unsafe-url":return s;case"strict-origin":return m3(s)&&!m3(a)?"no-referrer":o.toString();case"strict-origin-when-cross-origin":return s.origin===a.origin?s:m3(s)&&!m3(a)?"no-referrer":o;case"same-origin":return s.origin===a.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===a.origin?s:o;case"no-referrer-when-downgrade":return m3(s)&&!m3(a)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${r}`)}}function QJt(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),n="";for(let r of e)r&&MJt.has(r)&&(n=r);return n}var PJt,MJt,OJt,v9e=v(()=>{p();PJt=require("node:net");MJt=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),OJt="strict-origin-when-cross-origin"});var UJt,GJt,Vp,WX,Iei,uN,$Jt,WJt=v(()=>{p();UJt=require("node:url"),GJt=require("node:util");p0e();u0e();s0e();NJt();v9e();Vp=Symbol("Request internals"),WX=t=>typeof t=="object"&&typeof t[Vp]=="object",Iei=(0,GJt.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),uN=class t extends EI{constructor(e,n={}){let r;if(WX(e)?r=new URL(e.url):(r=new URL(e),e={}),r.username!==""||r.password!=="")throw new TypeError(`${r} is an url with embedded credentials.`);let i=n.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!WX(n)&&"data"in n&&Iei(),(n.body!=null||WX(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=n.body?n.body:WX(e)&&e.body!==null?p3(e):null;super(s,{size:n.size||e.size||0});let o=new uA(n.headers||e.headers||{});if(s!==null&&!o.has("Content-Type")){let u=l0e(s,this);u&&o.set("Content-Type",u)}let a=WX(e)?e.signal:null;if("signal"in n&&(a=n.signal),a!=null&&!dJt(a))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let c=n.referrer==null?e.referrer:n.referrer;if(c==="")c="no-referrer";else if(c){let u=new URL(c);c=/^about:(\/\/)?client$/.test(u)?"client":u}else c=void 0;this[Vp]={method:i,redirect:n.redirect||e.redirect||"follow",headers:o,parsedURL:r,signal:a,referrer:c},this.follow=n.follow===void 0?e.follow===void 0?20:e.follow:n.follow,this.compress=n.compress===void 0?e.compress===void 0?!0:e.compress:n.compress,this.counter=n.counter||e.counter||0,this.agent=n.agent||e.agent,this.highWaterMark=n.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=n.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=n.referrerPolicy||e.referrerPolicy||""}get method(){return this[Vp].method}get url(){return(0,UJt.format)(this[Vp].parsedURL)}get headers(){return this[Vp].headers}get redirect(){return this[Vp].redirect}get signal(){return this[Vp].signal}get referrer(){if(this[Vp].referrer==="no-referrer")return"";if(this[Vp].referrer==="client")return"about:client";if(this[Vp].referrer)return this[Vp].referrer.toString()}get referrerPolicy(){return this[Vp].referrerPolicy}set referrerPolicy(e){this[Vp].referrerPolicy=LJt(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(uN.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});$Jt=t=>{let{parsedURL:e}=t[Vp],n=new uA(t[Vp].headers);n.has("Accept")||n.set("Accept","*/*");let r=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(r="0"),t.body!==null){let a=TJt(t);typeof a=="number"&&!Number.isNaN(a)&&(r=String(a))}r&&n.set("Content-Length",r),t.referrerPolicy===""&&(t.referrerPolicy=OJt),t.referrer&&t.referrer!=="no-referrer"?t[Vp].referrer=FJt(t):t[Vp].referrer="no-referrer",t[Vp].referrer instanceof URL&&n.set("Referer",t.referrer),n.has("User-Agent")||n.set("User-Agent","node-fetch"),t.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=t;typeof i=="function"&&(i=i(e));let s=BJt(e),o={path:e.pathname+s,method:t.method,headers:n[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:o}}});var HX,HJt=v(()=>{p();r0e();HX=class extends xv{constructor(e,n="aborted"){super(e,n)}}});var VJt={};br(VJt,{AbortError:()=>HX,Blob:()=>yx,FetchError:()=>$f,File:()=>aN,FormData:()=>cN,Headers:()=>uA,Request:()=>uN,Response:()=>Qy,blobFrom:()=>EJt,blobFromSync:()=>yJt,default:()=>R9e,fileFrom:()=>bJt,fileFromSync:()=>_Jt,isRedirect:()=>$X});async function R9e(t,e){return new Promise((n,r)=>{let i=new uN(t,e),{parsedURL:s,options:o}=$Jt(i);if(!wei.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let f=tJt(i.url),g=new Qy(f,{headers:{"Content-Type":f.typeFull}});n(g);return}let a=(s.protocol==="https:"?jJt.default:qJt.default).request,{signal:c}=i,u=null,l=()=>{let f=new HX("The operation was aborted.");r(f),i.body&&i.body instanceof Uy.default.Readable&&i.body.destroy(f),!(!u||!u.body)&&u.body.emit("error",f)};if(c&&c.aborted){l();return}let d=()=>{l(),h()},m=a(s.toString(),o);c&&c.addEventListener("abort",d);let h=()=>{m.abort(),c&&c.removeEventListener("abort",d)};m.on("error",f=>{r(new $f(`request to ${i.url} failed, reason: ${f.message}`,"system",f)),h()}),Tei(m,f=>{u&&u.body&&u.body.destroy(f)}),process.version<"v14"&&m.on("socket",f=>{let g;f.prependListener("end",()=>{g=f._eventsCount}),f.prependListener("close",A=>{if(u&&g{m.setTimeout(0);let g=RJt(f.rawHeaders);if($X(f.statusCode)){let S=g.get("Location"),C=null;try{C=S===null?null:new URL(S,i.url)}catch{if(i.redirect!=="manual"){r(new $f(`uri requested responds with an invalid redirect URL: ${S}`,"invalid-redirect")),h();return}}switch(i.redirect){case"error":r(new $f(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),h();return;case"manual":break;case"follow":{if(C===null)break;if(i.counter>=i.follow){r(new $f(`maximum redirect reached at: ${i.url}`,"max-redirect")),h();return}let I={headers:new uA(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:p3(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!pJt(i.url,C)||!mJt(i.url,C))for(let k of["authorization","www-authenticate","cookie","cookie2"])I.headers.delete(k);if(f.statusCode!==303&&i.body&&e.body instanceof Uy.default.Readable){r(new $f("Cannot follow redirect with body being a readable stream","unsupported-redirect")),h();return}(f.statusCode===303||(f.statusCode===301||f.statusCode===302)&&i.method==="POST")&&(I.method="GET",I.body=void 0,I.headers.delete("content-length"));let w=QJt(g);w&&(I.referrerPolicy=w),n(R9e(new uN(C,I))),h();return}default:return r(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}c&&f.once("end",()=>{c.removeEventListener("abort",d)});let A=(0,Uy.pipeline)(f,new Uy.PassThrough,S=>{S&&r(S)});process.version<"v12.10"&&f.on("aborted",d);let y={url:i.url,status:f.statusCode,statusText:f.statusMessage,headers:g,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},E=g.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||E===null||f.statusCode===204||f.statusCode===304){u=new Qy(A,y),n(u);return}let _={flush:o2.default.Z_SYNC_FLUSH,finishFlush:o2.default.Z_SYNC_FLUSH};if(E==="gzip"||E==="x-gzip"){A=(0,Uy.pipeline)(A,o2.default.createGunzip(_),S=>{S&&r(S)}),u=new Qy(A,y),n(u);return}if(E==="deflate"||E==="x-deflate"){let S=(0,Uy.pipeline)(f,new Uy.PassThrough,C=>{C&&r(C)});S.once("data",C=>{(C[0]&15)===8?A=(0,Uy.pipeline)(A,o2.default.createInflate(),I=>{I&&r(I)}):A=(0,Uy.pipeline)(A,o2.default.createInflateRaw(),I=>{I&&r(I)}),u=new Qy(A,y),n(u)}),S.once("end",()=>{u||(u=new Qy(A,y),n(u))});return}if(E==="br"){A=(0,Uy.pipeline)(A,o2.default.createBrotliDecompress(),S=>{S&&r(S)}),u=new Qy(A,y),n(u);return}u=new Qy(A,y),n(u)}),vJt(m,i).catch(r)})}function Tei(t,e){let n=qX.Buffer.from(`0\r \r -`),r=!1,s=!1,i;t.on("response",o=>{let{headers:a}=o;r=a["transfer-encoding"]==="chunked"&&!a["content-length"]}),t.on("socket",o=>{let a=()=>{if(r&&!s){let u=new Error("Premature close");u.code="ERR_STREAM_PREMATURE_CLOSE",e(u)}},c=u=>{s=kK.Buffer.compare(u.slice(-5),n)===0,!s&&i&&(s=kK.Buffer.compare(i.slice(-3),n.slice(0,3))===0&&kK.Buffer.compare(u.slice(-2),n.slice(3))===0),i=u};o.prependListener("close",a),o.on("data",c),t.on("close",()=>{o.removeListener("close",a),o.removeListener("data",c)})})}var c$t,l$t,sO,EA,kK,WRr,d$t=V(()=>{p();c$t=Gt(require("node:http"),1),l$t=Gt(require("node:https"),1),sO=Gt(require("node:zlib"),1),EA=Gt(require("node:stream"),1),kK=require("node:buffer");E2t();lme();j2t();dme();o$t();Kqe();a$t();r3e();tme();sme();s3e();Xqe();WRr=new Set(["data:","http:","https:"])});var m$t=ee(KW=>{"use strict";p();var HRr=KW&&KW.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},YW;Object.defineProperty(KW,"__esModule",{value:!0});KW.Gaxios=void 0;var VRr=HRr(Fqe()),jRr=require("https"),iO=$qe(),YRr=A2t(),p$t=require("stream"),h$t=qqe(),KRr=async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),zRr=204,pme=class{agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new h$t.GaxiosInterceptorManager,response:new h$t.GaxiosInterceptorManager}}fetch(...e){let n=e[0],r=e[1],s,i=new Headers;return typeof n=="string"?s=new URL(n):n instanceof URL?s=n:n&&n.url&&(s=new URL(n.url)),n&&typeof n=="object"&&"headers"in n&&YW.mergeHeaders(i,n.headers),r&&YW.mergeHeaders(i,new Headers(r.headers)),typeof n=="object"&&!(n instanceof URL)?this.request({...r,...n,headers:i,url:s}):this.request({...r,headers:i,url:s})}async request(e={}){let n=await this.#r(e);return n=await this.#t(n),this.#n(this._request(n))}async _defaultAdapter(e){let n=e.fetchImplementation||this.defaults.fetchImplementation||await YW.#a(),r={...e};delete r.data;let s=await n(e.url,r),i=await this.getResponseData(e,s);return Object.getOwnPropertyDescriptor(s,"data")?.configurable||Object.defineProperties(s,{data:{configurable:!0,writable:!0,enumerable:!0,value:i}}),Object.assign(s,{config:e,data:i})}async _request(e){try{let n;if(e.adapter?n=await e.adapter(e,this._defaultAdapter.bind(this)):n=await this._defaultAdapter(e),!e.validateStatus(n.status)){if(e.responseType==="stream"){let s=[];for await(let i of n.data)s.push(i);n.data=Buffer.concat(s.map(i=>typeof i=="string"?Buffer.from(i):i)).toString("utf8")}let r=iO.GaxiosError.extractAPIErrorFromResponse(n,`Request failed with status code ${n.status}`);throw new iO.GaxiosError(r?.message,e,n,r)}return n}catch(n){let r;n instanceof iO.GaxiosError?r=n:n instanceof Error?r=new iO.GaxiosError(n.message,e,void 0,n):r=new iO.GaxiosError("Unexpected Gaxios Error",e,void 0,n);let{shouldRetry:s,config:i}=await(0,YRr.getRetryConfig)(r);if(s&&i)return r.config.retryConfig.currentRetryAttempt=i.retryConfig.currentRetryAttempt,e.retryConfig=r.config?.retryConfig,this.#i(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(r),r}}async getResponseData(e,n){if(n.status===zRr)return"";if(e.maxContentLength&&n.headers.has("content-length")&&e.maxContentLength=200&&e<300}async getResponseDataFromContentType(e){let n=e.headers.get("Content-Type");if(n===null)return e.text();if(n=n.toLowerCase(),n.includes("application/json")){let r=await e.text();try{r=JSON.parse(r)}catch{}return r}else return n.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,n){let r=`--${n}--`;for(let s of e){let i=s.headers.get("Content-Type")||"application/octet-stream";yield`--${n}\r -Content-Type: ${i}\r +`),r=!1,i=!1,s;t.on("response",o=>{let{headers:a}=o;r=a["transfer-encoding"]==="chunked"&&!a["content-length"]}),t.on("socket",o=>{let a=()=>{if(r&&!i){let u=new Error("Premature close");u.code="ERR_STREAM_PREMATURE_CLOSE",e(u)}},c=u=>{i=qX.Buffer.compare(u.slice(-5),n)===0,!i&&s&&(i=qX.Buffer.compare(s.slice(-3),n.slice(0,3))===0&&qX.Buffer.compare(u.slice(-2),n.slice(3))===0),s=u};o.prependListener("close",a),o.on("data",c),t.on("close",()=>{o.removeListener("close",a),o.removeListener("data",c)})})}var qJt,jJt,o2,Uy,qX,wei,YJt=v(()=>{p();qJt=Ot(require("node:http"),1),jJt=Ot(require("node:https"),1),o2=Ot(require("node:zlib"),1),Uy=Ot(require("node:stream"),1),qX=require("node:buffer");nJt();u0e();kJt();p0e();WJt();E9e();HJt();T9e();n0e();s0e();v9e();x9e();wei=new Set(["data:","http:","https:"])});var JJt=re(f3=>{"use strict";p();var vei=f3&&f3.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},h3;Object.defineProperty(f3,"__esModule",{value:!0});f3.Gaxios=void 0;var Rei=vei(a9e()),kei=require("https"),a2=u9e(),Bei=UKt(),zJt=require("stream"),KJt=m9e(),Nei=async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),Dei=204,m0e=class{agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new KJt.GaxiosInterceptorManager,response:new KJt.GaxiosInterceptorManager}}fetch(...e){let n=e[0],r=e[1],i,s=new Headers;return typeof n=="string"?i=new URL(n):n instanceof URL?i=n:n&&n.url&&(i=new URL(n.url)),n&&typeof n=="object"&&"headers"in n&&h3.mergeHeaders(s,n.headers),r&&h3.mergeHeaders(s,new Headers(r.headers)),typeof n=="object"&&!(n instanceof URL)?this.request({...r,...n,headers:s,url:i}):this.request({...r,headers:s,url:i})}async request(e={}){let n=await this.#r(e);return n=await this.#t(n),this.#n(this._request(n))}async _defaultAdapter(e){let n=e.fetchImplementation||this.defaults.fetchImplementation||await h3.#c(),r={...e};delete r.data;let i=await n(e.url,r),s=await this.getResponseData(e,i);return Object.getOwnPropertyDescriptor(i,"data")?.configurable||Object.defineProperties(i,{data:{configurable:!0,writable:!0,enumerable:!0,value:s}}),Object.assign(i,{config:e,data:s})}async _request(e){try{let n;if(e.adapter?n=await e.adapter(e,this._defaultAdapter.bind(this)):n=await this._defaultAdapter(e),!e.validateStatus(n.status)){if(e.responseType==="stream"){let i=[];for await(let s of n.data)i.push(s);n.data=Buffer.concat(i.map(s=>typeof s=="string"?Buffer.from(s):s)).toString("utf8")}let r=a2.GaxiosError.extractAPIErrorFromResponse(n,`Request failed with status code ${n.status}`);throw new a2.GaxiosError(r?.message,e,n,r)}return n}catch(n){let r;n instanceof a2.GaxiosError?r=n:n instanceof Error?r=new a2.GaxiosError(n.message,e,void 0,n):r=new a2.GaxiosError("Unexpected Gaxios Error",e,void 0,n);let{shouldRetry:i,config:s}=await(0,Bei.getRetryConfig)(r);if(i&&s)return r.config.retryConfig.currentRetryAttempt=s.retryConfig.currentRetryAttempt,e.retryConfig=r.config?.retryConfig,this.#i(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(r),r}}async getResponseData(e,n){if(n.status===Dei)return"";if(e.maxContentLength&&n.headers.has("content-length")&&e.maxContentLength=200&&e<300}async getResponseDataFromContentType(e){let n=e.headers.get("Content-Type");if(n===null)return e.text();if(n=n.toLowerCase(),n.includes("application/json")){let r=await e.text();try{r=JSON.parse(r)}catch{}return r}else return n.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,n){let r=`--${n}--`;for(let i of e){let s=i.headers.get("Content-Type")||"application/octet-stream";yield`--${n}\r +Content-Type: ${s}\r \r -`,typeof s.content=="string"?yield s.content:yield*s.content,yield`\r -`}yield r}static#s;static#c;static async#o(){return this.#s||=(await Promise.resolve().then(()=>Gt(KQe()))).HttpsProxyAgent,this.#s}static async#a(){let e=typeof window<"u"&&!!window;return this.#c||=e?window.fetch:(await Promise.resolve().then(()=>(d$t(),u$t))).default,this.#c}static mergeHeaders(e,...n){e=e instanceof Headers?e:new Headers(e);for(let r of n)(r instanceof Headers?r:new Headers(r)).forEach((i,o)=>{o==="set-cookie"?e.append(o,i):e.set(o,i)});return e}};KW.Gaxios=pme;YW=pme});var $p=ee(wm=>{"use strict";p();var JRr=wm&&wm.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),XRr=wm&&wm.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&JRr(e,t,n)};Object.defineProperty(wm,"__esModule",{value:!0});wm.instance=wm.Gaxios=wm.GaxiosError=void 0;wm.request=ekr;var f$t=m$t();Object.defineProperty(wm,"Gaxios",{enumerable:!0,get:function(){return f$t.Gaxios}});var ZRr=$qe();Object.defineProperty(wm,"GaxiosError",{enumerable:!0,get:function(){return ZRr.GaxiosError}});XRr(qqe(),wm);wm.instance=new f$t.Gaxios;async function ekr(t){return wm.instance.request(t)}});var o3e=ee((g$t,hme)=>{p();(function(t){"use strict";var e,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,r=Math.ceil,s=Math.floor,i="[BigNumber Error] ",o=i+"Number primitive has more than 15 significant digits: ",a=1e14,c=14,u=9007199254740991,l=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,h=1e9;function m(I){var x,w,R,N=Re.prototype={constructor:Re,toString:null,valueOf:null},P=new Re(1),G=20,$=4,Q=-7,H=21,oe=-1e7,re=1e7,Z=!1,q=1,ce=0,be={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Be="0123456789abcdefghijklmnopqrstuvwxyz",Me=!0;function Re(j,X){var ae,me,Ae,ue,ye,Ie,Ee,Te,_e=this;if(!(_e instanceof Re))return new Re(j,X);if(X==null){if(j&&j._isBigNumber===!0){_e.s=j.s,!j.c||j.e>re?_e.c=_e.e=null:j.e=10;ye/=10,ue++);ue>re?_e.c=_e.e=null:(_e.e=ue,_e.c=[j]);return}Te=String(j)}else{if(!n.test(Te=String(j)))return R(_e,Te,Ie);_e.s=Te.charCodeAt(0)==45?(Te=Te.slice(1),-1):1}(ue=Te.indexOf("."))>-1&&(Te=Te.replace(".","")),(ye=Te.search(/e/i))>0?(ue<0&&(ue=ye),ue+=+Te.slice(ye+1),Te=Te.substring(0,ye)):ue<0&&(ue=Te.length)}else{if(y(X,2,Be.length,"Base"),X==10&&Me)return _e=new Re(j),J(_e,G+_e.e+1,$);if(Te=String(j),Ie=typeof j=="number"){if(j*0!=0)return R(_e,Te,Ie,X);if(_e.s=1/j<0?(Te=Te.slice(1),-1):1,Re.DEBUG&&Te.replace(/^0\.0*|\./,"").length>15)throw Error(o+j)}else _e.s=Te.charCodeAt(0)===45?(Te=Te.slice(1),-1):1;for(ae=Be.slice(0,X),ue=ye=0,Ee=Te.length;yeue){ue=Ee;continue}}else if(!Ae&&(Te==Te.toUpperCase()&&(Te=Te.toLowerCase())||Te==Te.toLowerCase()&&(Te=Te.toUpperCase()))){Ae=!0,ye=-1,ue=0;continue}return R(_e,String(j),Ie,X)}Ie=!1,Te=w(Te,X,10,_e.s),(ue=Te.indexOf("."))>-1?Te=Te.replace(".",""):ue=Te.length}for(ye=0;Te.charCodeAt(ye)===48;ye++);for(Ee=Te.length;Te.charCodeAt(--Ee)===48;);if(Te=Te.slice(ye,++Ee)){if(Ee-=ye,Ie&&Re.DEBUG&&Ee>15&&(j>u||j!==s(j)))throw Error(o+_e.s*j);if((ue=ue-ye-1)>re)_e.c=_e.e=null;else if(ue=-h&&Ae<=h&&Ae===s(Ae)){if(me[0]===0){if(Ae===0&&me.length===1)return!0;break e}if(X=(Ae+1)%c,X<1&&(X+=c),String(me[0]).length==X){for(X=0;X=a||ae!==s(ae))break e;if(ae!==0)return!0}}}else if(me===null&&Ae===null&&(ue===null||ue===1||ue===-1))return!0;throw Error(i+"Invalid BigNumber: "+j)},Re.maximum=Re.max=function(){return ie(arguments,-1)},Re.minimum=Re.min=function(){return ie(arguments,1)},Re.random=(function(){var j=9007199254740992,X=Math.random()*j&2097151?function(){return s(Math.random()*j)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(ae){var me,Ae,ue,ye,Ie,Ee=0,Te=[],_e=new Re(P);if(ae==null?ae=G:y(ae,0,h),ye=r(ae/c),Z)if(crypto.getRandomValues){for(me=crypto.getRandomValues(new Uint32Array(ye*=2));Ee>>11),Ie>=9e15?(Ae=crypto.getRandomValues(new Uint32Array(2)),me[Ee]=Ae[0],me[Ee+1]=Ae[1]):(Te.push(Ie%1e14),Ee+=2);Ee=ye/2}else if(crypto.randomBytes){for(me=crypto.randomBytes(ye*=7);Ee=9e15?crypto.randomBytes(7).copy(me,Ee):(Te.push(Ie%1e14),Ee+=7);Ee=ye/7}else throw Z=!1,Error(i+"crypto unavailable");if(!Z)for(;Ee=10;Ie/=10,Ee++);EeAe-1&&(Ie[ye+1]==null&&(Ie[ye+1]=0),Ie[ye+1]+=Ie[ye]/Ae|0,Ie[ye]%=Ae)}return Ie.reverse()}return function(ae,me,Ae,ue,ye){var Ie,Ee,Te,_e,z,We,He,dt,it=ae.indexOf("."),ze=G,rt=$;for(it>=0&&(_e=ce,ce=0,ae=ae.replace(".",""),dt=new Re(me),We=dt.pow(ae.length-it),ce=_e,dt.c=X(C(g(We.c),We.e,"0"),10,Ae,j),dt.e=dt.c.length),He=X(ae,me,Ae,ye?(Ie=Be,j):(Ie=j,Be)),Te=_e=He.length;He[--_e]==0;He.pop());if(!He[0])return Ie.charAt(0);if(it<0?--Te:(We.c=He,We.e=Te,We.s=ue,We=x(We,dt,ze,rt,Ae),He=We.c,z=We.r,Te=We.e),Ee=Te+ze+1,it=He[Ee],_e=Ae/2,z=z||Ee<0||He[Ee+1]!=null,z=rt<4?(it!=null||z)&&(rt==0||rt==(We.s<0?3:2)):it>_e||it==_e&&(rt==4||z||rt==6&&He[Ee-1]&1||rt==(We.s<0?8:7)),Ee<1||!He[0])ae=z?C(Ie.charAt(1),-ze,Ie.charAt(0)):Ie.charAt(0);else{if(He.length=Ee,z)for(--Ae;++He[--Ee]>Ae;)He[Ee]=0,Ee||(++Te,He=[1].concat(He));for(_e=He.length;!He[--_e];);for(it=0,ae="";it<=_e;ae+=Ie.charAt(He[it++]));ae=C(ae,Te,Ie.charAt(0))}return ae}})(),x=(function(){function j(me,Ae,ue){var ye,Ie,Ee,Te,_e=0,z=me.length,We=Ae%d,He=Ae/d|0;for(me=me.slice();z--;)Ee=me[z]%d,Te=me[z]/d|0,ye=He*Ee+Te*We,Ie=We*Ee+ye%d*d+_e,_e=(Ie/ue|0)+(ye/d|0)+He*Te,me[z]=Ie%ue;return _e&&(me=[_e].concat(me)),me}function X(me,Ae,ue,ye){var Ie,Ee;if(ue!=ye)Ee=ue>ye?1:-1;else for(Ie=Ee=0;IeAe[Ie]?1:-1;break}return Ee}function ae(me,Ae,ue,ye){for(var Ie=0;ue--;)me[ue]-=Ie,Ie=me[ue]1;me.splice(0,1));}return function(me,Ae,ue,ye,Ie){var Ee,Te,_e,z,We,He,dt,it,ze,rt,Ct,sn,Mt,Lt,Pt,Ze,Pe,Xe=me.s==Ae.s?1:-1,At=me.c,Vt=Ae.c;if(!At||!At[0]||!Vt||!Vt[0])return new Re(!me.s||!Ae.s||(At?Vt&&At[0]==Vt[0]:!Vt)?NaN:At&&At[0]==0||!Vt?Xe*0:Xe/0);for(it=new Re(Xe),ze=it.c=[],Te=me.e-Ae.e,Xe=ue+Te+1,Ie||(Ie=a,Te=f(me.e/c)-f(Ae.e/c),Xe=Xe/c|0),_e=0;Vt[_e]==(At[_e]||0);_e++);if(Vt[_e]>(At[_e]||0)&&Te--,Xe<0)ze.push(1),z=!0;else{for(Lt=At.length,Ze=Vt.length,_e=0,Xe+=2,We=s(Ie/(Vt[0]+1)),We>1&&(Vt=j(Vt,We,Ie),At=j(At,We,Ie),Ze=Vt.length,Lt=At.length),Mt=Ze,rt=At.slice(0,Ze),Ct=rt.length;Ct=Ie/2&&Pt++;do{if(We=0,Ee=X(Vt,rt,Ze,Ct),Ee<0){if(sn=rt[0],Ze!=Ct&&(sn=sn*Ie+(rt[1]||0)),We=s(sn/Pt),We>1)for(We>=Ie&&(We=Ie-1),He=j(Vt,We,Ie),dt=He.length,Ct=rt.length;X(He,rt,dt,Ct)==1;)We--,ae(He,Ze=10;Xe/=10,_e++);J(it,ue+(it.e=_e+Te*c-1)+1,ye,z)}else it.e=Te,it.r=+z;return it}})();function se(j,X,ae,me){var Ae,ue,ye,Ie,Ee;if(ae==null?ae=$:y(ae,0,8),!j.c)return j.toString();if(Ae=j.c[0],ye=j.e,X==null)Ee=g(j.c),Ee=me==1||me==2&&(ye<=Q||ye>=H)?S(Ee,ye):C(Ee,ye,"0");else if(j=J(new Re(j),X,ae),ue=j.e,Ee=g(j.c),Ie=Ee.length,me==1||me==2&&(X<=ue||ue<=Q)){for(;Ieye),Ee=C(Ee,ue,"0"),ue+1>Ie){if(--X>0)for(Ee+=".";X--;Ee+="0");}else if(X+=ue-Ie,X>0)for(ue+1==Ie&&(Ee+=".");X--;Ee+="0");return j.s<0&&Ae?"-"+Ee:Ee}function ie(j,X){for(var ae,me,Ae=1,ue=new Re(j[0]);Ae=10;Ae/=10,me++);return(ae=me+ae*c-1)>re?j.c=j.e=null:ae=10;Ie/=10,Ae++);if(ue=X-Ae,ue<0)ue+=c,ye=X,Ee=z[Te=0],_e=s(Ee/We[Ae-ye-1]%10);else if(Te=r((ue+1)/c),Te>=z.length)if(me){for(;z.length<=Te;z.push(0));Ee=_e=0,Ae=1,ue%=c,ye=ue-c+1}else break e;else{for(Ee=Ie=z[Te],Ae=1;Ie>=10;Ie/=10,Ae++);ue%=c,ye=ue-c+Ae,_e=ye<0?0:s(Ee/We[Ae-ye-1]%10)}if(me=me||X<0||z[Te+1]!=null||(ye<0?Ee:Ee%We[Ae-ye-1]),me=ae<4?(_e||me)&&(ae==0||ae==(j.s<0?3:2)):_e>5||_e==5&&(ae==4||me||ae==6&&(ue>0?ye>0?Ee/We[Ae-ye]:0:z[Te-1])%10&1||ae==(j.s<0?8:7)),X<1||!z[0])return z.length=0,me?(X-=j.e+1,z[0]=We[(c-X%c)%c],j.e=-X||0):z[0]=j.e=0,j;if(ue==0?(z.length=Te,Ie=1,Te--):(z.length=Te+1,Ie=We[c-ue],z[Te]=ye>0?s(Ee/We[Ae-ye]%We[ye])*Ie:0),me)for(;;)if(Te==0){for(ue=1,ye=z[0];ye>=10;ye/=10,ue++);for(ye=z[0]+=Ie,Ie=1;ye>=10;ye/=10,Ie++);ue!=Ie&&(j.e++,z[0]==a&&(z[0]=1));break}else{if(z[Te]+=Ie,z[Te]!=a)break;z[Te--]=0,Ie=1}for(ue=z.length;z[--ue]===0;z.pop());}j.e>re?j.c=j.e=null:j.e=H?S(X,ae):C(X,ae,"0"),j.s<0?"-"+X:X)}return N.absoluteValue=N.abs=function(){var j=new Re(this);return j.s<0&&(j.s=1),j},N.comparedTo=function(j,X){return A(this,new Re(j,X))},N.decimalPlaces=N.dp=function(j,X){var ae,me,Ae,ue=this;if(j!=null)return y(j,0,h),X==null?X=$:y(X,0,8),J(new Re(ue),j+ue.e+1,X);if(!(ae=ue.c))return null;if(me=((Ae=ae.length-1)-f(this.e/c))*c,Ae=ae[Ae])for(;Ae%10==0;Ae/=10,me--);return me<0&&(me=0),me},N.dividedBy=N.div=function(j,X){return x(this,new Re(j,X),G,$)},N.dividedToIntegerBy=N.idiv=function(j,X){return x(this,new Re(j,X),0,1)},N.exponentiatedBy=N.pow=function(j,X){var ae,me,Ae,ue,ye,Ie,Ee,Te,_e,z=this;if(j=new Re(j),j.c&&!j.isInteger())throw Error(i+"Exponent not an integer: "+te(j));if(X!=null&&(X=new Re(X)),Ie=j.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!j.c||!j.c[0])return _e=new Re(Math.pow(+te(z),Ie?j.s*(2-b(j)):+te(j))),X?_e.mod(X):_e;if(Ee=j.s<0,X){if(X.c?!X.c[0]:!X.s)return new Re(NaN);me=!Ee&&z.isInteger()&&X.isInteger(),me&&(z=z.mod(X))}else{if(j.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||Ie&&z.c[1]>=24e7:z.c[0]<8e13||Ie&&z.c[0]<=9999975e7)))return ue=z.s<0&&b(j)?-0:0,z.e>-1&&(ue=1/ue),new Re(Ee?1/ue:ue);ce&&(ue=r(ce/c+2))}for(Ie?(ae=new Re(.5),Ee&&(j.s=1),Te=b(j)):(Ae=Math.abs(+te(j)),Te=Ae%2),_e=new Re(P);;){if(Te){if(_e=_e.times(z),!_e.c)break;ue?_e.c.length>ue&&(_e.c.length=ue):me&&(_e=_e.mod(X))}if(Ae){if(Ae=s(Ae/2),Ae===0)break;Te=Ae%2}else if(j=j.times(ae),J(j,j.e+1,1),j.e>14)Te=b(j);else{if(Ae=+te(j),Ae===0)break;Te=Ae%2}z=z.times(z),ue?z.c&&z.c.length>ue&&(z.c.length=ue):me&&(z=z.mod(X))}return me?_e:(Ee&&(_e=P.div(_e)),X?_e.mod(X):ue?J(_e,ce,$,ye):_e)},N.integerValue=function(j){var X=new Re(this);return j==null?j=$:y(j,0,8),J(X,X.e+1,j)},N.isEqualTo=N.eq=function(j,X){return A(this,new Re(j,X))===0},N.isFinite=function(){return!!this.c},N.isGreaterThan=N.gt=function(j,X){return A(this,new Re(j,X))>0},N.isGreaterThanOrEqualTo=N.gte=function(j,X){return(X=A(this,new Re(j,X)))===1||X===0},N.isInteger=function(){return!!this.c&&f(this.e/c)>this.c.length-2},N.isLessThan=N.lt=function(j,X){return A(this,new Re(j,X))<0},N.isLessThanOrEqualTo=N.lte=function(j,X){return(X=A(this,new Re(j,X)))===-1||X===0},N.isNaN=function(){return!this.s},N.isNegative=function(){return this.s<0},N.isPositive=function(){return this.s>0},N.isZero=function(){return!!this.c&&this.c[0]==0},N.minus=function(j,X){var ae,me,Ae,ue,ye=this,Ie=ye.s;if(j=new Re(j,X),X=j.s,!Ie||!X)return new Re(NaN);if(Ie!=X)return j.s=-X,ye.plus(j);var Ee=ye.e/c,Te=j.e/c,_e=ye.c,z=j.c;if(!Ee||!Te){if(!_e||!z)return _e?(j.s=-X,j):new Re(z?ye:NaN);if(!_e[0]||!z[0])return z[0]?(j.s=-X,j):new Re(_e[0]?ye:$==3?-0:0)}if(Ee=f(Ee),Te=f(Te),_e=_e.slice(),Ie=Ee-Te){for((ue=Ie<0)?(Ie=-Ie,Ae=_e):(Te=Ee,Ae=z),Ae.reverse(),X=Ie;X--;Ae.push(0));Ae.reverse()}else for(me=(ue=(Ie=_e.length)<(X=z.length))?Ie:X,Ie=X=0;X0)for(;X--;_e[ae++]=0);for(X=a-1;me>Ie;){if(_e[--me]=0;){for(ae=0,We=sn[Ae]%ze,He=sn[Ae]/ze|0,ye=Ee,ue=Ae+ye;ue>Ae;)Te=Ct[--ye]%ze,_e=Ct[ye]/ze|0,Ie=He*Te+_e*We,Te=We*Te+Ie%ze*ze+dt[ue]+ae,ae=(Te/it|0)+(Ie/ze|0)+He*_e,dt[ue--]=Te%it;dt[ue]=ae}return ae?++me:dt.splice(0,1),ne(j,dt,me)},N.negated=function(){var j=new Re(this);return j.s=-j.s||null,j},N.plus=function(j,X){var ae,me=this,Ae=me.s;if(j=new Re(j,X),X=j.s,!Ae||!X)return new Re(NaN);if(Ae!=X)return j.s=-X,me.minus(j);var ue=me.e/c,ye=j.e/c,Ie=me.c,Ee=j.c;if(!ue||!ye){if(!Ie||!Ee)return new Re(Ae/0);if(!Ie[0]||!Ee[0])return Ee[0]?j:new Re(Ie[0]?me:Ae*0)}if(ue=f(ue),ye=f(ye),Ie=Ie.slice(),Ae=ue-ye){for(Ae>0?(ye=ue,ae=Ee):(Ae=-Ae,ae=Ie),ae.reverse();Ae--;ae.push(0));ae.reverse()}for(Ae=Ie.length,X=Ee.length,Ae-X<0&&(ae=Ee,Ee=Ie,Ie=ae,X=Ae),Ae=0;X;)Ae=(Ie[--X]=Ie[X]+Ee[X]+Ae)/a|0,Ie[X]=a===Ie[X]?0:Ie[X]%a;return Ae&&(Ie=[Ae].concat(Ie),++ye),ne(j,Ie,ye)},N.precision=N.sd=function(j,X){var ae,me,Ae,ue=this;if(j!=null&&j!==!!j)return y(j,1,h),X==null?X=$:y(X,0,8),J(new Re(ue),j,X);if(!(ae=ue.c))return null;if(Ae=ae.length-1,me=Ae*c+1,Ae=ae[Ae]){for(;Ae%10==0;Ae/=10,me--);for(Ae=ae[0];Ae>=10;Ae/=10,me++);}return j&&ue.e+1>me&&(me=ue.e+1),me},N.shiftedBy=function(j){return y(j,-u,u),this.times("1e"+j)},N.squareRoot=N.sqrt=function(){var j,X,ae,me,Ae,ue=this,ye=ue.c,Ie=ue.s,Ee=ue.e,Te=G+4,_e=new Re("0.5");if(Ie!==1||!ye||!ye[0])return new Re(!Ie||Ie<0&&(!ye||ye[0])?NaN:ye?ue:1/0);if(Ie=Math.sqrt(+te(ue)),Ie==0||Ie==1/0?(X=g(ye),(X.length+Ee)%2==0&&(X+="0"),Ie=Math.sqrt(+X),Ee=f((Ee+1)/2)-(Ee<0||Ee%2),Ie==1/0?X="5e"+Ee:(X=Ie.toExponential(),X=X.slice(0,X.indexOf("e")+1)+Ee),ae=new Re(X)):ae=new Re(Ie+""),ae.c[0]){for(Ee=ae.e,Ie=Ee+Te,Ie<3&&(Ie=0);;)if(Ae=ae,ae=_e.times(Ae.plus(x(ue,Ae,Te,1))),g(Ae.c).slice(0,Ie)===(X=g(ae.c)).slice(0,Ie))if(ae.e0&&dt>0){for(ue=dt%Ie||Ie,_e=He.substr(0,ue);ue0&&(_e+=Te+He.slice(ue)),We&&(_e="-"+_e)}me=z?_e+(ae.decimalSeparator||"")+((Ee=+ae.fractionGroupSize)?z.replace(new RegExp("\\d{"+Ee+"}\\B","g"),"$&"+(ae.fractionGroupSeparator||"")):z):_e}return(ae.prefix||"")+me+(ae.suffix||"")},N.toFraction=function(j){var X,ae,me,Ae,ue,ye,Ie,Ee,Te,_e,z,We,He=this,dt=He.c;if(j!=null&&(Ie=new Re(j),!Ie.isInteger()&&(Ie.c||Ie.s!==1)||Ie.lt(P)))throw Error(i+"Argument "+(Ie.isInteger()?"out of range: ":"not an integer: ")+te(Ie));if(!dt)return new Re(He);for(X=new Re(P),Te=ae=new Re(P),me=Ee=new Re(P),We=g(dt),ue=X.e=We.length-He.e-1,X.c[0]=l[(ye=ue%c)<0?c+ye:ye],j=!j||Ie.comparedTo(X)>0?ue>0?X:Te:Ie,ye=re,re=1/0,Ie=new Re(We),Ee.c[0]=0;_e=x(Ie,X,0,1),Ae=ae.plus(_e.times(me)),Ae.comparedTo(j)!=1;)ae=me,me=Ae,Te=Ee.plus(_e.times(Ae=Te)),Ee=Ae,X=Ie.minus(_e.times(Ae=X)),Ie=Ae;return Ae=x(j.minus(ae),me,0,1),Ee=Ee.plus(Ae.times(Te)),ae=ae.plus(Ae.times(me)),Ee.s=Te.s=He.s,ue=ue*2,z=x(Te,me,ue,$).minus(He).abs().comparedTo(x(Ee,ae,ue,$).minus(He).abs())<1?[Te,me]:[Ee,ae],re=ye,z},N.toNumber=function(){return+te(this)},N.toPrecision=function(j,X){return j!=null&&y(j,1,h),se(this,j,X,2)},N.toString=function(j){var X,ae=this,me=ae.s,Ae=ae.e;return Ae===null?me?(X="Infinity",me<0&&(X="-"+X)):X="NaN":(j==null?X=Ae<=Q||Ae>=H?S(g(ae.c),Ae):C(g(ae.c),Ae,"0"):j===10&&Me?(ae=J(new Re(ae),G+Ae+1,$),X=C(g(ae.c),ae.e,"0")):(y(j,2,Be.length,"Base"),X=w(C(g(ae.c),Ae,"0"),10,j,me,!0)),me<0&&ae.c[0]&&(X="-"+X)),X},N.valueOf=N.toJSON=function(){return te(this)},N._isBigNumber=!0,I!=null&&Re.set(I),Re}function f(I){var x=I|0;return I>0||I===x?x:x-1}function g(I){for(var x,w,R=1,N=I.length,P=I[0]+"";RH^w?1:-1;for($=(Q=N.length)<(H=P.length)?Q:H,G=0;G<$;G++)if(N[G]!=P[G])return N[G]>P[G]^w?1:-1;return Q==H?0:Q>H^w?1:-1}function y(I,x,w,R){if(Iw||I!==s(I))throw Error(i+(R||"Argument")+(typeof I=="number"?Iw?" out of range: ":" not an integer: ":" not a primitive number: ")+String(I))}function b(I){var x=I.c.length-1;return f(I.e/c)==x&&I.c[x]%2!=0}function S(I,x){return(I.length>1?I.charAt(0)+"."+I.slice(1):I)+(x<0?"e":"e+")+x}function C(I,x,w){var R,N;if(x<0){for(N=w+".";++x;N+=w);I=N+I}else if(R=I.length,++x>R){for(N=w,x-=R;--x;N+=w);I+=N}else x{p();var A$t=o3e(),y$t=E$t.exports;(function(){"use strict";function t(u){return u<10?"0"+u:u}var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r,s,i={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},o;function a(u){return n.lastIndex=0,n.test(u)?'"'+u.replace(n,function(l){var d=i[l];return typeof d=="string"?d:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+u+'"'}function c(u,l){var d,h,m,f,g=r,A,y=l[u],b=y!=null&&(y instanceof A$t||A$t.isBigNumber(y));switch(y&&typeof y=="object"&&typeof y.toJSON=="function"&&(y=y.toJSON(u)),typeof o=="function"&&(y=o.call(l,u,y)),typeof y){case"string":return b?y:a(y);case"number":return isFinite(y)?String(y):"null";case"boolean":case"null":case"bigint":return String(y);case"object":if(!y)return"null";if(r+=s,A=[],Object.prototype.toString.apply(y)==="[object Array]"){for(f=y.length,d=0;dOt(eJt()))).HttpsProxyAgent,this.#s}static async#c(){let e=typeof window<"u"&&!!window;return this.#o||=e?window.fetch:(await Promise.resolve().then(()=>(YJt(),VJt))).default,this.#o}static mergeHeaders(e,...n){e=e instanceof Headers?e:new Headers(e);for(let r of n)(r instanceof Headers?r:new Headers(r)).forEach((s,o)=>{o==="set-cookie"?e.append(o,s):e.set(o,s)});return e}};f3.Gaxios=m0e;h3=m0e});var Um=re(Wf=>{"use strict";p();var Pei=Wf&&Wf.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Mei=Wf&&Wf.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Pei(e,t,n)};Object.defineProperty(Wf,"__esModule",{value:!0});Wf.instance=Wf.Gaxios=Wf.GaxiosError=void 0;Wf.request=Lei;var XJt=JJt();Object.defineProperty(Wf,"Gaxios",{enumerable:!0,get:function(){return XJt.Gaxios}});var Oei=u9e();Object.defineProperty(Wf,"GaxiosError",{enumerable:!0,get:function(){return Oei.GaxiosError}});Mei(m9e(),Wf);Wf.instance=new XJt.Gaxios;async function Lei(t){return Wf.instance.request(t)}});var k9e=re((ZJt,h0e)=>{p();(function(t){"use strict";var e,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,r=Math.ceil,i=Math.floor,s="[BigNumber Error] ",o=s+"Number primitive has more than 15 significant digits: ",a=1e14,c=14,u=9007199254740991,l=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,m=1e9;function h(C){var I,w,k,N=we.prototype={constructor:we,toString:null,valueOf:null},O=new we(1),W=20,$=4,G=-7,q=21,ce=-1e7,Y=1e7,z=!1,j=1,se=0,Ae={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},De="0123456789abcdefghijklmnopqrstuvwxyz",Pe=!0;function we(V,ee){var ae,me,ge,ue,ye,Se,be,Te,_e=this;if(!(_e instanceof we))return new we(V,ee);if(ee==null){if(V&&V._isBigNumber===!0){_e.s=V.s,!V.c||V.e>Y?_e.c=_e.e=null:V.e=10;ye/=10,ue++);ue>Y?_e.c=_e.e=null:(_e.e=ue,_e.c=[V]);return}Te=String(V)}else{if(!n.test(Te=String(V)))return k(_e,Te,Se);_e.s=Te.charCodeAt(0)==45?(Te=Te.slice(1),-1):1}(ue=Te.indexOf("."))>-1&&(Te=Te.replace(".","")),(ye=Te.search(/e/i))>0?(ue<0&&(ue=ye),ue+=+Te.slice(ye+1),Te=Te.substring(0,ye)):ue<0&&(ue=Te.length)}else{if(y(ee,2,De.length,"Base"),ee==10&&Pe)return _e=new we(V),Z(_e,W+_e.e+1,$);if(Te=String(V),Se=typeof V=="number"){if(V*0!=0)return k(_e,Te,Se,ee);if(_e.s=1/V<0?(Te=Te.slice(1),-1):1,we.DEBUG&&Te.replace(/^0\.0*|\./,"").length>15)throw Error(o+V)}else _e.s=Te.charCodeAt(0)===45?(Te=Te.slice(1),-1):1;for(ae=De.slice(0,ee),ue=ye=0,be=Te.length;yeue){ue=be;continue}}else if(!ge&&(Te==Te.toUpperCase()&&(Te=Te.toLowerCase())||Te==Te.toLowerCase()&&(Te=Te.toUpperCase()))){ge=!0,ye=-1,ue=0;continue}return k(_e,String(V),Se,ee)}Se=!1,Te=w(Te,ee,10,_e.s),(ue=Te.indexOf("."))>-1?Te=Te.replace(".",""):ue=Te.length}for(ye=0;Te.charCodeAt(ye)===48;ye++);for(be=Te.length;Te.charCodeAt(--be)===48;);if(Te=Te.slice(ye,++be)){if(be-=ye,Se&&we.DEBUG&&be>15&&(V>u||V!==i(V)))throw Error(o+_e.s*V);if((ue=ue-ye-1)>Y)_e.c=_e.e=null;else if(ue=-m&&ge<=m&&ge===i(ge)){if(me[0]===0){if(ge===0&&me.length===1)return!0;break e}if(ee=(ge+1)%c,ee<1&&(ee+=c),String(me[0]).length==ee){for(ee=0;ee=a||ae!==i(ae))break e;if(ae!==0)return!0}}}else if(me===null&&ge===null&&(ue===null||ue===1||ue===-1))return!0;throw Error(s+"Invalid BigNumber: "+V)},we.maximum=we.max=function(){return oe(arguments,-1)},we.minimum=we.min=function(){return oe(arguments,1)},we.random=(function(){var V=9007199254740992,ee=Math.random()*V&2097151?function(){return i(Math.random()*V)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(ae){var me,ge,ue,ye,Se,be=0,Te=[],_e=new we(O);if(ae==null?ae=W:y(ae,0,m),ye=r(ae/c),z)if(crypto.getRandomValues){for(me=crypto.getRandomValues(new Uint32Array(ye*=2));be>>11),Se>=9e15?(ge=crypto.getRandomValues(new Uint32Array(2)),me[be]=ge[0],me[be+1]=ge[1]):(Te.push(Se%1e14),be+=2);be=ye/2}else if(crypto.randomBytes){for(me=crypto.randomBytes(ye*=7);be=9e15?crypto.randomBytes(7).copy(me,be):(Te.push(Se%1e14),be+=7);be=ye/7}else throw z=!1,Error(s+"crypto unavailable");if(!z)for(;be=10;Se/=10,be++);bege-1&&(Se[ye+1]==null&&(Se[ye+1]=0),Se[ye+1]+=Se[ye]/ge|0,Se[ye]%=ge)}return Se.reverse()}return function(ae,me,ge,ue,ye){var Se,be,Te,_e,X,$e,He,mt,st=ae.indexOf("."),ze=W,rt=$;for(st>=0&&(_e=se,se=0,ae=ae.replace(".",""),mt=new we(me),$e=mt.pow(ae.length-st),se=_e,mt.c=ee(S(g($e.c),$e.e,"0"),10,ge,V),mt.e=mt.c.length),He=ee(ae,me,ge,ye?(Se=De,V):(Se=V,De)),Te=_e=He.length;He[--_e]==0;He.pop());if(!He[0])return Se.charAt(0);if(st<0?--Te:($e.c=He,$e.e=Te,$e.s=ue,$e=I($e,mt,ze,rt,ge),He=$e.c,X=$e.r,Te=$e.e),be=Te+ze+1,st=He[be],_e=ge/2,X=X||be<0||He[be+1]!=null,X=rt<4?(st!=null||X)&&(rt==0||rt==($e.s<0?3:2)):st>_e||st==_e&&(rt==4||X||rt==6&&He[be-1]&1||rt==($e.s<0?8:7)),be<1||!He[0])ae=X?S(Se.charAt(1),-ze,Se.charAt(0)):Se.charAt(0);else{if(He.length=be,X)for(--ge;++He[--be]>ge;)He[be]=0,be||(++Te,He=[1].concat(He));for(_e=He.length;!He[--_e];);for(st=0,ae="";st<=_e;ae+=Se.charAt(He[st++]));ae=S(ae,Te,Se.charAt(0))}return ae}})(),I=(function(){function V(me,ge,ue){var ye,Se,be,Te,_e=0,X=me.length,$e=ge%d,He=ge/d|0;for(me=me.slice();X--;)be=me[X]%d,Te=me[X]/d|0,ye=He*be+Te*$e,Se=$e*be+ye%d*d+_e,_e=(Se/ue|0)+(ye/d|0)+He*Te,me[X]=Se%ue;return _e&&(me=[_e].concat(me)),me}function ee(me,ge,ue,ye){var Se,be;if(ue!=ye)be=ue>ye?1:-1;else for(Se=be=0;Sege[Se]?1:-1;break}return be}function ae(me,ge,ue,ye){for(var Se=0;ue--;)me[ue]-=Se,Se=me[ue]1;me.splice(0,1));}return function(me,ge,ue,ye,Se){var be,Te,_e,X,$e,He,mt,st,ze,rt,Ct,on,Ft,Qt,Mt,Xe,Me,Je=me.s==ge.s?1:-1,yt=me.c,Vt=ge.c;if(!yt||!yt[0]||!Vt||!Vt[0])return new we(!me.s||!ge.s||(yt?Vt&&yt[0]==Vt[0]:!Vt)?NaN:yt&&yt[0]==0||!Vt?Je*0:Je/0);for(st=new we(Je),ze=st.c=[],Te=me.e-ge.e,Je=ue+Te+1,Se||(Se=a,Te=f(me.e/c)-f(ge.e/c),Je=Je/c|0),_e=0;Vt[_e]==(yt[_e]||0);_e++);if(Vt[_e]>(yt[_e]||0)&&Te--,Je<0)ze.push(1),X=!0;else{for(Qt=yt.length,Xe=Vt.length,_e=0,Je+=2,$e=i(Se/(Vt[0]+1)),$e>1&&(Vt=V(Vt,$e,Se),yt=V(yt,$e,Se),Xe=Vt.length,Qt=yt.length),Ft=Xe,rt=yt.slice(0,Xe),Ct=rt.length;Ct=Se/2&&Mt++;do{if($e=0,be=ee(Vt,rt,Xe,Ct),be<0){if(on=rt[0],Xe!=Ct&&(on=on*Se+(rt[1]||0)),$e=i(on/Mt),$e>1)for($e>=Se&&($e=Se-1),He=V(Vt,$e,Se),mt=He.length,Ct=rt.length;ee(He,rt,mt,Ct)==1;)$e--,ae(He,Xe=10;Je/=10,_e++);Z(st,ue+(st.e=_e+Te*c-1)+1,ye,X)}else st.e=Te,st.r=+X;return st}})();function ie(V,ee,ae,me){var ge,ue,ye,Se,be;if(ae==null?ae=$:y(ae,0,8),!V.c)return V.toString();if(ge=V.c[0],ye=V.e,ee==null)be=g(V.c),be=me==1||me==2&&(ye<=G||ye>=q)?_(be,ye):S(be,ye,"0");else if(V=Z(new we(V),ee,ae),ue=V.e,be=g(V.c),Se=be.length,me==1||me==2&&(ee<=ue||ue<=G)){for(;Seye),be=S(be,ue,"0"),ue+1>Se){if(--ee>0)for(be+=".";ee--;be+="0");}else if(ee+=ue-Se,ee>0)for(ue+1==Se&&(be+=".");ee--;be+="0");return V.s<0&&ge?"-"+be:be}function oe(V,ee){for(var ae,me,ge=1,ue=new we(V[0]);ge=10;ge/=10,me++);return(ae=me+ae*c-1)>Y?V.c=V.e=null:ae=10;Se/=10,ge++);if(ue=ee-ge,ue<0)ue+=c,ye=ee,be=X[Te=0],_e=i(be/$e[ge-ye-1]%10);else if(Te=r((ue+1)/c),Te>=X.length)if(me){for(;X.length<=Te;X.push(0));be=_e=0,ge=1,ue%=c,ye=ue-c+1}else break e;else{for(be=Se=X[Te],ge=1;Se>=10;Se/=10,ge++);ue%=c,ye=ue-c+ge,_e=ye<0?0:i(be/$e[ge-ye-1]%10)}if(me=me||ee<0||X[Te+1]!=null||(ye<0?be:be%$e[ge-ye-1]),me=ae<4?(_e||me)&&(ae==0||ae==(V.s<0?3:2)):_e>5||_e==5&&(ae==4||me||ae==6&&(ue>0?ye>0?be/$e[ge-ye]:0:X[Te-1])%10&1||ae==(V.s<0?8:7)),ee<1||!X[0])return X.length=0,me?(ee-=V.e+1,X[0]=$e[(c-ee%c)%c],V.e=-ee||0):X[0]=V.e=0,V;if(ue==0?(X.length=Te,Se=1,Te--):(X.length=Te+1,Se=$e[c-ue],X[Te]=ye>0?i(be/$e[ge-ye]%$e[ye])*Se:0),me)for(;;)if(Te==0){for(ue=1,ye=X[0];ye>=10;ye/=10,ue++);for(ye=X[0]+=Se,Se=1;ye>=10;ye/=10,Se++);ue!=Se&&(V.e++,X[0]==a&&(X[0]=1));break}else{if(X[Te]+=Se,X[Te]!=a)break;X[Te--]=0,Se=1}for(ue=X.length;X[--ue]===0;X.pop());}V.e>Y?V.c=V.e=null:V.e=q?_(ee,ae):S(ee,ae,"0"),V.s<0?"-"+ee:ee)}return N.absoluteValue=N.abs=function(){var V=new we(this);return V.s<0&&(V.s=1),V},N.comparedTo=function(V,ee){return A(this,new we(V,ee))},N.decimalPlaces=N.dp=function(V,ee){var ae,me,ge,ue=this;if(V!=null)return y(V,0,m),ee==null?ee=$:y(ee,0,8),Z(new we(ue),V+ue.e+1,ee);if(!(ae=ue.c))return null;if(me=((ge=ae.length-1)-f(this.e/c))*c,ge=ae[ge])for(;ge%10==0;ge/=10,me--);return me<0&&(me=0),me},N.dividedBy=N.div=function(V,ee){return I(this,new we(V,ee),W,$)},N.dividedToIntegerBy=N.idiv=function(V,ee){return I(this,new we(V,ee),0,1)},N.exponentiatedBy=N.pow=function(V,ee){var ae,me,ge,ue,ye,Se,be,Te,_e,X=this;if(V=new we(V),V.c&&!V.isInteger())throw Error(s+"Exponent not an integer: "+te(V));if(ee!=null&&(ee=new we(ee)),Se=V.e>14,!X.c||!X.c[0]||X.c[0]==1&&!X.e&&X.c.length==1||!V.c||!V.c[0])return _e=new we(Math.pow(+te(X),Se?V.s*(2-E(V)):+te(V))),ee?_e.mod(ee):_e;if(be=V.s<0,ee){if(ee.c?!ee.c[0]:!ee.s)return new we(NaN);me=!be&&X.isInteger()&&ee.isInteger(),me&&(X=X.mod(ee))}else{if(V.e>9&&(X.e>0||X.e<-1||(X.e==0?X.c[0]>1||Se&&X.c[1]>=24e7:X.c[0]<8e13||Se&&X.c[0]<=9999975e7)))return ue=X.s<0&&E(V)?-0:0,X.e>-1&&(ue=1/ue),new we(be?1/ue:ue);se&&(ue=r(se/c+2))}for(Se?(ae=new we(.5),be&&(V.s=1),Te=E(V)):(ge=Math.abs(+te(V)),Te=ge%2),_e=new we(O);;){if(Te){if(_e=_e.times(X),!_e.c)break;ue?_e.c.length>ue&&(_e.c.length=ue):me&&(_e=_e.mod(ee))}if(ge){if(ge=i(ge/2),ge===0)break;Te=ge%2}else if(V=V.times(ae),Z(V,V.e+1,1),V.e>14)Te=E(V);else{if(ge=+te(V),ge===0)break;Te=ge%2}X=X.times(X),ue?X.c&&X.c.length>ue&&(X.c.length=ue):me&&(X=X.mod(ee))}return me?_e:(be&&(_e=O.div(_e)),ee?_e.mod(ee):ue?Z(_e,se,$,ye):_e)},N.integerValue=function(V){var ee=new we(this);return V==null?V=$:y(V,0,8),Z(ee,ee.e+1,V)},N.isEqualTo=N.eq=function(V,ee){return A(this,new we(V,ee))===0},N.isFinite=function(){return!!this.c},N.isGreaterThan=N.gt=function(V,ee){return A(this,new we(V,ee))>0},N.isGreaterThanOrEqualTo=N.gte=function(V,ee){return(ee=A(this,new we(V,ee)))===1||ee===0},N.isInteger=function(){return!!this.c&&f(this.e/c)>this.c.length-2},N.isLessThan=N.lt=function(V,ee){return A(this,new we(V,ee))<0},N.isLessThanOrEqualTo=N.lte=function(V,ee){return(ee=A(this,new we(V,ee)))===-1||ee===0},N.isNaN=function(){return!this.s},N.isNegative=function(){return this.s<0},N.isPositive=function(){return this.s>0},N.isZero=function(){return!!this.c&&this.c[0]==0},N.minus=function(V,ee){var ae,me,ge,ue,ye=this,Se=ye.s;if(V=new we(V,ee),ee=V.s,!Se||!ee)return new we(NaN);if(Se!=ee)return V.s=-ee,ye.plus(V);var be=ye.e/c,Te=V.e/c,_e=ye.c,X=V.c;if(!be||!Te){if(!_e||!X)return _e?(V.s=-ee,V):new we(X?ye:NaN);if(!_e[0]||!X[0])return X[0]?(V.s=-ee,V):new we(_e[0]?ye:$==3?-0:0)}if(be=f(be),Te=f(Te),_e=_e.slice(),Se=be-Te){for((ue=Se<0)?(Se=-Se,ge=_e):(Te=be,ge=X),ge.reverse(),ee=Se;ee--;ge.push(0));ge.reverse()}else for(me=(ue=(Se=_e.length)<(ee=X.length))?Se:ee,Se=ee=0;ee0)for(;ee--;_e[ae++]=0);for(ee=a-1;me>Se;){if(_e[--me]=0;){for(ae=0,$e=on[ge]%ze,He=on[ge]/ze|0,ye=be,ue=ge+ye;ue>ge;)Te=Ct[--ye]%ze,_e=Ct[ye]/ze|0,Se=He*Te+_e*$e,Te=$e*Te+Se%ze*ze+mt[ue]+ae,ae=(Te/st|0)+(Se/ze|0)+He*_e,mt[ue--]=Te%st;mt[ue]=ae}return ae?++me:mt.splice(0,1),ne(V,mt,me)},N.negated=function(){var V=new we(this);return V.s=-V.s||null,V},N.plus=function(V,ee){var ae,me=this,ge=me.s;if(V=new we(V,ee),ee=V.s,!ge||!ee)return new we(NaN);if(ge!=ee)return V.s=-ee,me.minus(V);var ue=me.e/c,ye=V.e/c,Se=me.c,be=V.c;if(!ue||!ye){if(!Se||!be)return new we(ge/0);if(!Se[0]||!be[0])return be[0]?V:new we(Se[0]?me:ge*0)}if(ue=f(ue),ye=f(ye),Se=Se.slice(),ge=ue-ye){for(ge>0?(ye=ue,ae=be):(ge=-ge,ae=Se),ae.reverse();ge--;ae.push(0));ae.reverse()}for(ge=Se.length,ee=be.length,ge-ee<0&&(ae=be,be=Se,Se=ae,ee=ge),ge=0;ee;)ge=(Se[--ee]=Se[ee]+be[ee]+ge)/a|0,Se[ee]=a===Se[ee]?0:Se[ee]%a;return ge&&(Se=[ge].concat(Se),++ye),ne(V,Se,ye)},N.precision=N.sd=function(V,ee){var ae,me,ge,ue=this;if(V!=null&&V!==!!V)return y(V,1,m),ee==null?ee=$:y(ee,0,8),Z(new we(ue),V,ee);if(!(ae=ue.c))return null;if(ge=ae.length-1,me=ge*c+1,ge=ae[ge]){for(;ge%10==0;ge/=10,me--);for(ge=ae[0];ge>=10;ge/=10,me++);}return V&&ue.e+1>me&&(me=ue.e+1),me},N.shiftedBy=function(V){return y(V,-u,u),this.times("1e"+V)},N.squareRoot=N.sqrt=function(){var V,ee,ae,me,ge,ue=this,ye=ue.c,Se=ue.s,be=ue.e,Te=W+4,_e=new we("0.5");if(Se!==1||!ye||!ye[0])return new we(!Se||Se<0&&(!ye||ye[0])?NaN:ye?ue:1/0);if(Se=Math.sqrt(+te(ue)),Se==0||Se==1/0?(ee=g(ye),(ee.length+be)%2==0&&(ee+="0"),Se=Math.sqrt(+ee),be=f((be+1)/2)-(be<0||be%2),Se==1/0?ee="5e"+be:(ee=Se.toExponential(),ee=ee.slice(0,ee.indexOf("e")+1)+be),ae=new we(ee)):ae=new we(Se+""),ae.c[0]){for(be=ae.e,Se=be+Te,Se<3&&(Se=0);;)if(ge=ae,ae=_e.times(ge.plus(I(ue,ge,Te,1))),g(ge.c).slice(0,Se)===(ee=g(ae.c)).slice(0,Se))if(ae.e0&&mt>0){for(ue=mt%Se||Se,_e=He.substr(0,ue);ue0&&(_e+=Te+He.slice(ue)),$e&&(_e="-"+_e)}me=X?_e+(ae.decimalSeparator||"")+((be=+ae.fractionGroupSize)?X.replace(new RegExp("\\d{"+be+"}\\B","g"),"$&"+(ae.fractionGroupSeparator||"")):X):_e}return(ae.prefix||"")+me+(ae.suffix||"")},N.toFraction=function(V){var ee,ae,me,ge,ue,ye,Se,be,Te,_e,X,$e,He=this,mt=He.c;if(V!=null&&(Se=new we(V),!Se.isInteger()&&(Se.c||Se.s!==1)||Se.lt(O)))throw Error(s+"Argument "+(Se.isInteger()?"out of range: ":"not an integer: ")+te(Se));if(!mt)return new we(He);for(ee=new we(O),Te=ae=new we(O),me=be=new we(O),$e=g(mt),ue=ee.e=$e.length-He.e-1,ee.c[0]=l[(ye=ue%c)<0?c+ye:ye],V=!V||Se.comparedTo(ee)>0?ue>0?ee:Te:Se,ye=Y,Y=1/0,Se=new we($e),be.c[0]=0;_e=I(Se,ee,0,1),ge=ae.plus(_e.times(me)),ge.comparedTo(V)!=1;)ae=me,me=ge,Te=be.plus(_e.times(ge=Te)),be=ge,ee=Se.minus(_e.times(ge=ee)),Se=ge;return ge=I(V.minus(ae),me,0,1),be=be.plus(ge.times(Te)),ae=ae.plus(ge.times(me)),be.s=Te.s=He.s,ue=ue*2,X=I(Te,me,ue,$).minus(He).abs().comparedTo(I(be,ae,ue,$).minus(He).abs())<1?[Te,me]:[be,ae],Y=ye,X},N.toNumber=function(){return+te(this)},N.toPrecision=function(V,ee){return V!=null&&y(V,1,m),ie(this,V,ee,2)},N.toString=function(V){var ee,ae=this,me=ae.s,ge=ae.e;return ge===null?me?(ee="Infinity",me<0&&(ee="-"+ee)):ee="NaN":(V==null?ee=ge<=G||ge>=q?_(g(ae.c),ge):S(g(ae.c),ge,"0"):V===10&&Pe?(ae=Z(new we(ae),W+ge+1,$),ee=S(g(ae.c),ae.e,"0")):(y(V,2,De.length,"Base"),ee=w(S(g(ae.c),ge,"0"),10,V,me,!0)),me<0&&ae.c[0]&&(ee="-"+ee)),ee},N.valueOf=N.toJSON=function(){return te(this)},N._isBigNumber=!0,C!=null&&we.set(C),we}function f(C){var I=C|0;return C>0||C===I?I:I-1}function g(C){for(var I,w,k=1,N=C.length,O=C[0]+"";kq^w?1:-1;for($=(G=N.length)<(q=O.length)?G:q,W=0;W<$;W++)if(N[W]!=O[W])return N[W]>O[W]^w?1:-1;return G==q?0:G>q^w?1:-1}function y(C,I,w,k){if(Cw||C!==i(C))throw Error(s+(k||"Argument")+(typeof C=="number"?Cw?" out of range: ":" not an integer: ":" not a primitive number: ")+String(C))}function E(C){var I=C.c.length-1;return f(C.e/c)==I&&C.c[I]%2!=0}function _(C,I){return(C.length>1?C.charAt(0)+"."+C.slice(1):C)+(I<0?"e":"e+")+I}function S(C,I,w){var k,N;if(I<0){for(N=w+".";++I;N+=w);C=N+C}else if(k=C.length,++I>k){for(N=w,I-=k;--I;N+=w);C+=N}else I{p();var eXt=k9e(),tXt=nXt.exports;(function(){"use strict";function t(u){return u<10?"0"+u:u}var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},o;function a(u){return n.lastIndex=0,n.test(u)?'"'+u.replace(n,function(l){var d=s[l];return typeof d=="string"?d:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+u+'"'}function c(u,l){var d,m,h,f,g=r,A,y=l[u],E=y!=null&&(y instanceof eXt||eXt.isBigNumber(y));switch(y&&typeof y=="object"&&typeof y.toJSON=="function"&&(y=y.toJSON(u)),typeof o=="function"&&(y=o.call(l,u,y)),typeof y){case"string":return E?y:a(y);case"number":return isFinite(y)?String(y):"null";case"boolean":case"null":case"bigint":return String(y);case"object":if(!y)return"null";if(r+=i,A=[],Object.prototype.toString.apply(y)==="[object Array]"){for(f=y.length,d=0;d{p();var mme=null,tkr=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,nkr=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/,rkr=function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var n,r,s={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` -`,r:"\r",t:" "},i,o=function(g){throw{name:"SyntaxError",message:g,at:n,text:i}},a=function(g){return g&&g!==r&&o("Expected '"+g+"' instead of '"+r+"'"),r=i.charAt(n),n+=1,r},c=function(){var g,A="";for(r==="-"&&(A="-",a("-"));r>="0"&&r<="9";)A+=r,a();if(r===".")for(A+=".";a()&&r>="0"&&r<="9";)A+=r;if(r==="e"||r==="E")for(A+=r,a(),(r==="-"||r==="+")&&(A+=r,a());r>="0"&&r<="9";)A+=r,a();if(g=+A,!isFinite(g))o("Bad number");else return mme==null&&(mme=o3e()),A.length>15?e.storeAsString?A:e.useNativeBigInt?BigInt(A):new mme(A):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(g):new mme(g):g},u=function(){var g,A,y="",b;if(r==='"')for(var S=n;a();){if(r==='"')return n-1>S&&(y+=i.substring(S,n-1)),a(),y;if(r==="\\"){if(n-1>S&&(y+=i.substring(S,n-1)),a(),r==="u"){for(b=0,A=0;A<4&&(g=parseInt(a(),16),!!isFinite(g));A+=1)b=b*16+g;y+=String.fromCharCode(b)}else if(typeof s[r]=="string")y+=s[r];else break;S=n}}o("Bad string")},l=function(){for(;r&&r<=" ";)a()},d=function(){switch(r){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}o("Unexpected '"+r+"'")},h,m=function(){var g=[];if(r==="["){if(a("["),l(),r==="]")return a("]"),g;for(;r;){if(g.push(h()),l(),r==="]")return a("]"),g;a(","),l()}}o("Bad array")},f=function(){var g,A=Object.create(null);if(r==="{"){if(a("{"),l(),r==="}")return a("}"),A;for(;r;){if(g=u(),l(),a(":"),e.strict===!0&&Object.hasOwnProperty.call(A,g)&&o('Duplicate key "'+g+'"'),tkr.test(g)===!0?e.protoAction==="error"?o("Object contains forbidden prototype property"):e.protoAction==="ignore"?h():A[g]=h():nkr.test(g)===!0?e.constructorAction==="error"?o("Object contains forbidden constructor property"):e.constructorAction==="ignore"?h():A[g]=h():A[g]=h(),l(),r==="}")return a("}"),A;a(","),l()}}o("Bad object")};return h=function(){switch(l(),r){case"{":return f();case"[":return m();case'"':return u();case"-":return c();default:return r>="0"&&r<="9"?c():d()}},function(g,A){var y;return i=g+"",n=0,r=" ",y=h(),l(),r&&o("Syntax error"),typeof A=="function"?(function b(S,C){var I,x,w=S[C];return w&&typeof w=="object"&&Object.keys(w).forEach(function(R){x=b(w,R),x!==void 0?w[R]=x:delete w[R]}),A.call(S,C,w)})({"":y},""):y}};_$t.exports=rkr});var x$t=ee((Nso,fme)=>{p();var C$t=b$t().stringify,I$t=S$t();fme.exports=function(t){return{parse:I$t(t),stringify:C$t}};fme.exports.parse=I$t();fme.exports.stringify=C$t});var a3e=ee(T_=>{"use strict";p();Object.defineProperty(T_,"__esModule",{value:!0});T_.GCE_LINUX_BIOS_PATHS=void 0;T_.isGoogleCloudServerless=v$t;T_.isGoogleComputeEngineLinux=R$t;T_.isGoogleComputeEngineMACAddress=k$t;T_.isGoogleComputeEngine=N$t;T_.detectGCPResidency=ikr;var w$t=require("fs"),T$t=require("os");T_.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var skr=/^42:01/;function v$t(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}function R$t(){if((0,T$t.platform)()!=="linux")return!1;try{(0,w$t.statSync)(T_.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,w$t.readFileSync)(T_.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}function k$t(){let t=(0,T$t.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:n}of e)if(skr.test(n))return!0}return!1}function N$t(){return R$t()||k$t()}function ikr(){return v$t()||N$t()}});var D$t=ee(Ame=>{"use strict";p();Object.defineProperty(Ame,"__esModule",{value:!0});Ame.Colours=void 0;var gme=class t{static enabled=!1;static reset="";static bright="";static dim="";static red="";static green="";static yellow="";static blue="";static magenta="";static cyan="";static white="";static grey="";static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process?.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};Ame.Colours=gme;gme.refresh()});var P$t=ee(yme=>{"use strict";p();Object.defineProperty(yme,"__esModule",{value:!0});yme.LogSeverity=void 0;var B$t;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(B$t||(yme.LogSeverity=B$t={}))});var F$t=ee(Xa=>{"use strict";p();var okr=Xa&&Xa.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),akr=Xa&&Xa.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),O$t=Xa&&Xa.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[r.length]=s);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),s=0;sthis.on(r,s)}),this.func.debug=(...r)=>this.invokeSeverity(rw.LogSeverity.DEBUG,...r),this.func.info=(...r)=>this.invokeSeverity(rw.LogSeverity.INFO,...r),this.func.warn=(...r)=>this.invokeSeverity(rw.LogSeverity.WARNING,...r),this.func.error=(...r)=>this.invokeSeverity(rw.LogSeverity.ERROR,...r),this.func.sublog=r=>L$t(r,this.func)}invoke(e,...n){if(this.upstream)try{this.upstream(e,...n)}catch{}try{this.emit("log",e,n)}catch{}}invokeSeverity(e,...n){this.invoke({severity:e},...n)}};Xa.AdhocDebugLogger=DK;Xa.placeholder=new DK("",()=>{}).func;var zW=class{cached=new Map;filters=[];filtersSet=!1;constructor(){let e=NK.env[Xa.env.nodeEnables]??"*";e==="all"&&(e="*"),this.filters=e.split(",")}log(e,n,...r){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let s=this.cached.get(e);s||(s=this.makeLogger(e),this.cached.set(e,s)),s(n,...r)}catch(s){console.error(s)}}};Xa.DebugLogBackendBase=zW;var c3e=class extends zW{enabledRegexp=/.*/g;isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(n,...r)=>{let s=`${bA.Colours.green}${e}${bA.Colours.reset}`,i=`${bA.Colours.yellow}${NK.pid}${bA.Colours.reset}`,o;switch(n.severity){case rw.LogSeverity.ERROR:o=`${bA.Colours.red}${n.severity}${bA.Colours.reset}`;break;case rw.LogSeverity.INFO:o=`${bA.Colours.magenta}${n.severity}${bA.Colours.reset}`;break;case rw.LogSeverity.WARNING:o=`${bA.Colours.yellow}${n.severity}${bA.Colours.reset}`;break;default:o=n.severity??rw.LogSeverity.DEFAULT;break}let a=M$t.formatWithOptions({colors:bA.Colours.enabled},...r),c=Object.assign({},n);delete c.severity;let u=Object.getOwnPropertyNames(c).length?JSON.stringify(c):"",l=u?`${bA.Colours.grey}${u}${bA.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",i,s,o,a,u?` ${l}`:"")}:()=>{}}setFilters(){let n=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${n}$`,"i")}};function l3e(){return new c3e}var u3e=class extends zW{debugPkg;constructor(e){super(),this.debugPkg=e}makeLogger(e){let n=this.debugPkg(e);return(r,...s)=>{n(s[0],...s.slice(1))}}setFilters(){let e=NK.env.NODE_DEBUG??"";NK.env.NODE_DEBUG=`${e}${e?",":""}${this.filters.join(",")}`}};function lkr(t){return new u3e(t)}var d3e=class extends zW{upstream;constructor(e){super(),this.upstream=e??void 0}makeLogger(e){let n=this.upstream?.makeLogger(e);return(r,...s)=>{let i=r.severity??rw.LogSeverity.INFO,o=Object.assign({severity:i,message:M$t.format(...s)},r),a=JSON.stringify(o);n?n(r,a):console.log("%s",a)}}setFilters(){this.upstream?.setFilters()}};function ukr(t){return new d3e(t)}Xa.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var p3e=new Map,v_;function dkr(t){v_=t,p3e.clear()}function L$t(t,e){if(!v_&&!NK.env[Xa.env.nodeEnables]||!t)return Xa.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let n=p3e.get(t);if(n)return n.func;if(v_===null)return Xa.placeholder;v_===void 0&&(v_=l3e());let r=(()=>{let s;return new DK(t,(o,...a)=>{if(s!==v_){if(v_===null)return;v_===void 0&&(v_=l3e()),s=v_}v_?.log(t,o,...a)})})();return p3e.set(t,r),r.func}});var Q$t=ee(oO=>{"use strict";p();var pkr=oO&&oO.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),hkr=oO&&oO.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&pkr(e,t,n)};Object.defineProperty(oO,"__esModule",{value:!0});hkr(F$t(),oO)});var PK=ee(bs=>{"use strict";p();var $$t=bs&&bs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),mkr=bs&&bs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fkr=bs&&bs.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[r.length]=s);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),s=0;s{switch(e){case"params":case"property":case"headers":break;case"qs":throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");default:throw new Error(`'${e}' is not a valid configuration option.`)}})}async function BK(t,e={},n=3,r=!1){let s=new Headers(bs.HEADERS),i="",o={};if(typeof t=="object"){let d=t;new Headers(d.headers).forEach((h,m)=>s.set(m,h)),i=d.metadataKey,o=d.params||o,n=d.noResponseRetries||n,r=d.fastFail||r}else i=t;typeof e=="string"?i+=`/${e}`:(bkr(e),e.property&&(i+=`/${e.property}`),new Headers(e.headers).forEach((d,h)=>s.set(h,d)),o=e.params||o);let a=r?_kr:h3e.request,c={url:`${m3e()}/${i}`,headers:s,retryConfig:{noResponseRetries:n},params:o,responseType:"text",timeout:W$t()};U$t.info("instance request %j",c);let u=await a(c);U$t.info("instance metadata is %s",u.data);let l=u.headers.get(bs.HEADER_NAME);if(l!==bs.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${bs.HEADER_NAME} header. Expected '${bs.HEADER_VALUE}', got ${l?`'${l}'`:"no header"}`);if(typeof u.data=="string")try{return Akr.parse(u.data)}catch{}return u.data}async function _kr(t){let e={...t,url:t.url?.toString().replace(m3e(),m3e(bs.SECONDARY_HOST_ADDRESS))},n=(0,h3e.request)(t),r=(0,h3e.request)(e);return Promise.any([n,r])}function Skr(t){return BK("instance",t)}function Ckr(t){return BK("project",t)}function Ikr(t){return BK("universe",t)}async function xkr(t){let e={};return await Promise.all(t.map(n=>(async()=>{let r=await BK(n),s=n.metadataKey;e[s]=r})())),e}function wkr(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}var Eme;async function Tkr(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in bs.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(bs.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return f3e();case"ping-only":}}try{return Eme===void 0&&(Eme=BK("instance",void 0,wkr(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Eme,!0}catch(t){let e=t;if(process.env.DEBUG_AUTH&&console.info(e),e.type==="request-timeout"||e.response&&e.response.status===404)return!1;if(!(e.response&&e.response.status===404)&&(!e.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(e.code.toString()))){let n="UNKNOWN";e.code&&(n=e.code.toString()),process.emitWarning(`received unexpected error = ${e.message} code = ${n}`,"MetadataLookupWarning")}return!1}}function vkr(){Eme=void 0}bs.gcpResidencyCache=null;function f3e(){return bs.gcpResidencyCache===null&&G$t(),bs.gcpResidencyCache}function G$t(t=null){bs.gcpResidencyCache=t!==null?t:(0,ykr.detectGCPResidency)()}function W$t(){return f3e()?0:3e3}gkr(a3e(),bs)});var V$t=ee(bme=>{"use strict";p();bme.byteLength=kkr;bme.toByteArray=Dkr;bme.fromByteArray=Okr;var bC=[],xE=[],Rkr=typeof Uint8Array<"u"?Uint8Array:Array,g3e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(aO=0,q$t=g3e.length;aO0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function kkr(t){var e=H$t(t),n=e[0],r=e[1];return(n+r)*3/4-r}function Nkr(t,e,n){return(e+n)*3/4-n}function Dkr(t){var e,n=H$t(t),r=n[0],s=n[1],i=new Rkr(Nkr(t,r,s)),o=0,a=s>0?r-4:r,c;for(c=0;c>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=xE[t.charCodeAt(c)]<<2|xE[t.charCodeAt(c+1)]>>4,i[o++]=e&255),s===1&&(e=xE[t.charCodeAt(c)]<<10|xE[t.charCodeAt(c+1)]<<4|xE[t.charCodeAt(c+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function Bkr(t){return bC[t>>18&63]+bC[t>>12&63]+bC[t>>6&63]+bC[t&63]}function Pkr(t,e,n){for(var r,s=[],i=e;ia?a:o+i));return r===1?(e=t[n-1],s.push(bC[e>>2]+bC[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],s.push(bC[e>>10]+bC[e>>4&63]+bC[e<<2&63]+"=")),s.join("")}});var y3e=ee(A3e=>{"use strict";p();Object.defineProperty(A3e,"__esModule",{value:!0});A3e.fromArrayBufferToHex=Mkr;function Mkr(t){return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}});var j$t=ee(_me=>{"use strict";p();Object.defineProperty(_me,"__esModule",{value:!0});_me.BrowserCrypto=void 0;var JW=V$t(),Lkr=y3e(),E3e=class t{constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let n=new TextEncoder().encode(e),r=await window.crypto.subtle.digest("SHA-256",n);return JW.fromByteArray(new Uint8Array(r))}randomBytesBase64(e){let n=new Uint8Array(e);return window.crypto.getRandomValues(n),JW.fromByteArray(n)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,n,r){let s={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(n),o=JW.toByteArray(t.padBase64(r)),a=await window.crypto.subtle.importKey("jwk",e,s,!0,["verify"]);return await window.crypto.subtle.verify(s,a,Buffer.from(o),i)}async sign(e,n){let r={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(n),i=await window.crypto.subtle.importKey("jwk",e,r,!0,["sign"]),o=await window.crypto.subtle.sign(r,i,s);return JW.fromByteArray(new Uint8Array(o))}decodeBase64StringUtf8(e){let n=JW.toByteArray(t.padBase64(e));return new TextDecoder().decode(n)}encodeBase64StringUtf8(e){let n=new TextEncoder().encode(e);return JW.fromByteArray(n)}async sha256DigestHex(e){let n=new TextEncoder().encode(e),r=await window.crypto.subtle.digest("SHA-256",n);return(0,Lkr.fromArrayBufferToHex)(r)}async signWithHmacSha256(e,n){let r=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),s=new TextEncoder,i=await window.crypto.subtle.importKey("raw",s.encode(r),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",i,s.encode(n))}};_me.BrowserCrypto=E3e});var Y$t=ee(Sme=>{"use strict";p();Object.defineProperty(Sme,"__esModule",{value:!0});Sme.NodeCrypto=void 0;var XW=require("crypto"),b3e=class{async sha256DigestBase64(e){return XW.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return XW.randomBytes(e).toString("base64")}async verify(e,n,r){let s=XW.createVerify("RSA-SHA256");return s.update(n),s.end(),s.verify(e,r,"base64")}async sign(e,n){let r=XW.createSign("RSA-SHA256");return r.update(n),r.end(),r.sign(e,"base64")}decodeBase64StringUtf8(e){return Buffer.from(e,"base64").toString("utf-8")}encodeBase64StringUtf8(e){return Buffer.from(e,"utf-8").toString("base64")}async sha256DigestHex(e){return XW.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,n){let r=typeof e=="string"?e:Qkr(e);return Fkr(XW.createHmac("sha256",r).update(n).digest())}};Sme.NodeCrypto=b3e;function Fkr(t){let e=new ArrayBuffer(t.length),n=new Uint8Array(e);for(let r=0;r{"use strict";p();var Ukr=sw&&sw.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),$kr=sw&&sw.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Ukr(e,t,n)};Object.defineProperty(sw,"__esModule",{value:!0});sw.createCrypto=qkr;sw.hasBrowserCrypto=K$t;var Gkr=j$t(),Wkr=Y$t();$kr(y3e(),sw);function qkr(){return K$t()?new Gkr.BrowserCrypto:new Wkr.NodeCrypto}function K$t(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}});var ZW=ee((_3e,J$t)=>{p();var Cme=require("buffer"),_C=Cme.Buffer;function z$t(t,e){for(var n in t)e[n]=t[n]}_C.from&&_C.alloc&&_C.allocUnsafe&&_C.allocUnsafeSlow?J$t.exports=Cme:(z$t(Cme,_3e),_3e.Buffer=cO);function cO(t,e,n){return _C(t,e,n)}cO.prototype=Object.create(_C.prototype);z$t(_C,cO);cO.from=function(t,e,n){if(typeof t=="number")throw new TypeError("Argument must not be a number");return _C(t,e,n)};cO.alloc=function(t,e,n){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=_C(t);return e!==void 0?typeof n=="string"?r.fill(e,n):r.fill(e):r.fill(0),r};cO.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return _C(t)};cO.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Cme.SlowBuffer(t)}});var Z$t=ee((nio,X$t)=>{"use strict";p();function S3e(t){var e=(t/8|0)+(t%8===0?0:1);return e}var Hkr={ES256:S3e(256),ES384:S3e(384),ES512:S3e(521)};function Vkr(t){var e=Hkr[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}X$t.exports=Vkr});var C3e=ee((sio,iGt)=>{"use strict";p();var Ime=ZW().Buffer,tGt=Z$t(),xme=128,nGt=0,jkr=32,Ykr=16,Kkr=2,rGt=Ykr|jkr|nGt<<6,wme=Kkr|nGt<<6;function zkr(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function sGt(t){if(Ime.isBuffer(t))return t;if(typeof t=="string")return Ime.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Jkr(t,e){t=sGt(t);var n=tGt(e),r=n+1,s=t.length,i=0;if(t[i++]!==rGt)throw new Error('Could not find expected "seq"');var o=t[i++];if(o===(xme|1)&&(o=t[i++]),s-i=xme;return s&&--r,r}function Xkr(t,e){t=sGt(t);var n=tGt(e),r=t.length;if(r!==n*2)throw new TypeError('"'+e+'" signatures must be "'+n*2+'" bytes, saw "'+r+'"');var s=eGt(t,0,n),i=eGt(t,n,t.length),o=n-s,a=n-i,c=2+o+1+1+a,u=c{"use strict";p();Object.defineProperty(iw,"__esModule",{value:!0});iw.LRUCache=void 0;iw.snakeToCamel=aGt;iw.originalOrCamelOptions=nNr;iw.removeUndefinedValuesInObject=rNr;iw.isValidFile=sNr;iw.getWellKnownCertificateConfigFileLocation=iNr;var Zkr=require("fs"),eNr=require("os"),I3e=require("path"),tNr="certificate_config.json",oGt="gcloud";function aGt(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}function nNr(t){function e(n){let r=t||{};return r[n]??r[aGt(n)]}return{get:e}}var x3e=class{capacity;#e=new Map;maxAge;constructor(e){this.capacity=e.capacity,this.maxAge=e.maxAge}#t(e,n){this.#e.delete(e),this.#e.set(e,{value:n,lastAccessed:Date.now()})}set(e,n){this.#t(e,n),this.#n()}get(e){let n=this.#e.get(e);if(n)return this.#t(e,n.value),this.#n(),n.value}#n(){let e=this.maxAge?Date.now()-this.maxAge:0,n=this.#e.entries().next();for(;!n.done&&(this.#e.size>this.capacity||n.value[1].lastAccessed{(n===void 0||n==="undefined")&&delete t[e]}),t}async function sNr(t){try{return(await Zkr.promises.lstat(t)).isFile()}catch{return!1}}function iNr(){let t=process.env.CLOUDSDK_CONFIG||(oNr()?I3e.join(process.env.APPDATA||"",oGt):I3e.join(process.env.HOME||"",".config",oGt));return I3e.join(t,tNr)}function oNr(){return eNr.platform().startsWith("win")}});var cGt=ee(Tme=>{"use strict";p();Object.defineProperty(Tme,"__esModule",{value:!0});Tme.Colours=void 0;var Rh=class t{static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process==null?void 0:process.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};Tme.Colours=Rh;Rh.enabled=!1;Rh.reset="";Rh.bright="";Rh.dim="";Rh.red="";Rh.green="";Rh.yellow="";Rh.blue="";Rh.magenta="";Rh.cyan="";Rh.white="";Rh.grey="";Rh.refresh()});var pGt=ee(_a=>{"use strict";p();var aNr=_a&&_a.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),cNr=_a&&_a.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lGt=_a&&_a.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[r.length]=s);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),s=0;sthis.on(r,s)}),this.func.debug=(...r)=>this.invokeSeverity(k_.DEBUG,...r),this.func.info=(...r)=>this.invokeSeverity(k_.INFO,...r),this.func.warn=(...r)=>this.invokeSeverity(k_.WARNING,...r),this.func.error=(...r)=>this.invokeSeverity(k_.ERROR,...r),this.func.sublog=r=>dGt(r,this.func)}invoke(e,...n){if(this.upstream)try{this.upstream(e,...n)}catch{}try{this.emit("log",e,n)}catch{}}invokeSeverity(e,...n){this.invoke({severity:e},...n)}};_a.AdhocDebugLogger=LK;_a.placeholder=new LK("",()=>{}).func;var eq=class{constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let n=(e=MK.env[_a.env.nodeEnables])!==null&&e!==void 0?e:"*";n==="all"&&(n="*"),this.filters=n.split(",")}log(e,n,...r){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let s=this.cached.get(e);s||(s=this.makeLogger(e),this.cached.set(e,s)),s(n,...r)}catch(s){console.error(s)}}};_a.DebugLogBackendBase=eq;var w3e=class extends eq{constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(n,...r)=>{var s;let i=`${_A.Colours.green}${e}${_A.Colours.reset}`,o=`${_A.Colours.yellow}${MK.pid}${_A.Colours.reset}`,a;switch(n.severity){case k_.ERROR:a=`${_A.Colours.red}${n.severity}${_A.Colours.reset}`;break;case k_.INFO:a=`${_A.Colours.magenta}${n.severity}${_A.Colours.reset}`;break;case k_.WARNING:a=`${_A.Colours.yellow}${n.severity}${_A.Colours.reset}`;break;default:a=(s=n.severity)!==null&&s!==void 0?s:k_.DEFAULT;break}let c=uGt.formatWithOptions({colors:_A.Colours.enabled},...r),u=Object.assign({},n);delete u.severity;let l=Object.getOwnPropertyNames(u).length?JSON.stringify(u):"",d=l?`${_A.Colours.grey}${l}${_A.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",o,i,a,c,l?` ${d}`:"")}:()=>{}}setFilters(){let n=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${n}$`,"i")}};function T3e(){return new w3e}var v3e=class extends eq{constructor(e){super(),this.debugPkg=e}makeLogger(e){let n=this.debugPkg(e);return(r,...s)=>{n(s[0],...s.slice(1))}}setFilters(){var e;let n=(e=MK.env.NODE_DEBUG)!==null&&e!==void 0?e:"";MK.env.NODE_DEBUG=`${n}${n?",":""}${this.filters.join(",")}`}};function uNr(t){return new v3e(t)}var R3e=class extends eq{constructor(e){var n;super(),this.upstream=(n=e)!==null&&n!==void 0?n:void 0}makeLogger(e){var n;let r=(n=this.upstream)===null||n===void 0?void 0:n.makeLogger(e);return(s,...i)=>{var o;let a=(o=s.severity)!==null&&o!==void 0?o:k_.INFO,c=Object.assign({severity:a,message:uGt.format(...i)},s),u=JSON.stringify(c);r?r(s,u):console.log("%s",u)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function dNr(t){return new R3e(t)}_a.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var k3e=new Map,SA;function pNr(t){SA=t,k3e.clear()}function dGt(t,e){if(!SA&&!MK.env[_a.env.nodeEnables]||!t)return _a.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let n=k3e.get(t);if(n)return n.func;if(SA===null)return _a.placeholder;SA===void 0&&(SA=T3e());let r=(()=>{let s;return new LK(t,(o,...a)=>{if(s!==SA){if(SA===null)return;SA===void 0&&(SA=T3e()),s=SA}SA?.log(t,o,...a)})})();return k3e.set(t,r),r.func}});var hGt=ee(lO=>{"use strict";p();var hNr=lO&&lO.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),mNr=lO&&lO.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&hNr(e,t,n)};Object.defineProperty(lO,"__esModule",{value:!0});mNr(pGt(),lO)});var mGt=ee((mio,fNr)=>{fNr.exports={name:"google-auth-library",version:"10.9.1",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:{type:"git",directory:"core/packages/google-auth-library-nodejs",url:"https://github.com/googleapis/google-cloud-node.git"},keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.1.4","gcp-metadata":"8.1.2","google-logging-utils":"1.1.3",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/node":"^24.0.0","@types/sinon":"^21.0.0","assert-rejects":"^1.0.0",c8:"^10.1.3",codecov:"^3.8.3",gts:"^6.0.2","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.1",puppeteer:"^24.0.0",sinon:"21.0.3","ts-loader":"^9.5.2",typescript:"5.8.3",webpack:"^5.97.1","webpack-cli":"^6.0.1"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0",homepage:"https://github.com/googleapis/google-cloud-node/tree/main/core/packages/google-auth-library-nodejs"}});var N3e=ee(wk=>{"use strict";p();Object.defineProperty(wk,"__esModule",{value:!0});wk.USER_AGENT=wk.PRODUCT_NAME=wk.pkg=void 0;var fGt=mGt();wk.pkg=fGt;var gGt="google-api-nodejs-client";wk.PRODUCT_NAME=gGt;var gNr=`${gGt}/${fGt.version}`;wk.USER_AGENT=gNr});var CA=ee(N_=>{"use strict";p();Object.defineProperty(N_,"__esModule",{value:!0});N_.AuthClient=N_.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=N_.DEFAULT_UNIVERSE=void 0;var ANr=require("events"),D3e=$p(),yNr=R_(),ENr=hGt(),B3e=N3e();N_.DEFAULT_UNIVERSE="googleapis.com";N_.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var P3e=class t extends ANr.EventEmitter{apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=N_.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=N_.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let n=(0,yNr.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=n.get("project_id")??null,this.quotaProjectId=n.get("quota_project_id"),this.credentials=n.get("credentials")??{},this.universeDomain=n.get("universe_domain")??N_.DEFAULT_UNIVERSE,this.transporter=e.transporter??new D3e.Gaxios(e.transporterOptions),n.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let n=e[0],r=e[1],s,i=new Headers;return typeof n=="string"?s=new URL(n):n instanceof URL?s=n:n&&n.url&&(s=new URL(n.url)),n&&typeof n=="object"&&"headers"in n&&D3e.Gaxios.mergeHeaders(i,n.headers),r&&D3e.Gaxios.mergeHeaders(i,new Headers(r.headers)),typeof n=="object"&&!(n instanceof URL)?this.request({...r,...n,headers:i,url:s}):this.request({...r,headers:i,url:s})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,n){let r=n.get("x-goog-user-project"),s=n.get("authorization");return r&&e.set("x-goog-user-project",r),s&&e.set("authorization",s),e}static log=(0,ENr.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:async e=>{if(!e.headers.has("x-goog-api-client")){let r=process.version.replace(/^v/,"");e.headers.set("x-goog-api-client",`gl-node/${r}`)}let n=e.headers.get("User-Agent");n?n.includes(`${B3e.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${n} ${B3e.USER_AGENT}`):e.headers.set("User-Agent",B3e.USER_AGENT);try{let r=e,s=r[t.RequestMethodNameSymbol],i=`${Math.floor(Math.random()*1e3)}`;r[t.RequestLogIdSymbol]=i;let o={url:e.url,headers:e.headers};s?t.log.info("%s [%s] request %j",s,i,o):t.log.info("[%s] request %j",i,o)}catch{}return e}};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:async e=>{try{let n=e.config,r=n[t.RequestMethodNameSymbol],s=n[t.RequestLogIdSymbol];r?t.log.info("%s [%s] response %j",r,s,e.data):t.log.info("[%s] response %j",s,e.data)}catch{}return e},rejected:async e=>{try{let n=e.config,r=n[t.RequestMethodNameSymbol],s=n[t.RequestLogIdSymbol];r?t.log.info("%s [%s] error %j",r,s,e.response?.data):t.log.error("[%s] error %j",s,e.response?.data)}catch{}throw e}};static setMethodName(e,n){try{let r=e;r[t.RequestMethodNameSymbol]=n}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};N_.AuthClient=P3e});var M3e=ee(vme=>{"use strict";p();Object.defineProperty(vme,"__esModule",{value:!0});vme.LoginTicket=void 0;var O3e=class{envelope;payload;constructor(e,n){this.envelope=e,this.payload=n}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let e=this.getPayload();return e&&e.sub?e.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};vme.LoginTicket=O3e});var Tk=ee(SC=>{"use strict";p();Object.defineProperty(SC,"__esModule",{value:!0});SC.OAuth2Client=SC.ClientAuthentication=SC.CertificateFormat=SC.CodeChallengeMethod=void 0;var AGt=$p(),bNr=require("querystring"),_Nr=require("stream"),SNr=C3e(),yGt=R_(),L3e=OK(),tq=CA(),CNr=M3e(),EGt;(function(t){t.Plain="plain",t.S256="S256"})(EGt||(SC.CodeChallengeMethod=EGt={}));var ow;(function(t){t.PEM="PEM",t.JWK="JWK"})(ow||(SC.CertificateFormat=ow={}));var FK;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(FK||(SC.ClientAuthentication=FK={}));var F3e=class t extends tq.AuthClient{redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=ow.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(e={},n,r){super(typeof e=="object"?e:{}),typeof e!="object"&&(e={clientId:e,clientSecret:n,redirectUri:r}),this._clientId=e.clientId||e.client_id,this._clientSecret=e.clientSecret||e.client_secret,this.redirectUri=e.redirectUri||e.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...e.endpoints},this.clientAuthentication=e.clientAuthentication||FK.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+bNr.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,L3e.createCrypto)(),r=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),i=(await e.sha256DigestBase64(r)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:r,codeChallenge:i}}getToken(e,n){let r=typeof e=="string"?{code:e}:e;if(n)this.getTokenAsync(r).then(s=>n(null,s.tokens,s.res),s=>n(s,null,s.response));else return this.getTokenAsync(r)}async getTokenAsync(e){let n=this.endpoints.oauth2TokenUrl.toString(),r=new Headers,s={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===FK.ClientSecretBasic){let c=Buffer.from(`${this._clientId}:${this._clientSecret}`);r.set("authorization",`Basic ${c.toString("base64")}`)}this.clientAuthentication===FK.ClientSecretPost&&(s.client_secret=this._clientSecret);let i={...t.RETRY_CONFIG,method:"POST",url:n,data:new URLSearchParams((0,yGt.removeUndefinedValuesInObject)(s)),headers:r};tq.AuthClient.setMethodName(i,"getTokenAsync");let o=await this.transporter.request(i),a=o.data;return o.data&&o.data.expires_in&&(a.expiry_date=new Date().getTime()+o.data.expires_in*1e3,delete a.expires_in),this.emit("tokens",a),{tokens:a,res:o}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let n=this.refreshTokenNoCache(e).then(r=>(this.refreshTokenPromises.delete(e),r),r=>{throw this.refreshTokenPromises.delete(e),r});return this.refreshTokenPromises.set(e,n),n}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let n=this.endpoints.oauth2TokenUrl.toString(),r={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},s;try{let o={...t.RETRY_CONFIG,method:"POST",url:n,data:new URLSearchParams((0,yGt.removeUndefinedValuesInObject)(r))};tq.AuthClient.setMethodName(o,"refreshTokenNoCache"),s=await this.transporter.request(o)}catch(o){throw o instanceof AGt.GaxiosError&&o.message==="invalid_grant"&&o.response?.data&&/ReAuth/i.test(o.response.data.error_description)&&(o.message=JSON.stringify(o.response.data)),o}let i=s.data;return s.data&&s.data.expires_in&&(i.expiry_date=new Date().getTime()+s.data.expires_in*1e3,delete i.expires_in),this.emit("tokens",i),{tokens:i,res:s}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(n=>e(null,n.credentials,n.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),n=e.tokens;return n.refresh_token=this.credentials.refresh_token,this.credentials=n,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(n=>e(null,n.token,n.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let r=await this.processAndValidateRefreshHandler();if(r?.access_token)return this.setCredentials(r),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let n=await this.refreshAccessTokenAsync();if(!n.credentials||n.credentials&&!n.credentials.access_token)throw new Error("Could not refresh access token.");return{token:n.credentials.access_token,res:n.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let n=this.credentials;if(!n.access_token&&!n.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(n.access_token&&!this.isTokenExpiring()){n.token_type=n.token_type||"Bearer";let a=new Headers({authorization:n.token_type+" "+n.access_token});return{headers:this.addSharedMetadataHeaders(a)}}if(this.refreshHandler){let a=await this.processAndValidateRefreshHandler();if(a?.access_token){this.setCredentials(a);let c=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(c)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let r=null,s=null;try{r=await this.refreshToken(n.refresh_token),s=r.tokens}catch(a){let c=a;throw c.response&&(c.response.status===403||c.response.status===404)&&(c.message=`Could not refresh access token: ${c.message}`),c}let i=this.credentials;i.token_type=i.token_type||"Bearer",s.refresh_token=i.refresh_token,this.credentials=s;let o=new Headers({authorization:i.token_type+" "+s.access_token});return{headers:this.addSharedMetadataHeaders(o),res:r.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let n=new URL(this.endpoints.oauth2RevokeUrl);return n.searchParams.append("token",e),n}revokeToken(e,n){let r={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(tq.AuthClient.setMethodName(r,"revokeToken"),n)this.transporter.request(r).then(s=>n(null,s),n);else return this.transporter.request(r)}revokeCredentials(e){if(e)this.revokeCredentialsAsync().then(n=>e(null,n),e);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let e=this.credentials.access_token;if(this.credentials={},e)return this.revokeToken(e);throw new Error("No access token to revoke.")}request(e,n){if(n)this.requestAsync(e).then(r=>n(null,r),r=>n(r,r.response));else return this.requestAsync(e)}async requestAsync(e,n=!1){try{let r=await this.getRequestMetadataAsync();return e.headers=AGt.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,r.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(r){let s=r.response;if(s){let i=s.status,o=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),a=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,c=s.config.data instanceof _Nr.Readable,u=i===401||i===403;if(!n&&u&&!c&&o)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!n&&u&&!c&&a){let l=await this.processAndValidateRefreshHandler();return l?.access_token&&this.setCredentials(l),this.requestAsync(e,!0)}}throw r}}verifyIdToken(e,n){if(n&&typeof n!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(n)this.verifyIdTokenAsync(e).then(r=>n(null,r),n);else return this.verifyIdTokenAsync(e)}async verifyIdTokenAsync(e){if(!e.idToken)throw new Error("The verifyIdToken method requires an ID Token");let n=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(e.idToken,n.certs,e.audience,this.issuers,e.maxExpiry)}async getTokenInfo(e){let{data:n}=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${e}`},url:this.endpoints.tokenInfoUrl.toString()}),r=Object.assign({expiry_date:new Date().getTime()+n.expires_in*1e3,scopes:n.scope.split(" ")},n);return delete r.expires_in,delete r.scope,r}getFederatedSignonCerts(e){if(e)this.getFederatedSignonCertsAsync().then(n=>e(null,n.certs,n.res),e);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let e=new Date().getTime(),n=(0,L3e.hasBrowserCrypto)()?ow.JWK:ow.PEM;if(this.certificateExpiry&&e[0-9]+)/.exec(i)?.groups?.maxAge;u&&(o=Number(u)*1e3)}let a={};switch(n){case ow.PEM:a=r.data;break;case ow.JWK:for(let u of r.data.keys)a[u.kid]=u;break;default:throw new Error(`Unsupported certificate format ${n}`)}let c=new Date;return this.certificateExpiry=o===-1?null:new Date(c.getTime()+o),this.certificateCache=a,this.certificateCacheFormat=n,{certs:a,format:n,res:r}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(n=>e(null,n.pubkeys,n.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,n=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let r={...t.RETRY_CONFIG,url:n};tq.AuthClient.setMethodName(r,"getIapPublicKeysAsync"),e=await this.transporter.request(r)}catch(r){throw r instanceof Error&&(r.message=`Failed to retrieve verification certificates: ${r.message}`),r}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,n,r,s,i){let o=(0,L3e.createCrypto)();i||(i=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let a=e.split(".");if(a.length!==3)throw new Error("Wrong number of segments in token: "+e);let c=a[0]+"."+a[1],u=a[2],l,d;try{l=JSON.parse(o.decodeBase64StringUtf8(a[0]))}catch(S){throw S instanceof Error&&(S.message=`Can't parse token envelope: ${a[0]}': ${S.message}`),S}if(!l)throw new Error("Can't parse token envelope: "+a[0]);try{d=JSON.parse(o.decodeBase64StringUtf8(a[1]))}catch(S){throw S instanceof Error&&(S.message=`Can't parse token payload '${a[0]}`),S}if(!d)throw new Error("Can't parse token payload: "+a[1]);if(!Object.prototype.hasOwnProperty.call(n,l.kid))throw new Error("No pem found for envelope: "+JSON.stringify(l));let h=n[l.kid];if(l.alg==="ES256"&&(u=SNr.joseToDer(u,"ES256").toString("base64")),!await o.verify(h,c,u))throw new Error("Invalid token signature: "+e);if(!d.iat)throw new Error("No issue time in token: "+JSON.stringify(d));if(!d.exp)throw new Error("No expiration time in token: "+JSON.stringify(d));let f=Number(d.iat);if(isNaN(f))throw new Error("iat field using invalid format");let g=Number(d.exp);if(isNaN(g))throw new Error("exp field using invalid format");let A=new Date().getTime()/1e3;if(g>=A+i)throw new Error("Expiration time too far in future: "+JSON.stringify(d));let y=f-t.CLOCK_SKEW_SECS_,b=g+t.CLOCK_SKEW_SECS_;if(Ab)throw new Error("Token used too late, "+A+" > "+b+": "+JSON.stringify(d));if(s&&s.indexOf(d.iss)<0)throw new Error("Invalid issuer, expected one of ["+s+"], but got "+d.iss);if(typeof r<"u"&&r!==null){let S=d.aud,C=!1;if(r.constructor===Array?C=r.indexOf(S)>-1:C=S===r,!C)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new CNr.LoginTicket(l,d)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let e=await this.refreshHandler();if(!e.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return e}}isTokenExpiring(){let e=this.credentials.expiry_date;return e?e<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};SC.OAuth2Client=F3e});var U3e=ee(Rme=>{"use strict";p();Object.defineProperty(Rme,"__esModule",{value:!0});Rme.Compute=void 0;var INr=$p(),bGt=PK(),xNr=Tk(),Q3e=class extends xNr.OAuth2Client{serviceAccountEmail;scopes;constructor(e={}){super(e),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=e.serviceAccountEmail||"default",this.scopes=Array.isArray(e.scopes)?e.scopes:e.scopes?[e.scopes]:[]}async refreshTokenNoCache(){let e=`service-accounts/${this.serviceAccountEmail}/token`,n;try{let s={property:e};this.scopes.length>0&&(s.params={scopes:this.scopes.join(",")}),n=await bGt.instance(s)}catch(s){throw s instanceof INr.GaxiosError&&(s.message=`Could not refresh access token: ${s.message}`,this.wrapError(s)),s}let r=n;return n&&n.expires_in&&(r.expiry_date=new Date().getTime()+n.expires_in*1e3,delete r.expires_in),this.emit("tokens",r),{tokens:r,res:null}}async fetchIdToken(e){let n=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${e}`,r;try{let s={property:n};r=await bGt.instance(s)}catch(s){throw s instanceof Error&&(s.message=`Could not fetch ID token: ${s.message}`),s}return r}wrapError(e){let n=e.response;n&&n.status&&(e.status=n.status,n.status===403?e.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+e.message:n.status===404&&(e.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+e.message))}};Rme.Compute=Q3e});var G3e=ee(kme=>{"use strict";p();Object.defineProperty(kme,"__esModule",{value:!0});kme.IdTokenClient=void 0;var wNr=Tk(),$3e=class extends wNr.OAuth2Client{targetAudience;idTokenProvider;constructor(e){super(e),this.targetAudience=e.targetAudience,this.idTokenProvider=e.idTokenProvider}async getRequestMetadataAsync(){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let n=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:n,expiry_date:this.getIdTokenExpiryDate(n)}}return{headers:new Headers({authorization:"Bearer "+this.credentials.id_token})}}getIdTokenExpiryDate(e){let n=e.split(".")[1];if(n)return JSON.parse(Buffer.from(n,"base64").toString("ascii")).exp*1e3}};kme.IdTokenClient=$3e});var W3e=ee(nq=>{"use strict";p();Object.defineProperty(nq,"__esModule",{value:!0});nq.GCPEnv=void 0;nq.clear=TNr;nq.getEnv=vNr;var _Gt=PK(),CC;(function(t){t.APP_ENGINE="APP_ENGINE",t.KUBERNETES_ENGINE="KUBERNETES_ENGINE",t.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",t.COMPUTE_ENGINE="COMPUTE_ENGINE",t.CLOUD_RUN="CLOUD_RUN",t.CLOUD_RUN_JOBS="CLOUD_RUN_JOBS",t.NONE="NONE"})(CC||(nq.GCPEnv=CC={}));var QK;function TNr(){QK=void 0}async function vNr(){return QK||(QK=RNr(),QK)}async function RNr(){let t=CC.NONE;return kNr()?t=CC.APP_ENGINE:NNr()?t=CC.CLOUD_FUNCTIONS:await ONr()?await PNr()?t=CC.KUBERNETES_ENGINE:DNr()?t=CC.CLOUD_RUN:BNr()?t=CC.CLOUD_RUN_JOBS:t=CC.COMPUTE_ENGINE:t=CC.NONE,t}function kNr(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}function NNr(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}function DNr(){return!!process.env.K_CONFIGURATION}function BNr(){return!!process.env.CLOUD_RUN_JOB}async function PNr(){try{return await _Gt.instance("attributes/cluster-name"),!0}catch{return!1}}async function ONr(){return _Gt.isAvailable()}});var q3e=ee((Rio,SGt)=>{p();var Nme=ZW().Buffer,MNr=require("stream"),LNr=require("util");function Dme(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Nme.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Nme.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}LNr.inherits(Dme,MNr);Dme.prototype.write=function(e){this.buffer=Nme.concat([this.buffer,Nme.from(e)]),this.emit("data",e)};Dme.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};SGt.exports=Dme});var IGt=ee((Nio,CGt)=>{"use strict";p();var UK=require("buffer").Buffer,H3e=require("buffer").SlowBuffer;CGt.exports=Bme;function Bme(t,e){if(!UK.isBuffer(t)||!UK.isBuffer(e)||t.length!==e.length)return!1;for(var n=0,r=0;r{p();var sq=ZW().Buffer,wE=require("crypto"),wGt=C3e(),xGt=require("util"),UNr=`"%s" is not a valid algorithm. +`+g+"}":"{"+A.join(",")+"}",r=g,h}}typeof tXt.stringify!="function"&&(tXt.stringify=function(u,l,d){var m;if(r="",i="",typeof d=="number")for(m=0;m{p();var f0e=null,Fei=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,Qei=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/,Uei=function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var n,r,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` +`,r:"\r",t:" "},s,o=function(g){throw{name:"SyntaxError",message:g,at:n,text:s}},a=function(g){return g&&g!==r&&o("Expected '"+g+"' instead of '"+r+"'"),r=s.charAt(n),n+=1,r},c=function(){var g,A="";for(r==="-"&&(A="-",a("-"));r>="0"&&r<="9";)A+=r,a();if(r===".")for(A+=".";a()&&r>="0"&&r<="9";)A+=r;if(r==="e"||r==="E")for(A+=r,a(),(r==="-"||r==="+")&&(A+=r,a());r>="0"&&r<="9";)A+=r,a();if(g=+A,!isFinite(g))o("Bad number");else return f0e==null&&(f0e=k9e()),A.length>15?e.storeAsString?A:e.useNativeBigInt?BigInt(A):new f0e(A):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(g):new f0e(g):g},u=function(){var g,A,y="",E;if(r==='"')for(var _=n;a();){if(r==='"')return n-1>_&&(y+=s.substring(_,n-1)),a(),y;if(r==="\\"){if(n-1>_&&(y+=s.substring(_,n-1)),a(),r==="u"){for(E=0,A=0;A<4&&(g=parseInt(a(),16),!!isFinite(g));A+=1)E=E*16+g;y+=String.fromCharCode(E)}else if(typeof i[r]=="string")y+=i[r];else break;_=n}}o("Bad string")},l=function(){for(;r&&r<=" ";)a()},d=function(){switch(r){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}o("Unexpected '"+r+"'")},m,h=function(){var g=[];if(r==="["){if(a("["),l(),r==="]")return a("]"),g;for(;r;){if(g.push(m()),l(),r==="]")return a("]"),g;a(","),l()}}o("Bad array")},f=function(){var g,A=Object.create(null);if(r==="{"){if(a("{"),l(),r==="}")return a("}"),A;for(;r;){if(g=u(),l(),a(":"),e.strict===!0&&Object.hasOwnProperty.call(A,g)&&o('Duplicate key "'+g+'"'),Fei.test(g)===!0?e.protoAction==="error"?o("Object contains forbidden prototype property"):e.protoAction==="ignore"?m():A[g]=m():Qei.test(g)===!0?e.constructorAction==="error"?o("Object contains forbidden constructor property"):e.constructorAction==="ignore"?m():A[g]=m():A[g]=m(),l(),r==="}")return a("}"),A;a(","),l()}}o("Bad object")};return m=function(){switch(l(),r){case"{":return f();case"[":return h();case'"':return u();case"-":return c();default:return r>="0"&&r<="9"?c():d()}},function(g,A){var y;return s=g+"",n=0,r=" ",y=m(),l(),r&&o("Syntax error"),typeof A=="function"?(function E(_,S){var C,I,w=_[S];return w&&typeof w=="object"&&Object.keys(w).forEach(function(k){I=E(w,k),I!==void 0?w[k]=I:delete w[k]}),A.call(_,S,w)})({"":y},""):y}};iXt.exports=Uei});var cXt=re((GQo,g0e)=>{p();var oXt=rXt().stringify,aXt=sXt();g0e.exports=function(t){return{parse:aXt(t),stringify:oXt}};g0e.exports.parse=aXt();g0e.exports.stringify=oXt});var B9e=re(bx=>{"use strict";p();Object.defineProperty(bx,"__esModule",{value:!0});bx.GCE_LINUX_BIOS_PATHS=void 0;bx.isGoogleCloudServerless=dXt;bx.isGoogleComputeEngineLinux=pXt;bx.isGoogleComputeEngineMACAddress=mXt;bx.isGoogleComputeEngine=hXt;bx.detectGCPResidency=$ei;var lXt=require("fs"),uXt=require("os");bx.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var Gei=/^42:01/;function dXt(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}function pXt(){if((0,uXt.platform)()!=="linux")return!1;try{(0,lXt.statSync)(bx.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,lXt.readFileSync)(bx.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}function mXt(){let t=(0,uXt.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:n}of e)if(Gei.test(n))return!0}return!1}function hXt(){return pXt()||mXt()}function $ei(){return dXt()||hXt()}});var fXt=re(y0e=>{"use strict";p();Object.defineProperty(y0e,"__esModule",{value:!0});y0e.Colours=void 0;var A0e=class t{static enabled=!1;static reset="";static bright="";static dim="";static red="";static green="";static yellow="";static blue="";static magenta="";static cyan="";static white="";static grey="";static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process?.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};y0e.Colours=A0e;A0e.refresh()});var AXt=re(E0e=>{"use strict";p();Object.defineProperty(E0e,"__esModule",{value:!0});E0e.LogSeverity=void 0;var gXt;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(gXt||(E0e.LogSeverity=gXt={}))});var _Xt=re(Dc=>{"use strict";p();var Wei=Dc&&Dc.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Hei=Dc&&Dc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yXt=Dc&&Dc.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;ithis.on(r,i)}),this.func.debug=(...r)=>this.invokeSeverity(Cv.LogSeverity.DEBUG,...r),this.func.info=(...r)=>this.invokeSeverity(Cv.LogSeverity.INFO,...r),this.func.warn=(...r)=>this.invokeSeverity(Cv.LogSeverity.WARNING,...r),this.func.error=(...r)=>this.invokeSeverity(Cv.LogSeverity.ERROR,...r),this.func.sublog=r=>bXt(r,this.func)}invoke(e,...n){if(this.upstream)try{this.upstream(e,...n)}catch{}try{this.emit("log",e,n)}catch{}}invokeSeverity(e,...n){this.invoke({severity:e},...n)}};Dc.AdhocDebugLogger=VX;Dc.placeholder=new VX("",()=>{}).func;var g3=class{cached=new Map;filters=[];filtersSet=!1;constructor(){let e=jX.env[Dc.env.nodeEnables]??"*";e==="all"&&(e="*"),this.filters=e.split(",")}log(e,n,...r){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let i=this.cached.get(e);i||(i=this.makeLogger(e),this.cached.set(e,i)),i(n,...r)}catch(i){console.error(i)}}};Dc.DebugLogBackendBase=g3;var N9e=class extends g3{enabledRegexp=/.*/g;isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(n,...r)=>{let i=`${Gy.Colours.green}${e}${Gy.Colours.reset}`,s=`${Gy.Colours.yellow}${jX.pid}${Gy.Colours.reset}`,o;switch(n.severity){case Cv.LogSeverity.ERROR:o=`${Gy.Colours.red}${n.severity}${Gy.Colours.reset}`;break;case Cv.LogSeverity.INFO:o=`${Gy.Colours.magenta}${n.severity}${Gy.Colours.reset}`;break;case Cv.LogSeverity.WARNING:o=`${Gy.Colours.yellow}${n.severity}${Gy.Colours.reset}`;break;default:o=n.severity??Cv.LogSeverity.DEFAULT;break}let a=EXt.formatWithOptions({colors:Gy.Colours.enabled},...r),c=Object.assign({},n);delete c.severity;let u=Object.getOwnPropertyNames(c).length?JSON.stringify(c):"",l=u?`${Gy.Colours.grey}${u}${Gy.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",s,i,o,a,u?` ${l}`:"")}:()=>{}}setFilters(){let n=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${n}$`,"i")}};function D9e(){return new N9e}var P9e=class extends g3{debugPkg;constructor(e){super(),this.debugPkg=e}makeLogger(e){let n=this.debugPkg(e);return(r,...i)=>{n(i[0],...i.slice(1))}}setFilters(){let e=jX.env.NODE_DEBUG??"";jX.env.NODE_DEBUG=`${e}${e?",":""}${this.filters.join(",")}`}};function jei(t){return new P9e(t)}var M9e=class extends g3{upstream;constructor(e){super(),this.upstream=e??void 0}makeLogger(e){let n=this.upstream?.makeLogger(e);return(r,...i)=>{let s=r.severity??Cv.LogSeverity.INFO,o=Object.assign({severity:s,message:EXt.format(...i)},r),a=JSON.stringify(o);n?n(r,a):console.log("%s",a)}}setFilters(){this.upstream?.setFilters()}};function Vei(t){return new M9e(t)}Dc.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var O9e=new Map,_x;function Yei(t){_x=t,O9e.clear()}function bXt(t,e){if(!_x&&!jX.env[Dc.env.nodeEnables]||!t)return Dc.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let n=O9e.get(t);if(n)return n.func;if(_x===null)return Dc.placeholder;_x===void 0&&(_x=D9e());let r=(()=>{let i;return new VX(t,(o,...a)=>{if(i!==_x){if(_x===null)return;_x===void 0&&(_x=D9e()),i=_x}_x?.log(t,o,...a)})})();return O9e.set(t,r),r.func}});var xXt=re(c2=>{"use strict";p();var zei=c2&&c2.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Kei=c2&&c2.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&zei(e,t,n)};Object.defineProperty(c2,"__esModule",{value:!0});Kei(_Xt(),c2)});var zX=re(Si=>{"use strict";p();var CXt=Si&&Si.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Jei=Si&&Si.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xei=Si&&Si.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i{switch(e){case"params":case"property":case"headers":break;case"qs":throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");default:throw new Error(`'${e}' is not a valid configuration option.`)}})}async function YX(t,e={},n=3,r=!1){let i=new Headers(Si.HEADERS),s="",o={};if(typeof t=="object"){let d=t;new Headers(d.headers).forEach((m,h)=>i.set(h,m)),s=d.metadataKey,o=d.params||o,n=d.noResponseRetries||n,r=d.fastFail||r}else s=t;typeof e=="string"?s+=`/${e}`:(rti(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((d,m)=>i.set(m,d)),o=e.params||o);let a=r?iti:L9e.request,c={url:`${F9e()}/${s}`,headers:i,retryConfig:{noResponseRetries:n},params:o,responseType:"text",timeout:wXt()};SXt.info("instance request %j",c);let u=await a(c);SXt.info("instance metadata is %s",u.data);let l=u.headers.get(Si.HEADER_NAME);if(l!==Si.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${Si.HEADER_NAME} header. Expected '${Si.HEADER_VALUE}', got ${l?`'${l}'`:"no header"}`);if(typeof u.data=="string")try{return eti.parse(u.data)}catch{}return u.data}async function iti(t){let e={...t,url:t.url?.toString().replace(F9e(),F9e(Si.SECONDARY_HOST_ADDRESS))},n=(0,L9e.request)(t),r=(0,L9e.request)(e);return Promise.any([n,r])}function sti(t){return YX("instance",t)}function oti(t){return YX("project",t)}function ati(t){return YX("universe",t)}async function cti(t){let e={};return await Promise.all(t.map(n=>(async()=>{let r=await YX(n),i=n.metadataKey;e[i]=r})())),e}function lti(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}var b0e;async function uti(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in Si.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(Si.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return Q9e();case"ping-only":}}try{return b0e===void 0&&(b0e=YX("instance",void 0,lti(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await b0e,!0}catch(t){let e=t;if(process.env.DEBUG_AUTH&&console.info(e),e.type==="request-timeout"||e.response&&e.response.status===404)return!1;if(!(e.response&&e.response.status===404)&&(!e.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(e.code.toString()))){let n="UNKNOWN";e.code&&(n=e.code.toString()),process.emitWarning(`received unexpected error = ${e.message} code = ${n}`,"MetadataLookupWarning")}return!1}}function dti(){b0e=void 0}Si.gcpResidencyCache=null;function Q9e(){return Si.gcpResidencyCache===null&&IXt(),Si.gcpResidencyCache}function IXt(t=null){Si.gcpResidencyCache=t!==null?t:(0,tti.detectGCPResidency)()}function wXt(){return Q9e()?0:3e3}Zei(B9e(),Si)});var RXt=re(_0e=>{"use strict";p();_0e.byteLength=mti;_0e.toByteArray=fti;_0e.fromByteArray=yti;var bI=[],V0=[],pti=typeof Uint8Array<"u"?Uint8Array:Array,U9e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(l2=0,TXt=U9e.length;l20)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function mti(t){var e=vXt(t),n=e[0],r=e[1];return(n+r)*3/4-r}function hti(t,e,n){return(e+n)*3/4-n}function fti(t){var e,n=vXt(t),r=n[0],i=n[1],s=new pti(hti(t,r,i)),o=0,a=i>0?r-4:r,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=V0[t.charCodeAt(c)]<<2|V0[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=V0[t.charCodeAt(c)]<<10|V0[t.charCodeAt(c+1)]<<4|V0[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function gti(t){return bI[t>>18&63]+bI[t>>12&63]+bI[t>>6&63]+bI[t&63]}function Ati(t,e,n){for(var r,i=[],s=e;sa?a:o+s));return r===1?(e=t[n-1],i.push(bI[e>>2]+bI[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],i.push(bI[e>>10]+bI[e>>4&63]+bI[e<<2&63]+"=")),i.join("")}});var $9e=re(G9e=>{"use strict";p();Object.defineProperty(G9e,"__esModule",{value:!0});G9e.fromArrayBufferToHex=Eti;function Eti(t){return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}});var kXt=re(x0e=>{"use strict";p();Object.defineProperty(x0e,"__esModule",{value:!0});x0e.BrowserCrypto=void 0;var A3=RXt(),bti=$9e(),W9e=class t{constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let n=new TextEncoder().encode(e),r=await window.crypto.subtle.digest("SHA-256",n);return A3.fromByteArray(new Uint8Array(r))}randomBytesBase64(e){let n=new Uint8Array(e);return window.crypto.getRandomValues(n),A3.fromByteArray(n)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,n,r){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(n),o=A3.toByteArray(t.padBase64(r)),a=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,a,Buffer.from(o),s)}async sign(e,n){let r={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(n),s=await window.crypto.subtle.importKey("jwk",e,r,!0,["sign"]),o=await window.crypto.subtle.sign(r,s,i);return A3.fromByteArray(new Uint8Array(o))}decodeBase64StringUtf8(e){let n=A3.toByteArray(t.padBase64(e));return new TextDecoder().decode(n)}encodeBase64StringUtf8(e){let n=new TextEncoder().encode(e);return A3.fromByteArray(n)}async sha256DigestHex(e){let n=new TextEncoder().encode(e),r=await window.crypto.subtle.digest("SHA-256",n);return(0,bti.fromArrayBufferToHex)(r)}async signWithHmacSha256(e,n){let r=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,s=await window.crypto.subtle.importKey("raw",i.encode(r),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,i.encode(n))}};x0e.BrowserCrypto=W9e});var BXt=re(S0e=>{"use strict";p();Object.defineProperty(S0e,"__esModule",{value:!0});S0e.NodeCrypto=void 0;var y3=require("crypto"),H9e=class{async sha256DigestBase64(e){return y3.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return y3.randomBytes(e).toString("base64")}async verify(e,n,r){let i=y3.createVerify("RSA-SHA256");return i.update(n),i.end(),i.verify(e,r,"base64")}async sign(e,n){let r=y3.createSign("RSA-SHA256");return r.update(n),r.end(),r.sign(e,"base64")}decodeBase64StringUtf8(e){return Buffer.from(e,"base64").toString("utf-8")}encodeBase64StringUtf8(e){return Buffer.from(e,"utf-8").toString("base64")}async sha256DigestHex(e){return y3.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,n){let r=typeof e=="string"?e:xti(e);return _ti(y3.createHmac("sha256",r).update(n).digest())}};S0e.NodeCrypto=H9e;function _ti(t){let e=new ArrayBuffer(t.length),n=new Uint8Array(e);for(let r=0;r{"use strict";p();var Sti=Iv&&Iv.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Cti=Iv&&Iv.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Sti(e,t,n)};Object.defineProperty(Iv,"__esModule",{value:!0});Iv.createCrypto=Tti;Iv.hasBrowserCrypto=NXt;var Iti=kXt(),wti=BXt();Cti($9e(),Iv);function Tti(){return NXt()?new Iti.BrowserCrypto:new wti.NodeCrypto}function NXt(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}});var E3=re((q9e,PXt)=>{p();var C0e=require("buffer"),_I=C0e.Buffer;function DXt(t,e){for(var n in t)e[n]=t[n]}_I.from&&_I.alloc&&_I.allocUnsafe&&_I.allocUnsafeSlow?PXt.exports=C0e:(DXt(C0e,q9e),q9e.Buffer=u2);function u2(t,e,n){return _I(t,e,n)}u2.prototype=Object.create(_I.prototype);DXt(_I,u2);u2.from=function(t,e,n){if(typeof t=="number")throw new TypeError("Argument must not be a number");return _I(t,e,n)};u2.alloc=function(t,e,n){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=_I(t);return e!==void 0?typeof n=="string"?r.fill(e,n):r.fill(e):r.fill(0),r};u2.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return _I(t)};u2.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return C0e.SlowBuffer(t)}});var OXt=re((pUo,MXt)=>{"use strict";p();function j9e(t){var e=(t/8|0)+(t%8===0?0:1);return e}var vti={ES256:j9e(256),ES384:j9e(384),ES512:j9e(521)};function Rti(t){var e=vti[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}MXt.exports=Rti});var V9e=re((hUo,$Xt)=>{"use strict";p();var I0e=E3().Buffer,FXt=OXt(),w0e=128,QXt=0,kti=32,Bti=16,Nti=2,UXt=Bti|kti|QXt<<6,T0e=Nti|QXt<<6;function Dti(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function GXt(t){if(I0e.isBuffer(t))return t;if(typeof t=="string")return I0e.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Pti(t,e){t=GXt(t);var n=FXt(e),r=n+1,i=t.length,s=0;if(t[s++]!==UXt)throw new Error('Could not find expected "seq"');var o=t[s++];if(o===(w0e|1)&&(o=t[s++]),i-s=w0e;return i&&--r,r}function Mti(t,e){t=GXt(t);var n=FXt(e),r=t.length;if(r!==n*2)throw new TypeError('"'+e+'" signatures must be "'+n*2+'" bytes, saw "'+r+'"');var i=LXt(t,0,n),s=LXt(t,n,t.length),o=n-i,a=n-s,c=2+o+1+1+a,u=c{"use strict";p();Object.defineProperty(wv,"__esModule",{value:!0});wv.LRUCache=void 0;wv.snakeToCamel=HXt;wv.originalOrCamelOptions=Qti;wv.removeUndefinedValuesInObject=Uti;wv.isValidFile=Gti;wv.getWellKnownCertificateConfigFileLocation=$ti;var Oti=require("fs"),Lti=require("os"),Y9e=require("path"),Fti="certificate_config.json",WXt="gcloud";function HXt(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}function Qti(t){function e(n){let r=t||{};return r[n]??r[HXt(n)]}return{get:e}}var z9e=class{capacity;#e=new Map;maxAge;constructor(e){this.capacity=e.capacity,this.maxAge=e.maxAge}#t(e,n){this.#e.delete(e),this.#e.set(e,{value:n,lastAccessed:Date.now()})}set(e,n){this.#t(e,n),this.#n()}get(e){let n=this.#e.get(e);if(n)return this.#t(e,n.value),this.#n(),n.value}#n(){let e=this.maxAge?Date.now()-this.maxAge:0,n=this.#e.entries().next();for(;!n.done&&(this.#e.size>this.capacity||n.value[1].lastAccessed{(n===void 0||n==="undefined")&&delete t[e]}),t}async function Gti(t){try{return(await Oti.promises.lstat(t)).isFile()}catch{return!1}}function $ti(){let t=process.env.CLOUDSDK_CONFIG||(Wti()?Y9e.join(process.env.APPDATA||"",WXt):Y9e.join(process.env.HOME||"",".config",WXt));return Y9e.join(t,Fti)}function Wti(){return Lti.platform().startsWith("win")}});var qXt=re(v0e=>{"use strict";p();Object.defineProperty(v0e,"__esModule",{value:!0});v0e.Colours=void 0;var Mh=class t{static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process==null?void 0:process.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};v0e.Colours=Mh;Mh.enabled=!1;Mh.reset="";Mh.bright="";Mh.dim="";Mh.red="";Mh.green="";Mh.yellow="";Mh.blue="";Mh.magenta="";Mh.cyan="";Mh.white="";Mh.grey="";Mh.refresh()});var zXt=re(ja=>{"use strict";p();var Hti=ja&&ja.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),qti=ja&&ja.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jXt=ja&&ja.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;ithis.on(r,i)}),this.func.debug=(...r)=>this.invokeSeverity(Sx.DEBUG,...r),this.func.info=(...r)=>this.invokeSeverity(Sx.INFO,...r),this.func.warn=(...r)=>this.invokeSeverity(Sx.WARNING,...r),this.func.error=(...r)=>this.invokeSeverity(Sx.ERROR,...r),this.func.sublog=r=>YXt(r,this.func)}invoke(e,...n){if(this.upstream)try{this.upstream(e,...n)}catch{}try{this.emit("log",e,n)}catch{}}invokeSeverity(e,...n){this.invoke({severity:e},...n)}};ja.AdhocDebugLogger=XX;ja.placeholder=new XX("",()=>{}).func;var b3=class{constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let n=(e=JX.env[ja.env.nodeEnables])!==null&&e!==void 0?e:"*";n==="all"&&(n="*"),this.filters=n.split(",")}log(e,n,...r){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let i=this.cached.get(e);i||(i=this.makeLogger(e),this.cached.set(e,i)),i(n,...r)}catch(i){console.error(i)}}};ja.DebugLogBackendBase=b3;var K9e=class extends b3{constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(n,...r)=>{var i;let s=`${$y.Colours.green}${e}${$y.Colours.reset}`,o=`${$y.Colours.yellow}${JX.pid}${$y.Colours.reset}`,a;switch(n.severity){case Sx.ERROR:a=`${$y.Colours.red}${n.severity}${$y.Colours.reset}`;break;case Sx.INFO:a=`${$y.Colours.magenta}${n.severity}${$y.Colours.reset}`;break;case Sx.WARNING:a=`${$y.Colours.yellow}${n.severity}${$y.Colours.reset}`;break;default:a=(i=n.severity)!==null&&i!==void 0?i:Sx.DEFAULT;break}let c=VXt.formatWithOptions({colors:$y.Colours.enabled},...r),u=Object.assign({},n);delete u.severity;let l=Object.getOwnPropertyNames(u).length?JSON.stringify(u):"",d=l?`${$y.Colours.grey}${l}${$y.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",o,s,a,c,l?` ${d}`:"")}:()=>{}}setFilters(){let n=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${n}$`,"i")}};function J9e(){return new K9e}var X9e=class extends b3{constructor(e){super(),this.debugPkg=e}makeLogger(e){let n=this.debugPkg(e);return(r,...i)=>{n(i[0],...i.slice(1))}}setFilters(){var e;let n=(e=JX.env.NODE_DEBUG)!==null&&e!==void 0?e:"";JX.env.NODE_DEBUG=`${n}${n?",":""}${this.filters.join(",")}`}};function Vti(t){return new X9e(t)}var Z9e=class extends b3{constructor(e){var n;super(),this.upstream=(n=e)!==null&&n!==void 0?n:void 0}makeLogger(e){var n;let r=(n=this.upstream)===null||n===void 0?void 0:n.makeLogger(e);return(i,...s)=>{var o;let a=(o=i.severity)!==null&&o!==void 0?o:Sx.INFO,c=Object.assign({severity:a,message:VXt.format(...s)},i),u=JSON.stringify(c);r?r(i,u):console.log("%s",u)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function Yti(t){return new Z9e(t)}ja.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var e6e=new Map,Wy;function zti(t){Wy=t,e6e.clear()}function YXt(t,e){if(!Wy&&!JX.env[ja.env.nodeEnables]||!t)return ja.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let n=e6e.get(t);if(n)return n.func;if(Wy===null)return ja.placeholder;Wy===void 0&&(Wy=J9e());let r=(()=>{let i;return new XX(t,(o,...a)=>{if(i!==Wy){if(Wy===null)return;Wy===void 0&&(Wy=J9e()),i=Wy}Wy?.log(t,o,...a)})})();return e6e.set(t,r),r.func}});var KXt=re(d2=>{"use strict";p();var Kti=d2&&d2.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Jti=d2&&d2.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Kti(e,t,n)};Object.defineProperty(d2,"__esModule",{value:!0});Jti(zXt(),d2)});var JXt=re((CUo,Xti)=>{Xti.exports={name:"google-auth-library",version:"10.9.1",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:{type:"git",directory:"core/packages/google-auth-library-nodejs",url:"https://github.com/googleapis/google-cloud-node.git"},keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.1.4","gcp-metadata":"8.1.2","google-logging-utils":"1.1.3",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/node":"^24.0.0","@types/sinon":"^21.0.0","assert-rejects":"^1.0.0",c8:"^10.1.3",codecov:"^3.8.3",gts:"^6.0.2","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.1",puppeteer:"^24.0.0",sinon:"21.0.3","ts-loader":"^9.5.2",typescript:"5.8.3",webpack:"^5.97.1","webpack-cli":"^6.0.1"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0",homepage:"https://github.com/googleapis/google-cloud-node/tree/main/core/packages/google-auth-library-nodejs"}});var t6e=re(dN=>{"use strict";p();Object.defineProperty(dN,"__esModule",{value:!0});dN.USER_AGENT=dN.PRODUCT_NAME=dN.pkg=void 0;var XXt=JXt();dN.pkg=XXt;var ZXt="google-api-nodejs-client";dN.PRODUCT_NAME=ZXt;var Zti=`${ZXt}/${XXt.version}`;dN.USER_AGENT=Zti});var Hy=re(Cx=>{"use strict";p();Object.defineProperty(Cx,"__esModule",{value:!0});Cx.AuthClient=Cx.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Cx.DEFAULT_UNIVERSE=void 0;var eni=require("events"),n6e=Um(),tni=xx(),nni=KXt(),r6e=t6e();Cx.DEFAULT_UNIVERSE="googleapis.com";Cx.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var i6e=class t extends eni.EventEmitter{apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=Cx.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=Cx.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let n=(0,tni.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=n.get("project_id")??null,this.quotaProjectId=n.get("quota_project_id"),this.credentials=n.get("credentials")??{},this.universeDomain=n.get("universe_domain")??Cx.DEFAULT_UNIVERSE,this.transporter=e.transporter??new n6e.Gaxios(e.transporterOptions),n.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let n=e[0],r=e[1],i,s=new Headers;return typeof n=="string"?i=new URL(n):n instanceof URL?i=n:n&&n.url&&(i=new URL(n.url)),n&&typeof n=="object"&&"headers"in n&&n6e.Gaxios.mergeHeaders(s,n.headers),r&&n6e.Gaxios.mergeHeaders(s,new Headers(r.headers)),typeof n=="object"&&!(n instanceof URL)?this.request({...r,...n,headers:s,url:i}):this.request({...r,headers:s,url:i})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,n){let r=n.get("x-goog-user-project"),i=n.get("authorization");return r&&e.set("x-goog-user-project",r),i&&e.set("authorization",i),e}static log=(0,nni.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:async e=>{if(!e.headers.has("x-goog-api-client")){let r=process.version.replace(/^v/,"");e.headers.set("x-goog-api-client",`gl-node/${r}`)}let n=e.headers.get("User-Agent");n?n.includes(`${r6e.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${n} ${r6e.USER_AGENT}`):e.headers.set("User-Agent",r6e.USER_AGENT);try{let r=e,i=r[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;r[t.RequestLogIdSymbol]=s;let o={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,o):t.log.info("[%s] request %j",s,o)}catch{}return e}};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:async e=>{try{let n=e.config,r=n[t.RequestMethodNameSymbol],i=n[t.RequestLogIdSymbol];r?t.log.info("%s [%s] response %j",r,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},rejected:async e=>{try{let n=e.config,r=n[t.RequestMethodNameSymbol],i=n[t.RequestLogIdSymbol];r?t.log.info("%s [%s] error %j",r,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e}};static setMethodName(e,n){try{let r=e;r[t.RequestMethodNameSymbol]=n}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Cx.AuthClient=i6e});var o6e=re(R0e=>{"use strict";p();Object.defineProperty(R0e,"__esModule",{value:!0});R0e.LoginTicket=void 0;var s6e=class{envelope;payload;constructor(e,n){this.envelope=e,this.payload=n}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let e=this.getPayload();return e&&e.sub?e.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};R0e.LoginTicket=s6e});var pN=re(xI=>{"use strict";p();Object.defineProperty(xI,"__esModule",{value:!0});xI.OAuth2Client=xI.ClientAuthentication=xI.CertificateFormat=xI.CodeChallengeMethod=void 0;var eZt=Um(),rni=require("querystring"),ini=require("stream"),sni=V9e(),tZt=xx(),a6e=KX(),_3=Hy(),oni=o6e(),nZt;(function(t){t.Plain="plain",t.S256="S256"})(nZt||(xI.CodeChallengeMethod=nZt={}));var Tv;(function(t){t.PEM="PEM",t.JWK="JWK"})(Tv||(xI.CertificateFormat=Tv={}));var ZX;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(ZX||(xI.ClientAuthentication=ZX={}));var c6e=class t extends _3.AuthClient{redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=Tv.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(e={},n,r){super(typeof e=="object"?e:{}),typeof e!="object"&&(e={clientId:e,clientSecret:n,redirectUri:r}),this._clientId=e.clientId||e.client_id,this._clientSecret=e.clientSecret||e.client_secret,this.redirectUri=e.redirectUri||e.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...e.endpoints},this.clientAuthentication=e.clientAuthentication||ZX.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+rni.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,a6e.createCrypto)(),r=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),s=(await e.sha256DigestBase64(r)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:r,codeChallenge:s}}getToken(e,n){let r=typeof e=="string"?{code:e}:e;if(n)this.getTokenAsync(r).then(i=>n(null,i.tokens,i.res),i=>n(i,null,i.response));else return this.getTokenAsync(r)}async getTokenAsync(e){let n=this.endpoints.oauth2TokenUrl.toString(),r=new Headers,i={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===ZX.ClientSecretBasic){let c=Buffer.from(`${this._clientId}:${this._clientSecret}`);r.set("authorization",`Basic ${c.toString("base64")}`)}this.clientAuthentication===ZX.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:n,data:new URLSearchParams((0,tZt.removeUndefinedValuesInObject)(i)),headers:r};_3.AuthClient.setMethodName(s,"getTokenAsync");let o=await this.transporter.request(s),a=o.data;return o.data&&o.data.expires_in&&(a.expiry_date=new Date().getTime()+o.data.expires_in*1e3,delete a.expires_in),this.emit("tokens",a),{tokens:a,res:o}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let n=this.refreshTokenNoCache(e).then(r=>(this.refreshTokenPromises.delete(e),r),r=>{throw this.refreshTokenPromises.delete(e),r});return this.refreshTokenPromises.set(e,n),n}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let n=this.endpoints.oauth2TokenUrl.toString(),r={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let o={...t.RETRY_CONFIG,method:"POST",url:n,data:new URLSearchParams((0,tZt.removeUndefinedValuesInObject)(r))};_3.AuthClient.setMethodName(o,"refreshTokenNoCache"),i=await this.transporter.request(o)}catch(o){throw o instanceof eZt.GaxiosError&&o.message==="invalid_grant"&&o.response?.data&&/ReAuth/i.test(o.response.data.error_description)&&(o.message=JSON.stringify(o.response.data)),o}let s=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(n=>e(null,n.credentials,n.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),n=e.tokens;return n.refresh_token=this.credentials.refresh_token,this.credentials=n,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(n=>e(null,n.token,n.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let r=await this.processAndValidateRefreshHandler();if(r?.access_token)return this.setCredentials(r),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let n=await this.refreshAccessTokenAsync();if(!n.credentials||n.credentials&&!n.credentials.access_token)throw new Error("Could not refresh access token.");return{token:n.credentials.access_token,res:n.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let n=this.credentials;if(!n.access_token&&!n.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(n.access_token&&!this.isTokenExpiring()){n.token_type=n.token_type||"Bearer";let a=new Headers({authorization:n.token_type+" "+n.access_token});return{headers:this.addSharedMetadataHeaders(a)}}if(this.refreshHandler){let a=await this.processAndValidateRefreshHandler();if(a?.access_token){this.setCredentials(a);let c=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(c)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let r=null,i=null;try{r=await this.refreshToken(n.refresh_token),i=r.tokens}catch(a){let c=a;throw c.response&&(c.response.status===403||c.response.status===404)&&(c.message=`Could not refresh access token: ${c.message}`),c}let s=this.credentials;s.token_type=s.token_type||"Bearer",i.refresh_token=s.refresh_token,this.credentials=i;let o=new Headers({authorization:s.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(o),res:r.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let n=new URL(this.endpoints.oauth2RevokeUrl);return n.searchParams.append("token",e),n}revokeToken(e,n){let r={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(_3.AuthClient.setMethodName(r,"revokeToken"),n)this.transporter.request(r).then(i=>n(null,i),n);else return this.transporter.request(r)}revokeCredentials(e){if(e)this.revokeCredentialsAsync().then(n=>e(null,n),e);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let e=this.credentials.access_token;if(this.credentials={},e)return this.revokeToken(e);throw new Error("No access token to revoke.")}request(e,n){if(n)this.requestAsync(e).then(r=>n(null,r),r=>n(r,r.response));else return this.requestAsync(e)}async requestAsync(e,n=!1){try{let r=await this.getRequestMetadataAsync();return e.headers=eZt.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,r.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(r){let i=r.response;if(i){let s=i.status,o=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),a=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,c=i.config.data instanceof ini.Readable,u=s===401||s===403;if(!n&&u&&!c&&o)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!n&&u&&!c&&a){let l=await this.processAndValidateRefreshHandler();return l?.access_token&&this.setCredentials(l),this.requestAsync(e,!0)}}throw r}}verifyIdToken(e,n){if(n&&typeof n!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(n)this.verifyIdTokenAsync(e).then(r=>n(null,r),n);else return this.verifyIdTokenAsync(e)}async verifyIdTokenAsync(e){if(!e.idToken)throw new Error("The verifyIdToken method requires an ID Token");let n=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(e.idToken,n.certs,e.audience,this.issuers,e.maxExpiry)}async getTokenInfo(e){let{data:n}=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${e}`},url:this.endpoints.tokenInfoUrl.toString()}),r=Object.assign({expiry_date:new Date().getTime()+n.expires_in*1e3,scopes:n.scope.split(" ")},n);return delete r.expires_in,delete r.scope,r}getFederatedSignonCerts(e){if(e)this.getFederatedSignonCertsAsync().then(n=>e(null,n.certs,n.res),e);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let e=new Date().getTime(),n=(0,a6e.hasBrowserCrypto)()?Tv.JWK:Tv.PEM;if(this.certificateExpiry&&e[0-9]+)/.exec(s)?.groups?.maxAge;u&&(o=Number(u)*1e3)}let a={};switch(n){case Tv.PEM:a=r.data;break;case Tv.JWK:for(let u of r.data.keys)a[u.kid]=u;break;default:throw new Error(`Unsupported certificate format ${n}`)}let c=new Date;return this.certificateExpiry=o===-1?null:new Date(c.getTime()+o),this.certificateCache=a,this.certificateCacheFormat=n,{certs:a,format:n,res:r}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(n=>e(null,n.pubkeys,n.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,n=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let r={...t.RETRY_CONFIG,url:n};_3.AuthClient.setMethodName(r,"getIapPublicKeysAsync"),e=await this.transporter.request(r)}catch(r){throw r instanceof Error&&(r.message=`Failed to retrieve verification certificates: ${r.message}`),r}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,n,r,i,s){let o=(0,a6e.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let a=e.split(".");if(a.length!==3)throw new Error("Wrong number of segments in token: "+e);let c=a[0]+"."+a[1],u=a[2],l,d;try{l=JSON.parse(o.decodeBase64StringUtf8(a[0]))}catch(_){throw _ instanceof Error&&(_.message=`Can't parse token envelope: ${a[0]}': ${_.message}`),_}if(!l)throw new Error("Can't parse token envelope: "+a[0]);try{d=JSON.parse(o.decodeBase64StringUtf8(a[1]))}catch(_){throw _ instanceof Error&&(_.message=`Can't parse token payload '${a[0]}`),_}if(!d)throw new Error("Can't parse token payload: "+a[1]);if(!Object.prototype.hasOwnProperty.call(n,l.kid))throw new Error("No pem found for envelope: "+JSON.stringify(l));let m=n[l.kid];if(l.alg==="ES256"&&(u=sni.joseToDer(u,"ES256").toString("base64")),!await o.verify(m,c,u))throw new Error("Invalid token signature: "+e);if(!d.iat)throw new Error("No issue time in token: "+JSON.stringify(d));if(!d.exp)throw new Error("No expiration time in token: "+JSON.stringify(d));let f=Number(d.iat);if(isNaN(f))throw new Error("iat field using invalid format");let g=Number(d.exp);if(isNaN(g))throw new Error("exp field using invalid format");let A=new Date().getTime()/1e3;if(g>=A+s)throw new Error("Expiration time too far in future: "+JSON.stringify(d));let y=f-t.CLOCK_SKEW_SECS_,E=g+t.CLOCK_SKEW_SECS_;if(AE)throw new Error("Token used too late, "+A+" > "+E+": "+JSON.stringify(d));if(i&&i.indexOf(d.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+d.iss);if(typeof r<"u"&&r!==null){let _=d.aud,S=!1;if(r.constructor===Array?S=r.indexOf(_)>-1:S=_===r,!S)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new oni.LoginTicket(l,d)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let e=await this.refreshHandler();if(!e.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return e}}isTokenExpiring(){let e=this.credentials.expiry_date;return e?e<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};xI.OAuth2Client=c6e});var u6e=re(k0e=>{"use strict";p();Object.defineProperty(k0e,"__esModule",{value:!0});k0e.Compute=void 0;var ani=Um(),rZt=zX(),cni=pN(),l6e=class extends cni.OAuth2Client{serviceAccountEmail;scopes;constructor(e={}){super(e),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=e.serviceAccountEmail||"default",this.scopes=Array.isArray(e.scopes)?e.scopes:e.scopes?[e.scopes]:[]}async refreshTokenNoCache(){let e=`service-accounts/${this.serviceAccountEmail}/token`,n;try{let i={property:e};this.scopes.length>0&&(i.params={scopes:this.scopes.join(",")}),n=await rZt.instance(i)}catch(i){throw i instanceof ani.GaxiosError&&(i.message=`Could not refresh access token: ${i.message}`,this.wrapError(i)),i}let r=n;return n&&n.expires_in&&(r.expiry_date=new Date().getTime()+n.expires_in*1e3,delete r.expires_in),this.emit("tokens",r),{tokens:r,res:null}}async fetchIdToken(e){let n=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${e}`,r;try{let i={property:n};r=await rZt.instance(i)}catch(i){throw i instanceof Error&&(i.message=`Could not fetch ID token: ${i.message}`),i}return r}wrapError(e){let n=e.response;n&&n.status&&(e.status=n.status,n.status===403?e.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+e.message:n.status===404&&(e.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+e.message))}};k0e.Compute=l6e});var p6e=re(B0e=>{"use strict";p();Object.defineProperty(B0e,"__esModule",{value:!0});B0e.IdTokenClient=void 0;var lni=pN(),d6e=class extends lni.OAuth2Client{targetAudience;idTokenProvider;constructor(e){super(e),this.targetAudience=e.targetAudience,this.idTokenProvider=e.idTokenProvider}async getRequestMetadataAsync(){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let n=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:n,expiry_date:this.getIdTokenExpiryDate(n)}}return{headers:new Headers({authorization:"Bearer "+this.credentials.id_token})}}getIdTokenExpiryDate(e){let n=e.split(".")[1];if(n)return JSON.parse(Buffer.from(n,"base64").toString("ascii")).exp*1e3}};B0e.IdTokenClient=d6e});var m6e=re(x3=>{"use strict";p();Object.defineProperty(x3,"__esModule",{value:!0});x3.GCPEnv=void 0;x3.clear=uni;x3.getEnv=dni;var iZt=zX(),SI;(function(t){t.APP_ENGINE="APP_ENGINE",t.KUBERNETES_ENGINE="KUBERNETES_ENGINE",t.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",t.COMPUTE_ENGINE="COMPUTE_ENGINE",t.CLOUD_RUN="CLOUD_RUN",t.CLOUD_RUN_JOBS="CLOUD_RUN_JOBS",t.NONE="NONE"})(SI||(x3.GCPEnv=SI={}));var eZ;function uni(){eZ=void 0}async function dni(){return eZ||(eZ=pni(),eZ)}async function pni(){let t=SI.NONE;return mni()?t=SI.APP_ENGINE:hni()?t=SI.CLOUD_FUNCTIONS:await yni()?await Ani()?t=SI.KUBERNETES_ENGINE:fni()?t=SI.CLOUD_RUN:gni()?t=SI.CLOUD_RUN_JOBS:t=SI.COMPUTE_ENGINE:t=SI.NONE,t}function mni(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}function hni(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}function fni(){return!!process.env.K_CONFIGURATION}function gni(){return!!process.env.CLOUD_RUN_JOB}async function Ani(){try{return await iZt.instance("attributes/cluster-name"),!0}catch{return!1}}async function yni(){return iZt.isAvailable()}});var h6e=re((QUo,sZt)=>{p();var N0e=E3().Buffer,Eni=require("stream"),bni=require("util");function D0e(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=N0e.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=N0e.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}bni.inherits(D0e,Eni);D0e.prototype.write=function(e){this.buffer=N0e.concat([this.buffer,N0e.from(e)]),this.emit("data",e)};D0e.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};sZt.exports=D0e});var aZt=re((GUo,oZt)=>{"use strict";p();var tZ=require("buffer").Buffer,f6e=require("buffer").SlowBuffer;oZt.exports=P0e;function P0e(t,e){if(!tZ.isBuffer(t)||!tZ.isBuffer(e)||t.length!==e.length)return!1;for(var n=0,r=0;r{p();var C3=E3().Buffer,Y0=require("crypto"),lZt=V9e(),cZt=require("util"),Sni=`"%s" is not a valid algorithm. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,$K="secret must be a string or buffer",rq="key must be a string or a buffer",$Nr="key must be a string, a buffer or an object",j3e=typeof wE.createPublicKey=="function";j3e&&(rq+=" or a KeyObject",$K+="or a KeyObject");function TGt(t){if(!sq.isBuffer(t)&&typeof t!="string"&&(!j3e||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw D_(rq)}function vGt(t){if(!sq.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw D_($Nr)}function GNr(t){if(!sq.isBuffer(t)){if(typeof t=="string")return t;if(!j3e||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw D_($K)}}function Y3e(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function RGt(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var n=0;n{p();var XNr=require("buffer").Buffer;PGt.exports=function(e){return typeof e=="string"?e:typeof e=="number"||XNr.isBuffer(e)?e.toString():JSON.stringify(e)}});var UGt=ee((Lio,QGt)=>{p();var ZNr=ZW().Buffer,OGt=q3e(),eDr=K3e(),tDr=require("stream"),MGt=z3e(),J3e=require("util");function LGt(t,e){return ZNr.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function nDr(t,e,n){n=n||"utf8";var r=LGt(MGt(t),"binary"),s=LGt(MGt(e),n);return J3e.format("%s.%s",r,s)}function FGt(t){var e=t.header,n=t.payload,r=t.secret||t.privateKey,s=t.encoding,i=eDr(e.alg),o=nDr(e,n,s),a=i.sign(o,r);return J3e.format("%s.%s",o,a)}function Pme(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var n=new OGt(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=n,this.payload=new OGt(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}J3e.inherits(Pme,tDr);Pme.prototype.sign=function(){try{var e=FGt({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};Pme.sign=FGt;QGt.exports=Pme});var zGt=ee((Qio,KGt)=>{p();var GGt=ZW().Buffer,$Gt=q3e(),rDr=K3e(),sDr=require("stream"),WGt=z3e(),iDr=require("util"),oDr=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function aDr(t){return Object.prototype.toString.call(t)==="[object Object]"}function cDr(t){if(aDr(t))return t;try{return JSON.parse(t)}catch{return}}function qGt(t){var e=t.split(".",1)[0];return cDr(GGt.from(e,"base64").toString("binary"))}function lDr(t){return t.split(".",2).join(".")}function HGt(t){return t.split(".")[2]}function uDr(t,e){e=e||"utf8";var n=t.split(".")[1];return GGt.from(n,"base64").toString(e)}function VGt(t){return oDr.test(t)&&!!qGt(t)}function jGt(t,e,n){if(!e){var r=new Error("Missing algorithm parameter for jws.verify");throw r.code="MISSING_ALGORITHM",r}t=WGt(t);var s=HGt(t),i=lDr(t),o=rDr(e);return o.verify(i,s,n)}function YGt(t,e){if(e=e||{},t=WGt(t),!VGt(t))return null;var n=qGt(t);if(!n)return null;var r=uDr(t);return(n.typ==="JWT"||e.json)&&(r=JSON.parse(r,e.encoding)),{header:n,payload:r,signature:HGt(t)}}function iq(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var n=new $Gt(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=n,this.signature=new $Gt(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}iDr.inherits(iq,sDr);iq.prototype.verify=function(){try{var e=jGt(this.signature.buffer,this.algorithm,this.key.buffer),n=YGt(this.signature.buffer,this.encoding);return this.emit("done",e,n),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};iq.decode=YGt;iq.isValid=VGt;iq.verify=jGt;KGt.exports=iq});var X3e=ee(vk=>{p();var JGt=UGt(),Ome=zGt(),dDr=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];vk.ALGORITHMS=dDr;vk.sign=JGt.sign;vk.verify=Ome.verify;vk.decode=Ome.decode;vk.isValid=Ome.isValid;vk.createSign=function(e){return new JGt(e)};vk.createVerify=function(e){return new Ome(e)}});var ZGt=ee(Mme=>{"use strict";p();Object.defineProperty(Mme,"__esModule",{value:!0});Mme.buildPayloadForJwsSign=XGt;Mme.getJwsSign=fDr;var pDr=X3e(),hDr="RS256",mDr="https://oauth2.googleapis.com/token";function XGt(t){let e=Math.floor(new Date().getTime()/1e3);return{iss:t.iss,scope:t.scope,aud:mDr,exp:e+3600,iat:e,sub:t.sub,...t.additionalClaims}}function fDr(t){let e=XGt(t);return(0,pDr.sign)({header:{alg:hDr},payload:e,secret:t.key})}});var eWt=ee(Z3e=>{"use strict";p();Object.defineProperty(Z3e,"__esModule",{value:!0});Z3e.getToken=bDr;var gDr=ZGt(),ADr="https://oauth2.googleapis.com/token",yDr="urn:ietf:params:oauth:grant-type:jwt-bearer",EDr=t=>({method:"POST",url:ADr,data:new URLSearchParams({grant_type:yDr,assertion:(0,gDr.getJwsSign)(t)}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});async function bDr(t){if(!t.transporter)throw new Error("No transporter set.");try{let e=EDr(t);return(await t.transporter.request(e)).data}catch(e){let n=e,r=n.response?.data;throw r?.error&&(n.message=`${r.error}: ${r.error_description}`),n}}});var tWt=ee(Lme=>{"use strict";p();Object.defineProperty(Lme,"__esModule",{value:!0});Lme.ErrorWithCode=void 0;var eHe=class extends Error{code;constructor(e,n){super(e),this.code=n}};Lme.ErrorWithCode=eHe});var oHe=ee(iHe=>{"use strict";p();Object.defineProperty(iHe,"__esModule",{value:!0});iHe.getCredentials=CDr;var _Dr=require("path"),nWt=require("fs"),SDr=require("util"),Fme=tWt(),rWt=nWt.readFile?(0,SDr.promisify)(nWt.readFile):async()=>{throw new Fme.ErrorWithCode("use key rather than keyFile.","MISSING_CREDENTIALS")},Rk;(function(t){t.JSON=".json",t.DER=".der",t.CRT=".crt",t.PEM=".pem",t.P12=".p12",t.PFX=".pfx"})(Rk||(Rk={}));var tHe=class{keyFilePath;constructor(e){this.keyFilePath=e}async getCredentials(){let e=await rWt(this.keyFilePath,"utf8"),n;try{n=JSON.parse(e)}catch(i){let o=i;throw new Error(`Invalid JSON key file: ${o.message}`)}let r=n.private_key,s=n.client_email;if(!r||!s)throw new Fme.ErrorWithCode("private_key and client_email are required.","MISSING_CREDENTIALS");return{privateKey:r,clientEmail:s}}},nHe=class{keyFilePath;constructor(e){this.keyFilePath=e}async getCredentials(){return{privateKey:await rWt(this.keyFilePath,"utf8")}}},rHe=class{async getCredentials(){throw new Fme.ErrorWithCode("*.p12 certificates are not supported after v6.1.2. Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.","UNKNOWN_CERTIFICATE_TYPE")}},sHe=class{static create(e){switch(_Dr.extname(e)){case Rk.JSON:return new tHe(e);case Rk.DER:case Rk.CRT:case Rk.PEM:return new nHe(e);case Rk.P12:case Rk.PFX:return new rHe;default:throw new Fme.ErrorWithCode("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE")}}};async function CDr(t){return sHe.create(t).getCredentials()}});var sWt=ee(Qme=>{"use strict";p();Object.defineProperty(Qme,"__esModule",{value:!0});Qme.TokenHandler=void 0;var IDr=eWt(),xDr=oHe(),aHe=class{token;tokenExpiresAt;inFlightRequest;tokenOptions;constructor(e){this.tokenOptions=e}async processCredentials(){if(!this.tokenOptions.key&&!this.tokenOptions.keyFile)throw new Error("No key or keyFile set.");if(!this.tokenOptions.key&&this.tokenOptions.keyFile){let e=await(0,xDr.getCredentials)(this.tokenOptions.keyFile);this.tokenOptions.key=e.privateKey,this.tokenOptions.email=e.clientEmail}}isTokenExpiring(){if(!this.token||!this.tokenExpiresAt)return!0;let e=new Date().getTime(),n=this.tokenOptions.eagerRefreshThresholdMillis??0;return this.tokenExpiresAt<=e+n}hasExpired(){let e=new Date().getTime();return this.token&&this.tokenExpiresAt?new Date().getTime()>=this.tokenExpiresAt:!0}async getToken(e){if(await this.processCredentials(),this.inFlightRequest&&!e)return this.inFlightRequest;if(this.token&&!this.isTokenExpiring()&&!e)return this.token;try{this.inFlightRequest=(0,IDr.getToken)(this.tokenOptions);let n=await this.inFlightRequest;return this.token=n,this.tokenExpiresAt=new Date().getTime()+(n.expires_in??0)*1e3,n}finally{this.inFlightRequest=void 0}}};Qme.TokenHandler=aHe});var iWt=ee(cHe=>{"use strict";p();Object.defineProperty(cHe,"__esModule",{value:!0});cHe.revokeToken=vDr;var wDr="https://oauth2.googleapis.com/revoke?token=",TDr=!0;async function vDr(t,e){let n=wDr+t;return await e.request({url:n,retry:TDr})}});var uHe=ee(Ume=>{"use strict";p();Object.defineProperty(Ume,"__esModule",{value:!0});Ume.GoogleToken=void 0;var RDr=$p(),oWt=sWt(),kDr=iWt(),lHe=class{tokenOptions;tokenHandler;constructor(e){this.tokenOptions=e||{},this.tokenOptions.transporter=this.tokenOptions.transporter||{request:n=>(0,RDr.request)(n)},this.tokenOptions.iss||(this.tokenOptions.iss=this.tokenOptions.email),typeof this.tokenOptions.scope=="object"&&(this.tokenOptions.scope=this.tokenOptions.scope.join(" ")),this.tokenHandler=new oWt.TokenHandler(this.tokenOptions)}get expiresAt(){return this.tokenHandler.tokenExpiresAt}get accessToken(){return this.tokenHandler.token?.access_token}get idToken(){return this.tokenHandler.token?.id_token}get tokenType(){return this.tokenHandler.token?.token_type}get refreshToken(){return this.tokenHandler.token?.refresh_token}hasExpired(){return this.tokenHandler.hasExpired()}isTokenExpiring(){return this.tokenHandler.isTokenExpiring()}getToken(e,n={forceRefresh:!1}){let r;typeof e=="function"?r=e:typeof e=="object"&&(n=e);let s=this.tokenHandler.getToken(n.forceRefresh??!1);return r&&s.then(i=>r(null,i),r),s}revokeToken(e){if(!this.accessToken)return Promise.reject(new Error("No token to revoke."));let n=(0,kDr.revokeToken)(this.accessToken,this.tokenOptions.transporter);e&&n.then(()=>e(),e),this.tokenHandler=new oWt.TokenHandler(this.tokenOptions)}get googleTokenOptions(){return this.tokenOptions}};Ume.GoogleToken=lHe});var pHe=ee($me=>{"use strict";p();Object.defineProperty($me,"__esModule",{value:!0});$me.JWTAccess=void 0;var NDr=X3e(),DDr=R_(),aWt={alg:"RS256",typ:"JWT"},dHe=class t{email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new DDr.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,n,r,s){this.email=e,this.key=n,this.keyId=r,this.eagerRefreshThresholdMillis=s??300*1e3}getCachedKey(e,n){let r=e;if(n&&Array.isArray(n)&&n.length?r=e?`${e}_${n.join("_")}`:`${n.join("_")}`:typeof n=="string"&&(r=e?`${e}_${n}`:n),!r)throw Error("Scopes or url must be provided");return r}getRequestHeaders(e,n,r){let s=this.getCachedKey(e,r),i=this.cache.get(s),o=Date.now();if(i&&i.expiration-o>this.eagerRefreshThresholdMillis)return new Headers(i.headers);let a=Math.floor(Date.now()/1e3),c=t.getExpirationTime(a),u;if(Array.isArray(r)&&(r=r.join(" ")),r?u={iss:this.email,sub:this.email,scope:r,exp:c,iat:a}:u={iss:this.email,sub:this.email,aud:e,exp:c,iat:a},n){for(let f in u)if(n[f])throw new Error(`The '${f}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let l=this.keyId?{...aWt,kid:this.keyId}:aWt,d=Object.assign(u,n),h=NDr.sign({header:l,payload:d,secret:this.key}),m=new Headers({authorization:`Bearer ${h}`});return this.cache.set(s,{expiration:c*1e3,headers:m}),m}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,n){if(n)this.fromStreamAsync(e).then(()=>n(),n);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((n,r)=>{e||r(new Error("Must pass in a stream containing the service account auth settings."));let s="";e.setEncoding("utf8").on("data",i=>s+=i).on("error",r).on("end",()=>{try{let i=JSON.parse(s);this.fromJSON(i),n()}catch(i){r(i)}})})}};$me.JWTAccess=dHe});var mHe=ee(Wme=>{"use strict";p();Object.defineProperty(Wme,"__esModule",{value:!0});Wme.JWT=void 0;var cWt=uHe(),BDr=oHe(),PDr=pHe(),ODr=Tk(),Gme=CA(),hHe=class t extends ODr.OAuth2Client{email;keyFile;key;keyId;defaultScopes;scopes;scope;subject;gtoken;additionalClaims;useJWTAccessWithScope;defaultServicePath;access;constructor(e={}){super(e),this.email=e.email,this.keyFile=e.keyFile,this.key=e.key,this.keyId=e.keyId,this.scopes=e.scopes,this.subject=e.subject,this.additionalClaims=e.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(e){let n=new t(this);return n.scopes=e,n}async getRequestMetadataAsync(e){e=this.defaultServicePath?`https://${this.defaultServicePath}/`:e;let n=!this.hasUserScopes()&&e||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==Gme.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Gme.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Gme.DEFAULT_UNIVERSE}`);if(!this.apiKey&&n)if(this.additionalClaims&&this.additionalClaims.target_audience){let{tokens:r}=await this.refreshToken();return{headers:this.addSharedMetadataHeaders(new Headers({authorization:`Bearer ${r.id_token}`}))}}else{this.access||(this.access=new PDr.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let r;this.hasUserScopes()?r=this.scopes:e||(r=this.defaultScopes);let s=this.useJWTAccessWithScope||this.universeDomain!==Gme.DEFAULT_UNIVERSE,i=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,s?r:void 0);return{headers:this.addSharedMetadataHeaders(i)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let n=new cWt.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:e},transporter:this.transporter});if(await n.getToken({forceRefresh:!0}),!n.idToken)throw new Error("Unknown error: Failed to fetch ID token");return n.idToken}hasUserScopes(){return this.scopes?this.scopes.length>0:!1}hasAnyScopes(){return!!(this.scopes&&this.scopes.length>0||this.defaultScopes&&this.defaultScopes.length>0)}authorize(e){if(e)this.authorizeAsync().then(n=>e(null,n),e);else return this.authorizeAsync()}async authorizeAsync(){let e=await this.refreshToken();if(!e)throw new Error("No result returned");return this.credentials=e.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.googleTokenOptions?.key,this.email=this.gtoken.googleTokenOptions?.iss,e.tokens}async refreshTokenNoCache(){let e=this.createGToken(),r={access_token:(await e.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:e.expiresAt,id_token:e.idToken};return this.emit("tokens",r),{res:null,tokens:r}}createGToken(){return this.gtoken||(this.gtoken=new cWt.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,n){if(n)this.fromStreamAsync(e).then(()=>n(),n);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((n,r)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let s="";e.setEncoding("utf8").on("error",r).on("data",i=>s+=i).on("end",()=>{try{let i=JSON.parse(s);this.fromJSON(i),n()}catch(i){r(i)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let e=this.createGToken(),n=await(0,BDr.getCredentials)(this.keyFile);return{private_key:n.privateKey,client_email:n.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};Wme.JWT=hHe});var gHe=ee(oq=>{"use strict";p();Object.defineProperty(oq,"__esModule",{value:!0});oq.UserRefreshClient=oq.USER_REFRESH_ACCOUNT_TYPE=void 0;var MDr=Tk(),LDr=CA();oq.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var fHe=class t extends MDr.OAuth2Client{_refreshToken;constructor(e,n,r,s,i){let o=e&&typeof e=="object"?e:{clientId:e,clientSecret:n,refreshToken:r,eagerRefreshThresholdMillis:s,forceRefreshOnFailure:i};super(o),this._refreshToken=o.refreshToken,this.credentials.refresh_token=o.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let n={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e}),responseType:"json"};return LDr.AuthClient.setMethodName(n,"fetchIdToken"),(await this.transporter.request(n)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,n){if(n)this.fromStreamAsync(e).then(()=>n(),n);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((n,r)=>{if(!e)return r(new Error("Must pass in a stream containing the user refresh token."));let s="";e.setEncoding("utf8").on("error",r).on("data",i=>s+=i).on("end",()=>{try{let i=JSON.parse(s);return this.fromJSON(i),n()}catch(i){return r(i)}})})}static fromJSON(e){let n=new t;return n.fromJSON(e),n}};oq.UserRefreshClient=fHe});var yHe=ee(aq=>{"use strict";p();Object.defineProperty(aq,"__esModule",{value:!0});aq.Impersonated=aq.IMPERSONATED_ACCOUNT_TYPE=void 0;var lWt=Tk(),FDr=$p(),QDr=R_();aq.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var AHe=class t extends lWt.OAuth2Client{sourceClient;targetPrincipal;targetScopes;delegates;lifetime;endpoint;constructor(e={}){if(super(e),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=e.sourceClient??new lWt.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,QDr.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,r=`${this.endpoint}/v1/${n}:signBlob`,s={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:s,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,n=`${this.endpoint}/v1/${e}:generateAccessToken`,r={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},s=await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:r,method:"POST"}),i=s.data;return this.credentials.access_token=i.accessToken,this.credentials.expiry_date=Date.parse(i.expireTime),{tokens:this.credentials,res:s}}catch(e){if(!(e instanceof Error))throw e;let n=0,r="";throw e instanceof FDr.GaxiosError&&(n=e?.response?.data?.error?.status,r=e?.response?.data?.error?.message),n&&r?(e.message=`${n}: unable to impersonate: ${r}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,n){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,s=`${this.endpoint}/v1/${r}:generateIdToken`,i={delegates:this.delegates,audience:e,includeEmail:n?.includeEmail??!0,useEmailAzp:n?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:s,data:i,method:"POST"})).data.token}};aq.Impersonated=AHe});var bHe=ee(WK=>{"use strict";p();Object.defineProperty(WK,"__esModule",{value:!0});WK.OAuthClientAuthHandler=void 0;WK.getErrorFromOAuthErrorResponse=GDr;var cq=$p(),UDr=OK(),$Dr=["PUT","POST","PATCH"],EHe=class{#e=(0,UDr.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new cq.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new cq.Gaxios)}applyClientAuthenticationOptions(e,n){e.headers=cq.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,n),n||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,n){if(n)e.headers=cq.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${n}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=cq.Gaxios.mergeHeaders(e.headers);let r=this.#t.clientId,s=this.#t.clientSecret||"",i=this.#e.encodeBase64StringUtf8(`${r}:${s}`);cq.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${i}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let n=(e.method||"GET").toUpperCase();if(!$Dr.includes(n))throw new Error(`${n} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let s=new Headers(e.headers).get("content-type");if(s?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let i=new URLSearchParams(e.data??"");i.append("client_id",this.#t.clientId),i.append("client_secret",this.#t.clientSecret||""),e.data=i}else if(s?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${s} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};WK.OAuthClientAuthHandler=EHe;function GDr(t,e){let n=t.error,r=t.error_description,s=t.error_uri,i=`Error code ${n}`;typeof r<"u"&&(i+=`: ${r}`),typeof s<"u"&&(i+=` - ${s}`);let o=new Error(i);if(e){let a=Object.keys(e);e.stack&&a.push("stack"),a.forEach(c=>{c!=="message"&&Object.defineProperty(o,c,{value:e[c],writable:!1,enumerable:!0})})}return o}});var Hme=ee(qme=>{"use strict";p();Object.defineProperty(qme,"__esModule",{value:!0});qme.StsCredentials=void 0;var WDr=$p(),qDr=CA(),uWt=bHe(),HDr=R_(),_He=class t extends uWt.OAuthClientAuthHandler{#e;constructor(e={tokenExchangeEndpoint:""},n){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:n}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,n,r){let s={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:r&&JSON.stringify(r)},i={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:n,data:new URLSearchParams((0,HDr.removeUndefinedValuesInObject)(s)),responseType:"json"};qDr.AuthClient.setMethodName(i,"exchangeToken"),this.applyClientAuthenticationOptions(i);try{let o=await this.transporter.request(i),a=o.data;return a.res=o,a}catch(o){throw o instanceof WDr.GaxiosError&&o.response?(0,uWt.getErrorFromOAuthErrorResponse)(o.response.data,o):o}}};qme.StsCredentials=_He});var kk=ee(TE=>{"use strict";p();Object.defineProperty(TE,"__esModule",{value:!0});TE.BaseExternalAccountClient=TE.CLOUD_RESOURCE_MANAGER=TE.EXTERNAL_ACCOUNT_TYPE=TE.EXPIRATION_TIME_OFFSET=void 0;var VDr=$p(),jDr=require("stream"),SHe=CA(),YDr=Hme(),dWt=R_(),KDr=N3e(),zDr="urn:ietf:params:oauth:grant-type:token-exchange",JDr="urn:ietf:params:oauth:token-type:access_token",CHe="https://www.googleapis.com/auth/cloud-platform",XDr=3600;TE.EXPIRATION_TIME_OFFSET=300*1e3;TE.EXTERNAL_ACCOUNT_TYPE="external_account";TE.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var ZDr="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",e1r="https://sts.{universeDomain}/v1/token",IHe=class t extends SHe.AuthClient{scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#e=null;constructor(e){super(e);let n=(0,dWt.originalOrCamelOptions)(e),r=n.get("type");if(r&&r!==TE.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${TE.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let s=n.get("client_id"),i=n.get("client_secret");this.tokenUrl=n.get("token_url")??e1r.replace("{universeDomain}",this.universeDomain);let o=n.get("subject_token_type"),a=n.get("workforce_pool_user_project"),c=n.get("service_account_impersonation_url"),u=n.get("service_account_impersonation"),l=(0,dWt.originalOrCamelOptions)(u).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(n.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),s&&(this.clientAuth={confidentialClientType:"basic",clientId:s,clientSecret:i}),this.stsCredential=new YDr.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=n.get("scopes")||[CHe],this.cachedAccessToken=null,this.audience=n.get("audience"),this.subjectTokenType=o,this.workforcePoolUserProject=a;let d=new RegExp(ZDr);if(this.workforcePoolUserProject&&!this.audience.match(d))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=c,this.serviceAccountImpersonationLifetime=l,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=XDr),this.projectNumber=this.getProjectNumber(this.audience),this.supplierContext={audience:this.audience,subjectTokenType:this.subjectTokenType,transporter:this.transporter}}getServiceAccountEmail(){if(this.serviceAccountImpersonationUrl){if(this.serviceAccountImpersonationUrl.length>256)throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);return/serviceAccounts\/(?[^:]+):generateAccessToken$/.exec(this.serviceAccountImpersonationUrl)?.groups?.email||null}return null}setCredentials(e){super.setCredentials(e),this.cachedAccessToken=e}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),n=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(n)}request(e,n){if(n)this.requestAsync(e).then(r=>n(null,r),r=>n(r,r.response));else return this.requestAsync(e)}async getProjectId(){let e=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(e){let n=await this.getRequestHeaders(),r={...t.RETRY_CONFIG,headers:n,url:`${this.cloudResourceManagerURL.toString()}${e}`,responseType:"json"};SHe.AuthClient.setMethodName(r,"getProjectId");let s=await this.transporter.request(r);return this.projectId=s.data.projectId,this.projectId}return null}async requestAsync(e,n=!1){let r;try{let s=await this.getRequestHeaders();e.headers=VDr.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,s),r=await this.transporter.request(e)}catch(s){let i=s.response;if(i){let o=i.status,a=i.config.data instanceof jDr.Readable;if(!n&&(o===401||o===403)&&!a&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw s}return r}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),n={grantType:zDr,audience:this.audience,requestedTokenType:JDr,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[CHe]:this.getScopesArray()},r=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,s=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),i=await this.stsCredential.exchangeToken(n,s,r);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(i.access_token):i.expires_in?this.cachedAccessToken={access_token:i.access_token,expiry_date:new Date().getTime()+i.expires_in*1e3,res:i.res}:this.cachedAccessToken={access_token:i.access_token,res:i.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let n=e.match(/\/projects\/([^/]+)/);return n?n[1]:null}async getImpersonatedAccessToken(e){let n={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"},responseType:"json"};SHe.AuthClient.setMethodName(n,"getImpersonatedAccessToken");let r=await this.transporter.request(n),s=r.data;return{access_token:s.accessToken,expiry_date:new Date(s.expireTime).getTime(),res:r}}isExpired(e){let n=new Date().getTime();return e.expiry_date?n>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[CHe]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),n=this.serviceAccountImpersonationUrl!==void 0,r=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${KDr.pkg.version} google-byoid-sdk source/${r} sa-impersonation/${n} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};TE.BaseExternalAccountClient=IHe});var pWt=ee(Vme=>{"use strict";p();Object.defineProperty(Vme,"__esModule",{value:!0});Vme.FileSubjectTokenSupplier=void 0;var wHe=require("util"),THe=require("fs"),t1r=(0,wHe.promisify)(THe.readFile??(()=>{})),n1r=(0,wHe.promisify)(THe.realpath??(()=>{})),r1r=(0,wHe.promisify)(THe.lstat??(()=>{})),xHe=class{filePath;formatType;subjectTokenFieldName;constructor(e){this.filePath=e.filePath,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName}async getSubjectToken(){let e=this.filePath;try{if(e=await n1r(e),!(await r1r(e)).isFile())throw new Error}catch(s){throw s instanceof Error&&(s.message=`The file at ${e} does not exist, or it is not a file. ${s.message}`),s}let n,r=await t1r(e,{encoding:"utf8"});if(this.formatType==="text"?n=r:this.formatType==="json"&&this.subjectTokenFieldName&&(n=JSON.parse(r)[this.subjectTokenFieldName]),!n)throw new Error("Unable to parse the subject_token from the credential_source file");return n}};Vme.FileSubjectTokenSupplier=xHe});var hWt=ee(jme=>{"use strict";p();Object.defineProperty(jme,"__esModule",{value:!0});jme.UrlSubjectTokenSupplier=void 0;var s1r=CA(),vHe=class{url;headers;formatType;subjectTokenFieldName;additionalGaxiosOptions;constructor(e){this.url=e.url,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName,this.headers=e.headers,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getSubjectToken(e){let n={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers,responseType:this.formatType};s1r.AuthClient.setMethodName(n,"getSubjectToken");let r;if(this.formatType==="text"?r=(await e.transporter.request(n)).data:this.formatType==="json"&&this.subjectTokenFieldName&&(r=(await e.transporter.request(n)).data[this.subjectTokenFieldName]),!r)throw new Error("Unable to parse the subject_token from the credential_source URL");return r}};jme.UrlSubjectTokenSupplier=vHe});var mWt=ee(IA=>{"use strict";p();Object.defineProperty(IA,"__esModule",{value:!0});IA.CertificateSubjectTokenSupplier=IA.InvalidConfigurationError=IA.CertificateSourceUnavailableError=IA.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var Yme=R_(),Kme=require("fs"),zme=require("crypto"),i1r=require("https");IA.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var IC=class extends Error{constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};IA.CertificateSourceUnavailableError=IC;var vE=class extends Error{constructor(e){super(e),this.name="InvalidConfigurationError"}};IA.InvalidConfigurationError=vE;var RHe=class{certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new vE("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new vE("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new vE("Cannot create mTLS Agent with missing certificate or key");return new i1r.Agent({key:this.key,cert:this.cert})}async getSubjectToken(){this.certificateConfigPath=await this.#e();let{certPath:e,keyPath:n}=await this.#t();return{cert:this.cert,key:this.key}=await this.#n(e,n),await this.#r(this.cert)}async#e(){let e=this.certificateConfigPath;if(e){if(await(0,Yme.isValidFile)(e))return e;throw new IC(`Provided certificate config path is invalid: ${e}`)}let n=process.env[IA.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(n){if(await(0,Yme.isValidFile)(n))return n;throw new IC(`Path from environment variable "${IA.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${n}`)}let r=(0,Yme.getWellKnownCertificateConfigFileLocation)();if(await(0,Yme.isValidFile)(r))return r;throw new IC(`Could not find certificate configuration file. Searched override path, the "${IA.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${r}).`)}async#t(){let e=this.certificateConfigPath,n;try{n=await Kme.promises.readFile(e,"utf8")}catch{throw new IC(`Failed to read certificate config file at: ${e}`)}try{let r=JSON.parse(n),s=r?.cert_configs?.workload?.cert_path,i=r?.cert_configs?.workload?.key_path;if(!s||!i)throw new vE(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:s,keyPath:i}}catch(r){throw r instanceof vE?r:new vE(`Failed to parse certificate config from ${e}: ${r.message}`)}}async#n(e,n){let r,s;try{r=await Kme.promises.readFile(e),new zme.X509Certificate(r)}catch(i){let o=i instanceof Error?i.message:String(i);throw new IC(`Failed to read certificate file at ${e}: ${o}`)}try{s=await Kme.promises.readFile(n),(0,zme.createPrivateKey)(s)}catch(i){let o=i instanceof Error?i.message:String(i);throw new IC(`Failed to read private key file at ${n}: ${o}`)}return{cert:r,key:s}}async#r(e){let n=new zme.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([n.raw.toString("base64")]);try{let i=((await Kme.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((c,u)=>{try{return new zme.X509Certificate(c)}catch(l){let d=l instanceof Error?l.message:String(l);throw new vE(`Failed to parse certificate at index ${u} in trust chain file ${this.trustChainPath}: ${d}`)}}),o=i.findIndex(c=>n.raw.equals(c.raw)),a;if(o===-1)a=[n,...i];else if(o===0)a=i;else throw new vE(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${o}).`);return JSON.stringify(a.map(c=>c.raw.toString("base64")))}catch(r){if(r instanceof vE)throw r;let s=r instanceof Error?r.message:String(r);throw new IC(`Failed to process certificate chain from ${this.trustChainPath}: ${s}`)}}};IA.CertificateSubjectTokenSupplier=RHe});var DHe=ee(Jme=>{"use strict";p();Object.defineProperty(Jme,"__esModule",{value:!0});Jme.IdentityPoolClient=void 0;var o1r=kk(),kHe=R_(),a1r=pWt(),c1r=hWt(),fWt=mWt(),l1r=Hme(),gWt=$p(),NHe=class t extends o1r.BaseExternalAccountClient{subjectTokenSupplier;constructor(e){super(e);let n=(0,kHe.originalOrCamelOptions)(e),r=n.get("credential_source"),s=n.get("subject_token_supplier");if(!r&&!s)throw new Error("A credential source or subject token supplier must be specified.");if(r&&s)throw new Error("Only one of credential source or subject token supplier can be specified.");if(s)this.subjectTokenSupplier=s,this.credentialSourceType="programmatic";else{let i=(0,kHe.originalOrCamelOptions)(r),o=(0,kHe.originalOrCamelOptions)(i.get("format")),a=o.get("type")||"text",c=o.get("subject_token_field_name");if(a!=="json"&&a!=="text")throw new Error(`Invalid credential_source format "${a}"`);if(a==="json"&&!c)throw new Error("Missing subject_token_field_name for JSON credential_source format");let u=i.get("file"),l=i.get("url"),d=i.get("certificate"),h=i.get("headers");if(u&&l||l&&d||u&&d)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(u)this.credentialSourceType="file",this.subjectTokenSupplier=new a1r.FileSubjectTokenSupplier({filePath:u,formatType:a,subjectTokenFieldName:c});else if(l)this.credentialSourceType="url",this.subjectTokenSupplier=new c1r.UrlSubjectTokenSupplier({url:l,formatType:a,subjectTokenFieldName:c,headers:h,additionalGaxiosOptions:t.RETRY_CONFIG});else if(d){this.credentialSourceType="certificate";let m=new fWt.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:d.use_default_certificate_config,certificateConfigLocation:d.certificate_config_location,trustChainPath:d.trust_chain_path});this.subjectTokenSupplier=m}else throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.')}}async retrieveSubjectToken(){let e=await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);if(this.subjectTokenSupplier instanceof fWt.CertificateSubjectTokenSupplier){let n=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new l1r.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new gWt.Gaxios({agent:n})}),this.transporter=new gWt.Gaxios({...this.transporter.defaults||{},agent:n})}return e}};Jme.IdentityPoolClient=NHe});var PHe=ee(Zme=>{"use strict";p();Object.defineProperty(Zme,"__esModule",{value:!0});Zme.AwsRequestSigner=void 0;var Xme=$p(),yWt=OK(),AWt="AWS4-HMAC-SHA256",u1r="aws4_request",BHe=class{getCredentials;region;crypto;constructor(e,n){this.getCredentials=e,this.region=n,this.crypto=(0,yWt.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let n=typeof e.data=="object"?JSON.stringify(e.data):e.data,r=e.url,s=e.method||"GET",i=e.body||n,o=e.headers,a=await this.getCredentials(),c=new URL(r);if(typeof i!="string"&&i!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${i}`);let u=await p1r({crypto:this.crypto,host:c.host,canonicalUri:c.pathname,canonicalQuerystring:c.search.slice(1),method:s,region:this.region,securityCredentials:a,requestPayload:i,additionalAmzHeaders:o}),l=Xme.Gaxios.mergeHeaders(u.amzDate?{"x-amz-date":u.amzDate}:{},{authorization:u.authorizationHeader,host:c.host},o||{});a.token&&Xme.Gaxios.mergeHeaders(l,{"x-amz-security-token":a.token});let d={url:r,method:s,headers:l};return i!==void 0&&(d.body=i),d}};Zme.AwsRequestSigner=BHe;async function qK(t,e,n){return await t.signWithHmacSha256(e,n)}async function d1r(t,e,n,r,s){let i=await qK(t,`AWS4${e}`,n),o=await qK(t,i,r),a=await qK(t,o,s);return await qK(t,a,"aws4_request")}async function p1r(t){let e=Xme.Gaxios.mergeHeaders(t.additionalAmzHeaders),n=t.requestPayload||"",r=t.host.split(".")[0],s=new Date,i=s.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),o=s.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let a=Xme.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":i},e),c="",u=[...a.keys()].sort();u.forEach(b=>{c+=`${b}:${a.get(b)} -`});let l=u.join(";"),d=await t.crypto.sha256DigestHex(n),h=`${t.method.toUpperCase()} + "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,nZ="secret must be a string or buffer",S3="key must be a string or a buffer",Cni="key must be a string, a buffer or an object",A6e=typeof Y0.createPublicKey=="function";A6e&&(S3+=" or a KeyObject",nZ+="or a KeyObject");function uZt(t){if(!C3.isBuffer(t)&&typeof t!="string"&&(!A6e||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Ix(S3)}function dZt(t){if(!C3.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Ix(Cni)}function Ini(t){if(!C3.isBuffer(t)){if(typeof t=="string")return t;if(!A6e||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Ix(nZ)}}function y6e(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function pZt(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var n=0;n{p();var Mni=require("buffer").Buffer;AZt.exports=function(e){return typeof e=="string"?e:typeof e=="number"||Mni.isBuffer(e)?e.toString():JSON.stringify(e)}});var SZt=re((VUo,xZt)=>{p();var Oni=E3().Buffer,yZt=h6e(),Lni=E6e(),Fni=require("stream"),EZt=b6e(),_6e=require("util");function bZt(t,e){return Oni.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Qni(t,e,n){n=n||"utf8";var r=bZt(EZt(t),"binary"),i=bZt(EZt(e),n);return _6e.format("%s.%s",r,i)}function _Zt(t){var e=t.header,n=t.payload,r=t.secret||t.privateKey,i=t.encoding,s=Lni(e.alg),o=Qni(e,n,i),a=s.sign(o,r);return _6e.format("%s.%s",o,a)}function M0e(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var n=new yZt(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=n,this.payload=new yZt(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}_6e.inherits(M0e,Fni);M0e.prototype.sign=function(){try{var e=_Zt({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};M0e.sign=_Zt;xZt.exports=M0e});var DZt=re((zUo,NZt)=>{p();var IZt=E3().Buffer,CZt=h6e(),Uni=E6e(),Gni=require("stream"),wZt=b6e(),$ni=require("util"),Wni=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Hni(t){return Object.prototype.toString.call(t)==="[object Object]"}function qni(t){if(Hni(t))return t;try{return JSON.parse(t)}catch{return}}function TZt(t){var e=t.split(".",1)[0];return qni(IZt.from(e,"base64").toString("binary"))}function jni(t){return t.split(".",2).join(".")}function vZt(t){return t.split(".")[2]}function Vni(t,e){e=e||"utf8";var n=t.split(".")[1];return IZt.from(n,"base64").toString(e)}function RZt(t){return Wni.test(t)&&!!TZt(t)}function kZt(t,e,n){if(!e){var r=new Error("Missing algorithm parameter for jws.verify");throw r.code="MISSING_ALGORITHM",r}t=wZt(t);var i=vZt(t),s=jni(t),o=Uni(e);return o.verify(s,i,n)}function BZt(t,e){if(e=e||{},t=wZt(t),!RZt(t))return null;var n=TZt(t);if(!n)return null;var r=Vni(t);return(n.typ==="JWT"||e.json)&&(r=JSON.parse(r,e.encoding)),{header:n,payload:r,signature:vZt(t)}}function I3(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var n=new CZt(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=n,this.signature=new CZt(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}$ni.inherits(I3,Gni);I3.prototype.verify=function(){try{var e=kZt(this.signature.buffer,this.algorithm,this.key.buffer),n=BZt(this.signature.buffer,this.encoding);return this.emit("done",e,n),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};I3.decode=BZt;I3.isValid=RZt;I3.verify=kZt;NZt.exports=I3});var x6e=re(mN=>{p();var PZt=SZt(),O0e=DZt(),Yni=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];mN.ALGORITHMS=Yni;mN.sign=PZt.sign;mN.verify=O0e.verify;mN.decode=O0e.decode;mN.isValid=O0e.isValid;mN.createSign=function(e){return new PZt(e)};mN.createVerify=function(e){return new O0e(e)}});var OZt=re(L0e=>{"use strict";p();Object.defineProperty(L0e,"__esModule",{value:!0});L0e.buildPayloadForJwsSign=MZt;L0e.getJwsSign=Xni;var zni=x6e(),Kni="RS256",Jni="https://oauth2.googleapis.com/token";function MZt(t){let e=Math.floor(new Date().getTime()/1e3);return{iss:t.iss,scope:t.scope,aud:Jni,exp:e+3600,iat:e,sub:t.sub,...t.additionalClaims}}function Xni(t){let e=MZt(t);return(0,zni.sign)({header:{alg:Kni},payload:e,secret:t.key})}});var LZt=re(S6e=>{"use strict";p();Object.defineProperty(S6e,"__esModule",{value:!0});S6e.getToken=rri;var Zni=OZt(),eri="https://oauth2.googleapis.com/token",tri="urn:ietf:params:oauth:grant-type:jwt-bearer",nri=t=>({method:"POST",url:eri,data:new URLSearchParams({grant_type:tri,assertion:(0,Zni.getJwsSign)(t)}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});async function rri(t){if(!t.transporter)throw new Error("No transporter set.");try{let e=nri(t);return(await t.transporter.request(e)).data}catch(e){let n=e,r=n.response?.data;throw r?.error&&(n.message=`${r.error}: ${r.error_description}`),n}}});var FZt=re(F0e=>{"use strict";p();Object.defineProperty(F0e,"__esModule",{value:!0});F0e.ErrorWithCode=void 0;var C6e=class extends Error{code;constructor(e,n){super(e),this.code=n}};F0e.ErrorWithCode=C6e});var k6e=re(R6e=>{"use strict";p();Object.defineProperty(R6e,"__esModule",{value:!0});R6e.getCredentials=ori;var iri=require("path"),QZt=require("fs"),sri=require("util"),Q0e=FZt(),UZt=QZt.readFile?(0,sri.promisify)(QZt.readFile):async()=>{throw new Q0e.ErrorWithCode("use key rather than keyFile.","MISSING_CREDENTIALS")},hN;(function(t){t.JSON=".json",t.DER=".der",t.CRT=".crt",t.PEM=".pem",t.P12=".p12",t.PFX=".pfx"})(hN||(hN={}));var I6e=class{keyFilePath;constructor(e){this.keyFilePath=e}async getCredentials(){let e=await UZt(this.keyFilePath,"utf8"),n;try{n=JSON.parse(e)}catch(s){let o=s;throw new Error(`Invalid JSON key file: ${o.message}`)}let r=n.private_key,i=n.client_email;if(!r||!i)throw new Q0e.ErrorWithCode("private_key and client_email are required.","MISSING_CREDENTIALS");return{privateKey:r,clientEmail:i}}},w6e=class{keyFilePath;constructor(e){this.keyFilePath=e}async getCredentials(){return{privateKey:await UZt(this.keyFilePath,"utf8")}}},T6e=class{async getCredentials(){throw new Q0e.ErrorWithCode("*.p12 certificates are not supported after v6.1.2. Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.","UNKNOWN_CERTIFICATE_TYPE")}},v6e=class{static create(e){switch(iri.extname(e)){case hN.JSON:return new I6e(e);case hN.DER:case hN.CRT:case hN.PEM:return new w6e(e);case hN.P12:case hN.PFX:return new T6e;default:throw new Q0e.ErrorWithCode("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE")}}};async function ori(t){return v6e.create(t).getCredentials()}});var GZt=re(U0e=>{"use strict";p();Object.defineProperty(U0e,"__esModule",{value:!0});U0e.TokenHandler=void 0;var ari=LZt(),cri=k6e(),B6e=class{token;tokenExpiresAt;inFlightRequest;tokenOptions;constructor(e){this.tokenOptions=e}async processCredentials(){if(!this.tokenOptions.key&&!this.tokenOptions.keyFile)throw new Error("No key or keyFile set.");if(!this.tokenOptions.key&&this.tokenOptions.keyFile){let e=await(0,cri.getCredentials)(this.tokenOptions.keyFile);this.tokenOptions.key=e.privateKey,this.tokenOptions.email=e.clientEmail}}isTokenExpiring(){if(!this.token||!this.tokenExpiresAt)return!0;let e=new Date().getTime(),n=this.tokenOptions.eagerRefreshThresholdMillis??0;return this.tokenExpiresAt<=e+n}hasExpired(){let e=new Date().getTime();return this.token&&this.tokenExpiresAt?new Date().getTime()>=this.tokenExpiresAt:!0}async getToken(e){if(await this.processCredentials(),this.inFlightRequest&&!e)return this.inFlightRequest;if(this.token&&!this.isTokenExpiring()&&!e)return this.token;try{this.inFlightRequest=(0,ari.getToken)(this.tokenOptions);let n=await this.inFlightRequest;return this.token=n,this.tokenExpiresAt=new Date().getTime()+(n.expires_in??0)*1e3,n}finally{this.inFlightRequest=void 0}}};U0e.TokenHandler=B6e});var $Zt=re(N6e=>{"use strict";p();Object.defineProperty(N6e,"__esModule",{value:!0});N6e.revokeToken=dri;var lri="https://oauth2.googleapis.com/revoke?token=",uri=!0;async function dri(t,e){let n=lri+t;return await e.request({url:n,retry:uri})}});var P6e=re(G0e=>{"use strict";p();Object.defineProperty(G0e,"__esModule",{value:!0});G0e.GoogleToken=void 0;var pri=Um(),WZt=GZt(),mri=$Zt(),D6e=class{tokenOptions;tokenHandler;constructor(e){this.tokenOptions=e||{},this.tokenOptions.transporter=this.tokenOptions.transporter||{request:n=>(0,pri.request)(n)},this.tokenOptions.iss||(this.tokenOptions.iss=this.tokenOptions.email),typeof this.tokenOptions.scope=="object"&&(this.tokenOptions.scope=this.tokenOptions.scope.join(" ")),this.tokenHandler=new WZt.TokenHandler(this.tokenOptions)}get expiresAt(){return this.tokenHandler.tokenExpiresAt}get accessToken(){return this.tokenHandler.token?.access_token}get idToken(){return this.tokenHandler.token?.id_token}get tokenType(){return this.tokenHandler.token?.token_type}get refreshToken(){return this.tokenHandler.token?.refresh_token}hasExpired(){return this.tokenHandler.hasExpired()}isTokenExpiring(){return this.tokenHandler.isTokenExpiring()}getToken(e,n={forceRefresh:!1}){let r;typeof e=="function"?r=e:typeof e=="object"&&(n=e);let i=this.tokenHandler.getToken(n.forceRefresh??!1);return r&&i.then(s=>r(null,s),r),i}revokeToken(e){if(!this.accessToken)return Promise.reject(new Error("No token to revoke."));let n=(0,mri.revokeToken)(this.accessToken,this.tokenOptions.transporter);e&&n.then(()=>e(),e),this.tokenHandler=new WZt.TokenHandler(this.tokenOptions)}get googleTokenOptions(){return this.tokenOptions}};G0e.GoogleToken=D6e});var O6e=re($0e=>{"use strict";p();Object.defineProperty($0e,"__esModule",{value:!0});$0e.JWTAccess=void 0;var hri=x6e(),fri=xx(),HZt={alg:"RS256",typ:"JWT"},M6e=class t{email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new fri.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,n,r,i){this.email=e,this.key=n,this.keyId=r,this.eagerRefreshThresholdMillis=i??300*1e3}getCachedKey(e,n){let r=e;if(n&&Array.isArray(n)&&n.length?r=e?`${e}_${n.join("_")}`:`${n.join("_")}`:typeof n=="string"&&(r=e?`${e}_${n}`:n),!r)throw Error("Scopes or url must be provided");return r}getRequestHeaders(e,n,r){let i=this.getCachedKey(e,r),s=this.cache.get(i),o=Date.now();if(s&&s.expiration-o>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let a=Math.floor(Date.now()/1e3),c=t.getExpirationTime(a),u;if(Array.isArray(r)&&(r=r.join(" ")),r?u={iss:this.email,sub:this.email,scope:r,exp:c,iat:a}:u={iss:this.email,sub:this.email,aud:e,exp:c,iat:a},n){for(let f in u)if(n[f])throw new Error(`The '${f}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let l=this.keyId?{...HZt,kid:this.keyId}:HZt,d=Object.assign(u,n),m=hri.sign({header:l,payload:d,secret:this.key}),h=new Headers({authorization:`Bearer ${m}`});return this.cache.set(i,{expiration:c*1e3,headers:h}),h}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,n){if(n)this.fromStreamAsync(e).then(()=>n(),n);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((n,r)=>{e||r(new Error("Must pass in a stream containing the service account auth settings."));let i="";e.setEncoding("utf8").on("data",s=>i+=s).on("error",r).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),n()}catch(s){r(s)}})})}};$0e.JWTAccess=M6e});var F6e=re(H0e=>{"use strict";p();Object.defineProperty(H0e,"__esModule",{value:!0});H0e.JWT=void 0;var qZt=P6e(),gri=k6e(),Ari=O6e(),yri=pN(),W0e=Hy(),L6e=class t extends yri.OAuth2Client{email;keyFile;key;keyId;defaultScopes;scopes;scope;subject;gtoken;additionalClaims;useJWTAccessWithScope;defaultServicePath;access;constructor(e={}){super(e),this.email=e.email,this.keyFile=e.keyFile,this.key=e.key,this.keyId=e.keyId,this.scopes=e.scopes,this.subject=e.subject,this.additionalClaims=e.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(e){let n=new t(this);return n.scopes=e,n}async getRequestMetadataAsync(e){e=this.defaultServicePath?`https://${this.defaultServicePath}/`:e;let n=!this.hasUserScopes()&&e||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==W0e.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==W0e.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${W0e.DEFAULT_UNIVERSE}`);if(!this.apiKey&&n)if(this.additionalClaims&&this.additionalClaims.target_audience){let{tokens:r}=await this.refreshToken();return{headers:this.addSharedMetadataHeaders(new Headers({authorization:`Bearer ${r.id_token}`}))}}else{this.access||(this.access=new Ari.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let r;this.hasUserScopes()?r=this.scopes:e||(r=this.defaultScopes);let i=this.useJWTAccessWithScope||this.universeDomain!==W0e.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?r:void 0);return{headers:this.addSharedMetadataHeaders(s)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let n=new qZt.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:e},transporter:this.transporter});if(await n.getToken({forceRefresh:!0}),!n.idToken)throw new Error("Unknown error: Failed to fetch ID token");return n.idToken}hasUserScopes(){return this.scopes?this.scopes.length>0:!1}hasAnyScopes(){return!!(this.scopes&&this.scopes.length>0||this.defaultScopes&&this.defaultScopes.length>0)}authorize(e){if(e)this.authorizeAsync().then(n=>e(null,n),e);else return this.authorizeAsync()}async authorizeAsync(){let e=await this.refreshToken();if(!e)throw new Error("No result returned");return this.credentials=e.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.googleTokenOptions?.key,this.email=this.gtoken.googleTokenOptions?.iss,e.tokens}async refreshTokenNoCache(){let e=this.createGToken(),r={access_token:(await e.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:e.expiresAt,id_token:e.idToken};return this.emit("tokens",r),{res:null,tokens:r}}createGToken(){return this.gtoken||(this.gtoken=new qZt.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,n){if(n)this.fromStreamAsync(e).then(()=>n(),n);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((n,r)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let i="";e.setEncoding("utf8").on("error",r).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),n()}catch(s){r(s)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let e=this.createGToken(),n=await(0,gri.getCredentials)(this.keyFile);return{private_key:n.privateKey,client_email:n.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};H0e.JWT=L6e});var U6e=re(w3=>{"use strict";p();Object.defineProperty(w3,"__esModule",{value:!0});w3.UserRefreshClient=w3.USER_REFRESH_ACCOUNT_TYPE=void 0;var Eri=pN(),bri=Hy();w3.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Q6e=class t extends Eri.OAuth2Client{_refreshToken;constructor(e,n,r,i,s){let o=e&&typeof e=="object"?e:{clientId:e,clientSecret:n,refreshToken:r,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:s};super(o),this._refreshToken=o.refreshToken,this.credentials.refresh_token=o.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let n={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e}),responseType:"json"};return bri.AuthClient.setMethodName(n,"fetchIdToken"),(await this.transporter.request(n)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,n){if(n)this.fromStreamAsync(e).then(()=>n(),n);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((n,r)=>{if(!e)return r(new Error("Must pass in a stream containing the user refresh token."));let i="";e.setEncoding("utf8").on("error",r).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);return this.fromJSON(s),n()}catch(s){return r(s)}})})}static fromJSON(e){let n=new t;return n.fromJSON(e),n}};w3.UserRefreshClient=Q6e});var $6e=re(T3=>{"use strict";p();Object.defineProperty(T3,"__esModule",{value:!0});T3.Impersonated=T3.IMPERSONATED_ACCOUNT_TYPE=void 0;var jZt=pN(),_ri=Um(),xri=xx();T3.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var G6e=class t extends jZt.OAuth2Client{sourceClient;targetPrincipal;targetScopes;delegates;lifetime;endpoint;constructor(e={}){if(super(e),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=e.sourceClient??new jZt.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,xri.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,r=`${this.endpoint}/v1/${n}:signBlob`,i={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:i,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,n=`${this.endpoint}/v1/${e}:generateAccessToken`,r={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},i=await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:r,method:"POST"}),s=i.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let n=0,r="";throw e instanceof _ri.GaxiosError&&(n=e?.response?.data?.error?.status,r=e?.response?.data?.error?.message),n&&r?(e.message=`${n}: unable to impersonate: ${r}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,n){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,i=`${this.endpoint}/v1/${r}:generateIdToken`,s={delegates:this.delegates,audience:e,includeEmail:n?.includeEmail??!0,useEmailAzp:n?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:s,method:"POST"})).data.token}};T3.Impersonated=G6e});var H6e=re(iZ=>{"use strict";p();Object.defineProperty(iZ,"__esModule",{value:!0});iZ.OAuthClientAuthHandler=void 0;iZ.getErrorFromOAuthErrorResponse=Iri;var v3=Um(),Sri=KX(),Cri=["PUT","POST","PATCH"],W6e=class{#e=(0,Sri.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new v3.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new v3.Gaxios)}applyClientAuthenticationOptions(e,n){e.headers=v3.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,n),n||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,n){if(n)e.headers=v3.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${n}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=v3.Gaxios.mergeHeaders(e.headers);let r=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${r}:${i}`);v3.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let n=(e.method||"GET").toUpperCase();if(!Cri.includes(n))throw new Error(`${n} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let i=new Headers(e.headers).get("content-type");if(i?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let s=new URLSearchParams(e.data??"");s.append("client_id",this.#t.clientId),s.append("client_secret",this.#t.clientSecret||""),e.data=s}else if(i?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${i} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};iZ.OAuthClientAuthHandler=W6e;function Iri(t,e){let n=t.error,r=t.error_description,i=t.error_uri,s=`Error code ${n}`;typeof r<"u"&&(s+=`: ${r}`),typeof i<"u"&&(s+=` - ${i}`);let o=new Error(s);if(e){let a=Object.keys(e);e.stack&&a.push("stack"),a.forEach(c=>{c!=="message"&&Object.defineProperty(o,c,{value:e[c],writable:!1,enumerable:!0})})}return o}});var j0e=re(q0e=>{"use strict";p();Object.defineProperty(q0e,"__esModule",{value:!0});q0e.StsCredentials=void 0;var wri=Um(),Tri=Hy(),VZt=H6e(),vri=xx(),q6e=class t extends VZt.OAuthClientAuthHandler{#e;constructor(e={tokenExchangeEndpoint:""},n){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:n}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,n,r){let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:r&&JSON.stringify(r)},s={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:n,data:new URLSearchParams((0,vri.removeUndefinedValuesInObject)(i)),responseType:"json"};Tri.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let o=await this.transporter.request(s),a=o.data;return a.res=o,a}catch(o){throw o instanceof wri.GaxiosError&&o.response?(0,VZt.getErrorFromOAuthErrorResponse)(o.response.data,o):o}}};q0e.StsCredentials=q6e});var fN=re(z0=>{"use strict";p();Object.defineProperty(z0,"__esModule",{value:!0});z0.BaseExternalAccountClient=z0.CLOUD_RESOURCE_MANAGER=z0.EXTERNAL_ACCOUNT_TYPE=z0.EXPIRATION_TIME_OFFSET=void 0;var Rri=Um(),kri=require("stream"),j6e=Hy(),Bri=j0e(),YZt=xx(),Nri=t6e(),Dri="urn:ietf:params:oauth:grant-type:token-exchange",Pri="urn:ietf:params:oauth:token-type:access_token",V6e="https://www.googleapis.com/auth/cloud-platform",Mri=3600;z0.EXPIRATION_TIME_OFFSET=300*1e3;z0.EXTERNAL_ACCOUNT_TYPE="external_account";z0.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var Ori="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",Lri="https://sts.{universeDomain}/v1/token",Y6e=class t extends j6e.AuthClient{scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#e=null;constructor(e){super(e);let n=(0,YZt.originalOrCamelOptions)(e),r=n.get("type");if(r&&r!==z0.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${z0.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let i=n.get("client_id"),s=n.get("client_secret");this.tokenUrl=n.get("token_url")??Lri.replace("{universeDomain}",this.universeDomain);let o=n.get("subject_token_type"),a=n.get("workforce_pool_user_project"),c=n.get("service_account_impersonation_url"),u=n.get("service_account_impersonation"),l=(0,YZt.originalOrCamelOptions)(u).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(n.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),i&&(this.clientAuth={confidentialClientType:"basic",clientId:i,clientSecret:s}),this.stsCredential=new Bri.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=n.get("scopes")||[V6e],this.cachedAccessToken=null,this.audience=n.get("audience"),this.subjectTokenType=o,this.workforcePoolUserProject=a;let d=new RegExp(Ori);if(this.workforcePoolUserProject&&!this.audience.match(d))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=c,this.serviceAccountImpersonationLifetime=l,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=Mri),this.projectNumber=this.getProjectNumber(this.audience),this.supplierContext={audience:this.audience,subjectTokenType:this.subjectTokenType,transporter:this.transporter}}getServiceAccountEmail(){if(this.serviceAccountImpersonationUrl){if(this.serviceAccountImpersonationUrl.length>256)throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);return/serviceAccounts\/(?[^:]+):generateAccessToken$/.exec(this.serviceAccountImpersonationUrl)?.groups?.email||null}return null}setCredentials(e){super.setCredentials(e),this.cachedAccessToken=e}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),n=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(n)}request(e,n){if(n)this.requestAsync(e).then(r=>n(null,r),r=>n(r,r.response));else return this.requestAsync(e)}async getProjectId(){let e=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(e){let n=await this.getRequestHeaders(),r={...t.RETRY_CONFIG,headers:n,url:`${this.cloudResourceManagerURL.toString()}${e}`,responseType:"json"};j6e.AuthClient.setMethodName(r,"getProjectId");let i=await this.transporter.request(r);return this.projectId=i.data.projectId,this.projectId}return null}async requestAsync(e,n=!1){let r;try{let i=await this.getRequestHeaders();e.headers=Rri.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),r=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let o=s.status,a=s.config.data instanceof kri.Readable;if(!n&&(o===401||o===403)&&!a&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return r}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),n={grantType:Dri,audience:this.audience,requestedTokenType:Pri,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[V6e]:this.getScopesArray()},r=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(n,i,r);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(s.access_token):s.expires_in?this.cachedAccessToken={access_token:s.access_token,expiry_date:new Date().getTime()+s.expires_in*1e3,res:s.res}:this.cachedAccessToken={access_token:s.access_token,res:s.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let n=e.match(/\/projects\/([^/]+)/);return n?n[1]:null}async getImpersonatedAccessToken(e){let n={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"},responseType:"json"};j6e.AuthClient.setMethodName(n,"getImpersonatedAccessToken");let r=await this.transporter.request(n),i=r.data;return{access_token:i.accessToken,expiry_date:new Date(i.expireTime).getTime(),res:r}}isExpired(e){let n=new Date().getTime();return e.expiry_date?n>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[V6e]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),n=this.serviceAccountImpersonationUrl!==void 0,r=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${Nri.pkg.version} google-byoid-sdk source/${r} sa-impersonation/${n} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};z0.BaseExternalAccountClient=Y6e});var zZt=re(V0e=>{"use strict";p();Object.defineProperty(V0e,"__esModule",{value:!0});V0e.FileSubjectTokenSupplier=void 0;var K6e=require("util"),J6e=require("fs"),Fri=(0,K6e.promisify)(J6e.readFile??(()=>{})),Qri=(0,K6e.promisify)(J6e.realpath??(()=>{})),Uri=(0,K6e.promisify)(J6e.lstat??(()=>{})),z6e=class{filePath;formatType;subjectTokenFieldName;constructor(e){this.filePath=e.filePath,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName}async getSubjectToken(){let e=this.filePath;try{if(e=await Qri(e),!(await Uri(e)).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let n,r=await Fri(e,{encoding:"utf8"});if(this.formatType==="text"?n=r:this.formatType==="json"&&this.subjectTokenFieldName&&(n=JSON.parse(r)[this.subjectTokenFieldName]),!n)throw new Error("Unable to parse the subject_token from the credential_source file");return n}};V0e.FileSubjectTokenSupplier=z6e});var KZt=re(Y0e=>{"use strict";p();Object.defineProperty(Y0e,"__esModule",{value:!0});Y0e.UrlSubjectTokenSupplier=void 0;var Gri=Hy(),X6e=class{url;headers;formatType;subjectTokenFieldName;additionalGaxiosOptions;constructor(e){this.url=e.url,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName,this.headers=e.headers,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getSubjectToken(e){let n={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers,responseType:this.formatType};Gri.AuthClient.setMethodName(n,"getSubjectToken");let r;if(this.formatType==="text"?r=(await e.transporter.request(n)).data:this.formatType==="json"&&this.subjectTokenFieldName&&(r=(await e.transporter.request(n)).data[this.subjectTokenFieldName]),!r)throw new Error("Unable to parse the subject_token from the credential_source URL");return r}};Y0e.UrlSubjectTokenSupplier=X6e});var JZt=re(qy=>{"use strict";p();Object.defineProperty(qy,"__esModule",{value:!0});qy.CertificateSubjectTokenSupplier=qy.InvalidConfigurationError=qy.CertificateSourceUnavailableError=qy.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var z0e=xx(),K0e=require("fs"),J0e=require("crypto"),$ri=require("https");qy.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var CI=class extends Error{constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};qy.CertificateSourceUnavailableError=CI;var K0=class extends Error{constructor(e){super(e),this.name="InvalidConfigurationError"}};qy.InvalidConfigurationError=K0;var Z6e=class{certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new K0("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new K0("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new K0("Cannot create mTLS Agent with missing certificate or key");return new $ri.Agent({key:this.key,cert:this.cert})}async getSubjectToken(){this.certificateConfigPath=await this.#e();let{certPath:e,keyPath:n}=await this.#t();return{cert:this.cert,key:this.key}=await this.#n(e,n),await this.#r(this.cert)}async#e(){let e=this.certificateConfigPath;if(e){if(await(0,z0e.isValidFile)(e))return e;throw new CI(`Provided certificate config path is invalid: ${e}`)}let n=process.env[qy.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(n){if(await(0,z0e.isValidFile)(n))return n;throw new CI(`Path from environment variable "${qy.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${n}`)}let r=(0,z0e.getWellKnownCertificateConfigFileLocation)();if(await(0,z0e.isValidFile)(r))return r;throw new CI(`Could not find certificate configuration file. Searched override path, the "${qy.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${r}).`)}async#t(){let e=this.certificateConfigPath,n;try{n=await K0e.promises.readFile(e,"utf8")}catch{throw new CI(`Failed to read certificate config file at: ${e}`)}try{let r=JSON.parse(n),i=r?.cert_configs?.workload?.cert_path,s=r?.cert_configs?.workload?.key_path;if(!i||!s)throw new K0(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:s}}catch(r){throw r instanceof K0?r:new K0(`Failed to parse certificate config from ${e}: ${r.message}`)}}async#n(e,n){let r,i;try{r=await K0e.promises.readFile(e),new J0e.X509Certificate(r)}catch(s){let o=s instanceof Error?s.message:String(s);throw new CI(`Failed to read certificate file at ${e}: ${o}`)}try{i=await K0e.promises.readFile(n),(0,J0e.createPrivateKey)(i)}catch(s){let o=s instanceof Error?s.message:String(s);throw new CI(`Failed to read private key file at ${n}: ${o}`)}return{cert:r,key:i}}async#r(e){let n=new J0e.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([n.raw.toString("base64")]);try{let s=((await K0e.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((c,u)=>{try{return new J0e.X509Certificate(c)}catch(l){let d=l instanceof Error?l.message:String(l);throw new K0(`Failed to parse certificate at index ${u} in trust chain file ${this.trustChainPath}: ${d}`)}}),o=s.findIndex(c=>n.raw.equals(c.raw)),a;if(o===-1)a=[n,...s];else if(o===0)a=s;else throw new K0(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${o}).`);return JSON.stringify(a.map(c=>c.raw.toString("base64")))}catch(r){if(r instanceof K0)throw r;let i=r instanceof Error?r.message:String(r);throw new CI(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};qy.CertificateSubjectTokenSupplier=Z6e});var nze=re(X0e=>{"use strict";p();Object.defineProperty(X0e,"__esModule",{value:!0});X0e.IdentityPoolClient=void 0;var Wri=fN(),eze=xx(),Hri=zZt(),qri=KZt(),XZt=JZt(),jri=j0e(),ZZt=Um(),tze=class t extends Wri.BaseExternalAccountClient{subjectTokenSupplier;constructor(e){super(e);let n=(0,eze.originalOrCamelOptions)(e),r=n.get("credential_source"),i=n.get("subject_token_supplier");if(!r&&!i)throw new Error("A credential source or subject token supplier must be specified.");if(r&&i)throw new Error("Only one of credential source or subject token supplier can be specified.");if(i)this.subjectTokenSupplier=i,this.credentialSourceType="programmatic";else{let s=(0,eze.originalOrCamelOptions)(r),o=(0,eze.originalOrCamelOptions)(s.get("format")),a=o.get("type")||"text",c=o.get("subject_token_field_name");if(a!=="json"&&a!=="text")throw new Error(`Invalid credential_source format "${a}"`);if(a==="json"&&!c)throw new Error("Missing subject_token_field_name for JSON credential_source format");let u=s.get("file"),l=s.get("url"),d=s.get("certificate"),m=s.get("headers");if(u&&l||l&&d||u&&d)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(u)this.credentialSourceType="file",this.subjectTokenSupplier=new Hri.FileSubjectTokenSupplier({filePath:u,formatType:a,subjectTokenFieldName:c});else if(l)this.credentialSourceType="url",this.subjectTokenSupplier=new qri.UrlSubjectTokenSupplier({url:l,formatType:a,subjectTokenFieldName:c,headers:m,additionalGaxiosOptions:t.RETRY_CONFIG});else if(d){this.credentialSourceType="certificate";let h=new XZt.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:d.use_default_certificate_config,certificateConfigLocation:d.certificate_config_location,trustChainPath:d.trust_chain_path});this.subjectTokenSupplier=h}else throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.')}}async retrieveSubjectToken(){let e=await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);if(this.subjectTokenSupplier instanceof XZt.CertificateSubjectTokenSupplier){let n=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new jri.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new ZZt.Gaxios({agent:n})}),this.transporter=new ZZt.Gaxios({...this.transporter.defaults||{},agent:n})}return e}};X0e.IdentityPoolClient=tze});var ize=re(ebe=>{"use strict";p();Object.defineProperty(ebe,"__esModule",{value:!0});ebe.AwsRequestSigner=void 0;var Z0e=Um(),ten=KX(),een="AWS4-HMAC-SHA256",Vri="aws4_request",rze=class{getCredentials;region;crypto;constructor(e,n){this.getCredentials=e,this.region=n,this.crypto=(0,ten.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let n=typeof e.data=="object"?JSON.stringify(e.data):e.data,r=e.url,i=e.method||"GET",s=e.body||n,o=e.headers,a=await this.getCredentials(),c=new URL(r);if(typeof s!="string"&&s!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${s}`);let u=await zri({crypto:this.crypto,host:c.host,canonicalUri:c.pathname,canonicalQuerystring:c.search.slice(1),method:i,region:this.region,securityCredentials:a,requestPayload:s,additionalAmzHeaders:o}),l=Z0e.Gaxios.mergeHeaders(u.amzDate?{"x-amz-date":u.amzDate}:{},{authorization:u.authorizationHeader,host:c.host},o||{});a.token&&Z0e.Gaxios.mergeHeaders(l,{"x-amz-security-token":a.token});let d={url:r,method:i,headers:l};return s!==void 0&&(d.body=s),d}};ebe.AwsRequestSigner=rze;async function sZ(t,e,n){return await t.signWithHmacSha256(e,n)}async function Yri(t,e,n,r,i){let s=await sZ(t,`AWS4${e}`,n),o=await sZ(t,s,r),a=await sZ(t,o,i);return await sZ(t,a,"aws4_request")}async function zri(t){let e=Z0e.Gaxios.mergeHeaders(t.additionalAmzHeaders),n=t.requestPayload||"",r=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),o=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let a=Z0e.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),c="",u=[...a.keys()].sort();u.forEach(E=>{c+=`${E}:${a.get(E)} +`});let l=u.join(";"),d=await t.crypto.sha256DigestHex(n),m=`${t.method.toUpperCase()} ${t.canonicalUri} ${t.canonicalQuerystring} ${c} ${l} -${d}`,m=`${o}/${t.region}/${r}/${u1r}`,f=`${AWt} -${i} -${m} -`+await t.crypto.sha256DigestHex(h),g=await d1r(t.crypto,t.securityCredentials.secretAccessKey,o,t.region,r),A=await qK(t.crypto,g,f),y=`${AWt} Credential=${t.securityCredentials.accessKeyId}/${m}, SignedHeaders=${l}, Signature=${(0,yWt.fromArrayBufferToHex)(A)}`;return{amzDate:e.has("date")?void 0:i,authorizationHeader:y,canonicalQuerystring:t.canonicalQuerystring}}});var EWt=ee(tfe=>{"use strict";p();Object.defineProperty(tfe,"__esModule",{value:!0});tfe.DefaultAwsSecurityCredentialsSupplier=void 0;var efe=CA(),OHe=class{regionUrl;securityCredentialsUrl;imdsV2SessionTokenUrl;additionalGaxiosOptions;constructor(e){this.regionUrl=e.regionUrl,this.securityCredentialsUrl=e.securityCredentialsUrl,this.imdsV2SessionTokenUrl=e.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getAwsRegion(e){if(this.#r)return this.#r;let n=new Headers;if(!this.#r&&this.imdsV2SessionTokenUrl&&n.set("x-aws-ec2-metadata-token",await this.#e(e.transporter)),!this.regionUrl)throw new RangeError('Unable to determine AWS region due to missing "options.credential_source.region_url"');let r={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",responseType:"text",headers:n};efe.AuthClient.setMethodName(r,"getAwsRegion");let s=await e.transporter.request(r);return s.data.substr(0,s.data.length-1)}async getAwsSecurityCredentials(e){if(this.#i)return this.#i;let n=new Headers;this.imdsV2SessionTokenUrl&&n.set("x-aws-ec2-metadata-token",await this.#e(e.transporter));let r=await this.#t(n,e.transporter),s=await this.#n(r,n,e.transporter);return{accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,token:s.Token}}async#e(e){let n={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",responseType:"text",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return efe.AuthClient.setMethodName(n,"#getImdsV2SessionToken"),(await e.request(n)).data}async#t(e,n){if(!this.securityCredentialsUrl)throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"');let r={...this.additionalGaxiosOptions,url:this.securityCredentialsUrl,method:"GET",responseType:"text",headers:e};return efe.AuthClient.setMethodName(r,"#getAwsRoleName"),(await n.request(r)).data}async#n(e,n,r){let s={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:n,responseType:"json"};return efe.AuthClient.setMethodName(s,"#retrieveAwsSecurityCredentials"),(await r.request(s)).data}get#r(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#i(){return process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY?{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,token:process.env.AWS_SESSION_TOKEN}:null}};tfe.DefaultAwsSecurityCredentialsSupplier=OHe});var LHe=ee(nfe=>{"use strict";p();Object.defineProperty(nfe,"__esModule",{value:!0});nfe.AwsClient=void 0;var h1r=PHe(),m1r=kk(),f1r=EWt(),bWt=R_(),g1r=$p(),MHe=class t extends m1r.BaseExternalAccountClient{environmentId;awsSecurityCredentialsSupplier;regionalCredVerificationUrl;awsRequestSigner;region;static#e="https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";static AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";static AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254";constructor(e){super(e);let n=(0,bWt.originalOrCamelOptions)(e),r=n.get("credential_source"),s=n.get("aws_security_credentials_supplier");if(!r&&!s)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(r&&s)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(s)this.awsSecurityCredentialsSupplier=s,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let i=(0,bWt.originalOrCamelOptions)(r);this.environmentId=i.get("environment_id");let o=i.get("region_url"),a=i.get("url"),c=i.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new f1r.DefaultAwsSecurityCredentialsSupplier({regionUrl:o,securityCredentialsUrl:a,imdsV2SessionTokenUrl:c}),this.regionalCredVerificationUrl=i.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){let e=this.environmentId?.match(/^(aws)(\d+)$/);if(!e||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(e[2],10)!==1)throw new Error(`aws version "${e[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new h1r.AwsRequestSigner(async()=>this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext),this.region));let e=await this.awsRequestSigner.getRequestOptions({...t.RETRY_CONFIG,url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"}),n=[];return g1r.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((s,i)=>n.push({key:i,value:s})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:n}))}};nfe.AwsClient=MHe});var GHe=ee(Fu=>{"use strict";p();Object.defineProperty(Fu,"__esModule",{value:!0});Fu.InvalidSubjectTokenError=Fu.InvalidMessageFieldError=Fu.InvalidCodeFieldError=Fu.InvalidTokenTypeFieldError=Fu.InvalidExpirationTimeFieldError=Fu.InvalidSuccessFieldError=Fu.InvalidVersionFieldError=Fu.ExecutableResponseError=Fu.ExecutableResponse=void 0;var rfe="urn:ietf:params:oauth:token-type:saml2",FHe="urn:ietf:params:oauth:token-type:id_token",QHe="urn:ietf:params:oauth:token-type:jwt",UHe=class{version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new sfe("Executable response must contain a 'version' field.");if(e.success===void 0)throw new ife("Executable response must contain a 'success' field.");if(this.version=e.version,this.success=e.success,this.success){if(this.expirationTime=e.expiration_time,this.tokenType=e.token_type,this.tokenType!==rfe&&this.tokenType!==FHe&&this.tokenType!==QHe)throw new ofe(`Executable response must contain a 'token_type' field when successful and it must be one of ${FHe}, ${QHe}, or ${rfe}.`);if(this.tokenType===rfe){if(!e.saml_response)throw new HK(`Executable response must contain a 'saml_response' field when token_type=${rfe}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new HK(`Executable response must contain a 'id_token' field when token_type=${FHe} or ${QHe}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new afe("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new cfe("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime{"use strict";p();Object.defineProperty(lq,"__esModule",{value:!0});lq.PluggableAuthHandler=lq.ExecutableError=void 0;var uO=GHe(),A1r=require("child_process"),WHe=require("fs"),lfe=class extends Error{code;constructor(e,n){super(`The executable failed with exit code: ${n} and error message: ${e}.`),this.code=n,Object.setPrototypeOf(this,new.target.prototype)}};lq.ExecutableError=lfe;var qHe=class t{commandComponents;timeoutMillis;outputFile;constructor(e){if(!e.command)throw new Error("No command provided.");if(this.commandComponents=t.parseCommand(e.command),this.timeoutMillis=e.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((n,r)=>{let s=A1r.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),i="";s.stdout.on("data",a=>{i+=a}),s.stderr.on("data",a=>{i+=a});let o=setTimeout(()=>(s.removeAllListeners(),s.kill(),r(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);s.on("close",a=>{if(clearTimeout(o),a===0)try{let c=JSON.parse(i),u=new uO.ExecutableResponse(c);return n(u)}catch(c){return c instanceof uO.ExecutableResponseError?r(c):r(new uO.ExecutableResponseError(`The executable returned an invalid response: ${i}`))}else return r(new lfe(i,a.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await WHe.promises.realpath(this.outputFile)}catch{return}if(!(await WHe.promises.lstat(e)).isFile())return;let n=await WHe.promises.readFile(e,{encoding:"utf8"});if(n!=="")try{let r=JSON.parse(n);return new uO.ExecutableResponse(r).isValid()?new uO.ExecutableResponse(r):void 0}catch(r){throw r instanceof uO.ExecutableResponseError?r:new uO.ExecutableResponseError(`The output file contained an invalid response: ${n}`)}}static parseCommand(e){let n=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!n)throw new Error(`Provided command: "${e}" could not be parsed.`);for(let r=0;r{"use strict";p();Object.defineProperty(uq,"__esModule",{value:!0});uq.PluggableAuthClient=uq.ExecutableError=void 0;var y1r=kk(),E1r=GHe(),_Wt=HHe(),b1r=HHe();Object.defineProperty(uq,"ExecutableError",{enumerable:!0,get:function(){return b1r.ExecutableError}});var _1r=30*1e3,SWt=5*1e3,CWt=120*1e3,S1r="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",IWt=1,VHe=class extends y1r.BaseExternalAccountClient{command;timeoutMillis;outputFile;handler;constructor(e){if(super(e),!e.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=e.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(e.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=_1r;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillisCWt)throw new Error(`Timeout must be between ${SWt} and ${CWt} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new _Wt.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[S1r]!=="1")throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.");let e;if(this.outputFile&&(e=await this.handler.retrieveCachedResponse()),!e){let n=new Map;n.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience),n.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType),n.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0"),this.outputFile&&n.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile);let r=this.getServiceAccountEmail();r&&n.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",r),e=await this.handler.retrieveResponseFromExecutable(n)}if(e.version>IWt)throw new Error(`Version of executable is not currently supported, maximum supported version is ${IWt}.`);if(!e.success)throw new _Wt.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new E1r.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(e.isExpired())throw new Error("Executable response is expired.");return e.subjectToken}};uq.PluggableAuthClient=VHe});var KHe=ee(ufe=>{"use strict";p();Object.defineProperty(ufe,"__esModule",{value:!0});ufe.ExternalAccountClient=void 0;var C1r=kk(),I1r=DHe(),x1r=LHe(),w1r=jHe(),YHe=class{constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e){return e&&e.type===C1r.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new x1r.AwsClient(e):e.credential_source?.executable?new w1r.PluggableAuthClient(e):new I1r.IdentityPoolClient(e):null}};ufe.ExternalAccountClient=YHe});var XHe=ee(dq=>{"use strict";p();Object.defineProperty(dq,"__esModule",{value:!0});dq.ExternalAccountAuthorizedUserClient=dq.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var wWt=CA(),xWt=bHe(),TWt=$p(),T1r=require("stream"),v1r=kk();dq.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var R1r="https://sts.{universeDomain}/v1/oauthtoken",zHe=class t extends xWt.OAuthClientAuthHandler{#e;constructor(e){super(e),this.#e=e.tokenRefreshEndpoint}async refreshToken(e,n){let r={...t.RETRY_CONFIG,url:this.#e,method:"POST",headers:n,data:new URLSearchParams({grant_type:"refresh_token",refresh_token:e}),responseType:"json"};wWt.AuthClient.setMethodName(r,"refreshToken"),this.applyClientAuthenticationOptions(r);try{let s=await this.transporter.request(r),i=s.data;return i.res=s,i}catch(s){throw s instanceof TWt.GaxiosError&&s.response?(0,xWt.getErrorFromOAuthErrorResponse)(s.response.data,s):s}}},JHe=class extends wWt.AuthClient{cachedAccessToken;externalAccountAuthorizedUserHandler;refreshToken;constructor(e){super(e),e.universe_domain&&(this.universeDomain=e.universe_domain),this.refreshToken=e.refresh_token;let n={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new zHe({tokenRefreshEndpoint:e.token_url??R1r.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:n}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=v1r.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!e?.forceRefreshOnFailure}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),n=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(n)}request(e,n){if(n)this.requestAsync(e).then(r=>n(null,r),r=>n(r,r.response));else return this.requestAsync(e)}async requestAsync(e,n=!1){let r;try{let s=await this.getRequestHeaders();e.headers=TWt.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,s),r=await this.transporter.request(e)}catch(s){let i=s.response;if(i){let o=i.status,a=i.config.data instanceof T1r.Readable;if(!n&&(o===401||o===403)&&!a&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw s}return r}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let n=new Date().getTime();return e.expiry_date?n>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};dq.ExternalAccountAuthorizedUserClient=JHe});var e5e=ee(Nk=>{"use strict";p();Object.defineProperty(Nk,"__esModule",{value:!0});Nk.GdchClient=Nk.GDCH_SERVICE_ACCOUNT_TYPE=void 0;var k1r=require("crypto"),N1r=require("fs"),D1r=require("https"),B1r=Tk(),P1r=3600;Nk.GDCH_SERVICE_ACCOUNT_TYPE="gdch_service_account";var ZHe=class t extends B1r.OAuth2Client{projectId;privateKeyId;privateKey;serviceIdentityName;tokenServerUri;caCertPath;apiAudience;lifetime;gdchOptions;caAgentPromise;cachedCaCertPath;lastCaCertReadTime=0;CA_CERT_TTL_MS=300*1e3;constructor(e={}){super(e),this.gdchOptions=e,this.projectId=e.projectId||void 0,this.privateKeyId=e.privateKeyId,this.privateKey=e.privateKey,this.serviceIdentityName=e.serviceIdentityName,this.tokenServerUri=e.tokenServerUri,this.caCertPath=e.caCertPath,this.apiAudience=e.apiAudience,this.lifetime=e.lifetime||P1r,this.credentials={refresh_token:"gdch-placeholder",expiry_date:1}}createWithGdchAudience(e){if(!e)throw new Error("Audience cannot be null or empty for GDCH service account credentials.");return new t({...this.gdchOptions,projectId:this.projectId,privateKeyId:this.privateKeyId,privateKey:this.privateKey,serviceIdentityName:this.serviceIdentityName,tokenServerUri:this.tokenServerUri,caCertPath:this.caCertPath,lifetime:this.lifetime,apiAudience:e})}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the GDCH credentials settings.");if(e.type!==Nk.GDCH_SERVICE_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${Nk.GDCH_SERVICE_ACCOUNT_TYPE}" type`);if(e.format_version!=="1")throw new Error("Only format version 1 is supported.");if(!e.project)throw new Error("The incoming JSON object does not contain a project field");if(!e.private_key_id)throw new Error("The incoming JSON object does not contain a private_key_id field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");if(!e.name)throw new Error("The incoming JSON object does not contain a name field");if(!e.token_uri)throw new Error("The incoming JSON object does not contain a token_uri field");this.projectId=e.project,this.privateKeyId=e.private_key_id,this.privateKey=e.private_key,this.serviceIdentityName=e.name,this.tokenServerUri=e.token_uri,this.caCertPath=e.ca_cert_path,this.gdchOptions={...this.gdchOptions,projectId:e.project,privateKeyId:e.private_key_id,privateKey:e.private_key,serviceIdentityName:e.name,tokenServerUri:e.token_uri,caCertPath:e.ca_cert_path}}async refreshTokenNoCache(){if(!this.apiAudience)throw new Error("Audience cannot be null or empty for GDCH service account credentials. Specify the audience by calling createWithGdchAudience.");if(!this.privateKey)throw new Error("Private key is not configured for GDCH credentials.");if(!this.privateKeyId)throw new Error("Private key ID is not configured for GDCH credentials.");if(!this.projectId)throw new Error("Project is not configured for GDCH credentials.");if(!this.serviceIdentityName)throw new Error("Service identity name is not configured for GDCH credentials.");if(!this.tokenServerUri)throw new Error("Token server URI is not configured for GDCH credentials.");let e=this.createAssertion(),n={audience:this.apiAudience,grant_type:"urn:ietf:params:oauth:token-type:token-exchange",requested_token_type:"urn:ietf:params:oauth:token-type:access_token",subject_token:e,subject_token_type:"urn:k8s:params:oauth:token-type:serviceaccount"},r={url:this.tokenServerUri,method:"POST",headers:{"Content-Type":"application/json"},data:n,responseType:"json",timeout:1e4,retry:!0,retryConfig:{httpMethodsToRetry:["POST"],statusCodesToRetry:[[500,599]],noResponseRetries:3}};this.caCertPath&&(r.agent=await this.getCaAgent());try{let s=await this.transporter.request(r),i=s.data;if(!i.access_token)throw new Error("Token response did not contain an access_token.");if(!i.expires_in)throw new Error("Token response did not contain an expires_in field.");let o={access_token:i.access_token,token_type:"STS-Bearer",expiry_date:Date.now()+i.expires_in*1e3};return this.emit("tokens",o),{res:s,tokens:o}}catch(s){if(s&&s.config&&s.config.data)try{if(typeof s.config.data=="string"){let i=JSON.parse(s.config.data);i.subject_token&&(i.subject_token="***REDACTED***",s.config.data=JSON.stringify(i))}else typeof s.config.data=="object"&&s.config.data.subject_token&&(s.config.data.subject_token="***REDACTED***")}catch{}throw s instanceof Error&&(s.message=`Error getting access token for GDCH service account: ${s.message}, iss: ${this.serviceIdentityName}`),s}}createAssertion(){let e={alg:"ES256",typ:"JWT",kid:this.privateKeyId},n=`system:serviceaccount:${this.projectId}:${this.serviceIdentityName}`,r=Math.floor(Date.now()/1e3),s={iss:n,sub:n,iat:r,exp:r+this.lifetime,aud:this.tokenServerUri},i=this.base64UrlEncode(JSON.stringify(e)),o=this.base64UrlEncode(JSON.stringify(s)),a=`${i}.${o}`,c=k1r.sign("sha256",Buffer.from(a),{key:this.privateKey,dsaEncoding:"ieee-p1363"}),u=this.base64UrlEncode(c);return`${a}.${u}`}async requestAsync(e,n=!1){if(this.caCertPath&&!e.agent){let r=(e.url||"").toString();!r.includes("googleapis.com")&&!r.includes("google.com")&&(e.agent=await this.getCaAgent())}return super.requestAsync(e,n)}getCaAgent(){if(!this.caCertPath){this.caAgentPromise=void 0,this.cachedCaCertPath=void 0,this.lastCaCertReadTime=0;return}let e=Date.now(),n=e-this.lastCaCertReadTime>this.CA_CERT_TTL_MS;if(this.caAgentPromise&&this.caCertPath===this.cachedCaCertPath&&!n)return this.caAgentPromise;this.cachedCaCertPath=this.caCertPath,this.lastCaCertReadTime=e;let r=this.caCertPath;return this.caAgentPromise=(async()=>{try{let s=await N1r.promises.readFile(r);return new D1r.Agent({ca:s})}catch(s){throw this.cachedCaCertPath===r&&(this.caAgentPromise=void 0,this.cachedCaCertPath=void 0,this.lastCaCertReadTime=0),s instanceof Error&&(s.message=`Error reading certificate file from CA cert path, value '${r}': ${s.message}`),s}})(),this.caAgentPromise}toJSON(){return{...this,privateKey:this.privateKey?"***REDACTED***":void 0,_clientSecret:this._clientSecret?"***REDACTED***":void 0,apiKey:this.apiKey?"***REDACTED***":void 0,gdchOptions:this.gdchOptions?{...this.gdchOptions,privateKey:this.gdchOptions.privateKey?"***REDACTED***":void 0,clientSecret:this.gdchOptions.clientSecret?"***REDACTED***":void 0,client_secret:this.gdchOptions.client_secret?"***REDACTED***":void 0,apiKey:this.gdchOptions.apiKey?"***REDACTED***":void 0,credentials:this.gdchOptions.credentials?{...this.gdchOptions.credentials,access_token:this.gdchOptions.credentials.access_token?"***REDACTED***":void 0,refresh_token:this.gdchOptions.credentials.refresh_token?"***REDACTED***":void 0}:void 0}:void 0,credentials:{...this.credentials,access_token:this.credentials?.access_token?"***REDACTED***":void 0,refresh_token:this.credentials?.refresh_token?"***REDACTED***":void 0}}}[Symbol.for("nodejs.util.inspect.custom")](){return this.toJSON()}base64UrlEncode(e){return(typeof e=="string"?Buffer.from(e):e).toString("base64url")}};Nk.GdchClient=ZHe});var NWt=ee(B_=>{"use strict";p();Object.defineProperty(B_,"__esModule",{value:!0});B_.GoogleAuth=B_.GoogleAuthExceptionMessages=void 0;var O1r=require("child_process"),VK=require("fs"),M1r=$p(),jK=PK(),L1r=require("os"),dfe=require("path"),F1r=OK(),Q1r=U3e(),U1r=G3e(),$1r=W3e(),pq=mHe(),vWt=gHe(),hq=yHe(),G1r=KHe(),YK=kk(),t5e=CA(),RWt=XHe(),n5e=e5e(),kWt=R_();B_.GoogleAuthExceptionMessages={API_KEY_WITH_CREDENTIALS:"API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.",NO_PROJECT_ID_FOUND:`Unable to detect a Project Id in the current environment. +${d}`,h=`${o}/${t.region}/${r}/${Vri}`,f=`${een} +${s} +${h} +`+await t.crypto.sha256DigestHex(m),g=await Yri(t.crypto,t.securityCredentials.secretAccessKey,o,t.region,r),A=await sZ(t.crypto,g,f),y=`${een} Credential=${t.securityCredentials.accessKeyId}/${h}, SignedHeaders=${l}, Signature=${(0,ten.fromArrayBufferToHex)(A)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:y,canonicalQuerystring:t.canonicalQuerystring}}});var nen=re(nbe=>{"use strict";p();Object.defineProperty(nbe,"__esModule",{value:!0});nbe.DefaultAwsSecurityCredentialsSupplier=void 0;var tbe=Hy(),sze=class{regionUrl;securityCredentialsUrl;imdsV2SessionTokenUrl;additionalGaxiosOptions;constructor(e){this.regionUrl=e.regionUrl,this.securityCredentialsUrl=e.securityCredentialsUrl,this.imdsV2SessionTokenUrl=e.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getAwsRegion(e){if(this.#r)return this.#r;let n=new Headers;if(!this.#r&&this.imdsV2SessionTokenUrl&&n.set("x-aws-ec2-metadata-token",await this.#e(e.transporter)),!this.regionUrl)throw new RangeError('Unable to determine AWS region due to missing "options.credential_source.region_url"');let r={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",responseType:"text",headers:n};tbe.AuthClient.setMethodName(r,"getAwsRegion");let i=await e.transporter.request(r);return i.data.substr(0,i.data.length-1)}async getAwsSecurityCredentials(e){if(this.#i)return this.#i;let n=new Headers;this.imdsV2SessionTokenUrl&&n.set("x-aws-ec2-metadata-token",await this.#e(e.transporter));let r=await this.#t(n,e.transporter),i=await this.#n(r,n,e.transporter);return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,token:i.Token}}async#e(e){let n={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",responseType:"text",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return tbe.AuthClient.setMethodName(n,"#getImdsV2SessionToken"),(await e.request(n)).data}async#t(e,n){if(!this.securityCredentialsUrl)throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"');let r={...this.additionalGaxiosOptions,url:this.securityCredentialsUrl,method:"GET",responseType:"text",headers:e};return tbe.AuthClient.setMethodName(r,"#getAwsRoleName"),(await n.request(r)).data}async#n(e,n,r){let i={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:n,responseType:"json"};return tbe.AuthClient.setMethodName(i,"#retrieveAwsSecurityCredentials"),(await r.request(i)).data}get#r(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#i(){return process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY?{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,token:process.env.AWS_SESSION_TOKEN}:null}};nbe.DefaultAwsSecurityCredentialsSupplier=sze});var aze=re(rbe=>{"use strict";p();Object.defineProperty(rbe,"__esModule",{value:!0});rbe.AwsClient=void 0;var Kri=ize(),Jri=fN(),Xri=nen(),ren=xx(),Zri=Um(),oze=class t extends Jri.BaseExternalAccountClient{environmentId;awsSecurityCredentialsSupplier;regionalCredVerificationUrl;awsRequestSigner;region;static#e="https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";static AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";static AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254";constructor(e){super(e);let n=(0,ren.originalOrCamelOptions)(e),r=n.get("credential_source"),i=n.get("aws_security_credentials_supplier");if(!r&&!i)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(r&&i)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(i)this.awsSecurityCredentialsSupplier=i,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,ren.originalOrCamelOptions)(r);this.environmentId=s.get("environment_id");let o=s.get("region_url"),a=s.get("url"),c=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new Xri.DefaultAwsSecurityCredentialsSupplier({regionUrl:o,securityCredentialsUrl:a,imdsV2SessionTokenUrl:c}),this.regionalCredVerificationUrl=s.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){let e=this.environmentId?.match(/^(aws)(\d+)$/);if(!e||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(e[2],10)!==1)throw new Error(`aws version "${e[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new Kri.AwsRequestSigner(async()=>this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext),this.region));let e=await this.awsRequestSigner.getRequestOptions({...t.RETRY_CONFIG,url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"}),n=[];return Zri.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,s)=>n.push({key:s,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:n}))}};rbe.AwsClient=oze});var pze=re(Bd=>{"use strict";p();Object.defineProperty(Bd,"__esModule",{value:!0});Bd.InvalidSubjectTokenError=Bd.InvalidMessageFieldError=Bd.InvalidCodeFieldError=Bd.InvalidTokenTypeFieldError=Bd.InvalidExpirationTimeFieldError=Bd.InvalidSuccessFieldError=Bd.InvalidVersionFieldError=Bd.ExecutableResponseError=Bd.ExecutableResponse=void 0;var ibe="urn:ietf:params:oauth:token-type:saml2",cze="urn:ietf:params:oauth:token-type:id_token",lze="urn:ietf:params:oauth:token-type:jwt",uze=class{version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new sbe("Executable response must contain a 'version' field.");if(e.success===void 0)throw new obe("Executable response must contain a 'success' field.");if(this.version=e.version,this.success=e.success,this.success){if(this.expirationTime=e.expiration_time,this.tokenType=e.token_type,this.tokenType!==ibe&&this.tokenType!==cze&&this.tokenType!==lze)throw new abe(`Executable response must contain a 'token_type' field when successful and it must be one of ${cze}, ${lze}, or ${ibe}.`);if(this.tokenType===ibe){if(!e.saml_response)throw new oZ(`Executable response must contain a 'saml_response' field when token_type=${ibe}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new oZ(`Executable response must contain a 'id_token' field when token_type=${cze} or ${lze}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new cbe("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new lbe("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime{"use strict";p();Object.defineProperty(R3,"__esModule",{value:!0});R3.PluggableAuthHandler=R3.ExecutableError=void 0;var p2=pze(),eii=require("child_process"),mze=require("fs"),ube=class extends Error{code;constructor(e,n){super(`The executable failed with exit code: ${n} and error message: ${e}.`),this.code=n,Object.setPrototypeOf(this,new.target.prototype)}};R3.ExecutableError=ube;var hze=class t{commandComponents;timeoutMillis;outputFile;constructor(e){if(!e.command)throw new Error("No command provided.");if(this.commandComponents=t.parseCommand(e.command),this.timeoutMillis=e.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((n,r)=>{let i=eii.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",a=>{s+=a}),i.stderr.on("data",a=>{s+=a});let o=setTimeout(()=>(i.removeAllListeners(),i.kill(),r(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",a=>{if(clearTimeout(o),a===0)try{let c=JSON.parse(s),u=new p2.ExecutableResponse(c);return n(u)}catch(c){return c instanceof p2.ExecutableResponseError?r(c):r(new p2.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return r(new ube(s,a.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await mze.promises.realpath(this.outputFile)}catch{return}if(!(await mze.promises.lstat(e)).isFile())return;let n=await mze.promises.readFile(e,{encoding:"utf8"});if(n!=="")try{let r=JSON.parse(n);return new p2.ExecutableResponse(r).isValid()?new p2.ExecutableResponse(r):void 0}catch(r){throw r instanceof p2.ExecutableResponseError?r:new p2.ExecutableResponseError(`The output file contained an invalid response: ${n}`)}}static parseCommand(e){let n=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!n)throw new Error(`Provided command: "${e}" could not be parsed.`);for(let r=0;r{"use strict";p();Object.defineProperty(k3,"__esModule",{value:!0});k3.PluggableAuthClient=k3.ExecutableError=void 0;var tii=fN(),nii=pze(),ien=fze(),rii=fze();Object.defineProperty(k3,"ExecutableError",{enumerable:!0,get:function(){return rii.ExecutableError}});var iii=30*1e3,sen=5*1e3,oen=120*1e3,sii="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",aen=1,gze=class extends tii.BaseExternalAccountClient{command;timeoutMillis;outputFile;handler;constructor(e){if(super(e),!e.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=e.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(e.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=iii;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillisoen)throw new Error(`Timeout must be between ${sen} and ${oen} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new ien.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[sii]!=="1")throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.");let e;if(this.outputFile&&(e=await this.handler.retrieveCachedResponse()),!e){let n=new Map;n.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience),n.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType),n.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0"),this.outputFile&&n.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile);let r=this.getServiceAccountEmail();r&&n.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",r),e=await this.handler.retrieveResponseFromExecutable(n)}if(e.version>aen)throw new Error(`Version of executable is not currently supported, maximum supported version is ${aen}.`);if(!e.success)throw new ien.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new nii.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(e.isExpired())throw new Error("Executable response is expired.");return e.subjectToken}};k3.PluggableAuthClient=gze});var Eze=re(dbe=>{"use strict";p();Object.defineProperty(dbe,"__esModule",{value:!0});dbe.ExternalAccountClient=void 0;var oii=fN(),aii=nze(),cii=aze(),lii=Aze(),yze=class{constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e){return e&&e.type===oii.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new cii.AwsClient(e):e.credential_source?.executable?new lii.PluggableAuthClient(e):new aii.IdentityPoolClient(e):null}};dbe.ExternalAccountClient=yze});var xze=re(B3=>{"use strict";p();Object.defineProperty(B3,"__esModule",{value:!0});B3.ExternalAccountAuthorizedUserClient=B3.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var len=Hy(),cen=H6e(),uen=Um(),uii=require("stream"),dii=fN();B3.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var pii="https://sts.{universeDomain}/v1/oauthtoken",bze=class t extends cen.OAuthClientAuthHandler{#e;constructor(e){super(e),this.#e=e.tokenRefreshEndpoint}async refreshToken(e,n){let r={...t.RETRY_CONFIG,url:this.#e,method:"POST",headers:n,data:new URLSearchParams({grant_type:"refresh_token",refresh_token:e}),responseType:"json"};len.AuthClient.setMethodName(r,"refreshToken"),this.applyClientAuthenticationOptions(r);try{let i=await this.transporter.request(r),s=i.data;return s.res=i,s}catch(i){throw i instanceof uen.GaxiosError&&i.response?(0,cen.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},_ze=class extends len.AuthClient{cachedAccessToken;externalAccountAuthorizedUserHandler;refreshToken;constructor(e){super(e),e.universe_domain&&(this.universeDomain=e.universe_domain),this.refreshToken=e.refresh_token;let n={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new bze({tokenRefreshEndpoint:e.token_url??pii.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:n}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=dii.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!e?.forceRefreshOnFailure}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),n=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(n)}request(e,n){if(n)this.requestAsync(e).then(r=>n(null,r),r=>n(r,r.response));else return this.requestAsync(e)}async requestAsync(e,n=!1){let r;try{let i=await this.getRequestHeaders();e.headers=uen.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),r=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let o=s.status,a=s.config.data instanceof uii.Readable;if(!n&&(o===401||o===403)&&!a&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return r}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let n=new Date().getTime();return e.expiry_date?n>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};B3.ExternalAccountAuthorizedUserClient=_ze});var Cze=re(gN=>{"use strict";p();Object.defineProperty(gN,"__esModule",{value:!0});gN.GdchClient=gN.GDCH_SERVICE_ACCOUNT_TYPE=void 0;var mii=require("crypto"),hii=require("fs"),fii=require("https"),gii=pN(),Aii=3600;gN.GDCH_SERVICE_ACCOUNT_TYPE="gdch_service_account";var Sze=class t extends gii.OAuth2Client{projectId;privateKeyId;privateKey;serviceIdentityName;tokenServerUri;caCertPath;apiAudience;lifetime;gdchOptions;caAgentPromise;cachedCaCertPath;lastCaCertReadTime=0;CA_CERT_TTL_MS=300*1e3;constructor(e={}){super(e),this.gdchOptions=e,this.projectId=e.projectId||void 0,this.privateKeyId=e.privateKeyId,this.privateKey=e.privateKey,this.serviceIdentityName=e.serviceIdentityName,this.tokenServerUri=e.tokenServerUri,this.caCertPath=e.caCertPath,this.apiAudience=e.apiAudience,this.lifetime=e.lifetime||Aii,this.credentials={refresh_token:"gdch-placeholder",expiry_date:1}}createWithGdchAudience(e){if(!e)throw new Error("Audience cannot be null or empty for GDCH service account credentials.");return new t({...this.gdchOptions,projectId:this.projectId,privateKeyId:this.privateKeyId,privateKey:this.privateKey,serviceIdentityName:this.serviceIdentityName,tokenServerUri:this.tokenServerUri,caCertPath:this.caCertPath,lifetime:this.lifetime,apiAudience:e})}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the GDCH credentials settings.");if(e.type!==gN.GDCH_SERVICE_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${gN.GDCH_SERVICE_ACCOUNT_TYPE}" type`);if(e.format_version!=="1")throw new Error("Only format version 1 is supported.");if(!e.project)throw new Error("The incoming JSON object does not contain a project field");if(!e.private_key_id)throw new Error("The incoming JSON object does not contain a private_key_id field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");if(!e.name)throw new Error("The incoming JSON object does not contain a name field");if(!e.token_uri)throw new Error("The incoming JSON object does not contain a token_uri field");this.projectId=e.project,this.privateKeyId=e.private_key_id,this.privateKey=e.private_key,this.serviceIdentityName=e.name,this.tokenServerUri=e.token_uri,this.caCertPath=e.ca_cert_path,this.gdchOptions={...this.gdchOptions,projectId:e.project,privateKeyId:e.private_key_id,privateKey:e.private_key,serviceIdentityName:e.name,tokenServerUri:e.token_uri,caCertPath:e.ca_cert_path}}async refreshTokenNoCache(){if(!this.apiAudience)throw new Error("Audience cannot be null or empty for GDCH service account credentials. Specify the audience by calling createWithGdchAudience.");if(!this.privateKey)throw new Error("Private key is not configured for GDCH credentials.");if(!this.privateKeyId)throw new Error("Private key ID is not configured for GDCH credentials.");if(!this.projectId)throw new Error("Project is not configured for GDCH credentials.");if(!this.serviceIdentityName)throw new Error("Service identity name is not configured for GDCH credentials.");if(!this.tokenServerUri)throw new Error("Token server URI is not configured for GDCH credentials.");let e=this.createAssertion(),n={audience:this.apiAudience,grant_type:"urn:ietf:params:oauth:token-type:token-exchange",requested_token_type:"urn:ietf:params:oauth:token-type:access_token",subject_token:e,subject_token_type:"urn:k8s:params:oauth:token-type:serviceaccount"},r={url:this.tokenServerUri,method:"POST",headers:{"Content-Type":"application/json"},data:n,responseType:"json",timeout:1e4,retry:!0,retryConfig:{httpMethodsToRetry:["POST"],statusCodesToRetry:[[500,599]],noResponseRetries:3}};this.caCertPath&&(r.agent=await this.getCaAgent());try{let i=await this.transporter.request(r),s=i.data;if(!s.access_token)throw new Error("Token response did not contain an access_token.");if(!s.expires_in)throw new Error("Token response did not contain an expires_in field.");let o={access_token:s.access_token,token_type:"STS-Bearer",expiry_date:Date.now()+s.expires_in*1e3};return this.emit("tokens",o),{res:i,tokens:o}}catch(i){if(i&&i.config&&i.config.data)try{if(typeof i.config.data=="string"){let s=JSON.parse(i.config.data);s.subject_token&&(s.subject_token="***REDACTED***",i.config.data=JSON.stringify(s))}else typeof i.config.data=="object"&&i.config.data.subject_token&&(i.config.data.subject_token="***REDACTED***")}catch{}throw i instanceof Error&&(i.message=`Error getting access token for GDCH service account: ${i.message}, iss: ${this.serviceIdentityName}`),i}}createAssertion(){let e={alg:"ES256",typ:"JWT",kid:this.privateKeyId},n=`system:serviceaccount:${this.projectId}:${this.serviceIdentityName}`,r=Math.floor(Date.now()/1e3),i={iss:n,sub:n,iat:r,exp:r+this.lifetime,aud:this.tokenServerUri},s=this.base64UrlEncode(JSON.stringify(e)),o=this.base64UrlEncode(JSON.stringify(i)),a=`${s}.${o}`,c=mii.sign("sha256",Buffer.from(a),{key:this.privateKey,dsaEncoding:"ieee-p1363"}),u=this.base64UrlEncode(c);return`${a}.${u}`}async requestAsync(e,n=!1){if(this.caCertPath&&!e.agent){let r=(e.url||"").toString();!r.includes("googleapis.com")&&!r.includes("google.com")&&(e.agent=await this.getCaAgent())}return super.requestAsync(e,n)}getCaAgent(){if(!this.caCertPath){this.caAgentPromise=void 0,this.cachedCaCertPath=void 0,this.lastCaCertReadTime=0;return}let e=Date.now(),n=e-this.lastCaCertReadTime>this.CA_CERT_TTL_MS;if(this.caAgentPromise&&this.caCertPath===this.cachedCaCertPath&&!n)return this.caAgentPromise;this.cachedCaCertPath=this.caCertPath,this.lastCaCertReadTime=e;let r=this.caCertPath;return this.caAgentPromise=(async()=>{try{let i=await hii.promises.readFile(r);return new fii.Agent({ca:i})}catch(i){throw this.cachedCaCertPath===r&&(this.caAgentPromise=void 0,this.cachedCaCertPath=void 0,this.lastCaCertReadTime=0),i instanceof Error&&(i.message=`Error reading certificate file from CA cert path, value '${r}': ${i.message}`),i}})(),this.caAgentPromise}toJSON(){return{...this,privateKey:this.privateKey?"***REDACTED***":void 0,_clientSecret:this._clientSecret?"***REDACTED***":void 0,apiKey:this.apiKey?"***REDACTED***":void 0,gdchOptions:this.gdchOptions?{...this.gdchOptions,privateKey:this.gdchOptions.privateKey?"***REDACTED***":void 0,clientSecret:this.gdchOptions.clientSecret?"***REDACTED***":void 0,client_secret:this.gdchOptions.client_secret?"***REDACTED***":void 0,apiKey:this.gdchOptions.apiKey?"***REDACTED***":void 0,credentials:this.gdchOptions.credentials?{...this.gdchOptions.credentials,access_token:this.gdchOptions.credentials.access_token?"***REDACTED***":void 0,refresh_token:this.gdchOptions.credentials.refresh_token?"***REDACTED***":void 0}:void 0}:void 0,credentials:{...this.credentials,access_token:this.credentials?.access_token?"***REDACTED***":void 0,refresh_token:this.credentials?.refresh_token?"***REDACTED***":void 0}}}[Symbol.for("nodejs.util.inspect.custom")](){return this.toJSON()}base64UrlEncode(e){return(typeof e=="string"?Buffer.from(e):e).toString("base64url")}};gN.GdchClient=Sze});var hen=re(wx=>{"use strict";p();Object.defineProperty(wx,"__esModule",{value:!0});wx.GoogleAuth=wx.GoogleAuthExceptionMessages=void 0;var yii=require("child_process"),aZ=require("fs"),Eii=Um(),cZ=zX(),bii=require("os"),pbe=require("path"),_ii=KX(),xii=u6e(),Sii=p6e(),Cii=m6e(),N3=F6e(),den=U6e(),D3=$6e(),Iii=Eze(),lZ=fN(),Ize=Hy(),pen=xze(),wze=Cze(),men=xx();wx.GoogleAuthExceptionMessages={API_KEY_WITH_CREDENTIALS:"API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.",NO_PROJECT_ID_FOUND:`Unable to detect a Project Id in the current environment. To learn more about authentication and Google APIs, visit: https://cloud.google.com/docs/authentication/getting-started`,NO_CREDENTIALS_FOUND:`Unable to find credentials in current environment. To learn more about authentication and Google APIs, visit: https://cloud.google.com/docs/authentication/getting-started`,NO_ADC_FOUND:"Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.",NO_UNIVERSE_DOMAIN_FOUND:`Unable to detect a Universe Domain in the current environment. To learn more about Universe Domain retrieval, visit: -https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var r5e=class{checkIsGCE=void 0;useJWTAccessWithScope;defaultServicePath;get isGCE(){return this.checkIsGCE}_findProjectIdPromise;_cachedProjectId;jsonContent=null;apiKey;cachedCredential=null;#e=null;defaultScopes;keyFilename;scopes;clientOptions={};constructor(e={}){if(this._cachedProjectId=e.projectId||null,this.cachedCredential=e.authClient||null,this.keyFilename=e.keyFilename||e.keyFile,this.scopes=e.scopes,this.clientOptions=e.clientOptions||{},this.jsonContent=e.credentials||null,this.apiKey=e.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(B_.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);e.universeDomain&&(this.clientOptions.universeDomain=e.universeDomain)}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath,e.useJWTAccessWithScope=this.useJWTAccessWithScope,e.defaultScopes=this.defaultScopes}getProjectId(e){if(e)this.getProjectIdAsync().then(n=>e(null,n),e);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===B_.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw e}}async findAndCacheProjectId(){let e=null;if(e||=await this.getProductionProjectId(),e||=await this.getFileProjectId(),e||=await this.getDefaultServiceProjectId(),e||=await this.getGCEProjectId(),e||=await this.getExternalAccountClientProjectId(),e)return this._cachedProjectId=e,e;throw new Error(B_.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){let e;try{e=await jK.universe("universe-domain"),e||=t5e.DEFAULT_UNIVERSE}catch(n){if(n&&n?.response?.status===404)e=t5e.DEFAULT_UNIVERSE;else throw n}return e}async getUniverseDomain(){let e=(0,kWt.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=t5e.DEFAULT_UNIVERSE}return e}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},n){let r;if(typeof e=="function"?n=e:r=e,n)this.getApplicationDefaultAsync(r).then(s=>n(null,s.credential,s.projectId),n);else return this.getApplicationDefaultAsync(r)}async getApplicationDefaultAsync(e={}){if(this.cachedCredential)return await this.#t(this.cachedCredential,null);let n;if(n=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e),n)return n instanceof pq.JWT?n.scopes=this.scopes:n instanceof YK.BaseExternalAccountClient&&(n.scopes=this.getAnyScopes()),await this.#t(n);if(n=await this._tryGetApplicationCredentialsFromWellKnownFile(e),n)return n instanceof pq.JWT?n.scopes=this.scopes:n instanceof YK.BaseExternalAccountClient&&(n.scopes=this.getAnyScopes()),await this.#t(n);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new Q1r.Compute(e));throw new Error(B_.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async#t(e,n=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let r=await this.getProjectIdOptional();return n&&(e.quotaProjectId=n),this.cachedCredential=e,{credential:e,projectId:r}}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=jK.getGCPResidency()||await jK.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){let n=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!n||n.length===0)return null;try{return await this._getApplicationCredentialsFromFilePath(n,e)}catch(r){throw r instanceof Error&&(r.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${r.message}`),r}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let n=process.env.CLOUDSDK_CONFIG;if(!n)if(this._isWindows())process.env.APPDATA&&(n=dfe.join(process.env.APPDATA,"gcloud"));else{let i=process.env.HOME;i&&(n=dfe.join(i,".config","gcloud"))}if(!n)return null;let r=dfe.join(n,"application_default_credentials.json");return VK.existsSync(r)?await this._getApplicationCredentialsFromFilePath(r,e):null}async _getApplicationCredentialsFromFilePath(e,n={}){if(!e||e.length===0)throw new Error("The file path is invalid.");try{if(e=VK.realpathSync(e),!VK.lstatSync(e).isFile())throw new Error}catch(s){throw s instanceof Error&&(s.message=`The file at ${e} does not exist, or it is not a file. ${s.message}`),s}let r=VK.createReadStream(e);return this.fromStream(r,n)}fromImpersonatedJSON(e){if(!e)throw new Error("Must pass in a JSON object containing an impersonated refresh token");if(e.type!==hq.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${hq.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!e.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!e.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let n=this.fromJSON(e.source_credentials);if(e.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${e.service_account_impersonation_url}`);let r=/(?[^/]+):(generateAccessToken|generateIdToken)$/.exec(e.service_account_impersonation_url)?.groups?.target;if(!r)throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`);let s=(this.scopes||e.scopes||this.defaultScopes)??[];return new hq.Impersonated({...e,sourceClient:n,targetPrincipal:r,targetScopes:Array.isArray(s)?s:[s]})}fromJSON(e,n={}){let r,s=(0,kWt.originalOrCamelOptions)(n).get("universe_domain");return e.type===vWt.USER_REFRESH_ACCOUNT_TYPE?(r=new vWt.UserRefreshClient(n),r.fromJSON(e)):e.type===hq.IMPERSONATED_ACCOUNT_TYPE?r=this.fromImpersonatedJSON(e):e.type===YK.EXTERNAL_ACCOUNT_TYPE?(r=G1r.ExternalAccountClient.fromJSON({...e,...n}),r.scopes=this.getAnyScopes()):e.type===RWt.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?r=new RWt.ExternalAccountAuthorizedUserClient({...e,...n}):e.type===n5e.GDCH_SERVICE_ACCOUNT_TYPE?(r=new n5e.GdchClient(n),r.fromJSON(e)):(n.scopes=this.scopes,r=new pq.JWT(n),this.setGapicJWTValues(r),r.fromJSON(e)),s&&(r.universeDomain=s),r}_cacheClientFromJSON(e,n){let r=this.fromJSON(e,n);return this.jsonContent=e,this.cachedCredential=r,r}fromStream(e,n={},r){let s={};if(typeof n=="function"?r=n:s=n,r)this.fromStreamAsync(e,s).then(i=>r(null,i),r);else return this.fromStreamAsync(e,s)}fromStreamAsync(e,n){return new Promise((r,s)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let i=[];e.setEncoding("utf8").on("error",s).on("data",o=>i.push(o)).on("end",()=>{try{try{let o=JSON.parse(i.join("")),a=this._cacheClientFromJSON(o,n);return r(a)}catch(o){if(!this.keyFilename)throw o;let a=new pq.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=a,this.setGapicJWTValues(a),r(a)}}catch(o){return s(o)}})})}fromAPIKey(e,n={}){return new pq.JWT({...n,apiKey:e})}_isWindows(){let e=L1r.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,O1r.exec)("gcloud config config-helper --format json",(n,r)=>{if(!n&&r)try{let s=JSON.parse(r).configuration.properties.core.project;e(s);return}catch{}e(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let n=await this.getClient();if(n&&n.projectId)return n.projectId}let e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return e?e.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==YK.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await jK.project("project-id")}catch{return null}}getCredentials(e){if(e)this.getCredentialsAsync().then(n=>e(null,n),e);else return this.getCredentialsAsync()}async getCredentialsAsync(){let e=await this.getClient();if(e instanceof hq.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof YK.BaseExternalAccountClient){let n=e.getServiceAccountEmail();if(n)return{client_email:n,universe_domain:e.universeDomain}}if(this.jsonContent)return{client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key,universe_domain:this.jsonContent.universe_domain};if(await this._checkIsGCE()){let[n,r]=await Promise.all([jK.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:n,universe_domain:r}}throw new Error(B_.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND)}async getClient(){if(this.cachedCredential)return this.cachedCredential;this.#e=this.#e||this.#n();try{let e=await this.#e;if(e instanceof n5e.GdchClient&&!e.apiAudience){let n=this.clientOptions,r=n.apiEndpoint||n.servicePath;if(r){let i=`${r.startsWith("http")?"":"https://"}${r}`.replace(/\/+$/,""),o=e.createWithGdchAudience(i);return this.cachedCredential=o,o}}return e}finally{this.#e=null}}async#n(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);if(this.keyFilename){let e=dfe.resolve(this.keyFilename),n=VK.createReadStream(e);return await this.fromStreamAsync(n,this.clientOptions)}else if(this.apiKey){let e=await this.fromAPIKey(this.apiKey,this.clientOptions);e.scopes=this.scopes;let{credential:n}=await this.#t(e);return n}else{let{credential:e}=await this.getApplicationDefaultAsync(this.clientOptions);return e}}async getIdTokenClient(e){let n=await this.getClient();if(!("fetchIdToken"in n))throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.");return new U1r.IdTokenClient({targetAudience:e,idTokenProvider:n})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(e){return(await this.getClient()).getRequestHeaders(e)}async authorizeRequest(e={}){let n=e.url,s=await(await this.getClient()).getRequestHeaders(n);return e.headers=M1r.Gaxios.mergeHeaders(e.headers,s),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,$1r.getEnv)()}async sign(e,n){let r=await this.getClient(),s=await this.getUniverseDomain();if(n=n||`https://iamcredentials.${s}/v1/projects/-/serviceAccounts/`,r instanceof hq.Impersonated)return(await r.sign(e)).signedBlob;let i=(0,F1r.createCrypto)();if(r instanceof pq.JWT&&r.key)return await i.sign(r.key,e);let o=await this.getCredentials();if(!o.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(i,o.client_email,e,n)}async signBlob(e,n,r,s){let i=new URL(s+`${n}:signBlob`);return(await this.request({method:"POST",url:i.href,data:{payload:e.encodeBase64StringUtf8(r)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};B_.GoogleAuth=r5e});var DWt=ee(pfe=>{"use strict";p();Object.defineProperty(pfe,"__esModule",{value:!0});pfe.IAMAuth=void 0;var s5e=class{selector;token;constructor(e,n){this.selector=e,this.token=n,this.selector=e,this.token=n}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};pfe.IAMAuth=s5e});var BWt=ee(wC=>{"use strict";p();Object.defineProperty(wC,"__esModule",{value:!0});wC.DownscopedClient=wC.EXPIRATION_TIME_OFFSET=wC.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var W1r=$p(),q1r=require("stream"),i5e=CA(),H1r=Hme(),V1r="urn:ietf:params:oauth:grant-type:token-exchange",j1r="urn:ietf:params:oauth:token-type:access_token",Y1r="urn:ietf:params:oauth:token-type:access_token";wC.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;wC.EXPIRATION_TIME_OFFSET=300*1e3;var o5e=class extends i5e.AuthClient{authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,n={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof i5e.AuthClient?{}:e),e instanceof i5e.AuthClient?(this.authClient=e,this.credentialAccessBoundary=n):(this.authClient=e.authClient,this.credentialAccessBoundary=e.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>wC.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${wC.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let r of this.credentialAccessBoundary.accessBoundary.accessBoundaryRules)if(r.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new H1r.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(e){if(!e.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(e),this.cachedDownscopedAccessToken=e}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),n=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(n)}request(e,n){if(n)this.requestAsync(e).then(r=>n(null,r),r=>n(r,r.response));else return this.requestAsync(e)}async requestAsync(e,n=!1){let r;try{let s=await this.getRequestHeaders();e.headers=W1r.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,s),r=await this.transporter.request(e)}catch(s){let i=s.response;if(i){let o=i.status,a=i.config.data instanceof q1r.Readable;if(!n&&(o===401||o===403)&&!a&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw s}return r}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,n={grantType:V1r,requestedTokenType:j1r,subjectToken:e,subjectTokenType:Y1r},r=await this.stsCredential.exchangeToken(n,void 0,this.credentialAccessBoundary),s=this.authClient.credentials?.expiry_date||null,i=r.expires_in?new Date().getTime()+r.expires_in*1e3:s;return this.cachedDownscopedAccessToken={access_token:r.access_token,expiry_date:i,res:r.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let n=new Date().getTime();return e.expiry_date?n>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};wC.DownscopedClient=o5e});var PWt=ee(hfe=>{"use strict";p();Object.defineProperty(hfe,"__esModule",{value:!0});hfe.PassThroughClient=void 0;var K1r=CA(),a5e=class extends K1r.AuthClient{async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};hfe.PassThroughClient=a5e});var UWt=ee(dr=>{"use strict";p();var z1r=dr&&dr.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),J1r=dr&&dr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&z1r(e,t,n)};Object.defineProperty(dr,"__esModule",{value:!0});dr.GoogleAuth=dr.auth=dr.GDCH_SERVICE_ACCOUNT_TYPE=dr.GdchClient=dr.PassThroughClient=dr.ExternalAccountAuthorizedUserClient=dr.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=dr.ExecutableError=dr.PluggableAuthClient=dr.DownscopedClient=dr.BaseExternalAccountClient=dr.ExternalAccountClient=dr.IdentityPoolClient=dr.AwsRequestSigner=dr.AwsClient=dr.UserRefreshClient=dr.LoginTicket=dr.ClientAuthentication=dr.OAuth2Client=dr.CodeChallengeMethod=dr.Impersonated=dr.JWT=dr.JWTAccess=dr.IdTokenClient=dr.IAMAuth=dr.GCPEnv=dr.Compute=dr.DEFAULT_UNIVERSE=dr.AuthClient=dr.gaxios=dr.gcpMetadata=void 0;var OWt=NWt();Object.defineProperty(dr,"GoogleAuth",{enumerable:!0,get:function(){return OWt.GoogleAuth}});dr.gcpMetadata=PK();dr.gaxios=$p();var MWt=CA();Object.defineProperty(dr,"AuthClient",{enumerable:!0,get:function(){return MWt.AuthClient}});Object.defineProperty(dr,"DEFAULT_UNIVERSE",{enumerable:!0,get:function(){return MWt.DEFAULT_UNIVERSE}});var X1r=U3e();Object.defineProperty(dr,"Compute",{enumerable:!0,get:function(){return X1r.Compute}});var Z1r=W3e();Object.defineProperty(dr,"GCPEnv",{enumerable:!0,get:function(){return Z1r.GCPEnv}});var eBr=DWt();Object.defineProperty(dr,"IAMAuth",{enumerable:!0,get:function(){return eBr.IAMAuth}});var tBr=G3e();Object.defineProperty(dr,"IdTokenClient",{enumerable:!0,get:function(){return tBr.IdTokenClient}});var nBr=pHe();Object.defineProperty(dr,"JWTAccess",{enumerable:!0,get:function(){return nBr.JWTAccess}});var rBr=mHe();Object.defineProperty(dr,"JWT",{enumerable:!0,get:function(){return rBr.JWT}});var sBr=yHe();Object.defineProperty(dr,"Impersonated",{enumerable:!0,get:function(){return sBr.Impersonated}});var c5e=Tk();Object.defineProperty(dr,"CodeChallengeMethod",{enumerable:!0,get:function(){return c5e.CodeChallengeMethod}});Object.defineProperty(dr,"OAuth2Client",{enumerable:!0,get:function(){return c5e.OAuth2Client}});Object.defineProperty(dr,"ClientAuthentication",{enumerable:!0,get:function(){return c5e.ClientAuthentication}});var iBr=M3e();Object.defineProperty(dr,"LoginTicket",{enumerable:!0,get:function(){return iBr.LoginTicket}});var oBr=gHe();Object.defineProperty(dr,"UserRefreshClient",{enumerable:!0,get:function(){return oBr.UserRefreshClient}});var aBr=LHe();Object.defineProperty(dr,"AwsClient",{enumerable:!0,get:function(){return aBr.AwsClient}});var cBr=PHe();Object.defineProperty(dr,"AwsRequestSigner",{enumerable:!0,get:function(){return cBr.AwsRequestSigner}});var lBr=DHe();Object.defineProperty(dr,"IdentityPoolClient",{enumerable:!0,get:function(){return lBr.IdentityPoolClient}});var uBr=KHe();Object.defineProperty(dr,"ExternalAccountClient",{enumerable:!0,get:function(){return uBr.ExternalAccountClient}});var dBr=kk();Object.defineProperty(dr,"BaseExternalAccountClient",{enumerable:!0,get:function(){return dBr.BaseExternalAccountClient}});var pBr=BWt();Object.defineProperty(dr,"DownscopedClient",{enumerable:!0,get:function(){return pBr.DownscopedClient}});var LWt=jHe();Object.defineProperty(dr,"PluggableAuthClient",{enumerable:!0,get:function(){return LWt.PluggableAuthClient}});Object.defineProperty(dr,"ExecutableError",{enumerable:!0,get:function(){return LWt.ExecutableError}});var FWt=XHe();Object.defineProperty(dr,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:function(){return FWt.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE}});Object.defineProperty(dr,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:function(){return FWt.ExternalAccountAuthorizedUserClient}});var hBr=PWt();Object.defineProperty(dr,"PassThroughClient",{enumerable:!0,get:function(){return hBr.PassThroughClient}});var QWt=e5e();Object.defineProperty(dr,"GdchClient",{enumerable:!0,get:function(){return QWt.GdchClient}});Object.defineProperty(dr,"GDCH_SERVICE_ACCOUNT_TYPE",{enumerable:!0,get:function(){return QWt.GDCH_SERVICE_ACCOUNT_TYPE}});J1r(uHe(),dr);var mBr=new OWt.GoogleAuth;dr.auth=mBr});var aw=ee((Zoo,WWt)=>{"use strict";p();var $Wt=["nodebuffer","arraybuffer","fragments"],GWt=typeof Blob<"u";GWt&&$Wt.push("blob");WWt.exports={BINARY_TYPES:$Wt,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:GWt,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var KK=ee((tao,mfe)=>{"use strict";p();var{EMPTY_BUFFER:fBr}=aw(),l5e=Buffer[Symbol.species];function gBr(t,e){if(t.length===0)return fBr;if(t.length===1)return t[0];let n=Buffer.allocUnsafe(e),r=0;for(let s=0;s{"use strict";p();var VWt=Symbol("kDone"),d5e=Symbol("kRun"),p5e=class{constructor(e){this[VWt]=()=>{this.pending--,this[d5e]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[d5e]()}[d5e](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[VWt])}}};jWt.exports=p5e});var gq=ee((iao,XWt)=>{"use strict";p();var zK=require("zlib"),KWt=KK(),yBr=YWt(),{kStatusCode:zWt}=aw(),EBr=Buffer[Symbol.species],bBr=Buffer.from([0,0,255,255]),gfe=Symbol("permessage-deflate"),cw=Symbol("total-length"),mq=Symbol("callback"),Dk=Symbol("buffers"),fq=Symbol("error"),ffe,h5e=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!ffe){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ffe=new yBr(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[mq];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let n=this._options,r=e.find(s=>!(n.serverNoContextTakeover===!1&&s.server_no_context_takeover||s.server_max_window_bits&&(n.serverMaxWindowBits===!1||typeof n.serverMaxWindowBits=="number"&&n.serverMaxWindowBits>s.server_max_window_bits)||typeof n.clientMaxWindowBits=="number"&&(typeof s.client_max_window_bits=="number"?n.clientMaxWindowBits>s.client_max_window_bits:!s.client_max_window_bits)));if(!r)throw new Error("None of the extension offers can be accepted");return n.serverNoContextTakeover&&(r.server_no_context_takeover=!0),n.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof n.serverMaxWindowBits=="number"&&(r.server_max_window_bits=n.serverMaxWindowBits),typeof n.clientMaxWindowBits=="number"?r.client_max_window_bits=n.clientMaxWindowBits:(r.client_max_window_bits===!0||n.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(e){let n=e[0];if(this._options.clientNoContextTakeover===!1&&n.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!n.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(n.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&n.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return n}normalizeParams(e){return e.forEach(n=>{Object.keys(n).forEach(r=>{let s=n[r];if(s.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(s=s[0],r==="client_max_window_bits"){if(s!==!0){let i=+s;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${r}": ${s}`);s=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${s}`)}else if(r==="server_max_window_bits"){let i=+s;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${r}": ${s}`);s=i}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(s!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${s}`)}else throw new Error(`Unknown parameter "${r}"`);n[r]=s})}),e}decompress(e,n,r){ffe.add(s=>{this._decompress(e,n,(i,o)=>{s(),r(i,o)})})}compress(e,n,r){ffe.add(s=>{this._compress(e,n,(i,o)=>{s(),r(i,o)})})}_decompress(e,n,r){let s=this._isServer?"client":"server";if(!this._inflate){let i=`${s}_max_window_bits`,o=typeof this.params[i]!="number"?zK.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=zK.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[gfe]=this,this._inflate[cw]=0,this._inflate[Dk]=[],this._inflate.on("error",SBr),this._inflate.on("data",JWt)}this._inflate[mq]=r,this._inflate.write(e),n&&this._inflate.write(bBr),this._inflate.flush(()=>{let i=this._inflate[fq];if(i){this._inflate.close(),this._inflate=null,r(i);return}let o=KWt.concat(this._inflate[Dk],this._inflate[cw]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[cw]=0,this._inflate[Dk]=[],n&&this.params[`${s}_no_context_takeover`]&&this._inflate.reset()),r(null,o)})}_compress(e,n,r){let s=this._isServer?"server":"client";if(!this._deflate){let i=`${s}_max_window_bits`,o=typeof this.params[i]!="number"?zK.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=zK.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[cw]=0,this._deflate[Dk]=[],this._deflate.on("data",_Br)}this._deflate[mq]=r,this._deflate.write(e),this._deflate.flush(zK.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=KWt.concat(this._deflate[Dk],this._deflate[cw]);n&&(i=new EBr(i.buffer,i.byteOffset,i.length-4)),this._deflate[mq]=null,this._deflate[cw]=0,this._deflate[Dk]=[],n&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),r(null,i)})}};XWt.exports=h5e;function _Br(t){this[Dk].push(t),this[cw]+=t.length}function JWt(t){if(this[cw]+=t.length,this[gfe]._maxPayload<1||this[cw]<=this[gfe]._maxPayload){this[Dk].push(t);return}this[fq]=new RangeError("Max payload size exceeded"),this[fq].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[fq][zWt]=1009,this.removeListener("data",JWt),this.reset()}function SBr(t){if(this[gfe]._inflate=null,this[fq]){this[mq](this[fq]);return}t[zWt]=1007,this[mq](t)}});var Aq=ee((aao,Afe)=>{"use strict";p();var{isUtf8:ZWt}=require("buffer"),{hasBlob:CBr}=aw(),IBr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function xBr(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function m5e(t){let e=t.length,n=0;for(;n=e||(t[n+1]&192)!==128||(t[n+2]&192)!==128||t[n]===224&&(t[n+1]&224)===128||t[n]===237&&(t[n+1]&224)===160)return!1;n+=3}else if((t[n]&248)===240){if(n+3>=e||(t[n+1]&192)!==128||(t[n+2]&192)!==128||(t[n+3]&192)!==128||t[n]===240&&(t[n+1]&240)===128||t[n]===244&&t[n+1]>143||t[n]>244)return!1;n+=4}else return!1;return!0}function wBr(t){return CBr&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}Afe.exports={isBlob:wBr,isValidStatusCode:xBr,isValidUTF8:m5e,tokenChars:IBr};if(ZWt)Afe.exports.isValidUTF8=function(t){return t.length<24?m5e(t):ZWt(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=require("utf-8-validate");Afe.exports.isValidUTF8=function(e){return e.length<32?m5e(e):t(e)}}catch{}});var E5e=ee((lao,oqt)=>{"use strict";p();var{Writable:TBr}=require("stream"),eqt=gq(),{BINARY_TYPES:vBr,EMPTY_BUFFER:tqt,kStatusCode:RBr,kWebSocket:kBr}=aw(),{concat:f5e,toArrayBuffer:NBr,unmask:DBr}=KK(),{isValidStatusCode:BBr,isValidUTF8:nqt}=Aq(),yfe=Buffer[Symbol.species],RE=0,rqt=1,sqt=2,iqt=3,g5e=4,A5e=5,Efe=6,y5e=class extends TBr{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||vBr[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[kBr]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=RE}_write(e,n,r){if(this._opcode===8&&this._state==RE)return r();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){r(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e=r.length?n.set(this._buffers.shift(),s):(n.set(new Uint8Array(r.buffer,r.byteOffset,e),s),this._buffers[0]=new yfe(r.buffer,r.byteOffset+e,r.length-e)),e-=r.length}while(e>0);return n}startLoop(e){this._loop=!0;do switch(this._state){case RE:this.getInfo(e);break;case rqt:this.getPayloadLength16(e);break;case sqt:this.getPayloadLength64(e);break;case iqt:this.getMask();break;case g5e:this.getData(e);break;case A5e:case Efe:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let n=this.consume(2);if((n[0]&48)!==0){let s=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(s);return}let r=(n[0]&64)===64;if(r&&!this._extensions[eqt.extensionName]){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(this._fin=(n[0]&128)===128,this._opcode=n[0]&15,this._payloadLength=n[1]&127,this._opcode===0){if(r){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(!this._fragmented){let s=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let s=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(s);return}if(r){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let s=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(s);return}}else{let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(n[1]&128)===128,this._isServer){if(!this._masked){let s=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(s);return}}else if(this._masked){let s=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(s);return}this._payloadLength===126?this._state=rqt:this._payloadLength===127?this._state=sqt:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let n=this.consume(8),r=n.readUInt32BE(0);if(r>Math.pow(2,21)-1){let s=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(s);return}this._payloadLength=r*Math.pow(2,32)+n.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let n=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(n);return}this._masked?this._state=iqt:this._state=g5e}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=g5e}getData(e){let n=tqt;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(n,e);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let r=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");e(r);return}if(this._compressed){this._state=A5e,this.decompress(n,e);return}n.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(n)),this.dataMessage(e)}decompress(e,n){this._extensions[eqt.extensionName].decompress(e,this._fin,(s,i)=>{if(s)return n(s);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");n(o);return}this._fragments.push(i)}this.dataMessage(n),this._state===RE&&this.startLoop(n)})}dataMessage(e){if(!this._fin){this._state=RE;return}let n=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let s;this._binaryType==="nodebuffer"?s=f5e(r,n):this._binaryType==="arraybuffer"?s=NBr(f5e(r,n)):this._binaryType==="blob"?s=new Blob(r):s=r,this._allowSynchronousEvents?(this.emit("message",s,!0),this._state=RE):(this._state=Efe,setImmediate(()=>{this.emit("message",s,!0),this._state=RE,this.startLoop(e)}))}else{let s=f5e(r,n);if(!this._skipUTF8Validation&&!nqt(s)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(i);return}this._state===A5e||this._allowSynchronousEvents?(this.emit("message",s,!1),this._state=RE):(this._state=Efe,setImmediate(()=>{this.emit("message",s,!1),this._state=RE,this.startLoop(e)}))}}controlMessage(e,n){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,tqt),this.end();else{let r=e.readUInt16BE(0);if(!BBr(r)){let i=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(i);return}let s=new yfe(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!nqt(s)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(i);return}this._loop=!1,this.emit("conclude",r,s),this.end()}this._state=RE;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=RE):(this._state=Efe,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=RE,this.startLoop(n)}))}createError(e,n,r,s,i){this._loop=!1,this._errored=!0;let o=new e(r?`Invalid WebSocket frame: ${n}`:n);return Error.captureStackTrace(o,this.createError),o.code=i,o[RBr]=s,o}};oqt.exports=y5e});var S5e=ee((pao,lqt)=>{"use strict";p();var{Duplex:dao}=require("stream"),{randomFillSync:PBr}=require("crypto"),{types:{isUint8Array:OBr}}=require("util"),aqt=gq(),{EMPTY_BUFFER:MBr,kWebSocket:LBr,NOOP:FBr}=aw(),{isBlob:yq,isValidStatusCode:QBr}=Aq(),{mask:cqt,toBuffer:dO}=KK(),kE=Symbol("kByteLength"),UBr=Buffer.alloc(4),bfe=8*1024,pO,Eq=bfe,P_=0,$Br=1,GBr=2,b5e=class t{constructor(e,n,r){this._extensions=n||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=P_,this.onerror=FBr,this[LBr]=void 0}static frame(e,n){let r,s=!1,i=2,o=!1;n.mask&&(r=n.maskBuffer||UBr,n.generateMask?n.generateMask(r):(Eq===bfe&&(pO===void 0&&(pO=Buffer.alloc(bfe)),PBr(pO,0,bfe),Eq=0),r[0]=pO[Eq++],r[1]=pO[Eq++],r[2]=pO[Eq++],r[3]=pO[Eq++]),o=(r[0]|r[1]|r[2]|r[3])===0,i=6);let a;typeof e=="string"?(!n.mask||o)&&n[kE]!==void 0?a=n[kE]:(e=Buffer.from(e),a=e.length):(a=e.length,s=n.mask&&n.readOnly&&!o);let c=a;a>=65536?(i+=8,c=127):a>125&&(i+=2,c=126);let u=Buffer.allocUnsafe(s?a+i:i);return u[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),n.mask?(u[1]|=128,u[i-4]=r[0],u[i-3]=r[1],u[i-2]=r[2],u[i-1]=r[3],o?[u,e]:s?(cqt(e,r,u,i,a),[u]):(cqt(e,r,e,0,a),[u,e])):[u,e]}close(e,n,r,s){let i;if(e===void 0)i=MBr;else{if(typeof e!="number"||!QBr(e))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(e,0);else{let a=Buffer.byteLength(n);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(i=Buffer.allocUnsafe(2+a),i.writeUInt16BE(e,0),typeof n=="string")i.write(n,2);else if(OBr(n))i.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let o={[kE]:i.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==P_?this.enqueue([this.dispatch,i,!1,o,s]):this.sendFrame(t.frame(i,o),s)}ping(e,n,r){let s,i;if(typeof e=="string"?(s=Buffer.byteLength(e),i=!1):yq(e)?(s=e.size,i=!1):(e=dO(e),s=e.length,i=dO.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[kE]:s,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};yq(e)?this._state!==P_?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==P_?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(t.frame(e,o),r)}pong(e,n,r){let s,i;if(typeof e=="string"?(s=Buffer.byteLength(e),i=!1):yq(e)?(s=e.size,i=!1):(e=dO(e),s=e.length,i=dO.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[kE]:s,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};yq(e)?this._state!==P_?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==P_?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(t.frame(e,o),r)}send(e,n,r){let s=this._extensions[aqt.extensionName],i=n.binary?2:1,o=n.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):yq(e)?(a=e.size,c=!1):(e=dO(e),a=e.length,c=dO.readOnly),this._firstFragment?(this._firstFragment=!1,o&&s&&s.params[s._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=s._threshold),this._compress=o):(o=!1,i=0),n.fin&&(this._firstFragment=!0);let u={[kE]:a,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:o};yq(e)?this._state!==P_?this.enqueue([this.getBlobData,e,this._compress,u,r]):this.getBlobData(e,this._compress,u,r):this._state!==P_?this.enqueue([this.dispatch,e,this._compress,u,r]):this.dispatch(e,this._compress,u,r)}getBlobData(e,n,r,s){this._bufferedBytes+=r[kE],this._state=GBr,e.arrayBuffer().then(i=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(_5e,this,a,s);return}this._bufferedBytes-=r[kE];let o=dO(i);n?this.dispatch(o,n,r,s):(this._state=P_,this.sendFrame(t.frame(o,r),s),this.dequeue())}).catch(i=>{process.nextTick(WBr,this,i,s)})}dispatch(e,n,r,s){if(!n){this.sendFrame(t.frame(e,r),s);return}let i=this._extensions[aqt.extensionName];this._bufferedBytes+=r[kE],this._state=$Br,i.compress(e,r.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");_5e(this,c,s);return}this._bufferedBytes-=r[kE],this._state=P_,r.readOnly=!1,this.sendFrame(t.frame(a,r),s),this.dequeue()})}dequeue(){for(;this._state===P_&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][kE],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][kE],this._queue.push(e)}sendFrame(e,n){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],n),this._socket.uncork()):this._socket.write(e[0],n)}};lqt.exports=b5e;function _5e(t,e,n){typeof n=="function"&&n(e);for(let r=0;r{"use strict";p();var{kForOnEventAttribute:JK,kListener:C5e}=aw(),uqt=Symbol("kCode"),dqt=Symbol("kData"),pqt=Symbol("kError"),hqt=Symbol("kMessage"),mqt=Symbol("kReason"),bq=Symbol("kTarget"),fqt=Symbol("kType"),gqt=Symbol("kWasClean"),lw=class{constructor(e){this[bq]=null,this[fqt]=e}get target(){return this[bq]}get type(){return this[fqt]}};Object.defineProperty(lw.prototype,"target",{enumerable:!0});Object.defineProperty(lw.prototype,"type",{enumerable:!0});var hO=class extends lw{constructor(e,n={}){super(e),this[uqt]=n.code===void 0?0:n.code,this[mqt]=n.reason===void 0?"":n.reason,this[gqt]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[uqt]}get reason(){return this[mqt]}get wasClean(){return this[gqt]}};Object.defineProperty(hO.prototype,"code",{enumerable:!0});Object.defineProperty(hO.prototype,"reason",{enumerable:!0});Object.defineProperty(hO.prototype,"wasClean",{enumerable:!0});var _q=class extends lw{constructor(e,n={}){super(e),this[pqt]=n.error===void 0?null:n.error,this[hqt]=n.message===void 0?"":n.message}get error(){return this[pqt]}get message(){return this[hqt]}};Object.defineProperty(_q.prototype,"error",{enumerable:!0});Object.defineProperty(_q.prototype,"message",{enumerable:!0});var XK=class extends lw{constructor(e,n={}){super(e),this[dqt]=n.data===void 0?null:n.data}get data(){return this[dqt]}};Object.defineProperty(XK.prototype,"data",{enumerable:!0});var qBr={addEventListener(t,e,n={}){for(let s of this.listeners(t))if(!n[JK]&&s[C5e]===e&&!s[JK])return;let r;if(t==="message")r=function(i,o){let a=new XK("message",{data:o?i:i.toString()});a[bq]=this,_fe(e,this,a)};else if(t==="close")r=function(i,o){let a=new hO("close",{code:i,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[bq]=this,_fe(e,this,a)};else if(t==="error")r=function(i){let o=new _q("error",{error:i,message:i.message});o[bq]=this,_fe(e,this,o)};else if(t==="open")r=function(){let i=new lw("open");i[bq]=this,_fe(e,this,i)};else return;r[JK]=!!n[JK],r[C5e]=e,n.once?this.once(t,r):this.on(t,r)},removeEventListener(t,e){for(let n of this.listeners(t))if(n[C5e]===e&&!n[JK]){this.removeListener(t,n);break}}};Aqt.exports={CloseEvent:hO,ErrorEvent:_q,Event:lw,EventTarget:qBr,MessageEvent:XK};function _fe(t,e,n){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,n):t.call(e,n)}});var Sfe=ee((gao,Eqt)=>{"use strict";p();var{tokenChars:ZK}=Aq();function TC(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}function HBr(t){let e=Object.create(null),n=Object.create(null),r=!1,s=!1,i=!1,o,a,c=-1,u=-1,l=-1,d=0;for(;d{let n=t[e];return Array.isArray(n)||(n=[n]),n.map(r=>[e].concat(Object.keys(r).map(s=>{let i=r[s];return Array.isArray(i)||(i=[i]),i.map(o=>o===!0?s:`${s}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Eqt.exports={format:VBr,parse:HBr}});var wfe=ee((bao,Nqt)=>{"use strict";p();var jBr=require("events"),YBr=require("https"),KBr=require("http"),Sqt=require("net"),zBr=require("tls"),{randomBytes:JBr,createHash:XBr}=require("crypto"),{Duplex:yao,Readable:Eao}=require("stream"),{URL:I5e}=require("url"),Bk=gq(),ZBr=E5e(),ePr=S5e(),{isBlob:tPr}=Aq(),{BINARY_TYPES:bqt,CLOSE_TIMEOUT:nPr,EMPTY_BUFFER:Cfe,GUID:rPr,kForOnEventAttribute:x5e,kListener:sPr,kStatusCode:iPr,kWebSocket:Zd,NOOP:Cqt}=aw(),{EventTarget:{addEventListener:oPr,removeEventListener:aPr}}=yqt(),{format:cPr,parse:lPr}=Sfe(),{toBuffer:uPr}=KK(),Iqt=Symbol("kAborted"),w5e=[8,13],uw=["CONNECTING","OPEN","CLOSING","CLOSED"],dPr=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Lc=class t extends jBr{constructor(e,n,r){super(),this._binaryType=bqt[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Cfe,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n=="object"&&n!==null?(r=n,n=[]):n=[n]),xqt(this,e,n,r)):(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){bqt.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,n,r){let s=new ZBr({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),i=new ePr(e,this._extensions,r.generateMask);this._receiver=s,this._sender=i,this._socket=e,s[Zd]=this,i[Zd]=this,e[Zd]=this,s.on("conclude",mPr),s.on("drain",fPr),s.on("error",gPr),s.on("message",APr),s.on("ping",yPr),s.on("pong",EPr),i.onerror=bPr,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),n.length>0&&e.unshift(n),e.on("close",vqt),e.on("data",xfe),e.on("end",Rqt),e.on("error",kqt),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Bk.extensionName]&&this._extensions[Bk.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,n){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){xA(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,n,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Tqt(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,n,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){T5e(this,e,r);return}n===void 0&&(n=!this._isServer),this._sender.ping(e||Cfe,n,r)}pong(e,n,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){T5e(this,e,r);return}n===void 0&&(n=!this._isServer),this._sender.pong(e||Cfe,n,r)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,n,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"&&(r=n,n={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){T5e(this,e,r);return}let s={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[Bk.extensionName]||(s.compress=!1),this._sender.send(e||Cfe,s,r)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){xA(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(Lc,"CONNECTING",{enumerable:!0,value:uw.indexOf("CONNECTING")});Object.defineProperty(Lc.prototype,"CONNECTING",{enumerable:!0,value:uw.indexOf("CONNECTING")});Object.defineProperty(Lc,"OPEN",{enumerable:!0,value:uw.indexOf("OPEN")});Object.defineProperty(Lc.prototype,"OPEN",{enumerable:!0,value:uw.indexOf("OPEN")});Object.defineProperty(Lc,"CLOSING",{enumerable:!0,value:uw.indexOf("CLOSING")});Object.defineProperty(Lc.prototype,"CLOSING",{enumerable:!0,value:uw.indexOf("CLOSING")});Object.defineProperty(Lc,"CLOSED",{enumerable:!0,value:uw.indexOf("CLOSED")});Object.defineProperty(Lc.prototype,"CLOSED",{enumerable:!0,value:uw.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(Lc.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(Lc.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[x5e])return e[sPr];return null},set(e){for(let n of this.listeners(t))if(n[x5e]){this.removeListener(t,n);break}typeof e=="function"&&this.addEventListener(t,e,{[x5e]:!0})}})});Lc.prototype.addEventListener=oPr;Lc.prototype.removeEventListener=aPr;Nqt.exports=Lc;function xqt(t,e,n,r){let s={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:nPr,protocolVersion:w5e[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=s.autoPong,t._closeTimeout=s.closeTimeout,!w5e.includes(s.protocolVersion))throw new RangeError(`Unsupported protocol version: ${s.protocolVersion} (supported versions: ${w5e.join(", ")})`);let i;if(e instanceof I5e)i=e;else try{i=new I5e(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),t._url=i.href;let o=i.protocol==="wss:",a=i.protocol==="ws+unix:",c;if(i.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!i.pathname?c="The URL's pathname is empty":i.hash&&(c="The URL contains a fragment identifier"),c){let g=new SyntaxError(c);if(t._redirects===0)throw g;Ife(t,g);return}let u=o?443:80,l=JBr(16).toString("base64"),d=o?YBr.request:KBr.request,h=new Set,m;if(s.createConnection=s.createConnection||(o?hPr:pPr),s.defaultPort=s.defaultPort||u,s.port=i.port||u,s.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,s.headers={...s.headers,"Sec-WebSocket-Version":s.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},s.path=i.pathname+i.search,s.timeout=s.handshakeTimeout,s.perMessageDeflate&&(m=new Bk({...s.perMessageDeflate,isServer:!1,maxPayload:s.maxPayload}),s.headers["Sec-WebSocket-Extensions"]=cPr({[Bk.extensionName]:m.offer()})),n.length){for(let g of n){if(typeof g!="string"||!dPr.test(g)||h.has(g))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(g)}s.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(s.origin&&(s.protocolVersion<13?s.headers["Sec-WebSocket-Origin"]=s.origin:s.headers.Origin=s.origin),(i.username||i.password)&&(s.auth=`${i.username}:${i.password}`),a){let g=s.path.split(":");s.socketPath=g[0],s.path=g[1]}let f;if(s.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=o,t._originalHostOrSocketPath=a?s.socketPath:i.host;let g=r&&r.headers;if(r={...r,headers:{}},g)for(let[A,y]of Object.entries(g))r.headers[A.toLowerCase()]=y}else if(t.listenerCount("redirect")===0){let g=a?t._originalIpc?s.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:i.host===t._originalHostOrSocketPath;(!g||t._originalSecure&&!o)&&(delete s.headers.authorization,delete s.headers.cookie,g||delete s.headers.host,s.auth=void 0)}s.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(s.auth).toString("base64")),f=t._req=d(s),t._redirects&&t.emit("redirect",t.url,f)}else f=t._req=d(s);s.timeout&&f.on("timeout",()=>{xA(t,f,"Opening handshake has timed out")}),f.on("error",g=>{f===null||f[Iqt]||(f=t._req=null,Ife(t,g))}),f.on("response",g=>{let A=g.headers.location,y=g.statusCode;if(A&&s.followRedirects&&y>=300&&y<400){if(++t._redirects>s.maxRedirects){xA(t,f,"Maximum redirects exceeded");return}f.abort();let b;try{b=new I5e(A,e)}catch{let C=new SyntaxError(`Invalid URL: ${A}`);Ife(t,C);return}xqt(t,b,n,r)}else t.emit("unexpected-response",f,g)||xA(t,f,`Unexpected server response: ${g.statusCode}`)}),f.on("upgrade",(g,A,y)=>{if(t.emit("upgrade",g),t.readyState!==Lc.CONNECTING)return;f=t._req=null;let b=g.headers.upgrade;if(b===void 0||b.toLowerCase()!=="websocket"){xA(t,A,"Invalid Upgrade header");return}let S=XBr("sha1").update(l+rPr).digest("base64");if(g.headers["sec-websocket-accept"]!==S){xA(t,A,"Invalid Sec-WebSocket-Accept header");return}let C=g.headers["sec-websocket-protocol"],I;if(C!==void 0?h.size?h.has(C)||(I="Server sent an invalid subprotocol"):I="Server sent a subprotocol but none was requested":h.size&&(I="Server sent no subprotocol"),I){xA(t,A,I);return}C&&(t._protocol=C);let x=g.headers["sec-websocket-extensions"];if(x!==void 0){if(!m){xA(t,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let w;try{w=lPr(x)}catch{xA(t,A,"Invalid Sec-WebSocket-Extensions header");return}let R=Object.keys(w);if(R.length!==1||R[0]!==Bk.extensionName){xA(t,A,"Server indicated an extension that was not requested");return}try{m.accept(w[Bk.extensionName])}catch{xA(t,A,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[Bk.extensionName]=m}t.setSocket(A,y,{allowSynchronousEvents:s.allowSynchronousEvents,generateMask:s.generateMask,maxBufferedChunks:s.maxBufferedChunks,maxFragments:s.maxFragments,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation})}),s.finishRequest?s.finishRequest(f,t):f.end()}function Ife(t,e){t._readyState=Lc.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function pPr(t){return t.path=t.socketPath,Sqt.connect(t)}function hPr(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Sqt.isIP(t.host)?"":t.host),zBr.connect(t)}function xA(t,e,n){t._readyState=Lc.CLOSING;let r=new Error(n);Error.captureStackTrace(r,xA),e.setHeader?(e[Iqt]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Ife,t,r)):(e.destroy(r),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function T5e(t,e,n){if(e){let r=tPr(e)?e.size:uPr(e).length;t._socket?t._sender._bufferedBytes+=r:t._bufferedAmount+=r}if(n){let r=new Error(`WebSocket is not open: readyState ${t.readyState} (${uw[t.readyState]})`);process.nextTick(n,r)}}function mPr(t,e){let n=this[Zd];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,n._socket[Zd]!==void 0&&(n._socket.removeListener("data",xfe),process.nextTick(wqt,n._socket),t===1005?n.close():n.close(t,e))}function fPr(){let t=this[Zd];t.isPaused||t._socket.resume()}function gPr(t){let e=this[Zd];e._socket[Zd]!==void 0&&(e._socket.removeListener("data",xfe),process.nextTick(wqt,e._socket),e.close(t[iPr])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function _qt(){this[Zd].emitClose()}function APr(t,e){this[Zd].emit("message",t,e)}function yPr(t){let e=this[Zd];e._autoPong&&e.pong(t,!this._isServer,Cqt),e.emit("ping",t)}function EPr(t){this[Zd].emit("pong",t)}function wqt(t){t.resume()}function bPr(t){let e=this[Zd];e.readyState!==Lc.CLOSED&&(e.readyState===Lc.OPEN&&(e._readyState=Lc.CLOSING,Tqt(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function Tqt(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function vqt(){let t=this[Zd];if(this.removeListener("close",vqt),this.removeListener("data",xfe),this.removeListener("end",Rqt),t._readyState=Lc.CLOSING,!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);t._receiver.write(e)}t._receiver.end(),this[Zd]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",_qt),t._receiver.on("finish",_qt))}function xfe(t){this[Zd]._receiver.write(t)||this.pause()}function Rqt(){let t=this[Zd];t._readyState=Lc.CLOSING,t._receiver.end(),this.end()}function kqt(){let t=this[Zd];this.removeListener("error",kqt),this.on("error",Cqt),t&&(t._readyState=Lc.CLOSING,this.destroy())}});var Oqt=ee((Cao,Pqt)=>{"use strict";p();var Sao=wfe(),{Duplex:_Pr}=require("stream");function Dqt(t){t.emit("close")}function SPr(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Bqt(t){this.removeListener("error",Bqt),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function CPr(t,e){let n=!0,r=new _Pr({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(i,o){let a=!o&&r._readableState.objectMode?i.toString():i;r.push(a)||t.pause()}),t.once("error",function(i){r.destroyed||(n=!1,r.destroy(i))}),t.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(s,i){if(t.readyState===t.CLOSED){i(s),process.nextTick(Dqt,r);return}let o=!1;t.once("error",function(c){o=!0,i(c)}),t.once("close",function(){o||i(s),process.nextTick(Dqt,r)}),n&&t.terminate()},r._final=function(s){if(t.readyState===t.CONNECTING){t.once("open",function(){r._final(s)});return}t._socket!==null&&(t._socket._writableState.finished?(s(),r._readableState.endEmitted&&r.destroy()):(t._socket.once("finish",function(){s()}),t.close()))},r._read=function(){t.isPaused&&t.resume()},r._write=function(s,i,o){if(t.readyState===t.CONNECTING){t.once("open",function(){r._write(s,i,o)});return}t.send(s,o)},r.on("end",SPr),r.on("error",Bqt),r}Pqt.exports=CPr});var v5e=ee((xao,Mqt)=>{"use strict";p();var{tokenChars:IPr}=Aq();function xPr(t){let e=new Set,n=-1,r=-1,s=0;for(s;s{"use strict";p();var wPr=require("events"),Tfe=require("http"),{Duplex:Tao}=require("stream"),{createHash:TPr}=require("crypto"),Lqt=Sfe(),mO=gq(),vPr=v5e(),RPr=wfe(),{CLOSE_TIMEOUT:kPr,GUID:NPr,kWebSocket:DPr}=aw(),BPr=/^[+/0-9A-Za-z]{22}==$/,Fqt=0,Qqt=1,$qt=2,R5e=class extends wPr{constructor(e,n){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:kPr,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:RPr,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Tfe.createServer((r,s)=>{let i=Tfe.STATUS_CODES[426];s.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),s.end(i)}),this._server.listen(e.port,e.host,e.backlog,n)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=PPr(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(s,i,o)=>{this.handleUpgrade(s,i,o,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Fqt}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===$qt){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(ez,this);return}if(e&&this.once("close",e),this._state!==Qqt)if(this._state=Qqt,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(ez,this):process.nextTick(ez,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{ez(this)})}}shouldHandle(e){if(this.options.path){let n=e.url.indexOf("?");if((n!==-1?e.url.slice(0,n):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,n,r,s){n.on("error",Uqt);let i=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){fO(this,e,n,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){fO(this,e,n,400,"Invalid Upgrade header");return}if(i===void 0||!BPr.test(i)){fO(this,e,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){fO(this,e,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){tz(n,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=vPr.parse(c)}catch{fO(this,e,n,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let h=new mO({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let m=Lqt.parse(l);m[mO.extensionName]&&(h.accept(m[mO.extensionName]),d[mO.extensionName]=h)}catch{fO(this,e,n,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(m,f,g,A)=>{if(!m)return tz(n,f||401,g,A);this.completeUpgrade(d,i,u,e,n,r,s)});return}if(!this.options.verifyClient(h))return tz(n,401)}this.completeUpgrade(d,i,u,e,n,r,s)}completeUpgrade(e,n,r,s,i,o,a){if(!i.readable||!i.writable)return i.destroy();if(i[DPr])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Fqt)return tz(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${TPr("sha1").update(n+NPr).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(r.size){let d=this.options.handleProtocols?this.options.handleProtocols(r,s):r.values().next().value;d&&(u.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(e[mO.extensionName]){let d=e[mO.extensionName].params,h=Lqt.format({[mO.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${h}`),l._extensions=e}this.emit("headers",u,s),i.write(u.concat(`\r +https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var Tze=class{checkIsGCE=void 0;useJWTAccessWithScope;defaultServicePath;get isGCE(){return this.checkIsGCE}_findProjectIdPromise;_cachedProjectId;jsonContent=null;apiKey;cachedCredential=null;#e=null;defaultScopes;keyFilename;scopes;clientOptions={};constructor(e={}){if(this._cachedProjectId=e.projectId||null,this.cachedCredential=e.authClient||null,this.keyFilename=e.keyFilename||e.keyFile,this.scopes=e.scopes,this.clientOptions=e.clientOptions||{},this.jsonContent=e.credentials||null,this.apiKey=e.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(wx.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);e.universeDomain&&(this.clientOptions.universeDomain=e.universeDomain)}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath,e.useJWTAccessWithScope=this.useJWTAccessWithScope,e.defaultScopes=this.defaultScopes}getProjectId(e){if(e)this.getProjectIdAsync().then(n=>e(null,n),e);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===wx.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw e}}async findAndCacheProjectId(){let e=null;if(e||=await this.getProductionProjectId(),e||=await this.getFileProjectId(),e||=await this.getDefaultServiceProjectId(),e||=await this.getGCEProjectId(),e||=await this.getExternalAccountClientProjectId(),e)return this._cachedProjectId=e,e;throw new Error(wx.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){let e;try{e=await cZ.universe("universe-domain"),e||=Ize.DEFAULT_UNIVERSE}catch(n){if(n&&n?.response?.status===404)e=Ize.DEFAULT_UNIVERSE;else throw n}return e}async getUniverseDomain(){let e=(0,men.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Ize.DEFAULT_UNIVERSE}return e}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},n){let r;if(typeof e=="function"?n=e:r=e,n)this.getApplicationDefaultAsync(r).then(i=>n(null,i.credential,i.projectId),n);else return this.getApplicationDefaultAsync(r)}async getApplicationDefaultAsync(e={}){if(this.cachedCredential)return await this.#t(this.cachedCredential,null);let n;if(n=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e),n)return n instanceof N3.JWT?n.scopes=this.scopes:n instanceof lZ.BaseExternalAccountClient&&(n.scopes=this.getAnyScopes()),await this.#t(n);if(n=await this._tryGetApplicationCredentialsFromWellKnownFile(e),n)return n instanceof N3.JWT?n.scopes=this.scopes:n instanceof lZ.BaseExternalAccountClient&&(n.scopes=this.getAnyScopes()),await this.#t(n);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new xii.Compute(e));throw new Error(wx.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async#t(e,n=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let r=await this.getProjectIdOptional();return n&&(e.quotaProjectId=n),this.cachedCredential=e,{credential:e,projectId:r}}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=cZ.getGCPResidency()||await cZ.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){let n=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!n||n.length===0)return null;try{return await this._getApplicationCredentialsFromFilePath(n,e)}catch(r){throw r instanceof Error&&(r.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${r.message}`),r}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let n=process.env.CLOUDSDK_CONFIG;if(!n)if(this._isWindows())process.env.APPDATA&&(n=pbe.join(process.env.APPDATA,"gcloud"));else{let s=process.env.HOME;s&&(n=pbe.join(s,".config","gcloud"))}if(!n)return null;let r=pbe.join(n,"application_default_credentials.json");return aZ.existsSync(r)?await this._getApplicationCredentialsFromFilePath(r,e):null}async _getApplicationCredentialsFromFilePath(e,n={}){if(!e||e.length===0)throw new Error("The file path is invalid.");try{if(e=aZ.realpathSync(e),!aZ.lstatSync(e).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let r=aZ.createReadStream(e);return this.fromStream(r,n)}fromImpersonatedJSON(e){if(!e)throw new Error("Must pass in a JSON object containing an impersonated refresh token");if(e.type!==D3.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${D3.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!e.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!e.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let n=this.fromJSON(e.source_credentials);if(e.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${e.service_account_impersonation_url}`);let r=/(?[^/]+):(generateAccessToken|generateIdToken)$/.exec(e.service_account_impersonation_url)?.groups?.target;if(!r)throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`);let i=(this.scopes||e.scopes||this.defaultScopes)??[];return new D3.Impersonated({...e,sourceClient:n,targetPrincipal:r,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,n={}){let r,i=(0,men.originalOrCamelOptions)(n).get("universe_domain");return e.type===den.USER_REFRESH_ACCOUNT_TYPE?(r=new den.UserRefreshClient(n),r.fromJSON(e)):e.type===D3.IMPERSONATED_ACCOUNT_TYPE?r=this.fromImpersonatedJSON(e):e.type===lZ.EXTERNAL_ACCOUNT_TYPE?(r=Iii.ExternalAccountClient.fromJSON({...e,...n}),r.scopes=this.getAnyScopes()):e.type===pen.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?r=new pen.ExternalAccountAuthorizedUserClient({...e,...n}):e.type===wze.GDCH_SERVICE_ACCOUNT_TYPE?(r=new wze.GdchClient(n),r.fromJSON(e)):(n.scopes=this.scopes,r=new N3.JWT(n),this.setGapicJWTValues(r),r.fromJSON(e)),i&&(r.universeDomain=i),r}_cacheClientFromJSON(e,n){let r=this.fromJSON(e,n);return this.jsonContent=e,this.cachedCredential=r,r}fromStream(e,n={},r){let i={};if(typeof n=="function"?r=n:i=n,r)this.fromStreamAsync(e,i).then(s=>r(null,s),r);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,n){return new Promise((r,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",o=>s.push(o)).on("end",()=>{try{try{let o=JSON.parse(s.join("")),a=this._cacheClientFromJSON(o,n);return r(a)}catch(o){if(!this.keyFilename)throw o;let a=new N3.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=a,this.setGapicJWTValues(a),r(a)}}catch(o){return i(o)}})})}fromAPIKey(e,n={}){return new N3.JWT({...n,apiKey:e})}_isWindows(){let e=bii.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,yii.exec)("gcloud config config-helper --format json",(n,r)=>{if(!n&&r)try{let i=JSON.parse(r).configuration.properties.core.project;e(i);return}catch{}e(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let n=await this.getClient();if(n&&n.projectId)return n.projectId}let e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return e?e.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==lZ.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await cZ.project("project-id")}catch{return null}}getCredentials(e){if(e)this.getCredentialsAsync().then(n=>e(null,n),e);else return this.getCredentialsAsync()}async getCredentialsAsync(){let e=await this.getClient();if(e instanceof D3.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof lZ.BaseExternalAccountClient){let n=e.getServiceAccountEmail();if(n)return{client_email:n,universe_domain:e.universeDomain}}if(this.jsonContent)return{client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key,universe_domain:this.jsonContent.universe_domain};if(await this._checkIsGCE()){let[n,r]=await Promise.all([cZ.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:n,universe_domain:r}}throw new Error(wx.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND)}async getClient(){if(this.cachedCredential)return this.cachedCredential;this.#e=this.#e||this.#n();try{let e=await this.#e;if(e instanceof wze.GdchClient&&!e.apiAudience){let n=this.clientOptions,r=n.apiEndpoint||n.servicePath;if(r){let s=`${r.startsWith("http")?"":"https://"}${r}`.replace(/\/+$/,""),o=e.createWithGdchAudience(s);return this.cachedCredential=o,o}}return e}finally{this.#e=null}}async#n(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);if(this.keyFilename){let e=pbe.resolve(this.keyFilename),n=aZ.createReadStream(e);return await this.fromStreamAsync(n,this.clientOptions)}else if(this.apiKey){let e=await this.fromAPIKey(this.apiKey,this.clientOptions);e.scopes=this.scopes;let{credential:n}=await this.#t(e);return n}else{let{credential:e}=await this.getApplicationDefaultAsync(this.clientOptions);return e}}async getIdTokenClient(e){let n=await this.getClient();if(!("fetchIdToken"in n))throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.");return new Sii.IdTokenClient({targetAudience:e,idTokenProvider:n})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(e){return(await this.getClient()).getRequestHeaders(e)}async authorizeRequest(e={}){let n=e.url,i=await(await this.getClient()).getRequestHeaders(n);return e.headers=Eii.Gaxios.mergeHeaders(e.headers,i),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,Cii.getEnv)()}async sign(e,n){let r=await this.getClient(),i=await this.getUniverseDomain();if(n=n||`https://iamcredentials.${i}/v1/projects/-/serviceAccounts/`,r instanceof D3.Impersonated)return(await r.sign(e)).signedBlob;let s=(0,_ii.createCrypto)();if(r instanceof N3.JWT&&r.key)return await s.sign(r.key,e);let o=await this.getCredentials();if(!o.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,o.client_email,e,n)}async signBlob(e,n,r,i){let s=new URL(i+`${n}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(r)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};wx.GoogleAuth=Tze});var fen=re(mbe=>{"use strict";p();Object.defineProperty(mbe,"__esModule",{value:!0});mbe.IAMAuth=void 0;var vze=class{selector;token;constructor(e,n){this.selector=e,this.token=n,this.selector=e,this.token=n}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};mbe.IAMAuth=vze});var gen=re(wI=>{"use strict";p();Object.defineProperty(wI,"__esModule",{value:!0});wI.DownscopedClient=wI.EXPIRATION_TIME_OFFSET=wI.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var wii=Um(),Tii=require("stream"),Rze=Hy(),vii=j0e(),Rii="urn:ietf:params:oauth:grant-type:token-exchange",kii="urn:ietf:params:oauth:token-type:access_token",Bii="urn:ietf:params:oauth:token-type:access_token";wI.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;wI.EXPIRATION_TIME_OFFSET=300*1e3;var kze=class extends Rze.AuthClient{authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,n={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Rze.AuthClient?{}:e),e instanceof Rze.AuthClient?(this.authClient=e,this.credentialAccessBoundary=n):(this.authClient=e.authClient,this.credentialAccessBoundary=e.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>wI.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${wI.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let r of this.credentialAccessBoundary.accessBoundary.accessBoundaryRules)if(r.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new vii.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(e){if(!e.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(e),this.cachedDownscopedAccessToken=e}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),n=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(n)}request(e,n){if(n)this.requestAsync(e).then(r=>n(null,r),r=>n(r,r.response));else return this.requestAsync(e)}async requestAsync(e,n=!1){let r;try{let i=await this.getRequestHeaders();e.headers=wii.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),r=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let o=s.status,a=s.config.data instanceof Tii.Readable;if(!n&&(o===401||o===403)&&!a&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return r}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,n={grantType:Rii,requestedTokenType:kii,subjectToken:e,subjectTokenType:Bii},r=await this.stsCredential.exchangeToken(n,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,s=r.expires_in?new Date().getTime()+r.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:r.access_token,expiry_date:s,res:r.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let n=new Date().getTime();return e.expiry_date?n>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};wI.DownscopedClient=kze});var Aen=re(hbe=>{"use strict";p();Object.defineProperty(hbe,"__esModule",{value:!0});hbe.PassThroughClient=void 0;var Nii=Hy(),Bze=class extends Nii.AuthClient{async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};hbe.PassThroughClient=Bze});var Sen=re(hr=>{"use strict";p();var Dii=hr&&hr.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Pii=hr&&hr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Dii(e,t,n)};Object.defineProperty(hr,"__esModule",{value:!0});hr.GoogleAuth=hr.auth=hr.GDCH_SERVICE_ACCOUNT_TYPE=hr.GdchClient=hr.PassThroughClient=hr.ExternalAccountAuthorizedUserClient=hr.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=hr.ExecutableError=hr.PluggableAuthClient=hr.DownscopedClient=hr.BaseExternalAccountClient=hr.ExternalAccountClient=hr.IdentityPoolClient=hr.AwsRequestSigner=hr.AwsClient=hr.UserRefreshClient=hr.LoginTicket=hr.ClientAuthentication=hr.OAuth2Client=hr.CodeChallengeMethod=hr.Impersonated=hr.JWT=hr.JWTAccess=hr.IdTokenClient=hr.IAMAuth=hr.GCPEnv=hr.Compute=hr.DEFAULT_UNIVERSE=hr.AuthClient=hr.gaxios=hr.gcpMetadata=void 0;var yen=hen();Object.defineProperty(hr,"GoogleAuth",{enumerable:!0,get:function(){return yen.GoogleAuth}});hr.gcpMetadata=zX();hr.gaxios=Um();var Een=Hy();Object.defineProperty(hr,"AuthClient",{enumerable:!0,get:function(){return Een.AuthClient}});Object.defineProperty(hr,"DEFAULT_UNIVERSE",{enumerable:!0,get:function(){return Een.DEFAULT_UNIVERSE}});var Mii=u6e();Object.defineProperty(hr,"Compute",{enumerable:!0,get:function(){return Mii.Compute}});var Oii=m6e();Object.defineProperty(hr,"GCPEnv",{enumerable:!0,get:function(){return Oii.GCPEnv}});var Lii=fen();Object.defineProperty(hr,"IAMAuth",{enumerable:!0,get:function(){return Lii.IAMAuth}});var Fii=p6e();Object.defineProperty(hr,"IdTokenClient",{enumerable:!0,get:function(){return Fii.IdTokenClient}});var Qii=O6e();Object.defineProperty(hr,"JWTAccess",{enumerable:!0,get:function(){return Qii.JWTAccess}});var Uii=F6e();Object.defineProperty(hr,"JWT",{enumerable:!0,get:function(){return Uii.JWT}});var Gii=$6e();Object.defineProperty(hr,"Impersonated",{enumerable:!0,get:function(){return Gii.Impersonated}});var Nze=pN();Object.defineProperty(hr,"CodeChallengeMethod",{enumerable:!0,get:function(){return Nze.CodeChallengeMethod}});Object.defineProperty(hr,"OAuth2Client",{enumerable:!0,get:function(){return Nze.OAuth2Client}});Object.defineProperty(hr,"ClientAuthentication",{enumerable:!0,get:function(){return Nze.ClientAuthentication}});var $ii=o6e();Object.defineProperty(hr,"LoginTicket",{enumerable:!0,get:function(){return $ii.LoginTicket}});var Wii=U6e();Object.defineProperty(hr,"UserRefreshClient",{enumerable:!0,get:function(){return Wii.UserRefreshClient}});var Hii=aze();Object.defineProperty(hr,"AwsClient",{enumerable:!0,get:function(){return Hii.AwsClient}});var qii=ize();Object.defineProperty(hr,"AwsRequestSigner",{enumerable:!0,get:function(){return qii.AwsRequestSigner}});var jii=nze();Object.defineProperty(hr,"IdentityPoolClient",{enumerable:!0,get:function(){return jii.IdentityPoolClient}});var Vii=Eze();Object.defineProperty(hr,"ExternalAccountClient",{enumerable:!0,get:function(){return Vii.ExternalAccountClient}});var Yii=fN();Object.defineProperty(hr,"BaseExternalAccountClient",{enumerable:!0,get:function(){return Yii.BaseExternalAccountClient}});var zii=gen();Object.defineProperty(hr,"DownscopedClient",{enumerable:!0,get:function(){return zii.DownscopedClient}});var ben=Aze();Object.defineProperty(hr,"PluggableAuthClient",{enumerable:!0,get:function(){return ben.PluggableAuthClient}});Object.defineProperty(hr,"ExecutableError",{enumerable:!0,get:function(){return ben.ExecutableError}});var _en=xze();Object.defineProperty(hr,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:function(){return _en.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE}});Object.defineProperty(hr,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:function(){return _en.ExternalAccountAuthorizedUserClient}});var Kii=Aen();Object.defineProperty(hr,"PassThroughClient",{enumerable:!0,get:function(){return Kii.PassThroughClient}});var xen=Cze();Object.defineProperty(hr,"GdchClient",{enumerable:!0,get:function(){return xen.GdchClient}});Object.defineProperty(hr,"GDCH_SERVICE_ACCOUNT_TYPE",{enumerable:!0,get:function(){return xen.GDCH_SERVICE_ACCOUNT_TYPE}});Pii(P6e(),hr);var Jii=new yen.GoogleAuth;hr.auth=Jii});var vv=re((l$o,wen)=>{"use strict";p();var Cen=["nodebuffer","arraybuffer","fragments"],Ien=typeof Blob<"u";Ien&&Cen.push("blob");wen.exports={BINARY_TYPES:Cen,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Ien,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var uZ=re((d$o,fbe)=>{"use strict";p();var{EMPTY_BUFFER:Xii}=vv(),Dze=Buffer[Symbol.species];function Zii(t,e){if(t.length===0)return Xii;if(t.length===1)return t[0];let n=Buffer.allocUnsafe(e),r=0;for(let i=0;i{"use strict";p();var Ren=Symbol("kDone"),Mze=Symbol("kRun"),Oze=class{constructor(e){this[Ren]=()=>{this.pending--,this[Mze]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Mze]()}[Mze](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Ren])}}};ken.exports=Oze});var O3=re((f$o,Men)=>{"use strict";p();var dZ=require("zlib"),Nen=uZ(),tsi=Ben(),{kStatusCode:Den}=vv(),nsi=Buffer[Symbol.species],rsi=Buffer.from([0,0,255,255]),Abe=Symbol("permessage-deflate"),Rv=Symbol("total-length"),P3=Symbol("callback"),AN=Symbol("buffers"),M3=Symbol("error"),gbe,Lze=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!gbe){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;gbe=new tsi(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[P3];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let n=this._options,r=e.find(i=>!(n.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(n.serverMaxWindowBits===!1||typeof n.serverMaxWindowBits=="number"&&n.serverMaxWindowBits>i.server_max_window_bits)||typeof n.clientMaxWindowBits=="number"&&(typeof i.client_max_window_bits=="number"?n.clientMaxWindowBits>i.client_max_window_bits:!i.client_max_window_bits)));if(!r)throw new Error("None of the extension offers can be accepted");return n.serverNoContextTakeover&&(r.server_no_context_takeover=!0),n.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof n.serverMaxWindowBits=="number"&&(r.server_max_window_bits=n.serverMaxWindowBits),typeof n.clientMaxWindowBits=="number"?r.client_max_window_bits=n.clientMaxWindowBits:(r.client_max_window_bits===!0||n.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(e){let n=e[0];if(this._options.clientNoContextTakeover===!1&&n.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!n.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(n.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&n.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return n}normalizeParams(e){return e.forEach(n=>{Object.keys(n).forEach(r=>{let i=n[r];if(i.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(i=i[0],r==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${i}`)}else if(r==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${i}`);i=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${i}`)}else throw new Error(`Unknown parameter "${r}"`);n[r]=i})}),e}decompress(e,n,r){gbe.add(i=>{this._decompress(e,n,(s,o)=>{i(),r(s,o)})})}compress(e,n,r){gbe.add(i=>{this._compress(e,n,(s,o)=>{i(),r(s,o)})})}_decompress(e,n,r){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?dZ.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=dZ.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Abe]=this,this._inflate[Rv]=0,this._inflate[AN]=[],this._inflate.on("error",ssi),this._inflate.on("data",Pen)}this._inflate[P3]=r,this._inflate.write(e),n&&this._inflate.write(rsi),this._inflate.flush(()=>{let s=this._inflate[M3];if(s){this._inflate.close(),this._inflate=null,r(s);return}let o=Nen.concat(this._inflate[AN],this._inflate[Rv]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Rv]=0,this._inflate[AN]=[],n&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),r(null,o)})}_compress(e,n,r){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?dZ.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=dZ.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[Rv]=0,this._deflate[AN]=[],this._deflate.on("data",isi)}this._deflate[P3]=r,this._deflate.write(e),this._deflate.flush(dZ.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Nen.concat(this._deflate[AN],this._deflate[Rv]);n&&(s=new nsi(s.buffer,s.byteOffset,s.length-4)),this._deflate[P3]=null,this._deflate[Rv]=0,this._deflate[AN]=[],n&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};Men.exports=Lze;function isi(t){this[AN].push(t),this[Rv]+=t.length}function Pen(t){if(this[Rv]+=t.length,this[Abe]._maxPayload<1||this[Rv]<=this[Abe]._maxPayload){this[AN].push(t);return}this[M3]=new RangeError("Max payload size exceeded"),this[M3].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[M3][Den]=1009,this.removeListener("data",Pen),this.reset()}function ssi(t){if(this[Abe]._inflate=null,this[M3]){this[P3](this[M3]);return}t[Den]=1007,this[P3](t)}});var L3=re((A$o,ybe)=>{"use strict";p();var{isUtf8:Oen}=require("buffer"),{hasBlob:osi}=vv(),asi=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function csi(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Fze(t){let e=t.length,n=0;for(;n=e||(t[n+1]&192)!==128||(t[n+2]&192)!==128||t[n]===224&&(t[n+1]&224)===128||t[n]===237&&(t[n+1]&224)===160)return!1;n+=3}else if((t[n]&248)===240){if(n+3>=e||(t[n+1]&192)!==128||(t[n+2]&192)!==128||(t[n+3]&192)!==128||t[n]===240&&(t[n+1]&240)===128||t[n]===244&&t[n+1]>143||t[n]>244)return!1;n+=4}else return!1;return!0}function lsi(t){return osi&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}ybe.exports={isBlob:lsi,isValidStatusCode:csi,isValidUTF8:Fze,tokenChars:asi};if(Oen)ybe.exports.isValidUTF8=function(t){return t.length<24?Fze(t):Oen(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=require("utf-8-validate");ybe.exports.isValidUTF8=function(e){return e.length<32?Fze(e):t(e)}}catch{}});var Wze=re((E$o,Wen)=>{"use strict";p();var{Writable:usi}=require("stream"),Len=O3(),{BINARY_TYPES:dsi,EMPTY_BUFFER:Fen,kStatusCode:psi,kWebSocket:msi}=vv(),{concat:Qze,toArrayBuffer:hsi,unmask:fsi}=uZ(),{isValidStatusCode:gsi,isValidUTF8:Qen}=L3(),Ebe=Buffer[Symbol.species],J0=0,Uen=1,Gen=2,$en=3,Uze=4,Gze=5,bbe=6,$ze=class extends usi{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||dsi[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[msi]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=J0}_write(e,n,r){if(this._opcode===8&&this._state==J0)return r();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){r(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e=r.length?n.set(this._buffers.shift(),i):(n.set(new Uint8Array(r.buffer,r.byteOffset,e),i),this._buffers[0]=new Ebe(r.buffer,r.byteOffset+e,r.length-e)),e-=r.length}while(e>0);return n}startLoop(e){this._loop=!0;do switch(this._state){case J0:this.getInfo(e);break;case Uen:this.getPayloadLength16(e);break;case Gen:this.getPayloadLength64(e);break;case $en:this.getMask();break;case Uze:this.getData(e);break;case Gze:case bbe:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let n=this.consume(2);if((n[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let r=(n[0]&64)===64;if(r&&!this._extensions[Len.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(n[0]&128)===128,this._opcode=n[0]&15,this._payloadLength=n[1]&127,this._opcode===0){if(r){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(r){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(n[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=Uen:this._payloadLength===127?this._state=Gen:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let n=this.consume(8),r=n.readUInt32BE(0);if(r>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=r*Math.pow(2,32)+n.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let n=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(n);return}this._masked?this._state=$en:this._state=Uze}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Uze}getData(e){let n=Fen;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(n,e);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let r=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");e(r);return}if(this._compressed){this._state=Gze,this.decompress(n,e);return}n.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(n)),this.dataMessage(e)}decompress(e,n){this._extensions[Len.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return n(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");n(o);return}this._fragments.push(s)}this.dataMessage(n),this._state===J0&&this.startLoop(n)})}dataMessage(e){if(!this._fin){this._state=J0;return}let n=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Qze(r,n):this._binaryType==="arraybuffer"?i=hsi(Qze(r,n)):this._binaryType==="blob"?i=new Blob(r):i=r,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=J0):(this._state=bbe,setImmediate(()=>{this.emit("message",i,!0),this._state=J0,this.startLoop(e)}))}else{let i=Qze(r,n);if(!this._skipUTF8Validation&&!Qen(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===Gze||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=J0):(this._state=bbe,setImmediate(()=>{this.emit("message",i,!1),this._state=J0,this.startLoop(e)}))}}controlMessage(e,n){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Fen),this.end();else{let r=e.readUInt16BE(0);if(!gsi(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(s);return}let i=new Ebe(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Qen(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(s);return}this._loop=!1,this.emit("conclude",r,i),this.end()}this._state=J0;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=J0):(this._state=bbe,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=J0,this.startLoop(n)}))}createError(e,n,r,i,s){this._loop=!1,this._errored=!0;let o=new e(r?`Invalid WebSocket frame: ${n}`:n);return Error.captureStackTrace(o,this.createError),o.code=s,o[psi]=i,o}};Wen.exports=$ze});var jze=re((x$o,jen)=>{"use strict";p();var{Duplex:_$o}=require("stream"),{randomFillSync:Asi}=require("crypto"),{types:{isUint8Array:ysi}}=require("util"),Hen=O3(),{EMPTY_BUFFER:Esi,kWebSocket:bsi,NOOP:_si}=vv(),{isBlob:F3,isValidStatusCode:xsi}=L3(),{mask:qen,toBuffer:m2}=uZ(),X0=Symbol("kByteLength"),Ssi=Buffer.alloc(4),_be=8*1024,h2,Q3=_be,Tx=0,Csi=1,Isi=2,Hze=class t{constructor(e,n,r){this._extensions=n||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Tx,this.onerror=_si,this[bsi]=void 0}static frame(e,n){let r,i=!1,s=2,o=!1;n.mask&&(r=n.maskBuffer||Ssi,n.generateMask?n.generateMask(r):(Q3===_be&&(h2===void 0&&(h2=Buffer.alloc(_be)),Asi(h2,0,_be),Q3=0),r[0]=h2[Q3++],r[1]=h2[Q3++],r[2]=h2[Q3++],r[3]=h2[Q3++]),o=(r[0]|r[1]|r[2]|r[3])===0,s=6);let a;typeof e=="string"?(!n.mask||o)&&n[X0]!==void 0?a=n[X0]:(e=Buffer.from(e),a=e.length):(a=e.length,i=n.mask&&n.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let u=Buffer.allocUnsafe(i?a+s:s);return u[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),n.mask?(u[1]|=128,u[s-4]=r[0],u[s-3]=r[1],u[s-2]=r[2],u[s-1]=r[3],o?[u,e]:i?(qen(e,r,u,s,a),[u]):(qen(e,r,e,0,a),[u,e])):[u,e]}close(e,n,r,i){let s;if(e===void 0)s=Esi;else{if(typeof e!="number"||!xsi(e))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(n);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof n=="string")s.write(n,2);else if(ysi(n))s.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let o={[X0]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Tx?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(t.frame(s,o),i)}ping(e,n,r){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):F3(e)?(i=e.size,s=!1):(e=m2(e),i=e.length,s=m2.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[X0]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};F3(e)?this._state!==Tx?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==Tx?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(t.frame(e,o),r)}pong(e,n,r){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):F3(e)?(i=e.size,s=!1):(e=m2(e),i=e.length,s=m2.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[X0]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};F3(e)?this._state!==Tx?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==Tx?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(t.frame(e,o),r)}send(e,n,r){let i=this._extensions[Hen.extensionName],s=n.binary?2:1,o=n.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):F3(e)?(a=e.size,c=!1):(e=m2(e),a=e.length,c=m2.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),n.fin&&(this._firstFragment=!0);let u={[X0]:a,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};F3(e)?this._state!==Tx?this.enqueue([this.getBlobData,e,this._compress,u,r]):this.getBlobData(e,this._compress,u,r):this._state!==Tx?this.enqueue([this.dispatch,e,this._compress,u,r]):this.dispatch(e,this._compress,u,r)}getBlobData(e,n,r,i){this._bufferedBytes+=r[X0],this._state=Isi,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(qze,this,a,i);return}this._bufferedBytes-=r[X0];let o=m2(s);n?this.dispatch(o,n,r,i):(this._state=Tx,this.sendFrame(t.frame(o,r),i),this.dequeue())}).catch(s=>{process.nextTick(wsi,this,s,i)})}dispatch(e,n,r,i){if(!n){this.sendFrame(t.frame(e,r),i);return}let s=this._extensions[Hen.extensionName];this._bufferedBytes+=r[X0],this._state=Csi,s.compress(e,r.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");qze(this,c,i);return}this._bufferedBytes-=r[X0],this._state=Tx,r.readOnly=!1,this.sendFrame(t.frame(a,r),i),this.dequeue()})}dequeue(){for(;this._state===Tx&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][X0],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][X0],this._queue.push(e)}sendFrame(e,n){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],n),this._socket.uncork()):this._socket.write(e[0],n)}};jen.exports=Hze;function qze(t,e,n){typeof n=="function"&&n(e);for(let r=0;r{"use strict";p();var{kForOnEventAttribute:pZ,kListener:Vze}=vv(),Ven=Symbol("kCode"),Yen=Symbol("kData"),zen=Symbol("kError"),Ken=Symbol("kMessage"),Jen=Symbol("kReason"),U3=Symbol("kTarget"),Xen=Symbol("kType"),Zen=Symbol("kWasClean"),kv=class{constructor(e){this[U3]=null,this[Xen]=e}get target(){return this[U3]}get type(){return this[Xen]}};Object.defineProperty(kv.prototype,"target",{enumerable:!0});Object.defineProperty(kv.prototype,"type",{enumerable:!0});var f2=class extends kv{constructor(e,n={}){super(e),this[Ven]=n.code===void 0?0:n.code,this[Jen]=n.reason===void 0?"":n.reason,this[Zen]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[Ven]}get reason(){return this[Jen]}get wasClean(){return this[Zen]}};Object.defineProperty(f2.prototype,"code",{enumerable:!0});Object.defineProperty(f2.prototype,"reason",{enumerable:!0});Object.defineProperty(f2.prototype,"wasClean",{enumerable:!0});var G3=class extends kv{constructor(e,n={}){super(e),this[zen]=n.error===void 0?null:n.error,this[Ken]=n.message===void 0?"":n.message}get error(){return this[zen]}get message(){return this[Ken]}};Object.defineProperty(G3.prototype,"error",{enumerable:!0});Object.defineProperty(G3.prototype,"message",{enumerable:!0});var mZ=class extends kv{constructor(e,n={}){super(e),this[Yen]=n.data===void 0?null:n.data}get data(){return this[Yen]}};Object.defineProperty(mZ.prototype,"data",{enumerable:!0});var Tsi={addEventListener(t,e,n={}){for(let i of this.listeners(t))if(!n[pZ]&&i[Vze]===e&&!i[pZ])return;let r;if(t==="message")r=function(s,o){let a=new mZ("message",{data:o?s:s.toString()});a[U3]=this,xbe(e,this,a)};else if(t==="close")r=function(s,o){let a=new f2("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[U3]=this,xbe(e,this,a)};else if(t==="error")r=function(s){let o=new G3("error",{error:s,message:s.message});o[U3]=this,xbe(e,this,o)};else if(t==="open")r=function(){let s=new kv("open");s[U3]=this,xbe(e,this,s)};else return;r[pZ]=!!n[pZ],r[Vze]=e,n.once?this.once(t,r):this.on(t,r)},removeEventListener(t,e){for(let n of this.listeners(t))if(n[Vze]===e&&!n[pZ]){this.removeListener(t,n);break}}};etn.exports={CloseEvent:f2,ErrorEvent:G3,Event:kv,EventTarget:Tsi,MessageEvent:mZ};function xbe(t,e,n){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,n):t.call(e,n)}});var Sbe=re((w$o,ntn)=>{"use strict";p();var{tokenChars:hZ}=L3();function TI(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}function vsi(t){let e=Object.create(null),n=Object.create(null),r=!1,i=!1,s=!1,o,a,c=-1,u=-1,l=-1,d=0;for(;d{let n=t[e];return Array.isArray(n)||(n=[n]),n.map(r=>[e].concat(Object.keys(r).map(i=>{let s=r[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}ntn.exports={format:Rsi,parse:vsi}});var Tbe=re((k$o,htn)=>{"use strict";p();var ksi=require("events"),Bsi=require("https"),Nsi=require("http"),stn=require("net"),Dsi=require("tls"),{randomBytes:Psi,createHash:Msi}=require("crypto"),{Duplex:v$o,Readable:R$o}=require("stream"),{URL:Yze}=require("url"),yN=O3(),Osi=Wze(),Lsi=jze(),{isBlob:Fsi}=L3(),{BINARY_TYPES:rtn,CLOSE_TIMEOUT:Qsi,EMPTY_BUFFER:Cbe,GUID:Usi,kForOnEventAttribute:zze,kListener:Gsi,kStatusCode:$si,kWebSocket:Yp,NOOP:otn}=vv(),{EventTarget:{addEventListener:Wsi,removeEventListener:Hsi}}=ttn(),{format:qsi,parse:jsi}=Sbe(),{toBuffer:Vsi}=uZ(),atn=Symbol("kAborted"),Kze=[8,13],Bv=["CONNECTING","OPEN","CLOSING","CLOSED"],Ysi=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Il=class t extends ksi{constructor(e,n,r){super(),this._binaryType=rtn[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Cbe,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n=="object"&&n!==null?(r=n,n=[]):n=[n]),ctn(this,e,n,r)):(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){rtn.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,n,r){let i=new Osi({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),s=new Lsi(e,this._extensions,r.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[Yp]=this,s[Yp]=this,e[Yp]=this,i.on("conclude",Jsi),i.on("drain",Xsi),i.on("error",Zsi),i.on("message",eoi),i.on("ping",toi),i.on("pong",noi),s.onerror=roi,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),n.length>0&&e.unshift(n),e.on("close",dtn),e.on("data",wbe),e.on("end",ptn),e.on("error",mtn),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[yN.extensionName]&&this._extensions[yN.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,n){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){jy(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,n,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),utn(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,n,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Jze(this,e,r);return}n===void 0&&(n=!this._isServer),this._sender.ping(e||Cbe,n,r)}pong(e,n,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Jze(this,e,r);return}n===void 0&&(n=!this._isServer),this._sender.pong(e||Cbe,n,r)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,n,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"&&(r=n,n={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Jze(this,e,r);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[yN.extensionName]||(i.compress=!1),this._sender.send(e||Cbe,i,r)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){jy(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(Il,"CONNECTING",{enumerable:!0,value:Bv.indexOf("CONNECTING")});Object.defineProperty(Il.prototype,"CONNECTING",{enumerable:!0,value:Bv.indexOf("CONNECTING")});Object.defineProperty(Il,"OPEN",{enumerable:!0,value:Bv.indexOf("OPEN")});Object.defineProperty(Il.prototype,"OPEN",{enumerable:!0,value:Bv.indexOf("OPEN")});Object.defineProperty(Il,"CLOSING",{enumerable:!0,value:Bv.indexOf("CLOSING")});Object.defineProperty(Il.prototype,"CLOSING",{enumerable:!0,value:Bv.indexOf("CLOSING")});Object.defineProperty(Il,"CLOSED",{enumerable:!0,value:Bv.indexOf("CLOSED")});Object.defineProperty(Il.prototype,"CLOSED",{enumerable:!0,value:Bv.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(Il.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(Il.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[zze])return e[Gsi];return null},set(e){for(let n of this.listeners(t))if(n[zze]){this.removeListener(t,n);break}typeof e=="function"&&this.addEventListener(t,e,{[zze]:!0})}})});Il.prototype.addEventListener=Wsi;Il.prototype.removeEventListener=Hsi;htn.exports=Il;function ctn(t,e,n,r){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Qsi,protocolVersion:Kze[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=i.autoPong,t._closeTimeout=i.closeTimeout,!Kze.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Kze.join(", ")})`);let s;if(e instanceof Yze)s=e;else try{s=new Yze(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),t._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let g=new SyntaxError(c);if(t._redirects===0)throw g;Ibe(t,g);return}let u=o?443:80,l=Psi(16).toString("base64"),d=o?Bsi.request:Nsi.request,m=new Set,h;if(i.createConnection=i.createConnection||(o?Ksi:zsi),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(h=new yN({...i.perMessageDeflate,isServer:!1,maxPayload:i.maxPayload}),i.headers["Sec-WebSocket-Extensions"]=qsi({[yN.extensionName]:h.offer()})),n.length){for(let g of n){if(typeof g!="string"||!Ysi.test(g)||m.has(g))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(g)}i.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),a){let g=i.path.split(":");i.socketPath=g[0],i.path=g[1]}let f;if(i.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=o,t._originalHostOrSocketPath=a?i.socketPath:s.host;let g=r&&r.headers;if(r={...r,headers:{}},g)for(let[A,y]of Object.entries(g))r.headers[A.toLowerCase()]=y}else if(t.listenerCount("redirect")===0){let g=a?t._originalIpc?i.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:s.host===t._originalHostOrSocketPath;(!g||t._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,g||delete i.headers.host,i.auth=void 0)}i.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),f=t._req=d(i),t._redirects&&t.emit("redirect",t.url,f)}else f=t._req=d(i);i.timeout&&f.on("timeout",()=>{jy(t,f,"Opening handshake has timed out")}),f.on("error",g=>{f===null||f[atn]||(f=t._req=null,Ibe(t,g))}),f.on("response",g=>{let A=g.headers.location,y=g.statusCode;if(A&&i.followRedirects&&y>=300&&y<400){if(++t._redirects>i.maxRedirects){jy(t,f,"Maximum redirects exceeded");return}f.abort();let E;try{E=new Yze(A,e)}catch{let S=new SyntaxError(`Invalid URL: ${A}`);Ibe(t,S);return}ctn(t,E,n,r)}else t.emit("unexpected-response",f,g)||jy(t,f,`Unexpected server response: ${g.statusCode}`)}),f.on("upgrade",(g,A,y)=>{if(t.emit("upgrade",g),t.readyState!==Il.CONNECTING)return;f=t._req=null;let E=g.headers.upgrade;if(E===void 0||E.toLowerCase()!=="websocket"){jy(t,A,"Invalid Upgrade header");return}let _=Msi("sha1").update(l+Usi).digest("base64");if(g.headers["sec-websocket-accept"]!==_){jy(t,A,"Invalid Sec-WebSocket-Accept header");return}let S=g.headers["sec-websocket-protocol"],C;if(S!==void 0?m.size?m.has(S)||(C="Server sent an invalid subprotocol"):C="Server sent a subprotocol but none was requested":m.size&&(C="Server sent no subprotocol"),C){jy(t,A,C);return}S&&(t._protocol=S);let I=g.headers["sec-websocket-extensions"];if(I!==void 0){if(!h){jy(t,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let w;try{w=jsi(I)}catch{jy(t,A,"Invalid Sec-WebSocket-Extensions header");return}let k=Object.keys(w);if(k.length!==1||k[0]!==yN.extensionName){jy(t,A,"Server indicated an extension that was not requested");return}try{h.accept(w[yN.extensionName])}catch{jy(t,A,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[yN.extensionName]=h}t.setSocket(A,y,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(f,t):f.end()}function Ibe(t,e){t._readyState=Il.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function zsi(t){return t.path=t.socketPath,stn.connect(t)}function Ksi(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=stn.isIP(t.host)?"":t.host),Dsi.connect(t)}function jy(t,e,n){t._readyState=Il.CLOSING;let r=new Error(n);Error.captureStackTrace(r,jy),e.setHeader?(e[atn]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Ibe,t,r)):(e.destroy(r),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Jze(t,e,n){if(e){let r=Fsi(e)?e.size:Vsi(e).length;t._socket?t._sender._bufferedBytes+=r:t._bufferedAmount+=r}if(n){let r=new Error(`WebSocket is not open: readyState ${t.readyState} (${Bv[t.readyState]})`);process.nextTick(n,r)}}function Jsi(t,e){let n=this[Yp];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,n._socket[Yp]!==void 0&&(n._socket.removeListener("data",wbe),process.nextTick(ltn,n._socket),t===1005?n.close():n.close(t,e))}function Xsi(){let t=this[Yp];t.isPaused||t._socket.resume()}function Zsi(t){let e=this[Yp];e._socket[Yp]!==void 0&&(e._socket.removeListener("data",wbe),process.nextTick(ltn,e._socket),e.close(t[$si])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function itn(){this[Yp].emitClose()}function eoi(t,e){this[Yp].emit("message",t,e)}function toi(t){let e=this[Yp];e._autoPong&&e.pong(t,!this._isServer,otn),e.emit("ping",t)}function noi(t){this[Yp].emit("pong",t)}function ltn(t){t.resume()}function roi(t){let e=this[Yp];e.readyState!==Il.CLOSED&&(e.readyState===Il.OPEN&&(e._readyState=Il.CLOSING,utn(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function utn(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function dtn(){let t=this[Yp];if(this.removeListener("close",dtn),this.removeListener("data",wbe),this.removeListener("end",ptn),t._readyState=Il.CLOSING,!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);t._receiver.write(e)}t._receiver.end(),this[Yp]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",itn),t._receiver.on("finish",itn))}function wbe(t){this[Yp]._receiver.write(t)||this.pause()}function ptn(){let t=this[Yp];t._readyState=Il.CLOSING,t._receiver.end(),this.end()}function mtn(){let t=this[Yp];this.removeListener("error",mtn),this.on("error",otn),t&&(t._readyState=Il.CLOSING,this.destroy())}});var ytn=re((D$o,Atn)=>{"use strict";p();var N$o=Tbe(),{Duplex:ioi}=require("stream");function ftn(t){t.emit("close")}function soi(){!this.destroyed&&this._writableState.finished&&this.destroy()}function gtn(t){this.removeListener("error",gtn),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function ooi(t,e){let n=!0,r=new ioi({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(s,o){let a=!o&&r._readableState.objectMode?s.toString():s;r.push(a)||t.pause()}),t.once("error",function(s){r.destroyed||(n=!1,r.destroy(s))}),t.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(i,s){if(t.readyState===t.CLOSED){s(i),process.nextTick(ftn,r);return}let o=!1;t.once("error",function(c){o=!0,s(c)}),t.once("close",function(){o||s(i),process.nextTick(ftn,r)}),n&&t.terminate()},r._final=function(i){if(t.readyState===t.CONNECTING){t.once("open",function(){r._final(i)});return}t._socket!==null&&(t._socket._writableState.finished?(i(),r._readableState.endEmitted&&r.destroy()):(t._socket.once("finish",function(){i()}),t.close()))},r._read=function(){t.isPaused&&t.resume()},r._write=function(i,s,o){if(t.readyState===t.CONNECTING){t.once("open",function(){r._write(i,s,o)});return}t.send(i,o)},r.on("end",soi),r.on("error",gtn),r}Atn.exports=ooi});var Xze=re((M$o,Etn)=>{"use strict";p();var{tokenChars:aoi}=L3();function coi(t){let e=new Set,n=-1,r=-1,i=0;for(i;i{"use strict";p();var loi=require("events"),vbe=require("http"),{Duplex:L$o}=require("stream"),{createHash:uoi}=require("crypto"),btn=Sbe(),g2=O3(),doi=Xze(),poi=Tbe(),{CLOSE_TIMEOUT:moi,GUID:hoi,kWebSocket:foi}=vv(),goi=/^[+/0-9A-Za-z]{22}==$/,_tn=0,xtn=1,Ctn=2,Zze=class extends loi{constructor(e,n){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:moi,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:poi,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=vbe.createServer((r,i)=>{let s=vbe.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,n)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=Aoi(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=_tn}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===Ctn){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(fZ,this);return}if(e&&this.once("close",e),this._state!==xtn)if(this._state=xtn,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(fZ,this):process.nextTick(fZ,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{fZ(this)})}}shouldHandle(e){if(this.options.path){let n=e.url.indexOf("?");if((n!==-1?e.url.slice(0,n):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,n,r,i){n.on("error",Stn);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){A2(this,e,n,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){A2(this,e,n,400,"Invalid Upgrade header");return}if(s===void 0||!goi.test(s)){A2(this,e,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){A2(this,e,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){gZ(n,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=doi.parse(c)}catch{A2(this,e,n,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let m=new g2({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let h=btn.parse(l);h[g2.extensionName]&&(m.accept(h[g2.extensionName]),d[g2.extensionName]=m)}catch{A2(this,e,n,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(h,f,g,A)=>{if(!h)return gZ(n,f||401,g,A);this.completeUpgrade(d,s,u,e,n,r,i)});return}if(!this.options.verifyClient(m))return gZ(n,401)}this.completeUpgrade(d,s,u,e,n,r,i)}completeUpgrade(e,n,r,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[foi])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>_tn)return gZ(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${uoi("sha1").update(n+hoi).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(r.size){let d=this.options.handleProtocols?this.options.handleProtocols(r,i):r.values().next().value;d&&(u.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(e[g2.extensionName]){let d=e[g2.extensionName].params,m=btn.format({[g2.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${m}`),l._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r `).join(`\r -`)),i.removeListener("error",Uqt),l.setSocket(i,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(ez,this)})),a(l,s)}};Gqt.exports=R5e;function PPr(t,e){for(let n of Object.keys(e))t.on(n,e[n]);return function(){for(let r of Object.keys(e))t.removeListener(r,e[r])}}function ez(t){t._state=$qt,t.emit("close")}function Uqt(){this.destroy()}function tz(t,e,n,r){n=n||Tfe.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...r},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${Tfe.STATUS_CODES[e]}\r -`+Object.keys(r).map(s=>`${s}: ${r[s]}`).join(`\r +`)),s.removeListener("error",Stn),l.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(fZ,this)})),a(l,i)}};Itn.exports=Zze;function Aoi(t,e){for(let n of Object.keys(e))t.on(n,e[n]);return function(){for(let r of Object.keys(e))t.removeListener(r,e[r])}}function fZ(t){t._state=Ctn,t.emit("close")}function Stn(){this.destroy()}function gZ(t,e,n,r){n=n||vbe.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...r},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${vbe.STATUS_CODES[e]}\r +`+Object.keys(r).map(i=>`${i}: ${r[i]}`).join(`\r `)+`\r \r -`+n)}function fO(t,e,n,r,s,i){if(t.listenerCount("wsClientError")){let o=new Error(s);Error.captureStackTrace(o,fO),t.emit("wsClientError",o,n,e)}else tz(n,r,s,i)}});var OPr,MPr,LPr,FPr,QPr,UPr,k5e,$Pr,qqt=V(()=>{p();OPr=Gt(Oqt(),1),MPr=Gt(Sfe(),1),LPr=Gt(gq(),1),FPr=Gt(E5e(),1),QPr=Gt(S5e(),1),UPr=Gt(v5e(),1),k5e=Gt(wfe(),1),$Pr=Gt(Wqt(),1)});function HPr(){return{geminiUrl:WPr,vertexUrl:qPr}}function VPr(t,e,n,r){var s,i;if(!t?.baseUrl){let o=HPr();return e?(s=o.vertexUrl)!==null&&s!==void 0?s:n:(i=o.geminiUrl)!==null&&i!==void 0?i:r}return t.baseUrl}function Zn(t,e){let n=/\{([^}]+)\}/g;return t.replace(n,(r,s)=>{if(Object.prototype.hasOwnProperty.call(e,s)){let i=e[s];return i!=null?String(i):""}else throw new Error(`Key '${s}' not found in valueMap.`)})}function O(t,e,n){for(let i=0;i({}));else throw new Error(`Value must be a list given an array path ${o}`);if(Array.isArray(t[a])){let c=t[a];if(Array.isArray(n))for(let u=0;uD(a,e.slice(r+1),n)):n}else return n}else t=t[s]}return t}catch(r){if(r instanceof TypeError)return n;throw r}}function jPr(t,e){for(let[n,r]of Object.entries(e)){let s=n.split("."),i=r.split("."),o=new Set,a=-1;for(let c=0;ca)for(let c=a;c=e.length||typeof t!="object"||t===null)return;let i=e[r];if(i.endsWith("[]")){let o=i.slice(0,-2),a=t;if(o in a&&Array.isArray(a[o]))for(let c of a[o])P5e(c,e,n,r+1,s)}else if(i==="*"){if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let o=t,a=Object.keys(o).filter(u=>!u.startsWith("_")&&!s.has(u)),c={};for(let u of a)c[u]=o[u];for(let[u,l]of Object.entries(c)){let d=[];for(let h of n.slice(r))h==="*"?d.push(u):d.push(h);O(o,d,l)}for(let u of a)delete o[u]}}else{let o=t;i in o&&P5e(o[i],e,n,r+1,s)}}function P4e(t){if(typeof t!="string")throw new Error("fromImageBytes must be a string");return t}function YPr(t){let e={},n=D(t,["operationName"]);n!=null&&O(e,["operationName"],n);let r=D(t,["resourceName"]);return r!=null&&O(e,["_url","resourceName"],r),e}function KPr(t){let e={},n=D(t,["name"]);n!=null&&O(e,["name"],n);let r=D(t,["metadata"]);r!=null&&O(e,["metadata"],r);let s=D(t,["done"]);s!=null&&O(e,["done"],s);let i=D(t,["error"]);i!=null&&O(e,["error"],i);let o=D(t,["response","generateVideoResponse"]);return o!=null&&O(e,["response"],JPr(o)),e}function zPr(t){let e={},n=D(t,["name"]);n!=null&&O(e,["name"],n);let r=D(t,["metadata"]);r!=null&&O(e,["metadata"],r);let s=D(t,["done"]);s!=null&&O(e,["done"],s);let i=D(t,["error"]);i!=null&&O(e,["error"],i);let o=D(t,["response"]);return o!=null&&O(e,["response"],XPr(o)),e}function JPr(t){let e={},n=D(t,["generatedSamples"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(o=>ZPr(o))),O(e,["generatedVideos"],i)}let r=D(t,["raiMediaFilteredCount"]);r!=null&&O(e,["raiMediaFilteredCount"],r);let s=D(t,["raiMediaFilteredReasons"]);return s!=null&&O(e,["raiMediaFilteredReasons"],s),e}function XPr(t){let e={},n=D(t,["videos"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(o=>eOr(o))),O(e,["generatedVideos"],i)}let r=D(t,["raiMediaFilteredCount"]);r!=null&&O(e,["raiMediaFilteredCount"],r);let s=D(t,["raiMediaFilteredReasons"]);return s!=null&&O(e,["raiMediaFilteredReasons"],s),e}function ZPr(t){let e={},n=D(t,["video"]);return n!=null&&O(e,["video"],oOr(n)),e}function eOr(t){let e={},n=D(t,["_self"]);return n!=null&&O(e,["video"],aOr(n)),e}function tOr(t){let e={},n=D(t,["operationName"]);return n!=null&&O(e,["_url","operationName"],n),e}function nOr(t){let e={},n=D(t,["operationName"]);return n!=null&&O(e,["_url","operationName"],n),e}function rOr(t){let e={},n=D(t,["name"]);n!=null&&O(e,["name"],n);let r=D(t,["metadata"]);r!=null&&O(e,["metadata"],r);let s=D(t,["done"]);s!=null&&O(e,["done"],s);let i=D(t,["error"]);i!=null&&O(e,["error"],i);let o=D(t,["response"]);return o!=null&&O(e,["response"],sOr(o)),e}function sOr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["parent"]);r!=null&&O(e,["parent"],r);let s=D(t,["documentName"]);return s!=null&&O(e,["documentName"],s),e}function O4e(t){let e={},n=D(t,["name"]);n!=null&&O(e,["name"],n);let r=D(t,["metadata"]);r!=null&&O(e,["metadata"],r);let s=D(t,["done"]);s!=null&&O(e,["done"],s);let i=D(t,["error"]);i!=null&&O(e,["error"],i);let o=D(t,["response"]);return o!=null&&O(e,["response"],iOr(o)),e}function iOr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["parent"]);r!=null&&O(e,["parent"],r);let s=D(t,["documentName"]);return s!=null&&O(e,["documentName"],s),e}function oOr(t){let e={},n=D(t,["uri"]);n!=null&&O(e,["uri"],n);let r=D(t,["encodedVideo"]);r!=null&&O(e,["videoBytes"],P4e(r));let s=D(t,["encoding"]);return s!=null&&O(e,["mimeType"],s),e}function aOr(t){let e={},n=D(t,["gcsUri"]);n!=null&&O(e,["uri"],n);let r=D(t,["bytesBase64Encoded"]);r!=null&&O(e,["videoBytes"],P4e(r));let s=D(t,["mimeType"]);return s!=null&&O(e,["mimeType"],s),e}function Bo(t,e){if(!e||typeof e!="string")throw new Error("model is required and must be a string");if(e.includes("..")||e.includes("?")||e.includes("&"))throw new Error("invalid model parameter");if(t.isVertexAI()){if(e.startsWith("publishers/")||e.startsWith("projects/")||e.startsWith("models/"))return e;if(e.indexOf("/")>=0){let n=e.split("/",2);return`publishers/${n[0]}/models/${n[1]}`}else return`publishers/google/models/${e}`}else return e.startsWith("models/")||e.startsWith("tunedModels/")?e:`models/${e}`}function THt(t,e){let n=Bo(t,e);return n?n.startsWith("publishers/")&&t.isVertexAI()?`projects/${t.getProject()}/locations/${t.getLocation()}/${n}`:n.startsWith("models/")&&t.isVertexAI()?`projects/${t.getProject()}/locations/${t.getLocation()}/publishers/google/${n}`:n:""}function vHt(t){return Array.isArray(t)?t.map(e=>Vfe(e)):[Vfe(t)]}function Vfe(t){if(typeof t=="object"&&t!==null)return t;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof t}`)}function RHt(t){let e=Vfe(t);if(e.mimeType&&e.mimeType.startsWith("image/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function kHt(t){let e=Vfe(t);if(e.mimeType&&e.mimeType.startsWith("audio/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function Y3t(t){if(t==null)throw new Error("PartUnion is required");if(typeof t=="object")return t;if(typeof t=="string")return{text:t};throw new Error(`Unsupported part type: ${typeof t}`)}function NHt(t){if(t==null||Array.isArray(t)&&t.length===0)throw new Error("PartListUnion is required");return Array.isArray(t)?t.map(e=>Y3t(e)):[Y3t(t)]}function X5e(t){return t!=null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)}function K3t(t){return t!=null&&typeof t=="object"&&"functionCall"in t}function z3t(t){return t!=null&&typeof t=="object"&&"functionResponse"in t}function ep(t){if(t==null)throw new Error("ContentUnion is required");return X5e(t)?t:{role:"user",parts:NHt(t)}}function M4e(t,e){if(!e)return[];if(t.isVertexAI()&&Array.isArray(e))return e.flatMap(n=>{let r=ep(n);return r.parts&&r.parts.length>0&&r.parts[0].text!==void 0?[r.parts[0].text]:[]});if(t.isVertexAI()){let n=ep(e);return n.parts&&n.parts.length>0&&n.parts[0].text!==void 0?[n.parts[0].text]:[]}return Array.isArray(e)?e.map(n=>ep(n)):[ep(e)]}function qf(t){if(t==null||Array.isArray(t)&&t.length===0)throw new Error("contents are required");if(!Array.isArray(t)){if(K3t(t)||z3t(t))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[ep(t)]}let e=[],n=[],r=X5e(t[0]);for(let s of t){let i=X5e(s);if(i!=r)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(i)e.push(s);else{if(K3t(s)||z3t(s))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");n.push(s)}}return r||e.push({role:"user",parts:NHt(n)}),e}function cOr(t,e){t.includes("null")&&(e.nullable=!0);let n=t.filter(r=>r!=="null");if(n.length===1)e.type=Object.values(Pk).includes(n[0].toUpperCase())?n[0].toUpperCase():Pk.TYPE_UNSPECIFIED;else{e.anyOf=[];for(let r of n)e.anyOf.push({type:Object.values(Pk).includes(r.toUpperCase())?r.toUpperCase():Pk.TYPE_UNSPECIFIED})}}function Cq(t){let e={},n=["items"],r=["anyOf"],s=["properties"];if(t.type&&t.anyOf)throw new Error("type and anyOf cannot be both populated.");let i=t.anyOf;i!=null&&i.length==2&&(i[0].type==="null"?(e.nullable=!0,t=i[1]):i[1].type==="null"&&(e.nullable=!0,t=i[0])),t.type instanceof Array&&cOr(t.type,e);for(let[o,a]of Object.entries(t))if(a!=null)if(o=="type"){if(a==="null")throw new Error("type: null can not be the only possible type for the field.");if(a instanceof Array)continue;e.type=Object.values(Pk).includes(a.toUpperCase())?a.toUpperCase():Pk.TYPE_UNSPECIFIED}else if(n.includes(o))e[o]=Cq(a);else if(r.includes(o)){let c=[];for(let u of a){if(u.type=="null"){e.nullable=!0;continue}c.push(Cq(u))}e[o]=c}else if(s.includes(o)){let c={};for(let[u,l]of Object.entries(a))c[u]=Cq(l);e[o]=c}else{if(o==="additionalProperties")continue;e[o]=a}return e}function L4e(t){return Cq(t)}function F4e(t){if(typeof t=="object")return t;if(typeof t=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:t}}};throw new Error(`Unsupported speechConfig type: ${typeof t}`)}function Q4e(t){if("multiSpeakerVoiceConfig"in t)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return t}function Tq(t){if(t.functionDeclarations)for(let e of t.functionDeclarations)e.parameters&&(Object.keys(e.parameters).includes("$schema")?e.parametersJsonSchema||(e.parametersJsonSchema=e.parameters,delete e.parameters):e.parameters=Cq(e.parameters)),e.response&&(Object.keys(e.response).includes("$schema")?e.responseJsonSchema||(e.responseJsonSchema=e.response,delete e.response):e.response=Cq(e.response));return t}function vq(t){if(t==null)throw new Error("tools is required");if(!Array.isArray(t))throw new Error("tools is required and must be an array of Tools");let e=[];for(let n of t)e.push(n);return e}function lOr(t,e,n,r=1){let s=!e.startsWith(`${n}/`)&&e.split("/").length===r;return t.isVertexAI()?e.startsWith("projects/")?e:e.startsWith("locations/")?`projects/${t.getProject()}/${e}`:e.startsWith(`${n}/`)?`projects/${t.getProject()}/locations/${t.getLocation()}/${e}`:s?`projects/${t.getProject()}/locations/${t.getLocation()}/${n}/${e}`:e:s?`${n}/${e}`:e}function hw(t,e){if(typeof e!="string")throw new Error("name must be a string");return lOr(t,e,"cachedContents")}function DHt(t){switch(t){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return t}}function Uk(t){return P4e(t)}function uOr(t){return t!=null&&typeof t=="object"&&"name"in t}function BHt(t){return t!=null&&typeof t=="object"&&"video"in t}function PHt(t){return t!=null&&typeof t=="object"&&"uri"in t}function U4e(t){var e;let n;if(uOr(t)&&(n=t.name),!(PHt(t)&&(n=t.uri,n===void 0))&&!(BHt(t)&&(n=(e=t.video)===null||e===void 0?void 0:e.uri,n===void 0))){if(typeof t=="string"&&(n=t),n===void 0)throw new Error("Could not extract file name from the provided input.");if(n.startsWith("https://")){let s=n.split("files/")[1].match(/[a-z0-9]+/);if(s===null)throw new Error(`Could not extract file name from URI ${n}`);n=s[0]}else n.startsWith("files/")&&(n=n.split("files/")[1]);return n}}function OHt(t,e){let n;return t.isVertexAI()?n=e?"publishers/google/models":"models":n=e?"models":"tunedModels",n}function MHt(t){for(let e of["models","tunedModels","publisherModels"])if(dOr(t,e))return t[e];return[]}function dOr(t,e){return t!==null&&typeof t=="object"&&e in t}function pOr(t,e={}){let n=t,r={name:n.name,description:n.description,parametersJsonSchema:n.inputSchema};return n.outputSchema&&(r.responseJsonSchema=n.outputSchema),e.behavior&&(r.behavior=e.behavior),{functionDeclarations:[r]}}function hOr(t,e={}){let n=[],r=new Set;for(let s of t){let i=s.name;if(r.has(i))throw new Error(`Duplicate function name ${i} found in MCP tools. Please ensure function names are unique.`);r.add(i);let o=pOr(s,e);o.functionDeclarations&&n.push(...o.functionDeclarations)}return{functionDeclarations:n}}function LHt(t,e){let n;if(typeof e=="string")if(t.isVertexAI())if(e.startsWith("gs://"))n={format:"jsonl",gcsUri:[e]};else if(e.startsWith("bq://"))n={format:"bigquery",bigqueryUri:e};else if(/^projects\/[^/]+\/locations\/[^/]+\/datasets\/[^/]+$/.test(e))n={format:"vertex-dataset",vertexDatasetName:e};else throw new Error(`Unsupported string source for Vertex AI: ${e}`);else if(e.startsWith("files/"))n={fileName:e};else throw new Error(`Unsupported string source for Gemini API: ${e}`);else if(Array.isArray(e)){if(t.isVertexAI())throw new Error("InlinedRequest[] is not supported in Vertex AI.");n={inlinedRequests:e}}else n=e;let r=[n.gcsUri,n.bigqueryUri,n.vertexDatasetName].filter(Boolean).length,s=[n.inlinedRequests,n.fileName].filter(Boolean).length;if(t.isVertexAI()){if(s>0||r!==1)throw new Error("Exactly one of `gcsUri`, `bigqueryUri`, or `vertexDatasetName` must be set for Vertex AI.")}else if(r>0||s!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return n}function mOr(t){if(typeof t!="string")return t;let e=t;if(e.startsWith("gs://"))return{format:"jsonl",gcsUri:e};if(e.startsWith("bq://"))return{format:"bigquery",bigqueryUri:e};throw new Error(`Unsupported destination: ${e}`)}function FHt(t){if(typeof t!="object"||t===null)return{};let e=t,n=e.inlinedResponses;if(typeof n!="object"||n===null)return t;let s=n.inlinedResponses;if(!Array.isArray(s)||s.length===0)return t;let i=!1;for(let o of s){if(typeof o!="object"||o===null)continue;let c=o.response;if(typeof c!="object"||c===null)continue;if(c.embedding!==void 0){i=!0;break}}return i&&(e.inlinedEmbedContentResponses=e.inlinedResponses,delete e.inlinedResponses),t}function Rq(t,e){let n=e;if(!t.isVertexAI()){if(/batches\/[^/]+$/.test(n))return n.split("/").pop();throw new Error(`Invalid batch job name: ${n}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(n))return n.split("/").pop();if(/^\d+$/.test(n))return n;throw new Error(`Invalid batch job name: ${n}.`)}function QHt(t){let e=t;return e==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":e==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":e==="BATCH_STATE_RUNNING"?"JOB_STATE_RUNNING":e==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":e==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":e==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":e==="BATCH_STATE_EXPIRED"?"JOB_STATE_EXPIRED":e}function fOr(t){return t.includes("gemini")&&t!=="gemini-embedding-001"||t.includes("maas")}function gOr(t){let e={},n=D(t,["apiKey"]);if(n!=null&&O(e,["apiKey"],n),D(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(D(t,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(D(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(D(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(D(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(D(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return e}function AOr(t){let e={},n=D(t,["responsesFile"]);n!=null&&O(e,["fileName"],n);let r=D(t,["inlinedResponses","inlinedResponses"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(o=>JOr(o))),O(e,["inlinedResponses"],i)}let s=D(t,["inlinedEmbedContentResponses","inlinedResponses"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>o)),O(e,["inlinedEmbedContentResponses"],i)}return e}function yOr(t){let e={},n=D(t,["predictionsFormat"]);n!=null&&O(e,["format"],n);let r=D(t,["gcsDestination","outputUriPrefix"]);r!=null&&O(e,["gcsUri"],r);let s=D(t,["bigqueryDestination","outputUri"]);s!=null&&O(e,["bigqueryUri"],s);let i=D(t,["vertexMultimodalDatasetDestination"]);return i!=null&&O(e,["vertexDataset"],cMr(i)),e}function EOr(t){let e={},n=D(t,["format"]);n!=null&&O(e,["predictionsFormat"],n);let r=D(t,["gcsUri"]);r!=null&&O(e,["gcsDestination","outputUriPrefix"],r);let s=D(t,["bigqueryUri"]);if(s!=null&&O(e,["bigqueryDestination","outputUri"],s),D(t,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");if(D(t,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");if(D(t,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");let i=D(t,["vertexDataset"]);return i!=null&&O(e,["vertexMultimodalDatasetDestination"],lMr(i)),e}function Nfe(t){let e={},n=D(t,["name"]);n!=null&&O(e,["name"],n);let r=D(t,["metadata","displayName"]);r!=null&&O(e,["displayName"],r);let s=D(t,["metadata","state"]);s!=null&&O(e,["state"],QHt(s));let i=D(t,["metadata","createTime"]);i!=null&&O(e,["createTime"],i);let o=D(t,["metadata","endTime"]);o!=null&&O(e,["endTime"],o);let a=D(t,["metadata","updateTime"]);a!=null&&O(e,["updateTime"],a);let c=D(t,["metadata","model"]);c!=null&&O(e,["model"],c);let u=D(t,["metadata","output"]);return u!=null&&O(e,["dest"],AOr(FHt(u))),e}function Z5e(t){let e={},n=D(t,["name"]);n!=null&&O(e,["name"],n);let r=D(t,["displayName"]);r!=null&&O(e,["displayName"],r);let s=D(t,["state"]);s!=null&&O(e,["state"],QHt(s));let i=D(t,["error"]);i!=null&&O(e,["error"],i);let o=D(t,["createTime"]);o!=null&&O(e,["createTime"],o);let a=D(t,["startTime"]);a!=null&&O(e,["startTime"],a);let c=D(t,["endTime"]);c!=null&&O(e,["endTime"],c);let u=D(t,["updateTime"]);u!=null&&O(e,["updateTime"],u);let l=D(t,["model"]);l!=null&&O(e,["model"],l);let d=D(t,["inputConfig"]);d!=null&&O(e,["src"],bOr(d));let h=D(t,["outputConfig"]);h!=null&&O(e,["dest"],yOr(FHt(h)));let m=D(t,["completionStats"]);m!=null&&O(e,["completionStats"],m);let f=D(t,["outputInfo"]);return f!=null&&O(e,["outputInfo"],f),e}function bOr(t){let e={},n=D(t,["instancesFormat"]);n!=null&&O(e,["format"],n);let r=D(t,["gcsSource","uris"]);r!=null&&O(e,["gcsUri"],r);let s=D(t,["bigquerySource","inputUri"]);s!=null&&O(e,["bigqueryUri"],s);let i=D(t,["vertexMultimodalDatasetSource","datasetName"]);return i!=null&&O(e,["vertexDatasetName"],i),e}function _Or(t,e){let n={};if(D(e,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(D(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(D(e,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");let r=D(e,["fileName"]);r!=null&&O(n,["fileName"],r);let s=D(e,["inlinedRequests"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>zOr(t,o))),O(n,["requests","requests"],i)}if(D(e,["vertexDatasetName"])!==void 0)throw new Error("vertexDatasetName parameter is not supported in Gemini API.");return n}function SOr(t){let e={},n=D(t,["format"]);n!=null&&O(e,["instancesFormat"],n);let r=D(t,["gcsUri"]);r!=null&&O(e,["gcsSource","uris"],r);let s=D(t,["bigqueryUri"]);if(s!=null&&O(e,["bigquerySource","inputUri"],s),D(t,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");if(D(t,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");let i=D(t,["vertexDatasetName"]);return i!=null&&O(e,["vertexMultimodalDatasetSource","datasetName"],i),e}function COr(t){let e={},n=D(t,["data"]);if(n!=null&&O(e,["data"],n),D(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");let r=D(t,["mimeType"]);return r!=null&&O(e,["mimeType"],r),e}function IOr(t,e){let n={},r=D(e,["name"]);return r!=null&&O(n,["_url","name"],Rq(t,r)),n}function xOr(t,e){let n={},r=D(e,["name"]);return r!=null&&O(n,["_url","name"],Rq(t,r)),n}function wOr(t){let e={},n=D(t,["content"]);n!=null&&O(e,["content"],n);let r=D(t,["citationMetadata"]);r!=null&&O(e,["citationMetadata"],TOr(r));let s=D(t,["tokenCount"]);s!=null&&O(e,["tokenCount"],s);let i=D(t,["finishReason"]);i!=null&&O(e,["finishReason"],i);let o=D(t,["groundingMetadata"]);o!=null&&O(e,["groundingMetadata"],o);let a=D(t,["avgLogprobs"]);a!=null&&O(e,["avgLogprobs"],a);let c=D(t,["index"]);c!=null&&O(e,["index"],c);let u=D(t,["logprobsResult"]);u!=null&&O(e,["logprobsResult"],u);let l=D(t,["safetyRatings"]);if(l!=null){let h=l;Array.isArray(h)&&(h=h.map(m=>m)),O(e,["safetyRatings"],h)}let d=D(t,["urlContextMetadata"]);return d!=null&&O(e,["urlContextMetadata"],d),e}function TOr(t){let e={},n=D(t,["citationSources"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(s=>s)),O(e,["citations"],r)}return e}function UHt(t){let e={},n=D(t,["parts"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(i=>sMr(i))),O(e,["parts"],s)}let r=D(t,["role"]);return r!=null&&O(e,["role"],r),e}function vOr(t,e){let n={},r=D(t,["displayName"]);if(e!==void 0&&r!=null&&O(e,["batch","displayName"],r),D(t,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");let s=D(t,["webhookConfig"]);return e!==void 0&&s!=null&&O(e,["batch","webhookConfig"],s),n}function ROr(t,e){let n={},r=D(t,["displayName"]);e!==void 0&&r!=null&&O(e,["displayName"],r);let s=D(t,["dest"]);if(e!==void 0&&s!=null&&O(e,["outputConfig"],EOr(mOr(s))),D(t,["webhookConfig"])!==void 0)throw new Error("webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return n}function J3t(t,e){let n={},r=D(e,["model"]);r!=null&&O(n,["_url","model"],Bo(t,r));let s=D(e,["src"]);s!=null&&O(n,["batch","inputConfig"],_Or(t,LHt(t,s)));let i=D(e,["config"]);return i!=null&&vOr(i,n),n}function kOr(t,e){let n={},r=D(e,["model"]);r!=null&&O(n,["model"],Bo(t,r));let s=D(e,["src"]);s!=null&&O(n,["inputConfig"],SOr(LHt(t,s)));let i=D(e,["config"]);return i!=null&&ROr(i,n),n}function NOr(t,e){let n={},r=D(t,["displayName"]);return e!==void 0&&r!=null&&O(e,["batch","displayName"],r),n}function DOr(t,e){let n={},r=D(e,["model"]);r!=null&&O(n,["_url","model"],Bo(t,r));let s=D(e,["src"]);s!=null&&O(n,["batch","inputConfig"],QOr(t,s));let i=D(e,["config"]);return i!=null&&NOr(i,n),n}function BOr(t,e){let n={},r=D(e,["name"]);return r!=null&&O(n,["_url","name"],Rq(t,r)),n}function POr(t,e){let n={},r=D(e,["name"]);return r!=null&&O(n,["_url","name"],Rq(t,r)),n}function OOr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["name"]);r!=null&&O(e,["name"],r);let s=D(t,["done"]);s!=null&&O(e,["done"],s);let i=D(t,["error"]);return i!=null&&O(e,["error"],i),e}function MOr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["name"]);r!=null&&O(e,["name"],r);let s=D(t,["done"]);s!=null&&O(e,["done"],s);let i=D(t,["error"]);return i!=null&&O(e,["error"],i),e}function LOr(t,e){let n={},r=D(e,["contents"]);if(r!=null){let i=M4e(t,r);Array.isArray(i)&&(i=i.map(o=>o)),O(n,["requests[]","request","content"],i)}let s=D(e,["config"]);return s!=null&&(O(n,["_self"],FOr(s,n)),jPr(n,{"requests[].*":"requests[].request.*"})),n}function FOr(t,e){let n={},r=D(t,["taskType"]);e!==void 0&&r!=null&&O(e,["requests[]","taskType"],r);let s=D(t,["title"]);e!==void 0&&s!=null&&O(e,["requests[]","title"],s);let i=D(t,["outputDimensionality"]);if(e!==void 0&&i!=null&&O(e,["requests[]","outputDimensionality"],i),D(t,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(D(t,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");if(D(t,["documentOcr"])!==void 0)throw new Error("documentOcr parameter is not supported in Gemini API.");if(D(t,["audioTrackExtraction"])!==void 0)throw new Error("audioTrackExtraction parameter is not supported in Gemini API.");return n}function QOr(t,e){let n={},r=D(e,["fileName"]);r!=null&&O(n,["file_name"],r);let s=D(e,["inlinedRequests"]);return s!=null&&O(n,["requests"],LOr(t,s)),n}function UOr(t){let e={};if(D(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");let n=D(t,["fileUri"]);n!=null&&O(e,["fileUri"],n);let r=D(t,["mimeType"]);return r!=null&&O(e,["mimeType"],r),e}function $Or(t){let e={},n=D(t,["id"]);n!=null&&O(e,["id"],n);let r=D(t,["args"]);r!=null&&O(e,["args"],r);let s=D(t,["name"]);if(s!=null&&O(e,["name"],s),D(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(D(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function GOr(t){let e={},n=D(t,["allowedFunctionNames"]);n!=null&&O(e,["allowedFunctionNames"],n);let r=D(t,["mode"]);if(r!=null&&O(e,["mode"],r),D(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return e}function WOr(t,e,n){let r={},s=D(e,["systemInstruction"]);n!==void 0&&s!=null&&O(n,["systemInstruction"],UHt(ep(s)));let i=D(e,["temperature"]);i!=null&&O(r,["temperature"],i);let o=D(e,["topP"]);o!=null&&O(r,["topP"],o);let a=D(e,["topK"]);a!=null&&O(r,["topK"],a);let c=D(e,["candidateCount"]);c!=null&&O(r,["candidateCount"],c);let u=D(e,["maxOutputTokens"]);u!=null&&O(r,["maxOutputTokens"],u);let l=D(e,["stopSequences"]);l!=null&&O(r,["stopSequences"],l);let d=D(e,["responseLogprobs"]);d!=null&&O(r,["responseLogprobs"],d);let h=D(e,["logprobs"]);h!=null&&O(r,["logprobs"],h);let m=D(e,["presencePenalty"]);m!=null&&O(r,["presencePenalty"],m);let f=D(e,["frequencyPenalty"]);f!=null&&O(r,["frequencyPenalty"],f);let g=D(e,["seed"]);g!=null&&O(r,["seed"],g);let A=D(e,["responseMimeType"]);A!=null&&O(r,["responseMimeType"],A);let y=D(e,["responseSchema"]);y!=null&&O(r,["responseSchema"],L4e(y));let b=D(e,["responseJsonSchema"]);if(b!=null&&O(r,["responseJsonSchema"],b),D(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(D(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");let S=D(e,["safetySettings"]);if(n!==void 0&&S!=null){let H=S;Array.isArray(H)&&(H=H.map(oe=>iMr(oe))),O(n,["safetySettings"],H)}let C=D(e,["tools"]);if(n!==void 0&&C!=null){let H=vq(C);Array.isArray(H)&&(H=H.map(oe=>aMr(Tq(oe)))),O(n,["tools"],H)}let I=D(e,["toolConfig"]);if(n!==void 0&&I!=null&&O(n,["toolConfig"],oMr(I)),D(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");let x=D(e,["cachedContent"]);n!==void 0&&x!=null&&O(n,["cachedContent"],hw(t,x));let w=D(e,["responseModalities"]);w!=null&&O(r,["responseModalities"],w);let R=D(e,["mediaResolution"]);R!=null&&O(r,["mediaResolution"],R);let N=D(e,["speechConfig"]);if(N!=null&&O(r,["speechConfig"],F4e(N)),D(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");let P=D(e,["thinkingConfig"]);P!=null&&O(r,["thinkingConfig"],P);let G=D(e,["imageConfig"]);G!=null&&O(r,["imageConfig"],KOr(G));let $=D(e,["enableEnhancedCivicAnswers"]);if($!=null&&O(r,["enableEnhancedCivicAnswers"],$),D(e,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");let Q=D(e,["serviceTier"]);return n!==void 0&&Q!=null&&O(n,["serviceTier"],Q),r}function qOr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["candidates"]);if(r!=null){let u=r;Array.isArray(u)&&(u=u.map(l=>wOr(l))),O(e,["candidates"],u)}let s=D(t,["modelVersion"]);s!=null&&O(e,["modelVersion"],s);let i=D(t,["promptFeedback"]);i!=null&&O(e,["promptFeedback"],i);let o=D(t,["responseId"]);o!=null&&O(e,["responseId"],o);let a=D(t,["usageMetadata"]);a!=null&&O(e,["usageMetadata"],a);let c=D(t,["modelStatus"]);return c!=null&&O(e,["modelStatus"],c),e}function HOr(t,e){let n={},r=D(e,["name"]);return r!=null&&O(n,["_url","name"],Rq(t,r)),n}function VOr(t,e){let n={},r=D(e,["name"]);return r!=null&&O(n,["_url","name"],Rq(t,r)),n}function jOr(t){let e={},n=D(t,["authConfig"]);n!=null&&O(e,["authConfig"],gOr(n));let r=D(t,["enableWidget"]);return r!=null&&O(e,["enableWidget"],r),e}function YOr(t){let e={},n=D(t,["searchTypes"]);if(n!=null&&O(e,["searchTypes"],n),D(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(D(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");let r=D(t,["timeRangeFilter"]);return r!=null&&O(e,["timeRangeFilter"],r),e}function KOr(t){let e={},n=D(t,["aspectRatio"]);n!=null&&O(e,["aspectRatio"],n);let r=D(t,["imageSize"]);if(r!=null&&O(e,["imageSize"],r),D(t,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(D(t,["prominentPeople"])!==void 0)throw new Error("prominentPeople parameter is not supported in Gemini API.");if(D(t,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(D(t,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");if(D(t,["imageOutputOptions"])!==void 0)throw new Error("imageOutputOptions parameter is not supported in Gemini API.");return e}function zOr(t,e){let n={},r=D(e,["model"]);r!=null&&O(n,["request","model"],Bo(t,r));let s=D(e,["contents"]);if(s!=null){let a=qf(s);Array.isArray(a)&&(a=a.map(c=>UHt(c))),O(n,["request","contents"],a)}let i=D(e,["metadata"]);i!=null&&O(n,["metadata"],i);let o=D(e,["config"]);return o!=null&&O(n,["request","generationConfig"],WOr(t,o,D(n,["request"],{}))),n}function JOr(t){let e={},n=D(t,["response"]);n!=null&&O(e,["response"],qOr(n));let r=D(t,["metadata"]);r!=null&&O(e,["metadata"],r);let s=D(t,["error"]);return s!=null&&O(e,["error"],s),e}function XOr(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&O(e,["_query","pageSize"],r);let s=D(t,["pageToken"]);if(e!==void 0&&s!=null&&O(e,["_query","pageToken"],s),D(t,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return n}function ZOr(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&O(e,["_query","pageSize"],r);let s=D(t,["pageToken"]);e!==void 0&&s!=null&&O(e,["_query","pageToken"],s);let i=D(t,["filter"]);return e!==void 0&&i!=null&&O(e,["_query","filter"],i),n}function eMr(t){let e={},n=D(t,["config"]);return n!=null&&XOr(n,e),e}function tMr(t){let e={},n=D(t,["config"]);return n!=null&&ZOr(n,e),e}function nMr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&O(e,["nextPageToken"],r);let s=D(t,["operations"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>Nfe(o))),O(e,["batchJobs"],i)}return e}function rMr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&O(e,["nextPageToken"],r);let s=D(t,["batchPredictionJobs"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>Z5e(o))),O(e,["batchJobs"],i)}return e}function sMr(t){let e={},n=D(t,["mediaResolution"]);n!=null&&O(e,["mediaResolution"],n);let r=D(t,["codeExecutionResult"]);r!=null&&O(e,["codeExecutionResult"],r);let s=D(t,["executableCode"]);s!=null&&O(e,["executableCode"],s);let i=D(t,["fileData"]);i!=null&&O(e,["fileData"],UOr(i));let o=D(t,["functionCall"]);o!=null&&O(e,["functionCall"],$Or(o));let a=D(t,["functionResponse"]);a!=null&&O(e,["functionResponse"],a);let c=D(t,["inlineData"]);c!=null&&O(e,["inlineData"],COr(c));let u=D(t,["text"]);u!=null&&O(e,["text"],u);let l=D(t,["thought"]);l!=null&&O(e,["thought"],l);let d=D(t,["thoughtSignature"]);d!=null&&O(e,["thoughtSignature"],d);let h=D(t,["videoMetadata"]);h!=null&&O(e,["videoMetadata"],h);let m=D(t,["toolCall"]);m!=null&&O(e,["toolCall"],m);let f=D(t,["toolResponse"]);f!=null&&O(e,["toolResponse"],f);let g=D(t,["partMetadata"]);return g!=null&&O(e,["partMetadata"],g),e}function iMr(t){let e={},n=D(t,["category"]);if(n!=null&&O(e,["category"],n),D(t,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");let r=D(t,["threshold"]);return r!=null&&O(e,["threshold"],r),e}function oMr(t){let e={},n=D(t,["retrievalConfig"]);n!=null&&O(e,["retrievalConfig"],n);let r=D(t,["functionCallingConfig"]);r!=null&&O(e,["functionCallingConfig"],GOr(r));let s=D(t,["includeServerSideToolInvocations"]);return s!=null&&O(e,["includeServerSideToolInvocations"],s),e}function aMr(t){let e={};if(D(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");let n=D(t,["computerUse"]);n!=null&&O(e,["computerUse"],n);let r=D(t,["fileSearch"]);r!=null&&O(e,["fileSearch"],r);let s=D(t,["googleSearch"]);s!=null&&O(e,["googleSearch"],YOr(s));let i=D(t,["googleMaps"]);i!=null&&O(e,["googleMaps"],jOr(i));let o=D(t,["codeExecution"]);if(o!=null&&O(e,["codeExecution"],o),D(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");let a=D(t,["functionDeclarations"]);if(a!=null){let d=a;Array.isArray(d)&&(d=d.map(h=>h)),O(e,["functionDeclarations"],d)}let c=D(t,["googleSearchRetrieval"]);if(c!=null&&O(e,["googleSearchRetrieval"],c),D(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");let u=D(t,["urlContext"]);u!=null&&O(e,["urlContext"],u);let l=D(t,["mcpServers"]);if(l!=null){let d=l;Array.isArray(d)&&(d=d.map(h=>h)),O(e,["mcpServers"],d)}return e}function cMr(t){let e={},n=D(t,["bigqueryDestination","outputUri"]);n!=null&&O(e,["bigqueryDestination"],n);let r=D(t,["displayName"]);return r!=null&&O(e,["displayName"],r),e}function lMr(t){let e={},n=D(t,["bigqueryDestination"]);n!=null&&O(e,["bigqueryDestination","outputUri"],n);let r=D(t,["displayName"]);return r!=null&&O(e,["displayName"],r),e}function uMr(t){let e={},n=D(t,["apiKey"]);if(n!=null&&O(e,["apiKey"],n),D(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(D(t,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(D(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(D(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(D(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(D(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return e}function dMr(t){let e={},n=D(t,["data"]);if(n!=null&&O(e,["data"],n),D(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");let r=D(t,["mimeType"]);return r!=null&&O(e,["mimeType"],r),e}function X3t(t){let e={},n=D(t,["parts"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(i=>PMr(i))),O(e,["parts"],s)}let r=D(t,["role"]);return r!=null&&O(e,["role"],r),e}function Z3t(t){let e={},n=D(t,["parts"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(i=>OMr(i))),O(e,["parts"],s)}let r=D(t,["role"]);return r!=null&&O(e,["role"],r),e}function pMr(t,e){let n={},r=D(t,["ttl"]);e!==void 0&&r!=null&&O(e,["ttl"],r);let s=D(t,["expireTime"]);e!==void 0&&s!=null&&O(e,["expireTime"],s);let i=D(t,["displayName"]);e!==void 0&&i!=null&&O(e,["displayName"],i);let o=D(t,["contents"]);if(e!==void 0&&o!=null){let l=qf(o);Array.isArray(l)&&(l=l.map(d=>X3t(d))),O(e,["contents"],l)}let a=D(t,["systemInstruction"]);e!==void 0&&a!=null&&O(e,["systemInstruction"],X3t(ep(a)));let c=D(t,["tools"]);if(e!==void 0&&c!=null){let l=c;Array.isArray(l)&&(l=l.map(d=>FMr(d))),O(e,["tools"],l)}let u=D(t,["toolConfig"]);if(e!==void 0&&u!=null&&O(e,["toolConfig"],MMr(u)),D(t,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return n}function hMr(t,e){let n={},r=D(t,["ttl"]);e!==void 0&&r!=null&&O(e,["ttl"],r);let s=D(t,["expireTime"]);e!==void 0&&s!=null&&O(e,["expireTime"],s);let i=D(t,["displayName"]);e!==void 0&&i!=null&&O(e,["displayName"],i);let o=D(t,["contents"]);if(e!==void 0&&o!=null){let d=qf(o);Array.isArray(d)&&(d=d.map(h=>Z3t(h))),O(e,["contents"],d)}let a=D(t,["systemInstruction"]);e!==void 0&&a!=null&&O(e,["systemInstruction"],Z3t(ep(a)));let c=D(t,["tools"]);if(e!==void 0&&c!=null){let d=c;Array.isArray(d)&&(d=d.map(h=>QMr(h))),O(e,["tools"],d)}let u=D(t,["toolConfig"]);e!==void 0&&u!=null&&O(e,["toolConfig"],LMr(u));let l=D(t,["kmsKeyName"]);return e!==void 0&&l!=null&&O(e,["encryption_spec","kmsKeyName"],l),n}function mMr(t,e){let n={},r=D(e,["model"]);r!=null&&O(n,["model"],THt(t,r));let s=D(e,["config"]);return s!=null&&pMr(s,n),n}function fMr(t,e){let n={},r=D(e,["model"]);r!=null&&O(n,["model"],THt(t,r));let s=D(e,["config"]);return s!=null&&hMr(s,n),n}function gMr(t,e){let n={},r=D(e,["name"]);return r!=null&&O(n,["_url","name"],hw(t,r)),n}function AMr(t,e){let n={},r=D(e,["name"]);return r!=null&&O(n,["_url","name"],hw(t,r)),n}function yMr(t){let e={},n=D(t,["sdkHttpResponse"]);return n!=null&&O(e,["sdkHttpResponse"],n),e}function EMr(t){let e={},n=D(t,["sdkHttpResponse"]);return n!=null&&O(e,["sdkHttpResponse"],n),e}function bMr(t){let e={};if(D(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");let n=D(t,["fileUri"]);n!=null&&O(e,["fileUri"],n);let r=D(t,["mimeType"]);return r!=null&&O(e,["mimeType"],r),e}function _Mr(t){let e={},n=D(t,["id"]);n!=null&&O(e,["id"],n);let r=D(t,["args"]);r!=null&&O(e,["args"],r);let s=D(t,["name"]);if(s!=null&&O(e,["name"],s),D(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(D(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function SMr(t){let e={},n=D(t,["allowedFunctionNames"]);n!=null&&O(e,["allowedFunctionNames"],n);let r=D(t,["mode"]);if(r!=null&&O(e,["mode"],r),D(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return e}function CMr(t){let e={},n=D(t,["description"]);n!=null&&O(e,["description"],n);let r=D(t,["name"]);r!=null&&O(e,["name"],r);let s=D(t,["parameters"]);s!=null&&O(e,["parameters"],s);let i=D(t,["parametersJsonSchema"]);i!=null&&O(e,["parametersJsonSchema"],i);let o=D(t,["response"]);o!=null&&O(e,["response"],o);let a=D(t,["responseJsonSchema"]);if(a!=null&&O(e,["responseJsonSchema"],a),D(t,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return e}function IMr(t,e){let n={},r=D(e,["name"]);return r!=null&&O(n,["_url","name"],hw(t,r)),n}function xMr(t,e){let n={},r=D(e,["name"]);return r!=null&&O(n,["_url","name"],hw(t,r)),n}function wMr(t){let e={},n=D(t,["authConfig"]);n!=null&&O(e,["authConfig"],uMr(n));let r=D(t,["enableWidget"]);return r!=null&&O(e,["enableWidget"],r),e}function TMr(t){let e={},n=D(t,["searchTypes"]);if(n!=null&&O(e,["searchTypes"],n),D(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(D(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");let r=D(t,["timeRangeFilter"]);return r!=null&&O(e,["timeRangeFilter"],r),e}function vMr(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&O(e,["_query","pageSize"],r);let s=D(t,["pageToken"]);return e!==void 0&&s!=null&&O(e,["_query","pageToken"],s),n}function RMr(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&O(e,["_query","pageSize"],r);let s=D(t,["pageToken"]);return e!==void 0&&s!=null&&O(e,["_query","pageToken"],s),n}function kMr(t){let e={},n=D(t,["config"]);return n!=null&&vMr(n,e),e}function NMr(t){let e={},n=D(t,["config"]);return n!=null&&RMr(n,e),e}function DMr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&O(e,["nextPageToken"],r);let s=D(t,["cachedContents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>o)),O(e,["cachedContents"],i)}return e}function BMr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&O(e,["nextPageToken"],r);let s=D(t,["cachedContents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>o)),O(e,["cachedContents"],i)}return e}function PMr(t){let e={},n=D(t,["mediaResolution"]);n!=null&&O(e,["mediaResolution"],n);let r=D(t,["codeExecutionResult"]);r!=null&&O(e,["codeExecutionResult"],r);let s=D(t,["executableCode"]);s!=null&&O(e,["executableCode"],s);let i=D(t,["fileData"]);i!=null&&O(e,["fileData"],bMr(i));let o=D(t,["functionCall"]);o!=null&&O(e,["functionCall"],_Mr(o));let a=D(t,["functionResponse"]);a!=null&&O(e,["functionResponse"],a);let c=D(t,["inlineData"]);c!=null&&O(e,["inlineData"],dMr(c));let u=D(t,["text"]);u!=null&&O(e,["text"],u);let l=D(t,["thought"]);l!=null&&O(e,["thought"],l);let d=D(t,["thoughtSignature"]);d!=null&&O(e,["thoughtSignature"],d);let h=D(t,["videoMetadata"]);h!=null&&O(e,["videoMetadata"],h);let m=D(t,["toolCall"]);m!=null&&O(e,["toolCall"],m);let f=D(t,["toolResponse"]);f!=null&&O(e,["toolResponse"],f);let g=D(t,["partMetadata"]);return g!=null&&O(e,["partMetadata"],g),e}function OMr(t){let e={},n=D(t,["mediaResolution"]);n!=null&&O(e,["mediaResolution"],n);let r=D(t,["codeExecutionResult"]);r!=null&&O(e,["codeExecutionResult"],r);let s=D(t,["executableCode"]);s!=null&&O(e,["executableCode"],s);let i=D(t,["fileData"]);i!=null&&O(e,["fileData"],i);let o=D(t,["functionCall"]);o!=null&&O(e,["functionCall"],o);let a=D(t,["functionResponse"]);a!=null&&O(e,["functionResponse"],a);let c=D(t,["inlineData"]);c!=null&&O(e,["inlineData"],c);let u=D(t,["text"]);u!=null&&O(e,["text"],u);let l=D(t,["thought"]);l!=null&&O(e,["thought"],l);let d=D(t,["thoughtSignature"]);d!=null&&O(e,["thoughtSignature"],d);let h=D(t,["videoMetadata"]);if(h!=null&&O(e,["videoMetadata"],h),D(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");if(D(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");if(D(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return e}function MMr(t){let e={},n=D(t,["retrievalConfig"]);n!=null&&O(e,["retrievalConfig"],n);let r=D(t,["functionCallingConfig"]);r!=null&&O(e,["functionCallingConfig"],SMr(r));let s=D(t,["includeServerSideToolInvocations"]);return s!=null&&O(e,["includeServerSideToolInvocations"],s),e}function LMr(t){let e={},n=D(t,["retrievalConfig"]);n!=null&&O(e,["retrievalConfig"],n);let r=D(t,["functionCallingConfig"]);if(r!=null&&O(e,["functionCallingConfig"],r),D(t,["includeServerSideToolInvocations"])!==void 0)throw new Error("includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return e}function FMr(t){let e={};if(D(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");let n=D(t,["computerUse"]);n!=null&&O(e,["computerUse"],n);let r=D(t,["fileSearch"]);r!=null&&O(e,["fileSearch"],r);let s=D(t,["googleSearch"]);s!=null&&O(e,["googleSearch"],TMr(s));let i=D(t,["googleMaps"]);i!=null&&O(e,["googleMaps"],wMr(i));let o=D(t,["codeExecution"]);if(o!=null&&O(e,["codeExecution"],o),D(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");let a=D(t,["functionDeclarations"]);if(a!=null){let d=a;Array.isArray(d)&&(d=d.map(h=>h)),O(e,["functionDeclarations"],d)}let c=D(t,["googleSearchRetrieval"]);if(c!=null&&O(e,["googleSearchRetrieval"],c),D(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");let u=D(t,["urlContext"]);u!=null&&O(e,["urlContext"],u);let l=D(t,["mcpServers"]);if(l!=null){let d=l;Array.isArray(d)&&(d=d.map(h=>h)),O(e,["mcpServers"],d)}return e}function QMr(t){let e={},n=D(t,["retrieval"]);n!=null&&O(e,["retrieval"],n);let r=D(t,["computerUse"]);if(r!=null&&O(e,["computerUse"],r),D(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");let s=D(t,["googleSearch"]);s!=null&&O(e,["googleSearch"],s);let i=D(t,["googleMaps"]);i!=null&&O(e,["googleMaps"],i);let o=D(t,["codeExecution"]);o!=null&&O(e,["codeExecution"],o);let a=D(t,["enterpriseWebSearch"]);a!=null&&O(e,["enterpriseWebSearch"],a);let c=D(t,["functionDeclarations"]);if(c!=null){let h=c;Array.isArray(h)&&(h=h.map(m=>CMr(m))),O(e,["functionDeclarations"],h)}let u=D(t,["googleSearchRetrieval"]);u!=null&&O(e,["googleSearchRetrieval"],u);let l=D(t,["parallelAiSearch"]);l!=null&&O(e,["parallelAiSearch"],l);let d=D(t,["urlContext"]);if(d!=null&&O(e,["urlContext"],d),D(t,["mcpServers"])!==void 0)throw new Error("mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return e}function UMr(t,e){let n={},r=D(t,["ttl"]);e!==void 0&&r!=null&&O(e,["ttl"],r);let s=D(t,["expireTime"]);return e!==void 0&&s!=null&&O(e,["expireTime"],s),n}function $Mr(t,e){let n={},r=D(t,["ttl"]);e!==void 0&&r!=null&&O(e,["ttl"],r);let s=D(t,["expireTime"]);return e!==void 0&&s!=null&&O(e,["expireTime"],s),n}function GMr(t,e){let n={},r=D(e,["name"]);r!=null&&O(n,["_url","name"],hw(t,r));let s=D(e,["config"]);return s!=null&&UMr(s,n),n}function WMr(t,e){let n={},r=D(e,["name"]);r!=null&&O(n,["_url","name"],hw(t,r));let s=D(e,["config"]);return s!=null&&$Mr(s,n),n}function Ok(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function oi(t){return this instanceof oi?(this.v=t,this):new oi(t)}function M_(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(m){return function(f){return Promise.resolve(f).then(m,d)}}function a(m,f){r[m]&&(s[m]=function(g){return new Promise(function(A,y){i.push([m,g,A,y])>1||c(m,g)})},f&&(s[m]=f(s[m])))}function c(m,f){try{u(r[m](f))}catch(g){h(i[0][3],g)}}function u(m){m.value instanceof oi?Promise.resolve(m.value.v).then(l,d):h(i[0][2],m)}function l(m){c("next",m)}function d(m){c("throw",m)}function h(m,f){m(f),i.shift(),i.length&&c(i[0][0],i[0][1])}}function L_(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof eHt=="function"?eHt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=t[i]&&function(o){return new Promise(function(a,c){o=t[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}function qMr(t){var e;if(t.candidates==null||t.candidates.length===0)return!1;let n=(e=t.candidates[0])===null||e===void 0?void 0:e.content;return n===void 0?!1:$Ht(n)}function $Ht(t){if(t.parts===void 0||t.parts.length===0)return!1;for(let e of t.parts)if(e===void 0||Object.keys(e).length===0)return!1;return!0}function HMr(t){if(t.length!==0){for(let e of t)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}}function tHt(t){if(t===void 0||t.length===0)return[];let e=[],n=t.length,r=0;for(;ro)),O(e,["files"],i)}return e}function tLr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["files"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>i)),O(e,["files"],s)}return e}function nHt(t){let e={};if(D(t,["languageCodes"])!==void 0)throw new Error("languageCodes parameter is not supported in Gemini API.");return e}function nLr(t){let e={},n=D(t,["apiKey"]);if(n!=null&&O(e,["apiKey"],n),D(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(D(t,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(D(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(D(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(D(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(D(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return e}function Dfe(t){let e={},n=D(t,["data"]);if(n!=null&&O(e,["data"],n),D(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");let r=D(t,["mimeType"]);return r!=null&&O(e,["mimeType"],r),e}function rLr(t){let e={},n=D(t,["parts"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(i=>bLr(i))),O(e,["parts"],s)}let r=D(t,["role"]);return r!=null&&O(e,["role"],r),e}function sLr(t){let e={},n=D(t,["parts"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(i=>_Lr(i))),O(e,["parts"],s)}let r=D(t,["role"]);return r!=null&&O(e,["role"],r),e}function iLr(t){let e={};if(D(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");let n=D(t,["fileUri"]);n!=null&&O(e,["fileUri"],n);let r=D(t,["mimeType"]);return r!=null&&O(e,["mimeType"],r),e}function oLr(t){let e={},n=D(t,["id"]);n!=null&&O(e,["id"],n);let r=D(t,["args"]);r!=null&&O(e,["args"],r);let s=D(t,["name"]);if(s!=null&&O(e,["name"],s),D(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(D(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function aLr(t){let e={},n=D(t,["description"]);n!=null&&O(e,["description"],n);let r=D(t,["name"]);r!=null&&O(e,["name"],r);let s=D(t,["parameters"]);s!=null&&O(e,["parameters"],s);let i=D(t,["parametersJsonSchema"]);i!=null&&O(e,["parametersJsonSchema"],i);let o=D(t,["response"]);o!=null&&O(e,["response"],o);let a=D(t,["responseJsonSchema"]);if(a!=null&&O(e,["responseJsonSchema"],a),D(t,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return e}function cLr(t){let e={},n=D(t,["modelSelectionConfig"]);n!=null&&O(e,["modelConfig"],n);let r=D(t,["responseJsonSchema"]);r!=null&&O(e,["responseJsonSchema"],r);let s=D(t,["audioTimestamp"]);s!=null&&O(e,["audioTimestamp"],s);let i=D(t,["candidateCount"]);i!=null&&O(e,["candidateCount"],i);let o=D(t,["enableAffectiveDialog"]);o!=null&&O(e,["enableAffectiveDialog"],o);let a=D(t,["frequencyPenalty"]);a!=null&&O(e,["frequencyPenalty"],a);let c=D(t,["logprobs"]);c!=null&&O(e,["logprobs"],c);let u=D(t,["maxOutputTokens"]);u!=null&&O(e,["maxOutputTokens"],u);let l=D(t,["mediaResolution"]);l!=null&&O(e,["mediaResolution"],l);let d=D(t,["presencePenalty"]);d!=null&&O(e,["presencePenalty"],d);let h=D(t,["responseLogprobs"]);h!=null&&O(e,["responseLogprobs"],h);let m=D(t,["responseMimeType"]);m!=null&&O(e,["responseMimeType"],m);let f=D(t,["responseModalities"]);f!=null&&O(e,["responseModalities"],f);let g=D(t,["responseSchema"]);g!=null&&O(e,["responseSchema"],g);let A=D(t,["routingConfig"]);A!=null&&O(e,["routingConfig"],A);let y=D(t,["seed"]);y!=null&&O(e,["seed"],y);let b=D(t,["speechConfig"]);b!=null&&O(e,["speechConfig"],b);let S=D(t,["stopSequences"]);S!=null&&O(e,["stopSequences"],S);let C=D(t,["temperature"]);C!=null&&O(e,["temperature"],C);let I=D(t,["thinkingConfig"]);I!=null&&O(e,["thinkingConfig"],I);let x=D(t,["topK"]);x!=null&&O(e,["topK"],x);let w=D(t,["topP"]);if(w!=null&&O(e,["topP"],w),D(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return e}function lLr(t){let e={},n=D(t,["authConfig"]);n!=null&&O(e,["authConfig"],nLr(n));let r=D(t,["enableWidget"]);return r!=null&&O(e,["enableWidget"],r),e}function uLr(t){let e={},n=D(t,["searchTypes"]);if(n!=null&&O(e,["searchTypes"],n),D(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(D(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");let r=D(t,["timeRangeFilter"]);return r!=null&&O(e,["timeRangeFilter"],r),e}function dLr(t,e){let n={},r=D(t,["generationConfig"]);e!==void 0&&r!=null&&O(e,["setup","generationConfig"],r);let s=D(t,["responseModalities"]);e!==void 0&&s!=null&&O(e,["setup","generationConfig","responseModalities"],s);let i=D(t,["temperature"]);e!==void 0&&i!=null&&O(e,["setup","generationConfig","temperature"],i);let o=D(t,["topP"]);e!==void 0&&o!=null&&O(e,["setup","generationConfig","topP"],o);let a=D(t,["topK"]);e!==void 0&&a!=null&&O(e,["setup","generationConfig","topK"],a);let c=D(t,["maxOutputTokens"]);e!==void 0&&c!=null&&O(e,["setup","generationConfig","maxOutputTokens"],c);let u=D(t,["mediaResolution"]);e!==void 0&&u!=null&&O(e,["setup","generationConfig","mediaResolution"],u);let l=D(t,["seed"]);e!==void 0&&l!=null&&O(e,["setup","generationConfig","seed"],l);let d=D(t,["speechConfig"]);e!==void 0&&d!=null&&O(e,["setup","generationConfig","speechConfig"],Q4e(d));let h=D(t,["thinkingConfig"]);e!==void 0&&h!=null&&O(e,["setup","generationConfig","thinkingConfig"],h);let m=D(t,["enableAffectiveDialog"]);e!==void 0&&m!=null&&O(e,["setup","generationConfig","enableAffectiveDialog"],m);let f=D(t,["systemInstruction"]);e!==void 0&&f!=null&&O(e,["setup","systemInstruction"],rLr(ep(f)));let g=D(t,["tools"]);if(e!==void 0&&g!=null){let R=vq(g);Array.isArray(R)&&(R=R.map(N=>ILr(Tq(N)))),O(e,["setup","tools"],R)}let A=D(t,["sessionResumption"]);e!==void 0&&A!=null&&O(e,["setup","sessionResumption"],CLr(A));let y=D(t,["inputAudioTranscription"]);e!==void 0&&y!=null&&O(e,["setup","inputAudioTranscription"],nHt(y));let b=D(t,["outputAudioTranscription"]);e!==void 0&&b!=null&&O(e,["setup","outputAudioTranscription"],nHt(b));let S=D(t,["realtimeInputConfig"]);e!==void 0&&S!=null&&O(e,["setup","realtimeInputConfig"],S);let C=D(t,["contextWindowCompression"]);e!==void 0&&C!=null&&O(e,["setup","contextWindowCompression"],C);let I=D(t,["proactivity"]);if(e!==void 0&&I!=null&&O(e,["setup","proactivity"],I),D(t,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");let x=D(t,["avatarConfig"]);e!==void 0&&x!=null&&O(e,["setup","avatarConfig"],x);let w=D(t,["safetySettings"]);if(e!==void 0&&w!=null){let R=w;Array.isArray(R)&&(R=R.map(N=>SLr(N))),O(e,["setup","safetySettings"],R)}return n}function pLr(t,e){let n={},r=D(t,["generationConfig"]);e!==void 0&&r!=null&&O(e,["setup","generationConfig"],cLr(r));let s=D(t,["responseModalities"]);e!==void 0&&s!=null&&O(e,["setup","generationConfig","responseModalities"],s);let i=D(t,["temperature"]);e!==void 0&&i!=null&&O(e,["setup","generationConfig","temperature"],i);let o=D(t,["topP"]);e!==void 0&&o!=null&&O(e,["setup","generationConfig","topP"],o);let a=D(t,["topK"]);e!==void 0&&a!=null&&O(e,["setup","generationConfig","topK"],a);let c=D(t,["maxOutputTokens"]);e!==void 0&&c!=null&&O(e,["setup","generationConfig","maxOutputTokens"],c);let u=D(t,["mediaResolution"]);e!==void 0&&u!=null&&O(e,["setup","generationConfig","mediaResolution"],u);let l=D(t,["seed"]);e!==void 0&&l!=null&&O(e,["setup","generationConfig","seed"],l);let d=D(t,["speechConfig"]);e!==void 0&&d!=null&&O(e,["setup","generationConfig","speechConfig"],Q4e(d));let h=D(t,["thinkingConfig"]);e!==void 0&&h!=null&&O(e,["setup","generationConfig","thinkingConfig"],h);let m=D(t,["enableAffectiveDialog"]);e!==void 0&&m!=null&&O(e,["setup","generationConfig","enableAffectiveDialog"],m);let f=D(t,["systemInstruction"]);e!==void 0&&f!=null&&O(e,["setup","systemInstruction"],sLr(ep(f)));let g=D(t,["tools"]);if(e!==void 0&&g!=null){let N=vq(g);Array.isArray(N)&&(N=N.map(P=>xLr(Tq(P)))),O(e,["setup","tools"],N)}let A=D(t,["sessionResumption"]);e!==void 0&&A!=null&&O(e,["setup","sessionResumption"],A);let y=D(t,["inputAudioTranscription"]);e!==void 0&&y!=null&&O(e,["setup","inputAudioTranscription"],y);let b=D(t,["outputAudioTranscription"]);e!==void 0&&b!=null&&O(e,["setup","outputAudioTranscription"],b);let S=D(t,["realtimeInputConfig"]);e!==void 0&&S!=null&&O(e,["setup","realtimeInputConfig"],S);let C=D(t,["contextWindowCompression"]);e!==void 0&&C!=null&&O(e,["setup","contextWindowCompression"],C);let I=D(t,["proactivity"]);e!==void 0&&I!=null&&O(e,["setup","proactivity"],I);let x=D(t,["explicitVadSignal"]);e!==void 0&&x!=null&&O(e,["setup","explicitVadSignal"],x);let w=D(t,["avatarConfig"]);e!==void 0&&w!=null&&O(e,["setup","avatarConfig"],w);let R=D(t,["safetySettings"]);if(e!==void 0&&R!=null){let N=R;Array.isArray(N)&&(N=N.map(P=>P)),O(e,["setup","safetySettings"],N)}return n}function hLr(t,e){let n={},r=D(e,["model"]);r!=null&&O(n,["setup","model"],Bo(t,r));let s=D(e,["config"]);return s!=null&&O(n,["config"],dLr(s,n)),n}function mLr(t,e){let n={},r=D(e,["model"]);r!=null&&O(n,["setup","model"],Bo(t,r));let s=D(e,["config"]);return s!=null&&O(n,["config"],pLr(s,n)),n}function fLr(t){let e={},n=D(t,["musicGenerationConfig"]);return n!=null&&O(e,["musicGenerationConfig"],n),e}function gLr(t){let e={},n=D(t,["weightedPrompts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(s=>s)),O(e,["weightedPrompts"],r)}return e}function ALr(t){let e={},n=D(t,["media"]);if(n!=null){let u=vHt(n);Array.isArray(u)&&(u=u.map(l=>Dfe(l))),O(e,["mediaChunks"],u)}let r=D(t,["audio"]);r!=null&&O(e,["audio"],Dfe(kHt(r)));let s=D(t,["audioStreamEnd"]);s!=null&&O(e,["audioStreamEnd"],s);let i=D(t,["video"]);i!=null&&O(e,["video"],Dfe(RHt(i)));let o=D(t,["text"]);o!=null&&O(e,["text"],o);let a=D(t,["activityStart"]);a!=null&&O(e,["activityStart"],a);let c=D(t,["activityEnd"]);return c!=null&&O(e,["activityEnd"],c),e}function yLr(t){let e={},n=D(t,["media"]);if(n!=null){let u=vHt(n);Array.isArray(u)&&(u=u.map(l=>l)),O(e,["mediaChunks"],u)}let r=D(t,["audio"]);r!=null&&O(e,["audio"],kHt(r));let s=D(t,["audioStreamEnd"]);s!=null&&O(e,["audioStreamEnd"],s);let i=D(t,["video"]);i!=null&&O(e,["video"],RHt(i));let o=D(t,["text"]);o!=null&&O(e,["text"],o);let a=D(t,["activityStart"]);a!=null&&O(e,["activityStart"],a);let c=D(t,["activityEnd"]);return c!=null&&O(e,["activityEnd"],c),e}function ELr(t){let e={},n=D(t,["setupComplete"]);n!=null&&O(e,["setupComplete"],n);let r=D(t,["serverContent"]);r!=null&&O(e,["serverContent"],r);let s=D(t,["toolCall"]);s!=null&&O(e,["toolCall"],s);let i=D(t,["toolCallCancellation"]);i!=null&&O(e,["toolCallCancellation"],i);let o=D(t,["usageMetadata"]);o!=null&&O(e,["usageMetadata"],wLr(o));let a=D(t,["goAway"]);a!=null&&O(e,["goAway"],a);let c=D(t,["sessionResumptionUpdate"]);c!=null&&O(e,["sessionResumptionUpdate"],c);let u=D(t,["voiceActivityDetectionSignal"]);u!=null&&O(e,["voiceActivityDetectionSignal"],u);let l=D(t,["voiceActivity"]);return l!=null&&O(e,["voiceActivity"],TLr(l)),e}function bLr(t){let e={},n=D(t,["mediaResolution"]);n!=null&&O(e,["mediaResolution"],n);let r=D(t,["codeExecutionResult"]);r!=null&&O(e,["codeExecutionResult"],r);let s=D(t,["executableCode"]);s!=null&&O(e,["executableCode"],s);let i=D(t,["fileData"]);i!=null&&O(e,["fileData"],iLr(i));let o=D(t,["functionCall"]);o!=null&&O(e,["functionCall"],oLr(o));let a=D(t,["functionResponse"]);a!=null&&O(e,["functionResponse"],a);let c=D(t,["inlineData"]);c!=null&&O(e,["inlineData"],Dfe(c));let u=D(t,["text"]);u!=null&&O(e,["text"],u);let l=D(t,["thought"]);l!=null&&O(e,["thought"],l);let d=D(t,["thoughtSignature"]);d!=null&&O(e,["thoughtSignature"],d);let h=D(t,["videoMetadata"]);h!=null&&O(e,["videoMetadata"],h);let m=D(t,["toolCall"]);m!=null&&O(e,["toolCall"],m);let f=D(t,["toolResponse"]);f!=null&&O(e,["toolResponse"],f);let g=D(t,["partMetadata"]);return g!=null&&O(e,["partMetadata"],g),e}function _Lr(t){let e={},n=D(t,["mediaResolution"]);n!=null&&O(e,["mediaResolution"],n);let r=D(t,["codeExecutionResult"]);r!=null&&O(e,["codeExecutionResult"],r);let s=D(t,["executableCode"]);s!=null&&O(e,["executableCode"],s);let i=D(t,["fileData"]);i!=null&&O(e,["fileData"],i);let o=D(t,["functionCall"]);o!=null&&O(e,["functionCall"],o);let a=D(t,["functionResponse"]);a!=null&&O(e,["functionResponse"],a);let c=D(t,["inlineData"]);c!=null&&O(e,["inlineData"],c);let u=D(t,["text"]);u!=null&&O(e,["text"],u);let l=D(t,["thought"]);l!=null&&O(e,["thought"],l);let d=D(t,["thoughtSignature"]);d!=null&&O(e,["thoughtSignature"],d);let h=D(t,["videoMetadata"]);if(h!=null&&O(e,["videoMetadata"],h),D(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");if(D(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");if(D(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return e}function SLr(t){let e={},n=D(t,["category"]);if(n!=null&&O(e,["category"],n),D(t,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");let r=D(t,["threshold"]);return r!=null&&O(e,["threshold"],r),e}function CLr(t){let e={},n=D(t,["handle"]);if(n!=null&&O(e,["handle"],n),D(t,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function ILr(t){let e={};if(D(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");let n=D(t,["computerUse"]);n!=null&&O(e,["computerUse"],n);let r=D(t,["fileSearch"]);r!=null&&O(e,["fileSearch"],r);let s=D(t,["googleSearch"]);s!=null&&O(e,["googleSearch"],uLr(s));let i=D(t,["googleMaps"]);i!=null&&O(e,["googleMaps"],lLr(i));let o=D(t,["codeExecution"]);if(o!=null&&O(e,["codeExecution"],o),D(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");let a=D(t,["functionDeclarations"]);if(a!=null){let d=a;Array.isArray(d)&&(d=d.map(h=>h)),O(e,["functionDeclarations"],d)}let c=D(t,["googleSearchRetrieval"]);if(c!=null&&O(e,["googleSearchRetrieval"],c),D(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");let u=D(t,["urlContext"]);u!=null&&O(e,["urlContext"],u);let l=D(t,["mcpServers"]);if(l!=null){let d=l;Array.isArray(d)&&(d=d.map(h=>h)),O(e,["mcpServers"],d)}return e}function xLr(t){let e={},n=D(t,["retrieval"]);n!=null&&O(e,["retrieval"],n);let r=D(t,["computerUse"]);if(r!=null&&O(e,["computerUse"],r),D(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");let s=D(t,["googleSearch"]);s!=null&&O(e,["googleSearch"],s);let i=D(t,["googleMaps"]);i!=null&&O(e,["googleMaps"],i);let o=D(t,["codeExecution"]);o!=null&&O(e,["codeExecution"],o);let a=D(t,["enterpriseWebSearch"]);a!=null&&O(e,["enterpriseWebSearch"],a);let c=D(t,["functionDeclarations"]);if(c!=null){let h=c;Array.isArray(h)&&(h=h.map(m=>aLr(m))),O(e,["functionDeclarations"],h)}let u=D(t,["googleSearchRetrieval"]);u!=null&&O(e,["googleSearchRetrieval"],u);let l=D(t,["parallelAiSearch"]);l!=null&&O(e,["parallelAiSearch"],l);let d=D(t,["urlContext"]);if(d!=null&&O(e,["urlContext"],d),D(t,["mcpServers"])!==void 0)throw new Error("mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return e}function wLr(t){let e={},n=D(t,["promptTokenCount"]);n!=null&&O(e,["promptTokenCount"],n);let r=D(t,["cachedContentTokenCount"]);r!=null&&O(e,["cachedContentTokenCount"],r);let s=D(t,["candidatesTokenCount"]);s!=null&&O(e,["responseTokenCount"],s);let i=D(t,["toolUsePromptTokenCount"]);i!=null&&O(e,["toolUsePromptTokenCount"],i);let o=D(t,["thoughtsTokenCount"]);o!=null&&O(e,["thoughtsTokenCount"],o);let a=D(t,["totalTokenCount"]);a!=null&&O(e,["totalTokenCount"],a);let c=D(t,["promptTokensDetails"]);if(c!=null){let m=c;Array.isArray(m)&&(m=m.map(f=>f)),O(e,["promptTokensDetails"],m)}let u=D(t,["cacheTokensDetails"]);if(u!=null){let m=u;Array.isArray(m)&&(m=m.map(f=>f)),O(e,["cacheTokensDetails"],m)}let l=D(t,["candidatesTokensDetails"]);if(l!=null){let m=l;Array.isArray(m)&&(m=m.map(f=>f)),O(e,["responseTokensDetails"],m)}let d=D(t,["toolUsePromptTokensDetails"]);if(d!=null){let m=d;Array.isArray(m)&&(m=m.map(f=>f)),O(e,["toolUsePromptTokensDetails"],m)}let h=D(t,["trafficType"]);return h!=null&&O(e,["trafficType"],h),e}function TLr(t){let e={},n=D(t,["type"]);return n!=null&&O(e,["voiceActivityType"],n),e}function vLr(t,e){let n={},r=D(t,["apiKey"]);if(r!=null&&O(n,["apiKey"],r),D(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(D(t,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(D(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(D(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(D(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(D(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return n}function RLr(t,e){let n={},r=D(t,["data"]);if(r!=null&&O(n,["data"],r),D(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");let s=D(t,["mimeType"]);return s!=null&&O(n,["mimeType"],s),n}function kLr(t,e){let n={},r=D(t,["content"]);r!=null&&O(n,["content"],r);let s=D(t,["citationMetadata"]);s!=null&&O(n,["citationMetadata"],NLr(s));let i=D(t,["tokenCount"]);i!=null&&O(n,["tokenCount"],i);let o=D(t,["finishReason"]);o!=null&&O(n,["finishReason"],o);let a=D(t,["groundingMetadata"]);a!=null&&O(n,["groundingMetadata"],a);let c=D(t,["avgLogprobs"]);c!=null&&O(n,["avgLogprobs"],c);let u=D(t,["index"]);u!=null&&O(n,["index"],u);let l=D(t,["logprobsResult"]);l!=null&&O(n,["logprobsResult"],l);let d=D(t,["safetyRatings"]);if(d!=null){let m=d;Array.isArray(m)&&(m=m.map(f=>f)),O(n,["safetyRatings"],m)}let h=D(t,["urlContextMetadata"]);return h!=null&&O(n,["urlContextMetadata"],h),n}function NLr(t,e){let n={},r=D(t,["citationSources"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>i)),O(n,["citations"],s)}return n}function DLr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["contents"]);if(i!=null){let o=qf(i);Array.isArray(o)&&(o=o.map(a=>kq(a))),O(r,["contents"],o)}return r}function BLr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["tokensInfo"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>o)),O(n,["tokensInfo"],i)}return n}function PLr(t,e){let n={},r=D(t,["values"]);r!=null&&O(n,["values"],r);let s=D(t,["statistics"]);return s!=null&&O(n,["statistics"],OLr(s)),n}function OLr(t,e){let n={},r=D(t,["truncated"]);r!=null&&O(n,["truncated"],r);let s=D(t,["token_count"]);return s!=null&&O(n,["tokenCount"],s),n}function cz(t,e){let n={},r=D(t,["parts"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(o=>qFr(o))),O(n,["parts"],i)}let s=D(t,["role"]);return s!=null&&O(n,["role"],s),n}function kq(t,e){let n={},r=D(t,["parts"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(o=>HFr(o))),O(n,["parts"],i)}let s=D(t,["role"]);return s!=null&&O(n,["role"],s),n}function MLr(t,e){let n={},r=D(t,["controlType"]);r!=null&&O(n,["controlType"],r);let s=D(t,["enableControlImageComputation"]);return s!=null&&O(n,["computeControl"],s),n}function LLr(t,e){let n={};if(D(t,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(D(t,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(D(t,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return n}function FLr(t,e,n){let r={},s=D(t,["systemInstruction"]);e!==void 0&&s!=null&&O(e,["systemInstruction"],kq(ep(s)));let i=D(t,["tools"]);if(e!==void 0&&i!=null){let a=i;Array.isArray(a)&&(a=a.map(c=>HHt(c))),O(e,["tools"],a)}let o=D(t,["generationConfig"]);return e!==void 0&&o!=null&&O(e,["generationConfig"],RFr(o)),r}function QLr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["contents"]);if(i!=null){let a=qf(i);Array.isArray(a)&&(a=a.map(c=>cz(c))),O(r,["contents"],a)}let o=D(e,["config"]);return o!=null&&LLr(o),r}function ULr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["contents"]);if(i!=null){let a=qf(i);Array.isArray(a)&&(a=a.map(c=>kq(c))),O(r,["contents"],a)}let o=D(e,["config"]);return o!=null&&FLr(o,r),r}function $Lr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["totalTokens"]);s!=null&&O(n,["totalTokens"],s);let i=D(t,["cachedContentTokenCount"]);return i!=null&&O(n,["cachedContentTokenCount"],i),n}function GLr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["totalTokens"]);return s!=null&&O(n,["totalTokens"],s),n}function WLr(t,e,n){let r={},s=D(e,["model"]);return s!=null&&O(r,["_url","name"],Bo(t,s)),r}function qLr(t,e,n){let r={},s=D(e,["model"]);return s!=null&&O(r,["_url","name"],Bo(t,s)),r}function HLr(t,e){let n={},r=D(t,["sdkHttpResponse"]);return r!=null&&O(n,["sdkHttpResponse"],r),n}function VLr(t,e){let n={},r=D(t,["sdkHttpResponse"]);return r!=null&&O(n,["sdkHttpResponse"],r),n}function jLr(t,e,n){let r={},s=D(t,["outputGcsUri"]);e!==void 0&&s!=null&&O(e,["parameters","storageUri"],s);let i=D(t,["negativePrompt"]);e!==void 0&&i!=null&&O(e,["parameters","negativePrompt"],i);let o=D(t,["numberOfImages"]);e!==void 0&&o!=null&&O(e,["parameters","sampleCount"],o);let a=D(t,["aspectRatio"]);e!==void 0&&a!=null&&O(e,["parameters","aspectRatio"],a);let c=D(t,["guidanceScale"]);e!==void 0&&c!=null&&O(e,["parameters","guidanceScale"],c);let u=D(t,["seed"]);e!==void 0&&u!=null&&O(e,["parameters","seed"],u);let l=D(t,["safetyFilterLevel"]);e!==void 0&&l!=null&&O(e,["parameters","safetySetting"],l);let d=D(t,["personGeneration"]);e!==void 0&&d!=null&&O(e,["parameters","personGeneration"],d);let h=D(t,["includeSafetyAttributes"]);e!==void 0&&h!=null&&O(e,["parameters","includeSafetyAttributes"],h);let m=D(t,["includeRaiReason"]);e!==void 0&&m!=null&&O(e,["parameters","includeRaiReason"],m);let f=D(t,["language"]);e!==void 0&&f!=null&&O(e,["parameters","language"],f);let g=D(t,["outputMimeType"]);e!==void 0&&g!=null&&O(e,["parameters","outputOptions","mimeType"],g);let A=D(t,["outputCompressionQuality"]);e!==void 0&&A!=null&&O(e,["parameters","outputOptions","compressionQuality"],A);let y=D(t,["addWatermark"]);e!==void 0&&y!=null&&O(e,["parameters","addWatermark"],y);let b=D(t,["labels"]);e!==void 0&&b!=null&&O(e,["labels"],b);let S=D(t,["editMode"]);e!==void 0&&S!=null&&O(e,["parameters","editMode"],S);let C=D(t,["baseSteps"]);return e!==void 0&&C!=null&&O(e,["parameters","editConfig","baseSteps"],C),r}function YLr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["prompt"]);i!=null&&O(r,["instances[0]","prompt"],i);let o=D(e,["referenceImages"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(u=>JFr(u))),O(r,["instances[0]","referenceImages"],c)}let a=D(e,["config"]);return a!=null&&jLr(a,r),r}function KLr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["predictions"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>dge(o))),O(n,["generatedImages"],i)}return n}function zLr(t,e,n){let r={},s=D(t,["taskType"]);e!==void 0&&s!=null&&O(e,["requests[]","taskType"],s);let i=D(t,["title"]);e!==void 0&&i!=null&&O(e,["requests[]","title"],i);let o=D(t,["outputDimensionality"]);if(e!==void 0&&o!=null&&O(e,["requests[]","outputDimensionality"],o),D(t,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(D(t,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");if(D(t,["documentOcr"])!==void 0)throw new Error("documentOcr parameter is not supported in Gemini API.");if(D(t,["audioTrackExtraction"])!==void 0)throw new Error("audioTrackExtraction parameter is not supported in Gemini API.");return r}function JLr(t,e,n){let r={},s=D(n,["embeddingApiType"]);if(s===void 0&&(s="PREDICT"),s==="PREDICT"){let d=D(t,["taskType"]);e!==void 0&&d!=null&&O(e,["instances[]","task_type"],d)}else if(s==="EMBED_CONTENT"){let d=D(t,["taskType"]);e!==void 0&&d!=null&&O(e,["embedContentConfig","taskType"],d)}let i=D(n,["embeddingApiType"]);if(i===void 0&&(i="PREDICT"),i==="PREDICT"){let d=D(t,["title"]);e!==void 0&&d!=null&&O(e,["instances[]","title"],d)}else if(i==="EMBED_CONTENT"){let d=D(t,["title"]);e!==void 0&&d!=null&&O(e,["embedContentConfig","title"],d)}let o=D(n,["embeddingApiType"]);if(o===void 0&&(o="PREDICT"),o==="PREDICT"){let d=D(t,["outputDimensionality"]);e!==void 0&&d!=null&&O(e,["parameters","outputDimensionality"],d)}else if(o==="EMBED_CONTENT"){let d=D(t,["outputDimensionality"]);e!==void 0&&d!=null&&O(e,["embedContentConfig","outputDimensionality"],d)}let a=D(n,["embeddingApiType"]);if(a===void 0&&(a="PREDICT"),a==="PREDICT"){let d=D(t,["mimeType"]);e!==void 0&&d!=null&&O(e,["instances[]","mimeType"],d)}let c=D(n,["embeddingApiType"]);if(c===void 0&&(c="PREDICT"),c==="PREDICT"){let d=D(t,["autoTruncate"]);e!==void 0&&d!=null&&O(e,["parameters","autoTruncate"],d)}else if(c==="EMBED_CONTENT"){let d=D(t,["autoTruncate"]);e!==void 0&&d!=null&&O(e,["embedContentConfig","autoTruncate"],d)}let u=D(n,["embeddingApiType"]);if(u===void 0&&(u="PREDICT"),u==="EMBED_CONTENT"){let d=D(t,["documentOcr"]);e!==void 0&&d!=null&&O(e,["embedContentConfig","documentOcr"],d)}let l=D(n,["embeddingApiType"]);if(l===void 0&&(l="PREDICT"),l==="EMBED_CONTENT"){let d=D(t,["audioTrackExtraction"]);e!==void 0&&d!=null&&O(e,["embedContentConfig","audioTrackExtraction"],d)}return r}function XLr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["contents"]);if(i!=null){let u=M4e(t,i);Array.isArray(u)&&(u=u.map(l=>l)),O(r,["requests[]","content"],u)}let o=D(e,["content"]);o!=null&&cz(ep(o));let a=D(e,["config"]);a!=null&&zLr(a,r);let c=D(e,["model"]);return c!==void 0&&O(r,["requests[]","model"],Bo(t,c)),r}function ZLr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(n,["embeddingApiType"]);if(i===void 0&&(i="PREDICT"),i==="PREDICT"){let c=D(e,["contents"]);if(c!=null){let u=M4e(t,c);Array.isArray(u)&&(u=u.map(l=>l)),O(r,["instances[]","content"],u)}}let o=D(n,["embeddingApiType"]);if(o===void 0&&(o="PREDICT"),o==="EMBED_CONTENT"){let c=D(e,["content"]);c!=null&&O(r,["content"],kq(ep(c)))}let a=D(e,["config"]);return a!=null&&JLr(a,r,n),r}function eFr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["embeddings"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>a)),O(n,["embeddings"],o)}let i=D(t,["metadata"]);return i!=null&&O(n,["metadata"],i),n}function tFr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["predictions[]","embeddings"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>PLr(a))),O(n,["embeddings"],o)}let i=D(t,["metadata"]);if(i!=null&&O(n,["metadata"],i),e&&D(e,["embeddingApiType"])==="EMBED_CONTENT"){let o=D(t,["embedding"]),a=D(t,["usageMetadata"]),c=D(t,["truncated"]);if(o){let u={};a&&a.promptTokenCount&&(u.tokenCount=a.promptTokenCount),c&&(u.truncated=c),o.statistics=u,O(n,["embeddings"],[o])}}return n}function nFr(t,e){let n={},r=D(t,["endpoint"]);r!=null&&O(n,["name"],r);let s=D(t,["deployedModelId"]);return s!=null&&O(n,["deployedModelId"],s),n}function rFr(t,e){let n={};if(D(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");let r=D(t,["fileUri"]);r!=null&&O(n,["fileUri"],r);let s=D(t,["mimeType"]);return s!=null&&O(n,["mimeType"],s),n}function sFr(t,e){let n={},r=D(t,["id"]);r!=null&&O(n,["id"],r);let s=D(t,["args"]);s!=null&&O(n,["args"],s);let i=D(t,["name"]);if(i!=null&&O(n,["name"],i),D(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(D(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return n}function iFr(t,e){let n={},r=D(t,["allowedFunctionNames"]);r!=null&&O(n,["allowedFunctionNames"],r);let s=D(t,["mode"]);if(s!=null&&O(n,["mode"],s),D(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return n}function oFr(t,e){let n={},r=D(t,["description"]);r!=null&&O(n,["description"],r);let s=D(t,["name"]);s!=null&&O(n,["name"],s);let i=D(t,["parameters"]);i!=null&&O(n,["parameters"],i);let o=D(t,["parametersJsonSchema"]);o!=null&&O(n,["parametersJsonSchema"],o);let a=D(t,["response"]);a!=null&&O(n,["response"],a);let c=D(t,["responseJsonSchema"]);if(c!=null&&O(n,["responseJsonSchema"],c),D(t,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return n}function aFr(t,e,n,r){let s={},i=D(e,["systemInstruction"]);n!==void 0&&i!=null&&O(n,["systemInstruction"],cz(ep(i)));let o=D(e,["temperature"]);o!=null&&O(s,["temperature"],o);let a=D(e,["topP"]);a!=null&&O(s,["topP"],a);let c=D(e,["topK"]);c!=null&&O(s,["topK"],c);let u=D(e,["candidateCount"]);u!=null&&O(s,["candidateCount"],u);let l=D(e,["maxOutputTokens"]);l!=null&&O(s,["maxOutputTokens"],l);let d=D(e,["stopSequences"]);d!=null&&O(s,["stopSequences"],d);let h=D(e,["responseLogprobs"]);h!=null&&O(s,["responseLogprobs"],h);let m=D(e,["logprobs"]);m!=null&&O(s,["logprobs"],m);let f=D(e,["presencePenalty"]);f!=null&&O(s,["presencePenalty"],f);let g=D(e,["frequencyPenalty"]);g!=null&&O(s,["frequencyPenalty"],g);let A=D(e,["seed"]);A!=null&&O(s,["seed"],A);let y=D(e,["responseMimeType"]);y!=null&&O(s,["responseMimeType"],y);let b=D(e,["responseSchema"]);b!=null&&O(s,["responseSchema"],L4e(b));let S=D(e,["responseJsonSchema"]);if(S!=null&&O(s,["responseJsonSchema"],S),D(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(D(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");let C=D(e,["safetySettings"]);if(n!==void 0&&C!=null){let oe=C;Array.isArray(oe)&&(oe=oe.map(re=>XFr(re))),O(n,["safetySettings"],oe)}let I=D(e,["tools"]);if(n!==void 0&&I!=null){let oe=vq(I);Array.isArray(oe)&&(oe=oe.map(re=>oQr(Tq(re)))),O(n,["tools"],oe)}let x=D(e,["toolConfig"]);if(n!==void 0&&x!=null&&O(n,["toolConfig"],sQr(x)),D(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");let w=D(e,["cachedContent"]);n!==void 0&&w!=null&&O(n,["cachedContent"],hw(t,w));let R=D(e,["responseModalities"]);R!=null&&O(s,["responseModalities"],R);let N=D(e,["mediaResolution"]);N!=null&&O(s,["mediaResolution"],N);let P=D(e,["speechConfig"]);if(P!=null&&O(s,["speechConfig"],F4e(P)),D(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");let G=D(e,["thinkingConfig"]);G!=null&&O(s,["thinkingConfig"],G);let $=D(e,["imageConfig"]);$!=null&&O(s,["imageConfig"],PFr($));let Q=D(e,["enableEnhancedCivicAnswers"]);if(Q!=null&&O(s,["enableEnhancedCivicAnswers"],Q),D(e,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");let H=D(e,["serviceTier"]);return n!==void 0&&H!=null&&O(n,["serviceTier"],H),s}function cFr(t,e,n,r){let s={},i=D(e,["systemInstruction"]);n!==void 0&&i!=null&&O(n,["systemInstruction"],kq(ep(i)));let o=D(e,["temperature"]);o!=null&&O(s,["temperature"],o);let a=D(e,["topP"]);a!=null&&O(s,["topP"],a);let c=D(e,["topK"]);c!=null&&O(s,["topK"],c);let u=D(e,["candidateCount"]);u!=null&&O(s,["candidateCount"],u);let l=D(e,["maxOutputTokens"]);l!=null&&O(s,["maxOutputTokens"],l);let d=D(e,["stopSequences"]);d!=null&&O(s,["stopSequences"],d);let h=D(e,["responseLogprobs"]);h!=null&&O(s,["responseLogprobs"],h);let m=D(e,["logprobs"]);m!=null&&O(s,["logprobs"],m);let f=D(e,["presencePenalty"]);f!=null&&O(s,["presencePenalty"],f);let g=D(e,["frequencyPenalty"]);g!=null&&O(s,["frequencyPenalty"],g);let A=D(e,["seed"]);A!=null&&O(s,["seed"],A);let y=D(e,["responseMimeType"]);y!=null&&O(s,["responseMimeType"],y);let b=D(e,["responseSchema"]);b!=null&&O(s,["responseSchema"],L4e(b));let S=D(e,["responseJsonSchema"]);S!=null&&O(s,["responseJsonSchema"],S);let C=D(e,["routingConfig"]);C!=null&&O(s,["routingConfig"],C);let I=D(e,["modelSelectionConfig"]);I!=null&&O(s,["modelConfig"],I);let x=D(e,["safetySettings"]);if(n!==void 0&&x!=null){let ce=x;Array.isArray(ce)&&(ce=ce.map(be=>be)),O(n,["safetySettings"],ce)}let w=D(e,["tools"]);if(n!==void 0&&w!=null){let ce=vq(w);Array.isArray(ce)&&(ce=ce.map(be=>HHt(Tq(be)))),O(n,["tools"],ce)}let R=D(e,["toolConfig"]);n!==void 0&&R!=null&&O(n,["toolConfig"],iQr(R));let N=D(e,["labels"]);n!==void 0&&N!=null&&O(n,["labels"],N);let P=D(e,["cachedContent"]);n!==void 0&&P!=null&&O(n,["cachedContent"],hw(t,P));let G=D(e,["responseModalities"]);G!=null&&O(s,["responseModalities"],G);let $=D(e,["mediaResolution"]);$!=null&&O(s,["mediaResolution"],$);let Q=D(e,["speechConfig"]);Q!=null&&O(s,["speechConfig"],F4e(Q));let H=D(e,["audioTimestamp"]);H!=null&&O(s,["audioTimestamp"],H);let oe=D(e,["thinkingConfig"]);oe!=null&&O(s,["thinkingConfig"],oe);let re=D(e,["imageConfig"]);if(re!=null&&O(s,["imageConfig"],OFr(re)),D(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");let Z=D(e,["modelArmorConfig"]);n!==void 0&&Z!=null&&O(n,["modelArmorConfig"],Z);let q=D(e,["serviceTier"]);return n!==void 0&&q!=null&&O(n,["serviceTier"],q),s}function rHt(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["contents"]);if(i!=null){let a=qf(i);Array.isArray(a)&&(a=a.map(c=>cz(c))),O(r,["contents"],a)}let o=D(e,["config"]);return o!=null&&O(r,["generationConfig"],aFr(t,o,r)),r}function sHt(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["contents"]);if(i!=null){let a=qf(i);Array.isArray(a)&&(a=a.map(c=>kq(c))),O(r,["contents"],a)}let o=D(e,["config"]);return o!=null&&O(r,["generationConfig"],cFr(t,o,r)),r}function iHt(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["candidates"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(d=>kLr(d))),O(n,["candidates"],l)}let i=D(t,["modelVersion"]);i!=null&&O(n,["modelVersion"],i);let o=D(t,["promptFeedback"]);o!=null&&O(n,["promptFeedback"],o);let a=D(t,["responseId"]);a!=null&&O(n,["responseId"],a);let c=D(t,["usageMetadata"]);c!=null&&O(n,["usageMetadata"],c);let u=D(t,["modelStatus"]);return u!=null&&O(n,["modelStatus"],u),n}function oHt(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["candidates"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(d=>d)),O(n,["candidates"],l)}let i=D(t,["createTime"]);i!=null&&O(n,["createTime"],i);let o=D(t,["modelVersion"]);o!=null&&O(n,["modelVersion"],o);let a=D(t,["promptFeedback"]);a!=null&&O(n,["promptFeedback"],a);let c=D(t,["responseId"]);c!=null&&O(n,["responseId"],c);let u=D(t,["usageMetadata"]);return u!=null&&O(n,["usageMetadata"],u),n}function lFr(t,e,n){let r={};if(D(t,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(D(t,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");let s=D(t,["numberOfImages"]);e!==void 0&&s!=null&&O(e,["parameters","sampleCount"],s);let i=D(t,["aspectRatio"]);e!==void 0&&i!=null&&O(e,["parameters","aspectRatio"],i);let o=D(t,["guidanceScale"]);if(e!==void 0&&o!=null&&O(e,["parameters","guidanceScale"],o),D(t,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");let a=D(t,["safetyFilterLevel"]);e!==void 0&&a!=null&&O(e,["parameters","safetySetting"],a);let c=D(t,["personGeneration"]);e!==void 0&&c!=null&&O(e,["parameters","personGeneration"],c);let u=D(t,["includeSafetyAttributes"]);e!==void 0&&u!=null&&O(e,["parameters","includeSafetyAttributes"],u);let l=D(t,["includeRaiReason"]);e!==void 0&&l!=null&&O(e,["parameters","includeRaiReason"],l);let d=D(t,["language"]);e!==void 0&&d!=null&&O(e,["parameters","language"],d);let h=D(t,["outputMimeType"]);e!==void 0&&h!=null&&O(e,["parameters","outputOptions","mimeType"],h);let m=D(t,["outputCompressionQuality"]);if(e!==void 0&&m!=null&&O(e,["parameters","outputOptions","compressionQuality"],m),D(t,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(D(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");let f=D(t,["imageSize"]);if(e!==void 0&&f!=null&&O(e,["parameters","sampleImageSize"],f),D(t,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return r}function uFr(t,e,n){let r={},s=D(t,["outputGcsUri"]);e!==void 0&&s!=null&&O(e,["parameters","storageUri"],s);let i=D(t,["negativePrompt"]);e!==void 0&&i!=null&&O(e,["parameters","negativePrompt"],i);let o=D(t,["numberOfImages"]);e!==void 0&&o!=null&&O(e,["parameters","sampleCount"],o);let a=D(t,["aspectRatio"]);e!==void 0&&a!=null&&O(e,["parameters","aspectRatio"],a);let c=D(t,["guidanceScale"]);e!==void 0&&c!=null&&O(e,["parameters","guidanceScale"],c);let u=D(t,["seed"]);e!==void 0&&u!=null&&O(e,["parameters","seed"],u);let l=D(t,["safetyFilterLevel"]);e!==void 0&&l!=null&&O(e,["parameters","safetySetting"],l);let d=D(t,["personGeneration"]);e!==void 0&&d!=null&&O(e,["parameters","personGeneration"],d);let h=D(t,["includeSafetyAttributes"]);e!==void 0&&h!=null&&O(e,["parameters","includeSafetyAttributes"],h);let m=D(t,["includeRaiReason"]);e!==void 0&&m!=null&&O(e,["parameters","includeRaiReason"],m);let f=D(t,["language"]);e!==void 0&&f!=null&&O(e,["parameters","language"],f);let g=D(t,["outputMimeType"]);e!==void 0&&g!=null&&O(e,["parameters","outputOptions","mimeType"],g);let A=D(t,["outputCompressionQuality"]);e!==void 0&&A!=null&&O(e,["parameters","outputOptions","compressionQuality"],A);let y=D(t,["addWatermark"]);e!==void 0&&y!=null&&O(e,["parameters","addWatermark"],y);let b=D(t,["labels"]);e!==void 0&&b!=null&&O(e,["labels"],b);let S=D(t,["imageSize"]);e!==void 0&&S!=null&&O(e,["parameters","sampleImageSize"],S);let C=D(t,["enhancePrompt"]);return e!==void 0&&C!=null&&O(e,["parameters","enhancePrompt"],C),r}function dFr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["prompt"]);i!=null&&O(r,["instances[0]","prompt"],i);let o=D(e,["config"]);return o!=null&&lFr(o,r),r}function pFr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["prompt"]);i!=null&&O(r,["instances[0]","prompt"],i);let o=D(e,["config"]);return o!=null&&uFr(o,r),r}function hFr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["predictions"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>xFr(a))),O(n,["generatedImages"],o)}let i=D(t,["positivePromptSafetyAttributes"]);return i!=null&&O(n,["positivePromptSafetyAttributes"],WHt(i)),n}function mFr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["predictions"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>dge(a))),O(n,["generatedImages"],o)}let i=D(t,["positivePromptSafetyAttributes"]);return i!=null&&O(n,["positivePromptSafetyAttributes"],qHt(i)),n}function fFr(t,e,n){let r={},s=D(t,["numberOfVideos"]);if(e!==void 0&&s!=null&&O(e,["parameters","sampleCount"],s),D(t,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(D(t,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");let i=D(t,["durationSeconds"]);if(e!==void 0&&i!=null&&O(e,["parameters","durationSeconds"],i),D(t,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");let o=D(t,["aspectRatio"]);e!==void 0&&o!=null&&O(e,["parameters","aspectRatio"],o);let a=D(t,["resolution"]);e!==void 0&&a!=null&&O(e,["parameters","resolution"],a);let c=D(t,["personGeneration"]);if(e!==void 0&&c!=null&&O(e,["parameters","personGeneration"],c),D(t,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");let u=D(t,["negativePrompt"]);e!==void 0&&u!=null&&O(e,["parameters","negativePrompt"],u);let l=D(t,["enhancePrompt"]);if(e!==void 0&&l!=null&&O(e,["parameters","enhancePrompt"],l),D(t,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");let d=D(t,["lastFrame"]);e!==void 0&&d!=null&&O(e,["instances[0]","lastFrame"],pge(d));let h=D(t,["referenceImages"]);if(e!==void 0&&h!=null){let f=h;Array.isArray(f)&&(f=f.map(g=>EQr(g))),O(e,["instances[0]","referenceImages"],f)}if(D(t,["mask"])!==void 0)throw new Error("mask parameter is not supported in Gemini API.");if(D(t,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");if(D(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");let m=D(t,["webhookConfig"]);if(e!==void 0&&m!=null&&O(e,["webhookConfig"],m),D(t,["resizeMode"])!==void 0)throw new Error("resizeMode parameter is not supported in Gemini API.");return r}function gFr(t,e,n){let r={},s=D(t,["numberOfVideos"]);e!==void 0&&s!=null&&O(e,["parameters","sampleCount"],s);let i=D(t,["outputGcsUri"]);e!==void 0&&i!=null&&O(e,["parameters","storageUri"],i);let o=D(t,["fps"]);e!==void 0&&o!=null&&O(e,["parameters","fps"],o);let a=D(t,["durationSeconds"]);e!==void 0&&a!=null&&O(e,["parameters","durationSeconds"],a);let c=D(t,["seed"]);e!==void 0&&c!=null&&O(e,["parameters","seed"],c);let u=D(t,["aspectRatio"]);e!==void 0&&u!=null&&O(e,["parameters","aspectRatio"],u);let l=D(t,["resolution"]);e!==void 0&&l!=null&&O(e,["parameters","resolution"],l);let d=D(t,["personGeneration"]);e!==void 0&&d!=null&&O(e,["parameters","personGeneration"],d);let h=D(t,["pubsubTopic"]);e!==void 0&&h!=null&&O(e,["parameters","pubsubTopic"],h);let m=D(t,["negativePrompt"]);e!==void 0&&m!=null&&O(e,["parameters","negativePrompt"],m);let f=D(t,["enhancePrompt"]);e!==void 0&&f!=null&&O(e,["parameters","enhancePrompt"],f);let g=D(t,["generateAudio"]);e!==void 0&&g!=null&&O(e,["parameters","generateAudio"],g);let A=D(t,["lastFrame"]);e!==void 0&&A!=null&&O(e,["instances[0]","lastFrame"],Q_(A));let y=D(t,["referenceImages"]);if(e!==void 0&&y!=null){let x=y;Array.isArray(x)&&(x=x.map(w=>bQr(w))),O(e,["instances[0]","referenceImages"],x)}let b=D(t,["mask"]);e!==void 0&&b!=null&&O(e,["instances[0]","mask"],yQr(b));let S=D(t,["compressionQuality"]);e!==void 0&&S!=null&&O(e,["parameters","compressionQuality"],S);let C=D(t,["labels"]);if(e!==void 0&&C!=null&&O(e,["labels"],C),D(t,["webhookConfig"])!==void 0)throw new Error("webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");let I=D(t,["resizeMode"]);return e!==void 0&&I!=null&&O(e,["parameters","resizeMode"],I),r}function AFr(t,e){let n={},r=D(t,["name"]);r!=null&&O(n,["name"],r);let s=D(t,["metadata"]);s!=null&&O(n,["metadata"],s);let i=D(t,["done"]);i!=null&&O(n,["done"],i);let o=D(t,["error"]);o!=null&&O(n,["error"],o);let a=D(t,["response","generateVideoResponse"]);return a!=null&&O(n,["response"],_Fr(a)),n}function yFr(t,e){let n={},r=D(t,["name"]);r!=null&&O(n,["name"],r);let s=D(t,["metadata"]);s!=null&&O(n,["metadata"],s);let i=D(t,["done"]);i!=null&&O(n,["done"],i);let o=D(t,["error"]);o!=null&&O(n,["error"],o);let a=D(t,["response"]);return a!=null&&O(n,["response"],SFr(a)),n}function EFr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["prompt"]);i!=null&&O(r,["instances[0]","prompt"],i);let o=D(e,["image"]);o!=null&&O(r,["instances[0]","image"],pge(o));let a=D(e,["video"]);a!=null&&O(r,["instances[0]","video"],VHt(a));let c=D(e,["source"]);c!=null&&CFr(c,r);let u=D(e,["config"]);return u!=null&&fFr(u,r),r}function bFr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["prompt"]);i!=null&&O(r,["instances[0]","prompt"],i);let o=D(e,["image"]);o!=null&&O(r,["instances[0]","image"],Q_(o));let a=D(e,["video"]);a!=null&&O(r,["instances[0]","video"],jHt(a));let c=D(e,["source"]);c!=null&&IFr(c,r);let u=D(e,["config"]);return u!=null&&gFr(u,r),r}function _Fr(t,e){let n={},r=D(t,["generatedSamples"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(a=>TFr(a))),O(n,["generatedVideos"],o)}let s=D(t,["raiMediaFilteredCount"]);s!=null&&O(n,["raiMediaFilteredCount"],s);let i=D(t,["raiMediaFilteredReasons"]);return i!=null&&O(n,["raiMediaFilteredReasons"],i),n}function SFr(t,e){let n={},r=D(t,["videos"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(a=>vFr(a))),O(n,["generatedVideos"],o)}let s=D(t,["raiMediaFilteredCount"]);s!=null&&O(n,["raiMediaFilteredCount"],s);let i=D(t,["raiMediaFilteredReasons"]);return i!=null&&O(n,["raiMediaFilteredReasons"],i),n}function CFr(t,e,n){let r={},s=D(t,["prompt"]);e!==void 0&&s!=null&&O(e,["instances[0]","prompt"],s);let i=D(t,["image"]);e!==void 0&&i!=null&&O(e,["instances[0]","image"],pge(i));let o=D(t,["video"]);return e!==void 0&&o!=null&&O(e,["instances[0]","video"],VHt(o)),r}function IFr(t,e,n){let r={},s=D(t,["prompt"]);e!==void 0&&s!=null&&O(e,["instances[0]","prompt"],s);let i=D(t,["image"]);e!==void 0&&i!=null&&O(e,["instances[0]","image"],Q_(i));let o=D(t,["video"]);return e!==void 0&&o!=null&&O(e,["instances[0]","video"],jHt(o)),r}function xFr(t,e){let n={},r=D(t,["_self"]);r!=null&&O(n,["image"],MFr(r));let s=D(t,["raiFilteredReason"]);s!=null&&O(n,["raiFilteredReason"],s);let i=D(t,["_self"]);return i!=null&&O(n,["safetyAttributes"],WHt(i)),n}function dge(t,e){let n={},r=D(t,["_self"]);r!=null&&O(n,["image"],GHt(r));let s=D(t,["raiFilteredReason"]);s!=null&&O(n,["raiFilteredReason"],s);let i=D(t,["_self"]);i!=null&&O(n,["safetyAttributes"],qHt(i));let o=D(t,["prompt"]);return o!=null&&O(n,["enhancedPrompt"],o),n}function wFr(t,e){let n={},r=D(t,["_self"]);r!=null&&O(n,["mask"],GHt(r));let s=D(t,["labels"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>o)),O(n,["labels"],i)}return n}function TFr(t,e){let n={},r=D(t,["video"]);return r!=null&&O(n,["video"],gQr(r)),n}function vFr(t,e){let n={},r=D(t,["_self"]);return r!=null&&O(n,["video"],AQr(r)),n}function RFr(t,e){let n={},r=D(t,["modelSelectionConfig"]);r!=null&&O(n,["modelConfig"],r);let s=D(t,["responseJsonSchema"]);s!=null&&O(n,["responseJsonSchema"],s);let i=D(t,["audioTimestamp"]);i!=null&&O(n,["audioTimestamp"],i);let o=D(t,["candidateCount"]);o!=null&&O(n,["candidateCount"],o);let a=D(t,["enableAffectiveDialog"]);a!=null&&O(n,["enableAffectiveDialog"],a);let c=D(t,["frequencyPenalty"]);c!=null&&O(n,["frequencyPenalty"],c);let u=D(t,["logprobs"]);u!=null&&O(n,["logprobs"],u);let l=D(t,["maxOutputTokens"]);l!=null&&O(n,["maxOutputTokens"],l);let d=D(t,["mediaResolution"]);d!=null&&O(n,["mediaResolution"],d);let h=D(t,["presencePenalty"]);h!=null&&O(n,["presencePenalty"],h);let m=D(t,["responseLogprobs"]);m!=null&&O(n,["responseLogprobs"],m);let f=D(t,["responseMimeType"]);f!=null&&O(n,["responseMimeType"],f);let g=D(t,["responseModalities"]);g!=null&&O(n,["responseModalities"],g);let A=D(t,["responseSchema"]);A!=null&&O(n,["responseSchema"],A);let y=D(t,["routingConfig"]);y!=null&&O(n,["routingConfig"],y);let b=D(t,["seed"]);b!=null&&O(n,["seed"],b);let S=D(t,["speechConfig"]);S!=null&&O(n,["speechConfig"],S);let C=D(t,["stopSequences"]);C!=null&&O(n,["stopSequences"],C);let I=D(t,["temperature"]);I!=null&&O(n,["temperature"],I);let x=D(t,["thinkingConfig"]);x!=null&&O(n,["thinkingConfig"],x);let w=D(t,["topK"]);w!=null&&O(n,["topK"],w);let R=D(t,["topP"]);if(R!=null&&O(n,["topP"],R),D(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return n}function kFr(t,e,n){let r={},s=D(e,["model"]);return s!=null&&O(r,["_url","name"],Bo(t,s)),r}function NFr(t,e,n){let r={},s=D(e,["model"]);return s!=null&&O(r,["_url","name"],Bo(t,s)),r}function DFr(t,e){let n={},r=D(t,["authConfig"]);r!=null&&O(n,["authConfig"],vLr(r));let s=D(t,["enableWidget"]);return s!=null&&O(n,["enableWidget"],s),n}function BFr(t,e){let n={},r=D(t,["searchTypes"]);if(r!=null&&O(n,["searchTypes"],r),D(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(D(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");let s=D(t,["timeRangeFilter"]);return s!=null&&O(n,["timeRangeFilter"],s),n}function PFr(t,e){let n={},r=D(t,["aspectRatio"]);r!=null&&O(n,["aspectRatio"],r);let s=D(t,["imageSize"]);if(s!=null&&O(n,["imageSize"],s),D(t,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(D(t,["prominentPeople"])!==void 0)throw new Error("prominentPeople parameter is not supported in Gemini API.");if(D(t,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(D(t,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");if(D(t,["imageOutputOptions"])!==void 0)throw new Error("imageOutputOptions parameter is not supported in Gemini API.");return n}function OFr(t,e){let n={},r=D(t,["aspectRatio"]);r!=null&&O(n,["aspectRatio"],r);let s=D(t,["imageSize"]);s!=null&&O(n,["imageSize"],s);let i=D(t,["personGeneration"]);i!=null&&O(n,["personGeneration"],i);let o=D(t,["prominentPeople"]);o!=null&&O(n,["prominentPeople"],o);let a=D(t,["outputMimeType"]);a!=null&&O(n,["imageOutputOptions","mimeType"],a);let c=D(t,["outputCompressionQuality"]);c!=null&&O(n,["imageOutputOptions","compressionQuality"],c);let u=D(t,["imageOutputOptions"]);return u!=null&&O(n,["imageOutputOptions"],u),n}function MFr(t,e){let n={},r=D(t,["bytesBase64Encoded"]);r!=null&&O(n,["imageBytes"],Uk(r));let s=D(t,["mimeType"]);return s!=null&&O(n,["mimeType"],s),n}function GHt(t,e){let n={},r=D(t,["gcsUri"]);r!=null&&O(n,["gcsUri"],r);let s=D(t,["bytesBase64Encoded"]);s!=null&&O(n,["imageBytes"],Uk(s));let i=D(t,["mimeType"]);return i!=null&&O(n,["mimeType"],i),n}function pge(t,e){let n={};if(D(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");let r=D(t,["imageBytes"]);r!=null&&O(n,["bytesBase64Encoded"],Uk(r));let s=D(t,["mimeType"]);return s!=null&&O(n,["mimeType"],s),n}function Q_(t,e){let n={},r=D(t,["gcsUri"]);r!=null&&O(n,["gcsUri"],r);let s=D(t,["imageBytes"]);s!=null&&O(n,["bytesBase64Encoded"],Uk(s));let i=D(t,["mimeType"]);return i!=null&&O(n,["mimeType"],i),n}function LFr(t,e,n,r){let s={},i=D(e,["pageSize"]);n!==void 0&&i!=null&&O(n,["_query","pageSize"],i);let o=D(e,["pageToken"]);n!==void 0&&o!=null&&O(n,["_query","pageToken"],o);let a=D(e,["filter"]);n!==void 0&&a!=null&&O(n,["_query","filter"],a);let c=D(e,["queryBase"]);return n!==void 0&&c!=null&&O(n,["_url","models_url"],OHt(t,c)),s}function FFr(t,e,n,r){let s={},i=D(e,["pageSize"]);n!==void 0&&i!=null&&O(n,["_query","pageSize"],i);let o=D(e,["pageToken"]);n!==void 0&&o!=null&&O(n,["_query","pageToken"],o);let a=D(e,["filter"]);n!==void 0&&a!=null&&O(n,["_query","filter"],a);let c=D(e,["queryBase"]);return n!==void 0&&c!=null&&O(n,["_url","models_url"],OHt(t,c)),s}function QFr(t,e,n){let r={},s=D(e,["config"]);return s!=null&&LFr(t,s,r),r}function UFr(t,e,n){let r={},s=D(e,["config"]);return s!=null&&FFr(t,s,r),r}function $Fr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["nextPageToken"]);s!=null&&O(n,["nextPageToken"],s);let i=D(t,["_self"]);if(i!=null){let o=MHt(i);Array.isArray(o)&&(o=o.map(a=>i4e(a))),O(n,["models"],o)}return n}function GFr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["nextPageToken"]);s!=null&&O(n,["nextPageToken"],s);let i=D(t,["_self"]);if(i!=null){let o=MHt(i);Array.isArray(o)&&(o=o.map(a=>o4e(a))),O(n,["models"],o)}return n}function WFr(t,e){let n={},r=D(t,["maskMode"]);r!=null&&O(n,["maskMode"],r);let s=D(t,["segmentationClasses"]);s!=null&&O(n,["maskClasses"],s);let i=D(t,["maskDilation"]);return i!=null&&O(n,["dilation"],i),n}function i4e(t,e){let n={},r=D(t,["name"]);r!=null&&O(n,["name"],r);let s=D(t,["displayName"]);s!=null&&O(n,["displayName"],s);let i=D(t,["description"]);i!=null&&O(n,["description"],i);let o=D(t,["version"]);o!=null&&O(n,["version"],o);let a=D(t,["_self"]);a!=null&&O(n,["tunedModelInfo"],aQr(a));let c=D(t,["inputTokenLimit"]);c!=null&&O(n,["inputTokenLimit"],c);let u=D(t,["outputTokenLimit"]);u!=null&&O(n,["outputTokenLimit"],u);let l=D(t,["supportedGenerationMethods"]);l!=null&&O(n,["supportedActions"],l);let d=D(t,["temperature"]);d!=null&&O(n,["temperature"],d);let h=D(t,["maxTemperature"]);h!=null&&O(n,["maxTemperature"],h);let m=D(t,["topP"]);m!=null&&O(n,["topP"],m);let f=D(t,["topK"]);f!=null&&O(n,["topK"],f);let g=D(t,["thinking"]);return g!=null&&O(n,["thinking"],g),n}function o4e(t,e){let n={},r=D(t,["name"]);r!=null&&O(n,["name"],r);let s=D(t,["displayName"]);s!=null&&O(n,["displayName"],s);let i=D(t,["description"]);i!=null&&O(n,["description"],i);let o=D(t,["versionId"]);o!=null&&O(n,["version"],o);let a=D(t,["deployedModels"]);if(a!=null){let h=a;Array.isArray(h)&&(h=h.map(m=>nFr(m))),O(n,["endpoints"],h)}let c=D(t,["labels"]);c!=null&&O(n,["labels"],c);let u=D(t,["_self"]);u!=null&&O(n,["tunedModelInfo"],cQr(u));let l=D(t,["defaultCheckpointId"]);l!=null&&O(n,["defaultCheckpointId"],l);let d=D(t,["checkpoints"]);if(d!=null){let h=d;Array.isArray(h)&&(h=h.map(m=>m)),O(n,["checkpoints"],h)}return n}function qFr(t,e){let n={},r=D(t,["mediaResolution"]);r!=null&&O(n,["mediaResolution"],r);let s=D(t,["codeExecutionResult"]);s!=null&&O(n,["codeExecutionResult"],s);let i=D(t,["executableCode"]);i!=null&&O(n,["executableCode"],i);let o=D(t,["fileData"]);o!=null&&O(n,["fileData"],rFr(o));let a=D(t,["functionCall"]);a!=null&&O(n,["functionCall"],sFr(a));let c=D(t,["functionResponse"]);c!=null&&O(n,["functionResponse"],c);let u=D(t,["inlineData"]);u!=null&&O(n,["inlineData"],RLr(u));let l=D(t,["text"]);l!=null&&O(n,["text"],l);let d=D(t,["thought"]);d!=null&&O(n,["thought"],d);let h=D(t,["thoughtSignature"]);h!=null&&O(n,["thoughtSignature"],h);let m=D(t,["videoMetadata"]);m!=null&&O(n,["videoMetadata"],m);let f=D(t,["toolCall"]);f!=null&&O(n,["toolCall"],f);let g=D(t,["toolResponse"]);g!=null&&O(n,["toolResponse"],g);let A=D(t,["partMetadata"]);return A!=null&&O(n,["partMetadata"],A),n}function HFr(t,e){let n={},r=D(t,["mediaResolution"]);r!=null&&O(n,["mediaResolution"],r);let s=D(t,["codeExecutionResult"]);s!=null&&O(n,["codeExecutionResult"],s);let i=D(t,["executableCode"]);i!=null&&O(n,["executableCode"],i);let o=D(t,["fileData"]);o!=null&&O(n,["fileData"],o);let a=D(t,["functionCall"]);a!=null&&O(n,["functionCall"],a);let c=D(t,["functionResponse"]);c!=null&&O(n,["functionResponse"],c);let u=D(t,["inlineData"]);u!=null&&O(n,["inlineData"],u);let l=D(t,["text"]);l!=null&&O(n,["text"],l);let d=D(t,["thought"]);d!=null&&O(n,["thought"],d);let h=D(t,["thoughtSignature"]);h!=null&&O(n,["thoughtSignature"],h);let m=D(t,["videoMetadata"]);if(m!=null&&O(n,["videoMetadata"],m),D(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");if(D(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");if(D(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return n}function VFr(t,e){let n={},r=D(t,["productImage"]);return r!=null&&O(n,["image"],Q_(r)),n}function jFr(t,e,n){let r={},s=D(t,["numberOfImages"]);e!==void 0&&s!=null&&O(e,["parameters","sampleCount"],s);let i=D(t,["baseSteps"]);e!==void 0&&i!=null&&O(e,["parameters","baseSteps"],i);let o=D(t,["outputGcsUri"]);e!==void 0&&o!=null&&O(e,["parameters","storageUri"],o);let a=D(t,["seed"]);e!==void 0&&a!=null&&O(e,["parameters","seed"],a);let c=D(t,["safetyFilterLevel"]);e!==void 0&&c!=null&&O(e,["parameters","safetySetting"],c);let u=D(t,["personGeneration"]);e!==void 0&&u!=null&&O(e,["parameters","personGeneration"],u);let l=D(t,["addWatermark"]);e!==void 0&&l!=null&&O(e,["parameters","addWatermark"],l);let d=D(t,["outputMimeType"]);e!==void 0&&d!=null&&O(e,["parameters","outputOptions","mimeType"],d);let h=D(t,["outputCompressionQuality"]);e!==void 0&&h!=null&&O(e,["parameters","outputOptions","compressionQuality"],h);let m=D(t,["enhancePrompt"]);e!==void 0&&m!=null&&O(e,["parameters","enhancePrompt"],m);let f=D(t,["labels"]);return e!==void 0&&f!=null&&O(e,["labels"],f),r}function YFr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["source"]);i!=null&&zFr(i,r);let o=D(e,["config"]);return o!=null&&jFr(o,r),r}function KFr(t,e){let n={},r=D(t,["predictions"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>dge(i))),O(n,["generatedImages"],s)}return n}function zFr(t,e,n){let r={},s=D(t,["prompt"]);e!==void 0&&s!=null&&O(e,["instances[0]","prompt"],s);let i=D(t,["personImage"]);e!==void 0&&i!=null&&O(e,["instances[0]","personImage","image"],Q_(i));let o=D(t,["productImages"]);if(e!==void 0&&o!=null){let a=o;Array.isArray(a)&&(a=a.map(c=>VFr(c))),O(e,["instances[0]","productImages"],a)}return r}function JFr(t,e){let n={},r=D(t,["referenceImage"]);r!=null&&O(n,["referenceImage"],Q_(r));let s=D(t,["referenceId"]);s!=null&&O(n,["referenceId"],s);let i=D(t,["referenceType"]);i!=null&&O(n,["referenceType"],i);let o=D(t,["maskImageConfig"]);o!=null&&O(n,["maskImageConfig"],WFr(o));let a=D(t,["controlImageConfig"]);a!=null&&O(n,["controlImageConfig"],MLr(a));let c=D(t,["styleImageConfig"]);c!=null&&O(n,["styleImageConfig"],c);let u=D(t,["subjectImageConfig"]);return u!=null&&O(n,["subjectImageConfig"],u),n}function WHt(t,e){let n={},r=D(t,["safetyAttributes","categories"]);r!=null&&O(n,["categories"],r);let s=D(t,["safetyAttributes","scores"]);s!=null&&O(n,["scores"],s);let i=D(t,["contentType"]);return i!=null&&O(n,["contentType"],i),n}function qHt(t,e){let n={},r=D(t,["safetyAttributes","categories"]);r!=null&&O(n,["categories"],r);let s=D(t,["safetyAttributes","scores"]);s!=null&&O(n,["scores"],s);let i=D(t,["contentType"]);return i!=null&&O(n,["contentType"],i),n}function XFr(t,e){let n={},r=D(t,["category"]);if(r!=null&&O(n,["category"],r),D(t,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");let s=D(t,["threshold"]);return s!=null&&O(n,["threshold"],s),n}function ZFr(t,e){let n={},r=D(t,["image"]);return r!=null&&O(n,["image"],Q_(r)),n}function eQr(t,e,n){let r={},s=D(t,["mode"]);e!==void 0&&s!=null&&O(e,["parameters","mode"],s);let i=D(t,["maxPredictions"]);e!==void 0&&i!=null&&O(e,["parameters","maxPredictions"],i);let o=D(t,["confidenceThreshold"]);e!==void 0&&o!=null&&O(e,["parameters","confidenceThreshold"],o);let a=D(t,["maskDilation"]);e!==void 0&&a!=null&&O(e,["parameters","maskDilation"],a);let c=D(t,["binaryColorThreshold"]);e!==void 0&&c!=null&&O(e,["parameters","binaryColorThreshold"],c);let u=D(t,["labels"]);return e!==void 0&&u!=null&&O(e,["labels"],u),r}function tQr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["source"]);i!=null&&rQr(i,r);let o=D(e,["config"]);return o!=null&&eQr(o,r),r}function nQr(t,e){let n={},r=D(t,["predictions"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>wFr(i))),O(n,["generatedMasks"],s)}return n}function rQr(t,e,n){let r={},s=D(t,["prompt"]);e!==void 0&&s!=null&&O(e,["instances[0]","prompt"],s);let i=D(t,["image"]);e!==void 0&&i!=null&&O(e,["instances[0]","image"],Q_(i));let o=D(t,["scribbleImage"]);return e!==void 0&&o!=null&&O(e,["instances[0]","scribble"],ZFr(o)),r}function sQr(t,e){let n={},r=D(t,["retrievalConfig"]);r!=null&&O(n,["retrievalConfig"],r);let s=D(t,["functionCallingConfig"]);s!=null&&O(n,["functionCallingConfig"],iFr(s));let i=D(t,["includeServerSideToolInvocations"]);return i!=null&&O(n,["includeServerSideToolInvocations"],i),n}function iQr(t,e){let n={},r=D(t,["retrievalConfig"]);r!=null&&O(n,["retrievalConfig"],r);let s=D(t,["functionCallingConfig"]);if(s!=null&&O(n,["functionCallingConfig"],s),D(t,["includeServerSideToolInvocations"])!==void 0)throw new Error("includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return n}function oQr(t,e){let n={};if(D(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");let r=D(t,["computerUse"]);r!=null&&O(n,["computerUse"],r);let s=D(t,["fileSearch"]);s!=null&&O(n,["fileSearch"],s);let i=D(t,["googleSearch"]);i!=null&&O(n,["googleSearch"],BFr(i));let o=D(t,["googleMaps"]);o!=null&&O(n,["googleMaps"],DFr(o));let a=D(t,["codeExecution"]);if(a!=null&&O(n,["codeExecution"],a),D(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");let c=D(t,["functionDeclarations"]);if(c!=null){let h=c;Array.isArray(h)&&(h=h.map(m=>m)),O(n,["functionDeclarations"],h)}let u=D(t,["googleSearchRetrieval"]);if(u!=null&&O(n,["googleSearchRetrieval"],u),D(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");let l=D(t,["urlContext"]);l!=null&&O(n,["urlContext"],l);let d=D(t,["mcpServers"]);if(d!=null){let h=d;Array.isArray(h)&&(h=h.map(m=>m)),O(n,["mcpServers"],h)}return n}function HHt(t,e){let n={},r=D(t,["retrieval"]);r!=null&&O(n,["retrieval"],r);let s=D(t,["computerUse"]);if(s!=null&&O(n,["computerUse"],s),D(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");let i=D(t,["googleSearch"]);i!=null&&O(n,["googleSearch"],i);let o=D(t,["googleMaps"]);o!=null&&O(n,["googleMaps"],o);let a=D(t,["codeExecution"]);a!=null&&O(n,["codeExecution"],a);let c=D(t,["enterpriseWebSearch"]);c!=null&&O(n,["enterpriseWebSearch"],c);let u=D(t,["functionDeclarations"]);if(u!=null){let m=u;Array.isArray(m)&&(m=m.map(f=>oFr(f))),O(n,["functionDeclarations"],m)}let l=D(t,["googleSearchRetrieval"]);l!=null&&O(n,["googleSearchRetrieval"],l);let d=D(t,["parallelAiSearch"]);d!=null&&O(n,["parallelAiSearch"],d);let h=D(t,["urlContext"]);if(h!=null&&O(n,["urlContext"],h),D(t,["mcpServers"])!==void 0)throw new Error("mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return n}function aQr(t,e){let n={},r=D(t,["baseModel"]);r!=null&&O(n,["baseModel"],r);let s=D(t,["createTime"]);s!=null&&O(n,["createTime"],s);let i=D(t,["updateTime"]);return i!=null&&O(n,["updateTime"],i),n}function cQr(t,e){let n={},r=D(t,["labels","google-vertex-llm-tuning-base-model-id"]);r!=null&&O(n,["baseModel"],r);let s=D(t,["createTime"]);s!=null&&O(n,["createTime"],s);let i=D(t,["updateTime"]);return i!=null&&O(n,["updateTime"],i),n}function lQr(t,e,n){let r={},s=D(t,["displayName"]);e!==void 0&&s!=null&&O(e,["displayName"],s);let i=D(t,["description"]);e!==void 0&&i!=null&&O(e,["description"],i);let o=D(t,["defaultCheckpointId"]);return e!==void 0&&o!=null&&O(e,["defaultCheckpointId"],o),r}function uQr(t,e,n){let r={},s=D(t,["displayName"]);e!==void 0&&s!=null&&O(e,["displayName"],s);let i=D(t,["description"]);e!==void 0&&i!=null&&O(e,["description"],i);let o=D(t,["defaultCheckpointId"]);return e!==void 0&&o!=null&&O(e,["defaultCheckpointId"],o),r}function dQr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","name"],Bo(t,s));let i=D(e,["config"]);return i!=null&&lQr(i,r),r}function pQr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["config"]);return i!=null&&uQr(i,r),r}function hQr(t,e,n){let r={},s=D(t,["outputGcsUri"]);e!==void 0&&s!=null&&O(e,["parameters","storageUri"],s);let i=D(t,["safetyFilterLevel"]);e!==void 0&&i!=null&&O(e,["parameters","safetySetting"],i);let o=D(t,["personGeneration"]);e!==void 0&&o!=null&&O(e,["parameters","personGeneration"],o);let a=D(t,["includeRaiReason"]);e!==void 0&&a!=null&&O(e,["parameters","includeRaiReason"],a);let c=D(t,["outputMimeType"]);e!==void 0&&c!=null&&O(e,["parameters","outputOptions","mimeType"],c);let u=D(t,["outputCompressionQuality"]);e!==void 0&&u!=null&&O(e,["parameters","outputOptions","compressionQuality"],u);let l=D(t,["enhanceInputImage"]);e!==void 0&&l!=null&&O(e,["parameters","upscaleConfig","enhanceInputImage"],l);let d=D(t,["imagePreservationFactor"]);e!==void 0&&d!=null&&O(e,["parameters","upscaleConfig","imagePreservationFactor"],d);let h=D(t,["labels"]);e!==void 0&&h!=null&&O(e,["labels"],h);let m=D(t,["numberOfImages"]);e!==void 0&&m!=null&&O(e,["parameters","sampleCount"],m);let f=D(t,["mode"]);return e!==void 0&&f!=null&&O(e,["parameters","mode"],f),r}function mQr(t,e,n){let r={},s=D(e,["model"]);s!=null&&O(r,["_url","model"],Bo(t,s));let i=D(e,["image"]);i!=null&&O(r,["instances[0]","image"],Q_(i));let o=D(e,["upscaleFactor"]);o!=null&&O(r,["parameters","upscaleConfig","upscaleFactor"],o);let a=D(e,["config"]);return a!=null&&hQr(a,r),r}function fQr(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["predictions"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>dge(o))),O(n,["generatedImages"],i)}return n}function gQr(t,e){let n={},r=D(t,["uri"]);r!=null&&O(n,["uri"],r);let s=D(t,["encodedVideo"]);s!=null&&O(n,["videoBytes"],Uk(s));let i=D(t,["encoding"]);return i!=null&&O(n,["mimeType"],i),n}function AQr(t,e){let n={},r=D(t,["gcsUri"]);r!=null&&O(n,["uri"],r);let s=D(t,["bytesBase64Encoded"]);s!=null&&O(n,["videoBytes"],Uk(s));let i=D(t,["mimeType"]);return i!=null&&O(n,["mimeType"],i),n}function yQr(t,e){let n={},r=D(t,["image"]);r!=null&&O(n,["_self"],Q_(r));let s=D(t,["maskMode"]);return s!=null&&O(n,["maskMode"],s),n}function EQr(t,e){let n={},r=D(t,["image"]);r!=null&&O(n,["image"],pge(r));let s=D(t,["referenceType"]);return s!=null&&O(n,["referenceType"],s),n}function bQr(t,e){let n={},r=D(t,["image"]);r!=null&&O(n,["image"],Q_(r));let s=D(t,["referenceType"]);return s!=null&&O(n,["referenceType"],s),n}function VHt(t,e){let n={},r=D(t,["uri"]);r!=null&&O(n,["uri"],r);let s=D(t,["videoBytes"]);s!=null&&O(n,["encodedVideo"],Uk(s));let i=D(t,["mimeType"]);return i!=null&&O(n,["encoding"],i),n}function jHt(t,e){let n={},r=D(t,["uri"]);r!=null&&O(n,["gcsUri"],r);let s=D(t,["videoBytes"]);s!=null&&O(n,["bytesBase64Encoded"],Uk(s));let i=D(t,["mimeType"]);return i!=null&&O(n,["mimeType"],i),n}function _Qr(t,e,n){let r={},s=D(e,["displayName"]);n!==void 0&&s!=null&&O(n,["displayName"],s);let i=D(e,["embeddingModel"]);return n!==void 0&&i!=null&&O(n,["embeddingModel"],Bo(t,i)),r}function SQr(t,e){let n={},r=D(e,["config"]);return r!=null&&_Qr(t,r,n),n}function CQr(t,e){let n={},r=D(t,["force"]);return e!==void 0&&r!=null&&O(e,["_query","force"],r),n}function IQr(t){let e={},n=D(t,["name"]);n!=null&&O(e,["_url","name"],n);let r=D(t,["config"]);return r!=null&&CQr(r,e),e}function xQr(t){let e={},n=D(t,["name"]);return n!=null&&O(e,["_url","name"],n),e}function wQr(t,e){let n={},r=D(t,["customMetadata"]);if(e!==void 0&&r!=null){let i=r;Array.isArray(i)&&(i=i.map(o=>o)),O(e,["customMetadata"],i)}let s=D(t,["chunkingConfig"]);return e!==void 0&&s!=null&&O(e,["chunkingConfig"],s),n}function TQr(t){let e={},n=D(t,["name"]);n!=null&&O(e,["name"],n);let r=D(t,["metadata"]);r!=null&&O(e,["metadata"],r);let s=D(t,["done"]);s!=null&&O(e,["done"],s);let i=D(t,["error"]);i!=null&&O(e,["error"],i);let o=D(t,["response"]);return o!=null&&O(e,["response"],RQr(o)),e}function vQr(t){let e={},n=D(t,["fileSearchStoreName"]);n!=null&&O(e,["_url","file_search_store_name"],n);let r=D(t,["fileName"]);r!=null&&O(e,["fileName"],r);let s=D(t,["config"]);return s!=null&&wQr(s,e),e}function RQr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["parent"]);r!=null&&O(e,["parent"],r);let s=D(t,["documentName"]);return s!=null&&O(e,["documentName"],s),e}function kQr(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&O(e,["_query","pageSize"],r);let s=D(t,["pageToken"]);return e!==void 0&&s!=null&&O(e,["_query","pageToken"],s),n}function NQr(t){let e={},n=D(t,["config"]);return n!=null&&kQr(n,e),e}function DQr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&O(e,["nextPageToken"],r);let s=D(t,["fileSearchStores"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>o)),O(e,["fileSearchStores"],i)}return e}function YHt(t,e){let n={},r=D(t,["mimeType"]);e!==void 0&&r!=null&&O(e,["mimeType"],r);let s=D(t,["displayName"]);e!==void 0&&s!=null&&O(e,["displayName"],s);let i=D(t,["customMetadata"]);if(e!==void 0&&i!=null){let a=i;Array.isArray(a)&&(a=a.map(c=>c)),O(e,["customMetadata"],a)}let o=D(t,["chunkingConfig"]);return e!==void 0&&o!=null&&O(e,["chunkingConfig"],o),n}function BQr(t){let e={},n=D(t,["fileSearchStoreName"]);n!=null&&O(e,["_url","file_search_store_name"],n);let r=D(t,["config"]);return r!=null&&YHt(r,e),e}function PQr(t){let e={},n=D(t,["sdkHttpResponse"]);return n!=null&&O(e,["sdkHttpResponse"],n),e}async function aHt(t){var e;if(t===void 0)throw new Error("response is undefined");if(!t.ok){let n=t.status,r;!((e=t.headers.get("content-type"))===null||e===void 0)&&e.includes("application/json")?r=await t.json():r={error:{message:await t.text(),code:t.status,status:t.statusText}};let s=JSON.stringify(r);throw n>=400&&n<600?new jfe({message:s,status:n}):new Error(s)}}function HQr(t,e){if(!e||Object.keys(e).length===0)return;if(t.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let n={};if(typeof t.body=="string"&&t.body.length>0)try{let i=JSON.parse(t.body);if(typeof i=="object"&&i!==null&&!Array.isArray(i))n=i;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch{console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function r(i,o){let a=Object.assign({},i);for(let c in o)if(Object.prototype.hasOwnProperty.call(o,c)){let u=o[c],l=a[c];u&&typeof u=="object"&&!Array.isArray(u)&&l&&typeof l=="object"&&!Array.isArray(l)?a[c]=r(l,u):(l&&u&&typeof l!=typeof u&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${c}". Original type: ${typeof l}, New type: ${typeof u}. Overwriting.`),a[c]=u)}return a}let s=r(n,e);t.body=JSON.stringify(s)}function KHt(t){for(let e of t)if(YQr(e)||typeof e=="object"&&"inputSchema"in e)return!0;return jQr}function zHt(t){var e;let n=(e=t[a4e])!==null&&e!==void 0?e:"";t[a4e]=(n+` ${VQr}`).trimStart()}function YQr(t){return t!==null&&typeof t=="object"&&t instanceof l4e}function KQr(t){return M_(this,arguments,function*(n,r=100){let s,i=0;for(;i{e[r]=n}),e}function XQr(t){let e=new Headers;for(let[n,r]of Object.entries(t))e.append(n,r);return e}async function eUr(t,e,n){let r=new z5e,s;n.data instanceof Blob?s=await n.data.text():n.data instanceof ArrayBuffer?s=new TextDecoder().decode(n.data):s=n.data;let i=JSON.parse(s);if(t.isVertexAI()){let o=ELr(i);Object.assign(r,o)}else Object.assign(r,i);e(r)}function nUr(t){let e={};return t.forEach((n,r)=>{e[r]=n}),e}function rUr(t){let e=new Headers;for(let[n,r]of Object.entries(t))e.append(n,r);return e}function lHt(t){var e,n,r;if(!((e=t?.automaticFunctionCalling)===null||e===void 0)&&e.disable)return!0;let s=!1;for(let o of(n=t?.tools)!==null&&n!==void 0?n:[])if(Iq(o)){s=!0;break}if(!s)return!0;let i=(r=t?.automaticFunctionCalling)===null||r===void 0?void 0:r.maximumRemoteCalls;return i&&(i<0||!Number.isInteger(i))||i==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",i),!0):!1}function Iq(t){return"callTool"in t&&typeof t.callTool=="function"}function sUr(t){var e,n,r;return(r=(n=(e=t.config)===null||e===void 0?void 0:e.tools)===null||n===void 0?void 0:n.some(s=>Iq(s)))!==null&&r!==void 0?r:!1}function uHt(t){var e;let n=[];return!((e=t?.config)===null||e===void 0)&&e.tools&&t.config.tools.forEach((r,s)=>{if(Iq(r))return;let i=r;i.functionDeclarations&&i.functionDeclarations.length>0&&n.push(s)}),n}function dHt(t){var e;return!(!((e=t?.automaticFunctionCalling)===null||e===void 0)&&e.ignoreCallHistory)}function pHt(t){let e={};if(D(t,["languageCodes"])!==void 0)throw new Error("languageCodes parameter is not supported in Gemini API.");return e}function iUr(t){let e={},n=D(t,["apiKey"]);if(n!=null&&O(e,["apiKey"],n),D(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(D(t,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(D(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(D(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(D(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(D(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return e}function oUr(t){let e={},n=D(t,["data"]);if(n!=null&&O(e,["data"],n),D(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");let r=D(t,["mimeType"]);return r!=null&&O(e,["mimeType"],r),e}function aUr(t){let e={},n=D(t,["parts"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(i=>gUr(i))),O(e,["parts"],s)}let r=D(t,["role"]);return r!=null&&O(e,["role"],r),e}function cUr(t,e,n){let r={},s=D(e,["expireTime"]);n!==void 0&&s!=null&&O(n,["expireTime"],s);let i=D(e,["newSessionExpireTime"]);n!==void 0&&i!=null&&O(n,["newSessionExpireTime"],i);let o=D(e,["uses"]);n!==void 0&&o!=null&&O(n,["uses"],o);let a=D(e,["liveConnectConstraints"]);n!==void 0&&a!=null&&O(n,["bidiGenerateContentSetup"],fUr(t,a));let c=D(e,["lockAdditionalFields"]);return n!==void 0&&c!=null&&O(n,["fieldMask"],c),r}function lUr(t,e){let n={},r=D(e,["config"]);return r!=null&&O(n,["config"],cUr(t,r,n)),n}function uUr(t){let e={};if(D(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");let n=D(t,["fileUri"]);n!=null&&O(e,["fileUri"],n);let r=D(t,["mimeType"]);return r!=null&&O(e,["mimeType"],r),e}function dUr(t){let e={},n=D(t,["id"]);n!=null&&O(e,["id"],n);let r=D(t,["args"]);r!=null&&O(e,["args"],r);let s=D(t,["name"]);if(s!=null&&O(e,["name"],s),D(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(D(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function pUr(t){let e={},n=D(t,["authConfig"]);n!=null&&O(e,["authConfig"],iUr(n));let r=D(t,["enableWidget"]);return r!=null&&O(e,["enableWidget"],r),e}function hUr(t){let e={},n=D(t,["searchTypes"]);if(n!=null&&O(e,["searchTypes"],n),D(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(D(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");let r=D(t,["timeRangeFilter"]);return r!=null&&O(e,["timeRangeFilter"],r),e}function mUr(t,e){let n={},r=D(t,["generationConfig"]);e!==void 0&&r!=null&&O(e,["setup","generationConfig"],r);let s=D(t,["responseModalities"]);e!==void 0&&s!=null&&O(e,["setup","generationConfig","responseModalities"],s);let i=D(t,["temperature"]);e!==void 0&&i!=null&&O(e,["setup","generationConfig","temperature"],i);let o=D(t,["topP"]);e!==void 0&&o!=null&&O(e,["setup","generationConfig","topP"],o);let a=D(t,["topK"]);e!==void 0&&a!=null&&O(e,["setup","generationConfig","topK"],a);let c=D(t,["maxOutputTokens"]);e!==void 0&&c!=null&&O(e,["setup","generationConfig","maxOutputTokens"],c);let u=D(t,["mediaResolution"]);e!==void 0&&u!=null&&O(e,["setup","generationConfig","mediaResolution"],u);let l=D(t,["seed"]);e!==void 0&&l!=null&&O(e,["setup","generationConfig","seed"],l);let d=D(t,["speechConfig"]);e!==void 0&&d!=null&&O(e,["setup","generationConfig","speechConfig"],Q4e(d));let h=D(t,["thinkingConfig"]);e!==void 0&&h!=null&&O(e,["setup","generationConfig","thinkingConfig"],h);let m=D(t,["enableAffectiveDialog"]);e!==void 0&&m!=null&&O(e,["setup","generationConfig","enableAffectiveDialog"],m);let f=D(t,["systemInstruction"]);e!==void 0&&f!=null&&O(e,["setup","systemInstruction"],aUr(ep(f)));let g=D(t,["tools"]);if(e!==void 0&&g!=null){let R=vq(g);Array.isArray(R)&&(R=R.map(N=>EUr(Tq(N)))),O(e,["setup","tools"],R)}let A=D(t,["sessionResumption"]);e!==void 0&&A!=null&&O(e,["setup","sessionResumption"],yUr(A));let y=D(t,["inputAudioTranscription"]);e!==void 0&&y!=null&&O(e,["setup","inputAudioTranscription"],pHt(y));let b=D(t,["outputAudioTranscription"]);e!==void 0&&b!=null&&O(e,["setup","outputAudioTranscription"],pHt(b));let S=D(t,["realtimeInputConfig"]);e!==void 0&&S!=null&&O(e,["setup","realtimeInputConfig"],S);let C=D(t,["contextWindowCompression"]);e!==void 0&&C!=null&&O(e,["setup","contextWindowCompression"],C);let I=D(t,["proactivity"]);if(e!==void 0&&I!=null&&O(e,["setup","proactivity"],I),D(t,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");let x=D(t,["avatarConfig"]);e!==void 0&&x!=null&&O(e,["setup","avatarConfig"],x);let w=D(t,["safetySettings"]);if(e!==void 0&&w!=null){let R=w;Array.isArray(R)&&(R=R.map(N=>AUr(N))),O(e,["setup","safetySettings"],R)}return n}function fUr(t,e){let n={},r=D(e,["model"]);r!=null&&O(n,["setup","model"],Bo(t,r));let s=D(e,["config"]);return s!=null&&O(n,["config"],mUr(s,n)),n}function gUr(t){let e={},n=D(t,["mediaResolution"]);n!=null&&O(e,["mediaResolution"],n);let r=D(t,["codeExecutionResult"]);r!=null&&O(e,["codeExecutionResult"],r);let s=D(t,["executableCode"]);s!=null&&O(e,["executableCode"],s);let i=D(t,["fileData"]);i!=null&&O(e,["fileData"],uUr(i));let o=D(t,["functionCall"]);o!=null&&O(e,["functionCall"],dUr(o));let a=D(t,["functionResponse"]);a!=null&&O(e,["functionResponse"],a);let c=D(t,["inlineData"]);c!=null&&O(e,["inlineData"],oUr(c));let u=D(t,["text"]);u!=null&&O(e,["text"],u);let l=D(t,["thought"]);l!=null&&O(e,["thought"],l);let d=D(t,["thoughtSignature"]);d!=null&&O(e,["thoughtSignature"],d);let h=D(t,["videoMetadata"]);h!=null&&O(e,["videoMetadata"],h);let m=D(t,["toolCall"]);m!=null&&O(e,["toolCall"],m);let f=D(t,["toolResponse"]);f!=null&&O(e,["toolResponse"],f);let g=D(t,["partMetadata"]);return g!=null&&O(e,["partMetadata"],g),e}function AUr(t){let e={},n=D(t,["category"]);if(n!=null&&O(e,["category"],n),D(t,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");let r=D(t,["threshold"]);return r!=null&&O(e,["threshold"],r),e}function yUr(t){let e={},n=D(t,["handle"]);if(n!=null&&O(e,["handle"],n),D(t,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function EUr(t){let e={};if(D(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");let n=D(t,["computerUse"]);n!=null&&O(e,["computerUse"],n);let r=D(t,["fileSearch"]);r!=null&&O(e,["fileSearch"],r);let s=D(t,["googleSearch"]);s!=null&&O(e,["googleSearch"],hUr(s));let i=D(t,["googleMaps"]);i!=null&&O(e,["googleMaps"],pUr(i));let o=D(t,["codeExecution"]);if(o!=null&&O(e,["codeExecution"],o),D(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");let a=D(t,["functionDeclarations"]);if(a!=null){let d=a;Array.isArray(d)&&(d=d.map(h=>h)),O(e,["functionDeclarations"],d)}let c=D(t,["googleSearchRetrieval"]);if(c!=null&&O(e,["googleSearchRetrieval"],c),D(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");let u=D(t,["urlContext"]);u!=null&&O(e,["urlContext"],u);let l=D(t,["mcpServers"]);if(l!=null){let d=l;Array.isArray(d)&&(d=d.map(h=>h)),O(e,["mcpServers"],d)}return e}function bUr(t){let e=[];for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];if(typeof r=="object"&&r!=null&&Object.keys(r).length>0){let s=Object.keys(r).map(i=>`${n}.${i}`);e.push(...s)}else e.push(n)}return e.join(",")}function _Ur(t,e){let n=null,r=t.bidiGenerateContentSetup;if(typeof r=="object"&&r!==null&&"setup"in r){let i=r.setup;typeof i=="object"&&i!==null?(t.bidiGenerateContentSetup=i,n=i):delete t.bidiGenerateContentSetup}else r!==void 0&&delete t.bidiGenerateContentSetup;let s=t.fieldMask;if(n){let i=bUr(n);if(Array.isArray(e?.lockAdditionalFields)&&e?.lockAdditionalFields.length===0)i?t.fieldMask=i:delete t.fieldMask;else if(e?.lockAdditionalFields&&e.lockAdditionalFields.length>0&&s!==null&&Array.isArray(s)&&s.length>0){let o=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"],a=[];s.length>0&&(a=s.map(u=>o.includes(u)?`generationConfig.${u}`:u));let c=[];i&&c.push(i),a.length>0&&c.push(...a),c.length>0?t.fieldMask=c.join(","):delete t.fieldMask}else delete t.fieldMask}else s!==null&&Array.isArray(s)&&s.length>0?t.fieldMask=s.join(","):delete t.fieldMask;return t}function SUr(t,e){let n={},r=D(t,["force"]);return e!==void 0&&r!=null&&O(e,["_query","force"],r),n}function CUr(t){let e={},n=D(t,["name"]);n!=null&&O(e,["_url","name"],n);let r=D(t,["config"]);return r!=null&&SUr(r,e),e}function IUr(t){let e={},n=D(t,["name"]);return n!=null&&O(e,["_url","name"],n),e}function xUr(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&O(e,["_query","pageSize"],r);let s=D(t,["pageToken"]);return e!==void 0&&s!=null&&O(e,["_query","pageToken"],s),n}function wUr(t){let e={},n=D(t,["parent"]);n!=null&&O(e,["_url","parent"],n);let r=D(t,["config"]);return r!=null&&xUr(r,e),e}function TUr(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&O(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&O(e,["nextPageToken"],r);let s=D(t,["documents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(o=>o)),O(e,["documents"],i)}return e}function E4e(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}function mHt(t){if(!t)return!0;for(let e in t)return!1;return!0}function BUr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function LUr(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new GeminiNextGenAPIClient({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function XHt(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function FUr(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return XHt({start(){},async pull(n){let{done:r,value:s}=await e.next();r?n.close():n.enqueue(s)},async cancel(){var n;await((n=e.return)===null||n===void 0?void 0:n.call(e))}})}function ZHt(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){let n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function QUr(t){var e,n;if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await((n=(e=t[Symbol.asyncIterator]()).return)===null||n===void 0?void 0:n.call(e));return}let r=t.getReader(),s=r.cancel();r.releaseLock(),await s}function $Ur(t){return Object.entries(t).filter(([e,n])=>typeof n<"u").map(([e,n])=>{if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")return`${encodeURIComponent(e)}=${encodeURIComponent(n)}`;if(n===null)return`${encodeURIComponent(e)}=`;throw new Hf(`Cannot stringify type ${typeof n}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function N5e(t,e,n){return e5t(),new File(t,e??"unknown_file",n)}function WUr(t){return(typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"").split(/[\\/]/).pop()||void 0}async function jUr(t,e,n){if(e5t(),t=await t,HUr(t))return t instanceof File?t:N5e([await t.arrayBuffer()],t.name);if(VUr(t)){let s=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),N5e(await S4e(s),e,n)}let r=await S4e(t);if(e||(e=WUr(t)),!n?.type){let s=r.find(i=>typeof i=="object"&&"type"in i&&i.type);typeof s=="string"&&(n=Object.assign(Object.assign({},n),{type:s}))}return N5e(r,e,n)}async function S4e(t){var e,n,r,s,i;let o=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)o.push(t);else if(t5t(t))o.push(t instanceof Blob?t:await t.arrayBuffer());else if(qUr(t))try{for(var a=!0,c=L_(t),u;u=await c.next(),e=u.done,!e;a=!0){s=u.value,a=!1;let l=s;o.push(...await S4e(l))}}catch(l){n={error:l}}finally{try{!a&&!e&&(r=c.return)&&await r.call(c)}finally{if(n)throw n.error}}else{let l=(i=t?.constructor)===null||i===void 0?void 0:i.name;throw new Error(`Unexpected data type: ${typeof t}${l?`; constructor: ${l}`:""}${YUr(t)}`)}return o}function YUr(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(n=>`"${n}"`).join(", ")}]`}function n5t(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function zUr(t){let e=0;for(let s of t)e+=s.length;let n=new Uint8Array(e),r=0;for(let s of t)n.set(s,r),r+=s.length;return n}function $4e(t){let e;return(vfe??(e=new globalThis.TextEncoder,vfe=e.encode.bind(e)))(t)}function gHt(t){let e;return(Rfe??(e=new globalThis.TextDecoder,Rfe=e.decode.bind(e)))(t)}function JUr(t,e){let s=e??0,i=t.indexOf(10,s),o=t.indexOf(13,s);if(i===-1&&o===-1)return null;let a;return i!==-1&&o!==-1?a=Math.min(i,o):a=i!==-1?i:o,t[a]===10?{preceding:a,index:a+1,carriage:!1}:{preceding:a,index:a+1,carriage:!0}}function sz(){}function kfe(t,e,n){return!e||age[t]>age[n]?sz:e[t].bind(e)}function Tm(t){var e;let n=t.logger,r=(e=t.logLevel)!==null&&e!==void 0?e:"off";if(!n)return XUr;let s=yHt.get(n);if(s&&s[0]===r)return s[1];let i={error:kfe("error",n,r),warn:kfe("warn",n,r),info:kfe("info",n,r),debug:kfe("debug",n,r)};return yHt.set(n,[r,i]),i}function ZUr(t,e){return M_(this,arguments,function*(){var r,s,i,o;if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Hf("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Hf("Attempted to iterate over a response with no body");let a=new I4e,c=new wq,u=ZHt(t.body);try{for(var l=!0,d=L_(e2r(u)),h;h=yield oi(d.next()),r=h.done,!r;l=!0){o=h.value,l=!1;let m=o;for(let f of c.decode(m)){let g=a.decode(f);g&&(yield yield oi(g))}}}catch(m){s={error:m}}finally{try{!l&&!r&&(i=d.return)&&(yield oi(i.call(d)))}finally{if(s)throw s.error}}for(let m of c.flush()){let f=a.decode(m);f&&(yield yield oi(f))}})}function e2r(t){return M_(this,arguments,function*(){var n,r,s,i;try{for(var o=!0,a=L_(t),c;c=yield oi(a.next()),n=c.done,!n;o=!0){i=c.value,o=!1;let u=i;if(u==null)continue;let l=u instanceof ArrayBuffer?new Uint8Array(u):typeof u=="string"?$4e(u):u;yield yield oi(l)}}catch(u){r={error:u}}finally{try{!o&&!n&&(s=a.return)&&(yield oi(s.call(a)))}finally{if(r)throw r.error}}})}function t2r(t,e){let n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}async function n2r(t,e){let{response:n,requestLogID:r,retryOfRequestLogID:s,startTime:i}=e,o=await(async()=>{var a;if(e.options.stream)return Tm(t).debug("response",n.status,n.url,n.headers,n.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(n,e.controller,t):C4e.fromSSEResponse(n,e.controller,t);if(n.status===204)return null;if(e.options.__binaryResponse)return n;let c=n.headers.get("content-type"),u=(a=c?.split(";")[0])===null||a===void 0?void 0:a.trim();return u?.includes("application/json")||u?.endsWith("+json")?n.headers.get("content-length")==="0"?void 0:await n.json():await n.text()})();return Tm(t).debug(`[${r}] response parsed`,gO({retryOfRequestLogID:s,url:n.url,status:n.status,body:o,durationMs:Date.now()-i})),o}function*r2r(t){if(!t)return;if(r5t in t){let{values:r,nulls:s}=t;yield*r.entries();for(let i of s)yield[i,null];return}let e=!1,n;t instanceof Headers?n=t.entries():hHt(t)?n=t:(e=!0,n=Object.entries(t??{}));for(let r of n){let s=r[0];if(typeof s!="string")throw new TypeError("expected header name to be a string");let i=hHt(r[1])?r[1]:[r[1]],o=!1;for(let a of i)a!==void 0&&(e&&!o&&(o=!0,yield[s,null]),yield[s,a])}}function s2r(t){let e;if(t){if(e=t,e.scopes){if(typeof e.scopes=="string"&&e.scopes!==rz||Array.isArray(e.scopes)&&e.scopes.indexOf(rz)<0)throw new Error(`Invalid auth scopes. Scopes must include: ${rz}`)}else return e.scopes=[rz],e;return e}else return e={scopes:[rz]},e}async function i2r(t,e){var n,r,s;let i=U4e(t.file);if(i!==void 0)return await e.request({path:`files/${i}:download`,httpMethod:"GET",queryParams:{alt:"media"},httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal});if(BHt(t.file)){let o=(s=t.file.video)===null||s===void 0?void 0:s.videoBytes;if(typeof o=="string")return o;throw new Error("Failed to download generated video, Uri or videoBytes not found.")}else if(PHt(t.file)){let o=t.file.videoBytes;if(typeof o=="string")return o;throw new Error("Failed to download video, Uri or videoBytes not found.")}else throw new Error("Unsupported file type")}function o2r(t,e){let n={},r=D(t,["name"]);return r!=null&&O(n,["_url","name"],r),n}function a2r(t,e){let n={},r=D(t,["name"]);return r!=null&&O(n,["_url","name"],r),n}function c2r(t,e){let n={},r=D(t,["sdkHttpResponse"]);return r!=null&&O(n,["sdkHttpResponse"],r),n}function l2r(t,e){let n={},r=D(t,["sdkHttpResponse"]);return r!=null&&O(n,["sdkHttpResponse"],r),n}function u2r(t,e,n){let r={};if(D(t,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");let s=D(t,["tunedModelDisplayName"]);if(e!==void 0&&s!=null&&O(e,["displayName"],s),D(t,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");let i=D(t,["epochCount"]);e!==void 0&&i!=null&&O(e,["tuningTask","hyperparameters","epochCount"],i);let o=D(t,["learningRateMultiplier"]);if(o!=null&&O(r,["tuningTask","hyperparameters","learningRateMultiplier"],o),D(t,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(D(t,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(D(t,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");if(D(t,["tuningMode"])!==void 0)throw new Error("tuningMode parameter is not supported in Gemini API.");if(D(t,["customBaseModel"])!==void 0)throw new Error("customBaseModel parameter is not supported in Gemini API.");let a=D(t,["batchSize"]);e!==void 0&&a!=null&&O(e,["tuningTask","hyperparameters","batchSize"],a);let c=D(t,["learningRate"]);if(e!==void 0&&c!=null&&O(e,["tuningTask","hyperparameters","learningRate"],c),D(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");if(D(t,["beta"])!==void 0)throw new Error("beta parameter is not supported in Gemini API.");if(D(t,["baseTeacherModel"])!==void 0)throw new Error("baseTeacherModel parameter is not supported in Gemini API.");if(D(t,["tunedTeacherModelSource"])!==void 0)throw new Error("tunedTeacherModelSource parameter is not supported in Gemini API.");if(D(t,["sftLossWeightMultiplier"])!==void 0)throw new Error("sftLossWeightMultiplier parameter is not supported in Gemini API.");if(D(t,["outputUri"])!==void 0)throw new Error("outputUri parameter is not supported in Gemini API.");if(D(t,["encryptionSpec"])!==void 0)throw new Error("encryptionSpec parameter is not supported in Gemini API.");return r}function d2r(t,e,n){let r={},s=D(n,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){let x=D(t,["validationDataset"]);e!==void 0&&x!=null&&O(e,["supervisedTuningSpec"],B5e(x))}else if(s==="PREFERENCE_TUNING"){let x=D(t,["validationDataset"]);e!==void 0&&x!=null&&O(e,["preferenceOptimizationSpec"],B5e(x))}else if(s==="DISTILLATION"){let x=D(t,["validationDataset"]);e!==void 0&&x!=null&&O(e,["distillationSpec"],B5e(x))}let i=D(t,["tunedModelDisplayName"]);e!==void 0&&i!=null&&O(e,["tunedModelDisplayName"],i);let o=D(t,["description"]);e!==void 0&&o!=null&&O(e,["description"],o);let a=D(n,["config","method"]);if(a===void 0&&(a="SUPERVISED_FINE_TUNING"),a==="SUPERVISED_FINE_TUNING"){let x=D(t,["epochCount"]);e!==void 0&&x!=null&&O(e,["supervisedTuningSpec","hyperParameters","epochCount"],x)}else if(a==="PREFERENCE_TUNING"){let x=D(t,["epochCount"]);e!==void 0&&x!=null&&O(e,["preferenceOptimizationSpec","hyperParameters","epochCount"],x)}else if(a==="DISTILLATION"){let x=D(t,["epochCount"]);e!==void 0&&x!=null&&O(e,["distillationSpec","hyperParameters","epochCount"],x)}let c=D(n,["config","method"]);if(c===void 0&&(c="SUPERVISED_FINE_TUNING"),c==="SUPERVISED_FINE_TUNING"){let x=D(t,["learningRateMultiplier"]);e!==void 0&&x!=null&&O(e,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],x)}else if(c==="PREFERENCE_TUNING"){let x=D(t,["learningRateMultiplier"]);e!==void 0&&x!=null&&O(e,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],x)}else if(c==="DISTILLATION"){let x=D(t,["learningRateMultiplier"]);e!==void 0&&x!=null&&O(e,["distillationSpec","hyperParameters","learningRateMultiplier"],x)}let u=D(n,["config","method"]);if(u===void 0&&(u="SUPERVISED_FINE_TUNING"),u==="SUPERVISED_FINE_TUNING"){let x=D(t,["exportLastCheckpointOnly"]);e!==void 0&&x!=null&&O(e,["supervisedTuningSpec","exportLastCheckpointOnly"],x)}else if(u==="PREFERENCE_TUNING"){let x=D(t,["exportLastCheckpointOnly"]);e!==void 0&&x!=null&&O(e,["preferenceOptimizationSpec","exportLastCheckpointOnly"],x)}else if(u==="DISTILLATION"){let x=D(t,["exportLastCheckpointOnly"]);e!==void 0&&x!=null&&O(e,["distillationSpec","exportLastCheckpointOnly"],x)}let l=D(n,["config","method"]);if(l===void 0&&(l="SUPERVISED_FINE_TUNING"),l==="SUPERVISED_FINE_TUNING"){let x=D(t,["adapterSize"]);e!==void 0&&x!=null&&O(e,["supervisedTuningSpec","hyperParameters","adapterSize"],x)}else if(l==="PREFERENCE_TUNING"){let x=D(t,["adapterSize"]);e!==void 0&&x!=null&&O(e,["preferenceOptimizationSpec","hyperParameters","adapterSize"],x)}else if(l==="DISTILLATION"){let x=D(t,["adapterSize"]);e!==void 0&&x!=null&&O(e,["distillationSpec","hyperParameters","adapterSize"],x)}let d=D(n,["config","method"]);if(d===void 0&&(d="SUPERVISED_FINE_TUNING"),d==="SUPERVISED_FINE_TUNING"){let x=D(t,["tuningMode"]);e!==void 0&&x!=null&&O(e,["supervisedTuningSpec","tuningMode"],x)}else if(d==="DISTILLATION"){let x=D(t,["tuningMode"]);e!==void 0&&x!=null&&O(e,["distillationSpec","tuningMode"],x)}let h=D(t,["customBaseModel"]);e!==void 0&&h!=null&&O(e,["customBaseModel"],h);let m=D(n,["config","method"]);if(m===void 0&&(m="SUPERVISED_FINE_TUNING"),m==="SUPERVISED_FINE_TUNING"){let x=D(t,["batchSize"]);e!==void 0&&x!=null&&O(e,["supervisedTuningSpec","hyperParameters","batchSize"],x)}else if(m==="DISTILLATION"){let x=D(t,["batchSize"]);e!==void 0&&x!=null&&O(e,["distillationSpec","hyperParameters","batchSize"],x)}let f=D(n,["config","method"]);if(f===void 0&&(f="SUPERVISED_FINE_TUNING"),f==="SUPERVISED_FINE_TUNING"){let x=D(t,["learningRate"]);e!==void 0&&x!=null&&O(e,["supervisedTuningSpec","hyperParameters","learningRate"],x)}else if(f==="DISTILLATION"){let x=D(t,["learningRate"]);e!==void 0&&x!=null&&O(e,["distillationSpec","hyperParameters","learningRate"],x)}let g=D(t,["labels"]);e!==void 0&&g!=null&&O(e,["labels"],g);let A=D(t,["beta"]);e!==void 0&&A!=null&&O(e,["preferenceOptimizationSpec","hyperParameters","beta"],A);let y=D(t,["baseTeacherModel"]);e!==void 0&&y!=null&&O(e,["distillationSpec","baseTeacherModel"],y);let b=D(t,["tunedTeacherModelSource"]);e!==void 0&&b!=null&&O(e,["distillationSpec","tunedTeacherModelSource"],b);let S=D(t,["sftLossWeightMultiplier"]);e!==void 0&&S!=null&&O(e,["distillationSpec","hyperParameters","sftLossWeightMultiplier"],S);let C=D(t,["outputUri"]);e!==void 0&&C!=null&&O(e,["outputUri"],C);let I=D(t,["encryptionSpec"]);return e!==void 0&&I!=null&&O(e,["encryptionSpec"],I),r}function p2r(t,e){let n={},r=D(t,["baseModel"]);r!=null&&O(n,["baseModel"],r);let s=D(t,["preTunedModel"]);s!=null&&O(n,["preTunedModel"],s);let i=D(t,["trainingDataset"]);i!=null&&b2r(i);let o=D(t,["config"]);return o!=null&&u2r(o,n),n}function h2r(t,e){let n={},r=D(t,["baseModel"]);r!=null&&O(n,["baseModel"],r);let s=D(t,["preTunedModel"]);s!=null&&O(n,["preTunedModel"],s);let i=D(t,["trainingDataset"]);i!=null&&_2r(i,n,e);let o=D(t,["config"]);return o!=null&&d2r(o,n,e),n}function m2r(t,e){let n={},r=D(t,["name"]);return r!=null&&O(n,["_url","name"],r),n}function f2r(t,e){let n={},r=D(t,["name"]);return r!=null&&O(n,["_url","name"],r),n}function g2r(t,e,n){let r={},s=D(t,["pageSize"]);e!==void 0&&s!=null&&O(e,["_query","pageSize"],s);let i=D(t,["pageToken"]);e!==void 0&&i!=null&&O(e,["_query","pageToken"],i);let o=D(t,["filter"]);return e!==void 0&&o!=null&&O(e,["_query","filter"],o),r}function A2r(t,e){let n={},r=D(t,["config"]);return r!=null&&g2r(r,n),n}function y2r(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["nextPageToken"]);s!=null&&O(n,["nextPageToken"],s);let i=D(t,["tuningJobs"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(a=>k4e(a))),O(n,["tuningJobs"],o)}return n}function E2r(t,e){let n={},r=D(t,["name"]);r!=null&&O(n,["model"],r);let s=D(t,["name"]);return s!=null&&O(n,["endpoint"],s),n}function b2r(t,e){let n={};if(D(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(D(t,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");let r=D(t,["examples"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>i)),O(n,["examples","examples"],s)}return n}function _2r(t,e,n){let r={},s=D(n,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){let o=D(t,["gcsUri"]);e!==void 0&&o!=null&&O(e,["supervisedTuningSpec","trainingDatasetUri"],o)}else if(s==="PREFERENCE_TUNING"){let o=D(t,["gcsUri"]);e!==void 0&&o!=null&&O(e,["preferenceOptimizationSpec","trainingDatasetUri"],o)}else if(s==="DISTILLATION"){let o=D(t,["gcsUri"]);e!==void 0&&o!=null&&O(e,["distillationSpec","promptDatasetUri"],o)}let i=D(n,["config","method"]);if(i===void 0&&(i="SUPERVISED_FINE_TUNING"),i==="SUPERVISED_FINE_TUNING"){let o=D(t,["vertexDatasetResource"]);e!==void 0&&o!=null&&O(e,["supervisedTuningSpec","trainingDatasetUri"],o)}else if(i==="PREFERENCE_TUNING"){let o=D(t,["vertexDatasetResource"]);e!==void 0&&o!=null&&O(e,["preferenceOptimizationSpec","trainingDatasetUri"],o)}else if(i==="DISTILLATION"){let o=D(t,["vertexDatasetResource"]);e!==void 0&&o!=null&&O(e,["distillationSpec","promptDatasetUri"],o)}if(D(t,["examples"])!==void 0)throw new Error("examples parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");return r}function S2r(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["name"]);s!=null&&O(n,["name"],s);let i=D(t,["state"]);i!=null&&O(n,["state"],DHt(i));let o=D(t,["createTime"]);o!=null&&O(n,["createTime"],o);let a=D(t,["tuningTask","startTime"]);a!=null&&O(n,["startTime"],a);let c=D(t,["tuningTask","completeTime"]);c!=null&&O(n,["endTime"],c);let u=D(t,["updateTime"]);u!=null&&O(n,["updateTime"],u);let l=D(t,["description"]);l!=null&&O(n,["description"],l);let d=D(t,["baseModel"]);d!=null&&O(n,["baseModel"],d);let h=D(t,["_self"]);return h!=null&&O(n,["tunedModel"],E2r(h)),n}function k4e(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["name"]);s!=null&&O(n,["name"],s);let i=D(t,["state"]);i!=null&&O(n,["state"],DHt(i));let o=D(t,["createTime"]);o!=null&&O(n,["createTime"],o);let a=D(t,["startTime"]);a!=null&&O(n,["startTime"],a);let c=D(t,["endTime"]);c!=null&&O(n,["endTime"],c);let u=D(t,["updateTime"]);u!=null&&O(n,["updateTime"],u);let l=D(t,["error"]);l!=null&&O(n,["error"],l);let d=D(t,["description"]);d!=null&&O(n,["description"],d);let h=D(t,["baseModel"]);h!=null&&O(n,["baseModel"],h);let m=D(t,["tunedModel"]);m!=null&&O(n,["tunedModel"],m);let f=D(t,["preTunedModel"]);f!=null&&O(n,["preTunedModel"],f);let g=D(t,["supervisedTuningSpec"]);g!=null&&O(n,["supervisedTuningSpec"],g);let A=D(t,["preferenceOptimizationSpec"]);A!=null&&O(n,["preferenceOptimizationSpec"],A);let y=D(t,["distillationSpec"]);y!=null&&O(n,["distillationSpec"],y);let b=D(t,["tuningDataStats"]);b!=null&&O(n,["tuningDataStats"],b);let S=D(t,["encryptionSpec"]);S!=null&&O(n,["encryptionSpec"],S);let C=D(t,["partnerModelTuningSpec"]);C!=null&&O(n,["partnerModelTuningSpec"],C);let I=D(t,["customBaseModel"]);I!=null&&O(n,["customBaseModel"],I);let x=D(t,["evaluateDatasetRuns"]);if(x!=null){let q=x;Array.isArray(q)&&(q=q.map(ce=>ce)),O(n,["evaluateDatasetRuns"],q)}let w=D(t,["experiment"]);w!=null&&O(n,["experiment"],w);let R=D(t,["fullFineTuningSpec"]);R!=null&&O(n,["fullFineTuningSpec"],R);let N=D(t,["labels"]);N!=null&&O(n,["labels"],N);let P=D(t,["outputUri"]);P!=null&&O(n,["outputUri"],P);let G=D(t,["pipelineJob"]);G!=null&&O(n,["pipelineJob"],G);let $=D(t,["serviceAccount"]);$!=null&&O(n,["serviceAccount"],$);let Q=D(t,["tunedModelDisplayName"]);Q!=null&&O(n,["tunedModelDisplayName"],Q);let H=D(t,["tuningJobState"]);H!=null&&O(n,["tuningJobState"],H);let oe=D(t,["veoTuningSpec"]);oe!=null&&O(n,["veoTuningSpec"],oe);let re=D(t,["distillationSamplingSpec"]);re!=null&&O(n,["distillationSamplingSpec"],re);let Z=D(t,["tuningJobMetadata"]);return Z!=null&&O(n,["tuningJobMetadata"],Z),n}function C2r(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&O(n,["sdkHttpResponse"],r);let s=D(t,["name"]);s!=null&&O(n,["name"],s);let i=D(t,["metadata"]);i!=null&&O(n,["metadata"],i);let o=D(t,["done"]);o!=null&&O(n,["done"],o);let a=D(t,["error"]);return a!=null&&O(n,["error"],a),n}function B5e(t,e){let n={},r=D(t,["gcsUri"]);r!=null&&O(n,["validationDatasetUri"],r);let s=D(t,["vertexDatasetResource"]);return s!=null&&O(n,["validationDatasetUri"],s),n}async function I2r(t,e,n,r){var s;let i=await l5t(t,e,n,r),o=await i?.json();if(((s=i?.headers)===null||s===void 0?void 0:s[Mk])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return o.file}async function x2r(t,e,n,r){var s;let i=await l5t(t,e,n,r),o=await i?.json();if(((s=i?.headers)===null||s===void 0?void 0:s[Mk])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");let a=O4e(o),c=new Hfe;return Object.assign(c,a),c}async function l5t(t,e,n,r){var s,i,o;let a=e,c=r?.baseUrl||((s=n.clientOptions.httpOptions)===null||s===void 0?void 0:s.baseUrl);if(c){let m=new URL(c),f=new URL(e);f.protocol=m.protocol,f.host=m.host,f.port=m.port,a=f.toString()}let u=0,l=0,d=new Qk(new Response),h="upload";for(u=t.size;l=u&&(h+=", finalize");let g=0,A=a5t;for(;gsetTimeout(e,t))}function v2r(t){var e;if(t.enterprise!==void 0||t.vertexai!==void 0){if(t.enterprise!==void 0&&t.vertexai!==void 0&&t.enterprise!==t.vertexai)throw new Error("enterprise and vertexAI flags have conflicting values, please set enterprise value only.");return(e=t.enterprise)!==null&&e!==void 0?e:t.vertexai}let n=Lk("GOOGLE_GENAI_USE_ENTERPRISE"),r=Lk("GOOGLE_GENAI_USE_VERTEXAI"),s=bHt(n),i=bHt(r);return n!==void 0&&r!==void 0&&s!==i&&console.warn("Warning: Both GOOGLE_GENAI_USE_ENTERPRISE and GOOGLE_GENAI_USE_VERTEXAI are set with conflicting values. The value of GOOGLE_GENAI_USE_ENTERPRISE will be used."),n!==void 0?s:r!==void 0?i:!1}function Lk(t){var e,n,r;return(r=(n=(e=process==null?void 0:process.env)===null||e===void 0?void 0:e[t])===null||n===void 0?void 0:n.trim())!==null&&r!==void 0?r:void 0}function bHt(t){return t===void 0?!1:t.toLowerCase()==="true"}function R2r(){let t=Lk("GOOGLE_API_KEY"),e=Lk("GEMINI_API_KEY");return t&&e&&console.warn("Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY."),t||e||void 0}var lge,_Ht,SHt,uge,CHt,IHt,xHt,wHt,WPr,qPr,F_,Hqt,Vqt,jqt,Pk,Yqt,Kqt,zqt,Jqt,Xqt,Zqt,e3t,Fk,vC,t3t,n3t,r3t,s3t,i3t,Qu,o3t,a3t,c3t,l3t,u3t,Bfe,d3t,p3t,h3t,m3t,O5e,f3t,g3t,A3t,y3t,E3t,b3t,_3t,iz,S3t,C3t,Pfe,I3t,x3t,w3t,T3t,v3t,R3t,k3t,N3t,D3t,B3t,P3t,O3t,M3t,L3t,F3t,Q3t,U3t,$3t,G3t,W3t,q3t,H3t,V3t,j3t,Sq,Qk,AO,Ofe,Mfe,M5e,L5e,F5e,Q5e,Lfe,Ffe,Qfe,U5e,Ufe,$5e,$fe,Gfe,Wfe,G5e,W5e,q5e,H5e,V5e,j5e,Y5e,K5e,qfe,z5e,J5e,Hfe,dw,pw,e4e,t4e,n4e,r4e,jfe,s4e,OQr,MQr,LQr,a4e,FQr,QQr,UQr,$Qr,GQr,WQr,qQr,c4e,VQr,jQr,l4e,u4e,d4e,ZQr,p4e,tUr,h4e,cHt,m4e,f4e,g4e,A4e,y4e,JHt,vUr,b4e,Hf,Vf,oz,xq,Yfe,Kfe,zfe,Jfe,Xfe,Zfe,ege,tge,nge,RUr,kUr,_4e,NUr,DUr,hHt,PUr,OUr,MUr,UUr,GUr,e5t,qUr,t5t,HUr,VUr,az,fHt,KUr,O_,rge,sge,ige,oge,vfe,Rfe,wq,age,AHt,XUr,yHt,gO,C4e,I4e,x4e,r5t,nz,D5e,s5t,cge,pu,EHt,rz,w4e,T4e,v4e,R4e,N4e,i5t,o5t,a5t,c5t,Mk,D4e,B4e,T2r,yO,hge=V(()=>{p();lge=Gt(t2t(),1),_Ht=Gt(UWt(),1),SHt=require("fs"),uge=Gt(require("fs/promises"),1),CHt=require("fs/promises"),IHt=require("node:stream"),xHt=require("node:stream/promises");qqt();wHt=Gt(require("path"),1);F_=class{};(function(t){t.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",t.PYTHON="PYTHON"})(Hqt||(Hqt={}));(function(t){t.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",t.OUTCOME_OK="OUTCOME_OK",t.OUTCOME_FAILED="OUTCOME_FAILED",t.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(Vqt||(Vqt={}));(function(t){t.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",t.SILENT="SILENT",t.WHEN_IDLE="WHEN_IDLE",t.INTERRUPT="INTERRUPT"})(jqt||(jqt={}));(function(t){t.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",t.STRING="STRING",t.NUMBER="NUMBER",t.INTEGER="INTEGER",t.BOOLEAN="BOOLEAN",t.ARRAY="ARRAY",t.OBJECT="OBJECT",t.NULL="NULL"})(Pk||(Pk={}));(function(t){t.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",t.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(Yqt||(Yqt={}));(function(t){t.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",t.NO_AUTH="NO_AUTH",t.API_KEY_AUTH="API_KEY_AUTH",t.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",t.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",t.OAUTH="OAUTH",t.OIDC_AUTH="OIDC_AUTH"})(Kqt||(Kqt={}));(function(t){t.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",t.HTTP_IN_QUERY="HTTP_IN_QUERY",t.HTTP_IN_HEADER="HTTP_IN_HEADER",t.HTTP_IN_PATH="HTTP_IN_PATH",t.HTTP_IN_BODY="HTTP_IN_BODY",t.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(zqt||(zqt={}));(function(t){t.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",t.SIMPLE_SEARCH="SIMPLE_SEARCH",t.ELASTIC_SEARCH="ELASTIC_SEARCH"})(Jqt||(Jqt={}));(function(t){t.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",t.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",t.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",t.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(Xqt||(Xqt={}));(function(t){t.UNSPECIFIED="UNSPECIFIED",t.BLOCKING="BLOCKING",t.NON_BLOCKING="NON_BLOCKING"})(Zqt||(Zqt={}));(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(e3t||(e3t={}));(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE",t.VALIDATED="VALIDATED"})(Fk||(Fk={}));(function(t){t.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",t.MINIMAL="MINIMAL",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(vC||(vC={}));(function(t){t.DONT_ALLOW="DONT_ALLOW",t.ALLOW_ADULT="ALLOW_ADULT",t.ALLOW_ALL="ALLOW_ALL"})(t3t||(t3t={}));(function(t){t.PROMINENT_PEOPLE_UNSPECIFIED="PROMINENT_PEOPLE_UNSPECIFIED",t.ALLOW_PROMINENT_PEOPLE="ALLOW_PROMINENT_PEOPLE",t.BLOCK_PROMINENT_PEOPLE="BLOCK_PROMINENT_PEOPLE"})(n3t||(n3t={}));(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",t.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",t.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",t.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",t.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK"})(r3t||(r3t={}));(function(t){t.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",t.SEVERITY="SEVERITY",t.PROBABILITY="PROBABILITY"})(s3t||(s3t={}));(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE",t.OFF="OFF"})(i3t||(i3t={}));(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.IMAGE_SAFETY="IMAGE_SAFETY",t.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",t.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",t.NO_IMAGE="NO_IMAGE",t.IMAGE_RECITATION="IMAGE_RECITATION",t.IMAGE_OTHER="IMAGE_OTHER"})(Qu||(Qu={}));(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(o3t||(o3t={}));(function(t){t.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",t.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",t.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",t.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",t.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(a3t||(a3t={}));(function(t){t.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",t.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",t.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",t.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",t.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(c3t||(c3t={}));(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.IMAGE_SAFETY="IMAGE_SAFETY",t.MODEL_ARMOR="MODEL_ARMOR",t.JAILBREAK="JAILBREAK"})(l3t||(l3t={}));(function(t){t.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",t.ON_DEMAND="ON_DEMAND",t.ON_DEMAND_PRIORITY="ON_DEMAND_PRIORITY",t.ON_DEMAND_FLEX="ON_DEMAND_FLEX",t.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(u3t||(u3t={}));(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.AUDIO="AUDIO",t.VIDEO="VIDEO"})(Bfe||(Bfe={}));(function(t){t.MODEL_STAGE_UNSPECIFIED="MODEL_STAGE_UNSPECIFIED",t.UNSTABLE_EXPERIMENTAL="UNSTABLE_EXPERIMENTAL",t.EXPERIMENTAL="EXPERIMENTAL",t.PREVIEW="PREVIEW",t.STABLE="STABLE",t.LEGACY="LEGACY",t.DEPRECATED="DEPRECATED",t.RETIRED="RETIRED"})(d3t||(d3t={}));(function(t){t.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",t.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",t.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",t.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(p3t||(p3t={}));(function(t){t.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",t.TUNING_MODE_FULL="TUNING_MODE_FULL",t.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(h3t||(h3t={}));(function(t){t.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",t.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",t.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",t.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",t.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",t.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",t.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(m3t||(m3t={}));(function(t){t.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",t.JOB_STATE_QUEUED="JOB_STATE_QUEUED",t.JOB_STATE_PENDING="JOB_STATE_PENDING",t.JOB_STATE_RUNNING="JOB_STATE_RUNNING",t.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",t.JOB_STATE_FAILED="JOB_STATE_FAILED",t.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",t.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",t.JOB_STATE_PAUSED="JOB_STATE_PAUSED",t.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",t.JOB_STATE_UPDATING="JOB_STATE_UPDATING",t.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(O5e||(O5e={}));(function(t){t.TUNING_JOB_STATE_UNSPECIFIED="TUNING_JOB_STATE_UNSPECIFIED",t.TUNING_JOB_STATE_WAITING_FOR_QUOTA="TUNING_JOB_STATE_WAITING_FOR_QUOTA",t.TUNING_JOB_STATE_PROCESSING_DATASET="TUNING_JOB_STATE_PROCESSING_DATASET",t.TUNING_JOB_STATE_WAITING_FOR_CAPACITY="TUNING_JOB_STATE_WAITING_FOR_CAPACITY",t.TUNING_JOB_STATE_TUNING="TUNING_JOB_STATE_TUNING",t.TUNING_JOB_STATE_POST_PROCESSING="TUNING_JOB_STATE_POST_PROCESSING"})(f3t||(f3t={}));(function(t){t.AGGREGATION_METRIC_UNSPECIFIED="AGGREGATION_METRIC_UNSPECIFIED",t.AVERAGE="AVERAGE",t.MODE="MODE",t.STANDARD_DEVIATION="STANDARD_DEVIATION",t.VARIANCE="VARIANCE",t.MINIMUM="MINIMUM",t.MAXIMUM="MAXIMUM",t.MEDIAN="MEDIAN",t.PERCENTILE_P90="PERCENTILE_P90",t.PERCENTILE_P95="PERCENTILE_P95",t.PERCENTILE_P99="PERCENTILE_P99"})(g3t||(g3t={}));(function(t){t.PAIRWISE_CHOICE_UNSPECIFIED="PAIRWISE_CHOICE_UNSPECIFIED",t.BASELINE="BASELINE",t.CANDIDATE="CANDIDATE",t.TIE="TIE"})(A3t||(A3t={}));(function(t){t.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",t.TUNING_TASK_I2V="TUNING_TASK_I2V",t.TUNING_TASK_T2V="TUNING_TASK_T2V",t.TUNING_TASK_R2V="TUNING_TASK_R2V"})(y3t||(y3t={}));(function(t){t.STATE_UNSPECIFIED="STATE_UNSPECIFIED",t.STATE_PENDING="STATE_PENDING",t.STATE_ACTIVE="STATE_ACTIVE",t.STATE_FAILED="STATE_FAILED"})(E3t||(E3t={}));(function(t){t.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",t.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",t.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",t.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",t.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(b3t||(b3t={}));(function(t){t.TOOL_TYPE_UNSPECIFIED="TOOL_TYPE_UNSPECIFIED",t.GOOGLE_SEARCH_WEB="GOOGLE_SEARCH_WEB",t.GOOGLE_SEARCH_IMAGE="GOOGLE_SEARCH_IMAGE",t.URL_CONTEXT="URL_CONTEXT",t.GOOGLE_MAPS="GOOGLE_MAPS",t.FILE_SEARCH="FILE_SEARCH"})(_3t||(_3t={}));(function(t){t.COLLECTION="COLLECTION"})(iz||(iz={}));(function(t){t.UNSPECIFIED="unspecified",t.FLEX="flex",t.STANDARD="standard",t.PRIORITY="priority"})(S3t||(S3t={}));(function(t){t.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",t.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",t.BALANCED="BALANCED",t.PRIORITIZE_COST="PRIORITIZE_COST"})(C3t||(C3t={}));(function(t){t.PREDICT="PREDICT",t.EMBED_CONTENT="EMBED_CONTENT"})(Pfe||(Pfe={}));(function(t){t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(I3t||(I3t={}));(function(t){t.auto="auto",t.en="en",t.ja="ja",t.ko="ko",t.hi="hi",t.zh="zh",t.pt="pt",t.es="es"})(x3t||(x3t={}));(function(t){t.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",t.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",t.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",t.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",t.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(w3t||(w3t={}));(function(t){t.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",t.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",t.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",t.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(T3t||(T3t={}));(function(t){t.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",t.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",t.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",t.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(v3t||(v3t={}));(function(t){t.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",t.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",t.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",t.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",t.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",t.EDIT_MODE_STYLE="EDIT_MODE_STYLE",t.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",t.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(R3t||(R3t={}));(function(t){t.FOREGROUND="FOREGROUND",t.BACKGROUND="BACKGROUND",t.PROMPT="PROMPT",t.SEMANTIC="SEMANTIC",t.INTERACTIVE="INTERACTIVE"})(k3t||(k3t={}));(function(t){t.ASSET="ASSET",t.STYLE="STYLE"})(N3t||(N3t={}));(function(t){t.INSERT="INSERT",t.REMOVE="REMOVE",t.REMOVE_STATIC="REMOVE_STATIC",t.OUTPAINT="OUTPAINT"})(D3t||(D3t={}));(function(t){t.OPTIMIZED="OPTIMIZED",t.LOSSLESS="LOSSLESS"})(B3t||(B3t={}));(function(t){t.CROP="CROP",t.PAD="PAD"})(P3t||(P3t={}));(function(t){t.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",t.PREFERENCE_TUNING="PREFERENCE_TUNING",t.DISTILLATION="DISTILLATION"})(O3t||(O3t={}));(function(t){t.STATE_UNSPECIFIED="STATE_UNSPECIFIED",t.PROCESSING="PROCESSING",t.ACTIVE="ACTIVE",t.FAILED="FAILED"})(M3t||(M3t={}));(function(t){t.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",t.UPLOADED="UPLOADED",t.GENERATED="GENERATED",t.REGISTERED="REGISTERED"})(L3t||(L3t={}));(function(t){t.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.RESPONSE_REJECTED="RESPONSE_REJECTED",t.NEED_MORE_INPUT="NEED_MORE_INPUT",t.PROHIBITED_INPUT_CONTENT="PROHIBITED_INPUT_CONTENT",t.IMAGE_PROHIBITED_INPUT_CONTENT="IMAGE_PROHIBITED_INPUT_CONTENT",t.INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED="INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED",t.INPUT_IMAGE_CELEBRITY="INPUT_IMAGE_CELEBRITY",t.INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED="INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED",t.INPUT_TEXT_NCII_PROHIBITED="INPUT_TEXT_NCII_PROHIBITED",t.INPUT_OTHER="INPUT_OTHER",t.INPUT_IP_PROHIBITED="INPUT_IP_PROHIBITED",t.BLOCKLIST="BLOCKLIST",t.UNSAFE_PROMPT_FOR_IMAGE_GENERATION="UNSAFE_PROMPT_FOR_IMAGE_GENERATION",t.GENERATED_IMAGE_SAFETY="GENERATED_IMAGE_SAFETY",t.GENERATED_CONTENT_SAFETY="GENERATED_CONTENT_SAFETY",t.GENERATED_AUDIO_SAFETY="GENERATED_AUDIO_SAFETY",t.GENERATED_VIDEO_SAFETY="GENERATED_VIDEO_SAFETY",t.GENERATED_CONTENT_PROHIBITED="GENERATED_CONTENT_PROHIBITED",t.GENERATED_CONTENT_BLOCKLIST="GENERATED_CONTENT_BLOCKLIST",t.GENERATED_IMAGE_PROHIBITED="GENERATED_IMAGE_PROHIBITED",t.GENERATED_IMAGE_CELEBRITY="GENERATED_IMAGE_CELEBRITY",t.GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER="GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER",t.GENERATED_IMAGE_IDENTIFIABLE_PEOPLE="GENERATED_IMAGE_IDENTIFIABLE_PEOPLE",t.GENERATED_IMAGE_MINORS="GENERATED_IMAGE_MINORS",t.OUTPUT_IMAGE_IP_PROHIBITED="OUTPUT_IMAGE_IP_PROHIBITED",t.GENERATED_OTHER="GENERATED_OTHER",t.MAX_REGENERATION_REACHED="MAX_REGENERATION_REACHED"})(F3t||(F3t={}));(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.AUDIO="AUDIO",t.DOCUMENT="DOCUMENT"})(Q3t||(Q3t={}));(function(t){t.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",t.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",t.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(U3t||(U3t={}));(function(t){t.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",t.ACTIVITY_START="ACTIVITY_START",t.ACTIVITY_END="ACTIVITY_END"})($3t||($3t={}));(function(t){t.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",t.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",t.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(G3t||(G3t={}));(function(t){t.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",t.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",t.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(W3t||(W3t={}));(function(t){t.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",t.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",t.NO_INTERRUPTION="NO_INTERRUPTION"})(q3t||(q3t={}));(function(t){t.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",t.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",t.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT",t.TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO="TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"})(H3t||(H3t={}));(function(t){t.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",t.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",t.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",t.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",t.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",t.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",t.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",t.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",t.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",t.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",t.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",t.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",t.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(V3t||(V3t={}));(function(t){t.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",t.QUALITY="QUALITY",t.DIVERSITY="DIVERSITY",t.VOCALIZATION="VOCALIZATION"})(j3t||(j3t={}));(function(t){t.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",t.PLAY="PLAY",t.PAUSE="PAUSE",t.STOP="STOP",t.RESET_CONTEXT="RESET_CONTEXT"})(Sq||(Sq={}));Qk=class{constructor(e){let n={};for(let r of e.headers.entries())n[r[0]]=r[1];this.headers=n,this.responseInternal=e}json(){return this.responseInternal.json()}},AO=class{get text(){var e,n,r,s,i,o,a,c;if(((s=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let u="",l=!1,d=[];for(let h of(c=(a=(o=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)!==null&&c!==void 0?c:[]){for(let[m,f]of Object.entries(h))m!=="text"&&m!=="thought"&&m!=="thoughtSignature"&&(f!==null||f!==void 0)&&d.push(m);if(typeof h.text=="string"){if(typeof h.thought=="boolean"&&h.thought)continue;l=!0,u+=h.text}}return d.length>0&&console.warn(`there are non-text parts ${d} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),l?u:void 0}get data(){var e,n,r,s,i,o,a,c;if(((s=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let u="",l=[];for(let d of(c=(a=(o=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)!==null&&c!==void 0?c:[]){for(let[h,m]of Object.entries(d))h!=="inlineData"&&(m!==null||m!==void 0)&&l.push(h);d.inlineData&&typeof d.inlineData.data=="string"&&(u+=atob(d.inlineData.data))}return l.length>0&&console.warn(`there are non-data parts ${l} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),u.length>0?btoa(u):void 0}get functionCalls(){var e,n,r,s,i,o,a,c;if(((s=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");let u=(c=(a=(o=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||c===void 0?void 0:c.filter(l=>l.functionCall).map(l=>l.functionCall).filter(l=>l!==void 0);if(u?.length!==0)return u}get executableCode(){var e,n,r,s,i,o,a,c,u;if(((s=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");let l=(c=(a=(o=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||c===void 0?void 0:c.filter(d=>d.executableCode).map(d=>d.executableCode).filter(d=>d!==void 0);if(l?.length!==0)return(u=l?.[0])===null||u===void 0?void 0:u.code}get codeExecutionResult(){var e,n,r,s,i,o,a,c,u;if(((s=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");let l=(c=(a=(o=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||c===void 0?void 0:c.filter(d=>d.codeExecutionResult).map(d=>d.codeExecutionResult).filter(d=>d!==void 0);if(l?.length!==0)return(u=l?.[0])===null||u===void 0?void 0:u.output}},Ofe=class{},Mfe=class{},M5e=class{},L5e=class{},F5e=class{},Q5e=class{},Lfe=class{},Ffe=class{},Qfe=class{},U5e=class{},Ufe=class t{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let r=new t,s,i=e;return n?s=zPr(i):s=KPr(i),Object.assign(r,s),r}},$5e=class{},$fe=class{},Gfe=class{},Wfe=class{},G5e=class{},W5e=class{},q5e=class{},H5e=class t{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let r=new t,i=rOr(e);return Object.assign(r,i),r}},V5e=class{},j5e=class{},Y5e=class{},K5e=class{},qfe=class{},z5e=class{get text(){var e,n,r;let s="",i=!1,o=[];for(let a of(r=(n=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&r!==void 0?r:[]){for(let[c,u]of Object.entries(a))c!=="text"&&c!=="thought"&&u!==null&&o.push(c);if(typeof a.text=="string"){if(typeof a.thought=="boolean"&&a.thought)continue;i=!0,s+=a.text}}return o.length>0&&console.warn(`there are non-text parts ${o} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),i?s:void 0}get data(){var e,n,r;let s="",i=[];for(let o of(r=(n=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&r!==void 0?r:[]){for(let[a,c]of Object.entries(o))a!=="inlineData"&&c!==null&&i.push(a);o.inlineData&&typeof o.inlineData.data=="string"&&(s+=atob(o.inlineData.data))}return i.length>0&&console.warn(`there are non-data parts ${i} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),s.length>0?btoa(s):void 0}},J5e=class{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}},Hfe=class t{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let r=new t,i=O4e(e);return Object.assign(r,i),r}};(function(t){t.PAGED_ITEM_BATCH_JOBS="batchJobs",t.PAGED_ITEM_MODELS="models",t.PAGED_ITEM_TUNING_JOBS="tuningJobs",t.PAGED_ITEM_FILES="files",t.PAGED_ITEM_CACHED_CONTENTS="cachedContents",t.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",t.PAGED_ITEM_DOCUMENTS="documents"})(dw||(dw={}));pw=class{constructor(e,n,r,s){this.pageInternal=[],this.paramsInternal={},this.requestInternal=n,this.init(e,r,s)}init(e,n,r){var s,i;this.nameInternal=e,this.pageInternal=n[this.nameInternal]||[],this.sdkHttpResponseInternal=n?.sdkHttpResponse,this.idxInternal=0;let o={config:{}};!r||Object.keys(r).length===0?o={config:{}}:typeof r=="object"?o=Object.assign({},r):o=r,o.config&&(o.config.pageToken=n.nextPageToken),this.paramsInternal=o,this.pageInternalSize=(i=(s=o.config)===null||s===void 0?void 0:s.pageSize)!==null&&i!==void 0?i:this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};let e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");let e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){var e;return((e=this.params.config)===null||e===void 0?void 0:e.pageToken)!==void 0}};e4e=class extends F_{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new pw(dw.PAGED_ITEM_BATCH_JOBS,r=>this.listInternal(r),await this.listInternal(n),n),this.create=async n=>(this.apiClient.isVertexAI()&&(n.config=this.formatDestination(n.src,n.config)),this.createInternal(n)),this.createEmbeddings=async n=>{if(console.warn("batches.createEmbeddings() is experimental and may change without notice."),this.apiClient.isVertexAI())throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support batches.createEmbeddings.");return this.createEmbeddingsInternal(n)}}createInlinedGenerateContentRequest(e){let n=J3t(this.apiClient,e),r=n._url,s=Zn("{model}:batchGenerateContent",r),a=n.batch.inputConfig.requests,c=a.requests,u=[];for(let l of c){let d=Object.assign({},l);if(d.systemInstruction){let h=d.systemInstruction;delete d.systemInstruction;let m=d.request;m.systemInstruction=h,d.request=m}u.push(d)}return a.requests=u,delete n.config,delete n._url,delete n._query,{path:s,body:n}}getGcsUri(e){if(typeof e=="string")return e.startsWith("gs://")?e:void 0;if(!Array.isArray(e)&&e.gcsUri&&e.gcsUri.length>0)return e.gcsUri[0]}getBigqueryUri(e){if(typeof e=="string")return e.startsWith("bq://")?e:void 0;if(!Array.isArray(e))return e.bigqueryUri}formatDestination(e,n){let r=n?Object.assign({},n):{},s=Date.now().toString();if(r.displayName||(r.displayName=`genaiBatchJob_${s}`),r.dest===void 0){let i=this.getGcsUri(e),o=this.getBigqueryUri(e);if(i)i.endsWith(".jsonl")?r.dest=`${i.slice(0,-6)}/dest`:r.dest=`${i}_dest_${s}`;else if(o)r.dest=`${o}_dest_${s}`;else throw new Error("Unsupported source for Gemini Enterprise Agent Platform (previously known as Vertex AI): No GCS or BigQuery URI found.")}return r}async createInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=kOr(this.apiClient,e);return a=Zn("batchPredictionJobs",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>Z5e(l))}else{let u=J3t(this.apiClient,e);return a=Zn("{model}:batchGenerateContent",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),o.then(l=>Nfe(l))}}async createEmbeddingsInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=DOr(this.apiClient,e);return i=Zn("{model}:asyncBatchEmbedContent",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>Nfe(c))}}async get(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=VOr(this.apiClient,e);return a=Zn("batchPredictionJobs/{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>Z5e(l))}else{let u=HOr(this.apiClient,e);return a=Zn("batches/{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),o.then(l=>Nfe(l))}}async cancel(e){var n,r,s,i;let o="",a={};if(this.apiClient.isVertexAI()){let c=xOr(this.apiClient,e);o=Zn("batchPredictionJobs/{name}:cancel",c._url),a=c._query,delete c._url,delete c._query,await this.apiClient.request({path:o,queryParams:a,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal})}else{let c=IOr(this.apiClient,e);o=Zn("batches/{name}:cancel",c._url),a=c._query,delete c._url,delete c._query,await this.apiClient.request({path:o,queryParams:a,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal})}}async listInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=tMr(e);return a=Zn("batchPredictionJobs",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=rMr(l),h=new qfe;return Object.assign(h,d),h})}else{let u=eMr(e);return a=Zn("batches",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=nMr(l),h=new qfe;return Object.assign(h,d),h})}}async delete(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=POr(this.apiClient,e);return a=Zn("batchPredictionJobs/{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>MOr(l))}else{let u=BOr(this.apiClient,e);return a=Zn("batches/{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>OOr(l))}}};t4e=class extends F_{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new pw(dw.PAGED_ITEM_CACHED_CONTENTS,r=>this.listInternal(r),await this.listInternal(n),n)}async create(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=fMr(this.apiClient,e);return a=Zn("cachedContents",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>l)}else{let u=mMr(this.apiClient,e);return a=Zn("cachedContents",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),o.then(l=>l)}}async get(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=xMr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>l)}else{let u=IMr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),o.then(l=>l)}}async delete(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=AMr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=EMr(l),h=new Gfe;return Object.assign(h,d),h})}else{let u=gMr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=yMr(l),h=new Gfe;return Object.assign(h,d),h})}}async update(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=WMr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>l)}else{let u=GMr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),o.then(l=>l)}}async listInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=NMr(e);return a=Zn("cachedContents",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=BMr(l),h=new Wfe;return Object.assign(h,d),h})}else{let u=kMr(e);return a=Zn("cachedContents",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=DMr(l),h=new Wfe;return Object.assign(h,d),h})}}};n4e=class{constructor(e,n){this.modelsModule=e,this.apiClient=n}create(e){return new r4e(this.apiClient,this.modelsModule,e.model,e.config,structuredClone(e.history))}},r4e=class{constructor(e,n,r,s={},i=[]){this.apiClient=e,this.modelsModule=n,this.model=r,this.config=s,this.history=i,this.sendPromise=Promise.resolve(),HMr(i)}async sendMessage(e){var n;await this.sendPromise;let r=ep(e.message),s=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(r),config:(n=e.config)!==null&&n!==void 0?n:this.config});return this.sendPromise=(async()=>{var i,o,a;let c=await s,u=(o=(i=c.candidates)===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.content,l=c.automaticFunctionCallingHistory,d=this.getHistory(!0).length,h=[];l!=null&&(h=(a=l.slice(d))!==null&&a!==void 0?a:[]);let m=u?[u]:[];this.recordHistory(r,m,h)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),s}async sendMessageStream(e){var n;await this.sendPromise;let r=ep(e.message),s=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(r),config:(n=e.config)!==null&&n!==void 0?n:this.config});this.sendPromise=s.then(()=>{}).catch(()=>{});let i=await s;return this.processStreamResponse(i,r)}getHistory(e=!1){let n=e?tHt(this.history):this.history;return structuredClone(n)}processStreamResponse(e,n){return M_(this,arguments,function*(){var s,i,o,a,c,u;let l=[];try{for(var d=!0,h=L_(e),m;m=yield oi(h.next()),s=m.done,!s;d=!0){a=m.value,d=!1;let f=a;if(qMr(f)){let g=(u=(c=f.candidates)===null||c===void 0?void 0:c[0])===null||u===void 0?void 0:u.content;g!==void 0&&l.push(g)}yield yield oi(f)}}catch(f){i={error:f}}finally{try{!d&&!s&&(o=h.return)&&(yield oi(o.call(h)))}finally{if(i)throw i.error}}this.recordHistory(n,l)})}recordHistory(e,n,r){let s=[];n.length>0&&n.every(i=>i.role!==void 0)?s=n:s.push({role:"model",parts:[]}),r&&r.length>0?this.history.push(...tHt(r)):this.history.push(e),this.history.push(...s)}};jfe=class t extends Error{constructor(e){super(e.message),this.name="ApiError",this.status=e.status,Object.setPrototypeOf(this,t.prototype)}};s4e=class extends F_{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new pw(dw.PAGED_ITEM_FILES,r=>this.listInternal(r),await this.listInternal(n),n)}async upload(e){if(this.apiClient.isVertexAI())throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(e.file,e.config).then(n=>n)}async download(e){await this.apiClient.downloadFile(e)}async registerFiles(e){throw new Error("registerFiles is only supported in Node.js environments.")}async _registerFiles(e){return this.registerFilesInternal(e)}async listInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=ZMr(e);return i=Zn("files",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),s.then(c=>{let u=eLr(c),l=new V5e;return Object.assign(l,u),l})}}async createInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=VMr(e);return i=Zn("upload/v1beta/files",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>{let u=jMr(c),l=new j5e;return Object.assign(l,u),l})}}async get(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=zMr(e);return i=Zn("files/{file}",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>c)}}async delete(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=YMr(e);return i=Zn("files/{file}",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),s.then(c=>{let u=KMr(c),l=new Y5e;return Object.assign(l,u),l})}}async registerFilesInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=JMr(e);return i=Zn("files:register",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>{let u=tLr(c),l=new K5e;return Object.assign(l,u),l})}}};OQr="Content-Type",MQr="X-Server-Timeout",LQr="User-Agent",a4e="x-goog-api-client",FQr="1.52.0",QQr=`google-genai-sdk/${FQr}`,UQr="v1beta1",$Qr="v1beta",GQr=new Set(["us","eu"]),WQr=5,qQr=[408,429,500,502,503,504],c4e=class{constructor(e){var n,r,s;this.clientOptions=Object.assign({},e),this.customBaseUrl=(n=e.httpOptions)===null||n===void 0?void 0:n.baseUrl,this.clientOptions.vertexai&&(this.clientOptions.project&&this.clientOptions.location?this.clientOptions.apiKey=void 0:this.clientOptions.apiKey&&(this.clientOptions.project=void 0,this.clientOptions.location=void 0));let i={};if(this.clientOptions.vertexai){if(!this.clientOptions.location&&!this.clientOptions.apiKey&&!this.customBaseUrl&&(this.clientOptions.location="global"),!(this.clientOptions.project&&this.clientOptions.location||this.clientOptions.apiKey)&&!this.customBaseUrl)throw new Error("Authentication is not set up. Please provide either a project and location, or an API key, or a custom base URL.");let a=e.project&&e.location||!!e.apiKey;this.customBaseUrl&&!a?(i.baseUrl=this.customBaseUrl,this.clientOptions.project=void 0,this.clientOptions.location=void 0):this.clientOptions.apiKey||this.clientOptions.location==="global"?i.baseUrl="https://aiplatform.googleapis.com/":this.clientOptions.project&&this.clientOptions.location&&GQr.has(this.clientOptions.location)?i.baseUrl=`https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`:this.clientOptions.project&&this.clientOptions.location&&(i.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`),i.apiVersion=(r=this.clientOptions.apiVersion)!==null&&r!==void 0?r:UQr}else this.clientOptions.apiKey||console.warn("API key should be set when using the Gemini API."),i.apiVersion=(s=this.clientOptions.apiVersion)!==null&&s!==void 0?s:$Qr,i.baseUrl="https://generativelanguage.googleapis.com/";i.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=i,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(i,e.httpOptions))}isVertexAI(){var e;return(e=this.clientOptions.vertexai)!==null&&e!==void 0?e:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getCustomBaseUrl(){return this.customBaseUrl}async getAuthHeaders(){let e=new Headers;return await this.clientOptions.auth.addAuthHeaders(e),e}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");let r=[e.baseUrl.endsWith("/")?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==""&&r.push(e.apiVersion),r.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){let e=this.getBaseUrl(),n=new URL(e);return n.protocol=n.protocol=="http:"?"ws":"wss",n.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw new Error("HTTP options are not correctly set.")}constructUrl(e,n,r){let s=[this.getRequestUrlInternal(n)];return r&&s.push(this.getBaseResourcePath()),e!==""&&s.push(e),new URL(`${s.join("/")}`)}shouldPrependVertexProjectPath(e,n){return!(n.baseUrl&&n.baseUrlResourceScope===iz.COLLECTION||this.clientOptions.apiKey||!this.clientOptions.vertexai||e.path.startsWith("projects/")||e.httpMethod==="GET"&&e.path.startsWith("publishers/google/models"))}async request(e){let n=this.clientOptions.httpOptions;e.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));let r=this.shouldPrependVertexProjectPath(e,n),s=this.constructUrl(e.path,n,r);if(e.queryParams)for(let[o,a]of Object.entries(e.queryParams))s.searchParams.append(o,String(a));let i={};if(e.httpMethod==="GET"){if(e.body&&e.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else i.body=e.body;return i=await this.includeExtraHttpOptionsToRequestInit(i,n,s.toString(),e.abortSignal),this.unaryApiCall(s,i,e.httpMethod)}patchHttpOptions(e,n){let r=JSON.parse(JSON.stringify(e));for(let[s,i]of Object.entries(n))typeof i=="object"?r[s]=Object.assign(Object.assign({},r[s]),i):i!==void 0&&(r[s]=i);return r}async requestStream(e){let n=this.clientOptions.httpOptions;e.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));let r=this.shouldPrependVertexProjectPath(e,n),s=this.constructUrl(e.path,n,r);(!s.searchParams.has("alt")||s.searchParams.get("alt")!=="sse")&&s.searchParams.set("alt","sse");let i={};return i.body=e.body,i=await this.includeExtraHttpOptionsToRequestInit(i,n,s.toString(),e.abortSignal),this.streamApiCall(s,i,e.httpMethod)}async includeExtraHttpOptionsToRequestInit(e,n,r,s){if(n&&n.timeout||s){let i=new AbortController,o=i.signal;if(n.timeout&&n?.timeout>0){let a=setTimeout(()=>i.abort(),n.timeout);a&&typeof a.unref=="function"&&a.unref()}s&&s.addEventListener("abort",()=>{i.abort()}),e.signal=o}return n&&n.extraBody!==null&&HQr(e,n.extraBody),e.headers=await this.getHeadersInternal(n,r),e}async unaryApiCall(e,n,r){return this.apiCall(e.toString(),Object.assign(Object.assign({},n),{method:r})).then(async s=>(await aHt(s),new Qk(s))).catch(s=>{throw s instanceof Error?s:new Error(JSON.stringify(s))})}async streamApiCall(e,n,r){return this.apiCall(e.toString(),Object.assign(Object.assign({},n),{method:r})).then(async s=>(await aHt(s),this.processStreamResponse(s))).catch(s=>{throw s instanceof Error?s:new Error(JSON.stringify(s))})}processStreamResponse(e){return M_(this,arguments,function*(){var r;let s=(r=e?.body)===null||r===void 0?void 0:r.getReader(),i=new TextDecoder("utf-8");if(!s)throw new Error("Response body is empty");try{let o="",a="data:",c=[` +`+n)}function A2(t,e,n,r,i,s){if(t.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,A2),t.emit("wsClientError",o,n,e)}else gZ(n,r,i,s)}});var yoi,Eoi,boi,_oi,xoi,Soi,e7e,Coi,Ttn=v(()=>{p();yoi=Ot(ytn(),1),Eoi=Ot(Sbe(),1),boi=Ot(O3(),1),_oi=Ot(Wze(),1),xoi=Ot(jze(),1),Soi=Ot(Xze(),1),e7e=Ot(Tbe(),1),Coi=Ot(wtn(),1)});function voi(){return{geminiUrl:woi,vertexUrl:Toi}}function Roi(t,e,n,r){var i,s;if(!t?.baseUrl){let o=voi();return e?(i=o.vertexUrl)!==null&&i!==void 0?i:n:(s=o.geminiUrl)!==null&&s!==void 0?s:r}return t.baseUrl}function er(t,e){let n=/\{([^}]+)\}/g;return t.replace(n,(r,i)=>{if(Object.prototype.hasOwnProperty.call(e,i)){let s=e[i];return s!=null?String(s):""}else throw new Error(`Key '${i}' not found in valueMap.`)})}function M(t,e,n){for(let s=0;s({}));else throw new Error(`Value must be a list given an array path ${o}`);if(Array.isArray(t[a])){let c=t[a];if(Array.isArray(n))for(let u=0;uD(a,e.slice(r+1),n)):n}else return n}else t=t[i]}return t}catch(r){if(r instanceof TypeError)return n;throw r}}function koi(t,e){for(let[n,r]of Object.entries(e)){let i=n.split("."),s=r.split("."),o=new Set,a=-1;for(let c=0;ca)for(let c=a;c=e.length||typeof t!="object"||t===null)return;let s=e[r];if(s.endsWith("[]")){let o=s.slice(0,-2),a=t;if(o in a&&Array.isArray(a[o]))for(let c of a[o])i7e(c,e,n,r+1,i)}else if(s==="*"){if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let o=t,a=Object.keys(o).filter(u=>!u.startsWith("_")&&!i.has(u)),c={};for(let u of a)c[u]=o[u];for(let[u,l]of Object.entries(c)){let d=[];for(let m of n.slice(r))m==="*"?d.push(u):d.push(m);M(o,d,l)}for(let u of a)delete o[u]}}else{let o=t;s in o&&i7e(o[s],e,n,r+1,i)}}function PKe(t){if(typeof t!="string")throw new Error("fromImageBytes must be a string");return t}function Boi(t){let e={},n=D(t,["operationName"]);n!=null&&M(e,["operationName"],n);let r=D(t,["resourceName"]);return r!=null&&M(e,["_url","resourceName"],r),e}function Noi(t){let e={},n=D(t,["name"]);n!=null&&M(e,["name"],n);let r=D(t,["metadata"]);r!=null&&M(e,["metadata"],r);let i=D(t,["done"]);i!=null&&M(e,["done"],i);let s=D(t,["error"]);s!=null&&M(e,["error"],s);let o=D(t,["response","generateVideoResponse"]);return o!=null&&M(e,["response"],Poi(o)),e}function Doi(t){let e={},n=D(t,["name"]);n!=null&&M(e,["name"],n);let r=D(t,["metadata"]);r!=null&&M(e,["metadata"],r);let i=D(t,["done"]);i!=null&&M(e,["done"],i);let s=D(t,["error"]);s!=null&&M(e,["error"],s);let o=D(t,["response"]);return o!=null&&M(e,["response"],Moi(o)),e}function Poi(t){let e={},n=D(t,["generatedSamples"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(o=>Ooi(o))),M(e,["generatedVideos"],s)}let r=D(t,["raiMediaFilteredCount"]);r!=null&&M(e,["raiMediaFilteredCount"],r);let i=D(t,["raiMediaFilteredReasons"]);return i!=null&&M(e,["raiMediaFilteredReasons"],i),e}function Moi(t){let e={},n=D(t,["videos"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(o=>Loi(o))),M(e,["generatedVideos"],s)}let r=D(t,["raiMediaFilteredCount"]);r!=null&&M(e,["raiMediaFilteredCount"],r);let i=D(t,["raiMediaFilteredReasons"]);return i!=null&&M(e,["raiMediaFilteredReasons"],i),e}function Ooi(t){let e={},n=D(t,["video"]);return n!=null&&M(e,["video"],Woi(n)),e}function Loi(t){let e={},n=D(t,["_self"]);return n!=null&&M(e,["video"],Hoi(n)),e}function Foi(t){let e={},n=D(t,["operationName"]);return n!=null&&M(e,["_url","operationName"],n),e}function Qoi(t){let e={},n=D(t,["operationName"]);return n!=null&&M(e,["_url","operationName"],n),e}function Uoi(t){let e={},n=D(t,["name"]);n!=null&&M(e,["name"],n);let r=D(t,["metadata"]);r!=null&&M(e,["metadata"],r);let i=D(t,["done"]);i!=null&&M(e,["done"],i);let s=D(t,["error"]);s!=null&&M(e,["error"],s);let o=D(t,["response"]);return o!=null&&M(e,["response"],Goi(o)),e}function Goi(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["parent"]);r!=null&&M(e,["parent"],r);let i=D(t,["documentName"]);return i!=null&&M(e,["documentName"],i),e}function MKe(t){let e={},n=D(t,["name"]);n!=null&&M(e,["name"],n);let r=D(t,["metadata"]);r!=null&&M(e,["metadata"],r);let i=D(t,["done"]);i!=null&&M(e,["done"],i);let s=D(t,["error"]);s!=null&&M(e,["error"],s);let o=D(t,["response"]);return o!=null&&M(e,["response"],$oi(o)),e}function $oi(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["parent"]);r!=null&&M(e,["parent"],r);let i=D(t,["documentName"]);return i!=null&&M(e,["documentName"],i),e}function Woi(t){let e={},n=D(t,["uri"]);n!=null&&M(e,["uri"],n);let r=D(t,["encodedVideo"]);r!=null&&M(e,["videoBytes"],PKe(r));let i=D(t,["encoding"]);return i!=null&&M(e,["mimeType"],i),e}function Hoi(t){let e={},n=D(t,["gcsUri"]);n!=null&&M(e,["uri"],n);let r=D(t,["bytesBase64Encoded"]);r!=null&&M(e,["videoBytes"],PKe(r));let i=D(t,["mimeType"]);return i!=null&&M(e,["mimeType"],i),e}function ea(t,e){if(!e||typeof e!="string")throw new Error("model is required and must be a string");if(e.includes("..")||e.includes("?")||e.includes("&"))throw new Error("invalid model parameter");if(t.isVertexAI()){if(e.startsWith("publishers/")||e.startsWith("projects/")||e.startsWith("models/"))return e;if(e.indexOf("/")>=0){let n=e.split("/",2);return`publishers/${n[0]}/models/${n[1]}`}else return`publishers/google/models/${e}`}else return e.startsWith("models/")||e.startsWith("tunedModels/")?e:`models/${e}`}function Rrn(t,e){let n=ea(t,e);return n?n.startsWith("publishers/")&&t.isVertexAI()?`projects/${t.getProject()}/locations/${t.getLocation()}/${n}`:n.startsWith("models/")&&t.isVertexAI()?`projects/${t.getProject()}/locations/${t.getLocation()}/publishers/google/${n}`:n:""}function krn(t){return Array.isArray(t)?t.map(e=>Vbe(e)):[Vbe(t)]}function Vbe(t){if(typeof t=="object"&&t!==null)return t;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof t}`)}function Brn(t){let e=Vbe(t);if(e.mimeType&&e.mimeType.startsWith("image/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function Nrn(t){let e=Vbe(t);if(e.mimeType&&e.mimeType.startsWith("audio/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function Wnn(t){if(t==null)throw new Error("PartUnion is required");if(typeof t=="object")return t;if(typeof t=="string")return{text:t};throw new Error(`Unsupported part type: ${typeof t}`)}function Drn(t){if(t==null||Array.isArray(t)&&t.length===0)throw new Error("PartListUnion is required");return Array.isArray(t)?t.map(e=>Wnn(e)):[Wnn(t)]}function C7e(t){return t!=null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)}function Hnn(t){return t!=null&&typeof t=="object"&&"functionCall"in t}function qnn(t){return t!=null&&typeof t=="object"&&"functionResponse"in t}function zp(t){if(t==null)throw new Error("ContentUnion is required");return C7e(t)?t:{role:"user",parts:Drn(t)}}function OKe(t,e){if(!e)return[];if(t.isVertexAI()&&Array.isArray(e))return e.flatMap(n=>{let r=zp(n);return r.parts&&r.parts.length>0&&r.parts[0].text!==void 0?[r.parts[0].text]:[]});if(t.isVertexAI()){let n=zp(e);return n.parts&&n.parts.length>0&&n.parts[0].text!==void 0?[n.parts[0].text]:[]}return Array.isArray(e)?e.map(n=>zp(n)):[zp(e)]}function dA(t){if(t==null||Array.isArray(t)&&t.length===0)throw new Error("contents are required");if(!Array.isArray(t)){if(Hnn(t)||qnn(t))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[zp(t)]}let e=[],n=[],r=C7e(t[0]);for(let i of t){let s=C7e(i);if(s!=r)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(s)e.push(i);else{if(Hnn(i)||qnn(i))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");n.push(i)}}return r||e.push({role:"user",parts:Drn(n)}),e}function qoi(t,e){t.includes("null")&&(e.nullable=!0);let n=t.filter(r=>r!=="null");if(n.length===1)e.type=Object.values(EN).includes(n[0].toUpperCase())?n[0].toUpperCase():EN.TYPE_UNSPECIFIED;else{e.anyOf=[];for(let r of n)e.anyOf.push({type:Object.values(EN).includes(r.toUpperCase())?r.toUpperCase():EN.TYPE_UNSPECIFIED})}}function j3(t){let e={},n=["items"],r=["anyOf"],i=["properties"];if(t.type&&t.anyOf)throw new Error("type and anyOf cannot be both populated.");let s=t.anyOf;s!=null&&s.length==2&&(s[0].type==="null"?(e.nullable=!0,t=s[1]):s[1].type==="null"&&(e.nullable=!0,t=s[0])),t.type instanceof Array&&qoi(t.type,e);for(let[o,a]of Object.entries(t))if(a!=null)if(o=="type"){if(a==="null")throw new Error("type: null can not be the only possible type for the field.");if(a instanceof Array)continue;e.type=Object.values(EN).includes(a.toUpperCase())?a.toUpperCase():EN.TYPE_UNSPECIFIED}else if(n.includes(o))e[o]=j3(a);else if(r.includes(o)){let c=[];for(let u of a){if(u.type=="null"){e.nullable=!0;continue}c.push(j3(u))}e[o]=c}else if(i.includes(o)){let c={};for(let[u,l]of Object.entries(a))c[u]=j3(l);e[o]=c}else{if(o==="additionalProperties")continue;e[o]=a}return e}function LKe(t){return j3(t)}function FKe(t){if(typeof t=="object")return t;if(typeof t=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:t}}};throw new Error(`Unsupported speechConfig type: ${typeof t}`)}function QKe(t){if("multiSpeakerVoiceConfig"in t)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return t}function J3(t){if(t.functionDeclarations)for(let e of t.functionDeclarations)e.parameters&&(Object.keys(e.parameters).includes("$schema")?e.parametersJsonSchema||(e.parametersJsonSchema=e.parameters,delete e.parameters):e.parameters=j3(e.parameters)),e.response&&(Object.keys(e.response).includes("$schema")?e.responseJsonSchema||(e.responseJsonSchema=e.response,delete e.response):e.response=j3(e.response));return t}function X3(t){if(t==null)throw new Error("tools is required");if(!Array.isArray(t))throw new Error("tools is required and must be an array of Tools");let e=[];for(let n of t)e.push(n);return e}function joi(t,e,n,r=1){let i=!e.startsWith(`${n}/`)&&e.split("/").length===r;return t.isVertexAI()?e.startsWith("projects/")?e:e.startsWith("locations/")?`projects/${t.getProject()}/${e}`:e.startsWith(`${n}/`)?`projects/${t.getProject()}/locations/${t.getLocation()}/${e}`:i?`projects/${t.getProject()}/locations/${t.getLocation()}/${n}/${e}`:e:i?`${n}/${e}`:e}function Ov(t,e){if(typeof e!="string")throw new Error("name must be a string");return joi(t,e,"cachedContents")}function Prn(t){switch(t){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return t}}function b2(t){return PKe(t)}function Voi(t){return t!=null&&typeof t=="object"&&"name"in t}function Mrn(t){return t!=null&&typeof t=="object"&&"video"in t}function Orn(t){return t!=null&&typeof t=="object"&&"uri"in t}function UKe(t){var e;let n;if(Voi(t)&&(n=t.name),!(Orn(t)&&(n=t.uri,n===void 0))&&!(Mrn(t)&&(n=(e=t.video)===null||e===void 0?void 0:e.uri,n===void 0))){if(typeof t=="string"&&(n=t),n===void 0)throw new Error("Could not extract file name from the provided input.");if(n.startsWith("https://")){let i=n.split("files/")[1].match(/[a-z0-9]+/);if(i===null)throw new Error(`Could not extract file name from URI ${n}`);n=i[0]}else n.startsWith("files/")&&(n=n.split("files/")[1]);return n}}function Lrn(t,e){let n;return t.isVertexAI()?n=e?"publishers/google/models":"models":n=e?"models":"tunedModels",n}function Frn(t){for(let e of["models","tunedModels","publisherModels"])if(Yoi(t,e))return t[e];return[]}function Yoi(t,e){return t!==null&&typeof t=="object"&&e in t}function zoi(t,e={}){let n=t,r={name:n.name,description:n.description,parametersJsonSchema:n.inputSchema};return n.outputSchema&&(r.responseJsonSchema=n.outputSchema),e.behavior&&(r.behavior=e.behavior),{functionDeclarations:[r]}}function Koi(t,e={}){let n=[],r=new Set;for(let i of t){let s=i.name;if(r.has(s))throw new Error(`Duplicate function name ${s} found in MCP tools. Please ensure function names are unique.`);r.add(s);let o=zoi(i,e);o.functionDeclarations&&n.push(...o.functionDeclarations)}return{functionDeclarations:n}}function Qrn(t,e){let n;if(typeof e=="string")if(t.isVertexAI())if(e.startsWith("gs://"))n={format:"jsonl",gcsUri:[e]};else if(e.startsWith("bq://"))n={format:"bigquery",bigqueryUri:e};else if(/^projects\/[^/]+\/locations\/[^/]+\/datasets\/[^/]+$/.test(e))n={format:"vertex-dataset",vertexDatasetName:e};else throw new Error(`Unsupported string source for Vertex AI: ${e}`);else if(e.startsWith("files/"))n={fileName:e};else throw new Error(`Unsupported string source for Gemini API: ${e}`);else if(Array.isArray(e)){if(t.isVertexAI())throw new Error("InlinedRequest[] is not supported in Vertex AI.");n={inlinedRequests:e}}else n=e;let r=[n.gcsUri,n.bigqueryUri,n.vertexDatasetName].filter(Boolean).length,i=[n.inlinedRequests,n.fileName].filter(Boolean).length;if(t.isVertexAI()){if(i>0||r!==1)throw new Error("Exactly one of `gcsUri`, `bigqueryUri`, or `vertexDatasetName` must be set for Vertex AI.")}else if(r>0||i!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return n}function Joi(t){if(typeof t!="string")return t;let e=t;if(e.startsWith("gs://"))return{format:"jsonl",gcsUri:e};if(e.startsWith("bq://"))return{format:"bigquery",bigqueryUri:e};throw new Error(`Unsupported destination: ${e}`)}function Urn(t){if(typeof t!="object"||t===null)return{};let e=t,n=e.inlinedResponses;if(typeof n!="object"||n===null)return t;let i=n.inlinedResponses;if(!Array.isArray(i)||i.length===0)return t;let s=!1;for(let o of i){if(typeof o!="object"||o===null)continue;let c=o.response;if(typeof c!="object"||c===null)continue;if(c.embedding!==void 0){s=!0;break}}return s&&(e.inlinedEmbedContentResponses=e.inlinedResponses,delete e.inlinedResponses),t}function Z3(t,e){let n=e;if(!t.isVertexAI()){if(/batches\/[^/]+$/.test(n))return n.split("/").pop();throw new Error(`Invalid batch job name: ${n}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(n))return n.split("/").pop();if(/^\d+$/.test(n))return n;throw new Error(`Invalid batch job name: ${n}.`)}function Grn(t){let e=t;return e==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":e==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":e==="BATCH_STATE_RUNNING"?"JOB_STATE_RUNNING":e==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":e==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":e==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":e==="BATCH_STATE_EXPIRED"?"JOB_STATE_EXPIRED":e}function Xoi(t){return t.includes("gemini")&&t!=="gemini-embedding-001"||t.includes("maas")}function Zoi(t){let e={},n=D(t,["apiKey"]);if(n!=null&&M(e,["apiKey"],n),D(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["authType"])!==void 0)throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function eai(t){let e={},n=D(t,["responsesFile"]);n!=null&&M(e,["fileName"],n);let r=D(t,["inlinedResponses","inlinedResponses"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>Pai(o))),M(e,["inlinedResponses"],s)}let i=D(t,["inlinedEmbedContentResponses","inlinedResponses"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>o)),M(e,["inlinedEmbedContentResponses"],s)}return e}function tai(t){let e={},n=D(t,["predictionsFormat"]);n!=null&&M(e,["format"],n);let r=D(t,["gcsDestination","outputUriPrefix"]);r!=null&&M(e,["gcsUri"],r);let i=D(t,["bigqueryDestination","outputUri"]);i!=null&&M(e,["bigqueryUri"],i);let s=D(t,["vertexMultimodalDatasetDestination"]);return s!=null&&M(e,["vertexDataset"],qai(s)),e}function nai(t){let e={},n=D(t,["format"]);n!=null&&M(e,["predictionsFormat"],n);let r=D(t,["gcsUri"]);r!=null&&M(e,["gcsDestination","outputUriPrefix"],r);let i=D(t,["bigqueryUri"]);i!=null&&M(e,["bigqueryDestination","outputUri"],i);let s=D(t,["vertexDataset"]);if(s!=null&&M(e,["vertexMultimodalDatasetDestination"],jai(s)),D(t,["fileName"])!==void 0)throw new Error("fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function Dbe(t){let e={},n=D(t,["name"]);n!=null&&M(e,["name"],n);let r=D(t,["metadata","displayName"]);r!=null&&M(e,["displayName"],r);let i=D(t,["metadata","state"]);i!=null&&M(e,["state"],Grn(i));let s=D(t,["metadata","createTime"]);s!=null&&M(e,["createTime"],s);let o=D(t,["metadata","endTime"]);o!=null&&M(e,["endTime"],o);let a=D(t,["metadata","updateTime"]);a!=null&&M(e,["updateTime"],a);let c=D(t,["metadata","model"]);c!=null&&M(e,["model"],c);let u=D(t,["metadata","output"]);return u!=null&&M(e,["dest"],eai(Urn(u))),e}function I7e(t){let e={},n=D(t,["name"]);n!=null&&M(e,["name"],n);let r=D(t,["displayName"]);r!=null&&M(e,["displayName"],r);let i=D(t,["state"]);i!=null&&M(e,["state"],Grn(i));let s=D(t,["error"]);s!=null&&M(e,["error"],s);let o=D(t,["createTime"]);o!=null&&M(e,["createTime"],o);let a=D(t,["startTime"]);a!=null&&M(e,["startTime"],a);let c=D(t,["endTime"]);c!=null&&M(e,["endTime"],c);let u=D(t,["updateTime"]);u!=null&&M(e,["updateTime"],u);let l=D(t,["model"]);l!=null&&M(e,["model"],l);let d=D(t,["inputConfig"]);d!=null&&M(e,["src"],rai(d));let m=D(t,["outputConfig"]);m!=null&&M(e,["dest"],tai(Urn(m)));let h=D(t,["outputInfo"]);h!=null&&M(e,["outputInfo"],h);let f=D(t,["completionStats"]);return f!=null&&M(e,["completionStats"],f),e}function rai(t){let e={},n=D(t,["instancesFormat"]);n!=null&&M(e,["format"],n);let r=D(t,["gcsSource","uris"]);r!=null&&M(e,["gcsUri"],r);let i=D(t,["bigquerySource","inputUri"]);i!=null&&M(e,["bigqueryUri"],i);let s=D(t,["vertexMultimodalDatasetSource","datasetName"]);return s!=null&&M(e,["vertexDatasetName"],s),e}function iai(t,e){let n={};if(D(e,["format"])!==void 0)throw new Error("format parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(e,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(e,["vertexDatasetName"])!==void 0)throw new Error("vertexDatasetName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(e,["fileName"]);r!=null&&M(n,["fileName"],r);let i=D(e,["inlinedRequests"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>Dai(t,o))),M(n,["requests","requests"],s)}return n}function sai(t){let e={},n=D(t,["format"]);n!=null&&M(e,["instancesFormat"],n);let r=D(t,["gcsUri"]);r!=null&&M(e,["gcsSource","uris"],r);let i=D(t,["bigqueryUri"]);i!=null&&M(e,["bigquerySource","inputUri"],i);let s=D(t,["vertexDatasetName"]);if(s!=null&&M(e,["vertexMultimodalDatasetSource","datasetName"],s),D(t,["fileName"])!==void 0)throw new Error("fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function oai(t){let e={},n=D(t,["data"]);if(n!=null&&M(e,["data"],n),D(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["mimeType"]);return r!=null&&M(e,["mimeType"],r),e}function aai(t,e){let n={},r=D(e,["name"]);return r!=null&&M(n,["_url","name"],Z3(t,r)),n}function cai(t,e){let n={},r=D(e,["name"]);return r!=null&&M(n,["_url","name"],Z3(t,r)),n}function lai(t){let e={},n=D(t,["content"]);n!=null&&M(e,["content"],n);let r=D(t,["citationMetadata"]);r!=null&&M(e,["citationMetadata"],uai(r));let i=D(t,["tokenCount"]);i!=null&&M(e,["tokenCount"],i);let s=D(t,["finishReason"]);s!=null&&M(e,["finishReason"],s);let o=D(t,["groundingMetadata"]);o!=null&&M(e,["groundingMetadata"],o);let a=D(t,["avgLogprobs"]);a!=null&&M(e,["avgLogprobs"],a);let c=D(t,["index"]);c!=null&&M(e,["index"],c);let u=D(t,["logprobsResult"]);u!=null&&M(e,["logprobsResult"],u);let l=D(t,["safetyRatings"]);if(l!=null){let m=l;Array.isArray(m)&&(m=m.map(h=>h)),M(e,["safetyRatings"],m)}let d=D(t,["urlContextMetadata"]);return d!=null&&M(e,["urlContextMetadata"],d),e}function uai(t){let e={},n=D(t,["citationSources"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>i)),M(e,["citations"],r)}return e}function $rn(t){let e={},n=D(t,["parts"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>Gai(s))),M(e,["parts"],i)}let r=D(t,["role"]);return r!=null&&M(e,["role"],r),e}function dai(t,e){let n={},r=D(t,["displayName"]);if(e!==void 0&&r!=null&&M(e,["batch","displayName"],r),D(t,["dest"])!==void 0)throw new Error("dest parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let i=D(t,["webhookConfig"]);return e!==void 0&&i!=null&&M(e,["batch","webhookConfig"],i),n}function pai(t,e){let n={},r=D(t,["displayName"]);e!==void 0&&r!=null&&M(e,["displayName"],r);let i=D(t,["dest"]);if(e!==void 0&&i!=null&&M(e,["outputConfig"],nai(Joi(i))),D(t,["webhookConfig"])!==void 0)throw new Error("webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}function jnn(t,e){let n={},r=D(e,["model"]);r!=null&&M(n,["_url","model"],ea(t,r));let i=D(e,["src"]);i!=null&&M(n,["batch","inputConfig"],iai(t,Qrn(t,i)));let s=D(e,["config"]);return s!=null&&dai(s,n),n}function mai(t,e){let n={},r=D(e,["model"]);r!=null&&M(n,["model"],ea(t,r));let i=D(e,["src"]);i!=null&&M(n,["inputConfig"],sai(Qrn(t,i)));let s=D(e,["config"]);return s!=null&&pai(s,n),n}function hai(t,e){let n={},r=D(t,["displayName"]);return e!==void 0&&r!=null&&M(e,["batch","displayName"],r),n}function fai(t,e){let n={},r=D(e,["model"]);r!=null&&M(n,["_url","model"],ea(t,r));let i=D(e,["src"]);i!=null&&M(n,["batch","inputConfig"],xai(t,i));let s=D(e,["config"]);return s!=null&&hai(s,n),n}function gai(t,e){let n={},r=D(e,["name"]);return r!=null&&M(n,["_url","name"],Z3(t,r)),n}function Aai(t,e){let n={},r=D(e,["name"]);return r!=null&&M(n,["_url","name"],Z3(t,r)),n}function yai(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["name"]);r!=null&&M(e,["name"],r);let i=D(t,["done"]);i!=null&&M(e,["done"],i);let s=D(t,["error"]);return s!=null&&M(e,["error"],s),e}function Eai(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["name"]);r!=null&&M(e,["name"],r);let i=D(t,["done"]);i!=null&&M(e,["done"],i);let s=D(t,["error"]);return s!=null&&M(e,["error"],s),e}function bai(t,e){let n={},r=D(e,["contents"]);if(r!=null){let s=OKe(t,r);Array.isArray(s)&&(s=s.map(o=>o)),M(n,["requests[]","request","content"],s)}let i=D(e,["config"]);return i!=null&&(M(n,["_self"],_ai(i,n)),koi(n,{"requests[].*":"requests[].request.*"})),n}function _ai(t,e){let n={},r=D(t,["taskType"]);e!==void 0&&r!=null&&M(e,["requests[]","taskType"],r);let i=D(t,["title"]);e!==void 0&&i!=null&&M(e,["requests[]","title"],i);let s=D(t,["outputDimensionality"]);if(e!==void 0&&s!=null&&M(e,["requests[]","outputDimensionality"],s),D(t,["mimeType"])!==void 0)throw new Error("mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["documentOcr"])!==void 0)throw new Error("documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["audioTrackExtraction"])!==void 0)throw new Error("audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}function xai(t,e){let n={},r=D(e,["fileName"]);r!=null&&M(n,["file_name"],r);let i=D(e,["inlinedRequests"]);return i!=null&&M(n,["requests"],bai(t,i)),n}function Sai(t){let e={};if(D(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["fileUri"]);n!=null&&M(e,["fileUri"],n);let r=D(t,["mimeType"]);return r!=null&&M(e,["mimeType"],r),e}function Cai(t){let e={},n=D(t,["args"]);n!=null&&M(e,["args"],n);let r=D(t,["id"]);r!=null&&M(e,["id"],r);let i=D(t,["name"]);if(i!=null&&M(e,["name"],i),D(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function Iai(t){let e={},n=D(t,["allowedFunctionNames"]);n!=null&&M(e,["allowedFunctionNames"],n);let r=D(t,["mode"]);if(r!=null&&M(e,["mode"],r),D(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function wai(t,e,n){let r={},i=D(e,["serviceTier"]);n!==void 0&&i!=null&&M(n,["serviceTier"],i);let s=D(e,["systemInstruction"]);n!==void 0&&s!=null&&M(n,["systemInstruction"],$rn(zp(s)));let o=D(e,["temperature"]);o!=null&&M(r,["temperature"],o);let a=D(e,["topP"]);a!=null&&M(r,["topP"],a);let c=D(e,["topK"]);c!=null&&M(r,["topK"],c);let u=D(e,["candidateCount"]);u!=null&&M(r,["candidateCount"],u);let l=D(e,["maxOutputTokens"]);l!=null&&M(r,["maxOutputTokens"],l);let d=D(e,["stopSequences"]);d!=null&&M(r,["stopSequences"],d);let m=D(e,["responseLogprobs"]);m!=null&&M(r,["responseLogprobs"],m);let h=D(e,["logprobs"]);h!=null&&M(r,["logprobs"],h);let f=D(e,["presencePenalty"]);f!=null&&M(r,["presencePenalty"],f);let g=D(e,["frequencyPenalty"]);g!=null&&M(r,["frequencyPenalty"],g);let A=D(e,["seed"]);A!=null&&M(r,["seed"],A);let y=D(e,["responseMimeType"]);y!=null&&M(r,["responseMimeType"],y);let E=D(e,["responseSchema"]);E!=null&&M(r,["responseSchema"],LKe(E));let _=D(e,["responseJsonSchema"]);if(_!=null&&M(r,["responseJsonSchema"],_),D(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let S=D(e,["safetySettings"]);if(n!==void 0&&S!=null){let ce=S;Array.isArray(ce)&&(ce=ce.map(Y=>$ai(Y))),M(n,["safetySettings"],ce)}let C=D(e,["tools"]);if(n!==void 0&&C!=null){let ce=X3(C);Array.isArray(ce)&&(ce=ce.map(Y=>Hai(J3(Y)))),M(n,["tools"],ce)}let I=D(e,["toolConfig"]);if(n!==void 0&&I!=null&&M(n,["toolConfig"],Wai(I)),D(e,["labels"])!==void 0)throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let w=D(e,["cachedContent"]);n!==void 0&&w!=null&&M(n,["cachedContent"],Ov(t,w));let k=D(e,["responseModalities"]);k!=null&&M(r,["responseModalities"],k);let N=D(e,["mediaResolution"]);N!=null&&M(r,["mediaResolution"],N);let O=D(e,["speechConfig"]);if(O!=null&&M(r,["speechConfig"],FKe(O)),D(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let W=D(e,["thinkingConfig"]);W!=null&&M(r,["thinkingConfig"],W);let $=D(e,["audioTranscriptionConfig"]);$!=null&&M(r,["audioTranscriptionConfig"],$);let G=D(e,["imageConfig"]);G!=null&&M(r,["imageConfig"],Nai(G));let q=D(e,["enableEnhancedCivicAnswers"]);if(q!=null&&M(r,["enableEnhancedCivicAnswers"],q),D(e,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return r}function Tai(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["candidates"]);if(r!=null){let u=r;Array.isArray(u)&&(u=u.map(l=>lai(l))),M(e,["candidates"],u)}let i=D(t,["modelVersion"]);i!=null&&M(e,["modelVersion"],i);let s=D(t,["promptFeedback"]);s!=null&&M(e,["promptFeedback"],s);let o=D(t,["responseId"]);o!=null&&M(e,["responseId"],o);let a=D(t,["usageMetadata"]);a!=null&&M(e,["usageMetadata"],a);let c=D(t,["modelStatus"]);return c!=null&&M(e,["modelStatus"],c),e}function vai(t,e){let n={},r=D(e,["name"]);return r!=null&&M(n,["_url","name"],Z3(t,r)),n}function Rai(t,e){let n={},r=D(e,["name"]);return r!=null&&M(n,["_url","name"],Z3(t,r)),n}function kai(t){let e={},n=D(t,["authConfig"]);n!=null&&M(e,["authConfig"],Zoi(n));let r=D(t,["enableWidget"]);if(r!=null&&M(e,["enableWidget"],r),D(t,["groundingTypes"])!==void 0)throw new Error("groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function Bai(t){let e={};if(D(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["searchTypes"]);n!=null&&M(e,["searchTypes"],n);let r=D(t,["timeRangeFilter"]);return r!=null&&M(e,["timeRangeFilter"],r),e}function Nai(t){let e={},n=D(t,["aspectRatio"]);n!=null&&M(e,["aspectRatio"],n);let r=D(t,["imageSize"]);if(r!=null&&M(e,["imageSize"],r),D(t,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["imageOutputOptions"])!==void 0)throw new Error("imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["prominentPeople"])!==void 0)throw new Error("prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function Dai(t,e){let n={},r=D(e,["model"]);r!=null&&M(n,["request","model"],ea(t,r));let i=D(e,["contents"]);if(i!=null){let a=dA(i);Array.isArray(a)&&(a=a.map(c=>$rn(c))),M(n,["request","contents"],a)}let s=D(e,["metadata"]);s!=null&&M(n,["metadata"],s);let o=D(e,["config"]);return o!=null&&M(n,["request","generationConfig"],wai(t,o,D(n,["request"],{}))),n}function Pai(t){let e={},n=D(t,["response"]);n!=null&&M(e,["response"],Tai(n));let r=D(t,["metadata"]);r!=null&&M(e,["metadata"],r);let i=D(t,["error"]);return i!=null&&M(e,["error"],i),e}function Mai(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&M(e,["_query","pageSize"],r);let i=D(t,["pageToken"]);if(e!==void 0&&i!=null&&M(e,["_query","pageToken"],i),D(t,["filter"])!==void 0)throw new Error("filter parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}function Oai(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&M(e,["_query","pageSize"],r);let i=D(t,["pageToken"]);e!==void 0&&i!=null&&M(e,["_query","pageToken"],i);let s=D(t,["filter"]);return e!==void 0&&s!=null&&M(e,["_query","filter"],s),n}function Lai(t){let e={},n=D(t,["config"]);return n!=null&&Mai(n,e),e}function Fai(t){let e={},n=D(t,["config"]);return n!=null&&Oai(n,e),e}function Qai(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&M(e,["nextPageToken"],r);let i=D(t,["operations"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>Dbe(o))),M(e,["batchJobs"],s)}return e}function Uai(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&M(e,["nextPageToken"],r);let i=D(t,["batchPredictionJobs"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>I7e(o))),M(e,["batchJobs"],s)}return e}function Gai(t){let e={},n=D(t,["mediaResolution"]);n!=null&&M(e,["mediaResolution"],n);let r=D(t,["toolCall"]);r!=null&&M(e,["toolCall"],r);let i=D(t,["toolResponse"]);i!=null&&M(e,["toolResponse"],i);let s=D(t,["audioTranscription"]);s!=null&&M(e,["audioTranscription"],s);let o=D(t,["codeExecutionResult"]);o!=null&&M(e,["codeExecutionResult"],o);let a=D(t,["executableCode"]);a!=null&&M(e,["executableCode"],a);let c=D(t,["fileData"]);c!=null&&M(e,["fileData"],Sai(c));let u=D(t,["functionCall"]);u!=null&&M(e,["functionCall"],Cai(u));let l=D(t,["functionResponse"]);l!=null&&M(e,["functionResponse"],l);let d=D(t,["inlineData"]);d!=null&&M(e,["inlineData"],oai(d));let m=D(t,["text"]);m!=null&&M(e,["text"],m);let h=D(t,["thought"]);h!=null&&M(e,["thought"],h);let f=D(t,["thoughtSignature"]);f!=null&&M(e,["thoughtSignature"],f);let g=D(t,["videoMetadata"]);g!=null&&M(e,["videoMetadata"],g);let A=D(t,["partMetadata"]);A!=null&&M(e,["partMetadata"],A);let y=D(t,["mediaProcessing"]);return y!=null&&M(e,["mediaProcessing"],y),e}function $ai(t){let e={},n=D(t,["category"]);if(n!=null&&M(e,["category"],n),D(t,["method"])!==void 0)throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["threshold"]);return r!=null&&M(e,["threshold"],r),e}function Wai(t){let e={},n=D(t,["functionCallingConfig"]);n!=null&&M(e,["functionCallingConfig"],Iai(n));let r=D(t,["retrievalConfig"]);r!=null&&M(e,["retrievalConfig"],r);let i=D(t,["includeServerSideToolInvocations"]);return i!=null&&M(e,["includeServerSideToolInvocations"],i),e}function Hai(t){let e={};if(D(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["googleMaps"]);n!=null&&M(e,["googleMaps"],kai(n));let r=D(t,["mcpServers"]);if(r!=null){let d=r;Array.isArray(d)&&(d=d.map(m=>m)),M(e,["mcpServers"],d)}let i=D(t,["codeExecution"]);i!=null&&M(e,["codeExecution"],i);let s=D(t,["computerUse"]);if(s!=null&&M(e,["computerUse"],s),D(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["exaAiSearch"])!==void 0)throw new Error("exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=D(t,["functionDeclarations"]);if(o!=null){let d=o;Array.isArray(d)&&(d=d.map(m=>m)),M(e,["functionDeclarations"],d)}let a=D(t,["googleSearch"]);a!=null&&M(e,["googleSearch"],Bai(a));let c=D(t,["googleSearchRetrieval"]);if(c!=null&&M(e,["googleSearchRetrieval"],c),D(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=D(t,["urlContext"]);u!=null&&M(e,["urlContext"],u);let l=D(t,["fileSearch"]);return l!=null&&M(e,["fileSearch"],l),e}function qai(t){let e={},n=D(t,["bigqueryDestination","outputUri"]);n!=null&&M(e,["bigqueryDestination"],n);let r=D(t,["displayName"]);return r!=null&&M(e,["displayName"],r),e}function jai(t){let e={},n=D(t,["bigqueryDestination"]);n!=null&&M(e,["bigqueryDestination","outputUri"],n);let r=D(t,["displayName"]);return r!=null&&M(e,["displayName"],r),e}function Vai(t){let e={},n=D(t,["apiKey"]);if(n!=null&&M(e,["apiKey"],n),D(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["authType"])!==void 0)throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function Yai(t){let e={},n=D(t,["data"]);if(n!=null&&M(e,["data"],n),D(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["mimeType"]);return r!=null&&M(e,["mimeType"],r),e}function zai(t){let e={},n=D(t,["enablePromptInjectionDetection"]);n!=null&&M(e,["enablePromptInjectionDetection"],n);let r=D(t,["environment"]);r!=null&&M(e,["environment"],r);let i=D(t,["excludedPredefinedFunctions"]);if(i!=null&&M(e,["excludedPredefinedFunctions"],i),D(t,["disabledSafetyPolicies"])!==void 0)throw new Error("disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function Vnn(t){let e={},n=D(t,["parts"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>yci(s))),M(e,["parts"],i)}let r=D(t,["role"]);return r!=null&&M(e,["role"],r),e}function Ynn(t){let e={},n=D(t,["parts"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>Eci(s))),M(e,["parts"],i)}let r=D(t,["role"]);return r!=null&&M(e,["role"],r),e}function Kai(t,e){let n={},r=D(t,["ttl"]);e!==void 0&&r!=null&&M(e,["ttl"],r);let i=D(t,["expireTime"]);e!==void 0&&i!=null&&M(e,["expireTime"],i);let s=D(t,["displayName"]);e!==void 0&&s!=null&&M(e,["displayName"],s);let o=D(t,["contents"]);if(e!==void 0&&o!=null){let l=dA(o);Array.isArray(l)&&(l=l.map(d=>Vnn(d))),M(e,["contents"],l)}let a=D(t,["systemInstruction"]);e!==void 0&&a!=null&&M(e,["systemInstruction"],Vnn(zp(a)));let c=D(t,["tools"]);if(e!==void 0&&c!=null){let l=c;Array.isArray(l)&&(l=l.map(d=>xci(d))),M(e,["tools"],l)}let u=D(t,["toolConfig"]);if(e!==void 0&&u!=null&&M(e,["toolConfig"],bci(u)),D(t,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}function Jai(t,e){let n={},r=D(t,["ttl"]);e!==void 0&&r!=null&&M(e,["ttl"],r);let i=D(t,["expireTime"]);e!==void 0&&i!=null&&M(e,["expireTime"],i);let s=D(t,["displayName"]);e!==void 0&&s!=null&&M(e,["displayName"],s);let o=D(t,["contents"]);if(e!==void 0&&o!=null){let d=dA(o);Array.isArray(d)&&(d=d.map(m=>Ynn(m))),M(e,["contents"],d)}let a=D(t,["systemInstruction"]);e!==void 0&&a!=null&&M(e,["systemInstruction"],Ynn(zp(a)));let c=D(t,["tools"]);if(e!==void 0&&c!=null){let d=c;Array.isArray(d)&&(d=d.map(m=>Sci(m))),M(e,["tools"],d)}let u=D(t,["toolConfig"]);e!==void 0&&u!=null&&M(e,["toolConfig"],_ci(u));let l=D(t,["kmsKeyName"]);return e!==void 0&&l!=null&&M(e,["encryption_spec","kmsKeyName"],l),n}function Xai(t,e){let n={},r=D(e,["model"]);r!=null&&M(n,["model"],Rrn(t,r));let i=D(e,["config"]);return i!=null&&Kai(i,n),n}function Zai(t,e){let n={},r=D(e,["model"]);r!=null&&M(n,["model"],Rrn(t,r));let i=D(e,["config"]);return i!=null&&Jai(i,n),n}function eci(t,e){let n={},r=D(e,["name"]);return r!=null&&M(n,["_url","name"],Ov(t,r)),n}function tci(t,e){let n={},r=D(e,["name"]);return r!=null&&M(n,["_url","name"],Ov(t,r)),n}function nci(t){let e={},n=D(t,["sdkHttpResponse"]);return n!=null&&M(e,["sdkHttpResponse"],n),e}function rci(t){let e={},n=D(t,["sdkHttpResponse"]);return n!=null&&M(e,["sdkHttpResponse"],n),e}function ici(t){let e={};if(D(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["fileUri"]);n!=null&&M(e,["fileUri"],n);let r=D(t,["mimeType"]);return r!=null&&M(e,["mimeType"],r),e}function sci(t){let e={},n=D(t,["args"]);n!=null&&M(e,["args"],n);let r=D(t,["id"]);r!=null&&M(e,["id"],r);let i=D(t,["name"]);if(i!=null&&M(e,["name"],i),D(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function oci(t){let e={},n=D(t,["allowedFunctionNames"]);n!=null&&M(e,["allowedFunctionNames"],n);let r=D(t,["mode"]);if(r!=null&&M(e,["mode"],r),D(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function aci(t,e){let n={},r=D(e,["name"]);return r!=null&&M(n,["_url","name"],Ov(t,r)),n}function cci(t,e){let n={},r=D(e,["name"]);return r!=null&&M(n,["_url","name"],Ov(t,r)),n}function lci(t){let e={},n=D(t,["authConfig"]);n!=null&&M(e,["authConfig"],Vai(n));let r=D(t,["enableWidget"]);if(r!=null&&M(e,["enableWidget"],r),D(t,["groundingTypes"])!==void 0)throw new Error("groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function uci(t){let e={};if(D(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["searchTypes"]);n!=null&&M(e,["searchTypes"],n);let r=D(t,["timeRangeFilter"]);return r!=null&&M(e,["timeRangeFilter"],r),e}function dci(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&M(e,["_query","pageSize"],r);let i=D(t,["pageToken"]);return e!==void 0&&i!=null&&M(e,["_query","pageToken"],i),n}function pci(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&M(e,["_query","pageSize"],r);let i=D(t,["pageToken"]);return e!==void 0&&i!=null&&M(e,["_query","pageToken"],i),n}function mci(t){let e={},n=D(t,["config"]);return n!=null&&dci(n,e),e}function hci(t){let e={},n=D(t,["config"]);return n!=null&&pci(n,e),e}function fci(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&M(e,["nextPageToken"],r);let i=D(t,["cachedContents"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>o)),M(e,["cachedContents"],s)}return e}function gci(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&M(e,["nextPageToken"],r);let i=D(t,["cachedContents"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>o)),M(e,["cachedContents"],s)}return e}function Aci(t){let e={};if(D(t,["name"])!==void 0)throw new Error("name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["streamableHttpTransport"])!==void 0)throw new Error("streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function yci(t){let e={},n=D(t,["mediaResolution"]);n!=null&&M(e,["mediaResolution"],n);let r=D(t,["toolCall"]);r!=null&&M(e,["toolCall"],r);let i=D(t,["toolResponse"]);i!=null&&M(e,["toolResponse"],i);let s=D(t,["audioTranscription"]);s!=null&&M(e,["audioTranscription"],s);let o=D(t,["codeExecutionResult"]);o!=null&&M(e,["codeExecutionResult"],o);let a=D(t,["executableCode"]);a!=null&&M(e,["executableCode"],a);let c=D(t,["fileData"]);c!=null&&M(e,["fileData"],ici(c));let u=D(t,["functionCall"]);u!=null&&M(e,["functionCall"],sci(u));let l=D(t,["functionResponse"]);l!=null&&M(e,["functionResponse"],l);let d=D(t,["inlineData"]);d!=null&&M(e,["inlineData"],Yai(d));let m=D(t,["text"]);m!=null&&M(e,["text"],m);let h=D(t,["thought"]);h!=null&&M(e,["thought"],h);let f=D(t,["thoughtSignature"]);f!=null&&M(e,["thoughtSignature"],f);let g=D(t,["videoMetadata"]);g!=null&&M(e,["videoMetadata"],g);let A=D(t,["partMetadata"]);A!=null&&M(e,["partMetadata"],A);let y=D(t,["mediaProcessing"]);return y!=null&&M(e,["mediaProcessing"],y),e}function Eci(t){let e={},n=D(t,["mediaResolution"]);if(n!=null&&M(e,["mediaResolution"],n),D(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let r=D(t,["audioTranscription"]);r!=null&&M(e,["audioTranscription"],r);let i=D(t,["codeExecutionResult"]);i!=null&&M(e,["codeExecutionResult"],i);let s=D(t,["executableCode"]);s!=null&&M(e,["executableCode"],s);let o=D(t,["fileData"]);o!=null&&M(e,["fileData"],o);let a=D(t,["functionCall"]);a!=null&&M(e,["functionCall"],a);let c=D(t,["functionResponse"]);c!=null&&M(e,["functionResponse"],c);let u=D(t,["inlineData"]);u!=null&&M(e,["inlineData"],u);let l=D(t,["text"]);l!=null&&M(e,["text"],l);let d=D(t,["thought"]);d!=null&&M(e,["thought"],d);let m=D(t,["thoughtSignature"]);m!=null&&M(e,["thoughtSignature"],m);let h=D(t,["videoMetadata"]);if(h!=null&&M(e,["videoMetadata"],h),D(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let f=D(t,["mediaProcessing"]);return f!=null&&M(e,["mediaProcessing"],f),e}function bci(t){let e={},n=D(t,["functionCallingConfig"]);n!=null&&M(e,["functionCallingConfig"],oci(n));let r=D(t,["retrievalConfig"]);r!=null&&M(e,["retrievalConfig"],r);let i=D(t,["includeServerSideToolInvocations"]);return i!=null&&M(e,["includeServerSideToolInvocations"],i),e}function _ci(t){let e={},n=D(t,["functionCallingConfig"]);n!=null&&M(e,["functionCallingConfig"],n);let r=D(t,["retrievalConfig"]);if(r!=null&&M(e,["retrievalConfig"],r),D(t,["includeServerSideToolInvocations"])!==void 0)throw new Error("includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function xci(t){let e={};if(D(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["googleMaps"]);n!=null&&M(e,["googleMaps"],lci(n));let r=D(t,["mcpServers"]);if(r!=null){let d=r;Array.isArray(d)&&(d=d.map(m=>m)),M(e,["mcpServers"],d)}let i=D(t,["codeExecution"]);i!=null&&M(e,["codeExecution"],i);let s=D(t,["computerUse"]);if(s!=null&&M(e,["computerUse"],s),D(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["exaAiSearch"])!==void 0)throw new Error("exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=D(t,["functionDeclarations"]);if(o!=null){let d=o;Array.isArray(d)&&(d=d.map(m=>m)),M(e,["functionDeclarations"],d)}let a=D(t,["googleSearch"]);a!=null&&M(e,["googleSearch"],uci(a));let c=D(t,["googleSearchRetrieval"]);if(c!=null&&M(e,["googleSearchRetrieval"],c),D(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=D(t,["urlContext"]);u!=null&&M(e,["urlContext"],u);let l=D(t,["fileSearch"]);return l!=null&&M(e,["fileSearch"],l),e}function Sci(t){let e={},n=D(t,["retrieval"]);n!=null&&M(e,["retrieval"],n);let r=D(t,["googleMaps"]);r!=null&&M(e,["googleMaps"],r);let i=D(t,["mcpServers"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(g=>Aci(g))),M(e,["mcpServers"],f)}let s=D(t,["codeExecution"]);s!=null&&M(e,["codeExecution"],s);let o=D(t,["computerUse"]);o!=null&&M(e,["computerUse"],zai(o));let a=D(t,["enterpriseWebSearch"]);a!=null&&M(e,["enterpriseWebSearch"],a);let c=D(t,["exaAiSearch"]);c!=null&&M(e,["exaAiSearch"],c);let u=D(t,["functionDeclarations"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(g=>g)),M(e,["functionDeclarations"],f)}let l=D(t,["googleSearch"]);l!=null&&M(e,["googleSearch"],l);let d=D(t,["googleSearchRetrieval"]);d!=null&&M(e,["googleSearchRetrieval"],d);let m=D(t,["parallelAiSearch"]);m!=null&&M(e,["parallelAiSearch"],m);let h=D(t,["urlContext"]);if(h!=null&&M(e,["urlContext"],h),D(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function Cci(t,e){let n={},r=D(t,["ttl"]);e!==void 0&&r!=null&&M(e,["ttl"],r);let i=D(t,["expireTime"]);return e!==void 0&&i!=null&&M(e,["expireTime"],i),n}function Ici(t,e){let n={},r=D(t,["ttl"]);e!==void 0&&r!=null&&M(e,["ttl"],r);let i=D(t,["expireTime"]);return e!==void 0&&i!=null&&M(e,["expireTime"],i),n}function wci(t,e){let n={},r=D(e,["name"]);r!=null&&M(n,["_url","name"],Ov(t,r));let i=D(e,["config"]);return i!=null&&Cci(i,n),n}function Tci(t,e){let n={},r=D(e,["name"]);r!=null&&M(n,["_url","name"],Ov(t,r));let i=D(e,["config"]);return i!=null&&Ici(i,n),n}function Oh(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Zc(t){return this instanceof Zc?(this.v=t,this):new Zc(t)}function V3(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(h){return function(f){return Promise.resolve(f).then(h,d)}}function a(h,f){r[h]&&(i[h]=function(g){return new Promise(function(A,y){s.push([h,g,A,y])>1||c(h,g)})},f&&(i[h]=f(i[h])))}function c(h,f){try{u(r[h](f))}catch(g){m(s[0][3],g)}}function u(h){h.value instanceof Zc?Promise.resolve(h.value.v).then(l,d):m(s[0][2],h)}function l(h){c("next",h)}function d(h){c("throw",h)}function m(h,f){h(f),s.shift(),s.length&&c(s[0][0],s[0][1])}}function EZ(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof znn=="function"?znn(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function vci(t){var e;if(t.candidates==null||t.candidates.length===0)return!1;let n=(e=t.candidates[0])===null||e===void 0?void 0:e.content;return n===void 0?!1:Wrn(n)}function Wrn(t){if(t.parts===void 0||t.parts.length===0)return!1;for(let e of t.parts)if(e===void 0||Object.keys(e).length===0)return!1;return!0}function Rci(t){if(t.length!==0){for(let e of t)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}}function Knn(t){if(t===void 0||t.length===0)return[];let e=[],n=t.length,r=0;for(;ro)),M(e,["files"],s)}return e}function Qci(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["files"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),M(e,["files"],i)}return e}function Gci(t){let e={},n=D(t,["apiKey"]);if(n!=null&&M(e,["apiKey"],n),D(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["authType"])!==void 0)throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function Pbe(t){let e={},n=D(t,["data"]);if(n!=null&&M(e,["data"],n),D(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["mimeType"]);return r!=null&&M(e,["mimeType"],r),e}function $ci(t){let e={},n=D(t,["enablePromptInjectionDetection"]);n!=null&&M(e,["enablePromptInjectionDetection"],n);let r=D(t,["environment"]);r!=null&&M(e,["environment"],r);let i=D(t,["excludedPredefinedFunctions"]);if(i!=null&&M(e,["excludedPredefinedFunctions"],i),D(t,["disabledSafetyPolicies"])!==void 0)throw new Error("disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function Wci(t){let e={},n=D(t,["parts"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>ali(s))),M(e,["parts"],i)}let r=D(t,["role"]);return r!=null&&M(e,["role"],r),e}function Hci(t){let e={},n=D(t,["parts"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>cli(s))),M(e,["parts"],i)}let r=D(t,["role"]);return r!=null&&M(e,["role"],r),e}function qci(t){let e={};if(D(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["fileUri"]);n!=null&&M(e,["fileUri"],n);let r=D(t,["mimeType"]);return r!=null&&M(e,["mimeType"],r),e}function jci(t){let e={},n=D(t,["args"]);n!=null&&M(e,["args"],n);let r=D(t,["id"]);r!=null&&M(e,["id"],r);let i=D(t,["name"]);if(i!=null&&M(e,["name"],i),D(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function Vci(t){let e={},n=D(t,["modelSelectionConfig"]);n!=null&&M(e,["modelConfig"],n);let r=D(t,["responseJsonSchema"]);r!=null&&M(e,["responseJsonSchema"],r);let i=D(t,["audioTranscriptionConfig"]);i!=null&&M(e,["audioTranscriptionConfig"],i);let s=D(t,["audioTimestamp"]);s!=null&&M(e,["audioTimestamp"],s);let o=D(t,["candidateCount"]);o!=null&&M(e,["candidateCount"],o);let a=D(t,["enableAffectiveDialog"]);a!=null&&M(e,["enableAffectiveDialog"],a);let c=D(t,["frequencyPenalty"]);c!=null&&M(e,["frequencyPenalty"],c);let u=D(t,["logprobs"]);u!=null&&M(e,["logprobs"],u);let l=D(t,["maxOutputTokens"]);l!=null&&M(e,["maxOutputTokens"],l);let d=D(t,["mediaResolution"]);d!=null&&M(e,["mediaResolution"],d);let m=D(t,["presencePenalty"]);m!=null&&M(e,["presencePenalty"],m);let h=D(t,["responseFormat"]);if(h!=null){let O=h;Array.isArray(O)&&(O=O.map(W=>W)),M(e,["responseFormat"],O)}let f=D(t,["responseLogprobs"]);f!=null&&M(e,["responseLogprobs"],f);let g=D(t,["responseMimeType"]);g!=null&&M(e,["responseMimeType"],g);let A=D(t,["responseModalities"]);A!=null&&M(e,["responseModalities"],A);let y=D(t,["responseSchema"]);y!=null&&M(e,["responseSchema"],y);let E=D(t,["routingConfig"]);E!=null&&M(e,["routingConfig"],E);let _=D(t,["seed"]);_!=null&&M(e,["seed"],_);let S=D(t,["speechConfig"]);S!=null&&M(e,["speechConfig"],Hrn(S));let C=D(t,["stopSequences"]);C!=null&&M(e,["stopSequences"],C);let I=D(t,["temperature"]);I!=null&&M(e,["temperature"],I);let w=D(t,["thinkingConfig"]);w!=null&&M(e,["thinkingConfig"],w);let k=D(t,["topK"]);k!=null&&M(e,["topK"],k);let N=D(t,["topP"]);if(N!=null&&M(e,["topP"],N),D(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["translationConfig"])!==void 0)throw new Error("translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function Yci(t){let e={},n=D(t,["authConfig"]);n!=null&&M(e,["authConfig"],Gci(n));let r=D(t,["enableWidget"]);if(r!=null&&M(e,["enableWidget"],r),D(t,["groundingTypes"])!==void 0)throw new Error("groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function zci(t){let e={};if(D(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["searchTypes"]);n!=null&&M(e,["searchTypes"],n);let r=D(t,["timeRangeFilter"]);return r!=null&&M(e,["timeRangeFilter"],r),e}function Kci(t,e){let n={},r=D(t,["generationConfig"]);e!==void 0&&r!=null&&M(e,["setup","generationConfig"],r);let i=D(t,["responseModalities"]);e!==void 0&&i!=null&&M(e,["setup","generationConfig","responseModalities"],i);let s=D(t,["temperature"]);e!==void 0&&s!=null&&M(e,["setup","generationConfig","temperature"],s);let o=D(t,["topP"]);e!==void 0&&o!=null&&M(e,["setup","generationConfig","topP"],o);let a=D(t,["topK"]);e!==void 0&&a!=null&&M(e,["setup","generationConfig","topK"],a);let c=D(t,["maxOutputTokens"]);e!==void 0&&c!=null&&M(e,["setup","generationConfig","maxOutputTokens"],c);let u=D(t,["mediaResolution"]);e!==void 0&&u!=null&&M(e,["setup","generationConfig","mediaResolution"],u);let l=D(t,["seed"]);e!==void 0&&l!=null&&M(e,["setup","generationConfig","seed"],l);let d=D(t,["speechConfig"]);e!==void 0&&d!=null&&M(e,["setup","generationConfig","speechConfig"],QKe(d));let m=D(t,["thinkingConfig"]);e!==void 0&&m!=null&&M(e,["setup","generationConfig","thinkingConfig"],m);let h=D(t,["enableAffectiveDialog"]);e!==void 0&&h!=null&&M(e,["setup","generationConfig","enableAffectiveDialog"],h);let f=D(t,["systemInstruction"]);e!==void 0&&f!=null&&M(e,["setup","systemInstruction"],Wci(zp(f)));let g=D(t,["tools"]);if(e!==void 0&&g!=null){let N=X3(g);Array.isArray(N)&&(N=N.map(O=>mli(J3(O)))),M(e,["setup","tools"],N)}let A=D(t,["sessionResumption"]);e!==void 0&&A!=null&&M(e,["setup","sessionResumption"],dli(A));let y=D(t,["inputAudioTranscription"]);e!==void 0&&y!=null&&M(e,["setup","inputAudioTranscription"],y);let E=D(t,["outputAudioTranscription"]);e!==void 0&&E!=null&&M(e,["setup","outputAudioTranscription"],E);let _=D(t,["realtimeInputConfig"]);e!==void 0&&_!=null&&M(e,["setup","realtimeInputConfig"],_);let S=D(t,["contextWindowCompression"]);e!==void 0&&S!=null&&M(e,["setup","contextWindowCompression"],S);let C=D(t,["proactivity"]);if(e!==void 0&&C!=null&&M(e,["setup","proactivity"],C),D(t,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let I=D(t,["avatarConfig"]);e!==void 0&&I!=null&&M(e,["setup","avatarConfig"],I);let w=D(t,["safetySettings"]);if(e!==void 0&&w!=null){let N=w;Array.isArray(N)&&(N=N.map(O=>uli(O))),M(e,["setup","safetySettings"],N)}let k=D(t,["translationConfig"]);return e!==void 0&&k!=null&&M(e,["setup","generationConfig","translationConfig"],k),n}function Jci(t,e){let n={},r=D(t,["generationConfig"]);e!==void 0&&r!=null&&M(e,["setup","generationConfig"],Vci(r));let i=D(t,["responseModalities"]);e!==void 0&&i!=null&&M(e,["setup","generationConfig","responseModalities"],i);let s=D(t,["temperature"]);e!==void 0&&s!=null&&M(e,["setup","generationConfig","temperature"],s);let o=D(t,["topP"]);e!==void 0&&o!=null&&M(e,["setup","generationConfig","topP"],o);let a=D(t,["topK"]);e!==void 0&&a!=null&&M(e,["setup","generationConfig","topK"],a);let c=D(t,["maxOutputTokens"]);e!==void 0&&c!=null&&M(e,["setup","generationConfig","maxOutputTokens"],c);let u=D(t,["mediaResolution"]);e!==void 0&&u!=null&&M(e,["setup","generationConfig","mediaResolution"],u);let l=D(t,["seed"]);e!==void 0&&l!=null&&M(e,["setup","generationConfig","seed"],l);let d=D(t,["speechConfig"]);e!==void 0&&d!=null&&M(e,["setup","generationConfig","speechConfig"],Hrn(QKe(d)));let m=D(t,["thinkingConfig"]);e!==void 0&&m!=null&&M(e,["setup","generationConfig","thinkingConfig"],m);let h=D(t,["enableAffectiveDialog"]);e!==void 0&&h!=null&&M(e,["setup","generationConfig","enableAffectiveDialog"],h);let f=D(t,["systemInstruction"]);e!==void 0&&f!=null&&M(e,["setup","systemInstruction"],Hci(zp(f)));let g=D(t,["tools"]);if(e!==void 0&&g!=null){let O=X3(g);Array.isArray(O)&&(O=O.map(W=>hli(J3(W)))),M(e,["setup","tools"],O)}let A=D(t,["sessionResumption"]);e!==void 0&&A!=null&&M(e,["setup","sessionResumption"],A);let y=D(t,["inputAudioTranscription"]);e!==void 0&&y!=null&&M(e,["setup","inputAudioTranscription"],y);let E=D(t,["outputAudioTranscription"]);e!==void 0&&E!=null&&M(e,["setup","outputAudioTranscription"],E);let _=D(t,["realtimeInputConfig"]);e!==void 0&&_!=null&&M(e,["setup","realtimeInputConfig"],_);let S=D(t,["contextWindowCompression"]);e!==void 0&&S!=null&&M(e,["setup","contextWindowCompression"],S);let C=D(t,["proactivity"]);e!==void 0&&C!=null&&M(e,["setup","proactivity"],C);let I=D(t,["explicitVadSignal"]);e!==void 0&&I!=null&&M(e,["setup","explicitVadSignal"],I);let w=D(t,["avatarConfig"]);e!==void 0&&w!=null&&M(e,["setup","avatarConfig"],w);let k=D(t,["safetySettings"]);if(e!==void 0&&k!=null){let O=k;Array.isArray(O)&&(O=O.map(W=>W)),M(e,["setup","safetySettings"],O)}let N=D(t,["translationConfig"]);return e!==void 0&&N!=null&&M(e,["setup","generationConfig","translationConfig"],N),n}function Xci(t,e){let n={},r=D(e,["model"]);r!=null&&M(n,["setup","model"],ea(t,r));let i=D(e,["config"]);return i!=null&&M(n,["config"],Kci(i,n)),n}function Zci(t,e){let n={},r=D(e,["model"]);r!=null&&M(n,["setup","model"],ea(t,r));let i=D(e,["config"]);return i!=null&&M(n,["config"],Jci(i,n)),n}function eli(t){let e={},n=D(t,["musicGenerationConfig"]);return n!=null&&M(e,["musicGenerationConfig"],n),e}function tli(t){let e={},n=D(t,["weightedPrompts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>i)),M(e,["weightedPrompts"],r)}return e}function nli(t){let e={},n=D(t,["media"]);if(n!=null){let u=krn(n);Array.isArray(u)&&(u=u.map(l=>Pbe(l))),M(e,["mediaChunks"],u)}let r=D(t,["audio"]);r!=null&&M(e,["audio"],Pbe(Nrn(r)));let i=D(t,["audioStreamEnd"]);i!=null&&M(e,["audioStreamEnd"],i);let s=D(t,["video"]);s!=null&&M(e,["video"],Pbe(Brn(s)));let o=D(t,["text"]);o!=null&&M(e,["text"],o);let a=D(t,["activityStart"]);a!=null&&M(e,["activityStart"],a);let c=D(t,["activityEnd"]);return c!=null&&M(e,["activityEnd"],c),e}function rli(t){let e={},n=D(t,["media"]);if(n!=null){let u=krn(n);Array.isArray(u)&&(u=u.map(l=>l)),M(e,["mediaChunks"],u)}let r=D(t,["audio"]);r!=null&&M(e,["audio"],Nrn(r));let i=D(t,["audioStreamEnd"]);i!=null&&M(e,["audioStreamEnd"],i);let s=D(t,["video"]);s!=null&&M(e,["video"],Brn(s));let o=D(t,["text"]);o!=null&&M(e,["text"],o);let a=D(t,["activityStart"]);a!=null&&M(e,["activityStart"],a);let c=D(t,["activityEnd"]);return c!=null&&M(e,["activityEnd"],c),e}function ili(t){let e={},n=D(t,["setupComplete"]);n!=null&&M(e,["setupComplete"],n);let r=D(t,["serverContent"]);r!=null&&M(e,["serverContent"],r);let i=D(t,["toolCall"]);i!=null&&M(e,["toolCall"],i);let s=D(t,["toolCallCancellation"]);s!=null&&M(e,["toolCallCancellation"],s);let o=D(t,["usageMetadata"]);o!=null&&M(e,["usageMetadata"],fli(o));let a=D(t,["goAway"]);a!=null&&M(e,["goAway"],a);let c=D(t,["sessionResumptionUpdate"]);c!=null&&M(e,["sessionResumptionUpdate"],c);let u=D(t,["voiceActivityDetectionSignal"]);u!=null&&M(e,["voiceActivityDetectionSignal"],u);let l=D(t,["voiceActivity"]);return l!=null&&M(e,["voiceActivity"],gli(l)),e}function sli(t){let e={};if(D(t,["name"])!==void 0)throw new Error("name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["streamableHttpTransport"])!==void 0)throw new Error("streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function oli(t){let e={},n=D(t,["speakerVoiceConfigs"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>pli(i))),M(e,["speakerVoiceConfigs"],r)}return e}function ali(t){let e={},n=D(t,["mediaResolution"]);n!=null&&M(e,["mediaResolution"],n);let r=D(t,["toolCall"]);r!=null&&M(e,["toolCall"],r);let i=D(t,["toolResponse"]);i!=null&&M(e,["toolResponse"],i);let s=D(t,["audioTranscription"]);s!=null&&M(e,["audioTranscription"],s);let o=D(t,["codeExecutionResult"]);o!=null&&M(e,["codeExecutionResult"],o);let a=D(t,["executableCode"]);a!=null&&M(e,["executableCode"],a);let c=D(t,["fileData"]);c!=null&&M(e,["fileData"],qci(c));let u=D(t,["functionCall"]);u!=null&&M(e,["functionCall"],jci(u));let l=D(t,["functionResponse"]);l!=null&&M(e,["functionResponse"],l);let d=D(t,["inlineData"]);d!=null&&M(e,["inlineData"],Pbe(d));let m=D(t,["text"]);m!=null&&M(e,["text"],m);let h=D(t,["thought"]);h!=null&&M(e,["thought"],h);let f=D(t,["thoughtSignature"]);f!=null&&M(e,["thoughtSignature"],f);let g=D(t,["videoMetadata"]);g!=null&&M(e,["videoMetadata"],g);let A=D(t,["partMetadata"]);A!=null&&M(e,["partMetadata"],A);let y=D(t,["mediaProcessing"]);return y!=null&&M(e,["mediaProcessing"],y),e}function cli(t){let e={},n=D(t,["mediaResolution"]);if(n!=null&&M(e,["mediaResolution"],n),D(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let r=D(t,["audioTranscription"]);r!=null&&M(e,["audioTranscription"],r);let i=D(t,["codeExecutionResult"]);i!=null&&M(e,["codeExecutionResult"],i);let s=D(t,["executableCode"]);s!=null&&M(e,["executableCode"],s);let o=D(t,["fileData"]);o!=null&&M(e,["fileData"],o);let a=D(t,["functionCall"]);a!=null&&M(e,["functionCall"],a);let c=D(t,["functionResponse"]);c!=null&&M(e,["functionResponse"],c);let u=D(t,["inlineData"]);u!=null&&M(e,["inlineData"],u);let l=D(t,["text"]);l!=null&&M(e,["text"],l);let d=D(t,["thought"]);d!=null&&M(e,["thought"],d);let m=D(t,["thoughtSignature"]);m!=null&&M(e,["thoughtSignature"],m);let h=D(t,["videoMetadata"]);if(h!=null&&M(e,["videoMetadata"],h),D(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let f=D(t,["mediaProcessing"]);return f!=null&&M(e,["mediaProcessing"],f),e}function lli(t){let e={},n=D(t,["mimeType"]);n!=null&&M(e,["mimeType"],n);let r=D(t,["voiceSampleAudio"]);if(r!=null&&M(e,["voiceSampleAudio"],r),D(t,["consentAudio"])!==void 0)throw new Error("consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["voiceConsentSignature"])!==void 0)throw new Error("voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function uli(t){let e={},n=D(t,["category"]);if(n!=null&&M(e,["category"],n),D(t,["method"])!==void 0)throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["threshold"]);return r!=null&&M(e,["threshold"],r),e}function dli(t){let e={},n=D(t,["handle"]);if(n!=null&&M(e,["handle"],n),D(t,["transparent"])!==void 0)throw new Error("transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function pli(t){let e={},n=D(t,["speaker"]);n!=null&&M(e,["speaker"],n);let r=D(t,["voiceConfig"]);return r!=null&&M(e,["voiceConfig"],qrn(r)),e}function Hrn(t){let e={},n=D(t,["voiceConfig"]);n!=null&&M(e,["voiceConfig"],qrn(n));let r=D(t,["languageCode"]);r!=null&&M(e,["languageCode"],r);let i=D(t,["multiSpeakerVoiceConfig"]);return i!=null&&M(e,["multiSpeakerVoiceConfig"],oli(i)),e}function mli(t){let e={};if(D(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["googleMaps"]);n!=null&&M(e,["googleMaps"],Yci(n));let r=D(t,["mcpServers"]);if(r!=null){let d=r;Array.isArray(d)&&(d=d.map(m=>m)),M(e,["mcpServers"],d)}let i=D(t,["codeExecution"]);i!=null&&M(e,["codeExecution"],i);let s=D(t,["computerUse"]);if(s!=null&&M(e,["computerUse"],s),D(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["exaAiSearch"])!==void 0)throw new Error("exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=D(t,["functionDeclarations"]);if(o!=null){let d=o;Array.isArray(d)&&(d=d.map(m=>m)),M(e,["functionDeclarations"],d)}let a=D(t,["googleSearch"]);a!=null&&M(e,["googleSearch"],zci(a));let c=D(t,["googleSearchRetrieval"]);if(c!=null&&M(e,["googleSearchRetrieval"],c),D(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=D(t,["urlContext"]);u!=null&&M(e,["urlContext"],u);let l=D(t,["fileSearch"]);return l!=null&&M(e,["fileSearch"],l),e}function hli(t){let e={},n=D(t,["retrieval"]);n!=null&&M(e,["retrieval"],n);let r=D(t,["googleMaps"]);r!=null&&M(e,["googleMaps"],r);let i=D(t,["mcpServers"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(g=>sli(g))),M(e,["mcpServers"],f)}let s=D(t,["codeExecution"]);s!=null&&M(e,["codeExecution"],s);let o=D(t,["computerUse"]);o!=null&&M(e,["computerUse"],$ci(o));let a=D(t,["enterpriseWebSearch"]);a!=null&&M(e,["enterpriseWebSearch"],a);let c=D(t,["exaAiSearch"]);c!=null&&M(e,["exaAiSearch"],c);let u=D(t,["functionDeclarations"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(g=>g)),M(e,["functionDeclarations"],f)}let l=D(t,["googleSearch"]);l!=null&&M(e,["googleSearch"],l);let d=D(t,["googleSearchRetrieval"]);d!=null&&M(e,["googleSearchRetrieval"],d);let m=D(t,["parallelAiSearch"]);m!=null&&M(e,["parallelAiSearch"],m);let h=D(t,["urlContext"]);if(h!=null&&M(e,["urlContext"],h),D(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}function fli(t){let e={},n=D(t,["candidatesTokenCount"]);n!=null&&M(e,["responseTokenCount"],n);let r=D(t,["candidatesTokensDetails"]);if(r!=null){let h=r;Array.isArray(h)&&(h=h.map(f=>f)),M(e,["responseTokensDetails"],h)}let i=D(t,["cacheTokensDetails"]);if(i!=null){let h=i;Array.isArray(h)&&(h=h.map(f=>f)),M(e,["cacheTokensDetails"],h)}let s=D(t,["cachedContentTokenCount"]);s!=null&&M(e,["cachedContentTokenCount"],s);let o=D(t,["promptTokenCount"]);o!=null&&M(e,["promptTokenCount"],o);let a=D(t,["promptTokensDetails"]);if(a!=null){let h=a;Array.isArray(h)&&(h=h.map(f=>f)),M(e,["promptTokensDetails"],h)}let c=D(t,["thoughtsTokenCount"]);c!=null&&M(e,["thoughtsTokenCount"],c);let u=D(t,["toolUsePromptTokenCount"]);u!=null&&M(e,["toolUsePromptTokenCount"],u);let l=D(t,["toolUsePromptTokensDetails"]);if(l!=null){let h=l;Array.isArray(h)&&(h=h.map(f=>f)),M(e,["toolUsePromptTokensDetails"],h)}let d=D(t,["totalTokenCount"]);d!=null&&M(e,["totalTokenCount"],d);let m=D(t,["trafficType"]);return m!=null&&M(e,["trafficType"],m),e}function gli(t){let e={},n=D(t,["type"]);n!=null&&M(e,["voiceActivityType"],n);let r=D(t,["audioOffset"]);return r!=null&&M(e,["audioOffset"],r),e}function qrn(t){let e={},n=D(t,["replicatedVoiceConfig"]);n!=null&&M(e,["replicatedVoiceConfig"],lli(n));let r=D(t,["prebuiltVoiceConfig"]);return r!=null&&M(e,["prebuiltVoiceConfig"],r),e}function Ali(t,e){let n={},r=D(t,["apiKey"]);if(r!=null&&M(n,["apiKey"],r),D(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["authType"])!==void 0)throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}function yli(t,e){let n={},r=D(t,["data"]);if(r!=null&&M(n,["data"],r),D(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let i=D(t,["mimeType"]);return i!=null&&M(n,["mimeType"],i),n}function Eli(t,e){let n={},r=D(t,["content"]);r!=null&&M(n,["content"],r);let i=D(t,["citationMetadata"]);i!=null&&M(n,["citationMetadata"],bli(i));let s=D(t,["tokenCount"]);s!=null&&M(n,["tokenCount"],s);let o=D(t,["finishReason"]);o!=null&&M(n,["finishReason"],o);let a=D(t,["groundingMetadata"]);a!=null&&M(n,["groundingMetadata"],a);let c=D(t,["avgLogprobs"]);c!=null&&M(n,["avgLogprobs"],c);let u=D(t,["index"]);u!=null&&M(n,["index"],u);let l=D(t,["logprobsResult"]);l!=null&&M(n,["logprobsResult"],l);let d=D(t,["safetyRatings"]);if(d!=null){let h=d;Array.isArray(h)&&(h=h.map(f=>f)),M(n,["safetyRatings"],h)}let m=D(t,["urlContextMetadata"]);return m!=null&&M(n,["urlContextMetadata"],m),n}function bli(t,e){let n={},r=D(t,["citationSources"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),M(n,["citations"],i)}return n}function _li(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["contents"]);if(s!=null){let o=dA(s);Array.isArray(o)&&(o=o.map(a=>e4(a))),M(r,["contents"],o)}return r}function xli(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["tokensInfo"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>o)),M(n,["tokensInfo"],s)}return n}function Sli(t,e){let n={},r=D(t,["enablePromptInjectionDetection"]);r!=null&&M(n,["enablePromptInjectionDetection"],r);let i=D(t,["environment"]);i!=null&&M(n,["environment"],i);let s=D(t,["excludedPredefinedFunctions"]);if(s!=null&&M(n,["excludedPredefinedFunctions"],s),D(t,["disabledSafetyPolicies"])!==void 0)throw new Error("disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}function Cli(t,e){let n={},r=D(t,["values"]);r!=null&&M(n,["values"],r);let i=D(t,["statistics"]);return i!=null&&M(n,["statistics"],Ili(i)),n}function Ili(t,e){let n={},r=D(t,["truncated"]);r!=null&&M(n,["truncated"],r);let i=D(t,["token_count"]);i!=null&&M(n,["tokenCount"],i);let s=D(t,["tokensDetails"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>a)),M(n,["tokensDetails"],o)}return n}function SZ(t,e){let n={},r=D(t,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>kui(o))),M(n,["parts"],s)}let i=D(t,["role"]);return i!=null&&M(n,["role"],i),n}function e4(t,e){let n={},r=D(t,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>Bui(o))),M(n,["parts"],s)}let i=D(t,["role"]);return i!=null&&M(n,["role"],i),n}function wli(t,e){let n={},r=D(t,["controlType"]);r!=null&&M(n,["controlType"],r);let i=D(t,["enableControlImageComputation"]);return i!=null&&M(n,["computeControl"],i),n}function Tli(t,e){let n={};if(D(t,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["tools"])!==void 0)throw new Error("tools parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}function vli(t,e,n){let r={},i=D(t,["systemInstruction"]);e!==void 0&&i!=null&&M(e,["systemInstruction"],e4(zp(i)));let s=D(t,["tools"]);if(e!==void 0&&s!=null){let a=s;Array.isArray(a)&&(a=a.map(c=>zrn(c))),M(e,["tools"],a)}let o=D(t,["generationConfig"]);return e!==void 0&&o!=null&&M(e,["generationConfig"],hui(o)),r}function Rli(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["contents"]);if(s!=null){let a=dA(s);Array.isArray(a)&&(a=a.map(c=>SZ(c))),M(r,["contents"],a)}let o=D(e,["config"]);return o!=null&&Tli(o),r}function kli(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["contents"]);if(s!=null){let a=dA(s);Array.isArray(a)&&(a=a.map(c=>e4(c))),M(r,["contents"],a)}let o=D(e,["config"]);return o!=null&&vli(o,r),r}function Bli(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["totalTokens"]);i!=null&&M(n,["totalTokens"],i);let s=D(t,["cachedContentTokenCount"]);return s!=null&&M(n,["cachedContentTokenCount"],s),n}function Nli(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["totalTokens"]);return i!=null&&M(n,["totalTokens"],i),n}function Dli(t,e,n){let r={},i=D(e,["model"]);return i!=null&&M(r,["_url","name"],ea(t,i)),r}function Pli(t,e,n){let r={},i=D(e,["model"]);return i!=null&&M(r,["_url","name"],ea(t,i)),r}function Mli(t,e){let n={},r=D(t,["sdkHttpResponse"]);return r!=null&&M(n,["sdkHttpResponse"],r),n}function Oli(t,e){let n={},r=D(t,["sdkHttpResponse"]);return r!=null&&M(n,["sdkHttpResponse"],r),n}function Lli(t,e,n){let r={},i=D(t,["outputGcsUri"]);e!==void 0&&i!=null&&M(e,["parameters","storageUri"],i);let s=D(t,["negativePrompt"]);e!==void 0&&s!=null&&M(e,["parameters","negativePrompt"],s);let o=D(t,["numberOfImages"]);e!==void 0&&o!=null&&M(e,["parameters","sampleCount"],o);let a=D(t,["aspectRatio"]);e!==void 0&&a!=null&&M(e,["parameters","aspectRatio"],a);let c=D(t,["guidanceScale"]);e!==void 0&&c!=null&&M(e,["parameters","guidanceScale"],c);let u=D(t,["seed"]);e!==void 0&&u!=null&&M(e,["parameters","seed"],u);let l=D(t,["safetyFilterLevel"]);e!==void 0&&l!=null&&M(e,["parameters","safetySetting"],l);let d=D(t,["personGeneration"]);e!==void 0&&d!=null&&M(e,["parameters","personGeneration"],d);let m=D(t,["includeSafetyAttributes"]);e!==void 0&&m!=null&&M(e,["parameters","includeSafetyAttributes"],m);let h=D(t,["includeRaiReason"]);e!==void 0&&h!=null&&M(e,["parameters","includeRaiReason"],h);let f=D(t,["language"]);e!==void 0&&f!=null&&M(e,["parameters","language"],f);let g=D(t,["outputMimeType"]);e!==void 0&&g!=null&&M(e,["parameters","outputOptions","mimeType"],g);let A=D(t,["outputCompressionQuality"]);e!==void 0&&A!=null&&M(e,["parameters","outputOptions","compressionQuality"],A);let y=D(t,["addWatermark"]);e!==void 0&&y!=null&&M(e,["parameters","addWatermark"],y);let E=D(t,["labels"]);e!==void 0&&E!=null&&M(e,["labels"],E);let _=D(t,["editMode"]);e!==void 0&&_!=null&&M(e,["parameters","editMode"],_);let S=D(t,["baseSteps"]);return e!==void 0&&S!=null&&M(e,["parameters","editConfig","baseSteps"],S),r}function Fli(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["prompt"]);s!=null&&M(r,["instances[0]","prompt"],s);let o=D(e,["referenceImages"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(u=>Lui(u))),M(r,["instances[0]","referenceImages"],c)}let a=D(e,["config"]);return a!=null&&Lli(a,r),r}function Qli(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["predictions"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>r_e(o))),M(n,["generatedImages"],s)}return n}function Uli(t,e,n){let r={},i=D(t,["taskType"]);e!==void 0&&i!=null&&M(e,["requests[]","taskType"],i);let s=D(t,["title"]);e!==void 0&&s!=null&&M(e,["requests[]","title"],s);let o=D(t,["outputDimensionality"]);if(e!==void 0&&o!=null&&M(e,["requests[]","outputDimensionality"],o),D(t,["mimeType"])!==void 0)throw new Error("mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["documentOcr"])!==void 0)throw new Error("documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["audioTrackExtraction"])!==void 0)throw new Error("audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return r}function Gli(t,e,n){let r={},i=D(n,["embeddingApiType"]);if(i===void 0&&(i="PREDICT"),i==="PREDICT"){let d=D(t,["taskType"]);e!==void 0&&d!=null&&M(e,["instances[]","task_type"],d)}else if(i==="EMBED_CONTENT"){let d=D(t,["taskType"]);e!==void 0&&d!=null&&M(e,["embedContentConfig","taskType"],d)}let s=D(n,["embeddingApiType"]);if(s===void 0&&(s="PREDICT"),s==="PREDICT"){let d=D(t,["title"]);e!==void 0&&d!=null&&M(e,["instances[]","title"],d)}else if(s==="EMBED_CONTENT"){let d=D(t,["title"]);e!==void 0&&d!=null&&M(e,["embedContentConfig","title"],d)}let o=D(n,["embeddingApiType"]);if(o===void 0&&(o="PREDICT"),o==="PREDICT"){let d=D(t,["outputDimensionality"]);e!==void 0&&d!=null&&M(e,["parameters","outputDimensionality"],d)}else if(o==="EMBED_CONTENT"){let d=D(t,["outputDimensionality"]);e!==void 0&&d!=null&&M(e,["embedContentConfig","outputDimensionality"],d)}let a=D(n,["embeddingApiType"]);if(a===void 0&&(a="PREDICT"),a==="PREDICT"){let d=D(t,["mimeType"]);e!==void 0&&d!=null&&M(e,["instances[]","mimeType"],d)}let c=D(n,["embeddingApiType"]);if(c===void 0&&(c="PREDICT"),c==="PREDICT"){let d=D(t,["autoTruncate"]);e!==void 0&&d!=null&&M(e,["parameters","autoTruncate"],d)}else if(c==="EMBED_CONTENT"){let d=D(t,["autoTruncate"]);e!==void 0&&d!=null&&M(e,["embedContentConfig","autoTruncate"],d)}let u=D(n,["embeddingApiType"]);if(u===void 0&&(u="PREDICT"),u==="EMBED_CONTENT"){let d=D(t,["documentOcr"]);e!==void 0&&d!=null&&M(e,["embedContentConfig","documentOcr"],d)}let l=D(n,["embeddingApiType"]);if(l===void 0&&(l="PREDICT"),l==="EMBED_CONTENT"){let d=D(t,["audioTrackExtraction"]);e!==void 0&&d!=null&&M(e,["embedContentConfig","audioTrackExtraction"],d)}return r}function $li(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["contents"]);if(s!=null){let u=OKe(t,s);Array.isArray(u)&&(u=u.map(l=>l)),M(r,["requests[]","content"],u)}let o=D(e,["content"]);o!=null&&SZ(zp(o));let a=D(e,["config"]);a!=null&&Uli(a,r);let c=D(e,["model"]);return c!==void 0&&M(r,["requests[]","model"],ea(t,c)),r}function Wli(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(n,["embeddingApiType"]);if(s===void 0&&(s="PREDICT"),s==="PREDICT"){let c=D(e,["contents"]);if(c!=null){let u=OKe(t,c);Array.isArray(u)&&(u=u.map(l=>l)),M(r,["instances[]","content"],u)}}let o=D(n,["embeddingApiType"]);if(o===void 0&&(o="PREDICT"),o==="EMBED_CONTENT"){let c=D(e,["content"]);c!=null&&M(r,["content"],e4(zp(c)))}let a=D(e,["config"]);return a!=null&&Gli(a,r,n),r}function Hli(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["embeddings"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(a=>a)),M(n,["embeddings"],o)}let s=D(t,["metadata"]);return s!=null&&M(n,["metadata"],s),n}function qli(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["predictions[]","embeddings"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(a=>Cli(a))),M(n,["embeddings"],o)}let s=D(t,["metadata"]);if(s!=null&&M(n,["metadata"],s),e&&D(e,["embeddingApiType"])==="EMBED_CONTENT"){let o=D(t,["embedding"]),a=D(t,["usageMetadata"]),c=D(t,["truncated"]);if(o){let u={};a&&a.promptTokenCount&&(u.tokenCount=a.promptTokenCount),a&&a.promptTokensDetails&&(u.tokensDetails=a.promptTokensDetails),c&&(u.truncated=c),o.statistics=u,M(n,["embeddings"],[o])}}return n}function jli(t,e){let n={},r=D(t,["endpoint"]);r!=null&&M(n,["name"],r);let i=D(t,["deployedModelId"]);return i!=null&&M(n,["deployedModelId"],i),n}function Vli(t,e){let n={};if(D(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["fileUri"]);r!=null&&M(n,["fileUri"],r);let i=D(t,["mimeType"]);return i!=null&&M(n,["mimeType"],i),n}function Yli(t,e){let n={},r=D(t,["args"]);r!=null&&M(n,["args"],r);let i=D(t,["id"]);i!=null&&M(n,["id"],i);let s=D(t,["name"]);if(s!=null&&M(n,["name"],s),D(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}function zli(t,e){let n={},r=D(t,["allowedFunctionNames"]);r!=null&&M(n,["allowedFunctionNames"],r);let i=D(t,["mode"]);if(i!=null&&M(n,["mode"],i),D(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}function Kli(t,e,n,r){let i={},s=D(e,["serviceTier"]);n!==void 0&&s!=null&&M(n,["serviceTier"],s);let o=D(e,["systemInstruction"]);n!==void 0&&o!=null&&M(n,["systemInstruction"],SZ(zp(o)));let a=D(e,["temperature"]);a!=null&&M(i,["temperature"],a);let c=D(e,["topP"]);c!=null&&M(i,["topP"],c);let u=D(e,["topK"]);u!=null&&M(i,["topK"],u);let l=D(e,["candidateCount"]);l!=null&&M(i,["candidateCount"],l);let d=D(e,["maxOutputTokens"]);d!=null&&M(i,["maxOutputTokens"],d);let m=D(e,["stopSequences"]);m!=null&&M(i,["stopSequences"],m);let h=D(e,["responseLogprobs"]);h!=null&&M(i,["responseLogprobs"],h);let f=D(e,["logprobs"]);f!=null&&M(i,["logprobs"],f);let g=D(e,["presencePenalty"]);g!=null&&M(i,["presencePenalty"],g);let A=D(e,["frequencyPenalty"]);A!=null&&M(i,["frequencyPenalty"],A);let y=D(e,["seed"]);y!=null&&M(i,["seed"],y);let E=D(e,["responseMimeType"]);E!=null&&M(i,["responseMimeType"],E);let _=D(e,["responseSchema"]);_!=null&&M(i,["responseSchema"],LKe(_));let S=D(e,["responseJsonSchema"]);if(S!=null&&M(i,["responseJsonSchema"],S),D(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let C=D(e,["safetySettings"]);if(n!==void 0&&C!=null){let Y=C;Array.isArray(Y)&&(Y=Y.map(z=>Qui(z))),M(n,["safetySettings"],Y)}let I=D(e,["tools"]);if(n!==void 0&&I!=null){let Y=X3(I);Array.isArray(Y)&&(Y=Y.map(z=>Yui(J3(z)))),M(n,["tools"],Y)}let w=D(e,["toolConfig"]);if(n!==void 0&&w!=null&&M(n,["toolConfig"],jui(w)),D(e,["labels"])!==void 0)throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let k=D(e,["cachedContent"]);n!==void 0&&k!=null&&M(n,["cachedContent"],Ov(t,k));let N=D(e,["responseModalities"]);N!=null&&M(i,["responseModalities"],N);let O=D(e,["mediaResolution"]);O!=null&&M(i,["mediaResolution"],O);let W=D(e,["speechConfig"]);if(W!=null&&M(i,["speechConfig"],FKe(W)),D(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let $=D(e,["thinkingConfig"]);$!=null&&M(i,["thinkingConfig"],$);let G=D(e,["audioTranscriptionConfig"]);G!=null&&M(i,["audioTranscriptionConfig"],G);let q=D(e,["imageConfig"]);q!=null&&M(i,["imageConfig"],Eui(q));let ce=D(e,["enableEnhancedCivicAnswers"]);if(ce!=null&&M(i,["enableEnhancedCivicAnswers"],ce),D(e,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return i}function Jli(t,e,n,r){let i={},s=D(e,["serviceTier"]);n!==void 0&&s!=null&&M(n,["serviceTier"],s);let o=D(e,["systemInstruction"]);n!==void 0&&o!=null&&M(n,["systemInstruction"],e4(zp(o)));let a=D(e,["temperature"]);a!=null&&M(i,["temperature"],a);let c=D(e,["topP"]);c!=null&&M(i,["topP"],c);let u=D(e,["topK"]);u!=null&&M(i,["topK"],u);let l=D(e,["candidateCount"]);l!=null&&M(i,["candidateCount"],l);let d=D(e,["maxOutputTokens"]);d!=null&&M(i,["maxOutputTokens"],d);let m=D(e,["stopSequences"]);m!=null&&M(i,["stopSequences"],m);let h=D(e,["responseLogprobs"]);h!=null&&M(i,["responseLogprobs"],h);let f=D(e,["logprobs"]);f!=null&&M(i,["logprobs"],f);let g=D(e,["presencePenalty"]);g!=null&&M(i,["presencePenalty"],g);let A=D(e,["frequencyPenalty"]);A!=null&&M(i,["frequencyPenalty"],A);let y=D(e,["seed"]);y!=null&&M(i,["seed"],y);let E=D(e,["responseMimeType"]);E!=null&&M(i,["responseMimeType"],E);let _=D(e,["responseSchema"]);_!=null&&M(i,["responseSchema"],LKe(_));let S=D(e,["responseJsonSchema"]);S!=null&&M(i,["responseJsonSchema"],S);let C=D(e,["routingConfig"]);C!=null&&M(i,["routingConfig"],C);let I=D(e,["modelSelectionConfig"]);I!=null&&M(i,["modelConfig"],I);let w=D(e,["safetySettings"]);if(n!==void 0&&w!=null){let Ae=w;Array.isArray(Ae)&&(Ae=Ae.map(De=>De)),M(n,["safetySettings"],Ae)}let k=D(e,["tools"]);if(n!==void 0&&k!=null){let Ae=X3(k);Array.isArray(Ae)&&(Ae=Ae.map(De=>zrn(J3(De)))),M(n,["tools"],Ae)}let N=D(e,["toolConfig"]);n!==void 0&&N!=null&&M(n,["toolConfig"],Vui(N));let O=D(e,["labels"]);n!==void 0&&O!=null&&M(n,["labels"],O);let W=D(e,["cachedContent"]);n!==void 0&&W!=null&&M(n,["cachedContent"],Ov(t,W));let $=D(e,["responseModalities"]);$!=null&&M(i,["responseModalities"],$);let G=D(e,["mediaResolution"]);G!=null&&M(i,["mediaResolution"],G);let q=D(e,["speechConfig"]);q!=null&&M(i,["speechConfig"],Yrn(FKe(q)));let ce=D(e,["audioTimestamp"]);ce!=null&&M(i,["audioTimestamp"],ce);let Y=D(e,["thinkingConfig"]);Y!=null&&M(i,["thinkingConfig"],Y);let z=D(e,["audioTranscriptionConfig"]);z!=null&&M(i,["audioTranscriptionConfig"],z);let j=D(e,["imageConfig"]);if(j!=null&&M(i,["imageConfig"],bui(j)),D(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let se=D(e,["modelArmorConfig"]);return n!==void 0&&se!=null&&M(n,["modelArmorConfig"],se),i}function Jnn(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["contents"]);if(s!=null){let a=dA(s);Array.isArray(a)&&(a=a.map(c=>SZ(c))),M(r,["contents"],a)}let o=D(e,["config"]);return o!=null&&M(r,["generationConfig"],Kli(t,o,r)),r}function Xnn(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["contents"]);if(s!=null){let a=dA(s);Array.isArray(a)&&(a=a.map(c=>e4(c))),M(r,["contents"],a)}let o=D(e,["config"]);return o!=null&&M(r,["generationConfig"],Jli(t,o,r)),r}function Znn(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["candidates"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(d=>Eli(d))),M(n,["candidates"],l)}let s=D(t,["modelVersion"]);s!=null&&M(n,["modelVersion"],s);let o=D(t,["promptFeedback"]);o!=null&&M(n,["promptFeedback"],o);let a=D(t,["responseId"]);a!=null&&M(n,["responseId"],a);let c=D(t,["usageMetadata"]);c!=null&&M(n,["usageMetadata"],c);let u=D(t,["modelStatus"]);return u!=null&&M(n,["modelStatus"],u),n}function ern(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["candidates"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(d=>d)),M(n,["candidates"],l)}let s=D(t,["createTime"]);s!=null&&M(n,["createTime"],s);let o=D(t,["modelVersion"]);o!=null&&M(n,["modelVersion"],o);let a=D(t,["promptFeedback"]);a!=null&&M(n,["promptFeedback"],a);let c=D(t,["responseId"]);c!=null&&M(n,["responseId"],c);let u=D(t,["usageMetadata"]);return u!=null&&M(n,["usageMetadata"],u),n}function Xli(t,e,n){let r={},i=D(t,["outputGcsUri"]);e!==void 0&&i!=null&&M(e,["parameters","storageUri"],i);let s=D(t,["negativePrompt"]);e!==void 0&&s!=null&&M(e,["parameters","negativePrompt"],s);let o=D(t,["numberOfImages"]);e!==void 0&&o!=null&&M(e,["parameters","sampleCount"],o);let a=D(t,["aspectRatio"]);e!==void 0&&a!=null&&M(e,["parameters","aspectRatio"],a);let c=D(t,["guidanceScale"]);e!==void 0&&c!=null&&M(e,["parameters","guidanceScale"],c);let u=D(t,["seed"]);e!==void 0&&u!=null&&M(e,["parameters","seed"],u);let l=D(t,["safetyFilterLevel"]);e!==void 0&&l!=null&&M(e,["parameters","safetySetting"],l);let d=D(t,["personGeneration"]);e!==void 0&&d!=null&&M(e,["parameters","personGeneration"],d);let m=D(t,["includeSafetyAttributes"]);e!==void 0&&m!=null&&M(e,["parameters","includeSafetyAttributes"],m);let h=D(t,["includeRaiReason"]);e!==void 0&&h!=null&&M(e,["parameters","includeRaiReason"],h);let f=D(t,["language"]);e!==void 0&&f!=null&&M(e,["parameters","language"],f);let g=D(t,["outputMimeType"]);e!==void 0&&g!=null&&M(e,["parameters","outputOptions","mimeType"],g);let A=D(t,["outputCompressionQuality"]);e!==void 0&&A!=null&&M(e,["parameters","outputOptions","compressionQuality"],A);let y=D(t,["addWatermark"]);e!==void 0&&y!=null&&M(e,["parameters","addWatermark"],y);let E=D(t,["labels"]);e!==void 0&&E!=null&&M(e,["labels"],E);let _=D(t,["imageSize"]);e!==void 0&&_!=null&&M(e,["parameters","sampleImageSize"],_);let S=D(t,["enhancePrompt"]);return e!==void 0&&S!=null&&M(e,["parameters","enhancePrompt"],S),r}function Zli(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["prompt"]);s!=null&&M(r,["instances[0]","prompt"],s);let o=D(e,["config"]);return o!=null&&Xli(o,r),r}function eui(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["predictions"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(a=>r_e(a))),M(n,["generatedImages"],o)}let s=D(t,["positivePromptSafetyAttributes"]);return s!=null&&M(n,["positivePromptSafetyAttributes"],Vrn(s)),n}function tui(t,e,n){let r={},i=D(t,["numberOfVideos"]);if(e!==void 0&&i!=null&&M(e,["parameters","sampleCount"],i),D(t,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["fps"])!==void 0)throw new Error("fps parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let s=D(t,["durationSeconds"]);if(e!==void 0&&s!=null&&M(e,["parameters","durationSeconds"],s),D(t,["seed"])!==void 0)throw new Error("seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=D(t,["aspectRatio"]);e!==void 0&&o!=null&&M(e,["parameters","aspectRatio"],o);let a=D(t,["resolution"]);e!==void 0&&a!=null&&M(e,["parameters","resolution"],a);let c=D(t,["personGeneration"]);if(e!==void 0&&c!=null&&M(e,["parameters","personGeneration"],c),D(t,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=D(t,["negativePrompt"]);e!==void 0&&u!=null&&M(e,["parameters","negativePrompt"],u);let l=D(t,["enhancePrompt"]);if(e!==void 0&&l!=null&&M(e,["parameters","enhancePrompt"],l),D(t,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let d=D(t,["lastFrame"]);e!==void 0&&d!=null&&M(e,["instances[0]","lastFrame"],i_e(d));let m=D(t,["referenceImages"]);if(e!==void 0&&m!=null){let f=m;Array.isArray(f)&&(f=f.map(g=>adi(g))),M(e,["instances[0]","referenceImages"],f)}if(D(t,["mask"])!==void 0)throw new Error("mask parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["labels"])!==void 0)throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let h=D(t,["webhookConfig"]);if(e!==void 0&&h!=null&&M(e,["webhookConfig"],h),D(t,["resizeMode"])!==void 0)throw new Error("resizeMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return r}function nui(t,e,n){let r={},i=D(t,["numberOfVideos"]);e!==void 0&&i!=null&&M(e,["parameters","sampleCount"],i);let s=D(t,["outputGcsUri"]);e!==void 0&&s!=null&&M(e,["parameters","storageUri"],s);let o=D(t,["fps"]);e!==void 0&&o!=null&&M(e,["parameters","fps"],o);let a=D(t,["durationSeconds"]);e!==void 0&&a!=null&&M(e,["parameters","durationSeconds"],a);let c=D(t,["seed"]);e!==void 0&&c!=null&&M(e,["parameters","seed"],c);let u=D(t,["aspectRatio"]);e!==void 0&&u!=null&&M(e,["parameters","aspectRatio"],u);let l=D(t,["resolution"]);e!==void 0&&l!=null&&M(e,["parameters","resolution"],l);let d=D(t,["personGeneration"]);e!==void 0&&d!=null&&M(e,["parameters","personGeneration"],d);let m=D(t,["pubsubTopic"]);e!==void 0&&m!=null&&M(e,["parameters","pubsubTopic"],m);let h=D(t,["negativePrompt"]);e!==void 0&&h!=null&&M(e,["parameters","negativePrompt"],h);let f=D(t,["enhancePrompt"]);e!==void 0&&f!=null&&M(e,["parameters","enhancePrompt"],f);let g=D(t,["generateAudio"]);e!==void 0&&g!=null&&M(e,["parameters","generateAudio"],g);let A=D(t,["lastFrame"]);e!==void 0&&A!=null&&M(e,["instances[0]","lastFrame"],Rx(A));let y=D(t,["referenceImages"]);if(e!==void 0&&y!=null){let I=y;Array.isArray(I)&&(I=I.map(w=>cdi(w))),M(e,["instances[0]","referenceImages"],I)}let E=D(t,["mask"]);e!==void 0&&E!=null&&M(e,["instances[0]","mask"],odi(E));let _=D(t,["compressionQuality"]);e!==void 0&&_!=null&&M(e,["parameters","compressionQuality"],_);let S=D(t,["labels"]);if(e!==void 0&&S!=null&&M(e,["labels"],S),D(t,["webhookConfig"])!==void 0)throw new Error("webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let C=D(t,["resizeMode"]);return e!==void 0&&C!=null&&M(e,["parameters","resizeMode"],C),r}function rui(t,e){let n={},r=D(t,["name"]);r!=null&&M(n,["name"],r);let i=D(t,["metadata"]);i!=null&&M(n,["metadata"],i);let s=D(t,["done"]);s!=null&&M(n,["done"],s);let o=D(t,["error"]);o!=null&&M(n,["error"],o);let a=D(t,["response","generateVideoResponse"]);return a!=null&&M(n,["response"],aui(a)),n}function iui(t,e){let n={},r=D(t,["name"]);r!=null&&M(n,["name"],r);let i=D(t,["metadata"]);i!=null&&M(n,["metadata"],i);let s=D(t,["done"]);s!=null&&M(n,["done"],s);let o=D(t,["error"]);o!=null&&M(n,["error"],o);let a=D(t,["response"]);return a!=null&&M(n,["response"],cui(a)),n}function sui(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["prompt"]);s!=null&&M(r,["instances[0]","prompt"],s);let o=D(e,["image"]);o!=null&&M(r,["instances[0]","image"],i_e(o));let a=D(e,["video"]);a!=null&&M(r,["instances[0]","video"],Krn(a));let c=D(e,["source"]);c!=null&&lui(c,r);let u=D(e,["config"]);return u!=null&&tui(u,r),r}function oui(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["prompt"]);s!=null&&M(r,["instances[0]","prompt"],s);let o=D(e,["image"]);o!=null&&M(r,["instances[0]","image"],Rx(o));let a=D(e,["video"]);a!=null&&M(r,["instances[0]","video"],Jrn(a));let c=D(e,["source"]);c!=null&&uui(c,r);let u=D(e,["config"]);return u!=null&&nui(u,r),r}function aui(t,e){let n={},r=D(t,["generatedSamples"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(a=>pui(a))),M(n,["generatedVideos"],o)}let i=D(t,["raiMediaFilteredCount"]);i!=null&&M(n,["raiMediaFilteredCount"],i);let s=D(t,["raiMediaFilteredReasons"]);return s!=null&&M(n,["raiMediaFilteredReasons"],s),n}function cui(t,e){let n={},r=D(t,["videos"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(a=>mui(a))),M(n,["generatedVideos"],o)}let i=D(t,["raiMediaFilteredCount"]);i!=null&&M(n,["raiMediaFilteredCount"],i);let s=D(t,["raiMediaFilteredReasons"]);return s!=null&&M(n,["raiMediaFilteredReasons"],s),n}function lui(t,e,n){let r={},i=D(t,["prompt"]);e!==void 0&&i!=null&&M(e,["instances[0]","prompt"],i);let s=D(t,["image"]);e!==void 0&&s!=null&&M(e,["instances[0]","image"],i_e(s));let o=D(t,["video"]);return e!==void 0&&o!=null&&M(e,["instances[0]","video"],Krn(o)),r}function uui(t,e,n){let r={},i=D(t,["prompt"]);e!==void 0&&i!=null&&M(e,["instances[0]","prompt"],i);let s=D(t,["image"]);e!==void 0&&s!=null&&M(e,["instances[0]","image"],Rx(s));let o=D(t,["video"]);return e!==void 0&&o!=null&&M(e,["instances[0]","video"],Jrn(o)),r}function r_e(t,e){let n={},r=D(t,["_self"]);r!=null&&M(n,["image"],jrn(r));let i=D(t,["raiFilteredReason"]);i!=null&&M(n,["raiFilteredReason"],i);let s=D(t,["_self"]);s!=null&&M(n,["safetyAttributes"],Vrn(s));let o=D(t,["prompt"]);return o!=null&&M(n,["enhancedPrompt"],o),n}function dui(t,e){let n={},r=D(t,["_self"]);r!=null&&M(n,["mask"],jrn(r));let i=D(t,["labels"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>o)),M(n,["labels"],s)}return n}function pui(t,e){let n={},r=D(t,["video"]);return r!=null&&M(n,["video"],idi(r)),n}function mui(t,e){let n={},r=D(t,["_self"]);return r!=null&&M(n,["video"],sdi(r)),n}function hui(t,e){let n={},r=D(t,["modelSelectionConfig"]);r!=null&&M(n,["modelConfig"],r);let i=D(t,["responseJsonSchema"]);i!=null&&M(n,["responseJsonSchema"],i);let s=D(t,["audioTranscriptionConfig"]);s!=null&&M(n,["audioTranscriptionConfig"],s);let o=D(t,["audioTimestamp"]);o!=null&&M(n,["audioTimestamp"],o);let a=D(t,["candidateCount"]);a!=null&&M(n,["candidateCount"],a);let c=D(t,["enableAffectiveDialog"]);c!=null&&M(n,["enableAffectiveDialog"],c);let u=D(t,["frequencyPenalty"]);u!=null&&M(n,["frequencyPenalty"],u);let l=D(t,["logprobs"]);l!=null&&M(n,["logprobs"],l);let d=D(t,["maxOutputTokens"]);d!=null&&M(n,["maxOutputTokens"],d);let m=D(t,["mediaResolution"]);m!=null&&M(n,["mediaResolution"],m);let h=D(t,["presencePenalty"]);h!=null&&M(n,["presencePenalty"],h);let f=D(t,["responseFormat"]);if(f!=null){let W=f;Array.isArray(W)&&(W=W.map($=>$)),M(n,["responseFormat"],W)}let g=D(t,["responseLogprobs"]);g!=null&&M(n,["responseLogprobs"],g);let A=D(t,["responseMimeType"]);A!=null&&M(n,["responseMimeType"],A);let y=D(t,["responseModalities"]);y!=null&&M(n,["responseModalities"],y);let E=D(t,["responseSchema"]);E!=null&&M(n,["responseSchema"],E);let _=D(t,["routingConfig"]);_!=null&&M(n,["routingConfig"],_);let S=D(t,["seed"]);S!=null&&M(n,["seed"],S);let C=D(t,["speechConfig"]);C!=null&&M(n,["speechConfig"],Yrn(C));let I=D(t,["stopSequences"]);I!=null&&M(n,["stopSequences"],I);let w=D(t,["temperature"]);w!=null&&M(n,["temperature"],w);let k=D(t,["thinkingConfig"]);k!=null&&M(n,["thinkingConfig"],k);let N=D(t,["topK"]);N!=null&&M(n,["topK"],N);let O=D(t,["topP"]);if(O!=null&&M(n,["topP"],O),D(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["translationConfig"])!==void 0)throw new Error("translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}function fui(t,e,n){let r={},i=D(e,["model"]);return i!=null&&M(r,["_url","name"],ea(t,i)),r}function gui(t,e,n){let r={},i=D(e,["model"]);return i!=null&&M(r,["_url","name"],ea(t,i)),r}function Aui(t,e){let n={},r=D(t,["authConfig"]);r!=null&&M(n,["authConfig"],Ali(r));let i=D(t,["enableWidget"]);if(i!=null&&M(n,["enableWidget"],i),D(t,["groundingTypes"])!==void 0)throw new Error("groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}function yui(t,e){let n={};if(D(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["searchTypes"]);r!=null&&M(n,["searchTypes"],r);let i=D(t,["timeRangeFilter"]);return i!=null&&M(n,["timeRangeFilter"],i),n}function Eui(t,e){let n={},r=D(t,["aspectRatio"]);r!=null&&M(n,["aspectRatio"],r);let i=D(t,["imageSize"]);if(i!=null&&M(n,["imageSize"],i),D(t,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["imageOutputOptions"])!==void 0)throw new Error("imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["prominentPeople"])!==void 0)throw new Error("prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}function bui(t,e){let n={},r=D(t,["aspectRatio"]);r!=null&&M(n,["aspectRatio"],r);let i=D(t,["imageSize"]);i!=null&&M(n,["imageSize"],i);let s=D(t,["personGeneration"]);s!=null&&M(n,["personGeneration"],s);let o=D(t,["outputMimeType"]);o!=null&&M(n,["imageOutputOptions","mimeType"],o);let a=D(t,["outputCompressionQuality"]);a!=null&&M(n,["imageOutputOptions","compressionQuality"],a);let c=D(t,["imageOutputOptions"]);c!=null&&M(n,["imageOutputOptions"],c);let u=D(t,["prominentPeople"]);return u!=null&&M(n,["prominentPeople"],u),n}function jrn(t,e){let n={},r=D(t,["gcsUri"]);r!=null&&M(n,["gcsUri"],r);let i=D(t,["bytesBase64Encoded"]);i!=null&&M(n,["imageBytes"],b2(i));let s=D(t,["mimeType"]);return s!=null&&M(n,["mimeType"],s),n}function i_e(t,e){let n={};if(D(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["imageBytes"]);r!=null&&M(n,["bytesBase64Encoded"],b2(r));let i=D(t,["mimeType"]);return i!=null&&M(n,["mimeType"],i),n}function Rx(t,e){let n={},r=D(t,["gcsUri"]);r!=null&&M(n,["gcsUri"],r);let i=D(t,["imageBytes"]);i!=null&&M(n,["bytesBase64Encoded"],b2(i));let s=D(t,["mimeType"]);return s!=null&&M(n,["mimeType"],s),n}function _ui(t,e,n,r){let i={},s=D(e,["pageSize"]);n!==void 0&&s!=null&&M(n,["_query","pageSize"],s);let o=D(e,["pageToken"]);n!==void 0&&o!=null&&M(n,["_query","pageToken"],o);let a=D(e,["filter"]);n!==void 0&&a!=null&&M(n,["_query","filter"],a);let c=D(e,["queryBase"]);return n!==void 0&&c!=null&&M(n,["_url","models_url"],Lrn(t,c)),i}function xui(t,e,n,r){let i={},s=D(e,["pageSize"]);n!==void 0&&s!=null&&M(n,["_query","pageSize"],s);let o=D(e,["pageToken"]);n!==void 0&&o!=null&&M(n,["_query","pageToken"],o);let a=D(e,["filter"]);n!==void 0&&a!=null&&M(n,["_query","filter"],a);let c=D(e,["queryBase"]);return n!==void 0&&c!=null&&M(n,["_url","models_url"],Lrn(t,c)),i}function Sui(t,e,n){let r={},i=D(e,["config"]);return i!=null&&_ui(t,i,r),r}function Cui(t,e,n){let r={},i=D(e,["config"]);return i!=null&&xui(t,i,r),r}function Iui(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["nextPageToken"]);i!=null&&M(n,["nextPageToken"],i);let s=D(t,["_self"]);if(s!=null){let o=Frn(s);Array.isArray(o)&&(o=o.map(a=>k7e(a))),M(n,["models"],o)}return n}function wui(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["nextPageToken"]);i!=null&&M(n,["nextPageToken"],i);let s=D(t,["_self"]);if(s!=null){let o=Frn(s);Array.isArray(o)&&(o=o.map(a=>B7e(a))),M(n,["models"],o)}return n}function Tui(t,e){let n={},r=D(t,["maskMode"]);r!=null&&M(n,["maskMode"],r);let i=D(t,["segmentationClasses"]);i!=null&&M(n,["maskClasses"],i);let s=D(t,["maskDilation"]);return s!=null&&M(n,["dilation"],s),n}function vui(t,e){let n={};if(D(t,["name"])!==void 0)throw new Error("name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["streamableHttpTransport"])!==void 0)throw new Error("streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}function k7e(t,e){let n={},r=D(t,["name"]);r!=null&&M(n,["name"],r);let i=D(t,["displayName"]);i!=null&&M(n,["displayName"],i);let s=D(t,["description"]);s!=null&&M(n,["description"],s);let o=D(t,["version"]);o!=null&&M(n,["version"],o);let a=D(t,["_self"]);a!=null&&M(n,["tunedModelInfo"],zui(a));let c=D(t,["inputTokenLimit"]);c!=null&&M(n,["inputTokenLimit"],c);let u=D(t,["outputTokenLimit"]);u!=null&&M(n,["outputTokenLimit"],u);let l=D(t,["supportedGenerationMethods"]);l!=null&&M(n,["supportedActions"],l);let d=D(t,["temperature"]);d!=null&&M(n,["temperature"],d);let m=D(t,["maxTemperature"]);m!=null&&M(n,["maxTemperature"],m);let h=D(t,["topP"]);h!=null&&M(n,["topP"],h);let f=D(t,["topK"]);f!=null&&M(n,["topK"],f);let g=D(t,["thinking"]);return g!=null&&M(n,["thinking"],g),n}function B7e(t,e){let n={},r=D(t,["name"]);r!=null&&M(n,["name"],r);let i=D(t,["displayName"]);i!=null&&M(n,["displayName"],i);let s=D(t,["description"]);s!=null&&M(n,["description"],s);let o=D(t,["versionId"]);o!=null&&M(n,["version"],o);let a=D(t,["deployedModels"]);if(a!=null){let m=a;Array.isArray(m)&&(m=m.map(h=>jli(h))),M(n,["endpoints"],m)}let c=D(t,["labels"]);c!=null&&M(n,["labels"],c);let u=D(t,["_self"]);u!=null&&M(n,["tunedModelInfo"],Kui(u));let l=D(t,["defaultCheckpointId"]);l!=null&&M(n,["defaultCheckpointId"],l);let d=D(t,["checkpoints"]);if(d!=null){let m=d;Array.isArray(m)&&(m=m.map(h=>h)),M(n,["checkpoints"],m)}return n}function Rui(t,e){let n={},r=D(t,["speakerVoiceConfigs"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>qui(s))),M(n,["speakerVoiceConfigs"],i)}return n}function kui(t,e){let n={},r=D(t,["mediaResolution"]);r!=null&&M(n,["mediaResolution"],r);let i=D(t,["toolCall"]);i!=null&&M(n,["toolCall"],i);let s=D(t,["toolResponse"]);s!=null&&M(n,["toolResponse"],s);let o=D(t,["audioTranscription"]);o!=null&&M(n,["audioTranscription"],o);let a=D(t,["codeExecutionResult"]);a!=null&&M(n,["codeExecutionResult"],a);let c=D(t,["executableCode"]);c!=null&&M(n,["executableCode"],c);let u=D(t,["fileData"]);u!=null&&M(n,["fileData"],Vli(u));let l=D(t,["functionCall"]);l!=null&&M(n,["functionCall"],Yli(l));let d=D(t,["functionResponse"]);d!=null&&M(n,["functionResponse"],d);let m=D(t,["inlineData"]);m!=null&&M(n,["inlineData"],yli(m));let h=D(t,["text"]);h!=null&&M(n,["text"],h);let f=D(t,["thought"]);f!=null&&M(n,["thought"],f);let g=D(t,["thoughtSignature"]);g!=null&&M(n,["thoughtSignature"],g);let A=D(t,["videoMetadata"]);A!=null&&M(n,["videoMetadata"],A);let y=D(t,["partMetadata"]);y!=null&&M(n,["partMetadata"],y);let E=D(t,["mediaProcessing"]);return E!=null&&M(n,["mediaProcessing"],E),n}function Bui(t,e){let n={},r=D(t,["mediaResolution"]);if(r!=null&&M(n,["mediaResolution"],r),D(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let i=D(t,["audioTranscription"]);i!=null&&M(n,["audioTranscription"],i);let s=D(t,["codeExecutionResult"]);s!=null&&M(n,["codeExecutionResult"],s);let o=D(t,["executableCode"]);o!=null&&M(n,["executableCode"],o);let a=D(t,["fileData"]);a!=null&&M(n,["fileData"],a);let c=D(t,["functionCall"]);c!=null&&M(n,["functionCall"],c);let u=D(t,["functionResponse"]);u!=null&&M(n,["functionResponse"],u);let l=D(t,["inlineData"]);l!=null&&M(n,["inlineData"],l);let d=D(t,["text"]);d!=null&&M(n,["text"],d);let m=D(t,["thought"]);m!=null&&M(n,["thought"],m);let h=D(t,["thoughtSignature"]);h!=null&&M(n,["thoughtSignature"],h);let f=D(t,["videoMetadata"]);if(f!=null&&M(n,["videoMetadata"],f),D(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let g=D(t,["mediaProcessing"]);return g!=null&&M(n,["mediaProcessing"],g),n}function Nui(t,e){let n={},r=D(t,["productImage"]);return r!=null&&M(n,["image"],Rx(r)),n}function Dui(t,e,n){let r={},i=D(t,["numberOfImages"]);e!==void 0&&i!=null&&M(e,["parameters","sampleCount"],i);let s=D(t,["baseSteps"]);e!==void 0&&s!=null&&M(e,["parameters","baseSteps"],s);let o=D(t,["outputGcsUri"]);e!==void 0&&o!=null&&M(e,["parameters","storageUri"],o);let a=D(t,["seed"]);e!==void 0&&a!=null&&M(e,["parameters","seed"],a);let c=D(t,["safetyFilterLevel"]);e!==void 0&&c!=null&&M(e,["parameters","safetySetting"],c);let u=D(t,["personGeneration"]);e!==void 0&&u!=null&&M(e,["parameters","personGeneration"],u);let l=D(t,["addWatermark"]);e!==void 0&&l!=null&&M(e,["parameters","addWatermark"],l);let d=D(t,["outputMimeType"]);e!==void 0&&d!=null&&M(e,["parameters","outputOptions","mimeType"],d);let m=D(t,["outputCompressionQuality"]);e!==void 0&&m!=null&&M(e,["parameters","outputOptions","compressionQuality"],m);let h=D(t,["enhancePrompt"]);e!==void 0&&h!=null&&M(e,["parameters","enhancePrompt"],h);let f=D(t,["labels"]);return e!==void 0&&f!=null&&M(e,["labels"],f),r}function Pui(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["source"]);s!=null&&Oui(s,r);let o=D(e,["config"]);return o!=null&&Dui(o,r),r}function Mui(t,e){let n={},r=D(t,["predictions"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>r_e(s))),M(n,["generatedImages"],i)}return n}function Oui(t,e,n){let r={},i=D(t,["prompt"]);e!==void 0&&i!=null&&M(e,["instances[0]","prompt"],i);let s=D(t,["personImage"]);e!==void 0&&s!=null&&M(e,["instances[0]","personImage","image"],Rx(s));let o=D(t,["productImages"]);if(e!==void 0&&o!=null){let a=o;Array.isArray(a)&&(a=a.map(c=>Nui(c))),M(e,["instances[0]","productImages"],a)}return r}function Lui(t,e){let n={},r=D(t,["referenceImage"]);r!=null&&M(n,["referenceImage"],Rx(r));let i=D(t,["referenceId"]);i!=null&&M(n,["referenceId"],i);let s=D(t,["referenceType"]);s!=null&&M(n,["referenceType"],s);let o=D(t,["maskImageConfig"]);o!=null&&M(n,["maskImageConfig"],Tui(o));let a=D(t,["controlImageConfig"]);a!=null&&M(n,["controlImageConfig"],wli(a));let c=D(t,["styleImageConfig"]);c!=null&&M(n,["styleImageConfig"],c);let u=D(t,["subjectImageConfig"]);return u!=null&&M(n,["subjectImageConfig"],u),n}function Fui(t,e){let n={},r=D(t,["mimeType"]);r!=null&&M(n,["mimeType"],r);let i=D(t,["voiceSampleAudio"]);if(i!=null&&M(n,["voiceSampleAudio"],i),D(t,["consentAudio"])!==void 0)throw new Error("consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["voiceConsentSignature"])!==void 0)throw new Error("voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}function Vrn(t,e){let n={},r=D(t,["safetyAttributes","categories"]);r!=null&&M(n,["categories"],r);let i=D(t,["safetyAttributes","scores"]);i!=null&&M(n,["scores"],i);let s=D(t,["contentType"]);return s!=null&&M(n,["contentType"],s),n}function Qui(t,e){let n={},r=D(t,["category"]);if(r!=null&&M(n,["category"],r),D(t,["method"])!==void 0)throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let i=D(t,["threshold"]);return i!=null&&M(n,["threshold"],i),n}function Uui(t,e){let n={},r=D(t,["image"]);return r!=null&&M(n,["image"],Rx(r)),n}function Gui(t,e,n){let r={},i=D(t,["mode"]);e!==void 0&&i!=null&&M(e,["parameters","mode"],i);let s=D(t,["maxPredictions"]);e!==void 0&&s!=null&&M(e,["parameters","maxPredictions"],s);let o=D(t,["confidenceThreshold"]);e!==void 0&&o!=null&&M(e,["parameters","confidenceThreshold"],o);let a=D(t,["maskDilation"]);e!==void 0&&a!=null&&M(e,["parameters","maskDilation"],a);let c=D(t,["binaryColorThreshold"]);e!==void 0&&c!=null&&M(e,["parameters","binaryColorThreshold"],c);let u=D(t,["labels"]);return e!==void 0&&u!=null&&M(e,["labels"],u),r}function $ui(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["source"]);s!=null&&Hui(s,r);let o=D(e,["config"]);return o!=null&&Gui(o,r),r}function Wui(t,e){let n={},r=D(t,["predictions"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>dui(s))),M(n,["generatedMasks"],i)}return n}function Hui(t,e,n){let r={},i=D(t,["prompt"]);e!==void 0&&i!=null&&M(e,["instances[0]","prompt"],i);let s=D(t,["image"]);e!==void 0&&s!=null&&M(e,["instances[0]","image"],Rx(s));let o=D(t,["scribbleImage"]);return e!==void 0&&o!=null&&M(e,["instances[0]","scribble"],Uui(o)),r}function qui(t,e){let n={},r=D(t,["speaker"]);r!=null&&M(n,["speaker"],r);let i=D(t,["voiceConfig"]);return i!=null&&M(n,["voiceConfig"],Xrn(i)),n}function Yrn(t,e){let n={},r=D(t,["voiceConfig"]);r!=null&&M(n,["voiceConfig"],Xrn(r));let i=D(t,["languageCode"]);i!=null&&M(n,["languageCode"],i);let s=D(t,["multiSpeakerVoiceConfig"]);return s!=null&&M(n,["multiSpeakerVoiceConfig"],Rui(s)),n}function jui(t,e){let n={},r=D(t,["functionCallingConfig"]);r!=null&&M(n,["functionCallingConfig"],zli(r));let i=D(t,["retrievalConfig"]);i!=null&&M(n,["retrievalConfig"],i);let s=D(t,["includeServerSideToolInvocations"]);return s!=null&&M(n,["includeServerSideToolInvocations"],s),n}function Vui(t,e){let n={},r=D(t,["functionCallingConfig"]);r!=null&&M(n,["functionCallingConfig"],r);let i=D(t,["retrievalConfig"]);if(i!=null&&M(n,["retrievalConfig"],i),D(t,["includeServerSideToolInvocations"])!==void 0)throw new Error("includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}function Yui(t,e){let n={};if(D(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["googleMaps"]);r!=null&&M(n,["googleMaps"],Aui(r));let i=D(t,["mcpServers"]);if(i!=null){let m=i;Array.isArray(m)&&(m=m.map(h=>h)),M(n,["mcpServers"],m)}let s=D(t,["codeExecution"]);s!=null&&M(n,["codeExecution"],s);let o=D(t,["computerUse"]);if(o!=null&&M(n,["computerUse"],o),D(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["exaAiSearch"])!==void 0)throw new Error("exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let a=D(t,["functionDeclarations"]);if(a!=null){let m=a;Array.isArray(m)&&(m=m.map(h=>h)),M(n,["functionDeclarations"],m)}let c=D(t,["googleSearch"]);c!=null&&M(n,["googleSearch"],yui(c));let u=D(t,["googleSearchRetrieval"]);if(u!=null&&M(n,["googleSearchRetrieval"],u),D(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let l=D(t,["urlContext"]);l!=null&&M(n,["urlContext"],l);let d=D(t,["fileSearch"]);return d!=null&&M(n,["fileSearch"],d),n}function zrn(t,e){let n={},r=D(t,["retrieval"]);r!=null&&M(n,["retrieval"],r);let i=D(t,["googleMaps"]);i!=null&&M(n,["googleMaps"],i);let s=D(t,["mcpServers"]);if(s!=null){let g=s;Array.isArray(g)&&(g=g.map(A=>vui(A))),M(n,["mcpServers"],g)}let o=D(t,["codeExecution"]);o!=null&&M(n,["codeExecution"],o);let a=D(t,["computerUse"]);a!=null&&M(n,["computerUse"],Sli(a));let c=D(t,["enterpriseWebSearch"]);c!=null&&M(n,["enterpriseWebSearch"],c);let u=D(t,["exaAiSearch"]);u!=null&&M(n,["exaAiSearch"],u);let l=D(t,["functionDeclarations"]);if(l!=null){let g=l;Array.isArray(g)&&(g=g.map(A=>A)),M(n,["functionDeclarations"],g)}let d=D(t,["googleSearch"]);d!=null&&M(n,["googleSearch"],d);let m=D(t,["googleSearchRetrieval"]);m!=null&&M(n,["googleSearchRetrieval"],m);let h=D(t,["parallelAiSearch"]);h!=null&&M(n,["parallelAiSearch"],h);let f=D(t,["urlContext"]);if(f!=null&&M(n,["urlContext"],f),D(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}function zui(t,e){let n={},r=D(t,["baseModel"]);r!=null&&M(n,["baseModel"],r);let i=D(t,["createTime"]);i!=null&&M(n,["createTime"],i);let s=D(t,["updateTime"]);return s!=null&&M(n,["updateTime"],s),n}function Kui(t,e){let n={},r=D(t,["labels","google-vertex-llm-tuning-base-model-id"]);r!=null&&M(n,["baseModel"],r);let i=D(t,["createTime"]);i!=null&&M(n,["createTime"],i);let s=D(t,["updateTime"]);return s!=null&&M(n,["updateTime"],s),n}function Jui(t,e,n){let r={},i=D(t,["displayName"]);e!==void 0&&i!=null&&M(e,["displayName"],i);let s=D(t,["description"]);e!==void 0&&s!=null&&M(e,["description"],s);let o=D(t,["defaultCheckpointId"]);return e!==void 0&&o!=null&&M(e,["defaultCheckpointId"],o),r}function Xui(t,e,n){let r={},i=D(t,["displayName"]);e!==void 0&&i!=null&&M(e,["displayName"],i);let s=D(t,["description"]);e!==void 0&&s!=null&&M(e,["description"],s);let o=D(t,["defaultCheckpointId"]);return e!==void 0&&o!=null&&M(e,["defaultCheckpointId"],o),r}function Zui(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","name"],ea(t,i));let s=D(e,["config"]);return s!=null&&Jui(s,r),r}function edi(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["config"]);return s!=null&&Xui(s,r),r}function tdi(t,e,n){let r={},i=D(t,["outputGcsUri"]);e!==void 0&&i!=null&&M(e,["parameters","storageUri"],i);let s=D(t,["safetyFilterLevel"]);e!==void 0&&s!=null&&M(e,["parameters","safetySetting"],s);let o=D(t,["personGeneration"]);e!==void 0&&o!=null&&M(e,["parameters","personGeneration"],o);let a=D(t,["includeRaiReason"]);e!==void 0&&a!=null&&M(e,["parameters","includeRaiReason"],a);let c=D(t,["outputMimeType"]);e!==void 0&&c!=null&&M(e,["parameters","outputOptions","mimeType"],c);let u=D(t,["outputCompressionQuality"]);e!==void 0&&u!=null&&M(e,["parameters","outputOptions","compressionQuality"],u);let l=D(t,["enhanceInputImage"]);e!==void 0&&l!=null&&M(e,["parameters","upscaleConfig","enhanceInputImage"],l);let d=D(t,["imagePreservationFactor"]);e!==void 0&&d!=null&&M(e,["parameters","upscaleConfig","imagePreservationFactor"],d);let m=D(t,["labels"]);e!==void 0&&m!=null&&M(e,["labels"],m);let h=D(t,["numberOfImages"]);e!==void 0&&h!=null&&M(e,["parameters","sampleCount"],h);let f=D(t,["mode"]);return e!==void 0&&f!=null&&M(e,["parameters","mode"],f),r}function ndi(t,e,n){let r={},i=D(e,["model"]);i!=null&&M(r,["_url","model"],ea(t,i));let s=D(e,["image"]);s!=null&&M(r,["instances[0]","image"],Rx(s));let o=D(e,["upscaleFactor"]);o!=null&&M(r,["parameters","upscaleConfig","upscaleFactor"],o);let a=D(e,["config"]);return a!=null&&tdi(a,r),r}function rdi(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["predictions"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>r_e(o))),M(n,["generatedImages"],s)}return n}function idi(t,e){let n={},r=D(t,["uri"]);r!=null&&M(n,["uri"],r);let i=D(t,["encodedVideo"]);i!=null&&M(n,["videoBytes"],b2(i));let s=D(t,["encoding"]);return s!=null&&M(n,["mimeType"],s),n}function sdi(t,e){let n={},r=D(t,["gcsUri"]);r!=null&&M(n,["uri"],r);let i=D(t,["bytesBase64Encoded"]);i!=null&&M(n,["videoBytes"],b2(i));let s=D(t,["mimeType"]);return s!=null&&M(n,["mimeType"],s),n}function odi(t,e){let n={},r=D(t,["image"]);r!=null&&M(n,["_self"],Rx(r));let i=D(t,["maskMode"]);return i!=null&&M(n,["maskMode"],i),n}function adi(t,e){let n={},r=D(t,["image"]);r!=null&&M(n,["image"],i_e(r));let i=D(t,["referenceType"]);return i!=null&&M(n,["referenceType"],i),n}function cdi(t,e){let n={},r=D(t,["image"]);r!=null&&M(n,["image"],Rx(r));let i=D(t,["referenceType"]);return i!=null&&M(n,["referenceType"],i),n}function Krn(t,e){let n={},r=D(t,["uri"]);r!=null&&M(n,["uri"],r);let i=D(t,["videoBytes"]);i!=null&&M(n,["encodedVideo"],b2(i));let s=D(t,["mimeType"]);return s!=null&&M(n,["encoding"],s),n}function Jrn(t,e){let n={},r=D(t,["uri"]);r!=null&&M(n,["gcsUri"],r);let i=D(t,["videoBytes"]);i!=null&&M(n,["bytesBase64Encoded"],b2(i));let s=D(t,["mimeType"]);return s!=null&&M(n,["mimeType"],s),n}function Xrn(t,e){let n={},r=D(t,["replicatedVoiceConfig"]);r!=null&&M(n,["replicatedVoiceConfig"],Fui(r));let i=D(t,["prebuiltVoiceConfig"]);return i!=null&&M(n,["prebuiltVoiceConfig"],i),n}function ldi(t,e,n){let r={},i=D(e,["displayName"]);n!==void 0&&i!=null&&M(n,["displayName"],i);let s=D(e,["embeddingModel"]);return n!==void 0&&s!=null&&M(n,["embeddingModel"],ea(t,s)),r}function udi(t,e){let n={},r=D(e,["config"]);return r!=null&&ldi(t,r,n),n}function ddi(t,e){let n={},r=D(t,["force"]);return e!==void 0&&r!=null&&M(e,["_query","force"],r),n}function pdi(t){let e={},n=D(t,["name"]);n!=null&&M(e,["_url","name"],n);let r=D(t,["config"]);return r!=null&&ddi(r,e),e}function mdi(t){let e={},n=D(t,["name"]);return n!=null&&M(e,["_url","name"],n),e}function hdi(t,e){let n={},r=D(t,["customMetadata"]);if(e!==void 0&&r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>o)),M(e,["customMetadata"],s)}let i=D(t,["chunkingConfig"]);return e!==void 0&&i!=null&&M(e,["chunkingConfig"],i),n}function fdi(t){let e={},n=D(t,["name"]);n!=null&&M(e,["name"],n);let r=D(t,["metadata"]);r!=null&&M(e,["metadata"],r);let i=D(t,["done"]);i!=null&&M(e,["done"],i);let s=D(t,["error"]);s!=null&&M(e,["error"],s);let o=D(t,["response"]);return o!=null&&M(e,["response"],Adi(o)),e}function gdi(t){let e={},n=D(t,["fileSearchStoreName"]);n!=null&&M(e,["_url","file_search_store_name"],n);let r=D(t,["fileName"]);r!=null&&M(e,["fileName"],r);let i=D(t,["config"]);return i!=null&&hdi(i,e),e}function Adi(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["parent"]);r!=null&&M(e,["parent"],r);let i=D(t,["documentName"]);return i!=null&&M(e,["documentName"],i),e}function ydi(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&M(e,["_query","pageSize"],r);let i=D(t,["pageToken"]);return e!==void 0&&i!=null&&M(e,["_query","pageToken"],i),n}function Edi(t){let e={},n=D(t,["config"]);return n!=null&&ydi(n,e),e}function bdi(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&M(e,["nextPageToken"],r);let i=D(t,["fileSearchStores"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>o)),M(e,["fileSearchStores"],s)}return e}function Zrn(t,e){let n={},r=D(t,["mimeType"]);e!==void 0&&r!=null&&M(e,["mimeType"],r);let i=D(t,["displayName"]);e!==void 0&&i!=null&&M(e,["displayName"],i);let s=D(t,["customMetadata"]);if(e!==void 0&&s!=null){let a=s;Array.isArray(a)&&(a=a.map(c=>c)),M(e,["customMetadata"],a)}let o=D(t,["chunkingConfig"]);return e!==void 0&&o!=null&&M(e,["chunkingConfig"],o),n}function _di(t){let e={},n=D(t,["fileSearchStoreName"]);n!=null&&M(e,["_url","file_search_store_name"],n);let r=D(t,["config"]);return r!=null&&Zrn(r,e),e}function xdi(t){let e={},n=D(t,["sdkHttpResponse"]);return n!=null&&M(e,["sdkHttpResponse"],n),e}function Bdi(t){let n=globalThis[Symbol.for("undici.globalDispatcher.1")];if(n)for(let r of Object.getOwnPropertySymbols(n)){let i=r.description;if(i?.includes("headers timeout")||i?.includes("body timeout")){let s=n[r];typeof s=="number"&&(n[r]=Math.max(s,t))}}}function Ndi(t,e){let n=()=>{};if(!(t&&t>0)&&!e)return{signal:void 0,dispose:n};let r=new AbortController,i;t&&t>0&&(i=setTimeout(()=>r.abort(),t),i&&typeof i.unref=="function"&&i.unref());let s=()=>r.abort();return e&&(e.aborted?r.abort():e.addEventListener("abort",s)),{signal:r.signal,dispose:()=>{i!==void 0&&clearTimeout(i),e?.removeEventListener("abort",s)}}}async function t7e(t){var e;if(t===void 0)throw new Error("response is undefined");if(!t.ok){let n=t.status,r;!((e=t.headers.get("content-type"))===null||e===void 0)&&e.includes("application/json")?r=await t.json():r={error:{message:await t.text(),code:t.status,status:t.statusText}};let i=JSON.stringify(r);throw n>=400&&n<600?new Ybe({message:i,status:n}):new Error(i)}}function Qdi(t,e){if(!e||Object.keys(e).length===0)return;if(t.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let n={};if(typeof t.body=="string"&&t.body.length>0)try{let s=JSON.parse(t.body);if(typeof s=="object"&&s!==null&&!Array.isArray(s))n=s;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch{console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function r(s,o){let a=Object.assign({},s);for(let c in o)if(Object.prototype.hasOwnProperty.call(o,c)){let u=o[c],l=a[c];u&&typeof u=="object"&&!Array.isArray(u)&&l&&typeof l=="object"&&!Array.isArray(l)?a[c]=r(l,u):(l&&u&&typeof l!=typeof u&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${c}". Original type: ${typeof l}, New type: ${typeof u}. Overwriting.`),a[c]=u)}return a}let i=r(n,e);t.body=JSON.stringify(i)}function ein(t){for(let e of t)if($di(e)||typeof e=="object"&&"inputSchema"in e)return!0;return Gdi}function tin(t){var e;let n=(e=t[N7e])!==null&&e!==void 0?e:"";t[N7e]=(n+` ${Udi}`).trimStart()}function $di(t){return t!==null&&typeof t=="object"&&t instanceof P7e}function Wdi(t){return V3(this,arguments,function*(n,r=100){let i,s=0;for(;s{e[r]=n}),e}function jdi(t){let e=new Headers;for(let[n,r]of Object.entries(t))e.append(n,r);return e}async function Ydi(t,e,n){let r=new x7e,i;n.data instanceof Blob?i=await n.data.text():n.data instanceof ArrayBuffer?i=new TextDecoder().decode(n.data):i=n.data;let s=JSON.parse(i);if(t.isVertexAI()){let o=ili(s);Object.assign(r,o)}else Object.assign(r,s);e(r)}function Kdi(t){let e={};return t.forEach((n,r)=>{e[r]=n}),e}function Jdi(t){let e=new Headers;for(let[n,r]of Object.entries(t))e.append(n,r);return e}function nrn(t){var e,n,r;if(!((e=t?.automaticFunctionCalling)===null||e===void 0)&&e.disable)return!0;let i=!1;for(let o of(n=t?.tools)!==null&&n!==void 0?n:[])if(Y3(o)){i=!0;break}if(!i)return!0;let s=(r=t?.automaticFunctionCalling)===null||r===void 0?void 0:r.maximumRemoteCalls;return s&&(s<0||!Number.isInteger(s))||s==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",s),!0):!1}function Y3(t){return"callTool"in t&&typeof t.callTool=="function"}function Xdi(t){var e,n,r;return(r=(n=(e=t.config)===null||e===void 0?void 0:e.tools)===null||n===void 0?void 0:n.some(i=>Y3(i)))!==null&&r!==void 0?r:!1}function rrn(t){var e;let n=[];return!((e=t?.config)===null||e===void 0)&&e.tools&&t.config.tools.forEach((r,i)=>{if(Y3(r))return;let s=r;s.functionDeclarations&&s.functionDeclarations.length>0&&n.push(i)}),n}function irn(t){var e;return!(!((e=t?.automaticFunctionCalling)===null||e===void 0)&&e.ignoreCallHistory)}function Zdi(t){let e={},n=D(t,["apiKey"]);if(n!=null&&M(e,["apiKey"],n),D(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["authType"])!==void 0)throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function epi(t){let e={},n=D(t,["data"]);if(n!=null&&M(e,["data"],n),D(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["mimeType"]);return r!=null&&M(e,["mimeType"],r),e}function tpi(t){let e={},n=D(t,["parts"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>upi(s))),M(e,["parts"],i)}let r=D(t,["role"]);return r!=null&&M(e,["role"],r),e}function npi(t,e,n){let r={},i=D(e,["expireTime"]);n!==void 0&&i!=null&&M(n,["expireTime"],i);let s=D(e,["newSessionExpireTime"]);n!==void 0&&s!=null&&M(n,["newSessionExpireTime"],s);let o=D(e,["uses"]);n!==void 0&&o!=null&&M(n,["uses"],o);let a=D(e,["liveConnectConstraints"]);n!==void 0&&a!=null&&M(n,["bidiGenerateContentSetup"],lpi(t,a));let c=D(e,["lockAdditionalFields"]);return n!==void 0&&c!=null&&M(n,["fieldMask"],c),r}function rpi(t,e){let n={},r=D(e,["config"]);return r!=null&&M(n,["config"],npi(t,r,n)),n}function ipi(t){let e={};if(D(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["fileUri"]);n!=null&&M(e,["fileUri"],n);let r=D(t,["mimeType"]);return r!=null&&M(e,["mimeType"],r),e}function spi(t){let e={},n=D(t,["args"]);n!=null&&M(e,["args"],n);let r=D(t,["id"]);r!=null&&M(e,["id"],r);let i=D(t,["name"]);if(i!=null&&M(e,["name"],i),D(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function opi(t){let e={},n=D(t,["authConfig"]);n!=null&&M(e,["authConfig"],Zdi(n));let r=D(t,["enableWidget"]);if(r!=null&&M(e,["enableWidget"],r),D(t,["groundingTypes"])!==void 0)throw new Error("groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function api(t){let e={};if(D(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["searchTypes"]);n!=null&&M(e,["searchTypes"],n);let r=D(t,["timeRangeFilter"]);return r!=null&&M(e,["timeRangeFilter"],r),e}function cpi(t,e){let n={},r=D(t,["generationConfig"]);e!==void 0&&r!=null&&M(e,["setup","generationConfig"],r);let i=D(t,["responseModalities"]);e!==void 0&&i!=null&&M(e,["setup","generationConfig","responseModalities"],i);let s=D(t,["temperature"]);e!==void 0&&s!=null&&M(e,["setup","generationConfig","temperature"],s);let o=D(t,["topP"]);e!==void 0&&o!=null&&M(e,["setup","generationConfig","topP"],o);let a=D(t,["topK"]);e!==void 0&&a!=null&&M(e,["setup","generationConfig","topK"],a);let c=D(t,["maxOutputTokens"]);e!==void 0&&c!=null&&M(e,["setup","generationConfig","maxOutputTokens"],c);let u=D(t,["mediaResolution"]);e!==void 0&&u!=null&&M(e,["setup","generationConfig","mediaResolution"],u);let l=D(t,["seed"]);e!==void 0&&l!=null&&M(e,["setup","generationConfig","seed"],l);let d=D(t,["speechConfig"]);e!==void 0&&d!=null&&M(e,["setup","generationConfig","speechConfig"],QKe(d));let m=D(t,["thinkingConfig"]);e!==void 0&&m!=null&&M(e,["setup","generationConfig","thinkingConfig"],m);let h=D(t,["enableAffectiveDialog"]);e!==void 0&&h!=null&&M(e,["setup","generationConfig","enableAffectiveDialog"],h);let f=D(t,["systemInstruction"]);e!==void 0&&f!=null&&M(e,["setup","systemInstruction"],tpi(zp(f)));let g=D(t,["tools"]);if(e!==void 0&&g!=null){let N=X3(g);Array.isArray(N)&&(N=N.map(O=>mpi(J3(O)))),M(e,["setup","tools"],N)}let A=D(t,["sessionResumption"]);e!==void 0&&A!=null&&M(e,["setup","sessionResumption"],ppi(A));let y=D(t,["inputAudioTranscription"]);e!==void 0&&y!=null&&M(e,["setup","inputAudioTranscription"],y);let E=D(t,["outputAudioTranscription"]);e!==void 0&&E!=null&&M(e,["setup","outputAudioTranscription"],E);let _=D(t,["realtimeInputConfig"]);e!==void 0&&_!=null&&M(e,["setup","realtimeInputConfig"],_);let S=D(t,["contextWindowCompression"]);e!==void 0&&S!=null&&M(e,["setup","contextWindowCompression"],S);let C=D(t,["proactivity"]);if(e!==void 0&&C!=null&&M(e,["setup","proactivity"],C),D(t,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let I=D(t,["avatarConfig"]);e!==void 0&&I!=null&&M(e,["setup","avatarConfig"],I);let w=D(t,["safetySettings"]);if(e!==void 0&&w!=null){let N=w;Array.isArray(N)&&(N=N.map(O=>dpi(O))),M(e,["setup","safetySettings"],N)}let k=D(t,["translationConfig"]);return e!==void 0&&k!=null&&M(e,["setup","generationConfig","translationConfig"],k),n}function lpi(t,e){let n={},r=D(e,["model"]);r!=null&&M(n,["setup","model"],ea(t,r));let i=D(e,["config"]);return i!=null&&M(n,["config"],cpi(i,n)),n}function upi(t){let e={},n=D(t,["mediaResolution"]);n!=null&&M(e,["mediaResolution"],n);let r=D(t,["toolCall"]);r!=null&&M(e,["toolCall"],r);let i=D(t,["toolResponse"]);i!=null&&M(e,["toolResponse"],i);let s=D(t,["audioTranscription"]);s!=null&&M(e,["audioTranscription"],s);let o=D(t,["codeExecutionResult"]);o!=null&&M(e,["codeExecutionResult"],o);let a=D(t,["executableCode"]);a!=null&&M(e,["executableCode"],a);let c=D(t,["fileData"]);c!=null&&M(e,["fileData"],ipi(c));let u=D(t,["functionCall"]);u!=null&&M(e,["functionCall"],spi(u));let l=D(t,["functionResponse"]);l!=null&&M(e,["functionResponse"],l);let d=D(t,["inlineData"]);d!=null&&M(e,["inlineData"],epi(d));let m=D(t,["text"]);m!=null&&M(e,["text"],m);let h=D(t,["thought"]);h!=null&&M(e,["thought"],h);let f=D(t,["thoughtSignature"]);f!=null&&M(e,["thoughtSignature"],f);let g=D(t,["videoMetadata"]);g!=null&&M(e,["videoMetadata"],g);let A=D(t,["partMetadata"]);A!=null&&M(e,["partMetadata"],A);let y=D(t,["mediaProcessing"]);return y!=null&&M(e,["mediaProcessing"],y),e}function dpi(t){let e={},n=D(t,["category"]);if(n!=null&&M(e,["category"],n),D(t,["method"])!==void 0)throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["threshold"]);return r!=null&&M(e,["threshold"],r),e}function ppi(t){let e={},n=D(t,["handle"]);if(n!=null&&M(e,["handle"],n),D(t,["transparent"])!==void 0)throw new Error("transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}function mpi(t){let e={};if(D(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=D(t,["googleMaps"]);n!=null&&M(e,["googleMaps"],opi(n));let r=D(t,["mcpServers"]);if(r!=null){let d=r;Array.isArray(d)&&(d=d.map(m=>m)),M(e,["mcpServers"],d)}let i=D(t,["codeExecution"]);i!=null&&M(e,["codeExecution"],i);let s=D(t,["computerUse"]);if(s!=null&&M(e,["computerUse"],s),D(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["exaAiSearch"])!==void 0)throw new Error("exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=D(t,["functionDeclarations"]);if(o!=null){let d=o;Array.isArray(d)&&(d=d.map(m=>m)),M(e,["functionDeclarations"],d)}let a=D(t,["googleSearch"]);a!=null&&M(e,["googleSearch"],api(a));let c=D(t,["googleSearchRetrieval"]);if(c!=null&&M(e,["googleSearchRetrieval"],c),D(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=D(t,["urlContext"]);u!=null&&M(e,["urlContext"],u);let l=D(t,["fileSearch"]);return l!=null&&M(e,["fileSearch"],l),e}function hpi(t){let e=[];for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];if(typeof r=="object"&&r!=null&&Object.keys(r).length>0){let i=Object.keys(r).map(s=>`${n}.${s}`);e.push(...i)}else e.push(n)}return e.join(",")}function fpi(t,e){let n=null,r=t.bidiGenerateContentSetup;if(typeof r=="object"&&r!==null&&"setup"in r){let s=r.setup;typeof s=="object"&&s!==null?(t.bidiGenerateContentSetup=s,n=s):delete t.bidiGenerateContentSetup}else r!==void 0&&delete t.bidiGenerateContentSetup;let i=t.fieldMask;if(n){let s=hpi(n);if(Array.isArray(e?.lockAdditionalFields)&&e?.lockAdditionalFields.length===0)s?t.fieldMask=s:delete t.fieldMask;else if(e?.lockAdditionalFields&&e.lockAdditionalFields.length>0&&i!==null&&Array.isArray(i)&&i.length>0){let o=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"],a=[];i.length>0&&(a=i.map(u=>o.includes(u)?`generationConfig.${u}`:u));let c=[];s&&c.push(s),a.length>0&&c.push(...a),c.length>0?t.fieldMask=c.join(","):delete t.fieldMask}else delete t.fieldMask}else i!==null&&Array.isArray(i)&&i.length>0?t.fieldMask=i.join(","):delete t.fieldMask;return t}function gpi(t,e){let n={},r=D(t,["force"]);return e!==void 0&&r!=null&&M(e,["_query","force"],r),n}function Api(t){let e={},n=D(t,["name"]);n!=null&&M(e,["_url","name"],n);let r=D(t,["config"]);return r!=null&&gpi(r,e),e}function ypi(t){let e={},n=D(t,["name"]);return n!=null&&M(e,["_url","name"],n),e}function Epi(t,e){let n={},r=D(t,["pageSize"]);e!==void 0&&r!=null&&M(e,["_query","pageSize"],r);let i=D(t,["pageToken"]);return e!==void 0&&i!=null&&M(e,["_query","pageToken"],i),n}function bpi(t){let e={},n=D(t,["parent"]);n!=null&&M(e,["_url","parent"],n);let r=D(t,["config"]);return r!=null&&Epi(r,e),e}function _pi(t){let e={},n=D(t,["sdkHttpResponse"]);n!=null&&M(e,["sdkHttpResponse"],n);let r=D(t,["nextPageToken"]);r!=null&&M(e,["nextPageToken"],r);let i=D(t,["documents"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>o)),M(e,["documents"],s)}return e}function xpi(){return"Deno"in globalThis}function _Z(){var t,e,n,r,i,s;if(Rbe)return Rbe;let o=globalThis,a={};return xpi()?a=(r=(n=(e=(t=o.Deno)===null||t===void 0?void 0:t.env)===null||e===void 0?void 0:e.toObject)===null||n===void 0?void 0:n.call(e))!==null&&r!==void 0?r:{}:a=(s=(i=o.process)===null||i===void 0?void 0:i.env)!==null&&s!==void 0?s:{},Rbe=a,Rbe}function Spi(t){var e,n;let r=Object.assign({},t),i=_Z();return typeof i.GOOGLE_GENAI_API_VERSION<"u"&&((e=r.api_version)!==null&&e!==void 0||(r.api_version=i.GOOGLE_GENAI_API_VERSION)),typeof i.GOOGLE_GENAI_USER_PROJECT<"u"&&((n=r.user_project)!==null&&n!==void 0||(r.user_project=i.GOOGLE_GENAI_USER_PROJECT)),r}function Cpi(t){let[,e,...n]=t.pathname.split("/");if(!e)return t;let r=decodeURIComponent(e);if(!r.includes("/"))return t;let i=new URL(t);return i.pathname=`/${r}/${n.join("/")}`,i}async function Ipi(t,e){if(rin(t))return t.resolveGoogleGenAISecurity(e);let n=typeof t=="function"?await t():t;return nin(n)?srn(n):srn(void 0)}function wpi(t){var e,n;if(rin(t))return(n=(e=t.getDefaultHeaders)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:t.defaultHeaders;if(nin(t))return t.default_headers}function srn(t){var e,n;let r=_Z(),i=Object.assign(Object.assign({},t),{api_key:(e=t?.api_key)!==null&&e!==void 0?e:r.GOOGLE_GENAI_API_KEY,access_token:(n=t?.access_token)!==null&&n!==void 0?n:r.GOOGLE_GENAI_ACCESS_TOKEN});return iin(i)?i:void 0}function Tpi(t){var e,n;let r={};for(let[s,o]of t){let a=s.toLowerCase();a!=="authorization"&&a!=="x-goog-api-key"&&(r[s]=o)}let i={access_token:(e=t.get("authorization"))!==null&&e!==void 0?e:void 0,api_key:(n=t.get("x-goog-api-key"))!==null&&n!==void 0?n:void 0,default_headers:Object.keys(r).length?r:void 0};return iin(i)?i:void 0}function orn(t,e){if(e)for(let[n,r]of new Headers(e))t.get(n)===null&&t.set(n,r)}function vpi(t,e){t.options.user_project!==void 0&&e.get("x-goog-user-project")===null&&e.set("x-goog-user-project",t.options.user_project)}function Rpi(t,e){if(e){if(e.api_key){t.set("x-goog-api-key",e.api_key);return}e.access_token&&t.set("Authorization",Bpi(e.access_token))}}function kpi(t){return t.get("authorization")!==null||t.get("x-goog-api-key")!==null}function Bpi(t){return t.slice(0,7).toLowerCase()==="bearer "?t:`Bearer ${t}`}function nin(t){return typeof t=="object"&&t!==null}function rin(t){return typeof t=="object"&&t!==null&&"resolveGoogleGenAISecurity"in t&&typeof t.resolveGoogleGenAISecurity=="function"}function iin(t){return t.api_key!==void 0||t.access_token!==void 0||t.default_headers!==void 0}function q3(t){return Opi(t)?t:t instanceof tb?Npi(t):t instanceof IN?Dpi(t):t}function Npi(t){let e=Ppi(t),n=pA.generate(t.statusCode,e,t.message,t.headers);return AZ(n,"body",t.body),AZ(n,"contentType",t.contentType),AZ(n,"rawResponse",t.rawResponse),AZ(n,"statusCode",t.statusCode),AZ(n,"cause",t),n}function Dpi(t){return t instanceof Jbe?new V7e({message:t.message}):t instanceof Kbe?new j7e({message:t.message}):t instanceof Xbe?new K3({message:t.message,cause:t}):new K3({message:t.message,cause:t})}function Ppi(t){let e=arn(t,"data$");if(e&&typeof e=="object")return e;try{let r=JSON.parse(t.body);if(r&&typeof r=="object")return r}catch{}let n=arn(t,"error");return n&&typeof n=="object"?n:void 0}function arn(t,e){return t&&typeof t=="object"?t[e]:void 0}function crn(t){if(!t)return"";try{return JSON.stringify(t)}catch{return String(t)}}function Mpi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Opi(t){return typeof t=="object"&&t!==null?pA.prototype.isPrototypeOf(t):!1}function AZ(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!1})}function Lpi(t){let e=new H7e;t.registerBeforeCreateRequestHook(e),t.registerBeforeRequestHook(e)}function lrn(t){return{ok:!0,value:t}}function Nv(t){return{ok:!1,error:t}}function GKe(t){return btoa(String.fromCodePoint(...t))}function Fpi(t){return new TextEncoder().encode(t)}function Qpi(t){return GKe(Fpi(t))}function Va(t,e){let n=/\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;return function(i={}){return t.replace(n,function(s,o){if(!Upi.call(i,o))throw new Error(`Parameter '${o}' is required`);let a=i[o];if(typeof a!="string"&&typeof a!="number")throw new Error(`Parameter '${o}' must be a string or number`);return`${a}`}).replace(/^\/+/,"")}}function Gpi(t){var e;let n=t.server_url,r={};if(!n){let s=(e=t.server_idx)!==null&&e!==void 0?e:0;if(s<0||s>=urn.length)throw new Error(`Invalid server index ${s}`);n=urn[s]||""}let i=Va(n)(r);return new URL(i)}function Wpi(...t){let e=[];for(let n of t)n&&e.push(n);switch(e.length){case 0:case 1:return e[0]||null;default:return"any"in AbortSignal&&typeof AbortSignal.any=="function"?AbortSignal.any(e):Hpi(e)}}function Hpi(t){let e=new AbortController,n=e.signal;if(!t.length)return e.signal;if(t.length===1)return t[0]||e.signal;for(let o of t)if(o.aborted)return o;function r(){e.abort(this.reason),s()}let i=[];function s(){for(let o of i){let a=o.deref();a&&a.removeEventListener("abort",r)}}for(let o of t)i.push(new WeakRef(o)),o.addEventListener("abort",r);return n}function sc(t){let e={};for(let[n,r]of Object.entries(t))typeof r<"u"&&(e[n]=r);return e}function wN(t){if(t===null||typeof t!="object"||Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);if(e===null||e===Object.prototype)return!0;try{return Object.getPrototypeOf(e)===null}catch{return!1}}function qpi(t){return(e,n,r)=>{let i="",s=r?.explode?oin(e,n):[[e,n]];if(s.every(([u,l])=>l==null))return;let o=u=>r?.charEncoding==="percent"?encodeURIComponent(u):u,a=u=>o(ain(u)),c=o(t);return s.forEach(([u,l])=>{var d,m;let h="",f=null;l!=null&&(Array.isArray(l)?f=(d=lin(l,g=>`${a(g)}`))===null||d===void 0?void 0:d.join(c):wN(l)?f=(m=uin(Object.entries(l),([g,A])=>`${o(g)}${c}${a(A)}`))===null||m===void 0?void 0:m.join(c):f=`${a(l)}`,f!=null&&(h=`${o(u)}=${f}`,!(!h||h==="=")&&(i+=`&${h}`)))}),i.slice(1)}}function Lv(t,e,n){if(typeof e>"u")return;let r=s=>n?.charEncoding==="percent"?encodeURIComponent(s):s,i=r(JSON.stringify(e,cin));return n?.explode?i:`${r(t)}=${i}`}function oin(t,e){return Array.isArray(e)?e.map(n=>[t,n]):wN(e)?Object.entries(e??{}).map(([r,i])=>[r,i]):[[t,e]]}function ain(t){return t==null?"":t instanceof Date?t.toISOString():t instanceof Uint8Array?GKe(t):typeof t=="object"?JSON.stringify(t,cin):`${t}`}function cin(t,e){return e instanceof Uint8Array?GKe(e):e}function lin(t,e){let n=t.reduce((r,i)=>{if(i==null)return r;let s=e(i);return s==null||r.push(s),r},[]);return n.length?n:null}function uin(t,e){let n=[];for(let[r,i]of t){if(i==null)continue;let s=e([r,i]);s!=null&&n.push(s)}return n.length?n:null}function jpi(...t){return t.filter(Boolean).join("&")}function Vpi(t){return function(n,r){var i,s,o;let a=Object.assign(Object.assign({},r),{explode:(i=r?.explode)!==null&&i!==void 0?i:!0,charEncoding:(s=r?.charEncoding)!==null&&s!==void 0?s:"percent"}),c=new Set((o=r?.allowEmptyValue)!==null&&o!==void 0?o:[]),u=Object.entries(n).map(([l,d])=>c.has(l)&&(d==null||d===""||Array.isArray(d)&&d.length===0)?`${encodeURIComponent(l)}=`:t(l,d,a));return jpi(...u)}}function $3(t,e){var n;if(e==="*")return!0;let r=((n=t.headers.get("content-type"))===null||n===void 0?void 0:n.trim())||"application/octet-stream";r=r.toLowerCase();let i=e.toLowerCase().trim().split(drn),[s="",...o]=i;if(s.split("/").length!==2)return!1;let a=r.split(drn),[c="",...u]=a,[l="",d=""]=c.split("/");if(!l||!d||s!=="*/*"&&c!==s&&`${l}/*`!==s&&`*/${d}`!==s||u.length{let s=`${i}`;if(s==="default")return!0;if(!zpi.test(`${s}`))return s===n;let o=s.charAt(0);if(!o)throw new Error("Invalid status code range");let a=n.charAt(0);if(!a)throw new Error(`Invalid response status code: ${n}`);return a===o}):!1}function Kpi(t,e,n){return La(t,e)&&$3(t,n)}function din(t){if(typeof t!="object"||t==null)return!1;let e=t instanceof TypeError&&t.message.toLowerCase().startsWith("failed to fetch"),n=t instanceof TypeError&&t.message.toLowerCase().startsWith("fetch failed"),r="name"in t&&t.name==="ConnectionError",i="code"in t&&typeof t.code=="string"&&t.code.toLowerCase()==="econnreset";return e||n||i||r}function pin(t){if(typeof t!="object"||t==null)return!1;let e="name"in t&&t.name==="TimeoutError",n="code"in t&&t.code===23,r="code"in t&&typeof t.code=="string"&&t.code.toLowerCase()==="econnaborted";return e||n||r}function Jpi(t){if(typeof t!="object"||t==null)return!1;let e="name"in t&&t.name==="AbortError",n="code"in t&&t.code===20,r="code"in t&&typeof t.code=="string"&&t.code.toLowerCase()==="econnaborted";return e||n||r}async function Xpi(t,e){var n;switch(e.config.strategy){case"backoff":return tmi(mrn(t,{statusCodes:e.statusCodes,retryConnectionErrors:!!e.config.retryConnectionErrors}),(n=e.config.backoff)!==null&&n!==void 0?n:prn);case"attempt-count-backoff":return nmi(mrn(t,{statusCodes:e.statusCodes,retryConnectionErrors:!!e.config.retryConnectionErrors}),Object.assign(Object.assign({},prn),e.config.backoff),e.config);default:return await t(0)}}function mrn(t,e){return async n=>{try{let r=await t(n);if(emi(r,e.statusCodes))throw new TN("Response failed with retryable status code",r);return r}catch(r){throw r instanceof TN||e.retryConnectionErrors&&(pin(r)||din(r))?r:new xZ("Permanent error",{cause:r})}}}function emi(t,e){let n=`${t.status}`;return e.some(r=>{if(!Zpi.test(r))return r===n;let i=r.charAt(0);if(!i)throw new Error("Invalid status code range");let s=n.charAt(0);if(!s)throw new Error(`Invalid response status code: ${n}`);return s===i})}async function tmi(t,e){let{maxElapsedTime:n,initialInterval:r,exponent:i,maxInterval:s}=e,o=Date.now(),a=0;for(;;)try{return await t(a)}catch(c){if(c instanceof xZ)throw c.cause;if(Date.now()-o>n){if(c instanceof TN)return c.response;throw c}let l=0;c instanceof TN&&(l=min(c.response)),l<=0&&(l=r*Math.pow(a,i)+Math.random()*1e3);let d=Math.min(l,s);await hin(d),a++}}async function nmi(t,e,n){let r=0;for(;;)try{return await t(r)}catch(i){if(i instanceof xZ)throw i.cause;if(r>=n.maxRetries){if(i instanceof TN)return i.response;throw i}let s=0;i instanceof TN&&(s=min(i.response)),s<=0&&(s=e.initialInterval*Math.pow(e.exponent,r)*(1-Math.random()*.25));let o=Math.min(s,e.maxInterval);await hin(o),r++}}function min(t){let e=t.headers.get("retry-after-ms");if(e){let s=Number(e);if(Number.isFinite(s)&&s>=0)return s}let n=t.headers.get("retry-after")||"";if(!n)return 0;let r=Number(n);if(Number.isInteger(r))return r*1e3;let i=Date.parse(n);if(Number.isInteger(i)){let s=i-Date.now();return s>0?Math.ceil(s):0}return 0}async function hin(t){return new Promise(e=>setTimeout(e,t))}async function smi(t,e){if(!t)return;let n=e.headers.get("content-type"),r=n?.split(";")[0]||"";t.group(`> Request: ${e.method} ${e.url}`),t.group("Headers:");for(let[i,s]of e.headers.entries())t.log(`${i}: ${s}`);switch(t.groupEnd(),t.group("Body:"),!0){case fin.test(r):t.log(await e.clone().json());break;case r.startsWith("text/"):t.log(await e.clone().text());break;case r==="multipart/form-data":{let i=await e.clone().formData();for(let[s,o]of i){let a=o instanceof Blob?"":o;t.log(`${s}: ${a}`)}break}default:t.log(`<${n}>`);break}t.groupEnd(),t.groupEnd()}async function omi(t,e,n){if(!t)return;let r=e.headers.get("content-type"),i=r?.split(";")[0]||"";t.group(`< Response: ${n.method} ${n.url}`),t.log("Status Code:",e.status,e.statusText),t.group("Headers:");for(let[s,o]of e.headers.entries())t.log(`${s}: ${o}`);switch(t.groupEnd(),t.group("Body:"),!0){case($3(e,"application/json")||fin.test(i)&&!hrn.test(i)):t.log(await e.clone().json());break;case($3(e,"application/jsonl")||hrn.test(i)):case $3(e,"text/event-stream"):t.log(`<${r}>`);break;case $3(e,"text/*"):t.log(await e.clone().text());break;case $3(e,"multipart/form-data"):{let s=await e.clone().formData();for(let[o,a]of s){let c=a instanceof Blob?"":a;t.log(`${o}: ${c}`)}break}default:t.log(`<${r}>`);break}t.groupEnd(),t.groupEnd()}function frn(t){try{return JSON.parse(t)}catch{return t}}function ami(t,e={}){var n,r;let i=e.flattened===!0,s=(n=e.sentinel)!==null&&n!==void 0?n:"";return new rKe(t,o=>s!==""&&o.data===s?{done:!0,value:void 0}:i?{done:!1,value:o.data==null?void 0:frn(o.data)}:{done:!1,value:Object.assign(Object.assign({},o),{data:o.data==null?o.data:frn(o.data)})},{dataRequired:(r=e.dataRequired)!==null&&r!==void 0?r:!0})}function lmi(t,e,n){for(let r=n;re)continue;let s=!0;for(let o=0;o0&&(d=u.slice(0,l),m=u[l+1]===" "?u.slice(l+2):u.slice(l+1)),d==="data"?o.push(m):d==="event"?a.event=m:d==="id"&&!m.includes("\0")?n.eventId=m:d==="retry"&&/^\d+$/.test(m)&&(a.retry=Number(m))}if(!c){if(a.id=n.eventId,o.length)a.data=o.join(` +`);else if(r)return;return e(a)}}function vN(t,e,n){return Object.assign(Object.assign({},n),{err:!0,enc:"json",codes:t,errorClass:e})}function Mc(t,e){return Object.assign(Object.assign({},e),{enc:"json",codes:t})}function Ain(t,e,n){return Object.assign(Object.assign(Object.assign({},n),{enc:"sse",codes:t}),e?{sse:e}:{})}function pmi(t,e){return Object.assign(Object.assign({},e),{enc:"nil",codes:t})}function ns(t){return{enc:"fail",codes:t}}function oc(...t){return async function(n,r,i){let s,o;for(let m of t){let{codes:h}=m,f="ctype"in m?m.ctype:dmi[m.enc];if(f&&Kpi(n,h,f)){o=m;break}else if(!f&&La(n,h)){o=m;break}}if(!o)return[{ok:!1,error:new e_e("Unexpected Status or Content-Type",{response:n,request:r,body:await n.text().catch(()=>"")})},s];let a=o.enc,c="";switch(a){case"json":c=await n.text();try{s=JSON.parse(c)}catch(m){if(!("err"in o))throw m;s=c}break;case"jsonl":s=n.body;break;case"bytes":s=new Uint8Array(await n.arrayBuffer());break;case"stream":s=n.body;break;case"text":c=await n.text(),s=c;break;case"sse":if(n.body){let m="sse"in o&&o.sse||{};s=ami(n.body,m)}else s=null;break;case"nil":c=await n.text(),s=void 0;break;case"fail":c=await n.text(),s=c;break;default:throw new Error(`Unsupported response type: ${a}`)}if(o.enc==="fail")return[{ok:!1,error:new e_e("API error occurred",{request:r,response:n,body:c})},s];let u=o.key||i?.resultKey,l,d=o.hdrs?{headers:hmi(n.headers)}:null;return"err"in o?l=Object.assign(Object.assign(Object.assign({},i?.extraFields),d),wN(s)?s:null):u?l=Object.assign(Object.assign(Object.assign({},i?.extraFields),d),{[u]:s}):o.hdrs?l=Object.assign(Object.assign(Object.assign({},i?.extraFields),d),wN(s)?s:null):l=s,"err"in o?[{ok:!1,error:o.errorClass?new o.errorClass(l,{request:r,response:n,body:c}):l},s]:[{ok:!0,value:l},s]}}function hmi(t){let e={};for(let[n,r]of t.entries())e[n]=r.split(mmi);return e}function fmi(...t){let e={basic:{},headers:{},queryParams:{},cookies:{},oauth2:{type:"none"}},n=t.find(r=>r.every(i=>{if(i.value==null)return!1;if(i.type==="http:basic")return i.value.username!=null||i.value.password!=null;if(i.type==="http:custom")return null;if(i.type==="oauth2:password")return typeof i.value=="string"&&!!i.value;if(i.type==="oauth2:client_credentials")return typeof i.value=="string"?!!i.value:i.value.client_id!=null||i.value.client_secret!=null;if(typeof i.value=="string")return!!i.value;throw new Error(`Unrecognized security type: ${i.type} (value type: ${typeof i.value})`)}));return n==null?null:(n.forEach(r=>{if(r.value==null)return;let{type:i}=r;switch(i){case"apiKey:header":e.headers[r.fieldName]=r.value;break;case"apiKey:query":e.queryParams[r.fieldName]=r.value;break;case"apiKey:cookie":e.cookies[r.fieldName]=r.value;break;case"http:basic":gmi(e,r);break;case"http:custom":break;case"http:bearer":Bbe(e,r);break;case"oauth2":Bbe(e,r);break;case"oauth2:password":Bbe(e,r);break;case"oauth2:client_credentials":break;case"openIdConnect":Bbe(e,r);break;default:throw iKe.unrecognizedType(i)}}),e)}function gmi(t,e){e.value!=null&&(t.basic=e.value)}function Bbe(t,e){if(typeof e.value!="string"||!e.value)return;let n=e.value;n.slice(0,7).toLowerCase()!=="bearer "&&(n=`Bearer ${n}`),e.fieldName!==void 0&&(t.headers[e.fieldName]=n)}function ac(t,e){var n,r;let i=[[{fieldName:"accessToken",type:"http:custom",value:(n=t?.access_token)!==null&&n!==void 0?n:_Z().GOOGLE_GENAI_ACCESS_TOKEN},{fieldName:"apiKey",type:"http:custom",value:(r=t?.api_key)!==null&&r!==void 0?r:_Z().GOOGLE_GENAI_API_KEY},{fieldName:"defaultHeaders",type:"http:custom",value:t?.default_headers}]];return fmi(...i)}async function cc(t){if(t!=null)return typeof t=="function"?t():t}function ic(t){let e=t.$inspect(),n=e.then(([i,s])=>{if(!i.ok)throw i.error;return[i.value,s]}),r=e.then(([i,s])=>{var o;if(!i.ok&&!(!((o=s.response)===null||o===void 0)&&o.ok))throw i.error;return s});return n.catch(()=>{}),r.catch(()=>{}),new Ea(n,r)}function Ein(t,e,n,r){return new Ea(Ami(t,e,n,r))}async function Ami(t,e,n,r){var i,s,o;let c={body:e,api_version:n},u=Lv("body",c.body,{explode:!0}),l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/agents")(l),m=new Headers(sc({"Content-Type":"application/json",Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"CreateAgent",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"POST",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function bin(t,e,n,r){return new Ea(ymi(t,e,n,r))}async function ymi(t,e,n,r){var i,s,o;let c={id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",c.id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/agents/{id}")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"DeleteAgent",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"DELETE",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function _in(t,e,n,r){return new Ea(Emi(t,e,n,r))}async function Emi(t,e,n,r){var i,s,o;let c={id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",c.id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/agents/{id}")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"GetAgent",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"GET",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function xin(t,e,n,r,i,s){return new Ea(bmi(t,e,n,r,i,s))}async function bmi(t,e,n,r,i,s){var o,a,c;let l={api_version:e,page_size:n,page_token:r,parent:i},d=null,m={api_version:ts("api_version",(o=l?.api_version)!==null&&o!==void 0?o:t._options.api_version,{explode:!1,charEncoding:"percent"})},h=Va("/{api_version}/agents")(m),f=RN({page_size:l?.page_size,page_token:l?.page_token,parent:l?.parent}),g=new Headers(sc({Accept:"application/json"})),A=await cc(t._options.security),y=ac(A),E={options:t._options,base_url:(c=(a=s?.server_url)!==null&&a!==void 0?a:t._baseURL)!==null&&c!==void 0?c:"",operation_id:"ListAgents",o_auth2_scopes:null,resolved_security:y,security_source:t._options.security,retry_config:s?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:s?.retry_codes||["408","409","429","5XX"]},_=t._createRequest(E,{security:y,method:"GET",baseURL:s?.server_url,path:h,headers:g,query:f,body:d,userAgent:t._options.user_agent,timeout_ms:s?.timeout_ms||t._options.timeout_ms||-1},s);if(!_.ok)return[_,{status:"invalid"}];let S=_.value,C=await t._do(S,{context:E,isErrorStatusCode:k=>La({status:k},["4XX","5XX"]),retryConfig:E.retry_config,retryCodes:E.retry_codes});if(!C.ok)return[C,{status:"request-error",request:S}];let I=C.value,[w]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(I,S);return w.ok?[w,{status:"complete",request:S,response:I}]:[w,{status:"complete",request:S,response:I}]}function Sin(t,e,n,r){return new Ea(_mi(t,e,n,r))}async function _mi(t,e,n,r){var i,s,o;let c={body:e,api_version:n},u=Lv("body",c.body,{explode:!0}),l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/environments")(l),m=new Headers(sc({"Content-Type":"application/json",Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"CreateEnvironment",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"POST",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function Cin(t,e,n,r){return new Ea(xmi(t,e,n,r))}async function xmi(t,e,n,r){var i,s,o;let c={id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",c.id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/environments/{id}")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"DeleteEnvironment",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"DELETE",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function Iin(t,e,n,r){return new Ea(Smi(t,e,n,r))}async function Smi(t,e,n,r){var i,s,o;let c={id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",c.id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/environments/{id}")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"GetEnvironment",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"GET",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function win(t,e,n,r,i){return new Ea(Cmi(t,e,n,r,i))}async function Cmi(t,e,n,r,i){var s,o,a;let u={api_version:e,page_size:n,page_token:r},l=null,d={api_version:ts("api_version",(s=u?.api_version)!==null&&s!==void 0?s:t._options.api_version,{explode:!1,charEncoding:"percent"})},m=Va("/{api_version}/environments")(d),h=RN({page_size:u?.page_size,page_token:u?.page_token}),f=new Headers(sc({Accept:"application/json"})),g=await cc(t._options.security),A=ac(g),y={options:t._options,base_url:(a=(o=i?.server_url)!==null&&o!==void 0?o:t._baseURL)!==null&&a!==void 0?a:"",operation_id:"ListEnvironments",o_auth2_scopes:null,resolved_security:A,security_source:t._options.security,retry_config:i?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:i?.retry_codes||["408","409","429","5XX"]},E=t._createRequest(y,{security:A,method:"GET",baseURL:i?.server_url,path:m,headers:f,query:h,body:l,userAgent:t._options.user_agent,timeout_ms:i?.timeout_ms||t._options.timeout_ms||-1},i);if(!E.ok)return[E,{status:"invalid"}];let _=E.value,S=await t._do(_,{context:y,isErrorStatusCode:w=>La({status:w},["4XX","5XX"]),retryConfig:y.retry_config,retryCodes:y.retry_codes});if(!S.ok)return[S,{status:"request-error",request:_}];let C=S.value,[I]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(C,_);return I.ok?[I,{status:"complete",request:_,response:C}]:[I,{status:"complete",request:_,response:C}]}function Tin(t,e,n,r,i,s,o,a){return new Ea(Imi(t,e,n,r,i,s,o,a))}async function Imi(t,e,n,r,i,s,o,a){var c,u,l;let m={environment:e,path:n,api_version:r,page_size:i,page_token:s,recursive:o},h=null,f={api_version:ts("api_version",(c=m.api_version)!==null&&c!==void 0?c:t._options.api_version,{explode:!1,charEncoding:"percent"}),environment:ts("environment",m.environment,{explode:!1,charEncoding:"percent"}),path:ts("path",m.path,{explode:!1,charEncoding:"percent"})},g=Va("/{api_version}/environments/{environment}/files/{path}")(f),A=RN({page_size:m.page_size,page_token:m.page_token,recursive:m.recursive}),y=new Headers(sc({Accept:"application/json"})),E=await cc(t._options.security),_=ac(E),S={options:t._options,base_url:(l=(u=a?.server_url)!==null&&u!==void 0?u:t._baseURL)!==null&&l!==void 0?l:"",operation_id:"GetEnvironmentFiles",o_auth2_scopes:null,resolved_security:_,security_source:t._options.security,retry_config:a?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:a?.retry_codes||["408","409","429","5XX"]},C=t._createRequest(S,{security:_,method:"GET",baseURL:a?.server_url,path:g,headers:y,query:A,body:h,userAgent:t._options.user_agent,timeout_ms:a?.timeout_ms||t._options.timeout_ms||-1},a);if(!C.ok)return[C,{status:"invalid"}];let I=C.value,w=await t._do(I,{context:S,isErrorStatusCode:O=>La({status:O},["4XX","5XX"]),retryConfig:S.retry_config,retryCodes:S.retry_codes});if(!w.ok)return[w,{status:"request-error",request:I}];let k=w.value,[N]=await oc(Mc(200),ns("4XX"),ns("5XX"))(k,I);return N.ok?[N,{status:"complete",request:I,response:k}]:[N,{status:"complete",request:I,response:k}]}function vin(t,e,n,r){return new Ea(wmi(t,e,n,r))}async function wmi(t,e,n,r){var i,s,o;let c={id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",c.id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/interactions/{id}/cancel")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"cancelInteractionById",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"POST",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:I=>La({status:I},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,S={httpMeta:{response:_,request:y}},[C]=await oc(Mc(200),vN("4XX",lKe),vN("5XX",cKe))(_,y,{extraFields:S});return C.ok?[C,{status:"complete",request:y,response:_}]:[C,{status:"complete",request:y,response:_}]}function Rin(t,e,n,r){return new Ea(Tmi(t,e,n,r))}async function Tmi(t,e,n,r){var i,s,o,a;let c={body:e,api_version:n},u=c,l=Lv("body",u.body,{explode:!0}),d={api_version:ts("api_version",(i=u.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"})},m=Va("/{api_version}/interactions")(d),h=new Headers(sc({"Content-Type":"application/json",Accept:!((s=c?.body)===null||s===void 0)&&s.stream?"text/event-stream":"application/json"})),f=await cc(t._options.security),g=ac(f),A={options:t._options,base_url:(a=(o=r?.server_url)!==null&&o!==void 0?o:t._baseURL)!==null&&a!==void 0?a:"",operation_id:"CreateInteraction",o_auth2_scopes:null,resolved_security:g,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},y=t._createRequest(A,{security:g,method:"POST",baseURL:r?.server_url,path:m,headers:h,body:l,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!y.ok)return[y,{status:"invalid"}];let E=y.value,_=await t._do(E,{context:A,isErrorStatusCode:w=>La({status:w},["4XX","5XX"]),retryConfig:A.retry_config,retryCodes:A.retry_codes});if(!_.ok)return[_,{status:"request-error",request:E}];let S=_.value,C={httpMeta:{response:S,request:E}},[I]=await oc(Mc(200),Ain(200,{sentinel:"[DONE]",flattened:!0}),vN("4XX",dKe),vN("5XX",uKe))(S,E,{extraFields:C});return I.ok?[I,{status:"complete",request:E,response:S}]:[I,{status:"complete",request:E,response:S}]}function vmi(t,e,n,r){return new Ea(Rmi(t,e,n,r))}async function Rmi(t,e,n,r){var i,s,o;let c={id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",c.id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/interactions/{id}")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"deleteInteraction",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"DELETE",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:I=>La({status:I},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,S={httpMeta:{response:_,request:y}},[C]=await oc(pmi(200),vN("4XX",mKe),vN("5XX",pKe))(_,y,{extraFields:S});return C.ok?[C,{status:"complete",request:y,response:_}]:[C,{status:"complete",request:y,response:_}]}function kin(t,e,n,r,i,s,o){return new Ea(kmi(t,e,n,r,i,s,o))}async function kmi(t,e,n,r,i,s,o){var a,c,u;let l={id:e,api_version:n,include_input:r,last_event_id:i,stream:s},d=l,m=null,h={api_version:ts("api_version",(a=d.api_version)!==null&&a!==void 0?a:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",d.id,{explode:!1,charEncoding:"percent"})},f=Va("/{api_version}/interactions/{id}")(h),g=RN({include_input:d.include_input,last_event_id:d.last_event_id,stream:d.stream}),A=new Headers(sc({Accept:l?.stream?"text/event-stream":"application/json"})),y=await cc(t._options.security),E=ac(y),_={options:t._options,base_url:(u=(c=o?.server_url)!==null&&c!==void 0?c:t._baseURL)!==null&&u!==void 0?u:"",operation_id:"getInteractionById",o_auth2_scopes:null,resolved_security:E,security_source:t._options.security,retry_config:o?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:o?.retry_codes||["408","409","429","5XX"]},S=t._createRequest(_,{security:E,method:"GET",baseURL:o?.server_url,path:f,headers:A,query:g,body:m,userAgent:t._options.user_agent,timeout_ms:o?.timeout_ms||t._options.timeout_ms||-1},o);if(!S.ok)return[S,{status:"invalid"}];let C=S.value,I=await t._do(C,{context:_,isErrorStatusCode:O=>La({status:O},["4XX","5XX"]),retryConfig:_.retry_config,retryCodes:_.retry_codes});if(!I.ok)return[I,{status:"request-error",request:C}];let w=I.value,k={httpMeta:{response:w,request:C}},[N]=await oc(Mc(200),Ain(200,{sentinel:"[DONE]",flattened:!0}),vN("4XX",fKe),vN("5XX",hKe))(w,C,{extraFields:k});return N.ok?[N,{status:"complete",request:C,response:w}]:[N,{status:"complete",request:C,response:w}]}function Bin(t,e,n,r){return new Ea(Bmi(t,e,n,r))}async function Bmi(t,e,n,r){var i,s,o;let c={body:e,api_version:n},u=Lv("body",c.body,{explode:!0}),l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/triggers")(l),m=new Headers(sc({"Content-Type":"application/json",Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"CreateTrigger",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"POST",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(Mc(200),ns("4XX"),ns("5XX"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function Nin(t,e,n,r){return new Ea(Nmi(t,e,n,r))}async function Nmi(t,e,n,r){var i,s,o;let c={id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",c.id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/triggers/{id}")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"DeleteTrigger",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"DELETE",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(Mc(200),ns("4XX"),ns("5XX"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function Din(t,e,n,r){return new Ea(Dmi(t,e,n,r))}async function Dmi(t,e,n,r){var i,s,o;let c={id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",c.id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/triggers/{id}")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"GetTrigger",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"GET",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(Mc(200),ns("4XX"),ns("5XX"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function Pin(t,e,n,r,i,s){return new Ea(Pmi(t,e,n,r,i,s))}async function Pmi(t,e,n,r,i,s){var o,a,c;let l={trigger_id:e,api_version:n,page_size:r,page_token:i},d=null,m={api_version:ts("api_version",(o=l.api_version)!==null&&o!==void 0?o:t._options.api_version,{explode:!1,charEncoding:"percent"}),trigger_id:ts("trigger_id",l.trigger_id,{explode:!1,charEncoding:"percent"})},h=Va("/{api_version}/triggers/{trigger_id}/executions")(m),f=RN({page_size:l.page_size,page_token:l.page_token}),g=new Headers(sc({Accept:"application/json"})),A=await cc(t._options.security),y=ac(A),E={options:t._options,base_url:(c=(a=s?.server_url)!==null&&a!==void 0?a:t._baseURL)!==null&&c!==void 0?c:"",operation_id:"ListTriggerExecutions",o_auth2_scopes:null,resolved_security:y,security_source:t._options.security,retry_config:s?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:s?.retry_codes||["408","409","429","5XX"]},_=t._createRequest(E,{security:y,method:"GET",baseURL:s?.server_url,path:h,headers:g,query:f,body:d,userAgent:t._options.user_agent,timeout_ms:s?.timeout_ms||t._options.timeout_ms||-1},s);if(!_.ok)return[_,{status:"invalid"}];let S=_.value,C=await t._do(S,{context:E,isErrorStatusCode:k=>La({status:k},["4XX","5XX"]),retryConfig:E.retry_config,retryCodes:E.retry_codes});if(!C.ok)return[C,{status:"request-error",request:S}];let I=C.value,[w]=await oc(Mc(200),ns("4XX"),ns("5XX"))(I,S);return w.ok?[w,{status:"complete",request:S,response:I}]:[w,{status:"complete",request:S,response:I}]}function Min(t,e,n,r,i,s){return new Ea(Mmi(t,e,n,r,i,s))}async function Mmi(t,e,n,r,i,s){var o,a,c;let l={api_version:e,filter:n,page_size:r,page_token:i},d=null,m={api_version:ts("api_version",(o=l?.api_version)!==null&&o!==void 0?o:t._options.api_version,{explode:!1,charEncoding:"percent"})},h=Va("/{api_version}/triggers")(m),f=RN({filter:l?.filter,page_size:l?.page_size,page_token:l?.page_token}),g=new Headers(sc({Accept:"application/json"})),A=await cc(t._options.security),y=ac(A),E={options:t._options,base_url:(c=(a=s?.server_url)!==null&&a!==void 0?a:t._baseURL)!==null&&c!==void 0?c:"",operation_id:"ListTriggers",o_auth2_scopes:null,resolved_security:y,security_source:t._options.security,retry_config:s?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:s?.retry_codes||["408","409","429","5XX"]},_=t._createRequest(E,{security:y,method:"GET",baseURL:s?.server_url,path:h,headers:g,query:f,body:d,userAgent:t._options.user_agent,timeout_ms:s?.timeout_ms||t._options.timeout_ms||-1},s);if(!_.ok)return[_,{status:"invalid"}];let S=_.value,C=await t._do(S,{context:E,isErrorStatusCode:k=>La({status:k},["4XX","5XX"]),retryConfig:E.retry_config,retryCodes:E.retry_codes});if(!C.ok)return[C,{status:"request-error",request:S}];let I=C.value,[w]=await oc(Mc(200),ns("4XX"),ns("5XX"))(I,S);return w.ok?[w,{status:"complete",request:S,response:I}]:[w,{status:"complete",request:S,response:I}]}function Oin(t,e,n,r){return new Ea(Omi(t,e,n,r))}async function Omi(t,e,n,r){var i,s,o;let c={trigger_id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),trigger_id:ts("trigger_id",c.trigger_id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/triggers/{trigger_id}/executions")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"RunTrigger",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"POST",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(Mc(200),ns("4XX"),ns("5XX"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function Lin(t,e,n,r,i){return new Ea(Lmi(t,e,n,r,i))}async function Lmi(t,e,n,r,i){var s,o,a;let u={id:e,body:n,api_version:r},l=Lv("body",u.body,{explode:!0}),d={api_version:ts("api_version",(s=u.api_version)!==null&&s!==void 0?s:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",u.id,{explode:!1,charEncoding:"percent"})},m=Va("/{api_version}/triggers/{id}")(d),h=new Headers(sc({"Content-Type":"application/json",Accept:"application/json"})),f=await cc(t._options.security),g=ac(f),A={options:t._options,base_url:(a=(o=i?.server_url)!==null&&o!==void 0?o:t._baseURL)!==null&&a!==void 0?a:"",operation_id:"UpdateTrigger",o_auth2_scopes:null,resolved_security:g,security_source:t._options.security,retry_config:i?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:i?.retry_codes||["408","409","429","5XX"]},y=t._createRequest(A,{security:g,method:"PATCH",baseURL:i?.server_url,path:m,headers:h,body:l,userAgent:t._options.user_agent,timeout_ms:i?.timeout_ms||t._options.timeout_ms||-1},i);if(!y.ok)return[y,{status:"invalid"}];let E=y.value,_=await t._do(E,{context:A,isErrorStatusCode:I=>La({status:I},["4XX","5XX"]),retryConfig:A.retry_config,retryCodes:A.retry_codes});if(!_.ok)return[_,{status:"request-error",request:E}];let S=_.value,[C]=await oc(Mc(200),ns("4XX"),ns("5XX"))(S,E);return C.ok?[C,{status:"complete",request:E,response:S}]:[C,{status:"complete",request:E,response:S}]}function Fin(t,e,n,r){return new Ea(Fmi(t,e,n,r))}async function Fmi(t,e,n,r){var i,s,o;let c={body:e,api_version:n},u=Lv("body",c.body,{explode:!0}),l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/webhooks")(l),m=new Headers(sc({"Content-Type":"application/json",Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"CreateWebhook",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"POST",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function Qin(t,e,n,r){return new Ea(Qmi(t,e,n,r))}async function Qmi(t,e,n,r){var i,s,o;let c={id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",c.id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/webhooks/{id}")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"DeleteWebhook",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"DELETE",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function Uin(t,e,n,r){return new Ea(Umi(t,e,n,r))}async function Umi(t,e,n,r){var i,s,o;let c={id:e,api_version:n},u=null,l={api_version:ts("api_version",(i=c.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",c.id,{explode:!1,charEncoding:"percent"})},d=Va("/{api_version}/webhooks/{id}")(l),m=new Headers(sc({Accept:"application/json"})),h=await cc(t._options.security),f=ac(h),g={options:t._options,base_url:(o=(s=r?.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&o!==void 0?o:"",operation_id:"GetWebhook",o_auth2_scopes:null,resolved_security:f,security_source:t._options.security,retry_config:r?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:r?.retry_codes||["408","409","429","5XX"]},A=t._createRequest(g,{security:f,method:"GET",baseURL:r?.server_url,path:d,headers:m,body:u,userAgent:t._options.user_agent,timeout_ms:r?.timeout_ms||t._options.timeout_ms||-1},r);if(!A.ok)return[A,{status:"invalid"}];let y=A.value,E=await t._do(y,{context:g,isErrorStatusCode:C=>La({status:C},["4XX","5XX"]),retryConfig:g.retry_config,retryCodes:g.retry_codes});if(!E.ok)return[E,{status:"request-error",request:y}];let _=E.value,[S]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(_,y);return S.ok?[S,{status:"complete",request:y,response:_}]:[S,{status:"complete",request:y,response:_}]}function Gin(t,e,n,r,i){return new Ea(Gmi(t,e,n,r,i))}async function Gmi(t,e,n,r,i){var s,o,a;let u={api_version:e,page_size:n,page_token:r},l=null,d={api_version:ts("api_version",(s=u?.api_version)!==null&&s!==void 0?s:t._options.api_version,{explode:!1,charEncoding:"percent"})},m=Va("/{api_version}/webhooks")(d),h=RN({page_size:u?.page_size,page_token:u?.page_token}),f=new Headers(sc({Accept:"application/json"})),g=await cc(t._options.security),A=ac(g),y={options:t._options,base_url:(a=(o=i?.server_url)!==null&&o!==void 0?o:t._baseURL)!==null&&a!==void 0?a:"",operation_id:"ListWebhooks",o_auth2_scopes:null,resolved_security:A,security_source:t._options.security,retry_config:i?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:i?.retry_codes||["408","409","429","5XX"]},E=t._createRequest(y,{security:A,method:"GET",baseURL:i?.server_url,path:m,headers:f,query:h,body:l,userAgent:t._options.user_agent,timeout_ms:i?.timeout_ms||t._options.timeout_ms||-1},i);if(!E.ok)return[E,{status:"invalid"}];let _=E.value,S=await t._do(_,{context:y,isErrorStatusCode:w=>La({status:w},["4XX","5XX"]),retryConfig:y.retry_config,retryCodes:y.retry_codes});if(!S.ok)return[S,{status:"request-error",request:_}];let C=S.value,[I]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(C,_);return I.ok?[I,{status:"complete",request:_,response:C}]:[I,{status:"complete",request:_,response:C}]}function $in(t,e,n,r,i){return new Ea($mi(t,e,n,r,i))}async function $mi(t,e,n,r,i){var s,o,a;let u={id:e,api_version:n,body:r},l=Lv("body",u.body,{explode:!0}),d={api_version:ts("api_version",(s=u.api_version)!==null&&s!==void 0?s:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",u.id,{explode:!1,charEncoding:"percent"})},m=Va("/{api_version}/webhooks/{id}:ping")(d),h=new Headers(sc({"Content-Type":"application/json",Accept:"application/json"})),f=await cc(t._options.security),g=ac(f),A={options:t._options,base_url:(a=(o=i?.server_url)!==null&&o!==void 0?o:t._baseURL)!==null&&a!==void 0?a:"",operation_id:"PingWebhook",o_auth2_scopes:null,resolved_security:g,security_source:t._options.security,retry_config:i?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:i?.retry_codes||["408","409","429","5XX"]},y=t._createRequest(A,{security:g,method:"POST",baseURL:i?.server_url,path:m,headers:h,body:l,userAgent:t._options.user_agent,timeout_ms:i?.timeout_ms||t._options.timeout_ms||-1},i);if(!y.ok)return[y,{status:"invalid"}];let E=y.value,_=await t._do(E,{context:A,isErrorStatusCode:I=>La({status:I},["4XX","5XX"]),retryConfig:A.retry_config,retryCodes:A.retry_codes});if(!_.ok)return[_,{status:"request-error",request:E}];let S=_.value,[C]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(S,E);return C.ok?[C,{status:"complete",request:E,response:S}]:[C,{status:"complete",request:E,response:S}]}function Win(t,e,n,r,i){return new Ea(Wmi(t,e,n,r,i))}async function Wmi(t,e,n,r,i){var s,o,a;let u={id:e,api_version:n,body:r},l=Lv("body",u.body,{explode:!0}),d={api_version:ts("api_version",(s=u.api_version)!==null&&s!==void 0?s:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",u.id,{explode:!1,charEncoding:"percent"})},m=Va("/{api_version}/webhooks/{id}:rotateSigningSecret")(d),h=new Headers(sc({"Content-Type":"application/json",Accept:"application/json"})),f=await cc(t._options.security),g=ac(f),A={options:t._options,base_url:(a=(o=i?.server_url)!==null&&o!==void 0?o:t._baseURL)!==null&&a!==void 0?a:"",operation_id:"RotateSigningSecret",o_auth2_scopes:null,resolved_security:g,security_source:t._options.security,retry_config:i?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:i?.retry_codes||["408","409","429","5XX"]},y=t._createRequest(A,{security:g,method:"POST",baseURL:i?.server_url,path:m,headers:h,body:l,userAgent:t._options.user_agent,timeout_ms:i?.timeout_ms||t._options.timeout_ms||-1},i);if(!y.ok)return[y,{status:"invalid"}];let E=y.value,_=await t._do(E,{context:A,isErrorStatusCode:I=>La({status:I},["4XX","5XX"]),retryConfig:A.retry_config,retryCodes:A.retry_codes});if(!_.ok)return[_,{status:"request-error",request:E}];let S=_.value,[C]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(S,E);return C.ok?[C,{status:"complete",request:E,response:S}]:[C,{status:"complete",request:E,response:S}]}function Hin(t,e,n,r,i,s){return new Ea(Hmi(t,e,n,r,i,s))}async function Hmi(t,e,n,r,i,s){var o,a,c;let l={id:e,api_version:n,update_mask:r,body:i},d=Lv("body",l.body,{explode:!0}),m={api_version:ts("api_version",(o=l.api_version)!==null&&o!==void 0?o:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:ts("id",l.id,{explode:!1,charEncoding:"percent"})},h=Va("/{api_version}/webhooks/{id}")(m),f=RN({update_mask:l.update_mask}),g=new Headers(sc({"Content-Type":"application/json",Accept:"application/json"})),A=await cc(t._options.security),y=ac(A),E={options:t._options,base_url:(c=(a=s?.server_url)!==null&&a!==void 0?a:t._baseURL)!==null&&c!==void 0?c:"",operation_id:"UpdateWebhook",o_auth2_scopes:null,resolved_security:y,security_source:t._options.security,retry_config:s?.retries||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:s?.retry_codes||["408","409","429","5XX"]},_=t._createRequest(E,{security:y,method:"PATCH",baseURL:s?.server_url,path:h,headers:g,query:f,body:d,userAgent:t._options.user_agent,timeout_ms:s?.timeout_ms||t._options.timeout_ms||-1},s);if(!_.ok)return[_,{status:"invalid"}];let S=_.value,C=await t._do(S,{context:E,isErrorStatusCode:k=>La({status:k},["4XX","5XX"]),retryConfig:E.retry_config,retryCodes:E.retry_codes});if(!C.ok)return[C,{status:"request-error",request:S}];let I=C.value,[w]=await oc(ns("4XX"),ns("5XX"),Mc("default"))(I,S);return w.ok?[w,{status:"complete",request:S,response:I}]:[w,{status:"complete",request:S,response:I}]}function Vmi(t){let e=t.getBaseUrl();if(!e)throw new Error("Base URL must be set.");return e.replace(/\/+$/,"")}function Ymi(t){let e=zmi(t.getApiVersion()),n=t.getProject(),r=t.getLocation();return t.isVertexAI()&&e&&n&&r?`${e}/projects/${encodeURIComponent(n)}/locations/${encodeURIComponent(r)}`:e}function vI(t,e={}){var n,r,i,s,o;return new qmi(Object.assign(Object.assign({},e),{api_version:(n=e.api_version)!==null&&n!==void 0?n:Ymi(t),security:(r=e.security)!==null&&r!==void 0?r:new W7e({defaultHeaders:Object.assign(Object.assign({},(i=t.getDefaultHeaders)===null||i===void 0?void 0:i.call(t)),(s=t.getHeaders)===null||s===void 0?void 0:s.call(t)),getAuthHeaders:c=>t.getAuthHeaders(c)}),server_url:(o=e.server_url)!==null&&o!==void 0?o:Vmi(t)}))}function zmi(t){return t.replace(/^\/+|\/+$/g,"")}function Oa(t,e=!1){var n,r,i,s;if(!t&&!e)return;let o=t??{},{timeout:a,maxRetries:c,defaultBaseURL:u,query:l,body:d,fetchOptions:m}=o,h=Oh(o,["timeout","maxRetries","defaultBaseURL","query","body","fetchOptions"]),f=Object.assign({},h);t_e(l)?f.extra_query=l:Arn("query",l),t_e(d)?f.extra_body=d:Arn("body",d);let g=(n=h.fetch_options)!==null&&n!==void 0?n:m;g&&(f.fetch_options=g);let A=(r=h.server_url)!==null&&r!==void 0?r:u;A&&(f.server_url=A);let y=(i=h.timeout_ms)!==null&&i!==void 0?i:a;if(y!==void 0&&(f.timeout_ms=y),c!==void 0&&(f.retries={strategy:"attempt-count-backoff",retryConnectionErrors:!0,maxRetries:c}),e){let E=new Headers((s=f.headers)!==null&&s!==void 0?s:g?.headers);E.set("Accept","text/event-stream"),f.headers=E}return f}function Arn(t,e){e!=null&&console.warn(`GoogleGenAI.interactions: request option ${t} is not supported by the Google GenAI interactions bridge and will be ignored.`)}async function Pc(t){let[e,n]=await t.$inspect();if(!e.ok)throw q3(e.error);return Kmi(e.value,n)}async function n7e(t){try{return await t()}catch(e){throw q3(e)}}function yrn(t){let e=t;return new Proxy(t,{get(n,r){if(r!==Symbol.asyncIterator){let i=Reflect.get(n,r,n);return typeof i=="function"?i.bind(n):i}return function(){let s=e[Symbol.asyncIterator]();return{async next(...o){try{return await s.next(...o)}catch(a){throw q3(a)}},async return(o){if(!s.return)return{done:!0,value:o};try{return await s.return(o)}catch(a){throw q3(a)}},async throw(o){if(!s.throw)throw q3(o);try{return await s.throw(o)}catch(a){throw q3(a)}},[Symbol.asyncIterator](){return this}}}}})}function Kmi(t,e){return!t_e(t)||e.status!=="complete"?t:Object.assign(Object.assign({},t),{sdkHttpResponse:Jmi(e.response,t)})}function Jmi(t,e){let n={};for(let[r,i]of t.headers.entries())n[r]=i;return{headers:n,responseInternal:t,json:async()=>e}}function r7e(t){let e=Xmi(t);return e?ehi(e):t}function Xmi(t){if(t_e(t)){if(Array.isArray(t.steps))return t;if(Zmi(t)){let e=t.outputs;if(Array.isArray(e)){let{outputs:n}=t,r=Oh(t,["outputs"]);return Object.assign(Object.assign({},r),{steps:[{type:"model_output",content:e}]})}}return Object.assign(Object.assign({},t),{steps:[]})}}function Zmi(t){let e=t.model;return typeof e=="string"&&jmi.has(e)}function t_e(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function ehi(t){var e,n;let r=thi(t),i=(e=r.steps)!==null&&e!==void 0?e:[],s=[],o=!1;e:for(let d=i.length-1;d>=0;d--){let m=i[d];if(m.type==="user_input")break;if(m.type!=="model_output"||!m.content){if(o)break;continue}let h=m.content;for(let f=h.length-1;f>=0;f--){let g=h[f];if(g.type==="text")o=!0,s.push((n=g.text)!==null&&n!==void 0?n:"");else if(o)break e}}let a,c,u;for(let d=i.length-1;d>=0;d--){let m=i[d];if(m.type==="user_input")break;if(m.type==="model_output"&&m.content)for(let h=m.content.length-1;h>=0;h--){let f=m.content[h];f.type==="image"&&!a&&(a=f),f.type==="audio"&&!c&&(c=f),f.type==="video"&&!u&&(u=f)}}let l=s.reverse().join("");return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),l&&{output_text:l}),a?{output_image:a}:{}),c?{output_audio:c}:{}),u?{output_video:u}:{})}function thi(t){return Object.assign(Object.assign({},t),{created:Ern(t.created),updated:Ern(t.updated)})}function Ern(t){return t instanceof Date?t.toISOString():t}function nhi(t){let e;if(t){if(e=t,e.scopes){if(typeof e.scopes=="string"&&e.scopes!==yZ||Array.isArray(e.scopes)&&e.scopes.indexOf(yZ)<0)throw new Error(`Invalid auth scopes. Scopes must include: ${yZ}`)}else return e.scopes=[yZ],e;return e}else return e={scopes:[yZ]},e}async function rhi(t,e){var n,r,i;let s=UKe(t.file);if(s!==void 0)return await e.request({path:`files/${s}:download`,httpMethod:"GET",queryParams:{alt:"media"},httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal});if(Mrn(t.file)){let o=(i=t.file.video)===null||i===void 0?void 0:i.videoBytes;if(typeof o=="string")return o;throw new Error("Failed to download generated video, Uri or videoBytes not found.")}else if(Orn(t.file)){let o=t.file.videoBytes;if(typeof o=="string")return o;throw new Error("Failed to download video, Uri or videoBytes not found.")}else throw new Error("Unsupported file type")}function ihi(t,e){let n={},r=D(t,["name"]);return r!=null&&M(n,["_url","name"],r),n}function shi(t,e){let n={},r=D(t,["name"]);return r!=null&&M(n,["_url","name"],r),n}function ohi(t,e){let n={},r=D(t,["sdkHttpResponse"]);return r!=null&&M(n,["sdkHttpResponse"],r),n}function ahi(t,e){let n={},r=D(t,["sdkHttpResponse"]);return r!=null&&M(n,["sdkHttpResponse"],r),n}function RKe(t,e){let n={},r=D(t,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>bhi(o))),M(n,["parts"],s)}let i=D(t,["role"]);return i!=null&&M(n,["role"],i),n}function chi(t,e,n){let r={};if(D(t,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let i=D(t,["tunedModelDisplayName"]);if(e!==void 0&&i!=null&&M(e,["displayName"],i),D(t,["description"])!==void 0)throw new Error("description parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let s=D(t,["epochCount"]);e!==void 0&&s!=null&&M(e,["tuningTask","hyperparameters","epochCount"],s);let o=D(t,["learningRateMultiplier"]);if(o!=null&&M(r,["tuningTask","hyperparameters","learningRateMultiplier"],o),D(t,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["tuningMode"])!==void 0)throw new Error("tuningMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["customBaseModel"])!==void 0)throw new Error("customBaseModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let a=D(t,["batchSize"]);e!==void 0&&a!=null&&M(e,["tuningTask","hyperparameters","batchSize"],a);let c=D(t,["learningRate"]);if(e!==void 0&&c!=null&&M(e,["tuningTask","hyperparameters","learningRate"],c),D(t,["labels"])!==void 0)throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["beta"])!==void 0)throw new Error("beta parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["baseTeacherModel"])!==void 0)throw new Error("baseTeacherModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["tunedTeacherModelSource"])!==void 0)throw new Error("tunedTeacherModelSource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["sftLossWeightMultiplier"])!==void 0)throw new Error("sftLossWeightMultiplier parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["outputUri"])!==void 0)throw new Error("outputUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["rewardConfig"])!==void 0)throw new Error("rewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["compositeRewardConfig"])!==void 0)throw new Error("compositeRewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["samplesPerPrompt"])!==void 0)throw new Error("samplesPerPrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["evaluateInterval"])!==void 0)throw new Error("evaluateInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["checkpointInterval"])!==void 0)throw new Error("checkpointInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["maxOutputTokens"])!==void 0)throw new Error("maxOutputTokens parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["thinkingLevel"])!==void 0)throw new Error("thinkingLevel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["validationDatasetUri"])!==void 0)throw new Error("validationDatasetUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["encryptionSpec"])!==void 0)throw new Error("encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return r}function lhi(t,e,n){let r={},i=D(n,["config","method"]);if(i===void 0&&(i="SUPERVISED_FINE_TUNING"),i==="SUPERVISED_FINE_TUNING"){let q=D(t,["validationDataset"]);e!==void 0&&q!=null&&M(e,["supervisedTuningSpec"],Nbe(q))}else if(i==="PREFERENCE_TUNING"){let q=D(t,["validationDataset"]);e!==void 0&&q!=null&&M(e,["preferenceOptimizationSpec"],Nbe(q))}else if(i==="DISTILLATION"){let q=D(t,["validationDataset"]);e!==void 0&&q!=null&&M(e,["distillationSpec"],Nbe(q))}else if(i==="REINFORCEMENT_TUNING"){let q=D(t,["validationDataset"]);e!==void 0&&q!=null&&M(e,["reinforcementTuningSpec"],Nbe(q))}let s=D(t,["tunedModelDisplayName"]);e!==void 0&&s!=null&&M(e,["tunedModelDisplayName"],s);let o=D(t,["description"]);e!==void 0&&o!=null&&M(e,["description"],o);let a=D(n,["config","method"]);if(a===void 0&&(a="SUPERVISED_FINE_TUNING"),a==="SUPERVISED_FINE_TUNING"){let q=D(t,["epochCount"]);e!==void 0&&q!=null&&M(e,["supervisedTuningSpec","hyperParameters","epochCount"],q)}else if(a==="PREFERENCE_TUNING"){let q=D(t,["epochCount"]);e!==void 0&&q!=null&&M(e,["preferenceOptimizationSpec","hyperParameters","epochCount"],q)}else if(a==="DISTILLATION"){let q=D(t,["epochCount"]);e!==void 0&&q!=null&&M(e,["distillationSpec","hyperParameters","epochCount"],q)}else if(a==="REINFORCEMENT_TUNING"){let q=D(t,["epochCount"]);e!==void 0&&q!=null&&M(e,["reinforcementTuningSpec","hyperParameters","epochCount"],q)}let c=D(n,["config","method"]);if(c===void 0&&(c="SUPERVISED_FINE_TUNING"),c==="SUPERVISED_FINE_TUNING"){let q=D(t,["learningRateMultiplier"]);e!==void 0&&q!=null&&M(e,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],q)}else if(c==="PREFERENCE_TUNING"){let q=D(t,["learningRateMultiplier"]);e!==void 0&&q!=null&&M(e,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],q)}else if(c==="DISTILLATION"){let q=D(t,["learningRateMultiplier"]);e!==void 0&&q!=null&&M(e,["distillationSpec","hyperParameters","learningRateMultiplier"],q)}else if(c==="REINFORCEMENT_TUNING"){let q=D(t,["learningRateMultiplier"]);e!==void 0&&q!=null&&M(e,["reinforcementTuningSpec","hyperParameters","learningRateMultiplier"],q)}let u=D(n,["config","method"]);if(u===void 0&&(u="SUPERVISED_FINE_TUNING"),u==="SUPERVISED_FINE_TUNING"){let q=D(t,["exportLastCheckpointOnly"]);e!==void 0&&q!=null&&M(e,["supervisedTuningSpec","exportLastCheckpointOnly"],q)}else if(u==="PREFERENCE_TUNING"){let q=D(t,["exportLastCheckpointOnly"]);e!==void 0&&q!=null&&M(e,["preferenceOptimizationSpec","exportLastCheckpointOnly"],q)}else if(u==="DISTILLATION"){let q=D(t,["exportLastCheckpointOnly"]);e!==void 0&&q!=null&&M(e,["distillationSpec","exportLastCheckpointOnly"],q)}let l=D(n,["config","method"]);if(l===void 0&&(l="SUPERVISED_FINE_TUNING"),l==="SUPERVISED_FINE_TUNING"){let q=D(t,["adapterSize"]);e!==void 0&&q!=null&&M(e,["supervisedTuningSpec","hyperParameters","adapterSize"],q)}else if(l==="PREFERENCE_TUNING"){let q=D(t,["adapterSize"]);e!==void 0&&q!=null&&M(e,["preferenceOptimizationSpec","hyperParameters","adapterSize"],q)}else if(l==="DISTILLATION"){let q=D(t,["adapterSize"]);e!==void 0&&q!=null&&M(e,["distillationSpec","hyperParameters","adapterSize"],q)}else if(l==="REINFORCEMENT_TUNING"){let q=D(t,["adapterSize"]);e!==void 0&&q!=null&&M(e,["reinforcementTuningSpec","hyperParameters","adapterSize"],q)}let d=D(n,["config","method"]);if(d===void 0&&(d="SUPERVISED_FINE_TUNING"),d==="SUPERVISED_FINE_TUNING"){let q=D(t,["tuningMode"]);e!==void 0&&q!=null&&M(e,["supervisedTuningSpec","tuningMode"],q)}else if(d==="DISTILLATION"){let q=D(t,["tuningMode"]);e!==void 0&&q!=null&&M(e,["distillationSpec","tuningMode"],q)}let m=D(t,["customBaseModel"]);e!==void 0&&m!=null&&M(e,["customBaseModel"],m);let h=D(n,["config","method"]);if(h===void 0&&(h="SUPERVISED_FINE_TUNING"),h==="SUPERVISED_FINE_TUNING"){let q=D(t,["batchSize"]);e!==void 0&&q!=null&&M(e,["supervisedTuningSpec","hyperParameters","batchSize"],q)}else if(h==="DISTILLATION"){let q=D(t,["batchSize"]);e!==void 0&&q!=null&&M(e,["distillationSpec","hyperParameters","batchSize"],q)}else if(h==="REINFORCEMENT_TUNING"){let q=D(t,["batchSize"]);e!==void 0&&q!=null&&M(e,["reinforcementTuningSpec","hyperParameters","batchSize"],q)}let f=D(n,["config","method"]);if(f===void 0&&(f="SUPERVISED_FINE_TUNING"),f==="SUPERVISED_FINE_TUNING"){let q=D(t,["learningRate"]);e!==void 0&&q!=null&&M(e,["supervisedTuningSpec","hyperParameters","learningRate"],q)}else if(f==="DISTILLATION"){let q=D(t,["learningRate"]);e!==void 0&&q!=null&&M(e,["distillationSpec","hyperParameters","learningRate"],q)}let g=D(t,["labels"]);e!==void 0&&g!=null&&M(e,["labels"],g);let A=D(t,["beta"]);e!==void 0&&A!=null&&M(e,["preferenceOptimizationSpec","hyperParameters","beta"],A);let y=D(t,["baseTeacherModel"]);e!==void 0&&y!=null&&M(e,["distillationSpec","baseTeacherModel"],y);let E=D(t,["tunedTeacherModelSource"]);e!==void 0&&E!=null&&M(e,["distillationSpec","tunedTeacherModelSource"],E);let _=D(t,["sftLossWeightMultiplier"]);e!==void 0&&_!=null&&M(e,["distillationSpec","hyperParameters","sftLossWeightMultiplier"],_);let S=D(t,["outputUri"]);e!==void 0&&S!=null&&M(e,["outputUri"],S);let C=D(t,["rewardConfig"]);e!==void 0&&C!=null&&M(e,["reinforcementTuningSpec","singleRewardConfig"],C);let I=D(t,["compositeRewardConfig"]);e!==void 0&&I!=null&&M(e,["reinforcementTuningSpec","compositeRewardConfig"],I);let w=D(t,["samplesPerPrompt"]);e!==void 0&&w!=null&&M(e,["reinforcementTuningSpec","hyperParameters","samplesPerPrompt"],w);let k=D(t,["evaluateInterval"]);e!==void 0&&k!=null&&M(e,["reinforcementTuningSpec","hyperParameters","evaluateInterval"],k);let N=D(t,["checkpointInterval"]);e!==void 0&&N!=null&&M(e,["reinforcementTuningSpec","hyperParameters","checkpointInterval"],N);let O=D(t,["maxOutputTokens"]);e!==void 0&&O!=null&&M(e,["reinforcementTuningSpec","hyperParameters","maxOutputTokens"],O);let W=D(t,["thinkingLevel"]);e!==void 0&&W!=null&&M(e,["reinforcementTuningSpec","hyperParameters","thinkingLevel"],W);let $=D(t,["validationDatasetUri"]);e!==void 0&&$!=null&&M(e,["reinforcementTuningSpec","validationDatasetUri"],$);let G=D(t,["encryptionSpec"]);return e!==void 0&&G!=null&&M(e,["encryptionSpec"],G),r}function uhi(t,e){let n={},r=D(t,["baseModel"]);r!=null&&M(n,["baseModel"],r);let i=D(t,["preTunedModel"]);i!=null&&M(n,["preTunedModel"],i);let s=D(t,["trainingDataset"]);s!=null&&Shi(s);let o=D(t,["config"]);return o!=null&&chi(o,n),n}function dhi(t,e){let n={},r=D(t,["baseModel"]);r!=null&&M(n,["baseModel"],r);let i=D(t,["preTunedModel"]);i!=null&&M(n,["preTunedModel"],i);let s=D(t,["trainingDataset"]);s!=null&&Chi(s,n,e);let o=D(t,["config"]);return o!=null&&lhi(o,n,e),n}function qin(t,e){let n={},r=D(t,["epochCount"]);r!=null&&M(n,["epochCount"],r);let i=D(t,["learningRateMultiplier"]);i!=null&&M(n,["learningRateMultiplier"],i);let s=D(t,["adapterSize"]);s!=null&&M(n,["adapterSize"],s);let o=D(t,["batchSize"]);o!=null&&M(n,["batchSize"],o);let a=D(t,["learningRate"]);a!=null&&M(n,["learningRate"],a);let c=D(t,["generationConfig"]);return c!=null&&M(n,["generationConfig"],hhi(c)),n}function phi(t,e){let n={},r=D(t,["promptDatasetUri"]);r!=null&&M(n,["promptDatasetUri"],r);let i=D(t,["validationDatasetUri"]);i!=null&&M(n,["validationDatasetUri"],i);let s=D(t,["baseTeacherModel"]);s!=null&&M(n,["baseTeacherModel"],s);let o=D(t,["tunedTeacherModelSource"]);o!=null&&M(n,["tunedTeacherModelSource"],o);let a=D(t,["hyperparameters"]);return a!=null&&M(n,["hyperparameters"],qin(a)),n}function mhi(t,e){let n={},r=D(t,["baseTeacherModel"]);r!=null&&M(n,["baseTeacherModel"],r);let i=D(t,["hyperParameters"]);i!=null&&M(n,["hyperParameters"],qin(i));let s=D(t,["pipelineRootDirectory"]);s!=null&&M(n,["pipelineRootDirectory"],s);let o=D(t,["promptDatasetUri"]);o!=null&&M(n,["promptDatasetUri"],o);let a=D(t,["studentModel"]);a!=null&&M(n,["studentModel"],a);let c=D(t,["trainingDatasetUri"]);c!=null&&M(n,["trainingDatasetUri"],c);let u=D(t,["tunedTeacherModelSource"]);u!=null&&M(n,["tunedTeacherModelSource"],u);let l=D(t,["tuningMode"]);l!=null&&M(n,["tuningMode"],l);let d=D(t,["validationDatasetUri"]);return d!=null&&M(n,["validationDatasetUri"],d),n}function hhi(t,e){let n={},r=D(t,["modelConfig"]);r!=null&&M(n,["modelSelectionConfig"],r);let i=D(t,["responseJsonSchema"]);i!=null&&M(n,["responseJsonSchema"],i);let s=D(t,["audioTranscriptionConfig"]);s!=null&&M(n,["audioTranscriptionConfig"],s);let o=D(t,["audioTimestamp"]);o!=null&&M(n,["audioTimestamp"],o);let a=D(t,["candidateCount"]);a!=null&&M(n,["candidateCount"],a);let c=D(t,["enableAffectiveDialog"]);c!=null&&M(n,["enableAffectiveDialog"],c);let u=D(t,["frequencyPenalty"]);u!=null&&M(n,["frequencyPenalty"],u);let l=D(t,["logprobs"]);l!=null&&M(n,["logprobs"],l);let d=D(t,["maxOutputTokens"]);d!=null&&M(n,["maxOutputTokens"],d);let m=D(t,["mediaResolution"]);m!=null&&M(n,["mediaResolution"],m);let h=D(t,["presencePenalty"]);h!=null&&M(n,["presencePenalty"],h);let f=D(t,["responseFormat"]);if(f!=null){let W=f;Array.isArray(W)&&(W=W.map($=>$)),M(n,["responseFormat"],W)}let g=D(t,["responseLogprobs"]);g!=null&&M(n,["responseLogprobs"],g);let A=D(t,["responseMimeType"]);A!=null&&M(n,["responseMimeType"],A);let y=D(t,["responseModalities"]);y!=null&&M(n,["responseModalities"],y);let E=D(t,["responseSchema"]);E!=null&&M(n,["responseSchema"],E);let _=D(t,["routingConfig"]);_!=null&&M(n,["routingConfig"],_);let S=D(t,["seed"]);S!=null&&M(n,["seed"],S);let C=D(t,["speechConfig"]);C!=null&&M(n,["speechConfig"],C);let I=D(t,["stopSequences"]);I!=null&&M(n,["stopSequences"],I);let w=D(t,["temperature"]);w!=null&&M(n,["temperature"],w);let k=D(t,["thinkingConfig"]);k!=null&&M(n,["thinkingConfig"],k);let N=D(t,["topK"]);N!=null&&M(n,["topK"],N);let O=D(t,["topP"]);return O!=null&&M(n,["topP"],O),n}function fhi(t,e){let n={},r=D(t,["name"]);return r!=null&&M(n,["_url","name"],r),n}function ghi(t,e){let n={},r=D(t,["name"]);return r!=null&&M(n,["_url","name"],r),n}function Ahi(t,e,n){let r={},i=D(t,["pageSize"]);e!==void 0&&i!=null&&M(e,["_query","pageSize"],i);let s=D(t,["pageToken"]);e!==void 0&&s!=null&&M(e,["_query","pageToken"],s);let o=D(t,["filter"]);return e!==void 0&&o!=null&&M(e,["_query","filter"],o),r}function yhi(t,e){let n={},r=D(t,["config"]);return r!=null&&Ahi(r,n),n}function Ehi(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["nextPageToken"]);i!=null&&M(n,["nextPageToken"],i);let s=D(t,["tuningJobs"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>kKe(a))),M(n,["tuningJobs"],o)}return n}function bhi(t,e){let n={},r=D(t,["mediaResolution"]);if(r!=null&&M(n,["mediaResolution"],r),D(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(D(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let i=D(t,["audioTranscription"]);i!=null&&M(n,["audioTranscription"],i);let s=D(t,["codeExecutionResult"]);s!=null&&M(n,["codeExecutionResult"],s);let o=D(t,["executableCode"]);o!=null&&M(n,["executableCode"],o);let a=D(t,["fileData"]);a!=null&&M(n,["fileData"],a);let c=D(t,["functionCall"]);c!=null&&M(n,["functionCall"],c);let u=D(t,["functionResponse"]);u!=null&&M(n,["functionResponse"],u);let l=D(t,["inlineData"]);l!=null&&M(n,["inlineData"],l);let d=D(t,["text"]);d!=null&&M(n,["text"],d);let m=D(t,["thought"]);m!=null&&M(n,["thought"],m);let h=D(t,["thoughtSignature"]);h!=null&&M(n,["thoughtSignature"],h);let f=D(t,["videoMetadata"]);if(f!=null&&M(n,["videoMetadata"],f),D(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let g=D(t,["mediaProcessing"]);return g!=null&&M(n,["mediaProcessing"],g),n}function _hi(t,e){let n={},r=D(t,["references"]);r!=null&&M(n,["references"],r);let i=D(t,["contents"]);if(i!=null){let o=i;Array.isArray(o)&&(o=o.map(a=>RKe(a))),M(n,["contents"],o)}let s=D(t,["systemInstruction"]);return s!=null&&M(n,["systemInstruction"],RKe(s)),n}function xhi(t,e){let n={},r=D(t,["name"]);r!=null&&M(n,["model"],r);let i=D(t,["name"]);return i!=null&&M(n,["endpoint"],i),n}function Shi(t,e){let n={};if(D(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(D(t,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=D(t,["examples"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),M(n,["examples","examples"],i)}return n}function Chi(t,e,n){let r={},i=D(n,["config","method"]);if(i===void 0&&(i="SUPERVISED_FINE_TUNING"),i==="SUPERVISED_FINE_TUNING"){let o=D(t,["gcsUri"]);e!==void 0&&o!=null&&M(e,["supervisedTuningSpec","trainingDatasetUri"],o)}else if(i==="PREFERENCE_TUNING"){let o=D(t,["gcsUri"]);e!==void 0&&o!=null&&M(e,["preferenceOptimizationSpec","trainingDatasetUri"],o)}else if(i==="DISTILLATION"){let o=D(t,["gcsUri"]);e!==void 0&&o!=null&&M(e,["distillationSpec","promptDatasetUri"],o)}else if(i==="REINFORCEMENT_TUNING"){let o=D(t,["gcsUri"]);e!==void 0&&o!=null&&M(e,["reinforcementTuningSpec","trainingDatasetUri"],o)}let s=D(n,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){let o=D(t,["vertexDatasetResource"]);e!==void 0&&o!=null&&M(e,["supervisedTuningSpec","trainingDatasetUri"],o)}else if(s==="PREFERENCE_TUNING"){let o=D(t,["vertexDatasetResource"]);e!==void 0&&o!=null&&M(e,["preferenceOptimizationSpec","trainingDatasetUri"],o)}else if(s==="DISTILLATION"){let o=D(t,["vertexDatasetResource"]);e!==void 0&&o!=null&&M(e,["distillationSpec","promptDatasetUri"],o)}else if(s==="REINFORCEMENT_TUNING"){let o=D(t,["vertexDatasetResource"]);e!==void 0&&o!=null&&M(e,["reinforcementTuningSpec","trainingDatasetUri"],o)}if(D(t,["examples"])!==void 0)throw new Error("examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return r}function Ihi(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["name"]);i!=null&&M(n,["name"],i);let s=D(t,["state"]);s!=null&&M(n,["state"],Prn(s));let o=D(t,["createTime"]);o!=null&&M(n,["createTime"],o);let a=D(t,["tuningTask","startTime"]);a!=null&&M(n,["startTime"],a);let c=D(t,["tuningTask","completeTime"]);c!=null&&M(n,["endTime"],c);let u=D(t,["updateTime"]);u!=null&&M(n,["updateTime"],u);let l=D(t,["description"]);l!=null&&M(n,["description"],l);let d=D(t,["baseModel"]);d!=null&&M(n,["baseModel"],d);let m=D(t,["_self"]);return m!=null&&M(n,["tunedModel"],xhi(m)),n}function kKe(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["name"]);i!=null&&M(n,["name"],i);let s=D(t,["state"]);s!=null&&M(n,["state"],Prn(s));let o=D(t,["createTime"]);o!=null&&M(n,["createTime"],o);let a=D(t,["startTime"]);a!=null&&M(n,["startTime"],a);let c=D(t,["endTime"]);c!=null&&M(n,["endTime"],c);let u=D(t,["updateTime"]);u!=null&&M(n,["updateTime"],u);let l=D(t,["error"]);l!=null&&M(n,["error"],l);let d=D(t,["description"]);d!=null&&M(n,["description"],d);let m=D(t,["baseModel"]);m!=null&&M(n,["baseModel"],m);let h=D(t,["tunedModel"]);h!=null&&M(n,["tunedModel"],h);let f=D(t,["preTunedModel"]);f!=null&&M(n,["preTunedModel"],f);let g=D(t,["supervisedTuningSpec"]);g!=null&&M(n,["supervisedTuningSpec"],g);let A=D(t,["preferenceOptimizationSpec"]);A!=null&&M(n,["preferenceOptimizationSpec"],A);let y=D(t,["distillationSamplingSpec"]);y!=null&&M(n,["distillationSamplingSpec"],phi(y));let E=D(t,["distillationSpec"]);E!=null&&M(n,["distillationSpec"],mhi(E));let _=D(t,["reinforcementTuningSpec"]);_!=null&&M(n,["reinforcementTuningSpec"],_);let S=D(t,["tuningDataStats"]);S!=null&&M(n,["tuningDataStats"],S);let C=D(t,["encryptionSpec"]);C!=null&&M(n,["encryptionSpec"],C);let I=D(t,["partnerModelTuningSpec"]);I!=null&&M(n,["partnerModelTuningSpec"],I);let w=D(t,["customBaseModel"]);w!=null&&M(n,["customBaseModel"],w);let k=D(t,["evaluateDatasetRuns"]);if(k!=null){let Ae=k;Array.isArray(Ae)&&(Ae=Ae.map(De=>De)),M(n,["evaluateDatasetRuns"],Ae)}let N=D(t,["experiment"]);N!=null&&M(n,["experiment"],N);let O=D(t,["fullFineTuningSpec"]);O!=null&&M(n,["fullFineTuningSpec"],O);let W=D(t,["labels"]);W!=null&&M(n,["labels"],W);let $=D(t,["outputUri"]);$!=null&&M(n,["outputUri"],$);let G=D(t,["pipelineJob"]);G!=null&&M(n,["pipelineJob"],G);let q=D(t,["serviceAccount"]);q!=null&&M(n,["serviceAccount"],q);let ce=D(t,["tunedModelDisplayName"]);ce!=null&&M(n,["tunedModelDisplayName"],ce);let Y=D(t,["tuningJobMetadata"]);Y!=null&&M(n,["tuningJobMetadata"],Y);let z=D(t,["tuningJobState"]);z!=null&&M(n,["tuningJobState"],z);let j=D(t,["veoLoraTuningSpec"]);j!=null&&M(n,["veoLoraTuningSpec"],j);let se=D(t,["veoTuningSpec"]);return se!=null&&M(n,["veoTuningSpec"],se),n}function whi(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["name"]);i!=null&&M(n,["name"],i);let s=D(t,["metadata"]);s!=null&&M(n,["metadata"],s);let o=D(t,["done"]);o!=null&&M(n,["done"],o);let a=D(t,["error"]);return a!=null&&M(n,["error"],a),n}function Nbe(t,e){let n={},r=D(t,["gcsUri"]);r!=null&&M(n,["validationDatasetUri"],r);let i=D(t,["vertexDatasetResource"]);return i!=null&&M(n,["validationDatasetUri"],i),n}function Thi(t,e){let n={},r=D(t,["parent"]);r!=null&&M(n,["_url","parent"],r);let i=D(t,["sampleResponse"]);i!=null&&M(n,["sampleResponse"],RKe(i));let s=D(t,["example"]);s!=null&&M(n,["example"],_hi(s));let o=D(t,["singleRewardConfig"]);o!=null&&M(n,["singleRewardConfig"],o);let a=D(t,["compositeRewardConfig"]);return a!=null&&M(n,["compositeRewardConfig"],a),n}function vhi(t,e){let n={},r=D(t,["sdkHttpResponse"]);r!=null&&M(n,["sdkHttpResponse"],r);let i=D(t,["overallReward"]);i!=null&&M(n,["overallReward"],i);let s=D(t,["error"]);s!=null&&M(n,["error"],s);let o=D(t,["rewardInfoDetails"]);return o!=null&&M(n,["rewardInfoDetails"],o),n}async function Rhi(t,e,n,r){var i;let s=await Kin(t,e,n,r),o=await s?.json();if(((i=s?.headers)===null||i===void 0?void 0:i[bN])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return o.file}async function khi(t,e,n,r){var i;let s=await Kin(t,e,n,r),o=await s?.json();if(((i=s?.headers)===null||i===void 0?void 0:i[bN])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");let a=MKe(o),c=new jbe;return Object.assign(c,a),c}async function Kin(t,e,n,r){var i,s,o;let a=e,c=r?.baseUrl||((i=n.clientOptions.httpOptions)===null||i===void 0?void 0:i.baseUrl);if(c){let h=new URL(c),f=new URL(e);f.protocol=h.protocol,f.host=h.host,f.port=h.port,a=f.toString()}let u=0,l=0,d=new CN(new Response),m="upload";for(u=t.size;l=u&&(m+=", finalize");let g=0,A=Yin;for(;gsetTimeout(e,t))}function Dhi(t){var e;if(t&&(t.enterprise!==void 0||t.vertexai!==void 0)){if(t.enterprise!==void 0&&t.vertexai!==void 0&&t.enterprise!==t.vertexai)throw new Error("enterprise and vertexAI flags have conflicting values, please set enterprise value only.");return(e=t.enterprise)!==null&&e!==void 0?e:t.vertexai}let n=_N("GOOGLE_GENAI_USE_ENTERPRISE"),r=_N("GOOGLE_GENAI_USE_VERTEXAI"),i=_rn(n),s=_rn(r);return n!==void 0&&r!==void 0&&i!==s&&console.warn("Warning: Both GOOGLE_GENAI_USE_ENTERPRISE and GOOGLE_GENAI_USE_VERTEXAI are set with conflicting values. The value of GOOGLE_GENAI_USE_ENTERPRISE will be used."),n!==void 0?i:r!==void 0?s:!1}function _N(t){var e,n,r;return(r=(n=(e=process==null?void 0:process.env)===null||e===void 0?void 0:e[t])===null||n===void 0?void 0:n.trim())!==null&&r!==void 0?r:void 0}function _rn(t){return t===void 0?!1:t.toLowerCase()==="true"}function Phi(){let t=_N("GOOGLE_API_KEY"),e=_N("GEMINI_API_KEY");return t&&e&&console.warn("Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY."),t||e||void 0}var xrn,Srn,Crn,n_e,Irn,wrn,Trn,vrn,woi,Toi,vx,vtn,Rtn,ktn,EN,Btn,Ntn,Dtn,Ptn,Mtn,Otn,Ltn,Ftn,xN,Qtn,Utn,Gtn,$tn,Wtn,SN,nd,Htn,qtn,jtn,Vtn,Ytn,ztn,Ktn,Jtn,Mbe,Xtn,Ztn,enn,tnn,nnn,rnn,inn,snn,s7e,onn,ann,cnn,lnn,unn,dnn,pnn,mnn,hnn,fnn,gnn,bZ,Ann,Obe,ynn,Enn,bnn,_nn,xnn,Snn,Cnn,Inn,wnn,Tnn,vnn,Rnn,knn,Bnn,Nnn,Dnn,Pnn,Mnn,Onn,Lnn,Fnn,Qnn,Unn,Gnn,$nn,W3,CN,y2,Lbe,o7e,a7e,c7e,l7e,u7e,Fbe,Qbe,Ube,d7e,Gbe,p7e,$be,m7e,Wbe,Hbe,h7e,f7e,g7e,A7e,y7e,E7e,b7e,_7e,qbe,x7e,S7e,jbe,Dv,Pv,w7e,T7e,v7e,R7e,Ybe,Uci,Sdi,Cdi,Idi,N7e,wdi,Tdi,vdi,Rdi,kdi,Ddi,Pdi,Mdi,Odi,Ldi,Fdi,D7e,Udi,Gdi,P7e,M7e,O7e,Vdi,L7e,zdi,F7e,trn,z3,Q7e,U7e,G7e,$7e,Rbe,W7e,H7e,IN,zbe,H3,Kbe,Jbe,Xbe,tb,q7e,pA,j7e,K3,V7e,Y7e,z7e,K7e,J7e,X7e,Z7e,eKe,tKe,Zbe,Upi,urn,$pi,sin,ts,RN,Ypi,nKe,drn,zpi,prn,xZ,TN,Zpi,kbe,rmi,imi,Mv,fin,hrn,e_e,rKe,Z0,eb,gin,cmi,dmi,mmi,grn,iKe,yin,Ea,sKe,oKe,aKe,cKe,lKe,uKe,dKe,pKe,mKe,hKe,fKe,gKe,AKe,yKe,qmi,jmi,EKe,bKe,_Ke,xKe,SKe,CKe,brn,yZ,IKe,wKe,TKe,vKe,BKe,jin,Vin,Yin,zin,bN,NKe,DKe,Nhi,E2,s_e=v(()=>{p();xrn=Ot(CKt(),1),Srn=Ot(Sen(),1),Crn=require("fs"),n_e=Ot(require("fs/promises"),1),Irn=require("fs/promises"),wrn=require("node:stream"),Trn=require("node:stream/promises");Ttn();vrn=Ot(require("path"),1);vx=class{};(function(t){t.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",t.OUTCOME_OK="OUTCOME_OK",t.OUTCOME_FAILED="OUTCOME_FAILED",t.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(vtn||(vtn={}));(function(t){t.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",t.PYTHON="PYTHON"})(Rtn||(Rtn={}));(function(t){t.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",t.SILENT="SILENT",t.WHEN_IDLE="WHEN_IDLE",t.INTERRUPT="INTERRUPT"})(ktn||(ktn={}));(function(t){t.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",t.STRING="STRING",t.NUMBER="NUMBER",t.INTEGER="INTEGER",t.BOOLEAN="BOOLEAN",t.ARRAY="ARRAY",t.OBJECT="OBJECT",t.NULL="NULL"})(EN||(EN={}));(function(t){t.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",t.NO_AUTH="NO_AUTH",t.API_KEY_AUTH="API_KEY_AUTH",t.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",t.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",t.OAUTH="OAUTH",t.OIDC_AUTH="OIDC_AUTH"})(Btn||(Btn={}));(function(t){t.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",t.HTTP_IN_QUERY="HTTP_IN_QUERY",t.HTTP_IN_HEADER="HTTP_IN_HEADER",t.HTTP_IN_PATH="HTTP_IN_PATH",t.HTTP_IN_BODY="HTTP_IN_BODY",t.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(Ntn||(Ntn={}));(function(t){t.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",t.SIMPLE_SEARCH="SIMPLE_SEARCH",t.ELASTIC_SEARCH="ELASTIC_SEARCH"})(Dtn||(Dtn={}));(function(t){t.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",t.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER",t.ENVIRONMENT_MOBILE="ENVIRONMENT_MOBILE",t.ENVIRONMENT_DESKTOP="ENVIRONMENT_DESKTOP"})(Ptn||(Ptn={}));(function(t){t.SAFETY_POLICY_UNSPECIFIED="SAFETY_POLICY_UNSPECIFIED",t.FINANCIAL_TRANSACTIONS="FINANCIAL_TRANSACTIONS",t.SENSITIVE_DATA_MODIFICATION="SENSITIVE_DATA_MODIFICATION",t.COMMUNICATION_TOOL="COMMUNICATION_TOOL",t.ACCOUNT_CREATION="ACCOUNT_CREATION",t.DATA_MODIFICATION="DATA_MODIFICATION",t.USER_CONSENT_MANAGEMENT="USER_CONSENT_MANAGEMENT",t.LEGAL_TERMS_AND_AGREEMENTS="LEGAL_TERMS_AND_AGREEMENTS"})(Mtn||(Mtn={}));(function(t){t.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",t.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",t.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",t.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(Otn||(Otn={}));(function(t){t.UNSPECIFIED="UNSPECIFIED",t.BLOCKING="BLOCKING",t.NON_BLOCKING="NON_BLOCKING"})(Ltn||(Ltn={}));(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(Ftn||(Ftn={}));(function(t){t.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",t.MINIMAL="MINIMAL",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(xN||(xN={}));(function(t){t.DONT_ALLOW="DONT_ALLOW",t.ALLOW_ADULT="ALLOW_ADULT",t.ALLOW_ALL="ALLOW_ALL"})(Qtn||(Qtn={}));(function(t){t.PROMINENT_PEOPLE_UNSPECIFIED="PROMINENT_PEOPLE_UNSPECIFIED",t.ALLOW_PROMINENT_PEOPLE="ALLOW_PROMINENT_PEOPLE",t.BLOCK_PROMINENT_PEOPLE="BLOCK_PROMINENT_PEOPLE"})(Utn||(Utn={}));(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",t.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK",t.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",t.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",t.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",t.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"})(Gtn||(Gtn={}));(function(t){t.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",t.SEVERITY="SEVERITY",t.PROBABILITY="PROBABILITY"})($tn||($tn={}));(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE",t.OFF="OFF"})(Wtn||(Wtn={}));(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE",t.VALIDATED="VALIDATED"})(SN||(SN={}));(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.IMAGE_SAFETY="IMAGE_SAFETY",t.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",t.TOO_MANY_TOOL_CALLS="TOO_MANY_TOOL_CALLS",t.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",t.NO_IMAGE="NO_IMAGE",t.IMAGE_RECITATION="IMAGE_RECITATION",t.IMAGE_OTHER="IMAGE_OTHER"})(nd||(nd={}));(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(Htn||(Htn={}));(function(t){t.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",t.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",t.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",t.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",t.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(qtn||(qtn={}));(function(t){t.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",t.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",t.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",t.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",t.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(jtn||(jtn={}));(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.IMAGE_SAFETY="IMAGE_SAFETY",t.MODEL_ARMOR="MODEL_ARMOR",t.JAILBREAK="JAILBREAK"})(Vtn||(Vtn={}));(function(t){t.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",t.ON_DEMAND="ON_DEMAND",t.ON_DEMAND_PRIORITY="ON_DEMAND_PRIORITY",t.ON_DEMAND_FLEX="ON_DEMAND_FLEX",t.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(Ytn||(Ytn={}));(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.AUDIO="AUDIO",t.DOCUMENT="DOCUMENT"})(ztn||(ztn={}));(function(t){t.MODEL_STAGE_UNSPECIFIED="MODEL_STAGE_UNSPECIFIED",t.UNSTABLE_EXPERIMENTAL="UNSTABLE_EXPERIMENTAL",t.EXPERIMENTAL="EXPERIMENTAL",t.PREVIEW="PREVIEW",t.STABLE="STABLE",t.LEGACY="LEGACY",t.DEPRECATED="DEPRECATED",t.RETIRED="RETIRED"})(Ktn||(Ktn={}));(function(t){t.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",t.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",t.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",t.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(Jtn||(Jtn={}));(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.AUDIO="AUDIO",t.VIDEO="VIDEO"})(Mbe||(Mbe={}));(function(t){t.DELIVERY_UNSPECIFIED="DELIVERY_UNSPECIFIED",t.INLINE="INLINE",t.URI="URI"})(Xtn||(Xtn={}));(function(t){t.ASPECT_RATIO_UNSPECIFIED="ASPECT_RATIO_UNSPECIFIED",t.ASPECT_RATIO_ONE_BY_ONE="ASPECT_RATIO_ONE_BY_ONE",t.ASPECT_RATIO_TWO_BY_THREE="ASPECT_RATIO_TWO_BY_THREE",t.ASPECT_RATIO_THREE_BY_TWO="ASPECT_RATIO_THREE_BY_TWO",t.ASPECT_RATIO_THREE_BY_FOUR="ASPECT_RATIO_THREE_BY_FOUR",t.ASPECT_RATIO_FOUR_BY_THREE="ASPECT_RATIO_FOUR_BY_THREE",t.ASPECT_RATIO_FOUR_BY_FIVE="ASPECT_RATIO_FOUR_BY_FIVE",t.ASPECT_RATIO_FIVE_BY_FOUR="ASPECT_RATIO_FIVE_BY_FOUR",t.ASPECT_RATIO_NINE_BY_SIXTEEN="ASPECT_RATIO_NINE_BY_SIXTEEN",t.ASPECT_RATIO_SIXTEEN_BY_NINE="ASPECT_RATIO_SIXTEEN_BY_NINE",t.ASPECT_RATIO_TWENTY_ONE_BY_NINE="ASPECT_RATIO_TWENTY_ONE_BY_NINE",t.ASPECT_RATIO_ONE_BY_EIGHT="ASPECT_RATIO_ONE_BY_EIGHT",t.ASPECT_RATIO_EIGHT_BY_ONE="ASPECT_RATIO_EIGHT_BY_ONE",t.ASPECT_RATIO_ONE_BY_FOUR="ASPECT_RATIO_ONE_BY_FOUR",t.ASPECT_RATIO_FOUR_BY_ONE="ASPECT_RATIO_FOUR_BY_ONE"})(Ztn||(Ztn={}));(function(t){t.IMAGE_SIZE_UNSPECIFIED="IMAGE_SIZE_UNSPECIFIED",t.IMAGE_SIZE_FIVE_TWELVE="IMAGE_SIZE_FIVE_TWELVE",t.IMAGE_SIZE_ONE_K="IMAGE_SIZE_ONE_K",t.IMAGE_SIZE_TWO_K="IMAGE_SIZE_TWO_K",t.IMAGE_SIZE_FOUR_K="IMAGE_SIZE_FOUR_K"})(enn||(enn={}));(function(t){t.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",t.TUNING_MODE_FULL="TUNING_MODE_FULL",t.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(tnn||(tnn={}));(function(t){t.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",t.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",t.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",t.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",t.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",t.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",t.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(nnn||(nnn={}));(function(t){t.RESPONSE_PARSE_TYPE_UNSPECIFIED="RESPONSE_PARSE_TYPE_UNSPECIFIED",t.IDENTITY="IDENTITY",t.REGEX_EXTRACT="REGEX_EXTRACT"})(rnn||(rnn={}));(function(t){t.MATCH_OPERATION_UNSPECIFIED="MATCH_OPERATION_UNSPECIFIED",t.REGEX_CONTAINS="REGEX_CONTAINS",t.PARTIAL_MATCH="PARTIAL_MATCH",t.EXACT_MATCH="EXACT_MATCH"})(inn||(inn={}));(function(t){t.REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED="REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED",t.MINIMAL="MINIMAL",t.HIGH="HIGH"})(snn||(snn={}));(function(t){t.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",t.JOB_STATE_QUEUED="JOB_STATE_QUEUED",t.JOB_STATE_PENDING="JOB_STATE_PENDING",t.JOB_STATE_RUNNING="JOB_STATE_RUNNING",t.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",t.JOB_STATE_FAILED="JOB_STATE_FAILED",t.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",t.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",t.JOB_STATE_PAUSED="JOB_STATE_PAUSED",t.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",t.JOB_STATE_UPDATING="JOB_STATE_UPDATING",t.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(s7e||(s7e={}));(function(t){t.TUNING_JOB_STATE_UNSPECIFIED="TUNING_JOB_STATE_UNSPECIFIED",t.TUNING_JOB_STATE_WAITING_FOR_QUOTA="TUNING_JOB_STATE_WAITING_FOR_QUOTA",t.TUNING_JOB_STATE_PROCESSING_DATASET="TUNING_JOB_STATE_PROCESSING_DATASET",t.TUNING_JOB_STATE_WAITING_FOR_CAPACITY="TUNING_JOB_STATE_WAITING_FOR_CAPACITY",t.TUNING_JOB_STATE_TUNING="TUNING_JOB_STATE_TUNING",t.TUNING_JOB_STATE_POST_PROCESSING="TUNING_JOB_STATE_POST_PROCESSING"})(onn||(onn={}));(function(t){t.AGGREGATION_METRIC_UNSPECIFIED="AGGREGATION_METRIC_UNSPECIFIED",t.AVERAGE="AVERAGE",t.MODE="MODE",t.STANDARD_DEVIATION="STANDARD_DEVIATION",t.VARIANCE="VARIANCE",t.MINIMUM="MINIMUM",t.MAXIMUM="MAXIMUM",t.MEDIAN="MEDIAN",t.PERCENTILE_P90="PERCENTILE_P90",t.PERCENTILE_P95="PERCENTILE_P95",t.PERCENTILE_P99="PERCENTILE_P99"})(ann||(ann={}));(function(t){t.PAIRWISE_CHOICE_UNSPECIFIED="PAIRWISE_CHOICE_UNSPECIFIED",t.BASELINE="BASELINE",t.CANDIDATE="CANDIDATE",t.TIE="TIE"})(cnn||(cnn={}));(function(t){t.VIDEO_ORIENTATION_UNSPECIFIED="VIDEO_ORIENTATION_UNSPECIFIED",t.LANDSCAPE="LANDSCAPE",t.PORTRAIT="PORTRAIT"})(lnn||(lnn={}));(function(t){t.TUNING_SPEED_UNSPECIFIED="TUNING_SPEED_UNSPECIFIED",t.REGULAR="REGULAR",t.FAST="FAST"})(unn||(unn={}));(function(t){t.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",t.TUNING_TASK_I2V="TUNING_TASK_I2V",t.TUNING_TASK_T2V="TUNING_TASK_T2V",t.TUNING_TASK_R2V="TUNING_TASK_R2V"})(dnn||(dnn={}));(function(t){t.STATE_UNSPECIFIED="STATE_UNSPECIFIED",t.STATE_PENDING="STATE_PENDING",t.STATE_ACTIVE="STATE_ACTIVE",t.STATE_FAILED="STATE_FAILED"})(pnn||(pnn={}));(function(t){t.UNSPECIFIED="unspecified",t.FLEX="flex",t.STANDARD="standard",t.PRIORITY="priority"})(mnn||(mnn={}));(function(t){t.MEDIA_PROCESSING_UNSPECIFIED="MEDIA_PROCESSING_UNSPECIFIED",t.STATIC="STATIC",t.AGENTIC="AGENTIC"})(hnn||(hnn={}));(function(t){t.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",t.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",t.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",t.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",t.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(fnn||(fnn={}));(function(t){t.TOOL_TYPE_UNSPECIFIED="TOOL_TYPE_UNSPECIFIED",t.GOOGLE_SEARCH_WEB="GOOGLE_SEARCH_WEB",t.GOOGLE_SEARCH_IMAGE="GOOGLE_SEARCH_IMAGE",t.URL_CONTEXT="URL_CONTEXT",t.GOOGLE_MAPS="GOOGLE_MAPS",t.FILE_SEARCH="FILE_SEARCH",t.MEDIA_PROCESSING="MEDIA_PROCESSING"})(gnn||(gnn={}));(function(t){t.COLLECTION="COLLECTION"})(bZ||(bZ={}));(function(t){t.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",t.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",t.BALANCED="BALANCED",t.PRIORITIZE_COST="PRIORITIZE_COST"})(Ann||(Ann={}));(function(t){t.PREDICT="PREDICT",t.EMBED_CONTENT="EMBED_CONTENT"})(Obe||(Obe={}));(function(t){t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(ynn||(ynn={}));(function(t){t.auto="auto",t.en="en",t.ja="ja",t.ko="ko",t.hi="hi",t.zh="zh",t.pt="pt",t.es="es"})(Enn||(Enn={}));(function(t){t.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",t.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",t.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",t.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",t.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(bnn||(bnn={}));(function(t){t.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",t.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",t.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",t.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(_nn||(_nn={}));(function(t){t.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",t.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",t.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",t.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(xnn||(xnn={}));(function(t){t.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",t.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",t.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",t.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",t.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",t.EDIT_MODE_STYLE="EDIT_MODE_STYLE",t.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",t.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(Snn||(Snn={}));(function(t){t.FOREGROUND="FOREGROUND",t.BACKGROUND="BACKGROUND",t.PROMPT="PROMPT",t.SEMANTIC="SEMANTIC",t.INTERACTIVE="INTERACTIVE"})(Cnn||(Cnn={}));(function(t){t.ASSET="ASSET",t.STYLE="STYLE"})(Inn||(Inn={}));(function(t){t.INSERT="INSERT",t.REMOVE="REMOVE",t.REMOVE_STATIC="REMOVE_STATIC",t.OUTPAINT="OUTPAINT"})(wnn||(wnn={}));(function(t){t.OPTIMIZED="OPTIMIZED",t.LOSSLESS="LOSSLESS"})(Tnn||(Tnn={}));(function(t){t.CROP="CROP",t.PAD="PAD"})(vnn||(vnn={}));(function(t){t.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",t.PREFERENCE_TUNING="PREFERENCE_TUNING",t.DISTILLATION="DISTILLATION",t.REINFORCEMENT_TUNING="REINFORCEMENT_TUNING"})(Rnn||(Rnn={}));(function(t){t.STATE_UNSPECIFIED="STATE_UNSPECIFIED",t.PROCESSING="PROCESSING",t.ACTIVE="ACTIVE",t.FAILED="FAILED"})(knn||(knn={}));(function(t){t.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",t.UPLOADED="UPLOADED",t.GENERATED="GENERATED",t.REGISTERED="REGISTERED"})(Bnn||(Bnn={}));(function(t){t.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.RESPONSE_REJECTED="RESPONSE_REJECTED",t.NEED_MORE_INPUT="NEED_MORE_INPUT",t.PROHIBITED_INPUT_CONTENT="PROHIBITED_INPUT_CONTENT",t.IMAGE_PROHIBITED_INPUT_CONTENT="IMAGE_PROHIBITED_INPUT_CONTENT",t.INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED="INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED",t.INPUT_IMAGE_CELEBRITY="INPUT_IMAGE_CELEBRITY",t.INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED="INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED",t.INPUT_TEXT_NCII_PROHIBITED="INPUT_TEXT_NCII_PROHIBITED",t.INPUT_OTHER="INPUT_OTHER",t.INPUT_IP_PROHIBITED="INPUT_IP_PROHIBITED",t.BLOCKLIST="BLOCKLIST",t.UNSAFE_PROMPT_FOR_IMAGE_GENERATION="UNSAFE_PROMPT_FOR_IMAGE_GENERATION",t.GENERATED_IMAGE_SAFETY="GENERATED_IMAGE_SAFETY",t.GENERATED_CONTENT_SAFETY="GENERATED_CONTENT_SAFETY",t.GENERATED_AUDIO_SAFETY="GENERATED_AUDIO_SAFETY",t.GENERATED_VIDEO_SAFETY="GENERATED_VIDEO_SAFETY",t.GENERATED_CONTENT_PROHIBITED="GENERATED_CONTENT_PROHIBITED",t.GENERATED_CONTENT_BLOCKLIST="GENERATED_CONTENT_BLOCKLIST",t.GENERATED_IMAGE_PROHIBITED="GENERATED_IMAGE_PROHIBITED",t.GENERATED_IMAGE_CELEBRITY="GENERATED_IMAGE_CELEBRITY",t.GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER="GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER",t.GENERATED_IMAGE_IDENTIFIABLE_PEOPLE="GENERATED_IMAGE_IDENTIFIABLE_PEOPLE",t.GENERATED_IMAGE_MINORS="GENERATED_IMAGE_MINORS",t.OUTPUT_IMAGE_IP_PROHIBITED="OUTPUT_IMAGE_IP_PROHIBITED",t.GENERATED_OTHER="GENERATED_OTHER",t.MAX_REGENERATION_REACHED="MAX_REGENERATION_REACHED"})(Nnn||(Nnn={}));(function(t){t.INTERACTION_STATUS_UNSPECIFIED="INTERACTION_STATUS_UNSPECIFIED",t.IN_PROGRESS="IN_PROGRESS",t.REQUIRES_ACTION="REQUIRES_ACTION",t.IDLE="IDLE"})(Dnn||(Dnn={}));(function(t){t.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",t.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",t.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(Pnn||(Pnn={}));(function(t){t.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",t.ACTIVITY_START="ACTIVITY_START",t.ACTIVITY_END="ACTIVITY_END"})(Mnn||(Mnn={}));(function(t){t.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",t.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",t.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(Onn||(Onn={}));(function(t){t.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",t.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",t.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(Lnn||(Lnn={}));(function(t){t.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",t.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",t.NO_INTERRUPTION="NO_INTERRUPTION"})(Fnn||(Fnn={}));(function(t){t.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",t.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",t.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT",t.TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO="TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"})(Qnn||(Qnn={}));(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.VERBATIM="VERBATIM",t.SMART="SMART"})(Unn||(Unn={}));(function(t){t.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",t.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",t.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",t.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",t.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",t.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",t.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",t.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",t.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",t.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",t.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",t.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",t.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(Gnn||(Gnn={}));(function(t){t.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",t.QUALITY="QUALITY",t.DIVERSITY="DIVERSITY",t.VOCALIZATION="VOCALIZATION"})($nn||($nn={}));(function(t){t.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",t.PLAY="PLAY",t.PAUSE="PAUSE",t.STOP="STOP",t.RESET_CONTEXT="RESET_CONTEXT"})(W3||(W3={}));CN=class{constructor(e){let n={};for(let r of e.headers.entries())n[r[0]]=r[1];this.headers=n,this.responseInternal=e}json(){return this.responseInternal.json()}},y2=class{get text(){var e,n,r,i,s,o,a,c;if(((i=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let u="",l=!1,d=[];for(let m of(c=(a=(o=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)!==null&&c!==void 0?c:[]){for(let[h,f]of Object.entries(m))h!=="text"&&h!=="thought"&&h!=="thoughtSignature"&&(f!==null||f!==void 0)&&d.push(h);if(typeof m.text=="string"){if(typeof m.thought=="boolean"&&m.thought)continue;l=!0,u+=m.text}}return d.length>0&&console.warn(`there are non-text parts ${d} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),l?u:void 0}get data(){var e,n,r,i,s,o,a,c;if(((i=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let u="",l=[];for(let d of(c=(a=(o=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)!==null&&c!==void 0?c:[]){for(let[m,h]of Object.entries(d))m!=="inlineData"&&(h!==null||h!==void 0)&&l.push(m);d.inlineData&&typeof d.inlineData.data=="string"&&(u+=atob(d.inlineData.data))}return l.length>0&&console.warn(`there are non-data parts ${l} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),u.length>0?btoa(u):void 0}get functionCalls(){var e,n,r,i,s,o,a,c;if(((i=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");let u=(c=(a=(o=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||c===void 0?void 0:c.filter(l=>l.functionCall).map(l=>l.functionCall).filter(l=>l!==void 0);if(u?.length!==0)return u}get executableCode(){var e,n,r,i,s,o,a,c,u;if(((i=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");let l=(c=(a=(o=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||c===void 0?void 0:c.filter(d=>d.executableCode).map(d=>d.executableCode).filter(d=>d!==void 0);if(l?.length!==0)return(u=l?.[0])===null||u===void 0?void 0:u.code}get codeExecutionResult(){var e,n,r,i,s,o,a,c,u;if(((i=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");let l=(c=(a=(o=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||c===void 0?void 0:c.filter(d=>d.codeExecutionResult).map(d=>d.codeExecutionResult).filter(d=>d!==void 0);if(l?.length!==0)return(u=l?.[0])===null||u===void 0?void 0:u.output}},Lbe=class{},o7e=class{},a7e=class{},c7e=class{},l7e=class{},u7e=class{},Fbe=class{},Qbe=class{},Ube=class{},d7e=class{},Gbe=class t{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let r=new t,i,s=e;return n?i=Doi(s):i=Noi(s),Object.assign(r,i),r}},p7e=class{},$be=class{},m7e=class{},Wbe=class{},Hbe=class{},h7e=class{},f7e=class{},g7e=class{},A7e=class t{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let r=new t,s=Uoi(e);return Object.assign(r,s),r}},y7e=class{},E7e=class{},b7e=class{},_7e=class{},qbe=class{},x7e=class{get text(){var e,n,r;let i="",s=!1,o=[];for(let a of(r=(n=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&r!==void 0?r:[]){for(let[c,u]of Object.entries(a))c!=="text"&&c!=="thought"&&u!==null&&o.push(c);if(typeof a.text=="string"){if(typeof a.thought=="boolean"&&a.thought)continue;s=!0,i+=a.text}}return o.length>0&&console.warn(`there are non-text parts ${o} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),s?i:void 0}get data(){var e,n,r;let i="",s=[];for(let o of(r=(n=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&r!==void 0?r:[]){for(let[a,c]of Object.entries(o))a!=="inlineData"&&c!==null&&s.push(a);o.inlineData&&typeof o.inlineData.data=="string"&&(i+=atob(o.inlineData.data))}return s.length>0&&console.warn(`there are non-data parts ${s} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),i.length>0?btoa(i):void 0}},S7e=class{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}},jbe=class t{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let r=new t,s=MKe(e);return Object.assign(r,s),r}};(function(t){t.PAGED_ITEM_BATCH_JOBS="batchJobs",t.PAGED_ITEM_MODELS="models",t.PAGED_ITEM_TUNING_JOBS="tuningJobs",t.PAGED_ITEM_FILES="files",t.PAGED_ITEM_CACHED_CONTENTS="cachedContents",t.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",t.PAGED_ITEM_DOCUMENTS="documents",t.PAGED_ITEM_SKILLS="skills"})(Dv||(Dv={}));Pv=class{constructor(e,n,r,i){this.pageInternal=[],this.paramsInternal={},this.requestInternal=n,this.init(e,r,i)}init(e,n,r){var i,s;this.nameInternal=e,this.pageInternal=n[this.nameInternal]||[],this.sdkHttpResponseInternal=n?.sdkHttpResponse,this.idxInternal=0;let o={config:{}};!r||Object.keys(r).length===0?o={config:{}}:typeof r=="object"?o=Object.assign({},r):o=r,o.config&&(o.config.pageToken=n.nextPageToken),this.paramsInternal=o,this.pageInternalSize=(s=(i=o.config)===null||i===void 0?void 0:i.pageSize)!==null&&s!==void 0?s:this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};let e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");let e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){var e;return((e=this.params.config)===null||e===void 0?void 0:e.pageToken)!==void 0}};w7e=class extends vx{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new Pv(Dv.PAGED_ITEM_BATCH_JOBS,r=>this.listInternal(r),await this.listInternal(n),n),this.create=async n=>(this.apiClient.isVertexAI()&&(n.config=this.formatDestination(n.src,n.config)),this.createInternal(n)),this.createEmbeddings=async n=>{if(console.warn("batches.createEmbeddings() is experimental and may change without notice."),this.apiClient.isVertexAI())throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support batches.createEmbeddings.");return this.createEmbeddingsInternal(n)}}createInlinedGenerateContentRequest(e){let n=jnn(this.apiClient,e),r=n._url,i=er("{model}:batchGenerateContent",r),a=n.batch.inputConfig.requests,c=a.requests,u=[];for(let l of c){let d=Object.assign({},l);if(d.systemInstruction){let m=d.systemInstruction;delete d.systemInstruction;let h=d.request;h.systemInstruction=m,d.request=h}u.push(d)}return a.requests=u,delete n.config,delete n._url,delete n._query,{path:i,body:n}}getGcsUri(e){if(typeof e=="string")return e.startsWith("gs://")?e:void 0;if(!Array.isArray(e)&&e.gcsUri&&e.gcsUri.length>0)return e.gcsUri[0]}getBigqueryUri(e){if(typeof e=="string")return e.startsWith("bq://")?e:void 0;if(!Array.isArray(e))return e.bigqueryUri}formatDestination(e,n){let r=n?Object.assign({},n):{},i=Date.now().toString();if(r.displayName||(r.displayName=`genaiBatchJob_${i}`),r.dest===void 0){let s=this.getGcsUri(e),o=this.getBigqueryUri(e);if(s)s.endsWith(".jsonl")?r.dest=`${s.slice(0,-6)}/dest`:r.dest=`${s}_dest_${i}`;else if(o)r.dest=`${o}_dest_${i}`;else throw new Error("Unsupported source for Gemini Enterprise Agent Platform (previously known as Vertex AI): No GCS or BigQuery URI found.")}return r}async createInternal(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=mai(this.apiClient,e);return a=er("batchPredictionJobs",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>I7e(l))}else{let u=jnn(this.apiClient,e);return a=er("{model}:batchGenerateContent",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json()),o.then(l=>Dbe(l))}}async createEmbeddingsInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=fai(this.apiClient,e);return s=er("{model}:asyncBatchEmbedContent",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>Dbe(c))}}async get(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Rai(this.apiClient,e);return a=er("batchPredictionJobs/{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>I7e(l))}else{let u=vai(this.apiClient,e);return a=er("batches/{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json()),o.then(l=>Dbe(l))}}async cancel(e){var n,r,i,s;let o="",a={};if(this.apiClient.isVertexAI()){let c=cai(this.apiClient,e);o=er("batchPredictionJobs/{name}:cancel",c._url),a=c._query,delete c._url,delete c._query,await this.apiClient.request({path:o,queryParams:a,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal})}else{let c=aai(this.apiClient,e);o=er("batches/{name}:cancel",c._url),a=c._query,delete c._url,delete c._query,await this.apiClient.request({path:o,queryParams:a,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal})}}async listInternal(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Fai(e);return a=er("batchPredictionJobs",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=Uai(l),m=new qbe;return Object.assign(m,d),m})}else{let u=Lai(e);return a=er("batches",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=Qai(l),m=new qbe;return Object.assign(m,d),m})}}async delete(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Aai(this.apiClient,e);return a=er("batchPredictionJobs/{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>Eai(l))}else{let u=gai(this.apiClient,e);return a=er("batches/{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>yai(l))}}};T7e=class extends vx{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new Pv(Dv.PAGED_ITEM_CACHED_CONTENTS,r=>this.listInternal(r),await this.listInternal(n),n)}async create(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Zai(this.apiClient,e);return a=er("cachedContents",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>l)}else{let u=Xai(this.apiClient,e);return a=er("cachedContents",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json()),o.then(l=>l)}}async get(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=cci(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>l)}else{let u=aci(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json()),o.then(l=>l)}}async delete(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=tci(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=rci(l),m=new Wbe;return Object.assign(m,d),m})}else{let u=eci(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=nci(l),m=new Wbe;return Object.assign(m,d),m})}}async update(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Tci(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>l)}else{let u=wci(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json()),o.then(l=>l)}}async listInternal(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=hci(e);return a=er("cachedContents",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=gci(l),m=new Hbe;return Object.assign(m,d),m})}else{let u=mci(e);return a=er("cachedContents",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=fci(l),m=new Hbe;return Object.assign(m,d),m})}}};v7e=class{constructor(e,n){this.modelsModule=e,this.apiClient=n}create(e){return new R7e(this.apiClient,this.modelsModule,e.model,e.config,structuredClone(e.history))}},R7e=class{constructor(e,n,r,i={},s=[]){this.apiClient=e,this.modelsModule=n,this.model=r,this.config=i,this.history=s,this.sendPromise=Promise.resolve(),Rci(s)}async sendMessage(e){var n;await this.sendPromise;let r=zp(e.message),i=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(r),config:(n=e.config)!==null&&n!==void 0?n:this.config});return this.sendPromise=(async()=>{var s,o,a;let c=await i,u=(o=(s=c.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content,l=c.automaticFunctionCallingHistory,d=this.getHistory(!0).length,m=[];l!=null&&(m=(a=l.slice(d))!==null&&a!==void 0?a:[]);let h=u?[u]:[];this.recordHistory(r,h,m)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),i}async sendMessageStream(e){var n;await this.sendPromise;let r=zp(e.message),i=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(r),config:(n=e.config)!==null&&n!==void 0?n:this.config});this.sendPromise=i.then(()=>{}).catch(()=>{});let s=await i;return this.processStreamResponse(s,r)}getHistory(e=!1){let n=e?Knn(this.history):this.history;return structuredClone(n)}processStreamResponse(e,n){return V3(this,arguments,function*(){var i,s,o,a,c,u;let l=[];try{for(var d=!0,m=EZ(e),h;h=yield Zc(m.next()),i=h.done,!i;d=!0){a=h.value,d=!1;let f=a;if(vci(f)){let g=(u=(c=f.candidates)===null||c===void 0?void 0:c[0])===null||u===void 0?void 0:u.content;g!==void 0&&l.push(g)}yield yield Zc(f)}}catch(f){s={error:f}}finally{try{!d&&!i&&(o=m.return)&&(yield Zc(o.call(m)))}finally{if(s)throw s.error}}this.recordHistory(n,l)})}recordHistory(e,n,r){let i=[];n.length>0&&n.every(s=>s.role!==void 0)?i=n:i.push({role:"model",parts:[]}),r&&r.length>0?this.history.push(...Knn(r)):this.history.push(e),this.history.push(...i)}};Ybe=class t extends Error{constructor(e){super(e.message),this.name="ApiError",this.status=e.status,Object.setPrototypeOf(this,t.prototype)}};Uci=class extends vx{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new Pv(Dv.PAGED_ITEM_FILES,r=>this.listInternal(r),await this.listInternal(n),n)}async upload(e){if(this.apiClient.isVertexAI())throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(e.file,e.config).then(n=>n)}async download(e){await this.apiClient.downloadFile(e)}async registerFiles(e){throw new Error("registerFiles is only supported in Node.js environments.")}async _registerFiles(e){return this.registerFilesInternal(e)}async listInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=Lci(e);return s=er("files",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),i.then(c=>{let u=Fci(c),l=new y7e;return Object.assign(l,u),l})}}async createInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=kci(e);return s=er("upload/v1beta/files",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>{let u=Bci(c),l=new E7e;return Object.assign(l,u),l})}}async get(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=Pci(e);return s=er("files/{file}",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>c)}}async delete(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=Nci(e);return s=er("files/{file}",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),i.then(c=>{let u=Dci(c),l=new b7e;return Object.assign(l,u),l})}}async registerFilesInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=Mci(e);return s=er("files:register",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>{let u=Qci(c),l=new _7e;return Object.assign(l,u),l})}}};Sdi="Content-Type",Cdi="X-Server-Timeout",Idi="User-Agent",N7e="x-goog-api-client",wdi="2.21.0",Tdi=`google-genai-sdk/${wdi}`,vdi="v1beta1",Rdi="v1beta",kdi=new Set(["us","eu"]);Ddi=5,Pdi=1,Mdi=60,Odi=2,Ldi=1,Fdi=[408,429,500,502,503,504],D7e=class{constructor(e){var n,r,i;this.clientOptions=Object.assign({},e),this.customBaseUrl=(n=e.httpOptions)===null||n===void 0?void 0:n.baseUrl;let s={};if(this.clientOptions.vertexai){if(!this.clientOptions.location&&!this.clientOptions.apiKey&&!this.customBaseUrl&&(this.clientOptions.location="global"),!(this.clientOptions.project&&this.clientOptions.location||this.clientOptions.apiKey)&&!this.customBaseUrl)throw new Error("Authentication is not set up. Please provide either a project and location, or an API key, or a custom base URL.");let a=e.project&&e.location||!!e.apiKey;this.customBaseUrl&&!a?(s.baseUrl=this.customBaseUrl,this.clientOptions.project=void 0,this.clientOptions.location=void 0):this.clientOptions.apiKey&&!this.clientOptions.project||this.clientOptions.location==="global"?s.baseUrl="https://aiplatform.googleapis.com/":this.clientOptions.project&&this.clientOptions.location&&kdi.has(this.clientOptions.location)?s.baseUrl=`https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`:this.clientOptions.project&&this.clientOptions.location&&(s.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`),s.apiVersion=(r=this.clientOptions.apiVersion)!==null&&r!==void 0?r:vdi}else this.clientOptions.apiKey||console.warn("API key should be set when using the Gemini API."),s.apiVersion=(i=this.clientOptions.apiVersion)!==null&&i!==void 0?i:Rdi,s.baseUrl="https://generativelanguage.googleapis.com/";s.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=s,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(s,e.httpOptions))}isVertexAI(){var e;return(e=this.clientOptions.vertexai)!==null&&e!==void 0?e:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getCustomBaseUrl(){return this.customBaseUrl}async getAuthHeaders(){let e=new Headers;return await this.clientOptions.auth.addAuthHeaders(e),e}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");let r=[e.baseUrl.endsWith("/")?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==""&&r.push(e.apiVersion),r.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){let e=this.getBaseUrl(),n=new URL(e);return n.protocol=n.protocol=="http:"?"ws":"wss",n.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw new Error("HTTP options are not correctly set.")}constructUrl(e,n,r){let i=[this.getRequestUrlInternal(n)];return r&&i.push(this.getBaseResourcePath()),e!==""&&i.push(e),new URL(`${i.join("/")}`)}shouldPrependVertexProjectPath(e,n){return!(n.baseUrl&&n.baseUrlResourceScope===bZ.COLLECTION||!this.clientOptions.vertexai||!this.clientOptions.project||!this.clientOptions.location||e.path.startsWith("projects/")||e.httpMethod==="GET"&&e.path.startsWith("publishers/google/models"))}async request(e){let n=this.clientOptions.httpOptions;e.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));let r=this.shouldPrependVertexProjectPath(e,n),i=this.constructUrl(e.path,n,r);if(e.queryParams)for(let[o,a]of Object.entries(e.queryParams))i.searchParams.append(o,String(a));let s={};if(e.httpMethod==="GET"){if(e.body&&e.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else s.body=e.body;return s=await this.includeExtraHttpOptionsToRequestInit(s,n,i.toString()),this.unaryApiCall(i,s,e.httpMethod,n.retryOptions,n.timeout,e.abortSignal)}patchHttpOptions(e,n){let r=JSON.parse(JSON.stringify(e));for(let[i,s]of Object.entries(n))typeof s=="object"?r[i]=Object.assign(Object.assign({},r[i]),s):s!==void 0&&(r[i]=s);return r}async requestStream(e){let n=this.clientOptions.httpOptions;e.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));let r=this.shouldPrependVertexProjectPath(e,n),i=this.constructUrl(e.path,n,r);(!i.searchParams.has("alt")||i.searchParams.get("alt")!=="sse")&&i.searchParams.set("alt","sse");let s={};return s.body=e.body,s=await this.includeExtraHttpOptionsToRequestInit(s,n,i.toString()),this.streamApiCall(i,s,e.httpMethod,n.retryOptions,n.timeout,e.abortSignal)}async includeExtraHttpOptionsToRequestInit(e,n,r){return n?.timeout&&n.timeout>0&&Bdi(n.timeout),n&&n.extraBody!==null&&Qdi(e,n.extraBody),e.headers=await this.getHeadersInternal(n,r),e}async unaryApiCall(e,n,r,i,s,o){return this.apiCall(e.toString(),Object.assign(Object.assign({},n),{method:r}),i,s,o).then(async a=>(await t7e(a),new CN(a))).catch(a=>{throw a instanceof Error?a:new Error(`exception ${a} sending request`,{cause:a})})}async streamApiCall(e,n,r,i,s,o){return this.apiCall(e.toString(),Object.assign(Object.assign({},n),{method:r}),i,s,o).then(async a=>(await t7e(a),this.processStreamResponse(a))).catch(a=>{throw a instanceof Error?a:new Error(`exception ${a} sending request`,{cause:a})})}processStreamResponse(e){return V3(this,arguments,function*(){var r;let i=(r=e?.body)===null||r===void 0?void 0:r.getReader(),s=new TextDecoder("utf-8");if(!i)throw new Error("Response body is empty");try{let o="",a="data:",c=[` `,"\r\r",`\r \r -`];for(;;){let{done:u,value:l}=yield oi(s.read());if(u){if(o.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}let d=i.decode(l,{stream:!0});try{let f=JSON.parse(d);if("error"in f){let g=JSON.parse(JSON.stringify(f.error)),A=g.status,y=g.code,b=`got status: ${A}. ${JSON.stringify(f)}`;if(y>=400&&y<600)throw new jfe({message:b,status:y})}}catch(f){if(f.name==="ApiError")throw f}o+=d;let h=-1,m=0;for(;;){h=-1,m=0;for(let A of c){let y=o.indexOf(A);y!==-1&&(h===-1||y{let o=await fetch(e,n);if(o.ok)return o;throw qQr.includes(o.status)?new Error(`Retryable HTTP Error: ${o.statusText}`):new lge.AbortError(`Non-retryable exception ${o.statusText} sending request`)},{retries:((r=s.attempts)!==null&&r!==void 0?r:WQr)-1})}getDefaultHeaders(){let e={},n=QQr+" "+this.clientOptions.userAgentExtra;return e[LQr]=n,e[a4e]=n,e[OQr]="application/json",e}async getHeadersInternal(e,n){let r=new Headers;if(e&&e.headers){for(let[s,i]of Object.entries(e.headers))r.append(s,i);e.timeout&&e.timeout>0&&r.append(MQr,String(Math.ceil(e.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(r,n),r}getFileName(e){var n;let r="";return typeof e=="string"&&(r=e.replace(/[/\\]+$/,""),r=(n=r.split(/[/\\]/).pop())!==null&&n!==void 0?n:""),r}async uploadFile(e,n){var r;let s={};n!=null&&(s.mimeType=n.mimeType,s.name=n.name,s.displayName=n.displayName),s.name&&!s.name.startsWith("files/")&&(s.name=`files/${s.name}`);let i=this.clientOptions.uploader,o=await i.stat(e);s.sizeBytes=String(o.size);let a=(r=n?.mimeType)!==null&&r!==void 0?r:o.type;if(a===void 0||a==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");s.mimeType=a;let c={file:s},u=this.getFileName(e),l=Zn("upload/v1beta/files",c._url),d=await this.fetchUploadUrl(l,s.sizeBytes,s.mimeType,u,c,n?.httpOptions);return i.upload(e,d,this)}async uploadFileToFileSearchStore(e,n,r){var s;let i=this.clientOptions.uploader,o=await i.stat(n),a=String(o.size),c=(s=r?.mimeType)!==null&&s!==void 0?s:o.type;if(c===void 0||c==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");let u=`upload/v1beta/${e}:uploadToFileSearchStore`,l=this.getFileName(n),d={};r!=null&&YHt(r,d);let h=await this.fetchUploadUrl(u,a,c,l,d,r?.httpOptions);return i.uploadToFileSearchStore(n,h,this)}async downloadFile(e){await this.clientOptions.downloader.download(e,this)}async fetchUploadUrl(e,n,r,s,i,o){var a;let c={};o?c=o:c={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${n}`,"X-Goog-Upload-Header-Content-Type":`${r}`},s?{"X-Goog-Upload-File-Name":s}:{})};let u=await this.request({path:e,body:JSON.stringify(i),httpMethod:"POST",httpOptions:c});if(!u||!u?.headers)throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");let l=(a=u?.headers)===null||a===void 0?void 0:a["x-goog-upload-url"];if(l===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return l}};VQr="mcp_used/unknown",jQr=!1;l4e=class t{constructor(e=[],n){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=e,this.config=n}static create(e,n){return new t(e,n)}async initialize(){var e,n,r,s;if(this.mcpTools.length>0)return;let i={},o=[];for(let l of this.mcpClients)try{for(var a=!0,c=(n=void 0,L_(KQr(l))),u;u=await c.next(),e=u.done,!e;a=!0){s=u.value,a=!1;let d=s;o.push(d);let h=d.name;if(i[h])throw new Error(`Duplicate function name ${h} found in MCP tools. Please ensure function names are unique.`);i[h]=l}}catch(d){n={error:d}}finally{try{!a&&!e&&(r=c.return)&&await r.call(c)}finally{if(n)throw n.error}}this.mcpTools=o,this.functionNameToMcpClient=i}async tool(){return await this.initialize(),hOr(this.mcpTools,this.config)}async callTool(e){await this.initialize();let n=[];for(let r of e)if(r.name in this.functionNameToMcpClient){let s=this.functionNameToMcpClient[r.name],i;this.config.timeout&&(i={timeout:this.config.timeout});let o=await s.callTool({name:r.name,arguments:r.args},void 0,i);n.push({functionResponse:{name:r.name,response:o.isError?{error:o}:o}})}return n}};u4e=class{constructor(e,n,r){this.apiClient=e,this.auth=n,this.webSocketFactory=r}async connect(e){var n,r;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");let s=this.apiClient.getWebsocketBaseUrl(),i=this.apiClient.getApiVersion(),o=XQr(this.apiClient.getDefaultHeaders()),a=this.apiClient.getApiKey(),c=`${s}/ws/google.ai.generativelanguage.${i}.GenerativeService.BidiGenerateMusic?key=${a}`,u=()=>{},l=new Promise(S=>{u=S}),d=e.callbacks,h=function(){u({})},m=this.apiClient,f={onopen:h,onmessage:S=>{zQr(m,d.onmessage,S)},onerror:(n=d?.onerror)!==null&&n!==void 0?n:function(S){},onclose:(r=d?.onclose)!==null&&r!==void 0?r:function(S){}},g=this.webSocketFactory.create(c,JQr(o),f);g.connect(),await l;let b={setup:{model:Bo(this.apiClient,e.model)}};return g.send(JSON.stringify(b)),new d4e(g,this.apiClient)}},d4e=class{constructor(e,n){this.conn=e,this.apiClient=n}async setWeightedPrompts(e){if(!e.weightedPrompts||Object.keys(e.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");let n=gLr(e);this.conn.send(JSON.stringify({clientContent:n}))}async setMusicGenerationConfig(e){e.musicGenerationConfig||(e.musicGenerationConfig={});let n=fLr(e);this.conn.send(JSON.stringify(n))}sendPlaybackControl(e){let n={playbackControl:e};this.conn.send(JSON.stringify(n))}play(){this.sendPlaybackControl(Sq.PLAY)}pause(){this.sendPlaybackControl(Sq.PAUSE)}stop(){this.sendPlaybackControl(Sq.STOP)}resetContext(){this.sendPlaybackControl(Sq.RESET_CONTEXT)}close(){this.conn.close()}};ZQr="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";p4e=class{constructor(e,n,r){this.apiClient=e,this.auth=n,this.webSocketFactory=r,this.music=new u4e(this.apiClient,this.auth,this.webSocketFactory)}async connect(e){var n,r,s,i,o,a;if(e.config&&e.config.httpOptions)throw new Error("The Live module does not support httpOptions at request-level in LiveConnectConfig yet. Please use the client-level httpOptions configuration instead.");let c=this.apiClient.getWebsocketBaseUrl(),u=this.apiClient.getApiVersion(),l,d=this.apiClient.getHeaders();e.config&&e.config.tools&&KHt(e.config.tools)&&zHt(d);let h=rUr(d);if(this.apiClient.isVertexAI()){let N=this.apiClient.getProject(),P=this.apiClient.getLocation(),G=this.apiClient.getApiKey(),$=!!N&&!!P||!!G;this.apiClient.getCustomBaseUrl()&&!$?l=c:(l=`${c}/ws/google.cloud.aiplatform.${u}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(h,l))}else{let N=this.apiClient.getApiKey(),P="BidiGenerateContent",G="key";N?.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),u!=="v1alpha"&&console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."),P="BidiGenerateContentConstrained",G="access_token"),l=`${c}/ws/google.ai.generativelanguage.${u}.GenerativeService.${P}?${G}=${N}`}let m=()=>{},f=new Promise(N=>{m=N}),g=e.callbacks,A=function(){var N;(N=g?.onopen)===null||N===void 0||N.call(g),m({})},y=this.apiClient,b={onopen:A,onmessage:N=>{eUr(y,g.onmessage,N)},onerror:(n=g?.onerror)!==null&&n!==void 0?n:function(N){},onclose:(r=g?.onclose)!==null&&r!==void 0?r:function(N){}},S=this.webSocketFactory.create(l,nUr(h),b);S.connect(),await f;let C=Bo(this.apiClient,e.model);if(this.apiClient.isVertexAI()&&C.startsWith("publishers/")){let N=this.apiClient.getProject(),P=this.apiClient.getLocation();N&&P&&(C=`projects/${N}/locations/${P}/`+C)}let I={};this.apiClient.isVertexAI()&&((s=e.config)===null||s===void 0?void 0:s.responseModalities)===void 0&&(e.config===void 0?e.config={responseModalities:[Bfe.AUDIO]}:e.config.responseModalities=[Bfe.AUDIO]),!((i=e.config)===null||i===void 0)&&i.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");let x=(a=(o=e.config)===null||o===void 0?void 0:o.tools)!==null&&a!==void 0?a:[],w=[];for(let N of x)if(this.isCallableTool(N)){let P=N;w.push(await P.tool())}else w.push(N);w.length>0&&(e.config.tools=w);let R={model:C,config:e.config,callbacks:e.callbacks};return this.apiClient.isVertexAI()?I=mLr(this.apiClient,R):I=hLr(this.apiClient,R),delete I.config,S.send(JSON.stringify(I)),new h4e(S,this.apiClient)}isCallableTool(e){return"callTool"in e&&typeof e.callTool=="function"}},tUr={turnComplete:!0},h4e=class{constructor(e,n){this.conn=e,this.apiClient=n}tLiveClientContent(e,n){if(n.turns!==null&&n.turns!==void 0){let r=[];try{r=qf(n.turns),e.isVertexAI()||(r=r.map(s=>cz(s)))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof n.turns}'`)}return{clientContent:{turns:r,turnComplete:n.turnComplete}}}return{clientContent:{turnComplete:n.turnComplete}}}tLiveClienttToolResponse(e,n){let r=[];if(n.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(n.functionResponses)?r=n.functionResponses:r=[n.functionResponses],r.length===0)throw new Error("functionResponses is required.");for(let i of r){if(typeof i!="object"||i===null||!("name"in i)||!("response"in i))throw new Error(`Could not parse function response, type '${typeof i}'.`);if(!e.isVertexAI()&&!("id"in i))throw new Error(ZQr)}return{toolResponse:{functionResponses:r}}}sendClientContent(e){e=Object.assign(Object.assign({},tUr),e);let n=this.tLiveClientContent(this.apiClient,e);this.conn.send(JSON.stringify(n))}sendRealtimeInput(e){let n={};this.apiClient.isVertexAI()?n={realtimeInput:yLr(e)}:n={realtimeInput:ALr(e)},this.conn.send(JSON.stringify(n))}sendToolResponse(e){if(e.functionResponses==null)throw new Error("Tool response parameters are required.");let n=this.tLiveClienttToolResponse(this.apiClient,e);this.conn.send(JSON.stringify(n))}close(){this.conn.close()}};cHt=10;m4e=class extends F_{constructor(e){super(),this.apiClient=e,this.embedContent=async n=>{if(!this.apiClient.isVertexAI())return n.model.includes("gemini-embedding-2")&&(n.contents=qf(n.contents)),await this.embedContentInternal(n);if(n.model.includes("gemini")&&n.model!=="gemini-embedding-001"||n.model.includes("maas")){let s=qf(n.contents);if(s.length>1)throw new Error("The embedContent API for this model only supports one content at a time.");let i=Object.assign(Object.assign({},n),{content:s[0],embeddingApiType:Pfe.EMBED_CONTENT});return await this.embedContentInternal(i)}else{let s=Object.assign(Object.assign({},n),{embeddingApiType:Pfe.PREDICT});return await this.embedContentInternal(s)}},this.generateContent=async n=>{var r,s,i,o,a;let c=await this.processParamsMaybeAddMcpUsage(n);if(this.maybeMoveToResponseJsonSchem(n),!sUr(n)||lHt(n.config))return await this.generateContentInternal(c);let u=uHt(n);if(u.length>0){let g=u.map(A=>`tools[${A}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${g}.`)}let l,d,h=qf(c.contents),m=(i=(s=(r=c.config)===null||r===void 0?void 0:r.automaticFunctionCalling)===null||s===void 0?void 0:s.maximumRemoteCalls)!==null&&i!==void 0?i:cHt,f=0;for(;f{var r,s,i,o,a;if(this.maybeMoveToResponseJsonSchem(n),lHt(n.config)){let d=await this.processParamsMaybeAddMcpUsage(n);return await this.generateContentStreamInternal(d)}let c=uHt(n);if(c.length>0){let d=c.map(h=>`tools[${h}]`).join(", ");throw new Error(`Incompatible tools found at ${d}. Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations" is not yet supported.`)}let u=(i=(s=(r=n?.config)===null||r===void 0?void 0:r.toolConfig)===null||s===void 0?void 0:s.functionCallingConfig)===null||i===void 0?void 0:i.streamFunctionCallArguments,l=(a=(o=n?.config)===null||o===void 0?void 0:o.automaticFunctionCalling)===null||a===void 0?void 0:a.disable;if(u&&!l)throw new Error("Running in streaming mode with 'streamFunctionCallArguments' enabled, this feature is not compatible with automatic function calling (AFC). Please set 'config.automaticFunctionCalling.disable' to true to disable AFC or leave 'config.toolConfig.functionCallingConfig.streamFunctionCallArguments' to be undefined or set to false to disable streaming function call arguments feature.");return await this.processAfcStream(n)},this.generateImages=async n=>await this.generateImagesInternal(n).then(r=>{var s;let i,o=[];if(r?.generatedImages)for(let c of r.generatedImages)c&&c?.safetyAttributes&&((s=c?.safetyAttributes)===null||s===void 0?void 0:s.contentType)==="Positive Prompt"?i=c?.safetyAttributes:o.push(c);let a;return i?a={generatedImages:o,positivePromptSafetyAttributes:i,sdkHttpResponse:r.sdkHttpResponse}:a={generatedImages:o,sdkHttpResponse:r.sdkHttpResponse},a}),this.list=async n=>{var r;let o={config:Object.assign(Object.assign({},{queryBase:!0}),n?.config)};if(this.apiClient.isVertexAI()&&!o.config.queryBase){if(!((r=o.config)===null||r===void 0)&&r.filter)throw new Error("Filtering tuned models list for Gemini Enterprise Agent Platform (previously known as Vertex AI) is not currently supported");o.config.filter="labels.tune-type:*"}return new pw(dw.PAGED_ITEM_MODELS,a=>this.listInternal(a),await this.listInternal(o),o)},this.editImage=async n=>{let r={model:n.model,prompt:n.prompt,referenceImages:[],config:n.config};return n.referenceImages&&n.referenceImages&&(r.referenceImages=n.referenceImages.map(s=>s.toReferenceImageAPI())),await this.editImageInternal(r)},this.upscaleImage=async n=>{let r={numberOfImages:1,mode:"upscale"};n.config&&(r=Object.assign(Object.assign({},r),n.config));let s={model:n.model,image:n.image,upscaleFactor:n.upscaleFactor,config:r};return await this.upscaleImageInternal(s)},this.generateVideos=async n=>{var r,s,i,o,a,c;if((n.prompt||n.image||n.video)&&n.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return this.apiClient.isVertexAI()||(!((r=n.video)===null||r===void 0)&&r.uri&&(!((s=n.video)===null||s===void 0)&&s.videoBytes)?n.video={uri:n.video.uri,mimeType:n.video.mimeType}:!((o=(i=n.source)===null||i===void 0?void 0:i.video)===null||o===void 0)&&o.uri&&(!((c=(a=n.source)===null||a===void 0?void 0:a.video)===null||c===void 0)&&c.videoBytes)&&(n.source.video={uri:n.source.video.uri,mimeType:n.source.video.mimeType})),await this.generateVideosInternal(n)}}maybeMoveToResponseJsonSchem(e){e.config&&e.config.responseSchema&&(e.config.responseJsonSchema||Object.keys(e.config.responseSchema).includes("$schema")&&(e.config.responseJsonSchema=e.config.responseSchema,delete e.config.responseSchema))}async processParamsMaybeAddMcpUsage(e){var n,r,s;let i=(n=e.config)===null||n===void 0?void 0:n.tools;if(!i)return e;let o=await Promise.all(i.map(async c=>Iq(c)?await c.tool():c)),a={model:e.model,contents:e.contents,config:Object.assign(Object.assign({},e.config),{tools:o})};if(a.config.tools=o,e.config&&e.config.tools&&KHt(e.config.tools)){let c=(s=(r=e.config.httpOptions)===null||r===void 0?void 0:r.headers)!==null&&s!==void 0?s:{},u=Object.assign({},c);Object.keys(u).length===0&&(u=this.apiClient.getDefaultHeaders()),zHt(u),a.config.httpOptions=Object.assign(Object.assign({},e.config.httpOptions),{headers:u})}return a}async initAfcToolsMap(e){var n,r,s;let i=new Map;for(let o of(r=(n=e.config)===null||n===void 0?void 0:n.tools)!==null&&r!==void 0?r:[])if(Iq(o)){let a=o,c=await a.tool();for(let u of(s=c.functionDeclarations)!==null&&s!==void 0?s:[]){if(!u.name)throw new Error("Function declaration name is required.");if(i.has(u.name))throw new Error(`Duplicate tool declaration name: ${u.name}`);i.set(u.name,a)}}return i}async processAfcStream(e){var n,r,s;let i=(s=(r=(n=e.config)===null||n===void 0?void 0:n.automaticFunctionCalling)===null||r===void 0?void 0:r.maximumRemoteCalls)!==null&&s!==void 0?s:cHt,o=!1,a=0,c=await this.initAfcToolsMap(e);return(function(u,l,d){return M_(this,arguments,function*(){for(var h,m,f,g,A,y;a0){o=!0;let N=new AO;N.candidates=[{content:{role:"user",parts:w}}],yield yield oi(N);let P=[];P.push(...R),P.push({role:"user",parts:w});let G=qf(d.contents).concat(P);d.contents=G}else break}})})(this,c,e)}async generateContentInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=sHt(this.apiClient,e);return a=Zn("{model}:generateContent",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=oHt(l),h=new AO;return Object.assign(h,d),h})}else{let u=rHt(this.apiClient,e);return a=Zn("{model}:generateContent",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=iHt(l),h=new AO;return Object.assign(h,d),h})}}async generateContentStreamInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=sHt(this.apiClient,e);return a=Zn("{model}:streamGenerateContent?alt=sse",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.requestStream({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}),o.then(function(d){return M_(this,arguments,function*(){var h,m,f,g;try{for(var A=!0,y=L_(d),b;b=yield oi(y.next()),h=b.done,!h;A=!0){g=b.value,A=!1;let S=g,C=oHt(yield oi(S.json()),e);C.sdkHttpResponse={headers:S.headers};let I=new AO;Object.assign(I,C),yield yield oi(I)}}catch(S){m={error:S}}finally{try{!A&&!h&&(f=y.return)&&(yield oi(f.call(y)))}finally{if(m)throw m.error}}})})}else{let u=rHt(this.apiClient,e);return a=Zn("{model}:streamGenerateContent?alt=sse",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.requestStream({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}),o.then(function(d){return M_(this,arguments,function*(){var h,m,f,g;try{for(var A=!0,y=L_(d),b;b=yield oi(y.next()),h=b.done,!h;A=!0){g=b.value,A=!1;let S=g,C=iHt(yield oi(S.json()),e);C.sdkHttpResponse={headers:S.headers};let I=new AO;Object.assign(I,C),yield yield oi(I)}}catch(S){m={error:S}}finally{try{!A&&!h&&(f=y.return)&&(yield oi(f.call(y)))}finally{if(m)throw m.error}}})})}}async embedContentInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=ZLr(this.apiClient,e,e),l=fOr(e.model)?"{model}:embedContent":"{model}:predict";return a=Zn(l,u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(h=>{let m=h;return m.sdkHttpResponse={headers:d.headers},m})),o.then(d=>{let h=tFr(d,e),m=new Ofe;return Object.assign(m,h),m})}else{let u=XLr(this.apiClient,e);return a=Zn("{model}:batchEmbedContents",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=eFr(l),h=new Ofe;return Object.assign(h,d),h})}}async generateImagesInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=pFr(this.apiClient,e);return a=Zn("{model}:predict",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=mFr(l),h=new Mfe;return Object.assign(h,d),h})}else{let u=dFr(this.apiClient,e);return a=Zn("{model}:predict",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=hFr(l),h=new Mfe;return Object.assign(h,d),h})}}async editImageInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI()){let a=YLr(this.apiClient,e);return i=Zn("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),s.then(c=>{let u=KLr(c),l=new M5e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async upscaleImageInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI()){let a=mQr(this.apiClient,e);return i=Zn("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),s.then(c=>{let u=fQr(c),l=new L5e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async recontextImage(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI()){let a=YFr(this.apiClient,e);return i=Zn("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>{let u=KFr(c),l=new F5e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async segmentImage(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI()){let a=tQr(this.apiClient,e);return i=Zn("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>{let u=nQr(c),l=new Q5e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async get(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=NFr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>o4e(l))}else{let u=kFr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),o.then(l=>i4e(l))}}async listInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=UFr(this.apiClient,e);return a=Zn("{models_url}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=GFr(l),h=new Lfe;return Object.assign(h,d),h})}else{let u=QFr(this.apiClient,e);return a=Zn("{models_url}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=$Fr(l),h=new Lfe;return Object.assign(h,d),h})}}async update(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=pQr(this.apiClient,e);return a=Zn("{model}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>o4e(l))}else{let u=dQr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),o.then(l=>i4e(l))}}async delete(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=qLr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=VLr(l),h=new Ffe;return Object.assign(h,d),h})}else{let u=WLr(this.apiClient,e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=HLr(l),h=new Ffe;return Object.assign(h,d),h})}}async countTokens(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=ULr(this.apiClient,e);return a=Zn("{model}:countTokens",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=GLr(l),h=new Qfe;return Object.assign(h,d),h})}else{let u=QLr(this.apiClient,e);return a=Zn("{model}:countTokens",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=$Lr(l),h=new Qfe;return Object.assign(h,d),h})}}async computeTokens(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI()){let a=DLr(this.apiClient,e);return i=Zn("{model}:computeTokens",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),s.then(c=>{let u=BLr(c),l=new U5e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async generateVideosInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=bFr(this.apiClient,e);return a=Zn("{model}:predictLongRunning",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>{let d=yFr(l),h=new Ufe;return Object.assign(h,d),h})}else{let u=EFr(this.apiClient,e);return a=Zn("{model}:predictLongRunning",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),o.then(l=>{let d=AFr(l),h=new Ufe;return Object.assign(h,d),h})}}};f4e=class extends F_{constructor(e){super(),this.apiClient=e}async getVideosOperation(e){let n=e.operation,r=e.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){let s=n.name.split("/operations/")[0],i;r&&"httpOptions"in r&&(i=r.httpOptions);let o=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:s,config:{httpOptions:i}});return n._fromAPIResponse({apiResponse:o,_isVertexAI:!0})}else{let s=await this.getVideosOperationInternal({operationName:n.name,config:r});return n._fromAPIResponse({apiResponse:s,_isVertexAI:!1})}}async get(e){let n=e.operation,r=e.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){let s=n.name.split("/operations/")[0],i;r&&"httpOptions"in r&&(i=r.httpOptions);let o=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:s,config:{httpOptions:i}});return n._fromAPIResponse({apiResponse:o,_isVertexAI:!0})}else{let s=await this.getVideosOperationInternal({operationName:n.name,config:r});return n._fromAPIResponse({apiResponse:s,_isVertexAI:!1})}}async getVideosOperationInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=nOr(e);return a=Zn("{operationName}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o}else{let u=tOr(e);return a=Zn("{operationName}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),o}}async fetchPredictVideosOperationInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI()){let a=YPr(e);return i=Zn("{resourceName}:fetchPredictOperation",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}};g4e=class extends F_{constructor(e){super(),this.apiClient=e}async create(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{let a=lUr(this.apiClient,e);i=Zn("auth_tokens",a._url),o=a._query,delete a.config,delete a._url,delete a._query;let c=_Ur(a,e.config);return s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(u=>u.json()),s.then(u=>u)}}};A4e=class extends F_{constructor(e){super(),this.apiClient=e,this.list=async n=>new pw(dw.PAGED_ITEM_DOCUMENTS,r=>this.listInternal({parent:n.parent,config:r.config}),await this.listInternal(n),n)}async get(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=IUr(e);return i=Zn("{name}",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>c)}}async delete(e){var n,r;let s="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let o=CUr(e);s=Zn("{name}",o._url),i=o._query,delete o._url,delete o._query,await this.apiClient.request({path:s,queryParams:i,body:JSON.stringify(o),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal})}}async listInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=wUr(e);return i=Zn("{parent}/documents",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>{let u=TUr(c),l=new G5e;return Object.assign(l,u),l})}}};y4e=class extends F_{constructor(e,n=new A4e(e)){super(),this.apiClient=e,this.documents=n,this.list=async(r={})=>new pw(dw.PAGED_ITEM_FILE_SEARCH_STORES,s=>this.listInternal(s),await this.listInternal(r),r)}async uploadToFileSearchStore(e){if(this.apiClient.isVertexAI())throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files to a file search store.");return this.apiClient.uploadFileToFileSearchStore(e.fileSearchStoreName,e.file,e.config)}async downloadMedia(e,n){if(this.apiClient.isVertexAI())throw new Error("This method is only supported in the Gemini Developer client.");let r=new URL(e,"http://dummy.com"),s=r.pathname;if(s.startsWith("/")&&(s=s.slice(1)),!s.includes("/media/"))throw new Error(`Invalid uri format: ${e}. Expected to contain /media/`);let i={};r.searchParams.forEach((c,u)=>{i[u]=c}),i.alt="media";let o=Object.assign({},n?.httpOptions),a=await this.apiClient.request({path:s,httpMethod:"GET",queryParams:i,httpOptions:o});if(a instanceof Qk){let c=await a.responseInternal.arrayBuffer();return new Uint8Array(c)}else throw new Error("Unexpected response type from downloadMedia")}async create(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=SQr(this.apiClient,e);return i=Zn("fileSearchStores",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>c)}}async get(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=xQr(e);return i=Zn("{name}",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>c)}}async delete(e){var n,r;let s="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let o=IQr(e);s=Zn("{name}",o._url),i=o._query,delete o._url,delete o._query,await this.apiClient.request({path:s,queryParams:i,body:JSON.stringify(o),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal})}}async listInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=NQr(e);return i=Zn("fileSearchStores",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>{let u=DQr(c),l=new W5e;return Object.assign(l,u),l})}}async uploadToFileSearchStoreInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=BQr(e);return i=Zn("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>{let u=PQr(c),l=new q5e;return Object.assign(l,u),l})}}async importFile(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=vQr(e);return i=Zn("{file_search_store_name}:importFile",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),s.then(c=>{let u=TQr(c),l=new H5e;return Object.assign(l,u),l})}}};JHt=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return JHt=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),n=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))},vUr=()=>JHt();b4e=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};Hf=class extends Error{},Vf=class t extends Hf{constructor(e,n,r,s){super(`${t.makeMessage(e,n,r)}`),this.status=e,this.headers=s,this.error=n}static makeMessage(e,n,r){let s=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return e&&s?`${e} ${s}`:e?`${e} status code (no body)`:s||"(no status code or body)"}static generate(e,n,r,s){if(!e||!s)return new xq({message:r,cause:b4e(n)});let i=n;return e===400?new Kfe(e,i,r,s):e===401?new zfe(e,i,r,s):e===403?new Jfe(e,i,r,s):e===404?new Xfe(e,i,r,s):e===409?new Zfe(e,i,r,s):e===422?new ege(e,i,r,s):e===429?new tge(e,i,r,s):e>=500?new nge(e,i,r,s):new t(e,i,r,s)}},oz=class extends Vf{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},xq=class extends Vf{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}},Yfe=class extends xq{constructor({message:e}={}){super({message:e??"Request timed out."})}},Kfe=class extends Vf{},zfe=class extends Vf{},Jfe=class extends Vf{},Xfe=class extends Vf{},Zfe=class extends Vf{},ege=class extends Vf{},tge=class extends Vf{},nge=class extends Vf{};RUr=/^[a-z][a-z0-9+.-]*:/i,kUr=t=>RUr.test(t),_4e=t=>(_4e=Array.isArray,_4e(t)),NUr=_4e,DUr=NUr,hHt=DUr;PUr=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Hf(`${t} must be an integer`);if(e<0)throw new Hf(`${t} must be a positive integer`);return e},OUr=t=>{try{return JSON.parse(t)}catch{return}};MUr=t=>new Promise(e=>setTimeout(e,t));UUr=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});GUr="0.0.1";e5t=()=>{var t;if(typeof File>"u"){let{process:e}=globalThis,n=typeof((t=e?.versions)===null||t===void 0?void 0:t.node)=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(n?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};qUr=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function";t5t=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",HUr=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&t5t(t),VUr=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function";az=class{constructor(e){this._client=e}};az._key=[];fHt=Object.freeze(Object.create(null)),KUr=(t=n5t)=>(function(n,...r){if(n.length===1)return n[0];let s=!1,i=[],o=n.reduce((l,d,h)=>{var m,f,g;/[?#]/.test(d)&&(s=!0);let A=r[h],y=(s?encodeURIComponent:t)(""+A);return h!==r.length&&(A==null||typeof A=="object"&&A.toString===((g=Object.getPrototypeOf((f=Object.getPrototypeOf((m=A.hasOwnProperty)!==null&&m!==void 0?m:fHt))!==null&&f!==void 0?f:fHt))===null||g===void 0?void 0:g.toString))&&(y=A+"",i.push({start:l.length+d.length,length:y.length,error:`Value of type ${Object.prototype.toString.call(A).slice(8,-1)} is not a valid path parameter`})),l+d+(h===r.length?"":y)},""),a=o.split(/[?#]/,1)[0],c=/(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=c.exec(a))!==null;){let l=u[0].startsWith("/"),d=l?1:0,h=l?u[0].slice(1):u[0];i.push({start:u.index+d,length:h.length,error:`Value "${h}" can't be safely passed as a path parameter`})}if(i.sort((l,d)=>l.start-d.start),i.length>0){let l=0,d=i.reduce((h,m)=>{let f=" ".repeat(m.start-l),g="^".repeat(m.length);return l=m.start+m.length,h+f+g},"");throw new Hf(`Path parameters result in path with invalid segments: -${i.map(h=>h.error).join(` -`)} -${o} -${d}`)}return o}),O_=KUr(n5t);rge=class extends az{create(e,n){var r;let{api_version:s=this._client.apiVersion}=e,i=Ok(e,["api_version"]);if("model"in i&&"agent_config"in i)throw new Hf("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in i&&"generation_config"in i)throw new Hf("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(O_`/${s}/interactions`,Object.assign(Object.assign({body:i},n),{stream:(r=e.stream)!==null&&r!==void 0?r:!1}))}delete(e,n={},r){let{api_version:s=this._client.apiVersion}=n??{};return this._client.delete(O_`/${s}/interactions/${e}`,r)}cancel(e,n={},r){let{api_version:s=this._client.apiVersion}=n??{};return this._client.post(O_`/${s}/interactions/${e}/cancel`,r)}get(e,n={},r){var s;let i=n??{},{api_version:o=this._client.apiVersion}=i,a=Ok(i,["api_version"]);return this._client.get(O_`/${o}/interactions/${e}`,Object.assign(Object.assign({query:a},r),{stream:(s=n?.stream)!==null&&s!==void 0?s:!1}))}};rge._key=Object.freeze(["interactions"]);sge=class extends rge{};ige=class extends az{create(e,n){let{api_version:r=this._client.apiVersion}=e,s=Ok(e,["api_version"]);return this._client.post(O_`/${r}/webhooks`,Object.assign({body:s},n))}update(e,n={},r){let s=n??{},{api_version:i=this._client.apiVersion,update_mask:o}=s,a=Ok(s,["api_version","update_mask"]);return this._client.patch(O_`/${i}/webhooks/${e}`,Object.assign({query:{update_mask:o},body:a},r))}list(e={},n){let r=e??{},{api_version:s=this._client.apiVersion}=r,i=Ok(r,["api_version"]);return this._client.get(O_`/${s}/webhooks`,Object.assign({query:i},n))}delete(e,n={},r){let{api_version:s=this._client.apiVersion}=n??{};return this._client.delete(O_`/${s}/webhooks/${e}`,r)}get(e,n={},r){let{api_version:s=this._client.apiVersion}=n??{};return this._client.get(O_`/${s}/webhooks/${e}`,r)}ping(e,n=void 0,r){let{api_version:s=this._client.apiVersion,body:i}=n??{};return this._client.post(O_`/${s}/webhooks/${e}:ping`,Object.assign({body:i},r))}rotateSigningSecret(e,n={},r){let s=n??{},{api_version:i=this._client.apiVersion}=s,o=Ok(s,["api_version"]);return this._client.post(O_`/${i}/webhooks/${e}:rotateSigningSecret`,Object.assign({body:o},r))}};ige._key=Object.freeze(["webhooks"]);oge=class extends ige{};wq=class{constructor(){this.buffer=new Uint8Array,this.carriageReturnIndex=null,this.searchIndex=0}decode(e){var n;if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?$4e(e):e;this.buffer=zUr([this.buffer,r]);let s=[],i;for(;(i=JUr(this.buffer,(n=this.carriageReturnIndex)!==null&&n!==void 0?n:this.searchIndex))!=null;){if(i.carriage&&this.carriageReturnIndex==null){this.carriageReturnIndex=i.index;continue}if(this.carriageReturnIndex!=null&&(i.index!==this.carriageReturnIndex+1||i.carriage)){s.push(gHt(this.buffer.subarray(0,this.carriageReturnIndex-1))),this.buffer=this.buffer.subarray(this.carriageReturnIndex),this.carriageReturnIndex=null,this.searchIndex=0;continue}let o=this.carriageReturnIndex!==null?i.preceding-1:i.preceding,a=gHt(this.buffer.subarray(0,o));s.push(a),this.buffer=this.buffer.subarray(i.index),this.carriageReturnIndex=null,this.searchIndex=0}return this.searchIndex=Math.max(0,this.buffer.length-1),s}flush(){return this.buffer.length?this.decode(` -`):[]}};wq.NEWLINE_CHARS=new Set([` -`,"\r"]);wq.NEWLINE_REGEXP=/\r\n|[\n\r]/g;age={off:0,error:200,warn:300,info:400,debug:500},AHt=(t,e,n)=>{if(t){if(BUr(age,t))return t;Tm(n).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(age))}`)}};XUr={error:sz,warn:sz,info:sz,debug:sz},yHt=new WeakMap;gO=t=>(t.options&&(t.options=Object.assign({},t.options),delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,n])=>[e,e.toLowerCase()==="x-goog-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t);C4e=class t{constructor(e,n,r){this.iterator=e,this.controller=n,this.client=r}static fromSSEResponse(e,n,r){let s=!1,i=r?Tm(r):console;function o(){return M_(this,arguments,function*(){var c,u,l,d;if(s)throw new Hf("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let h=!1;try{try{for(var m=!0,f=L_(ZUr(e,n)),g;g=yield oi(f.next()),c=g.done,!c;m=!0){d=g.value,m=!1;let A=d;if(!h)if(A.data.startsWith("[DONE]")){h=!0;continue}else try{yield yield oi(JSON.parse(A.data))}catch(y){throw i.error("Could not parse message into JSON:",A.data),i.error("From chunk:",A.raw),y}}}catch(A){u={error:A}}finally{try{!m&&!c&&(l=f.return)&&(yield oi(l.call(f)))}finally{if(u)throw u.error}}h=!0}catch(A){if(E4e(A))return yield oi(void 0);throw A}finally{h||n.abort()}})}return new t(o,n,r)}static fromReadableStream(e,n,r){let s=!1;function i(){return M_(this,arguments,function*(){var c,u,l,d;let h=new wq,m=ZHt(e);try{for(var f=!0,g=L_(m),A;A=yield oi(g.next()),c=A.done,!c;f=!0){d=A.value,f=!1;let y=d;for(let b of h.decode(y))yield yield oi(b)}}catch(y){u={error:y}}finally{try{!f&&!c&&(l=g.return)&&(yield oi(l.call(g)))}finally{if(u)throw u.error}}for(let y of h.flush())yield yield oi(y)})}function o(){return M_(this,arguments,function*(){var c,u,l,d;if(s)throw new Hf("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let h=!1;try{try{for(var m=!0,f=L_(i()),g;g=yield oi(f.next()),c=g.done,!c;m=!0){d=g.value,m=!1;let A=d;h||A&&(yield yield oi(JSON.parse(A)))}}catch(A){u={error:A}}finally{try{!m&&!c&&(l=f.return)&&(yield oi(l.call(f)))}finally{if(u)throw u.error}}h=!0}catch(A){if(E4e(A))return yield oi(void 0);throw A}finally{h||n.abort()}})}return new t(o,n,r)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],n=[],r=this.iterator(),s=i=>({next:()=>{if(i.length===0){let o=r.next();e.push(o),n.push(o)}return i.shift()}});return[new t(()=>s(e),this.controller,this.client),new t(()=>s(n),this.controller,this.client)]}toReadableStream(){let e=this,n;return XHt({async start(){n=e[Symbol.asyncIterator]()},async pull(r){try{let{value:s,done:i}=await n.next();if(i)return r.close();let o=$4e(JSON.stringify(s)+` -`);r.enqueue(o)}catch(s){r.error(s)}},async cancel(){var r;await((r=n.return)===null||r===void 0?void 0:r.call(n))}})}};I4e=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let i={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],i}if(this.chunks.push(e),e.startsWith(":"))return null;let[n,r,s]=t2r(e,":");return s.startsWith(" ")&&(s=s.substring(1)),n==="event"?this.event=s:n==="data"&&this.data.push(s),null}};x4e=class t extends Promise{constructor(e,n,r=n2r){super(s=>{s(null)}),this.responsePromise=n,this.parseResponse=r,this.client=e}_thenUnwrap(e){return new t(this.client,this.responsePromise,async(n,r)=>e(await this.parseResponse(n,r),r))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:n}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(this.client,e))),this.parsedPromise}then(e,n){return this.parse().then(e,n)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};r5t=Symbol("brand.privateNullableHeaders");nz=t=>{let e=new Headers,n=new Set;for(let r of t){let s=new Set;for(let[i,o]of r2r(r)){let a=i.toLowerCase();s.has(a)||(e.delete(i),s.add(a)),o===null?(e.delete(i),n.add(a)):(e.append(i,o),n.delete(a))}}return{[r5t]:!0,values:e,nulls:n}};D5e=t=>{var e,n,r,s,i;if(typeof globalThis.process<"u")return((n=(e=globalThis.process.env)===null||e===void 0?void 0:e[t])===null||n===void 0?void 0:n.trim())||void 0;if(typeof globalThis.Deno<"u")return((i=(s=(r=globalThis.Deno.env)===null||r===void 0?void 0:r.get)===null||s===void 0?void 0:s.call(r,t))===null||i===void 0?void 0:i.trim())||void 0};cge=class t{constructor(e){var n,r,s,i,o,a,c,{baseURL:u=D5e("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:l=(n=D5e("GEMINI_API_KEY"))!==null&&n!==void 0?n:null,apiVersion:d="v1beta"}=e,h=Ok(e,["baseURL","apiKey","apiVersion"]);let m=Object.assign(Object.assign({apiKey:l,apiVersion:d},h),{baseURL:u||"https://generativelanguage.googleapis.com"});this.baseURL=m.baseURL,this.timeout=(r=m.timeout)!==null&&r!==void 0?r:t.DEFAULT_TIMEOUT,this.logger=(s=m.logger)!==null&&s!==void 0?s:console;let f="warn";this.logLevel=f,this.logLevel=(o=(i=AHt(m.logLevel,"ClientOptions.logLevel",this))!==null&&i!==void 0?i:AHt(D5e("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&o!==void 0?o:f,this.fetchOptions=m.fetchOptions,this.maxRetries=(a=m.maxRetries)!==null&&a!==void 0?a:2,this.fetch=(c=m.fetch)!==null&&c!==void 0?c:LUr(),this.encoder=UUr,this._options=m,this.apiKey=l,this.apiVersion=d,this.clientAdapter=m.clientAdapter}withOptions(e){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),e))}baseURLOverridden(){return this.baseURL!=="https://generativelanguage.googleapis.com"}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:n}){if(!(e.has("authorization")||e.has("x-goog-api-key"))&&!(this.apiKey&&e.get("x-goog-api-key"))&&!n.has("x-goog-api-key"))throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted')}async authHeaders(e){let n=nz([e.headers]);if(!(n.values.has("authorization")||n.values.has("x-goog-api-key"))){if(this.apiKey)return nz([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter&&this.clientAdapter.isVertexAI())return nz([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(e){return $Ur(e)}getUserAgent(){return`${this.constructor.name}/JS ${GUr}`}defaultIdempotencyKey(){return`stainless-node-retry-${vUr()}`}makeStatusError(e,n,r,s){return Vf.generate(e,n,r,s)}buildURL(e,n,r){let s=!this.baseURLOverridden()&&r||this.baseURL,i=kUr(e)?new URL(e):new URL(s+(s.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery(),a=Object.fromEntries(i.searchParams);return(!mHt(o)||!mHt(a))&&(n=Object.assign(Object.assign(Object.assign({},a),o),n)),typeof n=="object"&&n&&!Array.isArray(n)&&(i.search=this.stringifyQuery(n)),i.toString()}async prepareOptions(e){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!e.path.startsWith(`/${this.apiVersion}/projects/`)){let n=e.path.slice(this.apiVersion.length+1);e.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${n}`}}async prepareRequest(e,{url:n,options:r}){}get(e,n){return this.methodRequest("get",e,n)}post(e,n){return this.methodRequest("post",e,n)}patch(e,n){return this.methodRequest("patch",e,n)}put(e,n){return this.methodRequest("put",e,n)}delete(e,n){return this.methodRequest("delete",e,n)}methodRequest(e,n,r){return this.request(Promise.resolve(r).then(s=>Object.assign({method:e,path:n},s)))}request(e,n=null){return new x4e(this,this.makeRequest(e,n,void 0))}async makeRequest(e,n,r){var s,i,o;let a=await e,c=(s=a.maxRetries)!==null&&s!==void 0?s:this.maxRetries;n==null&&(n=c),await this.prepareOptions(a);let{req:u,url:l,timeout:d}=await this.buildRequest(a,{retryCount:c-n});await this.prepareRequest(u,{url:l,options:a});let h="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),m=r===void 0?"":`, retryOf: ${r}`,f=Date.now();if(Tm(this).debug(`[${h}] sending request`,gO({retryOfRequestLogID:r,method:a.method,url:l,options:a,headers:u.headers})),!((i=a.signal)===null||i===void 0)&&i.aborted)throw new oz;let g=new AbortController,A=await this.fetchWithTimeout(l,u,d,g).catch(b4e),y=Date.now();if(A instanceof globalThis.Error){let S=`retrying, ${n} attempts remaining`;if(!((o=a.signal)===null||o===void 0)&&o.aborted)throw new oz;let C=E4e(A)||/timed? ?out/i.test(String(A)+("cause"in A?String(A.cause):""));if(n)return Tm(this).info(`[${h}] connection ${C?"timed out":"failed"} - ${S}`),Tm(this).debug(`[${h}] connection ${C?"timed out":"failed"} (${S})`,gO({retryOfRequestLogID:r,url:l,durationMs:y-f,message:A.message})),this.retryRequest(a,n,r??h);throw Tm(this).info(`[${h}] connection ${C?"timed out":"failed"} - error; no more retries left`),Tm(this).debug(`[${h}] connection ${C?"timed out":"failed"} (error; no more retries left)`,gO({retryOfRequestLogID:r,url:l,durationMs:y-f,message:A.message})),C?new Yfe:new xq({cause:A})}let b=`[${h}${m}] ${u.method} ${l} ${A.ok?"succeeded":"failed"} with status ${A.status} in ${y-f}ms`;if(!A.ok){let S=await this.shouldRetry(A);if(n&&S){let N=`retrying, ${n} attempts remaining`;return await QUr(A.body),Tm(this).info(`${b} - ${N}`),Tm(this).debug(`[${h}] response error (${N})`,gO({retryOfRequestLogID:r,url:A.url,status:A.status,headers:A.headers,durationMs:y-f})),this.retryRequest(a,n,r??h,A.headers)}let C=S?"error; no more retries left":"error; not retryable";Tm(this).info(`${b} - ${C}`);let I=await A.text().catch(N=>b4e(N).message),x=OUr(I),w=x?void 0:I;throw Tm(this).debug(`[${h}] response error (${C})`,gO({retryOfRequestLogID:r,url:A.url,status:A.status,headers:A.headers,message:w,durationMs:Date.now()-f})),this.makeStatusError(A.status,x,w,A.headers)}return Tm(this).info(b),Tm(this).debug(`[${h}] response start`,gO({retryOfRequestLogID:r,url:A.url,status:A.status,headers:A.headers,durationMs:y-f})),{response:A,options:a,controller:g,requestLogID:h,retryOfRequestLogID:r,startTime:f}}async fetchWithTimeout(e,n,r,s){let i=n||{},{signal:o,method:a}=i,c=Ok(i,["signal","method"]),u=this._makeAbort(s);o&&o.addEventListener("abort",u,{once:!0});let l=setTimeout(u,r),d=globalThis.ReadableStream&&c.body instanceof globalThis.ReadableStream||typeof c.body=="object"&&c.body!==null&&Symbol.asyncIterator in c.body,h=Object.assign(Object.assign(Object.assign({signal:s.signal},d?{duplex:"half"}:{}),{method:"GET"}),c);a&&(h.method=a.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(l)}}async shouldRetry(e){let n=e.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,n,r,s){var i;let o,a=s?.get("retry-after-ms");if(a){let u=parseFloat(a);Number.isNaN(u)||(o=u)}let c=s?.get("retry-after");if(c&&!o){let u=parseFloat(c);Number.isNaN(u)?o=Date.parse(c)-Date.now():o=u*1e3}if(o===void 0){let u=(i=e.maxRetries)!==null&&i!==void 0?i:this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(n,u)}return await MUr(o),this.makeRequest(e,n-1,r)}calculateDefaultRetryTimeoutMillis(e,n){let i=n-e,o=Math.min(.5*Math.pow(2,i),8),a=1-Math.random()*.25;return o*a*1e3}async buildRequest(e,{retryCount:n=0}={}){var r,s,i;let o=Object.assign({},e),{method:a,path:c,query:u,defaultBaseURL:l}=o,d=this.buildURL(c,u,l);"timeout"in o&&PUr("timeout",o.timeout),o.timeout=(r=o.timeout)!==null&&r!==void 0?r:this.timeout;let{bodyHeaders:h,body:m}=this.buildBody({options:o}),f=await this.buildHeaders({options:e,method:a,bodyHeaders:h,retryCount:n});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:a,headers:f},o.signal&&{signal:o.signal}),globalThis.ReadableStream&&m instanceof globalThis.ReadableStream&&{duplex:"half"}),m&&{body:m}),(s=this.fetchOptions)!==null&&s!==void 0?s:{}),(i=o.fetchOptions)!==null&&i!==void 0?i:{}),url:d,timeout:o.timeout}}async buildHeaders({options:e,method:n,bodyHeaders:r,retryCount:s}){let i={};this.idempotencyHeader&&n!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);let o=await this.authHeaders(e),a=nz([i,{Accept:"application/json","User-Agent":this.getUserAgent()},this._options.defaultHeaders,r,e.headers,o]);return this.validateHeaders(a),a.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:n}}){if(!e)return{bodyHeaders:void 0,body:void 0};let r=nz([n]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:FUr(e)}:typeof e=="object"&&r.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:this.encoder({body:e,headers:r})}};cge.DEFAULT_TIMEOUT=6e4;pu=class extends cge{constructor(){super(...arguments),this.interactions=new sge(this),this.webhooks=new oge(this)}};s5t=pu;pu.GeminiNextGenAPIClient=s5t;pu.GeminiNextGenAPIClientError=Hf;pu.APIError=Vf;pu.APIConnectionError=xq;pu.APIConnectionTimeoutError=Yfe;pu.APIUserAbortError=oz;pu.NotFoundError=Xfe;pu.ConflictError=Zfe;pu.RateLimitError=tge;pu.BadRequestError=Kfe;pu.AuthenticationError=zfe;pu.InternalServerError=nge;pu.PermissionDeniedError=Jfe;pu.UnprocessableEntityError=ege;pu.toFile=jUr;pu.Interactions=sge;pu.Webhooks=oge;EHt="x-goog-api-key",rz="https://www.googleapis.com/auth/cloud-platform",w4e=class{constructor(e){if(e.apiKey!==void 0){this.apiKey=e.apiKey;return}let n=s2r(e.googleAuthOptions);this.googleAuth=new _Ht.GoogleAuth(n)}async addAuthHeaders(e,n){if(this.apiKey!==void 0){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");this.addKeyHeader(e);return}return this.addGoogleAuthHeaders(e,n)}addKeyHeader(e){if(e.get(EHt)===null){if(this.apiKey===void 0)throw new Error("Trying to set API key header but apiKey is not set");e.append(EHt,this.apiKey)}}async addGoogleAuthHeaders(e,n){if(this.googleAuth===void 0)throw new Error("Trying to set google-auth headers but googleAuth is unset");let r=await this.googleAuth.getRequestHeaders(n);for(let[s,i]of r)e.get(s)===null&&e.append(s,i)}};T4e=class{async download(e,n){if(e.downloadPath){let r=await i2r(e,n);if(r instanceof Qk){let s=(0,SHt.createWriteStream)(e.downloadPath);IHt.Readable.fromWeb(r.responseInternal.body).pipe(s),await(0,xHt.finished)(s)}else try{await(0,CHt.writeFile)(e.downloadPath,r,{encoding:"base64"})}catch(s){throw new Error(`Failed to write file to ${e.downloadPath}: ${s}`)}}}};v4e=class{create(e,n,r){return new R4e(e,n,r)}},R4e=class{constructor(e,n,r){this.url=e,this.headers=n,this.callbacks=r}connect(){this.ws=new k5e.default(this.url,{headers:this.headers}),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(e){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(e)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}};N4e=class extends F_{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new pw(dw.PAGED_ITEM_TUNING_JOBS,r=>this.listInternal(r),await this.listInternal(n),n),this.get=async n=>await this.getInternal(n),this.tune=async n=>{var r;if(this.apiClient.isVertexAI())if(n.baseModel.startsWith("projects/")){let s={tunedModelName:n.baseModel};!((r=n.config)===null||r===void 0)&&r.preTunedModelCheckpointId&&(s.checkpointId=n.config.preTunedModelCheckpointId);let i=Object.assign(Object.assign({},n),{preTunedModel:s});return i.baseModel=void 0,await this.tuneInternal(i)}else{let s=Object.assign({},n);return await this.tuneInternal(s)}else{let s=Object.assign({},n),i=await this.tuneMldevInternal(s),o="";return i.metadata!==void 0&&i.metadata.tunedModel!==void 0?o=i.metadata.tunedModel:i.name!==void 0&&i.name.includes("/operations/")&&(o=i.name.split("/operations/")[0]),{name:o,state:O5e.JOB_STATE_QUEUED}}}}async getInternal(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=f2r(e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>k4e(l))}else{let u=m2r(e);return a=Zn("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>S2r(l))}}async listInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI()){let a=A2r(e);return i=Zn("tuningJobs",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),s.then(c=>{let u=y2r(c),l=new $5e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async cancel(e){var n,r,s,i;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=a2r(e);return a=Zn("{name}:cancel",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=l2r(l),h=new $fe;return Object.assign(h,d),h})}else{let u=o2r(e);return a=Zn("{name}:cancel",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(d=>{let h=d;return h.sdkHttpResponse={headers:l.headers},h})),o.then(l=>{let d=c2r(l),h=new $fe;return Object.assign(h,d),h})}}async tuneInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI()){let a=h2r(e,e);return i=Zn("tuningJobs",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),s.then(c=>k4e(c))}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async tuneMldevInternal(e){var n,r;let s,i="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=p2r(e);return i=Zn("tunedModels",a._url),o=a._query,delete a._url,delete a._query,s=this.apiClient.request({path:i,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),s.then(c=>C2r(c))}}},i5t=1024*1024*8,o5t=3,a5t=1e3,c5t=2,Mk="x-goog-upload-status";D4e=class{async stat(e){let n={size:0,type:void 0};if(typeof e=="string"){let r=await uge.stat(e);return n.size=r.size,n.type=this.inferMimeType(e),n}else return await w2r(e)}async upload(e,n,r,s){return typeof e=="string"?await this.uploadFileFromPath(e,n,r,s):I2r(e,n,r,s)}async uploadToFileSearchStore(e,n,r,s){return typeof e=="string"?await this.uploadFileToFileSearchStoreFromPath(e,n,r,s):x2r(e,n,r,s)}inferMimeType(e){let n=e.slice(e.lastIndexOf(".")+1);return{aac:"audio/aac",abw:"application/x-abiword",arc:"application/x-freearc",avi:"video/x-msvideo",azw:"application/vnd.amazon.ebook",bin:"application/octet-stream",bmp:"image/bmp",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",css:"text/css",csv:"text/csv",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",eot:"application/vnd.ms-fontobject",epub:"application/epub+zip",gz:"application/gzip",gif:"image/gif",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",ics:"text/calendar",jar:"application/java-archive",jpeg:"image/jpeg",jpg:"image/jpeg",js:"text/javascript",json:"application/json",jsonld:"application/ld+json",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz+xml",mjs:"text/javascript",mp3:"audio/mpeg",mp4:"video/mp4",mpeg:"video/mpeg",mpkg:"application/vnd.apple.installer+xml",odt:"application/vnd.oasis.opendocument.text",oga:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",opus:"audio/opus",otf:"font/otf",png:"image/png",pdf:"application/pdf",php:"application/x-httpd-php",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",rar:"application/vnd.rar",rtf:"application/rtf",sh:"application/x-sh",svg:"image/svg+xml",swf:"application/x-shockwave-flash",tar:"application/x-tar",tif:"image/tiff",tiff:"image/tiff",ts:"video/mp2t",ttf:"font/ttf",txt:"text/plain",vsd:"application/vnd.visio",wav:"audio/wav",weba:"audio/webm",webm:"video/webm",webp:"image/webp",woff:"font/woff",woff2:"font/woff2",xhtml:"application/xhtml+xml",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xml:"application/xml",xul:"application/vnd.mozilla.xul+xml",zip:"application/zip","3gp":"video/3gpp","3g2":"video/3gpp2","7z":"application/x-7z-compressed"}[n.toLowerCase()]}async uploadFileFromPath(e,n,r,s){var i;let o=await this.uploadFileFromPathInternal(e,n,r,s),a=await o?.json();if(((i=o?.headers)===null||i===void 0?void 0:i[Mk])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return a.file}async uploadFileToFileSearchStoreFromPath(e,n,r,s){var i;let o=await this.uploadFileFromPathInternal(e,n,r,s),a=await o?.json();if(((i=o?.headers)===null||i===void 0?void 0:i[Mk])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");let c=O4e(a),u=new Hfe;return Object.assign(u,c),u}async uploadFileFromPathInternal(e,n,r,s){var i,o,a;let c=n,u=s?.baseUrl||((i=r.clientOptions.httpOptions)===null||i===void 0?void 0:i.baseUrl);if(u){let A=new URL(u),y=new URL(n);y.protocol=A.protocol,y.host=A.host,y.port=A.port,c=y.toString()}let l=0,d=0,h=new Qk(new Response),m="upload",f,g=wHt.basename(e);try{if(f=await uge.open(e,"r"),!f)throw new Error("Failed to open file");for(l=(await f.stat()).size;d=l&&(m+=", finalize");let y=new Uint8Array(A),{bytesRead:b}=await f.read(y,0,A,d);if(b!==A)throw new Error(`Failed to read ${A} bytes from file at offset ${d}. bytes actually read: ${b}`);let S=new Blob([y]),C=0,I=a5t;for(;C"u"||!process.versions||!process.versions.node)throw new Error("registerFiles is only supported in Node.js environments.");let r=await e.auth.getRequestHeaders(),s=e.config||{},i=s.httpOptions||{},o=Object.assign({},i.headers||{});if(r)if(typeof r[Symbol.iterator]=="function")for(let[a,c]of r)o[a]=c;else for(let[a,c]of Object.entries(r))o[a]=c;return this._registerFiles({uris:e.uris,config:Object.assign(Object.assign({},s),{httpOptions:Object.assign(Object.assign({},i),{headers:o})})})}};T2r="gl-node/";yO=class{getNextGenClient(){var e;let n=this.httpOptions;return this._nextGenClient===void 0&&(this._nextGenClient=new pu({baseURL:this.apiClient.getBaseUrl(),apiKey:this.apiKey,apiVersion:this.apiClient.getApiVersion(),clientAdapter:this.apiClient,defaultHeaders:this.apiClient.getDefaultHeaders(),timeout:n?.timeout,maxRetries:(e=n?.retryOptions)===null||e===void 0?void 0:e.attempts})),n?.extraBody&&console.warn("GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored."),this._nextGenClient}get interactions(){return this._interactions!==void 0?this._interactions:(console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions."),this._interactions=this.getNextGenClient().interactions,this._interactions)}get webhooks(){return this._webhooks!==void 0?this._webhooks:(this._webhooks=this.getNextGenClient().webhooks,this._webhooks)}constructor(e){var n,r,s,i;if((e.project||e.location)&&e.apiKey)throw new Error("Project/location and API key are mutually exclusive in the client initializer.");this.vertexai=v2r(e);let o=R2r(),a=Lk("GOOGLE_CLOUD_PROJECT"),c=Lk("GOOGLE_CLOUD_LOCATION");this.apiKey=(n=e.apiKey)!==null&&n!==void 0?n:o,this.project=(r=e.project)!==null&&r!==void 0?r:a,this.location=(s=e.location)!==null&&s!==void 0?s:c,!this.vertexai&&!this.apiKey&&console.warn("API key should be set when using the Gemini API."),this.vertexai&&(!((i=e.googleAuthOptions)===null||i===void 0)&&i.credentials&&(console.debug("The user provided Google Cloud credentials will take precedence over the API key from the environment variable."),this.apiKey=void 0),(a||c)&&e.apiKey?(console.debug("The user provided Vertex AI API key will take precedence over the project/location from the environment variables."),this.project=void 0,this.location=void 0):(e.project||e.location)&&o?(console.debug("The user provided project/location will take precedence over the API key from the environment variables."),this.apiKey=void 0):(a||c)&&o&&(console.debug("The project/location from the environment variables will take precedence over the API key from the environment variables."),this.apiKey=void 0),!this.location&&!this.apiKey&&(this.location="global"));let u=VPr(e.httpOptions,this.vertexai,Lk("GOOGLE_VERTEX_BASE_URL"),Lk("GOOGLE_GEMINI_BASE_URL"));u&&(e.httpOptions?e.httpOptions.baseUrl=u:e.httpOptions={baseUrl:u}),this.apiVersion=e.apiVersion,this.httpOptions=e.httpOptions;let l=new w4e({apiKey:this.apiKey,googleAuthOptions:e.googleAuthOptions});this.apiClient=new c4e({auth:l,project:this.project,location:this.location,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:T2r+process.version,uploader:new D4e,downloader:new T4e}),this.models=new m4e(this.apiClient),this.live=new p4e(this.apiClient,l,new v4e),this.batches=new e4e(this.apiClient),this.chats=new n4e(this.models,this.apiClient),this.caches=new t4e(this.apiClient),this.files=new B4e(this.apiClient),this.operations=new f4e(this.apiClient),this.authTokens=new g4e(this.apiClient),this.tunings=new N4e(this.apiClient),this.fileSearchStores=new y4e(this.apiClient)}}});function mge(t,e){if(e==="off")return"high";let n=t.thinkingLevelMap?.[e],r=typeof n=="string"?n.toLowerCase():e;switch(r){case"minimal":case"low":case"medium":case"high":return r;default:throw new Error(`Unsupported Google thinking level mapping for ${t.provider}/${t.id}: ${e} -> ${String(n)}`)}}function fge(t){return t.thought===!0}function Nq(t,e){return typeof e=="string"&&e.length>0?e:t}function N2r(t){return!t||t.length%4!==0?!1:k2r.test(t)}function G4e(t,e){return t&&N2r(e)?e:void 0}function W4e(t){let e=q4e(t);return t.startsWith("claude-")||t.startsWith("gpt-oss-")||e!==void 0&&e>=3}function q4e(t){let e=t.toLowerCase().match(/^gemini(?:-live)?-(\d+)/);if(e)return Number.parseInt(e[1],10)}function D2r(t){let e=q4e(t);return e!==void 0?e>=3:!0}function gge(t,e){let n=[],r=i=>W4e(t.id)?i.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,64):i,s=lE(e.messages,t,r);for(let i of s)if(i.role==="user")if(typeof i.content=="string")n.push({role:"user",parts:[{text:ts(i.content)}]});else{let o=i.content.map(a=>a.type==="text"?{text:ts(a.text)}:{inlineData:{mimeType:a.mimeType,data:a.data}});if(o.length===0)continue;n.push({role:"user",parts:o})}else if(i.role==="assistant"){let o=[],a=i.provider===t.provider&&i.model===t.id;for(let c of i.content)if(c.type==="text"){let u=G4e(a,c.textSignature);if((!c.text||c.text.trim()==="")&&!u)continue;o.push({text:ts(c.text),...u&&{thoughtSignature:u}})}else if(c.type==="thinking")if(a){let u=G4e(a,c.thinkingSignature);if((!c.thinking||c.thinking.trim()==="")&&!u)continue;o.push({thought:!0,text:ts(c.thinking),...u&&{thoughtSignature:u}})}else{if(!c.thinking||c.thinking.trim()==="")continue;o.push({text:ts(c.thinking)})}else if(c.type==="toolCall"){let u=G4e(a,c.thoughtSignature),l={functionCall:{name:c.name,args:c.arguments??{},...W4e(t.id)?{id:c.id}:{}},...u&&{thoughtSignature:u}};o.push(l)}if(o.length===0)continue;n.push({role:"model",parts:o})}else if(i.role==="toolResult"){let a=i.content.filter(y=>y.type==="text").map(y=>y.text).join(` -`),c=t.input.includes("image")?i.content.filter(y=>y.type==="image"):[],u=a.length>0,l=c.length>0,d=D2r(t.id),h=u?ts(a):l?"(see attached image)":"",m=c.map(y=>({inlineData:{mimeType:y.mimeType,data:y.data}})),f=W4e(t.id),g={functionResponse:{name:i.toolName,response:i.isError?{error:h}:{output:h},...l&&d&&{parts:m},...f?{id:i.toolCallId}:{}}},A=n[n.length-1];A?.role==="user"&&A.parts?.some(y=>y.functionResponse)?A.parts.push(g):n.push({role:"user",parts:[g]}),l&&!d&&n.push({role:"user",parts:[{text:"Tool result image:"},...m]})}return n}function p5t(t){if(typeof t!="object"||t===null||Array.isArray(t))return t;let e={};for(let[n,r]of Object.entries(t))B2r.has(n)||(e[n]=p5t(r));return e}function Age(t,e=!1,n=!0){if(t.length!==0)return[{functionDeclarations:t.map(r=>{let s=oA(r,n),i=aE(r,s);return{name:r.name,description:r.description,...e?{parameters:p5t(i)}:{parametersJsonSchema:i}}})}]}function yge(t){let e=q4e(t);return e!==void 0&&e>=3}function d5t(t){switch(t){case"auto":return Fk.AUTO;case"none":return Fk.NONE;case"any":return Fk.ANY;default:return Fk.AUTO}}function Ege(t,e,n){let r=t.some(s=>oA(s,n)===!0);return e==="none"||e==="any"?d5t(e):r?Fk.VALIDATED:e?d5t(e):void 0}function bge(t){switch(t){case Qu.STOP:return"stop";case Qu.MAX_TOKENS:return"length";case Qu.BLOCKLIST:case Qu.PROHIBITED_CONTENT:case Qu.SPII:case Qu.SAFETY:case Qu.IMAGE_SAFETY:case Qu.IMAGE_PROHIBITED_CONTENT:case Qu.IMAGE_RECITATION:case Qu.IMAGE_OTHER:case Qu.RECITATION:case Qu.FINISH_REASON_UNSPECIFIED:case Qu.OTHER:case Qu.LANGUAGE:case Qu.MALFORMED_FUNCTION_CALL:case Qu.UNEXPECTED_TOOL_CALL:case Qu.NO_IMAGE:return"error";default:{let e=t;throw new Error(`Unhandled stop reason: ${e}`)}}}function _ge(t,e){return yE(async()=>{try{return await t()}catch(n){throw n instanceof Error&&"status"in n&&!("headers"in n)&&(n.headers=void 0),n}},{maxRetries:e?.maxRetries,maxRetryDelayMs:e?.maxRetryDelayMs,signal:e?.signal})}var k2r,B2r,H4e=V(()=>{p();hge();SP();nC();rC();HB();k2r=/^[A-Za-z0-9+/]+={0,2}$/;B2r=new Set(["$schema","$id","$anchor","$dynamicAnchor","$vocabulary","$comment","$defs","definitions"])});var m5t={};Ir(m5t,{stream:()=>Sge,streamSimple:()=>O2r});function M2r(t,e,n){let r={};t.baseUrl&&(r.baseUrl=t.baseUrl,r.apiVersion="");let s=eC({"User-Agent":xh(),...t.headers,...n});return s&&(r.headers=s),new yO({apiKey:e,httpOptions:Object.keys(r).length>0?r:void 0})}function L2r(t,e,n={}){let r=gge(t,e),s={};n.temperature!==void 0&&(s.temperature=n.temperature),n.maxTokens!==void 0&&(s.maxOutputTokens=n.maxTokens);let i=yge(t.id),o=e.tools?.length?Ege(e.tools,n.toolChoice,i):void 0,a={...Object.keys(s).length>0&&s,...e.systemPrompt&&{systemInstruction:ts(e.systemPrompt)},...e.tools&&e.tools.length>0&&{tools:Age(e.tools,!1,i)},...o!==void 0&&{toolConfig:{functionCallingConfig:{mode:o}}}};if(n.thinking?.enabled&&t.reasoning){let u={includeThoughts:!0};n.thinking.level!==void 0?u.thinkingLevel=n.thinking.level:n.thinking.budgetTokens!==void 0&&(u.thinkingBudget=n.thinking.budgetTokens),a.thinkingConfig=u}else t.reasoning&&n.thinking&&!n.thinking.enabled&&(a.thinkingConfig=F2r(t));if(n.signal){if(n.signal.aborted)throw new Error("Request aborted");a.abortSignal=n.signal}return{model:t.id,contents:r,config:a}}function V4e(t){return/gemma-?4/.test(t.id.toLowerCase())}function j4e(t){return/gemini-3(?:\.\d+)?-pro/.test(t.id.toLowerCase())}function h5t(t){let e=t.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(e)||e==="gemini-flash-latest"||e==="gemini-flash-lite-latest"}function F2r(t){return j4e(t)?{thinkingLevel:"LOW"}:h5t(t)?{thinkingLevel:"MINIMAL"}:V4e(t)?{thinkingLevel:"MINIMAL"}:{thinkingBudget:0}}function Q2r(t,e){if(j4e(e))switch(t){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}if(V4e(e))switch(t){case"minimal":case"low":return"MINIMAL";case"medium":case"high":return"HIGH"}switch(t){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function U2r(t,e,n){return n?.[e]!==void 0?n[e]:t.id.includes("2.5-pro")?{minimal:128,low:2048,medium:8192,high:32768}[e]:t.id.includes("2.5-flash-lite")?{minimal:512,low:2048,medium:8192,high:24576}[e]:t.id.includes("2.5-flash")?{minimal:128,low:2048,medium:8192,high:24576}[e]:-1}var P2r,Sge,O2r,f5t=V(()=>{p();hge();is();Bx();Pf();oE();qx();nC();H4e();sC();P2r=0,Sge=(t,e,n)=>{let r=new Ka;return(async()=>{let s={role:"assistant",content:[],api:"google-generative-ai",provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(n?.fetch&&n.fetch!==globalThis.fetch)throw new Error("Custom fetch is not supported by the Google Generative AI adapter");let i=n?.apiKey;if(!i)throw new Error(`No API key for provider: ${t.provider}`);let o=M2r(t,i,n?.headers),a=L2r(t,e,n),c=await n?.onPayload?.(a,t);c!==void 0&&(a=c);let u=await _ge(()=>o.models.generateContentStream(a),n);r.push({type:"start",partial:s});let l=null,d=s.content,h=()=>d.length-1;for await(let m of u){s.responseId||=m.responseId;let f=m.candidates?.[0];if(f?.content?.parts)for(let g of f.content.parts){if(g.text!==void 0){let A=fge(g);(!l||A&&l.type!=="thinking"||!A&&l.type!=="text")&&(l&&(l.type==="text"?r.push({type:"text_end",contentIndex:d.length-1,content:l.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:l.thinking,partial:s})),A?(l={type:"thinking",thinking:"",thinkingSignature:void 0},s.content.push(l),r.push({type:"thinking_start",contentIndex:h(),partial:s})):(l={type:"text",text:""},s.content.push(l),r.push({type:"text_start",contentIndex:h(),partial:s}))),l.type==="thinking"?(l.thinking+=g.text,l.thinkingSignature=Nq(l.thinkingSignature,g.thoughtSignature),r.push({type:"thinking_delta",contentIndex:h(),delta:g.text,partial:s})):(l.text+=g.text,l.textSignature=Nq(l.textSignature,g.thoughtSignature),r.push({type:"text_delta",contentIndex:h(),delta:g.text,partial:s}))}if(g.functionCall){l&&(l.type==="text"?r.push({type:"text_end",contentIndex:h(),content:l.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:l.thinking,partial:s}),l=null);let A=g.functionCall.id,S={type:"toolCall",id:!A||s.content.some(C=>C.type==="toolCall"&&C.id===A)?`${g.functionCall.name}_${Date.now()}_${++P2r}`:A,name:g.functionCall.name||"",arguments:g.functionCall.args??{},...g.thoughtSignature&&{thoughtSignature:g.thoughtSignature}};s.content.push(S),r.push({type:"toolcall_start",contentIndex:h(),partial:s}),r.push({type:"toolcall_delta",contentIndex:h(),delta:JSON.stringify(S.arguments),partial:s}),r.push({type:"toolcall_end",contentIndex:h(),toolCall:S,partial:s})}}f?.finishReason&&(s.rawStopReason=f.finishReason,s.stopReason=bge(f.finishReason),s.content.some(g=>g.type==="toolCall")&&s.stopReason==="stop"&&(s.stopReason="toolUse")),m.usageMetadata&&(s.usage={input:(m.usageMetadata.promptTokenCount||0)-(m.usageMetadata.cachedContentTokenCount||0),output:(m.usageMetadata.candidatesTokenCount||0)+(m.usageMetadata.thoughtsTokenCount||0),cacheRead:m.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:m.usageMetadata.thoughtsTokenCount||0,totalTokens:m.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Sh(t,s.usage))}if(l&&(l.type==="text"?r.push({type:"text_end",contentIndex:h(),content:l.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:l.thinking,partial:s})),n?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="pending")throw new Error("Google stream ended without a finish reason");if(s.stopReason==="aborted"||s.stopReason==="error"){let m=s.rawStopReason?`Provider stopped with: ${s.rawStopReason}`:"An unknown error occurred";throw new Error(m)}r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(i){for(let o of s.content)"index"in o&&delete o.index;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=Of(Ch(i)),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},O2r=(t,e,n)=>{let r=n?.apiKey;if(!r)throw new Error(`No API key for provider: ${t.provider}`);let s={...Yd(t,e,n,r),toolChoice:n?.toolChoice};if(!n?.reasoning)return Sge(t,e,{...s,thinking:{enabled:!1}});let i=uu(t,n.reasoning),o=mge(t,i),a=t;return j4e(a)||h5t(a)||V4e(a)?Sge(t,e,{...s,thinking:{enabled:!0,level:Q2r(o,a)}}):Sge(t,e,{...s,thinking:{enabled:!0,budgetTokens:U2r(a,o,n.thinkingBudgets)}})}});var E5t={};Ir(E5t,{stream:()=>Cge,streamSimple:()=>q2r});function H2r(t,e,n,r,s){let i=K2r(s);return new yO({vertexai:!0,project:e,location:n,apiVersion:g5t,...i?{googleAuthOptions:i}:{},httpOptions:A5t(t,r)})}function V2r(t,e,n){return new yO({vertexai:!0,apiKey:e,apiVersion:g5t,httpOptions:A5t(t,n)})}function A5t(t,e){let n={},r=j2r(t.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=iz.COLLECTION,Y2r(r)&&(n.apiVersion=""));let s=eC({"User-Agent":xh(),...t.headers,...e});return s&&(n.headers=s),Object.keys(n).length>0?n:void 0}function j2r(t){let e=t.trim();if(!(!e||e.includes("{location}")))return e}function Y2r(t){try{return new URL(t).pathname.split("/").some(n=>/^v\d+(?:beta\d*)?$/.test(n))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(t)}}function K2r(t){let e=Ps("GOOGLE_APPLICATION_CREDENTIALS",t);return e?{keyFilename:e}:void 0}function z2r(t){let e=t?.apiKey?.trim();if(!(!e||e===$2r||J2r(e)))return e}function J2r(t){return/^<[^>]+>$/.test(t)}function X2r(t){let e=t?.project||Ps("GOOGLE_CLOUD_PROJECT",t?.env)||Ps("GCLOUD_PROJECT",t?.env);if(!e)throw new Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return e}function Z2r(t){let e=t?.location||Ps("GOOGLE_CLOUD_LOCATION",t?.env);if(!e)throw new Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return e}function e$r(t,e,n={}){let r=gge(t,e),s={};n.temperature!==void 0&&(s.temperature=n.temperature),n.maxTokens!==void 0&&(s.maxOutputTokens=n.maxTokens);let i=yge(t.id),o=e.tools?.length?Ege(e.tools,n.toolChoice,i):void 0,a={...Object.keys(s).length>0&&s,...e.systemPrompt&&{systemInstruction:ts(e.systemPrompt)},...e.tools&&e.tools.length>0&&{tools:Age(e.tools,!1,i)},...o!==void 0&&{toolConfig:{functionCallingConfig:{mode:o}}}};if(n.thinking?.enabled&&t.reasoning){let u={includeThoughts:!0};n.thinking.level!==void 0?u.thinkingLevel=G2r[n.thinking.level]:n.thinking.budgetTokens!==void 0&&(u.thinkingBudget=n.thinking.budgetTokens),a.thinkingConfig=u}else t.reasoning&&n.thinking&&!n.thinking.enabled&&(a.thinkingConfig=t$r(t));if(n.signal){if(n.signal.aborted)throw new Error("Request aborted");a.abortSignal=n.signal}return{model:t.id,contents:r,config:a}}function Y4e(t){return/gemini-3(?:\.\d+)?-pro/.test(t.id.toLowerCase())}function y5t(t){let e=t.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(e)||e==="gemini-flash-latest"||e==="gemini-flash-lite-latest"}function t$r(t){let e=t;return Y4e(e)?{thinkingLevel:vC.LOW}:y5t(e)?{thinkingLevel:vC.MINIMAL}:{thinkingBudget:0}}function n$r(t,e){if(Y4e(e))switch(t){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}switch(t){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function r$r(t,e,n){return n?.[e]!==void 0?n[e]:t.id.includes("2.5-pro")?{minimal:128,low:2048,medium:8192,high:32768}[e]:t.id.includes("2.5-flash")?{minimal:128,low:2048,medium:8192,high:24576}[e]:-1}var g5t,$2r,G2r,W2r,Cge,q2r,b5t=V(()=>{p();hge();is();Bx();Pf();oE();qx();tC();nC();H4e();sC();g5t="v1",$2r="gcp-vertex-credentials",G2r={THINKING_LEVEL_UNSPECIFIED:vC.THINKING_LEVEL_UNSPECIFIED,MINIMAL:vC.MINIMAL,LOW:vC.LOW,MEDIUM:vC.MEDIUM,HIGH:vC.HIGH},W2r=0,Cge=(t,e,n)=>{let r=new Ka;return(async()=>{let s={role:"assistant",content:[],api:"google-vertex",provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(n?.fetch&&n.fetch!==globalThis.fetch)throw new Error("Custom fetch is not supported by the Google Vertex adapter");let i=z2r(n),o=i?V2r(t,i,n?.headers):H2r(t,X2r(n),Z2r(n),n?.headers,n?.env),a=e$r(t,e,n),c=await n?.onPayload?.(a,t);c!==void 0&&(a=c);let u=await _ge(()=>o.models.generateContentStream(a),n);r.push({type:"start",partial:s});let l=null,d=s.content,h=()=>d.length-1;for await(let m of u){s.responseId||=m.responseId;let f=m.candidates?.[0];if(f?.content?.parts)for(let g of f.content.parts){if(g.text!==void 0){let A=fge(g);(!l||A&&l.type!=="thinking"||!A&&l.type!=="text")&&(l&&(l.type==="text"?r.push({type:"text_end",contentIndex:d.length-1,content:l.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:l.thinking,partial:s})),A?(l={type:"thinking",thinking:"",thinkingSignature:void 0},s.content.push(l),r.push({type:"thinking_start",contentIndex:h(),partial:s})):(l={type:"text",text:""},s.content.push(l),r.push({type:"text_start",contentIndex:h(),partial:s}))),l.type==="thinking"?(l.thinking+=g.text,l.thinkingSignature=Nq(l.thinkingSignature,g.thoughtSignature),r.push({type:"thinking_delta",contentIndex:h(),delta:g.text,partial:s})):(l.text+=g.text,l.textSignature=Nq(l.textSignature,g.thoughtSignature),r.push({type:"text_delta",contentIndex:h(),delta:g.text,partial:s}))}if(g.functionCall){l&&(l.type==="text"?r.push({type:"text_end",contentIndex:h(),content:l.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:l.thinking,partial:s}),l=null);let A=g.functionCall.id,S={type:"toolCall",id:!A||s.content.some(C=>C.type==="toolCall"&&C.id===A)?`${g.functionCall.name}_${Date.now()}_${++W2r}`:A,name:g.functionCall.name||"",arguments:g.functionCall.args??{},...g.thoughtSignature&&{thoughtSignature:g.thoughtSignature}};s.content.push(S),r.push({type:"toolcall_start",contentIndex:h(),partial:s}),r.push({type:"toolcall_delta",contentIndex:h(),delta:JSON.stringify(S.arguments),partial:s}),r.push({type:"toolcall_end",contentIndex:h(),toolCall:S,partial:s})}}f?.finishReason&&(s.rawStopReason=f.finishReason,s.stopReason=bge(f.finishReason),s.content.some(g=>g.type==="toolCall")&&s.stopReason==="stop"&&(s.stopReason="toolUse")),m.usageMetadata&&(s.usage={input:(m.usageMetadata.promptTokenCount||0)-(m.usageMetadata.cachedContentTokenCount||0),output:(m.usageMetadata.candidatesTokenCount||0)+(m.usageMetadata.thoughtsTokenCount||0),cacheRead:m.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:m.usageMetadata.thoughtsTokenCount||0,totalTokens:m.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Sh(t,s.usage))}if(l&&(l.type==="text"?r.push({type:"text_end",contentIndex:h(),content:l.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:l.thinking,partial:s})),n?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="pending")throw new Error("Google Vertex stream ended without a finish reason");if(s.stopReason==="aborted"||s.stopReason==="error"){let m=s.rawStopReason?`Provider stopped with: ${s.rawStopReason}`:"An unknown error occurred";throw new Error(m)}r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(i){for(let o of s.content)"index"in o&&delete o.index;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=Of(Ch(i)),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},q2r=(t,e,n)=>{let r={...Yd(t,e,n,void 0),toolChoice:n?.toolChoice};if(!n?.reasoning)return Cge(t,e,{...r,thinking:{enabled:!1}});let s=uu(t,n.reasoning),i=mge(t,s),o=t;return Y4e(o)||y5t(o)?Cge(t,e,{...r,thinking:{enabled:!0,level:n$r(i,o)}}):Cge(t,e,{...r,thinking:{enabled:!0,budgetTokens:r$r(o,i,n.thinkingBudgets)}})}});var k5t={};Ir(k5t,{stream:()=>w5t,streamSimple:()=>i$r});function o$r(t){return{role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()}}function a$r(){let t=new Map,e=new Map;return n=>{let r=t.get(n);if(r)return r;let s=0;for(;;){let i=T5t(n,s),o=e.get(i);if(!o||o===n)return t.set(n,i),e.set(i,n),i;s++}}}function T5t(t,e){let n=t.replace(/[^a-zA-Z0-9]/g,"");if(e===0&&n.length===_5t)return n;let r=n||t,s=e===0?r:`${r}:${e}`;return bk(s).replace(/[^a-zA-Z0-9]/g,"").slice(0,_5t)}function c$r(t){if(t instanceof Error){let e=t,n=typeof e.statusCode=="number"?e.statusCode:void 0,r=typeof e.body=="string"?e.body.trim():void 0;return n!==void 0&&r?`Mistral API error (${n}): ${l$r(r,s$r)}`:n!==void 0?`Mistral API error (${n}): ${t.message}`:t.message}return u$r(t)}function l$r(t,e){return t.length<=e?t:`${t.slice(0,e)}... [truncated ${t.length-e} chars]`}function u$r(t){try{let e=JSON.stringify(t);return e===void 0?String(t):e}catch{return String(t)}}async function d$r(t,e,n,r){let s=new URL(t.baseUrl);s.pathname=`${s.pathname.replace(/\/+$/u,"")}/`;let i=new URL("v1/chat/completions",s),o=p$r(t,n,r),a=AbortSignal.timeout(r?.timeoutMs??6e4),c=r?.signal?AbortSignal.any([r.signal,a]):a,u=await(r?.fetch??globalThis.fetch)(i,{method:"POST",headers:o,body:JSON.stringify(h$r(e)),signal:c});if(await r?.onResponse?.({status:u.status,headers:Pp(u.headers)},t),!u.ok){let l=await u.text();throw new K4e(u.status,l,u.statusText)}if(!u.body)throw new Error("Mistral response has no body");return g$r(u.body,c)}function p$r(t,e,n){let r=new Headers({"User-Agent":xh(),accept:"text/event-stream",authorization:`Bearer ${e}`,"content-type":"application/json"});S5t(r,t.headers),S5t(r,n?.headers);let s=C5t(t.headers,"x-affinity")||C5t(n?.headers,"x-affinity");return v5t(n)&&!s&&r.set("x-affinity",n.sessionId),r}function S5t(t,e){if(e)for(let[n,r]of Object.entries(e))r===null?t.delete(n):t.set(n,r)}function C5t(t,e){return!!t&&Object.keys(t).some(n=>n.toLowerCase()===e)}function h$r(t){let e={...t};for(let[r,s]of[["topP","top_p"],["maxTokens","max_tokens"],["randomSeed","random_seed"],["responseFormat","response_format"],["toolChoice","tool_choice"],["presencePenalty","presence_penalty"],["frequencyPenalty","frequency_penalty"],["parallelToolCalls","parallel_tool_calls"],["reasoningEffort","reasoning_effort"],["promptMode","prompt_mode"],["promptCacheKey","prompt_cache_key"],["safePrompt","safe_prompt"]])Dq(e,r,s);e.messages=t.messages.map(r=>m$r(r));let n=e.response_format;if(z4e(n)){let r={...n};Dq(r,"jsonSchema","json_schema");let s=r.json_schema;if(z4e(s)){let i={...s};Dq(i,"schemaDefinition","schema"),r.json_schema=i}e.response_format=r}return e}function m$r(t){let e={...t};return Dq(e,"toolCalls","tool_calls"),Dq(e,"toolCallId","tool_call_id"),Array.isArray(t.content)&&(e.content=t.content.map(n=>f$r(n))),e}function f$r(t){let e={...t};for(let[n,r]of[["imageUrl","image_url"],["documentUrl","document_url"],["documentName","document_name"],["fileId","file_id"],["referenceIds","reference_ids"],["inputAudio","input_audio"]])Dq(e,n,r);return e}function Dq(t,e,n){e in t&&(t[n]=t[e],delete t[e])}function z4e(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}async function*g$r(t,e){let n=t.getReader(),r=new TextDecoder,s="",i=()=>{n.cancel().catch(()=>{})};e.addEventListener("abort",i,{once:!0});try{for(;;){if(e.aborted)throw e.reason;let{done:o,value:a}=await n.read();if(e.aborted)throw e.reason;s+=o?r.decode():r.decode(a,{stream:!0});let c=I5t(s);for(;c;){let u=x5t(s.slice(0,c.index));if(s=s.slice(c.index+c.length),u===J4e)return;u&&(yield u),c=I5t(s)}if(o)break}if(s.trim()){let o=x5t(s);o!==J4e&&o&&(yield o)}}finally{e.removeEventListener("abort",i);try{await n.cancel()}catch{}try{n.releaseLock()}catch{}}}function I5t(t){let e=/\r\n\r\n|\r\n\r|\r\n\n|\r\r\n|\n\r\n|\r\r|\n\r|\n\n/u.exec(t);return e?.index===void 0?void 0:{index:e.index,length:e[0].length}}function x5t(t){let e=t.split(/\r\n|\r|\n/u).filter(r=>r.startsWith("data:")).map(r=>r.slice(5).trimStart()).join(` -`).trim();if(!e)return;if(e==="[DONE]")return J4e;let n=JSON.parse(e);if(!z4e(n)||!Array.isArray(n.choices))throw new Error("Invalid Mistral streaming event");return{data:n}}function A$r(t,e,n,r){let s={model:t.id,stream:!0,messages:_$r(n,t.input.includes("image"))};return e.tools?.length&&(s.tools=b$r(e.tools)),r?.temperature!==void 0&&(s.temperature=r.temperature),r?.maxTokens!==void 0&&(s.maxTokens=r.maxTokens),r?.toolChoice&&(s.toolChoice=x$r(r.toolChoice)),r?.promptMode&&(s.promptMode=r.promptMode),r?.reasoningEffort&&(s.reasoningEffort=r.reasoningEffort),v5t(r)&&(s.promptCacheKey=r.sessionId),e.systemPrompt&&s.messages.unshift({role:"system",content:ts(e.systemPrompt)}),s}function v5t(t){return t?.cacheRetention!=="none"&&!!t?.sessionId}function y$r(t,e){let n=t,r=n.promptTokensDetails?.cachedTokens??n.prompt_tokens_details?.cached_tokens??n.promptTokenDetails?.cachedTokens??n.prompt_token_details?.cached_tokens??n.numCachedTokens??n.num_cached_tokens??0,s=typeof r=="number"&&Number.isFinite(r)?r:0;return Math.min(e,Math.max(0,s))}async function E$r(t,e,n,r){let s=null,i=e.content,o=()=>i.length-1,a=new Map,c=u=>{if(u){if(u.type==="text"){n.push({type:"text_end",contentIndex:o(),content:u.text,partial:e});return}u.type==="thinking"&&n.push({type:"thinking_end",contentIndex:o(),content:u.thinking,partial:e})}};for await(let u of r){let l=u.data;if(e.responseId||=l.id,l.usage){let f=l.usage.prompt_tokens||0,g=y$r(l.usage,f);e.usage.input=Math.max(0,f-g),e.usage.output=l.usage.completion_tokens||0,e.usage.cacheRead=g,e.usage.cacheWrite=0,e.usage.totalTokens=l.usage.total_tokens||e.usage.input+e.usage.output+e.usage.cacheRead+e.usage.cacheWrite,Sh(t,e.usage)}let d=l.choices[0];if(!d)continue;if(d.finish_reason){e.rawStopReason=d.finish_reason;let f=w$r(d.finish_reason);e.stopReason=f.stopReason,f.errorMessage&&(e.errorMessage=f.errorMessage)}let h=d.delta;if(h.content!==null&&h.content!==void 0){let f=typeof h.content=="string"?[h.content]:h.content;for(let g of f){if(typeof g=="string"){let A=ts(g);(!s||s.type!=="text")&&(c(s),s={type:"text",text:""},e.content.push(s),n.push({type:"text_start",contentIndex:o(),partial:e})),s.text+=A,n.push({type:"text_delta",contentIndex:o(),delta:A,partial:e});continue}if(g.type==="thinking"){let A=(g.thinking??[]).map(b=>b.text??"").filter(b=>b.length>0).join(""),y=ts(A);if(!y)continue;(!s||s.type!=="thinking")&&(c(s),s={type:"thinking",thinking:""},e.content.push(s),n.push({type:"thinking_start",contentIndex:o(),partial:e})),s.thinking+=y,n.push({type:"thinking_delta",contentIndex:o(),delta:y,partial:e});continue}if(g.type==="text"){let A=ts(g.text??"");(!s||s.type!=="text")&&(c(s),s={type:"text",text:""},e.content.push(s),n.push({type:"text_start",contentIndex:o(),partial:e})),s.text+=A,n.push({type:"text_delta",contentIndex:o(),delta:A,partial:e})}}}let m=h.tool_calls||[];for(let f of m){s&&(c(s),s=null);let g=f.id&&f.id!=="null"?f.id:T5t(`toolcall:${f.index??0}`,0),A=f.index??g,y=a.get(A),b;if(y!==void 0){let C=e.content[y];C?.type==="toolCall"&&(b=C)}b||(b={type:"toolCall",id:g,name:f.function.name,arguments:{},partialArgs:""},e.content.push(b),a.set(A,e.content.length-1),n.push({type:"toolcall_start",contentIndex:e.content.length-1,partial:e}));let S=typeof f.function.arguments=="string"?f.function.arguments:JSON.stringify(f.function.arguments||{});b.partialArgs=(b.partialArgs||"")+S,b.arguments=va(b.partialArgs),n.push({type:"toolcall_delta",contentIndex:a.get(A),delta:S,partial:e})}}c(s);for(let u of a.values()){let l=e.content[u];if(l.type!=="toolCall")continue;let d=l;d.arguments=va(d.partialArgs),delete d.partialArgs,n.push({type:"toolcall_end",contentIndex:u,toolCall:d,partial:e})}}function b$r(t){return t.map(e=>{let n=oA(e,!0);return{type:"function",function:{name:e.name,description:e.description,parameters:X4e(aE(e,n)),strict:n??!1}}})}function X4e(t){if(Array.isArray(t))return t.map(e=>X4e(e));if(t&&typeof t=="object"){let e={};for(let[n,r]of Object.entries(t))e[n]=X4e(r);return e}return t}function _$r(t,e){let n=[];for(let r of t){if(r.role==="user"){if(typeof r.content=="string"){n.push({role:"user",content:ts(r.content)});continue}let c=r.content.some(l=>l.type==="image"),u=r.content.filter(l=>l.type==="text"||e).map(l=>l.type==="text"?{type:"text",text:ts(l.text)}:{type:"image_url",imageUrl:`data:${l.mimeType};base64,${l.data}`});if(u.length>0){n.push({role:"user",content:u});continue}c&&!e&&n.push({role:"user",content:"(image omitted: model does not support images)"});continue}if(r.role==="assistant"){let c=[],u=[];for(let d of r.content){if(d.type==="text"){d.text.trim().length>0&&c.push({type:"text",text:ts(d.text)});continue}if(d.type==="thinking"){d.thinking.trim().length>0&&c.push({type:"thinking",thinking:[{type:"text",text:ts(d.thinking)}]});continue}u.push({id:d.id,type:"function",function:{name:d.name,arguments:JSON.stringify(d.arguments||{})},index:0})}let l={role:"assistant",prefix:!1};c.length>0&&(l.content=c),u.length>0&&(l.toolCalls=u),(c.length>0||u.length>0)&&n.push(l);continue}let s=[],i=r.content.filter(c=>c.type==="text").map(c=>c.type==="text"?ts(c.text):"").join(` -`),o=r.content.some(c=>c.type==="image"),a=S$r(i,o,e,r.isError);s.push({type:"text",text:a});for(let c of r.content)e&&c.type==="image"&&s.push({type:"image_url",imageUrl:`data:${c.mimeType};base64,${c.data}`});n.push({role:"tool",toolCallId:r.toolCallId,name:r.toolName,content:s})}return n}function S$r(t,e,n,r){let s=t.trim(),i=r?"[tool error] ":"";return s.length>0?`${i}${s}${e&&!n?` -[tool image omitted: model does not support images]`:""}`:e?n?r?"[tool error] (see attached image)":"(see attached image)":r?"[tool error] (image omitted: model does not support images)":"(image omitted: model does not support images)":r?"[tool error] (no tool output)":"(no tool output)"}function R5t(t){return t.id==="mistral-small-2603"||t.id==="mistral-small-latest"||t.id==="mistral-medium-3.5"}function C$r(t){return t.reasoning&&!R5t(t)}function I$r(t,e){return t.thinkingLevelMap?.[e]??"high"}function x$r(t){if(t)return t==="auto"||t==="none"||t==="any"||t==="required"?t:{type:"function",function:{name:t.function.name}}}function w$r(t){if(t===null)return{stopReason:"stop"};switch(t){case"stop":return{stopReason:"stop"};case"length":case"model_length":return{stopReason:"length"};case"tool_calls":return{stopReason:"toolUse"};case"error":return{stopReason:"error",errorMessage:"Provider stopped with: error"};default:return{stopReason:"error",errorMessage:`Provider stopped with: ${t}`}}}var _5t,s$r,w5t,i$r,K4e,J4e,N5t=V(()=>{p();is();Pf();Yhe();oE();Px();qx();nC();rC();sC();HB();_5t=9,s$r=4e3,w5t=(t,e,n)=>{let r=new Ka;return(async()=>{let s=o$r(t);try{let i=n?.apiKey;if(!i)throw new Error(`No API key for provider: ${t.provider}`);let o=a$r(),a=lE(e.messages,t,d=>o(d)),c=A$r(t,e,a,n),u=await n?.onPayload?.(c,t);u!==void 0&&(c=u);let l=await d$r(t,c,i,n);if(r.push({type:"start",partial:s}),await E$r(t,s,r,l),n?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="pending")throw new Error("Mistral stream ended without a finish reason");if(s.stopReason==="aborted"||s.stopReason==="error")throw new Error(s.errorMessage||"An unknown error occurred");r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(i){for(let o of s.content)delete o.partialArgs;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=c$r(i),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},i$r=(t,e,n)=>{let r=n?.apiKey;if(!r)throw new Error(`No API key for provider: ${t.provider}`);let s={...Yd(t,e,n,r),toolChoice:n?.toolChoice},i=n?.reasoning?uu(t,n.reasoning):void 0,o=i==="off"?void 0:i,a=t.reasoning&&o!==void 0;return w5t(t,e,{...s,promptMode:a&&C$r(t)?"reasoning":void 0,reasoningEffort:a&&R5t(t)?I$r(t,o):void 0})};K4e=class extends Error{statusCode;body;constructor(e,n,r){super(r||`Request failed with status ${e}`),this.name="MistralHttpError",this.statusCode=e,this.body=n}};J4e=Symbol("mistral-stream-done")});function eVe(t){return Z4e.add(t),()=>{Z4e.delete(t)}}function tVe(t){let e=[];for(let n of Z4e)try{n(t)}catch(r){e.push(r)}if(e.length>0)throw new AggregateError(e,"Failed to cleanup session resources")}var Z4e,nVe=V(()=>{p();Z4e=new Set});function D5t(t){let e=t.filter(i=>i!==void 0);if(e.length===0)return{cleanup:()=>{}};if(e.length===1)return{signal:e[0],cleanup:()=>{}};let n=new AbortController,r=[],s=i=>{n.signal.aborted||n.abort(i.reason)};for(let i of e){if(i.aborted){s(i);break}let o=()=>s(i);i.addEventListener("abort",o,{once:!0}),r.push({signal:i,listener:o})}return{signal:n.signal,cleanup:()=>{for(let{signal:i,listener:o}of r)i.removeEventListener("abort",o)}}}var B5t=V(()=>{p()});function tl(t){let e=t??Date.now();if(!Number.isInteger(e)||e<0||e>0xffffffffffff)throw new RangeError(`UUIDv7 timestamp must be an integer between 0 and ${0xffffffffffff}`);let n=t===void 0?Math.max(e,P5t):t;t===void 0&&(P5t=n);let r=new Uint8Array(16);if(globalThis.crypto.getRandomValues(r),RC===void 0)RC=BigInt(r[1])<<32n|BigInt(r[2])<<24n|BigInt(r[3])<<16n|BigInt(r[4])<<8n|BigInt(r[5]);else{if(RC===T$r)throw new RangeError("UUIDv7 generator sequence exhausted");RC++}let s=BigInt(n);for(let o=5;o>=0;o--)r[o]=Number(s>>BigInt((5-o)*8))&255;r[6]=112|Number(RC>>37n&0x0fn),r[7]=Number(RC>>29n&0xffn),r[8]=128|Number(RC>>23n&0x3fn),r[9]=Number(RC>>15n&0xffn),r[10]=Number(RC>>7n&0xffn),r[11]=Number((RC&0x7fn)<<1n)|r[11]&1;let i=Array.from(r,o=>o.toString(16).padStart(2,"0"));return`${i.slice(0,4).join("")}-${i.slice(4,6).join("")}-${i.slice(6,8).join("")}-${i.slice(8,10).join("")}-${i.slice(10).join("")}`}var T$r,P5t,RC,$k=V(()=>{p();T$r=(1n<<41n)-1n,P5t=-1});var Z5t={};Ir(Z5t,{closeOpenAICodexWebSocketSessions:()=>Y5t,getOpenAICodexWebSocketDebugStats:()=>sGr,resetOpenAICodexWebSocketDebugStats:()=>iGr,stream:()=>W5t,streamSimple:()=>q$r});function M5t(t){if(t.stopReason==="pending")throw new Error("Codex stream ended without a stop reason");if(t.stopReason==="error"||t.stopReason==="aborted")throw new Error(t.errorMessage||"An unknown error occurred")}function F$r(t){return/GoUsageLimitError|FreeUsageLimitError|Monthly usage limit reached|available balance|insufficient_quota|out of budget|quota exceeded|billing/i.test(t)}function Q$r(t,e){return t===429&&F$r(e)?!1:t===429||t===500||t===502||t===503||t===504?!0:/rate.?limit|overloaded|service.?unavailable|upstream.?connect|connection.?refused/i.test(e)}function U$r(t){let e=t.get("retry-after-ms");if(e!==null){let i=Number(e);if(Number.isFinite(i))return Math.max(0,i)}let n=t.get("retry-after");if(!n)return;let r=Number(n);if(Number.isFinite(r))return Math.max(0,r*1e3);let s=Date.parse(n);if(!Number.isNaN(s))return Math.max(0,s-Date.now())}function $$r(t,e){let n=e?.maxRetryDelayMs??N$r;if(n>0&&t>n)throw new xge(`Server requested ${Math.ceil(t/1e3)}s retry delay (max: ${Math.ceil(n/1e3)}s)`);return t}function L5t(t,e){return new Promise((n,r)=>{if(e?.aborted){r(new Error("Request was aborted"));return}let s=setTimeout(n,t);e?.addEventListener("abort",()=>{clearTimeout(s),r(new Error("Request was aborted"))})})}function F5t(t){if(t!==void 0){if(!Number.isFinite(t)||t<0)throw new Error(`Invalid timeoutMs: ${String(t)}`);return Math.floor(t)}}function G$r(){return typeof process>"u"||!(process.versions?.node||process.versions?.bun)?null:process.getBuiltinModule?.("node:zlib")??null}function W$r(t){let e=G$r();if(!e||typeof e.zstdCompressSync!="function")return null;try{let n=e.zstdCompressSync(t,{params:{[e.constants.ZSTD_c_compressionLevel]:B$r}});return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}catch{return null}}function H$r(t,e,n,r,s=cE(e.tools,t.compat?.supportsOpenAIGrammarTools??!1)){let i=t.compat?.supportsStrictMode??!0,o=t.compat?.supportsOpenAIGrammarTools??!1,a=t.compat?.supportsAdditionalTools?"additional-tools":t.compat?.supportsToolSearch?"tool-search":void 0,c=xG(e,a!==void 0),u=JP(t,e,G5t,{includeSystemPrompt:!1,grammarToolInputProperties:s,deferredTools:c.deferred,deferredToolsMode:a,toolOptions:{strict:null,supportsStrictMode:i,supportsOpenAIGrammarTools:o}}),l={model:t.id,store:!1,stream:!0,instructions:e.systemPrompt||"You are a helpful assistant.",input:u,text:{verbosity:n?.textVerbosity||"low"},include:["reasoning.encrypted_content"],prompt_cache_key:r,tool_choice:n?.toolChoice??"auto",parallel_tool_calls:!0};if(n?.temperature!==void 0&&(l.temperature=n.temperature),n?.serviceTier!==void 0&&(l.service_tier=n.serviceTier),c.immediate.length>0&&(l.tools=_k(c.immediate,{strict:null,supportsStrictMode:i,supportsOpenAIGrammarTools:o})),n?.reasoningEffort!==void 0){let d=n.reasoningEffort==="none"?t.thinkingLevelMap?.off??"none":t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort;d!==null&&(l.reasoning={effort:d,summary:n.reasoningSummary??"auto"})}return l}function V$r(t,e){switch(e){case"flex":return .5;case"priority":return t.id==="gpt-5.5"?2.5:2;default:return 1}}function q5t(t,e,n){let r=V$r(n,e);r!==1&&(t.cost.input*=r,t.cost.output*=r,t.cost.cacheRead*=r,t.cost.cacheWrite*=r,t.cost.total=t.cost.input+t.cost.output+t.cost.cacheRead+t.cost.cacheWrite)}function H5t(t,e){return t==="default"&&(e==="flex"||e==="priority")?e:t??e}function V5t(t){let n=(t&&t.trim().length>0?t:v$r).replace(/\/+$/,"");return n.endsWith("/codex/responses")?n:n.endsWith("/codex")?`${n}/responses`:`${n}/codex/responses`}function j$r(t){let e=new URL(V5t(t));return e.protocol==="https:"&&(e.protocol="wss:"),e.protocol==="http:"&&(e.protocol="ws:"),e.toString()}async function Y$r(t,e,n,r,s,i){await XP(j5t(eGr(t,i?.signal),e),e,n,r,{serviceTier:i?.serviceTier,grammarToolInputProperties:s,resolveServiceTier:H5t,applyServiceTierPricing:(o,a)=>q5t(o,a,r)})}function K$r(t){return t instanceof _O||t instanceof lz}function z$r(t){return t instanceof _O&&t.code===O$r}function J$r(t){return t instanceof _O&&t.code===M$r}function X$r(t){let e=t.error&&typeof t.error=="object"?t.error:void 0;return{code:typeof t.code=="string"?t.code:typeof e?.code=="string"?e.code:void 0,message:typeof t.message=="string"?t.message:typeof e?.message=="string"?e.message:void 0}}async function*j5t(t,e){for await(let n of t){let r=typeof n.type=="string"?n.type:void 0;if(r){if(r==="error"){let{code:s,message:i}=X$r(n);throw new _O(`Codex error: ${i||s||JSON.stringify(n)}`,{code:s,payload:n})}if(r==="response.failed"){let s=n.response,i=s?.error?.code,o=s?.error?.message;throw new _O(o||"Codex response failed",{code:i,payload:n})}if(r==="response.done"||r==="response.completed"||r==="response.incomplete"){let s=n.response;typeof s?.end_turn=="boolean"&&(e.endTurn=s.end_turn);let i=s&&{...s,status:Z$r(s.status)};yield{...n,type:"response.completed",response:i};return}yield n}}}function Z$r(t){if(typeof t=="string")return L$r.has(t)?t:void 0}async function*eGr(t,e){if(!t.body)return;let n=t.body.getReader(),r=new TextDecoder,s="",i=()=>{n.cancel().catch(()=>{})};e?.addEventListener("abort",i,{once:!0});try{for(;;){if(e?.aborted)throw new Error("Request was aborted");let{done:o,value:a}=await n.read();if(e?.aborted)throw new Error("Request was aborted");s+=o?r.decode():r.decode(a,{stream:!0}),o&&s.trim()&&(s+=` - -`);let c=s.indexOf(` - -`);for(;c!==-1;){let u=s.slice(0,c);s=s.slice(c+2);let l=u.split(` +`];for(;;){let{done:u,value:l}=yield Zc(i.read());if(u){if(o.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}let d=s.decode(l,{stream:!0});try{let f=JSON.parse(d);if("error"in f){let g=JSON.parse(JSON.stringify(f.error)),A=g.status,y=g.code,E=`got status: ${A}. ${JSON.stringify(f)}`;if(y>=400&&y<600)throw new Ybe({message:E,status:y})}}catch(f){if(f.name==="ApiError")throw f}o+=d;let m=-1,h=0;for(;;){m=-1,h=0;for(let A of c){let y=o.indexOf(A);y!==-1&&(m===-1||y{let y=Ndi(i,s),E;try{E=await fetch(e,Object.assign(Object.assign({},n),{signal:y.signal}))}catch(_){throw y.dispose(),_}if(!r||E.ok||!m.includes(E.status))return E;try{await t7e(E)}finally{y.dispose()}return E};if(!r)return h();let f=Math.max(1,(a=r.attempts)!==null&&a!==void 0?a:Ddi),g=Math.round(((c=r.initialDelay)!==null&&c!==void 0?c:Pdi)*1e3),A=Math.max(g,Math.round(((u=r.maxDelay)!==null&&u!==void 0?u:Mdi)*1e3));return(0,xrn.default)(h,{retries:f-1,factor:(l=r.expBase)!==null&&l!==void 0?l:Odi,minTimeout:g,maxTimeout:A,randomize:((d=r.jitter)!==null&&d!==void 0?d:Ldi)>0,onFailedAttempt:y=>{var E;if(s?.aborted)throw(E=y.error)!==null&&E!==void 0?E:y}})}getDefaultHeaders(){let e={},n=Tdi+" "+this.clientOptions.userAgentExtra;return e[Idi]=n,e[N7e]=n,e[Sdi]="application/json",e}async getHeadersInternal(e,n){let r=new Headers;if(e&&e.headers)for(let[i,s]of Object.entries(e.headers))r.append(i,s);return e?.timeout&&e.timeout>0&&r.append(Cdi,String(Math.ceil(e.timeout/1e3))),await this.clientOptions.auth.addAuthHeaders(r,n),r}getFileName(e){var n;let r="";return typeof e=="string"&&(r=e.replace(/[/\\]+$/,""),r=(n=r.split(/[/\\]/).pop())!==null&&n!==void 0?n:""),r}async uploadFile(e,n){var r;let i={};n!=null&&(i.mimeType=n.mimeType,i.name=n.name,i.displayName=n.displayName),i.name&&!i.name.startsWith("files/")&&(i.name=`files/${i.name}`);let s=this.clientOptions.uploader,o=await s.stat(e);i.sizeBytes=String(o.size);let a=(r=n?.mimeType)!==null&&r!==void 0?r:o.type;if(a===void 0||a==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");i.mimeType=a;let c={file:i},u=this.getFileName(e),l=er("upload/v1beta/files",c._url),d=await this.fetchUploadUrl(l,i.sizeBytes,i.mimeType,u,c,n?.httpOptions);return s.upload(e,d,this)}async uploadFileToFileSearchStore(e,n,r){var i;let s=this.clientOptions.uploader,o=await s.stat(n),a=String(o.size),c=(i=r?.mimeType)!==null&&i!==void 0?i:o.type;if(c===void 0||c==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");let u=`upload/v1beta/${e}:uploadToFileSearchStore`,l=this.getFileName(n),d={};r!=null&&Zrn(r,d);let m=await this.fetchUploadUrl(u,a,c,l,d,r?.httpOptions);return s.uploadToFileSearchStore(n,m,this)}async downloadFile(e){await this.clientOptions.downloader.download(e,this)}async fetchUploadUrl(e,n,r,i,s,o){var a;let c={};o?c=o:c={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${n}`,"X-Goog-Upload-Header-Content-Type":`${r}`},i?{"X-Goog-Upload-File-Name":i}:{})};let u=await this.request({path:e,body:JSON.stringify(s),httpMethod:"POST",httpOptions:c});if(!u||!u?.headers)throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");let l=(a=u?.headers)===null||a===void 0?void 0:a["x-goog-upload-url"];if(l===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return l}};Udi="mcp_used/unknown",Gdi=!1;P7e=class t{constructor(e=[],n){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=e,this.config=n}static create(e,n){return new t(e,n)}async initialize(){var e,n,r,i;if(this.mcpTools.length>0)return;let s={},o=[];for(let l of this.mcpClients)try{for(var a=!0,c=(n=void 0,EZ(Wdi(l))),u;u=await c.next(),e=u.done,!e;a=!0){i=u.value,a=!1;let d=i;o.push(d);let m=d.name;if(s[m])throw new Error(`Duplicate function name ${m} found in MCP tools. Please ensure function names are unique.`);s[m]=l}}catch(d){n={error:d}}finally{try{!a&&!e&&(r=c.return)&&await r.call(c)}finally{if(n)throw n.error}}this.mcpTools=o,this.functionNameToMcpClient=s}async tool(){return await this.initialize(),Koi(this.mcpTools,this.config)}async callTool(e){await this.initialize();let n=[];for(let r of e)if(r.name in this.functionNameToMcpClient){let i=this.functionNameToMcpClient[r.name],s;this.config.timeout&&(s={timeout:this.config.timeout});let o=await i.callTool({name:r.name,arguments:r.args},void 0,s);n.push({functionResponse:{name:r.name,response:o.isError?{error:o}:o}})}return n}};M7e=class{constructor(e,n,r){this.apiClient=e,this.auth=n,this.webSocketFactory=r}async connect(e){var n,r;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");let i=this.apiClient.getWebsocketBaseUrl(),s=this.apiClient.getApiVersion(),o=jdi(this.apiClient.getDefaultHeaders()),a=this.apiClient.getApiKey(),c=`${i}/ws/google.ai.generativelanguage.${s}.GenerativeService.BidiGenerateMusic?key=${a}`,u=()=>{},l=new Promise(_=>{u=_}),d=e.callbacks,m=function(){u({})},h=this.apiClient,f={onopen:m,onmessage:_=>{Hdi(h,d.onmessage,_)},onerror:(n=d?.onerror)!==null&&n!==void 0?n:function(_){},onclose:(r=d?.onclose)!==null&&r!==void 0?r:function(_){}},g=this.webSocketFactory.create(c,qdi(o),f);g.connect(),await l;let E={setup:{model:ea(this.apiClient,e.model)}};return g.send(JSON.stringify(E)),new O7e(g,this.apiClient)}},O7e=class{constructor(e,n){this.conn=e,this.apiClient=n}async setWeightedPrompts(e){if(!e.weightedPrompts||Object.keys(e.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");let n=tli(e);this.conn.send(JSON.stringify({clientContent:n}))}async setMusicGenerationConfig(e){e.musicGenerationConfig||(e.musicGenerationConfig={});let n=eli(e);this.conn.send(JSON.stringify(n))}sendPlaybackControl(e){let n={playbackControl:e};this.conn.send(JSON.stringify(n))}play(){this.sendPlaybackControl(W3.PLAY)}pause(){this.sendPlaybackControl(W3.PAUSE)}stop(){this.sendPlaybackControl(W3.STOP)}resetContext(){this.sendPlaybackControl(W3.RESET_CONTEXT)}close(){this.conn.close()}};Vdi="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";L7e=class{constructor(e,n,r){this.apiClient=e,this.auth=n,this.webSocketFactory=r,this.music=new M7e(this.apiClient,this.auth,this.webSocketFactory)}async connect(e){var n,r,i,s,o,a;if(e.config&&e.config.httpOptions)throw new Error("The Live module does not support httpOptions at request-level in LiveConnectConfig yet. Please use the client-level httpOptions configuration instead.");let c=this.apiClient.getWebsocketBaseUrl(),u=this.apiClient.getApiVersion(),l,d=this.apiClient.getHeaders();e.config&&e.config.tools&&ein(e.config.tools)&&tin(d);let m=Jdi(d);if(this.apiClient.isVertexAI()){let q=this.apiClient.getProject(),ce=this.apiClient.getLocation(),Y=this.apiClient.getApiKey(),z=!!q&&!!ce||!!Y;this.apiClient.getCustomBaseUrl()&&!z?l=c:(l=`${c}/ws/google.cloud.aiplatform.${u}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(m,l))}else{let q=this.apiClient.getApiKey(),ce="BidiGenerateContent",Y="key";q?.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),u!=="v1alpha"&&console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."),ce="BidiGenerateContentConstrained",Y="access_token"),l=`${c}/ws/google.ai.generativelanguage.${u}.GenerativeService.${ce}?${Y}=${q}`}let h=()=>{},f=new Promise(q=>{h=q}),g=e.callbacks,A=function(){var q;(q=g?.onopen)===null||q===void 0||q.call(g),h({})},y=this.apiClient,E=!1,_=[],S=()=>{},C=new Promise(q=>{S=q}),I={onopen:A,onmessage:q=>{Ydi(y,ce=>{ce.setupComplete&&!G.setupComplete&&(G.setupComplete=ce.setupComplete,S({})),E?g.onmessage(ce):_.push(ce)},q)},onerror:(n=g?.onerror)!==null&&n!==void 0?n:function(q){},onclose:(r=g?.onclose)!==null&&r!==void 0?r:function(q){}},w=this.webSocketFactory.create(l,Kdi(m),I);w.connect(),await f;let k=ea(this.apiClient,e.model);if(this.apiClient.isVertexAI()&&k.startsWith("publishers/")){let q=this.apiClient.getProject(),ce=this.apiClient.getLocation();q&&ce&&(k=`projects/${q}/locations/${ce}/`+k)}let N={};this.apiClient.isVertexAI()&&((i=e.config)===null||i===void 0?void 0:i.responseModalities)===void 0&&(e.config===void 0?e.config={responseModalities:[Mbe.AUDIO]}:e.config.responseModalities=[Mbe.AUDIO]),!((s=e.config)===null||s===void 0)&&s.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. It will be removed in the next major version (not before 7/31/2026).");let O=(a=(o=e.config)===null||o===void 0?void 0:o.tools)!==null&&a!==void 0?a:[],W=[];for(let q of O)if(this.isCallableTool(q)){let ce=q;W.push(await ce.tool())}else W.push(q);W.length>0&&(e.config.tools=W);let $={model:k,config:e.config,callbacks:e.callbacks};this.apiClient.isVertexAI()?N=Zci(this.apiClient,$):N=Xci(this.apiClient,$),delete N.config;let G=new F7e(w,this.apiClient);w.send(JSON.stringify(N)),await C,E=!0;for(let q of _)g.onmessage(q);return G}isCallableTool(e){return"callTool"in e&&typeof e.callTool=="function"}},zdi={turnComplete:!0},F7e=class{constructor(e,n){this.conn=e,this.apiClient=n}tLiveClientContent(e,n){if(n.turns!==null&&n.turns!==void 0){let r=[];try{r=dA(n.turns),e.isVertexAI()||(r=r.map(i=>SZ(i)))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof n.turns}'`)}return{clientContent:{turns:r,turnComplete:n.turnComplete}}}return{clientContent:{turnComplete:n.turnComplete}}}tLiveClienttToolResponse(e,n){let r=[];if(n.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(n.functionResponses)?r=n.functionResponses:r=[n.functionResponses],r.length===0)throw new Error("functionResponses is required.");for(let s of r){if(typeof s!="object"||s===null||!("name"in s)||!("response"in s))throw new Error(`Could not parse function response, type '${typeof s}'.`);if(!e.isVertexAI()&&!("id"in s))throw new Error(Vdi)}return{toolResponse:{functionResponses:r}}}sendClientContent(e){e=Object.assign(Object.assign({},zdi),e);let n=this.tLiveClientContent(this.apiClient,e);this.conn.send(JSON.stringify(n))}sendRealtimeInput(e){let n={};this.apiClient.isVertexAI()?n={realtimeInput:rli(e)}:n={realtimeInput:nli(e)},this.conn.send(JSON.stringify(n))}sendToolResponse(e){if(e.functionResponses==null)throw new Error("Tool response parameters are required.");let n=this.tLiveClienttToolResponse(this.apiClient,e);this.conn.send(JSON.stringify(n))}close(){this.conn.close()}};trn=10;z3=class t extends vx{constructor(e){super(),this.apiClient=e,this.embedContent=async n=>{if(!this.apiClient.isVertexAI())return n.model.includes("gemini-embedding-2")&&(n.contents=dA(n.contents)),await this.embedContentInternal(n);if(n.model.includes("gemini")&&n.model!=="gemini-embedding-001"||n.model.includes("maas")){let i=dA(n.contents);if(i.length>1)throw new Error("The embedContent API for this model only supports one content at a time.");let s=Object.assign(Object.assign({},n),{content:i[0],embeddingApiType:Obe.EMBED_CONTENT});return await this.embedContentInternal(s)}else{let i=Object.assign(Object.assign({},n),{embeddingApiType:Obe.PREDICT});return await this.embedContentInternal(i)}},this.generateContent=async n=>{var r,i,s,o,a;let c=await this.processParamsMaybeAddMcpUsage(n);if(this.maybeMoveToResponseJsonSchema(n),!Xdi(n)||nrn(n.config))return await this.generateContentInternal(c);let u=rrn(n);if(u.length>0){let g=u.map(A=>`tools[${A}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${g}.`)}let l,d,m=dA(c.contents),h=(s=(i=(r=c.config)===null||r===void 0?void 0:r.automaticFunctionCalling)===null||i===void 0?void 0:i.maximumRemoteCalls)!==null&&s!==void 0?s:trn,f=0;for(;f{var r,i,s,o,a;if(this.maybeMoveToResponseJsonSchema(n),nrn(n.config)){let d=await this.processParamsMaybeAddMcpUsage(n);return await this.generateContentStreamInternal(d)}let c=rrn(n);if(c.length>0){let d=c.map(m=>`tools[${m}]`).join(", ");throw new Error(`Incompatible tools found at ${d}. Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations" is not yet supported.`)}let u=(s=(i=(r=n?.config)===null||r===void 0?void 0:r.toolConfig)===null||i===void 0?void 0:i.functionCallingConfig)===null||s===void 0?void 0:s.streamFunctionCallArguments,l=(a=(o=n?.config)===null||o===void 0?void 0:o.automaticFunctionCalling)===null||a===void 0?void 0:a.disable;if(u&&!l)throw new Error("Running in streaming mode with 'streamFunctionCallArguments' enabled, this feature is not compatible with automatic function calling (AFC). Please set 'config.automaticFunctionCalling.disable' to true to disable AFC or leave 'config.toolConfig.functionCallingConfig.streamFunctionCallArguments' to be undefined or set to false to disable streaming function call arguments feature.");return await this.processAfcStream(n)},this.generateImages=async n=>(t.loggedGenerateImagesWarning||(t.loggedGenerateImagesWarning=!0,console.warn("The generateImages method is deprecated and will be removed in the next major release (not before Jan. 1 2027). Please use the generateContent method with image models instead. See https://ai.google.dev/gemini-api/docs/deprecations#imagen-models and https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/image-generation#generate-images")),await this.generateImagesInternal(n).then(r=>{var i;let s,o=[];if(r?.generatedImages)for(let c of r.generatedImages)c&&c?.safetyAttributes&&((i=c?.safetyAttributes)===null||i===void 0?void 0:i.contentType)==="Positive Prompt"?s=c?.safetyAttributes:o.push(c);let a;return s?a={generatedImages:o,positivePromptSafetyAttributes:s,sdkHttpResponse:r.sdkHttpResponse}:a={generatedImages:o,sdkHttpResponse:r.sdkHttpResponse},a})),this.list=async n=>{var r;let o={config:Object.assign(Object.assign({},{queryBase:!0}),n?.config)};if(this.apiClient.isVertexAI()&&!o.config.queryBase){if(!((r=o.config)===null||r===void 0)&&r.filter)throw new Error("Filtering tuned models list is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");o.config.filter="labels.tune-type:*"}return new Pv(Dv.PAGED_ITEM_MODELS,a=>this.listInternal(a),await this.listInternal(o),o)},this.editImage=async n=>{t.loggedEditImageWarning||(t.loggedEditImageWarning=!0,console.warn("The editImage method is deprecated and will be removed in the next major release (not before Jan. 1 2027). Please use the generateContent method with image models instead. See https://ai.google.dev/gemini-api/docs/deprecations#imagen-models and https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/gemini-edit-images#edit-an-image"));let r={model:n.model,prompt:n.prompt,referenceImages:[],config:n.config};return n.referenceImages&&n.referenceImages&&(r.referenceImages=n.referenceImages.map(i=>i.toReferenceImageAPI())),await this.editImageInternal(r)},this.upscaleImage=async n=>{let r={numberOfImages:1,mode:"upscale"};n.config&&(r=Object.assign(Object.assign({},r),n.config));let i={model:n.model,image:n.image,upscaleFactor:n.upscaleFactor,config:r};return await this.upscaleImageInternal(i)},this.generateVideos=async n=>{var r,i,s,o,a,c;if((n.prompt||n.image||n.video)&&n.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return(n.prompt||n.image||n.video)&&(t.loggedGenerateVideosWarning||(t.loggedGenerateVideosWarning=!0,console.warn("The generateVideos method with prompt/image/video arguments is deprecated and will be removed in a future major release (not before 2026-07-31). Please use the source argument instead."))),this.apiClient.isVertexAI()||(!((r=n.video)===null||r===void 0)&&r.uri&&(!((i=n.video)===null||i===void 0)&&i.videoBytes)?n.video={uri:n.video.uri,mimeType:n.video.mimeType}:!((o=(s=n.source)===null||s===void 0?void 0:s.video)===null||o===void 0)&&o.uri&&(!((c=(a=n.source)===null||a===void 0?void 0:a.video)===null||c===void 0)&&c.videoBytes)&&(n.source.video={uri:n.source.video.uri,mimeType:n.source.video.mimeType})),await this.generateVideosInternal(n)}}maybeMoveToResponseJsonSchema(e){e.config&&e.config.responseSchema&&(e.config.responseJsonSchema||Object.keys(e.config.responseSchema).includes("$schema")&&(e.config.responseJsonSchema=e.config.responseSchema,delete e.config.responseSchema))}async processParamsMaybeAddMcpUsage(e){var n,r,i;let s=(n=e.config)===null||n===void 0?void 0:n.tools;if(!s)return e;let o=await Promise.all(s.map(async c=>Y3(c)?await c.tool():c)),a={model:e.model,contents:e.contents,config:Object.assign(Object.assign({},e.config),{tools:o})};if(a.config.tools=o,e.config&&e.config.tools&&ein(e.config.tools)){let c=(i=(r=e.config.httpOptions)===null||r===void 0?void 0:r.headers)!==null&&i!==void 0?i:{},u=Object.assign({},c);Object.keys(u).length===0&&(u=this.apiClient.getDefaultHeaders()),tin(u),a.config.httpOptions=Object.assign(Object.assign({},e.config.httpOptions),{headers:u})}return a}async initAfcToolsMap(e){var n,r,i;let s=new Map;for(let o of(r=(n=e.config)===null||n===void 0?void 0:n.tools)!==null&&r!==void 0?r:[])if(Y3(o)){let a=o,c=await a.tool();for(let u of(i=c.functionDeclarations)!==null&&i!==void 0?i:[]){if(!u.name)throw new Error("Function declaration name is required.");if(s.has(u.name))throw new Error(`Duplicate tool declaration name: ${u.name}`);s.set(u.name,a)}}return s}async processAfcStream(e){var n,r,i;let s=(i=(r=(n=e.config)===null||n===void 0?void 0:n.automaticFunctionCalling)===null||r===void 0?void 0:r.maximumRemoteCalls)!==null&&i!==void 0?i:trn,o=!1,a=0,c=await this.initAfcToolsMap(e);return(function(u,l,d){return V3(this,arguments,function*(){for(var m,h,f,g,A,y;a0){o=!0;let N=new y2;N.candidates=[{content:{role:"user",parts:w}}],yield yield Zc(N);let O=[];O.push(...k),O.push({role:"user",parts:w});let W=dA(d.contents).concat(O);d.contents=W}else break}})})(this,c,e)}async generateContentInternal(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Xnn(this.apiClient,e);return a=er("{model}:generateContent",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=ern(l),m=new y2;return Object.assign(m,d),m})}else{let u=Jnn(this.apiClient,e);return a=er("{model}:generateContent",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=Znn(l),m=new y2;return Object.assign(m,d),m})}}async generateContentStreamInternal(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Xnn(this.apiClient,e);return a=er("{model}:streamGenerateContent?alt=sse",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.requestStream({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}),o.then(function(d){return V3(this,arguments,function*(){var m,h,f,g;try{for(var A=!0,y=EZ(d),E;E=yield Zc(y.next()),m=E.done,!m;A=!0){g=E.value,A=!1;let _=g,S=ern(yield Zc(_.json()),e);S.sdkHttpResponse={headers:_.headers};let C=new y2;Object.assign(C,S),yield yield Zc(C)}}catch(_){h={error:_}}finally{try{!A&&!m&&(f=y.return)&&(yield Zc(f.call(y)))}finally{if(h)throw h.error}}})})}else{let u=Jnn(this.apiClient,e);return a=er("{model}:streamGenerateContent?alt=sse",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.requestStream({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}),o.then(function(d){return V3(this,arguments,function*(){var m,h,f,g;try{for(var A=!0,y=EZ(d),E;E=yield Zc(y.next()),m=E.done,!m;A=!0){g=E.value,A=!1;let _=g,S=Znn(yield Zc(_.json()),e);S.sdkHttpResponse={headers:_.headers};let C=new y2;Object.assign(C,S),yield yield Zc(C)}}catch(_){h={error:_}}finally{try{!A&&!m&&(f=y.return)&&(yield Zc(f.call(y)))}finally{if(h)throw h.error}}})})}}async embedContentInternal(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Wli(this.apiClient,e,e),l=Xoi(e.model)?"{model}:embedContent":"{model}:predict";return a=er(l,u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(m=>{let h=m;return h.sdkHttpResponse={headers:d.headers},h})),o.then(d=>{let m=qli(d,e),h=new Lbe;return Object.assign(h,m),h})}else{let u=$li(this.apiClient,e);return a=er("{model}:batchEmbedContents",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=Hli(l),m=new Lbe;return Object.assign(m,d),m})}}async generateImagesInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI()){let a=Zli(this.apiClient,e);return s=er("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),i.then(c=>{let u=eui(c),l=new o7e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async editImageInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI()){let a=Fli(this.apiClient,e);return s=er("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),i.then(c=>{let u=Qli(c),l=new a7e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async upscaleImageInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI()){let a=ndi(this.apiClient,e);return s=er("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),i.then(c=>{let u=rdi(c),l=new c7e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async recontextImage(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI()){let a=Pui(this.apiClient,e);return s=er("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>{let u=Mui(c),l=new l7e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async segmentImage(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI()){let a=$ui(this.apiClient,e);return s=er("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>{let u=Wui(c),l=new u7e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async get(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=gui(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>B7e(l))}else{let u=fui(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json()),o.then(l=>k7e(l))}}async listInternal(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Cui(this.apiClient,e);return a=er("{models_url}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=wui(l),m=new Fbe;return Object.assign(m,d),m})}else{let u=Sui(this.apiClient,e);return a=er("{models_url}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=Iui(l),m=new Fbe;return Object.assign(m,d),m})}}async update(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=edi(this.apiClient,e);return a=er("{model}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>B7e(l))}else{let u=Zui(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json()),o.then(l=>k7e(l))}}async delete(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Pli(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=Oli(l),m=new Qbe;return Object.assign(m,d),m})}else{let u=Dli(this.apiClient,e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=Mli(l),m=new Qbe;return Object.assign(m,d),m})}}async countTokens(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=kli(this.apiClient,e);return a=er("{model}:countTokens",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=Nli(l),m=new Ube;return Object.assign(m,d),m})}else{let u=Rli(this.apiClient,e);return a=er("{model}:countTokens",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=Bli(l),m=new Ube;return Object.assign(m,d),m})}}async computeTokens(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI()){let a=_li(this.apiClient,e);return s=er("{model}:computeTokens",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),i.then(c=>{let u=xli(c),l=new d7e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async generateVideosInternal(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=oui(this.apiClient,e);return a=er("{model}:predictLongRunning",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o.then(l=>{let d=iui(l),m=new Gbe;return Object.assign(m,d),m})}else{let u=sui(this.apiClient,e);return a=er("{model}:predictLongRunning",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json()),o.then(l=>{let d=rui(l),m=new Gbe;return Object.assign(m,d),m})}}};z3.loggedGenerateImagesWarning=!1;z3.loggedEditImageWarning=!1;z3.loggedGenerateVideosWarning=!1;Q7e=class extends vx{constructor(e){super(),this.apiClient=e}async getVideosOperation(e){let n=e.operation,r=e.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){let i=n.name.split("/operations/")[0],s;r&&"httpOptions"in r&&(s=r.httpOptions);let o=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:i,config:{httpOptions:s}});return n._fromAPIResponse({apiResponse:o,_isVertexAI:!0})}else{let i=await this.getVideosOperationInternal({operationName:n.name,config:r});return n._fromAPIResponse({apiResponse:i,_isVertexAI:!1})}}async get(e){let n=e.operation,r=e.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){let i=n.name.split("/operations/")[0],s;r&&"httpOptions"in r&&(s=r.httpOptions);let o=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:i,config:{httpOptions:s}});return n._fromAPIResponse({apiResponse:o,_isVertexAI:!0})}else{let i=await this.getVideosOperationInternal({operationName:n.name,config:r});return n._fromAPIResponse({apiResponse:i,_isVertexAI:!1})}}async getVideosOperationInternal(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=Qoi(e);return a=er("{operationName}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json()),o}else{let u=Foi(e);return a=er("{operationName}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json()),o}}async fetchPredictVideosOperationInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI()){let a=Boi(e);return s=er("{resourceName}:fetchPredictOperation",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}};U7e=class extends vx{constructor(e){super(),this.apiClient=e}async create(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{let a=rpi(this.apiClient,e);s=er("auth_tokens",a._url),o=a._query,delete a.config,delete a._url,delete a._query;let c=fpi(a,e.config);return i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(u=>u.json()),i.then(u=>u)}}};G7e=class extends vx{constructor(e){super(),this.apiClient=e,this.list=async n=>new Pv(Dv.PAGED_ITEM_DOCUMENTS,r=>this.listInternal({parent:n.parent,config:r.config}),await this.listInternal(n),n)}async get(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=ypi(e);return s=er("{name}",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>c)}}async delete(e){var n,r;let i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let o=Api(e);i=er("{name}",o._url),s=o._query,delete o._url,delete o._query,await this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(o),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal})}}async listInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=bpi(e);return s=er("{parent}/documents",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>{let u=_pi(c),l=new h7e;return Object.assign(l,u),l})}}};$7e=class extends vx{constructor(e,n=new G7e(e)){super(),this.apiClient=e,this.documents=n,this.list=async(r={})=>new Pv(Dv.PAGED_ITEM_FILE_SEARCH_STORES,i=>this.listInternal(i),await this.listInternal(r),r)}async uploadToFileSearchStore(e){if(this.apiClient.isVertexAI())throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files to a file search store.");return this.apiClient.uploadFileToFileSearchStore(e.fileSearchStoreName,e.file,e.config)}async downloadMedia(e,n){if(this.apiClient.isVertexAI())throw new Error("This method is only supported in the Gemini Developer client.");let r=new URL(e,"http://dummy.com"),i=r.pathname;if(i.startsWith("/")&&(i=i.slice(1)),!i.includes("/media/"))throw new Error(`Invalid uri format: ${e}. Expected to contain /media/`);let s={};r.searchParams.forEach((c,u)=>{s[u]=c}),s.alt="media";let o=Object.assign({},n?.httpOptions),a=await this.apiClient.request({path:i,httpMethod:"GET",queryParams:s,httpOptions:o});if(a instanceof CN){let c=await a.responseInternal.arrayBuffer();return new Uint8Array(c)}else throw new Error("Unexpected response type from downloadMedia")}async create(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=udi(this.apiClient,e);return s=er("fileSearchStores",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>c)}}async get(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=mdi(e);return s=er("{name}",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>c)}}async delete(e){var n,r;let i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let o=pdi(e);i=er("{name}",o._url),s=o._query,delete o._url,delete o._query,await this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(o),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal})}}async listInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=Edi(e);return s=er("fileSearchStores",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>{let u=bdi(c),l=new f7e;return Object.assign(l,u),l})}}async uploadToFileSearchStoreInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=_di(e);return s=er("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>{let u=xdi(c),l=new g7e;return Object.assign(l,u),l})}}async importFile(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=gdi(e);return s=er("{file_search_store_name}:importFile",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),i.then(c=>{let u=fdi(c),l=new A7e;return Object.assign(l,u),l})}}};W7e=class{constructor(e){this.options=e}getDefaultHeaders(){return this.options.defaultHeaders}async resolveGoogleGenAISecurity(e){return Tpi(await this.options.getAuthHeaders(e))}},H7e=class{beforeCreateRequest(e,n){return Object.assign(Object.assign({},n),{url:Cpi(n.url)})}async beforeRequest(e,n){if(orn(n.headers,wpi(e.security_source)),vpi(e,n.headers),kpi(n.headers))return n;let r=await Ipi(e.security_source,n.url);return orn(n.headers,r?.default_headers),Rpi(n.headers,r),n}};IN=class extends Error{constructor(e,n){let r=e;n?.cause&&(r+=`: ${n.cause}`),super(r,n),this.name="HTTPClientError",typeof this.cause>"u"&&(this.cause=n?.cause)}},zbe=class extends IN{constructor(){super(...arguments),this.name="UnexpectedClientError"}},H3=class extends IN{constructor(){super(...arguments),this.name="InvalidRequestError"}},Kbe=class extends IN{constructor(){super(...arguments),this.name="RequestAbortedError"}},Jbe=class extends IN{constructor(){super(...arguments),this.name="RequestTimeoutError"}},Xbe=class extends IN{constructor(){super(...arguments),this.name="ConnectionError"}};tb=class extends Error{constructor(e,n){var r,i,s,o;super(e),this.statusCode=(r=n?.response)===null||r===void 0?void 0:r.status,this.body=(i=n?.body)!==null&&i!==void 0?i:"",this.headers=(s=n?.response)===null||s===void 0?void 0:s.headers,this.contentType=((o=n?.response)===null||o===void 0?void 0:o.headers.get("content-type"))||"",this.rawResponse=n?.response,this.name="GoogleGenAiError"}};q7e=class extends Error{},pA=class t extends q7e{constructor(e,n,r,i){super(t.makeMessage(e,n,r)),this.status=e,this.headers=i,this.error=n,this.statusCode=e,this.body=crn(n),this.contentType=i?.get("content-type")||"",this.rawResponse=void 0,this.cause=void 0,this.name=this.constructor.name,Object.setPrototypeOf(this,new.target.prototype)}static makeMessage(e,n,r){var i;let s=n&&Mpi(n)&&typeof n.message=="string"?n.message:void 0,o=crn(n),a=(i=s??r)!==null&&i!==void 0?i:o||"An error occurred";return`${e?`${e} `:""}${a}`}static generate(e,n,r,i){return!e||!i?new K3({message:r,cause:n instanceof Error?n:void 0}):e===400?new Y7e(e,n,r,i):e===401?new z7e(e,n,r,i):e===403?new K7e(e,n,r,i):e===404?new J7e(e,n,r,i):e===409?new X7e(e,n,r,i):e===422?new Z7e(e,n,r,i):e===429?new eKe(e,n,r,i):e>=500?new tKe(e,n,r,i):new t(e,n,r,i)}},j7e=class extends pA{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},K3=class extends pA{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),this.cause=n}},V7e=class extends K3{constructor({message:e}={}){super({message:e||"Request timed out. This is a client-side timeout. You can increase the timeout by setting the `timeout` argument in your request or client http options."})}},Y7e=class extends pA{},z7e=class extends pA{},K7e=class extends pA{},J7e=class extends pA{},X7e=class extends pA{},Z7e=class extends pA{},eKe=class extends pA{},tKe=class extends pA{};Zbe=class{constructor(){this.sdkInitHooks=[],this.beforeCreateRequestHooks=[],this.beforeRequestHooks=[],this.afterSuccessHooks=[],this.afterErrorHooks=[];let e=[];for(let n of e)"sdkInit"in n&&this.registerSDKInitHook(n),"beforeCreateRequest"in n&&this.registerBeforeCreateRequestHook(n),"beforeRequest"in n&&this.registerBeforeRequestHook(n),"afterSuccess"in n&&this.registerAfterSuccessHook(n),"afterError"in n&&this.registerAfterErrorHook(n);Lpi(this)}registerSDKInitHook(e){this.sdkInitHooks.push(e)}registerBeforeCreateRequestHook(e){this.beforeCreateRequestHooks.push(e)}registerBeforeRequestHook(e){this.beforeRequestHooks.push(e)}registerAfterSuccessHook(e){this.afterSuccessHooks.push(e)}registerAfterErrorHook(e){this.afterErrorHooks.push(e)}sdkInit(e){return this.sdkInitHooks.reduce((n,r)=>r.sdkInit(n),e)}beforeCreateRequest(e,n){let r=n;for(let i of this.beforeCreateRequestHooks)r=i.beforeCreateRequest(e,r);return r}async beforeRequest(e,n){let r=n;for(let i of this.beforeRequestHooks)r=await i.beforeRequest(e,r);return r}async afterSuccess(e,n){let r=n;for(let i of this.afterSuccessHooks)r=await i.afterSuccess(e,r);return r}async afterError(e,n,r){let i=n,s=r;for(let o of this.afterErrorHooks){let a=await o.afterError(e,i,s);i=a.response,s=a.error}return{response:i,error:s}}};Upi=Object.prototype.hasOwnProperty;urn=["https://generativelanguage.googleapis.com"];$pi={userAgent:"speakeasy-sdk/typescript 2.4.1-preview.4 internal v1beta @google/genai"};sin=qpi(",");ts=(t,e,n)=>{let r="",i=n?.explode?oin(t,e):[[t,e]];if(i.every(([a,c])=>c==null))return;let s=a=>n?.charEncoding==="percent"?encodeURIComponent(a):a,o=a=>s(ain(a));return i.forEach(([a,c])=>{var u;let l="";if(c!=null){if(Array.isArray(c))l=(u=lin(c,d=>`${o(d)}`))===null||u===void 0?void 0:u.join(",");else if(wN(c)){let d=uin(Object.entries(c),([m,h])=>`,${s(m)},${o(h)}`);l=d?.join("").slice(1)}else l=`${n?.explode&&wN(e)?`${a}=`:""}${o(c)}`;r+=l?`,${l}`:""}}),r.slice(1)};RN=Vpi(sin);Ypi=(t,e)=>e==null?fetch(t):fetch(t,e),nKe=class t{constructor(e={}){this.requestHooks=[],this.requestErrorHooks=[],this.responseHooks=[],this.options=e,this.fetcher=e.fetcher||Ypi}async request(e){let n=e;for(let r of this.requestHooks){let i=await r(n);i&&(n=i)}try{let r=await this.fetcher(n);for(let i of this.responseHooks)await i(r,n);return r}catch(r){for(let i of this.requestErrorHooks)await i(r,n);throw r}}addHook(...e){if(e[0]==="beforeRequest")this.requestHooks.push(e[1]);else if(e[0]==="requestError")this.requestErrorHooks.push(e[1]);else if(e[0]==="response")this.responseHooks.push(e[1]);else throw new Error(`Invalid hook type: ${e[0]}`);return this}removeHook(...e){let n;if(e[0]==="beforeRequest")n=this.requestHooks;else if(e[0]==="requestError")n=this.requestErrorHooks;else if(e[0]==="response")n=this.responseHooks;else throw new Error(`Invalid hook type: ${e[0]}`);let r=n.findIndex(i=>i===e[1]);return r>=0&&n.splice(r,1),this}clone(){let e=new t(this.options);return e.requestHooks=this.requestHooks.slice(),e.requestErrorHooks=this.requestErrorHooks.slice(),e.responseHooks=this.responseHooks.slice(),e}},drn=/\s*;\s*/g;zpi=new RegExp("^[0-9]xx$","i");prn={initialInterval:500,maxInterval:6e4,exponent:1.5,maxElapsedTime:36e5},xZ=class t extends Error{constructor(e,n){let r=e;n?.cause&&(r+=`: ${n.cause}`),super(r,n),this.name="PermanentError",typeof this.cause>"u"&&(this.cause=n?.cause),Object.setPrototypeOf(this,t.prototype)}},TN=class t extends Error{constructor(e,n){super(e),this.response=n,this.name="TemporaryError",Object.setPrototypeOf(this,t.prototype)}};Zpi=new RegExp("^[0-9]xx$","i");kbe=typeof globalThis>"u"?null:globalThis,rmi=typeof kbe=="object"&&kbe!=null&&"importScripts"in kbe&&typeof kbe.importScripts=="function",imi=rmi||typeof navigator<"u"&&"serviceWorker"in navigator||typeof window=="object"&&typeof window.document<"u",Mv=class{constructor(e={}){let n=e;typeof n=="object"&&n!=null&&"hooks"in n&&n.hooks instanceof Zbe?this._hooks=n.hooks:this._hooks=new Zbe;let r=new nKe;e.http_client=e.http_client||r,e=this._hooks.sdkInit(e);let i=Gpi(e);i&&(i.pathname=i.pathname.replace(/\/+$/,"")+"/"),this._baseURL=i,this._httpClient=e.http_client||r,this._options=Object.assign(Object.assign({},Spi(e)),{hooks:this._hooks}),this._logger=this._options.debug_logger,!this._logger&&_Z().GOOGLE_GENAI_DEBUG&&(this._logger=console)}_createRequest(e,n,r){var i,s,o,a,c;let{method:u,path:l,query:d,headers:m,security:h}=n,f=(i=n.baseURL)!==null&&i!==void 0?i:this._baseURL;if(!f)return Nv(new H3("No base URL provided for operation"));let g=new URL(f),A;l?(g.pathname=g.pathname.replace(/\/+$/,"")+"/",A=new URL(l,g),!A.search&&g.search&&(A.search=g.search)):A=g,A.hash="";let y=(q,ce)=>{if(!ce)return q;let Y=new Set(ce.split("&").filter(j=>j!=="").map(j=>{var se;return(se=j.split("=")[0])!==null&&se!==void 0?se:""}));return[...q.split("&").filter(j=>{var se;return j!==""&&!Y.has((se=j.split("=")[0])!==null&&se!==void 0?se:"")}),ce].join("&")},E=q=>Object.entries(q).map(([ce,Y])=>{if(Y==null)return;let z=wN(Y)?JSON.stringify(Y):Y;return sin(ce,z,{explode:Array.isArray(z),charEncoding:"percent"})}).filter(ce=>typeof ce<"u").join("&"),_=[d||"",E(r?.extra_query||{}),E(h?.queryParams||{})].reduce(y,A.search.slice(1));_&&(A.search=`?${_}`);let S=new Headers(m),C=h?.basic.username,I=h?.basic.password;if(C!=null||I!=null){let q=Qpi([C||"",I||""].join(":"));S.set("Authorization",`Basic ${q}`)}let w=new Headers(h?.headers||{});for(let[q,ce]of w)S.set(q,ce);let k=S.get("cookie")||"";for(let[q,ce]of Object.entries(h?.cookies||{}))k+=`; ${q}=${ce}`;k=k.startsWith("; ")?k.slice(2):k,S.set("cookie",k);let N=new Headers((s=r?.headers)!==null&&s!==void 0?s:(o=r?.fetch_options)===null||o===void 0?void 0:o.headers);for(let[q,ce]of N)S.set(q,ce);imi||S.set((a=n.uaHeader)!==null&&a!==void 0?a:"user-agent",(c=n.userAgent)!==null&&c!==void 0?c:$pi.userAgent);let O=n.body,W=Object.fromEntries(Object.entries(r?.extra_body||{}).filter(([,q])=>typeof q<"u"));if(Object.keys(W).length>0){let q=new Headers(m).get("content-type")||"";if(!/^(application|text)\/([^+]+\+)*json/.test(q)||typeof O!="string"&&O!=null)return Nv(new H3("extra_body can only be merged into JSON object request bodies"));let Y;try{Y=O?JSON.parse(O):{}}catch(z){return Nv(new H3("extra_body can only be merged into JSON object request bodies",{cause:z}))}if(!wN(Y))return Nv(new H3("extra_body can only be merged into JSON object request bodies"));O=JSON.stringify(Object.assign(Object.assign({},Y),W)),S.delete("content-length")}let $=Object.assign(Object.assign({},r?.fetch_options),r);!$?.signal&&n.timeout_ms!=null&&n.timeout_ms>0&&(e.timeout_ms=n.timeout_ms),n.body instanceof ReadableStream&&Object.assign($,{duplex:"half"});let G;try{G=this._hooks.beforeCreateRequest(e,{url:A,options:Object.assign(Object.assign({},$),{body:O??null,headers:S,method:u})})}catch(q){return Nv(new zbe("Create request hook failed to execute",{cause:q}))}return lrn(new Request(G.url,G.options))}async _do(e,n){let{context:r,isErrorStatusCode:i}=n,s=r.timeout_ms;return Xpi(async()=>{var o;let a=e.clone(),c=a;if(s!=null&&s>0){let d=AbortSignal.timeout(s),m=(o=Wpi(a.signal,d))!==null&&o!==void 0?o:d;c=new Request(a,{signal:m})}let u=await this._hooks.beforeRequest(r,c);await smi(this._logger,u).catch(d=>{var m;return(m=this._logger)===null||m===void 0?void 0:m.log("Failed to log request:",d)});let l=await this._httpClient.request(u);try{if(i(l.status)){let d=await this._hooks.afterError(r,l,null);if(d.error)throw d.error;l=d.response||l}else l=await this._hooks.afterSuccess(r,l)}finally{await omi(this._logger,l,u).catch(d=>{var m;return(m=this._logger)===null||m===void 0?void 0:m.log("Failed to log response:",d)})}return l},{config:n.retryConfig,statusCodes:n.retryCodes}).then(o=>lrn(o),o=>{switch(!0){case Jpi(o):return Nv(new Kbe("Request aborted by client",{cause:o}));case pin(o):return Nv(new Jbe("Request timed out",{cause:o}));case din(o):return Nv(new Xbe("Unable to make request",{cause:o}));default:return Nv(new zbe("Unexpected HTTP client error",{cause:o}))}})}},fin=/^(application|text)\/([^+]+\+)*json.*/,hrn=/^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/;e_e=class extends tb{constructor(e,n){e&&(e+=": "),e+=`Status ${n.response.status}`;let r=n.response.headers.get("content-type")||'""';r!=="application/json"&&(e+=` Content-Type ${r.includes(" ")?`"${r}"`:r}`);let i=n.body||'""';e+=i.length>100?` +`:". ";let s=i;if(i.length>1e4){let o=i.substring(0,1e4),a=i.length-1e4;s=`${o}...and ${a} more chars`}e+=`Body: ${s}`,e=e.trim(),super(e,n),this.name="GoogleGenAiDefaultError"}};rKe=class extends ReadableStream{constructor(e,n,r){var i;let s=e.getReader(),o=new Uint8Array(4096),a=0,c=0,u={eventId:void 0},l=(i=r?.dataRequired)!==null&&i!==void 0?i:!0;super({async pull(d){try{for(;;){let m=lmi(o,a,c);if(!m){c=Math.max(0,a-cmi+1);let g=await s.read();if(g.done)return d.close();if(a+g.value.length>o.length){let A=new Uint8Array(Math.max(o.length*2,a+g.value.length));A.set(o.subarray(0,a)),o=A}o.set(g.value,a),a+=g.value.length;continue}let h=o.slice(0,m.index);if(o.copyWithin(0,m.index+m.length,a),a-=m.index+m.length,o.length>4096&&a<=o.length>>2){let g=new Uint8Array(Math.max(4096,a*2));g.set(o.subarray(0,a)),o=g}c=0;let f=umi(h,n,u,l);if(f&&!f.done)return d.enqueue(f.value);if(f?.done)return await s.cancel("done"),d.close()}}catch(m){d.error(m),await s.cancel(m)}},cancel:d=>s.cancel(d)})}[Symbol.asyncIterator](e){let n=ReadableStream.prototype[Symbol.asyncIterator];if(typeof n=="function")return n.call(this,e);let r=this.getReader(),i={next:async()=>{let o=await r.read();return o.done?(r.releaseLock(),{done:!0,value:void 0}):{done:!1,value:o.value}},throw:async o=>(await r.cancel(o),r.releaseLock(),{done:!0,value:void 0}),return:async()=>(await r.cancel("done"),r.releaseLock(),{done:!0,value:void 0}),[Symbol.asyncIterator](){return this}},s=Symbol.asyncDispose;return s&&(i[s]=async()=>{var o;await((o=i.return)===null||o===void 0?void 0:o.call(i))}),i}values(e){return this[Symbol.asyncIterator](e)}},Z0=13,eb=10,gin=[[Z0,eb,Z0,eb],[Z0,eb,Z0],[Z0,eb,eb],[Z0,Z0,eb],[eb,Z0,eb],[Z0,Z0],[eb,Z0],[eb,eb]],cmi=gin.reduce((t,e)=>Math.max(t,e.length),0);dmi={jsonl:"application/jsonl",json:"application/json",text:"text/plain",bytes:"application/octet-stream",stream:"application/octet-stream",sse:"text/event-stream",nil:"*",fail:"*"};mmi=/, */;grn={Incomplete:"incomplete",UnrecognisedSecurityType:"unrecognized_security_type"},iKe=class t extends Error{constructor(e,n){super(n),this.code=e,this.name="SecurityError"}static incomplete(){return new t(grn.Incomplete,"Security requirements not met in order to perform the operation")}static unrecognizedType(e){return new t(grn.UnrecognisedSecurityType,`Unrecognised security type: ${e}`)}};Ea=class t{constructor(e,n){this[yin]="APIPromise",this._promise=e instanceof Promise?e:Promise.resolve(e),this._unwrapped=e instanceof Promise?null:Promise.resolve(e[0]),this._callSource=n??null}_getUnwrapped(){var e;return(e=this._unwrapped)!==null&&e!==void 0?e:this._unwrapped=this._promise.then(([n])=>n)}then(e,n){return this._promise.then(e?([r])=>e(r):void 0,n)}catch(e){return this._getUnwrapped().catch(e)}finally(e){return this._getUnwrapped().finally(e)}$inspect(){return this._promise}asResponse(){var e;return((e=this._callSource)!==null&&e!==void 0?e:this._callSource=this._promise.then(([,r])=>r)).then(r=>{if(!r.response)throw new Error("APIPromise.asResponse: response unavailable");return r.response})}async withResponse(){let[[e],n]=await Promise.all([this._promise,this.asResponse()]);return{data:e,response:n}}_thenUnwrap(e){var n;let r=this._promise.then(([i,s])=>[e(i),s]);return r.catch(()=>{}),new t(r,(n=this._callSource)!==null&&n!==void 0?n:void 0)}};yin=Symbol.toStringTag;sKe=class extends Mv{list(e,n){return ic(xin(this,e?.api_version,e?.page_size,e?.page_token,e?.parent,n))}create(e,n){let{api_version:r}=e,i=Oh(e,["api_version"]);return ic(Ein(this,i,r,n))}delete(e,n,r){return ic(bin(this,e,n?.api_version,r))}get(e,n,r){return ic(_in(this,e,n?.api_version,r))}};oKe=class extends Mv{list(e,n,r,i){return ic(Tin(this,e,n,r?.api_version,r?.page_size,r?.page_token,r?.recursive,i))}};aKe=class extends Mv{get files(){var e;return(e=this._files)!==null&&e!==void 0?e:this._files=new oKe(this._options)}listEnvironments(e,n){return ic(win(this,e?.api_version,e?.page_size,e?.page_token,n))}createEnvironment(e,n,r){return ic(Sin(this,e,n,r))}deleteEnvironment(e,n,r){return ic(Cin(this,e,n?.api_version,r))}getEnvironment(e,n,r){return ic(Iin(this,e,n?.api_version,r))}};cKe=class extends tb{constructor(e,n){var r;let i=((r=e.error)===null||r===void 0?void 0:r.message)||`API error occurred: ${JSON.stringify(e)}`;super(i,n),this.data$=e,this.error=e.error,this.name="CancelInteractionByIdServerError"}},lKe=class extends tb{constructor(e,n){var r;let i=((r=e.error)===null||r===void 0?void 0:r.message)||`API error occurred: ${JSON.stringify(e)}`;super(i,n),this.data$=e,this.error=e.error,this.name="CancelInteractionByIdClientError"}};uKe=class extends tb{constructor(e,n){var r;let i=((r=e.error)===null||r===void 0?void 0:r.message)||`API error occurred: ${JSON.stringify(e)}`;super(i,n),this.data$=e,this.error=e.error,this.name="CreateInteractionServerError"}},dKe=class extends tb{constructor(e,n){var r;let i=((r=e.error)===null||r===void 0?void 0:r.message)||`API error occurred: ${JSON.stringify(e)}`;super(i,n),this.data$=e,this.error=e.error,this.name="CreateInteractionClientError"}};pKe=class extends tb{constructor(e,n){var r;let i=((r=e.error)===null||r===void 0?void 0:r.message)||`API error occurred: ${JSON.stringify(e)}`;super(i,n),this.data$=e,this.error=e.error,this.name="DeleteInteractionServerError"}},mKe=class extends tb{constructor(e,n){var r;let i=((r=e.error)===null||r===void 0?void 0:r.message)||`API error occurred: ${JSON.stringify(e)}`;super(i,n),this.data$=e,this.error=e.error,this.name="DeleteInteractionClientError"}};hKe=class extends tb{constructor(e,n){var r;let i=((r=e.error)===null||r===void 0?void 0:r.message)||`API error occurred: ${JSON.stringify(e)}`;super(i,n),this.data$=e,this.error=e.error,this.name="GetInteractionByIdServerError"}},fKe=class extends tb{constructor(e,n){var r;let i=((r=e.error)===null||r===void 0?void 0:r.message)||`API error occurred: ${JSON.stringify(e)}`;super(i,n),this.data$=e,this.error=e.error,this.name="GetInteractionByIdClientError"}};gKe=class extends Mv{create(e,n){let{api_version:r}=e,i=Oh(e,["api_version"]);return ic(Rin(this,i,r,n))}delete(e,n,r){return ic(vmi(this,e,n?.api_version,r))}get(e,n,r){return ic(kin(this,e,n?.api_version,n?.include_input,n?.last_event_id,n?.stream,r))}cancel(e,n,r){return ic(vin(this,e,n?.api_version,r))}};AKe=class extends Mv{list(e,n){return ic(Min(this,e?.api_version,e?.filter,e?.page_size,e?.page_token,n))}create(e,n){let{api_version:r}=e,i=Oh(e,["api_version"]);return ic(Bin(this,i,r,n))}delete(e,n,r){return ic(Nin(this,e,n?.api_version,r))}get(e,n,r){return ic(Din(this,e,n?.api_version,r))}update(e,n,r){let{api_version:i}=n,s=Oh(n,["api_version"]);return ic(Lin(this,e,s,i,r))}listExecutions(e,n,r){return ic(Pin(this,e,n?.api_version,n?.page_size,n?.page_token,r))}run(e,n,r){return ic(Oin(this,e,n?.api_version,r))}};yKe=class extends Mv{list(e,n){return ic(Gin(this,e?.api_version,e?.page_size,e?.page_token,n))}create(e,n){let{api_version:r}=e,i=Oh(e,["api_version"]);return ic(Fin(this,i,r,n))}delete(e,n,r){return ic(Qin(this,e,n?.api_version,r))}get(e,n,r){return ic(Uin(this,e,n?.api_version,r))}update(e,n,r){let i=n??{},{api_version:s,update_mask:o}=i,a=Oh(i,["api_version","update_mask"]),c=n===void 0||Object.keys(a).length===0?void 0:a;return ic(Hin(this,e,s,o,c,r))}ping(e,n,r,i){return ic($in(this,e,n,r,i))}rotateSigningSecret(e,n,r,i){return ic(Win(this,e,n,r,i))}};qmi=class extends Mv{get agents(){var e;return(e=this._agents)!==null&&e!==void 0?e:this._agents=new sKe(this._options)}get environments(){var e;return(e=this._environments)!==null&&e!==void 0?e:this._environments=new aKe(this._options)}get interactions(){var e;return(e=this._interactions)!==null&&e!==void 0?e:this._interactions=new gKe(this._options)}get triggers(){var e;return(e=this._triggers)!==null&&e!==void 0?e:this._triggers=new AKe(this._options)}get webhooks(){var e;return(e=this._webhooks)!==null&&e!==void 0?e:this._webhooks=new yKe(this._options)}};jmi=new Set(["lyria-3-pro-preview","lyria-3-clip-preview"]);EKe=class{constructor(e){this.parentClient=e}async create(e,n){let{api_version:r}=e,i=Oh(e,["api_version"]);if(i.stream===!0){let o=await n7e(()=>this.getClient(r).interactions.create(Object.assign(Object.assign({},i),{stream:!0,api_version:r}),Oa(n,!0)));return yrn(o)}let s=await Pc(Rin(this.getClient(r),i,r,Oa(n)));return r7e(s)}async get(e,n={},r){let{api_version:i,stream:s=!1,last_event_id:o,include_input:a}=n??{};if(s===!0){let u=await n7e(()=>this.getClient(i).interactions.get(e,{stream:s,last_event_id:o,include_input:a,api_version:i},Oa(r,!0)));return yrn(u)}let c=await Pc(kin(this.getClient(i),e,i,a,o,s,Oa(r)));return r7e(c)}async delete(e,n={},r){return n7e(()=>this.getClient(n?.api_version).interactions.delete(e,{api_version:n?.api_version},Oa(r)))}async cancel(e,n={},r){return r7e(await Pc(vin(this.getClient(n?.api_version),e,n?.api_version,Oa(r))))}getClient(e){var n;return e?vI(this.parentClient,{api_version:e}):((n=this.sdk)!==null&&n!==void 0||(this.sdk=vI(this.parentClient)),this.sdk)}},bKe=class{constructor(e){this.parentClient=e}async create(e={},n){let r=e??{},{api_version:i}=r,s=Oh(r,["api_version"]);return Pc(Ein(this.getClient(i),s,i,Oa(n)))}async list(e={},n){let{api_version:r,pageSize:i,pageToken:s,parent:o}=e??{};return Pc(xin(this.getClient(r),r,i,s,o,Oa(n)))}async get(e,n={},r){return Pc(_in(this.getClient(n?.api_version),e,n?.api_version,Oa(r)))}async delete(e,n={},r){return Pc(bin(this.getClient(n?.api_version),e,n?.api_version,Oa(r)))}getClient(e){var n;return e?vI(this.parentClient,{api_version:e}):((n=this.sdk)!==null&&n!==void 0||(this.sdk=vI(this.parentClient)),this.sdk)}},_Ke=class{constructor(e){this.parentClient=e}async create(e,n){let{api_version:r}=e,i=Oh(e,["api_version"]);return Pc(Fin(this.getClient(),i,r,Oa(n)))}async list(e={},n){let{api_version:r,page_size:i,page_token:s}=e??{};return Pc(Gin(this.getClient(),r,i,s,Oa(n)))}async get(e,n={},r){return Pc(Uin(this.getClient(),e,n?.api_version,Oa(r)))}async update(e,n={},r){let i=n??{},{api_version:s,update_mask:o}=i,a=Oh(i,["api_version","update_mask"]);return Pc(Hin(this.getClient(),e,s,o,a,Oa(r)))}async delete(e,n={},r){return Pc(Qin(this.getClient(),e,n?.api_version,Oa(r)))}async rotateSigningSecret(e,n={},r){let i=n??{},{api_version:s}=i,o=Oh(i,["api_version"]);return Pc(Win(this.getClient(),e,s,o,Oa(r)))}async ping(e,n=void 0,r){let{api_version:i,body:s}=n??{};return Pc($in(this.getClient(),e,i,s,Oa(r)))}getClient(){var e;return(e=this.sdk)!==null&&e!==void 0||(this.sdk=vI(this.parentClient)),this.sdk}},xKe=class{constructor(e){this.parentClient=e}async create(e,n){let{api_version:r}=e,i=Oh(e,["api_version"]);return Pc(Bin(this.getClient(r),i,r,Oa(n)))}async list(e={},n){let{api_version:r,filter:i,pageSize:s,pageToken:o}=e??{};return Pc(Min(this.getClient(r),r,i,s,o,Oa(n)))}async get(e,n={},r){return Pc(Din(this.getClient(n?.api_version),e,n?.api_version,Oa(r)))}async update(e,n,r){let{api_version:i}=n,s=Oh(n,["api_version"]);return Pc(Lin(this.getClient(i),e,s,i,Oa(r)))}async delete(e,n={},r){return Pc(Nin(this.getClient(n?.api_version),e,n?.api_version,Oa(r)))}async run(e,n={},r){return Pc(Oin(this.getClient(n?.api_version),e,n?.api_version,Oa(r)))}async listExecutions(e,n={},r){let{api_version:i,pageSize:s,pageToken:o}=n??{};return Pc(Pin(this.getClient(i),e,i,s,o,Oa(r)))}getClient(e){var n;return e?vI(this.parentClient,{api_version:e}):((n=this.sdk)!==null&&n!==void 0||(this.sdk=vI(this.parentClient)),this.sdk)}};SKe=class{constructor(e){this.resolveClient=e}async list(e,n){let{environment:r,path:i,page_size:s,page_token:o,recursive:a,api_version:c}=e;return Pc(Tin(this.resolveClient(c),r,i,c,s,o,a,Oa(n)))}},CKe=class{constructor(e){this.parentClient=e,this.files=new SKe(n=>this.getClient(n))}async create(e,n){let{api_version:r}=e,i=Oh(e,["api_version"]);return Pc(Sin(this.getClient(r),i,r,Oa(n)))}async list(e={},n){let{api_version:r,page_size:i,page_token:s}=e??{};return Pc(win(this.getClient(r),r,i,s,Oa(n)))}async get(e,n={},r){return Pc(Iin(this.getClient(n?.api_version),e,n?.api_version,Oa(r)))}async delete(e,n={},r){return Pc(Cin(this.getClient(n?.api_version),e,n?.api_version,Oa(r)))}getClient(e){var n;return e?vI(this.parentClient,{api_version:e}):((n=this.sdk)!==null&&n!==void 0||(this.sdk=vI(this.parentClient)),this.sdk)}};brn="x-goog-api-key",yZ="https://www.googleapis.com/auth/cloud-platform",IKe=class{constructor(e){if(e.apiKey!==void 0){this.apiKey=e.apiKey;return}let n=nhi(e.googleAuthOptions);this.googleAuth=new Srn.GoogleAuth(n)}async addAuthHeaders(e,n){if(this.apiKey!==void 0){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");this.addKeyHeader(e);return}return this.addGoogleAuthHeaders(e,n)}addKeyHeader(e){if(e.get(brn)===null){if(this.apiKey===void 0)throw new Error("Trying to set API key header but apiKey is not set");e.append(brn,this.apiKey)}}async addGoogleAuthHeaders(e,n){if(this.googleAuth===void 0)throw new Error("Trying to set google-auth headers but googleAuth is unset");let r=await this.googleAuth.getRequestHeaders(n);for(let[i,s]of r)e.get(i)===null&&e.append(i,s)}};wKe=class{async download(e,n){if(e.downloadPath){let r=await rhi(e,n);if(r instanceof CN){let i=(0,Crn.createWriteStream)(e.downloadPath);wrn.Readable.fromWeb(r.responseInternal.body).pipe(i),await(0,Trn.finished)(i)}else try{await(0,Irn.writeFile)(e.downloadPath,r,{encoding:"base64"})}catch(i){throw new Error(`Failed to write file to ${e.downloadPath}: ${i}`)}}}};TKe=class{create(e,n,r){return new vKe(e,n,r)}},vKe=class{constructor(e,n,r){this.url=e,this.headers=n,this.callbacks=r}connect(){this.ws=new e7e.default(this.url,{headers:this.headers}),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(e){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(e)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}};BKe=class extends vx{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new Pv(Dv.PAGED_ITEM_TUNING_JOBS,r=>this.listInternal(r),await this.listInternal(n),n),this.get=async n=>await this.getInternal(n),this.tune=async n=>{var r;if(this.apiClient.isVertexAI())if(n.baseModel.startsWith("projects/")){let i={tunedModelName:n.baseModel};!((r=n.config)===null||r===void 0)&&r.preTunedModelCheckpointId&&(i.checkpointId=n.config.preTunedModelCheckpointId);let s=Object.assign(Object.assign({},n),{preTunedModel:i});return s.baseModel=void 0,await this.tuneInternal(s)}else{let i=Object.assign({},n);return await this.tuneInternal(i)}else{let i=Object.assign({},n),s=await this.tuneMldevInternal(i),o="";return s.metadata!==void 0&&s.metadata.tunedModel!==void 0?o=s.metadata.tunedModel:s.name!==void 0&&s.name.includes("/operations/")&&(o=s.name.split("/operations/")[0]),{name:o,state:s7e.JOB_STATE_QUEUED}}}}async getInternal(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=ghi(e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>kKe(l))}else{let u=fhi(e);return a=er("{name}",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>Ihi(l))}}async listInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI()){let a=yhi(e);return s=er("tuningJobs",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),i.then(c=>{let u=Ehi(c),l=new p7e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async cancel(e){var n,r,i,s;let o,a="",c={};if(this.apiClient.isVertexAI()){let u=shi(e);return a=er("{name}:cancel",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=ahi(l),m=new $be;return Object.assign(m,d),m})}else{let u=ihi(e);return a=er("{name}:cancel",u._url),c=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(i=e.config)===null||i===void 0?void 0:i.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(l=>l.json().then(d=>{let m=d;return m.sdkHttpResponse={headers:l.headers},m})),o.then(l=>{let d=ohi(l),m=new $be;return Object.assign(m,d),m})}}async tuneInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI()){let a=dhi(e,e);return s=er("tuningJobs",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),i.then(c=>kKe(c))}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async tuneMldevInternal(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let a=uhi(e);return s=er("tunedModels",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),i.then(c=>whi(c))}}async validateReward(e){var n,r;let i,s="",o={};if(this.apiClient.isVertexAI()){let a=Thi(e);return s=er("{parent}/tuningJobs:validateReinforcementTuningReward",a._url),o=a._query,delete a._url,delete a._query,i=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=e.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{let l=u;return l.sdkHttpResponse={headers:c.headers},l})),i.then(c=>{let u=vhi(c),l=new m7e;return Object.assign(l,u),l})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}},jin=1024*1024*8,Vin=3,Yin=1e3,zin=2,bN="x-goog-upload-status";NKe=class{async stat(e){let n={size:0,type:void 0};if(typeof e=="string"){let r=await n_e.stat(e);return n.size=r.size,n.type=this.inferMimeType(e),n}else return await Bhi(e)}async upload(e,n,r,i){return typeof e=="string"?await this.uploadFileFromPath(e,n,r,i):Rhi(e,n,r,i)}async uploadToFileSearchStore(e,n,r,i){return typeof e=="string"?await this.uploadFileToFileSearchStoreFromPath(e,n,r,i):khi(e,n,r,i)}inferMimeType(e){let n=e.slice(e.lastIndexOf(".")+1);return{aac:"audio/aac",abw:"application/x-abiword",arc:"application/x-freearc",avi:"video/x-msvideo",azw:"application/vnd.amazon.ebook",bin:"application/octet-stream",bmp:"image/bmp",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",css:"text/css",csv:"text/csv",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",eot:"application/vnd.ms-fontobject",epub:"application/epub+zip",gz:"application/gzip",gif:"image/gif",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",ics:"text/calendar",jar:"application/java-archive",jpeg:"image/jpeg",jpg:"image/jpeg",js:"text/javascript",json:"application/json",jsonld:"application/ld+json",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz+xml",mjs:"text/javascript",mp3:"audio/mpeg",mp4:"video/mp4",mpeg:"video/mpeg",mpkg:"application/vnd.apple.installer+xml",odt:"application/vnd.oasis.opendocument.text",oga:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",opus:"audio/opus",otf:"font/otf",png:"image/png",pdf:"application/pdf",php:"application/x-httpd-php",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",rar:"application/vnd.rar",rtf:"application/rtf",sh:"application/x-sh",svg:"image/svg+xml",swf:"application/x-shockwave-flash",tar:"application/x-tar",tif:"image/tiff",tiff:"image/tiff",ts:"video/mp2t",ttf:"font/ttf",txt:"text/plain",vsd:"application/vnd.visio",wav:"audio/wav",weba:"audio/webm",webm:"video/webm",webp:"image/webp",woff:"font/woff",woff2:"font/woff2",xhtml:"application/xhtml+xml",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xml:"application/xml",xul:"application/vnd.mozilla.xul+xml",zip:"application/zip","3gp":"video/3gpp","3g2":"video/3gpp2","7z":"application/x-7z-compressed"}[n.toLowerCase()]}async uploadFileFromPath(e,n,r,i){var s;let o=await this.uploadFileFromPathInternal(e,n,r,i),a=await o?.json();if(((s=o?.headers)===null||s===void 0?void 0:s[bN])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return a.file}async uploadFileToFileSearchStoreFromPath(e,n,r,i){var s;let o=await this.uploadFileFromPathInternal(e,n,r,i),a=await o?.json();if(((s=o?.headers)===null||s===void 0?void 0:s[bN])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");let c=MKe(a),u=new jbe;return Object.assign(u,c),u}async uploadFileFromPathInternal(e,n,r,i){var s,o,a;let c=n,u=i?.baseUrl||((s=r.clientOptions.httpOptions)===null||s===void 0?void 0:s.baseUrl);if(u){let A=new URL(u),y=new URL(n);y.protocol=A.protocol,y.host=A.host,y.port=A.port,c=y.toString()}let l=0,d=0,m=new CN(new Response),h="upload",f,g=vrn.basename(e);try{if(f=await n_e.open(e,"r"),!f)throw new Error("Failed to open file");for(l=(await f.stat()).size;d=l&&(h+=", finalize");let y=new Uint8Array(A),{bytesRead:E}=await f.read(y,0,A,d);if(E!==A)throw new Error(`Failed to read ${A} bytes from file at offset ${d}. bytes actually read: ${E}`);let _=new Blob([y]),S=0,C=Yin;for(;S"u"||!process.versions||!process.versions.node)throw new Error("registerFiles is only supported in Node.js environments.");let r=await e.auth.getRequestHeaders(),i=e.config||{},s=i.httpOptions||{},o=Object.assign({},s.headers||{});if(r)if(typeof r[Symbol.iterator]=="function")for(let[a,c]of r)o[a]=c;else for(let[a,c]of Object.entries(r))o[a]=c;return this._registerFiles({uris:e.uris,config:Object.assign(Object.assign({},i),{httpOptions:Object.assign(Object.assign({},s),{headers:o})})})}};Nhi="gl-node/";E2=class{getNextGenClient(){let e=this.httpOptions;return this._nextGenClient===void 0&&(this._nextGenClient=vI(this.apiClient,{timeout_ms:e?.timeout})),e?.extraBody&&console.warn("GoogleGenAI: Client level httpOptions.extraBody is not supported by the Gemini NextGen client and will be ignored."),this._nextGenClient}get interactions(){return this._interactions!==void 0?this._interactions:(this._interactions=new EKe(this.apiClient),this._interactions)}get webhooks(){return this._webhooks!==void 0?this._webhooks:(this._webhooks=new _Ke(this.apiClient),this._webhooks)}get agents(){return this._agents!==void 0?this._agents:(console.warn("GoogleGenAI.agents: Agents usage is experimental and may change in future versions."),this._agents=new bKe(this.apiClient),this._agents)}get triggers(){return this._triggers!==void 0?this._triggers:(console.warn("GoogleGenAI.triggers: Triggers usage is experimental and may change in future versions."),this._triggers=new xKe(this.apiClient),this._triggers)}get environments(){return this._environments!==void 0?this._environments:(console.warn("GoogleGenAI.environments: Environments usage is experimental and may change in future versions."),this._environments=new CKe(this.apiClient),this._environments)}constructor(e={}){var n,r,i,s;if(this.vertexai=Dhi(e),(e.project||e.location)&&!this.vertexai)throw new Error("Project and location are not supported for Gemini API backend.");let o=Phi(),a=_N("GOOGLE_CLOUD_PROJECT"),c=_N("GOOGLE_CLOUD_LOCATION");this.apiKey=(n=e.apiKey)!==null&&n!==void 0?n:o,this.project=(r=e.project)!==null&&r!==void 0?r:a,this.location=(i=e.location)!==null&&i!==void 0?i:c,!this.vertexai&&!this.apiKey&&console.warn("API key should be set when using the Gemini API."),this.vertexai&&(!((s=e.googleAuthOptions)===null||s===void 0)&&s.credentials&&(console.debug("The user provided Google Cloud credentials will take precedence over the API key from the environment variable."),this.apiKey=void 0),!e.project&&!e.location&&(a||c)&&e.apiKey?(console.debug("The user provided Vertex AI API key will take precedence over the project/location from the environment variables."),this.project=void 0,this.location=void 0):(e.project||e.location)&&!e.apiKey&&o?(console.debug("The user provided project/location will take precedence over the API key from the environment variables."),this.apiKey=void 0):!e.project&&!e.location&&!e.apiKey&&(a||c)&&o&&(console.debug("The project/location from the environment variables will take precedence over the API key from the environment variables."),this.apiKey=void 0),!this.location&&!this.apiKey&&(this.location="global"));let u=Roi(e.httpOptions,this.vertexai,_N("GOOGLE_VERTEX_BASE_URL"),_N("GOOGLE_GEMINI_BASE_URL"));u&&(e.httpOptions?e.httpOptions.baseUrl=u:e.httpOptions={baseUrl:u}),this.apiVersion=e.apiVersion,this.httpOptions=e.httpOptions;let l=new IKe({apiKey:this.apiKey,googleAuthOptions:e.googleAuthOptions});this.apiClient=new D7e({auth:l,project:this.project,location:this.location,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:Nhi+process.version,uploader:new NKe,downloader:new wKe}),this.models=new z3(this.apiClient),this.live=new L7e(this.apiClient,l,new TKe),this.batches=new w7e(this.apiClient),this.chats=new v7e(this.models,this.apiClient),this.caches=new T7e(this.apiClient),this.files=new DKe(this.apiClient),this.operations=new Q7e(this.apiClient),this.authTokens=new U7e(this.apiClient),this.tunings=new BKe(this.apiClient),this.fileSearchStores=new $7e(this.apiClient)}}});function CZ(t,e){let n=t.thinkingLevelMap?.[e],r=typeof n=="string"?n.toLowerCase():e;switch(r){case"minimal":case"low":case"medium":case"high":return r;default:throw new Error(`Unsupported Google thinking level mapping for ${t.provider}/${t.id}: ${e} -> ${String(n)}`)}}function IZ(t){let e=t.id.toLowerCase();return/gemini-3(?:\.\d+)?-(?:pro|flash)/.test(e)||e==="gemini-flash-latest"||e==="gemini-flash-lite-latest"||/gemma-?4/.test(e)}function wZ(t){switch(t){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function TZ(t){return Mhi[t]}function o_e(t){if(!IZ(t))return{thinkingBudget:0};let e=Wl(t,"off");if(e==="off")return{thinkingBudget:0};let n=CZ(t,e),r=wZ(n);return{thinkingLevel:TZ(r)}}function a_e(t){return t.thought===!0}function t4(t,e){return typeof e=="string"&&e.length>0?e:t}function Lhi(t){return!t||t.length%4!==0?!1:Ohi.test(t)}function $Ke(t,e){return t&&Lhi(e)?e:void 0}function WKe(t){let e=HKe(t);return t.startsWith("claude-")||t.startsWith("gpt-oss-")||e!==void 0&&e>=3}function HKe(t){let e=t.toLowerCase().match(/^gemini(?:-live)?-(\d+)/);if(e)return Number.parseInt(e[1],10)}function Fhi(t){let e=HKe(t);return e!==void 0?e>=3:!0}function c_e(t,e){let n=tJ(ZC(e).messages),r=[],s=k0(n,t,o=>WKe(t.id)?o.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,64):o);for(let o of s)if(o.role==="user")if(typeof o.content=="string")r.push({role:"user",parts:[{text:ri(o.content)}]});else{let a=o.content.map(c=>c.type==="text"?{text:ri(c.text)}:{inlineData:{mimeType:c.mimeType,data:c.data}});if(a.length===0)continue;r.push({role:"user",parts:a})}else if(o.role==="assistant"){let a=[],c=o.provider===t.provider&&o.model===t.id;for(let u of o.content)if(u.type==="text"){let l=$Ke(c,u.textSignature);if((!u.text||u.text.trim()==="")&&!l)continue;a.push({text:ri(u.text),...l&&{thoughtSignature:l}})}else if(u.type==="thinking")if(c){let l=$Ke(c,u.thinkingSignature);if((!u.thinking||u.thinking.trim()==="")&&!l)continue;a.push({thought:!0,text:ri(u.thinking),...l&&{thoughtSignature:l}})}else{if(!u.thinking||u.thinking.trim()==="")continue;a.push({text:ri(u.thinking)})}else if(u.type==="toolCall"){let l=$Ke(c,u.thoughtSignature),d={functionCall:{name:u.name,args:u.arguments??{},...WKe(t.id)?{id:u.id}:{}},...l&&{thoughtSignature:l}};a.push(d)}if(a.length===0)continue;r.push({role:"model",parts:a})}else if(o.role==="toolResult"){let c=o.content.filter(E=>E.type==="text").map(E=>E.text).join(` +`),u=t.input.includes("image")?o.content.filter(E=>E.type==="image"):[],l=c.length>0,d=u.length>0,m=Fhi(t.id),h=l?ri(c):d?"(see attached image)":"",f=u.map(E=>({inlineData:{mimeType:E.mimeType,data:E.data}})),g=WKe(t.id),A={functionResponse:{name:o.toolName,response:o.isError?{error:h}:{output:h},...d&&m&&{parts:f},...g?{id:o.toolCallId}:{}}},y=r[r.length-1];y?.role==="user"&&y.parts?.some(E=>E.functionResponse)?y.parts.push(A):r.push({role:"user",parts:[A]}),d&&!m&&r.push({role:"user",parts:[{text:"Tool result image:"},...f]})}return r}function Zin(t){if(typeof t!="object"||t===null||Array.isArray(t))return t;let e={};for(let[n,r]of Object.entries(t))Qhi.has(n)||(e[n]=Zin(r));return e}function l_e(t,e=!1,n=!0){if(t.length!==0)return[{functionDeclarations:t.map(r=>{let i=wy(r,n),s=v0(r,i);return{name:r.name,description:r.description,...e?{parameters:Zin(s)}:{parametersJsonSchema:s}}})}]}function u_e(t){let e=HKe(t);return e!==void 0&&e>=3}function Xin(t){switch(t){case"auto":return SN.AUTO;case"none":return SN.NONE;case"any":return SN.ANY;default:return SN.AUTO}}function d_e(t,e,n){let r=t.some(i=>wy(i,n)===!0);return e==="none"||e==="any"?Xin(e):r?SN.VALIDATED:e?Xin(e):void 0}function p_e(t){switch(t){case nd.STOP:return"stop";case nd.MAX_TOKENS:return"length";case nd.BLOCKLIST:case nd.PROHIBITED_CONTENT:case nd.SPII:case nd.SAFETY:case nd.IMAGE_SAFETY:case nd.IMAGE_PROHIBITED_CONTENT:case nd.IMAGE_RECITATION:case nd.IMAGE_OTHER:case nd.RECITATION:case nd.FINISH_REASON_UNSPECIFIED:case nd.OTHER:case nd.LANGUAGE:case nd.MALFORMED_FUNCTION_CALL:case nd.UNEXPECTED_TOOL_CALL:case nd.TOO_MANY_TOOL_CALLS:case nd.NO_IMAGE:return"error";default:{let e=t;throw new Error(`Unhandled stop reason: ${e}`)}}}function m_e(t,e){return Q0(async()=>{try{return await t()}catch(n){throw n instanceof Error&&"status"in n&&!("headers"in n)&&(n.headers=void 0),n}},{maxRetries:e?.maxRetries,maxRetryDelayMs:e?.maxRetryDelayMs,signal:e?.signal})}var Mhi,Ohi,Qhi,qKe=v(()=>{p();s_e();ni();CL();tI();Nf();nI();jO();Mhi={THINKING_LEVEL_UNSPECIFIED:xN.THINKING_LEVEL_UNSPECIFIED,MINIMAL:xN.MINIMAL,LOW:xN.LOW,MEDIUM:xN.MEDIUM,HIGH:xN.HIGH};Ohi=/^[A-Za-z0-9+/]+={0,2}$/;Qhi=new Set(["$schema","$id","$anchor","$dynamicAnchor","$vocabulary","$comment","$defs","definitions"])});var esn={};br(esn,{stream:()=>vZ,streamSimple:()=>Ghi});function $hi(t,e,n){let r={};t.baseUrl&&(r.baseUrl=t.baseUrl,r.apiVersion="");let i=eI({"User-Agent":Bh(),...t.headers,...n});return i&&(r.headers=i),new E2({apiKey:e,httpOptions:Object.keys(r).length>0?r:void 0})}function Whi(t,e,n={}){let r=c_e(t,e),i=Iy(e.messages),s=Nm(e.messages),o={};n.temperature!==void 0&&(o.temperature=n.temperature),n.maxTokens!==void 0&&(o.maxOutputTokens=n.maxTokens);let a=u_e(t.id),c=s.length>0?d_e(s,n.toolChoice,a):void 0,u=i?kc(i):"",l={...Object.keys(o).length>0&&o,...u&&{systemInstruction:ri(u)},...s.length>0&&{tools:l_e(s,!1,a)},...c!==void 0&&{toolConfig:{functionCallingConfig:{mode:c}}}};if(n.thinking?.enabled&&t.reasoning){let m={includeThoughts:!0};n.thinking.level!==void 0?m.thinkingLevel=TZ(n.thinking.level):n.thinking.budgetTokens!==void 0&&(m.thinkingBudget=n.thinking.budgetTokens),l.thinkingConfig=m}else t.reasoning&&n.thinking&&!n.thinking.enabled&&(l.thinkingConfig=o_e(t));if(n.signal){if(n.signal.aborted)throw new Error("Request aborted");l.abortSignal=n.signal}return{model:t.id,contents:r,config:l}}function Hhi(t,e,n){return n?.[e]!==void 0?n[e]:t.id.includes("2.5-pro")?{minimal:128,low:2048,medium:8192,high:32768}[e]:t.id.includes("2.5-flash-lite")?{minimal:512,low:2048,medium:8192,high:24576}[e]:t.id.includes("2.5-flash")?{minimal:128,low:2048,medium:8192,high:24576}[e]:-1}var Uhi,vZ,Ghi,tsn=v(()=>{p();s_e();ni();ev();eA();T0();dv();tI();Cy();Nf();qKe();rI();Uhi=0,vZ=(t,e,n)=>{let r=new Rc,i=ZC(e);return(async()=>{let s={role:"assistant",content:[],api:"google-generative-ai",provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(n?.fetch&&n.fetch!==globalThis.fetch)throw new Error("Custom fetch is not supported by the Google Generative AI adapter");let o=n?.apiKey;if(!o)throw new Error(`No API key for provider: ${t.provider}`);let a=$hi(t,o,n?.headers),c=Whi(t,i,n),u=await n?.onPayload?.(c,t);u!==void 0&&(c=u);let l=await m_e(()=>a.models.generateContentStream(c),n);r.push({type:"start",partial:s});let d=null,m=s.content,h=()=>m.length-1;for await(let f of l){s.responseId||=f.responseId;let g=f.candidates?.[0];if(g?.content?.parts)for(let A of g.content.parts){if(A.text!==void 0){let y=a_e(A);(!d||y&&d.type!=="thinking"||!y&&d.type!=="text")&&(d&&(d.type==="text"?r.push({type:"text_end",contentIndex:m.length-1,content:d.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:d.thinking,partial:s})),y?(d={type:"thinking",thinking:"",thinkingSignature:void 0},s.content.push(d),r.push({type:"thinking_start",contentIndex:h(),partial:s})):(d={type:"text",text:""},s.content.push(d),r.push({type:"text_start",contentIndex:h(),partial:s}))),d.type==="thinking"?(d.thinking+=A.text,d.thinkingSignature=t4(d.thinkingSignature,A.thoughtSignature),r.push({type:"thinking_delta",contentIndex:h(),delta:A.text,partial:s})):(d.text+=A.text,d.textSignature=t4(d.textSignature,A.thoughtSignature),r.push({type:"text_delta",contentIndex:h(),delta:A.text,partial:s}))}if(A.functionCall){d&&(d.type==="text"?r.push({type:"text_end",contentIndex:h(),content:d.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:d.thinking,partial:s}),d=null);let y=A.functionCall.id,S={type:"toolCall",id:!y||s.content.some(C=>C.type==="toolCall"&&C.id===y)?`${A.functionCall.name}_${Date.now()}_${++Uhi}`:y,name:A.functionCall.name||"",arguments:A.functionCall.args??{},...A.thoughtSignature&&{thoughtSignature:A.thoughtSignature}};s.content.push(S),r.push({type:"toolcall_start",contentIndex:h(),partial:s}),r.push({type:"toolcall_delta",contentIndex:h(),delta:JSON.stringify(S.arguments),partial:s}),r.push({type:"toolcall_end",contentIndex:h(),toolCall:S,partial:s})}}g?.finishReason&&(s.rawStopReason=g.finishReason,s.stopReason=p_e(g.finishReason),s.content.some(A=>A.type==="toolCall")&&s.stopReason==="stop"&&(s.stopReason="toolUse")),f.usageMetadata&&(s.usage={input:(f.usageMetadata.promptTokenCount||0)-(f.usageMetadata.cachedContentTokenCount||0),output:(f.usageMetadata.candidatesTokenCount||0)+(f.usageMetadata.thoughtsTokenCount||0),cacheRead:f.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:f.usageMetadata.thoughtsTokenCount||0,totalTokens:f.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},$p(t,s.usage))}if(d&&(d.type==="text"?r.push({type:"text_end",contentIndex:h(),content:d.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:d.thinking,partial:s})),n?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="pending")throw new Error("Google stream ended without a finish reason");if(s.stopReason==="aborted"||s.stopReason==="error"){let f=s.rawStopReason?`Provider stopped with: ${s.rawStopReason}`:"An unknown error occurred";throw new Error(f)}r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(o){for(let a of s.content)"index"in a&&delete a.index;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=tA(Rh(o)),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},Ghi=(t,e,n)=>{let r=n?.apiKey;if(!r)throw new Error(`No API key for provider: ${t.provider}`);let i={...Wp(t,e,n,r),toolChoice:n?.toolChoice};if(!n?.reasoning)return vZ(t,e,{...i,thinking:{enabled:!1}});let s=Wl(t,n.reasoning);if(s==="off")return vZ(t,e,{...i,thinking:{enabled:!1}});let o=CZ(t,s);return IZ(t)?vZ(t,e,{...i,thinking:{enabled:!0,level:wZ(o)}}):vZ(t,e,{...i,thinking:{enabled:!0,budgetTokens:Hhi(t,o,n.thinkingBudgets)}})}});var Fv,n4=v(()=>{p();Sy();Fv=()=>ed(()=>Promise.resolve().then(()=>(tsn(),esn)))});var isn={};br(isn,{stream:()=>RZ,streamSimple:()=>Vhi});function Yhi(t,e,n,r,i){let s=Xhi(i);return new E2({vertexai:!0,project:e,location:n,apiVersion:nsn,...s?{googleAuthOptions:s}:{},httpOptions:rsn(t,r)})}function zhi(t,e,n){return new E2({vertexai:!0,apiKey:e,apiVersion:nsn,httpOptions:rsn(t,n)})}function rsn(t,e){let n={},r=Khi(t.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=bZ.COLLECTION,Jhi(r)&&(n.apiVersion=""));let i=eI({"User-Agent":Bh(),...t.headers,...e});return i&&(n.headers=i),Object.keys(n).length>0?n:void 0}function Khi(t){let e=t.trim();if(!(!e||e.includes("{location}")))return e}function Jhi(t){try{return new URL(t).pathname.split("/").some(n=>/^v\d+(?:beta\d*)?$/.test(n))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(t)}}function Xhi(t){let e=vi("GOOGLE_APPLICATION_CREDENTIALS",t);return e?{keyFilename:e}:void 0}function Zhi(t){let e=t?.apiKey?.trim();if(!(!e||e===qhi||efi(e)))return e}function efi(t){return/^<[^>]+>$/.test(t)}function tfi(t){let e=t?.project||vi("GOOGLE_CLOUD_PROJECT",t?.env)||vi("GCLOUD_PROJECT",t?.env);if(!e)throw new Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return e}function nfi(t){let e=t?.location||vi("GOOGLE_CLOUD_LOCATION",t?.env);if(!e)throw new Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return e}function rfi(t,e,n={}){let r=c_e(t,e),i=Iy(e.messages),s=Nm(e.messages),o={};n.temperature!==void 0&&(o.temperature=n.temperature),n.maxTokens!==void 0&&(o.maxOutputTokens=n.maxTokens);let a=u_e(t.id),c=s.length>0?d_e(s,n.toolChoice,a):void 0,u=i?kc(i):"",l={...Object.keys(o).length>0&&o,...u&&{systemInstruction:ri(u)},...s.length>0&&{tools:l_e(s,!1,a)},...c!==void 0&&{toolConfig:{functionCallingConfig:{mode:c}}}};if(n.thinking?.enabled&&t.reasoning){let m={includeThoughts:!0};n.thinking.level!==void 0?m.thinkingLevel=TZ(n.thinking.level):n.thinking.budgetTokens!==void 0&&(m.thinkingBudget=n.thinking.budgetTokens),l.thinkingConfig=m}else t.reasoning&&n.thinking&&!n.thinking.enabled&&(l.thinkingConfig=o_e(t));if(n.signal){if(n.signal.aborted)throw new Error("Request aborted");l.abortSignal=n.signal}return{model:t.id,contents:r,config:l}}function ifi(t,e,n){return n?.[e]!==void 0?n[e]:t.id.includes("2.5-pro")?{minimal:128,low:2048,medium:8192,high:32768}[e]:t.id.includes("2.5-flash")?{minimal:128,low:2048,medium:8192,high:24576}[e]:-1}var nsn,qhi,jhi,RZ,Vhi,ssn=v(()=>{p();s_e();ni();ev();eA();T0();dv();cx();tI();Cy();Nf();qKe();rI();nsn="v1",qhi="gcp-vertex-credentials",jhi=0,RZ=(t,e,n)=>{let r=new Rc,i=ZC(e);return(async()=>{let s={role:"assistant",content:[],api:"google-vertex",provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(n?.fetch&&n.fetch!==globalThis.fetch)throw new Error("Custom fetch is not supported by the Google Vertex adapter");let o=Zhi(n),a=o?zhi(t,o,n?.headers):Yhi(t,tfi(n),nfi(n),n?.headers,n?.env),c=rfi(t,i,n),u=await n?.onPayload?.(c,t);u!==void 0&&(c=u);let l=await m_e(()=>a.models.generateContentStream(c),n);r.push({type:"start",partial:s});let d=null,m=s.content,h=()=>m.length-1;for await(let f of l){s.responseId||=f.responseId;let g=f.candidates?.[0];if(g?.content?.parts)for(let A of g.content.parts){if(A.text!==void 0){let y=a_e(A);(!d||y&&d.type!=="thinking"||!y&&d.type!=="text")&&(d&&(d.type==="text"?r.push({type:"text_end",contentIndex:m.length-1,content:d.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:d.thinking,partial:s})),y?(d={type:"thinking",thinking:"",thinkingSignature:void 0},s.content.push(d),r.push({type:"thinking_start",contentIndex:h(),partial:s})):(d={type:"text",text:""},s.content.push(d),r.push({type:"text_start",contentIndex:h(),partial:s}))),d.type==="thinking"?(d.thinking+=A.text,d.thinkingSignature=t4(d.thinkingSignature,A.thoughtSignature),r.push({type:"thinking_delta",contentIndex:h(),delta:A.text,partial:s})):(d.text+=A.text,d.textSignature=t4(d.textSignature,A.thoughtSignature),r.push({type:"text_delta",contentIndex:h(),delta:A.text,partial:s}))}if(A.functionCall){d&&(d.type==="text"?r.push({type:"text_end",contentIndex:h(),content:d.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:d.thinking,partial:s}),d=null);let y=A.functionCall.id,S={type:"toolCall",id:!y||s.content.some(C=>C.type==="toolCall"&&C.id===y)?`${A.functionCall.name}_${Date.now()}_${++jhi}`:y,name:A.functionCall.name||"",arguments:A.functionCall.args??{},...A.thoughtSignature&&{thoughtSignature:A.thoughtSignature}};s.content.push(S),r.push({type:"toolcall_start",contentIndex:h(),partial:s}),r.push({type:"toolcall_delta",contentIndex:h(),delta:JSON.stringify(S.arguments),partial:s}),r.push({type:"toolcall_end",contentIndex:h(),toolCall:S,partial:s})}}g?.finishReason&&(s.rawStopReason=g.finishReason,s.stopReason=p_e(g.finishReason),s.content.some(A=>A.type==="toolCall")&&s.stopReason==="stop"&&(s.stopReason="toolUse")),f.usageMetadata&&(s.usage={input:(f.usageMetadata.promptTokenCount||0)-(f.usageMetadata.cachedContentTokenCount||0),output:(f.usageMetadata.candidatesTokenCount||0)+(f.usageMetadata.thoughtsTokenCount||0),cacheRead:f.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:f.usageMetadata.thoughtsTokenCount||0,totalTokens:f.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},$p(t,s.usage))}if(d&&(d.type==="text"?r.push({type:"text_end",contentIndex:h(),content:d.text,partial:s}):r.push({type:"thinking_end",contentIndex:h(),content:d.thinking,partial:s})),n?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="pending")throw new Error("Google Vertex stream ended without a finish reason");if(s.stopReason==="aborted"||s.stopReason==="error"){let f=s.rawStopReason?`Provider stopped with: ${s.rawStopReason}`:"An unknown error occurred";throw new Error(f)}r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(o){for(let a of s.content)"index"in a&&delete a.index;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=tA(Rh(o)),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},Vhi=(t,e,n)=>{let r={...Wp(t,e,n,void 0),toolChoice:n?.toolChoice};if(!n?.reasoning)return RZ(t,e,{...r,thinking:{enabled:!1}});let i=Wl(t,n.reasoning);if(i==="off")return RZ(t,e,{...r,thinking:{enabled:!1}});let s=CZ(t,i);return IZ(t)?RZ(t,e,{...r,thinking:{enabled:!0,level:wZ(s)}}):RZ(t,e,{...r,thinking:{enabled:!0,budgetTokens:ifi(t,s,n.thinkingBudgets)}})}});var _2,kZ=v(()=>{p();Sy();_2=()=>ed(()=>Promise.resolve().then(()=>(ssn(),isn)))});var fsn={};br(fsn,{stream:()=>dsn,streamSimple:()=>ofi});function afi(t){return{role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()}}function cfi(){let t=new Map,e=new Map;return n=>{let r=t.get(n);if(r)return r;let i=0;for(;;){let s=psn(n,i),o=e.get(s);if(!o||o===n)return t.set(n,s),e.set(s,n),s;i++}}}function psn(t,e){let n=t.replace(/[^a-zA-Z0-9]/g,"");if(e===0&&n.length===osn)return n;let r=n||t,i=e===0?r:`${r}:${e}`;return sN(i).replace(/[^a-zA-Z0-9]/g,"").slice(0,osn)}function lfi(t){if(t instanceof Error){let e=t,n=typeof e.statusCode=="number"?e.statusCode:void 0,r=typeof e.body=="string"?e.body.trim():void 0;return n!==void 0&&r?`Mistral API error (${n}): ${ufi(r,sfi)}`:n!==void 0?`Mistral API error (${n}): ${t.message}`:t.message}return dfi(t)}function ufi(t,e){return t.length<=e?t:`${t.slice(0,e)}... [truncated ${t.length-e} chars]`}function dfi(t){try{let e=JSON.stringify(t);return e===void 0?String(t):e}catch{return String(t)}}async function pfi(t,e,n,r){let i=new URL(t.baseUrl);i.pathname=`${i.pathname.replace(/\/+$/u,"")}/`;let s=new URL("v1/chat/completions",i),o=mfi(t,n,r),a=AbortSignal.timeout(r?.timeoutMs??6e4),c=r?.signal?AbortSignal.any([r.signal,a]):a,u=await(r?.fetch??globalThis.fetch)(s,{method:"POST",headers:o,body:JSON.stringify(hfi(e)),signal:c});if(await r?.onResponse?.({status:u.status,headers:Dm(u.headers)},t),!u.ok){let l=await u.text();throw new jKe(u.status,l,u.statusText)}if(!u.body)throw new Error("Mistral response has no body");return Afi(u.body,c)}function mfi(t,e,n){let r=new Headers({"User-Agent":Bh(),accept:"text/event-stream",authorization:`Bearer ${e}`,"content-type":"application/json"});asn(r,t.headers),asn(r,n?.headers);let i=csn(t.headers,"x-affinity")||csn(n?.headers,"x-affinity");return msn(n)&&!i&&r.set("x-affinity",n.sessionId),r}function asn(t,e){if(e)for(let[n,r]of Object.entries(e))r===null?t.delete(n):t.set(n,r)}function csn(t,e){return!!t&&Object.keys(t).some(n=>n.toLowerCase()===e)}function hfi(t){let e={...t};for(let[r,i]of[["topP","top_p"],["maxTokens","max_tokens"],["randomSeed","random_seed"],["responseFormat","response_format"],["toolChoice","tool_choice"],["presencePenalty","presence_penalty"],["frequencyPenalty","frequency_penalty"],["parallelToolCalls","parallel_tool_calls"],["reasoningEffort","reasoning_effort"],["promptMode","prompt_mode"],["promptCacheKey","prompt_cache_key"],["safePrompt","safe_prompt"]])r4(e,r,i);e.messages=t.messages.map(r=>ffi(r));let n=e.response_format;if(VKe(n)){let r={...n};r4(r,"jsonSchema","json_schema");let i=r.json_schema;if(VKe(i)){let s={...i};r4(s,"schemaDefinition","schema"),r.json_schema=s}e.response_format=r}return e}function ffi(t){let e={...t};return r4(e,"toolCalls","tool_calls"),r4(e,"toolCallId","tool_call_id"),Array.isArray(t.content)&&(e.content=t.content.map(n=>gfi(n))),e}function gfi(t){let e={...t};for(let[n,r]of[["imageUrl","image_url"],["documentUrl","document_url"],["documentName","document_name"],["fileId","file_id"],["referenceIds","reference_ids"],["inputAudio","input_audio"]])r4(e,n,r);return e}function r4(t,e,n){e in t&&(t[n]=t[e],delete t[e])}function VKe(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}async function*Afi(t,e){let n=t.getReader(),r=new TextDecoder,i="",s=()=>{n.cancel().catch(()=>{})};e.addEventListener("abort",s,{once:!0});try{for(;;){if(e.aborted)throw e.reason;let{done:o,value:a}=await n.read();if(e.aborted)throw e.reason;i+=o?r.decode():r.decode(a,{stream:!0});let c=lsn(i);for(;c;){let u=usn(i.slice(0,c.index));if(i=i.slice(c.index+c.length),u===YKe)return;u&&(yield u),c=lsn(i)}if(o)break}if(i.trim()){let o=usn(i);o!==YKe&&o&&(yield o)}}finally{e.removeEventListener("abort",s);try{await n.cancel()}catch{}try{n.releaseLock()}catch{}}}function lsn(t){let e=/\r\n\r\n|\r\n\r|\r\n\n|\r\r\n|\n\r\n|\r\r|\n\r|\n\n/u.exec(t);return e?.index===void 0?void 0:{index:e.index,length:e[0].length}}function usn(t){let e=t.split(/\r\n|\r|\n/u).filter(r=>r.startsWith("data:")).map(r=>r.slice(5).trimStart()).join(` +`).trim();if(!e)return;if(e==="[DONE]")return YKe;let n=JSON.parse(e);if(!VKe(n)||!Array.isArray(n.choices))throw new Error("Invalid Mistral streaming event");return{data:n}}function yfi(t,e,n,r){let i={model:t.id,stream:!0,messages:xfi(n,t.input.includes("image"))},s=Nm(e.messages);return s.length>0&&(i.tools=_fi(s)),r?.temperature!==void 0&&(i.temperature=r.temperature),r?.maxTokens!==void 0&&(i.maxTokens=r.maxTokens),r?.toolChoice&&(i.toolChoice=wfi(r.toolChoice)),r?.promptMode&&(i.promptMode=r.promptMode),r?.reasoningEffort&&(i.reasoningEffort=r.reasoningEffort),msn(r)&&(i.promptCacheKey=r.sessionId),i}function msn(t){return t?.cacheRetention!=="none"&&!!t?.sessionId}function Efi(t,e){let n=t,r=n.promptTokensDetails?.cachedTokens??n.prompt_tokens_details?.cached_tokens??n.promptTokenDetails?.cachedTokens??n.prompt_token_details?.cached_tokens??n.numCachedTokens??n.num_cached_tokens??0,i=typeof r=="number"&&Number.isFinite(r)?r:0;return Math.min(e,Math.max(0,i))}async function bfi(t,e,n,r){let i=null,s=e.content,o=()=>s.length-1,a=new Map,c=u=>{if(u){if(u.type==="text"){n.push({type:"text_end",contentIndex:o(),content:u.text,partial:e});return}u.type==="thinking"&&n.push({type:"thinking_end",contentIndex:o(),content:u.thinking,partial:e})}};for await(let u of r){let l=u.data;if(e.responseId||=l.id,l.usage){let f=l.usage.prompt_tokens||0,g=Efi(l.usage,f);e.usage.input=Math.max(0,f-g),e.usage.output=l.usage.completion_tokens||0,e.usage.cacheRead=g,e.usage.cacheWrite=0,e.usage.totalTokens=l.usage.total_tokens||e.usage.input+e.usage.output+e.usage.cacheRead+e.usage.cacheWrite,$p(t,e.usage)}let d=l.choices[0];if(!d)continue;if(d.finish_reason){e.rawStopReason=d.finish_reason;let f=Tfi(d.finish_reason);e.stopReason=f.stopReason,f.errorMessage&&(e.errorMessage=f.errorMessage)}let m=d.delta;if(m.content!==null&&m.content!==void 0){let f=typeof m.content=="string"?[m.content]:m.content;for(let g of f){if(typeof g=="string"){let A=ri(g);(!i||i.type!=="text")&&(c(i),i={type:"text",text:""},e.content.push(i),n.push({type:"text_start",contentIndex:o(),partial:e})),i.text+=A,n.push({type:"text_delta",contentIndex:o(),delta:A,partial:e});continue}if(g.type==="thinking"){let A=(g.thinking??[]).map(E=>E.text??"").filter(E=>E.length>0).join(""),y=ri(A);if(!y)continue;(!i||i.type!=="thinking")&&(c(i),i={type:"thinking",thinking:""},e.content.push(i),n.push({type:"thinking_start",contentIndex:o(),partial:e})),i.thinking+=y,n.push({type:"thinking_delta",contentIndex:o(),delta:y,partial:e});continue}if(g.type==="text"){let A=ri(g.text??"");(!i||i.type!=="text")&&(c(i),i={type:"text",text:""},e.content.push(i),n.push({type:"text_start",contentIndex:o(),partial:e})),i.text+=A,n.push({type:"text_delta",contentIndex:o(),delta:A,partial:e})}}}let h=m.tool_calls||[];for(let f of h){i&&(c(i),i=null);let g=f.id&&f.id!=="null"?f.id:psn(`toolcall:${f.index??0}`,0),A=f.index??g,y=a.get(A),E;if(y!==void 0){let S=e.content[y];S?.type==="toolCall"&&(E=S)}E||(E={type:"toolCall",id:g,name:f.function.name,arguments:{},partialArgs:""},e.content.push(E),a.set(A,e.content.length-1),n.push({type:"toolcall_start",contentIndex:e.content.length-1,partial:e}));let _=typeof f.function.arguments=="string"?f.function.arguments:JSON.stringify(f.function.arguments||{});E.partialArgs=(E.partialArgs||"")+_,E.arguments=ec(E.partialArgs),n.push({type:"toolcall_delta",contentIndex:a.get(A),delta:_,partial:e})}}c(i);for(let u of a.values()){let l=e.content[u];if(l.type!=="toolCall")continue;let d=l;d.arguments=ec(d.partialArgs),delete d.partialArgs,n.push({type:"toolcall_end",contentIndex:u,toolCall:d,partial:e})}}function _fi(t){return t.map(e=>{let n=wy(e,!0);return{type:"function",function:{name:e.name,description:e.description,parameters:zKe(v0(e,n)),strict:n??!1}}})}function zKe(t){if(Array.isArray(t))return t.map(e=>zKe(e));if(t&&typeof t=="object"){let e={};for(let[n,r]of Object.entries(t))e[n]=zKe(r);return e}return t}function xfi(t,e){let n=[];for(let[r,i]of t.entries()){if(i.role==="system"){let u=r===0?kc(i):XC(i);u.length>0&&n.push({role:"system",content:ri(u)});continue}if(i.role==="user"){if(typeof i.content=="string"){n.push({role:"user",content:ri(i.content)});continue}let u=i.content.some(d=>d.type==="image"),l=i.content.filter(d=>d.type==="text"||e).map(d=>d.type==="text"?{type:"text",text:ri(d.text)}:{type:"image_url",imageUrl:`data:${d.mimeType};base64,${d.data}`});if(l.length>0){n.push({role:"user",content:l});continue}u&&!e&&n.push({role:"user",content:"(image omitted: model does not support images)"});continue}if(i.role==="assistant"){let u=[],l=[];for(let m of i.content){if(m.type==="text"){m.text.trim().length>0&&u.push({type:"text",text:ri(m.text)});continue}if(m.type==="thinking"){m.thinking.trim().length>0&&u.push({type:"thinking",thinking:[{type:"text",text:ri(m.thinking)}]});continue}l.push({id:m.id,type:"function",function:{name:m.name,arguments:JSON.stringify(m.arguments||{})},index:0})}let d={role:"assistant",prefix:!1};u.length>0&&(d.content=u),l.length>0&&(d.toolCalls=l),(u.length>0||l.length>0)&&n.push(d);continue}let s=[],o=i.content.filter(u=>u.type==="text").map(u=>u.type==="text"?ri(u.text):"").join(` +`),a=i.content.some(u=>u.type==="image"),c=Sfi(o,a,e,i.isError);s.push({type:"text",text:c});for(let u of i.content)e&&u.type==="image"&&s.push({type:"image_url",imageUrl:`data:${u.mimeType};base64,${u.data}`});n.push({role:"tool",toolCallId:i.toolCallId,name:i.toolName,content:s})}return n}function Sfi(t,e,n,r){let i=t.trim(),s=r?"[tool error] ":"";return i.length>0?`${s}${i}${e&&!n?` +[tool image omitted: model does not support images]`:""}`:e?n?r?"[tool error] (see attached image)":"(see attached image)":r?"[tool error] (image omitted: model does not support images)":"(image omitted: model does not support images)":r?"[tool error] (no tool output)":"(no tool output)"}function hsn(t){return t.id==="mistral-small-2603"||t.id==="mistral-small-latest"||t.id.startsWith("mistral-medium-")||t.id==="zai-glm-5-2"}function Cfi(t){return t.reasoning&&!hsn(t)}function Ifi(t,e){return t.thinkingLevelMap?.[e]??"high"}function wfi(t){if(t)return t==="auto"||t==="none"||t==="any"||t==="required"?t:{type:"function",function:{name:t.function.name}}}function Tfi(t){if(t===null)return{stopReason:"stop"};switch(t){case"stop":return{stopReason:"stop"};case"length":case"model_length":return{stopReason:"length"};case"tool_calls":return{stopReason:"toolUse"};case"error":return{stopReason:"error",errorMessage:"Provider stopped with: error"};default:return{stopReason:"error",errorMessage:`Provider stopped with: ${t}`}}}var osn,sfi,dsn,ofi,jKe,YKe,gsn=v(()=>{p();ni();eA();qEe();T0();tv();dv();tI();Cy();Nf();nI();rI();jO();osn=9,sfi=4e3,dsn=(t,e,n)=>{let r=new Rc,i=vh(e,t.compat?.supportsMidConvoSystemMessages);return(async()=>{let s=afi(t);try{let o=n?.apiKey;if(!o)throw new Error(`No API key for provider: ${t.provider}`);let a=cfi(),c=k0(i.messages,t,m=>a(m)),u=yfi(t,i,c,n),l=await n?.onPayload?.(u,t);l!==void 0&&(u=l);let d=await pfi(t,u,o,n);if(r.push({type:"start",partial:s}),await bfi(t,s,r,d),n?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="pending")throw new Error("Mistral stream ended without a finish reason");if(s.stopReason==="aborted"||s.stopReason==="error")throw new Error(s.errorMessage||"An unknown error occurred");r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(o){for(let a of s.content)delete a.partialArgs;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=lfi(o),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},ofi=(t,e,n)=>{let r=n?.apiKey;if(!r)throw new Error(`No API key for provider: ${t.provider}`);let i={...Wp(t,e,n,r),toolChoice:n?.toolChoice},s=n?.reasoning?Wl(t,n.reasoning):void 0,o=s==="off"?void 0:s,a=t.reasoning&&o!==void 0;return dsn(t,e,{...i,promptMode:a&&Cfi(t)?"reasoning":void 0,reasoningEffort:a&&hsn(t)?Ifi(t,o):void 0})};jKe=class extends Error{statusCode;body;constructor(e,n,r){super(r||`Request failed with status ${e}`),this.name="MistralHttpError",this.statusCode=e,this.body=n}};YKe=Symbol("mistral-stream-done")});var x2,BZ=v(()=>{p();Sy();x2=()=>ed(()=>Promise.resolve().then(()=>(gsn(),fsn)))});function JKe(t){return KKe.add(t),()=>{KKe.delete(t)}}function XKe(t){let e=[];for(let n of KKe)try{n(t)}catch(r){e.push(r)}if(e.length>0)throw new AggregateError(e,"Failed to cleanup session resources")}var KKe,ZKe=v(()=>{p();KKe=new Set});function Asn(t){let e=t.filter(s=>s!==void 0);if(e.length===0)return{cleanup:()=>{}};if(e.length===1)return{signal:e[0],cleanup:()=>{}};let n=new AbortController,r=[],i=s=>{n.signal.aborted||n.abort(s.reason)};for(let s of e){if(s.aborted){i(s);break}let o=()=>i(s);s.addEventListener("abort",o,{once:!0}),r.push({signal:s,listener:o})}return{signal:n.signal,cleanup:()=>{for(let{signal:s,listener:o}of r)s.removeEventListener("abort",o)}}}var ysn=v(()=>{p()});function Oc(t){let e=t??Date.now();if(!Number.isInteger(e)||e<0||e>0xffffffffffff)throw new RangeError(`UUIDv7 timestamp must be an integer between 0 and ${0xffffffffffff}`);let n=t===void 0?Math.max(e,Esn):t;t===void 0&&(Esn=n);let r=new Uint8Array(16);if(globalThis.crypto.getRandomValues(r),RI===void 0)RI=BigInt(r[1])<<32n|BigInt(r[2])<<24n|BigInt(r[3])<<16n|BigInt(r[4])<<8n|BigInt(r[5]);else{if(RI===vfi)throw new RangeError("UUIDv7 generator sequence exhausted");RI++}let i=BigInt(n);for(let o=5;o>=0;o--)r[o]=Number(i>>BigInt((5-o)*8))&255;r[6]=112|Number(RI>>37n&0x0fn),r[7]=Number(RI>>29n&0xffn),r[8]=128|Number(RI>>23n&0x3fn),r[9]=Number(RI>>15n&0xffn),r[10]=Number(RI>>7n&0xffn),r[11]=Number((RI&0x7fn)<<1n)|r[11]&1;let s=Array.from(r,o=>o.toString(16).padStart(2,"0"));return`${s.slice(0,4).join("")}-${s.slice(4,6).join("")}-${s.slice(6,8).join("")}-${s.slice(8,10).join("")}-${s.slice(10).join("")}`}var vfi,Esn,RI,kN=v(()=>{p();vfi=(1n<<41n)-1n,Esn=-1});var Fsn={};br(Fsn,{closeOpenAICodexWebSocketSessions:()=>Dsn,getOpenAICodexWebSocketDebugStats:()=>sgi,resetOpenAICodexWebSocketDebugStats:()=>ogi,stream:()=>vsn,streamSimple:()=>qfi});function _sn(t){if(t.stopReason==="pending")throw new Error("Codex stream ended without a stop reason");if(t.stopReason==="error"||t.stopReason==="aborted")throw new Error(t.errorMessage||"An unknown error occurred")}function Qfi(t){return/GoUsageLimitError|FreeUsageLimitError|Monthly usage limit reached|available balance|insufficient_quota|out of budget|quota exceeded|billing/i.test(t)}function Ufi(t,e){return t===429&&Qfi(e)?!1:t===429||t===500||t===502||t===503||t===504?!0:/rate.?limit|overloaded|service.?unavailable|upstream.?connect|connection.?refused/i.test(e)}function Gfi(t){let e=t.get("retry-after-ms");if(e!==null){let s=Number(e);if(Number.isFinite(s))return Math.max(0,s)}let n=t.get("retry-after");if(!n)return;let r=Number(n);if(Number.isFinite(r))return Math.max(0,r*1e3);let i=Date.parse(n);if(!Number.isNaN(i))return Math.max(0,i-Date.now())}function $fi(t,e){let n=e?.maxRetryDelayMs??Nfi;if(n>0&&t>n)throw new f_e(`Server requested ${Math.ceil(t/1e3)}s retry delay (max: ${Math.ceil(n/1e3)}s)`);return t}function xsn(t,e){return new Promise((n,r)=>{if(e?.aborted){r(new Error("Request was aborted"));return}let i=setTimeout(n,t);e?.addEventListener("abort",()=>{clearTimeout(i),r(new Error("Request was aborted"))})})}function Ssn(t){if(t!==void 0){if(!Number.isFinite(t)||t<0)throw new Error(`Invalid timeoutMs: ${String(t)}`);return Math.floor(t)}}function Wfi(){return typeof process>"u"||!(process.versions?.node||process.versions?.bun)?null:process.getBuiltinModule?.("node:zlib")??null}function Hfi(t){let e=Wfi();if(!e||typeof e.zstdCompressSync!="function")return null;try{let n=e.zstdCompressSync(t,{params:{[e.constants.ZSTD_c_compressionLevel]:Pfi}});return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}catch{return null}}function jfi(t,e,n,r,i=R0(Bf(e.messages),t.compat?.supportsOpenAIGrammarTools??!1)){let s=t.compat?.supportsStrictMode??!0,o=t.compat?.supportsOpenAIGrammarTools??!1,a=t.compat?.supportsAdditionalTools??!1,c=t.compat?.supportsToolSearch??!1,u=w0(e.messages,a||c),l=ZL(t,e,Tsn,{includeSystemPrompt:!1,grammarToolInputProperties:i,supportsMidConvoSystemMessages:t.compat?.supportsMidConvoSystemMessages??!1,supportsAdditionalTools:a,supportsToolSearch:c,toolOptions:{strict:null,supportsStrictMode:s,supportsOpenAIGrammarTools:o}}),d=Iy(e.messages),m=d?kc(d):"",h={model:t.id,store:!1,stream:!0,instructions:m||"You are a helpful assistant.",input:l,text:{verbosity:n?.textVerbosity||"low"},include:["reasoning.encrypted_content"],prompt_cache_key:r,tool_choice:n?.toolChoice??"auto",parallel_tool_calls:!0};if(n?.temperature!==void 0&&(h.temperature=n.temperature),n?.serviceTier!==void 0&&(h.service_tier=n.serviceTier),u.requestTools.length>0&&(h.tools=oN(u.requestTools,{strict:null,supportsStrictMode:s,supportsOpenAIGrammarTools:o})),n?.reasoningEffort!==void 0){let f=n.reasoningEffort==="none"?t.thinkingLevelMap?.off===void 0?"none":t.thinkingLevelMap.off:t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort;f!==null&&(h.reasoning={effort:f,summary:n.reasoningSummary??"auto"})}else t.reasoning&&t.thinkingLevelMap?.off!==null&&(h.reasoning={effort:t.thinkingLevelMap?.off??"none"});return h}function Vfi(t,e){switch(e){case"flex":return .5;case"priority":return t.id==="gpt-5.5"?2.5:2;default:return 1}}function Rsn(t,e,n){let r=Vfi(n,e);r!==1&&(t.cost.input*=r,t.cost.output*=r,t.cost.cacheRead*=r,t.cost.cacheWrite*=r,t.cost.total=t.cost.input+t.cost.output+t.cost.cacheRead+t.cost.cacheWrite)}function ksn(t,e){return t==="default"&&(e==="flex"||e==="priority")?e:t??e}function Bsn(t){let n=(t&&t.trim().length>0?t:Rfi).replace(/\/+$/,"");return n.endsWith("/codex/responses")?n:n.endsWith("/codex")?`${n}/responses`:`${n}/codex/responses`}function Yfi(t){let e=new URL(Bsn(t));return e.protocol==="https:"&&(e.protocol="wss:"),e.protocol==="http:"&&(e.protocol="ws:"),e.toString()}async function zfi(t,e,n,r,i,s){await e2(Nsn(tgi(t,s?.signal),e),e,n,r,{serviceTier:s?.serviceTier,grammarToolInputProperties:i,resolveServiceTier:ksn,applyServiceTierPricing:(o,a)=>Rsn(o,a,r)})}function Kfi(t){return t instanceof S2||t instanceof NZ}function Jfi(t){return t instanceof S2&&t.code===Ofi}function Xfi(t){return t instanceof S2&&t.code===Lfi}function Zfi(t){let e=t.error&&typeof t.error=="object"?t.error:void 0;return{code:typeof t.code=="string"?t.code:typeof e?.code=="string"?e.code:void 0,message:typeof t.message=="string"?t.message:typeof e?.message=="string"?e.message:void 0}}async function*Nsn(t,e){for await(let n of t){let r=typeof n.type=="string"?n.type:void 0;if(r){if(r==="error"){let{code:i,message:s}=Zfi(n);throw new S2(`Codex error: ${s||i||JSON.stringify(n)}`,{code:i,payload:n})}if(r==="response.failed"){let i=n.response,s=i?.error?.code,o=i?.error?.message;throw new S2(o||"Codex response failed",{code:s,payload:n})}if(r==="response.done"||r==="response.completed"||r==="response.incomplete"){let i=n.response;typeof i?.end_turn=="boolean"&&(e.endTurn=i.end_turn);let s=i&&{...i,status:egi(i.status)};yield{...n,type:"response.completed",response:s};return}yield n}}}function egi(t){if(typeof t=="string")return Ffi.has(t)?t:void 0}async function*tgi(t,e){if(!t.body)return;let n=t.body.getReader(),r=new TextDecoder,i="",s=()=>{n.cancel().catch(()=>{})};e?.addEventListener("abort",s,{once:!0});try{for(;;){if(e?.aborted)throw new Error("Request was aborted");let{done:o,value:a}=await n.read();if(e?.aborted)throw new Error("Request was aborted");i+=o?r.decode():r.decode(a,{stream:!0}),o&&i.trim()&&(i+=` + +`);let c=i.indexOf(` + +`);for(;c!==-1;){let u=i.slice(0,c);i=i.slice(c+2);let l=u.split(` `).filter(d=>d.startsWith("data:")).map(d=>d.slice(5).trim());if(l.length>0){let d=l.join(` -`).trim();if(d&&d!=="[DONE]")try{yield JSON.parse(d)}catch(h){throw new lz(`Invalid Codex SSE JSON: ${kR(h)}`,{cause:h,payload:d})}}c=s.indexOf(` +`).trim();if(d&&d!=="[DONE]")try{yield JSON.parse(d)}catch(m){throw new NZ(`Invalid Codex SSE JSON: ${hB(m)}`,{cause:m,payload:d})}}c=i.indexOf(` -`)}if(o)break}}finally{e?.removeEventListener("abort",i);try{await n.cancel()}catch{}try{n.releaseLock()}catch{}}}function oVe(t){let e=uz.get(t);return e||(e={requests:0,connectionsCreated:0,connectionsReused:0,cachedContextRequests:0,storeTrueRequests:0,fullContextRequests:0,deltaRequests:0,lastInputItems:0,websocketFailures:0,sseFallbacks:0},uz.set(t,e)),e}function sGr(t){let e=uz.get(t);return e?{...e}:void 0}function iGr(t){if(t){uz.delete(t),wge.delete(t);return}uz.clear(),wge.clear()}function Y5t(t){let e=n=>{n.idleTimer&&clearTimeout(n.idleTimer),kC(n.socket,1e3,"debug_close")};if(t){for(let n of vm.get(t)?.values()??[])e(n);vm.delete(t);return}for(let n of vm.values())for(let r of n.values())e(r);vm.clear()}function K5t(t){return t?wge.has(t):!1}function Q5t(t){if(!t)return;let e=oVe(t);e.sseFallbacks++,e.websocketFallbackActive=K5t(t)}function oGr(t,e){if(!t)return;wge.add(t);let n=oVe(t);n.websocketFailures++,n.lastWebSocketError=kR(e),n.websocketFallbackActive=!0}async function aGr(t){if(!t&&rVe)return rVe;if(typeof process<"u"&&process.versions?.bun){let n=class extends WebSocket{constructor(r,s){let i={};Array.isArray(s)||typeof s=="string"?i={protocols:s}:i={...s};let o=yde(r.toString().replace(/^wss:/,"https:").replace(/^ws:/,"http:"),t);super(r,{...i,...o?{proxy:o.toString()}:{}})}};return t||(rVe=n),n}let e=globalThis.WebSocket;return typeof e!="function"?null:e}function cGr(t){let e=t.readyState;return typeof e=="number"?e:void 0}function Ige(t){let e=cGr(t);return e===void 0||e===1}function lGr(t){return Date.now()-t.createdAt>=rGr}function kC(t,e=1e3,n="done"){try{t.close(e,n)}catch{}}function U5t(t,e,n){n.idleTimer&&clearTimeout(n.idleTimer),n.idleTimer=setTimeout(()=>{if(n.busy)return;kC(n.socket,1e3,"idle_timeout");let r=vm.get(t);r?.get(e)===n&&r.delete(e),r?.size===0&&vm.delete(t)},nGr)}async function sVe(t,e,n,r=D$r,s){let i=await aGr(s);if(!i)throw new Error("WebSocket transport is not available in this runtime");let o=Pp(e);return delete o["OpenAI-Beta"],new Promise((a,c)=>{let u=!1,l,d;try{d=new i(t,{headers:o})}catch(b){c(b instanceof Error?b:new Error(String(b)));return}let h=()=>{l&&(clearTimeout(l),l=void 0),d.removeEventListener("open",f),d.removeEventListener("error",g),d.removeEventListener("close",A),n?.removeEventListener("abort",y)},m=(b,S)=>{u||(u=!0,h(),S&&kC(d,1e3,S),c(b))},f=()=>{u||(u=!0,h(),a(d))},g=b=>{m(z5t(b))},A=b=>{m(J5t(b))},y=()=>{m(new Error("Request was aborted"),"aborted")};d.addEventListener("open",f),d.addEventListener("error",g),d.addEventListener("close",A),n?.addEventListener("abort",y),r>0&&(l=setTimeout(()=>{m(new Error(`WebSocket connect timeout after ${r}ms`),"connect_timeout")},r)),n?.aborted&&y()})}async function uGr(t,e,n,r,s,i,o){if(!n){let d=await sVe(t,e,s,i,o);return{socket:d,reused:!1,release:()=>kC(d)}}let a=vm.get(n),c=a?.get(r);if(c){if(c.idleTimer&&(clearTimeout(c.idleTimer),c.idleTimer=void 0),!c.busy&&lGr(c))kC(c.socket,1e3,"connection_age_limit"),a?.delete(r),a?.size===0&&vm.delete(n);else if(!c.busy&&Ige(c.socket))return c.busy=!0,{socket:c.socket,entry:c,reused:!0,release:({keep:d}={})=>{if(!d||!Ige(c.socket)){kC(c.socket);let h=vm.get(n);h?.get(r)===c&&h.delete(r),h?.size===0&&vm.delete(n);return}c.busy=!1,U5t(n,r,c)}};if(c.busy){let d=await sVe(t,e,s,i,o);return{socket:d,reused:!1,release:()=>{kC(d)}}}Ige(c.socket)||(kC(c.socket),a?.delete(r),a?.size===0&&vm.delete(n))}let u=await sVe(t,e,s,i,o),l={socket:u,busy:!0,createdAt:Date.now()};return a=vm.get(n),a||(a=new Map,vm.set(n,a)),a.set(r,l),{socket:u,entry:l,reused:!1,release:({keep:d}={})=>{if(!d||!Ige(l.socket)){kC(l.socket),l.idleTimer&&clearTimeout(l.idleTimer);let h=vm.get(n);h?.get(r)===l&&h.delete(r),h?.size===0&&vm.delete(n);return}l.busy=!1,U5t(n,r,l)}}}function z5t(t){if(t&&typeof t=="object"){let e="message"in t?t.message:void 0;if(typeof e=="string"&&e.length>0)return new Error(e);let n="error"in t?t.error:void 0;if(n instanceof Error&&n.message.length>0)return n;if(n&&typeof n=="object"&&"message"in n){let r=n.message;if(typeof r=="string"&&r.length>0)return new Error(r)}}return new Error("WebSocket error")}function J5t(t){if(t&&typeof t=="object"){let e="code"in t?t.code:void 0,n="reason"in t?t.reason:void 0,r="wasClean"in t?t.wasClean:void 0,s=typeof e=="number"?` ${e}`:"",i=typeof n=="string"&&n.length>0?` ${n}`:"";return!i&&e===P$r&&(i=" message too big"),new iVe(`WebSocket closed${s}${i}`.trim(),{code:typeof e=="number"?e:void 0,reason:typeof n=="string"&&n.length>0?n:void 0,wasClean:typeof r=="boolean"?r:void 0})}return new Error("WebSocket closed")}async function dGr(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return new TextDecoder().decode(new Uint8Array(t));if(ArrayBuffer.isView(t)){let e=t;return new TextDecoder().decode(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}if(t&&typeof t=="object"&&"arrayBuffer"in t){let n=await t.arrayBuffer();return new TextDecoder().decode(new Uint8Array(n))}return null}async function*pGr(t,e,n){let r=[],s=null,i=!1,o=null,a=!1,c=()=>{if(!s)return;let m=s;s=null,m()},u=m=>{(async()=>{let f=null;try{if(!m||typeof m!="object"||!("data"in m)||(f=await dGr(m.data),!f))return;let g=JSON.parse(f),A=typeof g.type=="string"?g.type:"";(A==="response.completed"||A==="response.done"||A==="response.incomplete")&&(a=!0,i=!0),r.push(g),c()}catch(g){o=new lz(`Invalid Codex WebSocket JSON: ${kR(g)}`,{cause:g,payload:f}),i=!0,c()}})()},l=m=>{o=z5t(m),i=!0,c()},d=m=>{if(a){i=!0,c();return}o||(o=J5t(m)),i=!0,c()},h=()=>{o=new Error("Request was aborted"),i=!0,c()};t.addEventListener("message",u),t.addEventListener("error",l),t.addEventListener("close",d),e?.addEventListener("abort",h);try{for(;;){if(e?.aborted)throw new Error("Request was aborted");if(r.length>0){yield r.shift();continue}if(i)break;let m;await new Promise((f,g)=>{s=f,n!==void 0&&n>0&&(m=setTimeout(()=>{let A=new Error(`WebSocket idle timeout after ${n}ms`);o=A,i=!0,s=null,kC(t,1e3,"idle_timeout"),g(A)},n))}).finally(()=>{m&&clearTimeout(m)})}if(o)throw o;if(!a)throw new Error("WebSocket stream closed before response.completed")}finally{t.removeEventListener("message",u),t.removeEventListener("error",l),t.removeEventListener("close",d),e?.removeEventListener("abort",h)}}function $5t(t){let{input:e,previous_response_id:n,...r}=t;return r}function hGr(t,e){return JSON.stringify(t??[])===JSON.stringify(e??[])}function mGr(t,e){return JSON.stringify($5t(t))===JSON.stringify($5t(e))}function fGr(t,e){if(!mGr(t,e.lastRequestBody))return;let n=t.input??[],r=[...e.lastRequestBody.input??[],...e.lastResponseItems];if(n.lengthq5t(x,w,i)}),h?.signal?.aborted)y=!1;else if(b&&f&&r.responseId){let x=JP(i,{messages:[r]},G5t,{includeSystemPrompt:!1,grammarToolInputProperties:d}).filter(w=>w.type!=="function_call_output"&&w.type!=="custom_tool_call_output");f.continuation={lastRequestBody:S,lastResponseId:r.responseId,lastResponseItems:x}}}catch(x){throw f&&(f.continuation=void 0),y=!1,x}finally{A({keep:y})}}async function EGr(t){let e=await t.text(),n=e||t.statusText||"Request failed",r;try{let i=JSON.parse(e)?.error;if(i){let o=i.code||i.type||"";if(/usage_limit_reached|usage_not_included|rate_limit_exceeded/i.test(o)||t.status===429){let a=i.plan_type?` (${i.plan_type.toLowerCase()} plan)`:"",c=i.resets_at?Math.max(0,Math.round((i.resets_at*1e3-Date.now())/6e4)):void 0,u=c!==void 0?` Try again in ~${c} min.`:"";r=`You have hit your ChatGPT usage limit${a}.${u}`.trim()}n=i.message||r||n}}catch{}return{message:n,friendlyMessage:r}}function bGr(t){try{let e=t.split(".");if(e.length!==3)throw new Error("Invalid token");let r=JSON.parse(atob(e[1]))?.[R$r]?.chatgpt_account_id;if(!r)throw new Error("No account ID in token");return r}catch{throw new Error("Failed to extract accountId from token")}}function X5t(t,e,n,r){let s=new Headers(t);for(let[i,o]of Object.entries(e||{}))o===null?s.delete(i):s.set(i,o);return s.set("Authorization",`Bearer ${r}`),s.set("chatgpt-account-id",n),s.set("originator","pi"),s.set("User-Agent",xh()),s}function _Gr(t,e,n,r,s){let i=X5t(t,e,n,r);return i.set("OpenAI-Beta","responses=experimental"),i.set("accept","text/event-stream"),i.set("content-type","application/json"),s&&(i.set("session-id",s),i.set("x-client-request-id",s)),i}function SGr(t,e,n,r,s){let i=X5t(t,e,n,r);return i.delete("accept"),i.delete("content-type"),i.delete("OpenAI-Beta"),i.delete("openai-beta"),i.set("OpenAI-Beta",tGr),i.set("x-client-request-id",s),i.set("session-id",s),i}var v$r,R$r,k$r,O5t,N$r,D$r,B$r,G5t,P$r,O$r,M$r,L$r,xge,W5t,q$r,_O,lz,tGr,nGr,rGr,vm,uz,wge,rVe,iVe,e4t=V(()=>{p();is();nVe();B5t();she();qB();Bx();Pf();oE();iUe();qx();$k();rC();bK();Khe();sC();v$r="https://chatgpt.com/backend-api",R$r="https://api.openai.com/auth",k$r=0,O5t=1e3,N$r=6e4,D$r=15e3,B$r=3,G5t=new Set(["openai","openai-codex","opencode"]),P$r=1009,O$r="websocket_connection_limit_reached",M$r="previous_response_not_found",L$r=new Set(["completed","incomplete","failed","cancelled","queued","in_progress"]);xge=class extends Error{};W5t=(t,e,n)=>{let r=new Ka;return(async()=>{let s={role:"assistant",content:[],api:"openai-codex-responses",provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let i=n?.apiKey;if(!i)throw new Error(`No API key for provider: ${t.provider}`);let o=bGr(i),a=cE(e.tools,t.compat?.supportsOpenAIGrammarTools??!1),c=n?.cacheRetention==="none"?void 0:n?.sessionId,u=Ek(c),l=H$r(t,e,n,u,a),d=await n?.onPayload?.(l,t);d!==void 0&&(l=d);let h=u||tl(),m=_Gr(t.headers,n?.headers,o,i,u),f=SGr(t.headers,n?.headers,o,i,h),g=JSON.stringify(l),A=F5t(n?.timeoutMs),y=F5t(n?.websocketConnectTimeoutMs),b=n?.transport||"auto",S=!1,C=b!=="sse"&&K5t(c);if(C&&Q5t(c),b!=="sse"&&!C){let P=!1,G=!1,$=!1;for(;;){P=!1;try{if(await yGr(j$r(t.baseUrl),l,f,s,r,t,()=>{P=!0,S||(S=!0,r.push({type:"start",partial:s}))},A,y,c,o,a,n),n?.signal?.aborted)throw new Error("Request was aborted");M5t(s),r.push({type:"done",reason:s.stopReason,message:s}),r.end();return}catch(Q){let H=n?.signal?.aborted,oe=!P&&z$r(Q),re=J$r(Q);if(!H&&re&&!$){$=!0;continue}if(!H&&oe&&!G){G=!0;continue}if(H||K$r(Q)&&!oe||(ZS(s,$8("provider_transport_failure",Q,{configuredTransport:b,fallbackTransport:P?void 0:"sse",eventsEmitted:P,phase:P?"after_message_stream_start":"before_message_stream_start",requestBytes:new TextEncoder().encode(g).byteLength})),oGr(c,Q),P))throw Q;Q5t(c);break}}}let I=W$r(g);I&&m.set("content-encoding","zstd");let x=I??g,w,R,N=n?.maxRetries??k$r;for(let P=0;P<=N;P++){if(n?.signal?.aborted)throw new Error("Request was aborted");try{let G=A!==void 0&&A>0?AbortSignal.timeout(A):void 0,$=D5t([n?.signal,G]);try{w=await(n?.fetch??globalThis.fetch)(V5t(t.baseUrl),{method:"POST",headers:m,body:x,signal:$.signal})}catch(re){throw G?.aborted&&!n?.signal?.aborted?new Error(`Codex SSE response headers timed out after ${A}ms`):re}finally{$.cleanup()}if(await n?.onResponse?.({status:w.status,headers:Pp(w.headers)},t),w.ok)break;let Q=await w.text();if(P{let r=n?.apiKey;if(!r)throw new Error(`No API key for provider: ${t.provider}`);let s={...Yd(t,e,n,r),toolChoice:n?.toolChoice},i=n?.reasoning?uu(t,n.reasoning):void 0;return W5t(t,e,{...s,reasoningEffort:i==="off"?void 0:i})};_O=class extends Error{code;payload;constructor(e,n){super(e),this.name="CodexApiError",this.code=n?.code,this.payload=n?.payload,this.cause=n?.cause}},lz=class extends Error{payload;constructor(e,n){super(e),this.name="CodexProtocolError",this.payload=n?.payload,this.cause=n?.cause}};tGr="responses_websockets=2026-02-06",nGr=300*1e3,rGr=3300*1e3,vm=new Map,uz=new Map,wge=new Set;eVe(Y5t);rVe=null;iVe=class extends Error{code;reason;wasClean;constructor(e,n){super(e),this.name="WebSocketCloseError",this.code=n?.code,this.reason=n?.reason,this.wasClean=n?.wasClean}}});var p4t={};Ir(p4t,{convertMessages:()=>u4t,stream:()=>c4t,streamSimple:()=>MGr});function t4t(t,e){if(!t)return!1;let n=e.toLowerCase();for(let[r,s]of Object.entries(t))if(r.toLowerCase()===n&&s!==null&&s.trim().length>0)return!0;return!1}function o4t(t,e,n){if(e)return e;if(t4t(n,"authorization")||t4t(n,"cf-aig-authorization"))return"unused";throw new Error(`No API key for provider: ${t}`)}function CGr(t){for(let e of t)if(e.role==="toolResult"||e.role==="assistant"&&e.content.some(n=>n.type==="toolCall"))return!0;return!1}function IGr(t){let e=new Set;for(let n of t)if(n.role==="toolResult")for(let r of n.addedToolNames??[])e.add(r);return e}function xGr(t,e){if(!t)return[];let n=new Map(t.map(r=>[r.name,r]));return Array.from(e).map(r=>n.get(r)).filter(r=>r!==void 0)}function n4t(t){return t.type==="text"}function wGr(t){return t.type==="thinking"}function TGr(t){return t.type==="toolCall"}function vGr(t){return t.type==="image"}function RGr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function kGr(t){return(t.id===void 0||t.id===null||typeof t.id=="string")&&(t.format===void 0||typeof t.format=="string")&&(t.index===void 0||typeof t.index=="number")}function aVe(t){if(!RGr(t)||!kGr(t))return!1;switch(t.type){case"reasoning.summary":return typeof t.summary=="string";case"reasoning.encrypted":return typeof t.data=="string";case"reasoning.text":return typeof t.text=="string"&&(t.signature===void 0||t.signature===null||typeof t.signature=="string");default:return!1}}function NGr(t){if(t)try{let e=JSON.parse(t);return Array.isArray(e)&&e.length>0&&e.every(aVe)?e:void 0}catch{return}}function DGr(t){if(t)try{let e=JSON.parse(t);return aVe(e)&&e.type==="reasoning.encrypted"&&typeof e.id=="string"&&e.id.length>0&&e.data.length>0?e:void 0}catch{return}}function r4t(t,e){t.id??=e.id,t.format||=e.format,t.index??=e.index}function BGr(t,e){let n=t[t.length-1];if(e.type==="reasoning.text"&&n?.type==="reasoning.text"){n.text+=e.text,n.signature||=e.signature,r4t(n,e);return}if(e.type==="reasoning.summary"&&n?.type==="reasoning.summary"){n.summary+=e.summary,r4t(n,e);return}t.push({...e})}function OGr(t){return PGr.includes(t)}function a4t(t,e){return t||(Ps("PI_CACHE_RETENTION",e)==="long"?"long":"short")}function LGr(t,e,n,r,s,i,o=cVe(t)){let a={"User-Agent":xh(),...t.headers};if(t.provider==="github-copilot"){let c=wG(e.messages),u=TG({messages:e.messages,hasImages:c});Object.assign(a,u)}return i&&o.sendSessionAffinityHeaders&&(o.sessionAffinityFormat==="openrouter"?a["x-session-id"]=i:(o.sessionAffinityFormat==="openai"&&(a.session_id=i),a["x-client-request-id"]=i,a["x-session-affinity"]=i)),r&&Object.assign(a,r),new as({apiKey:n,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:s,defaultHeaders:a})}function FGr(t,e,n,r=cVe(t),s=a4t(n?.cacheRetention,n?.env),i=cE(e.tools,r.supportsOpenAIGrammarTools)){let o=u4t(t,e,r,{grammarToolInputProperties:i}),a=GGr(r,s),c={model:t.id,messages:o,stream:!0,prompt_cache_key:t.baseUrl.includes("api.openai.com")&&s!=="none"||s==="long"&&r.supportsLongCacheRetention?Ek(n?.sessionId):void 0,prompt_cache_retention:s==="long"&&r.supportsLongCacheRetention?"24h":void 0};r.supportsUsageInStreaming!==!1&&(c.stream_options={include_usage:!0}),r.supportsStore&&(c.store=!1),n?.maxTokens&&(r.maxTokensField==="max_tokens"?c.max_tokens=n.maxTokens:c.max_completion_tokens=n.maxTokens),n?.temperature!==void 0&&(c.temperature=n.temperature);let u=r.deferredToolsMode==="kimi"?IGr(e.messages):new Set,l=e.tools?.filter(m=>!u.has(m.name));l&&l.length>0?(c.tools=d4t(l,r),r.zaiToolStream&&(c.tool_stream=!0)):CGr(e.messages)&&(c.tools=[]),a&&WGr(o,c.tools,a),n?.toolChoice&&(c.tool_choice=n.toolChoice),r.vllmPriority!==void 0&&(c.priority=r.vllmPriority);let d=QGr(r),h=UGr(t,n,c);if(r.thinkingFormat==="zai"&&t.reasoning){let m=c;if(m.thinking=n?.reasoningEffort?{type:"enabled",clear_thinking:!1}:{type:"disabled"},n?.reasoningEffort&&r.supportsReasoningEffort){let f=t.thinkingLevelMap?.[n.reasoningEffort],g=f===void 0?n.reasoningEffort:f;typeof g=="string"&&(m.reasoning_effort=g)}}else if(r.thinkingFormat==="qwen"&&t.reasoning){if(c.enable_thinking=!!n?.reasoningEffort,n?.reasoningEffort&&r.supportsReasoningEffort){let m=t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort;typeof m=="string"&&(c.reasoning_effort=m)}}else if(r.thinkingFormat==="qwen-chat-template"&&t.reasoning)c.chat_template_kwargs={enable_thinking:!!n?.reasoningEffort,preserve_thinking:!0};else if(r.thinkingFormat==="chat-template"&&t.reasoning){let m=s4t(t,n,r.chatTemplateKwargs,h);m&&(c.chat_template_kwargs=m)}else if(r.thinkingFormat==="baseten"&&t.reasoning){let m=c,f=s4t(t,n,r.chatTemplateArgs,h);if(f&&(m.chat_template_args=f),r.supportsReasoningEffort){let g=n?.reasoningEffort,A=g?t.thinkingLevelMap?.[g]:t.thinkingLevelMap?.off,y=A===void 0?g:A;typeof y=="string"&&(m.reasoning_effort=y)}}else if(r.thinkingFormat==="deepseek"&&t.reasoning)n?.reasoningEffort?c.thinking={type:"enabled"}:t.thinkingLevelMap?.off!==null&&(c.thinking={type:"disabled"}),n?.reasoningEffort&&r.supportsReasoningEffort&&(c.reasoning_effort=t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort);else if(r.thinkingFormat==="openrouter"&&t.reasoning){let m=c;n?.reasoningEffort?m.reasoning={effort:t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort}:t.thinkingLevelMap?.off!==null&&(m.reasoning={effort:t.thinkingLevelMap?.off??"none"})}else if(r.thinkingFormat==="ant-ling"&&t.reasoning&&n?.reasoningEffort){let m=t.thinkingLevelMap?.[n.reasoningEffort];typeof m=="string"&&(c.reasoning={effort:m})}else if(r.thinkingFormat==="together"&&t.reasoning){let m=c;m.reasoning={enabled:!!n?.reasoningEffort},n?.reasoningEffort&&r.supportsReasoningEffort&&(m.reasoning_effort=t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort)}else if(r.thinkingFormat==="string-thinking"&&t.reasoning){let m=c;n?.reasoningEffort?m.thinking=t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort:t.thinkingLevelMap?.off!==null&&(m.thinking=t.thinkingLevelMap?.off??"none")}else if(n?.reasoningEffort&&t.reasoning&&r.supportsReasoningEffort)c.reasoning_effort=t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort;else if(!n?.reasoningEffort&&t.reasoning&&r.supportsReasoningEffort){let m=t.thinkingLevelMap?.off;typeof m=="string"&&(c.reasoning_effort=m)}if(d&&h!==void 0&&Object.assign(c,{[d]:h}),t.compat?.openRouterRouting&&(c.provider=t.compat.openRouterRouting),t.compat?.vercelGatewayRouting){let m=t.compat.vercelGatewayRouting;if(m.only||m.order){let f={};m.only&&(f.only=m.only),m.order&&(f.order=m.order),c.providerOptions={gateway:f}}}return n?.samplingParams&&Object.assign(c,n.samplingParams),c}function QGr(t){if(t.thinkingTokenBudgetField)return t.thinkingTokenBudgetField;if(t.supportsThinkingTokenBudget)return"thinking_token_budget"}function UGr(t,e,n){if(!e?.reasoningEffort||!t.reasoning)return;let r=n.max_tokens??n.max_completion_tokens??t.maxTokens,s=cUe(aUe(e.reasoningEffort,e.thinkingBudgets),r);return s>0?s:void 0}function s4t(t,e,n,r){let s={};for(let[i,o]of Object.entries(n)){let a=$Gr(t,e,o,r);a!==void 0&&(s[i]=a)}return Object.keys(s).length>0?s:void 0}function $Gr(t,e,n,r){if(typeof n!="object"||n===null)return n;let s=e?.reasoningEffort;if(!s&&n.omitWhenOff)return;if(n.$var==="thinking.enabled")return!!s;if(n.$var==="thinking.budget")return r;let i=s?t.thinkingLevelMap?.[s]:t.thinkingLevelMap?.off;return i===void 0?s:typeof i=="string"?i:void 0}function GGr(t,e){if(t.cacheControlFormat!=="anthropic"||e==="none")return;let n=e==="long"&&t.supportsLongCacheRetention?"1h":void 0;return{type:"ephemeral",...n?{ttl:n}:{}}}function WGr(t,e,n){qGr(t,n),VGr(e,n),HGr(t,n)}function qGr(t,e){for(let n of t)if(n.role==="system"||n.role==="developer"){jGr(n,e);return}}function HGr(t,e){for(let n=t.length-1;n>=0;n--){let r=t[n];if((r.role==="user"||r.role==="assistant"||r.role==="tool")&&YGr(r,e))return}}function VGr(t,e){if(!t||t.length===0)return;let n=t[t.length-1];n.cache_control=e}function jGr(t,e){return l4t(t,e)}function YGr(t,e){return t.role==="user"||t.role==="assistant"||t.role==="tool"?l4t(t,e):!1}function l4t(t,e){let n=t.content;if(typeof n=="string")return n.length===0?!1:(t.content=[{type:"text",text:n,cache_control:e}],!0);if(!Array.isArray(n))return!1;for(let r=n.length-1;r>=0;r--){let s=n[r];if(s?.type==="text"){let i=s;return i.cache_control=e,!0}}return!1}function u4t(t,e,n,r){let s=[],i=c=>{if(c.includes("|")){let u=c.indexOf("|"),l=c.slice(0,u).replace(/[^a-zA-Z0-9_-]/g,"_"),d=c.slice(u+1).replace(/[^a-zA-Z0-9_-]/g,"_"),h=d.length>0?`${l}_${d}`:l;if(h.length<=40)return h;let m=bk(c).slice(0,8);return`${l.slice(0,Math.max(1,40-m.length-1))}_${m}`}return t.provider==="openai"&&c.length>40?c.slice(0,40):c},o=lE(e.messages,t,c=>i(c));if(e.systemPrompt){let u=t.reasoning&&n.supportsDeveloperRole?"developer":"system";s.push({role:u,content:ts(e.systemPrompt)})}let a=null;for(let c=0;cd.type==="text"?{type:"text",text:ts(d.text)}:{type:"image_url",image_url:{url:`data:${d.mimeType};base64,${d.data}`}});if(l.length===0)continue;s.push({role:"user",content:l})}else if(u.role==="assistant"){let l={role:"assistant",content:n.requiresAssistantAfterToolResult?"":null},d=u.content.filter(n4t).filter(I=>I.text.trim().length>0).map(I=>({type:"text",text:ts(I.text)})),h=d.map(I=>I.text).join(""),m=u.content.filter(wGr),f=u.content.filter(TGr),g=m.map(I=>NGr(I.thinkingSignature)).find(I=>I!==void 0),A=f.map(I=>DGr(I.thoughtSignature)).filter(I=>I!==void 0),y=g??(A.length>0?A:void 0),b=m.filter(I=>I.thinking.trim().length>0);if(b.length>0){if(n.requiresThinkingAsText){let I=b.map(x=>ts(x.thinking)).join(` +`)}if(o)break}}finally{e?.removeEventListener("abort",s);try{await n.cancel()}catch{}try{n.releaseLock()}catch{}}}function rJe(t){let e=DZ.get(t);return e||(e={requests:0,connectionsCreated:0,connectionsReused:0,cachedContextRequests:0,storeTrueRequests:0,fullContextRequests:0,deltaRequests:0,lastInputItems:0,websocketFailures:0,sseFallbacks:0},DZ.set(t,e)),e}function sgi(t){let e=DZ.get(t);return e?{...e}:void 0}function ogi(t){if(t){DZ.delete(t),g_e.delete(t);return}DZ.clear(),g_e.clear()}function Dsn(t){let e=n=>{n.idleTimer&&clearTimeout(n.idleTimer),kI(n.socket,1e3,"debug_close")};if(t){for(let n of Hf.get(t)?.values()??[])e(n);Hf.delete(t);return}for(let n of Hf.values())for(let r of n.values())e(r);Hf.clear()}function Psn(t){return t?g_e.has(t):!1}function Csn(t){if(!t)return;let e=rJe(t);e.sseFallbacks++,e.websocketFallbackActive=Psn(t)}function agi(t,e){if(!t)return;g_e.add(t);let n=rJe(t);n.websocketFailures++,n.lastWebSocketError=hB(e),n.websocketFallbackActive=!0}async function cgi(t){if(!t&&eJe)return eJe;if(typeof process<"u"&&process.versions?.bun){let n=class extends WebSocket{constructor(r,i){let s={};Array.isArray(i)||typeof i=="string"?s={protocols:i}:s={...i};let o=AAe(r.toString().replace(/^wss:/,"https:").replace(/^ws:/,"http:"),t);super(r,{...s,...o?{proxy:o.toString()}:{}})}};return t||(eJe=n),n}let e=globalThis.WebSocket;return typeof e!="function"?null:e}function lgi(t){let e=t.readyState;return typeof e=="number"?e:void 0}function h_e(t){let e=lgi(t);return e===void 0||e===1}function ugi(t){return Date.now()-t.createdAt>=igi}function kI(t,e=1e3,n="done"){try{t.close(e,n)}catch{}}function Isn(t,e,n){n.idleTimer&&clearTimeout(n.idleTimer),n.idleTimer=setTimeout(()=>{if(n.busy)return;kI(n.socket,1e3,"idle_timeout");let r=Hf.get(t);r?.get(e)===n&&r.delete(e),r?.size===0&&Hf.delete(t)},rgi)}async function tJe(t,e,n,r=Dfi,i){let s=await cgi(i);if(!s)throw new Error("WebSocket transport is not available in this runtime");let o=Dm(e);return delete o["OpenAI-Beta"],new Promise((a,c)=>{let u=!1,l,d;try{d=new s(t,{headers:o})}catch(E){c(E instanceof Error?E:new Error(String(E)));return}let m=()=>{l&&(clearTimeout(l),l=void 0),d.removeEventListener("open",f),d.removeEventListener("error",g),d.removeEventListener("close",A),n?.removeEventListener("abort",y)},h=(E,_)=>{u||(u=!0,m(),_&&kI(d,1e3,_),c(E))},f=()=>{u||(u=!0,m(),a(d))},g=E=>{h(Msn(E))},A=E=>{h(Osn(E))},y=()=>{h(new Error("Request was aborted"),"aborted")};d.addEventListener("open",f),d.addEventListener("error",g),d.addEventListener("close",A),n?.addEventListener("abort",y),r>0&&(l=setTimeout(()=>{h(new Error(`WebSocket connect timeout after ${r}ms`),"connect_timeout")},r)),n?.aborted&&y()})}async function dgi(t,e,n,r,i,s,o){if(!n){let d=await tJe(t,e,i,s,o);return{socket:d,reused:!1,release:()=>kI(d)}}let a=Hf.get(n),c=a?.get(r);if(c){if(c.idleTimer&&(clearTimeout(c.idleTimer),c.idleTimer=void 0),!c.busy&&ugi(c))kI(c.socket,1e3,"connection_age_limit"),a?.delete(r),a?.size===0&&Hf.delete(n);else if(!c.busy&&h_e(c.socket))return c.busy=!0,{socket:c.socket,entry:c,reused:!0,release:({keep:d}={})=>{if(!d||!h_e(c.socket)){kI(c.socket);let m=Hf.get(n);m?.get(r)===c&&m.delete(r),m?.size===0&&Hf.delete(n);return}c.busy=!1,Isn(n,r,c)}};if(c.busy){let d=await tJe(t,e,i,s,o);return{socket:d,reused:!1,release:()=>{kI(d)}}}h_e(c.socket)||(kI(c.socket),a?.delete(r),a?.size===0&&Hf.delete(n))}let u=await tJe(t,e,i,s,o),l={socket:u,busy:!0,createdAt:Date.now()};return a=Hf.get(n),a||(a=new Map,Hf.set(n,a)),a.set(r,l),{socket:u,entry:l,reused:!1,release:({keep:d}={})=>{if(!d||!h_e(l.socket)){kI(l.socket),l.idleTimer&&clearTimeout(l.idleTimer);let m=Hf.get(n);m?.get(r)===l&&m.delete(r),m?.size===0&&Hf.delete(n);return}l.busy=!1,Isn(n,r,l)}}}function Msn(t){if(t&&typeof t=="object"){let e="message"in t?t.message:void 0;if(typeof e=="string"&&e.length>0)return new Error(e);let n="error"in t?t.error:void 0;if(n instanceof Error&&n.message.length>0)return n;if(n&&typeof n=="object"&&"message"in n){let r=n.message;if(typeof r=="string"&&r.length>0)return new Error(r)}}return new Error("WebSocket error")}function Osn(t){if(t&&typeof t=="object"){let e="code"in t?t.code:void 0,n="reason"in t?t.reason:void 0,r="wasClean"in t?t.wasClean:void 0,i=typeof e=="number"?` ${e}`:"",s=typeof n=="string"&&n.length>0?` ${n}`:"";return!s&&e===Mfi&&(s=" message too big"),new nJe(`WebSocket closed${i}${s}`.trim(),{code:typeof e=="number"?e:void 0,reason:typeof n=="string"&&n.length>0?n:void 0,wasClean:typeof r=="boolean"?r:void 0})}return new Error("WebSocket closed")}async function pgi(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return new TextDecoder().decode(new Uint8Array(t));if(ArrayBuffer.isView(t)){let e=t;return new TextDecoder().decode(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}if(t&&typeof t=="object"&&"arrayBuffer"in t){let n=await t.arrayBuffer();return new TextDecoder().decode(new Uint8Array(n))}return null}async function*mgi(t,e,n){let r=[],i=null,s=!1,o=null,a=!1,c=()=>{if(!i)return;let h=i;i=null,h()},u=h=>{(async()=>{let f=null;try{if(!h||typeof h!="object"||!("data"in h)||(f=await pgi(h.data),!f))return;let g=JSON.parse(f),A=typeof g.type=="string"?g.type:"";(A==="response.completed"||A==="response.done"||A==="response.incomplete")&&(a=!0,s=!0),r.push(g),c()}catch(g){o=new NZ(`Invalid Codex WebSocket JSON: ${hB(g)}`,{cause:g,payload:f}),s=!0,c()}})()},l=h=>{o=Msn(h),s=!0,c()},d=h=>{if(a){s=!0,c();return}o||(o=Osn(h)),s=!0,c()},m=()=>{o=new Error("Request was aborted"),s=!0,c()};t.addEventListener("message",u),t.addEventListener("error",l),t.addEventListener("close",d),e?.addEventListener("abort",m);try{for(;;){if(e?.aborted)throw new Error("Request was aborted");if(r.length>0){yield r.shift();continue}if(s)break;let h;await new Promise((f,g)=>{i=f,n!==void 0&&n>0&&(h=setTimeout(()=>{let A=new Error(`WebSocket idle timeout after ${n}ms`);o=A,s=!0,i=null,kI(t,1e3,"idle_timeout"),g(A)},n))}).finally(()=>{h&&clearTimeout(h)})}if(o)throw o;if(!a)throw new Error("WebSocket stream closed before response.completed")}finally{t.removeEventListener("message",u),t.removeEventListener("error",l),t.removeEventListener("close",d),e?.removeEventListener("abort",m)}}function wsn(t){let{input:e,previous_response_id:n,...r}=t;return r}function hgi(t,e){return JSON.stringify(t??[])===JSON.stringify(e??[])}function fgi(t,e){return JSON.stringify(wsn(t))===JSON.stringify(wsn(e))}function ggi(t,e){if(!fgi(t,e.lastRequestBody))return;let n=t.input??[],r=[...e.lastRequestBody.input??[],...e.lastResponseItems];if(n.lengthRsn(I,w,s)}),m?.signal?.aborted)y=!1;else if(E&&f&&r.responseId){let I=ZL(s,Id({messages:[r]}),Tsn,{includeSystemPrompt:!1,grammarToolInputProperties:d}).filter(w=>w.type!=="function_call_output"&&w.type!=="custom_tool_call_output");f.continuation={lastRequestBody:_,lastResponseId:r.responseId,lastResponseItems:I}}}catch(I){throw f&&(f.continuation=void 0),y=!1,I}finally{A({keep:y})}}async function bgi(t){let e=await t.text(),n=e||t.statusText||"Request failed",r;try{let s=JSON.parse(e)?.error;if(s){let o=s.code||s.type||"";if(/usage_limit_reached|usage_not_included|rate_limit_exceeded/i.test(o)||t.status===429){let a=s.plan_type?` (${s.plan_type.toLowerCase()} plan)`:"",c=s.resets_at?Math.max(0,Math.round((s.resets_at*1e3-Date.now())/6e4)):void 0,u=c!==void 0?` Try again in ~${c} min.`:"";r=`You have hit your ChatGPT usage limit${a}.${u}`.trim()}n=s.message||r||n}}catch{}return{message:n,friendlyMessage:r}}function _gi(t){try{let e=t.split(".");if(e.length!==3)throw new Error("Invalid token");let r=JSON.parse(atob(e[1]))?.[kfi]?.chatgpt_account_id;if(!r)throw new Error("No account ID in token");return r}catch{throw new Error("Failed to extract accountId from token")}}function Lsn(t,e,n,r){let i=new Headers(t);for(let[s,o]of Object.entries(e||{}))o===null?i.delete(s):i.set(s,o);return i.set("Authorization",`Bearer ${r}`),i.set("chatgpt-account-id",n),i.set("originator","pi"),i.set("User-Agent",Bh()),i}function xgi(t,e,n,r,i){let s=Lsn(t,e,n,r);return s.set("OpenAI-Beta","responses=experimental"),s.set("accept","text/event-stream"),s.set("content-type","application/json"),i&&(s.set("session-id",i),s.set("x-client-request-id",i)),s}function Sgi(t,e,n,r,i){let s=Lsn(t,e,n,r);return s.delete("accept"),s.delete("content-type"),s.delete("OpenAI-Beta"),s.delete("openai-beta"),s.set("OpenAI-Beta",ngi),s.set("x-client-request-id",i),s.set("session-id",i),s}var Rfi,kfi,Bfi,bsn,Nfi,Dfi,Pfi,Tsn,Mfi,Ofi,Lfi,Ffi,f_e,vsn,qfi,S2,NZ,ngi,rgi,igi,Hf,DZ,g_e,eJe,nJe,Qsn=v(()=>{p();ni();ZKe();ysn();qO();ev();eA();T0();w3e();dv();Cy();Nf();kN();nI();DX();jEe();rI();Rfi="https://chatgpt.com/backend-api",kfi="https://api.openai.com/auth",Bfi=0,bsn=1e3,Nfi=6e4,Dfi=15e3,Pfi=3,Tsn=new Set(["openai","openai-codex","opencode"]),Mfi=1009,Ofi="websocket_connection_limit_reached",Lfi="previous_response_not_found",Ffi=new Set(["completed","incomplete","failed","cancelled","queued","in_progress"]);f_e=class extends Error{};vsn=(t,e,n)=>{let r=new Rc,i=vh(e,t.compat?.supportsMidConvoSystemMessages);return(async()=>{let s={role:"assistant",content:[],api:"openai-codex-responses",provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let o=n?.apiKey;if(!o)throw new Error(`No API key for provider: ${t.provider}`);let a=_gi(o),c=R0(Bf(i.messages),t.compat?.supportsOpenAIGrammarTools??!1),u=n?.cacheRetention==="none"?void 0:n?.sessionId,l=iN(u),d=jfi(t,i,n,l,c),m=await n?.onPayload?.(d,t);m!==void 0&&(d=m);let h=l||Oc(),f=xgi(t.headers,n?.headers,a,o,l),g=Sgi(t.headers,n?.headers,a,o,h),A=JSON.stringify(d),y=Ssn(n?.timeoutMs),E=Ssn(n?.websocketConnectTimeoutMs),_=n?.transport||"auto",S=!1,C=_!=="sse"&&Psn(u);if(C&&Csn(u),_!=="sse"&&!C){let W=!1,$=!1,G=!1;for(;;){W=!1;try{if(await Egi(Yfi(t.baseUrl),d,g,s,r,t,()=>{W=!0,S||(S=!0,r.push({type:"start",partial:s}))},y,E,u,a,c,n),n?.signal?.aborted)throw new Error("Request was aborted");_sn(s),r.push({type:"done",reason:s.stopReason,message:s}),r.end();return}catch(q){let ce=n?.signal?.aborted,Y=!W&&Jfi(q),z=Xfi(q);if(!ce&&z&&!G){G=!0;continue}if(!ce&&Y&&!$){$=!0;continue}if(ce||Kfi(q)&&!Y||(JC(s,XK("provider_transport_failure",q,{configuredTransport:_,...W?{}:{fallbackTransport:"sse"},eventsEmitted:W,phase:W?"after_message_stream_start":"before_message_stream_start",requestBytes:new TextEncoder().encode(A).byteLength})),agi(u,q),W))throw q;Csn(u);break}}}let I=Hfi(A);I&&f.set("content-encoding","zstd");let w=I??A,k,N,O=n?.maxRetries??Bfi;for(let W=0;W<=O;W++){if(n?.signal?.aborted)throw new Error("Request was aborted");try{let $=y!==void 0&&y>0?AbortSignal.timeout(y):void 0,G=Asn([n?.signal,$]);try{k=await(n?.fetch??globalThis.fetch)(Bsn(t.baseUrl),{method:"POST",headers:f,body:w,signal:G.signal})}catch(z){throw $?.aborted&&!n?.signal?.aborted?new Error(`Codex SSE response headers timed out after ${y}ms`):z}finally{G.cleanup()}if(await n?.onResponse?.({status:k.status,headers:Dm(k.headers)},t),k.ok)break;let q=await k.text();if(W{let r=n?.apiKey;if(!r)throw new Error(`No API key for provider: ${t.provider}`);let i={...Wp(t,e,n,r),toolChoice:n?.toolChoice},s=n?.reasoning?Wl(t,n.reasoning):void 0;return vsn(t,e,{...i,reasoningEffort:s==="off"?void 0:s})};S2=class extends Error{code;payload;constructor(e,n){super(e),this.name="CodexApiError",this.code=n?.code,this.payload=n?.payload,this.cause=n?.cause}},NZ=class extends Error{payload;constructor(e,n){super(e),this.name="CodexProtocolError",this.payload=n?.payload,this.cause=n?.cause}};ngi="responses_websockets=2026-02-06",rgi=300*1e3,igi=3300*1e3,Hf=new Map,DZ=new Map,g_e=new Set;JKe(Dsn);eJe=null;nJe=class extends Error{code;reason;wasClean;constructor(e,n){super(e),this.name="WebSocketCloseError",this.code=n?.code,this.reason=n?.reason,this.wasClean=n?.wasClean}}});var C2,PZ=v(()=>{p();Sy();C2=()=>ed(()=>Promise.resolve().then(()=>(Qsn(),Fsn)))});var Jsn={};br(Jsn,{convertMessages:()=>zsn,stream:()=>Vsn,streamSimple:()=>Mgi});function Usn(t,e){if(!t)return!1;let n=e.toLowerCase();for(let[r,i]of Object.entries(t))if(r.toLowerCase()===n&&i!==null&&i.trim().length>0)return!0;return!1}function qsn(t,e,n){if(e)return e;if(Usn(n,"authorization")||Usn(n,"cf-aig-authorization"))return"unused";throw new Error(`No API key for provider: ${t}`)}function Cgi(t){for(let e of t)if(e.role==="toolResult"||e.role==="assistant"&&e.content.some(n=>n.type==="toolCall"))return!0;return!1}function Gsn(t){return t.type==="text"}function Igi(t){return t.type==="thinking"}function wgi(t){return t.type==="toolCall"}function Tgi(t){return t.type==="image"}function vgi(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Rgi(t){return(t.id===void 0||t.id===null||typeof t.id=="string")&&(t.format===void 0||typeof t.format=="string")&&(t.index===void 0||typeof t.index=="number")}function iJe(t){if(!vgi(t)||!Rgi(t))return!1;switch(t.type){case"reasoning.summary":return typeof t.summary=="string";case"reasoning.encrypted":return typeof t.data=="string";case"reasoning.text":return typeof t.text=="string"&&(t.signature===void 0||t.signature===null||typeof t.signature=="string");default:return!1}}function kgi(t){if(t)try{let e=JSON.parse(t);return Array.isArray(e)&&e.length>0&&e.every(iJe)?e:void 0}catch{return}}function Bgi(t){if(t)try{let e=JSON.parse(t);return iJe(e)&&e.type==="reasoning.encrypted"&&typeof e.id=="string"&&e.id.length>0&&e.data.length>0?e:void 0}catch{return}}function $sn(t,e){t.id??=e.id,t.format||=e.format,t.index??=e.index}function Ngi(t,e){let n=t[t.length-1];if(e.type==="reasoning.text"&&n?.type==="reasoning.text"){n.text+=e.text,n.signature||=e.signature,$sn(n,e);return}if(e.type==="reasoning.summary"&&n?.type==="reasoning.summary"){n.summary+=e.summary,$sn(n,e);return}t.push({...e})}function Pgi(t){return Dgi.includes(t)}function jsn(t,e){return t||(vi("PI_CACHE_RETENTION",e)==="long"?"long":"short")}function Ogi(t,e,n,r,i,s,o=A_e(t)){let a={"User-Agent":Bh(),...t.headers};if(t.provider==="github-copilot"){let c=qq(e.messages),u=jq({messages:e.messages,hasImages:c});Object.assign(a,u)}return s&&o.sendSessionAffinityHeaders&&(o.sessionAffinityFormat==="openrouter"?a["x-session-id"]=s:(o.sessionAffinityFormat==="openai"&&(a.session_id=s),a["x-client-request-id"]=s,a["x-session-affinity"]=s)),r&&Object.assign(a,r),new di({apiKey:n,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:i,defaultHeaders:a})}function Lgi(t,e,n,r=A_e(t),i=jsn(n?.cacheRetention,n?.env),s=R0(Bf(e.messages),r.supportsOpenAIGrammarTools)){let o=w0(e.messages,r.supportsMidConvoSystemMessages===!0&&r.supportsMidConvoToolAdditions===!0),a=zsn(t,e,r,{grammarToolInputProperties:s}),c=Ggi(r,i),u={model:t.id,messages:a,stream:!0,prompt_cache_key:t.baseUrl.includes("api.openai.com")&&i!=="none"||i==="long"&&r.supportsLongCacheRetention?iN(n?.sessionId):void 0,prompt_cache_retention:i==="long"&&r.supportsLongCacheRetention?"24h":void 0};r.supportsUsageInStreaming!==!1&&(u.stream_options={include_usage:!0}),r.supportsStore&&(u.store=!1),n?.maxTokens&&(r.maxTokensField==="max_tokens"?u.max_tokens=n.maxTokens:u.max_completion_tokens=n.maxTokens),n?.temperature!==void 0&&(u.temperature=n.temperature),o.requestTools.length>0?(u.tools=Ksn(o.requestTools,r),r.zaiToolStream&&(u.tool_stream=!0)):Cgi(e.messages)&&(u.tools=[]),c&&$gi(a,u.tools,c),n?.toolChoice&&(u.tool_choice=n.toolChoice),r.vllmPriority!==void 0&&(u.priority=r.vllmPriority);let l=Fgi(r),d=Qgi(t,n,u);if(r.thinkingFormat==="zai"&&t.reasoning){let m=u;if(m.thinking=n?.reasoningEffort?{type:"enabled",clear_thinking:!1}:{type:"disabled"},n?.reasoningEffort&&r.supportsReasoningEffort){let h=t.thinkingLevelMap?.[n.reasoningEffort],f=h===void 0?n.reasoningEffort:h;typeof f=="string"&&(m.reasoning_effort=f)}}else if(r.thinkingFormat==="qwen"&&t.reasoning){if(u.enable_thinking=!!n?.reasoningEffort,n?.reasoningEffort&&r.supportsReasoningEffort){let m=t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort;typeof m=="string"&&(u.reasoning_effort=m)}}else if(r.thinkingFormat==="qwen-chat-template"&&t.reasoning)u.chat_template_kwargs={enable_thinking:!!n?.reasoningEffort,preserve_thinking:!0};else if(r.thinkingFormat==="chat-template"&&t.reasoning){let m=Wsn(t,n,r.chatTemplateKwargs,d);m&&(u.chat_template_kwargs=m)}else if(r.thinkingFormat==="baseten"&&t.reasoning){let m=u,h=Wsn(t,n,r.chatTemplateArgs,d);if(h&&(m.chat_template_args=h),r.supportsReasoningEffort){let f=n?.reasoningEffort,g=f?t.thinkingLevelMap?.[f]:t.thinkingLevelMap?.off,A=g===void 0?f:g;typeof A=="string"&&(m.reasoning_effort=A)}}else if(r.thinkingFormat==="deepseek"&&t.reasoning)n?.reasoningEffort?u.thinking={type:"enabled"}:t.thinkingLevelMap?.off!==null&&(u.thinking={type:"disabled"}),n?.reasoningEffort&&r.supportsReasoningEffort&&(u.reasoning_effort=t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort);else if(r.thinkingFormat==="openrouter"&&t.reasoning){let m=u;n?.reasoningEffort?m.reasoning={effort:t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort}:t.thinkingLevelMap?.off!==null&&(m.reasoning={effort:t.thinkingLevelMap?.off??"none"})}else if(r.thinkingFormat==="ant-ling"&&t.reasoning&&n?.reasoningEffort){let m=t.thinkingLevelMap?.[n.reasoningEffort];typeof m=="string"&&(u.reasoning={effort:m})}else if(r.thinkingFormat==="together"&&t.reasoning){let m=u;m.reasoning={enabled:!!n?.reasoningEffort},n?.reasoningEffort&&r.supportsReasoningEffort&&(m.reasoning_effort=t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort)}else if(r.thinkingFormat==="string-thinking"&&t.reasoning){let m=u;n?.reasoningEffort?m.thinking=t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort:t.thinkingLevelMap?.off!==null&&(m.thinking=t.thinkingLevelMap?.off??"none")}else if(n?.reasoningEffort&&t.reasoning&&r.supportsReasoningEffort)u.reasoning_effort=t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort;else if(!n?.reasoningEffort&&t.reasoning&&r.supportsReasoningEffort){let m=t.thinkingLevelMap?.off;typeof m=="string"&&(u.reasoning_effort=m)}if(l&&d!==void 0&&Object.assign(u,{[l]:d}),t.compat?.openRouterRouting&&(u.provider=t.compat.openRouterRouting),t.compat?.vercelGatewayRouting){let m=t.compat.vercelGatewayRouting;if(m.only||m.order){let h={};m.only&&(h.only=m.only),m.order&&(h.order=m.order),u.providerOptions={gateway:h}}}return n?.samplingParams&&Object.assign(u,n.samplingParams),u}function Fgi(t){if(t.thinkingTokenBudgetField)return t.thinkingTokenBudgetField;if(t.supportsThinkingTokenBudget)return"thinking_token_budget"}function Qgi(t,e,n){if(!e?.reasoningEffort||!t.reasoning)return;let r=n.max_tokens??n.max_completion_tokens??t.maxTokens,i=k3e(R3e(e.reasoningEffort,e.thinkingBudgets),r);return i>0?i:void 0}function Wsn(t,e,n,r){let i={};for(let[s,o]of Object.entries(n)){let a=Ugi(t,e,o,r);a!==void 0&&(i[s]=a)}return Object.keys(i).length>0?i:void 0}function Ugi(t,e,n,r){if(typeof n!="object"||n===null)return n;let i=e?.reasoningEffort;if(!i&&n.omitWhenOff)return;if(n.$var==="thinking.enabled")return!!i;if(n.$var==="thinking.budget")return r;let s=i?t.thinkingLevelMap?.[i]:t.thinkingLevelMap?.off;return s===void 0?i:typeof s=="string"?s:void 0}function Ggi(t,e){if(t.cacheControlFormat!=="anthropic"||e==="none")return;let n=e==="long"&&t.supportsLongCacheRetention?"1h":void 0;return{type:"ephemeral",...n?{ttl:n}:{}}}function $gi(t,e,n){Wgi(t,n),qgi(e,n),Hgi(t,n)}function Wgi(t,e){for(let n of t)if(n.role==="system"||n.role==="developer"){jgi(n,e);return}}function Hgi(t,e){for(let n=t.length-1;n>=0;n--){let r=t[n];if((r.role==="user"||r.role==="assistant"||r.role==="tool")&&Vgi(r,e))return}}function qgi(t,e){if(!t||t.length===0)return;let n=t[t.length-1];n.cache_control=e}function jgi(t,e){return Ysn(t,e)}function Vgi(t,e){return t.role==="user"||t.role==="assistant"||t.role==="tool"?Ysn(t,e):!1}function Ysn(t,e){let n=t.content;if(typeof n=="string")return n.length===0?!1:(t.content=[{type:"text",text:n,cache_control:e}],!0);if(!Array.isArray(n))return!1;for(let r=n.length-1;r>=0;r--){let i=n[r];if(i?.type==="text"){let s=i;return s.cache_control=e,!0}}return!1}function zsn(t,e,n,r){let i=vh(e,n.supportsMidConvoSystemMessages),s=[],o=d=>{if(d.includes("|")){let m=d.indexOf("|"),h=d.slice(0,m).replace(/[^a-zA-Z0-9_-]/g,"_"),f=d.slice(m+1).replace(/[^a-zA-Z0-9_-]/g,"_"),g=f.length>0?`${h}_${f}`:h;if(g.length<=40)return g;let A=sN(d).slice(0,8);return`${h.slice(0,Math.max(1,40-A.length-1))}_${A}`}return t.provider==="openai"&&d.length>40?d.slice(0,40):d},a=k0(i.messages,t,d=>o(d)),c=w0(i.messages,n.supportsMidConvoSystemMessages===!0&&n.supportsMidConvoToolAdditions===!0),u=t.reasoning&&n.supportsDeveloperRole?"developer":"system",l=null;for(let d=0;d0&&c.anchorsAdditions?m.toolsAdded??[]:[];if(h.length>0){let g={role:"system",tools:Ksn(h,n)};s.push(g)}let f=d===0?kc(m):XC(m);f.length>0&&s.push({role:u,content:ri(f)})}else if(m.role==="user")if(typeof m.content=="string")s.push({role:"user",content:ri(m.content)});else{let h=m.content.filter(f=>f.type!=="text"||f.text.length>0).map(f=>f.type==="text"?{type:"text",text:ri(f.text)}:{type:"image_url",image_url:{url:`data:${f.mimeType};base64,${f.data}`}});if(h.length===0)continue;s.push({role:"user",content:h})}else if(m.role==="assistant"){let h={role:"assistant",content:n.requiresAssistantAfterToolResult?"":null},f=m.content.filter(Gsn).filter(k=>k.text.trim().length>0).map(k=>({type:"text",text:ri(k.text)})),g=f.map(k=>k.text).join(""),A=m.content.filter(Igi),y=m.content.filter(wgi),E=A.map(k=>kgi(k.thinkingSignature)).find(k=>k!==void 0),_=y.map(k=>Bgi(k.thoughtSignature)).filter(k=>k!==void 0),S=E??(_.length>0?_:void 0),C=A.filter(k=>k.thinking.trim().length>0);if(C.length>0){if(n.requiresThinkingAsText){let k=C.map(N=>ri(N.thinking)).join(` -`);l.content=[{type:"text",text:I},...d]}else if(h.length>0&&(l.content=h),!y){let I=b[0].thinkingSignature;t.provider==="opencode-go"&&I==="reasoning"&&(I="reasoning_content"),I&&OGr(I)&&(l[I]=b.map(x=>x.thinking).join(` -`))}}else h.length>0&&(l.content=h);f.length>0&&(l.tool_calls=f.map(I=>{let x=r?.grammarToolInputProperties?.get(I.name);return x!==void 0?{id:I.id,type:"custom",custom:{name:I.name,input:ts(bde(I.name,I.arguments,x))}}:{id:I.id,type:"function",function:{name:I.name,arguments:JSON.stringify(I.arguments)}}})),y&&(l.reasoning_details=y),n.requiresReasoningContentOnAssistantMessages&&t.reasoning&&l.reasoning_content===void 0&&(l.reasoning_content="");let S=l.content;if(!(S!=null&&S.length>0)&&!l.tool_calls)continue;s.push(l)}else if(u.role==="toolResult"){let l=[],d=new Set,h=c;for(;hS.text).join(` -`),g=m.content.some(S=>S.type==="image"),y=f.length>0?f:g?"(see attached image)":"(no tool output)",b={role:"tool",content:ts(y),tool_call_id:m.toolCallId};if(n.requiresToolResultName&&m.toolName&&(b.name=m.toolName),s.push(b),n.deferredToolsMode==="kimi")for(let S of m.addedToolNames??[])d.add(S);if(g&&t.input.includes("image"))for(let S of m.content)vGr(S)&&l.push({type:"image_url",image_url:{url:`data:${S.mimeType};base64,${S.data}`}})}if(c=h-1,l.length>0?(n.requiresAssistantAfterToolResult&&s.push({role:"assistant",content:"I have processed the tool results."}),s.push({role:"user",content:[{type:"text",text:"Attached image(s) from tool result:"},...l]}),a="user"):a="toolResult",d.size>0){let m=xGr(e.tools,d);if(m.length>0){let f={role:"system",tools:d4t(m,n)};s.push(f)}}continue}a=u.role}return s}function d4t(t,e){return t.map(n=>{let r=j8(n,e.supportsOpenAIGrammarTools);if(r)return{type:"custom",custom:{name:n.name,description:n.description,format:{type:"grammar",grammar:{syntax:r.format,definition:r.definition}}}};let s=oA(n,e.supportsStrictMode!==!1);return{type:"function",function:{name:n.name,description:n.description,parameters:aE(n,s),...e.supportsStrictMode!==!1&&{strict:s??!1}}}})}function i4t(t,e){let n=t.prompt_tokens||0,r=t.prompt_tokens_details?.cached_tokens??t.prompt_cache_hit_tokens??t.cached_tokens??0,s=t.prompt_tokens_details?.cache_write_tokens||0,i=Math.max(0,n-r-s),o=t.completion_tokens||0,a={input:i,output:o,cacheRead:r,cacheWrite:s,reasoning:t.completion_tokens_details?.reasoning_tokens||0,totalTokens:i+o+r+s,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}};return Sh(e,a),a}function KGr(t){if(t===null)return{stopReason:"stop"};switch(t){case"stop":case"end":return{stopReason:"stop"};case"length":return{stopReason:"length"};case"function_call":case"tool_calls":return{stopReason:"toolUse"};case"content_filter":return{stopReason:"error",errorMessage:"Provider finish_reason: content_filter"};case"network_error":return{stopReason:"error",errorMessage:"Provider finish_reason: network_error"};default:return{stopReason:"error",errorMessage:`Provider finish_reason: ${t}`}}}function zGr(t){let e=t.provider,n=t.baseUrl,r=e==="zai"||e==="zai-coding-cn"||n.includes("api.z.ai")||n.includes("open.bigmodel.cn"),s=e==="together"||n.includes("api.together.ai")||n.includes("api.together.xyz"),i=e==="moonshotai"||e==="moonshotai-cn"||n.includes("api.moonshot."),o=e==="openrouter"||n.includes("openrouter.ai"),a=e==="cloudflare-workers-ai"||n.includes("api.cloudflare.com"),c=e==="cloudflare-ai-gateway"||n.includes("gateway.ai.cloudflare.com"),u=e==="nvidia"||n.includes("integrate.api.nvidia.com"),l=e==="ant-ling"||n.includes("api.ant-ling.com"),d=e==="deepseek"||n.toLowerCase().includes("deepseek.com"),h=u||e==="cerebras"||n.includes("cerebras.ai")||e==="xai"||n.includes("api.x.ai")||s||n.includes("chutes.ai")||d||r||i||e==="opencode"||n.includes("opencode.ai")||a||c||l,m=n.includes("chutes.ai")||d||i||c||s||u||l||r,f=e==="xai"||n.includes("api.x.ai"),g=o&&(t.id.startsWith("anthropic/")||t.id.startsWith("openai/")),A=e==="openrouter"&&t.id.startsWith("anthropic/")?"anthropic":void 0;return{supportsStore:!h,supportsDeveloperRole:g||!h&&!o,supportsReasoningEffort:!f&&!r&&!i&&!s&&!c&&!u&&!l,supportsUsageInStreaming:!0,supportsFinishReason:!0,maxTokensField:m?"max_tokens":"max_completion_tokens",requiresToolResultName:!1,requiresAssistantAfterToolResult:!1,requiresThinkingAsText:!1,requiresReasoningContentOnAssistantMessages:d,thinkingFormat:d?"deepseek":r?"zai":s?"together":l?"ant-ling":o?"openrouter":"openai",openRouterRouting:{},vercelGatewayRouting:{},chatTemplateKwargs:{},chatTemplateArgs:{},zaiToolStream:!1,supportsThinkingTokenBudget:!1,thinkingTokenBudgetField:void 0,supportsStrictMode:!i&&!s&&!c&&!u,supportsOpenAIGrammarTools:!1,cacheControlFormat:A,sendSessionAffinityHeaders:!1,deferredToolsMode:void 0,sessionAffinityFormat:o?"openrouter":"openai",supportsLongCacheRetention:!(s||a||c||u||l)}}function cVe(t){let e=zGr(t);return t.compat?{supportsStore:t.compat.supportsStore??e.supportsStore,supportsDeveloperRole:t.compat.supportsDeveloperRole??e.supportsDeveloperRole,supportsReasoningEffort:t.compat.supportsReasoningEffort??e.supportsReasoningEffort,supportsUsageInStreaming:t.compat.supportsUsageInStreaming??e.supportsUsageInStreaming,supportsFinishReason:t.compat.supportsFinishReason??e.supportsFinishReason,maxTokensField:t.compat.maxTokensField??e.maxTokensField,requiresToolResultName:t.compat.requiresToolResultName??e.requiresToolResultName,requiresAssistantAfterToolResult:t.compat.requiresAssistantAfterToolResult??e.requiresAssistantAfterToolResult,requiresThinkingAsText:t.compat.requiresThinkingAsText??e.requiresThinkingAsText,requiresReasoningContentOnAssistantMessages:t.compat.requiresReasoningContentOnAssistantMessages??e.requiresReasoningContentOnAssistantMessages,thinkingFormat:t.compat.thinkingFormat??e.thinkingFormat,openRouterRouting:t.compat.openRouterRouting??{},vercelGatewayRouting:t.compat.vercelGatewayRouting??e.vercelGatewayRouting,chatTemplateKwargs:t.compat.chatTemplateKwargs??e.chatTemplateKwargs,chatTemplateArgs:t.compat.chatTemplateArgs??e.chatTemplateArgs,zaiToolStream:t.compat.zaiToolStream??e.zaiToolStream,supportsThinkingTokenBudget:t.compat.supportsThinkingTokenBudget??e.supportsThinkingTokenBudget,thinkingTokenBudgetField:t.compat.thinkingTokenBudgetField??e.thinkingTokenBudgetField,supportsStrictMode:t.compat.supportsStrictMode??e.supportsStrictMode,supportsOpenAIGrammarTools:t.compat.supportsOpenAIGrammarTools??e.supportsOpenAIGrammarTools,cacheControlFormat:t.compat.cacheControlFormat??e.cacheControlFormat,sendSessionAffinityHeaders:t.compat.sendSessionAffinityHeaders??e.sendSessionAffinityHeaders,deferredToolsMode:t.compat.deferredToolsMode??e.deferredToolsMode,sessionAffinityFormat:t.compat.sessionAffinityFormat??e.sessionAffinityFormat,supportsLongCacheRetention:t.compat.supportsLongCacheRetention??e.supportsLongCacheRetention,vllmPriority:t.compat.vllmPriority}:e}var PGr,c4t,MGr,h4t=V(()=>{p();EK();is();Bx();Pf();Yhe();oE();Px();qx();tC();SP();nC();rC();ohe();bK();sC();HB();PGr=["reasoning","reasoning_content","reasoning_text"];c4t=(t,e,n)=>{let r=new Ka;return(async()=>{let s={role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()},i,o=a=>{i!==void 0&&(a.thinkingSignature=JSON.stringify(i))};try{let a=o4t(t.provider,n?.apiKey,n?.headers),c=cVe(t),u=cE(e.tools,c.supportsOpenAIGrammarTools),l=a4t(n?.cacheRetention,n?.env),d=l==="none"?void 0:n?.sessionId,h=LGr(t,e,a,n?.headers,n?.fetch,d,c),m=FGr(t,e,n,c,l,u),f=await n?.onPayload?.(m,t);f!==void 0&&(m=f);let g={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},{data:A,response:y}=await yE(()=>h.chat.completions.create(m,g).withResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});await n?.onResponse?.({status:y.status,headers:Pp(y.headers)},t),r.push({type:"start",partial:s});let b=null,S=null,C=!1,I=new Map,x=new Map,w=s.content,R=oe=>w.indexOf(oe),N=oe=>{let re=oe.customInput?.property;if(re===void 0)return"";let Z=oe.arguments[re];return typeof Z=="string"?Z:""},P=(oe,re,Z)=>{let q=oe.customInput;if(!q)return;let ce=_de(q.jsonBuffer,q.property,re,Z);return oe.arguments={[q.property]:re},ce},G=oe=>{let re=R(oe);if(re!==-1){if(oe.type==="text")r.push({type:"text_end",contentIndex:re,content:oe.text,partial:s});else if(oe.type==="thinking")o(oe),r.push({type:"thinking_end",contentIndex:re,content:oe.thinking,partial:s});else if(oe.type==="toolCall"){if(oe.customInput){let Z=P(oe,N(oe),!0);Z!==void 0&&r.push({type:"toolcall_delta",contentIndex:re,delta:Z,partial:s})}else oe.arguments=va(oe.partialArgs);delete oe.partialArgs,delete oe.customInput,delete oe.streamIndex,r.push({type:"toolcall_end",contentIndex:re,toolCall:oe,partial:s})}}},$=()=>(b||(b={type:"text",text:""},w.push(b),r.push({type:"text_start",contentIndex:R(b),partial:s})),b),Q=oe=>(S||(S={type:"thinking",thinking:"",thinkingSignature:oe},w.push(S),r.push({type:"thinking_start",contentIndex:R(S),partial:s})),S),H=oe=>{let re=typeof oe.index=="number"?oe.index:void 0,Z=oe.function?.name??oe.custom?.name??"",q=re!==void 0?I.get(re):void 0;if(!q&&oe.id&&(q=x.get(oe.id)),!q){let ce=oe.custom&&!oe.function?u.get(Z)??"input":void 0,be=ce!==void 0;q={type:"toolCall",id:oe.id||"",name:Z,arguments:be?{[ce]:""}:{},partialArgs:be?void 0:"",customInput:be?{property:ce,jsonBuffer:{input:"",started:!1,closed:!1}}:void 0,streamIndex:re},re!==void 0&&I.set(re,q),oe.id&&x.set(oe.id,q),w.push(q),r.push({type:"toolcall_start",contentIndex:R(q),partial:s})}if(re!==void 0&&q.streamIndex===void 0&&(q.streamIndex=re,I.set(re,q)),oe.id&&x.set(oe.id,q),!q.name&&Z&&(q.name=Z),oe.custom&&!oe.function&&!q.customInput){let ce=u.get(q.name)??"input";q.arguments={[ce]:""},q.customInput={property:ce,jsonBuffer:{input:"",started:!1,closed:!1}},delete q.partialArgs}return q};for await(let oe of A){if(!oe||typeof oe!="object")continue;s.responseId||=oe.id,typeof oe.model=="string"&&oe.model.length>0&&oe.model!==t.id&&(s.responseModel||=oe.model),oe.usage&&(s.usage=i4t(oe.usage,t));let re=Array.isArray(oe.choices)?oe.choices[0]:void 0;if(re){if(!oe.usage&&re.usage&&(s.usage=i4t(re.usage,t)),re.finish_reason){s.rawStopReason=re.finish_reason;let Z=KGr(re.finish_reason);s.stopReason=Z.stopReason,Z.errorMessage&&(s.errorMessage=Z.errorMessage),C=!0}if(re.delta){if(re.delta.content!==null&&re.delta.content!==void 0&&re.delta.content.length>0){let Be=$();Be.text+=re.delta.content,r.push({type:"text_delta",contentIndex:R(Be),delta:re.delta.content,partial:s})}let Z=["reasoning_content","reasoning","reasoning_text"],q=re.delta,ce=null;for(let Be of Z){let Me=q[Be];if(typeof Me=="string"&&Me.length>0){ce=Be;break}}if(ce){let Be=q[ce];if(typeof Be=="string"&&Be.length>0){let Me=t.provider==="opencode-go"&&ce==="reasoning"?"reasoning_content":ce,Re=Q(Me);Re.thinking+=Be,r.push({type:"thinking_delta",contentIndex:R(Re),delta:Be,partial:s})}}if(re?.delta?.tool_calls)for(let Be of re.delta.tool_calls){let Me=H(Be);!Me.id&&Be.id&&(Me.id=Be.id,x.set(Be.id,Me));let Re=Be.function?.name??Be.custom?.name;!Me.name&&Re&&(Me.name=Re);let se="";if(Be.function?.arguments)se=Be.function.arguments,Me.partialArgs=(Me.partialArgs??"")+Be.function.arguments,Me.arguments=va(Me.partialArgs);else if(Be.custom?.input){let ie=N(Me)+Be.custom.input;se=P(Me,ie,!1)??""}r.push({type:"toolcall_delta",contentIndex:R(Me),delta:se,partial:s})}let be=re.delta.reasoning_details;if(Array.isArray(be))for(let Be of be)aVe(Be)&&(Q(""),i??=[],BGr(i,Be))}}}for(let oe of w)G(oe);if(n?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="aborted")throw new Error("Request was aborted");if(!C&&!c.supportsFinishReason&&(s.stopReason=s.content.some(oe=>oe.type==="toolCall")?"toolUse":"stop"),s.stopReason==="error")throw new Error(s.errorMessage||"Provider returned an error stop reason");if(c.supportsFinishReason&&!C||s.stopReason==="pending")throw new Error("Stream ended without finish_reason");r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(a){for(let u of s.content)u.type==="thinking"&&o(u),delete u.index,delete u.partialArgs,delete u.customInput,delete u.streamIndex;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=Of(Ch(a));let c=a?.error?.metadata?.raw;c&&!s.errorMessage.includes(String(c))&&(s.errorMessage+=` -${c}`),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},MGr=(t,e,n)=>{o4t(t.provider,n?.apiKey,n?.headers);let r={...Yd(t,e,n,n?.apiKey),toolChoice:n?.toolChoice},s=n?.reasoning?uu(t,n.reasoning):void 0;return c4t(t,e,{...r,reasoningEffort:s==="off"?void 0:s,thinkingBudgets:n?.thinkingBudgets})}});var y4t={};Ir(y4t,{stream:()=>A4t,streamSimple:()=>rWr});function m4t(t,e){if(!t)return!1;let n=e.toLowerCase();for(let[r,s]of Object.entries(t))if(r.toLowerCase()===n&&s!==null&&s.trim().length>0)return!0;return!1}function f4t(t,e,n){if(e)return e;if(m4t(n,"authorization")||m4t(n,"cf-aig-authorization"))return"unused";throw new Error(`No API key for provider: ${t}`)}function ZGr(t){return t.provider==="openrouter"||t.baseUrl.includes("openrouter.ai")?"openrouter":"openai"}function g4t(t,e){return t||(Ps("PI_CACHE_RETENTION",e)==="long"?"long":"short")}function lVe(t){return{supportsDeveloperRole:t.compat?.supportsDeveloperRole??!0,sessionAffinityFormat:t.compat?.sessionAffinityFormat??ZGr(t),supportsLongCacheRetention:t.compat?.supportsLongCacheRetention??!0,supportsStrictMode:t.compat?.supportsStrictMode??!1,supportsOpenAIGrammarTools:t.compat?.supportsOpenAIGrammarTools??!1,supportsAdditionalTools:t.compat?.supportsAdditionalTools??!1,supportsToolSearch:t.compat?.supportsToolSearch??!1,supportsExplicitPromptCacheMode:t.compat?.supportsExplicitPromptCacheMode??!1,supportsMaxOutputTokens:t.compat?.supportsMaxOutputTokens??!0}}function eWr(t,e){return e==="long"&&t.supportsLongCacheRetention&&!t.supportsExplicitPromptCacheMode?"24h":void 0}function tWr(t,e){if(t.supportsExplicitPromptCacheMode){if(e==="none")return{mode:"explicit"};if(e==="long"&&t.supportsLongCacheRetention)return{ttl:"30m"}}}function nWr(t){return Of(Ch(t),"OpenAI API error")}function sWr(t,e,n,r,s,i){let o=lVe(t),a={"User-Agent":xh(),...t.headers};if(t.provider==="github-copilot"){let c=wG(e.messages),u=TG({messages:e.messages,hasImages:c});Object.assign(a,u)}return i&&(o.sessionAffinityFormat==="openrouter"?a["x-session-id"]=i:(o.sessionAffinityFormat==="openai"&&(a.session_id=i),a["x-client-request-id"]=i)),r&&Object.assign(a,r),new as({apiKey:n,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:s,defaultHeaders:a})}function iWr(t,e,n,r=lVe(t),s=cE(e.tools,r.supportsOpenAIGrammarTools)){let i=r.supportsAdditionalTools?"additional-tools":r.supportsToolSearch?"tool-search":void 0,o=xG(e,i!==void 0),a=JP(t,e,JGr,{grammarToolInputProperties:s,deferredTools:o.deferred,deferredToolsMode:i,toolOptions:{supportsStrictMode:r.supportsStrictMode,supportsOpenAIGrammarTools:r.supportsOpenAIGrammarTools}}),c=g4t(n?.cacheRetention,n?.env),u={model:t.id,input:a,stream:!0,prompt_cache_key:c==="none"?void 0:Ek(n?.sessionId),prompt_cache_retention:eWr(r,c),prompt_cache_options:tWr(r,c),store:!1};if(n?.maxTokens&&r.supportsMaxOutputTokens&&(u.max_output_tokens=Math.max(n.maxTokens,XGr)),n?.temperature!==void 0&&(u.temperature=n?.temperature),n?.serviceTier!==void 0&&(u.service_tier=n.serviceTier),o.immediate.length>0&&(u.tools=_k(o.immediate,{supportsStrictMode:r.supportsStrictMode,supportsOpenAIGrammarTools:r.supportsOpenAIGrammarTools})),n?.toolChoice!==void 0&&(u.tool_choice=n.toolChoice),t.reasoning){if(n?.reasoningEffort||n?.reasoningSummary){let l=n?.reasoningEffort?t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort:"medium";u.reasoning={effort:l,summary:n?.reasoningSummary||"auto"},u.include=["reasoning.encrypted_content"]}else t.provider!=="github-copilot"&&t.thinkingLevelMap?.off!==null&&(u.reasoning={effort:t.thinkingLevelMap?.off??"none"});t.provider==="xai"&&(u.include=["reasoning.encrypted_content"])}return n?.samplingParams&&Object.assign(u,n.samplingParams),u}function oWr(t,e){switch(e){case"flex":return .5;case"priority":return t.id==="gpt-5.5"?2.5:2;default:return 1}}function aWr(t,e,n){let r=oWr(n,e);r!==1&&(t.cost.input*=r,t.cost.output*=r,t.cost.cacheRead*=r,t.cost.cacheWrite*=r,t.cost.total=t.cost.input+t.cost.output+t.cost.cacheRead+t.cost.cacheWrite)}var JGr,XGr,A4t,rWr,E4t=V(()=>{p();EK();is();she();Bx();Pf();oE();qx();tC();SP();rC();ohe();bK();Khe();sC();JGr=new Set(["openai","openai-codex","opencode"]),XGr=16;A4t=(t,e,n)=>{let r=new Ka;return(async()=>{let s={role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let i=f4t(t.provider,n?.apiKey,n?.headers),a=g4t(n?.cacheRetention,n?.env)==="none"?void 0:n?.sessionId,c=lVe(t),u=cE(e.tools,c.supportsOpenAIGrammarTools),l=sWr(t,e,i,n?.headers,n?.fetch,a),d=iWr(t,e,n,c,u),h=await n?.onPayload?.(d,t);h!==void 0&&(d=h);let m={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},{data:f,response:g}=await yE(()=>l.responses.create(d,m).withResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});if(await n?.onResponse?.({status:g.status,headers:Pp(g.headers)},t),r.push({type:"start",partial:s}),await XP(f,s,r,t,{serviceTier:n?.serviceTier,grammarToolInputProperties:u,applyServiceTierPricing:(A,y)=>aWr(A,y,t)}),n?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="pending")throw new Error("OpenAI Responses stream ended without a stop reason");if(s.stopReason==="aborted"||s.stopReason==="error")throw new Error(s.errorMessage||"An unknown error occurred");r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(i){for(let o of s.content)delete o.index,delete o.partialJson,delete o.customInput;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=nWr(i),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},rWr=(t,e,n)=>{f4t(t.provider,n?.apiKey,n?.headers);let r={...Yd(t,e,n,n?.apiKey),toolChoice:n?.toolChoice},s=n?.reasoning?uu(t,n.reasoning):void 0;return A4t(t,e,{...r,reasoningEffort:s==="off"?void 0:s})}});var I4t={};Ir(I4t,{PiMessagesResponseError:()=>dz,stream:()=>C4t,streamSimple:()=>gWr});function cWr(t){try{let e=JSON.parse(t),n=e?.error;return e&&typeof n=="object"&&n!==null&&!Array.isArray(n)?e:void 0}catch{return}}function lWr(t){return t.length>8192?`${t.slice(0,8192)}\u2026`:t}function uWr(t,e,n){let r=typeof n?.error?.message=="string"?n.error.message:void 0,s=typeof n?.error?.code=="string"?n.error.code:void 0,i=r??e,o=s?` (${s})`:"";return`${t.status} ${t.statusText}: ${i}${o}`}function dWr(t,e,n,r){let s=cWr(r),i=typeof s?.error?.code=="string"?s.error.code:void 0;return new dz(uWr(n,r,s),i,{version:1,provider:t.provider,model:t.id,url:e.toString(),status:n.status,statusText:n.statusText,error:s?.error,body:s?void 0:lWr(r),timestampMs:Date.now()})}function S4t(){return{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}function b4t(t,e){e&&ZS(t,{type:"pi_messages_rewrite",timestamp:Date.now(),details:{...e}})}function pWr(t){let e={role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:S4t(),stopReason:"pending",timestamp:Date.now()},n=new Map;return r=>{switch(r.type){case"done":return Object.assign(e,{stopReason:r.reason,usage:r.usage,responseId:r.responseId}),r.providerThinkingLevel!==void 0&&(e.providerThinkingLevel=r.providerThinkingLevel),b4t(e,r.rewrite),{type:"done",reason:r.reason,message:e};case"error":return Object.assign(e,{stopReason:r.reason,usage:r.usage,errorMessage:r.errorMessage,responseId:r.responseId}),r.providerThinkingLevel!==void 0&&(e.providerThinkingLevel=r.providerThinkingLevel),b4t(e,r.rewrite),{type:"error",reason:r.reason,error:e};case"start":break;case"text_start":e.content[r.contentIndex]={type:"text",text:""};break;case"text_delta":e.content[r.contentIndex].text+=r.delta;break;case"text_end":Object.assign(e.content[r.contentIndex],{text:r.content,textSignature:r.contentSignature});break;case"thinking_start":e.content[r.contentIndex]={type:"thinking",thinking:""};break;case"thinking_delta":e.content[r.contentIndex].thinking+=r.delta;break;case"thinking_end":Object.assign(e.content[r.contentIndex],{thinking:r.content,thinkingSignature:r.contentSignature,redacted:r.redacted});break;case"toolcall_start":e.content[r.contentIndex]={type:"toolCall",id:r.id,name:r.toolName,arguments:{}},n.set(r.contentIndex,"");break;case"toolcall_delta":{let s=`${n.get(r.contentIndex)??""}${r.delta}`;n.set(r.contentIndex,s),e.content[r.contentIndex].arguments=va(s);break}case"toolcall_end":return Object.assign(e.content[r.contentIndex],r.toolCall),n.delete(r.contentIndex),{type:"toolcall_end",contentIndex:r.contentIndex,toolCall:e.content[r.contentIndex],partial:e}}return{...r,partial:e}}}async function*hWr(t){let e=new TextDecoder,n=t.getReader(),r="";try{for(;;){let{done:s,value:i}=await n.read();r+=s?e.decode():e.decode(i,{stream:!0}),r=r.replace(/\r\n/g,` +`);h.content=[{type:"text",text:k},...f]}else if(g.length>0&&(h.content=g),!S){let k=C[0].thinkingSignature;t.provider==="opencode-go"&&k==="reasoning"&&(k="reasoning_content"),k&&Pgi(k)&&(h[k]=C.map(N=>N.thinking).join(` +`))}}else g.length>0&&(h.content=g);y.length>0&&(h.tool_calls=y.map(k=>{let N=r?.grammarToolInputProperties?.get(k.name);return N!==void 0?{id:k.id,type:"custom",custom:{name:k.name,input:ri(EAe(k.name,k.arguments,N))}}:{id:k.id,type:"function",function:{name:k.name,arguments:JSON.stringify(k.arguments)}}})),S&&(h.reasoning_details=S),n.requiresReasoningContentOnAssistantMessages&&t.reasoning&&h.reasoning_content===void 0&&(h.reasoning_content="");let I=h.content;if(!(I!=null&&I.length>0)&&!h.tool_calls)continue;s.push(h)}else if(m.role==="toolResult"){let h=[],f=d;for(;fC.text).join(` +`),y=g.content.some(C=>C.type==="image"),_=A.length>0?A:y?"(see attached image)":"(no tool output)",S={role:"tool",content:ri(_),tool_call_id:g.toolCallId};if(n.requiresToolResultName&&g.toolName&&(S.name=g.toolName),s.push(S),y&&t.input.includes("image"))for(let C of g.content)Tgi(C)&&h.push({type:"image_url",image_url:{url:`data:${C.mimeType};base64,${C.data}`}})}d=f-1,h.length>0?(n.requiresAssistantAfterToolResult&&s.push({role:"assistant",content:"I have processed the tool results."}),s.push({role:"user",content:[{type:"text",text:"Attached image(s) from tool result:"},...h]}),l="user"):l="toolResult";continue}l=m.role}return s}function Ksn(t,e){return t.map(n=>{let r=sJ(n,e.supportsOpenAIGrammarTools);if(r)return{type:"custom",custom:{name:n.name,description:n.description,format:{type:"grammar",grammar:{syntax:r.format,definition:r.definition}}}};let i=wy(n,e.supportsStrictMode!==!1);return{type:"function",function:{name:n.name,description:n.description,parameters:v0(n,i),...e.supportsStrictMode!==!1&&{strict:i??!1}}}})}function Hsn(t,e){let n=t.prompt_tokens||0,r=t.prompt_tokens_details?.cached_tokens??t.prompt_cache_hit_tokens??t.cached_tokens??0,i=t.prompt_tokens_details?.cache_write_tokens||0,s=Math.max(0,n-r-i),o=t.completion_tokens||0,a={input:s,output:o,cacheRead:r,cacheWrite:i,reasoning:t.completion_tokens_details?.reasoning_tokens||0,totalTokens:s+o+r+i,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}};return $p(e,a),a}function Ygi(t){if(t===null)return{stopReason:"stop"};switch(t){case"stop":case"end":return{stopReason:"stop"};case"length":return{stopReason:"length"};case"function_call":case"tool_calls":return{stopReason:"toolUse"};case"content_filter":return{stopReason:"error",errorMessage:"Provider finish_reason: content_filter"};case"network_error":return{stopReason:"error",errorMessage:"Provider finish_reason: network_error"};default:return{stopReason:"error",errorMessage:`Provider finish_reason: ${t}`}}}function zgi(t){let e=t.provider,n=t.baseUrl,r=e==="zai"||e==="zai-coding-cn"||n.includes("api.z.ai")||n.includes("open.bigmodel.cn"),i=e==="together"||n.includes("api.together.ai")||n.includes("api.together.xyz"),s=e==="moonshotai"||e==="moonshotai-cn"||n.includes("api.moonshot."),o=e==="openrouter"||n.includes("openrouter.ai"),a=e==="cloudflare-workers-ai"||n.includes("api.cloudflare.com"),c=e==="cloudflare-ai-gateway"||n.includes("gateway.ai.cloudflare.com"),u=e==="nvidia"||n.includes("integrate.api.nvidia.com"),l=e==="ant-ling"||n.includes("api.ant-ling.com"),d=e==="cerebras"||n.includes("cerebras.ai"),m=e==="deepseek"||n.toLowerCase().includes("deepseek.com"),h=u||d||e==="xai"||n.includes("api.x.ai")||i||n.includes("chutes.ai")||m||r||s||e==="opencode"||n.includes("opencode.ai")||a||c||l,f=n.includes("chutes.ai")||m||s||c||i||u||l||r,g=e==="xai"||n.includes("api.x.ai"),A=o&&(t.id.startsWith("anthropic/")||t.id.startsWith("openai/")),y=e==="openrouter"&&t.id.startsWith("anthropic/")?"anthropic":void 0;return{supportsStore:!h,supportsDeveloperRole:A||!h&&!o,supportsReasoningEffort:!g&&!r&&!s&&!i&&!c&&!u&&!l,supportsUsageInStreaming:!0,supportsFinishReason:!0,maxTokensField:f?"max_tokens":"max_completion_tokens",requiresToolResultName:!1,requiresAssistantAfterToolResult:!1,requiresThinkingAsText:!1,requiresReasoningContentOnAssistantMessages:m,thinkingFormat:m?"deepseek":r?"zai":i?"together":l?"ant-ling":o?"openrouter":"openai",openRouterRouting:{},vercelGatewayRouting:{},chatTemplateKwargs:{},chatTemplateArgs:{},zaiToolStream:!1,supportsThinkingTokenBudget:!1,thinkingTokenBudgetField:void 0,supportsStrictMode:!1,supportsOpenAIGrammarTools:!1,supportsMidConvoSystemMessages:!1,supportsMidConvoToolAdditions:!1,cacheControlFormat:y,sendSessionAffinityHeaders:o,sessionAffinityFormat:o?"openrouter":"openai",supportsLongCacheRetention:!(i||a||c||u||l)}}function A_e(t){let e=zgi(t);return t.compat?{supportsStore:t.compat.supportsStore??e.supportsStore,supportsDeveloperRole:t.compat.supportsDeveloperRole??e.supportsDeveloperRole,supportsReasoningEffort:t.compat.supportsReasoningEffort??e.supportsReasoningEffort,supportsUsageInStreaming:t.compat.supportsUsageInStreaming??e.supportsUsageInStreaming,supportsFinishReason:t.compat.supportsFinishReason??e.supportsFinishReason,maxTokensField:t.compat.maxTokensField??e.maxTokensField,requiresToolResultName:t.compat.requiresToolResultName??e.requiresToolResultName,requiresAssistantAfterToolResult:t.compat.requiresAssistantAfterToolResult??e.requiresAssistantAfterToolResult,requiresThinkingAsText:t.compat.requiresThinkingAsText??e.requiresThinkingAsText,requiresReasoningContentOnAssistantMessages:t.compat.requiresReasoningContentOnAssistantMessages??e.requiresReasoningContentOnAssistantMessages,thinkingFormat:t.compat.thinkingFormat??e.thinkingFormat,openRouterRouting:t.compat.openRouterRouting??{},vercelGatewayRouting:t.compat.vercelGatewayRouting??e.vercelGatewayRouting,chatTemplateKwargs:t.compat.chatTemplateKwargs??e.chatTemplateKwargs,chatTemplateArgs:t.compat.chatTemplateArgs??e.chatTemplateArgs,zaiToolStream:t.compat.zaiToolStream??e.zaiToolStream,supportsThinkingTokenBudget:t.compat.supportsThinkingTokenBudget??e.supportsThinkingTokenBudget,thinkingTokenBudgetField:t.compat.thinkingTokenBudgetField??e.thinkingTokenBudgetField,supportsStrictMode:t.compat.supportsStrictMode??e.supportsStrictMode,supportsOpenAIGrammarTools:t.compat.supportsOpenAIGrammarTools??e.supportsOpenAIGrammarTools,supportsMidConvoSystemMessages:t.compat.supportsMidConvoSystemMessages??e.supportsMidConvoSystemMessages,supportsMidConvoToolAdditions:t.compat.supportsMidConvoToolAdditions??e.supportsMidConvoToolAdditions,cacheControlFormat:t.compat.cacheControlFormat??e.cacheControlFormat,sendSessionAffinityHeaders:t.compat.sendSessionAffinityHeaders??e.sendSessionAffinityHeaders,sessionAffinityFormat:t.compat.sessionAffinityFormat??e.sessionAffinityFormat,supportsLongCacheRetention:t.compat.supportsLongCacheRetention??e.supportsLongCacheRetention,vllmPriority:t.compat.vllmPriority}:e}var Dgi,Vsn,Mgi,Xsn=v(()=>{p();NX();ni();ev();eA();qEe();T0();tv();dv();cx();CL();tI();Cy();Nf();nI();iEe();DX();rI();jO();Dgi=["reasoning","reasoning_content","reasoning_text"];Vsn=(t,e,n)=>{let r=new Rc,i=vh(e,A_e(t).supportsMidConvoSystemMessages);return(async()=>{let s={role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()},o,a=c=>{o!==void 0&&(c.thinkingSignature=JSON.stringify(o))};try{let c=qsn(t.provider,n?.apiKey,n?.headers),u=A_e(t),l=R0(Bf(i.messages),u.supportsOpenAIGrammarTools),d=jsn(n?.cacheRetention,n?.env),m=d==="none"?void 0:n?.sessionId,h=Ogi(t,i,c,n?.headers,n?.fetch,m,u),f=Lgi(t,i,n,u,d,l),g=await n?.onPayload?.(f,t);g!==void 0&&(f=g);let A={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},{data:y,response:E}=await Q0(()=>h.chat.completions.create(f,A).withResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});await n?.onResponse?.({status:E.status,headers:Dm(E.headers)},t),r.push({type:"start",partial:s});let _=null,S=null,C=!1,I=new Map,w=new Map,k=s.content,N=Y=>k.indexOf(Y),O=Y=>{let z=Y.customInput?.property;if(z===void 0)return"";let j=Y.arguments[z];return typeof j=="string"?j:""},W=(Y,z,j)=>{let se=Y.customInput;if(!se)return;let Ae=bAe(se.jsonBuffer,se.property,z,j);return Y.arguments={[se.property]:z},Ae},$=Y=>{let z=N(Y);if(z!==-1){if(Y.type==="text")r.push({type:"text_end",contentIndex:z,content:Y.text,partial:s});else if(Y.type==="thinking")a(Y),r.push({type:"thinking_end",contentIndex:z,content:Y.thinking,partial:s});else if(Y.type==="toolCall"){if(Y.customInput){let j=W(Y,O(Y),!0);j!==void 0&&r.push({type:"toolcall_delta",contentIndex:z,delta:j,partial:s})}else Y.arguments=ec(Y.partialArgs);delete Y.partialArgs,delete Y.customInput,delete Y.streamIndex,r.push({type:"toolcall_end",contentIndex:z,toolCall:Y,partial:s})}}},G=()=>(_||(_={type:"text",text:""},k.push(_),r.push({type:"text_start",contentIndex:N(_),partial:s})),_),q=Y=>(S||(S={type:"thinking",thinking:"",thinkingSignature:Y},k.push(S),r.push({type:"thinking_start",contentIndex:N(S),partial:s})),S),ce=Y=>{let z=typeof Y.index=="number"?Y.index:void 0,j=Y.function?.name??Y.custom?.name??"",se=z!==void 0?I.get(z):void 0;if(!se&&Y.id&&(se=w.get(Y.id)),!se){let Ae=Y.custom&&!Y.function?l.get(j)??"input":void 0,De=Ae!==void 0;se={type:"toolCall",id:Y.id||"",name:j,arguments:De?{[Ae]:""}:{},partialArgs:De?void 0:"",customInput:De?{property:Ae,jsonBuffer:{input:"",started:!1,closed:!1}}:void 0,streamIndex:z},z!==void 0&&I.set(z,se),Y.id&&w.set(Y.id,se),k.push(se),r.push({type:"toolcall_start",contentIndex:N(se),partial:s})}if(z!==void 0&&se.streamIndex===void 0&&(se.streamIndex=z,I.set(z,se)),Y.id&&w.set(Y.id,se),!se.name&&j&&(se.name=j),Y.custom&&!Y.function&&!se.customInput){let Ae=l.get(se.name)??"input";se.arguments={[Ae]:""},se.customInput={property:Ae,jsonBuffer:{input:"",started:!1,closed:!1}},delete se.partialArgs}return se};for await(let Y of y){if(!Y||typeof Y!="object")continue;s.responseId||=Y.id,typeof Y.model=="string"&&Y.model.length>0&&Y.model!==t.id&&(s.responseModel||=Y.model),Y.usage&&(s.usage=Hsn(Y.usage,t));let z=Array.isArray(Y.choices)?Y.choices[0]:void 0;if(z){if(!Y.usage&&z.usage&&(s.usage=Hsn(z.usage,t)),z.finish_reason){s.rawStopReason=z.finish_reason;let j=Ygi(z.finish_reason);s.stopReason=j.stopReason,j.errorMessage&&(s.errorMessage=j.errorMessage),C=!0}if(z.delta){if(z.delta.content!==null&&z.delta.content!==void 0&&z.delta.content.length>0){let Pe=G();Pe.text+=z.delta.content,r.push({type:"text_delta",contentIndex:N(Pe),delta:z.delta.content,partial:s})}let j=["reasoning_content","reasoning","reasoning_text"],se=z.delta,Ae=null;for(let Pe of j){let we=se[Pe];if(typeof we=="string"&&we.length>0){Ae=Pe;break}}if(Ae){let Pe=se[Ae];if(typeof Pe=="string"&&Pe.length>0){let we=t.provider==="opencode-go"&&Ae==="reasoning"?"reasoning_content":Ae,ie=q(we);ie.thinking+=Pe,r.push({type:"thinking_delta",contentIndex:N(ie),delta:Pe,partial:s})}}if(z?.delta?.tool_calls)for(let Pe of z.delta.tool_calls){let we=ce(Pe);!we.id&&Pe.id&&(we.id=Pe.id,w.set(Pe.id,we));let ie=Pe.function?.name??Pe.custom?.name;!we.name&&ie&&(we.name=ie);let oe="";if(Pe.function?.arguments)oe=Pe.function.arguments,we.partialArgs=(we.partialArgs??"")+Pe.function.arguments,we.arguments=ec(we.partialArgs);else if(Pe.custom?.input){let ne=O(we)+Pe.custom.input;oe=W(we,ne,!1)??""}r.push({type:"toolcall_delta",contentIndex:N(we),delta:oe,partial:s})}let De=z.delta.reasoning_details;if(Array.isArray(De))for(let Pe of De)iJe(Pe)&&(q(""),o??=[],Ngi(o,Pe))}}}for(let Y of k)$(Y);if(n?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="aborted")throw new Error("Request was aborted");if(!C&&!u.supportsFinishReason&&(s.stopReason=s.content.some(Y=>Y.type==="toolCall")?"toolUse":"stop"),s.stopReason==="error")throw new Error(s.errorMessage||"Provider returned an error stop reason");if(u.supportsFinishReason&&!C||s.stopReason==="pending")throw new Error("Stream ended without finish_reason");r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(c){for(let l of s.content)l.type==="thinking"&&a(l),delete l.index,delete l.partialArgs,delete l.customInput,delete l.streamIndex;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=tA(Rh(c));let u=c?.error?.metadata?.raw;u&&!s.errorMessage.includes(String(u))&&(s.errorMessage+=` +${u}`),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},Mgi=(t,e,n)=>{qsn(t.provider,n?.apiKey,n?.headers);let r={...Wp(t,e,n,n?.apiKey),toolChoice:n?.toolChoice},i=n?.reasoning?Wl(t,n.reasoning):void 0;return Vsn(t,e,{...r,reasoningEffort:i==="off"?void 0:i,thinkingBudgets:n?.thinkingBudgets})}});var qr,ba=v(()=>{p();Sy();qr=()=>ed(()=>Promise.resolve().then(()=>(Xsn(),Jsn)))});var ron={};br(ron,{stream:()=>non,streamSimple:()=>tAi});function Zsn(t,e){if(!t)return!1;let n=e.toLowerCase();for(let[r,i]of Object.entries(t))if(r.toLowerCase()===n&&i!==null&&i.trim().length>0)return!0;return!1}function eon(t,e,n){if(e)return e;if(Zsn(n,"authorization")||Zsn(n,"cf-aig-authorization"))return"unused";throw new Error(`No API key for provider: ${t}`)}function Xgi(t){return t.provider==="openrouter"||t.baseUrl.includes("openrouter.ai")?"openrouter":"openai"}function ton(t,e){return t||(vi("PI_CACHE_RETENTION",e)==="long"?"long":"short")}function y_e(t){return{supportsDeveloperRole:t.compat?.supportsDeveloperRole??!0,supportsMidConvoSystemMessages:t.compat?.supportsMidConvoSystemMessages??!1,sessionAffinityFormat:t.compat?.sessionAffinityFormat??Xgi(t),supportsLongCacheRetention:t.compat?.supportsLongCacheRetention??!0,supportsStrictMode:t.compat?.supportsStrictMode??!1,supportsOpenAIGrammarTools:t.compat?.supportsOpenAIGrammarTools??!1,supportsAdditionalTools:t.compat?.supportsAdditionalTools??!1,supportsToolSearch:t.compat?.supportsToolSearch??!1,supportsExplicitPromptCacheMode:t.compat?.supportsExplicitPromptCacheMode??!1,supportsMaxOutputTokens:t.compat?.supportsMaxOutputTokens??!0}}function Zgi(t,e){return e==="long"&&t.supportsLongCacheRetention&&!t.supportsExplicitPromptCacheMode?"24h":void 0}function eAi(t,e){if(t.supportsExplicitPromptCacheMode){if(e==="none")return{mode:"explicit"};if(e==="long"&&t.supportsLongCacheRetention)return{ttl:"30m"}}}function nAi(t,e,n,r,i,s){let o=y_e(t),a={"User-Agent":Bh(),...t.headers};if(t.provider==="github-copilot"){let c=qq(e.messages),u=jq({messages:e.messages,hasImages:c});Object.assign(a,u)}return s&&(o.sessionAffinityFormat==="openrouter"?a["x-session-id"]=s:(o.sessionAffinityFormat==="openai"&&(a.session_id=s),a["x-client-request-id"]=s)),r&&Object.assign(a,r),new di({apiKey:n,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:i,defaultHeaders:a})}function rAi(t,e,n,r=y_e(t),i=R0(Bf(e.messages),r.supportsOpenAIGrammarTools)){let s=w0(e.messages,r.supportsAdditionalTools||r.supportsToolSearch),o=ZL(t,e,Kgi,{grammarToolInputProperties:i,supportsMidConvoSystemMessages:r.supportsMidConvoSystemMessages,supportsAdditionalTools:r.supportsAdditionalTools,supportsToolSearch:r.supportsToolSearch,toolOptions:{supportsStrictMode:r.supportsStrictMode,supportsOpenAIGrammarTools:r.supportsOpenAIGrammarTools}}),a=ton(n?.cacheRetention,n?.env),c={model:t.id,input:o,stream:!0,prompt_cache_key:a==="none"?void 0:iN(n?.sessionId),prompt_cache_retention:Zgi(r,a),prompt_cache_options:eAi(r,a),store:!1};if(n?.maxTokens&&r.supportsMaxOutputTokens&&(c.max_output_tokens=Math.max(n.maxTokens,Jgi)),n?.temperature!==void 0&&(c.temperature=n?.temperature),n?.serviceTier!==void 0&&(c.service_tier=n.serviceTier),s.requestTools.length>0&&(c.tools=oN(s.requestTools,{supportsStrictMode:r.supportsStrictMode,supportsOpenAIGrammarTools:r.supportsOpenAIGrammarTools})),n?.toolChoice!==void 0&&(c.tool_choice=n.toolChoice),t.reasoning){if(n?.reasoningEffort||n?.reasoningSummary){let u=n?.reasoningEffort?t.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort:"medium";c.reasoning={effort:u,summary:n?.reasoningSummary||"auto"},c.include=["reasoning.encrypted_content"]}else t.provider!=="github-copilot"&&t.thinkingLevelMap?.off!==null&&(c.reasoning={effort:t.thinkingLevelMap?.off??"none"});t.provider==="xai"&&(c.include=["reasoning.encrypted_content"])}return n?.samplingParams&&Object.assign(c,n.samplingParams),c}function iAi(t,e){switch(e){case"flex":return .5;case"priority":return t.id==="gpt-5.5"?2.5:2;default:return 1}}function sAi(t,e,n){let r=iAi(n,e);r!==1&&(t.cost.input*=r,t.cost.output*=r,t.cost.cacheRead*=r,t.cost.cacheWrite*=r,t.cost.total=t.cost.input+t.cost.output+t.cost.cacheRead+t.cost.cacheWrite)}var Kgi,Jgi,non,tAi,ion=v(()=>{p();NX();ni();ev();eA();T0();dv();cx();CL();Nf();nI();iEe();DX();jEe();rI();Kgi=new Set(["openai","openai-codex","opencode"]),Jgi=16;non=(t,e,n)=>{let r=new Rc,i=vh(e,y_e(t).supportsMidConvoSystemMessages);return(async()=>{let s={role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let o=eon(t.provider,n?.apiKey,n?.headers),c=ton(n?.cacheRetention,n?.env)==="none"?void 0:n?.sessionId,u=y_e(t),l=R0(Bf(i.messages),u.supportsOpenAIGrammarTools),d=nAi(t,i,o,n?.headers,n?.fetch,c),m=rAi(t,i,n,u,l),h=await n?.onPayload?.(m,t);h!==void 0&&(m=h);let f={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},{data:g,response:A}=await Q0(()=>d.responses.create(m,f).withResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});if(await n?.onResponse?.({status:A.status,headers:Dm(A.headers)},t),r.push({type:"start",partial:s}),await e2(g,s,r,t,{serviceTier:n?.serviceTier,grammarToolInputProperties:l,applyServiceTierPricing:(y,E)=>sAi(y,E,t)}),n?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="pending")throw new Error("OpenAI Responses stream ended without a stop reason");if(s.stopReason==="aborted"||s.stopReason==="error")throw new Error(s.errorMessage||"An unknown error occurred");r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(o){for(let a of s.content)delete a.index,delete a.partialJson,delete a.customInput;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=tA(Rh(o),`${t.provider==="openai"?"OpenAI":t.provider} API error`),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},tAi=(t,e,n)=>{eon(t.provider,n?.apiKey,n?.headers);let r={...Wp(t,e,n,n?.apiKey),toolChoice:n?.toolChoice},i=n?.reasoning?Wl(t,n.reasoning):void 0;return non(t,e,{...r,reasoningEffort:i==="off"?void 0:i})}});var ip,kx=v(()=>{p();Sy();ip=()=>ed(()=>Promise.resolve().then(()=>(ion(),ron)))});var lon={};br(lon,{PiMessagesResponseError:()=>MZ,stream:()=>con,streamSimple:()=>hAi});function oAi(t){try{let e=JSON.parse(t),n=e?.error;return e&&typeof n=="object"&&n!==null&&!Array.isArray(n)?e:void 0}catch{return}}function aAi(t){return t.length>8192?`${t.slice(0,8192)}\u2026`:t}function cAi(t,e,n){let r=typeof n?.error?.message=="string"?n.error.message:void 0,i=typeof n?.error?.code=="string"?n.error.code:void 0,s=r??e,o=i?` (${i})`:"";return`${t.status} ${t.statusText}: ${s}${o}`}function lAi(t,e,n,r){let i=oAi(r),s=typeof i?.error?.code=="string"?i.error.code:void 0;return new MZ(cAi(n,r,i),s,{version:1,provider:t.provider,model:t.id,url:e.toString(),status:n.status,statusText:n.statusText,...i?.error===void 0?{}:{error:i.error},...i?{}:{body:aAi(r)},timestampMs:Date.now()})}function aon(){return{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}function son(t,e){e&&JC(t,{type:"pi_messages_rewrite",timestamp:Date.now(),details:{...e}})}function uAi(t){let e={role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:aon(),stopReason:"pending",timestamp:Date.now()},n=new Map;return r=>{switch(r.type){case"done":return Object.assign(e,{stopReason:r.reason,usage:r.usage,responseId:r.responseId}),r.providerThinkingLevel!==void 0&&(e.providerThinkingLevel=r.providerThinkingLevel),son(e,r.rewrite),{type:"done",reason:r.reason,message:e};case"error":return Object.assign(e,{stopReason:r.reason,usage:r.usage,errorMessage:r.errorMessage,responseId:r.responseId}),r.providerThinkingLevel!==void 0&&(e.providerThinkingLevel=r.providerThinkingLevel),son(e,r.rewrite),{type:"error",reason:r.reason,error:e};case"start":break;case"text_start":e.content[r.contentIndex]={type:"text",text:""};break;case"text_delta":e.content[r.contentIndex].text+=r.delta;break;case"text_end":Object.assign(e.content[r.contentIndex],{text:r.content,textSignature:r.contentSignature});break;case"thinking_start":e.content[r.contentIndex]={type:"thinking",thinking:""};break;case"thinking_delta":e.content[r.contentIndex].thinking+=r.delta;break;case"thinking_end":Object.assign(e.content[r.contentIndex],{thinking:r.content,thinkingSignature:r.contentSignature,redacted:r.redacted});break;case"toolcall_start":e.content[r.contentIndex]={type:"toolCall",id:r.id,name:r.toolName,arguments:{}},n.set(r.contentIndex,"");break;case"toolcall_delta":{let i=`${n.get(r.contentIndex)??""}${r.delta}`;n.set(r.contentIndex,i),e.content[r.contentIndex].arguments=ec(i);break}case"toolcall_end":return Object.assign(e.content[r.contentIndex],r.toolCall),n.delete(r.contentIndex),{type:"toolcall_end",contentIndex:r.contentIndex,toolCall:e.content[r.contentIndex],partial:e}}return{...r,partial:e}}}async function*dAi(t){let e=new TextDecoder,n=t.getReader(),r="";try{for(;;){let{done:i,value:s}=await n.read();r+=i?e.decode():e.decode(s,{stream:!0}),r=r.replace(/\r\n/g,` `);let o=r.indexOf(` -`);for(;o!==-1;){let a=_4t(r.slice(0,o));a&&(yield a),r=r.slice(o+2),o=r.indexOf(` +`);for(;o!==-1;){let a=oon(r.slice(0,o));a&&(yield a),r=r.slice(o+2),o=r.indexOf(` + +`)}if(i)break}if(r.trim()){let i=oon(r);i&&(yield i)}}finally{n.releaseLock()}}function oon(t){let e=t.split(` +`).find(n=>n.startsWith("data:"))?.slice(5).trim();return e&&e!=="[DONE]"?JSON.parse(e):void 0}function pAi(t,e,n){let r=n?"aborted":"error",i={role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:aon(),stopReason:r,errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()};return!n&&e instanceof MZ&&JC(i,XK("pi_messages_response_failure",e,e.diagnosticDetails)),{type:"error",reason:r,error:i}}function mAi(t,e){return t||(vi("PI_CACHE_RETENTION",e)==="long"?"long":void 0)}var MZ,con,hAi,uon=v(()=>{p();qO();eA();T0();tv();cx();MZ=class extends Error{code;diagnosticDetails;constructor(e,n,r){super(e),this.name="PiMessagesResponseError",this.code=n,this.diagnosticDetails=r}};con=(t,e,n)=>{let r=new Rc,i=uAi(t);return(async()=>{try{let s=n?.apiKey;if(!s)throw new Error(`No API key provided for provider "${t.provider}"`);let o=new URL(`${t.baseUrl.replace(/\/+$/u,"")}/messages`);n?.debug&&o.searchParams.set("debug","1");let a={model:t.id,context:e,options:{temperature:n?.temperature,maxTokens:n?.maxTokens,reasoning:n?.reasoning,cacheRetention:mAi(n?.cacheRetention,n?.env),sessionId:n?.sessionId,toolChoice:n?.toolChoice}},c=await n?.onPayload?.(a,t);c!==void 0&&(a=c);let u=await(n?.fetch??globalThis.fetch)(o,{method:"POST",headers:{authorization:`Bearer ${s}`,accept:"text/event-stream","content-type":"application/json",...eI(n?.headers)},body:JSON.stringify(a),signal:n?.signal});if(await n?.onResponse?.({status:u.status,headers:Dm(u.headers)},t),!u.ok){let l=await u.text();throw lAi(t,o,u,l)}if(!u.body)throw new Error(`${t.provider} response has no body`);for await(let l of dAi(u.body)){let d=i(l);if(r.push(d),d.type==="done"||d.type==="error")return}throw new Error(`${t.provider} stream ended without a terminal event`)}catch(s){r.push(pAi(t,s,n?.signal?.aborted??!1))}})(),r},hAi=(t,e,n)=>{let r=n;return con(t,e,{...n,reasoning:n?.reasoning,toolChoice:n?.toolChoice,debug:r?.debug})}});var OZ,E_e=v(()=>{p();Sy();OZ=()=>ed(()=>Promise.resolve().then(()=>(uon(),lon)))});function EAi(t){let e=t?.GOOGLE_APPLICATION_CREDENTIALS;if(e)return i4?i4(e):!1;if(LZ===null){if(!i4||!oJe||!aJe)return typeof process<"u"&&(process.versions?.node||process.versions?.bun)||(LZ=!1),!1;let n=vi("GOOGLE_APPLICATION_CREDENTIALS",t);n?LZ=i4(n):LZ=i4(aJe(oJe(),".config","gcloud","application_default_credentials.json"))}return LZ}function bAi(t){if(t==="github-copilot")return["COPILOT_GITHUB_TOKEN"];if(t==="anthropic")return[s4,b_e,__e];let n={"ant-ling":"ANT_LING_API_KEY","qwen-token-plan":"QWEN_TOKEN_PLAN_API_KEY","qwen-token-plan-cn":"QWEN_TOKEN_PLAN_CN_API_KEY","qwen-token-plan-individual":"QWEN_TOKEN_PLAN_API_KEY",openai:"OPENAI_API_KEY","azure-openai-responses":"AZURE_OPENAI_API_KEY",nvidia:"NVIDIA_API_KEY",deepseek:"DEEPSEEK_API_KEY",google:"GEMINI_API_KEY","google-vertex":"GOOGLE_CLOUD_API_KEY",groq:"GROQ_API_KEY",cerebras:"CEREBRAS_API_KEY",xai:"XAI_API_KEY",radius:"RADIUS_API_KEY",openrouter:"OPENROUTER_API_KEY","vercel-ai-gateway":"AI_GATEWAY_API_KEY",zai:"ZAI_API_KEY","zai-coding-cn":"ZAI_CODING_CN_API_KEY",mistral:"MISTRAL_API_KEY",minimax:"MINIMAX_API_KEY","minimax-cn":"MINIMAX_CN_API_KEY",moonshotai:"MOONSHOT_API_KEY","moonshotai-cn":"MOONSHOT_API_KEY",huggingface:"HF_TOKEN",fireworks:"FIREWORKS_API_KEY",together:"TOGETHER_API_KEY",baseten:"BASETEN_API_KEY",opencode:"OPENCODE_API_KEY","opencode-go":"OPENCODE_API_KEY","kimi-coding":"KIMI_API_KEY",meta:"META_API_KEY","cloudflare-workers-ai":"CLOUDFLARE_API_KEY","cloudflare-ai-gateway":"CLOUDFLARE_API_KEY",xiaomi:"XIAOMI_API_KEY","xiaomi-token-plan-cn":"XIAOMI_TOKEN_PLAN_CN_API_KEY","xiaomi-token-plan-ams":"XIAOMI_TOKEN_PLAN_AMS_API_KEY","xiaomi-token-plan-sgp":"XIAOMI_TOKEN_PLAN_SGP_API_KEY"}[t];return n?[n]:void 0}function don(t,e){let n=bAi(t);if(!n)return;let r=n.filter(i=>!!vi(i,e));return r.length>0?r:void 0}function cJe(t,e){let n=don(t,e);if(n?.[0]){let r=t==="anthropic"?n.find(i=>i!==s4):n[0];if(r)return vi(r,e)}if(t==="google-vertex"){let r=EAi(e),i=!!(vi("GOOGLE_CLOUD_PROJECT",e)||vi("GCLOUD_PROJECT",e)),s=!!vi("GOOGLE_CLOUD_LOCATION",e);if(r&&i&&s)return""}if(t==="amazon-bedrock"&&(vi("AWS_PROFILE",e)||vi("AWS_ACCESS_KEY_ID",e)&&vi("AWS_SECRET_ACCESS_KEY",e)||vi("AWS_BEARER_TOKEN_BEDROCK",e)||vi("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",e)||vi("AWS_CONTAINER_CREDENTIALS_FULL_URI",e)||vi("AWS_WEB_IDENTITY_TOKEN_FILE",e)))return""}var fAi,i4,oJe,aJe,sJe,gAi,AAi,yAi,s4,b_e,__e,LZ,x_e=v(()=>{p();cx();fAi=function(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,i,s,o){return r?e?".jsx":".js":i&&(!s||!o)?n:i+s+"."+o.toLowerCase()+"js"}):t},i4=null,oJe=null,aJe=null,sJe=t=>import(fAi(t)),gAi="node:fs",AAi="node:os",yAi="node:path";typeof process<"u"&&(process.versions?.node||process.versions?.bun)&&(sJe(gAi).then(t=>{i4=t.existsSync}),sJe(AAi).then(t=>{oJe=t.homedir}),sJe(yAi).then(t=>{aJe=t.join}));s4="ANTHROPIC_AUTH_TOKEN",b_e="ANTHROPIC_OAUTH_TOKEN",__e="ANTHROPIC_API_KEY",LZ=null});var S_e,lJe=v(()=>{p();S_e={openrouter:{"black-forest-labs/flux.2-flex":{id:"black-forest-labs/flux.2-flex",name:"Black Forest Labs: FLUX.2 Flex",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"black-forest-labs/flux.2-klein-4b":{id:"black-forest-labs/flux.2-klein-4b",name:"Black Forest Labs: FLUX.2 Klein 4B",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"black-forest-labs/flux.2-max":{id:"black-forest-labs/flux.2-max",name:"Black Forest Labs: FLUX.2 Max",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"black-forest-labs/flux.2-pro":{id:"black-forest-labs/flux.2-pro",name:"Black Forest Labs: FLUX.2 Pro",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"bytedance-seed/seedream-4.5":{id:"bytedance-seed/seedream-4.5",name:"ByteDance Seed: Seedream 4.5",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["image","text"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"bytedance-seed/seedream-5-0-lite":{id:"bytedance-seed/seedream-5-0-lite",name:"ByteDance Seed: Seedream 5.0 Lite",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"bytedance-seed/seedream-5-0-pro":{id:"bytedance-seed/seedream-5-0-pro",name:"ByteDance Seed: Seedream 5.0 Pro",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"google/gemini-2.5-flash-image":{id:"google/gemini-2.5-flash-image",name:"Google: Nano Banana (Gemini 2.5 Flash Image)",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["image","text"],output:["image","text"],cost:{input:.3,output:2.5,cacheRead:.03,cacheWrite:.0833333333333333}},"google/gemini-3-pro-image":{id:"google/gemini-3-pro-image",name:"Google: Nano Banana Pro (Gemini 3 Pro Image)",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["image","text"],output:["image","text"],cost:{input:2,output:12,cacheRead:.19999999999999998,cacheWrite:.375}},"google/gemini-3-pro-image-preview":{id:"google/gemini-3-pro-image-preview",name:"Google: Nano Banana Pro (Gemini 3 Pro Image Preview)",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["image","text"],output:["image","text"],cost:{input:2,output:12,cacheRead:.19999999999999998,cacheWrite:.375}},"google/gemini-3.1-flash-image":{id:"google/gemini-3.1-flash-image",name:"Google: Nano Banana 2 (Gemini 3.1 Flash Image)",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["image","text"],output:["image","text"],cost:{input:.5,output:3,cacheRead:0,cacheWrite:0}},"google/gemini-3.1-flash-image-preview":{id:"google/gemini-3.1-flash-image-preview",name:"Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview)",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["image","text"],output:["image","text"],cost:{input:.5,output:3,cacheRead:0,cacheWrite:0}},"google/gemini-3.1-flash-lite-image":{id:"google/gemini-3.1-flash-lite-image",name:"Google: Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image)",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["image","text"],output:["image","text"],cost:{input:.25,output:1.5,cacheRead:0,cacheWrite:0}},"inclusionai/ming-image-0.1-design":{id:"inclusionai/ming-image-0.1-design",name:"inclusionAI: Ming Image 0.1 Design",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"krea/krea-2-large":{id:"krea/krea-2-large",name:"Krea: Krea 2 Large",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"krea/krea-2-medium":{id:"krea/krea-2-medium",name:"Krea: Krea 2 Medium",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"krea/krea-2-medium-turbo":{id:"krea/krea-2-medium-turbo",name:"Krea: Krea 2 Medium Turbo",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"meta/muse-image":{id:"meta/muse-image",name:"Meta: Muse Image",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"microsoft/mai-image-2.5":{id:"microsoft/mai-image-2.5",name:"Microsoft AI: MAI-Image-2.5",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:5,output:0,cacheRead:0,cacheWrite:0}},"microsoft/mai-image-2.5-pro":{id:"microsoft/mai-image-2.5-pro",name:"Microsoft AI: MAI-Image-2.5 Pro",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:5,output:0,cacheRead:0,cacheWrite:0}},"microsoft/mai-image-2.6":{id:"microsoft/mai-image-2.6",name:"Microsoft AI: MAI-Image-2.6",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:5,output:0,cacheRead:0,cacheWrite:0}},"microsoft/mai-image-2.6-flash":{id:"microsoft/mai-image-2.6-flash",name:"Microsoft AI: MAI-Image-2.6 Flash",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:1.75,output:0,cacheRead:0,cacheWrite:0}},"openai/gpt-5-image":{id:"openai/gpt-5-image",name:"OpenAI: GPT-5 Image",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["image","text"],output:["image","text"],cost:{input:10,output:10,cacheRead:1.25,cacheWrite:0}},"openai/gpt-5-image-mini":{id:"openai/gpt-5-image-mini",name:"OpenAI: GPT-5 Image Mini",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["image","text"],output:["image","text"],cost:{input:2.5,output:2,cacheRead:.25,cacheWrite:0}},"openai/gpt-5.4-image-2":{id:"openai/gpt-5.4-image-2",name:"OpenAI: GPT-5.4 Image 2",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["image","text"],output:["image","text"],cost:{input:8,output:15,cacheRead:2,cacheWrite:0}},"openai/gpt-image-1":{id:"openai/gpt-image-1",name:"OpenAI: GPT Image 1",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:10,output:10,cacheRead:1.25,cacheWrite:0}},"openai/gpt-image-1-mini":{id:"openai/gpt-image-1-mini",name:"OpenAI: GPT Image 1 Mini",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:2.5,output:2.5,cacheRead:.25,cacheWrite:0}},"openai/gpt-image-2":{id:"openai/gpt-image-2",name:"OpenAI: GPT Image 2",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:8,output:8,cacheRead:2,cacheWrite:0}},"openai/gpt-image-2.5-flare":{id:"openai/gpt-image-2.5-flare",name:"OpenAI: GPT Image 2.5 Flare",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:8,output:8,cacheRead:2,cacheWrite:0}},"openai/gpt-image-2.5-sunburst":{id:"openai/gpt-image-2.5-sunburst",name:"OpenAI: GPT Image 2.5 Sunburst",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:8,output:8,cacheRead:2,cacheWrite:0}},"openrouter/auto":{id:"openrouter/auto",name:"Auto Router",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["text","image"],cost:{input:-1e6,output:-1e6,cacheRead:0,cacheWrite:0}},"openrouter/auto-beta":{id:"openrouter/auto-beta",name:"Auto Router (Beta)",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["text","image"],cost:{input:-1e6,output:-1e6,cacheRead:0,cacheWrite:0}},"qwen/qwen-image-3":{id:"qwen/qwen-image-3",name:"Qwen: Qwen Image 3",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"qwen/qwen-image-3-pro":{id:"qwen/qwen-image-3-pro",name:"Qwen: Qwen Image 3 Pro",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v3":{id:"recraft/recraft-v3",name:"Recraft: Recraft V3",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4":{id:"recraft/recraft-v4",name:"Recraft: Recraft V4",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4-pro":{id:"recraft/recraft-v4-pro",name:"Recraft: Recraft V4 Pro",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4-pro-vector":{id:"recraft/recraft-v4-pro-vector",name:"Recraft: Recraft V4 Pro Vector",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4-styles":{id:"recraft/recraft-v4-styles",name:"Recraft: Recraft V4 Styles",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4-styles-pro":{id:"recraft/recraft-v4-styles-pro",name:"Recraft: Recraft V4 Styles Pro",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4-styles-pro-vector":{id:"recraft/recraft-v4-styles-pro-vector",name:"Recraft: Recraft V4 Styles Pro Vector",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4-styles-vector":{id:"recraft/recraft-v4-styles-vector",name:"Recraft: Recraft V4 Styles Vector",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4-vector":{id:"recraft/recraft-v4-vector",name:"Recraft: Recraft V4 Vector",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4.1":{id:"recraft/recraft-v4.1",name:"Recraft: Recraft V4.1",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4.1-pro":{id:"recraft/recraft-v4.1-pro",name:"Recraft: Recraft V4.1 Pro",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4.1-pro-vector":{id:"recraft/recraft-v4.1-pro-vector",name:"Recraft: Recraft V4.1 Pro Vector",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4.1-utility":{id:"recraft/recraft-v4.1-utility",name:"Recraft: Recraft V4.1 Utility",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4.1-utility-pro":{id:"recraft/recraft-v4.1-utility-pro",name:"Recraft: Recraft V4.1 Utility Pro",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"recraft/recraft-v4.1-vector":{id:"recraft/recraft-v4.1-vector",name:"Recraft: Recraft V4.1 Vector",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"sourceful/riverflow-v2-fast":{id:"sourceful/riverflow-v2-fast",name:"Sourceful: Riverflow V2 Fast",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"sourceful/riverflow-v2-pro":{id:"sourceful/riverflow-v2-pro",name:"Sourceful: Riverflow V2 Pro",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"sourceful/riverflow-v2.5-fast":{id:"sourceful/riverflow-v2.5-fast",name:"Sourceful: Riverflow V2.5 Fast",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"sourceful/riverflow-v2.5-pro":{id:"sourceful/riverflow-v2.5-pro",name:"Sourceful: Riverflow V2.5 Pro",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"x-ai/grok-imagine-image-2.0":{id:"x-ai/grok-imagine-image-2.0",name:"xAI: Grok Imagine Image 2.0",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}},"x-ai/grok-imagine-image-quality":{id:"x-ai/grok-imagine-image-quality",name:"SpaceXAI: Grok Imagine Image Quality",api:"openrouter-images",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",input:["text","image"],output:["image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}}});function _Ai(t,e){return C_e.get(t)?.get(e)}function xAi(){return Array.from(C_e.keys())}function SAi(t){let e=C_e.get(t);return e?Array.from(e.values()):[]}var C_e,pon=v(()=>{p();lJe();C_e=new Map;for(let[t,e]of Object.entries(S_e)){let n=new Map;for(let[r,i]of Object.entries(e))n.set(r,i);C_e.set(t,n)}});function CAi(t,e){return(n,r,i)=>{if(n.api!==t)throw new Error(`Mismatched api: ${n.api} expected ${t}`);return e(n,r,i)}}function uJe(t,e){mon.set(t.api,{provider:{api:t.api,generateImages:CAi(t.api,t.generateImages)},sourceId:e})}function dJe(t){return mon.get(t)?.provider}var mon,I_e=v(()=>{p();mon=new Map});var pJe={};br(pJe,{generateImages:()=>IAi});function wAi(t,e,n,r){return new di({apiKey:e,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:eI({...t.headers,...n})})}function TAi(t,e){let n=e.input.map(r=>r.type==="text"?{type:"text",text:ri(r.text)}:{type:"image_url",image_url:{url:`data:${r.mimeType};base64,${r.data}`}});return{model:t.id,messages:[{role:"user",content:n}],stream:!1,modalities:t.output.includes("text")?["image","text"]:["image"]}}function vAi(t,e){let n=t.prompt_tokens||0,r=t.prompt_tokens_details?.cached_tokens||0,i=t.prompt_tokens_details?.cache_write_tokens||0,s=i>0?Math.max(0,r-i):r,o=Math.max(0,n-s-i),a=t.completion_tokens||0,c={input:o,output:a,cacheRead:s,cacheWrite:i,totalTokens:o+a+s+i,cost:{input:e.cost.input/1e6*o,output:e.cost.output/1e6*a,cacheRead:e.cost.cacheRead/1e6*s,cacheWrite:e.cost.cacheWrite/1e6*i,total:0}};return c.cost.total=c.cost.input+c.cost.output+c.cost.cacheRead+c.cost.cacheWrite,c}var IAi,mJe=v(()=>{p();NX();ev();T0();CL();tI();IAi=async(t,e,n)=>{let r={api:t.api,provider:t.provider,model:t.id,output:[],stopReason:"stop",timestamp:Date.now()};try{let i=n?.apiKey;if(!i)throw new Error(`No API key for provider: ${t.provider}`);let s=wAi(t,i,n?.headers,n?.fetch),o=TAi(t,e),a=await n?.onPayload?.(o,t);a!==void 0&&(o=a);let c={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},{data:u,response:l}=await Q0(()=>s.chat.completions.create(o,c).withResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});await n?.onResponse?.({status:l.status,headers:Dm(l.headers)},t);let d=u;r.responseId=d.id,d.usage&&(r.usage=vAi(d.usage,t));let m=d.choices[0];if(m){let h=m.message.content;typeof h=="string"&&h.length>0&&r.output.push({type:"text",text:h});for(let f of m.message.images??[]){let g=typeof f.image_url=="string"?f.image_url:f.image_url?.url;if(!g?.startsWith("data:"))continue;let A=g.match(/^data:([^;]+);base64,(.+)$/);A&&r.output.push({type:"image",mimeType:A[1],data:A[2]})}}return r}catch(i){return r.stopReason=n?.signal?.aborted?"aborted":"error",r.errorMessage=tA(Rh(i)),r}}});function RAi(t,e){return{api:t.api,provider:t.provider,model:t.id,output:[],stopReason:"error",errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()}}function kAi(){return hon||=Promise.resolve().then(()=>(mJe(),pJe)).then(t=>t),hon}function gon(){uJe({api:"openrouter-images",generateImages:fon})}var hon,fon,hJe=v(()=>{p();I_e();fon=async(t,e,n)=>{try{return await(await kAi()).generateImages(t,e,n)}catch(r){return RAi(t,r)}};gon()});function BAi(t){let e=dJe(t);if(!e)throw new Error(`No API provider registered for api: ${t}`);return e}async function NAi(t,e,n){return BAi(t.api).generateImages(t,e,n)}var Aon=v(()=>{p();hJe();I_e()});var Bx,I2=v(()=>{p();Bx={assign:0,create:0,clone:0,discard:0,update:0}});function w2(t,e,n){return t>=e&&t<=n}function bon(t){return t===8205}function DAi(t){return w2(t,55296,56319)}function yon(t){return w2(t,127462,127487)}function _on(t){return w2(t,65024,65039)}function xon(t){return w2(t,768,879)||w2(t,6832,6911)||w2(t,7616,7679)||w2(t,65056,65071)}function w_e(t){return t>65535?2:1}function Eon(t,e){for(;e=768&&(DAi(t)||xon(t)||_on(t)||bon(t))}function Con(t){let e=0,n=0;for(;n=e)return!0;return!1}function MAi(t,e){let n=0,r=0;for(;re)return!1;return!0}function Ion(t,e){if(e===0)return!0;if(t.length=e)return!0}}function won(t,e){if(t.length<=e)return!0;let n=0;for(;;){if(Son(t.charCodeAt(n)))return MAi(t,e);if(++n>e)return!1}}var Ton=v(()=>{p()});var L={};br(L,{Counted:()=>JAi,Entries:()=>eyi,EntriesRegExp:()=>ZAi,Every:()=>VAi,EveryAll:()=>YAi,GraphemeCount:()=>HAi,HasPropertyKey:()=>XAi,IsArray:()=>QZ,IsBigInt:()=>FZ,IsBoolean:()=>von,IsClassInstance:()=>WAi,IsConstructor:()=>LAi,IsDeepEqual:()=>EJe,IsEqual:()=>_s,IsFunction:()=>Ron,IsGreaterEqualThan:()=>Bon,IsGreaterThan:()=>UAi,IsInteger:()=>gJe,IsLessEqualThan:()=>kon,IsLessThan:()=>GAi,IsMaxLength:()=>qAi,IsMinLength:()=>jAi,IsMultipleOf:()=>$Ai,IsNull:()=>v_e,IsNumber:()=>R_e,IsObject:()=>UZ,IsObjectNotArray:()=>FAi,IsString:()=>GZ,IsSymbol:()=>QAi,IsUndefined:()=>AJe,IsUnsafePropertyKey:()=>Non,IsValueLike:()=>yJe,Keys:()=>T_e,ShiftLeft:()=>k_e,Some:()=>zAi,SomeAll:()=>KAi,Symbols:()=>tyi,Values:()=>nyi});function QZ(t){return Array.isArray(t)}function FZ(t){return _s(typeof t,"bigint")}function von(t){return _s(typeof t,"boolean")}function LAi(t){if(AJe(t)||!Ron(t))return!1;let e=Function.prototype.toString.call(t);return!!(/^class\s/.test(e)||/\[native code\]/.test(e))}function Ron(t){return _s(typeof t,"function")}function gJe(t){return Number.isInteger(t)}function v_e(t){return _s(t,null)}function R_e(t){return Number.isFinite(t)}function FAi(t){return UZ(t)&&!QZ(t)}function UZ(t){return _s(typeof t,"object")&&!v_e(t)}function GZ(t){return _s(typeof t,"string")}function QAi(t){return _s(typeof t,"symbol")}function AJe(t){return _s(t,void 0)}function _s(t,e){return t===e}function UAi(t,e){return t>e}function GAi(t,e){return t=e}function $Ai(t,e){if(FZ(t)||FZ(e))return BigInt(t)%BigInt(e)===0n;let n=1e-10;if(!R_e(t)||gJe(t)&&1/e%1===0)return!0;let r=t%e;return Math.min(Math.abs(r),Math.abs(r-e),Math.abs(r+e))i{s>=e&&!n(i,s)&&(r=!1)}),r}function zAi(t,e){return t.some((n,r)=>e(n,r))}function KAi(t,e){let n=!1;return t.forEach((r,i)=>{e(r,i)&&(n=!0)}),n}function JAi(t,e){return t.reduce((n,r,i)=>e(r,i)?++n:n,0)}function k_e(t,e,n){return _s(t.length,0)?n():e(t[0],t.slice(1))}function Non(t){return _s(t,"__proto__")||_s(t,"constructor")||_s(t,"prototype")}function XAi(t,e){return Non(e)?Object.prototype.hasOwnProperty.call(t,e):e in t}function ZAi(t){return T_e(t).map(e=>[new RegExp(`^${e}$`),t[e]])}function eyi(t){return Object.entries(t)}function T_e(t){return Object.getOwnPropertyNames(t)}function tyi(t){return Object.getOwnPropertySymbols(t)}function nyi(t){return Object.values(t)}function ryi(t,e){if(!UZ(e))return!1;let n=T_e(t);return _s(n.length,T_e(e).length)&&n.every(r=>EJe(t[r],e[r]))}function iyi(t,e){return QZ(e)&&_s(t.length,e.length)&&t.every((n,r)=>EJe(t[r],e[r]))}function EJe(t,e){return QZ(t)?iyi(t,e):UZ(t)?ryi(t,e):_s(t,e)}var o4=v(()=>{p();Ton()});var Fe={};br(Fe,{And:()=>bJe,ArrayLiteral:()=>Dyi,ArrowFunction:()=>Pyi,Call:()=>Myi,ConstDeclaration:()=>Uyi,Constant:()=>Lon,Counted:()=>vyi,Entries:()=>Ryi,Every:()=>Iyi,HasPropertyKey:()=>Byi,If:()=>Gyi,IsArray:()=>Mon,IsBigInt:()=>ayi,IsBoolean:()=>cyi,IsConstructor:()=>Ayi,IsDeepEqual:()=>Nyi,IsEqual:()=>yyi,IsFunction:()=>gyi,IsGreaterEqualThan:()=>xyi,IsGreaterThan:()=>Eyi,IsInteger:()=>lyi,IsLessEqualThan:()=>_yi,IsLessThan:()=>byi,IsMaxLength:()=>Cyi,IsMinLength:()=>Syi,IsNull:()=>uyi,IsNumber:()=>dyi,IsObject:()=>Oon,IsObjectNotArray:()=>pyi,IsString:()=>myi,IsSymbol:()=>hyi,IsUndefined:()=>fyi,Keys:()=>kyi,Member:()=>Lyi,MultipleOf:()=>qyi,New:()=>Oyi,Not:()=>Pon,Or:()=>Don,ReduceAnd:()=>Wyi,ReduceOr:()=>Hyi,Return:()=>$yi,Some:()=>wyi,SomeAll:()=>Tyi,Statements:()=>Qyi,Ternary:()=>Fyi});function oyi(t){return syi.test(t)}function bJe(t,e){return`(${t} && ${e})`}function Don(t,e){return`(${t} || ${e})`}function Pon(t){return`!(${t})`}function Mon(t){return`Array.isArray(${t})`}function ayi(t){return`typeof ${t} === "bigint"`}function cyi(t){return`typeof ${t} === "boolean"`}function lyi(t){return`Number.isInteger(${t})`}function uyi(t){return`${t} === null`}function dyi(t){return`Number.isFinite(${t})`}function pyi(t){return bJe(Oon(t),Pon(Mon(t)))}function Oon(t){return`typeof ${t} === "object" && ${t} !== null`}function myi(t){return`typeof ${t} === "string"`}function hyi(t){return`typeof ${t} === "symbol"`}function fyi(t){return`${t} === undefined`}function gyi(t){return`typeof ${t} === "function"`}function Ayi(t){return`Guard.IsConstructor(${t})`}function yyi(t,e){return`${t} === ${e}`}function Eyi(t,e){return`${t} > ${e}`}function byi(t,e){return`${t} < ${e}`}function _yi(t,e){return`${t} <= ${e}`}function xyi(t,e){return`${t} >= ${e}`}function Syi(t,e){return`Guard.IsMinLength(${t}, ${e})`}function Cyi(t,e){return`Guard.IsMaxLength(${t}, ${e})`}function Iyi(t,e,n,r){return _s(e,"0")?`${t}.every((${n[0]}, ${n[1]}) => (${r}))`:`${t}.every((${n[0]}, ${n[1]}) => (${n[1]} < ${e}) || (${r}))`}function wyi(t,e,n){return`${t}.some((${e[0]}, ${e[1]}) => ${n})`}function Tyi(t,e,n){return`((value) => { let result = false; value.forEach((${e[0]}, ${e[1]}) => { if (${n}) result = true }); return result })(${t})`}function vyi(t,e,n){return`${t}.reduce((result, ${e[0]}, ${e[1]}) => (${n}) ? ++result : result, 0)`}function Ryi(t){return`Object.entries(${t})`}function kyi(t){return`Object.getOwnPropertyNames(${t})`}function Byi(t,e){return _s(e,'"__proto__"')||_s(e,'"constructor"')?`Object.prototype.hasOwnProperty.call(${t}, ${e})`:`${e} in ${t}`}function Nyi(t,e){return`Guard.IsDeepEqual(${t}, ${e})`}function Dyi(t){return`[${t.join(", ")}]`}function Pyi(t,e){return`((${t.join(", ")}) => ${e})`}function Myi(t,e){return`${t}(${e.join(", ")})`}function Oyi(t,e){return`new ${t}(${e.join(", ")})`}function Lyi(t,e){return`${t}${oyi(e)?`.${e}`:`[${Lon(e)}]`}`}function Lon(t){if(!yJe(t))throw Error("Unsupported Constant");return GZ(t)?JSON.stringify(t):`${t}`}function Fyi(t,e,n){return`(${t} ? ${e} : ${n})`}function Qyi(t){return`{ ${t.join("; ")}; }`}function Uyi(t,e){return`const ${t} = ${e}`}function Gyi(t,e){return`if(${t}) { ${e} }`}function $yi(t){return`return ${t}`}function Wyi(t){return _s(t.length,0)?"true":t.reduce((e,n)=>bJe(e,n))}function Hyi(t){return _s(t.length,0)?"false":t.reduce((e,n)=>Don(e,n))}function qyi(t,e){return`Guard.IsMultipleOf(${t}, ${e})`}var syi,Fon=v(()=>{p();o4();syi=/^[\p{ID_Start}_$][\p{ID_Continue}_$\u200C\u200D]*$/u});var Cu={};br(Cu,{IsBigInt64Array:()=>sEi,IsBigUint64Array:()=>oEi,IsBoolean:()=>jyi,IsDate:()=>cEi,IsFloat32Array:()=>rEi,IsFloat64Array:()=>iEi,IsInt16Array:()=>Zyi,IsInt32Array:()=>tEi,IsInt8Array:()=>Kyi,IsMap:()=>uEi,IsNumber:()=>Vyi,IsRegExp:()=>aEi,IsSet:()=>lEi,IsString:()=>Yyi,IsTypeArray:()=>zyi,IsUint16Array:()=>eEi,IsUint32Array:()=>nEi,IsUint8Array:()=>Jyi,IsUint8ClampedArray:()=>Xyi});function jyi(t){return t instanceof Boolean}function Vyi(t){return t instanceof Number}function Yyi(t){return t instanceof String}function zyi(t){return globalThis.ArrayBuffer.isView(t)}function Kyi(t){return t instanceof globalThis.Int8Array}function Jyi(t){return t instanceof globalThis.Uint8Array}function Xyi(t){return t instanceof globalThis.Uint8ClampedArray}function Zyi(t){return t instanceof globalThis.Int16Array}function eEi(t){return t instanceof globalThis.Uint16Array}function tEi(t){return t instanceof globalThis.Int32Array}function nEi(t){return t instanceof globalThis.Uint32Array}function rEi(t){return t instanceof globalThis.Float32Array}function iEi(t){return t instanceof globalThis.Float64Array}function sEi(t){return t instanceof globalThis.BigInt64Array}function oEi(t){return t instanceof globalThis.BigUint64Array}function aEi(t){return t instanceof globalThis.RegExp}function cEi(t){return t instanceof globalThis.Date}function lEi(t){return t instanceof globalThis.Set}function uEi(t){return t instanceof globalThis.Map}var Qon=v(()=>{p()});var Uon=v(()=>{p();o4()});var B_e,ft=v(()=>{p();Fon();Qon();Uon();o4();o4();B_e=L});var Lc={};br(Lc,{Get:()=>hEi,Reset:()=>pEi,Set:()=>mEi});function pEi(){BI.immutableTypes=!1,BI.maxErrors=8,BI.maxInstantiationCount=128,BI.useAcceleration=!0,BI.exactOptionalPropertyTypes=!1,BI.enumerableKind=!1,BI.correctiveParse=!1,BI.unionPrioritySort=!0}function mEi(t){for(let e of L.Keys(t)){let n=t[e];n!==void 0&&Object.defineProperty(BI,e,{value:n})}}function hEi(){return BI}var BI,Gon=v(()=>{p();ft();BI={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0}});var NI=v(()=>{p();Gon()});function BN(t){return Lc.Get().immutableTypes?Object.freeze(t):t}var $Z=v(()=>{p();NI()});function fEi(t,e){return Bx.assign+=1,BN({...t,...e})}var $on=v(()=>{p();I2();$Z()});function gEi(t){return L.HasPropertyKey(t,"~kind")||L.HasPropertyKey(t,"~unsafe")}function AEi(t){let e={};for(let n of L.Keys(t)){if(L.IsUnsafePropertyKey(n))continue;let r=Object.getOwnPropertyDescriptor(t,n);r.value=T2(r.value),L.IsEqual(r.enumerable,!0)?e[n]=r.value:Object.defineProperty(e,n,r)}return e}function yEi(t){let e={};for(let n of L.Keys(t))L.IsUnsafePropertyKey(n)||(e[n]=T2(t[n]));for(let n of L.Symbols(t))e[n]=T2(t[n]);return e}function EEi(t){return L.IsClassInstance(t)?t:gEi(t)?AEi(t):yEi(t)}function bEi(t){return t.map(e=>T2(e))}function _Ei(t){return t.slice()}function xEi(t){return new RegExp(t.source,t.flags)}function SEi(t){return new Map(T2([...t.entries()]))}function CEi(t){return new Set(T2([...t.values()]))}function T2(t){return Cu.IsTypeArray(t)?_Ei(t):Cu.IsRegExp(t)?xEi(t):Cu.IsMap(t)?SEi(t):Cu.IsSet(t)?CEi(t):L.IsArray(t)?bEi(t):L.IsObject(t)?EEi(t):t}function v2(t){return Bx.clone+=1,T2(t)}var WZ=v(()=>{p();ft();I2()});function IEi(t,e){for(let n of Object.keys(e))Object.defineProperty(t,n,{configurable:!0,writable:!0,enumerable:!1,value:e[n]});return t}function Won(t,e){return{...t,...e}}function wEi(t,e,n={}){Bx.create+=1;let r=Won(e,n),i=Lc.Get().enumerableKind?Won(r,t):IEi(r,t);return BN(i)}var Hon=v(()=>{p();NI();I2();$Z()});function TEi(t,e){Bx.discard+=1;let n={};for(let r of L.Keys(t)){if(e.includes(r))continue;let i=Object.getOwnPropertyDescriptor(t,r);i.value=v2(i.value),Object.defineProperty(n,r,i)}return BN(n)}var qon=v(()=>{p();ft();I2();$Z();WZ()});function vEi(t,e,n){Bx.update+=1;let r=Lc.Get(),i=v2(t);for(let s of Object.keys(e))Object.defineProperty(i,s,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:e[s]});for(let s of Object.keys(n))Object.defineProperty(i,s,{configurable:!0,enumerable:!0,writable:!0,value:n[s]});return BN(i)}var jon=v(()=>{p();NI();I2();$Z();WZ()});var _t={};br(_t,{Assign:()=>fEi,Clone:()=>v2,Create:()=>wEi,Discard:()=>TEi,Metrics:()=>Bx,Update:()=>vEi});var Von=v(()=>{p();$on();WZ();Hon();qon();I2();jon()});var $n=v(()=>{p();Von()});function ar(t,e){return L.IsObject(t)&&L.HasPropertyKey(t,"~kind")&&L.IsEqual(t["~kind"],e)}function Fc(t){return L.IsObject(t)}var ls=v(()=>{p();ft()});function Er(t,e,n){return _t.Create({"~kind":"Deferred"},{type:"deferred",action:t,parameters:e,options:n},{})}function Qv(t){return ar(t,"Deferred")}var xo=v(()=>{p();$n();ls()});function REi(t){return _t.Update(t,{"~readonly":!0},{})}function HZ(t,e){return _t.Update(REi(t),{},e)}function Yon(t,e,n,r){let i=wn(t,e,n);return HZ(i,r)}var N_e=v(()=>{p();$n();jr()});function kEi(t){return _t.Update(t,{"~optional":!0},{})}function qZ(t,e){return _t.Update(kEi(t),{},e)}function zon(t,e,n,r){let i=wn(t,e,n);return qZ(i,r)}var D_e=v(()=>{p();$n();jr()});function Lh(t,e){return _t.Create({"~kind":"Array"},{type:"array",items:t},e)}function xs(t){return ar(t,"Array")}function R2(t){return _t.Discard(t,["~kind","type","items"])}var Fh=v(()=>{p();$n();ls()});function Nx(t,e,n={}){return _t.Create({"~kind":"Constructor"},{type:"constructor",parameters:t,instanceType:e},n)}function el(t){return ar(t,"Constructor")}function _Je(t){return _t.Discard(t,["~kind","type","parameters","instanceType"])}var nb=v(()=>{p();$n();ls()});function Dx(t,e,n={}){return _t.Create({"~kind":"Function"},{type:"function",parameters:t,returnType:e},n)}function tl(t){return ar(t,"Function")}function xJe(t){return _t.Discard(t,["~kind","type","parameters","returnType"])}var rb=v(()=>{p();$n();ls()});function Iu(t,e){return _t.Create({"~kind":"Ref"},{$ref:t},e)}function uo(t){return ar(t,"Ref")}var ib=v(()=>{p();$n();ls()});function Uv(t,e){return _t.Create({"~kind":"Generic"},{type:"generic",parameters:t,expression:e})}function k2(t){return ar(t,"Generic")}var jZ=v(()=>{p();$n();ls()});function B2(t){return _t.Create({"~kind":"Any"},{},t)}function Qc(t){return ar(t,"Any")}var qf=v(()=>{p();$n();ls()});function Xo(t){return _t.Create({"~kind":"Never"},{not:{}},t)}function Qh(t){return ar(t,"Never")}var SJe,sp=v(()=>{p();$n();ls();SJe="(?!)"});function Px(t,e={}){return Er("AddOptional",[t],e)}function NN(t,e={}){return qZ(t,e)}var VZ=v(()=>{p();xo();D_e()});function CJe(t){return NN(t)}function wu(t){return Fc(t)&&L.HasPropertyKey(t,"~optional")}var DN=v(()=>{p();ft();ls();VZ()});function IJe(t){return L.Keys(t).filter(e=>!wu(t[e]))}function YZ(t){return L.Keys(t)}function zZ(t){return L.Values(t)}var N2=v(()=>{p();ft();DN()});function Kr(t,e={}){let n=IJe(t),r=n.length>0?{required:n}:{};return _t.Create({"~kind":"Object"},{type:"object",...r,properties:t},e)}function Jr(t){return ar(t,"Object")}function wJe(t){return _t.Discard(t,["~kind","type","properties","required"])}var Ho=v(()=>{p();$n();ls();N2()});function Vl(t){return _t.Create({"~kind":"Unknown"},{},t)}function wl(t){return ar(t,"Unknown")}var Kp=v(()=>{p();$n();ls()});function Mx(t,e,n){let r=L.Keys(t).reduce((i,s)=>({...i,[s]:_t.Update(t[s],{},{$id:s})}),{});return _t.Create({"~kind":"Cyclic"},{$defs:r,$ref:e},n)}function la(t){return ar(t,"Cyclic")}function BEi(t){return _t.Discard(t,["~kind","$defs","$ref"])}var jf=v(()=>{p();ft();$n();ls()});function TJe(t){return _t.Update(t,{"~unsafe":null},{})}function KZ(t){return L.IsObjectNotArray(t)&&L.HasPropertyKey(t,"~unsafe")&&L.IsNull(t["~unsafe"])}var P_e=v(()=>{p();ft();$n()});var Gi={};br(Gi,{Match:()=>NEi});function NEi(t,e){return e[t.length]?.(...t)??(()=>{throw Error("Invalid Arguments")})()}var Kon=v(()=>{p()});var Yl=v(()=>{p();Kon()});function a4(...t){let[e,n]=Gi.Match(t,{2:(r,i)=>[r,i,i],1:r=>[r,Vl(),Vl()]});return _t.Create({"~kind":"Infer"},{type:"infer",name:e,extends:n},{})}function Tl(t){return ar(t,"Infer")}var sb=v(()=>{p();Yl();$n();ls();Kp()});function PN(t,e,n,r={}){return _t.Create({"~kind":"Dependent"},{if:t,then:e,else:n},r)}function nl(t){return ar(t,"Dependent")}function vJe(t){return _t.Discard(t,["~kind","if","then","else"])}var mA=v(()=>{p();$n();ls()});function RJe(t){return L.IsObjectNotArray(t)}function kJe(t){return L.Keys(t).filter(n=>isNaN(n)).reduce((n,r)=>[...n,t[r]],[])}var M_e=v(()=>{p();ft()});function BJe(t){return L.IsString(t)||L.IsNumber(t)}function NJe(t,e){let n=RJe(t)?kJe(t):t;return _t.Create({"~kind":"Enum"},{enum:n},e)}function rl(t){return ar(t,"Enum")}var Ox=v(()=>{p();ft();$n();ls();M_e();M_e()});function Jp(t,e={}){return _t.Create({"~kind":"Intersect"},{allOf:t},e)}function Vr(t){return ar(t,"Intersect")}function DJe(t){return _t.Discard(t,["~kind","allOf"])}var rd=v(()=>{p();$n();ls()});function DEi(){try{return Jon("null")(),!0}catch{return!1}}function PEi(){return L.IsUndefined(PJe)&&(PJe=DEi()),PJe&&Lc.Get().useAcceleration}function Jon(...t){return new globalThis.Function(...t)}var PJe,Xon=v(()=>{p();NI();ft()});var c4={};br(c4,{CanEvaluate:()=>PEi,Evaluate:()=>Jon});var Zon=v(()=>{p();Xon()});var MJe=v(()=>{p();Zon()});function vl(){throw new Error("Unreachable")}var OJe=v(()=>{p()});var Lx=v(()=>{p();OJe()});var DI={};br(DI,{Hash:()=>XEi,HashCode:()=>san});function MEi(t){let e=new Set,n=t;for(;n&&n!==Object.prototype;){for(let r of Reflect.ownKeys(n))r!=="constructor"&&typeof r!="symbol"&&e.add(r);n=Object.getPrototypeOf(n)}return[...e]}function OEi(t){return typeof t=="number"}function op(t){l4=l4^QEi[t],l4=l4*LEi%FEi}function UEi(t){op(Uh.Array);for(let e of t)MN(e)}function GEi(t){op(Uh.BigInt),ran.setBigInt64(0,t);for(let e of ian)op(e)}function ean(t){op(Uh.Boolean),op(t?1:0)}function $Ei(t){op(Uh.Constructor),MN(t.toString())}function WEi(t){op(Uh.Date),MN(t.getTime())}function HEi(t){op(Uh.Function),MN(t.toString())}function qEi(t){op(Uh.Null)}function tan(t){op(Uh.Number),ran.setFloat64(0,t,!0);for(let e of ian)op(e)}function jEi(t){op(Uh.Object);for(let e of MEi(t).sort())MN(e),MN(t[e])}function VEi(t){op(Uh.RegExp),LJe(t.toString())}function LJe(t){op(Uh.String);for(let e of YEi.encode(t))op(e)}function zEi(t){op(Uh.Symbol),MN(t.toString())}function KEi(t){op(Uh.TypeArray);let e=new Uint8Array(t.buffer);for(let n=0;n{p();Lx();ft();(function(t){t[t.Array=0]="Array",t[t.BigInt=1]="BigInt",t[t.Boolean=2]="Boolean",t[t.Date=3]="Date",t[t.Constructor=4]="Constructor",t[t.Function=5]="Function",t[t.Null=6]="Null",t[t.Number=7]="Number",t[t.Object=8]="Object",t[t.RegExp=9]="RegExp",t[t.String=10]="String",t[t.Symbol=11]="Symbol",t[t.TypeArray=12]="TypeArray",t[t.Undefined=13]="Undefined"})(Uh||(Uh={}));l4=BigInt("14695981039346656037"),[LEi,FEi]=[BigInt("1099511628211"),BigInt("18446744073709551616")],QEi=Array.from({length:256}).map((t,e)=>BigInt(e)),nan=new Float64Array(1),ran=new DataView(nan.buffer),ian=new Uint8Array(nan.buffer);YEi=new TextEncoder});var JZ=v(()=>{p();oan()});function aan(t){switch(t.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${t.params.dependencies.join(", ")} when property ${t.params.property} is present`;case"dependentRequired":return`must have properties ${t.params.dependencies.join(", ")} when property ${t.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${t.params.comparison} ${t.params.limit}`;case"exclusiveMinimum":return`must be ${t.params.comparison} ${t.params.limit}`;case"format":return`must match format "${t.params.format}"`;case"if":return`must match "${t.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${t.params.limit} items`;case"maxLength":return`must not have more than ${t.params.limit} characters`;case"maxProperties":return`must not have more than ${t.params.limit} properties`;case"maximum":return`must be ${t.params.comparison} ${t.params.limit}`;case"minItems":return`must not have fewer than ${t.params.limit} items`;case"minLength":return`must not have fewer than ${t.params.limit} characters`;case"minProperties":return`must not have fewer than ${t.params.limit} properties`;case"minimum":return`must be ${t.params.comparison} ${t.params.limit}`;case"multipleOf":return`must be multiple of ${t.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${t.params.pattern}"`;case"propertyNames":return`property names ${t.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${t.params.requiredProperties.join(", ")}`;case"type":return typeof t.params.type=="string"?`must be ${t.params.type}`:`must be either ${t.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~refine":return t.params.message;default:return"an unknown validation error occurred"}}var FJe=v(()=>{p()});function can(){return ZEi}var ZEi,QJe=v(()=>{p();FJe();ZEi=aan});var lan=v(()=>{p()});var uan=v(()=>{p()});var dan=v(()=>{p()});var pan=v(()=>{p()});var man=v(()=>{p()});var han=v(()=>{p()});var fan=v(()=>{p()});var gan=v(()=>{p()});var Aan=v(()=>{p()});var yan=v(()=>{p()});var Ean=v(()=>{p()});var UJe=v(()=>{p()});var ban=v(()=>{p()});var _an=v(()=>{p()});var xan=v(()=>{p()});var San=v(()=>{p()});var Can=v(()=>{p()});var Ian=v(()=>{p()});var wan=v(()=>{p()});var Tan=v(()=>{p()});var van=v(()=>{p()});var Ran=v(()=>{p()});var kan=v(()=>{p()});var Ban=v(()=>{p()});var Nan=v(()=>{p()});var Dan=v(()=>{p()});var Pan=v(()=>{p()});var Man=v(()=>{p()});var Oan=v(()=>{p()});var Lan=v(()=>{p()});var Fan=v(()=>{p()});var Qan=v(()=>{p()});var Uan=v(()=>{p()});var Gan=v(()=>{p()});var $an=v(()=>{p()});var Wan=v(()=>{p()});var Han=v(()=>{p()});var qan=v(()=>{p();QJe();lan();uan();dan();pan();man();FJe();han();fan();gan();Aan();yan();Ean();UJe();UJe();ban();_an();xan();San();Can();Ian();wan();Tan();van();Ran();kan();Ban();Nan();Dan();Pan();Man();Oan();Lan();Fan();Qan();Uan();Gan();$an();Wan();Han()});var jan=v(()=>{p();qan()});var u4=v(()=>{p();Yl();MJe();JZ();jan();$n();NI()});var d4=v(()=>{p();u4();u4();u4()});function XZ(t){return new m4(t)}function GJe(t,e){return XZ(t).Decode(e).Encode(()=>{throw Error("Encode not implemented")})}function $Je(t,e){return XZ(t).Decode(()=>{throw Error("Decode not implemented")}).Encode(e)}function Gm(t){return Fc(t)&&L.HasPropertyKey(t,"~codec")&&L.IsObject(t["~codec"])&&L.HasPropertyKey(t["~codec"],"encode")&&L.HasPropertyKey(t["~codec"],"decode")}var p4,m4,WJe=v(()=>{p();d4();ft();ls();p4=class{constructor(e,n){this.type=e,this.decode=n}Encode(e){let n=this.type,r=Gm(n)?o=>this.decode(n["~codec"].decode(o)):this.decode,i=Gm(n)?o=>n["~codec"].encode(e(o)):e,s={decode:r,encode:i};return _t.Update(this.type,{"~codec":s},{})}},m4=class{constructor(e){this.type=e}Decode(e){return new p4(this.type,e)}}});function HJe(t){return D2(t)}function ON(t){return Fc(t)&&L.HasPropertyKey(t,"~immutable")}var ZZ=v(()=>{p();ft();ls();eee()});function Fx(t,e={}){return Er("AddReadonly",[t],e)}function LN(t,e={}){return HZ(t,e)}var tee=v(()=>{p();xo();N_e()});function qJe(t){return LN(t)}function FN(t){return Fc(t)&&L.HasPropertyKey(t,"~readonly")}var nee=v(()=>{p();ft();ls();tee()});function Yan(t,e){let n=h4(t)?[...t["~refine"],e]:[e];return _t.Update(t,{"~refine":n},{})}function jJe(...t){let[e,n,r]=Gi.Match(t,{3:(i,s,o)=>[i,s,o],2:(i,s)=>[i,s,()=>"Refine Error"]});return Yan(e,{check:n,error:r})}function zan(t){return L.IsObjectNotArray(t)&&L.HasPropertyKey(t,"check")&&L.HasPropertyKey(t,"error")&&L.IsFunction(t.check)&&L.IsFunction(t.error)}function h4(t){return Fc(t)&&L.HasPropertyKey(t,"~refine")&&L.IsArray(t["~refine"])&&L.Every(t["~refine"],0,e=>zan(e))}var VJe=v(()=>{p();Yl();$n();ft();ls()});function f4(t){return _t.Create({"~kind":"BigInt"},{type:"bigint"},t)}function Vf(t){return ar(t,"BigInt")}var YJe,P2=v(()=>{p();$n();ls();YJe="-?(?:0|[1-9][0-9]*)n"});function ree(t){return _t.Create({"~kind":"Boolean"},{type:"boolean"},t)}function $m(t){return ar(t,"Boolean")}var QN=v(()=>{p();$n();ls()});function g4(t){return _t.Create({"~kind":"Identifier"},{name:t})}function zJe(t){return ar(t,"Identifier")}var KJe=v(()=>{p();$n();ls()});function UN(t){return _t.Create({"~kind":"Integer"},{type:"integer"},t)}function id(t){return ar(t,"Integer")}var iee,PI=v(()=>{p();$n();ls();iee="-?(?:0|[1-9][0-9]*)"});function Kan(t){return L.IsBigInt(t)?"bigint":L.IsBoolean(t)?"boolean":L.IsNumber(t)?"number":L.IsString(t)?"string":(()=>{throw new O_e(t)})()}function us(t,e){return _t.Create({"~kind":"Literal"},{type:Kan(t),const:t},e)}function see(t){return L.IsBigInt(t)||L.IsBoolean(t)||L.IsNumber(t)||L.IsString(t)}function JJe(t){return hs(t)&&L.IsBigInt(t.const)}function XJe(t){return hs(t)&&L.IsBoolean(t.const)}function oee(t){return hs(t)&&L.IsNumber(t.const)}function aee(t){return hs(t)&&L.IsString(t.const)}function hs(t){return ar(t,"Literal")}var O_e,Tu=v(()=>{p();$n();ft();ls();O_e=class extends Error{constructor(e){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}}});function M2(t){return _t.Create({"~kind":"Null"},{type:"null"},t)}function Qx(t){return ar(t,"Null")}var A4=v(()=>{p();$n();ls()});function Yf(t){return _t.Create({"~kind":"Number"},{type:"number"},t)}function lc(t){return ar(t,"Number")}var cee,Gh=v(()=>{p();$n();ls();cee="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?"});function O2(t){return _t.Create({"~kind":"Symbol"},{type:"symbol"},t)}function Ux(t){return ar(t,"Symbol")}var L2=v(()=>{p();$n();ls()});function GN(...t){let[e,n,r]=Gi.Match(t,{3:(i,s,o)=>[i,s,o],2:(i,s)=>[i,s,s],1:i=>[i,Vl(),Vl()]});return _t.Create({"~kind":"Parameter"},{name:e,extends:n,equals:r},{})}function ZJe(t){return ar(t,"Parameter")}var eXe=v(()=>{p();Yl();$n();ls();Kp()});function Wm(t){return _t.Create({"~kind":"String"},{type:"string"},t)}function zl(t){return ar(t,"String")}var lee,ob=v(()=>{p();$n();ls();lee=".*"});function Ri(t,e={}){return _t.Create({"~kind":"Union"},{anyOf:t},e)}function On(t){return ar(t,"Union")}function tXe(t){return _t.Discard(t,["~kind","anyOf"])}var ws=v(()=>{p();$n();ls()});function F2(t){let e=Jan(t);return L.IsEqual(e.length,2)?e[0]:[]}var uee=v(()=>{p();ft();L_e()});function t0i(t){return!0}function Xan(t){return L.ShiftLeft(t,(e,n)=>n0i(e)?Xan(n):!1,()=>!0)}function Zan(t){return L.IsEqual(t.length,0)?!1:Xan(t)}function n0i(t){return On(t)?Zan(t.anyOf):hs(t)?t0i(t.const):!1}function dee(t){return Zan(t)}var F_e=v(()=>{p();ft();Tu();ws()});function pee(t){return _t.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:t},{})}var Q_e=v(()=>{p();$n()});function ecn(t,e,n=[]){return L.ShiftLeft(t,(r,i)=>ecn(i,e,[...n,`${r}${e}`]),()=>n)}function r0i(t,e){return L.IsEqual(t.length,0)?[`${e}`]:ecn(t,e)}function tcn(t,e,n=[]){return L.ShiftLeft(e,(r,i)=>tcn(t,i,[...n,...ncn(t,r)]),()=>n)}function ncn(t,e){return On(e)?tcn(t,e.anyOf):hs(e)?r0i(t,e.const):vl()}function rcn(t,e){return L.ShiftLeft(e,(n,r)=>rcn(ncn(t,n),r),()=>t)}function i0i(t){return t.map(e=>us(e))}function s0i(t){let e=rcn([],t),n=i0i(e);return Ri(n)}function o0i(t){return L.IsEqual(t.length,0)?vl():L.IsEqual(t.length,1)&&hs(t[0])?t[0]:s0i(t)}function U_e(t){let e=F2(t);return L.IsEqual(e.length,0)?Wm():dee(e)?o0i(e):pee(t)}function Q2(t){let e=U_e(t);return ua(e)?Wm():e}var G_e=v(()=>{p();ft();Lx();Tu();ob();zf();ws();uee();F_e();Q_e()});function Kf(t,e){let n="object",r={[t]:e};return _t.Create({"~kind":"Record"},{type:n,patternProperties:r})}var $N=v(()=>{p();$n()});function icn(t){return Kf(ab,t)}var scn=v(()=>{p();ap();$N()});function ocn(t){return Kr({true:t,false:t})}var acn=v(()=>{p();Ho()});function il(t,e={}){let[n,r,i]=[t,t.length,!1];return _t.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:n,minItems:r},e)}function rs(t){return ar(t,"Tuple")}function nXe(t){return _t.Discard(t,["~kind","type","items","minItems","additionalItems"])}var sd=v(()=>{p();$n();ls()});function a0i(t){return _t.Discard(t,["~readonly"])}function rXe(t,e){return _t.Update(a0i(t),{},e)}function ccn(t,e,n,r){let i=wn(t,e,n);return rXe(i,r)}var iXe=v(()=>{p();$n();jr()});function sXe(t,e={}){return Er("RemoveReadonly",[t],e)}function oXe(t,e={}){return rXe(t,e)}var aXe=v(()=>{p();xo();iXe()});function c0i(t){return _t.Discard(t,["~optional"])}function cXe(t,e){return _t.Update(c0i(t),{},e)}function lcn(t,e,n,r){let i=wn(t,e,n);return cXe(i,r)}var lXe=v(()=>{p();$n();jr()});function uXe(t,e={}){return Er("RemoveOptional",[t],e)}function mee(t,e={}){return cXe(t,e)}var $_e=v(()=>{p();xo();lXe()});function dXe(t){return t.reduceRight((n,r,i)=>({[i]:r,...n}),{})}function ucn(t){let e=dXe(t.items);return Kr(e)}var pXe=v(()=>{p();Ho()});function W_e(t){return Jr(t)||rs(t)}function l0i(t,e){return FN(t)?!!FN(e):!1}function u0i(t,e){return wu(t)?!!wu(e):!1}function d0i(t,e){let n=l0i(t,e),r=u0i(t,e),i=uc([t,e]),s=oXe(mee(i));return n&&r?LN(NN(s)):n&&!r?LN(s):!n&&r?NN(s):s}function p0i(t,e,n){return n in t?n in e?d0i(t[n],e[n]):t[n]:n in e?e[n]:Xo()}function m0i(t,e){return[...new Set([...L.Keys(t),...L.Keys(e)])].reduce((i,s)=>({...i,[s]:p0i(t,e,s)}),{})}function dcn(t){return Jr(t)?t.properties:rs(t)?dXe(t.items):{}}function mXe(t,e){let n=dcn(t),r=dcn(e),i=m0i(n,r);return Kr(i)}var hXe=v(()=>{p();ft();nee();DN();Ho();sp();sd();tee();VZ();aXe();$_e();pXe();fs()});function h0i(t,e){let n=U2(t,e);return L.IsEqual(n,E4)?t:L.IsEqual(n,b4)||L.IsEqual(n,y4)?e:Xo()}function f0i(t,e){let n=W_e(t),r=W_e(e);return n&&r?mXe(t,e):n&&!r?t:!n&&r?e:h0i(t,e)}function fXe(t,e){return Qh(t)||Qc(t)?t:wl(t)||Qh(e)||Qc(e)?e:wl(e)?t:f0i(t,e)}var gXe=v(()=>{p();ft();qf();sp();Kp();hee();hXe()});function g0i(t,e){return On(t)||On(e)}function A0i(t,e){let n=Vy(t),r=Vy(e);return g0i(n,r)?uc([n,r]):fXe(n,r)}function pcn(t,e,n=[]){return L.ShiftLeft(e,(r,i)=>pcn(t,i,[...n,A0i(r,t)]),()=>L.IsEqual(n.length,0)?[t]:n)}function mcn(t,e,n=[]){return L.ShiftLeft(t,(r,i)=>mcn(i,e,[...n,..._4([r],e)]),()=>n)}function _4(t,e=[]){return L.ShiftLeft(t,(n,r)=>On(n)?_4(r,mcn(n.anyOf,e)):_4(r,pcn(n,e)),()=>e)}var AXe=v(()=>{p();ft();ws();gXe();fs();fs()});function y0i(t,e){let n=cp({},t,e);return Ci.IsExtendsTrueLike(n)?[]:[t]}function hcn(t,e,n=[]){return L.ShiftLeft(t,(r,i)=>hcn(i,e,[...n,...y0i(r,e)]),()=>n)}function H_e(t,e){let n=Vy(t),r=On(n)?n.anyOf:[n],i=hcn(r,e);return $h(i)}var yXe=v(()=>{p();ft();ws();Gx();fs();fs()});function cb(t,e,n){let r=uc([t,e]),i=H_e(n,t);return $h([r,i])}function Hm(t,e=[]){return L.ShiftLeft(t,(n,r)=>Hm(r,[...e,us(n)]),()=>$h(e))}function uc(t){let e=_4(t),n=q_e(e);return $h(n)}function Xp(t){let e=Q2(t);return Vy(e)}function $h(t){let e=q_e(t);return Gv(e)}function Vy(t){return nl(t)?cb(t.if,t.then,t.else):rl(t)?Hm(t.enum):Vr(t)?uc(t.allOf):ua(t)?Xp(t.pattern):On(t)?$h(t.anyOf):t}function Gv(t){return L.IsEqual(t.length,1)?t[0]:L.IsEqual(t.length,0)?Xo():Ri(t)}var fs=v(()=>{p();ft();mA();Ox();rd();Tu();sp();zf();ws();AXe();EXe();yXe();G_e()});function fcn(t,e){let n=Hm(t);return WN(n,e)}var gcn=v(()=>{p();fee();fs()});function Acn(t,e){return Kf($v,e)}var ycn=v(()=>{p();ap();$N()});function Ecn(t,e){let n=uc(t);return WN(n,e)}var bcn=v(()=>{p();fs();fee()});function _cn(t,e){return L.IsString(t)||L.IsNumber(t)?Kr({[t]:e}):L.IsEqual(t,!1)?Kr({false:e}):L.IsEqual(t,!0)?Kr({true:e}):Kr({})}var xcn=v(()=>{p();ft();Ho()});function Scn(t,e){return Kf(G2,e)}var Ccn=v(()=>{p();ap();$N()});function Icn(t,e){return L.HasPropertyKey(t,"pattern")&&(L.IsString(t.pattern)||t.pattern instanceof RegExp)?Kf(t.pattern.toString(),e):Kf(ab,e)}var wcn=v(()=>{p();ft();ap();$N()});function Tcn(t,e){let n=F2(t);return dee(n)?WN(Xp(t),e):Kf(t,e)}var vcn=v(()=>{p();fee();uee();F_e();fs();$N()});function E0i(t){return On(t)?Wv(t.anyOf):[t]}function Wv(t,e=[]){return L.ShiftLeft(t,(n,r)=>Wv(r,[...e,...E0i(n)]),()=>e)}var j_e=v(()=>{p();ft();ws()});function b0i(t){return t.some(e=>zl(e)||lc(e)||id(e))}function _0i(t,e){return L.IsEqual(b0i(t),!0)?Kf(ab,e):void 0}function x0i(t,e){return t.reduce((n,r)=>hs(r)&&(L.IsString(r.const)||L.IsNumber(r.const))?{...n,[r.const]:e}:n,{})}function S0i(t,e){let n=x0i(t,e);return Kr(n)}function Rcn(t,e){let n=Wv(t),r=_0i(n,e);return Fc(r)?r:S0i(n,e)}var kcn=v(()=>{p();ft();ls();Tu();Gh();PI();Ho();ob();ap();j_e();$N()});function WN(t,e){return Qc(t)?icn(e):$m(t)?ocn(e):rl(t)?fcn(t.enum,e):id(t)?Acn(t,e):Vr(t)?Ecn(t.allOf,e):hs(t)?_cn(t.const,e):lc(t)?Scn(t,e):On(t)?Rcn(t.anyOf,e):zl(t)?Icn(t,e):ua(t)?Tcn(t.pattern,e):Kr({})}var fee=v(()=>{p();qf();QN();Ox();rd();PI();Tu();Gh();Ho();ob();zf();ws();scn();acn();gcn();ycn();bcn();xcn();Ccn();wcn();vcn();kcn()});function V_e(t,e,n){return is([t])?_t.Update(WN(t,e),{},n):gee(t,e,n)}function bXe(t,e,n,r,i){let s=wn(t,e,n),o=wn(t,e,r);return V_e(s,o,i)}var Y_e=v(()=>{p();$n();ap();fee();jr()});function gee(t,e,n={}){return Er("Record",[t,e],n)}function $2(t,e,n={}){return V_e(t,e,n)}function _Xe(t,e){return Kf(t,e)}function Aee(t){return L.IsEqual(t,ab)?Wm():L.IsEqual(t,$v)?UN():L.IsEqual(t,G2)?Yf():U_e(t)}function vu(t){return L.Keys(t.patternProperties)[0]}function Hv(t){let e=vu(t);return Aee(e)}function _a(t){return t.patternProperties[vu(t)]}function Do(t){return ar(t,"Record")}function C0i(t){return _t.Discard(t,["~kind","type","patternProperties"])}var $v,G2,ab,ap=v(()=>{p();$n();ft();ls();PI();Gh();ob();xo();G_e();$N();Y_e();$v=`^${iee}$`,G2=`^${cee}$`,ab=`^${lee}$`});function HN(t){return _t.Create({"~kind":"Rest"},{type:"rest",items:t},{})}function qv(t){return ar(t,"Rest")}var x4=v(()=>{p();$n();ls()});var Bcn=v(()=>{p()});function yee(t){return _t.Create({"~kind":"This"},{$ref:"#"},t)}function Eee(t){return ar(t,"This")}var z_e=v(()=>{p();$n();ls()});function W2(t){return _t.Create({"~kind":"Undefined"},{type:"undefined"},t)}function Yy(t){return ar(t,"Undefined")}var S4=v(()=>{p();$n();ls()});function bee(t){return _t.Create({"~kind":"Void"},{type:"void"},t)}function Jf(t){return ar(t,"Void")}var H2=v(()=>{p();$n();ls()});var _ee=v(()=>{p();WJe();ZZ();DN();nee();VJe();qf();Fh();P2();QN();C4();nb();jf();xo();Ox();rb();jZ();KJe();mA();sb();PI();rd();Tu();sp();A4();Gh();Kp();L2();Ho();eXe();N2();ap();ib();x4();ls();Bcn();ob();L2();zf();z_e();sd();S4();ws();Kp();P_e();H2()});function w0i(t,e){return L.IsEqual(t,"Array")?Lh(e[0]):L.IsEqual(t,"Capitalize")?See(e[0]):L.IsEqual(t,"ConstructorParameters")?vee(e[0]):L.IsEqual(t,"Evaluate")?CXe(e[0]):L.IsEqual(t,"Exclude")?Ree(e[0],e[1]):L.IsEqual(t,"Extract")?kee(e[0],e[1]):L.IsEqual(t,"Index")?v4(e[0],e[1]):L.IsEqual(t,"InstanceType")?Bee(e[0]):L.IsEqual(t,"Lowercase")?Cee(e[0]):L.IsEqual(t,"NonNullable")?Nee(e[0]):L.IsEqual(t,"Omit")?Dee(e[0],e[1]):L.IsEqual(t,"Parameters")?Pee(e[0]):L.IsEqual(t,"Partial")?Mee(e[0]):L.IsEqual(t,"Pick")?Oee(e[0],e[1]):L.IsEqual(t,"Readonly")?Lee(e[0]):L.IsEqual(t,"KeyOf")?R4(e[0]):L.IsEqual(t,"Record")?gee(e[0],e[1]):L.IsEqual(t,"Required")?Fee(e[0]):L.IsEqual(t,"ReturnType")?Qee(e[0]):L.IsEqual(t,"Uncapitalize")?Iee(e[0]):L.IsEqual(t,"Uppercase")?wee(e[0]):T4(Iu(t),e)}function q2(){throw Error("Unreachable")}function Ocn(t,e=[]){return L.ShiftLeft(t,(n,r)=>Ocn(r,[...e,n[1]]),()=>e)}function jv(t){return L.IsEqual(t.length,3)?[t[0],...Ocn(t[1])]:[]}function Lcn(t){return GN(t[0],t[2],t[4])}function Fcn(t){return GN(t[0],t[2],t[2])}function Qcn(t){return GN(t[0],Vl(),t[2])}function Ucn(t){return GN(t,Vl(),Vl())}function Gcn(t){return jv(t)}function $cn(t){return t[1]}function Wcn(t){return jv(t)}function Hcn(t){return t[1]}function qcn(t){return w0i(t[0],t[1])}function jcn(t){return null}function Vcn(t){return Wm()}function Ycn(t){return Yf()}function zcn(t){return ree()}function Kcn(t){return W2()}function Jcn(t){return M2()}function Xcn(t){return UN()}function Zcn(t){return f4()}function eln(t){return Vl()}function tln(t){return B2()}function nln(t){return Kr({})}function rln(t){return Xo()}function iln(t){return O2()}function sln(t){return bee()}function oln(t){return yee()}function aln(t){return us(BigInt(t))}function cln(t){return us(L.IsEqual(t,"true"))}function lln(t){return us(parseFloat(t))}function uln(t){return us(t)}function dln(t){return t[1]}function pln(t){return us(t)}function mln(t){return L.IsEqual(t.length,3)?[t[0],t[1],...t[2]]:[t[0]]}function hln(t){return t[1]}function fln(t){return xee(t)}function gln(t){return L.IsEqual(t.length,6)?PN(t[1],t[3],t[5]):PN(t[1],t[3],Vl())}function Aln(t){return t.length>0}function yln(t){return t.reduce((e,n)=>L.IsEqual(n.length,3)?[...e,[n[1]]]:[...e,[]],[])}function Eln(t){return L.IsEqual(t.length,6)?[t[1],t[3],t[5]]:[]}function bln(t){return L.IsArray(t)&&L.IsEqual(t.length,3)?t[1]:t}function _ln(t){return L.IsEqual(t.length,2)?t[1]:[]}function Ncn(t,e){return e.reduce((n,r)=>{let i=r;return L.IsEqual(i.length,1)?v4(n,i[0]):L.IsEqual(i.length,0)?Lh(n):q2()},t)}function Dcn(t,e){return L.IsEqual(e.length,3)?Tee(t,e[0],e[1],e[2]):t}function T0i(t,e){return L.IsArray(e)&&L.IsEqual(e.length,0)?t:Uee(t,e)}function xln(t){let[e,n,r,i,s]=t;return T0i(Dcn(e?R4(Ncn(n,r)):Ncn(n,r),i),s)}function xXe(t,e){return L.IsEqual(e.length,3)?(()=>{let[n,r,i]=e,s=xXe(r,i);if(L.IsEqual(n,"&"))return Vr(s)?Jp([t,...s.allOf]):Jp([t,s]);if(L.IsEqual(n,"|"))return On(s)?Ri([t,...s.anyOf]):Ri([t,s]);q2()})():t}function Sln(t){let[e,n]=t;return xXe(e,n)}function Cln(t){let[e,n]=t;return xXe(e,n)}function Iln(t){return SXe(t[1])}function wln(t){return t[1]}function Tln(t){return Uv(t[0],t[2])}function vln(t){return L.IsEqual(t.length,4)?a4(t[1],t[3]):L.IsEqual(t.length,2)?a4(t[1],Vl()):q2()}function Rln(t){return`${t}`}function kln(t){return id(t[3])?$v:lc(t[3])?G2:Ux(t[3])?ab:zl(t[3])?ab:q2()}function Bln(t){return t.length>0}function Nln(t){return t.length>0}function Dln(t){let[e,n,r,i,s]=t;return{[n]:e&&r?Fx(Px(s)):e&&!r?Fx(s):!e&&r?Px(s):s}}function Pln(t){return jv(t)}function Mln(t){return t.reduce((e,n)=>L.HasPropertyKey(n,$v)||L.HasPropertyKey(n,G2)||L.HasPropertyKey(n,ab)?[e[0],_t.Assign(e[1],n)]:[_t.Assign(e[0],n),e[1]],[{},{}])}function Oln(t){return Mln(t[1])}function Lln(t){let[e,n]=t,r=L.IsEqual(L.Keys(n).length,0)?{}:{patternProperties:n};return Kr(e,r)}function Fln(t){return L.IsEqual(t.length,5)?Fx(Px(t[4])):L.IsEqual(t.length,3)?t[2]:L.IsEqual(t.length,4)?L.IsEqual(t[2],"readonly")?Fx(t[3]):Px(t[3]):q2()}function Qln(t){if(!L.IsArray(t)||!L.IsEqual(t.length,3))return t;let[e,n,r]=t;return e&&r?Fx(Px(n)):e&&!r?Fx(n):!e&&r?Px(n):n}function Uln(t){return L.IsEqual(t.length,2)?HN(t[1]):L.IsEqual(t.length,1)?t[0]:q2()}function Gln(t){return jv(t)}function $ln(t){return il(t[1])}function Wln(t){return Fx(Px(t[4]))}function Hln(t){return Fx(t[3])}function qln(t){return Px(t[3])}function jln(t){return t[2]}function Vln(t){return L.IsEqual(t.length,2)?HN(t[1]):L.IsEqual(t.length,1)?t[0]:q2()}function Yln(t){return jv(t)}function zln(t){return Dx(t[1],t[4])}function Kln(t){return Nx(t[2],t[5])}function Pcn(t,e){return L.IsEqual(t,"remove")?sXe(e):L.IsEqual(t,"add")?Fx(e):e}function Jln(t){return L.IsEqual(t.length,2)&&L.IsEqual(t[0],"-")?"remove":L.IsEqual(t.length,2)&&L.IsEqual(t[0],"+")||L.IsEqual(t.length,1)?"add":"none"}function Mcn(t,e){return L.IsEqual(t,"remove")?uXe(e):L.IsEqual(t,"add")?Px(e):e}function Xln(t){return L.IsEqual(t.length,2)&&L.IsEqual(t[0],"-")?"remove":L.IsEqual(t.length,2)&&L.IsEqual(t[0],"+")||L.IsEqual(t.length,1)?"add":"none"}function Zln(t){return L.IsEqual(t.length,2)?[t[1]]:[]}function eun(t){return L.IsArray(t[6])&&L.IsEqual(t[6].length,1)?I4(g4(t[3]),t[5],t[6][0],Pcn(t[1],Mcn(t[8],t[10]))):I4(g4(t[3]),t[5],Iu(t[3]),Pcn(t[1],Mcn(t[8],t[10])))}function tun(t){return Iu(t)}function nun(t){return BigInt(t)}function run(t){return parseFloat(t)}function iun(t){return L.IsEqual(t,"true")}function sun(t){return null}function oun(t){return{[t[0]]:t[2]}}function aun(t){return jv(t)}function v0i(t){return t.reduce((e,n)=>_t.Assign(e,n),{})}function cun(t){return v0i(t[1])}function lun(t){return jv(t)}function uun(t){return t[1]}function dun(t){return f4()}function pun(t){return Wm()}function mun(t){return Yf()}function hun(t){return UN()}function fun(t){return Xo()}function gun(t){return us(t)}function Aun(t){return Ri(t[1])}function yun(t){return t.length===3?[...t[0],...t[2]]:t.length===1?[...t[0]]:[]}function Eun(t){return[t[0],...t[1]]}function bun(t){return t[1]}function _un(t){return jv(t)}function xun(t){return L.IsEqual(t.length,2)?t[1]:[]}function Sun(t){let e=t[2],n=t[3],[r,i]=t[4],s=L.IsEqual(L.Keys(i).length,0)?{}:{patternProperties:i};return{[t[1]]:Uv(e,w4(n,r,s))}}function Cun(t){let e=t[2],[n,r]=t[3],i=L.IsEqual(L.Keys(r).length,0)?{}:{patternProperties:r};return{[t[1]]:w4(e,n,i)}}function Iun(t){return{[t[1]]:Uv(t[2],t[4])}}function wun(t){return{[t[1]]:t[3]}}function Tun(t){return null}function vun(t){return jv(t)}function Run(t){return t[1]}function kun(t){let[e,n]=[t[0],t[1]];return IXe(_t.Assign(e,Mln(n)[0]))}var Bun=v(()=>{p();$n();ft();_ee();j2()});var Vv=v(()=>{p();o4()});function Gee(t){return _s(t.length,2)}function ks(t,e,n){return Gee(t)?e(t[0],t[1]):n()}var hA=v(()=>{p();Vv()});function B0i(t,e){return _s(e.indexOf(t),0)?[t,e.slice(t.length)]:[]}function sl(t,e){for(let n=0;n{p();hA();Vv()});function wXe(t,e){return Array.from({length:e-t+1},(n,r)=>String.fromCharCode(t+r))}var Nun,TXe,vXe,k4,Dun,B4,qN,K_e,Pun,J_e,qm=v(()=>{p();Nun=[...wXe(97,122),...wXe(65,90)],TXe="0",vXe=wXe(49,57),k4=[TXe,...vXe],Dun=" ",B4=` +`,qN="_",K_e=".",Pun="$",J_e="-"});function Lun(t){let e=t.indexOf(D0i);return _s(e,-1)?"":t.slice(e+2)}function Fun(t){let e=t.indexOf(B4);return _s(e,-1)?"":t.slice(e)}function P0i(t){return t.replace(/^[ \t\r\f\v]+/,"")}function X_e(t){let e=P0i(t);return e.startsWith(Oun)?X_e(Lun(e.slice(2))):e.startsWith(Mun)?X_e(Fun(e.slice(2))):e}function lp(t){let e=t.trimStart();return e.startsWith(Oun)?lp(Lun(e.slice(2))):e.startsWith(Mun)?lp(Fun(e.slice(2))):e}var Mun,Oun,D0i,OI=v(()=>{p();Vv();qm();Mun="//",Oun="/*",D0i="*/"});function Z_e(t,e){return ks(sl([t],e),(n,r)=>[n,r],()=>["",e])}var RXe=v(()=>{p();hA();MI()});function M0i(t,e){return t.includes(e)}function N4(t,e,n,r=""){return ks(sl(t,n),(i,s)=>M0i(e,i)?N4(t,e,s,r):N4(t,e,s,`${r}${i}`),()=>[r,n])}var kXe=v(()=>{p();hA();MI()});function O0i(t){return sl(vXe,t)}function F0i(t){return N4(L0i,[qN],t)}function Q0i(t){return ks(sl([TXe],t),(e,n)=>[e,n],()=>ks(O0i(t),(e,n)=>ks(F0i(n),(r,i)=>[`${e}${r}`,i],()=>[]),()=>[]))}function exe(t){return Q0i(lp(t))}var L0i,txe=v(()=>{p();hA();OI();MI();kXe();qm();qm();qm();qm();L0i=[...k4,qN]});function U0i(t){return Z_e(J_e,t)}function G0i(t){return ks(U0i(t),(e,n)=>ks(exe(n),(r,i)=>[`${e}${r}`,i],()=>[]),()=>[])}function Qun(t){return G0i(lp(t))}var BXe=v(()=>{p();hA();OI();RXe();qm();txe()});function $0i(t){return ks(Qun(t),(e,n)=>ks(sl(["n"],n),(r,i)=>[`${e}`,i],()=>[]),()=>[])}function NXe(t){return $0i(t)}var Uun=v(()=>{p();hA();MI();BXe()});function DXe(t,e){return sl([t],e)}function qt(t,e){return _s(t,"")?["",e]:t.startsWith(B4)?DXe(t,X_e(e)):t.startsWith(Dun)?DXe(t,e):DXe(t,lp(e))}var Gun=v(()=>{p();Vv();OI();OI();MI();qm();qm()});function W0i(t){return sl($un,t)}function Wun(t,e=""){return ks(sl(H0i,t),(n,r)=>Wun(r,`${e}${n}`),()=>[e,t])}function q0i(t){return ks(W0i(t),(e,n)=>ks(Wun(n),(r,i)=>[`${e}${r}`,i],()=>[]),()=>[])}function Rl(t){return q0i(lp(t))}var $un,H0i,Hun=v(()=>{p();hA();OI();MI();qm();qm();qm();qm();$un=[...Nun,qN,Pun];H0i=[...$un,...k4]});function V0i(t){return Gee(sl([K_e],t))}function qun(t){return ks(N4(j0i,[qN],t),(e,n)=>_s(e,"")?[]:[e,n],()=>[])}function Y0i(t){return ks(sl([K_e],t),(e,n)=>ks(qun(n),(r,i)=>[`0${e}${r}`,i],()=>[]),()=>[])}function z0i(t){return ks(exe(t),(e,n)=>ks(sl([K_e],n),(r,i)=>ks(qun(i),(s,o)=>[`${e}${r}${s}`,o],()=>[`${e}`,i]),()=>[`${e}`,n]),()=>[])}function K0i(t){return V0i(t)?Y0i(t):z0i(t)}function jun(t){return K0i(lp(t))}var j0i,PXe=v(()=>{p();Vv();hA();OI();MI();kXe();qm();qm();txe();j0i=[...k4,qN]});function J0i(t){return Z_e(J_e,t)}function X0i(t){return ks(J0i(t),(e,n)=>ks(jun(n),(r,i)=>[`${e}${r}`,i],()=>[]),()=>[])}function nxe(t){return X0i(lp(t))}var Vun=v(()=>{p();hA();OI();RXe();qm();PXe()});var Yun=v(()=>{p();Vv()});function Z0i(t){return _s(t,"")?[]:[t.slice(0,1),t.slice(1)]}function zun(t,e){return k_e(t,(n,r)=>e.startsWith(n)?!0:zun(r,e),()=>!1)}function jN(t,e,n=""){return ks(Z0i(e),(r,i)=>zun(t,e)?[n,e]:jN(t,i,`${n}${r}`),()=>[])}var rxe=v(()=>{p();hA();Vv()});function ebi(t,e,n){return ks(sl([t],n),(r,i)=>ks(jN([e],i),(s,o)=>ks(sl([e],o),(a,c)=>[`${s}`,c],()=>[]),()=>[]),()=>[])}function tbi(t,e,n){return ks(sl([t],n),(r,i)=>ks(jN([B4,e],i),(s,o)=>ks(sl([e],o),(a,c)=>[`${s}`,c],()=>[]),()=>[]),()=>[])}function Kun(t,e,n,r){return n?ebi(t,e,lp(r)):tbi(t,e,lp(r))}var MXe=v(()=>{p();hA();OI();qm();MI();rxe()});function nbi(t,e){return sl(t,e)}function rbi(t,e){return Kun(t,t,!1,e)}function ibi(t,e){return ks(nbi(t,e),(n,r)=>rbi(n,`${n}${r}`),()=>[])}function ixe(t,e){return ibi(t,lp(e))}var Jun=v(()=>{p();hA();MI();OI();MXe()});function Xun(t,e){return ks(jN(t,e),(n,r)=>_s(n,"")?[]:[n,r],()=>[])}var Zun=v(()=>{p();Vv();hA();rxe()});var edn=v(()=>{p();Uun();Gun();Hun();BXe();Vun();Yun();MXe();Jun();txe();PXe();Zun();rxe()});var fe,obi,abi,cbi,lbi,rdn,idn,ubi,FXe,sdn,dbi,pbi,mbi,odn,adn,cdn,hbi,fbi,gbi,ldn,Abi,ybi,Ebi,bbi,_bi,udn,xbi,Sbi,Cbi,OXe,ddn,QXe,Ibi,wbi,Tbi,vbi,Rbi,kbi,Bbi,pdn,Nbi,Dbi,Pbi,Mbi,mdn,hdn,fdn,gdn,sxe,Obi,Lbi,Fbi,Qbi,ro,Ubi,Gbi,$bi,Wbi,Adn,ydn,Edn,bdn,oxe,_dn,Hbi,UXe,qbi,jbi,tdn,xdn,Sdn,Vbi,Ybi,zbi,Kbi,Jbi,Xbi,ndn,Cdn,Idn,wdn,Zbi,e_i,t_i,n_i,r_i,i_i,s_i,o_i,a_i,c_i,l_i,u_i,d_i,Tdn,vdn,p_i,Rdn,kdn,m_i,h_i,GXe,f_i,g_i,A_i,y_i,E_i,b_i,__i,x_i,Bdn,LXe,$Xe,Jan,Ndn,S_i,Ddn,C_i,I_i,w_i,T_i,v_i,Pdn,Mdn,R_i,WXe,k_i,Odn,L_e=v(()=>{p();Bun();edn();fe=(t,e,n=()=>[])=>t.length===2?e(t):n(),obi=t=>fe(fe(Rl(t),([e,n])=>fe(qt("extends",n),([r,i])=>fe(ro(i),([s,o])=>fe(qt("=",o),([a,c])=>fe(ro(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Lcn(e),n]),abi=t=>fe(fe(Rl(t),([e,n])=>fe(qt("extends",n),([r,i])=>fe(ro(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Fcn(e),n]),cbi=t=>fe(fe(Rl(t),([e,n])=>fe(qt("=",n),([r,i])=>fe(ro(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Qcn(e),n]),lbi=t=>fe(Rl(t),([e,n])=>[Ucn(e),n]),rdn=t=>fe(fe(obi(t),([e,n])=>[e,n],()=>fe(abi(t),([e,n])=>[e,n],()=>fe(cbi(t),([e,n])=>[e,n],()=>fe(lbi(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),idn=(t,e=[])=>fe(fe(qt(",",t),([n,r])=>fe(rdn(r),([i,s])=>[[n,i],s])),([n,r])=>idn(r,[...e,n]),()=>[e,t]),ubi=t=>fe(fe(fe(rdn(t),([e,n])=>fe(idn(n),([r,i])=>fe(fe(qt(",",i),([s,o])=>[[s],o],()=>[[],i]),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Gcn(e),n]),FXe=t=>fe(fe(qt("<",t),([e,n])=>fe(ubi(n),([r,i])=>fe(qt(">",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[$cn(e),n]),sdn=(t,e=[])=>fe(fe(qt(",",t),([n,r])=>fe(ro(r),([i,s])=>[[n,i],s])),([n,r])=>sdn(r,[...e,n]),()=>[e,t]),dbi=t=>fe(fe(fe(ro(t),([e,n])=>fe(sdn(n),([r,i])=>fe(fe(qt(",",i),([s,o])=>[[s],o],()=>[[],i]),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Wcn(e),n]),pbi=t=>fe(fe(qt("<",t),([e,n])=>fe(dbi(n),([r,i])=>fe(qt(">",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Hcn(e),n]),mbi=t=>fe(fe(Rl(t),([e,n])=>fe(pbi(n),([r,i])=>[[e,r],i])),([e,n])=>[qcn(e),n]),odn=t=>fe(fe(fe(qt(";",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[jcn(e),n]),adn=t=>fe(qt("string",t),([e,n])=>[Vcn(e),n]),cdn=t=>fe(qt("number",t),([e,n])=>[Ycn(e),n]),hbi=t=>fe(qt("boolean",t),([e,n])=>[zcn(e),n]),fbi=t=>fe(qt("undefined",t),([e,n])=>[Kcn(e),n]),gbi=t=>fe(qt("null",t),([e,n])=>[Jcn(e),n]),ldn=t=>fe(qt("integer",t),([e,n])=>[Xcn(e),n]),Abi=t=>fe(qt("bigint",t),([e,n])=>[Zcn(e),n]),ybi=t=>fe(qt("unknown",t),([e,n])=>[eln(e),n]),Ebi=t=>fe(qt("any",t),([e,n])=>[tln(e),n]),bbi=t=>fe(qt("object",t),([e,n])=>[nln(e),n]),_bi=t=>fe(qt("never",t),([e,n])=>[rln(e),n]),udn=t=>fe(qt("symbol",t),([e,n])=>[iln(e),n]),xbi=t=>fe(qt("void",t),([e,n])=>[sln(e),n]),Sbi=t=>fe(qt("this",t),([e,n])=>[oln(e),n]),Cbi=t=>fe(fe(qt("${",t),([e,n])=>fe(ro(n),([r,i])=>fe(qt("}",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[dln(e),n]),OXe=t=>fe(jN(["${","`"],t),([e,n])=>[pln(e),n]),ddn=t=>fe(fe(fe(OXe(t),([e,n])=>fe(Cbi(n),([r,i])=>fe(ddn(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe(fe(OXe(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe(fe(OXe(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[]))),([e,n])=>[mln(e),n]),QXe=t=>fe(fe(qt("`",t),([e,n])=>fe(ddn(n),([r,i])=>fe(qt("`",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[hln(e),n]),Ibi=t=>fe(QXe(t),([e,n])=>[fln(e),n]),wbi=t=>fe(fe(fe(qt("if",t),([e,n])=>fe(ro(n),([r,i])=>fe(qt("then",i),([s,o])=>fe(ro(o),([a,c])=>fe(qt("else",c),([u,l])=>fe(ro(l),([d,m])=>[[e,r,s,a,u,d],m])))))),([e,n])=>[e,n],()=>fe(fe(qt("if",t),([e,n])=>fe(ro(n),([r,i])=>fe(qt("then",i),([s,o])=>fe(ro(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[e,n],()=>[])),([e,n])=>[gln(e),n]),Tbi=t=>fe(NXe(t),([e,n])=>[aln(e),n]),vbi=t=>fe(fe(qt("true",t),([e,n])=>[e,n],()=>fe(qt("false",t),([e,n])=>[e,n],()=>[])),([e,n])=>[cln(e),n]),Rbi=t=>fe(nxe(t),([e,n])=>[lln(e),n]),kbi=t=>fe(ixe(["'",'"'],t),([e,n])=>[uln(e),n]),Bbi=t=>fe(fe(fe(qt("keyof",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Aln(e),n]),pdn=(t,e=[])=>fe(fe(fe(qt("[",t),([n,r])=>fe(ro(r),([i,s])=>fe(qt("]",s),([o,a])=>[[n,i,o],a]))),([n,r])=>[n,r],()=>fe(fe(qt("[",t),([n,r])=>fe(qt("]",r),([i,s])=>[[n,i],s])),([n,r])=>[n,r],()=>[])),([n,r])=>pdn(r,[...e,n]),()=>[e,t]),Nbi=t=>fe(pdn(t),([e,n])=>[yln(e),n]),Dbi=t=>fe(fe(fe(qt("extends",t),([e,n])=>fe(ro(n),([r,i])=>fe(qt("?",i),([s,o])=>fe(ro(o),([a,c])=>fe(qt(":",c),([u,l])=>fe(ro(l),([d,m])=>[[e,r,s,a,u,d],m])))))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Eln(e),n]),Pbi=t=>fe(fe(fe(qt("(",t),([e,n])=>fe(ro(n),([r,i])=>fe(qt(")",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe(adn(t),([e,n])=>[e,n],()=>fe(cdn(t),([e,n])=>[e,n],()=>fe(hbi(t),([e,n])=>[e,n],()=>fe(fbi(t),([e,n])=>[e,n],()=>fe(gbi(t),([e,n])=>[e,n],()=>fe(ldn(t),([e,n])=>[e,n],()=>fe(Abi(t),([e,n])=>[e,n],()=>fe(ybi(t),([e,n])=>[e,n],()=>fe(Ebi(t),([e,n])=>[e,n],()=>fe(bbi(t),([e,n])=>[e,n],()=>fe(_bi(t),([e,n])=>[e,n],()=>fe(udn(t),([e,n])=>[e,n],()=>fe(xbi(t),([e,n])=>[e,n],()=>fe(Sbi(t),([e,n])=>[e,n],()=>fe(Tbi(t),([e,n])=>[e,n],()=>fe(vbi(t),([e,n])=>[e,n],()=>fe(Rbi(t),([e,n])=>[e,n],()=>fe(kbi(t),([e,n])=>[e,n],()=>fe(Ibi(t),([e,n])=>[e,n],()=>fe(wbi(t),([e,n])=>[e,n],()=>fe(qbi(t),([e,n])=>[e,n],()=>fe(Ybi(t),([e,n])=>[e,n],()=>fe(e_i(t),([e,n])=>[e,n],()=>fe(Zbi(t),([e,n])=>[e,n],()=>fe(i_i(t),([e,n])=>[e,n],()=>fe(mbi(t),([e,n])=>[e,n],()=>fe(s_i(t),([e,n])=>[e,n],()=>[])))))))))))))))))))))))))))),([e,n])=>[bln(e),n]),Mbi=t=>fe(fe(fe(qt("with",t),([e,n])=>fe(Rdn(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[_ln(e),n]),mdn=t=>fe(fe(Bbi(t),([e,n])=>fe(Pbi(n),([r,i])=>fe(Nbi(i),([s,o])=>fe(Dbi(o),([a,c])=>fe(Mbi(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[xln(e),n]),hdn=t=>fe(fe(fe(qt("&",t),([e,n])=>fe(mdn(n),([r,i])=>fe(hdn(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[e,n]),fdn=t=>fe(fe(mdn(t),([e,n])=>fe(hdn(n),([r,i])=>[[e,r],i])),([e,n])=>[Sln(e),n]),gdn=t=>fe(fe(fe(qt("|",t),([e,n])=>fe(fdn(n),([r,i])=>fe(gdn(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[e,n]),sxe=t=>fe(fe(fdn(t),([e,n])=>fe(gdn(n),([r,i])=>[[e,r],i])),([e,n])=>[Cln(e),n]),Obi=t=>fe(fe(qt("readonly",t),([e,n])=>fe(sxe(n),([r,i])=>[[e,r],i])),([e,n])=>[Iln(e),n]),Lbi=t=>fe(fe(qt("|",t),([e,n])=>fe(sxe(n),([r,i])=>[[e,r],i])),([e,n])=>[wln(e),n]),Fbi=t=>fe(fe(FXe(t),([e,n])=>fe(qt("=",n),([r,i])=>fe(ro(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Tln(e),n]),Qbi=t=>fe(fe(fe(qt("infer",t),([e,n])=>fe(Rl(n),([r,i])=>fe(qt("extends",i),([s,o])=>fe(sxe(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[e,n],()=>fe(fe(qt("infer",t),([e,n])=>fe(Rl(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>[])),([e,n])=>[vln(e),n]),ro=t=>fe(fe(Qbi(t),([e,n])=>[e,n],()=>fe(Lbi(t),([e,n])=>[e,n],()=>fe(Obi(t),([e,n])=>[e,n],()=>fe(sxe(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),Ubi=t=>fe(nxe(t),([e,n])=>[Rln(e),n]),Gbi=t=>fe(Rl(t),([e,n])=>[e,n]),$bi=t=>fe(ixe(["'",'"'],t),([e,n])=>[e,n]),Wbi=t=>fe(fe(qt("[",t),([e,n])=>fe(Rl(n),([r,i])=>fe(qt(":",i),([s,o])=>fe(fe(ldn(o),([a,c])=>[a,c],()=>fe(cdn(o),([a,c])=>[a,c],()=>fe(adn(o),([a,c])=>[a,c],()=>fe(udn(o),([a,c])=>[a,c],()=>[])))),([a,c])=>fe(qt("]",c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[kln(e),n]),Adn=t=>fe(fe(Ubi(t),([e,n])=>[e,n],()=>fe(Gbi(t),([e,n])=>[e,n],()=>fe($bi(t),([e,n])=>[e,n],()=>fe(Wbi(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),ydn=t=>fe(fe(fe(qt("readonly",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Bln(e),n]),Edn=t=>fe(fe(fe(qt("?",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Nln(e),n]),bdn=t=>fe(fe(ydn(t),([e,n])=>fe(Adn(n),([r,i])=>fe(Edn(i),([s,o])=>fe(qt(":",o),([a,c])=>fe(ro(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Dln(e),n]),oxe=t=>fe(fe(fe(qt(",",t),([e,n])=>fe(qt(` +`,n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe(fe(qt(";",t),([e,n])=>fe(qt(` +`,n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe(fe(qt(",",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe(fe(qt(";",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe(fe(qt(` +`,t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[]))))),([e,n])=>[e,n]),_dn=(t,e=[])=>fe(fe(oxe(t),([n,r])=>fe(bdn(r),([i,s])=>[[n,i],s])),([n,r])=>_dn(r,[...e,n]),()=>[e,t]),Hbi=t=>fe(fe(fe(bdn(t),([e,n])=>fe(_dn(n),([r,i])=>fe(fe(oxe(i),([s,o])=>[[s],o],()=>[[],i]),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Pln(e),n]),UXe=t=>fe(fe(qt("{",t),([e,n])=>fe(Hbi(n),([r,i])=>fe(qt("}",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Oln(e),n]),qbi=t=>fe(UXe(t),([e,n])=>[Lln(e),n]),jbi=t=>fe(fe(fe(Rl(t),([e,n])=>fe(qt("?",n),([r,i])=>fe(qt(":",i),([s,o])=>fe(qt("readonly",o),([a,c])=>fe(ro(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[e,n],()=>fe(fe(Rl(t),([e,n])=>fe(qt(":",n),([r,i])=>fe(qt("readonly",i),([s,o])=>fe(ro(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[e,n],()=>fe(fe(Rl(t),([e,n])=>fe(qt("?",n),([r,i])=>fe(qt(":",i),([s,o])=>fe(ro(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[e,n],()=>fe(fe(Rl(t),([e,n])=>fe(qt(":",n),([r,i])=>fe(ro(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>[])))),([e,n])=>[Fln(e),n]),tdn=t=>fe(fe(jbi(t),([e,n])=>[e,n],()=>fe(fe(ydn(t),([e,n])=>fe(ro(n),([r,i])=>fe(Edn(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>[])),([e,n])=>[Qln(e),n]),xdn=t=>fe(fe(fe(qt("...",t),([e,n])=>fe(tdn(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe(fe(tdn(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[])),([e,n])=>[Uln(e),n]),Sdn=(t,e=[])=>fe(fe(qt(",",t),([n,r])=>fe(xdn(r),([i,s])=>[[n,i],s])),([n,r])=>Sdn(r,[...e,n]),()=>[e,t]),Vbi=t=>fe(fe(fe(xdn(t),([e,n])=>fe(Sdn(n),([r,i])=>fe(fe(qt(",",i),([s,o])=>[[s],o],()=>[[],i]),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Gln(e),n]),Ybi=t=>fe(fe(qt("[",t),([e,n])=>fe(Vbi(n),([r,i])=>fe(qt("]",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[$ln(e),n]),zbi=t=>fe(fe(Rl(t),([e,n])=>fe(qt("?",n),([r,i])=>fe(qt(":",i),([s,o])=>fe(qt("readonly",o),([a,c])=>fe(ro(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Wln(e),n]),Kbi=t=>fe(fe(Rl(t),([e,n])=>fe(qt(":",n),([r,i])=>fe(qt("readonly",i),([s,o])=>fe(ro(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[Hln(e),n]),Jbi=t=>fe(fe(Rl(t),([e,n])=>fe(qt("?",n),([r,i])=>fe(qt(":",i),([s,o])=>fe(ro(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[qln(e),n]),Xbi=t=>fe(fe(Rl(t),([e,n])=>fe(qt(":",n),([r,i])=>fe(ro(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[jln(e),n]),ndn=t=>fe(fe(zbi(t),([e,n])=>[e,n],()=>fe(Kbi(t),([e,n])=>[e,n],()=>fe(Jbi(t),([e,n])=>[e,n],()=>fe(Xbi(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),Cdn=t=>fe(fe(fe(qt("...",t),([e,n])=>fe(ndn(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe(fe(ndn(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[])),([e,n])=>[Vln(e),n]),Idn=(t,e=[])=>fe(fe(qt(",",t),([n,r])=>fe(Cdn(r),([i,s])=>[[n,i],s])),([n,r])=>Idn(r,[...e,n]),()=>[e,t]),wdn=t=>fe(fe(fe(Cdn(t),([e,n])=>fe(Idn(n),([r,i])=>fe(fe(qt(",",i),([s,o])=>[[s],o],()=>[[],i]),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Yln(e),n]),Zbi=t=>fe(fe(qt("(",t),([e,n])=>fe(wdn(n),([r,i])=>fe(qt(")",i),([s,o])=>fe(qt("=>",o),([a,c])=>fe(ro(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[zln(e),n]),e_i=t=>fe(fe(qt("new",t),([e,n])=>fe(qt("(",n),([r,i])=>fe(wdn(i),([s,o])=>fe(qt(")",o),([a,c])=>fe(qt("=>",c),([u,l])=>fe(ro(l),([d,m])=>[[e,r,s,a,u,d],m])))))),([e,n])=>[Kln(e),n]),t_i=t=>fe(fe(fe(qt("+",t),([e,n])=>fe(qt("readonly",n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe(fe(qt("-",t),([e,n])=>fe(qt("readonly",n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe(fe(qt("readonly",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])))),([e,n])=>[Jln(e),n]),n_i=t=>fe(fe(fe(qt("+",t),([e,n])=>fe(qt("?",n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe(fe(qt("-",t),([e,n])=>fe(qt("?",n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe(fe(qt("?",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])))),([e,n])=>[Xln(e),n]),r_i=t=>fe(fe(fe(qt("as",t),([e,n])=>fe(ro(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Zln(e),n]),i_i=t=>fe(fe(qt("{",t),([e,n])=>fe(t_i(n),([r,i])=>fe(qt("[",i),([s,o])=>fe(Rl(o),([a,c])=>fe(qt("in",c),([u,l])=>fe(ro(l),([d,m])=>fe(r_i(m),([h,f])=>fe(qt("]",f),([g,A])=>fe(n_i(A),([y,E])=>fe(qt(":",E),([_,S])=>fe(ro(S),([C,I])=>fe(odn(I),([w,k])=>fe(qt("}",k),([N,O])=>[[e,r,s,a,u,d,h,g,y,_,C,w,N],O]))))))))))))),([e,n])=>[eun(e),n]),s_i=t=>fe(Rl(t),([e,n])=>[tun(e),n]),o_i=t=>fe(NXe(t),([e,n])=>[nun(e),n]),a_i=t=>fe(nxe(t),([e,n])=>[run(e),n]),c_i=t=>fe(fe(qt("true",t),([e,n])=>[e,n],()=>fe(qt("false",t),([e,n])=>[e,n],()=>[])),([e,n])=>[iun(e),n]),l_i=t=>fe(ixe(['"',"'"],t),([e,n])=>[e,n]),u_i=t=>fe(qt("null",t),([e,n])=>[sun(e),n]),d_i=t=>fe(qt("undefined",t),([e,n])=>[void 0,n]),Tdn=t=>fe(fe(Adn(t),([e,n])=>fe(qt(":",n),([r,i])=>fe(GXe(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[oun(e),n]),vdn=(t,e=[])=>fe(fe(oxe(t),([n,r])=>fe(Tdn(r),([i,s])=>[[n,i],s])),([n,r])=>vdn(r,[...e,n]),()=>[e,t]),p_i=t=>fe(fe(fe(Tdn(t),([e,n])=>fe(vdn(n),([r,i])=>fe(fe(oxe(i),([s,o])=>[[s],o],()=>[[],i]),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[aun(e),n]),Rdn=t=>fe(fe(qt("{",t),([e,n])=>fe(p_i(n),([r,i])=>fe(qt("}",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[cun(e),n]),kdn=(t,e=[])=>fe(fe(qt(",",t),([n,r])=>fe(GXe(r),([i,s])=>[[n,i],s])),([n,r])=>kdn(r,[...e,n]),()=>[e,t]),m_i=t=>fe(fe(fe(GXe(t),([e,n])=>fe(kdn(n),([r,i])=>fe(fe(qt(",",i),([s,o])=>[[s],o],()=>[[],i]),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[lun(e),n]),h_i=t=>fe(fe(qt("[",t),([e,n])=>fe(m_i(n),([r,i])=>fe(qt("]",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[uun(e),n]),GXe=t=>fe(fe(o_i(t),([e,n])=>[e,n],()=>fe(a_i(t),([e,n])=>[e,n],()=>fe(c_i(t),([e,n])=>[e,n],()=>fe(l_i(t),([e,n])=>[e,n],()=>fe(u_i(t),([e,n])=>[e,n],()=>fe(d_i(t),([e,n])=>[e,n],()=>fe(Rdn(t),([e,n])=>[e,n],()=>fe(h_i(t),([e,n])=>[e,n],()=>[])))))))),([e,n])=>[e,n]),f_i=t=>fe(qt("-?(?:0|[1-9][0-9]*)n",t),([e,n])=>[dun(e),n]),g_i=t=>fe(qt(".*",t),([e,n])=>[pun(e),n]),A_i=t=>fe(qt("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",t),([e,n])=>[mun(e),n]),y_i=t=>fe(qt("-?(?:0|[1-9][0-9]*)",t),([e,n])=>[hun(e),n]),E_i=t=>fe(qt("(?!)",t),([e,n])=>[fun(e),n]),b_i=t=>fe(Xun(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],t),([e,n])=>[gun(e),n]),__i=t=>fe(fe(f_i(t),([e,n])=>[e,n],()=>fe(g_i(t),([e,n])=>[e,n],()=>fe(A_i(t),([e,n])=>[e,n],()=>fe(y_i(t),([e,n])=>[e,n],()=>fe(E_i(t),([e,n])=>[e,n],()=>fe(x_i(t),([e,n])=>[e,n],()=>fe(b_i(t),([e,n])=>[e,n],()=>[]))))))),([e,n])=>[e,n]),x_i=t=>fe(fe(qt("(",t),([e,n])=>fe($Xe(n),([r,i])=>fe(qt(")",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Aun(e),n]),Bdn=t=>fe(fe(fe(LXe(t),([e,n])=>fe(qt("|",n),([r,i])=>fe(Bdn(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe(fe(LXe(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[]))),([e,n])=>[yun(e),n]),LXe=t=>fe(fe(__i(t),([e,n])=>fe($Xe(n),([r,i])=>[[e,r],i])),([e,n])=>[Eun(e),n]),$Xe=t=>fe(fe(Bdn(t),([e,n])=>[e,n],()=>fe(LXe(t),([e,n])=>[e,n],()=>[])),([e,n])=>[e,n]),Jan=t=>fe(fe(qt("^",t),([e,n])=>fe($Xe(n),([r,i])=>fe(qt("$",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[bun(e),n]),Ndn=(t,e=[])=>fe(fe(qt(",",t),([n,r])=>fe(ro(r),([i,s])=>[[n,i],s])),([n,r])=>Ndn(r,[...e,n]),()=>[e,t]),S_i=t=>fe(fe(fe(ro(t),([e,n])=>fe(Ndn(n),([r,i])=>fe(fe(qt(",",i),([s,o])=>[[s],o],()=>[[],i]),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[_un(e),n]),Ddn=t=>fe(fe(fe(qt("extends",t),([e,n])=>fe(S_i(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[xun(e),n]),C_i=t=>fe(fe(qt("interface",t),([e,n])=>fe(Rl(n),([r,i])=>fe(FXe(i),([s,o])=>fe(Ddn(o),([a,c])=>fe(UXe(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Sun(e),n]),I_i=t=>fe(fe(qt("interface",t),([e,n])=>fe(Rl(n),([r,i])=>fe(Ddn(i),([s,o])=>fe(UXe(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[Cun(e),n]),w_i=t=>fe(fe(qt("type",t),([e,n])=>fe(Rl(n),([r,i])=>fe(FXe(i),([s,o])=>fe(qt("=",o),([a,c])=>fe(ro(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Iun(e),n]),T_i=t=>fe(fe(qt("type",t),([e,n])=>fe(Rl(n),([r,i])=>fe(qt("=",i),([s,o])=>fe(ro(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[wun(e),n]),v_i=t=>fe(fe(fe(qt("export",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Tun(e),n]),Pdn=t=>fe(fe(fe(qt(";",t),([e,n])=>fe(qt(` +`,n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>fe(fe(qt(";",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>fe(fe(qt(` +`,t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[]))),([e,n])=>[e,n]),Mdn=(t,e=[])=>fe(fe(Pdn(t),([n,r])=>fe(WXe(r),([i,s])=>[[n,i],s])),([n,r])=>Mdn(r,[...e,n]),()=>[e,t]),R_i=t=>fe(fe(fe(WXe(t),([e,n])=>fe(Mdn(n),([r,i])=>fe(fe(Pdn(i),([s,o])=>[[s],o],()=>[[],i]),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>fe([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[vun(e),n]),WXe=t=>fe(fe(v_i(t),([e,n])=>fe(fe(C_i(n),([r,i])=>[r,i],()=>fe(I_i(n),([r,i])=>[r,i],()=>fe(w_i(n),([r,i])=>[r,i],()=>fe(T_i(n),([r,i])=>[r,i],()=>[])))),([r,i])=>fe(odn(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Run(e),n]),k_i=t=>fe(fe(WXe(t),([e,n])=>fe(R_i(n),([r,i])=>[[e,r],i])),([e,n])=>[kun(e),n]),Odn=t=>fe(fe(k_i(t),([e,n])=>[e,n],()=>fe(Fbi(t),([e,n])=>[e,n],()=>fe(ro(t),([e,n])=>[e,n],()=>[]))),([e,n])=>[e,n])});function HXe(t){let e=QXe(`\`${t}\``);return L.IsEqual(e.length,2)?e[0]:vl()}var qXe=v(()=>{p();Lx();ft();L_e()});function N_i(t){return t.join("|")}function D_i(t){return t.slice(1,t.length-1)}function P_i(t,e,n){return VN(e,`${n}${t}`)}function M_i(t,e){return VN(t,`${e}${YJe}`)}function O_i(t,e){return VN(t,`${e}${iee}`)}function L_i(t,e){return VN(t,`${e}${cee}`)}function F_i(t,e){return $ee(Ri([us("false"),us("true")]),t,e)}function Q_i(t,e){return VN(t,`${e}${lee}`)}function U_i(t,e,n){return VN(e,`${n}${D_i(t)}`)}function G_i(t,e,n){let r=Wee(t,{});return $ee(r,e,n)}function $_i(t,e,n){let r=Hm(t);return $ee(r,e,n)}function Ldn(t,e,n,r=[]){return L.ShiftLeft(t,(i,s)=>Ldn(s,e,n,[...r,$ee(i,[],"")]),()=>VN(e,`${n}(${N_i(r)})`))}function $ee(t,e,n){return rl(t)?$_i(t.enum,e,n):id(t)?O_i(e,n):hs(t)?P_i(t.const,e,n):Vf(t)?M_i(e,n):$m(t)?F_i(e,n):lc(t)?L_i(e,n):zl(t)?Q_i(e,n):ua(t)?U_i(t.pattern,e,n):YXe(t)?G_i(t.parameters[0],e,n):On(t)?Ldn(t.anyOf,e,n):SJe}function VN(t,e){return L.ShiftLeft(t,(n,r)=>$ee(n,r,e),()=>e)}function W_i(t){return`^${VN(t,"")}$`}function jXe(t){let e=W_i(t);return pee(e)}var VXe=v(()=>{p();ft();Ox();Tu();ws();zf();P2();ob();Gh();PI();QN();sp();Q_e();fs();axe()});function Wee(t,e){return is(t)?_t.Update(jXe(t),{},e):xee(t,e)}function Fdn(t,e,n,r){let i=zy(t,e,n);return Wee(i,r)}var axe=v(()=>{p();$n();zf();VXe();jr()});function xee(t,e={}){return Er("TemplateLiteral",[t],e)}function YXe(t){return Fc(t)&&L.HasPropertyKey(t,"action")&&L.IsEqual(t.action,"TemplateLiteral")}function zXe(t){return Wee(t,{})}function Qdn(t){let e=HXe(t);return zXe(e)}function KXe(t,e={}){let n=L.IsString(t)?Qdn(t):zXe(t);return _t.Update(n,{},e)}function ua(t){return ar(t,"TemplateLiteral")}var zf=v(()=>{p();u4();ft();ls();xo();qXe();axe()});var Ci={};br(Ci,{ExtendsFalse:()=>$i,ExtendsTrue:()=>Xn,ExtendsUnion:()=>JXe,IsExtendsFalse:()=>H_i,IsExtendsTrue:()=>Gdn,IsExtendsTrueLike:()=>D4,IsExtendsUnion:()=>Udn,Match:()=>dc});function JXe(t){return _t.Create({"~kind":"ExtendsUnion"},{inferred:t})}function Udn(t){return L.IsObject(t)&&L.HasPropertyKey(t,"~kind")&&L.HasPropertyKey(t,"inferred")&&L.IsEqual(t["~kind"],"ExtendsUnion")&&L.IsObject(t.inferred)}function Xn(t){return _t.Create({"~kind":"ExtendsTrue"},{inferred:t})}function Gdn(t){return L.IsObject(t)&&L.HasPropertyKey(t,"~kind")&&L.HasPropertyKey(t,"inferred")&&L.IsEqual(t["~kind"],"ExtendsTrue")&&L.IsObject(t.inferred)}function $i(){return _t.Create({"~kind":"ExtendsFalse"},{})}function H_i(t){return L.IsObject(t)&&L.HasPropertyKey(t,"~kind")&&L.IsEqual(t["~kind"],"ExtendsFalse")}function D4(t){return Udn(t)||Gdn(t)}function dc(t,e,n){return D4(t)?e(t.inferred):n()}var Ya=v(()=>{p();ft();$n()});function q_i(t,e,n,r){return dc(js(t,n,r),i=>Xn(_t.Assign(_t.Assign(t,i),{[e]:n})),()=>$i())}function j_i(t,e){return Xn(t)}function V_i(t,e,n,r,i){return dc(js(t,e,n),s=>dc(js(s,e,r),o=>Xn(o),()=>$i()),()=>dc(js(t,e,i),s=>Xn(s),()=>$i()))}function Y_i(t,e,n){let r=Hm(n);return js(t,e,r)}function $dn(t,e,n){return L.ShiftLeft(n,(r,i)=>dc(js(t,e,r),s=>$dn(s,e,i),()=>$i()),()=>Xn(t))}function z_i(t,e,n){let r=Xp(n);return js(t,e,r)}function Wdn(t,e,n){return L.ShiftLeft(n,(r,i)=>dc(js(t,e,r),s=>Xn(s),()=>Wdn(t,e,i)),()=>$i())}function Po(t,e,n){return Qc(n)?j_i(t,e):nl(n)?V_i(t,e,n.if,n.then,n.else):rl(n)?Y_i(t,e,n.enum):Tl(n)?q_i(t,n.name,e,n.extends):Vr(n)?$dn(t,e,n.allOf):ua(n)?z_i(t,e,n.pattern):On(n)?Wdn(t,e,n.anyOf):wl(n)?Xn(t):$i()}var jm=v(()=>{p();ft();$n();qf();mA();Ox();sb();rd();zf();ws();Kp();Xf();Ya();fs();fs()});function Hdn(t,e,n){return Tl(n)?Po(t,e,n):Qc(n)?Xn(t):wl(n)?Xn(t):JXe(t)}var qdn=v(()=>{p();sb();qf();Kp();jm();Ya()});function K_i(t,e){let n=ON(t),r=ON(e);return n&&r||!n&&r?!0:!(n&&!r)}function jdn(t,e,n,r){return xs(r)?K_i(e,r)?js(t,n,r.items):$i():Po(t,e,r)}var Vdn=v(()=>{p();Fh();ZZ();jm();Xf();Ya()});function Ydn(t,e,n){return Vf(n)?Xn(t):Po(t,e,n)}var zdn=v(()=>{p();P2();jm();Ya()});function Kdn(t,e,n){return $m(n)?Xn(t):Po(t,e,n)}var Jdn=v(()=>{p();QN();jm();Ya()});function J_i(t,e,n,r,i){let s=Tl(r)?e:r,o=Tl(r)?r:e,a=wu(e),c=wu(r);return!a&&c?$i():dc(js(t,s,o),u=>Hee(u,n,i),()=>$i())}function X_i(t,e,n,r){return L.ShiftLeft(r,(i,s)=>J_i(t,e,n,i,s),()=>wu(e)?Xn(t):$i())}function Z_i(t,e,n){return L.ShiftLeft(e,(r,i)=>X_i(t,r,i,n),()=>Xn(t))}function Hee(t,e,n){return Z_i(t,e,n)}var XXe=v(()=>{p();ft();sb();DN();Xf();Ya()});function cxe(t,e,n){return Jf(n)?Xn(t):js(t,e,n)}var ZXe=v(()=>{p();H2();Xf();Ya()});function Xdn(t,e,n,r){return Qc(r)?Xn(t):wl(r)?Xn(t):el(r)?dc(Hee(t,e,r.parameters),i=>cxe(i,n,r.instanceType),()=>$i()):$i()}var Zdn=v(()=>{p();qf();nb();Kp();Ya();XXe();ZXe()});function epn(t,e,n,r,i){return dc(js(t,e,i),()=>js(t,n,i),()=>js(t,r,i))}var tpn=v(()=>{p();Xf();Ya()});function npn(t,e,n){let r=Hm(e);return js(t,r,n)}var rpn=v(()=>{p();Xf();fs()});function ipn(t,e,n,r){return Qc(r)?Xn(t):wl(r)?Xn(t):tl(r)?dc(Hee(t,e,r.parameters),i=>cxe(i,n,r.returnType),()=>$i()):$i()}var spn=v(()=>{p();qf();rb();Kp();Ya();XXe();ZXe()});function opn(t,e,n){return id(n)?Xn(t):lc(n)?Xn(t):Po(t,e,n)}var apn=v(()=>{p();PI();Gh();jm();Ya()});function cpn(t,e,n){let r=uc(e);return js(t,r,n)}var lpn=v(()=>{p();Xf();P4()});function lxe(t,e,n){return e===n?Xn(t):$i()}function exi(t,e,n){return hs(n)?lxe(t,e,n.const):Vf(n)?Xn(t):Po(t,us(e),n)}function txi(t,e,n){return hs(n)?lxe(t,e,n.const):$m(n)?Xn(t):Po(t,us(e),n)}function nxi(t,e,n){return hs(n)?lxe(t,e,n.const):lc(n)?Xn(t):Po(t,us(e),n)}function rxi(t,e,n){return hs(n)?lxe(t,e,n.const):zl(n)?Xn(t):Po(t,us(e),n)}function upn(t,e,n){return L.IsBigInt(e.const)?exi(t,e.const,n):L.IsBoolean(e.const)?txi(t,e.const,n):L.IsNumber(e.const)?nxi(t,e.const,n):L.IsString(e.const)?rxi(t,e.const,n):vl()}var dpn=v(()=>{p();ft();OJe();Tu();P2();QN();Gh();ob();jm();Ya()});function ppn(t,e,n){return Tl(n)?Po(t,e,n):Xn(t)}var mpn=v(()=>{p();sb();jm();Ya()});function hpn(t,e,n){return Qx(n)?Xn(t):Po(t,e,n)}var fpn=v(()=>{p();A4();jm();Ya()});function gpn(t,e,n){return lc(n)?Xn(t):Po(t,e,n)}var Apn=v(()=>{p();Gh();jm();Ya()});function ixi(t,e,n){return wu(e)?wu(n)?Xn(t):$i():Xn(t)}function sxi(t,e,n){return Tl(n)&&Qh(n.extends)?$i():dc(js(t,e,n),r=>ixi(r,e,n),()=>$i())}function oxi(t,e){return t.reduce((n,r)=>r in e?D4(e[r])?{...n,...e[r].inferred}:vl():vl(),{})}function axi(t,e,n){let r={};for(let o of L.Keys(n))r[o]=o in e?sxi({},e[o],n[o]):wu(n[o])?Tl(n[o])?Xn(_t.Assign(t,{[n[o].name]:n[o].extends})):Xn(t):$i();let i=L.Values(r).every(o=>D4(o)),s=i?oxi(L.Keys(r),r):{};return i?Xn(s):$i()}function cxi(t,e,n){let r=axi(t,e,n);return D4(r)?Xn(_t.Assign(t,r.inferred)):$i()}function lxi(t,e,n){return cxi(t,e,n)}function uxi(t,e){return L.Keys(e).reduce((n,r)=>({...n,[r]:L.HasPropertyKey(t,r)?On(n[r])?Ri([...n[r].anyOf,e[r]]):Ri([t[r],e[r]]):e[r]}),t)}function ypn(t,e,n,r){return L.ShiftLeft(e,(i,s)=>dc(js({},t[i],n),o=>ypn(t,s,n,uxi(r,o)),()=>$i()),()=>Xn(r))}function dxi(t,e,n,r){let i=L.Keys(e);return ypn(e,i,r,t)}function Epn(t,e,n){return Do(n)?dxi(t,e,vu(n),_a(n)):Jr(n)?lxi(t,e,n.properties):Po(t,Kr(e),n)}var bpn=v(()=>{p();Lx();$n();ft();DN();sb();sp();Ho();ap();ws();Xf();jm();Ya()});function pxi(t,e){return L.IsEqual(L.Keys(e).length,0)?Xn(t):$i()}function mxi(t,e,n,r,i){return js(t,n,i)}function _pn(t,e,n,r){return Do(r)?mxi(t,Aee(e),n,Aee(vu(r)),_a(r)):Jr(r)?pxi(t,r.properties):Qc(r)?Xn(t):wl(r)?Xn(t):$i()}var xpn=v(()=>{p();ft();qf();Kp();Ho();ap();Xf();Ya()});function Spn(t,e,n){return zl(n)?Xn(t):Po(t,e,n)}var Cpn=v(()=>{p();ob();jm();Ya()});function Ipn(t,e,n){return Ux(n)?Xn(t):Po(t,e,n)}var wpn=v(()=>{p();L2();jm();Ya()});function Tpn(t,e,n){let r=Xp(e);return js(t,r,n)}var vpn=v(()=>{p();Xf();fs()});function eZe(t,e){return _t.Create({"~kind":"Inferrable"},{name:t,type:e},{})}function qee(t){return L.IsObject(t)&&L.HasPropertyKey(t,"~kind")&&L.HasPropertyKey(t,"name")&&L.HasPropertyKey(t,"type")&&L.IsEqual(t["~kind"],"Inferrable")&&L.IsString(t.name)&&L.IsObject(t.type)}function tZe(t){return qv(t)?Tl(t.items)?xs(t.items.extends)?eZe(t.items.name,t.items.extends.items):wl(t.items.extends)?eZe(t.items.name,t.items.extends):void 0:vl():void 0}function uxe(t){return Tl(t)?eZe(t.name,t.extends):void 0}function nZe(t,e,n=[]){return L.ShiftLeft(t,(r,i)=>dc(js({},r,e),()=>nZe(i,e,[...n,r]),()=>{}),()=>n)}function Rpn(t,e,n,r){let i=nZe(n,r);return L.IsArray(i)?Xn(_t.Assign(t,{[e]:il(i)})):$i()}function dxe(t,e,n,r){let i=nZe(n,r);return L.IsArray(i)?Xn(_t.Assign(t,{[e]:Ri(i)})):$i()}var rZe=v(()=>{p();Lx();$n();ft();Fh();Kp();sd();Xf();ws();sb();x4();Ya()});function hxi(t){return[...t].reverse()}function iZe(t,e){return e?hxi(t):t}function fxi(t){let e=t.length>0?t[0]:void 0,n=Fc(e)?tZe(e):void 0;return Fc(n)}function gxi(t,e,n,r,i,s){return dc(js(t,n,i),o=>kpn(o,e,r,s),()=>$i())}function Axi(t,e,n,r,i){let s=tZe(r);return qee(s)?Rpn(t,s.name,iZe(n,e),s.type):L.ShiftLeft(n,(o,a)=>gxi(t,e,o,a,r,i),()=>$i())}function yxi(t,e,n,r){return L.ShiftLeft(r,(i,s)=>Axi(t,e,n,i,s),()=>L.IsEqual(n.length,0)?Xn(t):$i())}function kpn(t,e,n,r){return yxi(t,e,n,r)}function Exi(t,e,n){let r=YN(t,za([],[]),n),i=fxi(r);return kpn(t,i,iZe(e,i),iZe(r,i))}function Bpn(t,e,n){let r=uxe(n);return qee(r)?dxe(t,r.name,e,r.type):L.ShiftLeft(e,(i,s)=>dc(js(t,i,n),o=>Bpn(o,s,n),()=>$i()),()=>Xn(t))}function Npn(t,e,n){let r=YN(t,za([],[]),e);return rs(n)?Exi(t,r,n.items):xs(n)?Bpn(t,r,n.items):Po(t,il(r),n)}var Dpn=v(()=>{p();ft();ls();Fh();sd();Xf();jm();Ya();jr();jr();rZe()});function Ppn(t,e,n){return Jf(n)?Xn(t):Yy(n)?Xn(t):Po(t,e,n)}var Mpn=v(()=>{p();S4();H2();jm();Ya()});function Opn(t,e,n){return L.ShiftLeft(n,(r,i)=>dc(js(t,e,r),s=>Xn(s),()=>Opn(t,e,i)),()=>$i())}function sZe(t,e,n){return L.ShiftLeft(e,(r,i)=>dc(Opn(t,r,n),s=>sZe(s,i,n),()=>$i()),()=>Xn(t))}function Lpn(t,e,n){let r=uxe(n);return qee(r)?dxe(t,r.name,e,r.type):On(n)?sZe(t,e,n.anyOf):sZe(t,e,[n])}var Fpn=v(()=>{p();ft();ws();Xf();Ya();rZe()});function Qpn(t,e,n){return Tl(n)?Po(t,e,n):Qc(n)?Xn(t):wl(n)?Xn(t):$i()}var Upn=v(()=>{p();qf();Kp();sb();jm();Ya()});function Gpn(t,e,n){return Jf(n)?Xn(t):Po(t,e,n)}var $pn=v(()=>{p();H2();jm();Ya()});function js(t,e,n){return Qc(e)?Hdn(t,e,n):xs(e)?jdn(t,e,e.items,n):Vf(e)?Ydn(t,e,n):$m(e)?Kdn(t,e,n):el(e)?Xdn(t,e.parameters,e.instanceType,n):nl(e)?epn(t,e.if,e.then,e.else,n):rl(e)?npn(t,e.enum,n):tl(e)?ipn(t,e.parameters,e.returnType,n):id(e)?opn(t,e,n):Vr(e)?cpn(t,e.allOf,n):hs(e)?upn(t,e,n):Qh(e)?ppn(t,e,n):Qx(e)?hpn(t,e,n):lc(e)?gpn(t,e,n):Jr(e)?Epn(t,e.properties,n):Do(e)?_pn(t,vu(e),_a(e),n):zl(e)?Spn(t,e,n):Ux(e)?Ipn(t,e,n):ua(e)?Tpn(t,e.pattern,n):rs(e)?Npn(t,e.items,n):Yy(e)?Ppn(t,e,n):On(e)?Lpn(t,e.anyOf,n):wl(e)?Qpn(t,e,n):Jf(e)?Gpn(t,e,n):$i()}var Xf=v(()=>{p();qdn();Vdn();zdn();Jdn();Zdn();tpn();rpn();spn();apn();lpn();dpn();mpn();fpn();Apn();bpn();xpn();Cpn();wpn();vpn();Dpn();Mpn();Fpn();Upn();$pn();qf();Fh();P2();QN();nb();mA();Ox();rb();PI();rd();Tu();sp();A4();Gh();Ho();ap();ob();L2();zf();sd();S4();Kp();ws();H2();Ya()});function bxi(t,e){return uc([...t,Kr(e)])}function pxe(t,e,n){return is(t)?_t.Update(bxi(t,e),{},n):w4(t,e,n)}function oZe(t,e,n,r,i){let s=zy(t,e,n),o=jee(t,e,r);return pxe(s,o,i)}var mxe=v(()=>{p();$n();Ho();fs();j2();jr();jr();jr()});function w4(t,e,n={}){return Er("Interface",[t,e],n)}function V2(t){return Fc(t)&&L.HasPropertyKey(t,"action")&&L.IsEqual(t.action,"Interface")}function aZe(t,e,n={}){return pxe(t,e,n)}var Vee=v(()=>{p();ft();ls();xo();mxe()});function _xi(t,e,n){return t.includes(n)?!0:Yee([...t,n],e,e[n])}function Wpn(t,e,n){let r=zZ(n);return Y2(t,e,r)}function Y2(t,e,n){return L.ShiftLeft(n,(r,i)=>Yee(t,e,r)?!0:Y2(t,e,i),()=>!1)}function Yee(t,e,n){return uo(n)?_xi(t,e,n.$ref):xs(n)?Yee(t,e,n.items):el(n)?Y2(t,e,[...n.parameters,n.instanceType]):tl(n)?Y2(t,e,[...n.parameters,n.returnType]):V2(n)?Wpn(t,e,n.parameters[1]):Vr(n)?Y2(t,e,n.allOf):Jr(n)?Wpn(t,e,n.properties):On(n)?Y2(t,e,n.anyOf):rs(n)?Y2(t,e,n.items):Do(n)?Yee(t,e,_a(n)):!1}function cZe(t,e,n){return Yee(t,e,n)}var lZe=v(()=>{p();ft();Fh();nb();rb();rd();Ho();N2();ap();sd();ws();ib();Vee()});function xxi(t,e){return e.reduce((n,r)=>cZe([r],t,t[r])?[...n,r]:n,[])}function uZe(t){let e=YZ(t);return xxi(t,e)}var dZe=v(()=>{p();N2();lZe()});function Sxi(t,e,n){return n.includes(e)?n:e in t?zee(t,t[e],[...n,e]):vl()}function Hpn(t,e,n){let r=zZ(e);return M4(t,r,n)}function M4(t,e,n){return e.reduce((r,i)=>zee(t,i,r),n)}function zee(t,e,n){return uo(e)?Sxi(t,e.$ref,n):xs(e)?zee(t,e.items,n):el(e)?M4(t,[...e.parameters,e.instanceType],n):tl(e)?M4(t,[...e.parameters,e.returnType],n):V2(e)?Hpn(t,e.parameters[1],n):Vr(e)?M4(t,e.allOf,n):Jr(e)?Hpn(t,e.properties,n):On(e)?M4(t,e.anyOf,n):rs(e)?M4(t,e.items,n):Do(e)?zee(t,_a(e),n):n}function pZe(t,e,n){return zee(t,n,[e])}var mZe=v(()=>{p();Lx();Fh();nb();rb();rd();Ho();N2();ap();sd();ws();ib();Vee()});function Cxi(t){return B2()}function Ixi(t){return L.Keys(t).reduce((e,n)=>({...e,[n]:z2(t[n])}),{})}function Kee(t){return t.reduce((e,n)=>[...e,z2(n)],[])}function z2(t){return uo(t)?Cxi(t.$ref):xs(t)?Lh(z2(t.items),R2(t)):el(t)?Nx(Kee(t.parameters),z2(t.instanceType)):tl(t)?Dx(Kee(t.parameters),z2(t.returnType)):Vr(t)?Jp(Kee(t.allOf)):Jr(t)?Kr(Ixi(t.properties)):Do(t)?$2(Hv(t),z2(_a(t))):On(t)?Ri(Kee(t.anyOf)):rs(t)?il(Kee(t.items)):t}function wxi(t,e){return e in t?z2(t[e]):Vl()}function hZe(t){return wxi(t.$defs,t.$ref)}var qpn=v(()=>{p();ft();qf();Fh();nb();rb();rd();Ho();ap();ib();sd();ws();Kp()});function Txi(t,e,n){let r=zy(t,za([],[]),e),i=jee({},za([],[]),n);return uc([...r,Kr(i)])}function vxi(t,e){return L.Keys(t).filter(r=>e.includes(r)).reduce((r,i)=>{let s=t[i],o=V2(s)?Txi(t,s.parameters[0],s.parameters[1]):s;return{...r,[i]:o}},{})}function fZe(t,e,n){let r=pZe(t,e,n),i=vxi(t,r);return Mx(i,e)}var gZe=v(()=>{p();ft();jf();Ho();mZe();j2();jr();jr();jr();fs()});function jpn(t,e){return e in t?uo(t[e])?jpn(t,t[e].$ref):t[e]:Xo()}function $x(t,e){return jpn(t,e)}var K2=v(()=>{p();sp();ib()});var AZe=v(()=>{p();dZe();lZe();mZe();qpn();gZe();K2()});function Vpn(t){return la(t)?hZe(t):KZ(t)?Vl():t}function cp(t,e,n){let r=Vpn(e),i=Vpn(n);return js(t,r,i)}var Ypn=v(()=>{p();jf();Kp();P_e();Xf();AZe()});var Gx=v(()=>{p();Ypn();Ya()});function U2(t,e){let n=[cp({},t,e),cp({},e,t)];return Ci.IsExtendsTrueLike(n[0])&&Ci.IsExtendsTrueLike(n[1])?y4:Ci.IsExtendsTrueLike(n[0])&&Ci.IsExtendsFalse(n[1])?E4:Ci.IsExtendsFalse(n[0])&&Ci.IsExtendsTrueLike(n[1])?b4:O4}var y4,O4,E4,b4,hee=v(()=>{p();Gx();y4=0,O4=1,E4=2,b4=3});function yZe(t,e,n=[],r=e){return L.ShiftLeft(e,(i,s)=>{let o=U2(t,i);return L.IsEqual(o,E4)||L.IsEqual(o,y4)?r:L.IsEqual(o,O4)?yZe(t,s,[...n,i],r):yZe(t,s,n,r)},()=>[...n,t])}function Rxi(t,e,n){let r=Vy(t);return Qc(r)?[r]:wl(r)?[r]:Qh(r)?hxe(e,n):Jr(r)?hxe(e,[...n,r]):hxe(e,yZe(r,n))}function hxe(t,e=[]){return L.ShiftLeft(t,(n,r)=>Rxi(n,r,e),()=>e)}function q_e(t){let e=hxe(t);return Wv(e)}var EXe=v(()=>{p();ft();qf();sp();Ho();Kp();hee();j_e();fs()});function fxe(t,e){return _t.Update(Vy(t),{},e)}function EZe(t,e,n,r){let i=wn(t,e,n);return fxe(i,r)}var gxe=v(()=>{p();$n();jr();fs()});var P4=v(()=>{p();EXe();hee();hXe();AXe();fs();j_e();gxe();gXe()});function Jee(t,e=[]){return Qv(t)&&L.IsEqual(t.action,"Conditional")?uo(t.parameters[0])?Jee(t.parameters[2],Jee(t.parameters[3],[...e,t.parameters[0].$ref])):Jee(t.parameters[2],Jee(t.parameters[3],e)):Qv(t)&&L.IsEqual(t.action,"Mapped")&&Qv(t.parameters[1])&&L.IsEqual(t.parameters[1].action,"KeyOf")&&uo(t.parameters[1].parameters[0])?[...e,t.parameters[1].parameters[0].$ref]:e}function kxi(t,e){return t.reduce((n,r)=>[...n,e.includes(r.name)],[])}function Jpn(t,e,n=[]){return L.ShiftLeft(t,(r,i)=>L.ShiftLeft(e,(s,o)=>Jpn(i,o,[...n,[s,r]]),()=>n),()=>n)}function Bxi(t){return ua(t)?Xp(t.pattern):rl(t)?Hm(t.enum):t}function Nxi(t){let e=Bxi(t);return On(e)?[...e.anyOf]:[e]}function Dxi(t,e){return t.reduce((n,r)=>[...n,[...r,e]],[])}function zpn(t,e){return e.reduce((n,r)=>[...n,...Dxi(t,r)],[])}function Kpn(t){return t.reduce((e,n)=>L.IsEqual(n[0],!0)?zpn(e,Nxi(n[1])):zpn(e,[n[1]]),[[]])}function Xpn(t,e,n){let r=Jee(n),i=kxi(t,r),s=Jpn(e,i);return Qv(n)&&L.IsEqual(n.action,"Conditional")||Qv(n)&&L.IsEqual(n.action,"Mapped")?Kpn(s):[e]}var Zpn=v(()=>{p();ft();ws();xo();Ox();zf();ib();fs();fs()});function Pxi(){return["(not-resolvable)",Xo()]}function Mxi(){return["(not-generic)",Xo()]}function Oxi(t,e,n){return[t,Uv(e,n)]}function Lxi(t,e,n){return e in t?emn(t,e,t[e],n):Pxi()}function emn(t,e,n,r){return k2(n)?Oxi(e,n.parameters,n.expression):uo(n)?Lxi(t,n.$ref,r):Mxi()}function tmn(t,e,n){return emn(t,"(anonymous)",e,n)}var nmn=v(()=>{p();jZ();ib();sp()});function Fxi(t,e,n){if(Tl(e)||J2(e)||Ci.IsExtendsTrueLike(cp({},e,n)))return;let r={parameter:t,expect:n,actual:e};throw new Error(`Argument for parameter ${t} does not satisfy constraint`,{cause:r})}function rmn(t,e,n,r,i){let s=wn(t,e,i);return Fxi(n,s,r),_t.Assign(t,{[n]:s})}function Qxi(t,e,n,r,i){let s=wn(t,e,n.extends),o=wn(t,e,n.equals);return L.ShiftLeft(i,(a,c)=>bZe(rmn(t,e,n.name,s,a),e,r,c),()=>bZe(rmn(t,e,n.name,s,o),e,r,[]))}function bZe(t,e,n,r){return L.ShiftLeft(n,(i,s)=>Qxi(t,e,i,s,r),()=>t)}function imn(t,e,n,r){return bZe(t,e,n,r)}var smn=v(()=>{p();ft();$n();jr();Gx();sb();C4()});function Uxi(){if(!L.IsLessThan(xZe,Lc.Get().maxInstantiationCount))throw Error("Type instantiation is excessively deep and possibly infinite")}function Gxi(){Uxi(),xZe++,_Ze++}function $xi(){_Ze--,L.IsEqual(_Ze,0)&&(xZe=0)}function Wxi(t){return L.IsGreaterThan(t.callstack.length,0)?t.callstack[t.callstack.length-1]:""}function Hxi(t,e){return L.IsEqual(Wxi(t),e)}function qxi(t,e,n,r,i,s){Gxi();try{let o=imn(t,e,r,s),a=wn(o,za([...e.callstack,n.$ref],e.visited),i);return wn(o,za([],[]),a)}finally{$xi()}}function jxi(t,e,n,r,i,s){return s.reduce((o,a)=>{let c=qxi(t,e,n,r,i,a);return[...o,c]},[])}function Vxi(t,e,n,r,i,s){let o=Xpn(r,s,i),a=jxi(t,e,n,r,i,o);return L.IsEqual(a.length,1)?a[0]:$h(a)}function Axe(t,e,n,r){let i=zy(t,e,r),s=tmn(t,n,r),o=s[0],a=s[1];return k2(a)?Hxi(e,o)?T4(Iu(o),i):Vxi(t,e,Iu(o),a.parameters,a.expression,i):T4(n,i)}var _Ze,xZe,SZe=v(()=>{p();NI();ft();C4();ib();jZ();P4();jr();jr();jr();Zpn();nmn();smn();_Ze=0,xZe=0});function T4(t,e){return _t.Create({"~kind":"Call"},{type:"call",target:t,arguments:e},{})}function CZe(t,e){return Axe({},za([],[]),t,e)}function J2(t){return ar(t,"Call")}var C4=v(()=>{p();$n();ls();SZe();jr()});function Yxi(t){return _t.Discard(t,["~immutable"])}function IZe(t,e){return _t.Update(Yxi(t),{},e)}function omn(t,e,n,r){let i=wn(t,e,n);return IZe(i,r)}var wZe=v(()=>{p();$n();jr()});function amn(t,e){return t(e)}var cmn=v(()=>{p()});function lmn(t,e){return L.IsString(e)?us(amn(t,e)):us(e)}var umn=v(()=>{p();ft();Tu();cmn()});function dmn(t,e){let n=Xp(e);return Yv(t,n)}var pmn=v(()=>{p();yxe();P4()});function mmn(t,e){let n=e.map(r=>Yv(t,r));return Ri(n)}var hmn=v(()=>{p();ws();yxe()});function Yv(t,e){return hs(e)?lmn(t,e.const):ua(e)?dmn(t,e.pattern):On(e)?mmn(t,e.anyOf):e}var yxe=v(()=>{p();Tu();zf();ws();umn();pmn();hmn()});function See(t,e={}){return Er("Capitalize",[t],e)}function TZe(t,e={}){return bxe(t,e)}var Exe=v(()=>{p();xo();LI()});function Cee(t,e={}){return Er("Lowercase",[t],e)}function vZe(t,e={}){return xxe(t,e)}var _xe=v(()=>{p();xo();LI()});function Iee(t,e={}){return Er("Uncapitalize",[t],e)}function RZe(t,e={}){return Cxe(t,e)}var Sxe=v(()=>{p();xo();LI()});function wee(t,e={}){return Er("Uppercase",[t],e)}function kZe(t,e={}){return wxe(t,e)}var Ixe=v(()=>{p();xo();LI()});function bxe(t,e){return is([t])?_t.Update(Yv(zxi,t),{},e):See(t,e)}function xxe(t,e){return is([t])?_t.Update(Yv(Kxi,t),{},e):Cee(t,e)}function Cxe(t,e){return is([t])?_t.Update(Yv(Jxi,t),{},e):Iee(t,e)}function wxe(t,e){return is([t])?_t.Update(Yv(Xxi,t),{},e):wee(t,e)}function BZe(t,e,n,r){let i=wn(t,e,n);return bxe(i,r)}function NZe(t,e,n,r){let i=wn(t,e,n);return xxe(i,r)}function DZe(t,e,n,r){let i=wn(t,e,n);return Cxe(i,r)}function PZe(t,e,n,r){let i=wn(t,e,n);return wxe(i,r)}var zxi,Kxi,Jxi,Xxi,LI=v(()=>{p();$n();yxe();jr();Exe();_xe();Sxe();Ixe();zxi=t=>t[0].toUpperCase()+t.slice(1),Kxi=t=>t.toLowerCase(),Jxi=t=>t[0].toLowerCase()+t.slice(1),Xxi=t=>t.toUpperCase()});function Tee(t,e,n,r,i={}){return Er("Conditional",[t,e,n,r],i)}function MZe(t,e,n,r,i={}){return vxe({},za([],[]),t,e,n,r,i)}var Txe=v(()=>{p();xo();OZe();jr()});function Zxi(t,e,n,r,i,s){let o=cp(t,n,r);return Ci.IsExtendsUnion(o)?Ri([wn(o.inferred,e,i),wn(t,e,s)]):Ci.IsExtendsTrue(o)?wn(o.inferred,e,i):wn(t,e,s)}function vxe(t,e,n,r,i,s,o){return is([n,r])?_t.Update(Zxi(t,e,n,r,i,s),{},o):Tee(n,r,i,s,o)}function LZe(t,e,n,r,i,s,o){let a=wn(t,e,n),c=wn(t,e,r);return vxe(t,e,a,c,i,s,o)}var OZe=v(()=>{p();$n();ws();Gx();jr();Txe()});var FZe=v(()=>{p();OZe()});function vee(t,e={}){return Er("ConstructorParameters",[t],e)}function QZe(t,e={}){return kxe(t,e)}var Rxe=v(()=>{p();xo();Bxe()});function eSi(t){let e=el(t)?t.parameters:[],n=YN({},za([],[]),e);return il(n)}function kxe(t,e){return is([t])?_t.Update(eSi(t),{},e):vee(t,e)}function UZe(t,e,n,r){let i=wn(t,e,n);return kxe(i,r)}var Bxe=v(()=>{p();$n();nb();sd();Rxe();jr();jr();jr()});function Ree(t,e,n={}){return Er("Exclude",[t,e],n)}function GZe(t,e,n={}){return L4(t,e,n)}var Nxe=v(()=>{p();xo();Xee()});function L4(t,e,n){return is([t,e])?_t.Update(H_e(t,e),{},n):Ree(t,e,n)}function $Ze(t,e,n,r,i){let s=wn(t,e,n),o=wn(t,e,r);return L4(s,o,i)}var Xee=v(()=>{p();$n();jr();Nxe();yXe()});function kee(t,e,n={}){return Er("Extract",[t,e],n)}function WZe(t,e,n={}){return Pxe(t,e,n)}var Dxe=v(()=>{p();xo();Mxe()});function tSi(t,e){let n=cp({},t,e);return Ci.IsExtendsTrueLike(n)?[t]:[]}function fmn(t,e,n=[]){return L.ShiftLeft(t,(r,i)=>fmn(i,e,[...n,...tSi(r,e)]),()=>n)}function gmn(t,e){let n=Vy(t),r=On(n)?n.anyOf:[n],i=fmn(r,e);return $h(i)}var Amn=v(()=>{p();ft();ws();Gx();fs();fs()});function Pxe(t,e,n){return is([t,e])?_t.Update(gmn(t,e),{},n):kee(t,e,n)}function HZe(t,e,n,r,i){let s=wn(t,e,n),o=wn(t,e,r);return Pxe(s,o,i)}var Mxe=v(()=>{p();$n();jr();Dxe();Amn()});function nSi(t){return t.reduce((e,n)=>see(n)?[...e,us(n)]:e,[])}function X2(t){let e=nSi(t);return Ri(e)}var Zee=v(()=>{p();Tu();ws()});function v4(t,e,n={}){return Er("Index",[t,e],n)}function qZe(t,e,n={}){let r=L.IsArray(e)?X2(e):e;return Oxe(t,r,n)}var jZe=v(()=>{p();ft();xo();Zee();Lxe()});function ymn(t,e){let n=$x(t,e);return Ky(n)}var Emn=v(()=>{p();Z2();K2()});function bmn(t,e,n){let r=cb(t,e,n);return Ky(r)}var _mn=v(()=>{p();Z2();fs()});function rSi(t,e){let n=L.Keys(t).filter(l=>!L.HasPropertyKey(e,l)),r=L.Keys(e).filter(l=>!L.HasPropertyKey(t,l)),i=L.Keys(t).filter(l=>L.HasPropertyKey(e,l)),s=n.reduce((l,d)=>({...l,[d]:t[d]}),{}),o=r.reduce((l,d)=>({...l,[d]:e[d]}),{}),a=i.reduce((l,d)=>({...l,[d]:uc([t[d],e[d]])}),{}),c=_t.Assign(s,o);return _t.Assign(c,a)}function xmn(t){return t.reduce((e,n)=>rSi(e,Ky(n)),{})}var Smn=v(()=>{p();$n();ft();Z2();fs()});var Cmn=v(()=>{p()});function Imn(t){let e=ucn(il(t));return Ky(e)}var wmn=v(()=>{p();sd();pXe();Z2()});function iSi(t,e){return L.Keys(t).filter(i=>i in e).reduce((i,s)=>({...i,[s]:$h([t[s],e[s]])}),{})}function Tmn(t,e){return L.ShiftLeft(t,(n,r)=>Tmn(r,iSi(e,Ky(n))),()=>e)}function vmn(t){return L.ShiftLeft(t,(e,n)=>Tmn(n,Ky(e)),()=>vl())}var Rmn=v(()=>{p();ft();Lx();fs();Z2()});function Ky(t){return la(t)?ymn(t.$defs,t.$ref):nl(t)?bmn(t.if,t.then,t.else):Vr(t)?xmn(t.allOf):On(t)?vmn(t.anyOf):rs(t)?Imn(t.items):Jr(t)?t.properties:{}}var Z2=v(()=>{p();jf();mA();rd();Ho();sd();ws();Emn();_mn();Smn();Cmn();wmn();Rmn()});function eF(t){let e=Ky(t);return Kr(e)}var kmn=v(()=>{p();Ho();Z2()});var ete=v(()=>{p();kmn()});function tF(t){let e=`${t}`;return sSi.test(e)?parseInt(e):t}var sSi,tte=v(()=>{p();sSi=new RegExp("^(?:0|[1-9][0-9]*)$")});function oSi(t){return us(tF(t))}function Bmn(t){return t.map(e=>Nmn(e))}function Nmn(t){return Vr(t)?Jp(Bmn(t.allOf)):On(t)?Ri(Bmn(t.anyOf)):hs(t)?oSi(t.const):t}function Dmn(t,e){let n=Nmn(e),r=cp({},n,Yf());return Ci.IsExtendsTrueLike(r)?t:hs(e)&&L.IsEqual(e.const,"length")?Yf():Xo()}var Pmn=v(()=>{p();ft();rd();ws();Tu();Gh();sp();Gx();tte()});function Mmn(t,e){let n=$x(t,e);return fA(n)}var Omn=v(()=>{p();zN();K2()});function Lmn(t,e,n){let r=cb(t,e,n);return fA(r)}var Fmn=v(()=>{p();zN();fs()});function Qmn(t){let e=Hm(t);return fA(e)}var Umn=v(()=>{p();zN();fs()});function Gmn(t){let e=uc(t);return fA(e)}var $mn=v(()=>{p();fs();zN()});function Wmn(t){return[`${t}`]}var Hmn=v(()=>{p()});function qmn(t){let e=Xp(t);return fA(e)}var jmn=v(()=>{p();zN();fs()});function Vmn(t){return t.reduce((e,n)=>[...e,...fA(n)],[])}var Ymn=v(()=>{p();zN()});function fA(t){return la(t)?Mmn(t.$defs,t.$ref):nl(t)?Lmn(t.if,t.then,t.else):rl(t)?Qmn(t.enum):Vr(t)?Gmn(t.allOf):hs(t)?Wmn(t.const):ua(t)?qmn(t.pattern):On(t)?Vmn(t.anyOf):[]}var zN=v(()=>{p();jf();mA();Ox();rd();Tu();zf();ws();Omn();Fmn();Umn();$mn();Hmn();jmn();Ymn()});function F4(t){return fA(t)}var Fxe=v(()=>{p();zN()});function nte(t,e){return e.map(n=>rte(t,n))}function rte(t,e){return xs(e)?Lh(rte(t,e.items)):el(e)?Nx(nte(t,e.parameters),rte(t,e.instanceType)):tl(e)?Dx(nte(t,e.parameters),rte(t,e.returnType)):rs(e)?il(nte(t,e.items)):On(e)?Ri(nte(t,e.anyOf)):Vr(e)?Jp(nte(t,e.allOf)):Eee(e)?Kr(t):e}function zmn(t,e){return rte(t,e)}var Kmn=v(()=>{p();Fh();nb();rb();rd();Ho();sd();z_e();ws()});function aSi(t,e){let n=e in t?t[e]:Xo();return zmn(t,n)}function Jmn(t,e){return e.reduce((n,r)=>[...n,aSi(t,r)],[])}function cSi(t,e){let n=F4(e),r=Jmn(t,n);return $h(r)}function uSi(t){return t.filter(n=>lSi.test(n))}function dSi(t){let e=YZ(t),n=uSi(e),r=Jmn(t,n);return $h(r)}function Xmn(t,e){return lc(e)?dSi(t):cSi(t,e)}var lSi,Zmn=v(()=>{p();Gh();sp();N2();fs();Fxe();ap();Kmn();lSi=new RegExp($v)});function pSi(t){return us(tF(t))}function ehn(t){return t.map(e=>VZe(e))}function VZe(t){return Vr(t)?Jp(ehn(t.allOf)):On(t)?Ri(ehn(t.anyOf)):hs(t)?pSi(t.const):t}var thn=v(()=>{p();ws();rd();Tu();tte()});function mSi(t,e){return t.reduceRight((n,r,i)=>{let s=cp({},us(i),e);return Ci.IsExtendsTrueLike(s)?[r,...n]:n},[])}function hSi(t,e){let n=VZe(e),r=mSi(t,n);return Gv(r)}function fSi(t){return Gv(t)}function nhn(t,e){return hs(e)&&L.IsEqual(e.const,"length")?us(t.length):lc(e)||id(e)?fSi(t):hSi(t,e)}var rhn=v(()=>{p();ft();Tu();Gh();PI();fs();Gx();thn()});function ihn(t,e){return xs(t)?Dmn(t.items,e):Jr(t)?Xmn(t.properties,e):rs(t)?nhn(t.items,e):Xo()}var shn=v(()=>{p();Fh();sp();Ho();sd();Pmn();Zmn();rhn()});function gSi(t){return la(t)||nl(t)||Vr(t)||On(t)?eF(t):t}function Oxe(t,e,n){return is([t,e])?_t.Update(ihn(gSi(t),e),{},n):v4(t,e,n)}function YZe(t,e,n,r,i){let s=wn(t,e,n),o=wn(t,e,r);return Oxe(s,o,i)}var Lxe=v(()=>{p();$n();jf();mA();rd();ws();jr();jZe();ete();shn()});function Bee(t,e={}){return Er("InstanceType",[t],e)}function zZe(t,e={}){return Uxe(t,e)}var Qxe=v(()=>{p();xo();Gxe()});function ASi(t){return el(t)?t.instanceType:Xo()}function Uxe(t,e){return is([t])?_t.Update(ASi(t),{},e):Bee(t,e)}function KZe(t,e,n,r={}){let i=wn(t,e,n);return Uxe(i,r)}var Gxe=v(()=>{p();$n();nb();sp();Qxe();jr()});function R4(t,e={}){return Er("KeyOf",[t],e)}function JZe(t,e={}){return Wxe(t,e)}var $xe=v(()=>{p();xo();Hxe()});function ohn(){return Ri([Yf(),Wm(),O2()])}var ahn=v(()=>{p();Gh();ob();L2();ws()});function chn(t){return Yf()}var lhn=v(()=>{p();Gh()});function ySi(t){return t.reduce((n,r)=>see(r)?[...n,us(tF(r))]:vl(),[])}function uhn(t){let e=L.Keys(t),n=ySi(e);return Gv(n)}var dhn=v(()=>{p();Lx();ft();Tu();tte();fs()});function phn(t){return Hv(t)}var mhn=v(()=>{p();ap()});function hhn(t){let e=t.map((n,r)=>us(r));return Gv(e)}var fhn=v(()=>{p();Tu();fs()});function ghn(t){return Qc(t)?ohn():xs(t)?chn(t.items):Jr(t)?uhn(t.properties):Do(t)?phn(t):rs(t)?hhn(t.items):Xo()}var Ahn=v(()=>{p();qf();Fh();sp();Ho();ap();sd();ahn();lhn();dhn();mhn();fhn()});function ESi(t){return la(t)||nl(t)||Vr(t)||On(t)?eF(t):t}function Wxe(t,e){return is([t])?_t.Update(ghn(ESi(t)),{},e):R4(t,e)}function XZe(t,e,n,r){let i=wn(t,e,n);return Wxe(i,r)}var Hxe=v(()=>{p();$n();jf();mA();rd();ws();$xe();jr();ete();Ahn()});function I4(t,e,n,r,i={}){return Er("Mapped",[t,e,n,r],i)}function ZZe(t,e,n,r,i={}){return jxe({},za([],[]),t,e,n,r,i)}var qxe=v(()=>{p();xo();Vxe();jr()});function bSi(t){let e=Xp(t);return Yxe(e)}function _Si(t){return t.reduce((e,n)=>[...e,...Yxe(n)],[])}function xSi(t){let e=Hm(t);return Yxe(e)}function SSi(t){return L.IsNumber(t)?[us(`${t}`)]:[us(t)]}function Yxe(t){return rl(t)?xSi(t.enum):hs(t)?SSi(t.const):ua(t)?bSi(t.pattern):On(t)?_Si(t.anyOf):[t]}function yhn(t){return Yxe(t)}var Ehn=v(()=>{p();ft();Tu();Ox();zf();ws();fs();fs()});function CSi(t){return ua(t)?Xp(t.pattern):t}function ISi(t,e,n,r,i,s){let o=_t.Assign(t,{[n.name]:r}),a=wn(o,e,i),c=CSi(a),u=wn(o,e,s);return oee(c)||aee(c)?{[c.const]:u}:{}}function wSi(t,e,n,r,i,s){return r.reduce((o,a)=>[...o,ISi(t,e,n,a,i,s)],[])}function TSi(t){return t.reduce((e,n)=>[...e,Kr(n)],[])}function bhn(t,e,n,r,i,s){let o=yhn(r),a=wSi(t,e,n,o,i,s),c=TSi(a);return uc(c)}var _hn=v(()=>{p();$n();Tu();Ho();zf();jr();fs();fs();Ehn()});function jxe(t,e,n,r,i,s,o){return is([r])?_t.Update(bhn(t,e,n,r,i,s),{},o):I4(n,r,i,s,o)}function eet(t,e,n,r,i,s,o){let a=wn(t,e,r);return jxe(t,e,n,a,i,s,o)}var Vxe=v(()=>{p();$n();qxe();jr();_hn()});function vSi(t,e,n){let r=_t.Assign(t,e);return L.Keys(e).filter(s=>n.includes(s)).reduce((s,o)=>({...s,[o]:fZe(r,o,e[o])}),{})}function RSi(t,e,n){let r=_t.Assign(t,e);return L.Keys(e).filter(s=>!n.includes(s)).reduce((s,o)=>({...s,[o]:wn(r,za([],[]),e[o])}),{})}function kSi(t,e,n){let r=uZe(e),i=vSi(t,e,r),s=RSi(t,e,r),o={...i,...s};return _t.Update(o,{},n)}function ite(t,e,n,r){return kSi(t,n,r)}var zxe=v(()=>{p();ft();$n();jr();dZe();gZe();jr()});function Nee(t,e={}){return Er("NonNullable",[t],e)}function tet(t,e={}){return Jxe(t,e)}var Kxe=v(()=>{p();xo();Xxe()});function BSi(t){let e=Ri([M2(),W2()]);return L4(t,e,{})}function Jxe(t,e){return is([t])?_t.Update(BSi(t),{},e):Nee(t,e)}function net(t,e,n,r){let i=wn(t,e,n);return Jxe(i,r)}var Xxe=v(()=>{p();$n();A4();S4();ws();Xee();Kxe();jr()});function Dee(t,e,n={}){return Er("Omit",[t,e],n)}function ret(t,e,n={}){let r=L.IsArray(e)?X2(e):e;return eSe(t,r,n)}var Zxe=v(()=>{p();ft();xo();Zee();tSe()});function nSe(t){let e=eF(t);return Jr(e)?e.properties:vl()}var iet=v(()=>{p();Lx();Ho();ete()});function NSi(t,e){return L.Keys(t).reduce((r,i)=>e.includes(i)?r:{...r,[i]:t[i]},{})}function xhn(t,e){let n=nSe(t),r=F4(e),i=NSi(n,r);return Kr(i)}var Shn=v(()=>{p();ft();Ho();Fxe();iet()});function eSe(t,e,n){return is([t,e])?_t.Update(xhn(t,e),{},n):Dee(t,e,n)}function set(t,e,n,r,i){let s=wn(t,e,n),o=wn(t,e,r);return eSe(s,o,i)}var tSe=v(()=>{p();$n();Zxe();jr();Shn()});function Pee(t,e={}){return Er("Parameters",[t],e)}function oet(t,e={}){return iSe(t,e)}var rSe=v(()=>{p();xo();sSe()});function DSi(t){let e=tl(t)?t.parameters:[],n=YN({},za([],[]),e);return il(n)}function iSe(t,e){return is([t])?_t.Update(DSi(t),{},e):Pee(t,e)}function aet(t,e,n,r){let i=wn(t,e,n);return iSe(i,r)}var sSe=v(()=>{p();$n();rb();sd();rSe();jr();jr();jr()});function Mee(t,e={}){return Er("Partial",[t],e)}function cet(t,e={}){return aSe(t,e)}var oSe=v(()=>{p();xo();cSe()});function Chn(t,e){let n=$x(t,e),r=FI(n);return Mx(_t.Assign(t,{[e]:r}),e)}var Ihn=v(()=>{p();$n();jf();Q4();K2()});function whn(t,e,n){let r=cb(t,e,n);return FI(r)}var Thn=v(()=>{p();Q4();fs()});function vhn(t){let e=uc(t);return FI(e)}var Rhn=v(()=>{p();Q4();fs()});function khn(t){let e=t.map(n=>FI(n));return Ri(e)}var Bhn=v(()=>{p();ws();Q4()});function Nhn(t){let e=L.Keys(t).reduce((r,i)=>({...r,[i]:NN(t[i])}),{});return Kr(e)}var Dhn=v(()=>{p();ft();Ho();VZ()});function FI(t){return la(t)?Chn(t.$defs,t.$ref):nl(t)?whn(t.if,t.then,t.else):Vr(t)?vhn(t.allOf):On(t)?khn(t.anyOf):Jr(t)?Nhn(t.properties):Kr({})}var Q4=v(()=>{p();jf();mA();rd();Ho();ws();Ihn();Thn();Rhn();Bhn();Dhn()});function aSe(t,e){return is([t])?_t.Update(FI(t),{},e):Mee(t,e)}function uet(t,e,n,r){let i=wn(t,e,n);return aSe(i,r)}var cSe=v(()=>{p();$n();oSe();Q4();jr()});function Oee(t,e,n={}){return Er("Pick",[t,e],n)}function det(t,e,n={}){let r=L.IsArray(e)?X2(e):e;return uSe(t,r,n)}var lSe=v(()=>{p();ft();xo();Zee();dSe()});function PSi(t,e){return L.Keys(t).reduce((r,i)=>e.includes(i)?_t.Assign(r,{[i]:t[i]}):r,{})}function Phn(t,e){let n=nSe(t),r=F4(e),i=PSi(n,r);return Kr(i)}var Mhn=v(()=>{p();$n();ft();Ho();Fxe();iet()});function uSe(t,e,n){return is([t,e])?_t.Update(Phn(t,e),{},n):Oee(t,e,n)}function pet(t,e,n,r,i){let s=wn(t,e,n),o=wn(t,e,r);return uSe(s,o,i)}var dSe=v(()=>{p();$n();lSe();jr();Mhn()});function Lee(t,e={}){return Er("ReadonlyObject",[t],e)}function pSe(t,e={}){return hSe(t,e)}var met,mSe=v(()=>{p();xo();fSe();met=pSe});function Ohn(t){return D2(Lh(t))}var Lhn=v(()=>{p();Fh();eee()});function Fhn(t,e){let n=$x(t,e),r=QI(n);return Mx(_t.Assign(t,{[e]:r}),e)}var Qhn=v(()=>{p();$n();jf();U4();K2()});function Uhn(t,e,n){let r=cb(t,e,n);return QI(r)}var Ghn=v(()=>{p();U4();fs()});function $hn(t){let e=uc(t);return QI(e)}var Whn=v(()=>{p();U4();fs()});function Hhn(t){let e=L.Keys(t).reduce((r,i)=>({...r,[i]:LN(t[i])}),{});return Kr(e)}var qhn=v(()=>{p();ft();Ho();tee()});function jhn(t){return D2(il(t))}var Vhn=v(()=>{p();sd();eee()});function Yhn(t){let e=t.map(n=>QI(n));return Ri(e)}var zhn=v(()=>{p();ws();U4()});function QI(t){return xs(t)?Ohn(t.items):la(t)?Fhn(t.$defs,t.$ref):nl(t)?Uhn(t.if,t.then,t.else):Vr(t)?$hn(t.allOf):Jr(t)?Hhn(t.properties):rs(t)?jhn(t.items):On(t)?Yhn(t.anyOf):t}var U4=v(()=>{p();Fh();jf();mA();rd();Ho();sd();ws();Lhn();Qhn();Ghn();Whn();qhn();Vhn();zhn()});function hSe(t,e){return is([t])?_t.Update(QI(t),{},e):Lee(t)}function het(t,e,n,r){let i=wn(t,e,n);return hSe(i,r)}var fSe=v(()=>{p();$n();mSe();U4();jr()});function fet(t,e,n,r){return e.visited.includes(r)?n:r in t?wn(t,za(e.callstack,[...e.visited,r]),t[r]):n}var get=v(()=>{p();jr();jr()});function Khn(t,e){let n=$x(t,e),r=UI(n);return Mx(_t.Assign(t,{[e]:r}),e)}var Jhn=v(()=>{p();$n();jf();G4();K2()});function Xhn(t,e,n){let r=cb(t,e,n);return UI(r)}var Zhn=v(()=>{p();G4();fs()});function efn(t){let e=uc(t);return UI(e)}var tfn=v(()=>{p();G4();fs()});function nfn(t){let e=t.map(n=>UI(n));return Ri(e)}var rfn=v(()=>{p();ws();G4()});function ifn(t){let e=L.Keys(t).reduce((r,i)=>({...r,[i]:mee(t[i])}),{});return Kr(e)}var sfn=v(()=>{p();ft();Ho();$_e()});function UI(t){return la(t)?Khn(t.$defs,t.$ref):nl(t)?Xhn(t.if,t.then,t.else):Vr(t)?efn(t.allOf):On(t)?nfn(t.anyOf):Jr(t)?ifn(t.properties):Kr({})}var G4=v(()=>{p();jf();mA();rd();Ho();ws();Jhn();Zhn();tfn();rfn();sfn()});function Fee(t,e={}){return Er("Required",[t],e)}function Aet(t,e={}){return ASe(t,e)}var gSe=v(()=>{p();xo();ySe()});function ASe(t,e){return is([t])?_t.Update(UI(t),{},e):Fee(t,e)}function yet(t,e,n,r){let i=wn(t,e,n);return ASe(i,r)}var ySe=v(()=>{p();$n();G4();gSe();jr()});function Qee(t,e={}){return Er("ReturnType",[t],e)}function Eet(t,e={}){return bSe(t,e)}var ESe=v(()=>{p();xo();_Se()});function MSi(t){return tl(t)?t.returnType:Xo()}function bSe(t,e){return is([t])?_t.Update(MSi(t),{},e):Qee(t,e)}function bet(t,e,n,r={}){let i=wn(t,e,n);return bSe(i,r)}var _Se=v(()=>{p();$n();rb();sp();ESe();jr()});function Uee(t,e){return Er("With",[t,e],{})}function ste(t,e){return SSe(t,e)}var xSe=v(()=>{p();xo();CSe()});function SSe(t,e){return is([t])?_t.Update(t,{},e):Uee(t,e)}function _et(t,e,n,r){let i=wn(t,e,n);return SSe(i,r)}var CSe=v(()=>{p();$n();jr();xSe()});function OSi(t){return qv(t)?rs(t.items)?xet(t.items.items):Tl(t.items)?[t]:uo(t.items)?[t]:[Xo()]:[t]}function xet(t){return t.reduce((n,r)=>[...n,...OSi(r)],[])}var ofn=v(()=>{p();sb();sp();x4();ib();sd()});var afn=v(()=>{p();ofn()});function za(t,e){return{callstack:t,visited:e}}function is(t){return L.ShiftLeft(t,(e,n)=>uo(e)?!1:is(n),()=>!0)}function jee(t,e,n){return L.Keys(n).reduce((r,i)=>({...r,[i]:wn(t,e,n[i])}),{})}function YN(t,e,n){let r=zy(t,e,n);return xet(r)}function zy(t,e,n){return n.map(r=>wn(t,e,r))}function LSi(t,e){let n=wu(t)?qZ(e,{}):e,r=FN(t)?HZ(n,{}):n;return ON(t)?ote(r,{}):r}function FSi(t,e,n,r,i){return L.IsEqual(n,"AddImmutable")?cfn(t,e,r[0],i):L.IsEqual(n,"RemoveImmutable")?omn(t,e,r[0],i):L.IsEqual(n,"AddReadonly")?Yon(t,e,r[0],i):L.IsEqual(n,"RemoveReadonly")?ccn(t,e,r[0],i):L.IsEqual(n,"AddOptional")?zon(t,e,r[0],i):L.IsEqual(n,"RemoveOptional")?lcn(t,e,r[0],i):L.IsEqual(n,"Capitalize")?BZe(t,e,r[0],i):L.IsEqual(n,"Conditional")?LZe(t,e,r[0],r[1],r[2],r[3],i):L.IsEqual(n,"ConstructorParameters")?UZe(t,e,r[0],i):L.IsEqual(n,"Evaluate")?EZe(t,e,r[0],i):L.IsEqual(n,"Exclude")?$Ze(t,e,r[0],r[1],i):L.IsEqual(n,"Extract")?HZe(t,e,r[0],r[1],i):L.IsEqual(n,"Index")?YZe(t,e,r[0],r[1],i):L.IsEqual(n,"InstanceType")?KZe(t,e,r[0],i):L.IsEqual(n,"Interface")?oZe(t,e,r[0],r[1],i):L.IsEqual(n,"KeyOf")?XZe(t,e,r[0],i):L.IsEqual(n,"Lowercase")?NZe(t,e,r[0],i):L.IsEqual(n,"Mapped")?eet(t,e,r[0],r[1],r[2],r[3],i):L.IsEqual(n,"Module")?ite(t,e,r[0],i):L.IsEqual(n,"NonNullable")?net(t,e,r[0],i):L.IsEqual(n,"Pick")?pet(t,e,r[0],r[1],i):L.IsEqual(n,"Parameters")?aet(t,e,r[0],i):L.IsEqual(n,"Partial")?uet(t,e,r[0],i):L.IsEqual(n,"Omit")?set(t,e,r[0],r[1],i):L.IsEqual(n,"ReadonlyObject")?het(t,e,r[0],i):L.IsEqual(n,"Record")?bXe(t,e,r[0],r[1],i):L.IsEqual(n,"Required")?yet(t,e,r[0],i):L.IsEqual(n,"ReturnType")?bet(t,e,r[0],i):L.IsEqual(n,"TemplateLiteral")?Fdn(t,e,r[0],i):L.IsEqual(n,"Uncapitalize")?DZe(t,e,r[0],i):L.IsEqual(n,"Uppercase")?PZe(t,e,r[0],i):L.IsEqual(n,"With")?_et(t,e,r[0],r[1]):Er(n,r,i)}function QSi(t,e,n){let r=uo(n)?fet(t,e,n,n.$ref):xs(n)?Lh(wn(t,e,n.items),R2(n)):J2(n)?Axe(t,e,n.target,n.arguments):el(n)?Nx(zy(t,e,n.parameters),wn(t,e,n.instanceType),_Je(n)):tl(n)?Dx(zy(t,e,n.parameters),wn(t,e,n.returnType),xJe(n)):nl(n)?PN(wn(t,e,n.if),wn(t,e,n.then),wn(t,e,n.else),vJe(n)):Vr(n)?Jp(zy(t,e,n.allOf),DJe(n)):Jr(n)?Kr(jee(t,e,n.properties),wJe(n)):Do(n)?_Xe(vu(n),wn(t,e,_a(n))):qv(n)?HN(wn(t,e,n.items)):rs(n)?il(YN(t,e,n.items),nXe(n)):On(n)?Ri(zy(t,e,n.anyOf),tXe(n)):n;return LSi(n,r)}function wn(t,e,n){return Qv(n)?FSi(t,e,n.action,n.parameters,n.options):QSi(t,e,n)}function gA(t,e){return wn(t,za([],[]),e)}var jr=v(()=>{p();ft();ISe();N_e();D_e();Fh();nb();xo();rb();C4();mA();rd();Ho();ap();sd();ws();ib();x4();ISe();wZe();N_e();iXe();D_e();lXe();DN();ZZ();nee();SZe();LI();FZe();Bxe();gxe();Xee();Mxe();Lxe();Gxe();mxe();Hxe();LI();Vxe();zxe();Xxe();tSe();sSe();cSe();dSe();fSe();Y_e();get();ySe();_Se();axe();LI();LI();CSe();afn()});function USi(t){return _t.Update(t,{"~immutable":!0},{})}function ote(t,e){return _t.Update(USi(t),{},e)}function cfn(t,e,n,r){let i=wn(t,e,n);return ote(i,r)}var ISe=v(()=>{p();$n();jr()});function SXe(t,e={}){return Er("AddImmutable",[t],e)}function D2(t,e={}){return ote(t,e)}var eee=v(()=>{p();xo();ISe()});function GSi(t,e={}){return Er("RemoveImmutable",[t],e)}function $Si(t,e={}){return IZe(t,e)}var lfn=v(()=>{p();xo();wZe()});function CXe(t,e={}){return Er("Evaluate",[t],e)}function od(t,e={}){return fxe(t,e)}var Cet=v(()=>{p();xo();gxe()});function IXe(t,e={}){return Er("Module",[t],e)}function Iet(t,e={}){return ite({},za([],[]),t,e)}var wet=v(()=>{p();xo();jr();zxe()});var j2=v(()=>{p();eee();tee();VZ();lfn();aXe();$_e();Exe();Txe();Rxe();Cet();Nxe();Dxe();jZe();Qxe();Vee();$xe();_xe();qxe();wet();Kxe();Zxe();rSe();oSe();lSe();mSe();gSe();ESe();Sxe();Ixe();xSe()});var ufn=v(()=>{p();Bxe()});var dfn=v(()=>{p();M_e()});var pfn=v(()=>{p();Xee()});var mfn=v(()=>{p();Mxe()});var hfn=v(()=>{p()});var ffn=v(()=>{p();Zee();tte();hfn()});var gfn=v(()=>{p();Lxe()});var Afn=v(()=>{p();Gxe()});var yfn=v(()=>{p();mxe()});var Efn=v(()=>{p();LI()});var bfn=v(()=>{p();Hxe()});var _fn=v(()=>{p();Vxe()});var xfn=v(()=>{p();zxe()});var Sfn=v(()=>{p();Xxe()});var Cfn=v(()=>{p();tSe()});var Ifn=v(()=>{p();sSe()});var wfn=v(()=>{p();uee();qXe()});var Tfn=v(()=>{p();cSe()});var vfn=v(()=>{p();dSe()});function WSi(t,e){let n=U2(t,e);return L.IsEqual(n,b4)||L.IsEqual(n,O4)?1:0}function Rfn(t,e,n=[]){return L.ShiftLeft(e,(r,i)=>L.IsEqual(WSi(t,r),1)?Rfn(t,i,[...n,r]):[...n,t,...e],()=>[...n,t])}function kfn(t,e=[]){return L.ShiftLeft(t,(n,r)=>kfn(r,Rfn(n,e)),()=>e)}function Tet(t){return kfn(t)}var Bfn=v(()=>{p();ft();hee()});var Nfn=v(()=>{p();Bfn()});var Dfn=v(()=>{p();fSe()});var Pfn=v(()=>{p();Y_e()});var Mfn=v(()=>{p();get()});var Ofn=v(()=>{p();ySe()});var Lfn=v(()=>{p();_Se()});var Ffn=v(()=>{p()});function HSi(t){let e=F2(t);return!L.IsEqual(e.length,0)}var Qfn=v(()=>{p();ft();uee()});var wSe=v(()=>{p();Q_e();G_e();VXe();Ffn();F_e();Qfn()});var Ufn=v(()=>{p();CSe()});var vet=v(()=>{p();jr();FZe();ufn();AZe();dfn();P4();pfn();mfn();ffn();gfn();Afn();yfn();Efn();bfn();_fn();xfn();Sfn();ete();Cfn();Ifn();wfn();Tfn();vfn();Nfn();Dfn();Pfn();Mfn();Ofn();Lfn();wSe();Ufn()});function Ret(...t){let[e,n,r]=Gi.Match(t,{2:(o,a)=>L.IsString(o)?[{},o,a]:[o,a,{}],3:(o,a,c)=>[o,a,c],1:o=>[{},o,{}]}),i=Odn(n),s=L.IsArray(i)&&L.IsEqual(i.length,2)?wn(e,za([],[]),i[0]):Xo();return _t.Update(s,{},r)}var Gfn=v(()=>{p();Yl();$n();ft();_ee();jr();jr();L_e()});var TSe=v(()=>{p();Gfn()});var Ne={};br(Ne,{Any:()=>B2,Array:()=>Lh,BigInt:()=>f4,Boolean:()=>ree,Call:()=>CZe,Capitalize:()=>TZe,Codec:()=>XZ,Conditional:()=>MZe,Constructor:()=>Nx,ConstructorParameters:()=>QZe,Cyclic:()=>Mx,Decode:()=>GJe,DecodeBuilder:()=>m4,Dependent:()=>PN,Encode:()=>$Je,EncodeBuilder:()=>p4,Enum:()=>NJe,Evaluate:()=>od,Exclude:()=>GZe,Extends:()=>cp,ExtendsResult:()=>Ci,Extract:()=>WZe,Function:()=>Dx,Generic:()=>Uv,Identifier:()=>g4,Immutable:()=>HJe,Index:()=>qZe,Infer:()=>a4,InstanceType:()=>zZe,Instantiate:()=>gA,Integer:()=>UN,Interface:()=>aZe,Intersect:()=>Jp,IsAny:()=>Qc,IsArray:()=>xs,IsBigInt:()=>Vf,IsBoolean:()=>$m,IsCall:()=>J2,IsCodec:()=>Gm,IsConstructor:()=>el,IsCyclic:()=>la,IsDependent:()=>nl,IsEnum:()=>rl,IsEnumValue:()=>BJe,IsFunction:()=>tl,IsGeneric:()=>k2,IsIdentifier:()=>zJe,IsImmutable:()=>ON,IsInfer:()=>Tl,IsInteger:()=>id,IsIntersect:()=>Vr,IsKind:()=>ar,IsLiteral:()=>hs,IsNever:()=>Qh,IsNull:()=>Qx,IsNumber:()=>lc,IsObject:()=>Jr,IsOptional:()=>wu,IsParameter:()=>ZJe,IsReadonly:()=>FN,IsRecord:()=>Do,IsRef:()=>uo,IsRefine:()=>h4,IsRest:()=>qv,IsSchema:()=>Fc,IsString:()=>zl,IsSymbol:()=>Ux,IsTemplateLiteral:()=>ua,IsThis:()=>Eee,IsTuple:()=>rs,IsUndefined:()=>Yy,IsUnion:()=>On,IsUnknown:()=>wl,IsUnsafe:()=>KZ,IsVoid:()=>Jf,KeyOf:()=>JZe,Literal:()=>us,Lowercase:()=>vZe,Mapped:()=>ZZe,Module:()=>Iet,Never:()=>Xo,NonNullable:()=>tet,Null:()=>M2,Number:()=>Yf,Object:()=>Kr,Omit:()=>ret,Optional:()=>CJe,Parameter:()=>GN,Parameters:()=>oet,Partial:()=>cet,Pick:()=>det,Readonly:()=>qJe,ReadonlyObject:()=>pSe,ReadonlyType:()=>met,Record:()=>$2,RecordKey:()=>Hv,RecordPattern:()=>vu,RecordValue:()=>_a,Ref:()=>Iu,Refine:()=>jJe,Required:()=>Aet,Rest:()=>HN,ReturnType:()=>Eet,Script:()=>Ret,String:()=>Wm,Symbol:()=>O2,TemplateLiteral:()=>KXe,This:()=>yee,Tuple:()=>il,Uncapitalize:()=>RZe,Undefined:()=>W2,Union:()=>Ri,Unknown:()=>Vl,Unsafe:()=>TJe,Uppercase:()=>kZe,Void:()=>bee,With:()=>ste});var ket=v(()=>{p();jr();Gx();TSe();Exe();Txe();Rxe();Cet();Nxe();Dxe();j2();Qxe();Vee();$xe();_xe();qxe();wet();Kxe();Zxe();rSe();oSe();lSe();mSe();gSe();ESe();Sxe();Ixe();xSe();WJe();ZZ();DN();nee();VJe();qf();Fh();P2();QN();C4();nb();jf();Ox();rb();jZ();KJe();mA();sb();PI();rd();Tu();sp();A4();Gh();Ho();eXe();ap();ib();x4();ls();ob();L2();zf();z_e();sd();S4();ws();Kp();P_e();H2()});var vSe={};br(vSe,{AddImmutable:()=>D2,AddImmutableDeferred:()=>SXe,AddOptional:()=>NN,AddOptionalDeferred:()=>Px,AddReadonly:()=>LN,AddReadonlyDeferred:()=>Fx,Any:()=>B2,Array:()=>Lh,ArrayOptions:()=>R2,BigInt:()=>f4,BigIntPattern:()=>YJe,Boolean:()=>ree,Broaden:()=>q_e,Call:()=>CZe,CallConstruct:()=>T4,CanComposite:()=>W_e,Capitalize:()=>TZe,CapitalizeAction:()=>bxe,CapitalizeDeferred:()=>See,CapitalizeInstantiate:()=>BZe,Codec:()=>XZ,CollapseToObject:()=>eF,Compare:()=>U2,CompareResultDisjoint:()=>O4,CompareResultEqual:()=>y4,CompareResultLeftInside:()=>E4,CompareResultRightInside:()=>b4,Composite:()=>mXe,Conditional:()=>MZe,ConditionalAction:()=>vxe,ConditionalDeferred:()=>Tee,ConditionalInstantiate:()=>LZe,Constructor:()=>Nx,ConstructorOptions:()=>_Je,ConstructorParameters:()=>QZe,ConstructorParametersAction:()=>kxe,ConstructorParametersDeferred:()=>vee,ConstructorParametersInstantiate:()=>UZe,ConvertToIntegerKey:()=>tF,Cyclic:()=>Mx,CyclicCandidates:()=>uZe,CyclicCheck:()=>cZe,CyclicDependencies:()=>pZe,CyclicExtends:()=>hZe,CyclicOptions:()=>BEi,CyclicTarget:()=>$x,Decode:()=>GJe,DecodeBuilder:()=>m4,Deferred:()=>Er,Dependent:()=>PN,DependentOptions:()=>vJe,Distribute:()=>_4,Encode:()=>$Je,EncodeBuilder:()=>p4,Enum:()=>NJe,Evaluate:()=>od,EvaluateAction:()=>fxe,EvaluateDeferred:()=>CXe,EvaluateDependent:()=>cb,EvaluateEnum:()=>Hm,EvaluateInstantiate:()=>EZe,EvaluateIntersect:()=>uc,EvaluateTemplateLiteral:()=>Xp,EvaluateType:()=>Vy,EvaluateUnion:()=>$h,EvaluateUnionFast:()=>Gv,Exclude:()=>GZe,ExcludeAction:()=>L4,ExcludeDeferred:()=>Ree,ExcludeInstantiate:()=>$Ze,Extends:()=>cp,ExtendsResult:()=>Ci,Extract:()=>WZe,ExtractAction:()=>Pxe,ExtractDeferred:()=>kee,ExtractInstantiate:()=>HZe,Flatten:()=>Wv,Function:()=>Dx,FunctionOptions:()=>xJe,Generic:()=>Uv,Identifier:()=>g4,Immutable:()=>HJe,Index:()=>qZe,IndexAction:()=>Oxe,IndexDeferred:()=>v4,IndexInstantiate:()=>YZe,Infer:()=>a4,InstanceType:()=>zZe,InstanceTypeAction:()=>Uxe,InstanceTypeDeferred:()=>Bee,InstanceTypeInstantiate:()=>KZe,Instantiate:()=>gA,InstantiateCyclic:()=>fZe,Integer:()=>UN,IntegerKey:()=>$v,IntegerPattern:()=>iee,Interface:()=>aZe,InterfaceAction:()=>pxe,InterfaceDeferred:()=>w4,InterfaceInstantiate:()=>oZe,Intersect:()=>Jp,IntersectOptions:()=>DJe,InvalidLiteralValue:()=>O_e,IsAny:()=>Qc,IsArray:()=>xs,IsBigInt:()=>Vf,IsBoolean:()=>$m,IsCall:()=>J2,IsCodec:()=>Gm,IsConstructor:()=>el,IsCyclic:()=>la,IsDeferred:()=>Qv,IsDependent:()=>nl,IsEnum:()=>rl,IsEnumValue:()=>BJe,IsFunction:()=>tl,IsGeneric:()=>k2,IsIdentifier:()=>zJe,IsImmutable:()=>ON,IsInfer:()=>Tl,IsInteger:()=>id,IsInterfaceDeferred:()=>V2,IsIntersect:()=>Vr,IsKind:()=>ar,IsLiteral:()=>hs,IsLiteralBigInt:()=>JJe,IsLiteralBoolean:()=>XJe,IsLiteralNumber:()=>oee,IsLiteralString:()=>aee,IsLiteralValue:()=>see,IsNever:()=>Qh,IsNull:()=>Qx,IsNumber:()=>lc,IsObject:()=>Jr,IsOptional:()=>wu,IsParameter:()=>ZJe,IsReadonly:()=>FN,IsRecord:()=>Do,IsRef:()=>uo,IsRefine:()=>h4,IsRefinement:()=>zan,IsRest:()=>qv,IsSchema:()=>Fc,IsString:()=>zl,IsSymbol:()=>Ux,IsTemplateLiteral:()=>ua,IsTemplateLiteralDeferred:()=>YXe,IsTemplateLiteralFinite:()=>dee,IsTemplateLiteralPattern:()=>HSi,IsThis:()=>Eee,IsTuple:()=>rs,IsTypeScriptEnumLike:()=>RJe,IsUndefined:()=>Yy,IsUnion:()=>On,IsUnknown:()=>wl,IsUnsafe:()=>KZ,IsVoid:()=>Jf,KeyOf:()=>JZe,KeyOfAction:()=>Wxe,KeyOfDeferred:()=>R4,KeyOfInstantiate:()=>XZe,KeysToIndexer:()=>X2,Literal:()=>us,LiteralTypeName:()=>Kan,Lowercase:()=>vZe,LowercaseAction:()=>xxe,LowercaseDeferred:()=>Cee,LowercaseInstantiate:()=>NZe,Mapped:()=>ZZe,MappedAction:()=>jxe,MappedDeferred:()=>I4,MappedInstantiate:()=>eet,Module:()=>Iet,ModuleDeferred:()=>IXe,ModuleInstantiate:()=>ite,Narrow:()=>fXe,Never:()=>Xo,NeverPattern:()=>SJe,NonNullable:()=>tet,NonNullableAction:()=>Jxe,NonNullableDeferred:()=>Nee,NonNullableInstantiate:()=>net,Null:()=>M2,Number:()=>Yf,NumberKey:()=>G2,NumberPattern:()=>cee,Object:()=>Kr,ObjectOptions:()=>wJe,Omit:()=>ret,OmitAction:()=>eSe,OmitDeferred:()=>Dee,OmitInstantiate:()=>set,Optional:()=>CJe,Parameter:()=>GN,Parameters:()=>oet,ParametersAction:()=>iSe,ParametersDeferred:()=>Pee,ParametersInstantiate:()=>aet,ParsePatternIntoTypes:()=>F2,ParseTemplateIntoTypes:()=>HXe,Partial:()=>cet,PartialAction:()=>aSe,PartialDeferred:()=>Mee,PartialInstantiate:()=>uet,Pick:()=>det,PickAction:()=>uSe,PickDeferred:()=>Oee,PickInstantiate:()=>pet,Priority:()=>Tet,PropertyKeys:()=>YZ,PropertyValues:()=>zZ,Readonly:()=>qJe,ReadonlyObject:()=>pSe,ReadonlyObjectAction:()=>hSe,ReadonlyObjectDeferred:()=>Lee,ReadonlyObjectInstantiate:()=>het,ReadonlyType:()=>met,Record:()=>$2,RecordAction:()=>V_e,RecordDeferred:()=>gee,RecordFromPattern:()=>_Xe,RecordInstantiate:()=>bXe,RecordKey:()=>Hv,RecordOptions:()=>C0i,RecordPattern:()=>vu,RecordPatternToType:()=>Aee,RecordValue:()=>_a,Ref:()=>Iu,RefInstantiate:()=>fet,Refine:()=>jJe,RefineAdd:()=>Yan,RemoveImmutable:()=>$Si,RemoveImmutableDeferred:()=>GSi,RemoveOptional:()=>mee,RemoveOptionalDeferred:()=>uXe,RemoveReadonly:()=>oXe,RemoveReadonlyDeferred:()=>sXe,Required:()=>Aet,RequiredAction:()=>ASe,RequiredArray:()=>IJe,RequiredDeferred:()=>Fee,RequiredInstantiate:()=>yet,Rest:()=>HN,ReturnType:()=>Eet,ReturnTypeAction:()=>bSe,ReturnTypeDeferred:()=>Qee,ReturnTypeInstantiate:()=>bet,Script:()=>Ret,String:()=>Wm,StringKey:()=>ab,StringPattern:()=>lee,Symbol:()=>O2,TemplateLiteral:()=>KXe,TemplateLiteralCreate:()=>pee,TemplateLiteralDecode:()=>Q2,TemplateLiteralDecodeUnsafe:()=>U_e,TemplateLiteralDeferred:()=>xee,TemplateLiteralEncode:()=>jXe,TemplateLiteralFromString:()=>Qdn,TemplateLiteralFromTypes:()=>zXe,This:()=>yee,Tuple:()=>il,TupleOptions:()=>nXe,Type:()=>Ne,TypeScriptEnumToEnumValues:()=>kJe,Uncapitalize:()=>RZe,UncapitalizeAction:()=>Cxe,UncapitalizeDeferred:()=>Iee,UncapitalizeInstantiate:()=>DZe,Undefined:()=>W2,Union:()=>Ri,UnionOptions:()=>tXe,Unknown:()=>Vl,Unsafe:()=>TJe,Uppercase:()=>kZe,UppercaseAction:()=>wxe,UppercaseDeferred:()=>wee,UppercaseInstantiate:()=>PZe,Void:()=>bee,With:()=>ste,WithAction:()=>SSe,WithDeferred:()=>Uee,WithInstantiate:()=>_et,_Array_:()=>Lh,_Function_:()=>Dx,_Object_:()=>Kr,default:()=>qSi});var qSi,Vm=v(()=>{p();j2();vet();Gx();TSe();_ee();ket();ket();qSi=Ne});function tr(t,e){return{name:t,login:async n=>{n.signal.throwIfAborted();let r=await n.prompt({type:"secret",message:`Enter ${t}`});return n.signal.throwIfAborted(),{type:"api_key",key:r}},resolve:async({ctx:n,credential:r,signal:i})=>{if(i.throwIfAborted(),r?.key)return{auth:{apiKey:r.key},env:r.env,source:"stored credential"};for(let s of e){let o=await n.env(s);if(i.throwIfAborted(),o)return{auth:{apiKey:o},source:s}}}}}function up(t){let e,n=()=>(e??=t.load(),e);return{name:t.name,isSubscription:t.isSubscription,loginLabel:t.loginLabel,login:async r=>(await n()).login(r),refresh:async(r,i)=>(await n()).refresh(r,i),toAuth:async r=>(await n()).toAuth(r)}}var Ls=v(()=>{p()});var $fn=v(()=>{p()});function Net(t){return new Bet(t)}function Det(t){let e=t.models,n,r=t.refreshModels;return{id:t.id,name:t.name??t.id,auth:t.auth,getModels:()=>e,refreshModels:r?()=>(n??=(async()=>{try{e=await r()}finally{n=void 0}})(),n):void 0,generateImages:(i,s,o)=>t.api.generateImages(i,s,o)}}var Bet,RSe=v(()=>{p();aAe();lAe();uAe();Bet=class{providers=new Map;credentials;authContext;constructor(e){this.credentials=e?.credentials??new HO,this.authContext=e?.authContext??JK()}setProvider(e){this.providers.set(e.id,e)}deleteProvider(e){this.providers.delete(e)}clearProviders(){this.providers.clear()}getProviders(){return Array.from(this.providers.values())}getProvider(e){return this.providers.get(e)}getModels(e){if(e!==void 0){let r=this.providers.get(e);if(!r)return[];try{return r.getModels()}catch{return[]}}let n=[];for(let r of this.providers.values())try{n.push(...r.getModels())}catch{}return n}getModel(e,n){return this.getModels(e).find(r=>r.id===n)}async refresh(e){if(e!==void 0){let n=this.providers.get(e);if(!n?.refreshModels)return;try{await n.refreshModels()}catch(r){throw r instanceof ko?r:new ko("model_source",`Model refresh failed for ${e}`,{cause:r})}return}await Promise.allSettled(Array.from(this.providers.values(),async n=>n.refreshModels?.()))}async getAuth(e,n){let r=typeof e=="string"?e:e.provider,i=this.providers.get(r);if(i)return ZK(i,this.credentials,this.authContext,n)}async generateImages(e,n,r){try{let i=this.providers.get(e.provider);if(!i)throw new ko("provider",`Unknown provider: ${e.provider}`);let s=await this.getAuth(e,{apiKey:r?.apiKey,env:r?.env,signal:r?.signal}),o=s?.auth;if(!o)return i.generateImages(e,n,r);let a=o.baseUrl?{...e,baseUrl:o.baseUrl}:e,c=r?.apiKey??o.apiKey,u=o.headers||r?.headers?{...o.headers,...r?.headers}:void 0,l=s.env||r?.env?{...s.env??{},...r?.env??{}}:void 0;return await i.generateImages(a,n,{...r,apiKey:c,headers:u,env:l})}catch(i){return{api:e.api,provider:e.provider,model:e.id,output:[],stopReason:"error",errorMessage:i instanceof Error?i.message:String(i),timestamp:Date.now()}}}}});function zfn(t){return{type:"text",text:t}}function zSi(t){return{type:"thinking",thinking:t}}function KSi(t,e,n={}){return{type:"toolCall",id:n.id??Oet("tool"),name:t,arguments:e}}function JSi(t){return typeof t=="string"?[zfn(t)]:Array.isArray(t)?t:[t]}function XSi(t,e={}){return{role:"assistant",content:JSi(t),api:jfn,provider:Vfn,model:Yfn,usage:NSe,stopReason:e.stopReason??"stop",...e.deferred===void 0?{}:{deferred:e.deferred},...e.errorMessage===void 0?{}:{errorMessage:e.errorMessage},...e.responseId===void 0?{}:{responseId:e.responseId},timestamp:e.timestamp??Date.now()}}function cte(t){return Math.ceil(t.length/4)}function Oet(t){return`${t}:${Date.now()}:${Math.random().toString(36).slice(2)}`}function Kfn(t){return typeof t=="string"?t:t.map(e=>e.type==="text"?e.text:`[image:${e.mimeType}:${e.data.length}]`).join(` +`)}function Jfn(t){return t.map(e=>e.type==="text"?e.text:e.type==="thinking"?e.thinking:`${e.name}:${JSON.stringify(e.arguments)}`).join(` +`)}function ZSi(t){return[t.toolName,...t.content.map(e=>Kfn([e]))].join(` +`)}function eCi(t){return t.role==="system"?[kc(t),...t.toolsRemoved?.map(e=>`tool-:${JSON.stringify(e)}`)??[],...t.toolsAdded?.map(e=>`tool+:${JSON.stringify(e)}`)??[]].filter(e=>e.length>0).join(` +`):t.role==="user"?Kfn(t.content):t.role==="assistant"?Jfn(t.content):ZSi(t)}function tCi(t){return t.messages.map(e=>`${e.role}:${eCi(e)}`).join(` + +`)}function nCi(t,e){let n=Math.min(t.length,e.length),r=0;for(;r0?r:[""]}function rCi(t,e,n,r){let i=structuredClone(t);return{...i,api:e,provider:n,model:r,timestamp:i.timestamp??Date.now(),usage:i.usage??NSe}}function qfn(t,e){return{role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:NSe,stopReason:"deferred",deferred:e,timestamp:Date.now()}}function kSe(t,e,n,r){return{role:"assistant",content:[],api:e,provider:n,model:r,usage:NSe,stopReason:"error",errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}function ate(t){return{...t,stopReason:"aborted",errorMessage:"Request was aborted",timestamp:Date.now()}}function Met(t,e){if(!e||e<=0)return new Promise(r=>queueMicrotask(r));let n=cte(t)/e*1e3;return new Promise(r=>setTimeout(r,n))}async function BSe(t,e,n,r,i,s){let o={...e,content:[],stopReason:"pending"};if(s?.aborted){let a=ate(o);t.push({type:"error",reason:"aborted",error:a}),t.end(a);return}t.push({type:"start",partial:{...o}});for(let a=0;a({id:E.id,name:E.name??E.id,api:e,provider:n,baseUrl:VSi,reasoning:E.reasoning??!1,input:E.input??["text","image"],inputLimits:E.inputLimits,cost:E.cost??{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:E.contextWindow??128e3,maxTokens:E.maxTokens??16384})),m=async(E,_,S,C)=>{let I=typeof E=="function"?await E(_,S,a,C):E;return Hfn(rCi(I,e,n,C.id),_,S,c)},h=(E,_,S)=>{let C=oAe(),I=s.shift();return a.callCount++,queueMicrotask(async()=>{try{if(await S?.onResponse?.({status:200,headers:{}},E),!I){let k=kSe(new Error("No more faux responses queued"),e,n,E.id);k=Hfn(k,_,S,c),C.push({type:"error",reason:"error",error:k}),C.end(k);return}if(S?.deferred){let k={provider:E.provider,modelId:E.id,api:E.api,id:Oet("deferred"),...t.deferred?.pollAfterMs!==void 0?{pollAfterMs:t.deferred.pollAfterMs}:{}};u.set(k.id,{handle:k,step:I,context:_,options:S,model:E,pendingFetches:Math.max(0,Math.floor(t.deferred?.pendingFetches??0)),cancelled:!1}),await BSe(C,qfn(E,k),r,i,o,S.signal);return}let w=await m(I,_,S,E);await BSe(C,w,r,i,o,S?.signal)}catch(w){let k=kSe(w,e,n,E.id);C.push({type:"error",reason:"error",error:k}),C.end(k)}}),C},f=(E,_,S)=>h(E,_,S),g=(E,_,S)=>{let C=oAe();return a.deferredFetchCount++,queueMicrotask(async()=>{try{await S?.onResponse?.({status:200,headers:{}},E);let I=u.get(_.id);if(!I||I.handle.provider!==_.provider||I.handle.modelId!==_.modelId||I.handle.api!==_.api)throw new Error(`Unknown faux deferred response: ${_.id}`);if(I.cancelled)throw new Error(`Faux deferred response was cancelled: ${_.id}`);if(I.pendingFetches>0){I.pendingFetches--,await BSe(C,qfn(E,I.handle),r,i,o,S?.signal);return}if(!I.final){let{deferred:w,signal:k,onResponse:N,...O}=I.options??{};try{I.final=await m(I.step,I.context,O,I.model)}catch(W){I.final=kSe(W,e,n,I.model.id)}}await BSe(C,I.final,r,i,o,S?.signal)}catch(I){let w=kSe(I,e,n,E.id);C.push({type:"error",reason:"error",error:w}),C.end(w)}}),C},A=async(E,_,S)=>{a.cancelledDeferred.push(structuredClone(_));let C=u.get(_.id);C&&(C.cancelled=!0),await S?.onResponse?.({status:200,headers:{}},E)};function y(E){return E?d.find(_=>_.id===E):d[0]}return{api:e,provider:n,models:d,stream:h,streamSimple:f,fetchDeferred:g,cancelDeferred:A,getModel:y,state:a,setResponses(E){s=[...E]},appendResponses(E){s.push(...E)},getPendingResponseCount(){return s.length}}}function iCi(t={}){let e=DSe(t);return{provider:Mn({id:e.provider,auth:{apiKey:{name:"Faux",resolve:async()=>({auth:{}})}},models:e.models,api:{stream:e.stream,streamSimple:e.streamSimple,fetchDeferred:e.fetchDeferred,cancelDeferred:e.cancelDeferred}}),api:e.api,models:e.models,getModel:e.getModel,state:e.state,setResponses:e.setResponses,appendResponses:e.appendResponses,getPendingResponseCount:e.getPendingResponseCount}}var jfn,Vfn,Yfn,jSi,VSi,YSi,Wfn,NSe,Let=v(()=>{p();ni();eA();Cy();jfn="faux",Vfn="faux",Yfn="faux-1",jSi="Faux Model",VSi="http://localhost:0",YSi=3,Wfn=5,NSe={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}});var Xfn=v(()=>{p()});function sCi(t){return{type:"text",text:t.text,...t.textSignature===void 0?{}:{textSignature:t.textSignature}}}function oCi(t){return{type:"thinking",thinking:t.thinking,...t.thinkingSignature===void 0?{}:{thinkingSignature:t.thinkingSignature},...t.redacted===void 0?{}:{redacted:t.redacted}}}function aCi(t){return{type:"toolCall",id:t.id,name:t.name,arguments:structuredClone(t.arguments),...t.thoughtSignature===void 0?{}:{thoughtSignature:t.thoughtSignature},...t.namespace===void 0?{}:{namespace:t.namespace}}}function cCi(t){return{role:"assistant",content:[],api:t.api,provider:t.provider,model:t.model,...t.responseModel===void 0?{}:{responseModel:t.responseModel},...t.responseId===void 0?{}:{responseId:t.responseId},...t.providerThinkingLevel===void 0?{}:{providerThinkingLevel:t.providerThinkingLevel},...t.diagnostics===void 0?{}:{diagnostics:structuredClone(t.diagnostics)},usage:structuredClone(t.usage),stopReason:"pending",timestamp:t.timestamp}}function lte(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Invalid assistant message frame contentIndex: ${t}`)}function $4(t){lte(t.contentIndex);let e=t.partial.content[t.contentIndex];if(!e)throw new Error(`${t.type} event has no content block at index ${t.contentIndex}`);return e}function Qet(t){let e=JSON.stringify(t);if(e===void 0)throw new Error("Tool-call arguments are not JSON-serializable");return e}function Uet(t,e){if(typeof t=="string")return typeof e=="string"&&e.startsWith(t);if(Array.isArray(t))return Array.isArray(e)&&t.length<=e.length&&t.every((r,i)=>Uet(r,e[i]));if(typeof t!="object"||t===null)return Object.is(t,e);if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=e;return Object.entries(t).every(([r,i])=>Object.hasOwn(n,r)&&Uet(i,n[r]))}function Fet(t,e,n,r,i){if(lte(n),n!==t.content.length){let s=n{p();tv();lCi=Qet(ec(""));ute=class{started=!1;terminal=!1;blocks=new Map;encode(e){if(this.terminal)throw new Error(`Assistant message event ${e.type} follows a terminal event`);switch(e.type){case"start":if(this.started)throw new Error("Assistant message stream contains more than one start event");return this.started=!0,{type:"start",partial:cCi(e.partial)};case"done":if(!this.started)throw new Error("Assistant message done event appears before start");this.terminal=!0;return;case"error":this.terminal=!0;return}if(!this.started)throw new Error(`Assistant message ${e.type} event appears before start`);switch(e.type){case"text_start":{let n=$4(e);if(n.type!=="text")throw new Error(`text_start event points to ${n.type} block at index ${e.contentIndex}`);return this.startBlock(e.contentIndex,{kind:"text",coveredChars:n.text.length,deltaChars:0}),{type:"text_start",contentIndex:e.contentIndex,content:sCi(n)}}case"text_delta":return this.encodeTextDelta(e.contentIndex,e.delta,"text");case"text_end":{let n=$4(e);if(n.type!=="text")throw new Error(`text_end event points to ${n.type} block at index ${e.contentIndex}`);return this.endBlock(e.contentIndex,"text"),{type:"text_end",contentIndex:e.contentIndex,content:e.content,...n.textSignature===void 0?{}:{textSignature:n.textSignature}}}case"thinking_start":{let n=$4(e);if(n.type!=="thinking")throw new Error(`thinking_start event points to ${n.type} block at index ${e.contentIndex}`);return this.startBlock(e.contentIndex,{kind:"thinking",coveredChars:n.thinking.length,deltaChars:0}),{type:"thinking_start",contentIndex:e.contentIndex,content:oCi(n)}}case"thinking_delta":return this.encodeTextDelta(e.contentIndex,e.delta,"thinking");case"thinking_end":{let n=$4(e);if(n.type!=="thinking")throw new Error(`thinking_end event points to ${n.type} block at index ${e.contentIndex}`);return this.endBlock(e.contentIndex,"thinking"),{type:"thinking_end",contentIndex:e.contentIndex,content:e.content,...n.thinkingSignature===void 0?{}:{thinkingSignature:n.thinkingSignature},...n.redacted===void 0?{}:{redacted:n.redacted}}}case"toolcall_start":{let n=$4(e);if(n.type!=="toolCall")throw new Error(`toolcall_start event points to ${n.type} block at index ${e.contentIndex}`);let r=Qet(n.arguments),i=r===lCi;return this.startBlock(e.contentIndex,{kind:"toolCall",caughtUp:i,catchupJson:"",snapshotArguments:i?"":r}),{type:"toolcall_start",contentIndex:e.contentIndex,toolCall:aCi(n)}}case"toolcall_delta":{let n=this.block(e.contentIndex,"toolCall");if(n.kind!=="toolCall")throw new Error("Unreachable tool-call encoder state");if(n.caughtUp)return e.delta.length===0?void 0:{type:"toolcall_delta",contentIndex:e.contentIndex,delta:e.delta};n.catchupJson+=e.delta;let r=ec(n.catchupJson);if(Qet(r)!==n.snapshotArguments){let s=ec(n.snapshotArguments);if(!Uet(s,r))return}n.caughtUp=!0,n.snapshotArguments="";let i=n.catchupJson;return n.catchupJson="",i.length===0?void 0:{type:"toolcall_checkpoint",contentIndex:e.contentIndex,json:i}}case"toolcall_end":{let n=$4(e);if(n.type!=="toolCall")throw new Error(`toolcall_end event points to ${n.type} block at index ${e.contentIndex}`);if(e.toolCall.type!=="toolCall")throw new Error(`toolcall_end event has invalid tool call at index ${e.contentIndex}`);return this.endBlock(e.contentIndex,"toolCall"),{type:"toolcall_end",contentIndex:e.contentIndex,id:e.toolCall.id,name:e.toolCall.name,arguments:structuredClone(e.toolCall.arguments),...e.toolCall.thoughtSignature===void 0?{}:{thoughtSignature:e.toolCall.thoughtSignature},...e.toolCall.namespace===void 0?{}:{namespace:e.toolCall.namespace}}}}}startBlock(e,n){if(lte(e),this.blocks.has(e))throw new Error(`Assistant message block ${e} starts more than once`);this.blocks.set(e,n)}block(e,n){lte(e);let r=this.blocks.get(e);if(r===void 0)throw new Error(`Assistant message ${n} block ${e} has not started`);if(r.kind!==n)throw new Error(`Assistant message block ${e} is ${r.kind}, not ${n}`);return r}endBlock(e,n){this.block(e,n),this.blocks.delete(e)}encodeTextDelta(e,n,r){let i=this.block(e,r);if(i.kind==="toolCall")throw new Error("Unreachable text encoder state");let s=i.deltaChars;i.deltaChars+=n.length;let o=Math.max(0,i.coveredChars-s);if(o>=n.length)return;let a=o===0?n:n.slice(o);return r==="text"?{type:"text_delta",contentIndex:e,delta:a}:{type:"thinking_delta",contentIndex:e,delta:a}}}});function rF(t,e){return!!(t.stopReason==="error"&&t.errorMessage&&!dCi.some(r=>r.test(t.errorMessage))&&(egn.some(r=>r.test(t.errorMessage))||t.provider==="cerebras"&&uCi.test(t.errorMessage))||e&&t.stopReason==="stop"&&t.usage.input+t.usage.cacheRead>e||e&&t.stopReason==="length"&&t.usage.output===0&&t.usage.input+t.usage.cacheRead>=e*.99)}function dte(t,e){return t.stopReason==="length"&&e>0&&t.usage.output{p();egn=[/prompt (?:is )?too long/i,/request_too_large/i,/input is too long for requested model/i,/exceeds the context window/i,/exceeds (?:the )?(?:model'?s )?maximum context length(?: of [\d,]+ tokens?|\s*\([\d,]+\))/i,/input token count.*exceeds the maximum/i,/maximum prompt length is \d+/i,/reduce the length of the messages/i,/maximum context length is \d+ tokens/i,/exceeds (?:the )?maximum allowed input length of [\d,]+ tokens?/i,/input \(\d+ tokens\) is longer than the model'?s context length \(\d+ tokens\)/i,/exceeds the limit of \d+/i,/exceeds the available context size/i,/greater than the context length/i,/context window exceeds limit/i,/exceeded model token limit/i,/too large for model with \d+ maximum context length/i,/prompt has [\d,]+ tokens?, but the configured context size is [\d,]+ tokens?/i,/model_context_window_exceeded/i,/prompt too long; exceeded (?:max )?context length/i,/range of input length should be/i,/context[_ ]length[_ ]exceeded/i,/too many tokens/i,/token limit exceeded/i],uCi=/^4(?:00|13)\s*(?:status code)?\s*\(no body\)/i,dCi=[/^(Throttling error|Service unavailable):/i,/rate limit/i,/too many requests/i]});function ngn(t){return new RegExp(t.join("|"),"i")}function Wx(t,e){let n=t.baseDelayMs*2**Math.max(0,e-1),r=Number.isSafeInteger(n)?n:Number.MAX_SAFE_INTEGER;return Math.min(r,t.maxAgentDelayMs??KN)}function fCi(t,e){return new Promise((n,r)=>{if(e?.aborted){r(new pte);return}let i=setTimeout(n,t);e?.addEventListener("abort",()=>{clearTimeout(i),r(new pte)},{once:!0})})}async function mte(t,e,n,r){let i=e?.enabled?e.maxRetries:0,s=0,o;for(;;){let a=await t();if(a.stopReason==="aborted")return o&&await r?.onRetryFinished?.(!1,o.attempt),a;if(a.stopReason!=="error")return o&&await r?.onRetryFinished?.(!0,o.attempt),a;if(s>=i||!Jy(a))return o&&await r?.onRetryFinished?.(!1,o.attempt,a.errorMessage),a;s++,o={attempt:s,errorMessage:a.errorMessage||"Unknown error"};let c=Wx(e,s);await r?.onRetryScheduled?.(s,i,c,o.errorMessage);try{await fCi(c,n)}catch(u){if(await r?.onRetryFinished?.(!1,s,o.errorMessage),u instanceof pte){let{errorMessage:l,...d}=a;return{...d,stopReason:"aborted"}}throw u}await r?.onRetryAttemptStart?.()}}function Jy(t){if(t.stopReason!=="error"||!t.errorMessage)return!1;let e=t.errorMessage;return mCi.test(e)?!1:hCi.test(e)}var mCi,hCi,KN,pte,rgn=v(()=>{p();mCi=ngn(["GoUsageLimitError","FreeUsageLimitError","Monthly usage limit reached","available balance","insufficient_quota","out of budget","quota exceeded","billing"]),hCi=ngn(["overloaded","currently experiencing high demand","rate.?limit","too many requests","429","500","502","503","504","520","524","service.?unavailable","server.?error","internal.?error","provider.?returned.?error","exceeded request buffer limit while retrying upstream","network.?error","connection.?error","connection.?refused","connection.?lost","other side closed","fetch failed","getaddrinfo","ENOTFOUND","EAI_AGAIN","upstream.?connect","reset before headers","socket hang up","socket connection was closed","timed? out","timeout","terminated","websocket.?closed","websocket.?error","ended without","stream ended before message_stop","stream ended before a terminal response event","http2 request did not get a response","retry delay","you can retry your request","try your request again","please retry your request","ResourceExhausted"]),KN=6e4;pte=class extends Error{constructor(){super("Aborted")}}});function gCi(t,e){return Ne.Unsafe({type:"string",enum:t,...e?.description&&{description:e.description},...e?.default&&{default:e.default}})}var ign=v(()=>{p();Vm()});function hte(t){return L.HasPropertyKey(t,"~refine")&&L.IsArray(t["~refine"])&&L.Every(t["~refine"],0,e=>L.IsObject(e)&&L.HasPropertyKey(e,"check")&&L.HasPropertyKey(e,"error")&&L.IsFunction(e.check)&&L.IsFunction(e.error))}var sgn=v(()=>{p();ft()});function Nd(t){return L.IsObject(t)&&!L.IsArray(t)}function zv(t){return L.IsBoolean(t)}function Li(t){return Nd(t)||zv(t)}var Ru=v(()=>{p();ft()});function H4(t){return L.HasPropertyKey(t,"additionalItems")&&Li(t.additionalItems)}var ogn=v(()=>{p();ft();Ru()});function AA(t){return L.HasPropertyKey(t,"additionalProperties")&&Li(t.additionalProperties)}var agn=v(()=>{p();ft();Ru()});function fte(t){return L.HasPropertyKey(t,"allOf")&&L.IsArray(t.allOf)&&t.allOf.every(e=>Li(e))}var cgn=v(()=>{p();ft();Ru()});function gte(t){return L.HasPropertyKey(t,"$anchor")&&L.IsString(t.$anchor)}var lgn=v(()=>{p();ft()});function Ate(t){return L.HasPropertyKey(t,"anyOf")&&L.IsArray(t.anyOf)&&t.anyOf.every(e=>Li(e))}var ugn=v(()=>{p();ft();Ru()});function PSe(t){return L.HasPropertyKey(t,"const")}var dgn=v(()=>{p();ft()});function GI(t){return L.HasPropertyKey(t,"contains")&&Li(t.contains)}var pgn=v(()=>{p();ft();Ru()});function yA(t){return L.HasPropertyKey(t,"default")}var mgn=v(()=>{p();ft()});var hgn=v(()=>{p();ft();Ru()});function yte(t){return L.HasPropertyKey(t,"dependencies")&&L.IsObject(t.dependencies)&&Object.values(t.dependencies).every(e=>Li(e)||L.IsArray(e)&&e.every(n=>L.IsString(n)))}var fgn=v(()=>{p();ft();Ru()});function Ete(t){return L.HasPropertyKey(t,"dependentRequired")&&L.IsObject(t.dependentRequired)&&Object.values(t.dependentRequired).every(e=>L.IsArray(e)&&e.every(n=>L.IsString(n)))}var ggn=v(()=>{p();ft()});function q4(t){return L.HasPropertyKey(t,"dependentSchemas")&&L.IsObject(t.dependentSchemas)&&Object.values(t.dependentSchemas).every(e=>Li(e))}var Agn=v(()=>{p();ft();Ru()});function Kv(t){return L.HasPropertyKey(t,"$dynamicAnchor")&&L.IsString(t.$dynamicAnchor)}var ygn=v(()=>{p();ft()});function bte(t){return L.HasPropertyKey(t,"$dynamicRef")&&L.IsString(t.$dynamicRef)}var Egn=v(()=>{p();ft()});function _te(t){return L.HasPropertyKey(t,"else")&&Li(t.else)}var bgn=v(()=>{p();ft();Ru()});function MSe(t){return L.HasPropertyKey(t,"enum")&&L.IsArray(t.enum)}var _gn=v(()=>{p();ft()});function xte(t){return L.HasPropertyKey(t,"exclusiveMaximum")&&(L.IsNumber(t.exclusiveMaximum)||L.IsBigInt(t.exclusiveMaximum))}var xgn=v(()=>{p();ft()});function Hx(t){return L.HasPropertyKey(t,"exclusiveMinimum")&&(L.IsNumber(t.exclusiveMinimum)||L.IsBigInt(t.exclusiveMinimum))}var Sgn=v(()=>{p();ft()});function iF(t){return L.HasPropertyKey(t,"format")&&L.IsString(t.format)}var Cgn=v(()=>{p();ft()});function Xy(t){return L.HasPropertyKey(t,"$id")&&L.IsString(t.$id)}var Ign=v(()=>{p();ft()});function Ste(t){return L.HasPropertyKey(t,"if")&&Li(t.if)}var wgn=v(()=>{p();ft();Ru()});function Jv(t){return L.HasPropertyKey(t,"items")&&(Li(t.items)||L.IsArray(t.items)&&t.items.every(e=>Li(e)))}function Cte(t){return Jv(t)&&L.IsArray(t.items)}var Tgn=v(()=>{p();ft();Ru()});function Ite(t){return L.HasPropertyKey(t,"maximum")&&(L.IsNumber(t.maximum)||L.IsBigInt(t.maximum))}var vgn=v(()=>{p();ft()});function wte(t){return L.HasPropertyKey(t,"maxContains")&&L.IsNumber(t.maxContains)}var Rgn=v(()=>{p();ft()});function sF(t){return L.HasPropertyKey(t,"maxItems")&&L.IsNumber(t.maxItems)}var kgn=v(()=>{p();ft()});function Tte(t){return L.HasPropertyKey(t,"maxLength")&&L.IsNumber(t.maxLength)}var Bgn=v(()=>{p();ft()});function vte(t){return L.HasPropertyKey(t,"maxProperties")&&L.IsNumber(t.maxProperties)}var Ngn=v(()=>{p();ft()});function qx(t){return L.HasPropertyKey(t,"minimum")&&(L.IsNumber(t.minimum)||L.IsBigInt(t.minimum))}var Dgn=v(()=>{p();ft()});function Xv(t){return L.HasPropertyKey(t,"minContains")&&L.IsNumber(t.minContains)}var Pgn=v(()=>{p();ft()});function Zv(t){return L.HasPropertyKey(t,"minItems")&&L.IsNumber(t.minItems)}var Mgn=v(()=>{p();ft()});function oF(t){return L.HasPropertyKey(t,"minLength")&&L.IsNumber(t.minLength)}var Ogn=v(()=>{p();ft()});function aF(t){return L.HasPropertyKey(t,"minProperties")&&L.IsNumber(t.minProperties)}var Lgn=v(()=>{p();ft()});function Rte(t){return L.HasPropertyKey(t,"multipleOf")&&(L.IsNumber(t.multipleOf)||L.IsBigInt(t.multipleOf))}var Fgn=v(()=>{p();ft()});function kte(t){return L.HasPropertyKey(t,"not")&&Li(t.not)}var Qgn=v(()=>{p();ft();Ru()});function Bte(t){return L.HasPropertyKey(t,"oneOf")&&L.IsArray(t.oneOf)&&t.oneOf.every(e=>Li(e))}var Ugn=v(()=>{p();ft();Ru()});function cF(t){return L.HasPropertyKey(t,"pattern")&&(L.IsString(t.pattern)||t.pattern instanceof RegExp)}var Ggn=v(()=>{p();ft()});function eR(t){return L.HasPropertyKey(t,"patternProperties")&&L.IsObject(t.patternProperties)&&Object.values(t.patternProperties).every(e=>Li(e))}var $gn=v(()=>{p();ft();Ru()});function jx(t){return L.HasPropertyKey(t,"prefixItems")&&L.IsArray(t.prefixItems)&&t.prefixItems.every(e=>Li(e))}var Wgn=v(()=>{p();ft();Ru()});function tR(t){return L.HasPropertyKey(t,"properties")&&L.IsObject(t.properties)&&Object.values(t.properties).every(e=>Li(e))}var Hgn=v(()=>{p();ft();Ru()});function j4(t){return L.HasPropertyKey(t,"propertyNames")&&(L.IsObject(t.propertyNames)||Li(t.propertyNames))}var qgn=v(()=>{p();ft();Ru()});function ACi(t){return L.HasPropertyKey(t,"$recursiveAnchor")&&L.IsBoolean(t.$recursiveAnchor)}function Nte(t){return ACi(t)&&L.IsEqual(t.$recursiveAnchor,!0)}var jgn=v(()=>{p();ft()});function Dte(t){return L.HasPropertyKey(t,"$recursiveRef")&&L.IsString(t.$recursiveRef)}var Vgn=v(()=>{p();ft()});function Pte(t){return L.HasPropertyKey(t,"$ref")&&L.IsString(t.$ref)}var Ygn=v(()=>{p();ft()});function Vx(t){return L.HasPropertyKey(t,"required")&&L.IsArray(t.required)&&t.required.every(e=>L.IsString(e))}var zgn=v(()=>{p();ft()});function Mte(t){return L.HasPropertyKey(t,"then")&&Li(t.then)}var Kgn=v(()=>{p();ft();Ru()});function Ote(t){return L.HasPropertyKey(t,"type")&&(L.IsString(t.type)||L.IsArray(t.type)&&t.type.every(e=>L.IsString(e)))}var Jgn=v(()=>{p();ft()});function $I(t){return L.HasPropertyKey(t,"uniqueItems")&&L.IsBoolean(t.uniqueItems)}var Xgn=v(()=>{p();ft()});function JN(t){return L.HasPropertyKey(t,"unevaluatedItems")&&Li(t.unevaluatedItems)}var Zgn=v(()=>{p();ft();Ru()});function XN(t){return L.HasPropertyKey(t,"unevaluatedProperties")&&Li(t.unevaluatedProperties)}var eAn=v(()=>{p();ft();Ru()});var da=v(()=>{p();sgn();ogn();agn();cgn();lgn();ugn();dgn();pgn();mgn();hgn();fgn();ggn();Agn();ygn();Egn();bgn();_gn();xgn();Sgn();Cgn();Ign();wgn();Tgn();vgn();Rgn();kgn();Bgn();Ngn();Dgn();Pgn();Mgn();Ogn();Lgn();Fgn();Qgn();Ugn();Ggn();$gn();Wgn();Hgn();qgn();jgn();Vgn();Ygn();zgn();Ru();Kgn();Jgn();Xgn();Zgn();eAn()});function yCi(t){return JN(t)||XN(t)||L.Some(L.Keys(t),e=>OSe(t[e]))}function ECi(t){return L.Some(t,e=>OSe(e))}function OSe(t){return L.IsArray(t)?ECi(t):L.IsObject(t)?yCi(t):!1}function tAn(t,e){return OSe(e)||L.Some(L.Keys(t),n=>OSe(t[n]))}var LSe,Zp,em,WI=v(()=>{p();NI();da();ft();LSe=class{constructor(e){this.hasUnevaluated=e}UseUnevaluated(){return this.hasUnevaluated}Push(){return Fe.Call(Fe.Member("context","Push"),[])}Pop(){return Fe.Call(Fe.Member("context","Pop"),[])}AddIndex(e){return Fe.Call(Fe.Member("context","AddIndex"),[e])}AddKey(e){return Fe.Call(Fe.Member("context","AddKey"),[e])}Merge(e){return Fe.Call(Fe.Member("context","Merge"),[e])}},Zp=class{constructor(){let e=new Set,n=new Set;this.stack=[{indices:e,keys:n}]}Push(){let e=new Set,n=new Set;return this.stack.push({indices:e,keys:n}),!0}Pop(){return this.stack.pop(),!0}AddIndex(e){return this.GetIndices().add(e),!0}AddKey(e){return this.GetKeys().add(e),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(e){for(let n of e)n.GetIndices().forEach(r=>this.GetIndices().add(r)),n.GetKeys().forEach(r=>this.GetKeys().add(r));return!0}},em=class extends Zp{constructor(){super(),this.errors=[]}AtCapacity(){return this.errors.length>=Lc.Get().maxErrors}AddError(e){return this.AtCapacity()||this.errors.push(e),!1}GetErrors(){return this.errors}}});function lb(t){let e=`External[${FSe.variables.length}]`;return FSe.variables.push(t),e}function nAn(){FSe.variables=[]}function rAn(){return{...FSe}}var FSe,ZN=v(()=>{p();FSe={identifier:"External",variables:[]}});function iAn(t,e,n,r){let i=lb(n["~refine"].map(s=>s));return Fe.Every(i,Fe.Constant(0),["refinement","_"],Fe.Call(Fe.Member("refinement","check"),[r]))}function sAn(t,e,n,r){return L.Every(n["~refine"],0,(i,s)=>i.check(r))}function oAn(t,e,n,r,i,s){return L.EveryAll(i["~refine"],0,(o,a)=>o.check(s)||e.AddError({keyword:"~refine",schemaPath:n,instancePath:r,params:{index:a,message:o.error(s)}}))}var Get=v(()=>{p();ZN();ft()});function ta(){return`var_${bCi++}`}var bCi,Yx=v(()=>{p();bCi=0});function $et(t){return Jv(t)&&L.IsArray(t.items)}function _Ci(t,e,n,r){let[i,s]=[ta(),ta()],o=Wh(t,e,n.additionalItems,i),a=Fe.IsLessThan(s,Fe.Constant(n.items.length)),c=e.AddIndex(s);return Fe.Every(r,Fe.Constant(0),[i,s],Fe.Or(a,Fe.And(o,c)))}function xCi(t,e,n,r){let[i,s]=[ta(),ta()],o=Wh(t,e,n.additionalItems,i),a=Fe.IsLessThan(s,Fe.Constant(n.items.length));return Fe.Every(r,Fe.Constant(0),[i,s],Fe.Or(a,o))}function aAn(t,e,n,r){return $et(n)?e.UseUnevaluated()?_Ci(t,e,n,r):xCi(t,e,n,r):Fe.Constant(!0)}function cAn(t,e,n,r){return $et(n)?L.Every(r,0,(s,o)=>L.IsLessThan(o,n.items.length)||Zy(t,e,n.additionalItems,s)&&e.AddIndex(o)):!0}function lAn(t,e,n,r,i,s){return $et(i)?L.Every(s,0,(a,c)=>{let u=`${n}/additionalItems`,l=`${r}/${c}`;return L.IsLessThan(c,i.items.length)||eE(t,e,u,l,i.additionalItems,a)&&e.AddIndex(c)}):!0}var Wet=v(()=>{p();da();Yx();ft();Uc()});function zx(t){return new RegExp(t,"u")}var QSe=v(()=>{p()});function SCi(t,e){return!t.UseUnevaluated()&&(L.IsEqual(e,!0)||L.IsObject(e)&&L.IsEqual(L.Keys(e).length,0))}function CCi(t){return`^${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Het(t){let e=[];return eR(t)&&e.push(...L.Keys(t.patternProperties)),tR(t)&&e.push(...L.Keys(t.properties).map(CCi)),L.IsEqual(e.length,0)?"(?!)":`(${e.join("|")})`}function ICi(t,e,n){return Vx(e)&&tR(e)&&!eR(e)&&L.IsEqual(e.additionalProperties,!1)&&L.IsEqual(L.Keys(e.properties).length,e.required.length)}function wCi(t,e,n){return Fe.IsEqual(Fe.Member(Fe.Call(Fe.Member("Object","getOwnPropertyNames"),[n]),"length"),Fe.Constant(e.required.length))}function TCi(t,e,n,r){let[i,s]=[ta(),ta()],o=lb(zx(Het(n))),a=Wh(t,e,n.additionalProperties,`${r}[${i}]`),c=Fe.Call(Fe.Member(o,"test"),[i]),u=e.AddKey(i),l=e.UseUnevaluated()?Fe.Or(c,Fe.And(a,u)):Fe.Or(c,a);return Fe.Every(Fe.Keys(r),Fe.Constant(0),[i,s],l)}function uAn(t,e,n,r){return SCi(e,n.additionalProperties)?Fe.Constant(!0):ICi(e,n,r)?wCi(e,n,r):TCi(t,e,n,r)}function dAn(t,e,n,r){let i=zx(Het(n));return L.Every(L.Keys(r),0,(o,a)=>i.test(o)||Zy(t,e,n.additionalProperties,r[o])&&e.AddKey(o))}function pAn(t,e,n,r,i,s){let o=zx(Het(i)),a=[];return L.EveryAll(L.Keys(s),0,(u,l)=>{let d=`${n}/additionalProperties`,m=`${r}/${u}`,h=o.test(u)||eE(t,e,d,m,i.additionalProperties,s[u])&&e.AddKey(u);return h||a.push(u),h})||e.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:r,params:{additionalProperties:a}})}var qet=v(()=>{p();da();ZN();Yx();QSe();ft();Uc()});function eD(t,e,n,r,i){let s=Fe.ConstDeclaration("results","[]"),o=n.map((l,d)=>Fe.ConstDeclaration(`context_${d}`,Fe.New("CheckContext",[]))),a=n.map((l,d)=>Fe.ConstDeclaration(`condition_${d}`,Fe.Call(Fe.ArrowFunction(["context"],So(t,e,l,r)),[`context_${d}`]))),c=n.map((l,d)=>Fe.If(`condition_${d}`,Fe.Call(Fe.Member("results","push"),[`context_${d}`]))),u=Fe.Return(Fe.And(i,e.Merge("results")));return Fe.Call(Fe.ArrowFunction([],Fe.Statements([s,...o,...a,...c,u])),[])}var Y4=v(()=>{p();ft();Uc()});function vCi(t,e,n,r){return eD(t,e,n.allOf,r,Fe.IsEqual(Fe.Member("results","length"),Fe.Constant(n.allOf.length)))}function RCi(t,e,n,r){return Fe.ReduceAnd(n.allOf.map(i=>So(t,e,i,r)))}function mAn(t,e,n,r){return e.UseUnevaluated()?vCi(t,e,n,r):RCi(t,e,n,r)}function hAn(t,e,n,r){let i=n.allOf.reduce((s,o)=>{let a=new Zp;return Vs(t,a,o,r)?[...s,a]:s},[]);return L.IsEqual(i.length,n.allOf.length)&&e.Merge(i)}function fAn(t,e,n,r,i,s){let o=[],a=i.allOf.reduce((u,l,d)=>{let m=`${n}/allOf/${d}`,h=new em,f=Fa(t,h,m,r,l,s);return f||o.push(h),f?[...u,h]:u},[]),c=L.IsEqual(a.length,i.allOf.length)&&e.Merge(a);return c||o.forEach(u=>u.GetErrors().forEach(l=>e.AddError(l))),c}var jet=v(()=>{p();WI();Y4();ft();Uc()});function kCi(t,e,n,r){return eD(t,e,n.anyOf,r,Fe.IsGreaterThan(Fe.Member("results","length"),Fe.Constant(0)))}function BCi(t,e,n,r){return Fe.ReduceOr(n.anyOf.map(i=>So(t,e,i,r)))}function gAn(t,e,n,r){return e.UseUnevaluated()?kCi(t,e,n,r):BCi(t,e,n,r)}function AAn(t,e,n,r){let i=n.anyOf.reduce((s,o)=>{let a=new Zp;return Vs(t,a,o,r)?[...s,a]:s},[]);return L.IsGreaterThan(i.length,0)&&e.Merge(i)}function yAn(t,e,n,r,i,s){let o=[],a=i.anyOf.reduce((u,l,d)=>{let m=new em,h=`${n}/anyOf/${d}`,f=Fa(t,m,h,r,l,s);return f||o.push(m),f?[...u,m]:u},[]),c=L.IsGreaterThan(a.length,0)&&e.Merge(a);return c||o.forEach(u=>u.GetErrors().forEach(l=>e.AddError(l))),c||e.AddError({keyword:"anyOf",schemaPath:n,instancePath:r,params:{}})}var Vet=v(()=>{p();WI();Y4();ft();Uc()});function EAn(t,e,n,r){return n?Fe.Constant(!0):Fe.Constant(!1)}function Yet(t,e,n,r){return n}function bAn(t,e,n,r,i,s){return Yet(t,e,i,s)||e.AddError({keyword:"boolean",schemaPath:n,instancePath:r,params:{}})}var zet=v(()=>{p();ft()});function _An(t,e,n,r){return L.IsValueLike(n.const)?Fe.IsEqual(r,Fe.Constant(n.const)):Fe.IsDeepEqual(r,lb(n.const))}function Ket(t,e,n,r){return L.IsValueLike(n.const)?L.IsEqual(r,n.const):L.IsDeepEqual(r,n.const)}function xAn(t,e,n,r,i,s){return Ket(t,e,i,s)||e.AddError({keyword:"const",schemaPath:n,instancePath:r,params:{allowedValue:i.const}})}var Jet=v(()=>{p();ZN();ft()});function SAn(t){return!(Xv(t)&&L.IsEqual(t.minContains,0))}function NCi(t,e,n,r){let[i,s]=[ta(),ta()],o=Fe.Not(Fe.IsEqual(Fe.Member(r,"length"),Fe.Constant(0))),a=Fe.SomeAll(r,[i,s],Fe.And(So(t,e,n.contains,i),e.AddIndex(s)));return Fe.And(o,a)}function DCi(t,e,n,r){let[i]=[ta()],s=Fe.Not(Fe.IsEqual(Fe.Member(r,"length"),Fe.Constant(0))),o=Fe.Some(r,[i,"_"],So(t,e,n.contains,i));return Fe.And(s,o)}function CAn(t,e,n,r){return SAn(n)?e.UseUnevaluated()?NCi(t,e,n,r):DCi(t,e,n,r):Fe.Constant(!0)}function Xet(t,e,n,r){return SAn(n)?!L.IsEqual(r.length,0)&&L.SomeAll(r,(i,s)=>Vs(t,e,n.contains,i)&&e.AddIndex(s)):!0}function IAn(t,e,n,r,i,s){return Xet(t,e,i,s)||e.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:1}})}var Zet=v(()=>{p();da();Yx();ft();Uc()});function wAn(t,e,n,r){let i=Fe.IsEqual(Fe.Member(Fe.Keys(r),"length"),Fe.Constant(0)),s=Fe.ReduceAnd(L.Entries(n.dependencies).map(([o,a])=>{let c=Fe.Not(Fe.HasPropertyKey(r,Fe.Constant(o))),u=So(t,e,a,r),l=d=>Fe.ReduceAnd(d.map(m=>Fe.HasPropertyKey(r,Fe.Constant(m))));return Fe.Or(c,L.IsArray(a)?l(a):u)}));return Fe.Or(i,s)}function TAn(t,e,n,r){let i=L.IsEqual(L.Keys(r).length,0),s=L.Every(L.Entries(n.dependencies),0,([o,a])=>!L.HasPropertyKey(r,o)||(L.IsArray(a)?a.every(c=>L.HasPropertyKey(r,c)):Vs(t,e,a,r)));return i||s}function vAn(t,e,n,r,i,s){let o=L.IsEqual(L.Keys(s).length,0),a=L.EveryAll(L.Entries(i.dependencies),0,([c,u])=>{let l=`${n}/dependencies/${c}`;return!L.HasPropertyKey(s,c)||(L.IsArray(u)?u.every(d=>L.HasPropertyKey(s,d)||e.AddError({keyword:"dependencies",schemaPath:n,instancePath:r,params:{property:c,dependencies:u}})):Fa(t,e,l,r,u,s))});return o||a}var ett=v(()=>{p();ft();Uc()});function RAn(t,e,n,r){let i=Fe.IsEqual(Fe.Member(Fe.Keys(r),"length"),Fe.Constant(0)),s=Fe.ReduceAnd(L.Entries(n.dependentRequired).map(([o,a])=>{let c=Fe.Not(Fe.HasPropertyKey(r,Fe.Constant(o))),u=Fe.ReduceAnd(a.map(l=>Fe.HasPropertyKey(r,Fe.Constant(l))));return Fe.Or(c,u)}));return Fe.Or(i,s)}function kAn(t,e,n,r){let i=L.IsEqual(L.Keys(r).length,0),s=L.Every(L.Entries(n.dependentRequired),0,([o,a])=>!L.HasPropertyKey(r,o)||a.every(c=>L.HasPropertyKey(r,c)));return i||s}function BAn(t,e,n,r,i,s){let o=L.IsEqual(L.Keys(s).length,0),a=L.EveryAll(L.Entries(i.dependentRequired),0,([c,u])=>!L.HasPropertyKey(s,c)||L.EveryAll(u,0,l=>L.HasPropertyKey(s,l)||e.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:r,params:{property:c,dependencies:u}})));return o||a}var ttt=v(()=>{p();ft()});function NAn(t,e,n,r){let i=Fe.IsEqual(Fe.Member(Fe.Keys(r),"length"),Fe.Constant(0)),s=Fe.ReduceAnd(L.Entries(n.dependentSchemas).map(([o,a])=>{let c=Fe.Not(Fe.HasPropertyKey(r,Fe.Constant(o))),u=So(t,e,a,r);return Fe.Or(c,u)}));return Fe.Or(i,s)}function DAn(t,e,n,r){let i=L.IsEqual(L.Keys(r).length,0),s=L.Every(L.Entries(n.dependentSchemas),0,([o,a])=>!L.HasPropertyKey(r,o)||Vs(t,e,a,r));return i||s}function PAn(t,e,n,r,i,s){let o=L.IsEqual(L.Keys(s).length,0),a=L.EveryAll(L.Entries(i.dependentSchemas),0,([c,u])=>{let l=`${n}/dependentSchemas/${c}`;return!L.HasPropertyKey(s,c)||Fa(t,e,l,r,u,s)});return o||a}var ntt=v(()=>{p();ft();Uc()});function MAn(t,e,n,r){let i=t.DynamicRef(n)??!1;return nR(t,e,i,r)}function OAn(t,e,n,r){let i=t.DynamicRef(n)??!1;return Li(i)&&Vs(t,e,i,r)}function LAn(t,e,n,r,i,s){let o=t.DynamicRef(i)??!1;return Li(o)&&Fa(t,e,"#",r,o,s)}var FAn=v(()=>{p();Lte();da();Uc()});function QAn(t,e,n,r){return Fe.ReduceOr(n.enum.map(i=>{if(L.IsValueLike(i))return Fe.IsEqual(r,Fe.Constant(i));let s=lb(i);return Fe.IsDeepEqual(r,s)}))}function itt(t,e,n,r){return L.Some(n.enum,i=>L.IsValueLike(i)?L.IsEqual(r,i):L.IsDeepEqual(r,i))}function UAn(t,e,n,r,i,s){return itt(t,e,i,s)||e.AddError({keyword:"enum",schemaPath:n,instancePath:r,params:{allowedValues:i.enum}})}var stt=v(()=>{p();ZN();ft()});function GAn(t,e,n,r){return Fe.IsLessThan(r,Fe.Constant(n.exclusiveMaximum))}function ott(t,e,n,r){return L.IsLessThan(r,n.exclusiveMaximum)}function $An(t,e,n,r,i,s){return ott(t,e,i,s)||e.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:r,params:{comparison:"<",limit:i.exclusiveMaximum}})}var att=v(()=>{p();ft()});function WAn(t,e,n,r){return Fe.IsGreaterThan(r,Fe.Constant(n.exclusiveMinimum))}function ctt(t,e,n,r){return L.IsGreaterThan(r,n.exclusiveMinimum)}function HAn(t,e,n,r,i,s){return ctt(t,e,i,s)||e.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:r,params:{comparison:">",limit:i.exclusiveMinimum}})}var ltt=v(()=>{p();ft()});function OCi(t){return t%4===0&&(t%100!==0||t%400===0)}function z4(t){let e=MCi.exec(t);if(!e)return!1;let n=+e[1],r=+e[2],i=+e[3];return r>=1&&r<=12&&i>=1&&i<=(r===2&&OCi(n)?29:PCi[r])}var PCi,MCi,USe=v(()=>{p();PCi=[0,31,28,31,30,31,30,31,31,30,31,30,31],MCi=/^(\d\d\d\d)-(\d\d)-(\d\d)$/});function K4(t,e=!0){let n=LCi.exec(t);if(!n||e&&!n[4]&&!n[5])return!1;let r=+n[1],i=+n[2],s=+n[3];if(r>23||i>59||s>60)return!1;if(n[5]){let l=+n[6],d=+n[7];if(l>23||d>59)return!1}if(s<60)return!0;let o=n[5]==="-"?-1:1,a=+(n[6]||0),c=+(n[7]||0);return((r*60+i-o*(a*60+c))%1440+1440)%1440===1439}var LCi,GSe=v(()=>{p();LCi=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/});function $Se(t){let e=t.split(/T/i);return e.length===2&&z4(e[0])&&K4(e[1])}var utt=v(()=>{p();USe();GSe()});function WSe(t){return FCi.test(t)}var FCi,dtt=v(()=>{p();FCi=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/});function HSe(t){return QCi.test(t)}var QCi,ptt=v(()=>{p();QCi=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i});var qAn,jAn,VAn,kRa,J4,UCi,YAn,GCi,$Ci,WCi,mtt,HCi,BRa,zAn,htt,qCi,KAn,qSe,JAn,XAn,ftt,ZAn,jCi,VCi,eyn,tyn,X4=v(()=>{p();qAn=/^(?!-).*(?t.source).join("|"),"u"),tyn=new RegExp([htt,WCi,$Ci,qCi,mtt,HCi,jCi,VCi].map(t=>t.source).join("|"),"u")});function nyn(t){return qAn.test(t)&&jAn.test(t)&&VAn.test(t)}var ryn=v(()=>{p();X4()});function gtt(){throw null}function jSe(t){return t.toLowerCase().startsWith("xn--")}function ayn(t,e,n){t=n?Math.floor(t/KCi):t>>1,t+=Math.floor(t/e);let r=0;for(;t>(Kx-Qte)*Ute>>1;)t=Math.floor(t/(Kx-Qte)),r+=Kx;return r+Math.floor((Kx-Qte+1)*t/(t+zCi))}function VSe(t){let e=[],n=oyn,r=0,i=syn,s=t.lastIndexOf("-");if(s>0)for(let a=0;a=128&>t(),e.push(c)}let o=s<0?0:s+1;for(;o=t.length&>t();let d=t.charCodeAt(o++),m;d>=97&&d<=122?m=d-97:d>=48&&d<=57?m=d-48+26:gtt(),r+=m*c;let h=u<=i?Qte:u>=i+Ute?Ute:u-i;if(m0?[e,"-"]:[],i=Array.from(t,u=>u.codePointAt(0)),s=oyn,o=0,a=syn,c=n;for(;c=s&&l=a+Ute?Ute:m-a;if(d{p();X4();Kx=36,Qte=1,Ute=26,zCi=38,KCi=700,syn=72,oyn=128;JCi=new RegExp(J4.source,"gu")});function uyn(t){if(jSe(t))try{return zSe(VSe(t.slice(4).toLowerCase()))}catch{return!1}return zSe(t)}function dyn(t){let e=String.fromCodePoint(t);return eyn.test(e)?"EN":YAn.test(e)?"AN":mtt.test(e)?"NSM":qSe.test(e)?"R":XAn.test(e)?"AL":htt.test(e)?"L":"ON"}function zSe(t){for(let e of t)if(ZCi.test(dyn(e.codePointAt(0))))return!0;return!1}function KSe(t){let e=!1,n=lyn,r=!1,i=!1,s=!0;for(let o of t){let a=dyn(o.codePointAt(0));if(s){if(a!=="L"&&a!=="R"&&a!=="AL")return!1;e=a==="R"||a==="AL",n=e?XCi:lyn,s=!1}if(!n.test(a))return!1;a==="EN"?r=!0:a==="AN"&&(i=!0)}return!(e&&r&&i)}var XCi,lyn,ZCi,ytt=v(()=>{p();YSe();X4();XCi=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,lyn=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,ZCi=/^(?:R|AL|AN)$/});function eIi(t){return J4.test(t)&&cyn(t).length+4>63}function tIi(t){return t[0]==="-"||t[t.length-1]==="-"?!0:t.slice(2).join("").startsWith("--")}function JSe(t){if(eIi(t)||zSe(t)&&!KSe(t))return!1;let e=[...t],n=e.map(s=>s.codePointAt(0)),r=n.length;if(tIi(e)||zAn.test(e[0]))return!1;let i=!1;for(let s=0;s{p();X4();ytt();YSe()});function XSe(t){if(!jSe(t))return!1;try{let e=t.slice(4).toLowerCase();if(e.lastIndexOf("-")===0)return!1;let n=VSe(e);return J4.test(n)?JSe(n):!1}catch{return!1}}var btt=v(()=>{p();YSe();Ett();X4()});function nIi(t){return t.length>0&&t.length<=63}function rIi(t){return nIi(t)&&(XSe(t)||nyn(t))}function fyn(t){return t.length===0||t.length>253||t.charCodeAt(t.length-1)===46?!1:t.split(".").every(e=>rIi(e))}var gyn=v(()=>{p();ryn();btt()});function iIi(t){return t.length>0&&t.length<=63}function sIi(t){return iIi(t)&&(XSe(t)||JSe(t))}function oIi(t){return t.replace(/[\uff01-\uff5e]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248)).normalize("NFC").replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,"").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".")}function Ayn(t){if(t.length===0||t.includes(" "))return!1;let e=oIi(t);if(e.length>253)return!1;let n=e.split("."),r=n.some(i=>uyn(i));return n.every(i=>sIi(i)&&(!r||KSe(i)))}var yyn=v(()=>{p();ytt();Ett();btt()});var _tt=v(()=>{p();gyn();yyn()});function ZSe(t){return fyn(t)}var xtt=v(()=>{p();_tt()});function eCe(t){return aIi.test(t.normalize("NFC"))}var aIi,Stt=v(()=>{p();aIi=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?{p();_tt()});function nCe(t){return cIi.test(t)}var cIi,Itt=v(()=>{p();cIi=/^(?:(?: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)$/});function rCe(t){return lIi.test(t)}var lIi,wtt=v(()=>{p();lIi=/^(?:(?:(?:[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-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|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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})?::)$/i});function iCe(t){return!uIi.test(t)&&!dIi.test(t)&&URL.canParse(t,"http://example.com")}var uIi,dIi,Ttt=v(()=>{p();uIi=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,dIi=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//});function fIi(t){return t.length<2048?t.replace(pIi,"[::1]"):t}function sCe(t){return mIi.test(t)||hIi.test(t)?!1:URL.canParse(fIi(t))}var pIi,mIi,hIi,vtt=v(()=>{p();pIi=/\[[vV][0-9a-fA-F]+\.[^\]]+\]/,mIi=/[\x00-\x20<>\^`{|}\\]/,hIi=/%(?![0-9a-fA-F]{2})/});function oCe(t){return gIi.test(t)}var gIi,Rtt=v(()=>{p();gIi=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i});function aCe(t){return AIi.test(t)}var AIi,ktt=v(()=>{p();AIi=/^(?:\/(?:[^~/]|~0|~1)*)*$/});function cCe(t){try{return new RegExp(t,"u"),!0}catch{return!1}}var Btt=v(()=>{p()});function lCe(t){return yIi.test(t)}var yIi,Ntt=v(()=>{p();yIi=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/});function uCe(t){return EIi.test(t)}var EIi,Dtt=v(()=>{p();EIi=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?: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)|(?:[-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})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?: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)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i});function dCe(t){return bIi.test(t)}var bIi,Ptt=v(()=>{p();bIi=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i});function pCe(t){return _Ii.test(t)}var _Ii,Mtt=v(()=>{p();_Ii=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?: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)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i});function mCe(t){return URL.canParse(t)}var Ott=v(()=>{p()});function hCe(t){return xIi.test(t)}var xIi,Ltt=v(()=>{p();xIi=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i});function byn(){pc.clear()}function SIi(){return[...pc.entries()]}function CIi(t,e){pc.set(t,e)}function IIi(t){return pc.has(t)}function wIi(t){return pc.get(t)}function TIi(t,e){return pc.get(t)?.(e)??!0}function _yn(){byn(),pc.set("date-time",$Se),pc.set("date",z4),pc.set("duration",WSe),pc.set("email",HSe),pc.set("hostname",ZSe),pc.set("idn-email",eCe),pc.set("idn-hostname",tCe),pc.set("ipv4",nCe),pc.set("ipv6",rCe),pc.set("iri-reference",iCe),pc.set("iri",sCe),pc.set("json-pointer-uri-fragment",oCe),pc.set("json-pointer",aCe),pc.set("regex",cCe),pc.set("relative-json-pointer",lCe),pc.set("time",K4),pc.set("uri-reference",uCe),pc.set("uri-template",dCe),pc.set("uri",pCe),pc.set("url",mCe),pc.set("uuid",hCe)}var pc,xyn=v(()=>{p();utt();USe();dtt();ptt();xtt();Stt();Ctt();Itt();wtt();Ttt();vtt();Rtt();ktt();Btt();Ntt();GSe();Dtt();Ptt();Mtt();Ott();Ltt();pc=new Map;_yn()});var lF={};br(lF,{Clear:()=>byn,Entries:()=>SIi,Get:()=>wIi,Has:()=>IIi,IsDate:()=>z4,IsDateTime:()=>$Se,IsDuration:()=>WSe,IsEmail:()=>HSe,IsHostname:()=>ZSe,IsIPv4:()=>nCe,IsIPv6:()=>rCe,IsIdnEmail:()=>eCe,IsIdnHostname:()=>tCe,IsIri:()=>sCe,IsIriReference:()=>iCe,IsJsonPointer:()=>aCe,IsJsonPointerUriFragment:()=>oCe,IsRegex:()=>cCe,IsRelativeJsonPointer:()=>lCe,IsTime:()=>K4,IsUri:()=>pCe,IsUriReference:()=>uCe,IsUriTemplate:()=>dCe,IsUrl:()=>mCe,IsUuid:()=>hCe,Reset:()=>_yn,Set:()=>CIi,Test:()=>TIi});var fCe=v(()=>{p();xyn();utt();USe();dtt();ptt();xtt();Stt();Ctt();Itt();wtt();Ttt();vtt();Rtt();ktt();Btt();Ntt();GSe();Dtt();Ptt();Mtt();Ott();Ltt()});var Ftt=v(()=>{p();fCe();fCe();fCe()});function Syn(t,e,n,r){return Fe.Call(Fe.Member("Format","Test"),[Fe.Constant(n.format),r])}function Qtt(t,e,n,r){return lF.Test(n.format,r)}function Cyn(t,e,n,r,i,s){return Qtt(t,e,i,s)||e.AddError({keyword:"format",schemaPath:n,instancePath:r,params:{format:i.format}})}var Utt=v(()=>{p();Ftt();ft()});function Iyn(t,e,n,r){let i=Mte(n)?n.then:!0,s=_te(n)?n.else:!0;return Fe.Ternary(So(t,e,n.if,r),So(t,e,i,r),So(t,e,s,r))}function wyn(t,e,n,r){let i=Mte(n)?n.then:!0,s=_te(n)?n.else:!0;return Vs(t,e,n.if,r)?Vs(t,e,i,r):Vs(t,e,s,r)}function Tyn(t,e,n,r,i,s){let o=Mte(i)?i.then:!0,a=_te(i)?i.else:!0,c=new em,u=Fa(t,c,`${n}/if`,r,i.if,s)?Fa(t,c,`${n}/then`,r,o,s)||e.AddError({keyword:"if",schemaPath:n,instancePath:r,params:{failingKeyword:"then"}}):Fa(t,e,`${n}/else`,r,a,s)||e.AddError({keyword:"if",schemaPath:n,instancePath:r,params:{failingKeyword:"else"}});return u&&e.Merge([c]),u}var Gtt=v(()=>{p();da();WI();ft();Uc()});function vIi(t,e,n,r){return Fe.ReduceAnd(n.items.map((i,s)=>{let o=Fe.IsLessEqualThan(Fe.Member(r,"length"),Fe.Constant(s)),a=Wh(t,e,i,`${r}[${s}]`),c=e.AddIndex(Fe.Constant(s));return Fe.Or(o,Fe.And(a,c))}))}function RIi(t,e,n,r){return Fe.ReduceAnd(n.items.map((i,s)=>{let o=Fe.IsLessEqualThan(Fe.Member(r,"length"),Fe.Constant(s)),a=Wh(t,e,i,`${r}[${s}]`);return Fe.Or(o,a)}))}function kIi(t,e,n,r){return e.UseUnevaluated()?vIi(t,e,n,r):RIi(t,e,n,r)}function BIi(t,e,n,r){return L.Every(n.items,0,(i,s)=>L.IsLessEqualThan(r.length,s)||Zy(t,e,i,r[s])&&e.AddIndex(s))}function NIi(t,e,n,r,i,s){return L.EveryAll(i.items,0,(o,a)=>{let c=`${n}/items/${a}`,u=`${r}/${a}`;return L.IsLessEqualThan(s.length,a)||eE(t,e,c,u,o,s[a])&&e.AddIndex(a)})}function DIi(t,e,n,r){let i=jx(n)?n.prefixItems.length:0,s=Wh(t,e,n.items,"element"),o=e.AddIndex("index");return Fe.Every(r,Fe.Constant(i),["element","index"],Fe.And(s,o))}function PIi(t,e,n,r){let i=jx(n)?n.prefixItems.length:0,s=Wh(t,e,n.items,"element");return Fe.Every(r,Fe.Constant(i),["element","index"],s)}function MIi(t,e,n,r){return e.UseUnevaluated()?DIi(t,e,n,r):PIi(t,e,n,r)}function OIi(t,e,n,r){let i=jx(n)?n.prefixItems.length:0;return L.Every(r,i,(s,o)=>Zy(t,e,n.items,s)&&e.AddIndex(o))}function LIi(t,e,n,r,i,s){let o=jx(i)?i.prefixItems.length:0;return L.EveryAll(s,o,(a,c)=>{let u=`${n}/items`,l=`${r}/${c}`;return eE(t,e,u,l,i.items,a)&&e.AddIndex(c)})}function vyn(t,e,n,r){return Cte(n)?kIi(t,e,n,r):MIi(t,e,n,r)}function Ryn(t,e,n,r){return Cte(n)?BIi(t,e,n,r):OIi(t,e,n,r)}function kyn(t,e,n,r,i,s){return Cte(i)?NIi(t,e,n,r,i,s):LIi(t,e,n,r,i,s)}var $tt=v(()=>{p();da();ft();Uc()});function Byn(t){return GI(t)}function Nyn(t,e,n,r){if(!Byn(n))return Fe.Constant(!0);let[i]=[ta()],s=Fe.Counted(r,[i,"_"],So(t,e,n.contains,i));return Fe.IsLessEqualThan(s,Fe.Constant(n.maxContains))}function Wtt(t,e,n,r){if(!Byn(n))return!0;let i=L.Counted(r,s=>Vs(t,e,n.contains,s));return L.IsLessEqualThan(i,n.maxContains)}function Dyn(t,e,n,r,i,s){let o=Xv(i)?i.minContains:1;return Wtt(t,e,i,s)||e.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:o,maxContains:i.maxContains}})}var Htt=v(()=>{p();da();Yx();ft();Uc()});function Pyn(t,e,n,r){return Fe.IsLessEqualThan(r,Fe.Constant(n.maximum))}function qtt(t,e,n,r){return L.IsLessEqualThan(r,n.maximum)}function Myn(t,e,n,r,i,s){return qtt(t,e,i,s)||e.AddError({keyword:"maximum",schemaPath:n,instancePath:r,params:{comparison:"<=",limit:i.maximum}})}var jtt=v(()=>{p();ft()});function Oyn(t,e,n,r){return Fe.IsLessEqualThan(Fe.Member(r,"length"),Fe.Constant(n.maxItems))}function Vtt(t,e,n,r){return L.IsLessEqualThan(r.length,n.maxItems)}function Lyn(t,e,n,r,i,s){return Vtt(t,e,i,s)||e.AddError({keyword:"maxItems",schemaPath:n,instancePath:r,params:{limit:i.maxItems}})}var Ytt=v(()=>{p();ft()});function Fyn(t,e,n,r){return Fe.IsMaxLength(r,Fe.Constant(n.maxLength))}function ztt(t,e,n,r){return L.IsMaxLength(r,n.maxLength)}function Qyn(t,e,n,r,i,s){return ztt(t,e,i,s)||e.AddError({keyword:"maxLength",schemaPath:n,instancePath:r,params:{limit:i.maxLength}})}var Ktt=v(()=>{p();ft()});function Uyn(t,e,n,r){return Fe.IsLessEqualThan(Fe.Member(Fe.Keys(r),"length"),Fe.Constant(n.maxProperties))}function Jtt(t,e,n,r){return L.IsLessEqualThan(L.Keys(r).length,n.maxProperties)}function Gyn(t,e,n,r,i,s){return Jtt(t,e,i,s)||e.AddError({keyword:"maxProperties",schemaPath:n,instancePath:r,params:{limit:i.maxProperties}})}var Xtt=v(()=>{p();ft()});function $yn(t){return GI(t)}function FIi(t,e,n,r){let[i,s]=[ta(),ta()],o=Fe.Counted(r,[i,s],Fe.And(So(t,e,n.contains,i),e.AddIndex(s)));return Fe.IsGreaterEqualThan(o,Fe.Constant(n.minContains))}function QIi(t,e,n,r){let[i]=[ta()],s=Fe.Counted(r,[i,"_"],So(t,e,n.contains,i));return Fe.IsGreaterEqualThan(s,Fe.Constant(n.minContains))}function Wyn(t,e,n,r){return $yn(n)?e.UseUnevaluated()?FIi(t,e,n,r):QIi(t,e,n,r):Fe.Constant(!0)}function Ztt(t,e,n,r){if(!$yn(n))return!0;let i=L.Counted(r,(s,o)=>Vs(t,e,n.contains,s)&&e.AddIndex(o));return L.IsGreaterEqualThan(i,n.minContains)}function Hyn(t,e,n,r,i,s){return Ztt(t,e,i,s)||e.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:i.minContains}})}var ent=v(()=>{p();da();Yx();ft();Uc()});function qyn(t,e,n,r){return Fe.IsGreaterEqualThan(r,Fe.Constant(n.minimum))}function tnt(t,e,n,r){return L.IsGreaterEqualThan(r,n.minimum)}function jyn(t,e,n,r,i,s){return tnt(t,e,i,s)||e.AddError({keyword:"minimum",schemaPath:n,instancePath:r,params:{comparison:">=",limit:i.minimum}})}var nnt=v(()=>{p();ft()});function Vyn(t,e,n,r){return Fe.IsGreaterEqualThan(Fe.Member(r,"length"),Fe.Constant(n.minItems))}function rnt(t,e,n,r){return L.IsGreaterEqualThan(r.length,n.minItems)}function Yyn(t,e,n,r,i,s){return rnt(t,e,i,s)||e.AddError({keyword:"minItems",schemaPath:n,instancePath:r,params:{limit:i.minItems}})}var int=v(()=>{p();ft()});function zyn(t,e,n,r){return Fe.IsMinLength(r,Fe.Constant(n.minLength))}function snt(t,e,n,r){return L.IsMinLength(r,n.minLength)}function Kyn(t,e,n,r,i,s){return snt(t,e,i,s)||e.AddError({keyword:"minLength",schemaPath:n,instancePath:r,params:{limit:i.minLength}})}var ont=v(()=>{p();ft()});function Jyn(t,e,n,r){return Fe.IsGreaterEqualThan(Fe.Member(Fe.Keys(r),"length"),Fe.Constant(n.minProperties))}function ant(t,e,n,r){return L.IsGreaterEqualThan(L.Keys(r).length,n.minProperties)}function Xyn(t,e,n,r,i,s){return ant(t,e,i,s)||e.AddError({keyword:"minProperties",schemaPath:n,instancePath:r,params:{limit:i.minProperties}})}var cnt=v(()=>{p();ft()});function Zyn(t,e,n,r){return Fe.MultipleOf(r,Fe.Constant(n.multipleOf))}function lnt(t,e,n,r){return L.IsMultipleOf(r,n.multipleOf)}function eEn(t,e,n,r,i,s){return lnt(t,e,i,s)||e.AddError({keyword:"multipleOf",schemaPath:n,instancePath:r,params:{multipleOf:i.multipleOf}})}var unt=v(()=>{p();ft()});function UIi(t,e,n,r){return eD(t,e,[n.not],r,Fe.Not(Fe.IsEqual(Fe.Member("results","length"),Fe.Constant(1))))}function GIi(t,e,n,r){return Fe.Not(So(t,e,n.not,r))}function tEn(t,e,n,r){return e.UseUnevaluated()?UIi(t,e,n,r):GIi(t,e,n,r)}function dnt(t,e,n,r){let i=new Zp;return!Vs(t,i,n.not,r)&&e.Merge([i])}function nEn(t,e,n,r,i,s){return dnt(t,e,i,s)||e.AddError({keyword:"not",schemaPath:n,instancePath:r,params:{}})}var pnt=v(()=>{p();WI();Y4();ft();Uc()});function $Ii(t,e,n,r){return eD(t,e,n.oneOf,r,Fe.IsEqual(Fe.Member("results","length"),Fe.Constant(1)))}function WIi(t,e,n,r){let[i]=[ta()],s=Fe.ArrayLiteral(n.oneOf.map(a=>So(t,e,a,r))),o=Fe.Counted(s,[i,"_"],Fe.IsEqual(i,Fe.Constant(!0)));return Fe.IsEqual(o,Fe.Constant(1))}function rEn(t,e,n,r){return e.UseUnevaluated()?$Ii(t,e,n,r):WIi(t,e,n,r)}function iEn(t,e,n,r){let i=n.oneOf.reduce((s,o)=>{let a=new Zp;return Vs(t,a,o,r)?[...s,a]:s},[]);return L.IsEqual(i.length,1)&&e.Merge(i)}function sEn(t,e,n,r,i,s){let o=[],a=[],c=i.oneOf.reduce((l,d,m)=>{let h=new em,f=`${n}/oneOf/${m}`,g=Fa(t,h,f,r,d,s);return g&&a.push(m),g||o.push(h),g?[...l,h]:l},[]),u=L.IsEqual(c.length,1)&&e.Merge(c);return!u&&L.IsEqual(a.length,0)&&o.forEach(l=>l.GetErrors().forEach(d=>e.AddError(d))),u||e.AddError({keyword:"oneOf",schemaPath:n,instancePath:r,params:{passingSchemas:a}})}var mnt=v(()=>{p();WI();Y4();ft();Uc();Yx()});function oEn(t,e,n,r){let i=lb(L.IsString(n.pattern)?zx(n.pattern):n.pattern);return Fe.Call(Fe.Member(i,"test"),[r])}function hnt(t,e,n,r){return(L.IsString(n.pattern)?zx(n.pattern):n.pattern).test(r)}function aEn(t,e,n,r,i,s){return hnt(t,e,i,s)||e.AddError({keyword:"pattern",schemaPath:n,instancePath:r,params:{pattern:i.pattern}})}var fnt=v(()=>{p();ZN();ft();QSe()});function cEn(t,e,n,r){return Fe.ReduceAnd(L.Entries(n.patternProperties).map(([i,s])=>{let[o,a]=[ta(),ta()],c=lb(zx(i)),u=Fe.Not(Fe.Call(Fe.Member(c,"test"),[o])),l=Wh(t,e,s,a),d=e.AddKey(o),m=e.UseUnevaluated()?Fe.Or(u,Fe.And(l,d)):Fe.Or(u,l);return Fe.Every(Fe.Entries(r),Fe.Constant(0),[`[${o}, ${a}]`,"_"],m)}))}function lEn(t,e,n,r){return L.Every(L.Entries(n.patternProperties),0,([i,s])=>{let o=zx(i);return L.Every(L.Entries(r),0,([a,c])=>!o.test(a)||Zy(t,e,s,c)&&e.AddKey(a))})}function uEn(t,e,n,r,i,s){return L.EveryAll(L.Entries(i.patternProperties),0,([o,a])=>{let c=`${n}/patternProperties/${o}`,u=zx(o);return L.EveryAll(L.Entries(s),0,([l,d])=>{let m=`${r}/${l}`;return!u.test(l)||eE(t,e,c,m,a,d)&&e.AddKey(l)})})}var gnt=v(()=>{p();ZN();Yx();QSe();ft();Uc()});function dEn(t,e,n,r){return Fe.ReduceAnd(n.prefixItems.map((i,s)=>{let o=Fe.IsLessEqualThan(Fe.Member(r,"length"),Fe.Constant(s)),a=Wh(t,e,i,`${r}[${s}]`),c=e.AddIndex(Fe.Constant(s)),u=e.UseUnevaluated()?Fe.And(a,c):a;return Fe.Or(o,u)}))}function pEn(t,e,n,r){return L.IsEqual(r.length,0)||L.Every(n.prefixItems,0,(i,s)=>L.IsLessEqualThan(r.length,s)||Zy(t,e,i,r[s])&&e.AddIndex(s))}function mEn(t,e,n,r,i,s){return L.IsEqual(s.length,0)||L.EveryAll(i.prefixItems,0,(o,a)=>{let c=`${n}/prefixItems/${a}`,u=`${r}/${a}`;return L.IsLessEqualThan(s.length,a)||eE(t,e,c,u,o,s[a])&&e.AddIndex(a)})}var Ant=v(()=>{p();ft();Uc()});function gCe(t,e){return t.includes(e)||Lc.Get().exactOptionalPropertyTypes}function hEn(t,e){return Fe.IsUndefined(Fe.Member(t,e))}function ynt(t,e){return L.IsUndefined(t[e])}var fEn=v(()=>{p();NI();ft()});function gEn(t,e,n,r){let i=Vx(n)?n.required:[],s=L.Entries(n.properties).map(([o,a])=>{let c=Fe.Not(Fe.HasPropertyKey(r,Fe.Constant(o))),u=Wh(t,e,a,Fe.Member(r,o)),l=e.AddKey(Fe.Constant(o)),d=e.UseUnevaluated()?Fe.And(u,l):u,m=i.includes(o)?d:Fe.Or(c,d);return gCe(i,o)?m:Fe.Or(hEn(r,o),m)});return Fe.ReduceAnd(s)}function AEn(t,e,n,r){let i=Vx(n)?n.required:[];return L.Every(L.Entries(n.properties),0,([o,a])=>{let c=!L.HasPropertyKey(r,o)||Zy(t,e,a,r[o])&&e.AddKey(o);return gCe(i,o)?c:ynt(r,o)||c})}function yEn(t,e,n,r,i,s){let o=Vx(i)?i.required:[];return L.EveryAll(L.Entries(i.properties),0,([c,u])=>{let l=`${n}/properties/${c}`,d=`${r}/${c}`,m=()=>!L.HasPropertyKey(s,c)||eE(t,e,l,d,u,s[c])&&e.AddKey(c);return gCe(o,c)?m():ynt(s,c)||m()})}var Ent=v(()=>{p();da();ft();Uc();fEn()});function EEn(t,e,n,r){let[i,s]=[ta(),ta()];return Fe.Every(Fe.Keys(r),Fe.Constant(0),[i,s],So(t,e,n.propertyNames,i))}function bEn(t,e,n,r){return L.Every(L.Keys(r),0,(i,s)=>Vs(t,e,n.propertyNames,i))}function _En(t,e,n,r,i,s){let o=[];return L.EveryAll(L.Keys(s),0,(c,u)=>{let l=`${r}/${c}`,d=`${n}/propertyNames`,m=Fa(t,e,d,l,i.propertyNames,c);return m||o.push(c),m})||e.AddError({keyword:"propertyNames",schemaPath:n,instancePath:r,params:{propertyNames:o}})}var bnt=v(()=>{p();Yx();ft();Uc()});function xEn(t,e,n,r){let i=t.RecursiveRef(n)??!1;return nR(t,e,i,r)}function SEn(t,e,n,r){let i=t.RecursiveRef(n)??!1;return Li(i)&&Vs(t,e,i,r)}function CEn(t,e,n,r,i,s){let o=t.RecursiveRef(i)??!1;return Li(o)&&Fa(t,e,"#",r,o,s)}var _nt=v(()=>{p();Lte();da();Uc()});function HIi(t,e,n,r){let i=Fe.ArrowFunction(["context","value"],nR(t,e,n,"value")),s=Fe.ArrowFunction(["context","value"],Fe.Statements([Fe.ConstDeclaration("nextContext",Fe.New("CheckContext",[])),Fe.ConstDeclaration("result",Fe.Call(i,["nextContext","value"])),Fe.If("result",e.Merge("[nextContext]")),Fe.Return("result")]));return Fe.Call(s,["context",r])}function qIi(t,e,n,r){return nR(t,e,n,r)}function IEn(t,e,n,r){let i=t.Ref(n)??!1;return e.UseUnevaluated()?HIi(t,e,i,r):qIi(t,e,i,r)}function wEn(t,e,n,r){let i=t.Ref(n)??!1,s=new Zp,o=Li(i)&&Vs(t,s,i,r);return o&&e.Merge([s]),o}function TEn(t,e,n,r,i,s){let o=t.Ref(i)??!1,a=new em,c=Li(o)&&Fa(t,a,"#",r,o,s);return c&&e.Merge([a]),c||a.GetErrors().forEach(u=>e.AddError(u)),c}var xnt=v(()=>{p();Lte();da();WI();ft();Uc()});function vEn(t,e,n,r){return Fe.ReduceAnd(n.required.map(i=>Fe.HasPropertyKey(r,Fe.Constant(i))))}function REn(t,e,n,r){return L.Every(n.required,0,i=>L.HasPropertyKey(r,i))}function kEn(t,e,n,r,i,s){let o=[];return L.EveryAll(i.required,0,c=>{let u=L.HasPropertyKey(s,c);return u||o.push(c),u})||e.AddError({keyword:"required",schemaPath:n,instancePath:r,params:{requiredProperties:o}})}var Snt=v(()=>{p();ft()});function BEn(t,e,n,r){return L.IsEqual(n,"object")?Fe.IsObjectNotArray(r):L.IsEqual(n,"array")?Fe.IsArray(r):L.IsEqual(n,"boolean")?Fe.IsBoolean(r):L.IsEqual(n,"integer")?Fe.IsInteger(r):L.IsEqual(n,"number")?Fe.IsNumber(r):L.IsEqual(n,"null")?Fe.IsNull(r):L.IsEqual(n,"string")?Fe.IsString(r):L.IsEqual(n,"bigint")?Fe.IsBigInt(r):L.IsEqual(n,"constructor")?Fe.IsConstructor(r):L.IsEqual(n,"function")?Fe.IsFunction(r):L.IsEqual(n,"symbol")?Fe.IsSymbol(r):L.IsEqual(n,"undefined")?Fe.IsUndefined(r):L.IsEqual(n,"void")?Fe.IsUndefined(r):Fe.Constant(!0)}function Cnt(t,e,n,r,i){return L.IsEqual(n,"object")?L.IsObjectNotArray(i):L.IsEqual(n,"array")?L.IsArray(i):L.IsEqual(n,"boolean")?L.IsBoolean(i):L.IsEqual(n,"integer")?L.IsInteger(i):L.IsEqual(n,"number")?L.IsNumber(i):L.IsEqual(n,"null")?L.IsNull(i):L.IsEqual(n,"string")?L.IsString(i):L.IsEqual(n,"bigint")?L.IsBigInt(i):L.IsEqual(n,"constructor")?L.IsConstructor(i):L.IsEqual(n,"function")?L.IsFunction(i):L.IsEqual(n,"symbol")?L.IsSymbol(i):L.IsEqual(n,"undefined")?L.IsUndefined(i):L.IsEqual(n,"void")?L.IsUndefined(i):!0}function jIi(t,e,n,r){return Fe.ReduceOr(n.map(i=>BEn(t,e,i,r)))}function NEn(t,e,n,r,i){return L.Some(n,s=>Cnt(t,e,s,r,i))}function DEn(t,e,n,r){return L.IsArray(n.type)?jIi(t,e,n.type,r):BEn(t,e,n.type,r)}function PEn(t,e,n,r){return L.IsArray(n.type)?NEn(t,e,n.type,n,r):Cnt(t,e,n.type,n,r)}function MEn(t,e,n,r,i,s){return(L.IsArray(i.type)?NEn(t,e,i.type,i,s):Cnt(t,e,i.type,i,s))||e.AddError({keyword:"type",schemaPath:n,instancePath:r,params:{type:i.type}})}var Int=v(()=>{p();ft()});function OEn(t,e,n,r){let[i,s]=[ta(),ta()],o=Fe.Call(Fe.Member("context","GetIndices"),[]),a=Fe.Call(Fe.Member("indices","has"),[i]),c=So(t,e,n.unevaluatedItems,s),u=Fe.Call(Fe.Member("context","AddIndex"),[i]),l=Fe.Every(r,Fe.Constant(0),[s,i],Fe.And(Fe.Or(a,c),u));return Fe.Call(Fe.ArrowFunction(["context"],Fe.Statements([Fe.ConstDeclaration("indices",o),Fe.Return(l)])),["context"])}function LEn(t,e,n,r){let i=e.GetIndices();return L.Every(r,0,(s,o)=>(i.has(o)||Vs(t,e,n.unevaluatedItems,s))&&e.AddIndex(o))}function FEn(t,e,n,r,i,s){let o=e.GetIndices(),a=[];return L.EveryAll(s,0,(u,l)=>{let d=new em,m=(o.has(l)||Fa(t,d,n,r,i.unevaluatedItems,u))&&e.AddIndex(l);return m||a.push(l),m})||e.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:r,params:{unevaluatedItems:a}})}var wnt=v(()=>{p();Yx();WI();ft();Uc()});function QEn(t,e,n,r){let[i,s]=[ta(),ta()],o=Fe.Call(Fe.Member("context","GetKeys"),[]),a=Fe.Call(Fe.Member("keys","has"),[i]),c=Fe.Call(Fe.Member("context","AddKey"),[i]),u=So(t,e,n.unevaluatedProperties,s),l=Fe.Every(Fe.Entries(r),Fe.Constant(0),[`[${i}, ${s}]`,"_"],Fe.Or(a,Fe.And(u,c)));return Fe.Call(Fe.ArrowFunction(["context"],Fe.Statements([Fe.ConstDeclaration("keys",o),Fe.Return(l)])),["context"])}function UEn(t,e,n,r){let i=e.GetKeys();return L.Every(L.Entries(r),0,([s,o])=>i.has(s)||Vs(t,e,n.unevaluatedProperties,o)&&e.AddKey(s))}function GEn(t,e,n,r,i,s){let o=e.GetKeys(),a=[];return L.EveryAll(L.Entries(s),0,([u,l])=>{let d=new em,m=o.has(u)||Fa(t,d,n,r,i.unevaluatedProperties,l)&&e.AddKey(u);return m||a.push(u),m})||e.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:r,params:{unevaluatedProperties:a}})}var Tnt=v(()=>{p();Yx();WI();ft();Uc()});function vnt(t){return!L.IsEqual(t.uniqueItems,!1)}function $En(t,e,n,r){if(!vnt(n))return Fe.Constant(!0);let i=Fe.Member(Fe.New("Set",[Fe.Call(Fe.Member(r,"map"),[Fe.Member("Hashing","Hash")])]),"size"),s=Fe.Member(r,"length");return Fe.IsEqual(i,s)}function WEn(t,e,n,r){if(!vnt(n))return!0;let i=new Set(r.map(DI.Hash)).size,s=r.length;return L.IsEqual(i,s)}function HEn(t,e,n,r,i,s){if(!vnt(i))return!0;let o=new Set,a=s.reduce((u,l,d)=>{let m=DI.Hash(l);return o.has(m)?[...u,d]:(o.add(m),u)},[]);return L.IsEqual(a.length,0)||e.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:r,params:{duplicateItems:a}})}var Rnt=v(()=>{p();JZ();ft()});function Gte(t,e){return Ote(t)&&(L.IsArray(t.type)&&L.IsGreaterThan(t.type.length,0)&&L.Every(t.type,0,n=>L.IsEqual(n,e))||L.IsEqual(t.type,e))}function VIi(t){return Gte(t,"object")}function YIi(t){return Nd(t)&&(AA(t)||yte(t)||Ete(t)||q4(t)||tR(t)||eR(t)||j4(t)||aF(t)||vte(t)||Vx(t)||XN(t))}function zIi(t){return Gte(t,"array")}function KIi(t){return Nd(t)&&(H4(t)||Jv(t)||GI(t)||wte(t)||sF(t)||Xv(t)||Zv(t)||jx(t)||JN(t)||$I(t))}function JIi(t){return Gte(t,"string")}function XIi(t){return Nd(t)&&(oF(t)||Tte(t)||iF(t)||cF(t))}function ZIi(t){return Gte(t,"number")||Gte(t,"bigint")}function ewi(t){return Nd(t)&&(qx(t)||Ite(t)||xte(t)||Hx(t)||Rte(t))}function Wh(t,e,n,r){return e.UseUnevaluated()?Fe.And(Fe.And(e.Push(),So(t,e,n,r)),e.Pop()):So(t,e,n,r)}function So(t,e,n,r){t.Push(n);let i=[];if(zv(n))return EAn(t,e,n,r);if(Ote(n)&&i.push(DEn(t,e,n,r)),YIi(n)){let o=[];Vx(n)&&o.push(vEn(t,e,n,r)),AA(n)&&o.push(uAn(t,e,n,r)),yte(n)&&o.push(wAn(t,e,n,r)),Ete(n)&&o.push(RAn(t,e,n,r)),q4(n)&&o.push(NAn(t,e,n,r)),eR(n)&&o.push(cEn(t,e,n,r)),tR(n)&&o.push(gEn(t,e,n,r)),j4(n)&&o.push(EEn(t,e,n,r)),aF(n)&&o.push(Jyn(t,e,n,r)),vte(n)&&o.push(Uyn(t,e,n,r));let a=Fe.ReduceAnd(o),c=Fe.Or(Fe.Not(Fe.IsObjectNotArray(r)),a);i.push(VIi(n)?a:c)}if(KIi(n)){let o=[];H4(n)&&o.push(aAn(t,e,n,r)),GI(n)&&o.push(CAn(t,e,n,r)),Jv(n)&&o.push(vyn(t,e,n,r)),wte(n)&&o.push(Nyn(t,e,n,r)),sF(n)&&o.push(Oyn(t,e,n,r)),Xv(n)&&o.push(Wyn(t,e,n,r)),Zv(n)&&o.push(Vyn(t,e,n,r)),jx(n)&&o.push(dEn(t,e,n,r)),$I(n)&&o.push($En(t,e,n,r));let a=Fe.ReduceAnd(o),c=Fe.Or(Fe.Not(Fe.IsArray(r)),a);i.push(zIi(n)?a:c)}if(XIi(n)){let o=[];Tte(n)&&o.push(Fyn(t,e,n,r)),oF(n)&&o.push(zyn(t,e,n,r)),iF(n)&&o.push(Syn(t,e,n,r)),cF(n)&&o.push(oEn(t,e,n,r));let a=Fe.ReduceAnd(o),c=Fe.Or(Fe.Not(Fe.IsString(r)),a);i.push(JIi(n)?a:c)}if(ewi(n)){let o=[];xte(n)&&o.push(GAn(t,e,n,r)),Hx(n)&&o.push(WAn(t,e,n,r)),Ite(n)&&o.push(Pyn(t,e,n,r)),qx(n)&&o.push(qyn(t,e,n,r)),Rte(n)&&o.push(Zyn(t,e,n,r));let a=Fe.ReduceAnd(o),c=Fe.Or(Fe.Not(Fe.Or(Fe.IsNumber(r),Fe.IsBigInt(r))),a);i.push(ZIi(n)?a:c)}Pte(n)&&i.push(IEn(t,e,n,r)),Dte(n)&&i.push(xEn(t,e,n,r)),bte(n)&&i.push(MAn(t,e,n,r)),PSe(n)&&i.push(_An(t,e,n,r)),MSe(n)&&i.push(QAn(t,e,n,r)),Ste(n)&&i.push(Iyn(t,e,n,r)),kte(n)&&i.push(tEn(t,e,n,r)),fte(n)&&i.push(mAn(t,e,n,r)),Ate(n)&&i.push(gAn(t,e,n,r)),Bte(n)&&i.push(rEn(t,e,n,r)),JN(n)&&i.push(Fe.Or(Fe.Not(Fe.IsArray(r)),OEn(t,e,n,r))),XN(n)&&i.push(Fe.Or(Fe.Not(Fe.IsObject(r)),QEn(t,e,n,r))),hte(n)&&i.push(iAn(t,e,n,r));let s=Fe.ReduceAnd(i);return t.Pop(n),s}function Zy(t,e,n,r){return e.Push()&&Vs(t,e,n,r)&&e.Pop()}function Vs(t,e,n,r){t.Push(n);let i=zv(n)?Yet(t,e,n,r):(!Ote(n)||PEn(t,e,n,r))&&(!(L.IsObject(r)&&!L.IsArray(r))||(!Vx(n)||REn(t,e,n,r))&&(!AA(n)||dAn(t,e,n,r))&&(!yte(n)||TAn(t,e,n,r))&&(!Ete(n)||kAn(t,e,n,r))&&(!q4(n)||DAn(t,e,n,r))&&(!eR(n)||lEn(t,e,n,r))&&(!tR(n)||AEn(t,e,n,r))&&(!j4(n)||bEn(t,e,n,r))&&(!aF(n)||ant(t,e,n,r))&&(!vte(n)||Jtt(t,e,n,r)))&&(!L.IsArray(r)||(!H4(n)||cAn(t,e,n,r))&&(!GI(n)||Xet(t,e,n,r))&&(!Jv(n)||Ryn(t,e,n,r))&&(!wte(n)||Wtt(t,e,n,r))&&(!sF(n)||Vtt(t,e,n,r))&&(!Xv(n)||Ztt(t,e,n,r))&&(!Zv(n)||rnt(t,e,n,r))&&(!jx(n)||pEn(t,e,n,r))&&(!$I(n)||WEn(t,e,n,r)))&&(!L.IsString(r)||(!Tte(n)||ztt(t,e,n,r))&&(!oF(n)||snt(t,e,n,r))&&(!iF(n)||Qtt(t,e,n,r))&&(!cF(n)||hnt(t,e,n,r)))&&(!(L.IsNumber(r)||L.IsBigInt(r))||(!xte(n)||ott(t,e,n,r))&&(!Hx(n)||ctt(t,e,n,r))&&(!Ite(n)||qtt(t,e,n,r))&&(!qx(n)||tnt(t,e,n,r))&&(!Rte(n)||lnt(t,e,n,r)))&&(!Pte(n)||wEn(t,e,n,r))&&(!Dte(n)||SEn(t,e,n,r))&&(!bte(n)||OAn(t,e,n,r))&&(!PSe(n)||Ket(t,e,n,r))&&(!MSe(n)||itt(t,e,n,r))&&(!Ste(n)||wyn(t,e,n,r))&&(!kte(n)||dnt(t,e,n,r))&&(!fte(n)||hAn(t,e,n,r))&&(!Ate(n)||AAn(t,e,n,r))&&(!Bte(n)||iEn(t,e,n,r))&&(!JN(n)||!L.IsArray(r)||LEn(t,e,n,r))&&(!XN(n)||!L.IsObject(r)||UEn(t,e,n,r))&&(!hte(n)||sAn(t,e,n,r));return t.Pop(n),i}function eE(t,e,n,r,i,s){return e.Push()&&Fa(t,e,n,r,i,s)&&e.Pop()}function Fa(t,e,n,r,i,s){if(e.AtCapacity())return!1;t.Push(i);let o=zv(i)?bAn(t,e,n,r,i,s):!!(+(!Ote(i)||MEn(t,e,n,r,i,s))&+(!(L.IsObject(s)&&!L.IsArray(s))||!!(+(!Vx(i)||kEn(t,e,n,r,i,s))&+(!AA(i)||pAn(t,e,n,r,i,s))&+(!yte(i)||vAn(t,e,n,r,i,s))&+(!Ete(i)||BAn(t,e,n,r,i,s))&+(!q4(i)||PAn(t,e,n,r,i,s))&+(!eR(i)||uEn(t,e,n,r,i,s))&+(!tR(i)||yEn(t,e,n,r,i,s))&+(!j4(i)||_En(t,e,n,r,i,s))&+(!aF(i)||Xyn(t,e,n,r,i,s))&+(!vte(i)||Gyn(t,e,n,r,i,s))))&+(!L.IsArray(s)||!!(+(!H4(i)||lAn(t,e,n,r,i,s))&+(!GI(i)||IAn(t,e,n,r,i,s))&+(!Jv(i)||kyn(t,e,n,r,i,s))&+(!wte(i)||Dyn(t,e,n,r,i,s))&+(!sF(i)||Lyn(t,e,n,r,i,s))&+(!Xv(i)||Hyn(t,e,n,r,i,s))&+(!Zv(i)||Yyn(t,e,n,r,i,s))&+(!jx(i)||mEn(t,e,n,r,i,s))&+(!$I(i)||HEn(t,e,n,r,i,s))))&+(!L.IsString(s)||!!(+(!Tte(i)||Qyn(t,e,n,r,i,s))&+(!oF(i)||Kyn(t,e,n,r,i,s))&+(!iF(i)||Cyn(t,e,n,r,i,s))&+(!cF(i)||aEn(t,e,n,r,i,s))))&+(!(L.IsNumber(s)||L.IsBigInt(s))||!!(+(!xte(i)||$An(t,e,n,r,i,s))&+(!Hx(i)||HAn(t,e,n,r,i,s))&+(!Ite(i)||Myn(t,e,n,r,i,s))&+(!qx(i)||jyn(t,e,n,r,i,s))&+(!Rte(i)||eEn(t,e,n,r,i,s))))&+(!Pte(i)||TEn(t,e,n,r,i,s))&+(!Dte(i)||CEn(t,e,n,r,i,s))&+(!bte(i)||LAn(t,e,n,r,i,s))&+(!PSe(i)||xAn(t,e,n,r,i,s))&+(!MSe(i)||UAn(t,e,n,r,i,s))&+(!Ste(i)||Tyn(t,e,n,r,i,s))&+(!kte(i)||nEn(t,e,n,r,i,s))&+(!fte(i)||fAn(t,e,n,r,i,s))&+(!Ate(i)||yAn(t,e,n,r,i,s))&+(!Bte(i)||sEn(t,e,n,r,i,s))&+(!JN(i)||!L.IsArray(s)||FEn(t,e,n,r,i,s))&+(!XN(i)||!L.IsObject(s)||GEn(t,e,n,r,i,s)))&&(!hte(i)||oAn(t,e,n,r,i,s));return t.Pop(i),o}var Uc=v(()=>{p();da();Get();ft();Wet();qet();jet();Vet();zet();Jet();Zet();ett();ttt();ntt();FAn();stt();att();ltt();Utt();Gtt();$tt();Htt();jtt();Ytt();Ktt();Xtt();ent();nnt();int();ont();cnt();unt();pnt();mnt();fnt();gnt();Ant();Ent();bnt();_nt();xnt();Snt();Int();wnt();Tnt();Rnt()});function twi(){return`${qEn[0]++}`}function nwi(t,e){ACe.has(t)||ACe.set(t,new Map);let n=ACe.get(t);if(n.has(e))return n.get(e);let r=twi();return n.set(e,r),r}function rwi(t,e,n,r){return t.UseUnevaluated()?Fe.Call(`check_${n}`,["context",r]):Fe.Call(`check_${n}`,[r])}function iwi(t,e,n,r){let i=So(t,e,n,"value");return e.UseUnevaluated()?Fe.ConstDeclaration(`check_${r}`,Fe.ArrowFunction(["context","value"],i)):Fe.ConstDeclaration(`check_${r}`,Fe.ArrowFunction(["value"],i))}function jEn(){qEn[0]=0,ACe.clear(),$te.clear()}function VEn(){return[...$te.values()]}function nR(t,e,n,r){let i=nwi(n,t.LexicalBaseURL()),s=rwi(e,n,i,r);return $te.has(i)||($te.set(i,""),$te.set(i,iwi(t,e,n,i))),s}var qEn,ACe,$te,Lte=v(()=>{p();ft();Uc();qEn=[0],ACe=new Map,$te=new Map});var YEn=v(()=>{p()});var Jx={};br(Jx,{Delete:()=>pwi,Get:()=>uwi,Has:()=>lwi,Indices:()=>Wte,Set:()=>dwi});function zEn(t){if(t.length===0)throw Error("Cannot set root")}function KEn(t){if(!L.IsObject(t))throw Error("Cannot set value")}function swi(t){if(L.IsUnsafePropertyKey(t))throw Error("Pointer contains unsafe property key")}function JEn(t){for(let e of t)swi(e)}function owi(t){return/^(0|[1-9]\d*)$/.test(t)}function XEn(t){return[t.slice(0,t.length-1),t.slice(t.length-1)[0]]}function awi(t,e){return L.IsObject(e)&&L.HasPropertyKey(e,t)}function cwi(t,e){return L.IsObject(e)&&!L.IsUnsafePropertyKey(t)?e[t]:void 0}function knt(t,e){return t.reduce((n,r)=>cwi(r,n),e)}function Wte(t){if(L.IsEqual(t.length,0))return[];let e=t.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return e.length>0&&e[0]===""?e.slice(1):e}function lwi(t,e){let n=t;return Wte(e).every(r=>awi(r,n)?(n=n[r],!0):!1)}function uwi(t,e){let n=Wte(e);return knt(n,t)}function dwi(t,e,n){let r=Wte(e);zEn(r),JEn(r);let[i,s]=XEn(r),o=knt(i,t);return KEn(o),o[s]=n,t}function pwi(t,e){let n=Wte(e);zEn(n),JEn(n);let[r,i]=XEn(n),s=knt(r,t);return KEn(s),L.IsArray(s)&&owi(i)?s.splice(+i,1):delete s[i],t}var ZEn=v(()=>{p();ft()});var yCe=v(()=>{p();YEn();ZEn()});var tD={};br(tD,{Base:()=>r0n,DefaultBase:()=>ECe,DynamicRef:()=>s0n,Ref:()=>Hte,ResolveDynamicRef:()=>Rwi,ResolveRecursiveRef:()=>vwi,ResolveRef:()=>Twi,Resource:()=>i0n});function t0n(t,e){if(L.IsObject(t)&&Kv(t)&&L.IsEqual(t.$dynamicAnchor,e))return t;if(L.IsObject(t))for(let n of L.Keys(t)){let r=t0n(t[n],e);if(r)return r}}function Bnt(t,e,n){if(L.IsEqual(t,n))return e.href;let r=Nd(t)&&Xy(t)?new URL(t.$id,e.href):e;if(L.IsArray(t))for(let i of t){let s=Bnt(i,r,n);if(!L.IsUndefined(s))return s}else if(L.IsObject(t))for(let i of L.Keys(t)){let s=Bnt(t[i],r,n);if(!L.IsUndefined(s))return s}}function mwi(t,e,n){if(L.IsEqual(t.$id,n.hash))return t;let r=new URL(n.href,e.href);if(L.IsEqual(e.pathname,r.pathname))return n.hash.startsWith("#")?n0n(t,n):t}function hwi(t,e,n){let r=new URL(`#${t.$anchor}`,e.href),i=new URL(n.href,e.href);return L.IsEqual(r.href,i.href)?t:void 0}function fwi(t,e,n){let r=new URL(`#${t.$dynamicAnchor}`,e.href),i=new URL(n.href,e.href);return L.IsEqual(r.href,i.href)?t:void 0}function n0n(t,e){if(e.href.endsWith("#"))return t;if(!e.hash.startsWith("#"))return;let n=decodeURIComponent(e.hash.slice(1));return n.startsWith("/")?Jx.Get(t,n):void 0}function gwi(t,e,n){if(Xy(t)){let r=mwi(t,e,n);if(!L.IsUndefined(r))return r}if(gte(t)){let r=hwi(t,e,n);if(!L.IsUndefined(r))return r}if(Kv(t)){let r=fwi(t,e,n);if(!L.IsUndefined(r))return r}return n0n(t,n)}function Awi(t,e,n){return t.reduce((r,i)=>{let s=bCe(i,e,n);return L.IsUndefined(s)?r:s},void 0)}function ywi(t){return L.IsEqual(t,"const")||L.IsEqual(t,"enum")}function Ewi(t,e,n){return L.Keys(t).reduce((r,i)=>{if(ywi(i))return r;let s=bCe(t[i],e,n);return L.IsUndefined(s)?r:s},void 0)}function bCe(t,e,n){let r=Nd(t)&&Xy(t)?new URL(t.$id,e.href):e;if(Nd(t)){let i=gwi(t,r,n);if(!L.IsUndefined(i))return i}if(L.IsArray(t))return Awi(t,r,n);if(L.IsObject(t))return Ewi(t,r,n)}function r0n(t,e,n){return Bnt(t,new URL(e||".",ECe),n)}function i0n(t,e,n,r){let i=Hte(t,e,n,r,!1);return Nd(i)&&Xy(i)?i:void 0}function e0n(t){return t.href.split("#")[0]}function bwi(t,e){return L.HasPropertyKey(t,e)?t[e]:void 0}function _wi(t,e,n){return bCe(t,e,n)}function xwi(t,e,n){let r=e0n(n);if(L.IsEqual(r,e0n(e))||!L.HasPropertyKey(t,r))return;let i=t[r],s=Nd(i)&&Xy(i)?new URL(i.$id,r):new URL(r);return L.IsEqual(n.hash,"")?i:bCe(i,s,n)}function Swi(t,e,n,r,i){if(!r.$ref.startsWith("#")||L.HasPropertyKey(t,"$schema"))return;let s=r0n(e,n,i);if(!(L.IsUndefined(s)||L.IsEqual(s,n)))return{target:i,base:s,root:e}}function Cwi(t,e,n){let r=t[e];if(Nd(r))return{target:n,base:e,root:r}}function Iwi(t,e,n,r,i){let s=i?Cwi(t.context,r,n):void 0;return L.IsUndefined(s)?Swi(t.root,t.lexicalSchema,t.referenceBase,e,n):s}function wwi(t,e,n,r,i,s){if(Xy(i))return;let o=i0n(t,e,n,r);if(!(!o||s.includes(o)))return{target:i,resource:o}}function Hte(t,e,n,r,i=!0){let s=new URL(n||".",ECe),o=i&&Xy(e)?new URL(e.$id,s):s,a=new URL(r,o.href);return bwi(t,r)??_wi(e,o,a)??xwi(t,o,a)}function s0n(t,e,n,r,i,s){let o=new URL(n||".",ECe),a=i.$dynamicRef.startsWith("#")?r:e,c=Hte(t,a,n,i.$dynamicRef,!1);if(L.IsUndefined(c)){let d=new URL(i.$dynamicRef,o).hash;if(!d.startsWith("#/")&&d.startsWith("#")){let m=decodeURIComponent(d.slice(1));return s.find(f=>L.IsEqual(f.$dynamicAnchor,m))??t0n(e,m)}return}return!Nd(c)||!Kv(c)||new URL(i.$dynamicRef,o).hash.startsWith("#/")?c:s.find(d=>L.IsEqual(d.$dynamicAnchor,c.$dynamicAnchor))??c}function Twi(t,e){let n=t.inRetrievedFrame?t.lexicalSchema:t.root,r=e.$ref.startsWith("#")?t.lexicalSchema:n,i=Hte(t.context,r,t.referenceBase,e.$ref,!1);if(!i||!Nd(i))return{schema:i};let s=new URL(e.$ref,t.referenceBase).href.split("#")[0],o=!L.IsEqual(s,t.resourceBase),a=Iwi(t,e,i,s,o),c=o?wwi(t.context,t.root,t.referenceBase,s,i,t.ids):void 0;return{schema:i,retrievedResource:a,resolvedResource:c}}function vwi(t,e){let n=Nte(t.lexicalSchema)?t.recursiveAnchors[0]:t.lexicalSchema;return Hte(t.context,n,t.lexicalBase,e.$recursiveRef,!1)}function Rwi(t,e){return s0n(t.context,t.root,t.lexicalBase,t.lexicalSchema,e,t.dynamicAnchors)}var ECe,o0n=v(()=>{p();ft();yCe();da();ECe="https://json-schema.org"});var _Ce=v(()=>{p();o0n()});var ol,mc,SCe,p0n,Pnt,xCe,a0n,c0n,l0n,u0n,Nnt,Dnt,Mnt,Ont,d0n,m0n,rR,h0n=v(()=>{p();da();ft();_Ce();ol=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},rR=class{constructor(e,n){mc.add(this),this.context=e,this.schema=n,this.ids=[],this.resourceIds=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[],this.retrievedResources=new Map,this.retrievedFrames=[],this.resolvedResources=new Map,this.pendingResource=!0}LexicalBaseURL(){return ol(this,mc,"m",Pnt).call(this,this.ids)}Push(e){if(!Nd(e))return;Xy(e)&&ol(this,mc,"m",Mnt).call(this,e),gte(e)&&this.anchors.push(e),Nte(e)&&this.recursiveAnchors.push(e),Kv(e)&&this.dynamicAnchors.push(e);let n=this.retrievedResources.get(e);n&&this.retrievedFrames.push({schema:n.root,base:n.base,idDepth:this.ids.length,resourceDepth:this.resourceIds.length})}Pop(e){Nd(e)&&(Xy(e)&&ol(this,mc,"m",Ont).call(this,e),gte(e)&&this.anchors.pop(),Nte(e)&&this.recursiveAnchors.pop(),Kv(e)&&this.dynamicAnchors.pop(),this.retrievedResources.has(e)&&this.retrievedFrames.pop(),ol(this,mc,"m",m0n).call(this,e))}Ref(e){let n=tD.ResolveRef(ol(this,mc,"m",SCe).call(this),e);return ol(this,mc,"m",p0n).call(this,n),n.schema}RecursiveRef(e){let n=tD.ResolveRecursiveRef(ol(this,mc,"m",SCe).call(this),e);return n&&(this.pendingResource=!0),n}DynamicRef(e){let n=tD.ResolveDynamicRef(ol(this,mc,"m",SCe).call(this),e);return n&&(this.pendingResource=!0),n}};mc=new WeakSet,SCe=function(){return{context:this.context,root:this.schema,ids:this.ids,lexicalSchema:ol(this,mc,"m",c0n).call(this),lexicalBase:this.LexicalBaseURL(),referenceBase:ol(this,mc,"m",a0n).call(this),resourceBase:ol(this,mc,"m",xCe).call(this),recursiveAnchors:this.recursiveAnchors,dynamicAnchors:this.dynamicAnchors,inRetrievedFrame:this.retrievedFrames.length>0}},p0n=function(e){L.IsUndefined(e.schema)||(this.pendingResource=!0),L.IsUndefined(e.resolvedResource)||ol(this,mc,"m",d0n).call(this,e.resolvedResource.target,e.resolvedResource.resource),L.IsUndefined(e.retrievedResource)||this.retrievedResources.set(e.retrievedResource.target,{base:e.retrievedResource.base,root:e.retrievedResource.root})},Pnt=function(e){let n=this.retrievedFrames[this.retrievedFrames.length-1],r=n?new URL(n.base):new URL(tD.DefaultBase);return(n?e.slice(n.idDepth):e).reduce((s,o)=>new URL(o.$id,s),r).href},xCe=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.resourceIds.slice(e.resourceDepth).reduce((n,r)=>new URL(r.$id,n),new URL(e.base)).href:ol(this,mc,"m",Pnt).call(this,this.resourceIds)},a0n=function(){if(this.retrievedFrames.length>0)return ol(this,mc,"m",xCe).call(this);let e=this.ids[this.ids.length-1];return e&&!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)?this.LexicalBaseURL():ol(this,mc,"m",xCe).call(this)},c0n=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.ids.length>e.idDepth?this.ids[this.ids.length-1]:e.schema:this.ids.length>0?this.ids[this.ids.length-1]:this.schema},l0n=function(e){e.forEach(n=>ol(this,mc,"m",Nnt).call(this,n,!1))},u0n=function(e){e.forEach(n=>ol(this,mc,"m",Dnt).call(this,n,!1))},Nnt=function t(e,n=!0){if(zv(e))return;if(L.IsArray(e))return ol(this,mc,"m",l0n).call(this,e);if(!Nd(e))return;let r=e;if(!(!n&&Xy(r))){!n&&Kv(r)&&this.dynamicAnchors.push(r);for(let i of L.Keys(r))ol(this,mc,"m",t).call(this,r[i],!1)}},Dnt=function t(e,n=!0){if(zv(e))return;if(L.IsArray(e))return ol(this,mc,"m",u0n).call(this,e);if(!Nd(e))return;let r=e;if(!(!n&&Xy(r))){!n&&Kv(r)&&this.dynamicAnchors.pop();for(let i of L.Keys(r))ol(this,mc,"m",t).call(this,r[i],!1)}},Mnt=function(e){this.ids.push(e);let n=this.pendingResource;this.pendingResource=!1,n&&this.resourceIds.push(e),ol(this,mc,"m",Nnt).call(this,e,!0)},Ont=function(e){this.ids.pop(),this.resourceIds.length>0&&L.IsEqual(this.resourceIds[this.resourceIds.length-1],e)&&this.resourceIds.pop(),ol(this,mc,"m",Dnt).call(this,e,!0)},d0n=function(e,n){ol(this,mc,"m",Mnt).call(this,n),this.resolvedResources.set(e,n)},m0n=function(e){if(!this.resolvedResources.has(e))return;let n=this.resolvedResources.get(e);ol(this,mc,"m",Ont).call(this,n),this.resolvedResources.delete(e)}});var qte=v(()=>{p();WI();ZN();Lte();Y4();Get();h0n();Wet();qet();jet();Vet();zet();Jet();Zet();ett();ttt();ntt();stt();att();ltt();Utt();Gtt();$tt();Htt();Ytt();Ktt();Xtt();jtt();ent();int();ont();cnt();nnt();unt();pnt();mnt();fnt();gnt();Ant();Ent();bnt();_nt();xnt();Snt();Uc();Int();wnt();Tnt();Rnt()});var f0n=v(()=>{p();d4();ft();_Ce();da()});var g0n=v(()=>{p();f0n()});var A0n=v(()=>{p()});function kwi(t){let e=t.Functions().join(`; +`),n=t.UseUnevaluated()?["const context = new CheckContext({}, {})",`return ${t.Entry()}`]:[`return ${t.Entry()}`];return`${e}; return (value) => { ${n.join("; ")} }`}function Bwi(t,e){return c4.Evaluate("CheckContext","Guard","Format","Hashing",t.External().identifier,e)(Zp,L,lF,DI,t.External().variables)}function Nwi(t){let e=new rR(t.Context(),t.Schema()),n=new Zp;return r=>Vs(e,n,t.Schema(),r)}function Dwi(t,e){return c4.CanEvaluate()?Bwi(t,e):Nwi(t)}function jte(...t){let[e,n]=Gi.Match(t,{2:(c,u)=>[c,u],1:c=>[{},c]});nAn(),jEn();let r=new rR(e,n),i=new LSe(tAn(e,n)),s=nR(r,i,n,"value"),o=VEn(),a=rAn();return new Qnt(e,n,a,o,s,i.UseUnevaluated())}var Fnt,Qnt,Unt=v(()=>{p();Yl();MJe();JZ();ft();Ftt();qte();Fnt=class{constructor(e,n,r){this.isAccelerated=e,this.code=n,this.check=r}IsAccelerated(){return this.isAccelerated}Code(){return this.code}Check(e){return this.check(e)}},Qnt=class{constructor(e,n,r,i,s,o){this.context=e,this.schema=n,this.external=r,this.functions=i,this.entry=s,this.useUnevaluated=o}Context(){return this.context}Schema(){return this.schema}UseUnevaluated(){return this.useUnevaluated}External(){return this.external}Functions(){return this.functions}Entry(){return this.entry}Evaluate(){let e=kwi(this),n=Dwi(this,e);return new Fnt(c4.CanEvaluate(),e,n)}}});function CCe(...t){let[e,n,r]=Gi.Match(t,{3:(l,d,m)=>[l,d,m],2:(l,d)=>[{},l,d]}),i=new rR(e,n),s=new em,o=Fa(i,s,"#","",n,r),a=s.GetErrors(),c=can(),u=a.map(l=>({...l,message:c(l)}));return[o,u]}var ICe=v(()=>{p();Yl();QJe();qte()});function Gnt(...t){let[e,n,r]=Gi.Match(t,{3:(o,a,c)=>[o,a,c],2:(o,a)=>[{},o,a]}),i=new rR(e,n),s=new Zp;return Vs(i,s,n,r)}var $nt=v(()=>{p();Yl();qte()});var Wnt=v(()=>{p();Yl();$nt();ICe()});var y0n=v(()=>{p();Yl();Unt();ICe();Wnt()});var Hnt=v(()=>{p();qte();g0n();yCe();_Ce();A0n();da();Unt();y0n();$nt();Wnt();ICe()});var Z4=v(()=>{p();Hnt();Hnt()});function wCe(){return"// @ts-ignore"}function TCe(){return""}function Owi(t){return[...t.UseUnevaluated()?['import { CheckContext } from "typebox/schema"']:[],'import { Hashing } from "typebox/system"','import { Format } from "typebox/format"','import { Guard } from "typebox/guard"']}function Lwi(t){let{identifier:e}=t.External();return[TCe(),wCe(),`let ${e} = []`,TCe(),wCe(),`export function SetExternal(external) { ${e} = external.variables }`]}function Fwi(t){return t.Functions().map(e=>[TCe(),wCe(),`${e};`].join(` +`))}function Qwi(t){let e=t.UseUnevaluated()?`const context = new CheckContext({}, {}); return ${t.Entry()}`:`return ${t.Entry()}`;return[TCe(),wCe(),`export function Check(value) { ${e} }`]}function E0n(...t){let[e,n]=Gi.Match(t,{2:(s,o)=>[s,o],1:s=>[{},s]}),r=jte(e,n),i=[...Owi(r),...Lwi(r),...Fwi(r),...Qwi(r)].join(` +`);return{External:r.External(),Code:i}}var qnt=v(()=>{p();Yl();Z4()});function gs(...t){let[e,n,r]=Gi.Match(t,{3:(i,s,o)=>[i,s,o],2:(i,s)=>[{},i,s]});return Gnt(e,n,r)}var b0n=v(()=>{p();Yl();Z4()});var ad=v(()=>{p();b0n()});function EA(...t){let[e,n,r]=Gi.Match(t,{3:(o,a,c)=>[o,a,c],2:(o,a)=>[{},o,a]}),[i,s]=CCe(e,n,r);return s}var _0n=v(()=>{p();Yl();Z4()});var uF=v(()=>{p();_0n()});function Vte(...t){let[e,n,r]=Gi.Match(t,{3:(s,o,a)=>[s,o,a],2:(s,o)=>[{},s,o]});if(!gs(e,n,r))throw new HI("Assert",r,EA(e,n,r))}var HI,x0n=v(()=>{p();Yl();ad();uF();HI=class extends Error{constructor(e,n,r){super(e),Object.defineProperty(this,"cause",{value:{source:e,errors:r,value:n},writable:!1,configurable:!1,enumerable:!1})}}});var dF=v(()=>{p();x0n()});var ki=v(()=>{p();j2();vet();Gx();TSe();_ee()});function S0n(t,e,n){return L.IsArray(n)?n.map(r=>Dd(t,e.items,r)):n}var C0n=v(()=>{p();ft();qI()});function I0n(t,e,n){return Dd({...t,...e.$defs},Iu(e.$ref),n)}var w0n=v(()=>{p();ki();qI()});function Uwi(t,e){let n=L.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},r=gA(t,e),i=od(r);return Jr(i)?ste(i,n):i}function T0n(t,e,n){let r=Uwi(t,e);return Dd(t,r,n)}var v0n=v(()=>{p();ki();ft();qI()});function vCe(t){return L.HasPropertyKey(t,"additionalProperties")?t.additionalProperties:void 0}var jnt=v(()=>{p();ft()});function R0n(t,e,n){if(!L.IsObject(n)||L.IsArray(n))return n;let r=vCe(e);for(let i of L.Keys(n)){if(L.HasPropertyKey(e.properties,i)){n[i]=Dd(t,e.properties[i],n[i]);continue}if(L.IsBoolean(r)&&L.IsEqual(r,!0)||Fc(r)&&gs(t,r,n[i])){n[i]=Dd(t,r,n[i]);continue}delete n[i]}return n}var k0n=v(()=>{p();ki();ft();qI();ad();jnt()});function B0n(t,e,n){if(!L.IsObject(n))return n;let r=vCe(e),[i,s]=[new RegExp(vu(e)),_a(e)];for(let o of L.Keys(n)){if(i.test(o)){n[o]=Dd(t,s,n[o]);continue}if(L.IsBoolean(r)&&L.IsEqual(r,!0)||Fc(r)&&gs(t,r,n[o])){n[o]=Dd(t,r,n[o]);continue}delete n[o]}return n}var N0n=v(()=>{p();ki();ft();qI();ad();jnt()});function D0n(t,e,n){return L.HasPropertyKey(t,e.$ref)?Dd(t,t[e.$ref],n):n}var P0n=v(()=>{p();ft();qI()});function M0n(t,e,n){if(!L.IsArray(n))return n;let r=Math.min(n.length,e.items.length);for(let i=0;i{p();ft();qI()});function xa(t){return v2(t)}var L0n=v(()=>{p();WZ()});var Zf=v(()=>{p();L0n()});function F0n(t,e,n){for(let r of e.anyOf){let i=Dd(t,r,xa(n));if(gs(t,r,i))return i}return n}var Q0n=v(()=>{p();ad();Zf();qI()});function Dd(t,e,n){return xs(e)?S0n(t,e,n):la(e)?I0n(t,e,n):Vr(e)?T0n(t,e,n):Jr(e)?R0n(t,e,n):Do(e)?B0n(t,e,n):uo(e)?D0n(t,e,n):rs(e)?M0n(t,e,n):On(e)?F0n(t,e,n):n}var qI=v(()=>{p();ki();C0n();w0n();v0n();k0n();N0n();P0n();O0n();Q0n()});function Gwi(t,e){for(let n of B_e.Keys(t))B_e.HasPropertyKey(e,n)||(e[n]=t[n]);return e}function $wi(t){let e={};for(let n of B_e.Keys(t))e[n]=Yte(t[n]);return e}function Wwi(t){return Vnt(Tet(t))}function Vnt(t){return t.map(e=>Yte(e))}function Yte(t){let e=xs(t)?Lh(Yte(t.items),R2(t)):Vr(t)?Jp(Vnt(t.allOf)):On(t)?Ri(Wwi(t.anyOf)):Jr(t)?Kr($wi(t.properties)):Do(t)?$2(Hv(t),Yte(_a(t))):rs(t)?il(Vnt(t.items)):t;return Gwi(t,e)}function mF(t){return Yte(t)}var zte=v(()=>{p();ft();ki();ki();ki();ki();ki();ki();ki()});function bA(...t){let[e,n,r]=Gi.Match(t,{3:(s,o,a)=>[s,o,a],2:(s,o)=>[{},s,o]}),i=Lc.Get().unionPrioritySort?mF(n):n;return Dd(e,i,r)}var U0n=v(()=>{p();d4();qI();zte()});var hF=v(()=>{p();U0n()});function Ynt(t){return L.IsObject(t)&&L.HasPropertyKey(t,"value")}function Lr(t){return{value:t}}function fF(){}var iR=v(()=>{p();ft()});function Hwi(t){return L.IsArray(t)?Lr(t):Lr([t])}var G0n=v(()=>{p();ft();iR()});function qwi(t){return L.IsEqual(t,!0)?Lr(BigInt(1)):Lr(BigInt(0))}function zwi(t){return jwi.test(t)}function Kwi(t){return Vwi.test(t)}function Jwi(t){return Ywi.test(t)}function Xwi(t){let e=t.toLowerCase();return zwi(t)?Lr(BigInt(t.slice(0,t.length-1))):Kwi(t)?Lr(BigInt(t.split(".")[0])):Jwi(t)?Lr(BigInt(t)):L.IsEqual(e,"false")?Lr(BigInt(0)):L.IsEqual(e,"true")?Lr(BigInt(1)):void 0}function znt(t){return L.IsBigInt(t)?Lr(t):L.IsBoolean(t)?qwi(t):L.IsNumber(t)?Lr(BigInt(Math.trunc(t))):L.IsNull(t)?Lr(BigInt(0)):L.IsString(t)?Xwi(t):L.IsUndefined(t)?Lr(BigInt(0)):void 0}var jwi,Vwi,Ywi,Knt=v(()=>{p();ft();iR();jwi=/^-?(0|[1-9]\d*)n$/,Vwi=/^-?(0|[1-9]\d*)\.\d+$/,Ywi=/^-?(0|[1-9]\d*)$/});function Zwi(t){return L.IsEqual(t,BigInt(0))?Lr(!1):L.IsEqual(t,BigInt(1))?Lr(!0):void 0}function eTi(t){return L.IsEqual(t,0)?Lr(!1):L.IsEqual(t,1)?Lr(!0):void 0}function tTi(t){return L.IsEqual(t.toLowerCase(),"false")?Lr(!1):L.IsEqual(t.toLowerCase(),"true")?Lr(!0):L.IsEqual(t,"0")?Lr(!1):L.IsEqual(t,"1")?Lr(!0):void 0}function nTi(t){return L.IsBigInt(t)?Zwi(t):L.IsBoolean(t)?Lr(t):L.IsNumber(t)?eTi(t):L.IsNull(t)?Lr(!1):L.IsString(t)?tTi(t):L.IsUndefined(t)?Lr(!1):void 0}var $0n=v(()=>{p();ft();iR()});function rTi(t){return L.IsEqual(t,BigInt(0))?Lr(null):void 0}function iTi(t){return L.IsEqual(t,!1)?Lr(null):void 0}function sTi(t){return L.IsEqual(t,0)?Lr(null):void 0}function oTi(t){let e=t.toLowerCase();return L.IsEqual(e,"undefined")||L.IsEqual(e,"null")||L.IsEqual(t,"")||L.IsEqual(t,"0")?Lr(null):void 0}function aTi(t){return L.IsBigInt(t)?rTi(t):L.IsBoolean(t)?iTi(t):L.IsNumber(t)?sTi(t):L.IsNull(t)?Lr(null):L.IsString(t)?oTi(t):L.IsUndefined(t)?Lr(null):void 0}var W0n=v(()=>{p();ft();iR()});function cTi(t){return t<=H0n&&t>=q0n?Lr(Number(t)):void 0}function lTi(t){return Lr(t?1:0)}function uTi(t){let e=+t;if(L.IsNumber(e))return Lr(e);let n=t.toLowerCase();if(L.IsEqual(n,"false"))return Lr(0);if(L.IsEqual(n,"true"))return Lr(1);let r=znt(t);return Ynt(r)?r.value<=H0n&&r.value>=q0n?Lr(Number(r.value)):void 0:void 0}function dTi(t){return L.IsBigInt(t)?cTi(t):L.IsBoolean(t)?lTi(t):L.IsNumber(t)?Lr(t):L.IsNull(t)?Lr(0):L.IsString(t)?uTi(t):L.IsUndefined(t)?Lr(0):void 0}var H0n,q0n,j0n=v(()=>{p();ft();iR();Knt();H0n=BigInt(Number.MAX_SAFE_INTEGER),q0n=BigInt(Number.MIN_SAFE_INTEGER)});function pTi(t){return L.IsBigInt(t)?Lr(t.toString()):L.IsBoolean(t)?Lr(t.toString()):L.IsNumber(t)?Lr(t.toString()):L.IsNull(t)?Lr("null"):L.IsString(t)?Lr(t):L.IsUndefined(t)?Lr(""):void 0}var V0n=v(()=>{p();ft();iR()});function mTi(t){return L.IsEqual(t,BigInt(0))?Lr(void 0):void 0}function hTi(t){return L.IsEqual(t,!1)?Lr(void 0):void 0}function fTi(t){return L.IsEqual(t,0)?Lr(void 0):void 0}function gTi(t){let e=t.toLowerCase();return L.IsEqual(e,"undefined")||L.IsEqual(e,"null")||L.IsEqual(t,"")||L.IsEqual(t,"0")?Lr(void 0):void 0}function ATi(t){return L.IsBigInt(t)?mTi(t):L.IsBoolean(t)?hTi(t):L.IsNumber(t)?fTi(t):L.IsNull(t)?Lr(void 0):L.IsString(t)?gTi(t):L.IsUndefined(t)?Lr(t):void 0}var Y0n=v(()=>{p();ft();iR()});var po={};br(po,{Fail:()=>fF,IsOk:()=>Ynt,Ok:()=>Lr,TryArray:()=>Hwi,TryBigInt:()=>znt,TryBoolean:()=>nTi,TryNull:()=>aTi,TryNumber:()=>dTi,TryString:()=>pTi,TryUndefined:()=>ATi});var z0n=v(()=>{p();G0n();Knt();$0n();W0n();j0n();iR();V0n();Y0n()});var Xx=v(()=>{p();z0n()});function K0n(t,e,n){return po.TryArray(n).value.map(i=>kl(t,e.items,i))}var J0n=v(()=>{p();tE();Xx()});function X0n(t,e,n){let r=po.TryBigInt(n);return po.IsOk(r)?r.value:n}var Z0n=v(()=>{p();Xx()});function ebn(t,e,n){let r=po.TryBoolean(n);return po.IsOk(r)?r.value:n}var tbn=v(()=>{p();Xx()});function nbn(t,e,n){return kl({...t,...e.$defs},Iu(e.$ref),n)}var rbn=v(()=>{p();ki();tE()});function ibn(t,e,n){return kl(t,od(e),n)}var sbn=v(()=>{p();ki();tE()});function obn(t,e,n){let r=po.TryNumber(n);return po.IsOk(r)?Math.trunc(r.value):n}var abn=v(()=>{p();Xx()});function cbn(t,e,n){let r=gA(t,e),i=od(r);return kl(t,i,n)}var lbn=v(()=>{p();ki();tE()});function yTi(t,e,n){let r=po.TryBigInt(n);return po.IsOk(r)&&L.IsEqual(e.const,r.value)?r.value:n}function ETi(t,e,n){let r=po.TryBoolean(n);return po.IsOk(r)&&L.IsEqual(e.const,r.value)?r.value:n}function bTi(t,e,n){let r=po.TryNumber(n);return po.IsOk(r)&&L.IsEqual(e.const,r.value)?r.value:n}function _Ti(t,e,n){let r=po.TryString(n);return po.IsOk(r)&&L.IsEqual(e.const,r.value)?r.value:n}function ubn(t,e,n){return L.IsEqual(e.const,n)?n:JJe(e)?yTi(t,e,n):XJe(e)?ETi(t,e,n):oee(e)?bTi(t,e,n):aee(e)?_Ti(t,e,n):vl()}var dbn=v(()=>{p();Lx();ft();ki();Xx()});function pbn(t,e,n){let r=po.TryNull(n);return po.IsOk(r)?r.value:n}var mbn=v(()=>{p();Xx()});function hbn(t,e,n){let r=po.TryNumber(n);return po.IsOk(r)?r.value:n}var fbn=v(()=>{p();Xx()});function RCe(t,e,n,r){let i=L.Keys(r);for(let[s,o]of e)for(let a of i)s.test(a)||(r[a]=kl(t,n,r[a]));return r}var Jnt=v(()=>{p();ft();tE()});function e8(t,e,n){return wu(t)&&L.IsUndefined(n[e])}var kCe=v(()=>{p();ft();ki()});function xTi(t,e,n){let r=L.EntriesRegExp(e.properties),i=L.Keys(n);for(let[s,o]of r)for(let a of i)!s.test(a)||e8(o,a,n)||(n[a]=kl(t,o,n[a]));return L.HasPropertyKey(e,"additionalProperties")&&L.IsObject(e.additionalProperties)?RCe(t,r,e.additionalProperties,n):n}function gbn(t,e,n){return L.IsObjectNotArray(n)?xTi(t,e,n):n}var Abn=v(()=>{p();ft();tE();Jnt();kCe()});function STi(t,e,n){let r=L.EntriesRegExp(e.patternProperties),i=L.Keys(n);for(let[s,o]of r)for(let a of i)s.test(a)&&(n[a]=kl(t,o,n[a]));return L.HasPropertyKey(e,"additionalProperties")&&L.IsObject(e.additionalProperties)?RCe(t,r,e.additionalProperties,n):n}function ybn(t,e,n){return L.IsObjectNotArray(n)?STi(t,e,n):n}var Ebn=v(()=>{p();ft();tE();Jnt()});function bbn(t,e,n){return L.HasPropertyKey(t,e.$ref)?kl(t,t[e.$ref],n):n}var _bn=v(()=>{p();tE();ft()});function xbn(t,e,n){let r=po.TryString(n);return po.IsOk(r)?r.value:n}var Sbn=v(()=>{p();Xx()});function Cbn(t,e,n){return kl(t,od(e),n)}var Ibn=v(()=>{p();ki();tE()});function wbn(t,e,n){if(!L.IsArray(n))return n;for(let r=0;r{p();ft();tE()});function vbn(t,e,n){let r=po.TryUndefined(n);return po.IsOk(r)?r.value:n}var Rbn=v(()=>{p();Xx()});function kbn(t,e,n){if(e.anyOf.some(o=>gs(t,o,n)))return n;let s=e.anyOf.map(o=>kl(t,o,xa(n))).find(o=>gs(t,e,o));return L.IsUndefined(s)?n:s}var Bbn=v(()=>{p();ft();ad();Zf();tE()});function Nbn(t,e,n){let r=po.TryUndefined(n);return po.IsOk(r)?void 0:n}var Dbn=v(()=>{p();Xx()});function kl(t,e,n){return xs(e)?K0n(t,e,n):Vf(e)?X0n(t,e,n):$m(e)?ebn(t,e,n):la(e)?nbn(t,e,n):rl(e)?ibn(t,e,n):id(e)?obn(t,e,n):Vr(e)?cbn(t,e,n):hs(e)?ubn(t,e,n):Qx(e)?pbn(t,e,n):lc(e)?hbn(t,e,n):Jr(e)?gbn(t,e,n):Do(e)?ybn(t,e,n):uo(e)?bbn(t,e,n):zl(e)?xbn(t,e,n):ua(e)?Cbn(t,e,n):rs(e)?wbn(t,e,n):Yy(e)?vbn(t,e,n):On(e)?kbn(t,e,n):Jf(e)?Nbn(t,e,n):n}var tE=v(()=>{p();ki();J0n();Z0n();tbn();rbn();sbn();abn();lbn();dbn();mbn();fbn();Abn();Ebn();_bn();Sbn();Ibn();Tbn();Rbn();Bbn();Dbn()});function nE(...t){let[e,n,r]=Gi.Match(t,{3:(i,s,o)=>[i,s,o],2:(i,s)=>[{},i,s]});return kl(e,n,r)}var Pbn=v(()=>{p();Yl();tE()});var gF=v(()=>{p();Pbn()});function Mbn(t,e,n){if(!L.IsArray(n))return n;for(let r=0;r{p();ft();jI()});function Lbn(t,e,n){return Pd({...t,...e.$defs},Iu(e.$ref),n)}var Fbn=v(()=>{p();ki();jI()});function Qbn(t,e){return L.IsUndefined(e)?L.IsFunction(t.default)?t.default():xa(t.default):e}var Ubn=v(()=>{p();ft();Zf()});function Gbn(t,e,n){let r=gA(t,e),i=od(r);return Pd(t,i,n)}var $bn=v(()=>{p();ki();jI()});function Wbn(t,e,n){if(!L.IsObject(n))return n;let r=L.Keys(e.properties);for(let i of r){let s=Pd(t,e.properties[i],n[i]);L.IsUndefined(s)&&(wu(e.properties[i])||!L.HasPropertyKey(e.properties[i],"default"))||(n[i]=s)}if(!AA(e)||L.IsBoolean(e.additionalProperties))return n;for(let i of L.Keys(n))r.includes(i)||(n[i]=Pd(t,e.additionalProperties,n[i]));return n}var Hbn=v(()=>{p();ki();ft();jI();da()});function qbn(t,e,n){if(!L.IsObject(n))return n;let[r,i]=[new RegExp(vu(e)),_a(e)];for(let s of L.Keys(n))r.test(s)&&yA(i)&&(n[s]=Pd(t,i,n[s]));if(!AA(e))return n;for(let s of L.Keys(n))r.test(s)||(n[s]=Pd(t,e.additionalProperties,n[s]));return n}var jbn=v(()=>{p();ki();da();ft();jI()});function Vbn(t,e,n){return L.HasPropertyKey(t,e.$ref)?Pd(t,t[e.$ref],n):n}var Ybn=v(()=>{p();ft();jI()});function zbn(t,e,n){if(!L.IsArray(n))return n;let[r,i]=[e.items,Math.max(e.items.length,n.length)];for(let s=0;s{p();ft();jI()});function Jbn(t,e,n){for(let r of e.anyOf){let i=Pd(t,r,xa(n));if(gs(t,r,i))return i}return n}var Xbn=v(()=>{p();ad();Zf();jI()});function Pd(t,e,n){let r=yA(e)?Qbn(e,n):n;return xs(e)?Mbn(t,e,r):la(e)?Lbn(t,e,r):Vr(e)?Gbn(t,e,r):Jr(e)?Wbn(t,e,r):Do(e)?qbn(t,e,r):uo(e)?Vbn(t,e,r):rs(e)?zbn(t,e,r):On(e)?Jbn(t,e,r):r}var jI=v(()=>{p();Z4();ki();Obn();Fbn();Ubn();$bn();Hbn();jbn();Ybn();Kbn();Xbn()});function Zx(...t){let[e,n,r]=Gi.Match(t,{3:(i,s,o)=>[i,s,o],2:(i,s)=>[{},i,s]});return Pd(e,n,r)}var Zbn=v(()=>{p();Yl();jI()});var t8=v(()=>{p();Zbn()});function AF(t){return(...e)=>{let[n,r,i]=Gi.Match(e,{3:(s,o,a)=>[s,o,a],2:(s,o)=>[{},s,o]});return t.reduce((s,o)=>o(n,r,s),i)}}var e_n=v(()=>{p();Yl()});var Kte=v(()=>{p();e_n()});function CTi(t,e,n){return e["~codec"].decode(n)}function ITi(t,e,n){return e["~codec"].encode(n)}function hc(t,e,n,r){return Gm(n)?L.IsEqual(t,"Decode")?CTi(e,n,r):ITi(e,n,r):r}var VI=v(()=>{p();ft();ki()});function wTi(t,e,n,r){if(!L.IsArray(r))return r;for(let i=0;i{p();ft();eS();VI()});function r_n(t,e,n,r){return r=Gc(t,{...e,...n.$defs},Iu(n.$ref),r),hc(t,e,n,r)}var i_n=v(()=>{p();ki();eS();VI()});function s_n(t){return t.reduce((e,n)=>({...e,...n}),{})}function o_n(t,e){for(let n of e)if(!L.IsDeepEqual(t,n))return n;return t}function vTi(t,e,n,r){if(L.IsEqual(n.allOf.length,0))return hc(t,e,n,r);let i=n.allOf.map(a=>Gc(t,e,a,bA(a,xa(r)))),o=i.every(a=>L.IsObject(a))?s_n(i):o_n(r,i);return hc(t,e,n,o)}function RTi(t,e,n,r){if(L.IsEqual(n.allOf.length,0))return hc(t,e,n,r);let i=hc(t,e,n,r),s=n.allOf.map(a=>Gc(t,e,a,bA(a,xa(i))));return s.every(a=>L.IsObject(a))?s_n(s):o_n(i,s)}function a_n(t,e,n,r){return L.IsEqual(t,"Decode")?vTi(t,e,n,r):RTi(t,e,n,r)}var c_n=v(()=>{p();ft();eS();VI();Zf();hF()});function kTi(t,e,n,r){if(!L.IsObjectNotArray(r))return r;for(let i of L.Keys(n.properties))!L.HasPropertyKey(r,i)||e8(n.properties[i],i,r)||(r[i]=Gc(t,e,n.properties[i],r[i]));return hc(t,e,n,r)}function BTi(t,e,n,r){let i=hc(t,e,n,r);if(!L.IsObjectNotArray(i))return i;for(let s of L.Keys(n.properties))!L.HasPropertyKey(i,s)||e8(n.properties[s],s,i)||(i[s]=Gc(t,e,n.properties[s],i[s]));return i}function l_n(t,e,n,r){return L.IsEqual(t,"Decode")?kTi(t,e,n,r):BTi(t,e,n,r)}var u_n=v(()=>{p();ft();eS();VI();kCe()});function NTi(t,e,n,r){if(!L.IsObjectNotArray(r))return r;let i=new RegExp(vu(n));for(let s of L.Keys(r))i.test(s)&&(r[s]=Gc(t,e,_a(n),r[s]));return hc(t,e,n,r)}function DTi(t,e,n,r){let i=hc(t,e,n,r);if(!L.IsObjectNotArray(i))return i;let s=new RegExp(vu(n));for(let o of L.Keys(i))s.test(o)&&(i[o]=Gc(t,e,_a(n),i[o]));return i}function d_n(t,e,n,r){return L.IsEqual(t,"Decode")?NTi(t,e,n,r):DTi(t,e,n,r)}var p_n=v(()=>{p();ft();ki();eS();VI()});function m_n(t,e,n,r){return L.HasPropertyKey(e,n.$ref)?Gc(t,e,e[n.$ref],r):r}function h_n(t,e,n,r){return L.IsEqual(t,"Decode")?hc(t,e,n,m_n(t,e,n,r)):m_n(t,e,n,hc(t,e,n,r))}var f_n=v(()=>{p();ft();eS();VI()});function PTi(t,e,n,r){if(!L.IsArray(r))return r;for(let i=0;i{p();ft();eS();VI()});function OTi(t,e,n,r){for(let i of n.anyOf){if(!gs(e,i,r))continue;let s=Gc(t,e,i,r);return hc(t,e,n,s)}return r}function LTi(t,e,n,r){let i=hc(t,e,n,r);for(let s of n.anyOf){let o=Gc(t,e,s,xa(i));if(gs(e,s,o))return o}return i}function y_n(t,e,n,r){return L.IsEqual(t,"Decode")?OTi(t,e,n,r):LTi(t,e,n,r)}var E_n=v(()=>{p();ft();VI();eS();Zf();ad()});function Gc(t,e,n,r){return xs(n)?t_n(t,e,n,r):la(n)?r_n(t,e,n,r):Vr(n)?a_n(t,e,n,r):Jr(n)?l_n(t,e,n,r):Do(n)?d_n(t,e,n,r):uo(n)?h_n(t,e,n,r):rs(n)?g_n(t,e,n,r):On(n)?y_n(t,e,n,r):hc(t,e,n,r)}var eS=v(()=>{p();ki();n_n();i_n();c_n();u_n();p_n();f_n();A_n();E_n();VI()});function FTi(t,e,n){if(!gs(t,e,n))throw new BCe(n,EA(t,e,n));return n}function b_n(t,e,n){let r=Lc.Get().unionPrioritySort?mF(e):e;return Gc("Decode",t,r,n)}function Jte(...t){let[e,n,r]=Gi.Match(t,{3:(i,s,o)=>[i,s,o],2:(i,s)=>[{},i,s]});return QTi(e,n,r)}var BCe,QTi,__n=v(()=>{p();d4();dF();ad();uF();hF();Zf();gF();t8();Kte();eS();zte();BCe=class extends HI{constructor(e,n){super("Decode",e,n)}};QTi=AF([(t,e,n)=>xa(n),(t,e,n)=>Zx(t,e,n),(t,e,n)=>nE(t,e,n),(t,e,n)=>bA(t,e,n),(t,e,n)=>FTi(t,e,n),(t,e,n)=>b_n(t,e,n)])});function UTi(t,e,n){if(!gs(t,e,n))throw new NCe(n,EA(t,e,n));return n}function x_n(t,e,n){let r=Lc.Get().unionPrioritySort?mF(e):e;return Gc("Encode",t,r,n)}function Xte(...t){let[e,n,r]=Gi.Match(t,{3:(i,s,o)=>[i,s,o],2:(i,s)=>[{},i,s]});return GTi(e,n,r)}var NCe,GTi,S_n=v(()=>{p();d4();dF();ad();uF();hF();Zf();gF();t8();Kte();eS();zte();NCe=class extends HI{constructor(e,n){super("Encode",e,n)}};GTi=AF([(t,e,n)=>xa(n),(t,e,n)=>x_n(t,e,n),(t,e,n)=>Zx(t,e,n),(t,e,n)=>nE(t,e,n),(t,e,n)=>bA(t,e,n),(t,e,n)=>UTi(t,e,n)])});function $Ti(t,e){return Gm(e)||nD(t,e.items)}function WTi(t,e){return Gm(e)||C_n({...t,...e.$defs},Iu(e.$ref))}function HTi(t,e){return Gm(e)||e.allOf.some(n=>nD(t,n))}function qTi(t,e){return Gm(e)||L.Keys(e.properties).some(n=>nD(t,e.properties[n]))}function jTi(t,e){return Gm(e)||nD(t,_a(e))}function C_n(t,e){return Xnt.has(e.$ref)?!1:(Xnt.add(e.$ref),Gm(e)||L.HasPropertyKey(t,e.$ref)&&nD(t,t[e.$ref]))}function VTi(t,e){return Gm(e)||e.items.some(n=>nD(t,n))}function YTi(t,e){return Gm(e)||e.anyOf.some(n=>nD(t,n))}function nD(t,e){return xs(e)?$Ti(t,e):la(e)?WTi(t,e):Vr(e)?HTi(t,e):Jr(e)?qTi(t,e):Do(e)?jTi(t,e):uo(e)?C_n(t,e):rs(e)?VTi(t,e):On(e)?YTi(t,e):Gm(e)}function Zte(...t){let[e,n]=Gi.Match(t,{2:(r,i)=>[r,i],1:r=>[{},r]});return Xnt.clear(),nD(e,n)}var Xnt,I_n=v(()=>{p();Yl();ft();ki();ki();ki();ki();ki();ki();ki();ki();ki();Xnt=new Set});var Znt=v(()=>{p();__n();S_n();I_n()});var rE,yF=v(()=>{p();rE=class extends Error{constructor(e,n){super(n),this.type=e}}});function w_n(t,e){return L.IsFunction(e.default)?e.default(e):L.IsObject(e.default)?xa(e.default):e.default}var T_n=v(()=>{p();ft();Zf()});function v_n(t,e){if($I(e)&&!yA(e))throw new rE(e,"Arrays with uniqueItems constraints must specify a default annotation");let n=Zv(e)?e.minItems:0;return Array.from({length:n},()=>Bl(t,e.items))}var R_n=v(()=>{p();da();iE();yF()});function k_n(t,e){return Hx(e)?BigInt(e.exclusiveMinimum)+BigInt(1):qx(e)?BigInt(e.minimum):BigInt(0)}var B_n=v(()=>{p();da()});function N_n(t,e){return!1}var D_n=v(()=>{p()});function P_n(t,e){let n=Bl(t,e.instanceType);return class{constructor(){Object.assign(this,n)}}}var M_n=v(()=>{p();iE()});function O_n(t,e){return Bl({...t,...e.$defs},Iu(e.$ref))}var L_n=v(()=>{p();ki();iE()});function F_n(t,e){return Bl(t,od(e))}var Q_n=v(()=>{p();ki();iE()});function U_n(t,e){let n=Bl(t,e.returnType);return()=>n}var G_n=v(()=>{p();iE()});function $_n(t,e){return Hx(e)&&L.IsNumber(e.exclusiveMinimum)?e.exclusiveMinimum+1:qx(e)?e.minimum:0}var W_n=v(()=>{p();ft();da()});function H_n(t,e){let n=gA(t,e),r=od(n);return Bl(t,r)}var q_n=v(()=>{p();ki();iE()});function j_n(t,e){return e.const}var V_n=v(()=>{p()});function Y_n(t,e){throw new rE(e,"Cannot create TNever types")}var z_n=v(()=>{p();yF()});function K_n(t,e){return null}var J_n=v(()=>{p()});function X_n(t,e){return Hx(e)&&L.IsNumber(e.exclusiveMinimum)?e.exclusiveMinimum+1:qx(e)?e.minimum:0}var Z_n=v(()=>{p();ft();da()});function exn(t,e){return(L.IsUndefined(e.required)?[]:e.required).reduce((r,i)=>({...r,[i]:Bl(t,e.properties[i])}),{})}var txn=v(()=>{p();ft();iE()});function nxn(t,e){if(aF(e)&&!yA(e))throw new rE(e,"Record with the minProperties constraint must have a default annotation");return{}}var rxn=v(()=>{p();da();yF()});function ixn(t,e){return L.HasPropertyKey(t,e.$ref)?Bl(t,t[e.$ref]):(()=>{throw new rE(e,"Unable to deref Ref")})()}var sxn=v(()=>{p();ft();iE();yF()});function oxn(t,e){if((cF(e)||iF(e))&&!yA(e))throw Error("Strings with format or pattern constraints must specify default");let r=oF(e)?e.minLength:0;return"".padEnd(r)}var axn=v(()=>{p();da()});function cxn(t,e){return Symbol()}var lxn=v(()=>{p()});function uxn(t,e){let n=Q2(e.pattern);if(zl(n))throw new rE(e,"Unable to create TemplateLiteral due to infinite type expansion");return Bl(t,n)}var dxn=v(()=>{p();ki();wSe();iE();yF()});function pxn(t,e){return Array.from({length:e.minItems},(n,r)=>Bl(t,e.items[r]))}var mxn=v(()=>{p();iE()});var hxn=v(()=>{p()});function fxn(t,e){if(L.IsEqual(e.anyOf.length,0))throw Error("Unable to create Union with no variants");return Bl(t,e.anyOf[0])}var gxn=v(()=>{p();ft();iE()});var Axn=v(()=>{p()});function Bl(t,e){return yA(e)?w_n(t,e):xs(e)?v_n(t,e):Vf(e)?k_n(t,e):$m(e)?N_n(t,e):el(e)?P_n(t,e):la(e)?O_n(t,e):rl(e)?F_n(t,e):tl(e)?U_n(t,e):id(e)?$_n(t,e):Vr(e)?H_n(t,e):hs(e)?j_n(t,e):Qh(e)?Y_n(t,e):Qx(e)?K_n(t,e):lc(e)?X_n(t,e):Jr(e)?exn(t,e):Do(e)?nxn(t,e):uo(e)?ixn(t,e):zl(e)?oxn(t,e):Ux(e)?cxn(t,e):ua(e)?uxn(t,e):rs(e)?pxn(t,e):Yy(e)?void 0:On(e)?fxn(t,e):Jf(e)?void 0:void 0}var iE=v(()=>{p();ki();da();T_n();R_n();B_n();D_n();M_n();L_n();Q_n();G_n();W_n();q_n();V_n();z_n();J_n();Z_n();txn();rxn();sxn();axn();lxn();dxn();mxn();hxn();gxn();Axn()});function ku(...t){let[e,n]=Gi.Match(t,{2:(r,i)=>[r,i],1:r=>[{},r]});return Bl(e,n)}var yxn=v(()=>{p();Yl();iE()});var YI=v(()=>{p();yF();yxn()});function ene(t,e){return L.IsDeepEqual(t,e)}var Exn=v(()=>{p();ft()});var DCe=v(()=>{p();Exn()});function tne(t){return DI.Hash(t)}var bxn=v(()=>{p();JZ()});var PCe=v(()=>{p();bxn()});function zTi(t,e,n){if(!gs(t,e,n))throw new EF(n,EA(t,e,n));return n}function ert(...t){let[e,n,r]=Gi.Match(t,{3:(s,o,a)=>[s,o,a],2:(s,o)=>[{},s,o]});if(gs(e,n,r))return r;if(Lc.Get().correctiveParse)return MCe(e,n,r);throw new EF(r,EA(e,n,r))}var EF,MCe,_xn=v(()=>{p();u4();Yl();dF();ad();uF();hF();Zf();gF();t8();Kte();EF=class extends HI{constructor(e,n){super("Parse",e,n)}};MCe=AF([(t,e,n)=>xa(n),(t,e,n)=>Zx(t,e,n),(t,e,n)=>nE(t,e,n),(t,e,n)=>bA(t,e,n),(t,e,n)=>zTi(t,e,n)])});var trt=v(()=>{p();_xn()});function OCe(t,e){return{type:"update",path:t,value:e}}function Sxn(t,e){return{type:"insert",path:t,value:e}}function Cxn(t){return{type:"delete",path:t}}function xxn(t){if(!(L.IsObject(t)&&L.IsEqual(L.Symbols(t).length,0)))throw new Error("Cannot create diffs for objects with symbols keys")}function*KTi(t,e,n){if(!L.IsObject(n)||L.IsArray(n))return yield OCe(t,n);xxn(e),xxn(n);let r=L.Keys(e),i=L.Keys(n);for(let s of i)L.HasPropertyKey(e,s)||L.IsUnsafePropertyKey(s)||(yield Sxn(`${t}/${s}`,n[s]));for(let s of r)L.HasPropertyKey(n,s)&&(L.IsUnsafePropertyKey(s)||ene(e,n)||(yield*LCe(`${t}/${s}`,e[s],n[s])));for(let s of r)L.HasPropertyKey(n,s)||L.IsUnsafePropertyKey(s)||(yield Cxn(`${t}/${s}`))}function*JTi(t,e,n){if(!L.IsArray(n))return yield OCe(t,n);for(let r=0;r=0;r--)r{p();ft();DCe()});var wxn,Txn,vxn,evi,Rxn=v(()=>{p();ki();wxn=Kr({type:us("insert"),path:Wm(),value:Vl()}),Txn=Object({type:us("update"),path:Wm(),value:Vl()}),vxn=Kr({type:us("delete"),path:Wm()}),evi=Ri([wxn,Txn,vxn])});var FCe=v(()=>{p();yCe()});function tvi(t){return t.length>0&&t[0].path===""&&t[0].type==="update"}function nvi(t){return t.length===0}function rrt(t,e){if(tvi(e))return xa(e[0].value);if(nvi(e))return xa(t);let n=xa(t);for(let r of e)switch(r.type){case"insert":{Jx.Set(n,r.path,r.value);break}case"update":{Jx.Set(n,r.path,r.value);break}case"delete":{Jx.Delete(n,r.path);break}}return n}var kxn=v(()=>{p();Zf();FCe()});var irt=v(()=>{p();Ixn();Rxn();kxn()});var sR,QCe=v(()=>{p();sR=class extends Error{constructor(e,n,r,i){super(i),this.context=e,this.type=n,this.value=r}}});function rvi(t){let[e,n]=[new Set,[]];for(let r of t){let i=tne(r);e.has(i)||(e.add(i),n.push(r))}return n}function Bxn(t,e,n){if(gs(t,e,n))return n;let r=L.IsArray(n)?n:ku(t,e),i=Zv(e)&&r.lengthku(t,e))]:r,o=(sF(e)&&i.length>e.maxItems?i.slice(0,e.maxItems):i).map(c=>Bu(t,e.items,c));if(!$I(e)||$I(e)&&!L.IsEqual(e.uniqueItems,!0))return o;let a=rvi(o);if(!gs(t,e,a))throw new sR(t,e,n,"Failed to repair Array due to uniqueItems constraint");return a}var Nxn=v(()=>{p();da();ft();ad();YI();PCe();tS();QCe()});function Dxn(t,e,n){return Bu(t,od(e),n)}var Pxn=v(()=>{p();ki();tS()});function Mxn(t,e,n){let r=gA(t,e),i=od(r);return Bu(t,i,n)}var Oxn=v(()=>{p();ki();tS()});function Lxn(t,e,n){if(gs(t,e,n))return n;if(!L.IsObjectNotArray(n))return ku(t,e);let r=new Set(L.IsUndefined(e.required)?[]:e.required),i={};for(let[o,a]of L.Entries(e.properties))!r.has(o)&&L.IsUndefined(n[o])||(i[o]=o in n?Bu(t,a,n[o]):ku(t,a));let s=L.Keys(e.properties);if(AA(e)&&L.IsObject(e.additionalProperties))for(let o of L.Keys(n))s.includes(o)||(i[o]=Bu(t,e.additionalProperties,n[o]));return i}var Fxn=v(()=>{p();ft();ad();YI();da();tS()});function Qxn(t,e,n){if(gs(t,e,n))return n;if(L.IsNull(n)||!L.IsObject(n)||L.IsArray(n))return ku(t,e);let r=new RegExp(vu(e)),i=_a(e),s=new Set,o={};for(let[a,c]of L.Entries(n))r.test(a)&&(o[a]=Bu(t,i,c),s.add(a));if(AA(e))for(let a of L.Keys(n))s.has(a)||(o[a]=Bu(t,e.additionalProperties,n[a]));return o}var Uxn=v(()=>{p();da();ki();ft();YI();ad();tS()});function Gxn(t,e,n){return L.HasPropertyKey(t,e.$ref)?Bu(t,t[e.$ref],n):(()=>{throw new sR(t,e,n,"Unable to de-reference target type")})()}var $xn=v(()=>{p();ft();tS();QCe()});function Wxn(t,e,n){let r=Q2(e.pattern);return Bu(t,r,n)}var Hxn=v(()=>{p();wSe();tS()});function qxn(t,e,n){return gs(t,e,n)?n:L.IsArray(n)?e.items.map((r,i)=>Bu(t,r,n[i])):ku(t,e)}var jxn=v(()=>{p();ft();ad();YI();tS()});function Vxn(t,e,n){return uo(e)?L.HasPropertyKey(t,e.$ref)?Vxn(t,t[e.$ref],n):(()=>{throw new Error("Unable to Deref target")})():e}function ivi(t,e,n){if(!(Jr(e)&&L.IsObject(n)))return 0;let r=L.Keys(n);return L.Entries(e.properties).reduce((s,[o,a])=>{let c=hs(a)&&L.IsEqual(a.const,n[o])?100:0,u=gs(t,a,n[o])?10:0,l=r.includes(o)?1:0;return s+(c+u+l)},0)}function srt(t,e,n){let r=e.anyOf.map(o=>Vxn(t,o,n)),[i,s]=[r[0],0];for(let o of r){let a=ivi(t,o,n);a>s&&(i=o,s=a)}return i}var ort=v(()=>{p();ki();ft();ad()});function svi(t,e,n){let r=Ri(Wv(e.anyOf)),i=srt(t,r,n);return Bu(t,i,n)}function Yxn(t,e,n){return gs(t,e,n)?xa(n):yA(e)?ku(t,e):svi(t,e,n)}var zxn=v(()=>{p();da();ki();P4();ad();Zf();YI();tS();ort()});function Kxn(t,e,n){if(gs(t,e,n))return n;let r=nE(t,e,n);return gs(t,e,r)?r:ku(t,e)}var Jxn=v(()=>{p();ad();YI();gF()});function ovi(t,e,n){if(Cu.IsDate(n)||Cu.IsMap(n)||Cu.IsSet(n)||Cu.IsTypeArray(n)||L.IsConstructor(n)||L.IsFunction(n))throw new sR(t,e,n,"Value is not repairable")}function avi(t,e,n){if(el(e)||tl(e)||Qh(e))throw new sR(t,e,n,"Type is not repairable")}function cvi(t,e,n){return L.IsUndefined(n)&&!Yy(e)?ku(t,e):n}function lvi(t,e,n){return h4(e)?gs(t,e,n)?n:ku(t,e):n}function Bu(t,e,n){ovi(t,e,n),avi(t,e,n);let r=cvi(t,e,n),i=xs(e)?Bxn(t,e,r):rl(e)?Dxn(t,e,r):Vr(e)?Mxn(t,e,r):Jr(e)?Lxn(t,e,r):Do(e)?Qxn(t,e,r):uo(e)?Gxn(t,e,r):ua(e)?Wxn(t,e,r):rs(e)?qxn(t,e,r):On(e)?Yxn(t,e,r):Kxn(t,e,r);return lvi(t,e,i)}var tS=v(()=>{p();ft();ki();ad();YI();Nxn();Pxn();Oxn();Fxn();Uxn();$xn();Hxn();jxn();zxn();Jxn();QCe()});function art(...t){let[e,n,r]=Gi.Match(t,{3:(s,o,a)=>[s,o,a],2:(s,o)=>[{},s,o]}),i=Bu(e,n,r);return Vte(e,n,i),i}var Xxn=v(()=>{p();Yl();tS();dF()});var crt=v(()=>{p();Xxn()});var Zxn=v(()=>{p();kCe();zte();ort()});var bF={};br(bF,{Assert:()=>Vte,Check:()=>gs,Clean:()=>bA,Clone:()=>xa,Convert:()=>nE,Create:()=>ku,Decode:()=>Jte,Default:()=>Zx,Diff:()=>nrt,Encode:()=>Xte,Equal:()=>ene,Errors:()=>EA,HasCodec:()=>Zte,Hash:()=>tne,Parse:()=>ert,Patch:()=>rrt,Pointer:()=>Jx,Repair:()=>art});var lrt=v(()=>{p();dF();ad();hF();Zf();Znt();gF();YI();t8();DCe();uF();PCe();trt();irt();FCe();crt()});var UCe={};br(UCe,{Assert:()=>Vte,AssertError:()=>HI,Check:()=>gs,Clean:()=>bA,Clone:()=>xa,Convert:()=>nE,Create:()=>ku,CreateError:()=>rE,Decode:()=>Jte,DecodeError:()=>BCe,DecodeUnsafe:()=>b_n,Default:()=>Zx,Delete:()=>vxn,Diff:()=>nrt,Edit:()=>evi,Encode:()=>Xte,EncodeError:()=>NCe,EncodeUnsafe:()=>x_n,Equal:()=>ene,Errors:()=>EA,HasCodec:()=>Zte,Hash:()=>tne,Insert:()=>wxn,IsOptionalUndefined:()=>e8,Parse:()=>ert,ParseError:()=>EF,Parser:()=>MCe,Patch:()=>rrt,Pipeline:()=>AF,Pointer:()=>Jx,Repair:()=>art,UnionPrioritySort:()=>mF,UnionScoreSelect:()=>srt,Update:()=>Txn,Value:()=>bF,default:()=>uvi});var uvi,GCe=v(()=>{p();dF();ad();hF();Zf();Znt();gF();YI();uF();t8();DCe();PCe();trt();irt();Kte();FCe();crt();Zxn();lrt();lrt();uvi=bF});var n8,$Ce=v(()=>{p();NI();GCe();Z4();n8=class{constructor(e,n){this.hasCodec=Zte(e,n),this.buildResult=jte(e,n),this.evaluateResult=this.buildResult.Evaluate()}IsAccelerated(){return this.evaluateResult.IsAccelerated()}Context(){return this.buildResult.Context()}Type(){return this.buildResult.Schema()}Code(){return this.evaluateResult.Code()}Check(e){return this.evaluateResult.Check(e)}Parse(e){if(this.Check(e))return e;if(Lc.Get().correctiveParse)return MCe(this.Context(),this.Type(),e);throw new EF(e,this.Errors(e))}Errors(e){return this.IsAccelerated()&&this.Check(e)?[]:EA(this.Context(),this.Type(),e)}Clean(e){return bA(this.Context(),this.Type(),e)}Convert(e){return nE(this.Context(),this.Type(),e)}Create(){return ku(this.Context(),this.Type())}Default(e){return Zx(this.Context(),this.Type(),e)}Decode(e){return this.hasCodec?Jte(this.Context(),this.Type(),e):this.Parse(e)}Encode(e){return this.hasCodec?Xte(this.Context(),this.Type(),e):this.Parse(e)}}});function oR(...t){let[e,n]=Gi.Match(t,{2:(r,i)=>[r,i],1:r=>[{},r]});return new n8(e,n)}var urt=v(()=>{p();Yl();$Ce()});var WCe={};br(WCe,{Code:()=>E0n,Compile:()=>oR,Validator:()=>n8,default:()=>dvi});var dvi,nne=v(()=>{p();qnt();urt();$Ce();qnt();urt();$Ce();dvi=oR});function mvi(t){return typeof t.type=="string"?[t.type]:Array.isArray(t.type)?t.type.filter(e=>typeof e=="string"):[]}function hvi(t,e){switch(e){case"number":return typeof t=="number";case"integer":return typeof t=="number"&&Number.isInteger(t);case"boolean":return typeof t=="boolean";case"string":return typeof t=="string";case"null":return t===null;case"array":return Array.isArray(t);case"object":return typeof t=="object"&&t!==null&&!Array.isArray(t);default:return!1}}function drt(t){try{return nSn(t)}catch{return}}function fvi(t,e){switch(e){case"number":{if(t===null)return 0;if(typeof t=="string"&&t.trim()!==""){let n=Number(t);if(Number.isFinite(n))return n}return typeof t=="boolean"?t?1:0:t}case"integer":{if(t===null)return 0;if(typeof t=="string"&&t.trim()!==""){let n=Number(t);if(Number.isInteger(n))return n}return typeof t=="boolean"?t?1:0:t}case"boolean":{if(t===null)return!1;if(typeof t=="string"){if(t==="true")return!0;if(t==="false")return!1}if(typeof t=="number"){if(t===1)return!0;if(t===0)return!1}return t}case"string":return t===null?"":typeof t=="number"||typeof t=="boolean"?String(t):t;case"null":return t===""||t===0||t===!1?null:t;default:return t}}function gvi(t,e){let n=e.properties,r=new Set(n?Object.keys(n):[]);if(n)for(let[i,s]of Object.entries(n))i in t&&(t[i]=_F(t[i],s));if(e.additionalProperties&&typeof e.additionalProperties=="object")for(let[i,s]of Object.entries(t))r.has(i)||(t[i]=_F(s,e.additionalProperties))}function Avi(t,e){if(Array.isArray(e.items)){for(let n=0;n1&&r.some(s=>hvi(n,s));if(r.length>0&&!i)for(let s of r){let o=fvi(n,s);if(o!==n){n=o;break}}return r.includes("object")&&typeof n=="object"&&n!==null&&!Array.isArray(n)&&gvi(n,e),r.includes("array")&&Array.isArray(n)&&Avi(n,e),n}function HCe(t,e){if(Array.isArray(t)){if(Array.isArray(e.items))for(let i=0;ir.name===e.name);if(!n)throw new Error(`Tool "${e.name}" not found`);return xF(n,e)}function xF(t,e){let n=structuredClone(e.arguments);HCe(n,t.parameters),bF.Convert(t.parameters,n);let r=nSn(t.parameters);if(!Object.getOwnPropertySymbols(t.parameters).includes(pvi)){let o=_F(n,t.parameters);if(o!==n)if(typeof n=="object"&&n!==null&&typeof o=="object"&&o!==null){for(let a of Object.keys(n))delete n[a];Object.assign(n,o)}else return r.Check(o)?o:n}if(r.Check(n))return n;let i=r.Errors(n).map(o=>` - ${yvi(o)}: ${o.message}`).join(` +`)||"Unknown validation error",s=`Validation failed for tool "${e.name}": +${i} + +Received arguments: +${JSON.stringify(e.arguments,null,2)}`;throw new Error(s)}var eSn,pvi,rSn=v(()=>{p();nne();GCe();eSn=new WeakMap,pvi=Symbol.for("TypeBox.Kind")});var qo=v(()=>{p();Vm();Sy();aAe();lAe();Ls();$fn();RSe();ni();f3e();Let();ZKe();Xfn();Zfn();qO();eA();tv();tgn();rgn();Cy();Nf();ign();kN();rSn()});var iSn,sSn,oSn,aSn,cSn,lSn,uSn,dSn,bvi,_vi,xvi,Svi,Cvi,Ivi,wvi,Tvi,vvi,Rvi,kvi,Bvi,Nvi,Dvi,Pvi,Mvi,pSn=v(()=>{p();Uf();PX();n4();kZ();BZ();PZ();ba();kx();iSn=rc(),sSn=t2(),oSn=Fv(),aSn=_2(),cSn=x2(),lSn=C2(),uSn=qr(),dSn=ip(),bvi=iSn.stream,_vi=iSn.streamSimple,xvi=sSn.stream,Svi=sSn.streamSimple,Cvi=oSn.stream,Ivi=oSn.streamSimple,wvi=aSn.stream,Tvi=aSn.streamSimple,vvi=cSn.stream,Rvi=cSn.streamSimple,kvi=lSn.stream,Bvi=lSn.streamSimple,Nvi=uSn.stream,Dvi=uSn.streamSimple,Pvi=dSn.stream,Mvi=dSn.streamSimple});var hSn,mSn=v(()=>{hSn={"bedrock-converse-stream":{"amazon.nova-2-lite-v1:0":{id:"amazon.nova-2-lite-v1:0",name:"Nova 2 Lite",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.33,output:2.75,cacheRead:.0825,cacheWrite:.33},contextWindow:1e6,maxTokens:65535,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"amazon.nova-lite-v1:0":{id:"amazon.nova-lite-v1:0",name:"Nova Lite",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.06,output:.24,cacheRead:.015,cacheWrite:.06},contextWindow:3e5,maxTokens:1e4,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"amazon.nova-micro-v1:0":{id:"amazon.nova-micro-v1:0",name:"Nova Micro",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.035,output:.14,cacheRead:.00875,cacheWrite:.035},contextWindow:128e3,maxTokens:1e4},"amazon.nova-pro-v1:0":{id:"amazon.nova-pro-v1:0",name:"Nova Pro",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.8,output:3.2,cacheRead:.2,cacheWrite:.8},contextWindow:3e5,maxTokens:1e4,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-fable-5":{id:"anthropic.claude-fable-5",name:"Claude Fable 5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-fable-5-1":{id:"anthropic.claude-fable-5-1",name:"Claude Fable 5.1",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-haiku-4-5-20251001-v1:0":{id:"anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-opus-4-1-20250805-v1:0":{id:"anthropic.claude-opus-4-1-20250805-v1:0",name:"Claude Opus 4.1",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75},contextWindow:2e5,maxTokens:32e3,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-opus-4-5-20251101-v1:0":{id:"anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-opus-4-6-v1":{id:"anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-opus-4-7":{id:"anthropic.claude-opus-4-7",name:"Claude Opus 4.7",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-opus-4-8":{id:"anthropic.claude-opus-4-8",name:"Claude Opus 4.8",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-opus-5-5":{id:"anthropic.claude-opus-5-5",name:"Claude Opus 5.5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.2,cacheWrite:5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-sonnet-4-5-20250929-v1:0":{id:"anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-sonnet-4-6":{id:"anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3.3,output:16.5,cacheRead:.33,cacheWrite:4.125},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic.claude-sonnet-5":{id:"anthropic.claude-sonnet-5",name:"Claude Sonnet 5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"apac.amazon.nova-lite-v1:0":{id:"apac.amazon.nova-lite-v1:0",name:"Nova Lite (APAC)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.063,output:.252,cacheRead:.01575,cacheWrite:.063},contextWindow:3e5,maxTokens:1e4,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"apac.amazon.nova-micro-v1:0":{id:"apac.amazon.nova-micro-v1:0",name:"Nova Micro (APAC)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.037,output:.148,cacheRead:.00925,cacheWrite:.037},contextWindow:128e3,maxTokens:1e4},"apac.amazon.nova-pro-v1:0":{id:"apac.amazon.nova-pro-v1:0",name:"Nova Pro (APAC)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.84,output:3.36,cacheRead:.21,cacheWrite:.84},contextWindow:3e5,maxTokens:1e4,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"apac.anthropic.claude-sonnet-4-20250514-v1:0":{id:"apac.anthropic.claude-sonnet-4-20250514-v1:0",name:"Claude Sonnet 4 (APAC)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"au.anthropic.claude-haiku-4-5-20251001-v1:0":{id:"au.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (AU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:1.1,output:5.5,cacheRead:.11,cacheWrite:1.375},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"au.anthropic.claude-opus-4-6-v1":{id:"au.anthropic.claude-opus-4-6-v1",name:"AU Anthropic Claude Opus 4.6",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"au.anthropic.claude-opus-4-7":{id:"au.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (AU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"au.anthropic.claude-opus-4-8":{id:"au.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (AU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"au.anthropic.claude-opus-5":{id:"au.anthropic.claude-opus-5",name:"Claude Opus 5 (AU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"au.anthropic.claude-opus-5-5":{id:"au.anthropic.claude-opus-5-5",name:"Claude Opus 5.5 (AU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:4.4,output:22,cacheRead:.22,cacheWrite:5.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"au.anthropic.claude-sonnet-4-5-20250929-v1:0":{id:"au.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (AU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3.3,output:16.5,cacheRead:.33,cacheWrite:4.125},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"au.anthropic.claude-sonnet-4-6":{id:"au.anthropic.claude-sonnet-4-6",name:"AU Anthropic Claude Sonnet 4.6",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3.3,output:16.5,cacheRead:.33,cacheWrite:4.125},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"au.anthropic.claude-sonnet-5":{id:"au.anthropic.claude-sonnet-5",name:"Claude Sonnet 5 (AU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2.2,output:11,cacheRead:.22,cacheWrite:2.75},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"ca.amazon.nova-lite-v1:0":{id:"ca.amazon.nova-lite-v1:0",name:"Nova Lite (CA)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.064,output:.256,cacheRead:.016,cacheWrite:.064},contextWindow:3e5,maxTokens:1e4,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"deepseek.v3-v1:0":{id:"deepseek.v3-v1:0",name:"DeepSeek-V3.1",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.58,output:1.68,cacheRead:0,cacheWrite:0},contextWindow:163840,maxTokens:81920,compat:{supportsStrictMode:!0}},"deepseek.v3.2":{id:"deepseek.v3.2",name:"DeepSeek V3.2",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.62,output:1.85,cacheRead:0,cacheWrite:0},contextWindow:163840,maxTokens:81920,compat:{supportsStrictMode:!0}},"eu.amazon.nova-2-lite-v1:0":{id:"eu.amazon.nova-2-lite-v1:0",name:"Nova 2 Lite (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.374,output:3.157,cacheRead:.0935,cacheWrite:.374},contextWindow:1e6,maxTokens:65535,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.amazon.nova-lite-v1:0":{id:"eu.amazon.nova-lite-v1:0",name:"Nova Lite (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.069,output:.276,cacheRead:.01725,cacheWrite:.069},contextWindow:3e5,maxTokens:1e4,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.amazon.nova-micro-v1:0":{id:"eu.amazon.nova-micro-v1:0",name:"Nova Micro (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.04,output:.16,cacheRead:.01,cacheWrite:.04},contextWindow:128e3,maxTokens:1e4},"eu.amazon.nova-pro-v1:0":{id:"eu.amazon.nova-pro-v1:0",name:"Nova Pro (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.92,output:3.68,cacheRead:.23,cacheWrite:.92},contextWindow:3e5,maxTokens:1e4,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-fable-5":{id:"eu.anthropic.claude-fable-5",name:"Claude Fable 5 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:11,output:55,cacheRead:1.1,cacheWrite:13.75},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-haiku-4-5-20251001-v1:0":{id:"eu.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:1.1,output:5.5,cacheRead:.11,cacheWrite:1.375},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-opus-4-5-20251101-v1:0":{id:"eu.anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-opus-4-6-v1":{id:"eu.anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-opus-4-7":{id:"eu.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-opus-4-8":{id:"eu.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-opus-5":{id:"eu.anthropic.claude-opus-5",name:"Claude Opus 5 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-opus-5-5":{id:"eu.anthropic.claude-opus-5-5",name:"Claude Opus 5.5 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:4.4,output:22,cacheRead:.22,cacheWrite:5.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-sonnet-4-20250514-v1:0":{id:"eu.anthropic.claude-sonnet-4-20250514-v1:0",name:"Claude Sonnet 4 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-sonnet-4-5-20250929-v1:0":{id:"eu.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3.3,output:16.5,cacheRead:.33,cacheWrite:4.125},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-sonnet-4-6":{id:"eu.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3.3,output:16.5,cacheRead:.33,cacheWrite:4.125},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.anthropic.claude-sonnet-5":{id:"eu.anthropic.claude-sonnet-5",name:"Claude Sonnet 5 (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2.2,output:11,cacheRead:.22,cacheWrite:2.75},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"eu.mistral.pixtral-large-2502-v1:0":{id:"eu.mistral.pixtral-large-2502-v1:0",name:"Pixtral Large (25.02) (EU)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.eu-central-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:2,output:6,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.amazon.nova-2-lite-v1:0":{id:"global.amazon.nova-2-lite-v1:0",name:"Nova 2 Lite (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.3,output:2.5,cacheRead:.075,cacheWrite:.3},contextWindow:1e6,maxTokens:65535,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-fable-5":{id:"global.anthropic.claude-fable-5",name:"Claude Fable 5 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-fable-5-1":{id:"global.anthropic.claude-fable-5-1",name:"Claude Fable 5.1 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-haiku-4-5-20251001-v1:0":{id:"global.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-opus-4-5-20251101-v1:0":{id:"global.anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-opus-4-6-v1":{id:"global.anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-opus-4-7":{id:"global.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-opus-4-8":{id:"global.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-opus-5":{id:"global.anthropic.claude-opus-5",name:"Claude Opus 5 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-opus-5-5":{id:"global.anthropic.claude-opus-5-5",name:"Claude Opus 5.5 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.2,cacheWrite:5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-sonnet-4-20250514-v1:0":{id:"global.anthropic.claude-sonnet-4-20250514-v1:0",name:"Claude Sonnet 4 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-sonnet-4-5-20250929-v1:0":{id:"global.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-sonnet-4-6":{id:"global.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.anthropic.claude-sonnet-5":{id:"global.anthropic.claude-sonnet-5",name:"Claude Sonnet 5 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.openai.gpt-5.6-luna":{id:"global.openai.gpt-5.6-luna",name:"GPT-5.6 Luna (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25},contextWindow:105e4,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.openai.gpt-5.6-sol":{id:"global.openai.gpt-5.6-sol",name:"GPT-5.6 Sol (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.4,cacheWrite:5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.openai.gpt-5.6-terra":{id:"global.openai.gpt-5.6-terra",name:"GPT-5.6 Terra (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.openai.gpt-6-astra":{id:"global.openai.gpt-6-astra",name:"GPT-6 Astra (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:105e4,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"global.xai.grok-4.6":{id:"global.xai.grok-4.6",name:"Grok 4.6 (Global)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0},contextWindow:5e5,maxTokens:5e5,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google.gemma-4-26b-a4b":{id:"google.gemma-4-26b-a4b",name:"Gemma 4 26B A4B IT",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.13,output:.4,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google.gemma-4-31b":{id:"google.gemma-4-31b",name:"Gemma 4 31B IT",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.14,output:.4,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google.gemma-4-e2b":{id:"google.gemma-4-e2b",name:"Gemma 4 E2B IT",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.04,output:.08,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:8192,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"in.openai.gpt-5.6-luna":{id:"in.openai.gpt-5.6-luna",name:"GPT-5.6 Luna (India)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.22,output:1.32,cacheRead:.022,cacheWrite:.275},contextWindow:105e4,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"in.openai.gpt-5.6-terra":{id:"in.openai.gpt-5.6-terra",name:"GPT-5.6 Terra (India)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2.2,output:13.2,cacheRead:.22,cacheWrite:2.75},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"jp.amazon.nova-2-lite-v1:0":{id:"jp.amazon.nova-2-lite-v1:0",name:"Nova 2 Lite (JP)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.396,output:3.311,cacheRead:.099,cacheWrite:.396},contextWindow:1e6,maxTokens:65535,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"jp.anthropic.claude-haiku-4-5-20251001-v1:0":{id:"jp.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (JP)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:1.1,output:5.5,cacheRead:.11,cacheWrite:1.375},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"jp.anthropic.claude-opus-4-7":{id:"jp.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (JP)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"jp.anthropic.claude-opus-4-8":{id:"jp.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (JP)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"jp.anthropic.claude-opus-5":{id:"jp.anthropic.claude-opus-5",name:"Claude Opus 5 (JP)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"jp.anthropic.claude-opus-5-5":{id:"jp.anthropic.claude-opus-5-5",name:"Claude Opus 5.5 (JP)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:4.4,output:22,cacheRead:.22,cacheWrite:5.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"jp.anthropic.claude-sonnet-4-5-20250929-v1:0":{id:"jp.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (JP)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3.3,output:16.5,cacheRead:.33,cacheWrite:4.125},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"jp.anthropic.claude-sonnet-4-6":{id:"jp.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (JP)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3.3,output:16.5,cacheRead:.33,cacheWrite:4.125},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"jp.anthropic.claude-sonnet-5":{id:"jp.anthropic.claude-sonnet-5",name:"Claude Sonnet 5 (JP)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2.2,output:11,cacheRead:.22,cacheWrite:2.75},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta.llama3-1-70b-instruct-v1:0":{id:"meta.llama3-1-70b-instruct-v1:0",name:"Llama 3.1 70B Instruct",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.72,output:.72,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096},"meta.llama3-1-8b-instruct-v1:0":{id:"meta.llama3-1-8b-instruct-v1:0",name:"Llama 3.1 8B Instruct",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.22,output:.22,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096},"meta.llama3-3-70b-instruct-v1:0":{id:"meta.llama3-3-70b-instruct-v1:0",name:"Llama 3.3 70B Instruct",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.72,output:.72,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096},"meta.llama4-maverick-17b-instruct-v1:0":{id:"meta.llama4-maverick-17b-instruct-v1:0",name:"Llama 4 Maverick 17B Instruct",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.24,output:.97,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:8192,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta.llama4-scout-17b-instruct-v1:0":{id:"meta.llama4-scout-17b-instruct-v1:0",name:"Llama 4 Scout 17B Instruct",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.17,output:.66,cacheRead:0,cacheWrite:0},contextWindow:1e7,maxTokens:8192,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"minimax.minimax-m2":{id:"minimax.minimax-m2",name:"MiniMax-M2",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:0,cacheWrite:0},contextWindow:204608,maxTokens:128e3,compat:{supportsStrictMode:!0}},"minimax.minimax-m2.1":{id:"minimax.minimax-m2.1",name:"MiniMax-M2.1",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:0,cacheWrite:0},contextWindow:204800,maxTokens:131072,compat:{supportsStrictMode:!0}},"minimax.minimax-m2.5":{id:"minimax.minimax-m2.5",name:"MiniMax-M2.5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:0,cacheWrite:0},contextWindow:196608,maxTokens:98304,compat:{supportsStrictMode:!0}},"mistral.devstral-2-123b":{id:"mistral.devstral-2-123b",name:"Devstral 2 123B",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.4,output:2,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:8192,compat:{supportsStrictMode:!0}},"mistral.magistral-small-2509":{id:"mistral.magistral-small-2509",name:"Magistral Small 1.2",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.5,output:1.5,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4e4,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral.ministral-3-14b-instruct":{id:"mistral.ministral-3-14b-instruct",name:"Ministral 14B 3.0",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.2,output:.2,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral.ministral-3-3b-instruct":{id:"mistral.ministral-3-3b-instruct",name:"Ministral 3 3B",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.1,output:.1,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:8192,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral.ministral-3-8b-instruct":{id:"mistral.ministral-3-8b-instruct",name:"Ministral 3 8B",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.15,output:.15,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral.mistral-large-3-675b-instruct":{id:"mistral.mistral-large-3-675b-instruct",name:"Mistral Large 3",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.5,output:1.5,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:8192,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral.pixtral-large-2502-v1:0":{id:"mistral.pixtral-large-2502-v1:0",name:"Pixtral Large (25.02)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:2,output:6,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral.voxtral-mini-3b-2507":{id:"mistral.voxtral-mini-3b-2507",name:"Voxtral Mini 3B 2507",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.04,output:.04,cacheRead:0,cacheWrite:0},contextWindow:32768,maxTokens:4096,compat:{supportsStrictMode:!0}},"mistral.voxtral-small-24b-2507":{id:"mistral.voxtral-small-24b-2507",name:"Voxtral Small 24B 2507",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.1,output:.3,cacheRead:0,cacheWrite:0},contextWindow:32768,maxTokens:8192,compat:{supportsStrictMode:!0}},"moonshot.kimi-k2-thinking":{id:"moonshot.kimi-k2-thinking",name:"Kimi K2 Thinking",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.6,output:2.5,cacheRead:0,cacheWrite:0},contextWindow:262143,maxTokens:16e3,compat:{supportsStrictMode:!0}},"moonshotai.kimi-k2.5":{id:"moonshotai.kimi-k2.5",name:"Kimi K2.5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.6,output:3,cacheRead:0,cacheWrite:0},contextWindow:262143,maxTokens:16384,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia.nemotron-nano-12b-v2":{id:"nvidia.nemotron-nano-12b-v2",name:"NVIDIA Nemotron Nano 12B v2 VL BF16",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.2,output:.6,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia.nemotron-nano-3-30b":{id:"nvidia.nemotron-nano-3-30b",name:"NVIDIA Nemotron Nano 3 30B",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.06,output:.24,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:8192,compat:{supportsStrictMode:!0}},"nvidia.nemotron-nano-9b-v2":{id:"nvidia.nemotron-nano-9b-v2",name:"NVIDIA Nemotron Nano 9B v2",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.06,output:.23,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:8192,compat:{supportsStrictMode:!0}},"nvidia.nemotron-super-3-120b":{id:"nvidia.nemotron-super-3-120b",name:"NVIDIA Nemotron 3 Super 120B A12B",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.15,output:.65,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:131072,compat:{supportsStrictMode:!0}},"openai.gpt-5.4":{id:"openai.gpt-5.4",name:"GPT-5.4",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2.75,output:16.5,cacheRead:.275,cacheWrite:0},contextWindow:272e3,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai.gpt-5.5":{id:"openai.gpt-5.5",name:"GPT-5.5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:33,cacheRead:.55,cacheWrite:0},contextWindow:272e3,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai.gpt-5.6-luna":{id:"openai.gpt-5.6-luna",name:"GPT-5.6 Luna",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.22,output:1.32,cacheRead:.022,cacheWrite:.275},contextWindow:105e4,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai.gpt-5.6-sol":{id:"openai.gpt-5.6-sol",name:"GPT-5.6 Sol",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:4.4,output:22,cacheRead:.44,cacheWrite:5.5},contextWindow:105e4,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai.gpt-5.6-terra":{id:"openai.gpt-5.6-terra",name:"GPT-5.6 Terra",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2.2,output:13.2,cacheRead:.22,cacheWrite:2.75},contextWindow:105e4,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai.gpt-6-astra":{id:"openai.gpt-6-astra",name:"GPT-6 Astra",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:11,output:55,cacheRead:1.1,cacheWrite:13.75},contextWindow:105e4,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai.gpt-oss-120b":{id:"openai.gpt-oss-120b",name:"gpt-oss-120b",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.15,output:.6,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0}},"openai.gpt-oss-120b-1:0":{id:"openai.gpt-oss-120b-1:0",name:"gpt-oss-120b",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.15,output:.6,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0}},"openai.gpt-oss-20b":{id:"openai.gpt-oss-20b",name:"gpt-oss-20b",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.07,output:.3,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0}},"openai.gpt-oss-20b-1:0":{id:"openai.gpt-oss-20b-1:0",name:"gpt-oss-20b",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.07,output:.3,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0}},"openai.gpt-oss-safeguard-120b":{id:"openai.gpt-oss-safeguard-120b",name:"GPT OSS Safeguard 120B",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.15,output:.6,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0}},"openai.gpt-oss-safeguard-20b":{id:"openai.gpt-oss-safeguard-20b",name:"GPT OSS Safeguard 20B",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.07,output:.2,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0}},"qwen.qwen3-235b-a22b-2507-v1:0":{id:"qwen.qwen3-235b-a22b-2507-v1:0",name:"Qwen3 235B-A22B Instruct 2507",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.22,output:.88,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:131072,compat:{supportsStrictMode:!0}},"qwen.qwen3-32b-v1:0":{id:"qwen.qwen3-32b-v1:0",name:"Qwen3 32B",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.15,output:.6,cacheRead:0,cacheWrite:0},contextWindow:32768,maxTokens:16384,compat:{supportsStrictMode:!0}},"qwen.qwen3-coder-30b-a3b-v1:0":{id:"qwen.qwen3-coder-30b-a3b-v1:0",name:"Qwen3-Coder 30B-A3B Instruct",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.15,output:.6,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:131072,compat:{supportsStrictMode:!0}},"qwen.qwen3-coder-480b-a35b-v1:0":{id:"qwen.qwen3-coder-480b-a35b-v1:0",name:"Qwen3-Coder 480B-A35B Instruct",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.45,output:1.8,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:65536,compat:{supportsStrictMode:!0}},"qwen.qwen3-coder-next":{id:"qwen.qwen3-coder-next",name:"Qwen3 Coder Next",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.5,output:1.2,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:65536,compat:{supportsStrictMode:!0}},"qwen.qwen3-next-80b-a3b":{id:"qwen.qwen3-next-80b-a3b",name:"Qwen3-Next 80B-A3B Instruct",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.15,output:1.2,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:262e3,compat:{supportsStrictMode:!0}},"qwen.qwen3-vl-235b-a22b":{id:"qwen.qwen3-vl-235b-a22b",name:"Qwen3 VL 235B A22B Instruct",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.53,output:2.66,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:262e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us-gov.openai.gpt-oss-120b-1:0":{id:"us-gov.openai.gpt-oss-120b-1:0",name:"gpt-oss-120b (GovCloud)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.18,output:.72,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0}},"us-gov.openai.gpt-oss-20b-1:0":{id:"us-gov.openai.gpt-oss-20b-1:0",name:"gpt-oss-20b (GovCloud)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.084,output:.36,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0}},"us.amazon.nova-2-lite-v1:0":{id:"us.amazon.nova-2-lite-v1:0",name:"Nova 2 Lite (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.33,output:2.75,cacheRead:.0825,cacheWrite:.33},contextWindow:1e6,maxTokens:65535,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.amazon.nova-lite-v1:0":{id:"us.amazon.nova-lite-v1:0",name:"Nova Lite (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.06,output:.24,cacheRead:.015,cacheWrite:.06},contextWindow:3e5,maxTokens:1e4,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.amazon.nova-micro-v1:0":{id:"us.amazon.nova-micro-v1:0",name:"Nova Micro (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.035,output:.14,cacheRead:.00875,cacheWrite:.035},contextWindow:128e3,maxTokens:1e4},"us.amazon.nova-premier-v1:0":{id:"us.amazon.nova-premier-v1:0",name:"Nova Premier (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:2.5,output:12.5,cacheRead:.625,cacheWrite:2.5},contextWindow:1e6,maxTokens:1e4,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.amazon.nova-pro-v1:0":{id:"us.amazon.nova-pro-v1:0",name:"Nova Pro (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.8,output:3.2,cacheRead:.2,cacheWrite:.8},contextWindow:3e5,maxTokens:1e4,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-fable-5":{id:"us.anthropic.claude-fable-5",name:"Claude Fable 5 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:11,output:55,cacheRead:1.1,cacheWrite:13.75},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-fable-5-1":{id:"us.anthropic.claude-fable-5-1",name:"Claude Fable 5.1 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:11,output:55,cacheRead:.275,cacheWrite:13.75},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-haiku-4-5-20251001-v1:0":{id:"us.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:1.1,output:5.5,cacheRead:.11,cacheWrite:1.375},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-opus-4-1-20250805-v1:0":{id:"us.anthropic.claude-opus-4-1-20250805-v1:0",name:"Claude Opus 4.1 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75},contextWindow:2e5,maxTokens:32e3,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-opus-4-5-20251101-v1:0":{id:"us.anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-opus-4-6-v1":{id:"us.anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-opus-4-7":{id:"us.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-opus-4-8":{id:"us.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-opus-5":{id:"us.anthropic.claude-opus-5",name:"Claude Opus 5 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:5.5,output:27.5,cacheRead:.55,cacheWrite:6.875},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-opus-5-5":{id:"us.anthropic.claude-opus-5-5",name:"Claude Opus 5.5 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:4.4,output:22,cacheRead:.22,cacheWrite:5.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-sonnet-4-20250514-v1:0":{id:"us.anthropic.claude-sonnet-4-20250514-v1:0",name:"Claude Sonnet 4 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-sonnet-4-5-20250929-v1:0":{id:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3.3,output:16.5,cacheRead:.33,cacheWrite:4.125},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-sonnet-4-6":{id:"us.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:3.3,output:16.5,cacheRead:.33,cacheWrite:4.125},contextWindow:1e6,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.anthropic.claude-sonnet-5":{id:"us.anthropic.claude-sonnet-5",name:"Claude Sonnet 5 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2.2,output:11,cacheRead:.22,cacheWrite:2.75},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.meta.llama3-1-70b-instruct-v1:0":{id:"us.meta.llama3-1-70b-instruct-v1:0",name:"Llama 3.1 70B Instruct (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.72,output:.72,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096},"us.meta.llama3-1-8b-instruct-v1:0":{id:"us.meta.llama3-1-8b-instruct-v1:0",name:"Llama 3.1 8B Instruct (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.22,output:.22,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096},"us.meta.llama3-3-70b-instruct-v1:0":{id:"us.meta.llama3-3-70b-instruct-v1:0",name:"Llama 3.3 70B Instruct (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text"],cost:{input:.72,output:.72,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096},"us.meta.llama4-maverick-17b-instruct-v1:0":{id:"us.meta.llama4-maverick-17b-instruct-v1:0",name:"Llama 4 Maverick 17B Instruct (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.24,output:.97,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:8192,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.meta.llama4-scout-17b-instruct-v1:0":{id:"us.meta.llama4-scout-17b-instruct-v1:0",name:"Llama 4 Scout 17B Instruct (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:.17,output:.66,cacheRead:0,cacheWrite:0},contextWindow:1e7,maxTokens:8192,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.mistral.pixtral-large-2502-v1:0":{id:"us.mistral.pixtral-large-2502-v1:0",name:"Pixtral Large (25.02) (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!1,input:["text","image"],cost:{input:2,output:6,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.openai.gpt-5.6-luna":{id:"us.openai.gpt-5.6-luna",name:"GPT-5.6 Luna (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:.22,output:1.32,cacheRead:.022,cacheWrite:.275},contextWindow:105e4,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.openai.gpt-5.6-sol":{id:"us.openai.gpt-5.6-sol",name:"GPT-5.6 Sol (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:4.4,output:22,cacheRead:.44,cacheWrite:5.5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.openai.gpt-5.6-terra":{id:"us.openai.gpt-5.6-terra",name:"GPT-5.6 Terra (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2.2,output:13.2,cacheRead:.22,cacheWrite:2.75},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.openai.gpt-6-astra":{id:"us.openai.gpt-6-astra",name:"GPT-6 Astra (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:11,output:55,cacheRead:1.1,cacheWrite:13.75},contextWindow:105e4,maxTokens:128e3,compat:{supportsStrictMode:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"us.writer.palmyra-x4-v1:0":{id:"us.writer.palmyra-x4-v1:0",name:"Palmyra X4 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0},contextWindow:122880,maxTokens:8192},"us.writer.palmyra-x5-v1:0":{id:"us.writer.palmyra-x5-v1:0",name:"Palmyra X5 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.6,output:6,cacheRead:0,cacheWrite:0},contextWindow:104e4,maxTokens:8192},"us.xai.grok-4.6":{id:"us.xai.grok-4.6",name:"Grok 4.6 (US)",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2.2,output:6.6,cacheRead:.55,cacheWrite:0},contextWindow:5e5,maxTokens:5e5,inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"writer.palmyra-x4-v1:0":{id:"writer.palmyra-x4-v1:0",name:"Palmyra X4",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0},contextWindow:122880,maxTokens:8192},"writer.palmyra-x5-v1:0":{id:"writer.palmyra-x5-v1:0",name:"Palmyra X5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.6,output:6,cacheRead:0,cacheWrite:0},contextWindow:104e4,maxTokens:8192},"xai.grok-4.3":{id:"xai.grok-4.3",name:"Grok 4.3",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0},contextWindow:1e6,maxTokens:131072,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"xai.grok-4.6":{id:"xai.grok-4.6",name:"Grok 4.6",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text","image"],cost:{input:2.2,output:6.6,cacheRead:.55,cacheWrite:0},contextWindow:5e5,maxTokens:5e5,compat:{supportsStrictMode:!0},inputLimits:{images:{maxPerMessage:20,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai.glm-4.7":{id:"zai.glm-4.7",name:"GLM-4.7",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.6,output:2.2,cacheRead:0,cacheWrite:0},contextWindow:204800,maxTokens:131072,compat:{supportsStrictMode:!0}},"zai.glm-4.7-flash":{id:"zai.glm-4.7-flash",name:"GLM-4.7-Flash",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:.07,output:.4,cacheRead:0,cacheWrite:0},contextWindow:2e5,maxTokens:131072,compat:{supportsStrictMode:!0}},"zai.glm-5":{id:"zai.glm-5",name:"GLM-5",api:"bedrock-converse-stream",provider:"amazon-bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",reasoning:!0,input:["text"],cost:{input:1,output:3.2,cacheRead:0,cacheWrite:0},contextWindow:202752,maxTokens:131072,compat:{supportsStrictMode:!0}}}}});function Qn(t,e){return Object.assign({},...Object.values(e))}var Ts=v(()=>{p()});var qCe,prt=v(()=>{p();mSn();Ts();qCe=Qn("amazon-bedrock",hSn)});var gSn,fSn=v(()=>{gSn={"openai-completions":{"Ling-2.6-1T":{id:"Ling-2.6-1T",name:"Ling 2.6 1T",api:"openai-completions",baseUrl:"https://api.ant-ling.com/v1",provider:"ant-ling",reasoning:!1,input:["text"],cost:{input:.06,output:.25,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:65536,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"ant-ling",supportsStrictMode:!0,supportsLongCacheRetention:!1}},"Ling-2.6-flash":{id:"Ling-2.6-flash",name:"Ling 2.6 Flash",api:"openai-completions",baseUrl:"https://api.ant-ling.com/v1",provider:"ant-ling",reasoning:!1,input:["text"],cost:{input:.01,output:.02,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:65536,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"ant-ling",supportsStrictMode:!0,supportsLongCacheRetention:!1}},"Ring-2.6-1T":{id:"Ring-2.6-1T",name:"Ring 2.6 1T",api:"openai-completions",baseUrl:"https://api.ant-ling.com/v1",provider:"ant-ling",reasoning:!0,input:["text"],cost:{input:.06,output:.25,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:65536,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"ant-ling",supportsStrictMode:!0,supportsLongCacheRetention:!1},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:"xhigh"}}}}});var jCe,mrt=v(()=>{p();fSn();Ts();jCe=Qn("ant-ling",gSn)});var ySn,ASn=v(()=>{ySn={"anthropic-messages":{"claude-fable-5":{id:"claude-fable-5",name:"Claude Fable 5",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoSystemMessages:!0,supportsMidConvoToolChanges:!0,forceAdaptiveThinking:!0,supportsStrictTools:!0,allowedFallbackModels:[{provider:"anthropic",model:"claude-opus-4-8",cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25}},{provider:"anthropic",model:"claude-opus-5",cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25}}]},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-fable-5-1":{id:"claude-fable-5-1",name:"Claude Fable 5.1",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoEffort:!0,supportsMidConvoSystemMessages:!0,supportsMidConvoToolChanges:!0,forceAdaptiveThinking:!0,supportsStrictTools:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-haiku-4-5":{id:"claude-haiku-4-5",name:"Claude Haiku 4.5 (latest)",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:100,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-haiku-4-5-20251001":{id:"claude-haiku-4-5-20251001",name:"Claude Haiku 4.5",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:100,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-5":{id:"claude-opus-4-5",name:"Claude Opus 4.5 (latest)",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:100,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-5-20251101":{id:"claude-opus-4-5-20251101",name:"Claude Opus 4.5",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:2e5,maxTokens:64e3,compat:{supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:100,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-6":{id:"claude-opus-4-6",name:"Claude Opus 4.6",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{max:"max"},compat:{forceAdaptiveThinking:!0,supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-7":{id:"claude-opus-4-7",name:"Claude Opus 4.7",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},compat:{forceAdaptiveThinking:!0,supportsTemperature:!1,supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-8":{id:"claude-opus-4-8",name:"Claude Opus 4.8",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoSystemMessages:!0,supportsMidConvoToolChanges:!0,forceAdaptiveThinking:!0,supportsTemperature:!1,supportsStrictTools:!0},thinkingLevelMap:{xhigh:"xhigh",max:"max"},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-5":{id:"claude-opus-5",name:"Claude Opus 5",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoEffort:!0,supportsMidConvoSystemMessages:!0,supportsMidConvoToolChanges:!0,forceAdaptiveThinking:!0,supportsTemperature:!1,supportsStrictTools:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-5-5":{id:"claude-opus-5-5",name:"Claude Opus 5.5",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.2,cacheWrite:5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsMidConvoEffort:!0,supportsMidConvoSystemMessages:!0,supportsMidConvoToolChanges:!0,forceAdaptiveThinking:!0,supportsTemperature:!1,supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-4-5":{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5 (latest)",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:64e3,compat:{supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-4-5-20250929":{id:"claude-sonnet-4-5-20250929",name:"Claude Sonnet 4.5",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:64e3,compat:{supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-4-6":{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{max:"max"},compat:{forceAdaptiveThinking:!0,supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-5":{id:"claude-sonnet-5",name:"Claude Sonnet 5",api:"anthropic-messages",provider:"anthropic",baseUrl:"https://api.anthropic.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},compat:{forceAdaptiveThinking:!0,supportsStrictTools:!0},promptCache:{short:300,long:3600},inputLimits:{maxRequestBytes:33554432,images:{maxPerRequest:600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var VCe,hrt=v(()=>{p();ASn();Ts();VCe=Qn("anthropic",ySn)});var bSn,ESn=v(()=>{bSn={"azure-openai-responses":{"gpt-4":{id:"gpt-4",name:"GPT-4",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text"],cost:{input:30,output:60,cacheRead:0,cacheWrite:0},contextWindow:8192,maxTokens:8192},"gpt-4-turbo":{id:"gpt-4-turbo",name:"GPT-4 Turbo",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:10,output:30,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4.1":{id:"gpt-4.1",name:"GPT-4.1",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:1047576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4.1-mini":{id:"gpt-4.1-mini",name:"GPT-4.1 mini",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:.4,output:1.6,cacheRead:.1,cacheWrite:0},contextWindow:1047576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4.1-nano":{id:"gpt-4.1-nano",name:"GPT-4.1 nano",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:.1,output:.4,cacheRead:.025,cacheWrite:0},contextWindow:1047576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o":{id:"gpt-4o",name:"GPT-4o",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0},contextWindow:128e3,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o-2024-05-13":{id:"gpt-4o-2024-05-13",name:"GPT-4o (2024-05-13)",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:5,output:15,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o-2024-08-06":{id:"gpt-4o-2024-08-06",name:"GPT-4o (2024-08-06)",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0},contextWindow:128e3,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o-2024-11-20":{id:"gpt-4o-2024-11-20",name:"GPT-4o (2024-11-20)",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0},contextWindow:128e3,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o-mini":{id:"gpt-4o-mini",name:"GPT-4o mini",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:.15,output:.6,cacheRead:.075,cacheWrite:0},contextWindow:128e3,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5":{id:"gpt-5",name:"GPT-5",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-chat-latest":{id:"gpt-5-chat-latest",name:"GPT-5 Chat Latest",api:"azure-openai-responses",baseUrl:"",provider:"azure-openai-responses",reasoning:!1,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:128e3,maxTokens:16384,thinkingLevelMap:{off:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-mini":{id:"gpt-5-mini",name:"GPT-5 Mini",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.25,output:2,cacheRead:.025,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-nano":{id:"gpt-5-nano",name:"GPT-5 Nano",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.05,output:.4,cacheRead:.005,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-pro":{id:"gpt-5-pro",name:"GPT-5 Pro",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:15,output:120,cacheRead:0,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.1":{id:"gpt-5.1",name:"GPT-5.1",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.2":{id:"gpt-5.2",name:"GPT-5.2",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.2-chat-latest":{id:"gpt-5.2-chat-latest",name:"GPT-5.2 Chat",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:128e3,maxTokens:16384,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.2-pro":{id:"gpt-5.2-pro",name:"GPT-5.2 Pro",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:21,output:168,cacheRead:0,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.3-chat-latest":{id:"gpt-5.3-chat-latest",name:"GPT-5.3 Chat (latest)",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:128e3,maxTokens:16384,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.3-codex":{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.3-codex-spark":{id:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:128e3,maxTokens:32e3,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4":{id:"gpt-5.4",name:"GPT-5.4",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT-5.4 mini",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-nano":{id:"gpt-5.4-nano",name:"GPT-5.4 nano",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-pro":{id:"gpt-5.4-pro",name:"GPT-5.4 Pro",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:30,output:180,cacheRead:0,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.5-pro":{id:"gpt-5.5-pro",name:"GPT-5.5 Pro",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:30,output:180,cacheRead:0,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",minimal:null,low:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.4,cacheWrite:5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-luna":{id:"gpt-6-luna",name:"GPT-6 Luna",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-sol":{id:"gpt-6-sol",name:"GPT-6 Sol",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-realtime-2.1":{id:"gpt-realtime-2.1",name:"GPT-Realtime-2.1",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:4,output:24,cacheRead:.4,cacheWrite:0},contextWindow:128e3,maxTokens:32e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},o1:{id:"o1",name:"o1",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"o1-pro":{id:"o1-pro",name:"o1-pro",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:150,output:600,cacheRead:0,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},o3:{id:"o3",name:"o3",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"o3-mini":{id:"o3-mini",name:"o3-mini",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text"],cost:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0},contextWindow:2e5,maxTokens:1e5},"o3-pro":{id:"o3-pro",name:"o3-pro",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:20,output:80,cacheRead:0,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"o4-mini":{id:"o4-mini",name:"o4-mini",api:"azure-openai-responses",provider:"azure-openai-responses",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.1,output:4.4,cacheRead:.275,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var YCe,frt=v(()=>{p();ESn();Ts();YCe=Qn("azure-openai-responses",bSn)});var xSn,_Sn=v(()=>{xSn={"openai-completions":{"deepseek-ai/DeepSeek-V4-Flash-0731":{id:"deepseek-ai/DeepSeek-V4-Flash-0731",name:"DeepSeek V4 Flash 0731",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text"],cost:{input:.13,output:.26,cacheRead:.028,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:1048576,maxTokens:384e3},"deepseek-ai/DeepSeek-V4-Pro":{id:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text"],cost:{input:1.74,output:3.48,cacheRead:.145,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:1048576,maxTokens:262144},"deepseek-ai/DeepSeek-V4-Pro-0813":{id:"deepseek-ai/DeepSeek-V4-Pro-0813",name:"DeepSeek V4 Pro 0813",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:1.32,output:3.96,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:1048576,maxTokens:262144},"deepseek-ai/DeepSeek-V4.1-Flash":{id:"deepseek-ai/DeepSeek-V4.1-Flash",name:"DeepSeek V4.1 Flash",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.03,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:1048576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/Kimi-K2.5":{id:"moonshotai/Kimi-K2.5",name:"Kimi K2.5",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"off",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.6,output:3,cacheRead:.12,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"baseten",chatTemplateArgs:{enable_thinking:{$var:"thinking.enabled"}}},contextWindow:262e3,maxTokens:262e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/Kimi-K2.6":{id:"moonshotai/Kimi-K2.6",name:"Kimi K2.6",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"off",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"baseten",chatTemplateArgs:{enable_thinking:{$var:"thinking.enabled"}}},contextWindow:262e3,maxTokens:262e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/Kimi-K2.7-Code":{id:"moonshotai/Kimi-K2.7-Code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"off",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"baseten",chatTemplateArgs:{enable_thinking:{$var:"thinking.enabled"}}},contextWindow:262e3,maxTokens:262e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/Kimi-K3":{id:"moonshotai/Kimi-K3",name:"Kimi K3",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:3,output:15,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:1048576,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B":{id:"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B",name:"Nemotron Ultra",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"off",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text"],cost:{input:.6,output:2.4,cacheRead:.12,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"baseten",chatTemplateArgs:{enable_thinking:{$var:"thinking.enabled"}}},contextWindow:202800,maxTokens:202800},"nvidia/Nemotron-120B-A12B":{id:"nvidia/Nemotron-120B-A12B",name:"Nemotron Super",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"off",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text"],cost:{input:.3,output:.75,cacheRead:.06,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"baseten",chatTemplateArgs:{enable_thinking:{$var:"thinking.enabled"}}},contextWindow:202800,maxTokens:202800},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"OpenAI GPT 120B",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text"],cost:{input:.1,output:.5,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:128072,maxTokens:128072},"thinkingmachines/inkling":{id:"thinkingmachines/inkling",name:"Inkling",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:1,output:4.05,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:1048576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"thinkingmachines/inkling-small":{id:"thinkingmachines/inkling-small",name:"Inkling Small",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.5,output:1.2,cacheRead:.1,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:1048576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai-org/GLM-4.7":{id:"zai-org/GLM-4.7",name:"GLM 4.7",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"off",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text"],cost:{input:.6,output:2.2,cacheRead:.12,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"baseten",chatTemplateArgs:{enable_thinking:{$var:"thinking.enabled"}}},contextWindow:2e5,maxTokens:2e5},"zai-org/GLM-5":{id:"zai-org/GLM-5",name:"GLM 5",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"off",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text"],cost:{input:.95,output:3.15,cacheRead:.2,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"baseten",chatTemplateArgs:{enable_thinking:{$var:"thinking.enabled"}}},contextWindow:202800,maxTokens:202800},"zai-org/GLM-5.1":{id:"zai-org/GLM-5.1",name:"GLM 5.1",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"off",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text"],cost:{input:1.3,output:4.3,cacheRead:.26,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"baseten",chatTemplateArgs:{enable_thinking:{$var:"thinking.enabled"}}},contextWindow:202800,maxTokens:202800},"zai-org/GLM-5.2":{id:"zai-org/GLM-5.2",name:"GLM 5.2",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:1.4,output:4.4,cacheRead:.3,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"baseten",chatTemplateArgs:{enable_thinking:{$var:"thinking.enabled"}}},contextWindow:1048576,maxTokens:262144},"zai-org/GLM-5.2-Fast":{id:"zai-org/GLM-5.2-Fast",name:"GLM 5.2 Fast",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:2.1,output:6.6,cacheRead:.21,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"baseten",chatTemplateArgs:{enable_thinking:{$var:"thinking.enabled"}}},contextWindow:1048576,maxTokens:262144},"zai-org/GLM-5.3":{id:"zai-org/GLM-5.3",name:"GLM 5.3",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:1.4,output:4.4,cacheRead:.14,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:1048576,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai-org/GLM-5.3-Fast":{id:"zai-org/GLM-5.3-Fast",name:"GLM 5.3 Fast",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:2.1,output:6.6,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:1048576,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai-org/GLM-5.3-Flash":{id:"zai-org/GLM-5.3-Flash",name:"GLM 5.3 Flash",api:"openai-completions",provider:"baseten",baseUrl:"https://inference.baseten.co/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.15,output:.5,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,supportsUsageInStreaming:!0,maxTokensField:"max_tokens",sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,thinkingFormat:"openai"},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var zCe,grt=v(()=>{p();_Sn();Ts();zCe=Qn("baseten",xSn)});var CSn,SSn=v(()=>{CSn={"openai-completions":{"gpt-oss-120b":{id:"gpt-oss-120b",name:"GPT OSS 120B",api:"openai-completions",provider:"cerebras",baseUrl:"https://api.cerebras.ai/v1",reasoning:!0,input:["text"],cost:{input:.35,output:.75,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:40960,compat:{supportsStore:!1,supportsDeveloperRole:!1},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"qwen-3.8-27b":{id:"qwen-3.8-27b",name:"Qwen3.8 27B",api:"openai-completions",provider:"cerebras",baseUrl:"https://api.cerebras.ai/v1",reasoning:!0,input:["text","image"],cost:{input:.99,output:1.49,cacheRead:0,cacheWrite:0},contextWindow:65536,maxTokens:32768,compat:{supportsStore:!1,supportsDeveloperRole:!1},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var KCe,Art=v(()=>{p();SSn();Ts();KCe=Qn("cerebras",CSn)});var wSn,ISn=v(()=>{wSn={"anthropic-messages":{"claude-fable-5":{id:"claude-fable-5",name:"Claude Fable 5",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,compat:{sendSessionAffinityHeaders:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-fable-5.1":{id:"claude-fable-5.1",name:"Claude Fable 5.1",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,compat:{sendSessionAffinityHeaders:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-haiku-4.5":{id:"claude-haiku-4.5",name:"Claude Haiku 4.5 (latest)",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:2e5,maxTokens:64e3,compat:{sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4.5":{id:"claude-opus-4.5",name:"Claude Opus 4.5 (latest)",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:2e5,maxTokens:64e3,compat:{sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4.6":{id:"claude-opus-4.6",name:"Claude Opus 4.6",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{sendSessionAffinityHeaders:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4.7":{id:"claude-opus-4.7",name:"Claude Opus 4.7",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{sendSessionAffinityHeaders:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4.8":{id:"claude-opus-4.8",name:"Claude Opus 4.8",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{sendSessionAffinityHeaders:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-5":{id:"claude-opus-5",name:"Claude Opus 5",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{sendSessionAffinityHeaders:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-4.5":{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5 (latest)",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:64e3,compat:{sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-4.6":{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:128e3,compat:{sendSessionAffinityHeaders:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-5":{id:"claude-sonnet-5",name:"Claude Sonnet 5",api:"anthropic-messages",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128e3,compat:{sendSessionAffinityHeaders:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}},"openai-completions":{"workers-ai/@cf/deepseek-ai/deepseek-v4-flash-0731":{id:"workers-ai/@cf/deepseek-ai/deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text"],cost:{input:.44,output:1.32,cacheRead:.014,cacheWrite:0},contextWindow:1310720,maxTokens:1048576,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",max:"max"}},"workers-ai/@cf/deepseek-ai/deepseek-v4-pro-0813":{id:"workers-ai/@cf/deepseek-ai/deepseek-v4-pro-0813",name:"DeepSeek V4 Pro 0813",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text"],cost:{input:1.32,output:3.96,cacheRead:.044,cacheWrite:0},contextWindow:1048576,maxTokens:1048576,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",max:"max"}},"workers-ai/@cf/google/gemma-4-26b-a4b-it":{id:"workers-ai/@cf/google/gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text","image"],cost:{input:.1,output:.3,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:16384,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"workers-ai/@cf/ibm-granite/granite-4.0-h-micro":{id:"workers-ai/@cf/ibm-granite/granite-4.0-h-micro",name:"Granite 4.0 H Micro",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!1,input:["text"],cost:{input:.017,output:.112,cacheRead:0,cacheWrite:0},contextWindow:131e3,maxTokens:131e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast":{id:"workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast",name:"Llama 3.3 70B Instruct fp8 Fast",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!1,input:["text"],cost:{input:.293,output:2.253,cacheRead:0,cacheWrite:0},contextWindow:24e3,maxTokens:24e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct":{id:"workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout 17B 16E Instruct",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!1,input:["text","image"],cost:{input:.27,output:.85,cacheRead:0,cacheWrite:0},contextWindow:131e3,maxTokens:16384,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct":{id:"workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct",name:"Mistral Small 3.1 24B Instruct",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!1,input:["text"],cost:{input:.351,output:.555,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"workers-ai/@cf/moonshotai/kimi-k2.6":{id:"workers-ai/@cf/moonshotai/kimi-k2.6",name:"Kimi K2.6",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},contextWindow:262144,maxTokens:256e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"workers-ai/@cf/moonshotai/kimi-k2.7-code":{id:"workers-ai/@cf/moonshotai/kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},contextWindow:262144,maxTokens:262144,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"workers-ai/@cf/nvidia/nemotron-3-120b-a12b":{id:"workers-ai/@cf/nvidia/nemotron-3-120b-a12b",name:"Nemotron 3 Super 120B",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text"],cost:{input:.5,output:1.5,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"workers-ai/@cf/openai/gpt-oss-120b":{id:"workers-ai/@cf/openai/gpt-oss-120b",name:"GPT OSS 120B",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text"],cost:{input:.35,output:.75,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"workers-ai/@cf/openai/gpt-oss-20b":{id:"workers-ai/@cf/openai/gpt-oss-20b",name:"GPT OSS 20B",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text"],cost:{input:.2,output:.3,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"workers-ai/@cf/qwen/qwen3-30b-a3b-fp8":{id:"workers-ai/@cf/qwen/qwen3-30b-a3b-fp8",name:"Qwen3 30B A3b fp8",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text"],cost:{input:.0509,output:.335,cacheRead:0,cacheWrite:0},contextWindow:32768,maxTokens:32768,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"workers-ai/@cf/qwen/qwen3.8-27b":{id:"workers-ai/@cf/qwen/qwen3.8-27b",name:"Qwen3.8 27B",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text","image"],cost:{input:.45,output:3.2,cacheRead:.05,cacheWrite:0},contextWindow:262144,maxTokens:262144,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"workers-ai/@cf/zai-org/glm-4.7-flash":{id:"workers-ai/@cf/zai-org/glm-4.7-flash",name:"GLM-4.7-Flash",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text"],cost:{input:.0605,output:.4,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:131072,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"workers-ai/@cf/zai-org/glm-5.2":{id:"workers-ai/@cf/zai-org/glm-5.2",name:"Glm 5.2",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},contextWindow:262144,maxTokens:256e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"workers-ai/@cf/zai-org/glm-5.3":{id:"workers-ai/@cf/zai-org/glm-5.3",name:"Glm 5.3",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},contextWindow:1310720,maxTokens:1048576,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"workers-ai/@cf/zai-org/glm-5.3-flash":{id:"workers-ai/@cf/zai-org/glm-5.3-flash",name:"Glm 5.3 Flash",api:"openai-completions",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat",reasoning:!0,input:["text","image"],cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},contextWindow:1310720,maxTokens:1048576,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}},"openai-responses":{"gpt-4.1":{id:"gpt-4.1",name:"GPT-4.1",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!1,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{supportsStrictMode:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4.1-mini":{id:"gpt-4.1-mini",name:"GPT-4.1 mini",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!1,input:["text","image"],cost:{input:.4,output:1.6,cacheRead:.1,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{supportsStrictMode:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4.1-nano":{id:"gpt-4.1-nano",name:"GPT-4.1 nano",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!1,input:["text","image"],cost:{input:.1,output:.4,cacheRead:.025,cacheWrite:0},contextWindow:1e6,maxTokens:32768,compat:{supportsStrictMode:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o":{id:"gpt-4o",name:"GPT-4o",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!1,input:["text","image"],cost:{input:1.25,output:5,cacheRead:.625,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o-mini":{id:"gpt-4o-mini",name:"GPT-4o mini",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!1,input:["text","image"],cost:{input:.075,output:.3,cacheRead:.0375,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5":{id:"gpt-5",name:"GPT-5",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-mini":{id:"gpt-5-mini",name:"GPT-5 Mini",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:.25,output:2,cacheRead:.025,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-nano":{id:"gpt-5-nano",name:"GPT-5 Nano",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:.05,output:.4,cacheRead:.005,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.1":{id:"gpt-5.1",name:"GPT-5.1",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4":{id:"gpt-5.4",name:"GPT-5.4",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT-5.4 mini",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-nano":{id:"gpt-5.4-nano",name:"GPT-5.4 nano",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-pro":{id:"gpt-5.4-pro",name:"GPT-5.4 Pro",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:30,output:180,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:5,output:30,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.5-pro":{id:"gpt-5.5-pro",name:"GPT-5.5 Pro",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:30,output:180,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25,tiers:[{inputTokensAbove:272e3,input:.4,output:1.8,cacheRead:.04,cacheWrite:.5}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.4,cacheWrite:5,tiers:[{inputTokensAbove:272e3,input:8,output:30,cacheRead:.8,cacheWrite:10}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:18,cacheRead:.4,cacheWrite:5}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5,tiers:[{inputTokensAbove:272e3,input:20,output:75,cacheRead:2,cacheWrite:25}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},o3:{id:"o3",name:"o3",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"o3-mini":{id:"o3-mini",name:"o3-mini",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text"],cost:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0}},"o4-mini":{id:"o4-mini",name:"o4-mini",api:"openai-responses",provider:"cloudflare-ai-gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai",reasoning:!0,input:["text","image"],cost:{input:1.1,output:4.4,cacheRead:.275,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var JCe,yrt=v(()=>{p();ISn();Ts();JCe=Qn("cloudflare-ai-gateway",wSn)});var vSn,TSn=v(()=>{vSn={"openai-completions":{"@cf/deepseek-ai/deepseek-v4-flash-0731":{id:"@cf/deepseek-ai/deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text"],cost:{input:.44,output:1.32,cacheRead:.014,cacheWrite:0},contextWindow:1310720,maxTokens:1048576,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",max:"max"}},"@cf/deepseek-ai/deepseek-v4-pro-0813":{id:"@cf/deepseek-ai/deepseek-v4-pro-0813",name:"DeepSeek V4 Pro 0813",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text"],cost:{input:1.32,output:3.96,cacheRead:.044,cacheWrite:0},contextWindow:1048576,maxTokens:1048576,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",max:"max"}},"@cf/google/gemma-4-26b-a4b-it":{id:"@cf/google/gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text","image"],cost:{input:.1,output:.3,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:16384,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"@cf/ibm-granite/granite-4.0-h-micro":{id:"@cf/ibm-granite/granite-4.0-h-micro",name:"Granite 4.0 H Micro",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!1,input:["text"],cost:{input:.017,output:.112,cacheRead:0,cacheWrite:0},contextWindow:131e3,maxTokens:131e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"@cf/meta/llama-3.3-70b-instruct-fp8-fast":{id:"@cf/meta/llama-3.3-70b-instruct-fp8-fast",name:"Llama 3.3 70B Instruct fp8 Fast",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!1,input:["text"],cost:{input:.293,output:2.253,cacheRead:0,cacheWrite:0},contextWindow:24e3,maxTokens:24e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"@cf/meta/llama-4-scout-17b-16e-instruct":{id:"@cf/meta/llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout 17B 16E Instruct",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!1,input:["text","image"],cost:{input:.27,output:.85,cacheRead:0,cacheWrite:0},contextWindow:131e3,maxTokens:16384,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"@cf/mistralai/mistral-small-3.1-24b-instruct":{id:"@cf/mistralai/mistral-small-3.1-24b-instruct",name:"Mistral Small 3.1 24B Instruct",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!1,input:["text"],cost:{input:.351,output:.555,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"@cf/moonshotai/kimi-k2.6":{id:"@cf/moonshotai/kimi-k2.6",name:"Kimi K2.6",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},contextWindow:262144,maxTokens:256e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"@cf/moonshotai/kimi-k2.7-code":{id:"@cf/moonshotai/kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},contextWindow:262144,maxTokens:262144,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"@cf/nvidia/nemotron-3-120b-a12b":{id:"@cf/nvidia/nemotron-3-120b-a12b",name:"Nemotron 3 Super 120B",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text"],cost:{input:.5,output:1.5,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"@cf/openai/gpt-oss-120b":{id:"@cf/openai/gpt-oss-120b",name:"GPT OSS 120B",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text"],cost:{input:.35,output:.75,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"@cf/openai/gpt-oss-20b":{id:"@cf/openai/gpt-oss-20b",name:"GPT OSS 20B",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text"],cost:{input:.2,output:.3,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"@cf/qwen/qwen3-30b-a3b-fp8":{id:"@cf/qwen/qwen3-30b-a3b-fp8",name:"Qwen3 30B A3b fp8",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text"],cost:{input:.0509,output:.335,cacheRead:0,cacheWrite:0},contextWindow:32768,maxTokens:32768,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"@cf/qwen/qwen3.8-27b":{id:"@cf/qwen/qwen3.8-27b",name:"Qwen3.8 27B",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text","image"],cost:{input:.45,output:3.2,cacheRead:.05,cacheWrite:0},contextWindow:262144,maxTokens:262144,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"@cf/zai-org/glm-4.7-flash":{id:"@cf/zai-org/glm-4.7-flash",name:"GLM-4.7-Flash",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text"],cost:{input:.0605,output:.4,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:131072,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0}},"@cf/zai-org/glm-5.2":{id:"@cf/zai-org/glm-5.2",name:"Glm 5.2",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},contextWindow:262144,maxTokens:256e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"}},"@cf/zai-org/glm-5.3":{id:"@cf/zai-org/glm-5.3",name:"Glm 5.3",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},contextWindow:1310720,maxTokens:1048576,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"@cf/zai-org/glm-5.3-flash":{id:"@cf/zai-org/glm-5.3-flash",name:"Glm 5.3 Flash",api:"openai-completions",provider:"cloudflare-workers-ai",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",reasoning:!0,input:["text","image"],cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},contextWindow:1310720,maxTokens:1048576,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,supportsLongCacheRetention:!1,sendSessionAffinityHeaders:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var XCe,Ert=v(()=>{p();TSn();Ts();XCe=Qn("cloudflare-workers-ai",vSn)});var kSn,RSn=v(()=>{kSn={"openai-completions":{"deepseek-flash":{id:"deepseek-flash",name:"DeepSeek V4.1 Flash",api:"openai-completions",baseUrl:"https://api.deepseek.com",provider:"deepseek",reasoning:!0,thinkingLevelMap:{minimal:null,low:"low",medium:null,high:"high",max:"max"},input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.006,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,maxTokensField:"max_tokens",requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek",supportsStrictMode:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"deepseek-v4-pro":{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",api:"openai-completions",baseUrl:"https://api.deepseek.com",provider:"deepseek",reasoning:!0,input:["text"],cost:{input:1.32,output:3.96,cacheRead:.044,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,compat:{supportsStore:!1,supportsDeveloperRole:!1,maxTokensField:"max_tokens",requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek",supportsStrictMode:!0,supportsMidConvoSystemMessages:!0},thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",max:"max"}}}}});var ZCe,brt=v(()=>{p();RSn();Ts();ZCe=Qn("deepseek",kSn)});var NSn,BSn=v(()=>{NSn={"anthropic-messages":{"accounts/fireworks/models/deepseek-v4-flash-0731":{id:"accounts/fireworks/models/deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:.22,output:.66,cacheRead:.007,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"accounts/fireworks/models/deepseek-v4-flash-vision-exp":{id:"accounts/fireworks/models/deepseek-v4-flash-vision-exp",name:"DeepSeek V4 Flash Vision Exp",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:.22,output:.66,cacheRead:.007,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/models/deepseek-v4-pro":{id:"accounts/fireworks/models/deepseek-v4-pro",name:"DeepSeek V4 Pro",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:1.2,output:1.2,cacheRead:.6,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"}},"accounts/fireworks/models/deepseek-v4-pro-0813":{id:"accounts/fireworks/models/deepseek-v4-pro-0813",name:"DeepSeek V4 Pro 0813",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:1.32,output:3.96,cacheRead:.044,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"accounts/fireworks/models/deepseek-v4p1-flash":{id:"accounts/fireworks/models/deepseek-v4p1-flash",name:"DeepSeek V4.1 Flash",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:.22,output:.66,cacheRead:.007,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/models/gpt-oss-120b":{id:"accounts/fireworks/models/gpt-oss-120b",name:"GPT OSS 120B",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:.15,output:.6,cacheRead:.015,cacheWrite:0},contextWindow:131072,maxTokens:32768,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"accounts/fireworks/models/inkling":{id:"accounts/fireworks/models/inkling",name:"Inkling",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:1,output:4.05,cacheRead:.17,cacheWrite:0},contextWindow:1048576,maxTokens:1048576,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/models/kimi-k2p6":{id:"accounts/fireworks/models/kimi-k2p6",name:"Kimi K2.6",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},contextWindow:262e3,maxTokens:262e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/models/kimi-k2p7-code":{id:"accounts/fireworks/models/kimi-k2p7-code",name:"Kimi K2.7 Code",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},contextWindow:262e3,maxTokens:262e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/models/minimax-m2p7":{id:"accounts/fireworks/models/minimax-m2p7",name:"MiniMax-M2.7",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:1.2,output:1.2,cacheRead:.6,cacheWrite:0},contextWindow:196608,maxTokens:131072,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"accounts/fireworks/models/minimax-m3":{id:"accounts/fireworks/models/minimax-m3",name:"MiniMax-M3",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},contextWindow:512e3,maxTokens:512e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"accounts/fireworks/models/muse-glimmer-30b":{id:"accounts/fireworks/models/muse-glimmer-30b",name:"Muse Glimmer 30B",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:.35,output:1.5,cacheRead:.04,cacheWrite:0},contextWindow:131072,maxTokens:131072,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/models/nemotron-3-ultra-nvfp4":{id:"accounts/fireworks/models/nemotron-3-ultra-nvfp4",name:"Nemotron 3 Ultra 550B A55B",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:.6,output:2.4,cacheRead:.12,cacheWrite:0},contextWindow:262144,maxTokens:128e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1}},"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b":{id:"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b",name:"Nemotron 3.5 Lightning 30B A3B",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:.05,output:.2,cacheRead:.01,cacheWrite:0},contextWindow:262144,maxTokens:262144,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1}},"accounts/fireworks/models/qwen3p7-plus":{id:"accounts/fireworks/models/qwen3p7-plus",name:"Qwen 3.7 Plus",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:.4,output:1.6,cacheRead:.08,cacheWrite:0},contextWindow:262144,maxTokens:65536,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/models/qwen3p8-2p4t-a95b":{id:"accounts/fireworks/models/qwen3p8-2p4t-a95b",name:"Qwen3.8 2.4T A95B",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:2,output:6,cacheRead:.25,cacheWrite:0},contextWindow:262144,maxTokens:131072,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null}},"accounts/fireworks/models/qwen3p8-max":{id:"accounts/fireworks/models/qwen3p8-max",name:"Qwen3.8 Max",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.25,cacheWrite:0},contextWindow:262144,maxTokens:131072,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/routers/deepseek-flash-latest":{id:"accounts/fireworks/routers/deepseek-flash-latest",name:"DeepSeek Flash Latest",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:.22,output:.66,cacheRead:.007,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/routers/deepseek-pro-latest":{id:"accounts/fireworks/routers/deepseek-pro-latest",name:"DeepSeek Pro Latest",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:1.32,output:3.96,cacheRead:.044,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"}},"accounts/fireworks/routers/kimi-fast-latest":{id:"accounts/fireworks/routers/kimi-fast-latest",name:"Kimi Fast Latest",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:4.5,output:22.5,cacheRead:.45,cacheWrite:0},contextWindow:1048576,maxTokens:131072,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/routers/kimi-latest":{id:"accounts/fireworks/routers/kimi-latest",name:"Kimi Latest",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/routers/minimax-latest":{id:"accounts/fireworks/routers/minimax-latest",name:"MiniMax Latest",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},contextWindow:512e3,maxTokens:512e3,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"accounts/fireworks/routers/qwen-max-latest":{id:"accounts/fireworks/routers/qwen-max-latest",name:"Qwen Max Latest (Qwen3.8 Max)",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.25,cacheWrite:0},contextWindow:262144,maxTokens:131072,api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",compat:{allowEmptySignature:!0,sendSessionAffinityHeaders:!0,supportsEagerToolInputStreaming:!1,supportsCacheControlOnTools:!1,supportsLongCacheRetention:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}},"openai-completions":{"accounts/fireworks/models/glm-5p2":{id:"accounts/fireworks/models/glm-5p2",name:"GLM 5.2",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.14,cacheWrite:0},contextWindow:1048575,maxTokens:131072,api:"openai-completions",baseUrl:"https://api.fireworks.ai/inference/v1",compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1},thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"}},"accounts/fireworks/models/glm-5p3":{id:"accounts/fireworks/models/glm-5p3",name:"GLM 5.3",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},contextWindow:1048573,maxTokens:262144,api:"openai-completions",baseUrl:"https://api.fireworks.ai/inference/v1",compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"accounts/fireworks/models/glm-5p3-flash":{id:"accounts/fireworks/models/glm-5p3-flash",name:"GLM 5.3 Flash",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},contextWindow:1048573,maxTokens:131072,api:"openai-completions",baseUrl:"https://api.fireworks.ai/inference/v1",compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/models/kimi-k3":{id:"accounts/fireworks/models/kimi-k3",name:"Kimi K3",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,api:"openai-completions",baseUrl:"https://api.fireworks.ai/inference/v1",compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"openai",supportsMidConvoSystemMessages:!0,supportsMidConvoToolAdditions:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/routers/glm-5p2-fast":{id:"accounts/fireworks/routers/glm-5p2-fast",name:"GLM 5.2 Fast",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:2.1,output:6.6,cacheRead:.21,cacheWrite:0},contextWindow:1048575,maxTokens:131072,api:"openai-completions",baseUrl:"https://api.fireworks.ai/inference/v1",compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1},thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"}},"accounts/fireworks/routers/glm-5p3-fast":{id:"accounts/fireworks/routers/glm-5p3-fast",name:"GLM 5.3 Fast",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:2.1,output:6.6,cacheRead:.39,cacheWrite:0},contextWindow:1048572,maxTokens:262144,api:"openai-completions",baseUrl:"https://api.fireworks.ai/inference/v1",compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"accounts/fireworks/routers/glm-fast-latest":{id:"accounts/fireworks/routers/glm-fast-latest",name:"GLM 5.3 Fast (Latest)",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:2.1,output:6.6,cacheRead:.39,cacheWrite:0},contextWindow:1048572,maxTokens:262144,api:"openai-completions",baseUrl:"https://api.fireworks.ai/inference/v1",compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"accounts/fireworks/routers/glm-flash-latest":{id:"accounts/fireworks/routers/glm-flash-latest",name:"GLM Flash Latest (GLM 5.3 Flash)",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},contextWindow:1048573,maxTokens:131072,api:"openai-completions",baseUrl:"https://api.fireworks.ai/inference/v1",compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"accounts/fireworks/routers/glm-latest":{id:"accounts/fireworks/routers/glm-latest",name:"GLM Latest",provider:"fireworks",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},contextWindow:1048573,maxTokens:262144,api:"openai-completions",baseUrl:"https://api.fireworks.ai/inference/v1",compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"accounts/fireworks/routers/kimi-k3-fast":{id:"accounts/fireworks/routers/kimi-k3-fast",name:"Kimi K3 Fast",provider:"fireworks",reasoning:!0,input:["text","image"],cost:{input:4.5,output:22.5,cacheRead:.45,cacheWrite:0},contextWindow:1048576,maxTokens:131072,api:"openai-completions",baseUrl:"https://api.fireworks.ai/inference/v1",compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,sendSessionAffinityHeaders:!0,supportsLongCacheRetention:!1,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"openai",supportsMidConvoSystemMessages:!0,supportsMidConvoToolAdditions:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var eIe,_rt=v(()=>{p();BSn();Ts();eIe=Qn("fireworks",NSn)});var PSn,DSn=v(()=>{PSn={"anthropic-messages":{"claude-fable-5":{id:"claude-fable-5",name:"Claude Fable 5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-fable-5.1":{id:"claude-fable-5.1",name:"Claude Fable 5.1",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-haiku-4.5":{id:"claude-haiku-4.5",name:"Claude Haiku 4.5 (latest)",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:2e5,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsEagerToolInputStreaming:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4.7":{id:"claude-opus-4.7",name:"Claude Opus 4.7",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:32e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},compat:{forceAdaptiveThinking:!0,supportsTemperature:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4.8":{id:"claude-opus-4.8",name:"Claude Opus 4.8",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-5":{id:"claude-opus-5",name:"Claude Opus 5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-5.5":{id:"claude-opus-5.5",name:"Claude Opus 5.5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:4,output:20,cacheRead:.2,cacheWrite:5},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-4.6":{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:32e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{max:"max",minimal:"low"},compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-5":{id:"claude-sonnet-5",name:"Claude Sonnet 5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{xhigh:"xhigh",max:"max"},compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}},"openai-completions":{"gemini-3.5-flash":{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:1.5,output:9,cacheRead:.15,cacheWrite:0},contextWindow:2e5,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.6-flash":{id:"gemini-3.6-flash",name:"Gemini 3.6 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.7-flash":{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.8-flash":{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},contextWindow:256e3,maxTokens:32e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k3":{id:"kimi-k3",name:"Kimi K3",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}},"openai-responses":{"gpt-5-mini":{id:"gpt-5-mini",name:"GPT-5 Mini",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.25,output:2,cacheRead:.025,cacheWrite:0},contextWindow:264e3,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.3-codex":{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4":{id:"gpt-5.4",name:"GPT-5.4",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:5,output:22.5,cacheRead:.5,cacheWrite:0}]},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT-5.4 mini",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-nano":{id:"gpt-5.4-nano",name:"GPT-5.4 nano",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:10,output:45,cacheRead:1,cacheWrite:0}]},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25,tiers:[{inputTokensAbove:2e5,input:.4,output:1.8,cacheRead:.04,cacheWrite:.5}]},contextWindow:105e4,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.4,cacheWrite:5,tiers:[{inputTokensAbove:272e3,input:8,output:30,cacheRead:.8,cacheWrite:10}]},contextWindow:105e4,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:18,cacheRead:.4,cacheWrite:5}]},contextWindow:105e4,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5,tiers:[{inputTokensAbove:272e3,input:20,output:75,cacheRead:2,cacheWrite:25}]},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-luna":{id:"gpt-6-luna",name:"GPT-6 Luna",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125,tiers:[{inputTokensAbove:272e3,input:.2,output:.75,cacheRead:.02,cacheWrite:.25}]},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-sol":{id:"gpt-6-sol",name:"GPT-6 Sol",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:15,cacheRead:.4,cacheWrite:5}]},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-4.5":{id:"grok-4.5",name:"Grok 4.5",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:2e5,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:5e5,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-4.6":{id:"grok-4.6",name:"Grok 4.6",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:2e5,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:5e5,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-4.7":{id:"grok-4.7",name:"Grok 4.7",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:2e5,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:5e5,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mai-code-1-flash-picker":{id:"mai-code-1-flash-picker",name:"MAI-Code-1-Flash",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:256e3,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"mai-code-1.1-flash":{id:"mai-code-1.1-flash",name:"MAI-Code-1.1-Flash",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:0},contextWindow:256e3,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var tIe,xrt=v(()=>{p();DSn();Ts();tIe=Qn("github-copilot",PSn)});var OSn,MSn=v(()=>{OSn={"google-generative-ai":{"deep-research-max-preview-04-2026":{id:"deep-research-max-preview-04-2026",name:"Deep Research Max Preview (Apr-21-2026)",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:0},contextWindow:131072,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"deep-research-preview-04-2026":{id:"deep-research-preview-04-2026",name:"Deep Research Preview (Apr-21-2026)",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:0},contextWindow:131072,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-2.5-computer-use-preview-10-2025":{id:"gemini-2.5-computer-use-preview-10-2025",name:"Gemini 2.5 Computer Use Preview 10-2025",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-2.5-flash":{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,input:["text","image"],cost:{input:.3,output:2.5,cacheRead:.03,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-2.5-flash-lite":{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash-Lite",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,input:["text","image"],cost:{input:.1,output:.4,cacheRead:.01,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-2.5-pro":{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3-flash-preview":{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.5,output:3,cacheRead:.05,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.1-flash-lite":{id:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:1.5,cacheRead:.025,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.1-flash-lite-image":{id:"gemini-3.1-flash-lite-image",name:"Nano Banana 2 Lite",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:30,cacheRead:0,cacheWrite:0},contextWindow:65536,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.1-flash-lite-preview":{id:"gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:1.5,cacheRead:.025,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.1-flash-live-preview":{id:"gemini-3.1-flash-live-preview",name:"Gemini 3.1 Flash Live Preview",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:4.5,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.1-pro-preview":{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.1-pro-preview-customtools":{id:"gemini-3.1-pro-preview-customtools",name:"Gemini 3.1 Pro Preview Custom Tools",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.5-flash":{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.5,output:9,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.5-flash-lite":{id:"gemini-3.5-flash-lite",name:"Gemini 3.5 Flash Lite",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.3,output:2.5,cacheRead:.03,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.6-flash":{id:"gemini-3.6-flash",name:"Gemini 3.6 Flash",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.7-flash":{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.8-flash":{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-flash-latest":{id:"gemini-flash-latest",name:"Gemini Flash Latest",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.5,output:9,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-flash-lite-latest":{id:"gemini-flash-lite-latest",name:"Gemini Flash-Lite Latest",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:1.5,cacheRead:.025,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemma-4-26b-a4b-it":{id:"gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"MINIMAL",low:null,medium:null,high:"HIGH"},input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemma-4-31b-it":{id:"gemma-4-31b-it",name:"Gemma 4 31B IT",api:"google-generative-ai",provider:"google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",reasoning:!0,thinkingLevelMap:{off:null,minimal:"MINIMAL",low:null,medium:null,high:"HIGH"},input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,inputLimits:{maxRequestBytes:20971520,images:{maxPerRequest:3600,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var nIe,Srt=v(()=>{p();MSn();Ts();nIe=Qn("google",OSn)});var FSn,LSn=v(()=>{FSn={"google-vertex":{"gemini-2.5-flash":{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,input:["text","image"],cost:{input:.3,output:2.5,cacheRead:.03,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-2.5-flash-lite":{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash-Lite",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,input:["text","image"],cost:{input:.1,output:.4,cacheRead:.01,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-2.5-pro":{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3-flash-preview":{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.5,output:3,cacheRead:.05,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.1-flash-lite":{id:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:1.5,cacheRead:.025,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.1-pro-preview":{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.1-pro-preview-customtools":{id:"gemini-3.1-pro-preview-customtools",name:"Gemini 3.1 Pro Preview Custom Tools",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.5-flash":{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.5,output:9,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.5-flash-lite":{id:"gemini-3.5-flash-lite",name:"Gemini 3.5 Flash Lite",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.3,output:2.5,cacheRead:.03,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.6-flash":{id:"gemini-3.6-flash",name:"Gemini 3.6 Flash",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.7-flash":{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.8-flash":{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-flash-latest":{id:"gemini-flash-latest",name:"Gemini Flash Latest",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.5,output:9,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-flash-lite-latest":{id:"gemini-flash-lite-latest",name:"Gemini Flash-Lite Latest",api:"google-vertex",provider:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:1.5,cacheRead:.025,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var rIe,Crt=v(()=>{p();LSn();Ts();rIe=Qn("google-vertex",FSn)});var USn,QSn=v(()=>{USn={"openai-completions":{"llama-3.1-8b-instant":{id:"llama-3.1-8b-instant",name:"Llama 3.1 8B",api:"openai-completions",provider:"groq",baseUrl:"https://api.groq.com/openai/v1",reasoning:!1,input:["text"],cost:{input:.05,output:.08,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:131072,compat:{supportsStrictMode:!0}},"llama-3.3-70b-versatile":{id:"llama-3.3-70b-versatile",name:"Llama 3.3 70B",api:"openai-completions",provider:"groq",baseUrl:"https://api.groq.com/openai/v1",reasoning:!1,input:["text"],cost:{input:.59,output:.79,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsStrictMode:!0}},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"GPT OSS 120B",api:"openai-completions",provider:"groq",baseUrl:"https://api.groq.com/openai/v1",reasoning:!0,input:["text"],cost:{input:.15,output:.6,cacheRead:.075,cacheWrite:0},contextWindow:131072,maxTokens:65536,compat:{supportsStrictMode:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"GPT OSS 20B",api:"openai-completions",provider:"groq",baseUrl:"https://api.groq.com/openai/v1",reasoning:!0,input:["text"],cost:{input:.075,output:.3,cacheRead:.0375,cacheWrite:0},contextWindow:131072,maxTokens:65536,compat:{supportsStrictMode:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"openai/gpt-oss-safeguard-20b":{id:"openai/gpt-oss-safeguard-20b",name:"Safety GPT OSS 20B",api:"openai-completions",provider:"groq",baseUrl:"https://api.groq.com/openai/v1",reasoning:!0,input:["text"],cost:{input:.075,output:.3,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:65536,compat:{supportsStrictMode:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"qwen/qwen3.6-27b":{id:"qwen/qwen3.6-27b",name:"Qwen3.6 27B",api:"openai-completions",provider:"groq",baseUrl:"https://api.groq.com/openai/v1",reasoning:!0,input:["text","image"],cost:{input:.6,output:3,cacheRead:.3,cacheWrite:0},contextWindow:131072,maxTokens:16384,compat:{supportsStrictMode:!0},thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"default",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.8-27b":{id:"qwen/qwen3.8-27b",name:"Qwen3.8 27B",api:"openai-completions",provider:"groq",baseUrl:"https://api.groq.com/openai/v1",reasoning:!0,input:["text","image"],cost:{input:.8,output:4,cacheRead:0,cacheWrite:0},contextWindow:131042,maxTokens:16384,compat:{supportsStrictMode:!0},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var iIe,Irt=v(()=>{p();QSn();Ts();iIe=Qn("groq",USn)});var $Sn,GSn=v(()=>{$Sn={"openai-completions":{"MiniMaxAI/MiniMax-M2":{id:"MiniMaxAI/MiniMax-M2",name:"MiniMax-M2",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:204800,maxTokens:131072},"MiniMaxAI/MiniMax-M2.1":{id:"MiniMaxAI/MiniMax-M2.1",name:"MiniMax-M2.1",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:204800,maxTokens:131072},"MiniMaxAI/MiniMax-M2.5":{id:"MiniMaxAI/MiniMax-M2.5",name:"MiniMax-M2.5",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.03,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:204800,maxTokens:131072},"MiniMaxAI/MiniMax-M2.7":{id:"MiniMaxAI/MiniMax-M2.7",name:"MiniMax-M2.7",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:204800,maxTokens:131072},"MiniMaxAI/MiniMax-M3":{id:"MiniMaxAI/MiniMax-M3",name:"MiniMax-M3",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.3,output:1.2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:524288,maxTokens:512e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen2.5-Coder-32B-Instruct":{id:"Qwen/Qwen2.5-Coder-32B-Instruct",name:"Qwen2.5-Coder-32B-Instruct",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:.06,output:.2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:8192},"Qwen/Qwen3-235B-A22B":{id:"Qwen/Qwen3-235B-A22B",name:"Qwen3 235B-A22B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.2,output:.8,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:40960,maxTokens:16384},"Qwen/Qwen3-235B-A22B-Instruct-2507":{id:"Qwen/Qwen3-235B-A22B-Instruct-2507",name:"Qwen3 235B-A22B Instruct 2507",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:.855,output:2.565,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:16384},"Qwen/Qwen3-235B-A22B-Thinking-2507":{id:"Qwen/Qwen3-235B-A22B-Thinking-2507",name:"Qwen3-235B-A22B-Thinking-2507",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.3,output:3,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:131072},"Qwen/Qwen3-30B-A3B":{id:"Qwen/Qwen3-30B-A3B",name:"Qwen3 30B A3B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.12,output:.5,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:40960,maxTokens:16384},"Qwen/Qwen3-32B":{id:"Qwen/Qwen3-32B",name:"Qwen3 32B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.29,output:.59,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:16384},"Qwen/Qwen3-Coder-30B-A3B-Instruct":{id:"Qwen/Qwen3-Coder-30B-A3B-Instruct",name:"Qwen3-Coder 30B-A3B Instruct",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:.07,output:.26,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:65536},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{id:"Qwen/Qwen3-Coder-480B-A35B-Instruct",name:"Qwen3-Coder-480B-A35B-Instruct",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:2,output:2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:66536},"Qwen/Qwen3-Coder-Next":{id:"Qwen/Qwen3-Coder-Next",name:"Qwen3-Coder-Next",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:.2,output:1.5,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:65536},"Qwen/Qwen3-Next-80B-A3B-Instruct":{id:"Qwen/Qwen3-Next-80B-A3B-Instruct",name:"Qwen3-Next-80B-A3B-Instruct",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:.25,output:1,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:66536},"Qwen/Qwen3-Next-80B-A3B-Thinking":{id:"Qwen/Qwen3-Next-80B-A3B-Thinking",name:"Qwen3-Next-80B-A3B-Thinking",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:.3,output:2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:131072},"Qwen/Qwen3-VL-235B-A22B-Instruct":{id:"Qwen/Qwen3-VL-235B-A22B-Instruct",name:"Qwen3 VL 235B A22B Instruct",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text","image"],cost:{input:.3,output:1.5,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen3-VL-235B-A22B-Thinking":{id:"Qwen/Qwen3-VL-235B-A22B-Thinking",name:"Qwen3 VL 235B A22B Thinking",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.98,output:3.95,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:32768,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen3.5-122B-A10B":{id:"Qwen/Qwen3.5-122B-A10B",name:"Qwen3.5 122B-A10B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.4,output:3.2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen3.5-27B":{id:"Qwen/Qwen3.5-27B",name:"Qwen3.5 27B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.3,output:2.4,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen3.5-35B-A3B":{id:"Qwen/Qwen3.5-35B-A3B",name:"Qwen3.5 35B-A3B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.25,output:2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen3.5-397B-A17B":{id:"Qwen/Qwen3.5-397B-A17B",name:"Qwen3.5-397B-A17B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.6,output:3.6,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:32768,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen3.5-9B":{id:"Qwen/Qwen3.5-9B",name:"Qwen3.5 9B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.17,output:.25,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen3.6-27B":{id:"Qwen/Qwen3.6-27B",name:"Qwen3.6 27B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.47,output:3.19,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen3.6-35B-A3B":{id:"Qwen/Qwen3.6-35B-A3B",name:"Qwen3.6 35B-A3B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.15,output:.95,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen3.8-2.4T-A95B":{id:"Qwen/Qwen3.8-2.4T-A95B",name:"Qwen3.8 2.4T A95B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:2.5,output:6.25,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null}},"Qwen/Qwen3.8-27B":{id:"Qwen/Qwen3.8-27B",name:"Qwen3.8 27B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.4,output:3,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:32768,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"XiaomiMiMo/MiMo-V2-Flash":{id:"XiaomiMiMo/MiMo-V2-Flash",name:"MiMo-V2-Flash",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.1,output:.3,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:4096},"XiaomiMiMo/MiMo-V2.5":{id:"XiaomiMiMo/MiMo-V2.5",name:"MiMo-V2.5",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.4,output:2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:131072,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null}},"XiaomiMiMo/MiMo-V2.5-Pro":{id:"XiaomiMiMo/MiMo-V2.5-Pro",name:"MiMo-V2.5-Pro",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:1,output:3,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null}},"deepseek-ai/DeepSeek-R1":{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek-R1",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.7,output:2.5,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:64e3,maxTokens:32768},"deepseek-ai/DeepSeek-R1-0528":{id:"deepseek-ai/DeepSeek-R1-0528",name:"DeepSeek-R1-0528",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:3,output:5,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:163840,maxTokens:163840},"deepseek-ai/DeepSeek-V3":{id:"deepseek-ai/DeepSeek-V3",name:"DeepSeek-V3",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:.4,output:1.3,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:64e3,maxTokens:8192},"deepseek-ai/DeepSeek-V3-0324":{id:"deepseek-ai/DeepSeek-V3-0324",name:"DeepSeek V3 0324",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:.27,output:1.12,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:163840,maxTokens:163840},"deepseek-ai/DeepSeek-V3.1":{id:"deepseek-ai/DeepSeek-V3.1",name:"DeepSeek-V3.1",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.27,output:1,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:8192},"deepseek-ai/DeepSeek-V3.2":{id:"deepseek-ai/DeepSeek-V3.2",name:"DeepSeek-V3.2",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.28,output:.4,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:163840,maxTokens:65536},"deepseek-ai/DeepSeek-V4-Flash":{id:"deepseek-ai/DeepSeek-V4-Flash",name:"DeepSeek V4 Flash",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.14,output:.28,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1048576,maxTokens:384e3},"deepseek-ai/DeepSeek-V4-Flash-0731":{id:"deepseek-ai/DeepSeek-V4-Flash-0731",name:"DeepSeek V4 Flash 0731",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.14,output:.28,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1048576,maxTokens:384e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"}},"deepseek-ai/DeepSeek-V4-Flash-Vision-Exp":{id:"deepseek-ai/DeepSeek-V4-Flash-Vision-Exp",name:"DeepSeek V4 Flash Vision Exp",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.44,output:1.32,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1048576,maxTokens:384e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"deepseek-ai/DeepSeek-V4-Pro":{id:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.435,output:.87,cacheRead:.003625,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1048576,maxTokens:393216,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null}},"deepseek-ai/DeepSeek-V4-Pro-0813":{id:"deepseek-ai/DeepSeek-V4-Pro-0813",name:"DeepSeek V4 Pro 0813",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:1.32,output:3.96,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1e6,maxTokens:384e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"deepseek-ai/DeepSeek-V4.1-Flash":{id:"deepseek-ai/DeepSeek-V4.1-Flash",name:"DeepSeek V4.1 Flash",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.3,output:1.2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1048576,maxTokens:384e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-3-12b-it":{id:"google/gemma-3-12b-it",name:"Gemma 3 12B IT",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text","image"],cost:{input:.05,output:.15,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-3-27b-it":{id:"google/gemma-3-27b-it",name:"Gemma 3 27B IT",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text","image"],cost:{input:.08,output:.16,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-3-4b-it":{id:"google/gemma-3-4b-it",name:"Gemma 3 4B IT",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text","image"],cost:{input:.05,output:.1,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-4-26B-A4B-it":{id:"google/gemma-4-26B-A4B-it",name:"Gemma 4 26B A4B IT",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.13,output:.4,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-4-31B-it":{id:"google/gemma-4-31B-it",name:"Gemma 4 31B IT",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.14,output:.4,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta-llama/Llama-3.1-8B-Instruct":{id:"meta-llama/Llama-3.1-8B-Instruct",name:"Llama-3.1-8B-Instruct",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:.06,output:.06,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:4096},"meta-llama/Llama-3.3-70B-Instruct":{id:"meta-llama/Llama-3.3-70B-Instruct",name:"Llama-3.3-70B-Instruct",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:.59,output:.79,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:4096},"moonshotai/Kimi-K2-Instruct":{id:"moonshotai/Kimi-K2-Instruct",name:"Kimi-K2-Instruct",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:1,output:3,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:16384},"moonshotai/Kimi-K2-Instruct-0905":{id:"moonshotai/Kimi-K2-Instruct-0905",name:"Kimi-K2-Instruct-0905",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!1,input:["text"],cost:{input:1,output:3,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:16384},"moonshotai/Kimi-K2-Thinking":{id:"moonshotai/Kimi-K2-Thinking",name:"Kimi-K2-Thinking",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.6,output:2.5,cacheRead:.15,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:262144},"moonshotai/Kimi-K2.5":{id:"moonshotai/Kimi-K2.5",name:"Kimi-K2.5",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.6,output:3,cacheRead:.1,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/Kimi-K2.6":{id:"moonshotai/Kimi-K2.6",name:"Kimi-K2.6",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/Kimi-K2.7-Code":{id:"moonshotai/Kimi-K2.7-Code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/Kimi-K3":{id:"moonshotai/Kimi-K3",name:"Kimi K3",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1e6,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"GPT OSS 120B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.25,output:.69,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:32768,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"GPT OSS 20B",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.1,output:.5,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:32768,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null}},"stepfun-ai/Step-3.5-Flash":{id:"stepfun-ai/Step-3.5-Flash",name:"Step 3.5 Flash",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.1,output:.3,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:256e3},"stepfun-ai/Step-3.7-Flash":{id:"stepfun-ai/Step-3.7-Flash",name:"Step 3.7 Flash",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.15,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:256e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"tencent/Hy3":{id:"tencent/Hy3",name:"Hy3",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.14,output:.58,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:null}},"tencent/Hy4-preview":{id:"tencent/Hy4-preview",name:"Hy4 preview",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.834,output:2.501,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1e6,maxTokens:64e3,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null}},"thinkingmachines/Inkling":{id:"thinkingmachines/Inkling",name:"Inkling",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:1,output:4.05,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1048576,maxTokens:1048576,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"thinkingmachines/Inkling-Small":{id:"thinkingmachines/Inkling-Small",name:"Inkling Small",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.5,output:1.2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:524288,maxTokens:1048576,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai-org/GLM-4.5":{id:"zai-org/GLM-4.5",name:"GLM-4.5",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.6,output:2.2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:98304},"zai-org/GLM-4.5-Air":{id:"zai-org/GLM-4.5-Air",name:"GLM-4.5-Air",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.13,output:.85,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:98304},"zai-org/GLM-4.5V":{id:"zai-org/GLM-4.5V",name:"GLM-4.5V",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.6,output:1.8,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:65536,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai-org/GLM-4.6":{id:"zai-org/GLM-4.6",name:"GLM-4.6",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.55,output:2.2,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:204800,maxTokens:131072},"zai-org/GLM-4.6V-Flash":{id:"zai-org/GLM-4.6V-Flash",name:"GLM-4.6V-Flash",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.3,output:.9,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:131072,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai-org/GLM-4.7":{id:"zai-org/GLM-4.7",name:"GLM-4.7",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:.6,output:2.2,cacheRead:.11,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:204800,maxTokens:131072},"zai-org/GLM-4.7-Flash":{id:"zai-org/GLM-4.7-Flash",name:"GLM-4.7-Flash",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:2e5,maxTokens:128e3},"zai-org/GLM-5":{id:"zai-org/GLM-5",name:"GLM-5",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:1,output:3.2,cacheRead:.2,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:202752,maxTokens:131072},"zai-org/GLM-5.1":{id:"zai-org/GLM-5.1",name:"GLM-5.1",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:1,output:3.2,cacheRead:.2,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:202752,maxTokens:131072},"zai-org/GLM-5.2":{id:"zai-org/GLM-5.2",name:"GLM-5.2",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:262144,maxTokens:131072},"zai-org/GLM-5.3":{id:"zai-org/GLM-5.3",name:"GLM-5.3",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"zai-org/GLM-5.3-Flash":{id:"zai-org/GLM-5.3-Flash",name:"GLM-5.3-Flash",api:"openai-completions",provider:"huggingface",baseUrl:"https://router.huggingface.co/v1",reasoning:!0,input:["text","image"],cost:{input:.15,output:.5,cacheRead:0,cacheWrite:0},compat:{supportsStrictMode:!0,supportsDeveloperRole:!1},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var sIe,wrt=v(()=>{p();GSn();Ts();sIe=Qn("huggingface",$Sn)});var HSn,WSn=v(()=>{HSn={"anthropic-messages":{k3:{id:"k3",name:"Kimi K3",api:"anthropic-messages",provider:"kimi-coding",baseUrl:"https://api.kimi.com/coding",compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0},reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"k3-256k":{id:"k3-256k",name:"Kimi K3-256K",api:"anthropic-messages",provider:"kimi-coding",baseUrl:"https://api.kimi.com/coding",compat:{forceAdaptiveThinking:!0},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-for-coding":{id:"kimi-for-coding",name:"kimi-for-coding",api:"anthropic-messages",provider:"kimi-coding",baseUrl:"https://api.kimi.com/coding",compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0},reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},contextWindow:1048576,maxTokens:32768,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-for-coding-highspeed":{id:"kimi-for-coding-highspeed",name:"Kimi For Coding HighSpeed",api:"anthropic-messages",provider:"kimi-coding",baseUrl:"https://api.kimi.com/coding",compat:{forceAdaptiveThinking:!0},reasoning:!0,input:["text","image"],cost:{input:1.9,output:8,cacheRead:.38,cacheWrite:0},contextWindow:262144,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var oIe,Trt=v(()=>{p();WSn();Ts();oIe=Qn("kimi-coding",HSn)});var jSn,qSn=v(()=>{jSn={"openai-responses":{"muse-spark-1.1":{id:"muse-spark-1.1",name:"Muse Spark 1.1",api:"openai-responses",provider:"meta",baseUrl:"https://api.meta.ai/v1",reasoning:!0,input:["text","image"],cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"muse-spark-1.2":{id:"muse-spark-1.2",name:"Muse Spark 1.2",api:"openai-responses",provider:"meta",baseUrl:"https://api.meta.ai/v1",reasoning:!0,input:["text","image"],cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"muse-spark-1.2-contributor":{id:"muse-spark-1.2-contributor",name:"Muse Spark 1.2 Contributor",api:"openai-responses",provider:"meta",baseUrl:"https://api.meta.ai/v1",reasoning:!0,input:["text","image"],cost:{input:.1,output:.2,cacheRead:.002,cacheWrite:0},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"muse-spark-1.3":{id:"muse-spark-1.3",name:"Muse Spark 1.3",api:"openai-responses",provider:"meta",baseUrl:"https://api.meta.ai/v1",reasoning:!0,input:["text","image"],cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"muse-spark-1.3-contributor":{id:"muse-spark-1.3-contributor",name:"Muse Spark 1.3 Contributor",api:"openai-responses",provider:"meta",baseUrl:"https://api.meta.ai/v1",reasoning:!0,input:["text","image"],cost:{input:.1,output:.2,cacheRead:.002,cacheWrite:0},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var aIe,vrt=v(()=>{p();qSn();Ts();aIe=Qn("meta",jSn)});var YSn,VSn=v(()=>{YSn={"anthropic-messages":{"MiniMax-M2.7":{id:"MiniMax-M2.7",name:"MiniMax-M2.7",api:"anthropic-messages",provider:"minimax",baseUrl:"https://api.minimax.io/anthropic",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:.375},contextWindow:204800,maxTokens:131072},"MiniMax-M2.7-highspeed":{id:"MiniMax-M2.7-highspeed",name:"MiniMax-M2.7-highspeed",api:"anthropic-messages",provider:"minimax",baseUrl:"https://api.minimax.io/anthropic",reasoning:!0,input:["text"],cost:{input:.6,output:2.4,cacheRead:.06,cacheWrite:.375},contextWindow:204800,maxTokens:131072},"MiniMax-M3":{id:"MiniMax-M3",name:"MiniMax-M3",api:"anthropic-messages",provider:"minimax",baseUrl:"https://api.minimax.io/anthropic",reasoning:!0,input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},contextWindow:1048576,maxTokens:512e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var cIe,Rrt=v(()=>{p();VSn();Ts();cIe=Qn("minimax",YSn)});var KSn,zSn=v(()=>{KSn={"anthropic-messages":{"MiniMax-M2.7":{id:"MiniMax-M2.7",name:"MiniMax-M2.7",api:"anthropic-messages",provider:"minimax-cn",baseUrl:"https://api.minimaxi.com/anthropic",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:.375},contextWindow:204800,maxTokens:131072},"MiniMax-M2.7-highspeed":{id:"MiniMax-M2.7-highspeed",name:"MiniMax-M2.7-highspeed",api:"anthropic-messages",provider:"minimax-cn",baseUrl:"https://api.minimaxi.com/anthropic",reasoning:!0,input:["text"],cost:{input:.6,output:2.4,cacheRead:.06,cacheWrite:.375},contextWindow:204800,maxTokens:131072},"MiniMax-M3":{id:"MiniMax-M3",name:"MiniMax-M3",api:"anthropic-messages",provider:"minimax-cn",baseUrl:"https://api.minimaxi.com/anthropic",reasoning:!0,input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},contextWindow:1048576,maxTokens:512e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var lIe,krt=v(()=>{p();zSn();Ts();lIe=Qn("minimax-cn",KSn)});var XSn,JSn=v(()=>{XSn={"mistral-conversations":{"codestral-latest":{id:"codestral-latest",name:"Codestral (latest)",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.3,output:.9,cacheRead:.03,cacheWrite:0},contextWindow:256e3,maxTokens:4096},"devstral-2512":{id:"devstral-2512",name:"Devstral 2",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.4,output:2,cacheRead:.04,cacheWrite:0},contextWindow:262144,maxTokens:262144},"devstral-latest":{id:"devstral-latest",name:"Devstral 2",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.4,output:2,cacheRead:.04,cacheWrite:0},contextWindow:262144,maxTokens:262144},"devstral-medium-2507":{id:"devstral-medium-2507",name:"Devstral Medium",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.4,output:2,cacheRead:.04,cacheWrite:0},contextWindow:128e3,maxTokens:128e3},"devstral-medium-latest":{id:"devstral-medium-latest",name:"Devstral 2 (latest)",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.4,output:2,cacheRead:.04,cacheWrite:0},contextWindow:262144,maxTokens:262144},"devstral-small-2505":{id:"devstral-small-2505",name:"Devstral Small 2505",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.1,output:.3,cacheRead:.01,cacheWrite:0},contextWindow:128e3,maxTokens:128e3},"devstral-small-2507":{id:"devstral-small-2507",name:"Devstral Small",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.1,output:.3,cacheRead:.01,cacheWrite:0},contextWindow:128e3,maxTokens:128e3},"labs-devstral-small-2512":{id:"labs-devstral-small-2512",name:"Devstral Small 2",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"magistral-medium-latest":{id:"magistral-medium-latest",name:"Magistral Medium (latest)",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!0,input:["text"],cost:{input:2,output:5,cacheRead:.2,cacheWrite:0},contextWindow:128e3,maxTokens:16384},"magistral-small":{id:"magistral-small",name:"Magistral Small",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!0,input:["text"],cost:{input:.5,output:1.5,cacheRead:.05,cacheWrite:0},contextWindow:128e3,maxTokens:128e3},"ministral-3b-latest":{id:"ministral-3b-latest",name:"Ministral 3B (latest)",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.04,output:.04,cacheRead:.004,cacheWrite:0},contextWindow:128e3,maxTokens:128e3},"ministral-8b-latest":{id:"ministral-8b-latest",name:"Ministral 8B (latest)",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.1,output:.1,cacheRead:.01,cacheWrite:0},contextWindow:128e3,maxTokens:128e3},"mistral-large-2411":{id:"mistral-large-2411",name:"Mistral Large 2.1",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:2,output:6,cacheRead:.2,cacheWrite:0},contextWindow:131072,maxTokens:16384},"mistral-large-2512":{id:"mistral-large-2512",name:"Mistral Large 3",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text","image"],cost:{input:.5,output:1.5,cacheRead:.05,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral-large-latest":{id:"mistral-large-latest",name:"Mistral Large (latest)",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text","image"],cost:{input:.5,output:1.5,cacheRead:.05,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral-medium-2505":{id:"mistral-medium-2505",name:"Mistral Medium 3",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text","image"],cost:{input:.4,output:2,cacheRead:.04,cacheWrite:0},contextWindow:131072,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral-medium-2508":{id:"mistral-medium-2508",name:"Mistral Medium 3.1",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text","image"],cost:{input:.4,output:2,cacheRead:.04,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral-medium-2604":{id:"mistral-medium-2604",name:"Mistral Medium 3.5",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!0,input:["text","image"],cost:{input:1.5,output:7.5,cacheRead:.15,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral-medium-3.5":{id:"mistral-medium-3.5",name:"Mistral Medium 3.5",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!0,input:["text","image"],cost:{input:1.5,output:7.5,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral-medium-latest":{id:"mistral-medium-latest",name:"Mistral Medium (latest)",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!0,input:["text","image"],cost:{input:1.5,output:7.5,cacheRead:.15,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral-nemo":{id:"mistral-nemo",name:"Mistral Nemo",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.15,output:.15,cacheRead:.015,cacheWrite:0},contextWindow:128e3,maxTokens:128e3},"mistral-small-2506":{id:"mistral-small-2506",name:"Mistral Small 3.2",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text","image"],cost:{input:.1,output:.3,cacheRead:.01,cacheWrite:0},contextWindow:128e3,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral-small-2603":{id:"mistral-small-2603",name:"Mistral Small 4",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!0,input:["text","image"],cost:{input:.15,output:.6,cacheRead:.015,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral-small-latest":{id:"mistral-small-latest",name:"Mistral Small (latest)",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!0,input:["text","image"],cost:{input:.15,output:.6,cacheRead:.015,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"open-mistral-7b":{id:"open-mistral-7b",name:"Mistral 7B",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.25,output:.25,cacheRead:.025,cacheWrite:0},contextWindow:8e3,maxTokens:8e3},"open-mistral-nemo":{id:"open-mistral-nemo",name:"Open Mistral Nemo",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.15,output:.15,cacheRead:.015,cacheWrite:0},contextWindow:128e3,maxTokens:128e3},"open-mixtral-8x22b":{id:"open-mixtral-8x22b",name:"Mixtral 8x22B",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:2,output:6,cacheRead:.2,cacheWrite:0},contextWindow:64e3,maxTokens:64e3},"open-mixtral-8x7b":{id:"open-mixtral-8x7b",name:"Mixtral 8x7B",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.7,output:.7,cacheRead:.07,cacheWrite:0},contextWindow:32e3,maxTokens:32e3},"pixtral-12b":{id:"pixtral-12b",name:"Pixtral 12B",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text","image"],cost:{input:.15,output:.15,cacheRead:.015,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"pixtral-large-latest":{id:"pixtral-large-latest",name:"Pixtral Large (latest)",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text","image"],cost:{input:2,output:6,cacheRead:.2,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"voxtral-small-latest":{id:"voxtral-small-latest",name:"Voxtral Small (latest)",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!1,input:["text"],cost:{input:.1,output:.3,cacheRead:.01,cacheWrite:0},contextWindow:32e3,maxTokens:32e3},"zai-glm-5-2":{id:"zai-glm-5-2",name:"GLM-5.2",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.14,cacheWrite:0},contextWindow:1e6,maxTokens:131072},"zai-glm-5-3":{id:"zai-glm-5-3",name:"GLM-5.3",api:"mistral-conversations",provider:"mistral",baseUrl:"https://api.mistral.ai",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.14,cacheWrite:0},contextWindow:1e6,maxTokens:131072}}}});var uIe,Brt=v(()=>{p();JSn();Ts();uIe=Qn("mistral",XSn)});var eCn,ZSn=v(()=>{eCn={"openai-completions":{"kimi-k2.6":{id:"kimi-k2.6",name:"Kimi K2.6",api:"openai-completions",provider:"moonshotai",baseUrl:"https://api.moonshot.ai/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},contextWindow:262144,maxTokens:262144,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsStrictMode:!1,thinkingFormat:"deepseek",supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"moonshotai",baseUrl:"https://api.moonshot.ai/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},contextWindow:262144,maxTokens:262144,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsStrictMode:!1,thinkingFormat:"deepseek",supportsMidConvoSystemMessages:!0},thinkingLevelMap:{off:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.7-code-highspeed":{id:"kimi-k2.7-code-highspeed",name:"Kimi K2.7 Code HighSpeed",api:"openai-completions",provider:"moonshotai",baseUrl:"https://api.moonshot.ai/v1",reasoning:!0,input:["text","image"],cost:{input:1.9,output:8,cacheRead:.38,cacheWrite:0},contextWindow:262144,maxTokens:262144,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsStrictMode:!1,thinkingFormat:"deepseek",supportsMidConvoSystemMessages:!0},thinkingLevelMap:{off:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k3":{id:"kimi-k3",name:"Kimi K3",api:"openai-completions",provider:"moonshotai",baseUrl:"https://api.moonshot.ai/v1",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",supportsStrictMode:!1,thinkingFormat:"openai",requiresReasoningContentOnAssistantMessages:!0,supportsMidConvoSystemMessages:!0,supportsMidConvoToolAdditions:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var dIe,Nrt=v(()=>{p();ZSn();Ts();dIe=Qn("moonshotai",eCn)});var nCn,tCn=v(()=>{nCn={"openai-completions":{"kimi-k2.6":{id:"kimi-k2.6",name:"Kimi K2.6",api:"openai-completions",provider:"moonshotai-cn",baseUrl:"https://api.moonshot.cn/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},contextWindow:262144,maxTokens:262144,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsStrictMode:!1,thinkingFormat:"deepseek",supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"moonshotai-cn",baseUrl:"https://api.moonshot.cn/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},contextWindow:262144,maxTokens:262144,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsStrictMode:!1,thinkingFormat:"deepseek",supportsMidConvoSystemMessages:!0},thinkingLevelMap:{off:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.7-code-highspeed":{id:"kimi-k2.7-code-highspeed",name:"Kimi K2.7 Code HighSpeed",api:"openai-completions",provider:"moonshotai-cn",baseUrl:"https://api.moonshot.cn/v1",reasoning:!0,input:["text","image"],cost:{input:1.9,output:8,cacheRead:.38,cacheWrite:0},contextWindow:262144,maxTokens:262144,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsStrictMode:!1,thinkingFormat:"deepseek",supportsMidConvoSystemMessages:!0},thinkingLevelMap:{off:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k3":{id:"kimi-k3",name:"Kimi K3",api:"openai-completions",provider:"moonshotai-cn",baseUrl:"https://api.moonshot.cn/v1",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",supportsStrictMode:!1,thinkingFormat:"openai",requiresReasoningContentOnAssistantMessages:!0,supportsMidConvoSystemMessages:!0,supportsMidConvoToolAdditions:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var pIe,Drt=v(()=>{p();tCn();Ts();pIe=Qn("moonshotai-cn",nCn)});var iCn,rCn=v(()=>{iCn={"openai-completions":{"google/gemma-3-12b-it":{id:"google/gemma-3-12b-it",name:"Gemma 3 12B IT",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!1,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:131072,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-3-4b-it":{id:"google/gemma-3-4b-it",name:"Gemma 3 4B IT",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!1,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:131072,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/llama-3.2-11b-vision-instruct":{id:"meta/llama-3.2-11b-vision-instruct",name:"Llama 3.2 11b Vision Instruct",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!1,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:128e3,maxTokens:4096,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/llama-3.2-90b-vision-instruct":{id:"meta/llama-3.2-90b-vision-instruct",name:"Llama-3.2-90B-Vision-Instruct",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!1,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:128e3,maxTokens:8192,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-glimmer-30b":{id:"meta/muse-glimmer-30b",name:"Muse Glimmer 30B",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:131072,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-7b-instruct-v0.3":{id:"mistralai/mistral-7b-instruct-v0.3",name:"Mistral-7B-Instruct-v0.3",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!1,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:65536,maxTokens:65536},"moonshotai/kimi-k2.6":{id:"moonshotai/kimi-k2.6",name:"Kimi K2.6",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/kimi-k3":{id:"moonshotai/kimi-k3",name:"Kimi K3",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia/cosmos-reason2-8b":{id:"nvidia/cosmos-reason2-8b",name:"Cosmos Reason2 8B",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:131072,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia/llama-3.1-nemotron-70b-instruct":{id:"nvidia/llama-3.1-nemotron-70b-instruct",name:"Llama 3.1 Nemotron 70B Instruct",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!1,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:128e3,maxTokens:8192},"nvidia/llama-3.1-nemotron-ultra-253b-v1":{id:"nvidia/llama-3.1-nemotron-ultra-253b-v1",name:"Llama 3.1 Nemotron Ultra 253B",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:128e3,maxTokens:16384},"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning":{id:"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning",name:"Nemotron 3 Nano Omni",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:256e3,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia/nemotron-3-super-120b-a12b":{id:"nvidia/nemotron-3-super-120b-a12b",name:"Nemotron 3 Super",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text"],cost:{input:.2,output:.8,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:262144,maxTokens:262144},"nvidia/nemotron-3-ultra-550b-a55b":{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B A55B",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text"],cost:{input:.5,output:2.5,cacheRead:.15,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1e6,maxTokens:65536},"nvidia/nemotron-3.5-lightning-30b-a3b":{id:"nvidia/nemotron-3.5-lightning-30b-a3b",name:"Nemotron 3.5 Lightning 30B A3B",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:262144,maxTokens:262144},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"GPT OSS 20B",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:131072,maxTokens:32768},"poolside/laguna-xs-2.1":{id:"poolside/laguna-xs-2.1",name:"Laguna XS 2.1",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:262144,maxTokens:16384},"z-ai/glm-5.3":{id:"z-ai/glm-5.3",name:"GLM-5.3",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1e6,maxTokens:131072},"z-ai/glm-5.3-flash":{id:"z-ai/glm-5.3-flash",name:"GLM-5.3-Flash",api:"openai-completions",provider:"nvidia",baseUrl:"https://integrate.api.nvidia.com/v1",headers:{"NVCF-POLL-SECONDS":"3600"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var mIe,Prt=v(()=>{p();rCn();Ts();mIe=Qn("nvidia",iCn)});var oCn,sCn=v(()=>{oCn={"openai-responses":{"gpt-4":{id:"gpt-4",name:"GPT-4",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text"],cost:{input:30,output:60,cacheRead:0,cacheWrite:0},contextWindow:8192,maxTokens:8192,compat:{supportsStrictMode:!0}},"gpt-4-turbo":{id:"gpt-4-turbo",name:"GPT-4 Turbo",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text","image"],cost:{input:10,output:30,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096,compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4.1":{id:"gpt-4.1",name:"GPT-4.1",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4.1-mini":{id:"gpt-4.1-mini",name:"GPT-4.1 mini",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text","image"],cost:{input:.4,output:1.6,cacheRead:.1,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4.1-nano":{id:"gpt-4.1-nano",name:"GPT-4.1 nano",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text","image"],cost:{input:.1,output:.4,cacheRead:.025,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o":{id:"gpt-4o",name:"GPT-4o",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text","image"],cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o-2024-05-13":{id:"gpt-4o-2024-05-13",name:"GPT-4o (2024-05-13)",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text","image"],cost:{input:5,output:15,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096,compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o-2024-08-06":{id:"gpt-4o-2024-08-06",name:"GPT-4o (2024-08-06)",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text","image"],cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o-2024-11-20":{id:"gpt-4o-2024-11-20",name:"GPT-4o (2024-11-20)",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text","image"],cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-4o-mini":{id:"gpt-4o-mini",name:"GPT-4o mini",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text","image"],cost:{input:.15,output:.6,cacheRead:.075,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5":{id:"gpt-5",name:"GPT-5",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-chat-latest":{id:"gpt-5-chat-latest",name:"GPT-5 Chat Latest",api:"openai-responses",baseUrl:"https://api.openai.com/v1",provider:"openai",reasoning:!1,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:128e3,maxTokens:16384,thinkingLevelMap:{off:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-mini":{id:"gpt-5-mini",name:"GPT-5 Mini",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:.25,output:2,cacheRead:.025,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-nano":{id:"gpt-5-nano",name:"GPT-5 Nano",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:.05,output:.4,cacheRead:.005,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-pro":{id:"gpt-5-pro",name:"GPT-5 Pro",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:15,output:120,cacheRead:0,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.1":{id:"gpt-5.1",name:"GPT-5.1",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.2":{id:"gpt-5.2",name:"GPT-5.2",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.2-chat-latest":{id:"gpt-5.2-chat-latest",name:"GPT-5.2 Chat",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:128e3,maxTokens:16384,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:null,xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.2-pro":{id:"gpt-5.2-pro",name:"GPT-5.2 Pro",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:21,output:168,cacheRead:0,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.3-chat-latest":{id:"gpt-5.3-chat-latest",name:"GPT-5.3 Chat (latest)",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!1,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:128e3,maxTokens:16384,thinkingLevelMap:{off:null,xhigh:"xhigh"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.3-codex":{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.3-codex-spark":{id:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:128e3,maxTokens:32e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4":{id:"gpt-5.4",name:"GPT-5.4",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:5,output:22.5,cacheRead:.5,cacheWrite:0}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT-5.4 mini",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-nano":{id:"gpt-5.4-nano",name:"GPT-5.4 nano",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-pro":{id:"gpt-5.4-pro",name:"GPT-5.4 Pro",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:30,output:180,cacheRead:0,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:60,output:270,cacheRead:0,cacheWrite:0}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:10,output:45,cacheRead:1,cacheWrite:0}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.5-pro":{id:"gpt-5.5-pro",name:"GPT-5.5 Pro",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:30,output:180,cacheRead:0,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:60,output:270,cacheRead:0,cacheWrite:0}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25,tiers:[{inputTokensAbove:272e3,input:.4,output:1.8,cacheRead:.04,cacheWrite:.5}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0,supportsExplicitPromptCacheMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.4,cacheWrite:5,tiers:[{inputTokensAbove:272e3,input:8,output:30,cacheRead:.8,cacheWrite:10}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0,supportsExplicitPromptCacheMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:18,cacheRead:.4,cacheWrite:5}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0,supportsExplicitPromptCacheMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5,tiers:[{inputTokensAbove:272e3,input:20,output:75,cacheRead:2,cacheWrite:25}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0,supportsExplicitPromptCacheMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-luna":{id:"gpt-6-luna",name:"GPT-6 Luna",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125,tiers:[{inputTokensAbove:272e3,input:.2,output:.75,cacheRead:.02,cacheWrite:.25}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0,supportsExplicitPromptCacheMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-sol":{id:"gpt-6-sol",name:"GPT-6 Sol",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:15,cacheRead:.4,cacheWrite:5}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsStrictMode:!0,supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0,supportsExplicitPromptCacheMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-realtime-2.1":{id:"gpt-realtime-2.1",name:"GPT-Realtime-2.1",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:4,output:24,cacheRead:.4,cacheWrite:0},contextWindow:128e3,maxTokens:32e3,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},o1:{id:"o1",name:"o1",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"o1-pro":{id:"o1-pro",name:"o1-pro",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:150,output:600,cacheRead:0,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},o3:{id:"o3",name:"o3",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"o3-mini":{id:"o3-mini",name:"o3-mini",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text"],cost:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0}},"o3-pro":{id:"o3-pro",name:"o3-pro",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:20,output:80,cacheRead:0,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"o4-mini":{id:"o4-mini",name:"o4-mini",api:"openai-responses",provider:"openai",baseUrl:"https://api.openai.com/v1",reasoning:!0,input:["text","image"],cost:{input:1.1,output:4.4,cacheRead:.275,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsStrictMode:!0},inputLimits:{maxRequestBytes:536870912,images:{maxPerRequest:1500,resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var hIe,Mrt=v(()=>{p();sCn();Ts();hIe=Qn("openai",oCn)});var cCn,aCn=v(()=>{cCn={"openai-codex-responses":{"gpt-5.3-codex-spark":{id:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",api:"openai-codex-responses",provider:"openai-codex",baseUrl:"https://chatgpt.com/backend-api",reasoning:!0,input:["text"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:128e3,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",minimal:"low"},compat:{supportsOpenAIGrammarTools:!0}},"gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",api:"openai-codex-responses",provider:"openai-codex",baseUrl:"https://chatgpt.com/backend-api",reasoning:!0,input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:10,output:45,cacheRead:1,cacheWrite:0}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",minimal:"low"},compat:{supportsOpenAIGrammarTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",api:"openai-codex-responses",provider:"openai-codex",baseUrl:"https://chatgpt.com/backend-api",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25,tiers:[{inputTokensAbove:272e3,input:.4,output:1.8,cacheRead:.04,cacheWrite:.5}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},compat:{supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",api:"openai-codex-responses",provider:"openai-codex",baseUrl:"https://chatgpt.com/backend-api",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.4,cacheWrite:5,tiers:[{inputTokensAbove:272e3,input:8,output:30,cacheRead:.8,cacheWrite:10}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},compat:{supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",api:"openai-codex-responses",provider:"openai-codex",baseUrl:"https://chatgpt.com/backend-api",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:18,cacheRead:.4,cacheWrite:5}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},compat:{supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",api:"openai-codex-responses",provider:"openai-codex",baseUrl:"https://chatgpt.com/backend-api",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5,tiers:[{inputTokensAbove:272e3,input:20,output:75,cacheRead:2,cacheWrite:25}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-luna":{id:"gpt-6-luna",name:"GPT-6 Luna",api:"openai-codex-responses",provider:"openai-codex",baseUrl:"https://chatgpt.com/backend-api",reasoning:!0,input:["text","image"],cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125,tiers:[{inputTokensAbove:272e3,input:.2,output:.75,cacheRead:.02,cacheWrite:.25}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-sol":{id:"gpt-6-sol",name:"GPT-6 Sol",api:"openai-codex-responses",provider:"openai-codex",baseUrl:"https://chatgpt.com/backend-api",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:15,cacheRead:.4,cacheWrite:5}]},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsAdditionalTools:!0,supportsToolSearch:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var fIe,Ort=v(()=>{p();aCn();Ts();fIe=Qn("openai-codex",cCn)});var uCn,lCn=v(()=>{uCn={"anthropic-messages":{"claude-fable-5":{id:"claude-fable-5",name:"Claude Fable 5",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-fable-5-1":{id:"claude-fable-5-1",name:"Claude Fable 5.1",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-haiku-4-5":{id:"claude-haiku-4-5",name:"Claude Haiku 4.5",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-5":{id:"claude-opus-4-5",name:"Claude Opus 4.5",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-6":{id:"claude-opus-4-6",name:"Claude Opus 4.6",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{max:"max"},compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-7":{id:"claude-opus-4-7",name:"Claude Opus 4.7",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},compat:{forceAdaptiveThinking:!0,supportsTemperature:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-8":{id:"claude-opus-4-8",name:"Claude Opus 4.8",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-5":{id:"claude-opus-5",name:"Claude Opus 5",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-5-5":{id:"claude-opus-5-5",name:"Claude Opus 5.5",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.2,cacheWrite:5},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-4":{id:"claude-sonnet-4",name:"Claude Sonnet 4",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-4-5":{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-4-6":{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:64e3,thinkingLevelMap:{max:"max"},compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-5":{id:"claude-sonnet-5",name:"Claude Sonnet 5",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.5-plus":{id:"qwen3.5-plus",name:"Qwen3.5 Plus",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.6-plus":{id:"qwen3.6-plus",name:"Qwen3.6 Plus",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:.5,output:3,cacheRead:.05,cacheWrite:.625},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.8-flash":{id:"qwen3.8-flash",name:"Qwen3.8 Flash",api:"anthropic-messages",provider:"opencode",baseUrl:"https://opencode.ai/zen",reasoning:!0,input:["text","image"],cost:{input:.15,output:.47,cacheRead:.016,cacheWrite:.2},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}},"google-generative-ai":{"gemini-3-flash":{id:"gemini-3-flash",name:"Gemini 3 Flash",api:"google-generative-ai",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.5,output:3,cacheRead:.05,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.1-pro":{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro Preview",api:"google-generative-ai",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.5-flash":{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",api:"google-generative-ai",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.5,output:9,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.5-flash-lite":{id:"gemini-3.5-flash-lite",name:"Gemini 3.5 Flash Lite",api:"google-generative-ai",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.3,output:2.5,cacheRead:.03,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.6-flash":{id:"gemini-3.6-flash",name:"Gemini 3.6 Flash",api:"google-generative-ai",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.5,output:7.5,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.7-flash":{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash",api:"google-generative-ai",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.5,output:7.5,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gemini-3.8-flash":{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",api:"google-generative-ai",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.5,output:7.5,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}},"openai-completions":{"big-pickle":{id:"big-pickle",name:"Big Pickle",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:2e5,maxTokens:32e3},"deepseek-v4-flash":{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:.14,output:.28,cacheRead:.028,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,requiresReasoningContentOnAssistantMessages:!0},contextWindow:1e6,maxTokens:384e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"deepseek-v4-flash-vision-exp":{id:"deepseek-v4-flash-vision-exp",name:"DeepSeek V4 Flash Vision Exp",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.14,output:.28,cacheRead:.028,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",requiresReasoningContentOnAssistantMessages:!0},contextWindow:1e6,maxTokens:384e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"deepseek-v4-pro":{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:1.74,output:3.84,cacheRead:.145,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,requiresReasoningContentOnAssistantMessages:!0},contextWindow:1e6,maxTokens:384e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"}},"deepseek-v4.1-flash":{id:"deepseek-v4.1-flash",name:"DeepSeek V4.1 Flash",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.006,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",requiresReasoningContentOnAssistantMessages:!0},contextWindow:1e6,maxTokens:384e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"glm-5":{id:"glm-5",name:"GLM-5",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:1,output:3.2,cacheRead:.2,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:204800,maxTokens:131072},"glm-5.1":{id:"glm-5.1",name:"GLM-5.1",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:204800,maxTokens:131072},"glm-5.2":{id:"glm-5.2",name:"GLM-5.2",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"}},"glm-5.3":{id:"glm-5.3",name:"GLM-5.3",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"glm-5.3-flash":{id:"glm-5.3-flash",name:"GLM-5.3-Flash",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.5":{id:"kimi-k2.5",name:"Kimi K2.5",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.6,output:3,cacheRead:.08,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",supportsLongCacheRetention:!1},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.6":{id:"kimi-k2.6",name:"Kimi K2.6",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,thinkingFormat:"deepseek",supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k3":{id:"kimi-k3",name:"Kimi K3",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",supportsMidConvoSystemMessages:!0,supportsMidConvoToolAdditions:!0},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:null,xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"ling-3.0-flash-fin-free":{id:"ling-3.0-flash-fin-free",name:"Ling 3.0 Flash Fin Free",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:262144,maxTokens:32768},"mimo-v2.6-flash-free":{id:"mimo-v2.6-flash-free",name:"MiMo-V2.6-Flash Free",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:2e5,maxTokens:32e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"minimax-m2.5":{id:"minimax-m2.5",name:"MiniMax-M2.5",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:204800,maxTokens:131072},"minimax-m2.7":{id:"minimax-m2.7",name:"MiniMax-M2.7",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",supportsLongCacheRetention:!1},contextWindow:204800,maxTokens:131072},"minimax-m3":{id:"minimax-m3",name:"MiniMax-M3",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:512e3,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nemotron-3-ultra-free":{id:"nemotron-3-ultra-free",name:"Nemotron 3 Ultra Free",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:128e3},"nemotron-3.5-lightning-free":{id:"nemotron-3.5-lightning-free",name:"Nemotron 3.5 Lightning Free",api:"openai-completions",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:262144,maxTokens:262144}},"openai-responses":{"gpt-5":{id:"gpt-5",name:"GPT-5",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1.07,output:8.5,cacheRead:.107,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-codex":{id:"gpt-5-codex",name:"GPT-5 Codex",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1.07,output:8.5,cacheRead:.107,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5-nano":{id:"gpt-5-nano",name:"GPT-5 Nano",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.05,output:.4,cacheRead:.005,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.1":{id:"gpt-5.1",name:"GPT-5.1",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1.07,output:8.5,cacheRead:.107,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.1-codex":{id:"gpt-5.1-codex",name:"GPT-5.1 Codex",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1.07,output:8.5,cacheRead:.107,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.1-codex-max":{id:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.1-codex-mini":{id:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex Mini",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.25,output:2,cacheRead:.025,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.2":{id:"gpt-5.2",name:"GPT-5.2",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.2-codex":{id:"gpt-5.2-codex",name:"GPT-5.2 Codex",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.3-codex":{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4":{id:"gpt-5.4",name:"GPT-5.4",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:272e3,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-nano":{id:"gpt-5.4-nano",name:"GPT-5.4 Nano",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-pro":{id:"gpt-5.4-pro",name:"GPT-5.4 Pro",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:30,output:180,cacheRead:30,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.5-pro":{id:"gpt-5.5-pro",name:"GPT-5.5 Pro",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:30,output:180,cacheRead:30,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.4,cacheWrite:5},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:3.125},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-luna":{id:"gpt-6-luna",name:"GPT-6 Luna",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-sol":{id:"gpt-6-sol",name:"GPT-6 Sol",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},compat:{sessionAffinityFormat:"openai-nosession",supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-4.5":{id:"grok-4.5",name:"Grok 4.5",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.3,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession"},contextWindow:5e5,maxTokens:5e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-4.6":{id:"grok-4.6",name:"Grok 4.6",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession"},contextWindow:5e5,maxTokens:5e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-build-0.1":{id:"grok-build-0.1",name:"Grok Build 0.1",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1,output:2,cacheRead:.2,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession",supportsReasoningEffort:!1},contextWindow:256e3,maxTokens:256e3,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"muse-spark-1.2":{id:"muse-spark-1.2",name:"Muse Spark 1.2",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession"},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"muse-spark-1.2-contributor-free":{id:"muse-spark-1.2-contributor-free",name:"Muse Spark 1.2 Free",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession"},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"muse-spark-1.3":{id:"muse-spark-1.3",name:"Muse Spark 1.3",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession"},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"muse-spark-1.3-contributor-free":{id:"muse-spark-1.3-contributor-free",name:"Muse Spark 1.3 Free",api:"openai-responses",provider:"opencode",baseUrl:"https://opencode.ai/zen/v1",reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession"},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var gIe,Lrt=v(()=>{p();lCn();Ts();gIe=Qn("opencode",uCn)});var pCn,dCn=v(()=>{pCn={"anthropic-messages":{"minimax-m3":{id:"minimax-m3",name:"MiniMax-M3",api:"anthropic-messages",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go",reasoning:!0,input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.8-flash":{id:"qwen3.8-flash",name:"Qwen3.8 Flash",api:"anthropic-messages",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go",reasoning:!0,input:["text","image"],cost:{input:.15,output:.47,cacheRead:.016,cacheWrite:.2},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}},"openai-completions":{"deepseek-v4-flash":{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:.15,output:.6,cacheRead:.003,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},contextWindow:1e6,maxTokens:384e3,thinkingLevelMap:{minimal:null,low:"low",medium:null,high:"high",max:"max"}},"deepseek-v4-flash-vision-exp":{id:"deepseek-v4-flash-vision-exp",name:"DeepSeek V4 Flash Vision Exp",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.15,output:.6,cacheRead:.003,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},contextWindow:1e6,maxTokens:384e3,thinkingLevelMap:{minimal:null,low:"low",medium:null,high:"high",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"deepseek-v4-pro":{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro (New)",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:.66,output:1.98,cacheRead:.022,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},contextWindow:1e6,maxTokens:384e3,thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",max:"max"}},"deepseek-v4.1-flash":{id:"deepseek-v4.1-flash",name:"DeepSeek V4.1 Flash",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.15,output:.6,cacheRead:.003,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},contextWindow:1e6,maxTokens:384e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"glm-5.1":{id:"glm-5.1",name:"GLM-5.1",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:202752,maxTokens:32768},"glm-5.2":{id:"glm-5.2",name:"GLM-5.2",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"}},"glm-5.3":{id:"glm-5.3",name:"GLM-5.3",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"}},"glm-5.3-flash":{id:"glm-5.3-flash",name:"GLM-5.3-Flash",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},hy3:{id:"hy3",name:"Hy3",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:.14,output:.58,cacheRead:.035,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:256e3,maxTokens:128e3,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:null}},"hy4-preview":{id:"hy4-preview",name:"Hy4 preview",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:.834,output:2.501,cacheRead:.042,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1024e3,maxTokens:64e3,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null}},"kimi-k2.6":{id:"kimi-k2.6",name:"Kimi K2.6",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,thinkingFormat:"deepseek",supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1},contextWindow:262144,maxTokens:65536,thinkingLevelMap:{minimal:null,low:null,medium:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k3":{id:"kimi-k3",name:"Kimi K3",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens",supportsMidConvoSystemMessages:!0,supportsMidConvoToolAdditions:!0},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:null,xhigh:null,max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"longcat-2.0":{id:"longcat-2.0",name:"LongCat-2.0",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.006,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:131072},"mimo-v2.5":{id:"mimo-v2.5",name:"MiMo V2.5",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.14,output:.28,cacheRead:.0028,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.5-pro":{id:"mimo-v2.5-pro",name:"MiMo V2.5 Pro",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:.435,output:.87,cacheRead:.003625,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1048576,maxTokens:128e3},"mimo-v2.6-flash":{id:"mimo-v2.6-flash",name:"MiMo-V2.6-Flash",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.14,output:.28,cacheRead:.0028,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.6-pro":{id:"mimo-v2.6-pro",name:"MiMo-V2.6-Pro",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.435,output:.87,cacheRead:.003625,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"minimax-m2.7":{id:"minimax-m2.7",name:"MiniMax-M2.7",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:.375},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:204800,maxTokens:131072},"qwen3.6-plus":{id:"qwen3.6-plus",name:"Qwen3.6 Plus",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.5,output:3,cacheRead:.05,cacheWrite:.625},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,thinkingFormat:"qwen",maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.7-max":{id:"qwen3.7-max",name:"Qwen3.7 Max",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text"],cost:{input:2.5,output:7.5,cacheRead:.5,cacheWrite:3.125},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:65536},"qwen3.7-plus":{id:"qwen3.7-plus",name:"Qwen3.7 Plus",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.4,output:1.6,cacheRead:.04,cacheWrite:.5},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.8-max":{id:"qwen3.8-max",name:"Qwen3.8 Max",api:"openai-completions",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.25,cacheWrite:2.5},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"},contextWindow:1e6,maxTokens:131072,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}},"openai-responses":{"gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",api:"openai-responses",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25},compat:{sessionAffinityFormat:"openai-nosession",supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-4.6":{id:"grok-4.6",name:"Grok 4.6",api:"openai-responses",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession"},contextWindow:5e5,maxTokens:5e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-4.7":{id:"grok-4.7",name:"Grok 4.7",api:"openai-responses",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession"},contextWindow:5e5,maxTokens:5e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"muse-spark-1.2-contributor":{id:"muse-spark-1.2-contributor",name:"Muse Spark 1.2 Contributor",api:"openai-responses",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.1,output:.2,cacheRead:.002,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession"},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"muse-spark-1.3-contributor":{id:"muse-spark-1.3-contributor",name:"Muse Spark 1.3 Contributor",api:"openai-responses",provider:"opencode-go",baseUrl:"https://opencode.ai/zen/go/v1",reasoning:!0,input:["text","image"],cost:{input:.1,output:.2,cacheRead:.002,cacheWrite:0},compat:{sessionAffinityFormat:"openai-nosession"},contextWindow:1048576,maxTokens:131072,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var AIe,Frt=v(()=>{p();dCn();Ts();AIe=Qn("opencode-go",pCn)});var hCn,mCn=v(()=>{hCn={"anthropic-messages":{"anthropic/claude-3-haiku":{id:"anthropic/claude-3-haiku",name:"Anthropic: Claude 3 Haiku",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.25,output:1.25,cacheRead:.03,cacheWrite:.3},contextWindow:2e5,maxTokens:4096,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-fable-5":{id:"anthropic/claude-fable-5",name:"Anthropic: Claude Fable 5",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-fable-5.1":{id:"anthropic/claude-fable-5.1",name:"Anthropic: Claude Fable 5.1",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoEffort:!0,forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-haiku-4.5":{id:"anthropic/claude-haiku-4.5",name:"Anthropic: Claude Haiku 4.5",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.1":{id:"anthropic/claude-opus-4.1",name:"Anthropic: Claude Opus 4.1",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75},contextWindow:2e5,maxTokens:32e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.5":{id:"anthropic/claude-opus-4.5",name:"Anthropic: Claude Opus 4.5",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.6":{id:"anthropic/claude-opus-4.6",name:"Anthropic: Claude Opus 4.6",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.7":{id:"anthropic/claude-opus-4.7",name:"Anthropic: Claude Opus 4.7",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{forceAdaptiveThinking:!0,supportsTemperature:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.8":{id:"anthropic/claude-opus-4.8",name:"Anthropic: Claude Opus 4.8",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{forceAdaptiveThinking:!0,supportsTemperature:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-5":{id:"anthropic/claude-opus-5",name:"Anthropic: Claude Opus 5",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{forceAdaptiveThinking:!0,supportsTemperature:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-5.5":{id:"anthropic/claude-opus-5.5",name:"Anthropic: Claude Opus 5.5",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:4,output:20,cacheRead:.2,cacheWrite:5},contextWindow:1e6,maxTokens:128e3,compat:{supportsMidConvoEffort:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-4":{id:"anthropic/claude-sonnet-4",name:"Anthropic: Claude Sonnet 4",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-4.5":{id:"anthropic/claude-sonnet-4.5",name:"Anthropic: Claude Sonnet 4.5",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-4.6":{id:"anthropic/claude-sonnet-4.6",name:"Anthropic: Claude Sonnet 4.6",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:128e3,compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-5":{id:"anthropic/claude-sonnet-5",name:"Anthropic: Claude Sonnet 5",api:"anthropic-messages",baseUrl:"https://openrouter.ai/api",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128e3,compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}},"openai-completions":{"aion-labs/aion-2.0":{id:"aion-labs/aion-2.0",name:"AionLabs: Aion-2.0",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.8,output:1.6,cacheRead:.2,cacheWrite:0},contextWindow:1048576,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"aion-labs/aion-3.0":{id:"aion-labs/aion-3.0",name:"AionLabs: Aion-3.0",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:3,output:6,cacheRead:.75,cacheWrite:0},contextWindow:1048576,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"aion-labs/aion-3.0-mini":{id:"aion-labs/aion-3.0-mini",name:"AionLabs: Aion-3.0-Mini",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.7,output:1.4,cacheRead:.18,cacheWrite:0},contextWindow:1048576,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"amazon/nova-2-lite-v1":{id:"amazon/nova-2-lite-v1",name:"Amazon: Nova 2 Lite",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.3,output:2.5,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65535,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"amazon/nova-lite-v1":{id:"amazon/nova-lite-v1",name:"Amazon: Nova Lite 1.0",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.06,output:.24,cacheRead:0,cacheWrite:0},contextWindow:3e5,maxTokens:5120,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"amazon/nova-micro-v1":{id:"amazon/nova-micro-v1",name:"Amazon: Nova Micro 1.0",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.035,output:.14,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:5120,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"amazon/nova-premier-v1":{id:"amazon/nova-premier-v1",name:"Amazon: Nova Premier 1.0",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:2.5,output:12.5,cacheRead:.625,cacheWrite:0},contextWindow:1e6,maxTokens:32e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"amazon/nova-pro-v1":{id:"amazon/nova-pro-v1",name:"Amazon: Nova Pro 1.0",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.8,output:3.2,cacheRead:0,cacheWrite:0},contextWindow:3e5,maxTokens:5120,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-fable-5.1:batch":{id:"anthropic/claude-fable-5.1:batch",name:"Anthropic: Claude Fable 5.1 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:5,output:25,cacheRead:.125,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-fable-5:batch":{id:"anthropic/claude-fable-5:batch",name:"Anthropic: Claude Fable 5 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-haiku-4.5:batch":{id:"anthropic/claude-haiku-4.5:batch",name:"Anthropic: Claude Haiku 4.5 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.5,output:2.5,cacheRead:.05,cacheWrite:.625},contextWindow:2e5,maxTokens:64e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.1:batch":{id:"anthropic/claude-opus-4.1:batch",name:"Anthropic: Claude Opus 4.1 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:7.5,output:37.5,cacheRead:.75,cacheWrite:9.375},contextWindow:2e5,maxTokens:32e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.5:batch":{id:"anthropic/claude-opus-4.5:batch",name:"Anthropic: Claude Opus 4.5 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:2.5,output:12.5,cacheRead:.25,cacheWrite:3.125},contextWindow:2e5,maxTokens:64e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.6:batch":{id:"anthropic/claude-opus-4.6:batch",name:"Anthropic: Claude Opus 4.6 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:2.5,output:12.5,cacheRead:.25,cacheWrite:3.125},contextWindow:1e6,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.7:batch":{id:"anthropic/claude-opus-4.7:batch",name:"Anthropic: Claude Opus 4.7 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2.5,output:12.5,cacheRead:.25,cacheWrite:3.125},contextWindow:1e6,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.8:batch":{id:"anthropic/claude-opus-4.8:batch",name:"Anthropic: Claude Opus 4.8 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2.5,output:12.5,cacheRead:.25,cacheWrite:3.125},contextWindow:1e6,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-5.5:batch":{id:"anthropic/claude-opus-5.5:batch",name:"Anthropic: Claude Opus 5.5 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:10,cacheRead:.1,cacheWrite:2.5},contextWindow:1e6,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-5:batch":{id:"anthropic/claude-opus-5:batch",name:"Anthropic: Claude Opus 5 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2.5,output:12.5,cacheRead:.25,cacheWrite:3.125},contextWindow:1e6,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-4.5:batch":{id:"anthropic/claude-sonnet-4.5:batch",name:"Anthropic: Claude Sonnet 4.5 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:1.5,output:7.5,cacheRead:.15,cacheWrite:1.875},contextWindow:1e6,maxTokens:64e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-4.6:batch":{id:"anthropic/claude-sonnet-4.6:batch",name:"Anthropic: Claude Sonnet 4.6 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:1.5,output:7.5,cacheRead:.15,cacheWrite:1.875},contextWindow:1e6,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-5:batch":{id:"anthropic/claude-sonnet-5:batch",name:"Anthropic: Claude Sonnet 5 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:1e6,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"arcee-ai/trinity-large-thinking":{id:"arcee-ai/trinity-large-thinking",name:"Arcee AI: Trinity Large Thinking",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.25,output:.8,cacheRead:.06,cacheWrite:0},contextWindow:262144,maxTokens:8e4,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},auto:{id:"auto",name:"Auto",api:"openai-completions",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:2e6,maxTokens:3e4,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"bytedance-seed/seed-1.6":{id:"bytedance-seed/seed-1.6",name:"ByteDance Seed: Seed 1.6",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.25,output:2,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"bytedance-seed/seed-1.6-flash":{id:"bytedance-seed/seed-1.6-flash",name:"ByteDance Seed: Seed 1.6 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.075,output:.3,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"bytedance-seed/seed-2-1-turbo":{id:"bytedance-seed/seed-2-1-turbo",name:"ByteDance Seed: Seed 2.1 Turbo",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.5,output:2.5,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"bytedance-seed/seed-2.0-code":{id:"bytedance-seed/seed-2.0-code",name:"ByteDance Seed: Seed-2.0-Code",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.5,output:3,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"bytedance-seed/seed-2.0-lite":{id:"bytedance-seed/seed-2.0-lite",name:"ByteDance Seed: Seed-2.0-Lite",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:2,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"bytedance-seed/seed-2.0-mini":{id:"bytedance-seed/seed-2.0-mini",name:"ByteDance Seed: Seed-2.0-Mini",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.1,output:.4,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"cohere/command-r-08-2024":{id:"cohere/command-r-08-2024",name:"Cohere: Command R (08-2024)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.15,output:.6,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"cohere/command-r-plus-08-2024":{id:"cohere/command-r-plus-08-2024",name:"Cohere: Command R+ (08-2024)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"cohere/north-mini-code:free":{id:"cohere/north-mini-code:free",name:"Cohere: North Mini Code (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:64e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"deepseek/deepseek-chat":{id:"deepseek/deepseek-chat",name:"DeepSeek: DeepSeek V3",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.32,output:.89,cacheRead:0,cacheWrite:0},contextWindow:163840,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"deepseek/deepseek-chat-v3-0324":{id:"deepseek/deepseek-chat-v3-0324",name:"DeepSeek: DeepSeek V3 0324",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.25,output:1,cacheRead:0,cacheWrite:0},contextWindow:163840,maxTokens:147456,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"deepseek/deepseek-chat-v3.1":{id:"deepseek/deepseek-chat-v3.1",name:"DeepSeek: DeepSeek V3.1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.25,output:.95,cacheRead:.13,cacheWrite:0},contextWindow:163840,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"deepseek/deepseek-r1":{id:"deepseek/deepseek-r1",name:"DeepSeek: R1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.7,output:2.5,cacheRead:0,cacheWrite:0},contextWindow:64e3,maxTokens:16e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"deepseek/deepseek-r1-0528":{id:"deepseek/deepseek-r1-0528",name:"DeepSeek: R1 0528",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.5,output:2.15,cacheRead:.35,cacheWrite:0},contextWindow:163840,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"deepseek/deepseek-v3.1-terminus":{id:"deepseek/deepseek-v3.1-terminus",name:"DeepSeek: DeepSeek V3.1 Terminus",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.27,output:1,cacheRead:.135,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"deepseek/deepseek-v3.2":{id:"deepseek/deepseek-v3.2",name:"DeepSeek: DeepSeek V3.2",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.269,output:.4,cacheRead:.1345,cacheWrite:0},contextWindow:163840,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"deepseek/deepseek-v3.2-exp":{id:"deepseek/deepseek-v3.2-exp",name:"DeepSeek: DeepSeek V3.2 Exp",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.27,output:.41,cacheRead:0,cacheWrite:0},contextWindow:163840,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"deepseek/deepseek-v4-flash":{id:"deepseek/deepseek-v4-flash",name:"DeepSeek: DeepSeek V4 Flash 0423",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:"xhigh",max:null},input:["text"],cost:{input:.049,output:.098,cacheRead:.0098,cacheWrite:0},contextWindow:1024e3,maxTokens:384e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0}},"deepseek/deepseek-v4-flash-0731":{id:"deepseek/deepseek-v4-flash-0731",name:"DeepSeek: DeepSeek V4 Flash 0731",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:.04,output:.64,cacheRead:.016,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0}},"deepseek/deepseek-v4-flash-vision-exp":{id:"deepseek/deepseek-v4-flash-vision-exp",name:"DeepSeek: DeepSeek V4 Flash Vision Exp",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.22,output:.66,cacheRead:.007,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"deepseek/deepseek-v4-pro":{id:"deepseek/deepseek-v4-pro",name:"DeepSeek: DeepSeek V4 Pro 0423",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:"xhigh",max:null},input:["text"],cost:{input:.895578,output:1.791156,cacheRead:.074632,cacheWrite:0},contextWindow:1024e3,maxTokens:384e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0}},"deepseek/deepseek-v4-pro-0813":{id:"deepseek/deepseek-v4-pro-0813",name:"DeepSeek: DeepSeek V4 Pro 0813",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:.66,output:1.98,cacheRead:.022,cacheWrite:0},contextWindow:1048576,maxTokens:384e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0}},"deepseek/deepseek-v4.1-flash":{id:"deepseek/deepseek-v4.1-flash",name:"DeepSeek: DeepSeek V4.1 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.15,output:.6,cacheRead:.003,cacheWrite:0},contextWindow:1048576,maxTokens:384e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"deepseek/deepseek-v4.1-flash:batch":{id:"deepseek/deepseek-v4.1-flash:batch",name:"DeepSeek: DeepSeek V4.1 Flash (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.112,output:.336,cacheRead:.00336,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"dots-studio/dots-3-note-preview:free":{id:"dots-studio/dots-3-note-preview:free",name:"Dots Studio: Dots3-Note Preview (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:512e3,maxTokens:460800,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-2.5-flash":{id:"google/gemini-2.5-flash",name:"Google: Gemini 2.5 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.3,output:2.5,cacheRead:.03,cacheWrite:.083333},contextWindow:1048576,maxTokens:65535,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-2.5-flash-lite":{id:"google/gemini-2.5-flash-lite",name:"Google: Gemini 2.5 Flash Lite",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.1,output:.4,cacheRead:.01,cacheWrite:.083333},contextWindow:1048576,maxTokens:65535,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-2.5-flash-lite:batch":{id:"google/gemini-2.5-flash-lite:batch",name:"Google: Gemini 2.5 Flash Lite (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.05,output:.2,cacheRead:.01,cacheWrite:0},contextWindow:1048576,maxTokens:65535,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-2.5-flash:batch":{id:"google/gemini-2.5-flash:batch",name:"Google: Gemini 2.5 Flash (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.15,output:1.25,cacheRead:.03,cacheWrite:0},contextWindow:1048576,maxTokens:65535,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-2.5-pro":{id:"google/gemini-2.5-pro",name:"Google: Gemini 2.5 Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:.375},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-2.5-pro-preview":{id:"google/gemini-2.5-pro-preview",name:"Google: Gemini 2.5 Pro Preview 06-05",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:.375},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-2.5-pro:batch":{id:"google/gemini-2.5-pro:batch",name:"Google: Gemini 2.5 Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text","image"],cost:{input:.625,output:5,cacheRead:.125,cacheWrite:0},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3-flash-preview":{id:"google/gemini-3-flash-preview",name:"Google: Gemini 3 Flash Preview",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.5,output:3,cacheRead:.05,cacheWrite:.083333},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3-flash-preview:batch":{id:"google/gemini-3-flash-preview:batch",name:"Google: Gemini 3 Flash Preview (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:1.5,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3-pro-image":{id:"google/gemini-3-pro-image",name:"Google: Nano Banana Pro (Gemini 3 Pro Image)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:.375},contextWindow:65536,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.1-flash-lite":{id:"google/gemini-3.1-flash-lite",name:"Google: Gemini 3.1 Flash Lite",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:1.5,cacheRead:.025,cacheWrite:.083333},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.1-flash-lite-preview":{id:"google/gemini-3.1-flash-lite-preview",name:"Google: Gemini 3.1 Flash Lite Preview",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:1.5,cacheRead:.025,cacheWrite:.083333},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.1-flash-lite:batch":{id:"google/gemini-3.1-flash-lite:batch",name:"Google: Gemini 3.1 Flash Lite (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.125,output:.75,cacheRead:.0125,cacheWrite:0},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.1-pro-preview":{id:"google/gemini-3.1-pro-preview",name:"Google: Gemini 3.1 Pro Preview",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:.375},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.1-pro-preview-customtools":{id:"google/gemini-3.1-pro-preview-customtools",name:"Google: Gemini 3.1 Pro Preview Custom Tools",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:.375},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.1-pro-preview:batch":{id:"google/gemini-3.1-pro-preview:batch",name:"Google: Gemini 3.1 Pro Preview (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1,output:6,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.5-flash":{id:"google/gemini-3.5-flash",name:"Google: Gemini 3.5 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.5,output:9,cacheRead:.15,cacheWrite:.083333},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.5-flash-lite":{id:"google/gemini-3.5-flash-lite",name:"Google: Gemini 3.5 Flash Lite",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.3,output:2.5,cacheRead:.03,cacheWrite:.083333},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.5-flash-lite:batch":{id:"google/gemini-3.5-flash-lite:batch",name:"Google: Gemini 3.5 Flash Lite (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.15,output:1.25,cacheRead:.015,cacheWrite:0},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.5-flash:batch":{id:"google/gemini-3.5-flash:batch",name:"Google: Gemini 3.5 Flash (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.6-flash":{id:"google/gemini-3.6-flash",name:"Google: Gemini 3.6 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:.041667},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.6-flash:batch":{id:"google/gemini-3.6-flash:batch",name:"Google: Gemini 3.6 Flash (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.375,output:1.875,cacheRead:.0375,cacheWrite:.041667},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.7-flash":{id:"google/gemini-3.7-flash",name:"Google: Gemini 3.7 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:.041667},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.7-flash:batch":{id:"google/gemini-3.7-flash:batch",name:"Google: Gemini 3.7 Flash (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.375,output:1.875,cacheRead:.0375,cacheWrite:.041667},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.8-flash":{id:"google/gemini-3.8-flash",name:"Google: Gemini 3.8 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:.041667},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.8-flash:batch":{id:"google/gemini-3.8-flash:batch",name:"Google: Gemini 3.8 Flash (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.375,output:1.875,cacheRead:.0375,cacheWrite:.041667},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-3-12b-it":{id:"google/gemma-3-12b-it",name:"Google: Gemma 3 12B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.05,output:.15,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-3-27b-it":{id:"google/gemma-3-27b-it",name:"Google: Gemma 3 27B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.08,output:.45,cacheRead:.04,cacheWrite:0},contextWindow:131072,maxTokens:117964,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-4-26b-a4b-it":{id:"google/gemma-4-26b-a4b-it",name:"Google: Gemma 4 26B A4B ",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.09,output:.3,cacheRead:.05,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-4-26b-a4b-it:free":{id:"google/gemma-4-26b-a4b-it:free",name:"Google: Gemma 4 26B A4B (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-4-31b-it":{id:"google/gemma-4-31b-it",name:"Google: Gemma 4 31B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.09,output:.34,cacheRead:.05,cacheWrite:0},contextWindow:262144,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-4-31b-it:free":{id:"google/gemma-4-31b-it:free",name:"Google: Gemma 4 31B (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"ibm-granite/granite-4.2-8b":{id:"ibm-granite/granite-4.2-8b",name:"IBM: Granite 4.2 8B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:null},input:["text"],cost:{input:.06,output:.25,cacheRead:.015,cacheWrite:0},contextWindow:131072,maxTokens:117964,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"inception/mercury-2":{id:"inception/mercury-2",name:"Inception: Mercury 2",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text"],cost:{input:.25,output:.75,cacheRead:.025,cacheWrite:0},contextWindow:128e3,maxTokens:5e4,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"inception/mercury-2.5":{id:"inception/mercury-2.5",name:"Inception: Mercury 2.5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text"],cost:{input:.04,output:.15,cacheRead:.004,cacheWrite:0},contextWindow:26e4,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"inclusionai/ling-3.0-flash":{id:"inclusionai/ling-3.0-flash",name:"inclusionAI: Ling 3.0 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.021,output:.063,cacheRead:.0042,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"inclusionai/ling-3.0-flash-fin":{id:"inclusionai/ling-3.0-flash-fin",name:"inclusionAI: Ling 3.0 Flash Fin",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.06,output:.18,cacheRead:.012,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"inclusionai/ling-3.0-flash-fin:free":{id:"inclusionai/ling-3.0-flash-fin:free",name:"inclusionAI: Ling 3.0 Flash Fin (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"inclusionai/ling-3.0-flash-sante:free":{id:"inclusionai/ling-3.0-flash-sante:free",name:"inclusionAI: Ling 3.0 Flash Sante (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"inclusionai/ling-3.0-flash-vl":{id:"inclusionai/ling-3.0-flash-vl",name:"inclusionAI: Ling 3.0 Flash VL",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.06,output:.18,cacheRead:.012,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"inclusionai/ling-3.0-flash-vl:free":{id:"inclusionai/ling-3.0-flash-vl:free",name:"inclusionAI: Ling 3.0 Flash VL (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kwaipilot/kat-coder-pro-v2.5":{id:"kwaipilot/kat-coder-pro-v2.5",name:"Kwaipilot: KAT-Coder-Pro V2.5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.74,output:2.96,cacheRead:.15,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"liquid/lfm-2.5-2.6b:free":{id:"liquid/lfm-2.5-2.6b:free",name:"LiquidAI: LFM2.5-2.6B (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:65536,maxTokens:8192,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"meituan/longcat-2.0":{id:"meituan/longcat-2.0",name:"Meituan: LongCat 2.0",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.3,output:1.2,cacheRead:.006,cacheWrite:0},contextWindow:1048756,maxTokens:262144,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"meta-llama/llama-3.1-70b-instruct":{id:"meta-llama/llama-3.1-70b-instruct",name:"Meta: Llama 3.1 70B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.4,output:.4,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"meta-llama/llama-3.1-8b-instruct":{id:"meta-llama/llama-3.1-8b-instruct",name:"Meta: Llama 3.1 8B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.05,output:.08,cacheRead:.025,cacheWrite:0},contextWindow:131072,maxTokens:117964,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"meta-llama/llama-3.3-70b-instruct":{id:"meta-llama/llama-3.3-70b-instruct",name:"Meta: Llama 3.3 70B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.1,output:.32,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"meta-llama/llama-4-maverick":{id:"meta-llama/llama-4-maverick",name:"Meta: Llama 4 Maverick",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.1875,output:.6525,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta-llama/llama-4-scout":{id:"meta-llama/llama-4-scout",name:"Meta: Llama 4 Scout",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.1,output:.3,cacheRead:0,cacheWrite:0},contextWindow:327680,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-glimmer-30b":{id:"meta/muse-glimmer-30b",name:"Meta: Muse Glimmer 30B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.04,cacheWrite:0},contextWindow:131072,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-spark-1.1":{id:"meta/muse-spark-1.1",name:"Meta: Muse Spark 1.1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-spark-1.2":{id:"meta/muse-spark-1.2",name:"Meta: Muse Spark 1.2",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-spark-1.2-contributor":{id:"meta/muse-spark-1.2-contributor",name:"Meta: Muse Spark 1.2 Contributor",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:.1,output:.2,cacheRead:.002,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-spark-1.3":{id:"meta/muse-spark-1.3",name:"Meta: Muse Spark 1.3",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-spark-1.3-contributor":{id:"meta/muse-spark-1.3-contributor",name:"Meta: Muse Spark 1.3 Contributor",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.1,output:.2,cacheRead:.002,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"minimax/minimax-m1":{id:"minimax/minimax-m1",name:"MiniMax: MiniMax M1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.4,output:2.2,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:4e4,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"minimax/minimax-m2":{id:"minimax/minimax-m2",name:"MiniMax: MiniMax M2",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.255,output:1.02,cacheRead:0,cacheWrite:0},contextWindow:204800,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"minimax/minimax-m2.1":{id:"minimax/minimax-m2.1",name:"MiniMax: MiniMax M2.1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.3,output:1.2,cacheRead:.03,cacheWrite:0},contextWindow:204800,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"minimax/minimax-m2.5":{id:"minimax/minimax-m2.5",name:"MiniMax: MiniMax M2.5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.27,output:1.08,cacheRead:.027,cacheWrite:0},contextWindow:2e5,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"minimax/minimax-m2.7":{id:"minimax/minimax-m2.7",name:"MiniMax: MiniMax M2.7",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},contextWindow:204800,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"minimax/minimax-m3":{id:"minimax/minimax-m3",name:"MiniMax: MiniMax M3",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},contextWindow:524288,maxTokens:512e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/codestral-2508":{id:"mistralai/codestral-2508",name:"Mistral: Codestral 2508",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.3,output:.9,cacheRead:.03,cacheWrite:0},contextWindow:256e3,maxTokens:204800,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"mistralai/codestral-2508:batch":{id:"mistralai/codestral-2508:batch",name:"Mistral: Codestral 2508 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.15,output:.45,cacheRead:.015,cacheWrite:0},contextWindow:256e3,maxTokens:204800,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"mistralai/devstral-2512":{id:"mistralai/devstral-2512",name:"Mistral: Devstral 2 2512",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.4,output:2,cacheRead:.04,cacheWrite:0},contextWindow:262144,maxTokens:209715,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"mistralai/ministral-14b-2512":{id:"mistralai/ministral-14b-2512",name:"Mistral: Ministral 3 14B 2512",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.2,output:.2,cacheRead:.02,cacheWrite:0},contextWindow:262144,maxTokens:209715,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/ministral-3b-2512":{id:"mistralai/ministral-3b-2512",name:"Mistral: Ministral 3 3B 2512",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.1,output:.1,cacheRead:.01,cacheWrite:0},contextWindow:131072,maxTokens:104857,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/ministral-8b-2512":{id:"mistralai/ministral-8b-2512",name:"Mistral: Ministral 3 8B 2512",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.15,output:.15,cacheRead:.015,cacheWrite:0},contextWindow:262144,maxTokens:209715,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/ministral-8b-2512:batch":{id:"mistralai/ministral-8b-2512:batch",name:"Mistral: Ministral 3 8B 2512 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.075,output:.075,cacheRead:.0075,cacheWrite:0},contextWindow:262144,maxTokens:209715,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-large":{id:"mistralai/mistral-large",name:"Mistral Large",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:2,output:6,cacheRead:.2,cacheWrite:0},contextWindow:128e3,maxTokens:102400,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"mistralai/mistral-large-2407":{id:"mistralai/mistral-large-2407",name:"Mistral Large 2407",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:2,output:6,cacheRead:.2,cacheWrite:0},contextWindow:131072,maxTokens:104857,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"mistralai/mistral-large-2512:batch":{id:"mistralai/mistral-large-2512:batch",name:"Mistral: Mistral Large 3 2512 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.25,output:.75,cacheRead:.025,cacheWrite:0},contextWindow:262144,maxTokens:209715,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-medium-3":{id:"mistralai/mistral-medium-3",name:"Mistral: Mistral Medium 3",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.4,output:2,cacheRead:.04,cacheWrite:0},contextWindow:131072,maxTokens:104857,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-medium-3-5":{id:"mistralai/mistral-medium-3-5",name:"Mistral: Mistral Medium 3.5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.5,output:7.5,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:209715,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-medium-3-5:batch":{id:"mistralai/mistral-medium-3-5:batch",name:"Mistral: Mistral Medium 3.5 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:209715,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-medium-3.1":{id:"mistralai/mistral-medium-3.1",name:"Mistral: Mistral Medium 3.1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.4,output:2,cacheRead:.04,cacheWrite:0},contextWindow:131072,maxTokens:104857,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-medium-3.1:batch":{id:"mistralai/mistral-medium-3.1:batch",name:"Mistral: Mistral Medium 3.1 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.2,output:1,cacheRead:.02,cacheWrite:0},contextWindow:131072,maxTokens:104857,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-nemo":{id:"mistralai/mistral-nemo",name:"Mistral: Mistral Nemo",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.019,output:.03,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"mistralai/mistral-saba":{id:"mistralai/mistral-saba",name:"Mistral: Saba",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.2,output:.6,cacheRead:.02,cacheWrite:0},contextWindow:32768,maxTokens:26214,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"mistralai/mistral-small-2603":{id:"mistralai/mistral-small-2603",name:"Mistral: Mistral Small 4",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.15,output:.6,cacheRead:.015,cacheWrite:0},contextWindow:262144,maxTokens:209715,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-small-2603:batch":{id:"mistralai/mistral-small-2603:batch",name:"Mistral: Mistral Small 4 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.075,output:.3,cacheRead:.0075,cacheWrite:0},contextWindow:262144,maxTokens:209715,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-small-3.1-24b-instruct":{id:"mistralai/mistral-small-3.1-24b-instruct",name:"Mistral: Mistral Small 3.1 24B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.351,output:.555,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:102400,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mistral-small-3.2-24b-instruct":{id:"mistralai/mistral-small-3.2-24b-instruct",name:"Mistral: Mistral Small 3.2 24B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.09375,output:.25,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistralai/mixtral-8x22b-instruct":{id:"mistralai/mixtral-8x22b-instruct",name:"Mistral: Mixtral 8x22B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:2,output:6,cacheRead:.2,cacheWrite:0},contextWindow:65536,maxTokens:52428,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"mistralai/voxtral-small-24b-2507":{id:"mistralai/voxtral-small-24b-2507",name:"Mistral: Voxtral Small 24B 2507",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.1,output:.3,cacheRead:.01,cacheWrite:0},contextWindow:32768,maxTokens:26214,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"moonshotai/kimi-k2":{id:"moonshotai/kimi-k2",name:"MoonshotAI: Kimi K2 0711",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.57,output:2.3,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:98304,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"moonshotai/kimi-k2-0905":{id:"moonshotai/kimi-k2-0905",name:"MoonshotAI: Kimi K2 0905",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.6,output:2.5,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:98304,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"moonshotai/kimi-k2-thinking":{id:"moonshotai/kimi-k2-thinking",name:"MoonshotAI: Kimi K2 Thinking",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.6,output:2.5,cacheRead:.15,cacheWrite:0},contextWindow:262144,maxTokens:98304,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"moonshotai/kimi-k2.5":{id:"moonshotai/kimi-k2.5",name:"MoonshotAI: Kimi K2.5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.41,output:2.06,cacheRead:.07,cacheWrite:0},contextWindow:262144,maxTokens:4096,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/kimi-k2.6":{id:"moonshotai/kimi-k2.6",name:"MoonshotAI: Kimi K2.6",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/kimi-k2.7-code":{id:"moonshotai/kimi-k2.7-code",name:"MoonshotAI: Kimi K2.7 Code",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text","image"],cost:{input:.7062,output:3.3,cacheRead:.18,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/kimi-k3":{id:"moonshotai/kimi-k3",name:"MoonshotAI: Kimi K3",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/kimi-k3:batch":{id:"moonshotai/kimi-k3:batch",name:"MoonshotAI: Kimi K3 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:2.28,output:11.4,cacheRead:.228,cacheWrite:0},contextWindow:1048576,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nex-agi/nex-n2.5-mini:free":{id:"nex-agi/nex-n2.5-mini:free",name:"Nex AGI: Nex-N2.5-Mini (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nex-agi/nex-n2.5-pro":{id:"nex-agi/nex-n2.5-pro",name:"Nex AGI: Nex-N2.5-Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.075,output:.25,cacheRead:.015,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nex-agi/nex-n2.5-pro:free":{id:"nex-agi/nex-n2.5-pro:free",name:"Nex AGI: Nex-N2.5-Pro (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia/nemotron-3-nano-30b-a3b":{id:"nvidia/nemotron-3-nano-30b-a3b",name:"NVIDIA: Nemotron 3 Nano 30B A3B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.05,output:.2,cacheRead:.03,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free":{id:"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free",name:"NVIDIA: Nemotron 3 Nano Omni (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia/nemotron-3-super-120b-a12b":{id:"nvidia/nemotron-3-super-120b-a12b",name:"NVIDIA: Nemotron 3 Super",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:null,xhigh:null,max:null},input:["text"],cost:{input:.08,output:.45,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"nvidia/nemotron-3-super-120b-a12b:free":{id:"nvidia/nemotron-3-super-120b-a12b:free",name:"NVIDIA: Nemotron 3 Super (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:null,xhigh:null,max:null},input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"nvidia/nemotron-3-ultra-550b-a55b":{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"NVIDIA: Nemotron 3 Ultra",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:"medium",high:"high",xhigh:null,max:null},input:["text"],cost:{input:.6,output:2.4,cacheRead:.12,cacheWrite:0},contextWindow:202800,maxTokens:182520,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"nvidia/nemotron-3-ultra-550b-a55b:free":{id:"nvidia/nemotron-3-ultra-550b-a55b:free",name:"NVIDIA: Nemotron 3 Ultra (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:"medium",high:"high",xhigh:null,max:null},input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"nvidia/nemotron-3.5-lightning":{id:"nvidia/nemotron-3.5-lightning",name:"NVIDIA: Nemotron 3.5 Lightning",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.07,output:.2,cacheRead:.04,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"nvidia/nemotron-3.5-lightning:free":{id:"nvidia/nemotron-3.5-lightning:free",name:"NVIDIA: Nemotron 3.5 Lightning (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-3.5-turbo":{id:"openai/gpt-3.5-turbo",name:"OpenAI: GPT-3.5 Turbo",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.5,output:1.5,cacheRead:0,cacheWrite:0},contextWindow:16385,maxTokens:4096,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-3.5-turbo-0613":{id:"openai/gpt-3.5-turbo-0613",name:"OpenAI: GPT-3.5 Turbo (older v0613)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:1,output:2,cacheRead:0,cacheWrite:0},contextWindow:4095,maxTokens:3685,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-3.5-turbo-16k":{id:"openai/gpt-3.5-turbo-16k",name:"OpenAI: GPT-3.5 Turbo 16k",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:3,output:4,cacheRead:0,cacheWrite:0},contextWindow:16385,maxTokens:4096,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-3.5-turbo:batch":{id:"openai/gpt-3.5-turbo:batch",name:"OpenAI: GPT-3.5 Turbo (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.25,output:.75,cacheRead:0,cacheWrite:0},contextWindow:16385,maxTokens:4096,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-4":{id:"openai/gpt-4",name:"OpenAI: GPT-4",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:30,output:60,cacheRead:0,cacheWrite:0},contextWindow:8191,maxTokens:4096,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-4-turbo":{id:"openai/gpt-4-turbo",name:"OpenAI: GPT-4 Turbo",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:10,output:30,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4-turbo:batch":{id:"openai/gpt-4-turbo:batch",name:"OpenAI: GPT-4 Turbo (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:5,output:15,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1":{id:"openai/gpt-4.1",name:"OpenAI: GPT-4.1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1-mini":{id:"openai/gpt-4.1-mini",name:"OpenAI: GPT-4.1 Mini",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.4,output:1.6,cacheRead:.1,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1-mini:batch":{id:"openai/gpt-4.1-mini:batch",name:"OpenAI: GPT-4.1 Mini (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.2,output:.8,cacheRead:.05,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1-nano":{id:"openai/gpt-4.1-nano",name:"OpenAI: GPT-4.1 Nano",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.1,output:.4,cacheRead:.025,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1-nano:batch":{id:"openai/gpt-4.1-nano:batch",name:"OpenAI: GPT-4.1 Nano (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.05,output:.2,cacheRead:.0125,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1:batch":{id:"openai/gpt-4.1:batch",name:"OpenAI: GPT-4.1 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:1,output:4,cacheRead:.25,cacheWrite:0},contextWindow:1047576,maxTokens:32768,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o":{id:"openai/gpt-4o",name:"OpenAI: GPT-4o",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o-2024-05-13":{id:"openai/gpt-4o-2024-05-13",name:"OpenAI: GPT-4o (2024-05-13)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:5,output:15,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o-2024-08-06":{id:"openai/gpt-4o-2024-08-06",name:"OpenAI: GPT-4o (2024-08-06)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o-2024-11-20":{id:"openai/gpt-4o-2024-11-20",name:"OpenAI: GPT-4o (2024-11-20)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o-mini":{id:"openai/gpt-4o-mini",name:"OpenAI: GPT-4o-mini",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.15,output:.6,cacheRead:.075,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o-mini-2024-07-18":{id:"openai/gpt-4o-mini-2024-07-18",name:"OpenAI: GPT-4o-mini (2024-07-18)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.15,output:.6,cacheRead:.075,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o-mini:batch":{id:"openai/gpt-4o-mini:batch",name:"OpenAI: GPT-4o-mini (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.075,output:.3,cacheRead:.0375,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o:batch":{id:"openai/gpt-4o:batch",name:"OpenAI: GPT-4o (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:1.25,output:5,cacheRead:.625,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5":{id:"openai/gpt-5",name:"OpenAI: GPT-5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-mini":{id:"openai/gpt-5-mini",name:"OpenAI: GPT-5 Mini",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:2,cacheRead:.025,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-mini:batch":{id:"openai/gpt-5-mini:batch",name:"OpenAI: GPT-5 Mini (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.125,output:1,cacheRead:.0125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-nano":{id:"openai/gpt-5-nano",name:"OpenAI: GPT-5 Nano",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.05,output:.4,cacheRead:.005,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-nano:batch":{id:"openai/gpt-5-nano:batch",name:"OpenAI: GPT-5 Nano (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.025,output:.2,cacheRead:.0025,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-pro":{id:"openai/gpt-5-pro",name:"OpenAI: GPT-5 Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:15,output:120,cacheRead:0,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-pro:batch":{id:"openai/gpt-5-pro:batch",name:"OpenAI: GPT-5 Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:7.5,output:60,cacheRead:0,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.1":{id:"openai/gpt-5.1",name:"OpenAI: GPT-5.1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.1-codex":{id:"openai/gpt-5.1-codex",name:"OpenAI: GPT-5.1-Codex",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.25,output:10,cacheRead:.13,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.1-codex-max":{id:"openai/gpt-5.1-codex-max",name:"OpenAI: GPT-5.1-Codex-Max",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.1-codex-mini":{id:"openai/gpt-5.1-codex-mini",name:"OpenAI: GPT-5.1-Codex-Mini",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.25,output:2,cacheRead:.03,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.1:batch":{id:"openai/gpt-5.1:batch",name:"OpenAI: GPT-5.1 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.625,output:5,cacheRead:.0625,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.2":{id:"openai/gpt-5.2",name:"OpenAI: GPT-5.2",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.2-chat":{id:"openai/gpt-5.2-chat",name:"OpenAI: GPT-5.2 Chat",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:128e3,maxTokens:32e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.2-codex":{id:"openai/gpt-5.2-codex",name:"OpenAI: GPT-5.2-Codex",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.2-pro":{id:"openai/gpt-5.2-pro",name:"OpenAI: GPT-5.2 Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:21,output:168,cacheRead:0,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.2-pro:batch":{id:"openai/gpt-5.2-pro:batch",name:"OpenAI: GPT-5.2 Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:10.5,output:84,cacheRead:0,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.2:batch":{id:"openai/gpt-5.2:batch",name:"OpenAI: GPT-5.2 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:.875,output:7,cacheRead:.0875,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.3-codex":{id:"openai/gpt-5.3-codex",name:"OpenAI: GPT-5.3-Codex",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4":{id:"openai/gpt-5.4",name:"OpenAI: GPT-5.4",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-mini":{id:"openai/gpt-5.4-mini",name:"OpenAI: GPT-5.4 Mini",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-mini:batch":{id:"openai/gpt-5.4-mini:batch",name:"OpenAI: GPT-5.4 Mini (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:.375,output:2.25,cacheRead:.0375,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-nano":{id:"openai/gpt-5.4-nano",name:"OpenAI: GPT-5.4 Nano",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-nano:batch":{id:"openai/gpt-5.4-nano:batch",name:"OpenAI: GPT-5.4 Nano (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:.1,output:.625,cacheRead:.01,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-pro":{id:"openai/gpt-5.4-pro",name:"OpenAI: GPT-5.4 Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:30,output:180,cacheRead:0,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-pro:batch":{id:"openai/gpt-5.4-pro:batch",name:"OpenAI: GPT-5.4 Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:15,output:90,cacheRead:0,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4:batch":{id:"openai/gpt-5.4:batch",name:"OpenAI: GPT-5.4 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:1.25,output:7.5,cacheRead:.125,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.5":{id:"openai/gpt-5.5",name:"OpenAI: GPT-5.5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.5-pro":{id:"openai/gpt-5.5-pro",name:"OpenAI: GPT-5.5 Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:30,output:180,cacheRead:0,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.5-pro:batch":{id:"openai/gpt-5.5-pro:batch",name:"OpenAI: GPT-5.5 Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:15,output:90,cacheRead:0,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.5:batch":{id:"openai/gpt-5.5:batch",name:"OpenAI: GPT-5.5 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-luna":{id:"openai/gpt-5.6-luna",name:"OpenAI: GPT-5.6 Luna",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-luna-pro":{id:"openai/gpt-5.6-luna-pro",name:"OpenAI: GPT-5.6 Luna Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-luna-pro:batch":{id:"openai/gpt-5.6-luna-pro:batch",name:"OpenAI: GPT-5.6 Luna Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.1,output:.6,cacheRead:.01,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-luna:batch":{id:"openai/gpt-5.6-luna:batch",name:"OpenAI: GPT-5.6 Luna (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.1,output:.6,cacheRead:.01,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-sol":{id:"openai/gpt-5.6-sol",name:"OpenAI: GPT-5.6 Sol",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-sol-pro":{id:"openai/gpt-5.6-sol-pro",name:"OpenAI: GPT-5.6 Sol Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-sol-pro:batch":{id:"openai/gpt-5.6-sol-pro:batch",name:"OpenAI: GPT-5.6 Sol Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-sol:batch":{id:"openai/gpt-5.6-sol:batch",name:"OpenAI: GPT-5.6 Sol (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-terra":{id:"openai/gpt-5.6-terra",name:"OpenAI: GPT-5.6 Terra",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-terra-pro":{id:"openai/gpt-5.6-terra-pro",name:"OpenAI: GPT-5.6 Terra Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-terra-pro:batch":{id:"openai/gpt-5.6-terra-pro:batch",name:"OpenAI: GPT-5.6 Terra Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:1,output:6,cacheRead:.1,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-terra:batch":{id:"openai/gpt-5.6-terra:batch",name:"OpenAI: GPT-5.6 Terra (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:1,output:6,cacheRead:.1,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5:batch":{id:"openai/gpt-5:batch",name:"OpenAI: GPT-5 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.625,output:5,cacheRead:.0625,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-astra":{id:"openai/gpt-6-astra",name:"OpenAI: GPT-6 Astra",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-astra-pro":{id:"openai/gpt-6-astra-pro",name:"OpenAI: GPT-6 Astra Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-astra-pro:batch":{id:"openai/gpt-6-astra-pro:batch",name:"OpenAI: GPT-6 Astra Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-astra:batch":{id:"openai/gpt-6-astra:batch",name:"OpenAI: GPT-6 Astra (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-luna":{id:"openai/gpt-6-luna",name:"OpenAI: GPT-6 Luna",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-luna-pro":{id:"openai/gpt-6-luna-pro",name:"OpenAI: GPT-6 Luna Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-luna-pro:batch":{id:"openai/gpt-6-luna-pro:batch",name:"OpenAI: GPT-6 Luna Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.05,output:.25,cacheRead:.005,cacheWrite:.0625},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-luna:batch":{id:"openai/gpt-6-luna:batch",name:"OpenAI: GPT-6 Luna (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.05,output:.25,cacheRead:.005,cacheWrite:.0625},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-sol":{id:"openai/gpt-6-sol",name:"OpenAI: GPT-6 Sol",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-sol-pro":{id:"openai/gpt-6-sol-pro",name:"OpenAI: GPT-6 Sol Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-sol-pro:batch":{id:"openai/gpt-6-sol-pro:batch",name:"OpenAI: GPT-6 Sol Pro (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-sol:batch":{id:"openai/gpt-6-sol:batch",name:"OpenAI: GPT-6 Sol (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:105e4,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-audio":{id:"openai/gpt-audio",name:"OpenAI: GPT Audio",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-audio-mini":{id:"openai/gpt-audio-mini",name:"OpenAI: GPT Audio Mini",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.6,output:2.4,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-chat-latest":{id:"openai/gpt-chat-latest",name:"OpenAI: GPT Chat Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"OpenAI: gpt-oss-120b",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text"],cost:{input:.15,output:.6,cacheRead:.075,cacheWrite:0},contextWindow:131072,maxTokens:65536,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"OpenAI: gpt-oss-20b",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text"],cost:{input:.018,output:.09,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-oss-20b:batch":{id:"openai/gpt-oss-20b:batch",name:"OpenAI: gpt-oss-20b (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text"],cost:{input:.024,output:.112,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:117964,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/gpt-oss-safeguard-20b":{id:"openai/gpt-oss-safeguard-20b",name:"OpenAI: gpt-oss-safeguard-20b",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.075,output:.3,cacheRead:.0375,cacheWrite:0},contextWindow:131072,maxTokens:65536,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/o1":{id:"openai/o1",name:"OpenAI: o1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o3":{id:"openai/o3",name:"OpenAI: o3",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o3-mini":{id:"openai/o3-mini",name:"OpenAI: o3 Mini",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/o3-mini-high":{id:"openai/o3-mini-high",name:"OpenAI: o3 Mini High",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text"],cost:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/o3-mini:batch":{id:"openai/o3-mini:batch",name:"OpenAI: o3 Mini (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.55,output:2.2,cacheRead:.275,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"openai/o3-pro":{id:"openai/o3-pro",name:"OpenAI: o3 Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:20,output:80,cacheRead:0,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o3:batch":{id:"openai/o3:batch",name:"OpenAI: o3 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:1,output:4,cacheRead:.25,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o4-mini":{id:"openai/o4-mini",name:"OpenAI: o4 Mini",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:1.1,output:4.4,cacheRead:.275,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o4-mini-high":{id:"openai/o4-mini-high",name:"OpenAI: o4 Mini High",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.1,output:4.4,cacheRead:.275,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o4-mini:batch":{id:"openai/o4-mini:batch",name:"OpenAI: o4 Mini (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.55,output:2.2,cacheRead:.1375,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,compat:{thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openrouter/auto":{id:"openrouter/auto",name:"Auto Router",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:-1e6,output:-1e6,cacheRead:0,cacheWrite:0},contextWindow:2e6,maxTokens:4096,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openrouter/auto-beta":{id:"openrouter/auto-beta",name:"Auto Router (Beta)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:-1e6,output:-1e6,cacheRead:0,cacheWrite:0},contextWindow:2e6,maxTokens:4096,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openrouter/free":{id:"openrouter/free",name:"Free Models Router",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:2e5,maxTokens:4096,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openrouter/fusion":{id:"openrouter/fusion",name:"OpenRouter: Fusion",api:"openai-completions",provider:"openrouter",baseUrl:"https://openrouter.ai/api/v1",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:3e4,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"poolside/laguna-s-2.1":{id:"poolside/laguna-s-2.1",name:"Poolside: Laguna S 2.1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.09,output:.18,cacheRead:.009,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"poolside/laguna-s-2.1:free":{id:"poolside/laguna-s-2.1:free",name:"Poolside: Laguna S 2.1 (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"poolside/laguna-xs-2.1":{id:"poolside/laguna-xs-2.1",name:"Poolside: Laguna XS 2.1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.06,output:.12,cacheRead:.03,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"poolside/laguna-xs-2.1:free":{id:"poolside/laguna-xs-2.1:free",name:"Poolside: Laguna XS 2.1 (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"prism-ml/ternary-bonsai-2-27b":{id:"prism-ml/ternary-bonsai-2-27b",name:"PrismML: Ternary Bonsai 2 27B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:"medium",high:null,xhigh:"xhigh",max:null},input:["text","image"],cost:{input:.075,output:.5,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen-2.5-72b-instruct":{id:"qwen/qwen-2.5-72b-instruct",name:"Qwen2.5 72B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.36,output:.4,cacheRead:0,cacheWrite:0},contextWindow:32768,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen-2.5-7b-instruct":{id:"qwen/qwen-2.5-7b-instruct",name:"Qwen: Qwen2.5 7B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.1,output:.2,cacheRead:0,cacheWrite:0},contextWindow:32768,maxTokens:29491,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen-plus":{id:"qwen/qwen-plus",name:"Qwen: Qwen-Plus",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.26,output:.78,cacheRead:.052,cacheWrite:.325},contextWindow:1e6,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen-plus-2025-07-28":{id:"qwen/qwen-plus-2025-07-28",name:"Qwen: Qwen Plus 0728",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.26,output:.78,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-14b":{id:"qwen/qwen3-14b",name:"Qwen: Qwen3 14B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.12,output:.24,cacheRead:0,cacheWrite:0},contextWindow:40960,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-235b-a22b":{id:"qwen/qwen3-235b-a22b",name:"Qwen: Qwen3 235B A22B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.455,output:1.82,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:8192,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-235b-a22b-2507":{id:"qwen/qwen3-235b-a22b-2507",name:"Qwen: Qwen3 235B A22B Instruct 2507",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.0875,output:.35,cacheRead:.0175,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-235b-a22b-thinking-2507":{id:"qwen/qwen3-235b-a22b-thinking-2507",name:"Qwen: Qwen3 235B A22B Thinking 2507",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.23,output:2.3,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:117964,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-30b-a3b":{id:"qwen/qwen3-30b-a3b",name:"Qwen: Qwen3 30B A3B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.12,output:.5,cacheRead:0,cacheWrite:0},contextWindow:40960,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-30b-a3b-instruct-2507":{id:"qwen/qwen3-30b-a3b-instruct-2507",name:"Qwen: Qwen3 30B A3B Instruct 2507",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.04815,output:.19305,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:32e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-30b-a3b-thinking-2507":{id:"qwen/qwen3-30b-a3b-thinking-2507",name:"Qwen: Qwen3 30B A3B Thinking 2507",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.2,output:2.4,cacheRead:0,cacheWrite:0},contextWindow:81920,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-32b":{id:"qwen/qwen3-32b",name:"Qwen: Qwen3 32B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.08,output:.28,cacheRead:0,cacheWrite:0},contextWindow:40960,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-8b":{id:"qwen/qwen3-8b",name:"Qwen: Qwen3 8B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.117,output:.455,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:8192,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-coder":{id:"qwen/qwen3-coder",name:"Qwen: Qwen3 Coder 480B A35B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.3,output:1,cacheRead:.1,cacheWrite:0},contextWindow:262144,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-coder-30b-a3b-instruct":{id:"qwen/qwen3-coder-30b-a3b-instruct",name:"Qwen: Qwen3 Coder 30B A3B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.07,output:.28,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-coder-flash":{id:"qwen/qwen3-coder-flash",name:"Qwen: Qwen3 Coder Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.195,output:.975,cacheRead:.039,cacheWrite:.24375},contextWindow:1e6,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-coder-next":{id:"qwen/qwen3-coder-next",name:"Qwen: Qwen3 Coder Next",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.12,output:.8,cacheRead:.07,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-coder-plus":{id:"qwen/qwen3-coder-plus",name:"Qwen: Qwen3 Coder Plus",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.65,output:3.25,cacheRead:.13,cacheWrite:.8125},contextWindow:1e6,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-max":{id:"qwen/qwen3-max",name:"Qwen: Qwen3 Max",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.78,output:3.9,cacheRead:.156,cacheWrite:.975},contextWindow:262144,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-max-thinking":{id:"qwen/qwen3-max-thinking",name:"Qwen: Qwen3 Max Thinking",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.78,output:3.9,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-next-80b-a3b-instruct":{id:"qwen/qwen3-next-80b-a3b-instruct",name:"Qwen: Qwen3 Next 80B A3B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.09,output:1.1,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-next-80b-a3b-thinking":{id:"qwen/qwen3-next-80b-a3b-thinking",name:"Qwen: Qwen3 Next 80B A3B Thinking",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.15,output:1.2,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3-vl-235b-a22b-instruct":{id:"qwen/qwen3-vl-235b-a22b-instruct",name:"Qwen: Qwen3 VL 235B A22B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.21,output:1.9,cacheRead:.1,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3-vl-235b-a22b-thinking":{id:"qwen/qwen3-vl-235b-a22b-thinking",name:"Qwen: Qwen3 VL 235B A22B Thinking",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text","image"],cost:{input:.4,output:4,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3-vl-30b-a3b-instruct":{id:"qwen/qwen3-vl-30b-a3b-instruct",name:"Qwen: Qwen3 VL 30B A3B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.13,output:.52,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3-vl-30b-a3b-thinking":{id:"qwen/qwen3-vl-30b-a3b-thinking",name:"Qwen: Qwen3 VL 30B A3B Thinking",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text","image"],cost:{input:.2,output:2.4,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3-vl-32b-instruct":{id:"qwen/qwen3-vl-32b-instruct",name:"Qwen: Qwen3 VL 32B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.104,output:.416,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3-vl-8b-instruct":{id:"qwen/qwen3-vl-8b-instruct",name:"Qwen: Qwen3 VL 8B Instruct",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.117,output:.455,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3-vl-8b-thinking":{id:"qwen/qwen3-vl-8b-thinking",name:"Qwen: Qwen3 VL 8B Thinking",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text","image"],cost:{input:.18,output:2.1,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.5-122b-a10b":{id:"qwen/qwen3.5-122b-a10b",name:"Qwen: Qwen3.5-122B-A10B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.26,output:2.08,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.5-27b":{id:"qwen/qwen3.5-27b",name:"Qwen: Qwen3.5-27B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.195,output:1.56,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.5-35b-a3b":{id:"qwen/qwen3.5-35b-a3b",name:"Qwen: Qwen3.5-35B-A3B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.3125,output:1.25,cacheRead:.15625,cacheWrite:0},contextWindow:256e3,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.5-397b-a17b":{id:"qwen/qwen3.5-397b-a17b",name:"Qwen: Qwen3.5 397B A17B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.55,output:3.5,cacheRead:.225,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.5-9b":{id:"qwen/qwen3.5-9b",name:"Qwen: Qwen3.5-9B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.1,output:.15,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.5-flash-02-23":{id:"qwen/qwen3.5-flash-02-23",name:"Qwen: Qwen3.5-Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.065,output:.26,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.5-plus-02-15":{id:"qwen/qwen3.5-plus-02-15",name:"Qwen: Qwen3.5 Plus 2026-02-15",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.26,output:1.56,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.5-plus-20260420":{id:"qwen/qwen3.5-plus-20260420",name:"Qwen: Qwen3.5 Plus 2026-04-20",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.3,output:1.8,cacheRead:0,cacheWrite:.375},contextWindow:1e6,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.6-27b":{id:"qwen/qwen3.6-27b",name:"Qwen: Qwen3.6 27B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.32,output:2.7,cacheRead:.15,cacheWrite:0},contextWindow:262144,maxTokens:262140,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.6-35b-a3b":{id:"qwen/qwen3.6-35b-a3b",name:"Qwen: Qwen3.6 35B A3B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.15,output:1,cacheRead:.05,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.6-flash":{id:"qwen/qwen3.6-flash",name:"Qwen: Qwen3.6 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.1875,output:1.125,cacheRead:0,cacheWrite:.234375},contextWindow:1e6,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.6-max-preview":{id:"qwen/qwen3.6-max-preview",name:"Qwen: Qwen3.6 Max Preview",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:1.027,output:6.162,cacheRead:0,cacheWrite:1.28375},contextWindow:262144,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3.6-plus":{id:"qwen/qwen3.6-plus",name:"Qwen: Qwen3.6 Plus",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.325,output:1.95,cacheRead:0,cacheWrite:.40625},contextWindow:1e6,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.7-flash":{id:"qwen/qwen3.7-flash",name:"Qwen: Qwen3.7 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.03,output:.13,cacheRead:.006,cacheWrite:.038},contextWindow:1e6,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.7-max":{id:"qwen/qwen3.7-max",name:"Qwen: Qwen3.7 Max",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:1.475,output:4.425,cacheRead:.295,cacheWrite:1.84375},contextWindow:1e6,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3.7-plus":{id:"qwen/qwen3.7-plus",name:"Qwen: Qwen3.7 Plus",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.32,output:1.28,cacheRead:.064,cacheWrite:.4},contextWindow:1e6,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.8-2.4t-a95b":{id:"qwen/qwen3.8-2.4t-a95b",name:"Qwen: Qwen3.8 2.4T A95B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},input:["text"],cost:{input:2,output:6,cacheRead:.25,cacheWrite:0},contextWindow:1e6,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"qwen/qwen3.8-27b":{id:"qwen/qwen3.8-27b",name:"Qwen: Qwen3.8 27B",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},input:["text","image"],cost:{input:.42,output:3,cacheRead:.085,cacheWrite:0},contextWindow:1e6,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.8-27b:free":{id:"qwen/qwen3.8-27b:free",name:"Qwen: Qwen3.8 27B (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.8-flash":{id:"qwen/qwen3.8-flash",name:"Qwen: Qwen3.8 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.15,output:.47,cacheRead:.016,cacheWrite:.2},contextWindow:1e6,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.8-max-0902":{id:"qwen/qwen3.8-max-0902",name:"Qwen: Qwen3.8 Max (0902)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:2,output:6,cacheRead:.25,cacheWrite:2.5},contextWindow:1e6,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen/qwen3.8-omni-flash":{id:"qwen/qwen3.8-omni-flash",name:"Qwen: Qwen3.8 Omni Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.15,output:.47,cacheRead:.016,cacheWrite:0},contextWindow:1e6,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"rekaai/reka-edge":{id:"rekaai/reka-edge",name:"Reka Edge",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:.1,output:.1,cacheRead:0,cacheWrite:0},contextWindow:16384,maxTokens:14745,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"relace/relace-search":{id:"relace/relace-search",name:"Relace: Relace Search",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:1,output:3,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"sakana/fugu-max":{id:"sakana/fugu-max",name:"Sakana: Fugu Max",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:6,cacheRead:.25,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"sakana/fugu-ultra":{id:"sakana/fugu-ultra",name:"Sakana: Fugu Ultra",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"sakana/fugu-ultra-v2":{id:"sakana/fugu-ultra-v2",name:"Sakana: Fugu Ultra v2",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"sakana/sakana-namazu":{id:"sakana/sakana-namazu",name:"Sakana: Sakana Namazu",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.95,output:4,cacheRead:.15,cacheWrite:0},contextWindow:262144,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"sao10k/l3.1-euryale-70b":{id:"sao10k/l3.1-euryale-70b",name:"Sao10K: Llama 3.1 Euryale 70B v2.2",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text"],cost:{input:.85,output:.85,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"stepfun/step-3.5-flash":{id:"stepfun/step-3.5-flash",name:"StepFun: Step 3.5 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text"],cost:{input:.1,output:.3,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"stepfun/step-3.7-flash":{id:"stepfun/step-3.7-flash",name:"StepFun: Step 3.7 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.2,output:1.15,cacheRead:.04,cacheWrite:0},contextWindow:256e3,maxTokens:230400,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"tencent/hy3":{id:"tencent/hy3",name:"Tencent: Hy3",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:null},input:["text"],cost:{input:.0825,output:.33,cacheRead:.020625,cacheWrite:0},contextWindow:262144,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"tencent/hy3-preview":{id:"tencent/hy3-preview",name:"Tencent: Hy3 preview",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:null},input:["text"],cost:{input:.18,output:.6,cacheRead:.06,cacheWrite:0},contextWindow:262144,maxTokens:235929,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"tencent/hy4-preview":{id:"tencent/hy4-preview",name:"Tencent: Hy4 preview",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:null},input:["text"],cost:{input:.834,output:2.501,cacheRead:.042,cacheWrite:0},contextWindow:1048576,maxTokens:64e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"thinkingmachines/inkling":{id:"thinkingmachines/inkling",name:"Thinking Machines: Inkling",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:1,output:4.05,cacheRead:.17,cacheWrite:0},contextWindow:524288,maxTokens:471859,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"thinkingmachines/inkling-small":{id:"thinkingmachines/inkling-small",name:"Thinking Machines: Inkling Small",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.45,output:1.2,cacheRead:.1,cacheWrite:0},contextWindow:524288,maxTokens:262144,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"thinkingmachines/inkling-small:free":{id:"thinkingmachines/inkling-small:free",name:"Thinking Machines: Inkling Small (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:262144,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"thinkingmachines/inkling:free":{id:"thinkingmachines/inkling:free",name:"Thinking Machines: Inkling (free)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:262144,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"unbiased/pareto":{id:"unbiased/pareto",name:"Pareto",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!1,input:["text","image"],cost:{input:2.5,output:7.5,cacheRead:.25,cacheWrite:0},contextWindow:262144,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"upstage/solar-pro-3":{id:"upstage/solar-pro-3",name:"Upstage: Solar Pro 3",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text"],cost:{input:.15,output:.6,cacheRead:.015,cacheWrite:0},contextWindow:131072,maxTokens:117964,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"upstage/solar-pro4":{id:"upstage/solar-pro4",name:"Upstage: Solar Pro 4",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text"],cost:{input:.09,output:.36,cacheRead:.018,cacheWrite:0},contextWindow:524288,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"x-ai/grok-4.20":{id:"x-ai/grok-4.20",name:"SpaceXAI: Grok 4.20",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0},contextWindow:2e6,maxTokens:18e5,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"x-ai/grok-4.3":{id:"x-ai/grok-4.3",name:"SpaceXAI: Grok 4.3",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0},contextWindow:1e6,maxTokens:9e5,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"x-ai/grok-4.3:batch":{id:"x-ai/grok-4.3:batch",name:"SpaceXAI: Grok 4.3 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:1,output:2,cacheRead:.16,cacheWrite:0},contextWindow:1e6,maxTokens:9e5,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"x-ai/grok-4.5":{id:"x-ai/grok-4.5",name:"SpaceXAI: Grok 4.5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:2,output:6,cacheRead:.3,cacheWrite:0},contextWindow:5e5,maxTokens:45e4,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"x-ai/grok-4.6":{id:"x-ai/grok-4.6",name:"SpaceXAI: Grok 4.6",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0},contextWindow:5e5,maxTokens:45e4,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"x-ai/grok-4.7":{id:"x-ai/grok-4.7",name:"SpaceXAI: Grok 4.7",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:1.6,output:4.8,cacheRead:.4,cacheWrite:0},contextWindow:5e5,maxTokens:45e4,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"x-ai/grok-build-0.1":{id:"x-ai/grok-build-0.1",name:"SpaceXAI: Grok Build 0.1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null},input:["text","image"],cost:{input:1,output:2,cacheRead:.2,cacheWrite:0},contextWindow:256e3,maxTokens:230400,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"xiaomi/mimo-v2.5":{id:"xiaomi/mimo-v2.5",name:"Xiaomi: MiMo-V2.5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.14,output:.28,cacheRead:.0028,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"xiaomi/mimo-v2.5-pro":{id:"xiaomi/mimo-v2.5-pro",name:"Xiaomi: MiMo-V2.5-Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.435,output:.87,cacheRead:.0036,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"xiaomi/mimo-v2.6-flash":{id:"xiaomi/mimo-v2.6-flash",name:"Xiaomi: MiMo-V2.6-Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.14,output:.28,cacheRead:.0028,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"xiaomi/mimo-v2.6-pro":{id:"xiaomi/mimo-v2.6-pro",name:"Xiaomi: MiMo-V2.6-Pro",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.435,output:.87,cacheRead:.0036,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"xiaomi/mimo-v2.6-pro-ultraspeed":{id:"xiaomi/mimo-v2.6-pro-ultraspeed",name:"Xiaomi: MiMo-V2.6-Pro-UltraSpeed",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:4.35,output:8.7,cacheRead:.036,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"z-ai/glm-4.5":{id:"z-ai/glm-4.5",name:"Z.ai: GLM 4.5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.6,output:2.2,cacheRead:.11,cacheWrite:0},contextWindow:131072,maxTokens:98304,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-4.5-air":{id:"z-ai/glm-4.5-air",name:"Z.ai: GLM 4.5 Air",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.13,output:.85,cacheRead:.025,cacheWrite:0},contextWindow:131072,maxTokens:98304,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-4.5v":{id:"z-ai/glm-4.5v",name:"Z.ai: GLM 4.5V",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.6,output:1.8,cacheRead:.11,cacheWrite:0},contextWindow:65536,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"z-ai/glm-4.6":{id:"z-ai/glm-4.6",name:"Z.ai: GLM 4.6",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.43,output:1.75,cacheRead:.08,cacheWrite:0},contextWindow:198e3,maxTokens:16384,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-4.6v":{id:"z-ai/glm-4.6v",name:"Z.ai: GLM 4.6V",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:.3,output:.9,cacheRead:.055,cacheWrite:0},contextWindow:131072,maxTokens:32768,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"z-ai/glm-4.7":{id:"z-ai/glm-4.7",name:"Z.ai: GLM 4.7",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.4,output:1.75,cacheRead:.08,cacheWrite:0},contextWindow:202752,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-4.7-flash":{id:"z-ai/glm-4.7-flash",name:"Z.ai: GLM 4.7 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.0605,output:.4,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:117964,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-5":{id:"z-ai/glm-5",name:"Z.ai: GLM 5",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.6,output:1.9,cacheRead:.119,cacheWrite:0},contextWindow:198e3,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-5-turbo":{id:"z-ai/glm-5-turbo",name:"Z.ai: GLM 5 Turbo",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:1.2,output:4,cacheRead:.24,cacheWrite:0},contextWindow:202752,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-5.1":{id:"z-ai/glm-5.1",name:"Z.ai: GLM 5.1",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text"],cost:{input:.966,output:3.036,cacheRead:.1794,cacheWrite:0},contextWindow:2e5,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-5.2":{id:"z-ai/glm-5.2",name:"Z.ai: GLM 5.2",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:"xhigh",max:null},input:["text"],cost:{input:.6496,output:2.0416,cacheRead:.12064,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-5.3":{id:"z-ai/glm-5.3",name:"Z.ai: GLM 5.3",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:.6538,output:2.0548,cacheRead:.12142,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-5.3-flash":{id:"z-ai/glm-5.3-flash",name:"Z.ai: GLM 5.3 Flash",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.15,output:.5,cacheRead:.05,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"z-ai/glm-5.3-flash:batch":{id:"z-ai/glm-5.3-flash:batch",name:"Z.ai: GLM 5.3 Flash (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.06,output:.2,cacheRead:.012,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"z-ai/glm-5.3-flashx":{id:"z-ai/glm-5.3-flashx",name:"Z.ai: GLM 5.3 FlashX",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.37,output:1.25,cacheRead:.075,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"z-ai/glm-5.3:batch":{id:"z-ai/glm-5.3:batch",name:"Z.ai: GLM 5.3 (batch)",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:.72,output:2.4,cacheRead:.12,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"z-ai/glm-5v-turbo":{id:"z-ai/glm-5v-turbo",name:"Z.ai: GLM 5V Turbo",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:1.2,output:4,cacheRead:.24,cacheWrite:0},contextWindow:202752,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~anthropic/claude-fable-latest":{id:"~anthropic/claude-fable-latest",name:"Anthropic: Claude Fable Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~anthropic/claude-haiku-latest":{id:"~anthropic/claude-haiku-latest",name:"Anthropic: Claude Haiku Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:2e5,maxTokens:64e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~anthropic/claude-opus-latest":{id:"~anthropic/claude-opus-latest",name:"Anthropic: Claude Opus Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:4,output:20,cacheRead:.2,cacheWrite:5},contextWindow:1e6,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~anthropic/claude-sonnet-latest":{id:"~anthropic/claude-sonnet-latest",name:"Anthropic: Claude Sonnet Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,cacheControlFormat:"anthropic",sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~deepseek/deepseek-flash-latest":{id:"~deepseek/deepseek-flash-latest",name:"DeepSeek: DeepSeek Flash Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.12,output:.48,cacheRead:.0036,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~deepseek/deepseek-pro-latest":{id:"~deepseek/deepseek-pro-latest",name:"DeepSeek: DeepSeek Pro Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:.39996,output:1.19988,cacheRead:.012726,cacheWrite:0},contextWindow:1048576,maxTokens:393216,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}},"~deepseek/deepseek-v4-flash-latest":{id:"~deepseek/deepseek-v4-flash-latest",name:"DeepSeek: DeepSeek V4 Flash Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:.03,output:.8,cacheRead:.008,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0,requiresReasoningContentOnAssistantMessages:!0}},"~google/gemini-flash-latest":{id:"~google/gemini-flash-latest",name:"Google: Gemini Flash Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:.041667},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~google/gemini-pro-latest":{id:"~google/gemini-pro-latest",name:"Google: Gemini Pro Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:.375},contextWindow:1048576,maxTokens:65536,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~moonshotai/kimi-latest":{id:"~moonshotai/kimi-latest",name:"MoonshotAI: Kimi Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:1.4989,output:10.758,cacheRead:.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~openai/gpt-astra-latest":{id:"~openai/gpt-astra-latest",name:"OpenAI: GPT Astra Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:105e4,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~openai/gpt-luna-latest":{id:"~openai/gpt-luna-latest",name:"OpenAI: GPT Luna Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125},contextWindow:105e4,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~openai/gpt-mini-latest":{id:"~openai/gpt-mini-latest",name:"OpenAI: GPT Mini Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~openai/gpt-sol-latest":{id:"~openai/gpt-sol-latest",name:"OpenAI: GPT Sol Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~openai/gpt-terra-latest":{id:"~openai/gpt-terra-latest",name:"OpenAI: GPT Terra Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~x-ai/grok-latest":{id:"~x-ai/grok-latest",name:"xAI: Grok Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:1.6,output:4.8,cacheRead:.4,cacheWrite:0},contextWindow:5e5,maxTokens:45e4,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~z-ai/glm-flash-latest":{id:"~z-ai/glm-flash-latest",name:"Z.ai: GLM Flash Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.075,output:.25,cacheRead:.015,cacheWrite:0},contextWindow:1048576,maxTokens:943718,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"~z-ai/glm-latest":{id:"~z-ai/glm-latest",name:"Z.ai: GLM Latest",api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",provider:"openrouter",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:.6538,output:2.0548,cacheRead:.12142,cacheWrite:0},contextWindow:1048576,maxTokens:131072,compat:{supportsDeveloperRole:!1,thinkingFormat:"openrouter",supportsStrictMode:!0,sendSessionAffinityHeaders:!0}}}}});var yIe,Qrt=v(()=>{p();mCn();Ts();yIe=Qn("openrouter",hCn)});var gCn,fCn=v(()=>{gCn={"openai-completions":{"MiniMax-M2.5":{id:"MiniMax-M2.5",name:"MiniMax-M2.5",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:196608,maxTokens:32768},"deepseek-v3.2":{id:"deepseek-v3.2",name:"DeepSeek V3.2",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:65536},"deepseek-v4-flash":{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek-v4-flash-0731":{id:"deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek-v4-pro":{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek-v4-pro-0813":{id:"deepseek-v4-pro-0813",name:"DeepSeek V4 Pro 0813",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek-v4.1-flash":{id:"deepseek-v4.1-flash",name:"DeepSeek V4.1 Flash",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"glm-5":{id:"glm-5",name:"GLM-5",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:202752,maxTokens:16384},"glm-5.1":{id:"glm-5.1",name:"GLM-5.1",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:202752,maxTokens:128e3},"glm-5.2":{id:"glm-5.2",name:"GLM-5.2",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072},"glm-5.3":{id:"glm-5.3",name:"GLM-5.3",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072},"kimi-k2.5":{id:"kimi-k2.5",name:"Kimi K2.5",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:98304,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.6":{id:"kimi-k2.6",name:"Kimi K2.6",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.6-flash":{id:"qwen3.6-flash",name:"Qwen3.6 Flash",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.6-plus":{id:"qwen3.6-plus",name:"Qwen3.6 Plus",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.7-max":{id:"qwen3.7-max",name:"Qwen3.7 Max",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072},"qwen3.7-plus":{id:"qwen3.7-plus",name:"Qwen3.7 Plus",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.8-flash":{id:"qwen3.8-flash",name:"Qwen3.8 Flash",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.8-max":{id:"qwen3.8-max",name:"Qwen3.8 Max",api:"openai-completions",provider:"qwen-token-plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var EIe,Urt=v(()=>{p();fCn();Ts();EIe=Qn("qwen-token-plan",gCn)});var yCn,ACn=v(()=>{yCn={"openai-completions":{"MiniMax-M2.5":{id:"MiniMax-M2.5",name:"MiniMax-M2.5",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:196608,maxTokens:32768},"deepseek-v3.2":{id:"deepseek-v3.2",name:"DeepSeek V3.2",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:65536},"deepseek-v4-flash":{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek-v4-flash-0731":{id:"deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek-v4-pro":{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek-v4-pro-0813":{id:"deepseek-v4-pro-0813",name:"DeepSeek V4 Pro 0813",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek-v4.1-flash":{id:"deepseek-v4.1-flash",name:"DeepSeek V4.1 Flash",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"glm-5":{id:"glm-5",name:"GLM-5",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:202752,maxTokens:16384},"glm-5.1":{id:"glm-5.1",name:"GLM-5.1",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:202752,maxTokens:128e3},"glm-5.2":{id:"glm-5.2",name:"GLM-5.2",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072},"glm-5.3":{id:"glm-5.3",name:"GLM-5.3",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072},"kimi-k2.5":{id:"kimi-k2.5",name:"Kimi K2.5",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:98304,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.6":{id:"kimi-k2.6",name:"Kimi K2.6",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.6-flash":{id:"qwen3.6-flash",name:"Qwen3.6 Flash",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.6-plus":{id:"qwen3.6-plus",name:"Qwen3.6 Plus",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.7-max":{id:"qwen3.7-max",name:"Qwen3.7 Max",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072},"qwen3.7-plus":{id:"qwen3.7-plus",name:"Qwen3.7 Plus",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.8-flash":{id:"qwen3.8-flash",name:"Qwen3.8 Flash",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.8-max":{id:"qwen3.8-max",name:"Qwen3.8 Max",api:"openai-completions",provider:"qwen-token-plan-cn",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var bIe,Grt=v(()=>{p();ACn();Ts();bIe=Qn("qwen-token-plan-cn",yCn)});var bCn,ECn=v(()=>{bCn={"openai-completions":{"deepseek-v4-flash-0731":{id:"deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",api:"openai-completions",provider:"qwen-token-plan-individual",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek-v4-pro":{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",api:"openai-completions",provider:"qwen-token-plan-individual",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek-v4-pro-0813":{id:"deepseek-v4-pro-0813",name:"DeepSeek V4 Pro 0813",api:"openai-completions",provider:"qwen-token-plan-individual",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"glm-5.2":{id:"glm-5.2",name:"GLM-5.2",api:"openai-completions",provider:"qwen-token-plan-individual",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072},"qwen3.6-flash":{id:"qwen3.6-flash",name:"Qwen3.6 Flash",api:"openai-completions",provider:"qwen-token-plan-individual",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.7-max":{id:"qwen3.7-max",name:"Qwen3.7 Max",api:"openai-completions",provider:"qwen-token-plan-individual",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072},"qwen3.7-plus":{id:"qwen3.7-plus",name:"Qwen3.7 Plus",api:"openai-completions",provider:"qwen-token-plan-individual",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!1},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.8-flash":{id:"qwen3.8-flash",name:"Qwen3.8 Flash",api:"openai-completions",provider:"qwen-token-plan-individual",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"qwen3.8-max":{id:"qwen3.8-max",name:"Qwen3.8 Max",api:"openai-completions",provider:"qwen-token-plan-individual",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",compat:{supportsStrictMode:!0,thinkingFormat:"qwen",supportsDeveloperRole:!1,supportsStore:!1,supportsReasoningEffort:!0},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:null,xhigh:"xhigh",max:null},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var _Ie,$rt=v(()=>{p();ECn();Ts();_Ie=Qn("qwen-token-plan-individual",bCn)});var xCn,_Cn=v(()=>{xCn={"pi-messages":{balanced:{id:"balanced",name:"Balanced",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],contextWindow:1048576,maxTokens:131072,lab:"Moonshot AI",cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},enabled:!0,providers:[{id:"fireworks",name:"Fireworks AI",credential:"radius",source:"radius"},{id:"sference",name:"sference",credential:"radius",source:"radius"},{id:"baseten",name:"Baseten",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},cheap:{id:"cheap",name:"Cheap",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"xhigh"},input:["text"],contextWindow:1e6,maxTokens:384e3,lab:"DeepSeek",cost:{input:.22,output:.66,cacheRead:.007,cacheWrite:0},enabled:!0,providers:[{id:"sference",name:"sference",credential:"radius",source:"radius"},{id:"fireworks",name:"Fireworks AI",credential:"radius",source:"radius"},{id:"baseten",name:"Baseten",credential:"radius",source:"radius"},{id:"deepinfra",name:"DeepInfra",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1"},"claude-fable-5":{id:"claude-fable-5",name:"Claude Fable 5",reasoning:!0,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:1e6,maxTokens:128e3,lab:"Anthropic",cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},enabled:!0,providers:[{id:"anthropic",name:"Anthropic",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-fable-5-1":{id:"claude-fable-5-1",name:"Claude Fable 5.1",reasoning:!0,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:1e6,maxTokens:128e3,lab:"Anthropic",cost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},enabled:!0,providers:[{id:"anthropic",name:"Anthropic",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-haiku-4-5":{id:"claude-haiku-4-5",name:"Claude Haiku 4.5",reasoning:!0,input:["text","image"],contextWindow:2e5,maxTokens:64e3,lab:"Anthropic",cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},enabled:!0,providers:[{id:"anthropic",name:"Anthropic",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-5":{id:"claude-opus-4-5",name:"Claude Opus 4.5",reasoning:!0,input:["text","image"],contextWindow:2e5,maxTokens:64e3,lab:"Anthropic",cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},enabled:!0,providers:[{id:"anthropic",name:"Anthropic",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-4-8":{id:"claude-opus-4-8",name:"Claude Opus 4.8",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:1e6,maxTokens:128e3,lab:"Anthropic",cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},enabled:!0,providers:[{id:"anthropic",name:"Anthropic",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-5":{id:"claude-opus-5",name:"Claude Opus 5",reasoning:!0,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:1e6,maxTokens:128e3,lab:"Anthropic",cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},enabled:!0,providers:[{id:"anthropic",name:"Anthropic",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-opus-5-5":{id:"claude-opus-5-5",name:"Claude Opus 5.5",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:1e6,maxTokens:128e3,lab:"Anthropic",cost:{input:4,output:20,cacheRead:.2,cacheWrite:5},enabled:!0,providers:[{id:"anthropic",name:"Anthropic",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-4-5":{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64e3,lab:"Anthropic",cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},enabled:!0,providers:[{id:"anthropic",name:"Anthropic",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"claude-sonnet-5":{id:"claude-sonnet-5",name:"Claude Sonnet 5",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:1e6,maxTokens:128e3,lab:"Anthropic",cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},enabled:!0,providers:[{id:"anthropic",name:"Anthropic",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"deepseek-v4-flash":{id:"deepseek-v4-flash",name:"DeepSeek V4.1 Flash",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"xhigh"},input:["text"],contextWindow:1e6,maxTokens:384e3,lab:"DeepSeek",cost:{input:.22,output:.66,cacheRead:.007,cacheWrite:0},enabled:!0,providers:[{id:"sference",name:"sference",credential:"radius",source:"radius"},{id:"fireworks",name:"Fireworks AI",credential:"radius",source:"radius"},{id:"baseten",name:"Baseten",credential:"radius",source:"radius"},{id:"deepinfra",name:"DeepInfra",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1"},"deepseek-v4-pro":{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",max:"max"},input:["text"],contextWindow:1e6,maxTokens:262144,lab:"DeepSeek",cost:{input:1.32,output:3.96,cacheRead:.044,cacheWrite:0},enabled:!0,providers:[{id:"fireworks",name:"Fireworks AI",credential:"radius",source:"radius"},{id:"baseten",name:"Baseten",credential:"radius",source:"radius"},{id:"deepinfra",name:"DeepInfra",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1"},"deepseek-v4.1-flash":{id:"deepseek-v4.1-flash",name:"DeepSeek V4.1 Flash",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],contextWindow:1e6,maxTokens:384e3,lab:"DeepSeek",cost:{input:.22,output:.66,cacheRead:.007,cacheWrite:0},enabled:!0,providers:[{id:"fireworks",name:"Fireworks AI",credential:"radius",source:"radius"},{id:"sference",name:"sference",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1"},"glm-5.2":{id:"glm-5.2",name:"GLM 5.2",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},input:["text"],contextWindow:432e3,maxTokens:131072,lab:"Z.ai",cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},enabled:!0,providers:[{id:"fireworks",name:"Fireworks AI",credential:"radius",source:"radius"},{id:"deepinfra",name:"DeepInfra",credential:"radius",source:"radius"},{id:"baseten",name:"Baseten",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1"},"glm-5.3":{id:"glm-5.3",name:"GLM-5.3",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],contextWindow:1048576,maxTokens:131072,lab:"Z.ai",cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},enabled:!0,providers:[{id:"baseten",name:"Baseten",credential:"radius",source:"radius"},{id:"deepinfra",name:"DeepInfra",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1"},"glm-5.3-flash":{id:"glm-5.3-flash",name:"GLM-5.3 Flash",reasoning:!0,thinkingLevelMap:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"xhigh"},input:["text"],contextWindow:1e6,maxTokens:131072,lab:"Z.ai",cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},enabled:!0,providers:[{id:"sference",name:"sference",credential:"radius",source:"radius"},{id:"baseten",name:"Baseten",credential:"radius",source:"radius"},{id:"deepinfra",name:"DeepInfra",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1"},"gpt-5.3-codex":{id:"gpt-5.3-codex",name:"GPT 5.3 Codex",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],contextWindow:4e5,maxTokens:128e3,lab:"OpenAI",cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4":{id:"gpt-5.4",name:"GPT 5.4",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],contextWindow:272e3,maxTokens:128e3,lab:"OpenAI",cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:5,output:22.5,cacheRead:.5,cacheWrite:0}]},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT 5.4 Mini",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],contextWindow:4e5,maxTokens:128e3,lab:"OpenAI",cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.5":{id:"gpt-5.5",name:"GPT 5.5",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],contextWindow:272e3,maxTokens:128e3,lab:"OpenAI",cost:{input:5,output:30,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:10,output:45,cacheRead:1,cacheWrite:0}]},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT 5.6 Luna",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:272e3,maxTokens:128e3,lab:"OpenAI",cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25,tiers:[{inputTokensAbove:272e3,input:.4,output:1.8,cacheRead:.04,cacheWrite:.5}]},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT 5.6 Sol",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:272e3,maxTokens:128e3,lab:"OpenAI",cost:{input:4,output:20,cacheRead:.4,cacheWrite:5,tiers:[{inputTokensAbove:272e3,input:8,output:30,cacheRead:.8,cacheWrite:10}]},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT 5.6 Terra",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:272e3,maxTokens:128e3,lab:"OpenAI",cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:18,cacheRead:.4,cacheWrite:5}]},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-astra":{id:"gpt-6-astra",name:"GPT 6 Astra",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:272e3,maxTokens:128e3,lab:"OpenAI",cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5,tiers:[{inputTokensAbove:272e3,input:20,output:75,cacheRead:2,cacheWrite:25}]},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-luna":{id:"gpt-6-luna",name:"GPT 6 Luna",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:105e4,maxTokens:128e3,lab:"OpenAI",cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125,tiers:[{inputTokensAbove:272e3,input:.2,output:.75,cacheRead:.02,cacheWrite:.25}]},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"gpt-6-sol":{id:"gpt-6-sol",name:"GPT 6 Sol",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:105e4,maxTokens:128e3,lab:"OpenAI",cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:15,cacheRead:.4,cacheWrite:5}]},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",reasoning:!0,thinkingLevelMap:{off:null},input:["text","image"],contextWindow:262e3,maxTokens:262e3,lab:"Moonshot AI",cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},enabled:!0,providers:[{id:"fireworks",name:"Fireworks AI",credential:"radius",source:"radius"},{id:"deepinfra",name:"DeepInfra",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"kimi-k3":{id:"kimi-k3",name:"Kimi K3",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],contextWindow:1048576,maxTokens:131072,lab:"Moonshot AI",cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},enabled:!0,providers:[{id:"fireworks",name:"Fireworks AI",credential:"radius",source:"radius"},{id:"sference",name:"sference",credential:"radius",source:"radius"},{id:"baseten",name:"Baseten",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},precise:{id:"precise",name:"Precise",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},input:["text","image"],contextWindow:272e3,maxTokens:128e3,lab:"OpenAI",cost:{input:4,output:20,cacheRead:.4,cacheWrite:5,tiers:[{inputTokensAbove:272e3,input:8,output:30,cacheRead:.8,cacheWrite:10}]},enabled:!0,providers:[{id:"openai",name:"OpenAI",credential:"radius",source:"radius"}],api:"pi-messages",provider:"radius",baseUrl:"https://radius.pi.dev/v1",inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var xIe,Wrt=v(()=>{p();_Cn();Ts();xIe=Qn("radius",xCn)});var CCn,SCn=v(()=>{CCn={"openai-completions":{"MiniMaxAI/MiniMax-M2.7":{id:"MiniMaxAI/MiniMax-M2.7",name:"MiniMax-M2.7",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:null,medium:null},input:["text"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:202752,maxTokens:131072},"MiniMaxAI/MiniMax-M3":{id:"MiniMaxAI/MiniMax-M3",name:"MiniMax-M3",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:524288,maxTokens:25e4,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen2.5-7B-Instruct-Turbo":{id:"Qwen/Qwen2.5-7B-Instruct-Turbo",name:"Qwen 2.5 7B Instruct Turbo",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!1,input:["text"],cost:{input:.3,output:.3,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:32768,maxTokens:32768},"Qwen/Qwen3.5-9B":{id:"Qwen/Qwen3.5-9B",name:"Qwen3.5 9B",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text","image"],cost:{input:.17,output:.25,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:262144,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"Qwen/Qwen3.6-Plus":{id:"Qwen/Qwen3.6-Plus",name:"Qwen3.6 Plus",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text"],cost:{input:.5,output:3,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1e6,maxTokens:5e5},"Qwen/Qwen3.7-Max":{id:"Qwen/Qwen3.7-Max",name:"Qwen3.7 Max",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!1,input:["text"],cost:{input:1.25,output:3.75,cacheRead:.125,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1e6,maxTokens:5e5},"deepseek-ai/DeepSeek-V4-Flash-0731":{id:"deepseek-ai/DeepSeek-V4-Flash-0731",name:"DeepSeek V4 Flash 0731",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text"],cost:{input:.14,output:.28,cacheRead:.03,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1e6,maxTokens:384e3},"deepseek-ai/DeepSeek-V4-Pro":{id:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null,high:"high",xhigh:null},input:["text"],cost:{input:1.74,output:3.48,cacheRead:.2,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:512e3,maxTokens:384e3},"deepseek-ai/DeepSeek-V4-Pro-0813":{id:"deepseek-ai/DeepSeek-V4-Pro-0813",name:"DeepSeek V4 Pro 0813",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text"],cost:{input:1.32,output:3.96,cacheRead:.13,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1048576,maxTokens:384e3},"deepseek-ai/DeepSeek-V4.1-Flash":{id:"deepseek-ai/DeepSeek-V4.1-Flash",name:"DeepSeek V4.1 Flash",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text","image"],cost:{input:.3,output:1.2,cacheRead:.006,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1048576,maxTokens:384e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-4-31B-it":{id:"google/gemma-4-31B-it",name:"Gemma 4 31B Instruct",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text","image"],cost:{input:.39,output:.97,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:262144,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta-llama/Llama-3.3-70B-Instruct-Turbo":{id:"meta-llama/Llama-3.3-70B-Instruct-Turbo",name:"Llama 3.3 70B",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!1,input:["text"],cost:{input:1.04,output:1.04,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:131072,maxTokens:131072},"moonshotai/Kimi-K2.6":{id:"moonshotai/Kimi-K2.6",name:"Kimi K2.6",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text","image"],cost:{input:1.2,output:4.5,cacheRead:.2,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:262144,maxTokens:131e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/Kimi-K2.7-Code":{id:"moonshotai/Kimi-K2.7-Code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:262144,maxTokens:131072},"moonshotai/Kimi-K3":{id:"moonshotai/Kimi-K3",name:"Kimi K3",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia/nemotron-3-ultra-550b-a55b":{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B A55B",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text"],cost:{input:.6,output:3.6,cacheRead:.2,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:512300,maxTokens:512300},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"GPT OSS 120B",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text"],cost:{input:.15,output:.6,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"openai",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:131072,maxTokens:131072},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"GPT OSS 20B",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},input:["text"],cost:{input:.05,output:.2,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"openai",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:131072,maxTokens:131072},"thinkingmachines/Inkling":{id:"thinkingmachines/Inkling",name:"Inkling",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text","image"],cost:{input:1,output:4.05,cacheRead:.17,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:524288,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai-org/GLM-5.2":{id:"zai-org/GLM-5.2",name:"GLM-5.2",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:512e3,maxTokens:164e3},"zai-org/GLM-5.3":{id:"zai-org/GLM-5.3",name:"GLM-5.3",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1048576,maxTokens:262144},"zai-org/GLM-5.3-Flash":{id:"zai-org/GLM-5.3-Flash",name:"GLM-5.3-Flash",api:"openai-completions",provider:"together",baseUrl:"https://api.together.ai/v1",reasoning:!0,thinkingLevelMap:{minimal:null,low:null,medium:null},input:["text","image"],cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"together",supportsLongCacheRetention:!1,supportsStrictMode:!1},contextWindow:1048575,maxTokens:4e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var SIe,Hrt=v(()=>{p();SCn();Ts();SIe=Qn("together",CCn)});var wCn,ICn=v(()=>{wCn={"anthropic-messages":{"alibaba/qwen-3-14b":{id:"alibaba/qwen-3-14b",name:"Qwen3-14B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.12,output:.24,cacheRead:0,cacheWrite:0},contextWindow:40960,maxTokens:16384},"alibaba/qwen-3-235b":{id:"alibaba/qwen-3-235b",name:"Qwen3 235B A22B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.22,output:.88,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:16384},"alibaba/qwen-3-30b":{id:"alibaba/qwen-3-30b",name:"Qwen3-30B-A3B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.12,output:.5,cacheRead:0,cacheWrite:0},contextWindow:40960,maxTokens:16384},"alibaba/qwen-3-32b":{id:"alibaba/qwen-3-32b",name:"Qwen 3 32B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.16,output:.64,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192},"alibaba/qwen-3.6-max-preview":{id:"alibaba/qwen-3.6-max-preview",name:"Qwen 3.6 Max Preview",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1.3,output:7.8,cacheRead:.13,cacheWrite:1.625},contextWindow:24e4,maxTokens:64e3},"alibaba/qwen3-235b-a22b-thinking":{id:"alibaba/qwen3-235b-a22b-thinking",name:"Qwen3 VL 235B A22B Thinking",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.4,output:4,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3-coder":{id:"alibaba/qwen3-coder",name:"Qwen3 Coder 480B A35B Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1.5,output:7.5,cacheRead:.3,cacheWrite:0},contextWindow:262144,maxTokens:65536},"alibaba/qwen3-coder-30b-a3b":{id:"alibaba/qwen3-coder-30b-a3b",name:"Qwen 3 Coder 30B A3B Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.15,output:.6,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:8192},"alibaba/qwen3-coder-next":{id:"alibaba/qwen3-coder-next",name:"Qwen3 Coder Next",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.5,output:1.2,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:256e3},"alibaba/qwen3-coder-plus":{id:"alibaba/qwen3-coder-plus",name:"Qwen3 Coder Plus",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1,output:5,cacheRead:.2,cacheWrite:0},contextWindow:1e6,maxTokens:65536},"alibaba/qwen3-max":{id:"alibaba/qwen3-max",name:"Qwen3 Max",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1.2,output:6,cacheRead:.24,cacheWrite:0},contextWindow:262144,maxTokens:32768},"alibaba/qwen3-max-preview":{id:"alibaba/qwen3-max-preview",name:"Qwen3 Max Preview",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1.2,output:6,cacheRead:.24,cacheWrite:0},contextWindow:262144,maxTokens:32768},"alibaba/qwen3-max-thinking":{id:"alibaba/qwen3-max-thinking",name:"Qwen 3 Max Thinking",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1.2,output:6,cacheRead:.24,cacheWrite:0},contextWindow:256e3,maxTokens:65536},"alibaba/qwen3-next-80b-a3b-instruct":{id:"alibaba/qwen3-next-80b-a3b-instruct",name:"Qwen3 Next 80B A3B Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.15,output:1.2,cacheRead:0,cacheWrite:0},contextWindow:262114,maxTokens:262114},"alibaba/qwen3-next-80b-a3b-thinking":{id:"alibaba/qwen3-next-80b-a3b-thinking",name:"Qwen3 Next 80B A3B Thinking",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.15,output:1.2,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:262144},"alibaba/qwen3-vl-235b-a22b-instruct":{id:"alibaba/qwen3-vl-235b-a22b-instruct",name:"Qwen3 VL 235B A22B Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.4,output:1.6,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:129024,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3-vl-instruct":{id:"alibaba/qwen3-vl-instruct",name:"Qwen3 VL 235B A22B Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.4,output:1.6,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:129024,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3-vl-thinking":{id:"alibaba/qwen3-vl-thinking",name:"Qwen3 VL 235B A22B Thinking",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.4,output:4,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.5-flash":{id:"alibaba/qwen3.5-flash",name:"Qwen 3.5 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.1,output:.4,cacheRead:.01,cacheWrite:.125},contextWindow:1e6,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.5-plus":{id:"alibaba/qwen3.5-plus",name:"Qwen 3.5 Plus",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.4,output:2.5,cacheRead:.04,cacheWrite:.5},contextWindow:1e6,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.6-27b":{id:"alibaba/qwen3.6-27b",name:"Qwen 3.6 27B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.6,output:3.6,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.6-plus":{id:"alibaba/qwen3.6-plus",name:"Qwen 3.6 Plus",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.5,output:3,cacheRead:.05,cacheWrite:.625},contextWindow:1e6,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.7-flash":{id:"alibaba/qwen3.7-flash",name:"Qwen 3.7 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.03,output:.13,cacheRead:.006,cacheWrite:.038},contextWindow:991e3,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.7-max":{id:"alibaba/qwen3.7-max",name:"Qwen 3.7 Max",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:2.5,output:7.5,cacheRead:.5,cacheWrite:3.125},contextWindow:991e3,maxTokens:64e3},"alibaba/qwen3.7-plus":{id:"alibaba/qwen3.7-plus",name:"Qwen 3.7 Plus",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.4,output:1.6,cacheRead:.08,cacheWrite:.5},contextWindow:1e6,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.8-2.4t-a95b":{id:"alibaba/qwen3.8-2.4t-a95b",name:"Qwen3.8 2.4T A95B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:6,cacheRead:.25,cacheWrite:0},contextWindow:262144,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.8-27b":{id:"alibaba/qwen3.8-27b",name:"Qwen3.8 27B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.5,output:3,cacheRead:.1,cacheWrite:.625},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.8-flash":{id:"alibaba/qwen3.8-flash",name:"Qwen 3.8 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.15,output:.47,cacheRead:.016,cacheWrite:.2},contextWindow:991e3,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.8-max":{id:"alibaba/qwen3.8-max",name:"Qwen 3.8 Max",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:6,cacheRead:.25,cacheWrite:0},contextWindow:262144,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.8-max-0902":{id:"alibaba/qwen3.8-max-0902",name:"Qwen3.8 Max 0902",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:6,cacheRead:.25,cacheWrite:2.5},contextWindow:991e3,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"alibaba/qwen3.8-omni-flash":{id:"alibaba/qwen3.8-omni-flash",name:"Qwen 3.8 Omni Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.15,output:.47,cacheRead:.016,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"amazon/nova-2-lite":{id:"amazon/nova-2-lite",name:"Nova 2 Lite",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.3,output:2.5,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:1e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"amazon/nova-lite":{id:"amazon/nova-lite",name:"Nova Lite",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.06,output:.24,cacheRead:0,cacheWrite:0},contextWindow:3e5,maxTokens:8192,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"amazon/nova-micro":{id:"amazon/nova-micro",name:"Nova Micro",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.035,output:.14,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192},"amazon/nova-pro":{id:"amazon/nova-pro",name:"Nova Pro",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.8,output:3.2,cacheRead:0,cacheWrite:0},contextWindow:3e5,maxTokens:8192,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-3-haiku":{id:"anthropic/claude-3-haiku",name:"Claude 3 Haiku",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.25,output:1.25,cacheRead:.03,cacheWrite:.3},contextWindow:2e5,maxTokens:4096,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-fable-5":{id:"anthropic/claude-fable-5",name:"Claude Fable 5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0},cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-fable-5.1":{id:"anthropic/claude-fable-5.1",name:"Claude Fable 5.1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0},cost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-haiku-4.5":{id:"anthropic/claude-haiku-4.5",name:"Claude Haiku 4.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1,output:5,cacheRead:.1,cacheWrite:1.25},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4":{id:"anthropic/claude-opus-4",name:"Claude Opus 4",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75},contextWindow:2e5,maxTokens:8192,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.5":{id:"anthropic/claude-opus-4.5",name:"Claude Opus 4.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:2e5,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.6":{id:"anthropic/claude-opus-4.6",name:"Claude Opus 4.6",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0},cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.7":{id:"anthropic/claude-opus-4.7",name:"Claude Opus 4.7",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.8":{id:"anthropic/claude-opus-4.8",name:"Claude Opus 4.8",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-4.8-fast":{id:"anthropic/claude-opus-4.8-fast",name:"Claude Opus 4.8 (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-5":{id:"anthropic/claude-opus-5",name:"Claude Opus 5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-5-fast":{id:"anthropic/claude-opus-5-fast",name:"Claude Opus 5 (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-5.5":{id:"anthropic/claude-opus-5.5",name:"Claude Opus 5.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},cost:{input:4,output:20,cacheRead:.2,cacheWrite:5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-opus-5.5-fast":{id:"anthropic/claude-opus-5.5-fast",name:"Claude Opus 5.5 (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},cost:{input:8,output:40,cacheRead:.4,cacheWrite:10},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-4":{id:"anthropic/claude-sonnet-4",name:"Claude Sonnet 4",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:8192,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-4.5":{id:"anthropic/claude-sonnet-4.5",name:"Claude Sonnet 4.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-4.6":{id:"anthropic/claude-sonnet-4.6",name:"Claude Sonnet 4.6",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0},cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"anthropic/claude-sonnet-5":{id:"anthropic/claude-sonnet-5",name:"Claude Sonnet 5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0,forceAdaptiveThinking:!0},cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"arcee-ai/trinity-large-thinking":{id:"arcee-ai/trinity-large-thinking",name:"Trinity Large Thinking",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.25,output:.9,cacheRead:0,cacheWrite:0},contextWindow:262100,maxTokens:8e4},"bytedance/seed-1.6":{id:"bytedance/seed-1.6",name:"Seed 1.6",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.25,output:2,cacheRead:.05,cacheWrite:0},contextWindow:256e3,maxTokens:32e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"bytedance/seed-1.8":{id:"bytedance/seed-1.8",name:"Bytedance Seed 1.8",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.25,output:2,cacheRead:.05,cacheWrite:0},contextWindow:256e3,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"bytedance/seed-2.1-turbo":{id:"bytedance/seed-2.1-turbo",name:"Seed 2.1 Turbo",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.5,output:2.5,cacheRead:.1,cacheWrite:0},contextWindow:262144,maxTokens:262144,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"cohere/command-a":{id:"cohere/command-a",name:"Command A",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:8e3},"deepseek/deepseek-r1":{id:"deepseek/deepseek-r1",name:"DeepSeek-R1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1.35,output:5.4,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192},"deepseek/deepseek-v3.1":{id:"deepseek/deepseek-v3.1",name:"DeepSeek V3.1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.25,output:.95,cacheRead:.13,cacheWrite:0},contextWindow:163840,maxTokens:128e3},"deepseek/deepseek-v3.1-terminus":{id:"deepseek/deepseek-v3.1-terminus",name:"DeepSeek V3.1 Terminus",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.27,output:1,cacheRead:.135,cacheWrite:0},contextWindow:131072,maxTokens:65536},"deepseek/deepseek-v3.2":{id:"deepseek/deepseek-v3.2",name:"DeepSeek V3.2",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.62,output:1.85,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8e3},"deepseek/deepseek-v3.2-thinking":{id:"deepseek/deepseek-v3.2-thinking",name:"DeepSeek V3.2 Thinking",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.62,output:1.85,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8e3},"deepseek/deepseek-v4-flash":{id:"deepseek/deepseek-v4-flash",name:"DeepSeek V4 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.13,output:.26,cacheRead:.028,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek/deepseek-v4-flash-0731":{id:"deepseek/deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.076,output:.153,cacheRead:.014,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek/deepseek-v4-flash-vision-exp":{id:"deepseek/deepseek-v4-flash-vision-exp",name:"DeepSeek V4 Flash Vision Exp",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.22,output:.66,cacheRead:.007,cacheWrite:0},contextWindow:1048576,maxTokens:1048576,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"deepseek/deepseek-v4-pro":{id:"deepseek/deepseek-v4-pro",name:"DeepSeek V4 Pro",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.66,output:1.98,cacheRead:.022,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek/deepseek-v4-pro-0813":{id:"deepseek/deepseek-v4-pro-0813",name:"DeepSeek V4 Pro 0813",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.66,output:1.98,cacheRead:.066,cacheWrite:0},contextWindow:1e6,maxTokens:384e3},"deepseek/deepseek-v4.1-flash":{id:"deepseek/deepseek-v4.1-flash",name:"DeepSeek V4.1 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.3,output:1.2,cacheRead:.007,cacheWrite:0},contextWindow:1048576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-2.5-flash":{id:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.3,output:2.5,cacheRead:.03,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-2.5-flash-lite":{id:"google/gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.1,output:.4,cacheRead:.01,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-2.5-pro":{id:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:1048576,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3-flash":{id:"google/gemini-3-flash",name:"Gemini 3 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.5,output:3,cacheRead:.05,cacheWrite:0},contextWindow:1e6,maxTokens:65e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.1-flash-lite":{id:"google/gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.25,output:1.5,cacheRead:.03,cacheWrite:0},contextWindow:1e6,maxTokens:65e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.1-pro-preview":{id:"google/gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:12,cacheRead:.2,cacheWrite:0},contextWindow:1e6,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.5-flash":{id:"google/gemini-3.5-flash",name:"Gemini 3.5 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.5,output:9,cacheRead:.15,cacheWrite:0},contextWindow:1e6,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.5-flash-lite":{id:"google/gemini-3.5-flash-lite",name:"Gemini 3.5 Flash Lite",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.3,output:2.5,cacheRead:.03,cacheWrite:0},contextWindow:1e6,maxTokens:65e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.6-flash":{id:"google/gemini-3.6-flash",name:"Gemini 3.6 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:64e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.7-flash":{id:"google/gemini-3.7-flash",name:"Gemini 3.7 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemini-3.8-flash":{id:"google/gemini-3.8-flash",name:"Gemini 3.8 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:65536,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-4-26b-a4b-it":{id:"google/gemma-4-26b-a4b-it",name:"Google Gemma 4 26B A4B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.15,output:.6,cacheRead:.015,cacheWrite:0},contextWindow:262144,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"google/gemma-4-31b-it":{id:"google/gemma-4-31b-it",name:"Gemma 4 31B IT",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.14,output:.4,cacheRead:0,cacheWrite:0},contextWindow:262144,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"inception/mercury-2":{id:"inception/mercury-2",name:"Mercury 2",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.25,output:.75,cacheRead:.025,cacheWrite:0},contextWindow:128e3,maxTokens:128e3},"inception/mercury-2.5":{id:"inception/mercury-2.5",name:"Mercury 2.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.04,output:.15,cacheRead:.004,cacheWrite:0},contextWindow:26e4,maxTokens:65536},"inception/mercury-coder-small":{id:"inception/mercury-coder-small",name:"Mercury Coder Small Beta",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.25,output:1,cacheRead:0,cacheWrite:0},contextWindow:32e3,maxTokens:16384},"inclusionai/ling-3.0-flash":{id:"inclusionai/ling-3.0-flash",name:"Ling 3.0 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.021,output:.063,cacheRead:.0042,cacheWrite:0},contextWindow:256e3,maxTokens:32e3},"inclusionai/ling-3.0-flash-fin":{id:"inclusionai/ling-3.0-flash-fin",name:"Ling 3.0 Flash Fin",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:32e3},"inclusionai/ling-3.0-flash-fin-free":{id:"inclusionai/ling-3.0-flash-fin-free",name:"Ling 3.0 Flash Fin (Free)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:32e3},"inclusionai/ling-3.0-flash-sante":{id:"inclusionai/ling-3.0-flash-sante",name:"Ling 3.0 Flash Sante",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:32e3},"inclusionai/ling-3.0-flash-sante-free":{id:"inclusionai/ling-3.0-flash-sante-free",name:"Ling 3.0 Flash Sante (Free)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:32e3},"inclusionai/ling-3.0-flash-vl":{id:"inclusionai/ling-3.0-flash-vl",name:"Ling 3.0 Flash VL",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:32e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"inclusionai/ling-3.0-flash-vl-free":{id:"inclusionai/ling-3.0-flash-vl-free",name:"Ling 3.0 Flash VL (Free)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:32e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"interfaze/interfaze-beta":{id:"interfaze/interfaze-beta",name:"Interfaze Beta",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.5,output:3.5,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:32e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/llama-3.1-70b":{id:"meta/llama-3.1-70b",name:"Llama 3.1 70B Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.72,output:.72,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192},"meta/llama-3.1-8b":{id:"meta/llama-3.1-8b",name:"Llama 3.1 8B Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.22,output:.22,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192},"meta/llama-3.3-70b":{id:"meta/llama-3.3-70b",name:"Llama 3.3 70B Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.72,output:.72,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192},"meta/llama-4-maverick":{id:"meta/llama-4-maverick",name:"Llama 4 Maverick 17B Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.24,output:.97,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/llama-4-scout":{id:"meta/llama-4-scout",name:"Llama 4 Scout 17B Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.17,output:.66,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-glimmer-30b":{id:"meta/muse-glimmer-30b",name:"Muse Glimmer 30B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.35,output:1.5,cacheRead:.04,cacheWrite:0},contextWindow:131072,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-spark-1.1":{id:"meta/muse-spark-1.1",name:"Muse Spark 1.1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:1048576,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-spark-1.2":{id:"meta/muse-spark-1.2",name:"Muse Spark 1.2",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:1048576,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-spark-1.2-contributor":{id:"meta/muse-spark-1.2-contributor",name:"Muse Spark 1.2 Contributor",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.1,output:.2,cacheRead:.002,cacheWrite:0},contextWindow:1048576,maxTokens:1048576,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-spark-1.3":{id:"meta/muse-spark-1.3",name:"Muse Spark 1.3",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:4.25,cacheRead:.15,cacheWrite:0},contextWindow:1048576,maxTokens:1048576,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"meta/muse-spark-1.3-contributor":{id:"meta/muse-spark-1.3-contributor",name:"Muse Spark 1.3 Contributor",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.1,output:.2,cacheRead:.002,cacheWrite:0},contextWindow:1048576,maxTokens:1048576,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"minimax/minimax-m2":{id:"minimax/minimax-m2",name:"MiniMax M2",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.3,output:1.2,cacheRead:.03,cacheWrite:.375},contextWindow:205e3,maxTokens:205e3},"minimax/minimax-m2.1":{id:"minimax/minimax-m2.1",name:"MiniMax M2.1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.3,output:1.2,cacheRead:.03,cacheWrite:.375},contextWindow:204800,maxTokens:131072},"minimax/minimax-m2.1-lightning":{id:"minimax/minimax-m2.1-lightning",name:"MiniMax M2.1 Lightning",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.3,output:2.4,cacheRead:.03,cacheWrite:.375},contextWindow:204800,maxTokens:131072},"minimax/minimax-m2.5":{id:"minimax/minimax-m2.5",name:"MiniMax M2.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.3,output:1.2,cacheRead:.03,cacheWrite:.375},contextWindow:204800,maxTokens:131e3},"minimax/minimax-m2.5-highspeed":{id:"minimax/minimax-m2.5-highspeed",name:"MiniMax M2.5 High Speed",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.6,output:2.4,cacheRead:.03,cacheWrite:.375},contextWindow:204800,maxTokens:131e3},"minimax/minimax-m2.7":{id:"minimax/minimax-m2.7",name:"MiniMax M2.7",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:.375},contextWindow:204800,maxTokens:131e3},"minimax/minimax-m2.7-highspeed":{id:"minimax/minimax-m2.7-highspeed",name:"MiniMax M2.7 High Speed",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.6,output:2.4,cacheRead:.06,cacheWrite:.375},contextWindow:204800,maxTokens:131100},"minimax/minimax-m3":{id:"minimax/minimax-m3",name:"MiniMax M3",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.3,output:1.2,cacheRead:.06,cacheWrite:0},contextWindow:512e3,maxTokens:512e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral/codestral":{id:"mistral/codestral",name:"Mistral Codestral",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.3,output:.9,cacheRead:.03,cacheWrite:0},contextWindow:128e3,maxTokens:4e3},"mistral/ministral-14b":{id:"mistral/ministral-14b",name:"Ministral 14B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.2,output:.2,cacheRead:.02,cacheWrite:0},contextWindow:262144,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral/ministral-3b":{id:"mistral/ministral-3b",name:"Ministral 3B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.1,output:.1,cacheRead:.01,cacheWrite:0},contextWindow:131072,maxTokens:4e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral/ministral-8b":{id:"mistral/ministral-8b",name:"Ministral 8B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.15,output:.15,cacheRead:.015,cacheWrite:0},contextWindow:262144,maxTokens:4e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral/mistral-large-3":{id:"mistral/mistral-large-3",name:"Mistral Large 3",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.5,output:1.5,cacheRead:.05,cacheWrite:0},contextWindow:262144,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral/mistral-medium-3.5":{id:"mistral/mistral-medium-3.5",name:"Mistral Medium Latest",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.5,output:7.5,cacheRead:.15,cacheWrite:0},contextWindow:262144,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mistral/mistral-nemo":{id:"mistral/mistral-nemo",name:"Mistral Nemo 12B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.04,output:.17,cacheRead:0,cacheWrite:0},contextWindow:60288,maxTokens:16e3},"mistral/mistral-small":{id:"mistral/mistral-small",name:"Mistral Small",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.15,output:.6,cacheRead:.015,cacheWrite:0},contextWindow:262144,maxTokens:4e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mixedbread/toast-1":{id:"mixedbread/toast-1",name:"Toast 1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.3,output:.72,cacheRead:.036,cacheWrite:0},contextWindow:131e3,maxTokens:4e3},"moonshotai/kimi-k2":{id:"moonshotai/kimi-k2",name:"Kimi K2 Instruct",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.57,output:2.3,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:131072},"moonshotai/kimi-k2-thinking":{id:"moonshotai/kimi-k2-thinking",name:"Kimi K2 Thinking",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.47,output:2,cacheRead:.141,cacheWrite:0},contextWindow:216144,maxTokens:216144},"moonshotai/kimi-k2.5":{id:"moonshotai/kimi-k2.5",name:"Kimi K2.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.6,output:3,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/kimi-k2.6":{id:"moonshotai/kimi-k2.6",name:"Kimi K2.6",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},contextWindow:262e3,maxTokens:262e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/kimi-k2.7-code":{id:"moonshotai/kimi-k2.7-code",name:"Kimi K2.7 Code",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.95,output:4,cacheRead:.16,cacheWrite:0},contextWindow:256e3,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/kimi-k2.7-code-highspeed":{id:"moonshotai/kimi-k2.7-code-highspeed",name:"Kimi K2.7 Code High Speed",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.9,output:8,cacheRead:.38,cacheWrite:0},contextWindow:262144,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/kimi-k3":{id:"moonshotai/kimi-k3",name:"Kimi K3",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"moonshotai/kimi-k3-fast":{id:"moonshotai/kimi-k3-fast",name:"Kimi K3 Fast",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:4.5,output:22.5,cacheRead:.45,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia/nemotron-3-nano-30b-a3b":{id:"nvidia/nemotron-3-nano-30b-a3b",name:"Nemotron 3 Nano 30B A3B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.05,output:.2,cacheRead:.025,cacheWrite:0},contextWindow:262144,maxTokens:262144},"nvidia/nemotron-3-super-120b-a12b":{id:"nvidia/nemotron-3-super-120b-a12b",name:"NVIDIA Nemotron 3 Super 120B A12B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.15,output:.65,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:32e3},"nvidia/nemotron-3-ultra-550b-a55b":{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.6,output:2.4,cacheRead:.12,cacheWrite:0},contextWindow:1e6,maxTokens:65e3},"nvidia/nemotron-3.5-lightning":{id:"nvidia/nemotron-3.5-lightning",name:"Nemotron 3.5 Lightning 30B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.05,output:.2,cacheRead:.01,cacheWrite:0},contextWindow:262144,maxTokens:131072},"nvidia/nemotron-nano-12b-v2-vl":{id:"nvidia/nemotron-nano-12b-v2-vl",name:"Nvidia Nemotron Nano 12B V2 VL",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.2,output:.6,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"nvidia/nemotron-nano-9b-v2":{id:"nvidia/nemotron-nano-9b-v2",name:"Nvidia Nemotron Nano 9B V2",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.06,output:.23,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:131072},"openai/gpt-3.5-turbo":{id:"openai/gpt-3.5-turbo",name:"GPT-3.5 Turbo",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.5,output:1.5,cacheRead:0,cacheWrite:0},contextWindow:16385,maxTokens:4096},"openai/gpt-4-turbo":{id:"openai/gpt-4-turbo",name:"GPT-4 Turbo",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:10,output:30,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:4096,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1":{id:"openai/gpt-4.1",name:"GPT-4.1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:1047576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1-fast":{id:"openai/gpt-4.1-fast",name:"GPT-4.1 (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:3.5,output:14,cacheRead:.875,cacheWrite:0},contextWindow:1047576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1-mini":{id:"openai/gpt-4.1-mini",name:"GPT-4.1 mini",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.4,output:1.6,cacheRead:.1,cacheWrite:0},contextWindow:1047576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1-mini-fast":{id:"openai/gpt-4.1-mini-fast",name:"GPT-4.1 mini (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.7,output:2.8,cacheRead:.175,cacheWrite:0},contextWindow:1047576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1-nano":{id:"openai/gpt-4.1-nano",name:"GPT-4.1 nano",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.1,output:.4,cacheRead:.025,cacheWrite:0},contextWindow:1047576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4.1-nano-fast":{id:"openai/gpt-4.1-nano-fast",name:"GPT-4.1 nano (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.2,output:.8,cacheRead:.05,cacheWrite:0},contextWindow:1047576,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o":{id:"openai/gpt-4o",name:"GPT-4o",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0},contextWindow:128e3,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o-fast":{id:"openai/gpt-4o-fast",name:"GPT-4o (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:4.25,output:17,cacheRead:2.125,cacheWrite:0},contextWindow:128e3,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o-mini":{id:"openai/gpt-4o-mini",name:"GPT-4o mini",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.15,output:.6,cacheRead:.075,cacheWrite:0},contextWindow:128e3,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-4o-mini-fast":{id:"openai/gpt-4o-mini-fast",name:"GPT-4o mini (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.25,output:1,cacheRead:.125,cacheWrite:0},contextWindow:128e3,maxTokens:16384,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5":{id:"openai/gpt-5",name:"GPT-5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-codex":{id:"openai/gpt-5-codex",name:"GPT-5-Codex",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:10,cacheRead:.13,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-fast":{id:"openai/gpt-5-fast",name:"GPT-5 (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2.5,output:20,cacheRead:.25,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-mini":{id:"openai/gpt-5-mini",name:"GPT-5 mini",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.25,output:2,cacheRead:.025,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-mini-fast":{id:"openai/gpt-5-mini-fast",name:"GPT-5 mini (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.45,output:3.6,cacheRead:.045,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-nano":{id:"openai/gpt-5-nano",name:"GPT-5 nano",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.05,output:.4,cacheRead:.005,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5-pro":{id:"openai/gpt-5-pro",name:"GPT-5 pro",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:15,output:120,cacheRead:0,cacheWrite:0},contextWindow:4e5,maxTokens:272e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.1-codex":{id:"openai/gpt-5.1-codex",name:"GPT-5.1-Codex",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:10,cacheRead:.13,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.1-codex-max":{id:"openai/gpt-5.1-codex-max",name:"GPT 5.1 Codex Max",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.1-codex-mini":{id:"openai/gpt-5.1-codex-mini",name:"GPT 5.1 Codex Mini",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.25,output:2,cacheRead:.03,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.1-thinking":{id:"openai/gpt-5.1-thinking",name:"GPT 5.1 Thinking",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.1-thinking-fast":{id:"openai/gpt-5.1-thinking-fast",name:"GPT 5.1 Thinking (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2.5,output:20,cacheRead:.25,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.2":{id:"openai/gpt-5.2",name:"GPT 5.2",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.2-codex":{id:"openai/gpt-5.2-codex",name:"GPT 5.2 Codex",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.2-fast":{id:"openai/gpt-5.2-fast",name:"GPT 5.2 (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:3.5,output:28,cacheRead:.35,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.2-pro":{id:"openai/gpt-5.2-pro",name:"GPT 5.2 ",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:21,output:168,cacheRead:0,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.3-codex":{id:"openai/gpt-5.3-codex",name:"GPT 5.3 Codex",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.3-codex-fast":{id:"openai/gpt-5.3-codex-fast",name:"GPT 5.3 Codex (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:3.5,output:28,cacheRead:.35,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4":{id:"openai/gpt-5.4",name:"GPT 5.4",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-fast":{id:"openai/gpt-5.4-fast",name:"GPT 5.4 (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-mini":{id:"openai/gpt-5.4-mini",name:"GPT 5.4 Mini",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-mini-fast":{id:"openai/gpt-5.4-mini-fast",name:"GPT 5.4 Mini (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.5,output:9,cacheRead:.15,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-nano":{id:"openai/gpt-5.4-nano",name:"GPT 5.4 Nano",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.4-pro":{id:"openai/gpt-5.4-pro",name:"GPT 5.4 Pro",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:30,output:180,cacheRead:0,cacheWrite:0},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.5":{id:"openai/gpt-5.5",name:"GPT 5.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.5-fast":{id:"openai/gpt-5.5-fast",name:"GPT 5.5 (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:12.5,output:75,cacheRead:1.25,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.5-pro":{id:"openai/gpt-5.5-pro",name:"GPT 5.5 Pro",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:30,output:180,cacheRead:0,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh",off:null,minimal:null,low:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-luna":{id:"openai/gpt-5.6-luna",name:"GPT 5.6 Luna",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-luna-fast":{id:"openai/gpt-5.6-luna-fast",name:"GPT 5.6 Luna (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.4,output:2.4,cacheRead:.04,cacheWrite:.5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-sol":{id:"openai/gpt-5.6-sol",name:"GPT 5.6 Sol",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:4,output:20,cacheRead:.4,cacheWrite:5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-sol-fast":{id:"openai/gpt-5.6-sol-fast",name:"GPT 5.6 Sol (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:8,output:40,cacheRead:.8,cacheWrite:10},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-terra":{id:"openai/gpt-5.6-terra",name:"GPT 5.6 Terra",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-5.6-terra-fast":{id:"openai/gpt-5.6-terra-fast",name:"GPT 5.6 Terra (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:4,output:24,cacheRead:.4,cacheWrite:5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-astra":{id:"openai/gpt-6-astra",name:"GPT-6 Astra",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-astra-fast":{id:"openai/gpt-6-astra-fast",name:"GPT-6 Astra (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:20,output:100,cacheRead:2,cacheWrite:25},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-luna":{id:"openai/gpt-6-luna",name:"GPT-6 Luna",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-luna-fast":{id:"openai/gpt-6-luna-fast",name:"GPT-6 Luna (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.2,output:1,cacheRead:.02,cacheWrite:.25},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-sol":{id:"openai/gpt-6-sol",name:"GPT-6 Sol",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-6-sol-fast":{id:"openai/gpt-6-sol-fast",name:"GPT-6 Sol (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:4,output:20,cacheRead:.4,cacheWrite:5},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:{xhigh:"xhigh"},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"GPT OSS 120B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.1,output:.5,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:131072},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"GPT OSS 20B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.03,output:.14,cacheRead:0,cacheWrite:0},contextWindow:131072,maxTokens:8192},"openai/gpt-oss-safeguard-120b":{id:"openai/gpt-oss-safeguard-120b",name:"GPT OSS Safeguard 120B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.15,output:.6,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16e3},"openai/gpt-oss-safeguard-20b":{id:"openai/gpt-oss-safeguard-20b",name:"GPT OSS Safeguard 20B",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.07,output:.2,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16e3},"openai/o1":{id:"openai/o1",name:"o1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o3":{id:"openai/o3",name:"o3",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o3-fast":{id:"openai/o3-fast",name:"o3 (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:3.5,output:14,cacheRead:.875,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o3-mini":{id:"openai/o3-mini",name:"o3-mini",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0},contextWindow:2e5,maxTokens:1e5},"openai/o3-pro":{id:"openai/o3-pro",name:"o3 Pro",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:20,output:80,cacheRead:0,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o4-mini":{id:"openai/o4-mini",name:"o4-mini",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.1,output:4.4,cacheRead:.275,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"openai/o4-mini-fast":{id:"openai/o4-mini-fast",name:"o4-mini (Fast)",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"poolside/laguna-s-2.1":{id:"poolside/laguna-s-2.1",name:"Laguna S 2.1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.1,output:.2,cacheRead:.01,cacheWrite:0},contextWindow:1e6,maxTokens:131072},"poolside/laguna-s-2.1-free":{id:"poolside/laguna-s-2.1-free",name:"Laguna S 2.1 Free",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:256e3,maxTokens:32768},"quiverai/arrow-2":{id:"quiverai/arrow-2",name:"Arrow 2",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:4,output:20,cacheRead:.4,cacheWrite:5},contextWindow:131072,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"quiverai/arrow-2-telos":{id:"quiverai/arrow-2-telos",name:"Arrow 2 Telos",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:6,output:30,cacheRead:.6,cacheWrite:7.5},contextWindow:131072,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"sakana/fugu-max":{id:"sakana/fugu-max",name:"Fugu Max",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:6,cacheRead:.25,cacheWrite:0},contextWindow:1e6,maxTokens:1e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"sakana/fugu-ultra":{id:"sakana/fugu-ultra",name:"Fugu Ultra",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:1e6,maxTokens:1e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"sakana/fugu-ultra-v2":{id:"sakana/fugu-ultra-v2",name:"Fugu Ultra v2",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:1e6,maxTokens:1e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"sakana/namazu":{id:"sakana/namazu",name:"Sakana Namazu",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.95,output:4,cacheRead:.15,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.1-fast-non-reasoning":{id:"spacexai/grok-4.1-fast-non-reasoning",name:"Grok 4.1 Fast Non-Reasoning",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.2,output:.5,cacheRead:.05,cacheWrite:0},contextWindow:1e6,maxTokens:1e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.1-fast-reasoning":{id:"spacexai/grok-4.1-fast-reasoning",name:"Grok 4.1 Fast Reasoning",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.2,output:.5,cacheRead:.05,cacheWrite:0},contextWindow:1e6,maxTokens:1e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.20-multi-agent":{id:"spacexai/grok-4.20-multi-agent",name:"Grok 4.20 Multi-Agent",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0},contextWindow:2e6,maxTokens:2e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.20-multi-agent-beta":{id:"spacexai/grok-4.20-multi-agent-beta",name:"Grok 4.20 Multi Agent Beta",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0},contextWindow:2e6,maxTokens:2e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.20-non-reasoning":{id:"spacexai/grok-4.20-non-reasoning",name:"Grok 4.20 Non-Reasoning",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0},contextWindow:2e6,maxTokens:2e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.20-non-reasoning-beta":{id:"spacexai/grok-4.20-non-reasoning-beta",name:"Grok 4.20 Beta Non-Reasoning",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!1,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0},contextWindow:2e6,maxTokens:2e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.20-reasoning":{id:"spacexai/grok-4.20-reasoning",name:"Grok 4.20 Reasoning",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0},contextWindow:2e6,maxTokens:2e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.20-reasoning-beta":{id:"spacexai/grok-4.20-reasoning-beta",name:"Grok 4.20 Beta Reasoning",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0},contextWindow:2e6,maxTokens:2e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.3":{id:"spacexai/grok-4.3",name:"Grok 4.3",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0},contextWindow:1e6,maxTokens:1e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.5":{id:"spacexai/grok-4.5",name:"Grok 4.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:6,cacheRead:.3,cacheWrite:0},contextWindow:5e5,maxTokens:5e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.6":{id:"spacexai/grok-4.6",name:"Grok 4.6",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:2,output:6,cacheRead:.5,cacheWrite:0},contextWindow:5e5,maxTokens:5e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-4.7":{id:"spacexai/grok-4.7",name:"Grok 4.7",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.2,output:3.6,cacheRead:.3,cacheWrite:0},contextWindow:5e5,maxTokens:5e5,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"spacexai/grok-build-0.1":{id:"spacexai/grok-build-0.1",name:"Grok Build 0.1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1,output:2,cacheRead:.2,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"stepfun/step-3.5-flash":{id:"stepfun/step-3.5-flash",name:"StepFun 3.5 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.09,output:.3,cacheRead:.02,cacheWrite:0},contextWindow:262114,maxTokens:262114,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"stepfun/step-3.7-flash":{id:"stepfun/step-3.7-flash",name:"Step 3.7 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.2,output:1.15,cacheRead:.04,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"tencent/hy3":{id:"tencent/hy3",name:"Hy3",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.14,output:.58,cacheRead:.035,cacheWrite:0},contextWindow:262144,maxTokens:262144},"tencent/hy4-preview":{id:"tencent/hy4-preview",name:"Tencent Hy4 Preview",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.834,output:2.501,cacheRead:.042,cacheWrite:0},contextWindow:1024e3,maxTokens:64e3},"thinkingmachines/inkling":{id:"thinkingmachines/inkling",name:"Inkling",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1,output:4.05,cacheRead:.17,cacheWrite:0},contextWindow:256e3,maxTokens:256e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"thinkingmachines/inkling-small":{id:"thinkingmachines/inkling-small",name:"Inkling Small",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.5,output:1.2,cacheRead:.1,cacheWrite:0},contextWindow:1e6,maxTokens:1e6,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"xiaomi/mimo-v2.5":{id:"xiaomi/mimo-v2.5",name:"MiMo M2.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.14,output:.28,cacheRead:.0028,cacheWrite:0},contextWindow:105e4,maxTokens:131100,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"xiaomi/mimo-v2.5-pro":{id:"xiaomi/mimo-v2.5-pro",name:"MiMo V2.5 Pro",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.435,output:.87,cacheRead:.0036,cacheWrite:0},contextWindow:105e4,maxTokens:131e3},"xiaomi/mimo-v2.6-flash":{id:"xiaomi/mimo-v2.6-flash",name:"MiMo V2.6 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.14,output:.28,cacheRead:.0028,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"xiaomi/mimo-v2.6-pro":{id:"xiaomi/mimo-v2.6-pro",name:"MiMo V2.6 Pro",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.435,output:.87,cacheRead:.0036,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"xiaomi/mimo-v2.6-pro-ultraspeed":{id:"xiaomi/mimo-v2.6-pro-ultraspeed",name:"MiMo V2.6 Pro UltraSpeed",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:4.35,output:8.7,cacheRead:.036,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai/glm-4.5":{id:"zai/glm-4.5",name:"GLM 4.5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.6,output:2.2,cacheRead:.11,cacheWrite:0},contextWindow:128e3,maxTokens:96e3},"zai/glm-4.5-air":{id:"zai/glm-4.5-air",name:"GLM 4.5 Air",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.2,output:1.1,cacheRead:.03,cacheWrite:0},contextWindow:128e3,maxTokens:96e3},"zai/glm-4.5v":{id:"zai/glm-4.5v",name:"GLM 4.5V",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.6,output:1.8,cacheRead:.11,cacheWrite:0},contextWindow:66e3,maxTokens:16e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai/glm-4.6":{id:"zai/glm-4.6",name:"GLM 4.6",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.6,output:2.2,cacheRead:.11,cacheWrite:0},contextWindow:2e5,maxTokens:96e3},"zai/glm-4.7":{id:"zai/glm-4.7",name:"GLM 4.7",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.6,output:2.2,cacheRead:.12,cacheWrite:0},contextWindow:2e5,maxTokens:12e4},"zai/glm-4.7-flash":{id:"zai/glm-4.7-flash",name:"GLM 4.7 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.07,output:.4,cacheRead:0,cacheWrite:0},contextWindow:2e5,maxTokens:131e3},"zai/glm-4.7-flashx":{id:"zai/glm-4.7-flashx",name:"GLM 4.7 FlashX",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.06,output:.4,cacheRead:.01,cacheWrite:0},contextWindow:2e5,maxTokens:128e3},"zai/glm-5":{id:"zai/glm-5",name:"GLM 5",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1,output:3.2,cacheRead:0,cacheWrite:0},contextWindow:202800,maxTokens:131100},"zai/glm-5-turbo":{id:"zai/glm-5-turbo",name:"GLM 5 Turbo",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1.2,output:4,cacheRead:.24,cacheWrite:0},contextWindow:202800,maxTokens:131100},"zai/glm-5.1":{id:"zai/glm-5.1",name:"GLM 5.1",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},contextWindow:202800,maxTokens:64e3},"zai/glm-5.2":{id:"zai/glm-5.2",name:"GLM 5.2",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:.8,output:2.55,cacheRead:.16,cacheWrite:0},contextWindow:1e6,maxTokens:128e3},"zai/glm-5.2-fast":{id:"zai/glm-5.2-fast",name:"GLM 5.2 Fast",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:2.1,output:6.6,cacheRead:.21,cacheWrite:0},contextWindow:1e6,maxTokens:128e3},"zai/glm-5.3":{id:"zai/glm-5.3",name:"GLM 5.3",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:1.4,output:4.4,cacheRead:.14,cacheWrite:0},contextWindow:1e6,maxTokens:1e6},"zai/glm-5.3-fast":{id:"zai/glm-5.3-fast",name:"GLM 5.3 Fast",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text"],compat:{allowEmptySignature:!0},cost:{input:2.1,output:6.6,cacheRead:.21,cacheWrite:0},contextWindow:1048576,maxTokens:262144},"zai/glm-5.3-flash":{id:"zai/glm-5.3-flash",name:"GLM 5.3 Flash",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},contextWindow:1e6,maxTokens:131e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai/glm-5.3-flashx":{id:"zai/glm-5.3-flashx",name:"GLM 5.3 FlashX",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:.37,output:1.25,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"zai/glm-5v-turbo":{id:"zai/glm-5v-turbo",name:"GLM 5V Turbo",api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",provider:"vercel-ai-gateway",reasoning:!0,input:["text","image"],compat:{allowEmptySignature:!0},cost:{input:1.2,output:4,cacheRead:.24,cacheWrite:0},contextWindow:2e5,maxTokens:128e3,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var CIe,qrt=v(()=>{p();ICn();Ts();CIe=Qn("vercel-ai-gateway",wCn)});var vCn,TCn=v(()=>{vCn={"openai-responses":{"grok-4.3":{id:"grok-4.3",name:"Grok 4.3",api:"openai-responses",provider:"xai",baseUrl:"https://api.x.ai/v1",compat:{supportsLongCacheRetention:!1},reasoning:!0,input:["text","image"],cost:{input:1.25,output:2.5,cacheRead:.2,cacheWrite:0,tiers:[{inputTokensAbove:2e5,input:2.5,output:5,cacheRead:.4,cacheWrite:0}]},contextWindow:1e6,maxTokens:3e4,thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-4.5":{id:"grok-4.5",name:"Grok 4.5",api:"openai-responses",provider:"xai",baseUrl:"https://api.x.ai/v1",compat:{supportsLongCacheRetention:!1},reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.3,cacheWrite:0,tiers:[{inputTokensAbove:2e5,input:4,output:12,cacheRead:.6,cacheWrite:0}]},contextWindow:5e5,maxTokens:5e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-4.6":{id:"grok-4.6",name:"Grok 4.6",api:"openai-responses",provider:"xai",baseUrl:"https://api.x.ai/v1",compat:{supportsLongCacheRetention:!1},reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:2e5,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:5e5,maxTokens:5e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"grok-4.7":{id:"grok-4.7",name:"Grok 4.7",api:"openai-responses",provider:"xai",baseUrl:"https://api.x.ai/v1",compat:{supportsLongCacheRetention:!1},reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:2e5,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:5e5,maxTokens:5e5,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var IIe,jrt=v(()=>{p();TCn();Ts();IIe=Qn("xai",vCn)});var kCn,RCn=v(()=>{kCn={"openai-completions":{"mimo-v2.5":{id:"mimo-v2.5",name:"MiMo-V2.5",api:"openai-completions",provider:"xiaomi",baseUrl:"https://api.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:.14,output:.28,cacheRead:.0028,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.5-pro":{id:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",api:"openai-completions",provider:"xiaomi",baseUrl:"https://api.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text"],cost:{input:.435,output:.87,cacheRead:.0036,cacheWrite:0},contextWindow:1048576,maxTokens:131072},"mimo-v2.5-pro-ultraspeed":{id:"mimo-v2.5-pro-ultraspeed",name:"MiMo-V2.5-Pro-UltraSpeed",api:"openai-completions",provider:"xiaomi",baseUrl:"https://api.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text"],cost:{input:1.305,output:2.61,cacheRead:.0108,cacheWrite:0},contextWindow:1048576,maxTokens:131072},"mimo-v2.6-flash":{id:"mimo-v2.6-flash",name:"MiMo-V2.6-Flash",api:"openai-completions",provider:"xiaomi",baseUrl:"https://api.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:.14,output:.28,cacheRead:.0028,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.6-pro":{id:"mimo-v2.6-pro",name:"MiMo-V2.6-Pro",api:"openai-completions",provider:"xiaomi",baseUrl:"https://api.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:.435,output:.87,cacheRead:.0036,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.6-pro-ultraspeed":{id:"mimo-v2.6-pro-ultraspeed",name:"MiMo-V2.6-Pro-UltraSpeed",api:"openai-completions",provider:"xiaomi",baseUrl:"https://api.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:4.35,output:8.7,cacheRead:.036,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var wIe,Vrt=v(()=>{p();RCn();Ts();wIe=Qn("xiaomi",kCn)});var NCn,BCn=v(()=>{NCn={"openai-completions":{"mimo-v2.5":{id:"mimo-v2.5",name:"MiMo-V2.5",api:"openai-completions",provider:"xiaomi-token-plan-ams",baseUrl:"https://token-plan-ams.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.5-pro":{id:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",api:"openai-completions",provider:"xiaomi-token-plan-ams",baseUrl:"https://token-plan-ams.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072},"mimo-v2.6-flash":{id:"mimo-v2.6-flash",name:"MiMo-V2.6-Flash",api:"openai-completions",provider:"xiaomi-token-plan-ams",baseUrl:"https://token-plan-ams.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.6-pro":{id:"mimo-v2.6-pro",name:"MiMo-V2.6-Pro",api:"openai-completions",provider:"xiaomi-token-plan-ams",baseUrl:"https://token-plan-ams.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var TIe,Yrt=v(()=>{p();BCn();Ts();TIe=Qn("xiaomi-token-plan-ams",NCn)});var PCn,DCn=v(()=>{PCn={"openai-completions":{"mimo-v2.5":{id:"mimo-v2.5",name:"MiMo-V2.5",api:"openai-completions",provider:"xiaomi-token-plan-cn",baseUrl:"https://token-plan-cn.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.5-pro":{id:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",api:"openai-completions",provider:"xiaomi-token-plan-cn",baseUrl:"https://token-plan-cn.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072},"mimo-v2.6-flash":{id:"mimo-v2.6-flash",name:"MiMo-V2.6-Flash",api:"openai-completions",provider:"xiaomi-token-plan-cn",baseUrl:"https://token-plan-cn.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.6-pro":{id:"mimo-v2.6-pro",name:"MiMo-V2.6-Pro",api:"openai-completions",provider:"xiaomi-token-plan-cn",baseUrl:"https://token-plan-cn.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var vIe,zrt=v(()=>{p();DCn();Ts();vIe=Qn("xiaomi-token-plan-cn",PCn)});var OCn,MCn=v(()=>{OCn={"openai-completions":{"mimo-v2.5":{id:"mimo-v2.5",name:"MiMo-V2.5",api:"openai-completions",provider:"xiaomi-token-plan-sgp",baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.5-pro":{id:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",api:"openai-completions",provider:"xiaomi-token-plan-sgp",baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072},"mimo-v2.6-flash":{id:"mimo-v2.6-flash",name:"MiMo-V2.6-Flash",api:"openai-completions",provider:"xiaomi-token-plan-sgp",baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"mimo-v2.6-pro":{id:"mimo-v2.6-pro",name:"MiMo-V2.6-Pro",api:"openai-completions",provider:"xiaomi-token-plan-sgp",baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1",compat:{supportsStrictMode:!0,requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:"deepseek"},reasoning:!0,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}}}}});var RIe,Krt=v(()=>{p();MCn();Ts();RIe=Qn("xiaomi-token-plan-sgp",OCn)});var FCn,LCn=v(()=>{FCn={"openai-completions":{"glm-4.7":{id:"glm-4.7",name:"GLM-4.7",api:"openai-completions",provider:"zai",baseUrl:"https://api.z.ai/api/coding/paas/v4",reasoning:!0,input:["text"],cost:{input:.6,output:2.2,cacheRead:.11,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:204800,maxTokens:131072},"glm-5-turbo":{id:"glm-5-turbo",name:"GLM-5-Turbo",api:"openai-completions",provider:"zai",baseUrl:"https://api.z.ai/api/coding/paas/v4",reasoning:!0,input:["text"],cost:{input:1.2,output:4,cacheRead:.24,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:2e5,maxTokens:131072},"glm-5.2":{id:"glm-5.2",name:"GLM-5.2",api:"openai-completions",provider:"zai",baseUrl:"https://api.z.ai/api/coding/paas/v4",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:1e6,maxTokens:131072},"glm-5.2-highspeed":{id:"glm-5.2-highspeed",name:"GLM-5.2 Highspeed",api:"openai-completions",provider:"zai",baseUrl:"https://api.z.ai/api/coding/paas/v4",reasoning:!0,thinkingLevelMap:{off:"none",minimal:null,low:null,medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:1e6,maxTokens:131072},"glm-5.3":{id:"glm-5.3",name:"GLM-5.3",api:"openai-completions",provider:"zai",baseUrl:"https://api.z.ai/api/coding/paas/v4",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:1e6,maxTokens:131072},"glm-5.3-flash":{id:"glm-5.3-flash",name:"GLM-5.3-Flash",api:"openai-completions",provider:"zai",baseUrl:"https://api.z.ai/api/coding/paas/v4",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"glm-5.3-highspeed":{id:"glm-5.3-highspeed",name:"GLM-5.3 Highspeed",api:"openai-completions",provider:"zai",baseUrl:"https://api.z.ai/api/coding/paas/v4",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:1e6,maxTokens:131072}}}});var kIe,Jrt=v(()=>{p();LCn();Ts();kIe=Qn("zai",FCn)});var UCn,QCn=v(()=>{UCn={"openai-completions":{"glm-4.6v":{id:"glm-4.6v",name:"GLM-4.6V",api:"openai-completions",provider:"zai-coding-cn",baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",reasoning:!0,input:["text","image"],cost:{input:.3,output:.9,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:128e3,maxTokens:32768,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"glm-5.3":{id:"glm-5.3",name:"GLM-5.3",api:"openai-completions",provider:"zai-coding-cn",baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:1.4,output:4.4,cacheRead:.26,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:1e6,maxTokens:131072},"glm-5.3-flash":{id:"glm-5.3-flash",name:"GLM-5.3-Flash",api:"openai-completions",provider:"zai-coding-cn",baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text","image"],cost:{input:.15,output:.5,cacheRead:.03,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:1e6,maxTokens:131072,inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}}},"glm-5.3-highspeed":{id:"glm-5.3-highspeed",name:"GLM-5.3 Highspeed",api:"openai-completions",provider:"zai-coding-cn",baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",reasoning:!0,thinkingLevelMap:{off:null,minimal:null,low:"low",medium:null,high:"high",xhigh:null,max:"max"},input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!0,maxTokensField:"max_tokens",thinkingFormat:"zai",supportsStrictMode:!0,zaiToolStream:!0},contextWindow:1e6,maxTokens:131072}}}});var BIe,Xrt=v(()=>{p();QCn();Ts();BIe=Qn("zai-coding-cn",UCn)});var NIe,GCn=v(()=>{p();prt();mrt();hrt();frt();grt();Art();yrt();Ert();brt();_rt();xrt();Srt();Crt();Irt();wrt();Trt();vrt();Rrt();krt();Brt();Nrt();Drt();Prt();Mrt();Ort();Lrt();Frt();Qrt();Urt();Grt();$rt();Wrt();Hrt();qrt();jrt();Vrt();Yrt();zrt();Krt();Jrt();Xrt();NIe={"amazon-bedrock":qCe,"ant-ling":jCe,anthropic:VCe,"azure-openai-responses":YCe,baseten:zCe,cerebras:KCe,"cloudflare-ai-gateway":JCe,"cloudflare-workers-ai":XCe,deepseek:ZCe,fireworks:eIe,"github-copilot":tIe,google:nIe,"google-vertex":rIe,groq:iIe,huggingface:sIe,"kimi-coding":oIe,meta:aIe,minimax:cIe,"minimax-cn":lIe,mistral:uIe,moonshotai:dIe,"moonshotai-cn":pIe,nvidia:mIe,openai:hIe,"openai-codex":fIe,opencode:gIe,"opencode-go":AIe,openrouter:yIe,"qwen-token-plan":EIe,"qwen-token-plan-cn":bIe,"qwen-token-plan-individual":_Ie,radius:xIe,together:SIe,"vercel-ai-gateway":CIe,xai:IIe,xiaomi:wIe,"xiaomi-token-plan-ams":TIe,"xiaomi-token-plan-cn":vIe,"xiaomi-token-plan-sgp":RIe,zai:kIe,"zai-coding-cn":BIe}});function $Cn(){return Mn({id:"amazon-bedrock",name:"Amazon Bedrock",auth:{apiKey:SRi},models:Object.values(qCe),api:MX()})}var SRi,WCn=v(()=>{p();VEe();ni();prt();SRi={name:"AWS credentials or bearer token",login:async t=>{t.signal.throwIfAborted();let e=await t.prompt({type:"select",message:"Select Amazon Bedrock authentication method:",options:[{id:"bearer-token",label:"Bearer token"},{id:"aws-profile",label:"AWS profile"},{id:"credential-chain",label:"Existing AWS credential chain"}]});if(t.signal.throwIfAborted(),e==="bearer-token")return{type:"api_key",key:await t.prompt({type:"secret",message:"Enter Amazon Bedrock bearer token"})};if(t.notify({type:"info",message:"Amazon Bedrock supports AWS profiles, IAM credentials, and role-based credentials.",links:[{label:"AWS credential provider chain",url:"https://docs.aws.amazon.com/sdkref/latest/guide/standardized-credentials.html"}]}),e==="aws-profile")return{type:"api_key",env:{AWS_PROFILE:await t.prompt({type:"text",message:"Enter AWS profile name"})}};if(e!=="credential-chain")throw new Error(`Unknown Amazon Bedrock auth method: ${e}`);return await t.prompt({type:"text",message:"Configure AWS credentials, then press Enter to continue"}),{type:"api_key"}},resolve:async({ctx:t,credential:e,signal:n})=>{let r=async i=>{n.throwIfAborted();let s=await t.env(i);return n.throwIfAborted(),s};if(e?.key)return{auth:{apiKey:e.key},env:e.env,source:"stored credential"};if(await r("AWS_BEARER_TOKEN_BEDROCK"))return{auth:{},source:"AWS_BEARER_TOKEN_BEDROCK"};if(e?.env?.AWS_PROFILE??await r("AWS_PROFILE"))return{auth:{},env:e?.env,source:e?.env?.AWS_PROFILE?"stored credential":"AWS_PROFILE"};if(await r("AWS_ACCESS_KEY_ID")&&await r("AWS_SECRET_ACCESS_KEY"))return{auth:{},source:"AWS access keys"};if(await r("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"))return{auth:{},source:"ECS task role"};if(await r("AWS_CONTAINER_CREDENTIALS_FULL_URI"))return{auth:{},source:"ECS task role"};if(await r("AWS_WEB_IDENTITY_TOKEN_FILE"))return{auth:{},source:"web identity token"}}}});function HCn(){return Mn({id:"ant-ling",name:"Ant Ling",baseUrl:"https://api.ant-ling.com/v1",auth:{apiKey:tr("Ant Ling API key",["ANT_LING_API_KEY"])},models:Object.values(jCe),api:qr()})}var qCn=v(()=>{p();ba();Ls();ni();mrt()});var CRi,rD,Hh,jCn,VCn,YCn,DIe,zCn,KCn,JCn,XCn,zI=v(()=>{p();CRi=function(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,i,s,o){return r?e?".jsx":".js":i&&(!s||!o)?n:i+s+"."+o.toLowerCase()+"js"}):t},rD=t=>{let e=x.endsWith(".js")?t.replace(/\.ts$/,".js"):t;return import(CRi(e))},jCn=async()=>Hh?Hh.anthropic():(await rD("./anthropic.ts")).anthropicOAuth,VCn=async()=>Hh?Hh.openaiCodex():(await rD("./openai-codex.ts")).openaiCodexOAuth,YCn=async()=>Hh?Hh.githubCopilot():(await rD("./github-copilot.ts")).githubCopilotOAuth,DIe=async()=>Hh?Hh.openrouter():(await rD("./openrouter.ts")).openRouterOAuth,zCn=async()=>Hh?Hh.kimiCoding():(await rD("./kimi-coding.ts")).kimiCodingOAuth,KCn=async()=>Hh?Hh.meta():(await rD("./meta.ts")).metaOAuth,JCn=async()=>Hh?Hh.xai():(await rD("./xai.ts")).xaiOAuth,XCn=async t=>Hh?Hh.radius(t):(await rD("./radius.ts")).createRadiusOAuth(t)});function IRi(){return{name:"Anthropic API key",login:async t=>{t.signal.throwIfAborted();let e=await t.prompt({type:"secret",message:"Enter Anthropic API key"});return t.signal.throwIfAborted(),{type:"api_key",key:e}},resolve:async({ctx:t,credential:e,signal:n})=>{if(n.throwIfAborted(),e?.key)return{auth:{apiKey:e.key},env:e.env,source:"stored credential"};let r=await t.env(s4);if(n.throwIfAborted(),r)return{auth:{headers:{Authorization:`Bearer ${r}`}},source:s4};for(let i of[b_e,__e]){let s=await t.env(i);if(n.throwIfAborted(),s)return{auth:{apiKey:s},source:i}}}}}function ZCn(){return Mn({id:"anthropic",name:"Anthropic",baseUrl:"https://api.anthropic.com",auth:{apiKey:IRi(),oauth:up({name:"Anthropic (Claude Pro/Max)",isSubscription:!0,load:jCn})},models:Object.values(VCe),api:rc()})}var eIn=v(()=>{p();Uf();Ls();zI();x_e();ni();hrt()});function tIn(){return Mn({id:"azure-openai-responses",name:"Azure OpenAI",auth:{apiKey:tr("Azure OpenAI API key",["AZURE_OPENAI_API_KEY"])},models:Object.values(YCe),api:t2()})}var nIn=v(()=>{p();PX();Ls();ni();frt()});function rIn(){return Mn({id:"baseten",name:"Baseten",baseUrl:"https://inference.baseten.co/v1",auth:{apiKey:tr("Baseten API key",["BASETEN_API_KEY"])},models:Object.values(zCe),api:qr()})}var iIn=v(()=>{p();ba();Ls();ni();grt()});function sIn(){return Mn({id:"cerebras",name:"Cerebras",baseUrl:"https://api.cerebras.ai/v1",auth:{apiKey:tr("Cerebras API key",["CEREBRAS_API_KEY"])},models:Object.values(KCe),api:qr()})}var oIn=v(()=>{p();ba();Ls();ni();Art()});async function Zrt(t,e,n,r){let i=n?t===eit?n.key:n.env?.[t]:void 0;if(i!==void 0)return i;r.throwIfAborted();let s=await e.env(t);return r.throwIfAborted(),s}async function aIn(t,e,n,r){let i=await Zrt(eit,e,n,r),s=await Zrt(wRi,e,n,r),o=t==="ai-gateway"?await Zrt(TRi,e,n,r):void 0;if(!(!i||!s||t==="ai-gateway"&&!o))return{apiKey:i,env:{CLOUDFLARE_ACCOUNT_ID:s,...o?{CLOUDFLARE_GATEWAY_ID:o}:{}},source:n?"stored credential":eit}}function cIn(){return{name:"Cloudflare API key",login:async t=>{let e=await t.prompt({type:"secret",message:"Enter Cloudflare API key"}),n=await t.prompt({type:"text",message:"Enter Cloudflare account ID"});return{type:"api_key",key:e,env:{CLOUDFLARE_ACCOUNT_ID:n}}},resolve:async({ctx:t,credential:e,signal:n})=>{let r=await aIn("workers-ai",t,e,n);if(r)return{auth:{apiKey:r.apiKey},env:r.env,source:r.source}}}}function lIn(){return{name:"Cloudflare API key",login:async t=>{let e=await t.prompt({type:"secret",message:"Enter Cloudflare API key"}),n=await t.prompt({type:"text",message:"Enter Cloudflare account ID"}),r=await t.prompt({type:"text",message:"Enter Cloudflare AI Gateway ID"});return{type:"api_key",key:e,env:{CLOUDFLARE_ACCOUNT_ID:n,CLOUDFLARE_GATEWAY_ID:r}}},resolve:async({ctx:t,credential:e,signal:n})=>{let r=await aIn("ai-gateway",t,e,n);if(r)return{auth:{headers:{"cf-aig-authorization":`Bearer ${r.apiKey}`,Authorization:null,"x-api-key":null}},env:r.env,source:r.source}}}}var eit,wRi,TRi,tit=v(()=>{p();eit="CLOUDFLARE_API_KEY",wRi="CLOUDFLARE_ACCOUNT_ID",TRi="CLOUDFLARE_GATEWAY_ID"});function uIn(t,e){if(!e)return t;let n=t.baseUrl.replaceAll(`{${nit}}`,e[nit]??`{${nit}}`).replaceAll(`{${rit}}`,e[rit]??`{${rit}}`);return n===t.baseUrl?t:{...t,baseUrl:n}}function r8(t){return{stream:(e,n,r)=>t.stream(uIn(e,r?.env),n,r),streamSimple:(e,n,r)=>t.streamSimple(uIn(e,r?.env),n,r)}}var nit,rit,iit=v(()=>{p();nit="CLOUDFLARE_ACCOUNT_ID",rit="CLOUDFLARE_GATEWAY_ID"});function dIn(){return Mn({id:"cloudflare-ai-gateway",name:"Cloudflare AI Gateway",auth:{apiKey:lIn()},models:Object.values(JCe),api:{"anthropic-messages":r8(rc()),"openai-completions":r8(qr()),"openai-responses":r8(ip())}})}var pIn=v(()=>{p();Uf();ba();kx();ni();yrt();tit();iit()});function mIn(){return Mn({id:"cloudflare-workers-ai",name:"Cloudflare Workers AI",auth:{apiKey:cIn()},models:Object.values(XCe),api:r8(qr())})}var hIn=v(()=>{p();ba();ni();tit();iit();Ert()});var gIn,fIn=v(()=>{gIn={schemaVersion:3,generatedAt:"2026-09-22T19:31:44.346Z",structureHash:"c6acf0a192036dd24f23414d3064d4ebbec194485398fee5b9def0b4d86a0095",files:{"amazon-bedrock.json":"348babe9936d0d8efa54e3afa60aecacdc7ad39a9ca11687eeff92121367980d","ant-ling.json":"335137fb6dc428544ca56ab8fd52b300e7d0dcf97869fa10c1022669da8bfdeb","anthropic.json":"474a010cd96c759d60419a6ba745747d9a87f172276dc85b7568da9d072b4e75","azure-openai-responses.json":"c351c6af1882660ffa8a8598594b86671b45817106e45ac920535aaeac59fc96","baseten.json":"60001c0aa6c7c9112b00c2ed6f646b58baed196782fe4db6028074e9ccedc5e5","cerebras.json":"f180b9ca76bc103dede2c10827e859895742bcfda67f6205758c0bec6be391b4","cloudflare-ai-gateway.json":"21ca8d9b740a752d6e70a8ca9f3cb75417ba3ff69ffc5b84440b2c1ff40d88cb","cloudflare-workers-ai.json":"7b07349dedfc2f47fda77d3d525b0c0e5d236f8d5cd97a17399275091721afa3","deepseek.json":"549a7ddbdcfd4c59272f1ea9c7d6d9a70bbbfccad3df3a75fb16d6918ac54d0d","fireworks.json":"b6a6490129c66a845bcc76957138db9b25b0b2afa3e12c5d2c502ba2026c7509","github-copilot.json":"bb59f8e4ffca00a8e6031baee78f4bc39d0e95b7647452a3605decb7c4cff30a","google-vertex.json":"51867a5cdb223c5b9d21f8b54c17790aff024d9a4855edf4a9856d6e1a39d7c1","google.json":"328822707e554d5977974d4b24695c2878aad48e5ca527c1efb0284141ff708c","groq.json":"f1d03e0d6cdaef643f8d3a854d7caba784b2a820619a928c4711d08b6688de41","huggingface.json":"2afa4769c606655cf6c36df332ad41a41ec43a19cf9bae4e337243b54f5c9349","kimi-coding.json":"9884f065fe5a0e68e3538590c28019476077712f0542198eef6fdb53b8edd2ee","meta.json":"1b650998c0f9b404246cde1d353105e6d825d8a7292d8f8c43e85dd3402dc130","minimax-cn.json":"17c6d6a27514af90d6c519b7971d8c7e7624ceb12bc94a1384ceb3393c297e97","minimax.json":"29c0078460251b3e0224b4c5c994c108a83c028a7ffcb1ff85bdc0cdb3bad988","mistral.json":"df70e9066f39ffd93734895530653d642e9491bf66dd4b6ab1138f0cb400ae65","moonshotai-cn.json":"6397ff35e9c3fc0928cbc3a4877c12a3bff615c7fa917a0fba4359c2767557e5","moonshotai.json":"7259c6884e0f858de650ee39974a670d0381cf9f6f9f6d2e46b921413fcf1544","nvidia.json":"79452d78d25b41c9b1f16d645c9a6839c4721c4a29dd287513db796ad9763c84","openai-codex.json":"4bb30a26d1b40e1f67c9f24891fca0ce25b030bc4cbbb529be78608cd4466fdf","openai.json":"3c52c8587e7e4a1829ed98ec6e0e3d7bbb2baf47e8618556ed1e95a9c0362835","opencode-go.json":"d471bdb6a9f940fc732687d6749f92d2f3c7c9302ff39d2ce0af062f2472a4ad","opencode.json":"7dff0aba3c0cde09af480fb2e64a01360723b10b3dd1a4b14727435565251a8a","openrouter.json":"b591a790d1c1664c92e3eb80c8d174098ea6fff9dd6d88fcf4ee1b55dd53270d","qwen-token-plan-cn.json":"1bb24ea68feaec83612940e7413bf953d1664a86a521c90750f4c93dd572d8ae","qwen-token-plan-individual.json":"895804dbf586401e61c372e3edef8ee2530878e36a942e12fccf2469167921de","qwen-token-plan.json":"b626dba49c60a28ac9e6a128fa3e5bde97b43c865c4314e64b9b2191eb8afefa","radius.json":"016d54b9b6f2f839c700fe5b05523712d6cde7699c65bf9a3f29517f505dc6ee","together.json":"f7871c75e427b196abf3a1b5d839d50903a0532ebe2b04903eb26b41c93305fb","vercel-ai-gateway.json":"ca6038aabe7311632ac26e113cf4faede7e847db1163fd3aec534a91589fc926","xai.json":"4798b621df20e84db3a48a629ef8054723ebcc8b24314064f6437eb05036405f","xiaomi-token-plan-ams.json":"754a2b6fb127091f569eabbbc84c50862b319bf4ffad434fd0b2f86fd36007f5","xiaomi-token-plan-cn.json":"bebafd818b8cc9452405b16599bb3b4e74dc7bd629ad5847ea5c6ce7000706f3","xiaomi-token-plan-sgp.json":"edec21ee8d3d8839c96013b94bfa6a55616fb7fd62290fa99db2f3eec61713af","xiaomi.json":"640f758f527639c6233d89e548797ffe8d97acc85d5d7dfd647dbb0d42efe146","zai-coding-cn.json":"761cd1c3480519c3be2eaed82cff821993f652620d0787d0e38d7bf18ce2ba41","zai.json":"8f5776b5eaba607d898fb26015d46d040a68217e85860173af3bfbab5f8a9eb1"}}});function AIn(){return Mn({id:"deepseek",name:"DeepSeek",baseUrl:"https://api.deepseek.com",auth:{apiKey:tr("DeepSeek API key",["DEEPSEEK_API_KEY"])},models:Object.values(ZCe),api:qr()})}var yIn=v(()=>{p();ba();Ls();ni();brt()});function EIn(){return Mn({id:"fireworks",name:"Fireworks",baseUrl:"https://api.fireworks.ai/inference",auth:{apiKey:tr("Fireworks API key",["FIREWORKS_API_KEY"])},models:Object.values(eIe),api:{"anthropic-messages":rc(),"openai-completions":qr()}})}var bIn=v(()=>{p();Uf();ba();Ls();ni();_rt()});function _In(){return Mn({id:"github-copilot",name:"GitHub Copilot",baseUrl:"https://api.individual.githubcopilot.com",auth:{apiKey:tr("GitHub Copilot token",["COPILOT_GITHUB_TOKEN"]),oauth:up({name:"GitHub Copilot",isSubscription:!0,load:YCn})},models:Object.values(tIe),filterModels:(t,e)=>{if(e?.type!=="oauth")return t;let n=e.availableModelIds;if(!Array.isArray(n)||!n.every(i=>typeof i=="string"))return t;let r=new Set(n);return t.filter(i=>r.has(i.id))},api:{"anthropic-messages":rc(),"openai-completions":qr(),"openai-responses":ip()}})}var xIn=v(()=>{p();Uf();ba();kx();Ls();zI();ni();xrt()});function SIn(){return Mn({id:"google",name:"Google",baseUrl:"https://generativelanguage.googleapis.com/v1beta",auth:{apiKey:tr("Gemini API key",["GEMINI_API_KEY"])},models:Object.values(nIe),api:Fv()})}var CIn=v(()=>{p();n4();Ls();ni();Srt()});function IIn(){return Mn({id:"google-vertex",name:"Google Vertex AI",auth:{apiKey:kRi},models:Object.values(rIe),api:_2()})}var RRi,kRi,wIn=v(()=>{p();kZ();ni();Crt();RRi="~/.config/gcloud/application_default_credentials.json",kRi={name:"Google Cloud credentials",login:async t=>{t.signal.throwIfAborted();let e=await t.prompt({type:"select",message:"Select Google Vertex AI authentication method:",options:[{id:"api-key",label:"Google Cloud API key"},{id:"adc",label:"Application Default Credentials"},{id:"service-account",label:"Service account credentials file"}]});if(t.signal.throwIfAborted(),e==="api-key")return{type:"api_key",key:await t.prompt({type:"secret",message:"Enter Google Cloud API key"})};if(e!=="adc"&&e!=="service-account")throw new Error(`Unknown Google Vertex AI auth method: ${e}`);t.notify({type:"info",message:e==="adc"?"Run `gcloud auth application-default login`, then provide the project and location.":"Provide a service account credentials file, project, and location.",links:[{label:"Application Default Credentials",url:"https://cloud.google.com/docs/authentication/provide-credentials-adc"}]});let n=await t.prompt({type:"text",message:"Enter Google Cloud project ID"}),r=await t.prompt({type:"text",message:"Enter Google Cloud location"}),i=e==="service-account"?await t.prompt({type:"text",message:"Enter service account credentials file path"}):void 0;return{type:"api_key",env:{GOOGLE_CLOUD_PROJECT:n,GOOGLE_CLOUD_LOCATION:r,...i?{GOOGLE_APPLICATION_CREDENTIALS:i}:{}}}},resolve:async({ctx:t,credential:e,signal:n})=>{let r=async u=>{n.throwIfAborted();let l=await t.env(u);return n.throwIfAborted(),l},i=e?.key??await r("GOOGLE_CLOUD_API_KEY");if(i)return{auth:{apiKey:i},source:e?.key?"stored credential":"GOOGLE_CLOUD_API_KEY"};let s=e?.env?.GOOGLE_APPLICATION_CREDENTIALS??await r("GOOGLE_APPLICATION_CREDENTIALS");n.throwIfAborted();let o=await t.fileExists(s??RRi);n.throwIfAborted();let a=e?.env?.GOOGLE_CLOUD_PROJECT??await r("GOOGLE_CLOUD_PROJECT")??await r("GCLOUD_PROJECT"),c=e?.env?.GOOGLE_CLOUD_LOCATION??await r("GOOGLE_CLOUD_LOCATION");if(o&&a&&c)return{auth:{},env:e?.env,source:e?"stored credential":"gcloud application default credentials"}}}});function TIn(){return Mn({id:"groq",name:"Groq",baseUrl:"https://api.groq.com/openai/v1",auth:{apiKey:tr("Groq API key",["GROQ_API_KEY"])},models:Object.values(iIe),api:qr()})}var vIn=v(()=>{p();ba();Ls();ni();Irt()});function RIn(){return Mn({id:"huggingface",name:"Hugging Face",baseUrl:"https://router.huggingface.co/v1",auth:{apiKey:tr("Hugging Face token",["HF_TOKEN"])},models:Object.values(sIe),api:qr()})}var kIn=v(()=>{p();ba();Ls();ni();wrt()});function BIn(){return Mn({id:"kimi-coding",name:"Kimi For Coding",baseUrl:"https://api.kimi.com/coding",auth:{apiKey:tr("Kimi API key",["KIMI_API_KEY"]),oauth:up({name:"Kimi Code (subscription)",isSubscription:!0,loginLabel:"Sign in with Kimi Code",load:zCn})},models:Object.values(oIe),api:rc()})}var NIn=v(()=>{p();Uf();Ls();zI();ni();Trt()});function DIn(){return Mn({id:"meta",name:"Meta",baseUrl:"https://api.meta.ai/v1",auth:{apiKey:tr("Meta Model API key",["META_API_KEY"]),oauth:up({name:"Meta (Muse subscription)",isSubscription:!0,loginLabel:"Sign in with Meta",load:KCn})},models:Object.values(aIe),api:ip()})}var PIn=v(()=>{p();kx();Ls();zI();ni();vrt()});function MIn(){return Mn({id:"minimax",name:"MiniMax",baseUrl:"https://api.minimax.io/anthropic",auth:{apiKey:tr("MiniMax API key",["MINIMAX_API_KEY"])},models:Object.values(cIe),api:rc()})}var OIn=v(()=>{p();Uf();Ls();ni();Rrt()});function LIn(){return Mn({id:"minimax-cn",name:"MiniMax CN",baseUrl:"https://api.minimaxi.com/anthropic",auth:{apiKey:tr("MiniMax CN API key",["MINIMAX_CN_API_KEY"])},models:Object.values(lIe),api:rc()})}var FIn=v(()=>{p();Uf();Ls();ni();krt()});function QIn(){return Mn({id:"mistral",name:"Mistral",baseUrl:"https://api.mistral.ai",auth:{apiKey:tr("Mistral API key",["MISTRAL_API_KEY"])},models:Object.values(uIe),api:x2()})}var UIn=v(()=>{p();BZ();Ls();ni();Brt()});function GIn(){return Mn({id:"moonshotai",name:"Moonshot AI",baseUrl:"https://api.moonshot.ai/v1",auth:{apiKey:tr("Moonshot AI API key",["MOONSHOT_API_KEY"])},models:Object.values(dIe),api:qr()})}var $In=v(()=>{p();ba();Ls();ni();Nrt()});function WIn(){return Mn({id:"moonshotai-cn",name:"Moonshot AI CN",baseUrl:"https://api.moonshot.cn/v1",auth:{apiKey:tr("Moonshot AI API key",["MOONSHOT_API_KEY"])},models:Object.values(pIe),api:qr()})}var HIn=v(()=>{p();ba();Ls();ni();Drt()});function qIn(){return Mn({id:"nvidia",name:"NVIDIA",baseUrl:"https://integrate.api.nvidia.com/v1",auth:{apiKey:tr("NVIDIA API key",["NVIDIA_API_KEY"])},models:Object.values(mIe),api:qr()})}var jIn=v(()=>{p();ba();Ls();ni();Prt()});function VIn(){return Mn({id:"openai",name:"OpenAI",baseUrl:"https://api.openai.com/v1",auth:{apiKey:tr("OpenAI API key",["OPENAI_API_KEY"])},models:Object.values(hIe),api:ip()})}var YIn=v(()=>{p();kx();Ls();ni();Mrt()});function zIn(){return Mn({id:"openai-codex",name:"OpenAI Codex",baseUrl:"https://chatgpt.com/backend-api",auth:{oauth:up({name:"OpenAI (ChatGPT Plus/Pro)",isSubscription:!0,load:VCn})},models:Object.values(fIe),api:C2()})}var KIn=v(()=>{p();PZ();Ls();zI();ni();Ort()});function BRi(t,e){let n=e.toLowerCase();return Object.keys(t??{}).some(r=>r.toLowerCase()===n)}function XIn(t){return!t?.sessionId||BRi(t.headers,JIn)?t:{...t,headers:{...t.headers,[JIn]:t.sessionId}}}function aR(t){return{...t,stream:(e,n,r)=>t.stream(e,n,XIn(r)),streamSimple:(e,n,r)=>t.streamSimple(e,n,XIn(r))}}var JIn,sit=v(()=>{p();JIn="x-opencode-session"});function ZIn(){return Mn({id:"opencode",name:"OpenCode Zen",auth:{apiKey:tr("OpenCode API key",["OPENCODE_API_KEY"])},models:Object.values(gIe),api:{"anthropic-messages":aR(rc()),"google-generative-ai":aR(Fv()),"openai-completions":aR(qr()),"openai-responses":aR(ip())}})}var ewn=v(()=>{p();Uf();n4();ba();kx();Ls();ni();Lrt();sit()});function twn(){return Mn({id:"opencode-go",name:"OpenCode Go",auth:{apiKey:tr("OpenCode API key",["OPENCODE_API_KEY"])},models:Object.values(AIe),api:{"anthropic-messages":aR(rc()),"openai-completions":aR(qr()),"openai-responses":aR(ip())}})}var nwn=v(()=>{p();Uf();ba();kx();Ls();ni();Frt();sit()});function rwn(){return Mn({id:"openrouter",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",auth:{apiKey:tr("OpenRouter API key",["OPENROUTER_API_KEY"]),oauth:up({name:"OpenRouter OAuth",loginLabel:"Sign in with OpenRouter",load:DIe})},models:Object.values(yIe),api:{"anthropic-messages":rc(),"openai-completions":qr()}})}var iwn=v(()=>{p();Uf();ba();Ls();zI();ni();Qrt()});var swn,own=v(()=>{p();swn=()=>({generateImages:async(t,e,n)=>(await Promise.resolve().then(()=>(mJe(),pJe))).generateImages(t,e,n)})});function awn(){return Det({id:"openrouter",name:"OpenRouter",auth:{apiKey:tr("OpenRouter API key",["OPENROUTER_API_KEY"]),oauth:up({name:"OpenRouter OAuth",loginLabel:"Sign in with OpenRouter",load:DIe})},models:Object.values(S_e.openrouter),api:swn()})}var cwn=v(()=>{p();own();Ls();zI();lJe();RSe()});function lwn(){return Mn({id:"qwen-token-plan",name:"Qwen Token Plan",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",auth:{apiKey:tr("Qwen Token Plan API key",["QWEN_TOKEN_PLAN_API_KEY"])},models:Object.values(EIe),api:qr()})}var uwn=v(()=>{p();ba();Ls();ni();Urt()});function dwn(){return Mn({id:"qwen-token-plan-cn",name:"Qwen Token Plan CN",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",auth:{apiKey:tr("Qwen Token Plan CN API key",["QWEN_TOKEN_PLAN_CN_API_KEY"])},models:Object.values(bIe),api:qr()})}var pwn=v(()=>{p();ba();Ls();ni();Grt()});function mwn(){return Mn({id:"qwen-token-plan-individual",name:"Qwen Token Plan Individual",baseUrl:"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",auth:{apiKey:tr("Qwen Token Plan Individual API key",["QWEN_TOKEN_PLAN_API_KEY"])},models:Object.values(_Ie),api:qr()})}var hwn=v(()=>{p();ba();Ls();ni();$rt()});function NRi(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=t;return typeof e.id=="string"&&typeof e.name=="string"&&typeof e.reasoning=="boolean"&&Array.isArray(e.input)&&typeof e.cost=="object"&&e.cost!==null&&!Array.isArray(e.cost)&&typeof e.contextWindow=="number"&&typeof e.maxTokens=="number"}function fwn(t){if(typeof t!="object"||t===null||Array.isArray(t))return;let{baseUrl:e,models:n}=t;if(!(typeof e!="string"||!Array.isArray(n)))return{baseUrl:e,models:n.filter(NRi).map(r=>({...r}))}}function rne(t){return(/^https?:\/\//iu.test(t)?t:`https://${t}`).replace(/\/+$/u,"")}function DRi(t){return fwn(t?.gatewayConfig)}function oit(t,e){return e.models.map(n=>({...n,api:"pi-messages",provider:t,baseUrl:e.baseUrl}))}function ait(t,e){let n=DRi(e);return n?oit(t,n):[]}function PRi(t){let e=t.trim();return e.length>512?`${e.slice(0,512)}\u2026`:e}async function gwn(t,e,n){let r={accept:"application/json"};e&&(r.authorization=`Bearer ${e}`);let i=await fetch(new URL("/v1/config",t),{headers:r,signal:n});if(!i.ok)throw new Error(`Could not load Radius config from ${t}: ${i.status}: ${PRi(await i.text())}`);let s=fwn(await i.json());if(!s)throw new Error(`Invalid Radius config from ${t}`);return s}var SF,PIe=v(()=>{p();SF="https://radius.pi.dev"});function ine(t={}){let e=t.id??"radius",n=t.name??"Radius",r=rne(t.gateway??SF),i=r===rne(SF)?Object.values(xIe).map(a=>({...a,provider:e})):[],s=ait(e,void 0),o=OZ();return{id:e,name:n,auth:{apiKey:tr("Radius API key",["RADIUS_API_KEY"]),oauth:up({name:n,load:()=>XCn({name:n,gateway:r})})},getModels:()=>{let a=[...i];for(let c of s){let u=a.findIndex(l=>l.id===c.id);u>=0?a[u]=c:a.push(c)}return a},refreshModels:async a=>{let c=a.stored;if(c){let m=c.models.filter(h=>h.provider===e);if(!await a.publish({update:()=>{s=m}}))return}if(!c&&a.credential?.type==="oauth"){let m=ait(e,a.credential);if(m.length>0&&!await a.publish({persist:{models:m,checkedAt:Date.now()},update:()=>{s=m}}))return}if(!a.allowNetwork||a.signal.aborted)return;let u=a.credential?.type==="oauth"?a.credential.access:a.credential?.key,l=await gwn(r,u,a.signal);if(a.signal.aborted)return;let d=oit(e,l);await a.publish({persist:{models:d,checkedAt:Date.now()},update:()=>{s=d}})},stream:(a,c,u)=>o.stream(a,c,u),streamSimple:(a,c,u)=>o.streamSimple(a,c,u)}}var Awn=v(()=>{p();E_e();Ls();zI();Wrt();PIe()});function ywn(){return Mn({id:"together",name:"Together",baseUrl:"https://api.together.ai/v1",auth:{apiKey:tr("Together API key",["TOGETHER_API_KEY"])},models:Object.values(SIe),api:qr()})}var Ewn=v(()=>{p();ba();Ls();ni();Hrt()});function bwn(){return Mn({id:"vercel-ai-gateway",name:"Vercel AI Gateway",baseUrl:"https://ai-gateway.vercel.sh",auth:{apiKey:tr("Vercel AI Gateway API key",["AI_GATEWAY_API_KEY"])},models:Object.values(CIe),api:rc()})}var _wn=v(()=>{p();Uf();Ls();ni();qrt()});function xwn(){return Mn({id:"xai",name:"xAI",baseUrl:"https://api.x.ai/v1",auth:{apiKey:tr("xAI API key",["XAI_API_KEY"]),oauth:up({name:"xAI (Grok/X subscription)",isSubscription:!0,loginLabel:"Sign in with SuperGrok or X Premium",load:JCn})},models:Object.values(IIe),api:ip()})}var Swn=v(()=>{p();kx();Ls();zI();ni();jrt()});function Cwn(){return Mn({id:"xiaomi",name:"Xiaomi",baseUrl:"https://api.xiaomimimo.com/v1",auth:{apiKey:tr("Xiaomi API key",["XIAOMI_API_KEY"])},models:Object.values(wIe),api:qr()})}var Iwn=v(()=>{p();ba();Ls();ni();Vrt()});function wwn(){return Mn({id:"xiaomi-token-plan-ams",name:"Xiaomi Token Plan AMS",baseUrl:"https://token-plan-ams.xiaomimimo.com/v1",auth:{apiKey:tr("Xiaomi Token Plan AMS API key",["XIAOMI_TOKEN_PLAN_AMS_API_KEY"])},models:Object.values(TIe),api:qr()})}var Twn=v(()=>{p();ba();Ls();ni();Yrt()});function vwn(){return Mn({id:"xiaomi-token-plan-cn",name:"Xiaomi Token Plan CN",baseUrl:"https://token-plan-cn.xiaomimimo.com/v1",auth:{apiKey:tr("Xiaomi Token Plan CN API key",["XIAOMI_TOKEN_PLAN_CN_API_KEY"])},models:Object.values(vIe),api:qr()})}var Rwn=v(()=>{p();ba();Ls();ni();zrt()});function kwn(){return Mn({id:"xiaomi-token-plan-sgp",name:"Xiaomi Token Plan SGP",baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1",auth:{apiKey:tr("Xiaomi Token Plan SGP API key",["XIAOMI_TOKEN_PLAN_SGP_API_KEY"])},models:Object.values(RIe),api:qr()})}var Bwn=v(()=>{p();ba();Ls();ni();Krt()});function Nwn(){return Mn({id:"zai",name:"Z.AI",baseUrl:"https://api.z.ai/api/coding/paas/v4",auth:{apiKey:tr("Z.AI API key",["ZAI_API_KEY"])},models:Object.values(kIe),api:qr()})}var Dwn=v(()=>{p();ba();Ls();ni();Jrt()});function Pwn(){return Mn({id:"zai-coding-cn",name:"Z.AI Coding CN",baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",auth:{apiKey:tr("Z.AI Coding CN API key",["ZAI_CODING_CN_API_KEY"])},models:Object.values(BIe),api:qr()})}var Mwn=v(()=>{p();ba();Ls();ni();Xrt()});var sne={};br(sne,{builtinImagesModels:()=>MRi,builtinImagesProviders:()=>Own,builtinModels:()=>pit,builtinProviders:()=>MIe,getBuiltinModel:()=>cit,getBuiltinModelDataGeneratedAt:()=>uit,getBuiltinModels:()=>dit,getBuiltinProviders:()=>lit,radiusProvider:()=>ine});function cit(t,e){return NIe[t]?.[e]}function lit(){return Object.keys(NIe)}function uit(){let t=Date.parse(gIn.generatedAt);return Number.isNaN(t)?void 0:t}function dit(t){let e=NIe[t];return e?Object.values(e):[]}function MIe(){return[$Cn(),HCn(),ZCn(),tIn(),rIn(),sIn(),dIn(),mIn(),AIn(),EIn(),_In(),SIn(),IIn(),TIn(),RIn(),BIn(),DIn(),MIn(),LIn(),QIn(),GIn(),WIn(),qIn(),VIn(),zIn(),ZIn(),twn(),rwn(),lwn(),dwn(),mwn(),ine(),ywn(),bwn(),xwn(),Cwn(),wwn(),vwn(),kwn(),Nwn(),Pwn()]}function pit(t){let e=rJ(t);for(let n of MIe())e.setProvider(n);return e}function Own(){return[awn()]}function MRi(t){let e=Net(t);for(let n of Own())e.setProvider(n);return e}var OIe=v(()=>{p();RSe();GCn();ni();WCn();qCn();eIn();nIn();iIn();oIn();pIn();hIn();fIn();yIn();bIn();xIn();CIn();wIn();vIn();kIn();NIn();PIn();OIn();FIn();UIn();$In();HIn();jIn();YIn();KIn();ewn();nwn();iwn();cwn();uwn();pwn();hwn();Awn();Ewn();_wn();Swn();Iwn();Twn();Rwn();Bwn();Dwn();Mwn()});var s8={};br(s8,{ANTHROPIC_API_KEY_ENV:()=>__e,ANTHROPIC_AUTH_TOKEN_ENV:()=>s4,ANTHROPIC_OAUTH_TOKEN_ENV:()=>b_e,AssistantMessageEventStream:()=>Rc,AssistantMessageFrameEncoder:()=>ute,DEFAULT_MAX_AGENT_RETRY_DELAY_MS:()=>KN,EventStream:()=>mB,InMemoryCredentialStore:()=>HO,InMemoryModelsStore:()=>eJ,ModelsError:()=>ko,StringEnum:()=>gCi,Type:()=>Ne,anthropicMessagesApi:()=>rc,appendAssistantMessageDiagnostic:()=>JC,azureOpenAIResponsesApi:()=>t2,bedrockConverseStreamApi:()=>MX,calculateCost:()=>$p,clampThinkingLevel:()=>Wl,cleanupSessionResources:()=>XKe,collapseSystemMessages:()=>ZC,complete:()=>jRi,completeSimple:()=>yit,contentText:()=>aa,createAssistantMessageDiagnostic:()=>XK,createAssistantMessageEventStream:()=>oAe,createFauxCore:()=>DSe,createImagesModels:()=>Net,createImagesProvider:()=>Det,createInitialSystemMessage:()=>pAe,createModels:()=>rJ,createProvider:()=>Mn,declarationsEqual:()=>dAe,defaultProviderAuthContext:()=>JK,envApiKeyAuth:()=>tr,extractDiagnosticError:()=>fYt,fauxAssistantMessage:()=>XSi,fauxProvider:()=>iCi,fauxText:()=>zfn,fauxThinking:()=>zSi,fauxToolCall:()=>KSi,findEnvKeys:()=>don,formatThrownValue:()=>hB,generateImages:()=>NAi,generateImagesOpenRouter:()=>fon,getApiProvider:()=>CF,getApiProviders:()=>GRi,getCurrentSystemMessage:()=>kf,getCurrentSystemPrompt:()=>g3e,getCurrentTools:()=>Nm,getDeclaredTools:()=>Bf,getEnvApiKey:()=>cJe,getImageModel:()=>_Ai,getImageModels:()=>SAi,getImageProviders:()=>xAi,getImagesApiProvider:()=>dJe,getInitialSystemMessage:()=>Iy,getModel:()=>ORi,getModels:()=>LRi,getOverflowPatterns:()=>pCi,getProviders:()=>FRi,getSupportedThinkingLevels:()=>gB,getSystemMessageText:()=>kc,getToolStateChanges:()=>A3e,googleGenerativeAIApi:()=>Fv,googleVertexApi:()=>_2,hasApi:()=>n9r,hasNonAdditiveToolChanges:()=>gYt,hasToolRedefinitions:()=>y3e,isContextOverflow:()=>rF,isRecoverableLength:()=>dte,isRetryableAssistantError:()=>Jy,lazyApi:()=>ed,lazyOAuth:()=>up,lazyStream:()=>Th,mistralConversationsApi:()=>x2,modelsAreEqual:()=>Zd,normalizeContext:()=>Id,openAICodexResponsesApi:()=>C2,openAICompletionsApi:()=>qr,openAIResponsesApi:()=>ip,parseJsonWithRepair:()=>fAe,parseStreamingJson:()=>ec,piMessagesApi:()=>OZ,reduceAssistantMessageFrames:()=>W4,registerApiProvider:()=>mit,registerBuiltInApiProviders:()=>fit,registerBuiltInImagesApiProviders:()=>gon,registerFauxProvider:()=>WRi,registerImagesApiProvider:()=>uJe,registerSessionResourceCleanup:()=>JKe,renderSystemMessageUpdate:()=>XC,repairJson:()=>S3e,resetApiProviders:()=>git,resolveTranscript:()=>vh,resolveTranscriptTools:()=>w0,retryAssistantCall:()=>mte,retryDelayMs:()=>Wx,setBedrockProviderModule:()=>o9e,stream:()=>FIe,streamAnthropic:()=>bvi,streamAzureOpenAIResponses:()=>xvi,streamGoogle:()=>Cvi,streamGoogleVertex:()=>wvi,streamMistral:()=>vvi,streamOpenAICodexResponses:()=>kvi,streamOpenAICompletions:()=>Nvi,streamOpenAIResponses:()=>Pvi,streamSimple:()=>iD,streamSimpleAnthropic:()=>_vi,streamSimpleAzureOpenAIResponses:()=>Svi,streamSimpleGoogle:()=>Ivi,streamSimpleGoogleVertex:()=>Tvi,streamSimpleMistral:()=>Rvi,streamSimpleOpenAICodexResponses:()=>Bvi,streamSimpleOpenAICompletions:()=>Dvi,streamSimpleOpenAIResponses:()=>Mvi,toToolDeclaration:()=>fB,unregisterApiProviders:()=>Lwn,uuidv7:()=>Oc,validateToolArguments:()=>xF,validateToolCall:()=>Evi,withoutInitialSystemMessage:()=>tJ});function QRi(t,e){return(n,r,i)=>{if(n.api!==t)throw new Error(`Mismatched api: ${n.api} expected ${t}`);return e(n,r,i)}}function URi(t,e){return(n,r,i)=>{if(n.api!==t)throw new Error(`Mismatched api: ${n.api} expected ${t}`);return e(n,r,i)}}function mit(t,e){i8.set(t.api,{provider:{api:t.api,stream:QRi(t.api,t.stream),streamSimple:URi(t.api,t.streamSimple)},sourceId:e})}function CF(t){return i8.get(t)?.provider}function GRi(){return Array.from(i8.values(),t=>t.provider)}function Lwn(t){for(let[e,n]of i8.entries())n.sourceId===t&&i8.delete(e)}function $Ri(){i8.clear()}function WRi(t={}){let e=DSe(t),n=`faux-provider-${Math.random().toString(36).slice(2,10)}`;return mit({api:e.api,stream:e.stream,streamSimple:e.streamSimple},n),{api:e.api,models:e.models,getModel:e.getModel,state:e.state,setResponses:e.setResponses,appendResponses:e.appendResponses,getPendingResponseCount:e.getPendingResponseCount,unregister(){Lwn(n)}}}function fit(){for(let[t,e]of HRi)CF(t)||mit({api:t,stream:e.stream,streamSimple:e.streamSimple}),hit.set(t,CF(t))}function git(){$Ri(),hit.clear(),fit()}function Fwn(t){return typeof t=="string"&&t.trim().length>0}function LIe(t,e){if(Fwn(e?.apiKey))return e;let n=cJe(t.provider,e?.env);return!n||n===qRi?e:{...e,apiKey:n}}function Qwn(t){return Fwn(t?.apiKey)||typeof t?.headers?.["cf-aig-authorization"]=="string"}function Uwn(t){if(CF(t.api)!==hit.get(t.api))return;let e=Ait.getProvider(t.provider);return e?.getModels().some(n=>n.api===t.api)?e:void 0}function Gwn(t){let e=CF(t);if(!e)throw new Error(`No API provider registered for api: ${t}`);return e}function FIe(t,e,n){let r=Id(e),i=Uwn(t);return i?t.provider.startsWith("cloudflare-")&&!Qwn(n)?Ait.stream(t,r,n):i.stream(t,r,LIe(t,n)):Gwn(t.api).stream(t,r,LIe(t,n))}async function jRi(t,e,n){return FIe(t,e,n).result()}function iD(t,e,n){let r=Id(e),i=Uwn(t);return i?t.provider.startsWith("cloudflare-")&&!Qwn(n)?Ait.streamSimple(t,r,n):i.streamSimple(t,r,LIe(t,n)):Gwn(t.api).streamSimple(t,r,LIe(t,n))}async function yit(t,e,n){return iD(t,e,n).result()}var ORi,LRi,FRi,i8,HRi,hit,Ait,qRi,cR=v(()=>{p();Uf();PX();VEe();n4();kZ();BZ();PZ();ba();kx();E_e();x_e();pon();Aon();I_e();qo();pSn();hJe();Uf();PX();VEe();n4();kZ();BZ();PZ();ba();kx();E_e();x_e();OIe();Let();Nf();ORi=cit,LRi=dit,FRi=lit,i8=new Map;HRi=[["anthropic-messages",rc()],["openai-completions",qr()],["openai-responses",ip()],["openai-codex-responses",C2()],["azure-openai-responses",t2()],["google-generative-ai",Fv()],["google-vertex",_2()],["mistral-conversations",x2()],["bedrock-converse-stream",MX()],["pi-messages",OZ()]],hit=new Map;fit();Ait=pit(),qRi=""});var Wwn=re((BZa,$wn)=>{"use strict";p();var Nu=class t extends Array{constructor(e,n){if(super(e),this.sign=n,Object.setPrototypeOf(this,t.prototype),e>t.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded")}static BigInt(e){var n=Math.floor,r=Number.isFinite;if(typeof e=="number"){if(e===0)return t.__zero();if(t.__isOneDigitInt(e))return 0>e?t.__oneDigit(-e,!0):t.__oneDigit(e,!1);if(!r(e)||n(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return t.__fromDouble(e)}if(typeof e=="string"){let i=t.__fromString(e);if(i===null)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if(typeof e=="boolean")return e===!0?t.__oneDigit(1,!1):t.__zero();if(typeof e=="object"){if(e.constructor===t)return e;let i=t.__toPrimitive(e);return t.BigInt(i)}throw new TypeError("Cannot convert "+e+" to a BigInt")}toDebugString(){let e=["BigInt["];for(let n of this)e.push((n&&(n>>>0).toString(16))+", ");return e.push("]"),e.join("")}toString(e=10){if(2>e||36>>=12;let d=u-12,m=12<=u?0:a<<20+u,h=20+u;for(0>>30-d,m=a<>>30-h,h-=30;let f=t.__decideRounding(e,h,c,a);if((f===1||f===0&&(1&m)==1)&&(m=m+1>>>0,m===0&&(l++,l>>>20!=0&&(l=0,o++,1023=t.__kMaxLengthBits)throw new RangeError("BigInt too big");if(e.length===1&&e.__digit(0)===2){let o=1+(0|r/30),a=e.sign&&(1&r)!=0,c=new t(o,a);c.__initializeDigits();let u=1<>=1;r!==0;r>>=1)s=t.multiply(s,s),(1&r)!=0&&(i===null?i=s:i=t.multiply(i,s));return i}static multiply(e,n){if(e.length===0)return e;if(n.length===0)return n;let r=e.length+n.length;30<=e.__clzmsd()+n.__clzmsd()&&r--;let i=new t(r,e.sign!==n.sign);i.__initializeDigits();for(let s=0;st.__absoluteCompare(e,n))return t.__zero();let r=e.sign!==n.sign,i=n.__unsignedDigit(0),s;if(n.length===1&&32767>=i){if(i===1)return r===e.sign?e:t.unaryMinus(e);s=t.__absoluteDivSmall(e,i,null)}else s=t.__absoluteDivLarge(e,n,!0,!1);return s.sign=r,s.__trim()}static remainder(e,n){if(n.length===0)throw new RangeError("Division by zero");if(0>t.__absoluteCompare(e,n))return e;let r=n.__unsignedDigit(0);if(n.length===1&&32767>=r){if(r===1)return t.__zero();let s=t.__absoluteModSmall(e,r);return s===0?t.__zero():t.__oneDigit(s,e.sign)}let i=t.__absoluteDivLarge(e,n,!1,!0);return i.sign=e.sign,i.__trim()}static add(e,n){let r=e.sign;return r===n.sign?t.__absoluteAdd(e,n,r):0<=t.__absoluteCompare(e,n)?t.__absoluteSub(e,n,r):t.__absoluteSub(n,e,!r)}static subtract(e,n){let r=e.sign;return r===n.sign?0<=t.__absoluteCompare(e,n)?t.__absoluteSub(e,n,r):t.__absoluteSub(n,e,!r):t.__absoluteAdd(e,n,r)}static leftShift(e,n){return n.length===0||e.length===0?e:n.sign?t.__rightShiftByAbsolute(e,n):t.__leftShiftByAbsolute(e,n)}static signedRightShift(e,n){return n.length===0||e.length===0?e:n.sign?t.__leftShiftByAbsolute(e,n):t.__rightShiftByAbsolute(e,n)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(e,n){return 0>t.__compareToBigInt(e,n)}static lessThanOrEqual(e,n){return 0>=t.__compareToBigInt(e,n)}static greaterThan(e,n){return 0e)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(e===0)return t.__zero();if(e>=t.__kMaxLengthBits)return n;let i=0|(e+29)/30;if(n.lengthe)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(e===0)return t.__zero();if(n.sign){if(e>t.__kMaxLengthBits)throw new RangeError("BigInt too big");return t.__truncateAndSubFromPowerOfTwo(e,n,!1)}if(e>=t.__kMaxLengthBits)return n;let i=0|(e+29)/30;if(n.length>>s))?n:t.__truncateToNBits(e,n)}static ADD(e,n){if(e=t.__toPrimitive(e),n=t.__toPrimitive(n),typeof e=="string")return typeof n!="string"&&(n=n.toString()),e+n;if(typeof n=="string")return e.toString()+n;if(e=t.__toNumeric(e),n=t.__toNumeric(n),t.__isBigInt(e)&&t.__isBigInt(n))return t.add(e,n);if(typeof e=="number"&&typeof n=="number")return e+n;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(e,n){return t.__compare(e,n,0)}static LE(e,n){return t.__compare(e,n,1)}static GT(e,n){return t.__compare(e,n,2)}static GE(e,n){return t.__compare(e,n,3)}static EQ(e,n){for(;;){if(t.__isBigInt(e))return t.__isBigInt(n)?t.equal(e,n):t.EQ(n,e);if(typeof e=="number"){if(t.__isBigInt(n))return t.__equalToNumber(n,e);if(typeof n!="object")return e==n;n=t.__toPrimitive(n)}else if(typeof e=="string"){if(t.__isBigInt(n))return e=t.__fromString(e),e!==null&&t.equal(e,n);if(typeof n!="object")return e==n;n=t.__toPrimitive(n)}else if(typeof e=="boolean"){if(t.__isBigInt(n))return t.__equalToNumber(n,+e);if(typeof n!="object")return e==n;n=t.__toPrimitive(n)}else if(typeof e=="symbol"){if(t.__isBigInt(n))return!1;if(typeof n!="object")return e==n;n=t.__toPrimitive(n)}else if(typeof e=="object"){if(typeof n=="object"&&n.constructor!==t)return e==n;e=t.__toPrimitive(e)}else return e==n}}static NE(e,n){return!t.EQ(e,n)}static DataViewGetBigInt64(e,n,r=!1){return t.asIntN(64,t.DataViewGetBigUint64(e,n,r))}static DataViewGetBigUint64(e,n,r=!1){let[i,s]=r?[4,0]:[0,4],o=e.getUint32(n+i,r),a=e.getUint32(n+s,r),c=new t(3,!1);return c.__setDigit(0,1073741823&a),c.__setDigit(1,(268435455&o)<<2|a>>>30),c.__setDigit(2,o>>>28),c.__trim()}static DataViewSetBigInt64(e,n,r,i=!1){t.DataViewSetBigUint64(e,n,r,i)}static DataViewSetBigUint64(e,n,r,i=!1){r=t.asUintN(64,r);let s=0,o=0;if(0>>2,2n)s=-n-1;else{if(r===0)return-1;r--,i=e.__digit(r),s=29}let o=1<>>20,r=n-1023,i=(0|r/30)+1,s=new t(i,0>e),o=1048575&t.__kBitConversionInts[t.__kBitConversionIntHigh]|1048576,a=t.__kBitConversionInts[t.__kBitConversionIntLow],c=20,u=r%30,l,d=0;if(u<20){let m=c-u;d=m+32,l=o>>>m,o=o<<32-m|a>>>m,a<<=32-m}else if(u===20)d=32,l=o,o=a,a=0;else{let m=u-c;d=32-m,l=o<>>32-m,o=a<>>2,o=o<<30|a>>>2,a<<=30):l=0,s.__setDigit(m,l);return s.__trim()}static __isWhitespace(e){return 13>=e&&9<=e||(159>=e?e==32:131071>=e?e==160||e==5760:196607>=e?(e&=131071,10>=e||e==40||e==41||e==47||e==95||e==4096):e==65279)}static __fromString(e,n=0){let r=0,i=e.length,s=0;if(s===i)return t.__zero();let o=e.charCodeAt(s);for(;t.__isWhitespace(o);){if(++s===i)return t.__zero();o=e.charCodeAt(s)}if(o===43){if(++s===i)return null;o=e.charCodeAt(s),r=1}else if(o===45){if(++s===i)return null;o=e.charCodeAt(s),r=-1}if(n===0){if(n=10,o===48){if(++s===i)return t.__zero();if(o=e.charCodeAt(s),o===88||o===120){if(n=16,++s===i)return null;o=e.charCodeAt(s)}else if(o===79||o===111){if(n=8,++s===i)return null;o=e.charCodeAt(s)}else if(o===66||o===98){if(n=2,++s===i)return null;o=e.charCodeAt(s)}}}else if(n===16&&o===48){if(++s===i)return t.__zero();if(o=e.charCodeAt(s),o===88||o===120){if(++s===i)return null;o=e.charCodeAt(s)}}if(r!=0&&n!==10)return null;for(;o===48;){if(++s===i)return t.__zero();o=e.charCodeAt(s)}let a=i-s,c=t.__kMaxBitsPerChar[n],u=t.__kBitsPerCharTableMultiplier-1;if(a>1073741824/c)return null;let l=c*a+u>>>t.__kBitsPerCharTableShift,d=new t(0|(l+29)/30,!1),m=10>n?n:10,h=10>=t.__kBitsPerCharTableShift;let f=[],g=[],A=!1;do{let y=0,E=0;for(;;){let _;if(o-48>>>0>>0>>0>>0>>t.__kBitsPerCharTableShift)/30;d.__inplaceMultiplyAdd(y,A,E)}while(!f)}if(s!==i){if(!t.__isWhitespace(o))return null;for(s++;s>>u-o)}if(s!==0){if(i>=e.length)throw new Error("implementation bug");e.__setDigit(i++,s)}for(;i>>1)+(85&i),i=(51&i>>>2)+(51&i),i=(15&i>>>4)+(15&i);let s=i,o=n-1,a=e.__digit(r-1),c=t.__clz30(a),u=0|(30*r-c+s-1)/s;if(e.sign&&u++,268435456>>E,h=30-E;h>=s;)l[d--]=t.__kConversionChars[m&o],m>>>=s,h-=s}let f=(m|a<>>s-h;m!==0;)l[d--]=t.__kConversionChars[m&o],m>>>=s;if(e.sign&&(l[d--]="-"),d!=-1)throw new Error("implementation bug");return l.join("")}static __toStringGeneric(e,n,r){let i=e.length;if(i===0)return"";if(i===1){let g=e.__unsignedDigit(0).toString(n);return r===!1&&e.sign&&(g="-"+g),g}let s=30*i-t.__clz30(e.__digit(i-1)),o=t.__kMaxBitsPerChar[n],a=o-1,c=s*t.__kBitsPerCharTableMultiplier;c+=a-1,c=0|c/a;let u=c+1>>1,l=t.exponentiate(t.__oneDigit(n,!1),t.__oneDigit(u,!1)),d,m,h=l.__unsignedDigit(0);if(l.length===1&&32767>=h){d=new t(e.length,!1),d.__initializeDigits();let g=0;for(let A=2*e.length-1;0<=A;A--){let y=g<<15|e.__halfDigit(A);d.__setHalfDigit(A,0|y/h),g=0|y%h}m=g.toString(n)}else{let g=t.__absoluteDivLarge(e,l,!0,!0);d=g.quotient;let A=g.remainder.__trim();m=t.__toStringGeneric(A,n,!0)}d.__trim();let f=t.__toStringGeneric(d,n,!0);for(;m.lengthi?t.__absoluteLess(r):0}static __compareToNumber(e,n){if(t.__isOneDigitInt(n)){let r=e.sign,i=0>n;if(r!==i)return t.__unequalSign(r);if(e.length===0){if(i)throw new Error("implementation bug");return n===0?0:-1}if(1s?t.__absoluteGreater(r):on)return t.__unequalSign(r);if(n===0)throw new Error("implementation bug: should be handled elsewhere");if(e.length===0)return-1;t.__kBitConversionDouble[0]=n;let i=2047&t.__kBitConversionInts[t.__kBitConversionIntHigh]>>>20;if(i==2047)throw new Error("implementation bug: handled elsewhere");let s=i-1023;if(0>s)return t.__absoluteGreater(r);let o=e.length,a=e.__digit(o-1),c=t.__clz30(a),u=30*o-c,l=s+1;if(ul)return t.__absoluteGreater(r);let d=1048576|1048575&t.__kBitConversionInts[t.__kBitConversionIntHigh],m=t.__kBitConversionInts[t.__kBitConversionIntLow],h=20,f=29-c;if(f!==(0|(u-1)%30))throw new Error("implementation bug");let g,A=0;if(20>f){let y=h-f;A=y+32,g=d>>>y,d=d<<32-y|m>>>y,m<<=32-y}else if(f===20)A=32,g=d,d=m,m=0;else{let y=f-h;A=32-y,g=d<>>32-y,d=m<>>=0,g>>>=0,a>g)return t.__absoluteGreater(r);if(a>>2,d=d<<30|m>>>2,m<<=30):g=0;let E=e.__unsignedDigit(y);if(E>g)return t.__absoluteGreater(r);if(En&&e.__unsignedDigit(0)===r(n):t.__compareToDouble(e,n)===0}static __comparisonResultToBool(e,n){return n===0?0>e:n===1?0>=e:n===2?0n;case 3:return e>=n}if(t.__isBigInt(e)&&typeof n=="string")return n=t.__fromString(n),n!==null&&t.__comparisonResultToBool(t.__compareToBigInt(e,n),r);if(typeof e=="string"&&t.__isBigInt(n))return e=t.__fromString(e),e!==null&&t.__comparisonResultToBool(t.__compareToBigInt(e,n),r);if(e=t.__toNumeric(e),n=t.__toNumeric(n),t.__isBigInt(e)){if(t.__isBigInt(n))return t.__comparisonResultToBool(t.__compareToBigInt(e,n),r);if(typeof n!="number")throw new Error("implementation bug");return t.__comparisonResultToBool(t.__compareToNumber(e,n),r)}if(typeof e!="number")throw new Error("implementation bug");if(t.__isBigInt(n))return t.__comparisonResultToBool(t.__compareToNumber(n,e),2^r);if(typeof n!="number")throw new Error("implementation bug");return r===0?en:r===3?e>=n:void 0}__clzmsd(){return t.__clz30(this.__digit(this.length-1))}static __absoluteAdd(e,n,r){if(e.length>>30,s.__setDigit(a,1073741823&c)}for(;a>>30,s.__setDigit(a,1073741823&c)}return a>>30,i.__setDigit(o,1073741823&a)}for(;o>>30,i.__setDigit(o,1073741823&a)}return i.__trim()}static __absoluteAddOne(e,n,r=null){let i=e.length;r===null?r=new t(i,n):r.sign=n;let s=1;for(let o=0;o>>30,r.__setDigit(o,1073741823&a)}return s!=0&&r.__setDigitGrow(i,1),r}static __absoluteSubOne(e,n){let r=e.length;n=n||r;let i=new t(n,!1),s=1;for(let o=0;o>>30,i.__setDigit(o,1073741823&a)}if(s!=0)throw new Error("implementation bug");for(let o=r;oi?0:e.__unsignedDigit(i)>n.__unsignedDigit(i)?1:-1}static __multiplyAccumulate(e,n,r,i){if(n===0)return;let s=32767&n,o=n>>>15,a=0,c=0;for(let u,l=0;l>>15,f=t.__imul(m,s),g=t.__imul(m,o),A=t.__imul(h,s),y=t.__imul(h,o);u+=c+f+a,a=u>>>30,u&=1073741823,u+=((32767&g)<<15)+((32767&A)<<15),a+=u>>>30,c=y+(g>>>15)+(A>>>15),r.__setDigit(i,1073741823&u)}for(;a!=0||c!==0;i++){let u=r.__digit(i);u+=a+c,c=0,a=u>>>30,r.__setDigit(i,1073741823&u)}}static __internalMultiplyAdd(e,n,r,i,s){let o=r,a=0;for(let c=0;c>>15,n),m=l+((32767&d)<<15)+a+o;o=m>>>30,a=d>>>15,s.__setDigit(c,1073741823&m)}if(s.length>i)for(s.__setDigit(i++,o+a);ithis.length&&(r=this.length);let i=32767&e,s=e>>>15,o=0,a=n;for(let c=0;c>>15,m=t.__imul(l,i),h=t.__imul(l,s),f=t.__imul(d,i),g=t.__imul(d,s),A=a+m+o;o=A>>>30,A&=1073741823,A+=((32767&h)<<15)+((32767&f)<<15),o+=A>>>30,a=g+(h>>>15)+(f>>>15),this.__setDigit(c,1073741823&A)}if(o!=0||a!==0)throw new Error("implementation bug")}static __absoluteDivSmall(e,n,r=null){r===null&&(r=new t(e.length,!1));let i=0;for(let s,o=2*e.length-1;0<=o;o-=2){s=(i<<15|e.__halfDigit(o))>>>0;let a=0|s/n;i=0|s%n,s=(i<<15|e.__halfDigit(o-1))>>>0;let c=0|s/n;i=0|s%n,r.__setDigit(o>>>1,a<<15|c)}return r}static __absoluteModSmall(e,n){let r=0;for(let i=2*e.length-1;0<=i;i--)r=0|((r<<15|e.__halfDigit(i))>>>0)%n;return r}static __absoluteDivLarge(e,n,r,i){let s=n.__halfDigitLength(),o=n.length,a=e.__halfDigitLength()-s,c=null;r&&(c=new t(a+2>>>1,!1),c.__initializeDigits());let u=new t(s+2>>>1,!1);u.__initializeDigits();let l=t.__clz15(n.__halfDigit(s-1));0>>0;f=0|E/m;let _=0|E%m,S=n.__halfDigit(s-2),C=d.__halfDigit(g+s-2);for(;t.__imul(f,S)>>>0>(_<<16|C)>>>0&&(f--,_+=m,!(32767<_)););}t.__internalMultiplyAdd(n,f,0,o,u);let y=d.__inplaceSub(u,g,s+1);y!==0&&(y=d.__inplaceAdd(n,g,s),d.__setHalfDigit(g+s,32767&d.__halfDigit(g+s)+y),f--),r&&(1&g?h=f<<15:c.__setDigit(g>>>1,h|f))}if(i)return d.__inplaceRightShift(l),r?{quotient:c,remainder:d}:d;if(r)return c;throw new Error("unreachable")}static __clz15(e){return t.__clz30(e)-15}__inplaceAdd(e,n,r){let i=0;for(let s=0;s>>15,this.__setHalfDigit(n+s,32767&o)}return i}__inplaceSub(e,n,r){let i=0;if(1&n){n>>=1;let s=this.__digit(n),o=32767&s,a=0;for(;a>>1;a++){let l=e.__digit(a),d=(s>>>15)-(32767&l)-i;i=1&d>>>15,this.__setDigit(n+a,(32767&d)<<15|32767&o),s=this.__digit(n+a+1),o=(32767&s)-(l>>>15)-i,i=1&o>>>15}let c=e.__digit(a),u=(s>>>15)-(32767&c)-i;if(i=1&u>>>15,this.__setDigit(n+a,(32767&u)<<15|32767&o),n+a+1>=this.length)throw new RangeError("out of bounds");(1&r)==0&&(s=this.__digit(n+a+1),o=(32767&s)-(c>>>15)-i,i=1&o>>>15,this.__setDigit(n+e.length,1073709056&s|32767&o))}else{n>>=1;let s=0;for(;s>>15;let h=(l>>>15)-(d>>>15)-i;i=1&h>>>15,this.__setDigit(n+s,(32767&h)<<15|32767&m)}let o=this.__digit(n+s),a=e.__digit(s),c=(32767&o)-(32767&a)-i;i=1&c>>>15;let u=0;(1&r)==0&&(u=(o>>>15)-(a>>>15)-i,i=1&u>>>15),this.__setDigit(n+s,(32767&u)<<15|32767&c)}return i}__inplaceRightShift(e){if(e===0)return;let n=this.__digit(0)>>>e,r=this.length-1;for(let i=0;i>>e}this.__setDigit(r,n)}static __specialLeftShift(e,n,r){let i=e.length,s=new t(i+r,!1);if(n===0){for(let a=0;a>>30-n}return 0r)throw new RangeError("BigInt too big");let i=0|r/30,s=r%30,o=e.length,a=s!==0&&e.__digit(o-1)>>>30-s!=0,c=o+i+(a?1:0),u=new t(c,e.sign);if(s===0){let l=0;for(;l>>30-s}if(a)u.__setDigit(o+i,l);else if(l!==0)throw new Error("implementation bug")}return u.__trim()}static __rightShiftByAbsolute(e,n){let r=e.length,i=e.sign,s=t.__toShiftAmount(n);if(0>s)return t.__rightShiftByMaximum(i);let o=0|s/30,a=s%30,c=r-o;if(0>=c)return t.__rightShiftByMaximum(i);let u=!1;if(i){if((e.__digit(o)&(1<>>a,m=r-o-1;for(let h=0;h>>a}l.__setDigit(m,d)}return u&&(l=t.__absoluteAddOne(l,!0,l)),l.__trim()}static __rightShiftByMaximum(e){return e?t.__oneDigit(1,!0):t.__zero()}static __toShiftAmount(e){if(1t.__kMaxLengthBits?-1:n}static __toPrimitive(e,n="default"){if(typeof e!="object"||e.constructor===t)return e;if(typeof Symbol<"u"&&typeof Symbol.toPrimitive=="symbol"&&e[Symbol.toPrimitive]){let s=e[Symbol.toPrimitive](n);if(typeof s!="object")return s;throw new TypeError("Cannot convert object to primitive value")}let r=e.valueOf;if(r){let s=r.call(e);if(typeof s!="object")return s}let i=e.toString;if(i){let s=i.call(e);if(typeof s!="object")return s}throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(e){return t.__isBigInt(e)?e:+e}static __isBigInt(e){return typeof e=="object"&&e!==null&&e.constructor===t}static __truncateToNBits(e,n){let r=0|(e+29)/30,i=new t(r,n.sign),s=r-1;for(let a=0;a>>a}return i.__setDigit(s,o),i.__trim()}static __truncateAndSubFromPowerOfTwo(e,n,r){var i=Math.min;let s=0|(e+29)/30,o=new t(s,r),a=0,c=s-1,u=0;for(let h=i(c,n.length);a>>30,o.__setDigit(a,1073741823&f)}for(;a>>h;let f=1<<32-h;m=f-l-u,m&=f-1}return o.__setDigit(c,m),o.__trim()}__digit(e){return this[e]}__unsignedDigit(e){return this[e]>>>0}__setDigit(e,n){this[e]=0|n}__setDigitGrow(e,n){this[e]=0|n}__halfDigitLength(){let e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}__halfDigit(e){return 32767&this[e>>>1]>>>15*(1&e)}__setHalfDigit(e,n){let r=e>>>1,i=this.__digit(r),s=1&e?32767&i|n<<15:1073709056&i|32767&n;this.__setDigit(r,s)}static __digitPow(e,n){let r=1;for(;0>>=1,e*=e;return r}static __detectBigEndian(){return t.__kBitConversionDouble[0]=-0,t.__kBitConversionInts[0]!==0}static __isOneDigitInt(e){return(1073741823&e)===e}};Nu.__kMaxLength=33554432,Nu.__kMaxLengthBits=Nu.__kMaxLength<<5,Nu.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],Nu.__kBitsPerCharTableShift=5,Nu.__kBitsPerCharTableMultiplier=1<>>0)/Math.LN2)},Nu.__imul=Math.imul||function(t,e){return 0|t*e},$wn.exports=Nu});function Bvn(t,e,n){let r=t.indexOf(e);if(r===-1)return t;let i=e.length,s=0,o="";do o+=t.slice(s,r)+e+n,s=r+i,r=t.indexOf(e,s);while(r!==-1);return o+=t.slice(s),o}function Nvn(t,e,n,r){let i=0,s="";do{let o=t[r-1]==="\r";s+=t.slice(i,o?r-1:r)+e+(o?`\r +`:` +`)+n,i=r+1,r=t.indexOf(` +`,i)}while(r!==-1);return s+=t.slice(i),s}var Dvn=v(()=>{p()});function Lki(){let t=new Map;for(let[e,n]of Object.entries(Qa)){for(let[r,i]of Object.entries(n))Qa[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[r]=Qa[r],t.set(Number.parseInt(i[0],10),i[1]);Object.defineProperty(Qa,e,{value:n,enumerable:!1})}return Object.defineProperty(Qa,"codes",{value:t,enumerable:!1}),Qa.color.close="\x1B[39m",Qa.bgColor.close="\x1B[49m",Qa.underlineColor.close="\x1B[59m",Qa.color.ansi=Pvn(),Qa.color.ansi256=Nst(),Qa.color.ansi16m=Dst(),Qa.bgColor.ansi=Pvn(10),Qa.bgColor.ansi256=Nst(10),Qa.bgColor.ansi16m=Dst(10),Qa.underlineColor.ansi=Pki,Qa.underlineColor.ansi256=Nst(20),Qa.underlineColor.ansi16m=Dst(20),Object.defineProperties(Qa,{rgbToAnsi256:{value(e,n,r){return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){let n=/[\da-f]{6}|[\da-f]{3}/i.exec(e.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Qa.rgbToAnsi256(...Qa.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let n,r,i;if(e>=232)n=((e-232)*10+8)/255,r=n,i=n;else{e-=16;let a=e%36;n=Math.floor(e/36)/5,r=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(n,r,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(n));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,n,r)=>Qa.ansi256ToAnsi(Qa.rgbToAnsi256(e,n,r)),enumerable:!1},hexToAnsi:{value:e=>Qa.ansi256ToAnsi(Qa.hexToAnsi256(e)),enumerable:!1}}),Qa}var Pvn,Nst,Dst,Pki,Qa,aec,Mki,Oki,cec,lec,Fki,sw,Mvn=v(()=>{p();Pvn=(t=0)=>e=>`\x1B[${e+t}m`,Nst=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Dst=(t=0)=>(e,n,r)=>`\x1B[${38+t};2;${e};${n};${r}m`,Pki=t=>`\x1B[58;5;${t<90?t-30:t-90+8}m`,Qa={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],underlineDouble:["4:2",24],underlineCurly:["4:3",24],underlineDotted:["4:4",24],underlineDashed:["4:5",24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},underlineColor:{underlineBlack:["58;5;0",59],underlineRed:["58;5;1",59],underlineGreen:["58;5;2",59],underlineYellow:["58;5;3",59],underlineBlue:["58;5;4",59],underlineMagenta:["58;5;5",59],underlineCyan:["58;5;6",59],underlineWhite:["58;5;7",59],underlineBlackBright:["58;5;8",59],underlineGray:["58;5;8",59],underlineGrey:["58;5;8",59],underlineRedBright:["58;5;9",59],underlineGreenBright:["58;5;10",59],underlineYellowBright:["58;5;11",59],underlineBlueBright:["58;5;12",59],underlineMagentaBright:["58;5;13",59],underlineCyanBright:["58;5;14",59],underlineWhiteBright:["58;5;15",59]}},aec=Object.keys(Qa.modifier),Mki=Object.keys(Qa.color),Oki=Object.keys(Qa.bgColor),cec=Object.keys(Qa.underlineColor),lec=[...Mki,...Oki];Fki=Lki(),sw=Fki});function fb(t,e=globalThis.Deno?globalThis.Deno.args:Cwe.default.argv){let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),i=e.indexOf("--");return r!==-1&&(i===-1||r=2,has16m:t>=3}}function Gki(t,{streamIsTTY:e,sniffFlags:n=!0}={}){let r=Qki();r!==void 0&&(Swe=r);let i=n?Swe:r;if(i===0)return 0;if(n){if(fb("color=16m")||fb("color=full")||fb("color=truecolor"))return 3;if(fb("color=256"))return 2}if(i!==void 0&&Fvn())return i;if("TF_BUILD"in cl&&"AGENT_NAME"in cl)return 1;if(t&&!e&&i===void 0)return 0;let s=i||0;if(cl.TERM==="dumb")return s;if(Cwe.default.platform==="win32"){let o=Lvn.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in cl)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in cl)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in cl)||cl.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in cl)return/^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/.test(cl.TEAMCITY_VERSION)?1:0;if(cl.COLORTERM==="truecolor"||cl.TERM==="xterm-kitty"||cl.TERM==="xterm-ghostty"||cl.TERM==="wezterm")return 3;if("TERM_PROGRAM"in cl){let o=Number.parseInt((cl.TERM_PROGRAM_VERSION||"").split(".",1)[0],10);switch(cl.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(?:color)?$/i.test(cl.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(cl.TERM)||"COLORTERM"in cl?1:s}function Ovn(t,e={}){let n=Gki(t,{streamIsTTY:t&&t.isTTY,...e});return Uki(n)}var Cwe,Lvn,Pst,cl,Swe,$ki,Qvn,Uvn=v(()=>{p();Cwe=Ot(require("node:process"),1),Lvn=Ot(require("node:os"),1),Pst=Ot(require("node:tty"),1);({env:cl}=Cwe.default);fb("no-color")||fb("no-colors")||fb("color=false")||fb("color=never")?Swe=0:(fb("color")||fb("colors")||fb("color=true")||fb("color=always"))&&(Swe=1);$ki={stdout:Ovn({isTTY:Pst.default.isatty(1)}),stderr:Ovn({isTTY:Pst.default.isatty(2)})},Qvn=$ki});function ure(t){return qki(t)}var Gvn,$vn,are,cre,wwe,Iwe,lre,Wvn,Wki,Hki,qki,jki,Vki,Yki,Hvn,Ost,Mst,zki,Aec,tn,gb=v(()=>{p();Dvn();Mvn();Uvn();({stdout:Gvn,stderr:$vn}=Qvn),are=Symbol("GENERATOR"),cre=Symbol("STYLER"),wwe=Symbol("IS_EMPTY"),Iwe=Symbol("LEVEL"),lre=Object.create(null),Wvn=t=>{if(!Number.isSafeInteger(t)||t<0||t>3)throw new Error("The `level` should be an integer from 0 to 3")},Wki={enumerable:!0,get(){return this[Iwe]},set(t){Wvn(t),this[Iwe]=t}},Hki=(t,e={})=>{e.level!==void 0&&Wvn(e.level);let n=Gvn?Gvn.level:0;t[Iwe]=e.level===void 0?n:e.level},qki=t=>{let e=(...n)=>n.join(" ");return Hki(e,t),Object.setPrototypeOf(e,ure.prototype),e};Object.setPrototypeOf(ure.prototype,Function.prototype);for(let[t,e]of Object.entries(sw))lre[t]={get(){let n=Ost(this,Hvn(e.open,e.close,this[cre]),this[wwe]);return Object.defineProperty(this,t,{value:n}),n}};lre.visible={get(){let t=Ost(this,this[cre],!0);return Object.defineProperty(this,"visible",{value:t}),t}};jki=(t,e)=>{let n=sw[e];if(t==="rgb"){let i=(o,a,c)=>n.ansi(sw.rgbToAnsi(o,a,c));return[i,i,(o,a,c)=>n.ansi256(sw.rgbToAnsi256(o,a,c)),n.ansi16m]}if(t==="hex"){let i=o=>n.ansi(sw.hexToAnsi(o));return[i,i,o=>n.ansi256(sw.hexToAnsi256(o)),o=>n.ansi16m(...sw.hexToRgb(o))]}let r=i=>n.ansi(sw.ansi256ToAnsi(i));return[r,r,n.ansi256,n.ansi256]},Vki=["rgb","hex","ansi256"];for(let t of Vki){let e=t[0].toUpperCase()+t.slice(1);for(let[n,r]of[[t,"color"],["bg"+e,"bgColor"],["underline"+e,"underlineColor"]]){let{close:i}=sw[r],s=jki(t,r);lre[n]={get(){let o=function(a,c,u){let l=s[this.level](a,c,u);return Ost(this,Hvn(l,i,this[cre]),this[wwe])};return Object.defineProperty(this,n,{value:o}),o}}}}Yki=Object.defineProperties(()=>{},{...lre,level:{enumerable:!0,get(){return this[are].level},set(t){this[are].level=t}}}),Hvn=(t,e,n)=>{let r,i;return n===void 0?(r=t,i=e):(r=n.openAll+t,i=e+n.closeAll),{open:t,close:e,openAll:r,closeAll:i,parent:n}},Ost=(t,e,n)=>{let r=(...i)=>i.length===1?Mst(r,""+i[0]):i.length===2?Mst(r,i[0]+" "+i[1]):Mst(r,i.join(" "));return Object.setPrototypeOf(r,Yki),r[are]=t[are]??t,r[cre]=e,r[wwe]=n,r},Mst=(t,e)=>{if(t[are][Iwe]<=0||!e)return t[wwe]?"":e;let n=t[cre];if(n===void 0)return e;let{openAll:r,closeAll:i}=n;if(e.includes("\x1B"))for(;n!==void 0;)e=Bvn(e,n.close,n.open),n=n.parent;let s=e.indexOf(` +`);return s!==-1&&(e=Nvn(e,i,r,s)),r+e+i};Object.defineProperties(ure.prototype,{...lre,level:Wki});zki=ure(),Aec=ure({level:$vn?$vn.level:0}),tn=zki});var zvn=re((bec,Yvn)=>{p();Yvn.exports=Vvn;Vvn.sync=Jki;var qvn=require("fs");function Kki(t,e){var n=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r{p();Zvn.exports=Jvn;Jvn.sync=Xki;var Kvn=require("fs");function Jvn(t,e,n){Kvn.stat(t,function(r,i){n(r,r?!1:Xvn(i,e))})}function Xki(t,e){return Xvn(Kvn.statSync(t),e)}function Xvn(t,e){return t.isFile()&&Zki(t,e)}function Zki(t,e){var n=t.mode,r=t.uid,i=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,d=n&u||n&c&&i===o||n&a&&r===s||n&l&&s===0;return d}});var nRn=re((Iec,tRn)=>{p();var Cec=require("fs"),Twe;process.platform==="win32"||global.TESTING_WINDOWS?Twe=zvn():Twe=eRn();tRn.exports=Lst;Lst.sync=e1i;function Lst(t,e,n){if(typeof e=="function"&&(n=e,e={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){Lst(t,e||{},function(s,o){s?i(s):r(o)})})}Twe(t,e||{},function(r,i){r&&(r.code==="EACCES"||e&&e.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function e1i(t,e){try{return Twe.sync(t,e||{})}catch(n){if(e&&e.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var lRn=re((Tec,cRn)=>{p();var v8=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",rRn=require("path"),t1i=v8?";":":",iRn=nRn(),sRn=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),oRn=(t,e)=>{let n=e.colon||t1i,r=t.match(/\//)||v8&&t.match(/\\/)?[""]:[...v8?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],i=v8?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=v8?i.split(n):[""];return v8&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:i}},aRn=(t,e,n)=>{typeof e=="function"&&(n=e,e={}),e||(e={});let{pathEnv:r,pathExt:i,pathExtExe:s}=oRn(t,e),o=[],a=u=>new Promise((l,d)=>{if(u===r.length)return e.all&&o.length?l(o):d(sRn(t));let m=r[u],h=/^".*"$/.test(m)?m.slice(1,-1):m,f=rRn.join(h,t),g=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+f:f;l(c(g,u,0))}),c=(u,l,d)=>new Promise((m,h)=>{if(d===i.length)return m(a(l+1));let f=i[d];iRn(u+f,{pathExt:s},(g,A)=>{if(!g&&A)if(e.all)o.push(u+f);else return m(u+f);return m(c(u,l,d+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},n1i=(t,e)=>{e=e||{};let{pathEnv:n,pathExt:r,pathExtExe:i}=oRn(t,e),s=[];for(let o=0;o{"use strict";p();var uRn=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Fst.exports=uRn;Fst.exports.default=uRn});var fRn=re((Bec,hRn)=>{"use strict";p();var pRn=require("path"),r1i=lRn(),i1i=dRn();function mRn(t,e){let n=t.options.env||process.env,r=process.cwd(),i=t.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let o;try{o=r1i.sync(t.command,{path:n[i1i({env:n})],pathExt:e?pRn.delimiter:void 0})}catch{}finally{s&&process.chdir(r)}return o&&(o=pRn.resolve(i?t.options.cwd:"",o)),o}function s1i(t){return mRn(t)||mRn(t,!0)}hRn.exports=s1i});var gRn=re((Dec,Ust)=>{"use strict";p();var Qst=/([()\][%!^"`<>&|;, *?])/g;function o1i(t){return t=t.replace(Qst,"^$1"),t}function a1i(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Qst,"^$1"),e&&(t=t.replace(Qst,"^$1")),t}Ust.exports.command=o1i;Ust.exports.argument=a1i});var yRn=re((Mec,ARn)=>{"use strict";p();ARn.exports=/^#!(.*)/});var bRn=re((Lec,ERn)=>{"use strict";p();var c1i=yRn();ERn.exports=(t="")=>{let e=t.match(c1i);if(!e)return null;let[n,r]=e[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i}});var xRn=re((Qec,_Rn)=>{"use strict";p();var Gst=require("fs"),l1i=bRn();function u1i(t){let n=Buffer.alloc(150),r;try{r=Gst.openSync(t,"r"),Gst.readSync(r,n,0,150,0),Gst.closeSync(r)}catch{}return l1i(n.toString())}_Rn.exports=u1i});var wRn=re((Gec,IRn)=>{"use strict";p();var d1i=require("path"),SRn=fRn(),CRn=gRn(),p1i=xRn(),m1i=process.platform==="win32",h1i=/\.(?:com|exe)$/i,f1i=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function g1i(t){t.file=SRn(t);let e=t.file&&p1i(t.file);return e?(t.args.unshift(t.file),t.command=e,SRn(t)):t.file}function A1i(t){if(!m1i)return t;let e=g1i(t),n=!h1i.test(e);if(t.options.forceShell||n){let r=f1i.test(e);t.command=d1i.normalize(t.command),t.command=CRn.command(t.command),t.args=t.args.map(s=>CRn.argument(s,r));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function y1i(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null),e=e?e.slice(0):[],n=Object.assign({},n);let r={command:t,args:e,options:n,file:void 0,original:{command:t,args:e}};return n.shell?r:A1i(r)}IRn.exports=y1i});var RRn=re((Wec,vRn)=>{"use strict";p();var $st=process.platform==="win32";function Wst(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function E1i(t,e){if(!$st)return;let n=t.emit;t.emit=function(r,i){if(r==="exit"){let s=TRn(i,e);if(s)return n.call(t,"error",s)}return n.apply(t,arguments)}}function TRn(t,e){return $st&&t===1&&!e.file?Wst(e.original,"spawn"):null}function b1i(t,e){return $st&&t===1&&!e.file?Wst(e.original,"spawnSync"):null}vRn.exports={hookChildProcess:E1i,verifyENOENT:TRn,verifyENOENTSync:b1i,notFoundError:Wst}});var NRn=re((qec,R8)=>{"use strict";p();var kRn=require("child_process"),Hst=wRn(),qst=RRn();function BRn(t,e,n){let r=Hst(t,e,n),i=kRn.spawn(r.command,r.args,r.options);return qst.hookChildProcess(i,r),i}function _1i(t,e,n){let r=Hst(t,e,n),i=kRn.spawnSync(r.command,r.args,r.options);return i.error=i.error||qst.verifyENOENTSync(i.status,r),i}R8.exports=BRn;R8.exports.spawn=BRn;R8.exports.sync=_1i;R8.exports._parse=Hst;R8.exports._enoent=qst});function k8(t,e,n){return process.platform==="win32"?(0,jst.default)(t,e,n):(0,vwe.spawn)(t,e,n)}function SR(t,e,n){return process.platform==="win32"?jst.default.sync(t,e,n):(0,vwe.spawnSync)(t,e,n)}function B8(t){return new Promise((e,n)=>{let r=!1,i=!1,s=null,o,a=t.stdout===null,c=t.stderr===null,u=()=>{o&&(clearTimeout(o),o=void 0),t.removeListener("error",A),t.removeListener("exit",y),t.removeListener("close",E),t.stdout?.removeListener("end",f),t.stderr?.removeListener("end",g),t.stdout?.removeListener("data",h),t.stderr?.removeListener("data",h)},l=_=>{r||(r=!0,u(),t.stdout?.destroy(),t.stderr?.destroy(),e(_))},d=()=>{!i||r||a&&c&&l(s)},m=()=>{o&&clearTimeout(o),o=setTimeout(()=>l(s),x1i)},h=()=>{i&&!r&&m()},f=()=>{a=!0,d()},g=()=>{c=!0,d()},A=_=>{r||(r=!0,u(),n(_))},y=_=>{i=!0,s=_,d(),r||m()},E=_=>{l(_)};t.stdout?.once("end",f),t.stderr?.once("end",g),t.stdout?.on("data",h),t.stderr?.on("data",h),t.once("error",A),t.once("exit",y),t.once("close",E)})}var vwe,jst,x1i,FF=v(()=>{p();vwe=require("node:child_process"),jst=Ot(NRn(),1),x1i=100});function cd(t){try{return(0,Rwe.realpathSync)(t)}catch{return t}}function CR(t){try{let e=(0,Rwe.statSync)(t,{bigint:!0});return`${e.dev}:${e.ino}:${e.size}:${e.mtimeNs}:${e.ctimeNs}`}catch{return}}function Ab(t){let e=t.trim();return!(e.startsWith("npm:")||e.startsWith("git:")||e.startsWith("github:")||e.startsWith("http:")||e.startsWith("https:")||e.startsWith("ssh:"))}function C1i(t){if(!t.startsWith("/")||t.startsWith("//")||t.includes("\\"))return t;let e=t.match(/^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i);if(!e)return t;let n=e[2]?.replaceAll("/","\\");return`${e[1].toUpperCase()}:\\${n??""}`}function Vo(t,e={}){let n=e.trim?t.trim():t;if(e.normalizeUnicodeSpaces&&(n=n.replace(S1i," ")),e.stripAtPrefix&&n.startsWith("@")&&(n=n.slice(1)),process.platform==="win32"&&(n=C1i(n)),e.expandTilde??!0){let r=e.homeDir??(0,DRn.homedir)();if(n==="~")return r;if(n.startsWith("~/")||process.platform==="win32"&&n.startsWith("~\\"))return(0,mE.join)(r,n.slice(2))}return/^file:\/\//.test(n)?(0,PRn.fileURLToPath)(n):n}function Vn(t,e=process.cwd(),n={}){let r=Vo(t,n),i=Vo(e);return(0,mE.isAbsolute)(r)?(0,mE.resolve)(r):(0,mE.resolve)(i,r)}function QF(t,e){let n=Vn(e),r=Vn(t,n),i=(0,mE.relative)(n,r);return i===""||i!==".."&&!i.startsWith(`..${mE.sep}`)&&!(0,mE.isAbsolute)(i)?i||".":void 0}function MRn(t,e){let n=Vn(t,e);return(QF(n,e)??n).split(mE.sep).join("/")}function ORn(t){let e=process.platform==="darwin"?["com.dropbox.ignored","com.apple.fileprovider.ignore#P"]:process.platform==="linux"?["user.com.dropbox.ignored"]:[];for(let n of e)process.platform==="darwin"?SR("xattr",["-w",n,"1",t],{encoding:"utf-8",stdio:"ignore"}):SR("setfattr",["-n",n,"-v","1",t],{encoding:"utf-8",stdio:"ignore"})}var Rwe,DRn,mE,PRn,S1i,fc=v(()=>{p();Rwe=require("node:fs"),DRn=require("node:os"),mE=require("node:path"),PRn=require("node:url");FF();S1i=/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g});function dre(t){return t.startsWith("\uFEFF")?{bom:"\uFEFF",text:t.slice(1)}:{bom:"",text:t}}function zs(t){return dre(t).text}var nm=v(()=>{p()});function $Rn(t){return typeof t=="string"?{packageName:t,installSpec:t}:{packageName:t.packageName,installSpec:t.installSpec??t.packageName}}function kwe(t,e){return e?{...t,display:`${e.display} && ${t.display}`,steps:[e,t]}:t}function AD(t,e){return{command:t,args:e,display:[t,...e].map(n=>/\s/.test(n)?`"${n}"`:n).join(" ")}}function Nwe(){if(yD)return"bun-binary";let t=`${URn}\0${process.execPath||""}`.toLowerCase().replace(/\\/g,"/");return t.includes("/pnpm/")||t.includes("/.pnpm/")?"pnpm":t.includes("/yarn/")||t.includes("/.yarn/")?"yarn":w1i||t.includes("/install/global/node_modules/")?"bun":t.includes("/npm/")||t.includes("/node_modules/")?"npm":"unknown"}function WRn(){let t=eu(),e=process.platform==="win32"||t.includes("\\")?Br.win32:{basename:Br.basename,dirname:Br.dirname},n=e.dirname(t),r;if(e.basename(n).startsWith("@")&&e.basename(e.dirname(n))==="node_modules"?r=e.dirname(n):e.basename(n)==="node_modules"&&(r=n),!r)return;let i=e.dirname(r);if(e.basename(i)==="lib")return{root:r,prefix:e.dirname(i)}}function HRn(t,e,n=e,r){let i=$Rn(n);switch(t){case"bun-binary":return;case"pnpm":{let s=N8("pnpm",["root","-g"])?void 0:/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(eu()),o=s?[`--config.global-bin-dir=${process.env.PNPM_HOME||(0,Br.dirname)((0,Br.dirname)(s[1]))}`]:[];return kwe(AD("pnpm",["install","-g","--ignore-scripts","--config.minimumReleaseAge=0",...o,i.installSpec]),i.packageName===e?void 0:AD("pnpm",["remove","-g",...o,e]))}case"yarn":return kwe(AD("yarn",["global","add","--ignore-scripts",i.installSpec]),i.packageName===e?void 0:AD("yarn",["global","remove",e]));case"bun":return kwe(AD("bun",["install","-g","--ignore-scripts","--minimum-release-age=0",i.installSpec]),i.packageName===e?void 0:AD("bun",["uninstall","-g",e]));case"npm":{let[s="npm",...o]=r??[],a=r?.length?void 0:WRn(),c=[...o,...a?["--prefix",a.prefix]:[]],u=AD(s,[...c,"install","-g","--ignore-scripts","--min-release-age=0",i.installSpec]),l=i.packageName===e?void 0:AD(s,[...c,"uninstall","-g",e]);return kwe(u,l)}case"unknown":return}}function N8(t,e,n={}){let r=SR(t,e,{encoding:"utf-8",stdio:["ignore","pipe","pipe"]});if(r.status===0)return r.stdout.trim()||void 0;if(n.requireSuccess){let i=r.error?.message||r.stderr.trim()||`exit code ${r.status??"unknown"}`;throw new Error(`Failed to run ${[t,...e].join(" ")}: ${i}`)}}function T1i(t,e,n){switch(t){case"npm":{let r=!!n?.length,[i="npm",...s]=n??[];if(r&&i==="bun"){let c=N8(i,[...s,"pm","bin","-g"],{requireSuccess:!0}),u=[(0,Br.join)((0,Bwe.homedir)(),".bun","install","global","node_modules")];return c&&u.push((0,Br.join)((0,Br.dirname)(c),"install","global","node_modules")),u}let o=N8(i,[...s,"root","-g"],{requireSuccess:r}),a=r?void 0:WRn();return[o,a?.root].filter(c=>!!c)}case"pnpm":{let r=N8("pnpm",["root","-g"]);if(r)return[r,(0,Br.dirname)(r)];let i=/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(eu());return i?[i[1]]:[]}case"yarn":{let r=N8("yarn",["global","dir"]);return r?[r,(0,Br.join)(r,"node_modules")]:[]}case"bun":{let r=N8("bun",["pm","bin","-g"]),i=[(0,Br.join)((0,Bwe.homedir)(),".bun","install","global","node_modules")];return r&&i.push((0,Br.join)((0,Br.dirname)(r),"install","global","node_modules")),i}case"bun-binary":case"unknown":return[]}}function LRn(t,e){let n=(0,Br.resolve)(t);if(!(0,rm.existsSync)(n))return;let r=n;if(e)try{r=(0,rm.realpathSync)(n)}catch{return}return process.platform==="win32"&&(r=r.toLowerCase()),r}function FRn(t){return Array.from(new Set([LRn(t,!1),LRn(t,!0)].filter(e=>!!e)))}function v1i(){let t=process.argv[1];if(!t)return;let e=(0,Br.dirname)(t);for(;e!==(0,Br.dirname)(e);){if((0,rm.existsSync)((0,Br.join)(e,"package.json")))return e;e=(0,Br.dirname)(e)}}function qRn(){let t=eu();try{return(0,rm.accessSync)(t,rm.constants.W_OK),(0,rm.accessSync)((0,Br.dirname)(t),rm.constants.W_OK),!0}catch{return!1}}function jRn(t,e,n){let i=[eu(),v1i()].filter(s=>!!s).flatMap(s=>FRn(s));return T1i(t,e,n).some(s=>FRn(s).some(o=>{let a=o.endsWith(Br.sep)?o:`${o}${Br.sep}`;return i.some(c=>c.startsWith(a))}))}function VRn(t,e,n=t){let r=Nwe(),i=HRn(r,t,n,e);if(!(!i||!jRn(r,t,e)||!qRn()))return i}function YRn(t,e,n=t){let r=Nwe(),i=$Rn(n);if(r==="bun-binary")return"Download from: https://github.com/earendil-works/pi/releases/latest";let s=HRn(r,t,i,e);return s?jRn(r,t,e)&&!qRn()?`This installation is managed by a global ${r} install, but the install path is not writable. Update it yourself with: ${s.display}`:`This installation is not managed by a global ${r} install. Update it with the package manager, wrapper, or source checkout that provides it.`:`Update ${i.installSpec} using the package manager, wrapper, or source checkout that provides this installation.`}function R1i(t){let e=t;for(;e!==(0,Br.dirname)(e);){if((0,rm.existsSync)((0,Br.join)(e,"package.json"))){let n=(0,Br.dirname)(e);return(0,Br.basename)(e)==="dist"&&(0,rm.existsSync)((0,Br.join)(n,"package.json"))?n:e}e=(0,Br.dirname)(e)}return t}function eu(){let t=process.env.PI_PACKAGE_DIR;return t?Vo(t):yD?(0,Br.dirname)(process.execPath):R1i(URn)}function Vst(){if(yD)return(0,Br.join)(eu(),"theme");let t=eu(),e=(0,rm.existsSync)((0,Br.join)(t,"src"))?"src":"dist";return(0,Br.join)(t,e,"modes","interactive","theme")}function zRn(){if(yD)return(0,Br.join)(eu(),"export-html");let t=eu(),e=(0,rm.existsSync)((0,Br.join)(t,"src"))?"src":"dist";return(0,Br.join)(t,e,"core","export-html")}function k1i(){return(0,Br.join)(eu(),"package.json")}function D8(){return(0,Br.resolve)((0,Br.join)(eu(),"README.md"))}function IR(){return(0,Br.resolve)((0,Br.join)(eu(),"docs"))}function Dwe(){return(0,Br.resolve)((0,Br.join)(eu(),"examples"))}function Pwe(){return(0,Br.resolve)((0,Br.join)(eu(),"CHANGELOG.md"))}function B1i(){if(yD)return(0,Br.join)(eu(),"assets");let t=eu(),e=(0,rm.existsSync)((0,Br.join)(t,"src"))?"src":"dist";return(0,Br.join)(t,e,"modes","interactive","assets")}function KRn(t){return(0,Br.join)(B1i(),t)}function zst(t){return Vo(t)}function XRn(t){return`${process.env.PI_SHARE_VIEWER_URL||N1i}#${t}`}function ii(){let t=process.env[mre];return t?zst(t):(0,Br.join)((0,Bwe.homedir)(),Bi,"agent")}function Owe(){return(0,Br.join)(ii(),"themes")}function Lwe(){return(0,Br.join)(ii(),"auth.json")}function ZRn(){return(0,Br.join)(ii(),"settings.json")}function P8(){return(0,Br.join)(ii(),"bin")}function ekn(){return(0,Br.join)(ii(),"sessions")}function tkn(){return(0,Br.join)(ii(),`${hn}-debug.log`)}var rm,Bwe,Br,QRn,I1i,URn,yD,w1i,GRn,pre,JRn,ED,hn,Yst,Bi,Nl,mre,Mwe,N1i,Qs=v(()=>{p();rm=require("fs"),Bwe=require("os"),Br=require("path"),QRn=require("url");FF();fc();nm();I1i=(0,QRn.fileURLToPath)(x),URn=(0,Br.dirname)(I1i),yD=x.includes("$bunfs")||x.includes("~BUN")||x.includes("%7EBUN"),w1i=!!process.versions.bun,GRn=!0;pre={};try{pre=JSON.parse(zs((0,rm.readFileSync)(k1i(),"utf-8")))}catch(t){if(t.code!=="ENOENT")throw t}JRn=pre.piConfig?.name,ED=pre.name||"@earendil-works/pi-coding-agent",hn=JRn||"pi",Yst=JRn?hn:"\u03C0",Bi=pre.piConfig?.configDir||".pi",Nl=pre.version||"0.0.0",mre=`${hn.toUpperCase()}_CODING_AGENT_DIR`,Mwe=`${hn.toUpperCase()}_CODING_AGENT_SESSION_DIR`;N1i="https://pi.dev/session/"});function hre(t){return nkn.includes(t)}function rkn(t){let e=t.trim();return e.length>0?e:void 0}function fre(t){let e={messages:[],fileArgs:[],unknownFlags:new Map,diagnostics:[]};for(let n=0;ni.trim());else if(r==="--no-tools"||r==="-nt")e.noTools=!0;else if(r==="--no-builtin-tools"||r==="-nbt")e.noBuiltinTools=!0;else if((r==="--tools"||r==="-t")&&n+1i.trim()).filter(i=>i.length>0);else if((r==="--exclude-tools"||r==="-xt")&&n+1i.trim()).filter(i=>i.length>0);else if(r==="--thinking"&&n+10?` +${tn.bold("Extension CLI Flags:")} +${t.map(n=>{let r=n.type==="string"?" ":"",i=n.description??`Registered by ${n.extensionPath}`;return` --${n.name}${r}`.padEnd(30)+i}).join(` +`)} +`:"";console.log(`${tn.bold(hn)} - AI coding assistant with read, bash, edit, write tools + +${tn.bold("Usage:")} + ${hn} [options] [--] [@files...] [messages...] + +${tn.bold("Commands:")} + ${hn} install [-l] Install extension source and add to settings + ${hn} remove [-l] Remove extension source from settings + ${hn} uninstall [-l] Alias for remove + ${hn} update [source|self|pi] Update pi, extensions, or model catalogs + ${hn} list List installed extensions from settings + ${hn} config [-l] Open TUI to enable/disable package resources (Tab switches scope) + ${hn} auth Print credentials or check provider readiness + ${hn} --help Show help for install/remove/uninstall/update/list/config/auth + +${tn.bold("Options:")} + --provider Provider name (default: google) + --model Model pattern or ID (supports "provider/id" and optional ":") + --api-key API key (defaults to env vars) + --system-prompt System prompt (default: coding assistant prompt) + --append-system-prompt Append text or file contents to the system prompt (can be used multiple times) + --mode Output mode: text (default), json, or rpc + --print, -p Non-interactive mode: process prompt and exit + --continue, -c Continue previous session + --resume, -r Select a session to resume + --session Use specific session file or partial UUID + --session-id Use exact project session ID, creating it if missing + --fork Fork specific session file or partial UUID into a new session + --session-dir Directory for session storage and lookup + --no-session Don't save session (ephemeral) + --name, -n Set session display name + --models Comma-separated model patterns for Ctrl+P cycling + Supports globs (anthropic/*, *sonnet*) and fuzzy matching + --no-tools, -nt Disable all tools by default (built-in and extension) + --no-builtin-tools, -nbt Disable built-in tools by default but keep extension/custom tools enabled + --tools, -t Comma-separated allowlist of tool names to enable + Applies to built-in, extension, and custom tools + --exclude-tools, -xt Comma-separated denylist of tool names to disable + Applies to built-in, extension, and custom tools + --thinking Set thinking level: off, minimal, low, medium, high, xhigh, max + --extension, -e Load an extension file (can be used multiple times) + --no-extensions, -ne Disable extension discovery (explicit -e paths still work) + --skill Load a skill file or directory (can be used multiple times) + --no-skills, -ns Disable skills discovery and loading + --prompt-template Load a prompt template file or directory (can be used multiple times) + --no-prompt-templates, -np Disable prompt template discovery and loading + --theme Load a theme file or directory (can be used multiple times) + --use-theme Set the initial interactive theme for this run + --no-themes Disable theme discovery and loading + --no-context-files, -nc Disable AGENTS.md and CLAUDE.md discovery and loading + --export Export session file to HTML and exit + --list-models [search] List available models (with optional fuzzy search) + --verbose Force verbose startup (overrides quietStartup setting) + --tui-mode TUI mode: regular (default) or fullscreen + --approve, -a Trust project-local files for this run + --no-approve, -na Ignore project-local files for this run + --offline Disable startup network operations (same as PI_OFFLINE=1) + -- End option parsing; treat remaining arguments as messages/files + --help, -h Show this help + --version, -v Show version number + +Extensions can register additional flags (e.g., --plan from plan-mode extension).${e} + +${tn.bold("Examples:")} + # Print a provider API key for an external client + ${hn} auth print-api-key --provider openai + + # Print an OAuth bearer token for an external client (refreshes if expired) + ${hn} auth print-bearer-token --provider openai-codex + + # Interactive mode + ${hn} + + # Interactive mode with initial prompt + ${hn} "List all .ts files in src/" + + # Include files in initial message + ${hn} @prompt.md @image.png "What color is the sky?" + + # Non-interactive mode (process and exit) + ${hn} -p "List all .ts files in src/" + + # Prompt beginning with a dash + ${hn} -p -- "- Summarize these points" + + # Multiple messages (interactive) + ${hn} "Read package.json" "What dependencies do we have?" + + # Continue previous session + ${hn} --continue "What did we discuss?" + + # Start a named session + ${hn} --name "Refactor auth module" + + # Use different model + ${hn} --provider openai --model gpt-4o-mini "Help me refactor this code" + + # Use model with provider prefix (no --provider needed) + ${hn} --model openai/gpt-4o "Help me refactor this code" + + # Use model with thinking level shorthand + ${hn} --model sonnet:high "Solve this complex problem" + + # Limit model cycling to specific models + ${hn} --models claude-sonnet,claude-haiku,gpt-4o + + # Limit to a specific provider with glob pattern + ${hn} --models "github-copilot/*" + + # Cycle models with fixed thinking levels + ${hn} --models sonnet:high,haiku:low + + # Start with a specific thinking level + ${hn} --thinking high "Solve this complex problem" + + # Read-only mode (no file modifications possible) + ${hn} --tools read,grep,find,ls -p "Review the code in src/" + + # Disable one tool while keeping the rest available + ${hn} --exclude-tools ask_question + + # Export a session file to HTML + ${hn} --export ~/${Bi}/agent/sessions/--path--/session.jsonl + ${hn} --export session.jsonl output.html + +${tn.bold("Environment Variables:")} + ANTHROPIC_AUTH_TOKEN - Anthropic bearer auth token + ANTHROPIC_API_KEY - Anthropic Claude API key + ANTHROPIC_OAUTH_TOKEN - Anthropic OAuth token (alternative to API key) + ANT_LING_API_KEY - Ant Ling API key + OPENAI_API_KEY - OpenAI GPT API key + AZURE_OPENAI_API_KEY - Azure OpenAI API key + AZURE_OPENAI_BASE_URL - Azure OpenAI/Cognitive Services base URL (e.g. https://{resource}.openai.azure.com) + AZURE_OPENAI_RESOURCE_NAME - Azure OpenAI resource name (alternative to base URL) + AZURE_OPENAI_API_VERSION - Azure OpenAI API version (default: v1) + AZURE_OPENAI_DEPLOYMENT_NAME_MAP - Azure OpenAI model=deployment map (comma-separated) + DEEPSEEK_API_KEY - DeepSeek API key + NVIDIA_API_KEY - NVIDIA NIM API key + GEMINI_API_KEY - Google Gemini API key + GROQ_API_KEY - Groq API key + CEREBRAS_API_KEY - Cerebras API key + XAI_API_KEY - xAI Grok API key + FIREWORKS_API_KEY - Fireworks API key + TOGETHER_API_KEY - Together AI API key + BASETEN_API_KEY - Baseten API key + OPENROUTER_API_KEY - OpenRouter API key + AI_GATEWAY_API_KEY - Vercel AI Gateway API key + ZAI_API_KEY - ZAI Coding Plan API key (Global) + ZAI_CODING_CN_API_KEY - ZAI Coding Plan API key (China) + MISTRAL_API_KEY - Mistral API key + MINIMAX_API_KEY - MiniMax API key + MOONSHOT_API_KEY - Moonshot AI API key + OPENCODE_API_KEY - OpenCode Zen/OpenCode Go API key + KIMI_API_KEY - Kimi For Coding API key + META_API_KEY - Meta Model API key + CLOUDFLARE_API_KEY - Cloudflare API token (Workers AI and AI Gateway) + CLOUDFLARE_ACCOUNT_ID - Cloudflare account id (required for both) + CLOUDFLARE_GATEWAY_ID - Cloudflare AI Gateway slug (required for AI Gateway) + QWEN_TOKEN_PLAN_API_KEY - Qwen Token Plan API key (international region) + QWEN_TOKEN_PLAN_CN_API_KEY - Qwen Token Plan API key (China region) + XIAOMI_API_KEY - Xiaomi MiMo API key (api.xiaomimimo.com billing) + XIAOMI_TOKEN_PLAN_CN_API_KEY - Xiaomi MiMo Token Plan API key (China region) + XIAOMI_TOKEN_PLAN_AMS_API_KEY - Xiaomi MiMo Token Plan API key (Amsterdam region) + XIAOMI_TOKEN_PLAN_SGP_API_KEY - Xiaomi MiMo Token Plan API key (Singapore region) + AWS_PROFILE - AWS profile for Amazon Bedrock + AWS_ACCESS_KEY_ID - AWS access key for Amazon Bedrock + AWS_SECRET_ACCESS_KEY - AWS secret key for Amazon Bedrock + AWS_BEARER_TOKEN_BEDROCK - Bedrock API key (bearer token) + AWS_REGION - AWS region for Amazon Bedrock (e.g., us-east-1) + ${mre.padEnd(32)} - Config directory (default: ~/${Bi}/agent) + ${Mwe.padEnd(32)} - Session storage directory (overridden by --session-dir) + PI_PACKAGE_DIR - Override package directory (for Nix/Guix store paths) + PI_OFFLINE - Disable startup network operations when set to 1/true/yes + PI_TELEMETRY - Override install telemetry when set to 1/true/yes or 0/false/no + PI_SHARE_VIEWER_URL - Base URL for /share command (default: https://pi.dev/session/) -`)}if(s)break}if(r.trim()){let s=_4t(r);s&&(yield s)}}finally{n.releaseLock()}}function _4t(t){let e=t.split(` -`).find(n=>n.startsWith("data:"))?.slice(5).trim();return e&&e!=="[DONE]"?JSON.parse(e):void 0}function mWr(t,e,n){let r=n?"aborted":"error",s={role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:S4t(),stopReason:r,errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()};return!n&&e instanceof dz&&ZS(s,$8("pi_messages_response_failure",e,e.diagnosticDetails)),{type:"error",reason:r,error:s}}function fWr(t,e){return t||(Ps("PI_CACHE_RETENTION",e)==="long"?"long":void 0)}var dz,C4t,gWr,x4t=V(()=>{p();qB();Pf();oE();Px();tC();dz=class extends Error{code;diagnosticDetails;constructor(e,n,r){super(e),this.name="PiMessagesResponseError",this.code=n,this.diagnosticDetails=r}};C4t=(t,e,n)=>{let r=new Ka,s=pWr(t);return(async()=>{try{let i=n?.apiKey;if(!i)throw new Error(`No API key provided for provider "${t.provider}"`);let o=new URL(`${t.baseUrl.replace(/\/+$/u,"")}/messages`);n?.debug&&o.searchParams.set("debug","1");let a={model:t.id,context:e,options:{temperature:n?.temperature,maxTokens:n?.maxTokens,reasoning:n?.reasoning,cacheRetention:fWr(n?.cacheRetention,n?.env),sessionId:n?.sessionId,toolChoice:n?.toolChoice}},c=await n?.onPayload?.(a,t);c!==void 0&&(a=c);let u=await(n?.fetch??globalThis.fetch)(o,{method:"POST",headers:{authorization:`Bearer ${i}`,accept:"text/event-stream","content-type":"application/json",...eC(n?.headers)},body:JSON.stringify(a),signal:n?.signal});if(await n?.onResponse?.({status:u.status,headers:Pp(u.headers)},t),!u.ok){let l=await u.text();throw dWr(t,o,u,l)}if(!u.body)throw new Error(`${t.provider} response has no body`);for await(let l of hWr(u.body)){let d=s(l);if(r.push(d),d.type==="done"||d.type==="error")return}throw new Error(`${t.provider} stream ended without a terminal event`)}catch(i){r.push(mWr(t,i,n?.signal?.aborted??!1))}})(),r},gWr=(t,e,n)=>{let r=n;return C4t(t,e,{...n,reasoning:n?.reasoning,toolChoice:n?.toolChoice,debug:r?.debug})}});var gVe={};Ir(gVe,{generateImages:()=>TWr});function vWr(t,e,n,r){return new as({apiKey:e,baseURL:t.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:eC({...t.headers,...n})})}function RWr(t,e){let n=e.input.map(r=>r.type==="text"?{type:"text",text:ts(r.text)}:{type:"image_url",image_url:{url:`data:${r.mimeType};base64,${r.data}`}});return{model:t.id,messages:[{role:"user",content:n}],stream:!1,modalities:t.output.includes("text")?["image","text"]:["image"]}}function kWr(t,e){let n=t.prompt_tokens||0,r=t.prompt_tokens_details?.cached_tokens||0,s=t.prompt_tokens_details?.cache_write_tokens||0,i=s>0?Math.max(0,r-s):r,o=Math.max(0,n-i-s),a=t.completion_tokens||0,c={input:o,output:a,cacheRead:i,cacheWrite:s,totalTokens:o+a+i+s,cost:{input:e.cost.input/1e6*o,output:e.cost.output/1e6*a,cacheRead:e.cost.cacheRead/1e6*i,cacheWrite:e.cost.cacheWrite/1e6*s,total:0}};return c.cost.total=c.cost.input+c.cost.output+c.cost.cacheRead+c.cost.cacheWrite,c}var TWr,AVe=V(()=>{p();EK();Bx();oE();SP();nC();TWr=async(t,e,n)=>{let r={api:t.api,provider:t.provider,model:t.id,output:[],stopReason:"stop",timestamp:Date.now()};try{let s=n?.apiKey;if(!s)throw new Error(`No API key for provider: ${t.provider}`);let i=vWr(t,s,n?.headers,n?.fetch),o=RWr(t,e),a=await n?.onPayload?.(o,t);a!==void 0&&(o=a);let c={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},{data:u,response:l}=await yE(()=>i.chat.completions.create(o,c).withResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});await n?.onResponse?.({status:l.status,headers:Pp(l.headers)},t);let d=u;r.responseId=d.id,d.usage&&(r.usage=kWr(d.usage,t));let h=d.choices[0];if(h){let m=h.message.content;typeof m=="string"&&m.length>0&&r.output.push({type:"text",text:m});for(let f of h.message.images??[]){let g=typeof f.image_url=="string"?f.image_url:f.image_url?.url;if(!g?.startsWith("data:"))continue;let A=g.match(/^data:([^;]+);base64,(.+)$/);A&&r.output.push({type:"image",mimeType:A[1],data:A[2]})}}return r}catch(s){return r.stopReason=n?.signal?.aborted?"aborted":"error",r.errorMessage=Of(Ch(s)),r}}});var cen=ee((uCa,aen)=>{"use strict";p();var $l=class t extends Array{constructor(e,n){if(super(e),this.sign=n,Object.setPrototypeOf(this,t.prototype),e>t.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded")}static BigInt(e){var n=Math.floor,r=Number.isFinite;if(typeof e=="number"){if(e===0)return t.__zero();if(t.__isOneDigitInt(e))return 0>e?t.__oneDigit(-e,!0):t.__oneDigit(e,!1);if(!r(e)||n(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return t.__fromDouble(e)}if(typeof e=="string"){let s=t.__fromString(e);if(s===null)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return s}if(typeof e=="boolean")return e===!0?t.__oneDigit(1,!1):t.__zero();if(typeof e=="object"){if(e.constructor===t)return e;let s=t.__toPrimitive(e);return t.BigInt(s)}throw new TypeError("Cannot convert "+e+" to a BigInt")}toDebugString(){let e=["BigInt["];for(let n of this)e.push((n&&(n>>>0).toString(16))+", ");return e.push("]"),e.join("")}toString(e=10){if(2>e||36>>=12;let d=u-12,h=12<=u?0:a<<20+u,m=20+u;for(0>>30-d,h=a<>>30-m,m-=30;let f=t.__decideRounding(e,m,c,a);if((f===1||f===0&&(1&h)==1)&&(h=h+1>>>0,h===0&&(l++,l>>>20!=0&&(l=0,o++,1023=t.__kMaxLengthBits)throw new RangeError("BigInt too big");if(e.length===1&&e.__digit(0)===2){let o=1+(0|r/30),a=e.sign&&(1&r)!=0,c=new t(o,a);c.__initializeDigits();let u=1<>=1;r!==0;r>>=1)i=t.multiply(i,i),(1&r)!=0&&(s===null?s=i:s=t.multiply(s,i));return s}static multiply(e,n){if(e.length===0)return e;if(n.length===0)return n;let r=e.length+n.length;30<=e.__clzmsd()+n.__clzmsd()&&r--;let s=new t(r,e.sign!==n.sign);s.__initializeDigits();for(let i=0;it.__absoluteCompare(e,n))return t.__zero();let r=e.sign!==n.sign,s=n.__unsignedDigit(0),i;if(n.length===1&&32767>=s){if(s===1)return r===e.sign?e:t.unaryMinus(e);i=t.__absoluteDivSmall(e,s,null)}else i=t.__absoluteDivLarge(e,n,!0,!1);return i.sign=r,i.__trim()}static remainder(e,n){if(n.length===0)throw new RangeError("Division by zero");if(0>t.__absoluteCompare(e,n))return e;let r=n.__unsignedDigit(0);if(n.length===1&&32767>=r){if(r===1)return t.__zero();let i=t.__absoluteModSmall(e,r);return i===0?t.__zero():t.__oneDigit(i,e.sign)}let s=t.__absoluteDivLarge(e,n,!1,!0);return s.sign=e.sign,s.__trim()}static add(e,n){let r=e.sign;return r===n.sign?t.__absoluteAdd(e,n,r):0<=t.__absoluteCompare(e,n)?t.__absoluteSub(e,n,r):t.__absoluteSub(n,e,!r)}static subtract(e,n){let r=e.sign;return r===n.sign?0<=t.__absoluteCompare(e,n)?t.__absoluteSub(e,n,r):t.__absoluteSub(n,e,!r):t.__absoluteAdd(e,n,r)}static leftShift(e,n){return n.length===0||e.length===0?e:n.sign?t.__rightShiftByAbsolute(e,n):t.__leftShiftByAbsolute(e,n)}static signedRightShift(e,n){return n.length===0||e.length===0?e:n.sign?t.__leftShiftByAbsolute(e,n):t.__rightShiftByAbsolute(e,n)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(e,n){return 0>t.__compareToBigInt(e,n)}static lessThanOrEqual(e,n){return 0>=t.__compareToBigInt(e,n)}static greaterThan(e,n){return 0e)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(e===0)return t.__zero();if(e>=t.__kMaxLengthBits)return n;let s=0|(e+29)/30;if(n.lengthe)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(e===0)return t.__zero();if(n.sign){if(e>t.__kMaxLengthBits)throw new RangeError("BigInt too big");return t.__truncateAndSubFromPowerOfTwo(e,n,!1)}if(e>=t.__kMaxLengthBits)return n;let s=0|(e+29)/30;if(n.length>>i))?n:t.__truncateToNBits(e,n)}static ADD(e,n){if(e=t.__toPrimitive(e),n=t.__toPrimitive(n),typeof e=="string")return typeof n!="string"&&(n=n.toString()),e+n;if(typeof n=="string")return e.toString()+n;if(e=t.__toNumeric(e),n=t.__toNumeric(n),t.__isBigInt(e)&&t.__isBigInt(n))return t.add(e,n);if(typeof e=="number"&&typeof n=="number")return e+n;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(e,n){return t.__compare(e,n,0)}static LE(e,n){return t.__compare(e,n,1)}static GT(e,n){return t.__compare(e,n,2)}static GE(e,n){return t.__compare(e,n,3)}static EQ(e,n){for(;;){if(t.__isBigInt(e))return t.__isBigInt(n)?t.equal(e,n):t.EQ(n,e);if(typeof e=="number"){if(t.__isBigInt(n))return t.__equalToNumber(n,e);if(typeof n!="object")return e==n;n=t.__toPrimitive(n)}else if(typeof e=="string"){if(t.__isBigInt(n))return e=t.__fromString(e),e!==null&&t.equal(e,n);if(typeof n!="object")return e==n;n=t.__toPrimitive(n)}else if(typeof e=="boolean"){if(t.__isBigInt(n))return t.__equalToNumber(n,+e);if(typeof n!="object")return e==n;n=t.__toPrimitive(n)}else if(typeof e=="symbol"){if(t.__isBigInt(n))return!1;if(typeof n!="object")return e==n;n=t.__toPrimitive(n)}else if(typeof e=="object"){if(typeof n=="object"&&n.constructor!==t)return e==n;e=t.__toPrimitive(e)}else return e==n}}static NE(e,n){return!t.EQ(e,n)}static DataViewGetBigInt64(e,n,r=!1){return t.asIntN(64,t.DataViewGetBigUint64(e,n,r))}static DataViewGetBigUint64(e,n,r=!1){let[s,i]=r?[4,0]:[0,4],o=e.getUint32(n+s,r),a=e.getUint32(n+i,r),c=new t(3,!1);return c.__setDigit(0,1073741823&a),c.__setDigit(1,(268435455&o)<<2|a>>>30),c.__setDigit(2,o>>>28),c.__trim()}static DataViewSetBigInt64(e,n,r,s=!1){t.DataViewSetBigUint64(e,n,r,s)}static DataViewSetBigUint64(e,n,r,s=!1){r=t.asUintN(64,r);let i=0,o=0;if(0>>2,2n)i=-n-1;else{if(r===0)return-1;r--,s=e.__digit(r),i=29}let o=1<>>20,r=n-1023,s=(0|r/30)+1,i=new t(s,0>e),o=1048575&t.__kBitConversionInts[t.__kBitConversionIntHigh]|1048576,a=t.__kBitConversionInts[t.__kBitConversionIntLow],c=20,u=r%30,l,d=0;if(u<20){let h=c-u;d=h+32,l=o>>>h,o=o<<32-h|a>>>h,a<<=32-h}else if(u===20)d=32,l=o,o=a,a=0;else{let h=u-c;d=32-h,l=o<>>32-h,o=a<>>2,o=o<<30|a>>>2,a<<=30):l=0,i.__setDigit(h,l);return i.__trim()}static __isWhitespace(e){return 13>=e&&9<=e||(159>=e?e==32:131071>=e?e==160||e==5760:196607>=e?(e&=131071,10>=e||e==40||e==41||e==47||e==95||e==4096):e==65279)}static __fromString(e,n=0){let r=0,s=e.length,i=0;if(i===s)return t.__zero();let o=e.charCodeAt(i);for(;t.__isWhitespace(o);){if(++i===s)return t.__zero();o=e.charCodeAt(i)}if(o===43){if(++i===s)return null;o=e.charCodeAt(i),r=1}else if(o===45){if(++i===s)return null;o=e.charCodeAt(i),r=-1}if(n===0){if(n=10,o===48){if(++i===s)return t.__zero();if(o=e.charCodeAt(i),o===88||o===120){if(n=16,++i===s)return null;o=e.charCodeAt(i)}else if(o===79||o===111){if(n=8,++i===s)return null;o=e.charCodeAt(i)}else if(o===66||o===98){if(n=2,++i===s)return null;o=e.charCodeAt(i)}}}else if(n===16&&o===48){if(++i===s)return t.__zero();if(o=e.charCodeAt(i),o===88||o===120){if(++i===s)return null;o=e.charCodeAt(i)}}if(r!=0&&n!==10)return null;for(;o===48;){if(++i===s)return t.__zero();o=e.charCodeAt(i)}let a=s-i,c=t.__kMaxBitsPerChar[n],u=t.__kBitsPerCharTableMultiplier-1;if(a>1073741824/c)return null;let l=c*a+u>>>t.__kBitsPerCharTableShift,d=new t(0|(l+29)/30,!1),h=10>n?n:10,m=10>=t.__kBitsPerCharTableShift;let f=[],g=[],A=!1;do{let y=0,b=0;for(;;){let S;if(o-48>>>0>>0>>0>>0>>t.__kBitsPerCharTableShift)/30;d.__inplaceMultiplyAdd(y,A,b)}while(!f)}if(i!==s){if(!t.__isWhitespace(o))return null;for(i++;i>>u-o)}if(i!==0){if(s>=e.length)throw new Error("implementation bug");e.__setDigit(s++,i)}for(;s>>1)+(85&s),s=(51&s>>>2)+(51&s),s=(15&s>>>4)+(15&s);let i=s,o=n-1,a=e.__digit(r-1),c=t.__clz30(a),u=0|(30*r-c+i-1)/i;if(e.sign&&u++,268435456>>b,m=30-b;m>=i;)l[d--]=t.__kConversionChars[h&o],h>>>=i,m-=i}let f=(h|a<>>i-m;h!==0;)l[d--]=t.__kConversionChars[h&o],h>>>=i;if(e.sign&&(l[d--]="-"),d!=-1)throw new Error("implementation bug");return l.join("")}static __toStringGeneric(e,n,r){let s=e.length;if(s===0)return"";if(s===1){let g=e.__unsignedDigit(0).toString(n);return r===!1&&e.sign&&(g="-"+g),g}let i=30*s-t.__clz30(e.__digit(s-1)),o=t.__kMaxBitsPerChar[n],a=o-1,c=i*t.__kBitsPerCharTableMultiplier;c+=a-1,c=0|c/a;let u=c+1>>1,l=t.exponentiate(t.__oneDigit(n,!1),t.__oneDigit(u,!1)),d,h,m=l.__unsignedDigit(0);if(l.length===1&&32767>=m){d=new t(e.length,!1),d.__initializeDigits();let g=0;for(let A=2*e.length-1;0<=A;A--){let y=g<<15|e.__halfDigit(A);d.__setHalfDigit(A,0|y/m),g=0|y%m}h=g.toString(n)}else{let g=t.__absoluteDivLarge(e,l,!0,!0);d=g.quotient;let A=g.remainder.__trim();h=t.__toStringGeneric(A,n,!0)}d.__trim();let f=t.__toStringGeneric(d,n,!0);for(;h.lengths?t.__absoluteLess(r):0}static __compareToNumber(e,n){if(t.__isOneDigitInt(n)){let r=e.sign,s=0>n;if(r!==s)return t.__unequalSign(r);if(e.length===0){if(s)throw new Error("implementation bug");return n===0?0:-1}if(1i?t.__absoluteGreater(r):on)return t.__unequalSign(r);if(n===0)throw new Error("implementation bug: should be handled elsewhere");if(e.length===0)return-1;t.__kBitConversionDouble[0]=n;let s=2047&t.__kBitConversionInts[t.__kBitConversionIntHigh]>>>20;if(s==2047)throw new Error("implementation bug: handled elsewhere");let i=s-1023;if(0>i)return t.__absoluteGreater(r);let o=e.length,a=e.__digit(o-1),c=t.__clz30(a),u=30*o-c,l=i+1;if(ul)return t.__absoluteGreater(r);let d=1048576|1048575&t.__kBitConversionInts[t.__kBitConversionIntHigh],h=t.__kBitConversionInts[t.__kBitConversionIntLow],m=20,f=29-c;if(f!==(0|(u-1)%30))throw new Error("implementation bug");let g,A=0;if(20>f){let y=m-f;A=y+32,g=d>>>y,d=d<<32-y|h>>>y,h<<=32-y}else if(f===20)A=32,g=d,d=h,h=0;else{let y=f-m;A=32-y,g=d<>>32-y,d=h<>>=0,g>>>=0,a>g)return t.__absoluteGreater(r);if(a>>2,d=d<<30|h>>>2,h<<=30):g=0;let b=e.__unsignedDigit(y);if(b>g)return t.__absoluteGreater(r);if(bn&&e.__unsignedDigit(0)===r(n):t.__compareToDouble(e,n)===0}static __comparisonResultToBool(e,n){return n===0?0>e:n===1?0>=e:n===2?0n;case 3:return e>=n}if(t.__isBigInt(e)&&typeof n=="string")return n=t.__fromString(n),n!==null&&t.__comparisonResultToBool(t.__compareToBigInt(e,n),r);if(typeof e=="string"&&t.__isBigInt(n))return e=t.__fromString(e),e!==null&&t.__comparisonResultToBool(t.__compareToBigInt(e,n),r);if(e=t.__toNumeric(e),n=t.__toNumeric(n),t.__isBigInt(e)){if(t.__isBigInt(n))return t.__comparisonResultToBool(t.__compareToBigInt(e,n),r);if(typeof n!="number")throw new Error("implementation bug");return t.__comparisonResultToBool(t.__compareToNumber(e,n),r)}if(typeof e!="number")throw new Error("implementation bug");if(t.__isBigInt(n))return t.__comparisonResultToBool(t.__compareToNumber(n,e),2^r);if(typeof n!="number")throw new Error("implementation bug");return r===0?en:r===3?e>=n:void 0}__clzmsd(){return t.__clz30(this.__digit(this.length-1))}static __absoluteAdd(e,n,r){if(e.length>>30,i.__setDigit(a,1073741823&c)}for(;a>>30,i.__setDigit(a,1073741823&c)}return a>>30,s.__setDigit(o,1073741823&a)}for(;o>>30,s.__setDigit(o,1073741823&a)}return s.__trim()}static __absoluteAddOne(e,n,r=null){let s=e.length;r===null?r=new t(s,n):r.sign=n;let i=1;for(let o=0;o>>30,r.__setDigit(o,1073741823&a)}return i!=0&&r.__setDigitGrow(s,1),r}static __absoluteSubOne(e,n){let r=e.length;n=n||r;let s=new t(n,!1),i=1;for(let o=0;o>>30,s.__setDigit(o,1073741823&a)}if(i!=0)throw new Error("implementation bug");for(let o=r;os?0:e.__unsignedDigit(s)>n.__unsignedDigit(s)?1:-1}static __multiplyAccumulate(e,n,r,s){if(n===0)return;let i=32767&n,o=n>>>15,a=0,c=0;for(let u,l=0;l>>15,f=t.__imul(h,i),g=t.__imul(h,o),A=t.__imul(m,i),y=t.__imul(m,o);u+=c+f+a,a=u>>>30,u&=1073741823,u+=((32767&g)<<15)+((32767&A)<<15),a+=u>>>30,c=y+(g>>>15)+(A>>>15),r.__setDigit(s,1073741823&u)}for(;a!=0||c!==0;s++){let u=r.__digit(s);u+=a+c,c=0,a=u>>>30,r.__setDigit(s,1073741823&u)}}static __internalMultiplyAdd(e,n,r,s,i){let o=r,a=0;for(let c=0;c>>15,n),h=l+((32767&d)<<15)+a+o;o=h>>>30,a=d>>>15,i.__setDigit(c,1073741823&h)}if(i.length>s)for(i.__setDigit(s++,o+a);sthis.length&&(r=this.length);let s=32767&e,i=e>>>15,o=0,a=n;for(let c=0;c>>15,h=t.__imul(l,s),m=t.__imul(l,i),f=t.__imul(d,s),g=t.__imul(d,i),A=a+h+o;o=A>>>30,A&=1073741823,A+=((32767&m)<<15)+((32767&f)<<15),o+=A>>>30,a=g+(m>>>15)+(f>>>15),this.__setDigit(c,1073741823&A)}if(o!=0||a!==0)throw new Error("implementation bug")}static __absoluteDivSmall(e,n,r=null){r===null&&(r=new t(e.length,!1));let s=0;for(let i,o=2*e.length-1;0<=o;o-=2){i=(s<<15|e.__halfDigit(o))>>>0;let a=0|i/n;s=0|i%n,i=(s<<15|e.__halfDigit(o-1))>>>0;let c=0|i/n;s=0|i%n,r.__setDigit(o>>>1,a<<15|c)}return r}static __absoluteModSmall(e,n){let r=0;for(let s=2*e.length-1;0<=s;s--)r=0|((r<<15|e.__halfDigit(s))>>>0)%n;return r}static __absoluteDivLarge(e,n,r,s){let i=n.__halfDigitLength(),o=n.length,a=e.__halfDigitLength()-i,c=null;r&&(c=new t(a+2>>>1,!1),c.__initializeDigits());let u=new t(i+2>>>1,!1);u.__initializeDigits();let l=t.__clz15(n.__halfDigit(i-1));0>>0;f=0|b/h;let S=0|b%h,C=n.__halfDigit(i-2),I=d.__halfDigit(g+i-2);for(;t.__imul(f,C)>>>0>(S<<16|I)>>>0&&(f--,S+=h,!(32767>>1,m|f))}if(s)return d.__inplaceRightShift(l),r?{quotient:c,remainder:d}:d;if(r)return c;throw new Error("unreachable")}static __clz15(e){return t.__clz30(e)-15}__inplaceAdd(e,n,r){let s=0;for(let i=0;i>>15,this.__setHalfDigit(n+i,32767&o)}return s}__inplaceSub(e,n,r){let s=0;if(1&n){n>>=1;let i=this.__digit(n),o=32767&i,a=0;for(;a>>1;a++){let l=e.__digit(a),d=(i>>>15)-(32767&l)-s;s=1&d>>>15,this.__setDigit(n+a,(32767&d)<<15|32767&o),i=this.__digit(n+a+1),o=(32767&i)-(l>>>15)-s,s=1&o>>>15}let c=e.__digit(a),u=(i>>>15)-(32767&c)-s;if(s=1&u>>>15,this.__setDigit(n+a,(32767&u)<<15|32767&o),n+a+1>=this.length)throw new RangeError("out of bounds");(1&r)==0&&(i=this.__digit(n+a+1),o=(32767&i)-(c>>>15)-s,s=1&o>>>15,this.__setDigit(n+e.length,1073709056&i|32767&o))}else{n>>=1;let i=0;for(;i>>15;let m=(l>>>15)-(d>>>15)-s;s=1&m>>>15,this.__setDigit(n+i,(32767&m)<<15|32767&h)}let o=this.__digit(n+i),a=e.__digit(i),c=(32767&o)-(32767&a)-s;s=1&c>>>15;let u=0;(1&r)==0&&(u=(o>>>15)-(a>>>15)-s,s=1&u>>>15),this.__setDigit(n+i,(32767&u)<<15|32767&c)}return s}__inplaceRightShift(e){if(e===0)return;let n=this.__digit(0)>>>e,r=this.length-1;for(let s=0;s>>e}this.__setDigit(r,n)}static __specialLeftShift(e,n,r){let s=e.length,i=new t(s+r,!1);if(n===0){for(let a=0;a>>30-n}return 0r)throw new RangeError("BigInt too big");let s=0|r/30,i=r%30,o=e.length,a=i!==0&&e.__digit(o-1)>>>30-i!=0,c=o+s+(a?1:0),u=new t(c,e.sign);if(i===0){let l=0;for(;l>>30-i}if(a)u.__setDigit(o+s,l);else if(l!==0)throw new Error("implementation bug")}return u.__trim()}static __rightShiftByAbsolute(e,n){let r=e.length,s=e.sign,i=t.__toShiftAmount(n);if(0>i)return t.__rightShiftByMaximum(s);let o=0|i/30,a=i%30,c=r-o;if(0>=c)return t.__rightShiftByMaximum(s);let u=!1;if(s){if((e.__digit(o)&(1<>>a,h=r-o-1;for(let m=0;m>>a}l.__setDigit(h,d)}return u&&(l=t.__absoluteAddOne(l,!0,l)),l.__trim()}static __rightShiftByMaximum(e){return e?t.__oneDigit(1,!0):t.__zero()}static __toShiftAmount(e){if(1t.__kMaxLengthBits?-1:n}static __toPrimitive(e,n="default"){if(typeof e!="object"||e.constructor===t)return e;if(typeof Symbol<"u"&&typeof Symbol.toPrimitive=="symbol"&&e[Symbol.toPrimitive]){let i=e[Symbol.toPrimitive](n);if(typeof i!="object")return i;throw new TypeError("Cannot convert object to primitive value")}let r=e.valueOf;if(r){let i=r.call(e);if(typeof i!="object")return i}let s=e.toString;if(s){let i=s.call(e);if(typeof i!="object")return i}throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(e){return t.__isBigInt(e)?e:+e}static __isBigInt(e){return typeof e=="object"&&e!==null&&e.constructor===t}static __truncateToNBits(e,n){let r=0|(e+29)/30,s=new t(r,n.sign),i=r-1;for(let a=0;a>>a}return s.__setDigit(i,o),s.__trim()}static __truncateAndSubFromPowerOfTwo(e,n,r){var s=Math.min;let i=0|(e+29)/30,o=new t(i,r),a=0,c=i-1,u=0;for(let m=s(c,n.length);a>>30,o.__setDigit(a,1073741823&f)}for(;a>>m;let f=1<<32-m;h=f-l-u,h&=f-1}return o.__setDigit(c,h),o.__trim()}__digit(e){return this[e]}__unsignedDigit(e){return this[e]>>>0}__setDigit(e,n){this[e]=0|n}__setDigitGrow(e,n){this[e]=0|n}__halfDigitLength(){let e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}__halfDigit(e){return 32767&this[e>>>1]>>>15*(1&e)}__setHalfDigit(e,n){let r=e>>>1,s=this.__digit(r),i=1&e?32767&s|n<<15:1073709056&s|32767&n;this.__setDigit(r,i)}static __digitPow(e,n){let r=1;for(;0>>=1,e*=e;return r}static __detectBigEndian(){return t.__kBitConversionDouble[0]=-0,t.__kBitConversionInts[0]!==0}static __isOneDigitInt(e){return(1073741823&e)===e}};$l.__kMaxLength=33554432,$l.__kMaxLengthBits=$l.__kMaxLength<<5,$l.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],$l.__kBitsPerCharTableShift=5,$l.__kBitsPerCharTableMultiplier=1<<$l.__kBitsPerCharTableShift,$l.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],$l.__kBitConversionBuffer=new ArrayBuffer(8),$l.__kBitConversionDouble=new Float64Array($l.__kBitConversionBuffer),$l.__kBitConversionInts=new Int32Array($l.__kBitConversionBuffer),$l.__kBitConversionIntHigh=$l.__detectBigEndian()?0:1,$l.__kBitConversionIntLow=$l.__detectBigEndian()?1:0,$l.__clz30=Math.clz32?function(t){return Math.clz32(t)-2}:function(t){return t===0?30:0|29-(0|Math.log(t>>>0)/Math.LN2)},$l.__imul=Math.imul||function(t,e){return 0|t*e},aen.exports=$l});var dnn=ee((XCa,unn)=>{p();unn.exports=lnn;lnn.sync=I7r;var ann=require("fs");function C7r(t,e){var n=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r{p();fnn.exports=hnn;hnn.sync=x7r;var pnn=require("fs");function hnn(t,e,n){pnn.stat(t,function(r,s){n(r,r?!1:mnn(s,e))})}function x7r(t,e){return mnn(pnn.statSync(t),e)}function mnn(t,e){return t.isFile()&&w7r(t,e)}function w7r(t,e){var n=t.mode,r=t.uid,s=t.gid,i=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,d=n&u||n&c&&s===o||n&a&&r===i||n&l&&i===0;return d}});var ynn=ee((rIa,Ann)=>{p();var nIa=require("fs"),abe;process.platform==="win32"||global.TESTING_WINDOWS?abe=dnn():abe=gnn();Ann.exports=b9e;b9e.sync=T7r;function b9e(t,e,n){if(typeof e=="function"&&(n=e,e={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,s){b9e(t,e||{},function(i,o){i?s(i):r(o)})})}abe(t,e||{},function(r,s){r&&(r.code==="EACCES"||e&&e.ignoreErrors)&&(r=null,s=!1),n(r,s)})}function T7r(t,e){try{return abe.sync(t,e||{})}catch(n){if(e&&e.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var xnn=ee((iIa,Inn)=>{p();var $3=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Enn=require("path"),v7r=$3?";":":",bnn=ynn(),_nn=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Snn=(t,e)=>{let n=e.colon||v7r,r=t.match(/\//)||$3&&t.match(/\\/)?[""]:[...$3?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],s=$3?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=$3?s.split(n):[""];return $3&&t.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:s}},Cnn=(t,e,n)=>{typeof e=="function"&&(n=e,e={}),e||(e={});let{pathEnv:r,pathExt:s,pathExtExe:i}=Snn(t,e),o=[],a=u=>new Promise((l,d)=>{if(u===r.length)return e.all&&o.length?l(o):d(_nn(t));let h=r[u],m=/^".*"$/.test(h)?h.slice(1,-1):h,f=Enn.join(m,t),g=!m&&/^\.[\\\/]/.test(t)?t.slice(0,2)+f:f;l(c(g,u,0))}),c=(u,l,d)=>new Promise((h,m)=>{if(d===s.length)return h(a(l+1));let f=s[d];bnn(u+f,{pathExt:i},(g,A)=>{if(!g&&A)if(e.all)o.push(u+f);else return h(u+f);return h(c(u,l,d+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},R7r=(t,e)=>{e=e||{};let{pathEnv:n,pathExt:r,pathExtExe:s}=Snn(t,e),i=[];for(let o=0;o{"use strict";p();var wnn=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};_9e.exports=wnn;_9e.exports.default=wnn});var Nnn=ee((lIa,knn)=>{"use strict";p();var vnn=require("path"),k7r=xnn(),N7r=Tnn();function Rnn(t,e){let n=t.options.env||process.env,r=process.cwd(),s=t.options.cwd!=null,i=s&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(t.options.cwd)}catch{}let o;try{o=k7r.sync(t.command,{path:n[N7r({env:n})],pathExt:e?vnn.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return o&&(o=vnn.resolve(s?t.options.cwd:"",o)),o}function D7r(t){return Rnn(t)||Rnn(t,!0)}knn.exports=D7r});var Dnn=ee((dIa,C9e)=>{"use strict";p();var S9e=/([()\][%!^"`<>&|;, *?])/g;function B7r(t){return t=t.replace(S9e,"^$1"),t}function P7r(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(S9e,"^$1"),e&&(t=t.replace(S9e,"^$1")),t}C9e.exports.command=B7r;C9e.exports.argument=P7r});var Pnn=ee((hIa,Bnn)=>{"use strict";p();Bnn.exports=/^#!(.*)/});var Mnn=ee((fIa,Onn)=>{"use strict";p();var O7r=Pnn();Onn.exports=(t="")=>{let e=t.match(O7r);if(!e)return null;let[n,r]=e[0].replace(/#! ?/,"").split(" "),s=n.split("/").pop();return s==="env"?r:r?`${s} ${r}`:s}});var Fnn=ee((AIa,Lnn)=>{"use strict";p();var I9e=require("fs"),M7r=Mnn();function L7r(t){let n=Buffer.alloc(150),r;try{r=I9e.openSync(t,"r"),I9e.readSync(r,n,0,150,0),I9e.closeSync(r)}catch{}return M7r(n.toString())}Lnn.exports=L7r});var Gnn=ee((EIa,$nn)=>{"use strict";p();var F7r=require("path"),Qnn=Nnn(),Unn=Dnn(),Q7r=Fnn(),U7r=process.platform==="win32",$7r=/\.(?:com|exe)$/i,G7r=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function W7r(t){t.file=Qnn(t);let e=t.file&&Q7r(t.file);return e?(t.args.unshift(t.file),t.command=e,Qnn(t)):t.file}function q7r(t){if(!U7r)return t;let e=W7r(t),n=!$7r.test(e);if(t.options.forceShell||n){let r=G7r.test(e);t.command=F7r.normalize(t.command),t.command=Unn.command(t.command),t.args=t.args.map(i=>Unn.argument(i,r));let s=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${s}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function H7r(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null),e=e?e.slice(0):[],n=Object.assign({},n);let r={command:t,args:e,options:n,file:void 0,original:{command:t,args:e}};return n.shell?r:q7r(r)}$nn.exports=H7r});var Hnn=ee((_Ia,qnn)=>{"use strict";p();var x9e=process.platform==="win32";function w9e(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function V7r(t,e){if(!x9e)return;let n=t.emit;t.emit=function(r,s){if(r==="exit"){let i=Wnn(s,e);if(i)return n.call(t,"error",i)}return n.apply(t,arguments)}}function Wnn(t,e){return x9e&&t===1&&!e.file?w9e(e.original,"spawn"):null}function j7r(t,e){return x9e&&t===1&&!e.file?w9e(e.original,"spawnSync"):null}qnn.exports={hookChildProcess:V7r,verifyENOENT:Wnn,verifyENOENTSync:j7r,notFoundError:w9e}});var Ynn=ee((CIa,G3)=>{"use strict";p();var Vnn=require("child_process"),T9e=Gnn(),v9e=Hnn();function jnn(t,e,n){let r=T9e(t,e,n),s=Vnn.spawn(r.command,r.args,r.options);return v9e.hookChildProcess(s,r),s}function Y7r(t,e,n){let r=T9e(t,e,n),s=Vnn.spawnSync(r.command,r.args,r.options);return s.error=s.error||v9e.verifyENOENTSync(s.status,r),s}G3.exports=jnn;G3.exports.spawn=jnn;G3.exports.sync=Y7r;G3.exports._parse=T9e;G3.exports._enoent=v9e});var FKe=ee((jva,Qin)=>{p();function OKe(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(e){var n=t[e];typeof n=="object"&&!Object.isFrozen(n)&&OKe(n)}),t}var Din=OKe,mes=OKe;Din.default=mes;var r_e=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function IH(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function MN(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let s in r)n[s]=r[s]}),n}var fes="",win=t=>!!t.kind,NKe=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=IH(e)}openNode(e){if(!win(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){win(e)&&(this.buffer+=fes)}value(){return this.buffer}span(e){this.buffer+=``}},DKe=class t{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},BKe=class extends DKe{constructor(e){super(),this.options=e}addKeyword(e,n){e!==""&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,n){let r=e.root;r.kind=n,r.sublanguage=!0,this.add(r)}toHTML(){return new NKe(this,this.options).value()}finalize(){return!0}};function ges(t){return new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function vX(t){return t?typeof t=="string"?t:t.source:null}function Aes(...t){return t.map(n=>vX(n)).join("")}function yes(...t){return"("+t.map(n=>vX(n)).join("|")+")"}function Ees(t){return new RegExp(t.toString()+"|").exec("").length-1}function bes(t,e){let n=t&&t.exec(e);return n&&n.index===0}var _es=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ses(t,e="|"){let n=0;return t.map(r=>{n+=1;let s=n,i=vX(r),o="";for(;i.length>0;){let a=_es.exec(i);if(!a){o+=i;break}o+=i.substring(0,a.index),i=i.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+s):(o+=a[0],a[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(e)}var Ces=/\b\B/,Bin="[a-zA-Z]\\w*",MKe="[a-zA-Z_]\\w*",LKe="\\b\\d+(\\.\\d+)?",Pin="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Oin="\\b(0b[01]+)",Ies="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",xes=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=Aes(e,/.*\b/,t.binary,/\b.*/)),MN({className:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},RX={begin:"\\\\[\\s\\S]",relevance:0},wes={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[RX]},Tes={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[RX]},Min={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},s_e=function(t,e,n={}){let r=MN({className:"comment",begin:t,end:e,contains:[]},n);return r.contains.push(Min),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},ves=s_e("//","$"),Res=s_e("/\\*","\\*/"),kes=s_e("#","$"),Nes={className:"number",begin:LKe,relevance:0},Des={className:"number",begin:Pin,relevance:0},Bes={className:"number",begin:Oin,relevance:0},Pes={className:"number",begin:LKe+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},Oes={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[RX,{begin:/\[/,end:/\]/,relevance:0,contains:[RX]}]}]},Mes={className:"title",begin:Bin,relevance:0},Les={className:"title",begin:MKe,relevance:0},Fes={begin:"\\.\\s*"+MKe,relevance:0},Qes=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},n_e=Object.freeze({__proto__:null,MATCH_NOTHING_RE:Ces,IDENT_RE:Bin,UNDERSCORE_IDENT_RE:MKe,NUMBER_RE:LKe,C_NUMBER_RE:Pin,BINARY_NUMBER_RE:Oin,RE_STARTERS_RE:Ies,SHEBANG:xes,BACKSLASH_ESCAPE:RX,APOS_STRING_MODE:wes,QUOTE_STRING_MODE:Tes,PHRASAL_WORDS_MODE:Min,COMMENT:s_e,C_LINE_COMMENT_MODE:ves,C_BLOCK_COMMENT_MODE:Res,HASH_COMMENT_MODE:kes,NUMBER_MODE:Nes,C_NUMBER_MODE:Des,BINARY_NUMBER_MODE:Bes,CSS_NUMBER_MODE:Pes,REGEXP_MODE:Oes,TITLE_MODE:Mes,UNDERSCORE_TITLE_MODE:Les,METHOD_GUARD:Fes,END_SAME_AS_BEGIN:Qes});function Ues(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function $es(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Ues,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Ges(t,e){Array.isArray(t.illegal)&&(t.illegal=yes(...t.illegal))}function Wes(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function qes(t,e){t.relevance===void 0&&(t.relevance=1)}var Hes=["of","and","for","in","not","or","if","then","parent","list","value"],Ves="keyword";function Lin(t,e,n=Ves){let r={};return typeof t=="string"?s(n,t.split(" ")):Array.isArray(t)?s(n,t):Object.keys(t).forEach(function(i){Object.assign(r,Lin(t[i],e,i))}),r;function s(i,o){e&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){let c=a.split("|");r[c[0]]=[i,jes(c[0],c[1])]})}}function jes(t,e){return e?Number(e):Yes(t)?0:1}function Yes(t){return Hes.includes(t.toLowerCase())}function Kes(t,{plugins:e}){function n(a,c){return new RegExp(vX(a),"m"+(t.case_insensitive?"i":"")+(c?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,c]),this.matchAt+=Ees(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let c=this.regexes.map(u=>u[1]);this.matcherRe=n(Ses(c),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(c);if(!u)return null;let l=u.findIndex((h,m)=>m>0&&h!==void 0),d=this.matchIndexes[l];return u.splice(0,l),Object.assign(u,d)}}class s{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];let u=new r;return this.rules.slice(c).forEach(([l,d])=>u.addRule(l,d)),u.compile(),this.multiRegexes[c]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,u){this.rules.push([c,u]),u.type==="begin"&&this.count++}exec(c){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let l=u.exec(c);if(this.resumingScanAtSamePosition()&&!(l&&l.index===this.lastIndex)){let d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,l=d.exec(c)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function i(a){let c=new s;return a.contains.forEach(u=>c.addRule(u.begin,{rule:u,type:"begin"})),a.terminatorEnd&&c.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&c.addRule(a.illegal,{type:"illegal"}),c}function o(a,c){let u=a;if(a.isCompiled)return u;[Wes].forEach(d=>d(a,c)),t.compilerExtensions.forEach(d=>d(a,c)),a.__beforeBegin=null,[$es,Ges,qes].forEach(d=>d(a,c)),a.isCompiled=!0;let l=null;if(typeof a.keywords=="object"&&(l=a.keywords.$pattern,delete a.keywords.$pattern),a.keywords&&(a.keywords=Lin(a.keywords,t.case_insensitive)),a.lexemes&&l)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return l=l||a.lexemes||/\w+/,u.keywordPatternRe=n(l,!0),c&&(a.begin||(a.begin=/\B|\b/),u.beginRe=n(a.begin),a.endSameAsBegin&&(a.end=a.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(u.endRe=n(a.end)),u.terminatorEnd=vX(a.end)||"",a.endsWithParent&&c.terminatorEnd&&(u.terminatorEnd+=(a.end?"|":"")+c.terminatorEnd)),a.illegal&&(u.illegalRe=n(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return zes(d==="self"?a:d)})),a.contains.forEach(function(d){o(d,u)}),a.starts&&o(a.starts,c),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=MN(t.classNameAliases||{}),o(t)}function Fin(t){return t?t.endsWithParent||Fin(t.starts):!1}function zes(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return MN(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Fin(t)?MN(t,{starts:t.starts?MN(t.starts):null}):Object.isFrozen(t)?MN(t):t}var Jes="10.7.3";function Xes(t){return!!(t||t==="")}function Zes(t){let e={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!t.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,IH(this.code);let r={};return this.autoDetect?(r=t.highlightAuto(this.code),this.detectedLanguage=r.language):(r=t.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),r.value},autoDetect(){return!this.language||Xes(this.autodetect)},ignoreIllegals(){return!0}},render(r){return r("pre",{},[r("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:e,VuePlugin:{install(r){r.component("highlightjs",e)}}}}var ets={"after:highlightElement":({el:t,result:e,text:n})=>{let r=Tin(t);if(!r.length)return;let s=document.createElement("div");s.innerHTML=e.value,e.value=tts(r,Tin(s),n)}};function PKe(t){return t.nodeName.toLowerCase()}function Tin(t){let e=[];return(function n(r,s){for(let i=r.firstChild;i;i=i.nextSibling)i.nodeType===3?s+=i.nodeValue.length:i.nodeType===1&&(e.push({event:"start",offset:s,node:i}),s=n(i,s),PKe(i).match(/br|hr|img|input/)||e.push({event:"stop",offset:s,node:i}));return s})(t,0),e}function tts(t,e,n){let r=0,s="",i=[];function o(){return!t.length||!e.length?t.length?t:e:t[0].offset!==e[0].offset?t[0].offset"}function c(l){s+=""}function u(l){(l.event==="start"?a:c)(l.node)}for(;t.length||e.length;){let l=o();if(s+=IH(n.substring(r,l[0].offset)),r=l[0].offset,l===t){i.reverse().forEach(c);do u(l.splice(0,1)[0]),l=o();while(l===t&&l.length&&l[0].offset===r);i.reverse().forEach(a)}else l[0].event==="start"?i.push(l[0].node):i.pop(),u(l.splice(0,1)[0])}return s+IH(n.substr(r))}var vin={},RKe=t=>{console.error(t)},Rin=(t,...e)=>{console.log(`WARN: ${t}`,...e)},VE=(t,e)=>{vin[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),vin[`${t}/${e}`]=!0)},kKe=IH,kin=MN,Nin=Symbol("nomatch"),nts=function(t){let e=Object.create(null),n=Object.create(null),r=[],s=!0,i=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]},c={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:BKe};function u(Re){return c.noHighlightRe.test(Re)}function l(Re){let se=Re.className+" ";se+=Re.parentNode?Re.parentNode.className:"";let ie=c.languageDetectRe.exec(se);if(ie){let ne=oe(ie[1]);return ne||(Rin(o.replace("{}",ie[1])),Rin("Falling back to no-highlight mode for this block.",Re)),ne?ie[1]:"no-highlight"}return se.split(/\s+/).find(ne=>u(ne)||oe(ne))}function d(Re,se,ie,ne){let J="",te="";typeof se=="object"?(J=Re,ie=se.ignoreIllegals,te=se.language,ne=void 0):(VE("10.7.0","highlight(lang, code, ...args) has been deprecated."),VE("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),te=Re,J=se);let j={code:J,language:te};be("before:highlight",j);let X=j.result?j.result:h(j.language,j.code,ie,ne);return X.code=j.code,be("after:highlight",X),X}function h(Re,se,ie,ne){function J(Lt,Pt){let Ze=_e.case_insensitive?Pt[0].toLowerCase():Pt[0];return Object.prototype.hasOwnProperty.call(Lt.keywords,Ze)&&Lt.keywords[Ze]}function te(){if(!He.keywords){it.addText(ze);return}let Lt=0;He.keywordPatternRe.lastIndex=0;let Pt=He.keywordPatternRe.exec(ze),Ze="";for(;Pt;){Ze+=ze.substring(Lt,Pt.index);let Pe=J(He,Pt);if(Pe){let[Xe,At]=Pe;if(it.addText(Ze),Ze="",rt+=At,Xe.startsWith("_"))Ze+=Pt[0];else{let Vt=_e.classNameAliases[Xe]||Xe;it.addKeyword(Pt[0],Vt)}}else Ze+=Pt[0];Lt=He.keywordPatternRe.lastIndex,Pt=He.keywordPatternRe.exec(ze)}Ze+=ze.substr(Lt),it.addText(Ze)}function j(){if(ze==="")return;let Lt=null;if(typeof He.subLanguage=="string"){if(!e[He.subLanguage]){it.addText(ze);return}Lt=h(He.subLanguage,ze,!0,dt[He.subLanguage]),dt[He.subLanguage]=Lt.top}else Lt=f(ze,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(rt+=Lt.relevance),it.addSublanguage(Lt.emitter,Lt.language)}function X(){He.subLanguage!=null?j():te(),ze=""}function ae(Lt){return Lt.className&&it.openNode(_e.classNameAliases[Lt.className]||Lt.className),He=Object.create(Lt,{parent:{value:He}}),He}function me(Lt,Pt,Ze){let Pe=bes(Lt.endRe,Ze);if(Pe){if(Lt["on:end"]){let Xe=new r_e(Lt);Lt["on:end"](Pt,Xe),Xe.isMatchIgnored&&(Pe=!1)}if(Pe){for(;Lt.endsParent&&Lt.parent;)Lt=Lt.parent;return Lt}}if(Lt.endsWithParent)return me(Lt.parent,Pt,Ze)}function Ae(Lt){return He.matcher.regexIndex===0?(ze+=Lt[0],1):(Mt=!0,0)}function ue(Lt){let Pt=Lt[0],Ze=Lt.rule,Pe=new r_e(Ze),Xe=[Ze.__beforeBegin,Ze["on:begin"]];for(let At of Xe)if(At&&(At(Lt,Pe),Pe.isMatchIgnored))return Ae(Pt);return Ze&&Ze.endSameAsBegin&&(Ze.endRe=ges(Pt)),Ze.skip?ze+=Pt:(Ze.excludeBegin&&(ze+=Pt),X(),!Ze.returnBegin&&!Ze.excludeBegin&&(ze=Pt)),ae(Ze),Ze.returnBegin?0:Pt.length}function ye(Lt){let Pt=Lt[0],Ze=se.substr(Lt.index),Pe=me(He,Lt,Ze);if(!Pe)return Nin;let Xe=He;Xe.skip?ze+=Pt:(Xe.returnEnd||Xe.excludeEnd||(ze+=Pt),X(),Xe.excludeEnd&&(ze=Pt));do He.className&&it.closeNode(),!He.skip&&!He.subLanguage&&(rt+=He.relevance),He=He.parent;while(He!==Pe.parent);return Pe.starts&&(Pe.endSameAsBegin&&(Pe.starts.endRe=Pe.endRe),ae(Pe.starts)),Xe.returnEnd?0:Pt.length}function Ie(){let Lt=[];for(let Pt=He;Pt!==_e;Pt=Pt.parent)Pt.className&&Lt.unshift(Pt.className);Lt.forEach(Pt=>it.openNode(Pt))}let Ee={};function Te(Lt,Pt){let Ze=Pt&&Pt[0];if(ze+=Lt,Ze==null)return X(),0;if(Ee.type==="begin"&&Pt.type==="end"&&Ee.index===Pt.index&&Ze===""){if(ze+=se.slice(Pt.index,Pt.index+1),!s){let Pe=new Error("0 width match regex");throw Pe.languageName=Re,Pe.badRule=Ee.rule,Pe}return 1}if(Ee=Pt,Pt.type==="begin")return ue(Pt);if(Pt.type==="illegal"&&!ie){let Pe=new Error('Illegal lexeme "'+Ze+'" for mode "'+(He.className||"")+'"');throw Pe.mode=He,Pe}else if(Pt.type==="end"){let Pe=ye(Pt);if(Pe!==Nin)return Pe}if(Pt.type==="illegal"&&Ze==="")return 1;if(sn>1e5&&sn>Pt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=Ze,Ze.length}let _e=oe(Re);if(!_e)throw RKe(o.replace("{}",Re)),new Error('Unknown language: "'+Re+'"');let z=Kes(_e,{plugins:r}),We="",He=ne||z,dt={},it=new c.__emitter(c);Ie();let ze="",rt=0,Ct=0,sn=0,Mt=!1;try{for(He.matcher.considerAll();;){sn++,Mt?Mt=!1:He.matcher.considerAll(),He.matcher.lastIndex=Ct;let Lt=He.matcher.exec(se);if(!Lt)break;let Pt=se.substring(Ct,Lt.index),Ze=Te(Pt,Lt);Ct=Lt.index+Ze}return Te(se.substr(Ct)),it.closeAllNodes(),it.finalize(),We=it.toHTML(),{relevance:Math.floor(rt),value:We,language:Re,illegal:!1,emitter:it,top:He}}catch(Lt){if(Lt.message&&Lt.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:Lt.message,context:se.slice(Ct-100,Ct+100),mode:Lt.mode},sofar:We,relevance:0,value:kKe(se),emitter:it};if(s)return{illegal:!1,relevance:0,value:kKe(se),emitter:it,language:Re,top:He,errorRaised:Lt};throw Lt}}function m(Re){let se={relevance:0,emitter:new c.__emitter(c),value:kKe(Re),illegal:!1,top:a};return se.emitter.addText(Re),se}function f(Re,se){se=se||c.languages||Object.keys(e);let ie=m(Re),ne=se.filter(oe).filter(Z).map(ae=>h(ae,Re,!1));ne.unshift(ie);let J=ne.sort((ae,me)=>{if(ae.relevance!==me.relevance)return me.relevance-ae.relevance;if(ae.language&&me.language){if(oe(ae.language).supersetOf===me.language)return 1;if(oe(me.language).supersetOf===ae.language)return-1}return 0}),[te,j]=J,X=te;return X.second_best=j,X}function g(Re){return c.tabReplace||c.useBR?Re.replace(i,se=>se===` -`?c.useBR?"
":se:c.tabReplace?se.replace(/\t/g,c.tabReplace):se):Re}function A(Re,se,ie){let ne=se?n[se]:ie;Re.classList.add("hljs"),ne&&Re.classList.add(ne)}let y={"before:highlightElement":({el:Re})=>{c.useBR&&(Re.innerHTML=Re.innerHTML.replace(/\n/g,"").replace(//g,` -`))},"after:highlightElement":({result:Re})=>{c.useBR&&(Re.value=Re.value.replace(/\n/g,"
"))}},b=/^(<[^>]+>|\t)+/gm,S={"after:highlightElement":({result:Re})=>{c.tabReplace&&(Re.value=Re.value.replace(b,se=>se.replace(/\t/g,c.tabReplace)))}};function C(Re){let se=null,ie=l(Re);if(u(ie))return;be("before:highlightElement",{el:Re,language:ie}),se=Re;let ne=se.textContent,J=ie?d(ne,{language:ie,ignoreIllegals:!0}):f(ne);be("after:highlightElement",{el:Re,result:J,text:ne}),Re.innerHTML=J.value,A(Re,ie,J.language),Re.result={language:J.language,re:J.relevance,relavance:J.relevance},J.second_best&&(Re.second_best={language:J.second_best.language,re:J.second_best.relevance,relavance:J.second_best.relevance})}function I(Re){Re.useBR&&(VE("10.3.0","'useBR' will be removed entirely in v11.0"),VE("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),c=kin(c,Re)}let x=()=>{if(x.called)return;x.called=!0,VE("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead."),document.querySelectorAll("pre code").forEach(C)};function w(){VE("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),R=!0}let R=!1;function N(){if(document.readyState==="loading"){R=!0;return}document.querySelectorAll("pre code").forEach(C)}function P(){R&&N()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",P,!1);function G(Re,se){let ie=null;try{ie=se(t)}catch(ne){if(RKe("Language definition for '{}' could not be registered.".replace("{}",Re)),s)RKe(ne);else throw ne;ie=a}ie.name||(ie.name=Re),e[Re]=ie,ie.rawDefinition=se.bind(null,t),ie.aliases&&re(ie.aliases,{languageName:Re})}function $(Re){delete e[Re];for(let se of Object.keys(n))n[se]===Re&&delete n[se]}function Q(){return Object.keys(e)}function H(Re){VE("10.4.0","requireLanguage will be removed entirely in v11."),VE("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");let se=oe(Re);if(se)return se;throw new Error("The '{}' language is required, but not loaded.".replace("{}",Re))}function oe(Re){return Re=(Re||"").toLowerCase(),e[Re]||e[n[Re]]}function re(Re,{languageName:se}){typeof Re=="string"&&(Re=[Re]),Re.forEach(ie=>{n[ie.toLowerCase()]=se})}function Z(Re){let se=oe(Re);return se&&!se.disableAutodetect}function q(Re){Re["before:highlightBlock"]&&!Re["before:highlightElement"]&&(Re["before:highlightElement"]=se=>{Re["before:highlightBlock"](Object.assign({block:se.el},se))}),Re["after:highlightBlock"]&&!Re["after:highlightElement"]&&(Re["after:highlightElement"]=se=>{Re["after:highlightBlock"](Object.assign({block:se.el},se))})}function ce(Re){q(Re),r.push(Re)}function be(Re,se){let ie=Re;r.forEach(function(ne){ne[ie]&&ne[ie](se)})}function Be(Re){return VE("10.2.0","fixMarkup will be removed entirely in v11.0"),VE("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),g(Re)}function Me(Re){return VE("10.7.0","highlightBlock will be removed entirely in v12.0"),VE("10.7.0","Please use highlightElement now."),C(Re)}Object.assign(t,{highlight:d,highlightAuto:f,highlightAll:N,fixMarkup:Be,highlightElement:C,highlightBlock:Me,configure:I,initHighlighting:x,initHighlightingOnLoad:w,registerLanguage:G,unregisterLanguage:$,listLanguages:Q,getLanguage:oe,registerAliases:re,requireLanguage:H,autoDetection:Z,inherit:kin,addPlugin:ce,vuePlugin:Zes(t).VuePlugin}),t.debugMode=function(){s=!1},t.safeMode=function(){s=!0},t.versionString=Jes;for(let Re in n_e)typeof n_e[Re]=="object"&&Din(n_e[Re]);return Object.assign(t,n_e),t.addPlugin(y),t.addPlugin(ets),t.addPlugin(S),t},rts=nts({});Qin.exports=rts});var QKe=ee((Kva,Uin)=>{p();function sts(t){return t?typeof t=="string"?t:t.source:null}function its(...t){return t.map(n=>sts(n)).join("")}function ots(t){let e={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[e]}]};Object.assign(e,{className:"variable",variants:[{begin:its(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},i={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e,r]};r.contains.push(i);let o={className:"",begin:/\\"/},a={className:"string",begin:/'/,end:/'/},c={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,e]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],l=t.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),d={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp"},contains:[l,t.SHEBANG(),d,c,t.HASH_COMMENT_MODE,s,i,o,a,e]}}Uin.exports=ots});var UKe=ee((Jva,$in)=>{p();function ats(t){return t?typeof t=="string"?t:t.source:null}function i_e(t){return cts("(",t,")?")}function cts(...t){return t.map(n=>ats(n)).join("")}function lts(t){let e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",i="("+n+"|"+i_e(r)+"[a-zA-Z_]\\w*"+i_e("<[^<>]+>")+")",o={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:i_e(r)+t.IDENT_RE,relevance:0},h=i_e(r)+t.IDENT_RE+"\\s*\\(",m={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary",literal:"true false nullptr NULL"},f=[l,o,e,t.C_BLOCK_COMMENT_MODE,u,c],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:m,contains:f.concat([{begin:/\(/,end:/\)/,keywords:m,contains:f.concat(["self"]),relevance:0}]),relevance:0},A={className:"function",begin:"("+i+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:m,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:m,relevance:0},{begin:h,returnBegin:!0,contains:[d],relevance:0},{className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,e,t.C_BLOCK_COMMENT_MODE,l]};return{name:"C",aliases:["h"],keywords:m,disableAutodetect:!0,illegal:"",keywords:m,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:m},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:l,strings:c,keywords:m}}}$in.exports=lts});var GKe=ee((Zva,Gin)=>{p();function uts(t){return t?typeof t=="string"?t:t.source:null}function dts(t){return $Ke("(?=",t,")")}function o_e(t){return $Ke("(",t,")?")}function $Ke(...t){return t.map(n=>uts(n)).join("")}function pts(t){let e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",i="("+n+"|"+o_e(r)+"[a-zA-Z_]\\w*"+o_e("<[^<>]+>")+")",o={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:o_e(r)+t.IDENT_RE,relevance:0},h=o_e(r)+t.IDENT_RE+"\\s*\\(",f={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"_Bool _Complex _Imaginary",_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"],literal:"true false nullptr NULL"},g={className:"function.dispatch",relevance:0,keywords:f,begin:$Ke(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,t.IDENT_RE,dts(/\s*\(/))},A=[g,l,o,e,t.C_BLOCK_COMMENT_MODE,u,c],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:A.concat([{begin:/\(/,end:/\)/,keywords:f,contains:A.concat(["self"]),relevance:0}]),relevance:0},b={className:"function",begin:"("+i+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:f,relevance:0},{begin:h,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,e,t.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:f,illegal:"",keywords:f,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:l,strings:c,keywords:f}}}Gin.exports=pts});var WKe=ee((tRa,Win)=>{p();function hts(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:s.concat(i),built_in:e,literal:r},a=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},l=t.inherit(u,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:o},h=t.inherit(d,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,h]},f={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},g=t.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]});d.contains=[f,m,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,c,t.C_BLOCK_COMMENT_MODE],h.contains=[g,m,l,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,c,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let A={variants:[f,m,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},b=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",S={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},A,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,y,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,y,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"meta-string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+b+"\\s+)+"+t.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,y],relevance:0},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[A,c,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},S]}}Win.exports=hts});var qKe=ee((rRa,qin)=>{p();function mts(t){let e={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},n={className:"subst",variants:[{begin:/\$\{/,end:/\}/}],keywords:"true false null this is new super"},r={className:"string",variants:[{begin:"r'''",end:"'''"},{begin:'r"""',end:'"""'},{begin:"r'",end:"'",illegal:"\\n"},{begin:'r"',end:'"',illegal:"\\n"},{begin:"'''",end:"'''",contains:[t.BACKSLASH_ESCAPE,e,n]},{begin:'"""',end:'"""',contains:[t.BACKSLASH_ESCAPE,e,n]},{begin:"'",end:"'",illegal:"\\n",contains:[t.BACKSLASH_ESCAPE,e,n]},{begin:'"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE,e,n]}]};n.contains=[t.C_NUMBER_MODE,r];let s=["Comparable","DateTime","Duration","Function","Iterable","Iterator","List","Map","Match","Object","Pattern","RegExp","Set","Stopwatch","String","StringBuffer","StringSink","Symbol","Type","Uri","bool","double","int","num","Element","ElementList"],i=s.map(a=>`${a}?`);return{name:"Dart",keywords:{keyword:"abstract as assert async await break case catch class const continue covariant default deferred do dynamic else enum export extends extension external factory false final finally for Function get hide if implements import in inferface is late library mixin new null on operator part required rethrow return set show static super switch sync this throw true try typedef var void while with yield",built_in:s.concat(i).concat(["Never","Null","dynamic","print","document","querySelector","querySelectorAll","window"]),$pattern:/[A-Za-z][A-Za-z0-9_]*\??/},contains:[r,t.COMMENT(/\/\*\*(?!\/)/,/\*\//,{subLanguage:"markdown",relevance:0}),t.COMMENT(/\/{3,} ?/,/$/,{contains:[{subLanguage:"markdown",begin:".",end:"$",relevance:0}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},t.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"},{begin:"=>"}]}}qin.exports=mts});var HKe=ee((iRa,Hin)=>{p();function fts(t){let e={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",literal:"true false iota nil",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{name:"Go",aliases:["golang"],keywords:e,illegal:"{p();function gts(t){return t?typeof t=="string"?t:t.source:null}function Ats(t){return yts("(?=",t,")")}function yts(...t){return t.map(n=>gts(n)).join("")}function VKe(t,e={}){return e.variants=t,e}function Ets(t){let e="[A-Za-z0-9_$]+",n=VKe([t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]})]),r={className:"regexp",begin:/~?\/[^\/\n]+\//,contains:[t.BACKSLASH_ESCAPE]},s=VKe([t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]),i=VKe([{begin:/"""/,end:/"""/},{begin:/'''/,end:/'''/},{begin:"\\$/",end:"/\\$",relevance:10},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE],{className:"string"});return{name:"Groovy",keywords:{built_in:"this super",literal:"true false null",keyword:"byte short char int long boolean float double void def as in assert trait abstract static volatile transient public private protected synchronized final class interface enum if else for while switch case break default continue throw throws try catch finally implements extends new import package return instanceof"},contains:[t.SHEBANG({binary:"groovy",relevance:10}),n,i,r,s,{className:"class",beginKeywords:"class interface trait enum",end:/\{/,illegal:":",contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{className:"meta",begin:"@[A-Za-z]+",relevance:0},{className:"attr",begin:e+"[ ]*:",relevance:0},{begin:/\?/,end:/:/,relevance:0,contains:[n,i,r,s,"self"]},{className:"symbol",begin:"^[ ]*"+Ats(e+":"),excludeBegin:!0,end:e+":",relevance:0}],illegal:/#|<\//}}Vin.exports=Ets});var YKe=ee((lRa,jin)=>{p();var xH="[0-9](_*[0-9])*",a_e=`\\.(${xH})`,c_e="[0-9a-fA-F](_*[0-9a-fA-F])*",bts={className:"number",variants:[{begin:`(\\b(${xH})((${a_e})|\\.)?|(${a_e}))[eE][+-]?(${xH})[fFdD]?\\b`},{begin:`\\b(${xH})((${a_e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${a_e})[fFdD]?\\b`},{begin:`\\b(${xH})[fFdD]\\b`},{begin:`\\b0[xX]((${c_e})\\.?|(${c_e})?\\.(${c_e}))[pP][+-]?(${xH})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${c_e})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function _ts(t){var e="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",n=e+"(<"+e+"(\\s*,\\s*"+e+")*>)?",r="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",s={className:"meta",begin:"@"+e,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]};let i=bts;return{name:"Java",aliases:["jsp"],keywords:r,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"class",beginKeywords:"class interface enum",end:/[{;=]/,excludeEnd:!0,relevance:1,keywords:"class interface enum",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"new throw return else",relevance:0},{className:"class",begin:"record\\s+"+t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,excludeEnd:!0,end:/[{;=]/,keywords:r,contains:[{beginKeywords:"record"},{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"function",begin:"("+n+"\\s+)+"+t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:r,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[s,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,i,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},i,s]}}jin.exports=_ts});var zKe=ee((dRa,zin)=>{p();var Yin="[A-Za-z$_][0-9A-Za-z$_]*",Sts=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Cts=["true","false","null","undefined","NaN","Infinity"],Its=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],xts=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],wts=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Tts=["arguments","this","super","console","window","document","localStorage","module","global"],vts=[].concat(wts,Tts,Its,xts);function Rts(t){return t?typeof t=="string"?t:t.source:null}function Kin(t){return KKe("(?=",t,")")}function KKe(...t){return t.map(n=>Rts(n)).join("")}function kts(t){let e=(C,{after:I})=>{let x="",end:""},s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(C,I)=>{let x=C[0].length+C.index,w=C.input[x];if(w==="<"){I.ignoreMatch();return}w===">"&&(e(C,{after:x})||I.ignoreMatch())}},i={$pattern:Yin,keyword:Sts,literal:Cts,built_in:vts},o="[0-9](_?[0-9])*",a=`\\.(${o})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${c})((${a})|\\.)?|(${a}))[eE][+-]?(${o})\\b`},{begin:`\\b(${c})\\b((${a})\\b|\\.)?|(${a})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},l={className:"subst",begin:"\\$\\{",end:"\\}",keywords:i,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,l],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,l],subLanguage:"css"}},m={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,l]},g={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},A=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,h,m,u,t.REGEXP_MODE];l.contains=A.concat({begin:/\{/,end:/\}/,keywords:i,contains:["self"].concat(A)});let y=[].concat(g,l.contains),b=y.concat([{begin:/\(/,end:/\)/,keywords:i,contains:["self"].concat(y)}]),S={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:b};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{PARAMS_CONTAINS:b},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,h,m,g,u,{begin:KKe(/[{,\n]\s*/,Kin(KKe(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/,n+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:n+Kin("\\s*:"),relevance:0}]},{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[g,t.REGEXP_MODE,{className:"function",begin:"(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:b}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:r.begin,end:r.end},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:i,contains:["self",t.inherit(t.TITLE_MODE,{begin:n}),S],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[S,t.inherit(t.TITLE_MODE,{begin:n})]},{variants:[{begin:"\\."+n},{begin:"\\$"+n}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},t.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:n}),"self",S]},{begin:"(get|set)\\s+(?="+n+"\\()",end:/\{/,keywords:"get set",contains:[t.inherit(t.TITLE_MODE,{begin:n}),{begin:/\(\)/},S]},{begin:/\$[(.]/}]}}zin.exports=kts});var JKe=ee((hRa,Jin)=>{p();var wH="[0-9](_*[0-9])*",l_e=`\\.(${wH})`,u_e="[0-9a-fA-F](_*[0-9a-fA-F])*",Nts={className:"number",variants:[{begin:`(\\b(${wH})((${l_e})|\\.)?|(${l_e}))[eE][+-]?(${wH})[fFdD]?\\b`},{begin:`\\b(${wH})((${l_e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${l_e})[fFdD]?\\b`},{begin:`\\b(${wH})[fFdD]\\b`},{begin:`\\b0[xX]((${u_e})\\.?|(${u_e})?\\.(${u_e}))[pP][+-]?(${wH})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${u_e})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Dts(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,s]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,i,s]}]};s.contains.push(o);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(o,{className:"meta-string"})]}]},u=Nts,l=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=d;return h.variants[1].contains=[d],d.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,l,n,r,a,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,l],relevance:0},t.C_LINE_COMMENT_MODE,l,a,c,o,t.C_NUMBER_MODE]},l]},{className:"class",beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/,excludeBegin:!0,returnEnd:!0},a,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}Jin.exports=Dts});var XKe=ee((fRa,Xin)=>{p();function Bts(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},s=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:s.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:s}].concat(s)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}Xin.exports=Bts});var ZKe=ee((ARa,Zin)=>{p();function Pts(t){let e={keyword:"rec with let in inherit assert if else then",literal:"true false or and null",built_in:"import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation"},n={className:"subst",begin:/\$\{/,end:/\}/,keywords:e},r={begin:/[a-zA-Z0-9-_]+(\s*=)/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/\S+/}]},s={className:"string",contains:[n],variants:[{begin:"''",end:"''"},{begin:'"',end:'"'}]},i=[t.NUMBER_MODE,t.HASH_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,s,r];return n.contains=i,{name:"Nix",aliases:["nixos"],keywords:e,contains:i}}Zin.exports=Pts});var eze=ee((ERa,non)=>{p();function ton(t){return t?typeof t=="string"?t:t.source:null}function TH(...t){return t.map(n=>ton(n)).join("")}function eon(...t){return"("+t.map(n=>ton(n)).join("|")+")"}function Ots(t){let e=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:e.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},i={begin:/->\{/,end:/\}/},o={variants:[{begin:/\$\d/},{begin:TH(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[t.BACKSLASH_ESCAPE,s,o],c=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],u=(h,m,f="\\1")=>{let g=f==="\\1"?f:TH(f,m);return TH(TH("(?:",h,")"),m,/(?:\\.|[^\\\/])*?/,g,/(?:\\.|[^\\\/])*?/,f,n)},l=(h,m,f)=>TH(TH("(?:",h,")"),m,/(?:\\.|[^\\\/])*?/,f,n),d=[o,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),i,{className:"string",contains:a,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:u("s|tr|y",eon(...c))},{begin:u("s|tr|y","\\(","\\)")},{begin:u("s|tr|y","\\[","\\]")},{begin:u("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:l("(?:m|qr)?",/\//,/\//)},{begin:l("m|qr",eon(...c),/\1/)},{begin:l("m|qr",/\(/,/\)/)},{begin:l("m|qr",/\[/,/\]/)},{begin:l("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=d,i.contains=d,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:d}}non.exports=Ots});var tze=ee((_Ra,ron)=>{p();function Mts(t){let e={className:"variable",begin:"\\$+[a-zA-Z_\x7F-\xFF][a-zA-Z0-9_\x7F-\xFF]*(?![A-Za-z0-9])(?![$])"},n={className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{begin:/\?>/}]},r={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},s=t.inherit(t.APOS_STRING_MODE,{illegal:null}),i=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(r)}),o=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(r)}),a={className:"string",contains:[t.BACKSLASH_ESCAPE,n],variants:[t.inherit(s,{begin:"b'",end:"'"}),t.inherit(i,{begin:'b"',end:'"'}),i,s,o]},c={className:"number",variants:[{begin:"\\b0b[01]+(?:_[01]+)*\\b"},{begin:"\\b0o[0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:e[+-]?\\d+)?"}],relevance:0},u={keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list match|0 mixed new object or private protected public real return string switch throw trait try unset use var void while xor yield",literal:"false null true",built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException UnhandledMatchError ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Stringable Throwable Traversable WeakReference WeakMap Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass"};return{aliases:["php3","php4","php5","php6","php7","php8"],case_insensitive:!0,keywords:u,contains:[t.HASH_COMMENT_MODE,t.COMMENT("//","$",{contains:[n]}),t.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0,keywords:"__halt_compiler"}),n,{className:"keyword",begin:/\$this\b/},e,{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{className:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",e,t.C_BLOCK_COMMENT_MODE,a,c]}]},{className:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",relevance:0,end:";",contains:[t.UNDERSCORE_TITLE_MODE]},a,c]}}ron.exports=Mts});var nze=ee((CRa,son)=>{p();function Lts(t){return t?typeof t=="string"?t:t.source:null}function Fts(t){return Qts("(?=",t,")")}function Qts(...t){return t.map(n=>Lts(n)).join("")}function Uts(t){let i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},a={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},c={begin:/\{\{/,relevance:0},u={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,o,c,a]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,o,c,a]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,c,a]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,c,a]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},l="[0-9](_?[0-9])*",d=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${l})|(${d}))[eE][+-]?(${l})[jJ]?\\b`},{begin:`(${d})[jJ]?`},{begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${l})[jJ]\\b`}]},m={className:"comment",begin:Fts(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",o,h,u,t.HASH_COMMENT_MODE]}]};return a.contains=[u,h,o],{name:"Python",aliases:["py","gyp","ipython"],keywords:i,illegal:/(<\/|->|\?)|=>/,contains:[o,h,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},u,m,t.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[t.UNDERSCORE_TITLE_MODE,f,{begin:/->/,endsWithParent:!0,keywords:i}]},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,f,u]}]}}son.exports=Uts});var rze=ee((xRa,oon)=>{p();function $ts(t){return t?typeof t=="string"?t:t.source:null}function Gts(t){return ion("(?=",t,")")}function ion(...t){return t.map(n=>$ts(n)).join("")}function Wts(t){let e="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__",built_in:"proc lambda",literal:"true false nil"},r={className:"doctag",begin:"@[A-Za-z]+"},s={begin:"#<",end:">"},i=[t.COMMENT("#","$",{contains:[r]}),t.COMMENT("^=begin","^=end",{contains:[r],relevance:10}),t.COMMENT("^__END__","\\n$")],o={className:"subst",begin:/#\{/,end:/\}/,keywords:n},a={className:"string",contains:[t.BACKSLASH_ESCAPE,o],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:/<<[-~]?'?(\w+)\n(?:[^\n]*\n)*?\s*\1\b/,returnBegin:!0,contains:[{begin:/<<[-~]?'?/},t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,o]})]}]},c="[1-9](_?[0-9])*|0",u="[0-9](_?[0-9])*",l={className:"number",relevance:0,variants:[{begin:`\\b(${c})(\\.(${u}))?([eE][+-]?(${u})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},d={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:n},h=[a,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[t.inherit(t.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{begin:"("+t.IDENT_RE+"::)?"+t.IDENT_RE,relevance:0}]}].concat(i)},{className:"function",begin:ion(/def\s+/,Gts(e+"\\s*(\\(|;|$)")),relevance:0,keywords:"def",end:"$|;",contains:[t.inherit(t.TITLE_MODE,{begin:e}),d].concat(i)},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[a,{begin:e}],relevance:0},l,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:n},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,o],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(s,i),relevance:0}].concat(s,i);o.contains=h,d.contains=h;let A=[{begin:/^\s*=>/,starts:{end:"$",contains:h}},{className:"meta",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+>"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",contains:h}}];return i.unshift(s),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:n,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(A).concat(i).concat(h)}}oon.exports=Wts});var sze=ee((TRa,aon)=>{p();function qts(t){let e="([ui](8|16|32|64|128|size)|f(32|64))?",n="abstract as async await become box break const continue crate do dyn else enum extern false final fn for if impl in let loop macro match mod move mut override priv pub ref return self Self static struct super trait true try type typeof unsafe unsized use virtual where while yield",r="drop i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f32 f64 str char bool Box Option Result String Vec Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator Extend IntoIterator DoubleEndedIterator ExactSizeIterator SliceConcatExt ToString assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!";return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",keyword:n,literal:"true false Some None Ok Err",built_in:r},illegal:""}]}}aon.exports=qts});var ize=ee((RRa,con)=>{p();function Hts(t){let e={className:"meta",begin:"@[A-Za-z]+"},n={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"},{begin:/\$\{/,end:/\}/}]},r={className:"string",variants:[{begin:'"""',end:'"""'},{begin:'"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:'[a-z]+"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE,n]},{className:"string",begin:'[a-z]+"""',end:'"""',contains:[n],relevance:10}]},s={className:"symbol",begin:"'\\w[\\w\\d_]*(?!')"},i={className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},o={className:"title",begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,relevance:0},a={className:"class",beginKeywords:"class object trait type",end:/[:={\[\n;]/,excludeEnd:!0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{beginKeywords:"extends with",relevance:10},{begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[i]},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[i]},o]},c={className:"function",beginKeywords:"def",end:/[:={\[(\n;]/,excludeEnd:!0,contains:[o]};return{name:"Scala",keywords:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,r,s,i,c,a,t.C_NUMBER_MODE,e]}}con.exports=Hts});var dze=ee((NRa,gon)=>{p();function pon(t){return t?typeof t=="string"?t:t.source:null}function vH(t){return Ma("(?=",t,")")}function Ma(...t){return t.map(n=>pon(n)).join("")}function Zm(...t){return"("+t.map(n=>pon(n)).join("|")+")"}var uze=t=>Ma(/\b/,t,/\w$/.test(t)?/\b/:/\B/),lon=["Protocol","Type"].map(uze),oze=["init","self"].map(uze),Vts=["Any","Self"],aze=["associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],uon=["false","nil","true"],jts=["assignment","associativity","higherThan","left","lowerThan","none","right"],Yts=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],don=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],hon=Zm(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),mon=Zm(hon,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),cze=Ma(hon,mon,"*"),fon=Zm(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),d_e=Zm(fon,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),nT=Ma(fon,d_e,"*"),lze=Ma(/[A-Z]/,d_e,"*"),Kts=["autoclosure",Ma(/convention\(/,Zm("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ma(/objc\(/,nT,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","testable","UIApplicationMain","unknown","usableFromInline"],zts=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Jts(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],s={className:"keyword",begin:Ma(/\./,vH(Zm(...lon,...oze))),end:Zm(...lon,...oze),excludeBegin:!0},i={match:Ma(/\./,Zm(...aze)),relevance:0},o=aze.filter(X=>typeof X=="string").concat(["_|0"]),a=aze.filter(X=>typeof X!="string").concat(Vts).map(uze),c={variants:[{className:"keyword",match:Zm(...a,...oze)}]},u={$pattern:Zm(/\b\w+/,/#\w+/),keyword:o.concat(Yts),literal:uon},l=[s,i,c],d={match:Ma(/\./,Zm(...don)),relevance:0},h={className:"built_in",match:Ma(/\b/,Zm(...don),/(?=\()/)},m=[d,h],f={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:cze},{match:`\\.(\\.|${mon})+`}]},A=[f,g],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",S={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},C=(X="")=>({className:"subst",variants:[{match:Ma(/\\/,X,/[0\\tnr"']/)},{match:Ma(/\\/,X,/u\{[0-9a-fA-F]{1,8}\}/)}]}),I=(X="")=>({className:"subst",match:Ma(/\\/,X,/[\t ]*(?:[\r\n]|\r\n)/)}),x=(X="")=>({className:"subst",label:"interpol",begin:Ma(/\\/,X,/\(/),end:/\)/}),w=(X="")=>({begin:Ma(X,/"""/),end:Ma(/"""/,X),contains:[C(X),I(X),x(X)]}),R=(X="")=>({begin:Ma(X,/"/),end:Ma(/"/,X),contains:[C(X),x(X)]}),N={className:"string",variants:[w(),w("#"),w("##"),w("###"),R(),R("#"),R("##"),R("###")]},P={match:Ma(/`/,nT,/`/)},G={className:"variable",match:/\$\d+/},$={className:"variable",match:`\\$${d_e}+`},Q=[P,G,$],H={match:/(@|#)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:zts,contains:[...A,S,N]}]}},oe={className:"keyword",match:Ma(/@/,Zm(...Kts))},re={className:"meta",match:Ma(/@/,nT)},Z=[H,oe,re],q={match:vH(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ma(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,d_e,"+")},{className:"type",match:lze,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ma(/\s+&\s+/,vH(lze)),relevance:0}]},ce={begin://,keywords:u,contains:[...r,...l,...Z,f,q]};q.contains.push(ce);let be={match:Ma(nT,/\s*:/),keywords:"_|0",relevance:0},Be={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",be,...r,...l,...m,...A,S,N,...Q,...Z,q]},Me={beginKeywords:"func",contains:[{className:"title",match:Zm(P.match,nT,cze),endsParent:!0,relevance:0},e]},Re={begin://,contains:[...r,q]},se={begin:Zm(vH(Ma(nT,/\s*:/)),vH(Ma(nT,/\s+/,nT,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:nT}]},ie={begin:/\(/,end:/\)/,keywords:u,contains:[se,...r,...l,...A,S,N,...Z,q,Be],endsParent:!0,illegal:/["']/},ne={className:"function",match:vH(/\bfunc\b/),contains:[Me,Re,ie,e],illegal:[/\[/,/%/]},J={className:"function",match:/\b(subscript|init[?!]?)\s*(?=[<(])/,keywords:{keyword:"subscript init init? init!",$pattern:/\w+[?!]?/},contains:[Re,ie,e],illegal:/\[|%/},te={beginKeywords:"operator",end:t.MATCH_NOTHING_RE,contains:[{className:"title",match:cze,endsParent:!0,relevance:0}]},j={beginKeywords:"precedencegroup",end:t.MATCH_NOTHING_RE,contains:[{className:"title",match:lze,relevance:0},{begin:/{/,end:/}/,relevance:0,endsParent:!0,keywords:[...jts,...uon],contains:[q]}]};for(let X of N.variants){let ae=X.contains.find(Ae=>Ae.label==="interpol");ae.keywords=u;let me=[...l,...m,...A,S,N,...Q];ae.contains=[...me,{begin:/\(/,end:/\)/,contains:["self",...me]}]}return{name:"Swift",keywords:u,contains:[...r,ne,J,{className:"class",beginKeywords:"struct protocol class extension enum",end:"\\{",excludeEnd:!0,keywords:u,contains:[t.inherit(t.TITLE_MODE,{begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...l]},te,j,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...l,...m,...A,S,N,...Q,...Z,q,Be]}}gon.exports=Jts});var hze=ee((BRa,_on)=>{p();var p_e="[A-Za-z$_][0-9A-Za-z$_]*",yon=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Eon=["true","false","null","undefined","NaN","Infinity"],Xts=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],Zts=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ens=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],tns=["arguments","this","super","console","window","document","localStorage","module","global"],bon=[].concat(ens,tns,Xts,Zts);function nns(t){return t?typeof t=="string"?t:t.source:null}function Aon(t){return pze("(?=",t,")")}function pze(...t){return t.map(n=>nns(n)).join("")}function rns(t){let e=(C,{after:I})=>{let x="",end:""},s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(C,I)=>{let x=C[0].length+C.index,w=C.input[x];if(w==="<"){I.ignoreMatch();return}w===">"&&(e(C,{after:x})||I.ignoreMatch())}},i={$pattern:p_e,keyword:yon,literal:Eon,built_in:bon},o="[0-9](_?[0-9])*",a=`\\.(${o})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${c})((${a})|\\.)?|(${a}))[eE][+-]?(${o})\\b`},{begin:`\\b(${c})\\b((${a})\\b|\\.)?|(${a})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},l={className:"subst",begin:"\\$\\{",end:"\\}",keywords:i,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,l],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,l],subLanguage:"css"}},m={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,l]},g={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},A=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,h,m,u,t.REGEXP_MODE];l.contains=A.concat({begin:/\{/,end:/\}/,keywords:i,contains:["self"].concat(A)});let y=[].concat(g,l.contains),b=y.concat([{begin:/\(/,end:/\)/,keywords:i,contains:["self"].concat(y)}]),S={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:b};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{PARAMS_CONTAINS:b},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,h,m,g,u,{begin:pze(/[{,\n]\s*/,Aon(pze(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/,n+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:n+Aon("\\s*:"),relevance:0}]},{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[g,t.REGEXP_MODE,{className:"function",begin:"(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:b}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:r.begin,end:r.end},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:i,contains:["self",t.inherit(t.TITLE_MODE,{begin:n}),S],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[S,t.inherit(t.TITLE_MODE,{begin:n})]},{variants:[{begin:"\\."+n},{begin:"\\$"+n}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},t.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:n}),"self",S]},{begin:"(get|set)\\s+(?="+n+"\\()",end:/\{/,keywords:"get set",contains:[t.inherit(t.TITLE_MODE,{begin:n}),{begin:/\(\)/},S]},{begin:/\$[(.]/}]}}function sns(t){let e=p_e,n={beginKeywords:"namespace",end:/\{/,excludeEnd:!0},r={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:"interface extends"},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},i=["any","void","number","boolean","string","object","never","enum"],o=["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"],a={$pattern:p_e,keyword:yon.concat(o),literal:Eon,built_in:bon.concat(i)},c={className:"meta",begin:"@"+e},u=(h,m,f)=>{let g=h.contains.findIndex(A=>A.label===m);if(g===-1)throw new Error("can not find mode to replace");h.contains.splice(g,1,f)},l=rns(t);Object.assign(l.keywords,a),l.exports.PARAMS_CONTAINS.push(c),l.contains=l.contains.concat([c,n,r]),u(l,"shebang",t.SHEBANG()),u(l,"use_strict",s);let d=l.contains.find(h=>h.className==="function");return d.relevance=0,Object.assign(l,{name:"TypeScript",aliases:["ts","tsx"]}),l}_on.exports=sns});var xon=ee((LRa,Ion)=>{p();function ons(t){var e="[A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_][A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_0-9]+",n="\u0434\u0430\u043B\u0435\u0435 ",r="\u0432\u043E\u0437\u0432\u0440\u0430\u0442 \u0432\u044B\u0437\u0432\u0430\u0442\u044C\u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0434\u043B\u044F \u0435\u0441\u043B\u0438 \u0438 \u0438\u0437 \u0438\u043B\u0438 \u0438\u043D\u0430\u0447\u0435 \u0438\u043D\u0430\u0447\u0435\u0435\u0441\u043B\u0438 \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u043A\u043E\u043D\u0435\u0446\u0435\u0441\u043B\u0438 \u043A\u043E\u043D\u0435\u0446\u043F\u043E\u043F\u044B\u0442\u043A\u0438 \u043A\u043E\u043D\u0435\u0446\u0446\u0438\u043A\u043B\u0430 \u043D\u0435 \u043D\u043E\u0432\u044B\u0439 \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u043F\u0435\u0440\u0435\u043C \u043F\u043E \u043F\u043E\u043A\u0430 \u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u043F\u0440\u0435\u0440\u0432\u0430\u0442\u044C \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0442\u043E\u0433\u0434\u0430 \u0446\u0438\u043A\u043B \u044D\u043A\u0441\u043F\u043E\u0440\u0442 ",s=n+r,i="\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C\u0438\u0437\u0444\u0430\u0439\u043B\u0430 ",o="\u0432\u0435\u0431\u043A\u043B\u0438\u0435\u043D\u0442 \u0432\u043C\u0435\u0441\u0442\u043E \u0432\u043D\u0435\u0448\u043D\u0435\u0435\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u043A\u043B\u0438\u0435\u043D\u0442 \u043A\u043E\u043D\u0435\u0446\u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043A\u043B\u0438\u0435\u043D\u0442 \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0441\u0435\u0440\u0432\u0435\u0440 \u043D\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0435 \u043D\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0435\u043D\u0430\u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043D\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0435\u043D\u0430\u0441\u0435\u0440\u0432\u0435\u0440\u0435\u0431\u0435\u0437\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430 \u043D\u0430\u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043D\u0430\u0441\u0435\u0440\u0432\u0435\u0440\u0435\u0431\u0435\u0437\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430 \u043E\u0431\u043B\u0430\u0441\u0442\u044C \u043F\u0435\u0440\u0435\u0434 \u043F\u043E\u0441\u043B\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0442\u043E\u043B\u0441\u0442\u044B\u0439\u043A\u043B\u0438\u0435\u043D\u0442\u043E\u0431\u044B\u0447\u043D\u043E\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0442\u043E\u043B\u0441\u0442\u044B\u0439\u043A\u043B\u0438\u0435\u043D\u0442\u0443\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u043C\u043E\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0442\u043E\u043D\u043A\u0438\u0439\u043A\u043B\u0438\u0435\u043D\u0442 ",a=i+o,c="\u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0440\u0430\u043D\u0438\u0446 \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0440\u043E\u043A \u0441\u0438\u043C\u0432\u043E\u043B\u0442\u0430\u0431\u0443\u043B\u044F\u0446\u0438\u0438 ",u="ansitooem oemtoansi \u0432\u0432\u0435\u0441\u0442\u0438\u0432\u0438\u0434\u0441\u0443\u0431\u043A\u043E\u043D\u0442\u043E \u0432\u0432\u0435\u0441\u0442\u0438\u043F\u0435\u0440\u0435\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u0435 \u0432\u0432\u0435\u0441\u0442\u0438\u043F\u0435\u0440\u0438\u043E\u0434 \u0432\u0432\u0435\u0441\u0442\u0438\u043F\u043B\u0430\u043D\u0441\u0447\u0435\u0442\u043E\u0432 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439\u043F\u043B\u0430\u043D\u0441\u0447\u0435\u0442\u043E\u0432 \u0434\u0430\u0442\u0430\u0433\u043E\u0434 \u0434\u0430\u0442\u0430\u043C\u0435\u0441\u044F\u0446 \u0434\u0430\u0442\u0430\u0447\u0438\u0441\u043B\u043E \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0432\u0441\u0442\u0440\u043E\u043A\u0443 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0438\u0437\u0441\u0442\u0440\u043E\u043A\u0438 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0438\u0431 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043A\u043E\u0434\u0441\u0438\u043C\u0432 \u043A\u043E\u043D\u0433\u043E\u0434\u0430 \u043A\u043E\u043D\u0435\u0446\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u0431\u0438 \u043A\u043E\u043D\u0435\u0446\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043D\u043D\u043E\u0433\u043E\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u0431\u0438 \u043A\u043E\u043D\u0435\u0446\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B\u0430 \u043A\u043E\u043D\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0430 \u043A\u043E\u043D\u043C\u0435\u0441\u044F\u0446\u0430 \u043A\u043E\u043D\u043D\u0435\u0434\u0435\u043B\u0438 \u043B\u043E\u0433 \u043B\u043E\u043310 \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\u0441\u0443\u0431\u043A\u043E\u043D\u0442\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435\u043D\u0430\u0431\u043E\u0440\u0430\u043F\u0440\u0430\u0432 \u043D\u0430\u0437\u043D\u0430\u0447\u0438\u0442\u044C\u0432\u0438\u0434 \u043D\u0430\u0437\u043D\u0430\u0447\u0438\u0442\u044C\u0441\u0447\u0435\u0442 \u043D\u0430\u0439\u0442\u0438\u0441\u0441\u044B\u043B\u043A\u0438 \u043D\u0430\u0447\u0430\u043B\u043E\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u0431\u0438 \u043D\u0430\u0447\u0430\u043B\u043E\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B\u0430 \u043D\u0430\u0447\u0433\u043E\u0434\u0430 \u043D\u0430\u0447\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0430 \u043D\u0430\u0447\u043C\u0435\u0441\u044F\u0446\u0430 \u043D\u0430\u0447\u043D\u0435\u0434\u0435\u043B\u0438 \u043D\u043E\u043C\u0435\u0440\u0434\u043D\u044F\u0433\u043E\u0434\u0430 \u043D\u043E\u043C\u0435\u0440\u0434\u043D\u044F\u043D\u0435\u0434\u0435\u043B\u0438 \u043D\u043E\u043C\u0435\u0440\u043D\u0435\u0434\u0435\u043B\u0438\u0433\u043E\u0434\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0439\u0436\u0443\u0440\u043D\u0430\u043B\u0440\u0430\u0441\u0447\u0435\u0442\u043E\u0432 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0439\u043F\u043B\u0430\u043D\u0441\u0447\u0435\u0442\u043E\u0432 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0439\u044F\u0437\u044B\u043A \u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C\u043E\u043A\u043D\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439 \u043F\u0435\u0440\u0438\u043E\u0434\u0441\u0442\u0440 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u0430\u0442\u0443\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u043E\u0442\u0431\u043E\u0440\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u043E\u0437\u0438\u0446\u0438\u044E\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u0443\u0441\u0442\u043E\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0442\u0430 \u043F\u0440\u0435\u0444\u0438\u043A\u0441\u0430\u0432\u0442\u043E\u043D\u0443\u043C\u0435\u0440\u0430\u0446\u0438\u0438 \u043F\u0440\u043E\u043F\u0438\u0441\u044C \u043F\u0443\u0441\u0442\u043E\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u043C \u0440\u0430\u0437\u043E\u0431\u0440\u0430\u0442\u044C\u043F\u043E\u0437\u0438\u0446\u0438\u044E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044C\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u043D\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044C\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u043F\u043E \u0441\u0438\u043C\u0432 \u0441\u043E\u0437\u0434\u0430\u0442\u044C\u043E\u0431\u044A\u0435\u043A\u0442 \u0441\u0442\u0430\u0442\u0443\u0441\u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0430 \u0441\u0442\u0440\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\u0441\u0442\u0440\u043E\u043A \u0441\u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u043F\u043E\u0437\u0438\u0446\u0438\u044E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0441\u0447\u0435\u0442\u043F\u043E\u043A\u043E\u0434\u0443 \u0442\u0435\u043A\u0443\u0449\u0435\u0435\u0432\u0440\u0435\u043C\u044F \u0442\u0438\u043F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0442\u0438\u043F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0441\u0442\u0440 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0442\u0430\u043D\u0430 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0442\u0430\u043F\u043E \u0444\u0438\u043A\u0441\u0448\u0430\u0431\u043B\u043E\u043D \u0448\u0430\u0431\u043B\u043E\u043D ",l="acos asin atan base64\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 base64\u0441\u0442\u0440\u043E\u043A\u0430 cos exp log log10 pow sin sqrt tan xml\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 xml\u0441\u0442\u0440\u043E\u043A\u0430 xml\u0442\u0438\u043F xml\u0442\u0438\u043F\u0437\u043D\u0447 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0435\u043E\u043A\u043D\u043E \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0434\u0430\u043D\u043D\u044B\u0445 \u0431\u0443\u043B\u0435\u0432\u043E \u0432\u0432\u0435\u0441\u0442\u0438\u0434\u0430\u0442\u0443 \u0432\u0432\u0435\u0441\u0442\u0438\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432\u0432\u0435\u0441\u0442\u0438\u0441\u0442\u0440\u043E\u043A\u0443 \u0432\u0432\u0435\u0441\u0442\u0438\u0447\u0438\u0441\u043B\u043E \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044C\u0447\u0442\u0435\u043D\u0438\u044Fxml \u0432\u043E\u043F\u0440\u043E\u0441 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432\u0440\u0435\u0433 \u0432\u044B\u0433\u0440\u0443\u0437\u0438\u0442\u044C\u0436\u0443\u0440\u043D\u0430\u043B\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u044F \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C\u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443\u043F\u0440\u0430\u0432\u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u0432\u044B\u0447\u0438\u0441\u043B\u0438\u0442\u044C \u0433\u043E\u0434 \u0434\u0430\u043D\u043D\u044B\u0435\u0444\u043E\u0440\u043C\u044B\u0432\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u0430\u0442\u0430 \u0434\u0435\u043D\u044C \u0434\u0435\u043D\u044C\u0433\u043E\u0434\u0430 \u0434\u0435\u043D\u044C\u043D\u0435\u0434\u0435\u043B\u0438 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C\u043C\u0435\u0441\u044F\u0446 \u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0434\u0430\u043D\u043D\u044B\u0435\u0434\u043B\u044F\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0440\u0430\u0431\u043E\u0442\u0443\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C\u0440\u0430\u0431\u043E\u0442\u0443\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C\u0432\u043D\u0435\u0448\u043D\u044E\u044E\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u0443 \u0437\u0430\u043A\u0440\u044B\u0442\u044C\u0441\u043F\u0440\u0430\u0432\u043A\u0443 \u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044Cjson \u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044Cxml \u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044C\u0434\u0430\u0442\u0443json \u0437\u0430\u043F\u0438\u0441\u044C\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0441\u0432\u043E\u0439\u0441\u0442\u0432 \u0437\u0430\u043F\u0440\u043E\u0441\u0438\u0442\u044C\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C\u0441\u0438\u0441\u0442\u0435\u043C\u0443 \u0437\u0430\u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0432\u0434\u0430\u043D\u043D\u044B\u0435\u0444\u043E\u0440\u043C\u044B \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0432\u0441\u0442\u0440\u043E\u043A\u0443\u0432\u043D\u0443\u0442\u0440 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0432\u0444\u0430\u0439\u043B \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0438\u0437\u0441\u0442\u0440\u043E\u043A\u0438\u0432\u043D\u0443\u0442\u0440 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0438\u0437\u0444\u0430\u0439\u043B\u0430 \u0438\u0437xml\u0442\u0438\u043F\u0430 \u0438\u043C\u043F\u043E\u0440\u0442\u043C\u043E\u0434\u0435\u043B\u0438xdto \u0438\u043C\u044F\u043A\u043E\u043C\u043F\u044C\u044E\u0442\u0435\u0440\u0430 \u0438\u043C\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0435\u0434\u0430\u043D\u043D\u044B\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F\u043E\u0431\u043E\u0448\u0438\u0431\u043A\u0435 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0438\u043C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0433\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0430 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0445\u0444\u0430\u0439\u043B\u043E\u0432 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u0442\u0440\u043E\u043A\u0443 \u043A\u043E\u0434\u043B\u043E\u043A\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043A\u043E\u0434\u0441\u0438\u043C\u0432\u043E\u043B\u0430 \u043A\u043E\u043C\u0430\u043D\u0434\u0430\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u043A\u043E\u043D\u0435\u0446\u0433\u043E\u0434\u0430 \u043A\u043E\u043D\u0435\u0446\u0434\u043D\u044F \u043A\u043E\u043D\u0435\u0446\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0430 \u043A\u043E\u043D\u0435\u0446\u043C\u0435\u0441\u044F\u0446\u0430 \u043A\u043E\u043D\u0435\u0446\u043C\u0438\u043D\u0443\u0442\u044B \u043A\u043E\u043D\u0435\u0446\u043D\u0435\u0434\u0435\u043B\u0438 \u043A\u043E\u043D\u0435\u0446\u0447\u0430\u0441\u0430 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044F\u0431\u0430\u0437\u044B\u0434\u0430\u043D\u043D\u044B\u0445\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0430\u0434\u0438\u043D\u0430\u043C\u0438\u0447\u0435\u0441\u043A\u0438 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044F\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0430 \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0434\u0430\u043D\u043D\u044B\u0435\u0444\u043E\u0440\u043C\u044B \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0444\u0430\u0439\u043B \u043A\u0440\u0430\u0442\u043A\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043E\u0448\u0438\u0431\u043A\u0438 \u043B\u0435\u0432 \u043C\u0430\u043A\u0441 \u043C\u0435\u0441\u0442\u043D\u043E\u0435\u0432\u0440\u0435\u043C\u044F \u043C\u0435\u0441\u044F\u0446 \u043C\u0438\u043D \u043C\u0438\u043D\u0443\u0442\u0430 \u043C\u043E\u043D\u043E\u043F\u043E\u043B\u044C\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u043D\u0430\u0439\u0442\u0438 \u043D\u0430\u0439\u0442\u0438\u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435\u0441\u0438\u043C\u0432\u043E\u043B\u044Bxml \u043D\u0430\u0439\u0442\u0438\u043E\u043A\u043D\u043E\u043F\u043E\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0441\u0441\u044B\u043B\u043A\u0435 \u043D\u0430\u0439\u0442\u0438\u043F\u043E\u043C\u0435\u0447\u0435\u043D\u043D\u044B\u0435\u043D\u0430\u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u043D\u0430\u0439\u0442\u0438\u043F\u043E\u0441\u0441\u044B\u043B\u043A\u0430\u043C \u043D\u0430\u0439\u0442\u0438\u0444\u0430\u0439\u043B\u044B \u043D\u0430\u0447\u0430\u043B\u043E\u0433\u043E\u0434\u0430 \u043D\u0430\u0447\u0430\u043B\u043E\u0434\u043D\u044F \u043D\u0430\u0447\u0430\u043B\u043E\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0430 \u043D\u0430\u0447\u0430\u043B\u043E\u043C\u0435\u0441\u044F\u0446\u0430 \u043D\u0430\u0447\u0430\u043B\u043E\u043C\u0438\u043D\u0443\u0442\u044B \u043D\u0430\u0447\u0430\u043B\u043E\u043D\u0435\u0434\u0435\u043B\u0438 \u043D\u0430\u0447\u0430\u043B\u043E\u0447\u0430\u0441\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u0437\u0430\u043F\u0440\u043E\u0441\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043D\u0430\u0447\u0430\u0442\u044C\u0437\u0430\u043F\u0443\u0441\u043A\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043D\u0430\u0447\u0430\u0442\u044C\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u0432\u043D\u0435\u0448\u043D\u0435\u0439\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u044B \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0435\u0439 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u0444\u0430\u0439\u043B\u0430\u043C\u0438 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u0438\u0441\u043A\u0444\u0430\u0439\u043B\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0445\u0444\u0430\u0439\u043B\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435\u0434\u0432\u043E\u0438\u0447\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445\u0438\u0437\u0444\u0430\u0439\u043B\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044E \u043D\u0430\u0447\u0430\u0442\u044C\u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443\u0432\u043D\u0435\u0448\u043D\u0435\u0439\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u044B \u043D\u0430\u0447\u0430\u0442\u044C\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0435\u0439 \u043D\u0430\u0447\u0430\u0442\u044C\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u0444\u0430\u0439\u043B\u0430\u043C\u0438 \u043D\u0435\u0434\u0435\u043B\u044F\u0433\u043E\u0434\u0430 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E\u0441\u0442\u044C\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F \u043D\u043E\u043C\u0435\u0440\u0441\u0435\u0430\u043D\u0441\u0430\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043D\u043E\u043C\u0435\u0440\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043D\u0440\u0435\u0433 \u043D\u0441\u0442\u0440 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C\u043D\u0443\u043C\u0435\u0440\u0430\u0446\u0438\u044E\u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C\u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u043C\u044B\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u043F\u0440\u0435\u0440\u044B\u0432\u0430\u043D\u0438\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0438\u0442\u044C\u0444\u0430\u0439\u043B\u044B \u043E\u043A\u0440 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u043E\u0448\u0438\u0431\u043A\u0438 \u043E\u043F\u043E\u0432\u0435\u0441\u0442\u0438\u0442\u044C \u043E\u043F\u043E\u0432\u0435\u0441\u0442\u0438\u0442\u044C\u043E\u0431\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u0437\u0430\u043F\u0440\u043E\u0441\u0430\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u043E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u044F \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0438\u043D\u0434\u0435\u043A\u0441\u0441\u043F\u0440\u0430\u0432\u043A\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0441\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435\u0441\u043F\u0440\u0430\u0432\u043A\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0441\u043F\u0440\u0430\u0432\u043A\u0443 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0444\u043E\u0440\u043C\u0443 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0444\u043E\u0440\u043C\u0443\u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E \u043E\u0442\u043C\u0435\u043D\u0438\u0442\u044C\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044E \u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C\u0436\u0443\u0440\u043D\u0430\u043B\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u043F\u0435\u0440\u0435\u0439\u0442\u0438\u043F\u043E\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0441\u0441\u044B\u043B\u043A\u0435 \u043F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0444\u0430\u0439\u043B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0432\u043D\u0435\u0448\u043D\u044E\u044E\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u0443 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u0437\u0430\u043F\u0440\u043E\u0441\u0430\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u044F \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0435\u0439 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u0444\u0430\u0439\u043B\u0430\u043C\u0438 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043E\u0448\u0438\u0431\u043A\u0438 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0432\u0432\u043E\u0434\u0434\u0430\u0442\u044B \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0432\u0432\u043E\u0434\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0432\u0432\u043E\u0434\u0441\u0442\u0440\u043E\u043A\u0438 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0432\u0432\u043E\u0434\u0447\u0438\u0441\u043B\u0430 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0432\u043E\u043F\u0440\u043E\u0441 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E\u043E\u0431\u043E\u0448\u0438\u0431\u043A\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u043D\u0430\u043A\u0430\u0440\u0442\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 \u043F\u043E\u043B\u043D\u043E\u0435\u0438\u043C\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044Ccom\u043E\u0431\u044A\u0435\u043A\u0442 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044Cxml\u0442\u0438\u043F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0430\u0434\u0440\u0435\u0441\u043F\u043E\u043C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u044E \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0443\u0441\u0435\u0430\u043D\u0441\u043E\u0432 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F\u0441\u043F\u044F\u0449\u0435\u0433\u043E\u0441\u0435\u0430\u043D\u0441\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u0437\u0430\u0441\u044B\u043F\u0430\u043D\u0438\u044F\u043F\u0430\u0441\u0441\u0438\u0432\u043D\u043E\u0433\u043E\u0441\u0435\u0430\u043D\u0441\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u0430\u043D\u043D\u044B\u0435\u0432\u044B\u0431\u043E\u0440\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435\u043A\u043E\u0434\u044B\u043B\u043E\u043A\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435\u0447\u0430\u0441\u043E\u0432\u044B\u0435\u043F\u043E\u044F\u0441\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u043E\u0442\u0431\u043E\u0440\u0430\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u0437\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0433\u043E\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u043C\u044F\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0433\u043E\u0444\u0430\u0439\u043B\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u043C\u044F\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E\u044D\u043A\u0440\u0430\u043D\u043E\u0432\u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043A\u0440\u0430\u0442\u043A\u0438\u0439\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0430\u043A\u0435\u0442\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0430\u0441\u043A\u0443\u0432\u0441\u0435\u0444\u0430\u0439\u043B\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0430\u0441\u043A\u0443\u0432\u0441\u0435\u0444\u0430\u0439\u043B\u044B\u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0430\u0441\u043A\u0443\u0432\u0441\u0435\u0444\u0430\u0439\u043B\u044B\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u0430\u0434\u0440\u0435\u0441\u0443 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u0443\u044E\u0434\u043B\u0438\u043D\u0443\u043F\u0430\u0440\u043E\u043B\u0435\u0439\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043E\u043D\u043D\u0443\u044E\u0441\u0441\u044B\u043B\u043A\u0443 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043E\u043D\u043D\u0443\u044E\u0441\u0441\u044B\u043B\u043A\u0443\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u0431\u0430\u0437\u044B\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u0431\u0449\u0438\u0439\u043C\u0430\u043A\u0435\u0442 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u0431\u0449\u0443\u044E\u0444\u043E\u0440\u043C\u0443 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u043A\u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\u0443\u044E\u043E\u0442\u043C\u0435\u0442\u043A\u0443\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0433\u043E\u0440\u0435\u0436\u0438\u043C\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445\u043E\u043F\u0446\u0438\u0439\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u043E\u043B\u043D\u043E\u0435\u0438\u043C\u044F\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u043E\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445\u0441\u0441\u044B\u043B\u043E\u043A \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443\u0441\u043B\u043E\u0436\u043D\u043E\u0441\u0442\u0438\u043F\u0430\u0440\u043E\u043B\u0435\u0439\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u043F\u0443\u0442\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u043F\u0443\u0442\u0438\u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u043F\u0443\u0442\u0438\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u0435\u0430\u043D\u0441\u044B\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044E \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435\u043E\u0431\u044A\u0435\u043A\u0442\u0430\u0438\u0444\u043E\u0440\u043C\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u043E\u0441\u0442\u0430\u0432\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430odata \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0443\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F\u0431\u0430\u0437\u044B\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0442\u0435\u043A\u0443\u0449\u0438\u0439\u0441\u0435\u0430\u043D\u0441\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0444\u0430\u0439\u043B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0444\u0430\u0439\u043B\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0444\u043E\u0440\u043C\u0443 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u0443\u044E\u043E\u043F\u0446\u0438\u044E \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u0443\u044E\u043E\u043F\u0446\u0438\u044E\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0447\u0430\u0441\u043E\u0432\u043E\u0439\u043F\u043E\u044F\u0441\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438\u043E\u0441 \u043F\u043E\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0432\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0435\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435 \u043F\u043E\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0444\u0430\u0439\u043B \u043F\u043E\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0444\u0430\u0439\u043B\u044B \u043F\u0440\u0430\u0432 \u043F\u0440\u0430\u0432\u043E\u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u043E\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043A\u043E\u0434\u0430\u043B\u043E\u043A\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0435\u0440\u0438\u043E\u0434\u0430 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0430\u0432\u0430 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0447\u0430\u0441\u043E\u0432\u043E\u0433\u043E\u043F\u043E\u044F\u0441\u0430 \u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 \u043F\u0440\u0435\u043A\u0440\u0430\u0442\u0438\u0442\u044C\u0440\u0430\u0431\u043E\u0442\u0443\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C\u0432\u044B\u0437\u043E\u0432 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044Cjson \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044Cxml \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C\u0434\u0430\u0442\u0443json \u043F\u0443\u0441\u0442\u0430\u044F\u0441\u0442\u0440\u043E\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0439\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0440\u0430\u0437\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0434\u0430\u043D\u043D\u044B\u0435\u0434\u043B\u044F\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C\u0444\u0430\u0439\u043B \u0440\u0430\u0437\u043E\u0440\u0432\u0430\u0442\u044C\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435\u0441\u0432\u043D\u0435\u0448\u043D\u0438\u043C\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u043C\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u0442\u0440\u043E\u043A\u0443 \u0440\u043E\u043B\u044C\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0441\u0435\u043A\u0443\u043D\u0434\u0430 \u0441\u0438\u0433\u043D\u0430\u043B \u0441\u0438\u043C\u0432\u043E\u043B \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0436\u0443\u0440\u043D\u0430\u043B\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u043B\u0435\u0442\u043D\u0435\u0433\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C\u0431\u0443\u0444\u0435\u0440\u044B\u0434\u0432\u043E\u0438\u0447\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u0437\u0434\u0430\u0442\u044C\u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u0441\u043E\u0437\u0434\u0430\u0442\u044C\u0444\u0430\u0431\u0440\u0438\u043A\u0443xdto \u0441\u043E\u043A\u0440\u043B \u0441\u043E\u043A\u0440\u043B\u043F \u0441\u043E\u043A\u0440\u043F \u0441\u043E\u043E\u0431\u0449\u0438\u0442\u044C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0441\u0440\u0435\u0434 \u0441\u0442\u0440\u0434\u043B\u0438\u043D\u0430 \u0441\u0442\u0440\u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F\u043D\u0430 \u0441\u0442\u0440\u0437\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0442\u0440\u043D\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F\u0441 \u0441\u0442\u0440\u043E\u043A\u0430 \u0441\u0442\u0440\u043E\u043A\u0430\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u0441\u0442\u0440\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u0442\u0440\u043E\u043A\u0443 \u0441\u0442\u0440\u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u0441\u0442\u0440\u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0441\u0442\u0440\u0441\u0440\u0430\u0432\u043D\u0438\u0442\u044C \u0441\u0442\u0440\u0447\u0438\u0441\u043B\u043E\u0432\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0439 \u0441\u0442\u0440\u0447\u0438\u0441\u043B\u043E\u0441\u0442\u0440\u043E\u043A \u0441\u0442\u0440\u0448\u0430\u0431\u043B\u043E\u043D \u0442\u0435\u043A\u0443\u0449\u0430\u044F\u0434\u0430\u0442\u0430 \u0442\u0435\u043A\u0443\u0449\u0430\u044F\u0434\u0430\u0442\u0430\u0441\u0435\u0430\u043D\u0441\u0430 \u0442\u0435\u043A\u0443\u0449\u0430\u044F\u0443\u043D\u0438\u0432\u0435\u0440\u0441\u0430\u043B\u044C\u043D\u0430\u044F\u0434\u0430\u0442\u0430 \u0442\u0435\u043A\u0443\u0449\u0430\u044F\u0443\u043D\u0438\u0432\u0435\u0440\u0441\u0430\u043B\u044C\u043D\u0430\u044F\u0434\u0430\u0442\u0430\u0432\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430\u0445 \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E\u0448\u0440\u0438\u0444\u0442\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u043A\u043E\u0434\u043B\u043E\u043A\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u0440\u0435\u0436\u0438\u043C\u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u044F\u0437\u044B\u043A \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u044F\u0437\u044B\u043A\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u0442\u0438\u043F \u0442\u0438\u043F\u0437\u043D\u0447 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044F\u0430\u043A\u0442\u0438\u0432\u043D\u0430 \u0442\u0440\u0435\u0433 \u0443\u0434\u0430\u043B\u0438\u0442\u044C\u0434\u0430\u043D\u043D\u044B\u0435\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u0443\u0434\u0430\u043B\u0438\u0442\u044C\u0438\u0437\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0433\u043E\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430 \u0443\u0434\u0430\u043B\u0438\u0442\u044C\u043E\u0431\u044A\u0435\u043A\u0442\u044B \u0443\u0434\u0430\u043B\u0438\u0442\u044C\u0444\u0430\u0439\u043B\u044B \u0443\u043D\u0438\u0432\u0435\u0440\u0441\u0430\u043B\u044C\u043D\u043E\u0435\u0432\u0440\u0435\u043C\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0434\u0430\u043D\u043D\u044B\u0445 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0443\u0441\u0435\u0430\u043D\u0441\u043E\u0432 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0432\u043D\u0435\u0448\u043D\u044E\u044E\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u0443 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F\u0441\u043F\u044F\u0449\u0435\u0433\u043E\u0441\u0435\u0430\u043D\u0441\u0430 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u0437\u0430\u0441\u044B\u043F\u0430\u043D\u0438\u044F\u043F\u0430\u0441\u0441\u0438\u0432\u043D\u043E\u0433\u043E\u0441\u0435\u0430\u043D\u0441\u0430 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043A\u0440\u0430\u0442\u043A\u0438\u0439\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u0443\u044E\u0434\u043B\u0438\u043D\u0443\u043F\u0430\u0440\u043E\u043B\u0435\u0439\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043C\u043E\u043D\u043E\u043F\u043E\u043B\u044C\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0433\u043E\u0440\u0435\u0436\u0438\u043C\u0430 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445\u043E\u043F\u0446\u0438\u0439\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443\u0441\u043B\u043E\u0436\u043D\u043E\u0441\u0442\u0438\u043F\u0430\u0440\u043E\u043B\u0435\u0439\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0435\u0439 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u0444\u0430\u0439\u043B\u0430\u043C\u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435\u0441\u0432\u043D\u0435\u0448\u043D\u0438\u043C\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u043C\u0434\u0430\u043D\u043D\u044B\u0445 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435\u043E\u0431\u044A\u0435\u043A\u0442\u0430\u0438\u0444\u043E\u0440\u043C\u044B \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0441\u043E\u0441\u0442\u0430\u0432\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430odata \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0447\u0430\u0441\u043E\u0432\u043E\u0439\u043F\u043E\u044F\u0441\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0447\u0430\u0441\u043E\u0432\u043E\u0439\u043F\u043E\u044F\u0441\u0441\u0435\u0430\u043D\u0441\u0430 \u0444\u043E\u0440\u043C\u0430\u0442 \u0446\u0435\u043B \u0447\u0430\u0441 \u0447\u0430\u0441\u043E\u0432\u043E\u0439\u043F\u043E\u044F\u0441 \u0447\u0430\u0441\u043E\u0432\u043E\u0439\u043F\u043E\u044F\u0441\u0441\u0435\u0430\u043D\u0441\u0430 \u0447\u0438\u0441\u043B\u043E \u0447\u0438\u0441\u043B\u043E\u043F\u0440\u043E\u043F\u0438\u0441\u044C\u044E \u044D\u0442\u043E\u0430\u0434\u0440\u0435\u0441\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0433\u043E\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430 ",d="ws\u0441\u0441\u044B\u043B\u043A\u0438 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430\u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430\u043C\u0430\u043A\u0435\u0442\u043E\u0432\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430\u0441\u0442\u0438\u043B\u0435\u0439 \u0431\u0438\u0437\u043D\u0435\u0441\u043F\u0440\u043E\u0446\u0435\u0441\u0441\u044B \u0432\u043D\u0435\u0448\u043D\u0438\u0435\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0432\u043D\u0435\u0448\u043D\u0438\u0435\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438 \u0432\u043D\u0435\u0448\u043D\u0438\u0435\u043E\u0442\u0447\u0435\u0442\u044B \u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u044B\u0435\u043F\u043E\u043A\u0443\u043F\u043A\u0438 \u0433\u043B\u0430\u0432\u043D\u044B\u0439\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0433\u043B\u0430\u0432\u043D\u044B\u0439\u0441\u0442\u0438\u043B\u044C \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u044B \u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u043C\u044B\u0435\u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F \u0436\u0443\u0440\u043D\u0430\u043B\u044B\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F\u043E\u0431\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0447\u0435\u0439\u0434\u0430\u0442\u044B \u0438\u0441\u0442\u043E\u0440\u0438\u044F\u0440\u0430\u0431\u043E\u0442\u044B\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043A\u043E\u043D\u0441\u0442\u0430\u043D\u0442\u044B \u043A\u0440\u0438\u0442\u0435\u0440\u0438\u0438\u043E\u0442\u0431\u043E\u0440\u0430 \u043C\u0435\u0442\u0430\u0434\u0430\u043D\u043D\u044B\u0435 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0440\u0435\u043A\u043B\u0430\u043C\u044B \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0430\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u043C\u044B\u0445\u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0439 \u043E\u0442\u0447\u0435\u0442\u044B \u043F\u0430\u043D\u0435\u043B\u044C\u0437\u0430\u0434\u0430\u0447\u043E\u0441 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0441\u0435\u0430\u043D\u0441\u0430 \u043F\u0435\u0440\u0435\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u044F \u043F\u043B\u0430\u043D\u044B\u0432\u0438\u0434\u043E\u0432\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043F\u043B\u0430\u043D\u044B\u0432\u0438\u0434\u043E\u0432\u0445\u0430\u0440\u0430\u043A\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043A \u043F\u043B\u0430\u043D\u044B\u043E\u0431\u043C\u0435\u043D\u0430 \u043F\u043B\u0430\u043D\u044B\u0441\u0447\u0435\u0442\u043E\u0432 \u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0439\u043F\u043E\u0438\u0441\u043A \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430\u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u044B\u0445\u043F\u043E\u043A\u0443\u043F\u043E\u043A \u0440\u0430\u0431\u043E\u0447\u0430\u044F\u0434\u0430\u0442\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u0431\u0443\u0445\u0433\u0430\u043B\u0442\u0435\u0440\u0438\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u0441\u0432\u0435\u0434\u0435\u043D\u0438\u0439 \u0440\u0435\u0433\u043B\u0430\u043C\u0435\u043D\u0442\u043D\u044B\u0435\u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0441\u0435\u0440\u0438\u0430\u043B\u0438\u0437\u0430\u0442\u043E\u0440xdto \u0441\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u0433\u0435\u043E\u043F\u043E\u0437\u0438\u0446\u0438\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043C\u0443\u043B\u044C\u0442\u0438\u043C\u0435\u0434\u0438\u0430 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0440\u0435\u043A\u043B\u0430\u043C\u044B \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043F\u043E\u0447\u0442\u044B \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0438\u0438 \u0444\u0430\u0431\u0440\u0438\u043A\u0430xdto \u0444\u0430\u0439\u043B\u043E\u0432\u044B\u0435\u043F\u043E\u0442\u043E\u043A\u0438 \u0444\u043E\u043D\u043E\u0432\u044B\u0435\u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0432\u043E\u0442\u0447\u0435\u0442\u043E\u0432 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u0434\u0430\u043D\u043D\u044B\u0445\u0444\u043E\u0440\u043C \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u043E\u0431\u0449\u0438\u0445\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u0434\u0438\u043D\u0430\u043C\u0438\u0447\u0435\u0441\u043A\u0438\u0445\u0441\u043F\u0438\u0441\u043A\u043E\u0432 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043E\u0442\u0447\u0435\u0442\u043E\u0432 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u0441\u0438\u0441\u0442\u0435\u043C\u043D\u044B\u0445\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A ",h=c+u+l+d,m="web\u0446\u0432\u0435\u0442\u0430 windows\u0446\u0432\u0435\u0442\u0430 windows\u0448\u0440\u0438\u0444\u0442\u044B \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430\u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u0440\u0430\u043C\u043A\u0438\u0441\u0442\u0438\u043B\u044F \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u0446\u0432\u0435\u0442\u0430\u0441\u0442\u0438\u043B\u044F \u0448\u0440\u0438\u0444\u0442\u044B\u0441\u0442\u0438\u043B\u044F ",f="\u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0435\u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445\u0444\u043E\u0440\u043C\u044B\u0432\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u0430\u0432\u0442\u043E\u043D\u0443\u043C\u0435\u0440\u0430\u0446\u0438\u044F\u0432\u0444\u043E\u0440\u043C\u0435 \u0430\u0432\u0442\u043E\u0440\u0430\u0437\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u0435\u0441\u0435\u0440\u0438\u0439 \u0430\u043D\u0438\u043C\u0430\u0446\u0438\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0432\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u044F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u0438\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u043E\u0432 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u0432\u044B\u0441\u043E\u0442\u043E\u0439\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u0430\u044F\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0430\u0444\u043E\u0440\u043C\u044B \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0435\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0435\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u0432\u0438\u0434\u0433\u0440\u0443\u043F\u043F\u044B\u0444\u043E\u0440\u043C\u044B \u0432\u0438\u0434\u0434\u0435\u043A\u043E\u0440\u0430\u0446\u0438\u0438\u0444\u043E\u0440\u043C\u044B \u0432\u0438\u0434\u0434\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0444\u043E\u0440\u043C\u044B \u0432\u0438\u0434\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u0434\u0430\u043D\u043D\u044B\u0445 \u0432\u0438\u0434\u043A\u043D\u043E\u043F\u043A\u0438\u0444\u043E\u0440\u043C\u044B \u0432\u0438\u0434\u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0442\u0435\u043B\u044F \u0432\u0438\u0434\u043F\u043E\u0434\u043F\u0438\u0441\u0435\u0439\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0435 \u0432\u0438\u0434\u043F\u043E\u043B\u044F\u0444\u043E\u0440\u043C\u044B \u0432\u0438\u0434\u0444\u043B\u0430\u0436\u043A\u0430 \u0432\u043B\u0438\u044F\u043D\u0438\u0435\u0440\u0430\u0437\u043C\u0435\u0440\u0430\u043D\u0430\u043F\u0443\u0437\u044B\u0440\u0435\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0435\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0435\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0430\u043A\u043E\u043B\u043E\u043D\u043E\u043A \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0430\u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u043D\u044B\u0445\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u0444\u043E\u0440\u043C\u044B \u0433\u0440\u0443\u043F\u043F\u044B\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u043D\u0438\u044F \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F\u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u043D\u0438\u044F \u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B\u043C\u0435\u0436\u0434\u0443\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043C\u0438\u0444\u043E\u0440\u043C\u044B \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0432\u044B\u0432\u043E\u0434\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043F\u043E\u043B\u043E\u0441\u044B\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u043C\u043E\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0442\u043E\u0447\u043A\u0438\u0431\u0438\u0440\u0436\u0435\u0432\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0438\u0441\u0442\u043E\u0440\u0438\u044F\u0432\u044B\u0431\u043E\u0440\u0430\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u043E\u0441\u0438\u0442\u043E\u0447\u0435\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0440\u0430\u0437\u043C\u0435\u0440\u0430\u043F\u0443\u0437\u044B\u0440\u044C\u043A\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F\u0433\u0440\u0443\u043F\u043F\u044B\u043A\u043E\u043C\u0430\u043D\u0434 \u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C\u0441\u0435\u0440\u0438\u0439 \u043D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0435\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0434\u0435\u0440\u0435\u0432\u0430 \u043D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0435\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0441\u043F\u0438\u0441\u043A\u0430 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u0434\u0435\u043D\u0434\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u043C\u0435\u0442\u043E\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u043C\u0435\u0442\u043E\u043A\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0444\u043E\u0440\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0432\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0435 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0432\u043B\u0435\u0433\u0435\u043D\u0434\u0435\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0433\u0440\u0443\u043F\u043F\u044B\u043A\u043D\u043E\u043F\u043E\u043A \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u0448\u043A\u0430\u043B\u044B\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0438\u0437\u043C\u0435\u0440\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u0433\u0430\u043D\u0442\u0430 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043A\u043D\u043E\u043F\u043A\u0438 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043A\u043D\u043E\u043F\u043A\u0438\u0432\u044B\u0431\u043E\u0440\u0430 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043E\u0431\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439\u0444\u043E\u0440\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043E\u0431\u044B\u0447\u043D\u043E\u0439\u0433\u0440\u0443\u043F\u043F\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043E\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043B\u044C\u043D\u044B\u0445\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u043F\u0443\u0437\u044B\u0440\u044C\u043A\u043E\u0432\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043F\u0430\u043D\u0435\u043B\u0438\u043F\u043E\u0438\u0441\u043A\u0430 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0438 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u044F\u043F\u0440\u0438\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0438 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0438\u043F\u043E\u043B\u043E\u0441\u044B\u0440\u0435\u0433\u0443\u043B\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0444\u043E\u0440\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u0433\u0430\u043D\u0442\u0430 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043E\u0431\u044B\u0447\u043D\u043E\u0439\u0433\u0440\u0443\u043F\u043F\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0444\u0438\u0433\u0443\u0440\u044B\u043A\u043D\u043E\u043F\u043A\u0438 \u043F\u0430\u043B\u0438\u0442\u0440\u0430\u0446\u0432\u0435\u0442\u043E\u0432\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435\u043E\u0431\u044B\u0447\u043D\u043E\u0439\u0433\u0440\u0443\u043F\u043F\u044B \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0434\u0435\u043D\u0434\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u0433\u0430\u043D\u0442\u0430 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043F\u043E\u0438\u0441\u043A\u0432\u0442\u0430\u0431\u043B\u0438\u0446\u0435\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0444\u043E\u0440\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438\u043A\u043D\u043E\u043F\u043A\u0438\u0444\u043E\u0440\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043A\u043E\u043C\u0430\u043D\u0434\u043D\u043E\u0439\u043F\u0430\u043D\u0435\u043B\u0438\u0444\u043E\u0440\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043A\u043E\u043C\u0430\u043D\u0434\u043D\u043E\u0439\u043F\u0430\u043D\u0435\u043B\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0444\u043E\u0440\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043E\u043F\u043E\u0440\u043D\u043E\u0439\u0442\u043E\u0447\u043A\u0438\u043E\u0442\u0440\u0438\u0441\u043E\u0432\u043A\u0438 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u0434\u043F\u0438\u0441\u0435\u0439\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0435 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u0434\u043F\u0438\u0441\u0435\u0439\u0448\u043A\u0430\u043B\u044B\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u0438\u0437\u043C\u0435\u0440\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u044F\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0441\u0442\u0440\u043E\u043A\u0438\u043F\u043E\u0438\u0441\u043A\u0430 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430\u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0439\u043B\u0438\u043D\u0438\u0438 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043F\u043E\u0438\u0441\u043A\u043E\u043C \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0448\u043A\u0430\u043B\u044B\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u043F\u043E\u0440\u044F\u0434\u043E\u043A\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0442\u043E\u0447\u0435\u043A\u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0439\u0433\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u043F\u043E\u0440\u044F\u0434\u043E\u043A\u0441\u0435\u0440\u0438\u0439\u0432\u043B\u0435\u0433\u0435\u043D\u0434\u0435\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0440\u0430\u0437\u043C\u0435\u0440\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u0448\u043A\u0430\u043B\u044B\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0440\u0430\u0441\u0442\u044F\u0433\u0438\u0432\u0430\u043D\u0438\u0435\u043F\u043E\u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u0438\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u0433\u0430\u043D\u0442\u0430 \u0440\u0435\u0436\u0438\u043C\u0430\u0432\u0442\u043E\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u0432\u0432\u043E\u0434\u0430\u0441\u0442\u0440\u043E\u043A\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0440\u0435\u0436\u0438\u043C\u0432\u044B\u0431\u043E\u0440\u0430\u043D\u0435\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043D\u043E\u0433\u043E \u0440\u0435\u0436\u0438\u043C\u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0434\u0430\u0442\u044B \u0440\u0435\u0436\u0438\u043C\u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0441\u0442\u0440\u043E\u043A\u0438\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0440\u0435\u0436\u0438\u043C\u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0440\u0435\u0436\u0438\u043C\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u0440\u0430\u0437\u043C\u0435\u0440\u0430 \u0440\u0435\u0436\u0438\u043C\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u0441\u0432\u044F\u0437\u0430\u043D\u043D\u043E\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0434\u0438\u0430\u043B\u043E\u0433\u0430\u043F\u0435\u0447\u0430\u0442\u0438 \u0440\u0435\u0436\u0438\u043C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043A\u043E\u043C\u0430\u043D\u0434\u044B \u0440\u0435\u0436\u0438\u043C\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0440\u0435\u0436\u0438\u043C\u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E\u043E\u043A\u043D\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F\u043E\u043A\u043D\u0430\u0444\u043E\u0440\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u0441\u0435\u0440\u0438\u0438 \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u0440\u0438\u0441\u043E\u0432\u043A\u0438\u0441\u0435\u0442\u043A\u0438\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u043F\u043E\u043B\u0443\u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u0438\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u043F\u0440\u043E\u0431\u0435\u043B\u043E\u0432\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u043D\u0430\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435 \u0440\u0435\u0436\u0438\u043C\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u043A\u043E\u043B\u043E\u043D\u043A\u0438 \u0440\u0435\u0436\u0438\u043C\u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u044F\u0438\u043D\u0434\u0438\u043A\u0430\u0442\u043E\u0440\u0430 \u0440\u0435\u0436\u0438\u043C\u0441\u043F\u0438\u0441\u043A\u0430\u0437\u0430\u0434\u0430\u0447 \u0441\u043A\u0432\u043E\u0437\u043D\u043E\u0435\u0432\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445\u0444\u043E\u0440\u043C\u044B\u0432\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u0441\u043F\u043E\u0441\u043E\u0431\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u0442\u0435\u043A\u0441\u0442\u0430\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u0448\u043A\u0430\u043B\u044B\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0438\u0432\u0430\u044E\u0449\u0435\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u0430\u044F\u0433\u0440\u0443\u043F\u043F\u0430\u043A\u043E\u043C\u0430\u043D\u0434 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0435\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0441\u0442\u0438\u043B\u044C\u0441\u0442\u0440\u0435\u043B\u043A\u0438 \u0442\u0438\u043F\u0430\u043F\u043F\u0440\u043E\u043A\u0441\u0438\u043C\u0430\u0446\u0438\u0438\u043B\u0438\u043D\u0438\u0438\u0442\u0440\u0435\u043D\u0434\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u0435\u0434\u0438\u043D\u0438\u0446\u044B\u0448\u043A\u0430\u043B\u044B\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0442\u0438\u043F\u0438\u043C\u043F\u043E\u0440\u0442\u0430\u0441\u0435\u0440\u0438\u0439\u0441\u043B\u043E\u044F\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043B\u0438\u043D\u0438\u0438\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043B\u0438\u043D\u0438\u0438\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u043C\u0430\u0440\u043A\u0435\u0440\u0430\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043C\u0430\u0440\u043A\u0435\u0440\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u043E\u0431\u043B\u0430\u0441\u0442\u0438\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0442\u0438\u043F\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0441\u0435\u0440\u0438\u0438\u0441\u043B\u043E\u044F\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0442\u043E\u0447\u0435\u0447\u043D\u043E\u0433\u043E\u043E\u0431\u044A\u0435\u043A\u0442\u0430\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0448\u043A\u0430\u043B\u044B\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043B\u0435\u0433\u0435\u043D\u0434\u044B\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043F\u043E\u0438\u0441\u043A\u0430\u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043F\u0440\u043E\u0435\u043A\u0446\u0438\u0438\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0438\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u0439 \u0442\u0438\u043F\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u043E\u0432\u0438\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u0439 \u0442\u0438\u043F\u0440\u0430\u043C\u043A\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0442\u0438\u043F\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u0441\u0432\u044F\u0437\u0438\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u0433\u0430\u043D\u0442\u0430 \u0442\u0438\u043F\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u043F\u043E\u0441\u0435\u0440\u0438\u044F\u043C\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0442\u043E\u0447\u0435\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0439\u043B\u0438\u043D\u0438\u0438 \u0442\u0438\u043F\u0441\u0442\u043E\u0440\u043E\u043D\u044B\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u0444\u043E\u0440\u043C\u044B\u043E\u0442\u0447\u0435\u0442\u0430 \u0442\u0438\u043F\u0448\u043A\u0430\u043B\u044B\u0440\u0430\u0434\u0430\u0440\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0444\u0430\u043A\u0442\u043E\u0440\u043B\u0438\u043D\u0438\u0438\u0442\u0440\u0435\u043D\u0434\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0444\u0438\u0433\u0443\u0440\u0430\u043A\u043D\u043E\u043F\u043A\u0438 \u0444\u0438\u0433\u0443\u0440\u044B\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0444\u0438\u043A\u0441\u0430\u0446\u0438\u044F\u0432\u0442\u0430\u0431\u043B\u0438\u0446\u0435 \u0444\u043E\u0440\u043C\u0430\u0442\u0434\u043D\u044F\u0448\u043A\u0430\u043B\u044B\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0444\u043E\u0440\u043C\u0430\u0442\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0448\u0438\u0440\u0438\u043D\u0430\u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u043D\u044B\u0445\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u0444\u043E\u0440\u043C\u044B ",g="\u0432\u0438\u0434\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u044F\u0431\u0443\u0445\u0433\u0430\u043B\u0442\u0435\u0440\u0438\u0438 \u0432\u0438\u0434\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u044F\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0432\u0438\u0434\u0441\u0447\u0435\u0442\u0430 \u0432\u0438\u0434\u0442\u043E\u0447\u043A\u0438\u043C\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u0431\u0438\u0437\u043D\u0435\u0441\u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0430\u0433\u0440\u0435\u0433\u0430\u0442\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0433\u0440\u0443\u043F\u043F\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0435\u0436\u0438\u043C\u0430\u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0441\u0440\u0435\u0437\u0430 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u0430\u0433\u0440\u0435\u0433\u0430\u0442\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u0430\u0432\u0442\u043E\u0432\u0440\u0435\u043C\u044F \u0440\u0435\u0436\u0438\u043C\u0437\u0430\u043F\u0438\u0441\u0438\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0440\u0435\u0436\u0438\u043C\u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 ",A="\u0430\u0432\u0442\u043E\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0439\u043D\u043E\u043C\u0435\u0440\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0430\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0434\u0430\u043D\u043D\u044B\u0445 ",y="\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0438\u0442\u043E\u0433\u043E\u0432\u043A\u043E\u043B\u043E\u043D\u043E\u043A\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0438\u0442\u043E\u0433\u043E\u0432\u0441\u0442\u0440\u043E\u043A\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430\u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0441\u043F\u043E\u0441\u043E\u0431\u0447\u0442\u0435\u043D\u0438\u044F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u0434\u0432\u0443\u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0435\u0439\u043F\u0435\u0447\u0430\u0442\u0438 \u0442\u0438\u043F\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u043E\u0431\u043B\u0430\u0441\u0442\u0438\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043A\u0443\u0440\u0441\u043E\u0440\u043E\u0432\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043B\u0438\u043D\u0438\u0438\u0440\u0438\u0441\u0443\u043D\u043A\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043B\u0438\u043D\u0438\u0438\u044F\u0447\u0435\u0439\u043A\u0438\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043B\u0438\u043D\u0438\u0439\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0442\u0438\u043F\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0442\u0435\u043A\u0441\u0442\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u0440\u0438\u0441\u0443\u043D\u043A\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u0441\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u0443\u0437\u043E\u0440\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u0444\u0430\u0439\u043B\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u043E\u0447\u043D\u043E\u0441\u0442\u044C\u043F\u0435\u0447\u0430\u0442\u0438 \u0447\u0435\u0440\u0435\u0434\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u044F\u0441\u0442\u0440\u0430\u043D\u0438\u0446 ",b="\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0432\u0440\u0435\u043C\u0435\u043D\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u043F\u043B\u0430\u043D\u0438\u0440\u043E\u0432\u0449\u0438\u043A\u0430 ",S="\u0442\u0438\u043F\u0444\u0430\u0439\u043B\u0430\u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 ",C="\u043E\u0431\u0445\u043E\u0434\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u0437\u0430\u043F\u0438\u0441\u0438\u0437\u0430\u043F\u0440\u043E\u0441\u0430 ",I="\u0432\u0438\u0434\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044F\u043E\u0442\u0447\u0435\u0442\u0430 \u0442\u0438\u043F\u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0439 \u0442\u0438\u043F\u0438\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u044F\u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044F\u043E\u0442\u0447\u0435\u0442\u0430 \u0442\u0438\u043F\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0438\u0442\u043E\u0433\u043E\u0432 ",x="\u0434\u043E\u0441\u0442\u0443\u043F\u043A\u0444\u0430\u0439\u043B\u0443 \u0440\u0435\u0436\u0438\u043C\u0434\u0438\u0430\u043B\u043E\u0433\u0430\u0432\u044B\u0431\u043E\u0440\u0430\u0444\u0430\u0439\u043B\u0430 \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F\u0444\u0430\u0439\u043B\u0430 ",w="\u0442\u0438\u043F\u0438\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u044F\u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044F\u0437\u0430\u043F\u0440\u043E\u0441\u0430 ",R="\u0432\u0438\u0434\u0434\u0430\u043D\u043D\u044B\u0445\u0430\u043D\u0430\u043B\u0438\u0437\u0430 \u043C\u0435\u0442\u043E\u0434\u043A\u043B\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0438\u043F\u0435\u0434\u0438\u043D\u0438\u0446\u044B\u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B\u0430\u0432\u0440\u0435\u043C\u0435\u043D\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u0442\u0430\u0431\u043B\u0438\u0446\u044B\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0447\u0438\u0441\u043B\u043E\u0432\u044B\u0445\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u0438\u0441\u043A\u0430\u0430\u0441\u0441\u043E\u0446\u0438\u0430\u0446\u0438\u0439 \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u0434\u0435\u0440\u0435\u0432\u043E\u0440\u0435\u0448\u0435\u043D\u0438\u0439 \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043A\u043B\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044F \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043E\u0431\u0449\u0430\u044F\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u0438\u0441\u043A\u0430\u0441\u0441\u043E\u0446\u0438\u0430\u0446\u0438\u0439 \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u0438\u0441\u043A\u043F\u043E\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0435\u0439 \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u043C\u043E\u0434\u0435\u043B\u0438\u043F\u0440\u043E\u0433\u043D\u043E\u0437\u0430 \u0442\u0438\u043F\u043C\u0435\u0440\u044B\u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u044F\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043E\u0442\u0441\u0435\u0447\u0435\u043D\u0438\u044F\u043F\u0440\u0430\u0432\u0438\u043B\u0430\u0441\u0441\u043E\u0446\u0438\u0430\u0446\u0438\u0438 \u0442\u0438\u043F\u043F\u043E\u043B\u044F\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0443\u043F\u043E\u0440\u044F\u0434\u043E\u0447\u0438\u0432\u0430\u043D\u0438\u044F\u043F\u0440\u0430\u0432\u0438\u043B\u0430\u0441\u0441\u043E\u0446\u0438\u0430\u0446\u0438\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0443\u043F\u043E\u0440\u044F\u0434\u043E\u0447\u0438\u0432\u0430\u043D\u0438\u044F\u0448\u0430\u0431\u043B\u043E\u043D\u043E\u0432\u043F\u043E\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0435\u0439\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0443\u043F\u0440\u043E\u0449\u0435\u043D\u0438\u044F\u0434\u0435\u0440\u0435\u0432\u0430\u0440\u0435\u0448\u0435\u043D\u0438\u0439 ",N="ws\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 \u0432\u0430\u0440\u0438\u0430\u043D\u0442xpathxs \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0437\u0430\u043F\u0438\u0441\u0438\u0434\u0430\u0442\u044Bjson \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043F\u0440\u043E\u0441\u0442\u043E\u0433\u043E\u0442\u0438\u043F\u0430xs \u0432\u0438\u0434\u0433\u0440\u0443\u043F\u043F\u044B\u043C\u043E\u0434\u0435\u043B\u0438xs \u0432\u0438\u0434\u0444\u0430\u0441\u0435\u0442\u0430xdto \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044Fdom \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u043E\u0441\u0442\u044C\u043F\u0440\u043E\u0441\u0442\u043E\u0433\u043E\u0442\u0438\u043F\u0430xs \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u043E\u0441\u0442\u044C\u0441\u043E\u0441\u0442\u0430\u0432\u043D\u043E\u0433\u043E\u0442\u0438\u043F\u0430xs \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u043E\u0441\u0442\u044C\u0441\u0445\u0435\u043C\u044Bxs \u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043D\u044B\u0435\u043F\u043E\u0434\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438xs \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F\u0433\u0440\u0443\u043F\u043F\u043F\u043E\u0434\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438xs \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430xs \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F\u0438\u0434\u0435\u043D\u0442\u0438\u0447\u043D\u043E\u0441\u0442\u0438xs \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F\u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0438\u043C\u0435\u043Dxs \u043C\u0435\u0442\u043E\u0434\u043D\u0430\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u043D\u0438\u044Fxs \u043C\u043E\u0434\u0435\u043B\u044C\u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043Exs \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0442\u0438\u043F\u0430xml \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435\u043F\u043E\u0434\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438xs \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u043F\u0440\u043E\u0431\u0435\u043B\u044C\u043D\u044B\u0445\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432xs \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043Exs \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fxs \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u043E\u0442\u0431\u043E\u0440\u0430\u0443\u0437\u043B\u043E\u0432dom \u043F\u0435\u0440\u0435\u043D\u043E\u0441\u0441\u0442\u0440\u043E\u043Ajson \u043F\u043E\u0437\u0438\u0446\u0438\u044F\u0432\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0435dom \u043F\u0440\u043E\u0431\u0435\u043B\u044C\u043D\u044B\u0435\u0441\u0438\u043C\u0432\u043E\u043B\u044Bxml \u0442\u0438\u043F\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430xml \u0442\u0438\u043F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fjson \u0442\u0438\u043F\u043A\u0430\u043D\u043E\u043D\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043Exml \u0442\u0438\u043F\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u044Bxs \u0442\u0438\u043F\u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438xml \u0442\u0438\u043F\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430domxpath \u0442\u0438\u043F\u0443\u0437\u043B\u0430dom \u0442\u0438\u043F\u0443\u0437\u043B\u0430xml \u0444\u043E\u0440\u043C\u0430xml \u0444\u043E\u0440\u043C\u0430\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u044Fxs \u0444\u043E\u0440\u043C\u0430\u0442\u0434\u0430\u0442\u044Bjson \u044D\u043A\u0440\u0430\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432json ",P="\u0432\u0438\u0434\u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0432\u043B\u043E\u0436\u0435\u043D\u043D\u044B\u0445\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0438\u0442\u043E\u0433\u043E\u0432\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u043B\u0435\u0439\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u043B\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u043E\u0432\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0432\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0431\u0443\u0445\u0433\u0430\u043B\u0442\u0435\u0440\u0441\u043A\u043E\u0433\u043E\u043E\u0441\u0442\u0430\u0442\u043A\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0432\u044B\u0432\u043E\u0434\u0430\u0442\u0435\u043A\u0441\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0433\u0440\u0443\u043F\u043F\u044B\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u043E\u0442\u0431\u043E\u0440\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0434\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u043F\u043E\u043B\u0435\u0439\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043C\u0430\u043A\u0435\u0442\u0430\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043C\u0430\u043A\u0435\u0442\u0430\u043E\u0431\u043B\u0430\u0441\u0442\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043E\u0441\u0442\u0430\u0442\u043A\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0442\u0435\u043A\u0441\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0441\u0432\u044F\u0437\u0438\u043D\u0430\u0431\u043E\u0440\u043E\u0432\u0434\u0430\u043D\u043D\u044B\u0445\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043B\u0435\u0433\u0435\u043D\u0434\u044B\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043F\u0440\u0438\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u043E\u0442\u0431\u043E\u0440\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043F\u043E\u0441\u043E\u0431\u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0435\u0436\u0438\u043C\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0430\u0432\u0442\u043E\u043F\u043E\u0437\u0438\u0446\u0438\u044F\u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0432\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0432\u0432\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0435\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0444\u0438\u043A\u0441\u0430\u0446\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0443\u0441\u043B\u043E\u0432\u043D\u043E\u0433\u043E\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 ",G="\u0432\u0430\u0436\u043D\u043E\u0441\u0442\u044C\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u0442\u0435\u043A\u0441\u0442\u0430\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0441\u043F\u043E\u0441\u043E\u0431\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0432\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0441\u043F\u043E\u0441\u043E\u0431\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u043D\u0435ascii\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0442\u0438\u043F\u0442\u0435\u043A\u0441\u0442\u0430\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u044B \u0441\u0442\u0430\u0442\u0443\u0441\u0440\u0430\u0437\u0431\u043E\u0440\u0430\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F ",$="\u0440\u0435\u0436\u0438\u043C\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438\u0437\u0430\u043F\u0438\u0441\u0438\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438\u0437\u0430\u043F\u0438\u0441\u0438\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0440\u043E\u0432\u0435\u043D\u044C\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 ",Q="\u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0432\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u0440\u0435\u0436\u0438\u043C\u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0432\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u0440\u0435\u0436\u0438\u043C\u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u0430\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u0442\u0438\u043F\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0432\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 ",H="\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430\u0438\u043C\u0435\u043D\u0444\u0430\u0439\u043B\u043E\u0432\u0432zip\u0444\u0430\u0439\u043B\u0435 \u043C\u0435\u0442\u043E\u0434\u0441\u0436\u0430\u0442\u0438\u044Fzip \u043C\u0435\u0442\u043E\u0434\u0448\u0438\u0444\u0440\u043E\u0432\u0430\u043D\u0438\u044Fzip \u0440\u0435\u0436\u0438\u043C\u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F\u043F\u0443\u0442\u0435\u0439\u0444\u0430\u0439\u043B\u043E\u0432zip \u0440\u0435\u0436\u0438\u043C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438\u043F\u043E\u0434\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u043E\u0432zip \u0440\u0435\u0436\u0438\u043C\u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F\u043F\u0443\u0442\u0435\u0439zip \u0443\u0440\u043E\u0432\u0435\u043D\u044C\u0441\u0436\u0430\u0442\u0438\u044Fzip ",oe="\u0437\u0432\u0443\u043A\u043E\u0432\u043E\u0435\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0430\u043A\u0441\u0442\u0440\u043E\u043A\u0435 \u043F\u043E\u0437\u0438\u0446\u0438\u044F\u0432\u043F\u043E\u0442\u043E\u043A\u0435 \u043F\u043E\u0440\u044F\u0434\u043E\u043A\u0431\u0430\u0439\u0442\u043E\u0432 \u0440\u0435\u0436\u0438\u043C\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0435\u0436\u0438\u043C\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u043E\u0439\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u044B\u0445\u043F\u043E\u043A\u0443\u043F\u043E\u043A \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435\u0444\u043E\u043D\u043E\u0432\u043E\u0433\u043E\u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0442\u0438\u043F\u043F\u043E\u0434\u043F\u0438\u0441\u0447\u0438\u043A\u0430\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u043C\u044B\u0445\u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0439 \u0443\u0440\u043E\u0432\u0435\u043D\u044C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0437\u0430\u0449\u0438\u0449\u0435\u043D\u043D\u043E\u0433\u043E\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044Fftp ",re="\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u043E\u0440\u044F\u0434\u043A\u0430\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u0434\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u043C\u0438\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u043E\u0439\u0442\u043E\u0447\u043A\u0438\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E\u0439\u0442\u0430\u0431\u043B\u0438\u0446\u044B\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 ",Z="http\u043C\u0435\u0442\u043E\u0434 \u0430\u0432\u0442\u043E\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0430\u0432\u0442\u043E\u043F\u0440\u0435\u0444\u0438\u043A\u0441\u043D\u043E\u043C\u0435\u0440\u0430\u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u043E\u0433\u043E\u044F\u0437\u044B\u043A\u0430 \u0432\u0438\u0434\u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0432\u0438\u0434\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0442\u0430\u0431\u043B\u0438\u0446\u044B\u0432\u043D\u0435\u0448\u043D\u0435\u0433\u043E\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u043F\u0438\u0441\u044C\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u0439\u043F\u0440\u0438\u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435\u043F\u043E\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0435\u0439 \u0438\u043D\u0434\u0435\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0431\u0430\u0437\u044B\u043F\u043B\u0430\u043D\u0430\u0432\u0438\u0434\u043E\u0432\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0431\u044B\u0441\u0442\u0440\u043E\u0433\u043E\u0432\u044B\u0431\u043E\u0440\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E\u043F\u043E\u0438\u0441\u043A\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0430\u0437\u0434\u0435\u043B\u044F\u0435\u043C\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\u043E\u0435\u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0432\u0438\u0434\u0430\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0432\u0438\u0434\u0430\u0445\u0430\u0440\u0430\u043A\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043A\u0438 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0437\u0430\u0434\u0430\u0447\u0438 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u043B\u0430\u043D\u0430\u043E\u0431\u043C\u0435\u043D\u0430 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0441\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A\u0430 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0441\u0447\u0435\u0442\u0430 \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u0433\u0440\u0430\u043D\u0438\u0446\u044B\u043F\u0440\u0438\u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u043D\u043E\u043C\u0435\u0440\u0430\u0431\u0438\u0437\u043D\u0435\u0441\u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u043D\u043E\u043C\u0435\u0440\u0430\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0441\u0432\u0435\u0434\u0435\u043D\u0438\u0439 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0435\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043C\u044B\u0445\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0439\u043F\u043E\u0438\u0441\u043A\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435\u043F\u043E\u0441\u0442\u0440\u043E\u043A\u0435 \u043F\u0440\u0438\u043D\u0430\u0434\u043B\u0435\u0436\u043D\u043E\u0441\u0442\u044C\u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0430\u0443\u0442\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u0438\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0439\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0440\u0435\u0436\u0438\u043C\u0430\u0432\u0442\u043E\u043D\u0443\u043C\u0435\u0440\u0430\u0446\u0438\u0438\u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0440\u0435\u0436\u0438\u043C\u0437\u0430\u043F\u0438\u0441\u0438\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0440\u0435\u0436\u0438\u043C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438 \u0440\u0435\u0436\u0438\u043C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u0438\u043D\u0445\u0440\u043E\u043D\u043D\u044B\u0445\u0432\u044B\u0437\u043E\u0432\u043E\u0432\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0439\u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u044B\u0438\u0432\u043D\u0435\u0448\u043D\u0438\u0445\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442 \u0440\u0435\u0436\u0438\u043C\u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0433\u043E\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u0435\u0430\u043D\u0441\u043E\u0432 \u0440\u0435\u0436\u0438\u043C\u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F\u0434\u0430\u043D\u043D\u044B\u0445\u0432\u044B\u0431\u043E\u0440\u0430\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435\u043F\u043E\u0441\u0442\u0440\u043E\u043A\u0435 \u0440\u0435\u0436\u0438\u043C\u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u043E\u0441\u0442\u0438 \u0440\u0435\u0436\u0438\u043C\u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u043E\u0441\u0442\u0438\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0440\u0435\u0436\u0438\u043C\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u043E\u0439\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u0441\u0435\u0440\u0438\u0438\u043A\u043E\u0434\u043E\u0432\u043F\u043B\u0430\u043D\u0430\u0432\u0438\u0434\u043E\u0432\u0445\u0430\u0440\u0430\u043A\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043A \u0441\u0435\u0440\u0438\u0438\u043A\u043E\u0434\u043E\u0432\u043F\u043B\u0430\u043D\u0430\u0441\u0447\u0435\u0442\u043E\u0432 \u0441\u0435\u0440\u0438\u0438\u043A\u043E\u0434\u043E\u0432\u0441\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435 \u0441\u043F\u043E\u0441\u043E\u0431\u0432\u044B\u0431\u043E\u0440\u0430 \u0441\u043F\u043E\u0441\u043E\u0431\u043F\u043E\u0438\u0441\u043A\u0430\u0441\u0442\u0440\u043E\u043A\u0438\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435\u043F\u043E\u0441\u0442\u0440\u043E\u043A\u0435 \u0441\u043F\u043E\u0441\u043E\u0431\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u0438\u043F\u0434\u0430\u043D\u043D\u044B\u0445\u0442\u0430\u0431\u043B\u0438\u0446\u044B\u0432\u043D\u0435\u0448\u043D\u0435\u0433\u043E\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043A\u043E\u0434\u0430\u043F\u043B\u0430\u043D\u0430\u0432\u0438\u0434\u043E\u0432\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0442\u0438\u043F\u043A\u043E\u0434\u0430\u0441\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A\u0430 \u0442\u0438\u043F\u043C\u0430\u043A\u0435\u0442\u0430 \u0442\u0438\u043F\u043D\u043E\u043C\u0435\u0440\u0430\u0431\u0438\u0437\u043D\u0435\u0441\u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430 \u0442\u0438\u043F\u043D\u043E\u043C\u0435\u0440\u0430\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043D\u043E\u043C\u0435\u0440\u0430\u0437\u0430\u0434\u0430\u0447\u0438 \u0442\u0438\u043F\u0444\u043E\u0440\u043C\u044B \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0435\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u0439 ",q="\u0432\u0430\u0436\u043D\u043E\u0441\u0442\u044C\u043F\u0440\u043E\u0431\u043B\u0435\u043C\u044B\u043F\u0440\u0438\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0444\u043E\u0440\u043C\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E\u0448\u0440\u0438\u0444\u0442\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u043F\u0435\u0440\u0438\u043E\u0434\u0430 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0439\u0434\u0430\u0442\u044B\u043D\u0430\u0447\u0430\u043B\u0430 \u0432\u0438\u0434\u0433\u0440\u0430\u043D\u0438\u0446\u044B \u0432\u0438\u0434\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0432\u0438\u0434\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E\u043F\u043E\u0438\u0441\u043A\u0430 \u0432\u0438\u0434\u0440\u0430\u043C\u043A\u0438 \u0432\u0438\u0434\u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0446\u0432\u0435\u0442\u0430 \u0432\u0438\u0434\u0447\u0438\u0441\u043B\u043E\u0432\u043E\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0448\u0440\u0438\u0444\u0442\u0430 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u0430\u044F\u0434\u043B\u0438\u043D\u0430 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0439\u0437\u043D\u0430\u043A \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435byteordermark \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043C\u0435\u0442\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E\u043F\u043E\u0438\u0441\u043A\u0430 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0439\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043A\u043B\u0430\u0432\u0438\u0448\u0430 \u043A\u043E\u0434\u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0430\u0434\u0438\u0430\u043B\u043E\u0433\u0430 \u043A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430xbase \u043A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430\u0442\u0435\u043A\u0441\u0442\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u043E\u0438\u0441\u043A\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0438\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043F\u0430\u043D\u0435\u043B\u0438\u0440\u0430\u0437\u0434\u0435\u043B\u043E\u0432 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u0434\u0438\u0430\u043B\u043E\u0433\u0430\u0432\u043E\u043F\u0440\u043E\u0441 \u0440\u0435\u0436\u0438\u043C\u0437\u0430\u043F\u0443\u0441\u043A\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u043E\u043A\u0440\u0443\u0433\u043B\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F\u0444\u043E\u0440\u043C\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E\u043F\u043E\u0438\u0441\u043A\u0430 \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435\u0432\u043D\u0435\u0448\u043D\u0435\u0433\u043E\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u0431\u0430\u0437\u044B\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043F\u043E\u0441\u043E\u0431\u0432\u044B\u0431\u043E\u0440\u0430\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u0430windows \u0441\u043F\u043E\u0441\u043E\u0431\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u0442\u0440\u043E\u043A\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0442\u0438\u043F\u0432\u043D\u0435\u0448\u043D\u0435\u0439\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u044B \u0442\u0438\u043F\u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u044B \u0442\u0438\u043F\u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F\u043A\u043B\u0430\u0432\u0438\u0448\u0438enter \u0442\u0438\u043F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0438\u043E\u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0438\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u0431\u0430\u0437\u044B\u0434\u0430\u043D\u043D\u044B\u0445 \u0443\u0440\u043E\u0432\u0435\u043D\u044C\u0438\u0437\u043E\u043B\u044F\u0446\u0438\u0438\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0439 \u0445\u0435\u0448\u0444\u0443\u043D\u043A\u0446\u0438\u044F \u0447\u0430\u0441\u0442\u0438\u0434\u0430\u0442\u044B",ce=m+f+g+A+y+b+S+C+I+x+w+R+N+P+G+$+Q+H+oe+re+Z+q,be="com\u043E\u0431\u044A\u0435\u043A\u0442 ftp\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 http\u0437\u0430\u043F\u0440\u043E\u0441 http\u0441\u0435\u0440\u0432\u0438\u0441\u043E\u0442\u0432\u0435\u0442 http\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 ws\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044F ws\u043F\u0440\u043E\u043A\u0441\u0438 xbase \u0430\u043D\u0430\u043B\u0438\u0437\u0434\u0430\u043D\u043D\u044B\u0445 \u0430\u043D\u043D\u043E\u0442\u0430\u0446\u0438\u044Fxs \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0431\u0443\u0444\u0435\u0440\u0434\u0432\u043E\u0438\u0447\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445 \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435xs \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0433\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440\u0441\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u0445\u0447\u0438\u0441\u0435\u043B \u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u0430\u044F\u0441\u0445\u0435\u043C\u0430 \u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u0438\u0435\u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u0430\u044F\u0441\u0445\u0435\u043C\u0430 \u0433\u0440\u0443\u043F\u043F\u0430\u043C\u043E\u0434\u0435\u043B\u0438xs \u0434\u0430\u043D\u043D\u044B\u0435\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0434\u0432\u043E\u0438\u0447\u043D\u044B\u0435\u0434\u0430\u043D\u043D\u044B\u0435 \u0434\u0435\u043D\u0434\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430\u0433\u0430\u043D\u0442\u0430 \u0434\u0438\u0430\u043B\u043E\u0433\u0432\u044B\u0431\u043E\u0440\u0430\u0444\u0430\u0439\u043B\u0430 \u0434\u0438\u0430\u043B\u043E\u0433\u0432\u044B\u0431\u043E\u0440\u0430\u0446\u0432\u0435\u0442\u0430 \u0434\u0438\u0430\u043B\u043E\u0433\u0432\u044B\u0431\u043E\u0440\u0430\u0448\u0440\u0438\u0444\u0442\u0430 \u0434\u0438\u0430\u043B\u043E\u0433\u0440\u0430\u0441\u043F\u0438\u0441\u0430\u043D\u0438\u044F\u0440\u0435\u0433\u043B\u0430\u043C\u0435\u043D\u0442\u043D\u043E\u0433\u043E\u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0434\u0438\u0430\u043B\u043E\u0433\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u043F\u0435\u0440\u0438\u043E\u0434\u0430 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442dom \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442html \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044Fxs \u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u043C\u043E\u0435\u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u043F\u0438\u0441\u044Cdom \u0437\u0430\u043F\u0438\u0441\u044Cfastinfoset \u0437\u0430\u043F\u0438\u0441\u044Chtml \u0437\u0430\u043F\u0438\u0441\u044Cjson \u0437\u0430\u043F\u0438\u0441\u044Cxml \u0437\u0430\u043F\u0438\u0441\u044Czip\u0444\u0430\u0439\u043B\u0430 \u0437\u0430\u043F\u0438\u0441\u044C\u0434\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u043F\u0438\u0441\u044C\u0442\u0435\u043A\u0441\u0442\u0430 \u0437\u0430\u043F\u0438\u0441\u044C\u0443\u0437\u043B\u043E\u0432dom \u0437\u0430\u043F\u0440\u043E\u0441 \u0437\u0430\u0449\u0438\u0449\u0435\u043D\u043D\u043E\u0435\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435openssl \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u043F\u043E\u043B\u0435\u0439\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0438\u0437\u0432\u043B\u0435\u0447\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430 \u0438\u043C\u043F\u043E\u0440\u0442xs \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u0430 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0435\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u044B\u0439\u043F\u0440\u043E\u0444\u0438\u043B\u044C \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u0440\u043E\u043A\u0441\u0438 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F\u0434\u043B\u044F\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044Fxs \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430xs \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0438\u0442\u0435\u0440\u0430\u0442\u043E\u0440\u0443\u0437\u043B\u043E\u0432dom \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \u043A\u0432\u0430\u043B\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B\u0434\u0430\u0442\u044B \u043A\u0432\u0430\u043B\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B\u0434\u0432\u043E\u0438\u0447\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u0432\u0430\u043B\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B\u0441\u0442\u0440\u043E\u043A\u0438 \u043A\u0432\u0430\u043B\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B\u0447\u0438\u0441\u043B\u0430 \u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u0449\u0438\u043A\u043C\u0430\u043A\u0435\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u0449\u0438\u043A\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440\u043C\u0430\u043A\u0435\u0442\u0430\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440\u0444\u043E\u0440\u043C\u0430\u0442\u043D\u043E\u0439\u0441\u0442\u0440\u043E\u043A\u0438 \u043B\u0438\u043D\u0438\u044F \u043C\u0430\u043A\u0435\u0442\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043C\u0430\u043A\u0435\u0442\u043E\u0431\u043B\u0430\u0441\u0442\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043C\u0430\u043A\u0435\u0442\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043C\u0430\u0441\u043A\u0430xs \u043C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u043D\u0430\u0431\u043E\u0440\u0441\u0445\u0435\u043Cxml \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u0441\u0435\u0440\u0438\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438json \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u0431\u0445\u043E\u0434\u0434\u0435\u0440\u0435\u0432\u0430dom \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430xs \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435\u043D\u043E\u0442\u0430\u0446\u0438\u0438xs \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430xs \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u0434\u043E\u0441\u0442\u0443\u043F\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u043E\u0442\u043A\u0430\u0437\u0432\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u043F\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043C\u043E\u0433\u043E\u0444\u0430\u0439\u043B\u0430 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u0442\u0438\u043F\u043E\u0432 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0433\u0440\u0443\u043F\u043F\u044B\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u0432xs \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0433\u0440\u0443\u043F\u043F\u044B\u043C\u043E\u0434\u0435\u043B\u0438xs \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F\u0438\u0434\u0435\u043D\u0442\u0438\u0447\u043D\u043E\u0441\u0442\u0438xs \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u043E\u0441\u0442\u043E\u0433\u043E\u0442\u0438\u043F\u0430xs \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0441\u043E\u0441\u0442\u0430\u0432\u043D\u043E\u0433\u043E\u0442\u0438\u043F\u0430xs \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0442\u0438\u043F\u0430\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430dom \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044Fxpathxs \u043E\u0442\u0431\u043E\u0440\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u0430\u043A\u0435\u0442\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u043C\u044B\u0445\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0432\u044B\u0431\u043E\u0440\u0430 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0437\u0430\u043F\u0438\u0441\u0438json \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0437\u0430\u043F\u0438\u0441\u0438xml \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0447\u0442\u0435\u043D\u0438\u044Fxml \u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435xs \u043F\u043B\u0430\u043D\u0438\u0440\u043E\u0432\u0449\u0438\u043A \u043F\u043E\u043B\u0435\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u043B\u0435\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044Cdom \u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044C\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044C\u043E\u0442\u0447\u0435\u0442\u0430 \u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044C\u043E\u0442\u0447\u0435\u0442\u0430\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044C\u0441\u0445\u0435\u043Cxml \u043F\u043E\u0442\u043E\u043A \u043F\u043E\u0442\u043E\u043A\u0432\u043F\u0430\u043C\u044F\u0442\u0438 \u043F\u043E\u0447\u0442\u0430 \u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0435\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u043F\u0440\u0435\u043E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u043D\u0438\u0435xsl \u043F\u0440\u0435\u043E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043A\u043A\u0430\u043D\u043E\u043D\u0438\u0447\u0435\u0441\u043A\u043E\u043C\u0443xml \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0432\u044B\u0432\u043E\u0434\u0430\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445\u0432\u043A\u043E\u043B\u043B\u0435\u043A\u0446\u0438\u044E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0432\u044B\u0432\u043E\u0434\u0430\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445\u0432\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u044B\u0439\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0437\u044B\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0438\u043C\u0435\u043Ddom \u0440\u0430\u043C\u043A\u0430 \u0440\u0430\u0441\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u0440\u0435\u0433\u043B\u0430\u043C\u0435\u043D\u0442\u043D\u043E\u0433\u043E\u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u043E\u0435\u0438\u043C\u044Fxml \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0447\u0442\u0435\u043D\u0438\u044F\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u0432\u043E\u0434\u043D\u0430\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430 \u0441\u0432\u044F\u0437\u044C\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u0432\u044B\u0431\u043E\u0440\u0430 \u0441\u0432\u044F\u0437\u044C\u043F\u043E\u0442\u0438\u043F\u0443 \u0441\u0432\u044F\u0437\u044C\u043F\u043E\u0442\u0438\u043F\u0443\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0440\u0438\u0430\u043B\u0438\u0437\u0430\u0442\u043E\u0440xdto \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043A\u043B\u0438\u0435\u043D\u0442\u0430windows \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u0444\u0430\u0439\u043B \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u044B\u0443\u0434\u043E\u0441\u0442\u043E\u0432\u0435\u0440\u044F\u044E\u0449\u0438\u0445\u0446\u0435\u043D\u0442\u0440\u043E\u0432windows \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u044B\u0443\u0434\u043E\u0441\u0442\u043E\u0432\u0435\u0440\u044F\u044E\u0449\u0438\u0445\u0446\u0435\u043D\u0442\u0440\u043E\u0432\u0444\u0430\u0439\u043B \u0441\u0436\u0430\u0442\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u0438\u0441\u0442\u0435\u043C\u043D\u0430\u044F\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044E \u0441\u043E\u0447\u0435\u0442\u0430\u043D\u0438\u0435\u043A\u043B\u0430\u0432\u0438\u0448 \u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u0430\u044F\u0434\u0430\u0442\u0430\u043D\u0430\u0447\u0430\u043B\u0430 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u044B\u0439\u043F\u0435\u0440\u0438\u043E\u0434 \u0441\u0445\u0435\u043C\u0430xml \u0441\u0445\u0435\u043C\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0430\u0431\u043B\u0438\u0447\u043D\u044B\u0439\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0439\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043C\u043E\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0442\u0438\u043F\u0434\u0430\u043D\u043D\u044B\u0445xml \u0443\u043D\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u0439\u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0431\u0440\u0438\u043A\u0430xdto \u0444\u0430\u0439\u043B \u0444\u0430\u0439\u043B\u043E\u0432\u044B\u0439\u043F\u043E\u0442\u043E\u043A \u0444\u0430\u0441\u0435\u0442\u0434\u043B\u0438\u043D\u044Bxs \u0444\u0430\u0441\u0435\u0442\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\u0440\u0430\u0437\u0440\u044F\u0434\u043E\u0432\u0434\u0440\u043E\u0431\u043D\u043E\u0439\u0447\u0430\u0441\u0442\u0438xs \u0444\u0430\u0441\u0435\u0442\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0433\u043E\u0432\u043A\u043B\u044E\u0447\u0430\u044E\u0449\u0435\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fxs \u0444\u0430\u0441\u0435\u0442\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0433\u043E\u0438\u0441\u043A\u043B\u044E\u0447\u0430\u044E\u0449\u0435\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fxs \u0444\u0430\u0441\u0435\u0442\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0439\u0434\u043B\u0438\u043D\u044Bxs \u0444\u0430\u0441\u0435\u0442\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0433\u043E\u0432\u043A\u043B\u044E\u0447\u0430\u044E\u0449\u0435\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fxs \u0444\u0430\u0441\u0435\u0442\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0433\u043E\u0438\u0441\u043A\u043B\u044E\u0447\u0430\u044E\u0449\u0435\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fxs \u0444\u0430\u0441\u0435\u0442\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0439\u0434\u043B\u0438\u043D\u044Bxs \u0444\u0430\u0441\u0435\u0442\u043E\u0431\u0440\u0430\u0437\u0446\u0430xs \u0444\u0430\u0441\u0435\u0442\u043E\u0431\u0449\u0435\u0433\u043E\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\u0440\u0430\u0437\u0440\u044F\u0434\u043E\u0432xs \u0444\u0430\u0441\u0435\u0442\u043F\u0435\u0440\u0435\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u044Fxs \u0444\u0430\u0441\u0435\u0442\u043F\u0440\u043E\u0431\u0435\u043B\u044C\u043D\u044B\u0445\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432xs \u0444\u0438\u043B\u044C\u0442\u0440\u0443\u0437\u043B\u043E\u0432dom \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u0430\u044F\u0441\u0442\u0440\u043E\u043A\u0430 \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442xs \u0445\u0435\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0446\u0432\u0435\u0442 \u0447\u0442\u0435\u043D\u0438\u0435fastinfoset \u0447\u0442\u0435\u043D\u0438\u0435html \u0447\u0442\u0435\u043D\u0438\u0435json \u0447\u0442\u0435\u043D\u0438\u0435xml \u0447\u0442\u0435\u043D\u0438\u0435zip\u0444\u0430\u0439\u043B\u0430 \u0447\u0442\u0435\u043D\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445 \u0447\u0442\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430 \u0447\u0442\u0435\u043D\u0438\u0435\u0443\u0437\u043B\u043E\u0432dom \u0448\u0440\u0438\u0444\u0442 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 ",Be="comsafearray \u0434\u0435\u0440\u0435\u0432\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u043C\u0430\u0441\u0441\u0438\u0432 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u043F\u0438\u0441\u043E\u043A\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u0430\u044F\u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0430 \u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0435\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439\u043C\u0430\u0441\u0441\u0438\u0432 ",Me=be+Be,Re="null \u0438\u0441\u0442\u0438\u043D\u0430 \u043B\u043E\u0436\u044C \u043D\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043E",se=t.inherit(t.NUMBER_MODE),ie={className:"string",begin:'"|\\|',end:'"|$',contains:[{begin:'""'}]},ne={begin:"'",end:"'",excludeBegin:!0,excludeEnd:!0,contains:[{className:"number",begin:"\\d{4}([\\.\\\\/:-]?\\d{2}){0,5}"}]},J=t.inherit(t.C_LINE_COMMENT_MODE),te={className:"meta",begin:"#|&",end:"$",keywords:{$pattern:e,"meta-keyword":s+a},contains:[J]},j={className:"symbol",begin:"~",end:";|:",excludeEnd:!0},X={className:"function",variants:[{begin:"\u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u0430|\u0444\u0443\u043D\u043A\u0446\u0438\u044F",end:"\\)",keywords:"\u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u0430 \u0444\u0443\u043D\u043A\u0446\u0438\u044F"},{begin:"\u043A\u043E\u043D\u0435\u0446\u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u044B|\u043A\u043E\u043D\u0435\u0446\u0444\u0443\u043D\u043A\u0446\u0438\u0438",keywords:"\u043A\u043E\u043D\u0435\u0446\u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u044B \u043A\u043E\u043D\u0435\u0446\u0444\u0443\u043D\u043A\u0446\u0438\u0438"}],contains:[{begin:"\\(",end:"\\)",endsParent:!0,contains:[{className:"params",begin:e,end:",",excludeEnd:!0,endsWithParent:!0,keywords:{$pattern:e,keyword:"\u0437\u043D\u0430\u0447",literal:Re},contains:[se,ie,ne]},J]},t.inherit(t.TITLE_MODE,{begin:e})]};return{name:"1C:Enterprise",case_insensitive:!0,keywords:{$pattern:e,keyword:s,built_in:h,class:ce,type:Me,literal:Re},contains:[te,X,J,j,se,ie,ne]}}Ion.exports=ons});var Ton=ee((QRa,won)=>{p();function ans(t){return t?typeof t=="string"?t:t.source:null}function cns(...t){return t.map(n=>ans(n)).join("")}function lns(t){let e={ruleDeclaration:/^[a-zA-Z][a-zA-Z0-9-]*/,unexpectedChars:/[!@#$^&',?+~`|:]/},n=["ALPHA","BIT","CHAR","CR","CRLF","CTL","DIGIT","DQUOTE","HEXDIG","HTAB","LF","LWSP","OCTET","SP","VCHAR","WSP"],r=t.COMMENT(/;/,/$/),s={className:"symbol",begin:/%b[0-1]+(-[0-1]+|(\.[0-1]+)+){0,1}/},i={className:"symbol",begin:/%d[0-9]+(-[0-9]+|(\.[0-9]+)+){0,1}/},o={className:"symbol",begin:/%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+){0,1}/},a={className:"symbol",begin:/%[si]/},c={className:"attribute",begin:cns(e.ruleDeclaration,/(?=\s*=)/)};return{name:"Augmented Backus-Naur Form",illegal:e.unexpectedChars,keywords:n,contains:[c,r,s,i,o,a,t.QUOTE_STRING_MODE,t.NUMBER_MODE]}}won.exports=lns});var kon=ee(($Ra,Ron)=>{p();function von(t){return t?typeof t=="string"?t:t.source:null}function uns(...t){return t.map(n=>von(n)).join("")}function dns(...t){return"("+t.map(n=>von(n)).join("|")+")"}function pns(t){let e=["GET","POST","HEAD","PUT","DELETE","CONNECT","OPTIONS","PATCH","TRACE"];return{name:"Apache Access Log",contains:[{className:"number",begin:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?\b/,relevance:5},{className:"number",begin:/\b\d+\b/,relevance:0},{className:"string",begin:uns(/"/,dns(...e)),end:/"/,keywords:e,illegal:/\n/,relevance:5,contains:[{begin:/HTTP\/[12]\.\d'/,relevance:5}]},{className:"string",begin:/\[\d[^\]\n]{8,}\]/,illegal:/\n/,relevance:1},{className:"string",begin:/\[/,end:/\]/,illegal:/\n/,relevance:0},{className:"string",begin:/"Mozilla\/\d\.\d \(/,end:/"/,illegal:/\n/,relevance:3},{className:"string",begin:/"/,end:/"/,illegal:/\n/,relevance:0}]}}Ron.exports=pns});var Don=ee((WRa,Non)=>{p();function hns(t){return t?typeof t=="string"?t:t.source:null}function mns(...t){return t.map(n=>hns(n)).join("")}function fns(t){let e=/[a-zA-Z_$][a-zA-Z0-9_$]*/,n=/([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)/,r={className:"rest_arg",begin:/[.]{3}/,end:e,relevance:10};return{name:"ActionScript",aliases:["as"],keywords:{keyword:"as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with",literal:"true false null undefined"},contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,{className:"class",beginKeywords:"package",end:/\{/,contains:[t.TITLE_MODE]},{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.TITLE_MODE]},{className:"meta",beginKeywords:"import include",end:/;/,keywords:{"meta-keyword":"import include"}},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,illegal:/\S/,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,r]},{begin:mns(/:\s*/,n)}]},t.METHOD_GUARD],illegal:/#/}}Non.exports=fns});var Pon=ee((HRa,Bon)=>{p();function gns(t){let e="\\d(_|\\d)*",n="[eE][-+]?"+e,r=e+"(\\."+e+")?("+n+")?",s="\\w+",o="\\b("+(e+"#"+s+"(\\."+s+")?#("+n+")?")+"|"+r+")",a="[A-Za-z](_?[A-Za-z0-9.])*",c=`[]\\{\\}%#'"`,u=t.COMMENT("--","$"),l={begin:"\\s+:\\s+",end:"\\s*(:=|;|\\)|=>|$)",illegal:c,contains:[{beginKeywords:"loop for declare others",endsParent:!0},{className:"keyword",beginKeywords:"not null constant access function procedure in out aliased exception"},{className:"type",begin:a,endsParent:!0,relevance:0}]};return{name:"Ada",case_insensitive:!0,keywords:{keyword:"abort else new return abs elsif not reverse abstract end accept entry select access exception of separate aliased exit or some all others subtype and for out synchronized array function overriding at tagged generic package task begin goto pragma terminate body private then if procedure type case in protected constant interface is raise use declare range delay limited record when delta loop rem while digits renames with do mod requeue xor",literal:"True False"},contains:[u,{className:"string",begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{className:"string",begin:/'.'/},{className:"number",begin:o,relevance:0},{className:"symbol",begin:"'"+a},{className:"title",begin:"(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?",end:"(is|$)",keywords:"package body",excludeBegin:!0,excludeEnd:!0,illegal:c},{begin:"(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+",end:"(\\bis|\\bwith|\\brenames|\\)\\s*;)",keywords:"overriding function procedure with is renames return",returnBegin:!0,contains:[u,{className:"title",begin:"(\\bwith\\s+)?\\b(function|procedure)\\s+",end:"(\\(|\\s+|$)",excludeBegin:!0,excludeEnd:!0,illegal:c},l,{className:"type",begin:"\\breturn\\s+",end:"(\\s+|;|$)",keywords:"return",excludeBegin:!0,excludeEnd:!0,endsParent:!0,illegal:c}]},{className:"type",begin:"\\b(sub)?type\\s+",end:"\\s+",keywords:"type",excludeBegin:!0,illegal:c},l]}}Bon.exports=gns});var Mon=ee((jRa,Oon)=>{p();function Ans(t){var e={className:"built_in",begin:"\\b(void|bool|int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|string|ref|array|double|float|auto|dictionary)"},n={className:"symbol",begin:"[a-zA-Z0-9_]+@"},r={className:"keyword",begin:"<",end:">",contains:[e,n]};return e.contains=[r],n.contains=[r],{name:"AngelScript",aliases:["asc"],keywords:"for in|0 break continue while do|0 return if else case switch namespace is cast or and xor not get|0 in inout|10 out override set|0 private public const default|0 final shared external mixin|10 enum typedef funcdef this super import from interface abstract|0 try catch protected explicit property",illegal:"(^using\\s+[A-Za-z0-9_\\.]+;$|\\bfunction\\s*[^\\(])",contains:[{className:"string",begin:"'",end:"'",illegal:"\\n",contains:[t.BACKSLASH_ESCAPE],relevance:0},{className:"string",begin:'"""',end:'"""'},{className:"string",begin:'"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE],relevance:0},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",begin:"^\\s*\\[",end:"\\]"},{beginKeywords:"interface namespace",end:/\{/,illegal:"[;.\\-]",contains:[{className:"symbol",begin:"[a-zA-Z0-9_]+"}]},{beginKeywords:"class",end:/\{/,illegal:"[;.\\-]",contains:[{className:"symbol",begin:"[a-zA-Z0-9_]+",contains:[{begin:"[:,]\\s*",contains:[{className:"symbol",begin:"[a-zA-Z0-9_]+"}]}]}]},e,n,{className:"literal",begin:"\\b(null|true|false)"},{className:"number",relevance:0,begin:"(-?)(\\b0[xXbBoOdD][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?f?|\\.\\d+f?)([eE][-+]?\\d+f?)?)"}]}}Oon.exports=Ans});var Fon=ee((KRa,Lon)=>{p();function yns(t){let e={className:"number",begin:/[$%]\d+/},n={className:"number",begin:/\d+/},r={className:"number",begin:/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?/},s={className:"number",begin:/:\d{1,5}/};return{name:"Apache config",aliases:["apacheconf"],case_insensitive:!0,contains:[t.HASH_COMMENT_MODE,{className:"section",begin:/<\/?/,end:/>/,contains:[r,s,t.inherit(t.QUOTE_STRING_MODE,{relevance:0})]},{className:"attribute",begin:/\w+/,relevance:0,keywords:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{end:/$/,relevance:0,keywords:{literal:"on off all deny allow"},contains:[{className:"meta",begin:/\s\[/,end:/\]$/},{className:"variable",begin:/[\$%]\{/,end:/\}/,contains:["self",e]},r,n,t.QUOTE_STRING_MODE]}}],illegal:/\S/}}Lon.exports=yns});var Won=ee((JRa,Gon)=>{p();function $on(t){return t?typeof t=="string"?t:t.source:null}function Qon(...t){return t.map(n=>$on(n)).join("")}function Uon(...t){return"("+t.map(n=>$on(n)).join("|")+")"}function Ens(t){let e=t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),n={className:"params",begin:/\(/,end:/\)/,contains:["self",t.C_NUMBER_MODE,e]},r=t.COMMENT(/--/,/$/),s=t.COMMENT(/\(\*/,/\*\)/,{contains:["self",r]}),i=[r,s,t.HASH_COMMENT_MODE],o=[/apart from/,/aside from/,/instead of/,/out of/,/greater than/,/isn't|(doesn't|does not) (equal|come before|come after|contain)/,/(greater|less) than( or equal)?/,/(starts?|ends|begins?) with/,/contained by/,/comes (before|after)/,/a (ref|reference)/,/POSIX (file|path)/,/(date|time) string/,/quoted form/],a=[/clipboard info/,/the clipboard/,/info for/,/list (disks|folder)/,/mount volume/,/path to/,/(close|open for) access/,/(get|set) eof/,/current date/,/do shell script/,/get volume settings/,/random number/,/set volume/,/system attribute/,/system info/,/time to GMT/,/(load|run|store) script/,/scripting components/,/ASCII (character|number)/,/localized string/,/choose (application|color|file|file name|folder|from list|remote application|URL)/,/display (alert|dialog)/];return{name:"AppleScript",aliases:["osascript"],keywords:{keyword:"about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the|0 then third through thru timeout times to transaction try until where while whose with without",literal:"AppleScript false linefeed return pi quote result space tab true",built_in:"alias application boolean class constant date file integer list number real record string text activate beep count delay launch log offset read round run say summarize write character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"},contains:[e,t.C_NUMBER_MODE,{className:"built_in",begin:Qon(/\b/,Uon(...a),/\b/)},{className:"built_in",begin:/^\s*return\b/},{className:"literal",begin:/\b(text item delimiters|current application|missing value)\b/},{className:"keyword",begin:Qon(/\b/,Uon(...o),/\b/)},{beginKeywords:"on",illegal:/[${=;\n]/,contains:[t.UNDERSCORE_TITLE_MODE,n]},...i],illegal:/\/\/|->|=>|\[\[/}}Gon.exports=Ens});var Hon=ee((ZRa,qon)=>{p();function bns(t){let e="[A-Za-z_][0-9A-Za-z_]*",n={keyword:"if for while var new function do return void else break",literal:"BackSlash DoubleQuote false ForwardSlash Infinity NaN NewLine null PI SingleQuote Tab TextFormatting true undefined",built_in:"Abs Acos Angle Attachments Area AreaGeodetic Asin Atan Atan2 Average Bearing Boolean Buffer BufferGeodetic Ceil Centroid Clip Console Constrain Contains Cos Count Crosses Cut Date DateAdd DateDiff Day Decode DefaultValue Dictionary Difference Disjoint Distance DistanceGeodetic Distinct DomainCode DomainName Equals Exp Extent Feature FeatureSet FeatureSetByAssociation FeatureSetById FeatureSetByPortalItem FeatureSetByRelationshipName FeatureSetByTitle FeatureSetByUrl Filter First Floor Geometry GroupBy Guid HasKey Hour IIf IndexOf Intersection Intersects IsEmpty IsNan IsSelfIntersecting Length LengthGeodetic Log Max Mean Millisecond Min Minute Month MultiPartToSinglePart Multipoint NextSequenceValue Now Number OrderBy Overlaps Point Polygon Polyline Portal Pow Random Relate Reverse RingIsClockWise Round Second SetGeometry Sin Sort Sqrt Stdev Sum SymmetricDifference Tan Text Timestamp Today ToLocal Top Touches ToUTC TrackCurrentTime TrackGeometryWindow TrackIndex TrackStartTime TrackWindow TypeOf Union UrlEncode Variance Weekday When Within Year "},r={className:"symbol",begin:"\\$[datastore|feature|layer|map|measure|sourcefeature|sourcelayer|targetfeature|targetlayer|value|view]+"},s={className:"number",variants:[{begin:"\\b(0[bB][01]+)"},{begin:"\\b(0[oO][0-7]+)"},{begin:t.C_NUMBER_RE}],relevance:0},i={className:"subst",begin:"\\$\\{",end:"\\}",keywords:n,contains:[]},o={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,i]};i.contains=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,o,s,t.REGEXP_MODE];let a=i.contains.concat([t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]);return{name:"ArcGIS Arcade",keywords:n,contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,o,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,r,s,{begin:/[{,]\s*/,relevance:0,contains:[{begin:e+"\\s*:",returnBegin:!0,relevance:0,contains:[{className:"attr",begin:e,relevance:0}]}]},{begin:"("+t.RE_STARTERS_RE+"|\\b(return)\\b)\\s*",keywords:"return",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+e+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:a}]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:e}),{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:a}],illegal:/\[|%/},{begin:/\$[(.]/}],illegal:/#(?!!)/}}qon.exports=bns});var jon=ee((tka,Von)=>{p();function _ns(t){return t?typeof t=="string"?t:t.source:null}function Sns(t){return mze("(?=",t,")")}function h_e(t){return mze("(",t,")?")}function mze(...t){return t.map(n=>_ns(n)).join("")}function Cns(t){let e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",i="("+n+"|"+h_e(r)+"[a-zA-Z_]\\w*"+h_e("<[^<>]+>")+")",o={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:h_e(r)+t.IDENT_RE,relevance:0},h=h_e(r)+t.IDENT_RE+"\\s*\\(",f={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"_Bool _Complex _Imaginary",_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"],literal:"true false nullptr NULL"},g={className:"function.dispatch",relevance:0,keywords:f,begin:mze(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,t.IDENT_RE,Sns(/\s*\(/))},A=[g,l,o,e,t.C_BLOCK_COMMENT_MODE,u,c],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:A.concat([{begin:/\(/,end:/\)/,keywords:f,contains:A.concat(["self"]),relevance:0}]),relevance:0},b={className:"function",begin:"("+i+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:f,relevance:0},{begin:h,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,e,t.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:f,illegal:"",keywords:f,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:l,strings:c,keywords:f}}}function Ins(t){let e={keyword:"boolean byte word String",built_in:"KeyboardController MouseController SoftwareSerial EthernetServer EthernetClient LiquidCrystal RobotControl GSMVoiceCall EthernetUDP EsploraTFT HttpClient RobotMotor WiFiClient GSMScanner FileSystem Scheduler GSMServer YunClient YunServer IPAddress GSMClient GSMModem Keyboard Ethernet Console GSMBand Esplora Stepper Process WiFiUDP GSM_SMS Mailbox USBHost Firmata PImage Client Server GSMPIN FileIO Bridge Serial EEPROM Stream Mouse Audio Servo File Task GPRS WiFi Wire TFT GSM SPI SD ",_:"setup loop runShellCommandAsynchronously analogWriteResolution retrieveCallingNumber printFirmwareVersion analogReadResolution sendDigitalPortPair noListenOnLocalhost readJoystickButton setFirmwareVersion readJoystickSwitch scrollDisplayRight getVoiceCallStatus scrollDisplayLeft writeMicroseconds delayMicroseconds beginTransmission getSignalStrength runAsynchronously getAsynchronously listenOnLocalhost getCurrentCarrier readAccelerometer messageAvailable sendDigitalPorts lineFollowConfig countryNameWrite runShellCommand readStringUntil rewindDirectory readTemperature setClockDivider readLightSensor endTransmission analogReference detachInterrupt countryNameRead attachInterrupt encryptionType readBytesUntil robotNameWrite readMicrophone robotNameRead cityNameWrite userNameWrite readJoystickY readJoystickX mouseReleased openNextFile scanNetworks noInterrupts digitalWrite beginSpeaker mousePressed isActionDone mouseDragged displayLogos noAutoscroll addParameter remoteNumber getModifiers keyboardRead userNameRead waitContinue processInput parseCommand printVersion readNetworks writeMessage blinkVersion cityNameRead readMessage setDataMode parsePacket isListening setBitOrder beginPacket isDirectory motorsWrite drawCompass digitalRead clearScreen serialEvent rightToLeft setTextSize leftToRight requestFrom keyReleased compassRead analogWrite interrupts WiFiServer disconnect playMelody parseFloat autoscroll getPINUsed setPINUsed setTimeout sendAnalog readSlider analogRead beginWrite createChar motorsStop keyPressed tempoWrite readButton subnetMask debugPrint macAddress writeGreen randomSeed attachGPRS readString sendString remotePort releaseAll mouseMoved background getXChange getYChange answerCall getResult voiceCall endPacket constrain getSocket writeJSON getButton available connected findUntil readBytes exitValue readGreen writeBlue startLoop IPAddress isPressed sendSysex pauseMode gatewayIP setCursor getOemKey tuneWrite noDisplay loadImage switchPIN onRequest onReceive changePIN playFile noBuffer parseInt overflow checkPIN knobRead beginTFT bitClear updateIR bitWrite position writeRGB highByte writeRed setSpeed readBlue noStroke remoteIP transfer shutdown hangCall beginSMS endWrite attached maintain noCursor checkReg checkPUK shiftOut isValid shiftIn pulseIn connect println localIP pinMode getIMEI display noBlink process getBand running beginSD drawBMP lowByte setBand release bitRead prepare pointTo readRed setMode noFill remove listen stroke detach attach noTone exists buffer height bitSet circle config cursor random IRread setDNS endSMS getKey micros millis begin print write ready flush width isPIN blink clear press mkdir rmdir close point yield image BSSID click delay read text move peek beep rect line open seek fill size turn stop home find step tone sqrt RSSI SSID end bit tan cos sin pow map abs max min get run put",literal:"DIGITAL_MESSAGE FIRMATA_STRING ANALOG_MESSAGE REPORT_DIGITAL REPORT_ANALOG INPUT_PULLUP SET_PIN_MODE INTERNAL2V56 SYSTEM_RESET LED_BUILTIN INTERNAL1V1 SYSEX_START INTERNAL EXTERNAL DEFAULT OUTPUT INPUT HIGH LOW"},n=Cns(t),r=n.keywords;return r.keyword+=" "+e.keyword,r.literal+=" "+e.literal,r.built_in+=" "+e.built_in,r._+=" "+e._,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}Von.exports=Ins});var Kon=ee((rka,Yon)=>{p();function xns(t){let e={variants:[t.COMMENT("^[ \\t]*(?=#)","$",{relevance:0,excludeBegin:!0}),t.COMMENT("[;@]","$",{relevance:0}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]};return{name:"ARM Assembly",case_insensitive:!0,aliases:["arm"],keywords:{$pattern:"\\.?"+t.IDENT_RE,meta:".2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .arm .thumb .code16 .code32 .force_thumb .thumb_func .ltorg ALIAS ALIGN ARM AREA ASSERT ATTR CN CODE CODE16 CODE32 COMMON CP DATA DCB DCD DCDU DCDO DCFD DCFDU DCI DCQ DCQU DCW DCWU DN ELIF ELSE END ENDFUNC ENDIF ENDP ENTRY EQU EXPORT EXPORTAS EXTERN FIELD FILL FUNCTION GBLA GBLL GBLS GET GLOBAL IF IMPORT INCBIN INCLUDE INFO KEEP LCLA LCLL LCLS LTORG MACRO MAP MEND MEXIT NOFP OPT PRESERVE8 PROC QN READONLY RELOC REQUIRE REQUIRE8 RLIST FN ROUT SETA SETL SETS SN SPACE SUBT THUMB THUMBX TTL WHILE WEND ",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 pc lr sp ip sl sb fp a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 q0 q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 cpsr_c cpsr_x cpsr_s cpsr_f cpsr_cx cpsr_cxs cpsr_xs cpsr_xsf cpsr_sf cpsr_cxsf spsr_c spsr_x spsr_s spsr_f spsr_cx spsr_cxs spsr_xs spsr_xsf spsr_sf spsr_cxsf s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30 d31 {PC} {VAR} {TRUE} {FALSE} {OPT} {CONFIG} {ENDIAN} {CODESIZE} {CPU} {FPU} {ARCHITECTURE} {PCSTOREOFFSET} {ARMASM_VERSION} {INTER} {ROPI} {RWPI} {SWST} {NOSWST} . @"},contains:[{className:"keyword",begin:"\\b(adc|(qd?|sh?|u[qh]?)?add(8|16)?|usada?8|(q|sh?|u[qh]?)?(as|sa)x|and|adrl?|sbc|rs[bc]|asr|b[lx]?|blx|bxj|cbn?z|tb[bh]|bic|bfc|bfi|[su]bfx|bkpt|cdp2?|clz|clrex|cmp|cmn|cpsi[ed]|cps|setend|dbg|dmb|dsb|eor|isb|it[te]{0,3}|lsl|lsr|ror|rrx|ldm(([id][ab])|f[ds])?|ldr((s|ex)?[bhd])?|movt?|mvn|mra|mar|mul|[us]mull|smul[bwt][bt]|smu[as]d|smmul|smmla|mla|umlaal|smlal?([wbt][bt]|d)|mls|smlsl?[ds]|smc|svc|sev|mia([bt]{2}|ph)?|mrr?c2?|mcrr2?|mrs|msr|orr|orn|pkh(tb|bt)|rbit|rev(16|sh)?|sel|[su]sat(16)?|nop|pop|push|rfe([id][ab])?|stm([id][ab])?|str(ex)?[bhd]?|(qd?)?sub|(sh?|q|u[qh]?)?sub(8|16)|[su]xt(a?h|a?b(16)?)|srs([id][ab])?|swpb?|swi|smi|tst|teq|wfe|wfi|yield)(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo)?[sptrx]?(?=\\s)"},e,t.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",relevance:0},{className:"title",begin:"\\|",end:"\\|",illegal:"\\n",relevance:0},{className:"number",variants:[{begin:"[#$=]?0x[0-9a-f]+"},{begin:"[#$=]?0b[01]+"},{begin:"[#$=]\\d+"},{begin:"\\b\\d+"}],relevance:0},{className:"symbol",variants:[{begin:"^[ \\t]*[a-z_\\.\\$][a-z0-9_\\.\\$]+:"},{begin:"^[a-z_\\.\\$][a-z0-9_\\.\\$]+"},{begin:"[=#]\\w+"}],relevance:0}]}}Yon.exports=xns});var Zon=ee((ika,Xon)=>{p();function Jon(t){return t?typeof t=="string"?t:t.source:null}function zon(t){return QM("(?=",t,")")}function wns(t){return QM("(",t,")?")}function QM(...t){return t.map(n=>Jon(n)).join("")}function Tns(...t){return"("+t.map(n=>Jon(n)).join("|")+")"}function vns(t){let e=QM(/[A-Z_]/,wns(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),n=/[A-Za-z0-9._:-]+/,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"meta-keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=t.inherit(s,{begin:/\(/,end:/\)/}),o=t.inherit(t.APOS_STRING_MODE,{className:"meta-string"}),a=t.inherit(t.QUOTE_STRING_MODE,{className:"meta-string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,a,o,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,i,a,o]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:QM(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:e,relevance:0,starts:c}]},{className:"tag",begin:QM(/<\//,zon(QM(e,/>/))),contains:[{className:"name",begin:e,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}Xon.exports=vns});var nan=ee((aka,tan)=>{p();function Rns(t){return t?typeof t=="string"?t:t.source:null}function ean(...t){return t.map(n=>Rns(n)).join("")}function kns(t){let e={begin:"^'{3,}[ \\t]*$",relevance:10},n=[{begin:/\\[*_`]/},{begin:/\\\\\*{2}[^\n]*?\*{2}/},{begin:/\\\\_{2}[^\n]*_{2}/},{begin:/\\\\`{2}[^\n]*`{2}/},{begin:/[:;}][*_`](?![*_`])/}],r=[{className:"strong",begin:/\*{2}([^\n]+?)\*{2}/},{className:"strong",begin:ean(/\*\*/,/((\*(?!\*)|\\[^\n]|[^*\n\\])+\n)+/,/(\*(?!\*)|\\[^\n]|[^*\n\\])*/,/\*\*/),relevance:0},{className:"strong",begin:/\B\*(\S|\S[^\n]*?\S)\*(?!\w)/},{className:"strong",begin:/\*[^\s]([^\n]+\n)+([^\n]+)\*/}],s=[{className:"emphasis",begin:/_{2}([^\n]+?)_{2}/},{className:"emphasis",begin:ean(/__/,/((_(?!_)|\\[^\n]|[^_\n\\])+\n)+/,/(_(?!_)|\\[^\n]|[^_\n\\])*/,/__/),relevance:0},{className:"emphasis",begin:/\b_(\S|\S[^\n]*?\S)_(?!\w)/},{className:"emphasis",begin:/_[^\s]([^\n]+\n)+([^\n]+)_/},{className:"emphasis",begin:"\\B'(?!['\\s])",end:"(\\n{2}|')",contains:[{begin:"\\\\'\\w",relevance:0}],relevance:0}],i={className:"symbol",begin:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",relevance:10},o={className:"bullet",begin:"^(\\*+|-+|\\.+|[^\\n]+?::)\\s+"};return{name:"AsciiDoc",aliases:["adoc"],contains:[t.COMMENT("^/{4,}\\n","\\n/{4,}$",{relevance:10}),t.COMMENT("^//","$",{relevance:0}),{className:"title",begin:"^\\.\\w.*$"},{begin:"^[=\\*]{4,}\\n",end:"\\n^[=\\*]{4,}$",relevance:10},{className:"section",relevance:10,variants:[{begin:"^(={1,6})[ ].+?([ ]\\1)?$"},{begin:"^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$"}]},{className:"meta",begin:"^:.+?:",end:"\\s",excludeEnd:!0,relevance:10},{className:"meta",begin:"^\\[.+?\\]$",relevance:0},{className:"quote",begin:"^_{4,}\\n",end:"\\n_{4,}$",relevance:10},{className:"code",begin:"^[\\-\\.]{4,}\\n",end:"\\n[\\-\\.]{4,}$",relevance:10},{begin:"^\\+{4,}\\n",end:"\\n\\+{4,}$",contains:[{begin:"<",end:">",subLanguage:"xml",relevance:0}],relevance:10},o,i,...n,...r,...s,{className:"string",variants:[{begin:"``.+?''"},{begin:"`.+?'"}]},{className:"code",begin:/`{2}/,end:/(\n{2}|`{2})/},{className:"code",begin:"(`.+?`|\\+.+?\\+)",relevance:0},{className:"code",begin:"^[ \\t]",end:"$",relevance:0},e,{begin:"(link:)?(http|https|ftp|file|irc|image:?):\\S+?\\[[^[]*?\\]",returnBegin:!0,contains:[{begin:"(link|image:?):",relevance:0},{className:"link",begin:"\\w",end:"[^\\[]+",relevance:0},{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0,relevance:0}],relevance:10}]}}tan.exports=kns});var san=ee((lka,ran)=>{p();function Nns(t){return t?typeof t=="string"?t:t.source:null}function fze(...t){return t.map(n=>Nns(n)).join("")}function Dns(t){let e="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance",n="get set args call";return{name:"AspectJ",keywords:e,illegal:/<\/|#/,contains:[t.COMMENT(/\/\*\*/,/\*\//,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:/@[A-Za-z]+/}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"class",beginKeywords:"aspect",end:/[{;=]/,excludeEnd:!0,illegal:/[:;"\[\]]/,contains:[{beginKeywords:"extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton"},t.UNDERSCORE_TITLE_MODE,{begin:/\([^\)]*/,end:/[)]+/,keywords:e+" "+n,excludeEnd:!1}]},{className:"class",beginKeywords:"class interface",end:/[{;=]/,excludeEnd:!0,relevance:0,keywords:"class interface",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"pointcut after before around throwing returning",end:/[)]/,excludeEnd:!1,illegal:/["\[\]]/,contains:[{begin:fze(t.UNDERSCORE_IDENT_RE,/\s*\(/),returnBegin:!0,contains:[t.UNDERSCORE_TITLE_MODE]}]},{begin:/[:]/,returnBegin:!0,end:/[{;]/,relevance:0,excludeEnd:!1,keywords:e,illegal:/["\[\]]/,contains:[{begin:fze(t.UNDERSCORE_IDENT_RE,/\s*\(/),keywords:e+" "+n,relevance:0},t.QUOTE_STRING_MODE]},{beginKeywords:"new throw",relevance:0},{className:"function",begin:/\w+ +\w+(\.\w+)?\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]/,returnBegin:!0,end:/[{;=]/,keywords:e,excludeEnd:!0,contains:[{begin:fze(t.UNDERSCORE_IDENT_RE,/\s*\(/),returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,relevance:0,keywords:e,contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},t.C_NUMBER_MODE,{className:"meta",begin:/@[A-Za-z]+/}]}}ran.exports=Dns});var oan=ee((dka,ian)=>{p();function Bns(t){let e={begin:"`[\\s\\S]"};return{name:"AutoHotkey",case_insensitive:!0,aliases:["ahk"],keywords:{keyword:"Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group",literal:"true false NOT AND OR",built_in:"ComSpec Clipboard ClipboardAll ErrorLevel"},contains:[e,t.inherit(t.QUOTE_STRING_MODE,{contains:[e]}),t.COMMENT(";","$",{relevance:0}),t.C_BLOCK_COMMENT_MODE,{className:"number",begin:t.NUMBER_RE,relevance:0},{className:"variable",begin:"%[a-zA-Z0-9#_$@]+%"},{className:"built_in",begin:"^\\s*\\w+\\s*(,|%)"},{className:"title",variants:[{begin:'^[^\\n";]+::(?!=)'},{begin:'^[^\\n";]+:(?!=)',relevance:0}]},{className:"meta",begin:"^\\s*#\\w+",end:"$",relevance:0},{className:"built_in",begin:"A_[a-zA-Z0-9]+"},{begin:",\\s*,"}]}}ian.exports=Bns});var can=ee((hka,aan)=>{p();function Pns(t){let e="ByRef Case Const ContinueCase ContinueLoop Dim Do Else ElseIf EndFunc EndIf EndSelect EndSwitch EndWith Enum Exit ExitLoop For Func Global If In Local Next ReDim Return Select Static Step Switch Then To Until Volatile WEnd While With",n=["EndRegion","forcedef","forceref","ignorefunc","include","include-once","NoTrayIcon","OnAutoItStartRegister","pragma","Region","RequireAdmin","Tidy_Off","Tidy_On","Tidy_Parameters"],r="True False And Null Not Or Default",s="Abs ACos AdlibRegister AdlibUnRegister Asc AscW ASin Assign ATan AutoItSetOption AutoItWinGetTitle AutoItWinSetTitle Beep Binary BinaryLen BinaryMid BinaryToString BitAND BitNOT BitOR BitRotate BitShift BitXOR BlockInput Break Call CDTray Ceiling Chr ChrW ClipGet ClipPut ConsoleRead ConsoleWrite ConsoleWriteError ControlClick ControlCommand ControlDisable ControlEnable ControlFocus ControlGetFocus ControlGetHandle ControlGetPos ControlGetText ControlHide ControlListView ControlMove ControlSend ControlSetText ControlShow ControlTreeView Cos Dec DirCopy DirCreate DirGetSize DirMove DirRemove DllCall DllCallAddress DllCallbackFree DllCallbackGetPtr DllCallbackRegister DllClose DllOpen DllStructCreate DllStructGetData DllStructGetPtr DllStructGetSize DllStructSetData DriveGetDrive DriveGetFileSystem DriveGetLabel DriveGetSerial DriveGetType DriveMapAdd DriveMapDel DriveMapGet DriveSetLabel DriveSpaceFree DriveSpaceTotal DriveStatus EnvGet EnvSet EnvUpdate Eval Execute Exp FileChangeDir FileClose FileCopy FileCreateNTFSLink FileCreateShortcut FileDelete FileExists FileFindFirstFile FileFindNextFile FileFlush FileGetAttrib FileGetEncoding FileGetLongName FileGetPos FileGetShortcut FileGetShortName FileGetSize FileGetTime FileGetVersion FileInstall FileMove FileOpen FileOpenDialog FileRead FileReadLine FileReadToArray FileRecycle FileRecycleEmpty FileSaveDialog FileSelectFolder FileSetAttrib FileSetEnd FileSetPos FileSetTime FileWrite FileWriteLine Floor FtpSetProxy FuncName GUICreate GUICtrlCreateAvi GUICtrlCreateButton GUICtrlCreateCheckbox GUICtrlCreateCombo GUICtrlCreateContextMenu GUICtrlCreateDate GUICtrlCreateDummy GUICtrlCreateEdit GUICtrlCreateGraphic GUICtrlCreateGroup GUICtrlCreateIcon GUICtrlCreateInput GUICtrlCreateLabel GUICtrlCreateList GUICtrlCreateListView GUICtrlCreateListViewItem GUICtrlCreateMenu GUICtrlCreateMenuItem GUICtrlCreateMonthCal GUICtrlCreateObj GUICtrlCreatePic GUICtrlCreateProgress GUICtrlCreateRadio GUICtrlCreateSlider GUICtrlCreateTab GUICtrlCreateTabItem GUICtrlCreateTreeView GUICtrlCreateTreeViewItem GUICtrlCreateUpdown GUICtrlDelete GUICtrlGetHandle GUICtrlGetState GUICtrlRead GUICtrlRecvMsg GUICtrlRegisterListViewSort GUICtrlSendMsg GUICtrlSendToDummy GUICtrlSetBkColor GUICtrlSetColor GUICtrlSetCursor GUICtrlSetData GUICtrlSetDefBkColor GUICtrlSetDefColor GUICtrlSetFont GUICtrlSetGraphic GUICtrlSetImage GUICtrlSetLimit GUICtrlSetOnEvent GUICtrlSetPos GUICtrlSetResizing GUICtrlSetState GUICtrlSetStyle GUICtrlSetTip GUIDelete GUIGetCursorInfo GUIGetMsg GUIGetStyle GUIRegisterMsg GUISetAccelerators GUISetBkColor GUISetCoord GUISetCursor GUISetFont GUISetHelp GUISetIcon GUISetOnEvent GUISetState GUISetStyle GUIStartGroup GUISwitch Hex HotKeySet HttpSetProxy HttpSetUserAgent HWnd InetClose InetGet InetGetInfo InetGetSize InetRead IniDelete IniRead IniReadSection IniReadSectionNames IniRenameSection IniWrite IniWriteSection InputBox Int IsAdmin IsArray IsBinary IsBool IsDeclared IsDllStruct IsFloat IsFunc IsHWnd IsInt IsKeyword IsNumber IsObj IsPtr IsString Log MemGetStats Mod MouseClick MouseClickDrag MouseDown MouseGetCursor MouseGetPos MouseMove MouseUp MouseWheel MsgBox Number ObjCreate ObjCreateInterface ObjEvent ObjGet ObjName OnAutoItExitRegister OnAutoItExitUnRegister Ping PixelChecksum PixelGetColor PixelSearch ProcessClose ProcessExists ProcessGetStats ProcessList ProcessSetPriority ProcessWait ProcessWaitClose ProgressOff ProgressOn ProgressSet Ptr Random RegDelete RegEnumKey RegEnumVal RegRead RegWrite Round Run RunAs RunAsWait RunWait Send SendKeepActive SetError SetExtended ShellExecute ShellExecuteWait Shutdown Sin Sleep SoundPlay SoundSetWaveVolume SplashImageOn SplashOff SplashTextOn Sqrt SRandom StatusbarGetText StderrRead StdinWrite StdioClose StdoutRead String StringAddCR StringCompare StringFormat StringFromASCIIArray StringInStr StringIsAlNum StringIsAlpha StringIsASCII StringIsDigit StringIsFloat StringIsInt StringIsLower StringIsSpace StringIsUpper StringIsXDigit StringLeft StringLen StringLower StringMid StringRegExp StringRegExpReplace StringReplace StringReverse StringRight StringSplit StringStripCR StringStripWS StringToASCIIArray StringToBinary StringTrimLeft StringTrimRight StringUpper Tan TCPAccept TCPCloseSocket TCPConnect TCPListen TCPNameToIP TCPRecv TCPSend TCPShutdown, UDPShutdown TCPStartup, UDPStartup TimerDiff TimerInit ToolTip TrayCreateItem TrayCreateMenu TrayGetMsg TrayItemDelete TrayItemGetHandle TrayItemGetState TrayItemGetText TrayItemSetOnEvent TrayItemSetState TrayItemSetText TraySetClick TraySetIcon TraySetOnEvent TraySetPauseIcon TraySetState TraySetToolTip TrayTip UBound UDPBind UDPCloseSocket UDPOpen UDPRecv UDPSend VarGetType WinActivate WinActive WinClose WinExists WinFlash WinGetCaretPos WinGetClassList WinGetClientSize WinGetHandle WinGetPos WinGetProcess WinGetState WinGetText WinGetTitle WinKill WinList WinMenuSelectItem WinMinimizeAll WinMinimizeAllUndo WinMove WinSetOnTop WinSetState WinSetTitle WinSetTrans WinWait WinWaitActive WinWaitClose WinWaitNotActive",i={variants:[t.COMMENT(";","$",{relevance:0}),t.COMMENT("#cs","#ce"),t.COMMENT("#comments-start","#comments-end")]},o={begin:"\\$[A-z0-9_]+"},a={className:"string",variants:[{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]},c={variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]},u={className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":n},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",keywords:{"meta-keyword":"include"},end:"$",contains:[a,{className:"meta-string",variants:[{begin:"<",end:">"},{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]}]},a,i]},l={className:"symbol",begin:"@[A-z0-9_]+"},d={className:"function",beginKeywords:"Func",end:"$",illegal:"\\$|\\[|%",contains:[t.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)",contains:[o,a,c]}]};return{name:"AutoIt",case_insensitive:!0,illegal:/\/\*/,keywords:{keyword:e,built_in:s,literal:r},contains:[i,o,a,c,u,l,d]}}aan.exports=Pns});var uan=ee((fka,lan)=>{p();function Ons(t){return{name:"AVR Assembly",case_insensitive:!0,keywords:{$pattern:"\\.?"+t.IDENT_RE,keyword:"adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf",meta:".byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list .listmac .macro .nolist .org .set"},contains:[t.C_BLOCK_COMMENT_MODE,t.COMMENT(";","$",{relevance:0}),t.C_NUMBER_MODE,t.BINARY_NUMBER_MODE,{className:"number",begin:"\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"},t.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",illegal:"[^\\\\][^']"},{className:"symbol",begin:"^[A-Za-z0-9_.$]+:"},{className:"meta",begin:"#",end:"$"},{className:"subst",begin:"@[0-9]+"}]}}lan.exports=Ons});var pan=ee((Aka,dan)=>{p();function Mns(t){let e={className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},n="BEGIN END if else while do for in break continue delete next nextfile function func exit|10",r={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/(u|b)?r?'''/,end:/'''/,relevance:10},{begin:/(u|b)?r?"""/,end:/"""/,relevance:10},{begin:/(u|r|ur)'/,end:/'/,relevance:10},{begin:/(u|r|ur)"/,end:/"/,relevance:10},{begin:/(b|br)'/,end:/'/},{begin:/(b|br)"/,end:/"/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]};return{name:"Awk",keywords:{keyword:n},contains:[e,r,t.REGEXP_MODE,t.HASH_COMMENT_MODE,t.NUMBER_MODE]}}dan.exports=Mns});var man=ee((Eka,han)=>{p();function Lns(t){return{name:"X++",aliases:["x++"],keywords:{keyword:["abstract","as","asc","avg","break","breakpoint","by","byref","case","catch","changecompany","class","client","client","common","const","continue","count","crosscompany","delegate","delete_from","desc","display","div","do","edit","else","eventhandler","exists","extends","final","finally","firstfast","firstonly","firstonly1","firstonly10","firstonly100","firstonly1000","flush","for","forceliterals","forcenestedloop","forceplaceholders","forceselectorder","forupdate","from","generateonly","group","hint","if","implements","in","index","insert_recordset","interface","internal","is","join","like","maxof","minof","mod","namespace","new","next","nofetch","notexists","optimisticlock","order","outer","pessimisticlock","print","private","protected","public","readonly","repeatableread","retry","return","reverse","select","server","setting","static","sum","super","switch","this","throw","try","ttsabort","ttsbegin","ttscommit","unchecked","update_recordset","using","validtimestate","void","where","while"],built_in:["anytype","boolean","byte","char","container","date","double","enum","guid","int","int64","long","real","short","str","utcdatetime","var"],literal:["default","false","null","true"]},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"#",end:"$"},{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,illegal:":",contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]}]}}han.exports=Lns});var gan=ee((_ka,fan)=>{p();function Fns(t){return{name:"BASIC",case_insensitive:!0,illegal:"^.",keywords:{$pattern:"[a-zA-Z][a-zA-Z0-9_$%!#]*",keyword:"ABS ASC AND ATN AUTO|0 BEEP BLOAD|10 BSAVE|10 CALL CALLS CDBL CHAIN CHDIR CHR$|10 CINT CIRCLE CLEAR CLOSE CLS COLOR COM COMMON CONT COS CSNG CSRLIN CVD CVI CVS DATA DATE$ DEFDBL DEFINT DEFSNG DEFSTR DEF|0 SEG USR DELETE DIM DRAW EDIT END ENVIRON ENVIRON$ EOF EQV ERASE ERDEV ERDEV$ ERL ERR ERROR EXP FIELD FILES FIX FOR|0 FRE GET GOSUB|10 GOTO HEX$ IF THEN ELSE|0 INKEY$ INP INPUT INPUT# INPUT$ INSTR IMP INT IOCTL IOCTL$ KEY ON OFF LIST KILL LEFT$ LEN LET LINE LLIST LOAD LOC LOCATE LOF LOG LPRINT USING LSET MERGE MID$ MKDIR MKD$ MKI$ MKS$ MOD NAME NEW NEXT NOISE NOT OCT$ ON OR PEN PLAY STRIG OPEN OPTION BASE OUT PAINT PALETTE PCOPY PEEK PMAP POINT POKE POS PRINT PRINT] PSET PRESET PUT RANDOMIZE READ REM RENUM RESET|0 RESTORE RESUME RETURN|0 RIGHT$ RMDIR RND RSET RUN SAVE SCREEN SGN SHELL SIN SOUND SPACE$ SPC SQR STEP STICK STOP STR$ STRING$ SWAP SYSTEM TAB TAN TIME$ TIMER TROFF TRON TO USR VAL VARPTR VARPTR$ VIEW WAIT WHILE WEND WIDTH WINDOW WRITE XOR"},contains:[t.QUOTE_STRING_MODE,t.COMMENT("REM","$",{relevance:10}),t.COMMENT("'","$",{relevance:0}),{className:"symbol",begin:"^[0-9]+ ",relevance:10},{className:"number",begin:"\\b\\d+(\\.\\d+)?([edED]\\d+)?[#!]?",relevance:0},{className:"number",begin:"(&[hH][0-9a-fA-F]{1,4})"},{className:"number",begin:"(&[oO][0-7]{1,6})"}]}}fan.exports=Fns});var yan=ee((Cka,Aan)=>{p();function Qns(t){return{name:"Backus\u2013Naur Form",contains:[{className:"attribute",begin://},{begin:/::=/,end:/$/,contains:[{begin://},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]}]}}Aan.exports=Qns});var ban=ee((xka,Ean)=>{p();function Uns(t){let e={className:"literal",begin:/[+-]/,relevance:0};return{name:"Brainfuck",aliases:["bf"],contains:[t.COMMENT(`[^\\[\\]\\.,\\+\\-<> \r +${tn.bold("Built-in Tool Names:")} + read - Read file contents + bash - Execute bash commands + powershell - Execute PowerShell commands on Windows + edit - Edit files with find/replace + write - Write files (creates/overwrites) + grep - Search file contents (read-only, off by default) + find - Find files by glob pattern (read-only, off by default) + ls - List directory contents (read-only, off by default) +`)}var nkn,Fwe=v(()=>{p();gb();Qs();nkn=["off","minimal","low","medium","high","xhigh","max"]});function Zst(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function pkn(t){$F=t}function M8(t){let e=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=e[r];return i||(i=t(r),e[r]=i),i}}function mo(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(Yh.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,e)};return r}function ow(t,e){if(e){if(Yh.escapeTest.test(t))return t.replace(Yh.escapeReplace,akn)}else if(Yh.escapeTestNoEncode.test(t))return t.replace(Yh.escapeReplaceNoEncode,akn);return t}function ckn(t){try{t=encodeURI(t).replace(Yh.percentDecode,"%")}catch{return null}return t}function lkn(t,e){let n=t.replace(Yh.findPipe,(s,o,a)=>{let c=!1,u=o;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),r=n.split(Yh.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length=0&&Yh.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(` +`)}function IBi(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r0?-2:-1}function wBi(t,e=0){let n=e,r="";for(let i of t)if(i===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=i,n++;return r}function dkn(t,e,n,r,i){let s=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1"),c=t[0].charAt(0)==="!";r.state.inLink=!0;let u=r.state.linkEmitted,l=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(a),m=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=!1,!c){if(m){r.state.inRawBlock=l;return}r.state.linkEmitted=!0}return{type:c?"image":"link",raw:n,href:s,title:o,text:a,tokens:d}}function TBi(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(` +`).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[a]=o;return a.length>=i.length?s.slice(i.length):s}).join(` +`)}function gc(t,e){return GF.parse(t,e)}function vBi(...t){return GF.use(...t),gc.defaults=GF.defaults,pkn(gc.defaults),gc}var $F,UF,D1i,Yh,P1i,M1i,O1i,yre,L1i,eot,mkn,hkn,F1i,tot,Q1i,not,U1i,G1i,$we,rot,$1i,fkn,W1i,H1i,q1i,iot,skn,j1i,V1i,Y1i,z1i,gkn,K1i,wR,L8,Ere,J1i,X1i,Akn,Z1i,eBi,tBi,ykn,nBi,rBi,iBi,sBi,Ekn,oBi,aBi,cBi,lBi,uBi,dBi,pBi,mBi,hBi,fBi,gBi,ABi,yBi,EBi,Uwe,bBi,bkn,_kn,_Bi,okn,sot,xBi,Kst,SBi,Qwe,gre,CBi,akn,O8,oS,Gwe,oot,aS,Are,WF,GF,ltc,utc,dtc,ptc,mtc,htc,aot=v(()=>{p();$F=Zst();UF={exec:()=>null};D1i=((t="")=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:M8(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:M8(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:M8(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:M8(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:M8(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:M8(t=>new RegExp(`^ {0,${t}}>`))},P1i=/^(?:[ \t]*(?:\n|$))+/,M1i=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,O1i=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,yre=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,L1i=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,eot=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,mkn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hkn=mo(mkn).replace(/bull/g,eot).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),F1i=mo(mkn).replace(/bull/g,eot).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),tot=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Q1i=/^[^\n]+/,not=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,U1i=mo(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",not).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),G1i=mo(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,eot).getRegex(),$we="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",rot=/|$))/,$1i=mo("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",rot).replace("tag",$we).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fkn=t=>mo(tot).replace("hr",yre).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$we).getRegex(),W1i=fkn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),H1i=fkn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),q1i=mo(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",H1i).getRegex(),iot={blockquote:q1i,code:M1i,def:U1i,fences:O1i,heading:L1i,hr:yre,html:$1i,lheading:hkn,list:G1i,newline:P1i,paragraph:W1i,table:UF,text:Q1i},skn=mo("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yre).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$we).getRegex(),j1i={...iot,lheading:F1i,table:skn,paragraph:mo(tot).replace("hr",yre).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",skn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$we).getRegex()},V1i={...iot,html:mo(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",rot).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:UF,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:mo(tot).replace("hr",yre).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",hkn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Y1i=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,z1i=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gkn=/^( {2,}|\\)\n(?!\s*$)/,K1i=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",D1i?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ykn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,nBi=mo(ykn,"u").replace(/punct/g,wR).getRegex(),rBi=mo(ykn,"u").replace(/punct/g,Akn).getRegex(),iBi=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,sBi=mo(iBi,"u").replace(/openQuote/g,X1i).replace(/punct/g,wR).getRegex(),Ekn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",oBi=mo(Ekn,"gu").replace(/notPunctSpace/g,Ere).replace(/punctSpace/g,L8).replace(/punct/g,wR).getRegex(),aBi=mo(Ekn,"gu").replace(/notPunctSpace/g,eBi).replace(/punctSpace/g,Z1i).replace(/punct/g,Akn).getRegex(),cBi="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",lBi=mo(cBi,"gu").replace(/notPunctSpace/g,Ere).replace(/punctSpace/g,L8).replace(/punct/g,wR).getRegex(),uBi=mo("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ere).replace(/punctSpace/g,L8).replace(/punct/g,wR).getRegex(),dBi="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",pBi=mo(dBi,"gu").replace(/notPunctSpace/g,Ere).replace(/punctSpace/g,L8).replace(/punct/g,wR).getRegex(),mBi=mo(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,wR).getRegex(),hBi="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",fBi=mo(hBi,"gu").replace(/notPunctSpace/g,Ere).replace(/punctSpace/g,L8).replace(/punct/g,wR).getRegex(),gBi=mo(/\\(punct)/,"gu").replace(/punct/g,wR).getRegex(),ABi=mo(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),yBi=mo(rot).replace("(?:-->|$)","-->").getRegex(),EBi=mo("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",yBi).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Uwe=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,bBi=mo(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Uwe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bkn=mo(/^!?\[(label)\]\[(ref)\]/).replace("label",Uwe).replace("ref",not).getRegex(),_kn=mo(/^!?\[(ref)\](?:\[\])?/).replace("ref",not).getRegex(),_Bi=mo("reflink|nolink(?!\\()","g").replace("reflink",bkn).replace("nolink",_kn).getRegex(),okn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,sot={_backpedal:UF,anyPunctuation:gBi,autolink:ABi,blockSkip:tBi,br:gkn,code:z1i,del:UF,delLDelim:UF,delRDelim:UF,emStrongLDelim:nBi,emStrongRDelimAst:oBi,emStrongRDelimUnd:uBi,escape:Y1i,link:bBi,nolink:_kn,punctuation:J1i,reflink:bkn,reflinkSearch:_Bi,tag:EBi,text:K1i,url:UF},xBi={...sot,emStrongLDelim:sBi,emStrongRDelimAst:lBi,emStrongRDelimUnd:pBi,link:mo(/^!?\[(label)\]\((.*?)\)/).replace("label",Uwe).getRegex(),reflink:mo(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Uwe).getRegex()},Kst={...sot,emStrongRDelimAst:aBi,emStrongLDelim:rBi,delLDelim:mBi,delRDelim:fBi,url:mo(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",okn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:mo(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},akn=t=>CBi[t];O8=class{options;rules;lexer;constructor(t){this.options=t||$F}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:ukn(e[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=TBi(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=bD(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:bD(e[0],` +`),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:bD(e[0],` +`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=bD(e[0],` +`).split(` +`),r="",i="",s=[];for(;n.length>0;){let o=!1,a=[],c;for(c=0;c1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;t;){let c=!1,u="",l="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let d=wBi(e[2].split(` +`,1)[0],e[1].length),m=t.split(` +`,1)[0],h=!d.trim(),f=0;if(this.options.pedantic?(f=2,l=d.trimStart()):h?f=e[1].length+1:(f=d.search(this.rules.other.nonSpaceChar),f=f>4?1:f,l=d.slice(f),f+=e[1].length),h&&this.rules.other.blankLine.test(m)&&(u+=m+` +`,t=t.substring(m.length+1),c=!0),!c){let g=this.rules.other.nextBulletRegex(f),A=this.rules.other.hrRegex(f),y=this.rules.other.fencesBeginRegex(f),E=this.rules.other.headingBeginRegex(f),_=this.rules.other.htmlBeginRegex(f),S=this.rules.other.blockquoteBeginRegex(f);for(;t;){let C=t.split(` +`,1)[0],I;if(m=C,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),I=m):I=m.replace(this.rules.other.tabCharGlobal," "),y.test(m)||E.test(m)||_.test(m)||S.test(m)||g.test(m)||A.test(m))break;if(I.search(this.rules.other.nonSpaceChar)>=f||!m.trim())l+=` +`+I.slice(f);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(d)||E.test(d)||A.test(d))break;l+=` +`+m}h=!m.trim(),u+=C+` +`,t=t.substring(C.length+1),d=I.slice(f)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0)),i.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(l),loose:!1,text:l,tokens:[]}),i.raw+=u}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c of i.items)if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),!i.loose){let u=c.tokens.filter(d=>d.type==="space"),l=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=l}for(let c of i.items){let u=c.tokens[0];if(c.task&&(u?.type==="text"||u?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),u.raw=u.raw.replace(this.rules.other.listReplaceTask,""),u.text=u.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let l=this.rules.other.listTaskCheckbox.exec(c.raw);if(l){let d={type:"checkbox",raw:l[0]+" ",checked:l[0]!=="[ ]"};c.checked=d.checked,i.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=d.raw+c.tokens[0].raw,c.tokens[0].text=d.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(d)):c.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):c.tokens.unshift(d)}}else c.task&&(c.task=!1)}if(i.loose)for(let c of i.items){c.loose=!0;for(let u of c.tokens)u.type==="text"&&(u.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=ukn(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:bD(e[0],` +`),href:r,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=lkn(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(` +`):[],s={type:"table",raw:bD(e[0],` +`),header:[],align:[],rows:[]};if(n.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[c]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:bD(e[0],` +`),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===` +`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=bD(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=IBi(e[2],"()");if(s===-2)return;if(s>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),dkn(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return dkn(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,o,a=i,c=0,u=r[0][0],l=n===u,d=u==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(r=d.exec(e))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(o=[...s].length,r[3]||r[4]){a+=o;continue}else if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(l)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+c);let m=[...r[0]][0].length,h=t.slice(0,i+r.index+m+o);if(Math.min(i,o)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let f=h.slice(2,-2);return{type:"strong",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,o,a=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+i);(r=c.exec(e))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(o=[...s].length,o!==i))continue;if(r[3]||r[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let u=[...r[0]][0].length,l=t.slice(0,i+r.index+u+o),d=l.slice(i,-i);return{type:"del",raw:l,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},oS=class Jst{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$F,this.options.tokenizer=this.options.tokenizer||new O8,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let n={other:Yh,block:Qwe.normal,inline:gre.normal};this.options.pedantic?(n.block=Qwe.pedantic,n.inline=gre.pedantic):this.options.gfm&&(n.block=Qwe.gfm,this.options.breaks?n.inline=gre.breaks:n.inline=gre.gfm),this.tokenizer.rules=n}static get rules(){return{block:Qwe,inline:gre}}static lex(e,n){return new Jst(n).lex(e)}static lexInline(e,n){return new Jst(n).inlineTokens(e)}lex(e){e=e.replace(Yh.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let n=0;n(s=a.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let a=n.at(-1);s.raw.length===1&&a!==void 0?a.raw+=` +`:n.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+s.raw,a.text+=` +`+s.text,this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+s.raw,a.text+=` +`+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),n.push(s);continue}let o=e;if(this.options.extensions?.startBlock){let a=1/0,c=e.slice(1),u;this.options.extensions.startBlock.forEach(l=>{u=l.call({lexer:this},c),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(o))){let a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+s.raw,a.text+=` +`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s),r=o.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+s.raw,a.text+=` +`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let r of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(r[0])&&e.charAt(r.index-1)!=="!")return!0;for(let r of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=r[0],s=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,i.slice(s+1,-1)))&&!(s>1&&this.linkInText(i.slice(1,s-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let r=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,c=u=>{let l=u.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,u.slice(l+1,-1)))return u;if(l>1&&u.charAt(0)!=="!"){let d=u.slice(1,l-1);if(this.linkInText(d))return"["+d.replace(a,c)+"]["+"a".repeat(u.length-l-2)+"]"}return"["+"a".repeat(u.length-2)+"]"};r=r.replace(a,c)}r=r.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),r=r.replace(this.tokenizer.rules.inline.blockSkip,(a,c,u)=>{let l=u?u.length:0;return a.slice(0,l)+"["+"a".repeat(a.length-l-2)+"]"}),r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,s="",o=1/0;for(;e;){if(e.length(a=u.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let u=n.at(-1);a.type==="text"&&u?.type==="text"?(u.raw+=a.raw,u.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,r,s)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,r,s)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let c=e;if(this.options.extensions?.startInline){let u=1/0,l=e.slice(1),d;this.options.extensions.startInline.forEach(m=>{d=m.call({lexer:this},l),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(a=this.tokenizer.inlineText(c)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(s=a.raw.slice(-1)),i=!0;let u=n.at(-1);u?.type==="text"?(u.raw+=a.raw,u.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Gwe=class{options;parser;constructor(t){this.options=t||$F}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(Yh.notSpaceStart)?.[0],i=t.replace(Yh.endingNewline,"")+` +`;return r?'
'+(n?i:ow(i,!0))+`
+`:"
"+(n?i:ow(i,!0))+`
+`}blockquote({tokens:t}){return`
+${this.parser.parse(t)}
+`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`${this.parser.parseInline(t)} +`}hr(t){return`
+`}list(t){let e=t.ordered,n=t.start,r="";for(let o=0;o +`+r+" +`}listitem(t){return`
  • ${this.parser.parse(t.tokens)}
  • +`}checkbox({checked:t}){return" '}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    +`}table(t){let e="",n="";for(let i=0;i${r}`),` + +`+e+` +`+r+`
    +`}tablerow({text:t}){return` +${t} +`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+` +`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${ow(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),i=ckn(t);if(i===null)return r;t=i;let s='
    ",s}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=ckn(t);if(i===null)return ow(n);t=i;let s=`${ow(n)}{let o=i[s].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=e.renderers[i.name];s?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=s.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){let i=this.defaults.renderer||new Gwe(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,a=n.renderer[o],c=i[o];i[o]=(...u)=>{let l=a.apply(i,u);return l===!1&&(l=c.apply(i,u)),l||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new O8(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,a=n.tokenizer[o],c=i[o];i[o]=(...u)=>{let l=a.apply(i,u);return l===!1&&(l=c.apply(i,u)),l}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Are;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,a=n.hooks[o],c=i[o];Are.passThroughHooks.has(s)?i[o]=u=>{if(this.defaults.async&&Are.passThroughHooksRespectAsync.has(s))return(async()=>{let d=await a.call(i,u);return c.call(i,d)})();let l=a.call(i,u);return c.call(i,l)}:i[o]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,u);return d===!1&&(d=await c.apply(i,u)),d})();let l=a.apply(i,u);return l===!1&&(l=c.apply(i,u)),l}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(o){let a=[];return a.push(s.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return oS.lex(t,e??this.defaults)}parser(t,e){return aS.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?oS.lex:oS.lexInline)(o,i),c=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser(t):t?aS.parse:aS.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(s);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?oS.lex:oS.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?aS.parse:aS.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return s(o)}}}onError(t,e){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,t){let r="

    An error occurred:

    "+ow(n.message+"",!0)+"
    ";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},GF=new WF;gc.options=gc.setOptions=function(t){return GF.setOptions(t),gc.defaults=GF.defaults,pkn(gc.defaults),gc};gc.getDefaults=Zst;gc.defaults=$F;gc.use=vBi;gc.walkTokens=function(t,e){return GF.walkTokens(t,e)};gc.parseInline=GF.parseInline;gc.Parser=aS;gc.parser=aS.parse;gc.Renderer=Gwe;gc.TextRenderer=oot;gc.Lexer=oS;gc.lexer=oS.lex;gc.Tokenizer=O8;gc.Hooks=Are;gc.parse=gc;ltc=gc.options,utc=gc.setOptions,dtc=gc.walkTokens,ptc=gc.parseInline,mtc=aS.parse,htc=oS.lex});function bre(t,e){let n=t.toLowerCase(),r=e.toLowerCase(),i=l=>{if(l.length===0)return{matches:!0,score:0};if(l.length>r.length)return{matches:!1,score:0};let d=0,m=0,h=-1,f=0;for(;d=0&&(m+=(g-h-1)*2)),A&&(m-=10),m+=g*.1,h=g,d++}return d[a-z]+)(?[0-9]+)$/),a=n.match(/^(?[0-9]+)(?[a-z]+)$/),c=o?`${o.groups?.digits??""}${o.groups?.letters??""}`:a?`${a.groups?.letters??""}${a.groups?.digits??""}`:"";if(!c)return s;let u=i(c);return u.matches?{matches:!0,score:u.score+5}:s}function Pu(t,e,n){if(!e.trim())return t;let r=e.trim().split(/[\s/]+/).filter(s=>s.length>0);if(r.length===0)return t;let i=[];for(let s of t){let o=n(s),a=0,c=!0;for(let u of r){let l=bre(u,o);if(l.matches)a+=l.score;else{c=!1;break}}c&&i.push({item:s,totalScore:a})}return i.sort((s,o)=>s.totalScore-o.totalScore),i.map(s=>s.item)}var Wwe=v(()=>{p()});var xkn,Skn,Ckn,Ikn,wkn,Tkn,cot,vkn=v(()=>{p();xkn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Skn=12288,Ckn=65510,Ikn=[12288,12288,65281,65376,65504,65510],wkn=4352,Tkn=262141,cot=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141]});var Hwe,Rkn=v(()=>{p();Hwe=(t,e)=>{let n=0,r=Math.floor(t.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),s=i*2;if(et[s+1])n=i+1;else return!0}return!1}});function DBi(t){let e=t[0],n=t[1];for(let r=0;r=i&&kkn<=s)return[i,s];s-i>n-e&&(e=i,n=s)}return[e,n]}var kkn,BBi,NBi,Bkn,Nkn,Dkn,Pkn=v(()=>{p();vkn();Rkn();kkn=19968,[BBi,NBi]=DBi(cot);Bkn=t=>t<161||t>1114109?!1:Hwe(xkn,t),Nkn=t=>tCkn?!1:Hwe(Ikn,t),Dkn=t=>t>=BBi&&t<=NBi?!0:tTkn?!1:Hwe(cot,t)});function PBi(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function lot(t,{ambiguousAsWide:e=!1}={}){return PBi(t),Nkn(t)||Dkn(t)||e&&Bkn(t)?2:1}var Mkn=v(()=>{p();Pkn()});function Q8(){return yb}function U8(){return MBi}function OBi(t){let e=t.codePointAt(0);return e>=126976&&e<=130047||e>=8960&&e<=9215||e>=9728&&e<=10175||e>=11088&&e<=11093||t.includes("\uFE0F")||t.length>2}function pot(t){for(let e=0;e126)return!1}return!0}function HBi(t,e){if(e<=0||t.length===0)return{text:"",width:0};if(pot(t)){let c=t.slice(0,e);return{text:c,width:c.length}}let n=t.includes("\x1B"),r=t.includes(" ");if(!n&&!r){let c="",u=0;for(let{segment:l}of yb.segment(t)){let d=TR(l);if(u+d>e)break;c+=l,u+=d}return{text:c,width:u}}let i="",s=0,o=0,a="";for(;oe)break;a&&(i+=a,a=""),i+=" ",s+=3,o++;continue}let u=o;for(;ue)return{text:i,width:s};a&&(i+=a,a=""),i+=l,s+=d}o=u}return{text:i,width:s}}function uot(t,e,n,r,i,s){let o="\x1B[0m",a=YBi(t),c=e+r,u;return n.length>0?u=`${t}${a}${o}${n}${o}`:u=`${t}${a}${o}`,s?u+" ".repeat(Math.max(0,i-c)):u}function TR(t){if(t===" ")return 3;if(Okn.test(t))return[...t].length;if(LBi.test(t))return 0;if(OBi(t)&&GBi.test(t))return 2;let e=t.replace(FBi,""),n=e.codePointAt(0);if(n===void 0)return 0;if(n>=127462&&n<=127487)return 2;let r=lot(n),i=!1,s=[...e];for(let o of s.slice(1))if(Okn.test(o))r+=1,i=!1;else if(UBi.test(o))i=!0;else if(!QBi.test(o)){let a=o.codePointAt(0);i||a>=65280&&a<=65519?r+=lot(a):(a===3635||a===3763)&&(r+=1),i=!1}return r}function rn(t){if(t.length===0)return 0;if(pot(t))return t.length;let e=_re.get(t);if(e!==void 0)return e;let n=t;if(t.includes(" ")&&(n=n.replace(/\t/g," ")),n.includes("\x1B")){let i="",s=0;for(;s=$Bi){let i=_re.keys().next().value;i!==void 0&&_re.delete(i)}return _re.set(t,r),r}function HF(t){if(!t.includes("\x1B"))return t;let e="",n=0;for(;n0&&e>=n&&e=r&&ei==="\u0E33"?"\u0E4D\u0E32":"\u0ECD\u0EB2")),!e.includes(" "))return e;let n="",r=0;for(;r=t.length||t[e]!=="\x1B")return null;let n=t[e+1];if(n==="["){let r=e+2;for(;r{n&&(e.push(n),n="",i=null)};for(;s0?e[e.length-1]+=r:n=r),n&&e.push(n),e}function Ag(t,e){if(!t)return[""];let n=t.split(/\r\n|\r|\n/),r=[],i=new F8;for(let s of n){let o=r.length>0?i.getActiveCodes():"",a=KBi(o+s,e);for(let c of a)r.push(c);mot(s,i)}return r.length>0?r:[""]}function KBi(t,e){if(!t)return[""];if(rn(t)<=e)return[t];let r=[],i=new F8,s=zBi(t),o="",a=0;for(let c of s){let u=rn(c),l=c.trim()==="";if(u>e&&!l){if(o){let h=i.getLineEndReset();h&&(o+=h),r.push(o),o="",a=0}let m=JBi(c,e,i);for(let h=0;he&&a>0){let m=o.trimEnd(),h=i.getLineEndReset();h&&(m+=h),r.push(m),l?(o=i.getActiveCodes(),a=0):(o=i.getActiveCodes()+c,a=u)}else o+=c,a+=u;mot(c,i)}return o&&r.push(o),r.length>0?r.map(c=>c.trimEnd()):[""]}function hE(t){return/\s/.test(t)}function JBi(t,e,n){let r=[],i=n.getActiveCodes(),s=0,o=0,a=[];for(;oe){let d=n.getLineEndReset();d&&(i+=d),r.push(i),i=n.getActiveCodes(),s=0}i+=u,s+=l}return i&&r.push(i),r.length>0?r:[""]}function _D(t,e,n){let r=rn(t),i=Math.max(0,e-r),s=" ".repeat(i),o=t+s;return n(o)}function dr(t,e,n="...",r=!1){if(e<=0)return"";if(t.length===0)return r?" ".repeat(e):"";let i=rn(n);if(i>=e){let g=rn(t);if(g<=e)return r?t+" ".repeat(e-g):t;let A=HBi(n,e);return A.width===0?r?" ".repeat(e):"":uot("",0,A.text,A.width,e,r)}if(pot(t)){if(t.length<=e)return r?t+" ".repeat(e-t.length):t;let g=e-i;return uot(t.slice(0,g),g,n,i,e,r)}let s=e-i,o="",a="",c=0,u=0,l=!0,d=!1,m=!1,h=t.includes("\x1B"),f=t.includes(" ");if(!h&&!f){for(let{segment:g}of yb.segment(t)){let A=TR(g);if(l&&u+A<=s?(o+=g,u+=A):l=!1,c+=A,c>e){d=!0;break}}m=!d}else{let g=0;for(;ge){d=!0;break}g++;continue}let y=g;for(;ye){d=!0;break}}if(d)break;g=y}m=g>=t.length}return!d&&m?r?t+" ".repeat(Math.max(0,e-c)):t:uot(o,u,n,i,e,r)}function Hc(t,e,n,r=!1){return fot(t,e,n,r).text}function fot(t,e,n,r=!1){if(n<=0)return{text:"",width:0};let i=e+n,s="",o=0,a=0,c=0,u="";for(;c=e&&a=e&&a=i)break}if(c=d,a>=i)break}return{text:s,width:o}}function Gkn(t,e,n,r,i=!1){let s="",o=0,a="",c=0,u=0,l=0,d="",m=!1,h=n+r;for(dot.clear();l=n&&u=n&&u=e:u>=h)break}if(l=g,r<=0?u>=e:u>=h)break}return{before:s,beforeWidth:o,after:a,afterWidth:c}}var yb,MBi,LBi,FBi,QBi,UBi,Okn,GBi,$Bi,_re,G8,WBi,$8,xre,qBi,jBi,F8,hot,dot,ld=v(()=>{p();Mkn();yb=new Intl.Segmenter(void 0,{granularity:"grapheme"}),MBi=new Intl.Segmenter(void 0,{granularity:"word"});LBi=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),FBi=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),QBi=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})$","v"),UBi=new RegExp("^\\p{Mark}$","v"),Okn=new RegExp("^(?:[\\p{Spacing_Mark}--[\\u1734\\u302E\\u302F]]|[\\u065F\\u0F7F\\u102B\\u102C\\u1031\\u1033-\\u1035\\u1038\\u103A-\\u103E])+$","v"),GBi=new RegExp("^\\p{RGI_Emoji}$","v"),$Bi=512,_re=new Map,G8=/[\p{Script_Extensions=Han}\p{Script_Extensions=Hiragana}\p{Script_Extensions=Katakana}\p{Script_Extensions=Hangul}\p{Script_Extensions=Bopomofo}]/u,WBi=new RegExp(`(?:(?=\\p{Punctuation})${G8.source}|[\uFF0C\uFF0E\uFF1A\uFF1B\uFF01\uFF1F\uFF08\uFF09\uFF3B\uFF3D\uFF5B\uFF5D\u201C\u201D\u2018\u2019\u2026\u2014])`,"u"),$8=new RegExp(`(?:\\s|${WBi.source})`,"u"),xre=new RegExp(`(?:^|${$8.source})`,"u");qBi=/[\u0e33\u0eb3]/,jBi=/[\u0e33\u0eb3]/g;F8=class{bold=!1;dim=!1;italic=!1;underline=!1;blink=!1;inverse=!1;hidden=!1;strikethrough=!1;fgColor=null;bgColor=null;activeHyperlink=null;process(e){let n=Fkn(e);if(n!==void 0){this.activeHyperlink=n;return}if(!e.endsWith("m"))return;let r=e.match(/\x1b\[([\d;]*)m/);if(!r)return;let i=r[1];if(i===""||i==="0"){this.reset();return}let s=i.split(";"),o=0;for(;o=30&&a<=37||a>=90&&a<=97?this.fgColor=String(a):(a>=40&&a<=47||a>=100&&a<=107)&&(this.bgColor=String(a));break}o++}}reset(){this.bold=!1,this.dim=!1,this.italic=!1,this.underline=!1,this.blink=!1,this.inverse=!1,this.hidden=!1,this.strikethrough=!1,this.fgColor=null,this.bgColor=null}clear(){this.reset(),this.activeHyperlink=null}getActiveCodes(){let e=[];this.bold&&e.push("1"),this.dim&&e.push("2"),this.italic&&e.push("3"),this.underline&&e.push("4"),this.blink&&e.push("5"),this.inverse&&e.push("7"),this.hidden&&e.push("8"),this.strikethrough&&e.push("9"),this.fgColor&&e.push(this.fgColor),this.bgColor&&e.push(this.bgColor);let n=e.length>0?`\x1B[${e.join(";")}m`:"";return this.activeHyperlink&&(n+=VBi(this.activeHyperlink)),n}getActiveBackgroundCode(){return this.bgColor?`\x1B[${this.bgColor}m`:""}hasActiveCodes(){return this.bold||this.dim||this.italic||this.underline||this.blink||this.inverse||this.hidden||this.strikethrough||this.fgColor!==null||this.bgColor!==null||this.activeHyperlink!==null}getLineEndReset(){let e="";return this.underline&&(e+="\x1B[24m"),this.activeHyperlink&&(e+=Qkn(this.activeHyperlink.terminator)),e}};hot=/[(){}[\]<>.,;:'"!?+\-=*/\\|&%^$#@~`]/;dot=new F8});function vR(t){return t.replace(/\\/g,"/")}function XBi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ZBi(t){let e=vR(t);if(!e.includes("/"))return e;let n=e.endsWith("/"),r=e.replace(/^\/+|\/+$/g,"");if(!r)return e;let i="[\\\\/]",s=r.split("/").filter(Boolean).map(a=>XBi(a));if(s.length===0)return e;let o=s.join(i);return n&&(o+=i),o}function $kn(t){let e=-1,n=0;for(let r of t)n+=r.length,(zkn.has(r)||$8.test(r))&&(e=n-1);return e}function eNi(t){let e=!1,n=-1;for(let r=0;r0&&t[e-1]==="@"?Wkn(t,e-1)?t.slice(e-1):null:Wkn(t,e)?t.slice(e):null}function qkn(t){return t.startsWith('@"')?{rawPrefix:t.slice(2),isAtPrefix:!0,isQuotedPrefix:!0}:t.startsWith('"')?{rawPrefix:t.slice(1),isAtPrefix:!1,isQuotedPrefix:!0}:t.startsWith("@")?{rawPrefix:t.slice(1),isAtPrefix:!0,isQuotedPrefix:!1}:{rawPrefix:t,isAtPrefix:!1,isQuotedPrefix:!1}}function jkn(t,e){let n=e.isQuotedPrefix||$8.test(t),r=e.isAtPrefix?"@":"";return n?`${`${r}"`}${t}"`:`${r}${t}`}async function Vkn(t,e,n,r,i,s){let o=["--base-directory",t,"--max-results",String(r),"--type","f","--type","d","--follow","--hidden","--exclude",".git","--exclude",".git/*","--exclude",".git/**"];return s!==void 0&&o.push("--max-depth",String(s)),vR(n).includes("/")&&o.push("--full-path"),n&&o.push(ZBi(n)),await new Promise(a=>{if(i.aborted){a([]);return}let c=(0,Ykn.spawn)(e,o,{stdio:["ignore","pipe","pipe"]}),u="",l=!1,d=h=>{l||(l=!0,i.removeEventListener("abort",m),a(h))},m=()=>{c.exitCode===null&&c.kill("SIGKILL")};i.addEventListener("abort",m,{once:!0}),c.stdout.setEncoding("utf-8"),c.stdout.on("data",h=>{u+=h}),c.on("error",()=>{d([])}),c.on("close",h=>{if(i.aborted||h!==0||!u){d([]);return}let f=u.trim().split(` +`).filter(Boolean),g=[];for(let A of f){let y=vR(A),E=y.endsWith("/"),_=E?y.slice(0,-1):y;_===".git"||_.startsWith(".git/")||_.includes("/.git/")||g.push({path:y,isDirectory:E})}d(g)})})}var Ykn,Cre,got,im,zkn,Kkn,W8,Jkn=v(()=>{p();Ykn=require("child_process"),Cre=require("fs"),got=require("os"),im=require("path");Wwe();ld();zkn=new Set([" "," ",'"',"'","="]),Kkn=new RegExp(`${xre.source}$`,"u");W8=class{commands;basePath;fdPath;constructor(e=[],n,r=null){this.commands=e,this.basePath=n,this.fdPath=r}async getSuggestions(e,n,r,i){let o=(e[n]||"").slice(0,r),a=this.extractAtPrefix(o);if(a){let{rawPrefix:l,isQuotedPrefix:d}=qkn(a),m=await this.getFuzzyFileSuggestions(l,{isQuotedPrefix:d,signal:i.signal});return m.length===0?null:{items:m,prefix:a}}if(!i.force&&o.startsWith("/")){let l=o.indexOf(" ");if(l===-1){let g=o.slice(1),A=this.commands.map(E=>{let _="name"in E?E.name:E.value,S="argumentHint"in E&&E.argumentHint?E.argumentHint:void 0,C=E.description??"",I=S?C?`${S} \u2014 ${C}`:S:C;return{name:_,label:_,description:I||void 0}}),y=Pu(A,g,E=>!g.startsWith("skill:")&&E.name.startsWith("skill:")?E.name.slice(6):E.name).map(E=>({value:E.name,label:E.label,...E.description&&{description:E.description}}));return y.length===0?null:{items:y,prefix:o}}let d=o.slice(1,l),m=o.slice(l+1),h=this.commands.find(g=>("name"in g?g.name:g.value)===d);if(!h||!("getArgumentCompletions"in h)||!h.getArgumentCompletions)return null;let f=await h.getArgumentCompletions(m);return!Array.isArray(f)||f.length===0?null:{items:f,prefix:m}}let c=this.extractPathPrefix(o,i.force??!1);if(c===null)return null;let u=this.getFileSuggestions(c);return u.length===0?null:{items:u,prefix:c}}applyCompletion(e,n,r,i,s){let o=e[n]||"",a=o.slice(0,r-s.length),c=o.slice(r),u=s.startsWith('"')||s.startsWith('@"'),l=c.startsWith('"'),d=i.value.endsWith('"'),m=u&&d&&l?c.slice(1):c;if(s.startsWith("/")&&a.trim()===""&&!s.slice(1).includes("/")){let S=`${a}/${i.value} ${m}`,C=[...e];return C[n]=S,{lines:C,cursorLine:n,cursorCol:a.length+i.value.length+2}}if(s.startsWith("@")){let S=i.label.endsWith("/"),C=S?"":" ",I=`${a+i.value}${C}${m}`,w=[...e];w[n]=I;let k=i.value.endsWith('"'),N=S&&k?i.value.length-1:i.value.length;return{lines:w,cursorLine:n,cursorCol:a.length+N+C.length}}let f=o.slice(0,r);if(f.includes("/")&&f.includes(" ")){let S=a+i.value+m,C=[...e];C[n]=S;let I=i.label.endsWith("/"),w=i.value.endsWith('"'),k=I&&w?i.value.length-1:i.value.length;return{lines:C,cursorLine:n,cursorCol:a.length+k}}let g=a+i.value+m,A=[...e];A[n]=g;let y=i.label.endsWith("/"),E=i.value.endsWith('"'),_=y&&E?i.value.length-1:i.value.length;return{lines:A,cursorLine:n,cursorCol:a.length+_}}extractAtPrefix(e){let n=Hkn(e);if(n?.startsWith('@"'))return n;let r=$kn(e),i=r===-1?0:r+1;return e[i]==="@"?e.slice(i):null}extractPathPrefix(e,n=!1){let r=Hkn(e);if(r)return r;let i=$kn(e),s=i===-1?e:e.slice(i+1);return n||s.includes("/")||s.startsWith(".")||s.startsWith("~/")||s===""&&e!==""&&Kkn.test(e)?s:null}expandHomePath(e){if(e.startsWith("~/")){let n=(0,im.join)((0,got.homedir)(),e.slice(2));return e.endsWith("/")&&!n.endsWith("/")?`${n}/`:n}else if(e==="~")return(0,got.homedir)();return e}resolveScopedFuzzyQuery(e){let n=vR(e),r=n.lastIndexOf("/");if(r===-1)return null;let i=n.slice(0,r+1),s=n.slice(r+1),o;i.startsWith("~/")?o=this.expandHomePath(i):i.startsWith("/")?o=i:o=(0,im.join)(this.basePath,i);try{if(!(0,Cre.statSync)(o).isDirectory())return null}catch{return null}return{baseDir:o,query:s,displayBase:i}}scopedPathForDisplay(e,n){let r=vR(n);return e==="/"?`/${r}`:`${vR(e)}${r}`}getFileSuggestions(e){try{let n,r,{rawPrefix:i,isAtPrefix:s,isQuotedPrefix:o}=qkn(e),a=i;if(a.startsWith("~")&&(a=this.expandHomePath(a)),i===""||i==="./"||i==="../"||i==="~"||i==="~/"||i==="/"||s&&i==="")i.startsWith("~")||a.startsWith("/")?n=a:n=(0,im.join)(this.basePath,a),r="";else if(i.endsWith("/"))i.startsWith("~")||a.startsWith("/")?n=a:n=(0,im.join)(this.basePath,a),r="";else{let d=(0,im.dirname)(a),m=(0,im.basename)(a);i.startsWith("~")||a.startsWith("/")?n=d:n=(0,im.join)(this.basePath,d),r=m}let u=(0,Cre.readdirSync)(n,{withFileTypes:!0}),l=[];for(let d of u){if(!d.name.toLowerCase().startsWith(r.toLowerCase()))continue;let m=d.isDirectory();if(!m&&d.isSymbolicLink())try{let E=(0,im.join)(n,d.name);m=(0,Cre.statSync)(E).isDirectory()}catch{}let h,f=d.name,g=i;if(g.endsWith("/"))h=g+f;else if(g.includes("/")||g.includes("\\"))if(g.startsWith("~/")){let E=g.slice(2),_=(0,im.dirname)(E);h=`~/${_==="."?f:(0,im.join)(_,f)}`}else if(g.startsWith("/")){let E=(0,im.dirname)(g);E==="/"?h=`/${f}`:h=`${E}/${f}`}else h=(0,im.join)((0,im.dirname)(g),f),g.startsWith("./")&&!h.startsWith("./")&&(h=`./${h}`);else g.startsWith("~")?h=`~/${f}`:h=f;h=vR(h);let A=m?`${h}/`:h,y=jkn(A,{isDirectory:m,isAtPrefix:s,isQuotedPrefix:o});l.push({value:y,label:f+(m?"/":"")})}return l.sort((d,m)=>{let h=d.label.endsWith("/"),f=m.label.endsWith("/");return h&&!f?-1:!h&&f?1:d.label.localeCompare(m.label)}),l}catch{return[]}}scoreEntry(e,n,r){let s=(0,im.basename)(e).toLowerCase(),o=n.toLowerCase(),a=0;return s===o?a=100:s.startsWith(o)?a=80:s.includes(o)?a=50:e.toLowerCase().includes(o)&&(a=30),r&&a>0&&(a+=10),a}async getBaseDirSuggestions(e,n,r){return!this.fdPath||r.aborted?[]:await Vkn(e,this.fdPath,n,100,r,1)}async getFuzzyFileSuggestions(e,n){if(!this.fdPath||n.signal.aborted)return[];try{let r=this.resolveScopedFuzzyQuery(e),i=r?.baseDir??this.basePath,s=r?.query??e,o=await this.getBaseDirSuggestions(i,s,n.signal),a=await Vkn(i,this.fdPath,s,100,n.signal),c=new Set(o.map(h=>h.path)),u=[...o,...a.filter(h=>c.has(h.path)?!1:(c.add(h.path),!0))];if(n.signal.aborted)return[];let l=u.map(h=>({...h,score:s?this.scoreEntry(h.path,s,h.isDirectory):1})).filter(h=>h.score>0);l.sort((h,f)=>{let g=f.score-h.score;if(g!==0)return g;let A=vR(h.path).split("/").filter(Boolean).length,y=vR(f.path).split("/").filter(Boolean).length,E=A-y;if(E!==0)return E;let _=h.path.length-f.path.length;return _!==0?_:h.path.localeCompare(f.path)});let d=l.slice(0,20),m=[];for(let{path:h,isDirectory:f}of d){let g=f?h.slice(0,-1):h,A=r?this.scopedPathForDisplay(r.displayBase,g):g,y=(0,im.basename)(g),E=f?`${A}/`:A,_=jkn(E,{isDirectory:f,isAtPrefix:!0,isQuotedPrefix:n.isQuotedPrefix});m.push({value:_,label:y+(f?"/":""),description:A})}return m}catch{return[]}}shouldTriggerFileCompletion(e,n,r){let s=(e[n]||"").slice(0,r);return!(s.trim().startsWith("/")&&!s.trim().includes(" "))}}});function j8(t){Zm=t}function t1n(){return Zm}function zwe(t){return tNi.get(t)??t}function Ire(t,e){return(e&~q8&pr.shift)!==0&&t>=65&&t<=90?t+32:t}function V8(t){return t.includes("\x1B[200~")?!1:!!(t.includes(":3u")||t.includes(":3~")||t.includes(":3A")||t.includes(":3B")||t.includes(":3C")||t.includes(":3D")||t.includes(":3H")||t.includes(":3F"))}function n1n(t){return t.includes("\x1B[200~")?!1:!!(t.includes(":2u")||t.includes(":2~")||t.includes(":2A")||t.includes(":2B")||t.includes(":2C")||t.includes(":2D")||t.includes(":2H")||t.includes(":2F"))}function Vwe(t){if(!t)return"press";let e=parseInt(t,10);return e===2?"repeat":e===3?"release":"press"}function r1n(t){let e=t.match(/^\x1b\[(\d+)(?::(\d*))?(?::(\d+))?(?:;(\d+))?(?::(\d+))?u$/);if(e){let s=parseInt(e[1],10),o=e[2]&&e[2].length>0?parseInt(e[2],10):void 0,a=e[3]?parseInt(e[3],10):void 0,c=e[4]?parseInt(e[4],10):1,u=Vwe(e[5]);return jwe=u,{codepoint:s,shiftedKey:o,baseLayoutKey:a,modifier:c-1,eventType:u}}let n=t.match(/^\x1b\[1;(\d+)(?::(\d+))?([ABCD])$/);if(n){let s=parseInt(n[1],10),o=Vwe(n[2]),a={A:-1,B:-2,C:-3,D:-4};return jwe=o,{codepoint:a[n[3]],modifier:s-1,eventType:o}}let r=t.match(/^\x1b\[(\d+)(?:;(\d+))?(?::(\d+))?~$/);if(r){let s=parseInt(r[1],10),o=r[2]?parseInt(r[2],10):1,a=Vwe(r[3]),u={2:na.insert,3:na.delete,5:na.pageUp,6:na.pageDown,7:na.home,8:na.end}[s];if(u!==void 0)return jwe=a,{codepoint:u,modifier:o-1,eventType:a}}let i=t.match(/^\x1b\[1;(\d+)(?::(\d+))?([HF])$/);if(i){let s=parseInt(i[1],10),o=Vwe(i[2]),a=i[3]==="H"?na.home:na.end;return jwe=o,{codepoint:a,modifier:s-1,eventType:o}}return null}function Fi(t,e,n){let r=r1n(t);if(!r)return!1;let i=r.modifier&~q8,s=n&~q8;if(i!==s)return!1;let o=Ire(zwe(r.codepoint),r.modifier),a=Ire(zwe(e),n);if(o===a)return!0;if(r.baseLayoutKey!==void 0&&r.baseLayoutKey===e){let c=o,u=c>=97&&c<=122,l=H8.has(String.fromCharCode(c));if(!u&&!l)return!0}return!1}function Kwe(t){let e=t.match(/^\x1b\[27;(\d+);(\d+)~$/);if(!e)return null;let n=parseInt(e[1],10);return{codepoint:parseInt(e[2],10),modifier:n-1}}function bb(t,e,n){let r=Kwe(t);return r?r.codepoint===e&&r.modifier===n:!1}function i1n(){return!!process.env.WT_SESSION&&!process.env.SSH_CONNECTION&&!process.env.SSH_CLIENT&&!process.env.SSH_TTY}function Xkn(t,e){return t==="\x7F"?e===0:t!=="\b"?!1:i1n()?e===pr.ctrl:e===0}function sNi(t){let e=t.toLowerCase(),n=e.charCodeAt(0);return n>=97&&n<=122||e==="["||e==="\\"||e==="]"||e==="_"?String.fromCharCode(n&31):e==="-"?"":null}function Zkn(t){return t>="0"&&t<="9"}function Ywe(t,e,n){if(n===0)return!1;let r=Kwe(t);return!r||r.modifier!==n?!1:Ire(r.codepoint,r.modifier)===Ire(e,n)}function oNi(t,e){let n=[],r=e&~q8,i=pr.shift|pr.ctrl|pr.alt|pr.super;if((r&~i)===0)return r&pr.shift&&n.push("shift"),r&pr.ctrl&&n.push("ctrl"),r&pr.alt&&n.push("alt"),r&pr.super&&n.push("super"),n.length>0?`${n.join("+")}+${t}`:t}function aNi(t){let e=t.toLowerCase().split("+"),n=e[e.length-1];return n?{key:n,ctrl:e.includes("ctrl"),shift:e.includes("shift"),alt:e.includes("alt"),super:e.includes("super")}:null}function sm(t,e){let n=aNi(e);if(!n)return!1;let{key:r,ctrl:i,shift:s,alt:o,super:a}=n,c=0;switch(s&&(c|=pr.shift),o&&(c|=pr.alt),i&&(c|=pr.ctrl),a&&(c|=pr.super),r){case"escape":case"esc":return c!==0?!1:t==="\x1B"||Fi(t,Co.escape,0)||bb(t,Co.escape,0);case"space":return!Zm&&(c===pr.ctrl&&t==="\0"||c===pr.alt&&t==="\x1B ")?!0:c===0?t===" "||Fi(t,Co.space,0)||bb(t,Co.space,0):Fi(t,Co.space,c)||bb(t,Co.space,c);case"tab":return c===pr.shift?t==="\x1B[Z"||Fi(t,Co.tab,pr.shift)||bb(t,Co.tab,pr.shift):c===0?t===" "||Fi(t,Co.tab,0):Fi(t,Co.tab,c)||bb(t,Co.tab,c);case"enter":case"return":return c===pr.shift?Fi(t,Co.enter,pr.shift)||Fi(t,Co.kpEnter,pr.shift)||bb(t,Co.enter,pr.shift)?!0:Zm?t==="\x1B\r"||t===` +`:!1:c===pr.alt?Fi(t,Co.enter,pr.alt)||Fi(t,Co.kpEnter,pr.alt)||bb(t,Co.enter,pr.alt)?!0:Zm?!1:t==="\x1B\r":c===0?t==="\r"||!Zm&&t===` +`||t==="\x1BOM"||Fi(t,Co.enter,0)||Fi(t,Co.kpEnter,0):Fi(t,Co.enter,c)||Fi(t,Co.kpEnter,c)||bb(t,Co.enter,c);case"backspace":return c===pr.alt?t==="\x1B\x7F"||t==="\x1B\b"?!0:Fi(t,Co.backspace,pr.alt)||bb(t,Co.backspace,pr.alt):c===pr.ctrl?Xkn(t,pr.ctrl)?!0:Fi(t,Co.backspace,pr.ctrl)||bb(t,Co.backspace,pr.ctrl):c===0?Xkn(t,0)||Fi(t,Co.backspace,0)||bb(t,Co.backspace,0):Fi(t,Co.backspace,c)||bb(t,Co.backspace,c);case"insert":return c===0?TA(t,Eb.insert)||Fi(t,na.insert,0):fE(t,"insert",c)?!0:Fi(t,na.insert,c);case"delete":return c===0?TA(t,Eb.delete)||Fi(t,na.delete,0):fE(t,"delete",c)?!0:Fi(t,na.delete,c);case"clear":return c===0?TA(t,Eb.clear):fE(t,"clear",c);case"home":return c===0?TA(t,Eb.home)||Fi(t,na.home,0):fE(t,"home",c)?!0:Fi(t,na.home,c);case"end":return c===0?TA(t,Eb.end)||Fi(t,na.end,0):fE(t,"end",c)?!0:Fi(t,na.end,c);case"pageup":return c===0?TA(t,Eb.pageUp)||Fi(t,na.pageUp,0):fE(t,"pageUp",c)?!0:Fi(t,na.pageUp,c);case"pagedown":return c===0?TA(t,Eb.pageDown)||Fi(t,na.pageDown,0):fE(t,"pageDown",c)?!0:Fi(t,na.pageDown,c);case"up":return c===pr.alt?t==="\x1Bp"||Fi(t,Mu.up,pr.alt):c===0?TA(t,Eb.up)||Fi(t,Mu.up,0):fE(t,"up",c)?!0:Fi(t,Mu.up,c);case"down":return c===pr.alt?t==="\x1Bn"||Fi(t,Mu.down,pr.alt):c===0?TA(t,Eb.down)||Fi(t,Mu.down,0):fE(t,"down",c)?!0:Fi(t,Mu.down,c);case"left":return c===pr.alt?t==="\x1B[1;3D"||!Zm&&t==="\x1BB"||t==="\x1Bb"||Fi(t,Mu.left,pr.alt):c===pr.ctrl?t==="\x1B[1;5D"||fE(t,"left",pr.ctrl)||Fi(t,Mu.left,pr.ctrl):c===0?TA(t,Eb.left)||Fi(t,Mu.left,0):fE(t,"left",c)?!0:Fi(t,Mu.left,c);case"right":return c===pr.alt?t==="\x1B[1;3C"||!Zm&&t==="\x1BF"||t==="\x1Bf"||Fi(t,Mu.right,pr.alt):c===pr.ctrl?t==="\x1B[1;5C"||fE(t,"right",pr.ctrl)||Fi(t,Mu.right,pr.ctrl):c===0?TA(t,Eb.right)||Fi(t,Mu.right,0):fE(t,"right",c)?!0:Fi(t,Mu.right,c);case"f1":case"f2":case"f3":case"f4":case"f5":case"f6":case"f7":case"f8":case"f9":case"f10":case"f11":case"f12":return c!==0?!1:TA(t,Eb[r])}if(r.length===1&&(r>="a"&&r<="z"||Zkn(r)||H8.has(r))){let u=r.charCodeAt(0),l=sNi(r),d=r>="a"&&r<="z",m=Zkn(r);return c===pr.ctrl+pr.alt&&!Zm&&l&&t===`\x1B${l}`||c===pr.alt&&!Zm&&(d||m||H8.has(r))&&t===`\x1B${r}`?!0:c===pr.ctrl?l&&t===l?!0:Fi(t,u,pr.ctrl)||Ywe(t,u,pr.ctrl):c===pr.shift+pr.ctrl?Fi(t,u,pr.shift+pr.ctrl)||Ywe(t,u,pr.shift+pr.ctrl):c===pr.shift?d&&t===r.toUpperCase()?!0:Fi(t,u,pr.shift)||Ywe(t,u,pr.shift):c!==0?Fi(t,u,c)||Ywe(t,u,c):t===r||Fi(t,u,0)}return!1}function e1n(t,e,n){let r=zwe(t),i=Ire(r,e),s=i>=97&&i<=122,o=i>=48&&i<=57,a=H8.has(String.fromCharCode(i)),c=s||o||a?i:n??i,u;if(c===Co.escape?u="escape":c===Co.tab?u="tab":c===Co.enter||c===Co.kpEnter?u="enter":c===Co.space?u="space":c===Co.backspace?u="backspace":c===na.delete?u="delete":c===na.insert?u="insert":c===na.home?u="home":c===na.end?u="end":c===na.pageUp?u="pageUp":c===na.pageDown?u="pageDown":c===Mu.up?u="up":c===Mu.down?u="down":c===Mu.left?u="left":c===Mu.right?u="right":(c>=48&&c<=57||c>=97&&c<=122||H8.has(String.fromCharCode(c)))&&(u=String.fromCharCode(c)),!!u)return oNi(u,e)}function s1n(t){let e=r1n(t);if(e)return e1n(e.codepoint,e.modifier,e.baseLayoutKey);let n=Kwe(t);if(n)return e1n(n.codepoint,n.modifier);if(Zm&&(t==="\x1B\r"||t===` +`))return"shift+enter";let r=iNi[t];if(r)return r;if(t==="\x1B")return"escape";if(t==="")return"ctrl+\\";if(t==="")return"ctrl+]";if(t==="")return"ctrl+-";if(t==="\x1B\x1B")return"ctrl+alt+[";if(t==="\x1B")return"ctrl+alt+\\";if(t==="\x1B")return"ctrl+alt+]";if(t==="\x1B")return"ctrl+alt+-";if(t===" ")return"tab";if(t==="\r"||!Zm&&t===` +`||t==="\x1BOM")return"enter";if(t==="\0")return"ctrl+space";if(t===" ")return"space";if(t==="\x7F")return"backspace";if(t==="\b")return i1n()?"ctrl+backspace":"backspace";if(t==="\x1B[Z")return"shift+tab";if(!Zm&&t==="\x1B\r")return"alt+enter";if(!Zm&&t==="\x1B ")return"alt+space";if(t==="\x1B\x7F"||t==="\x1B\b")return"alt+backspace";if(!Zm&&t==="\x1BB")return"alt+left";if(!Zm&&t==="\x1BF")return"alt+right";if(!Zm&&t.length===2&&t[0]==="\x1B"){let i=t.charCodeAt(1);if(i>=1&&i<=26)return`ctrl+alt+${String.fromCharCode(i+96)}`;let s=String.fromCharCode(i);if(i>=97&&i<=122||i>=48&&i<=57||H8.has(s))return`alt+${s}`}if(t==="\x1B[A")return"up";if(t==="\x1B[B")return"down";if(t==="\x1B[C")return"right";if(t==="\x1B[D")return"left";if(t==="\x1B[H"||t==="\x1BOH")return"home";if(t==="\x1B[F"||t==="\x1BOF")return"end";if(t==="\x1B[3~")return"delete";if(t==="\x1B[5~")return"pageUp";if(t==="\x1B[6~")return"pageDown";if(t.length===1){let i=t.charCodeAt(0);if(i>=1&&i<=26)return`ctrl+${String.fromCharCode(i+96)}`;if(i>=32&&i<=126)return t}}function Tre(t){let e=t.match(cNi);if(!e)return;let n=Number.parseInt(e[1]??"",10);if(!Number.isFinite(n))return;let r=e[2]&&e[2].length>0?Number.parseInt(e[2],10):void 0,i=e[4]?Number.parseInt(e[4],10):1,s=Number.isFinite(i)?i-1:0;if((s&~lNi)!==0||s&(pr.alt|pr.ctrl))return;let o=n;if(s&pr.shift&&typeof r=="number"&&(o=r),o=zwe(o),!(!Number.isFinite(o)||o<32))try{return String.fromCodePoint(o)}catch{return}}function uNi(t){let e=Kwe(t);if(!(!e||(e.modifier&~q8&~pr.shift)!==0)&&!(!Number.isFinite(e.codepoint)||e.codepoint<32))try{return String.fromCodePoint(e.codepoint)}catch{return}}function Aot(t){return Tre(t)??uNi(t)}var Zm,wre,H8,pr,q8,Co,Mu,na,tNi,Eb,nNi,rNi,iNi,TA,fE,jwe,cNi,lNi,xD=v(()=>{p();Zm=!1;wre={escape:"escape",esc:"esc",enter:"enter",return:"return",tab:"tab",space:"space",backspace:"backspace",delete:"delete",insert:"insert",clear:"clear",home:"home",end:"end",pageUp:"pageUp",pageDown:"pageDown",up:"up",down:"down",left:"left",right:"right",f1:"f1",f2:"f2",f3:"f3",f4:"f4",f5:"f5",f6:"f6",f7:"f7",f8:"f8",f9:"f9",f10:"f10",f11:"f11",f12:"f12",backtick:"`",hyphen:"-",equals:"=",leftbracket:"[",rightbracket:"]",backslash:"\\",semicolon:";",quote:"'",comma:",",period:".",slash:"/",exclamation:"!",at:"@",hash:"#",dollar:"$",percent:"%",caret:"^",ampersand:"&",asterisk:"*",leftparen:"(",rightparen:")",underscore:"_",plus:"+",pipe:"|",tilde:"~",leftbrace:"{",rightbrace:"}",colon:":",lessthan:"<",greaterthan:">",question:"?",ctrl:t=>`ctrl+${t}`,shift:t=>`shift+${t}`,alt:t=>`alt+${t}`,super:t=>`super+${t}`,ctrlShift:t=>`ctrl+shift+${t}`,shiftCtrl:t=>`shift+ctrl+${t}`,ctrlAlt:t=>`ctrl+alt+${t}`,altCtrl:t=>`alt+ctrl+${t}`,shiftAlt:t=>`shift+alt+${t}`,altShift:t=>`alt+shift+${t}`,ctrlSuper:t=>`ctrl+super+${t}`,superCtrl:t=>`super+ctrl+${t}`,shiftSuper:t=>`shift+super+${t}`,superShift:t=>`super+shift+${t}`,altSuper:t=>`alt+super+${t}`,superAlt:t=>`super+alt+${t}`,ctrlShiftAlt:t=>`ctrl+shift+alt+${t}`,ctrlShiftSuper:t=>`ctrl+shift+super+${t}`},H8=new Set(["`","-","=","[","]","\\",";","'",",",".","/","!","@","#","$","%","^","&","*","(",")","_","+","|","~","{","}",":","<",">","?"]),pr={shift:1,alt:2,ctrl:4,super:8},q8=192,Co={escape:27,tab:9,enter:13,space:32,backspace:127,kpEnter:57414},Mu={up:-1,down:-2,right:-3,left:-4},na={delete:-10,insert:-11,pageUp:-12,pageDown:-13,home:-14,end:-15},tNi=new Map([[57399,48],[57400,49],[57401,50],[57402,51],[57403,52],[57404,53],[57405,54],[57406,55],[57407,56],[57408,57],[57409,46],[57410,47],[57411,42],[57412,45],[57413,43],[57415,61],[57416,44],[57417,Mu.left],[57418,Mu.right],[57419,Mu.up],[57420,Mu.down],[57421,na.pageUp],[57422,na.pageDown],[57423,na.home],[57424,na.end],[57425,na.insert],[57426,na.delete]]);Eb={up:["\x1B[A","\x1BOA"],down:["\x1B[B","\x1BOB"],right:["\x1B[C","\x1BOC"],left:["\x1B[D","\x1BOD"],home:["\x1B[H","\x1BOH","\x1B[1~","\x1B[7~"],end:["\x1B[F","\x1BOF","\x1B[4~","\x1B[8~"],insert:["\x1B[2~"],delete:["\x1B[3~"],pageUp:["\x1B[5~","\x1B[[5~"],pageDown:["\x1B[6~","\x1B[[6~"],clear:["\x1B[E","\x1BOE"],f1:["\x1BOP","\x1B[11~","\x1B[[A"],f2:["\x1BOQ","\x1B[12~","\x1B[[B"],f3:["\x1BOR","\x1B[13~","\x1B[[C"],f4:["\x1BOS","\x1B[14~","\x1B[[D"],f5:["\x1B[15~","\x1B[[E"],f6:["\x1B[17~"],f7:["\x1B[18~"],f8:["\x1B[19~"],f9:["\x1B[20~"],f10:["\x1B[21~"],f11:["\x1B[23~"],f12:["\x1B[24~"]},nNi={up:["\x1B[a"],down:["\x1B[b"],right:["\x1B[c"],left:["\x1B[d"],clear:["\x1B[e"],insert:["\x1B[2$"],delete:["\x1B[3$"],pageUp:["\x1B[5$"],pageDown:["\x1B[6$"],home:["\x1B[7$"],end:["\x1B[8$"]},rNi={up:["\x1BOa"],down:["\x1BOb"],right:["\x1BOc"],left:["\x1BOd"],clear:["\x1BOe"],insert:["\x1B[2^"],delete:["\x1B[3^"],pageUp:["\x1B[5^"],pageDown:["\x1B[6^"],home:["\x1B[7^"],end:["\x1B[8^"]},iNi={"\x1BOA":"up","\x1BOB":"down","\x1BOC":"right","\x1BOD":"left","\x1BOH":"home","\x1BOF":"end","\x1B[E":"clear","\x1BOE":"clear","\x1BOe":"ctrl+clear","\x1B[e":"shift+clear","\x1B[2~":"insert","\x1B[2$":"shift+insert","\x1B[2^":"ctrl+insert","\x1B[3$":"shift+delete","\x1B[3^":"ctrl+delete","\x1B[[5~":"pageUp","\x1B[[6~":"pageDown","\x1B[a":"shift+up","\x1B[b":"shift+down","\x1B[c":"shift+right","\x1B[d":"shift+left","\x1BOa":"ctrl+up","\x1BOb":"ctrl+down","\x1BOc":"ctrl+right","\x1BOd":"ctrl+left","\x1B[5$":"shift+pageUp","\x1B[6$":"shift+pageDown","\x1B[7$":"shift+home","\x1B[8$":"shift+end","\x1B[5^":"ctrl+pageUp","\x1B[6^":"ctrl+pageDown","\x1B[7^":"ctrl+home","\x1B[8^":"ctrl+end","\x1BOP":"f1","\x1BOQ":"f2","\x1BOR":"f3","\x1BOS":"f4","\x1B[11~":"f1","\x1B[12~":"f2","\x1B[13~":"f3","\x1B[14~":"f4","\x1B[[A":"f1","\x1B[[B":"f2","\x1B[[C":"f3","\x1B[[D":"f4","\x1B[[E":"f5","\x1B[15~":"f5","\x1B[17~":"f6","\x1B[18~":"f7","\x1B[19~":"f8","\x1B[20~":"f9","\x1B[21~":"f10","\x1B[23~":"f11","\x1B[24~":"f12","\x1Bb":"alt+left","\x1Bf":"alt+right","\x1Bp":"alt+up","\x1Bn":"alt+down"},TA=(t,e)=>e.includes(t),fE=(t,e,n)=>n===pr.shift?TA(t,nNi[e]):n===pr.ctrl?TA(t,rNi[e]):!1,jwe="press";cNi=/^\x1b\[(\d+)(?::(\d*))?(?::(\d+))?(?:;(\d+))?(?::(\d+))?u$/,lNi=pr.shift|q8});function dNi(t){let e=t.startsWith("#")?t.slice(1):t,n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return{r:n,g:r,b:i}}function Y8(t){if(!/^[0-9a-f]+$/i.test(t))return;let e=16**t.length-1;if(!(e<=0))return Math.round(parseInt(t,16)/e*255)}function a1n(t){return o1n.test(t)}function Jwe(t){let e=t.match(o1n);if(!e)return;let n=e[1].trim();if(n.startsWith("#")){let l=n.slice(1);if(/^[0-9a-f]{6}$/i.test(l))return dNi(n);if(/^[0-9a-f]{12}$/i.test(l)){let d=Y8(l.slice(0,4)),m=Y8(l.slice(4,8)),h=Y8(l.slice(8,12));return d!==void 0&&m!==void 0&&h!==void 0?{r:d,g:m,b:h}:void 0}return}let r=n.replace(/^rgba?:/i,""),[i,s,o]=r.split("/");if(i===void 0||s===void 0||o===void 0)return;let a=Y8(i),c=Y8(s),u=Y8(o);return a!==void 0&&c!==void 0&&u!==void 0?{r:a,g:c,b:u}:void 0}function Xwe(t){let e=t.match(pNi);if(e)return e[1]==="2"?"light":"dark"}var o1n,pNi,yot=v(()=>{p();o1n=/^\x1b\]11;([^\x07\x1b]*)(?:\x07|\x1b\\)$/i,pNi=/^(?:\x1b\[\?997;(1|2)n)+$/});function vre(){return f1n}function Zwe(t){f1n=t}function mNi(){try{return(0,d1n.execSync)("tmux display-message -p '#{client_termfeatures}'",{encoding:"utf8",timeout:250,stdio:["ignore","pipe","ignore"]}).split(",").map(e=>e.trim()).includes("hyperlinks")}catch{return!1}}function hNi(t){let e=process.env.TERM_PROGRAM?.toLowerCase()||"",n=process.env.TERMINAL_EMULATOR?.toLowerCase()||"",r=process.env.TERM?.toLowerCase()||"",i=process.env.COLORTERM?.toLowerCase()||"",s=i==="truecolor"||i==="24bit",o=process.platform==="win32";return process.env.TMUX||r.startsWith("tmux")?{images:null,trueColor:s,hyperlinks:t()}:r.startsWith("screen")?{images:null,trueColor:s,hyperlinks:!1}:process.env.KITTY_WINDOW_ID||e==="kitty"?{images:"kitty",trueColor:!0,hyperlinks:!0}:e==="ghostty"||r.includes("ghostty")||process.env.GHOSTTY_RESOURCES_DIR?{images:"kitty",trueColor:!0,hyperlinks:!0}:process.env.WEZTERM_PANE||e==="wezterm"?{images:"kitty",trueColor:!0,hyperlinks:!0}:e==="warpterminal"||process.env.WARP_SESSION_ID||process.env.WARP_TERMINAL_SESSION_UUID?{images:"kitty",trueColor:!0,hyperlinks:!0}:process.env.ITERM_SESSION_ID||e==="iterm.app"?{images:"iterm2",trueColor:!0,hyperlinks:!0}:process.env.WT_SESSION?{images:null,trueColor:!0,hyperlinks:!0}:e==="alacritty"||e==="vscode"||e==="zed"?{images:null,trueColor:!0,hyperlinks:!0}:n==="jetbrains-jediterm"?{images:null,trueColor:!0,hyperlinks:!1}:o?{images:null,trueColor:!0,hyperlinks:!1}:{images:null,trueColor:s,hyperlinks:!1}}function c1n(t){return t==="1"?!0:t==="0"?!1:void 0}function Eot(t=mNi){let e=c1n(process.env.PI_HYPERLINKS),n=hNi(e===void 0?t:()=>e),r=process.env.PI_IMAGE_PROTOCOL?.toLowerCase(),i=r==="kitty"||r==="iterm2"?r:r==="none"||r==="0"?null:void 0,s=c1n(process.env.PI_TRUE_COLOR);return{...n,...i!==void 0?{images:i}:{},...s!==void 0?{trueColor:s}:{},...e!==void 0?{hyperlinks:e}:{}}}function Dl(){if(!X8){let t=K8.hyperlinks;X8={...Eot(t===void 0?void 0:()=>t),...K8}}return X8}function g1n(){X8=null}function RR(t){K8.images===t.images&&K8.trueColor===t.trueColor&&K8.hyperlinks===t.hyperlinks||(K8={...t},X8=null)}function Rre(t){X8=t}function tu(t){return t.startsWith(J8)||t.startsWith(l1n)?!0:t.includes(J8)||t.includes(l1n)}function eTe(){return Math.floor(Math.random()*4294967294)+1}function bot(t,e={}){let r=["a=T","f=100","q=2"];if(e.moveCursor===!1&&r.push("C=1"),e.columns&&r.push(`c=${e.columns}`),e.rows&&r.push(`r=${e.rows}`),e.imageId&&r.push(`i=${e.imageId}`),t.length<=4096)return`\x1B_G${r.join(",")};${t}\x1B\\`;let i=[],s=0,o=!0;for(;s=t.length;o?(i.push(`\x1B_G${r.join(",")},m=1;${a}\x1B\\`),o=!1):c?i.push(`\x1B_Gm=0;${a}\x1B\\`):i.push(`\x1B_Gm=1;${a}\x1B\\`),s+=4096}return i.join("")}function Z8(t){return`\x1B_Ga=d,d=I,i=${t},q=2\x1B\\`}function tTe(){return"\x1B_Ga=d,d=A,q=2\x1B\\"}function _ot(){return"\x1B_Ga=d,d=a,q=2\x1B\\"}function xot(t,e={}){let n=[`inline=${e.inline!==!1?1:0}`,`size=${Buffer.byteLength(t,"base64")}`];if(e.width!==void 0&&n.push(`width=${e.width}`),e.height!==void 0&&n.push(`height=${e.height}`),e.name){let r=Buffer.from(e.name).toString("base64");n.push(`name=${r}`)}return e.preserveAspectRatio===!1&&n.push("preserveAspectRatio=0"),`\x1B]1337;File=${n.join(";")}:${t}\x07`}function fNi(t){if(u1n+=1,z8.delete(t.imageId),z8.set(t.imageId,{...t,transmissionGeneration:u1n}),z8.size>1e3){let e=z8.keys().next().value;e!==void 0&&z8.delete(e)}}function A1n(t){let e=/\x1b_G([^;]*);/.exec(t)?.[1];if(!e)return;let n=/(?:^|,)i=(\d+)(?:,|$)/.exec(e)?.[1];return n===void 0?void 0:z8.get(Number.parseInt(n,10))}function nTe(t){let e=A1n(t);if(e)return{imageId:e.imageId,columns:e.columns,rows:e.rows,widthPx:e.widthPx,heightPx:e.heightPx}}function y1n(t){let e=/\x1b_G([^;]*);/.exec(t),n=A1n(t);if(!e||!n)return;let r=e.index,i=e[1],s;for(;;){let c=t.indexOf("\x1B\\",r+J8.length);if(c===-1)return;if(s=c+2,!/(?:^|,)m=1(?:,|$)/.test(i))break;if(r=s,!t.startsWith(J8,r))return;let u=t.indexOf(";",r+J8.length);if(u===-1)return;i=t.slice(r+J8.length,u)}let a=`\x1B_Ga=p,q=2,${e[1].split(",").filter(c=>gNi.has(c.split("=",1)[0]??"")).join(",")}\x1B\\`;return{imageId:n.imageId,transmissionGeneration:n.transmissionGeneration,transmissionBytes:s-e.index,estimatedDecodedBytes:n.widthPx*n.heightPx*4,sequence:a,replacementLine:`${t.slice(0,e.index)}${a}${t.slice(s)}`}}function Sot(t,e,n){let r=nTe(t),i=/\x1b_G([^;]*);/.exec(t);if(!r||!i||e<0||e>=r.rows||n<=0)return t;let s=Math.min(n,r.rows-e);if(e===0&&s===r.rows)return t;let o=Math.floor(r.heightPx*e/r.rows),a=Math.ceil(r.heightPx*(e+s)/r.rows),c=Math.max(1,Math.min(r.heightPx,a)-o),u=i[1].split(",").filter(l=>!/^[yhr]=/.test(l));return u.push(`y=${o}`,`h=${c}`,`r=${s}`),`${t.slice(0,i.index)}\x1B_G${u.join(",")};${t.slice(i.index+i[0].length)}`}function E1n(t,e,n,r={widthPx:9,heightPx:18}){let i=Math.max(1,Math.floor(e)),s=n===void 0?void 0:Math.max(1,Math.floor(n)),o=Math.max(1,t.widthPx),a=Math.max(1,t.heightPx),c=i*r.widthPx/o,u=s===void 0?c:s*r.heightPx/a,l=Math.min(c,u),d=o*l,m=a*l,h=Math.ceil(d/r.widthPx),f=Math.ceil(m/r.heightPx);return{columns:Math.max(1,Math.min(i,h)),rows:Math.max(1,s===void 0?f:Math.min(s,f))}}function b1n(t,e,n={widthPx:9,heightPx:18}){return E1n(t,e,void 0,n).rows}function Cot(t){try{let e=Buffer.from(t,"base64");if(e.length<24||e[0]!==137||e[1]!==80||e[2]!==78||e[3]!==71)return null;let n=e.readUInt32BE(16),r=e.readUInt32BE(20);return{widthPx:n,heightPx:r}}catch{return null}}function Iot(t){try{let e=Buffer.from(t,"base64");if(e.length<2||e[0]!==255||e[1]!==216)return null;let n=2;for(;n=192&&r<=194){let s=e.readUInt16BE(n+5);return{widthPx:e.readUInt16BE(n+7),heightPx:s}}if(n+3>=e.length)return null;let i=e.readUInt16BE(n+2);if(i<2)return null;n+=2+i}return null}catch{return null}}function wot(t){try{let e=Buffer.from(t,"base64");if(e.length<10)return null;let n=e.slice(0,6).toString("ascii");if(n!=="GIF87a"&&n!=="GIF89a")return null;let r=e.readUInt16LE(6),i=e.readUInt16LE(8);return{widthPx:r,heightPx:i}}catch{return null}}function Tot(t){try{let e=Buffer.from(t,"base64");if(e.length<30)return null;let n=e.slice(0,4).toString("ascii"),r=e.slice(8,12).toString("ascii");if(n!=="RIFF"||r!=="WEBP")return null;let i=e.slice(12,16).toString("ascii");if(i==="VP8 "){if(e.length<30)return null;let s=e.readUInt16LE(26)&16383,o=e.readUInt16LE(28)&16383;return{widthPx:s,heightPx:o}}else if(i==="VP8L"){if(e.length<25)return null;let s=e.readUInt32LE(21),o=(s&16383)+1,a=(s>>14&16383)+1;return{widthPx:o,heightPx:a}}else if(i==="VP8X"){if(e.length<30)return null;let s=(e[24]|e[25]<<8|e[26]<<16)+1,o=(e[27]|e[28]<<8|e[29]<<16)+1;return{widthPx:s,heightPx:o}}return null}catch{return null}}function ej(t,e){return e==="image/png"?Cot(t):e==="image/jpeg"?Iot(t):e==="image/gif"?wot(t):e==="image/webp"?Tot(t):null}function rTe(t,e,n={}){let r=Dl();if(!r.images)return null;let i=n.maxWidthCells??80,s=E1n(e,i,n.maxHeightCells,vre());return r.images==="kitty"?(n.imageId!==void 0&&fNi({imageId:n.imageId,columns:s.columns,rows:s.rows,widthPx:e.widthPx,heightPx:e.heightPx}),{sequence:bot(t,{columns:s.columns,rows:s.rows,imageId:n.imageId,moveCursor:n.moveCursor}),columns:s.columns,rows:s.rows,imageId:n.imageId}):r.images==="iterm2"?{sequence:xot(t,{width:s.columns,height:"auto",preserveAspectRatio:n.preserveAspectRatio??!0}),columns:s.columns,rows:s.rows}:null}function gE(t,e){return`\x1B]8;;${e}\x1B\\${t}\x1B]8;;\x1B\\`}function ANi(t){let e=(0,p1n.homedir)();return e&&(t===e||t.startsWith(`${e}/`)||t.startsWith(`${e}\\`))?`~${t.slice(e.length)}`:t}function qF(t,e,n){let r=[];if(n){let i=ANi(n);Dl().hyperlinks&&(0,m1n.isAbsolute)(n)?r.push(gE(i,(0,h1n.pathToFileURL)(n).href)):r.push(i)}return r.push(`[${t}]`),e&&r.push(`${e.widthPx}x${e.heightPx}`),`[Image: ${r.join(" ")}]`}var d1n,p1n,m1n,h1n,X8,K8,f1n,J8,l1n,z8,u1n,gNi,SD=v(()=>{p();d1n=require("node:child_process"),p1n=require("node:os"),m1n=require("node:path"),h1n=require("node:url"),X8=null,K8={},f1n={widthPx:9,heightPx:18};J8="\x1B_G",l1n="\x1B]1337;File=";z8=new Map,u1n=0;gNi=new Set(["i","p","x","y","w","h","X","Y","c","r","C","U","z","P","Q","H","V"])});function kR(t,e){let n=t.handleMouse?.(e);if(n){if("target"in n)return n;if(!(!n.handled&&!n.capture&&!n.focus))return{...n,handled:!0,...n.focus?{focusTarget:t}:{},target:{component:t,originX:e.screenX-e.x,originY:e.screenY-e.y,width:e.width,height:e.height}}}}function x1n(t,e){return{...t,x:t.screenX-e.originX,y:t.screenY-e.originY,width:e.width,height:e.height}}function iTe(t){return t!==null&&"focused"in t}function _1n(t,e){if(t===void 0)return;if(typeof t=="number")return t;let n=t.match(/^(\d+(?:\.\d+)?)%$/);if(n)return Math.floor(e*parseFloat(n[1])/100)}function aw(t,e,n,r,i){if(tu(t))return t;let s=n+r,o=Gkn(t,n,s,i-s,!0),a=fot(e,0,r,!0),c=Math.max(0,n-o.beforeWidth),u=Math.max(0,r-a.width),l=Math.max(n,o.beforeWidth),d=Math.max(r,a.width),m=Math.max(0,i-l-d),h=Math.max(0,m-o.afterWidth),f=o.before+" ".repeat(c)+vot+a.text+" ".repeat(u)+vot+o.after+" ".repeat(h);return rn(f)<=i?f:Hc(f,0,i,!0)}function Bre(t){return t[Rot]===!0}var kre,AE,gn,vot,Rot,tj,_b=v(()=>{p();kre=require("node:perf_hooks");xD();yot();SD();ld();AE="\x1B_pi:c\x07";gn=class{children=[];mouseLayout;addChild(e){this.children.push(e)}removeChild(e){let n=this.children.indexOf(e);n!==-1&&this.children.splice(n,1)}clear(){this.children=[]}invalidate(){for(let e of this.children)e.invalidate?.()}handleMouse(e){if(e.y<0||e.y>=e.height)return;let n=this.mouseLayout?.width===e.width?this.mouseLayout.children:this.children.map(i=>({component:i,height:i.render(e.width).length})),r=0;for(let{component:i,height:s}of n){if(e.y>=r&&e.y0}overlayFocusRestore={status:"inactive"};constructor(e,n,r){super(),this.terminal=e,this.logDirectory=r,n!==void 0&&(this.showHardwareCursor=n)}resetRenderState(){}beforeTerminalStart(){}afterTerminalStart(){}beforeTerminalStop(e){}afterTerminalStop(e){}get fullRedraws(){return this.fullRedrawCount}getShowHardwareCursor(){return this.showHardwareCursor}setShowHardwareCursor(e){this.showHardwareCursor!==e&&(this.showHardwareCursor=e,e||this.terminal.hideCursor(),this.requestRender())}getClearOnShrink(){return this.clearOnShrink}setClearOnShrink(e){this.clearOnShrink=e}getFocusedComponent(){return this.focusedComponent}setFocus(e){this.setFocusInternal({component:e,overlayFocusRestore:"clear"})}setFocusInternal({component:e,overlayFocusRestore:n}){let r=this.focusedComponent,i=e,s=r?this.overlayStack.find(u=>u.component===r&&this.isOverlayVisible(u)):void 0,o=i?this.overlayStack.some(u=>u.component===i):!1,a=this.getVisibleOverlayFocusRestore();i&&!o?a.status==="blocked"&&a.blockedBy===r?a.resume.status==="focus-target"||!this.isComponentMounted(a.blockedBy)?i=this.resolveBlockedOverlayFocusResume(a):this.overlayFocusRestore={status:"blocked",overlay:a.overlay,blockedBy:i,resume:a.resume}:s&&a.status!=="inactive"&&a.overlay===s&&!this.isOverlayFocusAncestor(s,i)&&(this.overlayFocusRestore={status:"blocked",overlay:s,blockedBy:i,resume:{status:"restore-overlay"}}):i===null&&(a.status==="blocked"&&a.blockedBy===r?i=this.resolveBlockedOverlayFocusResume(a):n==="clear"&&this.clearOverlayFocusRestore()),iTe(this.focusedComponent)&&(this.focusedComponent.focused=!1),this.focusedComponent=i,iTe(i)&&(i.focused=!0);let c=i?this.overlayStack.find(u=>u.component===i&&this.isOverlayVisible(u)):void 0;c&&(this.overlayFocusRestore={status:"eligible",overlay:c})}clearOverlayFocusRestore(){this.overlayFocusRestore={status:"inactive"}}clearOverlayFocusRestoreFor(e){this.overlayFocusRestore.status!=="inactive"&&this.overlayFocusRestore.overlay===e&&this.clearOverlayFocusRestore()}resolveBlockedOverlayFocusResume(e){return e.resume.status==="restore-overlay"?e.overlay.component:(this.clearOverlayFocusRestore(),e.resume.target)}getVisibleOverlayFocusRestore(){let e=this.overlayFocusRestore;return e.status==="inactive"?e:!this.overlayStack.includes(e.overlay)||!this.isOverlayVisible(e.overlay)?{status:"inactive"}:e}isOverlayFocusAncestor(e,n){let r=new Set,i=e.preFocus;for(;i&&!r.has(i);){if(r.add(i),i===n)return!0;i=this.overlayStack.find(s=>s.component===i)?.preFocus??null}return!1}retargetOverlayPreFocus(e){for(let n of this.overlayStack)n!==e&&n.preFocus===e.component&&(n.preFocus=e.preFocus)}getMountedRoots(){return this.children}isComponentMounted(e){return this.getMountedRoots().some(n=>this.containsComponent(n,e))}containsComponent(e,n){return e===n?!0:e instanceof gn?e.children.some(r=>this.containsComponent(r,n)):!1}showOverlay(e,n){let r={component:e,...n===void 0?{}:{options:n},preFocus:this.focusedComponent,hidden:!1,focusOrder:++this.focusOrderCounter};return this.overlayStack.push(r),!n?.nonCapturing&&this.isOverlayVisible(r)&&this.setFocus(e),this.terminal.hideCursor(),this.requestRender(),{hide:()=>{let i=this.overlayStack.indexOf(r);if(i!==-1){if(this.clearOverlayFocusRestoreFor(r),this.retargetOverlayPreFocus(r),this.overlayStack.splice(i,1),this.focusedComponent===e){let s=this.getTopmostVisibleOverlay();this.setFocus(s?.component??r.preFocus)}this.overlayStack.length===0&&this.terminal.hideCursor(),this.requestRender()}},setHidden:i=>{if(r.hidden!==i){if(r.hidden=i,i){if(this.clearOverlayFocusRestoreFor(r),this.focusedComponent===e){let s=this.getTopmostVisibleOverlay();this.setFocus(s?.component??r.preFocus)}}else!n?.nonCapturing&&this.isOverlayVisible(r)&&(r.focusOrder=++this.focusOrderCounter,this.setFocus(e));this.requestRender()}},isHidden:()=>r.hidden,focus:()=>{!this.overlayStack.includes(r)||!this.isOverlayVisible(r)||(r.focusOrder=++this.focusOrderCounter,this.setFocus(e),this.requestRender())},unfocus:i=>{let s=this.focusedComponent===e,o=this.overlayFocusRestore,a=o.status!=="inactive"&&o.overlay===r;if(!(!s&&!a)){if(o.status==="blocked"&&o.overlay===r&&this.focusedComponent===o.blockedBy){i?this.overlayFocusRestore={status:"blocked",overlay:r,blockedBy:o.blockedBy,resume:{status:"focus-target",target:i.target}}:this.clearOverlayFocusRestore(),this.requestRender();return}if(this.clearOverlayFocusRestoreFor(r),s||i){let c=this.getTopmostVisibleOverlay(),u=c&&c!==r?c.component:r.preFocus;this.setFocus(i?i.target:u)}this.requestRender()}},isFocused:()=>this.focusedComponent===e,getBounds:()=>{if(!(!this.overlayStack.includes(r)||!this.isOverlayVisible(r)||!r.bounds))return{...r.bounds}}}}hideOverlay(){let e=this.overlayStack[this.overlayStack.length-1];if(e){if(this.clearOverlayFocusRestoreFor(e),this.retargetOverlayPreFocus(e),this.overlayStack.pop(),this.focusedComponent===e.component){let n=this.getTopmostVisibleOverlay();this.setFocus(n?.component??e.preFocus)}this.overlayStack.length===0&&this.terminal.hideCursor(),this.requestRender()}}hasOverlay(){return this.overlayStack.some(e=>this.isOverlayVisible(e))}isOverlayFocused(){return this.overlayStack.some(e=>e.component===this.focusedComponent&&this.isOverlayVisible(e))}resolveMouseFocusTarget(e){for(let n=this.overlayStack.length-1;n>=0;n--){let r=this.overlayStack[n];if(this.isOverlayVisible(r)&&this.containsComponent(r.component,e))return r.component}return e}dispatchMouseToOverlay(e){for(let n=this.renderedOverlayLayouts.length-1;n>=0;n--){let r=this.renderedOverlayLayouts[n];if(e.screenX=r.col+r.width||e.screenY=r.row+r.height)continue;let i=kR(r.entry.component,{...e,x:e.screenX-r.col,y:e.screenY-r.row,width:r.width,height:r.height});return i?{hit:!0,result:i.focus?{...i,focusTarget:r.entry.component}:i}:{hit:!0}}return{hit:!1}}isOverlayVisible(e){return e.hidden?!1:e.options?.visible?e.options.visible(this.terminal.columns,this.terminal.rows):!0}getTopmostVisibleOverlay(){let e;for(let n of this.overlayStack)n.options?.nonCapturing||!this.isOverlayVisible(n)||(!e||n.focusOrder>e.focusOrder)&&(e=n);return e}invalidate(){for(let e of this.getMountedRoots())e.invalidate();for(let e of this.overlayStack)e.component.invalidate()}start(){this.stopped=!1,this.beforeTerminalStart(),this.terminal.start(e=>this.handleTerminalInput(e),()=>this.requestRender()),this.afterTerminalStart(),this.terminal.hideCursor(),this.terminalColorSchemeNotificationsEnabled&&this.terminal.write("\x1B[?2031h"),this.queryCellSize(),this.requestRender()}addInputListener(e){return this.inputListeners.add(e),()=>{this.inputListeners.delete(e)}}removeInputListener(e){this.inputListeners.delete(e)}onTerminalColorSchemeChange(e){return this.terminalColorSchemeListeners.add(e),()=>{this.terminalColorSchemeListeners.delete(e)}}setTerminalColorSchemeNotifications(e){this.terminalColorSchemeNotificationsEnabled!==e&&(this.terminalColorSchemeNotificationsEnabled=e,this.stopped||this.terminal.write(e?"\x1B[?2031h":"\x1B[?2031l"))}queryCellSize(){Dl().images&&this.terminal.write("\x1B[16t")}stop(e={}){this.stopped=!0,this.cancelRenderTimer(),this.terminalColorSchemeNotificationsEnabled&&this.terminal.write("\x1B[?2031l"),this.beforeTerminalStop(e),this.terminal.showCursor(),this.terminal.stop(),this.afterTerminalStop(e)}renderNow(e=!1){e&&this.resetRenderState(),this.renderRequested=!1,this.cancelRenderTimer(),this.lastRenderAt=kre.performance.now(),this.doRender()}requestRender(e=!1){if(e){this.resetRenderState(),this.requestImmediateRender();return}this.renderRequested||(this.renderRequested=!0,process.nextTick(()=>this.scheduleRender()))}requestImmediateRender(){this.cancelRenderTimer(),this.renderRequested=!0,!this.immediateRenderScheduled&&(this.immediateRenderScheduled=!0,process.nextTick(()=>{this.immediateRenderScheduled=!1,!(this.stopped||!this.renderRequested)&&(this.cancelRenderTimer(),this.renderRequested=!1,this.lastRenderAt=kre.performance.now(),this.doRender())}))}cancelRenderTimer(){this.renderTimer&&(clearTimeout(this.renderTimer),this.renderTimer=void 0)}scheduleRender(){if(this.stopped||this.renderTimer||!this.renderRequested)return;let e=kre.performance.now()-this.lastRenderAt,n=Math.max(0,t.MIN_RENDER_INTERVAL_MS-e);this.renderTimer=setTimeout(()=>{this.renderTimer=void 0,!(this.stopped||!this.renderRequested)&&(this.renderRequested=!1,this.lastRenderAt=kre.performance.now(),this.doRender(),this.renderRequested&&this.scheduleRender())},n)}handleTerminalInput(e){if(this.consumeOsc11BackgroundResponse(e)||this.consumeTerminalColorSchemeReport(e))return;if(this.inputListeners.size>0){let i=e;for(let s of this.inputListeners){let o=s(i);if(o?.consume)return;o?.data!==void 0&&(i=o.data)}if(i.length===0)return;e=i}if(this.consumeCellSizeResponse(e))return;if(sm(e,"shift+ctrl+d")&&this.onDebug){this.onDebug();return}let n=this.overlayStack.find(i=>i.component===this.focusedComponent);if(n&&!this.isOverlayVisible(n)){let i=this.getTopmostVisibleOverlay();i?this.setFocus(i.component):this.setFocusInternal({component:n.preFocus,overlayFocusRestore:"preserve"})}if(!this.overlayStack.some(i=>i.component===this.focusedComponent)){let i=this.getVisibleOverlayFocusRestore();i.status==="eligible"?this.setFocus(i.overlay.component):i.status==="blocked"&&i.blockedBy!==this.focusedComponent&&(i.resume.status==="restore-overlay"?this.setFocus(i.overlay.component):(this.clearOverlayFocusRestore(),this.setFocus(i.resume.target)))}if(this.focusedComponent?.handleInput){if(V8(e)&&!this.focusedComponent.wantsKeyRelease)return;this.focusedComponent.handleInput(e),this.requestImmediateRender()}}consumeOsc11BackgroundResponse(e){if(this.pendingOsc11BackgroundReplies<=0||!a1n(e))return!1;let n=Jwe(e);this.pendingOsc11BackgroundReplies-=1;let r=this.pendingOsc11BackgroundQueries.shift();return r&&!r.settled&&(r.settled=!0,r.timer&&(clearTimeout(r.timer),r.timer=void 0),r.resolve?.(n),r.resolve=void 0),!0}consumeTerminalColorSchemeReport(e){let n=Xwe(e);if(!n)return!1;for(let r of this.terminalColorSchemeListeners)r(n);return!0}consumeCellSizeResponse(e){let n=e.match(/^\x1b\[6;(\d+);(\d+)t$/);if(!n)return!1;let r=parseInt(n[1],10),i=parseInt(n[2],10);return r<=0||i<=0||(Zwe({widthPx:i,heightPx:r}),this.invalidate(),this.requestRender()),!0}resolveOverlayLayout(e,n,r,i){let s=e??{},o=typeof s.margin=="number"?{top:s.margin,right:s.margin,bottom:s.margin,left:s.margin}:s.margin??{},a=Math.max(0,o.top??0),c=Math.max(0,o.right??0),u=Math.max(0,o.bottom??0),l=Math.max(0,o.left??0),d=Math.max(1,r-l-c),m=Math.max(1,i-a-u),h=_1n(s.width,r)??Math.min(80,d);s.minWidth!==void 0&&(h=Math.max(h,s.minWidth)),h=Math.max(1,Math.min(h,d));let f=_1n(s.maxHeight,i);f!==void 0&&(f=Math.max(1,Math.min(f,m)));let g=f!==void 0?Math.min(n,f):n,A,y;if(s.row!==void 0)if(typeof s.row=="string"){let E=s.row.match(/^(\d+(?:\.\d+)?)%$/);if(E){let _=Math.max(0,m-g),S=parseFloat(E[1])/100;A=a+Math.floor(_*S)}else A=this.resolveAnchorRow("center",g,m,a)}else A=s.row;else{let E=s.anchor??"center";A=this.resolveAnchorRow(E,g,m,a)}if(s.col!==void 0)if(typeof s.col=="string"){let E=s.col.match(/^(\d+(?:\.\d+)?)%$/);if(E){let _=Math.max(0,d-h),S=parseFloat(E[1])/100;y=l+Math.floor(_*S)}else y=this.resolveAnchorCol("center",h,d,l)}else y=s.col;else{let E=s.anchor??"center";y=this.resolveAnchorCol(E,h,d,l)}return s.offsetY!==void 0&&(A+=s.offsetY),s.offsetX!==void 0&&(y+=s.offsetX),A=Math.max(a,Math.min(A,i-u-g)),y=Math.max(l,Math.min(y,r-c-h)),{width:h,row:A,col:y,maxHeight:f}}resolveAnchorRow(e,n,r,i){switch(e){case"top-left":case"top-center":case"top-right":return i;case"bottom-left":case"bottom-center":case"bottom-right":return i+r-n;case"left-center":case"center":case"right-center":return i+Math.floor((r-n)/2)}}resolveAnchorCol(e,n,r,i){switch(e){case"top-left":case"left-center":case"bottom-left":return i;case"top-right":case"right-center":case"bottom-right":return i+r-n;case"top-center":case"center":case"bottom-center":return i+Math.floor((r-n)/2)}}compositeOverlays(e,n,r){if(this.overlayStack.length===0)return this.renderedOverlayLayouts=[],e;let i=[...e];for(let l of this.overlayStack)l.bounds=void 0;let s=[],o=i.length,a=this.overlayStack.filter(l=>this.isOverlayVisible(l));a.sort((l,d)=>l.focusOrder-d.focusOrder);for(let l of a){let{component:d,options:m}=l,{width:h,maxHeight:f}=this.resolveOverlayLayout(m,0,n,r),g=d.render(h);f!==void 0&&g.length>f&&(g=g.slice(0,f));let{row:A,col:y}=this.resolveOverlayLayout(m,g.length,n,r);l.bounds={row:A,col:y,width:h,height:g.length},s.push({entry:l,overlayLines:g,row:A,col:y,w:h}),o=Math.max(o,A+g.length)}this.renderedOverlayLayouts=s.map(({entry:l,row:d,col:m,w:h,overlayLines:f})=>({entry:l,row:d,col:m,width:h,height:f.length}));let c=Math.max(i.length,r,o);for(;i.length=0&&gh?Hc(l[f],0,h,!0):l[f];i[g]=this.compositeLineAt(i[g],A,m,h,n)}}return i}applyLineResets(e){let n=vot;for(let r=0;r=r;i--){let s=e[i],o=s.indexOf(AE);if(o!==-1){let a=s.slice(0,o),c=rn(a);return e[i]=s.slice(0,o)+s.slice(o+AE.length),{row:i,col:c}}}return null}queryTerminalBackgroundColor({timeoutMs:e}){return new Promise(n=>{let r={settled:!1,resolve:n,timer:void 0};r.timer=setTimeout(()=>{r.settled||(r.settled=!0,r.timer=void 0,r.resolve?.(void 0),r.resolve=void 0)},e),this.pendingOsc11BackgroundQueries.push(r),this.pendingOsc11BackgroundReplies+=1,this.terminal.write("\x1B]11;?\x07")})}queryTerminalColorScheme({timeoutMs:e}){return new Promise(n=>{let r=!1,i,s=()=>{},o=a=>{r||(r=!0,i&&(clearTimeout(i),i=void 0),s(),n(a))};s=this.onTerminalColorSchemeChange(o),i=setTimeout(()=>o(void 0),e),this.terminal.write("\x1B[?996n")})}}});var Ou,S1n=v(()=>{p();_b();ld();Ou=class{children=[];paddingX;paddingY;bgFn;cache;mouseLayout;constructor(e=1,n=1,r){this.paddingX=e,this.paddingY=n,this.bgFn=r}addChild(e){this.children.push(e),this.invalidateCache()}removeChild(e){let n=this.children.indexOf(e);n!==-1&&(this.children.splice(n,1),this.invalidateCache())}clear(){this.children=[],this.invalidateCache()}setBgFn(e){this.bgFn=e}invalidateCache(){this.cache=void 0}matchCache(e,n,r){let i=this.cache;return!!i&&i.width===e&&i.bgSample===r&&i.childLines.length===n.length&&i.childLines.every((s,o)=>s===n[o])}invalidate(){this.invalidateCache();for(let e of this.children)e.invalidate?.()}handleMouse(e){let n=Math.max(1,e.width-this.paddingX*2),r=e.y-this.paddingY,i=e.x-this.paddingX;if(r<0||i<0||i>=n)return;let s=this.mouseLayout?.width===n?this.mouseLayout.children:this.children.map(a=>({component:a,height:a.render(n).length})),o=0;for(let{component:a,height:c}of s){if(r>=o&&r{p();xD();BR={"tui.editor.cursorUp":{defaultKeys:"up",description:"Move cursor up"},"tui.editor.cursorDown":{defaultKeys:"down",description:"Move cursor down"},"tui.editor.historyPrevious":{defaultKeys:[],description:"Select previous prompt history entry"},"tui.editor.historyNext":{defaultKeys:[],description:"Select next prompt history entry"},"tui.editor.cursorLeft":{defaultKeys:["left","ctrl+b"],description:"Move cursor left"},"tui.editor.cursorRight":{defaultKeys:["right","ctrl+f"],description:"Move cursor right"},"tui.editor.cursorWordLeft":{defaultKeys:["alt+left","ctrl+left","alt+b"],description:"Move cursor word left"},"tui.editor.cursorWordRight":{defaultKeys:["alt+right","ctrl+right","alt+f"],description:"Move cursor word right"},"tui.editor.cursorLineStart":{defaultKeys:["home","ctrl+home","ctrl+a"],description:"Move to line start"},"tui.editor.cursorLineEnd":{defaultKeys:["end","ctrl+end","ctrl+e"],description:"Move to line end"},"tui.editor.jumpForward":{defaultKeys:"ctrl+]",description:"Jump forward to character"},"tui.editor.jumpBackward":{defaultKeys:"ctrl+alt+]",description:"Jump backward to character"},"tui.editor.pageUp":{defaultKeys:["pageUp","ctrl+pageUp"],description:"Page up"},"tui.editor.pageDown":{defaultKeys:["pageDown","ctrl+pageDown"],description:"Page down"},"tui.editor.deleteCharBackward":{defaultKeys:"backspace",description:"Delete character backward"},"tui.editor.deleteCharForward":{defaultKeys:["delete","ctrl+d"],description:"Delete character forward"},"tui.editor.deleteWordBackward":{defaultKeys:["ctrl+w","alt+backspace"],description:"Delete word backward"},"tui.editor.deleteWordForward":{defaultKeys:["alt+d","alt+delete"],description:"Delete word forward"},"tui.editor.deleteToLineStart":{defaultKeys:"ctrl+u",description:"Delete to line start"},"tui.editor.deleteToLineEnd":{defaultKeys:"ctrl+k",description:"Delete to line end"},"tui.editor.yank":{defaultKeys:"ctrl+y",description:"Yank"},"tui.editor.yankPop":{defaultKeys:"alt+y",description:"Yank pop"},"tui.editor.undo":{defaultKeys:"ctrl+-",description:"Undo"},"tui.input.newLine":{defaultKeys:["shift+enter","ctrl+j"],description:"Insert newline"},"tui.input.submit":{defaultKeys:"enter",description:"Submit input"},"tui.input.tab":{defaultKeys:"tab",description:"Tab / autocomplete"},"tui.input.copy":{defaultKeys:"ctrl+c",description:"Copy selection"},"tui.select.up":{defaultKeys:"up",description:"Move selection up"},"tui.select.down":{defaultKeys:"down",description:"Move selection down"},"tui.select.pageUp":{defaultKeys:"pageUp",description:"Selection page up"},"tui.select.pageDown":{defaultKeys:"pageDown",description:"Selection page down"},"tui.select.confirm":{defaultKeys:"enter",description:"Confirm selection"},"tui.select.cancel":{defaultKeys:["escape","ctrl+c"],description:"Cancel selection"},"tui.altScreen.pageUp":{defaultKeys:"pageUp",description:"Scroll viewport up one page"},"tui.altScreen.pageDown":{defaultKeys:"pageDown",description:"Scroll viewport down one page"},"tui.altScreen.halfPageUp":{defaultKeys:[],description:"Scroll viewport up half a page"},"tui.altScreen.halfPageDown":{defaultKeys:[],description:"Scroll viewport down half a page"},"tui.altScreen.lineUp":{defaultKeys:[],description:"Scroll viewport up one line"},"tui.altScreen.lineDown":{defaultKeys:[],description:"Scroll viewport down one line"},"tui.altScreen.previousPrompt":{defaultKeys:["ctrl+shift+up","ctrl+up"],description:"Jump to previous semantic prompt"},"tui.altScreen.nextPrompt":{defaultKeys:["ctrl+shift+down","ctrl+down"],description:"Jump to next semantic prompt"},"tui.altScreen.search":{defaultKeys:"ctrl+shift+f",description:"Search the primary scroll view"},"tui.altScreen.searchNext":{defaultKeys:["enter","ctrl+g"],description:"Select the next search match"},"tui.altScreen.searchPrevious":{defaultKeys:["shift+enter","ctrl+shift+g"],description:"Select the previous search match"},"tui.altScreen.searchClose":{defaultKeys:"escape",description:"Close transcript search"},"tui.altScreen.top":{defaultKeys:"home",description:"Scroll viewport to top"},"tui.altScreen.bottom":{defaultKeys:"end",description:"Scroll viewport to bottom"}};jF=class{definitions;userBindings;keysById=new Map;conflicts=[];constructor(e,n={}){this.definitions=e,this.userBindings=n,this.rebuild()}rebuild(){this.keysById.clear(),this.conflicts=[];let e=new Map;for(let[n,r]of Object.entries(this.userBindings))if(n in this.definitions)for(let i of kot(r)){let s=e.get(i)??new Set;s.add(n),e.set(i,s)}for(let[n,r]of e)r.size>1&&this.conflicts.push({key:n,keybindings:[...r]});for(let[n,r]of Object.entries(this.definitions)){let i=this.userBindings[n],s=kot(i===void 0?r.defaultKeys:i);this.keysById.set(n,s)}}matches(e,n){let r=this.keysById.get(n)??[];for(let i of r)if(sm(e,i))return!0;return!1}getKeys(e){return[...this.keysById.get(e)??[]]}getDefinition(e){return this.definitions[e]}getConflicts(){return this.conflicts.map(e=>({...e,keybindings:[...e.keybindings]}))}setUserBindings(e){this.userBindings=e,this.rebuild()}getUserBindings(){return{...this.userBindings}}getResolvedBindings(){let e={};for(let n of Object.keys(this.definitions)){let r=this.keysById.get(n)??[];e[n]=r.length===1?r[0]:[...r]}return e}},sTe=null});var Et,Bot=v(()=>{p();ld();Et=class{text;paddingX;paddingY;customBgFn;cachedText;cachedWidth;cachedLines;constructor(e="",n=1,r=1,i){this.text=e,this.paddingX=n,this.paddingY=r,this.customBgFn=i}setText(e){this.text=e,this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}setCustomBgFn(e){this.customBgFn=e,this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}invalidate(){this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}render(e){if(this.cachedLines&&this.cachedText===this.text&&this.cachedWidth===e)return this.cachedLines;if(!this.text||this.text.trim()===""){let m=[];return this.cachedText=this.text,this.cachedWidth=e,this.cachedLines=m,m}let n=this.text.replace(/\t/g," "),r=Math.min(this.paddingX,Math.max(0,Math.floor((e-1)/2))),i=Math.max(1,e-r*2),s=Ag(n,i),o=" ".repeat(r),a=" ".repeat(r),c=[];for(let m of s){let h=o+m+a;if(this.customBgFn)c.push(_D(h,e,this.customBgFn));else{let f=rn(h),g=Math.max(0,e-f);c.push(h+" ".repeat(g))}}let u=" ".repeat(e),l=[];for(let m=0;m0?d:[""]}}});var C1n,I1n,xb,Not=v(()=>{p();Bot();C1n=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],I1n=80,xb=class extends Et{frames=[...C1n];intervalMs=I1n;currentFrame=0;intervalId=null;ui=null;renderIndicatorVerbatim=!1;spinnerColorFn;messageColorFn;message="Loading...";constructor(e,n,r,i="Loading...",s){super("",1,0),this.ui=e,this.spinnerColorFn=n,this.messageColorFn=r,this.message=i,this.setIndicator(s)}render(e){return["",...super.render(e)]}start(){this.updateDisplay(),this.restartAnimation()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}setMessage(e){this.message=e,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}setIndicator(e){this.renderIndicatorVerbatim=e!==void 0,this.frames=e?.frames!==void 0?[...e.frames]:[...C1n],this.intervalMs=e?.intervalMs&&e.intervalMs>0?e.intervalMs:I1n,this.currentFrame=0,this.start()}restartAnimation(){this.stop(),!(this.frames.length<=1)&&(this.intervalId=setInterval(()=>{this.currentFrame=(this.currentFrame+1)%this.frames.length,this.updateDisplay()},this.intervalMs))}getRenderedIndicator(){let e=this.frames[this.currentFrame]??"";return this.renderIndicatorVerbatim?e:this.spinnerColorFn(e)}updateDisplay(){let e=this.getRenderedIndicator(),n=e.length>0?`${e} `:"";this.setText(`${n}${this.messageColorFn(this.message)}`),this.ui&&this.ui.requestRender()}}});var nj,w1n=v(()=>{p();NR();Not();nj=class extends xb{abortController=new AbortController;onAbort;get signal(){return this.abortController.signal}get aborted(){return this.abortController.signal.aborted}handleInput(e){Ai().matches(e,"tui.select.cancel")&&(this.abortController.abort(),this.onAbort?.())}dispose(){this.stop()}}});var rj,Dot=v(()=>{p();rj=class{ring=[];push(e,n){if(e)if(n.accumulate&&this.ring.length>0){let r=this.ring.pop();this.ring.push(n.prepend?e+r:r+e)}else this.ring.push(e)}peek(){return this.ring.length>0?this.ring[this.ring.length-1]:void 0}rotate(){if(this.ring.length>1){let e=this.ring.pop();this.ring.unshift(e)}}get length(){return this.ring.length}}});var ij,Pot=v(()=>{p();ij=class{stack=[];push(e){this.stack.push(structuredClone(e))}pop(){return this.stack.pop()}clear(){this.stack.length=0}get length(){return this.stack.length}}});function oTe(t,e,n){if(e<=0)return 0;let r=t.slice(0,e),i=n?.segment,s=n?.isAtomicSegment,o=i?[...i(r)]:[...T1n.segment(r)],a=e;for(;o.length>0&&!s?.(o[o.length-1]?.segment||"")&&hE(o[o.length-1]?.segment||"");)a-=o.pop()?.segment.length||0;if(o.length===0)return a;let c=o[o.length-1];if(s?.(c.segment))a-=c.segment.length;else if(c.isWordLike){let u=c.segment,l=[...u.matchAll(new RegExp(hot,"g"))];if(l.length<=0)a-=u.length;else{let d=l[l.length-1];a-=u.length-(d.index+d[0].length)}}else for(;o.length>0&&!s?.(o[o.length-1]?.segment||"")&&!o[o.length-1]?.isWordLike&&!hE(o[o.length-1]?.segment||"");)a-=o.pop()?.segment.length||0;return a}function aTe(t,e,n){if(e>=t.length)return t.length;let r=t.slice(e),i=n?.segment,s=n?.isAtomicSegment,a=(i?i(r):T1n.segment(r))[Symbol.iterator](),c=a.next(),u=e;for(;!c.done&&!s?.(c.value.segment)&&hE(c.value.segment);)u+=c.value.segment.length,c=a.next();if(c.done)return u;if(s?.(c.value.segment))u+=c.value.segment.length;else if(c.value.isWordLike)u+=hot.exec(c.value.segment)?.index??c.value.segment.length;else for(;!c.done&&!s?.(c.value.segment)&&!c.value.isWordLike&&!hE(c.value.segment);)u+=c.value.segment.length,c=a.next();return u}var T1n,Mot=v(()=>{p();ld();T1n=U8()});var v1n,R1n,yNi,ENi,bNi,eh,Oot=v(()=>{p();NR();ld();v1n=32,R1n=2,yNi=10,ENi=t=>t.replace(/[\r\n]+/g," ").trim(),bNi=(t,e,n)=>Math.max(e,Math.min(t,n)),eh=class{items=[];filteredItems=[];selectedIndex=0;mousePressedIndex;maxVisible=5;theme;layout;onSelect;onCancel;onSelectionChange;constructor(e,n,r,i={}){this.items=e,this.filteredItems=e,this.maxVisible=n,this.theme=r,this.layout=i}setFilter(e){this.filteredItems=this.items.filter(n=>n.value.toLowerCase().startsWith(e.toLowerCase())),this.selectedIndex=0}setSelectedIndex(e){this.selectedIndex=Math.max(0,Math.min(e,this.filteredItems.length-1))}invalidate(){}render(e){let n=[];if(this.filteredItems.length===0)return n.push(this.theme.noMatch(" No matching commands")),n;let r=this.getPrimaryColumnWidth(),{startIndex:i,endIndex:s}=this.getVisibleRange();for(let o=i;o0||s=r)){if(e.type==="press")return this.mousePressedIndex=i,this.selectedIndex!==i&&(this.selectedIndex=i,this.notifySelectionChange()),{handled:!0,focus:!0};if(e.type==="click"){let s=this.mousePressedIndex??i;this.mousePressedIndex=void 0;let o=this.selectedIndex!==s;this.selectedIndex=s,o&&this.notifySelectionChange();let a=this.filteredItems[this.selectedIndex];return a&&this.onSelect?.(a),{handled:!0}}}}handleInput(e){let n=Ai();if(n.matches(e,"tui.select.up"))this.selectedIndex=this.selectedIndex===0?this.filteredItems.length-1:this.selectedIndex-1,this.notifySelectionChange();else if(n.matches(e,"tui.select.down"))this.selectedIndex=this.selectedIndex===this.filteredItems.length-1?0:this.selectedIndex+1,this.notifySelectionChange();else if(n.matches(e,"tui.select.confirm")){let r=this.filteredItems[this.selectedIndex];r&&this.onSelect&&this.onSelect(r)}else n.matches(e,"tui.select.cancel")&&this.onCancel&&this.onCancel()}getVisibleRange(){let e=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredItems.length-this.maxVisible));return{startIndex:e,endIndex:Math.min(e+this.maxVisible,this.filteredItems.length)}}renderItem(e,n,r,i,s){let o=n?"\u2192 ":" ",a=rn(o);if(i&&r>40){let l=Math.max(1,Math.min(s,r-a-4)),d=Math.max(1,l-R1n),m=this.truncatePrimary(e,n,d,l),h=rn(m),f=" ".repeat(Math.max(1,l-h)),g=a+h+f.length,A=r-g-2;if(A>yNi){let y=dr(i,A,"");if(n)return this.theme.selectedText(`${o}${m}${f}${y}`);let E=this.theme.description(f+y);return o+m+E}}let c=r-a-2,u=this.truncatePrimary(e,n,c,c);return n?this.theme.selectedText(`${o}${u}`):o+u}getPrimaryColumnWidth(){let{min:e,max:n}=this.getPrimaryColumnBounds(),r=this.filteredItems.reduce((i,s)=>Math.max(i,rn(this.getDisplayValue(s))+R1n),0);return bNi(r,e,n)}getPrimaryColumnBounds(){let e=this.layout.minPrimaryColumnWidth??this.layout.maxPrimaryColumnWidth??v1n,n=this.layout.maxPrimaryColumnWidth??this.layout.minPrimaryColumnWidth??v1n;return{min:Math.max(1,Math.min(e,n)),max:Math.max(1,Math.max(e,n))}}truncatePrimary(e,n,r,i){let s=this.getDisplayValue(e),o=this.layout.truncatePrimary?this.layout.truncatePrimary({text:s,maxWidth:r,columnWidth:i,item:e,isSelected:n}):dr(s,r,"");return dr(o,r,"")}getDisplayValue(e){return e.label||e.value}notifySelectionChange(){let e=this.filteredItems[this.selectedIndex];e&&this.onSelectionChange&&this.onSelectionChange(e)}getSelectedItem(){return this.filteredItems[this.selectedIndex]||null}}});function sj(t){return t.length>=10&&O1n.test(t)}function xNi(t,e,n){if(n.size===0||!t.includes("[paste #"))return e.segment(t);let r=[];for(let a of t.matchAll(M1n)){let c=Number.parseInt(a[1],10);n.has(c)&&r.push({start:a.index,end:a.index+a[0].length})}if(r.length===0)return e.segment(t);let i=e.segment(t),s=[],o=0;for(let a of i){for(;o=c.start&&a.indexe&&(c>=0&&o-u+h<=e?(i.push({text:t.slice(a,c),startIndex:a,endIndex:c}),a=c,o-=u):ae){let y=Lot(m,e);for(let _=0;_n!=="@").map(L1n);return new RegExp(`${xre.source}(?:@(?:"[^"]*|${Fot.source})|[${e.join("")}]${Fot.source})$`,"u")}function D1n(t,e,n){let r=Math.max(0,n),i=` ${t} ${e} more `,s=rn(i);if(s+2<=r){let l=Math.floor((r-s)/2);return"\u2500".repeat(l)+i+"\u2500".repeat(r-l-s)}let o=`\u2500\u2500\u2500 ${t} ${e} more `,a=r-rn(o);if(a>=0)return o+"\u2500".repeat(a);let c="...".slice(0,r),u=r-rn(c);return Hc(o,0,u,!0)+c}var P1n,_Ni,M1n,O1n,SNi,CNi,k1n,Fot,ID,F1n=v(()=>{p();NR();xD();Dot();_b();Pot();ld();Mot();Oot();P1n=Q8(),_Ni=U8(),M1n=/\[paste #(\d+)( (\+\d+ lines|\d+ chars))?\]/g,O1n=/^\[paste #(\d+)( (\+\d+ lines|\d+ chars))?\]$/;SNi={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},CNi=20,k1n=["@","#"],Fot=new RegExp(`(?:(?!${$8.source}).)*`,"u");ID=class{state={lines:[""],cursorLine:0,cursorCol:0};focused=!1;tui;theme;paddingX=0;lastWidth=80;renderedVisibleLineCount=1;renderedAutocompleteHeight=0;scrollOffset=0;borderColor;autocompleteProvider;autocompleteTriggerCharacters=[...k1n];autocompleteTriggerPattern=B1n(this.autocompleteTriggerCharacters);autocompleteDebouncePattern=N1n(this.autocompleteTriggerCharacters);autocompleteList;autocompleteState=null;autocompletePrefix="";autocompleteMaxVisible=5;autocompleteAbort;autocompleteDebounceTimer;autocompleteRequestTask=Promise.resolve();autocompleteStartToken=0;autocompleteRequestId=0;pastes=new Map;pasteCounter=0;pasteBuffer="";isInPaste=!1;history=[];historyIndex=-1;historyDraft=null;killRing=new rj;lastAction=null;jumpMode=null;preferredVisualCol=null;snappedFromCursorCol=null;undoStack=new ij;onSubmit;onChange;disableSubmit=!1;constructor(e,n,r={}){this.tui=e,this.theme=n,this.borderColor=n.borderColor;let i=r.paddingX??0;this.paddingX=Number.isFinite(i)?Math.max(0,Math.floor(i)):0;let s=r.autocompleteMaxVisible??5;this.autocompleteMaxVisible=Number.isFinite(s)?Math.max(3,Math.min(20,Math.floor(s))):5}validPasteIds(){return new Set(this.pastes.keys())}segment(e,n){return xNi(e,n==="word"?_Ni:P1n,this.validPasteIds())}getPaddingX(){return this.paddingX}setPaddingX(e){let n=Number.isFinite(e)?Math.max(0,Math.floor(e)):0;this.paddingX!==n&&(this.paddingX=n,this.tui.requestRender())}getAutocompleteMaxVisible(){return this.autocompleteMaxVisible}setAutocompleteMaxVisible(e){let n=Number.isFinite(e)?Math.max(3,Math.min(20,Math.floor(e))):5;this.autocompleteMaxVisible!==n&&(this.autocompleteMaxVisible=n,this.tui.requestRender())}setAutocompleteProvider(e){this.cancelAutocomplete(),this.autocompleteProvider=e,this.setAutocompleteTriggerCharacters(e.triggerCharacters??[])}addToHistory(e){let n=e.trim();n&&(this.history.length>0&&this.history[0]===n||(this.history.unshift(n),this.history.length>100&&this.history.pop()))}isEditorEmpty(){return this.state.lines.length===1&&this.state.lines[0]===""}isOnFirstVisualLine(){let e=this.buildVisualLineMap(this.lastWidth);return this.findCurrentVisualLine(e)===0}isOnLastVisualLine(){let e=this.buildVisualLineMap(this.lastWidth);return this.findCurrentVisualLine(e)===e.length-1}navigateHistory(e){if(this.lastAction=null,this.history.length===0)return;let n=this.historyIndex-e;if(!(n<-1||n>=this.history.length))if(this.historyIndex===-1&&n>=0&&(this.pushUndoSnapshot(),this.historyDraft=structuredClone(this.state)),this.historyIndex=n,this.historyIndex===-1){let r=this.historyDraft;this.historyDraft=null,r?(this.state=r,this.preferredVisualCol=null,this.snappedFromCursorCol=null,this.scrollOffset=0,this.onChange&&this.onChange(this.getText())):this.setTextInternal("")}else this.setTextInternal(this.history[this.historyIndex]||"",e===-1?"start":"end")}exitHistoryBrowsing(){this.historyIndex=-1,this.historyDraft=null}setTextInternal(e,n="end"){let r=e.split(` +`);this.state.lines=r.length===0?[""]:r,this.state.cursorLine=n==="start"?0:this.state.lines.length-1,this.setCursorCol(n==="start"?0:this.state.lines[this.state.cursorLine]?.length||0),this.scrollOffset=0,this.onChange&&this.onChange(this.getText())}invalidate(){}renderTopBorder(e,n){let r=n>0?D1n("\u2191",n,e):"\u2500".repeat(e);return this.borderColor(r)}renderBottomBorder(e,n){let r=n>0?D1n("\u2193",n,e):"\u2500".repeat(e);return this.borderColor(r)}render(e){let n=Math.max(0,Math.floor((e-1)/2)),r=Math.min(this.paddingX,n),i=Math.max(1,e-r*2),s=Math.max(1,i-(r?0:1));this.lastWidth=s;let o=this.layoutText(s),a=this.tui.terminal.rows,c=Math.max(5,Math.floor(a*.3)),u=o.findIndex(y=>y.hasCursor);u===-1&&(u=0),u=this.scrollOffset+c&&(this.scrollOffset=u-c+1);let l=Math.max(0,o.length-c);this.scrollOffset=Math.max(0,Math.min(this.scrollOffset,l));let d=o.slice(this.scrollOffset,this.scrollOffset+c);this.renderedVisibleLineCount=d.length;let m=[],h=" ".repeat(r),f=h;m.push(this.renderTopBorder(e,this.scrollOffset));let g=this.focused;for(let y of d){let E=y.text,_=rn(y.text),S=!1;if(y.hasCursor&&y.cursorPos!==void 0){let w=E.slice(0,y.cursorPos),k=E.slice(y.cursorPos),N=g?AE:"";if(k.length>0){let W=[...this.segment(k,"grapheme")][0]?.segment||"",$=k.slice(W.length),G=`\x1B[7m${W}\x1B[0m`;E=w+N+G+$}else E=w+N+"\x1B[7m \x1B[0m",_=_+1,_>i&&r>0&&(S=!0)}let C=" ".repeat(Math.max(0,i-_)),I=S?f.slice(1):f;m.push(`${h}${E}${C}${I}`)}let A=o.length-(this.scrollOffset+d.length);if(m.push(this.renderBottomBorder(e,A)),this.renderedAutocompleteHeight=0,this.autocompleteState&&this.autocompleteList){let y=this.autocompleteList.render(i);this.renderedAutocompleteHeight=y.length;for(let E of y){let _=rn(E),S=" ".repeat(Math.max(0,i-_));m.push(`${h}${E}${S}${f}`)}}return m}handleMouse(e){let n=this.renderedVisibleLineCount+2;if(this.autocompleteState&&this.autocompleteList&&e.y>=n&&e.ythis.renderedVisibleLineCount)return{handled:!0,focus:!0};let r=this.buildVisualLineMap(this.lastWidth),i=this.scrollOffset+e.y-1,s=r[i];if(!s)return{handled:!0,focus:!0};let o=this.state.lines[s.logicalLine]??"",a=s.startCol+s.length,c=o.slice(s.startCol,a),u=Math.max(0,Math.floor((e.width-1)/2)),l=Math.min(this.paddingX,u),d=Math.max(0,e.x-l),m=0,h=c.length,f=0;for(let A of this.segment(c,"grapheme")){let y=m+rn(A.segment);if(f=A.index,d0&&(h=f),this.state.cursorLine=s.logicalLine,this.setCursorCol(s.startCol+h),this.lastAction=null,this.exitHistoryBrowsing(),this.autocompleteState&&this.updateAutocomplete(),{handled:!0,focus:!0}}handleInput(e){let n=Ai();if(this.jumpMode!==null){if(n.matches(e,"tui.editor.jumpForward")||n.matches(e,"tui.editor.jumpBackward")){this.jumpMode=null;return}let i=Aot(e)??(e.charCodeAt(0)>=32?e:void 0);if(i!==void 0){let s=this.jumpMode;this.jumpMode=null,this.jumpToChar(i,s);return}this.jumpMode=null}if(e.includes("\x1B[200~")&&(this.isInPaste=!0,this.pasteBuffer="",e=e.replace("\x1B[200~","")),this.isInPaste){this.pasteBuffer+=e;let i=this.pasteBuffer.indexOf("\x1B[201~");if(i!==-1){let s=this.pasteBuffer.substring(0,i);s.length>0&&this.handlePaste(s),this.isInPaste=!1;let o=this.pasteBuffer.substring(i+6);this.pasteBuffer="",o.length>0&&this.handleInput(o);return}return}if(n.matches(e,"tui.input.copy"))return;if(n.matches(e,"tui.editor.undo")){this.undo();return}if(this.autocompleteState&&this.autocompleteList){if(n.matches(e,"tui.select.cancel")){this.cancelAutocomplete();return}if(n.matches(e,"tui.select.up")||n.matches(e,"tui.select.down")){this.autocompleteList.handleInput(e);return}if(n.matches(e,"tui.input.tab")){let i=this.autocompleteList.getSelectedItem();if(i&&this.autocompleteProvider){this.pushUndoSnapshot(),this.lastAction=null;let s=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,i,this.autocompletePrefix);this.state.lines=s.lines,this.state.cursorLine=s.cursorLine,this.setCursorCol(s.cursorCol),this.cancelAutocomplete(),this.onChange&&this.onChange(this.getText())}return}if(n.matches(e,"tui.select.confirm")){let i=this.autocompleteList.getSelectedItem();if(i&&this.autocompleteProvider){this.pushUndoSnapshot(),this.lastAction=null;let s=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,i,this.autocompletePrefix);if(this.state.lines=s.lines,this.state.cursorLine=s.cursorLine,this.setCursorCol(s.cursorCol),this.autocompletePrefix.startsWith("/"))this.cancelAutocomplete();else{this.cancelAutocomplete(),this.onChange&&this.onChange(this.getText());return}}}}if(n.matches(e,"tui.input.tab")&&!this.autocompleteState){this.handleTabCompletion();return}if(n.matches(e,"tui.editor.deleteToLineEnd")){this.deleteToEndOfLine();return}if(n.matches(e,"tui.editor.deleteToLineStart")){this.deleteToStartOfLine();return}if(n.matches(e,"tui.editor.deleteWordBackward")){this.deleteWordBackwards();return}if(n.matches(e,"tui.editor.deleteWordForward")){this.deleteWordForward();return}if(n.matches(e,"tui.editor.deleteCharBackward")||sm(e,"shift+backspace")){this.handleBackspace();return}if(n.matches(e,"tui.editor.deleteCharForward")||sm(e,"shift+delete")){this.handleForwardDelete();return}if(n.matches(e,"tui.editor.yank")){this.yank();return}if(n.matches(e,"tui.editor.yankPop")){this.yankPop();return}if(n.matches(e,"tui.editor.historyPrevious")){this.cancelAutocomplete(),this.navigateHistory(-1);return}if(n.matches(e,"tui.editor.historyNext")){this.cancelAutocomplete(),this.navigateHistory(1);return}if(n.matches(e,"tui.editor.cursorLineStart")){this.moveToLineStart();return}if(n.matches(e,"tui.editor.cursorLineEnd")){this.moveToLineEnd();return}if(n.matches(e,"tui.editor.cursorWordLeft")){this.moveWordBackwards();return}if(n.matches(e,"tui.editor.cursorWordRight")){this.moveWordForwards();return}if(n.matches(e,"tui.input.newLine")||e.charCodeAt(0)===10&&e.length>1||e==="\x1B\r"||e==="\x1B[13;2~"||e.length>1&&e.includes("\x1B")&&e.includes("\r")||e===` +`&&e.length===1){if(this.shouldSubmitOnBackslashEnter(e,n)){this.handleBackspace(),this.submitValue();return}this.addNewLine();return}if(n.matches(e,"tui.input.submit")){if(this.disableSubmit)return;let i=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>0&&i[this.state.cursorCol-1]==="\\"){this.handleBackspace(),this.addNewLine();return}this.submitValue();return}if(n.matches(e,"tui.editor.cursorUp")){this.isOnFirstVisualLine()&&(this.isEditorEmpty()||this.historyIndex>-1||this.state.cursorCol===0)?this.navigateHistory(-1):this.isOnFirstVisualLine()?this.moveToLineStart():this.moveCursor(-1,0);return}if(n.matches(e,"tui.editor.cursorDown")){this.historyIndex>-1&&this.isOnLastVisualLine()?this.navigateHistory(1):this.isOnLastVisualLine()?this.moveToLineEnd():this.moveCursor(1,0);return}if(n.matches(e,"tui.editor.cursorRight")){this.moveCursor(0,1);return}if(n.matches(e,"tui.editor.cursorLeft")){this.moveCursor(0,-1);return}if(n.matches(e,"tui.editor.pageUp")){this.pageScroll(-1);return}if(n.matches(e,"tui.editor.pageDown")){this.pageScroll(1);return}if(n.matches(e,"tui.editor.jumpForward")){this.jumpMode="forward";return}if(n.matches(e,"tui.editor.jumpBackward")){this.jumpMode="backward";return}if(sm(e,"shift+space")){this.insertCharacter(" ");return}let r=Aot(e);if(r!==void 0){this.insertCharacter(r);return}e.charCodeAt(0)>=32&&this.insertCharacter(e)}layoutText(e){let n=[];if(this.state.lines.length===0||this.state.lines.length===1&&this.state.lines[0]==="")return n.push({text:"",hasCursor:!0,cursorPos:0}),n;for(let r=0;r=u.startIndex,h=l-u.startIndex):(m=l>=u.startIndex&&lu.text.length&&(h=u.text.length)))),m?n.push({text:u.text,hasCursor:!0,cursorPos:h}):n.push({text:u.text,hasCursor:!1})}}}return n}getText(){return this.state.lines.join(` +`)}expandPasteMarkers(e){let n=e;for(let[r,i]of this.pastes){let s=new RegExp(`\\[paste #${r}( (\\+\\d+ lines|\\d+ chars))?\\]`,"g");n=n.replace(s,()=>i)}return n}getExpandedText(){return this.expandPasteMarkers(this.state.lines.join(` +`))}getLines(){return[...this.state.lines]}getCursor(){return{line:this.state.cursorLine,col:this.state.cursorCol}}setText(e){this.cancelAutocomplete(),this.lastAction=null,this.exitHistoryBrowsing();let n=this.normalizeText(e);this.getText()!==n&&this.pushUndoSnapshot(),this.pastes.clear(),this.pasteCounter=0,this.setTextInternal(n)}insertTextAtCursor(e){e&&(this.cancelAutocomplete(),this.pushUndoSnapshot(),this.lastAction=null,this.exitHistoryBrowsing(),this.insertTextAtCursorInternal(e))}normalizeText(e){return e.replace(/\r\n/g,` +`).replace(/\r/g,` +`).replace(/\t/g," ")}insertTextAtCursorInternal(e){if(!e)return;let n=this.normalizeText(e),r=n.split(` +`),i=this.state.lines[this.state.cursorLine]||"",s=i.slice(0,this.state.cursorCol),o=i.slice(this.state.cursorCol);r.length===1?(this.state.lines[this.state.cursorLine]=s+n+o,this.setCursorCol(this.state.cursorCol+n.length)):(this.state.lines=[...this.state.lines.slice(0,this.state.cursorLine),s+r[0],...r.slice(1,-1),r[r.length-1]+o,...this.state.lines.slice(this.state.cursorLine+1)],this.state.cursorLine+=r.length-1,this.setCursorCol((r[r.length-1]||"").length)),this.onChange&&this.onChange(this.getText())}insertCharacter(e,n){this.exitHistoryBrowsing(),n||((hE(e)||this.lastAction!=="type-word")&&this.pushUndoSnapshot(),this.lastAction="type-word");let r=this.state.lines[this.state.cursorLine]||"",i=r.slice(0,this.state.cursorCol),s=r.slice(this.state.cursorCol);if(this.state.lines[this.state.cursorLine]=i+e+s,this.setCursorCol(this.state.cursorCol+e.length),this.onChange&&this.onChange(this.getText()),this.autocompleteState)this.updateAutocomplete();else if(e==="/"&&this.isAtStartOfMessage())this.tryTriggerAutocomplete();else if(this.autocompleteTriggerCharacters.includes(e)){let a=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);this.autocompleteTriggerPattern.test(a)&&this.tryTriggerAutocomplete()}else if(/[a-zA-Z0-9.\-_]/.test(e)||G8.test(e)){let a=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);this.isInSlashCommandContext(a)?this.tryTriggerAutocomplete():this.autocompleteTriggerPattern.test(a)&&this.tryTriggerAutocomplete()}}handlePaste(e){this.cancelAutocomplete(),this.exitHistoryBrowsing(),this.lastAction=null,this.pushUndoSnapshot();let n=e.replace(/\x1b\[(\d+);5u/g,(a,c)=>{let u=Number(c);return u>=97&&u<=122?String.fromCharCode(u-96):u>=65&&u<=90?String.fromCharCode(u-64):a}),i=this.normalizeText(n).split("").filter(a=>a===` +`||a.charCodeAt(0)>=32).join("");if(/^[/~.]/.test(i)){let a=this.state.lines[this.state.cursorLine]||"",c=this.state.cursorCol>0?a[this.state.cursorCol-1]:"";c&&/\w/.test(c)&&(i=` ${i}`)}let s=i.split(` +`),o=i.length;if(s.length>10||o>1e3){this.pasteCounter++;let a=this.pasteCounter;this.pastes.set(a,i);let c=s.length>10?`[paste #${a} +${s.length} lines]`:`[paste #${a} ${o} chars]`;this.insertTextAtCursorInternal(c);return}if(s.length===1){this.insertTextAtCursorInternal(i);return}this.insertTextAtCursorInternal(i)}addNewLine(){this.cancelAutocomplete(),this.exitHistoryBrowsing(),this.lastAction=null,this.pushUndoSnapshot();let e=this.state.lines[this.state.cursorLine]||"",n=e.slice(0,this.state.cursorCol),r=e.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=n,this.state.lines.splice(this.state.cursorLine+1,0,r),this.state.cursorLine++,this.setCursorCol(0),this.onChange&&this.onChange(this.getText())}shouldSubmitOnBackslashEnter(e,n){if(this.disableSubmit||!sm(e,"enter"))return!1;let r=n.getKeys("tui.input.submit");if(!(r.includes("shift+enter")||r.includes("shift+return")))return!1;let s=this.state.lines[this.state.cursorLine]||"";return this.state.cursorCol>0&&s[this.state.cursorCol-1]==="\\"}submitValue(){this.cancelAutocomplete();let e=this.expandPasteMarkers(this.state.lines.join(` +`)).trim();this.state={lines:[""],cursorLine:0,cursorCol:0},this.pastes.clear(),this.pasteCounter=0,this.exitHistoryBrowsing(),this.scrollOffset=0,this.undoStack.clear(),this.lastAction=null,this.onChange&&this.onChange(""),this.onSubmit&&this.onSubmit(e)}handleBackspace(){if(this.exitHistoryBrowsing(),this.lastAction=null,this.state.cursorCol>0){this.pushUndoSnapshot();let e=this.state.lines[this.state.cursorLine]||"",n=e.slice(0,this.state.cursorCol),r=[...this.segment(n,"grapheme")],i=r[r.length-1],s=i?i.segment.length:1,o=O1n.exec(i.segment);if(o){let u=Number(o[1]);this.pastes.delete(u),this.pasteCounter--;let l=[...this.pastes.keys()].filter(d=>d>u).sort((d,m)=>d-m);for(let d of l)this.pastes.set(d-1,this.pastes.get(d)),this.pastes.delete(d);this.state.lines=this.state.lines.map(d=>d.replace(M1n,(m,h,f)=>{let g=Number(h);return g<=u?m:`[paste #${g-1}${f}]`}))}e=this.state.lines[this.state.cursorLine]||"";let a=e.slice(0,this.state.cursorCol-s),c=e.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=a+c,this.setCursorCol(this.state.cursorCol-s)}else if(this.state.cursorLine>0){this.pushUndoSnapshot();let e=this.state.lines[this.state.cursorLine]||"",n=this.state.lines[this.state.cursorLine-1]||"";this.state.lines[this.state.cursorLine-1]=n+e,this.state.lines.splice(this.state.cursorLine,1),this.state.cursorLine--,this.setCursorCol(n.length)}if(this.onChange&&this.onChange(this.getText()),this.autocompleteState)this.updateAutocomplete();else{let n=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);this.isInSlashCommandContext(n)?this.tryTriggerAutocomplete():this.autocompleteTriggerPattern.test(n)&&this.tryTriggerAutocomplete()}}setCursorCol(e){this.state.cursorCol=e,this.preferredVisualCol=null,this.snappedFromCursorCol=null}moveToVisualLine(e,n,r){let i=e[n],s=e[r];if(!(i&&s))return;let o;if(this.snappedFromCursorCol!==null){let g=this.findVisualLineAt(e,i.logicalLine,this.snappedFromCursorCol);o=this.snappedFromCursorCol-e[g].startCol}else o=this.state.cursorCol-i.startCol;let c=n===e.length-1||e[n+1]?.logicalLine!==i.logicalLine?i.length:Math.max(0,i.length-1),l=r===e.length-1||e[r+1]?.logicalLine!==s.logicalLine?s.length:Math.max(0,s.length-1),d=this.computeVerticalMoveColumn(o,c,l);this.state.cursorLine=s.logicalLine;let m=s.startCol+d,h=this.state.lines[s.logicalLine]||"";this.state.cursorCol=Math.min(m,h.length);let f=[...this.segment(h,"grapheme")];for(let g of f){if(g.index>this.state.cursorCol)break;if(!(g.segment.length<=1)&&this.state.cursorColn;if(A&&y){let E=g.index+g.segment.length,_=r+1;for(;_0){this.pushUndoSnapshot();let n=e.slice(0,this.state.cursorCol);this.killRing.push(n,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.state.lines[this.state.cursorLine]=e.slice(this.state.cursorCol),this.setCursorCol(0)}else if(this.state.cursorLine>0){this.pushUndoSnapshot(),this.killRing.push(` +`,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill";let n=this.state.lines[this.state.cursorLine-1]||"";this.state.lines[this.state.cursorLine-1]=n+e,this.state.lines.splice(this.state.cursorLine,1),this.state.cursorLine--,this.setCursorCol(n.length)}this.onChange&&this.onChange(this.getText())}deleteToEndOfLine(){this.exitHistoryBrowsing();let e=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol0){this.pushUndoSnapshot(),this.killRing.push(` +`,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill";let n=this.state.lines[this.state.cursorLine-1]||"";this.state.lines[this.state.cursorLine-1]=n+e,this.state.lines.splice(this.state.cursorLine,1),this.state.cursorLine--,this.setCursorCol(n.length)}}else{this.pushUndoSnapshot();let n=this.lastAction==="kill",r=this.state.cursorCol;this.moveWordBackwards();let i=this.state.cursorCol;this.setCursorCol(r);let s=e.slice(i,this.state.cursorCol);this.killRing.push(s,{prepend:!0,accumulate:n}),this.lastAction="kill",this.state.lines[this.state.cursorLine]=e.slice(0,i)+e.slice(this.state.cursorCol),this.setCursorCol(i)}this.onChange&&this.onChange(this.getText())}deleteWordForward(){this.exitHistoryBrowsing();let e=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>=e.length){if(this.state.cursorLine=0&&(o=0&&s0)if(this.state.cursorCol0){let o=s.slice(0,this.state.cursorCol),a=[...this.segment(o,"grapheme")],c=a[a.length-1];this.setCursorCol(this.state.cursorCol-(c?c.segment.length:1))}else if(this.state.cursorLine>0){this.state.cursorLine--;let o=this.state.lines[this.state.cursorLine]||"";this.setCursorCol(o.length)}}this.autocompleteState&&this.updateAutocomplete()}pageScroll(e){this.lastAction=null;let n=this.tui.terminal.rows,r=Math.max(5,Math.floor(n*.3)),i=this.buildVisualLineMap(this.lastWidth),s=this.findCurrentVisualLine(i),o=Math.max(0,Math.min(i.length-1,s+e*r));this.moveToVisualLine(i,s,o)}moveWordBackwards(){this.lastAction=null;let e=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol===0){if(this.state.cursorLine>0){this.state.cursorLine--;let n=this.state.lines[this.state.cursorLine]||"";this.setCursorCol(n.length)}return}this.setCursorCol(oTe(e,this.state.cursorCol,{segment:n=>this.segment(n,"word"),isAtomicSegment:sj}))}yank(){if(this.killRing.length===0)return;this.pushUndoSnapshot();let e=this.killRing.peek();this.insertYankedText(e),this.lastAction="yank"}yankPop(){if(this.lastAction!=="yank"||this.killRing.length<=1)return;this.pushUndoSnapshot(),this.deleteYankedText(),this.killRing.rotate();let e=this.killRing.peek();this.insertYankedText(e),this.lastAction="yank"}insertYankedText(e){this.exitHistoryBrowsing();let n=e.split(` +`);if(n.length===1){let r=this.state.lines[this.state.cursorLine]||"",i=r.slice(0,this.state.cursorCol),s=r.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=i+e+s,this.setCursorCol(this.state.cursorCol+e.length)}else{let r=this.state.lines[this.state.cursorLine]||"",i=r.slice(0,this.state.cursorCol),s=r.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=i+(n[0]||"");for(let a=1;a=e.length){this.state.cursorLinethis.segment(n,"word"),isAtomicSegment:sj}))}isSlashMenuAllowed(){return this.state.cursorLine===0}isAtStartOfMessage(){if(!this.isSlashMenuAllowed())return!1;let n=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);return n.trim()===""||n.trim()==="/"}isInSlashCommandContext(e){return this.isSlashMenuAllowed()&&e.trimStart().startsWith("/")}getBestAutocompleteMatchIndex(e,n){if(!n)return-1;let r=-1;for(let i=0;i{if(!this.autocompleteProvider)return;this.pushUndoSnapshot(),this.lastAction=null;let o=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,s,this.autocompletePrefix);this.state.lines=o.lines,this.state.cursorLine=o.cursorLine,this.setCursorCol(o.cursorCol),this.cancelAutocomplete(),this.onChange?.(this.getText())},i}tryTriggerAutocomplete(e=!1){this.requestAutocomplete({force:!1,explicitTab:e})}handleTabCompletion(){if(!this.autocompleteProvider)return;let n=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);this.isInSlashCommandContext(n)&&!n.trimStart().includes(" ")?this.handleSlashCommandCompletion():this.forceFileAutocomplete(!0)}handleSlashCommandCompletion(){this.requestAutocomplete({force:!1,explicitTab:!0})}forceFileAutocomplete(e=!1){this.requestAutocomplete({force:!0,explicitTab:e})}requestAutocomplete(e){if(!this.autocompleteProvider||e.force&&!(!this.autocompleteProvider.shouldTriggerFileCompletion||this.autocompleteProvider.shouldTriggerFileCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol)))return;this.cancelAutocompleteRequest();let n=++this.autocompleteStartToken,r=this.getAutocompleteDebounceMs(e);if(r>0){this.autocompleteDebounceTimer=setTimeout(()=>{this.autocompleteDebounceTimer=void 0,this.startAutocompleteRequest(n,e)},r);return}this.startAutocompleteRequest(n,e)}async startAutocompleteRequest(e,n){let r=this.autocompleteRequestTask;this.autocompleteRequestTask=(async()=>{if(await r,e!==this.autocompleteStartToken||!this.autocompleteProvider)return;let i=new AbortController;this.autocompleteAbort=i;let s=++this.autocompleteRequestId,o=this.getText(),a=this.state.cursorLine,c=this.state.cursorCol;await this.runAutocompleteRequest(s,i,o,a,c,n)})(),await this.autocompleteRequestTask}setAutocompleteTriggerCharacters(e){let n=[...k1n];for(let r of e)r.length!==1||r==="/"||hE(r)||n.includes(r)||n.push(r);this.autocompleteTriggerCharacters=n,this.autocompleteTriggerPattern=B1n(n),this.autocompleteDebouncePattern=N1n(n)}getAutocompleteDebounceMs(e){if(e.explicitTab||e.force)return 0;let r=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);return this.autocompleteDebouncePattern.test(r)?CNi:0}async runAutocompleteRequest(e,n,r,i,s,o){if(!this.autocompleteProvider)return;let a=await this.autocompleteProvider.getSuggestions(this.state.lines,this.state.cursorLine,this.state.cursorCol,{signal:n.signal,force:o.force});if(this.isAutocompleteRequestCurrent(e,n,r,i,s)){if(this.autocompleteAbort=void 0,!a||!Array.isArray(a.items)||a.items.length===0){this.cancelAutocomplete(),this.tui.requestRender();return}if(o.force&&o.explicitTab&&a.items.length===1){let c=a.items[0];this.pushUndoSnapshot(),this.lastAction=null;let u=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,c,a.prefix);this.state.lines=u.lines,this.state.cursorLine=u.cursorLine,this.setCursorCol(u.cursorCol),this.onChange&&this.onChange(this.getText()),this.tui.requestRender();return}this.applyAutocompleteSuggestions(a,o.force?"force":"regular"),this.tui.requestRender()}}isAutocompleteRequestCurrent(e,n,r,i,s){return!n.signal.aborted&&e===this.autocompleteRequestId&&this.getText()===r&&this.state.cursorLine===i&&this.state.cursorCol===s}applyAutocompleteSuggestions(e,n){this.autocompletePrefix=e.prefix,this.autocompleteList=this.createAutocompleteList(e.prefix,e.items);let r=this.getBestAutocompleteMatchIndex(e.items,e.prefix);r>=0&&this.autocompleteList.setSelectedIndex(r),this.autocompleteState=n}cancelAutocompleteRequest(){this.autocompleteStartToken+=1,this.autocompleteDebounceTimer&&(clearTimeout(this.autocompleteDebounceTimer),this.autocompleteDebounceTimer=void 0),this.autocompleteAbort?.abort(),this.autocompleteAbort=void 0}clearAutocompleteUi(){this.autocompleteState=null,this.autocompleteList=void 0,this.autocompletePrefix=""}cancelAutocomplete(){this.cancelAutocompleteRequest(),this.clearAutocompleteUi()}isShowingAutocomplete(){return this.autocompleteState!==null}updateAutocomplete(){!this.autocompleteState||!this.autocompleteProvider||this.requestAutocomplete({force:this.autocompleteState==="force",explicitTab:!1})}}});function cTe(t){let e=t;return typeof e[oj]=="function"?e[oj]():void 0}var oj,Nre=v(()=>{p();oj=Symbol.for("@earendil-works/pi-tui/layout-node")});function INi(t){return!("render"in t)}function Dre(t,e){return t===void 0||!Number.isFinite(t)?e:Math.max(0,Math.floor(t))}function cj(t,e){return t.filter(n=>n.visible?.(e)??!0)}function wNi(t,e){let n=Math.max(0,Math.floor(e.minSize??0)),r=Math.max(n,Math.floor(e.maxSize??Number.MAX_SAFE_INTEGER));return Math.max(n,Math.min(r,Math.max(0,Math.floor(t))))}function Q1n(t,e,n,r){let i=n;for(;i>0;){let s=e.map((c,u)=>({entry:c,index:u})).filter(({entry:c,index:u})=>r==="grow"?(c.grow??0)>0&&t[u]<(c.maxSize??Number.MAX_SAFE_INTEGER):(c.shrink??1)>0&&t[u]>(c.minSize??0));if(s.length===0)return;let o=s.reduce((c,{entry:u,index:l})=>c+(r==="grow"?u.grow??0:(u.shrink??1)*Math.max(1,t[l])),0),a=0;for(let{entry:c,index:u}of s){if(i<=0)break;let l=r==="grow"?c.grow??0:(c.shrink??1)*Math.max(1,t[u]),d=Math.max(1,Math.floor(i*l/o)),m=r==="grow"?(c.maxSize??Number.MAX_SAFE_INTEGER)-t[u]:t[u]-(c.minSize??0),h=Math.min(i,d,m);h<=0||(t[u]=t[u]+(r==="grow"?h:-h),i-=h,a+=h)}if(a===0)return}}function VF(t,e,n,r){let i=t.map((a,c)=>wNi(a.basis===void 0||a.basis==="auto"?e[c]??0:a.basis,a));if(n===void 0)return i;let s=Math.max(0,Math.floor(n)-Math.max(0,t.length-1)*r),o=i.reduce((a,c)=>a+c,0);return os&&Q1n(i,t,o-s,"shrink"),i}var aj,lTe=v(()=>{p();Nre();_b();aj=class extends gn{entries=[];gap;align;constructor(e=[],n={}){super(),this.gap=Dre(n.gap,0),this.align=n.align??"stretch";for(let r of e)INi(r)?this.addChild(r.component,r):this.addChild(r)}addChild(e,n={}){super.addChild(e),this.entries.push({component:e,...n.basis===void 0?{}:{basis:n.basis},...n.grow===void 0?{}:{grow:Dre(n.grow,0)},...n.shrink===void 0?{}:{shrink:Dre(n.shrink,1)},...n.minSize===void 0?{}:{minSize:Dre(n.minSize,0)},...n.maxSize===void 0?{}:{maxSize:Dre(n.maxSize,Number.MAX_SAFE_INTEGER)},...n.visible===void 0?{}:{visible:n.visible}})}removeChild(e){super.removeChild(e);let n=this.entries.findIndex(r=>r.component===e);n!==-1&&this.entries.splice(n,1)}clear(){super.clear(),this.entries.length=0}[oj](){return{type:this.layoutType,entries:this.entries,gap:this.gap,align:this.align}}}});var uTe,U1n=v(()=>{p();_b();ld();lTe();uTe=class extends aj{layoutType="hstack";constructor(e=[],n={}){super(e,n)}render(e){let n=Math.max(1,e),r={width:n,height:Number.MAX_SAFE_INTEGER},i=cj(this.entries,r);if(i.length===0)return[];let s=i.map(d=>d.component.render(n).reduce((h,f)=>Math.max(h,rn(f)),0)),o=VF(i,s,n,this.gap),a=i.map((d,m)=>o[m]===0?[]:d.component.render(o[m])),c=a.reduce((d,m)=>Math.max(d,m.length),0),u=Array.from({length:c},()=>""),l=0;for(let d=0;d=u.length||(u[A]=aw(u[A],m[g],l,h,n))}l+=h+this.gap}return u}}});var wD,G1n=v(()=>{p();SD();ld();wD=class{base64Data;mimeType;dimensions;theme;options;imageId;cachedLines;cachedWidth;constructor(e,n,r,i={},s){this.base64Data=e,this.mimeType=n,this.theme=r,this.options=i,this.dimensions=s||ej(e,n)||{widthPx:800,heightPx:600},this.imageId=i.imageId}getImageId(){return this.imageId}invalidate(){this.cachedLines=void 0,this.cachedWidth=void 0}render(e){if(this.cachedLines&&this.cachedWidth===e)return this.cachedLines;let n=Math.max(1,Math.min(e-2,this.options.maxWidthCells??60)),r=vre(),i=Math.max(1,Math.ceil(n*r.widthPx/r.heightPx)),s=this.options.maxHeightCells??i,o=Dl(),a;if(o.images){o.images==="kitty"&&this.imageId===void 0&&(this.imageId=eTe());let c=rTe(this.base64Data,this.dimensions,{maxWidthCells:n,maxHeightCells:s,imageId:this.imageId,moveCursor:!1});if(c)if(c.imageId&&(this.imageId=c.imageId),o.images==="kitty"){a=[c.sequence];for(let u=0;u0?`\x1B[${u}A`:"";a.push(l+c.sequence)}else{let u=qF(this.mimeType,this.dimensions,this.options.filename);a=[dr(this.theme.fallbackColor(u),e)]}}else{let c=qF(this.mimeType,this.dimensions,this.options.filename);a=[dr(this.theme.fallbackColor(c),e)]}return this.cachedLines=a,this.cachedWidth=e,a}}});var YF,ma,dTe=v(()=>{p();NR();xD();Dot();_b();Pot();ld();Mot();YF=Q8(),ma=class{value="";cursor=0;prompt;placeholder;placeholderStyle;renderedStartColumn=0;onSubmit;onEscape;focused=!1;pasteBuffer="";isInPaste=!1;killRing=new rj;lastAction=null;undoStack=new ij;constructor(e={}){this.prompt=e.prompt??"> ",this.placeholder=e.placeholder??"",this.placeholderStyle=e.placeholderStyle??(n=>n)}getValue(){return this.value}setValue(e){this.value=e,this.cursor=Math.min(this.cursor,e.length)}handleInput(e){if(e.includes("\x1B[200~")&&(this.isInPaste=!0,this.pasteBuffer="",e=e.replace("\x1B[200~","")),this.isInPaste){this.pasteBuffer+=e;let s=this.pasteBuffer.indexOf("\x1B[201~");if(s!==-1){let o=this.pasteBuffer.substring(0,s);this.handlePaste(o),this.isInPaste=!1;let a=this.pasteBuffer.substring(s+6);this.pasteBuffer="",a&&this.handleInput(a)}return}let n=Ai();if(n.matches(e,"tui.select.cancel")){this.onEscape&&this.onEscape();return}if(n.matches(e,"tui.editor.undo")){this.undo();return}if(n.matches(e,"tui.input.submit")||e===` +`){this.onSubmit&&this.onSubmit(this.value);return}if(n.matches(e,"tui.editor.deleteCharBackward")){this.handleBackspace();return}if(n.matches(e,"tui.editor.deleteCharForward")){this.handleForwardDelete();return}if(n.matches(e,"tui.editor.deleteWordBackward")){this.deleteWordBackwards();return}if(n.matches(e,"tui.editor.deleteWordForward")){this.deleteWordForward();return}if(n.matches(e,"tui.editor.deleteToLineStart")){this.deleteToLineStart();return}if(n.matches(e,"tui.editor.deleteToLineEnd")){this.deleteToLineEnd();return}if(n.matches(e,"tui.editor.yank")){this.yank();return}if(n.matches(e,"tui.editor.yankPop")){this.yankPop();return}if(n.matches(e,"tui.editor.cursorLeft")){if(this.lastAction=null,this.cursor>0){let s=this.value.slice(0,this.cursor),o=[...YF.segment(s)],a=o[o.length-1];this.cursor-=a?a.segment.length:1}return}if(n.matches(e,"tui.editor.cursorRight")){if(this.lastAction=null,this.cursor{let o=s.charCodeAt(0);return o<32||o===127||o>=128&&o<=159})||this.insertCharacter(e)}handleMouse(e){if(e.type!=="press"||e.button!=="left"||e.y!==0)return;let n=Math.max(0,e.x-2),r=this.renderedStartColumn+n,i=0;this.cursor=this.value.length;for(let s of YF.segment(this.value)){let o=i+rn(s.segment);if(r0){this.pushUndo();let e=this.value.slice(0,this.cursor),n=[...YF.segment(e)],r=n[n.length-1],i=r?r.segment.length:1;this.value=this.value.slice(0,this.cursor-i)+this.value.slice(this.cursor),this.cursor-=i}}handleForwardDelete(){if(this.lastAction=null,this.cursor=this.value.length)return;this.pushUndo();let e=this.value.slice(this.cursor);this.killRing.push(e,{prepend:!1,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.value=this.value.slice(0,this.cursor)}deleteWordBackwards(){if(this.cursor===0)return;let e=this.lastAction==="kill";this.pushUndo();let n=this.cursor;this.moveWordBackwards();let r=this.cursor;this.cursor=n;let i=this.value.slice(r,this.cursor);this.killRing.push(i,{prepend:!0,accumulate:e}),this.lastAction="kill",this.value=this.value.slice(0,r)+this.value.slice(this.cursor),this.cursor=r}deleteWordForward(){if(this.cursor>=this.value.length)return;let e=this.lastAction==="kill";this.pushUndo();let n=this.cursor;this.moveWordForwards();let r=this.cursor;this.cursor=n;let i=this.value.slice(this.cursor,r);this.killRing.push(i,{prepend:!1,accumulate:e}),this.lastAction="kill",this.value=this.value.slice(0,this.cursor)+this.value.slice(r)}yank(){let e=this.killRing.peek();e&&(this.pushUndo(),this.value=this.value.slice(0,this.cursor)+e+this.value.slice(this.cursor),this.cursor+=e.length,this.lastAction="yank")}yankPop(){if(this.lastAction!=="yank"||this.killRing.length<=1)return;this.pushUndo();let e=this.killRing.peek()||"";this.value=this.value.slice(0,this.cursor-e.length)+this.value.slice(this.cursor),this.cursor-=e.length,this.killRing.rotate();let n=this.killRing.peek()||"";this.value=this.value.slice(0,this.cursor)+n+this.value.slice(this.cursor),this.cursor+=n.length,this.lastAction="yank"}pushUndo(){this.undoStack.push({value:this.value,cursor:this.cursor})}undo(){let e=this.undoStack.pop();e&&(this.value=e.value,this.cursor=e.cursor,this.lastAction=null)}moveWordBackwards(){this.cursor!==0&&(this.lastAction=null,this.cursor=oTe(this.value,this.cursor))}moveWordForwards(){this.cursor>=this.value.length||(this.lastAction=null,this.cursor=aTe(this.value,this.cursor))}handlePaste(e){this.lastAction=null,this.pushUndo();let n=e.replace(/\r\n/g,"").replace(/\r/g,"").replace(/\n/g,"").replace(/\t/g," ");this.value=this.value.slice(0,this.cursor)+n+this.value.slice(this.cursor),this.cursor+=n.length}invalidate(){}render(e){let n=e-rn(this.prompt);if(n<=0)return[dr(this.prompt,e,"")];if(this.value.length===0&&this.placeholder){let y=dr(this.placeholder,n,""),_=[...YF.segment(y)][0]?.segment??" ",S=y.slice(_.length),C=this.focused?AE:"",I=`\x1B[7m${this.placeholderStyle(_)}\x1B[27m`,w=C+I+this.placeholderStyle(S),k=" ".repeat(Math.max(0,n-rn(w)));return[this.prompt+w+k]}let r="",i=this.cursor;this.renderedStartColumn=0;let s=rn(this.value);if(s0){let _=Math.floor(y/2),S=0;E<_?S=0:E>s-_?S=Math.max(0,s-y):S=Math.max(0,E-_),this.renderedStartColumn=S,r=Hc(this.value,S,y,!0),i=Hc(this.value,S,Math.max(0,E-S),!0).length}else r="",i=0}let a=[...YF.segment(r.slice(i))][0],c=r.slice(0,i),u=a?.segment??" ",l=r.slice(i+u.length),d=this.focused?AE:"",m=`\x1B[7m${u}\x1B[27m`,h=c+d+m+l,f=rn(h),g=" ".repeat(Math.max(0,n-f));return[this.prompt+h+g]}}});function WNi(t,e){let n="";for(let r of t){let i=e[r];if(i===void 0)return;n+=i}return n}function W1n(t){return t.trim().replace(/\s*([=+-])\s*/g,"$1")}function Qot(t,e){return WNi(W1n(t),e==="sub"?MNi:PNi)}function zF(t,e){t=W1n(t);let n=Qot(t,e);if(n!==void 0)return n;let r=e==="sub"?"_":"^";return Array.from(t).length===1||e==="sub"&&/^[A-Za-z]+$/.test(t)?`${r}${t}`:`${r}(${t})`}function HNi(t,e){t=t.trim(),e=e.trim();let n=/^[\p{L}\p{N}.]+$/u.test(t),r=/^[\p{N}.]+$/u.test(e)||Array.from(e).length===1;return`${n?t:`(${t})`}/${r?e:`(${e})`}`}function pTe(t,e="\u221A"){return t=t.trim(),/^[\p{L}\p{N}.]+$/u.test(t)?`${e}${t}`:`${e}(${t})`}function KF(t){return t.replace(qNi," ").replaceAll(H1n,"").replace(jNi," ").replaceAll(JF,"").split(` +`).map(e=>e.replace(/[ \t]+/g," ").trim()).filter((e,n,r)=>e.length>0||n>0&&ni.baseline)),n=Math.max(...t.map(i=>i.lines.length-i.baseline-1)),r=[];for(let i=0;i<=e+n;i++){let s="";for(let o of t){let a=i-e+o.baseline;s+=a>=0&&ai+s.width,0),baseline:e}}function Mre(t,e){let n=[],r=0;for(let i of t.split(` +`)){let s=[],o=0,a;for(let u of i.matchAll(VNi)){let l=u.index,d=e[Number(u[1])];if(d){if(l>o){let m=i.slice(o,l),h=(a?m.trimStart():m).trimEnd(),f=a?.type==="matrix"&&/^\s/.test(m),g=d.type==="matrix"&&/\s$/.test(m),A=h?`${f?" ":""}${h}${g?" ":""}`:f||g?" ":"";s.push({lines:[A],width:rn(A),baseline:0})}if(d.type==="fraction"){let m=Mre(d.numerator,e),h=Mre(d.denominator,e),f=Math.max(m.width,h.width,1),g=f+2;s.push({lines:[...m.lines.map(A=>DR(A,g,!0)),` ${"\u2500".repeat(f)} `,...h.lines.map(A=>DR(A,g,!0))],width:g,baseline:m.lines.length})}else if(d.type==="operator"){let m=Math.max(rn(d.operator),d.lower===void 0?0:rn(d.lower),d.upper===void 0?0:rn(d.upper)),h=[];d.upper!==void 0&&h.push(`${DR(d.upper,m,!0)} `),h.push(`${DR(d.operator,m,!0)} `),d.lower!==void 0&&h.push(`${DR(d.lower,m,!0)} `),s.push({lines:h,width:m+1,baseline:d.upper===void 0?0:1})}else if(d.type==="script"){let m=d.upper===void 0?void 0:Mre(d.upper,e),h=d.lower===void 0?void 0:Mre(d.lower,e),f=Math.max(m?.width??0,h?.width??0);s.push({lines:[...m?.lines.map(g=>DR(g,f))??[]," ".repeat(f),...h?.lines.map(g=>DR(g,f))??[]],width:f,baseline:m?.lines.length??0})}else{let m=Math.max(0,...d.lines.map(h=>rn(h)));s.push({lines:d.lines.map(h=>DR(h,m)),width:m,baseline:d.baseline})}o=l+u[0].length,a=d}}if(orn(i))),baseline:r}}function Ore(t,e={}){let n=[],r=new Uot(t,n,e.display===!0).render();if(r===void 0)return;if(n.length===0)return r.replaceAll(mTe," ");let i=Mre(r,n).lines,s=Math.min(...i.filter(o=>o.trim()).map(o=>o.length-o.trimStart().length));return i.map(o=>o.slice(s).trimEnd()).join(` +`).trimEnd().replaceAll(mTe," ")}var TNi,vNi,RNi,kNi,BNi,NNi,DNi,PNi,MNi,ONi,LNi,$1n,FNi,QNi,UNi,GNi,$Ni,H1n,JF,qNi,jNi,lj,Pre,VNi,YNi,mTe,Uot,Got=v(()=>{p();ld();TNi={alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03F5",varepsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",vartheta:"\u03D1",iota:"\u03B9",kappa:"\u03BA",varkappa:"\u03F0",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",pi:"\u03C0",varpi:"\u03D6",rho:"\u03C1",varrho:"\u03F1",sigma:"\u03C3",varsigma:"\u03C2",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03D5",varphi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",Gamma:"\u0393",Delta:"\u0394",Theta:"\u0398",Lambda:"\u039B",Xi:"\u039E",Pi:"\u03A0",Sigma:"\u03A3",Upsilon:"\u03A5",Phi:"\u03A6",Psi:"\u03A8",Omega:"\u03A9",pm:"\xB1",mp:"\u2213",times:"\xD7",div:"\xF7",cdot:"\xB7",ast:"\u2217",star:"\u22C6",circ:"\u2218",bullet:"\u2022",oplus:"\u2295",ominus:"\u2296",otimes:"\u2297",oslash:"\u2298",odot:"\u2299",bigcirc:"\u25CB",dagger:"\u2020",ddagger:"\u2021",amalg:"\u2A3F",uplus:"\u228E",sqcap:"\u2293",sqcup:"\u2294",bowtie:"\u22C8",Join:"\u22C8",ltimes:"\u22C9",rtimes:"\u22CA",leftouterjoin:"\u27D5",rightouterjoin:"\u27D6",fullouterjoin:"\u27D7",triangleleft:"\u25C1",triangleright:"\u25B7",wr:"\u2240",cap:"\u2229",cup:"\u222A",bigcap:"\u22C2",bigcup:"\u22C3",bigwedge:"\u22C0",bigvee:"\u22C1",bigsqcup:"\u2A06",biguplus:"\u2A04",bigoplus:"\u2A01",bigotimes:"\u2A02",bigodot:"\u2A00",setminus:"\u2216",in:"\u2208",notin:"\u2209",ni:"\u220B",subset:"\u2282",supset:"\u2283",subseteq:"\u2286",supseteq:"\u2287",sqsubset:"\u228F",sqsupset:"\u2290",sqsubseteq:"\u2291",sqsupseteq:"\u2292",prec:"\u227A",preceq:"\u227C",succ:"\u227B",succeq:"\u227D",ll:"\u226A",gg:"\u226B",le:"\u2264",leq:"\u2264",leqslant:"\u2264",ge:"\u2265",geq:"\u2265",geqslant:"\u2265",ne:"\u2260",neq:"\u2260",equiv:"\u2261",approx:"\u2248",sim:"\u223C",simeq:"\u2243",cong:"\u2245",asymp:"\u224D",doteq:"\u2250",propto:"\u221D",parallel:"\u2225",perp:"\u22A5",mid:"\u2223",vdash:"\u22A2",dashv:"\u22A3",models:"\u22A8",Vdash:"\u22A9",Vvdash:"\u22AA",nvdash:"\u22AC",nvDash:"\u22AD",forall:"\u2200",exists:"\u2203",nexists:"\u2204",neg:"\xAC",land:"\u2227",wedge:"\u2227",lor:"\u2228",vee:"\u2228",to:"\u2192",rightarrow:"\u2192",longrightarrow:"\u2192",leftarrow:"\u2190",longleftarrow:"\u2190",gets:"\u2190",leftrightarrow:"\u2194",longleftrightarrow:"\u2194",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",leftharpoonup:"\u21BC",leftharpoondown:"\u21BD",rightharpoonup:"\u21C0",rightharpoondown:"\u21C1",rightleftharpoons:"\u21CC",leftrightharpoons:"\u21CB",nearrow:"\u2197",searrow:"\u2198",swarrow:"\u2199",nwarrow:"\u2196",rightsquigarrow:"\u21DD",leadsto:"\u21DD",Rightarrow:"\u21D2",Longrightarrow:"\u21D2",Leftarrow:"\u21D0",Longleftarrow:"\u21D0",Leftrightarrow:"\u21D4",Longleftrightarrow:"\u21D4",implies:"\u21D2",iff:"\u21D4",mapsto:"\u21A6",longmapsto:"\u21A6",uparrow:"\u2191",downarrow:"\u2193",partial:"\u2202",nabla:"\u2207",int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",sum:"\u2211",prod:"\u220F",coprod:"\u2210",infty:"\u221E",emptyset:"\u2205",varnothing:"\u2205",angle:"\u2220",therefore:"\u2234",because:"\u2235",aleph:"\u2135",beth:"\u2136",gimel:"\u2137",daleth:"\u2138",top:"\u22A4",bot:"\u22A5",triangle:"\u25B3",square:"\u25A1",lozenge:"\u25CA",checkmark:"\u2713",complement:"\u2201",wp:"\u2118",prime:"\u2032",ldots:"\u2026",dots:"\u2026",cdots:"\u22EF",vdots:"\u22EE",ddots:"\u22F1",ell:"\u2113",hbar:"\u210F",Im:"\u2111",Re:"\u211C",langle:"\u27E8",rangle:"\u27E9",vert:"|",lvert:"|",rvert:"|",Vert:"\u2016",lVert:"\u2016",rVert:"\u2016",lbrace:"{",rbrace:"}",backslash:"\\",lfloor:"\u230A",rfloor:"\u230B",lceil:"\u2308",rceil:"\u2309",colon:":"},vNi=new Set(["arccos","arcsin","arctan","arg","cos","cosh","cot","coth","csc","deg","det","dim","exp","gcd","hom","inf","ker","lg","lim","liminf","limsup","ln","log","max","min","Pr","sec","sin","sinh","sup","tan","tanh"]),RNi=new Set(["argmax","argmin","inf","injlim","lim","liminf","limsup","max","min","projlim","sup"]),kNi=new Set(["bigcap","bigcup","bigodot","bigoplus","bigotimes","bigsqcup","biguplus","bigvee","bigwedge","coprod","int","iint","iiint","oint","prod","sum"]),BNi=new Set(["Leftarrow","Leftrightarrow","Longleftarrow","Longleftrightarrow","Longrightarrow","Rightarrow","Join","Vdash","Vvdash","approx","asymp","bowtie","cong","dashv","fullouterjoin","doteq","downarrow","equiv","ge","geq","geqslant","gets","gg","hookleftarrow","hookrightarrow","iff","implies","in","leadsto","le","leftarrow","leftharpoondown","leftharpoonup","leftrightarrow","leftrightharpoons","leftouterjoin","leq","leqslant","ll","longleftarrow","longleftrightarrow","longmapsto","longrightarrow","ltimes","mapsto","mid","models","ne","nearrow","neq","ni","notin","nvdash","nvDash","nwarrow","parallel","perp","prec","preceq","propto","rightharpoondown","rightharpoonup","rightleftharpoons","rightouterjoin","rightarrow","rightsquigarrow","rtimes","searrow","sim","simeq","sqsubset","sqsubseteq","sqsupset","sqsupseteq","subset","subseteq","succ","succeq","supset","supseteq","swarrow","to","triangleleft","triangleright","twoheadleftarrow","twoheadrightarrow","uparrow","vdash"]),NNi={"<":"\u226E",">":"\u226F","=":"\u2260","\u2208":"\u2209","\u220B":"\u220C","\u2223":"\u2224","\u2225":"\u2226","\u223C":"\u2241","\u2243":"\u2244","\u2245":"\u2247","\u2248":"\u2249","\u2261":"\u2262","\u2264":"\u2270","\u2265":"\u2271","\u227A":"\u2280","\u227B":"\u2281","\u2282":"\u2284","\u2283":"\u2285","\u2286":"\u2288","\u2287":"\u2289","\u22A2":"\u22AC","\u22A8":"\u22AD","\u2194":"\u21AE","\u2190":"\u219A","\u2192":"\u219B","\u21D2":"\u21CF","\u21D0":"\u21CD","\u21D4":"\u21CE","\u227C":"\u22E0","\u227D":"\u22E1"},DNi={C:"\u2102",H:"\u210D",N:"\u2115",P:"\u2119",Q:"\u211A",R:"\u211D",Z:"\u2124"},PNi={0:"\u2070",1:"\xB9",2:"\xB2",3:"\xB3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079","+":"\u207A","-":"\u207B","=":"\u207C","(":"\u207D",")":"\u207E",a:"\u1D43",b:"\u1D47",c:"\u1D9C",d:"\u1D48",e:"\u1D49",f:"\u1DA0",g:"\u1D4D",h:"\u02B0",i:"\u2071",j:"\u02B2",k:"\u1D4F",l:"\u02E1",m:"\u1D50",n:"\u207F",o:"\u1D52",p:"\u1D56",r:"\u02B3",s:"\u02E2",t:"\u1D57",u:"\u1D58",v:"\u1D5B",w:"\u02B7",x:"\u02E3",y:"\u02B8",z:"\u1DBB"},MNi={0:"\u2080",1:"\u2081",2:"\u2082",3:"\u2083",4:"\u2084",5:"\u2085",6:"\u2086",7:"\u2087",8:"\u2088",9:"\u2089","+":"\u208A","-":"\u208B","=":"\u208C","(":"\u208D",")":"\u208E",a:"\u2090",e:"\u2091",h:"\u2095",i:"\u1D62",j:"\u2C7C",k:"\u2096",l:"\u2097",m:"\u2098",n:"\u2099",o:"\u2092",p:"\u209A",r:"\u1D63",s:"\u209B",t:"\u209C",u:"\u1D64",v:"\u1D65",x:"\u2093"},ONi=new Set([",",":",";"," ",">","enspace","enskip","medspace","quad","qquad","thickspace","thinspace"]),LNi=new Set(["!","negmedspace","negthickspace","negthinspace"]),$1n="\0",FNi=new Set(["bf","cal","it","rm","sf","sl","tt"]),QNi=new Set(["displaystyle","limits","nolimits","scriptstyle","scriptscriptstyle","textstyle"]),UNi=new Set(["big","Big","bigg","Bigg","bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr"]),GNi=new Set(["emph","mathcal","mathbf","mathfrak","mathit","mathrm","mathnormal","mathscr","mathsf","mathtt","mathup","mbox","overbrace","pmb","smash","substack","text","textbf","textit","textmd","textnormal","textrm","textsc","textsf","textsl","texttt","textup","underbrace","bm","boldsymbol"]),$Ni={acute:"\u0301",bar:"\u0305",breve:"\u0306",check:"\u030C",ddot:"\u0308",dot:"\u0307",grave:"\u0300",hat:"\u0302",mathring:"\u030A",overleftarrow:"\u20D6",overleftrightarrow:"\u20E1",overline:"\u0305",overrightarrow:"\u20D7",tilde:"\u0303",underline:"\u0332",vec:"\u20D7",widehat:"\u0302",widetilde:"\u0303"};H1n="\u{F0004}",JF="\u{F0005}",qNi=/(?<=[\p{L}\p{N})\]}\u{f0001}])\u{f0004}/gu,jNi=/\u{f0005}(?=[\p{L}\p{N}√\u{f0000}])/gu;lj="\u{F0000}",Pre="\u{F0001}",VNi=/\u{f0000}(\d+)\u{f0001}/gu,YNi=/\u{f0000}(\d+)\u{f0001}$/u,mTe="\u{F0002}";Uot=class t{source;layoutNodes;display;position=0;supported=!0;stackFractions=!0;scriptDepth=0;constructor(e,n,r){this.source=e,this.layoutNodes=n,this.display=r}render(){let e=this.parseSequence();if(!(!this.supported||this.position!==this.source.length))return KF(e)}parseSequence(e){let n="";for(;this.position"){n=`${n.trimEnd()} ${r} `,this.position++;continue}if(r==="&"){this.position++;continue}if(r==="~"){this.position++,n+=" ";continue}if(r==="."){let i=YNi.exec(n),s=i?this.layoutNodes[Number(i[1])]:void 0;if(s?.type==="matrix"){let o=s.lines.length-1;s.lines[o]=`${s.lines[o]??""}${r}`,this.position++;continue}}n+=r,this.position++}return e&&(this.supported=!1),n}parseScripts(e){let n={},r=[],i=m=>{let h=m==="_"?"sub":"sup";this.scriptDepth++;try{n[h]=this.parseRequiredArgument(!1)}finally{this.scriptDepth--}r.push(h)};i(e);let s=this.position;for(;sm!==void 0&&(m.includes("/")||!m.includes(lj)&&Array.from(m).length>1&&!/[A-Z*∗]/.test(m)));if(!(this.display&&u&&(this.scriptDepth>0||n.sub!==void 0&&a===void 0||n.sup!==void 0&&c===void 0)))return r.map(m=>m==="sub"?a??zF(n.sub??"",m):c??zF(n.sup??"",m)).join("");let d=this.layoutNodes.push({type:"script",lower:n.sub===void 0?void 0:KF(n.sub),upper:n.sup===void 0?void 0:KF(n.sup)})-1;return`${lj}${d}${Pre}`}parseWhitespace(){for(;this.position=this.source.length)return this.supported=!1,"";let e="",n=this.source[this.position]??"";if(n===` +`||n==="\r")return this.position++,n==="\r"&&this.source[this.position]===` +`&&this.position++," ";if(/[A-Za-z]/.test(n)){let s=this.position;for(;this.positionDNi[o]??o).join("")}if(e==="operatorname"){let s=this.source[this.position]==="*";s&&this.position++;let o=KF(this.parseRequiredArgument()).trim();return this.parseOperator(o,"bracket",s,!0)}if(e==="mod"||e==="bmod")return" mod ";if(e==="pmod"||e==="pod"){let s=this.parseRequiredArgument().trim();return e==="pmod"?` (mod ${s})`:` (${s})`}if(e==="overset"||e==="stackrel"){let s=this.parseRequiredArgument();return`${this.parseRequiredArgument().trim()}${zF(s,"sup")}`}if(e==="underset"){let s=this.parseRequiredArgument();return`${this.parseRequiredArgument().trim()}${zF(s,"sub")}`}if(GNi.has(e)){let s=this.parseRequiredArgument();return e.startsWith("text")||e==="mbox"?s:s.trim()}return e==="begin"?this.parseEnvironment():e==="end"?(this.supported=!1,""):(this.supported=!1,`\\${e}`)}parseOperator(e,n,r,i=!1){let s=r,o=this.position;for(;o=this.source.length)return this.supported=!1,"";if(this.source[this.position]==="{")return this.position++,this.parseSequence("}");if(this.source[this.position]==="\\")return this.parseCommand();let e=this.source[this.position]??"";return this.position++,e}parseOptionalArgument(){for(;this.position{let c=a.split("&"),u=s?Array.from({length:Math.ceil(c.length/2)},(l,d)=>c.slice(d*2,d*2+2).join("")).join(" "):c.join("");return this.renderNested(u).trim()}).filter(Boolean).join(` +`)}if(e==="cases"||e==="cases*")return this.renderCases(i);if(["array","matrix","smallmatrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"].includes(e)){let s=e==="array"?i.replace(/^\s*\{[^}]*\}/,""):i;return this.renderMatrix(e,s)}return this.supported=!1,i}renderCases(e){let n=this.splitEnvironmentRows(e).map(u=>u.split("&").map(l=>this.renderNested(l,!1).trim())).filter(u=>u.some(Boolean)),r=Math.max(0,...n.map(u=>rn((u[0]??"").replace(/,\s*$/,"")))),i=n.map(u=>{let l=(u[0]??"").replace(/,\s*$/,""),d=u[1]??"";if(!d)return l;let m=/^(?:if|when|for|otherwise)\b/i.test(d)?" ":" if ";return`${l}${mTe.repeat(r-rn(l))}${m}${d}`});if(i.length<=1)return i.length===0?"":`\u23A7 ${i[0]}`;let s=Math.floor(i.length/2),o=[...i];i.length%2===0&&o.splice(s,0,void 0);let a=o.map((u,l)=>{let d=l===0?"\u23A7":l===o.length-1?"\u23A9":"\u23A8";return u===void 0?d:`${d} ${u}`}),c=this.layoutNodes.push({type:"matrix",lines:a,baseline:s})-1;return`${lj}${c}${Pre}`}renderMatrix(e,n){let r=this.splitEnvironmentRows(n).map(u=>u.split("&").map(l=>this.renderNested(l,!1).trim())).filter(u=>u.some(Boolean)),i=Math.max(0,...r.map(u=>u.length)),s=Array.from({length:i},(u,l)=>Math.max(0,...r.map(d=>rn(d[l]??"")))),o=r.map(u=>Array.from({length:i},(l,d)=>{let m=u[d]??"";return`${m}${mTe.repeat(Math.max(0,(s[d]??0)-rn(m)))}`}).join(" \u2502 ")),a;if(e==="array"||e==="matrix"||e==="smallmatrix")a=o;else{let l={pmatrix:["\u239B","\u239E","\u239C","\u239F","\u239D","\u23A0"],bmatrix:["\u23A1","\u23A4","\u23A2","\u23A5","\u23A3","\u23A6"],Bmatrix:["\u23A7","\u23AB","\u23A8","\u23AC","\u23A9","\u23AD"],vmatrix:["\u2502","\u2502","\u2502","\u2502","\u2502","\u2502"],Vmatrix:["\u2551","\u2551","\u2551","\u2551","\u2551","\u2551"]}[e];if(!l)return this.supported=!1,o.join(` +`);a=o.map((d,m)=>{let h=m===0?l[0]:m===o.length-1?l[4]:l[2],f=m===0?l[1]:m===o.length-1?l[5]:l[3];return`${h} ${d} ${f}`})}if(a.length<=1)return a[0]??"";let c=this.layoutNodes.push({type:"matrix",lines:a,baseline:0})-1;return`${lj}${c}${Pre}`}renderNested(e,n=!0){let r=new t(e,this.layoutNodes,this.display&&n).render();return r===void 0?(this.supported=!1,e):r}}});function JNi(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r--)n++;return n%2===1}function XNi(t,e,n){let r=t.indexOf(e,n);for(;r>=0&&JNi(t,r);)r=t.indexOf(e,r+e.length);return r}function q1n(t){return/\\[A-Za-z]+|[_^=+*/<>()[\]|±≤≥≠≈∈→⇒∞∫∑√-]/.test(t)}function ZNi(t){let e="",n="";if(t.startsWith("$$"))e="$$",n="$$";else if(t.startsWith("\\("))e="\\(",n="\\)";else if(t.startsWith("\\["))e="\\[",n="\\]";else if(t.startsWith("$")&&!/^\$\s/.test(t))e="$",n="$";else return;let r=XNi(t,n,e.length);if(r>=0&&e==="$"&&(/\s$/.test(t.slice(e.length,r))||/^\d/.test(t.slice(r+1))||/^[A-Z_][A-Z0-9_]*(?:[^A-Za-z0-9_\s])?$/.test(t.slice(e.length,r))&&/^[A-Za-z_][A-Za-z0-9_]*/.test(t.slice(r+1))||t.slice(e.length,r).includes("`")))return;if(r<0){let o=t.slice(e.length);return e.startsWith("\\")||q1n(o)?{type:"latex",raw:t,text:o,pending:!0}:void 0}let i=t.slice(e.length,r);return!i||i.includes(` +`)?void 0:{type:"latex",raw:t.slice(0,r+n.length),text:i}}function eDi(t){let e=/^ {0,3}\$\$[ \t]*(?:\n)?([\s\S]*?)\$\$[ \t]*(?:\n|$)/.exec(t);if(e?.[1])return{type:"latexBlock",raw:e[0],text:e[1].trim()};let n=/^ {0,3}\\\[[ \t]*(?:\n)?([\s\S]*?)\\\][ \t]*(?:\n|$)/.exec(t);if(n?.[1])return{type:"latexBlock",raw:n[0],text:n[1].trim()};let r=/^ {0,3}\\\[[ \t]*(?:\n)?([\s\S]*)$/.exec(t);if(r)return{type:"latexBlock",raw:r[0],text:r[1],pending:!0};let i=/^ {0,3}\$\$[ \t]*(?:\n)?([\s\S]*)$/.exec(t);if(i?.[1]&&q1n(i[1]))return{type:"latexBlock",raw:i[0],text:i[1],pending:!0}}function Wot(t){let e=t[t.length-1];if(e?.type==="list"){Wot(e.items[e.items.length-1]?.tokens??[]);return}if(e?.type==="blockquote"){Wot(e.tokens??[]);return}if(e?.type!=="code")return;let n=/^(`{3,}|~{3,})/.exec(e.raw)?.[1],r=e.raw.split(` +`).pop();!n||!r||r.length>=n.length||r!==n[0]?.repeat(r.length)||(e.text=e.text.slice(0,-r.length).replace(/\n$/,""))}var KNi,$ot,tDi,Hot,Pl,j1n=v(()=>{p();aot();Got();SD();ld();KNi=/^(~~)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,$ot=class extends O8{del(e){let n=KNi.exec(e);if(!n)return;let r=n[2];return{type:"del",raw:n[0],text:r,tokens:this.lexer.inlineTokens(r)}}};tDi=[{name:"latexBlock",level:"block",start(t){let e=/(?:^|\n) {0,3}(?:\$\$|\\\[)/.exec(t);return e?e.index+(e[0].startsWith(` +`)?1:0):void 0},tokenizer:eDi},{name:"latex",level:"inline",start(t){let e=[t.indexOf("$"),t.indexOf("\\("),t.indexOf("\\[")].filter(n=>n>=0);return e.length>0?Math.min(...e):void 0},tokenizer:ZNi}];Hot=new WF;Hot.setOptions({tokenizer:new $ot});Hot.use({extensions:[...tDi]});Pl=class{text;paddingX;paddingY;defaultTextStyle;theme;options;defaultStylePrefix;cachedText;cachedWidth;cachedLines;constructor(e,n,r,i,s,o){this.text=e,this.paddingX=n,this.paddingY=r,this.theme=i,this.defaultTextStyle=s,this.options=o?{...o}:{}}setText(e){this.text=e,this.invalidate()}invalidate(){this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}render(e){if(this.cachedLines&&this.cachedText===this.text&&this.cachedWidth===e)return this.cachedLines;let n=Math.max(1,e-this.paddingX*2),r=this.options.transform?.(this.text,n)??this.text;if(!r||r.trim()===""){let g=[];return this.cachedText=this.text,this.cachedWidth=e,this.cachedLines=g,g}let i=r.replace(/\t/g," "),s=Hot.lexer(i);Wot(s);let o=[];for(let g=0;g0?f:[""]}applyDefaultStyle(e){if(!this.defaultTextStyle)return e;let n=e;return this.defaultTextStyle.color&&(n=this.defaultTextStyle.color(n)),this.defaultTextStyle.bold&&(n=this.theme.bold(n)),this.defaultTextStyle.italic&&(n=this.theme.italic(n)),this.defaultTextStyle.strikethrough&&(n=this.theme.strikethrough(n)),this.defaultTextStyle.underline&&(n=this.theme.underline(n)),n}getDefaultStylePrefix(){if(!this.defaultTextStyle)return"";if(this.defaultStylePrefix!==void 0)return this.defaultStylePrefix;let e="\0",n=e;this.defaultTextStyle.color&&(n=this.defaultTextStyle.color(n)),this.defaultTextStyle.bold&&(n=this.theme.bold(n)),this.defaultTextStyle.italic&&(n=this.theme.italic(n)),this.defaultTextStyle.strikethrough&&(n=this.theme.strikethrough(n)),this.defaultTextStyle.underline&&(n=this.theme.underline(n));let r=n.indexOf(e);return this.defaultStylePrefix=r>=0?n.slice(0,r):"",this.defaultStylePrefix}getStylePrefix(e){let r=e("\0"),i=r.indexOf("\0");return i>=0?r.slice(0,i):""}getDefaultInlineStyleContext(){return{applyText:e=>this.applyDefaultStyle(e),stylePrefix:this.getDefaultStylePrefix()}}renderToken(e,n,r,i){let s=[];switch(e.type){case"heading":{let o=e.depth,a=`${"#".repeat(o)} `,c;o===1?c=m=>this.theme.heading(this.theme.bold(this.theme.underline(m))):c=m=>this.theme.heading(this.theme.bold(m));let u={applyText:c,stylePrefix:this.getStylePrefix(c)},l=this.renderInlineTokens(e.tokens||[],u),d=o>=3?c(a)+l:l;s.push(d),r&&r!=="space"&&s.push("");break}case"paragraph":{let o=this.renderInlineTokens(e.tokens||[],i);s.push(o),r&&r!=="list"&&r!=="space"&&s.push("");break}case"text":s.push(this.renderInlineTokens([e],i));break;case"latexBlock":{let o=e,a=!o.pending&&this.options.renderLatex!==!1?Ore(o.text,{display:!0})??o.raw.trim():o.raw.trim();for(let c of a.split(` +`))s.push(this.applyDefaultStyle(c));r&&r!=="space"&&s.push("");break}case"code":{let o=this.theme.codeBlockIndent??" ";if(s.push(this.theme.codeBlockBorder(`\`\`\`${e.lang||""}`)),this.theme.highlightCode){let a=this.theme.highlightCode(e.text,e.lang);for(let c of a)s.push(`${o}${c}`)}else{let a=e.text.split(` +`);for(let c of a)s.push(`${o}${this.theme.codeBlock(c)}`)}s.push(this.theme.codeBlockBorder("```")),r&&r!=="space"&&s.push("");break}case"list":{let o=this.renderList(e,0,n,i);s.push(...o);break}case"table":{let o=this.renderTable(e,n,r,i);s.push(...o);break}case"blockquote":{let o=h=>this.theme.quote(this.theme.italic(h)),a=this.getStylePrefix(o),c=h=>{if(!a)return o(h);let f=h.replace(/\x1b\[0m/g,`\x1B[0m${a}`);return o(f)},u=Math.max(1,n-2),l={applyText:h=>h,stylePrefix:a},d=e.tokens||[],m=[];for(let h=0;h0&&m[m.length-1]==="";)m.pop();for(let h of m){let f=c(h),g=Ag(f,u);for(let A of g)s.push(this.theme.quoteBorder("\u2502 ")+A)}r&&r!=="space"&&s.push("");break}case"hr":s.push(this.theme.hr("\u2500".repeat(Math.min(n,80)))),r&&r!=="space"&&s.push("");break;case"html":"raw"in e&&typeof e.raw=="string"&&s.push(this.applyDefaultStyle(e.raw.trim()));break;case"space":s.push("");break;default:"text"in e&&typeof e.text=="string"&&s.push(e.text)}return s}renderInlineTokens(e,n){let r="",i=n??this.getDefaultInlineStyleContext(),{applyText:s,stylePrefix:o}=i,a=c=>c.split(` +`).map(l=>s(l)).join(` +`);for(let c of e)switch(c.type){case"latex":{let u=c,l=!u.pending&&this.options.renderLatex!==!1?Ore(u.text)??u.raw:u.raw;r+=a(l);break}case"escape":r+=a(this.options.preserveBackslashEscapes?c.raw:c.text);break;case"text":c.tokens&&c.tokens.length>0?r+=this.renderInlineTokens(c.tokens,i):r+=a(c.text);break;case"paragraph":r+=this.renderInlineTokens(c.tokens||[],i);break;case"strong":{let u=this.renderInlineTokens(c.tokens||[],i);r+=this.theme.bold(u)+o;break}case"em":{let u=this.renderInlineTokens(c.tokens||[],i);r+=this.theme.italic(u)+o;break}case"codespan":r+=this.theme.code(c.text)+o;break;case"link":{let u=this.renderInlineTokens(c.tokens||[],i),l=this.theme.link(this.theme.underline(u));if(Dl().hyperlinks)r+=gE(l,c.href)+o;else{let d=c.href.startsWith("mailto:")?c.href.slice(7):c.href;c.text===c.href||c.text===d?r+=l+o:r+=l+this.theme.linkUrl(` (${c.href})`)+o}break}case"br":r+=` +`;break;case"del":{let u=this.renderInlineTokens(c.tokens||[],i);r+=this.theme.strikethrough(u)+o;break}case"html":"raw"in c&&typeof c.raw=="string"&&(r+=a(c.raw));break;default:"text"in c&&typeof c.text=="string"&&(r+=a(c.text))}for(;o&&r.endsWith(o);)r=r.slice(0,-o.length);return r}getOrderedListMarker(e){let n=/^(?: {0,3})(\d{1,9}[.)])[ \t]+/.exec(e.raw);return n?`${n[1]} `:void 0}getUnorderedListMarker(e){let n=/^(?: {0,3})([-+*])(?:[ \t]+|(?=\r?\n|$))/.exec(e.raw);return n?`${n[1]} `:void 0}renderList(e,n,r,i){let s=[],o=" ".repeat(n),a=typeof e.start=="number"?e.start:1;for(let c=0;cs.length>0),i=0;for(let s of r)i=Math.max(i,rn(s));return n===void 0?i:Math.min(i,n)}wrapCellText(e,n,r=""){let i=Ag(e,Math.max(1,n));return i.map((s,o)=>{let a=oI+w,0);if(h>c){m=new Array(o).fill(1);let I=c-o;if(I>0){let w=d.reduce((W,$)=>W+Math.max(0,$-1),0),k=d.map(W=>{let $=Math.max(0,W-1);return w>0?Math.floor($/w*I):0});for(let W=0;WW+$,0),O=I-N;for(let W=0;O>0&&Ww+k,0)}let f=l.reduce((I,w)=>I+w,0)+a,g;if(f<=n)g=l.map((I,w)=>Math.max(I,m[w]));else{let I=l.reduce((O,W,$)=>O+Math.max(0,W-m[$]),0),w=Math.max(0,c-h);g=m.map((O,W)=>{let $=l[W],G=Math.max(0,$-O),q=0;return I>0&&(q=Math.floor(G/I*w)),O+q});let k=g.reduce((O,W)=>O+W,0),N=c-k;for(;N>0;){let O=!1;for(let W=0;W0;W++)g[W]"\u2500".repeat(I));s.push(`\u250C\u2500${A.join("\u2500\u252C\u2500")}\u2500\u2510`);let y=e.header.map((I,w)=>{let k=this.renderInlineTokens(I.tokens||[],i);return this.wrapCellText(k,g[w],i?.stylePrefix)}),E=Math.max(...y.map(I=>I.length));for(let I=0;I{let O=k[I]||"",W=O+" ".repeat(Math.max(0,g[N]-rn(O)));return this.theme.bold(W)});s.push(`\u2502 ${w.join(" \u2502 ")} \u2502`)}let S=`\u251C\u2500${g.map(I=>"\u2500".repeat(I)).join("\u2500\u253C\u2500")}\u2500\u2524`;s.push(S);for(let I=0;I{let $=this.renderInlineTokens(O.tokens||[],i);return this.wrapCellText($,g[W],i?.stylePrefix)}),N=Math.max(...k.map(O=>O.length));for(let O=0;O{let q=$[O]||"";return q+" ".repeat(Math.max(0,g[G]-rn(q)))});s.push(`\u2502 ${W.join(" \u2502 ")} \u2502`)}I"\u2500".repeat(I));return s.push(`\u2514\u2500${C.join("\u2500\u2534\u2500")}\u2500\u2518`),r&&r!=="space"&&s.push(""),s}}});var vA,V1n=v(()=>{p();_b();vA=class{child;onMouse;constructor(e,n){this.child=e,this.onMouse=n}render(e){return this.child.render(e)}handleMouse(e){return kR(this.child,e)??this.onMouse(e)}invalidate(){this.child.invalidate()}}});var TD,qot=v(()=>{p();Nre();_b();TD=class extends gn{child;followEnd;primary;overscroll;scrollbarTrackStyle;scrollbarThumbStyle;currentScrollbar;scrollbarHideDelayMs;currentScrollTop=0;contentHeight=0;currentViewportHeight=0;followingEnd;followSuppressedAtEnd=!1;requestRenderCallback;transientScrollbarVisible=!1;scrollbarActive=!1;scrollbarHideTimer;constructor(e,n={}){if(super(),n.axis!==void 0&&n.axis!=="vertical")throw new Error(`Unsupported ScrollView axis: ${n.axis}`);this.child=e,this.children.push(e),this.followEnd=(n.follow??"none")==="end",this.followingEnd=this.followEnd,this.primary=n.primary??!1,this.overscroll=n.overscroll??"chain",this.currentScrollbar=n.scrollbar??"hidden",this.scrollbarTrackStyle=n.scrollbarTrackStyle??(r=>`\x1B[90m${r}\x1B[39m`),this.scrollbarThumbStyle=n.scrollbarThumbStyle??(r=>`\x1B[37m${r}\x1B[39m`),this.scrollbarHideDelayMs=Math.max(0,Math.floor(n.scrollbarHideDelayMs??1e3))}get scrollTop(){return this.currentScrollTop}get isFollowingEnd(){return this.followingEnd}get viewportHeight(){return this.currentViewportHeight}get scrollbar(){return this.currentScrollbar}get isScrollbarVisible(){return this.scrollbar==="always"?this.currentViewportHeight>0:this.scrollbar==="auto"&&this.contentHeight>this.currentViewportHeight&&this.transientScrollbarVisible}get isScrollbarActive(){return this.scrollbarActive}setScrollbar(e){e!==this.currentScrollbar&&(this.currentScrollbar=e,e!=="auto"?this.hideTransientScrollbar():this.scrollbarActive&&this.markScrollbarActivity(),this.requestRenderCallback?.())}getContentWidth(e){return this.scrollbar==="always"&&e>1?e-1:e}markScrollbarActivity(){this.scrollbar!=="auto"||this.contentHeight<=this.currentViewportHeight||(this.transientScrollbarVisible=!0,this.scrollbarHideTimer&&(clearTimeout(this.scrollbarHideTimer),this.scrollbarHideTimer=void 0),!this.scrollbarActive&&(this.scrollbarHideTimer=setTimeout(()=>{this.scrollbarHideTimer=void 0,this.transientScrollbarVisible=!1,this.requestRenderCallback?.()},this.scrollbarHideDelayMs),this.scrollbarHideTimer.unref()))}hideTransientScrollbar(){this.transientScrollbarVisible=!1,this.scrollbarHideTimer&&(clearTimeout(this.scrollbarHideTimer),this.scrollbarHideTimer=void 0)}setScrollbarActive(e){e!==this.scrollbarActive&&(this.scrollbarActive=e,this.markScrollbarActivity(),this.requestRenderCallback?.())}scrollTo(e,n={}){let r=Number.isFinite(e)?Math.trunc(e):this.currentScrollTop,i=Math.max(0,this.contentHeight-this.currentViewportHeight),s=Math.max(0,Math.min(i,r)),o=n.disableFollow===!0&&s===i,a=!o&&this.followEnd&&s===i;if(s===this.currentScrollTop&&a===this.followingEnd&&o===this.followSuppressedAtEnd)return;let c=s!==this.currentScrollTop;this.currentScrollTop=s,this.followingEnd=a,this.followSuppressedAtEnd=o,c&&this.markScrollbarActivity(),this.requestRenderCallback?.()}scrollBy(e){let n=Number.isFinite(e)?Math.trunc(e):0;if(n===0)return 0;let r=Math.max(0,this.contentHeight-this.currentViewportHeight),i=this.followingEnd?r:this.currentScrollTop,s=Math.max(0,Math.min(r,i+n)),o=s-i,a=this.followingEnd;return this.currentScrollTop=s,this.followingEnd=this.followEnd&&s===r,this.followSuppressedAtEnd=!1,o!==0&&this.markScrollbarActivity(),(o!==0||this.followingEnd!==a)&&this.requestRenderCallback?.(),n-o}scrollToStart(){let e=this.currentScrollTop!==0||this.followingEnd!==(this.followEnd&&this.contentHeight<=this.currentViewportHeight);this.currentScrollTop=0,this.followingEnd=this.followEnd&&this.contentHeight<=this.currentViewportHeight,this.followSuppressedAtEnd=!1,e&&(this.markScrollbarActivity(),this.requestRenderCallback?.())}scrollToEnd(){let e=Math.max(0,this.contentHeight-this.currentViewportHeight),n=this.currentScrollTop!==e||this.followingEnd!==this.followEnd;this.currentScrollTop=e,this.followingEnd=this.followEnd,this.followSuppressedAtEnd=!1,n&&(this.markScrollbarActivity(),this.requestRenderCallback?.())}updateLayout(e,n,r){this.contentHeight=Math.max(0,Math.floor(e)),this.currentViewportHeight=Math.max(0,Math.floor(n)),this.requestRenderCallback=r;let i=Math.max(0,this.contentHeight-this.currentViewportHeight);this.followingEnd?this.currentScrollTop=i:this.currentScrollTop=Math.max(0,Math.min(this.currentScrollTop,i)),this.currentScrollTop`${i} `)}[oj](){return{type:"scroll",component:this.child,state:this}}}});var vD,Y1n=v(()=>{p();Wwe();NR();ld();dTe();vD=class{items;filteredItems;theme;selectedIndex=0;mousePressedIndex;maxVisible;onChange;onCancel;searchInput;searchEnabled;submenuComponent=null;submenuItemIndex=null;navigateAfterClose=null;constructor(e,n,r,i,s,o={}){this.items=e,this.filteredItems=e,this.maxVisible=n,this.theme=r,this.onChange=i,this.onCancel=s,this.searchEnabled=o.enableSearch??!1,this.searchEnabled&&(this.searchInput=new ma)}updateValue(e,n){let r=this.items.find(i=>i.id===e);r&&(r.currentValue=n)}selectItem(e){let r=(this.searchEnabled?this.filteredItems:this.items).findIndex(i=>i.id===e);r!==-1&&(this.selectedIndex=r)}invalidate(){this.submenuComponent?.invalidate?.()}render(e){return this.submenuComponent?this.submenuComponent.render(e):this.renderMainList(e)}renderMainList(e){let n=[];if(this.searchEnabled&&this.searchInput&&(n.push(...this.searchInput.render(e)),n.push("")),this.items.length===0)return n.push(this.theme.hint(" No settings available")),this.searchEnabled&&this.addHintLine(n,e),n;let r=this.getDisplayItems();if(r.length===0)return n.push(dr(this.theme.hint(" No matching settings"),e)),this.addHintLine(n,e),n;let{startIndex:i,endIndex:s}=this.getVisibleRange(r),o=Math.min(36,Math.max(...this.items.map(c=>rn(c.label))));for(let c=i;c0||s=s)){if(e.type==="press")return this.mousePressedIndex=o,this.selectedIndex=o,{handled:!0,focus:!0};if(e.type==="click")return this.selectedIndex=this.mousePressedIndex??o,this.mousePressedIndex=void 0,this.activateItem(),{handled:!0}}}handleInput(e){if(this.submenuComponent){this.submenuComponent.handleInput?.(e);return}let n=Ai(),r=this.getDisplayItems();if(n.matches(e,"tui.select.up")){if(r.length===0)return;this.selectedIndex=this.selectedIndex===0?r.length-1:this.selectedIndex-1}else if(n.matches(e,"tui.select.down")){if(r.length===0)return;this.selectedIndex=this.selectedIndex===r.length-1?0:this.selectedIndex+1}else n.matches(e,"tui.select.confirm")||e===" "&&(!this.searchEnabled||this.searchInput?.getValue().length===0)?this.activateItem():n.matches(e,"tui.select.cancel")?this.onCancel():this.searchEnabled&&this.searchInput&&(this.searchInput.handleInput(e),this.applyFilter(this.searchInput.getValue()))}getDisplayItems(){return this.searchEnabled?this.filteredItems:this.items}getVisibleRange(e){let n=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),e.length-this.maxVisible));return{startIndex:n,endIndex:Math.min(n+this.maxVisible,e.length)}}activateItem(){let e=this.getDisplayItems()[this.selectedIndex];if(e){if(e.submenu)this.submenuItemIndex=this.selectedIndex,this.submenuComponent=e.submenu(e.currentValue,(n,r)=>{n!==void 0&&(e.currentValue=n,this.onChange(e.id,n)),r?.navigateTo&&(this.navigateAfterClose=r.navigateTo),this.closeSubmenu()});else if(e.values&&e.values.length>0){let r=(e.values.indexOf(e.currentValue)+1)%e.values.length,i=e.values[r];e.currentValue=i,this.onChange(e.id,i)}}}closeSubmenu(){if(this.submenuComponent=null,this.navigateAfterClose!==null){let e=this.navigateAfterClose;this.navigateAfterClose=null,this.submenuItemIndex=null,this.selectItem(e),this.activateItem()}else this.submenuItemIndex!==null&&(this.selectedIndex=this.submenuItemIndex,this.submenuItemIndex=null)}applyFilter(e){this.filteredItems=Pu(this.items,e,n=>n.label),this.selectedIndex=0}addHintLine(e,n){e.push(""),e.push(dr(this.theme.hint(this.searchEnabled?" Type to search \xB7 Enter/Space to change \xB7 Esc to cancel":" Enter/Space to change \xB7 Esc to cancel"),n))}}});var Tt,z1n=v(()=>{p();Tt=class{lines;constructor(e=1){this.lines=e}setLines(e){this.lines=e}invalidate(){}render(e){let n=[];for(let r=0;r{p();ld();yE=class{text;paddingX;paddingY;constructor(e,n=0,r=0){this.text=e,this.paddingX=n,this.paddingY=r}invalidate(){}render(e){let n=[],r=" ".repeat(e);for(let f=0;f{p();lTe();XF=class extends aj{layoutType="vstack";constructor(e=[],n={}){super(e,n)}render(e){let n={width:Math.max(1,e),height:Number.MAX_SAFE_INTEGER},r=cj(this.entries,n),i=r.map(a=>a.component.render(n.width)),s=VF(r,i.map(a=>a.length),void 0,this.gap),o=[];for(let a=0;a0)for(let u=0;u{p();X1n=require("node:module"),PR=require("node:path"),Z1n=require("node:url"),nDi=(0,X1n.createRequire)(x),rDi="@earendil-works/pi-tui"});function iBn(t,e=""){let n=process.arch;if(n!=="x64"&&n!=="arm64")return;let r=rBn.join("native",t,"prebuilds",`${t}-${n}`,`${t}-platform${e}.node`);if(hTe.has(r))return hTe.get(r);for(let i of eBn(r))try{let s=iDi(i);if(typeof s?.getText=="function"&&typeof s.getImage=="function")return hTe.set(r,s),s}catch{}hTe.set(r,void 0)}function Lre(){if(!(process.platform!=="darwin"&&process.platform!=="win32"))return iBn(process.platform)}function ZF(){if(process.platform!=="linux")return Lre();if(process.env.DISPLAY)return iBn("linux","-x11")}var nBn,rBn,iDi,hTe,fTe=v(()=>{p();nBn=require("node:module"),rBn=Ot(require("node:path"),1);tBn();iDi=(0,nBn.createRequire)(x),hTe=new Map});function aDi(t){if(!t.startsWith(cS))return"not-escape";if(t.length===1)return"incomplete";let e=t.slice(1);return e.startsWith("[")?e.startsWith("[M")?t.length>=6?"complete":"incomplete":cDi(t):e.startsWith("]")?lDi(t):e.startsWith("P")?uDi(t):e.startsWith("_")?dDi(t):e.startsWith("O")?e.length>=2?"complete":"incomplete":(e.length===1,"complete")}function cDi(t){if(!t.startsWith(`${cS}[`))return"complete";if(t.length<3)return"incomplete";let e=t.slice(2),n=e[e.length-1],r=n.charCodeAt(0);if(r>=64&&r<=126){if(e.startsWith("<")){if(/^<\d+;\d+;\d+[Mm]$/.test(e))return"complete";if(n==="M"||n==="m"){let s=e.slice(1,-1).split(";");if(s.length===3&&s.every(o=>/^\d+$/.test(o)))return"complete"}return"incomplete"}return"complete"}return"incomplete"}function lDi(t){return!t.startsWith(`${cS}]`)||t.endsWith(`${cS}\\`)||t.endsWith("\x07")?"complete":"incomplete"}function uDi(t){return!t.startsWith(`${cS}P`)||t.endsWith(`${cS}\\`)?"complete":"incomplete"}function dDi(t){return!t.startsWith(`${cS}_`)||t.endsWith(`${cS}\\`)?"complete":"incomplete"}function pDi(t){let e=t.match(/^\x1b\[(\d+)(?::\d*)?(?::\d+)?u$/);if(!e)return;let n=parseInt(e[1],10);return n>=32?n:void 0}function oBn(t){let e=[],n=0;for(;nr.length)return{sequences:e,remainder:r}}else e.push(r[0]),n++}return{sequences:e,remainder:""}}var aBn,cS,sDi,oDi,sBn,gTe,uj,jot=v(()=>{p();aBn=require("events"),cS="\x1B",sDi=50,oDi=10,sBn="\x1B[200~",gTe="\x1B[201~";uj=class extends aBn.EventEmitter{buffer="";timeout=null;timeoutMs;escapeTimeoutMs;pasteMode=!1;pasteBuffer="";pendingKittyPrintableCodepoint;constructor(e={}){super(),this.timeoutMs=e.timeout??sDi,this.escapeTimeoutMs=e.escapeTimeout??oDi}process(e){this.timeout&&(clearTimeout(this.timeout),this.timeout=null);let n;if(Buffer.isBuffer(e))if(e.length===1&&e[0]>127){let s=e[0]-128;n=`\x1B${String.fromCharCode(s)}`}else n=e.toString();else n=e;if(n.length===0&&this.buffer.length===0){this.emitDataSequence("");return}if(this.buffer+=n,this.pasteMode){this.pasteBuffer+=this.buffer,this.buffer="";let s=this.pasteBuffer.indexOf(gTe);if(s!==-1){let o=this.pasteBuffer.slice(0,s),a=this.pasteBuffer.slice(s+gTe.length);this.pasteMode=!1,this.pasteBuffer="",this.pendingKittyPrintableCodepoint=void 0,this.emit("paste",o),a.length>0&&this.process(a)}return}let r=this.buffer.indexOf(sBn);if(r!==-1){if(r>0){let o=this.buffer.slice(0,r),a=oBn(o);for(let c of a.sequences)this.emitDataSequence(c)}this.pendingKittyPrintableCodepoint=void 0,this.buffer=this.buffer.slice(r+sBn.length),this.pasteMode=!0,this.pasteBuffer=this.buffer,this.buffer="";let s=this.pasteBuffer.indexOf(gTe);if(s!==-1){let o=this.pasteBuffer.slice(0,s),a=this.pasteBuffer.slice(s+gTe.length);this.pasteMode=!1,this.pasteBuffer="",this.pendingKittyPrintableCodepoint=void 0,this.emit("paste",o),a.length>0&&this.process(a)}return}let i=oBn(this.buffer);this.buffer=i.remainder;for(let s of i.sequences)this.emitDataSequence(s);if(this.buffer.length>0){let s=this.buffer===cS?this.escapeTimeoutMs:this.timeoutMs;this.timeout=setTimeout(()=>{let o=this.flush();for(let a of o)this.emitDataSequence(a)},s)}}emitDataSequence(e){let n=e.length===1?e.codePointAt(0):void 0;if(n!==void 0&&n===this.pendingKittyPrintableCodepoint){this.pendingKittyPrintableCodepoint=void 0;return}this.pendingKittyPrintableCodepoint=pDi(e),this.emit("data",e)}flush(){if(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.buffer.length===0)return[];let e=[this.buffer];return this.buffer="",this.pendingKittyPrintableCodepoint=void 0,e}clear(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.buffer="",this.pasteMode=!1,this.pasteBuffer="",this.pendingKittyPrintableCodepoint=void 0}getBuffer(){return this.buffer}destroy(){this.clear()}}});function cBn(t){let e=Lre();if(!e?.isModifierPressed)return!1;try{return e.isModifierPressed(t)===!0}catch{return!1}}var lBn=v(()=>{p();fTe()});function pBn(t){let e=t.match(/^\x1b\[\?(\d+)u$/);if(e)return{type:"kitty-flags",flags:Number.parseInt(e[1],10)};if(/^\x1b\[\?[\d;]*c$/.test(t))return{type:"device-attributes"}}function mBn(t){return t==="\x1B["||/^\x1b\[\?[\d;]*$/.test(t)}function yDi(){return process.platform==="darwin"&&process.env.TERM_PROGRAM==="Apple_Terminal"}function EDi(){if(!(process.platform==="win32"||process.pid<=0))try{process.kill(process.pid,"SIGWINCH")}catch{}}function bDi(t,e,n){return e&&t==="\r"&&n?hDi:t}function SDi(t=process.env){let e=Number(t.PI_TUI_ESC_TIMEOUT);return Number.isFinite(e)&&e>0?e:t.SSH_CONNECTION||t.SSH_TTY?xDi:_Di}var ATe,hBn,mDi,uBn,dBn,hDi,fDi,gDi,ADi,_Di,xDi,cw,fBn=v(()=>{p();ATe=Ot(require("node:fs"),1),hBn=Ot(require("node:path"),1);xD();lBn();fTe();jot();mDi=1e3,uBn="\x1B]9;4;3\x07",dBn="\x1B]9;4;0\x07",hDi="\x1B[13;2u",fDi=7,gDi=150,ADi=`\x1B[>${fDi}u\x1B[?u\x1B[c`;_Di=10,xDi=100;cw=class{wasRaw=!1;inputHandler;resizeHandler;_kittyProtocolActive=!1;_modifyOtherKeysActive=!1;keyboardProtocolPushed=!1;keyboardProtocolNegotiationBuffer="";keyboardProtocolBufferFlushTimer;stdinBuffer;stdinDataHandler;progressInterval;writeLogPath=(()=>{let e=process.env.PI_TUI_WRITE_LOG||"";if(!e)return"";try{if(ATe.statSync(e).isDirectory()){let n=new Date,r=`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}_${String(n.getHours()).padStart(2,"0")}-${String(n.getMinutes()).padStart(2,"0")}-${String(n.getSeconds()).padStart(2,"0")}`;return hBn.join(e,`tui-${r}-${process.pid}.log`)}}catch{}return e})();get kittyProtocolActive(){return this._kittyProtocolActive}get modifyOtherKeysActive(){return this._modifyOtherKeysActive}start(e,n){this.inputHandler=e,this.resizeHandler=n,this.wasRaw=process.stdin.isRaw||!1,process.stdin.setRawMode&&process.stdin.setRawMode(!0),process.stdin.setEncoding("utf8"),process.stdin.resume(),process.stdout.write("\x1B[?2004h"),process.stdout.on("resize",this.resizeHandler),EDi(),this.enableWindowsVTInput(),this.queryAndEnableKittyProtocol()}setupStdinBuffer(){this.stdinBuffer=new uj({escapeTimeout:SDi()}),this.stdinBuffer.on("data",e=>{let n=this.readKeyboardProtocolNegotiationSequence(e);if(n==="pending"){this.scheduleKeyboardProtocolNegotiationBufferFlush();return}this.handleKeyboardProtocolNegotiationSequence(n)||this.forwardInputSequence(e)}),this.stdinBuffer.on("paste",e=>{this.inputHandler&&this.inputHandler(`\x1B[200~${e}\x1B[201~`)}),this.stdinDataHandler=e=>{this.stdinBuffer.process(e)}}queryAndEnableKittyProtocol(){this.setupStdinBuffer(),process.stdin.on("data",this.stdinDataHandler),this.keyboardProtocolPushed=!0,this.clearKeyboardProtocolNegotiationBuffer(),process.stdout.write(ADi)}handleKeyboardProtocolNegotiationSequence(e){return e?(this.clearKeyboardProtocolNegotiationBuffer(),e.type==="kitty-flags"?(e.flags!==0?(this.disableModifyOtherKeys(),this._kittyProtocolActive||(this._kittyProtocolActive=!0,j8(!0))):this.enableModifyOtherKeys(),!0):(this._kittyProtocolActive||this.enableModifyOtherKeys(),!0)):!1}readKeyboardProtocolNegotiationSequence(e){if(this.keyboardProtocolNegotiationBuffer){let r=this.keyboardProtocolNegotiationBuffer+e,i=pBn(r);if(i)return this.clearKeyboardProtocolNegotiationBuffer(),i;if(mBn(r))return this.setKeyboardProtocolNegotiationBuffer(r),"pending";this.flushKeyboardProtocolNegotiationBufferAsInput()}let n=pBn(e);if(n)return n;if(mBn(e))return this.setKeyboardProtocolNegotiationBuffer(e),"pending"}setKeyboardProtocolNegotiationBuffer(e){this.clearKeyboardProtocolNegotiationBufferFlushTimer(),this.keyboardProtocolNegotiationBuffer=e}clearKeyboardProtocolNegotiationBuffer(){this.clearKeyboardProtocolNegotiationBufferFlushTimer(),this.keyboardProtocolNegotiationBuffer=""}flushKeyboardProtocolNegotiationBufferAsInput(){if(!this.keyboardProtocolNegotiationBuffer)return;let e=this.keyboardProtocolNegotiationBuffer;this.clearKeyboardProtocolNegotiationBuffer(),this.forwardInputSequence(e)}scheduleKeyboardProtocolNegotiationBufferFlush(){!this.keyboardProtocolNegotiationBuffer||this.keyboardProtocolBufferFlushTimer||(this.keyboardProtocolBufferFlushTimer=setTimeout(()=>{this.keyboardProtocolBufferFlushTimer=void 0,this.flushKeyboardProtocolNegotiationBufferAsInput()},gDi))}clearKeyboardProtocolNegotiationBufferFlushTimer(){this.keyboardProtocolBufferFlushTimer&&(clearTimeout(this.keyboardProtocolBufferFlushTimer),this.keyboardProtocolBufferFlushTimer=void 0)}forwardInputSequence(e){if(!this.inputHandler)return;let n=e==="\r"&&(yDi()||process.platform==="win32"),r=bDi(e,n,n&&cBn("shift"));this.inputHandler(r)}enableModifyOtherKeys(){this._kittyProtocolActive||this._modifyOtherKeysActive||(process.stdout.write("\x1B[>4;2m"),this._modifyOtherKeysActive=!0)}disableModifyOtherKeys(){this._modifyOtherKeysActive&&(process.stdout.write("\x1B[>4;0m"),this._modifyOtherKeysActive=!1)}enableWindowsVTInput(){if(process.platform==="win32")try{Lre()?.enableVirtualTerminalInput?.()}catch{}}async drainInput(e=1e3,n=50){let r=this.keyboardProtocolPushed||this._kittyProtocolActive;this.clearKeyboardProtocolNegotiationBuffer(),r&&(process.stdout.write("\x1B[{s=Date.now()};process.stdin.on("data",o);let a=Date.now()+e;try{for(;;){let c=Date.now(),u=a-c;if(u<=0||c-s>=n)break;await new Promise(l=>setTimeout(l,Math.min(n,u)))}}finally{process.stdin.removeListener("data",o),this.inputHandler=i}}stop(){this.clearProgressInterval()&&process.stdout.write(dBn),process.stdout.write("\x1B[?2004l");let e=this.keyboardProtocolPushed||this._kittyProtocolActive;this.clearKeyboardProtocolNegotiationBuffer(),e&&(process.stdout.write("\x1B[0?process.stdout.write(`\x1B[${e}B`):e<0&&process.stdout.write(`\x1B[${-e}A`)}hideCursor(){process.stdout.write("\x1B[?25l")}showCursor(){process.stdout.write("\x1B[?25h")}clearLine(){process.stdout.write("\x1B[K")}clearFromCursor(){process.stdout.write("\x1B[J")}clearScreen(){process.stdout.write("\x1B[2J\x1B[H")}setTitle(e){process.stdout.write(`\x1B]0;${e}\x07`)}setProgress(e){e?(process.stdout.write(uBn),this.progressInterval||(this.progressInterval=setInterval(()=>{process.stdout.write(uBn)},mDi))):(this.clearProgressInterval(),process.stdout.write(dBn))}clearProgressInterval(){return this.progressInterval?(clearInterval(this.progressInterval),this.progressInterval=void 0,!0):!1}}});function wDi(t){let e=[],n=[],r=0,i=!1,s=()=>{i&&(e.push(" "),r+=1,i=!1)};for(let o=0;o0&&(i=!0),c+=1,u+=1;continue}let l=u+1;for(;l0&&(i=!0),c+=d;continue}s(),e.push(l),n.push({textStart:r,textEnd:r+l.length,row:o,startCol:c,endCol:c+d,linearColumns:!1}),r+=l.length,c+=d}r>0&&(i=!0)}return{text:e.join(""),spans:n}}function TDi(t){return t.replace(/\s+/gu," ").trim()}function vDi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function RDi(t,e){if(!e)return[];let n=new RegExp(vDi(e),"giu"),r=[],i=0;for(let s of t.text.matchAll(n)){let o=s.index,a=o+s[0].length;for(;i=a)break;if(l.textEnd<=o)continue;let d=l.linearColumns?l.startCol+Math.max(o,l.textStart)-l.textStart:l.startCol,m=l.linearColumns?l.startCol+Math.min(a,l.textEnd)-l.textStart:l.endCol,h=c[c.length-1];h&&h.row===l.row&&d<=h.endCol?h.endCol=Math.max(h.endCol,m):c.push({row:l.row,startCol:d,endCol:m})}for(;i0&&r.push({segments:c})}return r}function Vot(t){let e=t.segments[0],n=t.segments[t.segments.length-1];return e&&n?`${e.row}:${e.startCol}:${n.row}:${n.endCol}`:""}var CDi,IDi,yTe,ETe,gBn=v(()=>{p();dTe();NR();ld();CDi=Q8(),IDi=/^[\x20-\x7e]*$/;yTe=class{sourceLines;corpus;normalizedQuery;matches=[];search(e,n){let r=this.sourceLines?.length!==e.length;if(!r&&this.sourceLines){for(let o=0;o`\x1B[2m${e}\x1B[22m`});onQueryChange;navigationButtonStyle;resultCount=0;resultIndex=-1;previousButtonStart=-1;previousButtonEnd=-1;nextButtonStart=-1;nextButtonEnd=-1;hoveredNavigationDirection;_focused=!1;constructor(e,n=r=>r){this.onQueryChange=e,this.navigationButtonStyle=n}get focused(){return this._focused}set focused(e){this._focused=e,this.input.focused=e}setResult(e,n){this.resultIndex=e,this.resultCount=n}getNavigationDirectionAt(e,n){if(e===2){if(n>=this.previousButtonStart&&n=this.nextButtonStart&&nG?G.split("+").map(q=>process.platform==="darwin"&&q.toLowerCase()==="alt"?"Option":q.charAt(0).toUpperCase()+q.slice(1)).join("+"):"Unbound",s=Ai(),o=i(s.getKeys("tui.altScreen.searchPrevious")[0]),a=i(s.getKeys("tui.altScreen.searchNext")[0]),u=this.input.getValue()?this.resultCount===0?"No matches":`${this.resultIndex+1}/${this.resultCount}`:"",l=Math.max(0,r-3),d=dr(u,l,""),m=d?`\x1B[2m ${d} \x1B[22m`:"",h=Math.max(0,r-rn(m)),f=dr(this.input.render(Math.max(1,h))[0]??"",h,""),g=" ".repeat(Math.max(0,h-rn(f))),A=`${f}${g}${m}`,y=`\u2191 ${o}`,E=`\u2193 ${a}`,_=" \xB7 ",S=1,C=Math.max(0,r-S*2-1),I=rn(y)+rn(_)+rn(E);I>C&&(y="\u2191",E="\u2193",_=" ",I=rn(y)+rn(_)+rn(E));let w=I<=C,k=w?this.navigationButtonStyle(y,this.hoveredNavigationDirection===-1)+_+this.navigationButtonStyle(E,this.hoveredNavigationDirection===1):"",N=w?S*2:0,O=k&&r>I+N?1:0,W=Math.max(0,r-(w?I:0)-N-O),$=1+W+S;return this.previousButtonStart=w?$:-1,this.previousButtonEnd=w?$+rn(y):-1,this.nextButtonStart=w?this.previousButtonEnd+rn(_):-1,this.nextButtonEnd=w?this.nextButtonStart+rn(E):-1,n===1?["\u250C","\u2502","\u2514"]:[`\u250C${"\u2500".repeat(r)}\u2510`,`\u2502${A}\u2502`,`\u2514${"\u2500".repeat(W)}${k?" ":""}${k}${k?" ":""}${"\u2500".repeat(O)}\u2518`]}}});var kDi,bTe,ABn=v(()=>{p();ld();kDi=1e3,bTe=class{entries=[];nextId=0;requestRender;constructor(e){this.requestRender=e}flash(e,n=kDi){let r=this.nextId++,i=setTimeout(()=>{let s=this.entries.findIndex(o=>o.id===r);s!==-1&&(this.entries.splice(s,1),this.requestRender())},Math.max(0,n));i.unref(),this.entries.push({id:r,message:e,timer:i}),this.requestRender()}dispose(){for(let e of this.entries)clearTimeout(e.timer);this.entries.length=0}invalidate(){}render(e){return this.entries.map(n=>`\x1B[7m${dr(` ${n.message} `,e,"")}\x1B[27m`)}}});function Fre(t,e){let n=Math.max(t.x,e.x),r=Math.max(t.y,e.y),i=Math.min(t.x+t.width,e.x+e.width),s=Math.min(t.y+t.height,e.y+e.height);return{x:n,y:r,width:Math.max(0,i-n),height:Math.max(0,s-r)}}function xTe(t,e,n){let r=Math.max(1,Math.floor(n)),i=t.renderCache.get(e);i||(i=new Map,t.renderCache.set(e,i));let s=i.get(r);return s||(s=e.render(r),i.set(r,s)),s}function yBn(t,e,n){return xTe(t,e,n).length}function NDi(t,e,n){return xTe(t,e,n).reduce((r,i)=>Math.max(r,rn(i)),0)}function EBn(t,e){return t.parent=e,t}function bBn(t,e){t.rect.y+=e;for(let n of t.children)bBn(n,e)}function _Bn(t,e){t.clip=Fre(e,t.rect);for(let n of t.children)_Bn(n,t.clip)}function _Te(t,e,n,r,i,s,o){let a=Math.max(1,Math.floor(i)),c=cTe(e);if(!c){let E=xTe(t,e,a),_=s===void 0?E.length:Math.max(0,Math.floor(s)),S=0;if(E.length>_&&_>0){let C=E.findIndex(I=>I.includes(AE));C>=_&&(S=C-_+1)}return{component:e,rect:{x:n,y:r,width:a,height:_},clip:Fre(o,{x:n,y:r,width:a,height:_}),children:[],lines:E,lineOffset:S,layer:0}}if(c.type==="scroll"){let E=c.state.scrollTop,_=c.state.getContentWidth(a),S=_Te(t,c.component,n,r-E,_,void 0,o),C=S.rect.height,I=s===void 0?C:Math.max(0,Math.floor(s));c.state.updateLayout(C,I,t.requestRender),bBn(S,E-c.state.scrollTop);let w=c.state;(c.state.primary||!t.primaryScrollView)&&(t.primaryScrollView=w);let k={x:n,y:r,width:a,height:I},N=Fre(o,k),O={component:e,rect:k,clip:N,children:[S],scrollView:w,scrollContentLines:xTe(t,c.component,_),layer:0};return S.parent=O,_Bn(S,N),O}let u=cj(c.entries,t.viewport),l=Math.max(0,u.length-1)*c.gap;if(c.type==="vstack"){let E=u.map(N=>typeof N.basis=="number"?N.basis:yBn(t,N.component,a)),_=VF(u,E,s,c.gap),S=_.reduce((N,O)=>N+O,0)+l,C=s===void 0?S:Math.max(0,Math.floor(s)),I={x:n,y:r,width:a,height:C},w={component:e,rect:I,clip:Fre(o,I),children:[],layer:0},k=r;for(let N=0;Ntypeof E.basis=="number"?E.basis:NDi(t,E.component,a)),m=VF(u,d,a,c.gap),h=u.map((E,_)=>yBn(t,E.component,Math.max(1,m[_]))),f=s===void 0?h.reduce((E,_)=>Math.max(E,_),0):Math.max(0,s),g={x:n,y:r,width:a,height:f},A={component:e,rect:g,clip:Fre(o,g),children:[],layer:0},y=n;for(let E=0;Er;if(!t.scrollView.isScrollbarVisible&&!i)return;let s=Math.min(2,r),o=Math.max(s,Math.min(r,Math.round(r*r/n))),a=Math.max(0,n-r),c=r-o,u=a===0?0:Math.round(t.scrollView.scrollTop/a*c),l=t.rect.x+t.rect.width-1;if(!(l=t.clip.x+t.clip.width))return{column:l,trackTop:t.rect.y,trackHeight:r,thumbTop:t.rect.y+u,thumbHeight:o,maxScrollTop:a}}function PDi(t,e,n){let r=dj(t);if(!(!r||!t.scrollView))for(let i=0;i=t.clip.y+t.clip.height||s<0||s>=e.length)continue;let a=s>=r.thumbTop&&s=n&&(tu(c)||!e[o])?e[o]=c:e[o]=aw(e[o]??"",c,t.rect.x,t.rect.width,n)}}for(let r of t.children)xBn(r,e,n);if(t.scrollView&&t.scrollContentLines&&t.scrollView.scrollTop>0&&t.rect.height>0)for(let r=t.scrollView.scrollTop-1;r>=0;r--){let i=t.scrollContentLines[r]??"",s=nTe(i);if(s){let o=t.scrollView.scrollTop-r;if(o=n&&(e[t.rect.y]=c)}break}if(i!=="")break}PDi(t,e,n)}function zot(t,e,n,r){let i=Math.max(1,Math.floor(e)),s=Math.max(1,Math.floor(n)),o={viewport:{width:i,height:s},renderCache:new Map,requestRender:r,primaryScrollView:void 0},a=_Te(o,t,0,0,i,s,{x:0,y:0,width:i,height:s}),c=Array.from({length:s},()=>"");return xBn(a,c,i),{root:a,width:i,height:s,lines:c,...o.primaryScrollView===void 0?{}:{primaryScrollView:o.primaryScrollView}}}function Yot(t,e,n){return e>=t.x&&e=t.y&&n{if(Yot(s.clip,e,n)){r.push({box:s,depth:o});for(let a of s.children)i(a,o+1)}};return i(t.root,0),r.sort((s,o)=>o.box.layer-s.box.layer||o.depth-s.depth),r.map(({box:s})=>s)}function Sb(t,e){let n=r=>{if(r.scrollView===e)return r;for(let i of r.children){let s=n(i);if(s)return s}};return n(t.root)}function STe(t,e,n){let r=[],i=(s,o)=>{if(Yot(s.clip,e,n)){s.scrollView&&Yot(s.rect,e,n)&&r.push({scrollView:s.scrollView,depth:o});for(let a of s.children)i(a,o+1)}};return i(t.root,0),r.sort((s,o)=>o.depth-s.depth),r.map(s=>s.scrollView)}var BDi,CBn=v(()=>{p();lTe();Nre();SD();_b();ld();BDi=/^(?:\x1b\]133;[ABC](?:\x07|\x1b\\))+/});var MDi,IBn,wBn,TBn,ODi,LDi,FDi,QDi,UDi,CTe,ITe,vBn,GDi,RBn,$Di,WDi,HDi,qDi,kBn,jDi,VDi,YDi,lS,BBn=v(()=>{p();gBn();ABn();qot();NR();xD();CBn();Nre();SD();_b();ld();MDi="\x1B[?1049h",IBn="\x1B[?1049l",wBn="\x1B[?7l",TBn="\x1B[?7h",ODi="\x1B[?1000h\x1B[?1002h\x1B[?1004h\x1B[?1006h",LDi="\x1B[?1000h\x1B[?1002h\x1B[?1003h\x1B[?1004h\x1B[?1006h",FDi="\x1B[?1006l\x1B[?1004l\x1B[?1003l\x1B[?1002l\x1B[?1000l",QDi="\x1B[I",UDi="\x1B[O",CTe="\x1B[?2026h",ITe="\x1B[?2026l",vBn=/^(?:\x1b\]133;[ABC](?:\x07|\x1b\\))+/,GDi=/^\x1b\]133;A(?:\x07|\x1b\\)/,RBn=4,$Di=5,WDi=16,HDi=32*1024*1024,qDi=64*1024*1024,kBn=500,jDi=5e3,VDi=new Set(["/","-"]),YDi=U8(),lS=class extends tj{mode="fullscreen";[Rot]=!0;previousScreen=[];lastDocument=[];previousScreenWidth=0;previousScreenHeight=0;layoutRoot;currentLayout;implicitDocument;implicitScrollView;flashes;altScreenActive=!1;imageProtocol=null;savedCapabilities;uploadedKittyImages=new Map;selectionAnchor;selectionFocus;selectionGranularity="character";selectionInitialRange;lastClick;selectionDragPointer;selectionAutoScrollDirection=0;selectionAutoScrollTimer;selectionPressActive=!1;scrollbarDrag;scrollbarHover;scrollToEndIndicatorRect;activeSearch;pressedUrl;selectionDragged=!1;mouseCapture;mousePressTarget;mousePressPoint;mousePressMoved=!1;lastComponentClick;wheelScrollLines;mouseEnabled;searchMatchStyle;searchCurrentMatchStyle;searchNavigationButtonStyle;scrollToEndIndicator;openUrl;onRightClickPaste;copyOnSelect;copySelection;constructor(e,n,r,i={}){super(e,n,r),this.implicitDocument={render:s=>super.render(s),handleMouse:s=>super.handleMouse(s),invalidate:()=>{for(let s of this.children)s.invalidate()}},this.implicitScrollView=new TD(this.implicitDocument,{follow:"end",primary:!0}),this.flashes=new bTe(()=>this.requestRender()),this.wheelScrollLines=Math.max(1,Math.floor(i.wheelScrollLines??1)),this.mouseEnabled=i.mouse??!0,this.searchMatchStyle=i.searchMatchStyle??(s=>`\x1B[4m${s}\x1B[24m`),this.searchCurrentMatchStyle=i.searchCurrentMatchStyle??(s=>`\x1B[1;7m${s}\x1B[22;27m`),this.searchNavigationButtonStyle=i.searchNavigationButtonStyle??(s=>s),this.scrollToEndIndicator=i.scrollToEndIndicator,this.openUrl=i.openUrl,this.onRightClickPaste=i.onRightClickPaste,this.copyOnSelect=i.copyOnSelect??!0,this.copySelection=i.copySelection,this.addInputListener(s=>this.handleViewportInput(s))}get viewportTop(){return this.getPrimaryScrollView().scrollTop}get isFollowingOutput(){return this.getPrimaryScrollView().isFollowingEnd}getCopyOnSelect(){return this.copyOnSelect}setCopyOnSelect(e){this.copyOnSelect=e}hasActiveSelection(){return this.getActiveSelectionText()!==void 0}async copyActiveSelectionToClipboard(){let e=this.getActiveSelectionText();return e?this.copyTextToClipboard(e):!1}setLayoutRoot(e){this.layoutRoot!==e&&(this.layoutRoot=e,this.currentLayout=void 0,this.requestRender())}render(e){return this.layoutRoot?.render(e)??super.render(e)}getMountedRoots(){return this.layoutRoot?[this.layoutRoot]:this.children}getPrimaryScrollView(){return this.currentLayout?.primaryScrollView??this.implicitScrollView}beforeTerminalStart(){this.stopSelectionAutoScroll(),this.selectionPressActive=!1,this.stopScrollbarHover(),this.stopScrollbarDrag(),this.flashes.dispose(),this.altScreenActive=!0;let e=Dl();this.imageProtocol=e.images,this.uploadedKittyImages.clear(),e.images==="iterm2"&&(this.savedCapabilities=e,Rre({...e,images:null}),this.invalidate()),this.lastDocument=[],this.selectionAnchor=void 0,this.selectionFocus=void 0,this.selectionGranularity="character",this.selectionInitialRange=void 0,this.lastClick=void 0,this.pressedUrl=void 0,this.selectionDragged=!1,this.clearComponentMouseGesture(),this.lastComponentClick=void 0,this.resetRenderState();let n=process.env.TERM?.toLowerCase()??"",r=process.env.TMUX!==void 0||process.env.ZELLIJ!==void 0||process.env.STY!==void 0||n.startsWith("tmux")||n.startsWith("screen")?ODi:LDi;this.terminal.write(`${MDi}${wBn}${this.mouseEnabled?r:""}\x1B[2J\x1B[H\x1B[?25l`)}beforeTerminalStop(e){this.closeSearch(),this.stopSelectionAutoScroll(),this.selectionPressActive=!1,this.stopScrollbarHover(),this.stopScrollbarDrag(),this.clearComponentMouseGesture(),this.flashes.dispose(),this.altScreenActive&&(this.terminal.write(`${CTe}${this.deleteKittyImages()}${this.mouseEnabled?FDi:""}${TBn}${ITe}`),this.uploadedKittyImages.clear())}afterTerminalStop(e){if(this.altScreenActive){if(this.altScreenActive=!1,e.preserveScreen)this.terminal.write(`${CTe}${IBn}\x1B[?25h${ITe}`);else{let n=Math.max(1,this.terminal.columns),r=this.render(n).map(s=>s.replace(vBn,""));this.lastDocument=this.applyLineResets(r.map(s=>s.replaceAll(AE,""))).map(s=>tu(s)||rn(s)<=n?s:Hc(s,0,n,!0));let i=`${CTe}${IBn}${wBn}`;for(let s=0;s0&&(i+=`\r +`),i+=`\r\x1B[2K${this.lastDocument[s]??""}`;i+=`\x1B[0m${TBn}\r +\x1B[?25h${ITe}`,this.terminal.write(i)}this.savedCapabilities&&(Rre(this.savedCapabilities),this.savedCapabilities=void 0)}}deleteKittyImages(){return this.imageProtocol==="kitty"?tTe():""}prepareKittyScreen(e){let n=new Set,r=e.map(c=>{let u=y1n(c);if(!u)return c;n.add(u.imageId);let l=this.uploadedKittyImages.get(u.imageId),d={transmissionGeneration:u.transmissionGeneration,transmissionBytes:u.transmissionBytes,estimatedDecodedBytes:u.estimatedDecodedBytes};return l&&this.uploadedKittyImages.delete(u.imageId),this.uploadedKittyImages.set(u.imageId,d),l?.transmissionGeneration===u.transmissionGeneration?u.replacementLine:c}),i=0,s=0,o=0;for(let[c,u]of this.uploadedKittyImages)n.has(c)||(i+=1,s+=u.transmissionBytes,o+=u.estimatedDecodedBytes);let a="";for(let[c,u]of this.uploadedKittyImages){if(i<=WDi&&s<=HDi&&o<=qDi)break;n.has(c)||(a+=Z8(c),this.uploadedKittyImages.delete(c),i-=1,s-=u.transmissionBytes,o-=u.estimatedDecodedBytes)}return{lines:r,evictedImageDeletion:a}}resetRenderState(){this.previousScreen=[],this.previousScreenWidth=0,this.previousScreenHeight=0,this.currentLayout=void 0}scrollBy(e){this.getPrimaryScrollView().scrollBy(e),this.requestRender()}scrollToTop(){this.getPrimaryScrollView().scrollToStart(),this.requestRender()}scrollToBottom(){this.getPrimaryScrollView().scrollToEnd(),this.requestRender()}scrollToPrompt(e){if(!this.currentLayout)return;let n=this.getPrimaryScrollView(),r=Sb(this.currentLayout,n)?.scrollContentLines;if(r){for(let i=n.scrollTop+e;i>=0&&ithis.updateSearchQuery(r),this.searchNavigationButtonStyle),n={component:e,index:new yTe,query:"",matches:[],selectedIndex:-1,anchorRow:this.getPrimaryScrollView().scrollTop,selectionMode:"query"};this.activeSearch=n,n.overlay=this.showOverlay(e,{anchor:"top-right",width:"40%",minWidth:32,margin:1})}closeSearch(){let e=this.activeSearch;e&&(this.activeSearch=void 0,e.overlay?.hide(),this.requestRender())}updateSearchQuery(e){let n=this.activeSearch;if(!n||e===n.query)return;let r=n.matches[n.selectedIndex];n.anchorRow=r?.segments[0]?.row??this.getPrimaryScrollView().scrollTop,n.query=e,n.selectionMode="query",n.component.setResult(-1,0),this.requestRender()}navigateSearch(e){let n=this.activeSearch;n?.query&&(n.selectionMode=e<0?"previous":"next",this.requestRender())}getSearchNavigationDirectionAt(e,n){let r=this.activeSearch,i=r?.overlay?.getBounds();if(!(!r||!i)&&!(e=i.col+i.width||n=i.row+i.height))return r.component.getNavigationDirectionAt(n-i.row,e-i.col)}handleSearchMouseEvent(e){let n=this.activeSearch;if(!n)return!1;let r=this.getSearchNavigationDirectionAt(e.x,e.y);return n.component.setHoveredNavigationDirection(r)&&this.requestRender(),r===void 0||e.release||(e.button&32)!==0||(e.button&3)!==0?!1:(this.navigateSearch(r),!0)}refreshSearch(e){let n=this.activeSearch;if(!n)return!1;let r=e.primaryScrollView??this.implicitScrollView,i=Sb(e,r),s=i?.scrollContentLines;if(!s||!n.query.trim())return n.matches=[],n.selectedIndex=-1,n.selectedKey=void 0,n.selectionMode="retain",n.component.setResult(-1,0),!1;let o=n.selectionMode!=="retain",a=n.index.search(s,n.query),c=a.matches;if(n.matches=c,!a.changed&&n.selectionMode==="retain")return!1;let u=a.changed?n.selectedKey?c.findIndex(y=>Vot(y)===n.selectedKey):-1:n.selectedIndex,l=-1;if(c.length>0)if(n.selectionMode==="query"){let y=0,E=c.length;for(;y=0?u:Math.min(n.selectedIndex,c.length-1);l=y<0?0:(y+1)%c.length}else if(n.selectionMode==="previous"){let y=u>=0?u:Math.min(n.selectedIndex,c.length-1);l=y<0?c.length-1:(y-1+c.length)%c.length}else l=u>=0?u:Math.min(Math.max(0,n.selectedIndex),c.length-1);if(n.selectedIndex=l,n.selectedKey=l>=0?Vot(c[l]):void 0,n.selectionMode="retain",n.component.setResult(l,c.length),!o)return!1;let d=c[l],m=d?.segments[0],h=d?.segments[d.segments.length-1];if(!i||!m||!h||r.viewportHeight<=0)return!1;let f=r.scrollTop,g=f+r.viewportHeight-1,A=f;return(m.rowg)&&(A=m.row-Math.floor(r.viewportHeight/3)),r.scrollTo(A,{disableFollow:!0}),r.scrollTop!==f}flash(e,n){this.flashes.flash(e,n)}shouldDeferViewportInputToOverlay(){return this.isOverlayFocused()&&this.activeSearch?.overlay?.isFocused()!==!0}clearComponentMouseGesture(){this.mouseCapture=void 0,this.mousePressTarget=void 0,this.mousePressPoint=void 0,this.mousePressMoved=!1}handleViewportInput(e){if(e===UDi){let o=this.selectionPressActive,a=o&&this.getSelectionBounds()!==void 0;return this.selectionPressActive=!1,this.stopSelectionAutoScroll(),this.stopScrollbarHover(),this.activeSearch?.component.setHoveredNavigationDirection(void 0)&&this.requestRender(),this.stopScrollbarDrag(),this.pressedUrl=void 0,this.selectionDragged=!1,this.clearComponentMouseGesture(),this.lastComponentClick=void 0,o&&(this.selectionAnchor=void 0,this.selectionFocus=void 0,this.selectionGranularity="character",this.selectionInitialRange=void 0,a&&this.requestRender()),this.lastClick=void 0,{consume:!0}}if(e===QDi)return{consume:!0};let n=this.parseWheelEvent(e);if(n){let o=this.createMouseEvent("wheel",n.button,n.x,n.y,{wheelDelta:n.direction*this.getWheelScrollLines(n.button)}),a=this.dispatchMouseToOverlay(o),c=a.result??(a.hit?void 0:this.dispatchMouseToLayout(o));return c?(this.applyMouseDispatchResult(o,c)&&this.requestRender(),{consume:!0}):this.shouldDeferViewportInputToOverlay()?void 0:(this.routeWheel(n),{consume:!0})}let r=this.parseSgrMouseEvent(e);if(r)return this.handleMouseEvent(r),{consume:!0};if(this.isMouseSequence(e))return{consume:!0};let i=Ai(),s=V8(e);if(i.matches(e,"tui.altScreen.search"))return s||this.toggleSearch(),{consume:!0};if(this.activeSearch?.overlay?.isFocused()){if(i.matches(e,"tui.altScreen.searchNext"))return s||this.navigateSearch(1),{consume:!0};if(i.matches(e,"tui.altScreen.searchPrevious"))return s||this.navigateSearch(-1),{consume:!0};if(i.matches(e,"tui.altScreen.searchClose"))return s||this.closeSearch(),{consume:!0}}if(!this.shouldDeferViewportInputToOverlay()){if(i.matches(e,"tui.altScreen.pageUp"))return s||this.scrollBy(-Math.max(1,this.getPrimaryScrollView().viewportHeight-RBn)),{consume:!0};if(i.matches(e,"tui.altScreen.pageDown"))return s||this.scrollBy(Math.max(1,this.getPrimaryScrollView().viewportHeight-RBn)),{consume:!0};if(i.matches(e,"tui.altScreen.halfPageUp"))return s||this.scrollBy(-Math.max(1,Math.floor(this.getPrimaryScrollView().viewportHeight/2))),{consume:!0};if(i.matches(e,"tui.altScreen.halfPageDown"))return s||this.scrollBy(Math.max(1,Math.floor(this.getPrimaryScrollView().viewportHeight/2))),{consume:!0};if(i.matches(e,"tui.altScreen.lineUp"))return s||this.scrollBy(-1),{consume:!0};if(i.matches(e,"tui.altScreen.lineDown"))return s||this.scrollBy(1),{consume:!0};if(i.matches(e,"tui.altScreen.previousPrompt"))return s||this.scrollToPrompt(-1),{consume:!0};if(i.matches(e,"tui.altScreen.nextPrompt"))return s||this.scrollToPrompt(1),{consume:!0};if(i.matches(e,"tui.altScreen.top"))return s||this.scrollToTop(),{consume:!0};if(i.matches(e,"tui.altScreen.bottom"))return s||this.scrollToBottom(),{consume:!0}}}decodeMouseButton(e){switch(e&3){case 0:return"left";case 1:return"middle";case 2:return"right";default:return"none"}}createMouseEvent(e,n,r,i,s={}){return{type:e,button:e==="wheel"?"none":this.decodeMouseButton(n),x:r,y:i,screenX:r,screenY:i,width:Math.max(1,this.terminal.columns),height:Math.max(1,this.terminal.rows),shift:(n&4)!==0,alt:(n&8)!==0,ctrl:(n&16)!==0,...s.wheelDelta===void 0?{}:{wheelDelta:s.wheelDelta},...s.clickCount===void 0?{}:{clickCount:s.clickCount}}}dispatchMouseToLayout(e){if(!this.currentLayout)return;let n=new Set,r=SBn(this.currentLayout,e.screenX,e.screenY);for(let i of r){if(n.has(i.component)||cTe(i.component)&&i.component.handleMouse===gn.prototype.handleMouse)continue;n.add(i.component);let s=kR(i.component,{...e,x:e.screenX-i.rect.x,y:e.screenY-i.rect.y,width:i.rect.width,height:i.rect.height});if(s)return s}}applyMouseDispatchResult(e,n){let r=this.resolveMouseFocusTarget(n.focusTarget??n.target.component),i=n.focus===!0&&this.getFocusedComponent()!==r;return n.focus&&this.setFocus(r),n.capture&&(this.mouseCapture=n.target),n.render??(i||e.type==="press"||e.type==="click"||e.type==="drag"||e.type==="wheel")}dispatchMouseToTarget(e,n){return kR(n.component,x1n(e,n))}getComponentClickCount(e,n,r){let i=Date.now(),s=this.lastComponentClick,o=s&&i-s.timestamp<=kBn&&s.component===e.component&&s.x===n&&s.y===r?s.count%3+1:1;return this.lastComponentClick={timestamp:i,count:o,component:e.component,x:n,y:r},o}clearTextSelection(){this.stopSelectionAutoScroll(),this.selectionPressActive=!1,this.selectionAnchor=void 0,this.selectionFocus=void 0,this.selectionGranularity="character",this.selectionInitialRange=void 0,this.pressedUrl=void 0,this.selectionDragged=!1}handleMouseEvent(e){let n=(e.button&32)!==0,r=e.release?"release":n?this.decodeMouseButton(e.button)==="none"?"move":"drag":"press",i=this.createMouseEvent(r,e.button,e.x,e.y);if(this.mouseCapture||this.mousePressTarget){let a=this.mouseCapture??this.mousePressTarget;this.mousePressPoint&&(e.x!==this.mousePressPoint.x||e.y!==this.mousePressPoint.y)&&(this.mousePressMoved=!0,this.lastComponentClick=void 0);let c=!1,u=this.dispatchMouseToTarget(i,a);if(u&&(c=this.applyMouseDispatchResult(i,u)),e.release){if(!this.mousePressMoved&&this.mousePressPoint?.x===e.x&&this.mousePressPoint.y===e.y){let l=this.createMouseEvent("click",e.button,e.x,e.y,{clickCount:this.getComponentClickCount(a,e.x,e.y)}),d=this.dispatchMouseToTarget(l,a);d&&(c=this.applyMouseDispatchResult(l,d)||c)}this.clearComponentMouseGesture()}c&&this.requestRender();return}if(this.handleSearchMouseEvent(e))return;let s=this.dispatchMouseToOverlay(i);if(s.hit)this.stopScrollbarHover();else{if(this.handleScrollToEndIndicatorMouseEvent(e))return;let a=this.handleScrollbarMouseEvent(e);if(this.scrollbarDrag||this.updateScrollbarHover(e.x,e.y),a)return}let o=s.result??(s.hit?void 0:this.dispatchMouseToLayout(i));if(o){let a=this.applyMouseDispatchResult(i,o);r==="press"&&(this.clearTextSelection(),this.mousePressTarget=o.target,this.mousePressPoint={x:e.x,y:e.y},this.mousePressMoved=!1),a&&this.requestRender();return}this.handleRightClickPaste(e)||this.handleSelectionMouseEvent(e)}parseWheelEvent(e){let n=/^\x1b\[<(\d+);(\d+);(\d+)[Mm]$/.exec(e);if(n){let r=Number.parseInt(n[1],10);if((r&64)===0)return;let i=r&3;return i!==0&&i!==1?void 0:{direction:i===0?-1:1,x:Number.parseInt(n[2],10)-1,y:Number.parseInt(n[3],10)-1,button:r}}if(e.length===6&&e.startsWith("\x1B[M")){let r=e.charCodeAt(3)-32;if((r&64)===0)return;let i=r&3;return i!==0&&i!==1?void 0:{direction:i===0?-1:1,x:e.charCodeAt(4)-33,y:e.charCodeAt(5)-33,button:r}}}getWheelScrollLines(e){return(e&8)!==0?this.wheelScrollLines*$Di:this.wheelScrollLines}routeWheel(e){let n=e.direction*this.getWheelScrollLines(e.button),r=new Set;for(let s of this.currentLayout?STe(this.currentLayout,e.x,e.y):[])if(r.add(s),n=s.scrollBy(n),n===0||s.overscroll==="contain")break;let i=this.getPrimaryScrollView();n!==0&&!r.has(i)&&i.scrollBy(n),this.updateScrollbarHover(e.x,e.y),this.requestRender()}parseSgrMouseEvent(e){let n=/^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/.exec(e);if(n)return{button:Number.parseInt(n[1],10),x:Number.parseInt(n[2],10)-1,y:Number.parseInt(n[3],10)-1,release:n[4]==="m"}}handleRightClickPaste(e){if(!this.onRightClickPaste||process.platform!=="win32"||process.env.TERM_PROGRAM?.toLowerCase()==="vscode"||e.release||e.button!==2)return!1;try{this.onRightClickPaste()}catch{}return!0}handleScrollToEndIndicatorMouseEvent(e){let n=this.scrollToEndIndicatorRect;return!n||e.release||(e.button&32)!==0||(e.button&3)!==0||e.y!==n.row||e.x=n.column+n.width?!1:(this.scrollToBottom(),!0)}getScrollbarTargetAt(e,n,r=!1){if(!(this.hasOverlay()||!this.currentLayout))for(let i of STe(this.currentLayout,e,n)){let s=Sb(this.currentLayout,i),o=s?dj(s,r):void 0;if(o&&e===o.column&&n>=o.trackTop&&n=n.geometry.thumbTop&&e.ye.col>=u.start&&e.colu.selectable&&l.selectable&&(u.joiner||l.joiner),a=r[s].start,c=r[s].end;for(let u=s;u>0&&o(r[u-1],r[u]);u--)a=r[u-1].start;for(let u=s;u=s?1:0,this.selectionAutoScrollDirection===0){this.stopSelectionAutoScroll();return}this.selectionAutoScrollTimer||(this.selectionAutoScrollTimer=setInterval(()=>this.autoScrollSelection(),50),this.selectionAutoScrollTimer.unref())}autoScrollSelection(){let e=this.selectionAnchor?.scrollView,n=this.selectionDragPointer,r=this.selectionAutoScrollDirection;if(!e||!n||r===0){this.stopSelectionAutoScroll();return}if(e.scrollBy(r)===r){this.stopSelectionAutoScroll();return}let s=this.getScrollSelectionPoint(e,n.x,n.y);s&&this.updateSelectionFocus(s),this.requestRender()}stopSelectionAutoScroll(){this.selectionAutoScrollTimer&&(clearInterval(this.selectionAutoScrollTimer),this.selectionAutoScrollTimer=void 0),this.selectionAutoScrollDirection=0,this.selectionDragPointer=void 0}handleSelectionMouseEvent(e){let n=e.button&3;if(n!==0&&!(e.release&&n===3))return;let r=this.selectionAnchor?.scrollView,i=this.getSelectionPoint(e,r);if(e.release){if(!this.selectionPressActive||(this.selectionPressActive=!1,this.stopSelectionAutoScroll(),!this.selectionAnchor))return;this.updateSelectionFocus(i);let l=!this.selectionDragged&&this.selectionAnchor.scrollView===i.scrollView&&this.selectionAnchor.row===i.row&&this.selectionAnchor.col===i.col,d=l?this.pressedUrl:void 0;if(this.pressedUrl=void 0,d&&this.openUrl){this.selectionAnchor=void 0,this.selectionFocus=void 0;try{this.openUrl(d)}catch{}this.requestRender();return}if(l){let m=this.createMouseEvent("click",e.button,e.x,e.y,{clickCount:this.lastClick?.count??1}),h=this.dispatchMouseToOverlay(m),f=h.result??(h.hit?void 0:this.dispatchMouseToLayout(m));if(f){let g=this.applyMouseDispatchResult(m,f);this.clearTextSelection(),g&&this.requestRender();return}}this.copyOnSelect&&this.copySelectionToClipboard(),this.requestRender();return}if((e.button&32)!==0){if(!this.selectionPressActive||!this.selectionAnchor)return;this.selectionDragged=!0,this.lastClick=void 0,this.pressedUrl=void 0,this.updateSelectionFocus(i),this.updateSelectionAutoScroll(e),this.requestRender();return}this.stopSelectionAutoScroll(),this.selectionPressActive=!0;let s=!this.hasOverlay()&&this.currentLayout?STe(this.currentLayout,e.x,e.y)[0]:void 0,o=this.getSelectionPoint(e,s),a=this.getWordSelection(o),c=this.getClickCount(o,a),u=c===2?a:c===3?this.getLineSelection(o):void 0;this.selectionGranularity=u?c===2?"word":"line":"character",this.selectionInitialRange=u,this.selectionAnchor=u?.start??o,this.selectionFocus=u?.end??o,this.selectionDragged=!1,this.pressedUrl=u?void 0:qwe(this.previousScreen[Math.max(0,Math.min(this.terminal.rows-1,e.y))]??"",Math.max(0,Math.min(this.terminal.columns-1,e.x))),this.requestRender()}getSelectionBounds(){if(!this.selectionAnchor||!this.selectionFocus||this.selectionAnchor.scrollView!==this.selectionFocus.scrollView)return;let e=this.selectionAnchor.rows&&(i+=r(e.slice(s,o))),i+=a.code,o+=a.length,s=o}return sh)break;for(let _ of E.segments){let S=s.rect.y+_.row-i.scrollTop;if(S=u)continue;let C=Math.max(l,s.rect.x+_.startCol),I=Math.min(d,s.rect.x+_.endCol);if(I<=C)continue;let w=o.get(S)??[];w.push({startCol:C,endCol:I,current:y===r.selectedIndex}),o.set(S,w)}}let A=[...e];for(let[y,E]of o){let _=A[y]??"";if(tu(_))continue;let S=rn(_);for(let C of E.sort((I,w)=>w.startCol-I.startCol)){let I=Math.min(C.startCol,S),w=Math.min(C.endCol,S);if(w<=I)continue;let k=Hc(_,0,I,!0),N=Hc(_,I,w-I,!0),O=Hc(_,w,Math.max(0,S-w),!0);_=`${k}${this.applySearchTextHighlight(N,C.current)}${O}`}A[y]=_}return A}applySelectionHighlight(e){let n="\x1B[7m",r=0;for(;r{if(lo||li.end.row||tu(u))return u;let d=rn(u),m=this.getSelectionColumns(u,l,i,a,c);if(m.end<=m.start)return u;let h=Hc(u,0,m.start,!0),f=Hc(u,m.start,m.end-m.start,!0),g=Hc(u,m.end,Math.max(0,d-m.end),!0);return`${h}${this.applySelectionHighlight(f)}${g}`})}isMouseSequence(e){return/^\x1b\[<\d+;\d+;\d+[Mm]$/.test(e)||e.length===6&&e.startsWith("\x1B[M")}compositeScrollToEndIndicator(e,n,r){this.scrollToEndIndicatorRect=void 0;let i=n.primaryScrollView??this.implicitScrollView;if(!this.scrollToEndIndicator||!i.followEnd||i.isFollowingEnd)return e;let s=Sb(n,i),o=s?.clip;if(!o||o.width<=0||o.height<=0)return e;let a=o.y+o.height-1;if(a>=e.length||tu(e[a]??""))return e;let c=s?dj(s)?.column:void 0,u=dr(this.scrollToEndIndicator(),o.width,""),l=rn(u),d=o.x+Math.floor((o.width-l)/2),m=c??o.x+o.width,h=Math.max(0,m-d),f=dr(u,h,""),g=rn(f);if(g===0)return e;let A=[...e];return A[a]=aw(A[a]??"",f,d,g,r),this.scrollToEndIndicatorRect={row:a,column:d,width:g},A}compositeFlashes(e,n,r){let i=this.flashes.render(n).slice(-r);if(i.length===0)return e;let s=[...e];for(;s.lengththis.requestRender());this.refreshSearch(i)&&(i=zot(r,e,n,()=>this.requestRender()));let s=i.lines.map(f=>f.replace(vBn,""));s=this.applySearchHighlights(s,i),s=this.compositeScrollToEndIndicator(s,i,e),s=this.compositeOverlays(s,e,n),s.length>n&&(s=s.slice(s.length-n)),s=this.applySelection(s,i),s=this.compositeFlashes(s,e,n);let o=this.extractCursorPosition(s,n);s=this.applyLineResets(s).map(f=>tu(f)||rn(f)<=e?f:Hc(f,0,e,!0));let a=this.previousScreen.length===0||this.previousScreenWidth!==e||this.previousScreenHeight!==n,c=s.some((f,g)=>f!==this.previousScreen[g]&&(tu(f)||tu(this.previousScreen[g]??""))),u=a||c,l=this.uploadedKittyImages.size>0,d=u&&this.imageProtocol==="kitty"?this.prepareKittyScreen(s):{lines:s,evictedImageDeletion:""},m=CTe;if(a){this.fullRedrawCount+=1;let f=this.imageProtocol==="kitty"&&l?_ot():this.deleteKittyImages();m+=`${f}\x1B[2J`}else c&&(this.imageProtocol==="iterm2"?m+="\x1B[2J":this.imageProtocol==="kitty"&&(m+=_ot()));m+=d.evictedImageDeletion;let h=u&&this.imageProtocol==="kitty"&&s.some(tu)&&(!!process.env.WEZTERM_PANE||process.env.TERM_PROGRAM?.toLowerCase()==="wezterm");if(h)for(let f=0;f4294967295||(a==="i"?i.push(u):a==="r"&&(s=u))}return{ids:i,rows:s}}function Kot(t){return MBn(t)?.ids??[]}function zDi(t){return MBn(t)?.rows??1}function KDi(){return!!process.env.TERMUX_VERSION}var MR,PBn,eQ,NBn,DBn,Qre,EE,OBn=v(()=>{p();MR=Ot(require("node:fs"),1),PBn=Ot(require("node:os"),1),eQ=Ot(require("node:path"),1);SD();_b();ld();NBn="\x1B_G",DBn=1024*1024,Qre=class{buffer="";writtenChars=0;write;constructor(e){this.write=e}append(e){let n=0;for(;n=55296&&e.charCodeAt(i-1)<=56319&&e.charCodeAt(i)>=56320&&e.charCodeAt(i)<=57343&&i--,i===n){this.flush();continue}this.buffer+=e.slice(n,i),n=i,this.buffer.length===DBn&&this.flush()}}flush(){this.buffer&&(this.write(this.buffer),this.writtenChars+=this.buffer.length,this.buffer="")}get length(){return this.writtenChars+this.buffer.length}};EE=class extends tj{mode="regular";previousLines=[];previousKittyImageIds=new Set;previousWidth=0;previousHeight=0;cursorRow=0;hardwareCursorRow=0;maxLinesRendered=0;previousViewportTop=0;captureRenderState(){return{previousLines:[...this.previousLines],previousWidth:this.previousWidth,previousHeight:this.previousHeight,cursorRow:this.cursorRow,hardwareCursorRow:this.hardwareCursorRow,maxLinesRendered:this.maxLinesRendered,previousViewportTop:this.previousViewportTop}}restoreRenderState(e){this.previousLines=e.previousLines.map(n=>tu(n)?"":n),this.previousKittyImageIds=new Set,this.previousWidth=e.previousWidth,this.previousHeight=e.previousHeight,this.cursorRow=e.cursorRow,this.hardwareCursorRow=e.hardwareCursorRow,this.maxLinesRendered=e.maxLinesRendered,this.previousViewportTop=e.previousViewportTop}resetRenderState(){this.previousLines=[],this.previousWidth=-1,this.previousHeight=-1,this.cursorRow=0,this.hardwareCursorRow=0,this.maxLinesRendered=0,this.previousViewportTop=0}beforeTerminalStop(e){if(e.preserveScreen||this.previousLines.length===0)return;this.terminal.write(" ");let r=this.previousLines.length-this.hardwareCursorRow;r>0?this.terminal.write(`\x1B[${r}B`):r<0&&this.terminal.write(`\x1B[${-r}A`),this.terminal.write(`\r +`)}collectKittyImageIds(e){let n=new Set;for(let r of e)for(let i of Kot(r))n.add(i);return n}deleteKittyImages(e){let n="";for(let r of e)n+=Z8(r);return n}getKittyImageReservedRows(e,n,r=e.length-1){let i=zDi(e[n]??"");if(i<=1)return 1;let s=Math.min(i,r-n+1,e.length-n),o=1;for(;o0)break;o++}return o}expandChangedRangeForKittyImages(e,n,r){let i=e,s=n,o=a=>{for(let c=0;c=e||c<=n&&u>=e)&&(i=Math.min(i,c),s=Math.max(s,u))}};return o(this.previousLines),o(r),{firstChanged:i,lastChanged:s}}deleteChangedKittyImages(e,n){if(e<0||n0?this.previousViewportTop+this.previousHeight:n,o=i?Math.max(0,s-n):this.previousViewportTop,a=o,c=this.hardwareCursorRow,u=O=>{let W=c-o;return O-a-W},l=this.render(e);this.hasOverlayEntries&&(l=this.compositeOverlays(l,e,n));let d=this.extractCursorPosition(l,n);l=this.applyLineResets(l);let m=O=>{this.fullRedrawCount+=1;let W=new Qre(G=>this.terminal.write(G));W.append("\x1B[?2026h"),O&&(W.append(this.deleteKittyImages(this.previousKittyImageIds)),W.append("\x1B[2J\x1B[H\x1B[3J"));for(let G=0;G0&&W.append(`\r +`);let q=l[G],Y=tu(q)?this.getKittyImageReservedRows(l,G):1;if(Y>1&&Y<=n){for(let z=1;z{if(h===void 0)return;let W=eQ.join(h,"pi-tui-debug.log"),$=`[${new Date().toISOString()}] fullRender: ${O} (prev=${this.previousLines.length}, new=${l.length}, height=${n}) +`;MR.mkdirSync(eQ.dirname(W),{recursive:!0}),MR.appendFileSync(W,$)};if(this.previousLines.length===0&&!r&&!i){f("first render"),m(!1);return}if(r){f(`terminal width changed (${this.previousWidth} -> ${e})`),m(!0);return}if(i&&!KDi()){f(`terminal height changed (${this.previousHeight} -> ${n})`),m(!0);return}if(this.getClearOnShrink()&&l.lengththis.previousLines.length;if(E&&(g===-1&&(g=this.previousLines.length),A=l.length-1),g!==-1){let O=this.expandChangedRangeForKittyImages(g,A,l);g=O.firstChanged,A=O.lastChanged}let _=E&&g===this.previousLines.length&&g>0;if(g===-1){this.positionHardwareCursor(d,l.length),this.previousViewportTop=o,this.previousHeight=n;return}if(g>=l.length){if(this.previousLines.length>l.length){let O=new Qre(Y=>this.terminal.write(Y));O.append("\x1B[?2026h"),O.append(this.deleteChangedKittyImages(g,A));let W=Math.max(0,l.length-1);if(W0?O.append(`\x1B[${$}B`):$<0&&O.append(`\x1B[${-$}A`),O.append("\r");let G=this.previousLines.length-l.length;if(G>n){f(`extraLines > height (${G} > ${n})`),m(!0);return}let q=l.length===0?0:1;G>0&&q>0&&O.append(`\x1B[${q}B`);for(let Y=0;Y0&&O.append(`\x1B[${ce}A`),O.append("\x1B[?2026l"),O.flush(),this.cursorRow=W,this.hardwareCursorRow=W}this.positionHardwareCursor(d,l.length),this.previousLines=l,this.previousKittyImageIds=this.collectKittyImageIds(l),this.previousWidth=e,this.previousHeight=n,this.previousViewportTop=o;return}if(gthis.terminal.write(O));S.append("\x1B[?2026h"),S.append(this.deleteChangedKittyImages(g,A));let C=o+n-1,I=_?g-1:g;if(I>C){let O=Math.max(0,Math.min(n-1,c-o)),W=n-1-O;W>0&&S.append(`\x1B[${W}B`);let $=I-C;S.append(`\r +`.repeat($)),o+=$,a+=$,c=I}let w=u(I);w>0?S.append(`\x1B[${w}B`):w<0&&S.append(`\x1B[${-w}A`),S.append(_?`\r +`:"\r");let k=Math.min(A,l.length-1);for(let O=g;O<=k;O++){O>g&&S.append(`\r +`);let W=l[O],$=tu(W),G=$?this.getKittyImageReservedRows(l,O,k):1;if(G>1){let q=O-a;if(q<0||q+G>n){f(`kitty image pre-clear would scroll (${q} + ${G} > ${n})`),m(!0);return}S.append("\x1B[2K");for(let ce=1;cee){let q=eQ.join(this.logDirectory??PBn.tmpdir(),"pi-tui-crash.log"),ce=[`Crash at ${new Date().toISOString()}`,`Terminal width: ${e}`,`Line ${O} visible width: ${rn(W)}`,"","=== All rendered lines ===",...l.map((z,j)=>`[${j}] (w=${rn(z)}) ${z}`),""].join(` +`);MR.mkdirSync(eQ.dirname(q),{recursive:!0}),MR.writeFileSync(q,ce),this.stop();let Y=[`Rendered line ${O} exceeds terminal width (${rn(W)} > ${e}).`,"","This is likely caused by a custom TUI component not truncating its output.","Use visibleWidth() to measure and truncateToWidth() to truncate lines.","",`Debug log written to: ${q}`].join(` +`);throw new Error(Y)}S.append(W)}let N=k;if(this.previousLines.length>l.length){if(k0?o+=`\x1B[${s}B`:s<0&&(o+=`\x1B[${-s}A`),o+=`\x1B[${i+1}G`,o&&this.terminal.write(o),this.hardwareCursorRow=r,this.getShowHardwareCursor()?this.terminal.showCursor():this.terminal.hideCursor()}}});var Ure={};br(Ure,{Box:()=>Ou,CURSOR_MARKER:()=>AE,CancellableLoader:()=>nj,CombinedAutocompleteProvider:()=>W8,Container:()=>gn,Editor:()=>ID,HStack:()=>uTe,Image:()=>wD,Input:()=>ma,Key:()=>wre,KeybindingsManager:()=>jF,Loader:()=>xb,Markdown:()=>Pl,Marked:()=>WF,MouseRegion:()=>vA,ProcessTerminal:()=>cw,ScrollView:()=>TD,SelectList:()=>eh,SettingsList:()=>vD,Spacer:()=>Tt,StdinBuffer:()=>uj,TUI_KEYBINDINGS:()=>BR,Text:()=>Et,TruncatedText:()=>yE,TuiAltScreen:()=>lS,TuiMainScreen:()=>EE,VStack:()=>XF,allocateImageId:()=>eTe,calculateImageRows:()=>b1n,compositeTuiLine:()=>aw,decodeKittyPrintable:()=>Tre,deleteAllKittyImages:()=>tTe,deleteKittyImage:()=>Z8,detectCapabilities:()=>Eot,encodeITerm2:()=>xot,encodeKitty:()=>bot,fuzzyFilter:()=>Pu,fuzzyMatch:()=>bre,getCapabilities:()=>Dl,getCellDimensions:()=>vre,getGifDimensions:()=>wot,getImageDimensions:()=>ej,getJpegDimensions:()=>Iot,getKeybindings:()=>Ai,getNativeClipboard:()=>ZF,getOsc8LinkAtColumn:()=>qwe,getPngDimensions:()=>Cot,getWebpDimensions:()=>Tot,hyperlink:()=>gE,imageFallback:()=>qF,isFocusable:()=>iTe,isKeyRelease:()=>V8,isKeyRepeat:()=>n1n,isKittyProtocolActive:()=>t1n,isViewportTUI:()=>Bre,matchesKey:()=>sm,parseKey:()=>s1n,parseOsc11BackgroundColor:()=>Jwe,parseTerminalColorSchemeReport:()=>Xwe,renderImage:()=>rTe,renderLatex:()=>Ore,resetCapabilitiesCache:()=>g1n,setCapabilities:()=>Rre,setCapabilityOverrides:()=>RR,setCellDimensions:()=>Zwe,setKeybindings:()=>CD,setKittyProtocolActive:()=>j8,sliceByColumn:()=>Hc,stripTerminalSequences:()=>HF,truncateToWidth:()=>dr,visibleWidth:()=>rn,wrapTextWithAnsi:()=>Ag});var Tr=v(()=>{p();aot();Jkn();S1n();w1n();F1n();U1n();G1n();dTe();Not();j1n();V1n();qot();Oot();Y1n();z1n();Bot();K1n();J1n();Wwe();NR();xD();Got();fTe();jot();fBn();yot();SD();_b();BBn();OBn();ld()});function tQ(t){if(t)try{t.close()}catch{}}function pj(t,e,n){try{let r=(0,LBn.watch)(t,e);return r.on("error",n),r}catch{return n(),null}}var LBn,FBn,Jot=v(()=>{p();LBn=require("node:fs"),FBn=5e3});var aat=re((Esc,XBn)=>{p();function iat(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(e){var n=t[e];typeof n=="object"&&!Object.isFrozen(n)&&iat(n)}),t}var qBn=iat,JDi=iat;qBn.default=JDi;var TTe=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function mj(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function RD(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var XDi="
    ",QBn=t=>!!t.kind,eat=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=mj(e)}openNode(e){if(!QBn(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){QBn(e)&&(this.buffer+=XDi)}value(){return this.buffer}span(e){this.buffer+=``}},tat=class t{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},nat=class extends tat{constructor(e){super(),this.options=e}addKeyword(e,n){e!==""&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,n){let r=e.root;r.kind=n,r.sublanguage=!0,this.add(r)}toHTML(){return new eat(this,this.options).value()}finalize(){return!0}};function ZDi(t){return new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function Gre(t){return t?typeof t=="string"?t:t.source:null}function ePi(...t){return t.map(n=>Gre(n)).join("")}function tPi(...t){return"("+t.map(n=>Gre(n)).join("|")+")"}function nPi(t){return new RegExp(t.toString()+"|").exec("").length-1}function rPi(t,e){let n=t&&t.exec(e);return n&&n.index===0}var iPi=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function sPi(t,e="|"){let n=0;return t.map(r=>{n+=1;let i=n,s=Gre(r),o="";for(;s.length>0;){let a=iPi.exec(s);if(!a){o+=s;break}o+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+i):(o+=a[0],a[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(e)}var oPi=/\b\B/,jBn="[a-zA-Z]\\w*",sat="[a-zA-Z_]\\w*",oat="\\b\\d+(\\.\\d+)?",VBn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",YBn="\\b(0b[01]+)",aPi="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",cPi=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=ePi(e,/.*\b/,t.binary,/\b.*/)),RD({className:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},$re={begin:"\\\\[\\s\\S]",relevance:0},lPi={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[$re]},uPi={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[$re]},zBn={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},vTe=function(t,e,n={}){let r=RD({className:"comment",begin:t,end:e,contains:[]},n);return r.contains.push(zBn),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},dPi=vTe("//","$"),pPi=vTe("/\\*","\\*/"),mPi=vTe("#","$"),hPi={className:"number",begin:oat,relevance:0},fPi={className:"number",begin:VBn,relevance:0},gPi={className:"number",begin:YBn,relevance:0},APi={className:"number",begin:oat+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},yPi={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[$re,{begin:/\[/,end:/\]/,relevance:0,contains:[$re]}]}]},EPi={className:"title",begin:jBn,relevance:0},bPi={className:"title",begin:sat,relevance:0},_Pi={begin:"\\.\\s*"+sat,relevance:0},xPi=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},wTe=Object.freeze({__proto__:null,MATCH_NOTHING_RE:oPi,IDENT_RE:jBn,UNDERSCORE_IDENT_RE:sat,NUMBER_RE:oat,C_NUMBER_RE:VBn,BINARY_NUMBER_RE:YBn,RE_STARTERS_RE:aPi,SHEBANG:cPi,BACKSLASH_ESCAPE:$re,APOS_STRING_MODE:lPi,QUOTE_STRING_MODE:uPi,PHRASAL_WORDS_MODE:zBn,COMMENT:vTe,C_LINE_COMMENT_MODE:dPi,C_BLOCK_COMMENT_MODE:pPi,HASH_COMMENT_MODE:mPi,NUMBER_MODE:hPi,C_NUMBER_MODE:fPi,BINARY_NUMBER_MODE:gPi,CSS_NUMBER_MODE:APi,REGEXP_MODE:yPi,TITLE_MODE:EPi,UNDERSCORE_TITLE_MODE:bPi,METHOD_GUARD:_Pi,END_SAME_AS_BEGIN:xPi});function SPi(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function CPi(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=SPi,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function IPi(t,e){Array.isArray(t.illegal)&&(t.illegal=tPi(...t.illegal))}function wPi(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function TPi(t,e){t.relevance===void 0&&(t.relevance=1)}var vPi=["of","and","for","in","not","or","if","then","parent","list","value"],RPi="keyword";function KBn(t,e,n=RPi){let r={};return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(s){Object.assign(r,KBn(t[s],e,s))}),r;function i(s,o){e&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){let c=a.split("|");r[c[0]]=[s,kPi(c[0],c[1])]})}}function kPi(t,e){return e?Number(e):BPi(t)?0:1}function BPi(t){return vPi.includes(t.toLowerCase())}function NPi(t,{plugins:e}){function n(a,c){return new RegExp(Gre(a),"m"+(t.case_insensitive?"i":"")+(c?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,c]),this.matchAt+=nPi(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let c=this.regexes.map(u=>u[1]);this.matcherRe=n(sPi(c),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(c);if(!u)return null;let l=u.findIndex((m,h)=>h>0&&m!==void 0),d=this.matchIndexes[l];return u.splice(0,l),Object.assign(u,d)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];let u=new r;return this.rules.slice(c).forEach(([l,d])=>u.addRule(l,d)),u.compile(),this.multiRegexes[c]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,u){this.rules.push([c,u]),u.type==="begin"&&this.count++}exec(c){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let l=u.exec(c);if(this.resumingScanAtSamePosition()&&!(l&&l.index===this.lastIndex)){let d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,l=d.exec(c)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function s(a){let c=new i;return a.contains.forEach(u=>c.addRule(u.begin,{rule:u,type:"begin"})),a.terminatorEnd&&c.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&c.addRule(a.illegal,{type:"illegal"}),c}function o(a,c){let u=a;if(a.isCompiled)return u;[wPi].forEach(d=>d(a,c)),t.compilerExtensions.forEach(d=>d(a,c)),a.__beforeBegin=null,[CPi,IPi,TPi].forEach(d=>d(a,c)),a.isCompiled=!0;let l=null;if(typeof a.keywords=="object"&&(l=a.keywords.$pattern,delete a.keywords.$pattern),a.keywords&&(a.keywords=KBn(a.keywords,t.case_insensitive)),a.lexemes&&l)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return l=l||a.lexemes||/\w+/,u.keywordPatternRe=n(l,!0),c&&(a.begin||(a.begin=/\B|\b/),u.beginRe=n(a.begin),a.endSameAsBegin&&(a.end=a.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(u.endRe=n(a.end)),u.terminatorEnd=Gre(a.end)||"",a.endsWithParent&&c.terminatorEnd&&(u.terminatorEnd+=(a.end?"|":"")+c.terminatorEnd)),a.illegal&&(u.illegalRe=n(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return DPi(d==="self"?a:d)})),a.contains.forEach(function(d){o(d,u)}),a.starts&&o(a.starts,c),u.matcher=s(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=RD(t.classNameAliases||{}),o(t)}function JBn(t){return t?t.endsWithParent||JBn(t.starts):!1}function DPi(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return RD(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:JBn(t)?RD(t,{starts:t.starts?RD(t.starts):null}):Object.isFrozen(t)?RD(t):t}var PPi="10.7.3";function MPi(t){return!!(t||t==="")}function OPi(t){let e={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!t.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,mj(this.code);let r={};return this.autoDetect?(r=t.highlightAuto(this.code),this.detectedLanguage=r.language):(r=t.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),r.value},autoDetect(){return!this.language||MPi(this.autodetect)},ignoreIllegals(){return!0}},render(r){return r("pre",{},[r("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:e,VuePlugin:{install(r){r.component("highlightjs",e)}}}}var LPi={"after:highlightElement":({el:t,result:e,text:n})=>{let r=UBn(t);if(!r.length)return;let i=document.createElement("div");i.innerHTML=e.value,e.value=FPi(r,UBn(i),n)}};function rat(t){return t.nodeName.toLowerCase()}function UBn(t){let e=[];return(function n(r,i){for(let s=r.firstChild;s;s=s.nextSibling)s.nodeType===3?i+=s.nodeValue.length:s.nodeType===1&&(e.push({event:"start",offset:i,node:s}),i=n(s,i),rat(s).match(/br|hr|img|input/)||e.push({event:"stop",offset:i,node:s}));return i})(t,0),e}function FPi(t,e,n){let r=0,i="",s=[];function o(){return!t.length||!e.length?t.length?t:e:t[0].offset!==e[0].offset?t[0].offset"}function c(l){i+=""}function u(l){(l.event==="start"?a:c)(l.node)}for(;t.length||e.length;){let l=o();if(i+=mj(n.substring(r,l[0].offset)),r=l[0].offset,l===t){s.reverse().forEach(c);do u(l.splice(0,1)[0]),l=o();while(l===t&&l.length&&l[0].offset===r);s.reverse().forEach(a)}else l[0].event==="start"?s.push(l[0].node):s.pop(),u(l.splice(0,1)[0])}return i+mj(n.substr(r))}var GBn={},Xot=t=>{console.error(t)},$Bn=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Cb=(t,e)=>{GBn[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),GBn[`${t}/${e}`]=!0)},Zot=mj,WBn=RD,HBn=Symbol("nomatch"),QPi=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,s=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]},c={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:nat};function u(we){return c.noHighlightRe.test(we)}function l(we){let ie=we.className+" ";ie+=we.parentNode?we.parentNode.className:"";let oe=c.languageDetectRe.exec(ie);if(oe){let ne=ce(oe[1]);return ne||($Bn(o.replace("{}",oe[1])),$Bn("Falling back to no-highlight mode for this block.",we)),ne?oe[1]:"no-highlight"}return ie.split(/\s+/).find(ne=>u(ne)||ce(ne))}function d(we,ie,oe,ne){let Z="",te="";typeof ie=="object"?(Z=we,oe=ie.ignoreIllegals,te=ie.language,ne=void 0):(Cb("10.7.0","highlight(lang, code, ...args) has been deprecated."),Cb("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),te=we,Z=ie);let V={code:Z,language:te};Ae("before:highlight",V);let ee=V.result?V.result:m(V.language,V.code,oe,ne);return ee.code=V.code,Ae("after:highlight",ee),ee}function m(we,ie,oe,ne){function Z(Qt,Mt){let Xe=_e.case_insensitive?Mt[0].toLowerCase():Mt[0];return Object.prototype.hasOwnProperty.call(Qt.keywords,Xe)&&Qt.keywords[Xe]}function te(){if(!He.keywords){st.addText(ze);return}let Qt=0;He.keywordPatternRe.lastIndex=0;let Mt=He.keywordPatternRe.exec(ze),Xe="";for(;Mt;){Xe+=ze.substring(Qt,Mt.index);let Me=Z(He,Mt);if(Me){let[Je,yt]=Me;if(st.addText(Xe),Xe="",rt+=yt,Je.startsWith("_"))Xe+=Mt[0];else{let Vt=_e.classNameAliases[Je]||Je;st.addKeyword(Mt[0],Vt)}}else Xe+=Mt[0];Qt=He.keywordPatternRe.lastIndex,Mt=He.keywordPatternRe.exec(ze)}Xe+=ze.substr(Qt),st.addText(Xe)}function V(){if(ze==="")return;let Qt=null;if(typeof He.subLanguage=="string"){if(!e[He.subLanguage]){st.addText(ze);return}Qt=m(He.subLanguage,ze,!0,mt[He.subLanguage]),mt[He.subLanguage]=Qt.top}else Qt=f(ze,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(rt+=Qt.relevance),st.addSublanguage(Qt.emitter,Qt.language)}function ee(){He.subLanguage!=null?V():te(),ze=""}function ae(Qt){return Qt.className&&st.openNode(_e.classNameAliases[Qt.className]||Qt.className),He=Object.create(Qt,{parent:{value:He}}),He}function me(Qt,Mt,Xe){let Me=rPi(Qt.endRe,Xe);if(Me){if(Qt["on:end"]){let Je=new TTe(Qt);Qt["on:end"](Mt,Je),Je.isMatchIgnored&&(Me=!1)}if(Me){for(;Qt.endsParent&&Qt.parent;)Qt=Qt.parent;return Qt}}if(Qt.endsWithParent)return me(Qt.parent,Mt,Xe)}function ge(Qt){return He.matcher.regexIndex===0?(ze+=Qt[0],1):(Ft=!0,0)}function ue(Qt){let Mt=Qt[0],Xe=Qt.rule,Me=new TTe(Xe),Je=[Xe.__beforeBegin,Xe["on:begin"]];for(let yt of Je)if(yt&&(yt(Qt,Me),Me.isMatchIgnored))return ge(Mt);return Xe&&Xe.endSameAsBegin&&(Xe.endRe=ZDi(Mt)),Xe.skip?ze+=Mt:(Xe.excludeBegin&&(ze+=Mt),ee(),!Xe.returnBegin&&!Xe.excludeBegin&&(ze=Mt)),ae(Xe),Xe.returnBegin?0:Mt.length}function ye(Qt){let Mt=Qt[0],Xe=ie.substr(Qt.index),Me=me(He,Qt,Xe);if(!Me)return HBn;let Je=He;Je.skip?ze+=Mt:(Je.returnEnd||Je.excludeEnd||(ze+=Mt),ee(),Je.excludeEnd&&(ze=Mt));do He.className&&st.closeNode(),!He.skip&&!He.subLanguage&&(rt+=He.relevance),He=He.parent;while(He!==Me.parent);return Me.starts&&(Me.endSameAsBegin&&(Me.starts.endRe=Me.endRe),ae(Me.starts)),Je.returnEnd?0:Mt.length}function Se(){let Qt=[];for(let Mt=He;Mt!==_e;Mt=Mt.parent)Mt.className&&Qt.unshift(Mt.className);Qt.forEach(Mt=>st.openNode(Mt))}let be={};function Te(Qt,Mt){let Xe=Mt&&Mt[0];if(ze+=Qt,Xe==null)return ee(),0;if(be.type==="begin"&&Mt.type==="end"&&be.index===Mt.index&&Xe===""){if(ze+=ie.slice(Mt.index,Mt.index+1),!i){let Me=new Error("0 width match regex");throw Me.languageName=we,Me.badRule=be.rule,Me}return 1}if(be=Mt,Mt.type==="begin")return ue(Mt);if(Mt.type==="illegal"&&!oe){let Me=new Error('Illegal lexeme "'+Xe+'" for mode "'+(He.className||"")+'"');throw Me.mode=He,Me}else if(Mt.type==="end"){let Me=ye(Mt);if(Me!==HBn)return Me}if(Mt.type==="illegal"&&Xe==="")return 1;if(on>1e5&&on>Mt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=Xe,Xe.length}let _e=ce(we);if(!_e)throw Xot(o.replace("{}",we)),new Error('Unknown language: "'+we+'"');let X=NPi(_e,{plugins:r}),$e="",He=ne||X,mt={},st=new c.__emitter(c);Se();let ze="",rt=0,Ct=0,on=0,Ft=!1;try{for(He.matcher.considerAll();;){on++,Ft?Ft=!1:He.matcher.considerAll(),He.matcher.lastIndex=Ct;let Qt=He.matcher.exec(ie);if(!Qt)break;let Mt=ie.substring(Ct,Qt.index),Xe=Te(Mt,Qt);Ct=Qt.index+Xe}return Te(ie.substr(Ct)),st.closeAllNodes(),st.finalize(),$e=st.toHTML(),{relevance:Math.floor(rt),value:$e,language:we,illegal:!1,emitter:st,top:He}}catch(Qt){if(Qt.message&&Qt.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:Qt.message,context:ie.slice(Ct-100,Ct+100),mode:Qt.mode},sofar:$e,relevance:0,value:Zot(ie),emitter:st};if(i)return{illegal:!1,relevance:0,value:Zot(ie),emitter:st,language:we,top:He,errorRaised:Qt};throw Qt}}function h(we){let ie={relevance:0,emitter:new c.__emitter(c),value:Zot(we),illegal:!1,top:a};return ie.emitter.addText(we),ie}function f(we,ie){ie=ie||c.languages||Object.keys(e);let oe=h(we),ne=ie.filter(ce).filter(z).map(ae=>m(ae,we,!1));ne.unshift(oe);let Z=ne.sort((ae,me)=>{if(ae.relevance!==me.relevance)return me.relevance-ae.relevance;if(ae.language&&me.language){if(ce(ae.language).supersetOf===me.language)return 1;if(ce(me.language).supersetOf===ae.language)return-1}return 0}),[te,V]=Z,ee=te;return ee.second_best=V,ee}function g(we){return c.tabReplace||c.useBR?we.replace(s,ie=>ie===` +`?c.useBR?"
    ":ie:c.tabReplace?ie.replace(/\t/g,c.tabReplace):ie):we}function A(we,ie,oe){let ne=ie?n[ie]:oe;we.classList.add("hljs"),ne&&we.classList.add(ne)}let y={"before:highlightElement":({el:we})=>{c.useBR&&(we.innerHTML=we.innerHTML.replace(/\n/g,"").replace(//g,` +`))},"after:highlightElement":({result:we})=>{c.useBR&&(we.value=we.value.replace(/\n/g,"
    "))}},E=/^(<[^>]+>|\t)+/gm,_={"after:highlightElement":({result:we})=>{c.tabReplace&&(we.value=we.value.replace(E,ie=>ie.replace(/\t/g,c.tabReplace)))}};function S(we){let ie=null,oe=l(we);if(u(oe))return;Ae("before:highlightElement",{el:we,language:oe}),ie=we;let ne=ie.textContent,Z=oe?d(ne,{language:oe,ignoreIllegals:!0}):f(ne);Ae("after:highlightElement",{el:we,result:Z,text:ne}),we.innerHTML=Z.value,A(we,oe,Z.language),we.result={language:Z.language,re:Z.relevance,relavance:Z.relevance},Z.second_best&&(we.second_best={language:Z.second_best.language,re:Z.second_best.relevance,relavance:Z.second_best.relevance})}function C(we){we.useBR&&(Cb("10.3.0","'useBR' will be removed entirely in v11.0"),Cb("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),c=WBn(c,we)}let I=()=>{if(I.called)return;I.called=!0,Cb("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead."),document.querySelectorAll("pre code").forEach(S)};function w(){Cb("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),k=!0}let k=!1;function N(){if(document.readyState==="loading"){k=!0;return}document.querySelectorAll("pre code").forEach(S)}function O(){k&&N()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",O,!1);function W(we,ie){let oe=null;try{oe=ie(t)}catch(ne){if(Xot("Language definition for '{}' could not be registered.".replace("{}",we)),i)Xot(ne);else throw ne;oe=a}oe.name||(oe.name=we),e[we]=oe,oe.rawDefinition=ie.bind(null,t),oe.aliases&&Y(oe.aliases,{languageName:we})}function $(we){delete e[we];for(let ie of Object.keys(n))n[ie]===we&&delete n[ie]}function G(){return Object.keys(e)}function q(we){Cb("10.4.0","requireLanguage will be removed entirely in v11."),Cb("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");let ie=ce(we);if(ie)return ie;throw new Error("The '{}' language is required, but not loaded.".replace("{}",we))}function ce(we){return we=(we||"").toLowerCase(),e[we]||e[n[we]]}function Y(we,{languageName:ie}){typeof we=="string"&&(we=[we]),we.forEach(oe=>{n[oe.toLowerCase()]=ie})}function z(we){let ie=ce(we);return ie&&!ie.disableAutodetect}function j(we){we["before:highlightBlock"]&&!we["before:highlightElement"]&&(we["before:highlightElement"]=ie=>{we["before:highlightBlock"](Object.assign({block:ie.el},ie))}),we["after:highlightBlock"]&&!we["after:highlightElement"]&&(we["after:highlightElement"]=ie=>{we["after:highlightBlock"](Object.assign({block:ie.el},ie))})}function se(we){j(we),r.push(we)}function Ae(we,ie){let oe=we;r.forEach(function(ne){ne[oe]&&ne[oe](ie)})}function De(we){return Cb("10.2.0","fixMarkup will be removed entirely in v11.0"),Cb("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),g(we)}function Pe(we){return Cb("10.7.0","highlightBlock will be removed entirely in v12.0"),Cb("10.7.0","Please use highlightElement now."),S(we)}Object.assign(t,{highlight:d,highlightAuto:f,highlightAll:N,fixMarkup:De,highlightElement:S,highlightBlock:Pe,configure:C,initHighlighting:I,initHighlightingOnLoad:w,registerLanguage:W,unregisterLanguage:$,listLanguages:G,getLanguage:ce,registerAliases:Y,requireLanguage:q,autoDetection:z,inherit:WBn,addPlugin:se,vuePlugin:OPi(t).VuePlugin}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=PPi;for(let we in wTe)typeof wTe[we]=="object"&&qBn(wTe[we]);return Object.assign(t,wTe),t.addPlugin(y),t.addPlugin(LPi),t.addPlugin(_),t},UPi=QPi({});XBn.exports=UPi});var cat=re((_sc,ZBn)=>{p();function GPi(t){return t?typeof t=="string"?t:t.source:null}function $Pi(...t){return t.map(n=>GPi(n)).join("")}function WPi(t){let e={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[e]}]};Object.assign(e,{className:"variable",variants:[{begin:$Pi(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e,r]};r.contains.push(s);let o={className:"",begin:/\\"/},a={className:"string",begin:/'/,end:/'/},c={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,e]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],l=t.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),d={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp"},contains:[l,t.SHEBANG(),d,c,t.HASH_COMMENT_MODE,i,s,o,a,e]}}ZBn.exports=WPi});var lat=re((Ssc,eNn)=>{p();function HPi(t){return t?typeof t=="string"?t:t.source:null}function RTe(t){return qPi("(",t,")?")}function qPi(...t){return t.map(n=>HPi(n)).join("")}function jPi(t){let e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",s="("+n+"|"+RTe(r)+"[a-zA-Z_]\\w*"+RTe("<[^<>]+>")+")",o={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:RTe(r)+t.IDENT_RE,relevance:0},m=RTe(r)+t.IDENT_RE+"\\s*\\(",h={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary",literal:"true false nullptr NULL"},f=[l,o,e,t.C_BLOCK_COMMENT_MODE,u,c],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:f.concat([{begin:/\(/,end:/\)/,keywords:h,contains:f.concat(["self"]),relevance:0}]),relevance:0},A={className:"function",begin:"("+s+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:h,relevance:0},{begin:m,returnBegin:!0,contains:[d],relevance:0},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,e,t.C_BLOCK_COMMENT_MODE,l]};return{name:"C",aliases:["h"],keywords:h,disableAutodetect:!0,illegal:"",keywords:h,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:h},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:l,strings:c,keywords:h}}}eNn.exports=jPi});var dat=re((Isc,tNn)=>{p();function VPi(t){return t?typeof t=="string"?t:t.source:null}function YPi(t){return uat("(?=",t,")")}function kTe(t){return uat("(",t,")?")}function uat(...t){return t.map(n=>VPi(n)).join("")}function zPi(t){let e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",s="("+n+"|"+kTe(r)+"[a-zA-Z_]\\w*"+kTe("<[^<>]+>")+")",o={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:kTe(r)+t.IDENT_RE,relevance:0},m=kTe(r)+t.IDENT_RE+"\\s*\\(",f={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"_Bool _Complex _Imaginary",_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"],literal:"true false nullptr NULL"},g={className:"function.dispatch",relevance:0,keywords:f,begin:uat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,t.IDENT_RE,YPi(/\s*\(/))},A=[g,l,o,e,t.C_BLOCK_COMMENT_MODE,u,c],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:A.concat([{begin:/\(/,end:/\)/,keywords:f,contains:A.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+s+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:f,relevance:0},{begin:m,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,e,t.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:f,illegal:"",keywords:f,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:l,strings:c,keywords:f}}}tNn.exports=zPi});var pat=re((Tsc,nNn)=>{p();function KPi(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:i.concat(s),built_in:e,literal:r},a=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},l=t.inherit(u,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:o},m=t.inherit(d,{illegal:/\n/}),h={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},f={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},g=t.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});d.contains=[f,h,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,c,t.C_BLOCK_COMMENT_MODE],m.contains=[g,h,l,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,c,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let A={variants:[f,h,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},E=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},A,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,y,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,y,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"meta-string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+E+"\\s+)+"+t.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,y],relevance:0},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[A,c,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},_]}}nNn.exports=KPi});var mat=re((Rsc,rNn)=>{p();function JPi(t){let e={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},n={className:"subst",variants:[{begin:/\$\{/,end:/\}/}],keywords:"true false null this is new super"},r={className:"string",variants:[{begin:"r'''",end:"'''"},{begin:'r"""',end:'"""'},{begin:"r'",end:"'",illegal:"\\n"},{begin:'r"',end:'"',illegal:"\\n"},{begin:"'''",end:"'''",contains:[t.BACKSLASH_ESCAPE,e,n]},{begin:'"""',end:'"""',contains:[t.BACKSLASH_ESCAPE,e,n]},{begin:"'",end:"'",illegal:"\\n",contains:[t.BACKSLASH_ESCAPE,e,n]},{begin:'"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE,e,n]}]};n.contains=[t.C_NUMBER_MODE,r];let i=["Comparable","DateTime","Duration","Function","Iterable","Iterator","List","Map","Match","Object","Pattern","RegExp","Set","Stopwatch","String","StringBuffer","StringSink","Symbol","Type","Uri","bool","double","int","num","Element","ElementList"],s=i.map(a=>`${a}?`);return{name:"Dart",keywords:{keyword:"abstract as assert async await break case catch class const continue covariant default deferred do dynamic else enum export extends extension external factory false final finally for Function get hide if implements import in inferface is late library mixin new null on operator part required rethrow return set show static super switch sync this throw true try typedef var void while with yield",built_in:i.concat(s).concat(["Never","Null","dynamic","print","document","querySelector","querySelectorAll","window"]),$pattern:/[A-Za-z][A-Za-z0-9_]*\??/},contains:[r,t.COMMENT(/\/\*\*(?!\/)/,/\*\//,{subLanguage:"markdown",relevance:0}),t.COMMENT(/\/{3,} ?/,/$/,{contains:[{subLanguage:"markdown",begin:".",end:"$",relevance:0}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},t.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"},{begin:"=>"}]}}rNn.exports=JPi});var hat=re((Bsc,iNn)=>{p();function XPi(t){let e={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",literal:"true false iota nil",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{name:"Go",aliases:["golang"],keywords:e,illegal:"{p();function ZPi(t){return t?typeof t=="string"?t:t.source:null}function eMi(t){return tMi("(?=",t,")")}function tMi(...t){return t.map(n=>ZPi(n)).join("")}function fat(t,e={}){return e.variants=t,e}function nMi(t){let e="[A-Za-z0-9_$]+",n=fat([t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]})]),r={className:"regexp",begin:/~?\/[^\/\n]+\//,contains:[t.BACKSLASH_ESCAPE]},i=fat([t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]),s=fat([{begin:/"""/,end:/"""/},{begin:/'''/,end:/'''/},{begin:"\\$/",end:"/\\$",relevance:10},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE],{className:"string"});return{name:"Groovy",keywords:{built_in:"this super",literal:"true false null",keyword:"byte short char int long boolean float double void def as in assert trait abstract static volatile transient public private protected synchronized final class interface enum if else for while switch case break default continue throw throws try catch finally implements extends new import package return instanceof"},contains:[t.SHEBANG({binary:"groovy",relevance:10}),n,s,r,i,{className:"class",beginKeywords:"class interface trait enum",end:/\{/,illegal:":",contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{className:"meta",begin:"@[A-Za-z]+",relevance:0},{className:"attr",begin:e+"[ ]*:",relevance:0},{begin:/\?/,end:/:/,relevance:0,contains:[n,s,r,i,"self"]},{className:"symbol",begin:"^[ ]*"+eMi(e+":"),excludeBegin:!0,end:e+":",relevance:0}],illegal:/#|<\//}}sNn.exports=nMi});var Aat=re((Msc,oNn)=>{p();var hj="[0-9](_*[0-9])*",BTe=`\\.(${hj})`,NTe="[0-9a-fA-F](_*[0-9a-fA-F])*",rMi={className:"number",variants:[{begin:`(\\b(${hj})((${BTe})|\\.)?|(${BTe}))[eE][+-]?(${hj})[fFdD]?\\b`},{begin:`\\b(${hj})((${BTe})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${BTe})[fFdD]?\\b`},{begin:`\\b(${hj})[fFdD]\\b`},{begin:`\\b0[xX]((${NTe})\\.?|(${NTe})?\\.(${NTe}))[pP][+-]?(${hj})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${NTe})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function iMi(t){var e="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",n=e+"(<"+e+"(\\s*,\\s*"+e+")*>)?",r="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",i={className:"meta",begin:"@"+e,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]};let s=rMi;return{name:"Java",aliases:["jsp"],keywords:r,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"class",beginKeywords:"class interface enum",end:/[{;=]/,excludeEnd:!0,relevance:1,keywords:"class interface enum",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"new throw return else",relevance:0},{className:"class",begin:"record\\s+"+t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,excludeEnd:!0,end:/[{;=]/,keywords:r,contains:[{beginKeywords:"record"},{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"function",begin:"("+n+"\\s+)+"+t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:r,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[i,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,s,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},s,i]}}oNn.exports=iMi});var Eat=re((Lsc,lNn)=>{p();var aNn="[A-Za-z$_][0-9A-Za-z$_]*",sMi=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],oMi=["true","false","null","undefined","NaN","Infinity"],aMi=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],cMi=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],lMi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],uMi=["arguments","this","super","console","window","document","localStorage","module","global"],dMi=[].concat(lMi,uMi,aMi,cMi);function pMi(t){return t?typeof t=="string"?t:t.source:null}function cNn(t){return yat("(?=",t,")")}function yat(...t){return t.map(n=>pMi(n)).join("")}function mMi(t){let e=(S,{after:C})=>{let I="",end:""},i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(S,C)=>{let I=S[0].length+S.index,w=S.input[I];if(w==="<"){C.ignoreMatch();return}w===">"&&(e(S,{after:I})||C.ignoreMatch())}},s={$pattern:aNn,keyword:sMi,literal:oMi,built_in:dMi},o="[0-9](_?[0-9])*",a=`\\.(${o})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${c})((${a})|\\.)?|(${a}))[eE][+-]?(${o})\\b`},{begin:`\\b(${c})\\b((${a})\\b|\\.)?|(${a})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},l={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,l],subLanguage:"xml"}},m={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,l],subLanguage:"css"}},h={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,l]},g={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},A=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,m,h,u,t.REGEXP_MODE];l.contains=A.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(A)});let y=[].concat(g,l.contains),E=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),_={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:E};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:E},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,m,h,g,u,{begin:yat(/[{,\n]\s*/,cNn(yat(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/,n+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:n+cNn("\\s*:"),relevance:0}]},{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[g,t.REGEXP_MODE,{className:"function",begin:"(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:E}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:r.begin,end:r.end},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:s,contains:["self",t.inherit(t.TITLE_MODE,{begin:n}),_],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[_,t.inherit(t.TITLE_MODE,{begin:n})]},{variants:[{begin:"\\."+n},{begin:"\\$"+n}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},t.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:n}),"self",_]},{begin:"(get|set)\\s+(?="+n+"\\()",end:/\{/,keywords:"get set",contains:[t.inherit(t.TITLE_MODE,{begin:n}),{begin:/\(\)/},_]},{begin:/\$[(.]/}]}}lNn.exports=mMi});var bat=re((Qsc,uNn)=>{p();var fj="[0-9](_*[0-9])*",DTe=`\\.(${fj})`,PTe="[0-9a-fA-F](_*[0-9a-fA-F])*",hMi={className:"number",variants:[{begin:`(\\b(${fj})((${DTe})|\\.)?|(${DTe}))[eE][+-]?(${fj})[fFdD]?\\b`},{begin:`\\b(${fj})((${DTe})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${DTe})[fFdD]?\\b`},{begin:`\\b(${fj})[fFdD]\\b`},{begin:`\\b0[xX]((${PTe})\\.?|(${PTe})?\\.(${PTe}))[pP][+-]?(${fj})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${PTe})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function fMi(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(o);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(o,{className:"meta-string"})]}]},u=hMi,l=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=d;return m.variants[1].contains=[d],d.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,l,n,r,a,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,l],relevance:0},t.C_LINE_COMMENT_MODE,l,a,c,o,t.C_NUMBER_MODE]},l]},{className:"class",beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/,excludeBegin:!0,returnEnd:!0},a,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}uNn.exports=fMi});var _at=re((Gsc,dNn)=>{p();function gMi(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}dNn.exports=gMi});var xat=re((Wsc,pNn)=>{p();function AMi(t){let e={keyword:"rec with let in inherit assert if else then",literal:"true false or and null",built_in:"import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation"},n={className:"subst",begin:/\$\{/,end:/\}/,keywords:e},r={begin:/[a-zA-Z0-9-_]+(\s*=)/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/\S+/}]},i={className:"string",contains:[n],variants:[{begin:"''",end:"''"},{begin:'"',end:'"'}]},s=[t.NUMBER_MODE,t.HASH_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,i,r];return n.contains=s,{name:"Nix",aliases:["nixos"],keywords:e,contains:s}}pNn.exports=AMi});var Sat=re((qsc,fNn)=>{p();function hNn(t){return t?typeof t=="string"?t:t.source:null}function gj(...t){return t.map(n=>hNn(n)).join("")}function mNn(...t){return"("+t.map(n=>hNn(n)).join("|")+")"}function yMi(t){let e=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:e.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},s={begin:/->\{/,end:/\}/},o={variants:[{begin:/\$\d/},{begin:gj(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[t.BACKSLASH_ESCAPE,i,o],c=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],u=(m,h,f="\\1")=>{let g=f==="\\1"?f:gj(f,h);return gj(gj("(?:",m,")"),h,/(?:\\.|[^\\\/])*?/,g,/(?:\\.|[^\\\/])*?/,f,n)},l=(m,h,f)=>gj(gj("(?:",m,")"),h,/(?:\\.|[^\\\/])*?/,f,n),d=[o,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:a,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:u("s|tr|y",mNn(...c))},{begin:u("s|tr|y","\\(","\\)")},{begin:u("s|tr|y","\\[","\\]")},{begin:u("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:l("(?:m|qr)?",/\//,/\//)},{begin:l("m|qr",mNn(...c),/\1/)},{begin:l("m|qr",/\(/,/\)/)},{begin:l("m|qr",/\[/,/\]/)},{begin:l("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=d,s.contains=d,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:d}}fNn.exports=yMi});var Cat=re((Vsc,gNn)=>{p();function EMi(t){let e={className:"variable",begin:"\\$+[a-zA-Z_\x7F-\xFF][a-zA-Z0-9_\x7F-\xFF]*(?![A-Za-z0-9])(?![$])"},n={className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{begin:/\?>/}]},r={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},i=t.inherit(t.APOS_STRING_MODE,{illegal:null}),s=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(r)}),o=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(r)}),a={className:"string",contains:[t.BACKSLASH_ESCAPE,n],variants:[t.inherit(i,{begin:"b'",end:"'"}),t.inherit(s,{begin:'b"',end:'"'}),s,i,o]},c={className:"number",variants:[{begin:"\\b0b[01]+(?:_[01]+)*\\b"},{begin:"\\b0o[0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:e[+-]?\\d+)?"}],relevance:0},u={keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list match|0 mixed new object or private protected public real return string switch throw trait try unset use var void while xor yield",literal:"false null true",built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException UnhandledMatchError ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Stringable Throwable Traversable WeakReference WeakMap Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass"};return{aliases:["php3","php4","php5","php6","php7","php8"],case_insensitive:!0,keywords:u,contains:[t.HASH_COMMENT_MODE,t.COMMENT("//","$",{contains:[n]}),t.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0,keywords:"__halt_compiler"}),n,{className:"keyword",begin:/\$this\b/},e,{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{className:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",e,t.C_BLOCK_COMMENT_MODE,a,c]}]},{className:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",relevance:0,end:";",contains:[t.UNDERSCORE_TITLE_MODE]},a,c]}}gNn.exports=EMi});var Iat=re((zsc,ANn)=>{p();function bMi(t){return t?typeof t=="string"?t:t.source:null}function _Mi(t){return xMi("(?=",t,")")}function xMi(...t){return t.map(n=>bMi(n)).join("")}function SMi(t){let s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},a={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/},c={begin:/\{\{/,relevance:0},u={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,o,c,a]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,o,c,a]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,c,a]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,c,a]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},l="[0-9](_?[0-9])*",d=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${l})|(${d}))[eE][+-]?(${l})[jJ]?\\b`},{begin:`(${d})[jJ]?`},{begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${l})[jJ]\\b`}]},h={className:"comment",begin:_Mi(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",o,m,u,t.HASH_COMMENT_MODE]}]};return a.contains=[u,m,o],{name:"Python",aliases:["py","gyp","ipython"],keywords:s,illegal:/(<\/|->|\?)|=>/,contains:[o,m,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},u,h,t.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[t.UNDERSCORE_TITLE_MODE,f,{begin:/->/,endsWithParent:!0,keywords:s}]},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,f,u]}]}}ANn.exports=SMi});var wat=re((Jsc,ENn)=>{p();function CMi(t){return t?typeof t=="string"?t:t.source:null}function IMi(t){return yNn("(?=",t,")")}function yNn(...t){return t.map(n=>CMi(n)).join("")}function wMi(t){let e="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__",built_in:"proc lambda",literal:"true false nil"},r={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},s=[t.COMMENT("#","$",{contains:[r]}),t.COMMENT("^=begin","^=end",{contains:[r],relevance:10}),t.COMMENT("^__END__","\\n$")],o={className:"subst",begin:/#\{/,end:/\}/,keywords:n},a={className:"string",contains:[t.BACKSLASH_ESCAPE,o],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:/<<[-~]?'?(\w+)\n(?:[^\n]*\n)*?\s*\1\b/,returnBegin:!0,contains:[{begin:/<<[-~]?'?/},t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,o]})]}]},c="[1-9](_?[0-9])*|0",u="[0-9](_?[0-9])*",l={className:"number",relevance:0,variants:[{begin:`\\b(${c})(\\.(${u}))?([eE][+-]?(${u})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},d={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:n},m=[a,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[t.inherit(t.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{begin:"("+t.IDENT_RE+"::)?"+t.IDENT_RE,relevance:0}]}].concat(s)},{className:"function",begin:yNn(/def\s+/,IMi(e+"\\s*(\\(|;|$)")),relevance:0,keywords:"def",end:"$|;",contains:[t.inherit(t.TITLE_MODE,{begin:e}),d].concat(s)},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[a,{begin:e}],relevance:0},l,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:n},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,o],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(i,s),relevance:0}].concat(i,s);o.contains=m,d.contains=m;let A=[{begin:/^\s*=>/,starts:{end:"$",contains:m}},{className:"meta",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+>"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",contains:m}}];return s.unshift(i),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:n,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(A).concat(s).concat(m)}}ENn.exports=wMi});var Tat=re((Zsc,bNn)=>{p();function TMi(t){let e="([ui](8|16|32|64|128|size)|f(32|64))?",n="abstract as async await become box break const continue crate do dyn else enum extern false final fn for if impl in let loop macro match mod move mut override priv pub ref return self Self static struct super trait true try type typeof unsafe unsized use virtual where while yield",r="drop i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f32 f64 str char bool Box Option Result String Vec Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator Extend IntoIterator DoubleEndedIterator ExactSizeIterator SliceConcatExt ToString assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!";return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",keyword:n,literal:"true false Some None Ok Err",built_in:r},illegal:""}]}}bNn.exports=TMi});var vat=re((toc,_Nn)=>{p();function vMi(t){let e={className:"meta",begin:"@[A-Za-z]+"},n={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"},{begin:/\$\{/,end:/\}/}]},r={className:"string",variants:[{begin:'"""',end:'"""'},{begin:'"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:'[a-z]+"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE,n]},{className:"string",begin:'[a-z]+"""',end:'"""',contains:[n],relevance:10}]},i={className:"symbol",begin:"'\\w[\\w\\d_]*(?!')"},s={className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},o={className:"title",begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,relevance:0},a={className:"class",beginKeywords:"class object trait type",end:/[:={\[\n;]/,excludeEnd:!0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{beginKeywords:"extends with",relevance:10},{begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[s]},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[s]},o]},c={className:"function",beginKeywords:"def",end:/[:={\[(\n;]/,excludeEnd:!0,contains:[o]};return{name:"Scala",keywords:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,r,i,s,c,a,t.C_NUMBER_MODE,e]}}_Nn.exports=vMi});var Pat=re((roc,RNn)=>{p();function INn(t){return t?typeof t=="string"?t:t.source:null}function Aj(t){return Ac("(?=",t,")")}function Ac(...t){return t.map(n=>INn(n)).join("")}function yg(...t){return"("+t.map(n=>INn(n)).join("|")+")"}var Dat=t=>Ac(/\b/,t,/\w$/.test(t)?/\b/:/\B/),xNn=["Protocol","Type"].map(Dat),Rat=["init","self"].map(Dat),RMi=["Any","Self"],kat=["associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],SNn=["false","nil","true"],kMi=["assignment","associativity","higherThan","left","lowerThan","none","right"],BMi=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],CNn=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],wNn=yg(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),TNn=yg(wNn,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Bat=Ac(wNn,TNn,"*"),vNn=yg(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),MTe=yg(vNn,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),OR=Ac(vNn,MTe,"*"),Nat=Ac(/[A-Z]/,MTe,"*"),NMi=["autoclosure",Ac(/convention\(/,yg("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ac(/objc\(/,OR,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","testable","UIApplicationMain","unknown","usableFromInline"],DMi=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function PMi(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={className:"keyword",begin:Ac(/\./,Aj(yg(...xNn,...Rat))),end:yg(...xNn,...Rat),excludeBegin:!0},s={match:Ac(/\./,yg(...kat)),relevance:0},o=kat.filter(ee=>typeof ee=="string").concat(["_|0"]),a=kat.filter(ee=>typeof ee!="string").concat(RMi).map(Dat),c={variants:[{className:"keyword",match:yg(...a,...Rat)}]},u={$pattern:yg(/\b\w+/,/#\w+/),keyword:o.concat(BMi),literal:SNn},l=[i,s,c],d={match:Ac(/\./,yg(...CNn)),relevance:0},m={className:"built_in",match:Ac(/\b/,yg(...CNn),/(?=\()/)},h=[d,m],f={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:Bat},{match:`\\.(\\.|${TNn})+`}]},A=[f,g],y="([0-9]_*)+",E="([0-9a-fA-F]_*)+",_={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},S=(ee="")=>({className:"subst",variants:[{match:Ac(/\\/,ee,/[0\\tnr"']/)},{match:Ac(/\\/,ee,/u\{[0-9a-fA-F]{1,8}\}/)}]}),C=(ee="")=>({className:"subst",match:Ac(/\\/,ee,/[\t ]*(?:[\r\n]|\r\n)/)}),I=(ee="")=>({className:"subst",label:"interpol",begin:Ac(/\\/,ee,/\(/),end:/\)/}),w=(ee="")=>({begin:Ac(ee,/"""/),end:Ac(/"""/,ee),contains:[S(ee),C(ee),I(ee)]}),k=(ee="")=>({begin:Ac(ee,/"/),end:Ac(/"/,ee),contains:[S(ee),I(ee)]}),N={className:"string",variants:[w(),w("#"),w("##"),w("###"),k(),k("#"),k("##"),k("###")]},O={match:Ac(/`/,OR,/`/)},W={className:"variable",match:/\$\d+/},$={className:"variable",match:`\\$${MTe}+`},G=[O,W,$],q={match:/(@|#)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:DMi,contains:[...A,_,N]}]}},ce={className:"keyword",match:Ac(/@/,yg(...NMi))},Y={className:"meta",match:Ac(/@/,OR)},z=[q,ce,Y],j={match:Aj(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ac(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,MTe,"+")},{className:"type",match:Nat,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ac(/\s+&\s+/,Aj(Nat)),relevance:0}]},se={begin://,keywords:u,contains:[...r,...l,...z,f,j]};j.contains.push(se);let Ae={match:Ac(OR,/\s*:/),keywords:"_|0",relevance:0},De={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Ae,...r,...l,...h,...A,_,N,...G,...z,j]},Pe={beginKeywords:"func",contains:[{className:"title",match:yg(O.match,OR,Bat),endsParent:!0,relevance:0},e]},we={begin://,contains:[...r,j]},ie={begin:yg(Aj(Ac(OR,/\s*:/)),Aj(Ac(OR,/\s+/,OR,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:OR}]},oe={begin:/\(/,end:/\)/,keywords:u,contains:[ie,...r,...l,...A,_,N,...z,j,De],endsParent:!0,illegal:/["']/},ne={className:"function",match:Aj(/\bfunc\b/),contains:[Pe,we,oe,e],illegal:[/\[/,/%/]},Z={className:"function",match:/\b(subscript|init[?!]?)\s*(?=[<(])/,keywords:{keyword:"subscript init init? init!",$pattern:/\w+[?!]?/},contains:[we,oe,e],illegal:/\[|%/},te={beginKeywords:"operator",end:t.MATCH_NOTHING_RE,contains:[{className:"title",match:Bat,endsParent:!0,relevance:0}]},V={beginKeywords:"precedencegroup",end:t.MATCH_NOTHING_RE,contains:[{className:"title",match:Nat,relevance:0},{begin:/{/,end:/}/,relevance:0,endsParent:!0,keywords:[...kMi,...SNn],contains:[j]}]};for(let ee of N.variants){let ae=ee.contains.find(ge=>ge.label==="interpol");ae.keywords=u;let me=[...l,...h,...A,_,N,...G];ae.contains=[...me,{begin:/\(/,end:/\)/,contains:["self",...me]}]}return{name:"Swift",keywords:u,contains:[...r,ne,Z,{className:"class",beginKeywords:"struct protocol class extension enum",end:"\\{",excludeEnd:!0,keywords:u,contains:[t.inherit(t.TITLE_MODE,{begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...l]},te,V,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...l,...h,...A,_,N,...G,...z,j,De]}}RNn.exports=PMi});var Oat=re((soc,PNn)=>{p();var OTe="[A-Za-z$_][0-9A-Za-z$_]*",BNn=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],NNn=["true","false","null","undefined","NaN","Infinity"],MMi=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],OMi=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],LMi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],FMi=["arguments","this","super","console","window","document","localStorage","module","global"],DNn=[].concat(LMi,FMi,MMi,OMi);function QMi(t){return t?typeof t=="string"?t:t.source:null}function kNn(t){return Mat("(?=",t,")")}function Mat(...t){return t.map(n=>QMi(n)).join("")}function UMi(t){let e=(S,{after:C})=>{let I="",end:""},i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(S,C)=>{let I=S[0].length+S.index,w=S.input[I];if(w==="<"){C.ignoreMatch();return}w===">"&&(e(S,{after:I})||C.ignoreMatch())}},s={$pattern:OTe,keyword:BNn,literal:NNn,built_in:DNn},o="[0-9](_?[0-9])*",a=`\\.(${o})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${c})((${a})|\\.)?|(${a}))[eE][+-]?(${o})\\b`},{begin:`\\b(${c})\\b((${a})\\b|\\.)?|(${a})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},l={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,l],subLanguage:"xml"}},m={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,l],subLanguage:"css"}},h={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,l]},g={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},A=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,m,h,u,t.REGEXP_MODE];l.contains=A.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(A)});let y=[].concat(g,l.contains),E=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),_={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:E};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:E},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,m,h,g,u,{begin:Mat(/[{,\n]\s*/,kNn(Mat(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/,n+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:n+kNn("\\s*:"),relevance:0}]},{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[g,t.REGEXP_MODE,{className:"function",begin:"(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:E}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:r.begin,end:r.end},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:s,contains:["self",t.inherit(t.TITLE_MODE,{begin:n}),_],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[_,t.inherit(t.TITLE_MODE,{begin:n})]},{variants:[{begin:"\\."+n},{begin:"\\$"+n}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},t.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:n}),"self",_]},{begin:"(get|set)\\s+(?="+n+"\\()",end:/\{/,keywords:"get set",contains:[t.inherit(t.TITLE_MODE,{begin:n}),{begin:/\(\)/},_]},{begin:/\$[(.]/}]}}function GMi(t){let e=OTe,n={beginKeywords:"namespace",end:/\{/,excludeEnd:!0},r={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:"interface extends"},i={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},s=["any","void","number","boolean","string","object","never","enum"],o=["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"],a={$pattern:OTe,keyword:BNn.concat(o),literal:NNn,built_in:DNn.concat(s)},c={className:"meta",begin:"@"+e},u=(m,h,f)=>{let g=m.contains.findIndex(A=>A.label===h);if(g===-1)throw new Error("can not find mode to replace");m.contains.splice(g,1,f)},l=UMi(t);Object.assign(l.keywords,a),l.exports.PARAMS_CONTAINS.push(c),l.contains=l.contains.concat([c,n,r]),u(l,"shebang",t.SHEBANG()),u(l,"use_strict",i);let d=l.contains.find(m=>m.className==="function");return d.relevance=0,Object.assign(l,{name:"TypeScript",aliases:["ts","tsx"]}),l}PNn.exports=GMi});function MNn(t){if(!(!Number.isInteger(t)||t<0||t>1114111))return String.fromCodePoint(t)}function $Mi(t){switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"apos":return"'"}if(t.startsWith("#x")||t.startsWith("#X"))return MNn(Number.parseInt(t.slice(2),16));if(t.startsWith("#"))return MNn(Number.parseInt(t.slice(1),10))}function ONn(t,e){let n=t.indexOf(";",e+1);if(n===-1||n-e>16)return;let r=t.slice(e+1,n),i=$Mi(r);if(i!==void 0)return{text:i,length:n-e+1}}var LNn=v(()=>{p()});var QNn=re((loc,FNn)=>{p();function WMi(t){var e="[A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_][A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_0-9]+",n="\u0434\u0430\u043B\u0435\u0435 ",r="\u0432\u043E\u0437\u0432\u0440\u0430\u0442 \u0432\u044B\u0437\u0432\u0430\u0442\u044C\u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0434\u043B\u044F \u0435\u0441\u043B\u0438 \u0438 \u0438\u0437 \u0438\u043B\u0438 \u0438\u043D\u0430\u0447\u0435 \u0438\u043D\u0430\u0447\u0435\u0435\u0441\u043B\u0438 \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u043A\u043E\u043D\u0435\u0446\u0435\u0441\u043B\u0438 \u043A\u043E\u043D\u0435\u0446\u043F\u043E\u043F\u044B\u0442\u043A\u0438 \u043A\u043E\u043D\u0435\u0446\u0446\u0438\u043A\u043B\u0430 \u043D\u0435 \u043D\u043E\u0432\u044B\u0439 \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u043F\u0435\u0440\u0435\u043C \u043F\u043E \u043F\u043E\u043A\u0430 \u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u043F\u0440\u0435\u0440\u0432\u0430\u0442\u044C \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0442\u043E\u0433\u0434\u0430 \u0446\u0438\u043A\u043B \u044D\u043A\u0441\u043F\u043E\u0440\u0442 ",i=n+r,s="\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C\u0438\u0437\u0444\u0430\u0439\u043B\u0430 ",o="\u0432\u0435\u0431\u043A\u043B\u0438\u0435\u043D\u0442 \u0432\u043C\u0435\u0441\u0442\u043E \u0432\u043D\u0435\u0448\u043D\u0435\u0435\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u043A\u043B\u0438\u0435\u043D\u0442 \u043A\u043E\u043D\u0435\u0446\u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043A\u043B\u0438\u0435\u043D\u0442 \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0441\u0435\u0440\u0432\u0435\u0440 \u043D\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0435 \u043D\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0435\u043D\u0430\u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043D\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0435\u043D\u0430\u0441\u0435\u0440\u0432\u0435\u0440\u0435\u0431\u0435\u0437\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430 \u043D\u0430\u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043D\u0430\u0441\u0435\u0440\u0432\u0435\u0440\u0435\u0431\u0435\u0437\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430 \u043E\u0431\u043B\u0430\u0441\u0442\u044C \u043F\u0435\u0440\u0435\u0434 \u043F\u043E\u0441\u043B\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0442\u043E\u043B\u0441\u0442\u044B\u0439\u043A\u043B\u0438\u0435\u043D\u0442\u043E\u0431\u044B\u0447\u043D\u043E\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0442\u043E\u043B\u0441\u0442\u044B\u0439\u043A\u043B\u0438\u0435\u043D\u0442\u0443\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u043C\u043E\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0442\u043E\u043D\u043A\u0438\u0439\u043A\u043B\u0438\u0435\u043D\u0442 ",a=s+o,c="\u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0440\u0430\u043D\u0438\u0446 \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0440\u043E\u043A \u0441\u0438\u043C\u0432\u043E\u043B\u0442\u0430\u0431\u0443\u043B\u044F\u0446\u0438\u0438 ",u="ansitooem oemtoansi \u0432\u0432\u0435\u0441\u0442\u0438\u0432\u0438\u0434\u0441\u0443\u0431\u043A\u043E\u043D\u0442\u043E \u0432\u0432\u0435\u0441\u0442\u0438\u043F\u0435\u0440\u0435\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u0435 \u0432\u0432\u0435\u0441\u0442\u0438\u043F\u0435\u0440\u0438\u043E\u0434 \u0432\u0432\u0435\u0441\u0442\u0438\u043F\u043B\u0430\u043D\u0441\u0447\u0435\u0442\u043E\u0432 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439\u043F\u043B\u0430\u043D\u0441\u0447\u0435\u0442\u043E\u0432 \u0434\u0430\u0442\u0430\u0433\u043E\u0434 \u0434\u0430\u0442\u0430\u043C\u0435\u0441\u044F\u0446 \u0434\u0430\u0442\u0430\u0447\u0438\u0441\u043B\u043E \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0432\u0441\u0442\u0440\u043E\u043A\u0443 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0438\u0437\u0441\u0442\u0440\u043E\u043A\u0438 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0438\u0431 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043A\u043E\u0434\u0441\u0438\u043C\u0432 \u043A\u043E\u043D\u0433\u043E\u0434\u0430 \u043A\u043E\u043D\u0435\u0446\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u0431\u0438 \u043A\u043E\u043D\u0435\u0446\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043D\u043D\u043E\u0433\u043E\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u0431\u0438 \u043A\u043E\u043D\u0435\u0446\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B\u0430 \u043A\u043E\u043D\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0430 \u043A\u043E\u043D\u043C\u0435\u0441\u044F\u0446\u0430 \u043A\u043E\u043D\u043D\u0435\u0434\u0435\u043B\u0438 \u043B\u043E\u0433 \u043B\u043E\u043310 \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\u0441\u0443\u0431\u043A\u043E\u043D\u0442\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435\u043D\u0430\u0431\u043E\u0440\u0430\u043F\u0440\u0430\u0432 \u043D\u0430\u0437\u043D\u0430\u0447\u0438\u0442\u044C\u0432\u0438\u0434 \u043D\u0430\u0437\u043D\u0430\u0447\u0438\u0442\u044C\u0441\u0447\u0435\u0442 \u043D\u0430\u0439\u0442\u0438\u0441\u0441\u044B\u043B\u043A\u0438 \u043D\u0430\u0447\u0430\u043B\u043E\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u0431\u0438 \u043D\u0430\u0447\u0430\u043B\u043E\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B\u0430 \u043D\u0430\u0447\u0433\u043E\u0434\u0430 \u043D\u0430\u0447\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0430 \u043D\u0430\u0447\u043C\u0435\u0441\u044F\u0446\u0430 \u043D\u0430\u0447\u043D\u0435\u0434\u0435\u043B\u0438 \u043D\u043E\u043C\u0435\u0440\u0434\u043D\u044F\u0433\u043E\u0434\u0430 \u043D\u043E\u043C\u0435\u0440\u0434\u043D\u044F\u043D\u0435\u0434\u0435\u043B\u0438 \u043D\u043E\u043C\u0435\u0440\u043D\u0435\u0434\u0435\u043B\u0438\u0433\u043E\u0434\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0439\u0436\u0443\u0440\u043D\u0430\u043B\u0440\u0430\u0441\u0447\u0435\u0442\u043E\u0432 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0439\u043F\u043B\u0430\u043D\u0441\u0447\u0435\u0442\u043E\u0432 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0439\u044F\u0437\u044B\u043A \u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C\u043E\u043A\u043D\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439 \u043F\u0435\u0440\u0438\u043E\u0434\u0441\u0442\u0440 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u0430\u0442\u0443\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u043E\u0442\u0431\u043E\u0440\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u043E\u0437\u0438\u0446\u0438\u044E\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u0443\u0441\u0442\u043E\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0442\u0430 \u043F\u0440\u0435\u0444\u0438\u043A\u0441\u0430\u0432\u0442\u043E\u043D\u0443\u043C\u0435\u0440\u0430\u0446\u0438\u0438 \u043F\u0440\u043E\u043F\u0438\u0441\u044C \u043F\u0443\u0441\u0442\u043E\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u043C \u0440\u0430\u0437\u043E\u0431\u0440\u0430\u0442\u044C\u043F\u043E\u0437\u0438\u0446\u0438\u044E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044C\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u043D\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044C\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u043F\u043E \u0441\u0438\u043C\u0432 \u0441\u043E\u0437\u0434\u0430\u0442\u044C\u043E\u0431\u044A\u0435\u043A\u0442 \u0441\u0442\u0430\u0442\u0443\u0441\u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0430 \u0441\u0442\u0440\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\u0441\u0442\u0440\u043E\u043A \u0441\u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u043F\u043E\u0437\u0438\u0446\u0438\u044E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0441\u0447\u0435\u0442\u043F\u043E\u043A\u043E\u0434\u0443 \u0442\u0435\u043A\u0443\u0449\u0435\u0435\u0432\u0440\u0435\u043C\u044F \u0442\u0438\u043F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0442\u0438\u043F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0441\u0442\u0440 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0442\u0430\u043D\u0430 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0442\u0430\u043F\u043E \u0444\u0438\u043A\u0441\u0448\u0430\u0431\u043B\u043E\u043D \u0448\u0430\u0431\u043B\u043E\u043D ",l="acos asin atan base64\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 base64\u0441\u0442\u0440\u043E\u043A\u0430 cos exp log log10 pow sin sqrt tan xml\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 xml\u0441\u0442\u0440\u043E\u043A\u0430 xml\u0442\u0438\u043F xml\u0442\u0438\u043F\u0437\u043D\u0447 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0435\u043E\u043A\u043D\u043E \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0434\u0430\u043D\u043D\u044B\u0445 \u0431\u0443\u043B\u0435\u0432\u043E \u0432\u0432\u0435\u0441\u0442\u0438\u0434\u0430\u0442\u0443 \u0432\u0432\u0435\u0441\u0442\u0438\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432\u0432\u0435\u0441\u0442\u0438\u0441\u0442\u0440\u043E\u043A\u0443 \u0432\u0432\u0435\u0441\u0442\u0438\u0447\u0438\u0441\u043B\u043E \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044C\u0447\u0442\u0435\u043D\u0438\u044Fxml \u0432\u043E\u043F\u0440\u043E\u0441 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432\u0440\u0435\u0433 \u0432\u044B\u0433\u0440\u0443\u0437\u0438\u0442\u044C\u0436\u0443\u0440\u043D\u0430\u043B\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u044F \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C\u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443\u043F\u0440\u0430\u0432\u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u0432\u044B\u0447\u0438\u0441\u043B\u0438\u0442\u044C \u0433\u043E\u0434 \u0434\u0430\u043D\u043D\u044B\u0435\u0444\u043E\u0440\u043C\u044B\u0432\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u0430\u0442\u0430 \u0434\u0435\u043D\u044C \u0434\u0435\u043D\u044C\u0433\u043E\u0434\u0430 \u0434\u0435\u043D\u044C\u043D\u0435\u0434\u0435\u043B\u0438 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C\u043C\u0435\u0441\u044F\u0446 \u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0434\u0430\u043D\u043D\u044B\u0435\u0434\u043B\u044F\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0440\u0430\u0431\u043E\u0442\u0443\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C\u0440\u0430\u0431\u043E\u0442\u0443\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C\u0432\u043D\u0435\u0448\u043D\u044E\u044E\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u0443 \u0437\u0430\u043A\u0440\u044B\u0442\u044C\u0441\u043F\u0440\u0430\u0432\u043A\u0443 \u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044Cjson \u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044Cxml \u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044C\u0434\u0430\u0442\u0443json \u0437\u0430\u043F\u0438\u0441\u044C\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0441\u0432\u043E\u0439\u0441\u0442\u0432 \u0437\u0430\u043F\u0440\u043E\u0441\u0438\u0442\u044C\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C\u0441\u0438\u0441\u0442\u0435\u043C\u0443 \u0437\u0430\u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0432\u0434\u0430\u043D\u043D\u044B\u0435\u0444\u043E\u0440\u043C\u044B \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0432\u0441\u0442\u0440\u043E\u043A\u0443\u0432\u043D\u0443\u0442\u0440 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0432\u0444\u0430\u0439\u043B \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0438\u0437\u0441\u0442\u0440\u043E\u043A\u0438\u0432\u043D\u0443\u0442\u0440 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0438\u0437\u0444\u0430\u0439\u043B\u0430 \u0438\u0437xml\u0442\u0438\u043F\u0430 \u0438\u043C\u043F\u043E\u0440\u0442\u043C\u043E\u0434\u0435\u043B\u0438xdto \u0438\u043C\u044F\u043A\u043E\u043C\u043F\u044C\u044E\u0442\u0435\u0440\u0430 \u0438\u043C\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0435\u0434\u0430\u043D\u043D\u044B\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F\u043E\u0431\u043E\u0448\u0438\u0431\u043A\u0435 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0438\u043C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0433\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0430 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0445\u0444\u0430\u0439\u043B\u043E\u0432 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u0442\u0440\u043E\u043A\u0443 \u043A\u043E\u0434\u043B\u043E\u043A\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043A\u043E\u0434\u0441\u0438\u043C\u0432\u043E\u043B\u0430 \u043A\u043E\u043C\u0430\u043D\u0434\u0430\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u043A\u043E\u043D\u0435\u0446\u0433\u043E\u0434\u0430 \u043A\u043E\u043D\u0435\u0446\u0434\u043D\u044F \u043A\u043E\u043D\u0435\u0446\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0430 \u043A\u043E\u043D\u0435\u0446\u043C\u0435\u0441\u044F\u0446\u0430 \u043A\u043E\u043D\u0435\u0446\u043C\u0438\u043D\u0443\u0442\u044B \u043A\u043E\u043D\u0435\u0446\u043D\u0435\u0434\u0435\u043B\u0438 \u043A\u043E\u043D\u0435\u0446\u0447\u0430\u0441\u0430 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044F\u0431\u0430\u0437\u044B\u0434\u0430\u043D\u043D\u044B\u0445\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0430\u0434\u0438\u043D\u0430\u043C\u0438\u0447\u0435\u0441\u043A\u0438 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044F\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0430 \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0434\u0430\u043D\u043D\u044B\u0435\u0444\u043E\u0440\u043C\u044B \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0444\u0430\u0439\u043B \u043A\u0440\u0430\u0442\u043A\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043E\u0448\u0438\u0431\u043A\u0438 \u043B\u0435\u0432 \u043C\u0430\u043A\u0441 \u043C\u0435\u0441\u0442\u043D\u043E\u0435\u0432\u0440\u0435\u043C\u044F \u043C\u0435\u0441\u044F\u0446 \u043C\u0438\u043D \u043C\u0438\u043D\u0443\u0442\u0430 \u043C\u043E\u043D\u043E\u043F\u043E\u043B\u044C\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u043D\u0430\u0439\u0442\u0438 \u043D\u0430\u0439\u0442\u0438\u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435\u0441\u0438\u043C\u0432\u043E\u043B\u044Bxml \u043D\u0430\u0439\u0442\u0438\u043E\u043A\u043D\u043E\u043F\u043E\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0441\u0441\u044B\u043B\u043A\u0435 \u043D\u0430\u0439\u0442\u0438\u043F\u043E\u043C\u0435\u0447\u0435\u043D\u043D\u044B\u0435\u043D\u0430\u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u043D\u0430\u0439\u0442\u0438\u043F\u043E\u0441\u0441\u044B\u043B\u043A\u0430\u043C \u043D\u0430\u0439\u0442\u0438\u0444\u0430\u0439\u043B\u044B \u043D\u0430\u0447\u0430\u043B\u043E\u0433\u043E\u0434\u0430 \u043D\u0430\u0447\u0430\u043B\u043E\u0434\u043D\u044F \u043D\u0430\u0447\u0430\u043B\u043E\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0430 \u043D\u0430\u0447\u0430\u043B\u043E\u043C\u0435\u0441\u044F\u0446\u0430 \u043D\u0430\u0447\u0430\u043B\u043E\u043C\u0438\u043D\u0443\u0442\u044B \u043D\u0430\u0447\u0430\u043B\u043E\u043D\u0435\u0434\u0435\u043B\u0438 \u043D\u0430\u0447\u0430\u043B\u043E\u0447\u0430\u0441\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u0437\u0430\u043F\u0440\u043E\u0441\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043D\u0430\u0447\u0430\u0442\u044C\u0437\u0430\u043F\u0443\u0441\u043A\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043D\u0430\u0447\u0430\u0442\u044C\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u0432\u043D\u0435\u0448\u043D\u0435\u0439\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u044B \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0435\u0439 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u0444\u0430\u0439\u043B\u0430\u043C\u0438 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u0438\u0441\u043A\u0444\u0430\u0439\u043B\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0445\u0444\u0430\u0439\u043B\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u043F\u043E\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435\u0434\u0432\u043E\u0438\u0447\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445\u0438\u0437\u0444\u0430\u0439\u043B\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430 \u043D\u0430\u0447\u0430\u0442\u044C\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044E \u043D\u0430\u0447\u0430\u0442\u044C\u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0435\u0444\u0430\u0439\u043B\u043E\u0432 \u043D\u0430\u0447\u0430\u0442\u044C\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443\u0432\u043D\u0435\u0448\u043D\u0435\u0439\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u044B \u043D\u0430\u0447\u0430\u0442\u044C\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0435\u0439 \u043D\u0430\u0447\u0430\u0442\u044C\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u0444\u0430\u0439\u043B\u0430\u043C\u0438 \u043D\u0435\u0434\u0435\u043B\u044F\u0433\u043E\u0434\u0430 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E\u0441\u0442\u044C\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F \u043D\u043E\u043C\u0435\u0440\u0441\u0435\u0430\u043D\u0441\u0430\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043D\u043E\u043C\u0435\u0440\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043D\u0440\u0435\u0433 \u043D\u0441\u0442\u0440 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C\u043D\u0443\u043C\u0435\u0440\u0430\u0446\u0438\u044E\u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C\u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u043C\u044B\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u043F\u0440\u0435\u0440\u044B\u0432\u0430\u043D\u0438\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0438\u0442\u044C\u0444\u0430\u0439\u043B\u044B \u043E\u043A\u0440 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u043E\u0448\u0438\u0431\u043A\u0438 \u043E\u043F\u043E\u0432\u0435\u0441\u0442\u0438\u0442\u044C \u043E\u043F\u043E\u0432\u0435\u0441\u0442\u0438\u0442\u044C\u043E\u0431\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u0437\u0430\u043F\u0440\u043E\u0441\u0430\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u043E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u044F \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0438\u043D\u0434\u0435\u043A\u0441\u0441\u043F\u0440\u0430\u0432\u043A\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0441\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435\u0441\u043F\u0440\u0430\u0432\u043A\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0441\u043F\u0440\u0430\u0432\u043A\u0443 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0444\u043E\u0440\u043C\u0443 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\u0444\u043E\u0440\u043C\u0443\u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E \u043E\u0442\u043C\u0435\u043D\u0438\u0442\u044C\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044E \u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C\u0436\u0443\u0440\u043D\u0430\u043B\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u043F\u0435\u0440\u0435\u0439\u0442\u0438\u043F\u043E\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0441\u0441\u044B\u043B\u043A\u0435 \u043F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0444\u0430\u0439\u043B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0432\u043D\u0435\u0448\u043D\u044E\u044E\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u0443 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u0437\u0430\u043F\u0440\u043E\u0441\u0430\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u044F \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0435\u0439 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u0444\u0430\u0439\u043B\u0430\u043C\u0438 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043E\u0448\u0438\u0431\u043A\u0438 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0432\u0432\u043E\u0434\u0434\u0430\u0442\u044B \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0432\u0432\u043E\u0434\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0432\u0432\u043E\u0434\u0441\u0442\u0440\u043E\u043A\u0438 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0432\u0432\u043E\u0434\u0447\u0438\u0441\u043B\u0430 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0432\u043E\u043F\u0440\u043E\u0441 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E\u043E\u0431\u043E\u0448\u0438\u0431\u043A\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u043D\u0430\u043A\u0430\u0440\u0442\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 \u043F\u043E\u043B\u043D\u043E\u0435\u0438\u043C\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044Ccom\u043E\u0431\u044A\u0435\u043A\u0442 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044Cxml\u0442\u0438\u043F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0430\u0434\u0440\u0435\u0441\u043F\u043E\u043C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u044E \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0443\u0441\u0435\u0430\u043D\u0441\u043E\u0432 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F\u0441\u043F\u044F\u0449\u0435\u0433\u043E\u0441\u0435\u0430\u043D\u0441\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u0437\u0430\u0441\u044B\u043F\u0430\u043D\u0438\u044F\u043F\u0430\u0441\u0441\u0438\u0432\u043D\u043E\u0433\u043E\u0441\u0435\u0430\u043D\u0441\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u0430\u043D\u043D\u044B\u0435\u0432\u044B\u0431\u043E\u0440\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435\u043A\u043E\u0434\u044B\u043B\u043E\u043A\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435\u0447\u0430\u0441\u043E\u0432\u044B\u0435\u043F\u043E\u044F\u0441\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u043E\u0442\u0431\u043E\u0440\u0430\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u0437\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0433\u043E\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u043C\u044F\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0433\u043E\u0444\u0430\u0439\u043B\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u043C\u044F\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E\u044D\u043A\u0440\u0430\u043D\u043E\u0432\u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043A\u0440\u0430\u0442\u043A\u0438\u0439\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0430\u043A\u0435\u0442\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0430\u0441\u043A\u0443\u0432\u0441\u0435\u0444\u0430\u0439\u043B\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0430\u0441\u043A\u0443\u0432\u0441\u0435\u0444\u0430\u0439\u043B\u044B\u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0430\u0441\u043A\u0443\u0432\u0441\u0435\u0444\u0430\u0439\u043B\u044B\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u0430\u0434\u0440\u0435\u0441\u0443 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u0443\u044E\u0434\u043B\u0438\u043D\u0443\u043F\u0430\u0440\u043E\u043B\u0435\u0439\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043E\u043D\u043D\u0443\u044E\u0441\u0441\u044B\u043B\u043A\u0443 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043E\u043D\u043D\u0443\u044E\u0441\u0441\u044B\u043B\u043A\u0443\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u0431\u0430\u0437\u044B\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u0431\u0449\u0438\u0439\u043C\u0430\u043A\u0435\u0442 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u0431\u0449\u0443\u044E\u0444\u043E\u0440\u043C\u0443 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u043A\u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\u0443\u044E\u043E\u0442\u043C\u0435\u0442\u043A\u0443\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0433\u043E\u0440\u0435\u0436\u0438\u043C\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445\u043E\u043F\u0446\u0438\u0439\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u043E\u043B\u043D\u043E\u0435\u0438\u043C\u044F\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u043E\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445\u0441\u0441\u044B\u043B\u043E\u043A \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443\u0441\u043B\u043E\u0436\u043D\u043E\u0441\u0442\u0438\u043F\u0430\u0440\u043E\u043B\u0435\u0439\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u043F\u0443\u0442\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u043F\u0443\u0442\u0438\u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C\u043F\u0443\u0442\u0438\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u0435\u0430\u043D\u0441\u044B\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044E \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435\u043E\u0431\u044A\u0435\u043A\u0442\u0430\u0438\u0444\u043E\u0440\u043C\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u043E\u0441\u0442\u0430\u0432\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430odata \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0443\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F\u0431\u0430\u0437\u044B\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0442\u0435\u043A\u0443\u0449\u0438\u0439\u0441\u0435\u0430\u043D\u0441\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0444\u0430\u0439\u043B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0444\u0430\u0439\u043B\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0444\u043E\u0440\u043C\u0443 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u0443\u044E\u043E\u043F\u0446\u0438\u044E \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u0443\u044E\u043E\u043F\u0446\u0438\u044E\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0447\u0430\u0441\u043E\u0432\u043E\u0439\u043F\u043E\u044F\u0441\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438\u043E\u0441 \u043F\u043E\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0432\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0435\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435 \u043F\u043E\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0444\u0430\u0439\u043B \u043F\u043E\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0444\u0430\u0439\u043B\u044B \u043F\u0440\u0430\u0432 \u043F\u0440\u0430\u0432\u043E\u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u043E\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043A\u043E\u0434\u0430\u043B\u043E\u043A\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0435\u0440\u0438\u043E\u0434\u0430 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0430\u0432\u0430 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0447\u0430\u0441\u043E\u0432\u043E\u0433\u043E\u043F\u043E\u044F\u0441\u0430 \u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 \u043F\u0440\u0435\u043A\u0440\u0430\u0442\u0438\u0442\u044C\u0440\u0430\u0431\u043E\u0442\u0443\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C\u0432\u044B\u0437\u043E\u0432 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044Cjson \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044Cxml \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C\u0434\u0430\u0442\u0443json \u043F\u0443\u0441\u0442\u0430\u044F\u0441\u0442\u0440\u043E\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0439\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0440\u0430\u0437\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0434\u0430\u043D\u043D\u044B\u0435\u0434\u043B\u044F\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C\u0444\u0430\u0439\u043B \u0440\u0430\u0437\u043E\u0440\u0432\u0430\u0442\u044C\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435\u0441\u0432\u043D\u0435\u0448\u043D\u0438\u043C\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u043C\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u0442\u0440\u043E\u043A\u0443 \u0440\u043E\u043B\u044C\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0441\u0435\u043A\u0443\u043D\u0434\u0430 \u0441\u0438\u0433\u043D\u0430\u043B \u0441\u0438\u043C\u0432\u043E\u043B \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0436\u0443\u0440\u043D\u0430\u043B\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u043B\u0435\u0442\u043D\u0435\u0433\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C\u0431\u0443\u0444\u0435\u0440\u044B\u0434\u0432\u043E\u0438\u0447\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u0437\u0434\u0430\u0442\u044C\u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u0441\u043E\u0437\u0434\u0430\u0442\u044C\u0444\u0430\u0431\u0440\u0438\u043A\u0443xdto \u0441\u043E\u043A\u0440\u043B \u0441\u043E\u043A\u0440\u043B\u043F \u0441\u043E\u043A\u0440\u043F \u0441\u043E\u043E\u0431\u0449\u0438\u0442\u044C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0441\u0440\u0435\u0434 \u0441\u0442\u0440\u0434\u043B\u0438\u043D\u0430 \u0441\u0442\u0440\u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F\u043D\u0430 \u0441\u0442\u0440\u0437\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0442\u0440\u043D\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F\u0441 \u0441\u0442\u0440\u043E\u043A\u0430 \u0441\u0442\u0440\u043E\u043A\u0430\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u0441\u0442\u0440\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0441\u0442\u0440\u043E\u043A\u0443 \u0441\u0442\u0440\u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u0441\u0442\u0440\u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0441\u0442\u0440\u0441\u0440\u0430\u0432\u043D\u0438\u0442\u044C \u0441\u0442\u0440\u0447\u0438\u0441\u043B\u043E\u0432\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0439 \u0441\u0442\u0440\u0447\u0438\u0441\u043B\u043E\u0441\u0442\u0440\u043E\u043A \u0441\u0442\u0440\u0448\u0430\u0431\u043B\u043E\u043D \u0442\u0435\u043A\u0443\u0449\u0430\u044F\u0434\u0430\u0442\u0430 \u0442\u0435\u043A\u0443\u0449\u0430\u044F\u0434\u0430\u0442\u0430\u0441\u0435\u0430\u043D\u0441\u0430 \u0442\u0435\u043A\u0443\u0449\u0430\u044F\u0443\u043D\u0438\u0432\u0435\u0440\u0441\u0430\u043B\u044C\u043D\u0430\u044F\u0434\u0430\u0442\u0430 \u0442\u0435\u043A\u0443\u0449\u0430\u044F\u0443\u043D\u0438\u0432\u0435\u0440\u0441\u0430\u043B\u044C\u043D\u0430\u044F\u0434\u0430\u0442\u0430\u0432\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430\u0445 \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E\u0448\u0440\u0438\u0444\u0442\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u043A\u043E\u0434\u043B\u043E\u043A\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u0440\u0435\u0436\u0438\u043C\u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u044F\u0437\u044B\u043A \u0442\u0435\u043A\u0443\u0449\u0438\u0439\u044F\u0437\u044B\u043A\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u0442\u0438\u043F \u0442\u0438\u043F\u0437\u043D\u0447 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044F\u0430\u043A\u0442\u0438\u0432\u043D\u0430 \u0442\u0440\u0435\u0433 \u0443\u0434\u0430\u043B\u0438\u0442\u044C\u0434\u0430\u043D\u043D\u044B\u0435\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u0443\u0434\u0430\u043B\u0438\u0442\u044C\u0438\u0437\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0433\u043E\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430 \u0443\u0434\u0430\u043B\u0438\u0442\u044C\u043E\u0431\u044A\u0435\u043A\u0442\u044B \u0443\u0434\u0430\u043B\u0438\u0442\u044C\u0444\u0430\u0439\u043B\u044B \u0443\u043D\u0438\u0432\u0435\u0440\u0441\u0430\u043B\u044C\u043D\u043E\u0435\u0432\u0440\u0435\u043C\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0434\u0430\u043D\u043D\u044B\u0445 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0443\u0441\u0435\u0430\u043D\u0441\u043E\u0432 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0432\u043D\u0435\u0448\u043D\u044E\u044E\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u0443 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F\u0441\u043F\u044F\u0449\u0435\u0433\u043E\u0441\u0435\u0430\u043D\u0441\u0430 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u0437\u0430\u0441\u044B\u043F\u0430\u043D\u0438\u044F\u043F\u0430\u0441\u0441\u0438\u0432\u043D\u043E\u0433\u043E\u0441\u0435\u0430\u043D\u0441\u0430 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0432\u0440\u0435\u043C\u044F\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u0441\u0438\u0441\u0442\u0435\u043C\u044B \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043A\u0440\u0430\u0442\u043A\u0438\u0439\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u0443\u044E\u0434\u043B\u0438\u043D\u0443\u043F\u0430\u0440\u043E\u043B\u0435\u0439\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043C\u043E\u043D\u043E\u043F\u043E\u043B\u044C\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0433\u043E\u0440\u0435\u0436\u0438\u043C\u0430 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445\u043E\u043F\u0446\u0438\u0439\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443\u0441\u043B\u043E\u0436\u043D\u043E\u0441\u0442\u0438\u043F\u0430\u0440\u043E\u043B\u0435\u0439\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0435\u0439 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0442\u044B\u0441\u0444\u0430\u0439\u043B\u0430\u043C\u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435\u0441\u0432\u043D\u0435\u0448\u043D\u0438\u043C\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u043C\u0434\u0430\u043D\u043D\u044B\u0445 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435\u043E\u0431\u044A\u0435\u043A\u0442\u0430\u0438\u0444\u043E\u0440\u043C\u044B \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0441\u043E\u0441\u0442\u0430\u0432\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430odata \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0447\u0430\u0441\u043E\u0432\u043E\u0439\u043F\u043E\u044F\u0441\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C\u0447\u0430\u0441\u043E\u0432\u043E\u0439\u043F\u043E\u044F\u0441\u0441\u0435\u0430\u043D\u0441\u0430 \u0444\u043E\u0440\u043C\u0430\u0442 \u0446\u0435\u043B \u0447\u0430\u0441 \u0447\u0430\u0441\u043E\u0432\u043E\u0439\u043F\u043E\u044F\u0441 \u0447\u0430\u0441\u043E\u0432\u043E\u0439\u043F\u043E\u044F\u0441\u0441\u0435\u0430\u043D\u0441\u0430 \u0447\u0438\u0441\u043B\u043E \u0447\u0438\u0441\u043B\u043E\u043F\u0440\u043E\u043F\u0438\u0441\u044C\u044E \u044D\u0442\u043E\u0430\u0434\u0440\u0435\u0441\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0433\u043E\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430 ",d="ws\u0441\u0441\u044B\u043B\u043A\u0438 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430\u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430\u043C\u0430\u043A\u0435\u0442\u043E\u0432\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430\u0441\u0442\u0438\u043B\u0435\u0439 \u0431\u0438\u0437\u043D\u0435\u0441\u043F\u0440\u043E\u0446\u0435\u0441\u0441\u044B \u0432\u043D\u0435\u0448\u043D\u0438\u0435\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0432\u043D\u0435\u0448\u043D\u0438\u0435\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438 \u0432\u043D\u0435\u0448\u043D\u0438\u0435\u043E\u0442\u0447\u0435\u0442\u044B \u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u044B\u0435\u043F\u043E\u043A\u0443\u043F\u043A\u0438 \u0433\u043B\u0430\u0432\u043D\u044B\u0439\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0433\u043B\u0430\u0432\u043D\u044B\u0439\u0441\u0442\u0438\u043B\u044C \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u044B \u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u043C\u044B\u0435\u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F \u0436\u0443\u0440\u043D\u0430\u043B\u044B\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F\u043E\u0431\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0430\u0431\u043E\u0447\u0435\u0439\u0434\u0430\u0442\u044B \u0438\u0441\u0442\u043E\u0440\u0438\u044F\u0440\u0430\u0431\u043E\u0442\u044B\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043A\u043E\u043D\u0441\u0442\u0430\u043D\u0442\u044B \u043A\u0440\u0438\u0442\u0435\u0440\u0438\u0438\u043E\u0442\u0431\u043E\u0440\u0430 \u043C\u0435\u0442\u0430\u0434\u0430\u043D\u043D\u044B\u0435 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0440\u0435\u043A\u043B\u0430\u043C\u044B \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0430\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u043C\u044B\u0445\u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0439 \u043E\u0442\u0447\u0435\u0442\u044B \u043F\u0430\u043D\u0435\u043B\u044C\u0437\u0430\u0434\u0430\u0447\u043E\u0441 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0441\u0435\u0430\u043D\u0441\u0430 \u043F\u0435\u0440\u0435\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u044F \u043F\u043B\u0430\u043D\u044B\u0432\u0438\u0434\u043E\u0432\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043F\u043B\u0430\u043D\u044B\u0432\u0438\u0434\u043E\u0432\u0445\u0430\u0440\u0430\u043A\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043A \u043F\u043B\u0430\u043D\u044B\u043E\u0431\u043C\u0435\u043D\u0430 \u043F\u043B\u0430\u043D\u044B\u0441\u0447\u0435\u0442\u043E\u0432 \u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0439\u043F\u043E\u0438\u0441\u043A \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439\u0431\u0430\u0437\u044B \u043F\u043E\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430\u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u044B\u0445\u043F\u043E\u043A\u0443\u043F\u043E\u043A \u0440\u0430\u0431\u043E\u0447\u0430\u044F\u0434\u0430\u0442\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u0431\u0443\u0445\u0433\u0430\u043B\u0442\u0435\u0440\u0438\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044B\u0441\u0432\u0435\u0434\u0435\u043D\u0438\u0439 \u0440\u0435\u0433\u043B\u0430\u043C\u0435\u043D\u0442\u043D\u044B\u0435\u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0441\u0435\u0440\u0438\u0430\u043B\u0438\u0437\u0430\u0442\u043E\u0440xdto \u0441\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u0433\u0435\u043E\u043F\u043E\u0437\u0438\u0446\u0438\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043C\u0443\u043B\u044C\u0442\u0438\u043C\u0435\u0434\u0438\u0430 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0440\u0435\u043A\u043B\u0430\u043C\u044B \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043F\u043E\u0447\u0442\u044B \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0438\u0438 \u0444\u0430\u0431\u0440\u0438\u043A\u0430xdto \u0444\u0430\u0439\u043B\u043E\u0432\u044B\u0435\u043F\u043E\u0442\u043E\u043A\u0438 \u0444\u043E\u043D\u043E\u0432\u044B\u0435\u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0432\u043E\u0442\u0447\u0435\u0442\u043E\u0432 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u0434\u0430\u043D\u043D\u044B\u0445\u0444\u043E\u0440\u043C \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u043E\u0431\u0449\u0438\u0445\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u0434\u0438\u043D\u0430\u043C\u0438\u0447\u0435\u0441\u043A\u0438\u0445\u0441\u043F\u0438\u0441\u043A\u043E\u0432 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043E\u0442\u0447\u0435\u0442\u043E\u0432 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u0441\u0438\u0441\u0442\u0435\u043C\u043D\u044B\u0445\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A ",m=c+u+l+d,h="web\u0446\u0432\u0435\u0442\u0430 windows\u0446\u0432\u0435\u0442\u0430 windows\u0448\u0440\u0438\u0444\u0442\u044B \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430\u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u0440\u0430\u043C\u043A\u0438\u0441\u0442\u0438\u043B\u044F \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u0446\u0432\u0435\u0442\u0430\u0441\u0442\u0438\u043B\u044F \u0448\u0440\u0438\u0444\u0442\u044B\u0441\u0442\u0438\u043B\u044F ",f="\u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0435\u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445\u0444\u043E\u0440\u043C\u044B\u0432\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u0430\u0432\u0442\u043E\u043D\u0443\u043C\u0435\u0440\u0430\u0446\u0438\u044F\u0432\u0444\u043E\u0440\u043C\u0435 \u0430\u0432\u0442\u043E\u0440\u0430\u0437\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u0435\u0441\u0435\u0440\u0438\u0439 \u0430\u043D\u0438\u043C\u0430\u0446\u0438\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0432\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u044F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u0438\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u043E\u0432 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u0432\u044B\u0441\u043E\u0442\u043E\u0439\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u0430\u044F\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0430\u0444\u043E\u0440\u043C\u044B \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0435\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0435\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u0432\u0438\u0434\u0433\u0440\u0443\u043F\u043F\u044B\u0444\u043E\u0440\u043C\u044B \u0432\u0438\u0434\u0434\u0435\u043A\u043E\u0440\u0430\u0446\u0438\u0438\u0444\u043E\u0440\u043C\u044B \u0432\u0438\u0434\u0434\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0444\u043E\u0440\u043C\u044B \u0432\u0438\u0434\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u0434\u0430\u043D\u043D\u044B\u0445 \u0432\u0438\u0434\u043A\u043D\u043E\u043F\u043A\u0438\u0444\u043E\u0440\u043C\u044B \u0432\u0438\u0434\u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0442\u0435\u043B\u044F \u0432\u0438\u0434\u043F\u043E\u0434\u043F\u0438\u0441\u0435\u0439\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0435 \u0432\u0438\u0434\u043F\u043E\u043B\u044F\u0444\u043E\u0440\u043C\u044B \u0432\u0438\u0434\u0444\u043B\u0430\u0436\u043A\u0430 \u0432\u043B\u0438\u044F\u043D\u0438\u0435\u0440\u0430\u0437\u043C\u0435\u0440\u0430\u043D\u0430\u043F\u0443\u0437\u044B\u0440\u0435\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0435\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0435\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0430\u043A\u043E\u043B\u043E\u043D\u043E\u043A \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0430\u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u043D\u044B\u0445\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u0444\u043E\u0440\u043C\u044B \u0433\u0440\u0443\u043F\u043F\u044B\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u043D\u0438\u044F \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439\u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F\u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u043D\u0438\u044F \u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B\u043C\u0435\u0436\u0434\u0443\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043C\u0438\u0444\u043E\u0440\u043C\u044B \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0432\u044B\u0432\u043E\u0434\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043F\u043E\u043B\u043E\u0441\u044B\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u043C\u043E\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0442\u043E\u0447\u043A\u0438\u0431\u0438\u0440\u0436\u0435\u0432\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0438\u0441\u0442\u043E\u0440\u0438\u044F\u0432\u044B\u0431\u043E\u0440\u0430\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u043E\u0441\u0438\u0442\u043E\u0447\u0435\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0440\u0430\u0437\u043C\u0435\u0440\u0430\u043F\u0443\u0437\u044B\u0440\u044C\u043A\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F\u0433\u0440\u0443\u043F\u043F\u044B\u043A\u043E\u043C\u0430\u043D\u0434 \u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C\u0441\u0435\u0440\u0438\u0439 \u043D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0435\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0434\u0435\u0440\u0435\u0432\u0430 \u043D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0435\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0441\u043F\u0438\u0441\u043A\u0430 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u0434\u0435\u043D\u0434\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u043C\u0435\u0442\u043E\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u043C\u0435\u0442\u043E\u043A\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0444\u043E\u0440\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0432\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0435 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0432\u043B\u0435\u0433\u0435\u043D\u0434\u0435\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0433\u0440\u0443\u043F\u043F\u044B\u043A\u043D\u043E\u043F\u043E\u043A \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u0448\u043A\u0430\u043B\u044B\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0438\u0437\u043C\u0435\u0440\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u0433\u0430\u043D\u0442\u0430 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043A\u043D\u043E\u043F\u043A\u0438 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043A\u043D\u043E\u043F\u043A\u0438\u0432\u044B\u0431\u043E\u0440\u0430 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043E\u0431\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439\u0444\u043E\u0440\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043E\u0431\u044B\u0447\u043D\u043E\u0439\u0433\u0440\u0443\u043F\u043F\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043E\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043B\u044C\u043D\u044B\u0445\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u043F\u0443\u0437\u044B\u0440\u044C\u043A\u043E\u0432\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043F\u0430\u043D\u0435\u043B\u0438\u043F\u043E\u0438\u0441\u043A\u0430 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0438 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u044F\u043F\u0440\u0438\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0438 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0438\u043F\u043E\u043B\u043E\u0441\u044B\u0440\u0435\u0433\u0443\u043B\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0444\u043E\u0440\u043C\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u0433\u0430\u043D\u0442\u0430 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043E\u0431\u044B\u0447\u043D\u043E\u0439\u0433\u0440\u0443\u043F\u043F\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0444\u0438\u0433\u0443\u0440\u044B\u043A\u043D\u043E\u043F\u043A\u0438 \u043F\u0430\u043B\u0438\u0442\u0440\u0430\u0446\u0432\u0435\u0442\u043E\u0432\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435\u043E\u0431\u044B\u0447\u043D\u043E\u0439\u0433\u0440\u0443\u043F\u043F\u044B \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0434\u0435\u043D\u0434\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u0433\u0430\u043D\u0442\u0430 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043F\u043E\u0438\u0441\u043A\u0432\u0442\u0430\u0431\u043B\u0438\u0446\u0435\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0444\u043E\u0440\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438\u043A\u043D\u043E\u043F\u043A\u0438\u0444\u043E\u0440\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043A\u043E\u043C\u0430\u043D\u0434\u043D\u043E\u0439\u043F\u0430\u043D\u0435\u043B\u0438\u0444\u043E\u0440\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043A\u043E\u043C\u0430\u043D\u0434\u043D\u043E\u0439\u043F\u0430\u043D\u0435\u043B\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0444\u043E\u0440\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043E\u043F\u043E\u0440\u043D\u043E\u0439\u0442\u043E\u0447\u043A\u0438\u043E\u0442\u0440\u0438\u0441\u043E\u0432\u043A\u0438 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u0434\u043F\u0438\u0441\u0435\u0439\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0435 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u0434\u043F\u0438\u0441\u0435\u0439\u0448\u043A\u0430\u043B\u044B\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u0438\u0437\u043C\u0435\u0440\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u044F\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0441\u0442\u0440\u043E\u043A\u0438\u043F\u043E\u0438\u0441\u043A\u0430 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430\u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0439\u043B\u0438\u043D\u0438\u0438 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043F\u043E\u0438\u0441\u043A\u043E\u043C \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0448\u043A\u0430\u043B\u044B\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u043F\u043E\u0440\u044F\u0434\u043E\u043A\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0442\u043E\u0447\u0435\u043A\u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0439\u0433\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u043F\u043E\u0440\u044F\u0434\u043E\u043A\u0441\u0435\u0440\u0438\u0439\u0432\u043B\u0435\u0433\u0435\u043D\u0434\u0435\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0440\u0430\u0437\u043C\u0435\u0440\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u0448\u043A\u0430\u043B\u044B\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0440\u0430\u0441\u0442\u044F\u0433\u0438\u0432\u0430\u043D\u0438\u0435\u043F\u043E\u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u0438\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u0433\u0430\u043D\u0442\u0430 \u0440\u0435\u0436\u0438\u043C\u0430\u0432\u0442\u043E\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u0432\u0432\u043E\u0434\u0430\u0441\u0442\u0440\u043E\u043A\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0440\u0435\u0436\u0438\u043C\u0432\u044B\u0431\u043E\u0440\u0430\u043D\u0435\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043D\u043E\u0433\u043E \u0440\u0435\u0436\u0438\u043C\u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0434\u0430\u0442\u044B \u0440\u0435\u0436\u0438\u043C\u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0441\u0442\u0440\u043E\u043A\u0438\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0440\u0435\u0436\u0438\u043C\u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0440\u0435\u0436\u0438\u043C\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u0440\u0430\u0437\u043C\u0435\u0440\u0430 \u0440\u0435\u0436\u0438\u043C\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u0441\u0432\u044F\u0437\u0430\u043D\u043D\u043E\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0434\u0438\u0430\u043B\u043E\u0433\u0430\u043F\u0435\u0447\u0430\u0442\u0438 \u0440\u0435\u0436\u0438\u043C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043A\u043E\u043C\u0430\u043D\u0434\u044B \u0440\u0435\u0436\u0438\u043C\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0440\u0435\u0436\u0438\u043C\u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E\u043E\u043A\u043D\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F\u043E\u043A\u043D\u0430\u0444\u043E\u0440\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u0441\u0435\u0440\u0438\u0438 \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u0440\u0438\u0441\u043E\u0432\u043A\u0438\u0441\u0435\u0442\u043A\u0438\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u043F\u043E\u043B\u0443\u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u0438\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u043F\u0440\u043E\u0431\u0435\u043B\u043E\u0432\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u043D\u0430\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435 \u0440\u0435\u0436\u0438\u043C\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u043A\u043E\u043B\u043E\u043D\u043A\u0438 \u0440\u0435\u0436\u0438\u043C\u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0440\u0435\u0436\u0438\u043C\u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u044F\u0438\u043D\u0434\u0438\u043A\u0430\u0442\u043E\u0440\u0430 \u0440\u0435\u0436\u0438\u043C\u0441\u043F\u0438\u0441\u043A\u0430\u0437\u0430\u0434\u0430\u0447 \u0441\u043A\u0432\u043E\u0437\u043D\u043E\u0435\u0432\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445\u0444\u043E\u0440\u043C\u044B\u0432\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u0441\u043F\u043E\u0441\u043E\u0431\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u0442\u0435\u043A\u0441\u0442\u0430\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u0448\u043A\u0430\u043B\u044B\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0438\u0432\u0430\u044E\u0449\u0435\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u0430\u044F\u0433\u0440\u0443\u043F\u043F\u0430\u043A\u043E\u043C\u0430\u043D\u0434 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0435\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u044F\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0441\u0442\u0438\u043B\u044C\u0441\u0442\u0440\u0435\u043B\u043A\u0438 \u0442\u0438\u043F\u0430\u043F\u043F\u0440\u043E\u043A\u0441\u0438\u043C\u0430\u0446\u0438\u0438\u043B\u0438\u043D\u0438\u0438\u0442\u0440\u0435\u043D\u0434\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u0435\u0434\u0438\u043D\u0438\u0446\u044B\u0448\u043A\u0430\u043B\u044B\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0442\u0438\u043F\u0438\u043C\u043F\u043E\u0440\u0442\u0430\u0441\u0435\u0440\u0438\u0439\u0441\u043B\u043E\u044F\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043B\u0438\u043D\u0438\u0438\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043B\u0438\u043D\u0438\u0438\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u043C\u0430\u0440\u043A\u0435\u0440\u0430\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043C\u0430\u0440\u043A\u0435\u0440\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u043E\u0431\u043B\u0430\u0441\u0442\u0438\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0442\u0438\u043F\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0441\u0435\u0440\u0438\u0438\u0441\u043B\u043E\u044F\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0442\u043E\u0447\u0435\u0447\u043D\u043E\u0433\u043E\u043E\u0431\u044A\u0435\u043A\u0442\u0430\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0448\u043A\u0430\u043B\u044B\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043B\u0435\u0433\u0435\u043D\u0434\u044B\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043F\u043E\u0438\u0441\u043A\u0430\u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u043F\u0440\u043E\u0435\u043A\u0446\u0438\u0438\u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0438\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u0439 \u0442\u0438\u043F\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u043E\u0432\u0438\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u0439 \u0442\u0438\u043F\u0440\u0430\u043C\u043A\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0442\u0438\u043F\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u0441\u0432\u044F\u0437\u0438\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u0433\u0430\u043D\u0442\u0430 \u0442\u0438\u043F\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u043F\u043E\u0441\u0435\u0440\u0438\u044F\u043C\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0442\u043E\u0447\u0435\u043A\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0442\u0438\u043F\u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0439\u043B\u0438\u043D\u0438\u0438 \u0442\u0438\u043F\u0441\u0442\u043E\u0440\u043E\u043D\u044B\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0442\u0438\u043F\u0444\u043E\u0440\u043C\u044B\u043E\u0442\u0447\u0435\u0442\u0430 \u0442\u0438\u043F\u0448\u043A\u0430\u043B\u044B\u0440\u0430\u0434\u0430\u0440\u043D\u043E\u0439\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0444\u0430\u043A\u0442\u043E\u0440\u043B\u0438\u043D\u0438\u0438\u0442\u0440\u0435\u043D\u0434\u0430\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B \u0444\u0438\u0433\u0443\u0440\u0430\u043A\u043D\u043E\u043F\u043A\u0438 \u0444\u0438\u0433\u0443\u0440\u044B\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0439\u0441\u0445\u0435\u043C\u044B \u0444\u0438\u043A\u0441\u0430\u0446\u0438\u044F\u0432\u0442\u0430\u0431\u043B\u0438\u0446\u0435 \u0444\u043E\u0440\u043C\u0430\u0442\u0434\u043D\u044F\u0448\u043A\u0430\u043B\u044B\u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0444\u043E\u0440\u043C\u0430\u0442\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0448\u0438\u0440\u0438\u043D\u0430\u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u043D\u044B\u0445\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u0444\u043E\u0440\u043C\u044B ",g="\u0432\u0438\u0434\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u044F\u0431\u0443\u0445\u0433\u0430\u043B\u0442\u0435\u0440\u0438\u0438 \u0432\u0438\u0434\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u044F\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0432\u0438\u0434\u0441\u0447\u0435\u0442\u0430 \u0432\u0438\u0434\u0442\u043E\u0447\u043A\u0438\u043C\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u0431\u0438\u0437\u043D\u0435\u0441\u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0430\u0433\u0440\u0435\u0433\u0430\u0442\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0433\u0440\u0443\u043F\u043F\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0435\u0436\u0438\u043C\u0430\u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0441\u0440\u0435\u0437\u0430 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u0430\u0433\u0440\u0435\u0433\u0430\u0442\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u0430\u0432\u0442\u043E\u0432\u0440\u0435\u043C\u044F \u0440\u0435\u0436\u0438\u043C\u0437\u0430\u043F\u0438\u0441\u0438\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0440\u0435\u0436\u0438\u043C\u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 ",A="\u0430\u0432\u0442\u043E\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0439\u043D\u043E\u043C\u0435\u0440\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0430\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0434\u0430\u043D\u043D\u044B\u0445 ",y="\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u044F\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0438\u0442\u043E\u0433\u043E\u0432\u043A\u043E\u043B\u043E\u043D\u043E\u043A\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0438\u0442\u043E\u0433\u043E\u0432\u0441\u0442\u0440\u043E\u043A\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430\u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0441\u043F\u043E\u0441\u043E\u0431\u0447\u0442\u0435\u043D\u0438\u044F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u0434\u0432\u0443\u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0435\u0439\u043F\u0435\u0447\u0430\u0442\u0438 \u0442\u0438\u043F\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u043E\u0431\u043B\u0430\u0441\u0442\u0438\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043A\u0443\u0440\u0441\u043E\u0440\u043E\u0432\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043B\u0438\u043D\u0438\u0438\u0440\u0438\u0441\u0443\u043D\u043A\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043B\u0438\u043D\u0438\u0438\u044F\u0447\u0435\u0439\u043A\u0438\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043B\u0438\u043D\u0438\u0439\u0441\u0432\u043E\u0434\u043D\u043E\u0439\u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0442\u0438\u043F\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0442\u0435\u043A\u0441\u0442\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u0440\u0438\u0441\u0443\u043D\u043A\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u0441\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u0443\u0437\u043E\u0440\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u0444\u0430\u0439\u043B\u0430\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u043E\u0447\u043D\u043E\u0441\u0442\u044C\u043F\u0435\u0447\u0430\u0442\u0438 \u0447\u0435\u0440\u0435\u0434\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u044F\u0441\u0442\u0440\u0430\u043D\u0438\u0446 ",E="\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u0432\u0440\u0435\u043C\u0435\u043D\u0438\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u043F\u043B\u0430\u043D\u0438\u0440\u043E\u0432\u0449\u0438\u043A\u0430 ",_="\u0442\u0438\u043F\u0444\u0430\u0439\u043B\u0430\u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 ",S="\u043E\u0431\u0445\u043E\u0434\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u0437\u0430\u043F\u0438\u0441\u0438\u0437\u0430\u043F\u0440\u043E\u0441\u0430 ",C="\u0432\u0438\u0434\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044F\u043E\u0442\u0447\u0435\u0442\u0430 \u0442\u0438\u043F\u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0439 \u0442\u0438\u043F\u0438\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u044F\u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044F\u043E\u0442\u0447\u0435\u0442\u0430 \u0442\u0438\u043F\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0438\u0442\u043E\u0433\u043E\u0432 ",I="\u0434\u043E\u0441\u0442\u0443\u043F\u043A\u0444\u0430\u0439\u043B\u0443 \u0440\u0435\u0436\u0438\u043C\u0434\u0438\u0430\u043B\u043E\u0433\u0430\u0432\u044B\u0431\u043E\u0440\u0430\u0444\u0430\u0439\u043B\u0430 \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F\u0444\u0430\u0439\u043B\u0430 ",w="\u0442\u0438\u043F\u0438\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u044F\u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044F\u0437\u0430\u043F\u0440\u043E\u0441\u0430 ",k="\u0432\u0438\u0434\u0434\u0430\u043D\u043D\u044B\u0445\u0430\u043D\u0430\u043B\u0438\u0437\u0430 \u043C\u0435\u0442\u043E\u0434\u043A\u043B\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0438\u043F\u0435\u0434\u0438\u043D\u0438\u0446\u044B\u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B\u0430\u0432\u0440\u0435\u043C\u0435\u043D\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u0442\u0430\u0431\u043B\u0438\u0446\u044B\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0447\u0438\u0441\u043B\u043E\u0432\u044B\u0445\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u0438\u0441\u043A\u0430\u0430\u0441\u0441\u043E\u0446\u0438\u0430\u0446\u0438\u0439 \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u0434\u0435\u0440\u0435\u0432\u043E\u0440\u0435\u0448\u0435\u043D\u0438\u0439 \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043A\u043B\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044F \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043E\u0431\u0449\u0430\u044F\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u0438\u0441\u043A\u0430\u0441\u0441\u043E\u0446\u0438\u0430\u0446\u0438\u0439 \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u0438\u0441\u043A\u043F\u043E\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0435\u0439 \u0442\u0438\u043F\u043A\u043E\u043B\u043E\u043D\u043A\u0438\u043C\u043E\u0434\u0435\u043B\u0438\u043F\u0440\u043E\u0433\u043D\u043E\u0437\u0430 \u0442\u0438\u043F\u043C\u0435\u0440\u044B\u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u044F\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043E\u0442\u0441\u0435\u0447\u0435\u043D\u0438\u044F\u043F\u0440\u0430\u0432\u0438\u043B\u0430\u0441\u0441\u043E\u0446\u0438\u0430\u0446\u0438\u0438 \u0442\u0438\u043F\u043F\u043E\u043B\u044F\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0443\u043F\u043E\u0440\u044F\u0434\u043E\u0447\u0438\u0432\u0430\u043D\u0438\u044F\u043F\u0440\u0430\u0432\u0438\u043B\u0430\u0441\u0441\u043E\u0446\u0438\u0430\u0446\u0438\u0438\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0443\u043F\u043E\u0440\u044F\u0434\u043E\u0447\u0438\u0432\u0430\u043D\u0438\u044F\u0448\u0430\u0431\u043B\u043E\u043D\u043E\u0432\u043F\u043E\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0435\u0439\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0443\u043F\u0440\u043E\u0449\u0435\u043D\u0438\u044F\u0434\u0435\u0440\u0435\u0432\u0430\u0440\u0435\u0448\u0435\u043D\u0438\u0439 ",N="ws\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 \u0432\u0430\u0440\u0438\u0430\u043D\u0442xpathxs \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0437\u0430\u043F\u0438\u0441\u0438\u0434\u0430\u0442\u044Bjson \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043F\u0440\u043E\u0441\u0442\u043E\u0433\u043E\u0442\u0438\u043F\u0430xs \u0432\u0438\u0434\u0433\u0440\u0443\u043F\u043F\u044B\u043C\u043E\u0434\u0435\u043B\u0438xs \u0432\u0438\u0434\u0444\u0430\u0441\u0435\u0442\u0430xdto \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044Fdom \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u043E\u0441\u0442\u044C\u043F\u0440\u043E\u0441\u0442\u043E\u0433\u043E\u0442\u0438\u043F\u0430xs \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u043E\u0441\u0442\u044C\u0441\u043E\u0441\u0442\u0430\u0432\u043D\u043E\u0433\u043E\u0442\u0438\u043F\u0430xs \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u043E\u0441\u0442\u044C\u0441\u0445\u0435\u043C\u044Bxs \u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043D\u044B\u0435\u043F\u043E\u0434\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438xs \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F\u0433\u0440\u0443\u043F\u043F\u043F\u043E\u0434\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438xs \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430xs \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F\u0438\u0434\u0435\u043D\u0442\u0438\u0447\u043D\u043E\u0441\u0442\u0438xs \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F\u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0438\u043C\u0435\u043Dxs \u043C\u0435\u0442\u043E\u0434\u043D\u0430\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u043D\u0438\u044Fxs \u043C\u043E\u0434\u0435\u043B\u044C\u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043Exs \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0442\u0438\u043F\u0430xml \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435\u043F\u043E\u0434\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438xs \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u043F\u0440\u043E\u0431\u0435\u043B\u044C\u043D\u044B\u0445\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432xs \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043Exs \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fxs \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u043E\u0442\u0431\u043E\u0440\u0430\u0443\u0437\u043B\u043E\u0432dom \u043F\u0435\u0440\u0435\u043D\u043E\u0441\u0441\u0442\u0440\u043E\u043Ajson \u043F\u043E\u0437\u0438\u0446\u0438\u044F\u0432\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0435dom \u043F\u0440\u043E\u0431\u0435\u043B\u044C\u043D\u044B\u0435\u0441\u0438\u043C\u0432\u043E\u043B\u044Bxml \u0442\u0438\u043F\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430xml \u0442\u0438\u043F\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fjson \u0442\u0438\u043F\u043A\u0430\u043D\u043E\u043D\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043Exml \u0442\u0438\u043F\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u044Bxs \u0442\u0438\u043F\u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438xml \u0442\u0438\u043F\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430domxpath \u0442\u0438\u043F\u0443\u0437\u043B\u0430dom \u0442\u0438\u043F\u0443\u0437\u043B\u0430xml \u0444\u043E\u0440\u043C\u0430xml \u0444\u043E\u0440\u043C\u0430\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u044Fxs \u0444\u043E\u0440\u043C\u0430\u0442\u0434\u0430\u0442\u044Bjson \u044D\u043A\u0440\u0430\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432json ",O="\u0432\u0438\u0434\u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0432\u043B\u043E\u0436\u0435\u043D\u043D\u044B\u0445\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0438\u0442\u043E\u0433\u043E\u0432\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u043B\u0435\u0439\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043F\u043E\u043B\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u043E\u0432\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0432\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0431\u0443\u0445\u0433\u0430\u043B\u0442\u0435\u0440\u0441\u043A\u043E\u0433\u043E\u043E\u0441\u0442\u0430\u0442\u043A\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0432\u044B\u0432\u043E\u0434\u0430\u0442\u0435\u043A\u0441\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0433\u0440\u0443\u043F\u043F\u044B\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432\u043E\u0442\u0431\u043E\u0440\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0434\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u043F\u043E\u043B\u0435\u0439\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043C\u0430\u043A\u0435\u0442\u0430\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043C\u0430\u043A\u0435\u0442\u0430\u043E\u0431\u043B\u0430\u0441\u0442\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043E\u0441\u0442\u0430\u0442\u043A\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F\u0442\u0435\u043A\u0441\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u0441\u0432\u044F\u0437\u0438\u043D\u0430\u0431\u043E\u0440\u043E\u0432\u0434\u0430\u043D\u043D\u044B\u0445\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043B\u0435\u0433\u0435\u043D\u0434\u044B\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043F\u0440\u0438\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u043E\u0442\u0431\u043E\u0440\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043F\u043E\u0441\u043E\u0431\u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0435\u0436\u0438\u043C\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0430\u0432\u0442\u043E\u043F\u043E\u0437\u0438\u0446\u0438\u044F\u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0432\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0432\u0432\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0435\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0444\u0438\u043A\u0441\u0430\u0446\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0443\u0441\u043B\u043E\u0432\u043D\u043E\u0433\u043E\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 ",W="\u0432\u0430\u0436\u043D\u043E\u0441\u0442\u044C\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u0442\u0435\u043A\u0441\u0442\u0430\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0441\u043F\u043E\u0441\u043E\u0431\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0432\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0441\u043F\u043E\u0441\u043E\u0431\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u043D\u0435ascii\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0442\u0438\u043F\u0442\u0435\u043A\u0441\u0442\u0430\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u044B \u0441\u0442\u0430\u0442\u0443\u0441\u0440\u0430\u0437\u0431\u043E\u0440\u0430\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0433\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F ",$="\u0440\u0435\u0436\u0438\u043C\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438\u0437\u0430\u043F\u0438\u0441\u0438\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438\u0437\u0430\u043F\u0438\u0441\u0438\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0440\u043E\u0432\u0435\u043D\u044C\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 ",G="\u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0432\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u0440\u0435\u0436\u0438\u043C\u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0432\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u0440\u0435\u0436\u0438\u043C\u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u0430\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u0442\u0438\u043F\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0432\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 ",q="\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430\u0438\u043C\u0435\u043D\u0444\u0430\u0439\u043B\u043E\u0432\u0432zip\u0444\u0430\u0439\u043B\u0435 \u043C\u0435\u0442\u043E\u0434\u0441\u0436\u0430\u0442\u0438\u044Fzip \u043C\u0435\u0442\u043E\u0434\u0448\u0438\u0444\u0440\u043E\u0432\u0430\u043D\u0438\u044Fzip \u0440\u0435\u0436\u0438\u043C\u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F\u043F\u0443\u0442\u0435\u0439\u0444\u0430\u0439\u043B\u043E\u0432zip \u0440\u0435\u0436\u0438\u043C\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438\u043F\u043E\u0434\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u043E\u0432zip \u0440\u0435\u0436\u0438\u043C\u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F\u043F\u0443\u0442\u0435\u0439zip \u0443\u0440\u043E\u0432\u0435\u043D\u044C\u0441\u0436\u0430\u0442\u0438\u044Fzip ",ce="\u0437\u0432\u0443\u043A\u043E\u0432\u043E\u0435\u043E\u043F\u043E\u0432\u0435\u0449\u0435\u043D\u0438\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0430\u043A\u0441\u0442\u0440\u043E\u043A\u0435 \u043F\u043E\u0437\u0438\u0446\u0438\u044F\u0432\u043F\u043E\u0442\u043E\u043A\u0435 \u043F\u043E\u0440\u044F\u0434\u043E\u043A\u0431\u0430\u0439\u0442\u043E\u0432 \u0440\u0435\u0436\u0438\u043C\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0435\u0436\u0438\u043C\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u043E\u0439\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u044B\u0445\u043F\u043E\u043A\u0443\u043F\u043E\u043A \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435\u0444\u043E\u043D\u043E\u0432\u043E\u0433\u043E\u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0442\u0438\u043F\u043F\u043E\u0434\u043F\u0438\u0441\u0447\u0438\u043A\u0430\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u043C\u044B\u0445\u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0439 \u0443\u0440\u043E\u0432\u0435\u043D\u044C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0437\u0430\u0449\u0438\u0449\u0435\u043D\u043D\u043E\u0433\u043E\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044Fftp ",Y="\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u043E\u0440\u044F\u0434\u043A\u0430\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u0434\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F\u043F\u0435\u0440\u0438\u043E\u0434\u0430\u043C\u0438\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u043E\u0439\u0442\u043E\u0447\u043A\u0438\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E\u0439\u0442\u0430\u0431\u043B\u0438\u0446\u044B\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0442\u0438\u043F\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F\u0441\u0445\u0435\u043C\u044B\u0437\u0430\u043F\u0440\u043E\u0441\u0430 ",z="http\u043C\u0435\u0442\u043E\u0434 \u0430\u0432\u0442\u043E\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0430\u0432\u0442\u043E\u043F\u0440\u0435\u0444\u0438\u043A\u0441\u043D\u043E\u043C\u0435\u0440\u0430\u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u043E\u0433\u043E\u044F\u0437\u044B\u043A\u0430 \u0432\u0438\u0434\u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0432\u0438\u0434\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0442\u0430\u0431\u043B\u0438\u0446\u044B\u0432\u043D\u0435\u0448\u043D\u0435\u0433\u043E\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u043F\u0438\u0441\u044C\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u0439\u043F\u0440\u0438\u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435\u043F\u043E\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0435\u0439 \u0438\u043D\u0434\u0435\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0431\u0430\u0437\u044B\u043F\u043B\u0430\u043D\u0430\u0432\u0438\u0434\u043E\u0432\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0431\u044B\u0441\u0442\u0440\u043E\u0433\u043E\u0432\u044B\u0431\u043E\u0440\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E\u043F\u043E\u0438\u0441\u043A\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0430\u0437\u0434\u0435\u043B\u044F\u0435\u043C\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\u043E\u0435\u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0432\u0438\u0434\u0430\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0432\u0438\u0434\u0430\u0445\u0430\u0440\u0430\u043A\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043A\u0438 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0437\u0430\u0434\u0430\u0447\u0438 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u043B\u0430\u043D\u0430\u043E\u0431\u043C\u0435\u043D\u0430 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0441\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A\u0430 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0435\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0441\u0447\u0435\u0442\u0430 \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435\u0433\u0440\u0430\u043D\u0438\u0446\u044B\u043F\u0440\u0438\u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u043D\u043E\u043C\u0435\u0440\u0430\u0431\u0438\u0437\u043D\u0435\u0441\u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u043D\u043E\u043C\u0435\u0440\u0430\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0441\u0432\u0435\u0434\u0435\u043D\u0438\u0439 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0435\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043C\u044B\u0445\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0439\u043F\u043E\u0438\u0441\u043A\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435\u043F\u043E\u0441\u0442\u0440\u043E\u043A\u0435 \u043F\u0440\u0438\u043D\u0430\u0434\u043B\u0435\u0436\u043D\u043E\u0441\u0442\u044C\u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u043F\u0440\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0430\u0443\u0442\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u0438\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0439\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u043E\u0431\u0449\u0435\u0433\u043E\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430 \u0440\u0435\u0436\u0438\u043C\u0430\u0432\u0442\u043E\u043D\u0443\u043C\u0435\u0440\u0430\u0446\u0438\u0438\u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0440\u0435\u0436\u0438\u043C\u0437\u0430\u043F\u0438\u0441\u0438\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0440\u0435\u0436\u0438\u043C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438 \u0440\u0435\u0436\u0438\u043C\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u0438\u043D\u0445\u0440\u043E\u043D\u043D\u044B\u0445\u0432\u044B\u0437\u043E\u0432\u043E\u0432\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0439\u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u044B\u0438\u0432\u043D\u0435\u0448\u043D\u0438\u0445\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442 \u0440\u0435\u0436\u0438\u043C\u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0433\u043E\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u0435\u0430\u043D\u0441\u043E\u0432 \u0440\u0435\u0436\u0438\u043C\u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F\u0434\u0430\u043D\u043D\u044B\u0445\u0432\u044B\u0431\u043E\u0440\u0430\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435\u043F\u043E\u0441\u0442\u0440\u043E\u043A\u0435 \u0440\u0435\u0436\u0438\u043C\u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u043E\u0441\u0442\u0438 \u0440\u0435\u0436\u0438\u043C\u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u043E\u0441\u0442\u0438\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0440\u0435\u0436\u0438\u043C\u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u043E\u0439\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u0441\u0435\u0440\u0438\u0438\u043A\u043E\u0434\u043E\u0432\u043F\u043B\u0430\u043D\u0430\u0432\u0438\u0434\u043E\u0432\u0445\u0430\u0440\u0430\u043A\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043A \u0441\u0435\u0440\u0438\u0438\u043A\u043E\u0434\u043E\u0432\u043F\u043B\u0430\u043D\u0430\u0441\u0447\u0435\u0442\u043E\u0432 \u0441\u0435\u0440\u0438\u0438\u043A\u043E\u0434\u043E\u0432\u0441\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435 \u0441\u043F\u043E\u0441\u043E\u0431\u0432\u044B\u0431\u043E\u0440\u0430 \u0441\u043F\u043E\u0441\u043E\u0431\u043F\u043E\u0438\u0441\u043A\u0430\u0441\u0442\u0440\u043E\u043A\u0438\u043F\u0440\u0438\u0432\u0432\u043E\u0434\u0435\u043F\u043E\u0441\u0442\u0440\u043E\u043A\u0435 \u0441\u043F\u043E\u0441\u043E\u0431\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u0438\u043F\u0434\u0430\u043D\u043D\u044B\u0445\u0442\u0430\u0431\u043B\u0438\u0446\u044B\u0432\u043D\u0435\u0448\u043D\u0435\u0433\u043E\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043A\u043E\u0434\u0430\u043F\u043B\u0430\u043D\u0430\u0432\u0438\u0434\u043E\u0432\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0442\u0438\u043F\u043A\u043E\u0434\u0430\u0441\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A\u0430 \u0442\u0438\u043F\u043C\u0430\u043A\u0435\u0442\u0430 \u0442\u0438\u043F\u043D\u043E\u043C\u0435\u0440\u0430\u0431\u0438\u0437\u043D\u0435\u0441\u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430 \u0442\u0438\u043F\u043D\u043E\u043C\u0435\u0440\u0430\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0442\u0438\u043F\u043D\u043E\u043C\u0435\u0440\u0430\u0437\u0430\u0434\u0430\u0447\u0438 \u0442\u0438\u043F\u0444\u043E\u0440\u043C\u044B \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0435\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u0439 ",j="\u0432\u0430\u0436\u043D\u043E\u0441\u0442\u044C\u043F\u0440\u043E\u0431\u043B\u0435\u043C\u044B\u043F\u0440\u0438\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0444\u043E\u0440\u043C\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E\u0448\u0440\u0438\u0444\u0442\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u043F\u0435\u0440\u0438\u043E\u0434\u0430 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0439\u0434\u0430\u0442\u044B\u043D\u0430\u0447\u0430\u043B\u0430 \u0432\u0438\u0434\u0433\u0440\u0430\u043D\u0438\u0446\u044B \u0432\u0438\u0434\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0432\u0438\u0434\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E\u043F\u043E\u0438\u0441\u043A\u0430 \u0432\u0438\u0434\u0440\u0430\u043C\u043A\u0438 \u0432\u0438\u0434\u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0446\u0432\u0435\u0442\u0430 \u0432\u0438\u0434\u0447\u0438\u0441\u043B\u043E\u0432\u043E\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0448\u0440\u0438\u0444\u0442\u0430 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u0430\u044F\u0434\u043B\u0438\u043D\u0430 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0439\u0437\u043D\u0430\u043A \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435byteordermark \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043C\u0435\u0442\u0430\u0434\u0430\u043D\u043D\u044B\u0445\u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E\u043F\u043E\u0438\u0441\u043A\u0430 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0439\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043A\u043B\u0430\u0432\u0438\u0448\u0430 \u043A\u043E\u0434\u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0430\u0434\u0438\u0430\u043B\u043E\u0433\u0430 \u043A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430xbase \u043A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430\u0442\u0435\u043A\u0441\u0442\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u043E\u0438\u0441\u043A\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0435\u0434\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u0438\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043F\u0430\u043D\u0435\u043B\u0438\u0440\u0430\u0437\u0434\u0435\u043B\u043E\u0432 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u0434\u0438\u0430\u043B\u043E\u0433\u0430\u0432\u043E\u043F\u0440\u043E\u0441 \u0440\u0435\u0436\u0438\u043C\u0437\u0430\u043F\u0443\u0441\u043A\u0430\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u043E\u043A\u0440\u0443\u0433\u043B\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F\u0444\u043E\u0440\u043C\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0440\u0435\u0436\u0438\u043C\u043F\u043E\u043B\u043D\u043E\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E\u043F\u043E\u0438\u0441\u043A\u0430 \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C\u043A\u043B\u0438\u0435\u043D\u0442\u0441\u043A\u043E\u0433\u043E\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435\u0432\u043D\u0435\u0448\u043D\u0435\u0433\u043E\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u0431\u0430\u0437\u044B\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043F\u043E\u0441\u043E\u0431\u0432\u044B\u0431\u043E\u0440\u0430\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u0430windows \u0441\u043F\u043E\u0441\u043E\u0431\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u0442\u0440\u043E\u043A\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0442\u0438\u043F\u0432\u043D\u0435\u0448\u043D\u0435\u0439\u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u044B \u0442\u0438\u043F\u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u044B \u0442\u0438\u043F\u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F\u043A\u043B\u0430\u0432\u0438\u0448\u0438enter \u0442\u0438\u043F\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0438\u043E\u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0438\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u0431\u0430\u0437\u044B\u0434\u0430\u043D\u043D\u044B\u0445 \u0443\u0440\u043E\u0432\u0435\u043D\u044C\u0438\u0437\u043E\u043B\u044F\u0446\u0438\u0438\u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0439 \u0445\u0435\u0448\u0444\u0443\u043D\u043A\u0446\u0438\u044F \u0447\u0430\u0441\u0442\u0438\u0434\u0430\u0442\u044B",se=h+f+g+A+y+E+_+S+C+I+w+k+N+O+W+$+G+q+ce+Y+z+j,Ae="com\u043E\u0431\u044A\u0435\u043A\u0442 ftp\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 http\u0437\u0430\u043F\u0440\u043E\u0441 http\u0441\u0435\u0440\u0432\u0438\u0441\u043E\u0442\u0432\u0435\u0442 http\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 ws\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044F ws\u043F\u0440\u043E\u043A\u0441\u0438 xbase \u0430\u043D\u0430\u043B\u0438\u0437\u0434\u0430\u043D\u043D\u044B\u0445 \u0430\u043D\u043D\u043E\u0442\u0430\u0446\u0438\u044Fxs \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u0431\u0443\u0444\u0435\u0440\u0434\u0432\u043E\u0438\u0447\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445 \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435xs \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0433\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440\u0441\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u0445\u0447\u0438\u0441\u0435\u043B \u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u0430\u044F\u0441\u0445\u0435\u043C\u0430 \u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u0438\u0435\u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u0430\u044F\u0441\u0445\u0435\u043C\u0430 \u0433\u0440\u0443\u043F\u043F\u0430\u043C\u043E\u0434\u0435\u043B\u0438xs \u0434\u0430\u043D\u043D\u044B\u0435\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0434\u0432\u043E\u0438\u0447\u043D\u044B\u0435\u0434\u0430\u043D\u043D\u044B\u0435 \u0434\u0435\u043D\u0434\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430\u0433\u0430\u043D\u0442\u0430 \u0434\u0438\u0430\u043B\u043E\u0433\u0432\u044B\u0431\u043E\u0440\u0430\u0444\u0430\u0439\u043B\u0430 \u0434\u0438\u0430\u043B\u043E\u0433\u0432\u044B\u0431\u043E\u0440\u0430\u0446\u0432\u0435\u0442\u0430 \u0434\u0438\u0430\u043B\u043E\u0433\u0432\u044B\u0431\u043E\u0440\u0430\u0448\u0440\u0438\u0444\u0442\u0430 \u0434\u0438\u0430\u043B\u043E\u0433\u0440\u0430\u0441\u043F\u0438\u0441\u0430\u043D\u0438\u044F\u0440\u0435\u0433\u043B\u0430\u043C\u0435\u043D\u0442\u043D\u043E\u0433\u043E\u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0434\u0438\u0430\u043B\u043E\u0433\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0433\u043E\u043F\u0435\u0440\u0438\u043E\u0434\u0430 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442dom \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442html \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044Fxs \u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u043C\u043E\u0435\u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u043F\u0438\u0441\u044Cdom \u0437\u0430\u043F\u0438\u0441\u044Cfastinfoset \u0437\u0430\u043F\u0438\u0441\u044Chtml \u0437\u0430\u043F\u0438\u0441\u044Cjson \u0437\u0430\u043F\u0438\u0441\u044Cxml \u0437\u0430\u043F\u0438\u0441\u044Czip\u0444\u0430\u0439\u043B\u0430 \u0437\u0430\u043F\u0438\u0441\u044C\u0434\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u043F\u0438\u0441\u044C\u0442\u0435\u043A\u0441\u0442\u0430 \u0437\u0430\u043F\u0438\u0441\u044C\u0443\u0437\u043B\u043E\u0432dom \u0437\u0430\u043F\u0440\u043E\u0441 \u0437\u0430\u0449\u0438\u0449\u0435\u043D\u043D\u043E\u0435\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435openssl \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u043F\u043E\u043B\u0435\u0439\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0438\u0437\u0432\u043B\u0435\u0447\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430 \u0438\u043C\u043F\u043E\u0440\u0442xs \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u0430 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0435\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u043E\u0447\u0442\u043E\u0432\u044B\u0439\u043F\u0440\u043E\u0444\u0438\u043B\u044C \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043F\u0440\u043E\u043A\u0441\u0438 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F\u0434\u043B\u044F\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044Fxs \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430xs \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0438\u0442\u0435\u0440\u0430\u0442\u043E\u0440\u0443\u0437\u043B\u043E\u0432dom \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \u043A\u0432\u0430\u043B\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B\u0434\u0430\u0442\u044B \u043A\u0432\u0430\u043B\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B\u0434\u0432\u043E\u0438\u0447\u043D\u044B\u0445\u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u0432\u0430\u043B\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B\u0441\u0442\u0440\u043E\u043A\u0438 \u043A\u0432\u0430\u043B\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B\u0447\u0438\u0441\u043B\u0430 \u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u0449\u0438\u043A\u043C\u0430\u043A\u0435\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u0449\u0438\u043A\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440\u043C\u0430\u043A\u0435\u0442\u0430\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440\u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440\u0444\u043E\u0440\u043C\u0430\u0442\u043D\u043E\u0439\u0441\u0442\u0440\u043E\u043A\u0438 \u043B\u0438\u043D\u0438\u044F \u043C\u0430\u043A\u0435\u0442\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043C\u0430\u043A\u0435\u0442\u043E\u0431\u043B\u0430\u0441\u0442\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043C\u0430\u043A\u0435\u0442\u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043C\u0430\u0441\u043A\u0430xs \u043C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u043D\u0430\u0431\u043E\u0440\u0441\u0445\u0435\u043Cxml \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438\u0441\u0435\u0440\u0438\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438json \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u0431\u0445\u043E\u0434\u0434\u0435\u0440\u0435\u0432\u0430dom \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430xs \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435\u043D\u043E\u0442\u0430\u0446\u0438\u0438xs \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430xs \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u0434\u043E\u0441\u0442\u0443\u043F\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F\u0441\u043E\u0431\u044B\u0442\u0438\u044F\u043E\u0442\u043A\u0430\u0437\u0432\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u0436\u0443\u0440\u043D\u0430\u043B\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u043F\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043C\u043E\u0433\u043E\u0444\u0430\u0439\u043B\u0430 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u0442\u0438\u043F\u043E\u0432 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0433\u0440\u0443\u043F\u043F\u044B\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u0432xs \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0433\u0440\u0443\u043F\u043F\u044B\u043C\u043E\u0434\u0435\u043B\u0438xs \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F\u0438\u0434\u0435\u043D\u0442\u0438\u0447\u043D\u043E\u0441\u0442\u0438xs \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u043F\u0440\u043E\u0441\u0442\u043E\u0433\u043E\u0442\u0438\u043F\u0430xs \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0441\u043E\u0441\u0442\u0430\u0432\u043D\u043E\u0433\u043E\u0442\u0438\u043F\u0430xs \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435\u0442\u0438\u043F\u0430\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430dom \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044Fxpathxs \u043E\u0442\u0431\u043E\u0440\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u0430\u043A\u0435\u0442\u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u043C\u044B\u0445\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0432\u044B\u0431\u043E\u0440\u0430 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0437\u0430\u043F\u0438\u0441\u0438json \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0437\u0430\u043F\u0438\u0441\u0438xml \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B\u0447\u0442\u0435\u043D\u0438\u044Fxml \u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435xs \u043F\u043B\u0430\u043D\u0438\u0440\u043E\u0432\u0449\u0438\u043A \u043F\u043E\u043B\u0435\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u043B\u0435\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044Cdom \u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044C\u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044C\u043E\u0442\u0447\u0435\u0442\u0430 \u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044C\u043E\u0442\u0447\u0435\u0442\u0430\u0430\u043D\u0430\u043B\u0438\u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u0441\u0442\u0440\u043E\u0438\u0442\u0435\u043B\u044C\u0441\u0445\u0435\u043Cxml \u043F\u043E\u0442\u043E\u043A \u043F\u043E\u0442\u043E\u043A\u0432\u043F\u0430\u043C\u044F\u0442\u0438 \u043F\u043E\u0447\u0442\u0430 \u043F\u043E\u0447\u0442\u043E\u0432\u043E\u0435\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u043F\u0440\u0435\u043E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u043D\u0438\u0435xsl \u043F\u0440\u0435\u043E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043A\u043A\u0430\u043D\u043E\u043D\u0438\u0447\u0435\u0441\u043A\u043E\u043C\u0443xml \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0432\u044B\u0432\u043E\u0434\u0430\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445\u0432\u043A\u043E\u043B\u043B\u0435\u043A\u0446\u0438\u044E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0432\u044B\u0432\u043E\u0434\u0430\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445\u0432\u0442\u0430\u0431\u043B\u0438\u0447\u043D\u044B\u0439\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0440\u0430\u0437\u044B\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0438\u043C\u0435\u043Ddom \u0440\u0430\u043C\u043A\u0430 \u0440\u0430\u0441\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u0440\u0435\u0433\u043B\u0430\u043C\u0435\u043D\u0442\u043D\u043E\u0433\u043E\u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u043E\u0435\u0438\u043C\u044Fxml \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0447\u0442\u0435\u043D\u0438\u044F\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u0432\u043E\u0434\u043D\u0430\u044F\u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430 \u0441\u0432\u044F\u0437\u044C\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u0432\u044B\u0431\u043E\u0440\u0430 \u0441\u0432\u044F\u0437\u044C\u043F\u043E\u0442\u0438\u043F\u0443 \u0441\u0432\u044F\u0437\u044C\u043F\u043E\u0442\u0438\u043F\u0443\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0440\u0438\u0430\u043B\u0438\u0437\u0430\u0442\u043E\u0440xdto \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043A\u043B\u0438\u0435\u043D\u0442\u0430windows \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043A\u043B\u0438\u0435\u043D\u0442\u0430\u0444\u0430\u0439\u043B \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043A\u0440\u0438\u043F\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u044B\u0443\u0434\u043E\u0441\u0442\u043E\u0432\u0435\u0440\u044F\u044E\u0449\u0438\u0445\u0446\u0435\u043D\u0442\u0440\u043E\u0432windows \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u044B\u0443\u0434\u043E\u0441\u0442\u043E\u0432\u0435\u0440\u044F\u044E\u0449\u0438\u0445\u0446\u0435\u043D\u0442\u0440\u043E\u0432\u0444\u0430\u0439\u043B \u0441\u0436\u0430\u0442\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u0438\u0441\u0442\u0435\u043C\u043D\u0430\u044F\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044E \u0441\u043E\u0447\u0435\u0442\u0430\u043D\u0438\u0435\u043A\u043B\u0430\u0432\u0438\u0448 \u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u0430\u044F\u0434\u0430\u0442\u0430\u043D\u0430\u0447\u0430\u043B\u0430 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u044B\u0439\u043F\u0435\u0440\u0438\u043E\u0434 \u0441\u0445\u0435\u043C\u0430xml \u0441\u0445\u0435\u043C\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 \u0442\u0430\u0431\u043B\u0438\u0447\u043D\u044B\u0439\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0439\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043C\u043E\u0435\u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0442\u0438\u043F\u0434\u0430\u043D\u043D\u044B\u0445xml \u0443\u043D\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u0439\u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0431\u0440\u0438\u043A\u0430xdto \u0444\u0430\u0439\u043B \u0444\u0430\u0439\u043B\u043E\u0432\u044B\u0439\u043F\u043E\u0442\u043E\u043A \u0444\u0430\u0441\u0435\u0442\u0434\u043B\u0438\u043D\u044Bxs \u0444\u0430\u0441\u0435\u0442\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\u0440\u0430\u0437\u0440\u044F\u0434\u043E\u0432\u0434\u0440\u043E\u0431\u043D\u043E\u0439\u0447\u0430\u0441\u0442\u0438xs \u0444\u0430\u0441\u0435\u0442\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0433\u043E\u0432\u043A\u043B\u044E\u0447\u0430\u044E\u0449\u0435\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fxs \u0444\u0430\u0441\u0435\u0442\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0433\u043E\u0438\u0441\u043A\u043B\u044E\u0447\u0430\u044E\u0449\u0435\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fxs \u0444\u0430\u0441\u0435\u0442\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0439\u0434\u043B\u0438\u043D\u044Bxs \u0444\u0430\u0441\u0435\u0442\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0433\u043E\u0432\u043A\u043B\u044E\u0447\u0430\u044E\u0449\u0435\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fxs \u0444\u0430\u0441\u0435\u0442\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0433\u043E\u0438\u0441\u043A\u043B\u044E\u0447\u0430\u044E\u0449\u0435\u0433\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044Fxs \u0444\u0430\u0441\u0435\u0442\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0439\u0434\u043B\u0438\u043D\u044Bxs \u0444\u0430\u0441\u0435\u0442\u043E\u0431\u0440\u0430\u0437\u0446\u0430xs \u0444\u0430\u0441\u0435\u0442\u043E\u0431\u0449\u0435\u0433\u043E\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\u0440\u0430\u0437\u0440\u044F\u0434\u043E\u0432xs \u0444\u0430\u0441\u0435\u0442\u043F\u0435\u0440\u0435\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u044Fxs \u0444\u0430\u0441\u0435\u0442\u043F\u0440\u043E\u0431\u0435\u043B\u044C\u043D\u044B\u0445\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432xs \u0444\u0438\u043B\u044C\u0442\u0440\u0443\u0437\u043B\u043E\u0432dom \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u0430\u044F\u0441\u0442\u0440\u043E\u043A\u0430 \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442xs \u0445\u0435\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0435\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0446\u0432\u0435\u0442 \u0447\u0442\u0435\u043D\u0438\u0435fastinfoset \u0447\u0442\u0435\u043D\u0438\u0435html \u0447\u0442\u0435\u043D\u0438\u0435json \u0447\u0442\u0435\u043D\u0438\u0435xml \u0447\u0442\u0435\u043D\u0438\u0435zip\u0444\u0430\u0439\u043B\u0430 \u0447\u0442\u0435\u043D\u0438\u0435\u0434\u0430\u043D\u043D\u044B\u0445 \u0447\u0442\u0435\u043D\u0438\u0435\u0442\u0435\u043A\u0441\u0442\u0430 \u0447\u0442\u0435\u043D\u0438\u0435\u0443\u0437\u043B\u043E\u0432dom \u0448\u0440\u0438\u0444\u0442 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0430\u043A\u043E\u043C\u043F\u043E\u043D\u043E\u0432\u043A\u0438\u0434\u0430\u043D\u043D\u044B\u0445 ",De="comsafearray \u0434\u0435\u0440\u0435\u0432\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u043C\u0430\u0441\u0441\u0438\u0432 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u043F\u0438\u0441\u043E\u043A\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u0430\u044F\u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0430 \u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0435\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439\u043C\u0430\u0441\u0441\u0438\u0432 ",Pe=Ae+De,we="null \u0438\u0441\u0442\u0438\u043D\u0430 \u043B\u043E\u0436\u044C \u043D\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043E",ie=t.inherit(t.NUMBER_MODE),oe={className:"string",begin:'"|\\|',end:'"|$',contains:[{begin:'""'}]},ne={begin:"'",end:"'",excludeBegin:!0,excludeEnd:!0,contains:[{className:"number",begin:"\\d{4}([\\.\\\\/:-]?\\d{2}){0,5}"}]},Z=t.inherit(t.C_LINE_COMMENT_MODE),te={className:"meta",begin:"#|&",end:"$",keywords:{$pattern:e,"meta-keyword":i+a},contains:[Z]},V={className:"symbol",begin:"~",end:";|:",excludeEnd:!0},ee={className:"function",variants:[{begin:"\u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u0430|\u0444\u0443\u043D\u043A\u0446\u0438\u044F",end:"\\)",keywords:"\u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u0430 \u0444\u0443\u043D\u043A\u0446\u0438\u044F"},{begin:"\u043A\u043E\u043D\u0435\u0446\u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u044B|\u043A\u043E\u043D\u0435\u0446\u0444\u0443\u043D\u043A\u0446\u0438\u0438",keywords:"\u043A\u043E\u043D\u0435\u0446\u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u044B \u043A\u043E\u043D\u0435\u0446\u0444\u0443\u043D\u043A\u0446\u0438\u0438"}],contains:[{begin:"\\(",end:"\\)",endsParent:!0,contains:[{className:"params",begin:e,end:",",excludeEnd:!0,endsWithParent:!0,keywords:{$pattern:e,keyword:"\u0437\u043D\u0430\u0447",literal:we},contains:[ie,oe,ne]},Z]},t.inherit(t.TITLE_MODE,{begin:e})]};return{name:"1C:Enterprise",case_insensitive:!0,keywords:{$pattern:e,keyword:i,built_in:m,class:se,type:Pe,literal:we},contains:[te,ee,Z,V,ie,oe,ne]}}FNn.exports=WMi});var GNn=re((doc,UNn)=>{p();function HMi(t){return t?typeof t=="string"?t:t.source:null}function qMi(...t){return t.map(n=>HMi(n)).join("")}function jMi(t){let e={ruleDeclaration:/^[a-zA-Z][a-zA-Z0-9-]*/,unexpectedChars:/[!@#$^&',?+~`|:]/},n=["ALPHA","BIT","CHAR","CR","CRLF","CTL","DIGIT","DQUOTE","HEXDIG","HTAB","LF","LWSP","OCTET","SP","VCHAR","WSP"],r=t.COMMENT(/;/,/$/),i={className:"symbol",begin:/%b[0-1]+(-[0-1]+|(\.[0-1]+)+){0,1}/},s={className:"symbol",begin:/%d[0-9]+(-[0-9]+|(\.[0-9]+)+){0,1}/},o={className:"symbol",begin:/%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+){0,1}/},a={className:"symbol",begin:/%[si]/},c={className:"attribute",begin:qMi(e.ruleDeclaration,/(?=\s*=)/)};return{name:"Augmented Backus-Naur Form",illegal:e.unexpectedChars,keywords:n,contains:[c,r,i,s,o,a,t.QUOTE_STRING_MODE,t.NUMBER_MODE]}}UNn.exports=jMi});var HNn=re((moc,WNn)=>{p();function $Nn(t){return t?typeof t=="string"?t:t.source:null}function VMi(...t){return t.map(n=>$Nn(n)).join("")}function YMi(...t){return"("+t.map(n=>$Nn(n)).join("|")+")"}function zMi(t){let e=["GET","POST","HEAD","PUT","DELETE","CONNECT","OPTIONS","PATCH","TRACE"];return{name:"Apache Access Log",contains:[{className:"number",begin:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?\b/,relevance:5},{className:"number",begin:/\b\d+\b/,relevance:0},{className:"string",begin:VMi(/"/,YMi(...e)),end:/"/,keywords:e,illegal:/\n/,relevance:5,contains:[{begin:/HTTP\/[12]\.\d'/,relevance:5}]},{className:"string",begin:/\[\d[^\]\n]{8,}\]/,illegal:/\n/,relevance:1},{className:"string",begin:/\[/,end:/\]/,illegal:/\n/,relevance:0},{className:"string",begin:/"Mozilla\/\d\.\d \(/,end:/"/,illegal:/\n/,relevance:3},{className:"string",begin:/"/,end:/"/,illegal:/\n/,relevance:0}]}}WNn.exports=zMi});var jNn=re((foc,qNn)=>{p();function KMi(t){return t?typeof t=="string"?t:t.source:null}function JMi(...t){return t.map(n=>KMi(n)).join("")}function XMi(t){let e=/[a-zA-Z_$][a-zA-Z0-9_$]*/,n=/([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)/,r={className:"rest_arg",begin:/[.]{3}/,end:e,relevance:10};return{name:"ActionScript",aliases:["as"],keywords:{keyword:"as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with",literal:"true false null undefined"},contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,{className:"class",beginKeywords:"package",end:/\{/,contains:[t.TITLE_MODE]},{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.TITLE_MODE]},{className:"meta",beginKeywords:"import include",end:/;/,keywords:{"meta-keyword":"import include"}},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,illegal:/\S/,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,r]},{begin:JMi(/:\s*/,n)}]},t.METHOD_GUARD],illegal:/#/}}qNn.exports=XMi});var YNn=re((Aoc,VNn)=>{p();function ZMi(t){let e="\\d(_|\\d)*",n="[eE][-+]?"+e,r=e+"(\\."+e+")?("+n+")?",i="\\w+",o="\\b("+(e+"#"+i+"(\\."+i+")?#("+n+")?")+"|"+r+")",a="[A-Za-z](_?[A-Za-z0-9.])*",c=`[]\\{\\}%#'"`,u=t.COMMENT("--","$"),l={begin:"\\s+:\\s+",end:"\\s*(:=|;|\\)|=>|$)",illegal:c,contains:[{beginKeywords:"loop for declare others",endsParent:!0},{className:"keyword",beginKeywords:"not null constant access function procedure in out aliased exception"},{className:"type",begin:a,endsParent:!0,relevance:0}]};return{name:"Ada",case_insensitive:!0,keywords:{keyword:"abort else new return abs elsif not reverse abstract end accept entry select access exception of separate aliased exit or some all others subtype and for out synchronized array function overriding at tagged generic package task begin goto pragma terminate body private then if procedure type case in protected constant interface is raise use declare range delay limited record when delta loop rem while digits renames with do mod requeue xor",literal:"True False"},contains:[u,{className:"string",begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{className:"string",begin:/'.'/},{className:"number",begin:o,relevance:0},{className:"symbol",begin:"'"+a},{className:"title",begin:"(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?",end:"(is|$)",keywords:"package body",excludeBegin:!0,excludeEnd:!0,illegal:c},{begin:"(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+",end:"(\\bis|\\bwith|\\brenames|\\)\\s*;)",keywords:"overriding function procedure with is renames return",returnBegin:!0,contains:[u,{className:"title",begin:"(\\bwith\\s+)?\\b(function|procedure)\\s+",end:"(\\(|\\s+|$)",excludeBegin:!0,excludeEnd:!0,illegal:c},l,{className:"type",begin:"\\breturn\\s+",end:"(\\s+|;|$)",keywords:"return",excludeBegin:!0,excludeEnd:!0,endsParent:!0,illegal:c}]},{className:"type",begin:"\\b(sub)?type\\s+",end:"\\s+",keywords:"type",excludeBegin:!0,illegal:c},l]}}VNn.exports=ZMi});var KNn=re((Eoc,zNn)=>{p();function eOi(t){var e={className:"built_in",begin:"\\b(void|bool|int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|string|ref|array|double|float|auto|dictionary)"},n={className:"symbol",begin:"[a-zA-Z0-9_]+@"},r={className:"keyword",begin:"<",end:">",contains:[e,n]};return e.contains=[r],n.contains=[r],{name:"AngelScript",aliases:["asc"],keywords:"for in|0 break continue while do|0 return if else case switch namespace is cast or and xor not get|0 in inout|10 out override set|0 private public const default|0 final shared external mixin|10 enum typedef funcdef this super import from interface abstract|0 try catch protected explicit property",illegal:"(^using\\s+[A-Za-z0-9_\\.]+;$|\\bfunction\\s*[^\\(])",contains:[{className:"string",begin:"'",end:"'",illegal:"\\n",contains:[t.BACKSLASH_ESCAPE],relevance:0},{className:"string",begin:'"""',end:'"""'},{className:"string",begin:'"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE],relevance:0},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",begin:"^\\s*\\[",end:"\\]"},{beginKeywords:"interface namespace",end:/\{/,illegal:"[;.\\-]",contains:[{className:"symbol",begin:"[a-zA-Z0-9_]+"}]},{beginKeywords:"class",end:/\{/,illegal:"[;.\\-]",contains:[{className:"symbol",begin:"[a-zA-Z0-9_]+",contains:[{begin:"[:,]\\s*",contains:[{className:"symbol",begin:"[a-zA-Z0-9_]+"}]}]}]},e,n,{className:"literal",begin:"\\b(null|true|false)"},{className:"number",relevance:0,begin:"(-?)(\\b0[xXbBoOdD][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?f?|\\.\\d+f?)([eE][-+]?\\d+f?)?)"}]}}zNn.exports=eOi});var XNn=re((_oc,JNn)=>{p();function tOi(t){let e={className:"number",begin:/[$%]\d+/},n={className:"number",begin:/\d+/},r={className:"number",begin:/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?/},i={className:"number",begin:/:\d{1,5}/};return{name:"Apache config",aliases:["apacheconf"],case_insensitive:!0,contains:[t.HASH_COMMENT_MODE,{className:"section",begin:/<\/?/,end:/>/,contains:[r,i,t.inherit(t.QUOTE_STRING_MODE,{relevance:0})]},{className:"attribute",begin:/\w+/,relevance:0,keywords:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{end:/$/,relevance:0,keywords:{literal:"on off all deny allow"},contains:[{className:"meta",begin:/\s\[/,end:/\]$/},{className:"variable",begin:/[\$%]\{/,end:/\}/,contains:["self",e]},r,n,t.QUOTE_STRING_MODE]}}],illegal:/\S/}}JNn.exports=tOi});var rDn=re((Soc,nDn)=>{p();function tDn(t){return t?typeof t=="string"?t:t.source:null}function ZNn(...t){return t.map(n=>tDn(n)).join("")}function eDn(...t){return"("+t.map(n=>tDn(n)).join("|")+")"}function nOi(t){let e=t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),n={className:"params",begin:/\(/,end:/\)/,contains:["self",t.C_NUMBER_MODE,e]},r=t.COMMENT(/--/,/$/),i=t.COMMENT(/\(\*/,/\*\)/,{contains:["self",r]}),s=[r,i,t.HASH_COMMENT_MODE],o=[/apart from/,/aside from/,/instead of/,/out of/,/greater than/,/isn't|(doesn't|does not) (equal|come before|come after|contain)/,/(greater|less) than( or equal)?/,/(starts?|ends|begins?) with/,/contained by/,/comes (before|after)/,/a (ref|reference)/,/POSIX (file|path)/,/(date|time) string/,/quoted form/],a=[/clipboard info/,/the clipboard/,/info for/,/list (disks|folder)/,/mount volume/,/path to/,/(close|open for) access/,/(get|set) eof/,/current date/,/do shell script/,/get volume settings/,/random number/,/set volume/,/system attribute/,/system info/,/time to GMT/,/(load|run|store) script/,/scripting components/,/ASCII (character|number)/,/localized string/,/choose (application|color|file|file name|folder|from list|remote application|URL)/,/display (alert|dialog)/];return{name:"AppleScript",aliases:["osascript"],keywords:{keyword:"about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the|0 then third through thru timeout times to transaction try until where while whose with without",literal:"AppleScript false linefeed return pi quote result space tab true",built_in:"alias application boolean class constant date file integer list number real record string text activate beep count delay launch log offset read round run say summarize write character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"},contains:[e,t.C_NUMBER_MODE,{className:"built_in",begin:ZNn(/\b/,eDn(...a),/\b/)},{className:"built_in",begin:/^\s*return\b/},{className:"literal",begin:/\b(text item delimiters|current application|missing value)\b/},{className:"keyword",begin:ZNn(/\b/,eDn(...o),/\b/)},{beginKeywords:"on",illegal:/[${=;\n]/,contains:[t.UNDERSCORE_TITLE_MODE,n]},...s],illegal:/\/\/|->|=>|\[\[/}}nDn.exports=nOi});var sDn=re((Ioc,iDn)=>{p();function rOi(t){let e="[A-Za-z_][0-9A-Za-z_]*",n={keyword:"if for while var new function do return void else break",literal:"BackSlash DoubleQuote false ForwardSlash Infinity NaN NewLine null PI SingleQuote Tab TextFormatting true undefined",built_in:"Abs Acos Angle Attachments Area AreaGeodetic Asin Atan Atan2 Average Bearing Boolean Buffer BufferGeodetic Ceil Centroid Clip Console Constrain Contains Cos Count Crosses Cut Date DateAdd DateDiff Day Decode DefaultValue Dictionary Difference Disjoint Distance DistanceGeodetic Distinct DomainCode DomainName Equals Exp Extent Feature FeatureSet FeatureSetByAssociation FeatureSetById FeatureSetByPortalItem FeatureSetByRelationshipName FeatureSetByTitle FeatureSetByUrl Filter First Floor Geometry GroupBy Guid HasKey Hour IIf IndexOf Intersection Intersects IsEmpty IsNan IsSelfIntersecting Length LengthGeodetic Log Max Mean Millisecond Min Minute Month MultiPartToSinglePart Multipoint NextSequenceValue Now Number OrderBy Overlaps Point Polygon Polyline Portal Pow Random Relate Reverse RingIsClockWise Round Second SetGeometry Sin Sort Sqrt Stdev Sum SymmetricDifference Tan Text Timestamp Today ToLocal Top Touches ToUTC TrackCurrentTime TrackGeometryWindow TrackIndex TrackStartTime TrackWindow TypeOf Union UrlEncode Variance Weekday When Within Year "},r={className:"symbol",begin:"\\$[datastore|feature|layer|map|measure|sourcefeature|sourcelayer|targetfeature|targetlayer|value|view]+"},i={className:"number",variants:[{begin:"\\b(0[bB][01]+)"},{begin:"\\b(0[oO][0-7]+)"},{begin:t.C_NUMBER_RE}],relevance:0},s={className:"subst",begin:"\\$\\{",end:"\\}",keywords:n,contains:[]},o={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,s]};s.contains=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,o,i,t.REGEXP_MODE];let a=s.contains.concat([t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]);return{name:"ArcGIS Arcade",keywords:n,contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,o,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,r,i,{begin:/[{,]\s*/,relevance:0,contains:[{begin:e+"\\s*:",returnBegin:!0,relevance:0,contains:[{className:"attr",begin:e,relevance:0}]}]},{begin:"("+t.RE_STARTERS_RE+"|\\b(return)\\b)\\s*",keywords:"return",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+e+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:a}]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:e}),{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:a}],illegal:/\[|%/},{begin:/\$[(.]/}],illegal:/#(?!!)/}}iDn.exports=rOi});var aDn=re((Toc,oDn)=>{p();function iOi(t){return t?typeof t=="string"?t:t.source:null}function sOi(t){return Lat("(?=",t,")")}function LTe(t){return Lat("(",t,")?")}function Lat(...t){return t.map(n=>iOi(n)).join("")}function oOi(t){let e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",s="("+n+"|"+LTe(r)+"[a-zA-Z_]\\w*"+LTe("<[^<>]+>")+")",o={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:LTe(r)+t.IDENT_RE,relevance:0},m=LTe(r)+t.IDENT_RE+"\\s*\\(",f={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"_Bool _Complex _Imaginary",_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"],literal:"true false nullptr NULL"},g={className:"function.dispatch",relevance:0,keywords:f,begin:Lat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,t.IDENT_RE,sOi(/\s*\(/))},A=[g,l,o,e,t.C_BLOCK_COMMENT_MODE,u,c],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:A.concat([{begin:/\(/,end:/\)/,keywords:f,contains:A.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+s+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:f,relevance:0},{begin:m,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,e,t.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:f,illegal:"",keywords:f,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:l,strings:c,keywords:f}}}function aOi(t){let e={keyword:"boolean byte word String",built_in:"KeyboardController MouseController SoftwareSerial EthernetServer EthernetClient LiquidCrystal RobotControl GSMVoiceCall EthernetUDP EsploraTFT HttpClient RobotMotor WiFiClient GSMScanner FileSystem Scheduler GSMServer YunClient YunServer IPAddress GSMClient GSMModem Keyboard Ethernet Console GSMBand Esplora Stepper Process WiFiUDP GSM_SMS Mailbox USBHost Firmata PImage Client Server GSMPIN FileIO Bridge Serial EEPROM Stream Mouse Audio Servo File Task GPRS WiFi Wire TFT GSM SPI SD ",_:"setup loop runShellCommandAsynchronously analogWriteResolution retrieveCallingNumber printFirmwareVersion analogReadResolution sendDigitalPortPair noListenOnLocalhost readJoystickButton setFirmwareVersion readJoystickSwitch scrollDisplayRight getVoiceCallStatus scrollDisplayLeft writeMicroseconds delayMicroseconds beginTransmission getSignalStrength runAsynchronously getAsynchronously listenOnLocalhost getCurrentCarrier readAccelerometer messageAvailable sendDigitalPorts lineFollowConfig countryNameWrite runShellCommand readStringUntil rewindDirectory readTemperature setClockDivider readLightSensor endTransmission analogReference detachInterrupt countryNameRead attachInterrupt encryptionType readBytesUntil robotNameWrite readMicrophone robotNameRead cityNameWrite userNameWrite readJoystickY readJoystickX mouseReleased openNextFile scanNetworks noInterrupts digitalWrite beginSpeaker mousePressed isActionDone mouseDragged displayLogos noAutoscroll addParameter remoteNumber getModifiers keyboardRead userNameRead waitContinue processInput parseCommand printVersion readNetworks writeMessage blinkVersion cityNameRead readMessage setDataMode parsePacket isListening setBitOrder beginPacket isDirectory motorsWrite drawCompass digitalRead clearScreen serialEvent rightToLeft setTextSize leftToRight requestFrom keyReleased compassRead analogWrite interrupts WiFiServer disconnect playMelody parseFloat autoscroll getPINUsed setPINUsed setTimeout sendAnalog readSlider analogRead beginWrite createChar motorsStop keyPressed tempoWrite readButton subnetMask debugPrint macAddress writeGreen randomSeed attachGPRS readString sendString remotePort releaseAll mouseMoved background getXChange getYChange answerCall getResult voiceCall endPacket constrain getSocket writeJSON getButton available connected findUntil readBytes exitValue readGreen writeBlue startLoop IPAddress isPressed sendSysex pauseMode gatewayIP setCursor getOemKey tuneWrite noDisplay loadImage switchPIN onRequest onReceive changePIN playFile noBuffer parseInt overflow checkPIN knobRead beginTFT bitClear updateIR bitWrite position writeRGB highByte writeRed setSpeed readBlue noStroke remoteIP transfer shutdown hangCall beginSMS endWrite attached maintain noCursor checkReg checkPUK shiftOut isValid shiftIn pulseIn connect println localIP pinMode getIMEI display noBlink process getBand running beginSD drawBMP lowByte setBand release bitRead prepare pointTo readRed setMode noFill remove listen stroke detach attach noTone exists buffer height bitSet circle config cursor random IRread setDNS endSMS getKey micros millis begin print write ready flush width isPIN blink clear press mkdir rmdir close point yield image BSSID click delay read text move peek beep rect line open seek fill size turn stop home find step tone sqrt RSSI SSID end bit tan cos sin pow map abs max min get run put",literal:"DIGITAL_MESSAGE FIRMATA_STRING ANALOG_MESSAGE REPORT_DIGITAL REPORT_ANALOG INPUT_PULLUP SET_PIN_MODE INTERNAL2V56 SYSTEM_RESET LED_BUILTIN INTERNAL1V1 SYSEX_START INTERNAL EXTERNAL DEFAULT OUTPUT INPUT HIGH LOW"},n=oOi(t),r=n.keywords;return r.keyword+=" "+e.keyword,r.literal+=" "+e.literal,r.built_in+=" "+e.built_in,r._+=" "+e._,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}oDn.exports=aOi});var lDn=re((Roc,cDn)=>{p();function cOi(t){let e={variants:[t.COMMENT("^[ \\t]*(?=#)","$",{relevance:0,excludeBegin:!0}),t.COMMENT("[;@]","$",{relevance:0}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]};return{name:"ARM Assembly",case_insensitive:!0,aliases:["arm"],keywords:{$pattern:"\\.?"+t.IDENT_RE,meta:".2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .arm .thumb .code16 .code32 .force_thumb .thumb_func .ltorg ALIAS ALIGN ARM AREA ASSERT ATTR CN CODE CODE16 CODE32 COMMON CP DATA DCB DCD DCDU DCDO DCFD DCFDU DCI DCQ DCQU DCW DCWU DN ELIF ELSE END ENDFUNC ENDIF ENDP ENTRY EQU EXPORT EXPORTAS EXTERN FIELD FILL FUNCTION GBLA GBLL GBLS GET GLOBAL IF IMPORT INCBIN INCLUDE INFO KEEP LCLA LCLL LCLS LTORG MACRO MAP MEND MEXIT NOFP OPT PRESERVE8 PROC QN READONLY RELOC REQUIRE REQUIRE8 RLIST FN ROUT SETA SETL SETS SN SPACE SUBT THUMB THUMBX TTL WHILE WEND ",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 pc lr sp ip sl sb fp a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 q0 q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 cpsr_c cpsr_x cpsr_s cpsr_f cpsr_cx cpsr_cxs cpsr_xs cpsr_xsf cpsr_sf cpsr_cxsf spsr_c spsr_x spsr_s spsr_f spsr_cx spsr_cxs spsr_xs spsr_xsf spsr_sf spsr_cxsf s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30 d31 {PC} {VAR} {TRUE} {FALSE} {OPT} {CONFIG} {ENDIAN} {CODESIZE} {CPU} {FPU} {ARCHITECTURE} {PCSTOREOFFSET} {ARMASM_VERSION} {INTER} {ROPI} {RWPI} {SWST} {NOSWST} . @"},contains:[{className:"keyword",begin:"\\b(adc|(qd?|sh?|u[qh]?)?add(8|16)?|usada?8|(q|sh?|u[qh]?)?(as|sa)x|and|adrl?|sbc|rs[bc]|asr|b[lx]?|blx|bxj|cbn?z|tb[bh]|bic|bfc|bfi|[su]bfx|bkpt|cdp2?|clz|clrex|cmp|cmn|cpsi[ed]|cps|setend|dbg|dmb|dsb|eor|isb|it[te]{0,3}|lsl|lsr|ror|rrx|ldm(([id][ab])|f[ds])?|ldr((s|ex)?[bhd])?|movt?|mvn|mra|mar|mul|[us]mull|smul[bwt][bt]|smu[as]d|smmul|smmla|mla|umlaal|smlal?([wbt][bt]|d)|mls|smlsl?[ds]|smc|svc|sev|mia([bt]{2}|ph)?|mrr?c2?|mcrr2?|mrs|msr|orr|orn|pkh(tb|bt)|rbit|rev(16|sh)?|sel|[su]sat(16)?|nop|pop|push|rfe([id][ab])?|stm([id][ab])?|str(ex)?[bhd]?|(qd?)?sub|(sh?|q|u[qh]?)?sub(8|16)|[su]xt(a?h|a?b(16)?)|srs([id][ab])?|swpb?|swi|smi|tst|teq|wfe|wfi|yield)(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo)?[sptrx]?(?=\\s)"},e,t.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",relevance:0},{className:"title",begin:"\\|",end:"\\|",illegal:"\\n",relevance:0},{className:"number",variants:[{begin:"[#$=]?0x[0-9a-f]+"},{begin:"[#$=]?0b[01]+"},{begin:"[#$=]\\d+"},{begin:"\\b\\d+"}],relevance:0},{className:"symbol",variants:[{begin:"^[ \\t]*[a-z_\\.\\$][a-z0-9_\\.\\$]+:"},{begin:"^[a-z_\\.\\$][a-z0-9_\\.\\$]+"},{begin:"[=#]\\w+"}],relevance:0}]}}cDn.exports=cOi});var mDn=re((Boc,pDn)=>{p();function dDn(t){return t?typeof t=="string"?t:t.source:null}function uDn(t){return nQ("(?=",t,")")}function lOi(t){return nQ("(",t,")?")}function nQ(...t){return t.map(n=>dDn(n)).join("")}function uOi(...t){return"("+t.map(n=>dDn(n)).join("|")+")"}function dOi(t){let e=nQ(/[A-Z_]/,lOi(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),n=/[A-Za-z0-9._:-]+/,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"meta-keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(i,{begin:/\(/,end:/\)/}),o=t.inherit(t.APOS_STRING_MODE,{className:"meta-string"}),a=t.inherit(t.QUOTE_STRING_MODE,{className:"meta-string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,a,o,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,s,a,o]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:nQ(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:e,relevance:0,starts:c}]},{className:"tag",begin:nQ(/<\//,uDn(nQ(e,/>/))),contains:[{className:"name",begin:e,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}pDn.exports=dOi});var gDn=re((Doc,fDn)=>{p();function pOi(t){return t?typeof t=="string"?t:t.source:null}function hDn(...t){return t.map(n=>pOi(n)).join("")}function mOi(t){let e={begin:"^'{3,}[ \\t]*$",relevance:10},n=[{begin:/\\[*_`]/},{begin:/\\\\\*{2}[^\n]*?\*{2}/},{begin:/\\\\_{2}[^\n]*_{2}/},{begin:/\\\\`{2}[^\n]*`{2}/},{begin:/[:;}][*_`](?![*_`])/}],r=[{className:"strong",begin:/\*{2}([^\n]+?)\*{2}/},{className:"strong",begin:hDn(/\*\*/,/((\*(?!\*)|\\[^\n]|[^*\n\\])+\n)+/,/(\*(?!\*)|\\[^\n]|[^*\n\\])*/,/\*\*/),relevance:0},{className:"strong",begin:/\B\*(\S|\S[^\n]*?\S)\*(?!\w)/},{className:"strong",begin:/\*[^\s]([^\n]+\n)+([^\n]+)\*/}],i=[{className:"emphasis",begin:/_{2}([^\n]+?)_{2}/},{className:"emphasis",begin:hDn(/__/,/((_(?!_)|\\[^\n]|[^_\n\\])+\n)+/,/(_(?!_)|\\[^\n]|[^_\n\\])*/,/__/),relevance:0},{className:"emphasis",begin:/\b_(\S|\S[^\n]*?\S)_(?!\w)/},{className:"emphasis",begin:/_[^\s]([^\n]+\n)+([^\n]+)_/},{className:"emphasis",begin:"\\B'(?!['\\s])",end:"(\\n{2}|')",contains:[{begin:"\\\\'\\w",relevance:0}],relevance:0}],s={className:"symbol",begin:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",relevance:10},o={className:"bullet",begin:"^(\\*+|-+|\\.+|[^\\n]+?::)\\s+"};return{name:"AsciiDoc",aliases:["adoc"],contains:[t.COMMENT("^/{4,}\\n","\\n/{4,}$",{relevance:10}),t.COMMENT("^//","$",{relevance:0}),{className:"title",begin:"^\\.\\w.*$"},{begin:"^[=\\*]{4,}\\n",end:"\\n^[=\\*]{4,}$",relevance:10},{className:"section",relevance:10,variants:[{begin:"^(={1,6})[ ].+?([ ]\\1)?$"},{begin:"^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$"}]},{className:"meta",begin:"^:.+?:",end:"\\s",excludeEnd:!0,relevance:10},{className:"meta",begin:"^\\[.+?\\]$",relevance:0},{className:"quote",begin:"^_{4,}\\n",end:"\\n_{4,}$",relevance:10},{className:"code",begin:"^[\\-\\.]{4,}\\n",end:"\\n[\\-\\.]{4,}$",relevance:10},{begin:"^\\+{4,}\\n",end:"\\n\\+{4,}$",contains:[{begin:"<",end:">",subLanguage:"xml",relevance:0}],relevance:10},o,s,...n,...r,...i,{className:"string",variants:[{begin:"``.+?''"},{begin:"`.+?'"}]},{className:"code",begin:/`{2}/,end:/(\n{2}|`{2})/},{className:"code",begin:"(`.+?`|\\+.+?\\+)",relevance:0},{className:"code",begin:"^[ \\t]",end:"$",relevance:0},e,{begin:"(link:)?(http|https|ftp|file|irc|image:?):\\S+?\\[[^[]*?\\]",returnBegin:!0,contains:[{begin:"(link|image:?):",relevance:0},{className:"link",begin:"\\w",end:"[^\\[]+",relevance:0},{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0,relevance:0}],relevance:10}]}}fDn.exports=mOi});var yDn=re((Moc,ADn)=>{p();function hOi(t){return t?typeof t=="string"?t:t.source:null}function Fat(...t){return t.map(n=>hOi(n)).join("")}function fOi(t){let e="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance",n="get set args call";return{name:"AspectJ",keywords:e,illegal:/<\/|#/,contains:[t.COMMENT(/\/\*\*/,/\*\//,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:/@[A-Za-z]+/}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"class",beginKeywords:"aspect",end:/[{;=]/,excludeEnd:!0,illegal:/[:;"\[\]]/,contains:[{beginKeywords:"extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton"},t.UNDERSCORE_TITLE_MODE,{begin:/\([^\)]*/,end:/[)]+/,keywords:e+" "+n,excludeEnd:!1}]},{className:"class",beginKeywords:"class interface",end:/[{;=]/,excludeEnd:!0,relevance:0,keywords:"class interface",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"pointcut after before around throwing returning",end:/[)]/,excludeEnd:!1,illegal:/["\[\]]/,contains:[{begin:Fat(t.UNDERSCORE_IDENT_RE,/\s*\(/),returnBegin:!0,contains:[t.UNDERSCORE_TITLE_MODE]}]},{begin:/[:]/,returnBegin:!0,end:/[{;]/,relevance:0,excludeEnd:!1,keywords:e,illegal:/["\[\]]/,contains:[{begin:Fat(t.UNDERSCORE_IDENT_RE,/\s*\(/),keywords:e+" "+n,relevance:0},t.QUOTE_STRING_MODE]},{beginKeywords:"new throw",relevance:0},{className:"function",begin:/\w+ +\w+(\.\w+)?\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]/,returnBegin:!0,end:/[{;=]/,keywords:e,excludeEnd:!0,contains:[{begin:Fat(t.UNDERSCORE_IDENT_RE,/\s*\(/),returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,relevance:0,keywords:e,contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},t.C_NUMBER_MODE,{className:"meta",begin:/@[A-Za-z]+/}]}}ADn.exports=fOi});var bDn=re((Loc,EDn)=>{p();function gOi(t){let e={begin:"`[\\s\\S]"};return{name:"AutoHotkey",case_insensitive:!0,aliases:["ahk"],keywords:{keyword:"Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group",literal:"true false NOT AND OR",built_in:"ComSpec Clipboard ClipboardAll ErrorLevel"},contains:[e,t.inherit(t.QUOTE_STRING_MODE,{contains:[e]}),t.COMMENT(";","$",{relevance:0}),t.C_BLOCK_COMMENT_MODE,{className:"number",begin:t.NUMBER_RE,relevance:0},{className:"variable",begin:"%[a-zA-Z0-9#_$@]+%"},{className:"built_in",begin:"^\\s*\\w+\\s*(,|%)"},{className:"title",variants:[{begin:'^[^\\n";]+::(?!=)'},{begin:'^[^\\n";]+:(?!=)',relevance:0}]},{className:"meta",begin:"^\\s*#\\w+",end:"$",relevance:0},{className:"built_in",begin:"A_[a-zA-Z0-9]+"},{begin:",\\s*,"}]}}EDn.exports=gOi});var xDn=re((Qoc,_Dn)=>{p();function AOi(t){let e="ByRef Case Const ContinueCase ContinueLoop Dim Do Else ElseIf EndFunc EndIf EndSelect EndSwitch EndWith Enum Exit ExitLoop For Func Global If In Local Next ReDim Return Select Static Step Switch Then To Until Volatile WEnd While With",n=["EndRegion","forcedef","forceref","ignorefunc","include","include-once","NoTrayIcon","OnAutoItStartRegister","pragma","Region","RequireAdmin","Tidy_Off","Tidy_On","Tidy_Parameters"],r="True False And Null Not Or Default",i="Abs ACos AdlibRegister AdlibUnRegister Asc AscW ASin Assign ATan AutoItSetOption AutoItWinGetTitle AutoItWinSetTitle Beep Binary BinaryLen BinaryMid BinaryToString BitAND BitNOT BitOR BitRotate BitShift BitXOR BlockInput Break Call CDTray Ceiling Chr ChrW ClipGet ClipPut ConsoleRead ConsoleWrite ConsoleWriteError ControlClick ControlCommand ControlDisable ControlEnable ControlFocus ControlGetFocus ControlGetHandle ControlGetPos ControlGetText ControlHide ControlListView ControlMove ControlSend ControlSetText ControlShow ControlTreeView Cos Dec DirCopy DirCreate DirGetSize DirMove DirRemove DllCall DllCallAddress DllCallbackFree DllCallbackGetPtr DllCallbackRegister DllClose DllOpen DllStructCreate DllStructGetData DllStructGetPtr DllStructGetSize DllStructSetData DriveGetDrive DriveGetFileSystem DriveGetLabel DriveGetSerial DriveGetType DriveMapAdd DriveMapDel DriveMapGet DriveSetLabel DriveSpaceFree DriveSpaceTotal DriveStatus EnvGet EnvSet EnvUpdate Eval Execute Exp FileChangeDir FileClose FileCopy FileCreateNTFSLink FileCreateShortcut FileDelete FileExists FileFindFirstFile FileFindNextFile FileFlush FileGetAttrib FileGetEncoding FileGetLongName FileGetPos FileGetShortcut FileGetShortName FileGetSize FileGetTime FileGetVersion FileInstall FileMove FileOpen FileOpenDialog FileRead FileReadLine FileReadToArray FileRecycle FileRecycleEmpty FileSaveDialog FileSelectFolder FileSetAttrib FileSetEnd FileSetPos FileSetTime FileWrite FileWriteLine Floor FtpSetProxy FuncName GUICreate GUICtrlCreateAvi GUICtrlCreateButton GUICtrlCreateCheckbox GUICtrlCreateCombo GUICtrlCreateContextMenu GUICtrlCreateDate GUICtrlCreateDummy GUICtrlCreateEdit GUICtrlCreateGraphic GUICtrlCreateGroup GUICtrlCreateIcon GUICtrlCreateInput GUICtrlCreateLabel GUICtrlCreateList GUICtrlCreateListView GUICtrlCreateListViewItem GUICtrlCreateMenu GUICtrlCreateMenuItem GUICtrlCreateMonthCal GUICtrlCreateObj GUICtrlCreatePic GUICtrlCreateProgress GUICtrlCreateRadio GUICtrlCreateSlider GUICtrlCreateTab GUICtrlCreateTabItem GUICtrlCreateTreeView GUICtrlCreateTreeViewItem GUICtrlCreateUpdown GUICtrlDelete GUICtrlGetHandle GUICtrlGetState GUICtrlRead GUICtrlRecvMsg GUICtrlRegisterListViewSort GUICtrlSendMsg GUICtrlSendToDummy GUICtrlSetBkColor GUICtrlSetColor GUICtrlSetCursor GUICtrlSetData GUICtrlSetDefBkColor GUICtrlSetDefColor GUICtrlSetFont GUICtrlSetGraphic GUICtrlSetImage GUICtrlSetLimit GUICtrlSetOnEvent GUICtrlSetPos GUICtrlSetResizing GUICtrlSetState GUICtrlSetStyle GUICtrlSetTip GUIDelete GUIGetCursorInfo GUIGetMsg GUIGetStyle GUIRegisterMsg GUISetAccelerators GUISetBkColor GUISetCoord GUISetCursor GUISetFont GUISetHelp GUISetIcon GUISetOnEvent GUISetState GUISetStyle GUIStartGroup GUISwitch Hex HotKeySet HttpSetProxy HttpSetUserAgent HWnd InetClose InetGet InetGetInfo InetGetSize InetRead IniDelete IniRead IniReadSection IniReadSectionNames IniRenameSection IniWrite IniWriteSection InputBox Int IsAdmin IsArray IsBinary IsBool IsDeclared IsDllStruct IsFloat IsFunc IsHWnd IsInt IsKeyword IsNumber IsObj IsPtr IsString Log MemGetStats Mod MouseClick MouseClickDrag MouseDown MouseGetCursor MouseGetPos MouseMove MouseUp MouseWheel MsgBox Number ObjCreate ObjCreateInterface ObjEvent ObjGet ObjName OnAutoItExitRegister OnAutoItExitUnRegister Ping PixelChecksum PixelGetColor PixelSearch ProcessClose ProcessExists ProcessGetStats ProcessList ProcessSetPriority ProcessWait ProcessWaitClose ProgressOff ProgressOn ProgressSet Ptr Random RegDelete RegEnumKey RegEnumVal RegRead RegWrite Round Run RunAs RunAsWait RunWait Send SendKeepActive SetError SetExtended ShellExecute ShellExecuteWait Shutdown Sin Sleep SoundPlay SoundSetWaveVolume SplashImageOn SplashOff SplashTextOn Sqrt SRandom StatusbarGetText StderrRead StdinWrite StdioClose StdoutRead String StringAddCR StringCompare StringFormat StringFromASCIIArray StringInStr StringIsAlNum StringIsAlpha StringIsASCII StringIsDigit StringIsFloat StringIsInt StringIsLower StringIsSpace StringIsUpper StringIsXDigit StringLeft StringLen StringLower StringMid StringRegExp StringRegExpReplace StringReplace StringReverse StringRight StringSplit StringStripCR StringStripWS StringToASCIIArray StringToBinary StringTrimLeft StringTrimRight StringUpper Tan TCPAccept TCPCloseSocket TCPConnect TCPListen TCPNameToIP TCPRecv TCPSend TCPShutdown, UDPShutdown TCPStartup, UDPStartup TimerDiff TimerInit ToolTip TrayCreateItem TrayCreateMenu TrayGetMsg TrayItemDelete TrayItemGetHandle TrayItemGetState TrayItemGetText TrayItemSetOnEvent TrayItemSetState TrayItemSetText TraySetClick TraySetIcon TraySetOnEvent TraySetPauseIcon TraySetState TraySetToolTip TrayTip UBound UDPBind UDPCloseSocket UDPOpen UDPRecv UDPSend VarGetType WinActivate WinActive WinClose WinExists WinFlash WinGetCaretPos WinGetClassList WinGetClientSize WinGetHandle WinGetPos WinGetProcess WinGetState WinGetText WinGetTitle WinKill WinList WinMenuSelectItem WinMinimizeAll WinMinimizeAllUndo WinMove WinSetOnTop WinSetState WinSetTitle WinSetTrans WinWait WinWaitActive WinWaitClose WinWaitNotActive",s={variants:[t.COMMENT(";","$",{relevance:0}),t.COMMENT("#cs","#ce"),t.COMMENT("#comments-start","#comments-end")]},o={begin:"\\$[A-z0-9_]+"},a={className:"string",variants:[{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]},c={variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]},u={className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":n},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",keywords:{"meta-keyword":"include"},end:"$",contains:[a,{className:"meta-string",variants:[{begin:"<",end:">"},{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]}]},a,s]},l={className:"symbol",begin:"@[A-z0-9_]+"},d={className:"function",beginKeywords:"Func",end:"$",illegal:"\\$|\\[|%",contains:[t.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)",contains:[o,a,c]}]};return{name:"AutoIt",case_insensitive:!0,illegal:/\/\*/,keywords:{keyword:e,built_in:i,literal:r},contains:[s,o,a,c,u,l,d]}}_Dn.exports=AOi});var CDn=re((Goc,SDn)=>{p();function yOi(t){return{name:"AVR Assembly",case_insensitive:!0,keywords:{$pattern:"\\.?"+t.IDENT_RE,keyword:"adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf",meta:".byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list .listmac .macro .nolist .org .set"},contains:[t.C_BLOCK_COMMENT_MODE,t.COMMENT(";","$",{relevance:0}),t.C_NUMBER_MODE,t.BINARY_NUMBER_MODE,{className:"number",begin:"\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"},t.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",illegal:"[^\\\\][^']"},{className:"symbol",begin:"^[A-Za-z0-9_.$]+:"},{className:"meta",begin:"#",end:"$"},{className:"subst",begin:"@[0-9]+"}]}}SDn.exports=yOi});var wDn=re((Woc,IDn)=>{p();function EOi(t){let e={className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},n="BEGIN END if else while do for in break continue delete next nextfile function func exit|10",r={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/(u|b)?r?'''/,end:/'''/,relevance:10},{begin:/(u|b)?r?"""/,end:/"""/,relevance:10},{begin:/(u|r|ur)'/,end:/'/,relevance:10},{begin:/(u|r|ur)"/,end:/"/,relevance:10},{begin:/(b|br)'/,end:/'/},{begin:/(b|br)"/,end:/"/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]};return{name:"Awk",keywords:{keyword:n},contains:[e,r,t.REGEXP_MODE,t.HASH_COMMENT_MODE,t.NUMBER_MODE]}}IDn.exports=EOi});var vDn=re((qoc,TDn)=>{p();function bOi(t){return{name:"X++",aliases:["x++"],keywords:{keyword:["abstract","as","asc","avg","break","breakpoint","by","byref","case","catch","changecompany","class","client","client","common","const","continue","count","crosscompany","delegate","delete_from","desc","display","div","do","edit","else","eventhandler","exists","extends","final","finally","firstfast","firstonly","firstonly1","firstonly10","firstonly100","firstonly1000","flush","for","forceliterals","forcenestedloop","forceplaceholders","forceselectorder","forupdate","from","generateonly","group","hint","if","implements","in","index","insert_recordset","interface","internal","is","join","like","maxof","minof","mod","namespace","new","next","nofetch","notexists","optimisticlock","order","outer","pessimisticlock","print","private","protected","public","readonly","repeatableread","retry","return","reverse","select","server","setting","static","sum","super","switch","this","throw","try","ttsabort","ttsbegin","ttscommit","unchecked","update_recordset","using","validtimestate","void","where","while"],built_in:["anytype","boolean","byte","char","container","date","double","enum","guid","int","int64","long","real","short","str","utcdatetime","var"],literal:["default","false","null","true"]},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"#",end:"$"},{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,illegal:":",contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]}]}}TDn.exports=bOi});var kDn=re((Voc,RDn)=>{p();function _Oi(t){return{name:"BASIC",case_insensitive:!0,illegal:"^.",keywords:{$pattern:"[a-zA-Z][a-zA-Z0-9_$%!#]*",keyword:"ABS ASC AND ATN AUTO|0 BEEP BLOAD|10 BSAVE|10 CALL CALLS CDBL CHAIN CHDIR CHR$|10 CINT CIRCLE CLEAR CLOSE CLS COLOR COM COMMON CONT COS CSNG CSRLIN CVD CVI CVS DATA DATE$ DEFDBL DEFINT DEFSNG DEFSTR DEF|0 SEG USR DELETE DIM DRAW EDIT END ENVIRON ENVIRON$ EOF EQV ERASE ERDEV ERDEV$ ERL ERR ERROR EXP FIELD FILES FIX FOR|0 FRE GET GOSUB|10 GOTO HEX$ IF THEN ELSE|0 INKEY$ INP INPUT INPUT# INPUT$ INSTR IMP INT IOCTL IOCTL$ KEY ON OFF LIST KILL LEFT$ LEN LET LINE LLIST LOAD LOC LOCATE LOF LOG LPRINT USING LSET MERGE MID$ MKDIR MKD$ MKI$ MKS$ MOD NAME NEW NEXT NOISE NOT OCT$ ON OR PEN PLAY STRIG OPEN OPTION BASE OUT PAINT PALETTE PCOPY PEEK PMAP POINT POKE POS PRINT PRINT] PSET PRESET PUT RANDOMIZE READ REM RENUM RESET|0 RESTORE RESUME RETURN|0 RIGHT$ RMDIR RND RSET RUN SAVE SCREEN SGN SHELL SIN SOUND SPACE$ SPC SQR STEP STICK STOP STR$ STRING$ SWAP SYSTEM TAB TAN TIME$ TIMER TROFF TRON TO USR VAL VARPTR VARPTR$ VIEW WAIT WHILE WEND WIDTH WINDOW WRITE XOR"},contains:[t.QUOTE_STRING_MODE,t.COMMENT("REM","$",{relevance:10}),t.COMMENT("'","$",{relevance:0}),{className:"symbol",begin:"^[0-9]+ ",relevance:10},{className:"number",begin:"\\b\\d+(\\.\\d+)?([edED]\\d+)?[#!]?",relevance:0},{className:"number",begin:"(&[hH][0-9a-fA-F]{1,4})"},{className:"number",begin:"(&[oO][0-7]{1,6})"}]}}RDn.exports=_Oi});var NDn=re((zoc,BDn)=>{p();function xOi(t){return{name:"Backus\u2013Naur Form",contains:[{className:"attribute",begin://},{begin:/::=/,end:/$/,contains:[{begin://},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]}]}}BDn.exports=xOi});var PDn=re((Joc,DDn)=>{p();function SOi(t){let e={className:"literal",begin:/[+-]/,relevance:0};return{name:"Brainfuck",aliases:["bf"],contains:[t.COMMENT(`[^\\[\\]\\.,\\+\\-<> \r ]`,`[\\[\\]\\.,\\+\\-<> \r -]`,{returnEnd:!0,relevance:0}),{className:"title",begin:"[\\[\\]]",relevance:0},{className:"string",begin:"[\\.,]",relevance:0},{begin:/(?:\+\+|--)/,contains:[e]},e]}}Ean.exports=Uns});var San=ee((Tka,_an)=>{p();function $ns(t){return t?typeof t=="string"?t:t.source:null}function Gns(t){return gze("(?=",t,")")}function m_e(t){return gze("(",t,")?")}function gze(...t){return t.map(n=>$ns(n)).join("")}function Wns(t){let e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",i="("+n+"|"+m_e(r)+"[a-zA-Z_]\\w*"+m_e("<[^<>]+>")+")",o={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:m_e(r)+t.IDENT_RE,relevance:0},h=m_e(r)+t.IDENT_RE+"\\s*\\(",f={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"_Bool _Complex _Imaginary",_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"],literal:"true false nullptr NULL"},g={className:"function.dispatch",relevance:0,keywords:f,begin:gze(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,t.IDENT_RE,Gns(/\s*\(/))},A=[g,l,o,e,t.C_BLOCK_COMMENT_MODE,u,c],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:A.concat([{begin:/\(/,end:/\)/,keywords:f,contains:A.concat(["self"]),relevance:0}]),relevance:0},b={className:"function",begin:"("+i+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:f,relevance:0},{begin:h,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,e,t.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:f,illegal:"",keywords:f,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:l,strings:c,keywords:f}}}function qns(t){let e=Wns(t),n=["c","h"],r=["cc","c++","h++","hpp","hh","hxx","cxx"];return e.disableAutodetect=!0,e.aliases=[],t.getLanguage("c")||e.aliases.push(...n),t.getLanguage("cpp")||e.aliases.push(...r),e}_an.exports=qns});var Ian=ee((Rka,Can)=>{p();function Hns(t){let e="div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to until while with var",n="false true",r=[t.C_LINE_COMMENT_MODE,t.COMMENT(/\{/,/\}/,{relevance:0}),t.COMMENT(/\(\*/,/\*\)/,{relevance:10})],s={className:"string",begin:/'/,end:/'/,contains:[{begin:/''/}]},i={className:"string",begin:/(#\d+)+/},o={className:"number",begin:"\\b\\d+(\\.\\d+)?(DT|D|T)",relevance:0},a={className:"string",begin:'"',end:'"'},c={className:"function",beginKeywords:"procedure",end:/[:;]/,keywords:"procedure|10",contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,keywords:e,contains:[s,i]}].concat(r)},u={className:"class",begin:"OBJECT (Table|Form|Report|Dataport|Codeunit|XMLport|MenuSuite|Page|Query) (\\d+) ([^\\r\\n]+)",returnBegin:!0,contains:[t.TITLE_MODE,c]};return{name:"C/AL",case_insensitive:!0,keywords:{keyword:e,literal:n},illegal:/\/\*/,contains:[s,i,o,a,t.NUMBER_MODE,u,c]}}Can.exports=Hns});var wan=ee((Nka,xan)=>{p();function Vns(t){return{name:"Cap\u2019n Proto",aliases:["capnp"],keywords:{keyword:"struct enum interface union group import using const annotation extends in of on as with from fixed",built_in:"Void Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64 Text Data AnyPointer AnyStruct Capability List",literal:"true false"},contains:[t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.HASH_COMMENT_MODE,{className:"meta",begin:/@0x[\w\d]{16};/,illegal:/\n/},{className:"symbol",begin:/@\d+\b/},{className:"class",beginKeywords:"struct enum",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{className:"class",beginKeywords:"interface",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]}]}}xan.exports=Vns});var van=ee((Bka,Tan)=>{p();function jns(t){let e="assembly module package import alias class interface object given value assign void function new of extends satisfies abstracts in out return break continue throw assert dynamic if else switch case for while try catch finally then let this outer super is exists nonempty",n="shared abstract formal default actual variable late native deprecated final sealed annotation suppressWarnings small",r="doc by license see throws tagged",s={className:"subst",excludeBegin:!0,excludeEnd:!0,begin:/``/,end:/``/,keywords:e,relevance:10},i=[{className:"string",begin:'"""',end:'"""',relevance:10},{className:"string",begin:'"',end:'"',contains:[s]},{className:"string",begin:"'",end:"'"},{className:"number",begin:"#[0-9a-fA-F_]+|\\$[01_]+|[0-9_]+(?:\\.[0-9_](?:[eE][+-]?\\d+)?)?[kMGTPmunpf]?",relevance:0}];return s.contains=i,{name:"Ceylon",keywords:{keyword:e+" "+n,meta:r},illegal:"\\$[^01]|#[^0-9a-fA-F]",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),{className:"meta",begin:'@[a-z]\\w*(?::"[^"]*")?'}].concat(i)}}Tan.exports=jns});var kan=ee((Oka,Ran)=>{p();function Yns(t){return{name:"Clean",aliases:["icl","dcl"],keywords:{keyword:"if let in with where case of class instance otherwise implementation definition system module from import qualified as special code inline foreign export ccall stdcall generic derive infix infixl infixr",built_in:"Int Real Char Bool",literal:"True False"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{begin:"->|<-[|:]?|#!?|>>=|\\{\\||\\|\\}|:==|=:|<>"}]}}Ran.exports=Yns});var Dan=ee((Lka,Nan)=>{p();function Kns(t){let e="a-zA-Z_\\-!.?+*=<>&#'",n="["+e+"]["+e+"0-9/;:]*",r="def defonce defprotocol defstruct defmulti defmethod defn- defn defmacro deftype defrecord",s={$pattern:n,"builtin-name":r+" cond apply if-not if-let if not not= =|0 <|0 >|0 <=|0 >=|0 ==|0 +|0 /|0 *|0 -|0 rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy first rest cons cast coll last butlast sigs reify second ffirst fnext nfirst nnext meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"},i="[-+]?\\d+(\\.\\d+)?",o={begin:n,relevance:0},a={className:"number",begin:i,relevance:0},c=t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),u=t.COMMENT(";","$",{relevance:0}),l={className:"literal",begin:/\b(true|false|nil)\b/},d={begin:"[\\[\\{]",end:"[\\]\\}]"},h={className:"comment",begin:"\\^"+n},m=t.COMMENT("\\^\\{","\\}"),f={className:"symbol",begin:"[:]{1,2}"+n},g={begin:"\\(",end:"\\)"},A={endsWithParent:!0,relevance:0},y={keywords:s,className:"name",begin:n,relevance:0,starts:A},b=[g,c,h,m,u,f,d,a,l,o],S={beginKeywords:r,lexemes:n,end:'(\\[|#|\\d|"|:|\\{|\\)|\\(|$)',contains:[{className:"title",begin:n,relevance:0,excludeEnd:!0,endsParent:!0}].concat(b)};return g.contains=[t.COMMENT("comment",""),S,y,A],A.contains=b,d.contains=b,m.contains=[d],{name:"Clojure",aliases:["clj"],illegal:/\S/,contains:[g,c,h,m,u,f,d,a,l]}}Nan.exports=Kns});var Pan=ee((Qka,Ban)=>{p();function zns(t){return{name:"Clojure REPL",contains:[{className:"meta",begin:/^([\w.-]+|\s*#_)?=>/,starts:{end:/$/,subLanguage:"clojure"}}]}}Ban.exports=zns});var Man=ee(($ka,Oan)=>{p();function Jns(t){return{name:"CMake",aliases:["cmake.in"],case_insensitive:!0,keywords:{keyword:"break cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue elseif else endforeach endfunction endif endmacro endwhile execute_process file find_file find_library find_package find_path find_program foreach function get_cmake_property get_directory_property get_filename_component get_property if include include_guard list macro mark_as_advanced math message option return separate_arguments set_directory_properties set_property set site_name string unset variable_watch while add_compile_definitions add_compile_options add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_link_options add_subdirectory add_test aux_source_directory build_command create_test_sourcelist define_property enable_language enable_testing export fltk_wrap_ui get_source_file_property get_target_property get_test_property include_directories include_external_msproject include_regular_expression install link_directories link_libraries load_cache project qt_wrap_cpp qt_wrap_ui remove_definitions set_source_files_properties set_target_properties set_tests_properties source_group target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_directories target_link_libraries target_link_options target_sources try_compile try_run ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload build_name exec_program export_library_dependencies install_files install_programs install_targets load_command make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or not command policy target test exists is_newer_than is_directory is_symlink is_absolute matches less greater equal less_equal greater_equal strless strgreater strequal strless_equal strgreater_equal version_less version_greater version_equal version_less_equal version_greater_equal in_list defined"},contains:[{className:"variable",begin:/\$\{/,end:/\}/},t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE]}}Oan.exports=Jns});var Fan=ee((Wka,Lan)=>{p();var Xns=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Zns=["true","false","null","undefined","NaN","Infinity"],ers=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],trs=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nrs=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rrs=["arguments","this","super","console","window","document","localStorage","module","global"],srs=[].concat(nrs,rrs,ers,trs);function irs(t){let e=["npm","print"],n=["yes","no","on","off"],r=["then","unless","until","loop","by","when","and","or","is","isnt","not"],s=["var","const","let","function","static"],i=m=>f=>!m.includes(f),o={keyword:Xns.concat(r).filter(i(s)),literal:Zns.concat(n),built_in:srs.concat(e)},a="[A-Za-z$_][0-9A-Za-z$_]*",c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},u=[t.BINARY_NUMBER_MODE,t.inherit(t.C_NUMBER_MODE,{starts:{end:"(\\s*/)?",relevance:0}}),{className:"string",variants:[{begin:/'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[t.BACKSLASH_ESCAPE]},{begin:/"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c]},{begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,c]}]},{className:"regexp",variants:[{begin:"///",end:"///",contains:[c,t.HASH_COMMENT_MODE]},{begin:"//[gim]{0,3}(?=\\W)",relevance:0},{begin:/\/(?![ *]).*?(?![\\]).\/[gim]{0,3}(?=\W)/}]},{begin:"@"+a},{subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,variants:[{begin:"```",end:"```"},{begin:"`",end:"`"}]}];c.contains=u;let l=t.inherit(t.TITLE_MODE,{begin:a}),d="(\\(.*\\)\\s*)?\\B[-=]>",h={className:"params",begin:"\\([^\\(]",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:o,contains:["self"].concat(u)}]};return{name:"CoffeeScript",aliases:["coffee","cson","iced"],keywords:o,illegal:/\/\*/,contains:u.concat([t.COMMENT("###","###"),t.HASH_COMMENT_MODE,{className:"function",begin:"^\\s*"+a+"\\s*=\\s*"+d,end:"[-=]>",returnBegin:!0,contains:[l,h]},{begin:/[:\(,=]\s*/,relevance:0,contains:[{className:"function",begin:d,end:"[-=]>",returnBegin:!0,contains:[h]}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[l]},l]},{begin:a+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}Lan.exports=irs});var Uan=ee((Hka,Qan)=>{p();function ors(t){return{name:"Coq",keywords:{keyword:"_|0 as at cofix else end exists exists2 fix for forall fun if IF in let match mod Prop return Set then Type using where with Abort About Add Admit Admitted All Arguments Assumptions Axiom Back BackTo Backtrack Bind Blacklist Canonical Cd Check Class Classes Close Coercion Coercions CoFixpoint CoInductive Collection Combined Compute Conjecture Conjectures Constant constr Constraint Constructors Context Corollary CreateHintDb Cut Declare Defined Definition Delimit Dependencies Dependent Derive Drop eauto End Equality Eval Example Existential Existentials Existing Export exporting Extern Extract Extraction Fact Field Fields File Fixpoint Focus for From Function Functional Generalizable Global Goal Grab Grammar Graph Guarded Heap Hint HintDb Hints Hypotheses Hypothesis ident Identity If Immediate Implicit Import Include Inductive Infix Info Initial Inline Inspect Instance Instances Intro Intros Inversion Inversion_clear Language Left Lemma Let Libraries Library Load LoadPath Local Locate Ltac ML Mode Module Modules Monomorphic Morphism Next NoInline Notation Obligation Obligations Opaque Open Optimize Options Parameter Parameters Parametric Path Paths pattern Polymorphic Preterm Print Printing Program Projections Proof Proposition Pwd Qed Quit Rec Record Recursive Redirect Relation Remark Remove Require Reserved Reset Resolve Restart Rewrite Right Ring Rings Save Scheme Scope Scopes Script Search SearchAbout SearchHead SearchPattern SearchRewrite Section Separate Set Setoid Show Solve Sorted Step Strategies Strategy Structure SubClass Table Tables Tactic Term Test Theorem Time Timeout Transparent Type Typeclasses Types Undelimit Undo Unfocus Unfocused Unfold Universe Universes Unset Unshelve using Variable Variables Variant Verbose Visibility where with",built_in:"abstract absurd admit after apply as assert assumption at auto autorewrite autounfold before bottom btauto by case case_eq cbn cbv change classical_left classical_right clear clearbody cofix compare compute congruence constr_eq constructor contradict contradiction cut cutrewrite cycle decide decompose dependent destruct destruction dintuition discriminate discrR do double dtauto eapply eassumption eauto ecase econstructor edestruct ediscriminate eelim eexact eexists einduction einjection eleft elim elimtype enough equality erewrite eright esimplify_eq esplit evar exact exactly_once exfalso exists f_equal fail field field_simplify field_simplify_eq first firstorder fix fold fourier functional generalize generalizing gfail give_up has_evar hnf idtac in induction injection instantiate intro intro_pattern intros intuition inversion inversion_clear is_evar is_var lapply lazy left lia lra move native_compute nia nsatz omega once pattern pose progress proof psatz quote record red refine reflexivity remember rename repeat replace revert revgoals rewrite rewrite_strat right ring ring_simplify rtauto set setoid_reflexivity setoid_replace setoid_rewrite setoid_symmetry setoid_transitivity shelve shelve_unifiable simpl simple simplify_eq solve specialize split split_Rabs split_Rmult stepl stepr subst sum swap symmetry tactic tauto time timeout top transitivity trivial try tryif unfold unify until using vm_compute with"},contains:[t.QUOTE_STRING_MODE,t.COMMENT("\\(\\*","\\*\\)"),t.C_NUMBER_MODE,{className:"type",excludeBegin:!0,begin:"\\|\\s*",end:"\\w+"},{begin:/[-=]>/}]}}Qan.exports=ors});var Gan=ee((jka,$an)=>{p();function ars(t){return{name:"Cach\xE9 Object Script",case_insensitive:!0,aliases:["cls"],keywords:"property parameter class classmethod clientmethod extends as break catch close continue do d|0 else elseif for goto halt hang h|0 if job j|0 kill k|0 lock l|0 merge new open quit q|0 read r|0 return set s|0 tcommit throw trollback try tstart use view while write w|0 xecute x|0 zkill znspace zn ztrap zwrite zw zzdump zzwrite print zbreak zinsert zload zprint zremove zsave zzprint mv mvcall mvcrt mvdim mvprint zquit zsync ascii",contains:[{className:"number",begin:"\\b(\\d+(\\.\\d*)?|\\.\\d+)",relevance:0},{className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]}]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"comment",begin:/;/,end:"$",relevance:0},{className:"built_in",begin:/(?:\$\$?|\.\.)\^?[a-zA-Z]+/},{className:"built_in",begin:/\$\$\$[a-zA-Z]+/},{className:"built_in",begin:/%[a-z]+(?:\.[a-z]+)*/},{className:"symbol",begin:/\^%?[a-zA-Z][\w]*/},{className:"keyword",begin:/##class|##super|#define|#dim/},{begin:/&sql\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,subLanguage:"sql"},{begin:/&(js|jscript|javascript)/,excludeBegin:!0,excludeEnd:!0,subLanguage:"javascript"},{begin:/&html<\s*\s*>/,subLanguage:"xml"}]}}$an.exports=ars});var qan=ee((Kka,Wan)=>{p();function crs(t){let e="primitive rsc_template",n="group clone ms master location colocation order fencing_topology rsc_ticket acl_target acl_group user role tag xml";return{name:"crmsh",aliases:["crm","pcmk"],case_insensitive:!0,keywords:{keyword:"params meta operations op rule attributes utilization"+" "+"read write deny defined not_defined in_range date spec in ref reference attribute type xpath version and or lt gt tag lte gte eq ne \\"+" "+"number string",literal:"Master Started Slave Stopped start promote demote stop monitor true false"},contains:[t.HASH_COMMENT_MODE,{beginKeywords:"node",starts:{end:"\\s*([\\w_-]+:)?",starts:{className:"title",end:"\\s*[\\$\\w_][\\w_-]*"}}},{beginKeywords:e,starts:{className:"title",end:"\\s*[\\$\\w_][\\w_-]*",starts:{end:"\\s*@?[\\w_][\\w_\\.:-]*"}}},{begin:"\\b("+n.split(" ").join("|")+")\\s+",keywords:n,starts:{className:"title",end:"[\\$\\w_][\\w_-]*"}},{beginKeywords:"property rsc_defaults op_defaults",starts:{className:"title",end:"\\s*([\\w_-]+:)?"}},t.QUOTE_STRING_MODE,{className:"meta",begin:"(ocf|systemd|service|lsb):[\\w_:-]+",relevance:0},{className:"number",begin:"\\b\\d+(\\.\\d+)?(ms|s|h|m)?",relevance:0},{className:"literal",begin:"[-]?(infinity|inf)",relevance:0},{className:"attr",begin:/([A-Za-z$_#][\w_-]+)=/,relevance:0},{className:"tag",begin:"",relevance:0}]}}Wan.exports=crs});var Van=ee((Jka,Han)=>{p();function lrs(t){let e="(_?[ui](8|16|32|64|128))?",n="(_?f(32|64))?",r="[a-zA-Z_]\\w*[!?=]?",s="[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~|]|//|//=|&[-+*]=?|&\\*\\*|\\[\\][=?]?",i="[A-Za-z_]\\w*(::\\w+)*(\\?|!)?",o={$pattern:r,keyword:"abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? return require select self sizeof struct super then type typeof union uninitialized unless until verbatim when while with yield __DIR__ __END_LINE__ __FILE__ __LINE__",literal:"false nil true"},a={className:"subst",begin:/#\{/,end:/\}/,keywords:o},c={className:"template-variable",variants:[{begin:"\\{\\{",end:"\\}\\}"},{begin:"\\{%",end:"%\\}"}],keywords:o};function u(A,y){let b=[{begin:A,end:y}];return b[0].contains=b,b}let l={className:"string",contains:[t.BACKSLASH_ESCAPE,a],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[Qwi]?\\(",end:"\\)",contains:u("\\(","\\)")},{begin:"%[Qwi]?\\[",end:"\\]",contains:u("\\[","\\]")},{begin:"%[Qwi]?\\{",end:/\}/,contains:u(/\{/,/\}/)},{begin:"%[Qwi]?<",end:">",contains:u("<",">")},{begin:"%[Qwi]?\\|",end:"\\|"},{begin:/<<-\w+$/,end:/^\s*\w+$/}],relevance:0},d={className:"string",variants:[{begin:"%q\\(",end:"\\)",contains:u("\\(","\\)")},{begin:"%q\\[",end:"\\]",contains:u("\\[","\\]")},{begin:"%q\\{",end:/\}/,contains:u(/\{/,/\}/)},{begin:"%q<",end:">",contains:u("<",">")},{begin:"%q\\|",end:"\\|"},{begin:/<<-'\w+'$/,end:/^\s*\w+$/}],relevance:0},h={begin:"(?!%\\})("+t.RE_STARTERS_RE+"|\\n|\\b(case|if|select|unless|until|when|while)\\b)\\s*",keywords:"case if select unless until when while",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,a],variants:[{begin:"//[a-z]*",relevance:0},{begin:"/(?!\\/)",end:"/[a-z]*"}]}],relevance:0},m={className:"regexp",contains:[t.BACKSLASH_ESCAPE,a],variants:[{begin:"%r\\(",end:"\\)",contains:u("\\(","\\)")},{begin:"%r\\[",end:"\\]",contains:u("\\[","\\]")},{begin:"%r\\{",end:/\}/,contains:u(/\{/,/\}/)},{begin:"%r<",end:">",contains:u("<",">")},{begin:"%r\\|",end:"\\|"}],relevance:0},f={className:"meta",begin:"@\\[",end:"\\]",contains:[t.inherit(t.QUOTE_STRING_MODE,{className:"meta-string"})]},g=[c,l,d,m,h,f,t.HASH_COMMENT_MODE,{className:"class",beginKeywords:"class module struct",end:"$|;",illegal:/=/,contains:[t.HASH_COMMENT_MODE,t.inherit(t.TITLE_MODE,{begin:i}),{begin:"<"}]},{className:"class",beginKeywords:"lib enum union",end:"$|;",illegal:/=/,contains:[t.HASH_COMMENT_MODE,t.inherit(t.TITLE_MODE,{begin:i})]},{beginKeywords:"annotation",end:"$|;",illegal:/=/,contains:[t.HASH_COMMENT_MODE,t.inherit(t.TITLE_MODE,{begin:i})],relevance:2},{className:"function",beginKeywords:"def",end:/\B\b/,contains:[t.inherit(t.TITLE_MODE,{begin:s,endsParent:!0})]},{className:"function",beginKeywords:"fun macro",end:/\B\b/,contains:[t.inherit(t.TITLE_MODE,{begin:s,endsParent:!0})],relevance:2},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":",contains:[l,{begin:s}],relevance:0},{className:"number",variants:[{begin:"\\b0b([01_]+)"+e},{begin:"\\b0o([0-7_]+)"+e},{begin:"\\b0x([A-Fa-f0-9_]+)"+e},{begin:"\\b([1-9][0-9_]*[0-9]|[0-9])(\\.[0-9][0-9_]*)?([eE]_?[-+]?[0-9_]*)?"+n+"(?!_)"},{begin:"\\b([1-9][0-9_]*|0)"+e}],relevance:0}];return a.contains=g,c.contains=g.slice(1),{name:"Crystal",aliases:["cr"],keywords:o,contains:g}}Han.exports=lrs});var Yan=ee((Zka,jan)=>{p();function urs(t){return{name:"CSP",case_insensitive:!1,keywords:{$pattern:"[a-zA-Z][a-zA-Z0-9_-]*",keyword:"base-uri child-src connect-src default-src font-src form-action frame-ancestors frame-src img-src media-src object-src plugin-types report-uri sandbox script-src style-src"},contains:[{className:"string",begin:"'",end:"'"},{className:"attribute",begin:"^Content",end:":",excludeEnd:!0}]}}jan.exports=urs});var zan=ee((tNa,Kan)=>{p();var drs=t=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]}}),prs=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hrs=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],mrs=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],frs=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],grs=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse();function Ars(t){return t?typeof t=="string"?t:t.source:null}function yrs(t){return Ers("(?=",t,")")}function Ers(...t){return t.map(n=>Ars(n)).join("")}function brs(t){let e=drs(t),n={className:"built_in",begin:/[\w-]+(?=\()/},r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.C_BLOCK_COMMENT_MODE,r,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+mrs.join("|")+")"},{begin:"::("+frs.join("|")+")"}]},{className:"attribute",begin:"\\b("+grs.join("|")+")\\b"},{begin:":",end:"[;}]",contains:[e.HEXCOLOR,e.IMPORTANT,t.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n]},{begin:yrs(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:hrs.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+prs.join("|")+")\\b"}]}}Kan.exports=brs});var Xan=ee((rNa,Jan)=>{p();function _rs(t){let e={$pattern:t.UNDERSCORE_IDENT_RE,keyword:"abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",built_in:"bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring",literal:"false null true"},n="(0|[1-9][\\d_]*)",r="(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)",s="0[bB][01_]+",i="([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)",o="0[xX]"+i,a="([eE][+-]?"+r+")",c="("+r+"(\\.\\d*|"+a+")|\\d+\\."+r+"|\\."+n+a+"?)",u="(0[xX]("+i+"\\."+i+"|\\.?"+i+")[pP][+-]?"+r+")",l="("+n+"|"+s+"|"+o+")",d="("+u+"|"+c+")",h=`\\\\(['"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};`,m={className:"number",begin:"\\b"+l+"(L|u|U|Lu|LU|uL|UL)?",relevance:0},f={className:"number",begin:"\\b("+d+"([fF]|L|i|[fF]i|Li)?|"+l+"(i|[fF]i|Li))",relevance:0},g={className:"string",begin:"'("+h+"|.)",end:"'",illegal:"."},y={className:"string",begin:'"',contains:[{begin:h,relevance:0}],end:'"[cwd]?'},b={className:"string",begin:'[rq]"',end:'"[cwd]?',relevance:5},S={className:"string",begin:"`",end:"`[cwd]?"},C={className:"string",begin:'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',relevance:10},I={className:"string",begin:'q"\\{',end:'\\}"'},x={className:"meta",begin:"^#!",end:"$",relevance:5},w={className:"meta",begin:"#(line)",end:"$",relevance:5},R={className:"keyword",begin:"@[a-zA-Z_][a-zA-Z_\\d]*"},N=t.COMMENT("\\/\\+","\\+\\/",{contains:["self"],relevance:10});return{name:"D",keywords:e,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,N,C,y,b,S,I,f,m,g,x,w,R]}}Jan.exports=_rs});var ecn=ee((iNa,Zan)=>{p();function Srs(t){return t?typeof t=="string"?t:t.source:null}function Crs(...t){return t.map(n=>Srs(n)).join("")}function Irs(t){let e={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:Crs(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.+?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};c.contains.push(u),u.contains.push(c);let l=[e,a];return c.contains=c.contains.concat(l),u.contains=u.contains.concat(l),l=l.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:l},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:l}]}]},e,s,c,u,{className:"quote",begin:"^>\\s+",contains:l,end:"$"},r,n,a,i]}}Zan.exports=Irs});var ncn=ee((aNa,tcn)=>{p();function xrs(t){let e="exports register file shl array record property for mod while set ally label uses raise not stored class safecall var interface or private static exit index inherited to else stdcall override shr asm far resourcestring finalization packed virtual out and protected library do xorwrite goto near function end div overload object unit begin string on inline repeat until destructor write message program with read initialization except default nil if case cdecl in downto threadvar of try pascal const external constructor type public then implementation finally published procedure absolute reintroduce operator as is abstract alias assembler bitpacked break continue cppdecl cvar enumerator experimental platform deprecated unimplemented dynamic export far16 forward generic helper implements interrupt iochecks local name nodefault noreturn nostackframe oldfpccall otherwise saveregisters softfloat specialize strict unaligned varargs ",n=[t.C_LINE_COMMENT_MODE,t.COMMENT(/\{/,/\}/,{relevance:0}),t.COMMENT(/\(\*/,/\*\)/,{relevance:10})],r={className:"meta",variants:[{begin:/\{\$/,end:/\}/},{begin:/\(\*\$/,end:/\*\)/}]},s={className:"string",begin:/'/,end:/'/,contains:[{begin:/''/}]},i={className:"number",relevance:0,variants:[{begin:"\\$[0-9A-Fa-f]+"},{begin:"&[0-7]+"},{begin:"%[01]+"}]},o={className:"string",begin:/(#\d+)+/},a={begin:t.IDENT_RE+"\\s*=\\s*class\\s*\\(",returnBegin:!0,contains:[t.TITLE_MODE]},c={className:"function",beginKeywords:"function constructor destructor procedure",end:/[:;]/,keywords:"function constructor|10 destructor|10 procedure|10",contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,keywords:e,contains:[s,o,r].concat(n)},r].concat(n)};return{name:"Delphi",aliases:["dpr","dfm","pas","pascal","freepascal","lazarus","lpr","lfm"],case_insensitive:!0,keywords:e,illegal:/"|\$[G-Zg-z]|\/\*|<\/|\|/,contains:[s,o,t.NUMBER_MODE,i,a,c,r].concat(n)}}tcn.exports=xrs});var scn=ee((lNa,rcn)=>{p();function wrs(t){return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,variants:[{begin:/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/},{begin:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{begin:/^--- +\d+,\d+ +----$/}]},{className:"comment",variants:[{begin:/Index: /,end:/$/},{begin:/^index/,end:/$/},{begin:/={3,}/,end:/$/},{begin:/^-{3}/,end:/$/},{begin:/^\*{3} /,end:/$/},{begin:/^\+{3}/,end:/$/},{begin:/^\*{15}$/},{begin:/^diff --git/,end:/$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}rcn.exports=wrs});var ocn=ee((dNa,icn)=>{p();function Trs(t){let e={begin:/\|[A-Za-z]+:?/,keywords:{name:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone"},contains:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE]};return{name:"Django",aliases:["jinja"],case_insensitive:!0,subLanguage:"xml",contains:[t.COMMENT(/\{%\s*comment\s*%\}/,/\{%\s*endcomment\s*%\}/),t.COMMENT(/\{#/,/#\}/),{className:"template-tag",begin:/\{%/,end:/%\}/,contains:[{className:"name",begin:/\w+/,keywords:{name:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim"},starts:{endsWithParent:!0,keywords:"in by as",contains:[e],relevance:0}}]},{className:"template-variable",begin:/\{\{/,end:/\}\}/,contains:[e]}]}}icn.exports=Trs});var ccn=ee((hNa,acn)=>{p();function vrs(t){return{name:"DNS Zone",aliases:["bind","zone"],keywords:{keyword:"IN A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME DHCID DLV DNAME DNSKEY DS HIP IPSECKEY KEY KX LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM PTR RRSIG RP SIG SOA SRV SSHFP TA TKEY TLSA TSIG TXT"},contains:[t.COMMENT(";","$",{relevance:0}),{className:"meta",begin:/^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/},{className:"number",begin:"((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-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-Fa-f]{1,4}:){5}(((:[0-9A-Fa-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-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-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-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-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-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-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-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-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-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-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}))|:)))\\b"},{className:"number",begin:"((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])\\b"},t.inherit(t.NUMBER_MODE,{begin:/\b\d+[dhwm]?/})]}}acn.exports=vrs});var ucn=ee((fNa,lcn)=>{p();function Rrs(t){return{name:"Dockerfile",aliases:["docker"],case_insensitive:!0,keywords:"from maintainer expose env arg user onbuild stopsignal",contains:[t.HASH_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{beginKeywords:"run cmd entrypoint volume add copy workdir label healthcheck shell",starts:{end:/[^\\]$/,subLanguage:"bash"}}],illegal:"{p();function krs(t){let e=t.COMMENT(/^\s*@?rem\b/,/$/,{relevance:10});return{name:"Batch file (DOS)",aliases:["bat","cmd"],case_insensitive:!0,illegal:/\/\*/,keywords:{keyword:"if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",built_in:"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux shift cd dir echo setlocal endlocal set pause copy append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color comp compact convert date dir diskcomp diskcopy doskey erase fs find findstr format ftype graftabl help keyb label md mkdir mode more move path pause print popd pushd promt rd recover rem rename replace restore rmdir shift sort start subst time title tree type ver verify vol ping net ipconfig taskkill xcopy ren del"},contains:[{className:"variable",begin:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{className:"function",begin:{className:"symbol",begin:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",relevance:0}.begin,end:"goto:eof",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),e]},{className:"number",begin:"\\b\\d+",relevance:0},e]}}dcn.exports=krs});var mcn=ee((ENa,hcn)=>{p();function Nrs(t){return{keywords:"dsconfig",contains:[{className:"keyword",begin:"^dsconfig",end:/\s/,excludeEnd:!0,relevance:10},{className:"built_in",begin:/(list|create|get|set|delete)-(\w+)/,end:/\s/,excludeEnd:!0,illegal:"!@#$%^&*()",relevance:10},{className:"built_in",begin:/--(\w+)/,end:/\s/,excludeEnd:!0},{className:"string",begin:/"/,end:/"/},{className:"string",begin:/'/,end:/'/},{className:"string",begin:/[\w\-?]+:\w+/,end:/\W/,relevance:0},{className:"string",begin:/\w+(\-\w+)*/,end:/(?=\W)/,relevance:0},t.HASH_COMMENT_MODE]}}hcn.exports=Nrs});var gcn=ee((_Na,fcn)=>{p();function Drs(t){let e={className:"string",variants:[t.inherit(t.QUOTE_STRING_MODE,{begin:'((u8?|U)|L)?"'}),{begin:'(u8?|U)?R"',end:'"',contains:[t.BACKSLASH_ESCAPE]},{begin:"'\\\\?.",end:"'",illegal:"."}]},n={className:"number",variants:[{begin:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},{begin:t.C_NUMBER_RE}],relevance:0},r={className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elif endif define undef ifdef ifndef"},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",end:"$",keywords:{"meta-keyword":"include"},contains:[t.inherit(e,{className:"meta-string"}),{className:"meta-string",begin:"<",end:">",illegal:"\\n"}]},e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},s={className:"variable",begin:/&[a-z\d_]*\b/},i={className:"meta-keyword",begin:"/[a-z][a-z\\d-]*/"},o={className:"symbol",begin:"^\\s*[a-zA-Z_][a-zA-Z\\d_]*:"},a={className:"params",begin:"<",end:">",contains:[n,s]},c={className:"class",begin:/[a-zA-Z_][a-zA-Z\d_@]*\s\{/,end:/[{;=]/,returnBegin:!0,excludeEnd:!0};return{name:"Device Tree",keywords:"",contains:[{className:"class",begin:"/\\s*\\{",end:/\};/,relevance:10,contains:[s,i,o,c,a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,n,e]},s,i,o,c,a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,n,e,r,{begin:t.IDENT_RE+"::",keywords:""}]}}fcn.exports=Drs});var ycn=ee((CNa,Acn)=>{p();function Brs(t){return{name:"Dust",aliases:["dst"],case_insensitive:!0,subLanguage:"xml",contains:[{className:"template-tag",begin:/\{[#\/]/,end:/\}/,illegal:/;/,contains:[{className:"name",begin:/[a-zA-Z\.-]+/,starts:{endsWithParent:!0,relevance:0,contains:[t.QUOTE_STRING_MODE]}}]},{className:"template-variable",begin:/\{/,end:/\}/,illegal:/;/,keywords:"if eq ne lt lte gt gte select default math sep"}]}}Acn.exports=Brs});var bcn=ee((xNa,Ecn)=>{p();function Prs(t){let e=t.COMMENT(/\(\*/,/\*\)/),n={className:"attribute",begin:/^[ ]*[a-zA-Z]+([\s_-]+[a-zA-Z]+)*/},s={begin:/=/,end:/[.;]/,contains:[e,{className:"meta",begin:/\?.*\?/},{className:"string",variants:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{begin:"`",end:"`"}]}]};return{name:"Extended Backus-Naur Form",illegal:/\S/,contains:[e,n,s]}}Ecn.exports=Prs});var Scn=ee((TNa,_cn)=>{p();function Ors(t){let e="[a-zA-Z_][a-zA-Z0-9_.]*(!|\\?)?",n="[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={$pattern:e,keyword:"and false then defined module in return redo retry end for true self when next until do begin unless nil break not case cond alias while ensure or include use alias fn quote require import with|0"},s={className:"subst",begin:/#\{/,end:/\}/,keywords:r},i={className:"number",begin:"(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[1-9][0-9_]*(\\.[0-9_]+([eE][-+]?[0-9]+)?)?)",relevance:0},o=`[/|([{<"']`,a={className:"string",begin:"~[a-z](?="+o+")",contains:[{endsParent:!0,contains:[{contains:[t.BACKSLASH_ESCAPE,s],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/\//,end:/\//},{begin:/\|/,end:/\|/},{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/},{begin:/\{/,end:/\}/},{begin://}]}]}]},c={className:"string",begin:"~[A-Z](?="+o+")",contains:[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/\//,end:/\//},{begin:/\|/,end:/\|/},{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/},{begin:/\{/,end:/\}/},{begin://}]},u={className:"string",contains:[t.BACKSLASH_ESCAPE,s],variants:[{begin:/"""/,end:/"""/},{begin:/'''/,end:/'''/},{begin:/~S"""/,end:/"""/,contains:[]},{begin:/~S"/,end:/"/,contains:[]},{begin:/~S'''/,end:/'''/,contains:[]},{begin:/~S'/,end:/'/,contains:[]},{begin:/'/,end:/'/},{begin:/"/,end:/"/}]},l={className:"function",beginKeywords:"def defp defmacro",end:/\B\b/,contains:[t.inherit(t.TITLE_MODE,{begin:e,endsParent:!0})]},d=t.inherit(l,{className:"class",beginKeywords:"defimpl defmodule defprotocol defrecord",end:/\bdo\b|$|;/}),h=[u,c,a,t.HASH_COMMENT_MODE,d,l,{begin:"::"},{className:"symbol",begin:":(?![\\s:])",contains:[u,{begin:n}],relevance:0},{className:"symbol",begin:e+":(?!:)",relevance:0},i,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))"},{begin:"->"},{begin:"("+t.RE_STARTERS_RE+")\\s*",contains:[t.HASH_COMMENT_MODE,{begin:/\/: (?=\d+\s*[,\]])/,relevance:0,contains:[i]},{className:"regexp",illegal:"\\n",contains:[t.BACKSLASH_ESCAPE,s],variants:[{begin:"/",end:"/[a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}],relevance:0}];return s.contains=h,{name:"Elixir",keywords:r,contains:h}}_cn.exports=Ors});var Icn=ee((RNa,Ccn)=>{p();function Mrs(t){let e={variants:[t.COMMENT("--","$"),t.COMMENT(/\{-/,/-\}/,{contains:["self"]})]},n={className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},r={begin:"\\(",end:"\\)",illegal:'"',contains:[{className:"type",begin:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},e]},s={begin:/\{/,end:/\}/,contains:r.contains},i={className:"string",begin:"'\\\\?.",end:"'",illegal:"."};return{name:"Elm",keywords:"let in if then else case of where module import exposing type alias as infix infixl infixr port effect command subscription",contains:[{beginKeywords:"port effect module",end:"exposing",keywords:"port effect module where command subscription exposing",contains:[r,e],illegal:"\\W\\.|;"},{begin:"import",end:"$",keywords:"import as exposing",contains:[r,e],illegal:"\\W\\.|;"},{begin:"type",end:"$",keywords:"type alias",contains:[n,r,s,e]},{beginKeywords:"infix infixl infixr",end:"$",contains:[t.C_NUMBER_MODE,e]},{begin:"port",end:"$",keywords:"port",contains:[e]},i,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,n,t.inherit(t.TITLE_MODE,{begin:"^[_a-z][\\w']*"}),e,{begin:"->|<-"}],illegal:/;/}}Ccn.exports=Mrs});var wcn=ee((NNa,xcn)=>{p();function Lrs(t){return{name:"ERB",subLanguage:"xml",contains:[t.COMMENT("<%#","%>"),{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0}]}}xcn.exports=Lrs});var vcn=ee((BNa,Tcn)=>{p();function Frs(t){return t?typeof t=="string"?t:t.source:null}function Qrs(...t){return t.map(n=>Frs(n)).join("")}function Urs(t){return{name:"Erlang REPL",keywords:{built_in:"spawn spawn_link self",keyword:"after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"},contains:[{className:"meta",begin:"^[0-9]+> ",relevance:10},t.COMMENT("%","$"),{className:"number",begin:"\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)",relevance:0},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{begin:Qrs(/\?(::)?/,/([A-Z]\w*)/,/((::)[A-Z]\w*)*/)},{begin:"->"},{begin:"ok"},{begin:"!"},{begin:"(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",relevance:0},{begin:"[A-Z][a-zA-Z0-9_']*",relevance:0}]}}Tcn.exports=Urs});var kcn=ee((ONa,Rcn)=>{p();function $rs(t){let e="[a-z'][a-zA-Z0-9_']*",n="("+e+":"+e+"|"+e+")",r={keyword:"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if let not of orelse|10 query receive rem try when xor",literal:"false true"},s=t.COMMENT("%","$"),i={className:"number",begin:"\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)",relevance:0},o={begin:"fun\\s+"+e+"/\\d+"},a={begin:n+"\\(",end:"\\)",returnBegin:!0,relevance:0,contains:[{begin:n,relevance:0},{begin:"\\(",end:"\\)",endsWithParent:!0,returnEnd:!0,relevance:0}]},c={begin:/\{/,end:/\}/,relevance:0},u={begin:"\\b_([A-Z][A-Za-z0-9_]*)?",relevance:0},l={begin:"[A-Z][a-zA-Z0-9_]*",relevance:0},d={begin:"#"+t.UNDERSCORE_IDENT_RE,relevance:0,returnBegin:!0,contains:[{begin:"#"+t.UNDERSCORE_IDENT_RE,relevance:0},{begin:/\{/,end:/\}/,relevance:0}]},h={beginKeywords:"fun receive if try case",end:"end",keywords:r};h.contains=[s,o,t.inherit(t.APOS_STRING_MODE,{className:""}),h,a,t.QUOTE_STRING_MODE,i,c,u,l,d];let m=[s,o,h,a,t.QUOTE_STRING_MODE,i,c,u,l,d];a.contains[1].contains=m,c.contains=m,d.contains[1].contains=m;let f=["-module","-record","-undef","-export","-ifdef","-ifndef","-author","-copyright","-doc","-vsn","-import","-include","-include_lib","-compile","-define","-else","-endif","-file","-behaviour","-behavior","-spec"],g={className:"params",begin:"\\(",end:"\\)",contains:m};return{name:"Erlang",aliases:["erl"],keywords:r,illegal:"(",returnBegin:!0,illegal:"\\(|#|//|/\\*|\\\\|:|;",contains:[g,t.inherit(t.TITLE_MODE,{begin:e})],starts:{end:";|\\.",keywords:r,contains:m}},s,{begin:"^-",end:"\\.",relevance:0,excludeEnd:!0,returnBegin:!0,keywords:{$pattern:"-"+t.IDENT_RE,keyword:f.map(A=>`${A}|1.5`).join(" ")},contains:[g]},i,t.QUOTE_STRING_MODE,d,u,l,c,{begin:/\.$/}]}}Rcn.exports=$rs});var Dcn=ee((LNa,Ncn)=>{p();function Grs(t){return{name:"Excel formulae",aliases:["xlsx","xls"],case_insensitive:!0,keywords:{$pattern:/[a-zA-Z][\w\.]*/,built_in:"ABS ACCRINT ACCRINTM ACOS ACOSH ACOT ACOTH AGGREGATE ADDRESS AMORDEGRC AMORLINC AND ARABIC AREAS ASC ASIN ASINH ATAN ATAN2 ATANH AVEDEV AVERAGE AVERAGEA AVERAGEIF AVERAGEIFS BAHTTEXT BASE BESSELI BESSELJ BESSELK BESSELY BETADIST BETA.DIST BETAINV BETA.INV BIN2DEC BIN2HEX BIN2OCT BINOMDIST BINOM.DIST BINOM.DIST.RANGE BINOM.INV BITAND BITLSHIFT BITOR BITRSHIFT BITXOR CALL CEILING CEILING.MATH CEILING.PRECISE CELL CHAR CHIDIST CHIINV CHITEST CHISQ.DIST CHISQ.DIST.RT CHISQ.INV CHISQ.INV.RT CHISQ.TEST CHOOSE CLEAN CODE COLUMN COLUMNS COMBIN COMBINA COMPLEX CONCAT CONCATENATE CONFIDENCE CONFIDENCE.NORM CONFIDENCE.T CONVERT CORREL COS COSH COT COTH COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS COUPDAYBS COUPDAYS COUPDAYSNC COUPNCD COUPNUM COUPPCD COVAR COVARIANCE.P COVARIANCE.S CRITBINOM CSC CSCH CUBEKPIMEMBER CUBEMEMBER CUBEMEMBERPROPERTY CUBERANKEDMEMBER CUBESET CUBESETCOUNT CUBEVALUE CUMIPMT CUMPRINC DATE DATEDIF DATEVALUE DAVERAGE DAY DAYS DAYS360 DB DBCS DCOUNT DCOUNTA DDB DEC2BIN DEC2HEX DEC2OCT DECIMAL DEGREES DELTA DEVSQ DGET DISC DMAX DMIN DOLLAR DOLLARDE DOLLARFR DPRODUCT DSTDEV DSTDEVP DSUM DURATION DVAR DVARP EDATE EFFECT ENCODEURL EOMONTH ERF ERF.PRECISE ERFC ERFC.PRECISE ERROR.TYPE EUROCONVERT EVEN EXACT EXP EXPON.DIST EXPONDIST FACT FACTDOUBLE FALSE|0 F.DIST FDIST F.DIST.RT FILTERXML FIND FINDB F.INV F.INV.RT FINV FISHER FISHERINV FIXED FLOOR FLOOR.MATH FLOOR.PRECISE FORECAST FORECAST.ETS FORECAST.ETS.CONFINT FORECAST.ETS.SEASONALITY FORECAST.ETS.STAT FORECAST.LINEAR FORMULATEXT FREQUENCY F.TEST FTEST FV FVSCHEDULE GAMMA GAMMA.DIST GAMMADIST GAMMA.INV GAMMAINV GAMMALN GAMMALN.PRECISE GAUSS GCD GEOMEAN GESTEP GETPIVOTDATA GROWTH HARMEAN HEX2BIN HEX2DEC HEX2OCT HLOOKUP HOUR HYPERLINK HYPGEOM.DIST HYPGEOMDIST IF IFERROR IFNA IFS IMABS IMAGINARY IMARGUMENT IMCONJUGATE IMCOS IMCOSH IMCOT IMCSC IMCSCH IMDIV IMEXP IMLN IMLOG10 IMLOG2 IMPOWER IMPRODUCT IMREAL IMSEC IMSECH IMSIN IMSINH IMSQRT IMSUB IMSUM IMTAN INDEX INDIRECT INFO INT INTERCEPT INTRATE IPMT IRR ISBLANK ISERR ISERROR ISEVEN ISFORMULA ISLOGICAL ISNA ISNONTEXT ISNUMBER ISODD ISREF ISTEXT ISO.CEILING ISOWEEKNUM ISPMT JIS KURT LARGE LCM LEFT LEFTB LEN LENB LINEST LN LOG LOG10 LOGEST LOGINV LOGNORM.DIST LOGNORMDIST LOGNORM.INV LOOKUP LOWER MATCH MAX MAXA MAXIFS MDETERM MDURATION MEDIAN MID MIDBs MIN MINIFS MINA MINUTE MINVERSE MIRR MMULT MOD MODE MODE.MULT MODE.SNGL MONTH MROUND MULTINOMIAL MUNIT N NA NEGBINOM.DIST NEGBINOMDIST NETWORKDAYS NETWORKDAYS.INTL NOMINAL NORM.DIST NORMDIST NORMINV NORM.INV NORM.S.DIST NORMSDIST NORM.S.INV NORMSINV NOT NOW NPER NPV NUMBERVALUE OCT2BIN OCT2DEC OCT2HEX ODD ODDFPRICE ODDFYIELD ODDLPRICE ODDLYIELD OFFSET OR PDURATION PEARSON PERCENTILE.EXC PERCENTILE.INC PERCENTILE PERCENTRANK.EXC PERCENTRANK.INC PERCENTRANK PERMUT PERMUTATIONA PHI PHONETIC PI PMT POISSON.DIST POISSON POWER PPMT PRICE PRICEDISC PRICEMAT PROB PRODUCT PROPER PV QUARTILE QUARTILE.EXC QUARTILE.INC QUOTIENT RADIANS RAND RANDBETWEEN RANK.AVG RANK.EQ RANK RATE RECEIVED REGISTER.ID REPLACE REPLACEB REPT RIGHT RIGHTB ROMAN ROUND ROUNDDOWN ROUNDUP ROW ROWS RRI RSQ RTD SEARCH SEARCHB SEC SECH SECOND SERIESSUM SHEET SHEETS SIGN SIN SINH SKEW SKEW.P SLN SLOPE SMALL SQL.REQUEST SQRT SQRTPI STANDARDIZE STDEV STDEV.P STDEV.S STDEVA STDEVP STDEVPA STEYX SUBSTITUTE SUBTOTAL SUM SUMIF SUMIFS SUMPRODUCT SUMSQ SUMX2MY2 SUMX2PY2 SUMXMY2 SWITCH SYD T TAN TANH TBILLEQ TBILLPRICE TBILLYIELD T.DIST T.DIST.2T T.DIST.RT TDIST TEXT TEXTJOIN TIME TIMEVALUE T.INV T.INV.2T TINV TODAY TRANSPOSE TREND TRIM TRIMMEAN TRUE|0 TRUNC T.TEST TTEST TYPE UNICHAR UNICODE UPPER VALUE VAR VAR.P VAR.S VARA VARP VARPA VDB VLOOKUP WEBSERVICE WEEKDAY WEEKNUM WEIBULL WEIBULL.DIST WORKDAY WORKDAY.INTL XIRR XNPV XOR YEAR YEARFRAC YIELD YIELDDISC YIELDMAT Z.TEST ZTEST"},contains:[{begin:/^=/,end:/[^=]/,returnEnd:!0,illegal:/=/,relevance:10},{className:"symbol",begin:/\b[A-Z]{1,2}\d+\b/,end:/[^\d]/,excludeEnd:!0,relevance:0},{className:"symbol",begin:/[A-Z]{0,2}\d*:[A-Z]{0,2}\d*/,relevance:0},t.BACKSLASH_ESCAPE,t.QUOTE_STRING_MODE,{className:"number",begin:t.NUMBER_RE+"(%)?",relevance:0},t.COMMENT(/\bN\(/,/\)/,{excludeBegin:!0,excludeEnd:!0,illegal:/\n/})]}}Ncn.exports=Grs});var Pcn=ee((QNa,Bcn)=>{p();function Wrs(t){return{name:"FIX",contains:[{begin:/[^\u2401\u0001]+/,end:/[\u2401\u0001]/,excludeEnd:!0,returnBegin:!0,returnEnd:!1,contains:[{begin:/([^\u2401\u0001=]+)/,end:/=([^\u2401\u0001=]+)/,returnEnd:!0,returnBegin:!1,className:"attr"},{begin:/=/,end:/([\u2401\u0001])/,excludeEnd:!0,excludeBegin:!0,className:"string"}]}],case_insensitive:!0}}Bcn.exports=Wrs});var Mcn=ee(($Na,Ocn)=>{p();function qrs(t){let e={className:"string",begin:/'(.|\\[xXuU][a-zA-Z0-9]+)'/},n={className:"string",variants:[{begin:'"',end:'"'}]},s={className:"function",beginKeywords:"def",end:/[:={\[(\n;]/,excludeEnd:!0,contains:[{className:"title",relevance:0,begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/}]};return{name:"Flix",keywords:{literal:"true false",keyword:"case class def else enum if impl import in lat rel index let match namespace switch type yield with"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e,n,s,t.C_NUMBER_MODE]}}Ocn.exports=qrs});var Fcn=ee((WNa,Lcn)=>{p();function Hrs(t){return t?typeof t=="string"?t:t.source:null}function Aze(...t){return t.map(n=>Hrs(n)).join("")}function Vrs(t){let e={className:"params",begin:"\\(",end:"\\)"},n={variants:[t.COMMENT("!","$",{relevance:0}),t.COMMENT("^C[ ]","$",{relevance:0}),t.COMMENT("^C$","$",{relevance:0})]},r=/(_[a-z_\d]+)?/,s=/([de][+-]?\d+)?/,i={className:"number",variants:[{begin:Aze(/\b\d+/,/\.(\d*)/,s,r)},{begin:Aze(/\b\d+/,s,r)},{begin:Aze(/\.\d+/,s,r)}],relevance:0},o={className:"function",beginKeywords:"subroutine function program",illegal:"[${=\\n]",contains:[t.UNDERSCORE_TITLE_MODE,e]},a={className:"string",relevance:0,variants:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]};return{name:"Fortran",case_insensitive:!0,aliases:["f90","f95"],keywords:{literal:".False. .True.",keyword:"kind do concurrent local shared while private call intrinsic where elsewhere type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then block endblock endassociate public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. goto save else use module select case access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit continue format pause cycle exit c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg synchronous nopass non_overridable pass protected volatile abstract extends import non_intrinsic value deferred generic final enumerator class associate bind enum c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated c_f_pointer c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure impure integer real character complex logical codimension dimension allocatable|10 parameter external implicit|10 none double precision assign intent optional pointer target in out common equivalence data",built_in:"alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image sync change team co_broadcast co_max co_min co_sum co_reduce"},illegal:/\/\*/,contains:[a,o,{begin:/^C\s*=(?!=)/,relevance:0},n,i]}}Lcn.exports=Vrs});var Ucn=ee((HNa,Qcn)=>{p();function jrs(t){let e={begin:"<",end:">",contains:[t.inherit(t.TITLE_MODE,{begin:/'[a-zA-Z0-9_]+/})]};return{name:"F#",aliases:["fs"],keywords:"abstract and as assert base begin class default delegate do done downcast downto elif else end exception extern false finally for fun function global if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield",illegal:/\/\*/,contains:[{className:"keyword",begin:/\b(yield|return|let|do)!/},{className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},{className:"string",begin:'"""',end:'"""'},t.COMMENT("\\(\\*(\\s)","\\*\\)",{contains:["self"]}),{className:"class",beginKeywords:"type",end:"\\(|=|$",excludeEnd:!0,contains:[t.UNDERSCORE_TITLE_MODE,e]},{className:"meta",begin:"\\[<",end:">\\]",relevance:10},{className:"symbol",begin:"\\B('[A-Za-z])\\b",contains:[t.BACKSLASH_ESCAPE]},t.C_LINE_COMMENT_MODE,t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),t.C_NUMBER_MODE]}}Qcn.exports=jrs});var Gcn=ee((jNa,$cn)=>{p();function Yrs(t){return t?typeof t=="string"?t:t.source:null}function Krs(t){return yze("(",t,")*")}function yze(...t){return t.map(n=>Yrs(n)).join("")}function zrs(t){let e={keyword:"abort acronym acronyms alias all and assign binary card diag display else eq file files for free ge gt if integer le loop lt maximizing minimizing model models ne negative no not option options or ord positive prod put putpage puttl repeat sameas semicont semiint smax smin solve sos1 sos2 sum system table then until using while xor yes",literal:"eps inf na",built_in:"abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power randBinomial randLinear randTriangle round rPower sigmoid sign signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion handleCollect handleDelete handleStatus handleSubmit heapFree heapLimit heapSize jobHandle jobKill jobStatus jobTerminate licenseLevel licenseStatus maxExecError sleep timeClose timeComp timeElapsed timeExec timeStart"},n={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0},r={className:"symbol",variants:[{begin:/=[lgenxc]=/},{begin:/\$/}]},s={className:"comment",variants:[{begin:"'",end:"'"},{begin:'"',end:'"'}],illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},i={begin:"/",end:"/",keywords:e,contains:[s,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,t.C_NUMBER_MODE]},o=/[a-z0-9&#*=?@\\><:,()$[\]_.{}!+%^-]+/,a={begin:/[a-z][a-z0-9_]*(\([a-z0-9_, ]*\))?[ \t]+/,excludeBegin:!0,end:"$",endsWithParent:!0,contains:[s,i,{className:"comment",begin:yze(o,Krs(yze(/[ ]+/,o))),relevance:0}]};return{name:"GAMS",aliases:["gms"],case_insensitive:!0,keywords:e,contains:[t.COMMENT(/^\$ontext/,/^\$offtext/),{className:"meta",begin:"^\\$[a-z0-9]+",end:"$",returnBegin:!0,contains:[{className:"meta-keyword",begin:"^\\$[a-z0-9]+"}]},t.COMMENT("^\\*","$"),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{beginKeywords:"set sets parameter parameters variable variables scalar scalars equation equations",end:";",contains:[t.COMMENT("^\\*","$"),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,i,a]},{beginKeywords:"table",end:";",returnBegin:!0,contains:[{beginKeywords:"table",end:"$",contains:[a]},t.COMMENT("^\\*","$"),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,t.C_NUMBER_MODE]},{className:"function",begin:/^[a-z][a-z0-9_,\-+' ()$]+\.{2}/,returnBegin:!0,contains:[{className:"title",begin:/^[a-z0-9_]+/},n,r]},t.C_NUMBER_MODE,r]}}$cn.exports=zrs});var qcn=ee((KNa,Wcn)=>{p();function Jrs(t){let e={keyword:"bool break call callexe checkinterrupt clear clearg closeall cls comlog compile continue create debug declare delete disable dlibrary dllcall do dos ed edit else elseif enable end endfor endif endp endo errorlog errorlogat expr external fn for format goto gosub graph if keyword let lib library line load loadarray loadexe loadf loadk loadm loadp loads loadx local locate loopnextindex lprint lpwidth lshow matrix msym ndpclex new open output outwidth plot plotsym pop prcsn print printdos proc push retp return rndcon rndmod rndmult rndseed run save saveall screen scroll setarray show sparse stop string struct system trace trap threadfor threadendfor threadbegin threadjoin threadstat threadend until use while winprint ne ge le gt lt and xor or not eq eqv",built_in:"abs acf aconcat aeye amax amean AmericanBinomCall AmericanBinomCall_Greeks AmericanBinomCall_ImpVol AmericanBinomPut AmericanBinomPut_Greeks AmericanBinomPut_ImpVol AmericanBSCall AmericanBSCall_Greeks AmericanBSCall_ImpVol AmericanBSPut AmericanBSPut_Greeks AmericanBSPut_ImpVol amin amult annotationGetDefaults annotationSetBkd annotationSetFont annotationSetLineColor annotationSetLineStyle annotationSetLineThickness annualTradingDays arccos arcsin areshape arrayalloc arrayindex arrayinit arraytomat asciiload asclabel astd astds asum atan atan2 atranspose axmargin balance band bandchol bandcholsol bandltsol bandrv bandsolpd bar base10 begwind besselj bessely beta box boxcox cdfBeta cdfBetaInv cdfBinomial cdfBinomialInv cdfBvn cdfBvn2 cdfBvn2e cdfCauchy cdfCauchyInv cdfChic cdfChii cdfChinc cdfChincInv cdfExp cdfExpInv cdfFc cdfFnc cdfFncInv cdfGam cdfGenPareto cdfHyperGeo cdfLaplace cdfLaplaceInv cdfLogistic cdfLogisticInv cdfmControlCreate cdfMvn cdfMvn2e cdfMvnce cdfMvne cdfMvt2e cdfMvtce cdfMvte cdfN cdfN2 cdfNc cdfNegBinomial cdfNegBinomialInv cdfNi cdfPoisson cdfPoissonInv cdfRayleigh cdfRayleighInv cdfTc cdfTci cdfTnc cdfTvn cdfWeibull cdfWeibullInv cdir ceil ChangeDir chdir chiBarSquare chol choldn cholsol cholup chrs close code cols colsf combinate combinated complex con cond conj cons ConScore contour conv convertsatostr convertstrtosa corrm corrms corrvc corrx corrxs cos cosh counts countwts crossprd crout croutp csrcol csrlin csvReadM csvReadSA cumprodc cumsumc curve cvtos datacreate datacreatecomplex datalist dataload dataloop dataopen datasave date datestr datestring datestrymd dayinyr dayofweek dbAddDatabase dbClose dbCommit dbCreateQuery dbExecQuery dbGetConnectOptions dbGetDatabaseName dbGetDriverName dbGetDrivers dbGetHostName dbGetLastErrorNum dbGetLastErrorText dbGetNumericalPrecPolicy dbGetPassword dbGetPort dbGetTableHeaders dbGetTables dbGetUserName dbHasFeature dbIsDriverAvailable dbIsOpen dbIsOpenError dbOpen dbQueryBindValue dbQueryClear dbQueryCols dbQueryExecPrepared dbQueryFetchAllM dbQueryFetchAllSA dbQueryFetchOneM dbQueryFetchOneSA dbQueryFinish dbQueryGetBoundValue dbQueryGetBoundValues dbQueryGetField dbQueryGetLastErrorNum dbQueryGetLastErrorText dbQueryGetLastInsertID dbQueryGetLastQuery dbQueryGetPosition dbQueryIsActive dbQueryIsForwardOnly dbQueryIsNull dbQueryIsSelect dbQueryIsValid dbQueryPrepare dbQueryRows dbQuerySeek dbQuerySeekFirst dbQuerySeekLast dbQuerySeekNext dbQuerySeekPrevious dbQuerySetForwardOnly dbRemoveDatabase dbRollback dbSetConnectOptions dbSetDatabaseName dbSetHostName dbSetNumericalPrecPolicy dbSetPort dbSetUserName dbTransaction DeleteFile delif delrows denseToSp denseToSpRE denToZero design det detl dfft dffti diag diagrv digamma doswin DOSWinCloseall DOSWinOpen dotfeq dotfeqmt dotfge dotfgemt dotfgt dotfgtmt dotfle dotflemt dotflt dotfltmt dotfne dotfnemt draw drop dsCreate dstat dstatmt dstatmtControlCreate dtdate dtday dttime dttodtv dttostr dttoutc dtvnormal dtvtodt dtvtoutc dummy dummybr dummydn eig eigh eighv eigv elapsedTradingDays endwind envget eof eqSolve eqSolvemt eqSolvemtControlCreate eqSolvemtOutCreate eqSolveset erf erfc erfccplx erfcplx error etdays ethsec etstr EuropeanBinomCall EuropeanBinomCall_Greeks EuropeanBinomCall_ImpVol EuropeanBinomPut EuropeanBinomPut_Greeks EuropeanBinomPut_ImpVol EuropeanBSCall EuropeanBSCall_Greeks EuropeanBSCall_ImpVol EuropeanBSPut EuropeanBSPut_Greeks EuropeanBSPut_ImpVol exctsmpl exec execbg exp extern eye fcheckerr fclearerr feq feqmt fflush fft ffti fftm fftmi fftn fge fgemt fgets fgetsa fgetsat fgetst fgt fgtmt fileinfo filesa fle flemt floor flt fltmt fmod fne fnemt fonts fopen formatcv formatnv fputs fputst fseek fstrerror ftell ftocv ftos ftostrC gamma gammacplx gammaii gausset gdaAppend gdaCreate gdaDStat gdaDStatMat gdaGetIndex gdaGetName gdaGetNames gdaGetOrders gdaGetType gdaGetTypes gdaGetVarInfo gdaIsCplx gdaLoad gdaPack gdaRead gdaReadByIndex gdaReadSome gdaReadSparse gdaReadStruct gdaReportVarInfo gdaSave gdaUpdate gdaUpdateAndPack gdaVars gdaWrite gdaWrite32 gdaWriteSome getarray getdims getf getGAUSShome getmatrix getmatrix4D getname getnamef getNextTradingDay getNextWeekDay getnr getorders getpath getPreviousTradingDay getPreviousWeekDay getRow getscalar3D getscalar4D getTrRow getwind glm gradcplx gradMT gradMTm gradMTT gradMTTm gradp graphprt graphset hasimag header headermt hess hessMT hessMTg hessMTgw hessMTm hessMTmw hessMTT hessMTTg hessMTTgw hessMTTm hessMTw hessp hist histf histp hsec imag indcv indexcat indices indices2 indicesf indicesfn indnv indsav integrate1d integrateControlCreate intgrat2 intgrat3 inthp1 inthp2 inthp3 inthp4 inthpControlCreate intquad1 intquad2 intquad3 intrleav intrleavsa intrsect intsimp inv invpd invswp iscplx iscplxf isden isinfnanmiss ismiss key keyav keyw lag lag1 lagn lapEighb lapEighi lapEighvb lapEighvi lapgEig lapgEigh lapgEighv lapgEigv lapgSchur lapgSvdcst lapgSvds lapgSvdst lapSvdcusv lapSvds lapSvdusv ldlp ldlsol linSolve listwise ln lncdfbvn lncdfbvn2 lncdfmvn lncdfn lncdfn2 lncdfnc lnfact lngammacplx lnpdfmvn lnpdfmvt lnpdfn lnpdft loadd loadstruct loadwind loess loessmt loessmtControlCreate log loglog logx logy lower lowmat lowmat1 ltrisol lu lusol machEpsilon make makevars makewind margin matalloc matinit mattoarray maxbytes maxc maxindc maxv maxvec mbesselei mbesselei0 mbesselei1 mbesseli mbesseli0 mbesseli1 meanc median mergeby mergevar minc minindc minv miss missex missrv moment momentd movingave movingaveExpwgt movingaveWgt nextindex nextn nextnevn nextwind ntos null null1 numCombinations ols olsmt olsmtControlCreate olsqr olsqr2 olsqrmt ones optn optnevn orth outtyp pacf packedToSp packr parse pause pdfCauchy pdfChi pdfExp pdfGenPareto pdfHyperGeo pdfLaplace pdfLogistic pdfn pdfPoisson pdfRayleigh pdfWeibull pi pinv pinvmt plotAddArrow plotAddBar plotAddBox plotAddHist plotAddHistF plotAddHistP plotAddPolar plotAddScatter plotAddShape plotAddTextbox plotAddTS plotAddXY plotArea plotBar plotBox plotClearLayout plotContour plotCustomLayout plotGetDefaults plotHist plotHistF plotHistP plotLayout plotLogLog plotLogX plotLogY plotOpenWindow plotPolar plotSave plotScatter plotSetAxesPen plotSetBar plotSetBarFill plotSetBarStacked plotSetBkdColor plotSetFill plotSetGrid plotSetLegend plotSetLineColor plotSetLineStyle plotSetLineSymbol plotSetLineThickness plotSetNewWindow plotSetTitle plotSetWhichYAxis plotSetXAxisShow plotSetXLabel plotSetXRange plotSetXTicInterval plotSetXTicLabel plotSetYAxisShow plotSetYLabel plotSetYRange plotSetZAxisShow plotSetZLabel plotSurface plotTS plotXY polar polychar polyeval polygamma polyint polymake polymat polymroot polymult polyroot pqgwin previousindex princomp printfm printfmt prodc psi putarray putf putvals pvCreate pvGetIndex pvGetParNames pvGetParVector pvLength pvList pvPack pvPacki pvPackm pvPackmi pvPacks pvPacksi pvPacksm pvPacksmi pvPutParVector pvTest pvUnpack QNewton QNewtonmt QNewtonmtControlCreate QNewtonmtOutCreate QNewtonSet QProg QProgmt QProgmtInCreate qqr qqre qqrep qr qre qrep qrsol qrtsol qtyr qtyre qtyrep quantile quantiled qyr qyre qyrep qz rank rankindx readr real reclassify reclassifyCuts recode recserar recsercp recserrc rerun rescale reshape rets rev rfft rffti rfftip rfftn rfftnp rfftp rndBernoulli rndBeta rndBinomial rndCauchy rndChiSquare rndCon rndCreateState rndExp rndGamma rndGeo rndGumbel rndHyperGeo rndi rndKMbeta rndKMgam rndKMi rndKMn rndKMnb rndKMp rndKMu rndKMvm rndLaplace rndLCbeta rndLCgam rndLCi rndLCn rndLCnb rndLCp rndLCu rndLCvm rndLogNorm rndMTu rndMVn rndMVt rndn rndnb rndNegBinomial rndp rndPoisson rndRayleigh rndStateSkip rndu rndvm rndWeibull rndWishart rotater round rows rowsf rref sampleData satostrC saved saveStruct savewind scale scale3d scalerr scalinfnanmiss scalmiss schtoc schur searchsourcepath seekr select selif seqa seqm setdif setdifsa setvars setvwrmode setwind shell shiftr sin singleindex sinh sleep solpd sortc sortcc sortd sorthc sorthcc sortind sortindc sortmc sortr sortrc spBiconjGradSol spChol spConjGradSol spCreate spDenseSubmat spDiagRvMat spEigv spEye spLDL spline spLU spNumNZE spOnes spreadSheetReadM spreadSheetReadSA spreadSheetWrite spScale spSubmat spToDense spTrTDense spTScalar spZeros sqpSolve sqpSolveMT sqpSolveMTControlCreate sqpSolveMTlagrangeCreate sqpSolveMToutCreate sqpSolveSet sqrt statements stdc stdsc stocv stof strcombine strindx strlen strput strrindx strsect strsplit strsplitPad strtodt strtof strtofcplx strtriml strtrimr strtrunc strtruncl strtruncpad strtruncr submat subscat substute subvec sumc sumr surface svd svd1 svd2 svdcusv svds svdusv sysstate tab tan tanh tempname time timedt timestr timeutc title tkf2eps tkf2ps tocart todaydt toeplitz token topolar trapchk trigamma trimr trunc type typecv typef union unionsa uniqindx uniqindxsa unique uniquesa upmat upmat1 upper utctodt utctodtv utrisol vals varCovMS varCovXS varget vargetl varmall varmares varput varputl vartypef vcm vcms vcx vcxs vec vech vecr vector vget view viewxyz vlist vnamecv volume vput vread vtypecv wait waitc walkindex where window writer xlabel xlsGetSheetCount xlsGetSheetSize xlsGetSheetTypes xlsMakeRange xlsReadM xlsReadSA xlsWrite xlsWriteM xlsWriteSA xpnd xtics xy xyz ylabel ytics zeros zeta zlabel ztics cdfEmpirical dot h5create h5open h5read h5readAttribute h5write h5writeAttribute ldl plotAddErrorBar plotAddSurface plotCDFEmpirical plotSetColormap plotSetContourLabels plotSetLegendFont plotSetTextInterpreter plotSetXTicCount plotSetYTicCount plotSetZLevels powerm strjoin sylvester strtrim",literal:"DB_AFTER_LAST_ROW DB_ALL_TABLES DB_BATCH_OPERATIONS DB_BEFORE_FIRST_ROW DB_BLOB DB_EVENT_NOTIFICATIONS DB_FINISH_QUERY DB_HIGH_PRECISION DB_LAST_INSERT_ID DB_LOW_PRECISION_DOUBLE DB_LOW_PRECISION_INT32 DB_LOW_PRECISION_INT64 DB_LOW_PRECISION_NUMBERS DB_MULTIPLE_RESULT_SETS DB_NAMED_PLACEHOLDERS DB_POSITIONAL_PLACEHOLDERS DB_PREPARED_QUERIES DB_QUERY_SIZE DB_SIMPLE_LOCKING DB_SYSTEM_TABLES DB_TABLES DB_TRANSACTIONS DB_UNICODE DB_VIEWS __STDIN __STDOUT __STDERR __FILE_DIR"},n=t.COMMENT("@","@"),r={className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"define definecs|10 undef ifdef ifndef iflight ifdllcall ifmac ifos2win ifunix else endif lineson linesoff srcfile srcline"},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",end:"$",keywords:{"meta-keyword":"include"},contains:[{className:"meta-string",begin:'"',end:'"',illegal:"\\n"}]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,n]},s={begin:/\bstruct\s+/,end:/\s/,keywords:"struct",contains:[{className:"type",begin:t.UNDERSCORE_IDENT_RE,relevance:0}]},i=[{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,endsWithParent:!0,relevance:0,contains:[{className:"literal",begin:/\.\.\./},t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,s]}],o={className:"title",begin:t.UNDERSCORE_IDENT_RE,relevance:0},a=function(h,m,f){let g=t.inherit({className:"function",beginKeywords:h,end:m,excludeEnd:!0,contains:[].concat(i)},f||{});return g.contains.push(o),g.contains.push(t.C_NUMBER_MODE),g.contains.push(t.C_BLOCK_COMMENT_MODE),g.contains.push(n),g},c={className:"built_in",begin:"\\b("+e.built_in.split(" ").join("|")+")\\b"},u={className:"string",begin:'"',end:'"',contains:[t.BACKSLASH_ESCAPE],relevance:0},l={begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,keywords:e,relevance:0,contains:[{beginKeywords:e.keyword},c,{className:"built_in",begin:t.UNDERSCORE_IDENT_RE,relevance:0}]},d={begin:/\(/,end:/\)/,relevance:0,keywords:{built_in:e.built_in,literal:e.literal},contains:[t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,c,l,u,"self"]};return l.contains.push(d),{name:"GAUSS",aliases:["gss"],case_insensitive:!0,keywords:e,illegal:/(\{[%#]|[%#]\}| <- )/,contains:[t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,n,u,r,{className:"keyword",begin:/\bexternal (matrix|string|array|sparse matrix|struct|proc|keyword|fn)/},a("proc keyword",";"),a("fn","="),{beginKeywords:"for threadfor",end:/;/,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE,n,d]},{variants:[{begin:t.UNDERSCORE_IDENT_RE+"\\."+t.UNDERSCORE_IDENT_RE},{begin:t.UNDERSCORE_IDENT_RE+"\\s*="}],relevance:0},l,s]}}Wcn.exports=Jrs});var Vcn=ee((JNa,Hcn)=>{p();function Xrs(t){let r={$pattern:"[A-Z_][A-Z0-9_.]*",keyword:"IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT EQ LT GT NE GE LE OR XOR"},s={className:"meta",begin:"([O])([0-9]+)"},i=t.inherit(t.C_NUMBER_MODE,{begin:"([-+]?((\\.\\d+)|(\\d+)(\\.\\d*)?))|"+t.C_NUMBER_RE}),o=[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.COMMENT(/\(/,/\)/),i,t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"name",begin:"([G])([0-9]+\\.?[0-9]?)"},{className:"name",begin:"([M])([0-9]+\\.?[0-9]?)"},{className:"attr",begin:"(VC|VS|#)",end:"(\\d+)"},{className:"attr",begin:"(VZOFX|VZOFY|VZOFZ)"},{className:"built_in",begin:"(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\[)",contains:[i],end:"\\]"},{className:"symbol",variants:[{begin:"N",end:"\\d+",illegal:"\\W"}]}];return{name:"G-code (ISO 6983)",aliases:["nc"],case_insensitive:!0,keywords:r,contains:[{className:"meta",begin:"%"},s].concat(o)}}Hcn.exports=Xrs});var Ycn=ee((ZNa,jcn)=>{p();function Zrs(t){return{name:"Gherkin",aliases:["feature"],keywords:"Feature Background Ability Business Need Scenario Scenarios Scenario Outline Scenario Template Examples Given And Then But When",contains:[{className:"symbol",begin:"\\*",relevance:0},{className:"meta",begin:"@[^@\\s]+"},{begin:"\\|",end:"\\|\\w*$",contains:[{className:"string",begin:"[^|]+"}]},{className:"variable",begin:"<",end:">"},t.HASH_COMMENT_MODE,{className:"string",begin:'"""',end:'"""'},t.QUOTE_STRING_MODE]}}jcn.exports=Zrs});var zcn=ee((tDa,Kcn)=>{p();function ess(t){return{name:"GLSL",keywords:{keyword:"break continue discard do else for if return while switch case default attribute binding buffer ccw centroid centroid varying coherent column_major const cw depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip triangles triangles_adjacency uniform varying vertices volatile writeonly",type:"atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void",built_in:"gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow",literal:"true false"},illegal:'"',contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"#",end:"$"}]}}Kcn.exports=ess});var Xcn=ee((rDa,Jcn)=>{p();function tss(t){return{name:"GML",case_insensitive:!1,keywords:{keyword:"begin end if then else while do for break continue with until repeat exit and or xor not return mod div switch case default var globalvar enum function constructor delete #macro #region #endregion",built_in:"is_real is_string is_array is_undefined is_int32 is_int64 is_ptr is_vec3 is_vec4 is_matrix is_bool is_method is_struct is_infinity is_nan is_numeric typeof variable_global_exists variable_global_get variable_global_set variable_instance_exists variable_instance_get variable_instance_set variable_instance_get_names variable_struct_exists variable_struct_get variable_struct_get_names variable_struct_names_count variable_struct_remove variable_struct_set array_delete array_insert array_length array_length_1d array_length_2d array_height_2d array_equals array_create array_copy array_pop array_push array_resize array_sort random random_range irandom irandom_range random_set_seed random_get_seed randomize randomise choose abs round floor ceil sign frac sqrt sqr exp ln log2 log10 sin cos tan arcsin arccos arctan arctan2 dsin dcos dtan darcsin darccos darctan darctan2 degtorad radtodeg power logn min max mean median clamp lerp dot_product dot_product_3d dot_product_normalised dot_product_3d_normalised dot_product_normalized dot_product_3d_normalized math_set_epsilon math_get_epsilon angle_difference point_distance_3d point_distance point_direction lengthdir_x lengthdir_y real string int64 ptr string_format chr ansi_char ord string_length string_byte_length string_pos string_copy string_char_at string_ord_at string_byte_at string_set_byte_at string_delete string_insert string_lower string_upper string_repeat string_letters string_digits string_lettersdigits string_replace string_replace_all string_count string_hash_to_newline clipboard_has_text clipboard_set_text clipboard_get_text date_current_datetime date_create_datetime date_valid_datetime date_inc_year date_inc_month date_inc_week date_inc_day date_inc_hour date_inc_minute date_inc_second date_get_year date_get_month date_get_week date_get_day date_get_hour date_get_minute date_get_second date_get_weekday date_get_day_of_year date_get_hour_of_year date_get_minute_of_year date_get_second_of_year date_year_span date_month_span date_week_span date_day_span date_hour_span date_minute_span date_second_span date_compare_datetime date_compare_date date_compare_time date_date_of date_time_of date_datetime_string date_date_string date_time_string date_days_in_month date_days_in_year date_leap_year date_is_today date_set_timezone date_get_timezone game_set_speed game_get_speed motion_set motion_add place_free place_empty place_meeting place_snapped move_random move_snap move_towards_point move_contact_solid move_contact_all move_outside_solid move_outside_all move_bounce_solid move_bounce_all move_wrap distance_to_point distance_to_object position_empty position_meeting path_start path_end mp_linear_step mp_potential_step mp_linear_step_object mp_potential_step_object mp_potential_settings mp_linear_path mp_potential_path mp_linear_path_object mp_potential_path_object mp_grid_create mp_grid_destroy mp_grid_clear_all mp_grid_clear_cell mp_grid_clear_rectangle mp_grid_add_cell mp_grid_get_cell mp_grid_add_rectangle mp_grid_add_instances mp_grid_path mp_grid_draw mp_grid_to_ds_grid collision_point collision_rectangle collision_circle collision_ellipse collision_line collision_point_list collision_rectangle_list collision_circle_list collision_ellipse_list collision_line_list instance_position_list instance_place_list point_in_rectangle point_in_triangle point_in_circle rectangle_in_rectangle rectangle_in_triangle rectangle_in_circle instance_find instance_exists instance_number instance_position instance_nearest instance_furthest instance_place instance_create_depth instance_create_layer instance_copy instance_change instance_destroy position_destroy position_change instance_id_get instance_deactivate_all instance_deactivate_object instance_deactivate_region instance_activate_all instance_activate_object instance_activate_region room_goto room_goto_previous room_goto_next room_previous room_next room_restart game_end game_restart game_load game_save game_save_buffer game_load_buffer event_perform event_user event_perform_object event_inherited show_debug_message show_debug_overlay debug_event debug_get_callstack alarm_get alarm_set font_texture_page_size keyboard_set_map keyboard_get_map keyboard_unset_map keyboard_check keyboard_check_pressed keyboard_check_released keyboard_check_direct keyboard_get_numlock keyboard_set_numlock keyboard_key_press keyboard_key_release keyboard_clear io_clear mouse_check_button mouse_check_button_pressed mouse_check_button_released mouse_wheel_up mouse_wheel_down mouse_clear draw_self draw_sprite draw_sprite_pos draw_sprite_ext draw_sprite_stretched draw_sprite_stretched_ext draw_sprite_tiled draw_sprite_tiled_ext draw_sprite_part draw_sprite_part_ext draw_sprite_general draw_clear draw_clear_alpha draw_point draw_line draw_line_width draw_rectangle draw_roundrect draw_roundrect_ext draw_triangle draw_circle draw_ellipse draw_set_circle_precision draw_arrow draw_button draw_path draw_healthbar draw_getpixel draw_getpixel_ext draw_set_colour draw_set_color draw_set_alpha draw_get_colour draw_get_color draw_get_alpha merge_colour make_colour_rgb make_colour_hsv colour_get_red colour_get_green colour_get_blue colour_get_hue colour_get_saturation colour_get_value merge_color make_color_rgb make_color_hsv color_get_red color_get_green color_get_blue color_get_hue color_get_saturation color_get_value merge_color screen_save screen_save_part draw_set_font draw_set_halign draw_set_valign draw_text draw_text_ext string_width string_height string_width_ext string_height_ext draw_text_transformed draw_text_ext_transformed draw_text_colour draw_text_ext_colour draw_text_transformed_colour draw_text_ext_transformed_colour draw_text_color draw_text_ext_color draw_text_transformed_color draw_text_ext_transformed_color draw_point_colour draw_line_colour draw_line_width_colour draw_rectangle_colour draw_roundrect_colour draw_roundrect_colour_ext draw_triangle_colour draw_circle_colour draw_ellipse_colour draw_point_color draw_line_color draw_line_width_color draw_rectangle_color draw_roundrect_color draw_roundrect_color_ext draw_triangle_color draw_circle_color draw_ellipse_color draw_primitive_begin draw_vertex draw_vertex_colour draw_vertex_color draw_primitive_end sprite_get_uvs font_get_uvs sprite_get_texture font_get_texture texture_get_width texture_get_height texture_get_uvs draw_primitive_begin_texture draw_vertex_texture draw_vertex_texture_colour draw_vertex_texture_color texture_global_scale surface_create surface_create_ext surface_resize surface_free surface_exists surface_get_width surface_get_height surface_get_texture surface_set_target surface_set_target_ext surface_reset_target surface_depth_disable surface_get_depth_disable draw_surface draw_surface_stretched draw_surface_tiled draw_surface_part draw_surface_ext draw_surface_stretched_ext draw_surface_tiled_ext draw_surface_part_ext draw_surface_general surface_getpixel surface_getpixel_ext surface_save surface_save_part surface_copy surface_copy_part application_surface_draw_enable application_get_position application_surface_enable application_surface_is_enabled display_get_width display_get_height display_get_orientation display_get_gui_width display_get_gui_height display_reset display_mouse_get_x display_mouse_get_y display_mouse_set display_set_ui_visibility window_set_fullscreen window_get_fullscreen window_set_caption window_set_min_width window_set_max_width window_set_min_height window_set_max_height window_get_visible_rects window_get_caption window_set_cursor window_get_cursor window_set_colour window_get_colour window_set_color window_get_color window_set_position window_set_size window_set_rectangle window_center window_get_x window_get_y window_get_width window_get_height window_mouse_get_x window_mouse_get_y window_mouse_set window_view_mouse_get_x window_view_mouse_get_y window_views_mouse_get_x window_views_mouse_get_y audio_listener_position audio_listener_velocity audio_listener_orientation audio_emitter_position audio_emitter_create audio_emitter_free audio_emitter_exists audio_emitter_pitch audio_emitter_velocity audio_emitter_falloff audio_emitter_gain audio_play_sound audio_play_sound_on audio_play_sound_at audio_stop_sound audio_resume_music audio_music_is_playing audio_resume_sound audio_pause_sound audio_pause_music audio_channel_num audio_sound_length audio_get_type audio_falloff_set_model audio_play_music audio_stop_music audio_master_gain audio_music_gain audio_sound_gain audio_sound_pitch audio_stop_all audio_resume_all audio_pause_all audio_is_playing audio_is_paused audio_exists audio_sound_set_track_position audio_sound_get_track_position audio_emitter_get_gain audio_emitter_get_pitch audio_emitter_get_x audio_emitter_get_y audio_emitter_get_z audio_emitter_get_vx audio_emitter_get_vy audio_emitter_get_vz audio_listener_set_position audio_listener_set_velocity audio_listener_set_orientation audio_listener_get_data audio_set_master_gain audio_get_master_gain audio_sound_get_gain audio_sound_get_pitch audio_get_name audio_sound_set_track_position audio_sound_get_track_position audio_create_stream audio_destroy_stream audio_create_sync_group audio_destroy_sync_group audio_play_in_sync_group audio_start_sync_group audio_stop_sync_group audio_pause_sync_group audio_resume_sync_group audio_sync_group_get_track_pos audio_sync_group_debug audio_sync_group_is_playing audio_debug audio_group_load audio_group_unload audio_group_is_loaded audio_group_load_progress audio_group_name audio_group_stop_all audio_group_set_gain audio_create_buffer_sound audio_free_buffer_sound audio_create_play_queue audio_free_play_queue audio_queue_sound audio_get_recorder_count audio_get_recorder_info audio_start_recording audio_stop_recording audio_sound_get_listener_mask audio_emitter_get_listener_mask audio_get_listener_mask audio_sound_set_listener_mask audio_emitter_set_listener_mask audio_set_listener_mask audio_get_listener_count audio_get_listener_info audio_system show_message show_message_async clickable_add clickable_add_ext clickable_change clickable_change_ext clickable_delete clickable_exists clickable_set_style show_question show_question_async get_integer get_string get_integer_async get_string_async get_login_async get_open_filename get_save_filename get_open_filename_ext get_save_filename_ext show_error highscore_clear highscore_add highscore_value highscore_name draw_highscore sprite_exists sprite_get_name sprite_get_number sprite_get_width sprite_get_height sprite_get_xoffset sprite_get_yoffset sprite_get_bbox_left sprite_get_bbox_right sprite_get_bbox_top sprite_get_bbox_bottom sprite_save sprite_save_strip sprite_set_cache_size sprite_set_cache_size_ext sprite_get_tpe sprite_prefetch sprite_prefetch_multi sprite_flush sprite_flush_multi sprite_set_speed sprite_get_speed_type sprite_get_speed font_exists font_get_name font_get_fontname font_get_bold font_get_italic font_get_first font_get_last font_get_size font_set_cache_size path_exists path_get_name path_get_length path_get_time path_get_kind path_get_closed path_get_precision path_get_number path_get_point_x path_get_point_y path_get_point_speed path_get_x path_get_y path_get_speed script_exists script_get_name timeline_add timeline_delete timeline_clear timeline_exists timeline_get_name timeline_moment_clear timeline_moment_add_script timeline_size timeline_max_moment object_exists object_get_name object_get_sprite object_get_solid object_get_visible object_get_persistent object_get_mask object_get_parent object_get_physics object_is_ancestor room_exists room_get_name sprite_set_offset sprite_duplicate sprite_assign sprite_merge sprite_add sprite_replace sprite_create_from_surface sprite_add_from_surface sprite_delete sprite_set_alpha_from_sprite sprite_collision_mask font_add_enable_aa font_add_get_enable_aa font_add font_add_sprite font_add_sprite_ext font_replace font_replace_sprite font_replace_sprite_ext font_delete path_set_kind path_set_closed path_set_precision path_add path_assign path_duplicate path_append path_delete path_add_point path_insert_point path_change_point path_delete_point path_clear_points path_reverse path_mirror path_flip path_rotate path_rescale path_shift script_execute object_set_sprite object_set_solid object_set_visible object_set_persistent object_set_mask room_set_width room_set_height room_set_persistent room_set_background_colour room_set_background_color room_set_view room_set_viewport room_get_viewport room_set_view_enabled room_add room_duplicate room_assign room_instance_add room_instance_clear room_get_camera room_set_camera asset_get_index asset_get_type file_text_open_from_string file_text_open_read file_text_open_write file_text_open_append file_text_close file_text_write_string file_text_write_real file_text_writeln file_text_read_string file_text_read_real file_text_readln file_text_eof file_text_eoln file_exists file_delete file_rename file_copy directory_exists directory_create directory_destroy file_find_first file_find_next file_find_close file_attributes filename_name filename_path filename_dir filename_drive filename_ext filename_change_ext file_bin_open file_bin_rewrite file_bin_close file_bin_position file_bin_size file_bin_seek file_bin_write_byte file_bin_read_byte parameter_count parameter_string environment_get_variable ini_open_from_string ini_open ini_close ini_read_string ini_read_real ini_write_string ini_write_real ini_key_exists ini_section_exists ini_key_delete ini_section_delete ds_set_precision ds_exists ds_stack_create ds_stack_destroy ds_stack_clear ds_stack_copy ds_stack_size ds_stack_empty ds_stack_push ds_stack_pop ds_stack_top ds_stack_write ds_stack_read ds_queue_create ds_queue_destroy ds_queue_clear ds_queue_copy ds_queue_size ds_queue_empty ds_queue_enqueue ds_queue_dequeue ds_queue_head ds_queue_tail ds_queue_write ds_queue_read ds_list_create ds_list_destroy ds_list_clear ds_list_copy ds_list_size ds_list_empty ds_list_add ds_list_insert ds_list_replace ds_list_delete ds_list_find_index ds_list_find_value ds_list_mark_as_list ds_list_mark_as_map ds_list_sort ds_list_shuffle ds_list_write ds_list_read ds_list_set ds_map_create ds_map_destroy ds_map_clear ds_map_copy ds_map_size ds_map_empty ds_map_add ds_map_add_list ds_map_add_map ds_map_replace ds_map_replace_map ds_map_replace_list ds_map_delete ds_map_exists ds_map_find_value ds_map_find_previous ds_map_find_next ds_map_find_first ds_map_find_last ds_map_write ds_map_read ds_map_secure_save ds_map_secure_load ds_map_secure_load_buffer ds_map_secure_save_buffer ds_map_set ds_priority_create ds_priority_destroy ds_priority_clear ds_priority_copy ds_priority_size ds_priority_empty ds_priority_add ds_priority_change_priority ds_priority_find_priority ds_priority_delete_value ds_priority_delete_min ds_priority_find_min ds_priority_delete_max ds_priority_find_max ds_priority_write ds_priority_read ds_grid_create ds_grid_destroy ds_grid_copy ds_grid_resize ds_grid_width ds_grid_height ds_grid_clear ds_grid_set ds_grid_add ds_grid_multiply ds_grid_set_region ds_grid_add_region ds_grid_multiply_region ds_grid_set_disk ds_grid_add_disk ds_grid_multiply_disk ds_grid_set_grid_region ds_grid_add_grid_region ds_grid_multiply_grid_region ds_grid_get ds_grid_get_sum ds_grid_get_max ds_grid_get_min ds_grid_get_mean ds_grid_get_disk_sum ds_grid_get_disk_min ds_grid_get_disk_max ds_grid_get_disk_mean ds_grid_value_exists ds_grid_value_x ds_grid_value_y ds_grid_value_disk_exists ds_grid_value_disk_x ds_grid_value_disk_y ds_grid_shuffle ds_grid_write ds_grid_read ds_grid_sort ds_grid_set ds_grid_get effect_create_below effect_create_above effect_clear part_type_create part_type_destroy part_type_exists part_type_clear part_type_shape part_type_sprite part_type_size part_type_scale part_type_orientation part_type_life part_type_step part_type_death part_type_speed part_type_direction part_type_gravity part_type_colour1 part_type_colour2 part_type_colour3 part_type_colour_mix part_type_colour_rgb part_type_colour_hsv part_type_color1 part_type_color2 part_type_color3 part_type_color_mix part_type_color_rgb part_type_color_hsv part_type_alpha1 part_type_alpha2 part_type_alpha3 part_type_blend part_system_create part_system_create_layer part_system_destroy part_system_exists part_system_clear part_system_draw_order part_system_depth part_system_position part_system_automatic_update part_system_automatic_draw part_system_update part_system_drawit part_system_get_layer part_system_layer part_particles_create part_particles_create_colour part_particles_create_color part_particles_clear part_particles_count part_emitter_create part_emitter_destroy part_emitter_destroy_all part_emitter_exists part_emitter_clear part_emitter_region part_emitter_burst part_emitter_stream external_call external_define external_free window_handle window_device matrix_get matrix_set matrix_build_identity matrix_build matrix_build_lookat matrix_build_projection_ortho matrix_build_projection_perspective matrix_build_projection_perspective_fov matrix_multiply matrix_transform_vertex matrix_stack_push matrix_stack_pop matrix_stack_multiply matrix_stack_set matrix_stack_clear matrix_stack_top matrix_stack_is_empty browser_input_capture os_get_config os_get_info os_get_language os_get_region os_lock_orientation display_get_dpi_x display_get_dpi_y display_set_gui_size display_set_gui_maximise display_set_gui_maximize device_mouse_dbclick_enable display_set_timing_method display_get_timing_method display_set_sleep_margin display_get_sleep_margin virtual_key_add virtual_key_hide virtual_key_delete virtual_key_show draw_enable_drawevent draw_enable_swf_aa draw_set_swf_aa_level draw_get_swf_aa_level draw_texture_flush draw_flush gpu_set_blendenable gpu_set_ztestenable gpu_set_zfunc gpu_set_zwriteenable gpu_set_lightingenable gpu_set_fog gpu_set_cullmode gpu_set_blendmode gpu_set_blendmode_ext gpu_set_blendmode_ext_sepalpha gpu_set_colorwriteenable gpu_set_colourwriteenable gpu_set_alphatestenable gpu_set_alphatestref gpu_set_alphatestfunc gpu_set_texfilter gpu_set_texfilter_ext gpu_set_texrepeat gpu_set_texrepeat_ext gpu_set_tex_filter gpu_set_tex_filter_ext gpu_set_tex_repeat gpu_set_tex_repeat_ext gpu_set_tex_mip_filter gpu_set_tex_mip_filter_ext gpu_set_tex_mip_bias gpu_set_tex_mip_bias_ext gpu_set_tex_min_mip gpu_set_tex_min_mip_ext gpu_set_tex_max_mip gpu_set_tex_max_mip_ext gpu_set_tex_max_aniso gpu_set_tex_max_aniso_ext gpu_set_tex_mip_enable gpu_set_tex_mip_enable_ext gpu_get_blendenable gpu_get_ztestenable gpu_get_zfunc gpu_get_zwriteenable gpu_get_lightingenable gpu_get_fog gpu_get_cullmode gpu_get_blendmode gpu_get_blendmode_ext gpu_get_blendmode_ext_sepalpha gpu_get_blendmode_src gpu_get_blendmode_dest gpu_get_blendmode_srcalpha gpu_get_blendmode_destalpha gpu_get_colorwriteenable gpu_get_colourwriteenable gpu_get_alphatestenable gpu_get_alphatestref gpu_get_alphatestfunc gpu_get_texfilter gpu_get_texfilter_ext gpu_get_texrepeat gpu_get_texrepeat_ext gpu_get_tex_filter gpu_get_tex_filter_ext gpu_get_tex_repeat gpu_get_tex_repeat_ext gpu_get_tex_mip_filter gpu_get_tex_mip_filter_ext gpu_get_tex_mip_bias gpu_get_tex_mip_bias_ext gpu_get_tex_min_mip gpu_get_tex_min_mip_ext gpu_get_tex_max_mip gpu_get_tex_max_mip_ext gpu_get_tex_max_aniso gpu_get_tex_max_aniso_ext gpu_get_tex_mip_enable gpu_get_tex_mip_enable_ext gpu_push_state gpu_pop_state gpu_get_state gpu_set_state draw_light_define_ambient draw_light_define_direction draw_light_define_point draw_light_enable draw_set_lighting draw_light_get_ambient draw_light_get draw_get_lighting shop_leave_rating url_get_domain url_open url_open_ext url_open_full get_timer achievement_login achievement_logout achievement_post achievement_increment achievement_post_score achievement_available achievement_show_achievements achievement_show_leaderboards achievement_load_friends achievement_load_leaderboard achievement_send_challenge achievement_load_progress achievement_reset achievement_login_status achievement_get_pic achievement_show_challenge_notifications achievement_get_challenges achievement_event achievement_show achievement_get_info cloud_file_save cloud_string_save cloud_synchronise ads_enable ads_disable ads_setup ads_engagement_launch ads_engagement_available ads_engagement_active ads_event ads_event_preload ads_set_reward_callback ads_get_display_height ads_get_display_width ads_move ads_interstitial_available ads_interstitial_display device_get_tilt_x device_get_tilt_y device_get_tilt_z device_is_keypad_open device_mouse_check_button device_mouse_check_button_pressed device_mouse_check_button_released device_mouse_x device_mouse_y device_mouse_raw_x device_mouse_raw_y device_mouse_x_to_gui device_mouse_y_to_gui iap_activate iap_status iap_enumerate_products iap_restore_all iap_acquire iap_consume iap_product_details iap_purchase_details facebook_init facebook_login facebook_status facebook_graph_request facebook_dialog facebook_logout facebook_launch_offerwall facebook_post_message facebook_send_invite facebook_user_id facebook_accesstoken facebook_check_permission facebook_request_read_permissions facebook_request_publish_permissions gamepad_is_supported gamepad_get_device_count gamepad_is_connected gamepad_get_description gamepad_get_button_threshold gamepad_set_button_threshold gamepad_get_axis_deadzone gamepad_set_axis_deadzone gamepad_button_count gamepad_button_check gamepad_button_check_pressed gamepad_button_check_released gamepad_button_value gamepad_axis_count gamepad_axis_value gamepad_set_vibration gamepad_set_colour gamepad_set_color os_is_paused window_has_focus code_is_compiled http_get http_get_file http_post_string http_request json_encode json_decode zip_unzip load_csv base64_encode base64_decode md5_string_unicode md5_string_utf8 md5_file os_is_network_connected sha1_string_unicode sha1_string_utf8 sha1_file os_powersave_enable analytics_event analytics_event_ext win8_livetile_tile_notification win8_livetile_tile_clear win8_livetile_badge_notification win8_livetile_badge_clear win8_livetile_queue_enable win8_secondarytile_pin win8_secondarytile_badge_notification win8_secondarytile_delete win8_livetile_notification_begin win8_livetile_notification_secondary_begin win8_livetile_notification_expiry win8_livetile_notification_tag win8_livetile_notification_text_add win8_livetile_notification_image_add win8_livetile_notification_end win8_appbar_enable win8_appbar_add_element win8_appbar_remove_element win8_settingscharm_add_entry win8_settingscharm_add_html_entry win8_settingscharm_add_xaml_entry win8_settingscharm_set_xaml_property win8_settingscharm_get_xaml_property win8_settingscharm_remove_entry win8_share_image win8_share_screenshot win8_share_file win8_share_url win8_share_text win8_search_enable win8_search_disable win8_search_add_suggestions win8_device_touchscreen_available win8_license_initialize_sandbox win8_license_trial_version winphone_license_trial_version winphone_tile_title winphone_tile_count winphone_tile_back_title winphone_tile_back_content winphone_tile_back_content_wide winphone_tile_front_image winphone_tile_front_image_small winphone_tile_front_image_wide winphone_tile_back_image winphone_tile_back_image_wide winphone_tile_background_colour winphone_tile_background_color winphone_tile_icon_image winphone_tile_small_icon_image winphone_tile_wide_content winphone_tile_cycle_images winphone_tile_small_background_image physics_world_create physics_world_gravity physics_world_update_speed physics_world_update_iterations physics_world_draw_debug physics_pause_enable physics_fixture_create physics_fixture_set_kinematic physics_fixture_set_density physics_fixture_set_awake physics_fixture_set_restitution physics_fixture_set_friction physics_fixture_set_collision_group physics_fixture_set_sensor physics_fixture_set_linear_damping physics_fixture_set_angular_damping physics_fixture_set_circle_shape physics_fixture_set_box_shape physics_fixture_set_edge_shape physics_fixture_set_polygon_shape physics_fixture_set_chain_shape physics_fixture_add_point physics_fixture_bind physics_fixture_bind_ext physics_fixture_delete physics_apply_force physics_apply_impulse physics_apply_angular_impulse physics_apply_local_force physics_apply_local_impulse physics_apply_torque physics_mass_properties physics_draw_debug physics_test_overlap physics_remove_fixture physics_set_friction physics_set_density physics_set_restitution physics_get_friction physics_get_density physics_get_restitution physics_joint_distance_create physics_joint_rope_create physics_joint_revolute_create physics_joint_prismatic_create physics_joint_pulley_create physics_joint_wheel_create physics_joint_weld_create physics_joint_friction_create physics_joint_gear_create physics_joint_enable_motor physics_joint_get_value physics_joint_set_value physics_joint_delete physics_particle_create physics_particle_delete physics_particle_delete_region_circle physics_particle_delete_region_box physics_particle_delete_region_poly physics_particle_set_flags physics_particle_set_category_flags physics_particle_draw physics_particle_draw_ext physics_particle_count physics_particle_get_data physics_particle_get_data_particle physics_particle_group_begin physics_particle_group_circle physics_particle_group_box physics_particle_group_polygon physics_particle_group_add_point physics_particle_group_end physics_particle_group_join physics_particle_group_delete physics_particle_group_count physics_particle_group_get_data physics_particle_group_get_mass physics_particle_group_get_inertia physics_particle_group_get_centre_x physics_particle_group_get_centre_y physics_particle_group_get_vel_x physics_particle_group_get_vel_y physics_particle_group_get_ang_vel physics_particle_group_get_x physics_particle_group_get_y physics_particle_group_get_angle physics_particle_set_group_flags physics_particle_get_group_flags physics_particle_get_max_count physics_particle_get_radius physics_particle_get_density physics_particle_get_damping physics_particle_get_gravity_scale physics_particle_set_max_count physics_particle_set_radius physics_particle_set_density physics_particle_set_damping physics_particle_set_gravity_scale network_create_socket network_create_socket_ext network_create_server network_create_server_raw network_connect network_connect_raw network_send_packet network_send_raw network_send_broadcast network_send_udp network_send_udp_raw network_set_timeout network_set_config network_resolve network_destroy buffer_create buffer_write buffer_read buffer_seek buffer_get_surface buffer_set_surface buffer_delete buffer_exists buffer_get_type buffer_get_alignment buffer_poke buffer_peek buffer_save buffer_save_ext buffer_load buffer_load_ext buffer_load_partial buffer_copy buffer_fill buffer_get_size buffer_tell buffer_resize buffer_md5 buffer_sha1 buffer_base64_encode buffer_base64_decode buffer_base64_decode_ext buffer_sizeof buffer_get_address buffer_create_from_vertex_buffer buffer_create_from_vertex_buffer_ext buffer_copy_from_vertex_buffer buffer_async_group_begin buffer_async_group_option buffer_async_group_end buffer_load_async buffer_save_async gml_release_mode gml_pragma steam_activate_overlay steam_is_overlay_enabled steam_is_overlay_activated steam_get_persona_name steam_initialised steam_is_cloud_enabled_for_app steam_is_cloud_enabled_for_account steam_file_persisted steam_get_quota_total steam_get_quota_free steam_file_write steam_file_write_file steam_file_read steam_file_delete steam_file_exists steam_file_size steam_file_share steam_is_screenshot_requested steam_send_screenshot steam_is_user_logged_on steam_get_user_steam_id steam_user_owns_dlc steam_user_installed_dlc steam_set_achievement steam_get_achievement steam_clear_achievement steam_set_stat_int steam_set_stat_float steam_set_stat_avg_rate steam_get_stat_int steam_get_stat_float steam_get_stat_avg_rate steam_reset_all_stats steam_reset_all_stats_achievements steam_stats_ready steam_create_leaderboard steam_upload_score steam_upload_score_ext steam_download_scores_around_user steam_download_scores steam_download_friends_scores steam_upload_score_buffer steam_upload_score_buffer_ext steam_current_game_language steam_available_languages steam_activate_overlay_browser steam_activate_overlay_user steam_activate_overlay_store steam_get_user_persona_name steam_get_app_id steam_get_user_account_id steam_ugc_download steam_ugc_create_item steam_ugc_start_item_update steam_ugc_set_item_title steam_ugc_set_item_description steam_ugc_set_item_visibility steam_ugc_set_item_tags steam_ugc_set_item_content steam_ugc_set_item_preview steam_ugc_submit_item_update steam_ugc_get_item_update_progress steam_ugc_subscribe_item steam_ugc_unsubscribe_item steam_ugc_num_subscribed_items steam_ugc_get_subscribed_items steam_ugc_get_item_install_info steam_ugc_get_item_update_info steam_ugc_request_item_details steam_ugc_create_query_user steam_ugc_create_query_user_ex steam_ugc_create_query_all steam_ugc_create_query_all_ex steam_ugc_query_set_cloud_filename_filter steam_ugc_query_set_match_any_tag steam_ugc_query_set_search_text steam_ugc_query_set_ranked_by_trend_days steam_ugc_query_add_required_tag steam_ugc_query_add_excluded_tag steam_ugc_query_set_return_long_description steam_ugc_query_set_return_total_only steam_ugc_query_set_allow_cached_response steam_ugc_send_query shader_set shader_get_name shader_reset shader_current shader_is_compiled shader_get_sampler_index shader_get_uniform shader_set_uniform_i shader_set_uniform_i_array shader_set_uniform_f shader_set_uniform_f_array shader_set_uniform_matrix shader_set_uniform_matrix_array shader_enable_corner_id texture_set_stage texture_get_texel_width texture_get_texel_height shaders_are_supported vertex_format_begin vertex_format_end vertex_format_delete vertex_format_add_position vertex_format_add_position_3d vertex_format_add_colour vertex_format_add_color vertex_format_add_normal vertex_format_add_texcoord vertex_format_add_textcoord vertex_format_add_custom vertex_create_buffer vertex_create_buffer_ext vertex_delete_buffer vertex_begin vertex_end vertex_position vertex_position_3d vertex_colour vertex_color vertex_argb vertex_texcoord vertex_normal vertex_float1 vertex_float2 vertex_float3 vertex_float4 vertex_ubyte4 vertex_submit vertex_freeze vertex_get_number vertex_get_buffer_size vertex_create_buffer_from_buffer vertex_create_buffer_from_buffer_ext push_local_notification push_get_first_local_notification push_get_next_local_notification push_cancel_local_notification skeleton_animation_set skeleton_animation_get skeleton_animation_mix skeleton_animation_set_ext skeleton_animation_get_ext skeleton_animation_get_duration skeleton_animation_get_frames skeleton_animation_clear skeleton_skin_set skeleton_skin_get skeleton_attachment_set skeleton_attachment_get skeleton_attachment_create skeleton_collision_draw_set skeleton_bone_data_get skeleton_bone_data_set skeleton_bone_state_get skeleton_bone_state_set skeleton_get_minmax skeleton_get_num_bounds skeleton_get_bounds skeleton_animation_get_frame skeleton_animation_set_frame draw_skeleton draw_skeleton_time draw_skeleton_instance draw_skeleton_collision skeleton_animation_list skeleton_skin_list skeleton_slot_data layer_get_id layer_get_id_at_depth layer_get_depth layer_create layer_destroy layer_destroy_instances layer_add_instance layer_has_instance layer_set_visible layer_get_visible layer_exists layer_x layer_y layer_get_x layer_get_y layer_hspeed layer_vspeed layer_get_hspeed layer_get_vspeed layer_script_begin layer_script_end layer_shader layer_get_script_begin layer_get_script_end layer_get_shader layer_set_target_room layer_get_target_room layer_reset_target_room layer_get_all layer_get_all_elements layer_get_name layer_depth layer_get_element_layer layer_get_element_type layer_element_move layer_force_draw_depth layer_is_draw_depth_forced layer_get_forced_depth layer_background_get_id layer_background_exists layer_background_create layer_background_destroy layer_background_visible layer_background_change layer_background_sprite layer_background_htiled layer_background_vtiled layer_background_stretch layer_background_yscale layer_background_xscale layer_background_blend layer_background_alpha layer_background_index layer_background_speed layer_background_get_visible layer_background_get_sprite layer_background_get_htiled layer_background_get_vtiled layer_background_get_stretch layer_background_get_yscale layer_background_get_xscale layer_background_get_blend layer_background_get_alpha layer_background_get_index layer_background_get_speed layer_sprite_get_id layer_sprite_exists layer_sprite_create layer_sprite_destroy layer_sprite_change layer_sprite_index layer_sprite_speed layer_sprite_xscale layer_sprite_yscale layer_sprite_angle layer_sprite_blend layer_sprite_alpha layer_sprite_x layer_sprite_y layer_sprite_get_sprite layer_sprite_get_index layer_sprite_get_speed layer_sprite_get_xscale layer_sprite_get_yscale layer_sprite_get_angle layer_sprite_get_blend layer_sprite_get_alpha layer_sprite_get_x layer_sprite_get_y layer_tilemap_get_id layer_tilemap_exists layer_tilemap_create layer_tilemap_destroy tilemap_tileset tilemap_x tilemap_y tilemap_set tilemap_set_at_pixel tilemap_get_tileset tilemap_get_tile_width tilemap_get_tile_height tilemap_get_width tilemap_get_height tilemap_get_x tilemap_get_y tilemap_get tilemap_get_at_pixel tilemap_get_cell_x_at_pixel tilemap_get_cell_y_at_pixel tilemap_clear draw_tilemap draw_tile tilemap_set_global_mask tilemap_get_global_mask tilemap_set_mask tilemap_get_mask tilemap_get_frame tile_set_empty tile_set_index tile_set_flip tile_set_mirror tile_set_rotate tile_get_empty tile_get_index tile_get_flip tile_get_mirror tile_get_rotate layer_tile_exists layer_tile_create layer_tile_destroy layer_tile_change layer_tile_xscale layer_tile_yscale layer_tile_blend layer_tile_alpha layer_tile_x layer_tile_y layer_tile_region layer_tile_visible layer_tile_get_sprite layer_tile_get_xscale layer_tile_get_yscale layer_tile_get_blend layer_tile_get_alpha layer_tile_get_x layer_tile_get_y layer_tile_get_region layer_tile_get_visible layer_instance_get_instance instance_activate_layer instance_deactivate_layer camera_create camera_create_view camera_destroy camera_apply camera_get_active camera_get_default camera_set_default camera_set_view_mat camera_set_proj_mat camera_set_update_script camera_set_begin_script camera_set_end_script camera_set_view_pos camera_set_view_size camera_set_view_speed camera_set_view_border camera_set_view_angle camera_set_view_target camera_get_view_mat camera_get_proj_mat camera_get_update_script camera_get_begin_script camera_get_end_script camera_get_view_x camera_get_view_y camera_get_view_width camera_get_view_height camera_get_view_speed_x camera_get_view_speed_y camera_get_view_border_x camera_get_view_border_y camera_get_view_angle camera_get_view_target view_get_camera view_get_visible view_get_xport view_get_yport view_get_wport view_get_hport view_get_surface_id view_set_camera view_set_visible view_set_xport view_set_yport view_set_wport view_set_hport view_set_surface_id gesture_drag_time gesture_drag_distance gesture_flick_speed gesture_double_tap_time gesture_double_tap_distance gesture_pinch_distance gesture_pinch_angle_towards gesture_pinch_angle_away gesture_rotate_time gesture_rotate_angle gesture_tap_count gesture_get_drag_time gesture_get_drag_distance gesture_get_flick_speed gesture_get_double_tap_time gesture_get_double_tap_distance gesture_get_pinch_distance gesture_get_pinch_angle_towards gesture_get_pinch_angle_away gesture_get_rotate_time gesture_get_rotate_angle gesture_get_tap_count keyboard_virtual_show keyboard_virtual_hide keyboard_virtual_status keyboard_virtual_height",literal:"self other all noone global local undefined pointer_invalid pointer_null path_action_stop path_action_restart path_action_continue path_action_reverse true false pi GM_build_date GM_version GM_runtime_version timezone_local timezone_utc gamespeed_fps gamespeed_microseconds ev_create ev_destroy ev_step ev_alarm ev_keyboard ev_mouse ev_collision ev_other ev_draw ev_draw_begin ev_draw_end ev_draw_pre ev_draw_post ev_keypress ev_keyrelease ev_trigger ev_left_button ev_right_button ev_middle_button ev_no_button ev_left_press ev_right_press ev_middle_press ev_left_release ev_right_release ev_middle_release ev_mouse_enter ev_mouse_leave ev_mouse_wheel_up ev_mouse_wheel_down ev_global_left_button ev_global_right_button ev_global_middle_button ev_global_left_press ev_global_right_press ev_global_middle_press ev_global_left_release ev_global_right_release ev_global_middle_release ev_joystick1_left ev_joystick1_right ev_joystick1_up ev_joystick1_down ev_joystick1_button1 ev_joystick1_button2 ev_joystick1_button3 ev_joystick1_button4 ev_joystick1_button5 ev_joystick1_button6 ev_joystick1_button7 ev_joystick1_button8 ev_joystick2_left ev_joystick2_right ev_joystick2_up ev_joystick2_down ev_joystick2_button1 ev_joystick2_button2 ev_joystick2_button3 ev_joystick2_button4 ev_joystick2_button5 ev_joystick2_button6 ev_joystick2_button7 ev_joystick2_button8 ev_outside ev_boundary ev_game_start ev_game_end ev_room_start ev_room_end ev_no_more_lives ev_animation_end ev_end_of_path ev_no_more_health ev_close_button ev_user0 ev_user1 ev_user2 ev_user3 ev_user4 ev_user5 ev_user6 ev_user7 ev_user8 ev_user9 ev_user10 ev_user11 ev_user12 ev_user13 ev_user14 ev_user15 ev_step_normal ev_step_begin ev_step_end ev_gui ev_gui_begin ev_gui_end ev_cleanup ev_gesture ev_gesture_tap ev_gesture_double_tap ev_gesture_drag_start ev_gesture_dragging ev_gesture_drag_end ev_gesture_flick ev_gesture_pinch_start ev_gesture_pinch_in ev_gesture_pinch_out ev_gesture_pinch_end ev_gesture_rotate_start ev_gesture_rotating ev_gesture_rotate_end ev_global_gesture_tap ev_global_gesture_double_tap ev_global_gesture_drag_start ev_global_gesture_dragging ev_global_gesture_drag_end ev_global_gesture_flick ev_global_gesture_pinch_start ev_global_gesture_pinch_in ev_global_gesture_pinch_out ev_global_gesture_pinch_end ev_global_gesture_rotate_start ev_global_gesture_rotating ev_global_gesture_rotate_end vk_nokey vk_anykey vk_enter vk_return vk_shift vk_control vk_alt vk_escape vk_space vk_backspace vk_tab vk_pause vk_printscreen vk_left vk_right vk_up vk_down vk_home vk_end vk_delete vk_insert vk_pageup vk_pagedown vk_f1 vk_f2 vk_f3 vk_f4 vk_f5 vk_f6 vk_f7 vk_f8 vk_f9 vk_f10 vk_f11 vk_f12 vk_numpad0 vk_numpad1 vk_numpad2 vk_numpad3 vk_numpad4 vk_numpad5 vk_numpad6 vk_numpad7 vk_numpad8 vk_numpad9 vk_divide vk_multiply vk_subtract vk_add vk_decimal vk_lshift vk_lcontrol vk_lalt vk_rshift vk_rcontrol vk_ralt mb_any mb_none mb_left mb_right mb_middle c_aqua c_black c_blue c_dkgray c_fuchsia c_gray c_green c_lime c_ltgray c_maroon c_navy c_olive c_purple c_red c_silver c_teal c_white c_yellow c_orange fa_left fa_center fa_right fa_top fa_middle fa_bottom pr_pointlist pr_linelist pr_linestrip pr_trianglelist pr_trianglestrip pr_trianglefan bm_complex bm_normal bm_add bm_max bm_subtract bm_zero bm_one bm_src_colour bm_inv_src_colour bm_src_color bm_inv_src_color bm_src_alpha bm_inv_src_alpha bm_dest_alpha bm_inv_dest_alpha bm_dest_colour bm_inv_dest_colour bm_dest_color bm_inv_dest_color bm_src_alpha_sat tf_point tf_linear tf_anisotropic mip_off mip_on mip_markedonly audio_falloff_none audio_falloff_inverse_distance audio_falloff_inverse_distance_clamped audio_falloff_linear_distance audio_falloff_linear_distance_clamped audio_falloff_exponent_distance audio_falloff_exponent_distance_clamped audio_old_system audio_new_system audio_mono audio_stereo audio_3d cr_default cr_none cr_arrow cr_cross cr_beam cr_size_nesw cr_size_ns cr_size_nwse cr_size_we cr_uparrow cr_hourglass cr_drag cr_appstart cr_handpoint cr_size_all spritespeed_framespersecond spritespeed_framespergameframe asset_object asset_unknown asset_sprite asset_sound asset_room asset_path asset_script asset_font asset_timeline asset_tiles asset_shader fa_readonly fa_hidden fa_sysfile fa_volumeid fa_directory fa_archive ds_type_map ds_type_list ds_type_stack ds_type_queue ds_type_grid ds_type_priority ef_explosion ef_ring ef_ellipse ef_firework ef_smoke ef_smokeup ef_star ef_spark ef_flare ef_cloud ef_rain ef_snow pt_shape_pixel pt_shape_disk pt_shape_square pt_shape_line pt_shape_star pt_shape_circle pt_shape_ring pt_shape_sphere pt_shape_flare pt_shape_spark pt_shape_explosion pt_shape_cloud pt_shape_smoke pt_shape_snow ps_distr_linear ps_distr_gaussian ps_distr_invgaussian ps_shape_rectangle ps_shape_ellipse ps_shape_diamond ps_shape_line ty_real ty_string dll_cdecl dll_stdcall matrix_view matrix_projection matrix_world os_win32 os_windows os_macosx os_ios os_android os_symbian os_linux os_unknown os_winphone os_tizen os_win8native os_wiiu os_3ds os_psvita os_bb10 os_ps4 os_xboxone os_ps3 os_xbox360 os_uwp os_tvos os_switch browser_not_a_browser browser_unknown browser_ie browser_firefox browser_chrome browser_safari browser_safari_mobile browser_opera browser_tizen browser_edge browser_windows_store browser_ie_mobile device_ios_unknown device_ios_iphone device_ios_iphone_retina device_ios_ipad device_ios_ipad_retina device_ios_iphone5 device_ios_iphone6 device_ios_iphone6plus device_emulator device_tablet display_landscape display_landscape_flipped display_portrait display_portrait_flipped tm_sleep tm_countvsyncs of_challenge_win of_challen ge_lose of_challenge_tie leaderboard_type_number leaderboard_type_time_mins_secs cmpfunc_never cmpfunc_less cmpfunc_equal cmpfunc_lessequal cmpfunc_greater cmpfunc_notequal cmpfunc_greaterequal cmpfunc_always cull_noculling cull_clockwise cull_counterclockwise lighttype_dir lighttype_point iap_ev_storeload iap_ev_product iap_ev_purchase iap_ev_consume iap_ev_restore iap_storeload_ok iap_storeload_failed iap_status_uninitialised iap_status_unavailable iap_status_loading iap_status_available iap_status_processing iap_status_restoring iap_failed iap_unavailable iap_available iap_purchased iap_canceled iap_refunded fb_login_default fb_login_fallback_to_webview fb_login_no_fallback_to_webview fb_login_forcing_webview fb_login_use_system_account fb_login_forcing_safari phy_joint_anchor_1_x phy_joint_anchor_1_y phy_joint_anchor_2_x phy_joint_anchor_2_y phy_joint_reaction_force_x phy_joint_reaction_force_y phy_joint_reaction_torque phy_joint_motor_speed phy_joint_angle phy_joint_motor_torque phy_joint_max_motor_torque phy_joint_translation phy_joint_speed phy_joint_motor_force phy_joint_max_motor_force phy_joint_length_1 phy_joint_length_2 phy_joint_damping_ratio phy_joint_frequency phy_joint_lower_angle_limit phy_joint_upper_angle_limit phy_joint_angle_limits phy_joint_max_length phy_joint_max_torque phy_joint_max_force phy_debug_render_aabb phy_debug_render_collision_pairs phy_debug_render_coms phy_debug_render_core_shapes phy_debug_render_joints phy_debug_render_obb phy_debug_render_shapes phy_particle_flag_water phy_particle_flag_zombie phy_particle_flag_wall phy_particle_flag_spring phy_particle_flag_elastic phy_particle_flag_viscous phy_particle_flag_powder phy_particle_flag_tensile phy_particle_flag_colourmixing phy_particle_flag_colormixing phy_particle_group_flag_solid phy_particle_group_flag_rigid phy_particle_data_flag_typeflags phy_particle_data_flag_position phy_particle_data_flag_velocity phy_particle_data_flag_colour phy_particle_data_flag_color phy_particle_data_flag_category achievement_our_info achievement_friends_info achievement_leaderboard_info achievement_achievement_info achievement_filter_all_players achievement_filter_friends_only achievement_filter_favorites_only achievement_type_achievement_challenge achievement_type_score_challenge achievement_pic_loaded achievement_show_ui achievement_show_profile achievement_show_leaderboard achievement_show_achievement achievement_show_bank achievement_show_friend_picker achievement_show_purchase_prompt network_socket_tcp network_socket_udp network_socket_bluetooth network_type_connect network_type_disconnect network_type_data network_type_non_blocking_connect network_config_connect_timeout network_config_use_non_blocking_socket network_config_enable_reliable_udp network_config_disable_reliable_udp buffer_fixed buffer_grow buffer_wrap buffer_fast buffer_vbuffer buffer_network buffer_u8 buffer_s8 buffer_u16 buffer_s16 buffer_u32 buffer_s32 buffer_u64 buffer_f16 buffer_f32 buffer_f64 buffer_bool buffer_text buffer_string buffer_surface_copy buffer_seek_start buffer_seek_relative buffer_seek_end buffer_generalerror buffer_outofspace buffer_outofbounds buffer_invalidtype text_type button_type input_type ANSI_CHARSET DEFAULT_CHARSET EASTEUROPE_CHARSET RUSSIAN_CHARSET SYMBOL_CHARSET SHIFTJIS_CHARSET HANGEUL_CHARSET GB2312_CHARSET CHINESEBIG5_CHARSET JOHAB_CHARSET HEBREW_CHARSET ARABIC_CHARSET GREEK_CHARSET TURKISH_CHARSET VIETNAMESE_CHARSET THAI_CHARSET MAC_CHARSET BALTIC_CHARSET OEM_CHARSET gp_face1 gp_face2 gp_face3 gp_face4 gp_shoulderl gp_shoulderr gp_shoulderlb gp_shoulderrb gp_select gp_start gp_stickl gp_stickr gp_padu gp_padd gp_padl gp_padr gp_axislh gp_axislv gp_axisrh gp_axisrv ov_friends ov_community ov_players ov_settings ov_gamegroup ov_achievements lb_sort_none lb_sort_ascending lb_sort_descending lb_disp_none lb_disp_numeric lb_disp_time_sec lb_disp_time_ms ugc_result_success ugc_filetype_community ugc_filetype_microtrans ugc_visibility_public ugc_visibility_friends_only ugc_visibility_private ugc_query_RankedByVote ugc_query_RankedByPublicationDate ugc_query_AcceptedForGameRankedByAcceptanceDate ugc_query_RankedByTrend ugc_query_FavoritedByFriendsRankedByPublicationDate ugc_query_CreatedByFriendsRankedByPublicationDate ugc_query_RankedByNumTimesReported ugc_query_CreatedByFollowedUsersRankedByPublicationDate ugc_query_NotYetRated ugc_query_RankedByTotalVotesAsc ugc_query_RankedByVotesUp ugc_query_RankedByTextSearch ugc_sortorder_CreationOrderDesc ugc_sortorder_CreationOrderAsc ugc_sortorder_TitleAsc ugc_sortorder_LastUpdatedDesc ugc_sortorder_SubscriptionDateDesc ugc_sortorder_VoteScoreDesc ugc_sortorder_ForModeration ugc_list_Published ugc_list_VotedOn ugc_list_VotedUp ugc_list_VotedDown ugc_list_WillVoteLater ugc_list_Favorited ugc_list_Subscribed ugc_list_UsedOrPlayed ugc_list_Followed ugc_match_Items ugc_match_Items_Mtx ugc_match_Items_ReadyToUse ugc_match_Collections ugc_match_Artwork ugc_match_Videos ugc_match_Screenshots ugc_match_AllGuides ugc_match_WebGuides ugc_match_IntegratedGuides ugc_match_UsableInGame ugc_match_ControllerBindings vertex_usage_position vertex_usage_colour vertex_usage_color vertex_usage_normal vertex_usage_texcoord vertex_usage_textcoord vertex_usage_blendweight vertex_usage_blendindices vertex_usage_psize vertex_usage_tangent vertex_usage_binormal vertex_usage_fog vertex_usage_depth vertex_usage_sample vertex_type_float1 vertex_type_float2 vertex_type_float3 vertex_type_float4 vertex_type_colour vertex_type_color vertex_type_ubyte4 layerelementtype_undefined layerelementtype_background layerelementtype_instance layerelementtype_oldtilemap layerelementtype_sprite layerelementtype_tilemap layerelementtype_particlesystem layerelementtype_tile tile_rotate tile_flip tile_mirror tile_index_mask kbv_type_default kbv_type_ascii kbv_type_url kbv_type_email kbv_type_numbers kbv_type_phone kbv_type_phone_name kbv_returnkey_default kbv_returnkey_go kbv_returnkey_google kbv_returnkey_join kbv_returnkey_next kbv_returnkey_route kbv_returnkey_search kbv_returnkey_send kbv_returnkey_yahoo kbv_returnkey_done kbv_returnkey_continue kbv_returnkey_emergency kbv_autocapitalize_none kbv_autocapitalize_words kbv_autocapitalize_sentences kbv_autocapitalize_characters",symbol:"argument_relative argument argument0 argument1 argument2 argument3 argument4 argument5 argument6 argument7 argument8 argument9 argument10 argument11 argument12 argument13 argument14 argument15 argument_count x|0 y|0 xprevious yprevious xstart ystart hspeed vspeed direction speed friction gravity gravity_direction path_index path_position path_positionprevious path_speed path_scale path_orientation path_endaction object_index id solid persistent mask_index instance_count instance_id room_speed fps fps_real current_time current_year current_month current_day current_weekday current_hour current_minute current_second alarm timeline_index timeline_position timeline_speed timeline_running timeline_loop room room_first room_last room_width room_height room_caption room_persistent score lives health show_score show_lives show_health caption_score caption_lives caption_health event_type event_number event_object event_action application_surface gamemaker_pro gamemaker_registered gamemaker_version error_occurred error_last debug_mode keyboard_key keyboard_lastkey keyboard_lastchar keyboard_string mouse_x mouse_y mouse_button mouse_lastbutton cursor_sprite visible sprite_index sprite_width sprite_height sprite_xoffset sprite_yoffset image_number image_index image_speed depth image_xscale image_yscale image_angle image_alpha image_blend bbox_left bbox_right bbox_top bbox_bottom layer background_colour background_showcolour background_color background_showcolor view_enabled view_current view_visible view_xview view_yview view_wview view_hview view_xport view_yport view_wport view_hport view_angle view_hborder view_vborder view_hspeed view_vspeed view_object view_surface_id view_camera game_id game_display_name game_project_name game_save_id working_directory temp_directory program_directory browser_width browser_height os_type os_device os_browser os_version display_aa async_load delta_time webgl_enabled event_data iap_data phy_rotation phy_position_x phy_position_y phy_angular_velocity phy_linear_velocity_x phy_linear_velocity_y phy_speed_x phy_speed_y phy_speed phy_angular_damping phy_linear_damping phy_bullet phy_fixed_rotation phy_active phy_mass phy_inertia phy_com_x phy_com_y phy_dynamic phy_kinematic phy_sleeping phy_collision_points phy_collision_x phy_collision_y phy_col_normal_x phy_col_normal_y phy_position_xprevious phy_position_yprevious"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE]}}Jcn.exports=tss});var eln=ee((iDa,Zcn)=>{p();function nss(t){return{name:"Golo",keywords:{keyword:"println readln print import module function local return let var while for foreach times in case when match with break continue augment augmentation each find filter reduce if then else otherwise try catch finally raise throw orIfNull DynamicObject|10 DynamicVariable struct Observable map set vector list array",literal:"true false null"},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"}]}}Zcn.exports=nss});var nln=ee((aDa,tln)=>{p();function rss(t){return{name:"Gradle",case_insensitive:!0,keywords:{keyword:"task project allprojects subprojects artifacts buildscript configurations dependencies repositories sourceSets description delete from into include exclude source classpath destinationDir includes options sourceCompatibility targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant def abstract break case catch continue default do else extends final finally for if implements instanceof native new private protected public return static switch synchronized throw throws transient try volatile while strictfp package import false null super this true antlrtask checkstyle codenarc copy boolean byte char class double float int interface long short void compile runTime file fileTree abs any append asList asWritable call collect compareTo count div dump each eachByte eachFile eachLine every find findAll flatten getAt getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter newReader newWriter next plus pop power previous print println push putAt read readBytes readLines reverse reverseEach round size sort splitEachLine step subMap times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader withStream withWriter withWriterAppend write writeLine"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.REGEXP_MODE]}}tln.exports=rss});var sln=ee((lDa,rln)=>{p();function sss(t){return{name:"HAML",case_insensitive:!0,contains:[{className:"meta",begin:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",relevance:10},t.COMMENT("^\\s*(!=#|=#|-#|/).*$",!1,{relevance:0}),{begin:"^\\s*(-|=|!=)(?!#)",starts:{end:"\\n",subLanguage:"ruby"}},{className:"tag",begin:"^\\s*%",contains:[{className:"selector-tag",begin:"\\w+"},{className:"selector-id",begin:"#[\\w-]+"},{className:"selector-class",begin:"\\.[\\w-]+"},{begin:/\{\s*/,end:/\s*\}/,contains:[{begin:":\\w+\\s*=>",end:",\\s+",returnBegin:!0,endsWithParent:!0,contains:[{className:"attr",begin:":\\w+"},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{begin:"\\w+",relevance:0}]}]},{begin:"\\(\\s*",end:"\\s*\\)",excludeEnd:!0,contains:[{begin:"\\w+\\s*=",end:"\\s+",returnBegin:!0,endsWithParent:!0,contains:[{className:"attr",begin:"\\w+",relevance:0},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{begin:"\\w+",relevance:0}]}]}]},{begin:"^\\s*[=~]\\s*"},{begin:/#\{/,starts:{end:/\}/,subLanguage:"ruby"}}]}}rln.exports=sss});var aln=ee((dDa,oln)=>{p();function iln(t){return t?typeof t=="string"?t:t.source:null}function iss(t){return kX("(",t,")*")}function oss(t){return kX("(",t,")?")}function kX(...t){return t.map(n=>iln(n)).join("")}function ass(...t){return"("+t.map(n=>iln(n)).join("|")+")"}function css(t){let e={"builtin-name":["action","bindattr","collection","component","concat","debugger","each","each-in","get","hash","if","in","input","link-to","loc","log","lookup","mut","outlet","partial","query-params","render","template","textarea","unbound","unless","view","with","yield"]},n={literal:["true","false","undefined","null"]},r=/""|"[^"]+"/,s=/''|'[^']+'/,i=/\[\]|\[[^\]]+\]/,o=/[^\s!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/,a=/(\.|\/)/,c=ass(r,s,i,o),u=kX(oss(/\.|\.\/|\//),c,iss(kX(a,c))),l=kX("(",i,"|",o,")(?==)"),d={begin:u,lexemes:/[\w.\/]+/},h=t.inherit(d,{keywords:n}),m={begin:/\(/,end:/\)/},f={className:"attr",begin:l,relevance:0,starts:{begin:/=/,end:/=/,starts:{contains:[t.NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,h,m]}}},g={begin:/as\s+\|/,keywords:{keyword:"as"},end:/\|/,contains:[{begin:/\w+/}]},A={contains:[t.NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,g,f,h,m],returnEnd:!0},y=t.inherit(d,{className:"name",keywords:e,starts:t.inherit(A,{end:/\)/})});m.contains=[y];let b=t.inherit(d,{keywords:e,className:"name",starts:t.inherit(A,{end:/\}\}/})}),S=t.inherit(d,{keywords:e,className:"name"}),C=t.inherit(d,{className:"name",keywords:e,starts:t.inherit(A,{end:/\}\}/})});return{name:"Handlebars",aliases:["hbs","html.hbs","html.handlebars","htmlbars"],case_insensitive:!0,subLanguage:"xml",contains:[{begin:/\\\{\{/,skip:!0},{begin:/\\\\(?=\{\{)/,skip:!0},t.COMMENT(/\{\{!--/,/--\}\}/),t.COMMENT(/\{\{!/,/\}\}/),{className:"template-tag",begin:/\{\{\{\{(?!\/)/,end:/\}\}\}\}/,contains:[b],starts:{end:/\{\{\{\{\//,returnEnd:!0,subLanguage:"xml"}},{className:"template-tag",begin:/\{\{\{\{\//,end:/\}\}\}\}/,contains:[S]},{className:"template-tag",begin:/\{\{#/,end:/\}\}/,contains:[b]},{className:"template-tag",begin:/\{\{(?=else\}\})/,end:/\}\}/,keywords:"else"},{className:"template-tag",begin:/\{\{(?=else if)/,end:/\}\}/,keywords:"else if"},{className:"template-tag",begin:/\{\{\//,end:/\}\}/,contains:[S]},{className:"template-variable",begin:/\{\{\{/,end:/\}\}\}/,contains:[C]},{className:"template-variable",begin:/\{\{/,end:/\}\}/,contains:[C]}]}}oln.exports=css});var lln=ee((hDa,cln)=>{p();function lss(t){let e={variants:[t.COMMENT("--","$"),t.COMMENT(/\{-/,/-\}/,{contains:["self"]})]},n={className:"meta",begin:/\{-#/,end:/#-\}/},r={className:"meta",begin:"^#",end:"$"},s={className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},i={begin:"\\(",end:"\\)",illegal:'"',contains:[n,r,{className:"type",begin:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},t.inherit(t.TITLE_MODE,{begin:"[_a-z][\\w']*"}),e]},o={begin:/\{/,end:/\}/,contains:i.contains};return{name:"Haskell",aliases:["hs"],keywords:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",contains:[{beginKeywords:"module",end:"where",keywords:"module where",contains:[i,e],illegal:"\\W\\.|;"},{begin:"\\bimport\\b",end:"$",keywords:"import qualified as hiding",contains:[i,e],illegal:"\\W\\.|;"},{className:"class",begin:"^(\\s*)?(class|instance)\\b",end:"where",keywords:"class family instance where",contains:[s,i,e]},{className:"class",begin:"\\b(data|(new)?type)\\b",end:"$",keywords:"data family type newtype deriving",contains:[n,s,i,o,e]},{beginKeywords:"default",end:"$",contains:[s,i,e]},{beginKeywords:"infix infixl infixr",end:"$",contains:[t.C_NUMBER_MODE,e]},{begin:"\\bforeign\\b",end:"$",keywords:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",contains:[s,t.QUOTE_STRING_MODE,e]},{className:"meta",begin:"#!\\/usr\\/bin\\/env runhaskell",end:"$"},n,r,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,s,t.inherit(t.TITLE_MODE,{begin:"^[_a-z][\\w']*"}),e,{begin:"->|<-"}]}}cln.exports=lss});var dln=ee((fDa,uln)=>{p();function uss(t){return{name:"Haxe",aliases:["hx"],keywords:{keyword:"break case cast catch continue default do dynamic else enum extern for function here if import in inline never new override package private get set public return static super switch this throw trace try typedef untyped using var while "+"Int Float String Bool Dynamic Void Array ",built_in:"trace this",literal:"true false null _"},contains:[{className:"string",begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE,{className:"subst",begin:"\\$\\{",end:"\\}"},{className:"subst",begin:"\\$",end:/\W\}/}]},t.QUOTE_STRING_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"@:",end:"$"},{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elseif end error"}},{className:"type",begin:":[ ]*",end:"[^A-Za-z0-9_ \\->]",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:":[ ]*",end:"\\W",excludeBegin:!0,excludeEnd:!0},{className:"type",begin:"new *",end:"\\W",excludeBegin:!0,excludeEnd:!0},{className:"class",beginKeywords:"enum",end:"\\{",contains:[t.TITLE_MODE]},{className:"class",beginKeywords:"abstract",end:"[\\{$]",contains:[{className:"type",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"type",begin:"from +",end:"\\W",excludeBegin:!0,excludeEnd:!0},{className:"type",begin:"to +",end:"\\W",excludeBegin:!0,excludeEnd:!0},t.TITLE_MODE],keywords:{keyword:"abstract from to"}},{className:"class",begin:"\\b(class|interface) +",end:"[\\{$]",excludeEnd:!0,keywords:"class interface",contains:[{className:"keyword",begin:"\\b(extends|implements) +",keywords:"extends implements",contains:[{className:"type",begin:t.IDENT_RE,relevance:0}]},t.TITLE_MODE]},{className:"function",beginKeywords:"function",end:"\\(",excludeEnd:!0,illegal:"\\S",contains:[t.TITLE_MODE]}],illegal:/<\//}}uln.exports=uss});var hln=ee((ADa,pln)=>{p();function dss(t){return{name:"HSP",case_insensitive:!0,keywords:{$pattern:/[\w._]+/,keyword:"goto gosub return break repeat loop continue wait await dim sdim foreach dimtype dup dupptr end stop newmod delmod mref run exgoto on mcall assert logmes newlab resume yield onexit onerror onkey onclick oncmd exist delete mkdir chdir dirlist bload bsave bcopy memfile if else poke wpoke lpoke getstr chdpm memexpand memcpy memset notesel noteadd notedel noteload notesave randomize noteunsel noteget split strrep setease button chgdisp exec dialog mmload mmplay mmstop mci pset pget syscolor mes print title pos circle cls font sysfont objsize picload color palcolor palette redraw width gsel gcopy gzoom gmode bmpsave hsvcolor getkey listbox chkbox combox input mesbox buffer screen bgscr mouse objsel groll line clrobj boxf objprm objmode stick grect grotate gsquare gradf objimage objskip objenable celload celdiv celput newcom querycom delcom cnvstow comres axobj winobj sendmsg comevent comevarg sarrayconv callfunc cnvwtos comevdisp libptr system hspstat hspver stat cnt err strsize looplev sublev iparam wparam lparam refstr refdval int rnd strlen length length2 length3 length4 vartype gettime peek wpeek lpeek varptr varuse noteinfo instr abs limit getease str strmid strf getpath strtrim sin cos tan atan sqrt double absf expf logf limitf powf geteasef mousex mousey mousew hwnd hinstance hdc ginfo objinfo dirinfo sysinfo thismod __hspver__ __hsp30__ __date__ __time__ __line__ __file__ _debug __hspdef__ and or xor not screen_normal screen_palette screen_hide screen_fixedsize screen_tool screen_frame gmode_gdi gmode_mem gmode_rgb0 gmode_alpha gmode_rgb0alpha gmode_add gmode_sub gmode_pixela ginfo_mx ginfo_my ginfo_act ginfo_sel ginfo_wx1 ginfo_wy1 ginfo_wx2 ginfo_wy2 ginfo_vx ginfo_vy ginfo_sizex ginfo_sizey ginfo_winx ginfo_winy ginfo_mesx ginfo_mesy ginfo_r ginfo_g ginfo_b ginfo_paluse ginfo_dispx ginfo_dispy ginfo_cx ginfo_cy ginfo_intid ginfo_newid ginfo_sx ginfo_sy objinfo_mode objinfo_bmscr objinfo_hwnd notemax notesize dir_cur dir_exe dir_win dir_sys dir_cmdline dir_desktop dir_mydoc dir_tv font_normal font_bold font_italic font_underline font_strikeout font_antialias objmode_normal objmode_guifont objmode_usefont gsquare_grad msgothic msmincho do until while wend for next _break _continue switch case default swbreak swend ddim ldim alloc m_pi rad2deg deg2rad ease_linear ease_quad_in ease_quad_out ease_quad_inout ease_cubic_in ease_cubic_out ease_cubic_inout ease_quartic_in ease_quartic_out ease_quartic_inout ease_bounce_in ease_bounce_out ease_bounce_inout ease_shake_in ease_shake_out ease_shake_inout ease_loop"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",begin:/\{"/,end:/"\}/,contains:[t.BACKSLASH_ESCAPE]},t.COMMENT(";","$",{relevance:0}),{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"addion cfunc cmd cmpopt comfunc const defcfunc deffunc define else endif enum epack func global if ifdef ifndef include modcfunc modfunc modinit modterm module pack packopt regcmd runtime undef usecom uselib"},contains:[t.inherit(t.QUOTE_STRING_MODE,{className:"meta-string"}),t.NUMBER_MODE,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"symbol",begin:"^\\*(\\w+|@)"},t.NUMBER_MODE,t.C_NUMBER_MODE]}}pln.exports=dss});var gln=ee((EDa,fln)=>{p();function mln(t){return t?typeof t=="string"?t:t.source:null}function pss(t){return NX("(",t,")*")}function hss(t){return NX("(",t,")?")}function NX(...t){return t.map(n=>mln(n)).join("")}function mss(...t){return"("+t.map(n=>mln(n)).join("|")+")"}function fss(t){let e={"builtin-name":["action","bindattr","collection","component","concat","debugger","each","each-in","get","hash","if","in","input","link-to","loc","log","lookup","mut","outlet","partial","query-params","render","template","textarea","unbound","unless","view","with","yield"]},n={literal:["true","false","undefined","null"]},r=/""|"[^"]+"/,s=/''|'[^']+'/,i=/\[\]|\[[^\]]+\]/,o=/[^\s!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/,a=/(\.|\/)/,c=mss(r,s,i,o),u=NX(hss(/\.|\.\/|\//),c,pss(NX(a,c))),l=NX("(",i,"|",o,")(?==)"),d={begin:u,lexemes:/[\w.\/]+/},h=t.inherit(d,{keywords:n}),m={begin:/\(/,end:/\)/},f={className:"attr",begin:l,relevance:0,starts:{begin:/=/,end:/=/,starts:{contains:[t.NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,h,m]}}},g={begin:/as\s+\|/,keywords:{keyword:"as"},end:/\|/,contains:[{begin:/\w+/}]},A={contains:[t.NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,g,f,h,m],returnEnd:!0},y=t.inherit(d,{className:"name",keywords:e,starts:t.inherit(A,{end:/\)/})});m.contains=[y];let b=t.inherit(d,{keywords:e,className:"name",starts:t.inherit(A,{end:/\}\}/})}),S=t.inherit(d,{keywords:e,className:"name"}),C=t.inherit(d,{className:"name",keywords:e,starts:t.inherit(A,{end:/\}\}/})});return{name:"Handlebars",aliases:["hbs","html.hbs","html.handlebars","htmlbars"],case_insensitive:!0,subLanguage:"xml",contains:[{begin:/\\\{\{/,skip:!0},{begin:/\\\\(?=\{\{)/,skip:!0},t.COMMENT(/\{\{!--/,/--\}\}/),t.COMMENT(/\{\{!/,/\}\}/),{className:"template-tag",begin:/\{\{\{\{(?!\/)/,end:/\}\}\}\}/,contains:[b],starts:{end:/\{\{\{\{\//,returnEnd:!0,subLanguage:"xml"}},{className:"template-tag",begin:/\{\{\{\{\//,end:/\}\}\}\}/,contains:[S]},{className:"template-tag",begin:/\{\{#/,end:/\}\}/,contains:[b]},{className:"template-tag",begin:/\{\{(?=else\}\})/,end:/\}\}/,keywords:"else"},{className:"template-tag",begin:/\{\{(?=else if)/,end:/\}\}/,keywords:"else if"},{className:"template-tag",begin:/\{\{\//,end:/\}\}/,contains:[S]},{className:"template-variable",begin:/\{\{\{/,end:/\}\}\}/,contains:[C]},{className:"template-variable",begin:/\{\{/,end:/\}\}/,contains:[C]}]}}function gss(t){let e=fss(t);return e.name="HTMLbars",t.getLanguage("handlebars")&&(e.disableAutodetect=!0),e}fln.exports=gss});var yln=ee((_Da,Aln)=>{p();function Ass(t){return t?typeof t=="string"?t:t.source:null}function yss(...t){return t.map(n=>Ass(n)).join("")}function Ess(t){let e="HTTP/(2|1\\.[01])",r={className:"attribute",begin:yss("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},s=[r,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+e+" \\d{3})",end:/$/,contains:[{className:"meta",begin:e},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:s}},{begin:"(?=^[A-Z]+ (.*?) "+e+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:e},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:s}},t.inherit(r,{relevance:0})]}}Aln.exports=Ess});var bln=ee((CDa,Eln)=>{p();function bss(t){var e="a-zA-Z_\\-!.?+*=<>&#'",n="["+e+"]["+e+"0-9/;:]*",r={$pattern:n,"builtin-name":"!= % %= & &= * ** **= *= *map + += , --build-class-- --import-- -= . / // //= /= < << <<= <= = > >= >> >>= @ @= ^ ^= abs accumulate all and any ap-compose ap-dotimes ap-each ap-each-while ap-filter ap-first ap-if ap-last ap-map ap-map-when ap-pipe ap-reduce ap-reject apply as-> ascii assert assoc bin break butlast callable calling-module-name car case cdr chain chr coll? combinations compile compress cond cons cons? continue count curry cut cycle dec def default-method defclass defmacro defmacro-alias defmacro/g! defmain defmethod defmulti defn defn-alias defnc defnr defreader defseq del delattr delete-route dict-comp dir disassemble dispatch-reader-macro distinct divmod do doto drop drop-last drop-while empty? end-sequence eval eval-and-compile eval-when-compile even? every? except exec filter first flatten float? fn fnc fnr for for* format fraction genexpr gensym get getattr global globals group-by hasattr hash hex id identity if if* if-not if-python2 import in inc input instance? integer integer-char? integer? interleave interpose is is-coll is-cons is-empty is-even is-every is-float is-instance is-integer is-integer-char is-iterable is-iterator is-keyword is-neg is-none is-not is-numeric is-odd is-pos is-string is-symbol is-zero isinstance islice issubclass iter iterable? iterate iterator? keyword keyword? lambda last len let lif lif-not list* list-comp locals loop macro-error macroexpand macroexpand-1 macroexpand-all map max merge-with method-decorator min multi-decorator multicombinations name neg? next none? nonlocal not not-in not? nth numeric? oct odd? open or ord partition permutations pos? post-route postwalk pow prewalk print product profile/calls profile/cpu put-route quasiquote quote raise range read read-str recursive-replace reduce remove repeat repeatedly repr require rest round route route-with-methods rwm second seq set-comp setattr setv some sorted string string? sum switch symbol? take take-nth take-while tee try unless unquote unquote-splicing vars walk when while with with* with-decorator with-gensyms xi xor yield yield-from zero? zip zip-longest | |= ~"},s="[-+]?\\d+(\\.\\d+)?",i={begin:n,relevance:0},o={className:"number",begin:s,relevance:0},a=t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),c=t.COMMENT(";","$",{relevance:0}),u={className:"literal",begin:/\b([Tt]rue|[Ff]alse|nil|None)\b/},l={begin:"[\\[\\{]",end:"[\\]\\}]"},d={className:"comment",begin:"\\^"+n},h=t.COMMENT("\\^\\{","\\}"),m={className:"symbol",begin:"[:]{1,2}"+n},f={begin:"\\(",end:"\\)"},g={endsWithParent:!0,relevance:0},A={className:"name",relevance:0,keywords:r,begin:n,starts:g},y=[f,a,d,h,c,m,l,o,u,i];return f.contains=[t.COMMENT("comment",""),A,g],g.contains=y,l.contains=y,{name:"Hy",aliases:["hylang"],illegal:/\S/,contains:[t.SHEBANG(),f,a,d,h,c,m,l,o,u]}}Eln.exports=bss});var Sln=ee((xDa,_ln)=>{p();function _ss(t){return{name:"Inform 7",aliases:["i7"],case_insensitive:!0,keywords:{keyword:"thing room person man woman animal container supporter backdrop door scenery open closed locked inside gender is are say understand kind of rule"},contains:[{className:"string",begin:'"',end:'"',relevance:0,contains:[{className:"subst",begin:"\\[",end:"\\]"}]},{className:"section",begin:/^(Volume|Book|Part|Chapter|Section|Table)\b/,end:"$"},{begin:/^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,end:":",contains:[{begin:"\\(This",end:"\\)"}]},{className:"comment",begin:"\\[",end:"\\]",contains:["self"]}]}}_ln.exports=_ss});var wln=ee((TDa,xln)=>{p();function Cln(t){return t?typeof t=="string"?t:t.source:null}function Sss(t){return Iln("(?=",t,")")}function Iln(...t){return t.map(n=>Cln(n)).join("")}function Css(...t){return"("+t.map(n=>Cln(n)).join("|")+")"}function Iss(t){let e={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},n=t.COMMENT();n.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},i={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},o={begin:/\[/,end:/\]/,contains:[n,s,r,i,e,"self"],relevance:0},l=Css(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/),d=Iln(l,"(\\s*\\.\\s*",l,")*",Sss(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[n,{className:"section",begin:/\[+/,end:/\]+/},{begin:d,className:"attr",starts:{end:/$/,contains:[n,o,s,r,i,e]}}]}}xln.exports=Iss});var vln=ee((RDa,Tln)=>{p();function xss(t){return t?typeof t=="string"?t:t.source:null}function Eze(...t){return t.map(n=>xss(n)).join("")}function wss(t){let e={className:"params",begin:"\\(",end:"\\)"},n=/(_[a-z_\d]+)?/,r=/([de][+-]?\d+)?/,s={className:"number",variants:[{begin:Eze(/\b\d+/,/\.(\d*)/,r,n)},{begin:Eze(/\b\d+/,r,n)},{begin:Eze(/\.\d+/,r,n)}],relevance:0};return{name:"IRPF90",case_insensitive:!0,keywords:{literal:".False. .True.",keyword:"kind do while private call intrinsic where elsewhere type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. goto save else use module select case access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit continue format pause cycle exit c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg synchronous nopass non_overridable pass protected volatile abstract extends import non_intrinsic value deferred generic final enumerator class associate bind enum c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated c_f_pointer c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure integer real character complex logical dimension allocatable|10 parameter external implicit|10 none double precision assign intent optional pointer target in out common equivalence data begin_provider &begin_provider end_provider begin_shell end_shell begin_template end_template subst assert touch soft_touch provide no_dep free irp_if irp_else irp_endif irp_write irp_read",built_in:"alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image IRP_ALIGN irp_here"},illegal:/\/\*/,contains:[t.inherit(t.APOS_STRING_MODE,{className:"string",relevance:0}),t.inherit(t.QUOTE_STRING_MODE,{className:"string",relevance:0}),{className:"function",beginKeywords:"subroutine function program",illegal:"[${=\\n]",contains:[t.UNDERSCORE_TITLE_MODE,e]},t.COMMENT("!","$",{relevance:0}),t.COMMENT("begin_doc","end_doc",{relevance:10}),s]}}Tln.exports=wss});var kln=ee((NDa,Rln)=>{p();function Tss(t){let e="[A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_!][A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_0-9]*",n="[A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_][A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_0-9]*",r="and \u0438 else \u0438\u043D\u0430\u0447\u0435 endexcept endfinally endforeach \u043A\u043E\u043D\u0435\u0446\u0432\u0441\u0435 endif \u043A\u043E\u043D\u0435\u0446\u0435\u0441\u043B\u0438 endwhile \u043A\u043E\u043D\u0435\u0446\u043F\u043E\u043A\u0430 except exitfor finally foreach \u0432\u0441\u0435 if \u0435\u0441\u043B\u0438 in \u0432 not \u043D\u0435 or \u0438\u043B\u0438 try while \u043F\u043E\u043A\u0430 ",se="SYSRES_CONST_ACCES_RIGHT_TYPE_EDIT SYSRES_CONST_ACCES_RIGHT_TYPE_FULL SYSRES_CONST_ACCES_RIGHT_TYPE_VIEW SYSRES_CONST_ACCESS_MODE_REQUISITE_CODE SYSRES_CONST_ACCESS_NO_ACCESS_VIEW SYSRES_CONST_ACCESS_NO_ACCESS_VIEW_CODE SYSRES_CONST_ACCESS_RIGHTS_ADD_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_ADD_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_CHANGE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_CHANGE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_DELETE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_DELETE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_EXECUTE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_EXECUTE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_NO_ACCESS_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_NO_ACCESS_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_RATIFY_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_RATIFY_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW SYSRES_CONST_ACCESS_RIGHTS_VIEW_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_TYPE_CHANGE SYSRES_CONST_ACCESS_TYPE_CHANGE_CODE SYSRES_CONST_ACCESS_TYPE_EXISTS SYSRES_CONST_ACCESS_TYPE_EXISTS_CODE SYSRES_CONST_ACCESS_TYPE_FULL SYSRES_CONST_ACCESS_TYPE_FULL_CODE SYSRES_CONST_ACCESS_TYPE_VIEW SYSRES_CONST_ACCESS_TYPE_VIEW_CODE SYSRES_CONST_ACTION_TYPE_ABORT SYSRES_CONST_ACTION_TYPE_ACCEPT SYSRES_CONST_ACTION_TYPE_ACCESS_RIGHTS SYSRES_CONST_ACTION_TYPE_ADD_ATTACHMENT SYSRES_CONST_ACTION_TYPE_CHANGE_CARD SYSRES_CONST_ACTION_TYPE_CHANGE_KIND SYSRES_CONST_ACTION_TYPE_CHANGE_STORAGE SYSRES_CONST_ACTION_TYPE_CONTINUE SYSRES_CONST_ACTION_TYPE_COPY SYSRES_CONST_ACTION_TYPE_CREATE SYSRES_CONST_ACTION_TYPE_CREATE_VERSION SYSRES_CONST_ACTION_TYPE_DELETE SYSRES_CONST_ACTION_TYPE_DELETE_ATTACHMENT SYSRES_CONST_ACTION_TYPE_DELETE_VERSION SYSRES_CONST_ACTION_TYPE_DISABLE_DELEGATE_ACCESS_RIGHTS SYSRES_CONST_ACTION_TYPE_ENABLE_DELEGATE_ACCESS_RIGHTS SYSRES_CONST_ACTION_TYPE_ENCRYPTION_BY_CERTIFICATE SYSRES_CONST_ACTION_TYPE_ENCRYPTION_BY_CERTIFICATE_AND_PASSWORD SYSRES_CONST_ACTION_TYPE_ENCRYPTION_BY_PASSWORD SYSRES_CONST_ACTION_TYPE_EXPORT_WITH_LOCK SYSRES_CONST_ACTION_TYPE_EXPORT_WITHOUT_LOCK SYSRES_CONST_ACTION_TYPE_IMPORT_WITH_UNLOCK SYSRES_CONST_ACTION_TYPE_IMPORT_WITHOUT_UNLOCK SYSRES_CONST_ACTION_TYPE_LIFE_CYCLE_STAGE SYSRES_CONST_ACTION_TYPE_LOCK SYSRES_CONST_ACTION_TYPE_LOCK_FOR_SERVER SYSRES_CONST_ACTION_TYPE_LOCK_MODIFY SYSRES_CONST_ACTION_TYPE_MARK_AS_READED SYSRES_CONST_ACTION_TYPE_MARK_AS_UNREADED SYSRES_CONST_ACTION_TYPE_MODIFY SYSRES_CONST_ACTION_TYPE_MODIFY_CARD SYSRES_CONST_ACTION_TYPE_MOVE_TO_ARCHIVE SYSRES_CONST_ACTION_TYPE_OFF_ENCRYPTION SYSRES_CONST_ACTION_TYPE_PASSWORD_CHANGE SYSRES_CONST_ACTION_TYPE_PERFORM SYSRES_CONST_ACTION_TYPE_RECOVER_FROM_LOCAL_COPY SYSRES_CONST_ACTION_TYPE_RESTART SYSRES_CONST_ACTION_TYPE_RESTORE_FROM_ARCHIVE SYSRES_CONST_ACTION_TYPE_REVISION SYSRES_CONST_ACTION_TYPE_SEND_BY_MAIL SYSRES_CONST_ACTION_TYPE_SIGN SYSRES_CONST_ACTION_TYPE_START SYSRES_CONST_ACTION_TYPE_UNLOCK SYSRES_CONST_ACTION_TYPE_UNLOCK_FROM_SERVER SYSRES_CONST_ACTION_TYPE_VERSION_STATE SYSRES_CONST_ACTION_TYPE_VERSION_VISIBILITY SYSRES_CONST_ACTION_TYPE_VIEW SYSRES_CONST_ACTION_TYPE_VIEW_SHADOW_COPY SYSRES_CONST_ACTION_TYPE_WORKFLOW_DESCRIPTION_MODIFY SYSRES_CONST_ACTION_TYPE_WRITE_HISTORY SYSRES_CONST_ACTIVE_VERSION_STATE_PICK_VALUE SYSRES_CONST_ADD_REFERENCE_MODE_NAME SYSRES_CONST_ADDITION_REQUISITE_CODE SYSRES_CONST_ADDITIONAL_PARAMS_REQUISITE_CODE SYSRES_CONST_ADITIONAL_JOB_END_DATE_REQUISITE_NAME SYSRES_CONST_ADITIONAL_JOB_READ_REQUISITE_NAME SYSRES_CONST_ADITIONAL_JOB_START_DATE_REQUISITE_NAME SYSRES_CONST_ADITIONAL_JOB_STATE_REQUISITE_NAME SYSRES_CONST_ADMINISTRATION_HISTORY_ADDING_USER_TO_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_ADDING_USER_TO_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_COMP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_COMP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_USER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_USER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_CREATION SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_CREATION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_DELETION SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_DELETION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_COMP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_COMP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_FROM_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_FROM_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_RESTRICTION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_RESTRICTION_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_PRIVILEGE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_PRIVILEGE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_RIGHTS_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_RIGHTS_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_IS_MAIN_SERVER_CHANGED_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_IS_MAIN_SERVER_CHANGED_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_IS_PUBLIC_CHANGED_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_IS_PUBLIC_CHANGED_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_RESTRICTION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_RESTRICTION_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_PRIVILEGE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_PRIVILEGE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_RIGHTS_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_RIGHTS_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_CREATION SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_CREATION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_DELETION SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_DELETION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_CATEGORY_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_CATEGORY_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_COMP_TITLE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_COMP_TITLE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_FULL_NAME_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_FULL_NAME_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_PARENT_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_PARENT_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_AUTH_TYPE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_AUTH_TYPE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_LOGIN_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_LOGIN_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_STATUS_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_STATUS_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_USER_PASSWORD_CHANGE SYSRES_CONST_ADMINISTRATION_HISTORY_USER_PASSWORD_CHANGE_ACTION SYSRES_CONST_ALL_ACCEPT_CONDITION_RUS SYSRES_CONST_ALL_USERS_GROUP SYSRES_CONST_ALL_USERS_GROUP_NAME SYSRES_CONST_ALL_USERS_SERVER_GROUP_NAME SYSRES_CONST_ALLOWED_ACCESS_TYPE_CODE SYSRES_CONST_ALLOWED_ACCESS_TYPE_NAME SYSRES_CONST_APP_VIEWER_TYPE_REQUISITE_CODE SYSRES_CONST_APPROVING_SIGNATURE_NAME SYSRES_CONST_APPROVING_SIGNATURE_REQUISITE_CODE SYSRES_CONST_ASSISTANT_SUBSTITUE_TYPE SYSRES_CONST_ASSISTANT_SUBSTITUE_TYPE_CODE SYSRES_CONST_ATTACH_TYPE_COMPONENT_TOKEN SYSRES_CONST_ATTACH_TYPE_DOC SYSRES_CONST_ATTACH_TYPE_EDOC SYSRES_CONST_ATTACH_TYPE_FOLDER SYSRES_CONST_ATTACH_TYPE_JOB SYSRES_CONST_ATTACH_TYPE_REFERENCE SYSRES_CONST_ATTACH_TYPE_TASK SYSRES_CONST_AUTH_ENCODED_PASSWORD SYSRES_CONST_AUTH_ENCODED_PASSWORD_CODE SYSRES_CONST_AUTH_NOVELL SYSRES_CONST_AUTH_PASSWORD SYSRES_CONST_AUTH_PASSWORD_CODE SYSRES_CONST_AUTH_WINDOWS SYSRES_CONST_AUTHENTICATING_SIGNATURE_NAME SYSRES_CONST_AUTHENTICATING_SIGNATURE_REQUISITE_CODE SYSRES_CONST_AUTO_ENUM_METHOD_FLAG SYSRES_CONST_AUTO_NUMERATION_CODE SYSRES_CONST_AUTO_STRONG_ENUM_METHOD_FLAG SYSRES_CONST_AUTOTEXT_NAME_REQUISITE_CODE SYSRES_CONST_AUTOTEXT_TEXT_REQUISITE_CODE SYSRES_CONST_AUTOTEXT_USAGE_ALL SYSRES_CONST_AUTOTEXT_USAGE_ALL_CODE SYSRES_CONST_AUTOTEXT_USAGE_SIGN SYSRES_CONST_AUTOTEXT_USAGE_SIGN_CODE SYSRES_CONST_AUTOTEXT_USAGE_WORK SYSRES_CONST_AUTOTEXT_USAGE_WORK_CODE SYSRES_CONST_AUTOTEXT_USE_ANYWHERE_CODE SYSRES_CONST_AUTOTEXT_USE_ON_SIGNING_CODE SYSRES_CONST_AUTOTEXT_USE_ON_WORK_CODE SYSRES_CONST_BEGIN_DATE_REQUISITE_CODE SYSRES_CONST_BLACK_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_BLUE_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_BTN_PART SYSRES_CONST_CALCULATED_ROLE_TYPE_CODE SYSRES_CONST_CALL_TYPE_VARIABLE_BUTTON_VALUE SYSRES_CONST_CALL_TYPE_VARIABLE_PROGRAM_VALUE SYSRES_CONST_CANCEL_MESSAGE_FUNCTION_RESULT SYSRES_CONST_CARD_PART SYSRES_CONST_CARD_REFERENCE_MODE_NAME SYSRES_CONST_CERTIFICATE_TYPE_REQUISITE_ENCRYPT_VALUE SYSRES_CONST_CERTIFICATE_TYPE_REQUISITE_SIGN_AND_ENCRYPT_VALUE SYSRES_CONST_CERTIFICATE_TYPE_REQUISITE_SIGN_VALUE SYSRES_CONST_CHECK_PARAM_VALUE_DATE_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_FLOAT_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_INTEGER_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_PICK_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_REEFRENCE_PARAM_TYPE SYSRES_CONST_CLOSED_RECORD_FLAG_VALUE_FEMININE SYSRES_CONST_CLOSED_RECORD_FLAG_VALUE_MASCULINE SYSRES_CONST_CODE_COMPONENT_TYPE_ADMIN SYSRES_CONST_CODE_COMPONENT_TYPE_DEVELOPER SYSRES_CONST_CODE_COMPONENT_TYPE_DOCS SYSRES_CONST_CODE_COMPONENT_TYPE_EDOC_CARDS SYSRES_CONST_CODE_COMPONENT_TYPE_EXTERNAL_EXECUTABLE SYSRES_CONST_CODE_COMPONENT_TYPE_OTHER SYSRES_CONST_CODE_COMPONENT_TYPE_REFERENCE SYSRES_CONST_CODE_COMPONENT_TYPE_REPORT SYSRES_CONST_CODE_COMPONENT_TYPE_SCRIPT SYSRES_CONST_CODE_COMPONENT_TYPE_URL SYSRES_CONST_CODE_REQUISITE_ACCESS SYSRES_CONST_CODE_REQUISITE_CODE SYSRES_CONST_CODE_REQUISITE_COMPONENT SYSRES_CONST_CODE_REQUISITE_DESCRIPTION SYSRES_CONST_CODE_REQUISITE_EXCLUDE_COMPONENT SYSRES_CONST_CODE_REQUISITE_RECORD SYSRES_CONST_COMMENT_REQ_CODE SYSRES_CONST_COMMON_SETTINGS_REQUISITE_CODE SYSRES_CONST_COMP_CODE_GRD SYSRES_CONST_COMPONENT_GROUP_TYPE_REQUISITE_CODE SYSRES_CONST_COMPONENT_TYPE_ADMIN_COMPONENTS SYSRES_CONST_COMPONENT_TYPE_DEVELOPER_COMPONENTS SYSRES_CONST_COMPONENT_TYPE_DOCS SYSRES_CONST_COMPONENT_TYPE_EDOC_CARDS SYSRES_CONST_COMPONENT_TYPE_EDOCS SYSRES_CONST_COMPONENT_TYPE_EXTERNAL_EXECUTABLE SYSRES_CONST_COMPONENT_TYPE_OTHER SYSRES_CONST_COMPONENT_TYPE_REFERENCE_TYPES SYSRES_CONST_COMPONENT_TYPE_REFERENCES SYSRES_CONST_COMPONENT_TYPE_REPORTS SYSRES_CONST_COMPONENT_TYPE_SCRIPTS SYSRES_CONST_COMPONENT_TYPE_URL SYSRES_CONST_COMPONENTS_REMOTE_SERVERS_VIEW_CODE SYSRES_CONST_CONDITION_BLOCK_DESCRIPTION SYSRES_CONST_CONST_FIRM_STATUS_COMMON SYSRES_CONST_CONST_FIRM_STATUS_INDIVIDUAL SYSRES_CONST_CONST_NEGATIVE_VALUE SYSRES_CONST_CONST_POSITIVE_VALUE SYSRES_CONST_CONST_SERVER_STATUS_DONT_REPLICATE SYSRES_CONST_CONST_SERVER_STATUS_REPLICATE SYSRES_CONST_CONTENTS_REQUISITE_CODE SYSRES_CONST_DATA_TYPE_BOOLEAN SYSRES_CONST_DATA_TYPE_DATE SYSRES_CONST_DATA_TYPE_FLOAT SYSRES_CONST_DATA_TYPE_INTEGER SYSRES_CONST_DATA_TYPE_PICK SYSRES_CONST_DATA_TYPE_REFERENCE SYSRES_CONST_DATA_TYPE_STRING SYSRES_CONST_DATA_TYPE_TEXT SYSRES_CONST_DATA_TYPE_VARIANT SYSRES_CONST_DATE_CLOSE_REQ_CODE SYSRES_CONST_DATE_FORMAT_DATE_ONLY_CHAR SYSRES_CONST_DATE_OPEN_REQ_CODE SYSRES_CONST_DATE_REQUISITE SYSRES_CONST_DATE_REQUISITE_CODE SYSRES_CONST_DATE_REQUISITE_NAME SYSRES_CONST_DATE_REQUISITE_TYPE SYSRES_CONST_DATE_TYPE_CHAR SYSRES_CONST_DATETIME_FORMAT_VALUE SYSRES_CONST_DEA_ACCESS_RIGHTS_ACTION_CODE SYSRES_CONST_DESCRIPTION_LOCALIZE_ID_REQUISITE_CODE SYSRES_CONST_DESCRIPTION_REQUISITE_CODE SYSRES_CONST_DET1_PART SYSRES_CONST_DET2_PART SYSRES_CONST_DET3_PART SYSRES_CONST_DET4_PART SYSRES_CONST_DET5_PART SYSRES_CONST_DET6_PART SYSRES_CONST_DETAIL_DATASET_KEY_REQUISITE_CODE SYSRES_CONST_DETAIL_PICK_REQUISITE_CODE SYSRES_CONST_DETAIL_REQ_CODE SYSRES_CONST_DO_NOT_USE_ACCESS_TYPE_CODE SYSRES_CONST_DO_NOT_USE_ACCESS_TYPE_NAME SYSRES_CONST_DO_NOT_USE_ON_VIEW_ACCESS_TYPE_CODE SYSRES_CONST_DO_NOT_USE_ON_VIEW_ACCESS_TYPE_NAME SYSRES_CONST_DOCUMENT_STORAGES_CODE SYSRES_CONST_DOCUMENT_TEMPLATES_TYPE_NAME SYSRES_CONST_DOUBLE_REQUISITE_CODE SYSRES_CONST_EDITOR_CLOSE_FILE_OBSERV_TYPE_CODE SYSRES_CONST_EDITOR_CLOSE_PROCESS_OBSERV_TYPE_CODE SYSRES_CONST_EDITOR_TYPE_REQUISITE_CODE SYSRES_CONST_EDITORS_APPLICATION_NAME_REQUISITE_CODE SYSRES_CONST_EDITORS_CREATE_SEVERAL_PROCESSES_REQUISITE_CODE SYSRES_CONST_EDITORS_EXTENSION_REQUISITE_CODE SYSRES_CONST_EDITORS_OBSERVER_BY_PROCESS_TYPE SYSRES_CONST_EDITORS_REFERENCE_CODE SYSRES_CONST_EDITORS_REPLACE_SPEC_CHARS_REQUISITE_CODE SYSRES_CONST_EDITORS_USE_PLUGINS_REQUISITE_CODE SYSRES_CONST_EDITORS_VIEW_DOCUMENT_OPENED_TO_EDIT_CODE SYSRES_CONST_EDOC_CARD_TYPE_REQUISITE_CODE SYSRES_CONST_EDOC_CARD_TYPES_LINK_REQUISITE_CODE SYSRES_CONST_EDOC_CERTIFICATE_AND_PASSWORD_ENCODE_CODE SYSRES_CONST_EDOC_CERTIFICATE_ENCODE_CODE SYSRES_CONST_EDOC_DATE_REQUISITE_CODE SYSRES_CONST_EDOC_KIND_REFERENCE_CODE SYSRES_CONST_EDOC_KINDS_BY_TEMPLATE_ACTION_CODE SYSRES_CONST_EDOC_MANAGE_ACCESS_CODE SYSRES_CONST_EDOC_NONE_ENCODE_CODE SYSRES_CONST_EDOC_NUMBER_REQUISITE_CODE SYSRES_CONST_EDOC_PASSWORD_ENCODE_CODE SYSRES_CONST_EDOC_READONLY_ACCESS_CODE SYSRES_CONST_EDOC_SHELL_LIFE_TYPE_VIEW_VALUE SYSRES_CONST_EDOC_SIZE_RESTRICTION_PRIORITY_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_CHECK_ACCESS_RIGHTS_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_COMPUTER_NAME_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_DATABASE_NAME_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_EDIT_IN_STORAGE_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_LOCAL_PATH_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_SHARED_SOURCE_NAME_REQUISITE_CODE SYSRES_CONST_EDOC_TEMPLATE_REQUISITE_CODE SYSRES_CONST_EDOC_TYPES_REFERENCE_CODE SYSRES_CONST_EDOC_VERSION_ACTIVE_STAGE_CODE SYSRES_CONST_EDOC_VERSION_DESIGN_STAGE_CODE SYSRES_CONST_EDOC_VERSION_OBSOLETE_STAGE_CODE SYSRES_CONST_EDOC_WRITE_ACCES_CODE SYSRES_CONST_EDOCUMENT_CARD_REQUISITES_REFERENCE_CODE_SELECTED_REQUISITE SYSRES_CONST_ENCODE_CERTIFICATE_TYPE_CODE SYSRES_CONST_END_DATE_REQUISITE_CODE SYSRES_CONST_ENUMERATION_TYPE_REQUISITE_CODE SYSRES_CONST_EXECUTE_ACCESS_RIGHTS_TYPE_CODE SYSRES_CONST_EXECUTIVE_FILE_STORAGE_TYPE SYSRES_CONST_EXIST_CONST SYSRES_CONST_EXIST_VALUE SYSRES_CONST_EXPORT_LOCK_TYPE_ASK SYSRES_CONST_EXPORT_LOCK_TYPE_WITH_LOCK SYSRES_CONST_EXPORT_LOCK_TYPE_WITHOUT_LOCK SYSRES_CONST_EXPORT_VERSION_TYPE_ASK SYSRES_CONST_EXPORT_VERSION_TYPE_LAST SYSRES_CONST_EXPORT_VERSION_TYPE_LAST_ACTIVE SYSRES_CONST_EXTENSION_REQUISITE_CODE SYSRES_CONST_FILTER_NAME_REQUISITE_CODE SYSRES_CONST_FILTER_REQUISITE_CODE SYSRES_CONST_FILTER_TYPE_COMMON_CODE SYSRES_CONST_FILTER_TYPE_COMMON_NAME SYSRES_CONST_FILTER_TYPE_USER_CODE SYSRES_CONST_FILTER_TYPE_USER_NAME SYSRES_CONST_FILTER_VALUE_REQUISITE_NAME SYSRES_CONST_FLOAT_NUMBER_FORMAT_CHAR SYSRES_CONST_FLOAT_REQUISITE_TYPE SYSRES_CONST_FOLDER_AUTHOR_VALUE SYSRES_CONST_FOLDER_KIND_ANY_OBJECTS SYSRES_CONST_FOLDER_KIND_COMPONENTS SYSRES_CONST_FOLDER_KIND_EDOCS SYSRES_CONST_FOLDER_KIND_JOBS SYSRES_CONST_FOLDER_KIND_TASKS SYSRES_CONST_FOLDER_TYPE_COMMON SYSRES_CONST_FOLDER_TYPE_COMPONENT SYSRES_CONST_FOLDER_TYPE_FAVORITES SYSRES_CONST_FOLDER_TYPE_INBOX SYSRES_CONST_FOLDER_TYPE_OUTBOX SYSRES_CONST_FOLDER_TYPE_QUICK_LAUNCH SYSRES_CONST_FOLDER_TYPE_SEARCH SYSRES_CONST_FOLDER_TYPE_SHORTCUTS SYSRES_CONST_FOLDER_TYPE_USER SYSRES_CONST_FROM_DICTIONARY_ENUM_METHOD_FLAG SYSRES_CONST_FULL_SUBSTITUTE_TYPE SYSRES_CONST_FULL_SUBSTITUTE_TYPE_CODE SYSRES_CONST_FUNCTION_CANCEL_RESULT SYSRES_CONST_FUNCTION_CATEGORY_SYSTEM SYSRES_CONST_FUNCTION_CATEGORY_USER SYSRES_CONST_FUNCTION_FAILURE_RESULT SYSRES_CONST_FUNCTION_SAVE_RESULT SYSRES_CONST_GENERATED_REQUISITE SYSRES_CONST_GREEN_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_GROUP_ACCOUNT_TYPE_VALUE_CODE SYSRES_CONST_GROUP_CATEGORY_NORMAL_CODE SYSRES_CONST_GROUP_CATEGORY_NORMAL_NAME SYSRES_CONST_GROUP_CATEGORY_SERVICE_CODE SYSRES_CONST_GROUP_CATEGORY_SERVICE_NAME SYSRES_CONST_GROUP_COMMON_CATEGORY_FIELD_VALUE SYSRES_CONST_GROUP_FULL_NAME_REQUISITE_CODE SYSRES_CONST_GROUP_NAME_REQUISITE_CODE SYSRES_CONST_GROUP_RIGHTS_T_REQUISITE_CODE SYSRES_CONST_GROUP_SERVER_CODES_REQUISITE_CODE SYSRES_CONST_GROUP_SERVER_NAME_REQUISITE_CODE SYSRES_CONST_GROUP_SERVICE_CATEGORY_FIELD_VALUE SYSRES_CONST_GROUP_USER_REQUISITE_CODE SYSRES_CONST_GROUPS_REFERENCE_CODE SYSRES_CONST_GROUPS_REQUISITE_CODE SYSRES_CONST_HIDDEN_MODE_NAME SYSRES_CONST_HIGH_LVL_REQUISITE_CODE SYSRES_CONST_HISTORY_ACTION_CREATE_CODE SYSRES_CONST_HISTORY_ACTION_DELETE_CODE SYSRES_CONST_HISTORY_ACTION_EDIT_CODE SYSRES_CONST_HOUR_CHAR SYSRES_CONST_ID_REQUISITE_CODE SYSRES_CONST_IDSPS_REQUISITE_CODE SYSRES_CONST_IMAGE_MODE_COLOR SYSRES_CONST_IMAGE_MODE_GREYSCALE SYSRES_CONST_IMAGE_MODE_MONOCHROME SYSRES_CONST_IMPORTANCE_HIGH SYSRES_CONST_IMPORTANCE_LOW SYSRES_CONST_IMPORTANCE_NORMAL SYSRES_CONST_IN_DESIGN_VERSION_STATE_PICK_VALUE SYSRES_CONST_INCOMING_WORK_RULE_TYPE_CODE SYSRES_CONST_INT_REQUISITE SYSRES_CONST_INT_REQUISITE_TYPE SYSRES_CONST_INTEGER_NUMBER_FORMAT_CHAR SYSRES_CONST_INTEGER_TYPE_CHAR SYSRES_CONST_IS_GENERATED_REQUISITE_NEGATIVE_VALUE SYSRES_CONST_IS_PUBLIC_ROLE_REQUISITE_CODE SYSRES_CONST_IS_REMOTE_USER_NEGATIVE_VALUE SYSRES_CONST_IS_REMOTE_USER_POSITIVE_VALUE SYSRES_CONST_IS_STORED_REQUISITE_NEGATIVE_VALUE SYSRES_CONST_IS_STORED_REQUISITE_STORED_VALUE SYSRES_CONST_ITALIC_LIFE_CYCLE_STAGE_DRAW_STYLE SYSRES_CONST_JOB_BLOCK_DESCRIPTION SYSRES_CONST_JOB_KIND_CONTROL_JOB SYSRES_CONST_JOB_KIND_JOB SYSRES_CONST_JOB_KIND_NOTICE SYSRES_CONST_JOB_STATE_ABORTED SYSRES_CONST_JOB_STATE_COMPLETE SYSRES_CONST_JOB_STATE_WORKING SYSRES_CONST_KIND_REQUISITE_CODE SYSRES_CONST_KIND_REQUISITE_NAME SYSRES_CONST_KINDS_CREATE_SHADOW_COPIES_REQUISITE_CODE SYSRES_CONST_KINDS_DEFAULT_EDOC_LIFE_STAGE_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_ALL_TEPLATES_ALLOWED_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_ALLOW_LIFE_CYCLE_STAGE_CHANGING_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_ALLOW_MULTIPLE_ACTIVE_VERSIONS_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_SHARE_ACCES_RIGHTS_BY_DEFAULT_CODE SYSRES_CONST_KINDS_EDOC_TEMPLATE_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_TYPE_REQUISITE_CODE SYSRES_CONST_KINDS_SIGNERS_REQUISITES_CODE SYSRES_CONST_KOD_INPUT_TYPE SYSRES_CONST_LAST_UPDATE_DATE_REQUISITE_CODE SYSRES_CONST_LIFE_CYCLE_START_STAGE_REQUISITE_CODE SYSRES_CONST_LILAC_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_LINK_OBJECT_KIND_COMPONENT SYSRES_CONST_LINK_OBJECT_KIND_DOCUMENT SYSRES_CONST_LINK_OBJECT_KIND_EDOC SYSRES_CONST_LINK_OBJECT_KIND_FOLDER SYSRES_CONST_LINK_OBJECT_KIND_JOB SYSRES_CONST_LINK_OBJECT_KIND_REFERENCE SYSRES_CONST_LINK_OBJECT_KIND_TASK SYSRES_CONST_LINK_REF_TYPE_REQUISITE_CODE SYSRES_CONST_LIST_REFERENCE_MODE_NAME SYSRES_CONST_LOCALIZATION_DICTIONARY_MAIN_VIEW_CODE SYSRES_CONST_MAIN_VIEW_CODE SYSRES_CONST_MANUAL_ENUM_METHOD_FLAG SYSRES_CONST_MASTER_COMP_TYPE_REQUISITE_CODE SYSRES_CONST_MASTER_TABLE_REC_ID_REQUISITE_CODE SYSRES_CONST_MAXIMIZED_MODE_NAME SYSRES_CONST_ME_VALUE SYSRES_CONST_MESSAGE_ATTENTION_CAPTION SYSRES_CONST_MESSAGE_CONFIRMATION_CAPTION SYSRES_CONST_MESSAGE_ERROR_CAPTION SYSRES_CONST_MESSAGE_INFORMATION_CAPTION SYSRES_CONST_MINIMIZED_MODE_NAME SYSRES_CONST_MINUTE_CHAR SYSRES_CONST_MODULE_REQUISITE_CODE SYSRES_CONST_MONITORING_BLOCK_DESCRIPTION SYSRES_CONST_MONTH_FORMAT_VALUE SYSRES_CONST_NAME_LOCALIZE_ID_REQUISITE_CODE SYSRES_CONST_NAME_REQUISITE_CODE SYSRES_CONST_NAME_SINGULAR_REQUISITE_CODE SYSRES_CONST_NAMEAN_INPUT_TYPE SYSRES_CONST_NEGATIVE_PICK_VALUE SYSRES_CONST_NEGATIVE_VALUE SYSRES_CONST_NO SYSRES_CONST_NO_PICK_VALUE SYSRES_CONST_NO_SIGNATURE_REQUISITE_CODE SYSRES_CONST_NO_VALUE SYSRES_CONST_NONE_ACCESS_RIGHTS_TYPE_CODE SYSRES_CONST_NONOPERATING_RECORD_FLAG_VALUE SYSRES_CONST_NONOPERATING_RECORD_FLAG_VALUE_MASCULINE SYSRES_CONST_NORMAL_ACCESS_RIGHTS_TYPE_CODE SYSRES_CONST_NORMAL_LIFE_CYCLE_STAGE_DRAW_STYLE SYSRES_CONST_NORMAL_MODE_NAME SYSRES_CONST_NOT_ALLOWED_ACCESS_TYPE_CODE SYSRES_CONST_NOT_ALLOWED_ACCESS_TYPE_NAME SYSRES_CONST_NOTE_REQUISITE_CODE SYSRES_CONST_NOTICE_BLOCK_DESCRIPTION SYSRES_CONST_NUM_REQUISITE SYSRES_CONST_NUM_STR_REQUISITE_CODE SYSRES_CONST_NUMERATION_AUTO_NOT_STRONG SYSRES_CONST_NUMERATION_AUTO_STRONG SYSRES_CONST_NUMERATION_FROM_DICTONARY SYSRES_CONST_NUMERATION_MANUAL SYSRES_CONST_NUMERIC_TYPE_CHAR SYSRES_CONST_NUMREQ_REQUISITE_CODE SYSRES_CONST_OBSOLETE_VERSION_STATE_PICK_VALUE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE_CODE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE_FEMININE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE_MASCULINE SYSRES_CONST_OPTIONAL_FORM_COMP_REQCODE_PREFIX SYSRES_CONST_ORANGE_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_ORIGINALREF_REQUISITE_CODE SYSRES_CONST_OURFIRM_REF_CODE SYSRES_CONST_OURFIRM_REQUISITE_CODE SYSRES_CONST_OURFIRM_VAR SYSRES_CONST_OUTGOING_WORK_RULE_TYPE_CODE SYSRES_CONST_PICK_NEGATIVE_RESULT SYSRES_CONST_PICK_POSITIVE_RESULT SYSRES_CONST_PICK_REQUISITE SYSRES_CONST_PICK_REQUISITE_TYPE SYSRES_CONST_PICK_TYPE_CHAR SYSRES_CONST_PLAN_STATUS_REQUISITE_CODE SYSRES_CONST_PLATFORM_VERSION_COMMENT SYSRES_CONST_PLUGINS_SETTINGS_DESCRIPTION_REQUISITE_CODE SYSRES_CONST_POSITIVE_PICK_VALUE SYSRES_CONST_POWER_TO_CREATE_ACTION_CODE SYSRES_CONST_POWER_TO_SIGN_ACTION_CODE SYSRES_CONST_PRIORITY_REQUISITE_CODE SYSRES_CONST_QUALIFIED_TASK_TYPE SYSRES_CONST_QUALIFIED_TASK_TYPE_CODE SYSRES_CONST_RECSTAT_REQUISITE_CODE SYSRES_CONST_RED_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_REF_ID_T_REF_TYPE_REQUISITE_CODE SYSRES_CONST_REF_REQUISITE SYSRES_CONST_REF_REQUISITE_TYPE SYSRES_CONST_REF_REQUISITES_REFERENCE_CODE_SELECTED_REQUISITE SYSRES_CONST_REFERENCE_RECORD_HISTORY_CREATE_ACTION_CODE SYSRES_CONST_REFERENCE_RECORD_HISTORY_DELETE_ACTION_CODE SYSRES_CONST_REFERENCE_RECORD_HISTORY_MODIFY_ACTION_CODE SYSRES_CONST_REFERENCE_TYPE_CHAR SYSRES_CONST_REFERENCE_TYPE_REQUISITE_NAME SYSRES_CONST_REFERENCES_ADD_PARAMS_REQUISITE_CODE SYSRES_CONST_REFERENCES_DISPLAY_REQUISITE_REQUISITE_CODE SYSRES_CONST_REMOTE_SERVER_STATUS_WORKING SYSRES_CONST_REMOTE_SERVER_TYPE_MAIN SYSRES_CONST_REMOTE_SERVER_TYPE_SECONDARY SYSRES_CONST_REMOTE_USER_FLAG_VALUE_CODE SYSRES_CONST_REPORT_APP_EDITOR_INTERNAL SYSRES_CONST_REPORT_BASE_REPORT_ID_REQUISITE_CODE SYSRES_CONST_REPORT_BASE_REPORT_REQUISITE_CODE SYSRES_CONST_REPORT_SCRIPT_REQUISITE_CODE SYSRES_CONST_REPORT_TEMPLATE_REQUISITE_CODE SYSRES_CONST_REPORT_VIEWER_CODE_REQUISITE_CODE SYSRES_CONST_REQ_ALLOW_COMPONENT_DEFAULT_VALUE SYSRES_CONST_REQ_ALLOW_RECORD_DEFAULT_VALUE SYSRES_CONST_REQ_ALLOW_SERVER_COMPONENT_DEFAULT_VALUE SYSRES_CONST_REQ_MODE_AVAILABLE_CODE SYSRES_CONST_REQ_MODE_EDIT_CODE SYSRES_CONST_REQ_MODE_HIDDEN_CODE SYSRES_CONST_REQ_MODE_NOT_AVAILABLE_CODE SYSRES_CONST_REQ_MODE_VIEW_CODE SYSRES_CONST_REQ_NUMBER_REQUISITE_CODE SYSRES_CONST_REQ_SECTION_VALUE SYSRES_CONST_REQ_TYPE_VALUE SYSRES_CONST_REQUISITE_FORMAT_BY_UNIT SYSRES_CONST_REQUISITE_FORMAT_DATE_FULL SYSRES_CONST_REQUISITE_FORMAT_DATE_TIME SYSRES_CONST_REQUISITE_FORMAT_LEFT SYSRES_CONST_REQUISITE_FORMAT_RIGHT SYSRES_CONST_REQUISITE_FORMAT_WITHOUT_UNIT SYSRES_CONST_REQUISITE_NUMBER_REQUISITE_CODE SYSRES_CONST_REQUISITE_SECTION_ACTIONS SYSRES_CONST_REQUISITE_SECTION_BUTTON SYSRES_CONST_REQUISITE_SECTION_BUTTONS SYSRES_CONST_REQUISITE_SECTION_CARD SYSRES_CONST_REQUISITE_SECTION_TABLE SYSRES_CONST_REQUISITE_SECTION_TABLE10 SYSRES_CONST_REQUISITE_SECTION_TABLE11 SYSRES_CONST_REQUISITE_SECTION_TABLE12 SYSRES_CONST_REQUISITE_SECTION_TABLE13 SYSRES_CONST_REQUISITE_SECTION_TABLE14 SYSRES_CONST_REQUISITE_SECTION_TABLE15 SYSRES_CONST_REQUISITE_SECTION_TABLE16 SYSRES_CONST_REQUISITE_SECTION_TABLE17 SYSRES_CONST_REQUISITE_SECTION_TABLE18 SYSRES_CONST_REQUISITE_SECTION_TABLE19 SYSRES_CONST_REQUISITE_SECTION_TABLE2 SYSRES_CONST_REQUISITE_SECTION_TABLE20 SYSRES_CONST_REQUISITE_SECTION_TABLE21 SYSRES_CONST_REQUISITE_SECTION_TABLE22 SYSRES_CONST_REQUISITE_SECTION_TABLE23 SYSRES_CONST_REQUISITE_SECTION_TABLE24 SYSRES_CONST_REQUISITE_SECTION_TABLE3 SYSRES_CONST_REQUISITE_SECTION_TABLE4 SYSRES_CONST_REQUISITE_SECTION_TABLE5 SYSRES_CONST_REQUISITE_SECTION_TABLE6 SYSRES_CONST_REQUISITE_SECTION_TABLE7 SYSRES_CONST_REQUISITE_SECTION_TABLE8 SYSRES_CONST_REQUISITE_SECTION_TABLE9 SYSRES_CONST_REQUISITES_PSEUDOREFERENCE_REQUISITE_NUMBER_REQUISITE_CODE SYSRES_CONST_RIGHT_ALIGNMENT_CODE SYSRES_CONST_ROLES_REFERENCE_CODE SYSRES_CONST_ROUTE_STEP_AFTER_RUS SYSRES_CONST_ROUTE_STEP_AND_CONDITION_RUS SYSRES_CONST_ROUTE_STEP_OR_CONDITION_RUS SYSRES_CONST_ROUTE_TYPE_COMPLEX SYSRES_CONST_ROUTE_TYPE_PARALLEL SYSRES_CONST_ROUTE_TYPE_SERIAL SYSRES_CONST_SBDATASETDESC_NEGATIVE_VALUE SYSRES_CONST_SBDATASETDESC_POSITIVE_VALUE SYSRES_CONST_SBVIEWSDESC_POSITIVE_VALUE SYSRES_CONST_SCRIPT_BLOCK_DESCRIPTION SYSRES_CONST_SEARCH_BY_TEXT_REQUISITE_CODE SYSRES_CONST_SEARCHES_COMPONENT_CONTENT SYSRES_CONST_SEARCHES_CRITERIA_ACTION_NAME SYSRES_CONST_SEARCHES_EDOC_CONTENT SYSRES_CONST_SEARCHES_FOLDER_CONTENT SYSRES_CONST_SEARCHES_JOB_CONTENT SYSRES_CONST_SEARCHES_REFERENCE_CODE SYSRES_CONST_SEARCHES_TASK_CONTENT SYSRES_CONST_SECOND_CHAR SYSRES_CONST_SECTION_REQUISITE_ACTIONS_VALUE SYSRES_CONST_SECTION_REQUISITE_CARD_VALUE SYSRES_CONST_SECTION_REQUISITE_CODE SYSRES_CONST_SECTION_REQUISITE_DETAIL_1_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_2_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_3_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_4_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_5_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_6_VALUE SYSRES_CONST_SELECT_REFERENCE_MODE_NAME SYSRES_CONST_SELECT_TYPE_SELECTABLE SYSRES_CONST_SELECT_TYPE_SELECTABLE_ONLY_CHILD SYSRES_CONST_SELECT_TYPE_SELECTABLE_WITH_CHILD SYSRES_CONST_SELECT_TYPE_UNSLECTABLE SYSRES_CONST_SERVER_TYPE_MAIN SYSRES_CONST_SERVICE_USER_CATEGORY_FIELD_VALUE SYSRES_CONST_SETTINGS_USER_REQUISITE_CODE SYSRES_CONST_SIGNATURE_AND_ENCODE_CERTIFICATE_TYPE_CODE SYSRES_CONST_SIGNATURE_CERTIFICATE_TYPE_CODE SYSRES_CONST_SINGULAR_TITLE_REQUISITE_CODE SYSRES_CONST_SQL_SERVER_AUTHENTIFICATION_FLAG_VALUE_CODE SYSRES_CONST_SQL_SERVER_ENCODE_AUTHENTIFICATION_FLAG_VALUE_CODE SYSRES_CONST_STANDART_ROUTE_REFERENCE_CODE SYSRES_CONST_STANDART_ROUTE_REFERENCE_COMMENT_REQUISITE_CODE SYSRES_CONST_STANDART_ROUTES_GROUPS_REFERENCE_CODE SYSRES_CONST_STATE_REQ_NAME SYSRES_CONST_STATE_REQUISITE_ACTIVE_VALUE SYSRES_CONST_STATE_REQUISITE_CLOSED_VALUE SYSRES_CONST_STATE_REQUISITE_CODE SYSRES_CONST_STATIC_ROLE_TYPE_CODE SYSRES_CONST_STATUS_PLAN_DEFAULT_VALUE SYSRES_CONST_STATUS_VALUE_AUTOCLEANING SYSRES_CONST_STATUS_VALUE_BLUE_SQUARE SYSRES_CONST_STATUS_VALUE_COMPLETE SYSRES_CONST_STATUS_VALUE_GREEN_SQUARE SYSRES_CONST_STATUS_VALUE_ORANGE_SQUARE SYSRES_CONST_STATUS_VALUE_PURPLE_SQUARE SYSRES_CONST_STATUS_VALUE_RED_SQUARE SYSRES_CONST_STATUS_VALUE_SUSPEND SYSRES_CONST_STATUS_VALUE_YELLOW_SQUARE SYSRES_CONST_STDROUTE_SHOW_TO_USERS_REQUISITE_CODE SYSRES_CONST_STORAGE_TYPE_FILE SYSRES_CONST_STORAGE_TYPE_SQL_SERVER SYSRES_CONST_STR_REQUISITE SYSRES_CONST_STRIKEOUT_LIFE_CYCLE_STAGE_DRAW_STYLE SYSRES_CONST_STRING_FORMAT_LEFT_ALIGN_CHAR SYSRES_CONST_STRING_FORMAT_RIGHT_ALIGN_CHAR SYSRES_CONST_STRING_REQUISITE_CODE SYSRES_CONST_STRING_REQUISITE_TYPE SYSRES_CONST_STRING_TYPE_CHAR SYSRES_CONST_SUBSTITUTES_PSEUDOREFERENCE_CODE SYSRES_CONST_SUBTASK_BLOCK_DESCRIPTION SYSRES_CONST_SYSTEM_SETTING_CURRENT_USER_PARAM_VALUE SYSRES_CONST_SYSTEM_SETTING_EMPTY_VALUE_PARAM_VALUE SYSRES_CONST_SYSTEM_VERSION_COMMENT SYSRES_CONST_TASK_ACCESS_TYPE_ALL SYSRES_CONST_TASK_ACCESS_TYPE_ALL_MEMBERS SYSRES_CONST_TASK_ACCESS_TYPE_MANUAL SYSRES_CONST_TASK_ENCODE_TYPE_CERTIFICATION SYSRES_CONST_TASK_ENCODE_TYPE_CERTIFICATION_AND_PASSWORD SYSRES_CONST_TASK_ENCODE_TYPE_NONE SYSRES_CONST_TASK_ENCODE_TYPE_PASSWORD SYSRES_CONST_TASK_ROUTE_ALL_CONDITION SYSRES_CONST_TASK_ROUTE_AND_CONDITION SYSRES_CONST_TASK_ROUTE_OR_CONDITION SYSRES_CONST_TASK_STATE_ABORTED SYSRES_CONST_TASK_STATE_COMPLETE SYSRES_CONST_TASK_STATE_CONTINUED SYSRES_CONST_TASK_STATE_CONTROL SYSRES_CONST_TASK_STATE_INIT SYSRES_CONST_TASK_STATE_WORKING SYSRES_CONST_TASK_TITLE SYSRES_CONST_TASK_TYPES_GROUPS_REFERENCE_CODE SYSRES_CONST_TASK_TYPES_REFERENCE_CODE SYSRES_CONST_TEMPLATES_REFERENCE_CODE SYSRES_CONST_TEST_DATE_REQUISITE_NAME SYSRES_CONST_TEST_DEV_DATABASE_NAME SYSRES_CONST_TEST_DEV_SYSTEM_CODE SYSRES_CONST_TEST_EDMS_DATABASE_NAME SYSRES_CONST_TEST_EDMS_MAIN_CODE SYSRES_CONST_TEST_EDMS_MAIN_DB_NAME SYSRES_CONST_TEST_EDMS_SECOND_CODE SYSRES_CONST_TEST_EDMS_SECOND_DB_NAME SYSRES_CONST_TEST_EDMS_SYSTEM_CODE SYSRES_CONST_TEST_NUMERIC_REQUISITE_NAME SYSRES_CONST_TEXT_REQUISITE SYSRES_CONST_TEXT_REQUISITE_CODE SYSRES_CONST_TEXT_REQUISITE_TYPE SYSRES_CONST_TEXT_TYPE_CHAR SYSRES_CONST_TYPE_CODE_REQUISITE_CODE SYSRES_CONST_TYPE_REQUISITE_CODE SYSRES_CONST_UNDEFINED_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_UNITS_SECTION_ID_REQUISITE_CODE SYSRES_CONST_UNITS_SECTION_REQUISITE_CODE SYSRES_CONST_UNOPERATING_RECORD_FLAG_VALUE_CODE SYSRES_CONST_UNSTORED_DATA_REQUISITE_CODE SYSRES_CONST_UNSTORED_DATA_REQUISITE_NAME SYSRES_CONST_USE_ACCESS_TYPE_CODE SYSRES_CONST_USE_ACCESS_TYPE_NAME SYSRES_CONST_USER_ACCOUNT_TYPE_VALUE_CODE SYSRES_CONST_USER_ADDITIONAL_INFORMATION_REQUISITE_CODE SYSRES_CONST_USER_AND_GROUP_ID_FROM_PSEUDOREFERENCE_REQUISITE_CODE SYSRES_CONST_USER_CATEGORY_NORMAL SYSRES_CONST_USER_CERTIFICATE_REQUISITE_CODE SYSRES_CONST_USER_CERTIFICATE_STATE_REQUISITE_CODE SYSRES_CONST_USER_CERTIFICATE_SUBJECT_NAME_REQUISITE_CODE SYSRES_CONST_USER_CERTIFICATE_THUMBPRINT_REQUISITE_CODE SYSRES_CONST_USER_COMMON_CATEGORY SYSRES_CONST_USER_COMMON_CATEGORY_CODE SYSRES_CONST_USER_FULL_NAME_REQUISITE_CODE SYSRES_CONST_USER_GROUP_TYPE_REQUISITE_CODE SYSRES_CONST_USER_LOGIN_REQUISITE_CODE SYSRES_CONST_USER_REMOTE_CONTROLLER_REQUISITE_CODE SYSRES_CONST_USER_REMOTE_SYSTEM_REQUISITE_CODE SYSRES_CONST_USER_RIGHTS_T_REQUISITE_CODE SYSRES_CONST_USER_SERVER_NAME_REQUISITE_CODE SYSRES_CONST_USER_SERVICE_CATEGORY SYSRES_CONST_USER_SERVICE_CATEGORY_CODE SYSRES_CONST_USER_STATUS_ADMINISTRATOR_CODE SYSRES_CONST_USER_STATUS_ADMINISTRATOR_NAME SYSRES_CONST_USER_STATUS_DEVELOPER_CODE SYSRES_CONST_USER_STATUS_DEVELOPER_NAME SYSRES_CONST_USER_STATUS_DISABLED_CODE SYSRES_CONST_USER_STATUS_DISABLED_NAME SYSRES_CONST_USER_STATUS_SYSTEM_DEVELOPER_CODE SYSRES_CONST_USER_STATUS_USER_CODE SYSRES_CONST_USER_STATUS_USER_NAME SYSRES_CONST_USER_STATUS_USER_NAME_DEPRECATED SYSRES_CONST_USER_TYPE_FIELD_VALUE_USER SYSRES_CONST_USER_TYPE_REQUISITE_CODE SYSRES_CONST_USERS_CONTROLLER_REQUISITE_CODE SYSRES_CONST_USERS_IS_MAIN_SERVER_REQUISITE_CODE SYSRES_CONST_USERS_REFERENCE_CODE SYSRES_CONST_USERS_REGISTRATION_CERTIFICATES_ACTION_NAME SYSRES_CONST_USERS_REQUISITE_CODE SYSRES_CONST_USERS_SYSTEM_REQUISITE_CODE SYSRES_CONST_USERS_USER_ACCESS_RIGHTS_TYPR_REQUISITE_CODE SYSRES_CONST_USERS_USER_AUTHENTICATION_REQUISITE_CODE SYSRES_CONST_USERS_USER_COMPONENT_REQUISITE_CODE SYSRES_CONST_USERS_USER_GROUP_REQUISITE_CODE SYSRES_CONST_USERS_VIEW_CERTIFICATES_ACTION_NAME SYSRES_CONST_VIEW_DEFAULT_CODE SYSRES_CONST_VIEW_DEFAULT_NAME SYSRES_CONST_VIEWER_REQUISITE_CODE SYSRES_CONST_WAITING_BLOCK_DESCRIPTION SYSRES_CONST_WIZARD_FORM_LABEL_TEST_STRING SYSRES_CONST_WIZARD_QUERY_PARAM_HEIGHT_ETALON_STRING SYSRES_CONST_WIZARD_REFERENCE_COMMENT_REQUISITE_CODE SYSRES_CONST_WORK_RULES_DESCRIPTION_REQUISITE_CODE SYSRES_CONST_WORK_TIME_CALENDAR_REFERENCE_CODE SYSRES_CONST_WORK_WORKFLOW_HARD_ROUTE_TYPE_VALUE SYSRES_CONST_WORK_WORKFLOW_HARD_ROUTE_TYPE_VALUE_CODE SYSRES_CONST_WORK_WORKFLOW_HARD_ROUTE_TYPE_VALUE_CODE_RUS SYSRES_CONST_WORK_WORKFLOW_SOFT_ROUTE_TYPE_VALUE_CODE_RUS SYSRES_CONST_WORKFLOW_ROUTE_TYPR_HARD SYSRES_CONST_WORKFLOW_ROUTE_TYPR_SOFT SYSRES_CONST_XML_ENCODING SYSRES_CONST_XREC_STAT_REQUISITE_CODE SYSRES_CONST_XRECID_FIELD_NAME SYSRES_CONST_YES SYSRES_CONST_YES_NO_2_REQUISITE_CODE SYSRES_CONST_YES_NO_REQUISITE_CODE SYSRES_CONST_YES_NO_T_REF_TYPE_REQUISITE_CODE SYSRES_CONST_YES_PICK_VALUE SYSRES_CONST_YES_VALUE "+"CR FALSE nil NO_VALUE NULL TAB TRUE YES_VALUE "+"ADMINISTRATORS_GROUP_NAME CUSTOMIZERS_GROUP_NAME DEVELOPERS_GROUP_NAME SERVICE_USERS_GROUP_NAME "+"DECISION_BLOCK_FIRST_OPERAND_PROPERTY DECISION_BLOCK_NAME_PROPERTY DECISION_BLOCK_OPERATION_PROPERTY DECISION_BLOCK_RESULT_TYPE_PROPERTY DECISION_BLOCK_SECOND_OPERAND_PROPERTY "+"ANY_FILE_EXTENTION COMPRESSED_DOCUMENT_EXTENSION EXTENDED_DOCUMENT_EXTENSION SHORT_COMPRESSED_DOCUMENT_EXTENSION SHORT_EXTENDED_DOCUMENT_EXTENSION "+"JOB_BLOCK_ABORT_DEADLINE_PROPERTY JOB_BLOCK_AFTER_FINISH_EVENT JOB_BLOCK_AFTER_QUERY_PARAMETERS_EVENT JOB_BLOCK_ATTACHMENT_PROPERTY JOB_BLOCK_ATTACHMENTS_RIGHTS_GROUP_PROPERTY JOB_BLOCK_ATTACHMENTS_RIGHTS_TYPE_PROPERTY JOB_BLOCK_BEFORE_QUERY_PARAMETERS_EVENT JOB_BLOCK_BEFORE_START_EVENT JOB_BLOCK_CREATED_JOBS_PROPERTY JOB_BLOCK_DEADLINE_PROPERTY JOB_BLOCK_EXECUTION_RESULTS_PROPERTY JOB_BLOCK_IS_PARALLEL_PROPERTY JOB_BLOCK_IS_RELATIVE_ABORT_DEADLINE_PROPERTY JOB_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY JOB_BLOCK_JOB_TEXT_PROPERTY JOB_BLOCK_NAME_PROPERTY JOB_BLOCK_NEED_SIGN_ON_PERFORM_PROPERTY JOB_BLOCK_PERFORMER_PROPERTY JOB_BLOCK_RELATIVE_ABORT_DEADLINE_TYPE_PROPERTY JOB_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY JOB_BLOCK_SUBJECT_PROPERTY "+"ENGLISH_LANGUAGE_CODE RUSSIAN_LANGUAGE_CODE "+"smHidden smMaximized smMinimized smNormal wmNo wmYes "+"COMPONENT_TOKEN_LINK_KIND DOCUMENT_LINK_KIND EDOCUMENT_LINK_KIND FOLDER_LINK_KIND JOB_LINK_KIND REFERENCE_LINK_KIND TASK_LINK_KIND "+"COMPONENT_TOKEN_LOCK_TYPE EDOCUMENT_VERSION_LOCK_TYPE "+"MONITOR_BLOCK_AFTER_FINISH_EVENT MONITOR_BLOCK_BEFORE_START_EVENT MONITOR_BLOCK_DEADLINE_PROPERTY MONITOR_BLOCK_INTERVAL_PROPERTY MONITOR_BLOCK_INTERVAL_TYPE_PROPERTY MONITOR_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY MONITOR_BLOCK_NAME_PROPERTY MONITOR_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY MONITOR_BLOCK_SEARCH_SCRIPT_PROPERTY "+"NOTICE_BLOCK_AFTER_FINISH_EVENT NOTICE_BLOCK_ATTACHMENT_PROPERTY NOTICE_BLOCK_ATTACHMENTS_RIGHTS_GROUP_PROPERTY NOTICE_BLOCK_ATTACHMENTS_RIGHTS_TYPE_PROPERTY NOTICE_BLOCK_BEFORE_START_EVENT NOTICE_BLOCK_CREATED_NOTICES_PROPERTY NOTICE_BLOCK_DEADLINE_PROPERTY NOTICE_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY NOTICE_BLOCK_NAME_PROPERTY NOTICE_BLOCK_NOTICE_TEXT_PROPERTY NOTICE_BLOCK_PERFORMER_PROPERTY NOTICE_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY NOTICE_BLOCK_SUBJECT_PROPERTY "+"dseAfterCancel dseAfterClose dseAfterDelete dseAfterDeleteOutOfTransaction dseAfterInsert dseAfterOpen dseAfterScroll dseAfterUpdate dseAfterUpdateOutOfTransaction dseBeforeCancel dseBeforeClose dseBeforeDelete dseBeforeDetailUpdate dseBeforeInsert dseBeforeOpen dseBeforeUpdate dseOnAnyRequisiteChange dseOnCloseRecord dseOnDeleteError dseOnOpenRecord dseOnPrepareUpdate dseOnUpdateError dseOnUpdateRatifiedRecord dseOnValidDelete dseOnValidUpdate reOnChange reOnChangeValues SELECTION_BEGIN_ROUTE_EVENT SELECTION_END_ROUTE_EVENT "+"CURRENT_PERIOD_IS_REQUIRED PREVIOUS_CARD_TYPE_NAME SHOW_RECORD_PROPERTIES_FORM "+"ACCESS_RIGHTS_SETTING_DIALOG_CODE ADMINISTRATOR_USER_CODE ANALYTIC_REPORT_TYPE asrtHideLocal asrtHideRemote CALCULATED_ROLE_TYPE_CODE COMPONENTS_REFERENCE_DEVELOPER_VIEW_CODE DCTS_TEST_PROTOCOLS_FOLDER_PATH E_EDOC_VERSION_ALREADY_APPROVINGLY_SIGNED E_EDOC_VERSION_ALREADY_APPROVINGLY_SIGNED_BY_USER E_EDOC_VERSION_ALREDY_SIGNED E_EDOC_VERSION_ALREDY_SIGNED_BY_USER EDOC_TYPES_CODE_REQUISITE_FIELD_NAME EDOCUMENTS_ALIAS_NAME FILES_FOLDER_PATH FILTER_OPERANDS_DELIMITER FILTER_OPERATIONS_DELIMITER FORMCARD_NAME FORMLIST_NAME GET_EXTENDED_DOCUMENT_EXTENSION_CREATION_MODE GET_EXTENDED_DOCUMENT_EXTENSION_IMPORT_MODE INTEGRATED_REPORT_TYPE IS_BUILDER_APPLICATION_ROLE IS_BUILDER_APPLICATION_ROLE2 IS_BUILDER_USERS ISBSYSDEV LOG_FOLDER_PATH mbCancel mbNo mbNoToAll mbOK mbYes mbYesToAll MEMORY_DATASET_DESRIPTIONS_FILENAME mrNo mrNoToAll mrYes mrYesToAll MULTIPLE_SELECT_DIALOG_CODE NONOPERATING_RECORD_FLAG_FEMININE NONOPERATING_RECORD_FLAG_MASCULINE OPERATING_RECORD_FLAG_FEMININE OPERATING_RECORD_FLAG_MASCULINE PROFILING_SETTINGS_COMMON_SETTINGS_CODE_VALUE PROGRAM_INITIATED_LOOKUP_ACTION ratDelete ratEdit ratInsert REPORT_TYPE REQUIRED_PICK_VALUES_VARIABLE rmCard rmList SBRTE_PROGID_DEV SBRTE_PROGID_RELEASE STATIC_ROLE_TYPE_CODE SUPPRESS_EMPTY_TEMPLATE_CREATION SYSTEM_USER_CODE UPDATE_DIALOG_DATASET USED_IN_OBJECT_HINT_PARAM USER_INITIATED_LOOKUP_ACTION USER_NAME_FORMAT USER_SELECTION_RESTRICTIONS WORKFLOW_TEST_PROTOCOLS_FOLDER_PATH ELS_SUBTYPE_CONTROL_NAME ELS_FOLDER_KIND_CONTROL_NAME REPEAT_PROCESS_CURRENT_OBJECT_EXCEPTION_NAME "+"PRIVILEGE_COMPONENT_FULL_ACCESS PRIVILEGE_DEVELOPMENT_EXPORT PRIVILEGE_DEVELOPMENT_IMPORT PRIVILEGE_DOCUMENT_DELETE PRIVILEGE_ESD PRIVILEGE_FOLDER_DELETE PRIVILEGE_MANAGE_ACCESS_RIGHTS PRIVILEGE_MANAGE_REPLICATION PRIVILEGE_MANAGE_SESSION_SERVER PRIVILEGE_OBJECT_FULL_ACCESS PRIVILEGE_OBJECT_VIEW PRIVILEGE_RESERVE_LICENSE PRIVILEGE_SYSTEM_CUSTOMIZE PRIVILEGE_SYSTEM_DEVELOP PRIVILEGE_SYSTEM_INSTALL PRIVILEGE_TASK_DELETE PRIVILEGE_USER_PLUGIN_SETTINGS_CUSTOMIZE PRIVILEGES_PSEUDOREFERENCE_CODE "+"ACCESS_TYPES_PSEUDOREFERENCE_CODE ALL_AVAILABLE_COMPONENTS_PSEUDOREFERENCE_CODE ALL_AVAILABLE_PRIVILEGES_PSEUDOREFERENCE_CODE ALL_REPLICATE_COMPONENTS_PSEUDOREFERENCE_CODE AVAILABLE_DEVELOPERS_COMPONENTS_PSEUDOREFERENCE_CODE COMPONENTS_PSEUDOREFERENCE_CODE FILTRATER_SETTINGS_CONFLICTS_PSEUDOREFERENCE_CODE GROUPS_PSEUDOREFERENCE_CODE RECEIVE_PROTOCOL_PSEUDOREFERENCE_CODE REFERENCE_REQUISITE_PSEUDOREFERENCE_CODE REFERENCE_REQUISITES_PSEUDOREFERENCE_CODE REFTYPES_PSEUDOREFERENCE_CODE REPLICATION_SEANCES_DIARY_PSEUDOREFERENCE_CODE SEND_PROTOCOL_PSEUDOREFERENCE_CODE SUBSTITUTES_PSEUDOREFERENCE_CODE SYSTEM_SETTINGS_PSEUDOREFERENCE_CODE UNITS_PSEUDOREFERENCE_CODE USERS_PSEUDOREFERENCE_CODE VIEWERS_PSEUDOREFERENCE_CODE "+"CERTIFICATE_TYPE_ENCRYPT CERTIFICATE_TYPE_SIGN CERTIFICATE_TYPE_SIGN_AND_ENCRYPT "+"STORAGE_TYPE_FILE STORAGE_TYPE_NAS_CIFS STORAGE_TYPE_SAPERION STORAGE_TYPE_SQL_SERVER "+"COMPTYPE2_REQUISITE_DOCUMENTS_VALUE COMPTYPE2_REQUISITE_TASKS_VALUE COMPTYPE2_REQUISITE_FOLDERS_VALUE COMPTYPE2_REQUISITE_REFERENCES_VALUE "+"SYSREQ_CODE SYSREQ_COMPTYPE2 SYSREQ_CONST_AVAILABLE_FOR_WEB SYSREQ_CONST_COMMON_CODE SYSREQ_CONST_COMMON_VALUE SYSREQ_CONST_FIRM_CODE SYSREQ_CONST_FIRM_STATUS SYSREQ_CONST_FIRM_VALUE SYSREQ_CONST_SERVER_STATUS SYSREQ_CONTENTS SYSREQ_DATE_OPEN SYSREQ_DATE_CLOSE SYSREQ_DESCRIPTION SYSREQ_DESCRIPTION_LOCALIZE_ID SYSREQ_DOUBLE SYSREQ_EDOC_ACCESS_TYPE SYSREQ_EDOC_AUTHOR SYSREQ_EDOC_CREATED SYSREQ_EDOC_DELEGATE_RIGHTS_REQUISITE_CODE SYSREQ_EDOC_EDITOR SYSREQ_EDOC_ENCODE_TYPE SYSREQ_EDOC_ENCRYPTION_PLUGIN_NAME SYSREQ_EDOC_ENCRYPTION_PLUGIN_VERSION SYSREQ_EDOC_EXPORT_DATE SYSREQ_EDOC_EXPORTER SYSREQ_EDOC_KIND SYSREQ_EDOC_LIFE_STAGE_NAME SYSREQ_EDOC_LOCKED_FOR_SERVER_CODE SYSREQ_EDOC_MODIFIED SYSREQ_EDOC_NAME SYSREQ_EDOC_NOTE SYSREQ_EDOC_QUALIFIED_ID SYSREQ_EDOC_SESSION_KEY SYSREQ_EDOC_SESSION_KEY_ENCRYPTION_PLUGIN_NAME SYSREQ_EDOC_SESSION_KEY_ENCRYPTION_PLUGIN_VERSION SYSREQ_EDOC_SIGNATURE_TYPE SYSREQ_EDOC_SIGNED SYSREQ_EDOC_STORAGE SYSREQ_EDOC_STORAGES_ARCHIVE_STORAGE SYSREQ_EDOC_STORAGES_CHECK_RIGHTS SYSREQ_EDOC_STORAGES_COMPUTER_NAME SYSREQ_EDOC_STORAGES_EDIT_IN_STORAGE SYSREQ_EDOC_STORAGES_EXECUTIVE_STORAGE SYSREQ_EDOC_STORAGES_FUNCTION SYSREQ_EDOC_STORAGES_INITIALIZED SYSREQ_EDOC_STORAGES_LOCAL_PATH SYSREQ_EDOC_STORAGES_SAPERION_DATABASE_NAME SYSREQ_EDOC_STORAGES_SEARCH_BY_TEXT SYSREQ_EDOC_STORAGES_SERVER_NAME SYSREQ_EDOC_STORAGES_SHARED_SOURCE_NAME SYSREQ_EDOC_STORAGES_TYPE SYSREQ_EDOC_TEXT_MODIFIED SYSREQ_EDOC_TYPE_ACT_CODE SYSREQ_EDOC_TYPE_ACT_DESCRIPTION SYSREQ_EDOC_TYPE_ACT_DESCRIPTION_LOCALIZE_ID SYSREQ_EDOC_TYPE_ACT_ON_EXECUTE SYSREQ_EDOC_TYPE_ACT_ON_EXECUTE_EXISTS SYSREQ_EDOC_TYPE_ACT_SECTION SYSREQ_EDOC_TYPE_ADD_PARAMS SYSREQ_EDOC_TYPE_COMMENT SYSREQ_EDOC_TYPE_EVENT_TEXT SYSREQ_EDOC_TYPE_NAME_IN_SINGULAR SYSREQ_EDOC_TYPE_NAME_IN_SINGULAR_LOCALIZE_ID SYSREQ_EDOC_TYPE_NAME_LOCALIZE_ID SYSREQ_EDOC_TYPE_NUMERATION_METHOD SYSREQ_EDOC_TYPE_PSEUDO_REQUISITE_CODE SYSREQ_EDOC_TYPE_REQ_CODE SYSREQ_EDOC_TYPE_REQ_DESCRIPTION SYSREQ_EDOC_TYPE_REQ_DESCRIPTION_LOCALIZE_ID SYSREQ_EDOC_TYPE_REQ_IS_LEADING SYSREQ_EDOC_TYPE_REQ_IS_REQUIRED SYSREQ_EDOC_TYPE_REQ_NUMBER SYSREQ_EDOC_TYPE_REQ_ON_CHANGE SYSREQ_EDOC_TYPE_REQ_ON_CHANGE_EXISTS SYSREQ_EDOC_TYPE_REQ_ON_SELECT SYSREQ_EDOC_TYPE_REQ_ON_SELECT_KIND SYSREQ_EDOC_TYPE_REQ_SECTION SYSREQ_EDOC_TYPE_VIEW_CARD SYSREQ_EDOC_TYPE_VIEW_CODE SYSREQ_EDOC_TYPE_VIEW_COMMENT SYSREQ_EDOC_TYPE_VIEW_IS_MAIN SYSREQ_EDOC_TYPE_VIEW_NAME SYSREQ_EDOC_TYPE_VIEW_NAME_LOCALIZE_ID SYSREQ_EDOC_VERSION_AUTHOR SYSREQ_EDOC_VERSION_CRC SYSREQ_EDOC_VERSION_DATA SYSREQ_EDOC_VERSION_EDITOR SYSREQ_EDOC_VERSION_EXPORT_DATE SYSREQ_EDOC_VERSION_EXPORTER SYSREQ_EDOC_VERSION_HIDDEN SYSREQ_EDOC_VERSION_LIFE_STAGE SYSREQ_EDOC_VERSION_MODIFIED SYSREQ_EDOC_VERSION_NOTE SYSREQ_EDOC_VERSION_SIGNATURE_TYPE SYSREQ_EDOC_VERSION_SIGNED SYSREQ_EDOC_VERSION_SIZE SYSREQ_EDOC_VERSION_SOURCE SYSREQ_EDOC_VERSION_TEXT_MODIFIED SYSREQ_EDOCKIND_DEFAULT_VERSION_STATE_CODE SYSREQ_FOLDER_KIND SYSREQ_FUNC_CATEGORY SYSREQ_FUNC_COMMENT SYSREQ_FUNC_GROUP SYSREQ_FUNC_GROUP_COMMENT SYSREQ_FUNC_GROUP_NUMBER SYSREQ_FUNC_HELP SYSREQ_FUNC_PARAM_DEF_VALUE SYSREQ_FUNC_PARAM_IDENT SYSREQ_FUNC_PARAM_NUMBER SYSREQ_FUNC_PARAM_TYPE SYSREQ_FUNC_TEXT SYSREQ_GROUP_CATEGORY SYSREQ_ID SYSREQ_LAST_UPDATE SYSREQ_LEADER_REFERENCE SYSREQ_LINE_NUMBER SYSREQ_MAIN_RECORD_ID SYSREQ_NAME SYSREQ_NAME_LOCALIZE_ID SYSREQ_NOTE SYSREQ_ORIGINAL_RECORD SYSREQ_OUR_FIRM SYSREQ_PROFILING_SETTINGS_BATCH_LOGING SYSREQ_PROFILING_SETTINGS_BATCH_SIZE SYSREQ_PROFILING_SETTINGS_PROFILING_ENABLED SYSREQ_PROFILING_SETTINGS_SQL_PROFILING_ENABLED SYSREQ_PROFILING_SETTINGS_START_LOGGED SYSREQ_RECORD_STATUS SYSREQ_REF_REQ_FIELD_NAME SYSREQ_REF_REQ_FORMAT SYSREQ_REF_REQ_GENERATED SYSREQ_REF_REQ_LENGTH SYSREQ_REF_REQ_PRECISION SYSREQ_REF_REQ_REFERENCE SYSREQ_REF_REQ_SECTION SYSREQ_REF_REQ_STORED SYSREQ_REF_REQ_TOKENS SYSREQ_REF_REQ_TYPE SYSREQ_REF_REQ_VIEW SYSREQ_REF_TYPE_ACT_CODE SYSREQ_REF_TYPE_ACT_DESCRIPTION SYSREQ_REF_TYPE_ACT_DESCRIPTION_LOCALIZE_ID SYSREQ_REF_TYPE_ACT_ON_EXECUTE SYSREQ_REF_TYPE_ACT_ON_EXECUTE_EXISTS SYSREQ_REF_TYPE_ACT_SECTION SYSREQ_REF_TYPE_ADD_PARAMS SYSREQ_REF_TYPE_COMMENT SYSREQ_REF_TYPE_COMMON_SETTINGS SYSREQ_REF_TYPE_DISPLAY_REQUISITE_NAME SYSREQ_REF_TYPE_EVENT_TEXT SYSREQ_REF_TYPE_MAIN_LEADING_REF SYSREQ_REF_TYPE_NAME_IN_SINGULAR SYSREQ_REF_TYPE_NAME_IN_SINGULAR_LOCALIZE_ID SYSREQ_REF_TYPE_NAME_LOCALIZE_ID SYSREQ_REF_TYPE_NUMERATION_METHOD SYSREQ_REF_TYPE_REQ_CODE SYSREQ_REF_TYPE_REQ_DESCRIPTION SYSREQ_REF_TYPE_REQ_DESCRIPTION_LOCALIZE_ID SYSREQ_REF_TYPE_REQ_IS_CONTROL SYSREQ_REF_TYPE_REQ_IS_FILTER SYSREQ_REF_TYPE_REQ_IS_LEADING SYSREQ_REF_TYPE_REQ_IS_REQUIRED SYSREQ_REF_TYPE_REQ_NUMBER SYSREQ_REF_TYPE_REQ_ON_CHANGE SYSREQ_REF_TYPE_REQ_ON_CHANGE_EXISTS SYSREQ_REF_TYPE_REQ_ON_SELECT SYSREQ_REF_TYPE_REQ_ON_SELECT_KIND SYSREQ_REF_TYPE_REQ_SECTION SYSREQ_REF_TYPE_VIEW_CARD SYSREQ_REF_TYPE_VIEW_CODE SYSREQ_REF_TYPE_VIEW_COMMENT SYSREQ_REF_TYPE_VIEW_IS_MAIN SYSREQ_REF_TYPE_VIEW_NAME SYSREQ_REF_TYPE_VIEW_NAME_LOCALIZE_ID SYSREQ_REFERENCE_TYPE_ID SYSREQ_STATE SYSREQ_STAT\u0415 SYSREQ_SYSTEM_SETTINGS_VALUE SYSREQ_TYPE SYSREQ_UNIT SYSREQ_UNIT_ID SYSREQ_USER_GROUPS_GROUP_FULL_NAME SYSREQ_USER_GROUPS_GROUP_NAME SYSREQ_USER_GROUPS_GROUP_SERVER_NAME SYSREQ_USERS_ACCESS_RIGHTS SYSREQ_USERS_AUTHENTICATION SYSREQ_USERS_CATEGORY SYSREQ_USERS_COMPONENT SYSREQ_USERS_COMPONENT_USER_IS_PUBLIC SYSREQ_USERS_DOMAIN SYSREQ_USERS_FULL_USER_NAME SYSREQ_USERS_GROUP SYSREQ_USERS_IS_MAIN_SERVER SYSREQ_USERS_LOGIN SYSREQ_USERS_REFERENCE_USER_IS_PUBLIC SYSREQ_USERS_STATUS SYSREQ_USERS_USER_CERTIFICATE SYSREQ_USERS_USER_CERTIFICATE_INFO SYSREQ_USERS_USER_CERTIFICATE_PLUGIN_NAME SYSREQ_USERS_USER_CERTIFICATE_PLUGIN_VERSION SYSREQ_USERS_USER_CERTIFICATE_STATE SYSREQ_USERS_USER_CERTIFICATE_SUBJECT_NAME SYSREQ_USERS_USER_CERTIFICATE_THUMBPRINT SYSREQ_USERS_USER_DEFAULT_CERTIFICATE SYSREQ_USERS_USER_DESCRIPTION SYSREQ_USERS_USER_GLOBAL_NAME SYSREQ_USERS_USER_LOGIN SYSREQ_USERS_USER_MAIN_SERVER SYSREQ_USERS_USER_TYPE SYSREQ_WORK_RULES_FOLDER_ID "+"RESULT_VAR_NAME RESULT_VAR_NAME_ENG "+"AUTO_NUMERATION_RULE_ID CANT_CHANGE_ID_REQUISITE_RULE_ID CANT_CHANGE_OURFIRM_REQUISITE_RULE_ID CHECK_CHANGING_REFERENCE_RECORD_USE_RULE_ID CHECK_CODE_REQUISITE_RULE_ID CHECK_DELETING_REFERENCE_RECORD_USE_RULE_ID CHECK_FILTRATER_CHANGES_RULE_ID CHECK_RECORD_INTERVAL_RULE_ID CHECK_REFERENCE_INTERVAL_RULE_ID CHECK_REQUIRED_DATA_FULLNESS_RULE_ID CHECK_REQUIRED_REQUISITES_FULLNESS_RULE_ID MAKE_RECORD_UNRATIFIED_RULE_ID RESTORE_AUTO_NUMERATION_RULE_ID SET_FIRM_CONTEXT_FROM_RECORD_RULE_ID SET_FIRST_RECORD_IN_LIST_FORM_RULE_ID SET_IDSPS_VALUE_RULE_ID SET_NEXT_CODE_VALUE_RULE_ID SET_OURFIRM_BOUNDS_RULE_ID SET_OURFIRM_REQUISITE_RULE_ID "+"SCRIPT_BLOCK_AFTER_FINISH_EVENT SCRIPT_BLOCK_BEFORE_START_EVENT SCRIPT_BLOCK_EXECUTION_RESULTS_PROPERTY SCRIPT_BLOCK_NAME_PROPERTY SCRIPT_BLOCK_SCRIPT_PROPERTY "+"SUBTASK_BLOCK_ABORT_DEADLINE_PROPERTY SUBTASK_BLOCK_AFTER_FINISH_EVENT SUBTASK_BLOCK_ASSIGN_PARAMS_EVENT SUBTASK_BLOCK_ATTACHMENTS_PROPERTY SUBTASK_BLOCK_ATTACHMENTS_RIGHTS_GROUP_PROPERTY SUBTASK_BLOCK_ATTACHMENTS_RIGHTS_TYPE_PROPERTY SUBTASK_BLOCK_BEFORE_START_EVENT SUBTASK_BLOCK_CREATED_TASK_PROPERTY SUBTASK_BLOCK_CREATION_EVENT SUBTASK_BLOCK_DEADLINE_PROPERTY SUBTASK_BLOCK_IMPORTANCE_PROPERTY SUBTASK_BLOCK_INITIATOR_PROPERTY SUBTASK_BLOCK_IS_RELATIVE_ABORT_DEADLINE_PROPERTY SUBTASK_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY SUBTASK_BLOCK_JOBS_TYPE_PROPERTY SUBTASK_BLOCK_NAME_PROPERTY SUBTASK_BLOCK_PARALLEL_ROUTE_PROPERTY SUBTASK_BLOCK_PERFORMERS_PROPERTY SUBTASK_BLOCK_RELATIVE_ABORT_DEADLINE_TYPE_PROPERTY SUBTASK_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY SUBTASK_BLOCK_REQUIRE_SIGN_PROPERTY SUBTASK_BLOCK_STANDARD_ROUTE_PROPERTY SUBTASK_BLOCK_START_EVENT SUBTASK_BLOCK_STEP_CONTROL_PROPERTY SUBTASK_BLOCK_SUBJECT_PROPERTY SUBTASK_BLOCK_TASK_CONTROL_PROPERTY SUBTASK_BLOCK_TEXT_PROPERTY SUBTASK_BLOCK_UNLOCK_ATTACHMENTS_ON_STOP_PROPERTY SUBTASK_BLOCK_USE_STANDARD_ROUTE_PROPERTY SUBTASK_BLOCK_WAIT_FOR_TASK_COMPLETE_PROPERTY "+"SYSCOMP_CONTROL_JOBS SYSCOMP_FOLDERS SYSCOMP_JOBS SYSCOMP_NOTICES SYSCOMP_TASKS "+"SYSDLG_CREATE_EDOCUMENT SYSDLG_CREATE_EDOCUMENT_VERSION SYSDLG_CURRENT_PERIOD SYSDLG_EDIT_FUNCTION_HELP SYSDLG_EDOCUMENT_KINDS_FOR_TEMPLATE SYSDLG_EXPORT_MULTIPLE_EDOCUMENTS SYSDLG_EXPORT_SINGLE_EDOCUMENT SYSDLG_IMPORT_EDOCUMENT SYSDLG_MULTIPLE_SELECT SYSDLG_SETUP_ACCESS_RIGHTS SYSDLG_SETUP_DEFAULT_RIGHTS SYSDLG_SETUP_FILTER_CONDITION SYSDLG_SETUP_SIGN_RIGHTS SYSDLG_SETUP_TASK_OBSERVERS SYSDLG_SETUP_TASK_ROUTE SYSDLG_SETUP_USERS_LIST SYSDLG_SIGN_EDOCUMENT SYSDLG_SIGN_MULTIPLE_EDOCUMENTS "+"SYSREF_ACCESS_RIGHTS_TYPES SYSREF_ADMINISTRATION_HISTORY SYSREF_ALL_AVAILABLE_COMPONENTS SYSREF_ALL_AVAILABLE_PRIVILEGES SYSREF_ALL_REPLICATING_COMPONENTS SYSREF_AVAILABLE_DEVELOPERS_COMPONENTS SYSREF_CALENDAR_EVENTS SYSREF_COMPONENT_TOKEN_HISTORY SYSREF_COMPONENT_TOKENS SYSREF_COMPONENTS SYSREF_CONSTANTS SYSREF_DATA_RECEIVE_PROTOCOL SYSREF_DATA_SEND_PROTOCOL SYSREF_DIALOGS SYSREF_DIALOGS_REQUISITES SYSREF_EDITORS SYSREF_EDOC_CARDS SYSREF_EDOC_TYPES SYSREF_EDOCUMENT_CARD_REQUISITES SYSREF_EDOCUMENT_CARD_TYPES SYSREF_EDOCUMENT_CARD_TYPES_REFERENCE SYSREF_EDOCUMENT_CARDS SYSREF_EDOCUMENT_HISTORY SYSREF_EDOCUMENT_KINDS SYSREF_EDOCUMENT_REQUISITES SYSREF_EDOCUMENT_SIGNATURES SYSREF_EDOCUMENT_TEMPLATES SYSREF_EDOCUMENT_TEXT_STORAGES SYSREF_EDOCUMENT_VIEWS SYSREF_FILTERER_SETUP_CONFLICTS SYSREF_FILTRATER_SETTING_CONFLICTS SYSREF_FOLDER_HISTORY SYSREF_FOLDERS SYSREF_FUNCTION_GROUPS SYSREF_FUNCTION_PARAMS SYSREF_FUNCTIONS SYSREF_JOB_HISTORY SYSREF_LINKS SYSREF_LOCALIZATION_DICTIONARY SYSREF_LOCALIZATION_LANGUAGES SYSREF_MODULES SYSREF_PRIVILEGES SYSREF_RECORD_HISTORY SYSREF_REFERENCE_REQUISITES SYSREF_REFERENCE_TYPE_VIEWS SYSREF_REFERENCE_TYPES SYSREF_REFERENCES SYSREF_REFERENCES_REQUISITES SYSREF_REMOTE_SERVERS SYSREF_REPLICATION_SESSIONS_LOG SYSREF_REPLICATION_SESSIONS_PROTOCOL SYSREF_REPORTS SYSREF_ROLES SYSREF_ROUTE_BLOCK_GROUPS SYSREF_ROUTE_BLOCKS SYSREF_SCRIPTS SYSREF_SEARCHES SYSREF_SERVER_EVENTS SYSREF_SERVER_EVENTS_HISTORY SYSREF_STANDARD_ROUTE_GROUPS SYSREF_STANDARD_ROUTES SYSREF_STATUSES SYSREF_SYSTEM_SETTINGS SYSREF_TASK_HISTORY SYSREF_TASK_KIND_GROUPS SYSREF_TASK_KINDS SYSREF_TASK_RIGHTS SYSREF_TASK_SIGNATURES SYSREF_TASKS SYSREF_UNITS SYSREF_USER_GROUPS SYSREF_USER_GROUPS_REFERENCE SYSREF_USER_SUBSTITUTION SYSREF_USERS SYSREF_USERS_REFERENCE SYSREF_VIEWERS SYSREF_WORKING_TIME_CALENDARS "+"ACCESS_RIGHTS_TABLE_NAME EDMS_ACCESS_TABLE_NAME EDOC_TYPES_TABLE_NAME "+"TEST_DEV_DB_NAME TEST_DEV_SYSTEM_CODE TEST_EDMS_DB_NAME TEST_EDMS_MAIN_CODE TEST_EDMS_MAIN_DB_NAME TEST_EDMS_SECOND_CODE TEST_EDMS_SECOND_DB_NAME TEST_EDMS_SYSTEM_CODE TEST_ISB5_MAIN_CODE TEST_ISB5_SECOND_CODE TEST_SQL_SERVER_2005_NAME TEST_SQL_SERVER_NAME "+"ATTENTION_CAPTION cbsCommandLinks cbsDefault CONFIRMATION_CAPTION ERROR_CAPTION INFORMATION_CAPTION mrCancel mrOk "+"EDOC_VERSION_ACTIVE_STAGE_CODE EDOC_VERSION_DESIGN_STAGE_CODE EDOC_VERSION_OBSOLETE_STAGE_CODE "+"cpDataEnciphermentEnabled cpDigitalSignatureEnabled cpID cpIssuer cpPluginVersion cpSerial cpSubjectName cpSubjSimpleName cpValidFromDate cpValidToDate "+"ISBL_SYNTAX NO_SYNTAX XML_SYNTAX "+"WAIT_BLOCK_AFTER_FINISH_EVENT WAIT_BLOCK_BEFORE_START_EVENT WAIT_BLOCK_DEADLINE_PROPERTY WAIT_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY WAIT_BLOCK_NAME_PROPERTY WAIT_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY "+"SYSRES_COMMON SYSRES_CONST SYSRES_MBFUNC SYSRES_SBDATA SYSRES_SBGUI SYSRES_SBINTF SYSRES_SBREFDSC SYSRES_SQLERRORS SYSRES_SYSCOMP ",oa="atUser atGroup atRole "+"aemEnabledAlways aemDisabledAlways aemEnabledOnBrowse aemEnabledOnEdit aemDisabledOnBrowseEmpty "+"apBegin apEnd "+"alLeft alRight "+"asmNever asmNoButCustomize asmAsLastTime asmYesButCustomize asmAlways "+"cirCommon cirRevoked "+"ctSignature ctEncode ctSignatureEncode "+"clbUnchecked clbChecked clbGrayed "+"ceISB ceAlways ceNever "+"ctDocument ctReference ctScript ctUnknown ctReport ctDialog ctFunction ctFolder ctEDocument ctTask ctJob ctNotice ctControlJob "+"cfInternal cfDisplay "+"ciUnspecified ciWrite ciRead "+"ckFolder ckEDocument ckTask ckJob ckComponentToken ckAny ckReference ckScript ckReport ckDialog "+"ctISBLEditor ctBevel ctButton ctCheckListBox ctComboBox ctComboEdit ctGrid ctDBCheckBox ctDBComboBox ctDBEdit ctDBEllipsis ctDBMemo ctDBNavigator ctDBRadioGroup ctDBStatusLabel ctEdit ctGroupBox ctInplaceHint ctMemo ctPanel ctListBox ctRadioButton ctRichEdit ctTabSheet ctWebBrowser ctImage ctHyperLink ctLabel ctDBMultiEllipsis ctRibbon ctRichView ctInnerPanel ctPanelGroup ctBitButton "+"cctDate cctInteger cctNumeric cctPick cctReference cctString cctText "+"cltInternal cltPrimary cltGUI "+"dseBeforeOpen dseAfterOpen dseBeforeClose dseAfterClose dseOnValidDelete dseBeforeDelete dseAfterDelete dseAfterDeleteOutOfTransaction dseOnDeleteError dseBeforeInsert dseAfterInsert dseOnValidUpdate dseBeforeUpdate dseOnUpdateRatifiedRecord dseAfterUpdate dseAfterUpdateOutOfTransaction dseOnUpdateError dseAfterScroll dseOnOpenRecord dseOnCloseRecord dseBeforeCancel dseAfterCancel dseOnUpdateDeadlockError dseBeforeDetailUpdate dseOnPrepareUpdate dseOnAnyRequisiteChange "+"dssEdit dssInsert dssBrowse dssInActive "+"dftDate dftShortDate dftDateTime dftTimeStamp "+"dotDays dotHours dotMinutes dotSeconds "+"dtkndLocal dtkndUTC "+"arNone arView arEdit arFull "+"ddaView ddaEdit "+"emLock emEdit emSign emExportWithLock emImportWithUnlock emChangeVersionNote emOpenForModify emChangeLifeStage emDelete emCreateVersion emImport emUnlockExportedWithLock emStart emAbort emReInit emMarkAsReaded emMarkAsUnreaded emPerform emAccept emResume emChangeRights emEditRoute emEditObserver emRecoveryFromLocalCopy emChangeWorkAccessType emChangeEncodeTypeToCertificate emChangeEncodeTypeToPassword emChangeEncodeTypeToNone emChangeEncodeTypeToCertificatePassword emChangeStandardRoute emGetText emOpenForView emMoveToStorage emCreateObject emChangeVersionHidden emDeleteVersion emChangeLifeCycleStage emApprovingSign emExport emContinue emLockFromEdit emUnLockForEdit emLockForServer emUnlockFromServer emDelegateAccessRights emReEncode "+"ecotFile ecotProcess "+"eaGet eaCopy eaCreate eaCreateStandardRoute "+"edltAll edltNothing edltQuery "+"essmText essmCard "+"esvtLast esvtLastActive esvtSpecified "+"edsfExecutive edsfArchive "+"edstSQLServer edstFile "+"edvstNone edvstEDocumentVersionCopy edvstFile edvstTemplate edvstScannedFile "+"vsDefault vsDesign vsActive vsObsolete "+"etNone etCertificate etPassword etCertificatePassword "+"ecException ecWarning ecInformation "+"estAll estApprovingOnly "+"evtLast evtLastActive evtQuery "+"fdtString fdtNumeric fdtInteger fdtDate fdtText fdtUnknown fdtWideString fdtLargeInteger "+"ftInbox ftOutbox ftFavorites ftCommonFolder ftUserFolder ftComponents ftQuickLaunch ftShortcuts ftSearch "+"grhAuto grhX1 grhX2 grhX3 "+"hltText hltRTF hltHTML "+"iffBMP iffJPEG iffMultiPageTIFF iffSinglePageTIFF iffTIFF iffPNG "+"im8bGrayscale im24bRGB im1bMonochrome "+"itBMP itJPEG itWMF itPNG "+"ikhInformation ikhWarning ikhError ikhNoIcon "+"icUnknown icScript icFunction icIntegratedReport icAnalyticReport icDataSetEventHandler icActionHandler icFormEventHandler icLookUpEventHandler icRequisiteChangeEventHandler icBeforeSearchEventHandler icRoleCalculation icSelectRouteEventHandler icBlockPropertyCalculation icBlockQueryParamsEventHandler icChangeSearchResultEventHandler icBlockEventHandler icSubTaskInitEventHandler icEDocDataSetEventHandler icEDocLookUpEventHandler icEDocActionHandler icEDocFormEventHandler icEDocRequisiteChangeEventHandler icStructuredConversionRule icStructuredConversionEventBefore icStructuredConversionEventAfter icWizardEventHandler icWizardFinishEventHandler icWizardStepEventHandler icWizardStepFinishEventHandler icWizardActionEnableEventHandler icWizardActionExecuteEventHandler icCreateJobsHandler icCreateNoticesHandler icBeforeLookUpEventHandler icAfterLookUpEventHandler icTaskAbortEventHandler icWorkflowBlockActionHandler icDialogDataSetEventHandler icDialogActionHandler icDialogLookUpEventHandler icDialogRequisiteChangeEventHandler icDialogFormEventHandler icDialogValidCloseEventHandler icBlockFormEventHandler icTaskFormEventHandler icReferenceMethod icEDocMethod icDialogMethod icProcessMessageHandler "+"isShow isHide isByUserSettings "+"jkJob jkNotice jkControlJob "+"jtInner jtLeft jtRight jtFull jtCross "+"lbpAbove lbpBelow lbpLeft lbpRight "+"eltPerConnection eltPerUser "+"sfcUndefined sfcBlack sfcGreen sfcRed sfcBlue sfcOrange sfcLilac "+"sfsItalic sfsStrikeout sfsNormal "+"ldctStandardRoute ldctWizard ldctScript ldctFunction ldctRouteBlock ldctIntegratedReport ldctAnalyticReport ldctReferenceType ldctEDocumentType ldctDialog ldctServerEvents "+"mrcrtNone mrcrtUser mrcrtMaximal mrcrtCustom "+"vtEqual vtGreaterOrEqual vtLessOrEqual vtRange "+"rdYesterday rdToday rdTomorrow rdThisWeek rdThisMonth rdThisYear rdNextMonth rdNextWeek rdLastWeek rdLastMonth "+"rdWindow rdFile rdPrinter "+"rdtString rdtNumeric rdtInteger rdtDate rdtReference rdtAccount rdtText rdtPick rdtUnknown rdtLargeInteger rdtDocument "+"reOnChange reOnChangeValues "+"ttGlobal ttLocal ttUser ttSystem "+"ssmBrowse ssmSelect ssmMultiSelect ssmBrowseModal "+"smSelect smLike smCard "+"stNone stAuthenticating stApproving "+"sctString sctStream "+"sstAnsiSort sstNaturalSort "+"svtEqual svtContain "+"soatString soatNumeric soatInteger soatDatetime soatReferenceRecord soatText soatPick soatBoolean soatEDocument soatAccount soatIntegerCollection soatNumericCollection soatStringCollection soatPickCollection soatDatetimeCollection soatBooleanCollection soatReferenceRecordCollection soatEDocumentCollection soatAccountCollection soatContents soatUnknown "+"tarAbortByUser tarAbortByWorkflowException "+"tvtAllWords tvtExactPhrase tvtAnyWord "+"usNone usCompleted usRedSquare usBlueSquare usYellowSquare usGreenSquare usOrangeSquare usPurpleSquare usFollowUp "+"utUnknown utUser utDeveloper utAdministrator utSystemDeveloper utDisconnected "+"btAnd btDetailAnd btOr btNotOr btOnly "+"vmView vmSelect vmNavigation "+"vsmSingle vsmMultiple vsmMultipleCheck vsmNoSelection "+"wfatPrevious wfatNext wfatCancel wfatFinish "+"wfepUndefined wfepText3 wfepText6 wfepText9 wfepSpinEdit wfepDropDown wfepRadioGroup wfepFlag wfepText12 wfepText15 wfepText18 wfepText21 wfepText24 wfepText27 wfepText30 wfepRadioGroupColumn1 wfepRadioGroupColumn2 wfepRadioGroupColumn3 "+"wfetQueryParameter wfetText wfetDelimiter wfetLabel "+"wptString wptInteger wptNumeric wptBoolean wptDateTime wptPick wptText wptUser wptUserList wptEDocumentInfo wptEDocumentInfoList wptReferenceRecordInfo wptReferenceRecordInfoList wptFolderInfo wptTaskInfo wptContents wptFileName wptDate "+"wsrComplete wsrGoNext wsrGoPrevious wsrCustom wsrCancel wsrGoFinal "+"wstForm wstEDocument wstTaskCard wstReferenceRecordCard wstFinal "+"waAll waPerformers waManual "+"wsbStart wsbFinish wsbNotice wsbStep wsbDecision wsbWait wsbMonitor wsbScript wsbConnector wsbSubTask wsbLifeCycleStage wsbPause "+"wdtInteger wdtFloat wdtString wdtPick wdtDateTime wdtBoolean wdtTask wdtJob wdtFolder wdtEDocument wdtReferenceRecord wdtUser wdtGroup wdtRole wdtIntegerCollection wdtFloatCollection wdtStringCollection wdtPickCollection wdtDateTimeCollection wdtBooleanCollection wdtTaskCollection wdtJobCollection wdtFolderCollection wdtEDocumentCollection wdtReferenceRecordCollection wdtUserCollection wdtGroupCollection wdtRoleCollection wdtContents wdtUserList wdtSearchDescription wdtDeadLine wdtPickSet wdtAccountCollection "+"wiLow wiNormal wiHigh "+"wrtSoft wrtHard "+"wsInit wsRunning wsDone wsControlled wsAborted wsContinued "+"wtmFull wtmFromCurrent wtmOnlyCurrent ",Nr="AddSubString AdjustLineBreaks AmountInWords Analysis ArrayDimCount ArrayHighBound ArrayLowBound ArrayOf ArrayReDim Assert Assigned BeginOfMonth BeginOfPeriod BuildProfilingOperationAnalysis CallProcedure CanReadFile CArrayElement CDataSetRequisite ChangeDate ChangeReferenceDataset Char CharPos CheckParam CheckParamValue CompareStrings ConstantExists ControlState ConvertDateStr Copy CopyFile CreateArray CreateCachedReference CreateConnection CreateDialog CreateDualListDialog CreateEditor CreateException CreateFile CreateFolderDialog CreateInputDialog CreateLinkFile CreateList CreateLock CreateMemoryDataSet CreateObject CreateOpenDialog CreateProgress CreateQuery CreateReference CreateReport CreateSaveDialog CreateScript CreateSQLPivotFunction CreateStringList CreateTreeListSelectDialog CSelectSQL CSQL CSubString CurrentUserID CurrentUserName CurrentVersion DataSetLocateEx DateDiff DateTimeDiff DateToStr DayOfWeek DeleteFile DirectoryExists DisableCheckAccessRights DisableCheckFullShowingRestriction DisableMassTaskSendingRestrictions DropTable DupeString EditText EnableCheckAccessRights EnableCheckFullShowingRestriction EnableMassTaskSendingRestrictions EndOfMonth EndOfPeriod ExceptionExists ExceptionsOff ExceptionsOn Execute ExecuteProcess Exit ExpandEnvironmentVariables ExtractFileDrive ExtractFileExt ExtractFileName ExtractFilePath ExtractParams FileExists FileSize FindFile FindSubString FirmContext ForceDirectories Format FormatDate FormatNumeric FormatSQLDate FormatString FreeException GetComponent GetComponentLaunchParam GetConstant GetLastException GetReferenceRecord GetRefTypeByRefID GetTableID GetTempFolder IfThen In IndexOf InputDialog InputDialogEx InteractiveMode IsFileLocked IsGraphicFile IsNumeric Length LoadString LoadStringFmt LocalTimeToUTC LowerCase Max MessageBox MessageBoxEx MimeDecodeBinary MimeDecodeString MimeEncodeBinary MimeEncodeString Min MoneyInWords MoveFile NewID Now OpenFile Ord Precision Raise ReadCertificateFromFile ReadFile ReferenceCodeByID ReferenceNumber ReferenceRequisiteMode ReferenceRequisiteValue RegionDateSettings RegionNumberSettings RegionTimeSettings RegRead RegWrite RenameFile Replace Round SelectServerCode SelectSQL ServerDateTime SetConstant SetManagedFolderFieldsState ShowConstantsInputDialog ShowMessage Sleep Split SQL SQL2XLSTAB SQLProfilingSendReport StrToDate SubString SubStringCount SystemSetting Time TimeDiff Today Transliterate Trim UpperCase UserStatus UTCToLocalTime ValidateXML VarIsClear VarIsEmpty VarIsNull WorkTimeDiff WriteFile WriteFileEx WriteObjectHistory \u0410\u043D\u0430\u043B\u0438\u0437 \u0411\u0430\u0437\u0430\u0414\u0430\u043D\u043D\u044B\u0445 \u0411\u043B\u043E\u043A\u0415\u0441\u0442\u044C \u0411\u043B\u043E\u043A\u0415\u0441\u0442\u044C\u0420\u0430\u0441\u0448 \u0411\u043B\u043E\u043A\u0418\u043D\u0444\u043E \u0411\u043B\u043E\u043A\u0421\u043D\u044F\u0442\u044C \u0411\u043B\u043E\u043A\u0421\u043D\u044F\u0442\u044C\u0420\u0430\u0441\u0448 \u0411\u043B\u043E\u043A\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0412\u0432\u043E\u0434 \u0412\u0432\u043E\u0434\u041C\u0435\u043D\u044E \u0412\u0435\u0434\u0421 \u0412\u0435\u0434\u0421\u043F\u0440 \u0412\u0435\u0440\u0445\u043D\u044F\u044F\u0413\u0440\u0430\u043D\u0438\u0446\u0430\u041C\u0430\u0441\u0441\u0438\u0432\u0430 \u0412\u043D\u0435\u0448\u041F\u0440\u043E\u0433\u0440 \u0412\u043E\u0441\u0441\u0442 \u0412\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F\u041F\u0430\u043F\u043A\u0430 \u0412\u0440\u0435\u043C\u044F \u0412\u044B\u0431\u043E\u0440SQL \u0412\u044B\u0431\u0440\u0430\u0442\u044C\u0417\u0430\u043F\u0438\u0441\u044C \u0412\u044B\u0434\u0435\u043B\u0438\u0442\u044C\u0421\u0442\u0440 \u0412\u044B\u0437\u0432\u0430\u0442\u044C \u0412\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0412\u044B\u043F\u041F\u0440\u043E\u0433\u0440 \u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u0438\u0439\u0424\u0430\u0439\u043B \u0413\u0440\u0443\u043F\u043F\u0430\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0414\u0430\u0442\u0430\u0412\u0440\u0435\u043C\u044F\u0421\u0435\u0440\u0432 \u0414\u0435\u043D\u044C\u041D\u0435\u0434\u0435\u043B\u0438 \u0414\u0438\u0430\u043B\u043E\u0433\u0414\u0430\u041D\u0435\u0442 \u0414\u043B\u0438\u043D\u0430\u0421\u0442\u0440 \u0414\u043E\u0431\u041F\u043E\u0434\u0441\u0442\u0440 \u0415\u041F\u0443\u0441\u0442\u043E \u0415\u0441\u043B\u0438\u0422\u043E \u0415\u0427\u0438\u0441\u043B\u043E \u0417\u0430\u043C\u041F\u043E\u0434\u0441\u0442\u0440 \u0417\u0430\u043F\u0438\u0441\u044C\u0421\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A\u0430 \u0417\u043D\u0430\u0447\u041F\u043E\u043B\u044F\u0421\u043F\u0440 \u0418\u0414\u0422\u0438\u043F\u0421\u043F\u0440 \u0418\u0437\u0432\u043B\u0435\u0447\u044C\u0414\u0438\u0441\u043A \u0418\u0437\u0432\u043B\u0435\u0447\u044C\u0418\u043C\u044F\u0424\u0430\u0439\u043B\u0430 \u0418\u0437\u0432\u043B\u0435\u0447\u044C\u041F\u0443\u0442\u044C \u0418\u0437\u0432\u043B\u0435\u0447\u044C\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435 \u0418\u0437\u043C\u0414\u0430\u0442 \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C\u0420\u0430\u0437\u043C\u0435\u0440\u041C\u0430\u0441\u0441\u0438\u0432\u0430 \u0418\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u0439\u041C\u0430\u0441\u0441\u0438\u0432\u0430 \u0418\u043C\u044F\u041E\u0440\u0433 \u0418\u043C\u044F\u041F\u043E\u043B\u044F\u0421\u043F\u0440 \u0418\u043D\u0434\u0435\u043A\u0441 \u0418\u043D\u0434\u0438\u043A\u0430\u0442\u043E\u0440\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0418\u043D\u0434\u0438\u043A\u0430\u0442\u043E\u0440\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0418\u043D\u0434\u0438\u043A\u0430\u0442\u043E\u0440\u0428\u0430\u0433 \u0418\u043D\u0442\u0435\u0440\u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0439\u0420\u0435\u0436\u0438\u043C \u0418\u0442\u043E\u0433\u0422\u0431\u043B\u0421\u043F\u0440 \u041A\u043E\u0434\u0412\u0438\u0434\u0412\u0435\u0434\u0421\u043F\u0440 \u041A\u043E\u0434\u0412\u0438\u0434\u0421\u043F\u0440\u041F\u043E\u0418\u0414 \u041A\u043E\u0434\u041F\u043EAnalit \u041A\u043E\u0434\u0421\u0438\u043C\u0432\u043E\u043B\u0430 \u041A\u043E\u0434\u0421\u043F\u0440 \u041A\u043E\u043B\u041F\u043E\u0434\u0441\u0442\u0440 \u041A\u043E\u043B\u041F\u0440\u043E\u043F \u041A\u043E\u043D\u041C\u0435\u0441 \u041A\u043E\u043D\u0441\u0442 \u041A\u043E\u043D\u0441\u0442\u0415\u0441\u0442\u044C \u041A\u043E\u043D\u0441\u0442\u0417\u043D\u0430\u0447 \u041A\u043E\u043D\u0422\u0440\u0430\u043D \u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0424\u0430\u0439\u043B \u041A\u043E\u043F\u0438\u044F\u0421\u0442\u0440 \u041A\u041F\u0435\u0440\u0438\u043E\u0434 \u041A\u0421\u0442\u0440\u0422\u0431\u043B\u0421\u043F\u0440 \u041C\u0430\u043A\u0441 \u041C\u0430\u043A\u0441\u0421\u0442\u0440\u0422\u0431\u043B\u0421\u043F\u0440 \u041C\u0430\u0441\u0441\u0438\u0432 \u041C\u0435\u043D\u044E \u041C\u0435\u043D\u044E\u0420\u0430\u0441\u0448 \u041C\u0438\u043D \u041D\u0430\u0431\u043E\u0440\u0414\u0430\u043D\u043D\u044B\u0445\u041D\u0430\u0439\u0442\u0438\u0420\u0430\u0441\u0448 \u041D\u0430\u0438\u043C\u0412\u0438\u0434\u0421\u043F\u0440 \u041D\u0430\u0438\u043C\u041F\u043EAnalit \u041D\u0430\u0438\u043C\u0421\u043F\u0440 \u041D\u0430\u0441\u0442\u0440\u043E\u0438\u0442\u044C\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B\u0421\u0442\u0440\u043E\u043A \u041D\u0430\u0447\u041C\u0435\u0441 \u041D\u0430\u0447\u0422\u0440\u0430\u043D \u041D\u0438\u0436\u043D\u044F\u044F\u0413\u0440\u0430\u043D\u0438\u0446\u0430\u041C\u0430\u0441\u0441\u0438\u0432\u0430 \u041D\u043E\u043C\u0435\u0440\u0421\u043F\u0440 \u041D\u041F\u0435\u0440\u0438\u043E\u0434 \u041E\u043A\u043D\u043E \u041E\u043A\u0440 \u041E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u0435 \u041E\u0442\u043B\u0418\u043D\u0444\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u041E\u0442\u043B\u0418\u043D\u0444\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u041E\u0442\u0447\u0435\u0442 \u041E\u0442\u0447\u0435\u0442\u0410\u043D\u0430\u043B \u041E\u0442\u0447\u0435\u0442\u0418\u043D\u0442 \u041F\u0430\u043F\u043A\u0430\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u041F\u0430\u0443\u0437\u0430 \u041F\u0412\u044B\u0431\u043E\u0440SQL \u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C\u0424\u0430\u0439\u043B \u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 \u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0424\u0430\u0439\u043B \u041F\u043E\u0434\u0441\u0442\u0440 \u041F\u043E\u0438\u0441\u043A\u041F\u043E\u0434\u0441\u0442\u0440 \u041F\u043E\u0438\u0441\u043A\u0421\u0442\u0440 \u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0418\u0414\u0422\u0430\u0431\u043B\u0438\u0446\u044B \u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0418\u0414 \u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0418\u043C\u044F \u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0421\u0442\u0430\u0442\u0443\u0441 \u041F\u0440\u0435\u0440\u0432\u0430\u0442\u044C \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0417\u043D\u0430\u0447 \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C\u0423\u0441\u043B\u043E\u0432\u0438\u0435 \u0420\u0430\u0437\u0431\u0421\u0442\u0440 \u0420\u0430\u0437\u043D\u0412\u0440\u0435\u043C\u044F \u0420\u0430\u0437\u043D\u0414\u0430\u0442 \u0420\u0430\u0437\u043D\u0414\u0430\u0442\u0430\u0412\u0440\u0435\u043C\u044F \u0420\u0430\u0437\u043D\u0420\u0430\u0431\u0412\u0440\u0435\u043C\u044F \u0420\u0435\u0433\u0423\u0441\u0442\u0412\u0440\u0435\u043C \u0420\u0435\u0433\u0423\u0441\u0442\u0414\u0430\u0442 \u0420\u0435\u0433\u0423\u0441\u0442\u0427\u0441\u043B \u0420\u0435\u0434\u0422\u0435\u043A\u0441\u0442 \u0420\u0435\u0435\u0441\u0442\u0440\u0417\u0430\u043F\u0438\u0441\u044C \u0420\u0435\u0435\u0441\u0442\u0440\u0421\u043F\u0438\u0441\u043E\u043A\u0418\u043C\u0435\u043D\u041F\u0430\u0440\u0430\u043C \u0420\u0435\u0435\u0441\u0442\u0440\u0427\u0442\u0435\u043D\u0438\u0435 \u0420\u0435\u043A\u0432\u0421\u043F\u0440 \u0420\u0435\u043A\u0432\u0421\u043F\u0440\u041F\u0440 \u0421\u0435\u0433\u043E\u0434\u043D\u044F \u0421\u0435\u0439\u0447\u0430\u0441 \u0421\u0435\u0440\u0432\u0435\u0440 \u0421\u0435\u0440\u0432\u0435\u0440\u041F\u0440\u043E\u0446\u0435\u0441\u0441\u0418\u0414 \u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u0424\u0430\u0439\u043B\u0421\u0447\u0438\u0442\u0430\u0442\u044C \u0421\u0436\u041F\u0440\u043E\u0431 \u0421\u0438\u043C\u0432\u043E\u043B \u0421\u0438\u0441\u0442\u0435\u043C\u0430\u0414\u0438\u0440\u0435\u043A\u0442\u0443\u043C\u041A\u043E\u0434 \u0421\u0438\u0441\u0442\u0435\u043C\u0430\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0421\u0438\u0441\u0442\u0435\u043C\u0430\u041A\u043E\u0434 \u0421\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u0421\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0421\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0414\u0438\u0430\u043B\u043E\u0433 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0414\u0438\u0430\u043B\u043E\u0433\u0412\u044B\u0431\u043E\u0440\u0430\u0418\u0437\u0414\u0432\u0443\u0445\u0421\u043F\u0438\u0441\u043A\u043E\u0432 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0414\u0438\u0430\u043B\u043E\u0433\u0412\u044B\u0431\u043E\u0440\u0430\u041F\u0430\u043F\u043A\u0438 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0414\u0438\u0430\u043B\u043E\u0433\u041E\u0442\u043A\u0440\u044B\u0442\u0438\u044F\u0424\u0430\u0439\u043B\u0430 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0414\u0438\u0430\u043B\u043E\u0433\u0421\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F\u0424\u0430\u0439\u043B\u0430 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0417\u0430\u043F\u0440\u043E\u0441 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0418\u043D\u0434\u0438\u043A\u0430\u0442\u043E\u0440 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0418\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439\u0421\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041C\u0430\u0441\u0441\u0438\u0432 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041D\u0430\u0431\u043E\u0440\u0414\u0430\u043D\u043D\u044B\u0445 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041E\u0431\u044A\u0435\u043A\u0442 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041E\u0442\u0447\u0435\u0442 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041F\u0430\u043F\u043A\u0443 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0420\u0435\u0434\u0430\u043A\u0442\u043E\u0440 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0421\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0421\u043F\u0438\u0441\u043E\u043A \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0421\u043F\u0438\u0441\u043E\u043A\u0421\u0442\u0440\u043E\u043A \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0421\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0439 \u0421\u043E\u0437\u0434\u0421\u043F\u0440 \u0421\u043E\u0441\u0442\u0421\u043F\u0440 \u0421\u043E\u0445\u0440 \u0421\u043E\u0445\u0440\u0421\u043F\u0440 \u0421\u043F\u0438\u0441\u043E\u043A\u0421\u0438\u0441\u0442\u0435\u043C \u0421\u043F\u0440 \u0421\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A \u0421\u043F\u0440\u0411\u043B\u043E\u043A\u0415\u0441\u0442\u044C \u0421\u043F\u0440\u0411\u043B\u043E\u043A\u0421\u043D\u044F\u0442\u044C \u0421\u043F\u0440\u0411\u043B\u043E\u043A\u0421\u043D\u044F\u0442\u044C\u0420\u0430\u0441\u0448 \u0421\u043F\u0440\u0411\u043B\u043E\u043A\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0421\u043F\u0440\u0418\u0437\u043C\u041D\u0430\u0431\u0414\u0430\u043D \u0421\u043F\u0440\u041A\u043E\u0434 \u0421\u043F\u0440\u041D\u043E\u043C\u0435\u0440 \u0421\u043F\u0440\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0421\u043F\u0440\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0421\u043F\u0440\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0421\u043F\u0440\u041F\u0430\u0440\u0430\u043C \u0421\u043F\u0440\u041F\u043E\u043B\u0435\u0417\u043D\u0430\u0447 \u0421\u043F\u0440\u041F\u043E\u043B\u0435\u0418\u043C\u044F \u0421\u043F\u0440\u0420\u0435\u043A\u0432 \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u0412\u0432\u0435\u0434\u0417\u043D \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u041D\u043E\u0432\u044B\u0435 \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u041F\u0440 \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u041F\u0440\u0435\u0434\u0417\u043D \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u0420\u0435\u0436\u0438\u043C \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u0422\u0438\u043F\u0422\u0435\u043A\u0441\u0442 \u0421\u043F\u0440\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0421\u043F\u0440\u0421\u043E\u0441\u0442 \u0421\u043F\u0440\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0421\u043F\u0440\u0422\u0431\u043B\u0418\u0442\u043E\u0433 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u041A\u043E\u043B \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u041C\u0430\u043A\u0441 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u041C\u0438\u043D \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u041F\u0440\u0435\u0434 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u0421\u043B\u0435\u0434 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u0421\u043E\u0437\u0434 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u0423\u0434 \u0421\u043F\u0440\u0422\u0435\u043A\u041F\u0440\u0435\u0434\u0441\u0442 \u0421\u043F\u0440\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0421\u0440\u0430\u0432\u043D\u0438\u0442\u044C\u0421\u0442\u0440 \u0421\u0442\u0440\u0412\u0435\u0440\u0445\u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u0421\u0442\u0440\u041D\u0438\u0436\u043D\u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u0421\u0442\u0440\u0422\u0431\u043B\u0421\u043F\u0440 \u0421\u0443\u043C\u041F\u0440\u043E\u043F \u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0439 \u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0439\u041F\u0430\u0440\u0430\u043C \u0422\u0435\u043A\u0412\u0435\u0440\u0441\u0438\u044F \u0422\u0435\u043A\u041E\u0440\u0433 \u0422\u043E\u0447\u043D \u0422\u0440\u0430\u043D \u0422\u0440\u0430\u043D\u0441\u043B\u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044F \u0423\u0434\u0430\u043B\u0438\u0442\u044C\u0422\u0430\u0431\u043B\u0438\u0446\u0443 \u0423\u0434\u0430\u043B\u0438\u0442\u044C\u0424\u0430\u0439\u043B \u0423\u0434\u0421\u043F\u0440 \u0423\u0434\u0421\u0442\u0440\u0422\u0431\u043B\u0421\u043F\u0440 \u0423\u0441\u0442 \u0423\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438\u041A\u043E\u043D\u0441\u0442\u0430\u043D\u0442 \u0424\u0430\u0439\u043B\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u0421\u0447\u0438\u0442\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0424\u0430\u0439\u043B\u0412\u0440\u0435\u043C\u044F \u0424\u0430\u0439\u043B\u0412\u0440\u0435\u043C\u044F\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0424\u0430\u0439\u043B\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0417\u0430\u043D\u044F\u0442 \u0424\u0430\u0439\u043B\u0417\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0418\u0441\u043A\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u041C\u043E\u0436\u043D\u043E\u0427\u0438\u0442\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0424\u0430\u0439\u043B\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u041F\u0435\u0440\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u0424\u0430\u0439\u043B\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0424\u0430\u0439\u043B\u0420\u0430\u0437\u043C\u0435\u0440 \u0424\u0430\u0439\u043B\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0421\u0441\u044B\u043B\u043A\u0430\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0424\u0430\u0439\u043B\u0421\u0447\u0438\u0442\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0424\u043C\u0442SQL\u0414\u0430\u0442 \u0424\u043C\u0442\u0414\u0430\u0442 \u0424\u043C\u0442\u0421\u0442\u0440 \u0424\u043C\u0442\u0427\u0441\u043B \u0424\u043E\u0440\u043C\u0430\u0442 \u0426\u041C\u0430\u0441\u0441\u0438\u0432\u042D\u043B\u0435\u043C\u0435\u043D\u0442 \u0426\u041D\u0430\u0431\u043E\u0440\u0414\u0430\u043D\u043D\u044B\u0445\u0420\u0435\u043A\u0432\u0438\u0437\u0438\u0442 \u0426\u041F\u043E\u0434\u0441\u0442\u0440 ",aa="AltState Application CallType ComponentTokens CreatedJobs CreatedNotices ControlState DialogResult Dialogs EDocuments EDocumentVersionSource Folders GlobalIDs Job Jobs InputValue LookUpReference LookUpRequisiteNames LookUpSearch Object ParentComponent Processes References Requisite ReportName Reports Result Scripts Searches SelectedAttachments SelectedItems SelectMode Sender ServerEvents ServiceFactory ShiftState SubTask SystemDialogs Tasks Wizard Wizards Work \u0412\u044B\u0437\u043E\u0432\u0421\u043F\u043E\u0441\u043E\u0431 \u0418\u043C\u044F\u041E\u0442\u0447\u0435\u0442\u0430 \u0420\u0435\u043A\u0432\u0417\u043D\u0430\u0447 ",ca="IApplication IAccessRights IAccountRepository IAccountSelectionRestrictions IAction IActionList IAdministrationHistoryDescription IAnchors IApplication IArchiveInfo IAttachment IAttachmentList ICheckListBox ICheckPointedList IColumn IComponent IComponentDescription IComponentToken IComponentTokenFactory IComponentTokenInfo ICompRecordInfo IConnection IContents IControl IControlJob IControlJobInfo IControlList ICrypto ICrypto2 ICustomJob ICustomJobInfo ICustomListBox ICustomObjectWizardStep ICustomWork ICustomWorkInfo IDataSet IDataSetAccessInfo IDataSigner IDateCriterion IDateRequisite IDateRequisiteDescription IDateValue IDeaAccessRights IDeaObjectInfo IDevelopmentComponentLock IDialog IDialogFactory IDialogPickRequisiteItems IDialogsFactory IDICSFactory IDocRequisite IDocumentInfo IDualListDialog IECertificate IECertificateInfo IECertificates IEditControl IEditorForm IEdmsExplorer IEdmsObject IEdmsObjectDescription IEdmsObjectFactory IEdmsObjectInfo IEDocument IEDocumentAccessRights IEDocumentDescription IEDocumentEditor IEDocumentFactory IEDocumentInfo IEDocumentStorage IEDocumentVersion IEDocumentVersionListDialog IEDocumentVersionSource IEDocumentWizardStep IEDocVerSignature IEDocVersionState IEnabledMode IEncodeProvider IEncrypter IEvent IEventList IException IExternalEvents IExternalHandler IFactory IField IFileDialog IFolder IFolderDescription IFolderDialog IFolderFactory IFolderInfo IForEach IForm IFormTitle IFormWizardStep IGlobalIDFactory IGlobalIDInfo IGrid IHasher IHistoryDescription IHyperLinkControl IImageButton IImageControl IInnerPanel IInplaceHint IIntegerCriterion IIntegerList IIntegerRequisite IIntegerValue IISBLEditorForm IJob IJobDescription IJobFactory IJobForm IJobInfo ILabelControl ILargeIntegerCriterion ILargeIntegerRequisite ILargeIntegerValue ILicenseInfo ILifeCycleStage IList IListBox ILocalIDInfo ILocalization ILock IMemoryDataSet IMessagingFactory IMetadataRepository INotice INoticeInfo INumericCriterion INumericRequisite INumericValue IObject IObjectDescription IObjectImporter IObjectInfo IObserver IPanelGroup IPickCriterion IPickProperty IPickRequisite IPickRequisiteDescription IPickRequisiteItem IPickRequisiteItems IPickValue IPrivilege IPrivilegeList IProcess IProcessFactory IProcessMessage IProgress IProperty IPropertyChangeEvent IQuery IReference IReferenceCriterion IReferenceEnabledMode IReferenceFactory IReferenceHistoryDescription IReferenceInfo IReferenceRecordCardWizardStep IReferenceRequisiteDescription IReferencesFactory IReferenceValue IRefRequisite IReport IReportFactory IRequisite IRequisiteDescription IRequisiteDescriptionList IRequisiteFactory IRichEdit IRouteStep IRule IRuleList ISchemeBlock IScript IScriptFactory ISearchCriteria ISearchCriterion ISearchDescription ISearchFactory ISearchFolderInfo ISearchForObjectDescription ISearchResultRestrictions ISecuredContext ISelectDialog IServerEvent IServerEventFactory IServiceDialog IServiceFactory ISignature ISignProvider ISignProvider2 ISignProvider3 ISimpleCriterion IStringCriterion IStringList IStringRequisite IStringRequisiteDescription IStringValue ISystemDialogsFactory ISystemInfo ITabSheet ITask ITaskAbortReasonInfo ITaskCardWizardStep ITaskDescription ITaskFactory ITaskInfo ITaskRoute ITextCriterion ITextRequisite ITextValue ITreeListSelectDialog IUser IUserList IValue IView IWebBrowserControl IWizard IWizardAction IWizardFactory IWizardFormElement IWizardParam IWizardPickParam IWizardReferenceParam IWizardStep IWorkAccessRights IWorkDescription IWorkflowAskableParam IWorkflowAskableParams IWorkflowBlock IWorkflowBlockResult IWorkflowEnabledMode IWorkflowParam IWorkflowPickParam IWorkflowReferenceParam IWorkState IWorkTreeCustomNode IWorkTreeJobNode IWorkTreeTaskNode IXMLEditorForm SBCrypto ",vd=se+oa,Gn=aa,Ep="null true false nil ",bp={className:"number",begin:t.NUMBER_RE,relevance:0},rs={className:"string",variants:[{begin:'"',end:'"'},{begin:"'",end:"'"}]},Rd={className:"doctag",begin:"\\b(?:TODO|DONE|BEGIN|END|STUB|CHG|FIXME|NOTE|BUG|XXX)\\b",relevance:0},_p={className:"comment",begin:"//",end:"$",relevance:0,contains:[t.PHRASAL_WORDS_MODE,Rd]},wb={className:"comment",begin:"/\\*",end:"\\*/",relevance:0,contains:[t.PHRASAL_WORDS_MODE,Rd]},$a={variants:[_p,wb]},Cl={$pattern:e,keyword:r,built_in:vd,class:Gn,literal:Ep},dh={begin:"\\.\\s*"+t.UNDERSCORE_IDENT_RE,keywords:Cl,relevance:0},sd={className:"type",begin:":[ \\t]*("+ca.trim().replace(/\s/g,"|")+")",end:"[ \\t]*=",excludeEnd:!0},uc={className:"variable",keywords:Cl,begin:e,relevance:0,contains:[sd,dh]},im=n+"\\(";return{name:"ISBL",case_insensitive:!0,keywords:Cl,illegal:"\\$|\\?|%|,|;$|~|#|@|{p();function vss(t){let n={className:"params",begin:/\(/,end:/\)/,contains:[{begin:/[\w-]+ *=/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/[\w-]+/}]}],relevance:0},r={className:"function",begin:/:[\w\-.]+/,relevance:0},s={className:"string",begin:/\B([\/.])[\w\-.\/=]+/},i={className:"params",begin:/--[\w\-=\/]+/};return{name:"JBoss CLI",aliases:["wildfly-cli"],keywords:{$pattern:"[a-z-]+",keyword:"alias batch cd clear command connect connection-factory connection-info data-source deploy deployment-info deployment-overlay echo echo-dmr help history if jdbc-driver-info jms-queue|20 jms-topic|20 ls patch pwd quit read-attribute read-operation reload rollout-plan run-batch set shutdown try unalias undeploy unset version xa-data-source",literal:"true false"},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,i,r,s,n]}}Nln.exports=vss});var Pln=ee((ODa,Bln)=>{p();function Rss(t){let e={literal:"true false null"},n=[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],r=[t.QUOTE_STRING_MODE,t.C_NUMBER_MODE],s={end:",",endsWithParent:!0,excludeEnd:!0,contains:r,keywords:e},i={begin:/\{/,end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE],illegal:"\\n"},t.inherit(s,{begin:/:/})].concat(n),illegal:"\\S"},o={begin:"\\[",end:"\\]",contains:[t.inherit(s)],illegal:"\\S"};return r.push(i,o),n.forEach(function(a){r.push(a)}),{name:"JSON",contains:r,keywords:e,illegal:"\\S"}}Bln.exports=Rss});var Mln=ee((LDa,Oln)=>{p();function kss(t){var e="[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*",n=["baremodule","begin","break","catch","ccall","const","continue","do","else","elseif","end","export","false","finally","for","function","global","if","import","in","isa","let","local","macro","module","quote","return","true","try","using","where","while"],r=["ARGS","C_NULL","DEPOT_PATH","ENDIAN_BOM","ENV","Inf","Inf16","Inf32","Inf64","InsertionSort","LOAD_PATH","MergeSort","NaN","NaN16","NaN32","NaN64","PROGRAM_FILE","QuickSort","RoundDown","RoundFromZero","RoundNearest","RoundNearestTiesAway","RoundNearestTiesUp","RoundToZero","RoundUp","VERSION|0","devnull","false","im","missing","nothing","pi","stderr","stdin","stdout","true","undef","\u03C0","\u212F"],s=["AbstractArray","AbstractChannel","AbstractChar","AbstractDict","AbstractDisplay","AbstractFloat","AbstractIrrational","AbstractMatrix","AbstractRange","AbstractSet","AbstractString","AbstractUnitRange","AbstractVecOrMat","AbstractVector","Any","ArgumentError","Array","AssertionError","BigFloat","BigInt","BitArray","BitMatrix","BitSet","BitVector","Bool","BoundsError","CapturedException","CartesianIndex","CartesianIndices","Cchar","Cdouble","Cfloat","Channel","Char","Cint","Cintmax_t","Clong","Clonglong","Cmd","Colon","Complex","ComplexF16","ComplexF32","ComplexF64","CompositeException","Condition","Cptrdiff_t","Cshort","Csize_t","Cssize_t","Cstring","Cuchar","Cuint","Cuintmax_t","Culong","Culonglong","Cushort","Cvoid","Cwchar_t","Cwstring","DataType","DenseArray","DenseMatrix","DenseVecOrMat","DenseVector","Dict","DimensionMismatch","Dims","DivideError","DomainError","EOFError","Enum","ErrorException","Exception","ExponentialBackOff","Expr","Float16","Float32","Float64","Function","GlobalRef","HTML","IO","IOBuffer","IOContext","IOStream","IdDict","IndexCartesian","IndexLinear","IndexStyle","InexactError","InitError","Int","Int128","Int16","Int32","Int64","Int8","Integer","InterruptException","InvalidStateException","Irrational","KeyError","LinRange","LineNumberNode","LinearIndices","LoadError","MIME","Matrix","Method","MethodError","Missing","MissingException","Module","NTuple","NamedTuple","Nothing","Number","OrdinalRange","OutOfMemoryError","OverflowError","Pair","PartialQuickSort","PermutedDimsArray","Pipe","ProcessFailedException","Ptr","QuoteNode","Rational","RawFD","ReadOnlyMemoryError","Real","ReentrantLock","Ref","Regex","RegexMatch","RoundingMode","SegmentationFault","Set","Signed","Some","StackOverflowError","StepRange","StepRangeLen","StridedArray","StridedMatrix","StridedVecOrMat","StridedVector","String","StringIndexError","SubArray","SubString","SubstitutionString","Symbol","SystemError","Task","TaskFailedException","Text","TextDisplay","Timer","Tuple","Type","TypeError","TypeVar","UInt","UInt128","UInt16","UInt32","UInt64","UInt8","UndefInitializer","UndefKeywordError","UndefRefError","UndefVarError","Union","UnionAll","UnitRange","Unsigned","Val","Vararg","VecElement","VecOrMat","Vector","VersionNumber","WeakKeyDict","WeakRef"],i={$pattern:e,keyword:n,literal:r,built_in:s},o={keywords:i,illegal:/<\//},a={className:"number",begin:/(\b0x[\d_]*(\.[\d_]*)?|0x\.\d[\d_]*)p[-+]?\d+|\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\b\d[\d_]*(\.[\d_]*)?|\.\d[\d_]*)([eEfF][-+]?\d+)?/,relevance:0},c={className:"string",begin:/'(.|\\[xXuU][a-zA-Z0-9]+)'/},u={className:"subst",begin:/\$\(/,end:/\)/,keywords:i},l={className:"variable",begin:"\\$"+e},d={className:"string",contains:[t.BACKSLASH_ESCAPE,u,l],variants:[{begin:/\w*"""/,end:/"""\w*/,relevance:10},{begin:/\w*"/,end:/"\w*/}]},h={className:"string",contains:[t.BACKSLASH_ESCAPE,u,l],begin:"`",end:"`"},m={className:"meta",begin:"@"+e},f={className:"comment",variants:[{begin:"#=",end:"=#",relevance:10},{begin:"#",end:"$"}]};return o.name="Julia",o.contains=[a,c,d,h,m,f,t.HASH_COMMENT_MODE,{className:"keyword",begin:"\\b(((abstract|primitive)\\s+)type|(mutable\\s+)?struct)\\b"},{begin:/<:/}],u.contains=o.contains,o}Oln.exports=kss});var Fln=ee((QDa,Lln)=>{p();function Nss(t){return{name:"Julia REPL",contains:[{className:"meta",begin:/^julia>/,relevance:10,starts:{end:/^(?![ ]{6})/,subLanguage:"julia"},aliases:["jldoctest"]}]}}Lln.exports=Nss});var Uln=ee(($Da,Qln)=>{p();function Dss(t){let e="[a-zA-Z_][\\w.]*",n="<\\?(lasso(script)?|=)",r="\\]|\\?>",s={$pattern:e+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},i=t.COMMENT("",{relevance:0}),o={className:"meta",begin:"\\[noprocess\\]",starts:{end:"\\[/noprocess\\]",returnEnd:!0,contains:[i]}},a={className:"meta",begin:"\\[/noprocess|"+n},c={className:"symbol",begin:"'"+e+"'"},u=[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.inherit(t.C_NUMBER_MODE,{begin:t.C_NUMBER_RE+"|(-?infinity|NaN)\\b"}),t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"`",end:"`"},{variants:[{begin:"[#$]"+e},{begin:"#",end:"\\d+",illegal:"\\W"}]},{className:"type",begin:"::\\s*",end:e,illegal:"\\W"},{className:"params",variants:[{begin:"-(?!infinity)"+e,relevance:0},{begin:"(\\.\\.\\.)"}]},{begin:/(->|\.)\s*/,relevance:0,contains:[c]},{className:"class",beginKeywords:"define",returnEnd:!0,end:"\\(|=>",contains:[t.inherit(t.TITLE_MODE,{begin:e+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:s,contains:[{className:"meta",begin:r,relevance:0,starts:{end:"\\[|"+n,returnEnd:!0,relevance:0,contains:[i]}},o,a,{className:"meta",begin:"\\[no_square_brackets",starts:{end:"\\[/no_square_brackets\\]",keywords:s,contains:[{className:"meta",begin:r,relevance:0,starts:{end:"\\[noprocess\\]|"+n,returnEnd:!0,contains:[i]}},o,a].concat(u)}},{className:"meta",begin:"\\[",relevance:0},{className:"meta",begin:"^#!",end:"lasso9$",relevance:10}].concat(u)}}Qln.exports=Dss});var Gln=ee((WDa,$ln)=>{p();function Bss(t){return t?typeof t=="string"?t:t.source:null}function Pss(...t){return"("+t.map(n=>Bss(n)).join("|")+")"}function Oss(t){let e=Pss(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(N=>N+"(?![a-zA-Z@:_])")),n=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}","[qs]__?[a-zA-Z](?:_?[a-zA-Z])+","use(?:_i)?:[a-zA-Z]*","(?:else|fi|or):","(?:if|cs|exp):w","(?:hbox|vbox):n","::[a-zA-Z]_unbraced","::[a-zA-Z:]"].map(N=>N+"(?![a-zA-Z:_])").join("|")),r=[{begin:/[a-zA-Z@]+/},{begin:/[^a-zA-Z@]?/}],s=[{begin:/\^{6}[0-9a-f]{6}/},{begin:/\^{5}[0-9a-f]{5}/},{begin:/\^{4}[0-9a-f]{4}/},{begin:/\^{3}[0-9a-f]{3}/},{begin:/\^{2}[0-9a-f]{2}/},{begin:/\^{2}[\u0000-\u007f]/}],i={className:"keyword",begin:/\\/,relevance:0,contains:[{endsParent:!0,begin:e},{endsParent:!0,begin:n},{endsParent:!0,variants:s},{endsParent:!0,relevance:0,variants:r}]},o={className:"params",relevance:0,begin:/#+\d?/},a={variants:s},c={className:"built_in",relevance:0,begin:/[$&^_]/},u={className:"meta",begin:"% !TeX",end:"$",relevance:10},l=t.COMMENT("%","$",{relevance:0}),d=[i,o,a,c,u,l],h={begin:/\{/,end:/\}/,relevance:0,contains:["self",...d]},m=t.inherit(h,{relevance:0,endsParent:!0,contains:[h,...d]}),f={begin:/\[/,end:/\]/,endsParent:!0,relevance:0,contains:[h,...d]},g={begin:/\s+/,relevance:0},A=[m],y=[f],b=function(N,P){return{contains:[g],starts:{relevance:0,contains:N,starts:P}}},S=function(N,P){return{begin:"\\\\"+N+"(?![a-zA-Z@:_])",keywords:{$pattern:/\\[a-zA-Z]+/,keyword:"\\"+N},relevance:0,contains:[g],starts:P}},C=function(N,P){return t.inherit({begin:"\\\\begin(?=[ ]*(\\r?\\n[ ]*)?\\{"+N+"\\})",keywords:{$pattern:/\\[a-zA-Z]+/,keyword:"\\begin"},relevance:0},b(A,P))},I=(N="string")=>t.END_SAME_AS_BEGIN({className:N,begin:/(.|\r?\n)/,end:/(.|\r?\n)/,excludeBegin:!0,excludeEnd:!0,endsParent:!0}),x=function(N){return{className:"string",end:"(?=\\\\end\\{"+N+"\\})"}},w=(N="string")=>({relevance:0,begin:/\{/,starts:{endsParent:!0,contains:[{className:N,end:/(?=\})/,endsParent:!0,contains:[{begin:/\{/,end:/\}/,relevance:0,contains:["self"]}]}]}}),R=[...["verb","lstinline"].map(N=>S(N,{contains:[I()]})),S("mint",b(A,{contains:[I()]})),S("mintinline",b(A,{contains:[w(),I()]})),S("url",{contains:[w("link"),w("link")]}),S("hyperref",{contains:[w("link")]}),S("href",b(y,{contains:[w("link")]})),...[].concat(...["","\\*"].map(N=>[C("verbatim"+N,x("verbatim"+N)),C("filecontents"+N,b(A,x("filecontents"+N))),...["","B","L"].map(P=>C(P+"Verbatim"+N,b(y,x(P+"Verbatim"+N))))])),C("minted",b(y,b(A,x("minted"))))];return{name:"LaTeX",aliases:["tex"],contains:[...R,...d]}}$ln.exports=Oss});var qln=ee((HDa,Wln)=>{p();function Mss(t){return{name:"LDIF",contains:[{className:"attribute",begin:"^dn",end:": ",excludeEnd:!0,starts:{end:"$",relevance:0},relevance:10},{className:"attribute",begin:"^\\w",end:": ",excludeEnd:!0,starts:{end:"$",relevance:0}},{className:"literal",begin:"^-",end:"$"},t.HASH_COMMENT_MODE]}}Wln.exports=Mss});var Vln=ee((jDa,Hln)=>{p();function Lss(t){return{name:"Leaf",contains:[{className:"function",begin:"#+[A-Za-z_0-9]*\\(",end:/ \{/,returnBegin:!0,excludeEnd:!0,contains:[{className:"keyword",begin:"#+"},{className:"title",begin:"[A-Za-z_][A-Za-z_0-9]*"},{className:"params",begin:"\\(",end:"\\)",endsParent:!0,contains:[{className:"string",begin:'"',end:'"'},{className:"variable",begin:"[A-Za-z_][A-Za-z_0-9]*"}]}]}]}}Hln.exports=Lss});var zln=ee((KDa,Kln)=>{p();var Fss=t=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]}}),Qss=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Uss=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],jln=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Yln=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],$ss=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse(),Gss=jln.concat(Yln);function Wss(t){let e=Fss(t),n=Gss,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",o=[],a=[],c=function(S){return{className:"string",begin:"~?"+S+".*?"+S}},u=function(S,C,I){return{className:S,begin:C,relevance:I}},l={$pattern:/[a-z-]+/,keyword:r,attribute:Uss.join(" ")},d={begin:"\\(",end:"\\)",contains:a,keywords:l,relevance:0};a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,u("variable","@@?"+s,10),u("variable","@\\{"+s+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT);let h=a.concat({begin:/\{/,end:/\}/,contains:o}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},f={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},{className:"attribute",begin:"\\b("+$ss.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:a,relevance:0}},A={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,u("keyword","all\\b"),u("variable","@\\{"+s+"\\}"),{begin:"\\b("+Qss.join("|")+")\\b",className:"selector-tag"},u("selector-tag",i+"%?",0),u("selector-id","#"+i),u("selector-class","\\."+i,0),u("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+jln.join("|")+")"},{className:"selector-pseudo",begin:"::("+Yln.join("|")+")"},{begin:"\\(",end:"\\)",contains:h},{begin:"!important"}]},b={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,A,b,f,y),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}Kln.exports=Wss});var Xln=ee((JDa,Jln)=>{p();function qss(t){var e="[a-zA-Z_\\-+\\*\\/<=>&#][a-zA-Z0-9_\\-+*\\/<=>&#!]*",n="\\|[^]*?\\|",r="(-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|-)?\\d+)?",s={className:"literal",begin:"\\b(t{1}|nil)\\b"},i={className:"number",variants:[{begin:r,relevance:0},{begin:"#(b|B)[0-1]+(/[0-1]+)?"},{begin:"#(o|O)[0-7]+(/[0-7]+)?"},{begin:"#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?"},{begin:"#(c|C)\\("+r+" +"+r,end:"\\)"}]},o=t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),a=t.COMMENT(";","$",{relevance:0}),c={begin:"\\*",end:"\\*"},u={className:"symbol",begin:"[:&]"+e},l={begin:e,relevance:0},d={begin:n},h={begin:"\\(",end:"\\)",contains:["self",s,o,i,l]},m={contains:[i,o,c,u,h,l],variants:[{begin:"['`]\\(",end:"\\)"},{begin:"\\(quote ",end:"\\)",keywords:{name:"quote"}},{begin:"'"+n}]},f={variants:[{begin:"'"+e},{begin:"#'"+e+"(::"+e+")*"}]},g={begin:"\\(\\s*",end:"\\)"},A={endsWithParent:!0,relevance:0};return g.contains=[{className:"name",variants:[{begin:e,relevance:0},{begin:n}]},A],A.contains=[m,f,g,s,i,o,a,c,u,d,l],{name:"Lisp",illegal:/\S/,contains:[i,t.SHEBANG(),s,o,a,m,f,g,l]}}Jln.exports=qss});var eun=ee((ZDa,Zln)=>{p();function Hss(t){let e={className:"variable",variants:[{begin:"\\b([gtps][A-Z]{1}[a-zA-Z0-9]*)(\\[.+\\])?(?:\\s*?)"},{begin:"\\$_[A-Z]+"}],relevance:0},n=[t.C_BLOCK_COMMENT_MODE,t.HASH_COMMENT_MODE,t.COMMENT("--","$"),t.COMMENT("[^:]//","$")],r=t.inherit(t.TITLE_MODE,{variants:[{begin:"\\b_*rig[A-Z][A-Za-z0-9_\\-]*"},{begin:"\\b_[a-z0-9\\-]+"}]}),s=t.inherit(t.TITLE_MODE,{begin:"\\b([A-Za-z0-9_\\-]+)\\b"});return{name:"LiveCode",case_insensitive:!1,keywords:{keyword:"$_COOKIE $_FILES $_GET $_GET_BINARY $_GET_RAW $_POST $_POST_BINARY $_POST_RAW $_SESSION $_SERVER codepoint codepoints segment segments codeunit codeunits sentence sentences trueWord trueWords paragraph after byte bytes english the until http forever descending using line real8 with seventh for stdout finally element word words fourth before black ninth sixth characters chars stderr uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat end repeat URL in try into switch to words https token binfile each tenth as ticks tick system real4 by dateItems without char character ascending eighth whole dateTime numeric short first ftp integer abbreviated abbr abbrev private case while if div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within contains ends with begins the keys of keys",literal:"SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five quote empty one true return cr linefeed right backslash null seven tab three two RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK",built_in:"put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg avgDev base64Decode base64Encode baseConvert binaryDecode binaryEncode byteOffset byteToNum cachedURL cachedURLs charToNum cipherNames codepointOffset codepointProperty codepointToNum codeunitOffset commandNames compound compress constantNames cos date dateFormat decompress difference directories diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames geometricMean global globals hasMemory harmonicMean hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge messageAuthenticationCode messageDigest millisec millisecs millisecond milliseconds min monthNames nativeCharToNum normalizeText num number numToByte numToChar numToCodepoint numToNativeChar offset open openfiles openProcesses openProcessIDs openSockets paragraphOffset paramCount param params peerAddress pendingMessages platform popStdDev populationStandardDeviation populationVariance popVariance processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLCreateTreeFromFileWithNamespaces revXMLCreateTreeWithNamespaces revXMLDataFromXPathQuery revXMLEvaluateXPath revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_Execute revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sampVariance sec secs seconds sentenceOffset sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound stdDev sum sysError systemVersion tan tempName textDecode textEncode tick ticks time to tokenOffset toLower toUpper transpose truewordOffset trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus uuid value variableNames variance version waitDepth weekdayNames wordOffset xsltApplyStylesheet xsltApplyStylesheetFromFile xsltLoadStylesheet xsltLoadStylesheetFromFile add breakpoint cancel clear local variable file word line folder directory URL close socket process combine constant convert create new alias folder directory decrypt delete variable word line folder directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback libURLSetDriver libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime libURLSetStatusCallback load extension loadedExtensions multiply socket prepare process post seek rel relative read from process rename replace require resetAll resolve revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split start stop subtract symmetric union unload vectorDotProduct wait write"},contains:[e,{className:"keyword",begin:"\\bend\\sif\\b"},{className:"function",beginKeywords:"function",end:"$",contains:[e,s,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE,r]},{className:"function",begin:"\\bend\\s+",end:"$",keywords:"end",contains:[s,r],relevance:0},{beginKeywords:"command on",end:"$",contains:[e,s,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE,r]},{className:"meta",variants:[{begin:"<\\?(rev|lc|livecode)",relevance:10},{begin:"<\\?"},{begin:"\\?>"}]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE,r].concat(n),illegal:";$|^\\[|^=|&|\\{"}}Zln.exports=Hss});var nun=ee((t1a,tun)=>{p();var Vss=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],jss=["true","false","null","undefined","NaN","Infinity"],Yss=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],Kss=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],zss=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Jss=["arguments","this","super","console","window","document","localStorage","module","global"],Xss=[].concat(zss,Jss,Yss,Kss);function Zss(t){let e=["npm","print"],n=["yes","no","on","off","it","that","void"],r=["then","unless","until","loop","of","by","when","and","or","is","isnt","not","it","that","otherwise","from","to","til","fallthrough","case","enum","native","list","map","__hasProp","__extends","__slice","__bind","__indexOf"],s={keyword:Vss.concat(r),literal:jss.concat(n),built_in:Xss.concat(e)},i="[A-Za-z$_](?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*",o=t.inherit(t.TITLE_MODE,{begin:i}),a={className:"subst",begin:/#\{/,end:/\}/,keywords:s},c={className:"subst",begin:/#[A-Za-z$_]/,end:/(?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*/,keywords:s},u=[t.BINARY_NUMBER_MODE,{className:"number",begin:"(\\b0[xX][a-fA-F0-9_]+)|(\\b\\d(\\d|_\\d)*(\\.(\\d(\\d|_\\d)*)?)?(_*[eE]([-+]\\d(_\\d|\\d)*)?)?[_a-z]*)",relevance:0,starts:{end:"(\\s*/)?",relevance:0}},{className:"string",variants:[{begin:/'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[t.BACKSLASH_ESCAPE]},{begin:/"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,a,c]},{begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,a,c]},{begin:/\\/,end:/(\s|$)/,excludeEnd:!0}]},{className:"regexp",variants:[{begin:"//",end:"//[gim]*",contains:[a,t.HASH_COMMENT_MODE]},{begin:/\/(?![ *])(\\.|[^\\\n])*?\/[gim]*(?=\W)/}]},{begin:"@"+i},{begin:"``",end:"``",excludeBegin:!0,excludeEnd:!0,subLanguage:"javascript"}];a.contains=u;let l={className:"params",begin:"\\(",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(u)}]},d={begin:"(#=>|=>|\\|>>|-?->|!->)"};return{name:"LiveScript",aliases:["ls"],keywords:s,illegal:/\/\*/,contains:u.concat([t.COMMENT("\\/\\*","\\*\\/"),t.HASH_COMMENT_MODE,d,{className:"function",contains:[o,l],returnBegin:!0,variants:[{begin:"("+i+"\\s*(?:=|:=)\\s*)?(\\(.*\\)\\s*)?\\B->\\*?",end:"->\\*?"},{begin:"("+i+"\\s*(?:=|:=)\\s*)?!?(\\(.*\\)\\s*)?\\B[-~]{1,2}>\\*?",end:"[-~]{1,2}>\\*?"},{begin:"("+i+"\\s*(?:=|:=)\\s*)?(\\(.*\\)\\s*)?\\B!?[-~]{1,2}>\\*?",end:"!?[-~]{1,2}>\\*?"}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[o]},o]},{begin:i+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}tun.exports=Zss});var sun=ee((r1a,run)=>{p();function eis(t){return t?typeof t=="string"?t:t.source:null}function f_e(...t){return t.map(n=>eis(n)).join("")}function tis(t){let e=/([-a-zA-Z$._][\w$.-]*)/,n={className:"type",begin:/\bi\d+(?=\s|\b)/},r={className:"operator",relevance:0,begin:/=/},s={className:"punctuation",relevance:0,begin:/,/},i={className:"number",variants:[{begin:/0[xX][a-fA-F0-9]+/},{begin:/-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?/}],relevance:0},o={className:"symbol",variants:[{begin:/^\s*[a-z]+:/}],relevance:0},a={className:"variable",variants:[{begin:f_e(/%/,e)},{begin:/%\d+/},{begin:/#\d+/}]},c={className:"title",variants:[{begin:f_e(/@/,e)},{begin:/@\d+/},{begin:f_e(/!/,e)},{begin:f_e(/!\d+/,e)},{begin:/!\d+/}]};return{name:"LLVM IR",keywords:"begin end true false declare define global constant private linker_private internal available_externally linkonce linkonce_odr weak weak_odr appending dllimport dllexport common default hidden protected extern_weak external thread_local zeroinitializer undef null to tail target triple datalayout volatile nuw nsw nnan ninf nsz arcp fast exact inbounds align addrspace section alias module asm sideeffect gc dbg linker_private_weak attributes blockaddress initialexec localdynamic localexec prefix unnamed_addr ccc fastcc coldcc x86_stdcallcc x86_fastcallcc arm_apcscc arm_aapcscc arm_aapcs_vfpcc ptx_device ptx_kernel intel_ocl_bicc msp430_intrcc spir_func spir_kernel x86_64_sysvcc x86_64_win64cc x86_thiscallcc cc c signext zeroext inreg sret nounwind noreturn noalias nocapture byval nest readnone readonly inlinehint noinline alwaysinline optsize ssp sspreq noredzone noimplicitfloat naked builtin cold nobuiltin noduplicate nonlazybind optnone returns_twice sanitize_address sanitize_memory sanitize_thread sspstrong uwtable returned type opaque eq ne slt sgt sle sge ult ugt ule uge oeq one olt ogt ole oge ord uno ueq une x acq_rel acquire alignstack atomic catch cleanup filter inteldialect max min monotonic nand personality release seq_cst singlethread umax umin unordered xchg add fadd sub fsub mul fmul udiv sdiv fdiv urem srem frem shl lshr ashr and or xor icmp fcmp phi call trunc zext sext fptrunc fpext uitofp sitofp fptoui fptosi inttoptr ptrtoint bitcast addrspacecast select va_arg ret br switch invoke unwind unreachable indirectbr landingpad resume malloc alloca free load store getelementptr extractelement insertelement shufflevector getresult extractvalue insertvalue atomicrmw cmpxchg fence argmemonly double",contains:[n,t.COMMENT(/;\s*$/,null,{relevance:0}),t.COMMENT(/;/,/$/),t.QUOTE_STRING_MODE,{className:"string",variants:[{begin:/"/,end:/[^\\]"/}]},c,s,r,a,o,i]}}run.exports=tis});var oun=ee((i1a,iun)=>{p();function nis(t){var e={className:"subst",begin:/\\[tn"\\]/},n={className:"string",begin:'"',end:'"',contains:[e]},r={className:"number",relevance:0,begin:t.C_NUMBER_RE},s={className:"literal",variants:[{begin:"\\b(PI|TWO_PI|PI_BY_TWO|DEG_TO_RAD|RAD_TO_DEG|SQRT2)\\b"},{begin:"\\b(XP_ERROR_(EXPERIENCES_DISABLED|EXPERIENCE_(DISABLED|SUSPENDED)|INVALID_(EXPERIENCE|PARAMETERS)|KEY_NOT_FOUND|MATURITY_EXCEEDED|NONE|NOT_(FOUND|PERMITTED(_LAND)?)|NO_EXPERIENCE|QUOTA_EXCEEDED|RETRY_UPDATE|STORAGE_EXCEPTION|STORE_DISABLED|THROTTLED|UNKNOWN_ERROR)|JSON_APPEND|STATUS_(PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(_OBJECT)?|(DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(_(BY_(LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(PARCEL(_OWNER)?|REGION)))?|CAMERA_(PITCH|DISTANCE|BEHINDNESS_(ANGLE|LAG)|(FOCUS|POSITION)(_(THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(ROOT|SET|ALL_(OTHERS|CHILDREN)|THIS)|ACTIVE|PASS(IVE|_(ALWAYS|IF_NOT_HANDLED|NEVER))|SCRIPTED|CONTROL_(FWD|BACK|(ROT_)?(LEFT|RIGHT)|UP|DOWN|(ML_)?LBUTTON)|PERMISSION_(RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(_START)?|TELEPORT|MEDIA)|OBJECT_(CLICK_ACTION|HOVER_HEIGHT|LAST_OWNER_ID|(PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_(ATTACHED|ON_REZ)|NAME|DESC|POS|PRIM_(COUNT|EQUIVALENCE)|RETURN_(PARCEL(_OWNER)?|REGION)|REZZER_KEY|ROO?T|VELOCITY|OMEGA|OWNER|GROUP(_TAG)?|CREATOR|ATTACHED_(POINT|SLOTS_AVAILABLE)|RENDER_WEIGHT|(BODY_SHAPE|PATHFINDING)_TYPE|(RUNNING|TOTAL)_SCRIPT_COUNT|TOTAL_INVENTORY_COUNT|SCRIPT_(MEMORY|TIME))|TYPE_(INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(DEBUG|PUBLIC)_CHANNEL|ATTACH_(AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](SHOULDER|HAND|FOOT|EAR|EYE|[UL](ARM|LEG)|HIP)|(LEFT|RIGHT)_PEC|HUD_(CENTER_[12]|TOP_(RIGHT|CENTER|LEFT)|BOTTOM(_(RIGHT|LEFT))?)|[LR]HAND_RING1|TAIL_(BASE|TIP)|[LR]WING|FACE_(JAW|[LR]EAR|[LR]EYE|TOUNGE)|GROIN|HIND_[LR]FOOT)|LAND_(LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(ONLINE|NAME|BORN|SIM_(POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(ON_FILE|USED)|REMOTE_DATA_(CHANNEL|REQUEST|REPLY)|PSYS_(PART_(BF_(ZERO|ONE(_MINUS_(DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(START|END)_(COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(RIBBON|WIND|INTERP_(COLOR|SCALE)|BOUNCE|FOLLOW_(SRC|VELOCITY)|TARGET_(POS|LINEAR)|EMISSIVE)_MASK)|SRC_(MAX_AGE|PATTERN|ANGLE_(BEGIN|END)|BURST_(RATE|PART_COUNT|RADIUS|SPEED_(MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(DROP|EXPLODE|ANGLE(_CONE(_EMPTY)?)?)))|VEHICLE_(REFERENCE_FRAME|TYPE_(NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(LINEAR|ANGULAR)_(FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(LINEAR|ANGULAR)_(DEFLECTION_(EFFICIENCY|TIMESCALE)|MOTOR_(DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(EFFICIENCY|TIMESCALE)|BANKING_(EFFICIENCY|MIX|TIMESCALE)|FLAG_(NO_DEFLECTION_UP|LIMIT_(ROLL_ONLY|MOTOR_UP)|HOVER_((WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(ALLOW_UNSIT|ALPHA_MODE(_(BLEND|EMISSIVE|MASK|NONE))?|NORMAL|SPECULAR|TYPE(_(BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(_(STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(NONE|LOW|MEDIUM|HIGH)|BUMP_(NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(DEFAULT|PLANAR)|SCRIPTED_SIT_ONLY|SCULPT_(TYPE_(SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(MIRROR|INVERT))|PHYSICS(_(SHAPE_(CONVEX|NONE|PRIM|TYPE)))?|(POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIT_TARGET|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(ALT_IMAGE_ENABLE|CONTROLS|(CURRENT|HOME)_URL|AUTO_(LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(WIDTH|HEIGHT)_PIXELS|WHITELIST(_ENABLE)?|PERMS_(INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(STANDARD|MINI)|PERM_(NONE|OWNER|GROUP|ANYONE)|MAX_(URL_LENGTH|WHITELIST_(SIZE|COUNT)|(WIDTH|HEIGHT)_PIXELS)))|MASK_(BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(MEDIA_COMMAND_(STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(ALLOW_(FLY|(GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(GROUP_)?OBJECTS)|USE_(ACCESS_(GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(GROUP|ALL)_OBJECT_ENTRY)|COUNT_(TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(HIDE|DEFAULT)|REGION_FLAG_(ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(METHOD|MIMETYPE|BODY_(MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|SIT_(INVALID_(AGENT|LINK_OBJECT)|NO(T_EXPERIENCE|_(ACCESS|EXPERIENCE_PERMISSION|SIT_TARGET)))|STRING_(TRIM(_(HEAD|TAIL))?)|CLICK_ACTION_(NONE|TOUCH|SIT|BUY|PAY|OPEN(_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(NONE|SCRIPT_MEMORY)|RC_(DATA_FLAGS|DETECT_PHANTOM|GET_(LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(TYPES|AGENTS|(NON)?PHYSICAL|LAND))|RCERR_(CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(ALLOWED_(AGENT|GROUP)_(ADD|REMOVE)|BANNED_AGENT_(ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(COMMAND|CMD_(PLAY|STOP|PAUSE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(CMD_((SMOOTH_)?STOP|JUMP)|DESIRED_(TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(_([ABCD]|NONE))?|MAX_(DECEL|TURN_RADIUS|(ACCEL|SPEED)))|PURSUIT_(OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(EVADE_(HIDDEN|SPOTTED)|FAILURE_(DYNAMIC_PATHFINDING_DISABLED|INVALID_(GOAL|START)|NO_(NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(PARCEL_)?UNREACHABLE)|(GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(_(FAST|NONE|SLOW))?|CONTENT_TYPE_(ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(RADIUS|STATIC)|(PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\\b"},{begin:"\\b(FALSE|TRUE)\\b"},{begin:"\\b(ZERO_ROTATION)\\b"},{begin:"\\b(EOF|JSON_(ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(GRANTED|DENIED))\\b"},{begin:"\\b(ZERO_VECTOR|TOUCH_INVALID_(TEXCOORD|VECTOR))\\b"}]},i={className:"built_in",begin:"\\b(ll(AgentInExperience|(Create|DataSize|Delete|KeyCount|Keys|Read|Update)KeyValue|GetExperience(Details|ErrorMessage)|ReturnObjectsBy(ID|Owner)|Json(2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(Mag|Norm|Dist)|Rot(Between|2(Euler|Fwd|Left|Up))|(Euler|Axes)2Rot|Whisper|(Region|Owner)?Say|Shout|Listen(Control|Remove)?|Sensor(Repeat|Remove)?|Detected(Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|([GS]et)(AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(Scale|Offset|Rotate)Texture|(Rot)?Target(Remove)?|(Stop)?MoveToTarget|Apply(Rotational)?Impulse|Set(KeyframedMotion|ContentType|RegionPos|(Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(Queueing|Radius)|Vehicle(Type|(Float|Vector|Rotation)Param)|(Touch|Sit)?Text|Camera(Eye|At)Offset|PrimitiveParams|ClickAction|Link(Alpha|Color|PrimitiveParams(Fast)?|Texture(Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get((Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(PrimitiveParams|Number(OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(Details|PermMask|PrimCount)|Parcel(MaxPrims|Details|Prim(Count|Owners))|Attached(List)?|(SPMax|Free|Used)Memory|Region(Name|TimeDilation|FPS|Corner|AgentCount)|Root(Position|Rotation)|UnixTime|(Parcel|Region)Flags|(Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(Prims|NotecardLines|Sides)|Animation(List)?|(Camera|Local)(Pos|Rot)|Vel|Accel|Omega|Time(stamp|OfDay)|(Object|CenterOf)?Mass|MassMKS|Energy|Owner|(Owner)?Key|SunDirection|Texture(Offset|Scale|Rot)|Inventory(Number|Name|Key|Type|Creator|PermMask)|Permissions(Key)?|StartParameter|List(Length|EntryType)|Date|Agent(Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(Name|State))|(Get|Reset|GetAndReset)Time|PlaySound(Slave)?|LoopSound(Master|Slave)?|(Trigger|Stop|Preload)Sound|((Get|Delete)Sub|Insert)String|To(Upper|Lower)|Give(InventoryList|Money)|RezObject|(Stop)?LookAt|Sleep|CollisionFilter|(Take|Release)Controls|DetachFromAvatar|AttachToAvatar(Temp)?|InstantMessage|(GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(Length|Trim)|(Start|Stop)Animation|TargetOmega|Request(Experience)?Permissions|(Create|Break)Link|BreakAllLinks|(Give|Remove)Inventory|Water|PassTouches|Request(Agent|Inventory)Data|TeleportAgent(Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(Axis|Angle)|A(cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(CSV|Integer|Json|Float|String|Key|Vector|Rot|List(Strided)?)|DeleteSubList|List(Statistics|Sort|Randomize|(Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(Slope|Normal|Contour)|GroundRepel|(Set|Remove)VehicleFlags|SitOnLink|(AvatarOn)?(Link)?SitTarget|Script(Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(Integer|String)ToBase64|XorBase64|Log(10)?|Base64To(String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(Load|Release|(E|Une)scape)URL|ParcelMedia(CommandList|Query)|ModPow|MapDestination|(RemoveFrom|AddTo|Reset)Land(Pass|Ban)List|(Set|Clear)CameraParams|HTTP(Request|Response)|TextBox|DetectedTouch(UV|Face|Pos|(N|Bin)ormal|ST)|(MD5|SHA1|DumpList2)String|Request(Secure)?URL|Clear(Prim|Link)Media|(Link)?ParticleSystem|(Get|Request)(Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\\b"};return{name:"LSL (Linden Scripting Language)",illegal:":",contains:[n,{className:"comment",variants:[t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/")],relevance:0},r,{className:"section",variants:[{begin:"\\b(state|default)\\b"},{begin:"\\b(state_(entry|exit)|touch(_(start|end))?|(land_)?collision(_(start|end))?|timer|listen|(no_)?sensor|control|(not_)?at_(rot_)?target|money|email|experience_permissions(_denied)?|run_time_permissions|changed|attach|dataserver|moving_(start|end)|link_message|(on|object)_rez|remote_data|http_re(sponse|quest)|path_update|transaction_result)\\b"}]},i,s,{className:"type",begin:"\\b(integer|float|string|key|vector|quaternion|rotation|list)\\b"}]}}iun.exports=nis});var cun=ee((a1a,aun)=>{p();function ris(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%{p();var sis=["AASTriangle","AbelianGroup","Abort","AbortKernels","AbortProtect","AbortScheduledTask","Above","Abs","AbsArg","AbsArgPlot","Absolute","AbsoluteCorrelation","AbsoluteCorrelationFunction","AbsoluteCurrentValue","AbsoluteDashing","AbsoluteFileName","AbsoluteOptions","AbsolutePointSize","AbsoluteThickness","AbsoluteTime","AbsoluteTiming","AcceptanceThreshold","AccountingForm","Accumulate","Accuracy","AccuracyGoal","ActionDelay","ActionMenu","ActionMenuBox","ActionMenuBoxOptions","Activate","Active","ActiveClassification","ActiveClassificationObject","ActiveItem","ActivePrediction","ActivePredictionObject","ActiveStyle","AcyclicGraphQ","AddOnHelpPath","AddSides","AddTo","AddToSearchIndex","AddUsers","AdjacencyGraph","AdjacencyList","AdjacencyMatrix","AdjacentMeshCells","AdjustmentBox","AdjustmentBoxOptions","AdjustTimeSeriesForecast","AdministrativeDivisionData","AffineHalfSpace","AffineSpace","AffineStateSpaceModel","AffineTransform","After","AggregatedEntityClass","AggregationLayer","AircraftData","AirportData","AirPressureData","AirTemperatureData","AiryAi","AiryAiPrime","AiryAiZero","AiryBi","AiryBiPrime","AiryBiZero","AlgebraicIntegerQ","AlgebraicNumber","AlgebraicNumberDenominator","AlgebraicNumberNorm","AlgebraicNumberPolynomial","AlgebraicNumberTrace","AlgebraicRules","AlgebraicRulesData","Algebraics","AlgebraicUnitQ","Alignment","AlignmentMarker","AlignmentPoint","All","AllowAdultContent","AllowedCloudExtraParameters","AllowedCloudParameterExtensions","AllowedDimensions","AllowedFrequencyRange","AllowedHeads","AllowGroupClose","AllowIncomplete","AllowInlineCells","AllowKernelInitialization","AllowLooseGrammar","AllowReverseGroupClose","AllowScriptLevelChange","AllowVersionUpdate","AllTrue","Alphabet","AlphabeticOrder","AlphabeticSort","AlphaChannel","AlternateImage","AlternatingFactorial","AlternatingGroup","AlternativeHypothesis","Alternatives","AltitudeMethod","AmbientLight","AmbiguityFunction","AmbiguityList","Analytic","AnatomyData","AnatomyForm","AnatomyPlot3D","AnatomySkinStyle","AnatomyStyling","AnchoredSearch","And","AndersonDarlingTest","AngerJ","AngleBisector","AngleBracket","AnglePath","AnglePath3D","AngleVector","AngularGauge","Animate","AnimationCycleOffset","AnimationCycleRepetitions","AnimationDirection","AnimationDisplayTime","AnimationRate","AnimationRepetitions","AnimationRunning","AnimationRunTime","AnimationTimeIndex","Animator","AnimatorBox","AnimatorBoxOptions","AnimatorElements","Annotate","Annotation","AnnotationDelete","AnnotationKeys","AnnotationRules","AnnotationValue","Annuity","AnnuityDue","Annulus","AnomalyDetection","AnomalyDetector","AnomalyDetectorFunction","Anonymous","Antialiasing","AntihermitianMatrixQ","Antisymmetric","AntisymmetricMatrixQ","Antonyms","AnyOrder","AnySubset","AnyTrue","Apart","ApartSquareFree","APIFunction","Appearance","AppearanceElements","AppearanceRules","AppellF1","Append","AppendCheck","AppendLayer","AppendTo","Apply","ApplySides","ArcCos","ArcCosh","ArcCot","ArcCoth","ArcCsc","ArcCsch","ArcCurvature","ARCHProcess","ArcLength","ArcSec","ArcSech","ArcSin","ArcSinDistribution","ArcSinh","ArcTan","ArcTanh","Area","Arg","ArgMax","ArgMin","ArgumentCountQ","ARIMAProcess","ArithmeticGeometricMean","ARMAProcess","Around","AroundReplace","ARProcess","Array","ArrayComponents","ArrayDepth","ArrayFilter","ArrayFlatten","ArrayMesh","ArrayPad","ArrayPlot","ArrayQ","ArrayResample","ArrayReshape","ArrayRules","Arrays","Arrow","Arrow3DBox","ArrowBox","Arrowheads","ASATriangle","Ask","AskAppend","AskConfirm","AskDisplay","AskedQ","AskedValue","AskFunction","AskState","AskTemplateDisplay","AspectRatio","AspectRatioFixed","Assert","AssociateTo","Association","AssociationFormat","AssociationMap","AssociationQ","AssociationThread","AssumeDeterministic","Assuming","Assumptions","AstronomicalData","Asymptotic","AsymptoticDSolveValue","AsymptoticEqual","AsymptoticEquivalent","AsymptoticGreater","AsymptoticGreaterEqual","AsymptoticIntegrate","AsymptoticLess","AsymptoticLessEqual","AsymptoticOutputTracker","AsymptoticProduct","AsymptoticRSolveValue","AsymptoticSolve","AsymptoticSum","Asynchronous","AsynchronousTaskObject","AsynchronousTasks","Atom","AtomCoordinates","AtomCount","AtomDiagramCoordinates","AtomList","AtomQ","AttentionLayer","Attributes","Audio","AudioAmplify","AudioAnnotate","AudioAnnotationLookup","AudioBlockMap","AudioCapture","AudioChannelAssignment","AudioChannelCombine","AudioChannelMix","AudioChannels","AudioChannelSeparate","AudioData","AudioDelay","AudioDelete","AudioDevice","AudioDistance","AudioEncoding","AudioFade","AudioFrequencyShift","AudioGenerator","AudioIdentify","AudioInputDevice","AudioInsert","AudioInstanceQ","AudioIntervals","AudioJoin","AudioLabel","AudioLength","AudioLocalMeasurements","AudioLooping","AudioLoudness","AudioMeasurements","AudioNormalize","AudioOutputDevice","AudioOverlay","AudioPad","AudioPan","AudioPartition","AudioPause","AudioPitchShift","AudioPlay","AudioPlot","AudioQ","AudioRecord","AudioReplace","AudioResample","AudioReverb","AudioReverse","AudioSampleRate","AudioSpectralMap","AudioSpectralTransformation","AudioSplit","AudioStop","AudioStream","AudioStreams","AudioTimeStretch","AudioTracks","AudioTrim","AudioType","AugmentedPolyhedron","AugmentedSymmetricPolynomial","Authenticate","Authentication","AuthenticationDialog","AutoAction","Autocomplete","AutocompletionFunction","AutoCopy","AutocorrelationTest","AutoDelete","AutoEvaluateEvents","AutoGeneratedPackage","AutoIndent","AutoIndentSpacings","AutoItalicWords","AutoloadPath","AutoMatch","Automatic","AutomaticImageSize","AutoMultiplicationSymbol","AutoNumberFormatting","AutoOpenNotebooks","AutoOpenPalettes","AutoQuoteCharacters","AutoRefreshed","AutoRemove","AutorunSequencing","AutoScaling","AutoScroll","AutoSpacing","AutoStyleOptions","AutoStyleWords","AutoSubmitting","Axes","AxesEdge","AxesLabel","AxesOrigin","AxesStyle","AxiomaticTheory","Axis","BabyMonsterGroupB","Back","Background","BackgroundAppearance","BackgroundTasksSettings","Backslash","Backsubstitution","Backward","Ball","Band","BandpassFilter","BandstopFilter","BarabasiAlbertGraphDistribution","BarChart","BarChart3D","BarcodeImage","BarcodeRecognize","BaringhausHenzeTest","BarLegend","BarlowProschanImportance","BarnesG","BarOrigin","BarSpacing","BartlettHannWindow","BartlettWindow","BaseDecode","BaseEncode","BaseForm","Baseline","BaselinePosition","BaseStyle","BasicRecurrentLayer","BatchNormalizationLayer","BatchSize","BatesDistribution","BattleLemarieWavelet","BayesianMaximization","BayesianMaximizationObject","BayesianMinimization","BayesianMinimizationObject","Because","BeckmannDistribution","Beep","Before","Begin","BeginDialogPacket","BeginFrontEndInteractionPacket","BeginPackage","BellB","BellY","Below","BenfordDistribution","BeniniDistribution","BenktanderGibratDistribution","BenktanderWeibullDistribution","BernoulliB","BernoulliDistribution","BernoulliGraphDistribution","BernoulliProcess","BernsteinBasis","BesselFilterModel","BesselI","BesselJ","BesselJZero","BesselK","BesselY","BesselYZero","Beta","BetaBinomialDistribution","BetaDistribution","BetaNegativeBinomialDistribution","BetaPrimeDistribution","BetaRegularized","Between","BetweennessCentrality","BeveledPolyhedron","BezierCurve","BezierCurve3DBox","BezierCurve3DBoxOptions","BezierCurveBox","BezierCurveBoxOptions","BezierFunction","BilateralFilter","Binarize","BinaryDeserialize","BinaryDistance","BinaryFormat","BinaryImageQ","BinaryRead","BinaryReadList","BinarySerialize","BinaryWrite","BinCounts","BinLists","Binomial","BinomialDistribution","BinomialProcess","BinormalDistribution","BiorthogonalSplineWavelet","BipartiteGraphQ","BiquadraticFilterModel","BirnbaumImportance","BirnbaumSaundersDistribution","BitAnd","BitClear","BitGet","BitLength","BitNot","BitOr","BitSet","BitShiftLeft","BitShiftRight","BitXor","BiweightLocation","BiweightMidvariance","Black","BlackmanHarrisWindow","BlackmanNuttallWindow","BlackmanWindow","Blank","BlankForm","BlankNullSequence","BlankSequence","Blend","Block","BlockchainAddressData","BlockchainBase","BlockchainBlockData","BlockchainContractValue","BlockchainData","BlockchainGet","BlockchainKeyEncode","BlockchainPut","BlockchainTokenData","BlockchainTransaction","BlockchainTransactionData","BlockchainTransactionSign","BlockchainTransactionSubmit","BlockMap","BlockRandom","BlomqvistBeta","BlomqvistBetaTest","Blue","Blur","BodePlot","BohmanWindow","Bold","Bond","BondCount","BondList","BondQ","Bookmarks","Boole","BooleanConsecutiveFunction","BooleanConvert","BooleanCountingFunction","BooleanFunction","BooleanGraph","BooleanMaxterms","BooleanMinimize","BooleanMinterms","BooleanQ","BooleanRegion","Booleans","BooleanStrings","BooleanTable","BooleanVariables","BorderDimensions","BorelTannerDistribution","Bottom","BottomHatTransform","BoundaryDiscretizeGraphics","BoundaryDiscretizeRegion","BoundaryMesh","BoundaryMeshRegion","BoundaryMeshRegionQ","BoundaryStyle","BoundedRegionQ","BoundingRegion","Bounds","Box","BoxBaselineShift","BoxData","BoxDimensions","Boxed","Boxes","BoxForm","BoxFormFormatTypes","BoxFrame","BoxID","BoxMargins","BoxMatrix","BoxObject","BoxRatios","BoxRotation","BoxRotationPoint","BoxStyle","BoxWhiskerChart","Bra","BracketingBar","BraKet","BrayCurtisDistance","BreadthFirstScan","Break","BridgeData","BrightnessEqualize","BroadcastStationData","Brown","BrownForsytheTest","BrownianBridgeProcess","BrowserCategory","BSplineBasis","BSplineCurve","BSplineCurve3DBox","BSplineCurve3DBoxOptions","BSplineCurveBox","BSplineCurveBoxOptions","BSplineFunction","BSplineSurface","BSplineSurface3DBox","BSplineSurface3DBoxOptions","BubbleChart","BubbleChart3D","BubbleScale","BubbleSizes","BuildingData","BulletGauge","BusinessDayQ","ButterflyGraph","ButterworthFilterModel","Button","ButtonBar","ButtonBox","ButtonBoxOptions","ButtonCell","ButtonContents","ButtonData","ButtonEvaluator","ButtonExpandable","ButtonFrame","ButtonFunction","ButtonMargins","ButtonMinHeight","ButtonNote","ButtonNotebook","ButtonSource","ButtonStyle","ButtonStyleMenuListing","Byte","ByteArray","ByteArrayFormat","ByteArrayQ","ByteArrayToString","ByteCount","ByteOrdering","C","CachedValue","CacheGraphics","CachePersistence","CalendarConvert","CalendarData","CalendarType","Callout","CalloutMarker","CalloutStyle","CallPacket","CanberraDistance","Cancel","CancelButton","CandlestickChart","CanonicalGraph","CanonicalizePolygon","CanonicalizePolyhedron","CanonicalName","CanonicalWarpingCorrespondence","CanonicalWarpingDistance","CantorMesh","CantorStaircase","Cap","CapForm","CapitalDifferentialD","Capitalize","CapsuleShape","CaptureRunning","CardinalBSplineBasis","CarlemanLinearize","CarmichaelLambda","CaseOrdering","Cases","CaseSensitive","Cashflow","Casoratian","Catalan","CatalanNumber","Catch","CategoricalDistribution","Catenate","CatenateLayer","CauchyDistribution","CauchyWindow","CayleyGraph","CDF","CDFDeploy","CDFInformation","CDFWavelet","Ceiling","CelestialSystem","Cell","CellAutoOverwrite","CellBaseline","CellBoundingBox","CellBracketOptions","CellChangeTimes","CellContents","CellContext","CellDingbat","CellDynamicExpression","CellEditDuplicate","CellElementsBoundingBox","CellElementSpacings","CellEpilog","CellEvaluationDuplicate","CellEvaluationFunction","CellEvaluationLanguage","CellEventActions","CellFrame","CellFrameColor","CellFrameLabelMargins","CellFrameLabels","CellFrameMargins","CellGroup","CellGroupData","CellGrouping","CellGroupingRules","CellHorizontalScrolling","CellID","CellLabel","CellLabelAutoDelete","CellLabelMargins","CellLabelPositioning","CellLabelStyle","CellLabelTemplate","CellMargins","CellObject","CellOpen","CellPrint","CellProlog","Cells","CellSize","CellStyle","CellTags","CellularAutomaton","CensoredDistribution","Censoring","Center","CenterArray","CenterDot","CentralFeature","CentralMoment","CentralMomentGeneratingFunction","Cepstrogram","CepstrogramArray","CepstrumArray","CForm","ChampernowneNumber","ChangeOptions","ChannelBase","ChannelBrokerAction","ChannelDatabin","ChannelHistoryLength","ChannelListen","ChannelListener","ChannelListeners","ChannelListenerWait","ChannelObject","ChannelPreSendFunction","ChannelReceiverFunction","ChannelSend","ChannelSubscribers","ChanVeseBinarize","Character","CharacterCounts","CharacterEncoding","CharacterEncodingsPath","CharacteristicFunction","CharacteristicPolynomial","CharacterName","CharacterNormalize","CharacterRange","Characters","ChartBaseStyle","ChartElementData","ChartElementDataFunction","ChartElementFunction","ChartElements","ChartLabels","ChartLayout","ChartLegends","ChartStyle","Chebyshev1FilterModel","Chebyshev2FilterModel","ChebyshevDistance","ChebyshevT","ChebyshevU","Check","CheckAbort","CheckAll","Checkbox","CheckboxBar","CheckboxBox","CheckboxBoxOptions","ChemicalData","ChessboardDistance","ChiDistribution","ChineseRemainder","ChiSquareDistribution","ChoiceButtons","ChoiceDialog","CholeskyDecomposition","Chop","ChromaticityPlot","ChromaticityPlot3D","ChromaticPolynomial","Circle","CircleBox","CircleDot","CircleMinus","CirclePlus","CirclePoints","CircleThrough","CircleTimes","CirculantGraph","CircularOrthogonalMatrixDistribution","CircularQuaternionMatrixDistribution","CircularRealMatrixDistribution","CircularSymplecticMatrixDistribution","CircularUnitaryMatrixDistribution","Circumsphere","CityData","ClassifierFunction","ClassifierInformation","ClassifierMeasurements","ClassifierMeasurementsObject","Classify","ClassPriors","Clear","ClearAll","ClearAttributes","ClearCookies","ClearPermissions","ClearSystemCache","ClebschGordan","ClickPane","Clip","ClipboardNotebook","ClipFill","ClippingStyle","ClipPlanes","ClipPlanesStyle","ClipRange","Clock","ClockGauge","ClockwiseContourIntegral","Close","Closed","CloseKernels","ClosenessCentrality","Closing","ClosingAutoSave","ClosingEvent","ClosingSaveDialog","CloudAccountData","CloudBase","CloudConnect","CloudConnections","CloudDeploy","CloudDirectory","CloudDisconnect","CloudEvaluate","CloudExport","CloudExpression","CloudExpressions","CloudFunction","CloudGet","CloudImport","CloudLoggingData","CloudObject","CloudObjectInformation","CloudObjectInformationData","CloudObjectNameFormat","CloudObjects","CloudObjectURLType","CloudPublish","CloudPut","CloudRenderingMethod","CloudSave","CloudShare","CloudSubmit","CloudSymbol","CloudUnshare","CloudUserID","ClusterClassify","ClusterDissimilarityFunction","ClusteringComponents","ClusteringTree","CMYKColor","Coarse","CodeAssistOptions","Coefficient","CoefficientArrays","CoefficientDomain","CoefficientList","CoefficientRules","CoifletWavelet","Collect","Colon","ColonForm","ColorBalance","ColorCombine","ColorConvert","ColorCoverage","ColorData","ColorDataFunction","ColorDetect","ColorDistance","ColorFunction","ColorFunctionScaling","Colorize","ColorNegate","ColorOutput","ColorProfileData","ColorQ","ColorQuantize","ColorReplace","ColorRules","ColorSelectorSettings","ColorSeparate","ColorSetter","ColorSetterBox","ColorSetterBoxOptions","ColorSlider","ColorsNear","ColorSpace","ColorToneMapping","Column","ColumnAlignments","ColumnBackgrounds","ColumnForm","ColumnLines","ColumnsEqual","ColumnSpacings","ColumnWidths","CombinedEntityClass","CombinerFunction","CometData","CommonDefaultFormatTypes","Commonest","CommonestFilter","CommonName","CommonUnits","CommunityBoundaryStyle","CommunityGraphPlot","CommunityLabels","CommunityRegionStyle","CompanyData","CompatibleUnitQ","CompilationOptions","CompilationTarget","Compile","Compiled","CompiledCodeFunction","CompiledFunction","CompilerOptions","Complement","ComplementedEntityClass","CompleteGraph","CompleteGraphQ","CompleteKaryTree","CompletionsListPacket","Complex","ComplexContourPlot","Complexes","ComplexExpand","ComplexInfinity","ComplexityFunction","ComplexListPlot","ComplexPlot","ComplexPlot3D","ComplexRegionPlot","ComplexStreamPlot","ComplexVectorPlot","ComponentMeasurements","ComponentwiseContextMenu","Compose","ComposeList","ComposeSeries","CompositeQ","Composition","CompoundElement","CompoundExpression","CompoundPoissonDistribution","CompoundPoissonProcess","CompoundRenewalProcess","Compress","CompressedData","CompressionLevel","ComputeUncertainty","Condition","ConditionalExpression","Conditioned","Cone","ConeBox","ConfidenceLevel","ConfidenceRange","ConfidenceTransform","ConfigurationPath","ConformAudio","ConformImages","Congruent","ConicHullRegion","ConicHullRegion3DBox","ConicHullRegionBox","ConicOptimization","Conjugate","ConjugateTranspose","Conjunction","Connect","ConnectedComponents","ConnectedGraphComponents","ConnectedGraphQ","ConnectedMeshComponents","ConnectedMoleculeComponents","ConnectedMoleculeQ","ConnectionSettings","ConnectLibraryCallbackFunction","ConnectSystemModelComponents","ConnesWindow","ConoverTest","ConsoleMessage","ConsoleMessagePacket","Constant","ConstantArray","ConstantArrayLayer","ConstantImage","ConstantPlusLayer","ConstantRegionQ","Constants","ConstantTimesLayer","ConstellationData","ConstrainedMax","ConstrainedMin","Construct","Containing","ContainsAll","ContainsAny","ContainsExactly","ContainsNone","ContainsOnly","ContentFieldOptions","ContentLocationFunction","ContentObject","ContentPadding","ContentsBoundingBox","ContentSelectable","ContentSize","Context","ContextMenu","Contexts","ContextToFileName","Continuation","Continue","ContinuedFraction","ContinuedFractionK","ContinuousAction","ContinuousMarkovProcess","ContinuousTask","ContinuousTimeModelQ","ContinuousWaveletData","ContinuousWaveletTransform","ContourDetect","ContourGraphics","ContourIntegral","ContourLabels","ContourLines","ContourPlot","ContourPlot3D","Contours","ContourShading","ContourSmoothing","ContourStyle","ContraharmonicMean","ContrastiveLossLayer","Control","ControlActive","ControlAlignment","ControlGroupContentsBox","ControllabilityGramian","ControllabilityMatrix","ControllableDecomposition","ControllableModelQ","ControllerDuration","ControllerInformation","ControllerInformationData","ControllerLinking","ControllerManipulate","ControllerMethod","ControllerPath","ControllerState","ControlPlacement","ControlsRendering","ControlType","Convergents","ConversionOptions","ConversionRules","ConvertToBitmapPacket","ConvertToPostScript","ConvertToPostScriptPacket","ConvexHullMesh","ConvexPolygonQ","ConvexPolyhedronQ","ConvolutionLayer","Convolve","ConwayGroupCo1","ConwayGroupCo2","ConwayGroupCo3","CookieFunction","Cookies","CoordinateBoundingBox","CoordinateBoundingBoxArray","CoordinateBounds","CoordinateBoundsArray","CoordinateChartData","CoordinatesToolOptions","CoordinateTransform","CoordinateTransformData","CoprimeQ","Coproduct","CopulaDistribution","Copyable","CopyDatabin","CopyDirectory","CopyFile","CopyTag","CopyToClipboard","CornerFilter","CornerNeighbors","Correlation","CorrelationDistance","CorrelationFunction","CorrelationTest","Cos","Cosh","CoshIntegral","CosineDistance","CosineWindow","CosIntegral","Cot","Coth","Count","CountDistinct","CountDistinctBy","CounterAssignments","CounterBox","CounterBoxOptions","CounterClockwiseContourIntegral","CounterEvaluator","CounterFunction","CounterIncrements","CounterStyle","CounterStyleMenuListing","CountRoots","CountryData","Counts","CountsBy","Covariance","CovarianceEstimatorFunction","CovarianceFunction","CoxianDistribution","CoxIngersollRossProcess","CoxModel","CoxModelFit","CramerVonMisesTest","CreateArchive","CreateCellID","CreateChannel","CreateCloudExpression","CreateDatabin","CreateDataStructure","CreateDataSystemModel","CreateDialog","CreateDirectory","CreateDocument","CreateFile","CreateIntermediateDirectories","CreateManagedLibraryExpression","CreateNotebook","CreatePacletArchive","CreatePalette","CreatePalettePacket","CreatePermissionsGroup","CreateScheduledTask","CreateSearchIndex","CreateSystemModel","CreateTemporary","CreateUUID","CreateWindow","CriterionFunction","CriticalityFailureImportance","CriticalitySuccessImportance","CriticalSection","Cross","CrossEntropyLossLayer","CrossingCount","CrossingDetect","CrossingPolygon","CrossMatrix","Csc","Csch","CTCLossLayer","Cube","CubeRoot","Cubics","Cuboid","CuboidBox","Cumulant","CumulantGeneratingFunction","Cup","CupCap","Curl","CurlyDoubleQuote","CurlyQuote","CurrencyConvert","CurrentDate","CurrentImage","CurrentlySpeakingPacket","CurrentNotebookImage","CurrentScreenImage","CurrentValue","Curry","CurryApplied","CurvatureFlowFilter","CurveClosed","Cyan","CycleGraph","CycleIndexPolynomial","Cycles","CyclicGroup","Cyclotomic","Cylinder","CylinderBox","CylindricalDecomposition","D","DagumDistribution","DamData","DamerauLevenshteinDistance","DampingFactor","Darker","Dashed","Dashing","DatabaseConnect","DatabaseDisconnect","DatabaseReference","Databin","DatabinAdd","DatabinRemove","Databins","DatabinUpload","DataCompression","DataDistribution","DataRange","DataReversed","Dataset","DatasetDisplayPanel","DataStructure","DataStructureQ","Date","DateBounds","Dated","DateDelimiters","DateDifference","DatedUnit","DateFormat","DateFunction","DateHistogram","DateInterval","DateList","DateListLogPlot","DateListPlot","DateListStepPlot","DateObject","DateObjectQ","DateOverlapsQ","DatePattern","DatePlus","DateRange","DateReduction","DateString","DateTicksFormat","DateValue","DateWithinQ","DaubechiesWavelet","DavisDistribution","DawsonF","DayCount","DayCountConvention","DayHemisphere","DaylightQ","DayMatchQ","DayName","DayNightTerminator","DayPlus","DayRange","DayRound","DeBruijnGraph","DeBruijnSequence","Debug","DebugTag","Decapitalize","Decimal","DecimalForm","DeclareKnownSymbols","DeclarePackage","Decompose","DeconvolutionLayer","Decrement","Decrypt","DecryptFile","DedekindEta","DeepSpaceProbeData","Default","DefaultAxesStyle","DefaultBaseStyle","DefaultBoxStyle","DefaultButton","DefaultColor","DefaultControlPlacement","DefaultDuplicateCellStyle","DefaultDuration","DefaultElement","DefaultFaceGridsStyle","DefaultFieldHintStyle","DefaultFont","DefaultFontProperties","DefaultFormatType","DefaultFormatTypeForStyle","DefaultFrameStyle","DefaultFrameTicksStyle","DefaultGridLinesStyle","DefaultInlineFormatType","DefaultInputFormatType","DefaultLabelStyle","DefaultMenuStyle","DefaultNaturalLanguage","DefaultNewCellStyle","DefaultNewInlineCellStyle","DefaultNotebook","DefaultOptions","DefaultOutputFormatType","DefaultPrintPrecision","DefaultStyle","DefaultStyleDefinitions","DefaultTextFormatType","DefaultTextInlineFormatType","DefaultTicksStyle","DefaultTooltipStyle","DefaultValue","DefaultValues","Defer","DefineExternal","DefineInputStreamMethod","DefineOutputStreamMethod","DefineResourceFunction","Definition","Degree","DegreeCentrality","DegreeGraphDistribution","DegreeLexicographic","DegreeReverseLexicographic","DEigensystem","DEigenvalues","Deinitialization","Del","DelaunayMesh","Delayed","Deletable","Delete","DeleteAnomalies","DeleteBorderComponents","DeleteCases","DeleteChannel","DeleteCloudExpression","DeleteContents","DeleteDirectory","DeleteDuplicates","DeleteDuplicatesBy","DeleteFile","DeleteMissing","DeleteObject","DeletePermissionsKey","DeleteSearchIndex","DeleteSmallComponents","DeleteStopwords","DeleteWithContents","DeletionWarning","DelimitedArray","DelimitedSequence","Delimiter","DelimiterFlashTime","DelimiterMatching","Delimiters","DeliveryFunction","Dendrogram","Denominator","DensityGraphics","DensityHistogram","DensityPlot","DensityPlot3D","DependentVariables","Deploy","Deployed","Depth","DepthFirstScan","Derivative","DerivativeFilter","DerivedKey","DescriptorStateSpace","DesignMatrix","DestroyAfterEvaluation","Det","DeviceClose","DeviceConfigure","DeviceExecute","DeviceExecuteAsynchronous","DeviceObject","DeviceOpen","DeviceOpenQ","DeviceRead","DeviceReadBuffer","DeviceReadLatest","DeviceReadList","DeviceReadTimeSeries","Devices","DeviceStreams","DeviceWrite","DeviceWriteBuffer","DGaussianWavelet","DiacriticalPositioning","Diagonal","DiagonalizableMatrixQ","DiagonalMatrix","DiagonalMatrixQ","Dialog","DialogIndent","DialogInput","DialogLevel","DialogNotebook","DialogProlog","DialogReturn","DialogSymbols","Diamond","DiamondMatrix","DiceDissimilarity","DictionaryLookup","DictionaryWordQ","DifferenceDelta","DifferenceOrder","DifferenceQuotient","DifferenceRoot","DifferenceRootReduce","Differences","DifferentialD","DifferentialRoot","DifferentialRootReduce","DifferentiatorFilter","DigitalSignature","DigitBlock","DigitBlockMinimum","DigitCharacter","DigitCount","DigitQ","DihedralAngle","DihedralGroup","Dilation","DimensionalCombinations","DimensionalMeshComponents","DimensionReduce","DimensionReducerFunction","DimensionReduction","Dimensions","DiracComb","DiracDelta","DirectedEdge","DirectedEdges","DirectedGraph","DirectedGraphQ","DirectedInfinity","Direction","Directive","Directory","DirectoryName","DirectoryQ","DirectoryStack","DirichletBeta","DirichletCharacter","DirichletCondition","DirichletConvolve","DirichletDistribution","DirichletEta","DirichletL","DirichletLambda","DirichletTransform","DirichletWindow","DisableConsolePrintPacket","DisableFormatting","DiscreteAsymptotic","DiscreteChirpZTransform","DiscreteConvolve","DiscreteDelta","DiscreteHadamardTransform","DiscreteIndicator","DiscreteLimit","DiscreteLQEstimatorGains","DiscreteLQRegulatorGains","DiscreteLyapunovSolve","DiscreteMarkovProcess","DiscreteMaxLimit","DiscreteMinLimit","DiscretePlot","DiscretePlot3D","DiscreteRatio","DiscreteRiccatiSolve","DiscreteShift","DiscreteTimeModelQ","DiscreteUniformDistribution","DiscreteVariables","DiscreteWaveletData","DiscreteWaveletPacketTransform","DiscreteWaveletTransform","DiscretizeGraphics","DiscretizeRegion","Discriminant","DisjointQ","Disjunction","Disk","DiskBox","DiskMatrix","DiskSegment","Dispatch","DispatchQ","DispersionEstimatorFunction","Display","DisplayAllSteps","DisplayEndPacket","DisplayFlushImagePacket","DisplayForm","DisplayFunction","DisplayPacket","DisplayRules","DisplaySetSizePacket","DisplayString","DisplayTemporary","DisplayWith","DisplayWithRef","DisplayWithVariable","DistanceFunction","DistanceMatrix","DistanceTransform","Distribute","Distributed","DistributedContexts","DistributeDefinitions","DistributionChart","DistributionDomain","DistributionFitTest","DistributionParameterAssumptions","DistributionParameterQ","Dithering","Div","Divergence","Divide","DivideBy","Dividers","DivideSides","Divisible","Divisors","DivisorSigma","DivisorSum","DMSList","DMSString","Do","DockedCells","DocumentGenerator","DocumentGeneratorInformation","DocumentGeneratorInformationData","DocumentGenerators","DocumentNotebook","DocumentWeightingRules","Dodecahedron","DomainRegistrationInformation","DominantColors","DOSTextFormat","Dot","DotDashed","DotEqual","DotLayer","DotPlusLayer","Dotted","DoubleBracketingBar","DoubleContourIntegral","DoubleDownArrow","DoubleLeftArrow","DoubleLeftRightArrow","DoubleLeftTee","DoubleLongLeftArrow","DoubleLongLeftRightArrow","DoubleLongRightArrow","DoubleRightArrow","DoubleRightTee","DoubleUpArrow","DoubleUpDownArrow","DoubleVerticalBar","DoublyInfinite","Down","DownArrow","DownArrowBar","DownArrowUpArrow","DownLeftRightVector","DownLeftTeeVector","DownLeftVector","DownLeftVectorBar","DownRightTeeVector","DownRightVector","DownRightVectorBar","Downsample","DownTee","DownTeeArrow","DownValues","DragAndDrop","DrawEdges","DrawFrontFaces","DrawHighlighted","Drop","DropoutLayer","DSolve","DSolveValue","Dt","DualLinearProgramming","DualPolyhedron","DualSystemsModel","DumpGet","DumpSave","DuplicateFreeQ","Duration","Dynamic","DynamicBox","DynamicBoxOptions","DynamicEvaluationTimeout","DynamicGeoGraphics","DynamicImage","DynamicLocation","DynamicModule","DynamicModuleBox","DynamicModuleBoxOptions","DynamicModuleParent","DynamicModuleValues","DynamicName","DynamicNamespace","DynamicReference","DynamicSetting","DynamicUpdating","DynamicWrapper","DynamicWrapperBox","DynamicWrapperBoxOptions","E","EarthImpactData","EarthquakeData","EccentricityCentrality","Echo","EchoFunction","EclipseType","EdgeAdd","EdgeBetweennessCentrality","EdgeCapacity","EdgeCapForm","EdgeColor","EdgeConnectivity","EdgeContract","EdgeCost","EdgeCount","EdgeCoverQ","EdgeCycleMatrix","EdgeDashing","EdgeDelete","EdgeDetect","EdgeForm","EdgeIndex","EdgeJoinForm","EdgeLabeling","EdgeLabels","EdgeLabelStyle","EdgeList","EdgeOpacity","EdgeQ","EdgeRenderingFunction","EdgeRules","EdgeShapeFunction","EdgeStyle","EdgeTaggedGraph","EdgeTaggedGraphQ","EdgeTags","EdgeThickness","EdgeWeight","EdgeWeightedGraphQ","Editable","EditButtonSettings","EditCellTagsSettings","EditDistance","EffectiveInterest","Eigensystem","Eigenvalues","EigenvectorCentrality","Eigenvectors","Element","ElementData","ElementwiseLayer","ElidedForms","Eliminate","EliminationOrder","Ellipsoid","EllipticE","EllipticExp","EllipticExpPrime","EllipticF","EllipticFilterModel","EllipticK","EllipticLog","EllipticNomeQ","EllipticPi","EllipticReducedHalfPeriods","EllipticTheta","EllipticThetaPrime","EmbedCode","EmbeddedHTML","EmbeddedService","EmbeddingLayer","EmbeddingObject","EmitSound","EmphasizeSyntaxErrors","EmpiricalDistribution","Empty","EmptyGraphQ","EmptyRegion","EnableConsolePrintPacket","Enabled","Encode","Encrypt","EncryptedObject","EncryptFile","End","EndAdd","EndDialogPacket","EndFrontEndInteractionPacket","EndOfBuffer","EndOfFile","EndOfLine","EndOfString","EndPackage","EngineEnvironment","EngineeringForm","Enter","EnterExpressionPacket","EnterTextPacket","Entity","EntityClass","EntityClassList","EntityCopies","EntityFunction","EntityGroup","EntityInstance","EntityList","EntityPrefetch","EntityProperties","EntityProperty","EntityPropertyClass","EntityRegister","EntityStore","EntityStores","EntityTypeName","EntityUnregister","EntityValue","Entropy","EntropyFilter","Environment","Epilog","EpilogFunction","Equal","EqualColumns","EqualRows","EqualTilde","EqualTo","EquatedTo","Equilibrium","EquirippleFilterKernel","Equivalent","Erf","Erfc","Erfi","ErlangB","ErlangC","ErlangDistribution","Erosion","ErrorBox","ErrorBoxOptions","ErrorNorm","ErrorPacket","ErrorsDialogSettings","EscapeRadius","EstimatedBackground","EstimatedDistribution","EstimatedProcess","EstimatorGains","EstimatorRegulator","EuclideanDistance","EulerAngles","EulerCharacteristic","EulerE","EulerGamma","EulerianGraphQ","EulerMatrix","EulerPhi","Evaluatable","Evaluate","Evaluated","EvaluatePacket","EvaluateScheduledTask","EvaluationBox","EvaluationCell","EvaluationCompletionAction","EvaluationData","EvaluationElements","EvaluationEnvironment","EvaluationMode","EvaluationMonitor","EvaluationNotebook","EvaluationObject","EvaluationOrder","Evaluator","EvaluatorNames","EvenQ","EventData","EventEvaluator","EventHandler","EventHandlerTag","EventLabels","EventSeries","ExactBlackmanWindow","ExactNumberQ","ExactRootIsolation","ExampleData","Except","ExcludedForms","ExcludedLines","ExcludedPhysicalQuantities","ExcludePods","Exclusions","ExclusionsStyle","Exists","Exit","ExitDialog","ExoplanetData","Exp","Expand","ExpandAll","ExpandDenominator","ExpandFileName","ExpandNumerator","Expectation","ExpectationE","ExpectedValue","ExpGammaDistribution","ExpIntegralE","ExpIntegralEi","ExpirationDate","Exponent","ExponentFunction","ExponentialDistribution","ExponentialFamily","ExponentialGeneratingFunction","ExponentialMovingAverage","ExponentialPowerDistribution","ExponentPosition","ExponentStep","Export","ExportAutoReplacements","ExportByteArray","ExportForm","ExportPacket","ExportString","Expression","ExpressionCell","ExpressionGraph","ExpressionPacket","ExpressionUUID","ExpToTrig","ExtendedEntityClass","ExtendedGCD","Extension","ExtentElementFunction","ExtentMarkers","ExtentSize","ExternalBundle","ExternalCall","ExternalDataCharacterEncoding","ExternalEvaluate","ExternalFunction","ExternalFunctionName","ExternalIdentifier","ExternalObject","ExternalOptions","ExternalSessionObject","ExternalSessions","ExternalStorageBase","ExternalStorageDownload","ExternalStorageGet","ExternalStorageObject","ExternalStoragePut","ExternalStorageUpload","ExternalTypeSignature","ExternalValue","Extract","ExtractArchive","ExtractLayer","ExtractPacletArchive","ExtremeValueDistribution","FaceAlign","FaceForm","FaceGrids","FaceGridsStyle","FacialFeatures","Factor","FactorComplete","Factorial","Factorial2","FactorialMoment","FactorialMomentGeneratingFunction","FactorialPower","FactorInteger","FactorList","FactorSquareFree","FactorSquareFreeList","FactorTerms","FactorTermsList","Fail","Failure","FailureAction","FailureDistribution","FailureQ","False","FareySequence","FARIMAProcess","FeatureDistance","FeatureExtract","FeatureExtraction","FeatureExtractor","FeatureExtractorFunction","FeatureNames","FeatureNearest","FeatureSpacePlot","FeatureSpacePlot3D","FeatureTypes","FEDisableConsolePrintPacket","FeedbackLinearize","FeedbackSector","FeedbackSectorStyle","FeedbackType","FEEnableConsolePrintPacket","FetalGrowthData","Fibonacci","Fibonorial","FieldCompletionFunction","FieldHint","FieldHintStyle","FieldMasked","FieldSize","File","FileBaseName","FileByteCount","FileConvert","FileDate","FileExistsQ","FileExtension","FileFormat","FileHandler","FileHash","FileInformation","FileName","FileNameDepth","FileNameDialogSettings","FileNameDrop","FileNameForms","FileNameJoin","FileNames","FileNameSetter","FileNameSplit","FileNameTake","FilePrint","FileSize","FileSystemMap","FileSystemScan","FileTemplate","FileTemplateApply","FileType","FilledCurve","FilledCurveBox","FilledCurveBoxOptions","Filling","FillingStyle","FillingTransform","FilteredEntityClass","FilterRules","FinancialBond","FinancialData","FinancialDerivative","FinancialIndicator","Find","FindAnomalies","FindArgMax","FindArgMin","FindChannels","FindClique","FindClusters","FindCookies","FindCurvePath","FindCycle","FindDevices","FindDistribution","FindDistributionParameters","FindDivisions","FindEdgeCover","FindEdgeCut","FindEdgeIndependentPaths","FindEquationalProof","FindEulerianCycle","FindExternalEvaluators","FindFaces","FindFile","FindFit","FindFormula","FindFundamentalCycles","FindGeneratingFunction","FindGeoLocation","FindGeometricConjectures","FindGeometricTransform","FindGraphCommunities","FindGraphIsomorphism","FindGraphPartition","FindHamiltonianCycle","FindHamiltonianPath","FindHiddenMarkovStates","FindImageText","FindIndependentEdgeSet","FindIndependentVertexSet","FindInstance","FindIntegerNullVector","FindKClan","FindKClique","FindKClub","FindKPlex","FindLibrary","FindLinearRecurrence","FindList","FindMatchingColor","FindMaximum","FindMaximumCut","FindMaximumFlow","FindMaxValue","FindMeshDefects","FindMinimum","FindMinimumCostFlow","FindMinimumCut","FindMinValue","FindMoleculeSubstructure","FindPath","FindPeaks","FindPermutation","FindPostmanTour","FindProcessParameters","FindRepeat","FindRoot","FindSequenceFunction","FindSettings","FindShortestPath","FindShortestTour","FindSpanningTree","FindSystemModelEquilibrium","FindTextualAnswer","FindThreshold","FindTransientRepeat","FindVertexCover","FindVertexCut","FindVertexIndependentPaths","Fine","FinishDynamic","FiniteAbelianGroupCount","FiniteGroupCount","FiniteGroupData","First","FirstCase","FirstPassageTimeDistribution","FirstPosition","FischerGroupFi22","FischerGroupFi23","FischerGroupFi24Prime","FisherHypergeometricDistribution","FisherRatioTest","FisherZDistribution","Fit","FitAll","FitRegularization","FittedModel","FixedOrder","FixedPoint","FixedPointList","FlashSelection","Flat","Flatten","FlattenAt","FlattenLayer","FlatTopWindow","FlipView","Floor","FlowPolynomial","FlushPrintOutputPacket","Fold","FoldList","FoldPair","FoldPairList","FollowRedirects","Font","FontColor","FontFamily","FontForm","FontName","FontOpacity","FontPostScriptName","FontProperties","FontReencoding","FontSize","FontSlant","FontSubstitutions","FontTracking","FontVariations","FontWeight","For","ForAll","ForceVersionInstall","Format","FormatRules","FormatType","FormatTypeAutoConvert","FormatValues","FormBox","FormBoxOptions","FormControl","FormFunction","FormLayoutFunction","FormObject","FormPage","FormTheme","FormulaData","FormulaLookup","FortranForm","Forward","ForwardBackward","Fourier","FourierCoefficient","FourierCosCoefficient","FourierCosSeries","FourierCosTransform","FourierDCT","FourierDCTFilter","FourierDCTMatrix","FourierDST","FourierDSTMatrix","FourierMatrix","FourierParameters","FourierSequenceTransform","FourierSeries","FourierSinCoefficient","FourierSinSeries","FourierSinTransform","FourierTransform","FourierTrigSeries","FractionalBrownianMotionProcess","FractionalGaussianNoiseProcess","FractionalPart","FractionBox","FractionBoxOptions","FractionLine","Frame","FrameBox","FrameBoxOptions","Framed","FrameInset","FrameLabel","Frameless","FrameMargins","FrameRate","FrameStyle","FrameTicks","FrameTicksStyle","FRatioDistribution","FrechetDistribution","FreeQ","FrenetSerretSystem","FrequencySamplingFilterKernel","FresnelC","FresnelF","FresnelG","FresnelS","Friday","FrobeniusNumber","FrobeniusSolve","FromAbsoluteTime","FromCharacterCode","FromCoefficientRules","FromContinuedFraction","FromDate","FromDigits","FromDMS","FromEntity","FromJulianDate","FromLetterNumber","FromPolarCoordinates","FromRomanNumeral","FromSphericalCoordinates","FromUnixTime","Front","FrontEndDynamicExpression","FrontEndEventActions","FrontEndExecute","FrontEndObject","FrontEndResource","FrontEndResourceString","FrontEndStackSize","FrontEndToken","FrontEndTokenExecute","FrontEndValueCache","FrontEndVersion","FrontFaceColor","FrontFaceOpacity","Full","FullAxes","FullDefinition","FullForm","FullGraphics","FullInformationOutputRegulator","FullOptions","FullRegion","FullSimplify","Function","FunctionCompile","FunctionCompileExport","FunctionCompileExportByteArray","FunctionCompileExportLibrary","FunctionCompileExportString","FunctionDomain","FunctionExpand","FunctionInterpolation","FunctionPeriod","FunctionRange","FunctionSpace","FussellVeselyImportance","GaborFilter","GaborMatrix","GaborWavelet","GainMargins","GainPhaseMargins","GalaxyData","GalleryView","Gamma","GammaDistribution","GammaRegularized","GapPenalty","GARCHProcess","GatedRecurrentLayer","Gather","GatherBy","GaugeFaceElementFunction","GaugeFaceStyle","GaugeFrameElementFunction","GaugeFrameSize","GaugeFrameStyle","GaugeLabels","GaugeMarkers","GaugeStyle","GaussianFilter","GaussianIntegers","GaussianMatrix","GaussianOrthogonalMatrixDistribution","GaussianSymplecticMatrixDistribution","GaussianUnitaryMatrixDistribution","GaussianWindow","GCD","GegenbauerC","General","GeneralizedLinearModelFit","GenerateAsymmetricKeyPair","GenerateConditions","GeneratedCell","GeneratedDocumentBinding","GenerateDerivedKey","GenerateDigitalSignature","GenerateDocument","GeneratedParameters","GeneratedQuantityMagnitudes","GenerateFileSignature","GenerateHTTPResponse","GenerateSecuredAuthenticationKey","GenerateSymmetricKey","GeneratingFunction","GeneratorDescription","GeneratorHistoryLength","GeneratorOutputType","Generic","GenericCylindricalDecomposition","GenomeData","GenomeLookup","GeoAntipode","GeoArea","GeoArraySize","GeoBackground","GeoBoundingBox","GeoBounds","GeoBoundsRegion","GeoBubbleChart","GeoCenter","GeoCircle","GeoContourPlot","GeoDensityPlot","GeodesicClosing","GeodesicDilation","GeodesicErosion","GeodesicOpening","GeoDestination","GeodesyData","GeoDirection","GeoDisk","GeoDisplacement","GeoDistance","GeoDistanceList","GeoElevationData","GeoEntities","GeoGraphics","GeogravityModelData","GeoGridDirectionDifference","GeoGridLines","GeoGridLinesStyle","GeoGridPosition","GeoGridRange","GeoGridRangePadding","GeoGridUnitArea","GeoGridUnitDistance","GeoGridVector","GeoGroup","GeoHemisphere","GeoHemisphereBoundary","GeoHistogram","GeoIdentify","GeoImage","GeoLabels","GeoLength","GeoListPlot","GeoLocation","GeologicalPeriodData","GeomagneticModelData","GeoMarker","GeometricAssertion","GeometricBrownianMotionProcess","GeometricDistribution","GeometricMean","GeometricMeanFilter","GeometricOptimization","GeometricScene","GeometricTransformation","GeometricTransformation3DBox","GeometricTransformation3DBoxOptions","GeometricTransformationBox","GeometricTransformationBoxOptions","GeoModel","GeoNearest","GeoPath","GeoPosition","GeoPositionENU","GeoPositionXYZ","GeoProjection","GeoProjectionData","GeoRange","GeoRangePadding","GeoRegionValuePlot","GeoResolution","GeoScaleBar","GeoServer","GeoSmoothHistogram","GeoStreamPlot","GeoStyling","GeoStylingImageFunction","GeoVariant","GeoVector","GeoVectorENU","GeoVectorPlot","GeoVectorXYZ","GeoVisibleRegion","GeoVisibleRegionBoundary","GeoWithinQ","GeoZoomLevel","GestureHandler","GestureHandlerTag","Get","GetBoundingBoxSizePacket","GetContext","GetEnvironment","GetFileName","GetFrontEndOptionsDataPacket","GetLinebreakInformationPacket","GetMenusPacket","GetPageBreakInformationPacket","Glaisher","GlobalClusteringCoefficient","GlobalPreferences","GlobalSession","Glow","GoldenAngle","GoldenRatio","GompertzMakehamDistribution","GoochShading","GoodmanKruskalGamma","GoodmanKruskalGammaTest","Goto","Grad","Gradient","GradientFilter","GradientOrientationFilter","GrammarApply","GrammarRules","GrammarToken","Graph","Graph3D","GraphAssortativity","GraphAutomorphismGroup","GraphCenter","GraphComplement","GraphData","GraphDensity","GraphDiameter","GraphDifference","GraphDisjointUnion","GraphDistance","GraphDistanceMatrix","GraphElementData","GraphEmbedding","GraphHighlight","GraphHighlightStyle","GraphHub","Graphics","Graphics3D","Graphics3DBox","Graphics3DBoxOptions","GraphicsArray","GraphicsBaseline","GraphicsBox","GraphicsBoxOptions","GraphicsColor","GraphicsColumn","GraphicsComplex","GraphicsComplex3DBox","GraphicsComplex3DBoxOptions","GraphicsComplexBox","GraphicsComplexBoxOptions","GraphicsContents","GraphicsData","GraphicsGrid","GraphicsGridBox","GraphicsGroup","GraphicsGroup3DBox","GraphicsGroup3DBoxOptions","GraphicsGroupBox","GraphicsGroupBoxOptions","GraphicsGrouping","GraphicsHighlightColor","GraphicsRow","GraphicsSpacing","GraphicsStyle","GraphIntersection","GraphLayout","GraphLinkEfficiency","GraphPeriphery","GraphPlot","GraphPlot3D","GraphPower","GraphPropertyDistribution","GraphQ","GraphRadius","GraphReciprocity","GraphRoot","GraphStyle","GraphUnion","Gray","GrayLevel","Greater","GreaterEqual","GreaterEqualLess","GreaterEqualThan","GreaterFullEqual","GreaterGreater","GreaterLess","GreaterSlantEqual","GreaterThan","GreaterTilde","Green","GreenFunction","Grid","GridBaseline","GridBox","GridBoxAlignment","GridBoxBackground","GridBoxDividers","GridBoxFrame","GridBoxItemSize","GridBoxItemStyle","GridBoxOptions","GridBoxSpacings","GridCreationSettings","GridDefaultElement","GridElementStyleOptions","GridFrame","GridFrameMargins","GridGraph","GridLines","GridLinesStyle","GroebnerBasis","GroupActionBase","GroupBy","GroupCentralizer","GroupElementFromWord","GroupElementPosition","GroupElementQ","GroupElements","GroupElementToWord","GroupGenerators","Groupings","GroupMultiplicationTable","GroupOrbits","GroupOrder","GroupPageBreakWithin","GroupSetwiseStabilizer","GroupStabilizer","GroupStabilizerChain","GroupTogetherGrouping","GroupTogetherNestedGrouping","GrowCutComponents","Gudermannian","GuidedFilter","GumbelDistribution","HaarWavelet","HadamardMatrix","HalfLine","HalfNormalDistribution","HalfPlane","HalfSpace","HalftoneShading","HamiltonianGraphQ","HammingDistance","HammingWindow","HandlerFunctions","HandlerFunctionsKeys","HankelH1","HankelH2","HankelMatrix","HankelTransform","HannPoissonWindow","HannWindow","HaradaNortonGroupHN","HararyGraph","HarmonicMean","HarmonicMeanFilter","HarmonicNumber","Hash","HatchFilling","HatchShading","Haversine","HazardFunction","Head","HeadCompose","HeaderAlignment","HeaderBackground","HeaderDisplayFunction","HeaderLines","HeaderSize","HeaderStyle","Heads","HeavisideLambda","HeavisidePi","HeavisideTheta","HeldGroupHe","HeldPart","HelpBrowserLookup","HelpBrowserNotebook","HelpBrowserSettings","Here","HermiteDecomposition","HermiteH","HermitianMatrixQ","HessenbergDecomposition","Hessian","HeunB","HeunBPrime","HeunC","HeunCPrime","HeunD","HeunDPrime","HeunG","HeunGPrime","HeunT","HeunTPrime","HexadecimalCharacter","Hexahedron","HexahedronBox","HexahedronBoxOptions","HiddenItems","HiddenMarkovProcess","HiddenSurface","Highlighted","HighlightGraph","HighlightImage","HighlightMesh","HighpassFilter","HigmanSimsGroupHS","HilbertCurve","HilbertFilter","HilbertMatrix","Histogram","Histogram3D","HistogramDistribution","HistogramList","HistogramTransform","HistogramTransformInterpolation","HistoricalPeriodData","HitMissTransform","HITSCentrality","HjorthDistribution","HodgeDual","HoeffdingD","HoeffdingDTest","Hold","HoldAll","HoldAllComplete","HoldComplete","HoldFirst","HoldForm","HoldPattern","HoldRest","HolidayCalendar","HomeDirectory","HomePage","Horizontal","HorizontalForm","HorizontalGauge","HorizontalScrollPosition","HornerForm","HostLookup","HotellingTSquareDistribution","HoytDistribution","HTMLSave","HTTPErrorResponse","HTTPRedirect","HTTPRequest","HTTPRequestData","HTTPResponse","Hue","HumanGrowthData","HumpDownHump","HumpEqual","HurwitzLerchPhi","HurwitzZeta","HyperbolicDistribution","HypercubeGraph","HyperexponentialDistribution","Hyperfactorial","Hypergeometric0F1","Hypergeometric0F1Regularized","Hypergeometric1F1","Hypergeometric1F1Regularized","Hypergeometric2F1","Hypergeometric2F1Regularized","HypergeometricDistribution","HypergeometricPFQ","HypergeometricPFQRegularized","HypergeometricU","Hyperlink","HyperlinkAction","HyperlinkCreationSettings","Hyperplane","Hyphenation","HyphenationOptions","HypoexponentialDistribution","HypothesisTestData","I","IconData","Iconize","IconizedObject","IconRules","Icosahedron","Identity","IdentityMatrix","If","IgnoreCase","IgnoreDiacritics","IgnorePunctuation","IgnoreSpellCheck","IgnoringInactive","Im","Image","Image3D","Image3DProjection","Image3DSlices","ImageAccumulate","ImageAdd","ImageAdjust","ImageAlign","ImageApply","ImageApplyIndexed","ImageAspectRatio","ImageAssemble","ImageAugmentationLayer","ImageBoundingBoxes","ImageCache","ImageCacheValid","ImageCapture","ImageCaptureFunction","ImageCases","ImageChannels","ImageClip","ImageCollage","ImageColorSpace","ImageCompose","ImageContainsQ","ImageContents","ImageConvolve","ImageCooccurrence","ImageCorners","ImageCorrelate","ImageCorrespondingPoints","ImageCrop","ImageData","ImageDeconvolve","ImageDemosaic","ImageDifference","ImageDimensions","ImageDisplacements","ImageDistance","ImageEffect","ImageExposureCombine","ImageFeatureTrack","ImageFileApply","ImageFileFilter","ImageFileScan","ImageFilter","ImageFocusCombine","ImageForestingComponents","ImageFormattingWidth","ImageForwardTransformation","ImageGraphics","ImageHistogram","ImageIdentify","ImageInstanceQ","ImageKeypoints","ImageLabels","ImageLegends","ImageLevels","ImageLines","ImageMargins","ImageMarker","ImageMarkers","ImageMeasurements","ImageMesh","ImageMultiply","ImageOffset","ImagePad","ImagePadding","ImagePartition","ImagePeriodogram","ImagePerspectiveTransformation","ImagePosition","ImagePreviewFunction","ImagePyramid","ImagePyramidApply","ImageQ","ImageRangeCache","ImageRecolor","ImageReflect","ImageRegion","ImageResize","ImageResolution","ImageRestyle","ImageRotate","ImageRotated","ImageSaliencyFilter","ImageScaled","ImageScan","ImageSize","ImageSizeAction","ImageSizeCache","ImageSizeMultipliers","ImageSizeRaw","ImageSubtract","ImageTake","ImageTransformation","ImageTrim","ImageType","ImageValue","ImageValuePositions","ImagingDevice","ImplicitRegion","Implies","Import","ImportAutoReplacements","ImportByteArray","ImportOptions","ImportString","ImprovementImportance","In","Inactivate","Inactive","IncidenceGraph","IncidenceList","IncidenceMatrix","IncludeAromaticBonds","IncludeConstantBasis","IncludeDefinitions","IncludeDirectories","IncludeFileExtension","IncludeGeneratorTasks","IncludeHydrogens","IncludeInflections","IncludeMetaInformation","IncludePods","IncludeQuantities","IncludeRelatedTables","IncludeSingularTerm","IncludeWindowTimes","Increment","IndefiniteMatrixQ","Indent","IndentingNewlineSpacings","IndentMaxFraction","IndependenceTest","IndependentEdgeSetQ","IndependentPhysicalQuantity","IndependentUnit","IndependentUnitDimension","IndependentVertexSetQ","Indeterminate","IndeterminateThreshold","IndexCreationOptions","Indexed","IndexEdgeTaggedGraph","IndexGraph","IndexTag","Inequality","InexactNumberQ","InexactNumbers","InfiniteFuture","InfiniteLine","InfinitePast","InfinitePlane","Infinity","Infix","InflationAdjust","InflationMethod","Information","InformationData","InformationDataGrid","Inherited","InheritScope","InhomogeneousPoissonProcess","InitialEvaluationHistory","Initialization","InitializationCell","InitializationCellEvaluation","InitializationCellWarning","InitializationObjects","InitializationValue","Initialize","InitialSeeding","InlineCounterAssignments","InlineCounterIncrements","InlineRules","Inner","InnerPolygon","InnerPolyhedron","Inpaint","Input","InputAliases","InputAssumptions","InputAutoReplacements","InputField","InputFieldBox","InputFieldBoxOptions","InputForm","InputGrouping","InputNamePacket","InputNotebook","InputPacket","InputSettings","InputStream","InputString","InputStringPacket","InputToBoxFormPacket","Insert","InsertionFunction","InsertionPointObject","InsertLinebreaks","InsertResults","Inset","Inset3DBox","Inset3DBoxOptions","InsetBox","InsetBoxOptions","Insphere","Install","InstallService","InstanceNormalizationLayer","InString","Integer","IntegerDigits","IntegerExponent","IntegerLength","IntegerName","IntegerPart","IntegerPartitions","IntegerQ","IntegerReverse","Integers","IntegerString","Integral","Integrate","Interactive","InteractiveTradingChart","Interlaced","Interleaving","InternallyBalancedDecomposition","InterpolatingFunction","InterpolatingPolynomial","Interpolation","InterpolationOrder","InterpolationPoints","InterpolationPrecision","Interpretation","InterpretationBox","InterpretationBoxOptions","InterpretationFunction","Interpreter","InterpretTemplate","InterquartileRange","Interrupt","InterruptSettings","IntersectedEntityClass","IntersectingQ","Intersection","Interval","IntervalIntersection","IntervalMarkers","IntervalMarkersStyle","IntervalMemberQ","IntervalSlider","IntervalUnion","Into","Inverse","InverseBetaRegularized","InverseCDF","InverseChiSquareDistribution","InverseContinuousWaveletTransform","InverseDistanceTransform","InverseEllipticNomeQ","InverseErf","InverseErfc","InverseFourier","InverseFourierCosTransform","InverseFourierSequenceTransform","InverseFourierSinTransform","InverseFourierTransform","InverseFunction","InverseFunctions","InverseGammaDistribution","InverseGammaRegularized","InverseGaussianDistribution","InverseGudermannian","InverseHankelTransform","InverseHaversine","InverseImagePyramid","InverseJacobiCD","InverseJacobiCN","InverseJacobiCS","InverseJacobiDC","InverseJacobiDN","InverseJacobiDS","InverseJacobiNC","InverseJacobiND","InverseJacobiNS","InverseJacobiSC","InverseJacobiSD","InverseJacobiSN","InverseLaplaceTransform","InverseMellinTransform","InversePermutation","InverseRadon","InverseRadonTransform","InverseSeries","InverseShortTimeFourier","InverseSpectrogram","InverseSurvivalFunction","InverseTransformedRegion","InverseWaveletTransform","InverseWeierstrassP","InverseWishartMatrixDistribution","InverseZTransform","Invisible","InvisibleApplication","InvisibleTimes","IPAddress","IrreduciblePolynomialQ","IslandData","IsolatingInterval","IsomorphicGraphQ","IsotopeData","Italic","Item","ItemAspectRatio","ItemBox","ItemBoxOptions","ItemDisplayFunction","ItemSize","ItemStyle","ItoProcess","JaccardDissimilarity","JacobiAmplitude","Jacobian","JacobiCD","JacobiCN","JacobiCS","JacobiDC","JacobiDN","JacobiDS","JacobiNC","JacobiND","JacobiNS","JacobiP","JacobiSC","JacobiSD","JacobiSN","JacobiSymbol","JacobiZeta","JankoGroupJ1","JankoGroupJ2","JankoGroupJ3","JankoGroupJ4","JarqueBeraALMTest","JohnsonDistribution","Join","JoinAcross","Joined","JoinedCurve","JoinedCurveBox","JoinedCurveBoxOptions","JoinForm","JordanDecomposition","JordanModelDecomposition","JulianDate","JuliaSetBoettcher","JuliaSetIterationCount","JuliaSetPlot","JuliaSetPoints","K","KagiChart","KaiserBesselWindow","KaiserWindow","KalmanEstimator","KalmanFilter","KarhunenLoeveDecomposition","KaryTree","KatzCentrality","KCoreComponents","KDistribution","KEdgeConnectedComponents","KEdgeConnectedGraphQ","KeepExistingVersion","KelvinBei","KelvinBer","KelvinKei","KelvinKer","KendallTau","KendallTauTest","KernelExecute","KernelFunction","KernelMixtureDistribution","KernelObject","Kernels","Ket","Key","KeyCollisionFunction","KeyComplement","KeyDrop","KeyDropFrom","KeyExistsQ","KeyFreeQ","KeyIntersection","KeyMap","KeyMemberQ","KeypointStrength","Keys","KeySelect","KeySort","KeySortBy","KeyTake","KeyUnion","KeyValueMap","KeyValuePattern","Khinchin","KillProcess","KirchhoffGraph","KirchhoffMatrix","KleinInvariantJ","KnapsackSolve","KnightTourGraph","KnotData","KnownUnitQ","KochCurve","KolmogorovSmirnovTest","KroneckerDelta","KroneckerModelDecomposition","KroneckerProduct","KroneckerSymbol","KuiperTest","KumaraswamyDistribution","Kurtosis","KuwaharaFilter","KVertexConnectedComponents","KVertexConnectedGraphQ","LABColor","Label","Labeled","LabeledSlider","LabelingFunction","LabelingSize","LabelStyle","LabelVisibility","LaguerreL","LakeData","LambdaComponents","LambertW","LaminaData","LanczosWindow","LandauDistribution","Language","LanguageCategory","LanguageData","LanguageIdentify","LanguageOptions","LaplaceDistribution","LaplaceTransform","Laplacian","LaplacianFilter","LaplacianGaussianFilter","Large","Larger","Last","Latitude","LatitudeLongitude","LatticeData","LatticeReduce","Launch","LaunchKernels","LayeredGraphPlot","LayerSizeFunction","LayoutInformation","LCHColor","LCM","LeaderSize","LeafCount","LeapYearQ","LearnDistribution","LearnedDistribution","LearningRate","LearningRateMultipliers","LeastSquares","LeastSquaresFilterKernel","Left","LeftArrow","LeftArrowBar","LeftArrowRightArrow","LeftDownTeeVector","LeftDownVector","LeftDownVectorBar","LeftRightArrow","LeftRightVector","LeftTee","LeftTeeArrow","LeftTeeVector","LeftTriangle","LeftTriangleBar","LeftTriangleEqual","LeftUpDownVector","LeftUpTeeVector","LeftUpVector","LeftUpVectorBar","LeftVector","LeftVectorBar","LegendAppearance","Legended","LegendFunction","LegendLabel","LegendLayout","LegendMargins","LegendMarkers","LegendMarkerSize","LegendreP","LegendreQ","LegendreType","Length","LengthWhile","LerchPhi","Less","LessEqual","LessEqualGreater","LessEqualThan","LessFullEqual","LessGreater","LessLess","LessSlantEqual","LessThan","LessTilde","LetterCharacter","LetterCounts","LetterNumber","LetterQ","Level","LeveneTest","LeviCivitaTensor","LevyDistribution","Lexicographic","LibraryDataType","LibraryFunction","LibraryFunctionError","LibraryFunctionInformation","LibraryFunctionLoad","LibraryFunctionUnload","LibraryLoad","LibraryUnload","LicenseID","LiftingFilterData","LiftingWaveletTransform","LightBlue","LightBrown","LightCyan","Lighter","LightGray","LightGreen","Lighting","LightingAngle","LightMagenta","LightOrange","LightPink","LightPurple","LightRed","LightSources","LightYellow","Likelihood","Limit","LimitsPositioning","LimitsPositioningTokens","LindleyDistribution","Line","Line3DBox","Line3DBoxOptions","LinearFilter","LinearFractionalOptimization","LinearFractionalTransform","LinearGradientImage","LinearizingTransformationData","LinearLayer","LinearModelFit","LinearOffsetFunction","LinearOptimization","LinearProgramming","LinearRecurrence","LinearSolve","LinearSolveFunction","LineBox","LineBoxOptions","LineBreak","LinebreakAdjustments","LineBreakChart","LinebreakSemicolonWeighting","LineBreakWithin","LineColor","LineGraph","LineIndent","LineIndentMaxFraction","LineIntegralConvolutionPlot","LineIntegralConvolutionScale","LineLegend","LineOpacity","LineSpacing","LineWrapParts","LinkActivate","LinkClose","LinkConnect","LinkConnectedQ","LinkCreate","LinkError","LinkFlush","LinkFunction","LinkHost","LinkInterrupt","LinkLaunch","LinkMode","LinkObject","LinkOpen","LinkOptions","LinkPatterns","LinkProtocol","LinkRankCentrality","LinkRead","LinkReadHeld","LinkReadyQ","Links","LinkService","LinkWrite","LinkWriteHeld","LiouvilleLambda","List","Listable","ListAnimate","ListContourPlot","ListContourPlot3D","ListConvolve","ListCorrelate","ListCurvePathPlot","ListDeconvolve","ListDensityPlot","ListDensityPlot3D","Listen","ListFormat","ListFourierSequenceTransform","ListInterpolation","ListLineIntegralConvolutionPlot","ListLinePlot","ListLogLinearPlot","ListLogLogPlot","ListLogPlot","ListPicker","ListPickerBox","ListPickerBoxBackground","ListPickerBoxOptions","ListPlay","ListPlot","ListPlot3D","ListPointPlot3D","ListPolarPlot","ListQ","ListSliceContourPlot3D","ListSliceDensityPlot3D","ListSliceVectorPlot3D","ListStepPlot","ListStreamDensityPlot","ListStreamPlot","ListSurfacePlot3D","ListVectorDensityPlot","ListVectorPlot","ListVectorPlot3D","ListZTransform","Literal","LiteralSearch","LocalAdaptiveBinarize","LocalCache","LocalClusteringCoefficient","LocalizeDefinitions","LocalizeVariables","LocalObject","LocalObjects","LocalResponseNormalizationLayer","LocalSubmit","LocalSymbol","LocalTime","LocalTimeZone","LocationEquivalenceTest","LocationTest","Locator","LocatorAutoCreate","LocatorBox","LocatorBoxOptions","LocatorCentering","LocatorPane","LocatorPaneBox","LocatorPaneBoxOptions","LocatorRegion","Locked","Log","Log10","Log2","LogBarnesG","LogGamma","LogGammaDistribution","LogicalExpand","LogIntegral","LogisticDistribution","LogisticSigmoid","LogitModelFit","LogLikelihood","LogLinearPlot","LogLogisticDistribution","LogLogPlot","LogMultinormalDistribution","LogNormalDistribution","LogPlot","LogRankTest","LogSeriesDistribution","LongEqual","Longest","LongestCommonSequence","LongestCommonSequencePositions","LongestCommonSubsequence","LongestCommonSubsequencePositions","LongestMatch","LongestOrderedSequence","LongForm","Longitude","LongLeftArrow","LongLeftRightArrow","LongRightArrow","LongShortTermMemoryLayer","Lookup","Loopback","LoopFreeGraphQ","Looping","LossFunction","LowerCaseQ","LowerLeftArrow","LowerRightArrow","LowerTriangularize","LowerTriangularMatrixQ","LowpassFilter","LQEstimatorGains","LQGRegulator","LQOutputRegulatorGains","LQRegulatorGains","LUBackSubstitution","LucasL","LuccioSamiComponents","LUDecomposition","LunarEclipse","LUVColor","LyapunovSolve","LyonsGroupLy","MachineID","MachineName","MachineNumberQ","MachinePrecision","MacintoshSystemPageSetup","Magenta","Magnification","Magnify","MailAddressValidation","MailExecute","MailFolder","MailItem","MailReceiverFunction","MailResponseFunction","MailSearch","MailServerConnect","MailServerConnection","MailSettings","MainSolve","MaintainDynamicCaches","Majority","MakeBoxes","MakeExpression","MakeRules","ManagedLibraryExpressionID","ManagedLibraryExpressionQ","MandelbrotSetBoettcher","MandelbrotSetDistance","MandelbrotSetIterationCount","MandelbrotSetMemberQ","MandelbrotSetPlot","MangoldtLambda","ManhattanDistance","Manipulate","Manipulator","MannedSpaceMissionData","MannWhitneyTest","MantissaExponent","Manual","Map","MapAll","MapAt","MapIndexed","MAProcess","MapThread","MarchenkoPasturDistribution","MarcumQ","MardiaCombinedTest","MardiaKurtosisTest","MardiaSkewnessTest","MarginalDistribution","MarkovProcessProperties","Masking","MatchingDissimilarity","MatchLocalNameQ","MatchLocalNames","MatchQ","Material","MathematicalFunctionData","MathematicaNotation","MathieuC","MathieuCharacteristicA","MathieuCharacteristicB","MathieuCharacteristicExponent","MathieuCPrime","MathieuGroupM11","MathieuGroupM12","MathieuGroupM22","MathieuGroupM23","MathieuGroupM24","MathieuS","MathieuSPrime","MathMLForm","MathMLText","Matrices","MatrixExp","MatrixForm","MatrixFunction","MatrixLog","MatrixNormalDistribution","MatrixPlot","MatrixPower","MatrixPropertyDistribution","MatrixQ","MatrixRank","MatrixTDistribution","Max","MaxBend","MaxCellMeasure","MaxColorDistance","MaxDate","MaxDetect","MaxDuration","MaxExtraBandwidths","MaxExtraConditions","MaxFeatureDisplacement","MaxFeatures","MaxFilter","MaximalBy","Maximize","MaxItems","MaxIterations","MaxLimit","MaxMemoryUsed","MaxMixtureKernels","MaxOverlapFraction","MaxPlotPoints","MaxPoints","MaxRecursion","MaxStableDistribution","MaxStepFraction","MaxSteps","MaxStepSize","MaxTrainingRounds","MaxValue","MaxwellDistribution","MaxWordGap","McLaughlinGroupMcL","Mean","MeanAbsoluteLossLayer","MeanAround","MeanClusteringCoefficient","MeanDegreeConnectivity","MeanDeviation","MeanFilter","MeanGraphDistance","MeanNeighborDegree","MeanShift","MeanShiftFilter","MeanSquaredLossLayer","Median","MedianDeviation","MedianFilter","MedicalTestData","Medium","MeijerG","MeijerGReduce","MeixnerDistribution","MellinConvolve","MellinTransform","MemberQ","MemoryAvailable","MemoryConstrained","MemoryConstraint","MemoryInUse","MengerMesh","Menu","MenuAppearance","MenuCommandKey","MenuEvaluator","MenuItem","MenuList","MenuPacket","MenuSortingValue","MenuStyle","MenuView","Merge","MergeDifferences","MergingFunction","MersennePrimeExponent","MersennePrimeExponentQ","Mesh","MeshCellCentroid","MeshCellCount","MeshCellHighlight","MeshCellIndex","MeshCellLabel","MeshCellMarker","MeshCellMeasure","MeshCellQuality","MeshCells","MeshCellShapeFunction","MeshCellStyle","MeshConnectivityGraph","MeshCoordinates","MeshFunctions","MeshPrimitives","MeshQualityGoal","MeshRange","MeshRefinementFunction","MeshRegion","MeshRegionQ","MeshShading","MeshStyle","Message","MessageDialog","MessageList","MessageName","MessageObject","MessageOptions","MessagePacket","Messages","MessagesNotebook","MetaCharacters","MetaInformation","MeteorShowerData","Method","MethodOptions","MexicanHatWavelet","MeyerWavelet","Midpoint","Min","MinColorDistance","MinDate","MinDetect","MineralData","MinFilter","MinimalBy","MinimalPolynomial","MinimalStateSpaceModel","Minimize","MinimumTimeIncrement","MinIntervalSize","MinkowskiQuestionMark","MinLimit","MinMax","MinorPlanetData","Minors","MinRecursion","MinSize","MinStableDistribution","Minus","MinusPlus","MinValue","Missing","MissingBehavior","MissingDataMethod","MissingDataRules","MissingQ","MissingString","MissingStyle","MissingValuePattern","MittagLefflerE","MixedFractionParts","MixedGraphQ","MixedMagnitude","MixedRadix","MixedRadixQuantity","MixedUnit","MixtureDistribution","Mod","Modal","Mode","Modular","ModularInverse","ModularLambda","Module","Modulus","MoebiusMu","Molecule","MoleculeContainsQ","MoleculeEquivalentQ","MoleculeGraph","MoleculeModify","MoleculePattern","MoleculePlot","MoleculePlot3D","MoleculeProperty","MoleculeQ","MoleculeRecognize","MoleculeValue","Moment","Momentary","MomentConvert","MomentEvaluate","MomentGeneratingFunction","MomentOfInertia","Monday","Monitor","MonomialList","MonomialOrder","MonsterGroupM","MoonPhase","MoonPosition","MorletWavelet","MorphologicalBinarize","MorphologicalBranchPoints","MorphologicalComponents","MorphologicalEulerNumber","MorphologicalGraph","MorphologicalPerimeter","MorphologicalTransform","MortalityData","Most","MountainData","MouseAnnotation","MouseAppearance","MouseAppearanceTag","MouseButtons","Mouseover","MousePointerNote","MousePosition","MovieData","MovingAverage","MovingMap","MovingMedian","MoyalDistribution","Multicolumn","MultiedgeStyle","MultigraphQ","MultilaunchWarning","MultiLetterItalics","MultiLetterStyle","MultilineFunction","Multinomial","MultinomialDistribution","MultinormalDistribution","MultiplicativeOrder","Multiplicity","MultiplySides","Multiselection","MultivariateHypergeometricDistribution","MultivariatePoissonDistribution","MultivariateTDistribution","N","NakagamiDistribution","NameQ","Names","NamespaceBox","NamespaceBoxOptions","Nand","NArgMax","NArgMin","NBernoulliB","NBodySimulation","NBodySimulationData","NCache","NDEigensystem","NDEigenvalues","NDSolve","NDSolveValue","Nearest","NearestFunction","NearestMeshCells","NearestNeighborGraph","NearestTo","NebulaData","NeedCurrentFrontEndPackagePacket","NeedCurrentFrontEndSymbolsPacket","NeedlemanWunschSimilarity","Needs","Negative","NegativeBinomialDistribution","NegativeDefiniteMatrixQ","NegativeIntegers","NegativeMultinomialDistribution","NegativeRationals","NegativeReals","NegativeSemidefiniteMatrixQ","NeighborhoodData","NeighborhoodGraph","Nest","NestedGreaterGreater","NestedLessLess","NestedScriptRules","NestGraph","NestList","NestWhile","NestWhileList","NetAppend","NetBidirectionalOperator","NetChain","NetDecoder","NetDelete","NetDrop","NetEncoder","NetEvaluationMode","NetExtract","NetFlatten","NetFoldOperator","NetGANOperator","NetGraph","NetInformation","NetInitialize","NetInsert","NetInsertSharedArrays","NetJoin","NetMapOperator","NetMapThreadOperator","NetMeasurements","NetModel","NetNestOperator","NetPairEmbeddingOperator","NetPort","NetPortGradient","NetPrepend","NetRename","NetReplace","NetReplacePart","NetSharedArray","NetStateObject","NetTake","NetTrain","NetTrainResultsObject","NetworkPacketCapture","NetworkPacketRecording","NetworkPacketRecordingDuring","NetworkPacketTrace","NeumannValue","NevilleThetaC","NevilleThetaD","NevilleThetaN","NevilleThetaS","NewPrimitiveStyle","NExpectation","Next","NextCell","NextDate","NextPrime","NextScheduledTaskTime","NHoldAll","NHoldFirst","NHoldRest","NicholsGridLines","NicholsPlot","NightHemisphere","NIntegrate","NMaximize","NMaxValue","NMinimize","NMinValue","NominalVariables","NonAssociative","NoncentralBetaDistribution","NoncentralChiSquareDistribution","NoncentralFRatioDistribution","NoncentralStudentTDistribution","NonCommutativeMultiply","NonConstants","NondimensionalizationTransform","None","NoneTrue","NonlinearModelFit","NonlinearStateSpaceModel","NonlocalMeansFilter","NonNegative","NonNegativeIntegers","NonNegativeRationals","NonNegativeReals","NonPositive","NonPositiveIntegers","NonPositiveRationals","NonPositiveReals","Nor","NorlundB","Norm","Normal","NormalDistribution","NormalGrouping","NormalizationLayer","Normalize","Normalized","NormalizedSquaredEuclideanDistance","NormalMatrixQ","NormalsFunction","NormFunction","Not","NotCongruent","NotCupCap","NotDoubleVerticalBar","Notebook","NotebookApply","NotebookAutoSave","NotebookClose","NotebookConvertSettings","NotebookCreate","NotebookCreateReturnObject","NotebookDefault","NotebookDelete","NotebookDirectory","NotebookDynamicExpression","NotebookEvaluate","NotebookEventActions","NotebookFileName","NotebookFind","NotebookFindReturnObject","NotebookGet","NotebookGetLayoutInformationPacket","NotebookGetMisspellingsPacket","NotebookImport","NotebookInformation","NotebookInterfaceObject","NotebookLocate","NotebookObject","NotebookOpen","NotebookOpenReturnObject","NotebookPath","NotebookPrint","NotebookPut","NotebookPutReturnObject","NotebookRead","NotebookResetGeneratedCells","Notebooks","NotebookSave","NotebookSaveAs","NotebookSelection","NotebookSetupLayoutInformationPacket","NotebooksMenu","NotebookTemplate","NotebookWrite","NotElement","NotEqualTilde","NotExists","NotGreater","NotGreaterEqual","NotGreaterFullEqual","NotGreaterGreater","NotGreaterLess","NotGreaterSlantEqual","NotGreaterTilde","Nothing","NotHumpDownHump","NotHumpEqual","NotificationFunction","NotLeftTriangle","NotLeftTriangleBar","NotLeftTriangleEqual","NotLess","NotLessEqual","NotLessFullEqual","NotLessGreater","NotLessLess","NotLessSlantEqual","NotLessTilde","NotNestedGreaterGreater","NotNestedLessLess","NotPrecedes","NotPrecedesEqual","NotPrecedesSlantEqual","NotPrecedesTilde","NotReverseElement","NotRightTriangle","NotRightTriangleBar","NotRightTriangleEqual","NotSquareSubset","NotSquareSubsetEqual","NotSquareSuperset","NotSquareSupersetEqual","NotSubset","NotSubsetEqual","NotSucceeds","NotSucceedsEqual","NotSucceedsSlantEqual","NotSucceedsTilde","NotSuperset","NotSupersetEqual","NotTilde","NotTildeEqual","NotTildeFullEqual","NotTildeTilde","NotVerticalBar","Now","NoWhitespace","NProbability","NProduct","NProductFactors","NRoots","NSolve","NSum","NSumTerms","NuclearExplosionData","NuclearReactorData","Null","NullRecords","NullSpace","NullWords","Number","NumberCompose","NumberDecompose","NumberExpand","NumberFieldClassNumber","NumberFieldDiscriminant","NumberFieldFundamentalUnits","NumberFieldIntegralBasis","NumberFieldNormRepresentatives","NumberFieldRegulator","NumberFieldRootsOfUnity","NumberFieldSignature","NumberForm","NumberFormat","NumberLinePlot","NumberMarks","NumberMultiplier","NumberPadding","NumberPoint","NumberQ","NumberSeparator","NumberSigns","NumberString","Numerator","NumeratorDenominator","NumericalOrder","NumericalSort","NumericArray","NumericArrayQ","NumericArrayType","NumericFunction","NumericQ","NuttallWindow","NValues","NyquistGridLines","NyquistPlot","O","ObservabilityGramian","ObservabilityMatrix","ObservableDecomposition","ObservableModelQ","OceanData","Octahedron","OddQ","Off","Offset","OLEData","On","ONanGroupON","Once","OneIdentity","Opacity","OpacityFunction","OpacityFunctionScaling","Open","OpenAppend","Opener","OpenerBox","OpenerBoxOptions","OpenerView","OpenFunctionInspectorPacket","Opening","OpenRead","OpenSpecialOptions","OpenTemporary","OpenWrite","Operate","OperatingSystem","OperatorApplied","OptimumFlowData","Optional","OptionalElement","OptionInspectorSettings","OptionQ","Options","OptionsPacket","OptionsPattern","OptionValue","OptionValueBox","OptionValueBoxOptions","Or","Orange","Order","OrderDistribution","OrderedQ","Ordering","OrderingBy","OrderingLayer","Orderless","OrderlessPatternSequence","OrnsteinUhlenbeckProcess","Orthogonalize","OrthogonalMatrixQ","Out","Outer","OuterPolygon","OuterPolyhedron","OutputAutoOverwrite","OutputControllabilityMatrix","OutputControllableModelQ","OutputForm","OutputFormData","OutputGrouping","OutputMathEditExpression","OutputNamePacket","OutputResponse","OutputSizeLimit","OutputStream","Over","OverBar","OverDot","Overflow","OverHat","Overlaps","Overlay","OverlayBox","OverlayBoxOptions","Overscript","OverscriptBox","OverscriptBoxOptions","OverTilde","OverVector","OverwriteTarget","OwenT","OwnValues","Package","PackingMethod","PackPaclet","PacletDataRebuild","PacletDirectoryAdd","PacletDirectoryLoad","PacletDirectoryRemove","PacletDirectoryUnload","PacletDisable","PacletEnable","PacletFind","PacletFindRemote","PacletInformation","PacletInstall","PacletInstallSubmit","PacletNewerQ","PacletObject","PacletObjectQ","PacletSite","PacletSiteObject","PacletSiteRegister","PacletSites","PacletSiteUnregister","PacletSiteUpdate","PacletUninstall","PacletUpdate","PaddedForm","Padding","PaddingLayer","PaddingSize","PadeApproximant","PadLeft","PadRight","PageBreakAbove","PageBreakBelow","PageBreakWithin","PageFooterLines","PageFooters","PageHeaderLines","PageHeaders","PageHeight","PageRankCentrality","PageTheme","PageWidth","Pagination","PairedBarChart","PairedHistogram","PairedSmoothHistogram","PairedTTest","PairedZTest","PaletteNotebook","PalettePath","PalindromeQ","Pane","PaneBox","PaneBoxOptions","Panel","PanelBox","PanelBoxOptions","Paneled","PaneSelector","PaneSelectorBox","PaneSelectorBoxOptions","PaperWidth","ParabolicCylinderD","ParagraphIndent","ParagraphSpacing","ParallelArray","ParallelCombine","ParallelDo","Parallelepiped","ParallelEvaluate","Parallelization","Parallelize","ParallelMap","ParallelNeeds","Parallelogram","ParallelProduct","ParallelSubmit","ParallelSum","ParallelTable","ParallelTry","Parameter","ParameterEstimator","ParameterMixtureDistribution","ParameterVariables","ParametricFunction","ParametricNDSolve","ParametricNDSolveValue","ParametricPlot","ParametricPlot3D","ParametricRampLayer","ParametricRegion","ParentBox","ParentCell","ParentConnect","ParentDirectory","ParentForm","Parenthesize","ParentList","ParentNotebook","ParetoDistribution","ParetoPickandsDistribution","ParkData","Part","PartBehavior","PartialCorrelationFunction","PartialD","ParticleAcceleratorData","ParticleData","Partition","PartitionGranularity","PartitionsP","PartitionsQ","PartLayer","PartOfSpeech","PartProtection","ParzenWindow","PascalDistribution","PassEventsDown","PassEventsUp","Paste","PasteAutoQuoteCharacters","PasteBoxFormInlineCells","PasteButton","Path","PathGraph","PathGraphQ","Pattern","PatternFilling","PatternSequence","PatternTest","PauliMatrix","PaulWavelet","Pause","PausedTime","PDF","PeakDetect","PeanoCurve","PearsonChiSquareTest","PearsonCorrelationTest","PearsonDistribution","PercentForm","PerfectNumber","PerfectNumberQ","PerformanceGoal","Perimeter","PeriodicBoundaryCondition","PeriodicInterpolation","Periodogram","PeriodogramArray","Permanent","Permissions","PermissionsGroup","PermissionsGroupMemberQ","PermissionsGroups","PermissionsKey","PermissionsKeys","PermutationCycles","PermutationCyclesQ","PermutationGroup","PermutationLength","PermutationList","PermutationListQ","PermutationMax","PermutationMin","PermutationOrder","PermutationPower","PermutationProduct","PermutationReplace","Permutations","PermutationSupport","Permute","PeronaMalikFilter","Perpendicular","PerpendicularBisector","PersistenceLocation","PersistenceTime","PersistentObject","PersistentObjects","PersistentValue","PersonData","PERTDistribution","PetersenGraph","PhaseMargins","PhaseRange","PhysicalSystemData","Pi","Pick","PIDData","PIDDerivativeFilter","PIDFeedforward","PIDTune","Piecewise","PiecewiseExpand","PieChart","PieChart3D","PillaiTrace","PillaiTraceTest","PingTime","Pink","PitchRecognize","Pivoting","PixelConstrained","PixelValue","PixelValuePositions","Placed","Placeholder","PlaceholderReplace","Plain","PlanarAngle","PlanarGraph","PlanarGraphQ","PlanckRadiationLaw","PlaneCurveData","PlanetaryMoonData","PlanetData","PlantData","Play","PlayRange","Plot","Plot3D","Plot3Matrix","PlotDivision","PlotJoined","PlotLabel","PlotLabels","PlotLayout","PlotLegends","PlotMarkers","PlotPoints","PlotRange","PlotRangeClipping","PlotRangeClipPlanesStyle","PlotRangePadding","PlotRegion","PlotStyle","PlotTheme","Pluralize","Plus","PlusMinus","Pochhammer","PodStates","PodWidth","Point","Point3DBox","Point3DBoxOptions","PointBox","PointBoxOptions","PointFigureChart","PointLegend","PointSize","PoissonConsulDistribution","PoissonDistribution","PoissonProcess","PoissonWindow","PolarAxes","PolarAxesOrigin","PolarGridLines","PolarPlot","PolarTicks","PoleZeroMarkers","PolyaAeppliDistribution","PolyGamma","Polygon","Polygon3DBox","Polygon3DBoxOptions","PolygonalNumber","PolygonAngle","PolygonBox","PolygonBoxOptions","PolygonCoordinates","PolygonDecomposition","PolygonHoleScale","PolygonIntersections","PolygonScale","Polyhedron","PolyhedronAngle","PolyhedronCoordinates","PolyhedronData","PolyhedronDecomposition","PolyhedronGenus","PolyLog","PolynomialExtendedGCD","PolynomialForm","PolynomialGCD","PolynomialLCM","PolynomialMod","PolynomialQ","PolynomialQuotient","PolynomialQuotientRemainder","PolynomialReduce","PolynomialRemainder","Polynomials","PoolingLayer","PopupMenu","PopupMenuBox","PopupMenuBoxOptions","PopupView","PopupWindow","Position","PositionIndex","Positive","PositiveDefiniteMatrixQ","PositiveIntegers","PositiveRationals","PositiveReals","PositiveSemidefiniteMatrixQ","PossibleZeroQ","Postfix","PostScript","Power","PowerDistribution","PowerExpand","PowerMod","PowerModList","PowerRange","PowerSpectralDensity","PowersRepresentations","PowerSymmetricPolynomial","Precedence","PrecedenceForm","Precedes","PrecedesEqual","PrecedesSlantEqual","PrecedesTilde","Precision","PrecisionGoal","PreDecrement","Predict","PredictionRoot","PredictorFunction","PredictorInformation","PredictorMeasurements","PredictorMeasurementsObject","PreemptProtect","PreferencesPath","Prefix","PreIncrement","Prepend","PrependLayer","PrependTo","PreprocessingRules","PreserveColor","PreserveImageOptions","Previous","PreviousCell","PreviousDate","PriceGraphDistribution","PrimaryPlaceholder","Prime","PrimeNu","PrimeOmega","PrimePi","PrimePowerQ","PrimeQ","Primes","PrimeZetaP","PrimitivePolynomialQ","PrimitiveRoot","PrimitiveRootList","PrincipalComponents","PrincipalValue","Print","PrintableASCIIQ","PrintAction","PrintForm","PrintingCopies","PrintingOptions","PrintingPageRange","PrintingStartingPageNumber","PrintingStyleEnvironment","Printout3D","Printout3DPreviewer","PrintPrecision","PrintTemporary","Prism","PrismBox","PrismBoxOptions","PrivateCellOptions","PrivateEvaluationOptions","PrivateFontOptions","PrivateFrontEndOptions","PrivateKey","PrivateNotebookOptions","PrivatePaths","Probability","ProbabilityDistribution","ProbabilityPlot","ProbabilityPr","ProbabilityScalePlot","ProbitModelFit","ProcessConnection","ProcessDirectory","ProcessEnvironment","Processes","ProcessEstimator","ProcessInformation","ProcessObject","ProcessParameterAssumptions","ProcessParameterQ","ProcessStateDomain","ProcessStatus","ProcessTimeDomain","Product","ProductDistribution","ProductLog","ProgressIndicator","ProgressIndicatorBox","ProgressIndicatorBoxOptions","Projection","Prolog","PromptForm","ProofObject","Properties","Property","PropertyList","PropertyValue","Proportion","Proportional","Protect","Protected","ProteinData","Pruning","PseudoInverse","PsychrometricPropertyData","PublicKey","PublisherID","PulsarData","PunctuationCharacter","Purple","Put","PutAppend","Pyramid","PyramidBox","PyramidBoxOptions","QBinomial","QFactorial","QGamma","QHypergeometricPFQ","QnDispersion","QPochhammer","QPolyGamma","QRDecomposition","QuadraticIrrationalQ","QuadraticOptimization","Quantile","QuantilePlot","Quantity","QuantityArray","QuantityDistribution","QuantityForm","QuantityMagnitude","QuantityQ","QuantityUnit","QuantityVariable","QuantityVariableCanonicalUnit","QuantityVariableDimensions","QuantityVariableIdentifier","QuantityVariablePhysicalQuantity","Quartics","QuartileDeviation","Quartiles","QuartileSkewness","Query","QueueingNetworkProcess","QueueingProcess","QueueProperties","Quiet","Quit","Quotient","QuotientRemainder","RadialGradientImage","RadialityCentrality","RadicalBox","RadicalBoxOptions","RadioButton","RadioButtonBar","RadioButtonBox","RadioButtonBoxOptions","Radon","RadonTransform","RamanujanTau","RamanujanTauL","RamanujanTauTheta","RamanujanTauZ","Ramp","Random","RandomChoice","RandomColor","RandomComplex","RandomEntity","RandomFunction","RandomGeoPosition","RandomGraph","RandomImage","RandomInstance","RandomInteger","RandomPermutation","RandomPoint","RandomPolygon","RandomPolyhedron","RandomPrime","RandomReal","RandomSample","RandomSeed","RandomSeeding","RandomVariate","RandomWalkProcess","RandomWord","Range","RangeFilter","RangeSpecification","RankedMax","RankedMin","RarerProbability","Raster","Raster3D","Raster3DBox","Raster3DBoxOptions","RasterArray","RasterBox","RasterBoxOptions","Rasterize","RasterSize","Rational","RationalFunctions","Rationalize","Rationals","Ratios","RawArray","RawBoxes","RawData","RawMedium","RayleighDistribution","Re","Read","ReadByteArray","ReadLine","ReadList","ReadProtected","ReadString","Real","RealAbs","RealBlockDiagonalForm","RealDigits","RealExponent","Reals","RealSign","Reap","RebuildPacletData","RecognitionPrior","RecognitionThreshold","Record","RecordLists","RecordSeparators","Rectangle","RectangleBox","RectangleBoxOptions","RectangleChart","RectangleChart3D","RectangularRepeatingElement","RecurrenceFilter","RecurrenceTable","RecurringDigitsForm","Red","Reduce","RefBox","ReferenceLineStyle","ReferenceMarkers","ReferenceMarkerStyle","Refine","ReflectionMatrix","ReflectionTransform","Refresh","RefreshRate","Region","RegionBinarize","RegionBoundary","RegionBoundaryStyle","RegionBounds","RegionCentroid","RegionDifference","RegionDimension","RegionDisjoint","RegionDistance","RegionDistanceFunction","RegionEmbeddingDimension","RegionEqual","RegionFillingStyle","RegionFunction","RegionImage","RegionIntersection","RegionMeasure","RegionMember","RegionMemberFunction","RegionMoment","RegionNearest","RegionNearestFunction","RegionPlot","RegionPlot3D","RegionProduct","RegionQ","RegionResize","RegionSize","RegionSymmetricDifference","RegionUnion","RegionWithin","RegisterExternalEvaluator","RegularExpression","Regularization","RegularlySampledQ","RegularPolygon","ReIm","ReImLabels","ReImPlot","ReImStyle","Reinstall","RelationalDatabase","RelationGraph","Release","ReleaseHold","ReliabilityDistribution","ReliefImage","ReliefPlot","RemoteAuthorizationCaching","RemoteConnect","RemoteConnectionObject","RemoteFile","RemoteRun","RemoteRunProcess","Remove","RemoveAlphaChannel","RemoveAsynchronousTask","RemoveAudioStream","RemoveBackground","RemoveChannelListener","RemoveChannelSubscribers","Removed","RemoveDiacritics","RemoveInputStreamMethod","RemoveOutputStreamMethod","RemoveProperty","RemoveScheduledTask","RemoveUsers","RemoveVideoStream","RenameDirectory","RenameFile","RenderAll","RenderingOptions","RenewalProcess","RenkoChart","RepairMesh","Repeated","RepeatedNull","RepeatedString","RepeatedTiming","RepeatingElement","Replace","ReplaceAll","ReplaceHeldPart","ReplaceImageValue","ReplaceList","ReplacePart","ReplacePixelValue","ReplaceRepeated","ReplicateLayer","RequiredPhysicalQuantities","Resampling","ResamplingAlgorithmData","ResamplingMethod","Rescale","RescalingTransform","ResetDirectory","ResetMenusPacket","ResetScheduledTask","ReshapeLayer","Residue","ResizeLayer","Resolve","ResourceAcquire","ResourceData","ResourceFunction","ResourceObject","ResourceRegister","ResourceRemove","ResourceSearch","ResourceSubmissionObject","ResourceSubmit","ResourceSystemBase","ResourceSystemPath","ResourceUpdate","ResourceVersion","ResponseForm","Rest","RestartInterval","Restricted","Resultant","ResumePacket","Return","ReturnEntersInput","ReturnExpressionPacket","ReturnInputFormPacket","ReturnPacket","ReturnReceiptFunction","ReturnTextPacket","Reverse","ReverseApplied","ReverseBiorthogonalSplineWavelet","ReverseElement","ReverseEquilibrium","ReverseGraph","ReverseSort","ReverseSortBy","ReverseUpEquilibrium","RevolutionAxis","RevolutionPlot3D","RGBColor","RiccatiSolve","RiceDistribution","RidgeFilter","RiemannR","RiemannSiegelTheta","RiemannSiegelZ","RiemannXi","Riffle","Right","RightArrow","RightArrowBar","RightArrowLeftArrow","RightComposition","RightCosetRepresentative","RightDownTeeVector","RightDownVector","RightDownVectorBar","RightTee","RightTeeArrow","RightTeeVector","RightTriangle","RightTriangleBar","RightTriangleEqual","RightUpDownVector","RightUpTeeVector","RightUpVector","RightUpVectorBar","RightVector","RightVectorBar","RiskAchievementImportance","RiskReductionImportance","RogersTanimotoDissimilarity","RollPitchYawAngles","RollPitchYawMatrix","RomanNumeral","Root","RootApproximant","RootIntervals","RootLocusPlot","RootMeanSquare","RootOfUnityQ","RootReduce","Roots","RootSum","Rotate","RotateLabel","RotateLeft","RotateRight","RotationAction","RotationBox","RotationBoxOptions","RotationMatrix","RotationTransform","Round","RoundImplies","RoundingRadius","Row","RowAlignments","RowBackgrounds","RowBox","RowHeights","RowLines","RowMinHeight","RowReduce","RowsEqual","RowSpacings","RSolve","RSolveValue","RudinShapiro","RudvalisGroupRu","Rule","RuleCondition","RuleDelayed","RuleForm","RulePlot","RulerUnits","Run","RunProcess","RunScheduledTask","RunThrough","RuntimeAttributes","RuntimeOptions","RussellRaoDissimilarity","SameQ","SameTest","SameTestProperties","SampledEntityClass","SampleDepth","SampledSoundFunction","SampledSoundList","SampleRate","SamplingPeriod","SARIMAProcess","SARMAProcess","SASTriangle","SatelliteData","SatisfiabilityCount","SatisfiabilityInstances","SatisfiableQ","Saturday","Save","Saveable","SaveAutoDelete","SaveConnection","SaveDefinitions","SavitzkyGolayMatrix","SawtoothWave","Scale","Scaled","ScaleDivisions","ScaledMousePosition","ScaleOrigin","ScalePadding","ScaleRanges","ScaleRangeStyle","ScalingFunctions","ScalingMatrix","ScalingTransform","Scan","ScheduledTask","ScheduledTaskActiveQ","ScheduledTaskInformation","ScheduledTaskInformationData","ScheduledTaskObject","ScheduledTasks","SchurDecomposition","ScientificForm","ScientificNotationThreshold","ScorerGi","ScorerGiPrime","ScorerHi","ScorerHiPrime","ScreenRectangle","ScreenStyleEnvironment","ScriptBaselineShifts","ScriptForm","ScriptLevel","ScriptMinSize","ScriptRules","ScriptSizeMultipliers","Scrollbars","ScrollingOptions","ScrollPosition","SearchAdjustment","SearchIndexObject","SearchIndices","SearchQueryString","SearchResultObject","Sec","Sech","SechDistribution","SecondOrderConeOptimization","SectionGrouping","SectorChart","SectorChart3D","SectorOrigin","SectorSpacing","SecuredAuthenticationKey","SecuredAuthenticationKeys","SeedRandom","Select","Selectable","SelectComponents","SelectedCells","SelectedNotebook","SelectFirst","Selection","SelectionAnimate","SelectionCell","SelectionCellCreateCell","SelectionCellDefaultStyle","SelectionCellParentStyle","SelectionCreateCell","SelectionDebuggerTag","SelectionDuplicateCell","SelectionEvaluate","SelectionEvaluateCreateCell","SelectionMove","SelectionPlaceholder","SelectionSetStyle","SelectWithContents","SelfLoops","SelfLoopStyle","SemanticImport","SemanticImportString","SemanticInterpretation","SemialgebraicComponentInstances","SemidefiniteOptimization","SendMail","SendMessage","Sequence","SequenceAlignment","SequenceAttentionLayer","SequenceCases","SequenceCount","SequenceFold","SequenceFoldList","SequenceForm","SequenceHold","SequenceLastLayer","SequenceMostLayer","SequencePosition","SequencePredict","SequencePredictorFunction","SequenceReplace","SequenceRestLayer","SequenceReverseLayer","SequenceSplit","Series","SeriesCoefficient","SeriesData","SeriesTermGoal","ServiceConnect","ServiceDisconnect","ServiceExecute","ServiceObject","ServiceRequest","ServiceResponse","ServiceSubmit","SessionSubmit","SessionTime","Set","SetAccuracy","SetAlphaChannel","SetAttributes","Setbacks","SetBoxFormNamesPacket","SetCloudDirectory","SetCookies","SetDelayed","SetDirectory","SetEnvironment","SetEvaluationNotebook","SetFileDate","SetFileLoadingContext","SetNotebookStatusLine","SetOptions","SetOptionsPacket","SetPermissions","SetPrecision","SetProperty","SetSecuredAuthenticationKey","SetSelectedNotebook","SetSharedFunction","SetSharedVariable","SetSpeechParametersPacket","SetStreamPosition","SetSystemModel","SetSystemOptions","Setter","SetterBar","SetterBox","SetterBoxOptions","Setting","SetUsers","SetValue","Shading","Shallow","ShannonWavelet","ShapiroWilkTest","Share","SharingList","Sharpen","ShearingMatrix","ShearingTransform","ShellRegion","ShenCastanMatrix","ShiftedGompertzDistribution","ShiftRegisterSequence","Short","ShortDownArrow","Shortest","ShortestMatch","ShortestPathFunction","ShortLeftArrow","ShortRightArrow","ShortTimeFourier","ShortTimeFourierData","ShortUpArrow","Show","ShowAutoConvert","ShowAutoSpellCheck","ShowAutoStyles","ShowCellBracket","ShowCellLabel","ShowCellTags","ShowClosedCellArea","ShowCodeAssist","ShowContents","ShowControls","ShowCursorTracker","ShowGroupOpenCloseIcon","ShowGroupOpener","ShowInvisibleCharacters","ShowPageBreaks","ShowPredictiveInterface","ShowSelection","ShowShortBoxForm","ShowSpecialCharacters","ShowStringCharacters","ShowSyntaxStyles","ShrinkingDelay","ShrinkWrapBoundingBox","SiderealTime","SiegelTheta","SiegelTukeyTest","SierpinskiCurve","SierpinskiMesh","Sign","Signature","SignedRankTest","SignedRegionDistance","SignificanceLevel","SignPadding","SignTest","SimilarityRules","SimpleGraph","SimpleGraphQ","SimplePolygonQ","SimplePolyhedronQ","Simplex","Simplify","Sin","Sinc","SinghMaddalaDistribution","SingleEvaluation","SingleLetterItalics","SingleLetterStyle","SingularValueDecomposition","SingularValueList","SingularValuePlot","SingularValues","Sinh","SinhIntegral","SinIntegral","SixJSymbol","Skeleton","SkeletonTransform","SkellamDistribution","Skewness","SkewNormalDistribution","SkinStyle","Skip","SliceContourPlot3D","SliceDensityPlot3D","SliceDistribution","SliceVectorPlot3D","Slider","Slider2D","Slider2DBox","Slider2DBoxOptions","SliderBox","SliderBoxOptions","SlideView","Slot","SlotSequence","Small","SmallCircle","Smaller","SmithDecomposition","SmithDelayCompensator","SmithWatermanSimilarity","SmoothDensityHistogram","SmoothHistogram","SmoothHistogram3D","SmoothKernelDistribution","SnDispersion","Snippet","SnubPolyhedron","SocialMediaData","Socket","SocketConnect","SocketListen","SocketListener","SocketObject","SocketOpen","SocketReadMessage","SocketReadyQ","Sockets","SocketWaitAll","SocketWaitNext","SoftmaxLayer","SokalSneathDissimilarity","SolarEclipse","SolarSystemFeatureData","SolidAngle","SolidData","SolidRegionQ","Solve","SolveAlways","SolveDelayed","Sort","SortBy","SortedBy","SortedEntityClass","Sound","SoundAndGraphics","SoundNote","SoundVolume","SourceLink","Sow","Space","SpaceCurveData","SpaceForm","Spacer","Spacings","Span","SpanAdjustments","SpanCharacterRounding","SpanFromAbove","SpanFromBoth","SpanFromLeft","SpanLineThickness","SpanMaxSize","SpanMinSize","SpanningCharacters","SpanSymmetric","SparseArray","SpatialGraphDistribution","SpatialMedian","SpatialTransformationLayer","Speak","SpeakerMatchQ","SpeakTextPacket","SpearmanRankTest","SpearmanRho","SpeciesData","SpecificityGoal","SpectralLineData","Spectrogram","SpectrogramArray","Specularity","SpeechCases","SpeechInterpreter","SpeechRecognize","SpeechSynthesize","SpellingCorrection","SpellingCorrectionList","SpellingDictionaries","SpellingDictionariesPath","SpellingOptions","SpellingSuggestionsPacket","Sphere","SphereBox","SpherePoints","SphericalBesselJ","SphericalBesselY","SphericalHankelH1","SphericalHankelH2","SphericalHarmonicY","SphericalPlot3D","SphericalRegion","SphericalShell","SpheroidalEigenvalue","SpheroidalJoiningFactor","SpheroidalPS","SpheroidalPSPrime","SpheroidalQS","SpheroidalQSPrime","SpheroidalRadialFactor","SpheroidalS1","SpheroidalS1Prime","SpheroidalS2","SpheroidalS2Prime","Splice","SplicedDistribution","SplineClosed","SplineDegree","SplineKnots","SplineWeights","Split","SplitBy","SpokenString","Sqrt","SqrtBox","SqrtBoxOptions","Square","SquaredEuclideanDistance","SquareFreeQ","SquareIntersection","SquareMatrixQ","SquareRepeatingElement","SquaresR","SquareSubset","SquareSubsetEqual","SquareSuperset","SquareSupersetEqual","SquareUnion","SquareWave","SSSTriangle","StabilityMargins","StabilityMarginsStyle","StableDistribution","Stack","StackBegin","StackComplete","StackedDateListPlot","StackedListPlot","StackInhibit","StadiumShape","StandardAtmosphereData","StandardDeviation","StandardDeviationFilter","StandardForm","Standardize","Standardized","StandardOceanData","StandbyDistribution","Star","StarClusterData","StarData","StarGraph","StartAsynchronousTask","StartExternalSession","StartingStepSize","StartOfLine","StartOfString","StartProcess","StartScheduledTask","StartupSound","StartWebSession","StateDimensions","StateFeedbackGains","StateOutputEstimator","StateResponse","StateSpaceModel","StateSpaceRealization","StateSpaceTransform","StateTransformationLinearize","StationaryDistribution","StationaryWaveletPacketTransform","StationaryWaveletTransform","StatusArea","StatusCentrality","StepMonitor","StereochemistryElements","StieltjesGamma","StippleShading","StirlingS1","StirlingS2","StopAsynchronousTask","StoppingPowerData","StopScheduledTask","StrataVariables","StratonovichProcess","StreamColorFunction","StreamColorFunctionScaling","StreamDensityPlot","StreamMarkers","StreamPlot","StreamPoints","StreamPosition","Streams","StreamScale","StreamStyle","String","StringBreak","StringByteCount","StringCases","StringContainsQ","StringCount","StringDelete","StringDrop","StringEndsQ","StringExpression","StringExtract","StringForm","StringFormat","StringFreeQ","StringInsert","StringJoin","StringLength","StringMatchQ","StringPadLeft","StringPadRight","StringPart","StringPartition","StringPosition","StringQ","StringRepeat","StringReplace","StringReplaceList","StringReplacePart","StringReverse","StringRiffle","StringRotateLeft","StringRotateRight","StringSkeleton","StringSplit","StringStartsQ","StringTake","StringTemplate","StringToByteArray","StringToStream","StringTrim","StripBoxes","StripOnInput","StripWrapperBoxes","StrokeForm","StructuralImportance","StructuredArray","StructuredArrayHeadQ","StructuredSelection","StruveH","StruveL","Stub","StudentTDistribution","Style","StyleBox","StyleBoxAutoDelete","StyleData","StyleDefinitions","StyleForm","StyleHints","StyleKeyMapping","StyleMenuListing","StyleNameDialogSettings","StyleNames","StylePrint","StyleSheetPath","Subdivide","Subfactorial","Subgraph","SubMinus","SubPlus","SubresultantPolynomialRemainders","SubresultantPolynomials","Subresultants","Subscript","SubscriptBox","SubscriptBoxOptions","Subscripted","Subsequences","Subset","SubsetCases","SubsetCount","SubsetEqual","SubsetMap","SubsetPosition","SubsetQ","SubsetReplace","Subsets","SubStar","SubstitutionSystem","Subsuperscript","SubsuperscriptBox","SubsuperscriptBoxOptions","SubtitleEncoding","SubtitleTracks","Subtract","SubtractFrom","SubtractSides","SubValues","Succeeds","SucceedsEqual","SucceedsSlantEqual","SucceedsTilde","Success","SuchThat","Sum","SumConvergence","SummationLayer","Sunday","SunPosition","Sunrise","Sunset","SuperDagger","SuperMinus","SupernovaData","SuperPlus","Superscript","SuperscriptBox","SuperscriptBoxOptions","Superset","SupersetEqual","SuperStar","Surd","SurdForm","SurfaceAppearance","SurfaceArea","SurfaceColor","SurfaceData","SurfaceGraphics","SurvivalDistribution","SurvivalFunction","SurvivalModel","SurvivalModelFit","SuspendPacket","SuzukiDistribution","SuzukiGroupSuz","SwatchLegend","Switch","Symbol","SymbolName","SymletWavelet","Symmetric","SymmetricGroup","SymmetricKey","SymmetricMatrixQ","SymmetricPolynomial","SymmetricReduction","Symmetrize","SymmetrizedArray","SymmetrizedArrayRules","SymmetrizedDependentComponents","SymmetrizedIndependentComponents","SymmetrizedReplacePart","SynchronousInitialization","SynchronousUpdating","Synonyms","Syntax","SyntaxForm","SyntaxInformation","SyntaxLength","SyntaxPacket","SyntaxQ","SynthesizeMissingValues","SystemCredential","SystemCredentialData","SystemCredentialKey","SystemCredentialKeys","SystemCredentialStoreObject","SystemDialogInput","SystemException","SystemGet","SystemHelpPath","SystemInformation","SystemInformationData","SystemInstall","SystemModel","SystemModeler","SystemModelExamples","SystemModelLinearize","SystemModelParametricSimulate","SystemModelPlot","SystemModelProgressReporting","SystemModelReliability","SystemModels","SystemModelSimulate","SystemModelSimulateSensitivity","SystemModelSimulationData","SystemOpen","SystemOptions","SystemProcessData","SystemProcesses","SystemsConnectionsModel","SystemsModelDelay","SystemsModelDelayApproximate","SystemsModelDelete","SystemsModelDimensions","SystemsModelExtract","SystemsModelFeedbackConnect","SystemsModelLabels","SystemsModelLinearity","SystemsModelMerge","SystemsModelOrder","SystemsModelParallelConnect","SystemsModelSeriesConnect","SystemsModelStateFeedbackConnect","SystemsModelVectorRelativeOrders","SystemStub","SystemTest","Tab","TabFilling","Table","TableAlignments","TableDepth","TableDirections","TableForm","TableHeadings","TableSpacing","TableView","TableViewBox","TableViewBoxBackground","TableViewBoxItemSize","TableViewBoxOptions","TabSpacings","TabView","TabViewBox","TabViewBoxOptions","TagBox","TagBoxNote","TagBoxOptions","TaggingRules","TagSet","TagSetDelayed","TagStyle","TagUnset","Take","TakeDrop","TakeLargest","TakeLargestBy","TakeList","TakeSmallest","TakeSmallestBy","TakeWhile","Tally","Tan","Tanh","TargetDevice","TargetFunctions","TargetSystem","TargetUnits","TaskAbort","TaskExecute","TaskObject","TaskRemove","TaskResume","Tasks","TaskSuspend","TaskWait","TautologyQ","TelegraphProcess","TemplateApply","TemplateArgBox","TemplateBox","TemplateBoxOptions","TemplateEvaluate","TemplateExpression","TemplateIf","TemplateObject","TemplateSequence","TemplateSlot","TemplateSlotSequence","TemplateUnevaluated","TemplateVerbatim","TemplateWith","TemporalData","TemporalRegularity","Temporary","TemporaryVariable","TensorContract","TensorDimensions","TensorExpand","TensorProduct","TensorQ","TensorRank","TensorReduce","TensorSymmetry","TensorTranspose","TensorWedge","TestID","TestReport","TestReportObject","TestResultObject","Tetrahedron","TetrahedronBox","TetrahedronBoxOptions","TeXForm","TeXSave","Text","Text3DBox","Text3DBoxOptions","TextAlignment","TextBand","TextBoundingBox","TextBox","TextCases","TextCell","TextClipboardType","TextContents","TextData","TextElement","TextForm","TextGrid","TextJustification","TextLine","TextPacket","TextParagraph","TextPosition","TextRecognize","TextSearch","TextSearchReport","TextSentences","TextString","TextStructure","TextStyle","TextTranslation","Texture","TextureCoordinateFunction","TextureCoordinateScaling","TextWords","Therefore","ThermodynamicData","ThermometerGauge","Thick","Thickness","Thin","Thinning","ThisLink","ThompsonGroupTh","Thread","ThreadingLayer","ThreeJSymbol","Threshold","Through","Throw","ThueMorse","Thumbnail","Thursday","Ticks","TicksStyle","TideData","Tilde","TildeEqual","TildeFullEqual","TildeTilde","TimeConstrained","TimeConstraint","TimeDirection","TimeFormat","TimeGoal","TimelinePlot","TimeObject","TimeObjectQ","TimeRemaining","Times","TimesBy","TimeSeries","TimeSeriesAggregate","TimeSeriesForecast","TimeSeriesInsert","TimeSeriesInvertibility","TimeSeriesMap","TimeSeriesMapThread","TimeSeriesModel","TimeSeriesModelFit","TimeSeriesResample","TimeSeriesRescale","TimeSeriesShift","TimeSeriesThread","TimeSeriesWindow","TimeUsed","TimeValue","TimeWarpingCorrespondence","TimeWarpingDistance","TimeZone","TimeZoneConvert","TimeZoneOffset","Timing","Tiny","TitleGrouping","TitsGroupT","ToBoxes","ToCharacterCode","ToColor","ToContinuousTimeModel","ToDate","Today","ToDiscreteTimeModel","ToEntity","ToeplitzMatrix","ToExpression","ToFileName","Together","Toggle","ToggleFalse","Toggler","TogglerBar","TogglerBox","TogglerBoxOptions","ToHeldExpression","ToInvertibleTimeSeries","TokenWords","Tolerance","ToLowerCase","Tomorrow","ToNumberField","TooBig","Tooltip","TooltipBox","TooltipBoxOptions","TooltipDelay","TooltipStyle","ToonShading","Top","TopHatTransform","ToPolarCoordinates","TopologicalSort","ToRadicals","ToRules","ToSphericalCoordinates","ToString","Total","TotalHeight","TotalLayer","TotalVariationFilter","TotalWidth","TouchPosition","TouchscreenAutoZoom","TouchscreenControlPlacement","ToUpperCase","Tr","Trace","TraceAbove","TraceAction","TraceBackward","TraceDepth","TraceDialog","TraceForward","TraceInternal","TraceLevel","TraceOff","TraceOn","TraceOriginal","TracePrint","TraceScan","TrackedSymbols","TrackingFunction","TracyWidomDistribution","TradingChart","TraditionalForm","TraditionalFunctionNotation","TraditionalNotation","TraditionalOrder","TrainingProgressCheckpointing","TrainingProgressFunction","TrainingProgressMeasurements","TrainingProgressReporting","TrainingStoppingCriterion","TrainingUpdateSchedule","TransferFunctionCancel","TransferFunctionExpand","TransferFunctionFactor","TransferFunctionModel","TransferFunctionPoles","TransferFunctionTransform","TransferFunctionZeros","TransformationClass","TransformationFunction","TransformationFunctions","TransformationMatrix","TransformedDistribution","TransformedField","TransformedProcess","TransformedRegion","TransitionDirection","TransitionDuration","TransitionEffect","TransitiveClosureGraph","TransitiveReductionGraph","Translate","TranslationOptions","TranslationTransform","Transliterate","Transparent","TransparentColor","Transpose","TransposeLayer","TrapSelection","TravelDirections","TravelDirectionsData","TravelDistance","TravelDistanceList","TravelMethod","TravelTime","TreeForm","TreeGraph","TreeGraphQ","TreePlot","TrendStyle","Triangle","TriangleCenter","TriangleConstruct","TriangleMeasurement","TriangleWave","TriangularDistribution","TriangulateMesh","Trig","TrigExpand","TrigFactor","TrigFactorList","Trigger","TrigReduce","TrigToExp","TrimmedMean","TrimmedVariance","TropicalStormData","True","TrueQ","TruncatedDistribution","TruncatedPolyhedron","TsallisQExponentialDistribution","TsallisQGaussianDistribution","TTest","Tube","TubeBezierCurveBox","TubeBezierCurveBoxOptions","TubeBox","TubeBoxOptions","TubeBSplineCurveBox","TubeBSplineCurveBoxOptions","Tuesday","TukeyLambdaDistribution","TukeyWindow","TunnelData","Tuples","TuranGraph","TuringMachine","TuttePolynomial","TwoWayRule","Typed","TypeSpecifier","UnateQ","Uncompress","UnconstrainedParameters","Undefined","UnderBar","Underflow","Underlined","Underoverscript","UnderoverscriptBox","UnderoverscriptBoxOptions","Underscript","UnderscriptBox","UnderscriptBoxOptions","UnderseaFeatureData","UndirectedEdge","UndirectedGraph","UndirectedGraphQ","UndoOptions","UndoTrackedVariables","Unequal","UnequalTo","Unevaluated","UniformDistribution","UniformGraphDistribution","UniformPolyhedron","UniformSumDistribution","Uninstall","Union","UnionedEntityClass","UnionPlus","Unique","UnitaryMatrixQ","UnitBox","UnitConvert","UnitDimensions","Unitize","UnitRootTest","UnitSimplify","UnitStep","UnitSystem","UnitTriangle","UnitVector","UnitVectorLayer","UnityDimensions","UniverseModelData","UniversityData","UnixTime","Unprotect","UnregisterExternalEvaluator","UnsameQ","UnsavedVariables","Unset","UnsetShared","UntrackedVariables","Up","UpArrow","UpArrowBar","UpArrowDownArrow","Update","UpdateDynamicObjects","UpdateDynamicObjectsSynchronous","UpdateInterval","UpdatePacletSites","UpdateSearchIndex","UpDownArrow","UpEquilibrium","UpperCaseQ","UpperLeftArrow","UpperRightArrow","UpperTriangularize","UpperTriangularMatrixQ","Upsample","UpSet","UpSetDelayed","UpTee","UpTeeArrow","UpTo","UpValues","URL","URLBuild","URLDecode","URLDispatcher","URLDownload","URLDownloadSubmit","URLEncode","URLExecute","URLExpand","URLFetch","URLFetchAsynchronous","URLParse","URLQueryDecode","URLQueryEncode","URLRead","URLResponseTime","URLSave","URLSaveAsynchronous","URLShorten","URLSubmit","UseGraphicsRange","UserDefinedWavelet","Using","UsingFrontEnd","UtilityFunction","V2Get","ValenceErrorHandling","ValidationLength","ValidationSet","Value","ValueBox","ValueBoxOptions","ValueDimensions","ValueForm","ValuePreprocessingFunction","ValueQ","Values","ValuesData","Variables","Variance","VarianceEquivalenceTest","VarianceEstimatorFunction","VarianceGammaDistribution","VarianceTest","VectorAngle","VectorAround","VectorAspectRatio","VectorColorFunction","VectorColorFunctionScaling","VectorDensityPlot","VectorGlyphData","VectorGreater","VectorGreaterEqual","VectorLess","VectorLessEqual","VectorMarkers","VectorPlot","VectorPlot3D","VectorPoints","VectorQ","VectorRange","Vectors","VectorScale","VectorScaling","VectorSizes","VectorStyle","Vee","Verbatim","Verbose","VerboseConvertToPostScriptPacket","VerificationTest","VerifyConvergence","VerifyDerivedKey","VerifyDigitalSignature","VerifyFileSignature","VerifyInterpretation","VerifySecurityCertificates","VerifySolutions","VerifyTestAssumptions","Version","VersionedPreferences","VersionNumber","VertexAdd","VertexCapacity","VertexColors","VertexComponent","VertexConnectivity","VertexContract","VertexCoordinateRules","VertexCoordinates","VertexCorrelationSimilarity","VertexCosineSimilarity","VertexCount","VertexCoverQ","VertexDataCoordinates","VertexDegree","VertexDelete","VertexDiceSimilarity","VertexEccentricity","VertexInComponent","VertexInDegree","VertexIndex","VertexJaccardSimilarity","VertexLabeling","VertexLabels","VertexLabelStyle","VertexList","VertexNormals","VertexOutComponent","VertexOutDegree","VertexQ","VertexRenderingFunction","VertexReplace","VertexShape","VertexShapeFunction","VertexSize","VertexStyle","VertexTextureCoordinates","VertexWeight","VertexWeightedGraphQ","Vertical","VerticalBar","VerticalForm","VerticalGauge","VerticalSeparator","VerticalSlider","VerticalTilde","Video","VideoEncoding","VideoExtractFrames","VideoFrameList","VideoFrameMap","VideoPause","VideoPlay","VideoQ","VideoStop","VideoStream","VideoStreams","VideoTimeSeries","VideoTracks","VideoTrim","ViewAngle","ViewCenter","ViewMatrix","ViewPoint","ViewPointSelectorSettings","ViewPort","ViewProjection","ViewRange","ViewVector","ViewVertical","VirtualGroupData","Visible","VisibleCell","VoiceStyleData","VoigtDistribution","VolcanoData","Volume","VonMisesDistribution","VoronoiMesh","WaitAll","WaitAsynchronousTask","WaitNext","WaitUntil","WakebyDistribution","WalleniusHypergeometricDistribution","WaringYuleDistribution","WarpingCorrespondence","WarpingDistance","WatershedComponents","WatsonUSquareTest","WattsStrogatzGraphDistribution","WaveletBestBasis","WaveletFilterCoefficients","WaveletImagePlot","WaveletListPlot","WaveletMapIndexed","WaveletMatrixPlot","WaveletPhi","WaveletPsi","WaveletScale","WaveletScalogram","WaveletThreshold","WeaklyConnectedComponents","WeaklyConnectedGraphComponents","WeaklyConnectedGraphQ","WeakStationarity","WeatherData","WeatherForecastData","WebAudioSearch","WebElementObject","WeberE","WebExecute","WebImage","WebImageSearch","WebSearch","WebSessionObject","WebSessions","WebWindowObject","Wedge","Wednesday","WeibullDistribution","WeierstrassE1","WeierstrassE2","WeierstrassE3","WeierstrassEta1","WeierstrassEta2","WeierstrassEta3","WeierstrassHalfPeriods","WeierstrassHalfPeriodW1","WeierstrassHalfPeriodW2","WeierstrassHalfPeriodW3","WeierstrassInvariantG2","WeierstrassInvariantG3","WeierstrassInvariants","WeierstrassP","WeierstrassPPrime","WeierstrassSigma","WeierstrassZeta","WeightedAdjacencyGraph","WeightedAdjacencyMatrix","WeightedData","WeightedGraphQ","Weights","WelchWindow","WheelGraph","WhenEvent","Which","While","White","WhiteNoiseProcess","WhitePoint","Whitespace","WhitespaceCharacter","WhittakerM","WhittakerW","WienerFilter","WienerProcess","WignerD","WignerSemicircleDistribution","WikidataData","WikidataSearch","WikipediaData","WikipediaSearch","WilksW","WilksWTest","WindDirectionData","WindingCount","WindingPolygon","WindowClickSelect","WindowElements","WindowFloating","WindowFrame","WindowFrameElements","WindowMargins","WindowMovable","WindowOpacity","WindowPersistentStyles","WindowSelected","WindowSize","WindowStatusArea","WindowTitle","WindowToolbars","WindowWidth","WindSpeedData","WindVectorData","WinsorizedMean","WinsorizedVariance","WishartMatrixDistribution","With","WolframAlpha","WolframAlphaDate","WolframAlphaQuantity","WolframAlphaResult","WolframLanguageData","Word","WordBoundary","WordCharacter","WordCloud","WordCount","WordCounts","WordData","WordDefinition","WordFrequency","WordFrequencyData","WordList","WordOrientation","WordSearch","WordSelectionFunction","WordSeparators","WordSpacings","WordStem","WordTranslation","WorkingPrecision","WrapAround","Write","WriteLine","WriteString","Wronskian","XMLElement","XMLObject","XMLTemplate","Xnor","Xor","XYZColor","Yellow","Yesterday","YuleDissimilarity","ZernikeR","ZeroSymmetric","ZeroTest","ZeroWidthTimes","Zeta","ZetaZero","ZIPCodeData","ZipfDistribution","ZoomCenter","ZoomFactor","ZTest","ZTransform","$Aborted","$ActivationGroupID","$ActivationKey","$ActivationUserRegistered","$AddOnsDirectory","$AllowDataUpdates","$AllowExternalChannelFunctions","$AllowInternet","$AssertFunction","$Assumptions","$AsynchronousTask","$AudioDecoders","$AudioEncoders","$AudioInputDevices","$AudioOutputDevices","$BaseDirectory","$BasePacletsDirectory","$BatchInput","$BatchOutput","$BlockchainBase","$BoxForms","$ByteOrdering","$CacheBaseDirectory","$Canceled","$ChannelBase","$CharacterEncoding","$CharacterEncodings","$CloudAccountName","$CloudBase","$CloudConnected","$CloudConnection","$CloudCreditsAvailable","$CloudEvaluation","$CloudExpressionBase","$CloudObjectNameFormat","$CloudObjectURLType","$CloudRootDirectory","$CloudSymbolBase","$CloudUserID","$CloudUserUUID","$CloudVersion","$CloudVersionNumber","$CloudWolframEngineVersionNumber","$CommandLine","$CompilationTarget","$ConditionHold","$ConfiguredKernels","$Context","$ContextPath","$ControlActiveSetting","$Cookies","$CookieStore","$CreationDate","$CurrentLink","$CurrentTask","$CurrentWebSession","$DataStructures","$DateStringFormat","$DefaultAudioInputDevice","$DefaultAudioOutputDevice","$DefaultFont","$DefaultFrontEnd","$DefaultImagingDevice","$DefaultLocalBase","$DefaultMailbox","$DefaultNetworkInterface","$DefaultPath","$DefaultProxyRules","$DefaultSystemCredentialStore","$Display","$DisplayFunction","$DistributedContexts","$DynamicEvaluation","$Echo","$EmbedCodeEnvironments","$EmbeddableServices","$EntityStores","$Epilog","$EvaluationCloudBase","$EvaluationCloudObject","$EvaluationEnvironment","$ExportFormats","$ExternalIdentifierTypes","$ExternalStorageBase","$Failed","$FinancialDataSource","$FontFamilies","$FormatType","$FrontEnd","$FrontEndSession","$GeoEntityTypes","$GeoLocation","$GeoLocationCity","$GeoLocationCountry","$GeoLocationPrecision","$GeoLocationSource","$HistoryLength","$HomeDirectory","$HTMLExportRules","$HTTPCookies","$HTTPRequest","$IgnoreEOF","$ImageFormattingWidth","$ImageResolution","$ImagingDevice","$ImagingDevices","$ImportFormats","$IncomingMailSettings","$InitialDirectory","$Initialization","$InitializationContexts","$Input","$InputFileName","$InputStreamMethods","$Inspector","$InstallationDate","$InstallationDirectory","$InterfaceEnvironment","$InterpreterTypes","$IterationLimit","$KernelCount","$KernelID","$Language","$LaunchDirectory","$LibraryPath","$LicenseExpirationDate","$LicenseID","$LicenseProcesses","$LicenseServer","$LicenseSubprocesses","$LicenseType","$Line","$Linked","$LinkSupported","$LoadedFiles","$LocalBase","$LocalSymbolBase","$MachineAddresses","$MachineDomain","$MachineDomains","$MachineEpsilon","$MachineID","$MachineName","$MachinePrecision","$MachineType","$MaxExtraPrecision","$MaxLicenseProcesses","$MaxLicenseSubprocesses","$MaxMachineNumber","$MaxNumber","$MaxPiecewiseCases","$MaxPrecision","$MaxRootDegree","$MessageGroups","$MessageList","$MessagePrePrint","$Messages","$MinMachineNumber","$MinNumber","$MinorReleaseNumber","$MinPrecision","$MobilePhone","$ModuleNumber","$NetworkConnected","$NetworkInterfaces","$NetworkLicense","$NewMessage","$NewSymbol","$NotebookInlineStorageLimit","$Notebooks","$NoValue","$NumberMarks","$Off","$OperatingSystem","$Output","$OutputForms","$OutputSizeLimit","$OutputStreamMethods","$Packages","$ParentLink","$ParentProcessID","$PasswordFile","$PatchLevelID","$Path","$PathnameSeparator","$PerformanceGoal","$Permissions","$PermissionsGroupBase","$PersistenceBase","$PersistencePath","$PipeSupported","$PlotTheme","$Post","$Pre","$PreferencesDirectory","$PreInitialization","$PrePrint","$PreRead","$PrintForms","$PrintLiteral","$Printout3DPreviewer","$ProcessID","$ProcessorCount","$ProcessorType","$ProductInformation","$ProgramName","$PublisherID","$RandomState","$RecursionLimit","$RegisteredDeviceClasses","$RegisteredUserName","$ReleaseNumber","$RequesterAddress","$RequesterWolframID","$RequesterWolframUUID","$RootDirectory","$ScheduledTask","$ScriptCommandLine","$ScriptInputString","$SecuredAuthenticationKeyTokens","$ServiceCreditsAvailable","$Services","$SessionID","$SetParentLink","$SharedFunctions","$SharedVariables","$SoundDisplay","$SoundDisplayFunction","$SourceLink","$SSHAuthentication","$SubtitleDecoders","$SubtitleEncoders","$SummaryBoxDataSizeLimit","$SuppressInputFormHeads","$SynchronousEvaluation","$SyntaxHandler","$System","$SystemCharacterEncoding","$SystemCredentialStore","$SystemID","$SystemMemory","$SystemShell","$SystemTimeZone","$SystemWordLength","$TemplatePath","$TemporaryDirectory","$TemporaryPrefix","$TestFileName","$TextStyle","$TimedOut","$TimeUnit","$TimeZone","$TimeZoneEntity","$TopDirectory","$TraceOff","$TraceOn","$TracePattern","$TracePostAction","$TracePreAction","$UnitSystem","$Urgent","$UserAddOnsDirectory","$UserAgentLanguages","$UserAgentMachine","$UserAgentName","$UserAgentOperatingSystem","$UserAgentString","$UserAgentVersion","$UserBaseDirectory","$UserBasePacletsDirectory","$UserDocumentsDirectory","$Username","$UserName","$UserURLBase","$Version","$VersionNumber","$VideoDecoders","$VideoEncoders","$VoiceStyles","$WolframDocumentsDirectory","$WolframID","$WolframUUID"];function dun(t){return t?typeof t=="string"?t:t.source:null}function lun(t){return g_e("(",t,")?")}function g_e(...t){return t.map(n=>dun(n)).join("")}function uun(...t){return"("+t.map(n=>dun(n)).join("|")+")"}function iis(t){let e=/([2-9]|[1-2]\d|[3][0-5])\^\^/,n=/(\w*\.\w+|\w+\.\w*|\w+)/,r=/(\d*\.\d+|\d+\.\d*|\d+)/,s=uun(g_e(e,n),r),a=uun(/``[+-]?(\d*\.\d+|\d+\.\d*|\d+)/,/`([+-]?(\d*\.\d+|\d+\.\d*|\d+))?/),c=/\*\^[+-]?\d+/,l={className:"number",relevance:0,begin:g_e(s,lun(a),lun(c))},d=/[a-zA-Z$][a-zA-Z0-9$]*/,h=new Set(sis),m={variants:[{className:"builtin-symbol",begin:d,"on:begin":(C,I)=>{h.has(C[0])||I.ignoreMatch()}},{className:"symbol",relevance:0,begin:d}]},f={className:"named-character",begin:/\\\[[$a-zA-Z][$a-zA-Z0-9]+\]/},g={className:"operator",relevance:0,begin:/[+\-*/,;.:@~=><&|_`'^?!%]+/},A={className:"pattern",relevance:0,begin:/([a-zA-Z$][a-zA-Z0-9$]*)?_+([a-zA-Z$][a-zA-Z0-9$]*)?/},y={className:"slot",relevance:0,begin:/#[a-zA-Z$][a-zA-Z0-9$]*|#+[0-9]?/},b={className:"brace",relevance:0,begin:/[[\](){}]/},S={className:"message-name",relevance:0,begin:g_e("::",d)};return{name:"Mathematica",aliases:["mma","wl"],classNameAliases:{brace:"punctuation",pattern:"type",slot:"type",symbol:"variable","named-character":"variable","builtin-symbol":"built_in","message-name":"string"},contains:[t.COMMENT(/\(\*/,/\*\)/,{contains:["self"]}),A,y,S,m,f,t.QUOTE_STRING_MODE,l,g,b]}}pun.exports=iis});var fun=ee((d1a,mun)=>{p();function ois(t){var e="('|\\.')+",n={relevance:0,contains:[{begin:e}]};return{name:"Matlab",keywords:{keyword:"arguments break case catch classdef continue else elseif end enumeration events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i|0 inf nan isnan isinf isfinite j|0 why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson max min nanmax nanmin mean nanmean type table readtable writetable sortrows sort figure plot plot3 scatter scatter3 cellfun legend intersect ismember procrustes hold num2cell "},illegal:'(//|"|#|/\\*|\\s+/\\w+)',contains:[{className:"function",beginKeywords:"function",end:"$",contains:[t.UNDERSCORE_TITLE_MODE,{className:"params",variants:[{begin:"\\(",end:"\\)"},{begin:"\\[",end:"\\]"}]}]},{className:"built_in",begin:/true|false/,relevance:0,starts:n},{begin:"[a-zA-Z][a-zA-Z_0-9]*"+e,relevance:0},{className:"number",begin:t.C_NUMBER_RE,relevance:0,starts:n},{className:"string",begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE,{begin:"''"}]},{begin:/\]|\}|\)/,relevance:0,starts:n},{className:"string",begin:'"',end:'"',contains:[t.BACKSLASH_ESCAPE,{begin:'""'}],starts:n},t.COMMENT("^\\s*%\\{\\s*$","^\\s*%\\}\\s*$"),t.COMMENT("%","$")]}}mun.exports=ois});var Aun=ee((h1a,gun)=>{p();function ais(t){return{name:"Maxima",keywords:{$pattern:"[A-Za-z_%][0-9A-Za-z_%]*",keyword:"if then else elseif for thru do while unless step in and or not",literal:"true false unknown inf minf ind und %e %i %pi %phi %gamma",built_in:" abasep abs absint absolute_real_time acos acosh acot acoth acsc acsch activate addcol add_edge add_edges addmatrices addrow add_vertex add_vertices adjacency_matrix adjoin adjoint af agd airy airy_ai airy_bi airy_dai airy_dbi algsys alg_type alias allroots alphacharp alphanumericp amortization %and annuity_fv annuity_pv antid antidiff AntiDifference append appendfile apply apply1 apply2 applyb1 apropos args arit_amortization arithmetic arithsum array arrayapply arrayinfo arraymake arraysetapply ascii asec asech asin asinh askinteger asksign assoc assoc_legendre_p assoc_legendre_q assume assume_external_byte_order asympa at atan atan2 atanh atensimp atom atvalue augcoefmatrix augmented_lagrangian_method av average_degree backtrace bars barsplot barsplot_description base64 base64_decode bashindices batch batchload bc2 bdvac belln benefit_cost bern bernpoly bernstein_approx bernstein_expand bernstein_poly bessel bessel_i bessel_j bessel_k bessel_simplify bessel_y beta beta_incomplete beta_incomplete_generalized beta_incomplete_regularized bezout bfallroots bffac bf_find_root bf_fmin_cobyla bfhzeta bfloat bfloatp bfpsi bfpsi0 bfzeta biconnected_components bimetric binomial bipartition block blockmatrixp bode_gain bode_phase bothcoef box boxplot boxplot_description break bug_report build_info|10 buildq build_sample burn cabs canform canten cardinality carg cartan cartesian_product catch cauchy_matrix cbffac cdf_bernoulli cdf_beta cdf_binomial cdf_cauchy cdf_chi2 cdf_continuous_uniform cdf_discrete_uniform cdf_exp cdf_f cdf_gamma cdf_general_finite_discrete cdf_geometric cdf_gumbel cdf_hypergeometric cdf_laplace cdf_logistic cdf_lognormal cdf_negative_binomial cdf_noncentral_chi2 cdf_noncentral_student_t cdf_normal cdf_pareto cdf_poisson cdf_rank_sum cdf_rayleigh cdf_signed_rank cdf_student_t cdf_weibull cdisplay ceiling central_moment cequal cequalignore cf cfdisrep cfexpand cgeodesic cgreaterp cgreaterpignore changename changevar chaosgame charat charfun charfun2 charlist charp charpoly chdir chebyshev_t chebyshev_u checkdiv check_overlaps chinese cholesky christof chromatic_index chromatic_number cint circulant_graph clear_edge_weight clear_rules clear_vertex_label clebsch_gordan clebsch_graph clessp clesspignore close closefile cmetric coeff coefmatrix cograd col collapse collectterms columnop columnspace columnswap columnvector combination combine comp2pui compare compfile compile compile_file complement_graph complete_bipartite_graph complete_graph complex_number_p components compose_functions concan concat conjugate conmetderiv connected_components connect_vertices cons constant constantp constituent constvalue cont2part content continuous_freq contortion contour_plot contract contract_edge contragrad contrib_ode convert coord copy copy_file copy_graph copylist copymatrix cor cos cosh cot coth cov cov1 covdiff covect covers crc24sum create_graph create_list csc csch csetup cspline ctaylor ct_coordsys ctransform ctranspose cube_graph cuboctahedron_graph cunlisp cv cycle_digraph cycle_graph cylindrical days360 dblint deactivate declare declare_constvalue declare_dimensions declare_fundamental_dimensions declare_fundamental_units declare_qty declare_translated declare_unit_conversion declare_units declare_weights decsym defcon define define_alt_display define_variable defint defmatch defrule defstruct deftaylor degree_sequence del delete deleten delta demo demoivre denom depends derivdegree derivlist describe desolve determinant dfloat dgauss_a dgauss_b dgeev dgemm dgeqrf dgesv dgesvd diag diagmatrix diag_matrix diagmatrixp diameter diff digitcharp dimacs_export dimacs_import dimension dimensionless dimensions dimensions_as_list direct directory discrete_freq disjoin disjointp disolate disp dispcon dispform dispfun dispJordan display disprule dispterms distrib divide divisors divsum dkummer_m dkummer_u dlange dodecahedron_graph dotproduct dotsimp dpart draw draw2d draw3d drawdf draw_file draw_graph dscalar echelon edge_coloring edge_connectivity edges eigens_by_jacobi eigenvalues eigenvectors eighth einstein eivals eivects elapsed_real_time elapsed_run_time ele2comp ele2polynome ele2pui elem elementp elevation_grid elim elim_allbut eliminate eliminate_using ellipse elliptic_e elliptic_ec elliptic_eu elliptic_f elliptic_kc elliptic_pi ematrix empty_graph emptyp endcons entermatrix entertensor entier equal equalp equiv_classes erf erfc erf_generalized erfi errcatch error errormsg errors euler ev eval_string evenp every evolution evolution2d evundiff example exp expand expandwrt expandwrt_factored expint expintegral_chi expintegral_ci expintegral_e expintegral_e1 expintegral_ei expintegral_e_simplify expintegral_li expintegral_shi expintegral_si explicit explose exponentialize express expt exsec extdiff extract_linear_equations extremal_subset ezgcd %f f90 facsum factcomb factor factorfacsum factorial factorout factorsum facts fast_central_elements fast_linsolve fasttimes featurep fernfale fft fib fibtophi fifth filename_merge file_search file_type fillarray findde find_root find_root_abs find_root_error find_root_rel first fix flatten flength float floatnump floor flower_snark flush flush1deriv flushd flushnd flush_output fmin_cobyla forget fortran fourcos fourexpand fourier fourier_elim fourint fourintcos fourintsin foursimp foursin fourth fposition frame_bracket freeof freshline fresnel_c fresnel_s from_adjacency_matrix frucht_graph full_listify fullmap fullmapl fullratsimp fullratsubst fullsetify funcsolve fundamental_dimensions fundamental_units fundef funmake funp fv g0 g1 gamma gamma_greek gamma_incomplete gamma_incomplete_generalized gamma_incomplete_regularized gauss gauss_a gauss_b gaussprob gcd gcdex gcdivide gcfac gcfactor gd generalized_lambert_w genfact gen_laguerre genmatrix gensym geo_amortization geo_annuity_fv geo_annuity_pv geomap geometric geometric_mean geosum get getcurrentdirectory get_edge_weight getenv get_lu_factors get_output_stream_string get_pixel get_plot_option get_tex_environment get_tex_environment_default get_vertex_label gfactor gfactorsum ggf girth global_variances gn gnuplot_close gnuplot_replot gnuplot_reset gnuplot_restart gnuplot_start go Gosper GosperSum gr2d gr3d gradef gramschmidt graph6_decode graph6_encode graph6_export graph6_import graph_center graph_charpoly graph_eigenvalues graph_flow graph_order graph_periphery graph_product graph_size graph_union great_rhombicosidodecahedron_graph great_rhombicuboctahedron_graph grid_graph grind grobner_basis grotzch_graph hamilton_cycle hamilton_path hankel hankel_1 hankel_2 harmonic harmonic_mean hav heawood_graph hermite hessian hgfred hilbertmap hilbert_matrix hipow histogram histogram_description hodge horner hypergeometric i0 i1 %ibes ic1 ic2 ic_convert ichr1 ichr2 icosahedron_graph icosidodecahedron_graph icurvature ident identfor identity idiff idim idummy ieqn %if ifactors iframes ifs igcdex igeodesic_coords ilt image imagpart imetric implicit implicit_derivative implicit_plot indexed_tensor indices induced_subgraph inferencep inference_result infix info_display init_atensor init_ctensor in_neighbors innerproduct inpart inprod inrt integerp integer_partitions integrate intersect intersection intervalp intopois intosum invariant1 invariant2 inverse_fft inverse_jacobi_cd inverse_jacobi_cn inverse_jacobi_cs inverse_jacobi_dc inverse_jacobi_dn inverse_jacobi_ds inverse_jacobi_nc inverse_jacobi_nd inverse_jacobi_ns inverse_jacobi_sc inverse_jacobi_sd inverse_jacobi_sn invert invert_by_adjoint invert_by_lu inv_mod irr is is_biconnected is_bipartite is_connected is_digraph is_edge_in_graph is_graph is_graph_or_digraph ishow is_isomorphic isolate isomorphism is_planar isqrt isreal_p is_sconnected is_tree is_vertex_in_graph items_inference %j j0 j1 jacobi jacobian jacobi_cd jacobi_cn jacobi_cs jacobi_dc jacobi_dn jacobi_ds jacobi_nc jacobi_nd jacobi_ns jacobi_p jacobi_sc jacobi_sd jacobi_sn JF jn join jordan julia julia_set julia_sin %k kdels kdelta kill killcontext kostka kron_delta kronecker_product kummer_m kummer_u kurtosis kurtosis_bernoulli kurtosis_beta kurtosis_binomial kurtosis_chi2 kurtosis_continuous_uniform kurtosis_discrete_uniform kurtosis_exp kurtosis_f kurtosis_gamma kurtosis_general_finite_discrete kurtosis_geometric kurtosis_gumbel kurtosis_hypergeometric kurtosis_laplace kurtosis_logistic kurtosis_lognormal kurtosis_negative_binomial kurtosis_noncentral_chi2 kurtosis_noncentral_student_t kurtosis_normal kurtosis_pareto kurtosis_poisson kurtosis_rayleigh kurtosis_student_t kurtosis_weibull label labels lagrange laguerre lambda lambert_w laplace laplacian_matrix last lbfgs lc2kdt lcharp lc_l lcm lc_u ldefint ldisp ldisplay legendre_p legendre_q leinstein length let letrules letsimp levi_civita lfreeof lgtreillis lhs li liediff limit Lindstedt linear linearinterpol linear_program linear_regression line_graph linsolve listarray list_correlations listify list_matrix_entries list_nc_monomials listoftens listofvars listp lmax lmin load loadfile local locate_matrix_entry log logcontract log_gamma lopow lorentz_gauge lowercasep lpart lratsubst lreduce lriemann lsquares_estimates lsquares_estimates_approximate lsquares_estimates_exact lsquares_mse lsquares_residual_mse lsquares_residuals lsum ltreillis lu_backsub lucas lu_factor %m macroexpand macroexpand1 make_array makebox makefact makegamma make_graph make_level_picture makelist makeOrders make_poly_continent make_poly_country make_polygon make_random_state make_rgb_picture makeset make_string_input_stream make_string_output_stream make_transform mandelbrot mandelbrot_set map mapatom maplist matchdeclare matchfix mat_cond mat_fullunblocker mat_function mathml_display mat_norm matrix matrixmap matrixp matrix_size mattrace mat_trace mat_unblocker max max_clique max_degree max_flow maximize_lp max_independent_set max_matching maybe md5sum mean mean_bernoulli mean_beta mean_binomial mean_chi2 mean_continuous_uniform mean_deviation mean_discrete_uniform mean_exp mean_f mean_gamma mean_general_finite_discrete mean_geometric mean_gumbel mean_hypergeometric mean_laplace mean_logistic mean_lognormal mean_negative_binomial mean_noncentral_chi2 mean_noncentral_student_t mean_normal mean_pareto mean_poisson mean_rayleigh mean_student_t mean_weibull median median_deviation member mesh metricexpandall mgf1_sha1 min min_degree min_edge_cut minfactorial minimalPoly minimize_lp minimum_spanning_tree minor minpack_lsquares minpack_solve min_vertex_cover min_vertex_cut mkdir mnewton mod mode_declare mode_identity ModeMatrix moebius mon2schur mono monomial_dimensions multibernstein_poly multi_display_for_texinfo multi_elem multinomial multinomial_coeff multi_orbit multiplot_mode multi_pui multsym multthru mycielski_graph nary natural_unit nc_degree ncexpt ncharpoly negative_picture neighbors new newcontext newdet new_graph newline newton new_variable next_prime nicedummies niceindices ninth nofix nonarray noncentral_moment nonmetricity nonnegintegerp nonscalarp nonzeroandfreeof notequal nounify nptetrad npv nroots nterms ntermst nthroot nullity nullspace num numbered_boundaries numberp number_to_octets num_distinct_partitions numerval numfactor num_partitions nusum nzeta nzetai nzetar octets_to_number octets_to_oid odd_girth oddp ode2 ode_check odelin oid_to_octets op opena opena_binary openr openr_binary openw openw_binary operatorp opsubst optimize %or orbit orbits ordergreat ordergreatp orderless orderlessp orthogonal_complement orthopoly_recur orthopoly_weight outermap out_neighbors outofpois pade parabolic_cylinder_d parametric parametric_surface parg parGosper parse_string parse_timedate part part2cont partfrac partition partition_set partpol path_digraph path_graph pathname_directory pathname_name pathname_type pdf_bernoulli pdf_beta pdf_binomial pdf_cauchy pdf_chi2 pdf_continuous_uniform pdf_discrete_uniform pdf_exp pdf_f pdf_gamma pdf_general_finite_discrete pdf_geometric pdf_gumbel pdf_hypergeometric pdf_laplace pdf_logistic pdf_lognormal pdf_negative_binomial pdf_noncentral_chi2 pdf_noncentral_student_t pdf_normal pdf_pareto pdf_poisson pdf_rank_sum pdf_rayleigh pdf_signed_rank pdf_student_t pdf_weibull pearson_skewness permanent permut permutation permutations petersen_graph petrov pickapart picture_equalp picturep piechart piechart_description planar_embedding playback plog plot2d plot3d plotdf ploteq plsquares pochhammer points poisdiff poisexpt poisint poismap poisplus poissimp poissubst poistimes poistrim polar polarform polartorect polar_to_xy poly_add poly_buchberger poly_buchberger_criterion poly_colon_ideal poly_content polydecomp poly_depends_p poly_elimination_ideal poly_exact_divide poly_expand poly_expt poly_gcd polygon poly_grobner poly_grobner_equal poly_grobner_member poly_grobner_subsetp poly_ideal_intersection poly_ideal_polysaturation poly_ideal_polysaturation1 poly_ideal_saturation poly_ideal_saturation1 poly_lcm poly_minimization polymod poly_multiply polynome2ele polynomialp poly_normal_form poly_normalize poly_normalize_list poly_polysaturation_extension poly_primitive_part poly_pseudo_divide poly_reduced_grobner poly_reduction poly_saturation_extension poly_s_polynomial poly_subtract polytocompanion pop postfix potential power_mod powerseries powerset prefix prev_prime primep primes principal_components print printf printfile print_graph printpois printprops prodrac product properties propvars psi psubst ptriangularize pui pui2comp pui2ele pui2polynome pui_direct puireduc push put pv qput qrange qty quad_control quad_qag quad_qagi quad_qagp quad_qags quad_qawc quad_qawf quad_qawo quad_qaws quadrilateral quantile quantile_bernoulli quantile_beta quantile_binomial quantile_cauchy quantile_chi2 quantile_continuous_uniform quantile_discrete_uniform quantile_exp quantile_f quantile_gamma quantile_general_finite_discrete quantile_geometric quantile_gumbel quantile_hypergeometric quantile_laplace quantile_logistic quantile_lognormal quantile_negative_binomial quantile_noncentral_chi2 quantile_noncentral_student_t quantile_normal quantile_pareto quantile_poisson quantile_rayleigh quantile_student_t quantile_weibull quartile_skewness quit qunit quotient racah_v racah_w radcan radius random random_bernoulli random_beta random_binomial random_bipartite_graph random_cauchy random_chi2 random_continuous_uniform random_digraph random_discrete_uniform random_exp random_f random_gamma random_general_finite_discrete random_geometric random_graph random_graph1 random_gumbel random_hypergeometric random_laplace random_logistic random_lognormal random_negative_binomial random_network random_noncentral_chi2 random_noncentral_student_t random_normal random_pareto random_permutation random_poisson random_rayleigh random_regular_graph random_student_t random_tournament random_tree random_weibull range rank rat ratcoef ratdenom ratdiff ratdisrep ratexpand ratinterpol rational rationalize ratnumer ratnump ratp ratsimp ratsubst ratvars ratweight read read_array read_binary_array read_binary_list read_binary_matrix readbyte readchar read_hashed_array readline read_list read_matrix read_nested_list readonly read_xpm real_imagpart_to_conjugate realpart realroots rearray rectangle rectform rectform_log_if_constant recttopolar rediff reduce_consts reduce_order region region_boundaries region_boundaries_plus rem remainder remarray rembox remcomps remcon remcoord remfun remfunction remlet remove remove_constvalue remove_dimensions remove_edge remove_fundamental_dimensions remove_fundamental_units remove_plot_option remove_vertex rempart remrule remsym remvalue rename rename_file reset reset_displays residue resolvante resolvante_alternee1 resolvante_bipartite resolvante_diedrale resolvante_klein resolvante_klein3 resolvante_produit_sym resolvante_unitaire resolvante_vierer rest resultant return reveal reverse revert revert2 rgb2level rhs ricci riemann rinvariant risch rk rmdir rncombine romberg room rootscontract round row rowop rowswap rreduce run_testsuite %s save saving scalarp scaled_bessel_i scaled_bessel_i0 scaled_bessel_i1 scalefactors scanmap scatterplot scatterplot_description scene schur2comp sconcat scopy scsimp scurvature sdowncase sec sech second sequal sequalignore set_alt_display setdifference set_draw_defaults set_edge_weight setelmx setequalp setify setp set_partitions set_plot_option set_prompt set_random_state set_tex_environment set_tex_environment_default setunits setup_autoload set_up_dot_simplifications set_vertex_label seventh sexplode sf sha1sum sha256sum shortest_path shortest_weighted_path show showcomps showratvars sierpinskiale sierpinskimap sign signum similaritytransform simp_inequality simplify_sum simplode simpmetderiv simtran sin sinh sinsert sinvertcase sixth skewness skewness_bernoulli skewness_beta skewness_binomial skewness_chi2 skewness_continuous_uniform skewness_discrete_uniform skewness_exp skewness_f skewness_gamma skewness_general_finite_discrete skewness_geometric skewness_gumbel skewness_hypergeometric skewness_laplace skewness_logistic skewness_lognormal skewness_negative_binomial skewness_noncentral_chi2 skewness_noncentral_student_t skewness_normal skewness_pareto skewness_poisson skewness_rayleigh skewness_student_t skewness_weibull slength smake small_rhombicosidodecahedron_graph small_rhombicuboctahedron_graph smax smin smismatch snowmap snub_cube_graph snub_dodecahedron_graph solve solve_rec solve_rec_rat some somrac sort sparse6_decode sparse6_encode sparse6_export sparse6_import specint spherical spherical_bessel_j spherical_bessel_y spherical_hankel1 spherical_hankel2 spherical_harmonic spherical_to_xyz splice split sposition sprint sqfr sqrt sqrtdenest sremove sremovefirst sreverse ssearch ssort sstatus ssubst ssubstfirst staircase standardize standardize_inverse_trig starplot starplot_description status std std1 std_bernoulli std_beta std_binomial std_chi2 std_continuous_uniform std_discrete_uniform std_exp std_f std_gamma std_general_finite_discrete std_geometric std_gumbel std_hypergeometric std_laplace std_logistic std_lognormal std_negative_binomial std_noncentral_chi2 std_noncentral_student_t std_normal std_pareto std_poisson std_rayleigh std_student_t std_weibull stemplot stirling stirling1 stirling2 strim striml strimr string stringout stringp strong_components struve_h struve_l sublis sublist sublist_indices submatrix subsample subset subsetp subst substinpart subst_parallel substpart substring subvar subvarp sum sumcontract summand_to_rec supcase supcontext symbolp symmdifference symmetricp system take_channel take_inference tan tanh taylor taylorinfo taylorp taylor_simplifier taytorat tcl_output tcontract tellrat tellsimp tellsimpafter tentex tenth test_mean test_means_difference test_normality test_proportion test_proportions_difference test_rank_sum test_sign test_signed_rank test_variance test_variance_ratio tex tex1 tex_display texput %th third throw time timedate timer timer_info tldefint tlimit todd_coxeter toeplitz tokens to_lisp topological_sort to_poly to_poly_solve totaldisrep totalfourier totient tpartpol trace tracematrix trace_options transform_sample translate translate_file transpose treefale tree_reduce treillis treinat triangle triangularize trigexpand trigrat trigreduce trigsimp trunc truncate truncated_cube_graph truncated_dodecahedron_graph truncated_icosahedron_graph truncated_tetrahedron_graph tr_warnings_get tube tutte_graph ueivects uforget ultraspherical underlying_graph undiff union unique uniteigenvectors unitp units unit_step unitvector unorder unsum untellrat untimer untrace uppercasep uricci uriemann uvect vandermonde_matrix var var1 var_bernoulli var_beta var_binomial var_chi2 var_continuous_uniform var_discrete_uniform var_exp var_f var_gamma var_general_finite_discrete var_geometric var_gumbel var_hypergeometric var_laplace var_logistic var_lognormal var_negative_binomial var_noncentral_chi2 var_noncentral_student_t var_normal var_pareto var_poisson var_rayleigh var_student_t var_weibull vector vectorpotential vectorsimp verbify vers vertex_coloring vertex_connectivity vertex_degree vertex_distance vertex_eccentricity vertex_in_degree vertex_out_degree vertices vertices_to_cycle vertices_to_path %w weyl wheel_graph wiener_index wigner_3j wigner_6j wigner_9j with_stdout write_binary_data writebyte write_data writefile wronskian xreduce xthru %y Zeilberger zeroequiv zerofor zeromatrix zeromatrixp zeta zgeev zheev zlange zn_add_table zn_carmichael_lambda zn_characteristic_factors zn_determinant zn_factor_generators zn_invert_by_lu zn_log zn_mult_table absboxchar activecontexts adapt_depth additive adim aform algebraic algepsilon algexact aliases allbut all_dotsimp_denoms allocation allsym alphabetic animation antisymmetric arrays askexp assume_pos assume_pos_pred assumescalar asymbol atomgrad atrig1 axes axis_3d axis_bottom axis_left axis_right axis_top azimuth background background_color backsubst berlefact bernstein_explicit besselexpand beta_args_sum_to_integer beta_expand bftorat bftrunc bindtest border boundaries_array box boxchar breakup %c capping cauchysum cbrange cbtics center cflength cframe_flag cnonmet_flag color color_bar color_bar_tics colorbox columns commutative complex cone context contexts contour contour_levels cosnpiflag ctaypov ctaypt ctayswitch ctayvar ct_coords ctorsion_flag ctrgsimp cube current_let_rule_package cylinder data_file_name debugmode decreasing default_let_rule_package delay dependencies derivabbrev derivsubst detout diagmetric diff dim dimensions dispflag display2d|10 display_format_internal distribute_over doallmxops domain domxexpt domxmxops domxnctimes dontfactor doscmxops doscmxplus dot0nscsimp dot0simp dot1simp dotassoc dotconstrules dotdistrib dotexptsimp dotident dotscrules draw_graph_program draw_realpart edge_color edge_coloring edge_partition edge_type edge_width %edispflag elevation %emode endphi endtheta engineering_format_floats enhanced3d %enumer epsilon_lp erfflag erf_representation errormsg error_size error_syms error_type %e_to_numlog eval even evenfun evflag evfun ev_point expandwrt_denom expintexpand expintrep expon expop exptdispflag exptisolate exptsubst facexpand facsum_combine factlim factorflag factorial_expand factors_only fb feature features file_name file_output_append file_search_demo file_search_lisp file_search_maxima|10 file_search_tests file_search_usage file_type_lisp file_type_maxima|10 fill_color fill_density filled_func fixed_vertices flipflag float2bf font font_size fortindent fortspaces fpprec fpprintprec functions gamma_expand gammalim gdet genindex gensumnum GGFCFMAX GGFINFINITY globalsolve gnuplot_command gnuplot_curve_styles gnuplot_curve_titles gnuplot_default_term_command gnuplot_dumb_term_command gnuplot_file_args gnuplot_file_name gnuplot_out_file gnuplot_pdf_term_command gnuplot_pm3d gnuplot_png_term_command gnuplot_postamble gnuplot_preamble gnuplot_ps_term_command gnuplot_svg_term_command gnuplot_term gnuplot_view_args Gosper_in_Zeilberger gradefs grid grid2d grind halfangles head_angle head_both head_length head_type height hypergeometric_representation %iargs ibase icc1 icc2 icounter idummyx ieqnprint ifb ifc1 ifc2 ifg ifgi ifr iframe_bracket_form ifri igeowedge_flag ikt1 ikt2 imaginary inchar increasing infeval infinity inflag infolists inm inmc1 inmc2 intanalysis integer integervalued integrate_use_rootsof integration_constant integration_constant_counter interpolate_color intfaclim ip_grid ip_grid_in irrational isolate_wrt_times iterations itr julia_parameter %k1 %k2 keepfloat key key_pos kinvariant kt label label_alignment label_orientation labels lassociative lbfgs_ncorrections lbfgs_nfeval_max leftjust legend letrat let_rule_packages lfg lg lhospitallim limsubst linear linear_solver linechar linel|10 linenum line_type linewidth line_width linsolve_params linsolvewarn lispdisp listarith listconstvars listdummyvars lmxchar load_pathname loadprint logabs logarc logcb logconcoeffp logexpand lognegint logsimp logx logx_secondary logy logy_secondary logz lriem m1pbranch macroexpansion macros mainvar manual_demo maperror mapprint matrix_element_add matrix_element_mult matrix_element_transpose maxapplydepth maxapplyheight maxima_tempdir|10 maxima_userdir|10 maxnegex MAX_ORD maxposex maxpsifracdenom maxpsifracnum maxpsinegint maxpsiposint maxtayorder mesh_lines_color method mod_big_prime mode_check_errorp mode_checkp mode_check_warnp mod_test mod_threshold modular_linear_solver modulus multiplicative multiplicities myoptions nary negdistrib negsumdispflag newline newtonepsilon newtonmaxiter nextlayerfactor niceindicespref nm nmc noeval nolabels nonegative_lp noninteger nonscalar noun noundisp nouns np npi nticks ntrig numer numer_pbranch obase odd oddfun opacity opproperties opsubst optimprefix optionset orientation origin orthopoly_returns_intervals outative outchar packagefile palette partswitch pdf_file pfeformat phiresolution %piargs piece pivot_count_sx pivot_max_sx plot_format plot_options plot_realpart png_file pochhammer_max_index points pointsize point_size points_joined point_type poislim poisson poly_coefficient_ring poly_elimination_order polyfactor poly_grobner_algorithm poly_grobner_debug poly_monomial_order poly_primary_elimination_order poly_return_term_list poly_secondary_elimination_order poly_top_reduction_only posfun position powerdisp pred prederror primep_number_of_tests product_use_gamma program programmode promote_float_to_bigfloat prompt proportional_axes props psexpand ps_file radexpand radius radsubstflag rassociative ratalgdenom ratchristof ratdenomdivide rateinstein ratepsilon ratfac rational ratmx ratprint ratriemann ratsimpexpons ratvarswitch ratweights ratweyl ratwtlvl real realonly redraw refcheck resolution restart resultant ric riem rmxchar %rnum_list rombergabs rombergit rombergmin rombergtol rootsconmode rootsepsilon run_viewer same_xy same_xyz savedef savefactors scalar scalarmatrixp scale scale_lp setcheck setcheckbreak setval show_edge_color show_edges show_edge_type show_edge_width show_id show_label showtime show_vertex_color show_vertex_size show_vertex_type show_vertices show_weight simp simplified_output simplify_products simpproduct simpsum sinnpiflag solvedecomposes solveexplicit solvefactors solvenullwarn solveradcan solvetrigwarn space sparse sphere spring_embedding_depth sqrtdispflag stardisp startphi starttheta stats_numer stringdisp structures style sublis_apply_lambda subnumsimp sumexpand sumsplitfact surface surface_hide svg_file symmetric tab taylordepth taylor_logexpand taylor_order_coefficients taylor_truncate_polynomials tensorkill terminal testsuite_files thetaresolution timer_devalue title tlimswitch tr track transcompile transform transform_xy translate_fast_arrays transparent transrun tr_array_as_ref tr_bound_function_applyp tr_file_tty_messagesp tr_float_can_branch_complex tr_function_call_default trigexpandplus trigexpandtimes triginverses trigsign trivial_solutions tr_numer tr_optimize_max_loop tr_semicompile tr_state_vars tr_warn_bad_function_calls tr_warn_fexpr tr_warn_meval tr_warn_mode tr_warn_undeclared tr_warn_undefined_variable tstep ttyoff tube_extremes ufg ug %unitexpand unit_vectors uric uriem use_fast_arrays user_preamble usersetunits values vect_cross verbose vertex_color vertex_coloring vertex_partition vertex_size vertex_type view warnings weyl width windowname windowtitle wired_surface wireframe xaxis xaxis_color xaxis_secondary xaxis_type xaxis_width xlabel xlabel_secondary xlength xrange xrange_secondary xtics xtics_axis xtics_rotate xtics_rotate_secondary xtics_secondary xtics_secondary_axis xu_grid x_voxel xy_file xyplane xy_scale yaxis yaxis_color yaxis_secondary yaxis_type yaxis_width ylabel ylabel_secondary ylength yrange yrange_secondary ytics ytics_axis ytics_rotate ytics_rotate_secondary ytics_secondary ytics_secondary_axis yv_grid y_voxel yx_ratio zaxis zaxis_color zaxis_type zaxis_width zeroa zerob zerobern zeta%pi zlabel zlabel_rotate zlength zmin zn_primroot_limit zn_primroot_pretest",symbol:"_ __ %|0 %%|0"},contains:[{className:"comment",begin:"/\\*",end:"\\*/",contains:["self"]},t.QUOTE_STRING_MODE,{className:"number",relevance:0,variants:[{begin:"\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Ee][-+]?\\d+\\b"},{begin:"\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Bb][-+]?\\d+\\b",relevance:10},{begin:"\\b(\\.\\d+|\\d+\\.\\d+)\\b"},{begin:"\\b(\\d+|0[0-9A-Za-z]+)\\.?\\b"}]}],illegal:/@/}}gun.exports=ais});var Eun=ee((f1a,yun)=>{p();function cis(t){return{name:"MEL",keywords:"int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",illegal:"{p();function lis(t){let e={keyword:"module use_module import_module include_module end_module initialise mutable initialize finalize finalise interface implementation pred mode func type inst solver any_pred any_func is semidet det nondet multi erroneous failure cc_nondet cc_multi typeclass instance where pragma promise external trace atomic or_else require_complete_switch require_det require_semidet require_multi require_nondet require_cc_multi require_cc_nondet require_erroneous require_failure",meta:"inline no_inline type_spec source_file fact_table obsolete memo loop_check minimal_model terminates does_not_terminate check_termination promise_equivalent_clauses foreign_proc foreign_decl foreign_code foreign_type foreign_import_module foreign_export_enum foreign_export foreign_enum may_call_mercury will_not_call_mercury thread_safe not_thread_safe maybe_thread_safe promise_pure promise_semipure tabled_for_io local untrailed trailed attach_to_io_state can_pass_as_mercury_type stable will_not_throw_exception may_modify_trail will_not_modify_trail may_duplicate may_not_duplicate affects_liveness does_not_affect_liveness doesnt_affect_liveness no_sharing unknown_sharing sharing",built_in:"some all not if then else true fail false try catch catch_any semidet_true semidet_false semidet_fail impure_true impure semipure"},n=t.COMMENT("%","$"),r={className:"number",begin:"0'.\\|0[box][0-9a-fA-F]*"},s=t.inherit(t.APOS_STRING_MODE,{relevance:0}),i=t.inherit(t.QUOTE_STRING_MODE,{relevance:0}),o={className:"subst",begin:"\\\\[abfnrtv]\\|\\\\x[0-9a-fA-F]*\\\\\\|%[-+# *.0-9]*[dioxXucsfeEgGp]",relevance:0};return i.contains=i.contains.slice(),i.contains.push(o),{name:"Mercury",aliases:["m","moo"],keywords:e,contains:[{className:"built_in",variants:[{begin:"<=>"},{begin:"<=",relevance:0},{begin:"=>",relevance:0},{begin:"/\\\\"},{begin:"\\\\/"}]},{className:"built_in",variants:[{begin:":-\\|-->"},{begin:"=",relevance:0}]},n,t.C_BLOCK_COMMENT_MODE,r,t.NUMBER_MODE,s,i,{begin:/:-/},{begin:/\.$/}]}}bun.exports=lis});var Cun=ee((E1a,Sun)=>{p();function uis(t){return{name:"MIPS Assembly",case_insensitive:!0,aliases:["mips"],keywords:{$pattern:"\\.?"+t.IDENT_RE,meta:".2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .ltorg ",built_in:"$0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $30 $31 zero at v0 v1 a0 a1 a2 a3 a4 a5 a6 a7 t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 s0 s1 s2 s3 s4 s5 s6 s7 s8 k0 k1 gp sp fp ra $f0 $f1 $f2 $f2 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15 $f16 $f17 $f18 $f19 $f20 $f21 $f22 $f23 $f24 $f25 $f26 $f27 $f28 $f29 $f30 $f31 Context Random EntryLo0 EntryLo1 Context PageMask Wired EntryHi HWREna BadVAddr Count Compare SR IntCtl SRSCtl SRSMap Cause EPC PRId EBase Config Config1 Config2 Config3 LLAddr Debug DEPC DESAVE CacheErr ECC ErrorEPC TagLo DataLo TagHi DataHi WatchLo WatchHi PerfCtl PerfCnt "},contains:[{className:"keyword",begin:"\\b(addi?u?|andi?|b(al)?|beql?|bgez(al)?l?|bgtzl?|blezl?|bltz(al)?l?|bnel?|cl[oz]|divu?|ext|ins|j(al)?|jalr(\\.hb)?|jr(\\.hb)?|lbu?|lhu?|ll|lui|lw[lr]?|maddu?|mfhi|mflo|movn|movz|move|msubu?|mthi|mtlo|mul|multu?|nop|nor|ori?|rotrv?|sb|sc|se[bh]|sh|sllv?|slti?u?|srav?|srlv?|subu?|sw[lr]?|xori?|wsbh|abs\\.[sd]|add\\.[sd]|alnv.ps|bc1[ft]l?|c\\.(s?f|un|u?eq|[ou]lt|[ou]le|ngle?|seq|l[et]|ng[et])\\.[sd]|(ceil|floor|round|trunc)\\.[lw]\\.[sd]|cfc1|cvt\\.d\\.[lsw]|cvt\\.l\\.[dsw]|cvt\\.ps\\.s|cvt\\.s\\.[dlw]|cvt\\.s\\.p[lu]|cvt\\.w\\.[dls]|div\\.[ds]|ldx?c1|luxc1|lwx?c1|madd\\.[sd]|mfc1|mov[fntz]?\\.[ds]|msub\\.[sd]|mth?c1|mul\\.[ds]|neg\\.[ds]|nmadd\\.[ds]|nmsub\\.[ds]|p[lu][lu]\\.ps|recip\\.fmt|r?sqrt\\.[ds]|sdx?c1|sub\\.[ds]|suxc1|swx?c1|break|cache|d?eret|[de]i|ehb|mfc0|mtc0|pause|prefx?|rdhwr|rdpgpr|sdbbp|ssnop|synci?|syscall|teqi?|tgei?u?|tlb(p|r|w[ir])|tlti?u?|tnei?|wait|wrpgpr)",end:"\\s"},t.COMMENT("[;#](?!\\s*$)","$"),t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",relevance:0},{className:"title",begin:"\\|",end:"\\|",illegal:"\\n",relevance:0},{className:"number",variants:[{begin:"0x[0-9a-f]+"},{begin:"\\b-?\\d+"}],relevance:0},{className:"symbol",variants:[{begin:"^\\s*[a-z_\\.\\$][a-z0-9_\\.\\$]+:"},{begin:"^\\s*[0-9]+:"},{begin:"[0-9]+[bf]"}],relevance:0}],illegal:/\//}}Sun.exports=uis});var xun=ee((_1a,Iun)=>{p();function dis(t){return{name:"Mizar",keywords:"environ vocabularies notations constructors definitions registrations theorems schemes requirements begin end definition registration cluster existence pred func defpred deffunc theorem proof let take assume then thus hence ex for st holds consider reconsider such that and in provided of as from be being by means equals implies iff redefine define now not or attr is mode suppose per cases set thesis contradiction scheme reserve struct correctness compatibility coherence symmetry assymetry reflexivity irreflexivity connectedness uniqueness commutativity idempotence involutiveness projectivity",contains:[t.COMMENT("::","$")]}}Iun.exports=dis});var Tun=ee((C1a,wun)=>{p();function pis(t){return{name:"Mojolicious",subLanguage:"xml",contains:[{className:"meta",begin:"^__(END|DATA)__$"},{begin:"^\\s*%{1,2}={0,2}",end:"$",subLanguage:"perl"},{begin:"<%{1,2}={0,2}",end:"={0,1}%>",subLanguage:"perl",excludeBegin:!0,excludeEnd:!0}]}}wun.exports=pis});var Run=ee((x1a,vun)=>{p();function his(t){let e={className:"number",relevance:0,variants:[{begin:"[$][a-fA-F0-9]+"},t.NUMBER_MODE]};return{name:"Monkey",case_insensitive:!0,keywords:{keyword:"public private property continue exit extern new try catch eachin not abstract final select case default const local global field end if then else elseif endif while wend repeat until forever for to step next return module inline throw import",built_in:"DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI",literal:"true false null and or shl shr mod"},illegal:/\/\*/,contains:[t.COMMENT("#rem","#end"),t.COMMENT("'","$",{relevance:0}),{className:"function",beginKeywords:"function method",end:"[(=:]|$",illegal:/\n/,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"class",beginKeywords:"class interface",end:"$",contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{className:"built_in",begin:"\\b(self|super)\\b"},{className:"meta",begin:"\\s*#",end:"$",keywords:{"meta-keyword":"if else elseif endif end then"}},{className:"meta",begin:"^\\s*strict\\b"},{beginKeywords:"alias",end:"=",contains:[t.UNDERSCORE_TITLE_MODE]},t.QUOTE_STRING_MODE,e]}}vun.exports=his});var Nun=ee((T1a,kun)=>{p();function mis(t){let e={keyword:"if then not for in while do return else elseif break continue switch and or unless when class extends super local import export from using",literal:"true false nil",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},n="[A-Za-z$_][0-9A-Za-z$_]*",r={className:"subst",begin:/#\{/,end:/\}/,keywords:e},s=[t.inherit(t.C_NUMBER_MODE,{starts:{end:"(\\s*/)?",relevance:0}}),{className:"string",variants:[{begin:/'/,end:/'/,contains:[t.BACKSLASH_ESCAPE]},{begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r]}]},{className:"built_in",begin:"@__"+t.IDENT_RE},{begin:"@"+t.IDENT_RE},{begin:t.IDENT_RE+"\\\\"+t.IDENT_RE}];r.contains=s;let i=t.inherit(t.TITLE_MODE,{begin:n}),o="(\\(.*\\)\\s*)?\\B[-=]>",a={className:"params",begin:"\\([^\\(]",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:e,contains:["self"].concat(s)}]};return{name:"MoonScript",aliases:["moon"],keywords:e,illegal:/\/\*/,contains:s.concat([t.COMMENT("--","$"),{className:"function",begin:"^\\s*"+n+"\\s*=\\s*"+o,end:"[-=]>",returnBegin:!0,contains:[i,a]},{begin:/[\(,:=]\s*/,relevance:0,contains:[{className:"function",begin:o,end:"[-=]>",returnBegin:!0,contains:[a]}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[i]},i]},{className:"name",begin:n+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}kun.exports=mis});var Bun=ee((R1a,Dun)=>{p();function fis(t){return{name:"N1QL",case_insensitive:!0,contains:[{beginKeywords:"build create index delete drop explain infer|10 insert merge prepare select update upsert|10",end:/;/,endsWithParent:!0,keywords:{keyword:"all alter analyze and any array as asc begin between binary boolean break bucket build by call case cast cluster collate collection commit connect continue correlate cover create database dataset datastore declare decrement delete derived desc describe distinct do drop each element else end every except exclude execute exists explain fetch first flatten for force from function grant group gsi having if ignore ilike in include increment index infer inline inner insert intersect into is join key keys keyspace known last left let letting like limit lsm map mapping matched materialized merge minus namespace nest not number object offset on option or order outer over parse partition password path pool prepare primary private privilege procedure public raw realm reduce rename return returning revoke right role rollback satisfies schema select self semi set show some start statistics string system then to transaction trigger truncate under union unique unknown unnest unset update upsert use user using validate value valued values via view when where while with within work xor",literal:"true false null missing|5",built_in:"array_agg array_append array_concat array_contains array_count array_distinct array_ifnull array_length array_max array_min array_position array_prepend array_put array_range array_remove array_repeat array_replace array_reverse array_sort array_sum avg count max min sum greatest least ifmissing ifmissingornull ifnull missingif nullif ifinf ifnan ifnanorinf naninf neginfif posinfif clock_millis clock_str date_add_millis date_add_str date_diff_millis date_diff_str date_part_millis date_part_str date_trunc_millis date_trunc_str duration_to_str millis str_to_millis millis_to_str millis_to_utc millis_to_zone_name now_millis now_str str_to_duration str_to_utc str_to_zone_name decode_json encode_json encoded_size poly_length base64 base64_encode base64_decode meta uuid abs acos asin atan atan2 ceil cos degrees e exp ln log floor pi power radians random round sign sin sqrt tan trunc object_length object_names object_pairs object_inner_pairs object_values object_inner_values object_add object_put object_remove object_unwrap regexp_contains regexp_like regexp_position regexp_replace contains initcap length lower ltrim position repeat replace rtrim split substr title trim upper isarray isatom isboolean isnumber isobject isstring type toarray toatom toboolean tonumber toobject tostring"},contains:[{className:"string",begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{className:"string",begin:'"',end:'"',contains:[t.BACKSLASH_ESCAPE]},{className:"symbol",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE],relevance:2},t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE]},t.C_BLOCK_COMMENT_MODE]}}Dun.exports=fis});var Oun=ee((N1a,Pun)=>{p();function gis(t){let e={className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{/,end:/\}/},{begin:/[$@]/+t.UNDERSCORE_IDENT_RE}]},n={endsWithParent:!0,keywords:{$pattern:"[a-z/_]+",literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},relevance:0,illegal:"=>",contains:[t.HASH_COMMENT_MODE,{className:"string",contains:[t.BACKSLASH_ESCAPE,e],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[e]},{className:"regexp",contains:[t.BACKSLASH_ESCAPE,e],variants:[{begin:"\\s\\^",end:"\\s|\\{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|\\{|;",returnEnd:!0},{begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number",begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{className:"number",begin:"\\b\\d+[kKmMgGdshdwy]*\\b",relevance:0},e]};return{name:"Nginx config",aliases:["nginxconf"],contains:[t.HASH_COMMENT_MODE,{begin:t.UNDERSCORE_IDENT_RE+"\\s+\\{",returnBegin:!0,end:/\{/,contains:[{className:"section",begin:t.UNDERSCORE_IDENT_RE}],relevance:0},{begin:t.UNDERSCORE_IDENT_RE+"\\s",end:";|\\{",returnBegin:!0,contains:[{className:"attribute",begin:t.UNDERSCORE_IDENT_RE,starts:n}],relevance:0}],illegal:"[^\\s\\}]"}}Pun.exports=gis});var Lun=ee((B1a,Mun)=>{p();function Ais(t){return{name:"Nim",keywords:{keyword:"addr and as asm bind block break case cast const continue converter discard distinct div do elif else end enum except export finally for from func generic if import in include interface is isnot iterator let macro method mixin mod nil not notin object of or out proc ptr raise ref return shl shr static template try tuple type using var when while with without xor yield",literal:"shared guarded stdin stdout stderr result true false",built_in:"int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float float32 float64 bool char string cstring pointer expr stmt void auto any range array openarray varargs seq set clong culong cchar cschar cshort cint csize clonglong cfloat cdouble clongdouble cuchar cushort cuint culonglong cstringarray semistatic"},contains:[{className:"meta",begin:/\{\./,end:/\.\}/,relevance:10},{className:"string",begin:/[a-zA-Z]\w*"/,end:/"/,contains:[{begin:/""/}]},{className:"string",begin:/([a-zA-Z]\w*)?"""/,end:/"""/},t.QUOTE_STRING_MODE,{className:"type",begin:/\b[A-Z]\w+\b/,relevance:0},{className:"number",relevance:0,variants:[{begin:/\b(0[xX][0-9a-fA-F][_0-9a-fA-F]*)('?[iIuU](8|16|32|64))?/},{begin:/\b(0o[0-7][_0-7]*)('?[iIuUfF](8|16|32|64))?/},{begin:/\b(0(b|B)[01][_01]*)('?[iIuUfF](8|16|32|64))?/},{begin:/\b(\d[_\d]*)('?[iIuUfF](8|16|32|64))?/}]},t.HASH_COMMENT_MODE]}}Mun.exports=Ais});var Qun=ee((O1a,Fun)=>{p();function yis(t){return{name:"Node REPL",contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$",subLanguage:"javascript"}},variants:[{begin:/^>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}Fun.exports=yis});var $un=ee((L1a,Uun)=>{p();function Eis(t){let e={className:"variable",begin:/\$(ADMINTOOLS|APPDATA|CDBURN_AREA|CMDLINE|COMMONFILES32|COMMONFILES64|COMMONFILES|COOKIES|DESKTOP|DOCUMENTS|EXEDIR|EXEFILE|EXEPATH|FAVORITES|FONTS|HISTORY|HWNDPARENT|INSTDIR|INTERNET_CACHE|LANGUAGE|LOCALAPPDATA|MUSIC|NETHOOD|OUTDIR|PICTURES|PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES32|PROGRAMFILES64|PROGRAMFILES|QUICKLAUNCH|RECENT|RESOURCES_LOCALIZED|RESOURCES|SENDTO|SMPROGRAMS|SMSTARTUP|STARTMENU|SYSDIR|TEMP|TEMPLATES|VIDEOS|WINDIR)/},n={className:"variable",begin:/\$+\{[\w.:-]+\}/},r={className:"variable",begin:/\$+\w+/,illegal:/\(\)\{\}/},s={className:"variable",begin:/\$+\([\w^.:-]+\)/},i={className:"params",begin:"(ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)"},o={className:"keyword",begin:/!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|if|ifdef|ifmacrodef|ifmacrondef|ifndef|include|insertmacro|macro|macroend|makensis|packhdr|searchparse|searchreplace|system|tempfile|undef|verbose|warning)/},a={className:"meta",begin:/\$(\\[nrt]|\$)/},c={className:"class",begin:/\w+::\w+/},u={className:"string",variants:[{begin:'"',end:'"'},{begin:"'",end:"'"},{begin:"`",end:"`"}],illegal:/\n/,contains:[a,e,n,r,s]};return{name:"NSIS",case_insensitive:!1,keywords:{keyword:"Abort AddBrandingImage AddSize AllowRootDirInstall AllowSkipFiles AutoCloseWindow BGFont BGGradient BrandingText BringToFront Call CallInstDLL Caption ChangeUI CheckBitmap ClearErrors CompletedText ComponentText CopyFiles CRCCheck CreateDirectory CreateFont CreateShortCut Delete DeleteINISec DeleteINIStr DeleteRegKey DeleteRegValue DetailPrint DetailsButtonText DirText DirVar DirVerify EnableWindow EnumRegKey EnumRegValue Exch Exec ExecShell ExecShellWait ExecWait ExpandEnvStrings File FileBufSize FileClose FileErrorText FileOpen FileRead FileReadByte FileReadUTF16LE FileReadWord FileWriteUTF16LE FileSeek FileWrite FileWriteByte FileWriteWord FindClose FindFirst FindNext FindWindow FlushINI GetCurInstType GetCurrentAddress GetDlgItem GetDLLVersion GetDLLVersionLocal GetErrorLevel GetFileTime GetFileTimeLocal GetFullPathName GetFunctionAddress GetInstDirError GetKnownFolderPath GetLabelAddress GetTempFileName Goto HideWindow Icon IfAbort IfErrors IfFileExists IfRebootFlag IfRtlLanguage IfShellVarContextAll IfSilent InitPluginsDir InstallButtonText InstallColors InstallDir InstallDirRegKey InstProgressFlags InstType InstTypeGetText InstTypeSetText Int64Cmp Int64CmpU Int64Fmt IntCmp IntCmpU IntFmt IntOp IntPtrCmp IntPtrCmpU IntPtrOp IsWindow LangString LicenseBkColor LicenseData LicenseForceSelection LicenseLangString LicenseText LoadAndSetImage LoadLanguageFile LockWindow LogSet LogText ManifestDPIAware ManifestLongPathAware ManifestMaxVersionTested ManifestSupportedOS MessageBox MiscButtonText Name Nop OutFile Page PageCallbacks PEAddResource PEDllCharacteristics PERemoveResource PESubsysVer Pop Push Quit ReadEnvStr ReadINIStr ReadRegDWORD ReadRegStr Reboot RegDLL Rename RequestExecutionLevel ReserveFile Return RMDir SearchPath SectionGetFlags SectionGetInstTypes SectionGetSize SectionGetText SectionIn SectionSetFlags SectionSetInstTypes SectionSetSize SectionSetText SendMessage SetAutoClose SetBrandingImage SetCompress SetCompressor SetCompressorDictSize SetCtlColors SetCurInstType SetDatablockOptimize SetDateSave SetDetailsPrint SetDetailsView SetErrorLevel SetErrors SetFileAttributes SetFont SetOutPath SetOverwrite SetRebootFlag SetRegView SetShellVarContext SetSilent ShowInstDetails ShowUninstDetails ShowWindow SilentInstall SilentUnInstall Sleep SpaceTexts StrCmp StrCmpS StrCpy StrLen SubCaption Unicode UninstallButtonText UninstallCaption UninstallIcon UninstallSubCaption UninstallText UninstPage UnRegDLL Var VIAddVersionKey VIFileVersion VIProductVersion WindowIcon WriteINIStr WriteRegBin WriteRegDWORD WriteRegExpandStr WriteRegMultiStr WriteRegNone WriteRegStr WriteUninstaller XPStyle",literal:"admin all auto both bottom bzip2 colored components current custom directory false force hide highest ifdiff ifnewer instfiles lastused leave left license listonly lzma nevershow none normal notset off on open print right show silent silentlog smooth textonly top true try un.components un.custom un.directory un.instfiles un.license uninstConfirm user Win10 Win7 Win8 WinVista zlib"},contains:[t.HASH_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.COMMENT(";","$",{relevance:0}),{className:"function",beginKeywords:"Function PageEx Section SectionGroup",end:"$"},u,o,n,r,s,i,c,t.NUMBER_MODE]}}Uun.exports=Eis});var Wun=ee((Q1a,Gun)=>{p();function bis(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={$pattern:n,keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},s={$pattern:n,keyword:"@interface @class @protocol @implementation"};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:r,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+s.keyword.split(" ").join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:s,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}Gun.exports=bis});var Hun=ee(($1a,qun)=>{p();function _is(t){return{name:"OCaml",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:"\\[(\\|\\|)?\\]|\\(\\)",relevance:0},t.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*",relevance:0},t.inherit(t.APOS_STRING_MODE,{className:"string",relevance:0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/->/}]}}qun.exports=_is});var jun=ee((W1a,Vun)=>{p();function Sis(t){let e={className:"keyword",begin:"\\$(f[asn]|t|vp[rtd]|children)"},n={className:"literal",begin:"false|true|PI|undef"},r={className:"number",begin:"\\b\\d+(\\.\\d+)?(e-?\\d+)?",relevance:0},s=t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),i={className:"meta",keywords:{"meta-keyword":"include use"},begin:"include|use <",end:">"},o={className:"params",begin:"\\(",end:"\\)",contains:["self",r,s,e,n]},a={begin:"[*!#%]",relevance:0},c={className:"function",beginKeywords:"module function",end:/=|\{/,contains:[o,t.UNDERSCORE_TITLE_MODE]};return{name:"OpenSCAD",aliases:["scad"],keywords:{keyword:"function module include use for intersection_for if else \\%",literal:"false true PI undef",built_in:"circle square polygon text sphere cube cylinder polyhedron translate rotate scale resize mirror multmatrix color offset hull minkowski union difference intersection abs sign sin cos tan acos asin atan atan2 floor round ceil ln log pow sqrt exp rands min max concat lookup str chr search version version_num norm cross parent_module echo import import_dxf dxf_linear_extrude linear_extrude rotate_extrude surface projection render children dxf_cross dxf_dim let assign"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,r,i,s,e,a,c]}}Vun.exports=Sis});var Kun=ee((H1a,Yun)=>{p();function Cis(t){let e={$pattern:/\.?\w+/,keyword:"abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained"},n=t.COMMENT(/\{/,/\}/,{relevance:0}),r=t.COMMENT("\\(\\*","\\*\\)",{relevance:10}),s={className:"string",begin:"'",end:"'",contains:[{begin:"''"}]},i={className:"string",begin:"(#\\d+)+"},o={className:"function",beginKeywords:"function constructor destructor procedure method",end:"[:;]",keywords:"function constructor|10 destructor|10 procedure|10 method|10",contains:[t.TITLE_MODE,{className:"params",begin:"\\(",end:"\\)",keywords:e,contains:[s,i]},n,r]};return{name:"Oxygene",case_insensitive:!0,keywords:e,illegal:'("|\\$[G-Zg-z]|\\/\\*||->)',contains:[n,r,t.C_LINE_COMMENT_MODE,s,i,t.NUMBER_MODE,o,{className:"class",begin:"=\\bclass\\b",end:"end;",keywords:e,contains:[s,i,n,r,t.C_LINE_COMMENT_MODE,o]}]}}Yun.exports=Cis});var Jun=ee((j1a,zun)=>{p();function Iis(t){let e=t.COMMENT(/\{/,/\}/,{contains:["self"]});return{name:"Parser3",subLanguage:"xml",relevance:0,contains:[t.COMMENT("^#","$"),t.COMMENT(/\^rem\{/,/\}/,{relevance:10,contains:[e]}),{className:"meta",begin:"^@(?:BASE|USE|CLASS|OPTIONS)$",relevance:10},{className:"title",begin:"@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$"},{className:"variable",begin:/\$\{?[\w\-.:]+\}?/},{className:"keyword",begin:/\^[\w\-.:]+/},{className:"number",begin:"\\^#[0-9a-fA-F]+"},t.C_NUMBER_MODE]}}zun.exports=Iis});var Zun=ee((K1a,Xun)=>{p();function xis(t){let e={className:"variable",begin:/\$[\w\d#@][\w\d_]*/},n={className:"variable",begin:/<(?!\/)/,end:/>/};return{name:"Packet Filter config",aliases:["pf.conf"],keywords:{$pattern:/[a-z0-9_<>-]+/,built_in:"block match pass load anchor|5 antispoof|10 set table",keyword:"in out log quick on rdomain inet inet6 proto from port os to route allow-opts divert-packet divert-reply divert-to flags group icmp-type icmp6-type label once probability recieved-on rtable prio queue tos tag tagged user keep fragment for os drop af-to|10 binat-to|10 nat-to|10 rdr-to|10 bitmask least-stats random round-robin source-hash static-port dup-to reply-to route-to parent bandwidth default min max qlimit block-policy debug fingerprints hostid limit loginterface optimization reassemble ruleset-optimization basic none profile skip state-defaults state-policy timeout const counters persist no modulate synproxy state|5 floating if-bound no-sync pflow|10 sloppy source-track global rule max-src-nodes max-src-states max-src-conn max-src-conn-rate overload flush scrub|5 max-mss min-ttl no-df|10 random-id",literal:"all any no-route self urpf-failed egress|5 unknown"},contains:[t.HASH_COMMENT_MODE,t.NUMBER_MODE,t.QUOTE_STRING_MODE,e,n]}}Xun.exports=xis});var tdn=ee((J1a,edn)=>{p();function wis(t){let e=t.COMMENT("--","$"),n="[a-zA-Z_][a-zA-Z_0-9$]*",r="\\$([a-zA-Z_]?|[a-zA-Z_][a-zA-Z_0-9]*)\\$",s="<<\\s*"+n+"\\s*>>",i="ABORT ALTER ANALYZE BEGIN CALL CHECKPOINT|10 CLOSE CLUSTER COMMENT COMMIT COPY CREATE DEALLOCATE DECLARE DELETE DISCARD DO DROP END EXECUTE EXPLAIN FETCH GRANT IMPORT INSERT LISTEN LOAD LOCK MOVE NOTIFY PREPARE REASSIGN|10 REFRESH REINDEX RELEASE RESET REVOKE ROLLBACK SAVEPOINT SECURITY SELECT SET SHOW START TRUNCATE UNLISTEN|10 UPDATE VACUUM|10 VALUES AGGREGATE COLLATION CONVERSION|10 DATABASE DEFAULT PRIVILEGES DOMAIN TRIGGER EXTENSION FOREIGN WRAPPER|10 TABLE FUNCTION GROUP LANGUAGE LARGE OBJECT MATERIALIZED VIEW OPERATOR CLASS FAMILY POLICY PUBLICATION|10 ROLE RULE SCHEMA SEQUENCE SERVER STATISTICS SUBSCRIPTION SYSTEM TABLESPACE CONFIGURATION DICTIONARY PARSER TEMPLATE TYPE USER MAPPING PREPARED ACCESS METHOD CAST AS TRANSFORM TRANSACTION OWNED TO INTO SESSION AUTHORIZATION INDEX PROCEDURE ASSERTION ALL ANALYSE AND ANY ARRAY ASC ASYMMETRIC|10 BOTH CASE CHECK COLLATE COLUMN CONCURRENTLY|10 CONSTRAINT CROSS DEFERRABLE RANGE DESC DISTINCT ELSE EXCEPT FOR FREEZE|10 FROM FULL HAVING ILIKE IN INITIALLY INNER INTERSECT IS ISNULL JOIN LATERAL LEADING LIKE LIMIT NATURAL NOT NOTNULL NULL OFFSET ON ONLY OR ORDER OUTER OVERLAPS PLACING PRIMARY REFERENCES RETURNING SIMILAR SOME SYMMETRIC TABLESAMPLE THEN TRAILING UNION UNIQUE USING VARIADIC|10 VERBOSE WHEN WHERE WINDOW WITH BY RETURNS INOUT OUT SETOF|10 IF STRICT CURRENT CONTINUE OWNER LOCATION OVER PARTITION WITHIN BETWEEN ESCAPE EXTERNAL INVOKER DEFINER WORK RENAME VERSION CONNECTION CONNECT TABLES TEMP TEMPORARY FUNCTIONS SEQUENCES TYPES SCHEMAS OPTION CASCADE RESTRICT ADD ADMIN EXISTS VALID VALIDATE ENABLE DISABLE REPLICA|10 ALWAYS PASSING COLUMNS PATH REF VALUE OVERRIDING IMMUTABLE STABLE VOLATILE BEFORE AFTER EACH ROW PROCEDURAL ROUTINE NO HANDLER VALIDATOR OPTIONS STORAGE OIDS|10 WITHOUT INHERIT DEPENDS CALLED INPUT LEAKPROOF|10 COST ROWS NOWAIT SEARCH UNTIL ENCRYPTED|10 PASSWORD CONFLICT|10 INSTEAD INHERITS CHARACTERISTICS WRITE CURSOR ALSO STATEMENT SHARE EXCLUSIVE INLINE ISOLATION REPEATABLE READ COMMITTED SERIALIZABLE UNCOMMITTED LOCAL GLOBAL SQL PROCEDURES RECURSIVE SNAPSHOT ROLLUP CUBE TRUSTED|10 INCLUDE FOLLOWING PRECEDING UNBOUNDED RANGE GROUPS UNENCRYPTED|10 SYSID FORMAT DELIMITER HEADER QUOTE ENCODING FILTER OFF FORCE_QUOTE FORCE_NOT_NULL FORCE_NULL COSTS BUFFERS TIMING SUMMARY DISABLE_PAGE_SKIPPING RESTART CYCLE GENERATED IDENTITY DEFERRED IMMEDIATE LEVEL LOGGED UNLOGGED OF NOTHING NONE EXCLUDE ATTRIBUTE USAGE ROUTINES TRUE FALSE NAN INFINITY ",o="SUPERUSER NOSUPERUSER CREATEDB NOCREATEDB CREATEROLE NOCREATEROLE INHERIT NOINHERIT LOGIN NOLOGIN REPLICATION NOREPLICATION BYPASSRLS NOBYPASSRLS ",a="ALIAS BEGIN CONSTANT DECLARE END EXCEPTION RETURN PERFORM|10 RAISE GET DIAGNOSTICS STACKED|10 FOREACH LOOP ELSIF EXIT WHILE REVERSE SLICE DEBUG LOG INFO NOTICE WARNING ASSERT OPEN ",c="BIGINT INT8 BIGSERIAL SERIAL8 BIT VARYING VARBIT BOOLEAN BOOL BOX BYTEA CHARACTER CHAR VARCHAR CIDR CIRCLE DATE DOUBLE PRECISION FLOAT8 FLOAT INET INTEGER INT INT4 INTERVAL JSON JSONB LINE LSEG|10 MACADDR MACADDR8 MONEY NUMERIC DEC DECIMAL PATH POINT POLYGON REAL FLOAT4 SMALLINT INT2 SMALLSERIAL|10 SERIAL2|10 SERIAL|10 SERIAL4|10 TEXT TIME ZONE TIMETZ|10 TIMESTAMP TIMESTAMPTZ|10 TSQUERY|10 TSVECTOR|10 TXID_SNAPSHOT|10 UUID XML NATIONAL NCHAR INT4RANGE|10 INT8RANGE|10 NUMRANGE|10 TSRANGE|10 TSTZRANGE|10 DATERANGE|10 ANYELEMENT ANYARRAY ANYNONARRAY ANYENUM ANYRANGE CSTRING INTERNAL RECORD PG_DDL_COMMAND VOID UNKNOWN OPAQUE REFCURSOR NAME OID REGPROC|10 REGPROCEDURE|10 REGOPER|10 REGOPERATOR|10 REGCLASS|10 REGTYPE|10 REGROLE|10 REGNAMESPACE|10 REGCONFIG|10 REGDICTIONARY|10 ",u=c.trim().split(" ").map(function(g){return g.split("|")[0]}).join("|"),l="CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURRENT_CATALOG|10 CURRENT_DATE LOCALTIME LOCALTIMESTAMP CURRENT_ROLE|10 CURRENT_SCHEMA|10 SESSION_USER PUBLIC ",d="FOUND NEW OLD TG_NAME|10 TG_WHEN|10 TG_LEVEL|10 TG_OP|10 TG_RELID|10 TG_RELNAME|10 TG_TABLE_NAME|10 TG_TABLE_SCHEMA|10 TG_NARGS|10 TG_ARGV|10 TG_EVENT|10 TG_TAG|10 ROW_COUNT RESULT_OID|10 PG_CONTEXT|10 RETURNED_SQLSTATE COLUMN_NAME CONSTRAINT_NAME PG_DATATYPE_NAME|10 MESSAGE_TEXT TABLE_NAME SCHEMA_NAME PG_EXCEPTION_DETAIL|10 PG_EXCEPTION_HINT|10 PG_EXCEPTION_CONTEXT|10 ",h="SQLSTATE SQLERRM|10 SUCCESSFUL_COMPLETION WARNING DYNAMIC_RESULT_SETS_RETURNED IMPLICIT_ZERO_BIT_PADDING NULL_VALUE_ELIMINATED_IN_SET_FUNCTION PRIVILEGE_NOT_GRANTED PRIVILEGE_NOT_REVOKED STRING_DATA_RIGHT_TRUNCATION DEPRECATED_FEATURE NO_DATA NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED SQL_STATEMENT_NOT_YET_COMPLETE CONNECTION_EXCEPTION CONNECTION_DOES_NOT_EXIST CONNECTION_FAILURE SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION TRANSACTION_RESOLUTION_UNKNOWN PROTOCOL_VIOLATION TRIGGERED_ACTION_EXCEPTION FEATURE_NOT_SUPPORTED INVALID_TRANSACTION_INITIATION LOCATOR_EXCEPTION INVALID_LOCATOR_SPECIFICATION INVALID_GRANTOR INVALID_GRANT_OPERATION INVALID_ROLE_SPECIFICATION DIAGNOSTICS_EXCEPTION STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER CASE_NOT_FOUND CARDINALITY_VIOLATION DATA_EXCEPTION ARRAY_SUBSCRIPT_ERROR CHARACTER_NOT_IN_REPERTOIRE DATETIME_FIELD_OVERFLOW DIVISION_BY_ZERO ERROR_IN_ASSIGNMENT ESCAPE_CHARACTER_CONFLICT INDICATOR_OVERFLOW INTERVAL_FIELD_OVERFLOW INVALID_ARGUMENT_FOR_LOGARITHM INVALID_ARGUMENT_FOR_NTILE_FUNCTION INVALID_ARGUMENT_FOR_NTH_VALUE_FUNCTION INVALID_ARGUMENT_FOR_POWER_FUNCTION INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION INVALID_CHARACTER_VALUE_FOR_CAST INVALID_DATETIME_FORMAT INVALID_ESCAPE_CHARACTER INVALID_ESCAPE_OCTET INVALID_ESCAPE_SEQUENCE NONSTANDARD_USE_OF_ESCAPE_CHARACTER INVALID_INDICATOR_PARAMETER_VALUE INVALID_PARAMETER_VALUE INVALID_REGULAR_EXPRESSION INVALID_ROW_COUNT_IN_LIMIT_CLAUSE INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE INVALID_TABLESAMPLE_ARGUMENT INVALID_TABLESAMPLE_REPEAT INVALID_TIME_ZONE_DISPLACEMENT_VALUE INVALID_USE_OF_ESCAPE_CHARACTER MOST_SPECIFIC_TYPE_MISMATCH NULL_VALUE_NOT_ALLOWED NULL_VALUE_NO_INDICATOR_PARAMETER NUMERIC_VALUE_OUT_OF_RANGE SEQUENCE_GENERATOR_LIMIT_EXCEEDED STRING_DATA_LENGTH_MISMATCH STRING_DATA_RIGHT_TRUNCATION SUBSTRING_ERROR TRIM_ERROR UNTERMINATED_C_STRING ZERO_LENGTH_CHARACTER_STRING FLOATING_POINT_EXCEPTION INVALID_TEXT_REPRESENTATION INVALID_BINARY_REPRESENTATION BAD_COPY_FILE_FORMAT UNTRANSLATABLE_CHARACTER NOT_AN_XML_DOCUMENT INVALID_XML_DOCUMENT INVALID_XML_CONTENT INVALID_XML_COMMENT INVALID_XML_PROCESSING_INSTRUCTION INTEGRITY_CONSTRAINT_VIOLATION RESTRICT_VIOLATION NOT_NULL_VIOLATION FOREIGN_KEY_VIOLATION UNIQUE_VIOLATION CHECK_VIOLATION EXCLUSION_VIOLATION INVALID_CURSOR_STATE INVALID_TRANSACTION_STATE ACTIVE_SQL_TRANSACTION BRANCH_TRANSACTION_ALREADY_ACTIVE HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION READ_ONLY_SQL_TRANSACTION SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED NO_ACTIVE_SQL_TRANSACTION IN_FAILED_SQL_TRANSACTION IDLE_IN_TRANSACTION_SESSION_TIMEOUT INVALID_SQL_STATEMENT_NAME TRIGGERED_DATA_CHANGE_VIOLATION INVALID_AUTHORIZATION_SPECIFICATION INVALID_PASSWORD DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST DEPENDENT_OBJECTS_STILL_EXIST INVALID_TRANSACTION_TERMINATION SQL_ROUTINE_EXCEPTION FUNCTION_EXECUTED_NO_RETURN_STATEMENT MODIFYING_SQL_DATA_NOT_PERMITTED PROHIBITED_SQL_STATEMENT_ATTEMPTED READING_SQL_DATA_NOT_PERMITTED INVALID_CURSOR_NAME EXTERNAL_ROUTINE_EXCEPTION CONTAINING_SQL_NOT_PERMITTED MODIFYING_SQL_DATA_NOT_PERMITTED PROHIBITED_SQL_STATEMENT_ATTEMPTED READING_SQL_DATA_NOT_PERMITTED EXTERNAL_ROUTINE_INVOCATION_EXCEPTION INVALID_SQLSTATE_RETURNED NULL_VALUE_NOT_ALLOWED TRIGGER_PROTOCOL_VIOLATED SRF_PROTOCOL_VIOLATED EVENT_TRIGGER_PROTOCOL_VIOLATED SAVEPOINT_EXCEPTION INVALID_SAVEPOINT_SPECIFICATION INVALID_CATALOG_NAME INVALID_SCHEMA_NAME TRANSACTION_ROLLBACK TRANSACTION_INTEGRITY_CONSTRAINT_VIOLATION SERIALIZATION_FAILURE STATEMENT_COMPLETION_UNKNOWN DEADLOCK_DETECTED SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION SYNTAX_ERROR INSUFFICIENT_PRIVILEGE CANNOT_COERCE GROUPING_ERROR WINDOWING_ERROR INVALID_RECURSION INVALID_FOREIGN_KEY INVALID_NAME NAME_TOO_LONG RESERVED_NAME DATATYPE_MISMATCH INDETERMINATE_DATATYPE COLLATION_MISMATCH INDETERMINATE_COLLATION WRONG_OBJECT_TYPE GENERATED_ALWAYS UNDEFINED_COLUMN UNDEFINED_FUNCTION UNDEFINED_TABLE UNDEFINED_PARAMETER UNDEFINED_OBJECT DUPLICATE_COLUMN DUPLICATE_CURSOR DUPLICATE_DATABASE DUPLICATE_FUNCTION DUPLICATE_PREPARED_STATEMENT DUPLICATE_SCHEMA DUPLICATE_TABLE DUPLICATE_ALIAS DUPLICATE_OBJECT AMBIGUOUS_COLUMN AMBIGUOUS_FUNCTION AMBIGUOUS_PARAMETER AMBIGUOUS_ALIAS INVALID_COLUMN_REFERENCE INVALID_COLUMN_DEFINITION INVALID_CURSOR_DEFINITION INVALID_DATABASE_DEFINITION INVALID_FUNCTION_DEFINITION INVALID_PREPARED_STATEMENT_DEFINITION INVALID_SCHEMA_DEFINITION INVALID_TABLE_DEFINITION INVALID_OBJECT_DEFINITION WITH_CHECK_OPTION_VIOLATION INSUFFICIENT_RESOURCES DISK_FULL OUT_OF_MEMORY TOO_MANY_CONNECTIONS CONFIGURATION_LIMIT_EXCEEDED PROGRAM_LIMIT_EXCEEDED STATEMENT_TOO_COMPLEX TOO_MANY_COLUMNS TOO_MANY_ARGUMENTS OBJECT_NOT_IN_PREREQUISITE_STATE OBJECT_IN_USE CANT_CHANGE_RUNTIME_PARAM LOCK_NOT_AVAILABLE OPERATOR_INTERVENTION QUERY_CANCELED ADMIN_SHUTDOWN CRASH_SHUTDOWN CANNOT_CONNECT_NOW DATABASE_DROPPED SYSTEM_ERROR IO_ERROR UNDEFINED_FILE DUPLICATE_FILE SNAPSHOT_TOO_OLD CONFIG_FILE_ERROR LOCK_FILE_EXISTS FDW_ERROR FDW_COLUMN_NAME_NOT_FOUND FDW_DYNAMIC_PARAMETER_VALUE_NEEDED FDW_FUNCTION_SEQUENCE_ERROR FDW_INCONSISTENT_DESCRIPTOR_INFORMATION FDW_INVALID_ATTRIBUTE_VALUE FDW_INVALID_COLUMN_NAME FDW_INVALID_COLUMN_NUMBER FDW_INVALID_DATA_TYPE FDW_INVALID_DATA_TYPE_DESCRIPTORS FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER FDW_INVALID_HANDLE FDW_INVALID_OPTION_INDEX FDW_INVALID_OPTION_NAME FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH FDW_INVALID_STRING_FORMAT FDW_INVALID_USE_OF_NULL_POINTER FDW_TOO_MANY_HANDLES FDW_OUT_OF_MEMORY FDW_NO_SCHEMAS FDW_OPTION_NAME_NOT_FOUND FDW_REPLY_HANDLE FDW_SCHEMA_NOT_FOUND FDW_TABLE_NOT_FOUND FDW_UNABLE_TO_CREATE_EXECUTION FDW_UNABLE_TO_CREATE_REPLY FDW_UNABLE_TO_ESTABLISH_CONNECTION PLPGSQL_ERROR RAISE_EXCEPTION NO_DATA_FOUND TOO_MANY_ROWS ASSERT_FAILURE INTERNAL_ERROR DATA_CORRUPTED INDEX_CORRUPTED ",f="ARRAY_AGG AVG BIT_AND BIT_OR BOOL_AND BOOL_OR COUNT EVERY JSON_AGG JSONB_AGG JSON_OBJECT_AGG JSONB_OBJECT_AGG MAX MIN MODE STRING_AGG SUM XMLAGG CORR COVAR_POP COVAR_SAMP REGR_AVGX REGR_AVGY REGR_COUNT REGR_INTERCEPT REGR_R2 REGR_SLOPE REGR_SXX REGR_SXY REGR_SYY STDDEV STDDEV_POP STDDEV_SAMP VARIANCE VAR_POP VAR_SAMP PERCENTILE_CONT PERCENTILE_DISC ROW_NUMBER RANK DENSE_RANK PERCENT_RANK CUME_DIST NTILE LAG LEAD FIRST_VALUE LAST_VALUE NTH_VALUE NUM_NONNULLS NUM_NULLS ABS CBRT CEIL CEILING DEGREES DIV EXP FLOOR LN LOG MOD PI POWER RADIANS ROUND SCALE SIGN SQRT TRUNC WIDTH_BUCKET RANDOM SETSEED ACOS ACOSD ASIN ASIND ATAN ATAND ATAN2 ATAN2D COS COSD COT COTD SIN SIND TAN TAND BIT_LENGTH CHAR_LENGTH CHARACTER_LENGTH LOWER OCTET_LENGTH OVERLAY POSITION SUBSTRING TREAT TRIM UPPER ASCII BTRIM CHR CONCAT CONCAT_WS CONVERT CONVERT_FROM CONVERT_TO DECODE ENCODE INITCAP LEFT LENGTH LPAD LTRIM MD5 PARSE_IDENT PG_CLIENT_ENCODING QUOTE_IDENT|10 QUOTE_LITERAL|10 QUOTE_NULLABLE|10 REGEXP_MATCH REGEXP_MATCHES REGEXP_REPLACE REGEXP_SPLIT_TO_ARRAY REGEXP_SPLIT_TO_TABLE REPEAT REPLACE REVERSE RIGHT RPAD RTRIM SPLIT_PART STRPOS SUBSTR TO_ASCII TO_HEX TRANSLATE OCTET_LENGTH GET_BIT GET_BYTE SET_BIT SET_BYTE TO_CHAR TO_DATE TO_NUMBER TO_TIMESTAMP AGE CLOCK_TIMESTAMP|10 DATE_PART DATE_TRUNC ISFINITE JUSTIFY_DAYS JUSTIFY_HOURS JUSTIFY_INTERVAL MAKE_DATE MAKE_INTERVAL|10 MAKE_TIME MAKE_TIMESTAMP|10 MAKE_TIMESTAMPTZ|10 NOW STATEMENT_TIMESTAMP|10 TIMEOFDAY TRANSACTION_TIMESTAMP|10 ENUM_FIRST ENUM_LAST ENUM_RANGE AREA CENTER DIAMETER HEIGHT ISCLOSED ISOPEN NPOINTS PCLOSE POPEN RADIUS WIDTH BOX BOUND_BOX CIRCLE LINE LSEG PATH POLYGON ABBREV BROADCAST HOST HOSTMASK MASKLEN NETMASK NETWORK SET_MASKLEN TEXT INET_SAME_FAMILY INET_MERGE MACADDR8_SET7BIT ARRAY_TO_TSVECTOR GET_CURRENT_TS_CONFIG NUMNODE PLAINTO_TSQUERY PHRASETO_TSQUERY WEBSEARCH_TO_TSQUERY QUERYTREE SETWEIGHT STRIP TO_TSQUERY TO_TSVECTOR JSON_TO_TSVECTOR JSONB_TO_TSVECTOR TS_DELETE TS_FILTER TS_HEADLINE TS_RANK TS_RANK_CD TS_REWRITE TSQUERY_PHRASE TSVECTOR_TO_ARRAY TSVECTOR_UPDATE_TRIGGER TSVECTOR_UPDATE_TRIGGER_COLUMN XMLCOMMENT XMLCONCAT XMLELEMENT XMLFOREST XMLPI XMLROOT XMLEXISTS XML_IS_WELL_FORMED XML_IS_WELL_FORMED_DOCUMENT XML_IS_WELL_FORMED_CONTENT XPATH XPATH_EXISTS XMLTABLE XMLNAMESPACES TABLE_TO_XML TABLE_TO_XMLSCHEMA TABLE_TO_XML_AND_XMLSCHEMA QUERY_TO_XML QUERY_TO_XMLSCHEMA QUERY_TO_XML_AND_XMLSCHEMA CURSOR_TO_XML CURSOR_TO_XMLSCHEMA SCHEMA_TO_XML SCHEMA_TO_XMLSCHEMA SCHEMA_TO_XML_AND_XMLSCHEMA DATABASE_TO_XML DATABASE_TO_XMLSCHEMA DATABASE_TO_XML_AND_XMLSCHEMA XMLATTRIBUTES TO_JSON TO_JSONB ARRAY_TO_JSON ROW_TO_JSON JSON_BUILD_ARRAY JSONB_BUILD_ARRAY JSON_BUILD_OBJECT JSONB_BUILD_OBJECT JSON_OBJECT JSONB_OBJECT JSON_ARRAY_LENGTH JSONB_ARRAY_LENGTH JSON_EACH JSONB_EACH JSON_EACH_TEXT JSONB_EACH_TEXT JSON_EXTRACT_PATH JSONB_EXTRACT_PATH JSON_OBJECT_KEYS JSONB_OBJECT_KEYS JSON_POPULATE_RECORD JSONB_POPULATE_RECORD JSON_POPULATE_RECORDSET JSONB_POPULATE_RECORDSET JSON_ARRAY_ELEMENTS JSONB_ARRAY_ELEMENTS JSON_ARRAY_ELEMENTS_TEXT JSONB_ARRAY_ELEMENTS_TEXT JSON_TYPEOF JSONB_TYPEOF JSON_TO_RECORD JSONB_TO_RECORD JSON_TO_RECORDSET JSONB_TO_RECORDSET JSON_STRIP_NULLS JSONB_STRIP_NULLS JSONB_SET JSONB_INSERT JSONB_PRETTY CURRVAL LASTVAL NEXTVAL SETVAL COALESCE NULLIF GREATEST LEAST ARRAY_APPEND ARRAY_CAT ARRAY_NDIMS ARRAY_DIMS ARRAY_FILL ARRAY_LENGTH ARRAY_LOWER ARRAY_POSITION ARRAY_POSITIONS ARRAY_PREPEND ARRAY_REMOVE ARRAY_REPLACE ARRAY_TO_STRING ARRAY_UPPER CARDINALITY STRING_TO_ARRAY UNNEST ISEMPTY LOWER_INC UPPER_INC LOWER_INF UPPER_INF RANGE_MERGE GENERATE_SERIES GENERATE_SUBSCRIPTS CURRENT_DATABASE CURRENT_QUERY CURRENT_SCHEMA|10 CURRENT_SCHEMAS|10 INET_CLIENT_ADDR INET_CLIENT_PORT INET_SERVER_ADDR INET_SERVER_PORT ROW_SECURITY_ACTIVE FORMAT_TYPE TO_REGCLASS TO_REGPROC TO_REGPROCEDURE TO_REGOPER TO_REGOPERATOR TO_REGTYPE TO_REGNAMESPACE TO_REGROLE COL_DESCRIPTION OBJ_DESCRIPTION SHOBJ_DESCRIPTION TXID_CURRENT TXID_CURRENT_IF_ASSIGNED TXID_CURRENT_SNAPSHOT TXID_SNAPSHOT_XIP TXID_SNAPSHOT_XMAX TXID_SNAPSHOT_XMIN TXID_VISIBLE_IN_SNAPSHOT TXID_STATUS CURRENT_SETTING SET_CONFIG BRIN_SUMMARIZE_NEW_VALUES BRIN_SUMMARIZE_RANGE BRIN_DESUMMARIZE_RANGE GIN_CLEAN_PENDING_LIST SUPPRESS_REDUNDANT_UPDATES_TRIGGER LO_FROM_BYTEA LO_PUT LO_GET LO_CREAT LO_CREATE LO_UNLINK LO_IMPORT LO_EXPORT LOREAD LOWRITE GROUPING CAST ".trim().split(" ").map(function(g){return g.split("|")[0]}).join("|");return{name:"PostgreSQL",aliases:["postgres","postgresql"],case_insensitive:!0,keywords:{keyword:i+a+o,built_in:l+d+h},illegal:/:==|\W\s*\(\*|(^|\s)\$[a-z]|\{\{|[a-z]:\s*$|\.\.\.|TO:|DO:/,contains:[{className:"keyword",variants:[{begin:/\bTEXT\s*SEARCH\b/},{begin:/\b(PRIMARY|FOREIGN|FOR(\s+NO)?)\s+KEY\b/},{begin:/\bPARALLEL\s+(UNSAFE|RESTRICTED|SAFE)\b/},{begin:/\bSTORAGE\s+(PLAIN|EXTERNAL|EXTENDED|MAIN)\b/},{begin:/\bMATCH\s+(FULL|PARTIAL|SIMPLE)\b/},{begin:/\bNULLS\s+(FIRST|LAST)\b/},{begin:/\bEVENT\s+TRIGGER\b/},{begin:/\b(MAPPING|OR)\s+REPLACE\b/},{begin:/\b(FROM|TO)\s+(PROGRAM|STDIN|STDOUT)\b/},{begin:/\b(SHARE|EXCLUSIVE)\s+MODE\b/},{begin:/\b(LEFT|RIGHT)\s+(OUTER\s+)?JOIN\b/},{begin:/\b(FETCH|MOVE)\s+(NEXT|PRIOR|FIRST|LAST|ABSOLUTE|RELATIVE|FORWARD|BACKWARD)\b/},{begin:/\bPRESERVE\s+ROWS\b/},{begin:/\bDISCARD\s+PLANS\b/},{begin:/\bREFERENCING\s+(OLD|NEW)\b/},{begin:/\bSKIP\s+LOCKED\b/},{begin:/\bGROUPING\s+SETS\b/},{begin:/\b(BINARY|INSENSITIVE|SCROLL|NO\s+SCROLL)\s+(CURSOR|FOR)\b/},{begin:/\b(WITH|WITHOUT)\s+HOLD\b/},{begin:/\bWITH\s+(CASCADED|LOCAL)\s+CHECK\s+OPTION\b/},{begin:/\bEXCLUDE\s+(TIES|NO\s+OTHERS)\b/},{begin:/\bFORMAT\s+(TEXT|XML|JSON|YAML)\b/},{begin:/\bSET\s+((SESSION|LOCAL)\s+)?NAMES\b/},{begin:/\bIS\s+(NOT\s+)?UNKNOWN\b/},{begin:/\bSECURITY\s+LABEL\b/},{begin:/\bSTANDALONE\s+(YES|NO|NO\s+VALUE)\b/},{begin:/\bWITH\s+(NO\s+)?DATA\b/},{begin:/\b(FOREIGN|SET)\s+DATA\b/},{begin:/\bSET\s+(CATALOG|CONSTRAINTS)\b/},{begin:/\b(WITH|FOR)\s+ORDINALITY\b/},{begin:/\bIS\s+(NOT\s+)?DOCUMENT\b/},{begin:/\bXML\s+OPTION\s+(DOCUMENT|CONTENT)\b/},{begin:/\b(STRIP|PRESERVE)\s+WHITESPACE\b/},{begin:/\bNO\s+(ACTION|MAXVALUE|MINVALUE)\b/},{begin:/\bPARTITION\s+BY\s+(RANGE|LIST|HASH)\b/},{begin:/\bAT\s+TIME\s+ZONE\b/},{begin:/\bGRANTED\s+BY\b/},{begin:/\bRETURN\s+(QUERY|NEXT)\b/},{begin:/\b(ATTACH|DETACH)\s+PARTITION\b/},{begin:/\bFORCE\s+ROW\s+LEVEL\s+SECURITY\b/},{begin:/\b(INCLUDING|EXCLUDING)\s+(COMMENTS|CONSTRAINTS|DEFAULTS|IDENTITY|INDEXES|STATISTICS|STORAGE|ALL)\b/},{begin:/\bAS\s+(ASSIGNMENT|IMPLICIT|PERMISSIVE|RESTRICTIVE|ENUM|RANGE)\b/}]},{begin:/\b(FORMAT|FAMILY|VERSION)\s*\(/},{begin:/\bINCLUDE\s*\(/,keywords:"INCLUDE"},{begin:/\bRANGE(?!\s*(BETWEEN|UNBOUNDED|CURRENT|[-0-9]+))/},{begin:/\b(VERSION|OWNER|TEMPLATE|TABLESPACE|CONNECTION\s+LIMIT|PROCEDURE|RESTRICT|JOIN|PARSER|COPY|START|END|COLLATION|INPUT|ANALYZE|STORAGE|LIKE|DEFAULT|DELIMITER|ENCODING|COLUMN|CONSTRAINT|TABLE|SCHEMA)\s*=/},{begin:/\b(PG_\w+?|HAS_[A-Z_]+_PRIVILEGE)\b/,relevance:10},{begin:/\bEXTRACT\s*\(/,end:/\bFROM\b/,returnEnd:!0,keywords:{type:"CENTURY DAY DECADE DOW DOY EPOCH HOUR ISODOW ISOYEAR MICROSECONDS MILLENNIUM MILLISECONDS MINUTE MONTH QUARTER SECOND TIMEZONE TIMEZONE_HOUR TIMEZONE_MINUTE WEEK YEAR"}},{begin:/\b(XMLELEMENT|XMLPI)\s*\(\s*NAME/,keywords:{keyword:"NAME"}},{begin:/\b(XMLPARSE|XMLSERIALIZE)\s*\(\s*(DOCUMENT|CONTENT)/,keywords:{keyword:"DOCUMENT CONTENT"}},{beginKeywords:"CACHE INCREMENT MAXVALUE MINVALUE",end:t.C_NUMBER_RE,returnEnd:!0,keywords:"BY CACHE INCREMENT MAXVALUE MINVALUE"},{className:"type",begin:/\b(WITH|WITHOUT)\s+TIME\s+ZONE\b/},{className:"type",begin:/\bINTERVAL\s+(YEAR|MONTH|DAY|HOUR|MINUTE|SECOND)(\s+TO\s+(MONTH|HOUR|MINUTE|SECOND))?\b/},{begin:/\bRETURNS\s+(LANGUAGE_HANDLER|TRIGGER|EVENT_TRIGGER|FDW_HANDLER|INDEX_AM_HANDLER|TSM_HANDLER)\b/,keywords:{keyword:"RETURNS",type:"LANGUAGE_HANDLER TRIGGER EVENT_TRIGGER FDW_HANDLER INDEX_AM_HANDLER TSM_HANDLER"}},{begin:"\\b("+f+")\\s*\\("},{begin:"\\.("+u+")\\b"},{begin:"\\b("+u+")\\s+PATH\\b",keywords:{keyword:"PATH",type:c.replace("PATH ","")}},{className:"type",begin:"\\b("+u+")\\b"},{className:"string",begin:"'",end:"'",contains:[{begin:"''"}]},{className:"string",begin:"(e|E|u&|U&)'",end:"'",contains:[{begin:"\\\\."}],relevance:10},t.END_SAME_AS_BEGIN({begin:r,end:r,contains:[{subLanguage:["pgsql","perl","python","tcl","r","lua","java","php","ruby","bash","scheme","xml","json"],endsWithParent:!0}]}),{begin:'"',end:'"',contains:[{begin:'""'}]},t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,e,{className:"meta",variants:[{begin:"%(ROW)?TYPE",relevance:10},{begin:"\\$\\d+"},{begin:"^#\\w",end:"$"}]},{className:"symbol",begin:s,relevance:10}]}}edn.exports=wis});var rdn=ee((Z1a,ndn)=>{p();function Tis(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}ndn.exports=Tis});var idn=ee((tBa,sdn)=>{p();function vis(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}sdn.exports=vis});var adn=ee((rBa,odn)=>{p();function Ris(t){let e={keyword:"actor addressof and as be break class compile_error compile_intrinsic consume continue delegate digestof do else elseif embed end error for fun if ifdef in interface is isnt lambda let match new not object or primitive recover repeat return struct then trait try type until use var where while with xor",meta:"iso val tag trn box ref",literal:"this false true"},n={className:"string",begin:'"""',end:'"""',relevance:10},r={className:"string",begin:'"',end:'"',contains:[t.BACKSLASH_ESCAPE]},s={className:"string",begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE],relevance:0},i={className:"type",begin:"\\b_?[A-Z][\\w]*",relevance:0},o={begin:t.IDENT_RE+"'",relevance:0};return{name:"Pony",keywords:e,contains:[i,n,r,s,o,{className:"number",begin:"(-?)(\\b0[xX][a-fA-F0-9]+|\\b0[bB][01]+|(\\b\\d+(_\\d+)?(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",relevance:0},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]}}odn.exports=Ris});var ldn=ee((iBa,cdn)=>{p();function kis(t){let e=["string","char","byte","int","long","bool","decimal","single","double","DateTime","xml","array","hashtable","void"],n="Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where",r="-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|-split|-wildcard|-xor",s={$pattern:/-?[A-z\.\-]+\b/,keyword:"if else foreach return do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch hidden static parameter",built_in:"ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write"},i=/\w[\w\d]*((-)[\w\d]+)*/,o={begin:"`[\\s\\S]",relevance:0},a={className:"variable",variants:[{begin:/\$\B/},{className:"keyword",begin:/\$this/},{begin:/\$[\w\d][\w\d_:]*/}]},c={className:"literal",begin:/\$(null|true|false)\b/},u={className:"string",variants:[{begin:/"/,end:/"/},{begin:/@"/,end:/^"@/}],contains:[o,a,{className:"variable",begin:/\$[A-z]/,end:/[^A-z]/}]},l={className:"string",variants:[{begin:/'/,end:/'/},{begin:/@'/,end:/^'@/}]},d={className:"doctag",variants:[{begin:/\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/},{begin:/\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\s+\S+/}]},h=t.inherit(t.COMMENT(null,null),{variants:[{begin:/#/,end:/$/},{begin:/<#/,end:/#>/}],contains:[d]}),m={className:"built_in",variants:[{begin:"(".concat(n,")+(-)[\\w\\d]+")}]},f={className:"class",beginKeywords:"class enum",end:/\s*[{]/,excludeEnd:!0,relevance:0,contains:[t.TITLE_MODE]},g={className:"function",begin:/function\s+/,end:/\s*\{|$/,excludeEnd:!0,returnBegin:!0,relevance:0,contains:[{begin:"function",relevance:0,className:"keyword"},{className:"title",begin:i,relevance:0},{begin:/\(/,end:/\)/,className:"params",relevance:0,contains:[a]}]},A={begin:/using\s/,end:/$/,returnBegin:!0,contains:[u,l,{className:"keyword",begin:/(using|assembly|command|module|namespace|type)/}]},y={variants:[{className:"operator",begin:"(".concat(r,")\\b")},{className:"literal",begin:/(-)[\w\d]+/,relevance:0}]},b={className:"selector-tag",begin:/@\B/,relevance:0},S={className:"function",begin:/\[.*\]\s*[\w]+[ ]??\(/,end:/$/,returnBegin:!0,relevance:0,contains:[{className:"keyword",begin:"(".concat(s.keyword.toString().replace(/\s/g,"|"),")\\b"),endsParent:!0,relevance:0},t.inherit(t.TITLE_MODE,{endsParent:!0})]},C=[S,h,o,t.NUMBER_MODE,u,l,m,a,c,b],I={begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[].concat("self",C,{begin:"("+e.join("|")+")",className:"built_in",relevance:0},{className:"type",begin:/[\.\w\d]+/,relevance:0})};return S.contains.unshift(I),{name:"PowerShell",aliases:["ps","ps1"],case_insensitive:!0,keywords:s,contains:C.concat(f,g,A,y,I)}}cdn.exports=kis});var ddn=ee((aBa,udn)=>{p();function Nis(t){return{name:"Processing",keywords:{keyword:"BufferedReader PVector PFont PImage PGraphics HashMap boolean byte char color double float int long String Array FloatDict FloatList IntDict IntList JSONArray JSONObject Object StringDict StringList Table TableRow XML false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",literal:"P2D P3D HALF_PI PI QUARTER_PI TAU TWO_PI",title:"setup draw",built_in:"displayHeight displayWidth mouseY mouseX mousePressed pmouseX pmouseY key keyCode pixels focused frameCount frameRate height width size createGraphics beginDraw createShape loadShape PShape arc ellipse line point quad rect triangle bezier bezierDetail bezierPoint bezierTangent curve curveDetail curvePoint curveTangent curveTightness shape shapeMode beginContour beginShape bezierVertex curveVertex endContour endShape quadraticVertex vertex ellipseMode noSmooth rectMode smooth strokeCap strokeJoin strokeWeight mouseClicked mouseDragged mouseMoved mousePressed mouseReleased mouseWheel keyPressed keyPressedkeyReleased keyTyped print println save saveFrame day hour millis minute month second year background clear colorMode fill noFill noStroke stroke alpha blue brightness color green hue lerpColor red saturation modelX modelY modelZ screenX screenY screenZ ambient emissive shininess specular add createImage beginCamera camera endCamera frustum ortho perspective printCamera printProjection cursor frameRate noCursor exit loop noLoop popStyle pushStyle redraw binary boolean byte char float hex int str unbinary unhex join match matchAll nf nfc nfp nfs split splitTokens trim append arrayCopy concat expand reverse shorten sort splice subset box sphere sphereDetail createInput createReader loadBytes loadJSONArray loadJSONObject loadStrings loadTable loadXML open parseXML saveTable selectFolder selectInput beginRaw beginRecord createOutput createWriter endRaw endRecord PrintWritersaveBytes saveJSONArray saveJSONObject saveStream saveStrings saveXML selectOutput popMatrix printMatrix pushMatrix resetMatrix rotate rotateX rotateY rotateZ scale shearX shearY translate ambientLight directionalLight lightFalloff lights lightSpecular noLights normal pointLight spotLight image imageMode loadImage noTint requestImage tint texture textureMode textureWrap blend copy filter get loadPixels set updatePixels blendMode loadShader PShaderresetShader shader createFont loadFont text textFont textAlign textLeading textMode textSize textWidth textAscent textDescent abs ceil constrain dist exp floor lerp log mag map max min norm pow round sq sqrt acos asin atan atan2 cos degrees radians sin tan noise noiseDetail noiseSeed random randomGaussian randomSeed"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE]}}udn.exports=Nis});var hdn=ee((lBa,pdn)=>{p();function Dis(t){return{name:"Python profiler",contains:[t.C_NUMBER_MODE,{begin:"[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}",end:":",excludeEnd:!0},{begin:"(ncalls|tottime|cumtime)",end:"$",keywords:"ncalls tottime|10 cumtime|10 filename",relevance:10},{begin:"function calls",end:"$",contains:[t.C_NUMBER_MODE],relevance:10},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:"\\(",end:"\\)$",excludeBegin:!0,excludeEnd:!0,relevance:0}]}}pdn.exports=Dis});var fdn=ee((dBa,mdn)=>{p();function Bis(t){let e={begin:/[a-z][A-Za-z0-9_]*/,relevance:0},n={className:"symbol",variants:[{begin:/[A-Z][a-zA-Z0-9_]*/},{begin:/_[A-Za-z0-9_]*/}],relevance:0},r={begin:/\(/,end:/\)/,relevance:0},s={begin:/\[/,end:/\]/},i={className:"comment",begin:/%/,end:/$/,contains:[t.PHRASAL_WORDS_MODE]},o={className:"string",begin:/`/,end:/`/,contains:[t.BACKSLASH_ESCAPE]},a={className:"string",begin:/0'(\\'|.)/},c={className:"string",begin:/0'\\s/},l=[e,n,r,{begin:/:-/},s,i,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,o,a,c,t.C_NUMBER_MODE];return r.contains=l,s.contains=l,{name:"Prolog",contains:l.concat([{begin:/\.$/}])}}mdn.exports=Bis});var Adn=ee((hBa,gdn)=>{p();function Pis(t){var e="[ \\t\\f]*",n="[ \\t\\f]+",r=e+"[:=]"+e,s=n,i="("+r+"|"+s+")",o="([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",a="([^\\\\:= \\t\\f\\n]|\\\\.)+",c={end:i,relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{begin:"\\\\\\\\"},{begin:"\\\\\\n"}]}};return{name:".properties",case_insensitive:!0,illegal:/\S/,contains:[t.COMMENT("^\\s*[!#]","$"),{returnBegin:!0,variants:[{begin:o+r,relevance:1},{begin:o+s,relevance:0}],contains:[{className:"attr",begin:o,endsParent:!0,relevance:0}],starts:c},{begin:a+i,returnBegin:!0,relevance:0,contains:[{className:"meta",begin:a,endsParent:!0,relevance:0}],starts:c},{className:"attr",relevance:0,begin:a+e+"$"}]}}gdn.exports=Pis});var Edn=ee((fBa,ydn)=>{p();function Ois(t){return{name:"Protocol Buffers",keywords:{keyword:"package import option optional required repeated group oneof",built_in:"double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes",literal:"true false"},contains:[t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"message enum service",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{className:"function",beginKeywords:"rpc",end:/[{;]/,excludeEnd:!0,keywords:"rpc returns"},{begin:/^\s*[A-Z_]+(?=\s*=[^\n]+;$)/}]}}ydn.exports=Ois});var _dn=ee((ABa,bdn)=>{p();function Mis(t){let e={keyword:"and case default else elsif false if in import enherits node or true undef unless main settings $string ",literal:"alias audit before loglevel noop require subscribe tag owner ensure group mode name|0 changes context force incl lens load_path onlyif provider returns root show_diff type_check en_address ip_address realname command environment hour monute month monthday special target weekday creates cwd ogoutput refresh refreshonly tries try_sleep umask backup checksum content ctime force ignore links mtime purge recurse recurselimit replace selinux_ignore_defaults selrange selrole seltype seluser source souirce_permissions sourceselect validate_cmd validate_replacement allowdupe attribute_membership auth_membership forcelocal gid ia_load_module members system host_aliases ip allowed_trunk_vlans description device_url duplex encapsulation etherchannel native_vlan speed principals allow_root auth_class auth_type authenticate_user k_of_n mechanisms rule session_owner shared options device fstype enable hasrestart directory present absent link atboot blockdevice device dump pass remounts poller_tag use message withpath adminfile allow_virtual allowcdrom category configfiles flavor install_options instance package_settings platform responsefile status uninstall_options vendor unless_system_user unless_uid binary control flags hasstatus manifest pattern restart running start stop allowdupe auths expiry gid groups home iterations key_membership keys managehome membership password password_max_age password_min_age profile_membership profiles project purge_ssh_keys role_membership roles salt shell uid baseurl cost descr enabled enablegroups exclude failovermethod gpgcheck gpgkey http_caching include includepkgs keepalive metadata_expire metalink mirrorlist priority protect proxy proxy_password proxy_username repo_gpgcheck s3_enabled skip_if_unavailable sslcacert sslclientcert sslclientkey sslverify mounted",built_in:"architecture augeasversion blockdevices boardmanufacturer boardproductname boardserialnumber cfkey dhcp_servers domain ec2_ ec2_userdata facterversion filesystems ldom fqdn gid hardwareisa hardwaremodel hostname id|0 interfaces ipaddress ipaddress_ ipaddress6 ipaddress6_ iphostnumber is_virtual kernel kernelmajversion kernelrelease kernelversion kernelrelease kernelversion lsbdistcodename lsbdistdescription lsbdistid lsbdistrelease lsbmajdistrelease lsbminordistrelease lsbrelease macaddress macaddress_ macosx_buildversion macosx_productname macosx_productversion macosx_productverson_major macosx_productversion_minor manufacturer memoryfree memorysize netmask metmask_ network_ operatingsystem operatingsystemmajrelease operatingsystemrelease osfamily partitions path physicalprocessorcount processor processorcount productname ps puppetversion rubysitedir rubyversion selinux selinux_config_mode selinux_config_policy selinux_current_mode selinux_current_mode selinux_enforced selinux_policyversion serialnumber sp_ sshdsakey sshecdsakey sshrsakey swapencrypted swapfree swapsize timezone type uniqueid uptime uptime_days uptime_hours uptime_seconds uuid virtual vlans xendomains zfs_version zonenae zones zpool_version"},n=t.COMMENT("#","$"),r="([A-Za-z_]|::)(\\w|::)*",s=t.inherit(t.TITLE_MODE,{begin:r}),i={className:"variable",begin:"\\$"+r},o={className:"string",contains:[t.BACKSLASH_ESCAPE,i],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/}]};return{name:"Puppet",aliases:["pp"],contains:[n,i,o,{beginKeywords:"class",end:"\\{|;",illegal:/=/,contains:[s,n]},{beginKeywords:"define",end:/\{/,contains:[{className:"section",begin:t.IDENT_RE,endsParent:!0}]},{begin:t.IDENT_RE+"\\s+\\{",returnBegin:!0,end:/\S/,contains:[{className:"keyword",begin:t.IDENT_RE},{begin:/\{/,end:/\}/,keywords:e,relevance:0,contains:[o,n,{begin:"[a-zA-Z_]+\\s*=>",returnBegin:!0,end:"=>",contains:[{className:"attr",begin:t.IDENT_RE}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},i]}],relevance:0}]}}bdn.exports=Mis});var Cdn=ee((EBa,Sdn)=>{p();function Lis(t){let e={className:"string",begin:'(~)?"',end:'"',illegal:"\\n"},n={className:"symbol",begin:"#[a-zA-Z_]\\w*\\$?"};return{name:"PureBASIC",aliases:["pb","pbi"],keywords:"Align And Array As Break CallDebugger Case CompilerCase CompilerDefault CompilerElse CompilerElseIf CompilerEndIf CompilerEndSelect CompilerError CompilerIf CompilerSelect CompilerWarning Continue Data DataSection Debug DebugLevel Declare DeclareC DeclareCDLL DeclareDLL DeclareModule Default Define Dim DisableASM DisableDebugger DisableExplicit Else ElseIf EnableASM EnableDebugger EnableExplicit End EndDataSection EndDeclareModule EndEnumeration EndIf EndImport EndInterface EndMacro EndModule EndProcedure EndSelect EndStructure EndStructureUnion EndWith Enumeration EnumerationBinary Extends FakeReturn For ForEach ForEver Global Gosub Goto If Import ImportC IncludeBinary IncludeFile IncludePath Interface List Macro MacroExpandedCount Map Module NewList NewMap Next Not Or Procedure ProcedureC ProcedureCDLL ProcedureDLL ProcedureReturn Protected Prototype PrototypeC ReDim Read Repeat Restore Return Runtime Select Shared Static Step Structure StructureUnion Swap Threaded To UndefineMacro Until Until UnuseModule UseModule Wend While With XIncludeFile XOr",contains:[t.COMMENT(";","$",{relevance:0}),{className:"function",begin:"\\b(Procedure|Declare)(C|CDLL|DLL)?\\b",end:"\\(",excludeEnd:!0,returnBegin:!0,contains:[{className:"keyword",begin:"(Procedure|Declare)(C|CDLL|DLL)?",excludeEnd:!0},{className:"type",begin:"\\.\\w*"},t.UNDERSCORE_TITLE_MODE]},e,n]}}Sdn.exports=Lis});var xdn=ee((_Ba,Idn)=>{p();function Fis(t){return{aliases:["pycon"],contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}Idn.exports=Fis});var Tdn=ee((CBa,wdn)=>{p();function Qis(t){return{name:"Q",aliases:["k","kdb"],keywords:{$pattern:/(`?)[A-Za-z0-9_]+\b/,keyword:"do while select delete by update from",literal:"0b 1b",built_in:"neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum",type:"`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid"},contains:[t.C_LINE_COMMENT_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE]}}wdn.exports=Qis});var Rdn=ee((xBa,vdn)=>{p();function Uis(t){return t?typeof t=="string"?t:t.source:null}function $is(...t){return t.map(n=>Uis(n)).join("")}function Gis(t){let e={keyword:"in of on if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await import",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Behavior bool color coordinate date double enumeration font geocircle georectangle geoshape int list matrix4x4 parent point quaternion real rect size string url variant vector2d vector3d vector4d Promise"},n="[a-zA-Z_][a-zA-Z0-9\\._]*",r={className:"keyword",begin:"\\bproperty\\b",starts:{className:"string",end:"(:|=|;|,|//|/\\*|$)",returnEnd:!0}},s={className:"keyword",begin:"\\bsignal\\b",starts:{className:"string",end:"(\\(|:|=|;|,|//|/\\*|$)",returnEnd:!0}},i={className:"attribute",begin:"\\bid\\s*:",starts:{className:"string",end:n,returnEnd:!1}},o={begin:n+"\\s*:",returnBegin:!0,contains:[{className:"attribute",begin:n,end:"\\s*:",excludeEnd:!0,relevance:0}],relevance:0},a={begin:$is(n,/\s*\{/),end:/\{/,returnBegin:!0,relevance:0,contains:[t.inherit(t.TITLE_MODE,{begin:n})]};return{name:"QML",aliases:["qt"],case_insensitive:!1,keywords:e,contains:[{className:"meta",begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,{className:"subst",begin:"\\$\\{",end:"\\}"}]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"number",variants:[{begin:"\\b(0[bB][01]+)"},{begin:"\\b(0[oO][0-7]+)"},{begin:t.C_NUMBER_RE}],relevance:0},{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.REGEXP_MODE,{begin:/\s*[);\]]/,relevance:0,subLanguage:"xml"}],relevance:0},s,r,{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/}),{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]}],illegal:/\[|%/},{begin:"\\."+t.IDENT_RE,relevance:0},i,o,a],illegal:/#/}}vdn.exports=Gis});var Ndn=ee((TBa,kdn)=>{p();function Wis(t){return t?typeof t=="string"?t:t.source:null}function qis(t){return bze("(?=",t,")")}function bze(...t){return t.map(n=>Wis(n)).join("")}function His(t){let e=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=/[a-zA-Z][a-zA-Z_0-9]*/;return{name:"R",illegal:/->/,keywords:{$pattern:e,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},compilerExtensions:[(r,s)=>{if(!r.beforeMatch)return;if(r.starts)throw new Error("beforeMatch cannot be used with starts");let i=Object.assign({},r);Object.keys(r).forEach(o=>{delete r[o]}),r.begin=bze(i.beforeMatch,qis(i.begin)),r.starts={relevance:0,contains:[Object.assign(i,{endsParent:!0})]},r.relevance=0,delete i.beforeMatch}],contains:[t.COMMENT(/#'/,/$/,{contains:[{className:"doctag",begin:"@examples",starts:{contains:[{begin:/\n/},{begin:/#'\s*(?=@[a-zA-Z]+)/,endsParent:!0},{begin:/#'/,end:/$/,excludeBegin:!0}]}},{className:"doctag",begin:"@param",end:/$/,contains:[{className:"variable",variants:[{begin:e},{begin:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{className:"doctag",begin:/@[a-zA-Z]+/},{className:"meta-keyword",begin:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{className:"number",relevance:0,beforeMatch:/([^a-zA-Z0-9._])/,variants:[{match:/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/},{match:/0[xX][0-9a-fA-F]+([pP][+-]?\d+)?[Li]?/},{match:/(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[Li]?/}]},{begin:"%",end:"%"},{begin:bze(n,"\\s+<-\\s+")},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}kdn.exports=His});var Bdn=ee((RBa,Ddn)=>{p();function Vis(t){function e(I){return I.map(function(x){return x.split("").map(function(w){return"\\"+w}).join("")}).join("|")}let n="~?[a-z$_][0-9a-zA-Z$_]*",r="`?[A-Z$_][0-9a-zA-Z$_]*",s="'?[a-z$_][0-9a-z$_]*",i="\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*("+s+"\\s*(,"+s+"\\s*)*)?\\))?",o=n+"("+i+"){0,2}",a="("+e(["||","++","**","+.","*","/","*.","/.","..."])+"|\\|>|&&|==|===)",c="\\s+"+a+"\\s+",u={keyword:"and as asr assert begin class constraint do done downto else end exception external for fun function functor if in include inherit initializer land lazy let lor lsl lsr lxor match method mod module mutable new nonrec object of open or private rec sig struct then to try type val virtual when while with",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ",literal:"true false"},l="\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",d={className:"number",relevance:0,variants:[{begin:l},{begin:"\\(-"+l+"\\)"}]},h={className:"operator",relevance:0,begin:a},m=[{className:"identifier",relevance:0,begin:n},h,d],f=[t.QUOTE_STRING_MODE,h,{className:"module",begin:"\\b"+r,returnBegin:!0,end:".",contains:[{className:"identifier",begin:r,relevance:0}]}],g=[{className:"module",begin:"\\b"+r,returnBegin:!0,end:".",relevance:0,contains:[{className:"identifier",begin:r,relevance:0}]}],A={begin:n,end:"(,|\\n|\\))",relevance:0,contains:[h,{className:"typing",begin:":",end:"(,|\\n)",returnBegin:!0,relevance:0,contains:g}]},y={className:"function",relevance:0,keywords:u,variants:[{begin:"\\s(\\(\\.?.*?\\)|"+n+")\\s*=>",end:"\\s*=>",returnBegin:!0,relevance:0,contains:[{className:"params",variants:[{begin:n},{begin:o},{begin:/\(\s*\)/}]}]},{begin:"\\s\\(\\.?[^;\\|]*\\)\\s*=>",end:"\\s=>",returnBegin:!0,relevance:0,contains:[{className:"params",relevance:0,variants:[A]}]},{begin:"\\(\\.\\s"+n+"\\)\\s*=>"}]};f.push(y);let b={className:"constructor",begin:r+"\\(",end:"\\)",illegal:"\\n",keywords:u,contains:[t.QUOTE_STRING_MODE,h,{className:"params",begin:"\\b"+n}]},S={className:"pattern-match",begin:"\\|",returnBegin:!0,keywords:u,end:"=>",relevance:0,contains:[b,h,{relevance:0,className:"constructor",begin:r}]},C={className:"module-access",keywords:u,returnBegin:!0,variants:[{begin:"\\b("+r+"\\.)+"+n},{begin:"\\b("+r+"\\.)+\\(",end:"\\)",returnBegin:!0,contains:[y,{begin:"\\(",end:"\\)",skip:!0}].concat(f)},{begin:"\\b("+r+"\\.)+\\{",end:/\}/}],contains:f};return g.push(C),{name:"ReasonML",aliases:["re"],keywords:u,illegal:"(:-|:=|\\$\\{|\\+=)",contains:[t.COMMENT("/\\*","\\*/",{illegal:"^(#,\\/\\/)"}),{className:"character",begin:"'(\\\\[^']+|[^'])'",illegal:"\\n",relevance:0},t.QUOTE_STRING_MODE,{className:"literal",begin:"\\(\\)",relevance:0},{className:"literal",begin:"\\[\\|",end:"\\|\\]",relevance:0,contains:m},{className:"literal",begin:"\\[",end:"\\]",relevance:0,contains:m},b,{className:"operator",begin:c,illegal:"-->",relevance:0},d,t.C_LINE_COMMENT_MODE,S,y,{className:"module-def",begin:"\\bmodule\\s+"+n+"\\s+"+r+"\\s+=\\s+\\{",end:/\}/,returnBegin:!0,keywords:u,relevance:0,contains:[{className:"module",relevance:0,begin:r},{begin:/\{/,end:/\}/,skip:!0}].concat(f)},C]}}Ddn.exports=Vis});var Odn=ee((NBa,Pdn)=>{p();function jis(t){return{name:"RenderMan RIB",keywords:"ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry Hider Hyperboloid Identity Illuminate Imager Interior LightSource MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd TransformPoints Translate TrimCurve WorldBegin WorldEnd",illegal:"{p();function Yis(t){let e="[a-zA-Z-_][^\\n{]+\\{",n={className:"attribute",begin:/[a-zA-Z-_]+/,end:/\s*:/,excludeEnd:!0,starts:{end:";",relevance:0,contains:[{className:"variable",begin:/\.[a-zA-Z-_]+/},{className:"keyword",begin:/\(optional\)/}]}};return{name:"Roboconf",aliases:["graph","instances"],case_insensitive:!0,keywords:"import",contains:[{begin:"^facet "+e,end:/\}/,keywords:"facet",contains:[n,t.HASH_COMMENT_MODE]},{begin:"^\\s*instance of "+e,end:/\}/,keywords:"name count channels instance-data instance-state instance of",illegal:/\S/,contains:["self",n,t.HASH_COMMENT_MODE]},{begin:"^"+e,end:/\}/,contains:[n,t.HASH_COMMENT_MODE]},t.HASH_COMMENT_MODE]}}Mdn.exports=Yis});var Qdn=ee((OBa,Fdn)=>{p();function Kis(t){let e="foreach do while for if from to step else on-error and or not in",n="global local beep delay put len typeof pick log time set find environment terminal error execute parse resolve toarray tobool toid toip toip6 tonum tostr totime",r="add remove enable disable set get print export edit find run debug error info warning",s="true false yes no nothing nil null",i="traffic-flow traffic-generator firewall scheduler aaa accounting address-list address align area bandwidth-server bfd bgp bridge client clock community config connection console customer default dhcp-client dhcp-server discovery dns e-mail ethernet filter firmware gps graphing group hardware health hotspot identity igmp-proxy incoming instance interface ip ipsec ipv6 irq l2tp-server lcd ldp logging mac-server mac-winbox mangle manual mirror mme mpls nat nd neighbor network note ntp ospf ospf-v3 ovpn-server page peer pim ping policy pool port ppp pppoe-client pptp-server prefix profile proposal proxy queue radius resource rip ripng route routing screen script security-profiles server service service-port settings shares smb sms sniffer snmp snooper socks sstp-server system tool tracking type upgrade upnp user-manager users user vlan secret vrrp watchdog web-access wireless pptp pppoe lan wan layer7-protocol lease simple raw",o={className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,o,{className:"variable",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]}]},c={className:"string",begin:/'/,end:/'/};return{name:"Microtik RouterOS script",aliases:["mikrotik"],case_insensitive:!0,keywords:{$pattern:/:?[\w-]+/,literal:s,keyword:e+" :"+e.split(" ").join(" :")+" :"+n.split(" ").join(" :")},contains:[{variants:[{begin:/\/\*/,end:/\*\//},{begin:/\/\//,end:/$/},{begin:/<\//,end:/>/}],illegal:/./},t.COMMENT("^#","$"),a,c,o,{begin:/[\w-]+=([^\s{}[\]()>]+)/,relevance:0,returnBegin:!0,contains:[{className:"attribute",begin:/[^=]+/},{begin:/=/,endsWithParent:!0,relevance:0,contains:[a,c,o,{className:"literal",begin:"\\b("+s.split(" ").join("|")+")\\b"},{begin:/("[^"]*"|[^\s{}[\]]+)/}]}]},{className:"number",begin:/\*[0-9a-fA-F]+/},{begin:"\\b("+r.split(" ").join("|")+")([\\s[(\\]|])",returnBegin:!0,contains:[{className:"builtin-name",begin:/\w+/}]},{className:"built_in",variants:[{begin:"(\\.\\./|/|\\s)(("+i.split(" ").join("|")+");?\\s)+"},{begin:/\.\./,relevance:0}]}]}}Fdn.exports=Kis});var $dn=ee((LBa,Udn)=>{p();function zis(t){return{name:"RenderMan RSL",keywords:{keyword:"float color point normal vector matrix while for if do return else break extern continue",built_in:"abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp faceforward filterstep floor format fresnel incident length lightsource log match max min mod noise normalize ntransform opposite option phong pnoise pow printf ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan texture textureinfo trace transform vtransform xcomp ycomp zcomp"},illegal:"{p();function Jis(t){return{name:"Oracle Rules Language",keywords:{keyword:"BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM NUMDAYS READ_DATE STAGING",built_in:"IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{className:"literal",variants:[{begin:"#\\s+",relevance:0},{begin:"#[a-zA-Z .]+"}]}]}}Gdn.exports=Jis});var Hdn=ee(($Ba,qdn)=>{p();function Xis(t){return{name:"SAS",case_insensitive:!0,keywords:{literal:"null missing _all_ _automatic_ _character_ _infile_ _n_ _name_ _null_ _numeric_ _user_ _webout_",meta:"do if then else end until while abort array attrib by call cards cards4 catname continue datalines datalines4 delete delim delimiter display dm drop endsas error file filename footnote format goto in infile informat input keep label leave length libname link list lostcard merge missing modify options output out page put redirect remove rename replace retain return select set skip startsas stop title update waitsas where window x systask add and alter as cascade check create delete describe distinct drop foreign from group having index insert into in key like message modify msgtype not null on or order primary references reset restrict select set table unique update validate view where"},contains:[{className:"keyword",begin:/^\s*(proc [\w\d_]+|data|run|quit)[\s;]/},{className:"variable",begin:/&[a-zA-Z_&][a-zA-Z0-9_]*\.?/},{className:"emphasis",begin:/^\s*datalines|cards.*;/,end:/^\s*;\s*$/},{className:"built_in",begin:"%("+"bquote|nrbquote|cmpres|qcmpres|compstor|datatyp|display|do|else|end|eval|global|goto|if|index|input|keydef|label|left|length|let|local|lowcase|macro|mend|nrbquote|nrquote|nrstr|put|qcmpres|qleft|qlowcase|qscan|qsubstr|qsysfunc|qtrim|quote|qupcase|scan|str|substr|superq|syscall|sysevalf|sysexec|sysfunc|sysget|syslput|sysprod|sysrc|sysrput|then|to|trim|unquote|until|upcase|verify|while|window"+")"},{className:"name",begin:/%[a-zA-Z_][a-zA-Z_0-9]*/},{className:"meta",begin:"[^%]("+"abs|addr|airy|arcos|arsin|atan|attrc|attrn|band|betainv|blshift|bnot|bor|brshift|bxor|byte|cdf|ceil|cexist|cinv|close|cnonct|collate|compbl|compound|compress|cos|cosh|css|curobs|cv|daccdb|daccdbsl|daccsl|daccsyd|dacctab|dairy|date|datejul|datepart|datetime|day|dclose|depdb|depdbsl|depdbsl|depsl|depsl|depsyd|depsyd|deptab|deptab|dequote|dhms|dif|digamma|dim|dinfo|dnum|dopen|doptname|doptnum|dread|dropnote|dsname|erf|erfc|exist|exp|fappend|fclose|fcol|fdelete|fetch|fetchobs|fexist|fget|fileexist|filename|fileref|finfo|finv|fipname|fipnamel|fipstate|floor|fnonct|fnote|fopen|foptname|foptnum|fpoint|fpos|fput|fread|frewind|frlen|fsep|fuzz|fwrite|gaminv|gamma|getoption|getvarc|getvarn|hbound|hms|hosthelp|hour|ibessel|index|indexc|indexw|input|inputc|inputn|int|intck|intnx|intrr|irr|jbessel|juldate|kurtosis|lag|lbound|left|length|lgamma|libname|libref|log|log10|log2|logpdf|logpmf|logsdf|lowcase|max|mdy|mean|min|minute|mod|month|mopen|mort|n|netpv|nmiss|normal|note|npv|open|ordinal|pathname|pdf|peek|peekc|pmf|point|poisson|poke|probbeta|probbnml|probchi|probf|probgam|probhypr|probit|probnegb|probnorm|probt|put|putc|putn|qtr|quote|ranbin|rancau|ranexp|rangam|range|rank|rannor|ranpoi|rantbl|rantri|ranuni|repeat|resolve|reverse|rewind|right|round|saving|scan|sdf|second|sign|sin|sinh|skewness|soundex|spedis|sqrt|std|stderr|stfips|stname|stnamel|substr|sum|symget|sysget|sysmsg|sysprod|sysrc|system|tan|tanh|time|timepart|tinv|tnonct|today|translate|tranwrd|trigamma|trim|trimn|trunc|uniform|upcase|uss|var|varfmt|varinfmt|varlabel|varlen|varname|varnum|varray|varrayx|vartype|verify|vformat|vformatd|vformatdx|vformatn|vformatnx|vformatw|vformatwx|vformatx|vinarray|vinarrayx|vinformat|vinformatd|vinformatdx|vinformatn|vinformatnx|vinformatw|vinformatwx|vinformatx|vlabel|vlabelx|vlength|vlengthx|vname|vnamex|vtype|vtypex|weekday|year|yyq|zipfips|zipname|zipnamel|zipstate"+")[(]"},{className:"string",variants:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},t.COMMENT("\\*",";"),t.C_BLOCK_COMMENT_MODE]}}qdn.exports=Xis});var jdn=ee((WBa,Vdn)=>{p();function Zis(t){let e="[^\\(\\)\\[\\]\\{\\}\",'`;#|\\\\\\s]+",n="(-|\\+)?\\d+([./]\\d+)?",r=n+"[+\\-]"+n+"i",s={$pattern:e,"builtin-name":"case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules ' * + , ,@ - ... / ; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"},i={className:"literal",begin:"(#t|#f|#\\\\"+e+"|#\\\\.)"},o={className:"number",variants:[{begin:n,relevance:0},{begin:r,relevance:0},{begin:"#b[0-1]+(/[0-1]+)?"},{begin:"#o[0-7]+(/[0-7]+)?"},{begin:"#x[0-9a-f]+(/[0-9a-f]+)?"}]},a=t.QUOTE_STRING_MODE,c=[t.COMMENT(";","$",{relevance:0}),t.COMMENT("#\\|","\\|#")],u={begin:e,relevance:0},l={className:"symbol",begin:"'"+e},d={endsWithParent:!0,relevance:0},h={variants:[{begin:/'/},{begin:"`"}],contains:[{begin:"\\(",end:"\\)",contains:["self",i,a,o,u,l]}]},m={className:"name",relevance:0,begin:e,keywords:s},g={variants:[{begin:"\\(",end:"\\)"},{begin:"\\[",end:"\\]"}],contains:[{begin:/lambda/,endsWithParent:!0,returnBegin:!0,contains:[m,{endsParent:!0,variants:[{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/}],contains:[u]}]},m,d]};return d.contains=[i,o,a,u,l,h,g].concat(c),{name:"Scheme",illegal:/\S/,contains:[t.SHEBANG(),o,a,l,h,g].concat(c)}}Vdn.exports=Zis});var Kdn=ee((HBa,Ydn)=>{p();function eos(t){let e=[t.C_NUMBER_MODE,{className:"string",begin:`'|"`,end:`'|"`,contains:[t.BACKSLASH_ESCAPE,{begin:"''"}]}];return{name:"Scilab",aliases:["sci"],keywords:{$pattern:/%?\w+/,keyword:"abort break case clear catch continue do elseif else endfunction end for function global if pause return resume select try then while",literal:"%f %F %t %T %pi %eps %inf %nan %e %i %z %s",built_in:"abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp error exec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isempty isinfisnan isvector lasterror length load linspace list listfiles log10 log2 log max min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand real round sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tan type typename warning zeros matrix"},illegal:'("|#|/\\*|\\s+/\\w+)',contains:[{className:"function",beginKeywords:"function",end:"$",contains:[t.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)"}]},{begin:"[a-zA-Z_][a-zA-Z_0-9]*[\\.']+",relevance:0},{begin:"\\[",end:"\\][\\.']*",relevance:0,contains:e},t.COMMENT("//","$")].concat(e)}}Ydn.exports=eos});var Jdn=ee((jBa,zdn)=>{p();var tos=t=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]}}),nos=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ros=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],sos=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],ios=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],oos=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse();function aos(t){let e=tos(t),n=ios,r=sos,s="@[a-z-]+",i="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b"};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+nos.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:"::("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},{className:"attribute",begin:"\\b("+oos.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:":",end:";",contains:[a,e.HEXCOLOR,t.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT]},{begin:"@(page|font-face)",lexemes:s,keywords:"@page @font-face"},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:ros.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,t.CSS_NUMBER_MODE]}]}}zdn.exports=aos});var Zdn=ee((KBa,Xdn)=>{p();function cos(t){return{name:"Shell Session",aliases:["console"],contains:[{className:"meta",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#]/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}Xdn.exports=cos});var tpn=ee((JBa,epn)=>{p();function los(t){let e=["add","and","cmp","cmpg","cmpl","const","div","double","float","goto","if","int","long","move","mul","neg","new","nop","not","or","rem","return","shl","shr","sput","sub","throw","ushr","xor"],n=["aget","aput","array","check","execute","fill","filled","goto/16","goto/32","iget","instance","invoke","iput","monitor","packed","sget","sparse"],r=["transient","constructor","abstract","final","synthetic","public","private","protected","static","bridge","system"];return{name:"Smali",contains:[{className:"string",begin:'"',end:'"',relevance:0},t.COMMENT("#","$",{relevance:0}),{className:"keyword",variants:[{begin:"\\s*\\.end\\s[a-zA-Z0-9]*"},{begin:"^[ ]*\\.[a-zA-Z]*",relevance:0},{begin:"\\s:[a-zA-Z_0-9]*",relevance:0},{begin:"\\s("+r.join("|")+")"}]},{className:"built_in",variants:[{begin:"\\s("+e.join("|")+")\\s"},{begin:"\\s("+e.join("|")+")((-|/)[a-zA-Z0-9]+)+\\s",relevance:10},{begin:"\\s("+n.join("|")+")((-|/)[a-zA-Z0-9]+)*\\s",relevance:10}]},{className:"class",begin:`L[^(;: -]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}epn.exports=los});var rpn=ee((ZBa,npn)=>{p();function uos(t){let e="[a-z][a-zA-Z0-9_]*",n={className:"string",begin:"\\$.{1}"},r={className:"symbol",begin:"#"+t.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:"self super nil true false thisContext",contains:[t.COMMENT('"','"'),t.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:e+":",relevance:0},t.C_NUMBER_MODE,r,n,{begin:"\\|[ ]*"+e+"([ ]+"+e+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+e}]},{begin:"#\\(",end:"\\)",contains:[t.APOS_STRING_MODE,n,t.C_NUMBER_MODE,r]}]}}npn.exports=uos});var ipn=ee((tPa,spn)=>{p();function dos(t){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},t.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},t.inherit(t.APOS_STRING_MODE,{className:"string",relevance:0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}spn.exports=dos});var apn=ee((rPa,opn)=>{p();function pos(t){let e={className:"variable",begin:/\b_+[a-zA-Z]\w*/},n={className:"title",begin:/[a-zA-Z][a-zA-Z0-9]+_fnc_\w*/},r={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},s={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"define undef ifdef ifndef else endif include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(r,{className:"meta-string"}),{className:"meta-string",begin:/<[^\n>]*>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]};return{name:"SQF",case_insensitive:!0,keywords:{keyword:"case catch default do else exit exitWith for forEach from if private switch then throw to try waitUntil while with",built_in:"abs accTime acos action actionIDs actionKeys actionKeysImages actionKeysNames actionKeysNamesArray actionName actionParams activateAddons activatedAddons activateKey add3DENConnection add3DENEventHandler add3DENLayer addAction addBackpack addBackpackCargo addBackpackCargoGlobal addBackpackGlobal addCamShake addCuratorAddons addCuratorCameraArea addCuratorEditableObjects addCuratorEditingArea addCuratorPoints addEditorObject addEventHandler addForce addGoggles addGroupIcon addHandgunItem addHeadgear addItem addItemCargo addItemCargoGlobal addItemPool addItemToBackpack addItemToUniform addItemToVest addLiveStats addMagazine addMagazineAmmoCargo addMagazineCargo addMagazineCargoGlobal addMagazineGlobal addMagazinePool addMagazines addMagazineTurret addMenu addMenuItem addMissionEventHandler addMPEventHandler addMusicEventHandler addOwnedMine addPlayerScores addPrimaryWeaponItem addPublicVariableEventHandler addRating addResources addScore addScoreSide addSecondaryWeaponItem addSwitchableUnit addTeamMember addToRemainsCollector addTorque addUniform addVehicle addVest addWaypoint addWeapon addWeaponCargo addWeaponCargoGlobal addWeaponGlobal addWeaponItem addWeaponPool addWeaponTurret admin agent agents AGLToASL aimedAtTarget aimPos airDensityRTD airplaneThrottle airportSide AISFinishHeal alive all3DENEntities allAirports allControls allCurators allCutLayers allDead allDeadMen allDisplays allGroups allMapMarkers allMines allMissionObjects allow3DMode allowCrewInImmobile allowCuratorLogicIgnoreAreas allowDamage allowDammage allowFileOperations allowFleeing allowGetIn allowSprint allPlayers allSimpleObjects allSites allTurrets allUnits allUnitsUAV allVariables ammo ammoOnPylon and animate animateBay animateDoor animatePylon animateSource animationNames animationPhase animationSourcePhase animationState append apply armoryPoints arrayIntersect asin ASLToAGL ASLToATL assert assignAsCargo assignAsCargoIndex assignAsCommander assignAsDriver assignAsGunner assignAsTurret assignCurator assignedCargo assignedCommander assignedDriver assignedGunner assignedItems assignedTarget assignedTeam assignedVehicle assignedVehicleRole assignItem assignTeam assignToAirport atan atan2 atg ATLToASL attachedObject attachedObjects attachedTo attachObject attachTo attackEnabled backpack backpackCargo backpackContainer backpackItems backpackMagazines backpackSpaceFor behaviour benchmark binocular boundingBox boundingBoxReal boundingCenter breakOut breakTo briefingName buildingExit buildingPos buttonAction buttonSetAction cadetMode call callExtension camCommand camCommit camCommitPrepared camCommitted camConstuctionSetParams camCreate camDestroy cameraEffect cameraEffectEnableHUD cameraInterest cameraOn cameraView campaignConfigFile camPreload camPreloaded camPrepareBank camPrepareDir camPrepareDive camPrepareFocus camPrepareFov camPrepareFovRange camPreparePos camPrepareRelPos camPrepareTarget camSetBank camSetDir camSetDive camSetFocus camSetFov camSetFovRange camSetPos camSetRelPos camSetTarget camTarget camUseNVG canAdd canAddItemToBackpack canAddItemToUniform canAddItemToVest cancelSimpleTaskDestination canFire canMove canSlingLoad canStand canSuspend canTriggerDynamicSimulation canUnloadInCombat canVehicleCargo captive captiveNum cbChecked cbSetChecked ceil channelEnabled cheatsEnabled checkAIFeature checkVisibility className clearAllItemsFromBackpack clearBackpackCargo clearBackpackCargoGlobal clearGroupIcons clearItemCargo clearItemCargoGlobal clearItemPool clearMagazineCargo clearMagazineCargoGlobal clearMagazinePool clearOverlay clearRadio clearWeaponCargo clearWeaponCargoGlobal clearWeaponPool clientOwner closeDialog closeDisplay closeOverlay collapseObjectTree collect3DENHistory collectiveRTD combatMode commandArtilleryFire commandChat commander commandFire commandFollow commandFSM commandGetOut commandingMenu commandMove commandRadio commandStop commandSuppressiveFire commandTarget commandWatch comment commitOverlay compile compileFinal completedFSM composeText configClasses configFile configHierarchy configName configProperties configSourceAddonList configSourceMod configSourceModList confirmSensorTarget connectTerminalToUAV controlsGroupCtrl copyFromClipboard copyToClipboard copyWaypoints cos count countEnemy countFriendly countSide countType countUnknown create3DENComposition create3DENEntity createAgent createCenter createDialog createDiaryLink createDiaryRecord createDiarySubject createDisplay createGearDialog createGroup createGuardedPoint createLocation createMarker createMarkerLocal createMenu createMine createMissionDisplay createMPCampaignDisplay createSimpleObject createSimpleTask createSite createSoundSource createTask createTeam createTrigger createUnit createVehicle createVehicleCrew createVehicleLocal crew ctAddHeader ctAddRow ctClear ctCurSel ctData ctFindHeaderRows ctFindRowHeader ctHeaderControls ctHeaderCount ctRemoveHeaders ctRemoveRows ctrlActivate ctrlAddEventHandler ctrlAngle ctrlAutoScrollDelay ctrlAutoScrollRewind ctrlAutoScrollSpeed ctrlChecked ctrlClassName ctrlCommit ctrlCommitted ctrlCreate ctrlDelete ctrlEnable ctrlEnabled ctrlFade ctrlHTMLLoaded ctrlIDC ctrlIDD ctrlMapAnimAdd ctrlMapAnimClear ctrlMapAnimCommit ctrlMapAnimDone ctrlMapCursor ctrlMapMouseOver ctrlMapScale ctrlMapScreenToWorld ctrlMapWorldToScreen ctrlModel ctrlModelDirAndUp ctrlModelScale ctrlParent ctrlParentControlsGroup ctrlPosition ctrlRemoveAllEventHandlers ctrlRemoveEventHandler ctrlScale ctrlSetActiveColor ctrlSetAngle ctrlSetAutoScrollDelay ctrlSetAutoScrollRewind ctrlSetAutoScrollSpeed ctrlSetBackgroundColor ctrlSetChecked ctrlSetEventHandler ctrlSetFade ctrlSetFocus ctrlSetFont ctrlSetFontH1 ctrlSetFontH1B ctrlSetFontH2 ctrlSetFontH2B ctrlSetFontH3 ctrlSetFontH3B ctrlSetFontH4 ctrlSetFontH4B ctrlSetFontH5 ctrlSetFontH5B ctrlSetFontH6 ctrlSetFontH6B ctrlSetFontHeight ctrlSetFontHeightH1 ctrlSetFontHeightH2 ctrlSetFontHeightH3 ctrlSetFontHeightH4 ctrlSetFontHeightH5 ctrlSetFontHeightH6 ctrlSetFontHeightSecondary ctrlSetFontP ctrlSetFontPB ctrlSetFontSecondary ctrlSetForegroundColor ctrlSetModel ctrlSetModelDirAndUp ctrlSetModelScale ctrlSetPixelPrecision ctrlSetPosition ctrlSetScale ctrlSetStructuredText ctrlSetText ctrlSetTextColor ctrlSetTooltip ctrlSetTooltipColorBox ctrlSetTooltipColorShade ctrlSetTooltipColorText ctrlShow ctrlShown ctrlText ctrlTextHeight ctrlTextWidth ctrlType ctrlVisible ctRowControls ctRowCount ctSetCurSel ctSetData ctSetHeaderTemplate ctSetRowTemplate ctSetValue ctValue curatorAddons curatorCamera curatorCameraArea curatorCameraAreaCeiling curatorCoef curatorEditableObjects curatorEditingArea curatorEditingAreaType curatorMouseOver curatorPoints curatorRegisteredObjects curatorSelected curatorWaypointCost current3DENOperation currentChannel currentCommand currentMagazine currentMagazineDetail currentMagazineDetailTurret currentMagazineTurret currentMuzzle currentNamespace currentTask currentTasks currentThrowable currentVisionMode currentWaypoint currentWeapon currentWeaponMode currentWeaponTurret currentZeroing cursorObject cursorTarget customChat customRadio cutFadeOut cutObj cutRsc cutText damage date dateToNumber daytime deActivateKey debriefingText debugFSM debugLog deg delete3DENEntities deleteAt deleteCenter deleteCollection deleteEditorObject deleteGroup deleteGroupWhenEmpty deleteIdentity deleteLocation deleteMarker deleteMarkerLocal deleteRange deleteResources deleteSite deleteStatus deleteTeam deleteVehicle deleteVehicleCrew deleteWaypoint detach detectedMines diag_activeMissionFSMs diag_activeScripts diag_activeSQFScripts diag_activeSQSScripts diag_captureFrame diag_captureFrameToFile diag_captureSlowFrame diag_codePerformance diag_drawMode diag_enable diag_enabled diag_fps diag_fpsMin diag_frameNo diag_lightNewLoad diag_list diag_log diag_logSlowFrame diag_mergeConfigFile diag_recordTurretLimits diag_setLightNew diag_tickTime diag_toggle dialog diarySubjectExists didJIP didJIPOwner difficulty difficultyEnabled difficultyEnabledRTD difficultyOption direction directSay disableAI disableCollisionWith disableConversation disableDebriefingStats disableMapIndicators disableNVGEquipment disableRemoteSensors disableSerialization disableTIEquipment disableUAVConnectability disableUserInput displayAddEventHandler displayCtrl displayParent displayRemoveAllEventHandlers displayRemoveEventHandler displaySetEventHandler dissolveTeam distance distance2D distanceSqr distributionRegion do3DENAction doArtilleryFire doFire doFollow doFSM doGetOut doMove doorPhase doStop doSuppressiveFire doTarget doWatch drawArrow drawEllipse drawIcon drawIcon3D drawLine drawLine3D drawLink drawLocation drawPolygon drawRectangle drawTriangle driver drop dynamicSimulationDistance dynamicSimulationDistanceCoef dynamicSimulationEnabled dynamicSimulationSystemEnabled echo edit3DENMissionAttributes editObject editorSetEventHandler effectiveCommander emptyPositions enableAI enableAIFeature enableAimPrecision enableAttack enableAudioFeature enableAutoStartUpRTD enableAutoTrimRTD enableCamShake enableCaustics enableChannel enableCollisionWith enableCopilot enableDebriefingStats enableDiagLegend enableDynamicSimulation enableDynamicSimulationSystem enableEndDialog enableEngineArtillery enableEnvironment enableFatigue enableGunLights enableInfoPanelComponent enableIRLasers enableMimics enablePersonTurret enableRadio enableReload enableRopeAttach enableSatNormalOnDetail enableSaving enableSentences enableSimulation enableSimulationGlobal enableStamina enableTeamSwitch enableTraffic enableUAVConnectability enableUAVWaypoints enableVehicleCargo enableVehicleSensor enableWeaponDisassembly endLoadingScreen endMission engineOn enginesIsOnRTD enginesRpmRTD enginesTorqueRTD entities environmentEnabled estimatedEndServerTime estimatedTimeLeft evalObjectArgument everyBackpack everyContainer exec execEditorScript execFSM execVM exp expectedDestination exportJIPMessages eyeDirection eyePos face faction fadeMusic fadeRadio fadeSound fadeSpeech failMission fillWeaponsFromPool find findCover findDisplay findEditorObject findEmptyPosition findEmptyPositionReady findIf findNearestEnemy finishMissionInit finite fire fireAtTarget firstBackpack flag flagAnimationPhase flagOwner flagSide flagTexture fleeing floor flyInHeight flyInHeightASL fog fogForecast fogParams forceAddUniform forcedMap forceEnd forceFlagTexture forceFollowRoad forceMap forceRespawn forceSpeed forceWalk forceWeaponFire forceWeatherChange forEachMember forEachMemberAgent forEachMemberTeam forgetTarget format formation formationDirection formationLeader formationMembers formationPosition formationTask formatText formLeader freeLook fromEditor fuel fullCrew gearIDCAmmoCount gearSlotAmmoCount gearSlotData get3DENActionState get3DENAttribute get3DENCamera get3DENConnections get3DENEntity get3DENEntityID get3DENGrid get3DENIconsVisible get3DENLayerEntities get3DENLinesVisible get3DENMissionAttribute get3DENMouseOver get3DENSelected getAimingCoef getAllEnvSoundControllers getAllHitPointsDamage getAllOwnedMines getAllSoundControllers getAmmoCargo getAnimAimPrecision getAnimSpeedCoef getArray getArtilleryAmmo getArtilleryComputerSettings getArtilleryETA getAssignedCuratorLogic getAssignedCuratorUnit getBackpackCargo getBleedingRemaining getBurningValue getCameraViewDirection getCargoIndex getCenterOfMass getClientState getClientStateNumber getCompatiblePylonMagazines getConnectedUAV getContainerMaxLoad getCursorObjectParams getCustomAimCoef getDammage getDescription getDir getDirVisual getDLCAssetsUsage getDLCAssetsUsageByName getDLCs getEditorCamera getEditorMode getEditorObjectScope getElevationOffset getEnvSoundController getFatigue getForcedFlagTexture getFriend getFSMVariable getFuelCargo getGroupIcon getGroupIconParams getGroupIcons getHideFrom getHit getHitIndex getHitPointDamage getItemCargo getMagazineCargo getMarkerColor getMarkerPos getMarkerSize getMarkerType getMass getMissionConfig getMissionConfigValue getMissionDLCs getMissionLayerEntities getModelInfo getMousePosition getMusicPlayedTime getNumber getObjectArgument getObjectChildren getObjectDLC getObjectMaterials getObjectProxy getObjectTextures getObjectType getObjectViewDistance getOxygenRemaining getPersonUsedDLCs getPilotCameraDirection getPilotCameraPosition getPilotCameraRotation getPilotCameraTarget getPlateNumber getPlayerChannel getPlayerScores getPlayerUID getPos getPosASL getPosASLVisual getPosASLW getPosATL getPosATLVisual getPosVisual getPosWorld getPylonMagazines getRelDir getRelPos getRemoteSensorsDisabled getRepairCargo getResolution getShadowDistance getShotParents getSlingLoad getSoundController getSoundControllerResult getSpeed getStamina getStatValue getSuppression getTerrainGrid getTerrainHeightASL getText getTotalDLCUsageTime getUnitLoadout getUnitTrait getUserMFDText getUserMFDvalue getVariable getVehicleCargo getWeaponCargo getWeaponSway getWingsOrientationRTD getWingsPositionRTD getWPPos glanceAt globalChat globalRadio goggles goto group groupChat groupFromNetId groupIconSelectable groupIconsVisible groupId groupOwner groupRadio groupSelectedUnits groupSelectUnit gunner gusts halt handgunItems handgunMagazine handgunWeapon handsHit hasInterface hasPilotCamera hasWeapon hcAllGroups hcGroupParams hcLeader hcRemoveAllGroups hcRemoveGroup hcSelected hcSelectGroup hcSetGroup hcShowBar hcShownBar headgear hideBody hideObject hideObjectGlobal hideSelection hint hintC hintCadet hintSilent hmd hostMission htmlLoad HUDMovementLevels humidity image importAllGroups importance in inArea inAreaArray incapacitatedState inflame inflamed infoPanel infoPanelComponentEnabled infoPanelComponents infoPanels inGameUISetEventHandler inheritsFrom initAmbientLife inPolygon inputAction inRangeOfArtillery insertEditorObject intersect is3DEN is3DENMultiplayer isAbleToBreathe isAgent isArray isAutoHoverOn isAutonomous isAutotest isBleeding isBurning isClass isCollisionLightOn isCopilotEnabled isDamageAllowed isDedicated isDLCAvailable isEngineOn isEqualTo isEqualType isEqualTypeAll isEqualTypeAny isEqualTypeArray isEqualTypeParams isFilePatchingEnabled isFlashlightOn isFlatEmpty isForcedWalk isFormationLeader isGroupDeletedWhenEmpty isHidden isInRemainsCollector isInstructorFigureEnabled isIRLaserOn isKeyActive isKindOf isLaserOn isLightOn isLocalized isManualFire isMarkedForCollection isMultiplayer isMultiplayerSolo isNil isNull isNumber isObjectHidden isObjectRTD isOnRoad isPipEnabled isPlayer isRealTime isRemoteExecuted isRemoteExecutedJIP isServer isShowing3DIcons isSimpleObject isSprintAllowed isStaminaEnabled isSteamMission isStreamFriendlyUIEnabled isText isTouchingGround isTurnedOut isTutHintsEnabled isUAVConnectable isUAVConnected isUIContext isUniformAllowed isVehicleCargo isVehicleRadarOn isVehicleSensorEnabled isWalking isWeaponDeployed isWeaponRested itemCargo items itemsWithMagazines join joinAs joinAsSilent joinSilent joinString kbAddDatabase kbAddDatabaseTargets kbAddTopic kbHasTopic kbReact kbRemoveTopic kbTell kbWasSaid keyImage keyName knowsAbout land landAt landResult language laserTarget lbAdd lbClear lbColor lbColorRight lbCurSel lbData lbDelete lbIsSelected lbPicture lbPictureRight lbSelection lbSetColor lbSetColorRight lbSetCurSel lbSetData lbSetPicture lbSetPictureColor lbSetPictureColorDisabled lbSetPictureColorSelected lbSetPictureRight lbSetPictureRightColor lbSetPictureRightColorDisabled lbSetPictureRightColorSelected lbSetSelectColor lbSetSelectColorRight lbSetSelected lbSetText lbSetTextRight lbSetTooltip lbSetValue lbSize lbSort lbSortByValue lbText lbTextRight lbValue leader leaderboardDeInit leaderboardGetRows leaderboardInit leaderboardRequestRowsFriends leaderboardsRequestUploadScore leaderboardsRequestUploadScoreKeepBest leaderboardState leaveVehicle libraryCredits libraryDisclaimers lifeState lightAttachObject lightDetachObject lightIsOn lightnings limitSpeed linearConversion lineIntersects lineIntersectsObjs lineIntersectsSurfaces lineIntersectsWith linkItem list listObjects listRemoteTargets listVehicleSensors ln lnbAddArray lnbAddColumn lnbAddRow lnbClear lnbColor lnbCurSelRow lnbData lnbDeleteColumn lnbDeleteRow lnbGetColumnsPosition lnbPicture lnbSetColor lnbSetColumnsPos lnbSetCurSelRow lnbSetData lnbSetPicture lnbSetText lnbSetValue lnbSize lnbSort lnbSortByValue lnbText lnbValue load loadAbs loadBackpack loadFile loadGame loadIdentity loadMagazine loadOverlay loadStatus loadUniform loadVest local localize locationPosition lock lockCameraTo lockCargo lockDriver locked lockedCargo lockedDriver lockedTurret lockIdentity lockTurret lockWP log logEntities logNetwork logNetworkTerminate lookAt lookAtPos magazineCargo magazines magazinesAllTurrets magazinesAmmo magazinesAmmoCargo magazinesAmmoFull magazinesDetail magazinesDetailBackpack magazinesDetailUniform magazinesDetailVest magazinesTurret magazineTurretAmmo mapAnimAdd mapAnimClear mapAnimCommit mapAnimDone mapCenterOnCamera mapGridPosition markAsFinishedOnSteam markerAlpha markerBrush markerColor markerDir markerPos markerShape markerSize markerText markerType max members menuAction menuAdd menuChecked menuClear menuCollapse menuData menuDelete menuEnable menuEnabled menuExpand menuHover menuPicture menuSetAction menuSetCheck menuSetData menuSetPicture menuSetValue menuShortcut menuShortcutText menuSize menuSort menuText menuURL menuValue min mineActive mineDetectedBy missionConfigFile missionDifficulty missionName missionNamespace missionStart missionVersion mod modelToWorld modelToWorldVisual modelToWorldVisualWorld modelToWorldWorld modParams moonIntensity moonPhase morale move move3DENCamera moveInAny moveInCargo moveInCommander moveInDriver moveInGunner moveInTurret moveObjectToEnd moveOut moveTime moveTo moveToCompleted moveToFailed musicVolume name nameSound nearEntities nearestBuilding nearestLocation nearestLocations nearestLocationWithDubbing nearestObject nearestObjects nearestTerrainObjects nearObjects nearObjectsReady nearRoads nearSupplies nearTargets needReload netId netObjNull newOverlay nextMenuItemIndex nextWeatherChange nMenuItems not numberOfEnginesRTD numberToDate objectCurators objectFromNetId objectParent objStatus onBriefingGroup onBriefingNotes onBriefingPlan onBriefingTeamSwitch onCommandModeChanged onDoubleClick onEachFrame onGroupIconClick onGroupIconOverEnter onGroupIconOverLeave onHCGroupSelectionChanged onMapSingleClick onPlayerConnected onPlayerDisconnected onPreloadFinished onPreloadStarted onShowNewObject onTeamSwitch openCuratorInterface openDLCPage openMap openSteamApp openYoutubeVideo or orderGetIn overcast overcastForecast owner param params parseNumber parseSimpleArray parseText parsingNamespace particlesQuality pickWeaponPool pitch pixelGrid pixelGridBase pixelGridNoUIScale pixelH pixelW playableSlotsNumber playableUnits playAction playActionNow player playerRespawnTime playerSide playersNumber playGesture playMission playMove playMoveNow playMusic playScriptedMission playSound playSound3D position positionCameraToWorld posScreenToWorld posWorldToScreen ppEffectAdjust ppEffectCommit ppEffectCommitted ppEffectCreate ppEffectDestroy ppEffectEnable ppEffectEnabled ppEffectForceInNVG precision preloadCamera preloadObject preloadSound preloadTitleObj preloadTitleRsc preprocessFile preprocessFileLineNumbers primaryWeapon primaryWeaponItems primaryWeaponMagazine priority processDiaryLink productVersion profileName profileNamespace profileNameSteam progressLoadingScreen progressPosition progressSetPosition publicVariable publicVariableClient publicVariableServer pushBack pushBackUnique putWeaponPool queryItemsPool queryMagazinePool queryWeaponPool rad radioChannelAdd radioChannelCreate radioChannelRemove radioChannelSetCallSign radioChannelSetLabel radioVolume rain rainbow random rank rankId rating rectangular registeredTasks registerTask reload reloadEnabled remoteControl remoteExec remoteExecCall remoteExecutedOwner remove3DENConnection remove3DENEventHandler remove3DENLayer removeAction removeAll3DENEventHandlers removeAllActions removeAllAssignedItems removeAllContainers removeAllCuratorAddons removeAllCuratorCameraAreas removeAllCuratorEditingAreas removeAllEventHandlers removeAllHandgunItems removeAllItems removeAllItemsWithMagazines removeAllMissionEventHandlers removeAllMPEventHandlers removeAllMusicEventHandlers removeAllOwnedMines removeAllPrimaryWeaponItems removeAllWeapons removeBackpack removeBackpackGlobal removeCuratorAddons removeCuratorCameraArea removeCuratorEditableObjects removeCuratorEditingArea removeDrawIcon removeDrawLinks removeEventHandler removeFromRemainsCollector removeGoggles removeGroupIcon removeHandgunItem removeHeadgear removeItem removeItemFromBackpack removeItemFromUniform removeItemFromVest removeItems removeMagazine removeMagazineGlobal removeMagazines removeMagazinesTurret removeMagazineTurret removeMenuItem removeMissionEventHandler removeMPEventHandler removeMusicEventHandler removeOwnedMine removePrimaryWeaponItem removeSecondaryWeaponItem removeSimpleTask removeSwitchableUnit removeTeamMember removeUniform removeVest removeWeapon removeWeaponAttachmentCargo removeWeaponCargo removeWeaponGlobal removeWeaponTurret reportRemoteTarget requiredVersion resetCamShake resetSubgroupDirection resize resources respawnVehicle restartEditorCamera reveal revealMine reverse reversedMouseY roadAt roadsConnectedTo roleDescription ropeAttachedObjects ropeAttachedTo ropeAttachEnabled ropeAttachTo ropeCreate ropeCut ropeDestroy ropeDetach ropeEndPosition ropeLength ropes ropeUnwind ropeUnwound rotorsForcesRTD rotorsRpmRTD round runInitScript safeZoneH safeZoneW safeZoneWAbs safeZoneX safeZoneXAbs safeZoneY save3DENInventory saveGame saveIdentity saveJoysticks saveOverlay saveProfileNamespace saveStatus saveVar savingEnabled say say2D say3D scopeName score scoreSide screenshot screenToWorld scriptDone scriptName scudState secondaryWeapon secondaryWeaponItems secondaryWeaponMagazine select selectBestPlaces selectDiarySubject selectedEditorObjects selectEditorObject selectionNames selectionPosition selectLeader selectMax selectMin selectNoPlayer selectPlayer selectRandom selectRandomWeighted selectWeapon selectWeaponTurret sendAUMessage sendSimpleCommand sendTask sendTaskResult sendUDPMessage serverCommand serverCommandAvailable serverCommandExecutable serverName serverTime set set3DENAttribute set3DENAttributes set3DENGrid set3DENIconsVisible set3DENLayer set3DENLinesVisible set3DENLogicType set3DENMissionAttribute set3DENMissionAttributes set3DENModelsVisible set3DENObjectType set3DENSelected setAccTime setActualCollectiveRTD setAirplaneThrottle setAirportSide setAmmo setAmmoCargo setAmmoOnPylon setAnimSpeedCoef setAperture setApertureNew setArmoryPoints setAttributes setAutonomous setBehaviour setBleedingRemaining setBrakesRTD setCameraInterest setCamShakeDefParams setCamShakeParams setCamUseTI setCaptive setCenterOfMass setCollisionLight setCombatMode setCompassOscillation setConvoySeparation setCuratorCameraAreaCeiling setCuratorCoef setCuratorEditingAreaType setCuratorWaypointCost setCurrentChannel setCurrentTask setCurrentWaypoint setCustomAimCoef setCustomWeightRTD setDamage setDammage setDate setDebriefingText setDefaultCamera setDestination setDetailMapBlendPars setDir setDirection setDrawIcon setDriveOnPath setDropInterval setDynamicSimulationDistance setDynamicSimulationDistanceCoef setEditorMode setEditorObjectScope setEffectCondition setEngineRPMRTD setFace setFaceAnimation setFatigue setFeatureType setFlagAnimationPhase setFlagOwner setFlagSide setFlagTexture setFog setFormation setFormationTask setFormDir setFriend setFromEditor setFSMVariable setFuel setFuelCargo setGroupIcon setGroupIconParams setGroupIconsSelectable setGroupIconsVisible setGroupId setGroupIdGlobal setGroupOwner setGusts setHideBehind setHit setHitIndex setHitPointDamage setHorizonParallaxCoef setHUDMovementLevels setIdentity setImportance setInfoPanel setLeader setLightAmbient setLightAttenuation setLightBrightness setLightColor setLightDayLight setLightFlareMaxDistance setLightFlareSize setLightIntensity setLightnings setLightUseFlare setLocalWindParams setMagazineTurretAmmo setMarkerAlpha setMarkerAlphaLocal setMarkerBrush setMarkerBrushLocal setMarkerColor setMarkerColorLocal setMarkerDir setMarkerDirLocal setMarkerPos setMarkerPosLocal setMarkerShape setMarkerShapeLocal setMarkerSize setMarkerSizeLocal setMarkerText setMarkerTextLocal setMarkerType setMarkerTypeLocal setMass setMimic setMousePosition setMusicEffect setMusicEventHandler setName setNameSound setObjectArguments setObjectMaterial setObjectMaterialGlobal setObjectProxy setObjectTexture setObjectTextureGlobal setObjectViewDistance setOvercast setOwner setOxygenRemaining setParticleCircle setParticleClass setParticleFire setParticleParams setParticleRandom setPilotCameraDirection setPilotCameraRotation setPilotCameraTarget setPilotLight setPiPEffect setPitch setPlateNumber setPlayable setPlayerRespawnTime setPos setPosASL setPosASL2 setPosASLW setPosATL setPosition setPosWorld setPylonLoadOut setPylonsPriority setRadioMsg setRain setRainbow setRandomLip setRank setRectangular setRepairCargo setRotorBrakeRTD setShadowDistance setShotParents setSide setSimpleTaskAlwaysVisible setSimpleTaskCustomData setSimpleTaskDescription setSimpleTaskDestination setSimpleTaskTarget setSimpleTaskType setSimulWeatherLayers setSize setSkill setSlingLoad setSoundEffect setSpeaker setSpeech setSpeedMode setStamina setStaminaScheme setStatValue setSuppression setSystemOfUnits setTargetAge setTaskMarkerOffset setTaskResult setTaskState setTerrainGrid setText setTimeMultiplier setTitleEffect setTrafficDensity setTrafficDistance setTrafficGap setTrafficSpeed setTriggerActivation setTriggerArea setTriggerStatements setTriggerText setTriggerTimeout setTriggerType setType setUnconscious setUnitAbility setUnitLoadout setUnitPos setUnitPosWeak setUnitRank setUnitRecoilCoefficient setUnitTrait setUnloadInCombat setUserActionText setUserMFDText setUserMFDvalue setVariable setVectorDir setVectorDirAndUp setVectorUp setVehicleAmmo setVehicleAmmoDef setVehicleArmor setVehicleCargo setVehicleId setVehicleLock setVehiclePosition setVehicleRadar setVehicleReceiveRemoteTargets setVehicleReportOwnPosition setVehicleReportRemoteTargets setVehicleTIPars setVehicleVarName setVelocity setVelocityModelSpace setVelocityTransformation setViewDistance setVisibleIfTreeCollapsed setWantedRPMRTD setWaves setWaypointBehaviour setWaypointCombatMode setWaypointCompletionRadius setWaypointDescription setWaypointForceBehaviour setWaypointFormation setWaypointHousePosition setWaypointLoiterRadius setWaypointLoiterType setWaypointName setWaypointPosition setWaypointScript setWaypointSpeed setWaypointStatements setWaypointTimeout setWaypointType setWaypointVisible setWeaponReloadingTime setWind setWindDir setWindForce setWindStr setWingForceScaleRTD setWPPos show3DIcons showChat showCinemaBorder showCommandingMenu showCompass showCuratorCompass showGPS showHUD showLegend showMap shownArtilleryComputer shownChat shownCompass shownCuratorCompass showNewEditorObject shownGPS shownHUD shownMap shownPad shownRadio shownScoretable shownUAVFeed shownWarrant shownWatch showPad showRadio showScoretable showSubtitles showUAVFeed showWarrant showWatch showWaypoint showWaypoints side sideChat sideEnemy sideFriendly sideRadio simpleTasks simulationEnabled simulCloudDensity simulCloudOcclusion simulInClouds simulWeatherSync sin size sizeOf skill skillFinal skipTime sleep sliderPosition sliderRange sliderSetPosition sliderSetRange sliderSetSpeed sliderSpeed slingLoadAssistantShown soldierMagazines someAmmo sort soundVolume spawn speaker speed speedMode splitString sqrt squadParams stance startLoadingScreen step stop stopEngineRTD stopped str sunOrMoon supportInfo suppressFor surfaceIsWater surfaceNormal surfaceType swimInDepth switchableUnits switchAction switchCamera switchGesture switchLight switchMove synchronizedObjects synchronizedTriggers synchronizedWaypoints synchronizeObjectsAdd synchronizeObjectsRemove synchronizeTrigger synchronizeWaypoint systemChat systemOfUnits tan targetKnowledge targets targetsAggregate targetsQuery taskAlwaysVisible taskChildren taskCompleted taskCustomData taskDescription taskDestination taskHint taskMarkerOffset taskParent taskResult taskState taskType teamMember teamName teams teamSwitch teamSwitchEnabled teamType terminate terrainIntersect terrainIntersectASL terrainIntersectAtASL text textLog textLogFormat tg time timeMultiplier titleCut titleFadeOut titleObj titleRsc titleText toArray toFixed toLower toString toUpper triggerActivated triggerActivation triggerArea triggerAttachedVehicle triggerAttachObject triggerAttachVehicle triggerDynamicSimulation triggerStatements triggerText triggerTimeout triggerTimeoutCurrent triggerType turretLocal turretOwner turretUnit tvAdd tvClear tvCollapse tvCollapseAll tvCount tvCurSel tvData tvDelete tvExpand tvExpandAll tvPicture tvSetColor tvSetCurSel tvSetData tvSetPicture tvSetPictureColor tvSetPictureColorDisabled tvSetPictureColorSelected tvSetPictureRight tvSetPictureRightColor tvSetPictureRightColorDisabled tvSetPictureRightColorSelected tvSetText tvSetTooltip tvSetValue tvSort tvSortByValue tvText tvTooltip tvValue type typeName typeOf UAVControl uiNamespace uiSleep unassignCurator unassignItem unassignTeam unassignVehicle underwater uniform uniformContainer uniformItems uniformMagazines unitAddons unitAimPosition unitAimPositionVisual unitBackpack unitIsUAV unitPos unitReady unitRecoilCoefficient units unitsBelowHeight unlinkItem unlockAchievement unregisterTask updateDrawIcon updateMenuItem updateObjectTree useAISteeringComponent useAudioTimeForMoves userInputDisabled vectorAdd vectorCos vectorCrossProduct vectorDiff vectorDir vectorDirVisual vectorDistance vectorDistanceSqr vectorDotProduct vectorFromTo vectorMagnitude vectorMagnitudeSqr vectorModelToWorld vectorModelToWorldVisual vectorMultiply vectorNormalized vectorUp vectorUpVisual vectorWorldToModel vectorWorldToModelVisual vehicle vehicleCargoEnabled vehicleChat vehicleRadio vehicleReceiveRemoteTargets vehicleReportOwnPosition vehicleReportRemoteTargets vehicles vehicleVarName velocity velocityModelSpace verifySignature vest vestContainer vestItems vestMagazines viewDistance visibleCompass visibleGPS visibleMap visiblePosition visiblePositionASL visibleScoretable visibleWatch waves waypointAttachedObject waypointAttachedVehicle waypointAttachObject waypointAttachVehicle waypointBehaviour waypointCombatMode waypointCompletionRadius waypointDescription waypointForceBehaviour waypointFormation waypointHousePosition waypointLoiterRadius waypointLoiterType waypointName waypointPosition waypoints waypointScript waypointsEnabledUAV waypointShow waypointSpeed waypointStatements waypointTimeout waypointTimeoutCurrent waypointType waypointVisible weaponAccessories weaponAccessoriesCargo weaponCargo weaponDirection weaponInertia weaponLowered weapons weaponsItems weaponsItemsCargo weaponState weaponsTurret weightRTD WFSideText wind ",literal:"blufor civilian configNull controlNull displayNull east endl false grpNull independent lineBreak locationNull nil objNull opfor pi resistance scriptNull sideAmbientLife sideEmpty sideLogic sideUnknown taskNull teamMemberNull true west"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.NUMBER_MODE,e,n,r,s],illegal:/#|^\$ /}}opn.exports=pos});var lpn=ee((iPa,cpn)=>{p();function hos(t){var e=t.COMMENT("--","$");return{name:"SQL (more)",aliases:["mysql","oracle"],disableAutodetect:!0,case_insensitive:!0,illegal:/[<>{}*]/,contains:[{beginKeywords:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment values with",end:/;/,endsWithParent:!0,keywords:{$pattern:/[\w\.]+/,keyword:"as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias all allocate allow alter always analyze ancillary and anti any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound bucket buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain explode export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force foreign form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour hours http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lateral lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minutes minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notnull notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second seconds section securefile security seed segment select self semi sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tablesample tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unnest unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace window with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null unknown",built_in:"array bigint binary bit blob bool boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text time timestamp tinyint varchar varchar2 varying void"},contains:[{className:"string",begin:"'",end:"'",contains:[{begin:"''"}]},{className:"string",begin:'"',end:'"',contains:[{begin:'""'}]},{className:"string",begin:"`",end:"`"},t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,e,t.HASH_COMMENT_MODE]},t.C_BLOCK_COMMENT_MODE,e,t.HASH_COMMENT_MODE]}}cpn.exports=hos});var ppn=ee((aPa,dpn)=>{p();function upn(t){return t?typeof t=="string"?t:t.source:null}function mos(...t){return t.map(n=>upn(n)).join("")}function _ze(...t){return"("+t.map(n=>upn(n)).join("|")+")"}function fos(t){let e=t.COMMENT("--","$"),n={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},r={begin:/"/,end:/"/,contains:[{begin:/""/}]},s=["true","false","unknown"],i=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],a=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update ","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],l=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],d=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=u,m=[...c,...a].filter(b=>!u.includes(b)),f={className:"variable",begin:/@[a-z0-9]+/},g={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={begin:mos(/\b/,_ze(...h),/\s*\(/),keywords:{built_in:h}};function y(b,{exceptions:S,when:C}={}){let I=C;return S=S||[],b.map(x=>x.match(/\|\d+$/)||S.includes(x)?x:I(x)?`${x}|0`:x)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:y(m,{when:b=>b.length<3}),literal:s,type:o,built_in:l},contains:[{begin:_ze(...d),keywords:{$pattern:/[\w\.]+/,keyword:m.concat(d),literal:s,type:o}},{className:"type",begin:_ze(...i)},A,f,n,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,e,g]}}dpn.exports=fos});var mpn=ee((lPa,hpn)=>{p();function gos(t){let e=["functions","model","data","parameters","quantities","transformed","generated"],n=["for","in","if","else","while","break","continue","return"],r=["print","reject","increment_log_prob|10","integrate_ode|10","integrate_ode_rk45|10","integrate_ode_bdf|10","algebra_solver"],s=["int","real","vector","ordered","positive_ordered","simplex","unit_vector","row_vector","matrix","cholesky_factor_corr|10","cholesky_factor_cov|10","corr_matrix|10","cov_matrix|10","void"],i=["Phi","Phi_approx","abs","acos","acosh","algebra_solver","append_array","append_col","append_row","asin","asinh","atan","atan2","atanh","bernoulli_cdf","bernoulli_lccdf","bernoulli_lcdf","bernoulli_logit_lpmf","bernoulli_logit_rng","bernoulli_lpmf","bernoulli_rng","bessel_first_kind","bessel_second_kind","beta_binomial_cdf","beta_binomial_lccdf","beta_binomial_lcdf","beta_binomial_lpmf","beta_binomial_rng","beta_cdf","beta_lccdf","beta_lcdf","beta_lpdf","beta_rng","binary_log_loss","binomial_cdf","binomial_coefficient_log","binomial_lccdf","binomial_lcdf","binomial_logit_lpmf","binomial_lpmf","binomial_rng","block","categorical_logit_lpmf","categorical_logit_rng","categorical_lpmf","categorical_rng","cauchy_cdf","cauchy_lccdf","cauchy_lcdf","cauchy_lpdf","cauchy_rng","cbrt","ceil","chi_square_cdf","chi_square_lccdf","chi_square_lcdf","chi_square_lpdf","chi_square_rng","cholesky_decompose","choose","col","cols","columns_dot_product","columns_dot_self","cos","cosh","cov_exp_quad","crossprod","csr_extract_u","csr_extract_v","csr_extract_w","csr_matrix_times_vector","csr_to_dense_matrix","cumulative_sum","determinant","diag_matrix","diag_post_multiply","diag_pre_multiply","diagonal","digamma","dims","dirichlet_lpdf","dirichlet_rng","distance","dot_product","dot_self","double_exponential_cdf","double_exponential_lccdf","double_exponential_lcdf","double_exponential_lpdf","double_exponential_rng","e","eigenvalues_sym","eigenvectors_sym","erf","erfc","exp","exp2","exp_mod_normal_cdf","exp_mod_normal_lccdf","exp_mod_normal_lcdf","exp_mod_normal_lpdf","exp_mod_normal_rng","expm1","exponential_cdf","exponential_lccdf","exponential_lcdf","exponential_lpdf","exponential_rng","fabs","falling_factorial","fdim","floor","fma","fmax","fmin","fmod","frechet_cdf","frechet_lccdf","frechet_lcdf","frechet_lpdf","frechet_rng","gamma_cdf","gamma_lccdf","gamma_lcdf","gamma_lpdf","gamma_p","gamma_q","gamma_rng","gaussian_dlm_obs_lpdf","get_lp","gumbel_cdf","gumbel_lccdf","gumbel_lcdf","gumbel_lpdf","gumbel_rng","head","hypergeometric_lpmf","hypergeometric_rng","hypot","inc_beta","int_step","integrate_ode","integrate_ode_bdf","integrate_ode_rk45","inv","inv_Phi","inv_chi_square_cdf","inv_chi_square_lccdf","inv_chi_square_lcdf","inv_chi_square_lpdf","inv_chi_square_rng","inv_cloglog","inv_gamma_cdf","inv_gamma_lccdf","inv_gamma_lcdf","inv_gamma_lpdf","inv_gamma_rng","inv_logit","inv_sqrt","inv_square","inv_wishart_lpdf","inv_wishart_rng","inverse","inverse_spd","is_inf","is_nan","lbeta","lchoose","lgamma","lkj_corr_cholesky_lpdf","lkj_corr_cholesky_rng","lkj_corr_lpdf","lkj_corr_rng","lmgamma","lmultiply","log","log10","log1m","log1m_exp","log1m_inv_logit","log1p","log1p_exp","log2","log_determinant","log_diff_exp","log_falling_factorial","log_inv_logit","log_mix","log_rising_factorial","log_softmax","log_sum_exp","logistic_cdf","logistic_lccdf","logistic_lcdf","logistic_lpdf","logistic_rng","logit","lognormal_cdf","lognormal_lccdf","lognormal_lcdf","lognormal_lpdf","lognormal_rng","machine_precision","matrix_exp","max","mdivide_left_spd","mdivide_left_tri_low","mdivide_right_spd","mdivide_right_tri_low","mean","min","modified_bessel_first_kind","modified_bessel_second_kind","multi_gp_cholesky_lpdf","multi_gp_lpdf","multi_normal_cholesky_lpdf","multi_normal_cholesky_rng","multi_normal_lpdf","multi_normal_prec_lpdf","multi_normal_rng","multi_student_t_lpdf","multi_student_t_rng","multinomial_lpmf","multinomial_rng","multiply_log","multiply_lower_tri_self_transpose","neg_binomial_2_cdf","neg_binomial_2_lccdf","neg_binomial_2_lcdf","neg_binomial_2_log_lpmf","neg_binomial_2_log_rng","neg_binomial_2_lpmf","neg_binomial_2_rng","neg_binomial_cdf","neg_binomial_lccdf","neg_binomial_lcdf","neg_binomial_lpmf","neg_binomial_rng","negative_infinity","normal_cdf","normal_lccdf","normal_lcdf","normal_lpdf","normal_rng","not_a_number","num_elements","ordered_logistic_lpmf","ordered_logistic_rng","owens_t","pareto_cdf","pareto_lccdf","pareto_lcdf","pareto_lpdf","pareto_rng","pareto_type_2_cdf","pareto_type_2_lccdf","pareto_type_2_lcdf","pareto_type_2_lpdf","pareto_type_2_rng","pi","poisson_cdf","poisson_lccdf","poisson_lcdf","poisson_log_lpmf","poisson_log_rng","poisson_lpmf","poisson_rng","positive_infinity","pow","print","prod","qr_Q","qr_R","quad_form","quad_form_diag","quad_form_sym","rank","rayleigh_cdf","rayleigh_lccdf","rayleigh_lcdf","rayleigh_lpdf","rayleigh_rng","reject","rep_array","rep_matrix","rep_row_vector","rep_vector","rising_factorial","round","row","rows","rows_dot_product","rows_dot_self","scaled_inv_chi_square_cdf","scaled_inv_chi_square_lccdf","scaled_inv_chi_square_lcdf","scaled_inv_chi_square_lpdf","scaled_inv_chi_square_rng","sd","segment","sin","singular_values","sinh","size","skew_normal_cdf","skew_normal_lccdf","skew_normal_lcdf","skew_normal_lpdf","skew_normal_rng","softmax","sort_asc","sort_desc","sort_indices_asc","sort_indices_desc","sqrt","sqrt2","square","squared_distance","step","student_t_cdf","student_t_lccdf","student_t_lcdf","student_t_lpdf","student_t_rng","sub_col","sub_row","sum","tail","tan","tanh","target","tcrossprod","tgamma","to_array_1d","to_array_2d","to_matrix","to_row_vector","to_vector","trace","trace_gen_quad_form","trace_quad_form","trigamma","trunc","uniform_cdf","uniform_lccdf","uniform_lcdf","uniform_lpdf","uniform_rng","variance","von_mises_lpdf","von_mises_rng","weibull_cdf","weibull_lccdf","weibull_lcdf","weibull_lpdf","weibull_rng","wiener_lpdf","wishart_lpdf","wishart_rng"],o=["bernoulli","bernoulli_logit","beta","beta_binomial","binomial","binomial_logit","categorical","categorical_logit","cauchy","chi_square","dirichlet","double_exponential","exp_mod_normal","exponential","frechet","gamma","gaussian_dlm_obs","gumbel","hypergeometric","inv_chi_square","inv_gamma","inv_wishart","lkj_corr","lkj_corr_cholesky","logistic","lognormal","multi_gp","multi_gp_cholesky","multi_normal","multi_normal_cholesky","multi_normal_prec","multi_student_t","multinomial","neg_binomial","neg_binomial_2","neg_binomial_2_log","normal","ordered_logistic","pareto","pareto_type_2","poisson","poisson_log","rayleigh","scaled_inv_chi_square","skew_normal","student_t","uniform","von_mises","weibull","wiener","wishart"];return{name:"Stan",aliases:["stanfuncs"],keywords:{$pattern:t.IDENT_RE,title:e,keyword:n.concat(s).concat(r),built_in:i},contains:[t.C_LINE_COMMENT_MODE,t.COMMENT(/#/,/$/,{relevance:0,keywords:{"meta-keyword":"include"}}),t.COMMENT(/\/\*/,/\*\//,{relevance:0,contains:[{className:"doctag",begin:/@(return|param)/}]}),{begin:/<\s*lower\s*=/,keywords:"lower"},{begin:/[<,]\s*upper\s*=/,keywords:"upper"},{className:"keyword",begin:/\btarget\s*\+=/,relevance:10},{begin:"~\\s*("+t.IDENT_RE+")\\s*\\(",keywords:o},{className:"number",variants:[{begin:/\b\d+(?:\.\d*)?(?:[eE][+-]?\d+)?/},{begin:/\.\d+(?:[eE][+-]?\d+)?\b/}],relevance:0},{className:"string",begin:'"',end:'"',relevance:0}]}}hpn.exports=gos});var gpn=ee((dPa,fpn)=>{p();function Aos(t){return{name:"Stata",aliases:["do","ado"],case_insensitive:!0,keywords:"if else in foreach for forv forva forval forvalu forvalue forvalues by bys bysort xi quietly qui capture about ac ac_7 acprplot acprplot_7 adjust ado adopath adoupdate alpha ameans an ano anov anova anova_estat anova_terms anovadef aorder ap app appe appen append arch arch_dr arch_estat arch_p archlm areg areg_p args arima arima_dr arima_estat arima_p as asmprobit asmprobit_estat asmprobit_lf asmprobit_mfx__dlg asmprobit_p ass asse asser assert avplot avplot_7 avplots avplots_7 bcskew0 bgodfrey bias binreg bip0_lf biplot bipp_lf bipr_lf bipr_p biprobit bitest bitesti bitowt blogit bmemsize boot bootsamp bootstrap bootstrap_8 boxco_l boxco_p boxcox boxcox_6 boxcox_p bprobit br break brier bro brow brows browse brr brrstat bs bs_7 bsampl_w bsample bsample_7 bsqreg bstat bstat_7 bstat_8 bstrap bstrap_7 bubble bubbleplot ca ca_estat ca_p cabiplot camat canon canon_8 canon_8_p canon_estat canon_p cap caprojection capt captu captur capture cat cc cchart cchart_7 cci cd censobs_table centile cf char chdir checkdlgfiles checkestimationsample checkhlpfiles checksum chelp ci cii cl class classutil clear cli clis clist clo clog clog_lf clog_p clogi clogi_sw clogit clogit_lf clogit_p clogitp clogl_sw cloglog clonevar clslistarray cluster cluster_measures cluster_stop cluster_tree cluster_tree_8 clustermat cmdlog cnr cnre cnreg cnreg_p cnreg_sw cnsreg codebook collaps4 collapse colormult_nb colormult_nw compare compress conf confi confir confirm conren cons const constr constra constrai constrain constraint continue contract copy copyright copysource cor corc corr corr2data corr_anti corr_kmo corr_smc corre correl correla correlat correlate corrgram cou coun count cox cox_p cox_sw coxbase coxhaz coxvar cprplot cprplot_7 crc cret cretu cretur creturn cross cs cscript cscript_log csi ct ct_is ctset ctst_5 ctst_st cttost cumsp cumsp_7 cumul cusum cusum_7 cutil d|0 datasig datasign datasigna datasignat datasignatu datasignatur datasignature datetof db dbeta de dec deco decod decode deff des desc descr descri describ describe destring dfbeta dfgls dfuller di di_g dir dirstats dis discard disp disp_res disp_s displ displa display distinct do doe doed doedi doedit dotplot dotplot_7 dprobit drawnorm drop ds ds_util dstdize duplicates durbina dwstat dydx e|0 ed edi edit egen eivreg emdef en enc enco encod encode eq erase ereg ereg_lf ereg_p ereg_sw ereghet ereghet_glf ereghet_glf_sh ereghet_gp ereghet_ilf ereghet_ilf_sh ereghet_ip eret eretu eretur ereturn err erro error esize est est_cfexist est_cfname est_clickable est_expand est_hold est_table est_unhold est_unholdok estat estat_default estat_summ estat_vce_only esti estimates etodow etof etomdy ex exi exit expand expandcl fac fact facto factor factor_estat factor_p factor_pca_rotated factor_rotate factormat fcast fcast_compute fcast_graph fdades fdadesc fdadescr fdadescri fdadescrib fdadescribe fdasav fdasave fdause fh_st file open file read file close file filefilter fillin find_hlp_file findfile findit findit_7 fit fl fli flis flist for5_0 forest forestplot form forma format fpredict frac_154 frac_adj frac_chk frac_cox frac_ddp frac_dis frac_dv frac_in frac_mun frac_pp frac_pq frac_pv frac_wgt frac_xo fracgen fracplot fracplot_7 fracpoly fracpred fron_ex fron_hn fron_p fron_tn fron_tn2 frontier ftodate ftoe ftomdy ftowdate funnel funnelplot g|0 gamhet_glf gamhet_gp gamhet_ilf gamhet_ip gamma gamma_d2 gamma_p gamma_sw gammahet gdi_hexagon gdi_spokes ge gen gene gener genera generat generate genrank genstd genvmean gettoken gl gladder gladder_7 glim_l01 glim_l02 glim_l03 glim_l04 glim_l05 glim_l06 glim_l07 glim_l08 glim_l09 glim_l10 glim_l11 glim_l12 glim_lf glim_mu glim_nw1 glim_nw2 glim_nw3 glim_p glim_v1 glim_v2 glim_v3 glim_v4 glim_v5 glim_v6 glim_v7 glm glm_6 glm_p glm_sw glmpred glo glob globa global glogit glogit_8 glogit_p gmeans gnbre_lf gnbreg gnbreg_5 gnbreg_p gomp_lf gompe_sw gomper_p gompertz gompertzhet gomphet_glf gomphet_glf_sh gomphet_gp gomphet_ilf gomphet_ilf_sh gomphet_ip gphdot gphpen gphprint gprefs gprobi_p gprobit gprobit_8 gr gr7 gr_copy gr_current gr_db gr_describe gr_dir gr_draw gr_draw_replay gr_drop gr_edit gr_editviewopts gr_example gr_example2 gr_export gr_print gr_qscheme gr_query gr_read gr_rename gr_replay gr_save gr_set gr_setscheme gr_table gr_undo gr_use graph graph7 grebar greigen greigen_7 greigen_8 grmeanby grmeanby_7 gs_fileinfo gs_filetype gs_graphinfo gs_stat gsort gwood h|0 hadimvo hareg hausman haver he heck_d2 heckma_p heckman heckp_lf heckpr_p heckprob hel help hereg hetpr_lf hetpr_p hetprob hettest hexdump hilite hist hist_7 histogram hlogit hlu hmeans hotel hotelling hprobit hreg hsearch icd9 icd9_ff icd9p iis impute imtest inbase include inf infi infil infile infix inp inpu input ins insheet insp inspe inspec inspect integ inten intreg intreg_7 intreg_p intrg2_ll intrg_ll intrg_ll2 ipolate iqreg ir irf irf_create irfm iri is_svy is_svysum isid istdize ivprob_1_lf ivprob_lf ivprobit ivprobit_p ivreg ivreg_footnote ivtob_1_lf ivtob_lf ivtobit ivtobit_p jackknife jacknife jknife jknife_6 jknife_8 jkstat joinby kalarma1 kap kap_3 kapmeier kappa kapwgt kdensity kdensity_7 keep ksm ksmirnov ktau kwallis l|0 la lab labbe labbeplot labe label labelbook ladder levels levelsof leverage lfit lfit_p li lincom line linktest lis list lloghet_glf lloghet_glf_sh lloghet_gp lloghet_ilf lloghet_ilf_sh lloghet_ip llogi_sw llogis_p llogist llogistic llogistichet lnorm_lf lnorm_sw lnorma_p lnormal lnormalhet lnormhet_glf lnormhet_glf_sh lnormhet_gp lnormhet_ilf lnormhet_ilf_sh lnormhet_ip lnskew0 loadingplot loc loca local log logi logis_lf logistic logistic_p logit logit_estat logit_p loglogs logrank loneway lookfor lookup lowess lowess_7 lpredict lrecomp lroc lroc_7 lrtest ls lsens lsens_7 lsens_x lstat ltable ltable_7 ltriang lv lvr2plot lvr2plot_7 m|0 ma mac macr macro makecns man manova manova_estat manova_p manovatest mantel mark markin markout marksample mat mat_capp mat_order mat_put_rr mat_rapp mata mata_clear mata_describe mata_drop mata_matdescribe mata_matsave mata_matuse mata_memory mata_mlib mata_mosave mata_rename mata_which matalabel matcproc matlist matname matr matri matrix matrix_input__dlg matstrik mcc mcci md0_ md1_ md1debug_ md2_ md2debug_ mds mds_estat mds_p mdsconfig mdslong mdsmat mdsshepard mdytoe mdytof me_derd mean means median memory memsize menl meqparse mer merg merge meta mfp mfx mhelp mhodds minbound mixed_ll mixed_ll_reparm mkassert mkdir mkmat mkspline ml ml_5 ml_adjs ml_bhhhs ml_c_d ml_check ml_clear ml_cnt ml_debug ml_defd ml_e0 ml_e0_bfgs ml_e0_cycle ml_e0_dfp ml_e0i ml_e1 ml_e1_bfgs ml_e1_bhhh ml_e1_cycle ml_e1_dfp ml_e2 ml_e2_cycle ml_ebfg0 ml_ebfr0 ml_ebfr1 ml_ebh0q ml_ebhh0 ml_ebhr0 ml_ebr0i ml_ecr0i ml_edfp0 ml_edfr0 ml_edfr1 ml_edr0i ml_eds ml_eer0i ml_egr0i ml_elf ml_elf_bfgs ml_elf_bhhh ml_elf_cycle ml_elf_dfp ml_elfi ml_elfs ml_enr0i ml_enrr0 ml_erdu0 ml_erdu0_bfgs ml_erdu0_bhhh ml_erdu0_bhhhq ml_erdu0_cycle ml_erdu0_dfp ml_erdu0_nrbfgs ml_exde ml_footnote ml_geqnr ml_grad0 ml_graph ml_hbhhh ml_hd0 ml_hold ml_init ml_inv ml_log ml_max ml_mlout ml_mlout_8 ml_model ml_nb0 ml_opt ml_p ml_plot ml_query ml_rdgrd ml_repor ml_s_e ml_score ml_searc ml_technique ml_unhold mleval mlf_ mlmatbysum mlmatsum mlog mlogi mlogit mlogit_footnote mlogit_p mlopts mlsum mlvecsum mnl0_ mor more mov move mprobit mprobit_lf mprobit_p mrdu0_ mrdu1_ mvdecode mvencode mvreg mvreg_estat n|0 nbreg nbreg_al nbreg_lf nbreg_p nbreg_sw nestreg net newey newey_7 newey_p news nl nl_7 nl_9 nl_9_p nl_p nl_p_7 nlcom nlcom_p nlexp2 nlexp2_7 nlexp2a nlexp2a_7 nlexp3 nlexp3_7 nlgom3 nlgom3_7 nlgom4 nlgom4_7 nlinit nllog3 nllog3_7 nllog4 nllog4_7 nlog_rd nlogit nlogit_p nlogitgen nlogittree nlpred no nobreak noi nois noisi noisil noisily note notes notes_dlg nptrend numlabel numlist odbc old_ver olo olog ologi ologi_sw ologit ologit_p ologitp on one onew onewa oneway op_colnm op_comp op_diff op_inv op_str opr opro oprob oprob_sw oprobi oprobi_p oprobit oprobitp opts_exclusive order orthog orthpoly ou out outf outfi outfil outfile outs outsh outshe outshee outsheet ovtest pac pac_7 palette parse parse_dissim pause pca pca_8 pca_display pca_estat pca_p pca_rotate pcamat pchart pchart_7 pchi pchi_7 pcorr pctile pentium pergram pergram_7 permute permute_8 personal peto_st pkcollapse pkcross pkequiv pkexamine pkexamine_7 pkshape pksumm pksumm_7 pl plo plot plugin pnorm pnorm_7 poisgof poiss_lf poiss_sw poisso_p poisson poisson_estat post postclose postfile postutil pperron pr prais prais_e prais_e2 prais_p predict predictnl preserve print pro prob probi probit probit_estat probit_p proc_time procoverlay procrustes procrustes_estat procrustes_p profiler prog progr progra program prop proportion prtest prtesti pwcorr pwd q\\s qby qbys qchi qchi_7 qladder qladder_7 qnorm qnorm_7 qqplot qqplot_7 qreg qreg_c qreg_p qreg_sw qu quadchk quantile quantile_7 que quer query range ranksum ratio rchart rchart_7 rcof recast reclink recode reg reg3 reg3_p regdw regr regre regre_p2 regres regres_p regress regress_estat regriv_p remap ren rena renam rename renpfix repeat replace report reshape restore ret retu retur return rm rmdir robvar roccomp roccomp_7 roccomp_8 rocf_lf rocfit rocfit_8 rocgold rocplot rocplot_7 roctab roctab_7 rolling rologit rologit_p rot rota rotat rotate rotatemat rreg rreg_p ru run runtest rvfplot rvfplot_7 rvpplot rvpplot_7 sa safesum sample sampsi sav save savedresults saveold sc sca scal scala scalar scatter scm_mine sco scob_lf scob_p scobi_sw scobit scor score scoreplot scoreplot_help scree screeplot screeplot_help sdtest sdtesti se search separate seperate serrbar serrbar_7 serset set set_defaults sfrancia sh she shel shell shewhart shewhart_7 signestimationsample signrank signtest simul simul_7 simulate simulate_8 sktest sleep slogit slogit_d2 slogit_p smooth snapspan so sor sort spearman spikeplot spikeplot_7 spikeplt spline_x split sqreg sqreg_p sret sretu sretur sreturn ssc st st_ct st_hc st_hcd st_hcd_sh st_is st_issys st_note st_promo st_set st_show st_smpl st_subid stack statsby statsby_8 stbase stci stci_7 stcox stcox_estat stcox_fr stcox_fr_ll stcox_p stcox_sw stcoxkm stcoxkm_7 stcstat stcurv stcurve stcurve_7 stdes stem stepwise stereg stfill stgen stir stjoin stmc stmh stphplot stphplot_7 stphtest stphtest_7 stptime strate strate_7 streg streg_sw streset sts sts_7 stset stsplit stsum sttocc sttoct stvary stweib su suest suest_8 sum summ summa summar summari summariz summarize sunflower sureg survcurv survsum svar svar_p svmat svy svy_disp svy_dreg svy_est svy_est_7 svy_estat svy_get svy_gnbreg_p svy_head svy_header svy_heckman_p svy_heckprob_p svy_intreg_p svy_ivreg_p svy_logistic_p svy_logit_p svy_mlogit_p svy_nbreg_p svy_ologit_p svy_oprobit_p svy_poisson_p svy_probit_p svy_regress_p svy_sub svy_sub_7 svy_x svy_x_7 svy_x_p svydes svydes_8 svygen svygnbreg svyheckman svyheckprob svyintreg svyintreg_7 svyintrg svyivreg svylc svylog_p svylogit svymarkout svymarkout_8 svymean svymlog svymlogit svynbreg svyolog svyologit svyoprob svyoprobit svyopts svypois svypois_7 svypoisson svyprobit svyprobt svyprop svyprop_7 svyratio svyreg svyreg_p svyregress svyset svyset_7 svyset_8 svytab svytab_7 svytest svytotal sw sw_8 swcnreg swcox swereg swilk swlogis swlogit swologit swoprbt swpois swprobit swqreg swtobit swweib symmetry symmi symplot symplot_7 syntax sysdescribe sysdir sysuse szroeter ta tab tab1 tab2 tab_or tabd tabdi tabdis tabdisp tabi table tabodds tabodds_7 tabstat tabu tabul tabula tabulat tabulate te tempfile tempname tempvar tes test testnl testparm teststd tetrachoric time_it timer tis tob tobi tobit tobit_p tobit_sw token tokeni tokeniz tokenize tostring total translate translator transmap treat_ll treatr_p treatreg trim trimfill trnb_cons trnb_mean trpoiss_d2 trunc_ll truncr_p truncreg tsappend tset tsfill tsline tsline_ex tsreport tsrevar tsrline tsset tssmooth tsunab ttest ttesti tut_chk tut_wait tutorial tw tware_st two twoway twoway__fpfit_serset twoway__function_gen twoway__histogram_gen twoway__ipoint_serset twoway__ipoints_serset twoway__kdensity_gen twoway__lfit_serset twoway__normgen_gen twoway__pci_serset twoway__qfit_serset twoway__scatteri_serset twoway__sunflower_gen twoway_ksm_serset ty typ type typeof u|0 unab unabbrev unabcmd update us use uselabel var var_mkcompanion var_p varbasic varfcast vargranger varirf varirf_add varirf_cgraph varirf_create varirf_ctable varirf_describe varirf_dir varirf_drop varirf_erase varirf_graph varirf_ograph varirf_rename varirf_set varirf_table varlist varlmar varnorm varsoc varstable varstable_w varstable_w2 varwle vce vec vec_fevd vec_mkphi vec_p vec_p_w vecirf_create veclmar veclmar_w vecnorm vecnorm_w vecrank vecstable verinst vers versi versio version view viewsource vif vwls wdatetof webdescribe webseek webuse weib1_lf weib2_lf weib_lf weib_lf0 weibhet_glf weibhet_glf_sh weibhet_glfa weibhet_glfa_sh weibhet_gp weibhet_ilf weibhet_ilf_sh weibhet_ilfa weibhet_ilfa_sh weibhet_ip weibu_sw weibul_p weibull weibull_c weibull_s weibullhet wh whelp whi which whil while wilc_st wilcoxon win wind windo window winexec wntestb wntestb_7 wntestq xchart xchart_7 xcorr xcorr_7 xi xi_6 xmlsav xmlsave xmluse xpose xsh xshe xshel xshell xt_iis xt_tis xtab_p xtabond xtbin_p xtclog xtcloglog xtcloglog_8 xtcloglog_d2 xtcloglog_pa_p xtcloglog_re_p xtcnt_p xtcorr xtdata xtdes xtfront_p xtfrontier xtgee xtgee_elink xtgee_estat xtgee_makeivar xtgee_p xtgee_plink xtgls xtgls_p xthaus xthausman xtht_p xthtaylor xtile xtint_p xtintreg xtintreg_8 xtintreg_d2 xtintreg_p xtivp_1 xtivp_2 xtivreg xtline xtline_ex xtlogit xtlogit_8 xtlogit_d2 xtlogit_fe_p xtlogit_pa_p xtlogit_re_p xtmixed xtmixed_estat xtmixed_p xtnb_fe xtnb_lf xtnbreg xtnbreg_pa_p xtnbreg_refe_p xtpcse xtpcse_p xtpois xtpoisson xtpoisson_d2 xtpoisson_pa_p xtpoisson_refe_p xtpred xtprobit xtprobit_8 xtprobit_d2 xtprobit_re_p xtps_fe xtps_lf xtps_ren xtps_ren_8 xtrar_p xtrc xtrc_p xtrchh xtrefe_p xtreg xtreg_be xtreg_fe xtreg_ml xtreg_pa_p xtreg_re xtregar xtrere_p xtset xtsf_ll xtsf_llti xtsum xttab xttest0 xttobit xttobit_8 xttobit_p xttrans yx yxview__barlike_draw yxview_area_draw yxview_bar_draw yxview_dot_draw yxview_dropline_draw yxview_function_draw yxview_iarrow_draw yxview_ilabels_draw yxview_normal_draw yxview_pcarrow_draw yxview_pcbarrow_draw yxview_pccapsym_draw yxview_pcscatter_draw yxview_pcspike_draw yxview_rarea_draw yxview_rbar_draw yxview_rbarm_draw yxview_rcap_draw yxview_rcapsym_draw yxview_rconnected_draw yxview_rline_draw yxview_rscatter_draw yxview_rspike_draw yxview_spike_draw yxview_sunflower_draw zap_s zinb zinb_llf zinb_plf zip zip_llf zip_p zip_plf zt_ct_5 zt_hc_5 zt_hcd_5 zt_is_5 zt_iss_5 zt_sho_5 zt_smp_5 ztbase_5 ztcox_5 ztdes_5 ztereg_5 ztfill_5 ztgen_5 ztir_5 ztjoin_5 ztnb ztnb_p ztp ztp_p zts_5 ztset_5 ztspli_5 ztsum_5 zttoct_5 ztvary_5 ztweib_5",contains:[{className:"symbol",begin:/`[a-zA-Z0-9_]+'/},{className:"variable",begin:/\$\{?[a-zA-Z0-9_]+\}?/},{className:"string",variants:[{begin:`\`"[^\r +]`,{returnEnd:!0,relevance:0}),{className:"title",begin:"[\\[\\]]",relevance:0},{className:"string",begin:"[\\.,]",relevance:0},{begin:/(?:\+\+|--)/,contains:[e]},e]}}DDn.exports=SOi});var ODn=re((Zoc,MDn)=>{p();function COi(t){return t?typeof t=="string"?t:t.source:null}function IOi(t){return Qat("(?=",t,")")}function FTe(t){return Qat("(",t,")?")}function Qat(...t){return t.map(n=>COi(n)).join("")}function wOi(t){let e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",s="("+n+"|"+FTe(r)+"[a-zA-Z_]\\w*"+FTe("<[^<>]+>")+")",o={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:FTe(r)+t.IDENT_RE,relevance:0},m=FTe(r)+t.IDENT_RE+"\\s*\\(",f={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"_Bool _Complex _Imaginary",_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"],literal:"true false nullptr NULL"},g={className:"function.dispatch",relevance:0,keywords:f,begin:Qat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,t.IDENT_RE,IOi(/\s*\(/))},A=[g,l,o,e,t.C_BLOCK_COMMENT_MODE,u,c],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:A.concat([{begin:/\(/,end:/\)/,keywords:f,contains:A.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+s+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:f,relevance:0},{begin:m,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,e,t.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:f,illegal:"",keywords:f,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:l,strings:c,keywords:f}}}function TOi(t){let e=wOi(t),n=["c","h"],r=["cc","c++","h++","hpp","hh","hxx","cxx"];return e.disableAutodetect=!0,e.aliases=[],t.getLanguage("c")||e.aliases.push(...n),t.getLanguage("cpp")||e.aliases.push(...r),e}MDn.exports=TOi});var FDn=re((tac,LDn)=>{p();function vOi(t){let e="div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to until while with var",n="false true",r=[t.C_LINE_COMMENT_MODE,t.COMMENT(/\{/,/\}/,{relevance:0}),t.COMMENT(/\(\*/,/\*\)/,{relevance:10})],i={className:"string",begin:/'/,end:/'/,contains:[{begin:/''/}]},s={className:"string",begin:/(#\d+)+/},o={className:"number",begin:"\\b\\d+(\\.\\d+)?(DT|D|T)",relevance:0},a={className:"string",begin:'"',end:'"'},c={className:"function",beginKeywords:"procedure",end:/[:;]/,keywords:"procedure|10",contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,keywords:e,contains:[i,s]}].concat(r)},u={className:"class",begin:"OBJECT (Table|Form|Report|Dataport|Codeunit|XMLport|MenuSuite|Page|Query) (\\d+) ([^\\r\\n]+)",returnBegin:!0,contains:[t.TITLE_MODE,c]};return{name:"C/AL",case_insensitive:!0,keywords:{keyword:e,literal:n},illegal:/\/\*/,contains:[i,s,o,a,t.NUMBER_MODE,u,c]}}LDn.exports=vOi});var UDn=re((rac,QDn)=>{p();function ROi(t){return{name:"Cap\u2019n Proto",aliases:["capnp"],keywords:{keyword:"struct enum interface union group import using const annotation extends in of on as with from fixed",built_in:"Void Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64 Text Data AnyPointer AnyStruct Capability List",literal:"true false"},contains:[t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.HASH_COMMENT_MODE,{className:"meta",begin:/@0x[\w\d]{16};/,illegal:/\n/},{className:"symbol",begin:/@\d+\b/},{className:"class",beginKeywords:"struct enum",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{className:"class",beginKeywords:"interface",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]}]}}QDn.exports=ROi});var $Dn=re((sac,GDn)=>{p();function kOi(t){let e="assembly module package import alias class interface object given value assign void function new of extends satisfies abstracts in out return break continue throw assert dynamic if else switch case for while try catch finally then let this outer super is exists nonempty",n="shared abstract formal default actual variable late native deprecated final sealed annotation suppressWarnings small",r="doc by license see throws tagged",i={className:"subst",excludeBegin:!0,excludeEnd:!0,begin:/``/,end:/``/,keywords:e,relevance:10},s=[{className:"string",begin:'"""',end:'"""',relevance:10},{className:"string",begin:'"',end:'"',contains:[i]},{className:"string",begin:"'",end:"'"},{className:"number",begin:"#[0-9a-fA-F_]+|\\$[01_]+|[0-9_]+(?:\\.[0-9_](?:[eE][+-]?\\d+)?)?[kMGTPmunpf]?",relevance:0}];return i.contains=s,{name:"Ceylon",keywords:{keyword:e+" "+n,meta:r},illegal:"\\$[^01]|#[^0-9a-fA-F]",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),{className:"meta",begin:'@[a-z]\\w*(?::"[^"]*")?'}].concat(s)}}GDn.exports=kOi});var HDn=re((aac,WDn)=>{p();function BOi(t){return{name:"Clean",aliases:["icl","dcl"],keywords:{keyword:"if let in with where case of class instance otherwise implementation definition system module from import qualified as special code inline foreign export ccall stdcall generic derive infix infixl infixr",built_in:"Int Real Char Bool",literal:"True False"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{begin:"->|<-[|:]?|#!?|>>=|\\{\\||\\|\\}|:==|=:|<>"}]}}WDn.exports=BOi});var jDn=re((lac,qDn)=>{p();function NOi(t){let e="a-zA-Z_\\-!.?+*=<>&#'",n="["+e+"]["+e+"0-9/;:]*",r="def defonce defprotocol defstruct defmulti defmethod defn- defn defmacro deftype defrecord",i={$pattern:n,"builtin-name":r+" cond apply if-not if-let if not not= =|0 <|0 >|0 <=|0 >=|0 ==|0 +|0 /|0 *|0 -|0 rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy first rest cons cast coll last butlast sigs reify second ffirst fnext nfirst nnext meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"},s="[-+]?\\d+(\\.\\d+)?",o={begin:n,relevance:0},a={className:"number",begin:s,relevance:0},c=t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),u=t.COMMENT(";","$",{relevance:0}),l={className:"literal",begin:/\b(true|false|nil)\b/},d={begin:"[\\[\\{]",end:"[\\]\\}]"},m={className:"comment",begin:"\\^"+n},h=t.COMMENT("\\^\\{","\\}"),f={className:"symbol",begin:"[:]{1,2}"+n},g={begin:"\\(",end:"\\)"},A={endsWithParent:!0,relevance:0},y={keywords:i,className:"name",begin:n,relevance:0,starts:A},E=[g,c,m,h,u,f,d,a,l,o],_={beginKeywords:r,lexemes:n,end:'(\\[|#|\\d|"|:|\\{|\\)|\\(|$)',contains:[{className:"title",begin:n,relevance:0,excludeEnd:!0,endsParent:!0}].concat(E)};return g.contains=[t.COMMENT("comment",""),_,y,A],A.contains=E,d.contains=E,h.contains=[d],{name:"Clojure",aliases:["clj"],illegal:/\S/,contains:[g,c,m,h,u,f,d,a,l]}}qDn.exports=NOi});var YDn=re((dac,VDn)=>{p();function DOi(t){return{name:"Clojure REPL",contains:[{className:"meta",begin:/^([\w.-]+|\s*#_)?=>/,starts:{end:/$/,subLanguage:"clojure"}}]}}VDn.exports=DOi});var KDn=re((mac,zDn)=>{p();function POi(t){return{name:"CMake",aliases:["cmake.in"],case_insensitive:!0,keywords:{keyword:"break cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue elseif else endforeach endfunction endif endmacro endwhile execute_process file find_file find_library find_package find_path find_program foreach function get_cmake_property get_directory_property get_filename_component get_property if include include_guard list macro mark_as_advanced math message option return separate_arguments set_directory_properties set_property set site_name string unset variable_watch while add_compile_definitions add_compile_options add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_link_options add_subdirectory add_test aux_source_directory build_command create_test_sourcelist define_property enable_language enable_testing export fltk_wrap_ui get_source_file_property get_target_property get_test_property include_directories include_external_msproject include_regular_expression install link_directories link_libraries load_cache project qt_wrap_cpp qt_wrap_ui remove_definitions set_source_files_properties set_target_properties set_tests_properties source_group target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_directories target_link_libraries target_link_options target_sources try_compile try_run ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload build_name exec_program export_library_dependencies install_files install_programs install_targets load_command make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or not command policy target test exists is_newer_than is_directory is_symlink is_absolute matches less greater equal less_equal greater_equal strless strgreater strequal strless_equal strgreater_equal version_less version_greater version_equal version_less_equal version_greater_equal in_list defined"},contains:[{className:"variable",begin:/\$\{/,end:/\}/},t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE]}}zDn.exports=POi});var XDn=re((fac,JDn)=>{p();var MOi=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],OOi=["true","false","null","undefined","NaN","Infinity"],LOi=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],FOi=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],QOi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],UOi=["arguments","this","super","console","window","document","localStorage","module","global"],GOi=[].concat(QOi,UOi,LOi,FOi);function $Oi(t){let e=["npm","print"],n=["yes","no","on","off"],r=["then","unless","until","loop","by","when","and","or","is","isnt","not"],i=["var","const","let","function","static"],s=h=>f=>!h.includes(f),o={keyword:MOi.concat(r).filter(s(i)),literal:OOi.concat(n),built_in:GOi.concat(e)},a="[A-Za-z$_][0-9A-Za-z$_]*",c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},u=[t.BINARY_NUMBER_MODE,t.inherit(t.C_NUMBER_MODE,{starts:{end:"(\\s*/)?",relevance:0}}),{className:"string",variants:[{begin:/'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[t.BACKSLASH_ESCAPE]},{begin:/"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c]},{begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,c]}]},{className:"regexp",variants:[{begin:"///",end:"///",contains:[c,t.HASH_COMMENT_MODE]},{begin:"//[gim]{0,3}(?=\\W)",relevance:0},{begin:/\/(?![ *]).*?(?![\\]).\/[gim]{0,3}(?=\W)/}]},{begin:"@"+a},{subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,variants:[{begin:"```",end:"```"},{begin:"`",end:"`"}]}];c.contains=u;let l=t.inherit(t.TITLE_MODE,{begin:a}),d="(\\(.*\\)\\s*)?\\B[-=]>",m={className:"params",begin:"\\([^\\(]",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:o,contains:["self"].concat(u)}]};return{name:"CoffeeScript",aliases:["coffee","cson","iced"],keywords:o,illegal:/\/\*/,contains:u.concat([t.COMMENT("###","###"),t.HASH_COMMENT_MODE,{className:"function",begin:"^\\s*"+a+"\\s*=\\s*"+d,end:"[-=]>",returnBegin:!0,contains:[l,m]},{begin:/[:\(,=]\s*/,relevance:0,contains:[{className:"function",begin:d,end:"[-=]>",returnBegin:!0,contains:[m]}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[l]},l]},{begin:a+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}JDn.exports=$Oi});var ePn=re((Aac,ZDn)=>{p();function WOi(t){return{name:"Coq",keywords:{keyword:"_|0 as at cofix else end exists exists2 fix for forall fun if IF in let match mod Prop return Set then Type using where with Abort About Add Admit Admitted All Arguments Assumptions Axiom Back BackTo Backtrack Bind Blacklist Canonical Cd Check Class Classes Close Coercion Coercions CoFixpoint CoInductive Collection Combined Compute Conjecture Conjectures Constant constr Constraint Constructors Context Corollary CreateHintDb Cut Declare Defined Definition Delimit Dependencies Dependent Derive Drop eauto End Equality Eval Example Existential Existentials Existing Export exporting Extern Extract Extraction Fact Field Fields File Fixpoint Focus for From Function Functional Generalizable Global Goal Grab Grammar Graph Guarded Heap Hint HintDb Hints Hypotheses Hypothesis ident Identity If Immediate Implicit Import Include Inductive Infix Info Initial Inline Inspect Instance Instances Intro Intros Inversion Inversion_clear Language Left Lemma Let Libraries Library Load LoadPath Local Locate Ltac ML Mode Module Modules Monomorphic Morphism Next NoInline Notation Obligation Obligations Opaque Open Optimize Options Parameter Parameters Parametric Path Paths pattern Polymorphic Preterm Print Printing Program Projections Proof Proposition Pwd Qed Quit Rec Record Recursive Redirect Relation Remark Remove Require Reserved Reset Resolve Restart Rewrite Right Ring Rings Save Scheme Scope Scopes Script Search SearchAbout SearchHead SearchPattern SearchRewrite Section Separate Set Setoid Show Solve Sorted Step Strategies Strategy Structure SubClass Table Tables Tactic Term Test Theorem Time Timeout Transparent Type Typeclasses Types Undelimit Undo Unfocus Unfocused Unfold Universe Universes Unset Unshelve using Variable Variables Variant Verbose Visibility where with",built_in:"abstract absurd admit after apply as assert assumption at auto autorewrite autounfold before bottom btauto by case case_eq cbn cbv change classical_left classical_right clear clearbody cofix compare compute congruence constr_eq constructor contradict contradiction cut cutrewrite cycle decide decompose dependent destruct destruction dintuition discriminate discrR do double dtauto eapply eassumption eauto ecase econstructor edestruct ediscriminate eelim eexact eexists einduction einjection eleft elim elimtype enough equality erewrite eright esimplify_eq esplit evar exact exactly_once exfalso exists f_equal fail field field_simplify field_simplify_eq first firstorder fix fold fourier functional generalize generalizing gfail give_up has_evar hnf idtac in induction injection instantiate intro intro_pattern intros intuition inversion inversion_clear is_evar is_var lapply lazy left lia lra move native_compute nia nsatz omega once pattern pose progress proof psatz quote record red refine reflexivity remember rename repeat replace revert revgoals rewrite rewrite_strat right ring ring_simplify rtauto set setoid_reflexivity setoid_replace setoid_rewrite setoid_symmetry setoid_transitivity shelve shelve_unifiable simpl simple simplify_eq solve specialize split split_Rabs split_Rmult stepl stepr subst sum swap symmetry tactic tauto time timeout top transitivity trivial try tryif unfold unify until using vm_compute with"},contains:[t.QUOTE_STRING_MODE,t.COMMENT("\\(\\*","\\*\\)"),t.C_NUMBER_MODE,{className:"type",excludeBegin:!0,begin:"\\|\\s*",end:"\\w+"},{begin:/[-=]>/}]}}ZDn.exports=WOi});var nPn=re((Eac,tPn)=>{p();function HOi(t){return{name:"Cach\xE9 Object Script",case_insensitive:!0,aliases:["cls"],keywords:"property parameter class classmethod clientmethod extends as break catch close continue do d|0 else elseif for goto halt hang h|0 if job j|0 kill k|0 lock l|0 merge new open quit q|0 read r|0 return set s|0 tcommit throw trollback try tstart use view while write w|0 xecute x|0 zkill znspace zn ztrap zwrite zw zzdump zzwrite print zbreak zinsert zload zprint zremove zsave zzprint mv mvcall mvcrt mvdim mvprint zquit zsync ascii",contains:[{className:"number",begin:"\\b(\\d+(\\.\\d*)?|\\.\\d+)",relevance:0},{className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]}]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"comment",begin:/;/,end:"$",relevance:0},{className:"built_in",begin:/(?:\$\$?|\.\.)\^?[a-zA-Z]+/},{className:"built_in",begin:/\$\$\$[a-zA-Z]+/},{className:"built_in",begin:/%[a-z]+(?:\.[a-z]+)*/},{className:"symbol",begin:/\^%?[a-zA-Z][\w]*/},{className:"keyword",begin:/##class|##super|#define|#dim/},{begin:/&sql\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,subLanguage:"sql"},{begin:/&(js|jscript|javascript)/,excludeBegin:!0,excludeEnd:!0,subLanguage:"javascript"},{begin:/&html<\s*\s*>/,subLanguage:"xml"}]}}tPn.exports=HOi});var iPn=re((_ac,rPn)=>{p();function qOi(t){let e="primitive rsc_template",n="group clone ms master location colocation order fencing_topology rsc_ticket acl_target acl_group user role tag xml";return{name:"crmsh",aliases:["crm","pcmk"],case_insensitive:!0,keywords:{keyword:"params meta operations op rule attributes utilization"+" "+"read write deny defined not_defined in_range date spec in ref reference attribute type xpath version and or lt gt tag lte gte eq ne \\"+" "+"number string",literal:"Master Started Slave Stopped start promote demote stop monitor true false"},contains:[t.HASH_COMMENT_MODE,{beginKeywords:"node",starts:{end:"\\s*([\\w_-]+:)?",starts:{className:"title",end:"\\s*[\\$\\w_][\\w_-]*"}}},{beginKeywords:e,starts:{className:"title",end:"\\s*[\\$\\w_][\\w_-]*",starts:{end:"\\s*@?[\\w_][\\w_\\.:-]*"}}},{begin:"\\b("+n.split(" ").join("|")+")\\s+",keywords:n,starts:{className:"title",end:"[\\$\\w_][\\w_-]*"}},{beginKeywords:"property rsc_defaults op_defaults",starts:{className:"title",end:"\\s*([\\w_-]+:)?"}},t.QUOTE_STRING_MODE,{className:"meta",begin:"(ocf|systemd|service|lsb):[\\w_:-]+",relevance:0},{className:"number",begin:"\\b\\d+(\\.\\d+)?(ms|s|h|m)?",relevance:0},{className:"literal",begin:"[-]?(infinity|inf)",relevance:0},{className:"attr",begin:/([A-Za-z$_#][\w_-]+)=/,relevance:0},{className:"tag",begin:"",relevance:0}]}}rPn.exports=qOi});var oPn=re((Sac,sPn)=>{p();function jOi(t){let e="(_?[ui](8|16|32|64|128))?",n="(_?f(32|64))?",r="[a-zA-Z_]\\w*[!?=]?",i="[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~|]|//|//=|&[-+*]=?|&\\*\\*|\\[\\][=?]?",s="[A-Za-z_]\\w*(::\\w+)*(\\?|!)?",o={$pattern:r,keyword:"abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? return require select self sizeof struct super then type typeof union uninitialized unless until verbatim when while with yield __DIR__ __END_LINE__ __FILE__ __LINE__",literal:"false nil true"},a={className:"subst",begin:/#\{/,end:/\}/,keywords:o},c={className:"template-variable",variants:[{begin:"\\{\\{",end:"\\}\\}"},{begin:"\\{%",end:"%\\}"}],keywords:o};function u(A,y){let E=[{begin:A,end:y}];return E[0].contains=E,E}let l={className:"string",contains:[t.BACKSLASH_ESCAPE,a],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[Qwi]?\\(",end:"\\)",contains:u("\\(","\\)")},{begin:"%[Qwi]?\\[",end:"\\]",contains:u("\\[","\\]")},{begin:"%[Qwi]?\\{",end:/\}/,contains:u(/\{/,/\}/)},{begin:"%[Qwi]?<",end:">",contains:u("<",">")},{begin:"%[Qwi]?\\|",end:"\\|"},{begin:/<<-\w+$/,end:/^\s*\w+$/}],relevance:0},d={className:"string",variants:[{begin:"%q\\(",end:"\\)",contains:u("\\(","\\)")},{begin:"%q\\[",end:"\\]",contains:u("\\[","\\]")},{begin:"%q\\{",end:/\}/,contains:u(/\{/,/\}/)},{begin:"%q<",end:">",contains:u("<",">")},{begin:"%q\\|",end:"\\|"},{begin:/<<-'\w+'$/,end:/^\s*\w+$/}],relevance:0},m={begin:"(?!%\\})("+t.RE_STARTERS_RE+"|\\n|\\b(case|if|select|unless|until|when|while)\\b)\\s*",keywords:"case if select unless until when while",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,a],variants:[{begin:"//[a-z]*",relevance:0},{begin:"/(?!\\/)",end:"/[a-z]*"}]}],relevance:0},h={className:"regexp",contains:[t.BACKSLASH_ESCAPE,a],variants:[{begin:"%r\\(",end:"\\)",contains:u("\\(","\\)")},{begin:"%r\\[",end:"\\]",contains:u("\\[","\\]")},{begin:"%r\\{",end:/\}/,contains:u(/\{/,/\}/)},{begin:"%r<",end:">",contains:u("<",">")},{begin:"%r\\|",end:"\\|"}],relevance:0},f={className:"meta",begin:"@\\[",end:"\\]",contains:[t.inherit(t.QUOTE_STRING_MODE,{className:"meta-string"})]},g=[c,l,d,h,m,f,t.HASH_COMMENT_MODE,{className:"class",beginKeywords:"class module struct",end:"$|;",illegal:/=/,contains:[t.HASH_COMMENT_MODE,t.inherit(t.TITLE_MODE,{begin:s}),{begin:"<"}]},{className:"class",beginKeywords:"lib enum union",end:"$|;",illegal:/=/,contains:[t.HASH_COMMENT_MODE,t.inherit(t.TITLE_MODE,{begin:s})]},{beginKeywords:"annotation",end:"$|;",illegal:/=/,contains:[t.HASH_COMMENT_MODE,t.inherit(t.TITLE_MODE,{begin:s})],relevance:2},{className:"function",beginKeywords:"def",end:/\B\b/,contains:[t.inherit(t.TITLE_MODE,{begin:i,endsParent:!0})]},{className:"function",beginKeywords:"fun macro",end:/\B\b/,contains:[t.inherit(t.TITLE_MODE,{begin:i,endsParent:!0})],relevance:2},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":",contains:[l,{begin:i}],relevance:0},{className:"number",variants:[{begin:"\\b0b([01_]+)"+e},{begin:"\\b0o([0-7_]+)"+e},{begin:"\\b0x([A-Fa-f0-9_]+)"+e},{begin:"\\b([1-9][0-9_]*[0-9]|[0-9])(\\.[0-9][0-9_]*)?([eE]_?[-+]?[0-9_]*)?"+n+"(?!_)"},{begin:"\\b([1-9][0-9_]*|0)"+e}],relevance:0}];return a.contains=g,c.contains=g.slice(1),{name:"Crystal",aliases:["cr"],keywords:o,contains:g}}sPn.exports=jOi});var cPn=re((Iac,aPn)=>{p();function VOi(t){return{name:"CSP",case_insensitive:!1,keywords:{$pattern:"[a-zA-Z][a-zA-Z0-9_-]*",keyword:"base-uri child-src connect-src default-src font-src form-action frame-ancestors frame-src img-src media-src object-src plugin-types report-uri sandbox script-src style-src"},contains:[{className:"string",begin:"'",end:"'"},{className:"attribute",begin:"^Content",end:":",excludeEnd:!0}]}}aPn.exports=VOi});var uPn=re((Tac,lPn)=>{p();var YOi=t=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]}}),zOi=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],KOi=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],JOi=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],XOi=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ZOi=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse();function eLi(t){return t?typeof t=="string"?t:t.source:null}function tLi(t){return nLi("(?=",t,")")}function nLi(...t){return t.map(n=>eLi(n)).join("")}function rLi(t){let e=YOi(t),n={className:"built_in",begin:/[\w-]+(?=\()/},r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.C_BLOCK_COMMENT_MODE,r,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+JOi.join("|")+")"},{begin:"::("+XOi.join("|")+")"}]},{className:"attribute",begin:"\\b("+ZOi.join("|")+")\\b"},{begin:":",end:"[;}]",contains:[e.HEXCOLOR,e.IMPORTANT,t.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n]},{begin:tLi(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:KOi.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+zOi.join("|")+")\\b"}]}}lPn.exports=rLi});var pPn=re((Rac,dPn)=>{p();function iLi(t){let e={$pattern:t.UNDERSCORE_IDENT_RE,keyword:"abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",built_in:"bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring",literal:"false null true"},n="(0|[1-9][\\d_]*)",r="(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)",i="0[bB][01_]+",s="([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)",o="0[xX]"+s,a="([eE][+-]?"+r+")",c="("+r+"(\\.\\d*|"+a+")|\\d+\\."+r+"|\\."+n+a+"?)",u="(0[xX]("+s+"\\."+s+"|\\.?"+s+")[pP][+-]?"+r+")",l="("+n+"|"+i+"|"+o+")",d="("+u+"|"+c+")",m=`\\\\(['"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};`,h={className:"number",begin:"\\b"+l+"(L|u|U|Lu|LU|uL|UL)?",relevance:0},f={className:"number",begin:"\\b("+d+"([fF]|L|i|[fF]i|Li)?|"+l+"(i|[fF]i|Li))",relevance:0},g={className:"string",begin:"'("+m+"|.)",end:"'",illegal:"."},y={className:"string",begin:'"',contains:[{begin:m,relevance:0}],end:'"[cwd]?'},E={className:"string",begin:'[rq]"',end:'"[cwd]?',relevance:5},_={className:"string",begin:"`",end:"`[cwd]?"},S={className:"string",begin:'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',relevance:10},C={className:"string",begin:'q"\\{',end:'\\}"'},I={className:"meta",begin:"^#!",end:"$",relevance:5},w={className:"meta",begin:"#(line)",end:"$",relevance:5},k={className:"keyword",begin:"@[a-zA-Z_][a-zA-Z_\\d]*"},N=t.COMMENT("\\/\\+","\\+\\/",{contains:["self"],relevance:10});return{name:"D",keywords:e,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,N,S,y,E,_,C,f,h,g,I,w,k]}}dPn.exports=iLi});var hPn=re((Bac,mPn)=>{p();function sLi(t){return t?typeof t=="string"?t:t.source:null}function oLi(...t){return t.map(n=>sLi(n)).join("")}function aLi(t){let e={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:oLi(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.+?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};c.contains.push(u),u.contains.push(c);let l=[e,a];return c.contains=c.contains.concat(l),u.contains=u.contains.concat(l),l=l.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:l},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:l}]}]},e,i,c,u,{className:"quote",begin:"^>\\s+",contains:l,end:"$"},r,n,a,s]}}mPn.exports=aLi});var gPn=re((Dac,fPn)=>{p();function cLi(t){let e="exports register file shl array record property for mod while set ally label uses raise not stored class safecall var interface or private static exit index inherited to else stdcall override shr asm far resourcestring finalization packed virtual out and protected library do xorwrite goto near function end div overload object unit begin string on inline repeat until destructor write message program with read initialization except default nil if case cdecl in downto threadvar of try pascal const external constructor type public then implementation finally published procedure absolute reintroduce operator as is abstract alias assembler bitpacked break continue cppdecl cvar enumerator experimental platform deprecated unimplemented dynamic export far16 forward generic helper implements interrupt iochecks local name nodefault noreturn nostackframe oldfpccall otherwise saveregisters softfloat specialize strict unaligned varargs ",n=[t.C_LINE_COMMENT_MODE,t.COMMENT(/\{/,/\}/,{relevance:0}),t.COMMENT(/\(\*/,/\*\)/,{relevance:10})],r={className:"meta",variants:[{begin:/\{\$/,end:/\}/},{begin:/\(\*\$/,end:/\*\)/}]},i={className:"string",begin:/'/,end:/'/,contains:[{begin:/''/}]},s={className:"number",relevance:0,variants:[{begin:"\\$[0-9A-Fa-f]+"},{begin:"&[0-7]+"},{begin:"%[01]+"}]},o={className:"string",begin:/(#\d+)+/},a={begin:t.IDENT_RE+"\\s*=\\s*class\\s*\\(",returnBegin:!0,contains:[t.TITLE_MODE]},c={className:"function",beginKeywords:"function constructor destructor procedure",end:/[:;]/,keywords:"function constructor|10 destructor|10 procedure|10",contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,keywords:e,contains:[i,o,r].concat(n)},r].concat(n)};return{name:"Delphi",aliases:["dpr","dfm","pas","pascal","freepascal","lazarus","lpr","lfm"],case_insensitive:!0,keywords:e,illegal:/"|\$[G-Zg-z]|\/\*|<\/|\|/,contains:[i,o,t.NUMBER_MODE,s,a,c,r].concat(n)}}fPn.exports=cLi});var yPn=re((Mac,APn)=>{p();function lLi(t){return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,variants:[{begin:/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/},{begin:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{begin:/^--- +\d+,\d+ +----$/}]},{className:"comment",variants:[{begin:/Index: /,end:/$/},{begin:/^index/,end:/$/},{begin:/={3,}/,end:/$/},{begin:/^-{3}/,end:/$/},{begin:/^\*{3} /,end:/$/},{begin:/^\+{3}/,end:/$/},{begin:/^\*{15}$/},{begin:/^diff --git/,end:/$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}APn.exports=lLi});var bPn=re((Lac,EPn)=>{p();function uLi(t){let e={begin:/\|[A-Za-z]+:?/,keywords:{name:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone"},contains:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE]};return{name:"Django",aliases:["jinja"],case_insensitive:!0,subLanguage:"xml",contains:[t.COMMENT(/\{%\s*comment\s*%\}/,/\{%\s*endcomment\s*%\}/),t.COMMENT(/\{#/,/#\}/),{className:"template-tag",begin:/\{%/,end:/%\}/,contains:[{className:"name",begin:/\w+/,keywords:{name:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim"},starts:{endsWithParent:!0,keywords:"in by as",contains:[e],relevance:0}}]},{className:"template-variable",begin:/\{\{/,end:/\}\}/,contains:[e]}]}}EPn.exports=uLi});var xPn=re((Qac,_Pn)=>{p();function dLi(t){return{name:"DNS Zone",aliases:["bind","zone"],keywords:{keyword:"IN A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME DHCID DLV DNAME DNSKEY DS HIP IPSECKEY KEY KX LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM PTR RRSIG RP SIG SOA SRV SSHFP TA TKEY TLSA TSIG TXT"},contains:[t.COMMENT(";","$",{relevance:0}),{className:"meta",begin:/^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/},{className:"number",begin:"((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-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-Fa-f]{1,4}:){5}(((:[0-9A-Fa-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-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-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-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-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-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-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-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-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-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-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}))|:)))\\b"},{className:"number",begin:"((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])\\b"},t.inherit(t.NUMBER_MODE,{begin:/\b\d+[dhwm]?/})]}}_Pn.exports=dLi});var CPn=re((Gac,SPn)=>{p();function pLi(t){return{name:"Dockerfile",aliases:["docker"],case_insensitive:!0,keywords:"from maintainer expose env arg user onbuild stopsignal",contains:[t.HASH_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{beginKeywords:"run cmd entrypoint volume add copy workdir label healthcheck shell",starts:{end:/[^\\]$/,subLanguage:"bash"}}],illegal:"{p();function mLi(t){let e=t.COMMENT(/^\s*@?rem\b/,/$/,{relevance:10});return{name:"Batch file (DOS)",aliases:["bat","cmd"],case_insensitive:!0,illegal:/\/\*/,keywords:{keyword:"if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",built_in:"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux shift cd dir echo setlocal endlocal set pause copy append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color comp compact convert date dir diskcomp diskcopy doskey erase fs find findstr format ftype graftabl help keyb label md mkdir mode more move path pause print popd pushd promt rd recover rem rename replace restore rmdir shift sort start subst time title tree type ver verify vol ping net ipconfig taskkill xcopy ren del"},contains:[{className:"variable",begin:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{className:"function",begin:{className:"symbol",begin:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",relevance:0}.begin,end:"goto:eof",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),e]},{className:"number",begin:"\\b\\d+",relevance:0},e]}}IPn.exports=mLi});var vPn=re((qac,TPn)=>{p();function hLi(t){return{keywords:"dsconfig",contains:[{className:"keyword",begin:"^dsconfig",end:/\s/,excludeEnd:!0,relevance:10},{className:"built_in",begin:/(list|create|get|set|delete)-(\w+)/,end:/\s/,excludeEnd:!0,illegal:"!@#$%^&*()",relevance:10},{className:"built_in",begin:/--(\w+)/,end:/\s/,excludeEnd:!0},{className:"string",begin:/"/,end:/"/},{className:"string",begin:/'/,end:/'/},{className:"string",begin:/[\w\-?]+:\w+/,end:/\W/,relevance:0},{className:"string",begin:/\w+(\-\w+)*/,end:/(?=\W)/,relevance:0},t.HASH_COMMENT_MODE]}}TPn.exports=hLi});var kPn=re((Vac,RPn)=>{p();function fLi(t){let e={className:"string",variants:[t.inherit(t.QUOTE_STRING_MODE,{begin:'((u8?|U)|L)?"'}),{begin:'(u8?|U)?R"',end:'"',contains:[t.BACKSLASH_ESCAPE]},{begin:"'\\\\?.",end:"'",illegal:"."}]},n={className:"number",variants:[{begin:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},{begin:t.C_NUMBER_RE}],relevance:0},r={className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elif endif define undef ifdef ifndef"},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",end:"$",keywords:{"meta-keyword":"include"},contains:[t.inherit(e,{className:"meta-string"}),{className:"meta-string",begin:"<",end:">",illegal:"\\n"}]},e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},i={className:"variable",begin:/&[a-z\d_]*\b/},s={className:"meta-keyword",begin:"/[a-z][a-z\\d-]*/"},o={className:"symbol",begin:"^\\s*[a-zA-Z_][a-zA-Z\\d_]*:"},a={className:"params",begin:"<",end:">",contains:[n,i]},c={className:"class",begin:/[a-zA-Z_][a-zA-Z\d_@]*\s\{/,end:/[{;=]/,returnBegin:!0,excludeEnd:!0};return{name:"Device Tree",keywords:"",contains:[{className:"class",begin:"/\\s*\\{",end:/\};/,relevance:10,contains:[i,s,o,c,a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,n,e]},i,s,o,c,a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,n,e,r,{begin:t.IDENT_RE+"::",keywords:""}]}}RPn.exports=fLi});var NPn=re((zac,BPn)=>{p();function gLi(t){return{name:"Dust",aliases:["dst"],case_insensitive:!0,subLanguage:"xml",contains:[{className:"template-tag",begin:/\{[#\/]/,end:/\}/,illegal:/;/,contains:[{className:"name",begin:/[a-zA-Z\.-]+/,starts:{endsWithParent:!0,relevance:0,contains:[t.QUOTE_STRING_MODE]}}]},{className:"template-variable",begin:/\{/,end:/\}/,illegal:/;/,keywords:"if eq ne lt lte gt gte select default math sep"}]}}BPn.exports=gLi});var PPn=re((Jac,DPn)=>{p();function ALi(t){let e=t.COMMENT(/\(\*/,/\*\)/),n={className:"attribute",begin:/^[ ]*[a-zA-Z]+([\s_-]+[a-zA-Z]+)*/},i={begin:/=/,end:/[.;]/,contains:[e,{className:"meta",begin:/\?.*\?/},{className:"string",variants:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{begin:"`",end:"`"}]}]};return{name:"Extended Backus-Naur Form",illegal:/\S/,contains:[e,n,i]}}DPn.exports=ALi});var OPn=re((Zac,MPn)=>{p();function yLi(t){let e="[a-zA-Z_][a-zA-Z0-9_.]*(!|\\?)?",n="[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={$pattern:e,keyword:"and false then defined module in return redo retry end for true self when next until do begin unless nil break not case cond alias while ensure or include use alias fn quote require import with|0"},i={className:"subst",begin:/#\{/,end:/\}/,keywords:r},s={className:"number",begin:"(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[1-9][0-9_]*(\\.[0-9_]+([eE][-+]?[0-9]+)?)?)",relevance:0},o=`[/|([{<"']`,a={className:"string",begin:"~[a-z](?="+o+")",contains:[{endsParent:!0,contains:[{contains:[t.BACKSLASH_ESCAPE,i],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/\//,end:/\//},{begin:/\|/,end:/\|/},{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/},{begin:/\{/,end:/\}/},{begin://}]}]}]},c={className:"string",begin:"~[A-Z](?="+o+")",contains:[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/\//,end:/\//},{begin:/\|/,end:/\|/},{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/},{begin:/\{/,end:/\}/},{begin://}]},u={className:"string",contains:[t.BACKSLASH_ESCAPE,i],variants:[{begin:/"""/,end:/"""/},{begin:/'''/,end:/'''/},{begin:/~S"""/,end:/"""/,contains:[]},{begin:/~S"/,end:/"/,contains:[]},{begin:/~S'''/,end:/'''/,contains:[]},{begin:/~S'/,end:/'/,contains:[]},{begin:/'/,end:/'/},{begin:/"/,end:/"/}]},l={className:"function",beginKeywords:"def defp defmacro",end:/\B\b/,contains:[t.inherit(t.TITLE_MODE,{begin:e,endsParent:!0})]},d=t.inherit(l,{className:"class",beginKeywords:"defimpl defmodule defprotocol defrecord",end:/\bdo\b|$|;/}),m=[u,c,a,t.HASH_COMMENT_MODE,d,l,{begin:"::"},{className:"symbol",begin:":(?![\\s:])",contains:[u,{begin:n}],relevance:0},{className:"symbol",begin:e+":(?!:)",relevance:0},s,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))"},{begin:"->"},{begin:"("+t.RE_STARTERS_RE+")\\s*",contains:[t.HASH_COMMENT_MODE,{begin:/\/: (?=\d+\s*[,\]])/,relevance:0,contains:[s]},{className:"regexp",illegal:"\\n",contains:[t.BACKSLASH_ESCAPE,i],variants:[{begin:"/",end:"/[a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}],relevance:0}];return i.contains=m,{name:"Elixir",keywords:r,contains:m}}MPn.exports=yLi});var FPn=re((tcc,LPn)=>{p();function ELi(t){let e={variants:[t.COMMENT("--","$"),t.COMMENT(/\{-/,/-\}/,{contains:["self"]})]},n={className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},r={begin:"\\(",end:"\\)",illegal:'"',contains:[{className:"type",begin:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},e]},i={begin:/\{/,end:/\}/,contains:r.contains},s={className:"string",begin:"'\\\\?.",end:"'",illegal:"."};return{name:"Elm",keywords:"let in if then else case of where module import exposing type alias as infix infixl infixr port effect command subscription",contains:[{beginKeywords:"port effect module",end:"exposing",keywords:"port effect module where command subscription exposing",contains:[r,e],illegal:"\\W\\.|;"},{begin:"import",end:"$",keywords:"import as exposing",contains:[r,e],illegal:"\\W\\.|;"},{begin:"type",end:"$",keywords:"type alias",contains:[n,r,i,e]},{beginKeywords:"infix infixl infixr",end:"$",contains:[t.C_NUMBER_MODE,e]},{begin:"port",end:"$",keywords:"port",contains:[e]},s,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,n,t.inherit(t.TITLE_MODE,{begin:"^[_a-z][\\w']*"}),e,{begin:"->|<-"}],illegal:/;/}}LPn.exports=ELi});var UPn=re((rcc,QPn)=>{p();function bLi(t){return{name:"ERB",subLanguage:"xml",contains:[t.COMMENT("<%#","%>"),{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0}]}}QPn.exports=bLi});var $Pn=re((scc,GPn)=>{p();function _Li(t){return t?typeof t=="string"?t:t.source:null}function xLi(...t){return t.map(n=>_Li(n)).join("")}function SLi(t){return{name:"Erlang REPL",keywords:{built_in:"spawn spawn_link self",keyword:"after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"},contains:[{className:"meta",begin:"^[0-9]+> ",relevance:10},t.COMMENT("%","$"),{className:"number",begin:"\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)",relevance:0},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{begin:xLi(/\?(::)?/,/([A-Z]\w*)/,/((::)[A-Z]\w*)*/)},{begin:"->"},{begin:"ok"},{begin:"!"},{begin:"(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",relevance:0},{begin:"[A-Z][a-zA-Z0-9_']*",relevance:0}]}}GPn.exports=SLi});var HPn=re((acc,WPn)=>{p();function CLi(t){let e="[a-z'][a-zA-Z0-9_']*",n="("+e+":"+e+"|"+e+")",r={keyword:"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if let not of orelse|10 query receive rem try when xor",literal:"false true"},i=t.COMMENT("%","$"),s={className:"number",begin:"\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)",relevance:0},o={begin:"fun\\s+"+e+"/\\d+"},a={begin:n+"\\(",end:"\\)",returnBegin:!0,relevance:0,contains:[{begin:n,relevance:0},{begin:"\\(",end:"\\)",endsWithParent:!0,returnEnd:!0,relevance:0}]},c={begin:/\{/,end:/\}/,relevance:0},u={begin:"\\b_([A-Z][A-Za-z0-9_]*)?",relevance:0},l={begin:"[A-Z][a-zA-Z0-9_]*",relevance:0},d={begin:"#"+t.UNDERSCORE_IDENT_RE,relevance:0,returnBegin:!0,contains:[{begin:"#"+t.UNDERSCORE_IDENT_RE,relevance:0},{begin:/\{/,end:/\}/,relevance:0}]},m={beginKeywords:"fun receive if try case",end:"end",keywords:r};m.contains=[i,o,t.inherit(t.APOS_STRING_MODE,{className:""}),m,a,t.QUOTE_STRING_MODE,s,c,u,l,d];let h=[i,o,m,a,t.QUOTE_STRING_MODE,s,c,u,l,d];a.contains[1].contains=h,c.contains=h,d.contains[1].contains=h;let f=["-module","-record","-undef","-export","-ifdef","-ifndef","-author","-copyright","-doc","-vsn","-import","-include","-include_lib","-compile","-define","-else","-endif","-file","-behaviour","-behavior","-spec"],g={className:"params",begin:"\\(",end:"\\)",contains:h};return{name:"Erlang",aliases:["erl"],keywords:r,illegal:"(",returnBegin:!0,illegal:"\\(|#|//|/\\*|\\\\|:|;",contains:[g,t.inherit(t.TITLE_MODE,{begin:e})],starts:{end:";|\\.",keywords:r,contains:h}},i,{begin:"^-",end:"\\.",relevance:0,excludeEnd:!0,returnBegin:!0,keywords:{$pattern:"-"+t.IDENT_RE,keyword:f.map(A=>`${A}|1.5`).join(" ")},contains:[g]},s,t.QUOTE_STRING_MODE,d,u,l,c,{begin:/\.$/}]}}WPn.exports=CLi});var jPn=re((lcc,qPn)=>{p();function ILi(t){return{name:"Excel formulae",aliases:["xlsx","xls"],case_insensitive:!0,keywords:{$pattern:/[a-zA-Z][\w\.]*/,built_in:"ABS ACCRINT ACCRINTM ACOS ACOSH ACOT ACOTH AGGREGATE ADDRESS AMORDEGRC AMORLINC AND ARABIC AREAS ASC ASIN ASINH ATAN ATAN2 ATANH AVEDEV AVERAGE AVERAGEA AVERAGEIF AVERAGEIFS BAHTTEXT BASE BESSELI BESSELJ BESSELK BESSELY BETADIST BETA.DIST BETAINV BETA.INV BIN2DEC BIN2HEX BIN2OCT BINOMDIST BINOM.DIST BINOM.DIST.RANGE BINOM.INV BITAND BITLSHIFT BITOR BITRSHIFT BITXOR CALL CEILING CEILING.MATH CEILING.PRECISE CELL CHAR CHIDIST CHIINV CHITEST CHISQ.DIST CHISQ.DIST.RT CHISQ.INV CHISQ.INV.RT CHISQ.TEST CHOOSE CLEAN CODE COLUMN COLUMNS COMBIN COMBINA COMPLEX CONCAT CONCATENATE CONFIDENCE CONFIDENCE.NORM CONFIDENCE.T CONVERT CORREL COS COSH COT COTH COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS COUPDAYBS COUPDAYS COUPDAYSNC COUPNCD COUPNUM COUPPCD COVAR COVARIANCE.P COVARIANCE.S CRITBINOM CSC CSCH CUBEKPIMEMBER CUBEMEMBER CUBEMEMBERPROPERTY CUBERANKEDMEMBER CUBESET CUBESETCOUNT CUBEVALUE CUMIPMT CUMPRINC DATE DATEDIF DATEVALUE DAVERAGE DAY DAYS DAYS360 DB DBCS DCOUNT DCOUNTA DDB DEC2BIN DEC2HEX DEC2OCT DECIMAL DEGREES DELTA DEVSQ DGET DISC DMAX DMIN DOLLAR DOLLARDE DOLLARFR DPRODUCT DSTDEV DSTDEVP DSUM DURATION DVAR DVARP EDATE EFFECT ENCODEURL EOMONTH ERF ERF.PRECISE ERFC ERFC.PRECISE ERROR.TYPE EUROCONVERT EVEN EXACT EXP EXPON.DIST EXPONDIST FACT FACTDOUBLE FALSE|0 F.DIST FDIST F.DIST.RT FILTERXML FIND FINDB F.INV F.INV.RT FINV FISHER FISHERINV FIXED FLOOR FLOOR.MATH FLOOR.PRECISE FORECAST FORECAST.ETS FORECAST.ETS.CONFINT FORECAST.ETS.SEASONALITY FORECAST.ETS.STAT FORECAST.LINEAR FORMULATEXT FREQUENCY F.TEST FTEST FV FVSCHEDULE GAMMA GAMMA.DIST GAMMADIST GAMMA.INV GAMMAINV GAMMALN GAMMALN.PRECISE GAUSS GCD GEOMEAN GESTEP GETPIVOTDATA GROWTH HARMEAN HEX2BIN HEX2DEC HEX2OCT HLOOKUP HOUR HYPERLINK HYPGEOM.DIST HYPGEOMDIST IF IFERROR IFNA IFS IMABS IMAGINARY IMARGUMENT IMCONJUGATE IMCOS IMCOSH IMCOT IMCSC IMCSCH IMDIV IMEXP IMLN IMLOG10 IMLOG2 IMPOWER IMPRODUCT IMREAL IMSEC IMSECH IMSIN IMSINH IMSQRT IMSUB IMSUM IMTAN INDEX INDIRECT INFO INT INTERCEPT INTRATE IPMT IRR ISBLANK ISERR ISERROR ISEVEN ISFORMULA ISLOGICAL ISNA ISNONTEXT ISNUMBER ISODD ISREF ISTEXT ISO.CEILING ISOWEEKNUM ISPMT JIS KURT LARGE LCM LEFT LEFTB LEN LENB LINEST LN LOG LOG10 LOGEST LOGINV LOGNORM.DIST LOGNORMDIST LOGNORM.INV LOOKUP LOWER MATCH MAX MAXA MAXIFS MDETERM MDURATION MEDIAN MID MIDBs MIN MINIFS MINA MINUTE MINVERSE MIRR MMULT MOD MODE MODE.MULT MODE.SNGL MONTH MROUND MULTINOMIAL MUNIT N NA NEGBINOM.DIST NEGBINOMDIST NETWORKDAYS NETWORKDAYS.INTL NOMINAL NORM.DIST NORMDIST NORMINV NORM.INV NORM.S.DIST NORMSDIST NORM.S.INV NORMSINV NOT NOW NPER NPV NUMBERVALUE OCT2BIN OCT2DEC OCT2HEX ODD ODDFPRICE ODDFYIELD ODDLPRICE ODDLYIELD OFFSET OR PDURATION PEARSON PERCENTILE.EXC PERCENTILE.INC PERCENTILE PERCENTRANK.EXC PERCENTRANK.INC PERCENTRANK PERMUT PERMUTATIONA PHI PHONETIC PI PMT POISSON.DIST POISSON POWER PPMT PRICE PRICEDISC PRICEMAT PROB PRODUCT PROPER PV QUARTILE QUARTILE.EXC QUARTILE.INC QUOTIENT RADIANS RAND RANDBETWEEN RANK.AVG RANK.EQ RANK RATE RECEIVED REGISTER.ID REPLACE REPLACEB REPT RIGHT RIGHTB ROMAN ROUND ROUNDDOWN ROUNDUP ROW ROWS RRI RSQ RTD SEARCH SEARCHB SEC SECH SECOND SERIESSUM SHEET SHEETS SIGN SIN SINH SKEW SKEW.P SLN SLOPE SMALL SQL.REQUEST SQRT SQRTPI STANDARDIZE STDEV STDEV.P STDEV.S STDEVA STDEVP STDEVPA STEYX SUBSTITUTE SUBTOTAL SUM SUMIF SUMIFS SUMPRODUCT SUMSQ SUMX2MY2 SUMX2PY2 SUMXMY2 SWITCH SYD T TAN TANH TBILLEQ TBILLPRICE TBILLYIELD T.DIST T.DIST.2T T.DIST.RT TDIST TEXT TEXTJOIN TIME TIMEVALUE T.INV T.INV.2T TINV TODAY TRANSPOSE TREND TRIM TRIMMEAN TRUE|0 TRUNC T.TEST TTEST TYPE UNICHAR UNICODE UPPER VALUE VAR VAR.P VAR.S VARA VARP VARPA VDB VLOOKUP WEBSERVICE WEEKDAY WEEKNUM WEIBULL WEIBULL.DIST WORKDAY WORKDAY.INTL XIRR XNPV XOR YEAR YEARFRAC YIELD YIELDDISC YIELDMAT Z.TEST ZTEST"},contains:[{begin:/^=/,end:/[^=]/,returnEnd:!0,illegal:/=/,relevance:10},{className:"symbol",begin:/\b[A-Z]{1,2}\d+\b/,end:/[^\d]/,excludeEnd:!0,relevance:0},{className:"symbol",begin:/[A-Z]{0,2}\d*:[A-Z]{0,2}\d*/,relevance:0},t.BACKSLASH_ESCAPE,t.QUOTE_STRING_MODE,{className:"number",begin:t.NUMBER_RE+"(%)?",relevance:0},t.COMMENT(/\bN\(/,/\)/,{excludeBegin:!0,excludeEnd:!0,illegal:/\n/})]}}qPn.exports=ILi});var YPn=re((dcc,VPn)=>{p();function wLi(t){return{name:"FIX",contains:[{begin:/[^\u2401\u0001]+/,end:/[\u2401\u0001]/,excludeEnd:!0,returnBegin:!0,returnEnd:!1,contains:[{begin:/([^\u2401\u0001=]+)/,end:/=([^\u2401\u0001=]+)/,returnEnd:!0,returnBegin:!1,className:"attr"},{begin:/=/,end:/([\u2401\u0001])/,excludeEnd:!0,excludeBegin:!0,className:"string"}]}],case_insensitive:!0}}VPn.exports=wLi});var KPn=re((mcc,zPn)=>{p();function TLi(t){let e={className:"string",begin:/'(.|\\[xXuU][a-zA-Z0-9]+)'/},n={className:"string",variants:[{begin:'"',end:'"'}]},i={className:"function",beginKeywords:"def",end:/[:={\[(\n;]/,excludeEnd:!0,contains:[{className:"title",relevance:0,begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/}]};return{name:"Flix",keywords:{literal:"true false",keyword:"case class def else enum if impl import in lat rel index let match namespace switch type yield with"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e,n,i,t.C_NUMBER_MODE]}}zPn.exports=TLi});var XPn=re((fcc,JPn)=>{p();function vLi(t){return t?typeof t=="string"?t:t.source:null}function Uat(...t){return t.map(n=>vLi(n)).join("")}function RLi(t){let e={className:"params",begin:"\\(",end:"\\)"},n={variants:[t.COMMENT("!","$",{relevance:0}),t.COMMENT("^C[ ]","$",{relevance:0}),t.COMMENT("^C$","$",{relevance:0})]},r=/(_[a-z_\d]+)?/,i=/([de][+-]?\d+)?/,s={className:"number",variants:[{begin:Uat(/\b\d+/,/\.(\d*)/,i,r)},{begin:Uat(/\b\d+/,i,r)},{begin:Uat(/\.\d+/,i,r)}],relevance:0},o={className:"function",beginKeywords:"subroutine function program",illegal:"[${=\\n]",contains:[t.UNDERSCORE_TITLE_MODE,e]},a={className:"string",relevance:0,variants:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]};return{name:"Fortran",case_insensitive:!0,aliases:["f90","f95"],keywords:{literal:".False. .True.",keyword:"kind do concurrent local shared while private call intrinsic where elsewhere type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then block endblock endassociate public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. goto save else use module select case access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit continue format pause cycle exit c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg synchronous nopass non_overridable pass protected volatile abstract extends import non_intrinsic value deferred generic final enumerator class associate bind enum c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated c_f_pointer c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure impure integer real character complex logical codimension dimension allocatable|10 parameter external implicit|10 none double precision assign intent optional pointer target in out common equivalence data",built_in:"alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image sync change team co_broadcast co_max co_min co_sum co_reduce"},illegal:/\/\*/,contains:[a,o,{begin:/^C\s*=(?!=)/,relevance:0},n,s]}}JPn.exports=RLi});var eMn=re((Acc,ZPn)=>{p();function kLi(t){let e={begin:"<",end:">",contains:[t.inherit(t.TITLE_MODE,{begin:/'[a-zA-Z0-9_]+/})]};return{name:"F#",aliases:["fs"],keywords:"abstract and as assert base begin class default delegate do done downcast downto elif else end exception extern false finally for fun function global if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield",illegal:/\/\*/,contains:[{className:"keyword",begin:/\b(yield|return|let|do)!/},{className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},{className:"string",begin:'"""',end:'"""'},t.COMMENT("\\(\\*(\\s)","\\*\\)",{contains:["self"]}),{className:"class",beginKeywords:"type",end:"\\(|=|$",excludeEnd:!0,contains:[t.UNDERSCORE_TITLE_MODE,e]},{className:"meta",begin:"\\[<",end:">\\]",relevance:10},{className:"symbol",begin:"\\B('[A-Za-z])\\b",contains:[t.BACKSLASH_ESCAPE]},t.C_LINE_COMMENT_MODE,t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),t.C_NUMBER_MODE]}}ZPn.exports=kLi});var nMn=re((Ecc,tMn)=>{p();function BLi(t){return t?typeof t=="string"?t:t.source:null}function NLi(t){return Gat("(",t,")*")}function Gat(...t){return t.map(n=>BLi(n)).join("")}function DLi(t){let e={keyword:"abort acronym acronyms alias all and assign binary card diag display else eq file files for free ge gt if integer le loop lt maximizing minimizing model models ne negative no not option options or ord positive prod put putpage puttl repeat sameas semicont semiint smax smin solve sos1 sos2 sum system table then until using while xor yes",literal:"eps inf na",built_in:"abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power randBinomial randLinear randTriangle round rPower sigmoid sign signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion handleCollect handleDelete handleStatus handleSubmit heapFree heapLimit heapSize jobHandle jobKill jobStatus jobTerminate licenseLevel licenseStatus maxExecError sleep timeClose timeComp timeElapsed timeExec timeStart"},n={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0},r={className:"symbol",variants:[{begin:/=[lgenxc]=/},{begin:/\$/}]},i={className:"comment",variants:[{begin:"'",end:"'"},{begin:'"',end:'"'}],illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},s={begin:"/",end:"/",keywords:e,contains:[i,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,t.C_NUMBER_MODE]},o=/[a-z0-9&#*=?@\\><:,()$[\]_.{}!+%^-]+/,a={begin:/[a-z][a-z0-9_]*(\([a-z0-9_, ]*\))?[ \t]+/,excludeBegin:!0,end:"$",endsWithParent:!0,contains:[i,s,{className:"comment",begin:Gat(o,NLi(Gat(/[ ]+/,o))),relevance:0}]};return{name:"GAMS",aliases:["gms"],case_insensitive:!0,keywords:e,contains:[t.COMMENT(/^\$ontext/,/^\$offtext/),{className:"meta",begin:"^\\$[a-z0-9]+",end:"$",returnBegin:!0,contains:[{className:"meta-keyword",begin:"^\\$[a-z0-9]+"}]},t.COMMENT("^\\*","$"),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{beginKeywords:"set sets parameter parameters variable variables scalar scalars equation equations",end:";",contains:[t.COMMENT("^\\*","$"),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,s,a]},{beginKeywords:"table",end:";",returnBegin:!0,contains:[{beginKeywords:"table",end:"$",contains:[a]},t.COMMENT("^\\*","$"),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,t.C_NUMBER_MODE]},{className:"function",begin:/^[a-z][a-z0-9_,\-+' ()$]+\.{2}/,returnBegin:!0,contains:[{className:"title",begin:/^[a-z0-9_]+/},n,r]},t.C_NUMBER_MODE,r]}}tMn.exports=DLi});var iMn=re((_cc,rMn)=>{p();function PLi(t){let e={keyword:"bool break call callexe checkinterrupt clear clearg closeall cls comlog compile continue create debug declare delete disable dlibrary dllcall do dos ed edit else elseif enable end endfor endif endp endo errorlog errorlogat expr external fn for format goto gosub graph if keyword let lib library line load loadarray loadexe loadf loadk loadm loadp loads loadx local locate loopnextindex lprint lpwidth lshow matrix msym ndpclex new open output outwidth plot plotsym pop prcsn print printdos proc push retp return rndcon rndmod rndmult rndseed run save saveall screen scroll setarray show sparse stop string struct system trace trap threadfor threadendfor threadbegin threadjoin threadstat threadend until use while winprint ne ge le gt lt and xor or not eq eqv",built_in:"abs acf aconcat aeye amax amean AmericanBinomCall AmericanBinomCall_Greeks AmericanBinomCall_ImpVol AmericanBinomPut AmericanBinomPut_Greeks AmericanBinomPut_ImpVol AmericanBSCall AmericanBSCall_Greeks AmericanBSCall_ImpVol AmericanBSPut AmericanBSPut_Greeks AmericanBSPut_ImpVol amin amult annotationGetDefaults annotationSetBkd annotationSetFont annotationSetLineColor annotationSetLineStyle annotationSetLineThickness annualTradingDays arccos arcsin areshape arrayalloc arrayindex arrayinit arraytomat asciiload asclabel astd astds asum atan atan2 atranspose axmargin balance band bandchol bandcholsol bandltsol bandrv bandsolpd bar base10 begwind besselj bessely beta box boxcox cdfBeta cdfBetaInv cdfBinomial cdfBinomialInv cdfBvn cdfBvn2 cdfBvn2e cdfCauchy cdfCauchyInv cdfChic cdfChii cdfChinc cdfChincInv cdfExp cdfExpInv cdfFc cdfFnc cdfFncInv cdfGam cdfGenPareto cdfHyperGeo cdfLaplace cdfLaplaceInv cdfLogistic cdfLogisticInv cdfmControlCreate cdfMvn cdfMvn2e cdfMvnce cdfMvne cdfMvt2e cdfMvtce cdfMvte cdfN cdfN2 cdfNc cdfNegBinomial cdfNegBinomialInv cdfNi cdfPoisson cdfPoissonInv cdfRayleigh cdfRayleighInv cdfTc cdfTci cdfTnc cdfTvn cdfWeibull cdfWeibullInv cdir ceil ChangeDir chdir chiBarSquare chol choldn cholsol cholup chrs close code cols colsf combinate combinated complex con cond conj cons ConScore contour conv convertsatostr convertstrtosa corrm corrms corrvc corrx corrxs cos cosh counts countwts crossprd crout croutp csrcol csrlin csvReadM csvReadSA cumprodc cumsumc curve cvtos datacreate datacreatecomplex datalist dataload dataloop dataopen datasave date datestr datestring datestrymd dayinyr dayofweek dbAddDatabase dbClose dbCommit dbCreateQuery dbExecQuery dbGetConnectOptions dbGetDatabaseName dbGetDriverName dbGetDrivers dbGetHostName dbGetLastErrorNum dbGetLastErrorText dbGetNumericalPrecPolicy dbGetPassword dbGetPort dbGetTableHeaders dbGetTables dbGetUserName dbHasFeature dbIsDriverAvailable dbIsOpen dbIsOpenError dbOpen dbQueryBindValue dbQueryClear dbQueryCols dbQueryExecPrepared dbQueryFetchAllM dbQueryFetchAllSA dbQueryFetchOneM dbQueryFetchOneSA dbQueryFinish dbQueryGetBoundValue dbQueryGetBoundValues dbQueryGetField dbQueryGetLastErrorNum dbQueryGetLastErrorText dbQueryGetLastInsertID dbQueryGetLastQuery dbQueryGetPosition dbQueryIsActive dbQueryIsForwardOnly dbQueryIsNull dbQueryIsSelect dbQueryIsValid dbQueryPrepare dbQueryRows dbQuerySeek dbQuerySeekFirst dbQuerySeekLast dbQuerySeekNext dbQuerySeekPrevious dbQuerySetForwardOnly dbRemoveDatabase dbRollback dbSetConnectOptions dbSetDatabaseName dbSetHostName dbSetNumericalPrecPolicy dbSetPort dbSetUserName dbTransaction DeleteFile delif delrows denseToSp denseToSpRE denToZero design det detl dfft dffti diag diagrv digamma doswin DOSWinCloseall DOSWinOpen dotfeq dotfeqmt dotfge dotfgemt dotfgt dotfgtmt dotfle dotflemt dotflt dotfltmt dotfne dotfnemt draw drop dsCreate dstat dstatmt dstatmtControlCreate dtdate dtday dttime dttodtv dttostr dttoutc dtvnormal dtvtodt dtvtoutc dummy dummybr dummydn eig eigh eighv eigv elapsedTradingDays endwind envget eof eqSolve eqSolvemt eqSolvemtControlCreate eqSolvemtOutCreate eqSolveset erf erfc erfccplx erfcplx error etdays ethsec etstr EuropeanBinomCall EuropeanBinomCall_Greeks EuropeanBinomCall_ImpVol EuropeanBinomPut EuropeanBinomPut_Greeks EuropeanBinomPut_ImpVol EuropeanBSCall EuropeanBSCall_Greeks EuropeanBSCall_ImpVol EuropeanBSPut EuropeanBSPut_Greeks EuropeanBSPut_ImpVol exctsmpl exec execbg exp extern eye fcheckerr fclearerr feq feqmt fflush fft ffti fftm fftmi fftn fge fgemt fgets fgetsa fgetsat fgetst fgt fgtmt fileinfo filesa fle flemt floor flt fltmt fmod fne fnemt fonts fopen formatcv formatnv fputs fputst fseek fstrerror ftell ftocv ftos ftostrC gamma gammacplx gammaii gausset gdaAppend gdaCreate gdaDStat gdaDStatMat gdaGetIndex gdaGetName gdaGetNames gdaGetOrders gdaGetType gdaGetTypes gdaGetVarInfo gdaIsCplx gdaLoad gdaPack gdaRead gdaReadByIndex gdaReadSome gdaReadSparse gdaReadStruct gdaReportVarInfo gdaSave gdaUpdate gdaUpdateAndPack gdaVars gdaWrite gdaWrite32 gdaWriteSome getarray getdims getf getGAUSShome getmatrix getmatrix4D getname getnamef getNextTradingDay getNextWeekDay getnr getorders getpath getPreviousTradingDay getPreviousWeekDay getRow getscalar3D getscalar4D getTrRow getwind glm gradcplx gradMT gradMTm gradMTT gradMTTm gradp graphprt graphset hasimag header headermt hess hessMT hessMTg hessMTgw hessMTm hessMTmw hessMTT hessMTTg hessMTTgw hessMTTm hessMTw hessp hist histf histp hsec imag indcv indexcat indices indices2 indicesf indicesfn indnv indsav integrate1d integrateControlCreate intgrat2 intgrat3 inthp1 inthp2 inthp3 inthp4 inthpControlCreate intquad1 intquad2 intquad3 intrleav intrleavsa intrsect intsimp inv invpd invswp iscplx iscplxf isden isinfnanmiss ismiss key keyav keyw lag lag1 lagn lapEighb lapEighi lapEighvb lapEighvi lapgEig lapgEigh lapgEighv lapgEigv lapgSchur lapgSvdcst lapgSvds lapgSvdst lapSvdcusv lapSvds lapSvdusv ldlp ldlsol linSolve listwise ln lncdfbvn lncdfbvn2 lncdfmvn lncdfn lncdfn2 lncdfnc lnfact lngammacplx lnpdfmvn lnpdfmvt lnpdfn lnpdft loadd loadstruct loadwind loess loessmt loessmtControlCreate log loglog logx logy lower lowmat lowmat1 ltrisol lu lusol machEpsilon make makevars makewind margin matalloc matinit mattoarray maxbytes maxc maxindc maxv maxvec mbesselei mbesselei0 mbesselei1 mbesseli mbesseli0 mbesseli1 meanc median mergeby mergevar minc minindc minv miss missex missrv moment momentd movingave movingaveExpwgt movingaveWgt nextindex nextn nextnevn nextwind ntos null null1 numCombinations ols olsmt olsmtControlCreate olsqr olsqr2 olsqrmt ones optn optnevn orth outtyp pacf packedToSp packr parse pause pdfCauchy pdfChi pdfExp pdfGenPareto pdfHyperGeo pdfLaplace pdfLogistic pdfn pdfPoisson pdfRayleigh pdfWeibull pi pinv pinvmt plotAddArrow plotAddBar plotAddBox plotAddHist plotAddHistF plotAddHistP plotAddPolar plotAddScatter plotAddShape plotAddTextbox plotAddTS plotAddXY plotArea plotBar plotBox plotClearLayout plotContour plotCustomLayout plotGetDefaults plotHist plotHistF plotHistP plotLayout plotLogLog plotLogX plotLogY plotOpenWindow plotPolar plotSave plotScatter plotSetAxesPen plotSetBar plotSetBarFill plotSetBarStacked plotSetBkdColor plotSetFill plotSetGrid plotSetLegend plotSetLineColor plotSetLineStyle plotSetLineSymbol plotSetLineThickness plotSetNewWindow plotSetTitle plotSetWhichYAxis plotSetXAxisShow plotSetXLabel plotSetXRange plotSetXTicInterval plotSetXTicLabel plotSetYAxisShow plotSetYLabel plotSetYRange plotSetZAxisShow plotSetZLabel plotSurface plotTS plotXY polar polychar polyeval polygamma polyint polymake polymat polymroot polymult polyroot pqgwin previousindex princomp printfm printfmt prodc psi putarray putf putvals pvCreate pvGetIndex pvGetParNames pvGetParVector pvLength pvList pvPack pvPacki pvPackm pvPackmi pvPacks pvPacksi pvPacksm pvPacksmi pvPutParVector pvTest pvUnpack QNewton QNewtonmt QNewtonmtControlCreate QNewtonmtOutCreate QNewtonSet QProg QProgmt QProgmtInCreate qqr qqre qqrep qr qre qrep qrsol qrtsol qtyr qtyre qtyrep quantile quantiled qyr qyre qyrep qz rank rankindx readr real reclassify reclassifyCuts recode recserar recsercp recserrc rerun rescale reshape rets rev rfft rffti rfftip rfftn rfftnp rfftp rndBernoulli rndBeta rndBinomial rndCauchy rndChiSquare rndCon rndCreateState rndExp rndGamma rndGeo rndGumbel rndHyperGeo rndi rndKMbeta rndKMgam rndKMi rndKMn rndKMnb rndKMp rndKMu rndKMvm rndLaplace rndLCbeta rndLCgam rndLCi rndLCn rndLCnb rndLCp rndLCu rndLCvm rndLogNorm rndMTu rndMVn rndMVt rndn rndnb rndNegBinomial rndp rndPoisson rndRayleigh rndStateSkip rndu rndvm rndWeibull rndWishart rotater round rows rowsf rref sampleData satostrC saved saveStruct savewind scale scale3d scalerr scalinfnanmiss scalmiss schtoc schur searchsourcepath seekr select selif seqa seqm setdif setdifsa setvars setvwrmode setwind shell shiftr sin singleindex sinh sleep solpd sortc sortcc sortd sorthc sorthcc sortind sortindc sortmc sortr sortrc spBiconjGradSol spChol spConjGradSol spCreate spDenseSubmat spDiagRvMat spEigv spEye spLDL spline spLU spNumNZE spOnes spreadSheetReadM spreadSheetReadSA spreadSheetWrite spScale spSubmat spToDense spTrTDense spTScalar spZeros sqpSolve sqpSolveMT sqpSolveMTControlCreate sqpSolveMTlagrangeCreate sqpSolveMToutCreate sqpSolveSet sqrt statements stdc stdsc stocv stof strcombine strindx strlen strput strrindx strsect strsplit strsplitPad strtodt strtof strtofcplx strtriml strtrimr strtrunc strtruncl strtruncpad strtruncr submat subscat substute subvec sumc sumr surface svd svd1 svd2 svdcusv svds svdusv sysstate tab tan tanh tempname time timedt timestr timeutc title tkf2eps tkf2ps tocart todaydt toeplitz token topolar trapchk trigamma trimr trunc type typecv typef union unionsa uniqindx uniqindxsa unique uniquesa upmat upmat1 upper utctodt utctodtv utrisol vals varCovMS varCovXS varget vargetl varmall varmares varput varputl vartypef vcm vcms vcx vcxs vec vech vecr vector vget view viewxyz vlist vnamecv volume vput vread vtypecv wait waitc walkindex where window writer xlabel xlsGetSheetCount xlsGetSheetSize xlsGetSheetTypes xlsMakeRange xlsReadM xlsReadSA xlsWrite xlsWriteM xlsWriteSA xpnd xtics xy xyz ylabel ytics zeros zeta zlabel ztics cdfEmpirical dot h5create h5open h5read h5readAttribute h5write h5writeAttribute ldl plotAddErrorBar plotAddSurface plotCDFEmpirical plotSetColormap plotSetContourLabels plotSetLegendFont plotSetTextInterpreter plotSetXTicCount plotSetYTicCount plotSetZLevels powerm strjoin sylvester strtrim",literal:"DB_AFTER_LAST_ROW DB_ALL_TABLES DB_BATCH_OPERATIONS DB_BEFORE_FIRST_ROW DB_BLOB DB_EVENT_NOTIFICATIONS DB_FINISH_QUERY DB_HIGH_PRECISION DB_LAST_INSERT_ID DB_LOW_PRECISION_DOUBLE DB_LOW_PRECISION_INT32 DB_LOW_PRECISION_INT64 DB_LOW_PRECISION_NUMBERS DB_MULTIPLE_RESULT_SETS DB_NAMED_PLACEHOLDERS DB_POSITIONAL_PLACEHOLDERS DB_PREPARED_QUERIES DB_QUERY_SIZE DB_SIMPLE_LOCKING DB_SYSTEM_TABLES DB_TABLES DB_TRANSACTIONS DB_UNICODE DB_VIEWS __STDIN __STDOUT __STDERR __FILE_DIR"},n=t.COMMENT("@","@"),r={className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"define definecs|10 undef ifdef ifndef iflight ifdllcall ifmac ifos2win ifunix else endif lineson linesoff srcfile srcline"},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",end:"$",keywords:{"meta-keyword":"include"},contains:[{className:"meta-string",begin:'"',end:'"',illegal:"\\n"}]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,n]},i={begin:/\bstruct\s+/,end:/\s/,keywords:"struct",contains:[{className:"type",begin:t.UNDERSCORE_IDENT_RE,relevance:0}]},s=[{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,endsWithParent:!0,relevance:0,contains:[{className:"literal",begin:/\.\.\./},t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,i]}],o={className:"title",begin:t.UNDERSCORE_IDENT_RE,relevance:0},a=function(m,h,f){let g=t.inherit({className:"function",beginKeywords:m,end:h,excludeEnd:!0,contains:[].concat(s)},f||{});return g.contains.push(o),g.contains.push(t.C_NUMBER_MODE),g.contains.push(t.C_BLOCK_COMMENT_MODE),g.contains.push(n),g},c={className:"built_in",begin:"\\b("+e.built_in.split(" ").join("|")+")\\b"},u={className:"string",begin:'"',end:'"',contains:[t.BACKSLASH_ESCAPE],relevance:0},l={begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,keywords:e,relevance:0,contains:[{beginKeywords:e.keyword},c,{className:"built_in",begin:t.UNDERSCORE_IDENT_RE,relevance:0}]},d={begin:/\(/,end:/\)/,relevance:0,keywords:{built_in:e.built_in,literal:e.literal},contains:[t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,c,l,u,"self"]};return l.contains.push(d),{name:"GAUSS",aliases:["gss"],case_insensitive:!0,keywords:e,illegal:/(\{[%#]|[%#]\}| <- )/,contains:[t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,n,u,r,{className:"keyword",begin:/\bexternal (matrix|string|array|sparse matrix|struct|proc|keyword|fn)/},a("proc keyword",";"),a("fn","="),{beginKeywords:"for threadfor",end:/;/,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE,n,d]},{variants:[{begin:t.UNDERSCORE_IDENT_RE+"\\."+t.UNDERSCORE_IDENT_RE},{begin:t.UNDERSCORE_IDENT_RE+"\\s*="}],relevance:0},l,i]}}rMn.exports=PLi});var oMn=re((Scc,sMn)=>{p();function MLi(t){let r={$pattern:"[A-Z_][A-Z0-9_.]*",keyword:"IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT EQ LT GT NE GE LE OR XOR"},i={className:"meta",begin:"([O])([0-9]+)"},s=t.inherit(t.C_NUMBER_MODE,{begin:"([-+]?((\\.\\d+)|(\\d+)(\\.\\d*)?))|"+t.C_NUMBER_RE}),o=[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.COMMENT(/\(/,/\)/),s,t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"name",begin:"([G])([0-9]+\\.?[0-9]?)"},{className:"name",begin:"([M])([0-9]+\\.?[0-9]?)"},{className:"attr",begin:"(VC|VS|#)",end:"(\\d+)"},{className:"attr",begin:"(VZOFX|VZOFY|VZOFZ)"},{className:"built_in",begin:"(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\[)",contains:[s],end:"\\]"},{className:"symbol",variants:[{begin:"N",end:"\\d+",illegal:"\\W"}]}];return{name:"G-code (ISO 6983)",aliases:["nc"],case_insensitive:!0,keywords:r,contains:[{className:"meta",begin:"%"},i].concat(o)}}sMn.exports=MLi});var cMn=re((Icc,aMn)=>{p();function OLi(t){return{name:"Gherkin",aliases:["feature"],keywords:"Feature Background Ability Business Need Scenario Scenarios Scenario Outline Scenario Template Examples Given And Then But When",contains:[{className:"symbol",begin:"\\*",relevance:0},{className:"meta",begin:"@[^@\\s]+"},{begin:"\\|",end:"\\|\\w*$",contains:[{className:"string",begin:"[^|]+"}]},{className:"variable",begin:"<",end:">"},t.HASH_COMMENT_MODE,{className:"string",begin:'"""',end:'"""'},t.QUOTE_STRING_MODE]}}aMn.exports=OLi});var uMn=re((Tcc,lMn)=>{p();function LLi(t){return{name:"GLSL",keywords:{keyword:"break continue discard do else for if return while switch case default attribute binding buffer ccw centroid centroid varying coherent column_major const cw depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip triangles triangles_adjacency uniform varying vertices volatile writeonly",type:"atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void",built_in:"gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow",literal:"true false"},illegal:'"',contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"#",end:"$"}]}}lMn.exports=LLi});var pMn=re((Rcc,dMn)=>{p();function FLi(t){return{name:"GML",case_insensitive:!1,keywords:{keyword:"begin end if then else while do for break continue with until repeat exit and or xor not return mod div switch case default var globalvar enum function constructor delete #macro #region #endregion",built_in:"is_real is_string is_array is_undefined is_int32 is_int64 is_ptr is_vec3 is_vec4 is_matrix is_bool is_method is_struct is_infinity is_nan is_numeric typeof variable_global_exists variable_global_get variable_global_set variable_instance_exists variable_instance_get variable_instance_set variable_instance_get_names variable_struct_exists variable_struct_get variable_struct_get_names variable_struct_names_count variable_struct_remove variable_struct_set array_delete array_insert array_length array_length_1d array_length_2d array_height_2d array_equals array_create array_copy array_pop array_push array_resize array_sort random random_range irandom irandom_range random_set_seed random_get_seed randomize randomise choose abs round floor ceil sign frac sqrt sqr exp ln log2 log10 sin cos tan arcsin arccos arctan arctan2 dsin dcos dtan darcsin darccos darctan darctan2 degtorad radtodeg power logn min max mean median clamp lerp dot_product dot_product_3d dot_product_normalised dot_product_3d_normalised dot_product_normalized dot_product_3d_normalized math_set_epsilon math_get_epsilon angle_difference point_distance_3d point_distance point_direction lengthdir_x lengthdir_y real string int64 ptr string_format chr ansi_char ord string_length string_byte_length string_pos string_copy string_char_at string_ord_at string_byte_at string_set_byte_at string_delete string_insert string_lower string_upper string_repeat string_letters string_digits string_lettersdigits string_replace string_replace_all string_count string_hash_to_newline clipboard_has_text clipboard_set_text clipboard_get_text date_current_datetime date_create_datetime date_valid_datetime date_inc_year date_inc_month date_inc_week date_inc_day date_inc_hour date_inc_minute date_inc_second date_get_year date_get_month date_get_week date_get_day date_get_hour date_get_minute date_get_second date_get_weekday date_get_day_of_year date_get_hour_of_year date_get_minute_of_year date_get_second_of_year date_year_span date_month_span date_week_span date_day_span date_hour_span date_minute_span date_second_span date_compare_datetime date_compare_date date_compare_time date_date_of date_time_of date_datetime_string date_date_string date_time_string date_days_in_month date_days_in_year date_leap_year date_is_today date_set_timezone date_get_timezone game_set_speed game_get_speed motion_set motion_add place_free place_empty place_meeting place_snapped move_random move_snap move_towards_point move_contact_solid move_contact_all move_outside_solid move_outside_all move_bounce_solid move_bounce_all move_wrap distance_to_point distance_to_object position_empty position_meeting path_start path_end mp_linear_step mp_potential_step mp_linear_step_object mp_potential_step_object mp_potential_settings mp_linear_path mp_potential_path mp_linear_path_object mp_potential_path_object mp_grid_create mp_grid_destroy mp_grid_clear_all mp_grid_clear_cell mp_grid_clear_rectangle mp_grid_add_cell mp_grid_get_cell mp_grid_add_rectangle mp_grid_add_instances mp_grid_path mp_grid_draw mp_grid_to_ds_grid collision_point collision_rectangle collision_circle collision_ellipse collision_line collision_point_list collision_rectangle_list collision_circle_list collision_ellipse_list collision_line_list instance_position_list instance_place_list point_in_rectangle point_in_triangle point_in_circle rectangle_in_rectangle rectangle_in_triangle rectangle_in_circle instance_find instance_exists instance_number instance_position instance_nearest instance_furthest instance_place instance_create_depth instance_create_layer instance_copy instance_change instance_destroy position_destroy position_change instance_id_get instance_deactivate_all instance_deactivate_object instance_deactivate_region instance_activate_all instance_activate_object instance_activate_region room_goto room_goto_previous room_goto_next room_previous room_next room_restart game_end game_restart game_load game_save game_save_buffer game_load_buffer event_perform event_user event_perform_object event_inherited show_debug_message show_debug_overlay debug_event debug_get_callstack alarm_get alarm_set font_texture_page_size keyboard_set_map keyboard_get_map keyboard_unset_map keyboard_check keyboard_check_pressed keyboard_check_released keyboard_check_direct keyboard_get_numlock keyboard_set_numlock keyboard_key_press keyboard_key_release keyboard_clear io_clear mouse_check_button mouse_check_button_pressed mouse_check_button_released mouse_wheel_up mouse_wheel_down mouse_clear draw_self draw_sprite draw_sprite_pos draw_sprite_ext draw_sprite_stretched draw_sprite_stretched_ext draw_sprite_tiled draw_sprite_tiled_ext draw_sprite_part draw_sprite_part_ext draw_sprite_general draw_clear draw_clear_alpha draw_point draw_line draw_line_width draw_rectangle draw_roundrect draw_roundrect_ext draw_triangle draw_circle draw_ellipse draw_set_circle_precision draw_arrow draw_button draw_path draw_healthbar draw_getpixel draw_getpixel_ext draw_set_colour draw_set_color draw_set_alpha draw_get_colour draw_get_color draw_get_alpha merge_colour make_colour_rgb make_colour_hsv colour_get_red colour_get_green colour_get_blue colour_get_hue colour_get_saturation colour_get_value merge_color make_color_rgb make_color_hsv color_get_red color_get_green color_get_blue color_get_hue color_get_saturation color_get_value merge_color screen_save screen_save_part draw_set_font draw_set_halign draw_set_valign draw_text draw_text_ext string_width string_height string_width_ext string_height_ext draw_text_transformed draw_text_ext_transformed draw_text_colour draw_text_ext_colour draw_text_transformed_colour draw_text_ext_transformed_colour draw_text_color draw_text_ext_color draw_text_transformed_color draw_text_ext_transformed_color draw_point_colour draw_line_colour draw_line_width_colour draw_rectangle_colour draw_roundrect_colour draw_roundrect_colour_ext draw_triangle_colour draw_circle_colour draw_ellipse_colour draw_point_color draw_line_color draw_line_width_color draw_rectangle_color draw_roundrect_color draw_roundrect_color_ext draw_triangle_color draw_circle_color draw_ellipse_color draw_primitive_begin draw_vertex draw_vertex_colour draw_vertex_color draw_primitive_end sprite_get_uvs font_get_uvs sprite_get_texture font_get_texture texture_get_width texture_get_height texture_get_uvs draw_primitive_begin_texture draw_vertex_texture draw_vertex_texture_colour draw_vertex_texture_color texture_global_scale surface_create surface_create_ext surface_resize surface_free surface_exists surface_get_width surface_get_height surface_get_texture surface_set_target surface_set_target_ext surface_reset_target surface_depth_disable surface_get_depth_disable draw_surface draw_surface_stretched draw_surface_tiled draw_surface_part draw_surface_ext draw_surface_stretched_ext draw_surface_tiled_ext draw_surface_part_ext draw_surface_general surface_getpixel surface_getpixel_ext surface_save surface_save_part surface_copy surface_copy_part application_surface_draw_enable application_get_position application_surface_enable application_surface_is_enabled display_get_width display_get_height display_get_orientation display_get_gui_width display_get_gui_height display_reset display_mouse_get_x display_mouse_get_y display_mouse_set display_set_ui_visibility window_set_fullscreen window_get_fullscreen window_set_caption window_set_min_width window_set_max_width window_set_min_height window_set_max_height window_get_visible_rects window_get_caption window_set_cursor window_get_cursor window_set_colour window_get_colour window_set_color window_get_color window_set_position window_set_size window_set_rectangle window_center window_get_x window_get_y window_get_width window_get_height window_mouse_get_x window_mouse_get_y window_mouse_set window_view_mouse_get_x window_view_mouse_get_y window_views_mouse_get_x window_views_mouse_get_y audio_listener_position audio_listener_velocity audio_listener_orientation audio_emitter_position audio_emitter_create audio_emitter_free audio_emitter_exists audio_emitter_pitch audio_emitter_velocity audio_emitter_falloff audio_emitter_gain audio_play_sound audio_play_sound_on audio_play_sound_at audio_stop_sound audio_resume_music audio_music_is_playing audio_resume_sound audio_pause_sound audio_pause_music audio_channel_num audio_sound_length audio_get_type audio_falloff_set_model audio_play_music audio_stop_music audio_master_gain audio_music_gain audio_sound_gain audio_sound_pitch audio_stop_all audio_resume_all audio_pause_all audio_is_playing audio_is_paused audio_exists audio_sound_set_track_position audio_sound_get_track_position audio_emitter_get_gain audio_emitter_get_pitch audio_emitter_get_x audio_emitter_get_y audio_emitter_get_z audio_emitter_get_vx audio_emitter_get_vy audio_emitter_get_vz audio_listener_set_position audio_listener_set_velocity audio_listener_set_orientation audio_listener_get_data audio_set_master_gain audio_get_master_gain audio_sound_get_gain audio_sound_get_pitch audio_get_name audio_sound_set_track_position audio_sound_get_track_position audio_create_stream audio_destroy_stream audio_create_sync_group audio_destroy_sync_group audio_play_in_sync_group audio_start_sync_group audio_stop_sync_group audio_pause_sync_group audio_resume_sync_group audio_sync_group_get_track_pos audio_sync_group_debug audio_sync_group_is_playing audio_debug audio_group_load audio_group_unload audio_group_is_loaded audio_group_load_progress audio_group_name audio_group_stop_all audio_group_set_gain audio_create_buffer_sound audio_free_buffer_sound audio_create_play_queue audio_free_play_queue audio_queue_sound audio_get_recorder_count audio_get_recorder_info audio_start_recording audio_stop_recording audio_sound_get_listener_mask audio_emitter_get_listener_mask audio_get_listener_mask audio_sound_set_listener_mask audio_emitter_set_listener_mask audio_set_listener_mask audio_get_listener_count audio_get_listener_info audio_system show_message show_message_async clickable_add clickable_add_ext clickable_change clickable_change_ext clickable_delete clickable_exists clickable_set_style show_question show_question_async get_integer get_string get_integer_async get_string_async get_login_async get_open_filename get_save_filename get_open_filename_ext get_save_filename_ext show_error highscore_clear highscore_add highscore_value highscore_name draw_highscore sprite_exists sprite_get_name sprite_get_number sprite_get_width sprite_get_height sprite_get_xoffset sprite_get_yoffset sprite_get_bbox_left sprite_get_bbox_right sprite_get_bbox_top sprite_get_bbox_bottom sprite_save sprite_save_strip sprite_set_cache_size sprite_set_cache_size_ext sprite_get_tpe sprite_prefetch sprite_prefetch_multi sprite_flush sprite_flush_multi sprite_set_speed sprite_get_speed_type sprite_get_speed font_exists font_get_name font_get_fontname font_get_bold font_get_italic font_get_first font_get_last font_get_size font_set_cache_size path_exists path_get_name path_get_length path_get_time path_get_kind path_get_closed path_get_precision path_get_number path_get_point_x path_get_point_y path_get_point_speed path_get_x path_get_y path_get_speed script_exists script_get_name timeline_add timeline_delete timeline_clear timeline_exists timeline_get_name timeline_moment_clear timeline_moment_add_script timeline_size timeline_max_moment object_exists object_get_name object_get_sprite object_get_solid object_get_visible object_get_persistent object_get_mask object_get_parent object_get_physics object_is_ancestor room_exists room_get_name sprite_set_offset sprite_duplicate sprite_assign sprite_merge sprite_add sprite_replace sprite_create_from_surface sprite_add_from_surface sprite_delete sprite_set_alpha_from_sprite sprite_collision_mask font_add_enable_aa font_add_get_enable_aa font_add font_add_sprite font_add_sprite_ext font_replace font_replace_sprite font_replace_sprite_ext font_delete path_set_kind path_set_closed path_set_precision path_add path_assign path_duplicate path_append path_delete path_add_point path_insert_point path_change_point path_delete_point path_clear_points path_reverse path_mirror path_flip path_rotate path_rescale path_shift script_execute object_set_sprite object_set_solid object_set_visible object_set_persistent object_set_mask room_set_width room_set_height room_set_persistent room_set_background_colour room_set_background_color room_set_view room_set_viewport room_get_viewport room_set_view_enabled room_add room_duplicate room_assign room_instance_add room_instance_clear room_get_camera room_set_camera asset_get_index asset_get_type file_text_open_from_string file_text_open_read file_text_open_write file_text_open_append file_text_close file_text_write_string file_text_write_real file_text_writeln file_text_read_string file_text_read_real file_text_readln file_text_eof file_text_eoln file_exists file_delete file_rename file_copy directory_exists directory_create directory_destroy file_find_first file_find_next file_find_close file_attributes filename_name filename_path filename_dir filename_drive filename_ext filename_change_ext file_bin_open file_bin_rewrite file_bin_close file_bin_position file_bin_size file_bin_seek file_bin_write_byte file_bin_read_byte parameter_count parameter_string environment_get_variable ini_open_from_string ini_open ini_close ini_read_string ini_read_real ini_write_string ini_write_real ini_key_exists ini_section_exists ini_key_delete ini_section_delete ds_set_precision ds_exists ds_stack_create ds_stack_destroy ds_stack_clear ds_stack_copy ds_stack_size ds_stack_empty ds_stack_push ds_stack_pop ds_stack_top ds_stack_write ds_stack_read ds_queue_create ds_queue_destroy ds_queue_clear ds_queue_copy ds_queue_size ds_queue_empty ds_queue_enqueue ds_queue_dequeue ds_queue_head ds_queue_tail ds_queue_write ds_queue_read ds_list_create ds_list_destroy ds_list_clear ds_list_copy ds_list_size ds_list_empty ds_list_add ds_list_insert ds_list_replace ds_list_delete ds_list_find_index ds_list_find_value ds_list_mark_as_list ds_list_mark_as_map ds_list_sort ds_list_shuffle ds_list_write ds_list_read ds_list_set ds_map_create ds_map_destroy ds_map_clear ds_map_copy ds_map_size ds_map_empty ds_map_add ds_map_add_list ds_map_add_map ds_map_replace ds_map_replace_map ds_map_replace_list ds_map_delete ds_map_exists ds_map_find_value ds_map_find_previous ds_map_find_next ds_map_find_first ds_map_find_last ds_map_write ds_map_read ds_map_secure_save ds_map_secure_load ds_map_secure_load_buffer ds_map_secure_save_buffer ds_map_set ds_priority_create ds_priority_destroy ds_priority_clear ds_priority_copy ds_priority_size ds_priority_empty ds_priority_add ds_priority_change_priority ds_priority_find_priority ds_priority_delete_value ds_priority_delete_min ds_priority_find_min ds_priority_delete_max ds_priority_find_max ds_priority_write ds_priority_read ds_grid_create ds_grid_destroy ds_grid_copy ds_grid_resize ds_grid_width ds_grid_height ds_grid_clear ds_grid_set ds_grid_add ds_grid_multiply ds_grid_set_region ds_grid_add_region ds_grid_multiply_region ds_grid_set_disk ds_grid_add_disk ds_grid_multiply_disk ds_grid_set_grid_region ds_grid_add_grid_region ds_grid_multiply_grid_region ds_grid_get ds_grid_get_sum ds_grid_get_max ds_grid_get_min ds_grid_get_mean ds_grid_get_disk_sum ds_grid_get_disk_min ds_grid_get_disk_max ds_grid_get_disk_mean ds_grid_value_exists ds_grid_value_x ds_grid_value_y ds_grid_value_disk_exists ds_grid_value_disk_x ds_grid_value_disk_y ds_grid_shuffle ds_grid_write ds_grid_read ds_grid_sort ds_grid_set ds_grid_get effect_create_below effect_create_above effect_clear part_type_create part_type_destroy part_type_exists part_type_clear part_type_shape part_type_sprite part_type_size part_type_scale part_type_orientation part_type_life part_type_step part_type_death part_type_speed part_type_direction part_type_gravity part_type_colour1 part_type_colour2 part_type_colour3 part_type_colour_mix part_type_colour_rgb part_type_colour_hsv part_type_color1 part_type_color2 part_type_color3 part_type_color_mix part_type_color_rgb part_type_color_hsv part_type_alpha1 part_type_alpha2 part_type_alpha3 part_type_blend part_system_create part_system_create_layer part_system_destroy part_system_exists part_system_clear part_system_draw_order part_system_depth part_system_position part_system_automatic_update part_system_automatic_draw part_system_update part_system_drawit part_system_get_layer part_system_layer part_particles_create part_particles_create_colour part_particles_create_color part_particles_clear part_particles_count part_emitter_create part_emitter_destroy part_emitter_destroy_all part_emitter_exists part_emitter_clear part_emitter_region part_emitter_burst part_emitter_stream external_call external_define external_free window_handle window_device matrix_get matrix_set matrix_build_identity matrix_build matrix_build_lookat matrix_build_projection_ortho matrix_build_projection_perspective matrix_build_projection_perspective_fov matrix_multiply matrix_transform_vertex matrix_stack_push matrix_stack_pop matrix_stack_multiply matrix_stack_set matrix_stack_clear matrix_stack_top matrix_stack_is_empty browser_input_capture os_get_config os_get_info os_get_language os_get_region os_lock_orientation display_get_dpi_x display_get_dpi_y display_set_gui_size display_set_gui_maximise display_set_gui_maximize device_mouse_dbclick_enable display_set_timing_method display_get_timing_method display_set_sleep_margin display_get_sleep_margin virtual_key_add virtual_key_hide virtual_key_delete virtual_key_show draw_enable_drawevent draw_enable_swf_aa draw_set_swf_aa_level draw_get_swf_aa_level draw_texture_flush draw_flush gpu_set_blendenable gpu_set_ztestenable gpu_set_zfunc gpu_set_zwriteenable gpu_set_lightingenable gpu_set_fog gpu_set_cullmode gpu_set_blendmode gpu_set_blendmode_ext gpu_set_blendmode_ext_sepalpha gpu_set_colorwriteenable gpu_set_colourwriteenable gpu_set_alphatestenable gpu_set_alphatestref gpu_set_alphatestfunc gpu_set_texfilter gpu_set_texfilter_ext gpu_set_texrepeat gpu_set_texrepeat_ext gpu_set_tex_filter gpu_set_tex_filter_ext gpu_set_tex_repeat gpu_set_tex_repeat_ext gpu_set_tex_mip_filter gpu_set_tex_mip_filter_ext gpu_set_tex_mip_bias gpu_set_tex_mip_bias_ext gpu_set_tex_min_mip gpu_set_tex_min_mip_ext gpu_set_tex_max_mip gpu_set_tex_max_mip_ext gpu_set_tex_max_aniso gpu_set_tex_max_aniso_ext gpu_set_tex_mip_enable gpu_set_tex_mip_enable_ext gpu_get_blendenable gpu_get_ztestenable gpu_get_zfunc gpu_get_zwriteenable gpu_get_lightingenable gpu_get_fog gpu_get_cullmode gpu_get_blendmode gpu_get_blendmode_ext gpu_get_blendmode_ext_sepalpha gpu_get_blendmode_src gpu_get_blendmode_dest gpu_get_blendmode_srcalpha gpu_get_blendmode_destalpha gpu_get_colorwriteenable gpu_get_colourwriteenable gpu_get_alphatestenable gpu_get_alphatestref gpu_get_alphatestfunc gpu_get_texfilter gpu_get_texfilter_ext gpu_get_texrepeat gpu_get_texrepeat_ext gpu_get_tex_filter gpu_get_tex_filter_ext gpu_get_tex_repeat gpu_get_tex_repeat_ext gpu_get_tex_mip_filter gpu_get_tex_mip_filter_ext gpu_get_tex_mip_bias gpu_get_tex_mip_bias_ext gpu_get_tex_min_mip gpu_get_tex_min_mip_ext gpu_get_tex_max_mip gpu_get_tex_max_mip_ext gpu_get_tex_max_aniso gpu_get_tex_max_aniso_ext gpu_get_tex_mip_enable gpu_get_tex_mip_enable_ext gpu_push_state gpu_pop_state gpu_get_state gpu_set_state draw_light_define_ambient draw_light_define_direction draw_light_define_point draw_light_enable draw_set_lighting draw_light_get_ambient draw_light_get draw_get_lighting shop_leave_rating url_get_domain url_open url_open_ext url_open_full get_timer achievement_login achievement_logout achievement_post achievement_increment achievement_post_score achievement_available achievement_show_achievements achievement_show_leaderboards achievement_load_friends achievement_load_leaderboard achievement_send_challenge achievement_load_progress achievement_reset achievement_login_status achievement_get_pic achievement_show_challenge_notifications achievement_get_challenges achievement_event achievement_show achievement_get_info cloud_file_save cloud_string_save cloud_synchronise ads_enable ads_disable ads_setup ads_engagement_launch ads_engagement_available ads_engagement_active ads_event ads_event_preload ads_set_reward_callback ads_get_display_height ads_get_display_width ads_move ads_interstitial_available ads_interstitial_display device_get_tilt_x device_get_tilt_y device_get_tilt_z device_is_keypad_open device_mouse_check_button device_mouse_check_button_pressed device_mouse_check_button_released device_mouse_x device_mouse_y device_mouse_raw_x device_mouse_raw_y device_mouse_x_to_gui device_mouse_y_to_gui iap_activate iap_status iap_enumerate_products iap_restore_all iap_acquire iap_consume iap_product_details iap_purchase_details facebook_init facebook_login facebook_status facebook_graph_request facebook_dialog facebook_logout facebook_launch_offerwall facebook_post_message facebook_send_invite facebook_user_id facebook_accesstoken facebook_check_permission facebook_request_read_permissions facebook_request_publish_permissions gamepad_is_supported gamepad_get_device_count gamepad_is_connected gamepad_get_description gamepad_get_button_threshold gamepad_set_button_threshold gamepad_get_axis_deadzone gamepad_set_axis_deadzone gamepad_button_count gamepad_button_check gamepad_button_check_pressed gamepad_button_check_released gamepad_button_value gamepad_axis_count gamepad_axis_value gamepad_set_vibration gamepad_set_colour gamepad_set_color os_is_paused window_has_focus code_is_compiled http_get http_get_file http_post_string http_request json_encode json_decode zip_unzip load_csv base64_encode base64_decode md5_string_unicode md5_string_utf8 md5_file os_is_network_connected sha1_string_unicode sha1_string_utf8 sha1_file os_powersave_enable analytics_event analytics_event_ext win8_livetile_tile_notification win8_livetile_tile_clear win8_livetile_badge_notification win8_livetile_badge_clear win8_livetile_queue_enable win8_secondarytile_pin win8_secondarytile_badge_notification win8_secondarytile_delete win8_livetile_notification_begin win8_livetile_notification_secondary_begin win8_livetile_notification_expiry win8_livetile_notification_tag win8_livetile_notification_text_add win8_livetile_notification_image_add win8_livetile_notification_end win8_appbar_enable win8_appbar_add_element win8_appbar_remove_element win8_settingscharm_add_entry win8_settingscharm_add_html_entry win8_settingscharm_add_xaml_entry win8_settingscharm_set_xaml_property win8_settingscharm_get_xaml_property win8_settingscharm_remove_entry win8_share_image win8_share_screenshot win8_share_file win8_share_url win8_share_text win8_search_enable win8_search_disable win8_search_add_suggestions win8_device_touchscreen_available win8_license_initialize_sandbox win8_license_trial_version winphone_license_trial_version winphone_tile_title winphone_tile_count winphone_tile_back_title winphone_tile_back_content winphone_tile_back_content_wide winphone_tile_front_image winphone_tile_front_image_small winphone_tile_front_image_wide winphone_tile_back_image winphone_tile_back_image_wide winphone_tile_background_colour winphone_tile_background_color winphone_tile_icon_image winphone_tile_small_icon_image winphone_tile_wide_content winphone_tile_cycle_images winphone_tile_small_background_image physics_world_create physics_world_gravity physics_world_update_speed physics_world_update_iterations physics_world_draw_debug physics_pause_enable physics_fixture_create physics_fixture_set_kinematic physics_fixture_set_density physics_fixture_set_awake physics_fixture_set_restitution physics_fixture_set_friction physics_fixture_set_collision_group physics_fixture_set_sensor physics_fixture_set_linear_damping physics_fixture_set_angular_damping physics_fixture_set_circle_shape physics_fixture_set_box_shape physics_fixture_set_edge_shape physics_fixture_set_polygon_shape physics_fixture_set_chain_shape physics_fixture_add_point physics_fixture_bind physics_fixture_bind_ext physics_fixture_delete physics_apply_force physics_apply_impulse physics_apply_angular_impulse physics_apply_local_force physics_apply_local_impulse physics_apply_torque physics_mass_properties physics_draw_debug physics_test_overlap physics_remove_fixture physics_set_friction physics_set_density physics_set_restitution physics_get_friction physics_get_density physics_get_restitution physics_joint_distance_create physics_joint_rope_create physics_joint_revolute_create physics_joint_prismatic_create physics_joint_pulley_create physics_joint_wheel_create physics_joint_weld_create physics_joint_friction_create physics_joint_gear_create physics_joint_enable_motor physics_joint_get_value physics_joint_set_value physics_joint_delete physics_particle_create physics_particle_delete physics_particle_delete_region_circle physics_particle_delete_region_box physics_particle_delete_region_poly physics_particle_set_flags physics_particle_set_category_flags physics_particle_draw physics_particle_draw_ext physics_particle_count physics_particle_get_data physics_particle_get_data_particle physics_particle_group_begin physics_particle_group_circle physics_particle_group_box physics_particle_group_polygon physics_particle_group_add_point physics_particle_group_end physics_particle_group_join physics_particle_group_delete physics_particle_group_count physics_particle_group_get_data physics_particle_group_get_mass physics_particle_group_get_inertia physics_particle_group_get_centre_x physics_particle_group_get_centre_y physics_particle_group_get_vel_x physics_particle_group_get_vel_y physics_particle_group_get_ang_vel physics_particle_group_get_x physics_particle_group_get_y physics_particle_group_get_angle physics_particle_set_group_flags physics_particle_get_group_flags physics_particle_get_max_count physics_particle_get_radius physics_particle_get_density physics_particle_get_damping physics_particle_get_gravity_scale physics_particle_set_max_count physics_particle_set_radius physics_particle_set_density physics_particle_set_damping physics_particle_set_gravity_scale network_create_socket network_create_socket_ext network_create_server network_create_server_raw network_connect network_connect_raw network_send_packet network_send_raw network_send_broadcast network_send_udp network_send_udp_raw network_set_timeout network_set_config network_resolve network_destroy buffer_create buffer_write buffer_read buffer_seek buffer_get_surface buffer_set_surface buffer_delete buffer_exists buffer_get_type buffer_get_alignment buffer_poke buffer_peek buffer_save buffer_save_ext buffer_load buffer_load_ext buffer_load_partial buffer_copy buffer_fill buffer_get_size buffer_tell buffer_resize buffer_md5 buffer_sha1 buffer_base64_encode buffer_base64_decode buffer_base64_decode_ext buffer_sizeof buffer_get_address buffer_create_from_vertex_buffer buffer_create_from_vertex_buffer_ext buffer_copy_from_vertex_buffer buffer_async_group_begin buffer_async_group_option buffer_async_group_end buffer_load_async buffer_save_async gml_release_mode gml_pragma steam_activate_overlay steam_is_overlay_enabled steam_is_overlay_activated steam_get_persona_name steam_initialised steam_is_cloud_enabled_for_app steam_is_cloud_enabled_for_account steam_file_persisted steam_get_quota_total steam_get_quota_free steam_file_write steam_file_write_file steam_file_read steam_file_delete steam_file_exists steam_file_size steam_file_share steam_is_screenshot_requested steam_send_screenshot steam_is_user_logged_on steam_get_user_steam_id steam_user_owns_dlc steam_user_installed_dlc steam_set_achievement steam_get_achievement steam_clear_achievement steam_set_stat_int steam_set_stat_float steam_set_stat_avg_rate steam_get_stat_int steam_get_stat_float steam_get_stat_avg_rate steam_reset_all_stats steam_reset_all_stats_achievements steam_stats_ready steam_create_leaderboard steam_upload_score steam_upload_score_ext steam_download_scores_around_user steam_download_scores steam_download_friends_scores steam_upload_score_buffer steam_upload_score_buffer_ext steam_current_game_language steam_available_languages steam_activate_overlay_browser steam_activate_overlay_user steam_activate_overlay_store steam_get_user_persona_name steam_get_app_id steam_get_user_account_id steam_ugc_download steam_ugc_create_item steam_ugc_start_item_update steam_ugc_set_item_title steam_ugc_set_item_description steam_ugc_set_item_visibility steam_ugc_set_item_tags steam_ugc_set_item_content steam_ugc_set_item_preview steam_ugc_submit_item_update steam_ugc_get_item_update_progress steam_ugc_subscribe_item steam_ugc_unsubscribe_item steam_ugc_num_subscribed_items steam_ugc_get_subscribed_items steam_ugc_get_item_install_info steam_ugc_get_item_update_info steam_ugc_request_item_details steam_ugc_create_query_user steam_ugc_create_query_user_ex steam_ugc_create_query_all steam_ugc_create_query_all_ex steam_ugc_query_set_cloud_filename_filter steam_ugc_query_set_match_any_tag steam_ugc_query_set_search_text steam_ugc_query_set_ranked_by_trend_days steam_ugc_query_add_required_tag steam_ugc_query_add_excluded_tag steam_ugc_query_set_return_long_description steam_ugc_query_set_return_total_only steam_ugc_query_set_allow_cached_response steam_ugc_send_query shader_set shader_get_name shader_reset shader_current shader_is_compiled shader_get_sampler_index shader_get_uniform shader_set_uniform_i shader_set_uniform_i_array shader_set_uniform_f shader_set_uniform_f_array shader_set_uniform_matrix shader_set_uniform_matrix_array shader_enable_corner_id texture_set_stage texture_get_texel_width texture_get_texel_height shaders_are_supported vertex_format_begin vertex_format_end vertex_format_delete vertex_format_add_position vertex_format_add_position_3d vertex_format_add_colour vertex_format_add_color vertex_format_add_normal vertex_format_add_texcoord vertex_format_add_textcoord vertex_format_add_custom vertex_create_buffer vertex_create_buffer_ext vertex_delete_buffer vertex_begin vertex_end vertex_position vertex_position_3d vertex_colour vertex_color vertex_argb vertex_texcoord vertex_normal vertex_float1 vertex_float2 vertex_float3 vertex_float4 vertex_ubyte4 vertex_submit vertex_freeze vertex_get_number vertex_get_buffer_size vertex_create_buffer_from_buffer vertex_create_buffer_from_buffer_ext push_local_notification push_get_first_local_notification push_get_next_local_notification push_cancel_local_notification skeleton_animation_set skeleton_animation_get skeleton_animation_mix skeleton_animation_set_ext skeleton_animation_get_ext skeleton_animation_get_duration skeleton_animation_get_frames skeleton_animation_clear skeleton_skin_set skeleton_skin_get skeleton_attachment_set skeleton_attachment_get skeleton_attachment_create skeleton_collision_draw_set skeleton_bone_data_get skeleton_bone_data_set skeleton_bone_state_get skeleton_bone_state_set skeleton_get_minmax skeleton_get_num_bounds skeleton_get_bounds skeleton_animation_get_frame skeleton_animation_set_frame draw_skeleton draw_skeleton_time draw_skeleton_instance draw_skeleton_collision skeleton_animation_list skeleton_skin_list skeleton_slot_data layer_get_id layer_get_id_at_depth layer_get_depth layer_create layer_destroy layer_destroy_instances layer_add_instance layer_has_instance layer_set_visible layer_get_visible layer_exists layer_x layer_y layer_get_x layer_get_y layer_hspeed layer_vspeed layer_get_hspeed layer_get_vspeed layer_script_begin layer_script_end layer_shader layer_get_script_begin layer_get_script_end layer_get_shader layer_set_target_room layer_get_target_room layer_reset_target_room layer_get_all layer_get_all_elements layer_get_name layer_depth layer_get_element_layer layer_get_element_type layer_element_move layer_force_draw_depth layer_is_draw_depth_forced layer_get_forced_depth layer_background_get_id layer_background_exists layer_background_create layer_background_destroy layer_background_visible layer_background_change layer_background_sprite layer_background_htiled layer_background_vtiled layer_background_stretch layer_background_yscale layer_background_xscale layer_background_blend layer_background_alpha layer_background_index layer_background_speed layer_background_get_visible layer_background_get_sprite layer_background_get_htiled layer_background_get_vtiled layer_background_get_stretch layer_background_get_yscale layer_background_get_xscale layer_background_get_blend layer_background_get_alpha layer_background_get_index layer_background_get_speed layer_sprite_get_id layer_sprite_exists layer_sprite_create layer_sprite_destroy layer_sprite_change layer_sprite_index layer_sprite_speed layer_sprite_xscale layer_sprite_yscale layer_sprite_angle layer_sprite_blend layer_sprite_alpha layer_sprite_x layer_sprite_y layer_sprite_get_sprite layer_sprite_get_index layer_sprite_get_speed layer_sprite_get_xscale layer_sprite_get_yscale layer_sprite_get_angle layer_sprite_get_blend layer_sprite_get_alpha layer_sprite_get_x layer_sprite_get_y layer_tilemap_get_id layer_tilemap_exists layer_tilemap_create layer_tilemap_destroy tilemap_tileset tilemap_x tilemap_y tilemap_set tilemap_set_at_pixel tilemap_get_tileset tilemap_get_tile_width tilemap_get_tile_height tilemap_get_width tilemap_get_height tilemap_get_x tilemap_get_y tilemap_get tilemap_get_at_pixel tilemap_get_cell_x_at_pixel tilemap_get_cell_y_at_pixel tilemap_clear draw_tilemap draw_tile tilemap_set_global_mask tilemap_get_global_mask tilemap_set_mask tilemap_get_mask tilemap_get_frame tile_set_empty tile_set_index tile_set_flip tile_set_mirror tile_set_rotate tile_get_empty tile_get_index tile_get_flip tile_get_mirror tile_get_rotate layer_tile_exists layer_tile_create layer_tile_destroy layer_tile_change layer_tile_xscale layer_tile_yscale layer_tile_blend layer_tile_alpha layer_tile_x layer_tile_y layer_tile_region layer_tile_visible layer_tile_get_sprite layer_tile_get_xscale layer_tile_get_yscale layer_tile_get_blend layer_tile_get_alpha layer_tile_get_x layer_tile_get_y layer_tile_get_region layer_tile_get_visible layer_instance_get_instance instance_activate_layer instance_deactivate_layer camera_create camera_create_view camera_destroy camera_apply camera_get_active camera_get_default camera_set_default camera_set_view_mat camera_set_proj_mat camera_set_update_script camera_set_begin_script camera_set_end_script camera_set_view_pos camera_set_view_size camera_set_view_speed camera_set_view_border camera_set_view_angle camera_set_view_target camera_get_view_mat camera_get_proj_mat camera_get_update_script camera_get_begin_script camera_get_end_script camera_get_view_x camera_get_view_y camera_get_view_width camera_get_view_height camera_get_view_speed_x camera_get_view_speed_y camera_get_view_border_x camera_get_view_border_y camera_get_view_angle camera_get_view_target view_get_camera view_get_visible view_get_xport view_get_yport view_get_wport view_get_hport view_get_surface_id view_set_camera view_set_visible view_set_xport view_set_yport view_set_wport view_set_hport view_set_surface_id gesture_drag_time gesture_drag_distance gesture_flick_speed gesture_double_tap_time gesture_double_tap_distance gesture_pinch_distance gesture_pinch_angle_towards gesture_pinch_angle_away gesture_rotate_time gesture_rotate_angle gesture_tap_count gesture_get_drag_time gesture_get_drag_distance gesture_get_flick_speed gesture_get_double_tap_time gesture_get_double_tap_distance gesture_get_pinch_distance gesture_get_pinch_angle_towards gesture_get_pinch_angle_away gesture_get_rotate_time gesture_get_rotate_angle gesture_get_tap_count keyboard_virtual_show keyboard_virtual_hide keyboard_virtual_status keyboard_virtual_height",literal:"self other all noone global local undefined pointer_invalid pointer_null path_action_stop path_action_restart path_action_continue path_action_reverse true false pi GM_build_date GM_version GM_runtime_version timezone_local timezone_utc gamespeed_fps gamespeed_microseconds ev_create ev_destroy ev_step ev_alarm ev_keyboard ev_mouse ev_collision ev_other ev_draw ev_draw_begin ev_draw_end ev_draw_pre ev_draw_post ev_keypress ev_keyrelease ev_trigger ev_left_button ev_right_button ev_middle_button ev_no_button ev_left_press ev_right_press ev_middle_press ev_left_release ev_right_release ev_middle_release ev_mouse_enter ev_mouse_leave ev_mouse_wheel_up ev_mouse_wheel_down ev_global_left_button ev_global_right_button ev_global_middle_button ev_global_left_press ev_global_right_press ev_global_middle_press ev_global_left_release ev_global_right_release ev_global_middle_release ev_joystick1_left ev_joystick1_right ev_joystick1_up ev_joystick1_down ev_joystick1_button1 ev_joystick1_button2 ev_joystick1_button3 ev_joystick1_button4 ev_joystick1_button5 ev_joystick1_button6 ev_joystick1_button7 ev_joystick1_button8 ev_joystick2_left ev_joystick2_right ev_joystick2_up ev_joystick2_down ev_joystick2_button1 ev_joystick2_button2 ev_joystick2_button3 ev_joystick2_button4 ev_joystick2_button5 ev_joystick2_button6 ev_joystick2_button7 ev_joystick2_button8 ev_outside ev_boundary ev_game_start ev_game_end ev_room_start ev_room_end ev_no_more_lives ev_animation_end ev_end_of_path ev_no_more_health ev_close_button ev_user0 ev_user1 ev_user2 ev_user3 ev_user4 ev_user5 ev_user6 ev_user7 ev_user8 ev_user9 ev_user10 ev_user11 ev_user12 ev_user13 ev_user14 ev_user15 ev_step_normal ev_step_begin ev_step_end ev_gui ev_gui_begin ev_gui_end ev_cleanup ev_gesture ev_gesture_tap ev_gesture_double_tap ev_gesture_drag_start ev_gesture_dragging ev_gesture_drag_end ev_gesture_flick ev_gesture_pinch_start ev_gesture_pinch_in ev_gesture_pinch_out ev_gesture_pinch_end ev_gesture_rotate_start ev_gesture_rotating ev_gesture_rotate_end ev_global_gesture_tap ev_global_gesture_double_tap ev_global_gesture_drag_start ev_global_gesture_dragging ev_global_gesture_drag_end ev_global_gesture_flick ev_global_gesture_pinch_start ev_global_gesture_pinch_in ev_global_gesture_pinch_out ev_global_gesture_pinch_end ev_global_gesture_rotate_start ev_global_gesture_rotating ev_global_gesture_rotate_end vk_nokey vk_anykey vk_enter vk_return vk_shift vk_control vk_alt vk_escape vk_space vk_backspace vk_tab vk_pause vk_printscreen vk_left vk_right vk_up vk_down vk_home vk_end vk_delete vk_insert vk_pageup vk_pagedown vk_f1 vk_f2 vk_f3 vk_f4 vk_f5 vk_f6 vk_f7 vk_f8 vk_f9 vk_f10 vk_f11 vk_f12 vk_numpad0 vk_numpad1 vk_numpad2 vk_numpad3 vk_numpad4 vk_numpad5 vk_numpad6 vk_numpad7 vk_numpad8 vk_numpad9 vk_divide vk_multiply vk_subtract vk_add vk_decimal vk_lshift vk_lcontrol vk_lalt vk_rshift vk_rcontrol vk_ralt mb_any mb_none mb_left mb_right mb_middle c_aqua c_black c_blue c_dkgray c_fuchsia c_gray c_green c_lime c_ltgray c_maroon c_navy c_olive c_purple c_red c_silver c_teal c_white c_yellow c_orange fa_left fa_center fa_right fa_top fa_middle fa_bottom pr_pointlist pr_linelist pr_linestrip pr_trianglelist pr_trianglestrip pr_trianglefan bm_complex bm_normal bm_add bm_max bm_subtract bm_zero bm_one bm_src_colour bm_inv_src_colour bm_src_color bm_inv_src_color bm_src_alpha bm_inv_src_alpha bm_dest_alpha bm_inv_dest_alpha bm_dest_colour bm_inv_dest_colour bm_dest_color bm_inv_dest_color bm_src_alpha_sat tf_point tf_linear tf_anisotropic mip_off mip_on mip_markedonly audio_falloff_none audio_falloff_inverse_distance audio_falloff_inverse_distance_clamped audio_falloff_linear_distance audio_falloff_linear_distance_clamped audio_falloff_exponent_distance audio_falloff_exponent_distance_clamped audio_old_system audio_new_system audio_mono audio_stereo audio_3d cr_default cr_none cr_arrow cr_cross cr_beam cr_size_nesw cr_size_ns cr_size_nwse cr_size_we cr_uparrow cr_hourglass cr_drag cr_appstart cr_handpoint cr_size_all spritespeed_framespersecond spritespeed_framespergameframe asset_object asset_unknown asset_sprite asset_sound asset_room asset_path asset_script asset_font asset_timeline asset_tiles asset_shader fa_readonly fa_hidden fa_sysfile fa_volumeid fa_directory fa_archive ds_type_map ds_type_list ds_type_stack ds_type_queue ds_type_grid ds_type_priority ef_explosion ef_ring ef_ellipse ef_firework ef_smoke ef_smokeup ef_star ef_spark ef_flare ef_cloud ef_rain ef_snow pt_shape_pixel pt_shape_disk pt_shape_square pt_shape_line pt_shape_star pt_shape_circle pt_shape_ring pt_shape_sphere pt_shape_flare pt_shape_spark pt_shape_explosion pt_shape_cloud pt_shape_smoke pt_shape_snow ps_distr_linear ps_distr_gaussian ps_distr_invgaussian ps_shape_rectangle ps_shape_ellipse ps_shape_diamond ps_shape_line ty_real ty_string dll_cdecl dll_stdcall matrix_view matrix_projection matrix_world os_win32 os_windows os_macosx os_ios os_android os_symbian os_linux os_unknown os_winphone os_tizen os_win8native os_wiiu os_3ds os_psvita os_bb10 os_ps4 os_xboxone os_ps3 os_xbox360 os_uwp os_tvos os_switch browser_not_a_browser browser_unknown browser_ie browser_firefox browser_chrome browser_safari browser_safari_mobile browser_opera browser_tizen browser_edge browser_windows_store browser_ie_mobile device_ios_unknown device_ios_iphone device_ios_iphone_retina device_ios_ipad device_ios_ipad_retina device_ios_iphone5 device_ios_iphone6 device_ios_iphone6plus device_emulator device_tablet display_landscape display_landscape_flipped display_portrait display_portrait_flipped tm_sleep tm_countvsyncs of_challenge_win of_challen ge_lose of_challenge_tie leaderboard_type_number leaderboard_type_time_mins_secs cmpfunc_never cmpfunc_less cmpfunc_equal cmpfunc_lessequal cmpfunc_greater cmpfunc_notequal cmpfunc_greaterequal cmpfunc_always cull_noculling cull_clockwise cull_counterclockwise lighttype_dir lighttype_point iap_ev_storeload iap_ev_product iap_ev_purchase iap_ev_consume iap_ev_restore iap_storeload_ok iap_storeload_failed iap_status_uninitialised iap_status_unavailable iap_status_loading iap_status_available iap_status_processing iap_status_restoring iap_failed iap_unavailable iap_available iap_purchased iap_canceled iap_refunded fb_login_default fb_login_fallback_to_webview fb_login_no_fallback_to_webview fb_login_forcing_webview fb_login_use_system_account fb_login_forcing_safari phy_joint_anchor_1_x phy_joint_anchor_1_y phy_joint_anchor_2_x phy_joint_anchor_2_y phy_joint_reaction_force_x phy_joint_reaction_force_y phy_joint_reaction_torque phy_joint_motor_speed phy_joint_angle phy_joint_motor_torque phy_joint_max_motor_torque phy_joint_translation phy_joint_speed phy_joint_motor_force phy_joint_max_motor_force phy_joint_length_1 phy_joint_length_2 phy_joint_damping_ratio phy_joint_frequency phy_joint_lower_angle_limit phy_joint_upper_angle_limit phy_joint_angle_limits phy_joint_max_length phy_joint_max_torque phy_joint_max_force phy_debug_render_aabb phy_debug_render_collision_pairs phy_debug_render_coms phy_debug_render_core_shapes phy_debug_render_joints phy_debug_render_obb phy_debug_render_shapes phy_particle_flag_water phy_particle_flag_zombie phy_particle_flag_wall phy_particle_flag_spring phy_particle_flag_elastic phy_particle_flag_viscous phy_particle_flag_powder phy_particle_flag_tensile phy_particle_flag_colourmixing phy_particle_flag_colormixing phy_particle_group_flag_solid phy_particle_group_flag_rigid phy_particle_data_flag_typeflags phy_particle_data_flag_position phy_particle_data_flag_velocity phy_particle_data_flag_colour phy_particle_data_flag_color phy_particle_data_flag_category achievement_our_info achievement_friends_info achievement_leaderboard_info achievement_achievement_info achievement_filter_all_players achievement_filter_friends_only achievement_filter_favorites_only achievement_type_achievement_challenge achievement_type_score_challenge achievement_pic_loaded achievement_show_ui achievement_show_profile achievement_show_leaderboard achievement_show_achievement achievement_show_bank achievement_show_friend_picker achievement_show_purchase_prompt network_socket_tcp network_socket_udp network_socket_bluetooth network_type_connect network_type_disconnect network_type_data network_type_non_blocking_connect network_config_connect_timeout network_config_use_non_blocking_socket network_config_enable_reliable_udp network_config_disable_reliable_udp buffer_fixed buffer_grow buffer_wrap buffer_fast buffer_vbuffer buffer_network buffer_u8 buffer_s8 buffer_u16 buffer_s16 buffer_u32 buffer_s32 buffer_u64 buffer_f16 buffer_f32 buffer_f64 buffer_bool buffer_text buffer_string buffer_surface_copy buffer_seek_start buffer_seek_relative buffer_seek_end buffer_generalerror buffer_outofspace buffer_outofbounds buffer_invalidtype text_type button_type input_type ANSI_CHARSET DEFAULT_CHARSET EASTEUROPE_CHARSET RUSSIAN_CHARSET SYMBOL_CHARSET SHIFTJIS_CHARSET HANGEUL_CHARSET GB2312_CHARSET CHINESEBIG5_CHARSET JOHAB_CHARSET HEBREW_CHARSET ARABIC_CHARSET GREEK_CHARSET TURKISH_CHARSET VIETNAMESE_CHARSET THAI_CHARSET MAC_CHARSET BALTIC_CHARSET OEM_CHARSET gp_face1 gp_face2 gp_face3 gp_face4 gp_shoulderl gp_shoulderr gp_shoulderlb gp_shoulderrb gp_select gp_start gp_stickl gp_stickr gp_padu gp_padd gp_padl gp_padr gp_axislh gp_axislv gp_axisrh gp_axisrv ov_friends ov_community ov_players ov_settings ov_gamegroup ov_achievements lb_sort_none lb_sort_ascending lb_sort_descending lb_disp_none lb_disp_numeric lb_disp_time_sec lb_disp_time_ms ugc_result_success ugc_filetype_community ugc_filetype_microtrans ugc_visibility_public ugc_visibility_friends_only ugc_visibility_private ugc_query_RankedByVote ugc_query_RankedByPublicationDate ugc_query_AcceptedForGameRankedByAcceptanceDate ugc_query_RankedByTrend ugc_query_FavoritedByFriendsRankedByPublicationDate ugc_query_CreatedByFriendsRankedByPublicationDate ugc_query_RankedByNumTimesReported ugc_query_CreatedByFollowedUsersRankedByPublicationDate ugc_query_NotYetRated ugc_query_RankedByTotalVotesAsc ugc_query_RankedByVotesUp ugc_query_RankedByTextSearch ugc_sortorder_CreationOrderDesc ugc_sortorder_CreationOrderAsc ugc_sortorder_TitleAsc ugc_sortorder_LastUpdatedDesc ugc_sortorder_SubscriptionDateDesc ugc_sortorder_VoteScoreDesc ugc_sortorder_ForModeration ugc_list_Published ugc_list_VotedOn ugc_list_VotedUp ugc_list_VotedDown ugc_list_WillVoteLater ugc_list_Favorited ugc_list_Subscribed ugc_list_UsedOrPlayed ugc_list_Followed ugc_match_Items ugc_match_Items_Mtx ugc_match_Items_ReadyToUse ugc_match_Collections ugc_match_Artwork ugc_match_Videos ugc_match_Screenshots ugc_match_AllGuides ugc_match_WebGuides ugc_match_IntegratedGuides ugc_match_UsableInGame ugc_match_ControllerBindings vertex_usage_position vertex_usage_colour vertex_usage_color vertex_usage_normal vertex_usage_texcoord vertex_usage_textcoord vertex_usage_blendweight vertex_usage_blendindices vertex_usage_psize vertex_usage_tangent vertex_usage_binormal vertex_usage_fog vertex_usage_depth vertex_usage_sample vertex_type_float1 vertex_type_float2 vertex_type_float3 vertex_type_float4 vertex_type_colour vertex_type_color vertex_type_ubyte4 layerelementtype_undefined layerelementtype_background layerelementtype_instance layerelementtype_oldtilemap layerelementtype_sprite layerelementtype_tilemap layerelementtype_particlesystem layerelementtype_tile tile_rotate tile_flip tile_mirror tile_index_mask kbv_type_default kbv_type_ascii kbv_type_url kbv_type_email kbv_type_numbers kbv_type_phone kbv_type_phone_name kbv_returnkey_default kbv_returnkey_go kbv_returnkey_google kbv_returnkey_join kbv_returnkey_next kbv_returnkey_route kbv_returnkey_search kbv_returnkey_send kbv_returnkey_yahoo kbv_returnkey_done kbv_returnkey_continue kbv_returnkey_emergency kbv_autocapitalize_none kbv_autocapitalize_words kbv_autocapitalize_sentences kbv_autocapitalize_characters",symbol:"argument_relative argument argument0 argument1 argument2 argument3 argument4 argument5 argument6 argument7 argument8 argument9 argument10 argument11 argument12 argument13 argument14 argument15 argument_count x|0 y|0 xprevious yprevious xstart ystart hspeed vspeed direction speed friction gravity gravity_direction path_index path_position path_positionprevious path_speed path_scale path_orientation path_endaction object_index id solid persistent mask_index instance_count instance_id room_speed fps fps_real current_time current_year current_month current_day current_weekday current_hour current_minute current_second alarm timeline_index timeline_position timeline_speed timeline_running timeline_loop room room_first room_last room_width room_height room_caption room_persistent score lives health show_score show_lives show_health caption_score caption_lives caption_health event_type event_number event_object event_action application_surface gamemaker_pro gamemaker_registered gamemaker_version error_occurred error_last debug_mode keyboard_key keyboard_lastkey keyboard_lastchar keyboard_string mouse_x mouse_y mouse_button mouse_lastbutton cursor_sprite visible sprite_index sprite_width sprite_height sprite_xoffset sprite_yoffset image_number image_index image_speed depth image_xscale image_yscale image_angle image_alpha image_blend bbox_left bbox_right bbox_top bbox_bottom layer background_colour background_showcolour background_color background_showcolor view_enabled view_current view_visible view_xview view_yview view_wview view_hview view_xport view_yport view_wport view_hport view_angle view_hborder view_vborder view_hspeed view_vspeed view_object view_surface_id view_camera game_id game_display_name game_project_name game_save_id working_directory temp_directory program_directory browser_width browser_height os_type os_device os_browser os_version display_aa async_load delta_time webgl_enabled event_data iap_data phy_rotation phy_position_x phy_position_y phy_angular_velocity phy_linear_velocity_x phy_linear_velocity_y phy_speed_x phy_speed_y phy_speed phy_angular_damping phy_linear_damping phy_bullet phy_fixed_rotation phy_active phy_mass phy_inertia phy_com_x phy_com_y phy_dynamic phy_kinematic phy_sleeping phy_collision_points phy_collision_x phy_collision_y phy_col_normal_x phy_col_normal_y phy_position_xprevious phy_position_yprevious"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE]}}dMn.exports=FLi});var hMn=re((Bcc,mMn)=>{p();function QLi(t){return{name:"Golo",keywords:{keyword:"println readln print import module function local return let var while for foreach times in case when match with break continue augment augmentation each find filter reduce if then else otherwise try catch finally raise throw orIfNull DynamicObject|10 DynamicVariable struct Observable map set vector list array",literal:"true false null"},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"}]}}mMn.exports=QLi});var gMn=re((Dcc,fMn)=>{p();function ULi(t){return{name:"Gradle",case_insensitive:!0,keywords:{keyword:"task project allprojects subprojects artifacts buildscript configurations dependencies repositories sourceSets description delete from into include exclude source classpath destinationDir includes options sourceCompatibility targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant def abstract break case catch continue default do else extends final finally for if implements instanceof native new private protected public return static switch synchronized throw throws transient try volatile while strictfp package import false null super this true antlrtask checkstyle codenarc copy boolean byte char class double float int interface long short void compile runTime file fileTree abs any append asList asWritable call collect compareTo count div dump each eachByte eachFile eachLine every find findAll flatten getAt getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter newReader newWriter next plus pop power previous print println push putAt read readBytes readLines reverse reverseEach round size sort splitEachLine step subMap times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader withStream withWriter withWriterAppend write writeLine"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.REGEXP_MODE]}}fMn.exports=ULi});var yMn=re((Mcc,AMn)=>{p();function GLi(t){return{name:"HAML",case_insensitive:!0,contains:[{className:"meta",begin:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",relevance:10},t.COMMENT("^\\s*(!=#|=#|-#|/).*$",!1,{relevance:0}),{begin:"^\\s*(-|=|!=)(?!#)",starts:{end:"\\n",subLanguage:"ruby"}},{className:"tag",begin:"^\\s*%",contains:[{className:"selector-tag",begin:"\\w+"},{className:"selector-id",begin:"#[\\w-]+"},{className:"selector-class",begin:"\\.[\\w-]+"},{begin:/\{\s*/,end:/\s*\}/,contains:[{begin:":\\w+\\s*=>",end:",\\s+",returnBegin:!0,endsWithParent:!0,contains:[{className:"attr",begin:":\\w+"},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{begin:"\\w+",relevance:0}]}]},{begin:"\\(\\s*",end:"\\s*\\)",excludeEnd:!0,contains:[{begin:"\\w+\\s*=",end:"\\s+",returnBegin:!0,endsWithParent:!0,contains:[{className:"attr",begin:"\\w+",relevance:0},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{begin:"\\w+",relevance:0}]}]}]},{begin:"^\\s*[=~]\\s*"},{begin:/#\{/,starts:{end:/\}/,subLanguage:"ruby"}}]}}AMn.exports=GLi});var _Mn=re((Lcc,bMn)=>{p();function EMn(t){return t?typeof t=="string"?t:t.source:null}function $Li(t){return Wre("(",t,")*")}function WLi(t){return Wre("(",t,")?")}function Wre(...t){return t.map(n=>EMn(n)).join("")}function HLi(...t){return"("+t.map(n=>EMn(n)).join("|")+")"}function qLi(t){let e={"builtin-name":["action","bindattr","collection","component","concat","debugger","each","each-in","get","hash","if","in","input","link-to","loc","log","lookup","mut","outlet","partial","query-params","render","template","textarea","unbound","unless","view","with","yield"]},n={literal:["true","false","undefined","null"]},r=/""|"[^"]+"/,i=/''|'[^']+'/,s=/\[\]|\[[^\]]+\]/,o=/[^\s!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/,a=/(\.|\/)/,c=HLi(r,i,s,o),u=Wre(WLi(/\.|\.\/|\//),c,$Li(Wre(a,c))),l=Wre("(",s,"|",o,")(?==)"),d={begin:u,lexemes:/[\w.\/]+/},m=t.inherit(d,{keywords:n}),h={begin:/\(/,end:/\)/},f={className:"attr",begin:l,relevance:0,starts:{begin:/=/,end:/=/,starts:{contains:[t.NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,m,h]}}},g={begin:/as\s+\|/,keywords:{keyword:"as"},end:/\|/,contains:[{begin:/\w+/}]},A={contains:[t.NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,g,f,m,h],returnEnd:!0},y=t.inherit(d,{className:"name",keywords:e,starts:t.inherit(A,{end:/\)/})});h.contains=[y];let E=t.inherit(d,{keywords:e,className:"name",starts:t.inherit(A,{end:/\}\}/})}),_=t.inherit(d,{keywords:e,className:"name"}),S=t.inherit(d,{className:"name",keywords:e,starts:t.inherit(A,{end:/\}\}/})});return{name:"Handlebars",aliases:["hbs","html.hbs","html.handlebars","htmlbars"],case_insensitive:!0,subLanguage:"xml",contains:[{begin:/\\\{\{/,skip:!0},{begin:/\\\\(?=\{\{)/,skip:!0},t.COMMENT(/\{\{!--/,/--\}\}/),t.COMMENT(/\{\{!/,/\}\}/),{className:"template-tag",begin:/\{\{\{\{(?!\/)/,end:/\}\}\}\}/,contains:[E],starts:{end:/\{\{\{\{\//,returnEnd:!0,subLanguage:"xml"}},{className:"template-tag",begin:/\{\{\{\{\//,end:/\}\}\}\}/,contains:[_]},{className:"template-tag",begin:/\{\{#/,end:/\}\}/,contains:[E]},{className:"template-tag",begin:/\{\{(?=else\}\})/,end:/\}\}/,keywords:"else"},{className:"template-tag",begin:/\{\{(?=else if)/,end:/\}\}/,keywords:"else if"},{className:"template-tag",begin:/\{\{\//,end:/\}\}/,contains:[_]},{className:"template-variable",begin:/\{\{\{/,end:/\}\}\}/,contains:[S]},{className:"template-variable",begin:/\{\{/,end:/\}\}/,contains:[S]}]}}bMn.exports=qLi});var SMn=re((Qcc,xMn)=>{p();function jLi(t){let e={variants:[t.COMMENT("--","$"),t.COMMENT(/\{-/,/-\}/,{contains:["self"]})]},n={className:"meta",begin:/\{-#/,end:/#-\}/},r={className:"meta",begin:"^#",end:"$"},i={className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},s={begin:"\\(",end:"\\)",illegal:'"',contains:[n,r,{className:"type",begin:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},t.inherit(t.TITLE_MODE,{begin:"[_a-z][\\w']*"}),e]},o={begin:/\{/,end:/\}/,contains:s.contains};return{name:"Haskell",aliases:["hs"],keywords:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",contains:[{beginKeywords:"module",end:"where",keywords:"module where",contains:[s,e],illegal:"\\W\\.|;"},{begin:"\\bimport\\b",end:"$",keywords:"import qualified as hiding",contains:[s,e],illegal:"\\W\\.|;"},{className:"class",begin:"^(\\s*)?(class|instance)\\b",end:"where",keywords:"class family instance where",contains:[i,s,e]},{className:"class",begin:"\\b(data|(new)?type)\\b",end:"$",keywords:"data family type newtype deriving",contains:[n,i,s,o,e]},{beginKeywords:"default",end:"$",contains:[i,s,e]},{beginKeywords:"infix infixl infixr",end:"$",contains:[t.C_NUMBER_MODE,e]},{begin:"\\bforeign\\b",end:"$",keywords:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",contains:[i,t.QUOTE_STRING_MODE,e]},{className:"meta",begin:"#!\\/usr\\/bin\\/env runhaskell",end:"$"},n,r,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,i,t.inherit(t.TITLE_MODE,{begin:"^[_a-z][\\w']*"}),e,{begin:"->|<-"}]}}xMn.exports=jLi});var IMn=re((Gcc,CMn)=>{p();function VLi(t){return{name:"Haxe",aliases:["hx"],keywords:{keyword:"break case cast catch continue default do dynamic else enum extern for function here if import in inline never new override package private get set public return static super switch this throw trace try typedef untyped using var while "+"Int Float String Bool Dynamic Void Array ",built_in:"trace this",literal:"true false null _"},contains:[{className:"string",begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE,{className:"subst",begin:"\\$\\{",end:"\\}"},{className:"subst",begin:"\\$",end:/\W\}/}]},t.QUOTE_STRING_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"@:",end:"$"},{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elseif end error"}},{className:"type",begin:":[ ]*",end:"[^A-Za-z0-9_ \\->]",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:":[ ]*",end:"\\W",excludeBegin:!0,excludeEnd:!0},{className:"type",begin:"new *",end:"\\W",excludeBegin:!0,excludeEnd:!0},{className:"class",beginKeywords:"enum",end:"\\{",contains:[t.TITLE_MODE]},{className:"class",beginKeywords:"abstract",end:"[\\{$]",contains:[{className:"type",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"type",begin:"from +",end:"\\W",excludeBegin:!0,excludeEnd:!0},{className:"type",begin:"to +",end:"\\W",excludeBegin:!0,excludeEnd:!0},t.TITLE_MODE],keywords:{keyword:"abstract from to"}},{className:"class",begin:"\\b(class|interface) +",end:"[\\{$]",excludeEnd:!0,keywords:"class interface",contains:[{className:"keyword",begin:"\\b(extends|implements) +",keywords:"extends implements",contains:[{className:"type",begin:t.IDENT_RE,relevance:0}]},t.TITLE_MODE]},{className:"function",beginKeywords:"function",end:"\\(",excludeEnd:!0,illegal:"\\S",contains:[t.TITLE_MODE]}],illegal:/<\//}}CMn.exports=VLi});var TMn=re((Wcc,wMn)=>{p();function YLi(t){return{name:"HSP",case_insensitive:!0,keywords:{$pattern:/[\w._]+/,keyword:"goto gosub return break repeat loop continue wait await dim sdim foreach dimtype dup dupptr end stop newmod delmod mref run exgoto on mcall assert logmes newlab resume yield onexit onerror onkey onclick oncmd exist delete mkdir chdir dirlist bload bsave bcopy memfile if else poke wpoke lpoke getstr chdpm memexpand memcpy memset notesel noteadd notedel noteload notesave randomize noteunsel noteget split strrep setease button chgdisp exec dialog mmload mmplay mmstop mci pset pget syscolor mes print title pos circle cls font sysfont objsize picload color palcolor palette redraw width gsel gcopy gzoom gmode bmpsave hsvcolor getkey listbox chkbox combox input mesbox buffer screen bgscr mouse objsel groll line clrobj boxf objprm objmode stick grect grotate gsquare gradf objimage objskip objenable celload celdiv celput newcom querycom delcom cnvstow comres axobj winobj sendmsg comevent comevarg sarrayconv callfunc cnvwtos comevdisp libptr system hspstat hspver stat cnt err strsize looplev sublev iparam wparam lparam refstr refdval int rnd strlen length length2 length3 length4 vartype gettime peek wpeek lpeek varptr varuse noteinfo instr abs limit getease str strmid strf getpath strtrim sin cos tan atan sqrt double absf expf logf limitf powf geteasef mousex mousey mousew hwnd hinstance hdc ginfo objinfo dirinfo sysinfo thismod __hspver__ __hsp30__ __date__ __time__ __line__ __file__ _debug __hspdef__ and or xor not screen_normal screen_palette screen_hide screen_fixedsize screen_tool screen_frame gmode_gdi gmode_mem gmode_rgb0 gmode_alpha gmode_rgb0alpha gmode_add gmode_sub gmode_pixela ginfo_mx ginfo_my ginfo_act ginfo_sel ginfo_wx1 ginfo_wy1 ginfo_wx2 ginfo_wy2 ginfo_vx ginfo_vy ginfo_sizex ginfo_sizey ginfo_winx ginfo_winy ginfo_mesx ginfo_mesy ginfo_r ginfo_g ginfo_b ginfo_paluse ginfo_dispx ginfo_dispy ginfo_cx ginfo_cy ginfo_intid ginfo_newid ginfo_sx ginfo_sy objinfo_mode objinfo_bmscr objinfo_hwnd notemax notesize dir_cur dir_exe dir_win dir_sys dir_cmdline dir_desktop dir_mydoc dir_tv font_normal font_bold font_italic font_underline font_strikeout font_antialias objmode_normal objmode_guifont objmode_usefont gsquare_grad msgothic msmincho do until while wend for next _break _continue switch case default swbreak swend ddim ldim alloc m_pi rad2deg deg2rad ease_linear ease_quad_in ease_quad_out ease_quad_inout ease_cubic_in ease_cubic_out ease_cubic_inout ease_quartic_in ease_quartic_out ease_quartic_inout ease_bounce_in ease_bounce_out ease_bounce_inout ease_shake_in ease_shake_out ease_shake_inout ease_loop"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",begin:/\{"/,end:/"\}/,contains:[t.BACKSLASH_ESCAPE]},t.COMMENT(";","$",{relevance:0}),{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"addion cfunc cmd cmpopt comfunc const defcfunc deffunc define else endif enum epack func global if ifdef ifndef include modcfunc modfunc modinit modterm module pack packopt regcmd runtime undef usecom uselib"},contains:[t.inherit(t.QUOTE_STRING_MODE,{className:"meta-string"}),t.NUMBER_MODE,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"symbol",begin:"^\\*(\\w+|@)"},t.NUMBER_MODE,t.C_NUMBER_MODE]}}wMn.exports=YLi});var kMn=re((qcc,RMn)=>{p();function vMn(t){return t?typeof t=="string"?t:t.source:null}function zLi(t){return Hre("(",t,")*")}function KLi(t){return Hre("(",t,")?")}function Hre(...t){return t.map(n=>vMn(n)).join("")}function JLi(...t){return"("+t.map(n=>vMn(n)).join("|")+")"}function XLi(t){let e={"builtin-name":["action","bindattr","collection","component","concat","debugger","each","each-in","get","hash","if","in","input","link-to","loc","log","lookup","mut","outlet","partial","query-params","render","template","textarea","unbound","unless","view","with","yield"]},n={literal:["true","false","undefined","null"]},r=/""|"[^"]+"/,i=/''|'[^']+'/,s=/\[\]|\[[^\]]+\]/,o=/[^\s!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/,a=/(\.|\/)/,c=JLi(r,i,s,o),u=Hre(KLi(/\.|\.\/|\//),c,zLi(Hre(a,c))),l=Hre("(",s,"|",o,")(?==)"),d={begin:u,lexemes:/[\w.\/]+/},m=t.inherit(d,{keywords:n}),h={begin:/\(/,end:/\)/},f={className:"attr",begin:l,relevance:0,starts:{begin:/=/,end:/=/,starts:{contains:[t.NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,m,h]}}},g={begin:/as\s+\|/,keywords:{keyword:"as"},end:/\|/,contains:[{begin:/\w+/}]},A={contains:[t.NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,g,f,m,h],returnEnd:!0},y=t.inherit(d,{className:"name",keywords:e,starts:t.inherit(A,{end:/\)/})});h.contains=[y];let E=t.inherit(d,{keywords:e,className:"name",starts:t.inherit(A,{end:/\}\}/})}),_=t.inherit(d,{keywords:e,className:"name"}),S=t.inherit(d,{className:"name",keywords:e,starts:t.inherit(A,{end:/\}\}/})});return{name:"Handlebars",aliases:["hbs","html.hbs","html.handlebars","htmlbars"],case_insensitive:!0,subLanguage:"xml",contains:[{begin:/\\\{\{/,skip:!0},{begin:/\\\\(?=\{\{)/,skip:!0},t.COMMENT(/\{\{!--/,/--\}\}/),t.COMMENT(/\{\{!/,/\}\}/),{className:"template-tag",begin:/\{\{\{\{(?!\/)/,end:/\}\}\}\}/,contains:[E],starts:{end:/\{\{\{\{\//,returnEnd:!0,subLanguage:"xml"}},{className:"template-tag",begin:/\{\{\{\{\//,end:/\}\}\}\}/,contains:[_]},{className:"template-tag",begin:/\{\{#/,end:/\}\}/,contains:[E]},{className:"template-tag",begin:/\{\{(?=else\}\})/,end:/\}\}/,keywords:"else"},{className:"template-tag",begin:/\{\{(?=else if)/,end:/\}\}/,keywords:"else if"},{className:"template-tag",begin:/\{\{\//,end:/\}\}/,contains:[_]},{className:"template-variable",begin:/\{\{\{/,end:/\}\}\}/,contains:[S]},{className:"template-variable",begin:/\{\{/,end:/\}\}/,contains:[S]}]}}function ZLi(t){let e=XLi(t);return e.name="HTMLbars",t.getLanguage("handlebars")&&(e.disableAutodetect=!0),e}RMn.exports=ZLi});var NMn=re((Vcc,BMn)=>{p();function e2i(t){return t?typeof t=="string"?t:t.source:null}function t2i(...t){return t.map(n=>e2i(n)).join("")}function n2i(t){let e="HTTP/(2|1\\.[01])",r={className:"attribute",begin:t2i("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},i=[r,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+e+" \\d{3})",end:/$/,contains:[{className:"meta",begin:e},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},{begin:"(?=^[A-Z]+ (.*?) "+e+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:e},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},t.inherit(r,{relevance:0})]}}BMn.exports=n2i});var PMn=re((zcc,DMn)=>{p();function r2i(t){var e="a-zA-Z_\\-!.?+*=<>&#'",n="["+e+"]["+e+"0-9/;:]*",r={$pattern:n,"builtin-name":"!= % %= & &= * ** **= *= *map + += , --build-class-- --import-- -= . / // //= /= < << <<= <= = > >= >> >>= @ @= ^ ^= abs accumulate all and any ap-compose ap-dotimes ap-each ap-each-while ap-filter ap-first ap-if ap-last ap-map ap-map-when ap-pipe ap-reduce ap-reject apply as-> ascii assert assoc bin break butlast callable calling-module-name car case cdr chain chr coll? combinations compile compress cond cons cons? continue count curry cut cycle dec def default-method defclass defmacro defmacro-alias defmacro/g! defmain defmethod defmulti defn defn-alias defnc defnr defreader defseq del delattr delete-route dict-comp dir disassemble dispatch-reader-macro distinct divmod do doto drop drop-last drop-while empty? end-sequence eval eval-and-compile eval-when-compile even? every? except exec filter first flatten float? fn fnc fnr for for* format fraction genexpr gensym get getattr global globals group-by hasattr hash hex id identity if if* if-not if-python2 import in inc input instance? integer integer-char? integer? interleave interpose is is-coll is-cons is-empty is-even is-every is-float is-instance is-integer is-integer-char is-iterable is-iterator is-keyword is-neg is-none is-not is-numeric is-odd is-pos is-string is-symbol is-zero isinstance islice issubclass iter iterable? iterate iterator? keyword keyword? lambda last len let lif lif-not list* list-comp locals loop macro-error macroexpand macroexpand-1 macroexpand-all map max merge-with method-decorator min multi-decorator multicombinations name neg? next none? nonlocal not not-in not? nth numeric? oct odd? open or ord partition permutations pos? post-route postwalk pow prewalk print product profile/calls profile/cpu put-route quasiquote quote raise range read read-str recursive-replace reduce remove repeat repeatedly repr require rest round route route-with-methods rwm second seq set-comp setattr setv some sorted string string? sum switch symbol? take take-nth take-while tee try unless unquote unquote-splicing vars walk when while with with* with-decorator with-gensyms xi xor yield yield-from zero? zip zip-longest | |= ~"},i="[-+]?\\d+(\\.\\d+)?",s={begin:n,relevance:0},o={className:"number",begin:i,relevance:0},a=t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),c=t.COMMENT(";","$",{relevance:0}),u={className:"literal",begin:/\b([Tt]rue|[Ff]alse|nil|None)\b/},l={begin:"[\\[\\{]",end:"[\\]\\}]"},d={className:"comment",begin:"\\^"+n},m=t.COMMENT("\\^\\{","\\}"),h={className:"symbol",begin:"[:]{1,2}"+n},f={begin:"\\(",end:"\\)"},g={endsWithParent:!0,relevance:0},A={className:"name",relevance:0,keywords:r,begin:n,starts:g},y=[f,a,d,m,c,h,l,o,u,s];return f.contains=[t.COMMENT("comment",""),A,g],g.contains=y,l.contains=y,{name:"Hy",aliases:["hylang"],illegal:/\S/,contains:[t.SHEBANG(),f,a,d,m,c,h,l,o,u]}}DMn.exports=r2i});var OMn=re((Jcc,MMn)=>{p();function i2i(t){return{name:"Inform 7",aliases:["i7"],case_insensitive:!0,keywords:{keyword:"thing room person man woman animal container supporter backdrop door scenery open closed locked inside gender is are say understand kind of rule"},contains:[{className:"string",begin:'"',end:'"',relevance:0,contains:[{className:"subst",begin:"\\[",end:"\\]"}]},{className:"section",begin:/^(Volume|Book|Part|Chapter|Section|Table)\b/,end:"$"},{begin:/^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,end:":",contains:[{begin:"\\(This",end:"\\)"}]},{className:"comment",begin:"\\[",end:"\\]",contains:["self"]}]}}MMn.exports=i2i});var UMn=re((Zcc,QMn)=>{p();function LMn(t){return t?typeof t=="string"?t:t.source:null}function s2i(t){return FMn("(?=",t,")")}function FMn(...t){return t.map(n=>LMn(n)).join("")}function o2i(...t){return"("+t.map(n=>LMn(n)).join("|")+")"}function a2i(t){let e={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},n=t.COMMENT();n.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},o={begin:/\[/,end:/\]/,contains:[n,i,r,s,e,"self"],relevance:0},l=o2i(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/),d=FMn(l,"(\\s*\\.\\s*",l,")*",s2i(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[n,{className:"section",begin:/\[+/,end:/\]+/},{begin:d,className:"attr",starts:{end:/$/,contains:[n,o,i,r,s,e]}}]}}QMn.exports=a2i});var $Mn=re((tlc,GMn)=>{p();function c2i(t){return t?typeof t=="string"?t:t.source:null}function $at(...t){return t.map(n=>c2i(n)).join("")}function l2i(t){let e={className:"params",begin:"\\(",end:"\\)"},n=/(_[a-z_\d]+)?/,r=/([de][+-]?\d+)?/,i={className:"number",variants:[{begin:$at(/\b\d+/,/\.(\d*)/,r,n)},{begin:$at(/\b\d+/,r,n)},{begin:$at(/\.\d+/,r,n)}],relevance:0};return{name:"IRPF90",case_insensitive:!0,keywords:{literal:".False. .True.",keyword:"kind do while private call intrinsic where elsewhere type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. goto save else use module select case access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit continue format pause cycle exit c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg synchronous nopass non_overridable pass protected volatile abstract extends import non_intrinsic value deferred generic final enumerator class associate bind enum c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated c_f_pointer c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure integer real character complex logical dimension allocatable|10 parameter external implicit|10 none double precision assign intent optional pointer target in out common equivalence data begin_provider &begin_provider end_provider begin_shell end_shell begin_template end_template subst assert touch soft_touch provide no_dep free irp_if irp_else irp_endif irp_write irp_read",built_in:"alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image IRP_ALIGN irp_here"},illegal:/\/\*/,contains:[t.inherit(t.APOS_STRING_MODE,{className:"string",relevance:0}),t.inherit(t.QUOTE_STRING_MODE,{className:"string",relevance:0}),{className:"function",beginKeywords:"subroutine function program",illegal:"[${=\\n]",contains:[t.UNDERSCORE_TITLE_MODE,e]},t.COMMENT("!","$",{relevance:0}),t.COMMENT("begin_doc","end_doc",{relevance:10}),i]}}GMn.exports=l2i});var HMn=re((rlc,WMn)=>{p();function u2i(t){let e="[A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_!][A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_0-9]*",n="[A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_][A-Za-z\u0410-\u042F\u0430-\u044F\u0451\u0401_0-9]*",r="and \u0438 else \u0438\u043D\u0430\u0447\u0435 endexcept endfinally endforeach \u043A\u043E\u043D\u0435\u0446\u0432\u0441\u0435 endif \u043A\u043E\u043D\u0435\u0446\u0435\u0441\u043B\u0438 endwhile \u043A\u043E\u043D\u0435\u0446\u043F\u043E\u043A\u0430 except exitfor finally foreach \u0432\u0441\u0435 if \u0435\u0441\u043B\u0438 in \u0432 not \u043D\u0435 or \u0438\u043B\u0438 try while \u043F\u043E\u043A\u0430 ",ie="SYSRES_CONST_ACCES_RIGHT_TYPE_EDIT SYSRES_CONST_ACCES_RIGHT_TYPE_FULL SYSRES_CONST_ACCES_RIGHT_TYPE_VIEW SYSRES_CONST_ACCESS_MODE_REQUISITE_CODE SYSRES_CONST_ACCESS_NO_ACCESS_VIEW SYSRES_CONST_ACCESS_NO_ACCESS_VIEW_CODE SYSRES_CONST_ACCESS_RIGHTS_ADD_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_ADD_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_CHANGE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_CHANGE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_DELETE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_DELETE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_EXECUTE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_EXECUTE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_NO_ACCESS_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_NO_ACCESS_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_RATIFY_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_RATIFY_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW SYSRES_CONST_ACCESS_RIGHTS_VIEW_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_TYPE_CHANGE SYSRES_CONST_ACCESS_TYPE_CHANGE_CODE SYSRES_CONST_ACCESS_TYPE_EXISTS SYSRES_CONST_ACCESS_TYPE_EXISTS_CODE SYSRES_CONST_ACCESS_TYPE_FULL SYSRES_CONST_ACCESS_TYPE_FULL_CODE SYSRES_CONST_ACCESS_TYPE_VIEW SYSRES_CONST_ACCESS_TYPE_VIEW_CODE SYSRES_CONST_ACTION_TYPE_ABORT SYSRES_CONST_ACTION_TYPE_ACCEPT SYSRES_CONST_ACTION_TYPE_ACCESS_RIGHTS SYSRES_CONST_ACTION_TYPE_ADD_ATTACHMENT SYSRES_CONST_ACTION_TYPE_CHANGE_CARD SYSRES_CONST_ACTION_TYPE_CHANGE_KIND SYSRES_CONST_ACTION_TYPE_CHANGE_STORAGE SYSRES_CONST_ACTION_TYPE_CONTINUE SYSRES_CONST_ACTION_TYPE_COPY SYSRES_CONST_ACTION_TYPE_CREATE SYSRES_CONST_ACTION_TYPE_CREATE_VERSION SYSRES_CONST_ACTION_TYPE_DELETE SYSRES_CONST_ACTION_TYPE_DELETE_ATTACHMENT SYSRES_CONST_ACTION_TYPE_DELETE_VERSION SYSRES_CONST_ACTION_TYPE_DISABLE_DELEGATE_ACCESS_RIGHTS SYSRES_CONST_ACTION_TYPE_ENABLE_DELEGATE_ACCESS_RIGHTS SYSRES_CONST_ACTION_TYPE_ENCRYPTION_BY_CERTIFICATE SYSRES_CONST_ACTION_TYPE_ENCRYPTION_BY_CERTIFICATE_AND_PASSWORD SYSRES_CONST_ACTION_TYPE_ENCRYPTION_BY_PASSWORD SYSRES_CONST_ACTION_TYPE_EXPORT_WITH_LOCK SYSRES_CONST_ACTION_TYPE_EXPORT_WITHOUT_LOCK SYSRES_CONST_ACTION_TYPE_IMPORT_WITH_UNLOCK SYSRES_CONST_ACTION_TYPE_IMPORT_WITHOUT_UNLOCK SYSRES_CONST_ACTION_TYPE_LIFE_CYCLE_STAGE SYSRES_CONST_ACTION_TYPE_LOCK SYSRES_CONST_ACTION_TYPE_LOCK_FOR_SERVER SYSRES_CONST_ACTION_TYPE_LOCK_MODIFY SYSRES_CONST_ACTION_TYPE_MARK_AS_READED SYSRES_CONST_ACTION_TYPE_MARK_AS_UNREADED SYSRES_CONST_ACTION_TYPE_MODIFY SYSRES_CONST_ACTION_TYPE_MODIFY_CARD SYSRES_CONST_ACTION_TYPE_MOVE_TO_ARCHIVE SYSRES_CONST_ACTION_TYPE_OFF_ENCRYPTION SYSRES_CONST_ACTION_TYPE_PASSWORD_CHANGE SYSRES_CONST_ACTION_TYPE_PERFORM SYSRES_CONST_ACTION_TYPE_RECOVER_FROM_LOCAL_COPY SYSRES_CONST_ACTION_TYPE_RESTART SYSRES_CONST_ACTION_TYPE_RESTORE_FROM_ARCHIVE SYSRES_CONST_ACTION_TYPE_REVISION SYSRES_CONST_ACTION_TYPE_SEND_BY_MAIL SYSRES_CONST_ACTION_TYPE_SIGN SYSRES_CONST_ACTION_TYPE_START SYSRES_CONST_ACTION_TYPE_UNLOCK SYSRES_CONST_ACTION_TYPE_UNLOCK_FROM_SERVER SYSRES_CONST_ACTION_TYPE_VERSION_STATE SYSRES_CONST_ACTION_TYPE_VERSION_VISIBILITY SYSRES_CONST_ACTION_TYPE_VIEW SYSRES_CONST_ACTION_TYPE_VIEW_SHADOW_COPY SYSRES_CONST_ACTION_TYPE_WORKFLOW_DESCRIPTION_MODIFY SYSRES_CONST_ACTION_TYPE_WRITE_HISTORY SYSRES_CONST_ACTIVE_VERSION_STATE_PICK_VALUE SYSRES_CONST_ADD_REFERENCE_MODE_NAME SYSRES_CONST_ADDITION_REQUISITE_CODE SYSRES_CONST_ADDITIONAL_PARAMS_REQUISITE_CODE SYSRES_CONST_ADITIONAL_JOB_END_DATE_REQUISITE_NAME SYSRES_CONST_ADITIONAL_JOB_READ_REQUISITE_NAME SYSRES_CONST_ADITIONAL_JOB_START_DATE_REQUISITE_NAME SYSRES_CONST_ADITIONAL_JOB_STATE_REQUISITE_NAME SYSRES_CONST_ADMINISTRATION_HISTORY_ADDING_USER_TO_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_ADDING_USER_TO_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_COMP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_COMP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_USER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_USER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_CREATION SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_CREATION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_DELETION SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_DELETION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_COMP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_COMP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_FROM_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_FROM_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_RESTRICTION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_RESTRICTION_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_PRIVILEGE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_PRIVILEGE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_RIGHTS_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_RIGHTS_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_IS_MAIN_SERVER_CHANGED_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_IS_MAIN_SERVER_CHANGED_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_IS_PUBLIC_CHANGED_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_IS_PUBLIC_CHANGED_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_RESTRICTION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_RESTRICTION_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_PRIVILEGE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_PRIVILEGE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_RIGHTS_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_RIGHTS_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_CREATION SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_CREATION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_DELETION SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_DELETION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_CATEGORY_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_CATEGORY_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_COMP_TITLE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_COMP_TITLE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_FULL_NAME_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_FULL_NAME_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_PARENT_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_PARENT_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_AUTH_TYPE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_AUTH_TYPE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_LOGIN_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_LOGIN_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_STATUS_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_STATUS_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_USER_PASSWORD_CHANGE SYSRES_CONST_ADMINISTRATION_HISTORY_USER_PASSWORD_CHANGE_ACTION SYSRES_CONST_ALL_ACCEPT_CONDITION_RUS SYSRES_CONST_ALL_USERS_GROUP SYSRES_CONST_ALL_USERS_GROUP_NAME SYSRES_CONST_ALL_USERS_SERVER_GROUP_NAME SYSRES_CONST_ALLOWED_ACCESS_TYPE_CODE SYSRES_CONST_ALLOWED_ACCESS_TYPE_NAME SYSRES_CONST_APP_VIEWER_TYPE_REQUISITE_CODE SYSRES_CONST_APPROVING_SIGNATURE_NAME SYSRES_CONST_APPROVING_SIGNATURE_REQUISITE_CODE SYSRES_CONST_ASSISTANT_SUBSTITUE_TYPE SYSRES_CONST_ASSISTANT_SUBSTITUE_TYPE_CODE SYSRES_CONST_ATTACH_TYPE_COMPONENT_TOKEN SYSRES_CONST_ATTACH_TYPE_DOC SYSRES_CONST_ATTACH_TYPE_EDOC SYSRES_CONST_ATTACH_TYPE_FOLDER SYSRES_CONST_ATTACH_TYPE_JOB SYSRES_CONST_ATTACH_TYPE_REFERENCE SYSRES_CONST_ATTACH_TYPE_TASK SYSRES_CONST_AUTH_ENCODED_PASSWORD SYSRES_CONST_AUTH_ENCODED_PASSWORD_CODE SYSRES_CONST_AUTH_NOVELL SYSRES_CONST_AUTH_PASSWORD SYSRES_CONST_AUTH_PASSWORD_CODE SYSRES_CONST_AUTH_WINDOWS SYSRES_CONST_AUTHENTICATING_SIGNATURE_NAME SYSRES_CONST_AUTHENTICATING_SIGNATURE_REQUISITE_CODE SYSRES_CONST_AUTO_ENUM_METHOD_FLAG SYSRES_CONST_AUTO_NUMERATION_CODE SYSRES_CONST_AUTO_STRONG_ENUM_METHOD_FLAG SYSRES_CONST_AUTOTEXT_NAME_REQUISITE_CODE SYSRES_CONST_AUTOTEXT_TEXT_REQUISITE_CODE SYSRES_CONST_AUTOTEXT_USAGE_ALL SYSRES_CONST_AUTOTEXT_USAGE_ALL_CODE SYSRES_CONST_AUTOTEXT_USAGE_SIGN SYSRES_CONST_AUTOTEXT_USAGE_SIGN_CODE SYSRES_CONST_AUTOTEXT_USAGE_WORK SYSRES_CONST_AUTOTEXT_USAGE_WORK_CODE SYSRES_CONST_AUTOTEXT_USE_ANYWHERE_CODE SYSRES_CONST_AUTOTEXT_USE_ON_SIGNING_CODE SYSRES_CONST_AUTOTEXT_USE_ON_WORK_CODE SYSRES_CONST_BEGIN_DATE_REQUISITE_CODE SYSRES_CONST_BLACK_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_BLUE_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_BTN_PART SYSRES_CONST_CALCULATED_ROLE_TYPE_CODE SYSRES_CONST_CALL_TYPE_VARIABLE_BUTTON_VALUE SYSRES_CONST_CALL_TYPE_VARIABLE_PROGRAM_VALUE SYSRES_CONST_CANCEL_MESSAGE_FUNCTION_RESULT SYSRES_CONST_CARD_PART SYSRES_CONST_CARD_REFERENCE_MODE_NAME SYSRES_CONST_CERTIFICATE_TYPE_REQUISITE_ENCRYPT_VALUE SYSRES_CONST_CERTIFICATE_TYPE_REQUISITE_SIGN_AND_ENCRYPT_VALUE SYSRES_CONST_CERTIFICATE_TYPE_REQUISITE_SIGN_VALUE SYSRES_CONST_CHECK_PARAM_VALUE_DATE_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_FLOAT_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_INTEGER_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_PICK_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_REEFRENCE_PARAM_TYPE SYSRES_CONST_CLOSED_RECORD_FLAG_VALUE_FEMININE SYSRES_CONST_CLOSED_RECORD_FLAG_VALUE_MASCULINE SYSRES_CONST_CODE_COMPONENT_TYPE_ADMIN SYSRES_CONST_CODE_COMPONENT_TYPE_DEVELOPER SYSRES_CONST_CODE_COMPONENT_TYPE_DOCS SYSRES_CONST_CODE_COMPONENT_TYPE_EDOC_CARDS SYSRES_CONST_CODE_COMPONENT_TYPE_EXTERNAL_EXECUTABLE SYSRES_CONST_CODE_COMPONENT_TYPE_OTHER SYSRES_CONST_CODE_COMPONENT_TYPE_REFERENCE SYSRES_CONST_CODE_COMPONENT_TYPE_REPORT SYSRES_CONST_CODE_COMPONENT_TYPE_SCRIPT SYSRES_CONST_CODE_COMPONENT_TYPE_URL SYSRES_CONST_CODE_REQUISITE_ACCESS SYSRES_CONST_CODE_REQUISITE_CODE SYSRES_CONST_CODE_REQUISITE_COMPONENT SYSRES_CONST_CODE_REQUISITE_DESCRIPTION SYSRES_CONST_CODE_REQUISITE_EXCLUDE_COMPONENT SYSRES_CONST_CODE_REQUISITE_RECORD SYSRES_CONST_COMMENT_REQ_CODE SYSRES_CONST_COMMON_SETTINGS_REQUISITE_CODE SYSRES_CONST_COMP_CODE_GRD SYSRES_CONST_COMPONENT_GROUP_TYPE_REQUISITE_CODE SYSRES_CONST_COMPONENT_TYPE_ADMIN_COMPONENTS SYSRES_CONST_COMPONENT_TYPE_DEVELOPER_COMPONENTS SYSRES_CONST_COMPONENT_TYPE_DOCS SYSRES_CONST_COMPONENT_TYPE_EDOC_CARDS SYSRES_CONST_COMPONENT_TYPE_EDOCS SYSRES_CONST_COMPONENT_TYPE_EXTERNAL_EXECUTABLE SYSRES_CONST_COMPONENT_TYPE_OTHER SYSRES_CONST_COMPONENT_TYPE_REFERENCE_TYPES SYSRES_CONST_COMPONENT_TYPE_REFERENCES SYSRES_CONST_COMPONENT_TYPE_REPORTS SYSRES_CONST_COMPONENT_TYPE_SCRIPTS SYSRES_CONST_COMPONENT_TYPE_URL SYSRES_CONST_COMPONENTS_REMOTE_SERVERS_VIEW_CODE SYSRES_CONST_CONDITION_BLOCK_DESCRIPTION SYSRES_CONST_CONST_FIRM_STATUS_COMMON SYSRES_CONST_CONST_FIRM_STATUS_INDIVIDUAL SYSRES_CONST_CONST_NEGATIVE_VALUE SYSRES_CONST_CONST_POSITIVE_VALUE SYSRES_CONST_CONST_SERVER_STATUS_DONT_REPLICATE SYSRES_CONST_CONST_SERVER_STATUS_REPLICATE SYSRES_CONST_CONTENTS_REQUISITE_CODE SYSRES_CONST_DATA_TYPE_BOOLEAN SYSRES_CONST_DATA_TYPE_DATE SYSRES_CONST_DATA_TYPE_FLOAT SYSRES_CONST_DATA_TYPE_INTEGER SYSRES_CONST_DATA_TYPE_PICK SYSRES_CONST_DATA_TYPE_REFERENCE SYSRES_CONST_DATA_TYPE_STRING SYSRES_CONST_DATA_TYPE_TEXT SYSRES_CONST_DATA_TYPE_VARIANT SYSRES_CONST_DATE_CLOSE_REQ_CODE SYSRES_CONST_DATE_FORMAT_DATE_ONLY_CHAR SYSRES_CONST_DATE_OPEN_REQ_CODE SYSRES_CONST_DATE_REQUISITE SYSRES_CONST_DATE_REQUISITE_CODE SYSRES_CONST_DATE_REQUISITE_NAME SYSRES_CONST_DATE_REQUISITE_TYPE SYSRES_CONST_DATE_TYPE_CHAR SYSRES_CONST_DATETIME_FORMAT_VALUE SYSRES_CONST_DEA_ACCESS_RIGHTS_ACTION_CODE SYSRES_CONST_DESCRIPTION_LOCALIZE_ID_REQUISITE_CODE SYSRES_CONST_DESCRIPTION_REQUISITE_CODE SYSRES_CONST_DET1_PART SYSRES_CONST_DET2_PART SYSRES_CONST_DET3_PART SYSRES_CONST_DET4_PART SYSRES_CONST_DET5_PART SYSRES_CONST_DET6_PART SYSRES_CONST_DETAIL_DATASET_KEY_REQUISITE_CODE SYSRES_CONST_DETAIL_PICK_REQUISITE_CODE SYSRES_CONST_DETAIL_REQ_CODE SYSRES_CONST_DO_NOT_USE_ACCESS_TYPE_CODE SYSRES_CONST_DO_NOT_USE_ACCESS_TYPE_NAME SYSRES_CONST_DO_NOT_USE_ON_VIEW_ACCESS_TYPE_CODE SYSRES_CONST_DO_NOT_USE_ON_VIEW_ACCESS_TYPE_NAME SYSRES_CONST_DOCUMENT_STORAGES_CODE SYSRES_CONST_DOCUMENT_TEMPLATES_TYPE_NAME SYSRES_CONST_DOUBLE_REQUISITE_CODE SYSRES_CONST_EDITOR_CLOSE_FILE_OBSERV_TYPE_CODE SYSRES_CONST_EDITOR_CLOSE_PROCESS_OBSERV_TYPE_CODE SYSRES_CONST_EDITOR_TYPE_REQUISITE_CODE SYSRES_CONST_EDITORS_APPLICATION_NAME_REQUISITE_CODE SYSRES_CONST_EDITORS_CREATE_SEVERAL_PROCESSES_REQUISITE_CODE SYSRES_CONST_EDITORS_EXTENSION_REQUISITE_CODE SYSRES_CONST_EDITORS_OBSERVER_BY_PROCESS_TYPE SYSRES_CONST_EDITORS_REFERENCE_CODE SYSRES_CONST_EDITORS_REPLACE_SPEC_CHARS_REQUISITE_CODE SYSRES_CONST_EDITORS_USE_PLUGINS_REQUISITE_CODE SYSRES_CONST_EDITORS_VIEW_DOCUMENT_OPENED_TO_EDIT_CODE SYSRES_CONST_EDOC_CARD_TYPE_REQUISITE_CODE SYSRES_CONST_EDOC_CARD_TYPES_LINK_REQUISITE_CODE SYSRES_CONST_EDOC_CERTIFICATE_AND_PASSWORD_ENCODE_CODE SYSRES_CONST_EDOC_CERTIFICATE_ENCODE_CODE SYSRES_CONST_EDOC_DATE_REQUISITE_CODE SYSRES_CONST_EDOC_KIND_REFERENCE_CODE SYSRES_CONST_EDOC_KINDS_BY_TEMPLATE_ACTION_CODE SYSRES_CONST_EDOC_MANAGE_ACCESS_CODE SYSRES_CONST_EDOC_NONE_ENCODE_CODE SYSRES_CONST_EDOC_NUMBER_REQUISITE_CODE SYSRES_CONST_EDOC_PASSWORD_ENCODE_CODE SYSRES_CONST_EDOC_READONLY_ACCESS_CODE SYSRES_CONST_EDOC_SHELL_LIFE_TYPE_VIEW_VALUE SYSRES_CONST_EDOC_SIZE_RESTRICTION_PRIORITY_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_CHECK_ACCESS_RIGHTS_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_COMPUTER_NAME_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_DATABASE_NAME_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_EDIT_IN_STORAGE_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_LOCAL_PATH_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_SHARED_SOURCE_NAME_REQUISITE_CODE SYSRES_CONST_EDOC_TEMPLATE_REQUISITE_CODE SYSRES_CONST_EDOC_TYPES_REFERENCE_CODE SYSRES_CONST_EDOC_VERSION_ACTIVE_STAGE_CODE SYSRES_CONST_EDOC_VERSION_DESIGN_STAGE_CODE SYSRES_CONST_EDOC_VERSION_OBSOLETE_STAGE_CODE SYSRES_CONST_EDOC_WRITE_ACCES_CODE SYSRES_CONST_EDOCUMENT_CARD_REQUISITES_REFERENCE_CODE_SELECTED_REQUISITE SYSRES_CONST_ENCODE_CERTIFICATE_TYPE_CODE SYSRES_CONST_END_DATE_REQUISITE_CODE SYSRES_CONST_ENUMERATION_TYPE_REQUISITE_CODE SYSRES_CONST_EXECUTE_ACCESS_RIGHTS_TYPE_CODE SYSRES_CONST_EXECUTIVE_FILE_STORAGE_TYPE SYSRES_CONST_EXIST_CONST SYSRES_CONST_EXIST_VALUE SYSRES_CONST_EXPORT_LOCK_TYPE_ASK SYSRES_CONST_EXPORT_LOCK_TYPE_WITH_LOCK SYSRES_CONST_EXPORT_LOCK_TYPE_WITHOUT_LOCK SYSRES_CONST_EXPORT_VERSION_TYPE_ASK SYSRES_CONST_EXPORT_VERSION_TYPE_LAST SYSRES_CONST_EXPORT_VERSION_TYPE_LAST_ACTIVE SYSRES_CONST_EXTENSION_REQUISITE_CODE SYSRES_CONST_FILTER_NAME_REQUISITE_CODE SYSRES_CONST_FILTER_REQUISITE_CODE SYSRES_CONST_FILTER_TYPE_COMMON_CODE SYSRES_CONST_FILTER_TYPE_COMMON_NAME SYSRES_CONST_FILTER_TYPE_USER_CODE SYSRES_CONST_FILTER_TYPE_USER_NAME SYSRES_CONST_FILTER_VALUE_REQUISITE_NAME SYSRES_CONST_FLOAT_NUMBER_FORMAT_CHAR SYSRES_CONST_FLOAT_REQUISITE_TYPE SYSRES_CONST_FOLDER_AUTHOR_VALUE SYSRES_CONST_FOLDER_KIND_ANY_OBJECTS SYSRES_CONST_FOLDER_KIND_COMPONENTS SYSRES_CONST_FOLDER_KIND_EDOCS SYSRES_CONST_FOLDER_KIND_JOBS SYSRES_CONST_FOLDER_KIND_TASKS SYSRES_CONST_FOLDER_TYPE_COMMON SYSRES_CONST_FOLDER_TYPE_COMPONENT SYSRES_CONST_FOLDER_TYPE_FAVORITES SYSRES_CONST_FOLDER_TYPE_INBOX SYSRES_CONST_FOLDER_TYPE_OUTBOX SYSRES_CONST_FOLDER_TYPE_QUICK_LAUNCH SYSRES_CONST_FOLDER_TYPE_SEARCH SYSRES_CONST_FOLDER_TYPE_SHORTCUTS SYSRES_CONST_FOLDER_TYPE_USER SYSRES_CONST_FROM_DICTIONARY_ENUM_METHOD_FLAG SYSRES_CONST_FULL_SUBSTITUTE_TYPE SYSRES_CONST_FULL_SUBSTITUTE_TYPE_CODE SYSRES_CONST_FUNCTION_CANCEL_RESULT SYSRES_CONST_FUNCTION_CATEGORY_SYSTEM SYSRES_CONST_FUNCTION_CATEGORY_USER SYSRES_CONST_FUNCTION_FAILURE_RESULT SYSRES_CONST_FUNCTION_SAVE_RESULT SYSRES_CONST_GENERATED_REQUISITE SYSRES_CONST_GREEN_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_GROUP_ACCOUNT_TYPE_VALUE_CODE SYSRES_CONST_GROUP_CATEGORY_NORMAL_CODE SYSRES_CONST_GROUP_CATEGORY_NORMAL_NAME SYSRES_CONST_GROUP_CATEGORY_SERVICE_CODE SYSRES_CONST_GROUP_CATEGORY_SERVICE_NAME SYSRES_CONST_GROUP_COMMON_CATEGORY_FIELD_VALUE SYSRES_CONST_GROUP_FULL_NAME_REQUISITE_CODE SYSRES_CONST_GROUP_NAME_REQUISITE_CODE SYSRES_CONST_GROUP_RIGHTS_T_REQUISITE_CODE SYSRES_CONST_GROUP_SERVER_CODES_REQUISITE_CODE SYSRES_CONST_GROUP_SERVER_NAME_REQUISITE_CODE SYSRES_CONST_GROUP_SERVICE_CATEGORY_FIELD_VALUE SYSRES_CONST_GROUP_USER_REQUISITE_CODE SYSRES_CONST_GROUPS_REFERENCE_CODE SYSRES_CONST_GROUPS_REQUISITE_CODE SYSRES_CONST_HIDDEN_MODE_NAME SYSRES_CONST_HIGH_LVL_REQUISITE_CODE SYSRES_CONST_HISTORY_ACTION_CREATE_CODE SYSRES_CONST_HISTORY_ACTION_DELETE_CODE SYSRES_CONST_HISTORY_ACTION_EDIT_CODE SYSRES_CONST_HOUR_CHAR SYSRES_CONST_ID_REQUISITE_CODE SYSRES_CONST_IDSPS_REQUISITE_CODE SYSRES_CONST_IMAGE_MODE_COLOR SYSRES_CONST_IMAGE_MODE_GREYSCALE SYSRES_CONST_IMAGE_MODE_MONOCHROME SYSRES_CONST_IMPORTANCE_HIGH SYSRES_CONST_IMPORTANCE_LOW SYSRES_CONST_IMPORTANCE_NORMAL SYSRES_CONST_IN_DESIGN_VERSION_STATE_PICK_VALUE SYSRES_CONST_INCOMING_WORK_RULE_TYPE_CODE SYSRES_CONST_INT_REQUISITE SYSRES_CONST_INT_REQUISITE_TYPE SYSRES_CONST_INTEGER_NUMBER_FORMAT_CHAR SYSRES_CONST_INTEGER_TYPE_CHAR SYSRES_CONST_IS_GENERATED_REQUISITE_NEGATIVE_VALUE SYSRES_CONST_IS_PUBLIC_ROLE_REQUISITE_CODE SYSRES_CONST_IS_REMOTE_USER_NEGATIVE_VALUE SYSRES_CONST_IS_REMOTE_USER_POSITIVE_VALUE SYSRES_CONST_IS_STORED_REQUISITE_NEGATIVE_VALUE SYSRES_CONST_IS_STORED_REQUISITE_STORED_VALUE SYSRES_CONST_ITALIC_LIFE_CYCLE_STAGE_DRAW_STYLE SYSRES_CONST_JOB_BLOCK_DESCRIPTION SYSRES_CONST_JOB_KIND_CONTROL_JOB SYSRES_CONST_JOB_KIND_JOB SYSRES_CONST_JOB_KIND_NOTICE SYSRES_CONST_JOB_STATE_ABORTED SYSRES_CONST_JOB_STATE_COMPLETE SYSRES_CONST_JOB_STATE_WORKING SYSRES_CONST_KIND_REQUISITE_CODE SYSRES_CONST_KIND_REQUISITE_NAME SYSRES_CONST_KINDS_CREATE_SHADOW_COPIES_REQUISITE_CODE SYSRES_CONST_KINDS_DEFAULT_EDOC_LIFE_STAGE_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_ALL_TEPLATES_ALLOWED_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_ALLOW_LIFE_CYCLE_STAGE_CHANGING_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_ALLOW_MULTIPLE_ACTIVE_VERSIONS_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_SHARE_ACCES_RIGHTS_BY_DEFAULT_CODE SYSRES_CONST_KINDS_EDOC_TEMPLATE_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_TYPE_REQUISITE_CODE SYSRES_CONST_KINDS_SIGNERS_REQUISITES_CODE SYSRES_CONST_KOD_INPUT_TYPE SYSRES_CONST_LAST_UPDATE_DATE_REQUISITE_CODE SYSRES_CONST_LIFE_CYCLE_START_STAGE_REQUISITE_CODE SYSRES_CONST_LILAC_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_LINK_OBJECT_KIND_COMPONENT SYSRES_CONST_LINK_OBJECT_KIND_DOCUMENT SYSRES_CONST_LINK_OBJECT_KIND_EDOC SYSRES_CONST_LINK_OBJECT_KIND_FOLDER SYSRES_CONST_LINK_OBJECT_KIND_JOB SYSRES_CONST_LINK_OBJECT_KIND_REFERENCE SYSRES_CONST_LINK_OBJECT_KIND_TASK SYSRES_CONST_LINK_REF_TYPE_REQUISITE_CODE SYSRES_CONST_LIST_REFERENCE_MODE_NAME SYSRES_CONST_LOCALIZATION_DICTIONARY_MAIN_VIEW_CODE SYSRES_CONST_MAIN_VIEW_CODE SYSRES_CONST_MANUAL_ENUM_METHOD_FLAG SYSRES_CONST_MASTER_COMP_TYPE_REQUISITE_CODE SYSRES_CONST_MASTER_TABLE_REC_ID_REQUISITE_CODE SYSRES_CONST_MAXIMIZED_MODE_NAME SYSRES_CONST_ME_VALUE SYSRES_CONST_MESSAGE_ATTENTION_CAPTION SYSRES_CONST_MESSAGE_CONFIRMATION_CAPTION SYSRES_CONST_MESSAGE_ERROR_CAPTION SYSRES_CONST_MESSAGE_INFORMATION_CAPTION SYSRES_CONST_MINIMIZED_MODE_NAME SYSRES_CONST_MINUTE_CHAR SYSRES_CONST_MODULE_REQUISITE_CODE SYSRES_CONST_MONITORING_BLOCK_DESCRIPTION SYSRES_CONST_MONTH_FORMAT_VALUE SYSRES_CONST_NAME_LOCALIZE_ID_REQUISITE_CODE SYSRES_CONST_NAME_REQUISITE_CODE SYSRES_CONST_NAME_SINGULAR_REQUISITE_CODE SYSRES_CONST_NAMEAN_INPUT_TYPE SYSRES_CONST_NEGATIVE_PICK_VALUE SYSRES_CONST_NEGATIVE_VALUE SYSRES_CONST_NO SYSRES_CONST_NO_PICK_VALUE SYSRES_CONST_NO_SIGNATURE_REQUISITE_CODE SYSRES_CONST_NO_VALUE SYSRES_CONST_NONE_ACCESS_RIGHTS_TYPE_CODE SYSRES_CONST_NONOPERATING_RECORD_FLAG_VALUE SYSRES_CONST_NONOPERATING_RECORD_FLAG_VALUE_MASCULINE SYSRES_CONST_NORMAL_ACCESS_RIGHTS_TYPE_CODE SYSRES_CONST_NORMAL_LIFE_CYCLE_STAGE_DRAW_STYLE SYSRES_CONST_NORMAL_MODE_NAME SYSRES_CONST_NOT_ALLOWED_ACCESS_TYPE_CODE SYSRES_CONST_NOT_ALLOWED_ACCESS_TYPE_NAME SYSRES_CONST_NOTE_REQUISITE_CODE SYSRES_CONST_NOTICE_BLOCK_DESCRIPTION SYSRES_CONST_NUM_REQUISITE SYSRES_CONST_NUM_STR_REQUISITE_CODE SYSRES_CONST_NUMERATION_AUTO_NOT_STRONG SYSRES_CONST_NUMERATION_AUTO_STRONG SYSRES_CONST_NUMERATION_FROM_DICTONARY SYSRES_CONST_NUMERATION_MANUAL SYSRES_CONST_NUMERIC_TYPE_CHAR SYSRES_CONST_NUMREQ_REQUISITE_CODE SYSRES_CONST_OBSOLETE_VERSION_STATE_PICK_VALUE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE_CODE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE_FEMININE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE_MASCULINE SYSRES_CONST_OPTIONAL_FORM_COMP_REQCODE_PREFIX SYSRES_CONST_ORANGE_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_ORIGINALREF_REQUISITE_CODE SYSRES_CONST_OURFIRM_REF_CODE SYSRES_CONST_OURFIRM_REQUISITE_CODE SYSRES_CONST_OURFIRM_VAR SYSRES_CONST_OUTGOING_WORK_RULE_TYPE_CODE SYSRES_CONST_PICK_NEGATIVE_RESULT SYSRES_CONST_PICK_POSITIVE_RESULT SYSRES_CONST_PICK_REQUISITE SYSRES_CONST_PICK_REQUISITE_TYPE SYSRES_CONST_PICK_TYPE_CHAR SYSRES_CONST_PLAN_STATUS_REQUISITE_CODE SYSRES_CONST_PLATFORM_VERSION_COMMENT SYSRES_CONST_PLUGINS_SETTINGS_DESCRIPTION_REQUISITE_CODE SYSRES_CONST_POSITIVE_PICK_VALUE SYSRES_CONST_POWER_TO_CREATE_ACTION_CODE SYSRES_CONST_POWER_TO_SIGN_ACTION_CODE SYSRES_CONST_PRIORITY_REQUISITE_CODE SYSRES_CONST_QUALIFIED_TASK_TYPE SYSRES_CONST_QUALIFIED_TASK_TYPE_CODE SYSRES_CONST_RECSTAT_REQUISITE_CODE SYSRES_CONST_RED_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_REF_ID_T_REF_TYPE_REQUISITE_CODE SYSRES_CONST_REF_REQUISITE SYSRES_CONST_REF_REQUISITE_TYPE SYSRES_CONST_REF_REQUISITES_REFERENCE_CODE_SELECTED_REQUISITE SYSRES_CONST_REFERENCE_RECORD_HISTORY_CREATE_ACTION_CODE SYSRES_CONST_REFERENCE_RECORD_HISTORY_DELETE_ACTION_CODE SYSRES_CONST_REFERENCE_RECORD_HISTORY_MODIFY_ACTION_CODE SYSRES_CONST_REFERENCE_TYPE_CHAR SYSRES_CONST_REFERENCE_TYPE_REQUISITE_NAME SYSRES_CONST_REFERENCES_ADD_PARAMS_REQUISITE_CODE SYSRES_CONST_REFERENCES_DISPLAY_REQUISITE_REQUISITE_CODE SYSRES_CONST_REMOTE_SERVER_STATUS_WORKING SYSRES_CONST_REMOTE_SERVER_TYPE_MAIN SYSRES_CONST_REMOTE_SERVER_TYPE_SECONDARY SYSRES_CONST_REMOTE_USER_FLAG_VALUE_CODE SYSRES_CONST_REPORT_APP_EDITOR_INTERNAL SYSRES_CONST_REPORT_BASE_REPORT_ID_REQUISITE_CODE SYSRES_CONST_REPORT_BASE_REPORT_REQUISITE_CODE SYSRES_CONST_REPORT_SCRIPT_REQUISITE_CODE SYSRES_CONST_REPORT_TEMPLATE_REQUISITE_CODE SYSRES_CONST_REPORT_VIEWER_CODE_REQUISITE_CODE SYSRES_CONST_REQ_ALLOW_COMPONENT_DEFAULT_VALUE SYSRES_CONST_REQ_ALLOW_RECORD_DEFAULT_VALUE SYSRES_CONST_REQ_ALLOW_SERVER_COMPONENT_DEFAULT_VALUE SYSRES_CONST_REQ_MODE_AVAILABLE_CODE SYSRES_CONST_REQ_MODE_EDIT_CODE SYSRES_CONST_REQ_MODE_HIDDEN_CODE SYSRES_CONST_REQ_MODE_NOT_AVAILABLE_CODE SYSRES_CONST_REQ_MODE_VIEW_CODE SYSRES_CONST_REQ_NUMBER_REQUISITE_CODE SYSRES_CONST_REQ_SECTION_VALUE SYSRES_CONST_REQ_TYPE_VALUE SYSRES_CONST_REQUISITE_FORMAT_BY_UNIT SYSRES_CONST_REQUISITE_FORMAT_DATE_FULL SYSRES_CONST_REQUISITE_FORMAT_DATE_TIME SYSRES_CONST_REQUISITE_FORMAT_LEFT SYSRES_CONST_REQUISITE_FORMAT_RIGHT SYSRES_CONST_REQUISITE_FORMAT_WITHOUT_UNIT SYSRES_CONST_REQUISITE_NUMBER_REQUISITE_CODE SYSRES_CONST_REQUISITE_SECTION_ACTIONS SYSRES_CONST_REQUISITE_SECTION_BUTTON SYSRES_CONST_REQUISITE_SECTION_BUTTONS SYSRES_CONST_REQUISITE_SECTION_CARD SYSRES_CONST_REQUISITE_SECTION_TABLE SYSRES_CONST_REQUISITE_SECTION_TABLE10 SYSRES_CONST_REQUISITE_SECTION_TABLE11 SYSRES_CONST_REQUISITE_SECTION_TABLE12 SYSRES_CONST_REQUISITE_SECTION_TABLE13 SYSRES_CONST_REQUISITE_SECTION_TABLE14 SYSRES_CONST_REQUISITE_SECTION_TABLE15 SYSRES_CONST_REQUISITE_SECTION_TABLE16 SYSRES_CONST_REQUISITE_SECTION_TABLE17 SYSRES_CONST_REQUISITE_SECTION_TABLE18 SYSRES_CONST_REQUISITE_SECTION_TABLE19 SYSRES_CONST_REQUISITE_SECTION_TABLE2 SYSRES_CONST_REQUISITE_SECTION_TABLE20 SYSRES_CONST_REQUISITE_SECTION_TABLE21 SYSRES_CONST_REQUISITE_SECTION_TABLE22 SYSRES_CONST_REQUISITE_SECTION_TABLE23 SYSRES_CONST_REQUISITE_SECTION_TABLE24 SYSRES_CONST_REQUISITE_SECTION_TABLE3 SYSRES_CONST_REQUISITE_SECTION_TABLE4 SYSRES_CONST_REQUISITE_SECTION_TABLE5 SYSRES_CONST_REQUISITE_SECTION_TABLE6 SYSRES_CONST_REQUISITE_SECTION_TABLE7 SYSRES_CONST_REQUISITE_SECTION_TABLE8 SYSRES_CONST_REQUISITE_SECTION_TABLE9 SYSRES_CONST_REQUISITES_PSEUDOREFERENCE_REQUISITE_NUMBER_REQUISITE_CODE SYSRES_CONST_RIGHT_ALIGNMENT_CODE SYSRES_CONST_ROLES_REFERENCE_CODE SYSRES_CONST_ROUTE_STEP_AFTER_RUS SYSRES_CONST_ROUTE_STEP_AND_CONDITION_RUS SYSRES_CONST_ROUTE_STEP_OR_CONDITION_RUS SYSRES_CONST_ROUTE_TYPE_COMPLEX SYSRES_CONST_ROUTE_TYPE_PARALLEL SYSRES_CONST_ROUTE_TYPE_SERIAL SYSRES_CONST_SBDATASETDESC_NEGATIVE_VALUE SYSRES_CONST_SBDATASETDESC_POSITIVE_VALUE SYSRES_CONST_SBVIEWSDESC_POSITIVE_VALUE SYSRES_CONST_SCRIPT_BLOCK_DESCRIPTION SYSRES_CONST_SEARCH_BY_TEXT_REQUISITE_CODE SYSRES_CONST_SEARCHES_COMPONENT_CONTENT SYSRES_CONST_SEARCHES_CRITERIA_ACTION_NAME SYSRES_CONST_SEARCHES_EDOC_CONTENT SYSRES_CONST_SEARCHES_FOLDER_CONTENT SYSRES_CONST_SEARCHES_JOB_CONTENT SYSRES_CONST_SEARCHES_REFERENCE_CODE SYSRES_CONST_SEARCHES_TASK_CONTENT SYSRES_CONST_SECOND_CHAR SYSRES_CONST_SECTION_REQUISITE_ACTIONS_VALUE SYSRES_CONST_SECTION_REQUISITE_CARD_VALUE SYSRES_CONST_SECTION_REQUISITE_CODE SYSRES_CONST_SECTION_REQUISITE_DETAIL_1_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_2_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_3_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_4_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_5_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_6_VALUE SYSRES_CONST_SELECT_REFERENCE_MODE_NAME SYSRES_CONST_SELECT_TYPE_SELECTABLE SYSRES_CONST_SELECT_TYPE_SELECTABLE_ONLY_CHILD SYSRES_CONST_SELECT_TYPE_SELECTABLE_WITH_CHILD SYSRES_CONST_SELECT_TYPE_UNSLECTABLE SYSRES_CONST_SERVER_TYPE_MAIN SYSRES_CONST_SERVICE_USER_CATEGORY_FIELD_VALUE SYSRES_CONST_SETTINGS_USER_REQUISITE_CODE SYSRES_CONST_SIGNATURE_AND_ENCODE_CERTIFICATE_TYPE_CODE SYSRES_CONST_SIGNATURE_CERTIFICATE_TYPE_CODE SYSRES_CONST_SINGULAR_TITLE_REQUISITE_CODE SYSRES_CONST_SQL_SERVER_AUTHENTIFICATION_FLAG_VALUE_CODE SYSRES_CONST_SQL_SERVER_ENCODE_AUTHENTIFICATION_FLAG_VALUE_CODE SYSRES_CONST_STANDART_ROUTE_REFERENCE_CODE SYSRES_CONST_STANDART_ROUTE_REFERENCE_COMMENT_REQUISITE_CODE SYSRES_CONST_STANDART_ROUTES_GROUPS_REFERENCE_CODE SYSRES_CONST_STATE_REQ_NAME SYSRES_CONST_STATE_REQUISITE_ACTIVE_VALUE SYSRES_CONST_STATE_REQUISITE_CLOSED_VALUE SYSRES_CONST_STATE_REQUISITE_CODE SYSRES_CONST_STATIC_ROLE_TYPE_CODE SYSRES_CONST_STATUS_PLAN_DEFAULT_VALUE SYSRES_CONST_STATUS_VALUE_AUTOCLEANING SYSRES_CONST_STATUS_VALUE_BLUE_SQUARE SYSRES_CONST_STATUS_VALUE_COMPLETE SYSRES_CONST_STATUS_VALUE_GREEN_SQUARE SYSRES_CONST_STATUS_VALUE_ORANGE_SQUARE SYSRES_CONST_STATUS_VALUE_PURPLE_SQUARE SYSRES_CONST_STATUS_VALUE_RED_SQUARE SYSRES_CONST_STATUS_VALUE_SUSPEND SYSRES_CONST_STATUS_VALUE_YELLOW_SQUARE SYSRES_CONST_STDROUTE_SHOW_TO_USERS_REQUISITE_CODE SYSRES_CONST_STORAGE_TYPE_FILE SYSRES_CONST_STORAGE_TYPE_SQL_SERVER SYSRES_CONST_STR_REQUISITE SYSRES_CONST_STRIKEOUT_LIFE_CYCLE_STAGE_DRAW_STYLE SYSRES_CONST_STRING_FORMAT_LEFT_ALIGN_CHAR SYSRES_CONST_STRING_FORMAT_RIGHT_ALIGN_CHAR SYSRES_CONST_STRING_REQUISITE_CODE SYSRES_CONST_STRING_REQUISITE_TYPE SYSRES_CONST_STRING_TYPE_CHAR SYSRES_CONST_SUBSTITUTES_PSEUDOREFERENCE_CODE SYSRES_CONST_SUBTASK_BLOCK_DESCRIPTION SYSRES_CONST_SYSTEM_SETTING_CURRENT_USER_PARAM_VALUE SYSRES_CONST_SYSTEM_SETTING_EMPTY_VALUE_PARAM_VALUE SYSRES_CONST_SYSTEM_VERSION_COMMENT SYSRES_CONST_TASK_ACCESS_TYPE_ALL SYSRES_CONST_TASK_ACCESS_TYPE_ALL_MEMBERS SYSRES_CONST_TASK_ACCESS_TYPE_MANUAL SYSRES_CONST_TASK_ENCODE_TYPE_CERTIFICATION SYSRES_CONST_TASK_ENCODE_TYPE_CERTIFICATION_AND_PASSWORD SYSRES_CONST_TASK_ENCODE_TYPE_NONE SYSRES_CONST_TASK_ENCODE_TYPE_PASSWORD SYSRES_CONST_TASK_ROUTE_ALL_CONDITION SYSRES_CONST_TASK_ROUTE_AND_CONDITION SYSRES_CONST_TASK_ROUTE_OR_CONDITION SYSRES_CONST_TASK_STATE_ABORTED SYSRES_CONST_TASK_STATE_COMPLETE SYSRES_CONST_TASK_STATE_CONTINUED SYSRES_CONST_TASK_STATE_CONTROL SYSRES_CONST_TASK_STATE_INIT SYSRES_CONST_TASK_STATE_WORKING SYSRES_CONST_TASK_TITLE SYSRES_CONST_TASK_TYPES_GROUPS_REFERENCE_CODE SYSRES_CONST_TASK_TYPES_REFERENCE_CODE SYSRES_CONST_TEMPLATES_REFERENCE_CODE SYSRES_CONST_TEST_DATE_REQUISITE_NAME SYSRES_CONST_TEST_DEV_DATABASE_NAME SYSRES_CONST_TEST_DEV_SYSTEM_CODE SYSRES_CONST_TEST_EDMS_DATABASE_NAME SYSRES_CONST_TEST_EDMS_MAIN_CODE SYSRES_CONST_TEST_EDMS_MAIN_DB_NAME SYSRES_CONST_TEST_EDMS_SECOND_CODE SYSRES_CONST_TEST_EDMS_SECOND_DB_NAME SYSRES_CONST_TEST_EDMS_SYSTEM_CODE SYSRES_CONST_TEST_NUMERIC_REQUISITE_NAME SYSRES_CONST_TEXT_REQUISITE SYSRES_CONST_TEXT_REQUISITE_CODE SYSRES_CONST_TEXT_REQUISITE_TYPE SYSRES_CONST_TEXT_TYPE_CHAR SYSRES_CONST_TYPE_CODE_REQUISITE_CODE SYSRES_CONST_TYPE_REQUISITE_CODE SYSRES_CONST_UNDEFINED_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_UNITS_SECTION_ID_REQUISITE_CODE SYSRES_CONST_UNITS_SECTION_REQUISITE_CODE SYSRES_CONST_UNOPERATING_RECORD_FLAG_VALUE_CODE SYSRES_CONST_UNSTORED_DATA_REQUISITE_CODE SYSRES_CONST_UNSTORED_DATA_REQUISITE_NAME SYSRES_CONST_USE_ACCESS_TYPE_CODE SYSRES_CONST_USE_ACCESS_TYPE_NAME SYSRES_CONST_USER_ACCOUNT_TYPE_VALUE_CODE SYSRES_CONST_USER_ADDITIONAL_INFORMATION_REQUISITE_CODE SYSRES_CONST_USER_AND_GROUP_ID_FROM_PSEUDOREFERENCE_REQUISITE_CODE SYSRES_CONST_USER_CATEGORY_NORMAL SYSRES_CONST_USER_CERTIFICATE_REQUISITE_CODE SYSRES_CONST_USER_CERTIFICATE_STATE_REQUISITE_CODE SYSRES_CONST_USER_CERTIFICATE_SUBJECT_NAME_REQUISITE_CODE SYSRES_CONST_USER_CERTIFICATE_THUMBPRINT_REQUISITE_CODE SYSRES_CONST_USER_COMMON_CATEGORY SYSRES_CONST_USER_COMMON_CATEGORY_CODE SYSRES_CONST_USER_FULL_NAME_REQUISITE_CODE SYSRES_CONST_USER_GROUP_TYPE_REQUISITE_CODE SYSRES_CONST_USER_LOGIN_REQUISITE_CODE SYSRES_CONST_USER_REMOTE_CONTROLLER_REQUISITE_CODE SYSRES_CONST_USER_REMOTE_SYSTEM_REQUISITE_CODE SYSRES_CONST_USER_RIGHTS_T_REQUISITE_CODE SYSRES_CONST_USER_SERVER_NAME_REQUISITE_CODE SYSRES_CONST_USER_SERVICE_CATEGORY SYSRES_CONST_USER_SERVICE_CATEGORY_CODE SYSRES_CONST_USER_STATUS_ADMINISTRATOR_CODE SYSRES_CONST_USER_STATUS_ADMINISTRATOR_NAME SYSRES_CONST_USER_STATUS_DEVELOPER_CODE SYSRES_CONST_USER_STATUS_DEVELOPER_NAME SYSRES_CONST_USER_STATUS_DISABLED_CODE SYSRES_CONST_USER_STATUS_DISABLED_NAME SYSRES_CONST_USER_STATUS_SYSTEM_DEVELOPER_CODE SYSRES_CONST_USER_STATUS_USER_CODE SYSRES_CONST_USER_STATUS_USER_NAME SYSRES_CONST_USER_STATUS_USER_NAME_DEPRECATED SYSRES_CONST_USER_TYPE_FIELD_VALUE_USER SYSRES_CONST_USER_TYPE_REQUISITE_CODE SYSRES_CONST_USERS_CONTROLLER_REQUISITE_CODE SYSRES_CONST_USERS_IS_MAIN_SERVER_REQUISITE_CODE SYSRES_CONST_USERS_REFERENCE_CODE SYSRES_CONST_USERS_REGISTRATION_CERTIFICATES_ACTION_NAME SYSRES_CONST_USERS_REQUISITE_CODE SYSRES_CONST_USERS_SYSTEM_REQUISITE_CODE SYSRES_CONST_USERS_USER_ACCESS_RIGHTS_TYPR_REQUISITE_CODE SYSRES_CONST_USERS_USER_AUTHENTICATION_REQUISITE_CODE SYSRES_CONST_USERS_USER_COMPONENT_REQUISITE_CODE SYSRES_CONST_USERS_USER_GROUP_REQUISITE_CODE SYSRES_CONST_USERS_VIEW_CERTIFICATES_ACTION_NAME SYSRES_CONST_VIEW_DEFAULT_CODE SYSRES_CONST_VIEW_DEFAULT_NAME SYSRES_CONST_VIEWER_REQUISITE_CODE SYSRES_CONST_WAITING_BLOCK_DESCRIPTION SYSRES_CONST_WIZARD_FORM_LABEL_TEST_STRING SYSRES_CONST_WIZARD_QUERY_PARAM_HEIGHT_ETALON_STRING SYSRES_CONST_WIZARD_REFERENCE_COMMENT_REQUISITE_CODE SYSRES_CONST_WORK_RULES_DESCRIPTION_REQUISITE_CODE SYSRES_CONST_WORK_TIME_CALENDAR_REFERENCE_CODE SYSRES_CONST_WORK_WORKFLOW_HARD_ROUTE_TYPE_VALUE SYSRES_CONST_WORK_WORKFLOW_HARD_ROUTE_TYPE_VALUE_CODE SYSRES_CONST_WORK_WORKFLOW_HARD_ROUTE_TYPE_VALUE_CODE_RUS SYSRES_CONST_WORK_WORKFLOW_SOFT_ROUTE_TYPE_VALUE_CODE_RUS SYSRES_CONST_WORKFLOW_ROUTE_TYPR_HARD SYSRES_CONST_WORKFLOW_ROUTE_TYPR_SOFT SYSRES_CONST_XML_ENCODING SYSRES_CONST_XREC_STAT_REQUISITE_CODE SYSRES_CONST_XRECID_FIELD_NAME SYSRES_CONST_YES SYSRES_CONST_YES_NO_2_REQUISITE_CODE SYSRES_CONST_YES_NO_REQUISITE_CODE SYSRES_CONST_YES_NO_T_REF_TYPE_REQUISITE_CODE SYSRES_CONST_YES_PICK_VALUE SYSRES_CONST_YES_VALUE "+"CR FALSE nil NO_VALUE NULL TAB TRUE YES_VALUE "+"ADMINISTRATORS_GROUP_NAME CUSTOMIZERS_GROUP_NAME DEVELOPERS_GROUP_NAME SERVICE_USERS_GROUP_NAME "+"DECISION_BLOCK_FIRST_OPERAND_PROPERTY DECISION_BLOCK_NAME_PROPERTY DECISION_BLOCK_OPERATION_PROPERTY DECISION_BLOCK_RESULT_TYPE_PROPERTY DECISION_BLOCK_SECOND_OPERAND_PROPERTY "+"ANY_FILE_EXTENTION COMPRESSED_DOCUMENT_EXTENSION EXTENDED_DOCUMENT_EXTENSION SHORT_COMPRESSED_DOCUMENT_EXTENSION SHORT_EXTENDED_DOCUMENT_EXTENSION "+"JOB_BLOCK_ABORT_DEADLINE_PROPERTY JOB_BLOCK_AFTER_FINISH_EVENT JOB_BLOCK_AFTER_QUERY_PARAMETERS_EVENT JOB_BLOCK_ATTACHMENT_PROPERTY JOB_BLOCK_ATTACHMENTS_RIGHTS_GROUP_PROPERTY JOB_BLOCK_ATTACHMENTS_RIGHTS_TYPE_PROPERTY JOB_BLOCK_BEFORE_QUERY_PARAMETERS_EVENT JOB_BLOCK_BEFORE_START_EVENT JOB_BLOCK_CREATED_JOBS_PROPERTY JOB_BLOCK_DEADLINE_PROPERTY JOB_BLOCK_EXECUTION_RESULTS_PROPERTY JOB_BLOCK_IS_PARALLEL_PROPERTY JOB_BLOCK_IS_RELATIVE_ABORT_DEADLINE_PROPERTY JOB_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY JOB_BLOCK_JOB_TEXT_PROPERTY JOB_BLOCK_NAME_PROPERTY JOB_BLOCK_NEED_SIGN_ON_PERFORM_PROPERTY JOB_BLOCK_PERFORMER_PROPERTY JOB_BLOCK_RELATIVE_ABORT_DEADLINE_TYPE_PROPERTY JOB_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY JOB_BLOCK_SUBJECT_PROPERTY "+"ENGLISH_LANGUAGE_CODE RUSSIAN_LANGUAGE_CODE "+"smHidden smMaximized smMinimized smNormal wmNo wmYes "+"COMPONENT_TOKEN_LINK_KIND DOCUMENT_LINK_KIND EDOCUMENT_LINK_KIND FOLDER_LINK_KIND JOB_LINK_KIND REFERENCE_LINK_KIND TASK_LINK_KIND "+"COMPONENT_TOKEN_LOCK_TYPE EDOCUMENT_VERSION_LOCK_TYPE "+"MONITOR_BLOCK_AFTER_FINISH_EVENT MONITOR_BLOCK_BEFORE_START_EVENT MONITOR_BLOCK_DEADLINE_PROPERTY MONITOR_BLOCK_INTERVAL_PROPERTY MONITOR_BLOCK_INTERVAL_TYPE_PROPERTY MONITOR_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY MONITOR_BLOCK_NAME_PROPERTY MONITOR_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY MONITOR_BLOCK_SEARCH_SCRIPT_PROPERTY "+"NOTICE_BLOCK_AFTER_FINISH_EVENT NOTICE_BLOCK_ATTACHMENT_PROPERTY NOTICE_BLOCK_ATTACHMENTS_RIGHTS_GROUP_PROPERTY NOTICE_BLOCK_ATTACHMENTS_RIGHTS_TYPE_PROPERTY NOTICE_BLOCK_BEFORE_START_EVENT NOTICE_BLOCK_CREATED_NOTICES_PROPERTY NOTICE_BLOCK_DEADLINE_PROPERTY NOTICE_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY NOTICE_BLOCK_NAME_PROPERTY NOTICE_BLOCK_NOTICE_TEXT_PROPERTY NOTICE_BLOCK_PERFORMER_PROPERTY NOTICE_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY NOTICE_BLOCK_SUBJECT_PROPERTY "+"dseAfterCancel dseAfterClose dseAfterDelete dseAfterDeleteOutOfTransaction dseAfterInsert dseAfterOpen dseAfterScroll dseAfterUpdate dseAfterUpdateOutOfTransaction dseBeforeCancel dseBeforeClose dseBeforeDelete dseBeforeDetailUpdate dseBeforeInsert dseBeforeOpen dseBeforeUpdate dseOnAnyRequisiteChange dseOnCloseRecord dseOnDeleteError dseOnOpenRecord dseOnPrepareUpdate dseOnUpdateError dseOnUpdateRatifiedRecord dseOnValidDelete dseOnValidUpdate reOnChange reOnChangeValues SELECTION_BEGIN_ROUTE_EVENT SELECTION_END_ROUTE_EVENT "+"CURRENT_PERIOD_IS_REQUIRED PREVIOUS_CARD_TYPE_NAME SHOW_RECORD_PROPERTIES_FORM "+"ACCESS_RIGHTS_SETTING_DIALOG_CODE ADMINISTRATOR_USER_CODE ANALYTIC_REPORT_TYPE asrtHideLocal asrtHideRemote CALCULATED_ROLE_TYPE_CODE COMPONENTS_REFERENCE_DEVELOPER_VIEW_CODE DCTS_TEST_PROTOCOLS_FOLDER_PATH E_EDOC_VERSION_ALREADY_APPROVINGLY_SIGNED E_EDOC_VERSION_ALREADY_APPROVINGLY_SIGNED_BY_USER E_EDOC_VERSION_ALREDY_SIGNED E_EDOC_VERSION_ALREDY_SIGNED_BY_USER EDOC_TYPES_CODE_REQUISITE_FIELD_NAME EDOCUMENTS_ALIAS_NAME FILES_FOLDER_PATH FILTER_OPERANDS_DELIMITER FILTER_OPERATIONS_DELIMITER FORMCARD_NAME FORMLIST_NAME GET_EXTENDED_DOCUMENT_EXTENSION_CREATION_MODE GET_EXTENDED_DOCUMENT_EXTENSION_IMPORT_MODE INTEGRATED_REPORT_TYPE IS_BUILDER_APPLICATION_ROLE IS_BUILDER_APPLICATION_ROLE2 IS_BUILDER_USERS ISBSYSDEV LOG_FOLDER_PATH mbCancel mbNo mbNoToAll mbOK mbYes mbYesToAll MEMORY_DATASET_DESRIPTIONS_FILENAME mrNo mrNoToAll mrYes mrYesToAll MULTIPLE_SELECT_DIALOG_CODE NONOPERATING_RECORD_FLAG_FEMININE NONOPERATING_RECORD_FLAG_MASCULINE OPERATING_RECORD_FLAG_FEMININE OPERATING_RECORD_FLAG_MASCULINE PROFILING_SETTINGS_COMMON_SETTINGS_CODE_VALUE PROGRAM_INITIATED_LOOKUP_ACTION ratDelete ratEdit ratInsert REPORT_TYPE REQUIRED_PICK_VALUES_VARIABLE rmCard rmList SBRTE_PROGID_DEV SBRTE_PROGID_RELEASE STATIC_ROLE_TYPE_CODE SUPPRESS_EMPTY_TEMPLATE_CREATION SYSTEM_USER_CODE UPDATE_DIALOG_DATASET USED_IN_OBJECT_HINT_PARAM USER_INITIATED_LOOKUP_ACTION USER_NAME_FORMAT USER_SELECTION_RESTRICTIONS WORKFLOW_TEST_PROTOCOLS_FOLDER_PATH ELS_SUBTYPE_CONTROL_NAME ELS_FOLDER_KIND_CONTROL_NAME REPEAT_PROCESS_CURRENT_OBJECT_EXCEPTION_NAME "+"PRIVILEGE_COMPONENT_FULL_ACCESS PRIVILEGE_DEVELOPMENT_EXPORT PRIVILEGE_DEVELOPMENT_IMPORT PRIVILEGE_DOCUMENT_DELETE PRIVILEGE_ESD PRIVILEGE_FOLDER_DELETE PRIVILEGE_MANAGE_ACCESS_RIGHTS PRIVILEGE_MANAGE_REPLICATION PRIVILEGE_MANAGE_SESSION_SERVER PRIVILEGE_OBJECT_FULL_ACCESS PRIVILEGE_OBJECT_VIEW PRIVILEGE_RESERVE_LICENSE PRIVILEGE_SYSTEM_CUSTOMIZE PRIVILEGE_SYSTEM_DEVELOP PRIVILEGE_SYSTEM_INSTALL PRIVILEGE_TASK_DELETE PRIVILEGE_USER_PLUGIN_SETTINGS_CUSTOMIZE PRIVILEGES_PSEUDOREFERENCE_CODE "+"ACCESS_TYPES_PSEUDOREFERENCE_CODE ALL_AVAILABLE_COMPONENTS_PSEUDOREFERENCE_CODE ALL_AVAILABLE_PRIVILEGES_PSEUDOREFERENCE_CODE ALL_REPLICATE_COMPONENTS_PSEUDOREFERENCE_CODE AVAILABLE_DEVELOPERS_COMPONENTS_PSEUDOREFERENCE_CODE COMPONENTS_PSEUDOREFERENCE_CODE FILTRATER_SETTINGS_CONFLICTS_PSEUDOREFERENCE_CODE GROUPS_PSEUDOREFERENCE_CODE RECEIVE_PROTOCOL_PSEUDOREFERENCE_CODE REFERENCE_REQUISITE_PSEUDOREFERENCE_CODE REFERENCE_REQUISITES_PSEUDOREFERENCE_CODE REFTYPES_PSEUDOREFERENCE_CODE REPLICATION_SEANCES_DIARY_PSEUDOREFERENCE_CODE SEND_PROTOCOL_PSEUDOREFERENCE_CODE SUBSTITUTES_PSEUDOREFERENCE_CODE SYSTEM_SETTINGS_PSEUDOREFERENCE_CODE UNITS_PSEUDOREFERENCE_CODE USERS_PSEUDOREFERENCE_CODE VIEWERS_PSEUDOREFERENCE_CODE "+"CERTIFICATE_TYPE_ENCRYPT CERTIFICATE_TYPE_SIGN CERTIFICATE_TYPE_SIGN_AND_ENCRYPT "+"STORAGE_TYPE_FILE STORAGE_TYPE_NAS_CIFS STORAGE_TYPE_SAPERION STORAGE_TYPE_SQL_SERVER "+"COMPTYPE2_REQUISITE_DOCUMENTS_VALUE COMPTYPE2_REQUISITE_TASKS_VALUE COMPTYPE2_REQUISITE_FOLDERS_VALUE COMPTYPE2_REQUISITE_REFERENCES_VALUE "+"SYSREQ_CODE SYSREQ_COMPTYPE2 SYSREQ_CONST_AVAILABLE_FOR_WEB SYSREQ_CONST_COMMON_CODE SYSREQ_CONST_COMMON_VALUE SYSREQ_CONST_FIRM_CODE SYSREQ_CONST_FIRM_STATUS SYSREQ_CONST_FIRM_VALUE SYSREQ_CONST_SERVER_STATUS SYSREQ_CONTENTS SYSREQ_DATE_OPEN SYSREQ_DATE_CLOSE SYSREQ_DESCRIPTION SYSREQ_DESCRIPTION_LOCALIZE_ID SYSREQ_DOUBLE SYSREQ_EDOC_ACCESS_TYPE SYSREQ_EDOC_AUTHOR SYSREQ_EDOC_CREATED SYSREQ_EDOC_DELEGATE_RIGHTS_REQUISITE_CODE SYSREQ_EDOC_EDITOR SYSREQ_EDOC_ENCODE_TYPE SYSREQ_EDOC_ENCRYPTION_PLUGIN_NAME SYSREQ_EDOC_ENCRYPTION_PLUGIN_VERSION SYSREQ_EDOC_EXPORT_DATE SYSREQ_EDOC_EXPORTER SYSREQ_EDOC_KIND SYSREQ_EDOC_LIFE_STAGE_NAME SYSREQ_EDOC_LOCKED_FOR_SERVER_CODE SYSREQ_EDOC_MODIFIED SYSREQ_EDOC_NAME SYSREQ_EDOC_NOTE SYSREQ_EDOC_QUALIFIED_ID SYSREQ_EDOC_SESSION_KEY SYSREQ_EDOC_SESSION_KEY_ENCRYPTION_PLUGIN_NAME SYSREQ_EDOC_SESSION_KEY_ENCRYPTION_PLUGIN_VERSION SYSREQ_EDOC_SIGNATURE_TYPE SYSREQ_EDOC_SIGNED SYSREQ_EDOC_STORAGE SYSREQ_EDOC_STORAGES_ARCHIVE_STORAGE SYSREQ_EDOC_STORAGES_CHECK_RIGHTS SYSREQ_EDOC_STORAGES_COMPUTER_NAME SYSREQ_EDOC_STORAGES_EDIT_IN_STORAGE SYSREQ_EDOC_STORAGES_EXECUTIVE_STORAGE SYSREQ_EDOC_STORAGES_FUNCTION SYSREQ_EDOC_STORAGES_INITIALIZED SYSREQ_EDOC_STORAGES_LOCAL_PATH SYSREQ_EDOC_STORAGES_SAPERION_DATABASE_NAME SYSREQ_EDOC_STORAGES_SEARCH_BY_TEXT SYSREQ_EDOC_STORAGES_SERVER_NAME SYSREQ_EDOC_STORAGES_SHARED_SOURCE_NAME SYSREQ_EDOC_STORAGES_TYPE SYSREQ_EDOC_TEXT_MODIFIED SYSREQ_EDOC_TYPE_ACT_CODE SYSREQ_EDOC_TYPE_ACT_DESCRIPTION SYSREQ_EDOC_TYPE_ACT_DESCRIPTION_LOCALIZE_ID SYSREQ_EDOC_TYPE_ACT_ON_EXECUTE SYSREQ_EDOC_TYPE_ACT_ON_EXECUTE_EXISTS SYSREQ_EDOC_TYPE_ACT_SECTION SYSREQ_EDOC_TYPE_ADD_PARAMS SYSREQ_EDOC_TYPE_COMMENT SYSREQ_EDOC_TYPE_EVENT_TEXT SYSREQ_EDOC_TYPE_NAME_IN_SINGULAR SYSREQ_EDOC_TYPE_NAME_IN_SINGULAR_LOCALIZE_ID SYSREQ_EDOC_TYPE_NAME_LOCALIZE_ID SYSREQ_EDOC_TYPE_NUMERATION_METHOD SYSREQ_EDOC_TYPE_PSEUDO_REQUISITE_CODE SYSREQ_EDOC_TYPE_REQ_CODE SYSREQ_EDOC_TYPE_REQ_DESCRIPTION SYSREQ_EDOC_TYPE_REQ_DESCRIPTION_LOCALIZE_ID SYSREQ_EDOC_TYPE_REQ_IS_LEADING SYSREQ_EDOC_TYPE_REQ_IS_REQUIRED SYSREQ_EDOC_TYPE_REQ_NUMBER SYSREQ_EDOC_TYPE_REQ_ON_CHANGE SYSREQ_EDOC_TYPE_REQ_ON_CHANGE_EXISTS SYSREQ_EDOC_TYPE_REQ_ON_SELECT SYSREQ_EDOC_TYPE_REQ_ON_SELECT_KIND SYSREQ_EDOC_TYPE_REQ_SECTION SYSREQ_EDOC_TYPE_VIEW_CARD SYSREQ_EDOC_TYPE_VIEW_CODE SYSREQ_EDOC_TYPE_VIEW_COMMENT SYSREQ_EDOC_TYPE_VIEW_IS_MAIN SYSREQ_EDOC_TYPE_VIEW_NAME SYSREQ_EDOC_TYPE_VIEW_NAME_LOCALIZE_ID SYSREQ_EDOC_VERSION_AUTHOR SYSREQ_EDOC_VERSION_CRC SYSREQ_EDOC_VERSION_DATA SYSREQ_EDOC_VERSION_EDITOR SYSREQ_EDOC_VERSION_EXPORT_DATE SYSREQ_EDOC_VERSION_EXPORTER SYSREQ_EDOC_VERSION_HIDDEN SYSREQ_EDOC_VERSION_LIFE_STAGE SYSREQ_EDOC_VERSION_MODIFIED SYSREQ_EDOC_VERSION_NOTE SYSREQ_EDOC_VERSION_SIGNATURE_TYPE SYSREQ_EDOC_VERSION_SIGNED SYSREQ_EDOC_VERSION_SIZE SYSREQ_EDOC_VERSION_SOURCE SYSREQ_EDOC_VERSION_TEXT_MODIFIED SYSREQ_EDOCKIND_DEFAULT_VERSION_STATE_CODE SYSREQ_FOLDER_KIND SYSREQ_FUNC_CATEGORY SYSREQ_FUNC_COMMENT SYSREQ_FUNC_GROUP SYSREQ_FUNC_GROUP_COMMENT SYSREQ_FUNC_GROUP_NUMBER SYSREQ_FUNC_HELP SYSREQ_FUNC_PARAM_DEF_VALUE SYSREQ_FUNC_PARAM_IDENT SYSREQ_FUNC_PARAM_NUMBER SYSREQ_FUNC_PARAM_TYPE SYSREQ_FUNC_TEXT SYSREQ_GROUP_CATEGORY SYSREQ_ID SYSREQ_LAST_UPDATE SYSREQ_LEADER_REFERENCE SYSREQ_LINE_NUMBER SYSREQ_MAIN_RECORD_ID SYSREQ_NAME SYSREQ_NAME_LOCALIZE_ID SYSREQ_NOTE SYSREQ_ORIGINAL_RECORD SYSREQ_OUR_FIRM SYSREQ_PROFILING_SETTINGS_BATCH_LOGING SYSREQ_PROFILING_SETTINGS_BATCH_SIZE SYSREQ_PROFILING_SETTINGS_PROFILING_ENABLED SYSREQ_PROFILING_SETTINGS_SQL_PROFILING_ENABLED SYSREQ_PROFILING_SETTINGS_START_LOGGED SYSREQ_RECORD_STATUS SYSREQ_REF_REQ_FIELD_NAME SYSREQ_REF_REQ_FORMAT SYSREQ_REF_REQ_GENERATED SYSREQ_REF_REQ_LENGTH SYSREQ_REF_REQ_PRECISION SYSREQ_REF_REQ_REFERENCE SYSREQ_REF_REQ_SECTION SYSREQ_REF_REQ_STORED SYSREQ_REF_REQ_TOKENS SYSREQ_REF_REQ_TYPE SYSREQ_REF_REQ_VIEW SYSREQ_REF_TYPE_ACT_CODE SYSREQ_REF_TYPE_ACT_DESCRIPTION SYSREQ_REF_TYPE_ACT_DESCRIPTION_LOCALIZE_ID SYSREQ_REF_TYPE_ACT_ON_EXECUTE SYSREQ_REF_TYPE_ACT_ON_EXECUTE_EXISTS SYSREQ_REF_TYPE_ACT_SECTION SYSREQ_REF_TYPE_ADD_PARAMS SYSREQ_REF_TYPE_COMMENT SYSREQ_REF_TYPE_COMMON_SETTINGS SYSREQ_REF_TYPE_DISPLAY_REQUISITE_NAME SYSREQ_REF_TYPE_EVENT_TEXT SYSREQ_REF_TYPE_MAIN_LEADING_REF SYSREQ_REF_TYPE_NAME_IN_SINGULAR SYSREQ_REF_TYPE_NAME_IN_SINGULAR_LOCALIZE_ID SYSREQ_REF_TYPE_NAME_LOCALIZE_ID SYSREQ_REF_TYPE_NUMERATION_METHOD SYSREQ_REF_TYPE_REQ_CODE SYSREQ_REF_TYPE_REQ_DESCRIPTION SYSREQ_REF_TYPE_REQ_DESCRIPTION_LOCALIZE_ID SYSREQ_REF_TYPE_REQ_IS_CONTROL SYSREQ_REF_TYPE_REQ_IS_FILTER SYSREQ_REF_TYPE_REQ_IS_LEADING SYSREQ_REF_TYPE_REQ_IS_REQUIRED SYSREQ_REF_TYPE_REQ_NUMBER SYSREQ_REF_TYPE_REQ_ON_CHANGE SYSREQ_REF_TYPE_REQ_ON_CHANGE_EXISTS SYSREQ_REF_TYPE_REQ_ON_SELECT SYSREQ_REF_TYPE_REQ_ON_SELECT_KIND SYSREQ_REF_TYPE_REQ_SECTION SYSREQ_REF_TYPE_VIEW_CARD SYSREQ_REF_TYPE_VIEW_CODE SYSREQ_REF_TYPE_VIEW_COMMENT SYSREQ_REF_TYPE_VIEW_IS_MAIN SYSREQ_REF_TYPE_VIEW_NAME SYSREQ_REF_TYPE_VIEW_NAME_LOCALIZE_ID SYSREQ_REFERENCE_TYPE_ID SYSREQ_STATE SYSREQ_STAT\u0415 SYSREQ_SYSTEM_SETTINGS_VALUE SYSREQ_TYPE SYSREQ_UNIT SYSREQ_UNIT_ID SYSREQ_USER_GROUPS_GROUP_FULL_NAME SYSREQ_USER_GROUPS_GROUP_NAME SYSREQ_USER_GROUPS_GROUP_SERVER_NAME SYSREQ_USERS_ACCESS_RIGHTS SYSREQ_USERS_AUTHENTICATION SYSREQ_USERS_CATEGORY SYSREQ_USERS_COMPONENT SYSREQ_USERS_COMPONENT_USER_IS_PUBLIC SYSREQ_USERS_DOMAIN SYSREQ_USERS_FULL_USER_NAME SYSREQ_USERS_GROUP SYSREQ_USERS_IS_MAIN_SERVER SYSREQ_USERS_LOGIN SYSREQ_USERS_REFERENCE_USER_IS_PUBLIC SYSREQ_USERS_STATUS SYSREQ_USERS_USER_CERTIFICATE SYSREQ_USERS_USER_CERTIFICATE_INFO SYSREQ_USERS_USER_CERTIFICATE_PLUGIN_NAME SYSREQ_USERS_USER_CERTIFICATE_PLUGIN_VERSION SYSREQ_USERS_USER_CERTIFICATE_STATE SYSREQ_USERS_USER_CERTIFICATE_SUBJECT_NAME SYSREQ_USERS_USER_CERTIFICATE_THUMBPRINT SYSREQ_USERS_USER_DEFAULT_CERTIFICATE SYSREQ_USERS_USER_DESCRIPTION SYSREQ_USERS_USER_GLOBAL_NAME SYSREQ_USERS_USER_LOGIN SYSREQ_USERS_USER_MAIN_SERVER SYSREQ_USERS_USER_TYPE SYSREQ_WORK_RULES_FOLDER_ID "+"RESULT_VAR_NAME RESULT_VAR_NAME_ENG "+"AUTO_NUMERATION_RULE_ID CANT_CHANGE_ID_REQUISITE_RULE_ID CANT_CHANGE_OURFIRM_REQUISITE_RULE_ID CHECK_CHANGING_REFERENCE_RECORD_USE_RULE_ID CHECK_CODE_REQUISITE_RULE_ID CHECK_DELETING_REFERENCE_RECORD_USE_RULE_ID CHECK_FILTRATER_CHANGES_RULE_ID CHECK_RECORD_INTERVAL_RULE_ID CHECK_REFERENCE_INTERVAL_RULE_ID CHECK_REQUIRED_DATA_FULLNESS_RULE_ID CHECK_REQUIRED_REQUISITES_FULLNESS_RULE_ID MAKE_RECORD_UNRATIFIED_RULE_ID RESTORE_AUTO_NUMERATION_RULE_ID SET_FIRM_CONTEXT_FROM_RECORD_RULE_ID SET_FIRST_RECORD_IN_LIST_FORM_RULE_ID SET_IDSPS_VALUE_RULE_ID SET_NEXT_CODE_VALUE_RULE_ID SET_OURFIRM_BOUNDS_RULE_ID SET_OURFIRM_REQUISITE_RULE_ID "+"SCRIPT_BLOCK_AFTER_FINISH_EVENT SCRIPT_BLOCK_BEFORE_START_EVENT SCRIPT_BLOCK_EXECUTION_RESULTS_PROPERTY SCRIPT_BLOCK_NAME_PROPERTY SCRIPT_BLOCK_SCRIPT_PROPERTY "+"SUBTASK_BLOCK_ABORT_DEADLINE_PROPERTY SUBTASK_BLOCK_AFTER_FINISH_EVENT SUBTASK_BLOCK_ASSIGN_PARAMS_EVENT SUBTASK_BLOCK_ATTACHMENTS_PROPERTY SUBTASK_BLOCK_ATTACHMENTS_RIGHTS_GROUP_PROPERTY SUBTASK_BLOCK_ATTACHMENTS_RIGHTS_TYPE_PROPERTY SUBTASK_BLOCK_BEFORE_START_EVENT SUBTASK_BLOCK_CREATED_TASK_PROPERTY SUBTASK_BLOCK_CREATION_EVENT SUBTASK_BLOCK_DEADLINE_PROPERTY SUBTASK_BLOCK_IMPORTANCE_PROPERTY SUBTASK_BLOCK_INITIATOR_PROPERTY SUBTASK_BLOCK_IS_RELATIVE_ABORT_DEADLINE_PROPERTY SUBTASK_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY SUBTASK_BLOCK_JOBS_TYPE_PROPERTY SUBTASK_BLOCK_NAME_PROPERTY SUBTASK_BLOCK_PARALLEL_ROUTE_PROPERTY SUBTASK_BLOCK_PERFORMERS_PROPERTY SUBTASK_BLOCK_RELATIVE_ABORT_DEADLINE_TYPE_PROPERTY SUBTASK_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY SUBTASK_BLOCK_REQUIRE_SIGN_PROPERTY SUBTASK_BLOCK_STANDARD_ROUTE_PROPERTY SUBTASK_BLOCK_START_EVENT SUBTASK_BLOCK_STEP_CONTROL_PROPERTY SUBTASK_BLOCK_SUBJECT_PROPERTY SUBTASK_BLOCK_TASK_CONTROL_PROPERTY SUBTASK_BLOCK_TEXT_PROPERTY SUBTASK_BLOCK_UNLOCK_ATTACHMENTS_ON_STOP_PROPERTY SUBTASK_BLOCK_USE_STANDARD_ROUTE_PROPERTY SUBTASK_BLOCK_WAIT_FOR_TASK_COMPLETE_PROPERTY "+"SYSCOMP_CONTROL_JOBS SYSCOMP_FOLDERS SYSCOMP_JOBS SYSCOMP_NOTICES SYSCOMP_TASKS "+"SYSDLG_CREATE_EDOCUMENT SYSDLG_CREATE_EDOCUMENT_VERSION SYSDLG_CURRENT_PERIOD SYSDLG_EDIT_FUNCTION_HELP SYSDLG_EDOCUMENT_KINDS_FOR_TEMPLATE SYSDLG_EXPORT_MULTIPLE_EDOCUMENTS SYSDLG_EXPORT_SINGLE_EDOCUMENT SYSDLG_IMPORT_EDOCUMENT SYSDLG_MULTIPLE_SELECT SYSDLG_SETUP_ACCESS_RIGHTS SYSDLG_SETUP_DEFAULT_RIGHTS SYSDLG_SETUP_FILTER_CONDITION SYSDLG_SETUP_SIGN_RIGHTS SYSDLG_SETUP_TASK_OBSERVERS SYSDLG_SETUP_TASK_ROUTE SYSDLG_SETUP_USERS_LIST SYSDLG_SIGN_EDOCUMENT SYSDLG_SIGN_MULTIPLE_EDOCUMENTS "+"SYSREF_ACCESS_RIGHTS_TYPES SYSREF_ADMINISTRATION_HISTORY SYSREF_ALL_AVAILABLE_COMPONENTS SYSREF_ALL_AVAILABLE_PRIVILEGES SYSREF_ALL_REPLICATING_COMPONENTS SYSREF_AVAILABLE_DEVELOPERS_COMPONENTS SYSREF_CALENDAR_EVENTS SYSREF_COMPONENT_TOKEN_HISTORY SYSREF_COMPONENT_TOKENS SYSREF_COMPONENTS SYSREF_CONSTANTS SYSREF_DATA_RECEIVE_PROTOCOL SYSREF_DATA_SEND_PROTOCOL SYSREF_DIALOGS SYSREF_DIALOGS_REQUISITES SYSREF_EDITORS SYSREF_EDOC_CARDS SYSREF_EDOC_TYPES SYSREF_EDOCUMENT_CARD_REQUISITES SYSREF_EDOCUMENT_CARD_TYPES SYSREF_EDOCUMENT_CARD_TYPES_REFERENCE SYSREF_EDOCUMENT_CARDS SYSREF_EDOCUMENT_HISTORY SYSREF_EDOCUMENT_KINDS SYSREF_EDOCUMENT_REQUISITES SYSREF_EDOCUMENT_SIGNATURES SYSREF_EDOCUMENT_TEMPLATES SYSREF_EDOCUMENT_TEXT_STORAGES SYSREF_EDOCUMENT_VIEWS SYSREF_FILTERER_SETUP_CONFLICTS SYSREF_FILTRATER_SETTING_CONFLICTS SYSREF_FOLDER_HISTORY SYSREF_FOLDERS SYSREF_FUNCTION_GROUPS SYSREF_FUNCTION_PARAMS SYSREF_FUNCTIONS SYSREF_JOB_HISTORY SYSREF_LINKS SYSREF_LOCALIZATION_DICTIONARY SYSREF_LOCALIZATION_LANGUAGES SYSREF_MODULES SYSREF_PRIVILEGES SYSREF_RECORD_HISTORY SYSREF_REFERENCE_REQUISITES SYSREF_REFERENCE_TYPE_VIEWS SYSREF_REFERENCE_TYPES SYSREF_REFERENCES SYSREF_REFERENCES_REQUISITES SYSREF_REMOTE_SERVERS SYSREF_REPLICATION_SESSIONS_LOG SYSREF_REPLICATION_SESSIONS_PROTOCOL SYSREF_REPORTS SYSREF_ROLES SYSREF_ROUTE_BLOCK_GROUPS SYSREF_ROUTE_BLOCKS SYSREF_SCRIPTS SYSREF_SEARCHES SYSREF_SERVER_EVENTS SYSREF_SERVER_EVENTS_HISTORY SYSREF_STANDARD_ROUTE_GROUPS SYSREF_STANDARD_ROUTES SYSREF_STATUSES SYSREF_SYSTEM_SETTINGS SYSREF_TASK_HISTORY SYSREF_TASK_KIND_GROUPS SYSREF_TASK_KINDS SYSREF_TASK_RIGHTS SYSREF_TASK_SIGNATURES SYSREF_TASKS SYSREF_UNITS SYSREF_USER_GROUPS SYSREF_USER_GROUPS_REFERENCE SYSREF_USER_SUBSTITUTION SYSREF_USERS SYSREF_USERS_REFERENCE SYSREF_VIEWERS SYSREF_WORKING_TIME_CALENDARS "+"ACCESS_RIGHTS_TABLE_NAME EDMS_ACCESS_TABLE_NAME EDOC_TYPES_TABLE_NAME "+"TEST_DEV_DB_NAME TEST_DEV_SYSTEM_CODE TEST_EDMS_DB_NAME TEST_EDMS_MAIN_CODE TEST_EDMS_MAIN_DB_NAME TEST_EDMS_SECOND_CODE TEST_EDMS_SECOND_DB_NAME TEST_EDMS_SYSTEM_CODE TEST_ISB5_MAIN_CODE TEST_ISB5_SECOND_CODE TEST_SQL_SERVER_2005_NAME TEST_SQL_SERVER_NAME "+"ATTENTION_CAPTION cbsCommandLinks cbsDefault CONFIRMATION_CAPTION ERROR_CAPTION INFORMATION_CAPTION mrCancel mrOk "+"EDOC_VERSION_ACTIVE_STAGE_CODE EDOC_VERSION_DESIGN_STAGE_CODE EDOC_VERSION_OBSOLETE_STAGE_CODE "+"cpDataEnciphermentEnabled cpDigitalSignatureEnabled cpID cpIssuer cpPluginVersion cpSerial cpSubjectName cpSubjSimpleName cpValidFromDate cpValidToDate "+"ISBL_SYNTAX NO_SYNTAX XML_SYNTAX "+"WAIT_BLOCK_AFTER_FINISH_EVENT WAIT_BLOCK_BEFORE_START_EVENT WAIT_BLOCK_DEADLINE_PROPERTY WAIT_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY WAIT_BLOCK_NAME_PROPERTY WAIT_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY "+"SYSRES_COMMON SYSRES_CONST SYSRES_MBFUNC SYSRES_SBDATA SYSRES_SBGUI SYSRES_SBINTF SYSRES_SBREFDSC SYSRES_SQLERRORS SYSRES_SYSCOMP ",va="atUser atGroup atRole "+"aemEnabledAlways aemDisabledAlways aemEnabledOnBrowse aemEnabledOnEdit aemDisabledOnBrowseEmpty "+"apBegin apEnd "+"alLeft alRight "+"asmNever asmNoButCustomize asmAsLastTime asmYesButCustomize asmAlways "+"cirCommon cirRevoked "+"ctSignature ctEncode ctSignatureEncode "+"clbUnchecked clbChecked clbGrayed "+"ceISB ceAlways ceNever "+"ctDocument ctReference ctScript ctUnknown ctReport ctDialog ctFunction ctFolder ctEDocument ctTask ctJob ctNotice ctControlJob "+"cfInternal cfDisplay "+"ciUnspecified ciWrite ciRead "+"ckFolder ckEDocument ckTask ckJob ckComponentToken ckAny ckReference ckScript ckReport ckDialog "+"ctISBLEditor ctBevel ctButton ctCheckListBox ctComboBox ctComboEdit ctGrid ctDBCheckBox ctDBComboBox ctDBEdit ctDBEllipsis ctDBMemo ctDBNavigator ctDBRadioGroup ctDBStatusLabel ctEdit ctGroupBox ctInplaceHint ctMemo ctPanel ctListBox ctRadioButton ctRichEdit ctTabSheet ctWebBrowser ctImage ctHyperLink ctLabel ctDBMultiEllipsis ctRibbon ctRichView ctInnerPanel ctPanelGroup ctBitButton "+"cctDate cctInteger cctNumeric cctPick cctReference cctString cctText "+"cltInternal cltPrimary cltGUI "+"dseBeforeOpen dseAfterOpen dseBeforeClose dseAfterClose dseOnValidDelete dseBeforeDelete dseAfterDelete dseAfterDeleteOutOfTransaction dseOnDeleteError dseBeforeInsert dseAfterInsert dseOnValidUpdate dseBeforeUpdate dseOnUpdateRatifiedRecord dseAfterUpdate dseAfterUpdateOutOfTransaction dseOnUpdateError dseAfterScroll dseOnOpenRecord dseOnCloseRecord dseBeforeCancel dseAfterCancel dseOnUpdateDeadlockError dseBeforeDetailUpdate dseOnPrepareUpdate dseOnAnyRequisiteChange "+"dssEdit dssInsert dssBrowse dssInActive "+"dftDate dftShortDate dftDateTime dftTimeStamp "+"dotDays dotHours dotMinutes dotSeconds "+"dtkndLocal dtkndUTC "+"arNone arView arEdit arFull "+"ddaView ddaEdit "+"emLock emEdit emSign emExportWithLock emImportWithUnlock emChangeVersionNote emOpenForModify emChangeLifeStage emDelete emCreateVersion emImport emUnlockExportedWithLock emStart emAbort emReInit emMarkAsReaded emMarkAsUnreaded emPerform emAccept emResume emChangeRights emEditRoute emEditObserver emRecoveryFromLocalCopy emChangeWorkAccessType emChangeEncodeTypeToCertificate emChangeEncodeTypeToPassword emChangeEncodeTypeToNone emChangeEncodeTypeToCertificatePassword emChangeStandardRoute emGetText emOpenForView emMoveToStorage emCreateObject emChangeVersionHidden emDeleteVersion emChangeLifeCycleStage emApprovingSign emExport emContinue emLockFromEdit emUnLockForEdit emLockForServer emUnlockFromServer emDelegateAccessRights emReEncode "+"ecotFile ecotProcess "+"eaGet eaCopy eaCreate eaCreateStandardRoute "+"edltAll edltNothing edltQuery "+"essmText essmCard "+"esvtLast esvtLastActive esvtSpecified "+"edsfExecutive edsfArchive "+"edstSQLServer edstFile "+"edvstNone edvstEDocumentVersionCopy edvstFile edvstTemplate edvstScannedFile "+"vsDefault vsDesign vsActive vsObsolete "+"etNone etCertificate etPassword etCertificatePassword "+"ecException ecWarning ecInformation "+"estAll estApprovingOnly "+"evtLast evtLastActive evtQuery "+"fdtString fdtNumeric fdtInteger fdtDate fdtText fdtUnknown fdtWideString fdtLargeInteger "+"ftInbox ftOutbox ftFavorites ftCommonFolder ftUserFolder ftComponents ftQuickLaunch ftShortcuts ftSearch "+"grhAuto grhX1 grhX2 grhX3 "+"hltText hltRTF hltHTML "+"iffBMP iffJPEG iffMultiPageTIFF iffSinglePageTIFF iffTIFF iffPNG "+"im8bGrayscale im24bRGB im1bMonochrome "+"itBMP itJPEG itWMF itPNG "+"ikhInformation ikhWarning ikhError ikhNoIcon "+"icUnknown icScript icFunction icIntegratedReport icAnalyticReport icDataSetEventHandler icActionHandler icFormEventHandler icLookUpEventHandler icRequisiteChangeEventHandler icBeforeSearchEventHandler icRoleCalculation icSelectRouteEventHandler icBlockPropertyCalculation icBlockQueryParamsEventHandler icChangeSearchResultEventHandler icBlockEventHandler icSubTaskInitEventHandler icEDocDataSetEventHandler icEDocLookUpEventHandler icEDocActionHandler icEDocFormEventHandler icEDocRequisiteChangeEventHandler icStructuredConversionRule icStructuredConversionEventBefore icStructuredConversionEventAfter icWizardEventHandler icWizardFinishEventHandler icWizardStepEventHandler icWizardStepFinishEventHandler icWizardActionEnableEventHandler icWizardActionExecuteEventHandler icCreateJobsHandler icCreateNoticesHandler icBeforeLookUpEventHandler icAfterLookUpEventHandler icTaskAbortEventHandler icWorkflowBlockActionHandler icDialogDataSetEventHandler icDialogActionHandler icDialogLookUpEventHandler icDialogRequisiteChangeEventHandler icDialogFormEventHandler icDialogValidCloseEventHandler icBlockFormEventHandler icTaskFormEventHandler icReferenceMethod icEDocMethod icDialogMethod icProcessMessageHandler "+"isShow isHide isByUserSettings "+"jkJob jkNotice jkControlJob "+"jtInner jtLeft jtRight jtFull jtCross "+"lbpAbove lbpBelow lbpLeft lbpRight "+"eltPerConnection eltPerUser "+"sfcUndefined sfcBlack sfcGreen sfcRed sfcBlue sfcOrange sfcLilac "+"sfsItalic sfsStrikeout sfsNormal "+"ldctStandardRoute ldctWizard ldctScript ldctFunction ldctRouteBlock ldctIntegratedReport ldctAnalyticReport ldctReferenceType ldctEDocumentType ldctDialog ldctServerEvents "+"mrcrtNone mrcrtUser mrcrtMaximal mrcrtCustom "+"vtEqual vtGreaterOrEqual vtLessOrEqual vtRange "+"rdYesterday rdToday rdTomorrow rdThisWeek rdThisMonth rdThisYear rdNextMonth rdNextWeek rdLastWeek rdLastMonth "+"rdWindow rdFile rdPrinter "+"rdtString rdtNumeric rdtInteger rdtDate rdtReference rdtAccount rdtText rdtPick rdtUnknown rdtLargeInteger rdtDocument "+"reOnChange reOnChangeValues "+"ttGlobal ttLocal ttUser ttSystem "+"ssmBrowse ssmSelect ssmMultiSelect ssmBrowseModal "+"smSelect smLike smCard "+"stNone stAuthenticating stApproving "+"sctString sctStream "+"sstAnsiSort sstNaturalSort "+"svtEqual svtContain "+"soatString soatNumeric soatInteger soatDatetime soatReferenceRecord soatText soatPick soatBoolean soatEDocument soatAccount soatIntegerCollection soatNumericCollection soatStringCollection soatPickCollection soatDatetimeCollection soatBooleanCollection soatReferenceRecordCollection soatEDocumentCollection soatAccountCollection soatContents soatUnknown "+"tarAbortByUser tarAbortByWorkflowException "+"tvtAllWords tvtExactPhrase tvtAnyWord "+"usNone usCompleted usRedSquare usBlueSquare usYellowSquare usGreenSquare usOrangeSquare usPurpleSquare usFollowUp "+"utUnknown utUser utDeveloper utAdministrator utSystemDeveloper utDisconnected "+"btAnd btDetailAnd btOr btNotOr btOnly "+"vmView vmSelect vmNavigation "+"vsmSingle vsmMultiple vsmMultipleCheck vsmNoSelection "+"wfatPrevious wfatNext wfatCancel wfatFinish "+"wfepUndefined wfepText3 wfepText6 wfepText9 wfepSpinEdit wfepDropDown wfepRadioGroup wfepFlag wfepText12 wfepText15 wfepText18 wfepText21 wfepText24 wfepText27 wfepText30 wfepRadioGroupColumn1 wfepRadioGroupColumn2 wfepRadioGroupColumn3 "+"wfetQueryParameter wfetText wfetDelimiter wfetLabel "+"wptString wptInteger wptNumeric wptBoolean wptDateTime wptPick wptText wptUser wptUserList wptEDocumentInfo wptEDocumentInfoList wptReferenceRecordInfo wptReferenceRecordInfoList wptFolderInfo wptTaskInfo wptContents wptFileName wptDate "+"wsrComplete wsrGoNext wsrGoPrevious wsrCustom wsrCancel wsrGoFinal "+"wstForm wstEDocument wstTaskCard wstReferenceRecordCard wstFinal "+"waAll waPerformers waManual "+"wsbStart wsbFinish wsbNotice wsbStep wsbDecision wsbWait wsbMonitor wsbScript wsbConnector wsbSubTask wsbLifeCycleStage wsbPause "+"wdtInteger wdtFloat wdtString wdtPick wdtDateTime wdtBoolean wdtTask wdtJob wdtFolder wdtEDocument wdtReferenceRecord wdtUser wdtGroup wdtRole wdtIntegerCollection wdtFloatCollection wdtStringCollection wdtPickCollection wdtDateTimeCollection wdtBooleanCollection wdtTaskCollection wdtJobCollection wdtFolderCollection wdtEDocumentCollection wdtReferenceRecordCollection wdtUserCollection wdtGroupCollection wdtRoleCollection wdtContents wdtUserList wdtSearchDescription wdtDeadLine wdtPickSet wdtAccountCollection "+"wiLow wiNormal wiHigh "+"wrtSoft wrtHard "+"wsInit wsRunning wsDone wsControlled wsAborted wsContinued "+"wtmFull wtmFromCurrent wtmOnlyCurrent ",Dr="AddSubString AdjustLineBreaks AmountInWords Analysis ArrayDimCount ArrayHighBound ArrayLowBound ArrayOf ArrayReDim Assert Assigned BeginOfMonth BeginOfPeriod BuildProfilingOperationAnalysis CallProcedure CanReadFile CArrayElement CDataSetRequisite ChangeDate ChangeReferenceDataset Char CharPos CheckParam CheckParamValue CompareStrings ConstantExists ControlState ConvertDateStr Copy CopyFile CreateArray CreateCachedReference CreateConnection CreateDialog CreateDualListDialog CreateEditor CreateException CreateFile CreateFolderDialog CreateInputDialog CreateLinkFile CreateList CreateLock CreateMemoryDataSet CreateObject CreateOpenDialog CreateProgress CreateQuery CreateReference CreateReport CreateSaveDialog CreateScript CreateSQLPivotFunction CreateStringList CreateTreeListSelectDialog CSelectSQL CSQL CSubString CurrentUserID CurrentUserName CurrentVersion DataSetLocateEx DateDiff DateTimeDiff DateToStr DayOfWeek DeleteFile DirectoryExists DisableCheckAccessRights DisableCheckFullShowingRestriction DisableMassTaskSendingRestrictions DropTable DupeString EditText EnableCheckAccessRights EnableCheckFullShowingRestriction EnableMassTaskSendingRestrictions EndOfMonth EndOfPeriod ExceptionExists ExceptionsOff ExceptionsOn Execute ExecuteProcess Exit ExpandEnvironmentVariables ExtractFileDrive ExtractFileExt ExtractFileName ExtractFilePath ExtractParams FileExists FileSize FindFile FindSubString FirmContext ForceDirectories Format FormatDate FormatNumeric FormatSQLDate FormatString FreeException GetComponent GetComponentLaunchParam GetConstant GetLastException GetReferenceRecord GetRefTypeByRefID GetTableID GetTempFolder IfThen In IndexOf InputDialog InputDialogEx InteractiveMode IsFileLocked IsGraphicFile IsNumeric Length LoadString LoadStringFmt LocalTimeToUTC LowerCase Max MessageBox MessageBoxEx MimeDecodeBinary MimeDecodeString MimeEncodeBinary MimeEncodeString Min MoneyInWords MoveFile NewID Now OpenFile Ord Precision Raise ReadCertificateFromFile ReadFile ReferenceCodeByID ReferenceNumber ReferenceRequisiteMode ReferenceRequisiteValue RegionDateSettings RegionNumberSettings RegionTimeSettings RegRead RegWrite RenameFile Replace Round SelectServerCode SelectSQL ServerDateTime SetConstant SetManagedFolderFieldsState ShowConstantsInputDialog ShowMessage Sleep Split SQL SQL2XLSTAB SQLProfilingSendReport StrToDate SubString SubStringCount SystemSetting Time TimeDiff Today Transliterate Trim UpperCase UserStatus UTCToLocalTime ValidateXML VarIsClear VarIsEmpty VarIsNull WorkTimeDiff WriteFile WriteFileEx WriteObjectHistory \u0410\u043D\u0430\u043B\u0438\u0437 \u0411\u0430\u0437\u0430\u0414\u0430\u043D\u043D\u044B\u0445 \u0411\u043B\u043E\u043A\u0415\u0441\u0442\u044C \u0411\u043B\u043E\u043A\u0415\u0441\u0442\u044C\u0420\u0430\u0441\u0448 \u0411\u043B\u043E\u043A\u0418\u043D\u0444\u043E \u0411\u043B\u043E\u043A\u0421\u043D\u044F\u0442\u044C \u0411\u043B\u043E\u043A\u0421\u043D\u044F\u0442\u044C\u0420\u0430\u0441\u0448 \u0411\u043B\u043E\u043A\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0412\u0432\u043E\u0434 \u0412\u0432\u043E\u0434\u041C\u0435\u043D\u044E \u0412\u0435\u0434\u0421 \u0412\u0435\u0434\u0421\u043F\u0440 \u0412\u0435\u0440\u0445\u043D\u044F\u044F\u0413\u0440\u0430\u043D\u0438\u0446\u0430\u041C\u0430\u0441\u0441\u0438\u0432\u0430 \u0412\u043D\u0435\u0448\u041F\u0440\u043E\u0433\u0440 \u0412\u043E\u0441\u0441\u0442 \u0412\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F\u041F\u0430\u043F\u043A\u0430 \u0412\u0440\u0435\u043C\u044F \u0412\u044B\u0431\u043E\u0440SQL \u0412\u044B\u0431\u0440\u0430\u0442\u044C\u0417\u0430\u043F\u0438\u0441\u044C \u0412\u044B\u0434\u0435\u043B\u0438\u0442\u044C\u0421\u0442\u0440 \u0412\u044B\u0437\u0432\u0430\u0442\u044C \u0412\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0412\u044B\u043F\u041F\u0440\u043E\u0433\u0440 \u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u0438\u0439\u0424\u0430\u0439\u043B \u0413\u0440\u0443\u043F\u043F\u0430\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0414\u0430\u0442\u0430\u0412\u0440\u0435\u043C\u044F\u0421\u0435\u0440\u0432 \u0414\u0435\u043D\u044C\u041D\u0435\u0434\u0435\u043B\u0438 \u0414\u0438\u0430\u043B\u043E\u0433\u0414\u0430\u041D\u0435\u0442 \u0414\u043B\u0438\u043D\u0430\u0421\u0442\u0440 \u0414\u043E\u0431\u041F\u043E\u0434\u0441\u0442\u0440 \u0415\u041F\u0443\u0441\u0442\u043E \u0415\u0441\u043B\u0438\u0422\u043E \u0415\u0427\u0438\u0441\u043B\u043E \u0417\u0430\u043C\u041F\u043E\u0434\u0441\u0442\u0440 \u0417\u0430\u043F\u0438\u0441\u044C\u0421\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A\u0430 \u0417\u043D\u0430\u0447\u041F\u043E\u043B\u044F\u0421\u043F\u0440 \u0418\u0414\u0422\u0438\u043F\u0421\u043F\u0440 \u0418\u0437\u0432\u043B\u0435\u0447\u044C\u0414\u0438\u0441\u043A \u0418\u0437\u0432\u043B\u0435\u0447\u044C\u0418\u043C\u044F\u0424\u0430\u0439\u043B\u0430 \u0418\u0437\u0432\u043B\u0435\u0447\u044C\u041F\u0443\u0442\u044C \u0418\u0437\u0432\u043B\u0435\u0447\u044C\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435 \u0418\u0437\u043C\u0414\u0430\u0442 \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C\u0420\u0430\u0437\u043C\u0435\u0440\u041C\u0430\u0441\u0441\u0438\u0432\u0430 \u0418\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u0439\u041C\u0430\u0441\u0441\u0438\u0432\u0430 \u0418\u043C\u044F\u041E\u0440\u0433 \u0418\u043C\u044F\u041F\u043E\u043B\u044F\u0421\u043F\u0440 \u0418\u043D\u0434\u0435\u043A\u0441 \u0418\u043D\u0434\u0438\u043A\u0430\u0442\u043E\u0440\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0418\u043D\u0434\u0438\u043A\u0430\u0442\u043E\u0440\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0418\u043D\u0434\u0438\u043A\u0430\u0442\u043E\u0440\u0428\u0430\u0433 \u0418\u043D\u0442\u0435\u0440\u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0439\u0420\u0435\u0436\u0438\u043C \u0418\u0442\u043E\u0433\u0422\u0431\u043B\u0421\u043F\u0440 \u041A\u043E\u0434\u0412\u0438\u0434\u0412\u0435\u0434\u0421\u043F\u0440 \u041A\u043E\u0434\u0412\u0438\u0434\u0421\u043F\u0440\u041F\u043E\u0418\u0414 \u041A\u043E\u0434\u041F\u043EAnalit \u041A\u043E\u0434\u0421\u0438\u043C\u0432\u043E\u043B\u0430 \u041A\u043E\u0434\u0421\u043F\u0440 \u041A\u043E\u043B\u041F\u043E\u0434\u0441\u0442\u0440 \u041A\u043E\u043B\u041F\u0440\u043E\u043F \u041A\u043E\u043D\u041C\u0435\u0441 \u041A\u043E\u043D\u0441\u0442 \u041A\u043E\u043D\u0441\u0442\u0415\u0441\u0442\u044C \u041A\u043E\u043D\u0441\u0442\u0417\u043D\u0430\u0447 \u041A\u043E\u043D\u0422\u0440\u0430\u043D \u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0424\u0430\u0439\u043B \u041A\u043E\u043F\u0438\u044F\u0421\u0442\u0440 \u041A\u041F\u0435\u0440\u0438\u043E\u0434 \u041A\u0421\u0442\u0440\u0422\u0431\u043B\u0421\u043F\u0440 \u041C\u0430\u043A\u0441 \u041C\u0430\u043A\u0441\u0421\u0442\u0440\u0422\u0431\u043B\u0421\u043F\u0440 \u041C\u0430\u0441\u0441\u0438\u0432 \u041C\u0435\u043D\u044E \u041C\u0435\u043D\u044E\u0420\u0430\u0441\u0448 \u041C\u0438\u043D \u041D\u0430\u0431\u043E\u0440\u0414\u0430\u043D\u043D\u044B\u0445\u041D\u0430\u0439\u0442\u0438\u0420\u0430\u0441\u0448 \u041D\u0430\u0438\u043C\u0412\u0438\u0434\u0421\u043F\u0440 \u041D\u0430\u0438\u043C\u041F\u043EAnalit \u041D\u0430\u0438\u043C\u0421\u043F\u0440 \u041D\u0430\u0441\u0442\u0440\u043E\u0438\u0442\u044C\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B\u0421\u0442\u0440\u043E\u043A \u041D\u0430\u0447\u041C\u0435\u0441 \u041D\u0430\u0447\u0422\u0440\u0430\u043D \u041D\u0438\u0436\u043D\u044F\u044F\u0413\u0440\u0430\u043D\u0438\u0446\u0430\u041C\u0430\u0441\u0441\u0438\u0432\u0430 \u041D\u043E\u043C\u0435\u0440\u0421\u043F\u0440 \u041D\u041F\u0435\u0440\u0438\u043E\u0434 \u041E\u043A\u043D\u043E \u041E\u043A\u0440 \u041E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u0435 \u041E\u0442\u043B\u0418\u043D\u0444\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u041E\u0442\u043B\u0418\u043D\u0444\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u041E\u0442\u0447\u0435\u0442 \u041E\u0442\u0447\u0435\u0442\u0410\u043D\u0430\u043B \u041E\u0442\u0447\u0435\u0442\u0418\u043D\u0442 \u041F\u0430\u043F\u043A\u0430\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u041F\u0430\u0443\u0437\u0430 \u041F\u0412\u044B\u0431\u043E\u0440SQL \u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C\u0424\u0430\u0439\u043B \u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 \u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0424\u0430\u0439\u043B \u041F\u043E\u0434\u0441\u0442\u0440 \u041F\u043E\u0438\u0441\u043A\u041F\u043E\u0434\u0441\u0442\u0440 \u041F\u043E\u0438\u0441\u043A\u0421\u0442\u0440 \u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C\u0418\u0414\u0422\u0430\u0431\u043B\u0438\u0446\u044B \u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0418\u0414 \u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0418\u043C\u044F \u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0421\u0442\u0430\u0442\u0443\u0441 \u041F\u0440\u0435\u0440\u0432\u0430\u0442\u044C \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0417\u043D\u0430\u0447 \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C\u0423\u0441\u043B\u043E\u0432\u0438\u0435 \u0420\u0430\u0437\u0431\u0421\u0442\u0440 \u0420\u0430\u0437\u043D\u0412\u0440\u0435\u043C\u044F \u0420\u0430\u0437\u043D\u0414\u0430\u0442 \u0420\u0430\u0437\u043D\u0414\u0430\u0442\u0430\u0412\u0440\u0435\u043C\u044F \u0420\u0430\u0437\u043D\u0420\u0430\u0431\u0412\u0440\u0435\u043C\u044F \u0420\u0435\u0433\u0423\u0441\u0442\u0412\u0440\u0435\u043C \u0420\u0435\u0433\u0423\u0441\u0442\u0414\u0430\u0442 \u0420\u0435\u0433\u0423\u0441\u0442\u0427\u0441\u043B \u0420\u0435\u0434\u0422\u0435\u043A\u0441\u0442 \u0420\u0435\u0435\u0441\u0442\u0440\u0417\u0430\u043F\u0438\u0441\u044C \u0420\u0435\u0435\u0441\u0442\u0440\u0421\u043F\u0438\u0441\u043E\u043A\u0418\u043C\u0435\u043D\u041F\u0430\u0440\u0430\u043C \u0420\u0435\u0435\u0441\u0442\u0440\u0427\u0442\u0435\u043D\u0438\u0435 \u0420\u0435\u043A\u0432\u0421\u043F\u0440 \u0420\u0435\u043A\u0432\u0421\u043F\u0440\u041F\u0440 \u0421\u0435\u0433\u043E\u0434\u043D\u044F \u0421\u0435\u0439\u0447\u0430\u0441 \u0421\u0435\u0440\u0432\u0435\u0440 \u0421\u0435\u0440\u0432\u0435\u0440\u041F\u0440\u043E\u0446\u0435\u0441\u0441\u0418\u0414 \u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u0424\u0430\u0439\u043B\u0421\u0447\u0438\u0442\u0430\u0442\u044C \u0421\u0436\u041F\u0440\u043E\u0431 \u0421\u0438\u043C\u0432\u043E\u043B \u0421\u0438\u0441\u0442\u0435\u043C\u0430\u0414\u0438\u0440\u0435\u043A\u0442\u0443\u043C\u041A\u043E\u0434 \u0421\u0438\u0441\u0442\u0435\u043C\u0430\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0421\u0438\u0441\u0442\u0435\u043C\u0430\u041A\u043E\u0434 \u0421\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u0421\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0421\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0414\u0438\u0430\u043B\u043E\u0433 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0414\u0438\u0430\u043B\u043E\u0433\u0412\u044B\u0431\u043E\u0440\u0430\u0418\u0437\u0414\u0432\u0443\u0445\u0421\u043F\u0438\u0441\u043A\u043E\u0432 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0414\u0438\u0430\u043B\u043E\u0433\u0412\u044B\u0431\u043E\u0440\u0430\u041F\u0430\u043F\u043A\u0438 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0414\u0438\u0430\u043B\u043E\u0433\u041E\u0442\u043A\u0440\u044B\u0442\u0438\u044F\u0424\u0430\u0439\u043B\u0430 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0414\u0438\u0430\u043B\u043E\u0433\u0421\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F\u0424\u0430\u0439\u043B\u0430 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0417\u0430\u043F\u0440\u043E\u0441 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0418\u043D\u0434\u0438\u043A\u0430\u0442\u043E\u0440 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0418\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439\u0421\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041C\u0430\u0441\u0441\u0438\u0432 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041D\u0430\u0431\u043E\u0440\u0414\u0430\u043D\u043D\u044B\u0445 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041E\u0431\u044A\u0435\u043A\u0442 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041E\u0442\u0447\u0435\u0442 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u041F\u0430\u043F\u043A\u0443 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0420\u0435\u0434\u0430\u043A\u0442\u043E\u0440 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0421\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0421\u043F\u0438\u0441\u043E\u043A \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0421\u043F\u0438\u0441\u043E\u043A\u0421\u0442\u0440\u043E\u043A \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0421\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A \u0421\u043E\u0437\u0434\u0430\u0442\u044C\u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0439 \u0421\u043E\u0437\u0434\u0421\u043F\u0440 \u0421\u043E\u0441\u0442\u0421\u043F\u0440 \u0421\u043E\u0445\u0440 \u0421\u043E\u0445\u0440\u0421\u043F\u0440 \u0421\u043F\u0438\u0441\u043E\u043A\u0421\u0438\u0441\u0442\u0435\u043C \u0421\u043F\u0440 \u0421\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A \u0421\u043F\u0440\u0411\u043B\u043E\u043A\u0415\u0441\u0442\u044C \u0421\u043F\u0440\u0411\u043B\u043E\u043A\u0421\u043D\u044F\u0442\u044C \u0421\u043F\u0440\u0411\u043B\u043E\u043A\u0421\u043D\u044F\u0442\u044C\u0420\u0430\u0441\u0448 \u0421\u043F\u0440\u0411\u043B\u043E\u043A\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0421\u043F\u0440\u0418\u0437\u043C\u041D\u0430\u0431\u0414\u0430\u043D \u0421\u043F\u0440\u041A\u043E\u0434 \u0421\u043F\u0440\u041D\u043E\u043C\u0435\u0440 \u0421\u043F\u0440\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0421\u043F\u0440\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0421\u043F\u0440\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0421\u043F\u0440\u041F\u0430\u0440\u0430\u043C \u0421\u043F\u0440\u041F\u043E\u043B\u0435\u0417\u043D\u0430\u0447 \u0421\u043F\u0440\u041F\u043E\u043B\u0435\u0418\u043C\u044F \u0421\u043F\u0440\u0420\u0435\u043A\u0432 \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u0412\u0432\u0435\u0434\u0417\u043D \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u041D\u043E\u0432\u044B\u0435 \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u041F\u0440 \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u041F\u0440\u0435\u0434\u0417\u043D \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u0420\u0435\u0436\u0438\u043C \u0421\u043F\u0440\u0420\u0435\u043A\u0432\u0422\u0438\u043F\u0422\u0435\u043A\u0441\u0442 \u0421\u043F\u0440\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0421\u043F\u0440\u0421\u043E\u0441\u0442 \u0421\u043F\u0440\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0421\u043F\u0440\u0422\u0431\u043B\u0418\u0442\u043E\u0433 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u041A\u043E\u043B \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u041C\u0430\u043A\u0441 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u041C\u0438\u043D \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u041F\u0440\u0435\u0434 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u0421\u043B\u0435\u0434 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u0421\u043E\u0437\u0434 \u0421\u043F\u0440\u0422\u0431\u043B\u0421\u0442\u0440\u0423\u0434 \u0421\u043F\u0440\u0422\u0435\u043A\u041F\u0440\u0435\u0434\u0441\u0442 \u0421\u043F\u0440\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0421\u0440\u0430\u0432\u043D\u0438\u0442\u044C\u0421\u0442\u0440 \u0421\u0442\u0440\u0412\u0435\u0440\u0445\u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u0421\u0442\u0440\u041D\u0438\u0436\u043D\u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u0421\u0442\u0440\u0422\u0431\u043B\u0421\u043F\u0440 \u0421\u0443\u043C\u041F\u0440\u043E\u043F \u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0439 \u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0439\u041F\u0430\u0440\u0430\u043C \u0422\u0435\u043A\u0412\u0435\u0440\u0441\u0438\u044F \u0422\u0435\u043A\u041E\u0440\u0433 \u0422\u043E\u0447\u043D \u0422\u0440\u0430\u043D \u0422\u0440\u0430\u043D\u0441\u043B\u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044F \u0423\u0434\u0430\u043B\u0438\u0442\u044C\u0422\u0430\u0431\u043B\u0438\u0446\u0443 \u0423\u0434\u0430\u043B\u0438\u0442\u044C\u0424\u0430\u0439\u043B \u0423\u0434\u0421\u043F\u0440 \u0423\u0434\u0421\u0442\u0440\u0422\u0431\u043B\u0421\u043F\u0440 \u0423\u0441\u0442 \u0423\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438\u041A\u043E\u043D\u0441\u0442\u0430\u043D\u0442 \u0424\u0430\u0439\u043B\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u0421\u0447\u0438\u0442\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0424\u0430\u0439\u043B\u0412\u0440\u0435\u043C\u044F \u0424\u0430\u0439\u043B\u0412\u0440\u0435\u043C\u044F\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0424\u0430\u0439\u043B\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0417\u0430\u043D\u044F\u0442 \u0424\u0430\u0439\u043B\u0417\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0418\u0441\u043A\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u041C\u043E\u0436\u043D\u043E\u0427\u0438\u0442\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0424\u0430\u0439\u043B\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u041F\u0435\u0440\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u0424\u0430\u0439\u043B\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0424\u0430\u0439\u043B\u0420\u0430\u0437\u043C\u0435\u0440 \u0424\u0430\u0439\u043B\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0421\u0441\u044B\u043B\u043A\u0430\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0424\u0430\u0439\u043B\u0421\u0447\u0438\u0442\u0430\u0442\u044C \u0424\u0430\u0439\u043B\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0424\u043C\u0442SQL\u0414\u0430\u0442 \u0424\u043C\u0442\u0414\u0430\u0442 \u0424\u043C\u0442\u0421\u0442\u0440 \u0424\u043C\u0442\u0427\u0441\u043B \u0424\u043E\u0440\u043C\u0430\u0442 \u0426\u041C\u0430\u0441\u0441\u0438\u0432\u042D\u043B\u0435\u043C\u0435\u043D\u0442 \u0426\u041D\u0430\u0431\u043E\u0440\u0414\u0430\u043D\u043D\u044B\u0445\u0420\u0435\u043A\u0432\u0438\u0437\u0438\u0442 \u0426\u041F\u043E\u0434\u0441\u0442\u0440 ",Ra="AltState Application CallType ComponentTokens CreatedJobs CreatedNotices ControlState DialogResult Dialogs EDocuments EDocumentVersionSource Folders GlobalIDs Job Jobs InputValue LookUpReference LookUpRequisiteNames LookUpSearch Object ParentComponent Processes References Requisite ReportName Reports Result Scripts Searches SelectedAttachments SelectedItems SelectMode Sender ServerEvents ServiceFactory ShiftState SubTask SystemDialogs Tasks Wizard Wizards Work \u0412\u044B\u0437\u043E\u0432\u0421\u043F\u043E\u0441\u043E\u0431 \u0418\u043C\u044F\u041E\u0442\u0447\u0435\u0442\u0430 \u0420\u0435\u043A\u0432\u0417\u043D\u0430\u0447 ",ka="IApplication IAccessRights IAccountRepository IAccountSelectionRestrictions IAction IActionList IAdministrationHistoryDescription IAnchors IApplication IArchiveInfo IAttachment IAttachmentList ICheckListBox ICheckPointedList IColumn IComponent IComponentDescription IComponentToken IComponentTokenFactory IComponentTokenInfo ICompRecordInfo IConnection IContents IControl IControlJob IControlJobInfo IControlList ICrypto ICrypto2 ICustomJob ICustomJobInfo ICustomListBox ICustomObjectWizardStep ICustomWork ICustomWorkInfo IDataSet IDataSetAccessInfo IDataSigner IDateCriterion IDateRequisite IDateRequisiteDescription IDateValue IDeaAccessRights IDeaObjectInfo IDevelopmentComponentLock IDialog IDialogFactory IDialogPickRequisiteItems IDialogsFactory IDICSFactory IDocRequisite IDocumentInfo IDualListDialog IECertificate IECertificateInfo IECertificates IEditControl IEditorForm IEdmsExplorer IEdmsObject IEdmsObjectDescription IEdmsObjectFactory IEdmsObjectInfo IEDocument IEDocumentAccessRights IEDocumentDescription IEDocumentEditor IEDocumentFactory IEDocumentInfo IEDocumentStorage IEDocumentVersion IEDocumentVersionListDialog IEDocumentVersionSource IEDocumentWizardStep IEDocVerSignature IEDocVersionState IEnabledMode IEncodeProvider IEncrypter IEvent IEventList IException IExternalEvents IExternalHandler IFactory IField IFileDialog IFolder IFolderDescription IFolderDialog IFolderFactory IFolderInfo IForEach IForm IFormTitle IFormWizardStep IGlobalIDFactory IGlobalIDInfo IGrid IHasher IHistoryDescription IHyperLinkControl IImageButton IImageControl IInnerPanel IInplaceHint IIntegerCriterion IIntegerList IIntegerRequisite IIntegerValue IISBLEditorForm IJob IJobDescription IJobFactory IJobForm IJobInfo ILabelControl ILargeIntegerCriterion ILargeIntegerRequisite ILargeIntegerValue ILicenseInfo ILifeCycleStage IList IListBox ILocalIDInfo ILocalization ILock IMemoryDataSet IMessagingFactory IMetadataRepository INotice INoticeInfo INumericCriterion INumericRequisite INumericValue IObject IObjectDescription IObjectImporter IObjectInfo IObserver IPanelGroup IPickCriterion IPickProperty IPickRequisite IPickRequisiteDescription IPickRequisiteItem IPickRequisiteItems IPickValue IPrivilege IPrivilegeList IProcess IProcessFactory IProcessMessage IProgress IProperty IPropertyChangeEvent IQuery IReference IReferenceCriterion IReferenceEnabledMode IReferenceFactory IReferenceHistoryDescription IReferenceInfo IReferenceRecordCardWizardStep IReferenceRequisiteDescription IReferencesFactory IReferenceValue IRefRequisite IReport IReportFactory IRequisite IRequisiteDescription IRequisiteDescriptionList IRequisiteFactory IRichEdit IRouteStep IRule IRuleList ISchemeBlock IScript IScriptFactory ISearchCriteria ISearchCriterion ISearchDescription ISearchFactory ISearchFolderInfo ISearchForObjectDescription ISearchResultRestrictions ISecuredContext ISelectDialog IServerEvent IServerEventFactory IServiceDialog IServiceFactory ISignature ISignProvider ISignProvider2 ISignProvider3 ISimpleCriterion IStringCriterion IStringList IStringRequisite IStringRequisiteDescription IStringValue ISystemDialogsFactory ISystemInfo ITabSheet ITask ITaskAbortReasonInfo ITaskCardWizardStep ITaskDescription ITaskFactory ITaskInfo ITaskRoute ITextCriterion ITextRequisite ITextValue ITreeListSelectDialog IUser IUserList IValue IView IWebBrowserControl IWizard IWizardAction IWizardFactory IWizardFormElement IWizardParam IWizardPickParam IWizardReferenceParam IWizardStep IWorkAccessRights IWorkDescription IWorkflowAskableParam IWorkflowAskableParams IWorkflowBlock IWorkflowBlockResult IWorkflowEnabledMode IWorkflowParam IWorkflowPickParam IWorkflowReferenceParam IWorkState IWorkTreeCustomNode IWorkTreeJobNode IWorkTreeTaskNode IXMLEditorForm SBCrypto ",Cp=ie+va,Hn=Ra,Em="null true false nil ",bm={className:"number",begin:t.NUMBER_RE,relevance:0},ci={className:"string",variants:[{begin:'"',end:'"'},{begin:"'",end:"'"}]},Ip={className:"doctag",begin:"\\b(?:TODO|DONE|BEGIN|END|STUB|CHG|FIXME|NOTE|BUG|XXX)\\b",relevance:0},_m={className:"comment",begin:"//",end:"$",relevance:0,contains:[t.PHRASAL_WORDS_MODE,Ip]},m_={className:"comment",begin:"/\\*",end:"\\*/",relevance:0,contains:[t.PHRASAL_WORDS_MODE,Ip]},xc={variants:[_m,m_]},mu={$pattern:e,keyword:r,built_in:Cp,class:Hn,literal:Em},fh={begin:"\\.\\s*"+t.UNDERSCORE_IDENT_RE,keywords:mu,relevance:0},zd={className:"type",begin:":[ \\t]*("+ka.trim().replace(/\s/g,"|")+")",end:"[ \\t]*=",excludeEnd:!0},zc={className:"variable",keywords:mu,begin:e,relevance:0,contains:[zd,fh]},Af=n+"\\(";return{name:"ISBL",case_insensitive:!0,keywords:mu,illegal:"\\$|\\?|%|,|;$|~|#|@|{p();function d2i(t){let n={className:"params",begin:/\(/,end:/\)/,contains:[{begin:/[\w-]+ *=/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/[\w-]+/}]}],relevance:0},r={className:"function",begin:/:[\w\-.]+/,relevance:0},i={className:"string",begin:/\B([\/.])[\w\-.\/=]+/},s={className:"params",begin:/--[\w\-=\/]+/};return{name:"JBoss CLI",aliases:["wildfly-cli"],keywords:{$pattern:"[a-z-]+",keyword:"alias batch cd clear command connect connection-factory connection-info data-source deploy deployment-info deployment-overlay echo echo-dmr help history if jdbc-driver-info jms-queue|20 jms-topic|20 ls patch pwd quit read-attribute read-operation reload rollout-plan run-batch set shutdown try unalias undeploy unset version xa-data-source",literal:"true false"},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,s,r,i,n]}}qMn.exports=d2i});var YMn=re((alc,VMn)=>{p();function p2i(t){let e={literal:"true false null"},n=[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],r=[t.QUOTE_STRING_MODE,t.C_NUMBER_MODE],i={end:",",endsWithParent:!0,excludeEnd:!0,contains:r,keywords:e},s={begin:/\{/,end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE],illegal:"\\n"},t.inherit(i,{begin:/:/})].concat(n),illegal:"\\S"},o={begin:"\\[",end:"\\]",contains:[t.inherit(i)],illegal:"\\S"};return r.push(s,o),n.forEach(function(a){r.push(a)}),{name:"JSON",contains:r,keywords:e,illegal:"\\S"}}VMn.exports=p2i});var KMn=re((llc,zMn)=>{p();function m2i(t){var e="[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*",n=["baremodule","begin","break","catch","ccall","const","continue","do","else","elseif","end","export","false","finally","for","function","global","if","import","in","isa","let","local","macro","module","quote","return","true","try","using","where","while"],r=["ARGS","C_NULL","DEPOT_PATH","ENDIAN_BOM","ENV","Inf","Inf16","Inf32","Inf64","InsertionSort","LOAD_PATH","MergeSort","NaN","NaN16","NaN32","NaN64","PROGRAM_FILE","QuickSort","RoundDown","RoundFromZero","RoundNearest","RoundNearestTiesAway","RoundNearestTiesUp","RoundToZero","RoundUp","VERSION|0","devnull","false","im","missing","nothing","pi","stderr","stdin","stdout","true","undef","\u03C0","\u212F"],i=["AbstractArray","AbstractChannel","AbstractChar","AbstractDict","AbstractDisplay","AbstractFloat","AbstractIrrational","AbstractMatrix","AbstractRange","AbstractSet","AbstractString","AbstractUnitRange","AbstractVecOrMat","AbstractVector","Any","ArgumentError","Array","AssertionError","BigFloat","BigInt","BitArray","BitMatrix","BitSet","BitVector","Bool","BoundsError","CapturedException","CartesianIndex","CartesianIndices","Cchar","Cdouble","Cfloat","Channel","Char","Cint","Cintmax_t","Clong","Clonglong","Cmd","Colon","Complex","ComplexF16","ComplexF32","ComplexF64","CompositeException","Condition","Cptrdiff_t","Cshort","Csize_t","Cssize_t","Cstring","Cuchar","Cuint","Cuintmax_t","Culong","Culonglong","Cushort","Cvoid","Cwchar_t","Cwstring","DataType","DenseArray","DenseMatrix","DenseVecOrMat","DenseVector","Dict","DimensionMismatch","Dims","DivideError","DomainError","EOFError","Enum","ErrorException","Exception","ExponentialBackOff","Expr","Float16","Float32","Float64","Function","GlobalRef","HTML","IO","IOBuffer","IOContext","IOStream","IdDict","IndexCartesian","IndexLinear","IndexStyle","InexactError","InitError","Int","Int128","Int16","Int32","Int64","Int8","Integer","InterruptException","InvalidStateException","Irrational","KeyError","LinRange","LineNumberNode","LinearIndices","LoadError","MIME","Matrix","Method","MethodError","Missing","MissingException","Module","NTuple","NamedTuple","Nothing","Number","OrdinalRange","OutOfMemoryError","OverflowError","Pair","PartialQuickSort","PermutedDimsArray","Pipe","ProcessFailedException","Ptr","QuoteNode","Rational","RawFD","ReadOnlyMemoryError","Real","ReentrantLock","Ref","Regex","RegexMatch","RoundingMode","SegmentationFault","Set","Signed","Some","StackOverflowError","StepRange","StepRangeLen","StridedArray","StridedMatrix","StridedVecOrMat","StridedVector","String","StringIndexError","SubArray","SubString","SubstitutionString","Symbol","SystemError","Task","TaskFailedException","Text","TextDisplay","Timer","Tuple","Type","TypeError","TypeVar","UInt","UInt128","UInt16","UInt32","UInt64","UInt8","UndefInitializer","UndefKeywordError","UndefRefError","UndefVarError","Union","UnionAll","UnitRange","Unsigned","Val","Vararg","VecElement","VecOrMat","Vector","VersionNumber","WeakKeyDict","WeakRef"],s={$pattern:e,keyword:n,literal:r,built_in:i},o={keywords:s,illegal:/<\//},a={className:"number",begin:/(\b0x[\d_]*(\.[\d_]*)?|0x\.\d[\d_]*)p[-+]?\d+|\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\b\d[\d_]*(\.[\d_]*)?|\.\d[\d_]*)([eEfF][-+]?\d+)?/,relevance:0},c={className:"string",begin:/'(.|\\[xXuU][a-zA-Z0-9]+)'/},u={className:"subst",begin:/\$\(/,end:/\)/,keywords:s},l={className:"variable",begin:"\\$"+e},d={className:"string",contains:[t.BACKSLASH_ESCAPE,u,l],variants:[{begin:/\w*"""/,end:/"""\w*/,relevance:10},{begin:/\w*"/,end:/"\w*/}]},m={className:"string",contains:[t.BACKSLASH_ESCAPE,u,l],begin:"`",end:"`"},h={className:"meta",begin:"@"+e},f={className:"comment",variants:[{begin:"#=",end:"=#",relevance:10},{begin:"#",end:"$"}]};return o.name="Julia",o.contains=[a,c,d,m,h,f,t.HASH_COMMENT_MODE,{className:"keyword",begin:"\\b(((abstract|primitive)\\s+)type|(mutable\\s+)?struct)\\b"},{begin:/<:/}],u.contains=o.contains,o}zMn.exports=m2i});var XMn=re((dlc,JMn)=>{p();function h2i(t){return{name:"Julia REPL",contains:[{className:"meta",begin:/^julia>/,relevance:10,starts:{end:/^(?![ ]{6})/,subLanguage:"julia"},aliases:["jldoctest"]}]}}JMn.exports=h2i});var eOn=re((mlc,ZMn)=>{p();function f2i(t){let e="[a-zA-Z_][\\w.]*",n="<\\?(lasso(script)?|=)",r="\\]|\\?>",i={$pattern:e+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},s=t.COMMENT("",{relevance:0}),o={className:"meta",begin:"\\[noprocess\\]",starts:{end:"\\[/noprocess\\]",returnEnd:!0,contains:[s]}},a={className:"meta",begin:"\\[/noprocess|"+n},c={className:"symbol",begin:"'"+e+"'"},u=[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.inherit(t.C_NUMBER_MODE,{begin:t.C_NUMBER_RE+"|(-?infinity|NaN)\\b"}),t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"`",end:"`"},{variants:[{begin:"[#$]"+e},{begin:"#",end:"\\d+",illegal:"\\W"}]},{className:"type",begin:"::\\s*",end:e,illegal:"\\W"},{className:"params",variants:[{begin:"-(?!infinity)"+e,relevance:0},{begin:"(\\.\\.\\.)"}]},{begin:/(->|\.)\s*/,relevance:0,contains:[c]},{className:"class",beginKeywords:"define",returnEnd:!0,end:"\\(|=>",contains:[t.inherit(t.TITLE_MODE,{begin:e+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:i,contains:[{className:"meta",begin:r,relevance:0,starts:{end:"\\[|"+n,returnEnd:!0,relevance:0,contains:[s]}},o,a,{className:"meta",begin:"\\[no_square_brackets",starts:{end:"\\[/no_square_brackets\\]",keywords:i,contains:[{className:"meta",begin:r,relevance:0,starts:{end:"\\[noprocess\\]|"+n,returnEnd:!0,contains:[s]}},o,a].concat(u)}},{className:"meta",begin:"\\[",relevance:0},{className:"meta",begin:"^#!",end:"lasso9$",relevance:10}].concat(u)}}ZMn.exports=f2i});var nOn=re((flc,tOn)=>{p();function g2i(t){return t?typeof t=="string"?t:t.source:null}function A2i(...t){return"("+t.map(n=>g2i(n)).join("|")+")"}function y2i(t){let e=A2i(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(N=>N+"(?![a-zA-Z@:_])")),n=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}","[qs]__?[a-zA-Z](?:_?[a-zA-Z])+","use(?:_i)?:[a-zA-Z]*","(?:else|fi|or):","(?:if|cs|exp):w","(?:hbox|vbox):n","::[a-zA-Z]_unbraced","::[a-zA-Z:]"].map(N=>N+"(?![a-zA-Z:_])").join("|")),r=[{begin:/[a-zA-Z@]+/},{begin:/[^a-zA-Z@]?/}],i=[{begin:/\^{6}[0-9a-f]{6}/},{begin:/\^{5}[0-9a-f]{5}/},{begin:/\^{4}[0-9a-f]{4}/},{begin:/\^{3}[0-9a-f]{3}/},{begin:/\^{2}[0-9a-f]{2}/},{begin:/\^{2}[\u0000-\u007f]/}],s={className:"keyword",begin:/\\/,relevance:0,contains:[{endsParent:!0,begin:e},{endsParent:!0,begin:n},{endsParent:!0,variants:i},{endsParent:!0,relevance:0,variants:r}]},o={className:"params",relevance:0,begin:/#+\d?/},a={variants:i},c={className:"built_in",relevance:0,begin:/[$&^_]/},u={className:"meta",begin:"% !TeX",end:"$",relevance:10},l=t.COMMENT("%","$",{relevance:0}),d=[s,o,a,c,u,l],m={begin:/\{/,end:/\}/,relevance:0,contains:["self",...d]},h=t.inherit(m,{relevance:0,endsParent:!0,contains:[m,...d]}),f={begin:/\[/,end:/\]/,endsParent:!0,relevance:0,contains:[m,...d]},g={begin:/\s+/,relevance:0},A=[h],y=[f],E=function(N,O){return{contains:[g],starts:{relevance:0,contains:N,starts:O}}},_=function(N,O){return{begin:"\\\\"+N+"(?![a-zA-Z@:_])",keywords:{$pattern:/\\[a-zA-Z]+/,keyword:"\\"+N},relevance:0,contains:[g],starts:O}},S=function(N,O){return t.inherit({begin:"\\\\begin(?=[ ]*(\\r?\\n[ ]*)?\\{"+N+"\\})",keywords:{$pattern:/\\[a-zA-Z]+/,keyword:"\\begin"},relevance:0},E(A,O))},C=(N="string")=>t.END_SAME_AS_BEGIN({className:N,begin:/(.|\r?\n)/,end:/(.|\r?\n)/,excludeBegin:!0,excludeEnd:!0,endsParent:!0}),I=function(N){return{className:"string",end:"(?=\\\\end\\{"+N+"\\})"}},w=(N="string")=>({relevance:0,begin:/\{/,starts:{endsParent:!0,contains:[{className:N,end:/(?=\})/,endsParent:!0,contains:[{begin:/\{/,end:/\}/,relevance:0,contains:["self"]}]}]}}),k=[...["verb","lstinline"].map(N=>_(N,{contains:[C()]})),_("mint",E(A,{contains:[C()]})),_("mintinline",E(A,{contains:[w(),C()]})),_("url",{contains:[w("link"),w("link")]}),_("hyperref",{contains:[w("link")]}),_("href",E(y,{contains:[w("link")]})),...[].concat(...["","\\*"].map(N=>[S("verbatim"+N,I("verbatim"+N)),S("filecontents"+N,E(A,I("filecontents"+N))),...["","B","L"].map(O=>S(O+"Verbatim"+N,E(y,I(O+"Verbatim"+N))))])),S("minted",E(y,E(A,I("minted"))))];return{name:"LaTeX",aliases:["tex"],contains:[...k,...d]}}tOn.exports=y2i});var iOn=re((Alc,rOn)=>{p();function E2i(t){return{name:"LDIF",contains:[{className:"attribute",begin:"^dn",end:": ",excludeEnd:!0,starts:{end:"$",relevance:0},relevance:10},{className:"attribute",begin:"^\\w",end:": ",excludeEnd:!0,starts:{end:"$",relevance:0}},{className:"literal",begin:"^-",end:"$"},t.HASH_COMMENT_MODE]}}rOn.exports=E2i});var oOn=re((Elc,sOn)=>{p();function b2i(t){return{name:"Leaf",contains:[{className:"function",begin:"#+[A-Za-z_0-9]*\\(",end:/ \{/,returnBegin:!0,excludeEnd:!0,contains:[{className:"keyword",begin:"#+"},{className:"title",begin:"[A-Za-z_][A-Za-z_0-9]*"},{className:"params",begin:"\\(",end:"\\)",endsParent:!0,contains:[{className:"string",begin:'"',end:'"'},{className:"variable",begin:"[A-Za-z_][A-Za-z_0-9]*"}]}]}]}}sOn.exports=b2i});var uOn=re((_lc,lOn)=>{p();var _2i=t=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]}}),x2i=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],S2i=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],aOn=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],cOn=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],C2i=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse(),I2i=aOn.concat(cOn);function w2i(t){let e=_2i(t),n=I2i,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",o=[],a=[],c=function(_){return{className:"string",begin:"~?"+_+".*?"+_}},u=function(_,S,C){return{className:_,begin:S,relevance:C}},l={$pattern:/[a-z-]+/,keyword:r,attribute:S2i.join(" ")},d={begin:"\\(",end:"\\)",contains:a,keywords:l,relevance:0};a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT);let m=a.concat({begin:/\{/,end:/\}/,contains:o}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},f={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},{className:"attribute",begin:"\\b("+C2i.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:a,relevance:0}},A={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,h,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+x2i.join("|")+")\\b",className:"selector-tag"},u("selector-tag",s+"%?",0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+aOn.join("|")+")"},{className:"selector-pseudo",begin:"::("+cOn.join("|")+")"},{begin:"\\(",end:"\\)",contains:m},{begin:"!important"}]},E={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,A,E,f,y),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}lOn.exports=w2i});var pOn=re((Slc,dOn)=>{p();function T2i(t){var e="[a-zA-Z_\\-+\\*\\/<=>&#][a-zA-Z0-9_\\-+*\\/<=>&#!]*",n="\\|[^]*?\\|",r="(-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|-)?\\d+)?",i={className:"literal",begin:"\\b(t{1}|nil)\\b"},s={className:"number",variants:[{begin:r,relevance:0},{begin:"#(b|B)[0-1]+(/[0-1]+)?"},{begin:"#(o|O)[0-7]+(/[0-7]+)?"},{begin:"#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?"},{begin:"#(c|C)\\("+r+" +"+r,end:"\\)"}]},o=t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),a=t.COMMENT(";","$",{relevance:0}),c={begin:"\\*",end:"\\*"},u={className:"symbol",begin:"[:&]"+e},l={begin:e,relevance:0},d={begin:n},m={begin:"\\(",end:"\\)",contains:["self",i,o,s,l]},h={contains:[s,o,c,u,m,l],variants:[{begin:"['`]\\(",end:"\\)"},{begin:"\\(quote ",end:"\\)",keywords:{name:"quote"}},{begin:"'"+n}]},f={variants:[{begin:"'"+e},{begin:"#'"+e+"(::"+e+")*"}]},g={begin:"\\(\\s*",end:"\\)"},A={endsWithParent:!0,relevance:0};return g.contains=[{className:"name",variants:[{begin:e,relevance:0},{begin:n}]},A],A.contains=[h,f,g,i,s,o,a,c,u,d,l],{name:"Lisp",illegal:/\S/,contains:[s,t.SHEBANG(),i,o,a,h,f,g,l]}}dOn.exports=T2i});var hOn=re((Ilc,mOn)=>{p();function v2i(t){let e={className:"variable",variants:[{begin:"\\b([gtps][A-Z]{1}[a-zA-Z0-9]*)(\\[.+\\])?(?:\\s*?)"},{begin:"\\$_[A-Z]+"}],relevance:0},n=[t.C_BLOCK_COMMENT_MODE,t.HASH_COMMENT_MODE,t.COMMENT("--","$"),t.COMMENT("[^:]//","$")],r=t.inherit(t.TITLE_MODE,{variants:[{begin:"\\b_*rig[A-Z][A-Za-z0-9_\\-]*"},{begin:"\\b_[a-z0-9\\-]+"}]}),i=t.inherit(t.TITLE_MODE,{begin:"\\b([A-Za-z0-9_\\-]+)\\b"});return{name:"LiveCode",case_insensitive:!1,keywords:{keyword:"$_COOKIE $_FILES $_GET $_GET_BINARY $_GET_RAW $_POST $_POST_BINARY $_POST_RAW $_SESSION $_SERVER codepoint codepoints segment segments codeunit codeunits sentence sentences trueWord trueWords paragraph after byte bytes english the until http forever descending using line real8 with seventh for stdout finally element word words fourth before black ninth sixth characters chars stderr uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat end repeat URL in try into switch to words https token binfile each tenth as ticks tick system real4 by dateItems without char character ascending eighth whole dateTime numeric short first ftp integer abbreviated abbr abbrev private case while if div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within contains ends with begins the keys of keys",literal:"SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five quote empty one true return cr linefeed right backslash null seven tab three two RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK",built_in:"put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg avgDev base64Decode base64Encode baseConvert binaryDecode binaryEncode byteOffset byteToNum cachedURL cachedURLs charToNum cipherNames codepointOffset codepointProperty codepointToNum codeunitOffset commandNames compound compress constantNames cos date dateFormat decompress difference directories diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames geometricMean global globals hasMemory harmonicMean hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge messageAuthenticationCode messageDigest millisec millisecs millisecond milliseconds min monthNames nativeCharToNum normalizeText num number numToByte numToChar numToCodepoint numToNativeChar offset open openfiles openProcesses openProcessIDs openSockets paragraphOffset paramCount param params peerAddress pendingMessages platform popStdDev populationStandardDeviation populationVariance popVariance processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLCreateTreeFromFileWithNamespaces revXMLCreateTreeWithNamespaces revXMLDataFromXPathQuery revXMLEvaluateXPath revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_Execute revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sampVariance sec secs seconds sentenceOffset sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound stdDev sum sysError systemVersion tan tempName textDecode textEncode tick ticks time to tokenOffset toLower toUpper transpose truewordOffset trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus uuid value variableNames variance version waitDepth weekdayNames wordOffset xsltApplyStylesheet xsltApplyStylesheetFromFile xsltLoadStylesheet xsltLoadStylesheetFromFile add breakpoint cancel clear local variable file word line folder directory URL close socket process combine constant convert create new alias folder directory decrypt delete variable word line folder directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback libURLSetDriver libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime libURLSetStatusCallback load extension loadedExtensions multiply socket prepare process post seek rel relative read from process rename replace require resetAll resolve revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split start stop subtract symmetric union unload vectorDotProduct wait write"},contains:[e,{className:"keyword",begin:"\\bend\\sif\\b"},{className:"function",beginKeywords:"function",end:"$",contains:[e,i,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE,r]},{className:"function",begin:"\\bend\\s+",end:"$",keywords:"end",contains:[i,r],relevance:0},{beginKeywords:"command on",end:"$",contains:[e,i,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE,r]},{className:"meta",variants:[{begin:"<\\?(rev|lc|livecode)",relevance:10},{begin:"<\\?"},{begin:"\\?>"}]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE,r].concat(n),illegal:";$|^\\[|^=|&|\\{"}}mOn.exports=v2i});var gOn=re((Tlc,fOn)=>{p();var R2i=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],k2i=["true","false","null","undefined","NaN","Infinity"],B2i=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],N2i=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],D2i=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],P2i=["arguments","this","super","console","window","document","localStorage","module","global"],M2i=[].concat(D2i,P2i,B2i,N2i);function O2i(t){let e=["npm","print"],n=["yes","no","on","off","it","that","void"],r=["then","unless","until","loop","of","by","when","and","or","is","isnt","not","it","that","otherwise","from","to","til","fallthrough","case","enum","native","list","map","__hasProp","__extends","__slice","__bind","__indexOf"],i={keyword:R2i.concat(r),literal:k2i.concat(n),built_in:M2i.concat(e)},s="[A-Za-z$_](?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*",o=t.inherit(t.TITLE_MODE,{begin:s}),a={className:"subst",begin:/#\{/,end:/\}/,keywords:i},c={className:"subst",begin:/#[A-Za-z$_]/,end:/(?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*/,keywords:i},u=[t.BINARY_NUMBER_MODE,{className:"number",begin:"(\\b0[xX][a-fA-F0-9_]+)|(\\b\\d(\\d|_\\d)*(\\.(\\d(\\d|_\\d)*)?)?(_*[eE]([-+]\\d(_\\d|\\d)*)?)?[_a-z]*)",relevance:0,starts:{end:"(\\s*/)?",relevance:0}},{className:"string",variants:[{begin:/'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[t.BACKSLASH_ESCAPE]},{begin:/"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,a,c]},{begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,a,c]},{begin:/\\/,end:/(\s|$)/,excludeEnd:!0}]},{className:"regexp",variants:[{begin:"//",end:"//[gim]*",contains:[a,t.HASH_COMMENT_MODE]},{begin:/\/(?![ *])(\\.|[^\\\n])*?\/[gim]*(?=\W)/}]},{begin:"@"+s},{begin:"``",end:"``",excludeBegin:!0,excludeEnd:!0,subLanguage:"javascript"}];a.contains=u;let l={className:"params",begin:"\\(",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:i,contains:["self"].concat(u)}]},d={begin:"(#=>|=>|\\|>>|-?->|!->)"};return{name:"LiveScript",aliases:["ls"],keywords:i,illegal:/\/\*/,contains:u.concat([t.COMMENT("\\/\\*","\\*\\/"),t.HASH_COMMENT_MODE,d,{className:"function",contains:[o,l],returnBegin:!0,variants:[{begin:"("+s+"\\s*(?:=|:=)\\s*)?(\\(.*\\)\\s*)?\\B->\\*?",end:"->\\*?"},{begin:"("+s+"\\s*(?:=|:=)\\s*)?!?(\\(.*\\)\\s*)?\\B[-~]{1,2}>\\*?",end:"[-~]{1,2}>\\*?"},{begin:"("+s+"\\s*(?:=|:=)\\s*)?(\\(.*\\)\\s*)?\\B!?[-~]{1,2}>\\*?",end:"!?[-~]{1,2}>\\*?"}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[o]},o]},{begin:s+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}fOn.exports=O2i});var yOn=re((Rlc,AOn)=>{p();function L2i(t){return t?typeof t=="string"?t:t.source:null}function QTe(...t){return t.map(n=>L2i(n)).join("")}function F2i(t){let e=/([-a-zA-Z$._][\w$.-]*)/,n={className:"type",begin:/\bi\d+(?=\s|\b)/},r={className:"operator",relevance:0,begin:/=/},i={className:"punctuation",relevance:0,begin:/,/},s={className:"number",variants:[{begin:/0[xX][a-fA-F0-9]+/},{begin:/-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?/}],relevance:0},o={className:"symbol",variants:[{begin:/^\s*[a-z]+:/}],relevance:0},a={className:"variable",variants:[{begin:QTe(/%/,e)},{begin:/%\d+/},{begin:/#\d+/}]},c={className:"title",variants:[{begin:QTe(/@/,e)},{begin:/@\d+/},{begin:QTe(/!/,e)},{begin:QTe(/!\d+/,e)},{begin:/!\d+/}]};return{name:"LLVM IR",keywords:"begin end true false declare define global constant private linker_private internal available_externally linkonce linkonce_odr weak weak_odr appending dllimport dllexport common default hidden protected extern_weak external thread_local zeroinitializer undef null to tail target triple datalayout volatile nuw nsw nnan ninf nsz arcp fast exact inbounds align addrspace section alias module asm sideeffect gc dbg linker_private_weak attributes blockaddress initialexec localdynamic localexec prefix unnamed_addr ccc fastcc coldcc x86_stdcallcc x86_fastcallcc arm_apcscc arm_aapcscc arm_aapcs_vfpcc ptx_device ptx_kernel intel_ocl_bicc msp430_intrcc spir_func spir_kernel x86_64_sysvcc x86_64_win64cc x86_thiscallcc cc c signext zeroext inreg sret nounwind noreturn noalias nocapture byval nest readnone readonly inlinehint noinline alwaysinline optsize ssp sspreq noredzone noimplicitfloat naked builtin cold nobuiltin noduplicate nonlazybind optnone returns_twice sanitize_address sanitize_memory sanitize_thread sspstrong uwtable returned type opaque eq ne slt sgt sle sge ult ugt ule uge oeq one olt ogt ole oge ord uno ueq une x acq_rel acquire alignstack atomic catch cleanup filter inteldialect max min monotonic nand personality release seq_cst singlethread umax umin unordered xchg add fadd sub fsub mul fmul udiv sdiv fdiv urem srem frem shl lshr ashr and or xor icmp fcmp phi call trunc zext sext fptrunc fpext uitofp sitofp fptoui fptosi inttoptr ptrtoint bitcast addrspacecast select va_arg ret br switch invoke unwind unreachable indirectbr landingpad resume malloc alloca free load store getelementptr extractelement insertelement shufflevector getresult extractvalue insertvalue atomicrmw cmpxchg fence argmemonly double",contains:[n,t.COMMENT(/;\s*$/,null,{relevance:0}),t.COMMENT(/;/,/$/),t.QUOTE_STRING_MODE,{className:"string",variants:[{begin:/"/,end:/[^\\]"/}]},c,i,r,a,o,s]}}AOn.exports=F2i});var bOn=re((Blc,EOn)=>{p();function Q2i(t){var e={className:"subst",begin:/\\[tn"\\]/},n={className:"string",begin:'"',end:'"',contains:[e]},r={className:"number",relevance:0,begin:t.C_NUMBER_RE},i={className:"literal",variants:[{begin:"\\b(PI|TWO_PI|PI_BY_TWO|DEG_TO_RAD|RAD_TO_DEG|SQRT2)\\b"},{begin:"\\b(XP_ERROR_(EXPERIENCES_DISABLED|EXPERIENCE_(DISABLED|SUSPENDED)|INVALID_(EXPERIENCE|PARAMETERS)|KEY_NOT_FOUND|MATURITY_EXCEEDED|NONE|NOT_(FOUND|PERMITTED(_LAND)?)|NO_EXPERIENCE|QUOTA_EXCEEDED|RETRY_UPDATE|STORAGE_EXCEPTION|STORE_DISABLED|THROTTLED|UNKNOWN_ERROR)|JSON_APPEND|STATUS_(PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(_OBJECT)?|(DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(_(BY_(LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(PARCEL(_OWNER)?|REGION)))?|CAMERA_(PITCH|DISTANCE|BEHINDNESS_(ANGLE|LAG)|(FOCUS|POSITION)(_(THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(ROOT|SET|ALL_(OTHERS|CHILDREN)|THIS)|ACTIVE|PASS(IVE|_(ALWAYS|IF_NOT_HANDLED|NEVER))|SCRIPTED|CONTROL_(FWD|BACK|(ROT_)?(LEFT|RIGHT)|UP|DOWN|(ML_)?LBUTTON)|PERMISSION_(RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(_START)?|TELEPORT|MEDIA)|OBJECT_(CLICK_ACTION|HOVER_HEIGHT|LAST_OWNER_ID|(PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_(ATTACHED|ON_REZ)|NAME|DESC|POS|PRIM_(COUNT|EQUIVALENCE)|RETURN_(PARCEL(_OWNER)?|REGION)|REZZER_KEY|ROO?T|VELOCITY|OMEGA|OWNER|GROUP(_TAG)?|CREATOR|ATTACHED_(POINT|SLOTS_AVAILABLE)|RENDER_WEIGHT|(BODY_SHAPE|PATHFINDING)_TYPE|(RUNNING|TOTAL)_SCRIPT_COUNT|TOTAL_INVENTORY_COUNT|SCRIPT_(MEMORY|TIME))|TYPE_(INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(DEBUG|PUBLIC)_CHANNEL|ATTACH_(AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](SHOULDER|HAND|FOOT|EAR|EYE|[UL](ARM|LEG)|HIP)|(LEFT|RIGHT)_PEC|HUD_(CENTER_[12]|TOP_(RIGHT|CENTER|LEFT)|BOTTOM(_(RIGHT|LEFT))?)|[LR]HAND_RING1|TAIL_(BASE|TIP)|[LR]WING|FACE_(JAW|[LR]EAR|[LR]EYE|TOUNGE)|GROIN|HIND_[LR]FOOT)|LAND_(LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(ONLINE|NAME|BORN|SIM_(POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(ON_FILE|USED)|REMOTE_DATA_(CHANNEL|REQUEST|REPLY)|PSYS_(PART_(BF_(ZERO|ONE(_MINUS_(DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(START|END)_(COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(RIBBON|WIND|INTERP_(COLOR|SCALE)|BOUNCE|FOLLOW_(SRC|VELOCITY)|TARGET_(POS|LINEAR)|EMISSIVE)_MASK)|SRC_(MAX_AGE|PATTERN|ANGLE_(BEGIN|END)|BURST_(RATE|PART_COUNT|RADIUS|SPEED_(MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(DROP|EXPLODE|ANGLE(_CONE(_EMPTY)?)?)))|VEHICLE_(REFERENCE_FRAME|TYPE_(NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(LINEAR|ANGULAR)_(FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(LINEAR|ANGULAR)_(DEFLECTION_(EFFICIENCY|TIMESCALE)|MOTOR_(DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(EFFICIENCY|TIMESCALE)|BANKING_(EFFICIENCY|MIX|TIMESCALE)|FLAG_(NO_DEFLECTION_UP|LIMIT_(ROLL_ONLY|MOTOR_UP)|HOVER_((WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(ALLOW_UNSIT|ALPHA_MODE(_(BLEND|EMISSIVE|MASK|NONE))?|NORMAL|SPECULAR|TYPE(_(BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(_(STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(NONE|LOW|MEDIUM|HIGH)|BUMP_(NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(DEFAULT|PLANAR)|SCRIPTED_SIT_ONLY|SCULPT_(TYPE_(SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(MIRROR|INVERT))|PHYSICS(_(SHAPE_(CONVEX|NONE|PRIM|TYPE)))?|(POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIT_TARGET|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(ALT_IMAGE_ENABLE|CONTROLS|(CURRENT|HOME)_URL|AUTO_(LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(WIDTH|HEIGHT)_PIXELS|WHITELIST(_ENABLE)?|PERMS_(INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(STANDARD|MINI)|PERM_(NONE|OWNER|GROUP|ANYONE)|MAX_(URL_LENGTH|WHITELIST_(SIZE|COUNT)|(WIDTH|HEIGHT)_PIXELS)))|MASK_(BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(MEDIA_COMMAND_(STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(ALLOW_(FLY|(GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(GROUP_)?OBJECTS)|USE_(ACCESS_(GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(GROUP|ALL)_OBJECT_ENTRY)|COUNT_(TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(HIDE|DEFAULT)|REGION_FLAG_(ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(METHOD|MIMETYPE|BODY_(MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|SIT_(INVALID_(AGENT|LINK_OBJECT)|NO(T_EXPERIENCE|_(ACCESS|EXPERIENCE_PERMISSION|SIT_TARGET)))|STRING_(TRIM(_(HEAD|TAIL))?)|CLICK_ACTION_(NONE|TOUCH|SIT|BUY|PAY|OPEN(_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(NONE|SCRIPT_MEMORY)|RC_(DATA_FLAGS|DETECT_PHANTOM|GET_(LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(TYPES|AGENTS|(NON)?PHYSICAL|LAND))|RCERR_(CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(ALLOWED_(AGENT|GROUP)_(ADD|REMOVE)|BANNED_AGENT_(ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(COMMAND|CMD_(PLAY|STOP|PAUSE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(CMD_((SMOOTH_)?STOP|JUMP)|DESIRED_(TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(_([ABCD]|NONE))?|MAX_(DECEL|TURN_RADIUS|(ACCEL|SPEED)))|PURSUIT_(OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(EVADE_(HIDDEN|SPOTTED)|FAILURE_(DYNAMIC_PATHFINDING_DISABLED|INVALID_(GOAL|START)|NO_(NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(PARCEL_)?UNREACHABLE)|(GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(_(FAST|NONE|SLOW))?|CONTENT_TYPE_(ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(RADIUS|STATIC)|(PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\\b"},{begin:"\\b(FALSE|TRUE)\\b"},{begin:"\\b(ZERO_ROTATION)\\b"},{begin:"\\b(EOF|JSON_(ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(GRANTED|DENIED))\\b"},{begin:"\\b(ZERO_VECTOR|TOUCH_INVALID_(TEXCOORD|VECTOR))\\b"}]},s={className:"built_in",begin:"\\b(ll(AgentInExperience|(Create|DataSize|Delete|KeyCount|Keys|Read|Update)KeyValue|GetExperience(Details|ErrorMessage)|ReturnObjectsBy(ID|Owner)|Json(2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(Mag|Norm|Dist)|Rot(Between|2(Euler|Fwd|Left|Up))|(Euler|Axes)2Rot|Whisper|(Region|Owner)?Say|Shout|Listen(Control|Remove)?|Sensor(Repeat|Remove)?|Detected(Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|([GS]et)(AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(Scale|Offset|Rotate)Texture|(Rot)?Target(Remove)?|(Stop)?MoveToTarget|Apply(Rotational)?Impulse|Set(KeyframedMotion|ContentType|RegionPos|(Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(Queueing|Radius)|Vehicle(Type|(Float|Vector|Rotation)Param)|(Touch|Sit)?Text|Camera(Eye|At)Offset|PrimitiveParams|ClickAction|Link(Alpha|Color|PrimitiveParams(Fast)?|Texture(Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get((Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(PrimitiveParams|Number(OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(Details|PermMask|PrimCount)|Parcel(MaxPrims|Details|Prim(Count|Owners))|Attached(List)?|(SPMax|Free|Used)Memory|Region(Name|TimeDilation|FPS|Corner|AgentCount)|Root(Position|Rotation)|UnixTime|(Parcel|Region)Flags|(Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(Prims|NotecardLines|Sides)|Animation(List)?|(Camera|Local)(Pos|Rot)|Vel|Accel|Omega|Time(stamp|OfDay)|(Object|CenterOf)?Mass|MassMKS|Energy|Owner|(Owner)?Key|SunDirection|Texture(Offset|Scale|Rot)|Inventory(Number|Name|Key|Type|Creator|PermMask)|Permissions(Key)?|StartParameter|List(Length|EntryType)|Date|Agent(Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(Name|State))|(Get|Reset|GetAndReset)Time|PlaySound(Slave)?|LoopSound(Master|Slave)?|(Trigger|Stop|Preload)Sound|((Get|Delete)Sub|Insert)String|To(Upper|Lower)|Give(InventoryList|Money)|RezObject|(Stop)?LookAt|Sleep|CollisionFilter|(Take|Release)Controls|DetachFromAvatar|AttachToAvatar(Temp)?|InstantMessage|(GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(Length|Trim)|(Start|Stop)Animation|TargetOmega|Request(Experience)?Permissions|(Create|Break)Link|BreakAllLinks|(Give|Remove)Inventory|Water|PassTouches|Request(Agent|Inventory)Data|TeleportAgent(Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(Axis|Angle)|A(cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(CSV|Integer|Json|Float|String|Key|Vector|Rot|List(Strided)?)|DeleteSubList|List(Statistics|Sort|Randomize|(Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(Slope|Normal|Contour)|GroundRepel|(Set|Remove)VehicleFlags|SitOnLink|(AvatarOn)?(Link)?SitTarget|Script(Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(Integer|String)ToBase64|XorBase64|Log(10)?|Base64To(String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(Load|Release|(E|Une)scape)URL|ParcelMedia(CommandList|Query)|ModPow|MapDestination|(RemoveFrom|AddTo|Reset)Land(Pass|Ban)List|(Set|Clear)CameraParams|HTTP(Request|Response)|TextBox|DetectedTouch(UV|Face|Pos|(N|Bin)ormal|ST)|(MD5|SHA1|DumpList2)String|Request(Secure)?URL|Clear(Prim|Link)Media|(Link)?ParticleSystem|(Get|Request)(Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\\b"};return{name:"LSL (Linden Scripting Language)",illegal:":",contains:[n,{className:"comment",variants:[t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/")],relevance:0},r,{className:"section",variants:[{begin:"\\b(state|default)\\b"},{begin:"\\b(state_(entry|exit)|touch(_(start|end))?|(land_)?collision(_(start|end))?|timer|listen|(no_)?sensor|control|(not_)?at_(rot_)?target|money|email|experience_permissions(_denied)?|run_time_permissions|changed|attach|dataserver|moving_(start|end)|link_message|(on|object)_rez|remote_data|http_re(sponse|quest)|path_update|transaction_result)\\b"}]},s,i,{className:"type",begin:"\\b(integer|float|string|key|vector|quaternion|rotation|list)\\b"}]}}EOn.exports=Q2i});var xOn=re((Dlc,_On)=>{p();function U2i(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%{p();var G2i=["AASTriangle","AbelianGroup","Abort","AbortKernels","AbortProtect","AbortScheduledTask","Above","Abs","AbsArg","AbsArgPlot","Absolute","AbsoluteCorrelation","AbsoluteCorrelationFunction","AbsoluteCurrentValue","AbsoluteDashing","AbsoluteFileName","AbsoluteOptions","AbsolutePointSize","AbsoluteThickness","AbsoluteTime","AbsoluteTiming","AcceptanceThreshold","AccountingForm","Accumulate","Accuracy","AccuracyGoal","ActionDelay","ActionMenu","ActionMenuBox","ActionMenuBoxOptions","Activate","Active","ActiveClassification","ActiveClassificationObject","ActiveItem","ActivePrediction","ActivePredictionObject","ActiveStyle","AcyclicGraphQ","AddOnHelpPath","AddSides","AddTo","AddToSearchIndex","AddUsers","AdjacencyGraph","AdjacencyList","AdjacencyMatrix","AdjacentMeshCells","AdjustmentBox","AdjustmentBoxOptions","AdjustTimeSeriesForecast","AdministrativeDivisionData","AffineHalfSpace","AffineSpace","AffineStateSpaceModel","AffineTransform","After","AggregatedEntityClass","AggregationLayer","AircraftData","AirportData","AirPressureData","AirTemperatureData","AiryAi","AiryAiPrime","AiryAiZero","AiryBi","AiryBiPrime","AiryBiZero","AlgebraicIntegerQ","AlgebraicNumber","AlgebraicNumberDenominator","AlgebraicNumberNorm","AlgebraicNumberPolynomial","AlgebraicNumberTrace","AlgebraicRules","AlgebraicRulesData","Algebraics","AlgebraicUnitQ","Alignment","AlignmentMarker","AlignmentPoint","All","AllowAdultContent","AllowedCloudExtraParameters","AllowedCloudParameterExtensions","AllowedDimensions","AllowedFrequencyRange","AllowedHeads","AllowGroupClose","AllowIncomplete","AllowInlineCells","AllowKernelInitialization","AllowLooseGrammar","AllowReverseGroupClose","AllowScriptLevelChange","AllowVersionUpdate","AllTrue","Alphabet","AlphabeticOrder","AlphabeticSort","AlphaChannel","AlternateImage","AlternatingFactorial","AlternatingGroup","AlternativeHypothesis","Alternatives","AltitudeMethod","AmbientLight","AmbiguityFunction","AmbiguityList","Analytic","AnatomyData","AnatomyForm","AnatomyPlot3D","AnatomySkinStyle","AnatomyStyling","AnchoredSearch","And","AndersonDarlingTest","AngerJ","AngleBisector","AngleBracket","AnglePath","AnglePath3D","AngleVector","AngularGauge","Animate","AnimationCycleOffset","AnimationCycleRepetitions","AnimationDirection","AnimationDisplayTime","AnimationRate","AnimationRepetitions","AnimationRunning","AnimationRunTime","AnimationTimeIndex","Animator","AnimatorBox","AnimatorBoxOptions","AnimatorElements","Annotate","Annotation","AnnotationDelete","AnnotationKeys","AnnotationRules","AnnotationValue","Annuity","AnnuityDue","Annulus","AnomalyDetection","AnomalyDetector","AnomalyDetectorFunction","Anonymous","Antialiasing","AntihermitianMatrixQ","Antisymmetric","AntisymmetricMatrixQ","Antonyms","AnyOrder","AnySubset","AnyTrue","Apart","ApartSquareFree","APIFunction","Appearance","AppearanceElements","AppearanceRules","AppellF1","Append","AppendCheck","AppendLayer","AppendTo","Apply","ApplySides","ArcCos","ArcCosh","ArcCot","ArcCoth","ArcCsc","ArcCsch","ArcCurvature","ARCHProcess","ArcLength","ArcSec","ArcSech","ArcSin","ArcSinDistribution","ArcSinh","ArcTan","ArcTanh","Area","Arg","ArgMax","ArgMin","ArgumentCountQ","ARIMAProcess","ArithmeticGeometricMean","ARMAProcess","Around","AroundReplace","ARProcess","Array","ArrayComponents","ArrayDepth","ArrayFilter","ArrayFlatten","ArrayMesh","ArrayPad","ArrayPlot","ArrayQ","ArrayResample","ArrayReshape","ArrayRules","Arrays","Arrow","Arrow3DBox","ArrowBox","Arrowheads","ASATriangle","Ask","AskAppend","AskConfirm","AskDisplay","AskedQ","AskedValue","AskFunction","AskState","AskTemplateDisplay","AspectRatio","AspectRatioFixed","Assert","AssociateTo","Association","AssociationFormat","AssociationMap","AssociationQ","AssociationThread","AssumeDeterministic","Assuming","Assumptions","AstronomicalData","Asymptotic","AsymptoticDSolveValue","AsymptoticEqual","AsymptoticEquivalent","AsymptoticGreater","AsymptoticGreaterEqual","AsymptoticIntegrate","AsymptoticLess","AsymptoticLessEqual","AsymptoticOutputTracker","AsymptoticProduct","AsymptoticRSolveValue","AsymptoticSolve","AsymptoticSum","Asynchronous","AsynchronousTaskObject","AsynchronousTasks","Atom","AtomCoordinates","AtomCount","AtomDiagramCoordinates","AtomList","AtomQ","AttentionLayer","Attributes","Audio","AudioAmplify","AudioAnnotate","AudioAnnotationLookup","AudioBlockMap","AudioCapture","AudioChannelAssignment","AudioChannelCombine","AudioChannelMix","AudioChannels","AudioChannelSeparate","AudioData","AudioDelay","AudioDelete","AudioDevice","AudioDistance","AudioEncoding","AudioFade","AudioFrequencyShift","AudioGenerator","AudioIdentify","AudioInputDevice","AudioInsert","AudioInstanceQ","AudioIntervals","AudioJoin","AudioLabel","AudioLength","AudioLocalMeasurements","AudioLooping","AudioLoudness","AudioMeasurements","AudioNormalize","AudioOutputDevice","AudioOverlay","AudioPad","AudioPan","AudioPartition","AudioPause","AudioPitchShift","AudioPlay","AudioPlot","AudioQ","AudioRecord","AudioReplace","AudioResample","AudioReverb","AudioReverse","AudioSampleRate","AudioSpectralMap","AudioSpectralTransformation","AudioSplit","AudioStop","AudioStream","AudioStreams","AudioTimeStretch","AudioTracks","AudioTrim","AudioType","AugmentedPolyhedron","AugmentedSymmetricPolynomial","Authenticate","Authentication","AuthenticationDialog","AutoAction","Autocomplete","AutocompletionFunction","AutoCopy","AutocorrelationTest","AutoDelete","AutoEvaluateEvents","AutoGeneratedPackage","AutoIndent","AutoIndentSpacings","AutoItalicWords","AutoloadPath","AutoMatch","Automatic","AutomaticImageSize","AutoMultiplicationSymbol","AutoNumberFormatting","AutoOpenNotebooks","AutoOpenPalettes","AutoQuoteCharacters","AutoRefreshed","AutoRemove","AutorunSequencing","AutoScaling","AutoScroll","AutoSpacing","AutoStyleOptions","AutoStyleWords","AutoSubmitting","Axes","AxesEdge","AxesLabel","AxesOrigin","AxesStyle","AxiomaticTheory","Axis","BabyMonsterGroupB","Back","Background","BackgroundAppearance","BackgroundTasksSettings","Backslash","Backsubstitution","Backward","Ball","Band","BandpassFilter","BandstopFilter","BarabasiAlbertGraphDistribution","BarChart","BarChart3D","BarcodeImage","BarcodeRecognize","BaringhausHenzeTest","BarLegend","BarlowProschanImportance","BarnesG","BarOrigin","BarSpacing","BartlettHannWindow","BartlettWindow","BaseDecode","BaseEncode","BaseForm","Baseline","BaselinePosition","BaseStyle","BasicRecurrentLayer","BatchNormalizationLayer","BatchSize","BatesDistribution","BattleLemarieWavelet","BayesianMaximization","BayesianMaximizationObject","BayesianMinimization","BayesianMinimizationObject","Because","BeckmannDistribution","Beep","Before","Begin","BeginDialogPacket","BeginFrontEndInteractionPacket","BeginPackage","BellB","BellY","Below","BenfordDistribution","BeniniDistribution","BenktanderGibratDistribution","BenktanderWeibullDistribution","BernoulliB","BernoulliDistribution","BernoulliGraphDistribution","BernoulliProcess","BernsteinBasis","BesselFilterModel","BesselI","BesselJ","BesselJZero","BesselK","BesselY","BesselYZero","Beta","BetaBinomialDistribution","BetaDistribution","BetaNegativeBinomialDistribution","BetaPrimeDistribution","BetaRegularized","Between","BetweennessCentrality","BeveledPolyhedron","BezierCurve","BezierCurve3DBox","BezierCurve3DBoxOptions","BezierCurveBox","BezierCurveBoxOptions","BezierFunction","BilateralFilter","Binarize","BinaryDeserialize","BinaryDistance","BinaryFormat","BinaryImageQ","BinaryRead","BinaryReadList","BinarySerialize","BinaryWrite","BinCounts","BinLists","Binomial","BinomialDistribution","BinomialProcess","BinormalDistribution","BiorthogonalSplineWavelet","BipartiteGraphQ","BiquadraticFilterModel","BirnbaumImportance","BirnbaumSaundersDistribution","BitAnd","BitClear","BitGet","BitLength","BitNot","BitOr","BitSet","BitShiftLeft","BitShiftRight","BitXor","BiweightLocation","BiweightMidvariance","Black","BlackmanHarrisWindow","BlackmanNuttallWindow","BlackmanWindow","Blank","BlankForm","BlankNullSequence","BlankSequence","Blend","Block","BlockchainAddressData","BlockchainBase","BlockchainBlockData","BlockchainContractValue","BlockchainData","BlockchainGet","BlockchainKeyEncode","BlockchainPut","BlockchainTokenData","BlockchainTransaction","BlockchainTransactionData","BlockchainTransactionSign","BlockchainTransactionSubmit","BlockMap","BlockRandom","BlomqvistBeta","BlomqvistBetaTest","Blue","Blur","BodePlot","BohmanWindow","Bold","Bond","BondCount","BondList","BondQ","Bookmarks","Boole","BooleanConsecutiveFunction","BooleanConvert","BooleanCountingFunction","BooleanFunction","BooleanGraph","BooleanMaxterms","BooleanMinimize","BooleanMinterms","BooleanQ","BooleanRegion","Booleans","BooleanStrings","BooleanTable","BooleanVariables","BorderDimensions","BorelTannerDistribution","Bottom","BottomHatTransform","BoundaryDiscretizeGraphics","BoundaryDiscretizeRegion","BoundaryMesh","BoundaryMeshRegion","BoundaryMeshRegionQ","BoundaryStyle","BoundedRegionQ","BoundingRegion","Bounds","Box","BoxBaselineShift","BoxData","BoxDimensions","Boxed","Boxes","BoxForm","BoxFormFormatTypes","BoxFrame","BoxID","BoxMargins","BoxMatrix","BoxObject","BoxRatios","BoxRotation","BoxRotationPoint","BoxStyle","BoxWhiskerChart","Bra","BracketingBar","BraKet","BrayCurtisDistance","BreadthFirstScan","Break","BridgeData","BrightnessEqualize","BroadcastStationData","Brown","BrownForsytheTest","BrownianBridgeProcess","BrowserCategory","BSplineBasis","BSplineCurve","BSplineCurve3DBox","BSplineCurve3DBoxOptions","BSplineCurveBox","BSplineCurveBoxOptions","BSplineFunction","BSplineSurface","BSplineSurface3DBox","BSplineSurface3DBoxOptions","BubbleChart","BubbleChart3D","BubbleScale","BubbleSizes","BuildingData","BulletGauge","BusinessDayQ","ButterflyGraph","ButterworthFilterModel","Button","ButtonBar","ButtonBox","ButtonBoxOptions","ButtonCell","ButtonContents","ButtonData","ButtonEvaluator","ButtonExpandable","ButtonFrame","ButtonFunction","ButtonMargins","ButtonMinHeight","ButtonNote","ButtonNotebook","ButtonSource","ButtonStyle","ButtonStyleMenuListing","Byte","ByteArray","ByteArrayFormat","ByteArrayQ","ByteArrayToString","ByteCount","ByteOrdering","C","CachedValue","CacheGraphics","CachePersistence","CalendarConvert","CalendarData","CalendarType","Callout","CalloutMarker","CalloutStyle","CallPacket","CanberraDistance","Cancel","CancelButton","CandlestickChart","CanonicalGraph","CanonicalizePolygon","CanonicalizePolyhedron","CanonicalName","CanonicalWarpingCorrespondence","CanonicalWarpingDistance","CantorMesh","CantorStaircase","Cap","CapForm","CapitalDifferentialD","Capitalize","CapsuleShape","CaptureRunning","CardinalBSplineBasis","CarlemanLinearize","CarmichaelLambda","CaseOrdering","Cases","CaseSensitive","Cashflow","Casoratian","Catalan","CatalanNumber","Catch","CategoricalDistribution","Catenate","CatenateLayer","CauchyDistribution","CauchyWindow","CayleyGraph","CDF","CDFDeploy","CDFInformation","CDFWavelet","Ceiling","CelestialSystem","Cell","CellAutoOverwrite","CellBaseline","CellBoundingBox","CellBracketOptions","CellChangeTimes","CellContents","CellContext","CellDingbat","CellDynamicExpression","CellEditDuplicate","CellElementsBoundingBox","CellElementSpacings","CellEpilog","CellEvaluationDuplicate","CellEvaluationFunction","CellEvaluationLanguage","CellEventActions","CellFrame","CellFrameColor","CellFrameLabelMargins","CellFrameLabels","CellFrameMargins","CellGroup","CellGroupData","CellGrouping","CellGroupingRules","CellHorizontalScrolling","CellID","CellLabel","CellLabelAutoDelete","CellLabelMargins","CellLabelPositioning","CellLabelStyle","CellLabelTemplate","CellMargins","CellObject","CellOpen","CellPrint","CellProlog","Cells","CellSize","CellStyle","CellTags","CellularAutomaton","CensoredDistribution","Censoring","Center","CenterArray","CenterDot","CentralFeature","CentralMoment","CentralMomentGeneratingFunction","Cepstrogram","CepstrogramArray","CepstrumArray","CForm","ChampernowneNumber","ChangeOptions","ChannelBase","ChannelBrokerAction","ChannelDatabin","ChannelHistoryLength","ChannelListen","ChannelListener","ChannelListeners","ChannelListenerWait","ChannelObject","ChannelPreSendFunction","ChannelReceiverFunction","ChannelSend","ChannelSubscribers","ChanVeseBinarize","Character","CharacterCounts","CharacterEncoding","CharacterEncodingsPath","CharacteristicFunction","CharacteristicPolynomial","CharacterName","CharacterNormalize","CharacterRange","Characters","ChartBaseStyle","ChartElementData","ChartElementDataFunction","ChartElementFunction","ChartElements","ChartLabels","ChartLayout","ChartLegends","ChartStyle","Chebyshev1FilterModel","Chebyshev2FilterModel","ChebyshevDistance","ChebyshevT","ChebyshevU","Check","CheckAbort","CheckAll","Checkbox","CheckboxBar","CheckboxBox","CheckboxBoxOptions","ChemicalData","ChessboardDistance","ChiDistribution","ChineseRemainder","ChiSquareDistribution","ChoiceButtons","ChoiceDialog","CholeskyDecomposition","Chop","ChromaticityPlot","ChromaticityPlot3D","ChromaticPolynomial","Circle","CircleBox","CircleDot","CircleMinus","CirclePlus","CirclePoints","CircleThrough","CircleTimes","CirculantGraph","CircularOrthogonalMatrixDistribution","CircularQuaternionMatrixDistribution","CircularRealMatrixDistribution","CircularSymplecticMatrixDistribution","CircularUnitaryMatrixDistribution","Circumsphere","CityData","ClassifierFunction","ClassifierInformation","ClassifierMeasurements","ClassifierMeasurementsObject","Classify","ClassPriors","Clear","ClearAll","ClearAttributes","ClearCookies","ClearPermissions","ClearSystemCache","ClebschGordan","ClickPane","Clip","ClipboardNotebook","ClipFill","ClippingStyle","ClipPlanes","ClipPlanesStyle","ClipRange","Clock","ClockGauge","ClockwiseContourIntegral","Close","Closed","CloseKernels","ClosenessCentrality","Closing","ClosingAutoSave","ClosingEvent","ClosingSaveDialog","CloudAccountData","CloudBase","CloudConnect","CloudConnections","CloudDeploy","CloudDirectory","CloudDisconnect","CloudEvaluate","CloudExport","CloudExpression","CloudExpressions","CloudFunction","CloudGet","CloudImport","CloudLoggingData","CloudObject","CloudObjectInformation","CloudObjectInformationData","CloudObjectNameFormat","CloudObjects","CloudObjectURLType","CloudPublish","CloudPut","CloudRenderingMethod","CloudSave","CloudShare","CloudSubmit","CloudSymbol","CloudUnshare","CloudUserID","ClusterClassify","ClusterDissimilarityFunction","ClusteringComponents","ClusteringTree","CMYKColor","Coarse","CodeAssistOptions","Coefficient","CoefficientArrays","CoefficientDomain","CoefficientList","CoefficientRules","CoifletWavelet","Collect","Colon","ColonForm","ColorBalance","ColorCombine","ColorConvert","ColorCoverage","ColorData","ColorDataFunction","ColorDetect","ColorDistance","ColorFunction","ColorFunctionScaling","Colorize","ColorNegate","ColorOutput","ColorProfileData","ColorQ","ColorQuantize","ColorReplace","ColorRules","ColorSelectorSettings","ColorSeparate","ColorSetter","ColorSetterBox","ColorSetterBoxOptions","ColorSlider","ColorsNear","ColorSpace","ColorToneMapping","Column","ColumnAlignments","ColumnBackgrounds","ColumnForm","ColumnLines","ColumnsEqual","ColumnSpacings","ColumnWidths","CombinedEntityClass","CombinerFunction","CometData","CommonDefaultFormatTypes","Commonest","CommonestFilter","CommonName","CommonUnits","CommunityBoundaryStyle","CommunityGraphPlot","CommunityLabels","CommunityRegionStyle","CompanyData","CompatibleUnitQ","CompilationOptions","CompilationTarget","Compile","Compiled","CompiledCodeFunction","CompiledFunction","CompilerOptions","Complement","ComplementedEntityClass","CompleteGraph","CompleteGraphQ","CompleteKaryTree","CompletionsListPacket","Complex","ComplexContourPlot","Complexes","ComplexExpand","ComplexInfinity","ComplexityFunction","ComplexListPlot","ComplexPlot","ComplexPlot3D","ComplexRegionPlot","ComplexStreamPlot","ComplexVectorPlot","ComponentMeasurements","ComponentwiseContextMenu","Compose","ComposeList","ComposeSeries","CompositeQ","Composition","CompoundElement","CompoundExpression","CompoundPoissonDistribution","CompoundPoissonProcess","CompoundRenewalProcess","Compress","CompressedData","CompressionLevel","ComputeUncertainty","Condition","ConditionalExpression","Conditioned","Cone","ConeBox","ConfidenceLevel","ConfidenceRange","ConfidenceTransform","ConfigurationPath","ConformAudio","ConformImages","Congruent","ConicHullRegion","ConicHullRegion3DBox","ConicHullRegionBox","ConicOptimization","Conjugate","ConjugateTranspose","Conjunction","Connect","ConnectedComponents","ConnectedGraphComponents","ConnectedGraphQ","ConnectedMeshComponents","ConnectedMoleculeComponents","ConnectedMoleculeQ","ConnectionSettings","ConnectLibraryCallbackFunction","ConnectSystemModelComponents","ConnesWindow","ConoverTest","ConsoleMessage","ConsoleMessagePacket","Constant","ConstantArray","ConstantArrayLayer","ConstantImage","ConstantPlusLayer","ConstantRegionQ","Constants","ConstantTimesLayer","ConstellationData","ConstrainedMax","ConstrainedMin","Construct","Containing","ContainsAll","ContainsAny","ContainsExactly","ContainsNone","ContainsOnly","ContentFieldOptions","ContentLocationFunction","ContentObject","ContentPadding","ContentsBoundingBox","ContentSelectable","ContentSize","Context","ContextMenu","Contexts","ContextToFileName","Continuation","Continue","ContinuedFraction","ContinuedFractionK","ContinuousAction","ContinuousMarkovProcess","ContinuousTask","ContinuousTimeModelQ","ContinuousWaveletData","ContinuousWaveletTransform","ContourDetect","ContourGraphics","ContourIntegral","ContourLabels","ContourLines","ContourPlot","ContourPlot3D","Contours","ContourShading","ContourSmoothing","ContourStyle","ContraharmonicMean","ContrastiveLossLayer","Control","ControlActive","ControlAlignment","ControlGroupContentsBox","ControllabilityGramian","ControllabilityMatrix","ControllableDecomposition","ControllableModelQ","ControllerDuration","ControllerInformation","ControllerInformationData","ControllerLinking","ControllerManipulate","ControllerMethod","ControllerPath","ControllerState","ControlPlacement","ControlsRendering","ControlType","Convergents","ConversionOptions","ConversionRules","ConvertToBitmapPacket","ConvertToPostScript","ConvertToPostScriptPacket","ConvexHullMesh","ConvexPolygonQ","ConvexPolyhedronQ","ConvolutionLayer","Convolve","ConwayGroupCo1","ConwayGroupCo2","ConwayGroupCo3","CookieFunction","Cookies","CoordinateBoundingBox","CoordinateBoundingBoxArray","CoordinateBounds","CoordinateBoundsArray","CoordinateChartData","CoordinatesToolOptions","CoordinateTransform","CoordinateTransformData","CoprimeQ","Coproduct","CopulaDistribution","Copyable","CopyDatabin","CopyDirectory","CopyFile","CopyTag","CopyToClipboard","CornerFilter","CornerNeighbors","Correlation","CorrelationDistance","CorrelationFunction","CorrelationTest","Cos","Cosh","CoshIntegral","CosineDistance","CosineWindow","CosIntegral","Cot","Coth","Count","CountDistinct","CountDistinctBy","CounterAssignments","CounterBox","CounterBoxOptions","CounterClockwiseContourIntegral","CounterEvaluator","CounterFunction","CounterIncrements","CounterStyle","CounterStyleMenuListing","CountRoots","CountryData","Counts","CountsBy","Covariance","CovarianceEstimatorFunction","CovarianceFunction","CoxianDistribution","CoxIngersollRossProcess","CoxModel","CoxModelFit","CramerVonMisesTest","CreateArchive","CreateCellID","CreateChannel","CreateCloudExpression","CreateDatabin","CreateDataStructure","CreateDataSystemModel","CreateDialog","CreateDirectory","CreateDocument","CreateFile","CreateIntermediateDirectories","CreateManagedLibraryExpression","CreateNotebook","CreatePacletArchive","CreatePalette","CreatePalettePacket","CreatePermissionsGroup","CreateScheduledTask","CreateSearchIndex","CreateSystemModel","CreateTemporary","CreateUUID","CreateWindow","CriterionFunction","CriticalityFailureImportance","CriticalitySuccessImportance","CriticalSection","Cross","CrossEntropyLossLayer","CrossingCount","CrossingDetect","CrossingPolygon","CrossMatrix","Csc","Csch","CTCLossLayer","Cube","CubeRoot","Cubics","Cuboid","CuboidBox","Cumulant","CumulantGeneratingFunction","Cup","CupCap","Curl","CurlyDoubleQuote","CurlyQuote","CurrencyConvert","CurrentDate","CurrentImage","CurrentlySpeakingPacket","CurrentNotebookImage","CurrentScreenImage","CurrentValue","Curry","CurryApplied","CurvatureFlowFilter","CurveClosed","Cyan","CycleGraph","CycleIndexPolynomial","Cycles","CyclicGroup","Cyclotomic","Cylinder","CylinderBox","CylindricalDecomposition","D","DagumDistribution","DamData","DamerauLevenshteinDistance","DampingFactor","Darker","Dashed","Dashing","DatabaseConnect","DatabaseDisconnect","DatabaseReference","Databin","DatabinAdd","DatabinRemove","Databins","DatabinUpload","DataCompression","DataDistribution","DataRange","DataReversed","Dataset","DatasetDisplayPanel","DataStructure","DataStructureQ","Date","DateBounds","Dated","DateDelimiters","DateDifference","DatedUnit","DateFormat","DateFunction","DateHistogram","DateInterval","DateList","DateListLogPlot","DateListPlot","DateListStepPlot","DateObject","DateObjectQ","DateOverlapsQ","DatePattern","DatePlus","DateRange","DateReduction","DateString","DateTicksFormat","DateValue","DateWithinQ","DaubechiesWavelet","DavisDistribution","DawsonF","DayCount","DayCountConvention","DayHemisphere","DaylightQ","DayMatchQ","DayName","DayNightTerminator","DayPlus","DayRange","DayRound","DeBruijnGraph","DeBruijnSequence","Debug","DebugTag","Decapitalize","Decimal","DecimalForm","DeclareKnownSymbols","DeclarePackage","Decompose","DeconvolutionLayer","Decrement","Decrypt","DecryptFile","DedekindEta","DeepSpaceProbeData","Default","DefaultAxesStyle","DefaultBaseStyle","DefaultBoxStyle","DefaultButton","DefaultColor","DefaultControlPlacement","DefaultDuplicateCellStyle","DefaultDuration","DefaultElement","DefaultFaceGridsStyle","DefaultFieldHintStyle","DefaultFont","DefaultFontProperties","DefaultFormatType","DefaultFormatTypeForStyle","DefaultFrameStyle","DefaultFrameTicksStyle","DefaultGridLinesStyle","DefaultInlineFormatType","DefaultInputFormatType","DefaultLabelStyle","DefaultMenuStyle","DefaultNaturalLanguage","DefaultNewCellStyle","DefaultNewInlineCellStyle","DefaultNotebook","DefaultOptions","DefaultOutputFormatType","DefaultPrintPrecision","DefaultStyle","DefaultStyleDefinitions","DefaultTextFormatType","DefaultTextInlineFormatType","DefaultTicksStyle","DefaultTooltipStyle","DefaultValue","DefaultValues","Defer","DefineExternal","DefineInputStreamMethod","DefineOutputStreamMethod","DefineResourceFunction","Definition","Degree","DegreeCentrality","DegreeGraphDistribution","DegreeLexicographic","DegreeReverseLexicographic","DEigensystem","DEigenvalues","Deinitialization","Del","DelaunayMesh","Delayed","Deletable","Delete","DeleteAnomalies","DeleteBorderComponents","DeleteCases","DeleteChannel","DeleteCloudExpression","DeleteContents","DeleteDirectory","DeleteDuplicates","DeleteDuplicatesBy","DeleteFile","DeleteMissing","DeleteObject","DeletePermissionsKey","DeleteSearchIndex","DeleteSmallComponents","DeleteStopwords","DeleteWithContents","DeletionWarning","DelimitedArray","DelimitedSequence","Delimiter","DelimiterFlashTime","DelimiterMatching","Delimiters","DeliveryFunction","Dendrogram","Denominator","DensityGraphics","DensityHistogram","DensityPlot","DensityPlot3D","DependentVariables","Deploy","Deployed","Depth","DepthFirstScan","Derivative","DerivativeFilter","DerivedKey","DescriptorStateSpace","DesignMatrix","DestroyAfterEvaluation","Det","DeviceClose","DeviceConfigure","DeviceExecute","DeviceExecuteAsynchronous","DeviceObject","DeviceOpen","DeviceOpenQ","DeviceRead","DeviceReadBuffer","DeviceReadLatest","DeviceReadList","DeviceReadTimeSeries","Devices","DeviceStreams","DeviceWrite","DeviceWriteBuffer","DGaussianWavelet","DiacriticalPositioning","Diagonal","DiagonalizableMatrixQ","DiagonalMatrix","DiagonalMatrixQ","Dialog","DialogIndent","DialogInput","DialogLevel","DialogNotebook","DialogProlog","DialogReturn","DialogSymbols","Diamond","DiamondMatrix","DiceDissimilarity","DictionaryLookup","DictionaryWordQ","DifferenceDelta","DifferenceOrder","DifferenceQuotient","DifferenceRoot","DifferenceRootReduce","Differences","DifferentialD","DifferentialRoot","DifferentialRootReduce","DifferentiatorFilter","DigitalSignature","DigitBlock","DigitBlockMinimum","DigitCharacter","DigitCount","DigitQ","DihedralAngle","DihedralGroup","Dilation","DimensionalCombinations","DimensionalMeshComponents","DimensionReduce","DimensionReducerFunction","DimensionReduction","Dimensions","DiracComb","DiracDelta","DirectedEdge","DirectedEdges","DirectedGraph","DirectedGraphQ","DirectedInfinity","Direction","Directive","Directory","DirectoryName","DirectoryQ","DirectoryStack","DirichletBeta","DirichletCharacter","DirichletCondition","DirichletConvolve","DirichletDistribution","DirichletEta","DirichletL","DirichletLambda","DirichletTransform","DirichletWindow","DisableConsolePrintPacket","DisableFormatting","DiscreteAsymptotic","DiscreteChirpZTransform","DiscreteConvolve","DiscreteDelta","DiscreteHadamardTransform","DiscreteIndicator","DiscreteLimit","DiscreteLQEstimatorGains","DiscreteLQRegulatorGains","DiscreteLyapunovSolve","DiscreteMarkovProcess","DiscreteMaxLimit","DiscreteMinLimit","DiscretePlot","DiscretePlot3D","DiscreteRatio","DiscreteRiccatiSolve","DiscreteShift","DiscreteTimeModelQ","DiscreteUniformDistribution","DiscreteVariables","DiscreteWaveletData","DiscreteWaveletPacketTransform","DiscreteWaveletTransform","DiscretizeGraphics","DiscretizeRegion","Discriminant","DisjointQ","Disjunction","Disk","DiskBox","DiskMatrix","DiskSegment","Dispatch","DispatchQ","DispersionEstimatorFunction","Display","DisplayAllSteps","DisplayEndPacket","DisplayFlushImagePacket","DisplayForm","DisplayFunction","DisplayPacket","DisplayRules","DisplaySetSizePacket","DisplayString","DisplayTemporary","DisplayWith","DisplayWithRef","DisplayWithVariable","DistanceFunction","DistanceMatrix","DistanceTransform","Distribute","Distributed","DistributedContexts","DistributeDefinitions","DistributionChart","DistributionDomain","DistributionFitTest","DistributionParameterAssumptions","DistributionParameterQ","Dithering","Div","Divergence","Divide","DivideBy","Dividers","DivideSides","Divisible","Divisors","DivisorSigma","DivisorSum","DMSList","DMSString","Do","DockedCells","DocumentGenerator","DocumentGeneratorInformation","DocumentGeneratorInformationData","DocumentGenerators","DocumentNotebook","DocumentWeightingRules","Dodecahedron","DomainRegistrationInformation","DominantColors","DOSTextFormat","Dot","DotDashed","DotEqual","DotLayer","DotPlusLayer","Dotted","DoubleBracketingBar","DoubleContourIntegral","DoubleDownArrow","DoubleLeftArrow","DoubleLeftRightArrow","DoubleLeftTee","DoubleLongLeftArrow","DoubleLongLeftRightArrow","DoubleLongRightArrow","DoubleRightArrow","DoubleRightTee","DoubleUpArrow","DoubleUpDownArrow","DoubleVerticalBar","DoublyInfinite","Down","DownArrow","DownArrowBar","DownArrowUpArrow","DownLeftRightVector","DownLeftTeeVector","DownLeftVector","DownLeftVectorBar","DownRightTeeVector","DownRightVector","DownRightVectorBar","Downsample","DownTee","DownTeeArrow","DownValues","DragAndDrop","DrawEdges","DrawFrontFaces","DrawHighlighted","Drop","DropoutLayer","DSolve","DSolveValue","Dt","DualLinearProgramming","DualPolyhedron","DualSystemsModel","DumpGet","DumpSave","DuplicateFreeQ","Duration","Dynamic","DynamicBox","DynamicBoxOptions","DynamicEvaluationTimeout","DynamicGeoGraphics","DynamicImage","DynamicLocation","DynamicModule","DynamicModuleBox","DynamicModuleBoxOptions","DynamicModuleParent","DynamicModuleValues","DynamicName","DynamicNamespace","DynamicReference","DynamicSetting","DynamicUpdating","DynamicWrapper","DynamicWrapperBox","DynamicWrapperBoxOptions","E","EarthImpactData","EarthquakeData","EccentricityCentrality","Echo","EchoFunction","EclipseType","EdgeAdd","EdgeBetweennessCentrality","EdgeCapacity","EdgeCapForm","EdgeColor","EdgeConnectivity","EdgeContract","EdgeCost","EdgeCount","EdgeCoverQ","EdgeCycleMatrix","EdgeDashing","EdgeDelete","EdgeDetect","EdgeForm","EdgeIndex","EdgeJoinForm","EdgeLabeling","EdgeLabels","EdgeLabelStyle","EdgeList","EdgeOpacity","EdgeQ","EdgeRenderingFunction","EdgeRules","EdgeShapeFunction","EdgeStyle","EdgeTaggedGraph","EdgeTaggedGraphQ","EdgeTags","EdgeThickness","EdgeWeight","EdgeWeightedGraphQ","Editable","EditButtonSettings","EditCellTagsSettings","EditDistance","EffectiveInterest","Eigensystem","Eigenvalues","EigenvectorCentrality","Eigenvectors","Element","ElementData","ElementwiseLayer","ElidedForms","Eliminate","EliminationOrder","Ellipsoid","EllipticE","EllipticExp","EllipticExpPrime","EllipticF","EllipticFilterModel","EllipticK","EllipticLog","EllipticNomeQ","EllipticPi","EllipticReducedHalfPeriods","EllipticTheta","EllipticThetaPrime","EmbedCode","EmbeddedHTML","EmbeddedService","EmbeddingLayer","EmbeddingObject","EmitSound","EmphasizeSyntaxErrors","EmpiricalDistribution","Empty","EmptyGraphQ","EmptyRegion","EnableConsolePrintPacket","Enabled","Encode","Encrypt","EncryptedObject","EncryptFile","End","EndAdd","EndDialogPacket","EndFrontEndInteractionPacket","EndOfBuffer","EndOfFile","EndOfLine","EndOfString","EndPackage","EngineEnvironment","EngineeringForm","Enter","EnterExpressionPacket","EnterTextPacket","Entity","EntityClass","EntityClassList","EntityCopies","EntityFunction","EntityGroup","EntityInstance","EntityList","EntityPrefetch","EntityProperties","EntityProperty","EntityPropertyClass","EntityRegister","EntityStore","EntityStores","EntityTypeName","EntityUnregister","EntityValue","Entropy","EntropyFilter","Environment","Epilog","EpilogFunction","Equal","EqualColumns","EqualRows","EqualTilde","EqualTo","EquatedTo","Equilibrium","EquirippleFilterKernel","Equivalent","Erf","Erfc","Erfi","ErlangB","ErlangC","ErlangDistribution","Erosion","ErrorBox","ErrorBoxOptions","ErrorNorm","ErrorPacket","ErrorsDialogSettings","EscapeRadius","EstimatedBackground","EstimatedDistribution","EstimatedProcess","EstimatorGains","EstimatorRegulator","EuclideanDistance","EulerAngles","EulerCharacteristic","EulerE","EulerGamma","EulerianGraphQ","EulerMatrix","EulerPhi","Evaluatable","Evaluate","Evaluated","EvaluatePacket","EvaluateScheduledTask","EvaluationBox","EvaluationCell","EvaluationCompletionAction","EvaluationData","EvaluationElements","EvaluationEnvironment","EvaluationMode","EvaluationMonitor","EvaluationNotebook","EvaluationObject","EvaluationOrder","Evaluator","EvaluatorNames","EvenQ","EventData","EventEvaluator","EventHandler","EventHandlerTag","EventLabels","EventSeries","ExactBlackmanWindow","ExactNumberQ","ExactRootIsolation","ExampleData","Except","ExcludedForms","ExcludedLines","ExcludedPhysicalQuantities","ExcludePods","Exclusions","ExclusionsStyle","Exists","Exit","ExitDialog","ExoplanetData","Exp","Expand","ExpandAll","ExpandDenominator","ExpandFileName","ExpandNumerator","Expectation","ExpectationE","ExpectedValue","ExpGammaDistribution","ExpIntegralE","ExpIntegralEi","ExpirationDate","Exponent","ExponentFunction","ExponentialDistribution","ExponentialFamily","ExponentialGeneratingFunction","ExponentialMovingAverage","ExponentialPowerDistribution","ExponentPosition","ExponentStep","Export","ExportAutoReplacements","ExportByteArray","ExportForm","ExportPacket","ExportString","Expression","ExpressionCell","ExpressionGraph","ExpressionPacket","ExpressionUUID","ExpToTrig","ExtendedEntityClass","ExtendedGCD","Extension","ExtentElementFunction","ExtentMarkers","ExtentSize","ExternalBundle","ExternalCall","ExternalDataCharacterEncoding","ExternalEvaluate","ExternalFunction","ExternalFunctionName","ExternalIdentifier","ExternalObject","ExternalOptions","ExternalSessionObject","ExternalSessions","ExternalStorageBase","ExternalStorageDownload","ExternalStorageGet","ExternalStorageObject","ExternalStoragePut","ExternalStorageUpload","ExternalTypeSignature","ExternalValue","Extract","ExtractArchive","ExtractLayer","ExtractPacletArchive","ExtremeValueDistribution","FaceAlign","FaceForm","FaceGrids","FaceGridsStyle","FacialFeatures","Factor","FactorComplete","Factorial","Factorial2","FactorialMoment","FactorialMomentGeneratingFunction","FactorialPower","FactorInteger","FactorList","FactorSquareFree","FactorSquareFreeList","FactorTerms","FactorTermsList","Fail","Failure","FailureAction","FailureDistribution","FailureQ","False","FareySequence","FARIMAProcess","FeatureDistance","FeatureExtract","FeatureExtraction","FeatureExtractor","FeatureExtractorFunction","FeatureNames","FeatureNearest","FeatureSpacePlot","FeatureSpacePlot3D","FeatureTypes","FEDisableConsolePrintPacket","FeedbackLinearize","FeedbackSector","FeedbackSectorStyle","FeedbackType","FEEnableConsolePrintPacket","FetalGrowthData","Fibonacci","Fibonorial","FieldCompletionFunction","FieldHint","FieldHintStyle","FieldMasked","FieldSize","File","FileBaseName","FileByteCount","FileConvert","FileDate","FileExistsQ","FileExtension","FileFormat","FileHandler","FileHash","FileInformation","FileName","FileNameDepth","FileNameDialogSettings","FileNameDrop","FileNameForms","FileNameJoin","FileNames","FileNameSetter","FileNameSplit","FileNameTake","FilePrint","FileSize","FileSystemMap","FileSystemScan","FileTemplate","FileTemplateApply","FileType","FilledCurve","FilledCurveBox","FilledCurveBoxOptions","Filling","FillingStyle","FillingTransform","FilteredEntityClass","FilterRules","FinancialBond","FinancialData","FinancialDerivative","FinancialIndicator","Find","FindAnomalies","FindArgMax","FindArgMin","FindChannels","FindClique","FindClusters","FindCookies","FindCurvePath","FindCycle","FindDevices","FindDistribution","FindDistributionParameters","FindDivisions","FindEdgeCover","FindEdgeCut","FindEdgeIndependentPaths","FindEquationalProof","FindEulerianCycle","FindExternalEvaluators","FindFaces","FindFile","FindFit","FindFormula","FindFundamentalCycles","FindGeneratingFunction","FindGeoLocation","FindGeometricConjectures","FindGeometricTransform","FindGraphCommunities","FindGraphIsomorphism","FindGraphPartition","FindHamiltonianCycle","FindHamiltonianPath","FindHiddenMarkovStates","FindImageText","FindIndependentEdgeSet","FindIndependentVertexSet","FindInstance","FindIntegerNullVector","FindKClan","FindKClique","FindKClub","FindKPlex","FindLibrary","FindLinearRecurrence","FindList","FindMatchingColor","FindMaximum","FindMaximumCut","FindMaximumFlow","FindMaxValue","FindMeshDefects","FindMinimum","FindMinimumCostFlow","FindMinimumCut","FindMinValue","FindMoleculeSubstructure","FindPath","FindPeaks","FindPermutation","FindPostmanTour","FindProcessParameters","FindRepeat","FindRoot","FindSequenceFunction","FindSettings","FindShortestPath","FindShortestTour","FindSpanningTree","FindSystemModelEquilibrium","FindTextualAnswer","FindThreshold","FindTransientRepeat","FindVertexCover","FindVertexCut","FindVertexIndependentPaths","Fine","FinishDynamic","FiniteAbelianGroupCount","FiniteGroupCount","FiniteGroupData","First","FirstCase","FirstPassageTimeDistribution","FirstPosition","FischerGroupFi22","FischerGroupFi23","FischerGroupFi24Prime","FisherHypergeometricDistribution","FisherRatioTest","FisherZDistribution","Fit","FitAll","FitRegularization","FittedModel","FixedOrder","FixedPoint","FixedPointList","FlashSelection","Flat","Flatten","FlattenAt","FlattenLayer","FlatTopWindow","FlipView","Floor","FlowPolynomial","FlushPrintOutputPacket","Fold","FoldList","FoldPair","FoldPairList","FollowRedirects","Font","FontColor","FontFamily","FontForm","FontName","FontOpacity","FontPostScriptName","FontProperties","FontReencoding","FontSize","FontSlant","FontSubstitutions","FontTracking","FontVariations","FontWeight","For","ForAll","ForceVersionInstall","Format","FormatRules","FormatType","FormatTypeAutoConvert","FormatValues","FormBox","FormBoxOptions","FormControl","FormFunction","FormLayoutFunction","FormObject","FormPage","FormTheme","FormulaData","FormulaLookup","FortranForm","Forward","ForwardBackward","Fourier","FourierCoefficient","FourierCosCoefficient","FourierCosSeries","FourierCosTransform","FourierDCT","FourierDCTFilter","FourierDCTMatrix","FourierDST","FourierDSTMatrix","FourierMatrix","FourierParameters","FourierSequenceTransform","FourierSeries","FourierSinCoefficient","FourierSinSeries","FourierSinTransform","FourierTransform","FourierTrigSeries","FractionalBrownianMotionProcess","FractionalGaussianNoiseProcess","FractionalPart","FractionBox","FractionBoxOptions","FractionLine","Frame","FrameBox","FrameBoxOptions","Framed","FrameInset","FrameLabel","Frameless","FrameMargins","FrameRate","FrameStyle","FrameTicks","FrameTicksStyle","FRatioDistribution","FrechetDistribution","FreeQ","FrenetSerretSystem","FrequencySamplingFilterKernel","FresnelC","FresnelF","FresnelG","FresnelS","Friday","FrobeniusNumber","FrobeniusSolve","FromAbsoluteTime","FromCharacterCode","FromCoefficientRules","FromContinuedFraction","FromDate","FromDigits","FromDMS","FromEntity","FromJulianDate","FromLetterNumber","FromPolarCoordinates","FromRomanNumeral","FromSphericalCoordinates","FromUnixTime","Front","FrontEndDynamicExpression","FrontEndEventActions","FrontEndExecute","FrontEndObject","FrontEndResource","FrontEndResourceString","FrontEndStackSize","FrontEndToken","FrontEndTokenExecute","FrontEndValueCache","FrontEndVersion","FrontFaceColor","FrontFaceOpacity","Full","FullAxes","FullDefinition","FullForm","FullGraphics","FullInformationOutputRegulator","FullOptions","FullRegion","FullSimplify","Function","FunctionCompile","FunctionCompileExport","FunctionCompileExportByteArray","FunctionCompileExportLibrary","FunctionCompileExportString","FunctionDomain","FunctionExpand","FunctionInterpolation","FunctionPeriod","FunctionRange","FunctionSpace","FussellVeselyImportance","GaborFilter","GaborMatrix","GaborWavelet","GainMargins","GainPhaseMargins","GalaxyData","GalleryView","Gamma","GammaDistribution","GammaRegularized","GapPenalty","GARCHProcess","GatedRecurrentLayer","Gather","GatherBy","GaugeFaceElementFunction","GaugeFaceStyle","GaugeFrameElementFunction","GaugeFrameSize","GaugeFrameStyle","GaugeLabels","GaugeMarkers","GaugeStyle","GaussianFilter","GaussianIntegers","GaussianMatrix","GaussianOrthogonalMatrixDistribution","GaussianSymplecticMatrixDistribution","GaussianUnitaryMatrixDistribution","GaussianWindow","GCD","GegenbauerC","General","GeneralizedLinearModelFit","GenerateAsymmetricKeyPair","GenerateConditions","GeneratedCell","GeneratedDocumentBinding","GenerateDerivedKey","GenerateDigitalSignature","GenerateDocument","GeneratedParameters","GeneratedQuantityMagnitudes","GenerateFileSignature","GenerateHTTPResponse","GenerateSecuredAuthenticationKey","GenerateSymmetricKey","GeneratingFunction","GeneratorDescription","GeneratorHistoryLength","GeneratorOutputType","Generic","GenericCylindricalDecomposition","GenomeData","GenomeLookup","GeoAntipode","GeoArea","GeoArraySize","GeoBackground","GeoBoundingBox","GeoBounds","GeoBoundsRegion","GeoBubbleChart","GeoCenter","GeoCircle","GeoContourPlot","GeoDensityPlot","GeodesicClosing","GeodesicDilation","GeodesicErosion","GeodesicOpening","GeoDestination","GeodesyData","GeoDirection","GeoDisk","GeoDisplacement","GeoDistance","GeoDistanceList","GeoElevationData","GeoEntities","GeoGraphics","GeogravityModelData","GeoGridDirectionDifference","GeoGridLines","GeoGridLinesStyle","GeoGridPosition","GeoGridRange","GeoGridRangePadding","GeoGridUnitArea","GeoGridUnitDistance","GeoGridVector","GeoGroup","GeoHemisphere","GeoHemisphereBoundary","GeoHistogram","GeoIdentify","GeoImage","GeoLabels","GeoLength","GeoListPlot","GeoLocation","GeologicalPeriodData","GeomagneticModelData","GeoMarker","GeometricAssertion","GeometricBrownianMotionProcess","GeometricDistribution","GeometricMean","GeometricMeanFilter","GeometricOptimization","GeometricScene","GeometricTransformation","GeometricTransformation3DBox","GeometricTransformation3DBoxOptions","GeometricTransformationBox","GeometricTransformationBoxOptions","GeoModel","GeoNearest","GeoPath","GeoPosition","GeoPositionENU","GeoPositionXYZ","GeoProjection","GeoProjectionData","GeoRange","GeoRangePadding","GeoRegionValuePlot","GeoResolution","GeoScaleBar","GeoServer","GeoSmoothHistogram","GeoStreamPlot","GeoStyling","GeoStylingImageFunction","GeoVariant","GeoVector","GeoVectorENU","GeoVectorPlot","GeoVectorXYZ","GeoVisibleRegion","GeoVisibleRegionBoundary","GeoWithinQ","GeoZoomLevel","GestureHandler","GestureHandlerTag","Get","GetBoundingBoxSizePacket","GetContext","GetEnvironment","GetFileName","GetFrontEndOptionsDataPacket","GetLinebreakInformationPacket","GetMenusPacket","GetPageBreakInformationPacket","Glaisher","GlobalClusteringCoefficient","GlobalPreferences","GlobalSession","Glow","GoldenAngle","GoldenRatio","GompertzMakehamDistribution","GoochShading","GoodmanKruskalGamma","GoodmanKruskalGammaTest","Goto","Grad","Gradient","GradientFilter","GradientOrientationFilter","GrammarApply","GrammarRules","GrammarToken","Graph","Graph3D","GraphAssortativity","GraphAutomorphismGroup","GraphCenter","GraphComplement","GraphData","GraphDensity","GraphDiameter","GraphDifference","GraphDisjointUnion","GraphDistance","GraphDistanceMatrix","GraphElementData","GraphEmbedding","GraphHighlight","GraphHighlightStyle","GraphHub","Graphics","Graphics3D","Graphics3DBox","Graphics3DBoxOptions","GraphicsArray","GraphicsBaseline","GraphicsBox","GraphicsBoxOptions","GraphicsColor","GraphicsColumn","GraphicsComplex","GraphicsComplex3DBox","GraphicsComplex3DBoxOptions","GraphicsComplexBox","GraphicsComplexBoxOptions","GraphicsContents","GraphicsData","GraphicsGrid","GraphicsGridBox","GraphicsGroup","GraphicsGroup3DBox","GraphicsGroup3DBoxOptions","GraphicsGroupBox","GraphicsGroupBoxOptions","GraphicsGrouping","GraphicsHighlightColor","GraphicsRow","GraphicsSpacing","GraphicsStyle","GraphIntersection","GraphLayout","GraphLinkEfficiency","GraphPeriphery","GraphPlot","GraphPlot3D","GraphPower","GraphPropertyDistribution","GraphQ","GraphRadius","GraphReciprocity","GraphRoot","GraphStyle","GraphUnion","Gray","GrayLevel","Greater","GreaterEqual","GreaterEqualLess","GreaterEqualThan","GreaterFullEqual","GreaterGreater","GreaterLess","GreaterSlantEqual","GreaterThan","GreaterTilde","Green","GreenFunction","Grid","GridBaseline","GridBox","GridBoxAlignment","GridBoxBackground","GridBoxDividers","GridBoxFrame","GridBoxItemSize","GridBoxItemStyle","GridBoxOptions","GridBoxSpacings","GridCreationSettings","GridDefaultElement","GridElementStyleOptions","GridFrame","GridFrameMargins","GridGraph","GridLines","GridLinesStyle","GroebnerBasis","GroupActionBase","GroupBy","GroupCentralizer","GroupElementFromWord","GroupElementPosition","GroupElementQ","GroupElements","GroupElementToWord","GroupGenerators","Groupings","GroupMultiplicationTable","GroupOrbits","GroupOrder","GroupPageBreakWithin","GroupSetwiseStabilizer","GroupStabilizer","GroupStabilizerChain","GroupTogetherGrouping","GroupTogetherNestedGrouping","GrowCutComponents","Gudermannian","GuidedFilter","GumbelDistribution","HaarWavelet","HadamardMatrix","HalfLine","HalfNormalDistribution","HalfPlane","HalfSpace","HalftoneShading","HamiltonianGraphQ","HammingDistance","HammingWindow","HandlerFunctions","HandlerFunctionsKeys","HankelH1","HankelH2","HankelMatrix","HankelTransform","HannPoissonWindow","HannWindow","HaradaNortonGroupHN","HararyGraph","HarmonicMean","HarmonicMeanFilter","HarmonicNumber","Hash","HatchFilling","HatchShading","Haversine","HazardFunction","Head","HeadCompose","HeaderAlignment","HeaderBackground","HeaderDisplayFunction","HeaderLines","HeaderSize","HeaderStyle","Heads","HeavisideLambda","HeavisidePi","HeavisideTheta","HeldGroupHe","HeldPart","HelpBrowserLookup","HelpBrowserNotebook","HelpBrowserSettings","Here","HermiteDecomposition","HermiteH","HermitianMatrixQ","HessenbergDecomposition","Hessian","HeunB","HeunBPrime","HeunC","HeunCPrime","HeunD","HeunDPrime","HeunG","HeunGPrime","HeunT","HeunTPrime","HexadecimalCharacter","Hexahedron","HexahedronBox","HexahedronBoxOptions","HiddenItems","HiddenMarkovProcess","HiddenSurface","Highlighted","HighlightGraph","HighlightImage","HighlightMesh","HighpassFilter","HigmanSimsGroupHS","HilbertCurve","HilbertFilter","HilbertMatrix","Histogram","Histogram3D","HistogramDistribution","HistogramList","HistogramTransform","HistogramTransformInterpolation","HistoricalPeriodData","HitMissTransform","HITSCentrality","HjorthDistribution","HodgeDual","HoeffdingD","HoeffdingDTest","Hold","HoldAll","HoldAllComplete","HoldComplete","HoldFirst","HoldForm","HoldPattern","HoldRest","HolidayCalendar","HomeDirectory","HomePage","Horizontal","HorizontalForm","HorizontalGauge","HorizontalScrollPosition","HornerForm","HostLookup","HotellingTSquareDistribution","HoytDistribution","HTMLSave","HTTPErrorResponse","HTTPRedirect","HTTPRequest","HTTPRequestData","HTTPResponse","Hue","HumanGrowthData","HumpDownHump","HumpEqual","HurwitzLerchPhi","HurwitzZeta","HyperbolicDistribution","HypercubeGraph","HyperexponentialDistribution","Hyperfactorial","Hypergeometric0F1","Hypergeometric0F1Regularized","Hypergeometric1F1","Hypergeometric1F1Regularized","Hypergeometric2F1","Hypergeometric2F1Regularized","HypergeometricDistribution","HypergeometricPFQ","HypergeometricPFQRegularized","HypergeometricU","Hyperlink","HyperlinkAction","HyperlinkCreationSettings","Hyperplane","Hyphenation","HyphenationOptions","HypoexponentialDistribution","HypothesisTestData","I","IconData","Iconize","IconizedObject","IconRules","Icosahedron","Identity","IdentityMatrix","If","IgnoreCase","IgnoreDiacritics","IgnorePunctuation","IgnoreSpellCheck","IgnoringInactive","Im","Image","Image3D","Image3DProjection","Image3DSlices","ImageAccumulate","ImageAdd","ImageAdjust","ImageAlign","ImageApply","ImageApplyIndexed","ImageAspectRatio","ImageAssemble","ImageAugmentationLayer","ImageBoundingBoxes","ImageCache","ImageCacheValid","ImageCapture","ImageCaptureFunction","ImageCases","ImageChannels","ImageClip","ImageCollage","ImageColorSpace","ImageCompose","ImageContainsQ","ImageContents","ImageConvolve","ImageCooccurrence","ImageCorners","ImageCorrelate","ImageCorrespondingPoints","ImageCrop","ImageData","ImageDeconvolve","ImageDemosaic","ImageDifference","ImageDimensions","ImageDisplacements","ImageDistance","ImageEffect","ImageExposureCombine","ImageFeatureTrack","ImageFileApply","ImageFileFilter","ImageFileScan","ImageFilter","ImageFocusCombine","ImageForestingComponents","ImageFormattingWidth","ImageForwardTransformation","ImageGraphics","ImageHistogram","ImageIdentify","ImageInstanceQ","ImageKeypoints","ImageLabels","ImageLegends","ImageLevels","ImageLines","ImageMargins","ImageMarker","ImageMarkers","ImageMeasurements","ImageMesh","ImageMultiply","ImageOffset","ImagePad","ImagePadding","ImagePartition","ImagePeriodogram","ImagePerspectiveTransformation","ImagePosition","ImagePreviewFunction","ImagePyramid","ImagePyramidApply","ImageQ","ImageRangeCache","ImageRecolor","ImageReflect","ImageRegion","ImageResize","ImageResolution","ImageRestyle","ImageRotate","ImageRotated","ImageSaliencyFilter","ImageScaled","ImageScan","ImageSize","ImageSizeAction","ImageSizeCache","ImageSizeMultipliers","ImageSizeRaw","ImageSubtract","ImageTake","ImageTransformation","ImageTrim","ImageType","ImageValue","ImageValuePositions","ImagingDevice","ImplicitRegion","Implies","Import","ImportAutoReplacements","ImportByteArray","ImportOptions","ImportString","ImprovementImportance","In","Inactivate","Inactive","IncidenceGraph","IncidenceList","IncidenceMatrix","IncludeAromaticBonds","IncludeConstantBasis","IncludeDefinitions","IncludeDirectories","IncludeFileExtension","IncludeGeneratorTasks","IncludeHydrogens","IncludeInflections","IncludeMetaInformation","IncludePods","IncludeQuantities","IncludeRelatedTables","IncludeSingularTerm","IncludeWindowTimes","Increment","IndefiniteMatrixQ","Indent","IndentingNewlineSpacings","IndentMaxFraction","IndependenceTest","IndependentEdgeSetQ","IndependentPhysicalQuantity","IndependentUnit","IndependentUnitDimension","IndependentVertexSetQ","Indeterminate","IndeterminateThreshold","IndexCreationOptions","Indexed","IndexEdgeTaggedGraph","IndexGraph","IndexTag","Inequality","InexactNumberQ","InexactNumbers","InfiniteFuture","InfiniteLine","InfinitePast","InfinitePlane","Infinity","Infix","InflationAdjust","InflationMethod","Information","InformationData","InformationDataGrid","Inherited","InheritScope","InhomogeneousPoissonProcess","InitialEvaluationHistory","Initialization","InitializationCell","InitializationCellEvaluation","InitializationCellWarning","InitializationObjects","InitializationValue","Initialize","InitialSeeding","InlineCounterAssignments","InlineCounterIncrements","InlineRules","Inner","InnerPolygon","InnerPolyhedron","Inpaint","Input","InputAliases","InputAssumptions","InputAutoReplacements","InputField","InputFieldBox","InputFieldBoxOptions","InputForm","InputGrouping","InputNamePacket","InputNotebook","InputPacket","InputSettings","InputStream","InputString","InputStringPacket","InputToBoxFormPacket","Insert","InsertionFunction","InsertionPointObject","InsertLinebreaks","InsertResults","Inset","Inset3DBox","Inset3DBoxOptions","InsetBox","InsetBoxOptions","Insphere","Install","InstallService","InstanceNormalizationLayer","InString","Integer","IntegerDigits","IntegerExponent","IntegerLength","IntegerName","IntegerPart","IntegerPartitions","IntegerQ","IntegerReverse","Integers","IntegerString","Integral","Integrate","Interactive","InteractiveTradingChart","Interlaced","Interleaving","InternallyBalancedDecomposition","InterpolatingFunction","InterpolatingPolynomial","Interpolation","InterpolationOrder","InterpolationPoints","InterpolationPrecision","Interpretation","InterpretationBox","InterpretationBoxOptions","InterpretationFunction","Interpreter","InterpretTemplate","InterquartileRange","Interrupt","InterruptSettings","IntersectedEntityClass","IntersectingQ","Intersection","Interval","IntervalIntersection","IntervalMarkers","IntervalMarkersStyle","IntervalMemberQ","IntervalSlider","IntervalUnion","Into","Inverse","InverseBetaRegularized","InverseCDF","InverseChiSquareDistribution","InverseContinuousWaveletTransform","InverseDistanceTransform","InverseEllipticNomeQ","InverseErf","InverseErfc","InverseFourier","InverseFourierCosTransform","InverseFourierSequenceTransform","InverseFourierSinTransform","InverseFourierTransform","InverseFunction","InverseFunctions","InverseGammaDistribution","InverseGammaRegularized","InverseGaussianDistribution","InverseGudermannian","InverseHankelTransform","InverseHaversine","InverseImagePyramid","InverseJacobiCD","InverseJacobiCN","InverseJacobiCS","InverseJacobiDC","InverseJacobiDN","InverseJacobiDS","InverseJacobiNC","InverseJacobiND","InverseJacobiNS","InverseJacobiSC","InverseJacobiSD","InverseJacobiSN","InverseLaplaceTransform","InverseMellinTransform","InversePermutation","InverseRadon","InverseRadonTransform","InverseSeries","InverseShortTimeFourier","InverseSpectrogram","InverseSurvivalFunction","InverseTransformedRegion","InverseWaveletTransform","InverseWeierstrassP","InverseWishartMatrixDistribution","InverseZTransform","Invisible","InvisibleApplication","InvisibleTimes","IPAddress","IrreduciblePolynomialQ","IslandData","IsolatingInterval","IsomorphicGraphQ","IsotopeData","Italic","Item","ItemAspectRatio","ItemBox","ItemBoxOptions","ItemDisplayFunction","ItemSize","ItemStyle","ItoProcess","JaccardDissimilarity","JacobiAmplitude","Jacobian","JacobiCD","JacobiCN","JacobiCS","JacobiDC","JacobiDN","JacobiDS","JacobiNC","JacobiND","JacobiNS","JacobiP","JacobiSC","JacobiSD","JacobiSN","JacobiSymbol","JacobiZeta","JankoGroupJ1","JankoGroupJ2","JankoGroupJ3","JankoGroupJ4","JarqueBeraALMTest","JohnsonDistribution","Join","JoinAcross","Joined","JoinedCurve","JoinedCurveBox","JoinedCurveBoxOptions","JoinForm","JordanDecomposition","JordanModelDecomposition","JulianDate","JuliaSetBoettcher","JuliaSetIterationCount","JuliaSetPlot","JuliaSetPoints","K","KagiChart","KaiserBesselWindow","KaiserWindow","KalmanEstimator","KalmanFilter","KarhunenLoeveDecomposition","KaryTree","KatzCentrality","KCoreComponents","KDistribution","KEdgeConnectedComponents","KEdgeConnectedGraphQ","KeepExistingVersion","KelvinBei","KelvinBer","KelvinKei","KelvinKer","KendallTau","KendallTauTest","KernelExecute","KernelFunction","KernelMixtureDistribution","KernelObject","Kernels","Ket","Key","KeyCollisionFunction","KeyComplement","KeyDrop","KeyDropFrom","KeyExistsQ","KeyFreeQ","KeyIntersection","KeyMap","KeyMemberQ","KeypointStrength","Keys","KeySelect","KeySort","KeySortBy","KeyTake","KeyUnion","KeyValueMap","KeyValuePattern","Khinchin","KillProcess","KirchhoffGraph","KirchhoffMatrix","KleinInvariantJ","KnapsackSolve","KnightTourGraph","KnotData","KnownUnitQ","KochCurve","KolmogorovSmirnovTest","KroneckerDelta","KroneckerModelDecomposition","KroneckerProduct","KroneckerSymbol","KuiperTest","KumaraswamyDistribution","Kurtosis","KuwaharaFilter","KVertexConnectedComponents","KVertexConnectedGraphQ","LABColor","Label","Labeled","LabeledSlider","LabelingFunction","LabelingSize","LabelStyle","LabelVisibility","LaguerreL","LakeData","LambdaComponents","LambertW","LaminaData","LanczosWindow","LandauDistribution","Language","LanguageCategory","LanguageData","LanguageIdentify","LanguageOptions","LaplaceDistribution","LaplaceTransform","Laplacian","LaplacianFilter","LaplacianGaussianFilter","Large","Larger","Last","Latitude","LatitudeLongitude","LatticeData","LatticeReduce","Launch","LaunchKernels","LayeredGraphPlot","LayerSizeFunction","LayoutInformation","LCHColor","LCM","LeaderSize","LeafCount","LeapYearQ","LearnDistribution","LearnedDistribution","LearningRate","LearningRateMultipliers","LeastSquares","LeastSquaresFilterKernel","Left","LeftArrow","LeftArrowBar","LeftArrowRightArrow","LeftDownTeeVector","LeftDownVector","LeftDownVectorBar","LeftRightArrow","LeftRightVector","LeftTee","LeftTeeArrow","LeftTeeVector","LeftTriangle","LeftTriangleBar","LeftTriangleEqual","LeftUpDownVector","LeftUpTeeVector","LeftUpVector","LeftUpVectorBar","LeftVector","LeftVectorBar","LegendAppearance","Legended","LegendFunction","LegendLabel","LegendLayout","LegendMargins","LegendMarkers","LegendMarkerSize","LegendreP","LegendreQ","LegendreType","Length","LengthWhile","LerchPhi","Less","LessEqual","LessEqualGreater","LessEqualThan","LessFullEqual","LessGreater","LessLess","LessSlantEqual","LessThan","LessTilde","LetterCharacter","LetterCounts","LetterNumber","LetterQ","Level","LeveneTest","LeviCivitaTensor","LevyDistribution","Lexicographic","LibraryDataType","LibraryFunction","LibraryFunctionError","LibraryFunctionInformation","LibraryFunctionLoad","LibraryFunctionUnload","LibraryLoad","LibraryUnload","LicenseID","LiftingFilterData","LiftingWaveletTransform","LightBlue","LightBrown","LightCyan","Lighter","LightGray","LightGreen","Lighting","LightingAngle","LightMagenta","LightOrange","LightPink","LightPurple","LightRed","LightSources","LightYellow","Likelihood","Limit","LimitsPositioning","LimitsPositioningTokens","LindleyDistribution","Line","Line3DBox","Line3DBoxOptions","LinearFilter","LinearFractionalOptimization","LinearFractionalTransform","LinearGradientImage","LinearizingTransformationData","LinearLayer","LinearModelFit","LinearOffsetFunction","LinearOptimization","LinearProgramming","LinearRecurrence","LinearSolve","LinearSolveFunction","LineBox","LineBoxOptions","LineBreak","LinebreakAdjustments","LineBreakChart","LinebreakSemicolonWeighting","LineBreakWithin","LineColor","LineGraph","LineIndent","LineIndentMaxFraction","LineIntegralConvolutionPlot","LineIntegralConvolutionScale","LineLegend","LineOpacity","LineSpacing","LineWrapParts","LinkActivate","LinkClose","LinkConnect","LinkConnectedQ","LinkCreate","LinkError","LinkFlush","LinkFunction","LinkHost","LinkInterrupt","LinkLaunch","LinkMode","LinkObject","LinkOpen","LinkOptions","LinkPatterns","LinkProtocol","LinkRankCentrality","LinkRead","LinkReadHeld","LinkReadyQ","Links","LinkService","LinkWrite","LinkWriteHeld","LiouvilleLambda","List","Listable","ListAnimate","ListContourPlot","ListContourPlot3D","ListConvolve","ListCorrelate","ListCurvePathPlot","ListDeconvolve","ListDensityPlot","ListDensityPlot3D","Listen","ListFormat","ListFourierSequenceTransform","ListInterpolation","ListLineIntegralConvolutionPlot","ListLinePlot","ListLogLinearPlot","ListLogLogPlot","ListLogPlot","ListPicker","ListPickerBox","ListPickerBoxBackground","ListPickerBoxOptions","ListPlay","ListPlot","ListPlot3D","ListPointPlot3D","ListPolarPlot","ListQ","ListSliceContourPlot3D","ListSliceDensityPlot3D","ListSliceVectorPlot3D","ListStepPlot","ListStreamDensityPlot","ListStreamPlot","ListSurfacePlot3D","ListVectorDensityPlot","ListVectorPlot","ListVectorPlot3D","ListZTransform","Literal","LiteralSearch","LocalAdaptiveBinarize","LocalCache","LocalClusteringCoefficient","LocalizeDefinitions","LocalizeVariables","LocalObject","LocalObjects","LocalResponseNormalizationLayer","LocalSubmit","LocalSymbol","LocalTime","LocalTimeZone","LocationEquivalenceTest","LocationTest","Locator","LocatorAutoCreate","LocatorBox","LocatorBoxOptions","LocatorCentering","LocatorPane","LocatorPaneBox","LocatorPaneBoxOptions","LocatorRegion","Locked","Log","Log10","Log2","LogBarnesG","LogGamma","LogGammaDistribution","LogicalExpand","LogIntegral","LogisticDistribution","LogisticSigmoid","LogitModelFit","LogLikelihood","LogLinearPlot","LogLogisticDistribution","LogLogPlot","LogMultinormalDistribution","LogNormalDistribution","LogPlot","LogRankTest","LogSeriesDistribution","LongEqual","Longest","LongestCommonSequence","LongestCommonSequencePositions","LongestCommonSubsequence","LongestCommonSubsequencePositions","LongestMatch","LongestOrderedSequence","LongForm","Longitude","LongLeftArrow","LongLeftRightArrow","LongRightArrow","LongShortTermMemoryLayer","Lookup","Loopback","LoopFreeGraphQ","Looping","LossFunction","LowerCaseQ","LowerLeftArrow","LowerRightArrow","LowerTriangularize","LowerTriangularMatrixQ","LowpassFilter","LQEstimatorGains","LQGRegulator","LQOutputRegulatorGains","LQRegulatorGains","LUBackSubstitution","LucasL","LuccioSamiComponents","LUDecomposition","LunarEclipse","LUVColor","LyapunovSolve","LyonsGroupLy","MachineID","MachineName","MachineNumberQ","MachinePrecision","MacintoshSystemPageSetup","Magenta","Magnification","Magnify","MailAddressValidation","MailExecute","MailFolder","MailItem","MailReceiverFunction","MailResponseFunction","MailSearch","MailServerConnect","MailServerConnection","MailSettings","MainSolve","MaintainDynamicCaches","Majority","MakeBoxes","MakeExpression","MakeRules","ManagedLibraryExpressionID","ManagedLibraryExpressionQ","MandelbrotSetBoettcher","MandelbrotSetDistance","MandelbrotSetIterationCount","MandelbrotSetMemberQ","MandelbrotSetPlot","MangoldtLambda","ManhattanDistance","Manipulate","Manipulator","MannedSpaceMissionData","MannWhitneyTest","MantissaExponent","Manual","Map","MapAll","MapAt","MapIndexed","MAProcess","MapThread","MarchenkoPasturDistribution","MarcumQ","MardiaCombinedTest","MardiaKurtosisTest","MardiaSkewnessTest","MarginalDistribution","MarkovProcessProperties","Masking","MatchingDissimilarity","MatchLocalNameQ","MatchLocalNames","MatchQ","Material","MathematicalFunctionData","MathematicaNotation","MathieuC","MathieuCharacteristicA","MathieuCharacteristicB","MathieuCharacteristicExponent","MathieuCPrime","MathieuGroupM11","MathieuGroupM12","MathieuGroupM22","MathieuGroupM23","MathieuGroupM24","MathieuS","MathieuSPrime","MathMLForm","MathMLText","Matrices","MatrixExp","MatrixForm","MatrixFunction","MatrixLog","MatrixNormalDistribution","MatrixPlot","MatrixPower","MatrixPropertyDistribution","MatrixQ","MatrixRank","MatrixTDistribution","Max","MaxBend","MaxCellMeasure","MaxColorDistance","MaxDate","MaxDetect","MaxDuration","MaxExtraBandwidths","MaxExtraConditions","MaxFeatureDisplacement","MaxFeatures","MaxFilter","MaximalBy","Maximize","MaxItems","MaxIterations","MaxLimit","MaxMemoryUsed","MaxMixtureKernels","MaxOverlapFraction","MaxPlotPoints","MaxPoints","MaxRecursion","MaxStableDistribution","MaxStepFraction","MaxSteps","MaxStepSize","MaxTrainingRounds","MaxValue","MaxwellDistribution","MaxWordGap","McLaughlinGroupMcL","Mean","MeanAbsoluteLossLayer","MeanAround","MeanClusteringCoefficient","MeanDegreeConnectivity","MeanDeviation","MeanFilter","MeanGraphDistance","MeanNeighborDegree","MeanShift","MeanShiftFilter","MeanSquaredLossLayer","Median","MedianDeviation","MedianFilter","MedicalTestData","Medium","MeijerG","MeijerGReduce","MeixnerDistribution","MellinConvolve","MellinTransform","MemberQ","MemoryAvailable","MemoryConstrained","MemoryConstraint","MemoryInUse","MengerMesh","Menu","MenuAppearance","MenuCommandKey","MenuEvaluator","MenuItem","MenuList","MenuPacket","MenuSortingValue","MenuStyle","MenuView","Merge","MergeDifferences","MergingFunction","MersennePrimeExponent","MersennePrimeExponentQ","Mesh","MeshCellCentroid","MeshCellCount","MeshCellHighlight","MeshCellIndex","MeshCellLabel","MeshCellMarker","MeshCellMeasure","MeshCellQuality","MeshCells","MeshCellShapeFunction","MeshCellStyle","MeshConnectivityGraph","MeshCoordinates","MeshFunctions","MeshPrimitives","MeshQualityGoal","MeshRange","MeshRefinementFunction","MeshRegion","MeshRegionQ","MeshShading","MeshStyle","Message","MessageDialog","MessageList","MessageName","MessageObject","MessageOptions","MessagePacket","Messages","MessagesNotebook","MetaCharacters","MetaInformation","MeteorShowerData","Method","MethodOptions","MexicanHatWavelet","MeyerWavelet","Midpoint","Min","MinColorDistance","MinDate","MinDetect","MineralData","MinFilter","MinimalBy","MinimalPolynomial","MinimalStateSpaceModel","Minimize","MinimumTimeIncrement","MinIntervalSize","MinkowskiQuestionMark","MinLimit","MinMax","MinorPlanetData","Minors","MinRecursion","MinSize","MinStableDistribution","Minus","MinusPlus","MinValue","Missing","MissingBehavior","MissingDataMethod","MissingDataRules","MissingQ","MissingString","MissingStyle","MissingValuePattern","MittagLefflerE","MixedFractionParts","MixedGraphQ","MixedMagnitude","MixedRadix","MixedRadixQuantity","MixedUnit","MixtureDistribution","Mod","Modal","Mode","Modular","ModularInverse","ModularLambda","Module","Modulus","MoebiusMu","Molecule","MoleculeContainsQ","MoleculeEquivalentQ","MoleculeGraph","MoleculeModify","MoleculePattern","MoleculePlot","MoleculePlot3D","MoleculeProperty","MoleculeQ","MoleculeRecognize","MoleculeValue","Moment","Momentary","MomentConvert","MomentEvaluate","MomentGeneratingFunction","MomentOfInertia","Monday","Monitor","MonomialList","MonomialOrder","MonsterGroupM","MoonPhase","MoonPosition","MorletWavelet","MorphologicalBinarize","MorphologicalBranchPoints","MorphologicalComponents","MorphologicalEulerNumber","MorphologicalGraph","MorphologicalPerimeter","MorphologicalTransform","MortalityData","Most","MountainData","MouseAnnotation","MouseAppearance","MouseAppearanceTag","MouseButtons","Mouseover","MousePointerNote","MousePosition","MovieData","MovingAverage","MovingMap","MovingMedian","MoyalDistribution","Multicolumn","MultiedgeStyle","MultigraphQ","MultilaunchWarning","MultiLetterItalics","MultiLetterStyle","MultilineFunction","Multinomial","MultinomialDistribution","MultinormalDistribution","MultiplicativeOrder","Multiplicity","MultiplySides","Multiselection","MultivariateHypergeometricDistribution","MultivariatePoissonDistribution","MultivariateTDistribution","N","NakagamiDistribution","NameQ","Names","NamespaceBox","NamespaceBoxOptions","Nand","NArgMax","NArgMin","NBernoulliB","NBodySimulation","NBodySimulationData","NCache","NDEigensystem","NDEigenvalues","NDSolve","NDSolveValue","Nearest","NearestFunction","NearestMeshCells","NearestNeighborGraph","NearestTo","NebulaData","NeedCurrentFrontEndPackagePacket","NeedCurrentFrontEndSymbolsPacket","NeedlemanWunschSimilarity","Needs","Negative","NegativeBinomialDistribution","NegativeDefiniteMatrixQ","NegativeIntegers","NegativeMultinomialDistribution","NegativeRationals","NegativeReals","NegativeSemidefiniteMatrixQ","NeighborhoodData","NeighborhoodGraph","Nest","NestedGreaterGreater","NestedLessLess","NestedScriptRules","NestGraph","NestList","NestWhile","NestWhileList","NetAppend","NetBidirectionalOperator","NetChain","NetDecoder","NetDelete","NetDrop","NetEncoder","NetEvaluationMode","NetExtract","NetFlatten","NetFoldOperator","NetGANOperator","NetGraph","NetInformation","NetInitialize","NetInsert","NetInsertSharedArrays","NetJoin","NetMapOperator","NetMapThreadOperator","NetMeasurements","NetModel","NetNestOperator","NetPairEmbeddingOperator","NetPort","NetPortGradient","NetPrepend","NetRename","NetReplace","NetReplacePart","NetSharedArray","NetStateObject","NetTake","NetTrain","NetTrainResultsObject","NetworkPacketCapture","NetworkPacketRecording","NetworkPacketRecordingDuring","NetworkPacketTrace","NeumannValue","NevilleThetaC","NevilleThetaD","NevilleThetaN","NevilleThetaS","NewPrimitiveStyle","NExpectation","Next","NextCell","NextDate","NextPrime","NextScheduledTaskTime","NHoldAll","NHoldFirst","NHoldRest","NicholsGridLines","NicholsPlot","NightHemisphere","NIntegrate","NMaximize","NMaxValue","NMinimize","NMinValue","NominalVariables","NonAssociative","NoncentralBetaDistribution","NoncentralChiSquareDistribution","NoncentralFRatioDistribution","NoncentralStudentTDistribution","NonCommutativeMultiply","NonConstants","NondimensionalizationTransform","None","NoneTrue","NonlinearModelFit","NonlinearStateSpaceModel","NonlocalMeansFilter","NonNegative","NonNegativeIntegers","NonNegativeRationals","NonNegativeReals","NonPositive","NonPositiveIntegers","NonPositiveRationals","NonPositiveReals","Nor","NorlundB","Norm","Normal","NormalDistribution","NormalGrouping","NormalizationLayer","Normalize","Normalized","NormalizedSquaredEuclideanDistance","NormalMatrixQ","NormalsFunction","NormFunction","Not","NotCongruent","NotCupCap","NotDoubleVerticalBar","Notebook","NotebookApply","NotebookAutoSave","NotebookClose","NotebookConvertSettings","NotebookCreate","NotebookCreateReturnObject","NotebookDefault","NotebookDelete","NotebookDirectory","NotebookDynamicExpression","NotebookEvaluate","NotebookEventActions","NotebookFileName","NotebookFind","NotebookFindReturnObject","NotebookGet","NotebookGetLayoutInformationPacket","NotebookGetMisspellingsPacket","NotebookImport","NotebookInformation","NotebookInterfaceObject","NotebookLocate","NotebookObject","NotebookOpen","NotebookOpenReturnObject","NotebookPath","NotebookPrint","NotebookPut","NotebookPutReturnObject","NotebookRead","NotebookResetGeneratedCells","Notebooks","NotebookSave","NotebookSaveAs","NotebookSelection","NotebookSetupLayoutInformationPacket","NotebooksMenu","NotebookTemplate","NotebookWrite","NotElement","NotEqualTilde","NotExists","NotGreater","NotGreaterEqual","NotGreaterFullEqual","NotGreaterGreater","NotGreaterLess","NotGreaterSlantEqual","NotGreaterTilde","Nothing","NotHumpDownHump","NotHumpEqual","NotificationFunction","NotLeftTriangle","NotLeftTriangleBar","NotLeftTriangleEqual","NotLess","NotLessEqual","NotLessFullEqual","NotLessGreater","NotLessLess","NotLessSlantEqual","NotLessTilde","NotNestedGreaterGreater","NotNestedLessLess","NotPrecedes","NotPrecedesEqual","NotPrecedesSlantEqual","NotPrecedesTilde","NotReverseElement","NotRightTriangle","NotRightTriangleBar","NotRightTriangleEqual","NotSquareSubset","NotSquareSubsetEqual","NotSquareSuperset","NotSquareSupersetEqual","NotSubset","NotSubsetEqual","NotSucceeds","NotSucceedsEqual","NotSucceedsSlantEqual","NotSucceedsTilde","NotSuperset","NotSupersetEqual","NotTilde","NotTildeEqual","NotTildeFullEqual","NotTildeTilde","NotVerticalBar","Now","NoWhitespace","NProbability","NProduct","NProductFactors","NRoots","NSolve","NSum","NSumTerms","NuclearExplosionData","NuclearReactorData","Null","NullRecords","NullSpace","NullWords","Number","NumberCompose","NumberDecompose","NumberExpand","NumberFieldClassNumber","NumberFieldDiscriminant","NumberFieldFundamentalUnits","NumberFieldIntegralBasis","NumberFieldNormRepresentatives","NumberFieldRegulator","NumberFieldRootsOfUnity","NumberFieldSignature","NumberForm","NumberFormat","NumberLinePlot","NumberMarks","NumberMultiplier","NumberPadding","NumberPoint","NumberQ","NumberSeparator","NumberSigns","NumberString","Numerator","NumeratorDenominator","NumericalOrder","NumericalSort","NumericArray","NumericArrayQ","NumericArrayType","NumericFunction","NumericQ","NuttallWindow","NValues","NyquistGridLines","NyquistPlot","O","ObservabilityGramian","ObservabilityMatrix","ObservableDecomposition","ObservableModelQ","OceanData","Octahedron","OddQ","Off","Offset","OLEData","On","ONanGroupON","Once","OneIdentity","Opacity","OpacityFunction","OpacityFunctionScaling","Open","OpenAppend","Opener","OpenerBox","OpenerBoxOptions","OpenerView","OpenFunctionInspectorPacket","Opening","OpenRead","OpenSpecialOptions","OpenTemporary","OpenWrite","Operate","OperatingSystem","OperatorApplied","OptimumFlowData","Optional","OptionalElement","OptionInspectorSettings","OptionQ","Options","OptionsPacket","OptionsPattern","OptionValue","OptionValueBox","OptionValueBoxOptions","Or","Orange","Order","OrderDistribution","OrderedQ","Ordering","OrderingBy","OrderingLayer","Orderless","OrderlessPatternSequence","OrnsteinUhlenbeckProcess","Orthogonalize","OrthogonalMatrixQ","Out","Outer","OuterPolygon","OuterPolyhedron","OutputAutoOverwrite","OutputControllabilityMatrix","OutputControllableModelQ","OutputForm","OutputFormData","OutputGrouping","OutputMathEditExpression","OutputNamePacket","OutputResponse","OutputSizeLimit","OutputStream","Over","OverBar","OverDot","Overflow","OverHat","Overlaps","Overlay","OverlayBox","OverlayBoxOptions","Overscript","OverscriptBox","OverscriptBoxOptions","OverTilde","OverVector","OverwriteTarget","OwenT","OwnValues","Package","PackingMethod","PackPaclet","PacletDataRebuild","PacletDirectoryAdd","PacletDirectoryLoad","PacletDirectoryRemove","PacletDirectoryUnload","PacletDisable","PacletEnable","PacletFind","PacletFindRemote","PacletInformation","PacletInstall","PacletInstallSubmit","PacletNewerQ","PacletObject","PacletObjectQ","PacletSite","PacletSiteObject","PacletSiteRegister","PacletSites","PacletSiteUnregister","PacletSiteUpdate","PacletUninstall","PacletUpdate","PaddedForm","Padding","PaddingLayer","PaddingSize","PadeApproximant","PadLeft","PadRight","PageBreakAbove","PageBreakBelow","PageBreakWithin","PageFooterLines","PageFooters","PageHeaderLines","PageHeaders","PageHeight","PageRankCentrality","PageTheme","PageWidth","Pagination","PairedBarChart","PairedHistogram","PairedSmoothHistogram","PairedTTest","PairedZTest","PaletteNotebook","PalettePath","PalindromeQ","Pane","PaneBox","PaneBoxOptions","Panel","PanelBox","PanelBoxOptions","Paneled","PaneSelector","PaneSelectorBox","PaneSelectorBoxOptions","PaperWidth","ParabolicCylinderD","ParagraphIndent","ParagraphSpacing","ParallelArray","ParallelCombine","ParallelDo","Parallelepiped","ParallelEvaluate","Parallelization","Parallelize","ParallelMap","ParallelNeeds","Parallelogram","ParallelProduct","ParallelSubmit","ParallelSum","ParallelTable","ParallelTry","Parameter","ParameterEstimator","ParameterMixtureDistribution","ParameterVariables","ParametricFunction","ParametricNDSolve","ParametricNDSolveValue","ParametricPlot","ParametricPlot3D","ParametricRampLayer","ParametricRegion","ParentBox","ParentCell","ParentConnect","ParentDirectory","ParentForm","Parenthesize","ParentList","ParentNotebook","ParetoDistribution","ParetoPickandsDistribution","ParkData","Part","PartBehavior","PartialCorrelationFunction","PartialD","ParticleAcceleratorData","ParticleData","Partition","PartitionGranularity","PartitionsP","PartitionsQ","PartLayer","PartOfSpeech","PartProtection","ParzenWindow","PascalDistribution","PassEventsDown","PassEventsUp","Paste","PasteAutoQuoteCharacters","PasteBoxFormInlineCells","PasteButton","Path","PathGraph","PathGraphQ","Pattern","PatternFilling","PatternSequence","PatternTest","PauliMatrix","PaulWavelet","Pause","PausedTime","PDF","PeakDetect","PeanoCurve","PearsonChiSquareTest","PearsonCorrelationTest","PearsonDistribution","PercentForm","PerfectNumber","PerfectNumberQ","PerformanceGoal","Perimeter","PeriodicBoundaryCondition","PeriodicInterpolation","Periodogram","PeriodogramArray","Permanent","Permissions","PermissionsGroup","PermissionsGroupMemberQ","PermissionsGroups","PermissionsKey","PermissionsKeys","PermutationCycles","PermutationCyclesQ","PermutationGroup","PermutationLength","PermutationList","PermutationListQ","PermutationMax","PermutationMin","PermutationOrder","PermutationPower","PermutationProduct","PermutationReplace","Permutations","PermutationSupport","Permute","PeronaMalikFilter","Perpendicular","PerpendicularBisector","PersistenceLocation","PersistenceTime","PersistentObject","PersistentObjects","PersistentValue","PersonData","PERTDistribution","PetersenGraph","PhaseMargins","PhaseRange","PhysicalSystemData","Pi","Pick","PIDData","PIDDerivativeFilter","PIDFeedforward","PIDTune","Piecewise","PiecewiseExpand","PieChart","PieChart3D","PillaiTrace","PillaiTraceTest","PingTime","Pink","PitchRecognize","Pivoting","PixelConstrained","PixelValue","PixelValuePositions","Placed","Placeholder","PlaceholderReplace","Plain","PlanarAngle","PlanarGraph","PlanarGraphQ","PlanckRadiationLaw","PlaneCurveData","PlanetaryMoonData","PlanetData","PlantData","Play","PlayRange","Plot","Plot3D","Plot3Matrix","PlotDivision","PlotJoined","PlotLabel","PlotLabels","PlotLayout","PlotLegends","PlotMarkers","PlotPoints","PlotRange","PlotRangeClipping","PlotRangeClipPlanesStyle","PlotRangePadding","PlotRegion","PlotStyle","PlotTheme","Pluralize","Plus","PlusMinus","Pochhammer","PodStates","PodWidth","Point","Point3DBox","Point3DBoxOptions","PointBox","PointBoxOptions","PointFigureChart","PointLegend","PointSize","PoissonConsulDistribution","PoissonDistribution","PoissonProcess","PoissonWindow","PolarAxes","PolarAxesOrigin","PolarGridLines","PolarPlot","PolarTicks","PoleZeroMarkers","PolyaAeppliDistribution","PolyGamma","Polygon","Polygon3DBox","Polygon3DBoxOptions","PolygonalNumber","PolygonAngle","PolygonBox","PolygonBoxOptions","PolygonCoordinates","PolygonDecomposition","PolygonHoleScale","PolygonIntersections","PolygonScale","Polyhedron","PolyhedronAngle","PolyhedronCoordinates","PolyhedronData","PolyhedronDecomposition","PolyhedronGenus","PolyLog","PolynomialExtendedGCD","PolynomialForm","PolynomialGCD","PolynomialLCM","PolynomialMod","PolynomialQ","PolynomialQuotient","PolynomialQuotientRemainder","PolynomialReduce","PolynomialRemainder","Polynomials","PoolingLayer","PopupMenu","PopupMenuBox","PopupMenuBoxOptions","PopupView","PopupWindow","Position","PositionIndex","Positive","PositiveDefiniteMatrixQ","PositiveIntegers","PositiveRationals","PositiveReals","PositiveSemidefiniteMatrixQ","PossibleZeroQ","Postfix","PostScript","Power","PowerDistribution","PowerExpand","PowerMod","PowerModList","PowerRange","PowerSpectralDensity","PowersRepresentations","PowerSymmetricPolynomial","Precedence","PrecedenceForm","Precedes","PrecedesEqual","PrecedesSlantEqual","PrecedesTilde","Precision","PrecisionGoal","PreDecrement","Predict","PredictionRoot","PredictorFunction","PredictorInformation","PredictorMeasurements","PredictorMeasurementsObject","PreemptProtect","PreferencesPath","Prefix","PreIncrement","Prepend","PrependLayer","PrependTo","PreprocessingRules","PreserveColor","PreserveImageOptions","Previous","PreviousCell","PreviousDate","PriceGraphDistribution","PrimaryPlaceholder","Prime","PrimeNu","PrimeOmega","PrimePi","PrimePowerQ","PrimeQ","Primes","PrimeZetaP","PrimitivePolynomialQ","PrimitiveRoot","PrimitiveRootList","PrincipalComponents","PrincipalValue","Print","PrintableASCIIQ","PrintAction","PrintForm","PrintingCopies","PrintingOptions","PrintingPageRange","PrintingStartingPageNumber","PrintingStyleEnvironment","Printout3D","Printout3DPreviewer","PrintPrecision","PrintTemporary","Prism","PrismBox","PrismBoxOptions","PrivateCellOptions","PrivateEvaluationOptions","PrivateFontOptions","PrivateFrontEndOptions","PrivateKey","PrivateNotebookOptions","PrivatePaths","Probability","ProbabilityDistribution","ProbabilityPlot","ProbabilityPr","ProbabilityScalePlot","ProbitModelFit","ProcessConnection","ProcessDirectory","ProcessEnvironment","Processes","ProcessEstimator","ProcessInformation","ProcessObject","ProcessParameterAssumptions","ProcessParameterQ","ProcessStateDomain","ProcessStatus","ProcessTimeDomain","Product","ProductDistribution","ProductLog","ProgressIndicator","ProgressIndicatorBox","ProgressIndicatorBoxOptions","Projection","Prolog","PromptForm","ProofObject","Properties","Property","PropertyList","PropertyValue","Proportion","Proportional","Protect","Protected","ProteinData","Pruning","PseudoInverse","PsychrometricPropertyData","PublicKey","PublisherID","PulsarData","PunctuationCharacter","Purple","Put","PutAppend","Pyramid","PyramidBox","PyramidBoxOptions","QBinomial","QFactorial","QGamma","QHypergeometricPFQ","QnDispersion","QPochhammer","QPolyGamma","QRDecomposition","QuadraticIrrationalQ","QuadraticOptimization","Quantile","QuantilePlot","Quantity","QuantityArray","QuantityDistribution","QuantityForm","QuantityMagnitude","QuantityQ","QuantityUnit","QuantityVariable","QuantityVariableCanonicalUnit","QuantityVariableDimensions","QuantityVariableIdentifier","QuantityVariablePhysicalQuantity","Quartics","QuartileDeviation","Quartiles","QuartileSkewness","Query","QueueingNetworkProcess","QueueingProcess","QueueProperties","Quiet","Quit","Quotient","QuotientRemainder","RadialGradientImage","RadialityCentrality","RadicalBox","RadicalBoxOptions","RadioButton","RadioButtonBar","RadioButtonBox","RadioButtonBoxOptions","Radon","RadonTransform","RamanujanTau","RamanujanTauL","RamanujanTauTheta","RamanujanTauZ","Ramp","Random","RandomChoice","RandomColor","RandomComplex","RandomEntity","RandomFunction","RandomGeoPosition","RandomGraph","RandomImage","RandomInstance","RandomInteger","RandomPermutation","RandomPoint","RandomPolygon","RandomPolyhedron","RandomPrime","RandomReal","RandomSample","RandomSeed","RandomSeeding","RandomVariate","RandomWalkProcess","RandomWord","Range","RangeFilter","RangeSpecification","RankedMax","RankedMin","RarerProbability","Raster","Raster3D","Raster3DBox","Raster3DBoxOptions","RasterArray","RasterBox","RasterBoxOptions","Rasterize","RasterSize","Rational","RationalFunctions","Rationalize","Rationals","Ratios","RawArray","RawBoxes","RawData","RawMedium","RayleighDistribution","Re","Read","ReadByteArray","ReadLine","ReadList","ReadProtected","ReadString","Real","RealAbs","RealBlockDiagonalForm","RealDigits","RealExponent","Reals","RealSign","Reap","RebuildPacletData","RecognitionPrior","RecognitionThreshold","Record","RecordLists","RecordSeparators","Rectangle","RectangleBox","RectangleBoxOptions","RectangleChart","RectangleChart3D","RectangularRepeatingElement","RecurrenceFilter","RecurrenceTable","RecurringDigitsForm","Red","Reduce","RefBox","ReferenceLineStyle","ReferenceMarkers","ReferenceMarkerStyle","Refine","ReflectionMatrix","ReflectionTransform","Refresh","RefreshRate","Region","RegionBinarize","RegionBoundary","RegionBoundaryStyle","RegionBounds","RegionCentroid","RegionDifference","RegionDimension","RegionDisjoint","RegionDistance","RegionDistanceFunction","RegionEmbeddingDimension","RegionEqual","RegionFillingStyle","RegionFunction","RegionImage","RegionIntersection","RegionMeasure","RegionMember","RegionMemberFunction","RegionMoment","RegionNearest","RegionNearestFunction","RegionPlot","RegionPlot3D","RegionProduct","RegionQ","RegionResize","RegionSize","RegionSymmetricDifference","RegionUnion","RegionWithin","RegisterExternalEvaluator","RegularExpression","Regularization","RegularlySampledQ","RegularPolygon","ReIm","ReImLabels","ReImPlot","ReImStyle","Reinstall","RelationalDatabase","RelationGraph","Release","ReleaseHold","ReliabilityDistribution","ReliefImage","ReliefPlot","RemoteAuthorizationCaching","RemoteConnect","RemoteConnectionObject","RemoteFile","RemoteRun","RemoteRunProcess","Remove","RemoveAlphaChannel","RemoveAsynchronousTask","RemoveAudioStream","RemoveBackground","RemoveChannelListener","RemoveChannelSubscribers","Removed","RemoveDiacritics","RemoveInputStreamMethod","RemoveOutputStreamMethod","RemoveProperty","RemoveScheduledTask","RemoveUsers","RemoveVideoStream","RenameDirectory","RenameFile","RenderAll","RenderingOptions","RenewalProcess","RenkoChart","RepairMesh","Repeated","RepeatedNull","RepeatedString","RepeatedTiming","RepeatingElement","Replace","ReplaceAll","ReplaceHeldPart","ReplaceImageValue","ReplaceList","ReplacePart","ReplacePixelValue","ReplaceRepeated","ReplicateLayer","RequiredPhysicalQuantities","Resampling","ResamplingAlgorithmData","ResamplingMethod","Rescale","RescalingTransform","ResetDirectory","ResetMenusPacket","ResetScheduledTask","ReshapeLayer","Residue","ResizeLayer","Resolve","ResourceAcquire","ResourceData","ResourceFunction","ResourceObject","ResourceRegister","ResourceRemove","ResourceSearch","ResourceSubmissionObject","ResourceSubmit","ResourceSystemBase","ResourceSystemPath","ResourceUpdate","ResourceVersion","ResponseForm","Rest","RestartInterval","Restricted","Resultant","ResumePacket","Return","ReturnEntersInput","ReturnExpressionPacket","ReturnInputFormPacket","ReturnPacket","ReturnReceiptFunction","ReturnTextPacket","Reverse","ReverseApplied","ReverseBiorthogonalSplineWavelet","ReverseElement","ReverseEquilibrium","ReverseGraph","ReverseSort","ReverseSortBy","ReverseUpEquilibrium","RevolutionAxis","RevolutionPlot3D","RGBColor","RiccatiSolve","RiceDistribution","RidgeFilter","RiemannR","RiemannSiegelTheta","RiemannSiegelZ","RiemannXi","Riffle","Right","RightArrow","RightArrowBar","RightArrowLeftArrow","RightComposition","RightCosetRepresentative","RightDownTeeVector","RightDownVector","RightDownVectorBar","RightTee","RightTeeArrow","RightTeeVector","RightTriangle","RightTriangleBar","RightTriangleEqual","RightUpDownVector","RightUpTeeVector","RightUpVector","RightUpVectorBar","RightVector","RightVectorBar","RiskAchievementImportance","RiskReductionImportance","RogersTanimotoDissimilarity","RollPitchYawAngles","RollPitchYawMatrix","RomanNumeral","Root","RootApproximant","RootIntervals","RootLocusPlot","RootMeanSquare","RootOfUnityQ","RootReduce","Roots","RootSum","Rotate","RotateLabel","RotateLeft","RotateRight","RotationAction","RotationBox","RotationBoxOptions","RotationMatrix","RotationTransform","Round","RoundImplies","RoundingRadius","Row","RowAlignments","RowBackgrounds","RowBox","RowHeights","RowLines","RowMinHeight","RowReduce","RowsEqual","RowSpacings","RSolve","RSolveValue","RudinShapiro","RudvalisGroupRu","Rule","RuleCondition","RuleDelayed","RuleForm","RulePlot","RulerUnits","Run","RunProcess","RunScheduledTask","RunThrough","RuntimeAttributes","RuntimeOptions","RussellRaoDissimilarity","SameQ","SameTest","SameTestProperties","SampledEntityClass","SampleDepth","SampledSoundFunction","SampledSoundList","SampleRate","SamplingPeriod","SARIMAProcess","SARMAProcess","SASTriangle","SatelliteData","SatisfiabilityCount","SatisfiabilityInstances","SatisfiableQ","Saturday","Save","Saveable","SaveAutoDelete","SaveConnection","SaveDefinitions","SavitzkyGolayMatrix","SawtoothWave","Scale","Scaled","ScaleDivisions","ScaledMousePosition","ScaleOrigin","ScalePadding","ScaleRanges","ScaleRangeStyle","ScalingFunctions","ScalingMatrix","ScalingTransform","Scan","ScheduledTask","ScheduledTaskActiveQ","ScheduledTaskInformation","ScheduledTaskInformationData","ScheduledTaskObject","ScheduledTasks","SchurDecomposition","ScientificForm","ScientificNotationThreshold","ScorerGi","ScorerGiPrime","ScorerHi","ScorerHiPrime","ScreenRectangle","ScreenStyleEnvironment","ScriptBaselineShifts","ScriptForm","ScriptLevel","ScriptMinSize","ScriptRules","ScriptSizeMultipliers","Scrollbars","ScrollingOptions","ScrollPosition","SearchAdjustment","SearchIndexObject","SearchIndices","SearchQueryString","SearchResultObject","Sec","Sech","SechDistribution","SecondOrderConeOptimization","SectionGrouping","SectorChart","SectorChart3D","SectorOrigin","SectorSpacing","SecuredAuthenticationKey","SecuredAuthenticationKeys","SeedRandom","Select","Selectable","SelectComponents","SelectedCells","SelectedNotebook","SelectFirst","Selection","SelectionAnimate","SelectionCell","SelectionCellCreateCell","SelectionCellDefaultStyle","SelectionCellParentStyle","SelectionCreateCell","SelectionDebuggerTag","SelectionDuplicateCell","SelectionEvaluate","SelectionEvaluateCreateCell","SelectionMove","SelectionPlaceholder","SelectionSetStyle","SelectWithContents","SelfLoops","SelfLoopStyle","SemanticImport","SemanticImportString","SemanticInterpretation","SemialgebraicComponentInstances","SemidefiniteOptimization","SendMail","SendMessage","Sequence","SequenceAlignment","SequenceAttentionLayer","SequenceCases","SequenceCount","SequenceFold","SequenceFoldList","SequenceForm","SequenceHold","SequenceLastLayer","SequenceMostLayer","SequencePosition","SequencePredict","SequencePredictorFunction","SequenceReplace","SequenceRestLayer","SequenceReverseLayer","SequenceSplit","Series","SeriesCoefficient","SeriesData","SeriesTermGoal","ServiceConnect","ServiceDisconnect","ServiceExecute","ServiceObject","ServiceRequest","ServiceResponse","ServiceSubmit","SessionSubmit","SessionTime","Set","SetAccuracy","SetAlphaChannel","SetAttributes","Setbacks","SetBoxFormNamesPacket","SetCloudDirectory","SetCookies","SetDelayed","SetDirectory","SetEnvironment","SetEvaluationNotebook","SetFileDate","SetFileLoadingContext","SetNotebookStatusLine","SetOptions","SetOptionsPacket","SetPermissions","SetPrecision","SetProperty","SetSecuredAuthenticationKey","SetSelectedNotebook","SetSharedFunction","SetSharedVariable","SetSpeechParametersPacket","SetStreamPosition","SetSystemModel","SetSystemOptions","Setter","SetterBar","SetterBox","SetterBoxOptions","Setting","SetUsers","SetValue","Shading","Shallow","ShannonWavelet","ShapiroWilkTest","Share","SharingList","Sharpen","ShearingMatrix","ShearingTransform","ShellRegion","ShenCastanMatrix","ShiftedGompertzDistribution","ShiftRegisterSequence","Short","ShortDownArrow","Shortest","ShortestMatch","ShortestPathFunction","ShortLeftArrow","ShortRightArrow","ShortTimeFourier","ShortTimeFourierData","ShortUpArrow","Show","ShowAutoConvert","ShowAutoSpellCheck","ShowAutoStyles","ShowCellBracket","ShowCellLabel","ShowCellTags","ShowClosedCellArea","ShowCodeAssist","ShowContents","ShowControls","ShowCursorTracker","ShowGroupOpenCloseIcon","ShowGroupOpener","ShowInvisibleCharacters","ShowPageBreaks","ShowPredictiveInterface","ShowSelection","ShowShortBoxForm","ShowSpecialCharacters","ShowStringCharacters","ShowSyntaxStyles","ShrinkingDelay","ShrinkWrapBoundingBox","SiderealTime","SiegelTheta","SiegelTukeyTest","SierpinskiCurve","SierpinskiMesh","Sign","Signature","SignedRankTest","SignedRegionDistance","SignificanceLevel","SignPadding","SignTest","SimilarityRules","SimpleGraph","SimpleGraphQ","SimplePolygonQ","SimplePolyhedronQ","Simplex","Simplify","Sin","Sinc","SinghMaddalaDistribution","SingleEvaluation","SingleLetterItalics","SingleLetterStyle","SingularValueDecomposition","SingularValueList","SingularValuePlot","SingularValues","Sinh","SinhIntegral","SinIntegral","SixJSymbol","Skeleton","SkeletonTransform","SkellamDistribution","Skewness","SkewNormalDistribution","SkinStyle","Skip","SliceContourPlot3D","SliceDensityPlot3D","SliceDistribution","SliceVectorPlot3D","Slider","Slider2D","Slider2DBox","Slider2DBoxOptions","SliderBox","SliderBoxOptions","SlideView","Slot","SlotSequence","Small","SmallCircle","Smaller","SmithDecomposition","SmithDelayCompensator","SmithWatermanSimilarity","SmoothDensityHistogram","SmoothHistogram","SmoothHistogram3D","SmoothKernelDistribution","SnDispersion","Snippet","SnubPolyhedron","SocialMediaData","Socket","SocketConnect","SocketListen","SocketListener","SocketObject","SocketOpen","SocketReadMessage","SocketReadyQ","Sockets","SocketWaitAll","SocketWaitNext","SoftmaxLayer","SokalSneathDissimilarity","SolarEclipse","SolarSystemFeatureData","SolidAngle","SolidData","SolidRegionQ","Solve","SolveAlways","SolveDelayed","Sort","SortBy","SortedBy","SortedEntityClass","Sound","SoundAndGraphics","SoundNote","SoundVolume","SourceLink","Sow","Space","SpaceCurveData","SpaceForm","Spacer","Spacings","Span","SpanAdjustments","SpanCharacterRounding","SpanFromAbove","SpanFromBoth","SpanFromLeft","SpanLineThickness","SpanMaxSize","SpanMinSize","SpanningCharacters","SpanSymmetric","SparseArray","SpatialGraphDistribution","SpatialMedian","SpatialTransformationLayer","Speak","SpeakerMatchQ","SpeakTextPacket","SpearmanRankTest","SpearmanRho","SpeciesData","SpecificityGoal","SpectralLineData","Spectrogram","SpectrogramArray","Specularity","SpeechCases","SpeechInterpreter","SpeechRecognize","SpeechSynthesize","SpellingCorrection","SpellingCorrectionList","SpellingDictionaries","SpellingDictionariesPath","SpellingOptions","SpellingSuggestionsPacket","Sphere","SphereBox","SpherePoints","SphericalBesselJ","SphericalBesselY","SphericalHankelH1","SphericalHankelH2","SphericalHarmonicY","SphericalPlot3D","SphericalRegion","SphericalShell","SpheroidalEigenvalue","SpheroidalJoiningFactor","SpheroidalPS","SpheroidalPSPrime","SpheroidalQS","SpheroidalQSPrime","SpheroidalRadialFactor","SpheroidalS1","SpheroidalS1Prime","SpheroidalS2","SpheroidalS2Prime","Splice","SplicedDistribution","SplineClosed","SplineDegree","SplineKnots","SplineWeights","Split","SplitBy","SpokenString","Sqrt","SqrtBox","SqrtBoxOptions","Square","SquaredEuclideanDistance","SquareFreeQ","SquareIntersection","SquareMatrixQ","SquareRepeatingElement","SquaresR","SquareSubset","SquareSubsetEqual","SquareSuperset","SquareSupersetEqual","SquareUnion","SquareWave","SSSTriangle","StabilityMargins","StabilityMarginsStyle","StableDistribution","Stack","StackBegin","StackComplete","StackedDateListPlot","StackedListPlot","StackInhibit","StadiumShape","StandardAtmosphereData","StandardDeviation","StandardDeviationFilter","StandardForm","Standardize","Standardized","StandardOceanData","StandbyDistribution","Star","StarClusterData","StarData","StarGraph","StartAsynchronousTask","StartExternalSession","StartingStepSize","StartOfLine","StartOfString","StartProcess","StartScheduledTask","StartupSound","StartWebSession","StateDimensions","StateFeedbackGains","StateOutputEstimator","StateResponse","StateSpaceModel","StateSpaceRealization","StateSpaceTransform","StateTransformationLinearize","StationaryDistribution","StationaryWaveletPacketTransform","StationaryWaveletTransform","StatusArea","StatusCentrality","StepMonitor","StereochemistryElements","StieltjesGamma","StippleShading","StirlingS1","StirlingS2","StopAsynchronousTask","StoppingPowerData","StopScheduledTask","StrataVariables","StratonovichProcess","StreamColorFunction","StreamColorFunctionScaling","StreamDensityPlot","StreamMarkers","StreamPlot","StreamPoints","StreamPosition","Streams","StreamScale","StreamStyle","String","StringBreak","StringByteCount","StringCases","StringContainsQ","StringCount","StringDelete","StringDrop","StringEndsQ","StringExpression","StringExtract","StringForm","StringFormat","StringFreeQ","StringInsert","StringJoin","StringLength","StringMatchQ","StringPadLeft","StringPadRight","StringPart","StringPartition","StringPosition","StringQ","StringRepeat","StringReplace","StringReplaceList","StringReplacePart","StringReverse","StringRiffle","StringRotateLeft","StringRotateRight","StringSkeleton","StringSplit","StringStartsQ","StringTake","StringTemplate","StringToByteArray","StringToStream","StringTrim","StripBoxes","StripOnInput","StripWrapperBoxes","StrokeForm","StructuralImportance","StructuredArray","StructuredArrayHeadQ","StructuredSelection","StruveH","StruveL","Stub","StudentTDistribution","Style","StyleBox","StyleBoxAutoDelete","StyleData","StyleDefinitions","StyleForm","StyleHints","StyleKeyMapping","StyleMenuListing","StyleNameDialogSettings","StyleNames","StylePrint","StyleSheetPath","Subdivide","Subfactorial","Subgraph","SubMinus","SubPlus","SubresultantPolynomialRemainders","SubresultantPolynomials","Subresultants","Subscript","SubscriptBox","SubscriptBoxOptions","Subscripted","Subsequences","Subset","SubsetCases","SubsetCount","SubsetEqual","SubsetMap","SubsetPosition","SubsetQ","SubsetReplace","Subsets","SubStar","SubstitutionSystem","Subsuperscript","SubsuperscriptBox","SubsuperscriptBoxOptions","SubtitleEncoding","SubtitleTracks","Subtract","SubtractFrom","SubtractSides","SubValues","Succeeds","SucceedsEqual","SucceedsSlantEqual","SucceedsTilde","Success","SuchThat","Sum","SumConvergence","SummationLayer","Sunday","SunPosition","Sunrise","Sunset","SuperDagger","SuperMinus","SupernovaData","SuperPlus","Superscript","SuperscriptBox","SuperscriptBoxOptions","Superset","SupersetEqual","SuperStar","Surd","SurdForm","SurfaceAppearance","SurfaceArea","SurfaceColor","SurfaceData","SurfaceGraphics","SurvivalDistribution","SurvivalFunction","SurvivalModel","SurvivalModelFit","SuspendPacket","SuzukiDistribution","SuzukiGroupSuz","SwatchLegend","Switch","Symbol","SymbolName","SymletWavelet","Symmetric","SymmetricGroup","SymmetricKey","SymmetricMatrixQ","SymmetricPolynomial","SymmetricReduction","Symmetrize","SymmetrizedArray","SymmetrizedArrayRules","SymmetrizedDependentComponents","SymmetrizedIndependentComponents","SymmetrizedReplacePart","SynchronousInitialization","SynchronousUpdating","Synonyms","Syntax","SyntaxForm","SyntaxInformation","SyntaxLength","SyntaxPacket","SyntaxQ","SynthesizeMissingValues","SystemCredential","SystemCredentialData","SystemCredentialKey","SystemCredentialKeys","SystemCredentialStoreObject","SystemDialogInput","SystemException","SystemGet","SystemHelpPath","SystemInformation","SystemInformationData","SystemInstall","SystemModel","SystemModeler","SystemModelExamples","SystemModelLinearize","SystemModelParametricSimulate","SystemModelPlot","SystemModelProgressReporting","SystemModelReliability","SystemModels","SystemModelSimulate","SystemModelSimulateSensitivity","SystemModelSimulationData","SystemOpen","SystemOptions","SystemProcessData","SystemProcesses","SystemsConnectionsModel","SystemsModelDelay","SystemsModelDelayApproximate","SystemsModelDelete","SystemsModelDimensions","SystemsModelExtract","SystemsModelFeedbackConnect","SystemsModelLabels","SystemsModelLinearity","SystemsModelMerge","SystemsModelOrder","SystemsModelParallelConnect","SystemsModelSeriesConnect","SystemsModelStateFeedbackConnect","SystemsModelVectorRelativeOrders","SystemStub","SystemTest","Tab","TabFilling","Table","TableAlignments","TableDepth","TableDirections","TableForm","TableHeadings","TableSpacing","TableView","TableViewBox","TableViewBoxBackground","TableViewBoxItemSize","TableViewBoxOptions","TabSpacings","TabView","TabViewBox","TabViewBoxOptions","TagBox","TagBoxNote","TagBoxOptions","TaggingRules","TagSet","TagSetDelayed","TagStyle","TagUnset","Take","TakeDrop","TakeLargest","TakeLargestBy","TakeList","TakeSmallest","TakeSmallestBy","TakeWhile","Tally","Tan","Tanh","TargetDevice","TargetFunctions","TargetSystem","TargetUnits","TaskAbort","TaskExecute","TaskObject","TaskRemove","TaskResume","Tasks","TaskSuspend","TaskWait","TautologyQ","TelegraphProcess","TemplateApply","TemplateArgBox","TemplateBox","TemplateBoxOptions","TemplateEvaluate","TemplateExpression","TemplateIf","TemplateObject","TemplateSequence","TemplateSlot","TemplateSlotSequence","TemplateUnevaluated","TemplateVerbatim","TemplateWith","TemporalData","TemporalRegularity","Temporary","TemporaryVariable","TensorContract","TensorDimensions","TensorExpand","TensorProduct","TensorQ","TensorRank","TensorReduce","TensorSymmetry","TensorTranspose","TensorWedge","TestID","TestReport","TestReportObject","TestResultObject","Tetrahedron","TetrahedronBox","TetrahedronBoxOptions","TeXForm","TeXSave","Text","Text3DBox","Text3DBoxOptions","TextAlignment","TextBand","TextBoundingBox","TextBox","TextCases","TextCell","TextClipboardType","TextContents","TextData","TextElement","TextForm","TextGrid","TextJustification","TextLine","TextPacket","TextParagraph","TextPosition","TextRecognize","TextSearch","TextSearchReport","TextSentences","TextString","TextStructure","TextStyle","TextTranslation","Texture","TextureCoordinateFunction","TextureCoordinateScaling","TextWords","Therefore","ThermodynamicData","ThermometerGauge","Thick","Thickness","Thin","Thinning","ThisLink","ThompsonGroupTh","Thread","ThreadingLayer","ThreeJSymbol","Threshold","Through","Throw","ThueMorse","Thumbnail","Thursday","Ticks","TicksStyle","TideData","Tilde","TildeEqual","TildeFullEqual","TildeTilde","TimeConstrained","TimeConstraint","TimeDirection","TimeFormat","TimeGoal","TimelinePlot","TimeObject","TimeObjectQ","TimeRemaining","Times","TimesBy","TimeSeries","TimeSeriesAggregate","TimeSeriesForecast","TimeSeriesInsert","TimeSeriesInvertibility","TimeSeriesMap","TimeSeriesMapThread","TimeSeriesModel","TimeSeriesModelFit","TimeSeriesResample","TimeSeriesRescale","TimeSeriesShift","TimeSeriesThread","TimeSeriesWindow","TimeUsed","TimeValue","TimeWarpingCorrespondence","TimeWarpingDistance","TimeZone","TimeZoneConvert","TimeZoneOffset","Timing","Tiny","TitleGrouping","TitsGroupT","ToBoxes","ToCharacterCode","ToColor","ToContinuousTimeModel","ToDate","Today","ToDiscreteTimeModel","ToEntity","ToeplitzMatrix","ToExpression","ToFileName","Together","Toggle","ToggleFalse","Toggler","TogglerBar","TogglerBox","TogglerBoxOptions","ToHeldExpression","ToInvertibleTimeSeries","TokenWords","Tolerance","ToLowerCase","Tomorrow","ToNumberField","TooBig","Tooltip","TooltipBox","TooltipBoxOptions","TooltipDelay","TooltipStyle","ToonShading","Top","TopHatTransform","ToPolarCoordinates","TopologicalSort","ToRadicals","ToRules","ToSphericalCoordinates","ToString","Total","TotalHeight","TotalLayer","TotalVariationFilter","TotalWidth","TouchPosition","TouchscreenAutoZoom","TouchscreenControlPlacement","ToUpperCase","Tr","Trace","TraceAbove","TraceAction","TraceBackward","TraceDepth","TraceDialog","TraceForward","TraceInternal","TraceLevel","TraceOff","TraceOn","TraceOriginal","TracePrint","TraceScan","TrackedSymbols","TrackingFunction","TracyWidomDistribution","TradingChart","TraditionalForm","TraditionalFunctionNotation","TraditionalNotation","TraditionalOrder","TrainingProgressCheckpointing","TrainingProgressFunction","TrainingProgressMeasurements","TrainingProgressReporting","TrainingStoppingCriterion","TrainingUpdateSchedule","TransferFunctionCancel","TransferFunctionExpand","TransferFunctionFactor","TransferFunctionModel","TransferFunctionPoles","TransferFunctionTransform","TransferFunctionZeros","TransformationClass","TransformationFunction","TransformationFunctions","TransformationMatrix","TransformedDistribution","TransformedField","TransformedProcess","TransformedRegion","TransitionDirection","TransitionDuration","TransitionEffect","TransitiveClosureGraph","TransitiveReductionGraph","Translate","TranslationOptions","TranslationTransform","Transliterate","Transparent","TransparentColor","Transpose","TransposeLayer","TrapSelection","TravelDirections","TravelDirectionsData","TravelDistance","TravelDistanceList","TravelMethod","TravelTime","TreeForm","TreeGraph","TreeGraphQ","TreePlot","TrendStyle","Triangle","TriangleCenter","TriangleConstruct","TriangleMeasurement","TriangleWave","TriangularDistribution","TriangulateMesh","Trig","TrigExpand","TrigFactor","TrigFactorList","Trigger","TrigReduce","TrigToExp","TrimmedMean","TrimmedVariance","TropicalStormData","True","TrueQ","TruncatedDistribution","TruncatedPolyhedron","TsallisQExponentialDistribution","TsallisQGaussianDistribution","TTest","Tube","TubeBezierCurveBox","TubeBezierCurveBoxOptions","TubeBox","TubeBoxOptions","TubeBSplineCurveBox","TubeBSplineCurveBoxOptions","Tuesday","TukeyLambdaDistribution","TukeyWindow","TunnelData","Tuples","TuranGraph","TuringMachine","TuttePolynomial","TwoWayRule","Typed","TypeSpecifier","UnateQ","Uncompress","UnconstrainedParameters","Undefined","UnderBar","Underflow","Underlined","Underoverscript","UnderoverscriptBox","UnderoverscriptBoxOptions","Underscript","UnderscriptBox","UnderscriptBoxOptions","UnderseaFeatureData","UndirectedEdge","UndirectedGraph","UndirectedGraphQ","UndoOptions","UndoTrackedVariables","Unequal","UnequalTo","Unevaluated","UniformDistribution","UniformGraphDistribution","UniformPolyhedron","UniformSumDistribution","Uninstall","Union","UnionedEntityClass","UnionPlus","Unique","UnitaryMatrixQ","UnitBox","UnitConvert","UnitDimensions","Unitize","UnitRootTest","UnitSimplify","UnitStep","UnitSystem","UnitTriangle","UnitVector","UnitVectorLayer","UnityDimensions","UniverseModelData","UniversityData","UnixTime","Unprotect","UnregisterExternalEvaluator","UnsameQ","UnsavedVariables","Unset","UnsetShared","UntrackedVariables","Up","UpArrow","UpArrowBar","UpArrowDownArrow","Update","UpdateDynamicObjects","UpdateDynamicObjectsSynchronous","UpdateInterval","UpdatePacletSites","UpdateSearchIndex","UpDownArrow","UpEquilibrium","UpperCaseQ","UpperLeftArrow","UpperRightArrow","UpperTriangularize","UpperTriangularMatrixQ","Upsample","UpSet","UpSetDelayed","UpTee","UpTeeArrow","UpTo","UpValues","URL","URLBuild","URLDecode","URLDispatcher","URLDownload","URLDownloadSubmit","URLEncode","URLExecute","URLExpand","URLFetch","URLFetchAsynchronous","URLParse","URLQueryDecode","URLQueryEncode","URLRead","URLResponseTime","URLSave","URLSaveAsynchronous","URLShorten","URLSubmit","UseGraphicsRange","UserDefinedWavelet","Using","UsingFrontEnd","UtilityFunction","V2Get","ValenceErrorHandling","ValidationLength","ValidationSet","Value","ValueBox","ValueBoxOptions","ValueDimensions","ValueForm","ValuePreprocessingFunction","ValueQ","Values","ValuesData","Variables","Variance","VarianceEquivalenceTest","VarianceEstimatorFunction","VarianceGammaDistribution","VarianceTest","VectorAngle","VectorAround","VectorAspectRatio","VectorColorFunction","VectorColorFunctionScaling","VectorDensityPlot","VectorGlyphData","VectorGreater","VectorGreaterEqual","VectorLess","VectorLessEqual","VectorMarkers","VectorPlot","VectorPlot3D","VectorPoints","VectorQ","VectorRange","Vectors","VectorScale","VectorScaling","VectorSizes","VectorStyle","Vee","Verbatim","Verbose","VerboseConvertToPostScriptPacket","VerificationTest","VerifyConvergence","VerifyDerivedKey","VerifyDigitalSignature","VerifyFileSignature","VerifyInterpretation","VerifySecurityCertificates","VerifySolutions","VerifyTestAssumptions","Version","VersionedPreferences","VersionNumber","VertexAdd","VertexCapacity","VertexColors","VertexComponent","VertexConnectivity","VertexContract","VertexCoordinateRules","VertexCoordinates","VertexCorrelationSimilarity","VertexCosineSimilarity","VertexCount","VertexCoverQ","VertexDataCoordinates","VertexDegree","VertexDelete","VertexDiceSimilarity","VertexEccentricity","VertexInComponent","VertexInDegree","VertexIndex","VertexJaccardSimilarity","VertexLabeling","VertexLabels","VertexLabelStyle","VertexList","VertexNormals","VertexOutComponent","VertexOutDegree","VertexQ","VertexRenderingFunction","VertexReplace","VertexShape","VertexShapeFunction","VertexSize","VertexStyle","VertexTextureCoordinates","VertexWeight","VertexWeightedGraphQ","Vertical","VerticalBar","VerticalForm","VerticalGauge","VerticalSeparator","VerticalSlider","VerticalTilde","Video","VideoEncoding","VideoExtractFrames","VideoFrameList","VideoFrameMap","VideoPause","VideoPlay","VideoQ","VideoStop","VideoStream","VideoStreams","VideoTimeSeries","VideoTracks","VideoTrim","ViewAngle","ViewCenter","ViewMatrix","ViewPoint","ViewPointSelectorSettings","ViewPort","ViewProjection","ViewRange","ViewVector","ViewVertical","VirtualGroupData","Visible","VisibleCell","VoiceStyleData","VoigtDistribution","VolcanoData","Volume","VonMisesDistribution","VoronoiMesh","WaitAll","WaitAsynchronousTask","WaitNext","WaitUntil","WakebyDistribution","WalleniusHypergeometricDistribution","WaringYuleDistribution","WarpingCorrespondence","WarpingDistance","WatershedComponents","WatsonUSquareTest","WattsStrogatzGraphDistribution","WaveletBestBasis","WaveletFilterCoefficients","WaveletImagePlot","WaveletListPlot","WaveletMapIndexed","WaveletMatrixPlot","WaveletPhi","WaveletPsi","WaveletScale","WaveletScalogram","WaveletThreshold","WeaklyConnectedComponents","WeaklyConnectedGraphComponents","WeaklyConnectedGraphQ","WeakStationarity","WeatherData","WeatherForecastData","WebAudioSearch","WebElementObject","WeberE","WebExecute","WebImage","WebImageSearch","WebSearch","WebSessionObject","WebSessions","WebWindowObject","Wedge","Wednesday","WeibullDistribution","WeierstrassE1","WeierstrassE2","WeierstrassE3","WeierstrassEta1","WeierstrassEta2","WeierstrassEta3","WeierstrassHalfPeriods","WeierstrassHalfPeriodW1","WeierstrassHalfPeriodW2","WeierstrassHalfPeriodW3","WeierstrassInvariantG2","WeierstrassInvariantG3","WeierstrassInvariants","WeierstrassP","WeierstrassPPrime","WeierstrassSigma","WeierstrassZeta","WeightedAdjacencyGraph","WeightedAdjacencyMatrix","WeightedData","WeightedGraphQ","Weights","WelchWindow","WheelGraph","WhenEvent","Which","While","White","WhiteNoiseProcess","WhitePoint","Whitespace","WhitespaceCharacter","WhittakerM","WhittakerW","WienerFilter","WienerProcess","WignerD","WignerSemicircleDistribution","WikidataData","WikidataSearch","WikipediaData","WikipediaSearch","WilksW","WilksWTest","WindDirectionData","WindingCount","WindingPolygon","WindowClickSelect","WindowElements","WindowFloating","WindowFrame","WindowFrameElements","WindowMargins","WindowMovable","WindowOpacity","WindowPersistentStyles","WindowSelected","WindowSize","WindowStatusArea","WindowTitle","WindowToolbars","WindowWidth","WindSpeedData","WindVectorData","WinsorizedMean","WinsorizedVariance","WishartMatrixDistribution","With","WolframAlpha","WolframAlphaDate","WolframAlphaQuantity","WolframAlphaResult","WolframLanguageData","Word","WordBoundary","WordCharacter","WordCloud","WordCount","WordCounts","WordData","WordDefinition","WordFrequency","WordFrequencyData","WordList","WordOrientation","WordSearch","WordSelectionFunction","WordSeparators","WordSpacings","WordStem","WordTranslation","WorkingPrecision","WrapAround","Write","WriteLine","WriteString","Wronskian","XMLElement","XMLObject","XMLTemplate","Xnor","Xor","XYZColor","Yellow","Yesterday","YuleDissimilarity","ZernikeR","ZeroSymmetric","ZeroTest","ZeroWidthTimes","Zeta","ZetaZero","ZIPCodeData","ZipfDistribution","ZoomCenter","ZoomFactor","ZTest","ZTransform","$Aborted","$ActivationGroupID","$ActivationKey","$ActivationUserRegistered","$AddOnsDirectory","$AllowDataUpdates","$AllowExternalChannelFunctions","$AllowInternet","$AssertFunction","$Assumptions","$AsynchronousTask","$AudioDecoders","$AudioEncoders","$AudioInputDevices","$AudioOutputDevices","$BaseDirectory","$BasePacletsDirectory","$BatchInput","$BatchOutput","$BlockchainBase","$BoxForms","$ByteOrdering","$CacheBaseDirectory","$Canceled","$ChannelBase","$CharacterEncoding","$CharacterEncodings","$CloudAccountName","$CloudBase","$CloudConnected","$CloudConnection","$CloudCreditsAvailable","$CloudEvaluation","$CloudExpressionBase","$CloudObjectNameFormat","$CloudObjectURLType","$CloudRootDirectory","$CloudSymbolBase","$CloudUserID","$CloudUserUUID","$CloudVersion","$CloudVersionNumber","$CloudWolframEngineVersionNumber","$CommandLine","$CompilationTarget","$ConditionHold","$ConfiguredKernels","$Context","$ContextPath","$ControlActiveSetting","$Cookies","$CookieStore","$CreationDate","$CurrentLink","$CurrentTask","$CurrentWebSession","$DataStructures","$DateStringFormat","$DefaultAudioInputDevice","$DefaultAudioOutputDevice","$DefaultFont","$DefaultFrontEnd","$DefaultImagingDevice","$DefaultLocalBase","$DefaultMailbox","$DefaultNetworkInterface","$DefaultPath","$DefaultProxyRules","$DefaultSystemCredentialStore","$Display","$DisplayFunction","$DistributedContexts","$DynamicEvaluation","$Echo","$EmbedCodeEnvironments","$EmbeddableServices","$EntityStores","$Epilog","$EvaluationCloudBase","$EvaluationCloudObject","$EvaluationEnvironment","$ExportFormats","$ExternalIdentifierTypes","$ExternalStorageBase","$Failed","$FinancialDataSource","$FontFamilies","$FormatType","$FrontEnd","$FrontEndSession","$GeoEntityTypes","$GeoLocation","$GeoLocationCity","$GeoLocationCountry","$GeoLocationPrecision","$GeoLocationSource","$HistoryLength","$HomeDirectory","$HTMLExportRules","$HTTPCookies","$HTTPRequest","$IgnoreEOF","$ImageFormattingWidth","$ImageResolution","$ImagingDevice","$ImagingDevices","$ImportFormats","$IncomingMailSettings","$InitialDirectory","$Initialization","$InitializationContexts","$Input","$InputFileName","$InputStreamMethods","$Inspector","$InstallationDate","$InstallationDirectory","$InterfaceEnvironment","$InterpreterTypes","$IterationLimit","$KernelCount","$KernelID","$Language","$LaunchDirectory","$LibraryPath","$LicenseExpirationDate","$LicenseID","$LicenseProcesses","$LicenseServer","$LicenseSubprocesses","$LicenseType","$Line","$Linked","$LinkSupported","$LoadedFiles","$LocalBase","$LocalSymbolBase","$MachineAddresses","$MachineDomain","$MachineDomains","$MachineEpsilon","$MachineID","$MachineName","$MachinePrecision","$MachineType","$MaxExtraPrecision","$MaxLicenseProcesses","$MaxLicenseSubprocesses","$MaxMachineNumber","$MaxNumber","$MaxPiecewiseCases","$MaxPrecision","$MaxRootDegree","$MessageGroups","$MessageList","$MessagePrePrint","$Messages","$MinMachineNumber","$MinNumber","$MinorReleaseNumber","$MinPrecision","$MobilePhone","$ModuleNumber","$NetworkConnected","$NetworkInterfaces","$NetworkLicense","$NewMessage","$NewSymbol","$NotebookInlineStorageLimit","$Notebooks","$NoValue","$NumberMarks","$Off","$OperatingSystem","$Output","$OutputForms","$OutputSizeLimit","$OutputStreamMethods","$Packages","$ParentLink","$ParentProcessID","$PasswordFile","$PatchLevelID","$Path","$PathnameSeparator","$PerformanceGoal","$Permissions","$PermissionsGroupBase","$PersistenceBase","$PersistencePath","$PipeSupported","$PlotTheme","$Post","$Pre","$PreferencesDirectory","$PreInitialization","$PrePrint","$PreRead","$PrintForms","$PrintLiteral","$Printout3DPreviewer","$ProcessID","$ProcessorCount","$ProcessorType","$ProductInformation","$ProgramName","$PublisherID","$RandomState","$RecursionLimit","$RegisteredDeviceClasses","$RegisteredUserName","$ReleaseNumber","$RequesterAddress","$RequesterWolframID","$RequesterWolframUUID","$RootDirectory","$ScheduledTask","$ScriptCommandLine","$ScriptInputString","$SecuredAuthenticationKeyTokens","$ServiceCreditsAvailable","$Services","$SessionID","$SetParentLink","$SharedFunctions","$SharedVariables","$SoundDisplay","$SoundDisplayFunction","$SourceLink","$SSHAuthentication","$SubtitleDecoders","$SubtitleEncoders","$SummaryBoxDataSizeLimit","$SuppressInputFormHeads","$SynchronousEvaluation","$SyntaxHandler","$System","$SystemCharacterEncoding","$SystemCredentialStore","$SystemID","$SystemMemory","$SystemShell","$SystemTimeZone","$SystemWordLength","$TemplatePath","$TemporaryDirectory","$TemporaryPrefix","$TestFileName","$TextStyle","$TimedOut","$TimeUnit","$TimeZone","$TimeZoneEntity","$TopDirectory","$TraceOff","$TraceOn","$TracePattern","$TracePostAction","$TracePreAction","$UnitSystem","$Urgent","$UserAddOnsDirectory","$UserAgentLanguages","$UserAgentMachine","$UserAgentName","$UserAgentOperatingSystem","$UserAgentString","$UserAgentVersion","$UserBaseDirectory","$UserBasePacletsDirectory","$UserDocumentsDirectory","$Username","$UserName","$UserURLBase","$Version","$VersionNumber","$VideoDecoders","$VideoEncoders","$VoiceStyles","$WolframDocumentsDirectory","$WolframID","$WolframUUID"];function IOn(t){return t?typeof t=="string"?t:t.source:null}function SOn(t){return UTe("(",t,")?")}function UTe(...t){return t.map(n=>IOn(n)).join("")}function COn(...t){return"("+t.map(n=>IOn(n)).join("|")+")"}function $2i(t){let e=/([2-9]|[1-2]\d|[3][0-5])\^\^/,n=/(\w*\.\w+|\w+\.\w*|\w+)/,r=/(\d*\.\d+|\d+\.\d*|\d+)/,i=COn(UTe(e,n),r),a=COn(/``[+-]?(\d*\.\d+|\d+\.\d*|\d+)/,/`([+-]?(\d*\.\d+|\d+\.\d*|\d+))?/),c=/\*\^[+-]?\d+/,l={className:"number",relevance:0,begin:UTe(i,SOn(a),SOn(c))},d=/[a-zA-Z$][a-zA-Z0-9$]*/,m=new Set(G2i),h={variants:[{className:"builtin-symbol",begin:d,"on:begin":(S,C)=>{m.has(S[0])||C.ignoreMatch()}},{className:"symbol",relevance:0,begin:d}]},f={className:"named-character",begin:/\\\[[$a-zA-Z][$a-zA-Z0-9]+\]/},g={className:"operator",relevance:0,begin:/[+\-*/,;.:@~=><&|_`'^?!%]+/},A={className:"pattern",relevance:0,begin:/([a-zA-Z$][a-zA-Z0-9$]*)?_+([a-zA-Z$][a-zA-Z0-9$]*)?/},y={className:"slot",relevance:0,begin:/#[a-zA-Z$][a-zA-Z0-9$]*|#+[0-9]?/},E={className:"brace",relevance:0,begin:/[[\](){}]/},_={className:"message-name",relevance:0,begin:UTe("::",d)};return{name:"Mathematica",aliases:["mma","wl"],classNameAliases:{brace:"punctuation",pattern:"type",slot:"type",symbol:"variable","named-character":"variable","builtin-symbol":"built_in","message-name":"string"},contains:[t.COMMENT(/\(\*/,/\*\)/,{contains:["self"]}),A,y,_,h,f,t.QUOTE_STRING_MODE,l,g,E]}}wOn.exports=$2i});var ROn=re((Llc,vOn)=>{p();function W2i(t){var e="('|\\.')+",n={relevance:0,contains:[{begin:e}]};return{name:"Matlab",keywords:{keyword:"arguments break case catch classdef continue else elseif end enumeration events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i|0 inf nan isnan isinf isfinite j|0 why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson max min nanmax nanmin mean nanmean type table readtable writetable sortrows sort figure plot plot3 scatter scatter3 cellfun legend intersect ismember procrustes hold num2cell "},illegal:'(//|"|#|/\\*|\\s+/\\w+)',contains:[{className:"function",beginKeywords:"function",end:"$",contains:[t.UNDERSCORE_TITLE_MODE,{className:"params",variants:[{begin:"\\(",end:"\\)"},{begin:"\\[",end:"\\]"}]}]},{className:"built_in",begin:/true|false/,relevance:0,starts:n},{begin:"[a-zA-Z][a-zA-Z_0-9]*"+e,relevance:0},{className:"number",begin:t.C_NUMBER_RE,relevance:0,starts:n},{className:"string",begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE,{begin:"''"}]},{begin:/\]|\}|\)/,relevance:0,starts:n},{className:"string",begin:'"',end:'"',contains:[t.BACKSLASH_ESCAPE,{begin:'""'}],starts:n},t.COMMENT("^\\s*%\\{\\s*$","^\\s*%\\}\\s*$"),t.COMMENT("%","$")]}}vOn.exports=W2i});var BOn=re((Qlc,kOn)=>{p();function H2i(t){return{name:"Maxima",keywords:{$pattern:"[A-Za-z_%][0-9A-Za-z_%]*",keyword:"if then else elseif for thru do while unless step in and or not",literal:"true false unknown inf minf ind und %e %i %pi %phi %gamma",built_in:" abasep abs absint absolute_real_time acos acosh acot acoth acsc acsch activate addcol add_edge add_edges addmatrices addrow add_vertex add_vertices adjacency_matrix adjoin adjoint af agd airy airy_ai airy_bi airy_dai airy_dbi algsys alg_type alias allroots alphacharp alphanumericp amortization %and annuity_fv annuity_pv antid antidiff AntiDifference append appendfile apply apply1 apply2 applyb1 apropos args arit_amortization arithmetic arithsum array arrayapply arrayinfo arraymake arraysetapply ascii asec asech asin asinh askinteger asksign assoc assoc_legendre_p assoc_legendre_q assume assume_external_byte_order asympa at atan atan2 atanh atensimp atom atvalue augcoefmatrix augmented_lagrangian_method av average_degree backtrace bars barsplot barsplot_description base64 base64_decode bashindices batch batchload bc2 bdvac belln benefit_cost bern bernpoly bernstein_approx bernstein_expand bernstein_poly bessel bessel_i bessel_j bessel_k bessel_simplify bessel_y beta beta_incomplete beta_incomplete_generalized beta_incomplete_regularized bezout bfallroots bffac bf_find_root bf_fmin_cobyla bfhzeta bfloat bfloatp bfpsi bfpsi0 bfzeta biconnected_components bimetric binomial bipartition block blockmatrixp bode_gain bode_phase bothcoef box boxplot boxplot_description break bug_report build_info|10 buildq build_sample burn cabs canform canten cardinality carg cartan cartesian_product catch cauchy_matrix cbffac cdf_bernoulli cdf_beta cdf_binomial cdf_cauchy cdf_chi2 cdf_continuous_uniform cdf_discrete_uniform cdf_exp cdf_f cdf_gamma cdf_general_finite_discrete cdf_geometric cdf_gumbel cdf_hypergeometric cdf_laplace cdf_logistic cdf_lognormal cdf_negative_binomial cdf_noncentral_chi2 cdf_noncentral_student_t cdf_normal cdf_pareto cdf_poisson cdf_rank_sum cdf_rayleigh cdf_signed_rank cdf_student_t cdf_weibull cdisplay ceiling central_moment cequal cequalignore cf cfdisrep cfexpand cgeodesic cgreaterp cgreaterpignore changename changevar chaosgame charat charfun charfun2 charlist charp charpoly chdir chebyshev_t chebyshev_u checkdiv check_overlaps chinese cholesky christof chromatic_index chromatic_number cint circulant_graph clear_edge_weight clear_rules clear_vertex_label clebsch_gordan clebsch_graph clessp clesspignore close closefile cmetric coeff coefmatrix cograd col collapse collectterms columnop columnspace columnswap columnvector combination combine comp2pui compare compfile compile compile_file complement_graph complete_bipartite_graph complete_graph complex_number_p components compose_functions concan concat conjugate conmetderiv connected_components connect_vertices cons constant constantp constituent constvalue cont2part content continuous_freq contortion contour_plot contract contract_edge contragrad contrib_ode convert coord copy copy_file copy_graph copylist copymatrix cor cos cosh cot coth cov cov1 covdiff covect covers crc24sum create_graph create_list csc csch csetup cspline ctaylor ct_coordsys ctransform ctranspose cube_graph cuboctahedron_graph cunlisp cv cycle_digraph cycle_graph cylindrical days360 dblint deactivate declare declare_constvalue declare_dimensions declare_fundamental_dimensions declare_fundamental_units declare_qty declare_translated declare_unit_conversion declare_units declare_weights decsym defcon define define_alt_display define_variable defint defmatch defrule defstruct deftaylor degree_sequence del delete deleten delta demo demoivre denom depends derivdegree derivlist describe desolve determinant dfloat dgauss_a dgauss_b dgeev dgemm dgeqrf dgesv dgesvd diag diagmatrix diag_matrix diagmatrixp diameter diff digitcharp dimacs_export dimacs_import dimension dimensionless dimensions dimensions_as_list direct directory discrete_freq disjoin disjointp disolate disp dispcon dispform dispfun dispJordan display disprule dispterms distrib divide divisors divsum dkummer_m dkummer_u dlange dodecahedron_graph dotproduct dotsimp dpart draw draw2d draw3d drawdf draw_file draw_graph dscalar echelon edge_coloring edge_connectivity edges eigens_by_jacobi eigenvalues eigenvectors eighth einstein eivals eivects elapsed_real_time elapsed_run_time ele2comp ele2polynome ele2pui elem elementp elevation_grid elim elim_allbut eliminate eliminate_using ellipse elliptic_e elliptic_ec elliptic_eu elliptic_f elliptic_kc elliptic_pi ematrix empty_graph emptyp endcons entermatrix entertensor entier equal equalp equiv_classes erf erfc erf_generalized erfi errcatch error errormsg errors euler ev eval_string evenp every evolution evolution2d evundiff example exp expand expandwrt expandwrt_factored expint expintegral_chi expintegral_ci expintegral_e expintegral_e1 expintegral_ei expintegral_e_simplify expintegral_li expintegral_shi expintegral_si explicit explose exponentialize express expt exsec extdiff extract_linear_equations extremal_subset ezgcd %f f90 facsum factcomb factor factorfacsum factorial factorout factorsum facts fast_central_elements fast_linsolve fasttimes featurep fernfale fft fib fibtophi fifth filename_merge file_search file_type fillarray findde find_root find_root_abs find_root_error find_root_rel first fix flatten flength float floatnump floor flower_snark flush flush1deriv flushd flushnd flush_output fmin_cobyla forget fortran fourcos fourexpand fourier fourier_elim fourint fourintcos fourintsin foursimp foursin fourth fposition frame_bracket freeof freshline fresnel_c fresnel_s from_adjacency_matrix frucht_graph full_listify fullmap fullmapl fullratsimp fullratsubst fullsetify funcsolve fundamental_dimensions fundamental_units fundef funmake funp fv g0 g1 gamma gamma_greek gamma_incomplete gamma_incomplete_generalized gamma_incomplete_regularized gauss gauss_a gauss_b gaussprob gcd gcdex gcdivide gcfac gcfactor gd generalized_lambert_w genfact gen_laguerre genmatrix gensym geo_amortization geo_annuity_fv geo_annuity_pv geomap geometric geometric_mean geosum get getcurrentdirectory get_edge_weight getenv get_lu_factors get_output_stream_string get_pixel get_plot_option get_tex_environment get_tex_environment_default get_vertex_label gfactor gfactorsum ggf girth global_variances gn gnuplot_close gnuplot_replot gnuplot_reset gnuplot_restart gnuplot_start go Gosper GosperSum gr2d gr3d gradef gramschmidt graph6_decode graph6_encode graph6_export graph6_import graph_center graph_charpoly graph_eigenvalues graph_flow graph_order graph_periphery graph_product graph_size graph_union great_rhombicosidodecahedron_graph great_rhombicuboctahedron_graph grid_graph grind grobner_basis grotzch_graph hamilton_cycle hamilton_path hankel hankel_1 hankel_2 harmonic harmonic_mean hav heawood_graph hermite hessian hgfred hilbertmap hilbert_matrix hipow histogram histogram_description hodge horner hypergeometric i0 i1 %ibes ic1 ic2 ic_convert ichr1 ichr2 icosahedron_graph icosidodecahedron_graph icurvature ident identfor identity idiff idim idummy ieqn %if ifactors iframes ifs igcdex igeodesic_coords ilt image imagpart imetric implicit implicit_derivative implicit_plot indexed_tensor indices induced_subgraph inferencep inference_result infix info_display init_atensor init_ctensor in_neighbors innerproduct inpart inprod inrt integerp integer_partitions integrate intersect intersection intervalp intopois intosum invariant1 invariant2 inverse_fft inverse_jacobi_cd inverse_jacobi_cn inverse_jacobi_cs inverse_jacobi_dc inverse_jacobi_dn inverse_jacobi_ds inverse_jacobi_nc inverse_jacobi_nd inverse_jacobi_ns inverse_jacobi_sc inverse_jacobi_sd inverse_jacobi_sn invert invert_by_adjoint invert_by_lu inv_mod irr is is_biconnected is_bipartite is_connected is_digraph is_edge_in_graph is_graph is_graph_or_digraph ishow is_isomorphic isolate isomorphism is_planar isqrt isreal_p is_sconnected is_tree is_vertex_in_graph items_inference %j j0 j1 jacobi jacobian jacobi_cd jacobi_cn jacobi_cs jacobi_dc jacobi_dn jacobi_ds jacobi_nc jacobi_nd jacobi_ns jacobi_p jacobi_sc jacobi_sd jacobi_sn JF jn join jordan julia julia_set julia_sin %k kdels kdelta kill killcontext kostka kron_delta kronecker_product kummer_m kummer_u kurtosis kurtosis_bernoulli kurtosis_beta kurtosis_binomial kurtosis_chi2 kurtosis_continuous_uniform kurtosis_discrete_uniform kurtosis_exp kurtosis_f kurtosis_gamma kurtosis_general_finite_discrete kurtosis_geometric kurtosis_gumbel kurtosis_hypergeometric kurtosis_laplace kurtosis_logistic kurtosis_lognormal kurtosis_negative_binomial kurtosis_noncentral_chi2 kurtosis_noncentral_student_t kurtosis_normal kurtosis_pareto kurtosis_poisson kurtosis_rayleigh kurtosis_student_t kurtosis_weibull label labels lagrange laguerre lambda lambert_w laplace laplacian_matrix last lbfgs lc2kdt lcharp lc_l lcm lc_u ldefint ldisp ldisplay legendre_p legendre_q leinstein length let letrules letsimp levi_civita lfreeof lgtreillis lhs li liediff limit Lindstedt linear linearinterpol linear_program linear_regression line_graph linsolve listarray list_correlations listify list_matrix_entries list_nc_monomials listoftens listofvars listp lmax lmin load loadfile local locate_matrix_entry log logcontract log_gamma lopow lorentz_gauge lowercasep lpart lratsubst lreduce lriemann lsquares_estimates lsquares_estimates_approximate lsquares_estimates_exact lsquares_mse lsquares_residual_mse lsquares_residuals lsum ltreillis lu_backsub lucas lu_factor %m macroexpand macroexpand1 make_array makebox makefact makegamma make_graph make_level_picture makelist makeOrders make_poly_continent make_poly_country make_polygon make_random_state make_rgb_picture makeset make_string_input_stream make_string_output_stream make_transform mandelbrot mandelbrot_set map mapatom maplist matchdeclare matchfix mat_cond mat_fullunblocker mat_function mathml_display mat_norm matrix matrixmap matrixp matrix_size mattrace mat_trace mat_unblocker max max_clique max_degree max_flow maximize_lp max_independent_set max_matching maybe md5sum mean mean_bernoulli mean_beta mean_binomial mean_chi2 mean_continuous_uniform mean_deviation mean_discrete_uniform mean_exp mean_f mean_gamma mean_general_finite_discrete mean_geometric mean_gumbel mean_hypergeometric mean_laplace mean_logistic mean_lognormal mean_negative_binomial mean_noncentral_chi2 mean_noncentral_student_t mean_normal mean_pareto mean_poisson mean_rayleigh mean_student_t mean_weibull median median_deviation member mesh metricexpandall mgf1_sha1 min min_degree min_edge_cut minfactorial minimalPoly minimize_lp minimum_spanning_tree minor minpack_lsquares minpack_solve min_vertex_cover min_vertex_cut mkdir mnewton mod mode_declare mode_identity ModeMatrix moebius mon2schur mono monomial_dimensions multibernstein_poly multi_display_for_texinfo multi_elem multinomial multinomial_coeff multi_orbit multiplot_mode multi_pui multsym multthru mycielski_graph nary natural_unit nc_degree ncexpt ncharpoly negative_picture neighbors new newcontext newdet new_graph newline newton new_variable next_prime nicedummies niceindices ninth nofix nonarray noncentral_moment nonmetricity nonnegintegerp nonscalarp nonzeroandfreeof notequal nounify nptetrad npv nroots nterms ntermst nthroot nullity nullspace num numbered_boundaries numberp number_to_octets num_distinct_partitions numerval numfactor num_partitions nusum nzeta nzetai nzetar octets_to_number octets_to_oid odd_girth oddp ode2 ode_check odelin oid_to_octets op opena opena_binary openr openr_binary openw openw_binary operatorp opsubst optimize %or orbit orbits ordergreat ordergreatp orderless orderlessp orthogonal_complement orthopoly_recur orthopoly_weight outermap out_neighbors outofpois pade parabolic_cylinder_d parametric parametric_surface parg parGosper parse_string parse_timedate part part2cont partfrac partition partition_set partpol path_digraph path_graph pathname_directory pathname_name pathname_type pdf_bernoulli pdf_beta pdf_binomial pdf_cauchy pdf_chi2 pdf_continuous_uniform pdf_discrete_uniform pdf_exp pdf_f pdf_gamma pdf_general_finite_discrete pdf_geometric pdf_gumbel pdf_hypergeometric pdf_laplace pdf_logistic pdf_lognormal pdf_negative_binomial pdf_noncentral_chi2 pdf_noncentral_student_t pdf_normal pdf_pareto pdf_poisson pdf_rank_sum pdf_rayleigh pdf_signed_rank pdf_student_t pdf_weibull pearson_skewness permanent permut permutation permutations petersen_graph petrov pickapart picture_equalp picturep piechart piechart_description planar_embedding playback plog plot2d plot3d plotdf ploteq plsquares pochhammer points poisdiff poisexpt poisint poismap poisplus poissimp poissubst poistimes poistrim polar polarform polartorect polar_to_xy poly_add poly_buchberger poly_buchberger_criterion poly_colon_ideal poly_content polydecomp poly_depends_p poly_elimination_ideal poly_exact_divide poly_expand poly_expt poly_gcd polygon poly_grobner poly_grobner_equal poly_grobner_member poly_grobner_subsetp poly_ideal_intersection poly_ideal_polysaturation poly_ideal_polysaturation1 poly_ideal_saturation poly_ideal_saturation1 poly_lcm poly_minimization polymod poly_multiply polynome2ele polynomialp poly_normal_form poly_normalize poly_normalize_list poly_polysaturation_extension poly_primitive_part poly_pseudo_divide poly_reduced_grobner poly_reduction poly_saturation_extension poly_s_polynomial poly_subtract polytocompanion pop postfix potential power_mod powerseries powerset prefix prev_prime primep primes principal_components print printf printfile print_graph printpois printprops prodrac product properties propvars psi psubst ptriangularize pui pui2comp pui2ele pui2polynome pui_direct puireduc push put pv qput qrange qty quad_control quad_qag quad_qagi quad_qagp quad_qags quad_qawc quad_qawf quad_qawo quad_qaws quadrilateral quantile quantile_bernoulli quantile_beta quantile_binomial quantile_cauchy quantile_chi2 quantile_continuous_uniform quantile_discrete_uniform quantile_exp quantile_f quantile_gamma quantile_general_finite_discrete quantile_geometric quantile_gumbel quantile_hypergeometric quantile_laplace quantile_logistic quantile_lognormal quantile_negative_binomial quantile_noncentral_chi2 quantile_noncentral_student_t quantile_normal quantile_pareto quantile_poisson quantile_rayleigh quantile_student_t quantile_weibull quartile_skewness quit qunit quotient racah_v racah_w radcan radius random random_bernoulli random_beta random_binomial random_bipartite_graph random_cauchy random_chi2 random_continuous_uniform random_digraph random_discrete_uniform random_exp random_f random_gamma random_general_finite_discrete random_geometric random_graph random_graph1 random_gumbel random_hypergeometric random_laplace random_logistic random_lognormal random_negative_binomial random_network random_noncentral_chi2 random_noncentral_student_t random_normal random_pareto random_permutation random_poisson random_rayleigh random_regular_graph random_student_t random_tournament random_tree random_weibull range rank rat ratcoef ratdenom ratdiff ratdisrep ratexpand ratinterpol rational rationalize ratnumer ratnump ratp ratsimp ratsubst ratvars ratweight read read_array read_binary_array read_binary_list read_binary_matrix readbyte readchar read_hashed_array readline read_list read_matrix read_nested_list readonly read_xpm real_imagpart_to_conjugate realpart realroots rearray rectangle rectform rectform_log_if_constant recttopolar rediff reduce_consts reduce_order region region_boundaries region_boundaries_plus rem remainder remarray rembox remcomps remcon remcoord remfun remfunction remlet remove remove_constvalue remove_dimensions remove_edge remove_fundamental_dimensions remove_fundamental_units remove_plot_option remove_vertex rempart remrule remsym remvalue rename rename_file reset reset_displays residue resolvante resolvante_alternee1 resolvante_bipartite resolvante_diedrale resolvante_klein resolvante_klein3 resolvante_produit_sym resolvante_unitaire resolvante_vierer rest resultant return reveal reverse revert revert2 rgb2level rhs ricci riemann rinvariant risch rk rmdir rncombine romberg room rootscontract round row rowop rowswap rreduce run_testsuite %s save saving scalarp scaled_bessel_i scaled_bessel_i0 scaled_bessel_i1 scalefactors scanmap scatterplot scatterplot_description scene schur2comp sconcat scopy scsimp scurvature sdowncase sec sech second sequal sequalignore set_alt_display setdifference set_draw_defaults set_edge_weight setelmx setequalp setify setp set_partitions set_plot_option set_prompt set_random_state set_tex_environment set_tex_environment_default setunits setup_autoload set_up_dot_simplifications set_vertex_label seventh sexplode sf sha1sum sha256sum shortest_path shortest_weighted_path show showcomps showratvars sierpinskiale sierpinskimap sign signum similaritytransform simp_inequality simplify_sum simplode simpmetderiv simtran sin sinh sinsert sinvertcase sixth skewness skewness_bernoulli skewness_beta skewness_binomial skewness_chi2 skewness_continuous_uniform skewness_discrete_uniform skewness_exp skewness_f skewness_gamma skewness_general_finite_discrete skewness_geometric skewness_gumbel skewness_hypergeometric skewness_laplace skewness_logistic skewness_lognormal skewness_negative_binomial skewness_noncentral_chi2 skewness_noncentral_student_t skewness_normal skewness_pareto skewness_poisson skewness_rayleigh skewness_student_t skewness_weibull slength smake small_rhombicosidodecahedron_graph small_rhombicuboctahedron_graph smax smin smismatch snowmap snub_cube_graph snub_dodecahedron_graph solve solve_rec solve_rec_rat some somrac sort sparse6_decode sparse6_encode sparse6_export sparse6_import specint spherical spherical_bessel_j spherical_bessel_y spherical_hankel1 spherical_hankel2 spherical_harmonic spherical_to_xyz splice split sposition sprint sqfr sqrt sqrtdenest sremove sremovefirst sreverse ssearch ssort sstatus ssubst ssubstfirst staircase standardize standardize_inverse_trig starplot starplot_description status std std1 std_bernoulli std_beta std_binomial std_chi2 std_continuous_uniform std_discrete_uniform std_exp std_f std_gamma std_general_finite_discrete std_geometric std_gumbel std_hypergeometric std_laplace std_logistic std_lognormal std_negative_binomial std_noncentral_chi2 std_noncentral_student_t std_normal std_pareto std_poisson std_rayleigh std_student_t std_weibull stemplot stirling stirling1 stirling2 strim striml strimr string stringout stringp strong_components struve_h struve_l sublis sublist sublist_indices submatrix subsample subset subsetp subst substinpart subst_parallel substpart substring subvar subvarp sum sumcontract summand_to_rec supcase supcontext symbolp symmdifference symmetricp system take_channel take_inference tan tanh taylor taylorinfo taylorp taylor_simplifier taytorat tcl_output tcontract tellrat tellsimp tellsimpafter tentex tenth test_mean test_means_difference test_normality test_proportion test_proportions_difference test_rank_sum test_sign test_signed_rank test_variance test_variance_ratio tex tex1 tex_display texput %th third throw time timedate timer timer_info tldefint tlimit todd_coxeter toeplitz tokens to_lisp topological_sort to_poly to_poly_solve totaldisrep totalfourier totient tpartpol trace tracematrix trace_options transform_sample translate translate_file transpose treefale tree_reduce treillis treinat triangle triangularize trigexpand trigrat trigreduce trigsimp trunc truncate truncated_cube_graph truncated_dodecahedron_graph truncated_icosahedron_graph truncated_tetrahedron_graph tr_warnings_get tube tutte_graph ueivects uforget ultraspherical underlying_graph undiff union unique uniteigenvectors unitp units unit_step unitvector unorder unsum untellrat untimer untrace uppercasep uricci uriemann uvect vandermonde_matrix var var1 var_bernoulli var_beta var_binomial var_chi2 var_continuous_uniform var_discrete_uniform var_exp var_f var_gamma var_general_finite_discrete var_geometric var_gumbel var_hypergeometric var_laplace var_logistic var_lognormal var_negative_binomial var_noncentral_chi2 var_noncentral_student_t var_normal var_pareto var_poisson var_rayleigh var_student_t var_weibull vector vectorpotential vectorsimp verbify vers vertex_coloring vertex_connectivity vertex_degree vertex_distance vertex_eccentricity vertex_in_degree vertex_out_degree vertices vertices_to_cycle vertices_to_path %w weyl wheel_graph wiener_index wigner_3j wigner_6j wigner_9j with_stdout write_binary_data writebyte write_data writefile wronskian xreduce xthru %y Zeilberger zeroequiv zerofor zeromatrix zeromatrixp zeta zgeev zheev zlange zn_add_table zn_carmichael_lambda zn_characteristic_factors zn_determinant zn_factor_generators zn_invert_by_lu zn_log zn_mult_table absboxchar activecontexts adapt_depth additive adim aform algebraic algepsilon algexact aliases allbut all_dotsimp_denoms allocation allsym alphabetic animation antisymmetric arrays askexp assume_pos assume_pos_pred assumescalar asymbol atomgrad atrig1 axes axis_3d axis_bottom axis_left axis_right axis_top azimuth background background_color backsubst berlefact bernstein_explicit besselexpand beta_args_sum_to_integer beta_expand bftorat bftrunc bindtest border boundaries_array box boxchar breakup %c capping cauchysum cbrange cbtics center cflength cframe_flag cnonmet_flag color color_bar color_bar_tics colorbox columns commutative complex cone context contexts contour contour_levels cosnpiflag ctaypov ctaypt ctayswitch ctayvar ct_coords ctorsion_flag ctrgsimp cube current_let_rule_package cylinder data_file_name debugmode decreasing default_let_rule_package delay dependencies derivabbrev derivsubst detout diagmetric diff dim dimensions dispflag display2d|10 display_format_internal distribute_over doallmxops domain domxexpt domxmxops domxnctimes dontfactor doscmxops doscmxplus dot0nscsimp dot0simp dot1simp dotassoc dotconstrules dotdistrib dotexptsimp dotident dotscrules draw_graph_program draw_realpart edge_color edge_coloring edge_partition edge_type edge_width %edispflag elevation %emode endphi endtheta engineering_format_floats enhanced3d %enumer epsilon_lp erfflag erf_representation errormsg error_size error_syms error_type %e_to_numlog eval even evenfun evflag evfun ev_point expandwrt_denom expintexpand expintrep expon expop exptdispflag exptisolate exptsubst facexpand facsum_combine factlim factorflag factorial_expand factors_only fb feature features file_name file_output_append file_search_demo file_search_lisp file_search_maxima|10 file_search_tests file_search_usage file_type_lisp file_type_maxima|10 fill_color fill_density filled_func fixed_vertices flipflag float2bf font font_size fortindent fortspaces fpprec fpprintprec functions gamma_expand gammalim gdet genindex gensumnum GGFCFMAX GGFINFINITY globalsolve gnuplot_command gnuplot_curve_styles gnuplot_curve_titles gnuplot_default_term_command gnuplot_dumb_term_command gnuplot_file_args gnuplot_file_name gnuplot_out_file gnuplot_pdf_term_command gnuplot_pm3d gnuplot_png_term_command gnuplot_postamble gnuplot_preamble gnuplot_ps_term_command gnuplot_svg_term_command gnuplot_term gnuplot_view_args Gosper_in_Zeilberger gradefs grid grid2d grind halfangles head_angle head_both head_length head_type height hypergeometric_representation %iargs ibase icc1 icc2 icounter idummyx ieqnprint ifb ifc1 ifc2 ifg ifgi ifr iframe_bracket_form ifri igeowedge_flag ikt1 ikt2 imaginary inchar increasing infeval infinity inflag infolists inm inmc1 inmc2 intanalysis integer integervalued integrate_use_rootsof integration_constant integration_constant_counter interpolate_color intfaclim ip_grid ip_grid_in irrational isolate_wrt_times iterations itr julia_parameter %k1 %k2 keepfloat key key_pos kinvariant kt label label_alignment label_orientation labels lassociative lbfgs_ncorrections lbfgs_nfeval_max leftjust legend letrat let_rule_packages lfg lg lhospitallim limsubst linear linear_solver linechar linel|10 linenum line_type linewidth line_width linsolve_params linsolvewarn lispdisp listarith listconstvars listdummyvars lmxchar load_pathname loadprint logabs logarc logcb logconcoeffp logexpand lognegint logsimp logx logx_secondary logy logy_secondary logz lriem m1pbranch macroexpansion macros mainvar manual_demo maperror mapprint matrix_element_add matrix_element_mult matrix_element_transpose maxapplydepth maxapplyheight maxima_tempdir|10 maxima_userdir|10 maxnegex MAX_ORD maxposex maxpsifracdenom maxpsifracnum maxpsinegint maxpsiposint maxtayorder mesh_lines_color method mod_big_prime mode_check_errorp mode_checkp mode_check_warnp mod_test mod_threshold modular_linear_solver modulus multiplicative multiplicities myoptions nary negdistrib negsumdispflag newline newtonepsilon newtonmaxiter nextlayerfactor niceindicespref nm nmc noeval nolabels nonegative_lp noninteger nonscalar noun noundisp nouns np npi nticks ntrig numer numer_pbranch obase odd oddfun opacity opproperties opsubst optimprefix optionset orientation origin orthopoly_returns_intervals outative outchar packagefile palette partswitch pdf_file pfeformat phiresolution %piargs piece pivot_count_sx pivot_max_sx plot_format plot_options plot_realpart png_file pochhammer_max_index points pointsize point_size points_joined point_type poislim poisson poly_coefficient_ring poly_elimination_order polyfactor poly_grobner_algorithm poly_grobner_debug poly_monomial_order poly_primary_elimination_order poly_return_term_list poly_secondary_elimination_order poly_top_reduction_only posfun position powerdisp pred prederror primep_number_of_tests product_use_gamma program programmode promote_float_to_bigfloat prompt proportional_axes props psexpand ps_file radexpand radius radsubstflag rassociative ratalgdenom ratchristof ratdenomdivide rateinstein ratepsilon ratfac rational ratmx ratprint ratriemann ratsimpexpons ratvarswitch ratweights ratweyl ratwtlvl real realonly redraw refcheck resolution restart resultant ric riem rmxchar %rnum_list rombergabs rombergit rombergmin rombergtol rootsconmode rootsepsilon run_viewer same_xy same_xyz savedef savefactors scalar scalarmatrixp scale scale_lp setcheck setcheckbreak setval show_edge_color show_edges show_edge_type show_edge_width show_id show_label showtime show_vertex_color show_vertex_size show_vertex_type show_vertices show_weight simp simplified_output simplify_products simpproduct simpsum sinnpiflag solvedecomposes solveexplicit solvefactors solvenullwarn solveradcan solvetrigwarn space sparse sphere spring_embedding_depth sqrtdispflag stardisp startphi starttheta stats_numer stringdisp structures style sublis_apply_lambda subnumsimp sumexpand sumsplitfact surface surface_hide svg_file symmetric tab taylordepth taylor_logexpand taylor_order_coefficients taylor_truncate_polynomials tensorkill terminal testsuite_files thetaresolution timer_devalue title tlimswitch tr track transcompile transform transform_xy translate_fast_arrays transparent transrun tr_array_as_ref tr_bound_function_applyp tr_file_tty_messagesp tr_float_can_branch_complex tr_function_call_default trigexpandplus trigexpandtimes triginverses trigsign trivial_solutions tr_numer tr_optimize_max_loop tr_semicompile tr_state_vars tr_warn_bad_function_calls tr_warn_fexpr tr_warn_meval tr_warn_mode tr_warn_undeclared tr_warn_undefined_variable tstep ttyoff tube_extremes ufg ug %unitexpand unit_vectors uric uriem use_fast_arrays user_preamble usersetunits values vect_cross verbose vertex_color vertex_coloring vertex_partition vertex_size vertex_type view warnings weyl width windowname windowtitle wired_surface wireframe xaxis xaxis_color xaxis_secondary xaxis_type xaxis_width xlabel xlabel_secondary xlength xrange xrange_secondary xtics xtics_axis xtics_rotate xtics_rotate_secondary xtics_secondary xtics_secondary_axis xu_grid x_voxel xy_file xyplane xy_scale yaxis yaxis_color yaxis_secondary yaxis_type yaxis_width ylabel ylabel_secondary ylength yrange yrange_secondary ytics ytics_axis ytics_rotate ytics_rotate_secondary ytics_secondary ytics_secondary_axis yv_grid y_voxel yx_ratio zaxis zaxis_color zaxis_type zaxis_width zeroa zerob zerobern zeta%pi zlabel zlabel_rotate zlength zmin zn_primroot_limit zn_primroot_pretest",symbol:"_ __ %|0 %%|0"},contains:[{className:"comment",begin:"/\\*",end:"\\*/",contains:["self"]},t.QUOTE_STRING_MODE,{className:"number",relevance:0,variants:[{begin:"\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Ee][-+]?\\d+\\b"},{begin:"\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Bb][-+]?\\d+\\b",relevance:10},{begin:"\\b(\\.\\d+|\\d+\\.\\d+)\\b"},{begin:"\\b(\\d+|0[0-9A-Za-z]+)\\.?\\b"}]}],illegal:/@/}}kOn.exports=H2i});var DOn=re((Glc,NOn)=>{p();function q2i(t){return{name:"MEL",keywords:"int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",illegal:"{p();function j2i(t){let e={keyword:"module use_module import_module include_module end_module initialise mutable initialize finalize finalise interface implementation pred mode func type inst solver any_pred any_func is semidet det nondet multi erroneous failure cc_nondet cc_multi typeclass instance where pragma promise external trace atomic or_else require_complete_switch require_det require_semidet require_multi require_nondet require_cc_multi require_cc_nondet require_erroneous require_failure",meta:"inline no_inline type_spec source_file fact_table obsolete memo loop_check minimal_model terminates does_not_terminate check_termination promise_equivalent_clauses foreign_proc foreign_decl foreign_code foreign_type foreign_import_module foreign_export_enum foreign_export foreign_enum may_call_mercury will_not_call_mercury thread_safe not_thread_safe maybe_thread_safe promise_pure promise_semipure tabled_for_io local untrailed trailed attach_to_io_state can_pass_as_mercury_type stable will_not_throw_exception may_modify_trail will_not_modify_trail may_duplicate may_not_duplicate affects_liveness does_not_affect_liveness doesnt_affect_liveness no_sharing unknown_sharing sharing",built_in:"some all not if then else true fail false try catch catch_any semidet_true semidet_false semidet_fail impure_true impure semipure"},n=t.COMMENT("%","$"),r={className:"number",begin:"0'.\\|0[box][0-9a-fA-F]*"},i=t.inherit(t.APOS_STRING_MODE,{relevance:0}),s=t.inherit(t.QUOTE_STRING_MODE,{relevance:0}),o={className:"subst",begin:"\\\\[abfnrtv]\\|\\\\x[0-9a-fA-F]*\\\\\\|%[-+# *.0-9]*[dioxXucsfeEgGp]",relevance:0};return s.contains=s.contains.slice(),s.contains.push(o),{name:"Mercury",aliases:["m","moo"],keywords:e,contains:[{className:"built_in",variants:[{begin:"<=>"},{begin:"<=",relevance:0},{begin:"=>",relevance:0},{begin:"/\\\\"},{begin:"\\\\/"}]},{className:"built_in",variants:[{begin:":-\\|-->"},{begin:"=",relevance:0}]},n,t.C_BLOCK_COMMENT_MODE,r,t.NUMBER_MODE,i,s,{begin:/:-/},{begin:/\.$/}]}}POn.exports=j2i});var LOn=re((qlc,OOn)=>{p();function V2i(t){return{name:"MIPS Assembly",case_insensitive:!0,aliases:["mips"],keywords:{$pattern:"\\.?"+t.IDENT_RE,meta:".2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .ltorg ",built_in:"$0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $30 $31 zero at v0 v1 a0 a1 a2 a3 a4 a5 a6 a7 t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 s0 s1 s2 s3 s4 s5 s6 s7 s8 k0 k1 gp sp fp ra $f0 $f1 $f2 $f2 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15 $f16 $f17 $f18 $f19 $f20 $f21 $f22 $f23 $f24 $f25 $f26 $f27 $f28 $f29 $f30 $f31 Context Random EntryLo0 EntryLo1 Context PageMask Wired EntryHi HWREna BadVAddr Count Compare SR IntCtl SRSCtl SRSMap Cause EPC PRId EBase Config Config1 Config2 Config3 LLAddr Debug DEPC DESAVE CacheErr ECC ErrorEPC TagLo DataLo TagHi DataHi WatchLo WatchHi PerfCtl PerfCnt "},contains:[{className:"keyword",begin:"\\b(addi?u?|andi?|b(al)?|beql?|bgez(al)?l?|bgtzl?|blezl?|bltz(al)?l?|bnel?|cl[oz]|divu?|ext|ins|j(al)?|jalr(\\.hb)?|jr(\\.hb)?|lbu?|lhu?|ll|lui|lw[lr]?|maddu?|mfhi|mflo|movn|movz|move|msubu?|mthi|mtlo|mul|multu?|nop|nor|ori?|rotrv?|sb|sc|se[bh]|sh|sllv?|slti?u?|srav?|srlv?|subu?|sw[lr]?|xori?|wsbh|abs\\.[sd]|add\\.[sd]|alnv.ps|bc1[ft]l?|c\\.(s?f|un|u?eq|[ou]lt|[ou]le|ngle?|seq|l[et]|ng[et])\\.[sd]|(ceil|floor|round|trunc)\\.[lw]\\.[sd]|cfc1|cvt\\.d\\.[lsw]|cvt\\.l\\.[dsw]|cvt\\.ps\\.s|cvt\\.s\\.[dlw]|cvt\\.s\\.p[lu]|cvt\\.w\\.[dls]|div\\.[ds]|ldx?c1|luxc1|lwx?c1|madd\\.[sd]|mfc1|mov[fntz]?\\.[ds]|msub\\.[sd]|mth?c1|mul\\.[ds]|neg\\.[ds]|nmadd\\.[ds]|nmsub\\.[ds]|p[lu][lu]\\.ps|recip\\.fmt|r?sqrt\\.[ds]|sdx?c1|sub\\.[ds]|suxc1|swx?c1|break|cache|d?eret|[de]i|ehb|mfc0|mtc0|pause|prefx?|rdhwr|rdpgpr|sdbbp|ssnop|synci?|syscall|teqi?|tgei?u?|tlb(p|r|w[ir])|tlti?u?|tnei?|wait|wrpgpr)",end:"\\s"},t.COMMENT("[;#](?!\\s*$)","$"),t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",relevance:0},{className:"title",begin:"\\|",end:"\\|",illegal:"\\n",relevance:0},{className:"number",variants:[{begin:"0x[0-9a-f]+"},{begin:"\\b-?\\d+"}],relevance:0},{className:"symbol",variants:[{begin:"^\\s*[a-z_\\.\\$][a-z0-9_\\.\\$]+:"},{begin:"^\\s*[0-9]+:"},{begin:"[0-9]+[bf]"}],relevance:0}],illegal:/\//}}OOn.exports=V2i});var QOn=re((Vlc,FOn)=>{p();function Y2i(t){return{name:"Mizar",keywords:"environ vocabularies notations constructors definitions registrations theorems schemes requirements begin end definition registration cluster existence pred func defpred deffunc theorem proof let take assume then thus hence ex for st holds consider reconsider such that and in provided of as from be being by means equals implies iff redefine define now not or attr is mode suppose per cases set thesis contradiction scheme reserve struct correctness compatibility coherence symmetry assymetry reflexivity irreflexivity connectedness uniqueness commutativity idempotence involutiveness projectivity",contains:[t.COMMENT("::","$")]}}FOn.exports=Y2i});var GOn=re((zlc,UOn)=>{p();function z2i(t){return{name:"Mojolicious",subLanguage:"xml",contains:[{className:"meta",begin:"^__(END|DATA)__$"},{begin:"^\\s*%{1,2}={0,2}",end:"$",subLanguage:"perl"},{begin:"<%{1,2}={0,2}",end:"={0,1}%>",subLanguage:"perl",excludeBegin:!0,excludeEnd:!0}]}}UOn.exports=z2i});var WOn=re((Jlc,$On)=>{p();function K2i(t){let e={className:"number",relevance:0,variants:[{begin:"[$][a-fA-F0-9]+"},t.NUMBER_MODE]};return{name:"Monkey",case_insensitive:!0,keywords:{keyword:"public private property continue exit extern new try catch eachin not abstract final select case default const local global field end if then else elseif endif while wend repeat until forever for to step next return module inline throw import",built_in:"DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI",literal:"true false null and or shl shr mod"},illegal:/\/\*/,contains:[t.COMMENT("#rem","#end"),t.COMMENT("'","$",{relevance:0}),{className:"function",beginKeywords:"function method",end:"[(=:]|$",illegal:/\n/,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"class",beginKeywords:"class interface",end:"$",contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{className:"built_in",begin:"\\b(self|super)\\b"},{className:"meta",begin:"\\s*#",end:"$",keywords:{"meta-keyword":"if else elseif endif end then"}},{className:"meta",begin:"^\\s*strict\\b"},{beginKeywords:"alias",end:"=",contains:[t.UNDERSCORE_TITLE_MODE]},t.QUOTE_STRING_MODE,e]}}$On.exports=K2i});var qOn=re((Zlc,HOn)=>{p();function J2i(t){let e={keyword:"if then not for in while do return else elseif break continue switch and or unless when class extends super local import export from using",literal:"true false nil",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},n="[A-Za-z$_][0-9A-Za-z$_]*",r={className:"subst",begin:/#\{/,end:/\}/,keywords:e},i=[t.inherit(t.C_NUMBER_MODE,{starts:{end:"(\\s*/)?",relevance:0}}),{className:"string",variants:[{begin:/'/,end:/'/,contains:[t.BACKSLASH_ESCAPE]},{begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r]}]},{className:"built_in",begin:"@__"+t.IDENT_RE},{begin:"@"+t.IDENT_RE},{begin:t.IDENT_RE+"\\\\"+t.IDENT_RE}];r.contains=i;let s=t.inherit(t.TITLE_MODE,{begin:n}),o="(\\(.*\\)\\s*)?\\B[-=]>",a={className:"params",begin:"\\([^\\(]",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:e,contains:["self"].concat(i)}]};return{name:"MoonScript",aliases:["moon"],keywords:e,illegal:/\/\*/,contains:i.concat([t.COMMENT("--","$"),{className:"function",begin:"^\\s*"+n+"\\s*=\\s*"+o,end:"[-=]>",returnBegin:!0,contains:[s,a]},{begin:/[\(,:=]\s*/,relevance:0,contains:[{className:"function",begin:o,end:"[-=]>",returnBegin:!0,contains:[a]}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[s]},s]},{className:"name",begin:n+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}HOn.exports=J2i});var VOn=re((tuc,jOn)=>{p();function X2i(t){return{name:"N1QL",case_insensitive:!0,contains:[{beginKeywords:"build create index delete drop explain infer|10 insert merge prepare select update upsert|10",end:/;/,endsWithParent:!0,keywords:{keyword:"all alter analyze and any array as asc begin between binary boolean break bucket build by call case cast cluster collate collection commit connect continue correlate cover create database dataset datastore declare decrement delete derived desc describe distinct do drop each element else end every except exclude execute exists explain fetch first flatten for force from function grant group gsi having if ignore ilike in include increment index infer inline inner insert intersect into is join key keys keyspace known last left let letting like limit lsm map mapping matched materialized merge minus namespace nest not number object offset on option or order outer over parse partition password path pool prepare primary private privilege procedure public raw realm reduce rename return returning revoke right role rollback satisfies schema select self semi set show some start statistics string system then to transaction trigger truncate under union unique unknown unnest unset update upsert use user using validate value valued values via view when where while with within work xor",literal:"true false null missing|5",built_in:"array_agg array_append array_concat array_contains array_count array_distinct array_ifnull array_length array_max array_min array_position array_prepend array_put array_range array_remove array_repeat array_replace array_reverse array_sort array_sum avg count max min sum greatest least ifmissing ifmissingornull ifnull missingif nullif ifinf ifnan ifnanorinf naninf neginfif posinfif clock_millis clock_str date_add_millis date_add_str date_diff_millis date_diff_str date_part_millis date_part_str date_trunc_millis date_trunc_str duration_to_str millis str_to_millis millis_to_str millis_to_utc millis_to_zone_name now_millis now_str str_to_duration str_to_utc str_to_zone_name decode_json encode_json encoded_size poly_length base64 base64_encode base64_decode meta uuid abs acos asin atan atan2 ceil cos degrees e exp ln log floor pi power radians random round sign sin sqrt tan trunc object_length object_names object_pairs object_inner_pairs object_values object_inner_values object_add object_put object_remove object_unwrap regexp_contains regexp_like regexp_position regexp_replace contains initcap length lower ltrim position repeat replace rtrim split substr title trim upper isarray isatom isboolean isnumber isobject isstring type toarray toatom toboolean tonumber toobject tostring"},contains:[{className:"string",begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{className:"string",begin:'"',end:'"',contains:[t.BACKSLASH_ESCAPE]},{className:"symbol",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE],relevance:2},t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE]},t.C_BLOCK_COMMENT_MODE]}}jOn.exports=X2i});var zOn=re((ruc,YOn)=>{p();function Z2i(t){let e={className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{/,end:/\}/},{begin:/[$@]/+t.UNDERSCORE_IDENT_RE}]},n={endsWithParent:!0,keywords:{$pattern:"[a-z/_]+",literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},relevance:0,illegal:"=>",contains:[t.HASH_COMMENT_MODE,{className:"string",contains:[t.BACKSLASH_ESCAPE,e],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[e]},{className:"regexp",contains:[t.BACKSLASH_ESCAPE,e],variants:[{begin:"\\s\\^",end:"\\s|\\{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|\\{|;",returnEnd:!0},{begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number",begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{className:"number",begin:"\\b\\d+[kKmMgGdshdwy]*\\b",relevance:0},e]};return{name:"Nginx config",aliases:["nginxconf"],contains:[t.HASH_COMMENT_MODE,{begin:t.UNDERSCORE_IDENT_RE+"\\s+\\{",returnBegin:!0,end:/\{/,contains:[{className:"section",begin:t.UNDERSCORE_IDENT_RE}],relevance:0},{begin:t.UNDERSCORE_IDENT_RE+"\\s",end:";|\\{",returnBegin:!0,contains:[{className:"attribute",begin:t.UNDERSCORE_IDENT_RE,starts:n}],relevance:0}],illegal:"[^\\s\\}]"}}YOn.exports=Z2i});var JOn=re((suc,KOn)=>{p();function eFi(t){return{name:"Nim",keywords:{keyword:"addr and as asm bind block break case cast const continue converter discard distinct div do elif else end enum except export finally for from func generic if import in include interface is isnot iterator let macro method mixin mod nil not notin object of or out proc ptr raise ref return shl shr static template try tuple type using var when while with without xor yield",literal:"shared guarded stdin stdout stderr result true false",built_in:"int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float float32 float64 bool char string cstring pointer expr stmt void auto any range array openarray varargs seq set clong culong cchar cschar cshort cint csize clonglong cfloat cdouble clongdouble cuchar cushort cuint culonglong cstringarray semistatic"},contains:[{className:"meta",begin:/\{\./,end:/\.\}/,relevance:10},{className:"string",begin:/[a-zA-Z]\w*"/,end:/"/,contains:[{begin:/""/}]},{className:"string",begin:/([a-zA-Z]\w*)?"""/,end:/"""/},t.QUOTE_STRING_MODE,{className:"type",begin:/\b[A-Z]\w+\b/,relevance:0},{className:"number",relevance:0,variants:[{begin:/\b(0[xX][0-9a-fA-F][_0-9a-fA-F]*)('?[iIuU](8|16|32|64))?/},{begin:/\b(0o[0-7][_0-7]*)('?[iIuUfF](8|16|32|64))?/},{begin:/\b(0(b|B)[01][_01]*)('?[iIuUfF](8|16|32|64))?/},{begin:/\b(\d[_\d]*)('?[iIuUfF](8|16|32|64))?/}]},t.HASH_COMMENT_MODE]}}KOn.exports=eFi});var ZOn=re((auc,XOn)=>{p();function tFi(t){return{name:"Node REPL",contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$",subLanguage:"javascript"}},variants:[{begin:/^>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}XOn.exports=tFi});var tLn=re((luc,eLn)=>{p();function nFi(t){let e={className:"variable",begin:/\$(ADMINTOOLS|APPDATA|CDBURN_AREA|CMDLINE|COMMONFILES32|COMMONFILES64|COMMONFILES|COOKIES|DESKTOP|DOCUMENTS|EXEDIR|EXEFILE|EXEPATH|FAVORITES|FONTS|HISTORY|HWNDPARENT|INSTDIR|INTERNET_CACHE|LANGUAGE|LOCALAPPDATA|MUSIC|NETHOOD|OUTDIR|PICTURES|PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES32|PROGRAMFILES64|PROGRAMFILES|QUICKLAUNCH|RECENT|RESOURCES_LOCALIZED|RESOURCES|SENDTO|SMPROGRAMS|SMSTARTUP|STARTMENU|SYSDIR|TEMP|TEMPLATES|VIDEOS|WINDIR)/},n={className:"variable",begin:/\$+\{[\w.:-]+\}/},r={className:"variable",begin:/\$+\w+/,illegal:/\(\)\{\}/},i={className:"variable",begin:/\$+\([\w^.:-]+\)/},s={className:"params",begin:"(ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)"},o={className:"keyword",begin:/!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|if|ifdef|ifmacrodef|ifmacrondef|ifndef|include|insertmacro|macro|macroend|makensis|packhdr|searchparse|searchreplace|system|tempfile|undef|verbose|warning)/},a={className:"meta",begin:/\$(\\[nrt]|\$)/},c={className:"class",begin:/\w+::\w+/},u={className:"string",variants:[{begin:'"',end:'"'},{begin:"'",end:"'"},{begin:"`",end:"`"}],illegal:/\n/,contains:[a,e,n,r,i]};return{name:"NSIS",case_insensitive:!1,keywords:{keyword:"Abort AddBrandingImage AddSize AllowRootDirInstall AllowSkipFiles AutoCloseWindow BGFont BGGradient BrandingText BringToFront Call CallInstDLL Caption ChangeUI CheckBitmap ClearErrors CompletedText ComponentText CopyFiles CRCCheck CreateDirectory CreateFont CreateShortCut Delete DeleteINISec DeleteINIStr DeleteRegKey DeleteRegValue DetailPrint DetailsButtonText DirText DirVar DirVerify EnableWindow EnumRegKey EnumRegValue Exch Exec ExecShell ExecShellWait ExecWait ExpandEnvStrings File FileBufSize FileClose FileErrorText FileOpen FileRead FileReadByte FileReadUTF16LE FileReadWord FileWriteUTF16LE FileSeek FileWrite FileWriteByte FileWriteWord FindClose FindFirst FindNext FindWindow FlushINI GetCurInstType GetCurrentAddress GetDlgItem GetDLLVersion GetDLLVersionLocal GetErrorLevel GetFileTime GetFileTimeLocal GetFullPathName GetFunctionAddress GetInstDirError GetKnownFolderPath GetLabelAddress GetTempFileName Goto HideWindow Icon IfAbort IfErrors IfFileExists IfRebootFlag IfRtlLanguage IfShellVarContextAll IfSilent InitPluginsDir InstallButtonText InstallColors InstallDir InstallDirRegKey InstProgressFlags InstType InstTypeGetText InstTypeSetText Int64Cmp Int64CmpU Int64Fmt IntCmp IntCmpU IntFmt IntOp IntPtrCmp IntPtrCmpU IntPtrOp IsWindow LangString LicenseBkColor LicenseData LicenseForceSelection LicenseLangString LicenseText LoadAndSetImage LoadLanguageFile LockWindow LogSet LogText ManifestDPIAware ManifestLongPathAware ManifestMaxVersionTested ManifestSupportedOS MessageBox MiscButtonText Name Nop OutFile Page PageCallbacks PEAddResource PEDllCharacteristics PERemoveResource PESubsysVer Pop Push Quit ReadEnvStr ReadINIStr ReadRegDWORD ReadRegStr Reboot RegDLL Rename RequestExecutionLevel ReserveFile Return RMDir SearchPath SectionGetFlags SectionGetInstTypes SectionGetSize SectionGetText SectionIn SectionSetFlags SectionSetInstTypes SectionSetSize SectionSetText SendMessage SetAutoClose SetBrandingImage SetCompress SetCompressor SetCompressorDictSize SetCtlColors SetCurInstType SetDatablockOptimize SetDateSave SetDetailsPrint SetDetailsView SetErrorLevel SetErrors SetFileAttributes SetFont SetOutPath SetOverwrite SetRebootFlag SetRegView SetShellVarContext SetSilent ShowInstDetails ShowUninstDetails ShowWindow SilentInstall SilentUnInstall Sleep SpaceTexts StrCmp StrCmpS StrCpy StrLen SubCaption Unicode UninstallButtonText UninstallCaption UninstallIcon UninstallSubCaption UninstallText UninstPage UnRegDLL Var VIAddVersionKey VIFileVersion VIProductVersion WindowIcon WriteINIStr WriteRegBin WriteRegDWORD WriteRegExpandStr WriteRegMultiStr WriteRegNone WriteRegStr WriteUninstaller XPStyle",literal:"admin all auto both bottom bzip2 colored components current custom directory false force hide highest ifdiff ifnewer instfiles lastused leave left license listonly lzma nevershow none normal notset off on open print right show silent silentlog smooth textonly top true try un.components un.custom un.directory un.instfiles un.license uninstConfirm user Win10 Win7 Win8 WinVista zlib"},contains:[t.HASH_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.COMMENT(";","$",{relevance:0}),{className:"function",beginKeywords:"Function PageEx Section SectionGroup",end:"$"},u,o,n,r,i,s,c,t.NUMBER_MODE]}}eLn.exports=nFi});var rLn=re((duc,nLn)=>{p();function rFi(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={$pattern:n,keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},i={$pattern:n,keyword:"@interface @class @protocol @implementation"};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:r,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+i.keyword.split(" ").join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}nLn.exports=rFi});var sLn=re((muc,iLn)=>{p();function iFi(t){return{name:"OCaml",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:"\\[(\\|\\|)?\\]|\\(\\)",relevance:0},t.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*",relevance:0},t.inherit(t.APOS_STRING_MODE,{className:"string",relevance:0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/->/}]}}iLn.exports=iFi});var aLn=re((fuc,oLn)=>{p();function sFi(t){let e={className:"keyword",begin:"\\$(f[asn]|t|vp[rtd]|children)"},n={className:"literal",begin:"false|true|PI|undef"},r={className:"number",begin:"\\b\\d+(\\.\\d+)?(e-?\\d+)?",relevance:0},i=t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),s={className:"meta",keywords:{"meta-keyword":"include use"},begin:"include|use <",end:">"},o={className:"params",begin:"\\(",end:"\\)",contains:["self",r,i,e,n]},a={begin:"[*!#%]",relevance:0},c={className:"function",beginKeywords:"module function",end:/=|\{/,contains:[o,t.UNDERSCORE_TITLE_MODE]};return{name:"OpenSCAD",aliases:["scad"],keywords:{keyword:"function module include use for intersection_for if else \\%",literal:"false true PI undef",built_in:"circle square polygon text sphere cube cylinder polyhedron translate rotate scale resize mirror multmatrix color offset hull minkowski union difference intersection abs sign sin cos tan acos asin atan atan2 floor round ceil ln log pow sqrt exp rands min max concat lookup str chr search version version_num norm cross parent_module echo import import_dxf dxf_linear_extrude linear_extrude rotate_extrude surface projection render children dxf_cross dxf_dim let assign"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,r,s,i,e,a,c]}}oLn.exports=sFi});var lLn=re((Auc,cLn)=>{p();function oFi(t){let e={$pattern:/\.?\w+/,keyword:"abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained"},n=t.COMMENT(/\{/,/\}/,{relevance:0}),r=t.COMMENT("\\(\\*","\\*\\)",{relevance:10}),i={className:"string",begin:"'",end:"'",contains:[{begin:"''"}]},s={className:"string",begin:"(#\\d+)+"},o={className:"function",beginKeywords:"function constructor destructor procedure method",end:"[:;]",keywords:"function constructor|10 destructor|10 procedure|10 method|10",contains:[t.TITLE_MODE,{className:"params",begin:"\\(",end:"\\)",keywords:e,contains:[i,s]},n,r]};return{name:"Oxygene",case_insensitive:!0,keywords:e,illegal:'("|\\$[G-Zg-z]|\\/\\*||->)',contains:[n,r,t.C_LINE_COMMENT_MODE,i,s,t.NUMBER_MODE,o,{className:"class",begin:"=\\bclass\\b",end:"end;",keywords:e,contains:[i,s,n,r,t.C_LINE_COMMENT_MODE,o]}]}}cLn.exports=oFi});var dLn=re((Euc,uLn)=>{p();function aFi(t){let e=t.COMMENT(/\{/,/\}/,{contains:["self"]});return{name:"Parser3",subLanguage:"xml",relevance:0,contains:[t.COMMENT("^#","$"),t.COMMENT(/\^rem\{/,/\}/,{relevance:10,contains:[e]}),{className:"meta",begin:"^@(?:BASE|USE|CLASS|OPTIONS)$",relevance:10},{className:"title",begin:"@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$"},{className:"variable",begin:/\$\{?[\w\-.:]+\}?/},{className:"keyword",begin:/\^[\w\-.:]+/},{className:"number",begin:"\\^#[0-9a-fA-F]+"},t.C_NUMBER_MODE]}}uLn.exports=aFi});var mLn=re((_uc,pLn)=>{p();function cFi(t){let e={className:"variable",begin:/\$[\w\d#@][\w\d_]*/},n={className:"variable",begin:/<(?!\/)/,end:/>/};return{name:"Packet Filter config",aliases:["pf.conf"],keywords:{$pattern:/[a-z0-9_<>-]+/,built_in:"block match pass load anchor|5 antispoof|10 set table",keyword:"in out log quick on rdomain inet inet6 proto from port os to route allow-opts divert-packet divert-reply divert-to flags group icmp-type icmp6-type label once probability recieved-on rtable prio queue tos tag tagged user keep fragment for os drop af-to|10 binat-to|10 nat-to|10 rdr-to|10 bitmask least-stats random round-robin source-hash static-port dup-to reply-to route-to parent bandwidth default min max qlimit block-policy debug fingerprints hostid limit loginterface optimization reassemble ruleset-optimization basic none profile skip state-defaults state-policy timeout const counters persist no modulate synproxy state|5 floating if-bound no-sync pflow|10 sloppy source-track global rule max-src-nodes max-src-states max-src-conn max-src-conn-rate overload flush scrub|5 max-mss min-ttl no-df|10 random-id",literal:"all any no-route self urpf-failed egress|5 unknown"},contains:[t.HASH_COMMENT_MODE,t.NUMBER_MODE,t.QUOTE_STRING_MODE,e,n]}}pLn.exports=cFi});var fLn=re((Suc,hLn)=>{p();function lFi(t){let e=t.COMMENT("--","$"),n="[a-zA-Z_][a-zA-Z_0-9$]*",r="\\$([a-zA-Z_]?|[a-zA-Z_][a-zA-Z_0-9]*)\\$",i="<<\\s*"+n+"\\s*>>",s="ABORT ALTER ANALYZE BEGIN CALL CHECKPOINT|10 CLOSE CLUSTER COMMENT COMMIT COPY CREATE DEALLOCATE DECLARE DELETE DISCARD DO DROP END EXECUTE EXPLAIN FETCH GRANT IMPORT INSERT LISTEN LOAD LOCK MOVE NOTIFY PREPARE REASSIGN|10 REFRESH REINDEX RELEASE RESET REVOKE ROLLBACK SAVEPOINT SECURITY SELECT SET SHOW START TRUNCATE UNLISTEN|10 UPDATE VACUUM|10 VALUES AGGREGATE COLLATION CONVERSION|10 DATABASE DEFAULT PRIVILEGES DOMAIN TRIGGER EXTENSION FOREIGN WRAPPER|10 TABLE FUNCTION GROUP LANGUAGE LARGE OBJECT MATERIALIZED VIEW OPERATOR CLASS FAMILY POLICY PUBLICATION|10 ROLE RULE SCHEMA SEQUENCE SERVER STATISTICS SUBSCRIPTION SYSTEM TABLESPACE CONFIGURATION DICTIONARY PARSER TEMPLATE TYPE USER MAPPING PREPARED ACCESS METHOD CAST AS TRANSFORM TRANSACTION OWNED TO INTO SESSION AUTHORIZATION INDEX PROCEDURE ASSERTION ALL ANALYSE AND ANY ARRAY ASC ASYMMETRIC|10 BOTH CASE CHECK COLLATE COLUMN CONCURRENTLY|10 CONSTRAINT CROSS DEFERRABLE RANGE DESC DISTINCT ELSE EXCEPT FOR FREEZE|10 FROM FULL HAVING ILIKE IN INITIALLY INNER INTERSECT IS ISNULL JOIN LATERAL LEADING LIKE LIMIT NATURAL NOT NOTNULL NULL OFFSET ON ONLY OR ORDER OUTER OVERLAPS PLACING PRIMARY REFERENCES RETURNING SIMILAR SOME SYMMETRIC TABLESAMPLE THEN TRAILING UNION UNIQUE USING VARIADIC|10 VERBOSE WHEN WHERE WINDOW WITH BY RETURNS INOUT OUT SETOF|10 IF STRICT CURRENT CONTINUE OWNER LOCATION OVER PARTITION WITHIN BETWEEN ESCAPE EXTERNAL INVOKER DEFINER WORK RENAME VERSION CONNECTION CONNECT TABLES TEMP TEMPORARY FUNCTIONS SEQUENCES TYPES SCHEMAS OPTION CASCADE RESTRICT ADD ADMIN EXISTS VALID VALIDATE ENABLE DISABLE REPLICA|10 ALWAYS PASSING COLUMNS PATH REF VALUE OVERRIDING IMMUTABLE STABLE VOLATILE BEFORE AFTER EACH ROW PROCEDURAL ROUTINE NO HANDLER VALIDATOR OPTIONS STORAGE OIDS|10 WITHOUT INHERIT DEPENDS CALLED INPUT LEAKPROOF|10 COST ROWS NOWAIT SEARCH UNTIL ENCRYPTED|10 PASSWORD CONFLICT|10 INSTEAD INHERITS CHARACTERISTICS WRITE CURSOR ALSO STATEMENT SHARE EXCLUSIVE INLINE ISOLATION REPEATABLE READ COMMITTED SERIALIZABLE UNCOMMITTED LOCAL GLOBAL SQL PROCEDURES RECURSIVE SNAPSHOT ROLLUP CUBE TRUSTED|10 INCLUDE FOLLOWING PRECEDING UNBOUNDED RANGE GROUPS UNENCRYPTED|10 SYSID FORMAT DELIMITER HEADER QUOTE ENCODING FILTER OFF FORCE_QUOTE FORCE_NOT_NULL FORCE_NULL COSTS BUFFERS TIMING SUMMARY DISABLE_PAGE_SKIPPING RESTART CYCLE GENERATED IDENTITY DEFERRED IMMEDIATE LEVEL LOGGED UNLOGGED OF NOTHING NONE EXCLUDE ATTRIBUTE USAGE ROUTINES TRUE FALSE NAN INFINITY ",o="SUPERUSER NOSUPERUSER CREATEDB NOCREATEDB CREATEROLE NOCREATEROLE INHERIT NOINHERIT LOGIN NOLOGIN REPLICATION NOREPLICATION BYPASSRLS NOBYPASSRLS ",a="ALIAS BEGIN CONSTANT DECLARE END EXCEPTION RETURN PERFORM|10 RAISE GET DIAGNOSTICS STACKED|10 FOREACH LOOP ELSIF EXIT WHILE REVERSE SLICE DEBUG LOG INFO NOTICE WARNING ASSERT OPEN ",c="BIGINT INT8 BIGSERIAL SERIAL8 BIT VARYING VARBIT BOOLEAN BOOL BOX BYTEA CHARACTER CHAR VARCHAR CIDR CIRCLE DATE DOUBLE PRECISION FLOAT8 FLOAT INET INTEGER INT INT4 INTERVAL JSON JSONB LINE LSEG|10 MACADDR MACADDR8 MONEY NUMERIC DEC DECIMAL PATH POINT POLYGON REAL FLOAT4 SMALLINT INT2 SMALLSERIAL|10 SERIAL2|10 SERIAL|10 SERIAL4|10 TEXT TIME ZONE TIMETZ|10 TIMESTAMP TIMESTAMPTZ|10 TSQUERY|10 TSVECTOR|10 TXID_SNAPSHOT|10 UUID XML NATIONAL NCHAR INT4RANGE|10 INT8RANGE|10 NUMRANGE|10 TSRANGE|10 TSTZRANGE|10 DATERANGE|10 ANYELEMENT ANYARRAY ANYNONARRAY ANYENUM ANYRANGE CSTRING INTERNAL RECORD PG_DDL_COMMAND VOID UNKNOWN OPAQUE REFCURSOR NAME OID REGPROC|10 REGPROCEDURE|10 REGOPER|10 REGOPERATOR|10 REGCLASS|10 REGTYPE|10 REGROLE|10 REGNAMESPACE|10 REGCONFIG|10 REGDICTIONARY|10 ",u=c.trim().split(" ").map(function(g){return g.split("|")[0]}).join("|"),l="CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURRENT_CATALOG|10 CURRENT_DATE LOCALTIME LOCALTIMESTAMP CURRENT_ROLE|10 CURRENT_SCHEMA|10 SESSION_USER PUBLIC ",d="FOUND NEW OLD TG_NAME|10 TG_WHEN|10 TG_LEVEL|10 TG_OP|10 TG_RELID|10 TG_RELNAME|10 TG_TABLE_NAME|10 TG_TABLE_SCHEMA|10 TG_NARGS|10 TG_ARGV|10 TG_EVENT|10 TG_TAG|10 ROW_COUNT RESULT_OID|10 PG_CONTEXT|10 RETURNED_SQLSTATE COLUMN_NAME CONSTRAINT_NAME PG_DATATYPE_NAME|10 MESSAGE_TEXT TABLE_NAME SCHEMA_NAME PG_EXCEPTION_DETAIL|10 PG_EXCEPTION_HINT|10 PG_EXCEPTION_CONTEXT|10 ",m="SQLSTATE SQLERRM|10 SUCCESSFUL_COMPLETION WARNING DYNAMIC_RESULT_SETS_RETURNED IMPLICIT_ZERO_BIT_PADDING NULL_VALUE_ELIMINATED_IN_SET_FUNCTION PRIVILEGE_NOT_GRANTED PRIVILEGE_NOT_REVOKED STRING_DATA_RIGHT_TRUNCATION DEPRECATED_FEATURE NO_DATA NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED SQL_STATEMENT_NOT_YET_COMPLETE CONNECTION_EXCEPTION CONNECTION_DOES_NOT_EXIST CONNECTION_FAILURE SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION TRANSACTION_RESOLUTION_UNKNOWN PROTOCOL_VIOLATION TRIGGERED_ACTION_EXCEPTION FEATURE_NOT_SUPPORTED INVALID_TRANSACTION_INITIATION LOCATOR_EXCEPTION INVALID_LOCATOR_SPECIFICATION INVALID_GRANTOR INVALID_GRANT_OPERATION INVALID_ROLE_SPECIFICATION DIAGNOSTICS_EXCEPTION STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER CASE_NOT_FOUND CARDINALITY_VIOLATION DATA_EXCEPTION ARRAY_SUBSCRIPT_ERROR CHARACTER_NOT_IN_REPERTOIRE DATETIME_FIELD_OVERFLOW DIVISION_BY_ZERO ERROR_IN_ASSIGNMENT ESCAPE_CHARACTER_CONFLICT INDICATOR_OVERFLOW INTERVAL_FIELD_OVERFLOW INVALID_ARGUMENT_FOR_LOGARITHM INVALID_ARGUMENT_FOR_NTILE_FUNCTION INVALID_ARGUMENT_FOR_NTH_VALUE_FUNCTION INVALID_ARGUMENT_FOR_POWER_FUNCTION INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION INVALID_CHARACTER_VALUE_FOR_CAST INVALID_DATETIME_FORMAT INVALID_ESCAPE_CHARACTER INVALID_ESCAPE_OCTET INVALID_ESCAPE_SEQUENCE NONSTANDARD_USE_OF_ESCAPE_CHARACTER INVALID_INDICATOR_PARAMETER_VALUE INVALID_PARAMETER_VALUE INVALID_REGULAR_EXPRESSION INVALID_ROW_COUNT_IN_LIMIT_CLAUSE INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE INVALID_TABLESAMPLE_ARGUMENT INVALID_TABLESAMPLE_REPEAT INVALID_TIME_ZONE_DISPLACEMENT_VALUE INVALID_USE_OF_ESCAPE_CHARACTER MOST_SPECIFIC_TYPE_MISMATCH NULL_VALUE_NOT_ALLOWED NULL_VALUE_NO_INDICATOR_PARAMETER NUMERIC_VALUE_OUT_OF_RANGE SEQUENCE_GENERATOR_LIMIT_EXCEEDED STRING_DATA_LENGTH_MISMATCH STRING_DATA_RIGHT_TRUNCATION SUBSTRING_ERROR TRIM_ERROR UNTERMINATED_C_STRING ZERO_LENGTH_CHARACTER_STRING FLOATING_POINT_EXCEPTION INVALID_TEXT_REPRESENTATION INVALID_BINARY_REPRESENTATION BAD_COPY_FILE_FORMAT UNTRANSLATABLE_CHARACTER NOT_AN_XML_DOCUMENT INVALID_XML_DOCUMENT INVALID_XML_CONTENT INVALID_XML_COMMENT INVALID_XML_PROCESSING_INSTRUCTION INTEGRITY_CONSTRAINT_VIOLATION RESTRICT_VIOLATION NOT_NULL_VIOLATION FOREIGN_KEY_VIOLATION UNIQUE_VIOLATION CHECK_VIOLATION EXCLUSION_VIOLATION INVALID_CURSOR_STATE INVALID_TRANSACTION_STATE ACTIVE_SQL_TRANSACTION BRANCH_TRANSACTION_ALREADY_ACTIVE HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION READ_ONLY_SQL_TRANSACTION SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED NO_ACTIVE_SQL_TRANSACTION IN_FAILED_SQL_TRANSACTION IDLE_IN_TRANSACTION_SESSION_TIMEOUT INVALID_SQL_STATEMENT_NAME TRIGGERED_DATA_CHANGE_VIOLATION INVALID_AUTHORIZATION_SPECIFICATION INVALID_PASSWORD DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST DEPENDENT_OBJECTS_STILL_EXIST INVALID_TRANSACTION_TERMINATION SQL_ROUTINE_EXCEPTION FUNCTION_EXECUTED_NO_RETURN_STATEMENT MODIFYING_SQL_DATA_NOT_PERMITTED PROHIBITED_SQL_STATEMENT_ATTEMPTED READING_SQL_DATA_NOT_PERMITTED INVALID_CURSOR_NAME EXTERNAL_ROUTINE_EXCEPTION CONTAINING_SQL_NOT_PERMITTED MODIFYING_SQL_DATA_NOT_PERMITTED PROHIBITED_SQL_STATEMENT_ATTEMPTED READING_SQL_DATA_NOT_PERMITTED EXTERNAL_ROUTINE_INVOCATION_EXCEPTION INVALID_SQLSTATE_RETURNED NULL_VALUE_NOT_ALLOWED TRIGGER_PROTOCOL_VIOLATED SRF_PROTOCOL_VIOLATED EVENT_TRIGGER_PROTOCOL_VIOLATED SAVEPOINT_EXCEPTION INVALID_SAVEPOINT_SPECIFICATION INVALID_CATALOG_NAME INVALID_SCHEMA_NAME TRANSACTION_ROLLBACK TRANSACTION_INTEGRITY_CONSTRAINT_VIOLATION SERIALIZATION_FAILURE STATEMENT_COMPLETION_UNKNOWN DEADLOCK_DETECTED SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION SYNTAX_ERROR INSUFFICIENT_PRIVILEGE CANNOT_COERCE GROUPING_ERROR WINDOWING_ERROR INVALID_RECURSION INVALID_FOREIGN_KEY INVALID_NAME NAME_TOO_LONG RESERVED_NAME DATATYPE_MISMATCH INDETERMINATE_DATATYPE COLLATION_MISMATCH INDETERMINATE_COLLATION WRONG_OBJECT_TYPE GENERATED_ALWAYS UNDEFINED_COLUMN UNDEFINED_FUNCTION UNDEFINED_TABLE UNDEFINED_PARAMETER UNDEFINED_OBJECT DUPLICATE_COLUMN DUPLICATE_CURSOR DUPLICATE_DATABASE DUPLICATE_FUNCTION DUPLICATE_PREPARED_STATEMENT DUPLICATE_SCHEMA DUPLICATE_TABLE DUPLICATE_ALIAS DUPLICATE_OBJECT AMBIGUOUS_COLUMN AMBIGUOUS_FUNCTION AMBIGUOUS_PARAMETER AMBIGUOUS_ALIAS INVALID_COLUMN_REFERENCE INVALID_COLUMN_DEFINITION INVALID_CURSOR_DEFINITION INVALID_DATABASE_DEFINITION INVALID_FUNCTION_DEFINITION INVALID_PREPARED_STATEMENT_DEFINITION INVALID_SCHEMA_DEFINITION INVALID_TABLE_DEFINITION INVALID_OBJECT_DEFINITION WITH_CHECK_OPTION_VIOLATION INSUFFICIENT_RESOURCES DISK_FULL OUT_OF_MEMORY TOO_MANY_CONNECTIONS CONFIGURATION_LIMIT_EXCEEDED PROGRAM_LIMIT_EXCEEDED STATEMENT_TOO_COMPLEX TOO_MANY_COLUMNS TOO_MANY_ARGUMENTS OBJECT_NOT_IN_PREREQUISITE_STATE OBJECT_IN_USE CANT_CHANGE_RUNTIME_PARAM LOCK_NOT_AVAILABLE OPERATOR_INTERVENTION QUERY_CANCELED ADMIN_SHUTDOWN CRASH_SHUTDOWN CANNOT_CONNECT_NOW DATABASE_DROPPED SYSTEM_ERROR IO_ERROR UNDEFINED_FILE DUPLICATE_FILE SNAPSHOT_TOO_OLD CONFIG_FILE_ERROR LOCK_FILE_EXISTS FDW_ERROR FDW_COLUMN_NAME_NOT_FOUND FDW_DYNAMIC_PARAMETER_VALUE_NEEDED FDW_FUNCTION_SEQUENCE_ERROR FDW_INCONSISTENT_DESCRIPTOR_INFORMATION FDW_INVALID_ATTRIBUTE_VALUE FDW_INVALID_COLUMN_NAME FDW_INVALID_COLUMN_NUMBER FDW_INVALID_DATA_TYPE FDW_INVALID_DATA_TYPE_DESCRIPTORS FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER FDW_INVALID_HANDLE FDW_INVALID_OPTION_INDEX FDW_INVALID_OPTION_NAME FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH FDW_INVALID_STRING_FORMAT FDW_INVALID_USE_OF_NULL_POINTER FDW_TOO_MANY_HANDLES FDW_OUT_OF_MEMORY FDW_NO_SCHEMAS FDW_OPTION_NAME_NOT_FOUND FDW_REPLY_HANDLE FDW_SCHEMA_NOT_FOUND FDW_TABLE_NOT_FOUND FDW_UNABLE_TO_CREATE_EXECUTION FDW_UNABLE_TO_CREATE_REPLY FDW_UNABLE_TO_ESTABLISH_CONNECTION PLPGSQL_ERROR RAISE_EXCEPTION NO_DATA_FOUND TOO_MANY_ROWS ASSERT_FAILURE INTERNAL_ERROR DATA_CORRUPTED INDEX_CORRUPTED ",f="ARRAY_AGG AVG BIT_AND BIT_OR BOOL_AND BOOL_OR COUNT EVERY JSON_AGG JSONB_AGG JSON_OBJECT_AGG JSONB_OBJECT_AGG MAX MIN MODE STRING_AGG SUM XMLAGG CORR COVAR_POP COVAR_SAMP REGR_AVGX REGR_AVGY REGR_COUNT REGR_INTERCEPT REGR_R2 REGR_SLOPE REGR_SXX REGR_SXY REGR_SYY STDDEV STDDEV_POP STDDEV_SAMP VARIANCE VAR_POP VAR_SAMP PERCENTILE_CONT PERCENTILE_DISC ROW_NUMBER RANK DENSE_RANK PERCENT_RANK CUME_DIST NTILE LAG LEAD FIRST_VALUE LAST_VALUE NTH_VALUE NUM_NONNULLS NUM_NULLS ABS CBRT CEIL CEILING DEGREES DIV EXP FLOOR LN LOG MOD PI POWER RADIANS ROUND SCALE SIGN SQRT TRUNC WIDTH_BUCKET RANDOM SETSEED ACOS ACOSD ASIN ASIND ATAN ATAND ATAN2 ATAN2D COS COSD COT COTD SIN SIND TAN TAND BIT_LENGTH CHAR_LENGTH CHARACTER_LENGTH LOWER OCTET_LENGTH OVERLAY POSITION SUBSTRING TREAT TRIM UPPER ASCII BTRIM CHR CONCAT CONCAT_WS CONVERT CONVERT_FROM CONVERT_TO DECODE ENCODE INITCAP LEFT LENGTH LPAD LTRIM MD5 PARSE_IDENT PG_CLIENT_ENCODING QUOTE_IDENT|10 QUOTE_LITERAL|10 QUOTE_NULLABLE|10 REGEXP_MATCH REGEXP_MATCHES REGEXP_REPLACE REGEXP_SPLIT_TO_ARRAY REGEXP_SPLIT_TO_TABLE REPEAT REPLACE REVERSE RIGHT RPAD RTRIM SPLIT_PART STRPOS SUBSTR TO_ASCII TO_HEX TRANSLATE OCTET_LENGTH GET_BIT GET_BYTE SET_BIT SET_BYTE TO_CHAR TO_DATE TO_NUMBER TO_TIMESTAMP AGE CLOCK_TIMESTAMP|10 DATE_PART DATE_TRUNC ISFINITE JUSTIFY_DAYS JUSTIFY_HOURS JUSTIFY_INTERVAL MAKE_DATE MAKE_INTERVAL|10 MAKE_TIME MAKE_TIMESTAMP|10 MAKE_TIMESTAMPTZ|10 NOW STATEMENT_TIMESTAMP|10 TIMEOFDAY TRANSACTION_TIMESTAMP|10 ENUM_FIRST ENUM_LAST ENUM_RANGE AREA CENTER DIAMETER HEIGHT ISCLOSED ISOPEN NPOINTS PCLOSE POPEN RADIUS WIDTH BOX BOUND_BOX CIRCLE LINE LSEG PATH POLYGON ABBREV BROADCAST HOST HOSTMASK MASKLEN NETMASK NETWORK SET_MASKLEN TEXT INET_SAME_FAMILY INET_MERGE MACADDR8_SET7BIT ARRAY_TO_TSVECTOR GET_CURRENT_TS_CONFIG NUMNODE PLAINTO_TSQUERY PHRASETO_TSQUERY WEBSEARCH_TO_TSQUERY QUERYTREE SETWEIGHT STRIP TO_TSQUERY TO_TSVECTOR JSON_TO_TSVECTOR JSONB_TO_TSVECTOR TS_DELETE TS_FILTER TS_HEADLINE TS_RANK TS_RANK_CD TS_REWRITE TSQUERY_PHRASE TSVECTOR_TO_ARRAY TSVECTOR_UPDATE_TRIGGER TSVECTOR_UPDATE_TRIGGER_COLUMN XMLCOMMENT XMLCONCAT XMLELEMENT XMLFOREST XMLPI XMLROOT XMLEXISTS XML_IS_WELL_FORMED XML_IS_WELL_FORMED_DOCUMENT XML_IS_WELL_FORMED_CONTENT XPATH XPATH_EXISTS XMLTABLE XMLNAMESPACES TABLE_TO_XML TABLE_TO_XMLSCHEMA TABLE_TO_XML_AND_XMLSCHEMA QUERY_TO_XML QUERY_TO_XMLSCHEMA QUERY_TO_XML_AND_XMLSCHEMA CURSOR_TO_XML CURSOR_TO_XMLSCHEMA SCHEMA_TO_XML SCHEMA_TO_XMLSCHEMA SCHEMA_TO_XML_AND_XMLSCHEMA DATABASE_TO_XML DATABASE_TO_XMLSCHEMA DATABASE_TO_XML_AND_XMLSCHEMA XMLATTRIBUTES TO_JSON TO_JSONB ARRAY_TO_JSON ROW_TO_JSON JSON_BUILD_ARRAY JSONB_BUILD_ARRAY JSON_BUILD_OBJECT JSONB_BUILD_OBJECT JSON_OBJECT JSONB_OBJECT JSON_ARRAY_LENGTH JSONB_ARRAY_LENGTH JSON_EACH JSONB_EACH JSON_EACH_TEXT JSONB_EACH_TEXT JSON_EXTRACT_PATH JSONB_EXTRACT_PATH JSON_OBJECT_KEYS JSONB_OBJECT_KEYS JSON_POPULATE_RECORD JSONB_POPULATE_RECORD JSON_POPULATE_RECORDSET JSONB_POPULATE_RECORDSET JSON_ARRAY_ELEMENTS JSONB_ARRAY_ELEMENTS JSON_ARRAY_ELEMENTS_TEXT JSONB_ARRAY_ELEMENTS_TEXT JSON_TYPEOF JSONB_TYPEOF JSON_TO_RECORD JSONB_TO_RECORD JSON_TO_RECORDSET JSONB_TO_RECORDSET JSON_STRIP_NULLS JSONB_STRIP_NULLS JSONB_SET JSONB_INSERT JSONB_PRETTY CURRVAL LASTVAL NEXTVAL SETVAL COALESCE NULLIF GREATEST LEAST ARRAY_APPEND ARRAY_CAT ARRAY_NDIMS ARRAY_DIMS ARRAY_FILL ARRAY_LENGTH ARRAY_LOWER ARRAY_POSITION ARRAY_POSITIONS ARRAY_PREPEND ARRAY_REMOVE ARRAY_REPLACE ARRAY_TO_STRING ARRAY_UPPER CARDINALITY STRING_TO_ARRAY UNNEST ISEMPTY LOWER_INC UPPER_INC LOWER_INF UPPER_INF RANGE_MERGE GENERATE_SERIES GENERATE_SUBSCRIPTS CURRENT_DATABASE CURRENT_QUERY CURRENT_SCHEMA|10 CURRENT_SCHEMAS|10 INET_CLIENT_ADDR INET_CLIENT_PORT INET_SERVER_ADDR INET_SERVER_PORT ROW_SECURITY_ACTIVE FORMAT_TYPE TO_REGCLASS TO_REGPROC TO_REGPROCEDURE TO_REGOPER TO_REGOPERATOR TO_REGTYPE TO_REGNAMESPACE TO_REGROLE COL_DESCRIPTION OBJ_DESCRIPTION SHOBJ_DESCRIPTION TXID_CURRENT TXID_CURRENT_IF_ASSIGNED TXID_CURRENT_SNAPSHOT TXID_SNAPSHOT_XIP TXID_SNAPSHOT_XMAX TXID_SNAPSHOT_XMIN TXID_VISIBLE_IN_SNAPSHOT TXID_STATUS CURRENT_SETTING SET_CONFIG BRIN_SUMMARIZE_NEW_VALUES BRIN_SUMMARIZE_RANGE BRIN_DESUMMARIZE_RANGE GIN_CLEAN_PENDING_LIST SUPPRESS_REDUNDANT_UPDATES_TRIGGER LO_FROM_BYTEA LO_PUT LO_GET LO_CREAT LO_CREATE LO_UNLINK LO_IMPORT LO_EXPORT LOREAD LOWRITE GROUPING CAST ".trim().split(" ").map(function(g){return g.split("|")[0]}).join("|");return{name:"PostgreSQL",aliases:["postgres","postgresql"],case_insensitive:!0,keywords:{keyword:s+a+o,built_in:l+d+m},illegal:/:==|\W\s*\(\*|(^|\s)\$[a-z]|\{\{|[a-z]:\s*$|\.\.\.|TO:|DO:/,contains:[{className:"keyword",variants:[{begin:/\bTEXT\s*SEARCH\b/},{begin:/\b(PRIMARY|FOREIGN|FOR(\s+NO)?)\s+KEY\b/},{begin:/\bPARALLEL\s+(UNSAFE|RESTRICTED|SAFE)\b/},{begin:/\bSTORAGE\s+(PLAIN|EXTERNAL|EXTENDED|MAIN)\b/},{begin:/\bMATCH\s+(FULL|PARTIAL|SIMPLE)\b/},{begin:/\bNULLS\s+(FIRST|LAST)\b/},{begin:/\bEVENT\s+TRIGGER\b/},{begin:/\b(MAPPING|OR)\s+REPLACE\b/},{begin:/\b(FROM|TO)\s+(PROGRAM|STDIN|STDOUT)\b/},{begin:/\b(SHARE|EXCLUSIVE)\s+MODE\b/},{begin:/\b(LEFT|RIGHT)\s+(OUTER\s+)?JOIN\b/},{begin:/\b(FETCH|MOVE)\s+(NEXT|PRIOR|FIRST|LAST|ABSOLUTE|RELATIVE|FORWARD|BACKWARD)\b/},{begin:/\bPRESERVE\s+ROWS\b/},{begin:/\bDISCARD\s+PLANS\b/},{begin:/\bREFERENCING\s+(OLD|NEW)\b/},{begin:/\bSKIP\s+LOCKED\b/},{begin:/\bGROUPING\s+SETS\b/},{begin:/\b(BINARY|INSENSITIVE|SCROLL|NO\s+SCROLL)\s+(CURSOR|FOR)\b/},{begin:/\b(WITH|WITHOUT)\s+HOLD\b/},{begin:/\bWITH\s+(CASCADED|LOCAL)\s+CHECK\s+OPTION\b/},{begin:/\bEXCLUDE\s+(TIES|NO\s+OTHERS)\b/},{begin:/\bFORMAT\s+(TEXT|XML|JSON|YAML)\b/},{begin:/\bSET\s+((SESSION|LOCAL)\s+)?NAMES\b/},{begin:/\bIS\s+(NOT\s+)?UNKNOWN\b/},{begin:/\bSECURITY\s+LABEL\b/},{begin:/\bSTANDALONE\s+(YES|NO|NO\s+VALUE)\b/},{begin:/\bWITH\s+(NO\s+)?DATA\b/},{begin:/\b(FOREIGN|SET)\s+DATA\b/},{begin:/\bSET\s+(CATALOG|CONSTRAINTS)\b/},{begin:/\b(WITH|FOR)\s+ORDINALITY\b/},{begin:/\bIS\s+(NOT\s+)?DOCUMENT\b/},{begin:/\bXML\s+OPTION\s+(DOCUMENT|CONTENT)\b/},{begin:/\b(STRIP|PRESERVE)\s+WHITESPACE\b/},{begin:/\bNO\s+(ACTION|MAXVALUE|MINVALUE)\b/},{begin:/\bPARTITION\s+BY\s+(RANGE|LIST|HASH)\b/},{begin:/\bAT\s+TIME\s+ZONE\b/},{begin:/\bGRANTED\s+BY\b/},{begin:/\bRETURN\s+(QUERY|NEXT)\b/},{begin:/\b(ATTACH|DETACH)\s+PARTITION\b/},{begin:/\bFORCE\s+ROW\s+LEVEL\s+SECURITY\b/},{begin:/\b(INCLUDING|EXCLUDING)\s+(COMMENTS|CONSTRAINTS|DEFAULTS|IDENTITY|INDEXES|STATISTICS|STORAGE|ALL)\b/},{begin:/\bAS\s+(ASSIGNMENT|IMPLICIT|PERMISSIVE|RESTRICTIVE|ENUM|RANGE)\b/}]},{begin:/\b(FORMAT|FAMILY|VERSION)\s*\(/},{begin:/\bINCLUDE\s*\(/,keywords:"INCLUDE"},{begin:/\bRANGE(?!\s*(BETWEEN|UNBOUNDED|CURRENT|[-0-9]+))/},{begin:/\b(VERSION|OWNER|TEMPLATE|TABLESPACE|CONNECTION\s+LIMIT|PROCEDURE|RESTRICT|JOIN|PARSER|COPY|START|END|COLLATION|INPUT|ANALYZE|STORAGE|LIKE|DEFAULT|DELIMITER|ENCODING|COLUMN|CONSTRAINT|TABLE|SCHEMA)\s*=/},{begin:/\b(PG_\w+?|HAS_[A-Z_]+_PRIVILEGE)\b/,relevance:10},{begin:/\bEXTRACT\s*\(/,end:/\bFROM\b/,returnEnd:!0,keywords:{type:"CENTURY DAY DECADE DOW DOY EPOCH HOUR ISODOW ISOYEAR MICROSECONDS MILLENNIUM MILLISECONDS MINUTE MONTH QUARTER SECOND TIMEZONE TIMEZONE_HOUR TIMEZONE_MINUTE WEEK YEAR"}},{begin:/\b(XMLELEMENT|XMLPI)\s*\(\s*NAME/,keywords:{keyword:"NAME"}},{begin:/\b(XMLPARSE|XMLSERIALIZE)\s*\(\s*(DOCUMENT|CONTENT)/,keywords:{keyword:"DOCUMENT CONTENT"}},{beginKeywords:"CACHE INCREMENT MAXVALUE MINVALUE",end:t.C_NUMBER_RE,returnEnd:!0,keywords:"BY CACHE INCREMENT MAXVALUE MINVALUE"},{className:"type",begin:/\b(WITH|WITHOUT)\s+TIME\s+ZONE\b/},{className:"type",begin:/\bINTERVAL\s+(YEAR|MONTH|DAY|HOUR|MINUTE|SECOND)(\s+TO\s+(MONTH|HOUR|MINUTE|SECOND))?\b/},{begin:/\bRETURNS\s+(LANGUAGE_HANDLER|TRIGGER|EVENT_TRIGGER|FDW_HANDLER|INDEX_AM_HANDLER|TSM_HANDLER)\b/,keywords:{keyword:"RETURNS",type:"LANGUAGE_HANDLER TRIGGER EVENT_TRIGGER FDW_HANDLER INDEX_AM_HANDLER TSM_HANDLER"}},{begin:"\\b("+f+")\\s*\\("},{begin:"\\.("+u+")\\b"},{begin:"\\b("+u+")\\s+PATH\\b",keywords:{keyword:"PATH",type:c.replace("PATH ","")}},{className:"type",begin:"\\b("+u+")\\b"},{className:"string",begin:"'",end:"'",contains:[{begin:"''"}]},{className:"string",begin:"(e|E|u&|U&)'",end:"'",contains:[{begin:"\\\\."}],relevance:10},t.END_SAME_AS_BEGIN({begin:r,end:r,contains:[{subLanguage:["pgsql","perl","python","tcl","r","lua","java","php","ruby","bash","scheme","xml","json"],endsWithParent:!0}]}),{begin:'"',end:'"',contains:[{begin:'""'}]},t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,e,{className:"meta",variants:[{begin:"%(ROW)?TYPE",relevance:10},{begin:"\\$\\d+"},{begin:"^#\\w",end:"$"}]},{className:"symbol",begin:i,relevance:10}]}}hLn.exports=lFi});var ALn=re((Iuc,gLn)=>{p();function uFi(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}gLn.exports=uFi});var ELn=re((Tuc,yLn)=>{p();function dFi(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}yLn.exports=dFi});var _Ln=re((Ruc,bLn)=>{p();function pFi(t){let e={keyword:"actor addressof and as be break class compile_error compile_intrinsic consume continue delegate digestof do else elseif embed end error for fun if ifdef in interface is isnt lambda let match new not object or primitive recover repeat return struct then trait try type until use var where while with xor",meta:"iso val tag trn box ref",literal:"this false true"},n={className:"string",begin:'"""',end:'"""',relevance:10},r={className:"string",begin:'"',end:'"',contains:[t.BACKSLASH_ESCAPE]},i={className:"string",begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE],relevance:0},s={className:"type",begin:"\\b_?[A-Z][\\w]*",relevance:0},o={begin:t.IDENT_RE+"'",relevance:0};return{name:"Pony",keywords:e,contains:[s,n,r,i,o,{className:"number",begin:"(-?)(\\b0[xX][a-fA-F0-9]+|\\b0[bB][01]+|(\\b\\d+(_\\d+)?(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",relevance:0},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]}}bLn.exports=pFi});var SLn=re((Buc,xLn)=>{p();function mFi(t){let e=["string","char","byte","int","long","bool","decimal","single","double","DateTime","xml","array","hashtable","void"],n="Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where",r="-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|-split|-wildcard|-xor",i={$pattern:/-?[A-z\.\-]+\b/,keyword:"if else foreach return do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch hidden static parameter",built_in:"ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write"},s=/\w[\w\d]*((-)[\w\d]+)*/,o={begin:"`[\\s\\S]",relevance:0},a={className:"variable",variants:[{begin:/\$\B/},{className:"keyword",begin:/\$this/},{begin:/\$[\w\d][\w\d_:]*/}]},c={className:"literal",begin:/\$(null|true|false)\b/},u={className:"string",variants:[{begin:/"/,end:/"/},{begin:/@"/,end:/^"@/}],contains:[o,a,{className:"variable",begin:/\$[A-z]/,end:/[^A-z]/}]},l={className:"string",variants:[{begin:/'/,end:/'/},{begin:/@'/,end:/^'@/}]},d={className:"doctag",variants:[{begin:/\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/},{begin:/\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\s+\S+/}]},m=t.inherit(t.COMMENT(null,null),{variants:[{begin:/#/,end:/$/},{begin:/<#/,end:/#>/}],contains:[d]}),h={className:"built_in",variants:[{begin:"(".concat(n,")+(-)[\\w\\d]+")}]},f={className:"class",beginKeywords:"class enum",end:/\s*[{]/,excludeEnd:!0,relevance:0,contains:[t.TITLE_MODE]},g={className:"function",begin:/function\s+/,end:/\s*\{|$/,excludeEnd:!0,returnBegin:!0,relevance:0,contains:[{begin:"function",relevance:0,className:"keyword"},{className:"title",begin:s,relevance:0},{begin:/\(/,end:/\)/,className:"params",relevance:0,contains:[a]}]},A={begin:/using\s/,end:/$/,returnBegin:!0,contains:[u,l,{className:"keyword",begin:/(using|assembly|command|module|namespace|type)/}]},y={variants:[{className:"operator",begin:"(".concat(r,")\\b")},{className:"literal",begin:/(-)[\w\d]+/,relevance:0}]},E={className:"selector-tag",begin:/@\B/,relevance:0},_={className:"function",begin:/\[.*\]\s*[\w]+[ ]??\(/,end:/$/,returnBegin:!0,relevance:0,contains:[{className:"keyword",begin:"(".concat(i.keyword.toString().replace(/\s/g,"|"),")\\b"),endsParent:!0,relevance:0},t.inherit(t.TITLE_MODE,{endsParent:!0})]},S=[_,m,o,t.NUMBER_MODE,u,l,h,a,c,E],C={begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[].concat("self",S,{begin:"("+e.join("|")+")",className:"built_in",relevance:0},{className:"type",begin:/[\.\w\d]+/,relevance:0})};return _.contains.unshift(C),{name:"PowerShell",aliases:["ps","ps1"],case_insensitive:!0,keywords:i,contains:S.concat(f,g,A,y,C)}}xLn.exports=mFi});var ILn=re((Duc,CLn)=>{p();function hFi(t){return{name:"Processing",keywords:{keyword:"BufferedReader PVector PFont PImage PGraphics HashMap boolean byte char color double float int long String Array FloatDict FloatList IntDict IntList JSONArray JSONObject Object StringDict StringList Table TableRow XML false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",literal:"P2D P3D HALF_PI PI QUARTER_PI TAU TWO_PI",title:"setup draw",built_in:"displayHeight displayWidth mouseY mouseX mousePressed pmouseX pmouseY key keyCode pixels focused frameCount frameRate height width size createGraphics beginDraw createShape loadShape PShape arc ellipse line point quad rect triangle bezier bezierDetail bezierPoint bezierTangent curve curveDetail curvePoint curveTangent curveTightness shape shapeMode beginContour beginShape bezierVertex curveVertex endContour endShape quadraticVertex vertex ellipseMode noSmooth rectMode smooth strokeCap strokeJoin strokeWeight mouseClicked mouseDragged mouseMoved mousePressed mouseReleased mouseWheel keyPressed keyPressedkeyReleased keyTyped print println save saveFrame day hour millis minute month second year background clear colorMode fill noFill noStroke stroke alpha blue brightness color green hue lerpColor red saturation modelX modelY modelZ screenX screenY screenZ ambient emissive shininess specular add createImage beginCamera camera endCamera frustum ortho perspective printCamera printProjection cursor frameRate noCursor exit loop noLoop popStyle pushStyle redraw binary boolean byte char float hex int str unbinary unhex join match matchAll nf nfc nfp nfs split splitTokens trim append arrayCopy concat expand reverse shorten sort splice subset box sphere sphereDetail createInput createReader loadBytes loadJSONArray loadJSONObject loadStrings loadTable loadXML open parseXML saveTable selectFolder selectInput beginRaw beginRecord createOutput createWriter endRaw endRecord PrintWritersaveBytes saveJSONArray saveJSONObject saveStream saveStrings saveXML selectOutput popMatrix printMatrix pushMatrix resetMatrix rotate rotateX rotateY rotateZ scale shearX shearY translate ambientLight directionalLight lightFalloff lights lightSpecular noLights normal pointLight spotLight image imageMode loadImage noTint requestImage tint texture textureMode textureWrap blend copy filter get loadPixels set updatePixels blendMode loadShader PShaderresetShader shader createFont loadFont text textFont textAlign textLeading textMode textSize textWidth textAscent textDescent abs ceil constrain dist exp floor lerp log mag map max min norm pow round sq sqrt acos asin atan atan2 cos degrees radians sin tan noise noiseDetail noiseSeed random randomGaussian randomSeed"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE]}}CLn.exports=hFi});var TLn=re((Muc,wLn)=>{p();function fFi(t){return{name:"Python profiler",contains:[t.C_NUMBER_MODE,{begin:"[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}",end:":",excludeEnd:!0},{begin:"(ncalls|tottime|cumtime)",end:"$",keywords:"ncalls tottime|10 cumtime|10 filename",relevance:10},{begin:"function calls",end:"$",contains:[t.C_NUMBER_MODE],relevance:10},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:"\\(",end:"\\)$",excludeBegin:!0,excludeEnd:!0,relevance:0}]}}wLn.exports=fFi});var RLn=re((Luc,vLn)=>{p();function gFi(t){let e={begin:/[a-z][A-Za-z0-9_]*/,relevance:0},n={className:"symbol",variants:[{begin:/[A-Z][a-zA-Z0-9_]*/},{begin:/_[A-Za-z0-9_]*/}],relevance:0},r={begin:/\(/,end:/\)/,relevance:0},i={begin:/\[/,end:/\]/},s={className:"comment",begin:/%/,end:/$/,contains:[t.PHRASAL_WORDS_MODE]},o={className:"string",begin:/`/,end:/`/,contains:[t.BACKSLASH_ESCAPE]},a={className:"string",begin:/0'(\\'|.)/},c={className:"string",begin:/0'\\s/},l=[e,n,r,{begin:/:-/},i,s,t.C_BLOCK_COMMENT_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,o,a,c,t.C_NUMBER_MODE];return r.contains=l,i.contains=l,{name:"Prolog",contains:l.concat([{begin:/\.$/}])}}vLn.exports=gFi});var BLn=re((Quc,kLn)=>{p();function AFi(t){var e="[ \\t\\f]*",n="[ \\t\\f]+",r=e+"[:=]"+e,i=n,s="("+r+"|"+i+")",o="([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",a="([^\\\\:= \\t\\f\\n]|\\\\.)+",c={end:s,relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{begin:"\\\\\\\\"},{begin:"\\\\\\n"}]}};return{name:".properties",case_insensitive:!0,illegal:/\S/,contains:[t.COMMENT("^\\s*[!#]","$"),{returnBegin:!0,variants:[{begin:o+r,relevance:1},{begin:o+i,relevance:0}],contains:[{className:"attr",begin:o,endsParent:!0,relevance:0}],starts:c},{begin:a+s,returnBegin:!0,relevance:0,contains:[{className:"meta",begin:a,endsParent:!0,relevance:0}],starts:c},{className:"attr",relevance:0,begin:a+e+"$"}]}}kLn.exports=AFi});var DLn=re((Guc,NLn)=>{p();function yFi(t){return{name:"Protocol Buffers",keywords:{keyword:"package import option optional required repeated group oneof",built_in:"double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes",literal:"true false"},contains:[t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"message enum service",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{className:"function",beginKeywords:"rpc",end:/[{;]/,excludeEnd:!0,keywords:"rpc returns"},{begin:/^\s*[A-Z_]+(?=\s*=[^\n]+;$)/}]}}NLn.exports=yFi});var MLn=re((Wuc,PLn)=>{p();function EFi(t){let e={keyword:"and case default else elsif false if in import enherits node or true undef unless main settings $string ",literal:"alias audit before loglevel noop require subscribe tag owner ensure group mode name|0 changes context force incl lens load_path onlyif provider returns root show_diff type_check en_address ip_address realname command environment hour monute month monthday special target weekday creates cwd ogoutput refresh refreshonly tries try_sleep umask backup checksum content ctime force ignore links mtime purge recurse recurselimit replace selinux_ignore_defaults selrange selrole seltype seluser source souirce_permissions sourceselect validate_cmd validate_replacement allowdupe attribute_membership auth_membership forcelocal gid ia_load_module members system host_aliases ip allowed_trunk_vlans description device_url duplex encapsulation etherchannel native_vlan speed principals allow_root auth_class auth_type authenticate_user k_of_n mechanisms rule session_owner shared options device fstype enable hasrestart directory present absent link atboot blockdevice device dump pass remounts poller_tag use message withpath adminfile allow_virtual allowcdrom category configfiles flavor install_options instance package_settings platform responsefile status uninstall_options vendor unless_system_user unless_uid binary control flags hasstatus manifest pattern restart running start stop allowdupe auths expiry gid groups home iterations key_membership keys managehome membership password password_max_age password_min_age profile_membership profiles project purge_ssh_keys role_membership roles salt shell uid baseurl cost descr enabled enablegroups exclude failovermethod gpgcheck gpgkey http_caching include includepkgs keepalive metadata_expire metalink mirrorlist priority protect proxy proxy_password proxy_username repo_gpgcheck s3_enabled skip_if_unavailable sslcacert sslclientcert sslclientkey sslverify mounted",built_in:"architecture augeasversion blockdevices boardmanufacturer boardproductname boardserialnumber cfkey dhcp_servers domain ec2_ ec2_userdata facterversion filesystems ldom fqdn gid hardwareisa hardwaremodel hostname id|0 interfaces ipaddress ipaddress_ ipaddress6 ipaddress6_ iphostnumber is_virtual kernel kernelmajversion kernelrelease kernelversion kernelrelease kernelversion lsbdistcodename lsbdistdescription lsbdistid lsbdistrelease lsbmajdistrelease lsbminordistrelease lsbrelease macaddress macaddress_ macosx_buildversion macosx_productname macosx_productversion macosx_productverson_major macosx_productversion_minor manufacturer memoryfree memorysize netmask metmask_ network_ operatingsystem operatingsystemmajrelease operatingsystemrelease osfamily partitions path physicalprocessorcount processor processorcount productname ps puppetversion rubysitedir rubyversion selinux selinux_config_mode selinux_config_policy selinux_current_mode selinux_current_mode selinux_enforced selinux_policyversion serialnumber sp_ sshdsakey sshecdsakey sshrsakey swapencrypted swapfree swapsize timezone type uniqueid uptime uptime_days uptime_hours uptime_seconds uuid virtual vlans xendomains zfs_version zonenae zones zpool_version"},n=t.COMMENT("#","$"),r="([A-Za-z_]|::)(\\w|::)*",i=t.inherit(t.TITLE_MODE,{begin:r}),s={className:"variable",begin:"\\$"+r},o={className:"string",contains:[t.BACKSLASH_ESCAPE,s],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/}]};return{name:"Puppet",aliases:["pp"],contains:[n,s,o,{beginKeywords:"class",end:"\\{|;",illegal:/=/,contains:[i,n]},{beginKeywords:"define",end:/\{/,contains:[{className:"section",begin:t.IDENT_RE,endsParent:!0}]},{begin:t.IDENT_RE+"\\s+\\{",returnBegin:!0,end:/\S/,contains:[{className:"keyword",begin:t.IDENT_RE},{begin:/\{/,end:/\}/,keywords:e,relevance:0,contains:[o,n,{begin:"[a-zA-Z_]+\\s*=>",returnBegin:!0,end:"=>",contains:[{className:"attr",begin:t.IDENT_RE}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},s]}],relevance:0}]}}PLn.exports=EFi});var LLn=re((quc,OLn)=>{p();function bFi(t){let e={className:"string",begin:'(~)?"',end:'"',illegal:"\\n"},n={className:"symbol",begin:"#[a-zA-Z_]\\w*\\$?"};return{name:"PureBASIC",aliases:["pb","pbi"],keywords:"Align And Array As Break CallDebugger Case CompilerCase CompilerDefault CompilerElse CompilerElseIf CompilerEndIf CompilerEndSelect CompilerError CompilerIf CompilerSelect CompilerWarning Continue Data DataSection Debug DebugLevel Declare DeclareC DeclareCDLL DeclareDLL DeclareModule Default Define Dim DisableASM DisableDebugger DisableExplicit Else ElseIf EnableASM EnableDebugger EnableExplicit End EndDataSection EndDeclareModule EndEnumeration EndIf EndImport EndInterface EndMacro EndModule EndProcedure EndSelect EndStructure EndStructureUnion EndWith Enumeration EnumerationBinary Extends FakeReturn For ForEach ForEver Global Gosub Goto If Import ImportC IncludeBinary IncludeFile IncludePath Interface List Macro MacroExpandedCount Map Module NewList NewMap Next Not Or Procedure ProcedureC ProcedureCDLL ProcedureDLL ProcedureReturn Protected Prototype PrototypeC ReDim Read Repeat Restore Return Runtime Select Shared Static Step Structure StructureUnion Swap Threaded To UndefineMacro Until Until UnuseModule UseModule Wend While With XIncludeFile XOr",contains:[t.COMMENT(";","$",{relevance:0}),{className:"function",begin:"\\b(Procedure|Declare)(C|CDLL|DLL)?\\b",end:"\\(",excludeEnd:!0,returnBegin:!0,contains:[{className:"keyword",begin:"(Procedure|Declare)(C|CDLL|DLL)?",excludeEnd:!0},{className:"type",begin:"\\.\\w*"},t.UNDERSCORE_TITLE_MODE]},e,n]}}OLn.exports=bFi});var QLn=re((Vuc,FLn)=>{p();function _Fi(t){return{aliases:["pycon"],contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}FLn.exports=_Fi});var GLn=re((zuc,ULn)=>{p();function xFi(t){return{name:"Q",aliases:["k","kdb"],keywords:{$pattern:/(`?)[A-Za-z0-9_]+\b/,keyword:"do while select delete by update from",literal:"0b 1b",built_in:"neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum",type:"`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid"},contains:[t.C_LINE_COMMENT_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE]}}ULn.exports=xFi});var WLn=re((Juc,$Ln)=>{p();function SFi(t){return t?typeof t=="string"?t:t.source:null}function CFi(...t){return t.map(n=>SFi(n)).join("")}function IFi(t){let e={keyword:"in of on if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await import",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Behavior bool color coordinate date double enumeration font geocircle georectangle geoshape int list matrix4x4 parent point quaternion real rect size string url variant vector2d vector3d vector4d Promise"},n="[a-zA-Z_][a-zA-Z0-9\\._]*",r={className:"keyword",begin:"\\bproperty\\b",starts:{className:"string",end:"(:|=|;|,|//|/\\*|$)",returnEnd:!0}},i={className:"keyword",begin:"\\bsignal\\b",starts:{className:"string",end:"(\\(|:|=|;|,|//|/\\*|$)",returnEnd:!0}},s={className:"attribute",begin:"\\bid\\s*:",starts:{className:"string",end:n,returnEnd:!1}},o={begin:n+"\\s*:",returnBegin:!0,contains:[{className:"attribute",begin:n,end:"\\s*:",excludeEnd:!0,relevance:0}],relevance:0},a={begin:CFi(n,/\s*\{/),end:/\{/,returnBegin:!0,relevance:0,contains:[t.inherit(t.TITLE_MODE,{begin:n})]};return{name:"QML",aliases:["qt"],case_insensitive:!1,keywords:e,contains:[{className:"meta",begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,{className:"subst",begin:"\\$\\{",end:"\\}"}]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"number",variants:[{begin:"\\b(0[bB][01]+)"},{begin:"\\b(0[oO][0-7]+)"},{begin:t.C_NUMBER_RE}],relevance:0},{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.REGEXP_MODE,{begin:/\s*[);\]]/,relevance:0,subLanguage:"xml"}],relevance:0},i,r,{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/}),{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]}],illegal:/\[|%/},{begin:"\\."+t.IDENT_RE,relevance:0},s,o,a],illegal:/#/}}$Ln.exports=IFi});var qLn=re((Zuc,HLn)=>{p();function wFi(t){return t?typeof t=="string"?t:t.source:null}function TFi(t){return Wat("(?=",t,")")}function Wat(...t){return t.map(n=>wFi(n)).join("")}function vFi(t){let e=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=/[a-zA-Z][a-zA-Z_0-9]*/;return{name:"R",illegal:/->/,keywords:{$pattern:e,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},compilerExtensions:[(r,i)=>{if(!r.beforeMatch)return;if(r.starts)throw new Error("beforeMatch cannot be used with starts");let s=Object.assign({},r);Object.keys(r).forEach(o=>{delete r[o]}),r.begin=Wat(s.beforeMatch,TFi(s.begin)),r.starts={relevance:0,contains:[Object.assign(s,{endsParent:!0})]},r.relevance=0,delete s.beforeMatch}],contains:[t.COMMENT(/#'/,/$/,{contains:[{className:"doctag",begin:"@examples",starts:{contains:[{begin:/\n/},{begin:/#'\s*(?=@[a-zA-Z]+)/,endsParent:!0},{begin:/#'/,end:/$/,excludeBegin:!0}]}},{className:"doctag",begin:"@param",end:/$/,contains:[{className:"variable",variants:[{begin:e},{begin:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{className:"doctag",begin:/@[a-zA-Z]+/},{className:"meta-keyword",begin:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{className:"number",relevance:0,beforeMatch:/([^a-zA-Z0-9._])/,variants:[{match:/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/},{match:/0[xX][0-9a-fA-F]+([pP][+-]?\d+)?[Li]?/},{match:/(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[Li]?/}]},{begin:"%",end:"%"},{begin:Wat(n,"\\s+<-\\s+")},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}HLn.exports=vFi});var VLn=re((tdc,jLn)=>{p();function RFi(t){function e(C){return C.map(function(I){return I.split("").map(function(w){return"\\"+w}).join("")}).join("|")}let n="~?[a-z$_][0-9a-zA-Z$_]*",r="`?[A-Z$_][0-9a-zA-Z$_]*",i="'?[a-z$_][0-9a-z$_]*",s="\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*("+i+"\\s*(,"+i+"\\s*)*)?\\))?",o=n+"("+s+"){0,2}",a="("+e(["||","++","**","+.","*","/","*.","/.","..."])+"|\\|>|&&|==|===)",c="\\s+"+a+"\\s+",u={keyword:"and as asr assert begin class constraint do done downto else end exception external for fun function functor if in include inherit initializer land lazy let lor lsl lsr lxor match method mod module mutable new nonrec object of open or private rec sig struct then to try type val virtual when while with",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ",literal:"true false"},l="\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",d={className:"number",relevance:0,variants:[{begin:l},{begin:"\\(-"+l+"\\)"}]},m={className:"operator",relevance:0,begin:a},h=[{className:"identifier",relevance:0,begin:n},m,d],f=[t.QUOTE_STRING_MODE,m,{className:"module",begin:"\\b"+r,returnBegin:!0,end:".",contains:[{className:"identifier",begin:r,relevance:0}]}],g=[{className:"module",begin:"\\b"+r,returnBegin:!0,end:".",relevance:0,contains:[{className:"identifier",begin:r,relevance:0}]}],A={begin:n,end:"(,|\\n|\\))",relevance:0,contains:[m,{className:"typing",begin:":",end:"(,|\\n)",returnBegin:!0,relevance:0,contains:g}]},y={className:"function",relevance:0,keywords:u,variants:[{begin:"\\s(\\(\\.?.*?\\)|"+n+")\\s*=>",end:"\\s*=>",returnBegin:!0,relevance:0,contains:[{className:"params",variants:[{begin:n},{begin:o},{begin:/\(\s*\)/}]}]},{begin:"\\s\\(\\.?[^;\\|]*\\)\\s*=>",end:"\\s=>",returnBegin:!0,relevance:0,contains:[{className:"params",relevance:0,variants:[A]}]},{begin:"\\(\\.\\s"+n+"\\)\\s*=>"}]};f.push(y);let E={className:"constructor",begin:r+"\\(",end:"\\)",illegal:"\\n",keywords:u,contains:[t.QUOTE_STRING_MODE,m,{className:"params",begin:"\\b"+n}]},_={className:"pattern-match",begin:"\\|",returnBegin:!0,keywords:u,end:"=>",relevance:0,contains:[E,m,{relevance:0,className:"constructor",begin:r}]},S={className:"module-access",keywords:u,returnBegin:!0,variants:[{begin:"\\b("+r+"\\.)+"+n},{begin:"\\b("+r+"\\.)+\\(",end:"\\)",returnBegin:!0,contains:[y,{begin:"\\(",end:"\\)",skip:!0}].concat(f)},{begin:"\\b("+r+"\\.)+\\{",end:/\}/}],contains:f};return g.push(S),{name:"ReasonML",aliases:["re"],keywords:u,illegal:"(:-|:=|\\$\\{|\\+=)",contains:[t.COMMENT("/\\*","\\*/",{illegal:"^(#,\\/\\/)"}),{className:"character",begin:"'(\\\\[^']+|[^'])'",illegal:"\\n",relevance:0},t.QUOTE_STRING_MODE,{className:"literal",begin:"\\(\\)",relevance:0},{className:"literal",begin:"\\[\\|",end:"\\|\\]",relevance:0,contains:h},{className:"literal",begin:"\\[",end:"\\]",relevance:0,contains:h},E,{className:"operator",begin:c,illegal:"-->",relevance:0},d,t.C_LINE_COMMENT_MODE,_,y,{className:"module-def",begin:"\\bmodule\\s+"+n+"\\s+"+r+"\\s+=\\s+\\{",end:/\}/,returnBegin:!0,keywords:u,relevance:0,contains:[{className:"module",relevance:0,begin:r},{begin:/\{/,end:/\}/,skip:!0}].concat(f)},S]}}jLn.exports=RFi});var zLn=re((rdc,YLn)=>{p();function kFi(t){return{name:"RenderMan RIB",keywords:"ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry Hider Hyperboloid Identity Illuminate Imager Interior LightSource MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd TransformPoints Translate TrimCurve WorldBegin WorldEnd",illegal:"{p();function BFi(t){let e="[a-zA-Z-_][^\\n{]+\\{",n={className:"attribute",begin:/[a-zA-Z-_]+/,end:/\s*:/,excludeEnd:!0,starts:{end:";",relevance:0,contains:[{className:"variable",begin:/\.[a-zA-Z-_]+/},{className:"keyword",begin:/\(optional\)/}]}};return{name:"Roboconf",aliases:["graph","instances"],case_insensitive:!0,keywords:"import",contains:[{begin:"^facet "+e,end:/\}/,keywords:"facet",contains:[n,t.HASH_COMMENT_MODE]},{begin:"^\\s*instance of "+e,end:/\}/,keywords:"name count channels instance-data instance-state instance of",illegal:/\S/,contains:["self",n,t.HASH_COMMENT_MODE]},{begin:"^"+e,end:/\}/,contains:[n,t.HASH_COMMENT_MODE]},t.HASH_COMMENT_MODE]}}KLn.exports=BFi});var ZLn=re((adc,XLn)=>{p();function NFi(t){let e="foreach do while for if from to step else on-error and or not in",n="global local beep delay put len typeof pick log time set find environment terminal error execute parse resolve toarray tobool toid toip toip6 tonum tostr totime",r="add remove enable disable set get print export edit find run debug error info warning",i="true false yes no nothing nil null",s="traffic-flow traffic-generator firewall scheduler aaa accounting address-list address align area bandwidth-server bfd bgp bridge client clock community config connection console customer default dhcp-client dhcp-server discovery dns e-mail ethernet filter firmware gps graphing group hardware health hotspot identity igmp-proxy incoming instance interface ip ipsec ipv6 irq l2tp-server lcd ldp logging mac-server mac-winbox mangle manual mirror mme mpls nat nd neighbor network note ntp ospf ospf-v3 ovpn-server page peer pim ping policy pool port ppp pppoe-client pptp-server prefix profile proposal proxy queue radius resource rip ripng route routing screen script security-profiles server service service-port settings shares smb sms sniffer snmp snooper socks sstp-server system tool tracking type upgrade upnp user-manager users user vlan secret vrrp watchdog web-access wireless pptp pppoe lan wan layer7-protocol lease simple raw",o={className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,o,{className:"variable",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]}]},c={className:"string",begin:/'/,end:/'/};return{name:"Microtik RouterOS script",aliases:["mikrotik"],case_insensitive:!0,keywords:{$pattern:/:?[\w-]+/,literal:i,keyword:e+" :"+e.split(" ").join(" :")+" :"+n.split(" ").join(" :")},contains:[{variants:[{begin:/\/\*/,end:/\*\//},{begin:/\/\//,end:/$/},{begin:/<\//,end:/>/}],illegal:/./},t.COMMENT("^#","$"),a,c,o,{begin:/[\w-]+=([^\s{}[\]()>]+)/,relevance:0,returnBegin:!0,contains:[{className:"attribute",begin:/[^=]+/},{begin:/=/,endsWithParent:!0,relevance:0,contains:[a,c,o,{className:"literal",begin:"\\b("+i.split(" ").join("|")+")\\b"},{begin:/("[^"]*"|[^\s{}[\]]+)/}]}]},{className:"number",begin:/\*[0-9a-fA-F]+/},{begin:"\\b("+r.split(" ").join("|")+")([\\s[(\\]|])",returnBegin:!0,contains:[{className:"builtin-name",begin:/\w+/}]},{className:"built_in",variants:[{begin:"(\\.\\./|/|\\s)(("+s.split(" ").join("|")+");?\\s)+"},{begin:/\.\./,relevance:0}]}]}}XLn.exports=NFi});var t2n=re((ldc,e2n)=>{p();function DFi(t){return{name:"RenderMan RSL",keywords:{keyword:"float color point normal vector matrix while for if do return else break extern continue",built_in:"abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp faceforward filterstep floor format fresnel incident length lightsource log match max min mod noise normalize ntransform opposite option phong pnoise pow printf ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan texture textureinfo trace transform vtransform xcomp ycomp zcomp"},illegal:"{p();function PFi(t){return{name:"Oracle Rules Language",keywords:{keyword:"BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM NUMDAYS READ_DATE STAGING",built_in:"IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{className:"literal",variants:[{begin:"#\\s+",relevance:0},{begin:"#[a-zA-Z .]+"}]}]}}n2n.exports=PFi});var s2n=re((mdc,i2n)=>{p();function MFi(t){return{name:"SAS",case_insensitive:!0,keywords:{literal:"null missing _all_ _automatic_ _character_ _infile_ _n_ _name_ _null_ _numeric_ _user_ _webout_",meta:"do if then else end until while abort array attrib by call cards cards4 catname continue datalines datalines4 delete delim delimiter display dm drop endsas error file filename footnote format goto in infile informat input keep label leave length libname link list lostcard merge missing modify options output out page put redirect remove rename replace retain return select set skip startsas stop title update waitsas where window x systask add and alter as cascade check create delete describe distinct drop foreign from group having index insert into in key like message modify msgtype not null on or order primary references reset restrict select set table unique update validate view where"},contains:[{className:"keyword",begin:/^\s*(proc [\w\d_]+|data|run|quit)[\s;]/},{className:"variable",begin:/&[a-zA-Z_&][a-zA-Z0-9_]*\.?/},{className:"emphasis",begin:/^\s*datalines|cards.*;/,end:/^\s*;\s*$/},{className:"built_in",begin:"%("+"bquote|nrbquote|cmpres|qcmpres|compstor|datatyp|display|do|else|end|eval|global|goto|if|index|input|keydef|label|left|length|let|local|lowcase|macro|mend|nrbquote|nrquote|nrstr|put|qcmpres|qleft|qlowcase|qscan|qsubstr|qsysfunc|qtrim|quote|qupcase|scan|str|substr|superq|syscall|sysevalf|sysexec|sysfunc|sysget|syslput|sysprod|sysrc|sysrput|then|to|trim|unquote|until|upcase|verify|while|window"+")"},{className:"name",begin:/%[a-zA-Z_][a-zA-Z_0-9]*/},{className:"meta",begin:"[^%]("+"abs|addr|airy|arcos|arsin|atan|attrc|attrn|band|betainv|blshift|bnot|bor|brshift|bxor|byte|cdf|ceil|cexist|cinv|close|cnonct|collate|compbl|compound|compress|cos|cosh|css|curobs|cv|daccdb|daccdbsl|daccsl|daccsyd|dacctab|dairy|date|datejul|datepart|datetime|day|dclose|depdb|depdbsl|depdbsl|depsl|depsl|depsyd|depsyd|deptab|deptab|dequote|dhms|dif|digamma|dim|dinfo|dnum|dopen|doptname|doptnum|dread|dropnote|dsname|erf|erfc|exist|exp|fappend|fclose|fcol|fdelete|fetch|fetchobs|fexist|fget|fileexist|filename|fileref|finfo|finv|fipname|fipnamel|fipstate|floor|fnonct|fnote|fopen|foptname|foptnum|fpoint|fpos|fput|fread|frewind|frlen|fsep|fuzz|fwrite|gaminv|gamma|getoption|getvarc|getvarn|hbound|hms|hosthelp|hour|ibessel|index|indexc|indexw|input|inputc|inputn|int|intck|intnx|intrr|irr|jbessel|juldate|kurtosis|lag|lbound|left|length|lgamma|libname|libref|log|log10|log2|logpdf|logpmf|logsdf|lowcase|max|mdy|mean|min|minute|mod|month|mopen|mort|n|netpv|nmiss|normal|note|npv|open|ordinal|pathname|pdf|peek|peekc|pmf|point|poisson|poke|probbeta|probbnml|probchi|probf|probgam|probhypr|probit|probnegb|probnorm|probt|put|putc|putn|qtr|quote|ranbin|rancau|ranexp|rangam|range|rank|rannor|ranpoi|rantbl|rantri|ranuni|repeat|resolve|reverse|rewind|right|round|saving|scan|sdf|second|sign|sin|sinh|skewness|soundex|spedis|sqrt|std|stderr|stfips|stname|stnamel|substr|sum|symget|sysget|sysmsg|sysprod|sysrc|system|tan|tanh|time|timepart|tinv|tnonct|today|translate|tranwrd|trigamma|trim|trimn|trunc|uniform|upcase|uss|var|varfmt|varinfmt|varlabel|varlen|varname|varnum|varray|varrayx|vartype|verify|vformat|vformatd|vformatdx|vformatn|vformatnx|vformatw|vformatwx|vformatx|vinarray|vinarrayx|vinformat|vinformatd|vinformatdx|vinformatn|vinformatnx|vinformatw|vinformatwx|vinformatx|vlabel|vlabelx|vlength|vlengthx|vname|vnamex|vtype|vtypex|weekday|year|yyq|zipfips|zipname|zipnamel|zipstate"+")[(]"},{className:"string",variants:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},t.COMMENT("\\*",";"),t.C_BLOCK_COMMENT_MODE]}}i2n.exports=MFi});var a2n=re((fdc,o2n)=>{p();function OFi(t){let e="[^\\(\\)\\[\\]\\{\\}\",'`;#|\\\\\\s]+",n="(-|\\+)?\\d+([./]\\d+)?",r=n+"[+\\-]"+n+"i",i={$pattern:e,"builtin-name":"case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules ' * + , ,@ - ... / ; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"},s={className:"literal",begin:"(#t|#f|#\\\\"+e+"|#\\\\.)"},o={className:"number",variants:[{begin:n,relevance:0},{begin:r,relevance:0},{begin:"#b[0-1]+(/[0-1]+)?"},{begin:"#o[0-7]+(/[0-7]+)?"},{begin:"#x[0-9a-f]+(/[0-9a-f]+)?"}]},a=t.QUOTE_STRING_MODE,c=[t.COMMENT(";","$",{relevance:0}),t.COMMENT("#\\|","\\|#")],u={begin:e,relevance:0},l={className:"symbol",begin:"'"+e},d={endsWithParent:!0,relevance:0},m={variants:[{begin:/'/},{begin:"`"}],contains:[{begin:"\\(",end:"\\)",contains:["self",s,a,o,u,l]}]},h={className:"name",relevance:0,begin:e,keywords:i},g={variants:[{begin:"\\(",end:"\\)"},{begin:"\\[",end:"\\]"}],contains:[{begin:/lambda/,endsWithParent:!0,returnBegin:!0,contains:[h,{endsParent:!0,variants:[{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/}],contains:[u]}]},h,d]};return d.contains=[s,o,a,u,l,m,g].concat(c),{name:"Scheme",illegal:/\S/,contains:[t.SHEBANG(),o,a,l,m,g].concat(c)}}o2n.exports=OFi});var l2n=re((Adc,c2n)=>{p();function LFi(t){let e=[t.C_NUMBER_MODE,{className:"string",begin:`'|"`,end:`'|"`,contains:[t.BACKSLASH_ESCAPE,{begin:"''"}]}];return{name:"Scilab",aliases:["sci"],keywords:{$pattern:/%?\w+/,keyword:"abort break case clear catch continue do elseif else endfunction end for function global if pause return resume select try then while",literal:"%f %F %t %T %pi %eps %inf %nan %e %i %z %s",built_in:"abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp error exec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isempty isinfisnan isvector lasterror length load linspace list listfiles log10 log2 log max min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand real round sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tan type typename warning zeros matrix"},illegal:'("|#|/\\*|\\s+/\\w+)',contains:[{className:"function",beginKeywords:"function",end:"$",contains:[t.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)"}]},{begin:"[a-zA-Z_][a-zA-Z_0-9]*[\\.']+",relevance:0},{begin:"\\[",end:"\\][\\.']*",relevance:0,contains:e},t.COMMENT("//","$")].concat(e)}}c2n.exports=LFi});var d2n=re((Edc,u2n)=>{p();var FFi=t=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]}}),QFi=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],UFi=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],GFi=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],$Fi=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],WFi=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse();function HFi(t){let e=FFi(t),n=$Fi,r=GFi,i="@[a-z-]+",s="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b"};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+QFi.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:"::("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},{className:"attribute",begin:"\\b("+WFi.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:":",end:";",contains:[a,e.HEXCOLOR,t.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT]},{begin:"@(page|font-face)",lexemes:i,keywords:"@page @font-face"},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:UFi.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,t.CSS_NUMBER_MODE]}]}}u2n.exports=HFi});var m2n=re((_dc,p2n)=>{p();function qFi(t){return{name:"Shell Session",aliases:["console"],contains:[{className:"meta",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#]/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}p2n.exports=qFi});var f2n=re((Sdc,h2n)=>{p();function jFi(t){let e=["add","and","cmp","cmpg","cmpl","const","div","double","float","goto","if","int","long","move","mul","neg","new","nop","not","or","rem","return","shl","shr","sput","sub","throw","ushr","xor"],n=["aget","aput","array","check","execute","fill","filled","goto/16","goto/32","iget","instance","invoke","iput","monitor","packed","sget","sparse"],r=["transient","constructor","abstract","final","synthetic","public","private","protected","static","bridge","system"];return{name:"Smali",contains:[{className:"string",begin:'"',end:'"',relevance:0},t.COMMENT("#","$",{relevance:0}),{className:"keyword",variants:[{begin:"\\s*\\.end\\s[a-zA-Z0-9]*"},{begin:"^[ ]*\\.[a-zA-Z]*",relevance:0},{begin:"\\s:[a-zA-Z_0-9]*",relevance:0},{begin:"\\s("+r.join("|")+")"}]},{className:"built_in",variants:[{begin:"\\s("+e.join("|")+")\\s"},{begin:"\\s("+e.join("|")+")((-|/)[a-zA-Z0-9]+)+\\s",relevance:10},{begin:"\\s("+n.join("|")+")((-|/)[a-zA-Z0-9]+)*\\s",relevance:10}]},{className:"class",begin:`L[^(;: +]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}h2n.exports=jFi});var A2n=re((Idc,g2n)=>{p();function VFi(t){let e="[a-z][a-zA-Z0-9_]*",n={className:"string",begin:"\\$.{1}"},r={className:"symbol",begin:"#"+t.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:"self super nil true false thisContext",contains:[t.COMMENT('"','"'),t.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:e+":",relevance:0},t.C_NUMBER_MODE,r,n,{begin:"\\|[ ]*"+e+"([ ]+"+e+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+e}]},{begin:"#\\(",end:"\\)",contains:[t.APOS_STRING_MODE,n,t.C_NUMBER_MODE,r]}]}}g2n.exports=VFi});var E2n=re((Tdc,y2n)=>{p();function YFi(t){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},t.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},t.inherit(t.APOS_STRING_MODE,{className:"string",relevance:0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}y2n.exports=YFi});var _2n=re((Rdc,b2n)=>{p();function zFi(t){let e={className:"variable",begin:/\b_+[a-zA-Z]\w*/},n={className:"title",begin:/[a-zA-Z][a-zA-Z0-9]+_fnc_\w*/},r={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},i={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"define undef ifdef ifndef else endif include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(r,{className:"meta-string"}),{className:"meta-string",begin:/<[^\n>]*>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]};return{name:"SQF",case_insensitive:!0,keywords:{keyword:"case catch default do else exit exitWith for forEach from if private switch then throw to try waitUntil while with",built_in:"abs accTime acos action actionIDs actionKeys actionKeysImages actionKeysNames actionKeysNamesArray actionName actionParams activateAddons activatedAddons activateKey add3DENConnection add3DENEventHandler add3DENLayer addAction addBackpack addBackpackCargo addBackpackCargoGlobal addBackpackGlobal addCamShake addCuratorAddons addCuratorCameraArea addCuratorEditableObjects addCuratorEditingArea addCuratorPoints addEditorObject addEventHandler addForce addGoggles addGroupIcon addHandgunItem addHeadgear addItem addItemCargo addItemCargoGlobal addItemPool addItemToBackpack addItemToUniform addItemToVest addLiveStats addMagazine addMagazineAmmoCargo addMagazineCargo addMagazineCargoGlobal addMagazineGlobal addMagazinePool addMagazines addMagazineTurret addMenu addMenuItem addMissionEventHandler addMPEventHandler addMusicEventHandler addOwnedMine addPlayerScores addPrimaryWeaponItem addPublicVariableEventHandler addRating addResources addScore addScoreSide addSecondaryWeaponItem addSwitchableUnit addTeamMember addToRemainsCollector addTorque addUniform addVehicle addVest addWaypoint addWeapon addWeaponCargo addWeaponCargoGlobal addWeaponGlobal addWeaponItem addWeaponPool addWeaponTurret admin agent agents AGLToASL aimedAtTarget aimPos airDensityRTD airplaneThrottle airportSide AISFinishHeal alive all3DENEntities allAirports allControls allCurators allCutLayers allDead allDeadMen allDisplays allGroups allMapMarkers allMines allMissionObjects allow3DMode allowCrewInImmobile allowCuratorLogicIgnoreAreas allowDamage allowDammage allowFileOperations allowFleeing allowGetIn allowSprint allPlayers allSimpleObjects allSites allTurrets allUnits allUnitsUAV allVariables ammo ammoOnPylon and animate animateBay animateDoor animatePylon animateSource animationNames animationPhase animationSourcePhase animationState append apply armoryPoints arrayIntersect asin ASLToAGL ASLToATL assert assignAsCargo assignAsCargoIndex assignAsCommander assignAsDriver assignAsGunner assignAsTurret assignCurator assignedCargo assignedCommander assignedDriver assignedGunner assignedItems assignedTarget assignedTeam assignedVehicle assignedVehicleRole assignItem assignTeam assignToAirport atan atan2 atg ATLToASL attachedObject attachedObjects attachedTo attachObject attachTo attackEnabled backpack backpackCargo backpackContainer backpackItems backpackMagazines backpackSpaceFor behaviour benchmark binocular boundingBox boundingBoxReal boundingCenter breakOut breakTo briefingName buildingExit buildingPos buttonAction buttonSetAction cadetMode call callExtension camCommand camCommit camCommitPrepared camCommitted camConstuctionSetParams camCreate camDestroy cameraEffect cameraEffectEnableHUD cameraInterest cameraOn cameraView campaignConfigFile camPreload camPreloaded camPrepareBank camPrepareDir camPrepareDive camPrepareFocus camPrepareFov camPrepareFovRange camPreparePos camPrepareRelPos camPrepareTarget camSetBank camSetDir camSetDive camSetFocus camSetFov camSetFovRange camSetPos camSetRelPos camSetTarget camTarget camUseNVG canAdd canAddItemToBackpack canAddItemToUniform canAddItemToVest cancelSimpleTaskDestination canFire canMove canSlingLoad canStand canSuspend canTriggerDynamicSimulation canUnloadInCombat canVehicleCargo captive captiveNum cbChecked cbSetChecked ceil channelEnabled cheatsEnabled checkAIFeature checkVisibility className clearAllItemsFromBackpack clearBackpackCargo clearBackpackCargoGlobal clearGroupIcons clearItemCargo clearItemCargoGlobal clearItemPool clearMagazineCargo clearMagazineCargoGlobal clearMagazinePool clearOverlay clearRadio clearWeaponCargo clearWeaponCargoGlobal clearWeaponPool clientOwner closeDialog closeDisplay closeOverlay collapseObjectTree collect3DENHistory collectiveRTD combatMode commandArtilleryFire commandChat commander commandFire commandFollow commandFSM commandGetOut commandingMenu commandMove commandRadio commandStop commandSuppressiveFire commandTarget commandWatch comment commitOverlay compile compileFinal completedFSM composeText configClasses configFile configHierarchy configName configProperties configSourceAddonList configSourceMod configSourceModList confirmSensorTarget connectTerminalToUAV controlsGroupCtrl copyFromClipboard copyToClipboard copyWaypoints cos count countEnemy countFriendly countSide countType countUnknown create3DENComposition create3DENEntity createAgent createCenter createDialog createDiaryLink createDiaryRecord createDiarySubject createDisplay createGearDialog createGroup createGuardedPoint createLocation createMarker createMarkerLocal createMenu createMine createMissionDisplay createMPCampaignDisplay createSimpleObject createSimpleTask createSite createSoundSource createTask createTeam createTrigger createUnit createVehicle createVehicleCrew createVehicleLocal crew ctAddHeader ctAddRow ctClear ctCurSel ctData ctFindHeaderRows ctFindRowHeader ctHeaderControls ctHeaderCount ctRemoveHeaders ctRemoveRows ctrlActivate ctrlAddEventHandler ctrlAngle ctrlAutoScrollDelay ctrlAutoScrollRewind ctrlAutoScrollSpeed ctrlChecked ctrlClassName ctrlCommit ctrlCommitted ctrlCreate ctrlDelete ctrlEnable ctrlEnabled ctrlFade ctrlHTMLLoaded ctrlIDC ctrlIDD ctrlMapAnimAdd ctrlMapAnimClear ctrlMapAnimCommit ctrlMapAnimDone ctrlMapCursor ctrlMapMouseOver ctrlMapScale ctrlMapScreenToWorld ctrlMapWorldToScreen ctrlModel ctrlModelDirAndUp ctrlModelScale ctrlParent ctrlParentControlsGroup ctrlPosition ctrlRemoveAllEventHandlers ctrlRemoveEventHandler ctrlScale ctrlSetActiveColor ctrlSetAngle ctrlSetAutoScrollDelay ctrlSetAutoScrollRewind ctrlSetAutoScrollSpeed ctrlSetBackgroundColor ctrlSetChecked ctrlSetEventHandler ctrlSetFade ctrlSetFocus ctrlSetFont ctrlSetFontH1 ctrlSetFontH1B ctrlSetFontH2 ctrlSetFontH2B ctrlSetFontH3 ctrlSetFontH3B ctrlSetFontH4 ctrlSetFontH4B ctrlSetFontH5 ctrlSetFontH5B ctrlSetFontH6 ctrlSetFontH6B ctrlSetFontHeight ctrlSetFontHeightH1 ctrlSetFontHeightH2 ctrlSetFontHeightH3 ctrlSetFontHeightH4 ctrlSetFontHeightH5 ctrlSetFontHeightH6 ctrlSetFontHeightSecondary ctrlSetFontP ctrlSetFontPB ctrlSetFontSecondary ctrlSetForegroundColor ctrlSetModel ctrlSetModelDirAndUp ctrlSetModelScale ctrlSetPixelPrecision ctrlSetPosition ctrlSetScale ctrlSetStructuredText ctrlSetText ctrlSetTextColor ctrlSetTooltip ctrlSetTooltipColorBox ctrlSetTooltipColorShade ctrlSetTooltipColorText ctrlShow ctrlShown ctrlText ctrlTextHeight ctrlTextWidth ctrlType ctrlVisible ctRowControls ctRowCount ctSetCurSel ctSetData ctSetHeaderTemplate ctSetRowTemplate ctSetValue ctValue curatorAddons curatorCamera curatorCameraArea curatorCameraAreaCeiling curatorCoef curatorEditableObjects curatorEditingArea curatorEditingAreaType curatorMouseOver curatorPoints curatorRegisteredObjects curatorSelected curatorWaypointCost current3DENOperation currentChannel currentCommand currentMagazine currentMagazineDetail currentMagazineDetailTurret currentMagazineTurret currentMuzzle currentNamespace currentTask currentTasks currentThrowable currentVisionMode currentWaypoint currentWeapon currentWeaponMode currentWeaponTurret currentZeroing cursorObject cursorTarget customChat customRadio cutFadeOut cutObj cutRsc cutText damage date dateToNumber daytime deActivateKey debriefingText debugFSM debugLog deg delete3DENEntities deleteAt deleteCenter deleteCollection deleteEditorObject deleteGroup deleteGroupWhenEmpty deleteIdentity deleteLocation deleteMarker deleteMarkerLocal deleteRange deleteResources deleteSite deleteStatus deleteTeam deleteVehicle deleteVehicleCrew deleteWaypoint detach detectedMines diag_activeMissionFSMs diag_activeScripts diag_activeSQFScripts diag_activeSQSScripts diag_captureFrame diag_captureFrameToFile diag_captureSlowFrame diag_codePerformance diag_drawMode diag_enable diag_enabled diag_fps diag_fpsMin diag_frameNo diag_lightNewLoad diag_list diag_log diag_logSlowFrame diag_mergeConfigFile diag_recordTurretLimits diag_setLightNew diag_tickTime diag_toggle dialog diarySubjectExists didJIP didJIPOwner difficulty difficultyEnabled difficultyEnabledRTD difficultyOption direction directSay disableAI disableCollisionWith disableConversation disableDebriefingStats disableMapIndicators disableNVGEquipment disableRemoteSensors disableSerialization disableTIEquipment disableUAVConnectability disableUserInput displayAddEventHandler displayCtrl displayParent displayRemoveAllEventHandlers displayRemoveEventHandler displaySetEventHandler dissolveTeam distance distance2D distanceSqr distributionRegion do3DENAction doArtilleryFire doFire doFollow doFSM doGetOut doMove doorPhase doStop doSuppressiveFire doTarget doWatch drawArrow drawEllipse drawIcon drawIcon3D drawLine drawLine3D drawLink drawLocation drawPolygon drawRectangle drawTriangle driver drop dynamicSimulationDistance dynamicSimulationDistanceCoef dynamicSimulationEnabled dynamicSimulationSystemEnabled echo edit3DENMissionAttributes editObject editorSetEventHandler effectiveCommander emptyPositions enableAI enableAIFeature enableAimPrecision enableAttack enableAudioFeature enableAutoStartUpRTD enableAutoTrimRTD enableCamShake enableCaustics enableChannel enableCollisionWith enableCopilot enableDebriefingStats enableDiagLegend enableDynamicSimulation enableDynamicSimulationSystem enableEndDialog enableEngineArtillery enableEnvironment enableFatigue enableGunLights enableInfoPanelComponent enableIRLasers enableMimics enablePersonTurret enableRadio enableReload enableRopeAttach enableSatNormalOnDetail enableSaving enableSentences enableSimulation enableSimulationGlobal enableStamina enableTeamSwitch enableTraffic enableUAVConnectability enableUAVWaypoints enableVehicleCargo enableVehicleSensor enableWeaponDisassembly endLoadingScreen endMission engineOn enginesIsOnRTD enginesRpmRTD enginesTorqueRTD entities environmentEnabled estimatedEndServerTime estimatedTimeLeft evalObjectArgument everyBackpack everyContainer exec execEditorScript execFSM execVM exp expectedDestination exportJIPMessages eyeDirection eyePos face faction fadeMusic fadeRadio fadeSound fadeSpeech failMission fillWeaponsFromPool find findCover findDisplay findEditorObject findEmptyPosition findEmptyPositionReady findIf findNearestEnemy finishMissionInit finite fire fireAtTarget firstBackpack flag flagAnimationPhase flagOwner flagSide flagTexture fleeing floor flyInHeight flyInHeightASL fog fogForecast fogParams forceAddUniform forcedMap forceEnd forceFlagTexture forceFollowRoad forceMap forceRespawn forceSpeed forceWalk forceWeaponFire forceWeatherChange forEachMember forEachMemberAgent forEachMemberTeam forgetTarget format formation formationDirection formationLeader formationMembers formationPosition formationTask formatText formLeader freeLook fromEditor fuel fullCrew gearIDCAmmoCount gearSlotAmmoCount gearSlotData get3DENActionState get3DENAttribute get3DENCamera get3DENConnections get3DENEntity get3DENEntityID get3DENGrid get3DENIconsVisible get3DENLayerEntities get3DENLinesVisible get3DENMissionAttribute get3DENMouseOver get3DENSelected getAimingCoef getAllEnvSoundControllers getAllHitPointsDamage getAllOwnedMines getAllSoundControllers getAmmoCargo getAnimAimPrecision getAnimSpeedCoef getArray getArtilleryAmmo getArtilleryComputerSettings getArtilleryETA getAssignedCuratorLogic getAssignedCuratorUnit getBackpackCargo getBleedingRemaining getBurningValue getCameraViewDirection getCargoIndex getCenterOfMass getClientState getClientStateNumber getCompatiblePylonMagazines getConnectedUAV getContainerMaxLoad getCursorObjectParams getCustomAimCoef getDammage getDescription getDir getDirVisual getDLCAssetsUsage getDLCAssetsUsageByName getDLCs getEditorCamera getEditorMode getEditorObjectScope getElevationOffset getEnvSoundController getFatigue getForcedFlagTexture getFriend getFSMVariable getFuelCargo getGroupIcon getGroupIconParams getGroupIcons getHideFrom getHit getHitIndex getHitPointDamage getItemCargo getMagazineCargo getMarkerColor getMarkerPos getMarkerSize getMarkerType getMass getMissionConfig getMissionConfigValue getMissionDLCs getMissionLayerEntities getModelInfo getMousePosition getMusicPlayedTime getNumber getObjectArgument getObjectChildren getObjectDLC getObjectMaterials getObjectProxy getObjectTextures getObjectType getObjectViewDistance getOxygenRemaining getPersonUsedDLCs getPilotCameraDirection getPilotCameraPosition getPilotCameraRotation getPilotCameraTarget getPlateNumber getPlayerChannel getPlayerScores getPlayerUID getPos getPosASL getPosASLVisual getPosASLW getPosATL getPosATLVisual getPosVisual getPosWorld getPylonMagazines getRelDir getRelPos getRemoteSensorsDisabled getRepairCargo getResolution getShadowDistance getShotParents getSlingLoad getSoundController getSoundControllerResult getSpeed getStamina getStatValue getSuppression getTerrainGrid getTerrainHeightASL getText getTotalDLCUsageTime getUnitLoadout getUnitTrait getUserMFDText getUserMFDvalue getVariable getVehicleCargo getWeaponCargo getWeaponSway getWingsOrientationRTD getWingsPositionRTD getWPPos glanceAt globalChat globalRadio goggles goto group groupChat groupFromNetId groupIconSelectable groupIconsVisible groupId groupOwner groupRadio groupSelectedUnits groupSelectUnit gunner gusts halt handgunItems handgunMagazine handgunWeapon handsHit hasInterface hasPilotCamera hasWeapon hcAllGroups hcGroupParams hcLeader hcRemoveAllGroups hcRemoveGroup hcSelected hcSelectGroup hcSetGroup hcShowBar hcShownBar headgear hideBody hideObject hideObjectGlobal hideSelection hint hintC hintCadet hintSilent hmd hostMission htmlLoad HUDMovementLevels humidity image importAllGroups importance in inArea inAreaArray incapacitatedState inflame inflamed infoPanel infoPanelComponentEnabled infoPanelComponents infoPanels inGameUISetEventHandler inheritsFrom initAmbientLife inPolygon inputAction inRangeOfArtillery insertEditorObject intersect is3DEN is3DENMultiplayer isAbleToBreathe isAgent isArray isAutoHoverOn isAutonomous isAutotest isBleeding isBurning isClass isCollisionLightOn isCopilotEnabled isDamageAllowed isDedicated isDLCAvailable isEngineOn isEqualTo isEqualType isEqualTypeAll isEqualTypeAny isEqualTypeArray isEqualTypeParams isFilePatchingEnabled isFlashlightOn isFlatEmpty isForcedWalk isFormationLeader isGroupDeletedWhenEmpty isHidden isInRemainsCollector isInstructorFigureEnabled isIRLaserOn isKeyActive isKindOf isLaserOn isLightOn isLocalized isManualFire isMarkedForCollection isMultiplayer isMultiplayerSolo isNil isNull isNumber isObjectHidden isObjectRTD isOnRoad isPipEnabled isPlayer isRealTime isRemoteExecuted isRemoteExecutedJIP isServer isShowing3DIcons isSimpleObject isSprintAllowed isStaminaEnabled isSteamMission isStreamFriendlyUIEnabled isText isTouchingGround isTurnedOut isTutHintsEnabled isUAVConnectable isUAVConnected isUIContext isUniformAllowed isVehicleCargo isVehicleRadarOn isVehicleSensorEnabled isWalking isWeaponDeployed isWeaponRested itemCargo items itemsWithMagazines join joinAs joinAsSilent joinSilent joinString kbAddDatabase kbAddDatabaseTargets kbAddTopic kbHasTopic kbReact kbRemoveTopic kbTell kbWasSaid keyImage keyName knowsAbout land landAt landResult language laserTarget lbAdd lbClear lbColor lbColorRight lbCurSel lbData lbDelete lbIsSelected lbPicture lbPictureRight lbSelection lbSetColor lbSetColorRight lbSetCurSel lbSetData lbSetPicture lbSetPictureColor lbSetPictureColorDisabled lbSetPictureColorSelected lbSetPictureRight lbSetPictureRightColor lbSetPictureRightColorDisabled lbSetPictureRightColorSelected lbSetSelectColor lbSetSelectColorRight lbSetSelected lbSetText lbSetTextRight lbSetTooltip lbSetValue lbSize lbSort lbSortByValue lbText lbTextRight lbValue leader leaderboardDeInit leaderboardGetRows leaderboardInit leaderboardRequestRowsFriends leaderboardsRequestUploadScore leaderboardsRequestUploadScoreKeepBest leaderboardState leaveVehicle libraryCredits libraryDisclaimers lifeState lightAttachObject lightDetachObject lightIsOn lightnings limitSpeed linearConversion lineIntersects lineIntersectsObjs lineIntersectsSurfaces lineIntersectsWith linkItem list listObjects listRemoteTargets listVehicleSensors ln lnbAddArray lnbAddColumn lnbAddRow lnbClear lnbColor lnbCurSelRow lnbData lnbDeleteColumn lnbDeleteRow lnbGetColumnsPosition lnbPicture lnbSetColor lnbSetColumnsPos lnbSetCurSelRow lnbSetData lnbSetPicture lnbSetText lnbSetValue lnbSize lnbSort lnbSortByValue lnbText lnbValue load loadAbs loadBackpack loadFile loadGame loadIdentity loadMagazine loadOverlay loadStatus loadUniform loadVest local localize locationPosition lock lockCameraTo lockCargo lockDriver locked lockedCargo lockedDriver lockedTurret lockIdentity lockTurret lockWP log logEntities logNetwork logNetworkTerminate lookAt lookAtPos magazineCargo magazines magazinesAllTurrets magazinesAmmo magazinesAmmoCargo magazinesAmmoFull magazinesDetail magazinesDetailBackpack magazinesDetailUniform magazinesDetailVest magazinesTurret magazineTurretAmmo mapAnimAdd mapAnimClear mapAnimCommit mapAnimDone mapCenterOnCamera mapGridPosition markAsFinishedOnSteam markerAlpha markerBrush markerColor markerDir markerPos markerShape markerSize markerText markerType max members menuAction menuAdd menuChecked menuClear menuCollapse menuData menuDelete menuEnable menuEnabled menuExpand menuHover menuPicture menuSetAction menuSetCheck menuSetData menuSetPicture menuSetValue menuShortcut menuShortcutText menuSize menuSort menuText menuURL menuValue min mineActive mineDetectedBy missionConfigFile missionDifficulty missionName missionNamespace missionStart missionVersion mod modelToWorld modelToWorldVisual modelToWorldVisualWorld modelToWorldWorld modParams moonIntensity moonPhase morale move move3DENCamera moveInAny moveInCargo moveInCommander moveInDriver moveInGunner moveInTurret moveObjectToEnd moveOut moveTime moveTo moveToCompleted moveToFailed musicVolume name nameSound nearEntities nearestBuilding nearestLocation nearestLocations nearestLocationWithDubbing nearestObject nearestObjects nearestTerrainObjects nearObjects nearObjectsReady nearRoads nearSupplies nearTargets needReload netId netObjNull newOverlay nextMenuItemIndex nextWeatherChange nMenuItems not numberOfEnginesRTD numberToDate objectCurators objectFromNetId objectParent objStatus onBriefingGroup onBriefingNotes onBriefingPlan onBriefingTeamSwitch onCommandModeChanged onDoubleClick onEachFrame onGroupIconClick onGroupIconOverEnter onGroupIconOverLeave onHCGroupSelectionChanged onMapSingleClick onPlayerConnected onPlayerDisconnected onPreloadFinished onPreloadStarted onShowNewObject onTeamSwitch openCuratorInterface openDLCPage openMap openSteamApp openYoutubeVideo or orderGetIn overcast overcastForecast owner param params parseNumber parseSimpleArray parseText parsingNamespace particlesQuality pickWeaponPool pitch pixelGrid pixelGridBase pixelGridNoUIScale pixelH pixelW playableSlotsNumber playableUnits playAction playActionNow player playerRespawnTime playerSide playersNumber playGesture playMission playMove playMoveNow playMusic playScriptedMission playSound playSound3D position positionCameraToWorld posScreenToWorld posWorldToScreen ppEffectAdjust ppEffectCommit ppEffectCommitted ppEffectCreate ppEffectDestroy ppEffectEnable ppEffectEnabled ppEffectForceInNVG precision preloadCamera preloadObject preloadSound preloadTitleObj preloadTitleRsc preprocessFile preprocessFileLineNumbers primaryWeapon primaryWeaponItems primaryWeaponMagazine priority processDiaryLink productVersion profileName profileNamespace profileNameSteam progressLoadingScreen progressPosition progressSetPosition publicVariable publicVariableClient publicVariableServer pushBack pushBackUnique putWeaponPool queryItemsPool queryMagazinePool queryWeaponPool rad radioChannelAdd radioChannelCreate radioChannelRemove radioChannelSetCallSign radioChannelSetLabel radioVolume rain rainbow random rank rankId rating rectangular registeredTasks registerTask reload reloadEnabled remoteControl remoteExec remoteExecCall remoteExecutedOwner remove3DENConnection remove3DENEventHandler remove3DENLayer removeAction removeAll3DENEventHandlers removeAllActions removeAllAssignedItems removeAllContainers removeAllCuratorAddons removeAllCuratorCameraAreas removeAllCuratorEditingAreas removeAllEventHandlers removeAllHandgunItems removeAllItems removeAllItemsWithMagazines removeAllMissionEventHandlers removeAllMPEventHandlers removeAllMusicEventHandlers removeAllOwnedMines removeAllPrimaryWeaponItems removeAllWeapons removeBackpack removeBackpackGlobal removeCuratorAddons removeCuratorCameraArea removeCuratorEditableObjects removeCuratorEditingArea removeDrawIcon removeDrawLinks removeEventHandler removeFromRemainsCollector removeGoggles removeGroupIcon removeHandgunItem removeHeadgear removeItem removeItemFromBackpack removeItemFromUniform removeItemFromVest removeItems removeMagazine removeMagazineGlobal removeMagazines removeMagazinesTurret removeMagazineTurret removeMenuItem removeMissionEventHandler removeMPEventHandler removeMusicEventHandler removeOwnedMine removePrimaryWeaponItem removeSecondaryWeaponItem removeSimpleTask removeSwitchableUnit removeTeamMember removeUniform removeVest removeWeapon removeWeaponAttachmentCargo removeWeaponCargo removeWeaponGlobal removeWeaponTurret reportRemoteTarget requiredVersion resetCamShake resetSubgroupDirection resize resources respawnVehicle restartEditorCamera reveal revealMine reverse reversedMouseY roadAt roadsConnectedTo roleDescription ropeAttachedObjects ropeAttachedTo ropeAttachEnabled ropeAttachTo ropeCreate ropeCut ropeDestroy ropeDetach ropeEndPosition ropeLength ropes ropeUnwind ropeUnwound rotorsForcesRTD rotorsRpmRTD round runInitScript safeZoneH safeZoneW safeZoneWAbs safeZoneX safeZoneXAbs safeZoneY save3DENInventory saveGame saveIdentity saveJoysticks saveOverlay saveProfileNamespace saveStatus saveVar savingEnabled say say2D say3D scopeName score scoreSide screenshot screenToWorld scriptDone scriptName scudState secondaryWeapon secondaryWeaponItems secondaryWeaponMagazine select selectBestPlaces selectDiarySubject selectedEditorObjects selectEditorObject selectionNames selectionPosition selectLeader selectMax selectMin selectNoPlayer selectPlayer selectRandom selectRandomWeighted selectWeapon selectWeaponTurret sendAUMessage sendSimpleCommand sendTask sendTaskResult sendUDPMessage serverCommand serverCommandAvailable serverCommandExecutable serverName serverTime set set3DENAttribute set3DENAttributes set3DENGrid set3DENIconsVisible set3DENLayer set3DENLinesVisible set3DENLogicType set3DENMissionAttribute set3DENMissionAttributes set3DENModelsVisible set3DENObjectType set3DENSelected setAccTime setActualCollectiveRTD setAirplaneThrottle setAirportSide setAmmo setAmmoCargo setAmmoOnPylon setAnimSpeedCoef setAperture setApertureNew setArmoryPoints setAttributes setAutonomous setBehaviour setBleedingRemaining setBrakesRTD setCameraInterest setCamShakeDefParams setCamShakeParams setCamUseTI setCaptive setCenterOfMass setCollisionLight setCombatMode setCompassOscillation setConvoySeparation setCuratorCameraAreaCeiling setCuratorCoef setCuratorEditingAreaType setCuratorWaypointCost setCurrentChannel setCurrentTask setCurrentWaypoint setCustomAimCoef setCustomWeightRTD setDamage setDammage setDate setDebriefingText setDefaultCamera setDestination setDetailMapBlendPars setDir setDirection setDrawIcon setDriveOnPath setDropInterval setDynamicSimulationDistance setDynamicSimulationDistanceCoef setEditorMode setEditorObjectScope setEffectCondition setEngineRPMRTD setFace setFaceAnimation setFatigue setFeatureType setFlagAnimationPhase setFlagOwner setFlagSide setFlagTexture setFog setFormation setFormationTask setFormDir setFriend setFromEditor setFSMVariable setFuel setFuelCargo setGroupIcon setGroupIconParams setGroupIconsSelectable setGroupIconsVisible setGroupId setGroupIdGlobal setGroupOwner setGusts setHideBehind setHit setHitIndex setHitPointDamage setHorizonParallaxCoef setHUDMovementLevels setIdentity setImportance setInfoPanel setLeader setLightAmbient setLightAttenuation setLightBrightness setLightColor setLightDayLight setLightFlareMaxDistance setLightFlareSize setLightIntensity setLightnings setLightUseFlare setLocalWindParams setMagazineTurretAmmo setMarkerAlpha setMarkerAlphaLocal setMarkerBrush setMarkerBrushLocal setMarkerColor setMarkerColorLocal setMarkerDir setMarkerDirLocal setMarkerPos setMarkerPosLocal setMarkerShape setMarkerShapeLocal setMarkerSize setMarkerSizeLocal setMarkerText setMarkerTextLocal setMarkerType setMarkerTypeLocal setMass setMimic setMousePosition setMusicEffect setMusicEventHandler setName setNameSound setObjectArguments setObjectMaterial setObjectMaterialGlobal setObjectProxy setObjectTexture setObjectTextureGlobal setObjectViewDistance setOvercast setOwner setOxygenRemaining setParticleCircle setParticleClass setParticleFire setParticleParams setParticleRandom setPilotCameraDirection setPilotCameraRotation setPilotCameraTarget setPilotLight setPiPEffect setPitch setPlateNumber setPlayable setPlayerRespawnTime setPos setPosASL setPosASL2 setPosASLW setPosATL setPosition setPosWorld setPylonLoadOut setPylonsPriority setRadioMsg setRain setRainbow setRandomLip setRank setRectangular setRepairCargo setRotorBrakeRTD setShadowDistance setShotParents setSide setSimpleTaskAlwaysVisible setSimpleTaskCustomData setSimpleTaskDescription setSimpleTaskDestination setSimpleTaskTarget setSimpleTaskType setSimulWeatherLayers setSize setSkill setSlingLoad setSoundEffect setSpeaker setSpeech setSpeedMode setStamina setStaminaScheme setStatValue setSuppression setSystemOfUnits setTargetAge setTaskMarkerOffset setTaskResult setTaskState setTerrainGrid setText setTimeMultiplier setTitleEffect setTrafficDensity setTrafficDistance setTrafficGap setTrafficSpeed setTriggerActivation setTriggerArea setTriggerStatements setTriggerText setTriggerTimeout setTriggerType setType setUnconscious setUnitAbility setUnitLoadout setUnitPos setUnitPosWeak setUnitRank setUnitRecoilCoefficient setUnitTrait setUnloadInCombat setUserActionText setUserMFDText setUserMFDvalue setVariable setVectorDir setVectorDirAndUp setVectorUp setVehicleAmmo setVehicleAmmoDef setVehicleArmor setVehicleCargo setVehicleId setVehicleLock setVehiclePosition setVehicleRadar setVehicleReceiveRemoteTargets setVehicleReportOwnPosition setVehicleReportRemoteTargets setVehicleTIPars setVehicleVarName setVelocity setVelocityModelSpace setVelocityTransformation setViewDistance setVisibleIfTreeCollapsed setWantedRPMRTD setWaves setWaypointBehaviour setWaypointCombatMode setWaypointCompletionRadius setWaypointDescription setWaypointForceBehaviour setWaypointFormation setWaypointHousePosition setWaypointLoiterRadius setWaypointLoiterType setWaypointName setWaypointPosition setWaypointScript setWaypointSpeed setWaypointStatements setWaypointTimeout setWaypointType setWaypointVisible setWeaponReloadingTime setWind setWindDir setWindForce setWindStr setWingForceScaleRTD setWPPos show3DIcons showChat showCinemaBorder showCommandingMenu showCompass showCuratorCompass showGPS showHUD showLegend showMap shownArtilleryComputer shownChat shownCompass shownCuratorCompass showNewEditorObject shownGPS shownHUD shownMap shownPad shownRadio shownScoretable shownUAVFeed shownWarrant shownWatch showPad showRadio showScoretable showSubtitles showUAVFeed showWarrant showWatch showWaypoint showWaypoints side sideChat sideEnemy sideFriendly sideRadio simpleTasks simulationEnabled simulCloudDensity simulCloudOcclusion simulInClouds simulWeatherSync sin size sizeOf skill skillFinal skipTime sleep sliderPosition sliderRange sliderSetPosition sliderSetRange sliderSetSpeed sliderSpeed slingLoadAssistantShown soldierMagazines someAmmo sort soundVolume spawn speaker speed speedMode splitString sqrt squadParams stance startLoadingScreen step stop stopEngineRTD stopped str sunOrMoon supportInfo suppressFor surfaceIsWater surfaceNormal surfaceType swimInDepth switchableUnits switchAction switchCamera switchGesture switchLight switchMove synchronizedObjects synchronizedTriggers synchronizedWaypoints synchronizeObjectsAdd synchronizeObjectsRemove synchronizeTrigger synchronizeWaypoint systemChat systemOfUnits tan targetKnowledge targets targetsAggregate targetsQuery taskAlwaysVisible taskChildren taskCompleted taskCustomData taskDescription taskDestination taskHint taskMarkerOffset taskParent taskResult taskState taskType teamMember teamName teams teamSwitch teamSwitchEnabled teamType terminate terrainIntersect terrainIntersectASL terrainIntersectAtASL text textLog textLogFormat tg time timeMultiplier titleCut titleFadeOut titleObj titleRsc titleText toArray toFixed toLower toString toUpper triggerActivated triggerActivation triggerArea triggerAttachedVehicle triggerAttachObject triggerAttachVehicle triggerDynamicSimulation triggerStatements triggerText triggerTimeout triggerTimeoutCurrent triggerType turretLocal turretOwner turretUnit tvAdd tvClear tvCollapse tvCollapseAll tvCount tvCurSel tvData tvDelete tvExpand tvExpandAll tvPicture tvSetColor tvSetCurSel tvSetData tvSetPicture tvSetPictureColor tvSetPictureColorDisabled tvSetPictureColorSelected tvSetPictureRight tvSetPictureRightColor tvSetPictureRightColorDisabled tvSetPictureRightColorSelected tvSetText tvSetTooltip tvSetValue tvSort tvSortByValue tvText tvTooltip tvValue type typeName typeOf UAVControl uiNamespace uiSleep unassignCurator unassignItem unassignTeam unassignVehicle underwater uniform uniformContainer uniformItems uniformMagazines unitAddons unitAimPosition unitAimPositionVisual unitBackpack unitIsUAV unitPos unitReady unitRecoilCoefficient units unitsBelowHeight unlinkItem unlockAchievement unregisterTask updateDrawIcon updateMenuItem updateObjectTree useAISteeringComponent useAudioTimeForMoves userInputDisabled vectorAdd vectorCos vectorCrossProduct vectorDiff vectorDir vectorDirVisual vectorDistance vectorDistanceSqr vectorDotProduct vectorFromTo vectorMagnitude vectorMagnitudeSqr vectorModelToWorld vectorModelToWorldVisual vectorMultiply vectorNormalized vectorUp vectorUpVisual vectorWorldToModel vectorWorldToModelVisual vehicle vehicleCargoEnabled vehicleChat vehicleRadio vehicleReceiveRemoteTargets vehicleReportOwnPosition vehicleReportRemoteTargets vehicles vehicleVarName velocity velocityModelSpace verifySignature vest vestContainer vestItems vestMagazines viewDistance visibleCompass visibleGPS visibleMap visiblePosition visiblePositionASL visibleScoretable visibleWatch waves waypointAttachedObject waypointAttachedVehicle waypointAttachObject waypointAttachVehicle waypointBehaviour waypointCombatMode waypointCompletionRadius waypointDescription waypointForceBehaviour waypointFormation waypointHousePosition waypointLoiterRadius waypointLoiterType waypointName waypointPosition waypoints waypointScript waypointsEnabledUAV waypointShow waypointSpeed waypointStatements waypointTimeout waypointTimeoutCurrent waypointType waypointVisible weaponAccessories weaponAccessoriesCargo weaponCargo weaponDirection weaponInertia weaponLowered weapons weaponsItems weaponsItemsCargo weaponState weaponsTurret weightRTD WFSideText wind ",literal:"blufor civilian configNull controlNull displayNull east endl false grpNull independent lineBreak locationNull nil objNull opfor pi resistance scriptNull sideAmbientLife sideEmpty sideLogic sideUnknown taskNull teamMemberNull true west"},contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.NUMBER_MODE,e,n,r,i],illegal:/#|^\$ /}}b2n.exports=zFi});var S2n=re((Bdc,x2n)=>{p();function KFi(t){var e=t.COMMENT("--","$");return{name:"SQL (more)",aliases:["mysql","oracle"],disableAutodetect:!0,case_insensitive:!0,illegal:/[<>{}*]/,contains:[{beginKeywords:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment values with",end:/;/,endsWithParent:!0,keywords:{$pattern:/[\w\.]+/,keyword:"as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias all allocate allow alter always analyze ancillary and anti any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound bucket buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain explode export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force foreign form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour hours http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lateral lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minutes minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notnull notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second seconds section securefile security seed segment select self semi sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tablesample tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unnest unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace window with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null unknown",built_in:"array bigint binary bit blob bool boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text time timestamp tinyint varchar varchar2 varying void"},contains:[{className:"string",begin:"'",end:"'",contains:[{begin:"''"}]},{className:"string",begin:'"',end:'"',contains:[{begin:'""'}]},{className:"string",begin:"`",end:"`"},t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,e,t.HASH_COMMENT_MODE]},t.C_BLOCK_COMMENT_MODE,e,t.HASH_COMMENT_MODE]}}x2n.exports=KFi});var w2n=re((Ddc,I2n)=>{p();function C2n(t){return t?typeof t=="string"?t:t.source:null}function JFi(...t){return t.map(n=>C2n(n)).join("")}function Hat(...t){return"("+t.map(n=>C2n(n)).join("|")+")"}function XFi(t){let e=t.COMMENT("--","$"),n={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},r={begin:/"/,end:/"/,contains:[{begin:/""/}]},i=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],a=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update ","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],l=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],d=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=u,h=[...c,...a].filter(E=>!u.includes(E)),f={className:"variable",begin:/@[a-z0-9]+/},g={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={begin:JFi(/\b/,Hat(...m),/\s*\(/),keywords:{built_in:m}};function y(E,{exceptions:_,when:S}={}){let C=S;return _=_||[],E.map(I=>I.match(/\|\d+$/)||_.includes(I)?I:C(I)?`${I}|0`:I)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:y(h,{when:E=>E.length<3}),literal:i,type:o,built_in:l},contains:[{begin:Hat(...d),keywords:{$pattern:/[\w\.]+/,keyword:h.concat(d),literal:i,type:o}},{className:"type",begin:Hat(...s)},A,f,n,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,e,g]}}I2n.exports=XFi});var v2n=re((Mdc,T2n)=>{p();function ZFi(t){let e=["functions","model","data","parameters","quantities","transformed","generated"],n=["for","in","if","else","while","break","continue","return"],r=["print","reject","increment_log_prob|10","integrate_ode|10","integrate_ode_rk45|10","integrate_ode_bdf|10","algebra_solver"],i=["int","real","vector","ordered","positive_ordered","simplex","unit_vector","row_vector","matrix","cholesky_factor_corr|10","cholesky_factor_cov|10","corr_matrix|10","cov_matrix|10","void"],s=["Phi","Phi_approx","abs","acos","acosh","algebra_solver","append_array","append_col","append_row","asin","asinh","atan","atan2","atanh","bernoulli_cdf","bernoulli_lccdf","bernoulli_lcdf","bernoulli_logit_lpmf","bernoulli_logit_rng","bernoulli_lpmf","bernoulli_rng","bessel_first_kind","bessel_second_kind","beta_binomial_cdf","beta_binomial_lccdf","beta_binomial_lcdf","beta_binomial_lpmf","beta_binomial_rng","beta_cdf","beta_lccdf","beta_lcdf","beta_lpdf","beta_rng","binary_log_loss","binomial_cdf","binomial_coefficient_log","binomial_lccdf","binomial_lcdf","binomial_logit_lpmf","binomial_lpmf","binomial_rng","block","categorical_logit_lpmf","categorical_logit_rng","categorical_lpmf","categorical_rng","cauchy_cdf","cauchy_lccdf","cauchy_lcdf","cauchy_lpdf","cauchy_rng","cbrt","ceil","chi_square_cdf","chi_square_lccdf","chi_square_lcdf","chi_square_lpdf","chi_square_rng","cholesky_decompose","choose","col","cols","columns_dot_product","columns_dot_self","cos","cosh","cov_exp_quad","crossprod","csr_extract_u","csr_extract_v","csr_extract_w","csr_matrix_times_vector","csr_to_dense_matrix","cumulative_sum","determinant","diag_matrix","diag_post_multiply","diag_pre_multiply","diagonal","digamma","dims","dirichlet_lpdf","dirichlet_rng","distance","dot_product","dot_self","double_exponential_cdf","double_exponential_lccdf","double_exponential_lcdf","double_exponential_lpdf","double_exponential_rng","e","eigenvalues_sym","eigenvectors_sym","erf","erfc","exp","exp2","exp_mod_normal_cdf","exp_mod_normal_lccdf","exp_mod_normal_lcdf","exp_mod_normal_lpdf","exp_mod_normal_rng","expm1","exponential_cdf","exponential_lccdf","exponential_lcdf","exponential_lpdf","exponential_rng","fabs","falling_factorial","fdim","floor","fma","fmax","fmin","fmod","frechet_cdf","frechet_lccdf","frechet_lcdf","frechet_lpdf","frechet_rng","gamma_cdf","gamma_lccdf","gamma_lcdf","gamma_lpdf","gamma_p","gamma_q","gamma_rng","gaussian_dlm_obs_lpdf","get_lp","gumbel_cdf","gumbel_lccdf","gumbel_lcdf","gumbel_lpdf","gumbel_rng","head","hypergeometric_lpmf","hypergeometric_rng","hypot","inc_beta","int_step","integrate_ode","integrate_ode_bdf","integrate_ode_rk45","inv","inv_Phi","inv_chi_square_cdf","inv_chi_square_lccdf","inv_chi_square_lcdf","inv_chi_square_lpdf","inv_chi_square_rng","inv_cloglog","inv_gamma_cdf","inv_gamma_lccdf","inv_gamma_lcdf","inv_gamma_lpdf","inv_gamma_rng","inv_logit","inv_sqrt","inv_square","inv_wishart_lpdf","inv_wishart_rng","inverse","inverse_spd","is_inf","is_nan","lbeta","lchoose","lgamma","lkj_corr_cholesky_lpdf","lkj_corr_cholesky_rng","lkj_corr_lpdf","lkj_corr_rng","lmgamma","lmultiply","log","log10","log1m","log1m_exp","log1m_inv_logit","log1p","log1p_exp","log2","log_determinant","log_diff_exp","log_falling_factorial","log_inv_logit","log_mix","log_rising_factorial","log_softmax","log_sum_exp","logistic_cdf","logistic_lccdf","logistic_lcdf","logistic_lpdf","logistic_rng","logit","lognormal_cdf","lognormal_lccdf","lognormal_lcdf","lognormal_lpdf","lognormal_rng","machine_precision","matrix_exp","max","mdivide_left_spd","mdivide_left_tri_low","mdivide_right_spd","mdivide_right_tri_low","mean","min","modified_bessel_first_kind","modified_bessel_second_kind","multi_gp_cholesky_lpdf","multi_gp_lpdf","multi_normal_cholesky_lpdf","multi_normal_cholesky_rng","multi_normal_lpdf","multi_normal_prec_lpdf","multi_normal_rng","multi_student_t_lpdf","multi_student_t_rng","multinomial_lpmf","multinomial_rng","multiply_log","multiply_lower_tri_self_transpose","neg_binomial_2_cdf","neg_binomial_2_lccdf","neg_binomial_2_lcdf","neg_binomial_2_log_lpmf","neg_binomial_2_log_rng","neg_binomial_2_lpmf","neg_binomial_2_rng","neg_binomial_cdf","neg_binomial_lccdf","neg_binomial_lcdf","neg_binomial_lpmf","neg_binomial_rng","negative_infinity","normal_cdf","normal_lccdf","normal_lcdf","normal_lpdf","normal_rng","not_a_number","num_elements","ordered_logistic_lpmf","ordered_logistic_rng","owens_t","pareto_cdf","pareto_lccdf","pareto_lcdf","pareto_lpdf","pareto_rng","pareto_type_2_cdf","pareto_type_2_lccdf","pareto_type_2_lcdf","pareto_type_2_lpdf","pareto_type_2_rng","pi","poisson_cdf","poisson_lccdf","poisson_lcdf","poisson_log_lpmf","poisson_log_rng","poisson_lpmf","poisson_rng","positive_infinity","pow","print","prod","qr_Q","qr_R","quad_form","quad_form_diag","quad_form_sym","rank","rayleigh_cdf","rayleigh_lccdf","rayleigh_lcdf","rayleigh_lpdf","rayleigh_rng","reject","rep_array","rep_matrix","rep_row_vector","rep_vector","rising_factorial","round","row","rows","rows_dot_product","rows_dot_self","scaled_inv_chi_square_cdf","scaled_inv_chi_square_lccdf","scaled_inv_chi_square_lcdf","scaled_inv_chi_square_lpdf","scaled_inv_chi_square_rng","sd","segment","sin","singular_values","sinh","size","skew_normal_cdf","skew_normal_lccdf","skew_normal_lcdf","skew_normal_lpdf","skew_normal_rng","softmax","sort_asc","sort_desc","sort_indices_asc","sort_indices_desc","sqrt","sqrt2","square","squared_distance","step","student_t_cdf","student_t_lccdf","student_t_lcdf","student_t_lpdf","student_t_rng","sub_col","sub_row","sum","tail","tan","tanh","target","tcrossprod","tgamma","to_array_1d","to_array_2d","to_matrix","to_row_vector","to_vector","trace","trace_gen_quad_form","trace_quad_form","trigamma","trunc","uniform_cdf","uniform_lccdf","uniform_lcdf","uniform_lpdf","uniform_rng","variance","von_mises_lpdf","von_mises_rng","weibull_cdf","weibull_lccdf","weibull_lcdf","weibull_lpdf","weibull_rng","wiener_lpdf","wishart_lpdf","wishart_rng"],o=["bernoulli","bernoulli_logit","beta","beta_binomial","binomial","binomial_logit","categorical","categorical_logit","cauchy","chi_square","dirichlet","double_exponential","exp_mod_normal","exponential","frechet","gamma","gaussian_dlm_obs","gumbel","hypergeometric","inv_chi_square","inv_gamma","inv_wishart","lkj_corr","lkj_corr_cholesky","logistic","lognormal","multi_gp","multi_gp_cholesky","multi_normal","multi_normal_cholesky","multi_normal_prec","multi_student_t","multinomial","neg_binomial","neg_binomial_2","neg_binomial_2_log","normal","ordered_logistic","pareto","pareto_type_2","poisson","poisson_log","rayleigh","scaled_inv_chi_square","skew_normal","student_t","uniform","von_mises","weibull","wiener","wishart"];return{name:"Stan",aliases:["stanfuncs"],keywords:{$pattern:t.IDENT_RE,title:e,keyword:n.concat(i).concat(r),built_in:s},contains:[t.C_LINE_COMMENT_MODE,t.COMMENT(/#/,/$/,{relevance:0,keywords:{"meta-keyword":"include"}}),t.COMMENT(/\/\*/,/\*\//,{relevance:0,contains:[{className:"doctag",begin:/@(return|param)/}]}),{begin:/<\s*lower\s*=/,keywords:"lower"},{begin:/[<,]\s*upper\s*=/,keywords:"upper"},{className:"keyword",begin:/\btarget\s*\+=/,relevance:10},{begin:"~\\s*("+t.IDENT_RE+")\\s*\\(",keywords:o},{className:"number",variants:[{begin:/\b\d+(?:\.\d*)?(?:[eE][+-]?\d+)?/},{begin:/\.\d+(?:[eE][+-]?\d+)?\b/}],relevance:0},{className:"string",begin:'"',end:'"',relevance:0}]}}T2n.exports=ZFi});var k2n=re((Ldc,R2n)=>{p();function eQi(t){return{name:"Stata",aliases:["do","ado"],case_insensitive:!0,keywords:"if else in foreach for forv forva forval forvalu forvalue forvalues by bys bysort xi quietly qui capture about ac ac_7 acprplot acprplot_7 adjust ado adopath adoupdate alpha ameans an ano anov anova anova_estat anova_terms anovadef aorder ap app appe appen append arch arch_dr arch_estat arch_p archlm areg areg_p args arima arima_dr arima_estat arima_p as asmprobit asmprobit_estat asmprobit_lf asmprobit_mfx__dlg asmprobit_p ass asse asser assert avplot avplot_7 avplots avplots_7 bcskew0 bgodfrey bias binreg bip0_lf biplot bipp_lf bipr_lf bipr_p biprobit bitest bitesti bitowt blogit bmemsize boot bootsamp bootstrap bootstrap_8 boxco_l boxco_p boxcox boxcox_6 boxcox_p bprobit br break brier bro brow brows browse brr brrstat bs bs_7 bsampl_w bsample bsample_7 bsqreg bstat bstat_7 bstat_8 bstrap bstrap_7 bubble bubbleplot ca ca_estat ca_p cabiplot camat canon canon_8 canon_8_p canon_estat canon_p cap caprojection capt captu captur capture cat cc cchart cchart_7 cci cd censobs_table centile cf char chdir checkdlgfiles checkestimationsample checkhlpfiles checksum chelp ci cii cl class classutil clear cli clis clist clo clog clog_lf clog_p clogi clogi_sw clogit clogit_lf clogit_p clogitp clogl_sw cloglog clonevar clslistarray cluster cluster_measures cluster_stop cluster_tree cluster_tree_8 clustermat cmdlog cnr cnre cnreg cnreg_p cnreg_sw cnsreg codebook collaps4 collapse colormult_nb colormult_nw compare compress conf confi confir confirm conren cons const constr constra constrai constrain constraint continue contract copy copyright copysource cor corc corr corr2data corr_anti corr_kmo corr_smc corre correl correla correlat correlate corrgram cou coun count cox cox_p cox_sw coxbase coxhaz coxvar cprplot cprplot_7 crc cret cretu cretur creturn cross cs cscript cscript_log csi ct ct_is ctset ctst_5 ctst_st cttost cumsp cumsp_7 cumul cusum cusum_7 cutil d|0 datasig datasign datasigna datasignat datasignatu datasignatur datasignature datetof db dbeta de dec deco decod decode deff des desc descr descri describ describe destring dfbeta dfgls dfuller di di_g dir dirstats dis discard disp disp_res disp_s displ displa display distinct do doe doed doedi doedit dotplot dotplot_7 dprobit drawnorm drop ds ds_util dstdize duplicates durbina dwstat dydx e|0 ed edi edit egen eivreg emdef en enc enco encod encode eq erase ereg ereg_lf ereg_p ereg_sw ereghet ereghet_glf ereghet_glf_sh ereghet_gp ereghet_ilf ereghet_ilf_sh ereghet_ip eret eretu eretur ereturn err erro error esize est est_cfexist est_cfname est_clickable est_expand est_hold est_table est_unhold est_unholdok estat estat_default estat_summ estat_vce_only esti estimates etodow etof etomdy ex exi exit expand expandcl fac fact facto factor factor_estat factor_p factor_pca_rotated factor_rotate factormat fcast fcast_compute fcast_graph fdades fdadesc fdadescr fdadescri fdadescrib fdadescribe fdasav fdasave fdause fh_st file open file read file close file filefilter fillin find_hlp_file findfile findit findit_7 fit fl fli flis flist for5_0 forest forestplot form forma format fpredict frac_154 frac_adj frac_chk frac_cox frac_ddp frac_dis frac_dv frac_in frac_mun frac_pp frac_pq frac_pv frac_wgt frac_xo fracgen fracplot fracplot_7 fracpoly fracpred fron_ex fron_hn fron_p fron_tn fron_tn2 frontier ftodate ftoe ftomdy ftowdate funnel funnelplot g|0 gamhet_glf gamhet_gp gamhet_ilf gamhet_ip gamma gamma_d2 gamma_p gamma_sw gammahet gdi_hexagon gdi_spokes ge gen gene gener genera generat generate genrank genstd genvmean gettoken gl gladder gladder_7 glim_l01 glim_l02 glim_l03 glim_l04 glim_l05 glim_l06 glim_l07 glim_l08 glim_l09 glim_l10 glim_l11 glim_l12 glim_lf glim_mu glim_nw1 glim_nw2 glim_nw3 glim_p glim_v1 glim_v2 glim_v3 glim_v4 glim_v5 glim_v6 glim_v7 glm glm_6 glm_p glm_sw glmpred glo glob globa global glogit glogit_8 glogit_p gmeans gnbre_lf gnbreg gnbreg_5 gnbreg_p gomp_lf gompe_sw gomper_p gompertz gompertzhet gomphet_glf gomphet_glf_sh gomphet_gp gomphet_ilf gomphet_ilf_sh gomphet_ip gphdot gphpen gphprint gprefs gprobi_p gprobit gprobit_8 gr gr7 gr_copy gr_current gr_db gr_describe gr_dir gr_draw gr_draw_replay gr_drop gr_edit gr_editviewopts gr_example gr_example2 gr_export gr_print gr_qscheme gr_query gr_read gr_rename gr_replay gr_save gr_set gr_setscheme gr_table gr_undo gr_use graph graph7 grebar greigen greigen_7 greigen_8 grmeanby grmeanby_7 gs_fileinfo gs_filetype gs_graphinfo gs_stat gsort gwood h|0 hadimvo hareg hausman haver he heck_d2 heckma_p heckman heckp_lf heckpr_p heckprob hel help hereg hetpr_lf hetpr_p hetprob hettest hexdump hilite hist hist_7 histogram hlogit hlu hmeans hotel hotelling hprobit hreg hsearch icd9 icd9_ff icd9p iis impute imtest inbase include inf infi infil infile infix inp inpu input ins insheet insp inspe inspec inspect integ inten intreg intreg_7 intreg_p intrg2_ll intrg_ll intrg_ll2 ipolate iqreg ir irf irf_create irfm iri is_svy is_svysum isid istdize ivprob_1_lf ivprob_lf ivprobit ivprobit_p ivreg ivreg_footnote ivtob_1_lf ivtob_lf ivtobit ivtobit_p jackknife jacknife jknife jknife_6 jknife_8 jkstat joinby kalarma1 kap kap_3 kapmeier kappa kapwgt kdensity kdensity_7 keep ksm ksmirnov ktau kwallis l|0 la lab labbe labbeplot labe label labelbook ladder levels levelsof leverage lfit lfit_p li lincom line linktest lis list lloghet_glf lloghet_glf_sh lloghet_gp lloghet_ilf lloghet_ilf_sh lloghet_ip llogi_sw llogis_p llogist llogistic llogistichet lnorm_lf lnorm_sw lnorma_p lnormal lnormalhet lnormhet_glf lnormhet_glf_sh lnormhet_gp lnormhet_ilf lnormhet_ilf_sh lnormhet_ip lnskew0 loadingplot loc loca local log logi logis_lf logistic logistic_p logit logit_estat logit_p loglogs logrank loneway lookfor lookup lowess lowess_7 lpredict lrecomp lroc lroc_7 lrtest ls lsens lsens_7 lsens_x lstat ltable ltable_7 ltriang lv lvr2plot lvr2plot_7 m|0 ma mac macr macro makecns man manova manova_estat manova_p manovatest mantel mark markin markout marksample mat mat_capp mat_order mat_put_rr mat_rapp mata mata_clear mata_describe mata_drop mata_matdescribe mata_matsave mata_matuse mata_memory mata_mlib mata_mosave mata_rename mata_which matalabel matcproc matlist matname matr matri matrix matrix_input__dlg matstrik mcc mcci md0_ md1_ md1debug_ md2_ md2debug_ mds mds_estat mds_p mdsconfig mdslong mdsmat mdsshepard mdytoe mdytof me_derd mean means median memory memsize menl meqparse mer merg merge meta mfp mfx mhelp mhodds minbound mixed_ll mixed_ll_reparm mkassert mkdir mkmat mkspline ml ml_5 ml_adjs ml_bhhhs ml_c_d ml_check ml_clear ml_cnt ml_debug ml_defd ml_e0 ml_e0_bfgs ml_e0_cycle ml_e0_dfp ml_e0i ml_e1 ml_e1_bfgs ml_e1_bhhh ml_e1_cycle ml_e1_dfp ml_e2 ml_e2_cycle ml_ebfg0 ml_ebfr0 ml_ebfr1 ml_ebh0q ml_ebhh0 ml_ebhr0 ml_ebr0i ml_ecr0i ml_edfp0 ml_edfr0 ml_edfr1 ml_edr0i ml_eds ml_eer0i ml_egr0i ml_elf ml_elf_bfgs ml_elf_bhhh ml_elf_cycle ml_elf_dfp ml_elfi ml_elfs ml_enr0i ml_enrr0 ml_erdu0 ml_erdu0_bfgs ml_erdu0_bhhh ml_erdu0_bhhhq ml_erdu0_cycle ml_erdu0_dfp ml_erdu0_nrbfgs ml_exde ml_footnote ml_geqnr ml_grad0 ml_graph ml_hbhhh ml_hd0 ml_hold ml_init ml_inv ml_log ml_max ml_mlout ml_mlout_8 ml_model ml_nb0 ml_opt ml_p ml_plot ml_query ml_rdgrd ml_repor ml_s_e ml_score ml_searc ml_technique ml_unhold mleval mlf_ mlmatbysum mlmatsum mlog mlogi mlogit mlogit_footnote mlogit_p mlopts mlsum mlvecsum mnl0_ mor more mov move mprobit mprobit_lf mprobit_p mrdu0_ mrdu1_ mvdecode mvencode mvreg mvreg_estat n|0 nbreg nbreg_al nbreg_lf nbreg_p nbreg_sw nestreg net newey newey_7 newey_p news nl nl_7 nl_9 nl_9_p nl_p nl_p_7 nlcom nlcom_p nlexp2 nlexp2_7 nlexp2a nlexp2a_7 nlexp3 nlexp3_7 nlgom3 nlgom3_7 nlgom4 nlgom4_7 nlinit nllog3 nllog3_7 nllog4 nllog4_7 nlog_rd nlogit nlogit_p nlogitgen nlogittree nlpred no nobreak noi nois noisi noisil noisily note notes notes_dlg nptrend numlabel numlist odbc old_ver olo olog ologi ologi_sw ologit ologit_p ologitp on one onew onewa oneway op_colnm op_comp op_diff op_inv op_str opr opro oprob oprob_sw oprobi oprobi_p oprobit oprobitp opts_exclusive order orthog orthpoly ou out outf outfi outfil outfile outs outsh outshe outshee outsheet ovtest pac pac_7 palette parse parse_dissim pause pca pca_8 pca_display pca_estat pca_p pca_rotate pcamat pchart pchart_7 pchi pchi_7 pcorr pctile pentium pergram pergram_7 permute permute_8 personal peto_st pkcollapse pkcross pkequiv pkexamine pkexamine_7 pkshape pksumm pksumm_7 pl plo plot plugin pnorm pnorm_7 poisgof poiss_lf poiss_sw poisso_p poisson poisson_estat post postclose postfile postutil pperron pr prais prais_e prais_e2 prais_p predict predictnl preserve print pro prob probi probit probit_estat probit_p proc_time procoverlay procrustes procrustes_estat procrustes_p profiler prog progr progra program prop proportion prtest prtesti pwcorr pwd q\\s qby qbys qchi qchi_7 qladder qladder_7 qnorm qnorm_7 qqplot qqplot_7 qreg qreg_c qreg_p qreg_sw qu quadchk quantile quantile_7 que quer query range ranksum ratio rchart rchart_7 rcof recast reclink recode reg reg3 reg3_p regdw regr regre regre_p2 regres regres_p regress regress_estat regriv_p remap ren rena renam rename renpfix repeat replace report reshape restore ret retu retur return rm rmdir robvar roccomp roccomp_7 roccomp_8 rocf_lf rocfit rocfit_8 rocgold rocplot rocplot_7 roctab roctab_7 rolling rologit rologit_p rot rota rotat rotate rotatemat rreg rreg_p ru run runtest rvfplot rvfplot_7 rvpplot rvpplot_7 sa safesum sample sampsi sav save savedresults saveold sc sca scal scala scalar scatter scm_mine sco scob_lf scob_p scobi_sw scobit scor score scoreplot scoreplot_help scree screeplot screeplot_help sdtest sdtesti se search separate seperate serrbar serrbar_7 serset set set_defaults sfrancia sh she shel shell shewhart shewhart_7 signestimationsample signrank signtest simul simul_7 simulate simulate_8 sktest sleep slogit slogit_d2 slogit_p smooth snapspan so sor sort spearman spikeplot spikeplot_7 spikeplt spline_x split sqreg sqreg_p sret sretu sretur sreturn ssc st st_ct st_hc st_hcd st_hcd_sh st_is st_issys st_note st_promo st_set st_show st_smpl st_subid stack statsby statsby_8 stbase stci stci_7 stcox stcox_estat stcox_fr stcox_fr_ll stcox_p stcox_sw stcoxkm stcoxkm_7 stcstat stcurv stcurve stcurve_7 stdes stem stepwise stereg stfill stgen stir stjoin stmc stmh stphplot stphplot_7 stphtest stphtest_7 stptime strate strate_7 streg streg_sw streset sts sts_7 stset stsplit stsum sttocc sttoct stvary stweib su suest suest_8 sum summ summa summar summari summariz summarize sunflower sureg survcurv survsum svar svar_p svmat svy svy_disp svy_dreg svy_est svy_est_7 svy_estat svy_get svy_gnbreg_p svy_head svy_header svy_heckman_p svy_heckprob_p svy_intreg_p svy_ivreg_p svy_logistic_p svy_logit_p svy_mlogit_p svy_nbreg_p svy_ologit_p svy_oprobit_p svy_poisson_p svy_probit_p svy_regress_p svy_sub svy_sub_7 svy_x svy_x_7 svy_x_p svydes svydes_8 svygen svygnbreg svyheckman svyheckprob svyintreg svyintreg_7 svyintrg svyivreg svylc svylog_p svylogit svymarkout svymarkout_8 svymean svymlog svymlogit svynbreg svyolog svyologit svyoprob svyoprobit svyopts svypois svypois_7 svypoisson svyprobit svyprobt svyprop svyprop_7 svyratio svyreg svyreg_p svyregress svyset svyset_7 svyset_8 svytab svytab_7 svytest svytotal sw sw_8 swcnreg swcox swereg swilk swlogis swlogit swologit swoprbt swpois swprobit swqreg swtobit swweib symmetry symmi symplot symplot_7 syntax sysdescribe sysdir sysuse szroeter ta tab tab1 tab2 tab_or tabd tabdi tabdis tabdisp tabi table tabodds tabodds_7 tabstat tabu tabul tabula tabulat tabulate te tempfile tempname tempvar tes test testnl testparm teststd tetrachoric time_it timer tis tob tobi tobit tobit_p tobit_sw token tokeni tokeniz tokenize tostring total translate translator transmap treat_ll treatr_p treatreg trim trimfill trnb_cons trnb_mean trpoiss_d2 trunc_ll truncr_p truncreg tsappend tset tsfill tsline tsline_ex tsreport tsrevar tsrline tsset tssmooth tsunab ttest ttesti tut_chk tut_wait tutorial tw tware_st two twoway twoway__fpfit_serset twoway__function_gen twoway__histogram_gen twoway__ipoint_serset twoway__ipoints_serset twoway__kdensity_gen twoway__lfit_serset twoway__normgen_gen twoway__pci_serset twoway__qfit_serset twoway__scatteri_serset twoway__sunflower_gen twoway_ksm_serset ty typ type typeof u|0 unab unabbrev unabcmd update us use uselabel var var_mkcompanion var_p varbasic varfcast vargranger varirf varirf_add varirf_cgraph varirf_create varirf_ctable varirf_describe varirf_dir varirf_drop varirf_erase varirf_graph varirf_ograph varirf_rename varirf_set varirf_table varlist varlmar varnorm varsoc varstable varstable_w varstable_w2 varwle vce vec vec_fevd vec_mkphi vec_p vec_p_w vecirf_create veclmar veclmar_w vecnorm vecnorm_w vecrank vecstable verinst vers versi versio version view viewsource vif vwls wdatetof webdescribe webseek webuse weib1_lf weib2_lf weib_lf weib_lf0 weibhet_glf weibhet_glf_sh weibhet_glfa weibhet_glfa_sh weibhet_gp weibhet_ilf weibhet_ilf_sh weibhet_ilfa weibhet_ilfa_sh weibhet_ip weibu_sw weibul_p weibull weibull_c weibull_s weibullhet wh whelp whi which whil while wilc_st wilcoxon win wind windo window winexec wntestb wntestb_7 wntestq xchart xchart_7 xcorr xcorr_7 xi xi_6 xmlsav xmlsave xmluse xpose xsh xshe xshel xshell xt_iis xt_tis xtab_p xtabond xtbin_p xtclog xtcloglog xtcloglog_8 xtcloglog_d2 xtcloglog_pa_p xtcloglog_re_p xtcnt_p xtcorr xtdata xtdes xtfront_p xtfrontier xtgee xtgee_elink xtgee_estat xtgee_makeivar xtgee_p xtgee_plink xtgls xtgls_p xthaus xthausman xtht_p xthtaylor xtile xtint_p xtintreg xtintreg_8 xtintreg_d2 xtintreg_p xtivp_1 xtivp_2 xtivreg xtline xtline_ex xtlogit xtlogit_8 xtlogit_d2 xtlogit_fe_p xtlogit_pa_p xtlogit_re_p xtmixed xtmixed_estat xtmixed_p xtnb_fe xtnb_lf xtnbreg xtnbreg_pa_p xtnbreg_refe_p xtpcse xtpcse_p xtpois xtpoisson xtpoisson_d2 xtpoisson_pa_p xtpoisson_refe_p xtpred xtprobit xtprobit_8 xtprobit_d2 xtprobit_re_p xtps_fe xtps_lf xtps_ren xtps_ren_8 xtrar_p xtrc xtrc_p xtrchh xtrefe_p xtreg xtreg_be xtreg_fe xtreg_ml xtreg_pa_p xtreg_re xtregar xtrere_p xtset xtsf_ll xtsf_llti xtsum xttab xttest0 xttobit xttobit_8 xttobit_p xttrans yx yxview__barlike_draw yxview_area_draw yxview_bar_draw yxview_dot_draw yxview_dropline_draw yxview_function_draw yxview_iarrow_draw yxview_ilabels_draw yxview_normal_draw yxview_pcarrow_draw yxview_pcbarrow_draw yxview_pccapsym_draw yxview_pcscatter_draw yxview_pcspike_draw yxview_rarea_draw yxview_rbar_draw yxview_rbarm_draw yxview_rcap_draw yxview_rcapsym_draw yxview_rconnected_draw yxview_rline_draw yxview_rscatter_draw yxview_rspike_draw yxview_spike_draw yxview_sunflower_draw zap_s zinb zinb_llf zinb_plf zip zip_llf zip_p zip_plf zt_ct_5 zt_hc_5 zt_hcd_5 zt_is_5 zt_iss_5 zt_sho_5 zt_smp_5 ztbase_5 ztcox_5 ztdes_5 ztereg_5 ztfill_5 ztgen_5 ztir_5 ztjoin_5 ztnb ztnb_p ztp ztp_p zts_5 ztset_5 ztspli_5 ztsum_5 zttoct_5 ztvary_5 ztweib_5",contains:[{className:"symbol",begin:/`[a-zA-Z0-9_]+'/},{className:"variable",begin:/\$\{?[a-zA-Z0-9_]+\}?/},{className:"string",variants:[{begin:`\`"[^\r ]*?"'`},{begin:`"[^\r -"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},t.COMMENT("^[ ]*\\*.*$",!1),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]}}fpn.exports=Aos});var ypn=ee((hPa,Apn)=>{p();function yos(t){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:"HEADER ENDSEC DATA"},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.COMMENT("/\\*\\*!","\\*/"),t.C_NUMBER_MODE,t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}Apn.exports=yos});var bpn=ee((fPa,Epn)=>{p();var Eos=t=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]}}),bos=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],_os=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Sos=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Cos=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Ios=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse();function xos(t){let e=Eos(t),n="and or not only",r={className:"variable",begin:"\\$"+t.IDENT_RE},s=["charset","css","debug","extend","font-face","for","import","include","keyframes","media","mixin","page","warn","while"],i="(?=[.\\s\\n[:,(])";return{name:"Stylus",aliases:["styl"],case_insensitive:!1,keywords:"if else for in",illegal:"("+["\\?","(\\bReturn\\b)","(\\bEnd\\b)","(\\bend\\b)","(\\bdef\\b)",";","#\\s","\\*\\s","===\\s","\\|","%"].join("|")+")",contains:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.HEXCOLOR,{begin:"\\.[a-zA-Z][a-zA-Z0-9_-]*"+i,className:"selector-class"},{begin:"#[a-zA-Z][a-zA-Z0-9_-]*"+i,className:"selector-id"},{begin:"\\b("+bos.join("|")+")"+i,className:"selector-tag"},{className:"selector-pseudo",begin:"&?:("+Sos.join("|")+")"+i},{className:"selector-pseudo",begin:"&?::("+Cos.join("|")+")"+i},e.ATTRIBUTE_SELECTOR_MODE,{className:"keyword",begin:/@media/,starts:{end:/[{;}]/,keywords:{$pattern:/[a-z-]+/,keyword:n,attribute:_os.join(" ")},contains:[t.CSS_NUMBER_MODE]}},{className:"keyword",begin:"@((-(o|moz|ms|webkit)-)?("+s.join("|")+"))\\b"},r,t.CSS_NUMBER_MODE,{className:"function",begin:"^[a-zA-Z][a-zA-Z0-9_-]*\\(.*\\)",illegal:"[\\n]",returnBegin:!0,contains:[{className:"title",begin:"\\b[a-zA-Z][a-zA-Z0-9_-]*"},{className:"params",begin:/\(/,end:/\)/,contains:[e.HEXCOLOR,r,t.APOS_STRING_MODE,t.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE]}]},{className:"attribute",begin:"\\b("+Ios.join("|")+")\\b",starts:{end:/;|$/,contains:[e.HEXCOLOR,r,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.CSS_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,e.IMPORTANT],illegal:/\./,relevance:0}}]}}Epn.exports=xos});var Spn=ee((APa,_pn)=>{p();function wos(t){return{name:"SubUnit",case_insensitive:!0,contains:[{className:"string",begin:`\\[ +"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},t.COMMENT("^[ ]*\\*.*$",!1),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]}}R2n.exports=eQi});var N2n=re((Qdc,B2n)=>{p();function tQi(t){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:"HEADER ENDSEC DATA"},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.COMMENT("/\\*\\*!","\\*/"),t.C_NUMBER_MODE,t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}B2n.exports=tQi});var P2n=re((Gdc,D2n)=>{p();var nQi=t=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]}}),rQi=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],iQi=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],sQi=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],oQi=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],aQi=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse();function cQi(t){let e=nQi(t),n="and or not only",r={className:"variable",begin:"\\$"+t.IDENT_RE},i=["charset","css","debug","extend","font-face","for","import","include","keyframes","media","mixin","page","warn","while"],s="(?=[.\\s\\n[:,(])";return{name:"Stylus",aliases:["styl"],case_insensitive:!1,keywords:"if else for in",illegal:"("+["\\?","(\\bReturn\\b)","(\\bEnd\\b)","(\\bend\\b)","(\\bdef\\b)",";","#\\s","\\*\\s","===\\s","\\|","%"].join("|")+")",contains:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.HEXCOLOR,{begin:"\\.[a-zA-Z][a-zA-Z0-9_-]*"+s,className:"selector-class"},{begin:"#[a-zA-Z][a-zA-Z0-9_-]*"+s,className:"selector-id"},{begin:"\\b("+rQi.join("|")+")"+s,className:"selector-tag"},{className:"selector-pseudo",begin:"&?:("+sQi.join("|")+")"+s},{className:"selector-pseudo",begin:"&?::("+oQi.join("|")+")"+s},e.ATTRIBUTE_SELECTOR_MODE,{className:"keyword",begin:/@media/,starts:{end:/[{;}]/,keywords:{$pattern:/[a-z-]+/,keyword:n,attribute:iQi.join(" ")},contains:[t.CSS_NUMBER_MODE]}},{className:"keyword",begin:"@((-(o|moz|ms|webkit)-)?("+i.join("|")+"))\\b"},r,t.CSS_NUMBER_MODE,{className:"function",begin:"^[a-zA-Z][a-zA-Z0-9_-]*\\(.*\\)",illegal:"[\\n]",returnBegin:!0,contains:[{className:"title",begin:"\\b[a-zA-Z][a-zA-Z0-9_-]*"},{className:"params",begin:/\(/,end:/\)/,contains:[e.HEXCOLOR,r,t.APOS_STRING_MODE,t.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE]}]},{className:"attribute",begin:"\\b("+aQi.join("|")+")\\b",starts:{end:/;|$/,contains:[e.HEXCOLOR,r,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.CSS_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,e.IMPORTANT],illegal:/\./,relevance:0}}]}}D2n.exports=cQi});var O2n=re((Wdc,M2n)=>{p();function lQi(t){return{name:"SubUnit",case_insensitive:!0,contains:[{className:"string",begin:`\\[ (multipart)?`,end:`\\] -`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}_pn.exports=wos});var Ipn=ee((EPa,Cpn)=>{p();function Tos(t){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\(/,end:/\)/,contains:["self",{begin:/\\./}]}],relevance:10},{className:"keyword",begin:/\$(?!noop)[a-zA-Z][_a-zA-Z0-9]*/,end:/\(/,excludeEnd:!0},{className:"variable",begin:/%[_a-zA-Z0-9:]*/,end:"%"},{className:"symbol",begin:/\\./}]}}Cpn.exports=Tos});var wpn=ee((_Pa,xpn)=>{p();function vos(t){var e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,s]},o=t.inherit(i,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),a="[0-9]{4}(-[0-9][0-9]){0,2}",c="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",u="(\\.[0-9]*)?",l="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",d={className:"number",begin:"\\b"+a+c+u+l+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},f={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},g=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},d,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},m,f,i],A=[...g];return A.pop(),A.push(o),h.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}xpn.exports=vos});var vpn=ee((CPa,Tpn)=>{p();function Ros(t){return{name:"Test Anything Protocol",case_insensitive:!0,contains:[t.HASH_COMMENT_MODE,{className:"meta",variants:[{begin:"^TAP version (\\d+)$"},{begin:"^1\\.\\.(\\d+)$"}]},{begin:/---$/,end:"\\.\\.\\.$",subLanguage:"yaml",relevance:0},{className:"number",begin:" (\\d+) "},{className:"symbol",variants:[{begin:"^ok"},{begin:"^not ok"}]}]}}Tpn.exports=Ros});var Npn=ee((xPa,kpn)=>{p();function kos(t){return t?typeof t=="string"?t:t.source:null}function Nos(t){return Rpn("(",t,")?")}function Rpn(...t){return t.map(n=>kos(n)).join("")}function Dos(t){let e=/[a-zA-Z_][a-zA-Z0-9_]*/,n={className:"number",variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:"after append apply array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd chan clock close concat continue dde dict encoding eof error eval exec exit expr fblocked fconfigure fcopy file fileevent filename flush for foreach format gets glob global history http if incr info interp join lappend|10 lassign|10 lindex|10 linsert|10 list llength|10 load lrange|10 lrepeat|10 lreplace|10 lreverse|10 lsearch|10 lset|10 lsort|10 mathfunc mathop memory msgcat namespace open package parray pid pkg::create pkg_mkIndex platform platform::shell proc puts pwd read refchan regexp registry regsub|10 rename return safe scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter tcl_wordBreakBefore tcltest tclvars tell time tm trace unknown unload unset update uplevel upvar variable vwait while",contains:[t.COMMENT(";[ \\t]*#","$"),t.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:Rpn(/\$/,Nos(/::/),e,"(::",e,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[n]}]},{className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.inherit(t.QUOTE_STRING_MODE,{illegal:null})]},n]}}kpn.exports=Dos});var Bpn=ee((TPa,Dpn)=>{p();function Bos(t){let e="bool byte i16 i32 i64 double string binary";return{name:"Thrift",keywords:{keyword:"namespace const typedef struct enum service exception void oneway set list map required optional",built_in:e,literal:"true false"},contains:[t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"struct enum service exception",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:"\\b(set|list|map)\\s*<",end:">",keywords:e,contains:["self"]}]}}Dpn.exports=Bos});var Opn=ee((RPa,Ppn)=>{p();function Pos(t){let e={className:"number",begin:"[1-9][0-9]*",relevance:0},n={className:"symbol",begin:":[^\\]]+"},r={className:"built_in",begin:"(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",end:"\\]",contains:["self",e,n]},s={className:"built_in",begin:"(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",end:"\\]",contains:["self",e,t.QUOTE_STRING_MODE,n]};return{name:"TP",keywords:{keyword:"ABORT ACC ADJUST AND AP_LD BREAK CALL CNT COL CONDITION CONFIG DA DB DIV DETECT ELSE END ENDFOR ERR_NUM ERROR_PROG FINE FOR GP GUARD INC IF JMP LINEAR_MAX_SPEED LOCK MOD MONITOR OFFSET Offset OR OVERRIDE PAUSE PREG PTH RT_LD RUN SELECT SKIP Skip TA TB TO TOOL_OFFSET Tool_Offset UF UT UFRAME_NUM UTOOL_NUM UNLOCK WAIT X Y Z W P R STRLEN SUBSTR FINDSTR VOFFSET PROG ATTR MN POS",literal:"ON OFF max_speed LPOS JPOS ENABLE DISABLE START STOP RESET"},contains:[r,s,{className:"keyword",begin:"/(PROG|ATTR|MN|POS|END)\\b"},{className:"keyword",begin:"(CALL|RUN|POINT_LOGIC|LBL)\\b"},{className:"keyword",begin:"\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"},{className:"number",begin:"\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",relevance:0},t.COMMENT("//","[;$]"),t.COMMENT("!","[;$]"),t.COMMENT("--eg:","$"),t.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"'"},t.C_NUMBER_MODE,{className:"variable",begin:"\\$[A-Za-z0-9_]+"}]}}Ppn.exports=Pos});var Lpn=ee((NPa,Mpn)=>{p();function Oos(t){var e={className:"params",begin:"\\(",end:"\\)"},n="attribute block constant cycle date dump include max min parent random range source template_from_string",r={beginKeywords:n,keywords:{name:n},relevance:0,contains:[e]},s={begin:/\|[A-Za-z_]+:?/,keywords:"abs batch capitalize column convert_encoding date date_modify default escape filter first format inky_to_html inline_css join json_encode keys last length lower map markdown merge nl2br number_format raw reduce replace reverse round slice sort spaceless split striptags title trim upper url_encode",contains:[r]},i="apply autoescape block deprecated do embed extends filter flush for from if import include macro sandbox set use verbatim with";return i=i+" "+i.split(" ").map(function(o){return"end"+o}).join(" "),{name:"Twig",aliases:["craftcms"],case_insensitive:!0,subLanguage:"xml",contains:[t.COMMENT(/\{#/,/#\}/),{className:"template-tag",begin:/\{%/,end:/%\}/,contains:[{className:"name",begin:/\w+/,keywords:i,starts:{endsWithParent:!0,contains:[s,r],relevance:0}}]},{className:"template-variable",begin:/\{\{/,end:/\}\}/,contains:["self",s,r]}]}}Mpn.exports=Oos});var Qpn=ee((BPa,Fpn)=>{p();function Mos(t){return{name:"Vala",keywords:{keyword:"char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override virtual delegate if while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",built_in:"DBus GLib CCode Gee Object Gtk Posix",literal:"false true null"},contains:[{className:"class",beginKeywords:"class interface namespace",end:/\{/,excludeEnd:!0,illegal:"[^,:\\n\\s\\.]",contains:[t.UNDERSCORE_TITLE_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",begin:'"""',end:'"""',relevance:5},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"^#",end:"$",relevance:2}]}}Fpn.exports=Mos});var Gpn=ee((OPa,$pn)=>{p();function Upn(t){return t?typeof t=="string"?t:t.source:null}function A_e(...t){return t.map(n=>Upn(n)).join("")}function Sze(...t){return"("+t.map(n=>Upn(n)).join("|")+")"}function Los(t){let e={className:"string",begin:/"(""|[^/n])"C\b/},n={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,a={className:"literal",variants:[{begin:A_e(/# */,Sze(s,r),/ *#/)},{begin:A_e(/# */,o,/ *#/)},{begin:A_e(/# */,i,/ *#/)},{begin:A_e(/# */,Sze(s,r),/ +/,Sze(i,o),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},l=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[e,n,a,c,u,l,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{"meta-keyword":"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}$pn.exports=Los});var Hpn=ee((LPa,qpn)=>{p();function Wpn(t){return t?typeof t=="string"?t:t.source:null}function Fos(...t){return t.map(n=>Wpn(n)).join("")}function Qos(...t){return"("+t.map(n=>Wpn(n)).join("|")+")"}function Uos(t){let e="lcase month vartype instrrev ubound setlocale getobject rgb getref string weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency conversions csng timevalue second year space abs clng timeserial fixs len asc isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim strcomp int createobject loadpicture tan formatnumber mid split cint sin datepart ltrim sqr time derived eval date formatpercent exp inputbox left ascw chrw regexp cstr err".split(" "),n=["server","response","request","scriptengine","scriptenginebuildversion","scriptengineminorversion","scriptenginemajorversion"],r={begin:Fos(Qos(...e),"\\s*\\("),relevance:0,keywords:{built_in:e}};return{name:"VBScript",aliases:["vbs"],case_insensitive:!0,keywords:{keyword:"call class const dim do loop erase execute executeglobal exit for each next function if then else on error option explicit new private property let get public randomize redim rem select case set stop sub while wend with end to elseif is or xor and not class_initialize class_terminate default preserve in me byval byref step resume goto",built_in:n,literal:"true false null nothing empty"},illegal:"//",contains:[r,t.inherit(t.QUOTE_STRING_MODE,{contains:[{begin:'""'}]}),t.COMMENT(/'/,/$/,{relevance:0}),t.C_NUMBER_MODE]}}qpn.exports=Uos});var jpn=ee((QPa,Vpn)=>{p();function $os(t){return{name:"VBScript in HTML",subLanguage:"xml",contains:[{begin:"<%",end:"%>",subLanguage:"vbscript"}]}}Vpn.exports=$os});var Kpn=ee(($Pa,Ypn)=>{p();function Gos(t){return{name:"Verilog",aliases:["v","sv","svh"],case_insensitive:!1,keywords:{$pattern:/[\w\$]+/,keyword:"accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind bins binsof bit break buf|0 bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin function generate|5 genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import incdir include initial inout input inside instance int integer interconnect interface intersect join join_any join_none large let liblist library local localparam logic longint macromodule matches medium modport module nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 or output package packed parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor",literal:"null",built_in:"$finish $stop $exit $fatal $error $warning $info $realtime $time $printtimescale $bitstoreal $bitstoshortreal $itor $signed $cast $bits $stime $timeformat $realtobits $shortrealtobits $rtoi $unsigned $asserton $assertkill $assertpasson $assertfailon $assertnonvacuouson $assertoff $assertcontrol $assertpassoff $assertfailoff $assertvacuousoff $isunbounded $sampled $fell $changed $past_gclk $fell_gclk $changed_gclk $rising_gclk $steady_gclk $coverage_control $coverage_get $coverage_save $set_coverage_db_name $rose $stable $past $rose_gclk $stable_gclk $future_gclk $falling_gclk $changing_gclk $display $coverage_get_max $coverage_merge $get_coverage $load_coverage_db $typename $unpacked_dimensions $left $low $increment $clog2 $ln $log10 $exp $sqrt $pow $floor $ceil $sin $cos $tan $countbits $onehot $isunknown $fatal $warning $dimensions $right $high $size $asin $acos $atan $atan2 $hypot $sinh $cosh $tanh $asinh $acosh $atanh $countones $onehot0 $error $info $random $dist_chi_square $dist_erlang $dist_exponential $dist_normal $dist_poisson $dist_t $dist_uniform $q_initialize $q_remove $q_exam $async$and$array $async$nand$array $async$or$array $async$nor$array $sync$and$array $sync$nand$array $sync$or$array $sync$nor$array $q_add $q_full $psprintf $async$and$plane $async$nand$plane $async$or$plane $async$nor$plane $sync$and$plane $sync$nand$plane $sync$or$plane $sync$nor$plane $system $display $displayb $displayh $displayo $strobe $strobeb $strobeh $strobeo $write $readmemb $readmemh $writememh $value$plusargs $dumpvars $dumpon $dumplimit $dumpports $dumpportson $dumpportslimit $writeb $writeh $writeo $monitor $monitorb $monitorh $monitoro $writememb $dumpfile $dumpoff $dumpall $dumpflush $dumpportsoff $dumpportsall $dumpportsflush $fclose $fdisplay $fdisplayb $fdisplayh $fdisplayo $fstrobe $fstrobeb $fstrobeh $fstrobeo $swrite $swriteb $swriteh $swriteo $fscanf $fread $fseek $fflush $feof $fopen $fwrite $fwriteb $fwriteh $fwriteo $fmonitor $fmonitorb $fmonitorh $fmonitoro $sformat $sformatf $fgetc $ungetc $fgets $sscanf $rewind $ftell $ferror"},contains:[t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.QUOTE_STRING_MODE,{className:"number",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"\\b((\\d+'(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)"},{begin:"\\B(('(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)"},{begin:"\\b([0-9_])+",relevance:0}]},{className:"variable",variants:[{begin:"#\\((?!parameter).+\\)"},{begin:"\\.\\w+",relevance:0}]},{className:"meta",begin:"`",end:"$",keywords:{"meta-keyword":"define __FILE__ __LINE__ begin_keywords celldefine default_nettype define else elsif end_keywords endcelldefine endif ifdef ifndef include line nounconnected_drive pragma resetall timescale unconnected_drive undef undefineall"},relevance:0}]}}Ypn.exports=Gos});var Jpn=ee((WPa,zpn)=>{p();function Wos(t){let e="\\d(_|\\d)*",n="[eE][-+]?"+e,r=e+"(\\."+e+")?("+n+")?",s="\\w+",o="\\b("+(e+"#"+s+"(\\."+s+")?#("+n+")?")+"|"+r+")";return{name:"VHDL",case_insensitive:!0,keywords:{keyword:"abs access after alias all and architecture array assert assume assume_guarantee attribute begin block body buffer bus case component configuration constant context cover disconnect downto default else elsif end entity exit fairness file for force function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package parameter port postponed procedure process property protected pure range record register reject release rem report restrict restrict_guarantee return rol ror select sequence severity shared signal sla sll sra srl strong subtype then to transport type unaffected units until use variable view vmode vprop vunit wait when while with xnor xor",built_in:"boolean bit character integer time delay_length natural positive string bit_vector file_open_kind file_open_status std_logic std_logic_vector unsigned signed boolean_vector integer_vector std_ulogic std_ulogic_vector unresolved_unsigned u_unsigned unresolved_signed u_signed real_vector time_vector",literal:"false true note warning error failure line text side width"},illegal:/\{/,contains:[t.C_BLOCK_COMMENT_MODE,t.COMMENT("--","$"),t.QUOTE_STRING_MODE,{className:"number",begin:o,relevance:0},{className:"string",begin:"'(U|X|0|1|Z|W|L|H|-)'",contains:[t.BACKSLASH_ESCAPE]},{className:"symbol",begin:"'[A-Za-z](_?[A-Za-z0-9])*",contains:[t.BACKSLASH_ESCAPE]}]}}zpn.exports=Wos});var Zpn=ee((HPa,Xpn)=>{p();function qos(t){return{name:"Vim Script",keywords:{$pattern:/[!#@\w]+/,keyword:"N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu go gr grepa gu gv ha helpf helpg helpt hi hid his ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf quita qa rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank",built_in:"synIDtrans atan2 range matcharg did_filetype asin feedkeys xor argv complete_check add getwinposx getqflist getwinposy screencol clearmatches empty extend getcmdpos mzeval garbagecollect setreg ceil sqrt diff_hlID inputsecret get getfperm getpid filewritable shiftwidth max sinh isdirectory synID system inputrestore winline atan visualmode inputlist tabpagewinnr round getregtype mapcheck hasmapto histdel argidx findfile sha256 exists toupper getcmdline taglist string getmatches bufnr strftime winwidth bufexists strtrans tabpagebuflist setcmdpos remote_read printf setloclist getpos getline bufwinnr float2nr len getcmdtype diff_filler luaeval resolve libcallnr foldclosedend reverse filter has_key bufname str2float strlen setline getcharmod setbufvar index searchpos shellescape undofile foldclosed setqflist buflisted strchars str2nr virtcol floor remove undotree remote_expr winheight gettabwinvar reltime cursor tabpagenr finddir localtime acos getloclist search tanh matchend rename gettabvar strdisplaywidth type abs py3eval setwinvar tolower wildmenumode log10 spellsuggest bufloaded synconcealed nextnonblank server2client complete settabwinvar executable input wincol setmatches getftype hlID inputsave searchpair or screenrow line settabvar histadd deepcopy strpart remote_peek and eval getftime submatch screenchar winsaveview matchadd mkdir screenattr getfontname libcall reltimestr getfsize winnr invert pow getbufline byte2line soundfold repeat fnameescape tagfiles sin strwidth spellbadword trunc maparg log lispindent hostname setpos globpath remote_foreground getchar synIDattr fnamemodify cscope_connection stridx winbufnr indent min complete_add nr2char searchpairpos inputdialog values matchlist items hlexists strridx browsedir expand fmod pathshorten line2byte argc count getwinvar glob foldtextresult getreg foreground cosh matchdelete has char2nr simplify histget searchdecl iconv winrestcmd pumvisible writefile foldlevel haslocaldir keys cos matchstr foldtext histnr tan tempname getcwd byteidx getbufvar islocked escape eventhandler remote_send serverlist winrestview synstack pyeval prevnonblank readfile cindent filereadable changenr exp"},illegal:/;/,contains:[t.NUMBER_MODE,{className:"string",begin:"'",end:"'",illegal:"\\n"},{className:"string",begin:/"(\\"|\n\\|[^"\n])*"/},t.COMMENT('"',"$"),{className:"variable",begin:/[bwtglsav]:[\w\d_]*/},{className:"function",beginKeywords:"function function!",end:"$",relevance:0,contains:[t.TITLE_MODE,{className:"params",begin:"\\(",end:"\\)"}]},{className:"symbol",begin:/<[\w-]+>/}]}}Xpn.exports=qos});var thn=ee((jPa,ehn)=>{p();function Hos(t){return{name:"Intel x86 Assembly",case_insensitive:!0,keywords:{$pattern:"[.%]?"+t.IDENT_RE,keyword:"lock rep repe repz repne repnz xaquire xrelease bnd nobnd aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63",built_in:"ip eip rip al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r12b r13b r14b r15b ax bx cx dx si di bp sp r8w r9w r10w r11w r12w r13w r14w r15w eax ebx ecx edx esi edi ebp esp eip r8d r9d r10d r11d r12d r13d r14d r15d rax rbx rcx rdx rsi rdi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15 cs ds es fs gs ss st st0 st1 st2 st3 st4 st5 st6 st7 mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15 xmm16 xmm17 xmm18 xmm19 xmm20 xmm21 xmm22 xmm23 xmm24 xmm25 xmm26 xmm27 xmm28 xmm29 xmm30 xmm31 ymm0 ymm1 ymm2 ymm3 ymm4 ymm5 ymm6 ymm7 ymm8 ymm9 ymm10 ymm11 ymm12 ymm13 ymm14 ymm15 ymm16 ymm17 ymm18 ymm19 ymm20 ymm21 ymm22 ymm23 ymm24 ymm25 ymm26 ymm27 ymm28 ymm29 ymm30 ymm31 zmm0 zmm1 zmm2 zmm3 zmm4 zmm5 zmm6 zmm7 zmm8 zmm9 zmm10 zmm11 zmm12 zmm13 zmm14 zmm15 zmm16 zmm17 zmm18 zmm19 zmm20 zmm21 zmm22 zmm23 zmm24 zmm25 zmm26 zmm27 zmm28 zmm29 zmm30 zmm31 k0 k1 k2 k3 k4 k5 k6 k7 bnd0 bnd1 bnd2 bnd3 cr0 cr1 cr2 cr3 cr4 cr8 dr0 dr1 dr2 dr3 dr8 tr3 tr4 tr5 tr6 tr7 r0 r1 r2 r3 r4 r5 r6 r7 r0b r1b r2b r3b r4b r5b r6b r7b r0w r1w r2w r3w r4w r5w r6w r7w r0d r1d r2d r3d r4d r5d r6d r7d r0h r1h r2h r3h r0l r1l r2l r3l r4l r5l r6l r7l r8l r9l r10l r11l r12l r13l r14l r15l db dw dd dq dt ddq do dy dz resb resw resd resq rest resdq reso resy resz incbin equ times byte word dword qword nosplit rel abs seg wrt strict near far a32 ptr",meta:"%define %xdefine %+ %undef %defstr %deftok %assign %strcat %strlen %substr %rotate %elif %else %endif %if %ifmacro %ifctx %ifidn %ifidni %ifid %ifnum %ifstr %iftoken %ifempty %ifenv %error %warning %fatal %rep %endrep %include %push %pop %repl %pathsearch %depend %use %arg %stacksize %local %line %comment %endcomment .nolist __FILE__ __LINE__ __SECT__ __BITS__ __OUTPUT_FORMAT__ __DATE__ __TIME__ __DATE_NUM__ __TIME_NUM__ __UTC_DATE__ __UTC_TIME__ __UTC_DATE_NUM__ __UTC_TIME_NUM__ __PASS__ struc endstruc istruc at iend align alignb sectalign daz nodaz up down zero default option assume public bits use16 use32 use64 default section segment absolute extern global common cpu float __utf16__ __utf16le__ __utf16be__ __utf32__ __utf32le__ __utf32be__ __float8__ __float16__ __float32__ __float64__ __float80m__ __float80e__ __float128l__ __float128h__ __Infinity__ __QNaN__ __SNaN__ Inf NaN QNaN SNaN float8 float16 float32 float64 float80m float80e float128l float128h __FLOAT_DAZ__ __FLOAT_ROUND__ __FLOAT__"},contains:[t.COMMENT(";","$",{relevance:0}),{className:"number",variants:[{begin:"\\b(?:([0-9][0-9_]*)?\\.[0-9_]*(?:[eE][+-]?[0-9_]+)?|(0[Xx])?[0-9][0-9_]*(\\.[0-9_]*)?(?:[pP](?:[+-]?[0-9_]+)?)?)\\b",relevance:0},{begin:"\\$[0-9][0-9A-Fa-f]*",relevance:0},{begin:"\\b(?:[0-9A-Fa-f][0-9A-Fa-f_]*[Hh]|[0-9][0-9_]*[DdTt]?|[0-7][0-7_]*[QqOo]|[0-1][0-1_]*[BbYy])\\b"},{begin:"\\b(?:0[Xx][0-9A-Fa-f_]+|0[DdTt][0-9_]+|0[QqOo][0-7_]+|0[BbYy][0-1_]+)\\b"}]},t.QUOTE_STRING_MODE,{className:"string",variants:[{begin:"'",end:"[^\\\\]'"},{begin:"`",end:"[^\\\\]`"}],relevance:0},{className:"symbol",variants:[{begin:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)"},{begin:"^\\s*%%[A-Za-z0-9_$#@~.?]*:"}],relevance:0},{className:"subst",begin:"%[0-9]+",relevance:0},{className:"subst",begin:"%!S+",relevance:0},{className:"meta",begin:/^\s*\.[\w_-]+/}]}}ehn.exports=Hos});var rhn=ee((KPa,nhn)=>{p();function Vos(t){let n={$pattern:/[a-zA-Z][a-zA-Z0-9_?]*/,keyword:"if then else do while until for loop import with is as where when by data constant integer real text name boolean symbol infix prefix postfix block tree",literal:"true false nil",built_in:"in mod rem and or xor not abs sign floor ceil sqrt sin cos tan asin acos atan exp expm1 log log2 log10 log1p pi at text_length text_range text_find text_replace contains page slide basic_slide title_slide title subtitle fade_in fade_out fade_at clear_color color line_color line_width texture_wrap texture_transform texture scale_?x scale_?y scale_?z? translate_?x translate_?y translate_?z? rotate_?x rotate_?y rotate_?z? rectangle circle ellipse sphere path line_to move_to quad_to curve_to theme background contents locally time mouse_?x mouse_?y mouse_buttons "+"ObjectLoader Animate MovieCredits Slides Filters Shading Materials LensFlare Mapping VLCAudioVideo StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts"},r={className:"string",begin:'"',end:'"',illegal:"\\n"},s={className:"string",begin:"'",end:"'",illegal:"\\n"},i={className:"string",begin:"<<",end:">>"},o={className:"number",begin:"[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?"},a={beginKeywords:"import",end:"$",keywords:n,contains:[r]},c={className:"function",begin:/[a-z][^\n]*->/,returnBegin:!0,end:/->/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,keywords:n}})]};return{name:"XL",aliases:["tao"],keywords:n,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,r,s,i,c,a,o,t.NUMBER_MODE]}}nhn.exports=Vos});var ihn=ee((JPa,shn)=>{p();function jos(t){return{name:"XQuery",aliases:["xpath","xq"],case_insensitive:!1,illegal:/(proc)|(abstract)|(extends)|(until)|(#)/,keywords:{$pattern:/[a-zA-Z$][a-zA-Z0-9_:-]*/,keyword:"module schema namespace boundary-space preserve no-preserve strip default collation base-uri ordering context decimal-format decimal-separator copy-namespaces empty-sequence except exponent-separator external grouping-separator inherit no-inherit lax minus-sign per-mille percent schema-attribute schema-element strict unordered zero-digit declare import option function validate variable for at in let where order group by return if then else tumbling sliding window start when only end previous next stable ascending descending allowing empty greatest least some every satisfies switch case typeswitch try catch and or to union intersect instance of treat as castable cast map array delete insert into replace value rename copy modify update",type:"item document-node node attribute document element comment namespace namespace-node processing-instruction text construction xs:anyAtomicType xs:untypedAtomic xs:duration xs:time xs:decimal xs:float xs:double xs:gYearMonth xs:gYear xs:gMonthDay xs:gMonth xs:gDay xs:boolean xs:base64Binary xs:hexBinary xs:anyURI xs:QName xs:NOTATION xs:dateTime xs:dateTimeStamp xs:date xs:string xs:normalizedString xs:token xs:language xs:NMTOKEN xs:Name xs:NCName xs:ID xs:IDREF xs:ENTITY xs:integer xs:nonPositiveInteger xs:negativeInteger xs:long xs:int xs:short xs:byte xs:nonNegativeInteger xs:unisignedLong xs:unsignedInt xs:unsignedShort xs:unsignedByte xs:positiveInteger xs:yearMonthDuration xs:dayTimeDuration",literal:"eq ne lt le gt ge is self:: child:: descendant:: descendant-or-self:: attribute:: following:: following-sibling:: parent:: ancestor:: ancestor-or-self:: preceding:: preceding-sibling:: NaN"},contains:[{className:"variable",begin:/[$][\w\-:]+/},{className:"built_in",variants:[{begin:/\barray:/,end:/(?:append|filter|flatten|fold-(?:left|right)|for-each(?:-pair)?|get|head|insert-before|join|put|remove|reverse|size|sort|subarray|tail)\b/},{begin:/\bmap:/,end:/(?:contains|entry|find|for-each|get|keys|merge|put|remove|size)\b/},{begin:/\bmath:/,end:/(?:a(?:cos|sin|tan[2]?)|cos|exp(?:10)?|log(?:10)?|pi|pow|sin|sqrt|tan)\b/},{begin:/\bop:/,end:/\(/,excludeEnd:!0},{begin:/\bfn:/,end:/\(/,excludeEnd:!0},{begin:/[^/,end:/(\/[\w._:-]+>)/,subLanguage:"xml",contains:[{begin:/\{/,end:/\}/,subLanguage:"xquery"},"self"]}]}}shn.exports=jos});var ahn=ee((ZPa,ohn)=>{p();function Yos(t){let e={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null})]},n=t.UNDERSCORE_TITLE_MODE,r={variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]},s="namespace class interface use extends function return abstract final public protected private static deprecated throw try catch Exception echo empty isset instanceof unset let var new const self require if else elseif switch case default do while loop for continue break likely unlikely __LINE__ __FILE__ __DIR__ __FUNCTION__ __CLASS__ __TRAIT__ __METHOD__ __NAMESPACE__ array boolean float double integer object resource string char long unsigned bool int uint ulong uchar true false null undefined";return{name:"Zephir",aliases:["zep"],keywords:s,contains:[t.C_LINE_COMMENT_MODE,t.COMMENT(/\/\*/,/\*\//,{contains:[{className:"doctag",begin:/@[A-Za-z]+/}]}),{className:"string",begin:/<<<['"]?\w+['"]?$/,end:/^\w+;/,contains:[t.BACKSLASH_ESCAPE]},{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",beginKeywords:"function fn",end:/[;{]/,excludeEnd:!0,illegal:/\$|\[|%/,contains:[n,{className:"params",begin:/\(/,end:/\)/,keywords:s,contains:["self",t.C_BLOCK_COMMENT_MODE,e,r]}]},{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,illegal:/[:($"]/,contains:[{beginKeywords:"extends implements"},n]},{beginKeywords:"namespace",end:/;/,illegal:/[.']/,contains:[n]},{beginKeywords:"use",end:/;/,contains:[n]},{begin:/=>/},e,r]}}ohn.exports=Yos});var lhn=ee((tOa,chn)=>{p();var It=FKe();It.registerLanguage("1c",xon());It.registerLanguage("abnf",Ton());It.registerLanguage("accesslog",kon());It.registerLanguage("actionscript",Don());It.registerLanguage("ada",Pon());It.registerLanguage("angelscript",Mon());It.registerLanguage("apache",Fon());It.registerLanguage("applescript",Won());It.registerLanguage("arcade",Hon());It.registerLanguage("arduino",jon());It.registerLanguage("armasm",Kon());It.registerLanguage("xml",Zon());It.registerLanguage("asciidoc",nan());It.registerLanguage("aspectj",san());It.registerLanguage("autohotkey",oan());It.registerLanguage("autoit",can());It.registerLanguage("avrasm",uan());It.registerLanguage("awk",pan());It.registerLanguage("axapta",man());It.registerLanguage("bash",QKe());It.registerLanguage("basic",gan());It.registerLanguage("bnf",yan());It.registerLanguage("brainfuck",ban());It.registerLanguage("c-like",San());It.registerLanguage("c",UKe());It.registerLanguage("cal",Ian());It.registerLanguage("capnproto",wan());It.registerLanguage("ceylon",van());It.registerLanguage("clean",kan());It.registerLanguage("clojure",Dan());It.registerLanguage("clojure-repl",Pan());It.registerLanguage("cmake",Man());It.registerLanguage("coffeescript",Fan());It.registerLanguage("coq",Uan());It.registerLanguage("cos",Gan());It.registerLanguage("cpp",GKe());It.registerLanguage("crmsh",qan());It.registerLanguage("crystal",Van());It.registerLanguage("csharp",WKe());It.registerLanguage("csp",Yan());It.registerLanguage("css",zan());It.registerLanguage("d",Xan());It.registerLanguage("markdown",ecn());It.registerLanguage("dart",qKe());It.registerLanguage("delphi",ncn());It.registerLanguage("diff",scn());It.registerLanguage("django",ocn());It.registerLanguage("dns",ccn());It.registerLanguage("dockerfile",ucn());It.registerLanguage("dos",pcn());It.registerLanguage("dsconfig",mcn());It.registerLanguage("dts",gcn());It.registerLanguage("dust",ycn());It.registerLanguage("ebnf",bcn());It.registerLanguage("elixir",Scn());It.registerLanguage("elm",Icn());It.registerLanguage("ruby",rze());It.registerLanguage("erb",wcn());It.registerLanguage("erlang-repl",vcn());It.registerLanguage("erlang",kcn());It.registerLanguage("excel",Dcn());It.registerLanguage("fix",Pcn());It.registerLanguage("flix",Mcn());It.registerLanguage("fortran",Fcn());It.registerLanguage("fsharp",Ucn());It.registerLanguage("gams",Gcn());It.registerLanguage("gauss",qcn());It.registerLanguage("gcode",Vcn());It.registerLanguage("gherkin",Ycn());It.registerLanguage("glsl",zcn());It.registerLanguage("gml",Xcn());It.registerLanguage("go",HKe());It.registerLanguage("golo",eln());It.registerLanguage("gradle",nln());It.registerLanguage("groovy",jKe());It.registerLanguage("haml",sln());It.registerLanguage("handlebars",aln());It.registerLanguage("haskell",lln());It.registerLanguage("haxe",dln());It.registerLanguage("hsp",hln());It.registerLanguage("htmlbars",gln());It.registerLanguage("http",yln());It.registerLanguage("hy",bln());It.registerLanguage("inform7",Sln());It.registerLanguage("ini",wln());It.registerLanguage("irpf90",vln());It.registerLanguage("isbl",kln());It.registerLanguage("java",YKe());It.registerLanguage("javascript",zKe());It.registerLanguage("jboss-cli",Dln());It.registerLanguage("json",Pln());It.registerLanguage("julia",Mln());It.registerLanguage("julia-repl",Fln());It.registerLanguage("kotlin",JKe());It.registerLanguage("lasso",Uln());It.registerLanguage("latex",Gln());It.registerLanguage("ldif",qln());It.registerLanguage("leaf",Vln());It.registerLanguage("less",zln());It.registerLanguage("lisp",Xln());It.registerLanguage("livecodeserver",eun());It.registerLanguage("livescript",nun());It.registerLanguage("llvm",sun());It.registerLanguage("lsl",oun());It.registerLanguage("lua",XKe());It.registerLanguage("makefile",cun());It.registerLanguage("mathematica",hun());It.registerLanguage("matlab",fun());It.registerLanguage("maxima",Aun());It.registerLanguage("mel",Eun());It.registerLanguage("mercury",_un());It.registerLanguage("mipsasm",Cun());It.registerLanguage("mizar",xun());It.registerLanguage("perl",eze());It.registerLanguage("mojolicious",Tun());It.registerLanguage("monkey",Run());It.registerLanguage("moonscript",Nun());It.registerLanguage("n1ql",Bun());It.registerLanguage("nginx",Oun());It.registerLanguage("nim",Lun());It.registerLanguage("nix",ZKe());It.registerLanguage("node-repl",Qun());It.registerLanguage("nsis",$un());It.registerLanguage("objectivec",Wun());It.registerLanguage("ocaml",Hun());It.registerLanguage("openscad",jun());It.registerLanguage("oxygene",Kun());It.registerLanguage("parser3",Jun());It.registerLanguage("pf",Zun());It.registerLanguage("pgsql",tdn());It.registerLanguage("php",tze());It.registerLanguage("php-template",rdn());It.registerLanguage("plaintext",idn());It.registerLanguage("pony",adn());It.registerLanguage("powershell",ldn());It.registerLanguage("processing",ddn());It.registerLanguage("profile",hdn());It.registerLanguage("prolog",fdn());It.registerLanguage("properties",Adn());It.registerLanguage("protobuf",Edn());It.registerLanguage("puppet",_dn());It.registerLanguage("purebasic",Cdn());It.registerLanguage("python",nze());It.registerLanguage("python-repl",xdn());It.registerLanguage("q",Tdn());It.registerLanguage("qml",Rdn());It.registerLanguage("r",Ndn());It.registerLanguage("reasonml",Bdn());It.registerLanguage("rib",Odn());It.registerLanguage("roboconf",Ldn());It.registerLanguage("routeros",Qdn());It.registerLanguage("rsl",$dn());It.registerLanguage("ruleslanguage",Wdn());It.registerLanguage("rust",sze());It.registerLanguage("sas",Hdn());It.registerLanguage("scala",ize());It.registerLanguage("scheme",jdn());It.registerLanguage("scilab",Kdn());It.registerLanguage("scss",Jdn());It.registerLanguage("shell",Zdn());It.registerLanguage("smali",tpn());It.registerLanguage("smalltalk",rpn());It.registerLanguage("sml",ipn());It.registerLanguage("sqf",apn());It.registerLanguage("sql_more",lpn());It.registerLanguage("sql",ppn());It.registerLanguage("stan",mpn());It.registerLanguage("stata",gpn());It.registerLanguage("step21",ypn());It.registerLanguage("stylus",bpn());It.registerLanguage("subunit",Spn());It.registerLanguage("swift",dze());It.registerLanguage("taggerscript",Ipn());It.registerLanguage("yaml",wpn());It.registerLanguage("tap",vpn());It.registerLanguage("tcl",Npn());It.registerLanguage("thrift",Bpn());It.registerLanguage("tp",Opn());It.registerLanguage("twig",Lpn());It.registerLanguage("typescript",hze());It.registerLanguage("vala",Qpn());It.registerLanguage("vbnet",Gpn());It.registerLanguage("vbscript",Hpn());It.registerLanguage("vbscript-html",jpn());It.registerLanguage("verilog",Kpn());It.registerLanguage("vhdl",Jpn());It.registerLanguage("vim",Zpn());It.registerLanguage("x86asm",thn());It.registerLanguage("xl",rhn());It.registerLanguage("xquery",ihn());It.registerLanguage("zephir",ahn());chn.exports=It});var vo=ee(Zp=>{"use strict";p();var Uze=Symbol.for("yaml.alias"),jhn=Symbol.for("yaml.document"),__e=Symbol.for("yaml.map"),Yhn=Symbol.for("yaml.pair"),$ze=Symbol.for("yaml.scalar"),S_e=Symbol.for("yaml.seq"),iT=Symbol.for("yaml.node.type"),has=t=>!!t&&typeof t=="object"&&t[iT]===Uze,mas=t=>!!t&&typeof t=="object"&&t[iT]===jhn,fas=t=>!!t&&typeof t=="object"&&t[iT]===__e,gas=t=>!!t&&typeof t=="object"&&t[iT]===Yhn,Khn=t=>!!t&&typeof t=="object"&&t[iT]===$ze,Aas=t=>!!t&&typeof t=="object"&&t[iT]===S_e;function zhn(t){if(t&&typeof t=="object")switch(t[iT]){case __e:case S_e:return!0}return!1}function yas(t){if(t&&typeof t=="object")switch(t[iT]){case Uze:case __e:case $ze:case S_e:return!0}return!1}var Eas=t=>(Khn(t)||zhn(t))&&!!t.anchor;Zp.ALIAS=Uze;Zp.DOC=jhn;Zp.MAP=__e;Zp.NODE_TYPE=iT;Zp.PAIR=Yhn;Zp.SCALAR=$ze;Zp.SEQ=S_e;Zp.hasAnchor=Eas;Zp.isAlias=has;Zp.isCollection=zhn;Zp.isDocument=mas;Zp.isMap=fas;Zp.isNode=yas;Zp.isPair=gas;Zp.isScalar=Khn;Zp.isSeq=Aas});var FX=ee(Gze=>{"use strict";p();var yd=vo(),ag=Symbol("break visit"),Jhn=Symbol("skip children"),zC=Symbol("remove node");function C_e(t,e){let n=Xhn(e);yd.isDocument(t)?MH(null,t.contents,n,Object.freeze([t]))===zC&&(t.contents=null):MH(null,t,n,Object.freeze([]))}C_e.BREAK=ag;C_e.SKIP=Jhn;C_e.REMOVE=zC;function MH(t,e,n,r){let s=Zhn(t,e,n,r);if(yd.isNode(s)||yd.isPair(s))return emn(t,r,s),MH(t,s,n,r);if(typeof s!="symbol"){if(yd.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i{"use strict";p();var tmn=vo(),bas=FX(),_as={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Sas=t=>t.replace(/[!,[\]{}]/g,e=>_as[e]),QX=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||n(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+Sas(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),s;if(e&&r.length>0&&tmn.isNode(e.contents)){let i={};bas.visit(e.contents,(o,a)=>{tmn.isNode(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(` -`)}};QX.defaultYaml={explicit:!1,version:"1.2"};QX.defaultTags={"!!":"tag:yaml.org,2002:"};nmn.Directives=QX});var x_e=ee(UX=>{"use strict";p();var rmn=vo(),Cas=FX();function Ias(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function smn(t){let e=new Set;return Cas.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function imn(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function xas(t,e){let n=[],r=new Map,s=null;return{onAnchor:i=>{n.push(i),s??(s=smn(t));let o=imn(e,s);return s.add(o),o},setAnchors:()=>{for(let i of n){let o=r.get(i);if(typeof o=="object"&&o.anchor&&(rmn.isScalar(o.node)||rmn.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}UX.anchorIsValid=Ias;UX.anchorNames=smn;UX.createNodeAnchors=xas;UX.findNewAnchor=imn});var qze=ee(omn=>{"use strict";p();function $X(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s{"use strict";p();var was=vo();function amn(t,e,n){if(Array.isArray(t))return t.map((r,s)=>amn(r,String(s),n));if(t&&typeof t.toJSON=="function"){if(!n||!was.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=i=>{r.res=i,delete n.onCreate};let s=t.toJSON(e,n);return n.onCreate&&n.onCreate(s),s}return typeof t=="bigint"&&!n?.keep?Number(t):t}cmn.toJS=amn});var w_e=ee(umn=>{"use strict";p();var Tas=qze(),lmn=vo(),vas=FN(),Hze=class{constructor(e){Object.defineProperty(this,lmn.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!lmn.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=vas.toJS(this,"",o);if(typeof s=="function")for(let{count:c,res:u}of o.anchors.values())s(u,c);return typeof i=="function"?Tas.applyReviver(i,{"":a},"",a):a}};umn.NodeBase=Hze});var GX=ee(dmn=>{"use strict";p();var Ras=x_e(),kas=FX(),FH=vo(),Nas=w_e(),Das=FN(),Vze=class extends Nas.NodeBase{constructor(e){super(FH.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],kas.visit(e,{Node:(i,o)=>{(FH.isAlias(o)||FH.hasAnchor(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let s;for(let i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:s,maxAliasCount:i}=n,o=this.resolve(s,n);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(Das.toJS(o,null,n),a=r.get(o)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=T_e(s,o,r)),a.count*a.aliasCount>i)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,r){let s=`*${this.source}`;if(e){if(Ras.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}};function T_e(t,e,n){if(FH.isAlias(e)){let r=e.resolve(t),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(FH.isCollection(e)){let r=0;for(let s of e.items){let i=T_e(t,s,n);i>r&&(r=i)}return r}else if(FH.isPair(e)){let r=T_e(t,e.key,n),s=T_e(t,e.value,n);return Math.max(r,s)}return 1}dmn.Alias=Vze});var qu=ee(jze=>{"use strict";p();var Bas=vo(),Pas=w_e(),Oas=FN(),Mas=t=>!t||typeof t!="function"&&typeof t!="object",QN=class extends Pas.NodeBase{constructor(e){super(Bas.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:Oas.toJS(this.value,e,n)}toString(){return String(this.value)}};QN.BLOCK_FOLDED="BLOCK_FOLDED";QN.BLOCK_LITERAL="BLOCK_LITERAL";QN.PLAIN="PLAIN";QN.QUOTE_DOUBLE="QUOTE_DOUBLE";QN.QUOTE_SINGLE="QUOTE_SINGLE";jze.Scalar=QN;jze.isScalarValue=Mas});var WX=ee(hmn=>{"use strict";p();var Las=GX(),HM=vo(),pmn=qu(),Fas="tag:yaml.org,2002:";function Qas(t,e,n){if(e){let r=n.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return n.find(r=>r.identify?.(t)&&!r.format)}function Uas(t,e,n){if(HM.isDocument(t)&&(t=t.contents),HM.isNode(t))return t;if(HM.isPair(t)){let d=n.schema[HM.MAP].createNode?.(n.schema,null,n);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n,c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=s(t)),new Las.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Fas+e.slice(2));let u=Qas(t,e,o.tags);if(!u){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new pmn.Scalar(t);return c&&(c.node=d),d}u=t instanceof Map?o[HM.MAP]:Symbol.iterator in Object(t)?o[HM.SEQ]:o[HM.MAP]}i&&(i(u),delete n.onTagObj);let l=u?.createNode?u.createNode(n.schema,t,n):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(n.schema,t,n):new pmn.Scalar(t);return e?l.tag=e:u.default||(l.tag=u.tag),c&&(c.node=l),l}hmn.createNode=Uas});var R_e=ee(v_e=>{"use strict";p();var $as=WX(),JC=vo(),Gas=w_e();function Yze(t,e,n){let r=n;for(let s=e.length-1;s>=0;--s){let i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return $as.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var mmn=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Kze=class extends Gas.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>JC.isNode(r)||JC.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(mmn(e))this.add(n);else{let[r,...s]=e,i=this.get(r,!0);if(JC.isCollection(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Yze(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let s=this.get(n,!0);if(JC.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...s]=e,i=this.get(r,!0);return s.length===0?!n&&JC.isScalar(i)?i.value:i:JC.isCollection(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!JC.isPair(n))return!1;let r=n.value;return r==null||e&&JC.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let s=this.get(n,!0);return JC.isCollection(s)?s.hasIn(r):!1}setIn(e,n){let[r,...s]=e;if(s.length===0)this.set(r,n);else{let i=this.get(r,!0);if(JC.isCollection(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Yze(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};v_e.Collection=Kze;v_e.collectionFromPath=Yze;v_e.isEmptyPath=mmn});var qX=ee(k_e=>{"use strict";p();var Was=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function zze(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var qas=(t,e,n)=>t.endsWith(` -`)?zze(n,e):n.includes(` +`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}M2n.exports=lQi});var F2n=re((qdc,L2n)=>{p();function uQi(t){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\(/,end:/\)/,contains:["self",{begin:/\\./}]}],relevance:10},{className:"keyword",begin:/\$(?!noop)[a-zA-Z][_a-zA-Z0-9]*/,end:/\(/,excludeEnd:!0},{className:"variable",begin:/%[_a-zA-Z0-9:]*/,end:"%"},{className:"symbol",begin:/\\./}]}}L2n.exports=uQi});var U2n=re((Vdc,Q2n)=>{p();function dQi(t){var e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},o=t.inherit(s,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),a="[0-9]{4}(-[0-9][0-9]){0,2}",c="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",u="(\\.[0-9]*)?",l="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",d={className:"number",begin:"\\b"+a+c+u+l+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},h={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},f={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},g=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},d,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},h,f,s],A=[...g];return A.pop(),A.push(o),m.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}Q2n.exports=dQi});var $2n=re((zdc,G2n)=>{p();function pQi(t){return{name:"Test Anything Protocol",case_insensitive:!0,contains:[t.HASH_COMMENT_MODE,{className:"meta",variants:[{begin:"^TAP version (\\d+)$"},{begin:"^1\\.\\.(\\d+)$"}]},{begin:/---$/,end:"\\.\\.\\.$",subLanguage:"yaml",relevance:0},{className:"number",begin:" (\\d+) "},{className:"symbol",variants:[{begin:"^ok"},{begin:"^not ok"}]}]}}G2n.exports=pQi});var q2n=re((Jdc,H2n)=>{p();function mQi(t){return t?typeof t=="string"?t:t.source:null}function hQi(t){return W2n("(",t,")?")}function W2n(...t){return t.map(n=>mQi(n)).join("")}function fQi(t){let e=/[a-zA-Z_][a-zA-Z0-9_]*/,n={className:"number",variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:"after append apply array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd chan clock close concat continue dde dict encoding eof error eval exec exit expr fblocked fconfigure fcopy file fileevent filename flush for foreach format gets glob global history http if incr info interp join lappend|10 lassign|10 lindex|10 linsert|10 list llength|10 load lrange|10 lrepeat|10 lreplace|10 lreverse|10 lsearch|10 lset|10 lsort|10 mathfunc mathop memory msgcat namespace open package parray pid pkg::create pkg_mkIndex platform platform::shell proc puts pwd read refchan regexp registry regsub|10 rename return safe scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter tcl_wordBreakBefore tcltest tclvars tell time tm trace unknown unload unset update uplevel upvar variable vwait while",contains:[t.COMMENT(";[ \\t]*#","$"),t.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:W2n(/\$/,hQi(/::/),e,"(::",e,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[n]}]},{className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.inherit(t.QUOTE_STRING_MODE,{illegal:null})]},n]}}H2n.exports=fQi});var V2n=re((Zdc,j2n)=>{p();function gQi(t){let e="bool byte i16 i32 i64 double string binary";return{name:"Thrift",keywords:{keyword:"namespace const typedef struct enum service exception void oneway set list map required optional",built_in:e,literal:"true false"},contains:[t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"struct enum service exception",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:"\\b(set|list|map)\\s*<",end:">",keywords:e,contains:["self"]}]}}j2n.exports=gQi});var z2n=re((tpc,Y2n)=>{p();function AQi(t){let e={className:"number",begin:"[1-9][0-9]*",relevance:0},n={className:"symbol",begin:":[^\\]]+"},r={className:"built_in",begin:"(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",end:"\\]",contains:["self",e,n]},i={className:"built_in",begin:"(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",end:"\\]",contains:["self",e,t.QUOTE_STRING_MODE,n]};return{name:"TP",keywords:{keyword:"ABORT ACC ADJUST AND AP_LD BREAK CALL CNT COL CONDITION CONFIG DA DB DIV DETECT ELSE END ENDFOR ERR_NUM ERROR_PROG FINE FOR GP GUARD INC IF JMP LINEAR_MAX_SPEED LOCK MOD MONITOR OFFSET Offset OR OVERRIDE PAUSE PREG PTH RT_LD RUN SELECT SKIP Skip TA TB TO TOOL_OFFSET Tool_Offset UF UT UFRAME_NUM UTOOL_NUM UNLOCK WAIT X Y Z W P R STRLEN SUBSTR FINDSTR VOFFSET PROG ATTR MN POS",literal:"ON OFF max_speed LPOS JPOS ENABLE DISABLE START STOP RESET"},contains:[r,i,{className:"keyword",begin:"/(PROG|ATTR|MN|POS|END)\\b"},{className:"keyword",begin:"(CALL|RUN|POINT_LOGIC|LBL)\\b"},{className:"keyword",begin:"\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"},{className:"number",begin:"\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",relevance:0},t.COMMENT("//","[;$]"),t.COMMENT("!","[;$]"),t.COMMENT("--eg:","$"),t.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"'"},t.C_NUMBER_MODE,{className:"variable",begin:"\\$[A-Za-z0-9_]+"}]}}Y2n.exports=AQi});var J2n=re((rpc,K2n)=>{p();function yQi(t){var e={className:"params",begin:"\\(",end:"\\)"},n="attribute block constant cycle date dump include max min parent random range source template_from_string",r={beginKeywords:n,keywords:{name:n},relevance:0,contains:[e]},i={begin:/\|[A-Za-z_]+:?/,keywords:"abs batch capitalize column convert_encoding date date_modify default escape filter first format inky_to_html inline_css join json_encode keys last length lower map markdown merge nl2br number_format raw reduce replace reverse round slice sort spaceless split striptags title trim upper url_encode",contains:[r]},s="apply autoescape block deprecated do embed extends filter flush for from if import include macro sandbox set use verbatim with";return s=s+" "+s.split(" ").map(function(o){return"end"+o}).join(" "),{name:"Twig",aliases:["craftcms"],case_insensitive:!0,subLanguage:"xml",contains:[t.COMMENT(/\{#/,/#\}/),{className:"template-tag",begin:/\{%/,end:/%\}/,contains:[{className:"name",begin:/\w+/,keywords:s,starts:{endsWithParent:!0,contains:[i,r],relevance:0}}]},{className:"template-variable",begin:/\{\{/,end:/\}\}/,contains:["self",i,r]}]}}K2n.exports=yQi});var Z2n=re((spc,X2n)=>{p();function EQi(t){return{name:"Vala",keywords:{keyword:"char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override virtual delegate if while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",built_in:"DBus GLib CCode Gee Object Gtk Posix",literal:"false true null"},contains:[{className:"class",beginKeywords:"class interface namespace",end:/\{/,excludeEnd:!0,illegal:"[^,:\\n\\s\\.]",contains:[t.UNDERSCORE_TITLE_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",begin:'"""',end:'"""',relevance:5},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"^#",end:"$",relevance:2}]}}X2n.exports=EQi});var nFn=re((apc,tFn)=>{p();function eFn(t){return t?typeof t=="string"?t:t.source:null}function GTe(...t){return t.map(n=>eFn(n)).join("")}function qat(...t){return"("+t.map(n=>eFn(n)).join("|")+")"}function bQi(t){let e={className:"string",begin:/"(""|[^/n])"C\b/},n={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,a={className:"literal",variants:[{begin:GTe(/# */,qat(i,r),/ *#/)},{begin:GTe(/# */,o,/ *#/)},{begin:GTe(/# */,s,/ *#/)},{begin:GTe(/# */,qat(i,r),/ +/,qat(s,o),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},l=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[e,n,a,c,u,l,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{"meta-keyword":"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}tFn.exports=bQi});var sFn=re((lpc,iFn)=>{p();function rFn(t){return t?typeof t=="string"?t:t.source:null}function _Qi(...t){return t.map(n=>rFn(n)).join("")}function xQi(...t){return"("+t.map(n=>rFn(n)).join("|")+")"}function SQi(t){let e="lcase month vartype instrrev ubound setlocale getobject rgb getref string weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency conversions csng timevalue second year space abs clng timeserial fixs len asc isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim strcomp int createobject loadpicture tan formatnumber mid split cint sin datepart ltrim sqr time derived eval date formatpercent exp inputbox left ascw chrw regexp cstr err".split(" "),n=["server","response","request","scriptengine","scriptenginebuildversion","scriptengineminorversion","scriptenginemajorversion"],r={begin:_Qi(xQi(...e),"\\s*\\("),relevance:0,keywords:{built_in:e}};return{name:"VBScript",aliases:["vbs"],case_insensitive:!0,keywords:{keyword:"call class const dim do loop erase execute executeglobal exit for each next function if then else on error option explicit new private property let get public randomize redim rem select case set stop sub while wend with end to elseif is or xor and not class_initialize class_terminate default preserve in me byval byref step resume goto",built_in:n,literal:"true false null nothing empty"},illegal:"//",contains:[r,t.inherit(t.QUOTE_STRING_MODE,{contains:[{begin:'""'}]}),t.COMMENT(/'/,/$/,{relevance:0}),t.C_NUMBER_MODE]}}iFn.exports=SQi});var aFn=re((dpc,oFn)=>{p();function CQi(t){return{name:"VBScript in HTML",subLanguage:"xml",contains:[{begin:"<%",end:"%>",subLanguage:"vbscript"}]}}oFn.exports=CQi});var lFn=re((mpc,cFn)=>{p();function IQi(t){return{name:"Verilog",aliases:["v","sv","svh"],case_insensitive:!1,keywords:{$pattern:/[\w\$]+/,keyword:"accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind bins binsof bit break buf|0 bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin function generate|5 genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import incdir include initial inout input inside instance int integer interconnect interface intersect join join_any join_none large let liblist library local localparam logic longint macromodule matches medium modport module nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 or output package packed parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor",literal:"null",built_in:"$finish $stop $exit $fatal $error $warning $info $realtime $time $printtimescale $bitstoreal $bitstoshortreal $itor $signed $cast $bits $stime $timeformat $realtobits $shortrealtobits $rtoi $unsigned $asserton $assertkill $assertpasson $assertfailon $assertnonvacuouson $assertoff $assertcontrol $assertpassoff $assertfailoff $assertvacuousoff $isunbounded $sampled $fell $changed $past_gclk $fell_gclk $changed_gclk $rising_gclk $steady_gclk $coverage_control $coverage_get $coverage_save $set_coverage_db_name $rose $stable $past $rose_gclk $stable_gclk $future_gclk $falling_gclk $changing_gclk $display $coverage_get_max $coverage_merge $get_coverage $load_coverage_db $typename $unpacked_dimensions $left $low $increment $clog2 $ln $log10 $exp $sqrt $pow $floor $ceil $sin $cos $tan $countbits $onehot $isunknown $fatal $warning $dimensions $right $high $size $asin $acos $atan $atan2 $hypot $sinh $cosh $tanh $asinh $acosh $atanh $countones $onehot0 $error $info $random $dist_chi_square $dist_erlang $dist_exponential $dist_normal $dist_poisson $dist_t $dist_uniform $q_initialize $q_remove $q_exam $async$and$array $async$nand$array $async$or$array $async$nor$array $sync$and$array $sync$nand$array $sync$or$array $sync$nor$array $q_add $q_full $psprintf $async$and$plane $async$nand$plane $async$or$plane $async$nor$plane $sync$and$plane $sync$nand$plane $sync$or$plane $sync$nor$plane $system $display $displayb $displayh $displayo $strobe $strobeb $strobeh $strobeo $write $readmemb $readmemh $writememh $value$plusargs $dumpvars $dumpon $dumplimit $dumpports $dumpportson $dumpportslimit $writeb $writeh $writeo $monitor $monitorb $monitorh $monitoro $writememb $dumpfile $dumpoff $dumpall $dumpflush $dumpportsoff $dumpportsall $dumpportsflush $fclose $fdisplay $fdisplayb $fdisplayh $fdisplayo $fstrobe $fstrobeb $fstrobeh $fstrobeo $swrite $swriteb $swriteh $swriteo $fscanf $fread $fseek $fflush $feof $fopen $fwrite $fwriteb $fwriteh $fwriteo $fmonitor $fmonitorb $fmonitorh $fmonitoro $sformat $sformatf $fgetc $ungetc $fgets $sscanf $rewind $ftell $ferror"},contains:[t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.QUOTE_STRING_MODE,{className:"number",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"\\b((\\d+'(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)"},{begin:"\\B(('(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)"},{begin:"\\b([0-9_])+",relevance:0}]},{className:"variable",variants:[{begin:"#\\((?!parameter).+\\)"},{begin:"\\.\\w+",relevance:0}]},{className:"meta",begin:"`",end:"$",keywords:{"meta-keyword":"define __FILE__ __LINE__ begin_keywords celldefine default_nettype define else elsif end_keywords endcelldefine endif ifdef ifndef include line nounconnected_drive pragma resetall timescale unconnected_drive undef undefineall"},relevance:0}]}}cFn.exports=IQi});var dFn=re((fpc,uFn)=>{p();function wQi(t){let e="\\d(_|\\d)*",n="[eE][-+]?"+e,r=e+"(\\."+e+")?("+n+")?",i="\\w+",o="\\b("+(e+"#"+i+"(\\."+i+")?#("+n+")?")+"|"+r+")";return{name:"VHDL",case_insensitive:!0,keywords:{keyword:"abs access after alias all and architecture array assert assume assume_guarantee attribute begin block body buffer bus case component configuration constant context cover disconnect downto default else elsif end entity exit fairness file for force function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package parameter port postponed procedure process property protected pure range record register reject release rem report restrict restrict_guarantee return rol ror select sequence severity shared signal sla sll sra srl strong subtype then to transport type unaffected units until use variable view vmode vprop vunit wait when while with xnor xor",built_in:"boolean bit character integer time delay_length natural positive string bit_vector file_open_kind file_open_status std_logic std_logic_vector unsigned signed boolean_vector integer_vector std_ulogic std_ulogic_vector unresolved_unsigned u_unsigned unresolved_signed u_signed real_vector time_vector",literal:"false true note warning error failure line text side width"},illegal:/\{/,contains:[t.C_BLOCK_COMMENT_MODE,t.COMMENT("--","$"),t.QUOTE_STRING_MODE,{className:"number",begin:o,relevance:0},{className:"string",begin:"'(U|X|0|1|Z|W|L|H|-)'",contains:[t.BACKSLASH_ESCAPE]},{className:"symbol",begin:"'[A-Za-z](_?[A-Za-z0-9])*",contains:[t.BACKSLASH_ESCAPE]}]}}uFn.exports=wQi});var mFn=re((Apc,pFn)=>{p();function TQi(t){return{name:"Vim Script",keywords:{$pattern:/[!#@\w]+/,keyword:"N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu go gr grepa gu gv ha helpf helpg helpt hi hid his ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf quita qa rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank",built_in:"synIDtrans atan2 range matcharg did_filetype asin feedkeys xor argv complete_check add getwinposx getqflist getwinposy screencol clearmatches empty extend getcmdpos mzeval garbagecollect setreg ceil sqrt diff_hlID inputsecret get getfperm getpid filewritable shiftwidth max sinh isdirectory synID system inputrestore winline atan visualmode inputlist tabpagewinnr round getregtype mapcheck hasmapto histdel argidx findfile sha256 exists toupper getcmdline taglist string getmatches bufnr strftime winwidth bufexists strtrans tabpagebuflist setcmdpos remote_read printf setloclist getpos getline bufwinnr float2nr len getcmdtype diff_filler luaeval resolve libcallnr foldclosedend reverse filter has_key bufname str2float strlen setline getcharmod setbufvar index searchpos shellescape undofile foldclosed setqflist buflisted strchars str2nr virtcol floor remove undotree remote_expr winheight gettabwinvar reltime cursor tabpagenr finddir localtime acos getloclist search tanh matchend rename gettabvar strdisplaywidth type abs py3eval setwinvar tolower wildmenumode log10 spellsuggest bufloaded synconcealed nextnonblank server2client complete settabwinvar executable input wincol setmatches getftype hlID inputsave searchpair or screenrow line settabvar histadd deepcopy strpart remote_peek and eval getftime submatch screenchar winsaveview matchadd mkdir screenattr getfontname libcall reltimestr getfsize winnr invert pow getbufline byte2line soundfold repeat fnameescape tagfiles sin strwidth spellbadword trunc maparg log lispindent hostname setpos globpath remote_foreground getchar synIDattr fnamemodify cscope_connection stridx winbufnr indent min complete_add nr2char searchpairpos inputdialog values matchlist items hlexists strridx browsedir expand fmod pathshorten line2byte argc count getwinvar glob foldtextresult getreg foreground cosh matchdelete has char2nr simplify histget searchdecl iconv winrestcmd pumvisible writefile foldlevel haslocaldir keys cos matchstr foldtext histnr tan tempname getcwd byteidx getbufvar islocked escape eventhandler remote_send serverlist winrestview synstack pyeval prevnonblank readfile cindent filereadable changenr exp"},illegal:/;/,contains:[t.NUMBER_MODE,{className:"string",begin:"'",end:"'",illegal:"\\n"},{className:"string",begin:/"(\\"|\n\\|[^"\n])*"/},t.COMMENT('"',"$"),{className:"variable",begin:/[bwtglsav]:[\w\d_]*/},{className:"function",beginKeywords:"function function!",end:"$",relevance:0,contains:[t.TITLE_MODE,{className:"params",begin:"\\(",end:"\\)"}]},{className:"symbol",begin:/<[\w-]+>/}]}}pFn.exports=TQi});var fFn=re((Epc,hFn)=>{p();function vQi(t){return{name:"Intel x86 Assembly",case_insensitive:!0,keywords:{$pattern:"[.%]?"+t.IDENT_RE,keyword:"lock rep repe repz repne repnz xaquire xrelease bnd nobnd aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63",built_in:"ip eip rip al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r12b r13b r14b r15b ax bx cx dx si di bp sp r8w r9w r10w r11w r12w r13w r14w r15w eax ebx ecx edx esi edi ebp esp eip r8d r9d r10d r11d r12d r13d r14d r15d rax rbx rcx rdx rsi rdi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15 cs ds es fs gs ss st st0 st1 st2 st3 st4 st5 st6 st7 mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15 xmm16 xmm17 xmm18 xmm19 xmm20 xmm21 xmm22 xmm23 xmm24 xmm25 xmm26 xmm27 xmm28 xmm29 xmm30 xmm31 ymm0 ymm1 ymm2 ymm3 ymm4 ymm5 ymm6 ymm7 ymm8 ymm9 ymm10 ymm11 ymm12 ymm13 ymm14 ymm15 ymm16 ymm17 ymm18 ymm19 ymm20 ymm21 ymm22 ymm23 ymm24 ymm25 ymm26 ymm27 ymm28 ymm29 ymm30 ymm31 zmm0 zmm1 zmm2 zmm3 zmm4 zmm5 zmm6 zmm7 zmm8 zmm9 zmm10 zmm11 zmm12 zmm13 zmm14 zmm15 zmm16 zmm17 zmm18 zmm19 zmm20 zmm21 zmm22 zmm23 zmm24 zmm25 zmm26 zmm27 zmm28 zmm29 zmm30 zmm31 k0 k1 k2 k3 k4 k5 k6 k7 bnd0 bnd1 bnd2 bnd3 cr0 cr1 cr2 cr3 cr4 cr8 dr0 dr1 dr2 dr3 dr8 tr3 tr4 tr5 tr6 tr7 r0 r1 r2 r3 r4 r5 r6 r7 r0b r1b r2b r3b r4b r5b r6b r7b r0w r1w r2w r3w r4w r5w r6w r7w r0d r1d r2d r3d r4d r5d r6d r7d r0h r1h r2h r3h r0l r1l r2l r3l r4l r5l r6l r7l r8l r9l r10l r11l r12l r13l r14l r15l db dw dd dq dt ddq do dy dz resb resw resd resq rest resdq reso resy resz incbin equ times byte word dword qword nosplit rel abs seg wrt strict near far a32 ptr",meta:"%define %xdefine %+ %undef %defstr %deftok %assign %strcat %strlen %substr %rotate %elif %else %endif %if %ifmacro %ifctx %ifidn %ifidni %ifid %ifnum %ifstr %iftoken %ifempty %ifenv %error %warning %fatal %rep %endrep %include %push %pop %repl %pathsearch %depend %use %arg %stacksize %local %line %comment %endcomment .nolist __FILE__ __LINE__ __SECT__ __BITS__ __OUTPUT_FORMAT__ __DATE__ __TIME__ __DATE_NUM__ __TIME_NUM__ __UTC_DATE__ __UTC_TIME__ __UTC_DATE_NUM__ __UTC_TIME_NUM__ __PASS__ struc endstruc istruc at iend align alignb sectalign daz nodaz up down zero default option assume public bits use16 use32 use64 default section segment absolute extern global common cpu float __utf16__ __utf16le__ __utf16be__ __utf32__ __utf32le__ __utf32be__ __float8__ __float16__ __float32__ __float64__ __float80m__ __float80e__ __float128l__ __float128h__ __Infinity__ __QNaN__ __SNaN__ Inf NaN QNaN SNaN float8 float16 float32 float64 float80m float80e float128l float128h __FLOAT_DAZ__ __FLOAT_ROUND__ __FLOAT__"},contains:[t.COMMENT(";","$",{relevance:0}),{className:"number",variants:[{begin:"\\b(?:([0-9][0-9_]*)?\\.[0-9_]*(?:[eE][+-]?[0-9_]+)?|(0[Xx])?[0-9][0-9_]*(\\.[0-9_]*)?(?:[pP](?:[+-]?[0-9_]+)?)?)\\b",relevance:0},{begin:"\\$[0-9][0-9A-Fa-f]*",relevance:0},{begin:"\\b(?:[0-9A-Fa-f][0-9A-Fa-f_]*[Hh]|[0-9][0-9_]*[DdTt]?|[0-7][0-7_]*[QqOo]|[0-1][0-1_]*[BbYy])\\b"},{begin:"\\b(?:0[Xx][0-9A-Fa-f_]+|0[DdTt][0-9_]+|0[QqOo][0-7_]+|0[BbYy][0-1_]+)\\b"}]},t.QUOTE_STRING_MODE,{className:"string",variants:[{begin:"'",end:"[^\\\\]'"},{begin:"`",end:"[^\\\\]`"}],relevance:0},{className:"symbol",variants:[{begin:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)"},{begin:"^\\s*%%[A-Za-z0-9_$#@~.?]*:"}],relevance:0},{className:"subst",begin:"%[0-9]+",relevance:0},{className:"subst",begin:"%!S+",relevance:0},{className:"meta",begin:/^\s*\.[\w_-]+/}]}}hFn.exports=vQi});var AFn=re((_pc,gFn)=>{p();function RQi(t){let n={$pattern:/[a-zA-Z][a-zA-Z0-9_?]*/,keyword:"if then else do while until for loop import with is as where when by data constant integer real text name boolean symbol infix prefix postfix block tree",literal:"true false nil",built_in:"in mod rem and or xor not abs sign floor ceil sqrt sin cos tan asin acos atan exp expm1 log log2 log10 log1p pi at text_length text_range text_find text_replace contains page slide basic_slide title_slide title subtitle fade_in fade_out fade_at clear_color color line_color line_width texture_wrap texture_transform texture scale_?x scale_?y scale_?z? translate_?x translate_?y translate_?z? rotate_?x rotate_?y rotate_?z? rectangle circle ellipse sphere path line_to move_to quad_to curve_to theme background contents locally time mouse_?x mouse_?y mouse_buttons "+"ObjectLoader Animate MovieCredits Slides Filters Shading Materials LensFlare Mapping VLCAudioVideo StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts"},r={className:"string",begin:'"',end:'"',illegal:"\\n"},i={className:"string",begin:"'",end:"'",illegal:"\\n"},s={className:"string",begin:"<<",end:">>"},o={className:"number",begin:"[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?"},a={beginKeywords:"import",end:"$",keywords:n,contains:[r]},c={className:"function",begin:/[a-z][^\n]*->/,returnBegin:!0,end:/->/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,keywords:n}})]};return{name:"XL",aliases:["tao"],keywords:n,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,r,i,s,c,a,o,t.NUMBER_MODE]}}gFn.exports=RQi});var EFn=re((Spc,yFn)=>{p();function kQi(t){return{name:"XQuery",aliases:["xpath","xq"],case_insensitive:!1,illegal:/(proc)|(abstract)|(extends)|(until)|(#)/,keywords:{$pattern:/[a-zA-Z$][a-zA-Z0-9_:-]*/,keyword:"module schema namespace boundary-space preserve no-preserve strip default collation base-uri ordering context decimal-format decimal-separator copy-namespaces empty-sequence except exponent-separator external grouping-separator inherit no-inherit lax minus-sign per-mille percent schema-attribute schema-element strict unordered zero-digit declare import option function validate variable for at in let where order group by return if then else tumbling sliding window start when only end previous next stable ascending descending allowing empty greatest least some every satisfies switch case typeswitch try catch and or to union intersect instance of treat as castable cast map array delete insert into replace value rename copy modify update",type:"item document-node node attribute document element comment namespace namespace-node processing-instruction text construction xs:anyAtomicType xs:untypedAtomic xs:duration xs:time xs:decimal xs:float xs:double xs:gYearMonth xs:gYear xs:gMonthDay xs:gMonth xs:gDay xs:boolean xs:base64Binary xs:hexBinary xs:anyURI xs:QName xs:NOTATION xs:dateTime xs:dateTimeStamp xs:date xs:string xs:normalizedString xs:token xs:language xs:NMTOKEN xs:Name xs:NCName xs:ID xs:IDREF xs:ENTITY xs:integer xs:nonPositiveInteger xs:negativeInteger xs:long xs:int xs:short xs:byte xs:nonNegativeInteger xs:unisignedLong xs:unsignedInt xs:unsignedShort xs:unsignedByte xs:positiveInteger xs:yearMonthDuration xs:dayTimeDuration",literal:"eq ne lt le gt ge is self:: child:: descendant:: descendant-or-self:: attribute:: following:: following-sibling:: parent:: ancestor:: ancestor-or-self:: preceding:: preceding-sibling:: NaN"},contains:[{className:"variable",begin:/[$][\w\-:]+/},{className:"built_in",variants:[{begin:/\barray:/,end:/(?:append|filter|flatten|fold-(?:left|right)|for-each(?:-pair)?|get|head|insert-before|join|put|remove|reverse|size|sort|subarray|tail)\b/},{begin:/\bmap:/,end:/(?:contains|entry|find|for-each|get|keys|merge|put|remove|size)\b/},{begin:/\bmath:/,end:/(?:a(?:cos|sin|tan[2]?)|cos|exp(?:10)?|log(?:10)?|pi|pow|sin|sqrt|tan)\b/},{begin:/\bop:/,end:/\(/,excludeEnd:!0},{begin:/\bfn:/,end:/\(/,excludeEnd:!0},{begin:/[^/,end:/(\/[\w._:-]+>)/,subLanguage:"xml",contains:[{begin:/\{/,end:/\}/,subLanguage:"xquery"},"self"]}]}}yFn.exports=kQi});var _Fn=re((Ipc,bFn)=>{p();function BQi(t){let e={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null})]},n=t.UNDERSCORE_TITLE_MODE,r={variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]},i="namespace class interface use extends function return abstract final public protected private static deprecated throw try catch Exception echo empty isset instanceof unset let var new const self require if else elseif switch case default do while loop for continue break likely unlikely __LINE__ __FILE__ __DIR__ __FUNCTION__ __CLASS__ __TRAIT__ __METHOD__ __NAMESPACE__ array boolean float double integer object resource string char long unsigned bool int uint ulong uchar true false null undefined";return{name:"Zephir",aliases:["zep"],keywords:i,contains:[t.C_LINE_COMMENT_MODE,t.COMMENT(/\/\*/,/\*\//,{contains:[{className:"doctag",begin:/@[A-Za-z]+/}]}),{className:"string",begin:/<<<['"]?\w+['"]?$/,end:/^\w+;/,contains:[t.BACKSLASH_ESCAPE]},{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",beginKeywords:"function fn",end:/[;{]/,excludeEnd:!0,illegal:/\$|\[|%/,contains:[n,{className:"params",begin:/\(/,end:/\)/,keywords:i,contains:["self",t.C_BLOCK_COMMENT_MODE,e,r]}]},{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,illegal:/[:($"]/,contains:[{beginKeywords:"extends implements"},n]},{beginKeywords:"namespace",end:/;/,illegal:/[.']/,contains:[n]},{beginKeywords:"use",end:/;/,contains:[n]},{begin:/=>/},e,r]}}bFn.exports=BQi});var SFn=re((Tpc,xFn)=>{p();var It=aat();It.registerLanguage("1c",QNn());It.registerLanguage("abnf",GNn());It.registerLanguage("accesslog",HNn());It.registerLanguage("actionscript",jNn());It.registerLanguage("ada",YNn());It.registerLanguage("angelscript",KNn());It.registerLanguage("apache",XNn());It.registerLanguage("applescript",rDn());It.registerLanguage("arcade",sDn());It.registerLanguage("arduino",aDn());It.registerLanguage("armasm",lDn());It.registerLanguage("xml",mDn());It.registerLanguage("asciidoc",gDn());It.registerLanguage("aspectj",yDn());It.registerLanguage("autohotkey",bDn());It.registerLanguage("autoit",xDn());It.registerLanguage("avrasm",CDn());It.registerLanguage("awk",wDn());It.registerLanguage("axapta",vDn());It.registerLanguage("bash",cat());It.registerLanguage("basic",kDn());It.registerLanguage("bnf",NDn());It.registerLanguage("brainfuck",PDn());It.registerLanguage("c-like",ODn());It.registerLanguage("c",lat());It.registerLanguage("cal",FDn());It.registerLanguage("capnproto",UDn());It.registerLanguage("ceylon",$Dn());It.registerLanguage("clean",HDn());It.registerLanguage("clojure",jDn());It.registerLanguage("clojure-repl",YDn());It.registerLanguage("cmake",KDn());It.registerLanguage("coffeescript",XDn());It.registerLanguage("coq",ePn());It.registerLanguage("cos",nPn());It.registerLanguage("cpp",dat());It.registerLanguage("crmsh",iPn());It.registerLanguage("crystal",oPn());It.registerLanguage("csharp",pat());It.registerLanguage("csp",cPn());It.registerLanguage("css",uPn());It.registerLanguage("d",pPn());It.registerLanguage("markdown",hPn());It.registerLanguage("dart",mat());It.registerLanguage("delphi",gPn());It.registerLanguage("diff",yPn());It.registerLanguage("django",bPn());It.registerLanguage("dns",xPn());It.registerLanguage("dockerfile",CPn());It.registerLanguage("dos",wPn());It.registerLanguage("dsconfig",vPn());It.registerLanguage("dts",kPn());It.registerLanguage("dust",NPn());It.registerLanguage("ebnf",PPn());It.registerLanguage("elixir",OPn());It.registerLanguage("elm",FPn());It.registerLanguage("ruby",wat());It.registerLanguage("erb",UPn());It.registerLanguage("erlang-repl",$Pn());It.registerLanguage("erlang",HPn());It.registerLanguage("excel",jPn());It.registerLanguage("fix",YPn());It.registerLanguage("flix",KPn());It.registerLanguage("fortran",XPn());It.registerLanguage("fsharp",eMn());It.registerLanguage("gams",nMn());It.registerLanguage("gauss",iMn());It.registerLanguage("gcode",oMn());It.registerLanguage("gherkin",cMn());It.registerLanguage("glsl",uMn());It.registerLanguage("gml",pMn());It.registerLanguage("go",hat());It.registerLanguage("golo",hMn());It.registerLanguage("gradle",gMn());It.registerLanguage("groovy",gat());It.registerLanguage("haml",yMn());It.registerLanguage("handlebars",_Mn());It.registerLanguage("haskell",SMn());It.registerLanguage("haxe",IMn());It.registerLanguage("hsp",TMn());It.registerLanguage("htmlbars",kMn());It.registerLanguage("http",NMn());It.registerLanguage("hy",PMn());It.registerLanguage("inform7",OMn());It.registerLanguage("ini",UMn());It.registerLanguage("irpf90",$Mn());It.registerLanguage("isbl",HMn());It.registerLanguage("java",Aat());It.registerLanguage("javascript",Eat());It.registerLanguage("jboss-cli",jMn());It.registerLanguage("json",YMn());It.registerLanguage("julia",KMn());It.registerLanguage("julia-repl",XMn());It.registerLanguage("kotlin",bat());It.registerLanguage("lasso",eOn());It.registerLanguage("latex",nOn());It.registerLanguage("ldif",iOn());It.registerLanguage("leaf",oOn());It.registerLanguage("less",uOn());It.registerLanguage("lisp",pOn());It.registerLanguage("livecodeserver",hOn());It.registerLanguage("livescript",gOn());It.registerLanguage("llvm",yOn());It.registerLanguage("lsl",bOn());It.registerLanguage("lua",_at());It.registerLanguage("makefile",xOn());It.registerLanguage("mathematica",TOn());It.registerLanguage("matlab",ROn());It.registerLanguage("maxima",BOn());It.registerLanguage("mel",DOn());It.registerLanguage("mercury",MOn());It.registerLanguage("mipsasm",LOn());It.registerLanguage("mizar",QOn());It.registerLanguage("perl",Sat());It.registerLanguage("mojolicious",GOn());It.registerLanguage("monkey",WOn());It.registerLanguage("moonscript",qOn());It.registerLanguage("n1ql",VOn());It.registerLanguage("nginx",zOn());It.registerLanguage("nim",JOn());It.registerLanguage("nix",xat());It.registerLanguage("node-repl",ZOn());It.registerLanguage("nsis",tLn());It.registerLanguage("objectivec",rLn());It.registerLanguage("ocaml",sLn());It.registerLanguage("openscad",aLn());It.registerLanguage("oxygene",lLn());It.registerLanguage("parser3",dLn());It.registerLanguage("pf",mLn());It.registerLanguage("pgsql",fLn());It.registerLanguage("php",Cat());It.registerLanguage("php-template",ALn());It.registerLanguage("plaintext",ELn());It.registerLanguage("pony",_Ln());It.registerLanguage("powershell",SLn());It.registerLanguage("processing",ILn());It.registerLanguage("profile",TLn());It.registerLanguage("prolog",RLn());It.registerLanguage("properties",BLn());It.registerLanguage("protobuf",DLn());It.registerLanguage("puppet",MLn());It.registerLanguage("purebasic",LLn());It.registerLanguage("python",Iat());It.registerLanguage("python-repl",QLn());It.registerLanguage("q",GLn());It.registerLanguage("qml",WLn());It.registerLanguage("r",qLn());It.registerLanguage("reasonml",VLn());It.registerLanguage("rib",zLn());It.registerLanguage("roboconf",JLn());It.registerLanguage("routeros",ZLn());It.registerLanguage("rsl",t2n());It.registerLanguage("ruleslanguage",r2n());It.registerLanguage("rust",Tat());It.registerLanguage("sas",s2n());It.registerLanguage("scala",vat());It.registerLanguage("scheme",a2n());It.registerLanguage("scilab",l2n());It.registerLanguage("scss",d2n());It.registerLanguage("shell",m2n());It.registerLanguage("smali",f2n());It.registerLanguage("smalltalk",A2n());It.registerLanguage("sml",E2n());It.registerLanguage("sqf",_2n());It.registerLanguage("sql_more",S2n());It.registerLanguage("sql",w2n());It.registerLanguage("stan",v2n());It.registerLanguage("stata",k2n());It.registerLanguage("step21",N2n());It.registerLanguage("stylus",P2n());It.registerLanguage("subunit",O2n());It.registerLanguage("swift",Pat());It.registerLanguage("taggerscript",F2n());It.registerLanguage("yaml",U2n());It.registerLanguage("tap",$2n());It.registerLanguage("tcl",q2n());It.registerLanguage("thrift",V2n());It.registerLanguage("tp",z2n());It.registerLanguage("twig",J2n());It.registerLanguage("typescript",Oat());It.registerLanguage("vala",Z2n());It.registerLanguage("vbnet",nFn());It.registerLanguage("vbscript",sFn());It.registerLanguage("vbscript-html",aFn());It.registerLanguage("verilog",lFn());It.registerLanguage("vhdl",dFn());It.registerLanguage("vim",mFn());It.registerLanguage("x86asm",fFn());It.registerLanguage("xl",AFn());It.registerLanguage("xquery",EFn());It.registerLanguage("zephir",_Fn());xFn.exports=It});function jFn(){return jat||(jat=new Promise(t=>{setImmediate(()=>{Promise.resolve().then(()=>Ot(SFn(),1)).then(()=>t(),()=>{t()})})})),jat}function DQi(t){let e=/\sclass\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(t),n=e?.[1]??e?.[2];if(n){for(let r of n.split(/\s+/))if(r.startsWith(IFn))return r.slice(IFn.length)}}function PQi(t,e){let n=e[t];if(n)return n;let r=t.indexOf(".");if(r!==-1){let s=e[t.slice(0,r)];if(s)return s}let i=t.indexOf("-");if(i!==-1){let s=e[t.slice(0,i)];if(s)return s}}function MQi(t,e){for(let n=t.length-1;n>=0;n--){let r=t[n];if(!r)continue;let i=PQi(r,e);if(i)return i}return e.default}function OQi(t,e){if(!t.startsWith(""||n===" "||n===" "||n===` +`||n==="\r"}function LQi(t,e={}){let n="",r="",i=[],s=()=>{if(!r)return;let a=MQi(i,e);n+=a?a(r):r,r=""},o=0;for(;o",o+5);if(a!==-1){s();let c=t.slice(o,a+1),u=DQi(c);i.push(u),o=a+1;continue}}if(t.startsWith(CFn,o)){s(),i.length>0&&i.pop(),o+=CFn.length;continue}if(t[o]==="&"){let a=ONn(t,o);if(a){r+=a.text,o+=a.length;continue}}r+=t[o],o++}return s(),n}function Vat(t,e={}){let n=e.language?qre.default.highlight(t,{language:e.language,ignoreIllegals:e.ignoreIllegals}).value:qre.default.highlightAuto(t,e.languageSubset).value;return LQi(n,e.theme)}function Yat(t){return qre.default.getLanguage(t)!==void 0}var qre,wFn,TFn,vFn,RFn,kFn,BFn,NFn,DFn,PFn,MFn,OFn,LFn,FFn,QFn,UFn,GFn,$Fn,WFn,HFn,qFn,NQi,jat,CFn,IFn,zat=v(()=>{p();qre=Ot(aat(),1),wFn=Ot(cat(),1),TFn=Ot(lat(),1),vFn=Ot(dat(),1),RFn=Ot(pat(),1),kFn=Ot(mat(),1),BFn=Ot(hat(),1),NFn=Ot(gat(),1),DFn=Ot(Aat(),1),PFn=Ot(Eat(),1),MFn=Ot(bat(),1),OFn=Ot(_at(),1),LFn=Ot(xat(),1),FFn=Ot(Sat(),1),QFn=Ot(Cat(),1),UFn=Ot(Iat(),1),GFn=Ot(wat(),1),$Fn=Ot(Tat(),1),WFn=Ot(vat(),1),HFn=Ot(Pat(),1),qFn=Ot(Oat(),1);LNn();NQi={python:UFn.default,java:DFn.default,go:BFn.default,javascript:PFn.default,cpp:vFn.default,typescript:qFn.default,php:QFn.default,ruby:GFn.default,c:TFn.default,csharp:RFn.default,nix:LFn.default,bash:wFn.default,rust:$Fn.default,scala:WFn.default,kotlin:MFn.default,swift:HFn.default,dart:kFn.default,groovy:NFn.default,perl:FFn.default,lua:OFn.default};for(let[t,e]of Object.entries(NQi))qre.default.registerLanguage(t,e);CFn="
    ",IFn="hljs-"});function zFn(t){Zat=t}function $Te(t){let e=t.replace("#","");if(e.length!==6)throw new Error(`Invalid hex color: ${t}`);let n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16);if(Number.isNaN(n)||Number.isNaN(r)||Number.isNaN(i))throw new Error(`Invalid hex color: ${t}`);return{r:n,g:r,b:i}}function Kat(t){let e=1/0,n=0;for(let r=0;rt)}function rct(){let t=Vst(),e=[],n=new Set,r=i=>{n.has(i.name)||(n.add(i.name),e.push(i))};for(let i of Object.keys(ZFn()))r({name:i,path:iQ.join(t,`${i}.json`)});for(let i of $Qi())r(i);for(let[i,s]of Ej.entries())r({name:i,path:s.sourcePath});return e.sort((i,s)=>i.name.localeCompare(s.name))}function $Qi(){let t=Owe(),e=[];if(!_E.existsSync(t))return e;for(let n of _E.readdirSync(t)){if(!n.endsWith(".json"))continue;let r=iQ.join(t,n);try{let i=bj(r);i.name&&e.push({name:i.name,path:r})}catch{}}return e}function WQi(t){if(t.includes("/"))throw new Error(`Invalid theme name "${t}": theme names cannot contain "/" because it is reserved for automatic light/dark theme settings.`)}function HQi(t,e){if(Zat)return Zat(t,e);if(typeof e!="object"||e===null||!("colors"in e))throw new Error(`Invalid theme "${t}": expected an object with a "colors" map.`);return e}function tct(t,e){let n;try{n=JSON.parse(zs(e))}catch(r){throw new Error(`Failed to parse theme ${t}: ${r}`)}return HQi(t,n)}function ict(t){let e=ZFn();if(t in e)return e[t];let n=Ej.get(t);if(n?.sourcePath){let o=_E.readFileSync(n.sourcePath,"utf-8");return tct(n.sourcePath,o)}if(n)throw new Error(`Theme "${t}" does not have a source path for export`);let r=Owe(),i=iQ.join(r,`${t}.json`);if(!_E.existsSync(i))throw new Error(`Theme not found: ${t}`);let s=_E.readFileSync(i,"utf-8");return tct(t,s)}function eQn(t,e,n){let r=e??(Dl().trueColor?"truecolor":"256color"),i=JFn(XFn(t.colors),t.vars),s={},o={},a=new Set(["selectedBg","searchMatchBg","userMessageBg","customMessageBg","toolPendingBg","toolSuccessBg","toolErrorBg"]);for(let[c,u]of Object.entries(i))a.has(c)?o[c]=u:s[c]=u;return new sQ(s,o,r,{name:t.name,sourcePath:n})}function bj(t,e){let n=_E.readFileSync(t,"utf-8"),r=tct(t,n);return eQn(r,e,t)}function Yre(t,e){let n=Ej.get(t);if(n)return n;let r=ict(t);return eQn(r,e)}function HTe(t){try{return Yre(t)}catch{return}}function LR(t){if(!t)return;let e=t.indexOf("/");if(e===-1||t.indexOf("/",e+1)!==-1)return;let n=t.slice(0,e).trim(),r=t.slice(e+1).trim();if(!(!n||!r))return{lightTheme:n,darkTheme:r}}function _j(t,e){let n=LR(t);if(n)return e==="light"?n.lightTheme:n.darkTheme;if(!t?.includes("/")&&typeof t=="string")return t}function qQi(t){let e=t.split(";");for(let n=e.length-1;n>=0;n--){let r=parseInt(e[n].trim(),10);if(Number.isInteger(r)&&r>=0&&r<=255)return r}}function tQn({r:t,g:e,b:n}){let r=i=>{let s=i/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4};return .2126*r(t)+.7152*r(e)+.0722*r(n)}function jQi(t){return tQn($Te(act(t)))}function VQi(t){return tQn(t)>=.5?"light":"dark"}function xj(t={}){let n=(t.env??process.env).COLORFGBG||"",r=qQi(n);return r!==void 0?{theme:jQi(r)>=.5?"light":"dark",source:"COLORFGBG",detail:`background color index ${r}`,confidence:"high"}:{theme:"dark",source:"fallback",detail:"no terminal background hint found",confidence:"low"}}async function sct({ui:t,timeoutMs:e,env:n}){try{let r=await t.queryTerminalBackgroundColor({timeoutMs:e});if(r)return{theme:VQi(r),source:"terminal background",detail:`OSC 11 background rgb(${r.r}, ${r.g}, ${r.b})`,confidence:"high"}}catch{}return xj({env:n})}async function zre({ui:t,timeoutMs:e,env:n}){let r;try{r=t.queryTerminalColorScheme?.({timeoutMs:e})}catch{}let i=sct({ui:t,timeoutMs:e,env:n});try{let s=await r;if(s)return s}catch{}return(await i).theme}function oct(){return xj().theme}function yj(t){globalThis[nQn]=t,globalThis[YQi]=t}function Sj(t){Ej.clear();for(let e of t)e.name&&(WQi(e.name),Ej.set(e.name,e))}function lw(t,e=!1){let n=t??oct();bE=n;try{yj(Yre(n)),e&&sQn()}catch{bE="dark",yj(Yre("dark"))}}function aQ(t,e=!1){bE=t;try{return yj(Yre(t)),e&&sQn(),oQ&&oQ(),{success:!0}}catch(n){return bE="dark",yj(Yre("dark")),{success:!1,error:n instanceof Error?n.message:String(n)}}}function rQn(t){yj(t),bE="",uS(),oQ&&oQ()}function iQn(t){oQ=t}function sQn(){if(uS(),!bE||bE==="dark"||bE==="light")return;let t=Owe(),e=bE,n=`${e}.json`,r=iQ.join(t,n);if(!_E.existsSync(r))return;let i=()=>{rQ&&clearTimeout(rQ),rQ=setTimeout(()=>{if(rQ=void 0,bE===e&&_E.existsSync(r))try{let s=bj(r);Ej.set(e,s),yj(s),oQ&&oQ()}catch{}},100)};Vre=pj(t,(s,o)=>{if(bE===e){if(!o){i();return}o===n&&i()}},()=>{tQ(Vre),Vre=void 0})??void 0}function uS(){rQ&&(clearTimeout(rQ),rQ=void 0),tQ(Vre),Vre=void 0}function act(t){let e=["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"];if(t<16)return e[t];if(t<232){let i=t-16,s=Math.floor(i/36),o=Math.floor(i%36/6),a=i%6,c=u=>(u===0?0:55+u*40).toString(16).padStart(2,"0");return`#${c(s)}${c(o)}${c(a)}`}let r=(8+(t-232)*10).toString(16).padStart(2,"0");return`#${r}${r}${r}`}function cct(t){let e=t??bE??oct(),n=e==="light",r=ict(e),i=JFn(XFn(r.colors),r.vars),s=n?"#000000":"#e5e5e7",o={};for(let[a,c]of Object.entries(i))typeof c=="number"?o[a]=act(c):c===""?o[a]=s:o[a]=c;return o}function lct(t){let e=t??bE??oct();try{let n=ict(e),r=n.export;if(!r)return{};let i=n.vars??{},s=o=>{if(o===void 0)return;let a=nct(o,i);if(typeof a=="number")return act(a);if(a!=="")return a};return{pageBg:s(r.pageBg),cardBg:s(r.cardBg),infoBg:s(r.infoBg)}}catch{return{}}}function zQi(t){return{keyword:e=>t.fg("syntaxKeyword",e),built_in:e=>t.fg("syntaxType",e),literal:e=>t.fg("syntaxNumber",e),number:e=>t.fg("syntaxNumber",e),regexp:e=>t.fg("syntaxString",e),string:e=>t.fg("syntaxString",e),comment:e=>t.fg("syntaxComment",e),doctag:e=>t.fg("syntaxComment",e),meta:e=>t.fg("muted",e),function:e=>t.fg("syntaxFunction",e),title:e=>t.fg("syntaxFunction",e),class:e=>t.fg("syntaxType",e),type:e=>t.fg("syntaxType",e),tag:e=>t.fg("syntaxPunctuation",e),name:e=>t.fg("syntaxKeyword",e),attr:e=>t.fg("syntaxVariable",e),variable:e=>t.fg("syntaxVariable",e),params:e=>t.fg("syntaxVariable",e),operator:e=>t.fg("syntaxOperator",e),punctuation:e=>t.fg("syntaxPunctuation",e),emphasis:e=>t.italic(e),strong:e=>t.bold(e),link:e=>t.underline(e),addition:e=>t.fg("toolDiffAdded",e),deletion:e=>t.fg("toolDiffRemoved",e)}}function oQn(t){return(YFn!==t||!Xat)&&(YFn=t,Xat=zQi(t)),Xat}function FR(t,e){let n=e&&Yat(e)?e:void 0;if(!n)return t.split(` +`).map(i=>Ee.fg("mdCodeBlock",i));let r={language:n,ignoreIllegals:!0,theme:oQn(Ee)};try{return Vat(t,r).split(` +`)}catch{return t.split(` +`)}}function kD(t){let e=t.split(".").pop()?.toLowerCase();return e?{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",ps1:"powershell",sql:"sql",html:"html",htm:"html",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",md:"markdown",markdown:"markdown",dockerfile:"dockerfile",makefile:"makefile",cmake:"cmake",lua:"lua",perl:"perl",r:"r",scala:"scala",clj:"clojure",ex:"elixir",exs:"elixir",erl:"erlang",hs:"haskell",ml:"ocaml",vim:"vim",graphql:"graphql",proto:"protobuf",tf:"hcl",hcl:"hcl"}[e]:void 0}function zh(){return{heading:t=>Ee.fg("mdHeading",t),link:t=>Ee.fg("mdLink",t),linkUrl:t=>Ee.fg("mdLinkUrl",t),code:t=>Ee.fg("mdCode",t),codeBlock:t=>Ee.fg("mdCodeBlock",t),codeBlockBorder:t=>Ee.fg("mdCodeBlockBorder",t),quote:t=>Ee.fg("mdQuote",t),quoteBorder:t=>Ee.fg("mdQuoteBorder",t),hr:t=>Ee.fg("mdHr",t),listBullet:t=>Ee.fg("mdListBullet",t),bold:t=>Ee.bold(t),italic:t=>Ee.italic(t),underline:t=>Ee.underline(t),strikethrough:t=>tn.strikethrough(t),highlightCode:(t,e)=>{let n=e&&Yat(e)?e:void 0;if(!n)return t.split(` +`).map(i=>Ee.fg("mdCodeBlock",i));let r={language:n,ignoreIllegals:!0,theme:oQn(Ee)};try{return Vat(t,r).split(` +`)}catch{return t.split(` +`).map(i=>Ee.fg("mdCodeBlock",i))}}}}function dS(){return{selectedPrefix:t=>Ee.fg("accent",t),selectedText:t=>Ee.fg("accent",t),description:t=>Ee.fg("muted",t),scrollInfo:t=>Ee.fg("muted",t),noMatch:t=>Ee.fg("muted",t)}}function Kre(){return{borderColor:t=>Ee.fg("borderMuted",t),selectList:dS()}}function Cj(){return{label:(t,e)=>e?Ee.fg("accent",t):t,value:(t,e)=>e?Ee.fg("accent",t):Ee.fg("muted",t),description:t=>Ee.fg("dim",t),cursor:Ee.fg("accent","\u2192 "),hint:t=>Ee.fg("dim",t)}}var _E,iQ,Zat,jre,ect,sQ,Jat,nQn,YQi,Ee,bE,Vre,rQ,oQ,Ej,YFn,Xat,pi=v(()=>{p();_E=Ot(require("node:fs"),1),iQ=Ot(require("node:path"),1);Tr();gb();Qs();Jot();zat();nm();jre=[0,95,135,175,215,255],ect=Array.from({length:24},(t,e)=>8+e*10);sQ=class{name;sourcePath;sourceInfo;fgColors;bgColors;mode;constructor(e,n,r,i={}){this.name=i.name,this.sourcePath=i.sourcePath,this.sourceInfo=i.sourceInfo,this.mode=r,this.fgColors=new Map;let s={...e,scrollbarTrack:e.scrollbarTrack??e.muted,scrollbarThumb:e.scrollbarThumb??e.text,thinkingMax:e.thinkingMax??e.thinkingXhigh,searchMatchText:e.searchMatchText??e.text};for(let[a,c]of Object.entries(s))this.fgColors.set(a,UQi(c,r));this.bgColors=new Map;let o={...n,searchMatchBg:n.searchMatchBg??n.selectedBg};for(let[a,c]of Object.entries(o))this.bgColors.set(a,GQi(c,r))}fg(e,n){let r=this.fgColors.get(e);if(!r)throw new Error(`Unknown theme color: ${e}`);return`${r}${n}\x1B[39m`}bg(e,n){let r=this.bgColors.get(e);if(!r)throw new Error(`Unknown theme background color: ${e}`);return`${r}${n}\x1B[49m`}bold(e){return tn.bold(e)}italic(e){return tn.italic(e)}underline(e){return tn.underline(e)}inverse(e){return tn.inverse(e)}strikethrough(e){return tn.strikethrough(e)}getFgAnsi(e){let n=this.fgColors.get(e);if(!n)throw new Error(`Unknown theme color: ${e}`);return n}getBgAnsi(e){let n=this.bgColors.get(e);if(!n)throw new Error(`Unknown theme background color: ${e}`);return n}getColorMode(){return this.mode}getThinkingBorderColor(e){switch(e){case"off":return n=>this.fg("thinkingOff",n);case"minimal":return n=>this.fg("thinkingMinimal",n);case"low":return n=>this.fg("thinkingLow",n);case"medium":return n=>this.fg("thinkingMedium",n);case"high":return n=>this.fg("thinkingHigh",n);case"xhigh":return n=>this.fg("thinkingXhigh",n);case"max":return n=>this.fg("thinkingMax",n);default:return n=>this.fg("thinkingOff",n)}}getBashModeBorderColor(){return e=>this.fg("bashMode",e)}};nQn=Symbol.for("@earendil-works/pi-coding-agent:theme"),YQi=Symbol.for("@mariozechner/pi-coding-agent:theme"),Ee=new Proxy({},{get(t,e){let n=globalThis[nQn];if(!n)throw new Error("Theme not initialized. Call initTheme() first.");return n[e]}});Ej=new Map});var Yo=re(th=>{"use strict";p();var uct=Symbol.for("yaml.alias"),aQn=Symbol.for("yaml.document"),qTe=Symbol.for("yaml.map"),cQn=Symbol.for("yaml.pair"),dct=Symbol.for("yaml.scalar"),jTe=Symbol.for("yaml.seq"),QR=Symbol.for("yaml.node.type"),KQi=t=>!!t&&typeof t=="object"&&t[QR]===uct,JQi=t=>!!t&&typeof t=="object"&&t[QR]===aQn,XQi=t=>!!t&&typeof t=="object"&&t[QR]===qTe,ZQi=t=>!!t&&typeof t=="object"&&t[QR]===cQn,lQn=t=>!!t&&typeof t=="object"&&t[QR]===dct,eUi=t=>!!t&&typeof t=="object"&&t[QR]===jTe;function uQn(t){if(t&&typeof t=="object")switch(t[QR]){case qTe:case jTe:return!0}return!1}function tUi(t){if(t&&typeof t=="object")switch(t[QR]){case uct:case qTe:case dct:case jTe:return!0}return!1}var nUi=t=>(lQn(t)||uQn(t))&&!!t.anchor;th.ALIAS=uct;th.DOC=aQn;th.MAP=qTe;th.NODE_TYPE=QR;th.PAIR=cQn;th.SCALAR=dct;th.SEQ=jTe;th.hasAnchor=nUi;th.isAlias=KQi;th.isCollection=uQn;th.isDocument=JQi;th.isMap=XQi;th.isNode=tUi;th.isPair=ZQi;th.isScalar=lQn;th.isSeq=eUi});var Jre=re(pct=>{"use strict";p();var pp=Yo(),RA=Symbol("break visit"),dQn=Symbol("skip children"),uw=Symbol("remove node");function VTe(t,e){let n=pQn(e);pp.isDocument(t)?Ij(null,t.contents,n,Object.freeze([t]))===uw&&(t.contents=null):Ij(null,t,n,Object.freeze([]))}VTe.BREAK=RA;VTe.SKIP=dQn;VTe.REMOVE=uw;function Ij(t,e,n,r){let i=mQn(t,e,n,r);if(pp.isNode(i)||pp.isPair(i))return hQn(t,r,i),Ij(t,i,n,r);if(typeof i!="symbol"){if(pp.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s{"use strict";p();var fQn=Yo(),rUi=Jre(),iUi={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},sUi=t=>t.replace(/[!,[\]{}]/g,e=>iUi[e]),Xre=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+sUi(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(e&&r.length>0&&fQn.isNode(e.contents)){let s={};rUi.visit(e.contents,(o,a)=>{fQn.isNode(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` +`)}};Xre.defaultYaml={explicit:!1,version:"1.2"};Xre.defaultTags={"!!":"tag:yaml.org,2002:"};gQn.Directives=Xre});var zTe=re(Zre=>{"use strict";p();var AQn=Yo(),oUi=Jre();function aUi(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function yQn(t){let e=new Set;return oUi.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function EQn(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function cUi(t,e){let n=[],r=new Map,i=null;return{onAnchor:s=>{n.push(s),i??(i=yQn(t));let o=EQn(e,i);return i.add(o),o},setAnchors:()=>{for(let s of n){let o=r.get(s);if(typeof o=="object"&&o.anchor&&(AQn.isScalar(o.node)||AQn.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:r}}Zre.anchorIsValid=aUi;Zre.anchorNames=yQn;Zre.createNodeAnchors=cUi;Zre.findNewAnchor=EQn});var hct=re(bQn=>{"use strict";p();function eie(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i{"use strict";p();var lUi=Yo();function _Qn(t,e,n){if(Array.isArray(t))return t.map((r,i)=>_Qn(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!lUi.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!n?.keep?Number(t):t}xQn.toJS=_Qn});var KTe=re(CQn=>{"use strict";p();var uUi=hct(),SQn=Yo(),dUi=BD(),fct=class{constructor(e){Object.defineProperty(this,SQn.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!SQn.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=dUi.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:u}of o.anchors.values())i(u,c);return typeof s=="function"?uUi.applyReviver(s,{"":a},"",a):a}};CQn.NodeBase=fct});var tie=re(IQn=>{"use strict";p();var pUi=zTe(),mUi=Jre(),Tj=Yo(),hUi=KTe(),fUi=BD(),gct=class extends hUi.NodeBase{constructor(e){super(Tj.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],mUi.visit(e,{Node:(s,o)=>{(Tj.isAlias(o)||Tj.hasAnchor(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(let s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:s}=n,o=this.resolve(i,n);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(fUi.toJS(o,null,n),a=r.get(o)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=JTe(i,o,r)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(pUi.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function JTe(t,e,n){if(Tj.isAlias(e)){let r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Tj.isCollection(e)){let r=0;for(let i of e.items){let s=JTe(t,i,n);s>r&&(r=s)}return r}else if(Tj.isPair(e)){let r=JTe(t,e.key,n),i=JTe(t,e.value,n);return Math.max(r,i)}return 1}IQn.Alias=gct});var Md=re(Act=>{"use strict";p();var gUi=Yo(),AUi=KTe(),yUi=BD(),EUi=t=>!t||typeof t!="function"&&typeof t!="object",ND=class extends AUi.NodeBase{constructor(e){super(gUi.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:yUi.toJS(this.value,e,n)}toString(){return String(this.value)}};ND.BLOCK_FOLDED="BLOCK_FOLDED";ND.BLOCK_LITERAL="BLOCK_LITERAL";ND.PLAIN="PLAIN";ND.QUOTE_DOUBLE="QUOTE_DOUBLE";ND.QUOTE_SINGLE="QUOTE_SINGLE";Act.Scalar=ND;Act.isScalarValue=EUi});var nie=re(TQn=>{"use strict";p();var bUi=tie(),cQ=Yo(),wQn=Md(),_Ui="tag:yaml.org,2002:";function xUi(t,e,n){if(e){let r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>r.identify?.(t)&&!r.format)}function SUi(t,e,n){if(cQ.isDocument(t)&&(t=t.contents),cQ.isNode(t))return t;if(cQ.isPair(t)){let d=n.schema[cQ.MAP].createNode?.(n.schema,null,n);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=n,c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new bUi.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=_Ui+e.slice(2));let u=xUi(t,e,o.tags);if(!u){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new wQn.Scalar(t);return c&&(c.node=d),d}u=t instanceof Map?o[cQ.MAP]:Symbol.iterator in Object(t)?o[cQ.SEQ]:o[cQ.MAP]}s&&(s(u),delete n.onTagObj);let l=u?.createNode?u.createNode(n.schema,t,n):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(n.schema,t,n):new wQn.Scalar(t);return e?l.tag=e:u.default||(l.tag=u.tag),c&&(c.node=l),l}TQn.createNode=SUi});var ZTe=re(XTe=>{"use strict";p();var CUi=nie(),dw=Yo(),IUi=KTe();function yct(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return CUi.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var vQn=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Ect=class extends IUi.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>dw.isNode(r)||dw.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(vQn(e))this.add(n);else{let[r,...i]=e,s=this.get(r,!0);if(dw.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,yct(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(dw.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...i]=e,s=this.get(r,!0);return i.length===0?!n&&dw.isScalar(s)?s.value:s:dw.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!dw.isPair(n))return!1;let r=n.value;return r==null||e&&dw.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let i=this.get(n,!0);return dw.isCollection(i)?i.hasIn(r):!1}setIn(e,n){let[r,...i]=e;if(i.length===0)this.set(r,n);else{let s=this.get(r,!0);if(dw.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,yct(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};XTe.Collection=Ect;XTe.collectionFromPath=yct;XTe.isEmptyPath=vQn});var rie=re(eve=>{"use strict";p();var wUi=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function bct(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var TUi=(t,e,n)=>t.endsWith(` +`)?bct(n,e):n.includes(` `)?` -`+zze(n,e):(t.endsWith(" ")?"":" ")+n;k_e.indentComment=zze;k_e.lineComment=qas;k_e.stringifyComment=Was});var gmn=ee(HX=>{"use strict";p();var Has="flow",Jze="block",N_e="quoted";function Vas(t,e,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return t;ss-Math.max(2,i)?u.push(0):d=s-r);let h,m,f=!1,g=-1,A=-1,y=-1;n===Jze&&(g=fmn(t,g,e.length),g!==-1&&(d=g+c));for(let S;S=t[g+=1];){if(n===N_e&&S==="\\"){switch(A=g,t[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(S===` -`)n===Jze&&(g=fmn(t,g,e.length)),d=g+e.length+c,h=void 0;else{if(S===" "&&m&&m!==" "&&m!==` -`&&m!==" "){let C=t[g+1];C&&C!==" "&&C!==` -`&&C!==" "&&(h=g)}if(g>=d)if(h)u.push(h),d=h+c,h=void 0;else if(n===N_e){for(;m===" "||m===" ";)m=S,S=t[g+=1],f=!0;let C=g>y+1?g-2:A-1;if(l[C])return t;u.push(C),l[C]=!0,d=C+c,h=void 0}else f=!0}m=S}if(f&&a&&a(),u.length===0)return t;o&&o();let b=t.slice(0,u[0]);for(let S=0;S{"use strict";p();var h0=qu(),UN=gmn(),B_e=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),P_e=t=>/^(%|---|\.\.\.)/m.test(t);function jas(t,e,n){if(!e||e<0)return!1;let r=e-n,s=t.length;if(s<=r)return!1;for(let i=0,o=0;ir)return!0;if(o=i+1,s-o<=r)return!1}return!0}function VX(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(P_e(t)?" ":""),o="",a=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);let l=n.substr(c+2,4);switch(l){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:l.substr(0,2)==="00"?o+="\\x"+l.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length{"use strict";p();var vUi="flow",_ct="block",tve="quoted";function RUi(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,s)?u.push(0):d=i-r);let m,h,f=!1,g=-1,A=-1,y=-1;n===_ct&&(g=RQn(t,g,e.length),g!==-1&&(d=g+c));for(let _;_=t[g+=1];){if(n===tve&&_==="\\"){switch(A=g,t[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(_===` +`)n===_ct&&(g=RQn(t,g,e.length)),d=g+e.length+c,m=void 0;else{if(_===" "&&h&&h!==" "&&h!==` +`&&h!==" "){let S=t[g+1];S&&S!==" "&&S!==` +`&&S!==" "&&(m=g)}if(g>=d)if(m)u.push(m),d=m+c,m=void 0;else if(n===tve){for(;h===" "||h===" ";)h=_,_=t[g+=1],f=!0;let S=g>y+1?g-2:A-1;if(l[S])return t;u.push(S),l[S]=!0,d=S+c,m=void 0}else f=!0}h=_}if(f&&a&&a(),u.length===0)return t;o&&o();let E=t.slice(0,u[0]);for(let _=0;_{"use strict";p();var pS=Md(),DD=kQn(),rve=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),ive=t=>/^(%|---|\.\.\.)/m.test(t);function kUi(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,o=0;sr)return!0;if(o=s+1,i-o<=r)return!1}return!0}function sie(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(ive(t)?" ":""),o="",a=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);let l=n.substr(c+2,4);switch(l){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:l.substr(0,2)==="00"?o+="\\x"+l.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length -`;let d,h;for(h=n.length;h>0;--h){let I=n[h-1];if(I!==` -`&&I!==" "&&I!==" ")break}let m=n.substring(h),f=m.indexOf(` -`);f===-1?d="-":n===m||f!==m.length-1?(d="+",i&&i()):d="",m&&(n=n.slice(0,-m.length),m[m.length-1]===` -`&&(m=m.slice(0,-1)),m=m.replace(Zze,`$&${u}`));let g=!1,A,y=-1;for(A=0;A{x=!0});let R=UN.foldFlowLines(`${b}${I}${m}`,u,UN.FOLD_BLOCK,w);if(!x)return`>${C} -${u}${R}`}return n=n.replace(/\n+/g,`$&${u}`),`|${C} -${u}${b}${n}${m}`}function Yas(t,e,n,r){let{type:s,value:i}=t,{actualString:o,implicitKey:a,indent:c,indentStep:u,inFlow:l}=e;if(a&&i.includes(` -`)||l&&/[[\]{},]/.test(i))return QH(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||l||!i.includes(` -`)?QH(i,e):D_e(t,e,n,r);if(!a&&!l&&s!==h0.Scalar.PLAIN&&i.includes(` -`))return D_e(t,e,n,r);if(P_e(i)){if(c==="")return e.forceBlockIndent=!0,D_e(t,e,n,r);if(a&&c===u)return QH(i,e)}let d=i.replace(/\n+/g,`$& -${c}`);if(o){let h=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:m,tags:f}=e.doc.schema;if(f.some(h)||m?.some(h))return QH(i,e)}return a?d:UN.foldFlowLines(d,c,UN.FOLD_FLOW,B_e(e,!1))}function Kas(t,e,n,r){let{implicitKey:s,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==h0.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=h0.Scalar.QUOTE_DOUBLE);let c=l=>{switch(l){case h0.Scalar.BLOCK_FOLDED:case h0.Scalar.BLOCK_LITERAL:return s||i?QH(o.value,e):D_e(o,e,n,r);case h0.Scalar.QUOTE_DOUBLE:return VX(o.value,e);case h0.Scalar.QUOTE_SINGLE:return Xze(o.value,e);case h0.Scalar.PLAIN:return Yas(o,e,n,r);default:return null}},u=c(a);if(u===null){let{defaultKeyType:l,defaultStringType:d}=e.options,h=s&&l||d;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}Amn.stringifyString=Kas});var YX=ee(e7e=>{"use strict";p();var zas=x_e(),$N=vo(),Jas=qX(),Xas=jX();function Zas(t,e){let n=Object.assign({blockQuote:!0,commentString:Jas.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function ecs(t,e){if(e.tag){let s=t.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let n,r;if($N.isScalar(e)){r=e.value;let s=t.filter(i=>i.identify?.(r));if(s.length>1){let i=s.filter(o=>o.test);i.length>0&&(s=i)}n=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){let s=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function tcs(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let s=[],i=($N.isScalar(t)||$N.isCollection(t))&&t.anchor;i&&zas.anchorIsValid(i)&&(n.add(i),s.push(`&${i}`));let o=t.tag??(e.default?null:e.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}function ncs(t,e,n,r){if($N.isPair(t))return t.toString(e,n,r);if($N.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let s,i=$N.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>s=c});s??(s=ecs(e.doc.schema.tags,i));let o=tcs(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof s.stringify=="function"?s.stringify(i,e,n,r):$N.isScalar(i)?Xas.stringifyString(i,e,n,r):i.toString(e,n,r);return o?$N.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o} -${e.indent}${a}`:a}e7e.createStringifyContext=Zas;e7e.stringify=ncs});var _mn=ee(bmn=>{"use strict";p();var oT=vo(),ymn=qu(),Emn=YX(),KX=qX();function rcs({key:t,value:e},n,r,s){let{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:u,indentSeq:l,simpleKeys:d}}=n,h=oT.isNode(t)&&t.comment||null;if(d){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(oT.isCollection(t)||!oT.isNode(t)&&typeof t=="object"){let w="With simple keys, collection cannot be used as a key value";throw new Error(w)}}let m=!d&&(!t||h&&e==null&&!n.inFlow||oT.isCollection(t)||(oT.isScalar(t)?t.type===ymn.Scalar.BLOCK_FOLDED||t.type===ymn.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(d||!i),indent:a+c});let f=!1,g=!1,A=Emn.stringify(t,n,()=>f=!0,()=>g=!0);if(!m&&!n.inFlow&&A.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(i||e==null)return f&&r&&r(),A===""?"?":m?`? ${A}`:A}else if(i&&!d||e==null&&m)return A=`? ${A}`,h&&!f?A+=KX.lineComment(A,n.indent,u(h)):g&&s&&s(),A;f&&(h=null),m?(h&&(A+=KX.lineComment(A,n.indent,u(h))),A=`? ${A} -${a}:`):(A=`${A}:`,h&&(A+=KX.lineComment(A,n.indent,u(h))));let y,b,S;oT.isNode(e)?(y=!!e.spaceBefore,b=e.commentBefore,S=e.comment):(y=!1,b=null,S=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!m&&!h&&oT.isScalar(e)&&(n.indentAtStart=A.length+1),g=!1,!l&&c.length>=2&&!n.inFlow&&!m&&oT.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let C=!1,I=Emn.stringify(e,n,()=>C=!0,()=>g=!0),x=" ";if(h||y||b){if(x=y?` -`:"",b){let w=u(b);x+=` -${KX.indentComment(w,n.indent)}`}I===""&&!n.inFlow?x===` -`&&S&&(x=` - -`):x+=` -${n.indent}`}else if(!m&&oT.isCollection(e)){let w=I[0],R=I.indexOf(` -`),N=R!==-1,P=n.inFlow??e.flow??e.items.length===0;if(N||!P){let G=!1;if(N&&(w==="&"||w==="!")){let $=I.indexOf(" ");w==="&"&&$!==-1&&${"use strict";p();var Smn=require("process");function scs(t,...e){t==="debug"&&console.log(...e)}function ics(t,e){(t==="debug"||t==="warn")&&(typeof Smn.emitWarning=="function"?Smn.emitWarning(e):console.warn(e))}t7e.debug=scs;t7e.warn=ics});var Q_e=ee(F_e=>{"use strict";p();var L_e=vo(),Cmn=qu(),O_e="<<",M_e={identify:t=>t===O_e||typeof t=="symbol"&&t.description===O_e,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Cmn.Scalar(Symbol(O_e)),{addToJSMap:Imn}),stringify:()=>O_e},ocs=(t,e)=>(M_e.identify(e)||L_e.isScalar(e)&&(!e.type||e.type===Cmn.Scalar.PLAIN)&&M_e.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===M_e.tag&&n.default);function Imn(t,e,n){let r=xmn(t,n);if(L_e.isSeq(r))for(let s of r.items)r7e(t,e,s);else if(Array.isArray(r))for(let s of r)r7e(t,e,s);else r7e(t,e,r)}function r7e(t,e,n){let r=xmn(t,n);if(!L_e.isMap(r))throw new Error("Merge sources must be maps or map aliases");let s=r.toJSON(null,t,Map);for(let[i,o]of s)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function xmn(t,e){return t&&L_e.isAlias(e)?e.resolve(t.doc,t):e}F_e.addMergeToJSMap=Imn;F_e.isMergeKey=ocs;F_e.merge=M_e});var i7e=ee(vmn=>{"use strict";p();var acs=n7e(),wmn=Q_e(),ccs=YX(),Tmn=vo(),s7e=FN();function lcs(t,e,{key:n,value:r}){if(Tmn.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(wmn.isMergeKey(t,n))wmn.addMergeToJSMap(t,e,r);else{let s=s7e.toJS(n,"",t);if(e instanceof Map)e.set(s,s7e.toJS(r,s,t));else if(e instanceof Set)e.add(s);else{let i=ucs(n,s,t),o=s7e.toJS(r,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function ucs(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Tmn.isNode(t)&&n?.doc){let r=ccs.createStringifyContext(n.doc,{});r.anchors=new Set;for(let i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;let s=t.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),acs.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(e)}vmn.addPairToJSMap=lcs});var GN=ee(o7e=>{"use strict";p();var Rmn=WX(),dcs=_mn(),pcs=i7e(),U_e=vo();function hcs(t,e,n){let r=Rmn.createNode(t,void 0,n),s=Rmn.createNode(e,void 0,n);return new $_e(r,s)}var $_e=class t{constructor(e,n=null){Object.defineProperty(this,U_e.NODE_TYPE,{value:U_e.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return U_e.isNode(n)&&(n=n.clone(e)),U_e.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return pcs.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?dcs.stringifyPair(this,e,n,r):JSON.stringify(this)}};o7e.Pair=$_e;o7e.createPair=hcs});var a7e=ee(Nmn=>{"use strict";p();var VM=vo(),kmn=YX(),G_e=qX();function mcs(t,e,n){return(e.inFlow??t.flow?gcs:fcs)(t,e,n)}function fcs({comment:t,items:e},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:u}}=n,l=Object.assign({},n,{indent:i,type:null}),d=!1,h=[];for(let f=0;fA=null,()=>d=!0);A&&(y+=G_e.lineComment(y,i,u(A))),d&&A&&(d=!1),h.push(r+y)}let m;if(h.length===0)m=s.start+s.end;else{m=h[0];for(let f=1;f0;--m){let C=n[m-1];if(C!==` +`&&C!==" "&&C!==" ")break}let h=n.substring(m),f=h.indexOf(` +`);f===-1?d="-":n===h||f!==h.length-1?(d="+",s&&s()):d="",h&&(n=n.slice(0,-h.length),h[h.length-1]===` +`&&(h=h.slice(0,-1)),h=h.replace(Sct,`$&${u}`));let g=!1,A,y=-1;for(A=0;A{I=!0});let k=DD.foldFlowLines(`${E}${C}${h}`,u,DD.FOLD_BLOCK,w);if(!I)return`>${S} +${u}${k}`}return n=n.replace(/\n+/g,`$&${u}`),`|${S} +${u}${E}${n}${h}`}function BUi(t,e,n,r){let{type:i,value:s}=t,{actualString:o,implicitKey:a,indent:c,indentStep:u,inFlow:l}=e;if(a&&s.includes(` +`)||l&&/[[\]{},]/.test(s))return vj(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||l||!s.includes(` +`)?vj(s,e):nve(t,e,n,r);if(!a&&!l&&i!==pS.Scalar.PLAIN&&s.includes(` +`))return nve(t,e,n,r);if(ive(s)){if(c==="")return e.forceBlockIndent=!0,nve(t,e,n,r);if(a&&c===u)return vj(s,e)}let d=s.replace(/\n+/g,`$& +${c}`);if(o){let m=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:h,tags:f}=e.doc.schema;if(f.some(m)||h?.some(m))return vj(s,e)}return a?d:DD.foldFlowLines(d,c,DD.FOLD_FLOW,rve(e,!1))}function NUi(t,e,n,r){let{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==pS.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=pS.Scalar.QUOTE_DOUBLE);let c=l=>{switch(l){case pS.Scalar.BLOCK_FOLDED:case pS.Scalar.BLOCK_LITERAL:return i||s?vj(o.value,e):nve(o,e,n,r);case pS.Scalar.QUOTE_DOUBLE:return sie(o.value,e);case pS.Scalar.QUOTE_SINGLE:return xct(o.value,e);case pS.Scalar.PLAIN:return BUi(o,e,n,r);default:return null}},u=c(a);if(u===null){let{defaultKeyType:l,defaultStringType:d}=e.options,m=i&&l||d;if(u=c(m),u===null)throw new Error(`Unsupported default string type ${m}`)}return u}BQn.stringifyString=NUi});var aie=re(Cct=>{"use strict";p();var DUi=zTe(),PD=Yo(),PUi=rie(),MUi=oie();function OUi(t,e){let n=Object.assign({blockQuote:!0,commentString:PUi.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function LUi(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let n,r;if(PD.isScalar(e)){r=e.value;let i=t.filter(s=>s.identify?.(r));if(i.length>1){let s=i.filter(o=>o.test);s.length>0&&(i=s)}n=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function FUi(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(PD.isScalar(t)||PD.isCollection(t))&&t.anchor;s&&DUi.anchorIsValid(s)&&(n.add(s),i.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function QUi(t,e,n,r){if(PD.isPair(t))return t.toString(e,n,r);if(PD.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=PD.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=LUi(e.doc.schema.tags,s));let o=FUi(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(s,e,n,r):PD.isScalar(s)?MUi.stringifyString(s,e,n,r):s.toString(e,n,r);return o?PD.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o} +${e.indent}${a}`:a}Cct.createStringifyContext=OUi;Cct.stringify=QUi});var MQn=re(PQn=>{"use strict";p();var UR=Yo(),NQn=Md(),DQn=aie(),cie=rie();function UUi({key:t,value:e},n,r,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:u,indentSeq:l,simpleKeys:d}}=n,m=UR.isNode(t)&&t.comment||null;if(d){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(UR.isCollection(t)||!UR.isNode(t)&&typeof t=="object"){let w="With simple keys, collection cannot be used as a key value";throw new Error(w)}}let h=!d&&(!t||m&&e==null&&!n.inFlow||UR.isCollection(t)||(UR.isScalar(t)?t.type===NQn.Scalar.BLOCK_FOLDED||t.type===NQn.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(d||!s),indent:a+c});let f=!1,g=!1,A=DQn.stringify(t,n,()=>f=!0,()=>g=!0);if(!h&&!n.inFlow&&A.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return f&&r&&r(),A===""?"?":h?`? ${A}`:A}else if(s&&!d||e==null&&h)return A=`? ${A}`,m&&!f?A+=cie.lineComment(A,n.indent,u(m)):g&&i&&i(),A;f&&(m=null),h?(m&&(A+=cie.lineComment(A,n.indent,u(m))),A=`? ${A} +${a}:`):(A=`${A}:`,m&&(A+=cie.lineComment(A,n.indent,u(m))));let y,E,_;UR.isNode(e)?(y=!!e.spaceBefore,E=e.commentBefore,_=e.comment):(y=!1,E=null,_=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!m&&UR.isScalar(e)&&(n.indentAtStart=A.length+1),g=!1,!l&&c.length>=2&&!n.inFlow&&!h&&UR.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,C=DQn.stringify(e,n,()=>S=!0,()=>g=!0),I=" ";if(m||y||E){if(I=y?` +`:"",E){let w=u(E);I+=` +${cie.indentComment(w,n.indent)}`}C===""&&!n.inFlow?I===` +`&&_&&(I=` + +`):I+=` +${n.indent}`}else if(!h&&UR.isCollection(e)){let w=C[0],k=C.indexOf(` +`),N=k!==-1,O=n.inFlow??e.flow??e.items.length===0;if(N||!O){let W=!1;if(N&&(w==="&"||w==="!")){let $=C.indexOf(" ");w==="&"&&$!==-1&&${"use strict";p();var OQn=require("process");function GUi(t,...e){t==="debug"&&console.log(...e)}function $Ui(t,e){(t==="debug"||t==="warn")&&(typeof OQn.emitWarning=="function"?OQn.emitWarning(e):console.warn(e))}Ict.debug=GUi;Ict.warn=$Ui});var lve=re(cve=>{"use strict";p();var ave=Yo(),LQn=Md(),sve="<<",ove={identify:t=>t===sve||typeof t=="symbol"&&t.description===sve,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new LQn.Scalar(Symbol(sve)),{addToJSMap:FQn}),stringify:()=>sve},WUi=(t,e)=>(ove.identify(e)||ave.isScalar(e)&&(!e.type||e.type===LQn.Scalar.PLAIN)&&ove.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===ove.tag&&n.default);function FQn(t,e,n){let r=QQn(t,n);if(ave.isSeq(r))for(let i of r.items)Tct(t,e,i);else if(Array.isArray(r))for(let i of r)Tct(t,e,i);else Tct(t,e,r)}function Tct(t,e,n){let r=QQn(t,n);if(!ave.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,t,Map);for(let[s,o]of i)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function QQn(t,e){return t&&ave.isAlias(e)?e.resolve(t.doc,t):e}cve.addMergeToJSMap=FQn;cve.isMergeKey=WUi;cve.merge=ove});var Rct=re($Qn=>{"use strict";p();var HUi=wct(),UQn=lve(),qUi=aie(),GQn=Yo(),vct=BD();function jUi(t,e,{key:n,value:r}){if(GQn.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(UQn.isMergeKey(t,n))UQn.addMergeToJSMap(t,e,r);else{let i=vct.toJS(n,"",t);if(e instanceof Map)e.set(i,vct.toJS(r,i,t));else if(e instanceof Set)e.add(i);else{let s=VUi(n,i,t),o=vct.toJS(r,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function VUi(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(GQn.isNode(t)&&n?.doc){let r=qUi.createStringifyContext(n.doc,{});r.anchors=new Set;for(let s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=t.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),HUi.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}$Qn.addPairToJSMap=jUi});var MD=re(kct=>{"use strict";p();var WQn=nie(),YUi=MQn(),zUi=Rct(),uve=Yo();function KUi(t,e,n){let r=WQn.createNode(t,void 0,n),i=WQn.createNode(e,void 0,n);return new dve(r,i)}var dve=class t{constructor(e,n=null){Object.defineProperty(this,uve.NODE_TYPE,{value:uve.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return uve.isNode(n)&&(n=n.clone(e)),uve.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return zUi.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?YUi.stringifyPair(this,e,n,r):JSON.stringify(this)}};kct.Pair=dve;kct.createPair=KUi});var Bct=re(qQn=>{"use strict";p();var lQ=Yo(),HQn=aie(),pve=rie();function JUi(t,e,n){return(e.inFlow??t.flow?ZUi:XUi)(t,e,n)}function XUi({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:u}}=n,l=Object.assign({},n,{indent:s,type:null}),d=!1,m=[];for(let f=0;fA=null,()=>d=!0);A&&(y+=pve.lineComment(y,s,u(A))),d&&A&&(d=!1),m.push(r+y)}let h;if(m.length===0)h=i.start+i.end;else{h=m[0];for(let f=1;fA=null);u||(u=d.length>l||y.includes(` -`)),f0&&(u||(u=d.reduce((b,S)=>b+S.length+2,2)+(y.length+2)>e.options.lineWidth)),u&&(y+=",")),A&&(y+=G_e.lineComment(y,r,a(A))),d.push(y),l=d.length}let{start:h,end:m}=n;if(d.length===0)return h+m;if(!u){let f=d.reduce((g,A)=>g+A.length+2,2);u=e.options.lineWidth>0&&f>e.options.lineWidth}if(u){let f=h;for(let g of d)f+=g?` -${i}${s}${g}`:` +`}}return t?(h+=` +`+pve.indentComment(u(t),c),a&&a()):d&&o&&o(),h}function ZUi({items:t},e,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;r+=s;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),u=!1,l=0,d=[];for(let f=0;fA=null);u||(u=d.length>l||y.includes(` +`)),f0&&(u||(u=d.reduce((E,_)=>E+_.length+2,2)+(y.length+2)>e.options.lineWidth)),u&&(y+=",")),A&&(y+=pve.lineComment(y,r,a(A))),d.push(y),l=d.length}let{start:m,end:h}=n;if(d.length===0)return m+h;if(!u){let f=d.reduce((g,A)=>g+A.length+2,2);u=e.options.lineWidth>0&&f>e.options.lineWidth}if(u){let f=m;for(let g of d)f+=g?` +${s}${i}${g}`:` `;return`${f} -${s}${m}`}else return`${h}${o}${d.join(" ")}${o}${m}`}function W_e({indent:t,options:{commentString:e}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){let i=G_e.indentComment(e(r),t);n.push(i.trimStart())}}Nmn.stringifyCollection=mcs});var qN=ee(l7e=>{"use strict";p();var Acs=a7e(),ycs=i7e(),Ecs=R_e(),WN=vo(),q_e=GN(),bcs=qu();function zX(t,e){let n=WN.isScalar(e)?e.value:e;for(let r of t)if(WN.isPair(r)&&(r.key===e||r.key===n||WN.isScalar(r.key)&&r.key.value===n))return r}var c7e=class extends Ecs.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(WN.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:s,replacer:i}=r,o=new this(e),a=(c,u)=>{if(typeof i=="function")u=i.call(n,c,u);else if(Array.isArray(i)&&!i.includes(c))return;(u!==void 0||s)&&o.items.push(q_e.createPair(c,u,r))};if(n instanceof Map)for(let[c,u]of n)a(c,u);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;WN.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new q_e.Pair(e,e?.value):r=new q_e.Pair(e.key,e.value);let s=zX(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);WN.isScalar(s.value)&&bcs.isScalarValue(r.value)?s.value.value=r.value:s.value=r.value}else if(i){let o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let n=zX(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let s=zX(this.items,e)?.value;return(!n&&WN.isScalar(s)?s.value:s)??void 0}has(e){return!!zX(this.items,e)}set(e,n){this.add(new q_e.Pair(e,n),!0)}toJSON(e,n,r){let s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(let i of this.items)ycs.addPairToJSMap(n,s,i);return s}toString(e,n,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!WN.isPair(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Acs.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};l7e.YAMLMap=c7e;l7e.findPair=zX});var UH=ee(Bmn=>{"use strict";p();var _cs=vo(),Dmn=qN(),Scs={collection:"map",default:!0,nodeClass:Dmn.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return _cs.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Dmn.YAMLMap.from(t,e,n)};Bmn.map=Scs});var HN=ee(Pmn=>{"use strict";p();var Ccs=WX(),Ics=a7e(),xcs=R_e(),V_e=vo(),wcs=qu(),Tcs=FN(),u7e=class extends xcs.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(V_e.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=H_e(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=H_e(e);if(typeof r!="number")return;let s=this.items[r];return!n&&V_e.isScalar(s)?s.value:s}has(e){let n=H_e(e);return typeof n=="number"&&n=0?e:null}Pmn.YAMLSeq=u7e});var $H=ee(Mmn=>{"use strict";p();var vcs=vo(),Omn=HN(),Rcs={collection:"seq",default:!0,nodeClass:Omn.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return vcs.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Omn.YAMLSeq.from(t,e,n)};Mmn.seq=Rcs});var JX=ee(Lmn=>{"use strict";p();var kcs=jX(),Ncs={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),kcs.stringifyString(t,e,n,r)}};Lmn.string=Ncs});var j_e=ee(Umn=>{"use strict";p();var Fmn=qu(),Qmn={identify:t=>t==null,createNode:()=>new Fmn.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Fmn.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Qmn.test.test(t)?t:e.options.nullStr};Umn.nullTag=Qmn});var d7e=ee(Gmn=>{"use strict";p();var Dcs=qu(),$mn={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Dcs.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&$mn.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};Gmn.boolTag=$mn});var GH=ee(Wmn=>{"use strict";p();function Bcs({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}Wmn.stringifyNumber=Bcs});var h7e=ee(Y_e=>{"use strict";p();var Pcs=qu(),p7e=GH(),Ocs={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:p7e.stringifyNumber},Mcs={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():p7e.stringifyNumber(t)}},Lcs={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Pcs.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:p7e.stringifyNumber};Y_e.float=Lcs;Y_e.floatExp=Mcs;Y_e.floatNaN=Ocs});var f7e=ee(z_e=>{"use strict";p();var qmn=GH(),K_e=t=>typeof t=="bigint"||Number.isInteger(t),m7e=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function Hmn(t,e,n){let{value:r}=t;return K_e(r)&&r>=0?n+r.toString(e):qmn.stringifyNumber(t)}var Fcs={identify:t=>K_e(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>m7e(t,2,8,n),stringify:t=>Hmn(t,8,"0o")},Qcs={identify:K_e,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>m7e(t,0,10,n),stringify:qmn.stringifyNumber},Ucs={identify:t=>K_e(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>m7e(t,2,16,n),stringify:t=>Hmn(t,16,"0x")};z_e.int=Qcs;z_e.intHex=Ucs;z_e.intOct=Fcs});var jmn=ee(Vmn=>{"use strict";p();var $cs=UH(),Gcs=j_e(),Wcs=$H(),qcs=JX(),Hcs=d7e(),g7e=h7e(),A7e=f7e(),Vcs=[$cs.map,Wcs.seq,qcs.string,Gcs.nullTag,Hcs.boolTag,A7e.intOct,A7e.int,A7e.intHex,g7e.floatNaN,g7e.floatExp,g7e.float];Vmn.schema=Vcs});var zmn=ee(Kmn=>{"use strict";p();var jcs=qu(),Ycs=UH(),Kcs=$H();function Ymn(t){return typeof t=="bigint"||Number.isInteger(t)}var J_e=({value:t})=>JSON.stringify(t),zcs=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:J_e},{identify:t=>t==null,createNode:()=>new jcs.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:J_e},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:J_e},{identify:Ymn,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Ymn(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:J_e}],Jcs={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Xcs=[Ycs.map,Kcs.seq].concat(zcs,Jcs);Kmn.schema=Xcs});var E7e=ee(Jmn=>{"use strict";p();var XX=require("buffer"),y7e=qu(),Zcs=jX(),els={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof XX.Buffer=="function")return XX.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s{"use strict";p();var X_e=vo(),b7e=GN(),tls=qu(),nls=HN();function Xmn(t,e){if(X_e.isSeq(t))for(let n=0;n1&&e("Each pair must have its own sequence indicator");let s=r.items[0]||new b7e.Pair(new tls.Scalar(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore} -${s.key.commentBefore}`:r.commentBefore),r.comment){let i=s.value??s.key;i.comment=i.comment?`${r.comment} -${i.comment}`:r.comment}r=s}t.items[n]=X_e.isPair(r)?r:new b7e.Pair(r)}}else e("Expected a sequence for this tag");return t}function Zmn(t,e,n){let{replacer:r}=n,s=new nls.YAMLSeq(t);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let u=Object.keys(o);if(u.length===1)a=u[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=o;s.items.push(b7e.createPair(a,c,n))}return s}var rls={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Xmn,createNode:Zmn};Z_e.createPairs=Zmn;Z_e.pairs=rls;Z_e.resolvePairs=Xmn});var C7e=ee(S7e=>{"use strict";p();var efn=vo(),_7e=FN(),ZX=qN(),sls=HN(),tfn=e0e(),jM=class t extends sls.YAMLSeq{constructor(){super(),this.add=ZX.YAMLMap.prototype.add.bind(this),this.delete=ZX.YAMLMap.prototype.delete.bind(this),this.get=ZX.YAMLMap.prototype.get.bind(this),this.has=ZX.YAMLMap.prototype.has.bind(this),this.set=ZX.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let s of this.items){let i,o;if(efn.isPair(s)?(i=_7e.toJS(s.key,"",n),o=_7e.toJS(s.value,i,n)):i=_7e.toJS(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,n,r){let s=tfn.createPairs(e,n,r),i=new this;return i.items=s.items,i}};jM.tag="tag:yaml.org,2002:omap";var ils={collection:"seq",identify:t=>t instanceof Map,nodeClass:jM,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=tfn.resolvePairs(t,e),r=[];for(let{key:s}of n.items)efn.isScalar(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new jM,n)},createNode:(t,e,n)=>jM.from(t,e,n)};S7e.YAMLOMap=jM;S7e.omap=ils});var ofn=ee(I7e=>{"use strict";p();var nfn=qu();function rfn({value:t,source:e},n){return e&&(t?sfn:ifn).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var sfn={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new nfn.Scalar(!0),stringify:rfn},ifn={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new nfn.Scalar(!1),stringify:rfn};I7e.falseTag=ifn;I7e.trueTag=sfn});var afn=ee(t0e=>{"use strict";p();var ols=qu(),x7e=GH(),als={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:x7e.stringifyNumber},cls={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():x7e.stringifyNumber(t)}},lls={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new ols.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:x7e.stringifyNumber};t0e.float=lls;t0e.floatExp=cls;t0e.floatNaN=als});var lfn=ee(tZ=>{"use strict";p();var cfn=GH(),eZ=t=>typeof t=="bigint"||Number.isInteger(t);function n0e(t,e,n,{intAsBigInt:r}){let s=t[0];if((s==="-"||s==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return s==="-"?BigInt(-1)*o:o}let i=parseInt(t,n);return s==="-"?-1*i:i}function w7e(t,e,n){let{value:r}=t;if(eZ(r)){let s=r.toString(e);return r<0?"-"+n+s.substr(1):n+s}return cfn.stringifyNumber(t)}var uls={identify:eZ,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>n0e(t,2,2,n),stringify:t=>w7e(t,2,"0b")},dls={identify:eZ,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>n0e(t,1,8,n),stringify:t=>w7e(t,8,"0")},pls={identify:eZ,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>n0e(t,0,10,n),stringify:cfn.stringifyNumber},hls={identify:eZ,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>n0e(t,2,16,n),stringify:t=>w7e(t,16,"0x")};tZ.int=pls;tZ.intBin=uls;tZ.intHex=hls;tZ.intOct=dls});var v7e=ee(T7e=>{"use strict";p();var i0e=vo(),r0e=GN(),s0e=qN(),YM=class t extends s0e.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;i0e.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new r0e.Pair(e.key,null):n=new r0e.Pair(e,null),s0e.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=s0e.findPair(this.items,e);return!n&&i0e.isPair(r)?i0e.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=s0e.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new r0e.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(r0e.createPair(o,null,r));return i}};YM.tag="tag:yaml.org,2002:set";var mls={collection:"map",identify:t=>t instanceof Set,nodeClass:YM,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>YM.from(t,e,n),resolve(t,e){if(i0e.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new YM,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};T7e.YAMLSet=YM;T7e.set=mls});var k7e=ee(o0e=>{"use strict";p();var fls=GH();function R7e(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*i:i}function ufn(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return fls.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let s=n(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var gls={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>R7e(t,n),stringify:ufn},Als={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>R7e(t,!1),stringify:ufn},dfn={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(dfn.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,u=Date.UTC(n,r-1,s,i||0,o||0,a||0,c),l=e[8];if(l&&l!=="Z"){let d=R7e(l,!1);Math.abs(d)<30&&(d*=60),u-=6e4*d}return new Date(u)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};o0e.floatTime=Als;o0e.intTime=gls;o0e.timestamp=dfn});var mfn=ee(hfn=>{"use strict";p();var yls=UH(),Els=j_e(),bls=$H(),_ls=JX(),Sls=E7e(),pfn=ofn(),N7e=afn(),a0e=lfn(),Cls=Q_e(),Ils=C7e(),xls=e0e(),wls=v7e(),D7e=k7e(),Tls=[yls.map,bls.seq,_ls.string,Els.nullTag,pfn.trueTag,pfn.falseTag,a0e.intBin,a0e.intOct,a0e.int,a0e.intHex,N7e.floatNaN,N7e.floatExp,N7e.float,Sls.binary,Cls.merge,Ils.omap,xls.pairs,wls.set,D7e.intTime,D7e.floatTime,D7e.timestamp];hfn.schema=Tls});var Ifn=ee(O7e=>{"use strict";p();var yfn=UH(),vls=j_e(),Efn=$H(),Rls=JX(),kls=d7e(),B7e=h7e(),P7e=f7e(),Nls=jmn(),Dls=zmn(),bfn=E7e(),nZ=Q_e(),_fn=C7e(),Sfn=e0e(),ffn=mfn(),Cfn=v7e(),c0e=k7e(),gfn=new Map([["core",Nls.schema],["failsafe",[yfn.map,Efn.seq,Rls.string]],["json",Dls.schema],["yaml11",ffn.schema],["yaml-1.1",ffn.schema]]),Afn={binary:bfn.binary,bool:kls.boolTag,float:B7e.float,floatExp:B7e.floatExp,floatNaN:B7e.floatNaN,floatTime:c0e.floatTime,int:P7e.int,intHex:P7e.intHex,intOct:P7e.intOct,intTime:c0e.intTime,map:yfn.map,merge:nZ.merge,null:vls.nullTag,omap:_fn.omap,pairs:Sfn.pairs,seq:Efn.seq,set:Cfn.set,timestamp:c0e.timestamp},Bls={"tag:yaml.org,2002:binary":bfn.binary,"tag:yaml.org,2002:merge":nZ.merge,"tag:yaml.org,2002:omap":_fn.omap,"tag:yaml.org,2002:pairs":Sfn.pairs,"tag:yaml.org,2002:set":Cfn.set,"tag:yaml.org,2002:timestamp":c0e.timestamp};function Pls(t,e,n){let r=gfn.get(e);if(r&&!t)return n&&!r.includes(nZ.merge)?r.concat(nZ.merge):r.slice();let s=r;if(!s)if(Array.isArray(t))s=[];else{let i=Array.from(gfn.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(let i of t)s=s.concat(i);else typeof t=="function"&&(s=t(s.slice()));return n&&(s=s.concat(nZ.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?Afn[o]:o;if(!a){let c=JSON.stringify(o),u=Object.keys(Afn).map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(a)||i.push(a),i},[])}O7e.coreKnownTags=Bls;O7e.getTags=Pls});var F7e=ee(xfn=>{"use strict";p();var M7e=vo(),Ols=UH(),Mls=$H(),Lls=JX(),l0e=Ifn(),Fls=(t,e)=>t.keye.key?1:0,L7e=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?l0e.getTags(e,"compat"):e?l0e.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?l0e.coreKnownTags:{},this.tags=l0e.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,M7e.MAP,{value:Ols.map}),Object.defineProperty(this,M7e.SCALAR,{value:Lls.string}),Object.defineProperty(this,M7e.SEQ,{value:Mls.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Fls:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};xfn.Schema=L7e});var Tfn=ee(wfn=>{"use strict";p();var Qls=vo(),Q7e=YX(),rZ=qX();function Uls(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let s=Q7e.createStringifyContext(t,e),{commentString:i}=s.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=i(t.commentBefore);n.unshift(rZ.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(Qls.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let l=i(t.contents.commentBefore);n.push(rZ.indentComment(l,""))}s.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,u=Q7e.stringify(t.contents,s,()=>a=null,c);a&&(u+=rZ.lineComment(u,"",i(a))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}else n.push(Q7e.stringify(t.contents,s));if(t.directives?.docEnd)if(t.comment){let c=i(t.comment);c.includes(` -`)?(n.push("..."),n.push(rZ.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(rZ.indentComment(i(c),"")))}return n.join(` +${i}${h}`}else return`${m}${o}${d.join(" ")}${o}${h}`}function mve({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=pve.indentComment(e(r),t);n.push(s.trimStart())}}qQn.stringifyCollection=JUi});var LD=re(Dct=>{"use strict";p();var eGi=Bct(),tGi=Rct(),nGi=ZTe(),OD=Yo(),hve=MD(),rGi=Md();function lie(t,e){let n=OD.isScalar(e)?e.value:e;for(let r of t)if(OD.isPair(r)&&(r.key===e||r.key===n||OD.isScalar(r.key)&&r.key.value===n))return r}var Nct=class extends nGi.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(OD.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:i,replacer:s}=r,o=new this(e),a=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||i)&&o.items.push(hve.createPair(c,u,r))};if(n instanceof Map)for(let[c,u]of n)a(c,u);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;OD.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new hve.Pair(e,e?.value):r=new hve.Pair(e.key,e.value);let i=lie(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);OD.isScalar(i.value)&&rGi.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(s){let o=this.items.findIndex(a=>s(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let n=lie(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let i=lie(this.items,e)?.value;return(!n&&OD.isScalar(i)?i.value:i)??void 0}has(e){return!!lie(this.items,e)}set(e,n){this.add(new hve.Pair(e,n),!0)}toJSON(e,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let s of this.items)tGi.addPairToJSMap(n,i,s);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!OD.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),eGi.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};Dct.YAMLMap=Nct;Dct.findPair=lie});var Rj=re(VQn=>{"use strict";p();var iGi=Yo(),jQn=LD(),sGi={collection:"map",default:!0,nodeClass:jQn.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return iGi.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>jQn.YAMLMap.from(t,e,n)};VQn.map=sGi});var FD=re(YQn=>{"use strict";p();var oGi=nie(),aGi=Bct(),cGi=ZTe(),gve=Yo(),lGi=Md(),uGi=BD(),Pct=class extends cGi.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(gve.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=fve(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=fve(e);if(typeof r!="number")return;let i=this.items[r];return!n&&gve.isScalar(i)?i.value:i}has(e){let n=fve(e);return typeof n=="number"&&n=0?e:null}YQn.YAMLSeq=Pct});var kj=re(KQn=>{"use strict";p();var dGi=Yo(),zQn=FD(),pGi={collection:"seq",default:!0,nodeClass:zQn.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return dGi.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>zQn.YAMLSeq.from(t,e,n)};KQn.seq=pGi});var uie=re(JQn=>{"use strict";p();var mGi=oie(),hGi={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),mGi.stringifyString(t,e,n,r)}};JQn.string=hGi});var Ave=re(eUn=>{"use strict";p();var XQn=Md(),ZQn={identify:t=>t==null,createNode:()=>new XQn.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new XQn.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&ZQn.test.test(t)?t:e.options.nullStr};eUn.nullTag=ZQn});var Mct=re(nUn=>{"use strict";p();var fGi=Md(),tUn={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new fGi.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&tUn.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};nUn.boolTag=tUn});var Bj=re(rUn=>{"use strict";p();function gGi({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}rUn.stringifyNumber=gGi});var Lct=re(yve=>{"use strict";p();var AGi=Md(),Oct=Bj(),yGi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Oct.stringifyNumber},EGi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Oct.stringifyNumber(t)}},bGi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new AGi.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Oct.stringifyNumber};yve.float=bGi;yve.floatExp=EGi;yve.floatNaN=yGi});var Qct=re(bve=>{"use strict";p();var iUn=Bj(),Eve=t=>typeof t=="bigint"||Number.isInteger(t),Fct=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function sUn(t,e,n){let{value:r}=t;return Eve(r)&&r>=0?n+r.toString(e):iUn.stringifyNumber(t)}var _Gi={identify:t=>Eve(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Fct(t,2,8,n),stringify:t=>sUn(t,8,"0o")},xGi={identify:Eve,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Fct(t,0,10,n),stringify:iUn.stringifyNumber},SGi={identify:t=>Eve(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Fct(t,2,16,n),stringify:t=>sUn(t,16,"0x")};bve.int=xGi;bve.intHex=SGi;bve.intOct=_Gi});var aUn=re(oUn=>{"use strict";p();var CGi=Rj(),IGi=Ave(),wGi=kj(),TGi=uie(),vGi=Mct(),Uct=Lct(),Gct=Qct(),RGi=[CGi.map,wGi.seq,TGi.string,IGi.nullTag,vGi.boolTag,Gct.intOct,Gct.int,Gct.intHex,Uct.floatNaN,Uct.floatExp,Uct.float];oUn.schema=RGi});var uUn=re(lUn=>{"use strict";p();var kGi=Md(),BGi=Rj(),NGi=kj();function cUn(t){return typeof t=="bigint"||Number.isInteger(t)}var _ve=({value:t})=>JSON.stringify(t),DGi=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:_ve},{identify:t=>t==null,createNode:()=>new kGi.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:_ve},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:_ve},{identify:cUn,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>cUn(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:_ve}],PGi={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},MGi=[BGi.map,NGi.seq].concat(DGi,PGi);lUn.schema=MGi});var Wct=re(dUn=>{"use strict";p();var die=require("buffer"),$ct=Md(),OGi=oie(),LGi={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof die.Buffer=="function")return die.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i{"use strict";p();var xve=Yo(),Hct=MD(),FGi=Md(),QGi=FD();function pUn(t,e){if(xve.isSeq(t))for(let n=0;n1&&e("Each pair must have its own sequence indicator");let i=r.items[0]||new Hct.Pair(new FGi.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore} +${i.key.commentBefore}`:r.commentBefore),r.comment){let s=i.value??i.key;s.comment=s.comment?`${r.comment} +${s.comment}`:r.comment}r=i}t.items[n]=xve.isPair(r)?r:new Hct.Pair(r)}}else e("Expected a sequence for this tag");return t}function mUn(t,e,n){let{replacer:r}=n,i=new QGi.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(s++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let u=Object.keys(o);if(u.length===1)a=u[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=o;i.items.push(Hct.createPair(a,c,n))}return i}var UGi={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:pUn,createNode:mUn};Sve.createPairs=mUn;Sve.pairs=UGi;Sve.resolvePairs=pUn});var Vct=re(jct=>{"use strict";p();var hUn=Yo(),qct=BD(),pie=LD(),GGi=FD(),fUn=Cve(),uQ=class t extends GGi.YAMLSeq{constructor(){super(),this.add=pie.YAMLMap.prototype.add.bind(this),this.delete=pie.YAMLMap.prototype.delete.bind(this),this.get=pie.YAMLMap.prototype.get.bind(this),this.has=pie.YAMLMap.prototype.has.bind(this),this.set=pie.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,o;if(hUn.isPair(i)?(s=qct.toJS(i.key,"",n),o=qct.toJS(i.value,s,n)):s=qct.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,n,r){let i=fUn.createPairs(e,n,r),s=new this;return s.items=i.items,s}};uQ.tag="tag:yaml.org,2002:omap";var $Gi={collection:"seq",identify:t=>t instanceof Map,nodeClass:uQ,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=fUn.resolvePairs(t,e),r=[];for(let{key:i}of n.items)hUn.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new uQ,n)},createNode:(t,e,n)=>uQ.from(t,e,n)};jct.YAMLOMap=uQ;jct.omap=$Gi});var bUn=re(Yct=>{"use strict";p();var gUn=Md();function AUn({value:t,source:e},n){return e&&(t?yUn:EUn).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var yUn={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new gUn.Scalar(!0),stringify:AUn},EUn={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new gUn.Scalar(!1),stringify:AUn};Yct.falseTag=EUn;Yct.trueTag=yUn});var _Un=re(Ive=>{"use strict";p();var WGi=Md(),zct=Bj(),HGi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:zct.stringifyNumber},qGi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():zct.stringifyNumber(t)}},jGi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new WGi.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:zct.stringifyNumber};Ive.float=jGi;Ive.floatExp=qGi;Ive.floatNaN=HGi});var SUn=re(hie=>{"use strict";p();var xUn=Bj(),mie=t=>typeof t=="bigint"||Number.isInteger(t);function wve(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,n);return i==="-"?-1*s:s}function Kct(t,e,n){let{value:r}=t;if(mie(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return xUn.stringifyNumber(t)}var VGi={identify:mie,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>wve(t,2,2,n),stringify:t=>Kct(t,2,"0b")},YGi={identify:mie,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>wve(t,1,8,n),stringify:t=>Kct(t,8,"0")},zGi={identify:mie,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>wve(t,0,10,n),stringify:xUn.stringifyNumber},KGi={identify:mie,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>wve(t,2,16,n),stringify:t=>Kct(t,16,"0x")};hie.int=zGi;hie.intBin=VGi;hie.intHex=KGi;hie.intOct=YGi});var Xct=re(Jct=>{"use strict";p();var Rve=Yo(),Tve=MD(),vve=LD(),dQ=class t extends vve.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;Rve.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Tve.Pair(e.key,null):n=new Tve.Pair(e,null),vve.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=vve.findPair(this.items,e);return!n&&Rve.isPair(r)?Rve.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=vve.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Tve.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),s.items.push(Tve.createPair(o,null,r));return s}};dQ.tag="tag:yaml.org,2002:set";var JGi={collection:"map",identify:t=>t instanceof Set,nodeClass:dQ,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>dQ.from(t,e,n),resolve(t,e){if(Rve.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new dQ,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Jct.YAMLSet=dQ;Jct.set=JGi});var elt=re(kve=>{"use strict";p();var XGi=Bj();function Zct(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*s:s}function CUn(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return XGi.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let i=n(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var ZGi={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Zct(t,n),stringify:CUn},e$i={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Zct(t,!1),stringify:CUn},IUn={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(IUn.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,u=Date.UTC(n,r-1,i,s||0,o||0,a||0,c),l=e[8];if(l&&l!=="Z"){let d=Zct(l,!1);Math.abs(d)<30&&(d*=60),u-=6e4*d}return new Date(u)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};kve.floatTime=e$i;kve.intTime=ZGi;kve.timestamp=IUn});var vUn=re(TUn=>{"use strict";p();var t$i=Rj(),n$i=Ave(),r$i=kj(),i$i=uie(),s$i=Wct(),wUn=bUn(),tlt=_Un(),Bve=SUn(),o$i=lve(),a$i=Vct(),c$i=Cve(),l$i=Xct(),nlt=elt(),u$i=[t$i.map,r$i.seq,i$i.string,n$i.nullTag,wUn.trueTag,wUn.falseTag,Bve.intBin,Bve.intOct,Bve.int,Bve.intHex,tlt.floatNaN,tlt.floatExp,tlt.float,s$i.binary,o$i.merge,a$i.omap,c$i.pairs,l$i.set,nlt.intTime,nlt.floatTime,nlt.timestamp];TUn.schema=u$i});var FUn=re(slt=>{"use strict";p();var NUn=Rj(),d$i=Ave(),DUn=kj(),p$i=uie(),m$i=Mct(),rlt=Lct(),ilt=Qct(),h$i=aUn(),f$i=uUn(),PUn=Wct(),fie=lve(),MUn=Vct(),OUn=Cve(),RUn=vUn(),LUn=Xct(),Nve=elt(),kUn=new Map([["core",h$i.schema],["failsafe",[NUn.map,DUn.seq,p$i.string]],["json",f$i.schema],["yaml11",RUn.schema],["yaml-1.1",RUn.schema]]),BUn={binary:PUn.binary,bool:m$i.boolTag,float:rlt.float,floatExp:rlt.floatExp,floatNaN:rlt.floatNaN,floatTime:Nve.floatTime,int:ilt.int,intHex:ilt.intHex,intOct:ilt.intOct,intTime:Nve.intTime,map:NUn.map,merge:fie.merge,null:d$i.nullTag,omap:MUn.omap,pairs:OUn.pairs,seq:DUn.seq,set:LUn.set,timestamp:Nve.timestamp},g$i={"tag:yaml.org,2002:binary":PUn.binary,"tag:yaml.org,2002:merge":fie.merge,"tag:yaml.org,2002:omap":MUn.omap,"tag:yaml.org,2002:pairs":OUn.pairs,"tag:yaml.org,2002:set":LUn.set,"tag:yaml.org,2002:timestamp":Nve.timestamp};function A$i(t,e,n){let r=kUn.get(e);if(r&&!t)return n&&!r.includes(fie.merge)?r.concat(fie.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(kUn.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(fie.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?BUn[o]:o;if(!a){let c=JSON.stringify(o),u=Object.keys(BUn).map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return s.includes(a)||s.push(a),s},[])}slt.coreKnownTags=g$i;slt.getTags=A$i});var clt=re(QUn=>{"use strict";p();var olt=Yo(),y$i=Rj(),E$i=kj(),b$i=uie(),Dve=FUn(),_$i=(t,e)=>t.keye.key?1:0,alt=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Dve.getTags(e,"compat"):e?Dve.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Dve.coreKnownTags:{},this.tags=Dve.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,olt.MAP,{value:y$i.map}),Object.defineProperty(this,olt.SCALAR,{value:b$i.string}),Object.defineProperty(this,olt.SEQ,{value:E$i.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?_$i:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};QUn.Schema=alt});var GUn=re(UUn=>{"use strict";p();var x$i=Yo(),llt=aie(),gie=rie();function S$i(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=llt.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=s(t.commentBefore);n.unshift(gie.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(x$i.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let l=s(t.contents.commentBefore);n.push(gie.indentComment(l,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,u=llt.stringify(t.contents,i,()=>a=null,c);a&&(u+=gie.lineComment(u,"",s(a))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}else n.push(llt.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(` +`)?(n.push("..."),n.push(gie.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(gie.indentComment(s(c),"")))}return n.join(` `)+` -`}wfn.stringifyDocument=Uls});var sZ=ee(vfn=>{"use strict";p();var $ls=GX(),WH=R_e(),jE=vo(),Gls=GN(),Wls=FN(),qls=F7e(),Hls=Tfn(),U7e=x_e(),Vls=qze(),jls=WX(),$7e=Wze(),G7e=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,jE.NODE_TYPE,{value:jE.DOC});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new $7e.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){let e=Object.create(t.prototype,{[jE.NODE_TYPE]:{value:jE.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=jE.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){qH(this.contents)&&this.contents.add(e)}addIn(e,n){qH(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=U7e.anchorNames(this);e.anchor=!n||r.has(n)?U7e.findNewAnchor(n||"a",r):n}return new $ls.Alias(e.anchor)}createNode(e,n,r){let s;if(typeof n=="function")e=n.call({"":e},"",e),s=n;else if(Array.isArray(n)){let A=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(A).map(String);y.length>0&&(n=n.concat(y)),s=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:u,tag:l}=r??{},{onAnchor:d,setAnchors:h,sourceObjects:m}=U7e.createNodeAnchors(this,o||"a"),f={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:m},g=jls.createNode(e,l,f);return a&&jE.isCollection(g)&&(g.flow=!0),h(),g}createPair(e,n,r={}){let s=this.createNode(e,null,r),i=this.createNode(n,null,r);return new Gls.Pair(s,i)}delete(e){return qH(this.contents)?this.contents.delete(e):!1}deleteIn(e){return WH.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):qH(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return jE.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return WH.isEmptyPath(e)?!n&&jE.isScalar(this.contents)?this.contents.value:this.contents:jE.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return jE.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return WH.isEmptyPath(e)?this.contents!==void 0:jE.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=WH.collectionFromPath(this.schema,[e],n):qH(this.contents)&&this.contents.set(e,n)}setIn(e,n){WH.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=WH.collectionFromPath(this.schema,Array.from(e),n):qH(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new $7e.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new $7e.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new qls.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=Wls.toJS(this.contents,n??"",a);if(typeof i=="function")for(let{count:u,res:l}of a.anchors.values())i(l,u);return typeof o=="function"?Vls.applyReviver(o,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Hls.stringifyDocument(this,e)}};function qH(t){if(jE.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}vfn.Document=G7e});var aZ=ee(oZ=>{"use strict";p();var iZ=class extends Error{constructor(e,n,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=n}},W7e=class extends iZ{constructor(e,n,r){super("YAMLParseError",e,n,r)}},q7e=class extends iZ{constructor(e,n,r){super("YAMLWarning",e,n,r)}},Yls=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,i))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 -`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c?.line===r&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));let u=" ".repeat(i)+"^".repeat(a);n.message+=`: +`}UUn.stringifyDocument=S$i});var Aie=re($Un=>{"use strict";p();var C$i=tie(),Nj=ZTe(),Ib=Yo(),I$i=MD(),w$i=BD(),T$i=clt(),v$i=GUn(),ult=zTe(),R$i=hct(),k$i=nie(),dlt=mct(),plt=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ib.NODE_TYPE,{value:Ib.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:o}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new dlt.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let e=Object.create(t.prototype,{[Ib.NODE_TYPE]:{value:Ib.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Ib.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Dj(this.contents)&&this.contents.add(e)}addIn(e,n){Dj(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=ult.anchorNames(this);e.anchor=!n||r.has(n)?ult.findNewAnchor(n||"a",r):n}return new C$i.Alias(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){let A=E=>typeof E=="number"||E instanceof String||E instanceof Number,y=n.filter(A).map(String);y.length>0&&(n=n.concat(y)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:u,tag:l}=r??{},{onAnchor:d,setAnchors:m,sourceObjects:h}=ult.createNodeAnchors(this,o||"a"),f={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:h},g=k$i.createNode(e,l,f);return a&&Ib.isCollection(g)&&(g.flow=!0),m(),g}createPair(e,n,r={}){let i=this.createNode(e,null,r),s=this.createNode(n,null,r);return new I$i.Pair(i,s)}delete(e){return Dj(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Nj.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Dj(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Ib.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Nj.isEmptyPath(e)?!n&&Ib.isScalar(this.contents)?this.contents.value:this.contents:Ib.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Ib.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Nj.isEmptyPath(e)?this.contents!==void 0:Ib.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Nj.collectionFromPath(this.schema,[e],n):Dj(this.contents)&&this.contents.set(e,n)}setIn(e,n){Nj.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=Nj.collectionFromPath(this.schema,Array.from(e),n):Dj(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new dlt.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new dlt.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new T$i.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=w$i.toJS(this.contents,n??"",a);if(typeof s=="function")for(let{count:u,res:l}of a.anchors.values())s(l,u);return typeof o=="function"?R$i.applyReviver(o,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return v$i.stringifyDocument(this,e)}};function Dj(t){if(Ib.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}$Un.Document=plt});var bie=re(Eie=>{"use strict";p();var yie=class extends Error{constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}},mlt=class extends yie{constructor(e,n,r){super("YAMLParseError",e,n,r)}},hlt=class extends yie{constructor(e,n,r){super("YAMLWarning",e,n,r)}},B$i=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="\u2026"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c?.line===r&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-s)));let u=" ".repeat(s)+"^".repeat(a);n.message+=`: ${o} ${u} -`}};oZ.YAMLError=iZ;oZ.YAMLParseError=W7e;oZ.YAMLWarning=q7e;oZ.prettifyError=Yls});var cZ=ee(Rfn=>{"use strict";p();function Kls(t,{flow:e,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,u=a,l=a,d="",h="",m=!1,f=!1,g=null,A=null,y=null,b=null,S=null,C=null,I=null;for(let R of t)switch(f&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&i(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),g&&(u&&R.type!=="comment"&&R.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),R.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&R.source.includes(" ")&&(g=R),l=!0;break;case"comment":{l||i(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=R.source.substring(1)||" ";d?d+=h+N:d=N,h="",u=!1;break}case"newline":u?d?d+=R.source:(!C||n!=="seq-item-ind")&&(c=!0):h+=R.source,u=!0,m=!0,(A||y)&&(b=R),l=!0;break;case"anchor":A&&i(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&i(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),A=R,I??(I=R.offset),u=!1,l=!1,f=!0;break;case"tag":{y&&i(R,"MULTIPLE_TAGS","A node can have at most one tag"),y=R,I??(I=R.offset),u=!1,l=!1,f=!0;break}case n:(A||y)&&i(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),C&&i(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${e??"collection"}`),C=R,u=n==="seq-item-ind"||n==="explicit-key-ind",l=!1;break;case"comma":if(e){S&&i(R,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=R,u=!1,l=!1;break}default:i(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),u=!1,l=!1}let x=t[t.length-1],w=x?x.offset+x.source.length:s;return f&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(u&&g.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:C,spaceBefore:c,comment:d,hasNewline:m,anchor:A,tag:y,newlineAfterProp:b,end:w,start:I??w}}Rfn.resolveProps=Kls});var u0e=ee(kfn=>{"use strict";p();function H7e(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(H7e(e.key)||H7e(e.value))return!0}return!1;default:return!0}}kfn.containsNewline=H7e});var V7e=ee(Nfn=>{"use strict";p();var zls=u0e();function Jls(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&zls.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Nfn.flowIndentCheck=Jls});var j7e=ee(Bfn=>{"use strict";p();var Dfn=vo();function Xls(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let s=typeof r=="function"?r:(i,o)=>i===o||Dfn.isScalar(i)&&Dfn.isScalar(o)&&i.value===o.value;return e.some(i=>s(i.key,n))}Bfn.mapIncludes=Xls});var Qfn=ee(Ffn=>{"use strict";p();var Pfn=GN(),Zls=qN(),Ofn=cZ(),eus=u0e(),Mfn=V7e(),tus=j7e(),Lfn="All mapping items must start at the same column";function nus({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=i?.nodeClass??Zls.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,u=null;for(let l of r.items){let{start:d,key:h,sep:m,value:f}=l,g=Ofn.resolveProps(d,{indicator:"explicit-key-ind",next:h??m?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),A=!g.found;if(A){if(h&&(h.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==r.indent&&s(c,"BAD_INDENT",Lfn)),!g.anchor&&!g.tag&&!m){u=g.end,g.comment&&(a.comment?a.comment+=` -`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||eus.containsNewline(h))&&s(h??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==r.indent&&s(c,"BAD_INDENT",Lfn);n.atKey=!0;let y=g.end,b=h?t(n,h,g,s):e(n,y,d,null,g,s);n.schema.compat&&Mfn.flowIndentCheck(r.indent,h,s),n.atKey=!1,tus.mapIncludes(n,a.items,b)&&s(y,"DUPLICATE_KEY","Map keys must be unique");let S=Ofn.resolveProps(m??[],{indicator:"map-value-ind",next:f,offset:b.range[2],onError:s,parentIndent:r.indent,startOnNewline:!h||h.type==="block-scalar"});if(c=S.end,S.found){A&&(f?.type==="block-map"&&!S.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start{"use strict";p();var rus=HN(),sus=cZ(),ius=V7e();function ous({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=i?.nodeClass??rus.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,u=null;for(let{start:l,value:d}of r.items){let h=sus.resolveProps(l,{indicator:"seq-item-ind",next:d,offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||d)d?.type==="block-seq"?s(h.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{u=h.end,h.comment&&(a.comment=h.comment);continue}let m=d?t(n,d,h,s):e(n,h.end,l,null,h,s);n.schema.compat&&ius.flowIndentCheck(r.indent,d,s),c=m.range[2],a.items.push(m)}return a.range=[r.offset,c,u??c],a}Ufn.resolveBlockSeq=ous});var HH=ee(Gfn=>{"use strict";p();function aus(t,e,n,r){let s="";if(t){let i=!1,o="";for(let a of t){let{source:c,type:u}=a;switch(u){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let l=c.substring(1)||" ";s?s+=o+l:s=l,o="";break}case"newline":s&&(o+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=c.length}}return{comment:s,offset:e}}Gfn.resolveEnd=aus});var Vfn=ee(Hfn=>{"use strict";p();var cus=vo(),lus=GN(),Wfn=qN(),uus=HN(),dus=HH(),qfn=cZ(),pus=u0e(),hus=j7e(),Y7e="Block collections are not allowed within flow collections",K7e=t=>t&&(t.type==="block-map"||t.type==="block-seq");function mus({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?Wfn.YAMLMap:uus.YAMLSeq),u=new c(n.schema);u.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let A=0;A0){let A=dus.resolveEnd(f,g,n.options.strict,s);A.comment&&(u.comment?u.comment+=` -`+A.comment:u.comment=A.comment),u.range=[r.offset,g,A.offset]}else u.range=[r.offset,g,g];return u}Hfn.resolveFlowCollection=mus});var Yfn=ee(jfn=>{"use strict";p();var fus=vo(),gus=qu(),Aus=qN(),yus=HN(),Eus=Qfn(),bus=$fn(),_us=Vfn();function z7e(t,e,n,r,s,i){let o=n.type==="block-map"?Eus.resolveBlockMap(t,e,n,r,i):n.type==="block-seq"?bus.resolveBlockSeq(t,e,n,r,i):_us.resolveFlowCollection(t,e,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function Sus(t,e,n,r,s){let i=r.tag,o=i?e.directives.tagName(i.source,h=>s(i,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){let{anchor:h,newlineAfterProp:m}=r,f=h&&i?h.offset>i.offset?h:i:h??i;f&&(!m||m.offseth.tag===o&&h.collection===a);if(!c){let h=e.schema.knownTags[o];if(h?.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),c=h;else return h?s(i,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),z7e(t,e,n,s,o)}let u=z7e(t,e,n,s,o,c),l=c.resolve?.(u,h=>s(i,"TAG_RESOLVE_FAILED",h),e.options)??u,d=fus.isNode(l)?l:new gus.Scalar(l);return d.range=u.range,d.tag=o,c?.format&&(d.format=c.format),d}jfn.composeCollection=Sus});var X7e=ee(Kfn=>{"use strict";p();var J7e=qu();function Cus(t,e,n){let r=e.offset,s=Ius(e,t.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};let i=s.mode===">"?J7e.Scalar.BLOCK_FOLDED:J7e.Scalar.BLOCK_LITERAL,o=e.source?xus(e.source):[],a=o.length;for(let g=o.length-1;g>=0;--g){let A=o[g][1];if(A===""||A==="\r")a=g;else break}if(a===0){let g=s.chomp==="+"&&o.length>0?` -`.repeat(Math.max(1,o.length-1)):"",A=r+s.length;return e.source&&(A+=e.source.length),{value:g,type:i,comment:s.comment,range:[r,A,A]}}let c=e.indent+s.indent,u=e.offset+s.length,l=0;for(let g=0;gc&&(c=A.length);else{A.length=a;--g)o[g][0].length>c&&(a=g+1);let d="",h="",m=!1;for(let g=0;gc||y[0]===" "?(h===" "?h=` -`:!m&&h===` -`&&(h=` - -`),d+=h+A.slice(c)+y,h=` -`,m=!0):y===""?h===` +`}};Eie.YAMLError=yie;Eie.YAMLParseError=mlt;Eie.YAMLWarning=hlt;Eie.prettifyError=B$i});var _ie=re(WUn=>{"use strict";p();function N$i(t,{flow:e,indicator:n,next:r,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,u=a,l=a,d="",m="",h=!1,f=!1,g=null,A=null,y=null,E=null,_=null,S=null,C=null;for(let k of t)switch(f&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&s(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),g&&(u&&k.type!=="comment"&&k.type!=="newline"&&s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),k.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&k.source.includes(" ")&&(g=k),l=!0;break;case"comment":{l||s(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=k.source.substring(1)||" ";d?d+=m+N:d=N,m="",u=!1;break}case"newline":u?d?d+=k.source:(!S||n!=="seq-item-ind")&&(c=!0):m+=k.source,u=!0,h=!0,(A||y)&&(E=k),l=!0;break;case"anchor":A&&s(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&s(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),A=k,C??(C=k.offset),u=!1,l=!1,f=!0;break;case"tag":{y&&s(k,"MULTIPLE_TAGS","A node can have at most one tag"),y=k,C??(C=k.offset),u=!1,l=!1,f=!0;break}case n:(A||y)&&s(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),S&&s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),S=k,u=n==="seq-item-ind"||n==="explicit-key-ind",l=!1;break;case"comma":if(e){_&&s(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),_=k,u=!1,l=!1;break}default:s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),u=!1,l=!1}let I=t[t.length-1],w=I?I.offset+I.source.length:i;return f&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(u&&g.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:S,spaceBefore:c,comment:d,hasNewline:h,anchor:A,tag:y,newlineAfterProp:E,end:w,start:C??w}}WUn.resolveProps=N$i});var Pve=re(HUn=>{"use strict";p();function flt(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(flt(e.key)||flt(e.value))return!0}return!1;default:return!0}}HUn.containsNewline=flt});var glt=re(qUn=>{"use strict";p();var D$i=Pve();function P$i(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&D$i.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}qUn.flowIndentCheck=P$i});var Alt=re(VUn=>{"use strict";p();var jUn=Yo();function M$i(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,o)=>s===o||jUn.isScalar(s)&&jUn.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,n))}VUn.mapIncludes=M$i});var ZUn=re(XUn=>{"use strict";p();var YUn=MD(),O$i=LD(),zUn=_ie(),L$i=Pve(),KUn=glt(),F$i=Alt(),JUn="All mapping items must start at the same column";function Q$i({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=s?.nodeClass??O$i.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,u=null;for(let l of r.items){let{start:d,key:m,sep:h,value:f}=l,g=zUn.resolveProps(d,{indicator:"explicit-key-ind",next:m??h?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),A=!g.found;if(A){if(m&&(m.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==r.indent&&i(c,"BAD_INDENT",JUn)),!g.anchor&&!g.tag&&!h){u=g.end,g.comment&&(a.comment?a.comment+=` +`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||L$i.containsNewline(m))&&i(m??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==r.indent&&i(c,"BAD_INDENT",JUn);n.atKey=!0;let y=g.end,E=m?t(n,m,g,i):e(n,y,d,null,g,i);n.schema.compat&&KUn.flowIndentCheck(r.indent,m,i),n.atKey=!1,F$i.mapIncludes(n,a.items,E)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let _=zUn.resolveProps(h??[],{indicator:"map-value-ind",next:f,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=_.end,_.found){A&&(f?.type==="block-map"&&!_.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start<_.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=f?t(n,f,_,i):e(n,c,h,null,_,i);n.schema.compat&&KUn.flowIndentCheck(r.indent,f,i),c=S.range[2];let C=new YUn.Pair(E,S);n.options.keepSourceTokens&&(C.srcToken=l),a.items.push(C)}else{A&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(E.comment?E.comment+=` +`+_.comment:E.comment=_.comment);let S=new YUn.Pair(E);n.options.keepSourceTokens&&(S.srcToken=l),a.items.push(S)}}return u&&u{"use strict";p();var U$i=FD(),G$i=_ie(),$$i=glt();function W$i({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=s?.nodeClass??U$i.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,u=null;for(let{start:l,value:d}of r.items){let m=G$i.resolveProps(l,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||d)d?.type==="block-seq"?i(m.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{u=m.end,m.comment&&(a.comment=m.comment);continue}let h=d?t(n,d,m,i):e(n,m.end,l,null,m,i);n.schema.compat&&$$i.flowIndentCheck(r.indent,d,i),c=h.range[2],a.items.push(h)}return a.range=[r.offset,c,u??c],a}eGn.resolveBlockSeq=W$i});var Pj=re(nGn=>{"use strict";p();function H$i(t,e,n,r){let i="";if(t){let s=!1,o="";for(let a of t){let{source:c,type:u}=a;switch(u){case"space":s=!0;break;case"comment":{n&&!s&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let l=c.substring(1)||" ";i?i+=o+l:i=l,o="";break}case"newline":i&&(o+=c),s=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=c.length}}return{comment:i,offset:e}}nGn.resolveEnd=H$i});var oGn=re(sGn=>{"use strict";p();var q$i=Yo(),j$i=MD(),rGn=LD(),V$i=FD(),Y$i=Pj(),iGn=_ie(),z$i=Pve(),K$i=Alt(),ylt="Block collections are not allowed within flow collections",Elt=t=>t&&(t.type==="block-map"||t.type==="block-seq");function J$i({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?rGn.YAMLMap:V$i.YAMLSeq),u=new c(n.schema);u.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let A=0;A0){let A=Y$i.resolveEnd(f,g,n.options.strict,i);A.comment&&(u.comment?u.comment+=` +`+A.comment:u.comment=A.comment),u.range=[r.offset,g,A.offset]}else u.range=[r.offset,g,g];return u}sGn.resolveFlowCollection=J$i});var cGn=re(aGn=>{"use strict";p();var X$i=Yo(),Z$i=Md(),eWi=LD(),tWi=FD(),nWi=ZUn(),rWi=tGn(),iWi=oGn();function blt(t,e,n,r,i,s){let o=n.type==="block-map"?nWi.resolveBlockMap(t,e,n,r,s):n.type==="block-seq"?rWi.resolveBlockSeq(t,e,n,r,s):iWi.resolveFlowCollection(t,e,n,r,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function sWi(t,e,n,r,i){let s=r.tag,o=s?e.directives.tagName(s.source,m=>i(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){let{anchor:m,newlineAfterProp:h}=r,f=m&&s?m.offset>s.offset?m:s:m??s;f&&(!h||h.offsetm.tag===o&&m.collection===a);if(!c){let m=e.schema.knownTags[o];if(m?.collection===a)e.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?i(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${a} collection, but expects ${m.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),blt(t,e,n,i,o)}let u=blt(t,e,n,i,o,c),l=c.resolve?.(u,m=>i(s,"TAG_RESOLVE_FAILED",m),e.options)??u,d=X$i.isNode(l)?l:new Z$i.Scalar(l);return d.range=u.range,d.tag=o,c?.format&&(d.format=c.format),d}aGn.composeCollection=sWi});var xlt=re(lGn=>{"use strict";p();var _lt=Md();function oWi(t,e,n){let r=e.offset,i=aWi(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?_lt.Scalar.BLOCK_FOLDED:_lt.Scalar.BLOCK_LITERAL,o=e.source?cWi(e.source):[],a=o.length;for(let g=o.length-1;g>=0;--g){let A=o[g][1];if(A===""||A==="\r")a=g;else break}if(a===0){let g=i.chomp==="+"&&o.length>0?` +`.repeat(Math.max(1,o.length-1)):"",A=r+i.length;return e.source&&(A+=e.source.length),{value:g,type:s,comment:i.comment,range:[r,A,A]}}let c=e.indent+i.indent,u=e.offset+i.length,l=0;for(let g=0;gc&&(c=A.length);else{A.length=a;--g)o[g][0].length>c&&(a=g+1);let d="",m="",h=!1;for(let g=0;gc||y[0]===" "?(m===" "?m=` +`:!h&&m===` +`&&(m=` + +`),d+=m+A.slice(c)+y,m=` +`,h=!0):y===""?m===` `?d+=` -`:h=` -`:(d+=h+y,h=" ",m=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g{"use strict";p();var Z7e=qu(),wus=HH();function Tus(t,e,n){let{offset:r,type:s,source:i,end:o}=t,a,c,u=(h,m,f)=>n(r+h,m,f);switch(s){case"scalar":a=Z7e.Scalar.PLAIN,c=vus(i,u);break;case"single-quoted-scalar":a=Z7e.Scalar.QUOTE_SINGLE,c=Rus(i,u);break;case"double-quoted-scalar":a=Z7e.Scalar.QUOTE_DOUBLE,c=kus(i,u);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}let l=r+i.length,d=wus.resolveEnd(o,l,e,n);return{value:c,type:a,comment:d.comment,range:[r,l,d.offset]}}function vus(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),zfn(t)}function Rus(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),zfn(t.slice(1,-1)).replace(/''/g,"'")}function zfn(t){let e,n;try{e=new RegExp(`(.*?)(?{"use strict";p();var Slt=Md(),lWi=Pj();function uWi(t,e,n){let{offset:r,type:i,source:s,end:o}=t,a,c,u=(m,h,f)=>n(r+m,h,f);switch(i){case"scalar":a=Slt.Scalar.PLAIN,c=dWi(s,u);break;case"single-quoted-scalar":a=Slt.Scalar.QUOTE_SINGLE,c=pWi(s,u);break;case"double-quoted-scalar":a=Slt.Scalar.QUOTE_DOUBLE,c=mWi(s,u);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let l=r+s.length,d=lWi.resolveEnd(o,l,e,n);return{value:c,type:a,comment:d.comment,range:[r,l,d.offset]}}function dWi(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),uGn(t)}function pWi(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),uGn(t.slice(1,-1)).replace(/''/g,"'")}function uGn(t){let e,n;try{e=new RegExp(`(.*?)(?i?t.slice(i,r+1):s)}else n+=s}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Nus(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===` +`)&&(n+=r>s?t.slice(s,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function hWi(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===` `||r==="\r")&&!(r==="\r"&&t[e+2]!==` `);)r===` `&&(n+=` -`),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Dus={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Bus(t,e,n,r){let s=t.substr(e,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Jfn.resolveFlowScalar=Tus});var egn=ee(Zfn=>{"use strict";p();var KM=vo(),Xfn=qu(),Pus=X7e(),Ous=eJe();function Mus(t,e,n,r){let{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?Pus.resolveBlockScalar(t,e,r):Ous.resolveFlowScalar(e,t.options.strict,r),c=n?t.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,u;t.options.stringKeys&&t.atKey?u=t.schema[KM.SCALAR]:c?u=Lus(t.schema,s,c,n,r):e.type==="scalar"?u=Fus(t,s,e,r):u=t.schema[KM.SCALAR];let l;try{let d=u.resolve(s,h=>r(n??e,"TAG_RESOLVE_FAILED",h),t.options);l=KM.isScalar(d)?d:new Xfn.Scalar(d)}catch(d){let h=d instanceof Error?d.message:String(d);r(n??e,"TAG_RESOLVE_FAILED",h),l=new Xfn.Scalar(s)}return l.range=a,l.source=s,i&&(l.type=i),c&&(l.tag=c),u.format&&(l.format=u.format),o&&(l.comment=o),l}function Lus(t,e,n,r,s){if(n==="!")return t[KM.SCALAR];let i=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[KM.SCALAR])}function Fus({atKey:t,directives:e,schema:n},r,s,i){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[KM.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[KM.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),u=e.tagString(a.tag),l=`Value may be parsed as either ${c} or ${u}`;i(s,"TAG_RESOLVE_FAILED",l,!0)}}return o}Zfn.composeScalar=Mus});var ngn=ee(tgn=>{"use strict";p();function Qus(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":t-=s.source.length;continue}for(s=e[++r];s?.type==="space";)t+=s.source.length,s=e[++r];break}}return t}tgn.emptyScalarPosition=Qus});var ign=ee(nJe=>{"use strict";p();var Uus=GX(),$us=vo(),Gus=Yfn(),rgn=egn(),Wus=HH(),qus=ngn(),Hus={composeNode:sgn,composeEmptyNode:tJe};function sgn(t,e,n,r){let s=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=n,u,l=!0;switch(e.type){case"alias":u=Vus(t,e,r),(a||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=rgn.composeScalar(t,e,c,r),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Gus.composeCollection(Hus,t,e,n,r),a&&(u.anchor=a.source.substring(1))}catch(d){let h=d instanceof Error?d.message:String(d);r(e,"RESOURCE_EXHAUSTION",h)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",d),l=!1}}return u??(u=tJe(t,e.offset,void 0,null,n,r)),a&&u.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&t.options.stringKeys&&(!$us.isScalar(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(u.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?u.comment=o:u.commentBefore=o),t.options.keepSourceTokens&&l&&(u.srcToken=e),u}function tJe(t,e,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},u){let l={type:"scalar",offset:qus.emptyScalarPosition(e,n,r),indent:-1,source:""},d=rgn.composeScalar(t,l,a,u);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=c),d}function Vus({options:t},{offset:e,source:n,end:r},s){let i=new Uus.Alias(n.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=Wus.resolveEnd(r,o,t.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}nJe.composeEmptyNode=tJe;nJe.composeNode=sgn});var cgn=ee(agn=>{"use strict";p();var jus=sZ(),ogn=ign(),Yus=HH(),Kus=cZ();function zus(t,e,{offset:n,start:r,value:s,end:i},o){let a=Object.assign({_directives:e},t),c=new jus.Document(void 0,a),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},l=Kus.resolveProps(r,{indicator:"doc-start",next:s??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!l.hasNewline&&o(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?ogn.composeNode(u,s,l,o):ogn.composeEmptyNode(u,l.end,r,null,l,o);let d=c.contents.range[2],h=Yus.resolveEnd(i,d,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,d,h.offset],c}agn.composeDoc=zus});var sJe=ee(dgn=>{"use strict";p();var Jus=require("process"),Xus=Wze(),Zus=sZ(),lZ=aZ(),lgn=vo(),eds=cgn(),tds=HH();function uZ(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function ugn(t){let e="",n=!1,r=!1;for(let s=0;s{"use strict";p();var pQ=Yo(),pGn=Md(),AWi=xlt(),yWi=Clt();function EWi(t,e,n,r){let{value:i,type:s,comment:o,range:a}=e.type==="block-scalar"?AWi.resolveBlockScalar(t,e,r):yWi.resolveFlowScalar(e,t.options.strict,r),c=n?t.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,u;t.options.stringKeys&&t.atKey?u=t.schema[pQ.SCALAR]:c?u=bWi(t.schema,i,c,n,r):e.type==="scalar"?u=_Wi(t,i,e,r):u=t.schema[pQ.SCALAR];let l;try{let d=u.resolve(i,m=>r(n??e,"TAG_RESOLVE_FAILED",m),t.options);l=pQ.isScalar(d)?d:new pGn.Scalar(d)}catch(d){let m=d instanceof Error?d.message:String(d);r(n??e,"TAG_RESOLVE_FAILED",m),l=new pGn.Scalar(i)}return l.range=a,l.source=i,s&&(l.type=s),c&&(l.tag=c),u.format&&(l.format=u.format),o&&(l.comment=o),l}function bWi(t,e,n,r,i){if(n==="!")return t[pQ.SCALAR];let s=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)s.push(a);else return a;for(let a of s)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[pQ.SCALAR])}function _Wi({atKey:t,directives:e,schema:n},r,i,s){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[pQ.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[pQ.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),u=e.tagString(a.tag),l=`Value may be parsed as either ${c} or ${u}`;s(i,"TAG_RESOLVE_FAILED",l,!0)}}return o}mGn.composeScalar=EWi});var gGn=re(fGn=>{"use strict";p();function xWi(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];i?.type==="space";)t+=i.source.length,i=e[++r];break}}return t}fGn.emptyScalarPosition=xWi});var EGn=re(wlt=>{"use strict";p();var SWi=tie(),CWi=Yo(),IWi=cGn(),AGn=hGn(),wWi=Pj(),TWi=gGn(),vWi={composeNode:yGn,composeEmptyNode:Ilt};function yGn(t,e,n,r){let i=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=n,u,l=!0;switch(e.type){case"alias":u=RWi(t,e,r),(a||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=AGn.composeScalar(t,e,c,r),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=IWi.composeCollection(vWi,t,e,n,r),a&&(u.anchor=a.source.substring(1))}catch(d){let m=d instanceof Error?d.message:String(d);r(e,"RESOURCE_EXHAUSTION",m)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",d),l=!1}}return u??(u=Ilt(t,e.offset,void 0,null,n,r)),a&&u.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!CWi.isScalar(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?u.comment=o:u.commentBefore=o),t.options.keepSourceTokens&&l&&(u.srcToken=e),u}function Ilt(t,e,n,r,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},u){let l={type:"scalar",offset:TWi.emptyScalarPosition(e,n,r),indent:-1,source:""},d=AGn.composeScalar(t,l,a,u);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function RWi({options:t},{offset:e,source:n,end:r},i){let s=new SWi.Alias(n.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=wWi.resolveEnd(r,o,t.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}wlt.composeEmptyNode=Ilt;wlt.composeNode=yGn});var xGn=re(_Gn=>{"use strict";p();var kWi=Aie(),bGn=EGn(),BWi=Pj(),NWi=_ie();function DWi(t,e,{offset:n,start:r,value:i,end:s},o){let a=Object.assign({_directives:e},t),c=new kWi.Document(void 0,a),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},l=NWi.resolveProps(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!l.hasNewline&&o(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?bGn.composeNode(u,i,l,o):bGn.composeEmptyNode(u,l.end,r,null,l,o);let d=c.contents.range[2],m=BWi.resolveEnd(s,d,!1,o);return m.comment&&(c.comment=m.comment),c.range=[n,d,m.offset],c}_Gn.composeDoc=DWi});var vlt=re(IGn=>{"use strict";p();var PWi=require("process"),MWi=mct(),OWi=Aie(),xie=bie(),SGn=Yo(),LWi=xGn(),FWi=Pj();function Sie(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function CGn(t){let e="",n=!1,r=!1;for(let i=0;i{let o=uZ(n);i?this.warnings.push(new lZ.YAMLWarning(o,r,s)):this.errors.push(new lZ.YAMLParseError(o,r,s))},this.directives=new Xus.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:s}=ugn(this.prelude);if(r){let i=e.contents;if(n)e.comment=e.comment?`${e.comment} -${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(lgn.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];lgn.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r} -${a}`:r}else{let o=i.commentBefore;i.commentBefore=o?`${r} -${o}`:r}}if(n){for(let i=0;i{let i=uZ(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=eds.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new lZ.YAMLParseError(uZ(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new lZ.YAMLParseError(uZ(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=tds.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new lZ.YAMLParseError(uZ(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),s=new Zus.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}};dgn.Composer=rJe});var mgn=ee(d0e=>{"use strict";p();var nds=X7e(),rds=eJe(),sds=aZ(),pgn=jX();function ids(t,e=!0,n){if(t){let r=(s,i,o)=>{let a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(n)n(a,i,o);else throw new sds.YAMLParseError([a,a+1],i,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return rds.resolveFlowScalar(t,e,r);case"block-scalar":return nds.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function ods(t,e){let{implicitKey:n=!1,indent:r,inFlow:s=!1,offset:i=-1,type:o="PLAIN"}=e,a=pgn.stringifyString({type:o,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:` +`)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var Tlt=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{let o=Sie(n);s?this.warnings.push(new xie.YAMLWarning(o,r,i)):this.errors.push(new xie.YAMLParseError(o,r,i))},this.directives=new MWi.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:i}=CGn(this.prelude);if(r){let s=e.contents;if(n)e.comment=e.comment?`${e.comment} +${r}`:r;else if(i||e.directives.docStart||!s)e.commentBefore=r;else if(SGn.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];SGn.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r} +${a}`:r}else{let o=s.commentBefore;s.commentBefore=o?`${r} +${o}`:r}}if(n){for(let s=0;s{let s=Sie(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=LWi.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new xie.YAMLParseError(Sie(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new xie.YAMLParseError(Sie(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=FWi.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new xie.YAMLParseError(Sie(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),i=new OWi.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};IGn.Composer=Tlt});var vGn=re(Mve=>{"use strict";p();var QWi=xlt(),UWi=Clt(),GWi=bie(),wGn=oie();function $Wi(t,e=!0,n){if(t){let r=(i,s,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,s,o);else throw new GWi.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return UWi.resolveFlowScalar(t,e,r);case"block-scalar":return QWi.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function WWi(t,e){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=wGn.stringifyString({type:o,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:` `}];switch(a[0]){case"|":case">":{let u=a.indexOf(` `),l=a.substring(0,u),d=a.substring(u+1)+` -`,h=[{type:"block-scalar-header",offset:i,indent:r,source:l}];return hgn(h,c)||h.push({type:"newline",offset:-1,indent:r,source:` -`}),{type:"block-scalar",offset:i,indent:r,props:h,source:d}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:a,end:c};default:return{type:"scalar",offset:i,indent:r,source:a,end:c}}}function ads(t,e,n={}){let{afterKey:r=!1,implicitKey:s=!1,inFlow:i=!1,type:o}=n,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let u=t.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=pgn.stringifyString({type:o,value:e},{implicitKey:s||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":cds(t,c);break;case'"':iJe(t,c,"double-quoted-scalar");break;case"'":iJe(t,c,"single-quoted-scalar");break;default:iJe(t,c,"scalar")}}function cds(t,e){let n=e.indexOf(` -`),r=e.substring(0,n),s=e.substring(n+1)+` -`;if(t.type==="block-scalar"){let i=t.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=r,t.source=s}else{let{offset:i}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:r}];hgn(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:` -`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:s})}}function hgn(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function iJe(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),s=e.length;t.props[0].type==="block-scalar-header"&&(s-=t.props[0].source.length);for(let i of r)i.offset+=s;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{let s={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:n,source:e,end:[s]});break}default:{let r="indent"in t?t.indent:-1,s="end"in t&&Array.isArray(t.end)?t.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(t))i!=="type"&&i!=="offset"&&delete t[i];Object.assign(t,{type:n,indent:r,source:e,end:s})}}}d0e.createScalarToken=ods;d0e.resolveAsScalar=ids;d0e.setScalarValue=ads});var ggn=ee(fgn=>{"use strict";p();var lds=t=>"type"in t?h0e(t):p0e(t);function h0e(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=h0e(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=p0e(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=p0e(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=p0e(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function p0e({start:t,key:e,sep:n,value:r}){let s="";for(let i of t)s+=i.source;if(e&&(s+=h0e(e)),n)for(let i of n)s+=i.source;return r&&(s+=h0e(r)),s}fgn.stringify=lds});var bgn=ee(Egn=>{"use strict";p();var oJe=Symbol("break visit"),uds=Symbol("skip children"),Agn=Symbol("remove item");function zM(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),ygn(Object.freeze([]),t,e)}zM.BREAK=oJe;zM.SKIP=uds;zM.REMOVE=Agn;zM.itemAtPath=(t,e)=>{let n=t;for(let[r,s]of e){let i=n?.[r];if(i&&"items"in i)n=i.items[s];else return}return n};zM.parentCollection=(t,e)=>{let n=zM.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],s=n?.[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function ygn(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let s of["key","value"]){let i=e[s];if(i&&"items"in i){for(let o=0;o{"use strict";p();var aJe=mgn(),dds=ggn(),pds=bgn(),cJe="\uFEFF",lJe="",uJe="",dJe="",hds=t=>!!t&&"items"in t,mds=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function fds(t){switch(t){case cJe:return"";case lJe:return"";case uJe:return"";case dJe:return"";default:return JSON.stringify(t)}}function gds(t){switch(t){case cJe:return"byte-order-mark";case lJe:return"doc-mode";case uJe:return"flow-error-end";case dJe:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`,m=[{type:"block-scalar-header",offset:s,indent:r,source:l}];return TGn(m,c)||m.push({type:"newline",offset:-1,indent:r,source:` +`}),{type:"block-scalar",offset:s,indent:r,props:m,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:c};default:return{type:"scalar",offset:s,indent:r,source:a,end:c}}}function HWi(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=n,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let u=t.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=wGn.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":qWi(t,c);break;case'"':Rlt(t,c,"double-quoted-scalar");break;case"'":Rlt(t,c,"single-quoted-scalar");break;default:Rlt(t,c,"scalar")}}function qWi(t,e){let n=e.indexOf(` +`),r=e.substring(0,n),i=e.substring(n+1)+` +`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,t.source=i}else{let{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:r}];TGn(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:` +`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function TGn(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function Rlt(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of r)s.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{let r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:n,indent:r,source:e,end:i})}}}Mve.createScalarToken=WWi;Mve.resolveAsScalar=$Wi;Mve.setScalarValue=HWi});var kGn=re(RGn=>{"use strict";p();var jWi=t=>"type"in t?Lve(t):Ove(t);function Lve(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=Lve(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=Ove(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=Ove(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=Ove(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function Ove({start:t,key:e,sep:n,value:r}){let i="";for(let s of t)i+=s.source;if(e&&(i+=Lve(e)),n)for(let s of n)i+=s.source;return r&&(i+=Lve(r)),i}RGn.stringify=jWi});var PGn=re(DGn=>{"use strict";p();var klt=Symbol("break visit"),VWi=Symbol("skip children"),BGn=Symbol("remove item");function mQ(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),NGn(Object.freeze([]),t,e)}mQ.BREAK=klt;mQ.SKIP=VWi;mQ.REMOVE=BGn;mQ.itemAtPath=(t,e)=>{let n=t;for(let[r,i]of e){let s=n?.[r];if(s&&"items"in s)n=s.items[i];else return}return n};mQ.parentCollection=(t,e)=>{let n=mQ.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function NGn(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let o=0;o{"use strict";p();var Blt=vGn(),YWi=kGn(),zWi=PGn(),Nlt="\uFEFF",Dlt="",Plt="",Mlt="",KWi=t=>!!t&&"items"in t,JWi=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function XWi(t){switch(t){case Nlt:return"";case Dlt:return"";case Plt:return"";case Mlt:return"";default:return JSON.stringify(t)}}function ZWi(t){switch(t){case Nlt:return"byte-order-mark";case Dlt:return"doc-mode";case Plt:return"flow-error-end";case Mlt:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}cg.createScalarToken=aJe.createScalarToken;cg.resolveAsScalar=aJe.resolveAsScalar;cg.setScalarValue=aJe.setScalarValue;cg.stringify=dds.stringify;cg.visit=pds.visit;cg.BOM=cJe;cg.DOCUMENT=lJe;cg.FLOW_END=uJe;cg.SCALAR=dJe;cg.isCollection=hds;cg.isScalar=mds;cg.prettyToken=fds;cg.tokenType=gds});var mJe=ee(Sgn=>{"use strict";p();var dZ=m0e();function m0(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}var _gn=new Set("0123456789ABCDEFabcdef"),Ads=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),f0e=new Set(",[]{}"),yds=new Set(` ,[]{} -\r `),pJe=t=>!t||yds.has(t),hJe=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}kA.createScalarToken=Blt.createScalarToken;kA.resolveAsScalar=Blt.resolveAsScalar;kA.setScalarValue=Blt.setScalarValue;kA.stringify=YWi.stringify;kA.visit=zWi.visit;kA.BOM=Nlt;kA.DOCUMENT=Dlt;kA.FLOW_END=Plt;kA.SCALAR=Mlt;kA.isCollection=KWi;kA.isScalar=JWi;kA.prettyToken=XWi;kA.tokenType=ZWi});var Flt=re(OGn=>{"use strict";p();var Cie=Fve();function mS(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}var MGn=new Set("0123456789ABCDEFabcdef"),eHi=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Qve=new Set(",[]{}"),tHi=new Set(` ,[]{} +\r `),Olt=t=>!t||tHi.has(t),Llt=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[e+1]===` -`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let s=this.buffer[r+e+1];if(s===` -`||!s&&!this.atEnd)return e+r+1}return n===` -`||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&m0(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!m0(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&m0(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(pJe),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>m0(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case` -`:e=i,n=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===` -`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(` -`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===` -`;)r=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===` -`&&i>=this.pos&&i+1+n>a)e=i;else break}while(!0);return yield dZ.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){let i=this.buffer[r+1];if(m0(i)||e&&f0e.has(i))break;n=r}else if(m0(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` -`?(r+=1,s=` -`,i=this.buffer[r+1]):n=r),i==="#"||e&&f0e.has(i))break;if(s===` -`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&f0e.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield dZ.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(pJe),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(m0(r)||n&&f0e.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!m0(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Ads.has(n))n=this.buffer[++e];else if(n==="%"&&_gn.has(this.buffer[e+1])&&_gn.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let i=this.buffer[r+e+1];if(i===` +`||!i&&!this.atEnd)return e+r+1}return n===` +`||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&mS(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!mS(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&mS(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Olt),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>mS(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case` +`:e=s,n=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===` +`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(` +`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===` +`;)r=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let a=s;for(;o===" ";)o=this.buffer[--s];if(o===` +`&&s>=this.pos&&s+1+n>a)e=s;else break}while(!0);return yield Cie.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let s=this.buffer[r+1];if(mS(s)||e&&Qve.has(s))break;n=r}else if(mS(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===` +`?(r+=1,i=` +`,s=this.buffer[r+1]):n=r),s==="#"||e&&Qve.has(s))break;if(i===` +`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Qve.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Cie.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Olt),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(mS(r)||n&&Qve.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!mS(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(eHi.has(n))n=this.buffer[++e];else if(n==="%"&&MGn.has(this.buffer[e+1])&&MGn.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Sgn.Lexer=hJe});var gJe=ee(Cgn=>{"use strict";p();var fJe=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[i]{"use strict";p();var Eds=require("process"),Ign=m0e(),bds=mJe();function VN(t,e){for(let n=0;n=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function A0e(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&wgn(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{let s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&xgn(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};OGn.Lexer=Llt});var Ult=re(LGn=>{"use strict";p();var Qlt=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[s]{"use strict";p();var nHi=require("process"),FGn=Fve(),rHi=Flt();function QD(t,e){for(let n=0;n=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Gve(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&UGn(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&QGn(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(s&&n.sep&&!n.value){let o=[];for(let a=0;ae.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(VN(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Tgn(n.key)&&!VN(n.sep,"newline")){let o=VH(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(VN(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=VH(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):VN(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);s||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!VN(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){A0e(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||VN(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let s=g0e(r),i=VH(s);wgn(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Gve(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&n.sep&&!n.value){let o=[];for(let a=0;ae.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(QD(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(GGn(n.key)&&!QD(n.sep,"newline")){let o=Mj(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(QD(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Mj(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):QD(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!QD(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Gve(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||QD(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=Uve(r),s=Mj(i);UGn(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=g0e(e),r=VH(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=g0e(e),r=VH(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};vgn.Parser=AJe});var Bgn=ee(hZ=>{"use strict";p();var Rgn=sJe(),_ds=sZ(),pZ=aZ(),Sds=n7e(),Cds=vo(),Ids=gJe(),kgn=yJe();function Ngn(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Ids.LineCounter||null,prettyErrors:e}}function xds(t,e={}){let{lineCounter:n,prettyErrors:r}=Ngn(e),s=new kgn.Parser(n?.addNewLine),i=new Rgn.Composer(e),o=Array.from(i.compose(s.parse(t)));if(r&&n)for(let a of o)a.errors.forEach(pZ.prettifyError(t,n)),a.warnings.forEach(pZ.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function Dgn(t,e={}){let{lineCounter:n,prettyErrors:r}=Ngn(e),s=new kgn.Parser(n?.addNewLine),i=new Rgn.Composer(e),o=null;for(let a of i.compose(s.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new pZ.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(pZ.prettifyError(t,n)),o.warnings.forEach(pZ.prettifyError(t,n))),o}function wds(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let s=Dgn(t,n);if(!s)return null;if(s.warnings.forEach(i=>Sds.warn(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function Tds(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(t===void 0){let{keepUndefined:s}=n??e??{};if(!s)return}return Cds.isDocument(t)&&!r?t.toString(n):new _ds.Document(t,r,n).toString(n)}hZ.parse=wds;hZ.parseAllDocuments=xds;hZ.parseDocument=Dgn;hZ.stringify=Tds});var E0e=ee(na=>{"use strict";p();var vds=sJe(),Rds=sZ(),kds=F7e(),EJe=aZ(),Nds=GX(),jN=vo(),Dds=GN(),Bds=qu(),Pds=qN(),Ods=HN(),Mds=m0e(),Lds=mJe(),Fds=gJe(),Qds=yJe(),y0e=Bgn(),Pgn=FX();na.Composer=vds.Composer;na.Document=Rds.Document;na.Schema=kds.Schema;na.YAMLError=EJe.YAMLError;na.YAMLParseError=EJe.YAMLParseError;na.YAMLWarning=EJe.YAMLWarning;na.Alias=Nds.Alias;na.isAlias=jN.isAlias;na.isCollection=jN.isCollection;na.isDocument=jN.isDocument;na.isMap=jN.isMap;na.isNode=jN.isNode;na.isPair=jN.isPair;na.isScalar=jN.isScalar;na.isSeq=jN.isSeq;na.Pair=Dds.Pair;na.Scalar=Bds.Scalar;na.YAMLMap=Pds.YAMLMap;na.YAMLSeq=Ods.YAMLSeq;na.CST=Mds;na.Lexer=Lds.Lexer;na.LineCounter=Fds.LineCounter;na.Parser=Qds.Parser;na.parse=y0e.parse;na.parseAllDocuments=y0e.parseAllDocuments;na.parseDocument=y0e.parseDocument;na.stringify=y0e.stringify;na.visit=Pgn.visit;na.visitAsync=Pgn.visitAsync});var Ggn=ee((rFa,bt)=>{p();var Ugn={};Ugn.__wbindgen_placeholder__=bt.exports;var lt,{TextEncoder:Vds,TextDecoder:jds}=require("util");function _Je(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let s=t.description;return s==null?"Symbol":`Symbol(${s})`}if(e=="function"){let s=t.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(t)){let s=t.length,i="[";s>0&&(i+=_Je(t[0]));for(let o=1;o1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message} -${t.stack}`:r}var Ed=0,C0e=null;function KH(){return(C0e===null||C0e.byteLength===0)&&(C0e=new Uint8Array(lt.memory.buffer)),C0e}var x0e=new Vds("utf-8"),Yds=typeof x0e.encodeInto=="function"?function(t,e){return x0e.encodeInto(t,e)}:function(t,e){let n=x0e.encode(t);return e.set(n),{read:t.length,written:n.length}};function ey(t,e,n){if(n===void 0){let a=x0e.encode(t),c=e(a.length,1)>>>0;return KH().subarray(c,c+a.length).set(a),Ed=a.length,c}let r=t.length,s=e(r,1)>>>0,i=KH(),o=0;for(;o127)break;i[s+o]=a}if(o!==r){o!==0&&(t=t.slice(o)),s=n(s,r,r=o+t.length*3,1)>>>0;let a=KH().subarray(s+o,s+r),c=Yds(t,a);o+=c.written,s=n(s,r,o,1)>>>0}return Ed=o,s}var jH=null;function zH(){return(jH===null||jH.buffer.detached===!0||jH.buffer.detached===void 0&&jH.buffer!==lt.memory.buffer)&&(jH=new DataView(lt.memory.buffer)),jH}var $gn=new jds("utf-8",{ignoreBOM:!0,fatal:!0});$gn.decode();function XM(t,e){return t=t>>>0,$gn.decode(KH().subarray(t,t+e))}function Ut(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`);return t.ptr}bt.exports.alter_channel=function(t,e,n){Ut(t,$t),lt.alter_channel(t.__wbg_ptr,e,n)};bt.exports.alter_red_channel=function(t,e){Ut(t,$t),lt.alter_red_channel(t.__wbg_ptr,e)};bt.exports.alter_green_channel=function(t,e){Ut(t,$t),lt.alter_green_channel(t.__wbg_ptr,e)};bt.exports.alter_blue_channel=function(t,e){Ut(t,$t),lt.alter_blue_channel(t.__wbg_ptr,e)};bt.exports.alter_two_channels=function(t,e,n,r,s){Ut(t,$t),lt.alter_two_channels(t.__wbg_ptr,e,n,r,s)};bt.exports.alter_channels=function(t,e,n,r){Ut(t,$t),lt.alter_channels(t.__wbg_ptr,e,n,r)};bt.exports.remove_channel=function(t,e,n){Ut(t,$t),lt.remove_channel(t.__wbg_ptr,e,n)};bt.exports.remove_red_channel=function(t,e){Ut(t,$t),lt.remove_red_channel(t.__wbg_ptr,e)};bt.exports.remove_green_channel=function(t,e){Ut(t,$t),lt.remove_green_channel(t.__wbg_ptr,e)};bt.exports.remove_blue_channel=function(t,e){Ut(t,$t),lt.remove_blue_channel(t.__wbg_ptr,e)};bt.exports.swap_channels=function(t,e,n){Ut(t,$t),lt.swap_channels(t.__wbg_ptr,e,n)};bt.exports.invert=function(t){Ut(t,$t),lt.invert(t.__wbg_ptr)};bt.exports.selective_hue_rotate=function(t,e,n){Ut(t,$t),Ut(e,eh);var r=e.__destroy_into_raw();lt.selective_hue_rotate(t.__wbg_ptr,r,n)};bt.exports.selective_color_convert=function(t,e,n,r){Ut(t,$t),Ut(e,eh);var s=e.__destroy_into_raw();Ut(n,eh);var i=n.__destroy_into_raw();lt.selective_color_convert(t.__wbg_ptr,s,i,r)};bt.exports.selective_lighten=function(t,e,n){Ut(t,$t),Ut(e,eh);var r=e.__destroy_into_raw();lt.selective_lighten(t.__wbg_ptr,r,n)};bt.exports.selective_desaturate=function(t,e,n){Ut(t,$t),Ut(e,eh);var r=e.__destroy_into_raw();lt.selective_desaturate(t.__wbg_ptr,r,n)};bt.exports.selective_saturate=function(t,e,n){Ut(t,$t),Ut(e,eh);var r=e.__destroy_into_raw();lt.selective_saturate(t.__wbg_ptr,r,n)};bt.exports.selective_greyscale=function(t,e){Ut(t,$t);var n=t.__destroy_into_raw();Ut(e,eh);var r=e.__destroy_into_raw();lt.selective_greyscale(n,r)};bt.exports.monochrome=function(t,e,n,r){Ut(t,$t),lt.monochrome(t.__wbg_ptr,e,n,r)};bt.exports.sepia=function(t){Ut(t,$t),lt.sepia(t.__wbg_ptr)};bt.exports.grayscale=function(t){Ut(t,$t),lt.grayscale(t.__wbg_ptr)};bt.exports.grayscale_human_corrected=function(t){Ut(t,$t),lt.grayscale_human_corrected(t.__wbg_ptr)};bt.exports.desaturate=function(t){Ut(t,$t),lt.desaturate(t.__wbg_ptr)};bt.exports.decompose_min=function(t){Ut(t,$t),lt.decompose_min(t.__wbg_ptr)};bt.exports.decompose_max=function(t){Ut(t,$t),lt.decompose_max(t.__wbg_ptr)};bt.exports.grayscale_shades=function(t,e){Ut(t,$t),lt.grayscale_shades(t.__wbg_ptr,e)};bt.exports.r_grayscale=function(t){Ut(t,$t),lt.r_grayscale(t.__wbg_ptr)};bt.exports.g_grayscale=function(t){Ut(t,$t),lt.g_grayscale(t.__wbg_ptr)};bt.exports.b_grayscale=function(t){Ut(t,$t),lt.b_grayscale(t.__wbg_ptr)};bt.exports.single_channel_grayscale=function(t,e){Ut(t,$t),lt.single_channel_grayscale(t.__wbg_ptr,e)};bt.exports.threshold=function(t,e){Ut(t,$t),lt.threshold(t.__wbg_ptr,e)};bt.exports.gamma_correction=function(t,e,n,r){Ut(t,$t),lt.gamma_correction(t.__wbg_ptr,e,n,r)};bt.exports.hsluv=function(t,e,n){Ut(t,$t);let r=ey(e,lt.__wbindgen_malloc,lt.__wbindgen_realloc),s=Ed;lt.hsluv(t.__wbg_ptr,r,s,n)};bt.exports.lch=function(t,e,n){Ut(t,$t);let r=ey(e,lt.__wbindgen_malloc,lt.__wbindgen_realloc),s=Ed;lt.lch(t.__wbg_ptr,r,s,n)};bt.exports.hsl=function(t,e,n){Ut(t,$t);let r=ey(e,lt.__wbindgen_malloc,lt.__wbindgen_realloc),s=Ed;lt.hsl(t.__wbg_ptr,r,s,n)};bt.exports.hsv=function(t,e,n){Ut(t,$t);let r=ey(e,lt.__wbindgen_malloc,lt.__wbindgen_realloc),s=Ed;lt.hsv(t.__wbg_ptr,r,s,n)};bt.exports.hue_rotate_hsl=function(t,e){Ut(t,$t),lt.hue_rotate_hsl(t.__wbg_ptr,e)};bt.exports.hue_rotate_hsv=function(t,e){Ut(t,$t),lt.hue_rotate_hsv(t.__wbg_ptr,e)};bt.exports.hue_rotate_lch=function(t,e){Ut(t,$t),lt.hue_rotate_lch(t.__wbg_ptr,e)};bt.exports.hue_rotate_hsluv=function(t,e){Ut(t,$t),lt.hue_rotate_hsluv(t.__wbg_ptr,e)};bt.exports.saturate_hsl=function(t,e){Ut(t,$t),lt.saturate_hsl(t.__wbg_ptr,e)};bt.exports.saturate_lch=function(t,e){Ut(t,$t),lt.saturate_lch(t.__wbg_ptr,e)};bt.exports.saturate_hsluv=function(t,e){Ut(t,$t),lt.saturate_hsluv(t.__wbg_ptr,e)};bt.exports.saturate_hsv=function(t,e){Ut(t,$t),lt.saturate_hsv(t.__wbg_ptr,e)};bt.exports.lighten_lch=function(t,e){Ut(t,$t),lt.lighten_lch(t.__wbg_ptr,e)};bt.exports.lighten_hsluv=function(t,e){Ut(t,$t),lt.lighten_hsluv(t.__wbg_ptr,e)};bt.exports.lighten_hsl=function(t,e){Ut(t,$t),lt.lighten_hsl(t.__wbg_ptr,e)};bt.exports.lighten_hsv=function(t,e){Ut(t,$t),lt.lighten_hsv(t.__wbg_ptr,e)};bt.exports.darken_lch=function(t,e){Ut(t,$t),lt.darken_lch(t.__wbg_ptr,e)};bt.exports.darken_hsluv=function(t,e){Ut(t,$t),lt.darken_hsluv(t.__wbg_ptr,e)};bt.exports.darken_hsl=function(t,e){Ut(t,$t),lt.darken_hsl(t.__wbg_ptr,e)};bt.exports.darken_hsv=function(t,e){Ut(t,$t),lt.darken_hsv(t.__wbg_ptr,e)};bt.exports.desaturate_hsv=function(t,e){Ut(t,$t),lt.desaturate_hsv(t.__wbg_ptr,e)};bt.exports.desaturate_hsl=function(t,e){Ut(t,$t),lt.desaturate_hsl(t.__wbg_ptr,e)};bt.exports.desaturate_lch=function(t,e){Ut(t,$t),lt.desaturate_lch(t.__wbg_ptr,e)};bt.exports.desaturate_hsluv=function(t,e){Ut(t,$t),lt.desaturate_hsluv(t.__wbg_ptr,e)};bt.exports.mix_with_colour=function(t,e,n){Ut(t,$t),Ut(e,eh);var r=e.__destroy_into_raw();lt.mix_with_colour(t.__wbg_ptr,r,n)};bt.exports.noise_reduction=function(t){Ut(t,$t),lt.noise_reduction(t.__wbg_ptr)};bt.exports.sharpen=function(t){Ut(t,$t),lt.sharpen(t.__wbg_ptr)};bt.exports.edge_detection=function(t){Ut(t,$t),lt.edge_detection(t.__wbg_ptr)};bt.exports.identity=function(t){Ut(t,$t),lt.identity(t.__wbg_ptr)};bt.exports.box_blur=function(t){Ut(t,$t),lt.box_blur(t.__wbg_ptr)};bt.exports.gaussian_blur=function(t,e){Ut(t,$t),lt.gaussian_blur(t.__wbg_ptr,e)};bt.exports.detect_horizontal_lines=function(t){Ut(t,$t),lt.detect_horizontal_lines(t.__wbg_ptr)};bt.exports.detect_vertical_lines=function(t){Ut(t,$t),lt.detect_vertical_lines(t.__wbg_ptr)};bt.exports.detect_45_deg_lines=function(t){Ut(t,$t),lt.detect_45_deg_lines(t.__wbg_ptr)};bt.exports.detect_135_deg_lines=function(t){Ut(t,$t),lt.detect_135_deg_lines(t.__wbg_ptr)};bt.exports.laplace=function(t){Ut(t,$t),lt.laplace(t.__wbg_ptr)};bt.exports.edge_one=function(t){Ut(t,$t),lt.edge_one(t.__wbg_ptr)};bt.exports.emboss=function(t){Ut(t,$t),lt.emboss(t.__wbg_ptr)};bt.exports.sobel_horizontal=function(t){Ut(t,$t),lt.sobel_horizontal(t.__wbg_ptr)};bt.exports.prewitt_horizontal=function(t){Ut(t,$t),lt.prewitt_horizontal(t.__wbg_ptr)};bt.exports.sobel_vertical=function(t){Ut(t,$t),lt.sobel_vertical(t.__wbg_ptr)};bt.exports.sobel_global=function(t){Ut(t,$t),lt.sobel_global(t.__wbg_ptr)};bt.exports.add_noise_rand=function(t){Ut(t,$t),lt.add_noise_rand(t.__wbg_ptr)};bt.exports.pink_noise=function(t){Ut(t,$t),lt.pink_noise(t.__wbg_ptr)};bt.exports.watermark=function(t,e,n,r){Ut(t,$t),Ut(e,$t),lt.watermark(t.__wbg_ptr,e.__wbg_ptr,n,r)};bt.exports.blend=function(t,e,n){Ut(t,$t),Ut(e,$t);let r=ey(n,lt.__wbindgen_malloc,lt.__wbindgen_realloc),s=Ed;lt.blend(t.__wbg_ptr,e.__wbg_ptr,r,s)};bt.exports.create_gradient=function(t,e){let n=lt.create_gradient(t,e);return $t.__wrap(n)};bt.exports.apply_gradient=function(t){Ut(t,$t),lt.apply_gradient(t.__wbg_ptr)};bt.exports.neue=function(t){Ut(t,$t),lt.neue(t.__wbg_ptr)};bt.exports.lix=function(t){Ut(t,$t),lt.lix(t.__wbg_ptr)};bt.exports.ryo=function(t){Ut(t,$t),lt.ryo(t.__wbg_ptr)};bt.exports.filter=function(t,e){Ut(t,$t);let n=ey(e,lt.__wbindgen_malloc,lt.__wbindgen_realloc),r=Ed;lt.filter(t.__wbg_ptr,n,r)};bt.exports.lofi=function(t){Ut(t,$t),lt.lofi(t.__wbg_ptr)};bt.exports.pastel_pink=function(t){Ut(t,$t),lt.pastel_pink(t.__wbg_ptr)};bt.exports.golden=function(t){Ut(t,$t),lt.golden(t.__wbg_ptr)};bt.exports.cali=function(t){Ut(t,$t),lt.cali(t.__wbg_ptr)};bt.exports.dramatic=function(t){Ut(t,$t),lt.dramatic(t.__wbg_ptr)};bt.exports.monochrome_tint=function(t,e){Ut(t,$t),Ut(e,eh);var n=e.__destroy_into_raw();lt.monochrome_tint(t.__wbg_ptr,n)};bt.exports.duotone_violette=function(t){Ut(t,$t),lt.duotone_violette(t.__wbg_ptr)};bt.exports.duotone_horizon=function(t){Ut(t,$t),lt.duotone_horizon(t.__wbg_ptr)};bt.exports.duotone_tint=function(t,e){Ut(t,$t),Ut(e,eh);var n=e.__destroy_into_raw();lt.duotone_tint(t.__wbg_ptr,n)};bt.exports.duotone_lilac=function(t){Ut(t,$t),lt.duotone_lilac(t.__wbg_ptr)};bt.exports.duotone_ochre=function(t){Ut(t,$t),lt.duotone_ochre(t.__wbg_ptr)};bt.exports.firenze=function(t){Ut(t,$t),lt.firenze(t.__wbg_ptr)};bt.exports.obsidian=function(t){Ut(t,$t),lt.obsidian(t.__wbg_ptr)};bt.exports.crop=function(t,e,n,r,s){Ut(t,$t);let i=lt.crop(t.__wbg_ptr,e,n,r,s);return $t.__wrap(i)};bt.exports.crop_img_browser=function(t,e,n,r,s){return lt.crop_img_browser(t,e,n,r,s)};bt.exports.fliph=function(t){Ut(t,$t),lt.fliph(t.__wbg_ptr)};bt.exports.flipv=function(t){Ut(t,$t),lt.flipv(t.__wbg_ptr)};bt.exports.resize_img_browser=function(t,e,n,r){return Ut(t,$t),lt.resize_img_browser(t.__wbg_ptr,e,n,r)};bt.exports.resize=function(t,e,n,r){Ut(t,$t);let s=lt.resize(t.__wbg_ptr,e,n,r);return $t.__wrap(s)};bt.exports.seam_carve=function(t,e,n){Ut(t,$t);let r=lt.seam_carve(t.__wbg_ptr,e,n);return $t.__wrap(r)};bt.exports.shearx=function(t,e){Ut(t,$t);let n=lt.shearx(t.__wbg_ptr,e);return $t.__wrap(n)};bt.exports.sheary=function(t,e){Ut(t,$t);let n=lt.sheary(t.__wbg_ptr,e);return $t.__wrap(n)};bt.exports.padding_uniform=function(t,e,n){Ut(t,$t),Ut(n,YN);var r=n.__destroy_into_raw();let s=lt.padding_uniform(t.__wbg_ptr,e,r);return $t.__wrap(s)};bt.exports.padding_left=function(t,e,n){Ut(t,$t),Ut(n,YN);var r=n.__destroy_into_raw();let s=lt.padding_left(t.__wbg_ptr,e,r);return $t.__wrap(s)};bt.exports.padding_right=function(t,e,n){Ut(t,$t),Ut(n,YN);var r=n.__destroy_into_raw();let s=lt.padding_right(t.__wbg_ptr,e,r);return $t.__wrap(s)};bt.exports.padding_top=function(t,e,n){Ut(t,$t),Ut(n,YN);var r=n.__destroy_into_raw();let s=lt.padding_top(t.__wbg_ptr,e,r);return $t.__wrap(s)};bt.exports.padding_bottom=function(t,e,n){Ut(t,$t),Ut(n,YN);var r=n.__destroy_into_raw();let s=lt.padding_bottom(t.__wbg_ptr,e,r);return $t.__wrap(s)};bt.exports.rotate=function(t,e){Ut(t,$t);let n=lt.rotate(t.__wbg_ptr,e);return $t.__wrap(n)};bt.exports.resample=function(t,e,n){Ut(t,$t);let r=lt.resample(t.__wbg_ptr,e,n);return $t.__wrap(r)};bt.exports.offset=function(t,e,n){Ut(t,$t),lt.offset(t.__wbg_ptr,e,n)};bt.exports.offset_red=function(t,e){Ut(t,$t),lt.offset_red(t.__wbg_ptr,e)};bt.exports.offset_green=function(t,e){Ut(t,$t),lt.offset_green(t.__wbg_ptr,e)};bt.exports.offset_blue=function(t,e){Ut(t,$t),lt.offset_blue(t.__wbg_ptr,e)};bt.exports.multiple_offsets=function(t,e,n,r){Ut(t,$t),lt.multiple_offsets(t.__wbg_ptr,e,n,r)};bt.exports.halftone=function(t){Ut(t,$t),lt.halftone(t.__wbg_ptr)};bt.exports.primary=function(t){Ut(t,$t),lt.primary(t.__wbg_ptr)};bt.exports.colorize=function(t){Ut(t,$t),lt.colorize(t.__wbg_ptr)};bt.exports.solarize=function(t){Ut(t,$t),lt.solarize(t.__wbg_ptr)};bt.exports.solarize_retimg=function(t){Ut(t,$t);let e=lt.solarize_retimg(t.__wbg_ptr);return $t.__wrap(e)};bt.exports.adjust_brightness=function(t,e){Ut(t,$t),lt.adjust_brightness(t.__wbg_ptr,e)};bt.exports.inc_brightness=function(t,e){Ut(t,$t),lt.inc_brightness(t.__wbg_ptr,e)};bt.exports.dec_brightness=function(t,e){Ut(t,$t),lt.dec_brightness(t.__wbg_ptr,e)};bt.exports.adjust_contrast=function(t,e){Ut(t,$t),lt.adjust_contrast(t.__wbg_ptr,e)};bt.exports.tint=function(t,e,n,r){Ut(t,$t),lt.tint(t.__wbg_ptr,e,n,r)};bt.exports.horizontal_strips=function(t,e){Ut(t,$t),lt.horizontal_strips(t.__wbg_ptr,e)};bt.exports.color_horizontal_strips=function(t,e,n){Ut(t,$t),Ut(n,eh);var r=n.__destroy_into_raw();lt.color_horizontal_strips(t.__wbg_ptr,e,r)};bt.exports.vertical_strips=function(t,e){Ut(t,$t),lt.vertical_strips(t.__wbg_ptr,e)};bt.exports.color_vertical_strips=function(t,e,n){Ut(t,$t),Ut(n,eh);var r=n.__destroy_into_raw();lt.color_vertical_strips(t.__wbg_ptr,e,r)};bt.exports.oil=function(t,e,n){Ut(t,$t),lt.oil(t.__wbg_ptr,e,n)};bt.exports.frosted_glass=function(t){Ut(t,$t),lt.frosted_glass(t.__wbg_ptr)};bt.exports.pixelize=function(t,e){Ut(t,$t),lt.pixelize(t.__wbg_ptr,e)};bt.exports.normalize=function(t){Ut(t,$t),lt.normalize(t.__wbg_ptr)};bt.exports.dither=function(t,e){Ut(t,$t),lt.dither(t.__wbg_ptr,e)};bt.exports.duotone=function(t,e,n){Ut(t,$t),Ut(e,eh);var r=e.__destroy_into_raw();Ut(n,eh);var s=n.__destroy_into_raw();lt.duotone(t.__wbg_ptr,r,s)};bt.exports.draw_text_with_border=function(t,e,n,r,s){Ut(t,$t);let i=ey(e,lt.__wbindgen_malloc,lt.__wbindgen_realloc),o=Ed;lt.draw_text_with_border(t.__wbg_ptr,i,o,n,r,s)};bt.exports.draw_text=function(t,e,n,r,s){Ut(t,$t);let i=ey(e,lt.__wbindgen_malloc,lt.__wbindgen_realloc),o=Ed;lt.draw_text(t.__wbg_ptr,i,o,n,r,s)};function SJe(t,e){let n=e(t.length*1,1)>>>0;return KH().set(t,n/1),Ed=t.length,n}function YH(t,e){return t=t>>>0,KH().subarray(t/1,t/1+e)}function Kds(t){let e=lt.__wbindgen_export_2.get(t);return lt.__externref_table_dealloc(t),e}bt.exports.run=function(){let t=lt.run();if(t[1])throw Kds(t[0])};bt.exports.get_image_data=function(t,e){return lt.get_image_data(t,e)};bt.exports.putImageData=function(t,e,n){Ut(n,$t);var r=n.__destroy_into_raw();lt.putImageData(t,e,r)};bt.exports.open_image=function(t,e){let n=lt.open_image(t,e);return $t.__wrap(n)};bt.exports.to_raw_pixels=function(t){let e=lt.to_raw_pixels(t);var n=YH(e[0],e[1]).slice();return lt.__wbindgen_free(e[0],e[1]*1,1),n};bt.exports.base64_to_image=function(t){let e=ey(t,lt.__wbindgen_malloc,lt.__wbindgen_realloc),n=Ed,r=lt.base64_to_image(e,n);return $t.__wrap(r)};bt.exports.base64_to_vec=function(t){let e=ey(t,lt.__wbindgen_malloc,lt.__wbindgen_realloc),n=Ed,r=lt.base64_to_vec(e,n);var s=YH(r[0],r[1]).slice();return lt.__wbindgen_free(r[0],r[1]*1,1),s};bt.exports.to_image_data=function(t){Ut(t,$t);var e=t.__destroy_into_raw();return lt.to_image_data(e)};function CJe(t){return t==null}function w0e(t){let e=lt.__externref_table_alloc();return lt.__wbindgen_export_2.set(e,t),e}function ty(t,e){try{return t.apply(this,e)}catch(n){let r=w0e(n);lt.__wbindgen_exn_store(r)}}var I0e=null;function zds(){return(I0e===null||I0e.byteLength===0)&&(I0e=new Uint8ClampedArray(lt.memory.buffer)),I0e}function Jds(t,e){return t=t>>>0,zds().subarray(t/1,t/1+e)}bt.exports.SamplingFilter=Object.freeze({Nearest:1,1:"Nearest",Triangle:2,2:"Triangle",CatmullRom:3,3:"CatmullRom",Gaussian:4,4:"Gaussian",Lanczos3:5,5:"Lanczos3"});var bJe=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>lt.__wbg_photonimage_free(t>>>0,1)),$t=class t{static __wrap(e){e=e>>>0;let n=Object.create(t.prototype);return n.__wbg_ptr=e,bJe.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,bJe.unregister(this),e}free(){let e=this.__destroy_into_raw();lt.__wbg_photonimage_free(e,0)}constructor(e,n,r){let s=SJe(e,lt.__wbindgen_malloc),i=Ed,o=lt.photonimage_new(s,i,n,r);return this.__wbg_ptr=o>>>0,bJe.register(this,this.__wbg_ptr,this),this}static new_from_base64(e){let n=ey(e,lt.__wbindgen_malloc,lt.__wbindgen_realloc),r=Ed,s=lt.base64_to_image(n,r);return t.__wrap(s)}static new_from_byteslice(e){let n=SJe(e,lt.__wbindgen_malloc),r=Ed,s=lt.photonimage_new_from_byteslice(n,r);return t.__wrap(s)}static new_from_blob(e){let n=lt.photonimage_new_from_blob(e);return t.__wrap(n)}static new_from_image(e){let n=lt.photonimage_new_from_image(e);return t.__wrap(n)}get_width(){return lt.photonimage_get_width(this.__wbg_ptr)>>>0}get_raw_pixels(){let e=lt.photonimage_get_raw_pixels(this.__wbg_ptr);var n=YH(e[0],e[1]).slice();return lt.__wbindgen_free(e[0],e[1]*1,1),n}get_height(){return lt.photonimage_get_height(this.__wbg_ptr)>>>0}get_base64(){let e,n;try{let r=lt.photonimage_get_base64(this.__wbg_ptr);return e=r[0],n=r[1],XM(r[0],r[1])}finally{lt.__wbindgen_free(e,n,1)}}get_bytes(){let e=lt.photonimage_get_bytes(this.__wbg_ptr);var n=YH(e[0],e[1]).slice();return lt.__wbindgen_free(e[0],e[1]*1,1),n}get_bytes_jpeg(e){let n=lt.photonimage_get_bytes_jpeg(this.__wbg_ptr,e);var r=YH(n[0],n[1]).slice();return lt.__wbindgen_free(n[0],n[1]*1,1),r}get_bytes_webp(){let e=lt.photonimage_get_bytes_webp(this.__wbg_ptr);var n=YH(e[0],e[1]).slice();return lt.__wbindgen_free(e[0],e[1]*1,1),n}get_image_data(){return lt.photonimage_get_image_data(this.__wbg_ptr)}set_imgdata(e){lt.photonimage_set_imgdata(this.__wbg_ptr,e)}get_estimated_filesize(){let e=lt.photonimage_get_estimated_filesize(this.__wbg_ptr);return BigInt.asUintN(64,e)}};bt.exports.PhotonImage=$t;var Fgn=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>lt.__wbg_rgb_free(t>>>0,1)),eh=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,Fgn.unregister(this),e}free(){let e=this.__destroy_into_raw();lt.__wbg_rgb_free(e,0)}constructor(e,n,r){let s=lt.rgb_new(e,n,r);return this.__wbg_ptr=s>>>0,Fgn.register(this,this.__wbg_ptr,this),this}set_red(e){lt.rgb_set_red(this.__wbg_ptr,e)}set_green(e){lt.rgb_set_green(this.__wbg_ptr,e)}set_blue(e){lt.rgb_set_blue(this.__wbg_ptr,e)}get_red(){return lt.rgb_get_red(this.__wbg_ptr)}get_green(){return lt.rgb_get_green(this.__wbg_ptr)}get_blue(){return lt.rgb_get_blue(this.__wbg_ptr)}};bt.exports.Rgb=eh;var Qgn=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>lt.__wbg_rgba_free(t>>>0,1)),YN=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,Qgn.unregister(this),e}free(){let e=this.__destroy_into_raw();lt.__wbg_rgba_free(e,0)}constructor(e,n,r,s){let i=lt.rgba_new(e,n,r,s);return this.__wbg_ptr=i>>>0,Qgn.register(this,this.__wbg_ptr,this),this}set_red(e){lt.rgb_set_red(this.__wbg_ptr,e)}set_green(e){lt.rgb_set_green(this.__wbg_ptr,e)}set_blue(e){lt.rgb_set_blue(this.__wbg_ptr,e)}set_alpha(e){lt.rgba_set_alpha(this.__wbg_ptr,e)}get_red(){return lt.rgb_get_red(this.__wbg_ptr)}get_green(){return lt.rgb_get_green(this.__wbg_ptr)}get_blue(){return lt.rgb_get_blue(this.__wbg_ptr)}get_alpha(){return lt.rgba_get_alpha(this.__wbg_ptr)}};bt.exports.Rgba=YN;bt.exports.__wbg_new_abda76e883ba8a5f=function(){return new Error};bt.exports.__wbg_stack_658279fe44541cf6=function(t,e){let n=e.stack,r=ey(n,lt.__wbindgen_malloc,lt.__wbindgen_realloc),s=Ed;zH().setInt32(t+4,s,!0),zH().setInt32(t+0,r,!0)};bt.exports.__wbg_error_f851667af71bcfc6=function(t,e){let n,r;try{n=t,r=e,console.error(XM(t,e))}finally{lt.__wbindgen_free(n,r,1)}};bt.exports.__wbg_instanceof_Window_c4b70662a0d2c5ec=function(t){let e;try{e=t instanceof Window}catch{e=!1}return e};bt.exports.__wbg_document_e5c1786dea6542e4=function(t){let e=t.document;return CJe(e)?0:w0e(e)};bt.exports.__wbg_body_e70ae6abd01ae584=function(t){let e=t.body;return CJe(e)?0:w0e(e)};bt.exports.__wbg_createElement_5d4c76f218b78145=function(){return ty(function(t,e,n){return t.createElement(XM(e,n))},arguments)};bt.exports.__wbg_width_4c6f0048d64cf86b=function(t){return t.width};bt.exports.__wbg_height_21f0d3fd8f753394=function(t){return t.height};bt.exports.__wbg_width_79e0847ed5883b03=function(t){return t.width};bt.exports.__wbg_height_e4e4e4779f8feac0=function(t){return t.height};bt.exports.__wbg_data_fda507064d127f5b=function(t,e){let n=e.data,r=SJe(n,lt.__wbindgen_malloc),s=Ed;zH().setInt32(t+4,s,!0),zH().setInt32(t+0,r,!0)};bt.exports.__wbg_newwithu8clampedarrayandsh_1fddccb3a94a5e05=function(){return ty(function(t,e,n,r){return new ImageData(Jds(t,e),n>>>0,r>>>0)},arguments)};bt.exports.__wbg_instanceof_CanvasRenderingContext2d_3abbe7ec7af32cae=function(t){let e;try{e=t instanceof CanvasRenderingContext2D}catch{e=!1}return e};bt.exports.__wbg_drawImage_fede06db74e39a60=function(){return ty(function(t,e,n,r){t.drawImage(e,n,r)},arguments)};bt.exports.__wbg_drawImage_f395c8e43c79a909=function(){return ty(function(t,e,n,r,s,i,o,a,c,u){t.drawImage(e,n,r,s,i,o,a,c,u)},arguments)};bt.exports.__wbg_getImageData_5e1c242046e6b59e=function(){return ty(function(t,e,n,r,s){return t.getImageData(e,n,r,s)},arguments)};bt.exports.__wbg_putImageData_a8b3e177ee06d521=function(){return ty(function(t,e,n,r){t.putImageData(e,n,r)},arguments)};bt.exports.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e=function(t){let e;try{e=t instanceof HTMLCanvasElement}catch{e=!1}return e};bt.exports.__wbg_width_dc225e55343b745e=function(t){return t.width};bt.exports.__wbg_setwidth_488780db69b08846=function(t,e){t.width=e>>>0};bt.exports.__wbg_height_3a8bec2f3fe71b26=function(t){return t.height};bt.exports.__wbg_setheight_1761808c18403921=function(t,e){t.height=e>>>0};bt.exports.__wbg_getContext_fc99dbd3a9a7e318=function(){return ty(function(t,e,n){let r=t.getContext(XM(e,n));return CJe(r)?0:w0e(r)},arguments)};bt.exports.__wbg_settextContent_f82a86a8df347e1c=function(t,e,n){t.textContent=e===0?void 0:XM(e,n)};bt.exports.__wbg_appendChild_fa3b00dade9fc4cf=function(){return ty(function(t,e){return t.appendChild(e)},arguments)};bt.exports.__wbg_newnoargs_e643855c6572a4a8=function(t,e){return new Function(XM(t,e))};bt.exports.__wbg_call_f96b398515635514=function(){return ty(function(t,e){return t.call(e)},arguments)};bt.exports.__wbg_self_b9aad7f1c618bfaf=function(){return ty(function(){return self.self},arguments)};bt.exports.__wbg_window_55e469842c98b086=function(){return ty(function(){return window.window},arguments)};bt.exports.__wbg_globalThis_d0957e302752547e=function(){return ty(function(){return globalThis.globalThis},arguments)};bt.exports.__wbg_global_ae2f87312b8987fb=function(){return ty(function(){return global.global},arguments)};bt.exports.__wbindgen_is_undefined=function(t){return t===void 0};bt.exports.__wbg_buffer_fcbfb6d88b2732e9=function(t){return t.buffer};bt.exports.__wbg_new_bc5d9aad3f9ac80e=function(t){return new Uint8Array(t)};bt.exports.__wbg_set_4b3aa8445ac1e91c=function(t,e,n){t.set(e,n>>>0)};bt.exports.__wbg_length_d9c4ded7e708c6a1=function(t){return t.length};bt.exports.__wbindgen_debug_string=function(t,e){let n=_Je(e),r=ey(n,lt.__wbindgen_malloc,lt.__wbindgen_realloc),s=Ed;zH().setInt32(t+4,s,!0),zH().setInt32(t+0,r,!0)};bt.exports.__wbindgen_throw=function(t,e){throw new Error(XM(t,e))};bt.exports.__wbindgen_memory=function(){return lt.memory};bt.exports.__wbindgen_init_externref_table=function(){let t=lt.__wbindgen_export_2,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)};var Xds=require("path").join(__dirname,"photon_rs_bg.wasm"),Zds=require("fs").readFileSync(Xds),eps=new WebAssembly.Module(Zds),tps=new WebAssembly.Instance(eps,Ugn);lt=tps.exports;bt.exports.__wasm=lt;lt.__wbindgen_start()});var OSe=ee((p2a,PSe)=>{p();function Pyn(t){return Array.isArray(t)?t:[t]}var jhs=void 0,IXe="",Dyn=" ",CXe="\\",Yhs=/^\s+$/,Khs=/(?:[^\\]|^)\\$/,zhs=/^\\!/,Jhs=/^\\#/,Xhs=/\r?\n/g,Zhs=/^\.{0,2}\/|^\.{1,2}$/,ems=/\/$/,b5="/",Oyn="node-ignore";typeof Symbol<"u"&&(Oyn=Symbol.for("node-ignore"));var Myn=Oyn,_5=(t,e,n)=>(Object.defineProperty(t,e,{value:n}),n),tms=/([0-z])-([0-z])/g,Lyn=()=>!1,nms=t=>t.replace(tms,(e,n,r)=>n.charCodeAt(0)<=r.charCodeAt(0)?e:IXe),rms=t=>{let{length:e}=t;return t.slice(0,e-e%2)},sms=[[/^\uFEFF/,()=>IXe],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,n)=>e+(n.indexOf("\\")===0?Dyn:IXe)],[/(\\+?)\s/g,(t,e)=>{let{length:n}=e;return e.slice(0,n-n%2)+Dyn}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,n)=>e+6{let r=n.replace(/\\\*/g,"[^\\/]*");return e+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>CXe],[/\\\\/g,()=>CXe],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,n,r,s)=>e===CXe?`\\[${n}${rms(r)}${s}`:s==="]"&&r.length%2===0?`[${nms(n)}${r}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],ims=/(^|\\\/)?\\\*$/,UZ="regex",DSe="checkRegex",Byn="_",oms={[UZ](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[DSe](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},ams=t=>sms.reduce((e,[n,r])=>e.replace(n,r.bind(t)),t),BSe=t=>typeof t=="string",cms=t=>t&&BSe(t)&&!Yhs.test(t)&&!Khs.test(t)&&t.indexOf("#")!==0,lms=t=>t.split(Xhs).filter(Boolean),xXe=class{constructor(e,n,r,s,i,o){this.pattern=e,this.mark=n,this.negative=i,_5(this,"body",r),_5(this,"ignoreCase",s),_5(this,"regexPrefix",o)}get regex(){let e=Byn+UZ;return this[e]?this[e]:this._make(UZ,e)}get checkRegex(){let e=Byn+DSe;return this[e]?this[e]:this._make(DSe,e)}_make(e,n){let r=this.regexPrefix.replace(ims,oms[e]),s=this.ignoreCase?new RegExp(r,"i"):new RegExp(r);return _5(this,n,s)}},ums=({pattern:t,mark:e},n)=>{let r=!1,s=t;s.indexOf("!")===0&&(r=!0,s=s.substr(1)),s=s.replace(zhs,"!").replace(Jhs,"#");let i=ams(s);return new xXe(t,e,s,n,r,i)},wXe=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[Myn]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(BSe(e)&&(e={pattern:e}),cms(e.pattern)){let n=ums(e,this._ignoreCase);this._added=!0,this._rules.push(n)}}add(e){return this._added=!1,Pyn(BSe(e)?lms(e):e).forEach(this._add,this),this._added}test(e,n,r){let s=!1,i=!1,o;this._rules.forEach(c=>{let{negative:u}=c;i===u&&s!==i||u&&!s&&!i&&!n||!c[r].test(e)||(s=!u,i=u,o=u?jhs:c)});let a={ignored:s,unignored:i};return o&&(a.rule=o),a}},dms=(t,e)=>{throw new e(t)},_T=(t,e,n)=>BSe(t)?t?_T.isNotRelative(t)?n(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${e}\``,TypeError),Fyn=t=>Zhs.test(t);_T.isNotRelative=Fyn;_T.convert=t=>t;var TXe=class{constructor({ignorecase:e=!0,ignoreCase:n=e,allowRelativePaths:r=!1}={}){_5(this,Myn,!0),this._rules=new wXe(n),this._strictPathCheck=!r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,n,r,s){let i=e&&_T.convert(e);return _T(i,e,this._strictPathCheck?dms:Lyn),this._t(i,n,r,s)}checkIgnore(e){if(!ems.test(e))return this.test(e);let n=e.split(b5).filter(Boolean);if(n.pop(),n.length){let r=this._t(n.join(b5)+b5,this._testCache,!0,n);if(r.ignored)return r}return this._rules.test(e,!1,DSe)}_t(e,n,r,s){if(e in n)return n[e];if(s||(s=e.split(b5).filter(Boolean)),s.pop(),!s.length)return n[e]=this._rules.test(e,r,UZ);let i=this._t(s.join(b5)+b5,n,r,s);return n[e]=i.ignored?i:this._rules.test(e,r,UZ)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return Pyn(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},vXe=t=>new TXe(t),pms=t=>_T(t&&_T.convert(t),t,Lyn),Qyn=()=>{let t=n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/");_T.convert=t;let e=/^[a-z]:\//i;_T.isNotRelative=n=>e.test(n)||Fyn(n)};typeof process<"u"&&process.platform==="win32"&&Qyn();PSe.exports=vXe;vXe.default=vXe;PSe.exports.isPathValid=pms;_5(PSe.exports,Symbol.for("setupWindows"),Qyn)});var vbn=ee((BHa,Tbn)=>{p();(()=>{var t={"./node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist lazy recursive"(s){function i(o){return Promise.resolve().then(function(){var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a})}i.keys=()=>[],i.resolve=i,i.id="./node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist lazy recursive",s.exports=i},fs(s){"use strict";s.exports=require("fs")},"node:fs"(s){"use strict";s.exports=require("node:fs")},"node:module"(s){"use strict";s.exports=require("node:module")},"node:path"(s){"use strict";s.exports=require("node:path")},os(s){"use strict";s.exports=require("os")},path(s){"use strict";s.exports=require("path")},"./node_modules/.pnpm/get-tsconfig@4.14.0/node_modules/get-tsconfig/dist/index.cjs"(s,i,o){"use strict";var a=Object.defineProperty,c=(Ne,$e)=>a(Ne,"name",{value:$e,configurable:!0}),u=o("node:path"),l=o("node:fs"),d=o("node:module"),h=o("./node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs"),m=o("fs"),f=o("os"),g=o("path");function A(Ne){return Ne.startsWith("\\\\?\\")?Ne:Ne.replace(/\\/g,"/")}c(A,"slash");let y=c(Ne=>{let $e=l[Ne];return(ct,...Ge)=>{let wt=`${Ne}:${Ge.join(":")}`,Ot=ct?.get(wt);return Ot===void 0&&(Ot=Reflect.apply($e,l,Ge),ct?.set(wt,Ot)),Ot}},"cacheFs"),b=y("existsSync"),S=y("readFileSync"),C=y("statSync"),I=c((Ne,$e,ct)=>{for(;;){let Ge=u.posix.join(Ne,$e);if(b(ct,Ge))return Ge;let wt=u.dirname(Ne);if(wt===Ne)return;Ne=wt}},"findUp"),x=/^\.{1,2}(\/.*)?$/,w=c(Ne=>{let $e=A(Ne);return x.test($e)?$e:`./${$e}`},"normalizeRelativePath");function R(Ne,$e=!1){let ct=Ne.length,Ge=0,wt="",Ot=0,Rt=16,yn=0,fn=0,bn=0,tr=0,Kn=0;function ns(hn,Xs){let lo=0,us=0;for(;lo=48&&Vn<=57)us=16*us+Vn-48;else if(Vn>=65&&Vn<=70)us=16*us+Vn-65+10;else{if(!(Vn>=97&&Vn<=102))break;us=16*us+Vn-97+10}Ge++,lo++}return lo=ct){hn+=Ne.substring(Xs,Ge),Kn=2;break}let lo=Ne.charCodeAt(Ge);if(lo===34){hn+=Ne.substring(Xs,Ge),Ge++;break}if(lo!==92){if(lo>=0&&lo<=31){if(P(lo)){hn+=Ne.substring(Xs,Ge),Kn=2;break}Kn=6}Ge++}else{if(hn+=Ne.substring(Xs,Ge),Ge++,Ge>=ct){Kn=2;break}switch(Ne.charCodeAt(Ge++)){case 34:hn+='"';break;case 92:hn+="\\";break;case 47:hn+="/";break;case 98:hn+="\b";break;case 102:hn+="\f";break;case 110:hn+=` -`;break;case 114:hn+="\r";break;case 116:hn+=" ";break;case 117:let us=ns(4);us>=0?hn+=String.fromCharCode(us):Kn=4;break;default:Kn=5}Xs=Ge}}return hn}function Ur(){if(wt="",Kn=0,Ot=Ge,fn=yn,tr=bn,Ge>=ct)return Ot=ct,Rt=17;let hn=Ne.charCodeAt(Ge);if(N(hn)){do Ge++,wt+=String.fromCharCode(hn),hn=Ne.charCodeAt(Ge);while(N(hn));return Rt=15}if(P(hn))return Ge++,wt+=String.fromCharCode(hn),hn===13&&Ne.charCodeAt(Ge)===10&&(Ge++,wt+=` -`),yn++,bn=Ge,Rt=14;switch(hn){case 123:return Ge++,Rt=1;case 125:return Ge++,Rt=2;case 91:return Ge++,Rt=3;case 93:return Ge++,Rt=4;case 58:return Ge++,Rt=6;case 44:return Ge++,Rt=5;case 34:return Ge++,wt=Jr(),Rt=10;case 47:let Xs=Ge-1;if(Ne.charCodeAt(Ge+1)===47){for(Ge+=2;Ge=12&&hn<=15);return hn}return c(ns,"scanHexDigits"),c(dn,"setPosition"),c(As,"scanNumber"),c(Jr,"scanString"),c(Ur,"scanNext"),c(bo,"isUnknownContentCharacter"),c(Ci,"scanNextNonTrivia"),{setPosition:dn,getPosition:c(()=>Ge,"getPosition"),scan:$e?Ci:Ur,getToken:c(()=>Rt,"getToken"),getTokenValue:c(()=>wt,"getTokenValue"),getTokenOffset:c(()=>Ot,"getTokenOffset"),getTokenLength:c(()=>Ge-Ot,"getTokenLength"),getTokenStartLine:c(()=>fn,"getTokenStartLine"),getTokenStartCharacter:c(()=>Ot-tr,"getTokenStartCharacter"),getTokenError:c(()=>Kn,"getTokenError")}}function N(Ne){return Ne===32||Ne===9}function P(Ne){return Ne===10||Ne===13}function G(Ne){return Ne>=48&&Ne<=57}var $,Q;c(R,"createScanner"),c(N,"isWhiteSpace"),c(P,"isLineBreak"),c(G,"isDigit"),(Q=$||($={}))[Q.lineFeed=10]="lineFeed",Q[Q.carriageReturn=13]="carriageReturn",Q[Q.space=32]="space",Q[Q._0=48]="_0",Q[Q._1=49]="_1",Q[Q._2=50]="_2",Q[Q._3=51]="_3",Q[Q._4=52]="_4",Q[Q._5=53]="_5",Q[Q._6=54]="_6",Q[Q._7=55]="_7",Q[Q._8=56]="_8",Q[Q._9=57]="_9",Q[Q.a=97]="a",Q[Q.b=98]="b",Q[Q.c=99]="c",Q[Q.d=100]="d",Q[Q.e=101]="e",Q[Q.f=102]="f",Q[Q.g=103]="g",Q[Q.h=104]="h",Q[Q.i=105]="i",Q[Q.j=106]="j",Q[Q.k=107]="k",Q[Q.l=108]="l",Q[Q.m=109]="m",Q[Q.n=110]="n",Q[Q.o=111]="o",Q[Q.p=112]="p",Q[Q.q=113]="q",Q[Q.r=114]="r",Q[Q.s=115]="s",Q[Q.t=116]="t",Q[Q.u=117]="u",Q[Q.v=118]="v",Q[Q.w=119]="w",Q[Q.x=120]="x",Q[Q.y=121]="y",Q[Q.z=122]="z",Q[Q.A=65]="A",Q[Q.B=66]="B",Q[Q.C=67]="C",Q[Q.D=68]="D",Q[Q.E=69]="E",Q[Q.F=70]="F",Q[Q.G=71]="G",Q[Q.H=72]="H",Q[Q.I=73]="I",Q[Q.J=74]="J",Q[Q.K=75]="K",Q[Q.L=76]="L",Q[Q.M=77]="M",Q[Q.N=78]="N",Q[Q.O=79]="O",Q[Q.P=80]="P",Q[Q.Q=81]="Q",Q[Q.R=82]="R",Q[Q.S=83]="S",Q[Q.T=84]="T",Q[Q.U=85]="U",Q[Q.V=86]="V",Q[Q.W=87]="W",Q[Q.X=88]="X",Q[Q.Y=89]="Y",Q[Q.Z=90]="Z",Q[Q.asterisk=42]="asterisk",Q[Q.backslash=92]="backslash",Q[Q.closeBrace=125]="closeBrace",Q[Q.closeBracket=93]="closeBracket",Q[Q.colon=58]="colon",Q[Q.comma=44]="comma",Q[Q.dot=46]="dot",Q[Q.doubleQuote=34]="doubleQuote",Q[Q.minus=45]="minus",Q[Q.openBrace=123]="openBrace",Q[Q.openBracket=91]="openBracket",Q[Q.plus=43]="plus",Q[Q.slash=47]="slash",Q[Q.formFeed=12]="formFeed",Q[Q.tab=9]="tab",new Array(20).fill(0).map((Ne,$e)=>" ".repeat($e));let H=200;var oe,re,Z;function q(Ne,$e=[],ct=oe.DEFAULT){let Ge=null,wt=[],Ot=[];function Rt(yn){Array.isArray(wt)?wt.push(yn):Ge!==null&&(wt[Ge]=yn)}return c(Rt,"onValue"),ce(Ne,{onObjectBegin:c(()=>{let yn={};Rt(yn),Ot.push(wt),wt=yn,Ge=null},"onObjectBegin"),onObjectProperty:c(yn=>{Ge=yn},"onObjectProperty"),onObjectEnd:c(()=>{wt=Ot.pop()},"onObjectEnd"),onArrayBegin:c(()=>{let yn=[];Rt(yn),Ot.push(wt),wt=yn,Ge=null},"onArrayBegin"),onArrayEnd:c(()=>{wt=Ot.pop()},"onArrayEnd"),onLiteralValue:Rt,onError:c((yn,fn,bn)=>{$e.push({error:yn,offset:fn,length:bn})},"onError")},ct),wt[0]}function ce(Ne,$e,ct=oe.DEFAULT){let Ge=R(Ne,!1),wt=[],Ot=0;function Rt(zt){return zt?()=>Ot===0&&zt(Ge.getTokenOffset(),Ge.getTokenLength(),Ge.getTokenStartLine(),Ge.getTokenStartCharacter()):()=>!0}function yn(zt){return zt?Jt=>Ot===0&&zt(Jt,Ge.getTokenOffset(),Ge.getTokenLength(),Ge.getTokenStartLine(),Ge.getTokenStartCharacter()):()=>!0}function fn(zt){return zt?Jt=>Ot===0&&zt(Jt,Ge.getTokenOffset(),Ge.getTokenLength(),Ge.getTokenStartLine(),Ge.getTokenStartCharacter(),()=>wt.slice()):()=>!0}function bn(zt){return zt?()=>{Ot>0?Ot++:zt(Ge.getTokenOffset(),Ge.getTokenLength(),Ge.getTokenStartLine(),Ge.getTokenStartCharacter(),()=>wt.slice())===!1&&(Ot=1)}:()=>!0}function tr(zt){return zt?()=>{Ot>0&&Ot--,Ot===0&&zt(Ge.getTokenOffset(),Ge.getTokenLength(),Ge.getTokenStartLine(),Ge.getTokenStartCharacter())}:()=>!0}c(Rt,"toNoArgVisit"),c(yn,"toOneArgVisit"),c(fn,"toOneArgVisitWithPath"),c(bn,"toBeginVisit"),c(tr,"toEndVisit");let Kn=bn($e.onObjectBegin),ns=fn($e.onObjectProperty),dn=tr($e.onObjectEnd),As=bn($e.onArrayBegin),Jr=tr($e.onArrayEnd),Ur=fn($e.onLiteralValue),bo=yn($e.onSeparator),Ci=Rt($e.onComment),hn=yn($e.onError),Xs=ct&&ct.disallowComments,lo=ct&&ct.allowTrailingComma;function us(){for(;;){let zt=Ge.scan();switch(Ge.getTokenError()){case 4:Vn(14);break;case 5:Vn(15);break;case 3:Vn(13);break;case 1:Xs||Vn(11);break;case 2:Vn(12);break;case 6:Vn(16)}switch(zt){case 12:case 13:Xs?Vn(10):Ci();break;case 16:Vn(1);break;case 15:case 14:break;default:return zt}}}function Vn(zt,Jt=[],Dn=[]){if(hn(zt),Jt.length+Dn.length>0){let $n=Ge.getToken();for(;$n!==17;){if(Jt.indexOf($n)!==-1){us();break}if(Dn.indexOf($n)!==-1)break;$n=us()}}}function Td(zt){let Jt=Ge.getTokenValue();return zt?Ur(Jt):(ns(Jt),wt.push(Jt)),us(),!0}function nd(){switch(Ge.getToken()){case 11:let zt=Ge.getTokenValue(),Jt=Number(zt);isNaN(Jt)&&(Vn(2),Jt=0),Ur(Jt);break;case 7:Ur(null);break;case 8:Ur(!0);break;case 9:Ur(!1);break;default:return!1}return us(),!0}function Ap(){return Ge.getToken()!==10?(Vn(3,[],[2,5]),!1):(Td(!1),Ge.getToken()===6?(bo(":"),us(),Ua()||Vn(4,[],[2,5])):Vn(5,[],[2,5]),wt.pop(),!0)}function rd(){Kn(),us();let zt=!1;for(;Ge.getToken()!==2&&Ge.getToken()!==17;){if(Ge.getToken()===5){if(zt||Vn(4,[],[]),bo(","),us(),Ge.getToken()===2&&lo)break}else zt&&Vn(6,[],[]);Ap()||Vn(4,[],[2,5]),zt=!0}return dn(),Ge.getToken()!==2?Vn(7,[2],[]):us(),!0}function yp(){As(),us();let zt=!0,Jt=!1;for(;Ge.getToken()!==4&&Ge.getToken()!==17;){if(Ge.getToken()===5){if(Jt||Vn(4,[],[]),bo(","),us(),Ge.getToken()===4&&lo)break}else Jt&&Vn(6,[],[]);zt?(wt.push(0),zt=!1):wt[wt.length-1]++,Ua()||Vn(4,[],[4,5]),Jt=!0}return Jr(),zt||wt.pop(),Ge.getToken()!==4?Vn(8,[4],[]):us(),!0}function Ua(){switch(Ge.getToken()){case 3:return yp();case 1:return rd();case 10:return Td(!0);default:return nd()}}return c(us,"scanNext"),c(Vn,"handleError"),c(Td,"parseString"),c(nd,"parseLiteral"),c(Ap,"parseProperty"),c(rd,"parseObject"),c(yp,"parseArray"),c(Ua,"parseValue"),us(),Ge.getToken()===17?!!ct.allowEmptyContent||(Vn(4,[],[]),!1):Ua()?(Ge.getToken()!==17&&Vn(9,[],[]),!0):(Vn(4,[],[]),!1)}new Array(H).fill(0).map((Ne,$e)=>` -`+" ".repeat($e)),new Array(H).fill(0).map((Ne,$e)=>"\r"+" ".repeat($e)),new Array(H).fill(0).map((Ne,$e)=>`\r -`+" ".repeat($e)),new Array(H).fill(0).map((Ne,$e)=>` -`+" ".repeat($e)),new Array(H).fill(0).map((Ne,$e)=>"\r"+" ".repeat($e)),new Array(H).fill(0).map((Ne,$e)=>`\r -`+" ".repeat($e)),(function(Ne){Ne.DEFAULT={allowTrailingComma:!1}})(oe||(oe={})),c(q,"parse$1"),c(ce,"visit"),(function(Ne){Ne[Ne.None=0]="None",Ne[Ne.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",Ne[Ne.UnexpectedEndOfString=2]="UnexpectedEndOfString",Ne[Ne.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",Ne[Ne.InvalidUnicode=4]="InvalidUnicode",Ne[Ne.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",Ne[Ne.InvalidCharacter=6]="InvalidCharacter"})(re||(re={})),(function(Ne){Ne[Ne.OpenBraceToken=1]="OpenBraceToken",Ne[Ne.CloseBraceToken=2]="CloseBraceToken",Ne[Ne.OpenBracketToken=3]="OpenBracketToken",Ne[Ne.CloseBracketToken=4]="CloseBracketToken",Ne[Ne.CommaToken=5]="CommaToken",Ne[Ne.ColonToken=6]="ColonToken",Ne[Ne.NullKeyword=7]="NullKeyword",Ne[Ne.TrueKeyword=8]="TrueKeyword",Ne[Ne.FalseKeyword=9]="FalseKeyword",Ne[Ne.StringLiteral=10]="StringLiteral",Ne[Ne.NumericLiteral=11]="NumericLiteral",Ne[Ne.LineCommentTrivia=12]="LineCommentTrivia",Ne[Ne.BlockCommentTrivia=13]="BlockCommentTrivia",Ne[Ne.LineBreakTrivia=14]="LineBreakTrivia",Ne[Ne.Trivia=15]="Trivia",Ne[Ne.Unknown=16]="Unknown",Ne[Ne.EOF=17]="EOF"})(Z||(Z={}));let be=q;var Be;(function(Ne){Ne[Ne.InvalidSymbol=1]="InvalidSymbol",Ne[Ne.InvalidNumberFormat=2]="InvalidNumberFormat",Ne[Ne.PropertyNameExpected=3]="PropertyNameExpected",Ne[Ne.ValueExpected=4]="ValueExpected",Ne[Ne.ColonExpected=5]="ColonExpected",Ne[Ne.CommaExpected=6]="CommaExpected",Ne[Ne.CloseBraceExpected=7]="CloseBraceExpected",Ne[Ne.CloseBracketExpected=8]="CloseBracketExpected",Ne[Ne.EndOfFileExpected=9]="EndOfFileExpected",Ne[Ne.InvalidCommentToken=10]="InvalidCommentToken",Ne[Ne.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",Ne[Ne.UnexpectedEndOfString=12]="UnexpectedEndOfString",Ne[Ne.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",Ne[Ne.InvalidUnicode=14]="InvalidUnicode",Ne[Ne.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",Ne[Ne.InvalidCharacter=16]="InvalidCharacter"})(Be||(Be={}));let Me=c((Ne,$e)=>be(S($e,Ne,"utf8")),"readJsonc"),Re=Symbol("implicitBaseUrl"),se="${configDir}",ie=c(()=>{let{findPnpApi:Ne}=d;return Ne&&Ne(process.cwd())},"getPnpApi"),ne=c((Ne,$e,ct,Ge)=>{let wt=`resolveFromPackageJsonPath:${Ne}:${$e}:${ct}`;if(Ge!=null&&Ge.has(wt))return Ge.get(wt);let Ot=Me(Ne,Ge);if(!Ot)return;let Rt=$e||"tsconfig.json";if(!ct&&Ot.exports)try{let[yn]=h.resolveExports(Ot.exports,$e,["require","types"]);Rt=yn}catch{return!1}else!$e&&Ot.tsconfig&&(Rt=Ot.tsconfig);return Rt=u.join(Ne,"..",Rt),Ge?.set(wt,Rt),Rt},"resolveFromPackageJsonPath"),J="package.json",te="tsconfig.json",j=c((Ne,$e,ct)=>{let Ge=Ne;if(Ne===".."&&(Ge=u.join(Ge,te)),Ne[0]==="."&&(Ge=u.resolve($e,Ge)),u.isAbsolute(Ge)){if(b(ct,Ge)){if(C(ct,Ge).isFile())return Ge}else if(!Ge.endsWith(".json")){let dn=`${Ge}.json`;if(b(ct,dn))return dn}return}let[wt,...Ot]=Ne.split("/"),Rt=wt[0]==="@"?`${wt}/${Ot.shift()}`:wt,yn=Ot.join("/"),fn=ie();if(fn){let{resolveRequest:dn}=fn;try{if(Rt===Ne){let As=dn(u.join(Rt,J),$e);if(As){let Jr=ne(As,yn,!1,ct);if(Jr&&b(ct,Jr))return Jr}}else{let As;try{As=dn(Ne,$e,{extensions:[".json"]})}catch{As=dn(u.join(Ne,te),$e)}if(As)return As}}catch{}}let bn=I(u.resolve($e),u.join("node_modules",Rt),ct);if(!bn||!C(ct,bn).isDirectory())return;let tr=u.join(bn,J);if(b(ct,tr)){let dn=ne(tr,yn,!1,ct);if(dn===!1)return;if(dn&&b(ct,dn)&&C(ct,dn).isFile())return dn}let Kn=u.join(bn,yn),ns=Kn.endsWith(".json");if(!ns){let dn=`${Kn}.json`;if(b(ct,dn))return dn}if(b(ct,Kn)){if(C(ct,Kn).isDirectory()){let dn=u.join(Kn,J);if(b(ct,dn)){let Jr=ne(dn,"",!0,ct);if(Jr&&b(ct,Jr))return Jr}let As=u.join(Kn,te);if(b(ct,As))return As}else if(ns)return Kn}},"resolveExtendsPath"),X=c((Ne,$e)=>w(u.relative(Ne,$e)),"pathRelative"),ae=["files","include","exclude"],me=c((Ne,$e,ct)=>{let Ge=u.join($e,ct);return A(u.relative(Ne,Ge))||"./"},"resolveAndRelativize"),Ae=c((Ne,$e,ct)=>{let Ge=u.relative(Ne,$e);return Ge?A(`${Ge}/${ct.startsWith("./")?ct.slice(2):ct}`):ct},"prefixPattern"),ue=c((Ne,$e,ct,Ge)=>{let wt=j(Ne,$e,Ge);if(!wt)throw new Error(`File '${Ne}' not found.`);if(ct.has(wt))throw new Error(`Circularity detected while resolving configuration: ${wt}`);ct.add(wt);let Ot=u.dirname(wt),Rt=Ie(wt,Ge,ct);delete Rt.references;let{compilerOptions:yn}=Rt;if(yn){let{baseUrl:fn}=yn;fn&&!fn.startsWith(se)&&(yn.baseUrl=me($e,Ot,fn));let{outDir:bn}=yn;bn&&!bn.startsWith(se)&&(yn.outDir=me($e,Ot,bn));let{declarationDir:tr}=yn;tr&&!tr.startsWith(se)&&(yn.declarationDir=me($e,Ot,tr));let{rootDir:Kn}=yn;Kn&&!Kn.startsWith(se)&&(yn.rootDir=me($e,Ot,Kn));let{rootDirs:ns}=yn;ns&&(yn.rootDirs=ns.map(As=>As.startsWith(se)?As:me($e,Ot,As)));let{typeRoots:dn}=yn;dn&&(yn.typeRoots=dn.map(As=>As.startsWith(se)?As:me($e,Ot,As)))}for(let fn of ae){let bn=Rt[fn];bn&&(Rt[fn]=bn.map(tr=>tr.startsWith(se)?tr:Ae($e,Ot,tr)))}return Rt},"resolveExtends"),ye=["outDir","declarationDir"],Ie=c((Ne,$e,ct=new Set)=>{let Ge;try{Ge=Me(Ne,$e)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${Ne}`)}if(typeof Ge!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${Ne}`);let wt=u.dirname(Ne);if(Ge.compilerOptions){let{compilerOptions:Ot}=Ge;Ot.paths&&!Ot.baseUrl&&(Ot[Re]=wt)}if(Ge.extends){let Ot=Array.isArray(Ge.extends)?Ge.extends:[Ge.extends];delete Ge.extends;for(let Rt of Ot.reverse()){let yn=ue(Rt,wt,new Set(ct),$e),fn={...yn,...Ge,compilerOptions:{...yn.compilerOptions,...Ge.compilerOptions}};yn.watchOptions&&(fn.watchOptions={...yn.watchOptions,...Ge.watchOptions}),Ge=fn}}if(Ge.compilerOptions){let{compilerOptions:Ot}=Ge,Rt=["baseUrl","rootDir"];for(let yn of Rt){let fn=Ot[yn];if(fn&&!fn.startsWith(se)){let bn=u.resolve(wt,fn),tr=X(wt,bn);Ot[yn]=tr}}for(let yn of ye){let fn=Ot[yn];fn&&(Array.isArray(Ge.exclude)||(Ge.exclude=ye.map(bn=>Ot[bn]).filter(Boolean)),fn.startsWith(se)||(fn=w(fn)),Ot[yn]=fn)}}else Ge.compilerOptions={};if(Ge.include&&(Ge.include=Ge.include.map(A)),Ge.files&&(Ge.files=Ge.files.map(Ot=>Ot.startsWith(se)?Ot:w(Ot))),Ge.watchOptions){let{watchOptions:Ot}=Ge;Ot.excludeDirectories&&(Ot.excludeDirectories=Ot.excludeDirectories.map(Rt=>A(u.resolve(wt,Rt)))),Ot.excludeFiles&&(Ot.excludeFiles=Ot.excludeFiles.map(Rt=>A(u.resolve(wt,Rt)))),Ot.watchFile&&(Ot.watchFile=Ot.watchFile.toLowerCase()),Ot.watchDirectory&&(Ot.watchDirectory=Ot.watchDirectory.toLowerCase()),Ot.fallbackPolling&&(Ot.fallbackPolling=Ot.fallbackPolling.toLowerCase())}return Ge},"_parseTsconfig"),Ee=c((Ne,$e)=>{if(Ne.startsWith(se))return A(u.join($e,Ne.slice(12)))},"interpolateConfigDir"),Te=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],_e=c(Ne=>{if(Ne.strict){let $e=["noImplicitAny","noImplicitThis","strictNullChecks","strictFunctionTypes","strictBindCallApply","strictPropertyInitialization","strictBuiltinIteratorReturn","alwaysStrict","useUnknownInCatchVariables"];for(let ct of $e)Ne[ct]===void 0&&(Ne[ct]=!0)}if(Ne.composite&&(Ne.declaration!=null||(Ne.declaration=!0),Ne.incremental!=null||(Ne.incremental=!0)),Ne.target){let $e=Ne.target.toLowerCase();$e==="es2015"&&($e="es6"),Ne.target=$e,$e==="esnext"&&(Ne.module!=null||(Ne.module="es6"),Ne.useDefineForClassFields!=null||(Ne.useDefineForClassFields=!0)),($e==="es6"||$e==="es2016"||$e==="es2017"||$e==="es2018"||$e==="es2019"||$e==="es2020"||$e==="es2021"||$e==="es2022"||$e==="es2023"||$e==="es2024")&&(Ne.module!=null||(Ne.module="es6")),($e==="es2022"||$e==="es2023"||$e==="es2024")&&(Ne.useDefineForClassFields!=null||(Ne.useDefineForClassFields=!0))}if(Ne.module){let $e=Ne.module.toLowerCase();if($e==="es2015"&&($e="es6"),Ne.module=$e,($e==="es6"||$e==="es2020"||$e==="es2022"||$e==="esnext"||$e==="none"||$e==="system"||$e==="umd"||$e==="amd")&&(Ne.moduleResolution!=null||(Ne.moduleResolution="classic")),$e==="system"&&(Ne.allowSyntheticDefaultImports!=null||(Ne.allowSyntheticDefaultImports=!0)),($e==="node16"||$e==="node18"||$e==="node20"||$e==="nodenext"||$e==="preserve")&&(Ne.esModuleInterop!=null||(Ne.esModuleInterop=!0),Ne.allowSyntheticDefaultImports!=null||(Ne.allowSyntheticDefaultImports=!0)),($e==="node16"||$e==="node18"||$e==="node20"||$e==="nodenext")&&(Ne.moduleDetection!=null||(Ne.moduleDetection="force")),$e==="node16"&&(Ne.target!=null||(Ne.target="es2022"),Ne.moduleResolution!=null||(Ne.moduleResolution="node16")),$e==="node18"&&(Ne.target!=null||(Ne.target="es2022"),Ne.moduleResolution!=null||(Ne.moduleResolution="node16")),$e==="node20"&&(Ne.target!=null||(Ne.target="es2023"),Ne.moduleResolution!=null||(Ne.moduleResolution="node16"),Ne.resolveJsonModule!=null||(Ne.resolveJsonModule=!0)),$e==="nodenext"&&(Ne.target!=null||(Ne.target="esnext"),Ne.moduleResolution!=null||(Ne.moduleResolution="nodenext"),Ne.resolveJsonModule!=null||(Ne.resolveJsonModule=!0)),$e==="node16"||$e==="node18"||$e==="node20"||$e==="nodenext"){let ct=Ne.target;(ct==="es3"||ct==="es2022"||ct==="es2023"||ct==="es2024"||ct==="esnext")&&(Ne.useDefineForClassFields!=null||(Ne.useDefineForClassFields=!0))}$e==="preserve"&&(Ne.moduleResolution!=null||(Ne.moduleResolution="bundler"))}if(Ne.moduleResolution){let $e=Ne.moduleResolution.toLowerCase();$e==="node"&&($e="node10"),Ne.moduleResolution=$e,($e==="node16"||$e==="nodenext"||$e==="bundler")&&(Ne.resolvePackageJsonExports!=null||(Ne.resolvePackageJsonExports=!0),Ne.resolvePackageJsonImports!=null||(Ne.resolvePackageJsonImports=!0)),$e==="bundler"&&(Ne.allowSyntheticDefaultImports!=null||(Ne.allowSyntheticDefaultImports=!0),Ne.resolveJsonModule!=null||(Ne.resolveJsonModule=!0))}Ne.jsx&&(Ne.jsx=Ne.jsx.toLowerCase()),Ne.moduleDetection&&(Ne.moduleDetection=Ne.moduleDetection.toLowerCase()),Ne.importsNotUsedAsValues&&(Ne.importsNotUsedAsValues=Ne.importsNotUsedAsValues.toLowerCase()),Ne.newLine&&(Ne.newLine=Ne.newLine.toLowerCase()),Ne.esModuleInterop&&(Ne.allowSyntheticDefaultImports!=null||(Ne.allowSyntheticDefaultImports=!0)),Ne.verbatimModuleSyntax&&(Ne.isolatedModules!=null||(Ne.isolatedModules=!0),Ne.preserveConstEnums!=null||(Ne.preserveConstEnums=!0)),Ne.isolatedModules&&(Ne.preserveConstEnums!=null||(Ne.preserveConstEnums=!0)),Ne.rewriteRelativeImportExtensions&&(Ne.allowImportingTsExtensions!=null||(Ne.allowImportingTsExtensions=!0)),Ne.lib&&(Ne.lib=Ne.lib.map($e=>$e.toLowerCase())),Ne.checkJs&&(Ne.allowJs!=null||(Ne.allowJs=!0))},"normalizeCompilerOptions"),z=c((Ne,$e=new Map)=>{let ct=u.resolve(Ne),Ge=Ie(ct,$e),wt=u.dirname(ct),{compilerOptions:Ot}=Ge;if(Ot){for(let yn of Te){let fn=Ot[yn];if(fn){let bn=Ee(fn,wt);Ot[yn]=bn?X(wt,bn):fn}}for(let yn of["rootDirs","typeRoots"]){let fn=Ot[yn];fn&&(Ot[yn]=fn.map(bn=>{let tr=Ee(bn,wt);return tr?X(wt,tr):w(bn)}))}let{paths:Rt}=Ot;if(Rt)for(let yn of Object.keys(Rt))Rt[yn]=Rt[yn].map(fn=>{var bn;return(bn=Ee(fn,wt))!=null?bn:fn});_e(Ot)}for(let Rt of ae){let yn=Ge[Rt];yn&&(Ge[Rt]=yn.map(fn=>{var bn;return(bn=Ee(fn,wt))!=null?bn:fn}))}return Ge},"parseTsconfig");var We=Object.defineProperty,He=c((Ne,$e)=>We(Ne,"name",{value:$e,configurable:!0}),"s");let dt=He(Ne=>{let $e="";for(let ct=0;ct{let ct=g.join(Ne,`.is-fs-case-sensitive-test-${process.pid}`);try{return $e.writeFileSync(ct,""),!$e.existsSync(dt(ct))}finally{try{$e.unlinkSync(ct)}catch{}}},"checkDirectoryCaseWithWrite"),rt=He((Ne,$e,ct)=>{try{return ze(Ne,ct)}catch(Ge){if($e===void 0)return ze(f.tmpdir(),ct);throw Ge}},"checkDirectoryCaseWithFallback"),Ct=He((Ne,$e=m,ct=!0)=>{let Ge=Ne??process.cwd();if(ct&&it.has(Ge))return it.get(Ge);let wt,Ot=dt(Ge);return wt=Ot!==Ge&&$e.existsSync(Ge)?!$e.existsSync(Ot):rt(Ge,Ne,$e),ct&&it.set(Ge,wt),wt},"isFsCaseSensitive"),{join:sn}=u.posix,Mt={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Lt=c(Ne=>{let $e=[...Mt.ts],ct=[...Mt.cts],Ge=[...Mt.mts];return Ne!=null&&Ne.allowJs&&($e.push(".js",".jsx"),ct.push(".cjs"),Ge.push(".mjs")),[...$e,...ct,...Ge]},"getSupportedExtensions"),Pt=c(Ne=>{let $e=[];if(!Ne)return $e;let{outDir:ct,declarationDir:Ge}=Ne;return ct&&$e.push(ct),Ge&&$e.push(Ge),$e},"getDefaultExcludeSpec"),Ze=c(Ne=>Ne.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),Pe=`(?!(${["node_modules","bower_components","jspm_packages"].join("|")})(/|$))`,Xe=/(?:^|\/)[^.*?]+$/,At="**/*",Vt="[^/]",un="[^./]",mn=process.platform==="win32",Mn=c(({config:Ne,path:$e},ct=Ct())=>{if("extends"in Ne)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!u.isAbsolute($e))throw new Error("The tsconfig path must be absolute");mn&&($e=A($e));let Ge=u.dirname($e),{files:wt,include:Ot,exclude:Rt,compilerOptions:yn}=Ne,fn=c(Jr=>u.isAbsolute(Jr)?Jr:sn(Ge,Jr),"resolvePattern"),bn=wt?.map(fn),tr=Lt(yn),Kn=ct?"":"i",ns=(Rt||Pt(yn)).map(Jr=>{let Ur=fn(Jr),bo=Ze(Ur).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${Vt}*`).replaceAll(String.raw`\?`,Vt);return new RegExp(`^${bo}($|/)`,Kn)}),dn=wt||Ot?Ot:[At],As=dn?dn.map(Jr=>{let Ur=fn(Jr);Xe.test(Ur)&&(Ur=sn(Ur,At));let bo=Ze(Ur).replaceAll(String.raw`/\*\*`,`(/${Pe}${un}${Vt}*)*?`).replaceAll(/(\/)?\\\*/g,(Ci,hn)=>{let Xs=`(${un}|(\\.(?!min\\.js$))?)*`;return hn?`/${Pe}${un}${Xs}`:Xs}).replaceAll(/(\/)?\\\?/g,(Ci,hn)=>hn?`/${Pe}${Vt}`:Vt);return new RegExp(`^${bo}$`,Kn)}):void 0;return Jr=>{if(!u.isAbsolute(Jr))throw new Error("filePath must be absolute");return mn&&(Jr=A(Jr)),bn!=null&&bn.includes(Jr)||tr.some(Ur=>Jr.endsWith(Ur))&&!ns.some(Ur=>Ur.test(Jr))&&As&&As.some(Ur=>Ur.test(Jr))?Ne:void 0}},"createFilesMatcher"),Ve=c((Ne,$e,ct)=>{let Ge=u.resolve(Ne),wt=A(Ne);for(;;){let Ot=I(wt,$e,ct);if(!Ot)return;let Rt=u.resolve(Ot),yn=z(Rt,ct),fn={path:A(Rt),config:yn};if(Mn(fn)(Ge))return fn;let bn=u.dirname(Ot),tr=u.dirname(bn);if(tr===bn)return;wt=tr}},"findConfigApplicable"),pt=c((Ne=process.cwd(),$e="tsconfig.json",ct=new Map,Ge=!1)=>{var wt;return Ge?(wt=Ve(Ne,$e,ct))==null?void 0:wt.path:I(A(Ne),$e,ct)},"findTsconfig"),Xt=c((Ne=process.cwd(),$e="tsconfig.json",ct=new Map,Ge=!1)=>{var wt;if(!Ge){let Ot=pt(Ne,$e,ct);return Ot?{path:Ot,config:z(Ot,ct)}:null}return(wt=Ve(Ne,$e,ct))!=null?wt:null},"getTsconfig"),et=/\*/g,ut=c((Ne,$e)=>{let ct=Ne.match(et);if(ct&&ct.length>1)throw new Error($e)},"assertStarCount"),mt=c(Ne=>{if(Ne.includes("*")){let[$e,ct]=Ne.split("*");return{prefix:$e,suffix:ct}}return Ne},"parsePattern"),tt=c(({prefix:Ne,suffix:$e},ct)=>ct.startsWith(Ne)&&ct.endsWith($e),"isPatternMatch"),Dt=c((Ne,$e,ct)=>Object.entries(Ne).map(([Ge,wt])=>(ut(Ge,`Pattern '${Ge}' can have at most one '*' character.`),{pattern:mt(Ge),substitutions:wt.map(Ot=>{if(ut(Ot,`Substitution '${Ot}' in pattern '${Ge}' can have at most one '*' character.`),!$e&&!x.test(Ot)&&!u.isAbsolute(Ot))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return u.resolve(ct,Ot)})})),"parsePaths"),Zt=c(Ne=>{let{compilerOptions:$e}=Ne.config;if(!$e)return null;let{baseUrl:ct,paths:Ge}=$e;if(!ct&&!Ge)return null;let wt=Re in $e&&$e[Re],Ot=u.resolve(u.dirname(Ne.path),ct||wt||"."),Rt=Ge?Dt(Ge,ct,Ot):[];return yn=>{if(x.test(yn))return[];let fn=[];for(let ns of Rt){if(ns.pattern===yn)return ns.substitutions.map(A);typeof ns.pattern!="string"&&fn.push(ns)}let bn,tr=-1;for(let ns of fn)tt(ns.pattern,yn)&&ns.pattern.prefix.length>tr&&(tr=ns.pattern.prefix.length,bn=ns);if(!bn)return ct?[A(u.join(Ot,yn))]:[];let Kn=yn.slice(bn.pattern.prefix.length,yn.length-bn.pattern.suffix.length);return bn.substitutions.map(ns=>A(ns.replace("*",Kn)))}},"createPathsMatcher");i.createPathsMatcher=Zt,i.getTsconfig=Xt},"./node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs"(s,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});let o=C=>C!==null&&typeof C=="object",a=(C,I)=>Object.assign(new Error(`[${C}]: ${I}`),{code:C}),c="ERR_INVALID_PACKAGE_CONFIG",u="ERR_INVALID_PACKAGE_TARGET",l=/^\d+$/,d=/^(\.{1,2}|node_modules)$/i,h=/\/|\\/;var m,f=((m=f||{}).Export="exports",m.Import="imports",m);let g=(C,I,x,w,R)=>{if(I==null)return[];if(typeof I=="string"){let[N,...P]=I.split(h);if(N===".."||P.some(G=>d.test(G)))throw a(u,`Invalid "${C}" target "${I}" defined in the package config`);return[R?I.replace(/\*/g,R):I]}if(Array.isArray(I))return I.flatMap(N=>g(C,N,x,w,R));if(o(I)){for(let N of Object.keys(I)){if(l.test(N))throw a(c,"Cannot contain numeric property keys");if(N==="default"||w.includes(N))return g(C,I[N],x,w,R)}return[]}throw a(u,`Invalid "${C}" target "${I}"`)},A="*",y=(C,I)=>{let x=C.indexOf(A),w=I.indexOf(A);return x===w?I.length>C.length:w>x};function b(C,I){if(!I.includes(A)&&C.hasOwnProperty(I))return[I];let x,w;for(let R of Object.keys(C))if(R.includes(A)){let[N,P,G]=R.split(A);if(G===void 0&&I.startsWith(N)&&I.endsWith(P)){let $=I.slice(N.length,-P.length||void 0);$&&(!x||y(x,R))&&(x=R,w=$)}}return[x,w]}let S=/^\w+:/;i.resolveExports=(C,I,x)=>{if(!C)throw new Error('"exports" is required');I=I===""?".":`./${I}`,(typeof C=="string"||Array.isArray(C)||o(C)&&(P=>Object.keys(P).reduce((G,$)=>{let Q=$===""||$[0]!==".";if(G===void 0||G===Q)return Q;throw a(c,'"exports" cannot contain some keys starting with "." and some not')},void 0))(C))&&(C={".":C});let[w,R]=b(C,I),N=g(f.Export,C[w],I,x,R);if(N.length===0)throw a("ERR_PACKAGE_PATH_NOT_EXPORTED",I==="."?'No "exports" main defined':`Package subpath '${I}' is not defined by "exports"`);for(let P of N)if(!P.startsWith("./")&&!S.test(P))throw a(u,`Invalid "exports" target "${P}" defined in the package config`);return N},i.resolveImports=(C,I,x)=>{if(!C)throw new Error('"imports" is required');let[w,R]=b(C,I),N=g(f.Import,C[w],I,x,R);if(N.length===0)throw a("ERR_PACKAGE_IMPORT_NOT_DEFINED",`Package import specifier "${I}" is not defined in package`);return N}}},e={};function n(s){var i=e[s];if(i!==void 0)return i.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,n),o.exports}n.n=s=>{var i=s&&s.__esModule?()=>s.default:()=>s;return n.d(i,{a:i}),i},n.d=(s,i)=>{for(var o in i)n.o(i,o)&&!n.o(s,o)&&Object.defineProperty(s,o,{enumerable:!0,get:i[o]})},n.o=(s,i)=>Object.prototype.hasOwnProperty.call(s,i);var r={};(()=>{"use strict";n.d(r,{default:()=>X0});let s=require("node:os");var i=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],o=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],a="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",c={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},u="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",l={5:u,"5module":u+" export import",6:u+" const class extends export import super"},d=/^in(stanceof)?$/,h=new RegExp("["+a+"]"),m=new RegExp("["+a+"\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]");function f(T,M){for(var Y=65536,de=0;deT)return!1;if((Y+=M[de+1])>=T)return!0}return!1}function g(T,M){return T<65?T===36:T<91||(T<97?T===95:T<123||(T<=65535?T>=170&&h.test(String.fromCharCode(T)):M!==!1&&f(T,o)))}function A(T,M){return T<48?T===36:T<58||!(T<65)&&(T<91||(T<97?T===95:T<123||(T<=65535?T>=170&&m.test(String.fromCharCode(T)):M!==!1&&(f(T,o)||f(T,i)))))}var y=function(T,M){M===void 0&&(M={}),this.label=T,this.keyword=M.keyword,this.beforeExpr=!!M.beforeExpr,this.startsExpr=!!M.startsExpr,this.isLoop=!!M.isLoop,this.isAssign=!!M.isAssign,this.prefix=!!M.prefix,this.postfix=!!M.postfix,this.binop=M.binop||null,this.updateContext=null};function b(T,M){return new y(T,{beforeExpr:!0,binop:M})}var S={beforeExpr:!0},C={startsExpr:!0},I={};function x(T,M){return M===void 0&&(M={}),M.keyword=T,I[T]=new y(T,M)}var w={num:new y("num",C),regexp:new y("regexp",C),string:new y("string",C),name:new y("name",C),privateId:new y("privateId",C),eof:new y("eof"),bracketL:new y("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new y("]"),braceL:new y("{",{beforeExpr:!0,startsExpr:!0}),braceR:new y("}"),parenL:new y("(",{beforeExpr:!0,startsExpr:!0}),parenR:new y(")"),comma:new y(",",S),semi:new y(";",S),colon:new y(":",S),dot:new y("."),question:new y("?",S),questionDot:new y("?."),arrow:new y("=>",S),template:new y("template"),invalidTemplate:new y("invalidTemplate"),ellipsis:new y("...",S),backQuote:new y("`",C),dollarBraceL:new y("${",{beforeExpr:!0,startsExpr:!0}),eq:new y("=",{beforeExpr:!0,isAssign:!0}),assign:new y("_=",{beforeExpr:!0,isAssign:!0}),incDec:new y("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new y("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:b("||",1),logicalAND:b("&&",2),bitwiseOR:b("|",3),bitwiseXOR:b("^",4),bitwiseAND:b("&",5),equality:b("==/!=/===/!==",6),relational:b("/<=/>=",7),bitShift:b("<>/>>>",8),plusMin:new y("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:b("%",10),star:b("*",10),slash:b("/",10),starstar:new y("**",{beforeExpr:!0}),coalesce:b("??",1),_break:x("break"),_case:x("case",S),_catch:x("catch"),_continue:x("continue"),_debugger:x("debugger"),_default:x("default",S),_do:x("do",{isLoop:!0,beforeExpr:!0}),_else:x("else",S),_finally:x("finally"),_for:x("for",{isLoop:!0}),_function:x("function",C),_if:x("if"),_return:x("return",S),_switch:x("switch"),_throw:x("throw",S),_try:x("try"),_var:x("var"),_const:x("const"),_while:x("while",{isLoop:!0}),_with:x("with"),_new:x("new",{beforeExpr:!0,startsExpr:!0}),_this:x("this",C),_super:x("super",C),_class:x("class",C),_extends:x("extends",S),_export:x("export"),_import:x("import",C),_null:x("null",C),_true:x("true",C),_false:x("false",C),_in:x("in",{beforeExpr:!0,binop:7}),_instanceof:x("instanceof",{beforeExpr:!0,binop:7}),_typeof:x("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:x("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:x("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},R=/\r\n?|\n|\u2028|\u2029/,N=new RegExp(R.source,"g");function P(T){return T===10||T===13||T===8232||T===8233}function G(T,M,Y){Y===void 0&&(Y=T.length);for(var de=M;de>10),56320+(1023&T)))}var Me=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Re=function(T,M){this.line=T,this.column=M};Re.prototype.offset=function(T){return new Re(this.line,this.column+T)};var se=function(T,M,Y){this.start=M,this.end=Y,T.sourceFile!==null&&(this.source=T.sourceFile)};function ie(T,M){for(var Y=1,de=0;;){var ke=G(T,de,M);if(ke<0)return new Re(Y,M-de);++Y,de=ke}}var ne={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},J=!1;function te(T){var M={};for(var Y in ne)M[Y]=T&&Z(T,Y)?T[Y]:ne[Y];if(M.ecmaVersion==="latest"?M.ecmaVersion=1e8:M.ecmaVersion==null?(!J&&typeof console=="object"&&console.warn&&(J=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. -Defaulting to 2020, but this will stop working in the future.`)),M.ecmaVersion=11):M.ecmaVersion>=2015&&(M.ecmaVersion-=2009),M.allowReserved==null&&(M.allowReserved=M.ecmaVersion<5),T&&T.allowHashBang!=null||(M.allowHashBang=M.ecmaVersion>=14),q(M.onToken)){var de=M.onToken;M.onToken=function(ke){return de.push(ke)}}if(q(M.onComment)&&(M.onComment=(function(ke,je){return function(Je,ot,Qt,cn,rn,Bn){var Cn={type:Je?"Block":"Line",value:ot,start:Qt,end:cn};ke.locations&&(Cn.loc=new se(this,rn,Bn)),ke.ranges&&(Cn.range=[Qt,cn]),je.push(Cn)}})(M,M.onComment)),M.sourceType==="commonjs"&&M.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return M}var j=256,X=259;function ae(T,M){return 2|(T?4:0)|(M?8:0)}var me=function(T,M,Y){this.options=T=te(T),this.sourceFile=T.sourceFile,this.keywords=be(l[T.ecmaVersion>=6?6:T.sourceType==="module"?"5module":5]);var de="";T.allowReserved!==!0&&(de=c[T.ecmaVersion>=6?6:T.ecmaVersion===5?5:3],T.sourceType==="module"&&(de+=" await")),this.reservedWords=be(de);var ke=(de?de+" ":"")+c.strict;this.reservedWordsStrict=be(ke),this.reservedWordsStrictBind=be(ke+" "+c.strictBind),this.input=String(M),this.containsEsc=!1,Y?(this.pos=Y,this.lineStart=this.input.lastIndexOf(` -`,Y-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(R).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=w.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=T.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&T.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?2:1),this.regexpState=null,this.privateNameStack=[]},Ae={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};me.prototype.parse=function(){var T=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(T)},Ae.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},Ae.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},Ae.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},Ae.canAwait.get=function(){for(var T=this.scopeStack.length-1;T>=0;T--){var M=this.scopeStack[T].flags;if(768&M)return!1;if(2&M)return(4&M)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ae.allowReturn.get=function(){return!!this.inFunction||!!(this.options.allowReturnOutsideFunction&&1&this.currentVarScope().flags)},Ae.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},Ae.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},Ae.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ae.allowNewDotTarget.get=function(){for(var T=this.scopeStack.length-1;T>=0;T--){var M=this.scopeStack[T].flags;if(768&M||2&M&&!(16&M))return!0}return!1},Ae.allowUsing.get=function(){var T=this.currentScope().flags;return!(1024&T)&&!(!this.inModule&&1&T)},Ae.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&j)>0},me.extend=function(){for(var T=[],M=arguments.length;M--;)T[M]=arguments[M];for(var Y=this,de=0;de=,?^&]/.test(ke)||ke==="!"&&this.input.charAt(de+1)==="=")}T+=M[0].length,Q.lastIndex=T,T+=Q.exec(this.input)[0].length,this.input[T]===";"&&T++}},ue.eat=function(T){return this.type===T&&(this.next(),!0)},ue.isContextual=function(T){return this.type===w.name&&this.value===T&&!this.containsEsc},ue.eatContextual=function(T){return!!this.isContextual(T)&&(this.next(),!0)},ue.expectContextual=function(T){this.eatContextual(T)||this.unexpected()},ue.canInsertSemicolon=function(){return this.type===w.eof||this.type===w.braceR||R.test(this.input.slice(this.lastTokEnd,this.start))},ue.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ue.semicolon=function(){this.eat(w.semi)||this.insertSemicolon()||this.unexpected()},ue.afterTrailingComma=function(T,M){if(this.type===T)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),M||this.next(),!0},ue.expect=function(T){this.eat(T)||this.unexpected()},ue.unexpected=function(T){this.raise(T??this.start,"Unexpected token")};var Ie=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ue.checkPatternErrors=function(T,M){if(T){T.trailingComma>-1&&this.raiseRecoverable(T.trailingComma,"Comma is not permitted after the rest element");var Y=M?T.parenthesizedAssign:T.parenthesizedBind;Y>-1&&this.raiseRecoverable(Y,M?"Assigning to rvalue":"Parenthesized pattern")}},ue.checkExpressionErrors=function(T,M){if(!T)return!1;var Y=T.shorthandAssign,de=T.doubleProto;if(!M)return Y>=0||de>=0;Y>=0&&this.raise(Y,"Shorthand property assignments are valid only in destructuring patterns"),de>=0&&this.raiseRecoverable(de,"Redefinition of __proto__ property")},ue.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(je,!1,!T);case w._class:return T&&this.unexpected(),this.parseClass(je,!0);case w._if:return this.parseIfStatement(je);case w._return:return this.parseReturnStatement(je);case w._switch:return this.parseSwitchStatement(je);case w._throw:return this.parseThrowStatement(je);case w._try:return this.parseTryStatement(je);case w._const:case w._var:return de=de||this.value,T&&de!=="var"&&this.unexpected(),this.parseVarStatement(je,de);case w._while:return this.parseWhileStatement(je);case w._with:return this.parseWithStatement(je);case w.braceL:return this.parseBlock(!0,je);case w.semi:return this.parseEmptyStatement(je);case w._export:case w._import:if(this.options.ecmaVersion>10&&ke===w._import){Q.lastIndex=this.pos;var Je=Q.exec(this.input),ot=this.pos+Je[0].length,Qt=this.input.charCodeAt(ot);if(Qt===40||Qt===46)return this.parseExpressionStatement(je,this.parseExpression())}return this.options.allowImportExportEverywhere||(M||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),ke===w._import?this.parseImport(je):this.parseExport(je,Y);default:if(this.isAsyncFunction())return T&&this.unexpected(),this.next(),this.parseFunctionStatement(je,!0,!T);var cn=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(cn)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),cn==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(je,!1,cn),this.semicolon(),this.finishNode(je,"VariableDeclaration");var rn=this.value,Bn=this.parseExpression();return ke===w.name&&Bn.type==="Identifier"&&this.eat(w.colon)?this.parseLabeledStatement(je,rn,Bn,T):this.parseExpressionStatement(je,Bn)}},Ee.parseBreakContinueStatement=function(T,M){var Y=M==="break";this.next(),this.eat(w.semi)||this.insertSemicolon()?T.label=null:this.type!==w.name?this.unexpected():(T.label=this.parseIdent(),this.semicolon());for(var de=0;de=6?this.eat(w.semi):this.semicolon(),this.finishNode(T,"DoWhileStatement")},Ee.parseForStatement=function(T){this.next();var M=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Te),this.enterScope(0),this.expect(w.parenL),this.type===w.semi)return M>-1&&this.unexpected(M),this.parseFor(T,null);var Y=this.isLet();if(this.type===w._var||this.type===w._const||Y){var de=this.startNode(),ke=Y?"let":this.value;return this.next(),this.parseVar(de,!0,ke),this.finishNode(de,"VariableDeclaration"),this.parseForAfterInit(T,de,M)}var je=this.isContextual("let"),Je=!1,ot=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(ot){var Qt=this.startNode();return this.next(),ot==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(Qt,!0,ot),this.finishNode(Qt,"VariableDeclaration"),this.parseForAfterInit(T,Qt,M)}var cn=this.containsEsc,rn=new Ie,Bn=this.start,Cn=M>-1?this.parseExprSubscripts(rn,"await"):this.parseExpression(!0,rn);return this.type===w._in||(Je=this.options.ecmaVersion>=6&&this.isContextual("of"))?(M>-1?(this.type===w._in&&this.unexpected(M),T.await=!0):Je&&this.options.ecmaVersion>=8&&(Cn.start!==Bn||cn||Cn.type!=="Identifier"||Cn.name!=="async"?this.options.ecmaVersion>=9&&(T.await=!1):this.unexpected()),je&&Je&&this.raise(Cn.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(Cn,!1,rn),this.checkLValPattern(Cn),this.parseForIn(T,Cn)):(this.checkExpressionErrors(rn,!0),M>-1&&this.unexpected(M),this.parseFor(T,Cn))},Ee.parseForAfterInit=function(T,M,Y){return(this.type===w._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&M.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===w._in?Y>-1&&this.unexpected(Y):T.await=Y>-1),this.parseForIn(T,M)):(Y>-1&&this.unexpected(Y),this.parseFor(T,M))},Ee.parseFunctionStatement=function(T,M,Y){return this.next(),this.parseFunction(T,We|(Y?0:He),!1,M)},Ee.parseIfStatement=function(T){return this.next(),T.test=this.parseParenExpression(),T.consequent=this.parseStatement("if"),T.alternate=this.eat(w._else)?this.parseStatement("if"):null,this.finishNode(T,"IfStatement")},Ee.parseReturnStatement=function(T){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(w.semi)||this.insertSemicolon()?T.argument=null:(T.argument=this.parseExpression(),this.semicolon()),this.finishNode(T,"ReturnStatement")},Ee.parseSwitchStatement=function(T){var M;this.next(),T.discriminant=this.parseParenExpression(),T.cases=[],this.expect(w.braceL),this.labels.push(_e),this.enterScope(1024);for(var Y=!1;this.type!==w.braceR;)if(this.type===w._case||this.type===w._default){var de=this.type===w._case;M&&this.finishNode(M,"SwitchCase"),T.cases.push(M=this.startNode()),M.consequent=[],this.next(),de?M.test=this.parseExpression():(Y&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),Y=!0,M.test=null),this.expect(w.colon)}else M||this.unexpected(),M.consequent.push(this.parseStatement(null));return this.exitScope(),M&&this.finishNode(M,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(T,"SwitchStatement")},Ee.parseThrowStatement=function(T){return this.next(),R.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),T.argument=this.parseExpression(),this.semicolon(),this.finishNode(T,"ThrowStatement")};var z=[];Ee.parseCatchClauseParam=function(){var T=this.parseBindingAtom(),M=T.type==="Identifier";return this.enterScope(M?32:0),this.checkLValPattern(T,M?4:2),this.expect(w.parenR),T},Ee.parseTryStatement=function(T){if(this.next(),T.block=this.parseBlock(),T.handler=null,this.type===w._catch){var M=this.startNode();this.next(),this.eat(w.parenL)?M.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),M.param=null,this.enterScope(0)),M.body=this.parseBlock(!1),this.exitScope(),T.handler=this.finishNode(M,"CatchClause")}return T.finalizer=this.eat(w._finally)?this.parseBlock():null,T.handler||T.finalizer||this.raise(T.start,"Missing catch or finally clause"),this.finishNode(T,"TryStatement")},Ee.parseVarStatement=function(T,M,Y){return this.next(),this.parseVar(T,!1,M,Y),this.semicolon(),this.finishNode(T,"VariableDeclaration")},Ee.parseWhileStatement=function(T){return this.next(),T.test=this.parseParenExpression(),this.labels.push(Te),T.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(T,"WhileStatement")},Ee.parseWithStatement=function(T){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),T.object=this.parseParenExpression(),T.body=this.parseStatement("with"),this.finishNode(T,"WithStatement")},Ee.parseEmptyStatement=function(T){return this.next(),this.finishNode(T,"EmptyStatement")},Ee.parseLabeledStatement=function(T,M,Y,de){for(var ke=0,je=this.labels;ke=0;ot--){var Qt=this.labels[ot];if(Qt.statementStart!==T.start)break;Qt.statementStart=this.start,Qt.kind=Je}return this.labels.push({name:M,kind:Je,statementStart:this.start}),T.body=this.parseStatement(de?de.indexOf("label")===-1?de+"label":de:"label"),this.labels.pop(),T.label=Y,this.finishNode(T,"LabeledStatement")},Ee.parseExpressionStatement=function(T,M){return T.expression=M,this.semicolon(),this.finishNode(T,"ExpressionStatement")},Ee.parseBlock=function(T,M,Y){for(T===void 0&&(T=!0),M===void 0&&(M=this.startNode()),M.body=[],this.expect(w.braceL),T&&this.enterScope(0);this.type!==w.braceR;){var de=this.parseStatement(null);M.body.push(de)}return Y&&(this.strict=!1),this.next(),T&&this.exitScope(),this.finishNode(M,"BlockStatement")},Ee.parseFor=function(T,M){return T.init=M,this.expect(w.semi),T.test=this.type===w.semi?null:this.parseExpression(),this.expect(w.semi),T.update=this.type===w.parenR?null:this.parseExpression(),this.expect(w.parenR),T.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(T,"ForStatement")},Ee.parseForIn=function(T,M){var Y=this.type===w._in;return this.next(),M.type==="VariableDeclaration"&&M.declarations[0].init!=null&&(!Y||this.options.ecmaVersion<8||this.strict||M.kind!=="var"||M.declarations[0].id.type!=="Identifier")&&this.raise(M.start,(Y?"for-in":"for-of")+" loop variable declaration may not have an initializer"),T.left=M,T.right=Y?this.parseExpression():this.parseMaybeAssign(),this.expect(w.parenR),T.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(T,Y?"ForInStatement":"ForOfStatement")},Ee.parseVar=function(T,M,Y,de){for(T.declarations=[],T.kind=Y;;){var ke=this.startNode();if(this.parseVarId(ke,Y),this.eat(w.eq)?ke.init=this.parseMaybeAssign(M):de||Y!=="const"||this.type===w._in||this.options.ecmaVersion>=6&&this.isContextual("of")?de||Y!=="using"&&Y!=="await using"||!(this.options.ecmaVersion>=17)||this.type===w._in||this.isContextual("of")?de||ke.id.type==="Identifier"||M&&(this.type===w._in||this.isContextual("of"))?ke.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+Y+" declaration"):this.unexpected(),T.declarations.push(this.finishNode(ke,"VariableDeclarator")),!this.eat(w.comma))break}return T},Ee.parseVarId=function(T,M){T.id=M==="using"||M==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(T.id,M==="var"?1:2,!1)};var We=1,He=2;function dt(T,M){var Y=M.key.name,de=T[Y],ke="true";return M.type!=="MethodDefinition"||M.kind!=="get"&&M.kind!=="set"||(ke=(M.static?"s":"i")+M.kind),de==="iget"&&ke==="iset"||de==="iset"&&ke==="iget"||de==="sget"&&ke==="sset"||de==="sset"&&ke==="sget"?(T[Y]="true",!1):!!de||(T[Y]=ke,!1)}function it(T,M){var Y=T.computed,de=T.key;return!Y&&(de.type==="Identifier"&&de.name===M||de.type==="Literal"&&de.value===M)}Ee.parseFunction=function(T,M,Y,de,ke){this.initFunction(T),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!de)&&(this.type===w.star&&M&He&&this.unexpected(),T.generator=this.eat(w.star)),this.options.ecmaVersion>=8&&(T.async=!!de),M&We&&(T.id=4&M&&this.type!==w.name?null:this.parseIdent(),!T.id||M&He||this.checkLValSimple(T.id,this.strict||T.generator||T.async?this.treatFunctionsAsVar?1:2:3));var je=this.yieldPos,Je=this.awaitPos,ot=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ae(T.async,T.generator)),M&We||(T.id=this.type===w.name?this.parseIdent():null),this.parseFunctionParams(T),this.parseFunctionBody(T,Y,!1,ke),this.yieldPos=je,this.awaitPos=Je,this.awaitIdentPos=ot,this.finishNode(T,M&We?"FunctionDeclaration":"FunctionExpression")},Ee.parseFunctionParams=function(T){this.expect(w.parenL),T.params=this.parseBindingList(w.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Ee.parseClass=function(T,M){this.next();var Y=this.strict;this.strict=!0,this.parseClassId(T,M),this.parseClassSuper(T);var de=this.enterClassBody(),ke=this.startNode(),je=!1;for(ke.body=[],this.expect(w.braceL);this.type!==w.braceR;){var Je=this.parseClassElement(T.superClass!==null);Je&&(ke.body.push(Je),Je.type==="MethodDefinition"&&Je.kind==="constructor"?(je&&this.raiseRecoverable(Je.start,"Duplicate constructor in the same class"),je=!0):Je.key&&Je.key.type==="PrivateIdentifier"&&dt(de,Je)&&this.raiseRecoverable(Je.key.start,"Identifier '#"+Je.key.name+"' has already been declared"))}return this.strict=Y,this.next(),T.body=this.finishNode(ke,"ClassBody"),this.exitClassBody(),this.finishNode(T,M?"ClassDeclaration":"ClassExpression")},Ee.parseClassElement=function(T){if(this.eat(w.semi))return null;var M=this.options.ecmaVersion,Y=this.startNode(),de="",ke=!1,je=!1,Je="method",ot=!1;if(this.eatContextual("static")){if(M>=13&&this.eat(w.braceL))return this.parseClassStaticBlock(Y),Y;this.isClassElementNameStart()||this.type===w.star?ot=!0:de="static"}if(Y.static=ot,!de&&M>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==w.star||this.canInsertSemicolon()?de="async":je=!0),!de&&(M>=9||!je)&&this.eat(w.star)&&(ke=!0),!de&&!je&&!ke){var Qt=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?Je=Qt:de=Qt)}if(de?(Y.computed=!1,Y.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Y.key.name=de,this.finishNode(Y.key,"Identifier")):this.parseClassElementName(Y),M<13||this.type===w.parenL||Je!=="method"||ke||je){var cn=!Y.static&&it(Y,"constructor"),rn=cn&&T;cn&&Je!=="method"&&this.raise(Y.key.start,"Constructor can't have get/set modifier"),Y.kind=cn?"constructor":Je,this.parseClassMethod(Y,ke,je,rn)}else this.parseClassField(Y);return Y},Ee.isClassElementNameStart=function(){return this.type===w.name||this.type===w.privateId||this.type===w.num||this.type===w.string||this.type===w.bracketL||this.type.keyword},Ee.parseClassElementName=function(T){this.type===w.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),T.computed=!1,T.key=this.parsePrivateIdent()):this.parsePropertyName(T)},Ee.parseClassMethod=function(T,M,Y,de){var ke=T.key;T.kind==="constructor"?(M&&this.raise(ke.start,"Constructor can't be a generator"),Y&&this.raise(ke.start,"Constructor can't be an async method")):T.static&&it(T,"prototype")&&this.raise(ke.start,"Classes may not have a static property named prototype");var je=T.value=this.parseMethod(M,Y,de);return T.kind==="get"&&je.params.length!==0&&this.raiseRecoverable(je.start,"getter should have no params"),T.kind==="set"&&je.params.length!==1&&this.raiseRecoverable(je.start,"setter should have exactly one param"),T.kind==="set"&&je.params[0].type==="RestElement"&&this.raiseRecoverable(je.params[0].start,"Setter cannot use rest params"),this.finishNode(T,"MethodDefinition")},Ee.parseClassField=function(T){return it(T,"constructor")?this.raise(T.key.start,"Classes can't have a field named 'constructor'"):T.static&&it(T,"prototype")&&this.raise(T.key.start,"Classes can't have a static field named 'prototype'"),this.eat(w.eq)?(this.enterScope(576),T.value=this.parseMaybeAssign(),this.exitScope()):T.value=null,this.semicolon(),this.finishNode(T,"PropertyDefinition")},Ee.parseClassStaticBlock=function(T){T.body=[];var M=this.labels;for(this.labels=[],this.enterScope(320);this.type!==w.braceR;){var Y=this.parseStatement(null);T.body.push(Y)}return this.next(),this.exitScope(),this.labels=M,this.finishNode(T,"StaticBlock")},Ee.parseClassId=function(T,M){this.type===w.name?(T.id=this.parseIdent(),M&&this.checkLValSimple(T.id,2,!1)):(M===!0&&this.unexpected(),T.id=null)},Ee.parseClassSuper=function(T){T.superClass=this.eat(w._extends)?this.parseExprSubscripts(null,!1):null},Ee.enterClassBody=function(){var T={declared:Object.create(null),used:[]};return this.privateNameStack.push(T),T.declared},Ee.exitClassBody=function(){var T=this.privateNameStack.pop(),M=T.declared,Y=T.used;if(this.options.checkPrivateFields)for(var de=this.privateNameStack.length,ke=de===0?null:this.privateNameStack[de-1],je=0;je=11&&(this.eatContextual("as")?(T.exported=this.parseModuleExportName(),this.checkExport(M,T.exported,this.lastTokStart)):T.exported=null),this.expectContextual("from"),this.type!==w.string&&this.unexpected(),T.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(T.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(T,"ExportAllDeclaration")},Ee.parseExport=function(T,M){if(this.next(),this.eat(w.star))return this.parseExportAllDeclaration(T,M);if(this.eat(w._default))return this.checkExport(M,"default",this.lastTokStart),T.declaration=this.parseExportDefaultDeclaration(),this.finishNode(T,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())T.declaration=this.parseExportDeclaration(T),T.declaration.type==="VariableDeclaration"?this.checkVariableExport(M,T.declaration.declarations):this.checkExport(M,T.declaration.id,T.declaration.id.start),T.specifiers=[],T.source=null,this.options.ecmaVersion>=16&&(T.attributes=[]);else{if(T.declaration=null,T.specifiers=this.parseExportSpecifiers(M),this.eatContextual("from"))this.type!==w.string&&this.unexpected(),T.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(T.attributes=this.parseWithClause());else{for(var Y=0,de=T.specifiers;Y=16&&(T.attributes=[])}this.semicolon()}return this.finishNode(T,"ExportNamedDeclaration")},Ee.parseExportDeclaration=function(T){return this.parseStatement(null)},Ee.parseExportDefaultDeclaration=function(){var T;if(this.type===w._function||(T=this.isAsyncFunction())){var M=this.startNode();return this.next(),T&&this.next(),this.parseFunction(M,4|We,!1,T)}if(this.type===w._class){var Y=this.startNode();return this.parseClass(Y,"nullableID")}var de=this.parseMaybeAssign();return this.semicolon(),de},Ee.checkExport=function(T,M,Y){T&&(typeof M!="string"&&(M=M.type==="Identifier"?M.name:M.value),Z(T,M)&&this.raiseRecoverable(Y,"Duplicate export '"+M+"'"),T[M]=!0)},Ee.checkPatternExport=function(T,M){var Y=M.type;if(Y==="Identifier")this.checkExport(T,M,M.start);else if(Y==="ObjectPattern")for(var de=0,ke=M.properties;de=16&&(T.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(T,"ImportDeclaration")},Ee.parseImportSpecifier=function(){var T=this.startNode();return T.imported=this.parseModuleExportName(),this.eatContextual("as")?T.local=this.parseIdent():(this.checkUnreserved(T.imported),T.local=T.imported),this.checkLValSimple(T.local,2),this.finishNode(T,"ImportSpecifier")},Ee.parseImportDefaultSpecifier=function(){var T=this.startNode();return T.local=this.parseIdent(),this.checkLValSimple(T.local,2),this.finishNode(T,"ImportDefaultSpecifier")},Ee.parseImportNamespaceSpecifier=function(){var T=this.startNode();return this.next(),this.expectContextual("as"),T.local=this.parseIdent(),this.checkLValSimple(T.local,2),this.finishNode(T,"ImportNamespaceSpecifier")},Ee.parseImportSpecifiers=function(){var T=[],M=!0;if(this.type===w.name&&(T.push(this.parseImportDefaultSpecifier()),!this.eat(w.comma)))return T;if(this.type===w.star)return T.push(this.parseImportNamespaceSpecifier()),T;for(this.expect(w.braceL);!this.eat(w.braceR);){if(M)M=!1;else if(this.expect(w.comma),this.afterTrailingComma(w.braceR))break;T.push(this.parseImportSpecifier())}return T},Ee.parseWithClause=function(){var T=[];if(!this.eat(w._with))return T;this.expect(w.braceL);for(var M={},Y=!0;!this.eat(w.braceR);){if(Y)Y=!1;else if(this.expect(w.comma),this.afterTrailingComma(w.braceR))break;var de=this.parseImportAttribute(),ke=de.key.type==="Identifier"?de.key.name:de.key.value;Z(M,ke)&&this.raiseRecoverable(de.key.start,"Duplicate attribute key '"+ke+"'"),M[ke]=!0,T.push(de)}return T},Ee.parseImportAttribute=function(){var T=this.startNode();return T.key=this.type===w.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(w.colon),this.type!==w.string&&this.unexpected(),T.value=this.parseExprAtom(),this.finishNode(T,"ImportAttribute")},Ee.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===w.string){var T=this.parseLiteral(this.value);return Me.test(T.value)&&this.raise(T.start,"An export name cannot include a lone surrogate."),T}return this.parseIdent(!0)},Ee.adaptDirectivePrologue=function(T){for(var M=0;M=5&&T.type==="ExpressionStatement"&&T.expression.type==="Literal"&&typeof T.expression.value=="string"&&(this.input[T.start]==='"'||this.input[T.start]==="'")};var ze=me.prototype;ze.toAssignable=function(T,M,Y){if(this.options.ecmaVersion>=6&&T)switch(T.type){case"Identifier":this.inAsync&&T.name==="await"&&this.raise(T.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":T.type="ObjectPattern",Y&&this.checkPatternErrors(Y,!0);for(var de=0,ke=T.properties;de=8&&!ot&&Qt.name==="async"&&!this.canInsertSemicolon()&&this.eat(w._function))return this.overrideContext(Ct.f_expr),this.parseFunction(this.startNodeAt(je,Je),0,!1,!0,M);if(ke&&!this.canInsertSemicolon()){if(this.eat(w.arrow))return this.parseArrowExpression(this.startNodeAt(je,Je),[Qt],!1,M);if(this.options.ecmaVersion>=8&&Qt.name==="async"&&this.type===w.name&&!ot&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return Qt=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(w.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(je,Je),[Qt],!0,M)}return Qt;case w.regexp:var cn=this.value;return(de=this.parseLiteral(cn.value)).regex={pattern:cn.pattern,flags:cn.flags},de;case w.num:case w.string:return this.parseLiteral(this.value);case w._null:case w._true:case w._false:return(de=this.startNode()).value=this.type===w._null?null:this.type===w._true,de.raw=this.type.keyword,this.next(),this.finishNode(de,"Literal");case w.parenL:var rn=this.start,Bn=this.parseParenAndDistinguishExpression(ke,M);return T&&(T.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Bn)&&(T.parenthesizedAssign=rn),T.parenthesizedBind<0&&(T.parenthesizedBind=rn)),Bn;case w.bracketL:return de=this.startNode(),this.next(),de.elements=this.parseExprList(w.bracketR,!0,!0,T),this.finishNode(de,"ArrayExpression");case w.braceL:return this.overrideContext(Ct.b_expr),this.parseObj(!1,T);case w._function:return de=this.startNode(),this.next(),this.parseFunction(de,0);case w._class:return this.parseClass(this.startNode(),!1);case w._new:return this.parseNew();case w.backQuote:return this.parseTemplate();case w._import:return this.options.ecmaVersion>=11?this.parseExprImport(Y):this.unexpected();default:return this.parseExprAtomDefault()}},Mt.parseExprAtomDefault=function(){this.unexpected()},Mt.parseExprImport=function(T){var M=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===w.parenL&&!T)return this.parseDynamicImport(M);if(this.type===w.dot){var Y=this.startNodeAt(M.start,M.loc&&M.loc.start);return Y.name="import",M.meta=this.finishNode(Y,"Identifier"),this.parseImportMeta(M)}this.unexpected()},Mt.parseDynamicImport=function(T){if(this.next(),T.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(w.parenR)?T.options=null:(this.expect(w.comma),this.afterTrailingComma(w.parenR)?T.options=null:(T.options=this.parseMaybeAssign(),this.eat(w.parenR)||(this.expect(w.comma),this.afterTrailingComma(w.parenR)||this.unexpected())));else if(!this.eat(w.parenR)){var M=this.start;this.eat(w.comma)&&this.eat(w.parenR)?this.raiseRecoverable(M,"Trailing comma is not allowed in import()"):this.unexpected(M)}return this.finishNode(T,"ImportExpression")},Mt.parseImportMeta=function(T){this.next();var M=this.containsEsc;return T.property=this.parseIdent(!0),T.property.name!=="meta"&&this.raiseRecoverable(T.property.start,"The only valid meta property for import is 'import.meta'"),M&&this.raiseRecoverable(T.start,"'import.meta' must not contain escaped characters"),this.options.sourceType==="module"||this.options.allowImportExportEverywhere||this.raiseRecoverable(T.start,"Cannot use 'import.meta' outside a module"),this.finishNode(T,"MetaProperty")},Mt.parseLiteral=function(T){var M=this.startNode();return M.value=T,M.raw=this.input.slice(this.start,this.end),M.raw.charCodeAt(M.raw.length-1)===110&&(M.bigint=M.value!=null?M.value.toString():M.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(M,"Literal")},Mt.parseParenExpression=function(){this.expect(w.parenL);var T=this.parseExpression();return this.expect(w.parenR),T},Mt.shouldParseArrow=function(T){return!this.canInsertSemicolon()},Mt.parseParenAndDistinguishExpression=function(T,M){var Y,de=this.start,ke=this.startLoc,je=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Je,ot=this.start,Qt=this.startLoc,cn=[],rn=!0,Bn=!1,Cn=new Ie,Zr=this.yieldPos,Gi=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==w.parenR;){if(rn?rn=!1:this.expect(w.comma),je&&this.afterTrailingComma(w.parenR,!0)){Bn=!0;break}if(this.type===w.ellipsis){Je=this.start,cn.push(this.parseParenItem(this.parseRestBinding())),this.type===w.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}cn.push(this.parseMaybeAssign(!1,Cn,this.parseParenItem))}var su=this.lastTokEnd,ui=this.lastTokEndLoc;if(this.expect(w.parenR),T&&this.shouldParseArrow(cn)&&this.eat(w.arrow))return this.checkPatternErrors(Cn,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Zr,this.awaitPos=Gi,this.parseParenArrowList(de,ke,cn,M);cn.length&&!Bn||this.unexpected(this.lastTokStart),Je&&this.unexpected(Je),this.checkExpressionErrors(Cn,!0),this.yieldPos=Zr||this.yieldPos,this.awaitPos=Gi||this.awaitPos,cn.length>1?((Y=this.startNodeAt(ot,Qt)).expressions=cn,this.finishNodeAt(Y,"SequenceExpression",su,ui)):Y=cn[0]}else Y=this.parseParenExpression();if(this.options.preserveParens){var no=this.startNodeAt(de,ke);return no.expression=Y,this.finishNode(no,"ParenthesizedExpression")}return Y},Mt.parseParenItem=function(T){return T},Mt.parseParenArrowList=function(T,M,Y,de){return this.parseArrowExpression(this.startNodeAt(T,M),Y,!1,de)};var Ze=[];Mt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var T=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===w.dot){var M=this.startNodeAt(T.start,T.loc&&T.loc.start);M.name="new",T.meta=this.finishNode(M,"Identifier"),this.next();var Y=this.containsEsc;return T.property=this.parseIdent(!0),T.property.name!=="target"&&this.raiseRecoverable(T.property.start,"The only valid meta property for new is 'new.target'"),Y&&this.raiseRecoverable(T.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(T.start,"'new.target' can only be used in functions and class static block"),this.finishNode(T,"MetaProperty")}var de=this.start,ke=this.startLoc;return T.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),de,ke,!0,!1),this.eat(w.parenL)?T.arguments=this.parseExprList(w.parenR,this.options.ecmaVersion>=8,!1):T.arguments=Ze,this.finishNode(T,"NewExpression")},Mt.parseTemplateElement=function(T){var M=T.isTagged,Y=this.startNode();return this.type===w.invalidTemplate?(M||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),Y.value={raw:this.value.replace(/\r\n?/g,` -`),cooked:null}):Y.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` -`),cooked:this.value},this.next(),Y.tail=this.type===w.backQuote,this.finishNode(Y,"TemplateElement")},Mt.parseTemplate=function(T){T===void 0&&(T={});var M=T.isTagged;M===void 0&&(M=!1);var Y=this.startNode();this.next(),Y.expressions=[];var de=this.parseTemplateElement({isTagged:M});for(Y.quasis=[de];!de.tail;)this.type===w.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(w.dollarBraceL),Y.expressions.push(this.parseExpression()),this.expect(w.braceR),Y.quasis.push(de=this.parseTemplateElement({isTagged:M}));return this.next(),this.finishNode(Y,"TemplateLiteral")},Mt.isAsyncProp=function(T){return!T.computed&&T.key.type==="Identifier"&&T.key.name==="async"&&(this.type===w.name||this.type===w.num||this.type===w.string||this.type===w.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===w.star)&&!R.test(this.input.slice(this.lastTokEnd,this.start))},Mt.parseObj=function(T,M){var Y=this.startNode(),de=!0,ke={};for(Y.properties=[],this.next();!this.eat(w.braceR);){if(de)de=!1;else if(this.expect(w.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(w.braceR))break;var je=this.parseProperty(T,M);T||this.checkPropClash(je,ke,M),Y.properties.push(je)}return this.finishNode(Y,T?"ObjectPattern":"ObjectExpression")},Mt.parseProperty=function(T,M){var Y,de,ke,je,Je=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(w.ellipsis))return T?(Je.argument=this.parseIdent(!1),this.type===w.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(Je,"RestElement")):(Je.argument=this.parseMaybeAssign(!1,M),this.type===w.comma&&M&&M.trailingComma<0&&(M.trailingComma=this.start),this.finishNode(Je,"SpreadElement"));this.options.ecmaVersion>=6&&(Je.method=!1,Je.shorthand=!1,(T||M)&&(ke=this.start,je=this.startLoc),T||(Y=this.eat(w.star)));var ot=this.containsEsc;return this.parsePropertyName(Je),!T&&!ot&&this.options.ecmaVersion>=8&&!Y&&this.isAsyncProp(Je)?(de=!0,Y=this.options.ecmaVersion>=9&&this.eat(w.star),this.parsePropertyName(Je)):de=!1,this.parsePropertyValue(Je,T,Y,de,ke,je,M,ot),this.finishNode(Je,"Property")},Mt.parseGetterSetter=function(T){var M=T.key.name;this.parsePropertyName(T),T.value=this.parseMethod(!1),T.kind=M;var Y=T.kind==="get"?0:1;if(T.value.params.length!==Y){var de=T.value.start;T.kind==="get"?this.raiseRecoverable(de,"getter should have no params"):this.raiseRecoverable(de,"setter should have exactly one param")}else T.kind==="set"&&T.value.params[0].type==="RestElement"&&this.raiseRecoverable(T.value.params[0].start,"Setter cannot use rest params")},Mt.parsePropertyValue=function(T,M,Y,de,ke,je,Je,ot){(Y||de)&&this.type===w.colon&&this.unexpected(),this.eat(w.colon)?(T.value=M?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Je),T.kind="init"):this.options.ecmaVersion>=6&&this.type===w.parenL?(M&&this.unexpected(),T.method=!0,T.value=this.parseMethod(Y,de),T.kind="init"):M||ot||!(this.options.ecmaVersion>=5)||T.computed||T.key.type!=="Identifier"||T.key.name!=="get"&&T.key.name!=="set"||this.type===w.comma||this.type===w.braceR||this.type===w.eq?this.options.ecmaVersion>=6&&!T.computed&&T.key.type==="Identifier"?((Y||de)&&this.unexpected(),this.checkUnreserved(T.key),T.key.name!=="await"||this.awaitIdentPos||(this.awaitIdentPos=ke),M?T.value=this.parseMaybeDefault(ke,je,this.copyNode(T.key)):this.type===w.eq&&Je?(Je.shorthandAssign<0&&(Je.shorthandAssign=this.start),T.value=this.parseMaybeDefault(ke,je,this.copyNode(T.key))):T.value=this.copyNode(T.key),T.kind="init",T.shorthand=!0):this.unexpected():((Y||de)&&this.unexpected(),this.parseGetterSetter(T))},Mt.parsePropertyName=function(T){if(this.options.ecmaVersion>=6){if(this.eat(w.bracketL))return T.computed=!0,T.key=this.parseMaybeAssign(),this.expect(w.bracketR),T.key;T.computed=!1}return T.key=this.type===w.num||this.type===w.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},Mt.initFunction=function(T){T.id=null,this.options.ecmaVersion>=6&&(T.generator=T.expression=!1),this.options.ecmaVersion>=8&&(T.async=!1)},Mt.parseMethod=function(T,M,Y){var de=this.startNode(),ke=this.yieldPos,je=this.awaitPos,Je=this.awaitIdentPos;return this.initFunction(de),this.options.ecmaVersion>=6&&(de.generator=T),this.options.ecmaVersion>=8&&(de.async=!!M),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|ae(M,de.generator)|(Y?128:0)),this.expect(w.parenL),de.params=this.parseBindingList(w.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(de,!1,!0,!1),this.yieldPos=ke,this.awaitPos=je,this.awaitIdentPos=Je,this.finishNode(de,"FunctionExpression")},Mt.parseArrowExpression=function(T,M,Y,de){var ke=this.yieldPos,je=this.awaitPos,Je=this.awaitIdentPos;return this.enterScope(16|ae(Y,!1)),this.initFunction(T),this.options.ecmaVersion>=8&&(T.async=!!Y),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,T.params=this.toAssignableList(M,!0),this.parseFunctionBody(T,!0,!1,de),this.yieldPos=ke,this.awaitPos=je,this.awaitIdentPos=Je,this.finishNode(T,"ArrowFunctionExpression")},Mt.parseFunctionBody=function(T,M,Y,de){var ke=M&&this.type!==w.braceL,je=this.strict,Je=!1;if(ke)T.body=this.parseMaybeAssign(de),T.expression=!0,this.checkParams(T,!1);else{var ot=this.options.ecmaVersion>=7&&!this.isSimpleParamList(T.params);je&&!ot||(Je=this.strictDirective(this.end))&&ot&&this.raiseRecoverable(T.start,"Illegal 'use strict' directive in function with non-simple parameter list");var Qt=this.labels;this.labels=[],Je&&(this.strict=!0),this.checkParams(T,!je&&!Je&&!M&&!Y&&this.isSimpleParamList(T.params)),this.strict&&T.id&&this.checkLValSimple(T.id,5),T.body=this.parseBlock(!1,void 0,Je&&!je),T.expression=!1,this.adaptDirectivePrologue(T.body.body),this.labels=Qt}this.exitScope()},Mt.isSimpleParamList=function(T){for(var M=0,Y=T;M-1||ke.functions.indexOf(T)>-1||ke.var.indexOf(T)>-1,ke.lexical.push(T),this.inModule&&1&ke.flags&&delete this.undefinedExports[T]}else if(M===4)this.currentScope().lexical.push(T);else if(M===3){var je=this.currentScope();de=this.treatFunctionsAsVar?je.lexical.indexOf(T)>-1:je.lexical.indexOf(T)>-1||je.var.indexOf(T)>-1,je.functions.push(T)}else for(var Je=this.scopeStack.length-1;Je>=0;--Je){var ot=this.scopeStack[Je];if(ot.lexical.indexOf(T)>-1&&!(32&ot.flags&&ot.lexical[0]===T)||!this.treatFunctionsAsVarInScope(ot)&&ot.functions.indexOf(T)>-1){de=!0;break}if(ot.var.push(T),this.inModule&&1&ot.flags&&delete this.undefinedExports[T],ot.flags&X)break}de&&this.raiseRecoverable(Y,"Identifier '"+T+"' has already been declared")},Xe.checkLocalExport=function(T){this.scopeStack[0].lexical.indexOf(T.name)===-1&&this.scopeStack[0].var.indexOf(T.name)===-1&&(this.undefinedExports[T.name]=T)},Xe.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Xe.currentVarScope=function(){for(var T=this.scopeStack.length-1;;T--){var M=this.scopeStack[T];if(771&M.flags)return M}},Xe.currentThisScope=function(){for(var T=this.scopeStack.length-1;;T--){var M=this.scopeStack[T];if(771&M.flags&&!(16&M.flags))return M}};var Vt=function(T,M,Y){this.type="",this.start=M,this.end=0,T.options.locations&&(this.loc=new se(T,Y)),T.options.directSourceFile&&(this.sourceFile=T.options.directSourceFile),T.options.ranges&&(this.range=[M,0])},un=me.prototype;function mn(T,M,Y,de){return T.type=M,T.end=Y,this.options.locations&&(T.loc.end=de),this.options.ranges&&(T.range[1]=Y),T}un.startNode=function(){return new Vt(this,this.start,this.startLoc)},un.startNodeAt=function(T,M){return new Vt(this,T,M)},un.finishNode=function(T,M){return mn.call(this,T,M,this.lastTokEnd,this.lastTokEndLoc)},un.finishNodeAt=function(T,M,Y,de){return mn.call(this,T,M,Y,de)},un.copyNode=function(T){var M=new Vt(this,T.start,this.startLoc);for(var Y in T)M[Y]=T[Y];return M};var Mn="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Ve=Mn+" Extended_Pictographic",pt=Ve+" EBase EComp EMod EPres ExtPict",Xt={9:Mn,10:Ve,11:Ve,12:pt,13:pt,14:pt},et={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},ut="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",mt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",tt=mt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Dt=tt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Zt=Dt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Ne=Zt+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",$e={9:mt,10:tt,11:Dt,12:Zt,13:Ne,14:Ne+" Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz"},ct={};function Ge(T){var M=ct[T]={binary:be(Xt[T]+" "+ut),binaryOfStrings:be(et[T]),nonBinary:{General_Category:be(ut),Script:be($e[T])}};M.nonBinary.Script_Extensions=M.nonBinary.Script,M.nonBinary.gc=M.nonBinary.General_Category,M.nonBinary.sc=M.nonBinary.Script,M.nonBinary.scx=M.nonBinary.Script_Extensions}for(var wt=0,Ot=[9,10,11,12,13,14];wt=6?"uy":"")+(T.options.ecmaVersion>=9?"s":"")+(T.options.ecmaVersion>=13?"d":"")+(T.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ct[T.options.ecmaVersion>=14?14:T.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function bn(T){return T===105||T===109||T===115}function tr(T){return T===36||T>=40&&T<=43||T===46||T===63||T>=91&&T<=94||T>=123&&T<=125}function Kn(T){return T>=65&&T<=90||T>=97&&T<=122}fn.prototype.reset=function(T,M,Y){var de=Y.indexOf("v")!==-1,ke=Y.indexOf("u")!==-1;this.start=0|T,this.source=M+"",this.flags=Y,de&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=ke&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=ke&&this.parser.options.ecmaVersion>=9)},fn.prototype.raise=function(T){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+T)},fn.prototype.at=function(T,M){M===void 0&&(M=!1);var Y=this.source,de=Y.length;if(T>=de)return-1;var ke=Y.charCodeAt(T);if(!M&&!this.switchU||ke<=55295||ke>=57344||T+1>=de)return ke;var je=Y.charCodeAt(T+1);return je>=56320&&je<=57343?(ke<<10)+je-56613888:ke},fn.prototype.nextIndex=function(T,M){M===void 0&&(M=!1);var Y=this.source,de=Y.length;if(T>=de)return de;var ke,je=Y.charCodeAt(T);return!M&&!this.switchU||je<=55295||je>=57344||T+1>=de||(ke=Y.charCodeAt(T+1))<56320||ke>57343?T+1:T+2},fn.prototype.current=function(T){return T===void 0&&(T=!1),this.at(this.pos,T)},fn.prototype.lookahead=function(T){return T===void 0&&(T=!1),this.at(this.nextIndex(this.pos,T),T)},fn.prototype.advance=function(T){T===void 0&&(T=!1),this.pos=this.nextIndex(this.pos,T)},fn.prototype.eat=function(T,M){return M===void 0&&(M=!1),this.current(M)===T&&(this.advance(M),!0)},fn.prototype.eatChars=function(T,M){M===void 0&&(M=!1);for(var Y=this.pos,de=0,ke=T;de-1&&this.raise(T.start,"Duplicate regular expression flag"),Je==="u"&&(de=!0),Je==="v"&&(ke=!0)}this.options.ecmaVersion>=15&&de&&ke&&this.raise(T.start,"Invalid regular expression flag")},Rt.validateRegExpPattern=function(T){this.regexp_pattern(T),!T.switchN&&this.options.ecmaVersion>=9&&(function(M){for(var Y in M)return!0;return!1})(T.groupNames)&&(T.switchN=!0,this.regexp_pattern(T))},Rt.regexp_pattern=function(T){T.pos=0,T.lastIntValue=0,T.lastStringValue="",T.lastAssertionIsQuantifiable=!1,T.numCapturingParens=0,T.maxBackReference=0,T.groupNames=Object.create(null),T.backReferenceNames.length=0,T.branchID=null,this.regexp_disjunction(T),T.pos!==T.source.length&&(T.eat(41)&&T.raise("Unmatched ')'"),(T.eat(93)||T.eat(125))&&T.raise("Lone quantifier brackets")),T.maxBackReference>T.numCapturingParens&&T.raise("Invalid escape");for(var M=0,Y=T.backReferenceNames;M=16;for(M&&(T.branchID=new yn(T.branchID,null)),this.regexp_alternative(T);T.eat(124);)M&&(T.branchID=T.branchID.sibling()),this.regexp_alternative(T);M&&(T.branchID=T.branchID.parent),this.regexp_eatQuantifier(T,!0)&&T.raise("Nothing to repeat"),T.eat(123)&&T.raise("Lone quantifier brackets")},Rt.regexp_alternative=function(T){for(;T.pos=9&&(Y=T.eat(60)),T.eat(61)||T.eat(33))return this.regexp_disjunction(T),T.eat(41)||T.raise("Unterminated group"),T.lastAssertionIsQuantifiable=!Y,!0}return T.pos=M,!1},Rt.regexp_eatQuantifier=function(T,M){return M===void 0&&(M=!1),!!this.regexp_eatQuantifierPrefix(T,M)&&(T.eat(63),!0)},Rt.regexp_eatQuantifierPrefix=function(T,M){return T.eat(42)||T.eat(43)||T.eat(63)||this.regexp_eatBracedQuantifier(T,M)},Rt.regexp_eatBracedQuantifier=function(T,M){var Y=T.pos;if(T.eat(123)){var de=0,ke=-1;if(this.regexp_eatDecimalDigits(T)&&(de=T.lastIntValue,T.eat(44)&&this.regexp_eatDecimalDigits(T)&&(ke=T.lastIntValue),T.eat(125)))return ke!==-1&&ke=16){var Y=this.regexp_eatModifiers(T),de=T.eat(45);if(Y||de){for(var ke=0;ke-1&&T.raise("Duplicate regular expression modifiers")}if(de){var Je=this.regexp_eatModifiers(T);Y||Je||T.current()!==58||T.raise("Invalid regular expression modifiers");for(var ot=0;ot-1||Y.indexOf(Qt)>-1)&&T.raise("Duplicate regular expression modifiers")}}}}if(T.eat(58)){if(this.regexp_disjunction(T),T.eat(41))return!0;T.raise("Unterminated group")}}T.pos=M}return!1},Rt.regexp_eatCapturingGroup=function(T){if(T.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(T):T.current()===63&&T.raise("Invalid group"),this.regexp_disjunction(T),T.eat(41))return T.numCapturingParens+=1,!0;T.raise("Unterminated group")}return!1},Rt.regexp_eatModifiers=function(T){for(var M="",Y=0;(Y=T.current())!==-1&&bn(Y);)M+=Be(Y),T.advance();return M},Rt.regexp_eatExtendedAtom=function(T){return T.eat(46)||this.regexp_eatReverseSolidusAtomEscape(T)||this.regexp_eatCharacterClass(T)||this.regexp_eatUncapturingGroup(T)||this.regexp_eatCapturingGroup(T)||this.regexp_eatInvalidBracedQuantifier(T)||this.regexp_eatExtendedPatternCharacter(T)},Rt.regexp_eatInvalidBracedQuantifier=function(T){return this.regexp_eatBracedQuantifier(T,!0)&&T.raise("Nothing to repeat"),!1},Rt.regexp_eatSyntaxCharacter=function(T){var M=T.current();return!!tr(M)&&(T.lastIntValue=M,T.advance(),!0)},Rt.regexp_eatPatternCharacters=function(T){for(var M=T.pos,Y=0;(Y=T.current())!==-1&&!tr(Y);)T.advance();return T.pos!==M},Rt.regexp_eatExtendedPatternCharacter=function(T){var M=T.current();return!(M===-1||M===36||M>=40&&M<=43||M===46||M===63||M===91||M===94||M===124)&&(T.advance(),!0)},Rt.regexp_groupSpecifier=function(T){if(T.eat(63)){this.regexp_eatGroupName(T)||T.raise("Invalid group");var M=this.options.ecmaVersion>=16,Y=T.groupNames[T.lastStringValue];if(Y)if(M)for(var de=0,ke=Y;de=11,de=T.current(Y);return T.advance(Y),de===92&&this.regexp_eatRegExpUnicodeEscapeSequence(T,Y)&&(de=T.lastIntValue),(function(ke){return g(ke,!0)||ke===36||ke===95})(de)?(T.lastIntValue=de,!0):(T.pos=M,!1)},Rt.regexp_eatRegExpIdentifierPart=function(T){var M=T.pos,Y=this.options.ecmaVersion>=11,de=T.current(Y);return T.advance(Y),de===92&&this.regexp_eatRegExpUnicodeEscapeSequence(T,Y)&&(de=T.lastIntValue),(function(ke){return A(ke,!0)||ke===36||ke===95||ke===8204||ke===8205})(de)?(T.lastIntValue=de,!0):(T.pos=M,!1)},Rt.regexp_eatAtomEscape=function(T){return!!(this.regexp_eatBackReference(T)||this.regexp_eatCharacterClassEscape(T)||this.regexp_eatCharacterEscape(T)||T.switchN&&this.regexp_eatKGroupName(T))||(T.switchU&&(T.current()===99&&T.raise("Invalid unicode escape"),T.raise("Invalid escape")),!1)},Rt.regexp_eatBackReference=function(T){var M=T.pos;if(this.regexp_eatDecimalEscape(T)){var Y=T.lastIntValue;if(T.switchU)return Y>T.maxBackReference&&(T.maxBackReference=Y),!0;if(Y<=T.numCapturingParens)return!0;T.pos=M}return!1},Rt.regexp_eatKGroupName=function(T){if(T.eat(107)){if(this.regexp_eatGroupName(T))return T.backReferenceNames.push(T.lastStringValue),!0;T.raise("Invalid named reference")}return!1},Rt.regexp_eatCharacterEscape=function(T){return this.regexp_eatControlEscape(T)||this.regexp_eatCControlLetter(T)||this.regexp_eatZero(T)||this.regexp_eatHexEscapeSequence(T)||this.regexp_eatRegExpUnicodeEscapeSequence(T,!1)||!T.switchU&&this.regexp_eatLegacyOctalEscapeSequence(T)||this.regexp_eatIdentityEscape(T)},Rt.regexp_eatCControlLetter=function(T){var M=T.pos;if(T.eat(99)){if(this.regexp_eatControlLetter(T))return!0;T.pos=M}return!1},Rt.regexp_eatZero=function(T){return T.current()===48&&!As(T.lookahead())&&(T.lastIntValue=0,T.advance(),!0)},Rt.regexp_eatControlEscape=function(T){var M=T.current();return M===116?(T.lastIntValue=9,T.advance(),!0):M===110?(T.lastIntValue=10,T.advance(),!0):M===118?(T.lastIntValue=11,T.advance(),!0):M===102?(T.lastIntValue=12,T.advance(),!0):M===114&&(T.lastIntValue=13,T.advance(),!0)},Rt.regexp_eatControlLetter=function(T){var M=T.current();return!!Kn(M)&&(T.lastIntValue=M%32,T.advance(),!0)},Rt.regexp_eatRegExpUnicodeEscapeSequence=function(T,M){M===void 0&&(M=!1);var Y,de=T.pos,ke=M||T.switchU;if(T.eat(117)){if(this.regexp_eatFixedHexDigits(T,4)){var je=T.lastIntValue;if(ke&&je>=55296&&je<=56319){var Je=T.pos;if(T.eat(92)&&T.eat(117)&&this.regexp_eatFixedHexDigits(T,4)){var ot=T.lastIntValue;if(ot>=56320&&ot<=57343)return T.lastIntValue=1024*(je-55296)+(ot-56320)+65536,!0}T.pos=Je,T.lastIntValue=je}return!0}if(ke&&T.eat(123)&&this.regexp_eatHexDigits(T)&&T.eat(125)&&(Y=T.lastIntValue)>=0&&Y<=1114111)return!0;ke&&T.raise("Invalid unicode escape"),T.pos=de}return!1},Rt.regexp_eatIdentityEscape=function(T){if(T.switchU)return!!this.regexp_eatSyntaxCharacter(T)||!!T.eat(47)&&(T.lastIntValue=47,!0);var M=T.current();return!(M===99||T.switchN&&M===107)&&(T.lastIntValue=M,T.advance(),!0)},Rt.regexp_eatDecimalEscape=function(T){T.lastIntValue=0;var M=T.current();if(M>=49&&M<=57){do T.lastIntValue=10*T.lastIntValue+(M-48),T.advance();while((M=T.current())>=48&&M<=57);return!0}return!1};function ns(T){return Kn(T)||T===95}function dn(T){return ns(T)||As(T)}function As(T){return T>=48&&T<=57}function Jr(T){return T>=48&&T<=57||T>=65&&T<=70||T>=97&&T<=102}function Ur(T){return T>=65&&T<=70?T-65+10:T>=97&&T<=102?T-97+10:T-48}function bo(T){return T>=48&&T<=55}Rt.regexp_eatCharacterClassEscape=function(T){var M=T.current();if((function(ke){return ke===100||ke===68||ke===115||ke===83||ke===119||ke===87})(M))return T.lastIntValue=-1,T.advance(),1;var Y=!1;if(T.switchU&&this.options.ecmaVersion>=9&&((Y=M===80)||M===112)){var de;if(T.lastIntValue=-1,T.advance(),T.eat(123)&&(de=this.regexp_eatUnicodePropertyValueExpression(T))&&T.eat(125))return Y&&de===2&&T.raise("Invalid property name"),de;T.raise("Invalid property name")}return 0},Rt.regexp_eatUnicodePropertyValueExpression=function(T){var M=T.pos;if(this.regexp_eatUnicodePropertyName(T)&&T.eat(61)){var Y=T.lastStringValue;if(this.regexp_eatUnicodePropertyValue(T)){var de=T.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(T,Y,de),1}}if(T.pos=M,this.regexp_eatLoneUnicodePropertyNameOrValue(T)){var ke=T.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(T,ke)}return 0},Rt.regexp_validateUnicodePropertyNameAndValue=function(T,M,Y){Z(T.unicodeProperties.nonBinary,M)||T.raise("Invalid property name"),T.unicodeProperties.nonBinary[M].test(Y)||T.raise("Invalid property value")},Rt.regexp_validateUnicodePropertyNameOrValue=function(T,M){return T.unicodeProperties.binary.test(M)?1:T.switchV&&T.unicodeProperties.binaryOfStrings.test(M)?2:void T.raise("Invalid property name")},Rt.regexp_eatUnicodePropertyName=function(T){var M=0;for(T.lastStringValue="";ns(M=T.current());)T.lastStringValue+=Be(M),T.advance();return T.lastStringValue!==""},Rt.regexp_eatUnicodePropertyValue=function(T){var M=0;for(T.lastStringValue="";dn(M=T.current());)T.lastStringValue+=Be(M),T.advance();return T.lastStringValue!==""},Rt.regexp_eatLoneUnicodePropertyNameOrValue=function(T){return this.regexp_eatUnicodePropertyValue(T)},Rt.regexp_eatCharacterClass=function(T){if(T.eat(91)){var M=T.eat(94),Y=this.regexp_classContents(T);return T.eat(93)||T.raise("Unterminated character class"),M&&Y===2&&T.raise("Negated character class may contain strings"),!0}return!1},Rt.regexp_classContents=function(T){return T.current()===93?1:T.switchV?this.regexp_classSetExpression(T):(this.regexp_nonEmptyClassRanges(T),1)},Rt.regexp_nonEmptyClassRanges=function(T){for(;this.regexp_eatClassAtom(T);){var M=T.lastIntValue;if(T.eat(45)&&this.regexp_eatClassAtom(T)){var Y=T.lastIntValue;!T.switchU||M!==-1&&Y!==-1||T.raise("Invalid character class"),M!==-1&&Y!==-1&&M>Y&&T.raise("Range out of order in character class")}}},Rt.regexp_eatClassAtom=function(T){var M=T.pos;if(T.eat(92)){if(this.regexp_eatClassEscape(T))return!0;if(T.switchU){var Y=T.current();(Y===99||bo(Y))&&T.raise("Invalid class escape"),T.raise("Invalid escape")}T.pos=M}var de=T.current();return de!==93&&(T.lastIntValue=de,T.advance(),!0)},Rt.regexp_eatClassEscape=function(T){var M=T.pos;if(T.eat(98))return T.lastIntValue=8,!0;if(T.switchU&&T.eat(45))return T.lastIntValue=45,!0;if(!T.switchU&&T.eat(99)){if(this.regexp_eatClassControlLetter(T))return!0;T.pos=M}return this.regexp_eatCharacterClassEscape(T)||this.regexp_eatCharacterEscape(T)},Rt.regexp_classSetExpression=function(T){var M,Y=1;if(!this.regexp_eatClassSetRange(T))if(M=this.regexp_eatClassSetOperand(T)){M===2&&(Y=2);for(var de=T.pos;T.eatChars([38,38]);)T.current()!==38&&(M=this.regexp_eatClassSetOperand(T))?M!==2&&(Y=1):T.raise("Invalid character in character class");if(de!==T.pos)return Y;for(;T.eatChars([45,45]);)this.regexp_eatClassSetOperand(T)||T.raise("Invalid character in character class");if(de!==T.pos)return Y}else T.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(T)){if(!(M=this.regexp_eatClassSetOperand(T)))return Y;M===2&&(Y=2)}},Rt.regexp_eatClassSetRange=function(T){var M=T.pos;if(this.regexp_eatClassSetCharacter(T)){var Y=T.lastIntValue;if(T.eat(45)&&this.regexp_eatClassSetCharacter(T)){var de=T.lastIntValue;return Y!==-1&&de!==-1&&Y>de&&T.raise("Range out of order in character class"),!0}T.pos=M}return!1},Rt.regexp_eatClassSetOperand=function(T){return this.regexp_eatClassSetCharacter(T)?1:this.regexp_eatClassStringDisjunction(T)||this.regexp_eatNestedClass(T)},Rt.regexp_eatNestedClass=function(T){var M=T.pos;if(T.eat(91)){var Y=T.eat(94),de=this.regexp_classContents(T);if(T.eat(93))return Y&&de===2&&T.raise("Negated character class may contain strings"),de;T.pos=M}if(T.eat(92)){var ke=this.regexp_eatCharacterClassEscape(T);if(ke)return ke;T.pos=M}return null},Rt.regexp_eatClassStringDisjunction=function(T){var M=T.pos;if(T.eatChars([92,113])){if(T.eat(123)){var Y=this.regexp_classStringDisjunctionContents(T);if(T.eat(125))return Y}else T.raise("Invalid escape");T.pos=M}return null},Rt.regexp_classStringDisjunctionContents=function(T){for(var M=this.regexp_classString(T);T.eat(124);)this.regexp_classString(T)===2&&(M=2);return M},Rt.regexp_classString=function(T){for(var M=0;this.regexp_eatClassSetCharacter(T);)M++;return M===1?1:2},Rt.regexp_eatClassSetCharacter=function(T){var M=T.pos;if(T.eat(92))return!(!this.regexp_eatCharacterEscape(T)&&!this.regexp_eatClassSetReservedPunctuator(T))||(T.eat(98)?(T.lastIntValue=8,!0):(T.pos=M,!1));var Y=T.current();return!(Y<0||Y===T.lookahead()&&(function(de){return de===33||de>=35&&de<=38||de>=42&&de<=44||de===46||de>=58&&de<=64||de===94||de===96||de===126})(Y))&&!(function(de){return de===40||de===41||de===45||de===47||de>=91&&de<=93||de>=123&&de<=125})(Y)&&(T.advance(),T.lastIntValue=Y,!0)},Rt.regexp_eatClassSetReservedPunctuator=function(T){var M=T.current();return!!(function(Y){return Y===33||Y===35||Y===37||Y===38||Y===44||Y===45||Y>=58&&Y<=62||Y===64||Y===96||Y===126})(M)&&(T.lastIntValue=M,T.advance(),!0)},Rt.regexp_eatClassControlLetter=function(T){var M=T.current();return!(!As(M)&&M!==95)&&(T.lastIntValue=M%32,T.advance(),!0)},Rt.regexp_eatHexEscapeSequence=function(T){var M=T.pos;if(T.eat(120)){if(this.regexp_eatFixedHexDigits(T,2))return!0;T.switchU&&T.raise("Invalid escape"),T.pos=M}return!1},Rt.regexp_eatDecimalDigits=function(T){var M=T.pos,Y=0;for(T.lastIntValue=0;As(Y=T.current());)T.lastIntValue=10*T.lastIntValue+(Y-48),T.advance();return T.pos!==M},Rt.regexp_eatHexDigits=function(T){var M=T.pos,Y=0;for(T.lastIntValue=0;Jr(Y=T.current());)T.lastIntValue=16*T.lastIntValue+Ur(Y),T.advance();return T.pos!==M},Rt.regexp_eatLegacyOctalEscapeSequence=function(T){if(this.regexp_eatOctalDigit(T)){var M=T.lastIntValue;if(this.regexp_eatOctalDigit(T)){var Y=T.lastIntValue;M<=3&&this.regexp_eatOctalDigit(T)?T.lastIntValue=64*M+8*Y+T.lastIntValue:T.lastIntValue=8*M+Y}else T.lastIntValue=M;return!0}return!1},Rt.regexp_eatOctalDigit=function(T){var M=T.current();return bo(M)?(T.lastIntValue=M-48,T.advance(),!0):(T.lastIntValue=0,!1)},Rt.regexp_eatFixedHexDigits=function(T,M){var Y=T.pos;T.lastIntValue=0;for(var de=0;de=this.input.length?this.finishToken(w.eof):T.override?T.override(this):void this.readToken(this.fullCharCodeAtPos())},hn.readToken=function(T){return g(T,this.options.ecmaVersion>=6)||T===92?this.readWord():this.getTokenFromCode(T)},hn.fullCharCodeAt=function(T){var M=this.input.charCodeAt(T);if(M<=55295||M>=56320)return M;var Y=this.input.charCodeAt(T+1);return Y<=56319||Y>=57344?M:(M<<10)+Y-56613888},hn.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},hn.skipBlockComment=function(){var T=this.options.onComment&&this.curPosition(),M=this.pos,Y=this.input.indexOf("*/",this.pos+=2);if(Y===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=Y+2,this.options.locations)for(var de=void 0,ke=M;(de=G(this.input,ke,this.pos))>-1;)++this.curLine,ke=this.lineStart=de;this.options.onComment&&this.options.onComment(!0,this.input.slice(M+2,Y),M,this.pos,T,this.curPosition())},hn.skipLineComment=function(T){for(var M=this.pos,Y=this.options.onComment&&this.curPosition(),de=this.input.charCodeAt(this.pos+=T);this.pos8&&T<14||T>=5760&&$.test(String.fromCharCode(T))))break e;++this.pos}}},hn.finishToken=function(T,M){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var Y=this.type;this.type=T,this.value=M,this.updateContext(Y)},hn.readToken_dot=function(){var T=this.input.charCodeAt(this.pos+1);if(T>=48&&T<=57)return this.readNumber(!0);var M=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&T===46&&M===46?(this.pos+=3,this.finishToken(w.ellipsis)):(++this.pos,this.finishToken(w.dot))},hn.readToken_slash=function(){var T=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):T===61?this.finishOp(w.assign,2):this.finishOp(w.slash,1)},hn.readToken_mult_modulo_exp=function(T){var M=this.input.charCodeAt(this.pos+1),Y=1,de=T===42?w.star:w.modulo;return this.options.ecmaVersion>=7&&T===42&&M===42&&(++Y,de=w.starstar,M=this.input.charCodeAt(this.pos+2)),M===61?this.finishOp(w.assign,Y+1):this.finishOp(de,Y)},hn.readToken_pipe_amp=function(T){var M=this.input.charCodeAt(this.pos+1);return M===T?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(w.assign,3):this.finishOp(T===124?w.logicalOR:w.logicalAND,2):M===61?this.finishOp(w.assign,2):this.finishOp(T===124?w.bitwiseOR:w.bitwiseAND,1)},hn.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(w.assign,2):this.finishOp(w.bitwiseXOR,1)},hn.readToken_plus_min=function(T){var M=this.input.charCodeAt(this.pos+1);return M===T?M!==45||this.inModule||this.input.charCodeAt(this.pos+2)!==62||this.lastTokEnd!==0&&!R.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(w.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):M===61?this.finishOp(w.assign,2):this.finishOp(w.plusMin,1)},hn.readToken_lt_gt=function(T){var M=this.input.charCodeAt(this.pos+1),Y=1;return M===T?(Y=T===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Y)===61?this.finishOp(w.assign,Y+1):this.finishOp(w.bitShift,Y)):M!==33||T!==60||this.inModule||this.input.charCodeAt(this.pos+2)!==45||this.input.charCodeAt(this.pos+3)!==45?(M===61&&(Y=2),this.finishOp(w.relational,Y)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},hn.readToken_eq_excl=function(T){var M=this.input.charCodeAt(this.pos+1);return M===61?this.finishOp(w.equality,this.input.charCodeAt(this.pos+2)===61?3:2):T===61&&M===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(w.arrow)):this.finishOp(T===61?w.eq:w.prefix,1)},hn.readToken_question=function(){var T=this.options.ecmaVersion;if(T>=11){var M=this.input.charCodeAt(this.pos+1);if(M===46){var Y=this.input.charCodeAt(this.pos+2);if(Y<48||Y>57)return this.finishOp(w.questionDot,2)}if(M===63)return T>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(w.assign,3):this.finishOp(w.coalesce,2)}return this.finishOp(w.question,1)},hn.readToken_numberSign=function(){var T=35;if(this.options.ecmaVersion>=13&&(++this.pos,g(T=this.fullCharCodeAtPos(),!0)||T===92))return this.finishToken(w.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Be(T)+"'")},hn.getTokenFromCode=function(T){switch(T){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(w.parenL);case 41:return++this.pos,this.finishToken(w.parenR);case 59:return++this.pos,this.finishToken(w.semi);case 44:return++this.pos,this.finishToken(w.comma);case 91:return++this.pos,this.finishToken(w.bracketL);case 93:return++this.pos,this.finishToken(w.bracketR);case 123:return++this.pos,this.finishToken(w.braceL);case 125:return++this.pos,this.finishToken(w.braceR);case 58:return++this.pos,this.finishToken(w.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(w.backQuote);case 48:var M=this.input.charCodeAt(this.pos+1);if(M===120||M===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(M===111||M===79)return this.readRadixNumber(8);if(M===98||M===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(T);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(T);case 124:case 38:return this.readToken_pipe_amp(T);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(T);case 60:case 62:return this.readToken_lt_gt(T);case 61:case 33:return this.readToken_eq_excl(T);case 63:return this.readToken_question();case 126:return this.finishOp(w.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Be(T)+"'")},hn.finishOp=function(T,M){var Y=this.input.slice(this.pos,this.pos+M);return this.pos+=M,this.finishToken(T,Y)},hn.readRegexp=function(){for(var T,M,Y=this.pos;;){this.pos>=this.input.length&&this.raise(Y,"Unterminated regular expression");var de=this.input.charAt(this.pos);if(R.test(de)&&this.raise(Y,"Unterminated regular expression"),T)T=!1;else{if(de==="[")M=!0;else if(de==="]"&&M)M=!1;else if(de==="/"&&!M)break;T=de==="\\"}++this.pos}var ke=this.input.slice(Y,this.pos);++this.pos;var je=this.pos,Je=this.readWord1();this.containsEsc&&this.unexpected(je);var ot=this.regexpState||(this.regexpState=new fn(this));ot.reset(Y,ke,Je),this.validateRegExpFlags(ot),this.validateRegExpPattern(ot);var Qt=null;try{Qt=new RegExp(ke,Je)}catch{}return this.finishToken(w.regexp,{pattern:ke,flags:Je,value:Qt})},hn.readInt=function(T,M,Y){for(var de=this.options.ecmaVersion>=12&&M===void 0,ke=Y&&this.input.charCodeAt(this.pos)===48,je=this.pos,Je=0,ot=0,Qt=0,cn=M??1/0;Qt=97?rn-97+10:rn>=65?rn-65+10:rn>=48&&rn<=57?rn-48:1/0)>=T)break;ot=rn,Je=Je*T+Bn}}return de&&ot===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===je||M!=null&&this.pos-je!==M?null:Je},hn.readRadixNumber=function(T){var M=this.pos;this.pos+=2;var Y=this.readInt(T);return Y==null&&this.raise(this.start+2,"Expected number in radix "+T),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(Y=Xs(this.input.slice(M,this.pos)),++this.pos):g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(w.num,Y)},hn.readNumber=function(T){var M=this.pos;T||this.readInt(10,void 0,!0)!==null||this.raise(M,"Invalid number");var Y=this.pos-M>=2&&this.input.charCodeAt(M)===48;Y&&this.strict&&this.raise(M,"Invalid number");var de=this.input.charCodeAt(this.pos);if(!Y&&!T&&this.options.ecmaVersion>=11&&de===110){var ke=Xs(this.input.slice(M,this.pos));return++this.pos,g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(w.num,ke)}Y&&/[89]/.test(this.input.slice(M,this.pos))&&(Y=!1),de!==46||Y||(++this.pos,this.readInt(10),de=this.input.charCodeAt(this.pos)),de!==69&&de!==101||Y||((de=this.input.charCodeAt(++this.pos))!==43&&de!==45||++this.pos,this.readInt(10)===null&&this.raise(M,"Invalid number")),g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var je,Je=(je=this.input.slice(M,this.pos),Y?parseInt(je,8):parseFloat(je.replace(/_/g,"")));return this.finishToken(w.num,Je)},hn.readCodePoint=function(){var T;if(this.input.charCodeAt(this.pos)===123){this.options.ecmaVersion<6&&this.unexpected();var M=++this.pos;T=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,T>1114111&&this.invalidStringToken(M,"Code point out of bounds")}else T=this.readHexChar(4);return T},hn.readString=function(T){for(var M="",Y=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var de=this.input.charCodeAt(this.pos);if(de===T)break;de===92?(M+=this.input.slice(Y,this.pos),M+=this.readEscapedChar(!1),Y=this.pos):de===8232||de===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(P(de)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return M+=this.input.slice(Y,this.pos++),this.finishToken(w.string,M)};var lo={};hn.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(T){if(T!==lo)throw T;this.readInvalidTemplateToken()}this.inTemplateElement=!1},hn.invalidStringToken=function(T,M){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw lo;this.raise(T,M)},hn.readTmplToken=function(){for(var T="",M=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var Y=this.input.charCodeAt(this.pos);if(Y===96||Y===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos!==this.start||this.type!==w.template&&this.type!==w.invalidTemplate?(T+=this.input.slice(M,this.pos),this.finishToken(w.template,T)):Y===36?(this.pos+=2,this.finishToken(w.dollarBraceL)):(++this.pos,this.finishToken(w.backQuote));if(Y===92)T+=this.input.slice(M,this.pos),T+=this.readEscapedChar(!0),M=this.pos;else if(P(Y)){switch(T+=this.input.slice(M,this.pos),++this.pos,Y){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:T+=` -`;break;default:T+=String.fromCharCode(Y)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),M=this.pos}else++this.pos}},hn.readInvalidTemplateToken=function(){for(;this.pos=48&&M<=55){var de=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],ke=parseInt(de,8);return ke>255&&(de=de.slice(0,-1),ke=parseInt(de,8)),this.pos+=de.length-1,M=this.input.charCodeAt(this.pos),de==="0"&&M!==56&&M!==57||!this.strict&&!T||this.invalidStringToken(this.pos-1-de.length,T?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(ke)}return P(M)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(M)}},hn.readHexChar=function(T){var M=this.pos,Y=this.readInt(16,T);return Y===null&&this.invalidStringToken(M,"Bad character escape sequence"),Y},hn.readWord1=function(){this.containsEsc=!1;for(var T="",M=!0,Y=this.pos,de=this.options.ecmaVersion>=6;this.pos0?`?${Je.join("?")}`:"")+de}function yp(T){return T&&T!=="/"}function Ua(T,...M){let Y=T||"";for(let de of M.filter(ke=>yp(ke)))if(Y){let ke=de.replace(nd,"");Y=rd(Y)+ke}else Y=de;return Y}let zt=/^[A-Za-z]:\//;function Jt(T=""){return T&&T.replace(/\\/g,"/").replace(zt,M=>M.toUpperCase())}let Dn=/^[/\\]{2}/,$n=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,ar=/^[A-Za-z]:$/,Lr=/.(\.[^./]+|\.)$/,_r=function(T){if(T.length===0)return".";let M=(T=Jt(T)).match(Dn),Y=kr(T),de=T[T.length-1]==="/";return(T=Ri(T,!Y)).length===0?Y?"/":de?"./":".":(de&&(T+="/"),ar.test(T)&&(T+="/"),M?Y?`//${T}`:`//./${T}`:Y&&!kr(T)?`/${T}`:T)},zn=function(...T){let M="";for(let Y of T)if(Y)if(M.length>0){let de=M[M.length-1]==="/",ke=Y[0]==="/";M+=de&&ke?Y.slice(1):de||ke?Y:`/${Y}`}else M+=Y;return _r(M)};function ys(){return typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}let pn=function(...T){let M="",Y=!1;for(let de=(T=T.map(ke=>Jt(ke))).length-1;de>=-1&&!Y;de--){let ke=de>=0?T[de]:ys();ke&&ke.length!==0&&(M=`${ke}/${M}`,Y=kr(ke))}return M=Ri(M,!Y),Y&&!kr(M)?`/${M}`:M.length>0?M:"."};function Ri(T,M){let Y="",de=0,ke=-1,je=0,Je=null;for(let ot=0;ot<=T.length;++ot){if(ot2){let Qt=Y.lastIndexOf("/");Qt===-1?(Y="",de=0):(Y=Y.slice(0,Qt),de=Y.length-1-Y.lastIndexOf("/")),ke=ot,je=0;continue}if(Y.length>0){Y="",de=0,ke=ot,je=0;continue}}M&&(Y+=Y.length>0?"/..":"..",de=2)}else Y.length>0?Y+=`/${T.slice(ke+1,ot)}`:Y=T.slice(ke+1,ot),de=ot-ke-1;ke=ot,je=0}else Je==="."&&je!==-1?++je:je=-1}return Y}let kr=function(T){return $n.test(T)},Ii=function(T){if(T==="..")return"";let M=Lr.exec(Jt(T));return M&&M[1]||""},Ko=function(T){let M=Jt(T).replace(/\/$/,"").split("/").slice(0,-1);return M.length===1&&ar.test(M[0])&&(M[0]+="/"),M.join("/")||(kr(T)?"/":".")},oa=function(T,M){let Y=Jt(T).split("/"),de="";for(let ke=Y.length-1;ke>=0;ke--){let je=Y[ke];if(je){de=je;break}}return M&&de.endsWith(M)?de.slice(0,-M.length):de},Nr=require("node:url"),aa=require("node:assert"),ca=require("node:process");var vd=n("node:path");let Gn=require("node:v8"),Ep=require("node:util"),bp=new Set(us.builtinModules);function rs(T){return T.replace(/\\/g,"/")}let Rd={}.hasOwnProperty,_p=/^([A-Z][a-z\d]*)+$/,wb=new Set(["string","function","number","object","Function","Object","boolean","bigint","symbol"]),$a={};function Cl(T,M="and"){return T.length<3?T.join(` ${M} `):`${T.slice(0,-1).join(", ")}, ${M} ${T[T.length-1]}`}let dh=new Map,sd;function uc(T,M,Y){return dh.set(T,M),(function(de,ke){return je;function je(...Je){let ot=Error.stackTraceLimit;im()&&(Error.stackTraceLimit=0);let Qt=new de;im()&&(Error.stackTraceLimit=ot);let cn=(function(rn,Bn,Cn){let Zr=dh.get(rn);if(aa.ok(Zr!==void 0,"expected `message` to be found"),typeof Zr=="function")return aa.ok(Zr.length<=Bn.length,`Code: ${rn}; The provided arguments length (${Bn.length}) does not match the required ones (${Zr.length}).`),Reflect.apply(Zr,Cn,Bn);let Gi=/%[dfijoOs]/g,su=0;for(;Gi.exec(Zr)!==null;)su++;return aa.ok(su===Bn.length,`Code: ${rn}; The provided arguments length (${Bn.length}) does not match the required ones (${su}).`),Bn.length===0?Zr:(Bn.unshift(Zr),Reflect.apply(Ep.format,null,Bn))})(ke,Je,Qt);return Object.defineProperties(Qt,{message:{value:cn,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${ke}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),j0(Qt),Qt.code=ke,Qt}})(Y,T)}function im(){try{if(Gn.startupSnapshot.isBuildingSnapshot())return!1}catch{}let T=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return T===void 0?Object.isExtensible(Error):Rd.call(T,"writable")&&T.writable!==void 0?T.writable:T.set!==void 0}$a.ERR_INVALID_ARG_TYPE=uc("ERR_INVALID_ARG_TYPE",(T,M,Y)=>{aa.ok(typeof T=="string","'name' must be a string"),Array.isArray(M)||(M=[M]);let de="The ";if(T.endsWith(" argument"))de+=`${T} `;else{let ot=T.includes(".")?"property":"argument";de+=`"${T}" ${ot} `}de+="must be ";let ke=[],je=[],Je=[];for(let ot of M)aa.ok(typeof ot=="string","All expected entries have to be of type string"),wb.has(ot)?ke.push(ot.toLowerCase()):_p.exec(ot)===null?(aa.ok(ot!=="object",'The value "object" should be written as "Object"'),Je.push(ot)):je.push(ot);if(je.length>0){let ot=ke.indexOf("object");ot!==-1&&(ke.slice(ot,1),je.push("Object"))}return ke.length>0&&(de+=`${ke.length>1?"one of type":"of type"} ${Cl(ke,"or")}`,(je.length>0||Je.length>0)&&(de+=" or ")),je.length>0&&(de+=`an instance of ${Cl(je,"or")}`,Je.length>0&&(de+=" or ")),Je.length>0&&(Je.length>1?de+=`one of ${Cl(Je,"or")}`:(Je[0].toLowerCase()!==Je[0]&&(de+="an "),de+=`${Je[0]}`)),de+=`. Received ${(function(ot){if(ot==null)return String(ot);if(typeof ot=="function"&&ot.name)return`function ${ot.name}`;if(typeof ot=="object")return ot.constructor&&ot.constructor.name?`an instance of ${ot.constructor.name}`:`${(0,Ep.inspect)(ot,{depth:-1})}`;let Qt=(0,Ep.inspect)(ot,{colors:!1});return Qt.length>28&&(Qt=`${Qt.slice(0,25)}...`),`type ${typeof ot} (${Qt})`})(Y)}`,de},TypeError),$a.ERR_INVALID_MODULE_SPECIFIER=uc("ERR_INVALID_MODULE_SPECIFIER",(T,M,Y=void 0)=>`Invalid module "${T}" ${M}${Y?` imported from ${Y}`:""}`,TypeError),$a.ERR_INVALID_PACKAGE_CONFIG=uc("ERR_INVALID_PACKAGE_CONFIG",(T,M,Y)=>`Invalid package config ${T}${M?` while importing ${M}`:""}${Y?`. ${Y}`:""}`,Error),$a.ERR_INVALID_PACKAGE_TARGET=uc("ERR_INVALID_PACKAGE_TARGET",(T,M,Y,de=!1,ke=void 0)=>{let je=typeof Y=="string"&&!de&&Y.length>0&&!Y.startsWith("./");return M==="."?(aa.ok(de===!1),`Invalid "exports" main target ${JSON.stringify(Y)} defined in the package config ${T}package.json${ke?` imported from ${ke}`:""}${je?'; targets must start with "./"':""}`):`Invalid "${de?"imports":"exports"}" target ${JSON.stringify(Y)} defined for '${M}' in the package config ${T}package.json${ke?` imported from ${ke}`:""}${je?'; targets must start with "./"':""}`},Error),$a.ERR_MODULE_NOT_FOUND=uc("ERR_MODULE_NOT_FOUND",(T,M,Y=!1)=>`Cannot find ${Y?"module":"package"} '${T}' imported from ${M}`,Error),$a.ERR_NETWORK_IMPORT_DISALLOWED=uc("ERR_NETWORK_IMPORT_DISALLOWED","import of '%s' by %s is not supported: %s",Error),$a.ERR_PACKAGE_IMPORT_NOT_DEFINED=uc("ERR_PACKAGE_IMPORT_NOT_DEFINED",(T,M,Y)=>`Package import specifier "${T}" is not defined${M?` in package ${M}package.json`:""} imported from ${Y}`,TypeError),$a.ERR_PACKAGE_PATH_NOT_EXPORTED=uc("ERR_PACKAGE_PATH_NOT_EXPORTED",(T,M,Y=void 0)=>M==="."?`No "exports" main defined in ${T}package.json${Y?` imported from ${Y}`:""}`:`Package subpath '${M}' is not defined by "exports" in ${T}package.json${Y?` imported from ${Y}`:""}`,Error),$a.ERR_UNSUPPORTED_DIR_IMPORT=uc("ERR_UNSUPPORTED_DIR_IMPORT","Directory import '%s' is not supported resolving ES modules imported from %s",Error),$a.ERR_UNSUPPORTED_RESOLVE_REQUEST=uc("ERR_UNSUPPORTED_RESOLVE_REQUEST",'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',TypeError),$a.ERR_UNKNOWN_FILE_EXTENSION=uc("ERR_UNKNOWN_FILE_EXTENSION",(T,M)=>`Unknown file extension "${T}" for ${M}`,TypeError),$a.ERR_INVALID_ARG_VALUE=uc("ERR_INVALID_ARG_VALUE",(T,M,Y="is invalid")=>{let de=(0,Ep.inspect)(M);return de.length>128&&(de=`${de.slice(0,128)}...`),`The ${T.includes(".")?"property":"argument"} '${T}' ${Y}. Received ${de}`},TypeError);let j0=(function(T){let M="__node_internal_"+T.name;return Object.defineProperty(T,"name",{value:M}),T})(function(T){let M=im();return M&&(sd=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY),Error.captureStackTrace(T),M&&(Error.stackTraceLimit=sd),T}),Ty={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:ru}=$a,vy=new Map;function YI(T,{base:M,specifier:Y}){let de=vy.get(T);if(de)return de;let ke;try{ke=Vn.readFileSync(vd.toNamespacedPath(T),"utf8")}catch(Je){let ot=Je;if(ot.code!=="ENOENT")throw ot}let je={exists:!1,pjsonPath:T,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};if(ke!==void 0){let Je;try{Je=JSON.parse(ke)}catch(ot){let Qt=ot,cn=new ru(T,(M?`"${Y}" from `:"")+(0,Nr.fileURLToPath)(M||Y),Qt.message);throw cn.cause=Qt,cn}je.exists=!0,Ty.call(Je,"name")&&typeof Je.name=="string"&&(je.name=Je.name),Ty.call(Je,"main")&&typeof Je.main=="string"&&(je.main=Je.main),Ty.call(Je,"exports")&&(je.exports=Je.exports),Ty.call(Je,"imports")&&(je.imports=Je.imports),!Ty.call(Je,"type")||Je.type!=="commonjs"&&Je.type!=="module"||(je.type=Je.type)}return vy.set(T,je),je}function Tb(T){let M=new URL("package.json",T);for(;!M.pathname.endsWith("node_modules/package.json");){let Y=YI((0,Nr.fileURLToPath)(M),{specifier:T});if(Y.exists)return Y;let de=M;if(M=new URL("../package.json",M),M.pathname===de.pathname)break}return{pjsonPath:(0,Nr.fileURLToPath)(M),exists:!1,type:"none"}}function Su(T){return Tb(T).type}let{ERR_UNKNOWN_FILE_EXTENSION:Tg}=$a,iv={}.hasOwnProperty,De={__proto__:null,".cjs":"commonjs",".js":"module",".json":"json",".mjs":"module"},E={__proto__:null,"data:":function(T){let{1:M}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(T.pathname)||[null,null,null];return(function(Y){return Y&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(Y)?"module":Y==="application/json"?"json":null})(M)},"file:":function(T,M,Y){let de=(function(Je){let ot=Je.pathname,Qt=ot.length;for(;Qt--;){let cn=ot.codePointAt(Qt);if(cn===47)return"";if(cn===46)return ot.codePointAt(Qt-1)===47?"":ot.slice(Qt)}return""})(T);if(de===".js"){let Je=Su(T);return Je!=="none"?Je:"commonjs"}if(de===""){let Je=Su(T);return Je==="none"||Je==="commonjs"?"commonjs":"module"}let ke=De[de];if(ke)return ke;if(Y)return;let je=(0,Nr.fileURLToPath)(T);throw new Tg(de,je)},"http:":v,"https:":v,"node:":()=>"builtin"};function v(){}let B=Object.freeze(["node","import"]),U=new Set(B);function le(T){return U}let ve=RegExp.prototype[Symbol.replace],{ERR_INVALID_MODULE_SPECIFIER:Le,ERR_INVALID_PACKAGE_CONFIG:Ke,ERR_INVALID_PACKAGE_TARGET:Ye,ERR_MODULE_NOT_FOUND:Tt,ERR_PACKAGE_IMPORT_NOT_DEFINED:on,ERR_PACKAGE_PATH_NOT_EXPORTED:nr,ERR_UNSUPPORTED_DIR_IMPORT:Nn,ERR_UNSUPPORTED_RESOLVE_REQUEST:Dr}=$a,ji={}.hasOwnProperty,No=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,Pr=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,la=/^\.|%|\\/,ph=/\*/g,KI=/%2f|%5c/i,zI=new Set,k=/[/\\]{2}/;function W(T,M,Y,de,ke,je,Je){if(ca.noDeprecation)return;let ot=(0,Nr.fileURLToPath)(de),Qt=k.exec(Je?T:M)!==null;ca.emitWarning(`Use of deprecated ${Qt?"double slash":"leading or trailing slash matching"} resolving "${T}" for module request "${M}" ${M===Y?"":`matched to "${Y}" `}in the "${ke?"imports":"exports"}" field module resolution of the package at ${ot}${je?` imported from ${(0,Nr.fileURLToPath)(je)}`:""}.`,"DeprecationWarning","DEP0166")}function pe(T,M,Y,de){if(ca.noDeprecation||(function(Qt,cn){let rn=Qt.protocol;return iv.call(E,rn)&&E[rn](Qt,cn,!0)||null})(T,{parentURL:Y.href})!=="module")return;let je=(0,Nr.fileURLToPath)(T.href),Je=(0,Nr.fileURLToPath)(new URL(".",M)),ot=(0,Nr.fileURLToPath)(Y);de?vd.resolve(Je,de)!==je&&ca.emitWarning(`Package ${Je} has a "main" field set to "${de}", excluding the full filename and extension to the resolved file at "${je.slice(Je.length)}", imported from ${ot}. - Automatic extension resolution of the "main" field is deprecated for ES modules.`,"DeprecationWarning","DEP0151"):ca.emitWarning(`No "main" or "exports" field defined in the package.json for ${Je} resolving the main entry point "${je.slice(Je.length)}", imported from ${ot}. -Default "index" lookups for the main are deprecated for ES modules.`,"DeprecationWarning","DEP0151")}function Ce(T){try{return(0,Vn.statSync)(T)}catch{}}function qe(T){let M=(0,Vn.statSync)(T,{throwIfNoEntry:!1}),Y=M?M.isFile():void 0;return Y!=null&&Y}function ft(T,M,Y){let de;if(M.main!==void 0){if(de=new URL(M.main,T),qe(de))return de;let Je=[`./${M.main}.js`,`./${M.main}.json`,`./${M.main}.node`,`./${M.main}/index.js`,`./${M.main}/index.json`,`./${M.main}/index.node`],ot=-1;for(;++otM):T+M,de,Qt)}throw jt(Y,T,de,Je,ke)}if(No.exec(T.slice(2))!==null){if(Pr.exec(T.slice(2))!==null)throw jt(Y,T,de,Je,ke);if(!ot){let Cn=je?Y.replace("*",()=>M):Y+M;W(je?ve.call(ph,T,()=>M):T,Cn,Y,de,Je,ke,!0)}}let cn=new URL(T,de),rn=cn.pathname,Bn=new URL(".",de).pathname;if(!rn.startsWith(Bn))throw jt(Y,T,de,Je,ke);if(M==="")return cn;if(No.exec(M)!==null){let Cn=je?Y.replace("*",()=>M):Y+M;Pr.exec(M)===null?ot||W(je?ve.call(ph,T,()=>M):T,Cn,Y,de,Je,ke,!1):(function(Zr,Gi,su,ui,no){let Fs=`request is not a valid match in pattern "${Gi}" for the "${ui?"imports":"exports"}" resolution of ${(0,Nr.fileURLToPath)(su)}`;throw new Le(Zr,Fs,no&&(0,Nr.fileURLToPath)(no))})(Cn,Y,de,Je,ke)}return je?new URL(ve.call(ph,cn.href,()=>M)):new URL(M,cn)}function fr(T){let M=Number(T);return`${M}`===T&&M>=0&&M<4294967295}function Fr(T,M,Y,de,ke,je,Je,ot,Qt){if(typeof M=="string")return Fn(M,Y,de,T,ke,je,Je,ot,Qt);if(Array.isArray(M)){let cn=M;if(cn.length===0)return null;let rn,Bn=-1;for(;++Bn=rn.length&&M.endsWith(Cn)&&vc(Je,rn)===1&&rn.lastIndexOf("*")===Bn&&(Je=rn,ot=M.slice(Bn,M.length-Cn.length))}}if(Je){let rn=Fr(T,je[Je],ot,Je,de,!0,!1,M.endsWith("/"),ke);if(rn==null)throw vt(M,T,de);return rn}throw vt(M,T,de)}function vc(T,M){let Y=T.indexOf("*"),de=M.indexOf("*"),ke=Y===-1?T.length:Y+1,je=de===-1?M.length:de+1;return ke>je?-1:je>ke||Y===-1?1:de===-1||T.length>M.length?-1:M.length>T.length?1:0}function ff(T,M,Y){if(T==="#"||T.startsWith("#/")||T.endsWith("/"))throw new Le(T,"is not a valid internal imports specifier name",(0,Nr.fileURLToPath)(M));let de,ke=Tb(M);if(ke.exists){de=(0,Nr.pathToFileURL)(ke.pjsonPath);let je=ke.imports;if(je)if(ji.call(je,T)&&!T.includes("*")){let Je=Fr(de,je[T],"",T,M,!1,!0,!1,Y);if(Je!=null)return Je}else{let Je="",ot="",Qt=Object.getOwnPropertyNames(je),cn=-1;for(;++cn=rn.length&&T.endsWith(Cn)&&vc(Je,rn)===1&&rn.lastIndexOf("*")===Bn&&(Je=rn,ot=T.slice(Bn,T.length-Cn.length))}}if(Je){let rn=Fr(de,je[Je],ot,Je,M,!0,!0,!1,Y);if(rn!=null)return rn}}}throw(function(je,Je,ot){return new on(je,Je&&(0,Nr.fileURLToPath)(new URL(".",Je)),(0,Nr.fileURLToPath)(ot))})(T,de,M)}function om(T,M,Y){if(us.builtinModules.includes(T))return new URL("node:"+T);let{packageName:de,packageSubpath:ke,isScoped:je}=(function(rn,Bn){let Cn=rn.indexOf("/"),Zr=!0,Gi=!1;rn[0]==="@"&&(Gi=!0,Cn===-1||rn.length===0?Zr=!1:Cn=rn.indexOf("/",Cn+1));let su=Cn===-1?rn:rn.slice(0,Cn);if(la.exec(su)!==null&&(Zr=!1),!Zr)throw new Le(rn,"is not a valid package name",(0,Nr.fileURLToPath)(Bn));return{packageName:su,packageSubpath:"."+(Cn===-1?"":rn.slice(Cn)),isScoped:Gi}})(T,M),Je=Tb(M);if(Je.exists){let rn=(0,Nr.pathToFileURL)(Je.pjsonPath);if(Je.name===de&&Je.exports!==void 0&&Je.exports!==null)return uo(rn,ke,Je,M,Y)}let ot,Qt=new URL("./node_modules/"+de+"/package.json",M),cn=(0,Nr.fileURLToPath)(Qt);do{let rn=Ce(cn.slice(0,-13));if(!rn||!rn.isDirectory()){ot=cn,Qt=new URL((je?"../../../../node_modules/":"../../../node_modules/")+de+"/package.json",Qt),cn=(0,Nr.fileURLToPath)(Qt);continue}let Bn=YI(cn,{base:M,specifier:T});return Bn.exports!==void 0&&Bn.exports!==null?uo(Qt,ke,Bn,M,Y):ke==="."?ft(Qt,Bn,M):new URL(ke,Qt)}while(cn.length!==ot.length)}function kd(T,M,Y,de){Y===void 0&&(Y=le());let ke=M.protocol,je=ke==="data:"||ke==="http:"||ke==="https:",Je;if((function(ot){return ot!==""&&(ot[0]==="/"||(function(Qt){return Qt[0]==="."&&(Qt.length===1||Qt[1]==="/"||Qt[1]==="."&&(Qt.length===2||Qt[2]==="/"))})(ot))})(T))try{Je=new URL(T,M)}catch(ot){let Qt=new Dr(T,M);throw Qt.cause=ot,Qt}else if(ke==="file:"&&T[0]==="#")Je=ff(T,M,Y);else try{Je=new URL(T)}catch(ot){if(je&&!us.builtinModules.includes(T)){let Qt=new Dr(T,M);throw Qt.cause=ot,Qt}Je=om(T,M,Y)}return aa.ok(Je!==void 0,"expected to be defined"),Je.protocol!=="file:"?Je:(function(ot,Qt){if(KI.exec(ot.pathname)!==null)throw new Le(ot.pathname,'must not include encoded "/" or "\\" characters',(0,Nr.fileURLToPath)(Qt));let cn;try{cn=(0,Nr.fileURLToPath)(ot)}catch(Bn){let Cn=Bn;throw Object.defineProperty(Cn,"input",{value:String(ot)}),Object.defineProperty(Cn,"module",{value:String(Qt)}),Cn}let rn=Ce(cn.endsWith("/")?cn.slice(-1):cn);if(rn&&rn.isDirectory()){let Bn=new Nn(cn,(0,Nr.fileURLToPath)(Qt));throw Bn.url=String(ot),Bn}if(!rn||!rn.isFile()){let Bn=new Tt(cn||ot.pathname,Qt&&(0,Nr.fileURLToPath)(Qt),!0);throw Bn.url=String(ot),Bn}{let Bn=(0,Vn.realpathSync)(cn),{search:Cn,hash:Zr}=ot;(ot=(0,Nr.pathToFileURL)(Bn+(cn.endsWith(vd.sep)?"/":""))).search=Cn,ot.hash=Zr}return ot})(Je,M)}function Sp(T){return typeof T!="string"||T.startsWith("file://")?rs((0,Nr.fileURLToPath)(T)):rs(T)}function Sr(T){return(0,Nr.pathToFileURL)(Sp(T)).toString()}let Yi=new Set(["node","import"]),_o=[".mjs",".cjs",".js",".json"],Cu=new Set(["ERR_MODULE_NOT_FOUND","ERR_UNSUPPORTED_DIR_IMPORT","MODULE_NOT_FOUND","ERR_PACKAGE_PATH_NOT_EXPORTED"]);function Rc(T,M,Y){try{return kd(T,M,Y)}catch(de){if(!Cu.has(de?.code))throw de}}function ov(T,M={}){if(typeof T!="string"){if(!(T instanceof URL))throw new TypeError("input must be a `string` or `URL`");T=Sp(T)}if(/(?:node|data|http|https):/.test(T))return T;if(bp.has(T))return"node:"+T;if(T.startsWith("file://")&&(T=Sp(T)),kr(T))try{if((0,Vn.statSync)(T).isFile())return Sr(T)}catch(Je){if(Je?.code!=="ENOENT")throw Je}let Y=M.conditions?new Set(M.conditions):Yi,de=(Array.isArray(M.url)?M.url:[M.url]).filter(Boolean).map(Je=>new URL((function(ot){return typeof ot!="string"&&(ot=ot.toString()),/(?:node|data|http|https|file):/.test(ot)?ot:bp.has(ot)?"node:"+ot:"file://"+encodeURI(rs(ot))})(Je.toString())));de.length===0&&de.push(new URL(Sr(process.cwd())));let ke=[...de];for(let Je of de)Je.protocol==="file:"&&ke.push(new URL("./",Je),new URL(Ua(Je.pathname,"_index.js"),Je),new URL("node_modules",Je));let je;for(let Je of ke){if(je=Rc(T,Je,Y),je)break;for(let ot of["","/index"]){for(let Qt of M.extensions||_o)if(je=Rc(Ua(T,ot)+Qt,Je,Y),je)break;if(je)break}if(je)break}if(!je){let Je=new Error(`Cannot find module ${T} imported from ${ke.join(", ")}`);throw Je.code="ERR_MODULE_NOT_FOUND",Je}return Sr(je)}function vg(T,M){return ov(T,M)}function Iu(T,M){return Sp(vg(T,M))}let gf=/(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m,Nd=/\/\*.+?\*\/|\/\/.*(?=[nr])/g;function av(T,M={}){return M.stripComments&&(T=T.replace(Nd,"")),gf.test(T)}function Rg(T){if(typeof T!="string")throw new TypeError("Expected a string");return T.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}let b1=new Set(["/","\\",void 0]),_1=Symbol.for("pathe:normalizedAlias"),Nre=/[/\\]/;function Dre(T){if(T[_1])return T;let M=Object.fromEntries(Object.entries(T).sort(([Y],[de])=>(function(ke,je){return je.split("/").length-ke.split("/").length})(Y,de)));for(let Y in M)for(let de in M)de===Y||Y.startsWith(de)||M[Y]?.startsWith(de)&&b1.has(M[Y][de.length])&&(M[Y]=M[de]+M[Y].slice(de.length));return Object.defineProperty(M,_1,{value:!0,enumerable:!1}),M}function fQ(T="/"){let M=T[T.length-1];return M==="/"||M==="\\"}var IRe={rE:"2.6.1"};let Bre=require("node:crypto");var cv=n.n(Bre);let id=globalThis.process?.env||Object.create(null),vb=globalThis.process||{env:id},S1=vb!==void 0&&vb.env&&vb.env.NODE_ENV||void 0,xRe=[["claude",["CLAUDECODE","CLAUDE_CODE"]],["replit",["REPL_ID"]],["gemini",["GEMINI_CLI"]],["codex",["CODEX_SANDBOX","CODEX_THREAD_ID"]],["opencode",["OPENCODE"]],["pi",[fj("PATH",/\.pi[\\/]agent/)]],["auggie",["AUGMENT_AGENT"]],["goose",["GOOSE_PROVIDER"]],["devin",[fj("EDITOR",/devin/)]],["cursor",["CURSOR_AGENT"]],["kiro",[fj("TERM_PROGRAM",/kiro/)]]];function fj(T,M){return()=>{let Y=id[T];return!!Y&&M.test(Y)}}let gQ=(function(){let T=id.AI_AGENT;if(T)return{name:T.toLowerCase()};for(let[M,Y]of xRe)for(let de of Y)if(typeof de=="string"?id[de]:de())return{name:M};return{}})(),wRe=(gQ.name,gQ.name,[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:!0}],["GOOGLE_CLOUDRUN","K_SERVICE"],["GOOGLE_CLOUDRUN_JOB","CLOUD_RUN_JOB"],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["JENKINS","JENKINS_URL"],["HUDSON","HUDSON_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOY"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}],["EDGEONE_PAGES","EO_PAGES_CI",{ci:!0}]]),AQ=(function(){for(let T of wRe)if(id[T[1]||T[0]])return{name:T[0].toLowerCase(),...T[2]};return id.SHELL==="/bin/jsh"&&vb.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}})(),gj=(AQ.name,vb.platform||""),but=!!id.CI||AQ.ci!==!1,TRe=!!vb.stdout?.isTTY,_ut=(id.DEBUG,S1==="test"||!!id.TEST),Aj=(S1==="production"||id.MODE,S1==="dev"||S1==="development"||id.MODE,id.MINIMAL,/^win/i.test(gj)),Rb=(/^linux/i.test(gj),/^darwin/i.test(gj),!id.NO_COLOR&&(id.FORCE_COLOR||(TRe||Aj)&&id.TERM),(vb.versions?.node||"").replace(/^v/,"")||null),yQ=(Number(Rb?.split(".")[0]),!!vb?.versions?.node),C1="Bun"in globalThis,Pre="Deno"in globalThis,EQ="fastly"in globalThis,JI=[["Netlify"in globalThis,"netlify"],["EdgeRuntime"in globalThis,"edge-light"],[globalThis.navigator?.userAgent==="Cloudflare-Workers","workerd"],[EQ,"fastly"],[Pre,"deno"],[C1,"bun"],[yQ,"node"]];(function(){let T=JI.find(M=>M[0]);T&&T[1]})();let lv=require("node:tty"),kg=lv?.WriteStream?.prototype?.hasColors?.()??!1,Zs=(T,M)=>{if(!kg)return ke=>ke;let Y=`\x1B[${T}m`,de=`\x1B[${M}m`;return ke=>{let je=ke+"",Je=je.indexOf(de);if(Je===-1)return Y+je+de;let ot=Y,Qt=0,cn=(M===22?de:"")+Y;for(;Je!==-1;)ot+=je.slice(Qt,Je)+cn,Qt=Je+de.length,Je=je.indexOf(de,Qt);return ot+=je.slice(Qt)+de,ot}},Ore=(Zs(0,0),Zs(1,22),Zs(2,22),Zs(3,23),Zs(4,24),Zs(53,55),Zs(7,27),Zs(8,28),Zs(9,29),Zs(30,39),Zs(31,39)),Ng=Zs(32,39),I1=Zs(33,39),Mre=Zs(34,39),bQ=(Zs(35,39),Zs(36,39)),vRe=(Zs(37,39),Zs(90,39));Zs(40,49),Zs(41,49),Zs(42,49),Zs(43,49),Zs(44,49),Zs(45,49),Zs(46,49),Zs(47,49),Zs(100,49),Zs(91,39),Zs(92,39),Zs(93,39),Zs(94,39),Zs(95,39),Zs(96,39),Zs(97,39),Zs(101,49),Zs(102,49),Zs(103,49),Zs(104,49),Zs(105,49),Zs(106,49),Zs(107,49);function Lre(T){if(typeof T!="string"||T.startsWith("file://"))return!1;try{return(0,Vn.lstatSync)(T).isDirectory()}catch{return!1}}function Fre(T,M=8){return((function(){if(uv!==void 0)return uv;try{return uv=!!cv().getFips?.(),uv}catch{return uv=!1,uv}})()?cv().createHash("sha256"):cv().createHash("md5")).update(T).digest("hex").slice(0,M)}let Qre={true:Ng("true"),false:I1("false"),"[rebuild]":I1("[rebuild]"),"[esm]":Mre("[esm]"),"[cjs]":Ng("[cjs]"),"[import]":Mre("[import]"),"[require]":Ng("[require]"),"[native]":bQ("[native]"),"[transpile]":I1("[transpile]"),"[fallback]":Ore("[fallback]"),"[unknown]":Ore("[unknown]"),"[hit]":Ng("[hit]"),"[miss]":I1("[miss]"),"[json]":Ng("[json]"),"[data]":Ng("[data]")};function kc(T,...M){if(!T.opts.debug)return;let Y=process.cwd();console.log(vRe(["[jiti]",...M.map(de=>de in Qre?Qre[de]:typeof de!="string"?JSON.stringify(de):de.replace(Y,"."))].join(" ")))}function kb(T,M){return T.opts.interopDefault?(function(Y){let de=typeof Y;if(Y===null||de!=="object"&&de!=="function")return Y;let ke=Y.default,je=typeof ke,Je=ke==null,ot=je==="object"||je==="function";if(Je&&Y instanceof Promise)return Y;let Qt=je==="function"&&de!=="function",cn=ot&&!(ke instanceof Promise),rn=new Map;return new Proxy(Y,{get(Bn,Cn){if(rn.has(Cn))return rn.get(Cn);let Zr;return Cn==="__esModule"?Zr=!0:Cn==="default"?Zr=Je?Y:typeof ke?.default=="function"&&Y.__esModule?ke.default:ke:Cn in Bn?Zr=Bn[Cn]:cn&&(Zr=ke[Cn],typeof Zr=="function"&&(Zr=Zr.bind(ke))),rn.set(Cn,Zr),Zr},apply:Qt?(Bn,Cn,Zr)=>Reflect.apply(ke,Cn,Zr):void 0})})(M):M}let uv;function Ry(T,M){return!!XI(T,M)}function XI(T,M,Y){let de=process.env[T];if(!(T in process.env))return M;try{return JSON.parse(de)}catch{return Y?de:M}}let Ure=/\.(c|m)?j(sx?)$/,$re=/\.(c|m)?t(sx?)$/;function dv(T,M,Y){let de,ke;if(T.isNativeRe.test(M))return M;if(T.resolveTsConfigPaths&&!Y.skipTsConfigPaths){let ot=T.resolveTsConfigPaths(M);for(let Qt of ot){let cn=dv(T,Qt,{...Y,try:!0,skipTsConfigPaths:!0});if(cn)return cn}}T.alias&&(M=(function(ot,Qt){let cn=Jt(ot);Qt=Dre(Qt);for(let[rn,Bn]of Object.entries(Qt)){if(!cn.startsWith(rn))continue;let Cn=fQ(rn)?rn.slice(0,-1):rn;if(fQ(cn[Cn.length]))return zn(Bn,cn.slice(rn.length))}return cn})(M,T.alias));let je=Y?.parentURL||T.url;Lre(je)&&(je=zn(je,"_index.js"));let Je=(Y?.async?[Y?.conditions,["node","import"],["node","require"]]:[Y?.conditions,["node","require"],["node","import"]]).filter(Boolean);for(let ot of Je){try{de=Iu(M,{url:je,conditions:ot,extensions:T.opts.extensions})}catch(Qt){ke=Qt}if(de)return de}try{return T.nativeRequire.resolve(M,{paths:Y.paths})}catch(ot){ke=ot}for(let ot of T.additionalExts)if(de=yj(T,M+ot,je,Y)||yj(T,M+"/index"+ot,je,Y),de||($re.test(T.filename)||$re.test(T.parentModule?.filename||"")||Ure.test(M))&&(de=yj(T,M.replace(Ure,".$1t$2"),je,Y),de))return de;if(!Y?.try)throw ke}function yj(T,M,Y,de){try{return T.nativeRequire.resolve(M,{...de,paths:[Ko(Sp(Y)),...de?.paths||[]]})}catch{}}let Gre=require("node:fs/promises"),Wre=require("node:perf_hooks"),RRe=require("node:vm");var Dd=n.n(RRe);function Y0(T,M,Y){let de=T.parentCache||{};if(M.startsWith("node:"))return K0(T,M,Y.async);if(M.startsWith("file:"))M=(0,Nr.fileURLToPath)(M);else if(M.startsWith("data:")){if(!Y.async)throw new Error("`data:` URLs are only supported in ESM context. Use `import` or `jiti.import` instead.");return kc(T,"[native]","[data]","[import]",M),K0(T,M,!0)}if(us.builtinModules.includes(M)||M===".pnp.js")return K0(T,M,Y.async);if(T.opts.virtualModules&&M in T.opts.virtualModules){kc(T,"[virtual]",M);let ot=T.opts.virtualModules[M];return Y.async?Promise.resolve(kb(T,ot)):kb(T,ot)}if(T.opts.tryNative&&!T.opts.transformOptions)try{if(!(M=dv(T,M,Y))&&Y.try)return;if(kc(T,"[try-native]",Y.async&&T.nativeImport?"[import]":"[require]",M),Y.async&&T.nativeImport)return T.nativeImport(M).then(ot=>(T.opts.moduleCache===!1&&delete T.nativeRequire.cache[M],kb(T,ot))).catch(ot=>(kc(T,`[try-native] Using fallback for ${M} because of an error:`,ot),Y0({...T,opts:{...T.opts,tryNative:!1}},M,Y)));{let ot=T.nativeRequire(M);return T.opts.moduleCache===!1&&delete T.nativeRequire.cache[M],kb(T,ot)}}catch(ot){kc(T,`[try-native] Using fallback for ${M} because of an error:`,ot)}let ke=dv(T,M,Y);if(!ke&&Y.try)return;let je=Ii(ke);if(je===".json"){kc(T,"[json]",ke);let ot=T.nativeRequire(ke);return ot&&!("default"in ot)&&Object.defineProperty(ot,"default",{value:ot,enumerable:!1}),ot}if(je&&!T.opts.extensions.includes(je))return kc(T,"[native]","[unknown]",Y.async?"[import]":"[require]",ke),K0(T,ke,Y.async);if(T.isNativeRe.test(ke))return kc(T,"[native]",Y.async?"[import]":"[require]",ke),K0(T,ke,Y.async);if(de[ke])return kb(T,de[ke]?.exports);if(T.opts.moduleCache){let ot=T.nativeRequire.cache[ke];if(ot?.loaded)return kb(T,ot.exports)}let Je=(0,Vn.readFileSync)(ke,"utf8");return ZI(T,Je,{id:M,filename:ke,ext:je,cache:de,async:Y.async})}function K0(T,M,Y){return Y&&T.nativeImport?T.nativeImport((function(de){return Aj&&kr(de)?Sr(de):de})(M)).then(de=>kb(T,de)):kb(T,T.nativeRequire(M))}let Ej="9";function z0(T,M,Y){if(!T.opts.fsCache||!M.filename)return Y();let de=` /* v${Ej}-${Fre(M.source,16)} */ -`,ke=`${oa(Ko(M.filename))}-${(function(Qt){let cn=Qt.split(Nre).pop();if(!cn)return;let rn=cn.lastIndexOf(".");return rn<=0?cn:cn.slice(0,rn)})(M.filename)}`+(T.opts.sourceMaps?"+map":"")+(M.interopDefault?".i":"")+`.${Fre(M.filename)}`+(M.async?".mjs":".cjs");M.jsx&&M.filename.endsWith("x")&&(ke+="x");let je=T.opts.fsCache,Je=zn(je,ke);if(!T.opts.rebuildFsCache&&(0,Vn.existsSync)(Je)){let Qt=(0,Vn.readFileSync)(Je,"utf8");if(Qt.endsWith(de))return kc(T,"[cache]","[hit]",M.filename,"~>",Je),Qt}kc(T,"[cache]","[miss]",M.filename);let ot=Y();return ot.includes("__JITI_ERROR__")||((0,Vn.writeFileSync)(Je,ot+de,"utf8"),kc(T,"[cache]","[store]",M.filename,"~>",Je)),ot}function J0(T){if(T.opts.fsCache===!0&&(T.opts.fsCache=(function(M){let Y=M.filename&&pn(M.filename,"../node_modules");if(Y&&(0,Vn.existsSync)(Y))return zn(Y,".cache/jiti");let de=(0,s.tmpdir)();if(process.env.TMPDIR&&de===process.cwd()&&!process.env.JITI_RESPECT_TMPDIR_ENV){let ke=process.env.TMPDIR;delete process.env.TMPDIR,de=(0,s.tmpdir)(),process.env.TMPDIR=ke}return zn(de,"jiti")})(T)),T.opts.fsCache)try{if((0,Vn.mkdirSync)(T.opts.fsCache,{recursive:!0}),!(function(M){try{return(0,Vn.accessSync)(M,Vn.constants.W_OK),!0}catch{return!1}})(T.opts.fsCache))throw new Error("directory is not writable!")}catch(M){kc(T,"Error creating cache directory at ",T.opts.fsCache,M),T.opts.fsCache=!1}}function am(T,M){let Y=z0(T,M,()=>{let de=T.opts.transform({...T.opts.transformOptions,babel:{...T.opts.sourceMaps?{sourceFileName:M.filename,sourceMaps:"inline"}:{},...T.opts.transformOptions?.babel},interopDefault:T.opts.interopDefault,...M});return de.error&&T.opts.debug&&kc(T,de.error),de.code});return Y.startsWith("#!")&&(Y="// "+Y),Y}function ZI(T,M,Y={}){let de=Y.id||(Y.filename?oa(Y.filename):`_jitiEval.${Y.ext||(Y.async?"mjs":"js")}`),ke=Y.filename||dv(T,de,{async:Y.async}),je=Y.ext||Ii(ke),Je=Y.cache||T.parentCache||{},ot=/\.[cm]?tsx?$/.test(je),Qt=je===".mjs"||je===".js"&&(function(Fs){for(;Fs&&Fs!=="."&&Fs!=="/";){Fs=zn(Fs,"..");try{let Nb=(0,Vn.readFileSync)(zn(Fs,"package.json"),"utf8");try{return JSON.parse(Nb)}catch{}break}catch{}}})(ke)?.type==="module",cn=je===".cjs",rn=Y.forceTranspile??(!cn&&!(Qt&&Y.async)&&(ot||Qt||T.isTransformRe.test(ke)||av(M))),Bn=Wre.performance.now();if(rn){M=am(T,{filename:ke,source:M,ts:ot,async:Y.async??!1,jsx:T.opts.jsx});let Fs=Math.round(1e3*(Wre.performance.now()-Bn))/1e3;kc(T,"[transpile]",Y.async?"[esm]":"[cjs]",ke,`(${Fs}ms)`)}else{if(kc(T,"[native]",Y.async?"[import]":"[require]",ke),Y.async)return Promise.resolve(K0(T,ke,Y.async)).catch(Fs=>(kc(T,"Native import error:",Fs),kc(T,"[fallback]",ke),ZI(T,M,{...Y,forceTranspile:!0})));try{return K0(T,ke,Y.async)}catch(Fs){kc(T,"Native require error:",Fs),kc(T,"[fallback]",ke),M=am(T,{filename:ke,source:M,ts:ot,async:Y.async??!1,jsx:T.opts.jsx})}}let Cn=new us.Module(ke);Cn.filename=ke,T.parentModule&&(Cn.parent=T.parentModule,Array.isArray(T.parentModule.children)&&!T.parentModule.children.includes(Cn)&&T.parentModule.children.push(Cn));let Zr=X0(ke,T.opts,{parentModule:Cn,parentCache:Je,nativeImport:T.nativeImport,onError:T.onError,createRequire:T.createRequire},!0),Gi;Cn.require=Zr,Cn.path=Ko(ke),Cn.paths=us.Module._nodeModulePaths(Cn.path),Je[ke]=Cn,T.opts.moduleCache&&(T.nativeRequire.cache[ke]=Cn);let su=(function(Fs,Nb){return`(${Nb?.async?"async ":""}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${Fs} -});`})(M,{async:Y.async});try{Gi=Dd().runInThisContext(su,{filename:ke,lineOffset:0,displayErrors:!1})}catch(Fs){Fs.name==="SyntaxError"&&Y.async&&T.nativeImport?(kc(T,"[esm]","[import]","[fallback]",ke),Gi=(function(Nb,pv,ky,ex,_Q){let Hre=`export default ${pv}`,x1=_Q?void 0:`data:text/javascript;base64,${Buffer.from(Hre).toString("base64")}`;return(...Vre)=>{let w1,bj=()=>(w1=(function(hv,jre){let Yre=zn((0,s.tmpdir)(),"jiti-esm");try{(0,Vn.mkdirSync)(Yre,{recursive:!0})}catch{}let Kre=zn(Yre,`${oa(jre,Ii(jre))}-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`);return(0,Vn.writeFileSync)(Kre,hv),Kre})(Hre,ky),kc(Nb,"[esm]","[tempfile]",w1),ex(Sr(w1)));return(x1?ex(x1).catch(hv=>{if(hv?.code!=="ENAMETOOLONG")throw hv;return bj()}):bj()).then(hv=>hv.default(...Vre)).finally(()=>{w1&&(0,Gre.unlink)(w1).catch(()=>{})})}})(T,su,ke,T.nativeImport,T.opts.esmEvalTempFile)):(T.opts.moduleCache&&delete T.nativeRequire.cache[ke],T.onError(Fs))}let ui;try{ui=Gi(Cn.exports,Cn.require,Cn,Cn.filename,Ko(Cn.filename),Zr.import,Zr.esmResolve)}catch(Fs){T.opts.moduleCache&&delete T.nativeRequire.cache[ke],T.onError(Fs)}function no(){if(Cn.exports&&Cn.exports.__JITI_ERROR__){let{filename:Fs,line:Nb,column:pv,code:ky,message:ex}=Cn.exports.__JITI_ERROR__,_Q=new Error(`${ky}: ${ex} - ${`${Fs}:${Nb}:${pv}`}`);Error.captureStackTrace(_Q,Y0),T.onError(_Q)}return Cn.loaded=!0,kb(T,Cn.exports)}return Y.async?Promise.resolve(ui).then(no):no()}let qre=(0,s.platform)()==="win32";function X0(T,M={},Y,de=!1){let ke=de?M:(function(ui){let no={fsCache:Ry("JITI_FS_CACHE",Ry("JITI_CACHE",!0)),rebuildFsCache:Ry("JITI_REBUILD_FS_CACHE",!1),moduleCache:Ry("JITI_MODULE_CACHE",Ry("JITI_REQUIRE_CACHE",!0)),debug:Ry("JITI_DEBUG",!1),sourceMaps:Ry("JITI_SOURCE_MAPS",!1),interopDefault:Ry("JITI_INTEROP_DEFAULT",!0),extensions:XI("JITI_EXTENSIONS",[".js",".mjs",".cjs",".ts",".tsx",".mts",".cts",".mtsx",".ctsx"]),alias:XI("JITI_ALIAS",{}),nativeModules:XI("JITI_NATIVE_MODULES",[]),transformModules:XI("JITI_TRANSFORM_MODULES",[]),tryNative:XI("JITI_TRY_NATIVE","Bun"in globalThis),esmEvalTempFile:Ry("JITI_ESM_EVAL_TEMP_FILE",!1),jsx:Ry("JITI_JSX",!1),tsconfigPaths:XI("JITI_TSCONFIG_PATHS",!1,!0)};no.jsx&&no.extensions.push(".jsx",".tsx");let Fs={};return ui.cache!==void 0&&(Fs.fsCache=ui.cache),ui.requireCache!==void 0&&(Fs.moduleCache=ui.requireCache),{...no,...Fs,...ui}})(M);typeof T=="string"&&T.startsWith("file://")&&(T=Sp(T));let je=ke.alias&&Object.keys(ke.alias).length>0?Dre(ke.alias||{}):void 0,Je;if(ke.tsconfigPaths){let{getTsconfig:ui,createPathsMatcher:no}=n("./node_modules/.pnpm/get-tsconfig@4.14.0/node_modules/get-tsconfig/dist/index.cjs"),Fs=ui(typeof ke.tsconfigPaths=="string"?ke.tsconfigPaths:Ko(T));Fs&&(Je=no(Fs))}let ot=["typescript","jiti",...ke.nativeModules||[]],Qt=new RegExp(`node_modules/(${ot.map(ui=>Rg(ui)).join("|")})/`),cn=[...ke.transformModules||[]],rn=new RegExp(`node_modules/(${cn.map(ui=>Rg(ui)).join("|")})/`);T||(T=process.cwd()),!de&&Lre(T)&&(T=zn(T,"_index.js"));let Bn=Sr(T),Cn=[...ke.extensions].filter(ui=>ui!==".js"),Zr=Y.createRequire(qre?T.replace(/\//g,"\\"):T),Gi={filename:T,url:Bn,opts:ke,alias:je,resolveTsConfigPaths:Je,nativeModules:ot,transformModules:cn,isNativeRe:Qt,isTransformRe:rn,additionalExts:Cn,nativeRequire:Zr,onError:Y.onError,parentModule:Y.parentModule,parentCache:Y.parentCache,nativeImport:Y.nativeImport,createRequire:Y.createRequire};return de||kc(Gi,"[init]",...[["version:",IRe.rE],["module-cache:",ke.moduleCache],["fs-cache:",ke.fsCache],["rebuild-fs-cache:",ke.rebuildFsCache],["interop-defaults:",ke.interopDefault]].flat()),de||J0(Gi),Object.assign(function(ui){return Y0(Gi,ui,{async:!1})},{cache:ke.moduleCache?Zr.cache:Object.create(null),extensions:Zr.extensions,main:Zr.main,options:ke,resolve:Object.assign(function(ui,no){return dv(Gi,ui,{...no,async:!1})},{paths:Zr.resolve.paths}),transform:ui=>am(Gi,ui),evalModule:(ui,no)=>ZI(Gi,ui,no),async import(ui,no){let Fs=await Y0(Gi,ui,{...no,async:!0});return no?.default?Fs?.default??Fs:Fs},esmResolve(ui,no){typeof no=="string"&&(no={parentURL:no});let Fs=dv(Gi,ui,{parentURL:Bn,...no,async:!0});return!Fs||typeof Fs!="string"||Fs.startsWith("file://")?Fs:Sr(Fs)}})}})(),Tbn.exports=r.default})()});var Nbn=ee((OHa,kbn)=>{p();(()=>{var t={"./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/config/files lazy recursive"(s){function i(o){return Promise.resolve().then(function(){var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a})}i.keys=()=>[],i.resolve=i,i.id="./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/config/files lazy recursive",s.exports=i},"./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/config/files sync recursive"(s){function i(o){var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}i.keys=()=>[],i.resolve=i,i.id="./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/config/files sync recursive",s.exports=i},"./node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.29.0/node_modules/@babel/plugin-syntax-class-properties/lib/index.js"(s,i,o){"use strict";i.A=void 0;var a=(0,o("./node_modules/.pnpm/@babel+helper-plugin-utils@7.28.6/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)(c=>(c.assertVersion(7),{name:"syntax-class-properties",manipulateOptions(u,l){l.plugins.push("classProperties","classPrivateProperties","classPrivateMethods")}}));i.A=a},"./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"(s,i,o){var a;(function(c,u,l){"use strict";var d=Object.create,h=Object.defineProperty,m=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,g=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty,y=(it,ze)=>function(){return ze||(0,it[f(it)[0]])((ze={exports:{}}).exports,ze),ze.exports},b=(it,ze)=>{for(var rt in ze)h(it,rt,{get:ze[rt],enumerable:!0})},S=(it,ze,rt,Ct)=>{if(ze&&typeof ze=="object"||typeof ze=="function")for(let sn of f(ze))A.call(it,sn)||sn===rt||h(it,sn,{get:()=>ze[sn],enumerable:!(Ct=m(ze,sn))||Ct.enumerable});return it},C=(it,ze,rt)=>(rt=it!=null?d(g(it)):{},S(!ze&&it&&it.__esModule?rt:h(rt,"default",{value:it,enumerable:!0}),it)),I=it=>S(h({},"__esModule",{value:!0}),it),x=y({"umd:@jridgewell/sourcemap-codec"(it,ze){ze.exports=u}}),w=y({"umd:@jridgewell/trace-mapping"(it,ze){ze.exports=l}}),R={};b(R,{GenMapping:()=>Me,addMapping:()=>ie,addSegment:()=>se,allMappings:()=>Ae,fromMap:()=>me,maybeAddMapping:()=>J,maybeAddSegment:()=>ne,setIgnore:()=>j,setSourceContent:()=>te,toDecodedMap:()=>X,toEncodedMap:()=>ae}),c.exports=I(R);var N=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function P(it){return it}function G(it,ze){return it._indexes[ze]}function $(it,ze){let rt=G(it,ze);if(rt!==void 0)return rt;let{array:Ct,_indexes:sn}=it,Mt=Ct.push(ze);return sn[ze]=Mt-1}function Q(it,ze){let rt=G(it,ze);if(rt===void 0)return;let{array:Ct,_indexes:sn}=it;for(let Mt=rt+1;Mtue(!0,it,ze,rt,Ct,sn,Mt,Lt,Pt),J=(it,ze)=>dt(!0,it,ze);function te(it,ze,rt){let{_sources:Ct,_sourcesContent:sn}=it;sn[$(Ct,ze)]=rt}function j(it,ze,rt=!0){let{_sources:Ct,_sourcesContent:sn,_ignoreList:Mt}=it,Lt=$(Ct,ze);Lt===sn.length&&(sn[Lt]=null),rt?$(Mt,Lt):Q(Mt,Lt)}function X(it){let{_mappings:ze,_sources:rt,_sourcesContent:Ct,_names:sn,_ignoreList:Mt}=it;return _e(ze),{version:3,file:it.file||void 0,names:sn.array,sourceRoot:it.sourceRoot||void 0,sources:rt.array,sourcesContent:Ct,mappings:ze,ignoreList:Mt.array}}function ae(it){let ze=X(it);return Object.assign({},ze,{mappings:(0,H.encode)(ze.mappings)})}function me(it){let ze=new oe.TraceMap(it),rt=new Me({file:ze.file,sourceRoot:ze.sourceRoot});return z(rt._names,ze.names),z(rt._sources,ze.sources),rt._sourcesContent=ze.sourcesContent||ze.sources.map(()=>null),rt._mappings=(0,oe.decodedMappings)(ze),ze.ignoreList&&z(rt._ignoreList,ze.ignoreList),rt}function Ae(it){let ze=[],{_mappings:rt,_sources:Ct,_names:sn}=it;for(let Mt=0;Mt=0&&!(ze>=it[Ct][re]);rt=Ct--);return rt}function Te(it,ze,rt){for(let Ct=it.length;Ct>ze;Ct--)it[Ct]=it[Ct-1];it[ze]=rt}function _e(it){let{length:ze}=it,rt=ze;for(let Ct=rt-1;Ct>=0&&!(it[Ct].length>0);rt=Ct,Ct--);rtfunction(){return J||(0,ne[f(ne)[0]])((J={exports:{}}).exports,J),J.exports},b=(ne,J)=>{for(var te in J)h(ne,te,{get:J[te],enumerable:!0})},S=(ne,J,te,j)=>{if(J&&typeof J=="object"||typeof J=="function")for(let X of f(J))A.call(ne,X)||X===te||h(ne,X,{get:()=>J[X],enumerable:!(j=m(J,X))||j.enumerable});return ne},C=(ne,J,te)=>(te=ne!=null?d(g(ne)):{},S(!J&&ne&&ne.__esModule?te:h(te,"default",{value:ne,enumerable:!0}),ne)),I=ne=>S(h({},"__esModule",{value:!0}),ne),x=y({"umd:@jridgewell/trace-mapping"(ne,J){J.exports=l}}),w=y({"umd:@jridgewell/gen-mapping"(ne,J){J.exports=u}}),R={};b(R,{default:()=>ie}),c.exports=I(R);var N=C(x()),P=C(w()),G=C(x()),$=H("",-1,-1,"",null,!1),Q=[];function H(ne,J,te,j,X,ae){return{source:ne,line:J,column:te,name:j,content:X,ignore:ae}}function oe(ne,J,te,j,X){return{map:ne,sources:J,source:te,content:j,ignore:X}}function re(ne,J){return oe(ne,J,"",null,!1)}function Z(ne,J,te){return oe(null,Q,ne,J,te)}function q(ne){let J=new P.GenMapping({file:ne.map.file}),{sources:te,map:j}=ne,X=j.names,ae=(0,G.decodedMappings)(j);for(let me=0;menew N.TraceMap(ae,"")),j=te.pop();for(let ae=0;ae1)throw new Error(`Transformation map ${ae} must have exactly one source file. -Did you specify these with the most recent transformation maps first?`);let X=Me(j,J,"",0);for(let ae=te.length-1;ae>=0;ae--)X=re(te[ae],[X]);return X}function Me(ne,J,te,j){let{resolvedSources:X,sourcesContent:ae,ignoreList:me}=ne,Ae=j+1;return re(ne,X.map((ue,ye)=>{let Ie={importer:te,depth:Ae,source:ue||"",content:void 0,ignore:void 0},Ee=J(Ie.source,Ie),{source:Te,content:_e,ignore:z}=Ie;return Ee?Me(new N.TraceMap(Ee,Te),J,Te,Ae):Z(Te,_e!==void 0?_e:ae?ae[ye]:null,z!==void 0?z:!!me&&me.includes(ye))}))}var Re=C(w()),se=class{constructor(ne,J){let te=J.decodedMappings?(0,Re.toDecodedMap)(ne):(0,Re.toEncodedMap)(ne);this.version=te.version,this.file=te.file,this.mappings=te.mappings,this.names=te.names,this.ignoreList=te.ignoreList,this.sourceRoot=te.sourceRoot,this.sources=te.sources,J.excludeContent||(this.sourcesContent=te.sourcesContent)}toString(){return JSON.stringify(this)}};function ie(ne,J,te){let j=typeof te=="object"?te:{excludeContent:!!te,decodedMappings:!1},X=Be(ne,J);return new se(q(X),j)}})(s=o.nmd(s),o("./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"),o("./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js")),s.exports="default"in(a=s).exports?a.exports.default:a.exports},"./node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"(s){s.exports=(function(){"use strict";let i=/^[\w+.-]+:\/\//,o=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,a=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function c(I){return i.test(I)}function u(I){return I.startsWith("//")}function l(I){return I.startsWith("/")}function d(I){return I.startsWith("file:")}function h(I){return/^[.?#]/.test(I)}function m(I){let x=o.exec(I);return g(x[1],x[2]||"",x[3],x[4]||"",x[5]||"/",x[6]||"",x[7]||"")}function f(I){let x=a.exec(I),w=x[2];return g("file:","",x[1]||"","",l(w)?w:"/"+w,x[3]||"",x[4]||"")}function g(I,x,w,R,N,P,G){return{scheme:I,user:x,host:w,port:R,path:N,query:P,hash:G,type:7}}function A(I){if(u(I)){let w=m("http:"+I);return w.scheme="",w.type=6,w}if(l(I)){let w=m("http://foo.com"+I);return w.scheme="",w.host="",w.type=5,w}if(d(I))return f(I);if(c(I))return m(I);let x=m("http://foo.com/"+I);return x.scheme="",x.host="",x.type=I?I.startsWith("?")?3:I.startsWith("#")?2:4:1,x}function y(I){if(I.endsWith("/.."))return I;let x=I.lastIndexOf("/");return I.slice(0,x+1)}function b(I,x){S(x,x.type),I.path==="/"?I.path=x.path:I.path=y(x.path)+I.path}function S(I,x){let w=x<=4,R=I.path.split("/"),N=1,P=0,G=!1;for(let Q=1;QR&&(R=G)}S(w,R);let N=w.query+w.hash;switch(R){case 2:case 3:return N;case 4:{let P=w.path.slice(1);return P?h(x||I)&&!h(P)?"./"+P+N:P+N:N||"."}case 5:return w.path+N;default:return w.scheme+"//"+w.user+w.host+w.port+w.path+N}}return C})()},"./node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(s,i,o){var a;(function(c){"use strict";var u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,m=(se,ie,ne,J)=>{if(ie&&typeof ie=="object"||typeof ie=="function")for(let te of d(ie))h.call(se,te)||te===ne||u(se,te,{get:()=>ie[te],enumerable:!(J=l(ie,te))||J.enumerable});return se},f=se=>m(u({},"__esModule",{value:!0}),se),g={};((se,ie)=>{for(var ne in ie)u(se,ne,{get:ie[ne],enumerable:!0})})(g,{decode:()=>be,decodeGeneratedRanges:()=>re,decodeOriginalScopes:()=>Q,encode:()=>Re,encodeGeneratedRanges:()=>Z,encodeOriginalScopes:()=>H}),c.exports=f(g);var A=44,y=59,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S=new Uint8Array(64),C=new Uint8Array(128);for(let se=0;se>>=1,j&&(ne=-2147483648|-ne),ie+ne}function x(se,ie,ne){let J=ie-ne;J=J<0?-J<<1|1:J<<1;do{let te=31&J;J>>>=5,J>0&&(te|=32),se.write(S[te])}while(J>0);return ie}function w(se,ie){return!(se.pos>=ie)&&se.peek()!==A}var R=16384,N=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode:se=>Buffer.from(se.buffer,se.byteOffset,se.byteLength).toString()}:{decode(se){let ie="";for(let ne=0;ne0?ie+N.decode(se.subarray(0,ne)):ie}},G=class{constructor(se){this.pos=0,this.buffer=se}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(se){let{buffer:ie,pos:ne}=this,J=ie.indexOf(se,ne);return J===-1?ie.length:J}},$=[];function Q(se){let{length:ie}=se,ne=new G(se),J=[],te=[],j=0;for(;ne.pos0&&ne.write(A),J[0]=x(ne,j,J[0]),x(ne,X,0),x(ne,Ae,0),x(ne,te.length===6?1:0,0),te.length===6&&x(ne,te[5],0);for(let ye of ue)x(ne,ye,0);for(ie++;ieae||Ie===ae&&Ee>=me)break;ie=oe(se,ie,ne,J)}return ne.write(A),J[0]=x(ne,ae,J[0]),x(ne,me,0),ie}function re(se){let{length:ie}=se,ne=new G(se),J=[],te=[],j=0,X=0,ae=0,me=0,Ae=0,ue=0,ye=0,Ie=0;do{let Ee=ne.indexOf(";"),Te=0;for(;ne.posze;Ct--){let sn=ye;ye=I(ne,ye),Ie=I(ne,ye===sn?Ie:0);let Mt=I(ne,0);rt.push([Mt,ye,Ie])}}else rt=[[ze]];it.push(rt)}while(w(ne,Ee))}He.bindings=it,J.push(He),te.push(He)}j++,ne.pos=Ee+1}while(ne.pos0&&ne.write(A),J[1]=x(ne,te[1],J[1]),x(ne,(te.length===6?1:0)|(ue?2:0)|(Ae?4:0),0),te.length===6){let{4:Ie,5:Ee}=te;Ie!==J[2]&&(J[3]=0),J[2]=x(ne,Ie,J[2]),J[3]=x(ne,Ee,J[3])}if(ue){let{0:Ie,1:Ee,2:Te}=te.callsite;Ie!==J[4]?(J[5]=0,J[6]=0):Ee!==J[5]&&(J[6]=0),J[4]=x(ne,Ie,J[4]),J[5]=x(ne,Ee,J[5]),J[6]=x(ne,Te,J[6])}if(ye)for(let Ie of ye){Ie.length>1&&x(ne,-Ie.length,0),x(ne,Ie[0][0],0);let Ee=j,Te=X;for(let _e=1;_eae||Ee===ae&&Te>=me)break;ie=q(se,ie,ne,J)}return J[0]0&&ie.write(y),ae.length===0)continue;let me=0;for(let Ae=0;Ae0&&ie.write(A),me=x(ie,ue[0],me),ue.length!==1&&(ne=x(ie,ue[1],ne),J=x(ie,ue[2],J),te=x(ie,ue[3],te),ue.length!==4&&(j=x(ie,ue[4],j)))}}return ie.flush()}})(s=o.nmd(s)),s.exports="default"in(a=s).exports?a.exports.default:a.exports},"./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(s,i,o){var a;(function(c,u,l){"use strict";var d=Object.create,h=Object.defineProperty,m=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,g=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty,y=(et,ut)=>function(){return ut||(0,et[f(et)[0]])((ut={exports:{}}).exports,ut),ut.exports},b=(et,ut)=>{for(var mt in ut)h(et,mt,{get:ut[mt],enumerable:!0})},S=(et,ut,mt,tt)=>{if(ut&&typeof ut=="object"||typeof ut=="function")for(let Dt of f(ut))A.call(et,Dt)||Dt===mt||h(et,Dt,{get:()=>ut[Dt],enumerable:!(tt=m(ut,Dt))||tt.enumerable});return et},C=(et,ut,mt)=>(mt=et!=null?d(g(et)):{},S(!ut&&et&&et.__esModule?mt:h(mt,"default",{value:et,enumerable:!0}),et)),I=et=>S(h({},"__esModule",{value:!0}),et),x=y({"umd:@jridgewell/sourcemap-codec"(et,ut){ut.exports=l}}),w=y({"umd:@jridgewell/resolve-uri"(et,ut){ut.exports=u}}),R={};b(R,{AnyMap:()=>Ae,FlattenMap:()=>Ae,GREATEST_LOWER_BOUND:()=>We,LEAST_UPPER_BOUND:()=>z,TraceMap:()=>He,allGeneratedPositionsFor:()=>Mt,decodedMap:()=>At,decodedMappings:()=>ze,eachMapping:()=>Lt,encodedMap:()=>Vt,encodedMappings:()=>it,generatedPositionFor:()=>sn,isIgnored:()=>Pe,originalPositionFor:()=>Ct,presortedDecodedMap:()=>Xe,sourceContentFor:()=>Ze,traceSegment:()=>rt}),c.exports=I(R);var N=C(x()),P=C(w());function G(et){if(!et)return"";let ut=et.lastIndexOf("/");return et.slice(0,ut+1)}function $(et,ut){let mt=G(et),tt=ut?ut+"/":"";return Dt=>(0,P.default)(tt+(Dt||""),mt)}var Q=0,H=1,oe=2,re=3,Z=4,q=1,ce=2;function be(et,ut){let mt=Be(et,0);if(mt===et.length)return et;ut||(et=et.slice());for(let tt=mt;tt[]);for(let tt=0;tt>1),Zt=et[Dt][Q]-ut;if(Zt===0)return ne=!0,Dt;Zt<0?mt=Dt+1:tt=Dt-1}return ne=!1,mt-1}function te(et,ut,mt){for(let tt=mt+1;tt=0&&et[tt][Q]===ut;mt=tt--);return mt}function X(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function ae(et,ut,mt,tt){let{lastKey:Dt,lastNeedle:Zt,lastIndex:Ne}=mt,$e=0,ct=et.length-1;if(tt===Dt){if(ut===Zt)return ne=Ne!==-1&&et[Ne][Q]===ut,Ne;ut>=Zt?$e=Ne===-1?0:Ne:ct=Ne}return mt.lastKey=tt,mt.lastNeedle=ut,mt.lastIndex=J(et,ut,$e,ct)}function me(et){return typeof et=="string"?JSON.parse(et):et}var Ae=function(et,ut){let mt=me(et);if(!("sections"in mt))return new He(mt,ut);let tt=[],Dt=[],Zt=[],Ne=[],$e=[];return ue(mt,ut,tt,Dt,Zt,Ne,$e,0,0,1/0,1/0),Xe({version:3,file:mt.file,names:Ne,sources:Dt,sourcesContent:Zt,mappings:tt,ignoreList:$e})};function ue(et,ut,mt,tt,Dt,Zt,Ne,$e,ct,Ge,wt){let{sections:Ot}=et;for(let Rt=0;RtGe)return;let Jr=Ee(mt,As),Ur=dn===0?ct:0,bo=bn[dn];for(let Ci=0;Ci=wt)return;if(hn.length===1){Jr.push([Xs]);continue}let lo=yn+hn[H],us=hn[oe],Vn=hn[re];Jr.push(hn.length===4?[Xs,lo,us,Vn]:[Xs,lo,us,Vn,fn+hn[Z]])}}}function Ie(et,ut){for(let mt=0;mt=tt.length)return null;let Dt=tt[ut],Zt=Ve(Dt,et._decodedMemo,ut,mt,We);return Zt===-1?null:Dt[Zt]}function Ct(et,ut){let{line:mt,column:tt,bias:Dt}=ut;if(mt--,mt<0)throw new Error(Te);if(tt<0)throw new Error(_e);let Zt=ze(et);if(mt>=Zt.length)return mn(null,null,null,null);let Ne=Zt[mt],$e=Ve(Ne,et._decodedMemo,mt,tt,Dt||We);if($e===-1)return mn(null,null,null,null);let ct=Ne[$e];if(ct.length===1)return mn(null,null,null,null);let{names:Ge,resolvedSources:wt}=et;return mn(wt[ct[H]],ct[oe]+1,ct[re],ct.length===5?Ge[ct[Z]]:null)}function sn(et,ut){let{source:mt,line:tt,column:Dt,bias:Zt}=ut;return Xt(et,mt,tt,Dt,Zt||We,!1)}function Mt(et,ut){let{source:mt,line:tt,column:Dt,bias:Zt}=ut;return Xt(et,mt,tt,Dt,Zt||z,!0)}function Lt(et,ut){let mt=ze(et),{names:tt,resolvedSources:Dt}=et;for(let Zt=0;Zt{h!=="%%"&&(l++,h==="%c"&&(d=l))}),c.splice(d,0,u)},i.save=function(c){try{c?i.storage.setItem("debug",c):i.storage.removeItem("debug")}catch{}},i.load=function(){let c;try{c=i.storage.getItem("debug")||i.storage.getItem("DEBUG")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c},i.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let c;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(c=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(c[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},i.storage=(function(){try{return localStorage}catch{}})(),i.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),i.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],i.log=console.debug||console.log||(()=>{}),s.exports=o("./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js")(i);let{formatters:a}=s.exports;a.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}},"./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(s,i,o){s.exports=function(a){function c(d){let h,m,f,g=null;function A(...y){if(!A.enabled)return;let b=A,S=Number(new Date),C=S-(h||S);b.diff=C,b.prev=h,b.curr=S,h=S,y[0]=c.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let I=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(x,w)=>{if(x==="%%")return"%";I++;let R=c.formatters[w];if(typeof R=="function"){let N=y[I];x=R.call(b,N),y.splice(I,1),I--}return x}),c.formatArgs.call(b,y),(b.log||c.log).apply(b,y)}return A.namespace=d,A.useColors=c.useColors(),A.color=c.selectColor(d),A.extend=u,A.destroy=c.destroy,Object.defineProperty(A,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(m!==c.namespaces&&(m=c.namespaces,f=c.enabled(d)),f),set:y=>{g=y}}),typeof c.init=="function"&&c.init(A),A}function u(d,h){let m=c(this.namespace+(h===void 0?":":h)+d);return m.log=this.log,m}function l(d,h){let m=0,f=0,g=-1,A=0;for(;m"-"+h)].join(",");return c.enable(""),d},c.enable=function(d){c.save(d),c.namespaces=d,c.names=[],c.skips=[];let h=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?c.skips.push(m.slice(1)):c.names.push(m)},c.enabled=function(d){for(let h of c.skips)if(l(d,h))return!1;for(let h of c.names)if(l(d,h))return!0;return!1},c.humanize=o("./node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"),c.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(a).forEach(d=>{c[d]=a[d]}),c.names=[],c.skips=[],c.formatters={},c.selectColor=function(d){let h=0;for(let m=0;m"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?s.exports=o("./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"):s.exports=o("./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js")},"./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(s,i,o){let a=o("tty"),c=o("util");i.init=function(l){l.inspectOpts={};let d=Object.keys(i.inspectOpts);for(let h=0;h{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),i.colors=[6,2,3,4,5,1];try{let l=o("./node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js");l&&(l.stderr||l).level>=2&&(i.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}i.inspectOpts=Object.keys(process.env).filter(l=>/^debug_/i.test(l)).reduce((l,d)=>{let h=d.substring(6).toLowerCase().replace(/_([a-z])/g,(f,g)=>g.toUpperCase()),m=process.env[d];return m=!!/^(yes|on|true|enabled)$/i.test(m)||!/^(no|off|false|disabled)$/i.test(m)&&(m==="null"?null:Number(m)),l[h]=m,l},{}),s.exports=o("./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js")(i);let{formatters:u}=s.exports;u.o=function(l){return this.inspectOpts.colors=this.useColors,c.inspect(l,this.inspectOpts).split(` -`).map(d=>d.trim()).join(" ")},u.O=function(l){return this.inspectOpts.colors=this.useColors,c.inspect(l,this.inspectOpts)}},"./node_modules/.pnpm/gensync@1.0.0-beta.2/node_modules/gensync/index.js"(s){"use strict";let i=Symbol.for("gensync:v1:start"),o=Symbol.for("gensync:v1:suspend"),a="GENSYNC_OPTIONS_ERROR",c="GENSYNC_RACE_NONEMPTY",u="GENSYNC_ERRBACK_NO_CALLBACK";function l(S,C,I,x){if(typeof I===S||x&&I===void 0)return;let w;throw w=x?`Expected opts.${C} to be either a ${S}, or undefined.`:`Expected opts.${C} to be a ${S}.`,d(w,a)}function d(S,C){return Object.assign(new Error(S),{code:C})}function h({name:S,arity:C,sync:I,async:x}){return b(S,C,function*(...w){let R=yield i;if(!R)return I.call(this,w);let N;try{x.call(this,w,P=>{N||(N={value:P},R())},P=>{N||(N={err:P},R())})}catch(P){N={err:P},R()}if(yield o,N.hasOwnProperty("err"))throw N.err;return N.value})}function m(S){let C;for(;!({value:C}=S.next()).done;)g(C,S);return C}function f(S,C,I){(function x(){try{let w;for(;!({value:w}=S.next()).done;){g(w,S);let R=!0,N=!1,P=S.next(()=>{R?N=!0:x()});if(R=!1,A(P,S),!N)return}return C(w)}catch(w){return I(w)}})()}function g(S,C){S!==i&&y(C,d(`Got unexpected yielded value in gensync generator: ${JSON.stringify(S)}. Did you perhaps mean to use 'yield*' instead of 'yield'?`,"GENSYNC_EXPECTED_START"))}function A({value:S,done:C},I){(C||S!==o)&&y(I,d(C?"Unexpected generator completion. If you get this, it is probably a gensync bug.":`Expected GENSYNC_SUSPEND, got ${JSON.stringify(S)}. If you get this, it is probably a gensync bug.`,"GENSYNC_EXPECTED_SUSPEND"))}function y(S,C){throw S.throw&&S.throw(C),C}function b(S,C,I){if(typeof S=="string"){let x=Object.getOwnPropertyDescriptor(I,"name");x&&!x.configurable||Object.defineProperty(I,"name",Object.assign(x||{},{configurable:!0,value:S}))}if(typeof C=="number"){let x=Object.getOwnPropertyDescriptor(I,"length");x&&!x.configurable||Object.defineProperty(I,"length",Object.assign(x||{},{configurable:!0,value:C}))}return I}s.exports=Object.assign(function(S){let C=S;return C=typeof S!="function"?(function({name:I,arity:x,sync:w,async:R,errback:N}){if(l("string","name",I,!0),l("number","arity",x,!0),l("function","sync",w),l("function","async",R,!0),l("function","errback",N,!0),R&&N)throw d("Expected one of either opts.async or opts.errback, but got _both_.",a);if(typeof I!="string"){let P;N&&N.name&&N.name!=="errback"&&(P=N.name),R&&R.name&&R.name!=="async"&&(P=R.name.replace(/Async$/,"")),w&&w.name&&w.name!=="sync"&&(P=w.name.replace(/Sync$/,"")),typeof P=="string"&&(I=P)}return typeof x!="number"&&(x=w.length),h({name:I,arity:x,sync:function(P){return w.apply(this,P)},async:function(P,G,$){R?R.apply(this,P).then(G,$):N?N.call(this,...P,(Q,H)=>{Q==null?G(H):$(Q)}):G(w.apply(this,P))}})})(S):(function(I){return b(I.name,I.length,function(...x){return I.apply(this,x)})})(S),Object.assign(C,(function(I){return{sync:function(...w){return m(I.apply(this,w))},async:function(...w){return new Promise((R,N)=>{f(I.apply(this,w),R,N)})},errback:function(...w){let R=w.pop();if(typeof R!="function")throw d("Asynchronous function called without callback",u);let N;try{N=I.apply(this,w)}catch(P){return void R(P)}f(N,P=>R(void 0,P),P=>R(P))}}})(C))},{all:h({name:"all",arity:1,sync:function(S){return Array.from(S[0]).map(C=>m(C))},async:function(S,C,I){let x=Array.from(S[0]);if(x.length===0)return void Promise.resolve().then(()=>C([]));let w=0,R=x.map(()=>{});x.forEach((N,P)=>{f(N,G=>{R[P]=G,w+=1,w===R.length&&C(R)},I)})}}),race:h({name:"race",arity:1,sync:function(S){let C=Array.from(S[0]);if(C.length===0)throw d("Must race at least 1 item",c);return m(C[0])},async:function(S,C,I){let x=Array.from(S[0]);if(x.length===0)throw d("Must race at least 1 item",c);for(let w of x)f(w,C,I)}})})},"./node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(s){"use strict";s.exports=(i,o=process.argv)=>{let a=i.startsWith("-")?"":i.length===1?"-":"--",c=o.indexOf(a+i),u=o.indexOf("--");return c!==-1&&(u===-1||c{for(let x in C)o.call(C,x)&&I(x,C[x])},c=C=>"\\u"+("0000"+C).slice(-4),u=(C,I)=>{let x=C.toString(16);return I?x:x.toUpperCase()},l=i.toString,d=Array.isArray,h=C=>typeof C=="bigint",m={"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},f=/[\\\b\f\n\r\t]/,g=/[0-9]/,A=/[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,y=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g,b=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g,S=(C,I)=>{let x=()=>{oe=H,++I.indentLevel,H=I.indent.repeat(I.indentLevel)},w={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:" ",indentLevel:0,__inline1__:!1,__inline2__:!1},R=I&&I.json;var N,P;R&&(w.quotes="double",w.wrap=!0),N=w,(I=((P=I)&&a(P,(ne,J)=>{N[ne]=J}),N)).quotes!="single"&&I.quotes!="double"&&I.quotes!="backtick"&&(I.quotes="single");let G=I.quotes=="double"?'"':I.quotes=="backtick"?"`":"'",$=I.compact,Q=I.lowercaseHex,H=I.indent.repeat(I.indentLevel),oe="",re=I.__inline1__,Z=I.__inline2__,q=$?"":` -`,ce,be=!0,Be=I.numbers=="binary",Me=I.numbers=="octal",Re=I.numbers=="decimal",se=I.numbers=="hexadecimal";if(R&&C&&(ne=>typeof ne=="function")(C.toJSON)&&(C=C.toJSON()),!(ne=>typeof ne=="string"||l.call(ne)=="[object String]")(C)){if((ne=>l.call(ne)=="[object Map]")(C))return C.size==0?"new Map()":($||(I.__inline1__=!0,I.__inline2__=!1),"new Map("+S(Array.from(C),I)+")");if((ne=>l.call(ne)=="[object Set]")(C))return C.size==0?"new Set()":"new Set("+S(Array.from(C),I)+")";if((ne=>typeof Buffer=="function"&&Buffer.isBuffer(ne))(C))return C.length==0?"Buffer.from([])":"Buffer.from("+S(Array.from(C),I)+")";if(d(C))return ce=[],I.wrap=!0,re&&(I.__inline1__=!1,I.__inline2__=!0),Z||x(),((ne,J)=>{let te=ne.length,j=-1;for(;++j{be=!1,Z&&(I.__inline2__=!1),ce.push(($||Z?"":H)+S(ne,I))}),be?"[]":Z?"["+ce.join(", ")+"]":"["+q+ce.join(","+q)+q+($?"":oe)+"]";if((ne=>typeof ne=="number"||l.call(ne)=="[object Number]")(C)||h(C)){if(R)return JSON.stringify(Number(C));let ne;if(Re)ne=String(C);else if(se){let J=C.toString(16);Q||(J=J.toUpperCase()),ne="0x"+J}else Be?ne="0b"+C.toString(2):Me&&(ne="0o"+C.toString(8));return h(C)?ne+"n":ne}return h(C)?R?JSON.stringify(Number(C)):C+"n":(ne=>l.call(ne)=="[object Object]")(C)?(ce=[],I.wrap=!0,x(),a(C,(ne,J)=>{be=!1,ce.push(($?"":H)+S(ne,I)+":"+($?"":" ")+S(J,I))}),be?"{}":"{"+q+ce.join(","+q)+q+($?"":oe)+"}"):R?JSON.stringify(C)||"null":String(C)}let ie=I.escapeEverything?y:b;return ce=C.replace(ie,(ne,J,te,j,X,ae)=>{if(J){if(I.minimal)return J;let Ae=J.charCodeAt(0),ue=J.charCodeAt(1);return I.es6?"\\u{"+u(1024*(Ae-55296)+ue-56320+65536,Q)+"}":c(u(Ae,Q))+c(u(ue,Q))}if(te)return c(u(te.charCodeAt(0),Q));if(ne=="\0"&&!R&&!g.test(ae.charAt(X+1)))return"\\0";if(j)return j==G||I.escapeEverything?"\\"+j:j;if(f.test(ne))return m[ne];if(I.minimal&&!A.test(ne))return ne;let me=u(ne.charCodeAt(0),Q);return R||me.length>2?c(me):"\\x"+("00"+me).slice(-2)}),G=="`"&&(ce=ce.replace(/\$\{/g,"\\${")),I.isScriptContext&&(ce=ce.replace(/<\/(script|style)/gi,"<\\/$1").replace(/|$))/,fJr=To("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",$9e).replace("tag",bbe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Nrn=To(Q9e).replace("hr",uX).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",bbe).getRegex(),gJr=To(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Nrn).getRegex(),G9e={blockquote:gJr,code:cJr,def:hJr,fences:lJr,heading:uJr,hr:uX,html:fJr,lheading:krn,list:mJr,newline:aJr,paragraph:Nrn,table:xM,text:pJr},_rn=To("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",uX).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",bbe).getRegex(),AJr={...G9e,lheading:dJr,table:_rn,paragraph:To(Q9e).replace("hr",uX).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_rn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",bbe).getRegex()},yJr={...G9e,html:To(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$9e).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:xM,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:To(Q9e).replace("hr",uX).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",krn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},EJr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,bJr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Drn=/^( {2,}|\\)\n(?!\s*$)/,_Jr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k
    (?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",oJr?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Prn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,wJr=To(Prn,"u").replace(/punct/g,z3).getRegex(),TJr=To(Prn,"u").replace(/punct/g,Brn).getRegex(),Orn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vJr=To(Orn,"gu").replace(/notPunctSpace/g,W9e).replace(/punctSpace/g,_be).replace(/punct/g,z3).getRegex(),RJr=To(Orn,"gu").replace(/notPunctSpace/g,IJr).replace(/punctSpace/g,CJr).replace(/punct/g,Brn).getRegex(),kJr=To("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,W9e).replace(/punctSpace/g,_be).replace(/punct/g,z3).getRegex(),NJr=To(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,z3).getRegex(),DJr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",BJr=To(DJr,"gu").replace(/notPunctSpace/g,W9e).replace(/punctSpace/g,_be).replace(/punct/g,z3).getRegex(),PJr=To(/\\(punct)/,"gu").replace(/punct/g,z3).getRegex(),OJr=To(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),MJr=To($9e).replace("(?:-->|$)","-->").getRegex(),LJr=To("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",MJr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ybe=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,FJr=To(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ybe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Mrn=To(/^!?\[(label)\]\[(ref)\]/).replace("label",ybe).replace("ref",U9e).getRegex(),Lrn=To(/^!?\[(ref)\](?:\[\])?/).replace("ref",U9e).getRegex(),QJr=To("reflink|nolink(?!\\()","g").replace("reflink",Mrn).replace("nolink",Lrn).getRegex(),Srn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,q9e={_backpedal:xM,anyPunctuation:PJr,autolink:OJr,blockSkip:xJr,br:Drn,code:bJr,del:xM,delLDelim:xM,delRDelim:xM,emStrongLDelim:wJr,emStrongRDelimAst:vJr,emStrongRDelimUnd:kJr,escape:EJr,link:FJr,nolink:Lrn,punctuation:SJr,reflink:Mrn,reflinkSearch:QJr,tag:LJr,text:_Jr,url:xM},UJr={...q9e,link:To(/^!?\[(label)\]\((.*?)\)/).replace("label",ybe).getRegex(),reflink:To(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ybe).getRegex()},P9e={...q9e,emStrongRDelimAst:RJr,emStrongLDelim:TJr,delLDelim:NJr,delRDelim:BJr,url:To(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Srn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:To(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Crn=t=>GJr[t];function VC(t,e){if(e){if(Lh.escapeTest.test(t))return t.replace(Lh.escapeReplace,Crn)}else if(Lh.escapeTestNoEncode.test(t))return t.replace(Lh.escapeReplaceNoEncode,Crn);return t}function Irn(t){try{t=encodeURI(t).replace(Lh.percentDecode,"%")}catch{return null}return t}function xrn(t,e){let n=t.replace(Lh.findPipe,(i,o,a)=>{let c=!1,u=o;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),r=n.split(Lh.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length=0&&Lh.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(` -`)}function WJr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r0?-2:-1}function qJr(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function Trn(t,e,n,r,s){let i=e.href,o=e.title||null,a=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,c}function HJr(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(` -`).map(i=>{let o=i.match(n.other.beginningSpace);if(o===null)return i;let[a]=o;return a.length>=s.length?i.slice(s.length):i}).join(` -`)}var K3=class{options;rules;lexer;constructor(t){this.options=t||TM}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:wrn(e[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=HJr(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=vN(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:vN(e[0],` -`),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:vN(e[0],` -`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=vN(e[0],` -`).split(` -`),r="",s="",i=[];for(;n.length>0;){let o=!1,a=[],c;for(c=0;c1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let i=this.rules.other.listItemRegex(n),o=!1;for(;t;){let c=!1,u="",l="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let d=qJr(e[2].split(` -`,1)[0],e[1].length),h=t.split(` -`,1)[0],m=!d.trim(),f=0;if(this.options.pedantic?(f=2,l=d.trimStart()):m?f=e[1].length+1:(f=d.search(this.rules.other.nonSpaceChar),f=f>4?1:f,l=d.slice(f),f+=e[1].length),m&&this.rules.other.blankLine.test(h)&&(u+=h+` -`,t=t.substring(h.length+1),c=!0),!c){let g=this.rules.other.nextBulletRegex(f),A=this.rules.other.hrRegex(f),y=this.rules.other.fencesBeginRegex(f),b=this.rules.other.headingBeginRegex(f),S=this.rules.other.htmlBeginRegex(f),C=this.rules.other.blockquoteBeginRegex(f);for(;t;){let I=t.split(` -`,1)[0],x;if(h=I,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),x=h):x=h.replace(this.rules.other.tabCharGlobal," "),y.test(h)||b.test(h)||S.test(h)||C.test(h)||g.test(h)||A.test(h))break;if(x.search(this.rules.other.nonSpaceChar)>=f||!h.trim())l+=` -`+x.slice(f);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(d)||b.test(d)||A.test(d))break;l+=` -`+h}m=!h.trim(),u+=I+` -`,t=t.substring(I.length+1),d=x.slice(f)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0)),s.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(l),loose:!1,text:l,tokens:[]}),s.raw+=u}let a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c of s.items){this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]);let u=c.tokens[0];if(c.task&&(u?.type==="text"||u?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),u.raw=u.raw.replace(this.rules.other.listReplaceTask,""),u.text=u.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let l=this.rules.other.listTaskCheckbox.exec(c.raw);if(l){let d={type:"checkbox",raw:l[0]+" ",checked:l[0]!=="[ ]"};c.checked=d.checked,s.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=d.raw+c.tokens[0].raw,c.tokens[0].text=d.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(d)):c.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):c.tokens.unshift(d)}}else c.task&&(c.task=!1);if(!s.loose){let l=c.tokens.filter(h=>h.type==="space"),d=l.length>0&&l.some(h=>this.rules.other.anyLine.test(h.raw));s.loose=d}}if(s.loose)for(let c of s.items){c.loose=!0;for(let u of c.tokens)u.type==="text"&&(u.type="paragraph")}return s}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=wrn(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:vN(e[0],` -`),href:r,title:s}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=xrn(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(` -`):[],i={type:"table",raw:vN(e[0],` -`),header:[],align:[],rows:[]};if(n.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:vN(e[0],` -`),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===` -`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=vN(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=WJr(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Trn(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Trn(n,s,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,a=s,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+s);(r=u.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){a+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){c+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+c);let l=[...r[0]][0].length,d=t.slice(0,s+r.index+l+o);if(Math.min(s,o)%2){let m=d.slice(1,-1);return{type:"em",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}let h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,a=s,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+s);(r=c.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(o=[...i].length,o!==s))continue;if(r[3]||r[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let u=[...r[0]][0].length,l=t.slice(0,s+r.index+u+o),d=l.slice(s,-s);return{type:"del",raw:l,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},a0=class O9e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||TM,this.options.tokenizer=this.options.tokenizer||new K3,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Lh,block:Abe.normal,inline:cX.normal};this.options.pedantic?(n.block=Abe.pedantic,n.inline=cX.pedantic):this.options.gfm&&(n.block=Abe.gfm,this.options.breaks?n.inline=cX.breaks:n.inline=cX.gfm),this.tokenizer.rules=n}static get rules(){return{block:Abe,inline:cX}}static lex(e,n){return new O9e(n).lex(e)}static lexInline(e,n){return new O9e(n).inlineTokens(e)}lex(e){e=e.replace(Lh.carriageReturn,` -`),this.blockTokens(e,this.tokens);for(let n=0;n(i=a.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=` -`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` -`)?"":` -`)+i.raw,a.text+=` -`+i.text,this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` -`)?"":` -`)+i.raw,a.text+=` -`+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let o=e;if(this.options.extensions?.startBlock){let a=1/0,c=e.slice(1),u;this.options.extensions.startBlock.forEach(l=>{u=l.call({lexer:this},c),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){let a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(` -`)?"":` -`)+i.raw,a.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),r=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(` -`)?"":` -`)+i.raw,a.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let o=!1,a="",c=1/0;for(;e;){if(e.length(u=d.call({lexer:this},e,n))?(e=e.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);let d=n.at(-1);u.type==="text"&&d?.type==="text"?(d.raw+=u.raw,d.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(e,r,a)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(e,r,a)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),n.push(u);continue}let l=e;if(this.options.extensions?.startInline){let d=1/0,h=e.slice(1),m;this.options.extensions.startInline.forEach(f=>{m=f.call({lexer:this},h),typeof m=="number"&&m>=0&&(d=Math.min(d,m))}),d<1/0&&d>=0&&(l=e.substring(0,d+1))}if(u=this.tokenizer.inlineText(l)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(a=u.raw.slice(-1)),o=!0;let d=n.at(-1);d?.type==="text"?(d.raw+=u.raw,d.text+=u.text):n.push(u);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Ebe=class{options;parser;constructor(t){this.options=t||TM}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(Lh.notSpaceStart)?.[0],s=t.replace(Lh.endingNewline,"")+` -`;return r?'
    '+(n?s:VC(s,!0))+`
    -`:"
    "+(n?s:VC(s,!0))+`
    -`}blockquote({tokens:t}){return`
    -${this.parser.parse(t)}
    -`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`${this.parser.parseInline(t)} -`}hr(t){return`
    -`}list(t){let e=t.ordered,n=t.start,r="";for(let o=0;o -`+r+" -`}listitem(t){return`
  • ${this.parser.parse(t.tokens)}
  • -`}checkbox({checked:t}){return" '}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    -`}table(t){let e="",n="";for(let s=0;s${r}`),` - -`+e+` -`+r+`
    -`}tablerow({text:t}){return` -${t} -`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+` -`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${VC(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),s=Irn(t);if(s===null)return r;t=s;let i='
    ",i}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=Irn(t);if(s===null)return VC(n);t=s;let i=`${VC(n)}{let o=s[i].flat(1/0);n=n.concat(this.walkTokens(o,e))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),n.renderer){let s=this.defaults.renderer||new Ebe(this.defaults);for(let i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,a=n.renderer[o],c=s[o];s[o]=(...u)=>{let l=a.apply(s,u);return l===!1&&(l=c.apply(s,u)),l||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new K3(this.defaults);for(let i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,a=n.tokenizer[o],c=s[o];s[o]=(...u)=>{let l=a.apply(s,u);return l===!1&&(l=c.apply(s,u)),l}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new lX;for(let i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=n.hooks[o],c=s[o];lX.passThroughHooks.has(i)?s[o]=u=>{if(this.defaults.async&&lX.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await a.call(s,u);return c.call(s,d)})();let l=a.call(s,u);return c.call(s,l)}:s[o]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(s,u);return d===!1&&(d=await c.apply(s,u)),d})();let l=a.apply(s,u);return l===!1&&(l=c.apply(s,u)),l}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return a0.lex(t,e??this.defaults)}parser(t,e){return c0.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(e):e,a=await(s.hooks?await s.hooks.provideLexer(t):t?a0.lex:a0.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let u=await(s.hooks?await s.hooks.provideParser(t):t?c0.parse:c0.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(u):u})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let o=(s.hooks?s.hooks.provideLexer(t):t?a0.lex:a0.lexInline)(e,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(t):t?c0.parse:c0.parseInline)(o,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(t,e){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,t){let r="

    An error occurred:

    "+VC(n.message+"",!0)+"
    ";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},wM=new vM;function Ia(t,e){return wM.parse(t,e)}Ia.options=Ia.setOptions=function(t){return wM.setOptions(t),Ia.defaults=wM.defaults,vrn(Ia.defaults),Ia};Ia.getDefaults=L9e;Ia.defaults=TM;Ia.use=function(...t){return wM.use(...t),Ia.defaults=wM.defaults,vrn(Ia.defaults),Ia};Ia.walkTokens=function(t,e){return wM.walkTokens(t,e)};Ia.parseInline=wM.parseInline;Ia.Parser=c0;Ia.parser=c0.parse;Ia.Renderer=Ebe;Ia.TextRenderer=H9e;Ia.Lexer=a0;Ia.lexer=a0.lex;Ia.Tokenizer=K3;Ia.Hooks=lX;Ia.parse=Ia;var $Ia=Ia.options,GIa=Ia.setOptions,WIa=Ia.use,qIa=Ia.walkTokens,HIa=Ia.parseInline;var VIa=c0.parse,jIa=a0.lex;p();var qrn=require("child_process"),pX=require("fs"),V9e=require("os"),sp=require("path");p();function dX(t,e){let n=t.toLowerCase(),r=e.toLowerCase(),s=l=>{if(l.length===0)return{matches:!0,score:0};if(l.length>r.length)return{matches:!1,score:0};let d=0,h=0,m=-1,f=0;for(let g=0;g=0&&(h+=(g-m-1)*2)),A&&(h-=10),h+=g*.1,m=g,d++}return d[a-z]+)(?[0-9]+)$/),a=n.match(/^(?[0-9]+)(?[a-z]+)$/),c=o?`${o.groups?.digits??""}${o.groups?.letters??""}`:a?`${a.groups?.letters??""}${a.groups?.digits??""}`:"";if(!c)return i;let u=s(c);return u.matches?{matches:!0,score:u.score+5}:i}function Wl(t,e,n){if(!e.trim())return t;let r=e.trim().split(/[\s/]+/).filter(i=>i.length>0);if(r.length===0)return t;let s=[];for(let i of t){let o=n(i),a=0,c=!0;for(let u of r){let l=dX(u,o);if(l.matches)a+=l.score;else{c=!1;break}}c&&s.push({item:i,totalScore:a})}return s.sort((i,o)=>i.totalScore-o.totalScore),s.map(i=>i.item)}var Hrn=new Set([" "," ",'"',"'","="]);function Kw(t){return t.replace(/\\/g,"/")}function VJr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jJr(t){let e=Kw(t);if(!e.includes("/"))return e;let n=e.endsWith("/"),r=e.replace(/^\/+|\/+$/g,"");if(!r)return e;let s="[\\\\/]",i=r.split("/").filter(Boolean).map(a=>VJr(a));if(i.length===0)return e;let o=i.join(s);return n&&(o+=s),o}function Frn(t){for(let e=t.length-1;e>=0;e-=1)if(Hrn.has(t[e]??""))return e;return-1}function YJr(t){let e=!1,n=-1;for(let r=0;r0&&t[e-1]==="@"?Qrn(t,e-1)?t.slice(e-1):null:Qrn(t,e)?t.slice(e):null}function $rn(t){return t.startsWith('@"')?{rawPrefix:t.slice(2),isAtPrefix:!0,isQuotedPrefix:!0}:t.startsWith('"')?{rawPrefix:t.slice(1),isAtPrefix:!1,isQuotedPrefix:!0}:t.startsWith("@")?{rawPrefix:t.slice(1),isAtPrefix:!0,isQuotedPrefix:!1}:{rawPrefix:t,isAtPrefix:!1,isQuotedPrefix:!1}}function Grn(t,e){let n=e.isQuotedPrefix||t.includes(" "),r=e.isAtPrefix?"@":"";return n?`${`${r}"`}${t}"`:`${r}${t}`}async function Wrn(t,e,n,r,s,i){let o=["--base-directory",t,"--max-results",String(r),"--type","f","--type","d","--follow","--hidden","--exclude",".git","--exclude",".git/*","--exclude",".git/**"];return i!==void 0&&o.push("--max-depth",String(i)),Kw(n).includes("/")&&o.push("--full-path"),n&&o.push(jJr(n)),await new Promise(a=>{if(s.aborted){a([]);return}let c=(0,qrn.spawn)(e,o,{stdio:["ignore","pipe","pipe"]}),u="",l=!1,d=m=>{l||(l=!0,s.removeEventListener("abort",h),a(m))},h=()=>{c.exitCode===null&&c.kill("SIGKILL")};s.addEventListener("abort",h,{once:!0}),c.stdout.setEncoding("utf-8"),c.stdout.on("data",m=>{u+=m}),c.on("error",()=>{d([])}),c.on("close",m=>{if(s.aborted||m!==0||!u){d([]);return}let f=u.trim().split(` -`).filter(Boolean),g=[];for(let A of f){let y=Kw(A),b=y.endsWith("/"),S=b?y.slice(0,-1):y;S===".git"||S.startsWith(".git/")||S.includes("/.git/")||g.push({path:y,isDirectory:b})}d(g)})})}var J3=class{commands;basePath;fdPath;constructor(e=[],n,r=null){this.commands=e,this.basePath=n,this.fdPath=r}async getSuggestions(e,n,r,s){let o=(e[n]||"").slice(0,r),a=this.extractAtPrefix(o);if(a){let{rawPrefix:l,isQuotedPrefix:d}=$rn(a),h=await this.getFuzzyFileSuggestions(l,{isQuotedPrefix:d,signal:s.signal});return h.length===0?null:{items:h,prefix:a}}if(!s.force&&o.startsWith("/")){let l=o.indexOf(" ");if(l===-1){let g=o.slice(1),A=this.commands.map(b=>{let S="name"in b?b.name:b.value,C="argumentHint"in b&&b.argumentHint?b.argumentHint:void 0,I=b.description??"",x=C?I?`${C} \u2014 ${I}`:C:I;return{name:S,label:S,description:x||void 0}}),y=Wl(A,g,b=>b.name).map(b=>({value:b.name,label:b.label,...b.description&&{description:b.description}}));return y.length===0?null:{items:y,prefix:o}}let d=o.slice(1,l),h=o.slice(l+1),m=this.commands.find(g=>("name"in g?g.name:g.value)===d);if(!m||!("getArgumentCompletions"in m)||!m.getArgumentCompletions)return null;let f=await m.getArgumentCompletions(h);return!Array.isArray(f)||f.length===0?null:{items:f,prefix:h}}let c=this.extractPathPrefix(o,s.force??!1);if(c===null)return null;let u=this.getFileSuggestions(c);return u.length===0?null:{items:u,prefix:c}}applyCompletion(e,n,r,s,i){let o=e[n]||"",a=o.slice(0,r-i.length),c=o.slice(r),u=i.startsWith('"')||i.startsWith('@"'),l=c.startsWith('"'),d=s.value.endsWith('"'),h=u&&d&&l?c.slice(1):c;if(i.startsWith("/")&&a.trim()===""&&!i.slice(1).includes("/")){let C=`${a}/${s.value} ${h}`,I=[...e];return I[n]=C,{lines:I,cursorLine:n,cursorCol:a.length+s.value.length+2}}if(i.startsWith("@")){let C=s.label.endsWith("/"),I=C?"":" ",x=`${a+s.value}${I}${h}`,w=[...e];w[n]=x;let R=s.value.endsWith('"'),N=C&&R?s.value.length-1:s.value.length;return{lines:w,cursorLine:n,cursorCol:a.length+N+I.length}}let f=o.slice(0,r);if(f.includes("/")&&f.includes(" ")){let C=a+s.value+h,I=[...e];I[n]=C;let x=s.label.endsWith("/"),w=s.value.endsWith('"'),R=x&&w?s.value.length-1:s.value.length;return{lines:I,cursorLine:n,cursorCol:a.length+R}}let g=a+s.value+h,A=[...e];A[n]=g;let y=s.label.endsWith("/"),b=s.value.endsWith('"'),S=y&&b?s.value.length-1:s.value.length;return{lines:A,cursorLine:n,cursorCol:a.length+S}}extractAtPrefix(e){let n=Urn(e);if(n?.startsWith('@"'))return n;let r=Frn(e),s=r===-1?0:r+1;return e[s]==="@"?e.slice(s):null}extractPathPrefix(e,n=!1){let r=Urn(e);if(r)return r;let s=Frn(e),i=s===-1?e:e.slice(s+1);return n||i.includes("/")||i.startsWith(".")||i.startsWith("~/")||i===""&&e.endsWith(" ")?i:null}expandHomePath(e){if(e.startsWith("~/")){let n=(0,sp.join)((0,V9e.homedir)(),e.slice(2));return e.endsWith("/")&&!n.endsWith("/")?`${n}/`:n}else if(e==="~")return(0,V9e.homedir)();return e}resolveScopedFuzzyQuery(e){let n=Kw(e),r=n.lastIndexOf("/");if(r===-1)return null;let s=n.slice(0,r+1),i=n.slice(r+1),o;s.startsWith("~/")?o=this.expandHomePath(s):s.startsWith("/")?o=s:o=(0,sp.join)(this.basePath,s);try{if(!(0,pX.statSync)(o).isDirectory())return null}catch{return null}return{baseDir:o,query:i,displayBase:s}}scopedPathForDisplay(e,n){let r=Kw(n);return e==="/"?`/${r}`:`${Kw(e)}${r}`}getFileSuggestions(e){try{let n,r,{rawPrefix:s,isAtPrefix:i,isQuotedPrefix:o}=$rn(e),a=s;if(a.startsWith("~")&&(a=this.expandHomePath(a)),s===""||s==="./"||s==="../"||s==="~"||s==="~/"||s==="/"||i&&s==="")s.startsWith("~")||a.startsWith("/")?n=a:n=(0,sp.join)(this.basePath,a),r="";else if(s.endsWith("/"))s.startsWith("~")||a.startsWith("/")?n=a:n=(0,sp.join)(this.basePath,a),r="";else{let d=(0,sp.dirname)(a),h=(0,sp.basename)(a);s.startsWith("~")||a.startsWith("/")?n=d:n=(0,sp.join)(this.basePath,d),r=h}let u=(0,pX.readdirSync)(n,{withFileTypes:!0}),l=[];for(let d of u){if(!d.name.toLowerCase().startsWith(r.toLowerCase()))continue;let h=d.isDirectory();if(!h&&d.isSymbolicLink())try{let b=(0,sp.join)(n,d.name);h=(0,pX.statSync)(b).isDirectory()}catch{}let m,f=d.name,g=s;if(g.endsWith("/"))m=g+f;else if(g.includes("/")||g.includes("\\"))if(g.startsWith("~/")){let b=g.slice(2),S=(0,sp.dirname)(b);m=`~/${S==="."?f:(0,sp.join)(S,f)}`}else if(g.startsWith("/")){let b=(0,sp.dirname)(g);b==="/"?m=`/${f}`:m=`${b}/${f}`}else m=(0,sp.join)((0,sp.dirname)(g),f),g.startsWith("./")&&!m.startsWith("./")&&(m=`./${m}`);else g.startsWith("~")?m=`~/${f}`:m=f;m=Kw(m);let A=h?`${m}/`:m,y=Grn(A,{isDirectory:h,isAtPrefix:i,isQuotedPrefix:o});l.push({value:y,label:f+(h?"/":"")})}return l.sort((d,h)=>{let m=d.value.endsWith("/"),f=h.value.endsWith("/");return m&&!f?-1:!m&&f?1:d.label.localeCompare(h.label)}),l}catch{return[]}}scoreEntry(e,n,r){let i=(0,sp.basename)(e).toLowerCase(),o=n.toLowerCase(),a=0;return i===o?a=100:i.startsWith(o)?a=80:i.includes(o)?a=50:e.toLowerCase().includes(o)&&(a=30),r&&a>0&&(a+=10),a}async getBaseDirSuggestions(e,n,r){return!this.fdPath||r.aborted?[]:await Wrn(e,this.fdPath,n,100,r,1)}async getFuzzyFileSuggestions(e,n){if(!this.fdPath||n.signal.aborted)return[];try{let r=this.resolveScopedFuzzyQuery(e),s=r?.baseDir??this.basePath,i=r?.query??e,o=await this.getBaseDirSuggestions(s,i,n.signal),a=await Wrn(s,this.fdPath,i,100,n.signal),c=new Set(o.map(m=>m.path)),u=[...o,...a.filter(m=>c.has(m.path)?!1:(c.add(m.path),!0))];if(n.signal.aborted)return[];let l=u.map(m=>({...m,score:i?this.scoreEntry(m.path,i,m.isDirectory):1})).filter(m=>m.score>0);l.sort((m,f)=>{let g=f.score-m.score;if(g!==0)return g;let A=Kw(m.path).split("/").filter(Boolean).length,y=Kw(f.path).split("/").filter(Boolean).length,b=A-y;if(b!==0)return b;let S=m.path.length-f.path.length;return S!==0?S:m.path.localeCompare(f.path)});let d=l.slice(0,20),h=[];for(let{path:m,isDirectory:f}of d){let g=f?m.slice(0,-1):m,A=r?this.scopedPathForDisplay(r.displayBase,g):g,y=(0,sp.basename)(g),b=f?`${A}/`:A,S=Grn(b,{isDirectory:f,isAtPrefix:!0,isQuotedPrefix:n.isQuotedPrefix});h.push({value:S,label:y+(f?"/":""),description:A})}return h}catch{return[]}}shouldTriggerFileCompletion(e,n,r){let i=(e[n]||"").slice(0,r);return!(i.trim().startsWith("/")&&!i.trim().includes(" "))}};p();p();var bX=require("node:perf_hooks");p();var Jp=!1;function eH(t){Jp=t}function Krn(){return Jp}var mX={escape:"escape",esc:"esc",enter:"enter",return:"return",tab:"tab",space:"space",backspace:"backspace",delete:"delete",insert:"insert",clear:"clear",home:"home",end:"end",pageUp:"pageUp",pageDown:"pageDown",up:"up",down:"down",left:"left",right:"right",f1:"f1",f2:"f2",f3:"f3",f4:"f4",f5:"f5",f6:"f6",f7:"f7",f8:"f8",f9:"f9",f10:"f10",f11:"f11",f12:"f12",backtick:"`",hyphen:"-",equals:"=",leftbracket:"[",rightbracket:"]",backslash:"\\",semicolon:";",quote:"'",comma:",",period:".",slash:"/",exclamation:"!",at:"@",hash:"#",dollar:"$",percent:"%",caret:"^",ampersand:"&",asterisk:"*",leftparen:"(",rightparen:")",underscore:"_",plus:"+",pipe:"|",tilde:"~",leftbrace:"{",rightbrace:"}",colon:":",lessthan:"<",greaterthan:">",question:"?",ctrl:t=>`ctrl+${t}`,shift:t=>`shift+${t}`,alt:t=>`alt+${t}`,super:t=>`super+${t}`,ctrlShift:t=>`ctrl+shift+${t}`,shiftCtrl:t=>`shift+ctrl+${t}`,ctrlAlt:t=>`ctrl+alt+${t}`,altCtrl:t=>`alt+ctrl+${t}`,shiftAlt:t=>`shift+alt+${t}`,altShift:t=>`alt+shift+${t}`,ctrlSuper:t=>`ctrl+super+${t}`,superCtrl:t=>`super+ctrl+${t}`,shiftSuper:t=>`shift+super+${t}`,superShift:t=>`super+shift+${t}`,altSuper:t=>`alt+super+${t}`,superAlt:t=>`super+alt+${t}`,ctrlShiftAlt:t=>`ctrl+shift+alt+${t}`,ctrlShiftSuper:t=>`ctrl+shift+super+${t}`},X3=new Set(["`","-","=","[","]","\\",";","'",",",".","/","!","@","#","$","%","^","&","*","(",")","_","+","|","~","{","}",":","<",">","?"]),lr={shift:1,alt:2,ctrl:4,super:8},Z3=192,ao={escape:27,tab:9,enter:13,space:32,backspace:127,kpEnter:57414},ql={up:-1,down:-2,right:-3,left:-4},Fo={delete:-10,insert:-11,pageUp:-12,pageDown:-13,home:-14,end:-15},KJr=new Map([[57399,48],[57400,49],[57401,50],[57402,51],[57403,52],[57404,53],[57405,54],[57406,55],[57407,56],[57408,57],[57409,46],[57410,47],[57411,42],[57412,45],[57413,43],[57415,61],[57416,44],[57417,ql.left],[57418,ql.right],[57419,ql.up],[57420,ql.down],[57421,Fo.pageUp],[57422,Fo.pageDown],[57423,Fo.home],[57424,Fo.end],[57425,Fo.insert],[57426,Fo.delete]]);function xbe(t){return KJr.get(t)??t}function hX(t,e){return(e&~Z3&lr.shift)!==0&&t>=65&&t<=90?t+32:t}var $E={up:["\x1B[A","\x1BOA"],down:["\x1B[B","\x1BOB"],right:["\x1B[C","\x1BOC"],left:["\x1B[D","\x1BOD"],home:["\x1B[H","\x1BOH","\x1B[1~","\x1B[7~"],end:["\x1B[F","\x1BOF","\x1B[4~","\x1B[8~"],insert:["\x1B[2~"],delete:["\x1B[3~"],pageUp:["\x1B[5~","\x1B[[5~"],pageDown:["\x1B[6~","\x1B[[6~"],clear:["\x1B[E","\x1BOE"],f1:["\x1BOP","\x1B[11~","\x1B[[A"],f2:["\x1BOQ","\x1B[12~","\x1B[[B"],f3:["\x1BOR","\x1B[13~","\x1B[[C"],f4:["\x1BOS","\x1B[14~","\x1B[[D"],f5:["\x1B[15~","\x1B[[E"],f6:["\x1B[17~"],f7:["\x1B[18~"],f8:["\x1B[19~"],f9:["\x1B[20~"],f10:["\x1B[21~"],f11:["\x1B[23~"],f12:["\x1B[24~"]},zJr={up:["\x1B[a"],down:["\x1B[b"],right:["\x1B[c"],left:["\x1B[d"],clear:["\x1B[e"],insert:["\x1B[2$"],delete:["\x1B[3$"],pageUp:["\x1B[5$"],pageDown:["\x1B[6$"],home:["\x1B[7$"],end:["\x1B[8$"]},JJr={up:["\x1BOa"],down:["\x1BOb"],right:["\x1BOc"],left:["\x1BOd"],clear:["\x1BOe"],insert:["\x1B[2^"],delete:["\x1B[3^"],pageUp:["\x1B[5^"],pageDown:["\x1B[6^"],home:["\x1B[7^"],end:["\x1B[8^"]},XJr={"\x1BOA":"up","\x1BOB":"down","\x1BOC":"right","\x1BOD":"left","\x1BOH":"home","\x1BOF":"end","\x1B[E":"clear","\x1BOE":"clear","\x1BOe":"ctrl+clear","\x1B[e":"shift+clear","\x1B[2~":"insert","\x1B[2$":"shift+insert","\x1B[2^":"ctrl+insert","\x1B[3$":"shift+delete","\x1B[3^":"ctrl+delete","\x1B[[5~":"pageUp","\x1B[[6~":"pageDown","\x1B[a":"shift+up","\x1B[b":"shift+down","\x1B[c":"shift+right","\x1B[d":"shift+left","\x1BOa":"ctrl+up","\x1BOb":"ctrl+down","\x1BOc":"ctrl+right","\x1BOd":"ctrl+left","\x1B[5$":"shift+pageUp","\x1B[6$":"shift+pageDown","\x1B[7$":"shift+home","\x1B[8$":"shift+end","\x1B[5^":"ctrl+pageUp","\x1B[6^":"ctrl+pageDown","\x1B[7^":"ctrl+home","\x1B[8^":"ctrl+end","\x1BOP":"f1","\x1BOQ":"f2","\x1BOR":"f3","\x1BOS":"f4","\x1B[11~":"f1","\x1B[12~":"f2","\x1B[13~":"f3","\x1B[14~":"f4","\x1B[[A":"f1","\x1B[[B":"f2","\x1B[[C":"f3","\x1B[[D":"f4","\x1B[[E":"f5","\x1B[15~":"f5","\x1B[17~":"f6","\x1B[18~":"f7","\x1B[19~":"f8","\x1B[20~":"f9","\x1B[21~":"f10","\x1B[23~":"f11","\x1B[24~":"f12","\x1Bb":"alt+left","\x1Bf":"alt+right","\x1Bp":"alt+up","\x1Bn":"alt+down"},og=(t,e)=>e.includes(t),VA=(t,e,n)=>n===lr.shift?og(t,zJr[e]):n===lr.ctrl?og(t,JJr[e]):!1,Sbe="press";function tH(t){return t.includes("\x1B[200~")?!1:!!(t.includes(":3u")||t.includes(":3~")||t.includes(":3A")||t.includes(":3B")||t.includes(":3C")||t.includes(":3D")||t.includes(":3H")||t.includes(":3F"))}function zrn(t){return t.includes("\x1B[200~")?!1:!!(t.includes(":2u")||t.includes(":2~")||t.includes(":2A")||t.includes(":2B")||t.includes(":2C")||t.includes(":2D")||t.includes(":2H")||t.includes(":2F"))}function Cbe(t){if(!t)return"press";let e=parseInt(t,10);return e===2?"repeat":e===3?"release":"press"}function Jrn(t){let e=t.match(/^\x1b\[(\d+)(?::(\d*))?(?::(\d+))?(?:;(\d+))?(?::(\d+))?u$/);if(e){let i=parseInt(e[1],10),o=e[2]&&e[2].length>0?parseInt(e[2],10):void 0,a=e[3]?parseInt(e[3],10):void 0,c=e[4]?parseInt(e[4],10):1,u=Cbe(e[5]);return Sbe=u,{codepoint:i,shiftedKey:o,baseLayoutKey:a,modifier:c-1,eventType:u}}let n=t.match(/^\x1b\[1;(\d+)(?::(\d+))?([ABCD])$/);if(n){let i=parseInt(n[1],10),o=Cbe(n[2]),a={A:-1,B:-2,C:-3,D:-4};return Sbe=o,{codepoint:a[n[3]],modifier:i-1,eventType:o}}let r=t.match(/^\x1b\[(\d+)(?:;(\d+))?(?::(\d+))?~$/);if(r){let i=parseInt(r[1],10),o=r[2]?parseInt(r[2],10):1,a=Cbe(r[3]),u={2:Fo.insert,3:Fo.delete,5:Fo.pageUp,6:Fo.pageDown,7:Fo.home,8:Fo.end}[i];if(u!==void 0)return Sbe=a,{codepoint:u,modifier:o-1,eventType:a}}let s=t.match(/^\x1b\[1;(\d+)(?::(\d+))?([HF])$/);if(s){let i=parseInt(s[1],10),o=Cbe(s[2]),a=s[3]==="H"?Fo.home:Fo.end;return Sbe=o,{codepoint:a,modifier:i-1,eventType:o}}return null}function Ds(t,e,n){let r=Jrn(t);if(!r)return!1;let s=r.modifier&~Z3,i=n&~Z3;if(s!==i)return!1;let o=hX(xbe(r.codepoint),r.modifier),a=hX(xbe(e),n);if(o===a)return!0;if(r.baseLayoutKey!==void 0&&r.baseLayoutKey===e){let c=o,u=c>=97&&c<=122,l=X3.has(String.fromCharCode(c));if(!u&&!l)return!0}return!1}function wbe(t){let e=t.match(/^\x1b\[27;(\d+);(\d+)~$/);if(!e)return null;let n=parseInt(e[1],10);return{codepoint:parseInt(e[2],10),modifier:n-1}}function GE(t,e,n){let r=wbe(t);return r?r.codepoint===e&&r.modifier===n:!1}function Xrn(){return!!process.env.WT_SESSION&&!process.env.SSH_CONNECTION&&!process.env.SSH_CLIENT&&!process.env.SSH_TTY}function Vrn(t,e){return t==="\x7F"?e===0:t!=="\b"?!1:Xrn()?e===lr.ctrl:e===0}function ZJr(t){let e=t.toLowerCase(),n=e.charCodeAt(0);return n>=97&&n<=122||e==="["||e==="\\"||e==="]"||e==="_"?String.fromCharCode(n&31):e==="-"?"":null}function jrn(t){return t>="0"&&t<="9"}function Ibe(t,e,n){if(n===0)return!1;let r=wbe(t);return!r||r.modifier!==n?!1:hX(r.codepoint,r.modifier)===hX(e,n)}function eXr(t,e){let n=[],r=e&~Z3,s=lr.shift|lr.ctrl|lr.alt|lr.super;if((r&~s)===0)return r&lr.shift&&n.push("shift"),r&lr.ctrl&&n.push("ctrl"),r&lr.alt&&n.push("alt"),r&lr.super&&n.push("super"),n.length>0?`${n.join("+")}+${t}`:t}function tXr(t){let e=t.toLowerCase().split("+"),n=e[e.length-1];return n?{key:n,ctrl:e.includes("ctrl"),shift:e.includes("shift"),alt:e.includes("alt"),super:e.includes("super")}:null}function ip(t,e){let n=tXr(e);if(!n)return!1;let{key:r,ctrl:s,shift:i,alt:o,super:a}=n,c=0;switch(i&&(c|=lr.shift),o&&(c|=lr.alt),s&&(c|=lr.ctrl),a&&(c|=lr.super),r){case"escape":case"esc":return c!==0?!1:t==="\x1B"||Ds(t,ao.escape,0)||GE(t,ao.escape,0);case"space":return!Jp&&(c===lr.ctrl&&t==="\0"||c===lr.alt&&t==="\x1B ")?!0:c===0?t===" "||Ds(t,ao.space,0)||GE(t,ao.space,0):Ds(t,ao.space,c)||GE(t,ao.space,c);case"tab":return c===lr.shift?t==="\x1B[Z"||Ds(t,ao.tab,lr.shift)||GE(t,ao.tab,lr.shift):c===0?t===" "||Ds(t,ao.tab,0):Ds(t,ao.tab,c)||GE(t,ao.tab,c);case"enter":case"return":return c===lr.shift?Ds(t,ao.enter,lr.shift)||Ds(t,ao.kpEnter,lr.shift)||GE(t,ao.enter,lr.shift)?!0:Jp?t==="\x1B\r"||t===` -`:!1:c===lr.alt?Ds(t,ao.enter,lr.alt)||Ds(t,ao.kpEnter,lr.alt)||GE(t,ao.enter,lr.alt)?!0:Jp?!1:t==="\x1B\r":c===0?t==="\r"||!Jp&&t===` -`||t==="\x1BOM"||Ds(t,ao.enter,0)||Ds(t,ao.kpEnter,0):Ds(t,ao.enter,c)||Ds(t,ao.kpEnter,c)||GE(t,ao.enter,c);case"backspace":return c===lr.alt?t==="\x1B\x7F"||t==="\x1B\b"?!0:Ds(t,ao.backspace,lr.alt)||GE(t,ao.backspace,lr.alt):c===lr.ctrl?Vrn(t,lr.ctrl)?!0:Ds(t,ao.backspace,lr.ctrl)||GE(t,ao.backspace,lr.ctrl):c===0?Vrn(t,0)||Ds(t,ao.backspace,0)||GE(t,ao.backspace,0):Ds(t,ao.backspace,c)||GE(t,ao.backspace,c);case"insert":return c===0?og(t,$E.insert)||Ds(t,Fo.insert,0):VA(t,"insert",c)?!0:Ds(t,Fo.insert,c);case"delete":return c===0?og(t,$E.delete)||Ds(t,Fo.delete,0):VA(t,"delete",c)?!0:Ds(t,Fo.delete,c);case"clear":return c===0?og(t,$E.clear):VA(t,"clear",c);case"home":return c===0?og(t,$E.home)||Ds(t,Fo.home,0):VA(t,"home",c)?!0:Ds(t,Fo.home,c);case"end":return c===0?og(t,$E.end)||Ds(t,Fo.end,0):VA(t,"end",c)?!0:Ds(t,Fo.end,c);case"pageup":return c===0?og(t,$E.pageUp)||Ds(t,Fo.pageUp,0):VA(t,"pageUp",c)?!0:Ds(t,Fo.pageUp,c);case"pagedown":return c===0?og(t,$E.pageDown)||Ds(t,Fo.pageDown,0):VA(t,"pageDown",c)?!0:Ds(t,Fo.pageDown,c);case"up":return c===lr.alt?t==="\x1Bp"||Ds(t,ql.up,lr.alt):c===0?og(t,$E.up)||Ds(t,ql.up,0):VA(t,"up",c)?!0:Ds(t,ql.up,c);case"down":return c===lr.alt?t==="\x1Bn"||Ds(t,ql.down,lr.alt):c===0?og(t,$E.down)||Ds(t,ql.down,0):VA(t,"down",c)?!0:Ds(t,ql.down,c);case"left":return c===lr.alt?t==="\x1B[1;3D"||!Jp&&t==="\x1BB"||t==="\x1Bb"||Ds(t,ql.left,lr.alt):c===lr.ctrl?t==="\x1B[1;5D"||VA(t,"left",lr.ctrl)||Ds(t,ql.left,lr.ctrl):c===0?og(t,$E.left)||Ds(t,ql.left,0):VA(t,"left",c)?!0:Ds(t,ql.left,c);case"right":return c===lr.alt?t==="\x1B[1;3C"||!Jp&&t==="\x1BF"||t==="\x1Bf"||Ds(t,ql.right,lr.alt):c===lr.ctrl?t==="\x1B[1;5C"||VA(t,"right",lr.ctrl)||Ds(t,ql.right,lr.ctrl):c===0?og(t,$E.right)||Ds(t,ql.right,0):VA(t,"right",c)?!0:Ds(t,ql.right,c);case"f1":case"f2":case"f3":case"f4":case"f5":case"f6":case"f7":case"f8":case"f9":case"f10":case"f11":case"f12":return c!==0?!1:og(t,$E[r])}if(r.length===1&&(r>="a"&&r<="z"||jrn(r)||X3.has(r))){let u=r.charCodeAt(0),l=ZJr(r),d=r>="a"&&r<="z",h=jrn(r);return c===lr.ctrl+lr.alt&&!Jp&&l&&t===`\x1B${l}`||c===lr.alt&&!Jp&&(d||h||X3.has(r))&&t===`\x1B${r}`?!0:c===lr.ctrl?l&&t===l?!0:Ds(t,u,lr.ctrl)||Ibe(t,u,lr.ctrl):c===lr.shift+lr.ctrl?Ds(t,u,lr.shift+lr.ctrl)||Ibe(t,u,lr.shift+lr.ctrl):c===lr.shift?d&&t===r.toUpperCase()?!0:Ds(t,u,lr.shift)||Ibe(t,u,lr.shift):c!==0?Ds(t,u,c)||Ibe(t,u,c):t===r||Ds(t,u,0)}return!1}function Yrn(t,e,n){let r=xbe(t),s=hX(r,e),i=s>=97&&s<=122,o=s>=48&&s<=57,a=X3.has(String.fromCharCode(s)),c=i||o||a?s:n??s,u;if(c===ao.escape?u="escape":c===ao.tab?u="tab":c===ao.enter||c===ao.kpEnter?u="enter":c===ao.space?u="space":c===ao.backspace?u="backspace":c===Fo.delete?u="delete":c===Fo.insert?u="insert":c===Fo.home?u="home":c===Fo.end?u="end":c===Fo.pageUp?u="pageUp":c===Fo.pageDown?u="pageDown":c===ql.up?u="up":c===ql.down?u="down":c===ql.left?u="left":c===ql.right?u="right":(c>=48&&c<=57||c>=97&&c<=122||X3.has(String.fromCharCode(c)))&&(u=String.fromCharCode(c)),!!u)return eXr(u,e)}function Zrn(t){let e=Jrn(t);if(e)return Yrn(e.codepoint,e.modifier,e.baseLayoutKey);let n=wbe(t);if(n)return Yrn(n.codepoint,n.modifier);if(Jp&&(t==="\x1B\r"||t===` -`))return"shift+enter";let r=XJr[t];if(r)return r;if(t==="\x1B")return"escape";if(t==="")return"ctrl+\\";if(t==="")return"ctrl+]";if(t==="")return"ctrl+-";if(t==="\x1B\x1B")return"ctrl+alt+[";if(t==="\x1B")return"ctrl+alt+\\";if(t==="\x1B")return"ctrl+alt+]";if(t==="\x1B")return"ctrl+alt+-";if(t===" ")return"tab";if(t==="\r"||!Jp&&t===` -`||t==="\x1BOM")return"enter";if(t==="\0")return"ctrl+space";if(t===" ")return"space";if(t==="\x7F")return"backspace";if(t==="\b")return Xrn()?"ctrl+backspace":"backspace";if(t==="\x1B[Z")return"shift+tab";if(!Jp&&t==="\x1B\r")return"alt+enter";if(!Jp&&t==="\x1B ")return"alt+space";if(t==="\x1B\x7F"||t==="\x1B\b")return"alt+backspace";if(!Jp&&t==="\x1BB")return"alt+left";if(!Jp&&t==="\x1BF")return"alt+right";if(!Jp&&t.length===2&&t[0]==="\x1B"){let s=t.charCodeAt(1);if(s>=1&&s<=26)return`ctrl+alt+${String.fromCharCode(s+96)}`;let i=String.fromCharCode(s);if(s>=97&&s<=122||s>=48&&s<=57||X3.has(i))return`alt+${i}`}if(t==="\x1B[A")return"up";if(t==="\x1B[B")return"down";if(t==="\x1B[C")return"right";if(t==="\x1B[D")return"left";if(t==="\x1B[H"||t==="\x1BOH")return"home";if(t==="\x1B[F"||t==="\x1BOF")return"end";if(t==="\x1B[3~")return"delete";if(t==="\x1B[5~")return"pageUp";if(t==="\x1B[6~")return"pageDown";if(t.length===1){let s=t.charCodeAt(0);if(s>=1&&s<=26)return`ctrl+${String.fromCharCode(s+96)}`;if(s>=32&&s<=126)return t}}var nXr=/^\x1b\[(\d+)(?::(\d*))?(?::(\d+))?(?:;(\d+))?(?::(\d+))?u$/,rXr=lr.shift|Z3;function fX(t){let e=t.match(nXr);if(!e)return;let n=Number.parseInt(e[1]??"",10);if(!Number.isFinite(n))return;let r=e[2]&&e[2].length>0?Number.parseInt(e[2],10):void 0,s=e[4]?Number.parseInt(e[4],10):1,i=Number.isFinite(s)?s-1:0;if((i&~rXr)!==0||i&(lr.alt|lr.ctrl))return;let o=n;if(i&lr.shift&&typeof r=="number"&&(o=r),o=xbe(o),!(!Number.isFinite(o)||o<32))try{return String.fromCodePoint(o)}catch{return}}function sXr(t){let e=wbe(t);if(!(!e||(e.modifier&~Z3&~lr.shift)!==0)&&!(!Number.isFinite(e.codepoint)||e.codepoint<32))try{return String.fromCodePoint(e.codepoint)}catch{return}}function j9e(t){return fX(t)??sXr(t)}p();function iXr(t){let e=t.startsWith("#")?t.slice(1):t,n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),s=parseInt(e.slice(4,6),16);return{r:n,g:r,b:s}}function nH(t){if(!/^[0-9a-f]+$/i.test(t))return;let e=16**t.length-1;if(!(e<=0))return Math.round(parseInt(t,16)/e*255)}var esn=/^\x1b\]11;([^\x07\x1b]*)(?:\x07|\x1b\\)$/i,oXr=/^(?:\x1b\[\?997;(1|2)n)+$/;function tsn(t){return esn.test(t)}function Tbe(t){let e=t.match(esn);if(!e)return;let n=e[1].trim();if(n.startsWith("#")){let l=n.slice(1);if(/^[0-9a-f]{6}$/i.test(l))return iXr(n);if(/^[0-9a-f]{12}$/i.test(l)){let d=nH(l.slice(0,4)),h=nH(l.slice(4,8)),m=nH(l.slice(8,12));return d!==void 0&&h!==void 0&&m!==void 0?{r:d,g:h,b:m}:void 0}return}let r=n.replace(/^rgba?:/i,""),[s,i,o]=r.split("/");if(s===void 0||i===void 0||o===void 0)return;let a=nH(s),c=nH(i),u=nH(o);return a!==void 0&&c!==void 0&&u!==void 0?{r:a,g:c,b:u}:void 0}function vbe(t){let e=t.match(oXr);if(e)return e[1]==="2"?"light":"dark"}p();var isn=require("node:child_process"),osn=require("node:os"),asn=require("node:path"),csn=require("node:url"),oH=null,sH={},lsn={widthPx:9,heightPx:18};function gX(){return lsn}function Rbe(t){lsn=t}function aXr(){try{return(0,isn.execSync)("tmux display-message -p '#{client_termfeatures}'",{encoding:"utf8",timeout:250,stdio:["ignore","pipe","ignore"]}).split(",").map(e=>e.trim()).includes("hyperlinks")}catch{return!1}}function cXr(t){let e=process.env.TERM_PROGRAM?.toLowerCase()||"",n=process.env.TERMINAL_EMULATOR?.toLowerCase()||"",r=process.env.TERM?.toLowerCase()||"",s=process.env.COLORTERM?.toLowerCase()||"",i=s==="truecolor"||s==="24bit",o=process.platform==="win32";return process.env.TMUX||r.startsWith("tmux")?{images:null,trueColor:i,hyperlinks:t()}:r.startsWith("screen")?{images:null,trueColor:i,hyperlinks:!1}:process.env.KITTY_WINDOW_ID||e==="kitty"?{images:"kitty",trueColor:!0,hyperlinks:!0}:e==="ghostty"||r.includes("ghostty")||process.env.GHOSTTY_RESOURCES_DIR?{images:"kitty",trueColor:!0,hyperlinks:!0}:process.env.WEZTERM_PANE||e==="wezterm"?{images:"kitty",trueColor:!0,hyperlinks:!0}:e==="warpterminal"||process.env.WARP_SESSION_ID||process.env.WARP_TERMINAL_SESSION_UUID?{images:"kitty",trueColor:!0,hyperlinks:!0}:process.env.ITERM_SESSION_ID||e==="iterm.app"?{images:"iterm2",trueColor:!0,hyperlinks:!0}:process.env.WT_SESSION?{images:null,trueColor:!0,hyperlinks:!0}:e==="alacritty"||e==="vscode"||e==="zed"?{images:null,trueColor:!0,hyperlinks:!0}:n==="jetbrains-jediterm"?{images:null,trueColor:!0,hyperlinks:!1}:o?{images:null,trueColor:!0,hyperlinks:!1}:{images:null,trueColor:i,hyperlinks:!1}}function nsn(t){return t==="1"?!0:t==="0"?!1:void 0}function Y9e(t=aXr){let e=nsn(process.env.PI_HYPERLINKS),n=cXr(e===void 0?t:()=>e),r=process.env.PI_IMAGE_PROTOCOL?.toLowerCase(),s=r==="kitty"||r==="iterm2"?r:r==="none"||r==="0"?null:void 0,i=nsn(process.env.PI_TRUE_COLOR);return{...n,...s!==void 0?{images:s}:{},...i!==void 0?{trueColor:i}:{},...e!==void 0?{hyperlinks:e}:{}}}function qc(){if(!oH){let t=sH.hyperlinks;oH={...Y9e(t===void 0?void 0:()=>t),...sH}}return oH}function usn(){oH=null}function zw(t){sH.images===t.images&&sH.trueColor===t.trueColor&&sH.hyperlinks===t.hyperlinks||(sH={...t},oH=null)}function AX(t){oH=t}var iH="\x1B_G",rsn="\x1B]1337;File=";function Hl(t){return t.startsWith(iH)||t.startsWith(rsn)?!0:t.includes(iH)||t.includes(rsn)}function kbe(){return Math.floor(Math.random()*4294967294)+1}function K9e(t,e={}){let r=["a=T","f=100","q=2"];if(e.moveCursor===!1&&r.push("C=1"),e.columns&&r.push(`c=${e.columns}`),e.rows&&r.push(`r=${e.rows}`),e.imageId&&r.push(`i=${e.imageId}`),t.length<=4096)return`\x1B_G${r.join(",")};${t}\x1B\\`;let s=[],i=0,o=!0;for(;i=t.length;o?(s.push(`\x1B_G${r.join(",")},m=1;${a}\x1B\\`),o=!1):c?s.push(`\x1B_Gm=0;${a}\x1B\\`):s.push(`\x1B_Gm=1;${a}\x1B\\`),i+=4096}return s.join("")}function aH(t){return`\x1B_Ga=d,d=I,i=${t},q=2\x1B\\`}function Nbe(){return"\x1B_Ga=d,d=A,q=2\x1B\\"}function z9e(){return"\x1B_Ga=d,d=a,q=2\x1B\\"}function J9e(t,e={}){let n=[`inline=${e.inline!==!1?1:0}`,`size=${Buffer.byteLength(t,"base64")}`];if(e.width!==void 0&&n.push(`width=${e.width}`),e.height!==void 0&&n.push(`height=${e.height}`),e.name){let r=Buffer.from(e.name).toString("base64");n.push(`name=${r}`)}return e.preserveAspectRatio===!1&&n.push("preserveAspectRatio=0"),`\x1B]1337;File=${n.join(";")}:${t}\x07`}var rH=new Map,ssn=0;function lXr(t){if(ssn+=1,rH.delete(t.imageId),rH.set(t.imageId,{...t,transmissionGeneration:ssn}),rH.size>1e3){let e=rH.keys().next().value;e!==void 0&&rH.delete(e)}}function dsn(t){let e=/\x1b_G([^;]*);/.exec(t)?.[1];if(!e)return;let n=/(?:^|,)i=(\d+)(?:,|$)/.exec(e)?.[1];return n===void 0?void 0:rH.get(Number.parseInt(n,10))}function Dbe(t){let e=dsn(t);if(e)return{imageId:e.imageId,columns:e.columns,rows:e.rows,widthPx:e.widthPx,heightPx:e.heightPx}}var uXr=new Set(["i","p","x","y","w","h","X","Y","c","r","C","U","z","P","Q","H","V"]);function psn(t){let e=/\x1b_G([^;]*);/.exec(t),n=dsn(t);if(!e||!n)return;let r=e.index,s=e[1],i;for(;;){let c=t.indexOf("\x1B\\",r+iH.length);if(c===-1)return;if(i=c+2,!/(?:^|,)m=1(?:,|$)/.test(s))break;if(r=i,!t.startsWith(iH,r))return;let u=t.indexOf(";",r+iH.length);if(u===-1)return;s=t.slice(r+iH.length,u)}let a=`\x1B_Ga=p,q=2,${e[1].split(",").filter(c=>uXr.has(c.split("=",1)[0]??"")).join(",")}\x1B\\`;return{imageId:n.imageId,transmissionGeneration:n.transmissionGeneration,transmissionBytes:i-e.index,estimatedDecodedBytes:n.widthPx*n.heightPx*4,sequence:a,replacementLine:`${t.slice(0,e.index)}${a}${t.slice(i)}`}}function X9e(t,e,n){let r=Dbe(t),s=/\x1b_G([^;]*);/.exec(t);if(!r||!s||e<0||e>=r.rows||n<=0)return t;let i=Math.min(n,r.rows-e);if(e===0&&i===r.rows)return t;let o=Math.floor(r.heightPx*e/r.rows),a=Math.ceil(r.heightPx*(e+i)/r.rows),c=Math.max(1,Math.min(r.heightPx,a)-o),u=s[1].split(",").filter(l=>!/^[yhr]=/.test(l));return u.push(`y=${o}`,`h=${c}`,`r=${i}`),`${t.slice(0,s.index)}\x1B_G${u.join(",")};${t.slice(s.index+s[0].length)}`}function hsn(t,e,n,r={widthPx:9,heightPx:18}){let s=Math.max(1,Math.floor(e)),i=n===void 0?void 0:Math.max(1,Math.floor(n)),o=Math.max(1,t.widthPx),a=Math.max(1,t.heightPx),c=s*r.widthPx/o,u=i===void 0?c:i*r.heightPx/a,l=Math.min(c,u),d=o*l,h=a*l,m=Math.ceil(d/r.widthPx),f=Math.ceil(h/r.heightPx);return{columns:Math.max(1,Math.min(s,m)),rows:Math.max(1,i===void 0?f:Math.min(i,f))}}function msn(t,e,n={widthPx:9,heightPx:18}){return hsn(t,e,void 0,n).rows}function Z9e(t){try{let e=Buffer.from(t,"base64");if(e.length<24||e[0]!==137||e[1]!==80||e[2]!==78||e[3]!==71)return null;let n=e.readUInt32BE(16),r=e.readUInt32BE(20);return{widthPx:n,heightPx:r}}catch{return null}}function eKe(t){try{let e=Buffer.from(t,"base64");if(e.length<2||e[0]!==255||e[1]!==216)return null;let n=2;for(;n=192&&r<=194){let i=e.readUInt16BE(n+5);return{widthPx:e.readUInt16BE(n+7),heightPx:i}}if(n+3>=e.length)return null;let s=e.readUInt16BE(n+2);if(s<2)return null;n+=2+s}return null}catch{return null}}function tKe(t){try{let e=Buffer.from(t,"base64");if(e.length<10)return null;let n=e.slice(0,6).toString("ascii");if(n!=="GIF87a"&&n!=="GIF89a")return null;let r=e.readUInt16LE(6),s=e.readUInt16LE(8);return{widthPx:r,heightPx:s}}catch{return null}}function nKe(t){try{let e=Buffer.from(t,"base64");if(e.length<30)return null;let n=e.slice(0,4).toString("ascii"),r=e.slice(8,12).toString("ascii");if(n!=="RIFF"||r!=="WEBP")return null;let s=e.slice(12,16).toString("ascii");if(s==="VP8 "){if(e.length<30)return null;let i=e.readUInt16LE(26)&16383,o=e.readUInt16LE(28)&16383;return{widthPx:i,heightPx:o}}else if(s==="VP8L"){if(e.length<25)return null;let i=e.readUInt32LE(21),o=(i&16383)+1,a=(i>>14&16383)+1;return{widthPx:o,heightPx:a}}else if(s==="VP8X"){if(e.length<30)return null;let i=(e[24]|e[25]<<8|e[26]<<16)+1,o=(e[27]|e[28]<<8|e[29]<<16)+1;return{widthPx:i,heightPx:o}}return null}catch{return null}}function cH(t,e){return e==="image/png"?Z9e(t):e==="image/jpeg"?eKe(t):e==="image/gif"?tKe(t):e==="image/webp"?nKe(t):null}function Bbe(t,e,n={}){let r=qc();if(!r.images)return null;let s=n.maxWidthCells??80,i=hsn(e,s,n.maxHeightCells,gX());return r.images==="kitty"?(n.imageId!==void 0&&lXr({imageId:n.imageId,columns:i.columns,rows:i.rows,widthPx:e.widthPx,heightPx:e.heightPx}),{sequence:K9e(t,{columns:i.columns,rows:i.rows,imageId:n.imageId,moveCursor:n.moveCursor}),columns:i.columns,rows:i.rows,imageId:n.imageId}):r.images==="iterm2"?{sequence:J9e(t,{width:i.columns,height:"auto",preserveAspectRatio:n.preserveAspectRatio??!0}),columns:i.columns,rows:i.rows}:null}function jA(t,e){return`\x1B]8;;${e}\x1B\\${t}\x1B]8;;\x1B\\`}function dXr(t){let e=(0,osn.homedir)();return e&&(t===e||t.startsWith(`${e}/`)||t.startsWith(`${e}\\`))?`~${t.slice(e.length)}`:t}function RM(t,e,n){let r=[];if(n){let s=dXr(n);qc().hyperlinks&&(0,asn.isAbsolute)(n)?r.push(jA(s,(0,csn.pathToFileURL)(n).href)):r.push(s)}return r.push(`[${t}]`),e&&r.push(`${e.widthPx}x${e.heightPx}`),`[Image: ${r.join(" ")}]`}p();p();p();p();var fsn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],gsn=12288,Asn=65510,ysn=[12288,12288,65281,65376,65504,65510];var Esn=4352,bsn=262141,rKe=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];p();var Pbe=(t,e)=>{let n=0,r=Math.floor(t.length/2)-1;for(;n<=r;){let s=Math.floor((n+r)/2),i=s*2;if(et[i+1])n=s+1;else return!0}return!1};var _sn=19968,[mXr,fXr]=gXr(rKe);function gXr(t){let e=t[0],n=t[1];for(let r=0;r=s&&_sn<=i)return[s,i];i-s>n-e&&(e=s,n=i)}return[e,n]}var Ssn=t=>t<161||t>1114109?!1:Pbe(fsn,t),Csn=t=>tAsn?!1:Pbe(ysn,t);var Isn=t=>t>=mXr&&t<=fXr?!0:tbsn?!1:Pbe(rKe,t);function AXr(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function sKe(t,{ambiguousAsWide:e=!1}={}){return AXr(t),Csn(t)||Isn(t)||e&&Ssn(t)?2:1}var WE=new Intl.Segmenter(void 0,{granularity:"grapheme"}),yXr=new Intl.Segmenter(void 0,{granularity:"word"});function uH(){return WE}function dH(){return yXr}function EXr(t){let e=t.codePointAt(0);return e>=126976&&e<=130047||e>=8960&&e<=9215||e>=9728&&e<=10175||e>=11088&&e<=11093||t.includes("\uFE0F")||t.length>2}var bXr=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),_Xr=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),SXr=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})$","v"),CXr=new RegExp("^\\p{Mark}$","v"),xsn=new RegExp("^(?:[\\p{Spacing_Mark}--[\\u1734\\u302E\\u302F]]|[\\u065F\\u0F7F\\u102B\\u102C\\u1031\\u1033-\\u1035\\u1038\\u103A-\\u103E])+$","v"),IXr=new RegExp("^\\p{RGI_Emoji}$","v"),xXr=512,yX=new Map,Obe=/[\p{Script_Extensions=Han}\p{Script_Extensions=Hiragana}\p{Script_Extensions=Katakana}\p{Script_Extensions=Hangul}\p{Script_Extensions=Bopomofo}]/u;function aKe(t){for(let e=0;e126)return!1}return!0}function wXr(t,e){if(e<=0||t.length===0)return{text:"",width:0};if(aKe(t)){let c=t.slice(0,e);return{text:c,width:c.length}}let n=t.includes("\x1B"),r=t.includes(" ");if(!n&&!r){let c="",u=0;for(let{segment:l}of WE.segment(t)){let d=Jw(l);if(u+d>e)break;c+=l,u+=d}return{text:c,width:u}}let s="",i=0,o=0,a="";for(;oe)break;a&&(s+=a,a=""),s+=" ",i+=3,o++;continue}let u=o;for(;ue)return{text:s,width:i};a&&(s+=a,a=""),s+=l,i+=d}o=u}return{text:s,width:i}}function iKe(t,e,n,r,s,i){let o="\x1B[0m",a=kXr(t),c=e+r,u;return n.length>0?u=`${t}${a}${o}${n}${o}`:u=`${t}${a}${o}`,i?u+" ".repeat(Math.max(0,s-c)):u}function Jw(t){if(t===" ")return 3;if(xsn.test(t))return[...t].length;if(bXr.test(t))return 0;if(EXr(t)&&IXr.test(t))return 2;let e=t.replace(_Xr,""),n=e.codePointAt(0);if(n===void 0)return 0;if(n>=127462&&n<=127487)return 2;let r=sKe(n),s=!1,i=[...e];for(let o of i.slice(1))if(xsn.test(o))r+=1,s=!1;else if(CXr.test(o))s=!0;else if(!SXr.test(o)){let a=o.codePointAt(0);s||a>=65280&&a<=65519?r+=sKe(a):(a===3635||a===3763)&&(r+=1),s=!1}return r}function nn(t){if(t.length===0)return 0;if(aKe(t))return t.length;let e=yX.get(t);if(e!==void 0)return e;let n=t;if(t.includes(" ")&&(n=n.replace(/\t/g," ")),n.includes("\x1B")){let s="",i=0;for(;i=xXr){let s=yX.keys().next().value;s!==void 0&&yX.delete(s)}return yX.set(t,r),r}function kM(t){if(!t.includes("\x1B"))return t;let e="",n=0;for(;n0&&e>=n&&e=r&&es==="\u0E33"?"\u0E4D\u0E32":"\u0ECD\u0EB2")),!e.includes(" "))return e;let n="",r=0;for(;r=t.length||t[e]!=="\x1B")return null;let n=t[e+1];if(n==="["){let r=e+2;for(;r=30&&a<=37||a>=90&&a<=97?this.fgColor=String(a):(a>=40&&a<=47||a>=100&&a<=107)&&(this.bgColor=String(a));break}o++}}reset(){this.bold=!1,this.dim=!1,this.italic=!1,this.underline=!1,this.blink=!1,this.inverse=!1,this.hidden=!1,this.strikethrough=!1,this.fgColor=null,this.bgColor=null}clear(){this.reset(),this.activeHyperlink=null}getActiveCodes(){let e=[];this.bold&&e.push("1"),this.dim&&e.push("2"),this.italic&&e.push("3"),this.underline&&e.push("4"),this.blink&&e.push("5"),this.inverse&&e.push("7"),this.hidden&&e.push("8"),this.strikethrough&&e.push("9"),this.fgColor&&e.push(this.fgColor),this.bgColor&&e.push(this.bgColor);let n=e.length>0?`\x1B[${e.join(";")}m`:"";return this.activeHyperlink&&(n+=RXr(this.activeHyperlink)),n}getActiveBackgroundCode(){return this.bgColor?`\x1B[${this.bgColor}m`:""}hasActiveCodes(){return this.bold||this.dim||this.italic||this.underline||this.blink||this.inverse||this.hidden||this.strikethrough||this.fgColor!==null||this.bgColor!==null||this.activeHyperlink!==null}getLineEndReset(){let e="";return this.underline&&(e+="\x1B[24m"),this.activeHyperlink&&(e+=vsn(this.activeHyperlink.terminator)),e}};function cKe(t,e){let n=0;for(;n{n&&(e.push(n),n="",s=null)};for(;i0?e[e.length-1]+=r:n=r),n&&e.push(n),e}function Xm(t,e){if(!t)return[""];let n=t.split(/\r\n|\r|\n/),r=[],s=new lH;for(let i of n){let o=r.length>0?s.getActiveCodes():"",a=DXr(o+i,e);for(let c of a)r.push(c);cKe(i,s)}return r.length>0?r:[""]}function DXr(t,e){if(!t)return[""];if(nn(t)<=e)return[t];let r=[],s=new lH,i=NXr(t),o="",a=0;for(let c of i){let u=nn(c),l=c.trim()==="";if(u>e&&!l){if(o){let m=s.getLineEndReset();m&&(o+=m),r.push(o),o="",a=0}let h=BXr(c,e,s);for(let m=0;me&&a>0){let h=o.trimEnd(),m=s.getLineEndReset();m&&(h+=m),r.push(h),l?(o=s.getActiveCodes(),a=0):(o=s.getActiveCodes()+c,a=u)}else o+=c,a+=u;cKe(c,s)}return o&&r.push(o),r.length>0?r.map(c=>c.trimEnd()):[""]}var lKe=/[(){}[\]<>.,;:'"!?+\-=*/\\|&%^$#@~`]/;function YA(t){return/\s/.test(t)}function BXr(t,e,n){let r=[],s=n.getActiveCodes(),i=0,o=0,a=[];for(;oe){let d=n.getLineEndReset();d&&(s+=d),r.push(s),s=n.getActiveCodes(),i=0}s+=u,i+=l}return s&&r.push(s),r.length>0?r:[""]}function RN(t,e,n){let r=nn(t),s=Math.max(0,e-r),i=" ".repeat(s),o=t+i;return n(o)}function pr(t,e,n="...",r=!1){if(e<=0)return"";if(t.length===0)return r?" ".repeat(e):"";let s=nn(n);if(s>=e){let g=nn(t);if(g<=e)return r?t+" ".repeat(e-g):t;let A=wXr(n,e);return A.width===0?r?" ".repeat(e):"":iKe("",0,A.text,A.width,e,r)}if(aKe(t)){if(t.length<=e)return r?t+" ".repeat(e-t.length):t;let g=e-s;return iKe(t.slice(0,g),g,n,s,e,r)}let i=e-s,o="",a="",c=0,u=0,l=!0,d=!1,h=!1,m=t.includes("\x1B"),f=t.includes(" ");if(!m&&!f){for(let{segment:g}of WE.segment(t)){let A=Jw(g);if(l&&u+A<=i?(o+=g,u+=A):l=!1,c+=A,c>e){d=!0;break}}h=!d}else{let g=0;for(;ge){d=!0;break}g++;continue}let y=g;for(;ye){d=!0;break}}if(d)break;g=y}h=g>=t.length}return!d&&h?r?t+" ".repeat(Math.max(0,e-c)):t:iKe(o,u,n,s,e,r)}function ic(t,e,n,r=!1){return uKe(t,e,n,r).text}function uKe(t,e,n,r=!1){if(n<=0)return{text:"",width:0};let s=e+n,i="",o=0,a=0,c=0,u="";for(;c=e&&a=e&&a=s)break}if(c=d,a>=s)break}return{text:i,width:o}}var oKe=new lH;function ksn(t,e,n,r,s=!1){let i="",o=0,a="",c=0,u=0,l=0,d="",h=!1,m=n+r;for(oKe.clear();l=n&&u=n&&u=e:u>=m)break}if(l=g,r<=0?u>=e:u>=m)break}return{before:i,beforeWidth:o,after:a,afterWidth:c}}function Xw(t,e){let n=t.handleMouse?.(e);if(n){if("target"in n)return n;if(!(!n.handled&&!n.capture&&!n.focus))return{...n,handled:!0,...n.focus?{focusTarget:t}:{},target:{component:t,originX:e.screenX-e.x,originY:e.screenY-e.y,width:e.width,height:e.height}}}}function Dsn(t,e){return{...t,x:t.screenX-e.originX,y:t.screenY-e.originY,width:e.width,height:e.height}}function Lbe(t){return t!==null&&"focused"in t}var KA="\x1B_pi:c\x07";function Nsn(t,e){if(t===void 0)return;if(typeof t=="number")return t;let n=t.match(/^(\d+(?:\.\d+)?)%$/);if(n)return Math.floor(e*parseFloat(n[1])/100)}var _n=class{children=[];mouseLayout;addChild(e){this.children.push(e)}removeChild(e){let n=this.children.indexOf(e);n!==-1&&this.children.splice(n,1)}clear(){this.children=[]}invalidate(){for(let e of this.children)e.invalidate?.()}handleMouse(e){if(e.y<0||e.y>=e.height)return;let n=this.mouseLayout?.width===e.width?this.mouseLayout.children:this.children.map(s=>({component:s,height:s.render(e.width).length})),r=0;for(let{component:s,height:i}of n){if(e.y>=r&&e.y0}overlayFocusRestore={status:"inactive"};constructor(e,n,r){super(),this.terminal=e,this.logDirectory=r,n!==void 0&&(this.showHardwareCursor=n)}resetRenderState(){}beforeTerminalStart(){}afterTerminalStart(){}beforeTerminalStop(e){}afterTerminalStop(e){}get fullRedraws(){return this.fullRedrawCount}getShowHardwareCursor(){return this.showHardwareCursor}setShowHardwareCursor(e){this.showHardwareCursor!==e&&(this.showHardwareCursor=e,e||this.terminal.hideCursor(),this.requestRender())}getClearOnShrink(){return this.clearOnShrink}setClearOnShrink(e){this.clearOnShrink=e}getFocusedComponent(){return this.focusedComponent}setFocus(e){this.setFocusInternal({component:e,overlayFocusRestore:"clear"})}setFocusInternal({component:e,overlayFocusRestore:n}){let r=this.focusedComponent,s=e,i=r?this.overlayStack.find(u=>u.component===r&&this.isOverlayVisible(u)):void 0,o=s?this.overlayStack.some(u=>u.component===s):!1,a=this.getVisibleOverlayFocusRestore();s&&!o?a.status==="blocked"&&a.blockedBy===r?a.resume.status==="focus-target"||!this.isComponentMounted(a.blockedBy)?s=this.resolveBlockedOverlayFocusResume(a):this.overlayFocusRestore={status:"blocked",overlay:a.overlay,blockedBy:s,resume:a.resume}:i&&a.status!=="inactive"&&a.overlay===i&&!this.isOverlayFocusAncestor(i,s)&&(this.overlayFocusRestore={status:"blocked",overlay:i,blockedBy:s,resume:{status:"restore-overlay"}}):s===null&&(a.status==="blocked"&&a.blockedBy===r?s=this.resolveBlockedOverlayFocusResume(a):n==="clear"&&this.clearOverlayFocusRestore()),Lbe(this.focusedComponent)&&(this.focusedComponent.focused=!1),this.focusedComponent=s,Lbe(s)&&(s.focused=!0);let c=s?this.overlayStack.find(u=>u.component===s&&this.isOverlayVisible(u)):void 0;c&&(this.overlayFocusRestore={status:"eligible",overlay:c})}clearOverlayFocusRestore(){this.overlayFocusRestore={status:"inactive"}}clearOverlayFocusRestoreFor(e){this.overlayFocusRestore.status!=="inactive"&&this.overlayFocusRestore.overlay===e&&this.clearOverlayFocusRestore()}resolveBlockedOverlayFocusResume(e){return e.resume.status==="restore-overlay"?e.overlay.component:(this.clearOverlayFocusRestore(),e.resume.target)}getVisibleOverlayFocusRestore(){let e=this.overlayFocusRestore;return e.status==="inactive"?e:!this.overlayStack.includes(e.overlay)||!this.isOverlayVisible(e.overlay)?{status:"inactive"}:e}isOverlayFocusAncestor(e,n){let r=new Set,s=e.preFocus;for(;s&&!r.has(s);){if(r.add(s),s===n)return!0;s=this.overlayStack.find(i=>i.component===s)?.preFocus??null}return!1}retargetOverlayPreFocus(e){for(let n of this.overlayStack)n!==e&&n.preFocus===e.component&&(n.preFocus=e.preFocus)}getMountedRoots(){return this.children}isComponentMounted(e){return this.getMountedRoots().some(n=>this.containsComponent(n,e))}containsComponent(e,n){return e===n?!0:e instanceof _n?e.children.some(r=>this.containsComponent(r,n)):!1}showOverlay(e,n){let r={component:e,...n===void 0?{}:{options:n},preFocus:this.focusedComponent,hidden:!1,focusOrder:++this.focusOrderCounter};return this.overlayStack.push(r),!n?.nonCapturing&&this.isOverlayVisible(r)&&this.setFocus(e),this.terminal.hideCursor(),this.requestRender(),{hide:()=>{let s=this.overlayStack.indexOf(r);if(s!==-1){if(this.clearOverlayFocusRestoreFor(r),this.retargetOverlayPreFocus(r),this.overlayStack.splice(s,1),this.focusedComponent===e){let i=this.getTopmostVisibleOverlay();this.setFocus(i?.component??r.preFocus)}this.overlayStack.length===0&&this.terminal.hideCursor(),this.requestRender()}},setHidden:s=>{if(r.hidden!==s){if(r.hidden=s,s){if(this.clearOverlayFocusRestoreFor(r),this.focusedComponent===e){let i=this.getTopmostVisibleOverlay();this.setFocus(i?.component??r.preFocus)}}else!n?.nonCapturing&&this.isOverlayVisible(r)&&(r.focusOrder=++this.focusOrderCounter,this.setFocus(e));this.requestRender()}},isHidden:()=>r.hidden,focus:()=>{!this.overlayStack.includes(r)||!this.isOverlayVisible(r)||(r.focusOrder=++this.focusOrderCounter,this.setFocus(e),this.requestRender())},unfocus:s=>{let i=this.focusedComponent===e,o=this.overlayFocusRestore,a=o.status!=="inactive"&&o.overlay===r;if(!(!i&&!a)){if(o.status==="blocked"&&o.overlay===r&&this.focusedComponent===o.blockedBy){s?this.overlayFocusRestore={status:"blocked",overlay:r,blockedBy:o.blockedBy,resume:{status:"focus-target",target:s.target}}:this.clearOverlayFocusRestore(),this.requestRender();return}if(this.clearOverlayFocusRestoreFor(r),i||s){let c=this.getTopmostVisibleOverlay(),u=c&&c!==r?c.component:r.preFocus;this.setFocus(s?s.target:u)}this.requestRender()}},isFocused:()=>this.focusedComponent===e,getBounds:()=>{if(!(!this.overlayStack.includes(r)||!this.isOverlayVisible(r)||!r.bounds))return{...r.bounds}}}}hideOverlay(){let e=this.overlayStack[this.overlayStack.length-1];if(e){if(this.clearOverlayFocusRestoreFor(e),this.retargetOverlayPreFocus(e),this.overlayStack.pop(),this.focusedComponent===e.component){let n=this.getTopmostVisibleOverlay();this.setFocus(n?.component??e.preFocus)}this.overlayStack.length===0&&this.terminal.hideCursor(),this.requestRender()}}hasOverlay(){return this.overlayStack.some(e=>this.isOverlayVisible(e))}isOverlayFocused(){return this.overlayStack.some(e=>e.component===this.focusedComponent&&this.isOverlayVisible(e))}resolveMouseFocusTarget(e){for(let n=this.overlayStack.length-1;n>=0;n--){let r=this.overlayStack[n];if(this.isOverlayVisible(r)&&this.containsComponent(r.component,e))return r.component}return e}dispatchMouseToOverlay(e){for(let n=this.renderedOverlayLayouts.length-1;n>=0;n--){let r=this.renderedOverlayLayouts[n];if(e.screenX=r.col+r.width||e.screenY=r.row+r.height)continue;let s=Xw(r.entry.component,{...e,x:e.screenX-r.col,y:e.screenY-r.row,width:r.width,height:r.height});return s?{hit:!0,result:s.focus?{...s,focusTarget:r.entry.component}:s}:{hit:!0}}return{hit:!1}}isOverlayVisible(e){return e.hidden?!1:e.options?.visible?e.options.visible(this.terminal.columns,this.terminal.rows):!0}getTopmostVisibleOverlay(){let e;for(let n of this.overlayStack)n.options?.nonCapturing||!this.isOverlayVisible(n)||(!e||n.focusOrder>e.focusOrder)&&(e=n);return e}invalidate(){for(let e of this.getMountedRoots())e.invalidate();for(let e of this.overlayStack)e.component.invalidate()}start(){this.stopped=!1,this.beforeTerminalStart(),this.terminal.start(e=>this.handleTerminalInput(e),()=>this.requestRender()),this.afterTerminalStart(),this.terminal.hideCursor(),this.terminalColorSchemeNotificationsEnabled&&this.terminal.write("\x1B[?2031h"),this.queryCellSize(),this.requestRender()}addInputListener(e){return this.inputListeners.add(e),()=>{this.inputListeners.delete(e)}}removeInputListener(e){this.inputListeners.delete(e)}onTerminalColorSchemeChange(e){return this.terminalColorSchemeListeners.add(e),()=>{this.terminalColorSchemeListeners.delete(e)}}setTerminalColorSchemeNotifications(e){this.terminalColorSchemeNotificationsEnabled!==e&&(this.terminalColorSchemeNotificationsEnabled=e,this.stopped||this.terminal.write(e?"\x1B[?2031h":"\x1B[?2031l"))}queryCellSize(){qc().images&&this.terminal.write("\x1B[16t")}stop(e={}){this.stopped=!0,this.cancelRenderTimer(),this.terminalColorSchemeNotificationsEnabled&&this.terminal.write("\x1B[?2031l"),this.beforeTerminalStop(e),this.terminal.showCursor(),this.terminal.stop(),this.afterTerminalStop(e)}renderNow(e=!1){e&&this.resetRenderState(),this.renderRequested=!1,this.cancelRenderTimer(),this.lastRenderAt=bX.performance.now(),this.doRender()}requestRender(e=!1){if(e){this.resetRenderState(),this.requestImmediateRender();return}this.renderRequested||(this.renderRequested=!0,process.nextTick(()=>this.scheduleRender()))}requestImmediateRender(){this.cancelRenderTimer(),this.renderRequested=!0,!this.immediateRenderScheduled&&(this.immediateRenderScheduled=!0,process.nextTick(()=>{this.immediateRenderScheduled=!1,!(this.stopped||!this.renderRequested)&&(this.cancelRenderTimer(),this.renderRequested=!1,this.lastRenderAt=bX.performance.now(),this.doRender())}))}cancelRenderTimer(){this.renderTimer&&(clearTimeout(this.renderTimer),this.renderTimer=void 0)}scheduleRender(){if(this.stopped||this.renderTimer||!this.renderRequested)return;let e=bX.performance.now()-this.lastRenderAt,n=Math.max(0,t.MIN_RENDER_INTERVAL_MS-e);this.renderTimer=setTimeout(()=>{this.renderTimer=void 0,!(this.stopped||!this.renderRequested)&&(this.renderRequested=!1,this.lastRenderAt=bX.performance.now(),this.doRender(),this.renderRequested&&this.scheduleRender())},n)}handleTerminalInput(e){if(this.consumeOsc11BackgroundResponse(e)||this.consumeTerminalColorSchemeReport(e))return;if(this.inputListeners.size>0){let s=e;for(let i of this.inputListeners){let o=i(s);if(o?.consume)return;o?.data!==void 0&&(s=o.data)}if(s.length===0)return;e=s}if(this.consumeCellSizeResponse(e))return;if(ip(e,"shift+ctrl+d")&&this.onDebug){this.onDebug();return}let n=this.overlayStack.find(s=>s.component===this.focusedComponent);if(n&&!this.isOverlayVisible(n)){let s=this.getTopmostVisibleOverlay();s?this.setFocus(s.component):this.setFocusInternal({component:n.preFocus,overlayFocusRestore:"preserve"})}if(!this.overlayStack.some(s=>s.component===this.focusedComponent)){let s=this.getVisibleOverlayFocusRestore();s.status==="eligible"?this.setFocus(s.overlay.component):s.status==="blocked"&&s.blockedBy!==this.focusedComponent&&(s.resume.status==="restore-overlay"?this.setFocus(s.overlay.component):(this.clearOverlayFocusRestore(),this.setFocus(s.resume.target)))}if(this.focusedComponent?.handleInput){if(tH(e)&&!this.focusedComponent.wantsKeyRelease)return;this.focusedComponent.handleInput(e),this.requestImmediateRender()}}consumeOsc11BackgroundResponse(e){if(this.pendingOsc11BackgroundReplies<=0||!tsn(e))return!1;let n=Tbe(e);this.pendingOsc11BackgroundReplies-=1;let r=this.pendingOsc11BackgroundQueries.shift();return r&&!r.settled&&(r.settled=!0,r.timer&&(clearTimeout(r.timer),r.timer=void 0),r.resolve?.(n),r.resolve=void 0),!0}consumeTerminalColorSchemeReport(e){let n=vbe(e);if(!n)return!1;for(let r of this.terminalColorSchemeListeners)r(n);return!0}consumeCellSizeResponse(e){let n=e.match(/^\x1b\[6;(\d+);(\d+)t$/);if(!n)return!1;let r=parseInt(n[1],10),s=parseInt(n[2],10);return r<=0||s<=0||(Rbe({widthPx:s,heightPx:r}),this.invalidate(),this.requestRender()),!0}resolveOverlayLayout(e,n,r,s){let i=e??{},o=typeof i.margin=="number"?{top:i.margin,right:i.margin,bottom:i.margin,left:i.margin}:i.margin??{},a=Math.max(0,o.top??0),c=Math.max(0,o.right??0),u=Math.max(0,o.bottom??0),l=Math.max(0,o.left??0),d=Math.max(1,r-l-c),h=Math.max(1,s-a-u),m=Nsn(i.width,r)??Math.min(80,d);i.minWidth!==void 0&&(m=Math.max(m,i.minWidth)),m=Math.max(1,Math.min(m,d));let f=Nsn(i.maxHeight,s);f!==void 0&&(f=Math.max(1,Math.min(f,h)));let g=f!==void 0?Math.min(n,f):n,A,y;if(i.row!==void 0)if(typeof i.row=="string"){let b=i.row.match(/^(\d+(?:\.\d+)?)%$/);if(b){let S=Math.max(0,h-g),C=parseFloat(b[1])/100;A=a+Math.floor(S*C)}else A=this.resolveAnchorRow("center",g,h,a)}else A=i.row;else{let b=i.anchor??"center";A=this.resolveAnchorRow(b,g,h,a)}if(i.col!==void 0)if(typeof i.col=="string"){let b=i.col.match(/^(\d+(?:\.\d+)?)%$/);if(b){let S=Math.max(0,d-m),C=parseFloat(b[1])/100;y=l+Math.floor(S*C)}else y=this.resolveAnchorCol("center",m,d,l)}else y=i.col;else{let b=i.anchor??"center";y=this.resolveAnchorCol(b,m,d,l)}return i.offsetY!==void 0&&(A+=i.offsetY),i.offsetX!==void 0&&(y+=i.offsetX),A=Math.max(a,Math.min(A,s-u-g)),y=Math.max(l,Math.min(y,r-c-m)),{width:m,row:A,col:y,maxHeight:f}}resolveAnchorRow(e,n,r,s){switch(e){case"top-left":case"top-center":case"top-right":return s;case"bottom-left":case"bottom-center":case"bottom-right":return s+r-n;case"left-center":case"center":case"right-center":return s+Math.floor((r-n)/2)}}resolveAnchorCol(e,n,r,s){switch(e){case"top-left":case"left-center":case"bottom-left":return s;case"top-right":case"right-center":case"bottom-right":return s+r-n;case"top-center":case"center":case"bottom-center":return s+Math.floor((r-n)/2)}}compositeOverlays(e,n,r){if(this.overlayStack.length===0)return this.renderedOverlayLayouts=[],e;let s=[...e];for(let l of this.overlayStack)l.bounds=void 0;let i=[],o=s.length,a=this.overlayStack.filter(l=>this.isOverlayVisible(l));a.sort((l,d)=>l.focusOrder-d.focusOrder);for(let l of a){let{component:d,options:h}=l,{width:m,maxHeight:f}=this.resolveOverlayLayout(h,0,n,r),g=d.render(m);f!==void 0&&g.length>f&&(g=g.slice(0,f));let{row:A,col:y}=this.resolveOverlayLayout(h,g.length,n,r);l.bounds={row:A,col:y,width:m,height:g.length},i.push({entry:l,overlayLines:g,row:A,col:y,w:m}),o=Math.max(o,A+g.length)}this.renderedOverlayLayouts=i.map(({entry:l,row:d,col:h,w:m,overlayLines:f})=>({entry:l,row:d,col:h,width:m,height:f.length}));let c=Math.max(s.length,r,o);for(;s.length=0&&gm?ic(l[f],0,m,!0):l[f];s[g]=this.compositeLineAt(s[g],A,h,m,n)}}return s}applyLineResets(e){let n=dKe;for(let r=0;r=r;s--){let i=e[s],o=i.indexOf(KA);if(o!==-1){let a=i.slice(0,o),c=nn(a);return e[s]=i.slice(0,o)+i.slice(o+KA.length),{row:s,col:c}}}return null}queryTerminalBackgroundColor({timeoutMs:e}){return new Promise(n=>{let r={settled:!1,resolve:n,timer:void 0};r.timer=setTimeout(()=>{r.settled||(r.settled=!0,r.timer=void 0,r.resolve?.(void 0),r.resolve=void 0)},e),this.pendingOsc11BackgroundQueries.push(r),this.pendingOsc11BackgroundReplies+=1,this.terminal.write("\x1B]11;?\x07")})}queryTerminalColorScheme({timeoutMs:e}){return new Promise(n=>{let r=!1,s,i=()=>{},o=a=>{r||(r=!0,s&&(clearTimeout(s),s=void 0),i(),n(a))};i=this.onTerminalColorSchemeChange(o),s=setTimeout(()=>o(void 0),e),this.terminal.write("\x1B[?996n")})}};var Vl=class{children=[];paddingX;paddingY;bgFn;cache;mouseLayout;constructor(e=1,n=1,r){this.paddingX=e,this.paddingY=n,this.bgFn=r}addChild(e){this.children.push(e),this.invalidateCache()}removeChild(e){let n=this.children.indexOf(e);n!==-1&&(this.children.splice(n,1),this.invalidateCache())}clear(){this.children=[],this.invalidateCache()}setBgFn(e){this.bgFn=e}invalidateCache(){this.cache=void 0}matchCache(e,n,r){let s=this.cache;return!!s&&s.width===e&&s.bgSample===r&&s.childLines.length===n.length&&s.childLines.every((i,o)=>i===n[o])}invalidate(){this.invalidateCache();for(let e of this.children)e.invalidate?.()}handleMouse(e){let n=Math.max(1,e.width-this.paddingX*2),r=e.y-this.paddingY,s=e.x-this.paddingX;if(r<0||s<0||s>=n)return;let i=this.mouseLayout?.width===n?this.mouseLayout.children:this.children.map(a=>({component:a,height:a.render(n).length})),o=0;for(let{component:a,height:c}of i){if(r>=o&&r1&&this.conflicts.push({key:n,keybindings:[...r]});for(let[n,r]of Object.entries(this.definitions)){let s=this.userBindings[n],i=hKe(s===void 0?r.defaultKeys:s);this.keysById.set(n,i)}}matches(e,n){let r=this.keysById.get(n)??[];for(let s of r)if(ip(e,s))return!0;return!1}getKeys(e){return[...this.keysById.get(e)??[]]}getDefinition(e){return this.definitions[e]}getConflicts(){return this.conflicts.map(e=>({...e,keybindings:[...e.keybindings]}))}setUserBindings(e){this.userBindings=e,this.rebuild()}getUserBindings(){return{...this.userBindings}}getResolvedBindings(){let e={};for(let n of Object.keys(this.definitions)){let r=this.keysById.get(n)??[];e[n]=r.length===1?r[0]:[...r]}return e}},Fbe=null;function kN(t){Fbe=t}function ms(){return Fbe||(Fbe=new NM(Zw)),Fbe}p();p();var yt=class{text;paddingX;paddingY;customBgFn;cachedText;cachedWidth;cachedLines;constructor(e="",n=1,r=1,s){this.text=e,this.paddingX=n,this.paddingY=r,this.customBgFn=s}setText(e){this.text=e,this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}setCustomBgFn(e){this.customBgFn=e,this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}invalidate(){this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}render(e){if(this.cachedLines&&this.cachedText===this.text&&this.cachedWidth===e)return this.cachedLines;if(!this.text||this.text.trim()===""){let h=[];return this.cachedText=this.text,this.cachedWidth=e,this.cachedLines=h,h}let n=this.text.replace(/\t/g," "),r=Math.min(this.paddingX,Math.max(0,Math.floor((e-1)/2))),s=Math.max(1,e-r*2),i=Xm(n,s),o=" ".repeat(r),a=" ".repeat(r),c=[];for(let h of i){let m=o+h+a;if(this.customBgFn)c.push(RN(m,e,this.customBgFn));else{let f=nn(m),g=Math.max(0,e-f);c.push(m+" ".repeat(g))}}let u=" ".repeat(e),l=[];for(let h=0;h0?d:[""]}};var Bsn=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],Psn=80,qE=class extends yt{frames=[...Bsn];intervalMs=Psn;currentFrame=0;intervalId=null;ui=null;renderIndicatorVerbatim=!1;spinnerColorFn;messageColorFn;message="Loading...";constructor(e,n,r,s="Loading...",i){super("",1,0),this.ui=e,this.spinnerColorFn=n,this.messageColorFn=r,this.message=s,this.setIndicator(i)}render(e){return["",...super.render(e)]}start(){this.updateDisplay(),this.restartAnimation()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}setMessage(e){this.message=e,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}setIndicator(e){this.renderIndicatorVerbatim=e!==void 0,this.frames=e?.frames!==void 0?[...e.frames]:[...Bsn],this.intervalMs=e?.intervalMs&&e.intervalMs>0?e.intervalMs:Psn,this.currentFrame=0,this.start()}restartAnimation(){this.stop(),!(this.frames.length<=1)&&(this.intervalId=setInterval(()=>{this.currentFrame=(this.currentFrame+1)%this.frames.length,this.updateDisplay()},this.intervalMs))}getRenderedIndicator(){let e=this.frames[this.currentFrame]??"";return this.renderIndicatorVerbatim?e:this.spinnerColorFn(e)}updateDisplay(){let e=this.getRenderedIndicator(),n=e.length>0?`${e} `:"";this.setText(`${n}${this.messageColorFn(this.message)}`),this.ui&&this.ui.requestRender()}};var hH=class extends qE{abortController=new AbortController;onAbort;get signal(){return this.abortController.signal}get aborted(){return this.abortController.signal.aborted}handleInput(e){ms().matches(e,"tui.select.cancel")&&(this.abortController.abort(),this.onAbort?.())}dispose(){this.stop()}};p();p();var mH=class{ring=[];push(e,n){if(e)if(n.accumulate&&this.ring.length>0){let r=this.ring.pop();this.ring.push(n.prepend?e+r:r+e)}else this.ring.push(e)}peek(){return this.ring.length>0?this.ring[this.ring.length-1]:void 0}rotate(){if(this.ring.length>1){let e=this.ring.pop();this.ring.unshift(e)}}get length(){return this.ring.length}};p();var fH=class{stack=[];push(e){this.stack.push(structuredClone(e))}pop(){return this.stack.pop()}clear(){this.stack.length=0}get length(){return this.stack.length}};p();var Osn=dH();function Qbe(t,e,n){if(e<=0)return 0;let r=t.slice(0,e),s=n?.segment,i=n?.isAtomicSegment,o=s?[...s(r)]:[...Osn.segment(r)],a=e;for(;o.length>0&&!i?.(o[o.length-1]?.segment||"")&&YA(o[o.length-1]?.segment||"");)a-=o.pop()?.segment.length||0;if(o.length===0)return a;let c=o[o.length-1];if(i?.(c.segment))a-=c.segment.length;else if(c.isWordLike){let u=c.segment,l=[...u.matchAll(new RegExp(lKe,"g"))];if(l.length<=0)a-=u.length;else{let d=l[l.length-1];a-=u.length-(d.index+d[0].length)}}else for(;o.length>0&&!i?.(o[o.length-1]?.segment||"")&&!o[o.length-1]?.isWordLike&&!YA(o[o.length-1]?.segment||"");)a-=o.pop()?.segment.length||0;return a}function Ube(t,e,n){if(e>=t.length)return t.length;let r=t.slice(e),s=n?.segment,i=n?.isAtomicSegment,a=(s?s(r):Osn.segment(r))[Symbol.iterator](),c=a.next(),u=e;for(;!c.done&&!i?.(c.value.segment)&&YA(c.value.segment);)u+=c.value.segment.length,c=a.next();if(c.done)return u;if(i?.(c.value.segment))u+=c.value.segment.length;else if(c.value.isWordLike)u+=lKe.exec(c.value.segment)?.index??c.value.segment.length;else for(;!c.done&&!i?.(c.value.segment)&&!c.value.isWordLike&&!YA(c.value.segment);)u+=c.value.segment.length,c=a.next();return u}p();var Msn=32,Lsn=2,PXr=10,OXr=t=>t.replace(/[\r\n]+/g," ").trim(),MXr=(t,e,n)=>Math.max(e,Math.min(t,n)),Xp=class{items=[];filteredItems=[];selectedIndex=0;mousePressedIndex;maxVisible=5;theme;layout;onSelect;onCancel;onSelectionChange;constructor(e,n,r,s={}){this.items=e,this.filteredItems=e,this.maxVisible=n,this.theme=r,this.layout=s}setFilter(e){this.filteredItems=this.items.filter(n=>n.value.toLowerCase().startsWith(e.toLowerCase())),this.selectedIndex=0}setSelectedIndex(e){this.selectedIndex=Math.max(0,Math.min(e,this.filteredItems.length-1))}invalidate(){}render(e){let n=[];if(this.filteredItems.length===0)return n.push(this.theme.noMatch(" No matching commands")),n;let r=this.getPrimaryColumnWidth(),{startIndex:s,endIndex:i}=this.getVisibleRange();for(let o=s;o0||i=r)){if(e.type==="press")return this.mousePressedIndex=s,this.selectedIndex!==s&&(this.selectedIndex=s,this.notifySelectionChange()),{handled:!0,focus:!0};if(e.type==="click"){let i=this.mousePressedIndex??s;this.mousePressedIndex=void 0;let o=this.selectedIndex!==i;this.selectedIndex=i,o&&this.notifySelectionChange();let a=this.filteredItems[this.selectedIndex];return a&&this.onSelect?.(a),{handled:!0}}}}handleInput(e){let n=ms();if(n.matches(e,"tui.select.up"))this.selectedIndex=this.selectedIndex===0?this.filteredItems.length-1:this.selectedIndex-1,this.notifySelectionChange();else if(n.matches(e,"tui.select.down"))this.selectedIndex=this.selectedIndex===this.filteredItems.length-1?0:this.selectedIndex+1,this.notifySelectionChange();else if(n.matches(e,"tui.select.confirm")){let r=this.filteredItems[this.selectedIndex];r&&this.onSelect&&this.onSelect(r)}else n.matches(e,"tui.select.cancel")&&this.onCancel&&this.onCancel()}getVisibleRange(){let e=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredItems.length-this.maxVisible));return{startIndex:e,endIndex:Math.min(e+this.maxVisible,this.filteredItems.length)}}renderItem(e,n,r,s,i){let o=n?"\u2192 ":" ",a=nn(o);if(s&&r>40){let l=Math.max(1,Math.min(i,r-a-4)),d=Math.max(1,l-Lsn),h=this.truncatePrimary(e,n,d,l),m=nn(h),f=" ".repeat(Math.max(1,l-m)),g=a+m+f.length,A=r-g-2;if(A>PXr){let y=pr(s,A,"");if(n)return this.theme.selectedText(`${o}${h}${f}${y}`);let b=this.theme.description(f+y);return o+h+b}}let c=r-a-2,u=this.truncatePrimary(e,n,c,c);return n?this.theme.selectedText(`${o}${u}`):o+u}getPrimaryColumnWidth(){let{min:e,max:n}=this.getPrimaryColumnBounds(),r=this.filteredItems.reduce((s,i)=>Math.max(s,nn(this.getDisplayValue(i))+Lsn),0);return MXr(r,e,n)}getPrimaryColumnBounds(){let e=this.layout.minPrimaryColumnWidth??this.layout.maxPrimaryColumnWidth??Msn,n=this.layout.maxPrimaryColumnWidth??this.layout.minPrimaryColumnWidth??Msn;return{min:Math.max(1,Math.min(e,n)),max:Math.max(1,Math.max(e,n))}}truncatePrimary(e,n,r,s){let i=this.getDisplayValue(e),o=this.layout.truncatePrimary?this.layout.truncatePrimary({text:i,maxWidth:r,columnWidth:s,item:e,isSelected:n}):pr(i,r,"");return pr(o,r,"")}getDisplayValue(e){return e.label||e.value}notifySelectionChange(){let e=this.filteredItems[this.selectedIndex];e&&this.onSelectionChange&&this.onSelectionChange(e)}getSelectedItem(){return this.filteredItems[this.selectedIndex]||null}};var Gsn=uH(),LXr=dH(),Wsn=/\[paste #(\d+)( (\+\d+ lines|\d+ chars))?\]/g,qsn=/^\[paste #(\d+)( (\+\d+ lines|\d+ chars))?\]$/;function gH(t){return t.length>=10&&qsn.test(t)}function FXr(t,e,n){if(n.size===0||!t.includes("[paste #"))return e.segment(t);let r=[];for(let a of t.matchAll(Wsn)){let c=Number.parseInt(a[1],10);n.has(c)&&r.push({start:a.index,end:a.index+a[0].length})}if(r.length===0)return e.segment(t);let s=e.segment(t),i=[],o=0;for(let a of s){for(;o=c.start&&a.indexe&&(c>=0&&o-u+m<=e?(s.push({text:t.slice(a,c),startIndex:a,endIndex:c}),a=c,o-=u):ae){let y=mKe(h,e);for(let S=0;Sn!=="@").map(Hsn);return new RegExp(`(?:^|[ \\t])(?:@(?:"[^"]*|[^\\s]*)|[${e.join("")}][^\\s]*)$`)}function $sn(t,e,n){let r=Math.max(0,n),s=` ${t} ${e} more `,i=nn(s);if(i+2<=r){let l=Math.floor((r-i)/2);return"\u2500".repeat(l)+s+"\u2500".repeat(r-l-i)}let o=`\u2500\u2500\u2500 ${t} ${e} more `,a=r-nn(o);if(a>=0)return o+"\u2500".repeat(a);let c="...".slice(0,r),u=r-nn(c);return ic(o,0,u,!0)+c}var NN=class{state={lines:[""],cursorLine:0,cursorCol:0};focused=!1;tui;theme;paddingX=0;lastWidth=80;renderedVisibleLineCount=1;renderedAutocompleteHeight=0;scrollOffset=0;borderColor;autocompleteProvider;autocompleteTriggerCharacters=[...Fsn];autocompleteTriggerPattern=Qsn(this.autocompleteTriggerCharacters);autocompleteDebouncePattern=Usn(this.autocompleteTriggerCharacters);autocompleteList;autocompleteState=null;autocompletePrefix="";autocompleteMaxVisible=5;autocompleteAbort;autocompleteDebounceTimer;autocompleteRequestTask=Promise.resolve();autocompleteStartToken=0;autocompleteRequestId=0;pastes=new Map;pasteCounter=0;pasteBuffer="";isInPaste=!1;history=[];historyIndex=-1;historyDraft=null;killRing=new mH;lastAction=null;jumpMode=null;preferredVisualCol=null;snappedFromCursorCol=null;undoStack=new fH;onSubmit;onChange;disableSubmit=!1;constructor(e,n,r={}){this.tui=e,this.theme=n,this.borderColor=n.borderColor;let s=r.paddingX??0;this.paddingX=Number.isFinite(s)?Math.max(0,Math.floor(s)):0;let i=r.autocompleteMaxVisible??5;this.autocompleteMaxVisible=Number.isFinite(i)?Math.max(3,Math.min(20,Math.floor(i))):5}validPasteIds(){return new Set(this.pastes.keys())}segment(e,n){return FXr(e,n==="word"?LXr:Gsn,this.validPasteIds())}getPaddingX(){return this.paddingX}setPaddingX(e){let n=Number.isFinite(e)?Math.max(0,Math.floor(e)):0;this.paddingX!==n&&(this.paddingX=n,this.tui.requestRender())}getAutocompleteMaxVisible(){return this.autocompleteMaxVisible}setAutocompleteMaxVisible(e){let n=Number.isFinite(e)?Math.max(3,Math.min(20,Math.floor(e))):5;this.autocompleteMaxVisible!==n&&(this.autocompleteMaxVisible=n,this.tui.requestRender())}setAutocompleteProvider(e){this.cancelAutocomplete(),this.autocompleteProvider=e,this.setAutocompleteTriggerCharacters(e.triggerCharacters??[])}addToHistory(e){let n=e.trim();n&&(this.history.length>0&&this.history[0]===n||(this.history.unshift(n),this.history.length>100&&this.history.pop()))}isEditorEmpty(){return this.state.lines.length===1&&this.state.lines[0]===""}isOnFirstVisualLine(){let e=this.buildVisualLineMap(this.lastWidth);return this.findCurrentVisualLine(e)===0}isOnLastVisualLine(){let e=this.buildVisualLineMap(this.lastWidth);return this.findCurrentVisualLine(e)===e.length-1}navigateHistory(e){if(this.lastAction=null,this.history.length===0)return;let n=this.historyIndex-e;if(!(n<-1||n>=this.history.length))if(this.historyIndex===-1&&n>=0&&(this.pushUndoSnapshot(),this.historyDraft=structuredClone(this.state)),this.historyIndex=n,this.historyIndex===-1){let r=this.historyDraft;this.historyDraft=null,r?(this.state=r,this.preferredVisualCol=null,this.snappedFromCursorCol=null,this.scrollOffset=0,this.onChange&&this.onChange(this.getText())):this.setTextInternal("")}else this.setTextInternal(this.history[this.historyIndex]||"",e===-1?"start":"end")}exitHistoryBrowsing(){this.historyIndex=-1,this.historyDraft=null}setTextInternal(e,n="end"){let r=e.split(` -`);this.state.lines=r.length===0?[""]:r,this.state.cursorLine=n==="start"?0:this.state.lines.length-1,this.setCursorCol(n==="start"?0:this.state.lines[this.state.cursorLine]?.length||0),this.scrollOffset=0,this.onChange&&this.onChange(this.getText())}invalidate(){}renderTopBorder(e,n){let r=n>0?$sn("\u2191",n,e):"\u2500".repeat(e);return this.borderColor(r)}renderBottomBorder(e,n){let r=n>0?$sn("\u2193",n,e):"\u2500".repeat(e);return this.borderColor(r)}render(e){let n=Math.max(0,Math.floor((e-1)/2)),r=Math.min(this.paddingX,n),s=Math.max(1,e-r*2),i=Math.max(1,s-(r?0:1));this.lastWidth=i;let o=this.layoutText(i),a=this.tui.terminal.rows,c=Math.max(5,Math.floor(a*.3)),u=o.findIndex(y=>y.hasCursor);u===-1&&(u=0),u=this.scrollOffset+c&&(this.scrollOffset=u-c+1);let l=Math.max(0,o.length-c);this.scrollOffset=Math.max(0,Math.min(this.scrollOffset,l));let d=o.slice(this.scrollOffset,this.scrollOffset+c);this.renderedVisibleLineCount=d.length;let h=[],m=" ".repeat(r),f=m;h.push(this.renderTopBorder(e,this.scrollOffset));let g=this.focused;for(let y of d){let b=y.text,S=nn(y.text),C=!1;if(y.hasCursor&&y.cursorPos!==void 0){let w=b.slice(0,y.cursorPos),R=b.slice(y.cursorPos),N=g?KA:"";if(R.length>0){let G=[...this.segment(R,"grapheme")][0]?.segment||"",$=R.slice(G.length),Q=`\x1B[7m${G}\x1B[0m`;b=w+N+Q+$}else b=w+N+"\x1B[7m \x1B[0m",S=S+1,S>s&&r>0&&(C=!0)}let I=" ".repeat(Math.max(0,s-S)),x=C?f.slice(1):f;h.push(`${m}${b}${I}${x}`)}let A=o.length-(this.scrollOffset+d.length);if(h.push(this.renderBottomBorder(e,A)),this.renderedAutocompleteHeight=0,this.autocompleteState&&this.autocompleteList){let y=this.autocompleteList.render(s);this.renderedAutocompleteHeight=y.length;for(let b of y){let S=nn(b),C=" ".repeat(Math.max(0,s-S));h.push(`${m}${b}${C}${f}`)}}return h}handleMouse(e){let n=this.renderedVisibleLineCount+2;if(this.autocompleteState&&this.autocompleteList&&e.y>=n&&e.ythis.renderedVisibleLineCount)return{handled:!0,focus:!0};let r=this.buildVisualLineMap(this.lastWidth),s=this.scrollOffset+e.y-1,i=r[s];if(!i)return{handled:!0,focus:!0};let o=this.state.lines[i.logicalLine]??"",a=i.startCol+i.length,c=o.slice(i.startCol,a),u=Math.max(0,Math.floor((e.width-1)/2)),l=Math.min(this.paddingX,u),d=Math.max(0,e.x-l),h=0,m=c.length,f=0;for(let A of this.segment(c,"grapheme")){let y=h+nn(A.segment);if(f=A.index,d0&&(m=f),this.state.cursorLine=i.logicalLine,this.setCursorCol(i.startCol+m),this.lastAction=null,this.exitHistoryBrowsing(),this.autocompleteState&&this.updateAutocomplete(),{handled:!0,focus:!0}}handleInput(e){let n=ms();if(this.jumpMode!==null){if(n.matches(e,"tui.editor.jumpForward")||n.matches(e,"tui.editor.jumpBackward")){this.jumpMode=null;return}let s=j9e(e)??(e.charCodeAt(0)>=32?e:void 0);if(s!==void 0){let i=this.jumpMode;this.jumpMode=null,this.jumpToChar(s,i);return}this.jumpMode=null}if(e.includes("\x1B[200~")&&(this.isInPaste=!0,this.pasteBuffer="",e=e.replace("\x1B[200~","")),this.isInPaste){this.pasteBuffer+=e;let s=this.pasteBuffer.indexOf("\x1B[201~");if(s!==-1){let i=this.pasteBuffer.substring(0,s);i.length>0&&this.handlePaste(i),this.isInPaste=!1;let o=this.pasteBuffer.substring(s+6);this.pasteBuffer="",o.length>0&&this.handleInput(o);return}return}if(n.matches(e,"tui.input.copy"))return;if(n.matches(e,"tui.editor.undo")){this.undo();return}if(this.autocompleteState&&this.autocompleteList){if(n.matches(e,"tui.select.cancel")){this.cancelAutocomplete();return}if(n.matches(e,"tui.select.up")||n.matches(e,"tui.select.down")){this.autocompleteList.handleInput(e);return}if(n.matches(e,"tui.input.tab")){let s=this.autocompleteList.getSelectedItem();if(s&&this.autocompleteProvider){this.pushUndoSnapshot(),this.lastAction=null;let i=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,s,this.autocompletePrefix);this.state.lines=i.lines,this.state.cursorLine=i.cursorLine,this.setCursorCol(i.cursorCol),this.cancelAutocomplete(),this.onChange&&this.onChange(this.getText())}return}if(n.matches(e,"tui.select.confirm")){let s=this.autocompleteList.getSelectedItem();if(s&&this.autocompleteProvider){this.pushUndoSnapshot(),this.lastAction=null;let i=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,s,this.autocompletePrefix);if(this.state.lines=i.lines,this.state.cursorLine=i.cursorLine,this.setCursorCol(i.cursorCol),this.autocompletePrefix.startsWith("/"))this.cancelAutocomplete();else{this.cancelAutocomplete(),this.onChange&&this.onChange(this.getText());return}}}}if(n.matches(e,"tui.input.tab")&&!this.autocompleteState){this.handleTabCompletion();return}if(n.matches(e,"tui.editor.deleteToLineEnd")){this.deleteToEndOfLine();return}if(n.matches(e,"tui.editor.deleteToLineStart")){this.deleteToStartOfLine();return}if(n.matches(e,"tui.editor.deleteWordBackward")){this.deleteWordBackwards();return}if(n.matches(e,"tui.editor.deleteWordForward")){this.deleteWordForward();return}if(n.matches(e,"tui.editor.deleteCharBackward")||ip(e,"shift+backspace")){this.handleBackspace();return}if(n.matches(e,"tui.editor.deleteCharForward")||ip(e,"shift+delete")){this.handleForwardDelete();return}if(n.matches(e,"tui.editor.yank")){this.yank();return}if(n.matches(e,"tui.editor.yankPop")){this.yankPop();return}if(n.matches(e,"tui.editor.historyPrevious")){this.cancelAutocomplete(),this.navigateHistory(-1);return}if(n.matches(e,"tui.editor.historyNext")){this.cancelAutocomplete(),this.navigateHistory(1);return}if(n.matches(e,"tui.editor.cursorLineStart")){this.moveToLineStart();return}if(n.matches(e,"tui.editor.cursorLineEnd")){this.moveToLineEnd();return}if(n.matches(e,"tui.editor.cursorWordLeft")){this.moveWordBackwards();return}if(n.matches(e,"tui.editor.cursorWordRight")){this.moveWordForwards();return}if(n.matches(e,"tui.input.newLine")||e.charCodeAt(0)===10&&e.length>1||e==="\x1B\r"||e==="\x1B[13;2~"||e.length>1&&e.includes("\x1B")&&e.includes("\r")||e===` -`&&e.length===1){if(this.shouldSubmitOnBackslashEnter(e,n)){this.handleBackspace(),this.submitValue();return}this.addNewLine();return}if(n.matches(e,"tui.input.submit")){if(this.disableSubmit)return;let s=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>0&&s[this.state.cursorCol-1]==="\\"){this.handleBackspace(),this.addNewLine();return}this.submitValue();return}if(n.matches(e,"tui.editor.cursorUp")){this.isOnFirstVisualLine()&&(this.isEditorEmpty()||this.historyIndex>-1||this.state.cursorCol===0)?this.navigateHistory(-1):this.isOnFirstVisualLine()?this.moveToLineStart():this.moveCursor(-1,0);return}if(n.matches(e,"tui.editor.cursorDown")){this.historyIndex>-1&&this.isOnLastVisualLine()?this.navigateHistory(1):this.isOnLastVisualLine()?this.moveToLineEnd():this.moveCursor(1,0);return}if(n.matches(e,"tui.editor.cursorRight")){this.moveCursor(0,1);return}if(n.matches(e,"tui.editor.cursorLeft")){this.moveCursor(0,-1);return}if(n.matches(e,"tui.editor.pageUp")){this.pageScroll(-1);return}if(n.matches(e,"tui.editor.pageDown")){this.pageScroll(1);return}if(n.matches(e,"tui.editor.jumpForward")){this.jumpMode="forward";return}if(n.matches(e,"tui.editor.jumpBackward")){this.jumpMode="backward";return}if(ip(e,"shift+space")){this.insertCharacter(" ");return}let r=j9e(e);if(r!==void 0){this.insertCharacter(r);return}e.charCodeAt(0)>=32&&this.insertCharacter(e)}layoutText(e){let n=[];if(this.state.lines.length===0||this.state.lines.length===1&&this.state.lines[0]==="")return n.push({text:"",hasCursor:!0,cursorPos:0}),n;for(let r=0;r=u.startIndex,m=l-u.startIndex):(h=l>=u.startIndex&&lu.text.length&&(m=u.text.length)))),h?n.push({text:u.text,hasCursor:!0,cursorPos:m}):n.push({text:u.text,hasCursor:!1})}}}return n}getText(){return this.state.lines.join(` -`)}expandPasteMarkers(e){let n=e;for(let[r,s]of this.pastes){let i=new RegExp(`\\[paste #${r}( (\\+\\d+ lines|\\d+ chars))?\\]`,"g");n=n.replace(i,()=>s)}return n}getExpandedText(){return this.expandPasteMarkers(this.state.lines.join(` -`))}getLines(){return[...this.state.lines]}getCursor(){return{line:this.state.cursorLine,col:this.state.cursorCol}}setText(e){this.cancelAutocomplete(),this.lastAction=null,this.exitHistoryBrowsing();let n=this.normalizeText(e);this.getText()!==n&&this.pushUndoSnapshot(),this.pastes.clear(),this.pasteCounter=0,this.setTextInternal(n)}insertTextAtCursor(e){e&&(this.cancelAutocomplete(),this.pushUndoSnapshot(),this.lastAction=null,this.exitHistoryBrowsing(),this.insertTextAtCursorInternal(e))}normalizeText(e){return e.replace(/\r\n/g,` -`).replace(/\r/g,` -`).replace(/\t/g," ")}insertTextAtCursorInternal(e){if(!e)return;let n=this.normalizeText(e),r=n.split(` -`),s=this.state.lines[this.state.cursorLine]||"",i=s.slice(0,this.state.cursorCol),o=s.slice(this.state.cursorCol);r.length===1?(this.state.lines[this.state.cursorLine]=i+n+o,this.setCursorCol(this.state.cursorCol+n.length)):(this.state.lines=[...this.state.lines.slice(0,this.state.cursorLine),i+r[0],...r.slice(1,-1),r[r.length-1]+o,...this.state.lines.slice(this.state.cursorLine+1)],this.state.cursorLine+=r.length-1,this.setCursorCol((r[r.length-1]||"").length)),this.onChange&&this.onChange(this.getText())}insertCharacter(e,n){this.exitHistoryBrowsing(),n||((YA(e)||this.lastAction!=="type-word")&&this.pushUndoSnapshot(),this.lastAction="type-word");let r=this.state.lines[this.state.cursorLine]||"",s=r.slice(0,this.state.cursorCol),i=r.slice(this.state.cursorCol);if(this.state.lines[this.state.cursorLine]=s+e+i,this.setCursorCol(this.state.cursorCol+e.length),this.onChange&&this.onChange(this.getText()),this.autocompleteState)this.updateAutocomplete();else if(e==="/"&&this.isAtStartOfMessage())this.tryTriggerAutocomplete();else if(this.autocompleteTriggerCharacters.includes(e)){let a=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol),c=a[a.length-2];(a.length===1||c===" "||c===" ")&&this.tryTriggerAutocomplete()}else if(/[a-zA-Z0-9.\-_]/.test(e)){let a=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);this.isInSlashCommandContext(a)?this.tryTriggerAutocomplete():this.autocompleteTriggerPattern.test(a)&&this.tryTriggerAutocomplete()}}handlePaste(e){this.cancelAutocomplete(),this.exitHistoryBrowsing(),this.lastAction=null,this.pushUndoSnapshot();let n=e.replace(/\x1b\[(\d+);5u/g,(a,c)=>{let u=Number(c);return u>=97&&u<=122?String.fromCharCode(u-96):u>=65&&u<=90?String.fromCharCode(u-64):a}),s=this.normalizeText(n).split("").filter(a=>a===` -`||a.charCodeAt(0)>=32).join("");if(/^[/~.]/.test(s)){let a=this.state.lines[this.state.cursorLine]||"",c=this.state.cursorCol>0?a[this.state.cursorCol-1]:"";c&&/\w/.test(c)&&(s=` ${s}`)}let i=s.split(` -`),o=s.length;if(i.length>10||o>1e3){this.pasteCounter++;let a=this.pasteCounter;this.pastes.set(a,s);let c=i.length>10?`[paste #${a} +${i.length} lines]`:`[paste #${a} ${o} chars]`;this.insertTextAtCursorInternal(c);return}if(i.length===1){this.insertTextAtCursorInternal(s);return}this.insertTextAtCursorInternal(s)}addNewLine(){this.cancelAutocomplete(),this.exitHistoryBrowsing(),this.lastAction=null,this.pushUndoSnapshot();let e=this.state.lines[this.state.cursorLine]||"",n=e.slice(0,this.state.cursorCol),r=e.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=n,this.state.lines.splice(this.state.cursorLine+1,0,r),this.state.cursorLine++,this.setCursorCol(0),this.onChange&&this.onChange(this.getText())}shouldSubmitOnBackslashEnter(e,n){if(this.disableSubmit||!ip(e,"enter"))return!1;let r=n.getKeys("tui.input.submit");if(!(r.includes("shift+enter")||r.includes("shift+return")))return!1;let i=this.state.lines[this.state.cursorLine]||"";return this.state.cursorCol>0&&i[this.state.cursorCol-1]==="\\"}submitValue(){this.cancelAutocomplete();let e=this.expandPasteMarkers(this.state.lines.join(` -`)).trim();this.state={lines:[""],cursorLine:0,cursorCol:0},this.pastes.clear(),this.pasteCounter=0,this.exitHistoryBrowsing(),this.scrollOffset=0,this.undoStack.clear(),this.lastAction=null,this.onChange&&this.onChange(""),this.onSubmit&&this.onSubmit(e)}handleBackspace(){if(this.exitHistoryBrowsing(),this.lastAction=null,this.state.cursorCol>0){this.pushUndoSnapshot();let e=this.state.lines[this.state.cursorLine]||"",n=e.slice(0,this.state.cursorCol),r=[...this.segment(n,"grapheme")],s=r[r.length-1],i=s?s.segment.length:1,o=qsn.exec(s.segment);if(o){let u=Number(o[1]);this.pastes.delete(u),this.pasteCounter--;let l=[...this.pastes.keys()].filter(d=>d>u).sort((d,h)=>d-h);for(let d of l)this.pastes.set(d-1,this.pastes.get(d)),this.pastes.delete(d);this.state.lines=this.state.lines.map(d=>d.replace(Wsn,(h,m,f)=>{let g=Number(m);return g<=u?h:`[paste #${g-1}${f}]`}))}e=this.state.lines[this.state.cursorLine]||"";let a=e.slice(0,this.state.cursorCol-i),c=e.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=a+c,this.setCursorCol(this.state.cursorCol-i)}else if(this.state.cursorLine>0){this.pushUndoSnapshot();let e=this.state.lines[this.state.cursorLine]||"",n=this.state.lines[this.state.cursorLine-1]||"";this.state.lines[this.state.cursorLine-1]=n+e,this.state.lines.splice(this.state.cursorLine,1),this.state.cursorLine--,this.setCursorCol(n.length)}if(this.onChange&&this.onChange(this.getText()),this.autocompleteState)this.updateAutocomplete();else{let n=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);this.isInSlashCommandContext(n)?this.tryTriggerAutocomplete():this.autocompleteTriggerPattern.test(n)&&this.tryTriggerAutocomplete()}}setCursorCol(e){this.state.cursorCol=e,this.preferredVisualCol=null,this.snappedFromCursorCol=null}moveToVisualLine(e,n,r){let s=e[n],i=e[r];if(!(s&&i))return;let o;if(this.snappedFromCursorCol!==null){let g=this.findVisualLineAt(e,s.logicalLine,this.snappedFromCursorCol);o=this.snappedFromCursorCol-e[g].startCol}else o=this.state.cursorCol-s.startCol;let c=n===e.length-1||e[n+1]?.logicalLine!==s.logicalLine?s.length:Math.max(0,s.length-1),l=r===e.length-1||e[r+1]?.logicalLine!==i.logicalLine?i.length:Math.max(0,i.length-1),d=this.computeVerticalMoveColumn(o,c,l);this.state.cursorLine=i.logicalLine;let h=i.startCol+d,m=this.state.lines[i.logicalLine]||"";this.state.cursorCol=Math.min(h,m.length);let f=[...this.segment(m,"grapheme")];for(let g of f){if(g.index>this.state.cursorCol)break;if(!(g.segment.length<=1)&&this.state.cursorColn;if(A&&y){let b=g.index+g.segment.length,S=r+1;for(;S0){this.pushUndoSnapshot();let n=e.slice(0,this.state.cursorCol);this.killRing.push(n,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.state.lines[this.state.cursorLine]=e.slice(this.state.cursorCol),this.setCursorCol(0)}else if(this.state.cursorLine>0){this.pushUndoSnapshot(),this.killRing.push(` -`,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill";let n=this.state.lines[this.state.cursorLine-1]||"";this.state.lines[this.state.cursorLine-1]=n+e,this.state.lines.splice(this.state.cursorLine,1),this.state.cursorLine--,this.setCursorCol(n.length)}this.onChange&&this.onChange(this.getText())}deleteToEndOfLine(){this.exitHistoryBrowsing();let e=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol0){this.pushUndoSnapshot(),this.killRing.push(` -`,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill";let n=this.state.lines[this.state.cursorLine-1]||"";this.state.lines[this.state.cursorLine-1]=n+e,this.state.lines.splice(this.state.cursorLine,1),this.state.cursorLine--,this.setCursorCol(n.length)}}else{this.pushUndoSnapshot();let n=this.lastAction==="kill",r=this.state.cursorCol;this.moveWordBackwards();let s=this.state.cursorCol;this.setCursorCol(r);let i=e.slice(s,this.state.cursorCol);this.killRing.push(i,{prepend:!0,accumulate:n}),this.lastAction="kill",this.state.lines[this.state.cursorLine]=e.slice(0,s)+e.slice(this.state.cursorCol),this.setCursorCol(s)}this.onChange&&this.onChange(this.getText())}deleteWordForward(){this.exitHistoryBrowsing();let e=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>=e.length){if(this.state.cursorLine=0&&(o=0&&i0)if(this.state.cursorCol0){let o=i.slice(0,this.state.cursorCol),a=[...this.segment(o,"grapheme")],c=a[a.length-1];this.setCursorCol(this.state.cursorCol-(c?c.segment.length:1))}else if(this.state.cursorLine>0){this.state.cursorLine--;let o=this.state.lines[this.state.cursorLine]||"";this.setCursorCol(o.length)}}this.autocompleteState&&this.updateAutocomplete()}pageScroll(e){this.lastAction=null;let n=this.tui.terminal.rows,r=Math.max(5,Math.floor(n*.3)),s=this.buildVisualLineMap(this.lastWidth),i=this.findCurrentVisualLine(s),o=Math.max(0,Math.min(s.length-1,i+e*r));this.moveToVisualLine(s,i,o)}moveWordBackwards(){this.lastAction=null;let e=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol===0){if(this.state.cursorLine>0){this.state.cursorLine--;let n=this.state.lines[this.state.cursorLine]||"";this.setCursorCol(n.length)}return}this.setCursorCol(Qbe(e,this.state.cursorCol,{segment:n=>this.segment(n,"word"),isAtomicSegment:gH}))}yank(){if(this.killRing.length===0)return;this.pushUndoSnapshot();let e=this.killRing.peek();this.insertYankedText(e),this.lastAction="yank"}yankPop(){if(this.lastAction!=="yank"||this.killRing.length<=1)return;this.pushUndoSnapshot(),this.deleteYankedText(),this.killRing.rotate();let e=this.killRing.peek();this.insertYankedText(e),this.lastAction="yank"}insertYankedText(e){this.exitHistoryBrowsing();let n=e.split(` -`);if(n.length===1){let r=this.state.lines[this.state.cursorLine]||"",s=r.slice(0,this.state.cursorCol),i=r.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=s+e+i,this.setCursorCol(this.state.cursorCol+e.length)}else{let r=this.state.lines[this.state.cursorLine]||"",s=r.slice(0,this.state.cursorCol),i=r.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=s+(n[0]||"");for(let a=1;a=e.length){this.state.cursorLinethis.segment(n,"word"),isAtomicSegment:gH}))}isSlashMenuAllowed(){return this.state.cursorLine===0}isAtStartOfMessage(){if(!this.isSlashMenuAllowed())return!1;let n=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);return n.trim()===""||n.trim()==="/"}isInSlashCommandContext(e){return this.isSlashMenuAllowed()&&e.trimStart().startsWith("/")}getBestAutocompleteMatchIndex(e,n){if(!n)return-1;let r=-1;for(let s=0;s{if(!this.autocompleteProvider)return;this.pushUndoSnapshot(),this.lastAction=null;let o=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,i,this.autocompletePrefix);this.state.lines=o.lines,this.state.cursorLine=o.cursorLine,this.setCursorCol(o.cursorCol),this.cancelAutocomplete(),this.onChange?.(this.getText())},s}tryTriggerAutocomplete(e=!1){this.requestAutocomplete({force:!1,explicitTab:e})}handleTabCompletion(){if(!this.autocompleteProvider)return;let n=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);this.isInSlashCommandContext(n)&&!n.trimStart().includes(" ")?this.handleSlashCommandCompletion():this.forceFileAutocomplete(!0)}handleSlashCommandCompletion(){this.requestAutocomplete({force:!1,explicitTab:!0})}forceFileAutocomplete(e=!1){this.requestAutocomplete({force:!0,explicitTab:e})}requestAutocomplete(e){if(!this.autocompleteProvider||e.force&&!(!this.autocompleteProvider.shouldTriggerFileCompletion||this.autocompleteProvider.shouldTriggerFileCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol)))return;this.cancelAutocompleteRequest();let n=++this.autocompleteStartToken,r=this.getAutocompleteDebounceMs(e);if(r>0){this.autocompleteDebounceTimer=setTimeout(()=>{this.autocompleteDebounceTimer=void 0,this.startAutocompleteRequest(n,e)},r);return}this.startAutocompleteRequest(n,e)}async startAutocompleteRequest(e,n){let r=this.autocompleteRequestTask;this.autocompleteRequestTask=(async()=>{if(await r,e!==this.autocompleteStartToken||!this.autocompleteProvider)return;let s=new AbortController;this.autocompleteAbort=s;let i=++this.autocompleteRequestId,o=this.getText(),a=this.state.cursorLine,c=this.state.cursorCol;await this.runAutocompleteRequest(i,s,o,a,c,n)})(),await this.autocompleteRequestTask}setAutocompleteTriggerCharacters(e){let n=[...Fsn];for(let r of e)r.length!==1||r==="/"||YA(r)||n.includes(r)||n.push(r);this.autocompleteTriggerCharacters=n,this.autocompleteTriggerPattern=Qsn(n),this.autocompleteDebouncePattern=Usn(n)}getAutocompleteDebounceMs(e){if(e.explicitTab||e.force)return 0;let r=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);return this.autocompleteDebouncePattern.test(r)?UXr:0}async runAutocompleteRequest(e,n,r,s,i,o){if(!this.autocompleteProvider)return;let a=await this.autocompleteProvider.getSuggestions(this.state.lines,this.state.cursorLine,this.state.cursorCol,{signal:n.signal,force:o.force});if(this.isAutocompleteRequestCurrent(e,n,r,s,i)){if(this.autocompleteAbort=void 0,!a||!Array.isArray(a.items)||a.items.length===0){this.cancelAutocomplete(),this.tui.requestRender();return}if(o.force&&o.explicitTab&&a.items.length===1){let c=a.items[0];this.pushUndoSnapshot(),this.lastAction=null;let u=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,c,a.prefix);this.state.lines=u.lines,this.state.cursorLine=u.cursorLine,this.setCursorCol(u.cursorCol),this.onChange&&this.onChange(this.getText()),this.tui.requestRender();return}this.applyAutocompleteSuggestions(a,o.force?"force":"regular"),this.tui.requestRender()}}isAutocompleteRequestCurrent(e,n,r,s,i){return!n.signal.aborted&&e===this.autocompleteRequestId&&this.getText()===r&&this.state.cursorLine===s&&this.state.cursorCol===i}applyAutocompleteSuggestions(e,n){this.autocompletePrefix=e.prefix,this.autocompleteList=this.createAutocompleteList(e.prefix,e.items);let r=this.getBestAutocompleteMatchIndex(e.items,e.prefix);r>=0&&this.autocompleteList.setSelectedIndex(r),this.autocompleteState=n}cancelAutocompleteRequest(){this.autocompleteStartToken+=1,this.autocompleteDebounceTimer&&(clearTimeout(this.autocompleteDebounceTimer),this.autocompleteDebounceTimer=void 0),this.autocompleteAbort?.abort(),this.autocompleteAbort=void 0}clearAutocompleteUi(){this.autocompleteState=null,this.autocompleteList=void 0,this.autocompletePrefix=""}cancelAutocomplete(){this.cancelAutocompleteRequest(),this.clearAutocompleteUi()}isShowingAutocomplete(){return this.autocompleteState!==null}updateAutocomplete(){!this.autocompleteState||!this.autocompleteProvider||this.requestAutocomplete({force:this.autocompleteState==="force",explicitTab:!1})}};p();p();p();var AH=Symbol.for("@earendil-works/pi-tui/layout-node");function $be(t){let e=t;return typeof e[AH]=="function"?e[AH]():void 0}function $Xr(t){return!("render"in t)}function SX(t,e){return t===void 0||!Number.isFinite(t)?e:Math.max(0,Math.floor(t))}var yH=class extends _n{entries=[];gap;align;constructor(e=[],n={}){super(),this.gap=SX(n.gap,0),this.align=n.align??"stretch";for(let r of e)$Xr(r)?this.addChild(r.component,r):this.addChild(r)}addChild(e,n={}){super.addChild(e),this.entries.push({component:e,...n.basis===void 0?{}:{basis:n.basis},...n.grow===void 0?{}:{grow:SX(n.grow,0)},...n.shrink===void 0?{}:{shrink:SX(n.shrink,1)},...n.minSize===void 0?{}:{minSize:SX(n.minSize,0)},...n.maxSize===void 0?{}:{maxSize:SX(n.maxSize,Number.MAX_SAFE_INTEGER)},...n.visible===void 0?{}:{visible:n.visible}})}removeChild(e){super.removeChild(e);let n=this.entries.findIndex(r=>r.component===e);n!==-1&&this.entries.splice(n,1)}clear(){super.clear(),this.entries.length=0}[AH](){return{type:this.layoutType,entries:this.entries,gap:this.gap,align:this.align}}};function EH(t,e){return t.filter(n=>n.visible?.(e)??!0)}function GXr(t,e){let n=Math.max(0,Math.floor(e.minSize??0)),r=Math.max(n,Math.floor(e.maxSize??Number.MAX_SAFE_INTEGER));return Math.max(n,Math.min(r,Math.max(0,Math.floor(t))))}function Vsn(t,e,n,r){let s=n;for(;s>0;){let i=e.map((c,u)=>({entry:c,index:u})).filter(({entry:c,index:u})=>r==="grow"?(c.grow??0)>0&&t[u]<(c.maxSize??Number.MAX_SAFE_INTEGER):(c.shrink??1)>0&&t[u]>(c.minSize??0));if(i.length===0)return;let o=i.reduce((c,{entry:u,index:l})=>c+(r==="grow"?u.grow??0:(u.shrink??1)*Math.max(1,t[l])),0),a=0;for(let{entry:c,index:u}of i){if(s<=0)break;let l=r==="grow"?c.grow??0:(c.shrink??1)*Math.max(1,t[u]),d=Math.max(1,Math.floor(s*l/o)),h=r==="grow"?(c.maxSize??Number.MAX_SAFE_INTEGER)-t[u]:t[u]-(c.minSize??0),m=Math.min(s,d,h);m<=0||(t[u]=t[u]+(r==="grow"?m:-m),s-=m,a+=m)}if(a===0)return}}function DM(t,e,n,r){let s=t.map((a,c)=>GXr(a.basis===void 0||a.basis==="auto"?e[c]??0:a.basis,a));if(n===void 0)return s;let i=Math.max(0,Math.floor(n)-Math.max(0,t.length-1)*r),o=s.reduce((a,c)=>a+c,0);return oi&&Vsn(s,t,o-i,"shrink"),s}var Gbe=class extends yH{layoutType="hstack";constructor(e=[],n={}){super(e,n)}render(e){let n=Math.max(1,e),r={width:n,height:Number.MAX_SAFE_INTEGER},s=EH(this.entries,r);if(s.length===0)return[];let i=s.map(d=>d.component.render(n).reduce((m,f)=>Math.max(m,nn(f)),0)),o=DM(s,i,n,this.gap),a=s.map((d,h)=>o[h]===0?[]:d.component.render(o[h])),c=a.reduce((d,h)=>Math.max(d,h.length),0),u=Array.from({length:c},()=>""),l=0;for(let d=0;d=u.length||(u[A]=jC(u[A],h[g],l,m,n))}l+=m+this.gap}return u}};p();var DN=class{base64Data;mimeType;dimensions;theme;options;imageId;cachedLines;cachedWidth;constructor(e,n,r,s={},i){this.base64Data=e,this.mimeType=n,this.theme=r,this.options=s,this.dimensions=i||cH(e,n)||{widthPx:800,heightPx:600},this.imageId=s.imageId}getImageId(){return this.imageId}invalidate(){this.cachedLines=void 0,this.cachedWidth=void 0}render(e){if(this.cachedLines&&this.cachedWidth===e)return this.cachedLines;let n=Math.max(1,Math.min(e-2,this.options.maxWidthCells??60)),r=gX(),s=Math.max(1,Math.ceil(n*r.widthPx/r.heightPx)),i=this.options.maxHeightCells??s,o=qc(),a;if(o.images){o.images==="kitty"&&this.imageId===void 0&&(this.imageId=kbe());let c=Bbe(this.base64Data,this.dimensions,{maxWidthCells:n,maxHeightCells:i,imageId:this.imageId,moveCursor:!1});if(c)if(c.imageId&&(this.imageId=c.imageId),o.images==="kitty"){a=[c.sequence];for(let u=0;u0?`\x1B[${u}A`:"";a.push(l+c.sequence)}else{let u=RM(this.mimeType,this.dimensions,this.options.filename);a=[pr(this.theme.fallbackColor(u),e)]}}else{let c=RM(this.mimeType,this.dimensions,this.options.filename);a=[pr(this.theme.fallbackColor(c),e)]}return this.cachedLines=a,this.cachedWidth=e,a}};p();var BM=uH(),jo=class{value="";cursor=0;prompt;placeholder;placeholderStyle;renderedStartColumn=0;onSubmit;onEscape;focused=!1;pasteBuffer="";isInPaste=!1;killRing=new mH;lastAction=null;undoStack=new fH;constructor(e={}){this.prompt=e.prompt??"> ",this.placeholder=e.placeholder??"",this.placeholderStyle=e.placeholderStyle??(n=>n)}getValue(){return this.value}setValue(e){this.value=e,this.cursor=Math.min(this.cursor,e.length)}handleInput(e){if(e.includes("\x1B[200~")&&(this.isInPaste=!0,this.pasteBuffer="",e=e.replace("\x1B[200~","")),this.isInPaste){this.pasteBuffer+=e;let i=this.pasteBuffer.indexOf("\x1B[201~");if(i!==-1){let o=this.pasteBuffer.substring(0,i);this.handlePaste(o),this.isInPaste=!1;let a=this.pasteBuffer.substring(i+6);this.pasteBuffer="",a&&this.handleInput(a)}return}let n=ms();if(n.matches(e,"tui.select.cancel")){this.onEscape&&this.onEscape();return}if(n.matches(e,"tui.editor.undo")){this.undo();return}if(n.matches(e,"tui.input.submit")||e===` -`){this.onSubmit&&this.onSubmit(this.value);return}if(n.matches(e,"tui.editor.deleteCharBackward")){this.handleBackspace();return}if(n.matches(e,"tui.editor.deleteCharForward")){this.handleForwardDelete();return}if(n.matches(e,"tui.editor.deleteWordBackward")){this.deleteWordBackwards();return}if(n.matches(e,"tui.editor.deleteWordForward")){this.deleteWordForward();return}if(n.matches(e,"tui.editor.deleteToLineStart")){this.deleteToLineStart();return}if(n.matches(e,"tui.editor.deleteToLineEnd")){this.deleteToLineEnd();return}if(n.matches(e,"tui.editor.yank")){this.yank();return}if(n.matches(e,"tui.editor.yankPop")){this.yankPop();return}if(n.matches(e,"tui.editor.cursorLeft")){if(this.lastAction=null,this.cursor>0){let i=this.value.slice(0,this.cursor),o=[...BM.segment(i)],a=o[o.length-1];this.cursor-=a?a.segment.length:1}return}if(n.matches(e,"tui.editor.cursorRight")){if(this.lastAction=null,this.cursor{let o=i.charCodeAt(0);return o<32||o===127||o>=128&&o<=159})||this.insertCharacter(e)}handleMouse(e){if(e.type!=="press"||e.button!=="left"||e.y!==0)return;let n=Math.max(0,e.x-2),r=this.renderedStartColumn+n,s=0;this.cursor=this.value.length;for(let i of BM.segment(this.value)){let o=s+nn(i.segment);if(r0){this.pushUndo();let e=this.value.slice(0,this.cursor),n=[...BM.segment(e)],r=n[n.length-1],s=r?r.segment.length:1;this.value=this.value.slice(0,this.cursor-s)+this.value.slice(this.cursor),this.cursor-=s}}handleForwardDelete(){if(this.lastAction=null,this.cursor=this.value.length)return;this.pushUndo();let e=this.value.slice(this.cursor);this.killRing.push(e,{prepend:!1,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.value=this.value.slice(0,this.cursor)}deleteWordBackwards(){if(this.cursor===0)return;let e=this.lastAction==="kill";this.pushUndo();let n=this.cursor;this.moveWordBackwards();let r=this.cursor;this.cursor=n;let s=this.value.slice(r,this.cursor);this.killRing.push(s,{prepend:!0,accumulate:e}),this.lastAction="kill",this.value=this.value.slice(0,r)+this.value.slice(this.cursor),this.cursor=r}deleteWordForward(){if(this.cursor>=this.value.length)return;let e=this.lastAction==="kill";this.pushUndo();let n=this.cursor;this.moveWordForwards();let r=this.cursor;this.cursor=n;let s=this.value.slice(this.cursor,r);this.killRing.push(s,{prepend:!1,accumulate:e}),this.lastAction="kill",this.value=this.value.slice(0,this.cursor)+this.value.slice(r)}yank(){let e=this.killRing.peek();e&&(this.pushUndo(),this.value=this.value.slice(0,this.cursor)+e+this.value.slice(this.cursor),this.cursor+=e.length,this.lastAction="yank")}yankPop(){if(this.lastAction!=="yank"||this.killRing.length<=1)return;this.pushUndo();let e=this.killRing.peek()||"";this.value=this.value.slice(0,this.cursor-e.length)+this.value.slice(this.cursor),this.cursor-=e.length,this.killRing.rotate();let n=this.killRing.peek()||"";this.value=this.value.slice(0,this.cursor)+n+this.value.slice(this.cursor),this.cursor+=n.length,this.lastAction="yank"}pushUndo(){this.undoStack.push({value:this.value,cursor:this.cursor})}undo(){let e=this.undoStack.pop();e&&(this.value=e.value,this.cursor=e.cursor,this.lastAction=null)}moveWordBackwards(){this.cursor!==0&&(this.lastAction=null,this.cursor=Qbe(this.value,this.cursor))}moveWordForwards(){this.cursor>=this.value.length||(this.lastAction=null,this.cursor=Ube(this.value,this.cursor))}handlePaste(e){this.lastAction=null,this.pushUndo();let n=e.replace(/\r\n/g,"").replace(/\r/g,"").replace(/\n/g,"").replace(/\t/g," ");this.value=this.value.slice(0,this.cursor)+n+this.value.slice(this.cursor),this.cursor+=n.length}invalidate(){}render(e){let n=e-nn(this.prompt);if(n<=0)return[pr(this.prompt,e,"")];if(this.value.length===0&&this.placeholder){let y=pr(this.placeholder,n,""),S=[...BM.segment(y)][0]?.segment??" ",C=y.slice(S.length),I=this.focused?KA:"",x=`\x1B[7m${this.placeholderStyle(S)}\x1B[27m`,w=I+x+this.placeholderStyle(C),R=" ".repeat(Math.max(0,n-nn(w)));return[this.prompt+w+R]}let r="",s=this.cursor;this.renderedStartColumn=0;let i=nn(this.value);if(i0){let S=Math.floor(y/2),C=0;bi-S?C=Math.max(0,i-y):C=Math.max(0,b-S),this.renderedStartColumn=C,r=ic(this.value,C,y,!0),s=ic(this.value,C,Math.max(0,b-C),!0).length}else r="",s=0}let a=[...BM.segment(r.slice(s))][0],c=r.slice(0,s),u=a?.segment??" ",l=r.slice(s+u.length),d=this.focused?KA:"",h=`\x1B[7m${u}\x1B[27m`,m=c+d+h+l,f=nn(m),g=" ".repeat(Math.max(0,n-f));return[this.prompt+m+g]}};p();p();var WXr={alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03F5",varepsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",vartheta:"\u03D1",iota:"\u03B9",kappa:"\u03BA",varkappa:"\u03F0",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",pi:"\u03C0",varpi:"\u03D6",rho:"\u03C1",varrho:"\u03F1",sigma:"\u03C3",varsigma:"\u03C2",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03D5",varphi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",Gamma:"\u0393",Delta:"\u0394",Theta:"\u0398",Lambda:"\u039B",Xi:"\u039E",Pi:"\u03A0",Sigma:"\u03A3",Upsilon:"\u03A5",Phi:"\u03A6",Psi:"\u03A8",Omega:"\u03A9",pm:"\xB1",mp:"\u2213",times:"\xD7",div:"\xF7",cdot:"\xB7",ast:"\u2217",star:"\u22C6",circ:"\u2218",bullet:"\u2022",oplus:"\u2295",ominus:"\u2296",otimes:"\u2297",oslash:"\u2298",odot:"\u2299",bigcirc:"\u25CB",dagger:"\u2020",ddagger:"\u2021",amalg:"\u2A3F",uplus:"\u228E",sqcap:"\u2293",sqcup:"\u2294",bowtie:"\u22C8",Join:"\u22C8",ltimes:"\u22C9",rtimes:"\u22CA",leftouterjoin:"\u27D5",rightouterjoin:"\u27D6",fullouterjoin:"\u27D7",triangleleft:"\u25C1",triangleright:"\u25B7",wr:"\u2240",cap:"\u2229",cup:"\u222A",bigcap:"\u22C2",bigcup:"\u22C3",bigwedge:"\u22C0",bigvee:"\u22C1",bigsqcup:"\u2A06",biguplus:"\u2A04",bigoplus:"\u2A01",bigotimes:"\u2A02",bigodot:"\u2A00",setminus:"\u2216",in:"\u2208",notin:"\u2209",ni:"\u220B",subset:"\u2282",supset:"\u2283",subseteq:"\u2286",supseteq:"\u2287",sqsubset:"\u228F",sqsupset:"\u2290",sqsubseteq:"\u2291",sqsupseteq:"\u2292",prec:"\u227A",preceq:"\u227C",succ:"\u227B",succeq:"\u227D",ll:"\u226A",gg:"\u226B",le:"\u2264",leq:"\u2264",leqslant:"\u2264",ge:"\u2265",geq:"\u2265",geqslant:"\u2265",ne:"\u2260",neq:"\u2260",equiv:"\u2261",approx:"\u2248",sim:"\u223C",simeq:"\u2243",cong:"\u2245",asymp:"\u224D",doteq:"\u2250",propto:"\u221D",parallel:"\u2225",perp:"\u22A5",mid:"\u2223",vdash:"\u22A2",dashv:"\u22A3",models:"\u22A8",Vdash:"\u22A9",Vvdash:"\u22AA",nvdash:"\u22AC",nvDash:"\u22AD",forall:"\u2200",exists:"\u2203",nexists:"\u2204",neg:"\xAC",land:"\u2227",wedge:"\u2227",lor:"\u2228",vee:"\u2228",to:"\u2192",rightarrow:"\u2192",longrightarrow:"\u2192",leftarrow:"\u2190",longleftarrow:"\u2190",gets:"\u2190",leftrightarrow:"\u2194",longleftrightarrow:"\u2194",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",leftharpoonup:"\u21BC",leftharpoondown:"\u21BD",rightharpoonup:"\u21C0",rightharpoondown:"\u21C1",rightleftharpoons:"\u21CC",leftrightharpoons:"\u21CB",nearrow:"\u2197",searrow:"\u2198",swarrow:"\u2199",nwarrow:"\u2196",rightsquigarrow:"\u21DD",leadsto:"\u21DD",Rightarrow:"\u21D2",Longrightarrow:"\u21D2",Leftarrow:"\u21D0",Longleftarrow:"\u21D0",Leftrightarrow:"\u21D4",Longleftrightarrow:"\u21D4",implies:"\u21D2",iff:"\u21D4",mapsto:"\u21A6",longmapsto:"\u21A6",uparrow:"\u2191",downarrow:"\u2193",partial:"\u2202",nabla:"\u2207",int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",sum:"\u2211",prod:"\u220F",coprod:"\u2210",infty:"\u221E",emptyset:"\u2205",varnothing:"\u2205",angle:"\u2220",therefore:"\u2234",because:"\u2235",aleph:"\u2135",beth:"\u2136",gimel:"\u2137",daleth:"\u2138",top:"\u22A4",bot:"\u22A5",triangle:"\u25B3",square:"\u25A1",lozenge:"\u25CA",checkmark:"\u2713",complement:"\u2201",wp:"\u2118",prime:"\u2032",ldots:"\u2026",dots:"\u2026",cdots:"\u22EF",vdots:"\u22EE",ddots:"\u22F1",ell:"\u2113",hbar:"\u210F",Im:"\u2111",Re:"\u211C",langle:"\u27E8",rangle:"\u27E9",vert:"|",lvert:"|",rvert:"|",Vert:"\u2016",lVert:"\u2016",rVert:"\u2016",lbrace:"{",rbrace:"}",backslash:"\\",lfloor:"\u230A",rfloor:"\u230B",lceil:"\u2308",rceil:"\u2309",colon:":"},qXr=new Set(["arccos","arcsin","arctan","arg","cos","cosh","cot","coth","csc","deg","det","dim","exp","gcd","hom","inf","ker","lg","lim","liminf","limsup","ln","log","max","min","Pr","sec","sin","sinh","sup","tan","tanh"]),HXr=new Set(["argmax","argmin","inf","injlim","lim","liminf","limsup","max","min","projlim","sup"]),VXr=new Set(["bigcap","bigcup","bigodot","bigoplus","bigotimes","bigsqcup","biguplus","bigvee","bigwedge","coprod","int","iint","iiint","oint","prod","sum"]),jXr=new Set(["Leftarrow","Leftrightarrow","Longleftarrow","Longleftrightarrow","Longrightarrow","Rightarrow","Join","Vdash","Vvdash","approx","asymp","bowtie","cong","dashv","fullouterjoin","doteq","downarrow","equiv","ge","geq","geqslant","gets","gg","hookleftarrow","hookrightarrow","iff","implies","in","leadsto","le","leftarrow","leftharpoondown","leftharpoonup","leftrightarrow","leftrightharpoons","leftouterjoin","leq","leqslant","ll","longleftarrow","longleftrightarrow","longmapsto","longrightarrow","ltimes","mapsto","mid","models","ne","nearrow","neq","ni","notin","nvdash","nvDash","nwarrow","parallel","perp","prec","preceq","propto","rightharpoondown","rightharpoonup","rightleftharpoons","rightouterjoin","rightarrow","rightsquigarrow","rtimes","searrow","sim","simeq","sqsubset","sqsubseteq","sqsupset","sqsupseteq","subset","subseteq","succ","succeq","supset","supseteq","swarrow","to","triangleleft","triangleright","twoheadleftarrow","twoheadrightarrow","uparrow","vdash"]),YXr={"<":"\u226E",">":"\u226F","=":"\u2260","\u2208":"\u2209","\u220B":"\u220C","\u2223":"\u2224","\u2225":"\u2226","\u223C":"\u2241","\u2243":"\u2244","\u2245":"\u2247","\u2248":"\u2249","\u2261":"\u2262","\u2264":"\u2270","\u2265":"\u2271","\u227A":"\u2280","\u227B":"\u2281","\u2282":"\u2284","\u2283":"\u2285","\u2286":"\u2288","\u2287":"\u2289","\u22A2":"\u22AC","\u22A8":"\u22AD","\u2194":"\u21AE","\u2190":"\u219A","\u2192":"\u219B","\u21D2":"\u21CF","\u21D0":"\u21CD","\u21D4":"\u21CE","\u227C":"\u22E0","\u227D":"\u22E1"},KXr={C:"\u2102",H:"\u210D",N:"\u2115",P:"\u2119",Q:"\u211A",R:"\u211D",Z:"\u2124"},zXr={0:"\u2070",1:"\xB9",2:"\xB2",3:"\xB3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079","+":"\u207A","-":"\u207B","=":"\u207C","(":"\u207D",")":"\u207E",a:"\u1D43",b:"\u1D47",c:"\u1D9C",d:"\u1D48",e:"\u1D49",f:"\u1DA0",g:"\u1D4D",h:"\u02B0",i:"\u2071",j:"\u02B2",k:"\u1D4F",l:"\u02E1",m:"\u1D50",n:"\u207F",o:"\u1D52",p:"\u1D56",r:"\u02B3",s:"\u02E2",t:"\u1D57",u:"\u1D58",v:"\u1D5B",w:"\u02B7",x:"\u02E3",y:"\u02B8",z:"\u1DBB"},JXr={0:"\u2080",1:"\u2081",2:"\u2082",3:"\u2083",4:"\u2084",5:"\u2085",6:"\u2086",7:"\u2087",8:"\u2088",9:"\u2089","+":"\u208A","-":"\u208B","=":"\u208C","(":"\u208D",")":"\u208E",a:"\u2090",e:"\u2091",h:"\u2095",i:"\u1D62",j:"\u2C7C",k:"\u2096",l:"\u2097",m:"\u2098",n:"\u2099",o:"\u2092",p:"\u209A",r:"\u1D63",s:"\u209B",t:"\u209C",u:"\u1D64",v:"\u1D65",x:"\u2093"},XXr=new Set([",",":",";"," ",">","enspace","enskip","medspace","quad","qquad","thickspace","thinspace"]),ZXr=new Set(["!","negmedspace","negthickspace","negthinspace"]),jsn="\0",eZr=new Set(["displaystyle","limits","nolimits","scriptstyle","scriptscriptstyle","textstyle"]),tZr=new Set(["big","Big","bigg","Bigg","bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr"]),nZr=new Set(["emph","mathcal","mathbf","mathfrak","mathit","mathrm","mathnormal","mathscr","mathsf","mathtt","mathup","mbox","overbrace","pmb","smash","substack","text","textbf","textit","textmd","textnormal","textrm","textsc","textsf","textsl","texttt","textup","underbrace","bm","boldsymbol"]),rZr={acute:"\u0301",bar:"\u0305",breve:"\u0306",check:"\u030C",ddot:"\u0308",dot:"\u0307",grave:"\u0300",hat:"\u0302",mathring:"\u030A",overleftarrow:"\u20D6",overleftrightarrow:"\u20E1",overline:"\u0305",overrightarrow:"\u20D7",tilde:"\u0303",underline:"\u0332",vec:"\u20D7",widehat:"\u0302",widetilde:"\u0303"};function sZr(t,e){let n="";for(let r of t){let s=e[r];if(s===void 0)return;n+=s}return n}function bH(t,e){t=t.trim();let n=e==="sub"?JXr:zXr,r=sZr(t.replace(/\s*([=+-])\s*/g,"$1"),n);if(r!==void 0)return r;let s=e==="sub"?"_":"^";return Array.from(t).length===1||e==="sub"&&/^[A-Za-z]+$/.test(t)?`${s}${t}`:`${s}(${t})`}function iZr(t,e){t=t.trim(),e=e.trim();let n=/^[\p{L}\p{N}.]+$/u.test(t),r=/^[\p{N}.]+$/u.test(e)||Array.from(e).length===1;return`${n?t:`(${t})`}/${r?e:`(${e})`}`}function Wbe(t,e="\u221A"){return t=t.trim(),/^[\p{L}\p{N}.]+$/u.test(t)?`${e}${t}`:`${e}(${t})`}var Ysn="\u{F0004}",PM="\u{F0005}",oZr=/(?<=[\p{L}\p{N})\]}\u{f0001}])\u{f0004}/gu,aZr=/\u{f0005}(?=[\p{L}\p{N}√\u{f0000}])/gu;function CX(t){return t.replace(oZr," ").replaceAll(Ysn,"").replace(aZr," ").replaceAll(PM,"").split(` -`).map(e=>e.replace(/[ \t]+/g," ").trim()).filter((e,n,r)=>e.length>0||n>0&&ns.baseline)),n=Math.max(...t.map(s=>s.lines.length-s.baseline-1)),r=[];for(let s=0;s<=e+n;s++){let i="";for(let o of t){let a=s-e+o.baseline;i+=a>=0&&as+i.width,0),baseline:e}}function yKe(t,e){let n=[],r=0;for(let s of t.split(` -`)){let i=[],o=0,a;for(let u of s.matchAll(cZr)){let l=u.index,d=e[Number(u[1])];if(d){if(l>o){let h=s.slice(o,l),m=(a?h.trimStart():h).trimEnd(),f=a?.type==="matrix"&&/^\s/.test(h),g=d.type==="matrix"&&/\s$/.test(h),A=m?`${f?" ":""}${m}${g?" ":""}`:f||g?" ":"";i.push({lines:[A],width:nn(A),baseline:0})}if(d.type==="fraction"){let h=yKe(d.numerator,e),m=yKe(d.denominator,e),f=Math.max(h.width,m.width,1),g=f+2;i.push({lines:[...h.lines.map(A=>OM(A,g,!0)),` ${"\u2500".repeat(f)} `,...m.lines.map(A=>OM(A,g,!0))],width:g,baseline:h.lines.length})}else if(d.type==="operator"){let h=Math.max(nn(d.operator),d.lower===void 0?0:nn(d.lower),d.upper===void 0?0:nn(d.upper)),m=[];d.upper!==void 0&&m.push(`${OM(d.upper,h,!0)} `),m.push(`${OM(d.operator,h,!0)} `),d.lower!==void 0&&m.push(`${OM(d.lower,h,!0)} `),i.push({lines:m,width:h+1,baseline:d.upper===void 0?0:1})}else{let h=Math.max(0,...d.lines.map(m=>nn(m)));i.push({lines:d.lines.map(m=>OM(m,h)),width:h,baseline:d.baseline})}o=l+u[0].length,a=d}}if(onn(s))),baseline:r}}var EKe=class t{source;layoutNodes;display;position=0;supported=!0;stackFractions=!0;constructor(e,n,r){this.source=e,this.layoutNodes=n,this.display=r}render(){let e=this.parseSequence();if(!(!this.supported||this.position!==this.source.length))return CX(e)}parseSequence(e){let n="";for(;this.position"){n=`${n.trimEnd()} ${r} `,this.position++;continue}if(r==="&"){this.position++;continue}if(r==="~"){this.position++,n+=" ";continue}if(r==="."){let s=lZr.exec(n),i=s?this.layoutNodes[Number(s[1])]:void 0;if(i?.type==="matrix"){let o=i.lines.length-1;i.lines[o]=`${i.lines[o]??""}${r}`,this.position++;continue}}n+=r,this.position++}return e&&(this.supported=!1),n}parseWhitespace(){for(;this.position=this.source.length)return this.supported=!1,"";let e="",n=this.source[this.position]??"";if(n===` -`||n==="\r")return this.position++,n==="\r"&&this.source[this.position]===` -`&&this.position++," ";if(/[A-Za-z]/.test(n)){let i=this.position;for(;this.positionKXr[o]??o).join("")}if(e==="operatorname"){let i=this.source[this.position]==="*";i&&this.position++;let o=CX(this.parseRequiredArgument()).trim();return this.parseOperator(o,"bracket",i,!0)}if(e==="mod"||e==="bmod")return" mod ";if(e==="pmod"||e==="pod"){let i=this.parseRequiredArgument().trim();return e==="pmod"?` (mod ${i})`:` (${i})`}if(e==="overset"||e==="stackrel"){let i=this.parseRequiredArgument();return`${this.parseRequiredArgument().trim()}${bH(i,"sup")}`}if(e==="underset"){let i=this.parseRequiredArgument();return`${this.parseRequiredArgument().trim()}${bH(i,"sub")}`}if(nZr.has(e)){let i=this.parseRequiredArgument();return e.startsWith("text")||e==="mbox"?i:i.trim()}return e==="begin"?this.parseEnvironment():e==="end"?(this.supported=!1,""):(this.supported=!1,`\\${e}`)}parseOperator(e,n,r,s=!1){let i=r,o=this.position;for(;o=this.source.length)return this.supported=!1,"";if(this.source[this.position]==="{")return this.position++,this.parseSequence("}");if(this.source[this.position]==="\\")return this.parseCommand();let e=this.source[this.position]??"";return this.position++,e}parseOptionalArgument(){for(;this.position{let c=a.split("&"),u=i?Array.from({length:Math.ceil(c.length/2)},(l,d)=>c.slice(d*2,d*2+2).join("")).join(" "):c.join("");return this.renderNested(u).trim()}).filter(Boolean).join(` -`)}if(e==="cases"||e==="cases*"){let i=this.splitEnvironmentRows(s).map(o=>o.split("&").map(a=>this.renderNested(a,!1).trim())).filter(o=>o.some(Boolean));return i.map((o,a)=>{let c=(o[0]??"").replace(/,\s*$/,""),u=o[1]??"",l=a===0?"\u23A7":a===i.length-1?"\u23A9":"\u23A8",d=/^(?:if|when|for|otherwise)\b/i.test(u)?" ":" if ";return`${l} ${c}${u?`${d}${u}`:""}`}).join(` -`)}if(["array","matrix","smallmatrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"].includes(e)){let i=e==="array"?s.replace(/^\s*\{[^}]*\}/,""):s;return this.renderMatrix(e,i)}return this.supported=!1,s}renderMatrix(e,n){let r=this.splitEnvironmentRows(n).map(u=>u.split("&").map(l=>this.renderNested(l,!1).trim())).filter(u=>u.some(Boolean)),s=Math.max(0,...r.map(u=>u.length)),i=Array.from({length:s},(u,l)=>Math.max(0,...r.map(d=>nn(d[l]??"")))),o=r.map(u=>Array.from({length:s},(l,d)=>{let h=u[d]??"";return`${h}${AKe.repeat(Math.max(0,(i[d]??0)-nn(h)))}`}).join(" \u2502 ")),a;if(e==="array"||e==="matrix"||e==="smallmatrix")a=o;else{let l={pmatrix:["\u239B","\u239E","\u239C","\u239F","\u239D","\u23A0"],bmatrix:["\u23A1","\u23A4","\u23A2","\u23A5","\u23A3","\u23A6"],Bmatrix:["\u23A7","\u23AB","\u23A8","\u23AC","\u23A9","\u23AD"],vmatrix:["\u2502","\u2502","\u2502","\u2502","\u2502","\u2502"],Vmatrix:["\u2551","\u2551","\u2551","\u2551","\u2551","\u2551"]}[e];if(!l)return this.supported=!1,o.join(` -`);a=o.map((d,h)=>{let m=h===0?l[0]:h===o.length-1?l[4]:l[2],f=h===0?l[1]:h===o.length-1?l[5]:l[3];return`${m} ${d} ${f}`})}if(a.length<=1)return a[0]??"";let c=this.layoutNodes.push({type:"matrix",lines:a,baseline:0})-1;return`${fKe}${c}${gKe}`}renderNested(e,n=!0){let r=new t(e,this.layoutNodes,this.display&&n).render();return r===void 0?(this.supported=!1,e):r}};function IX(t,e={}){let n=[],r=new EKe(t,n,e.display===!0).render();if(r===void 0)return;if(n.length===0)return r.replaceAll(AKe," ");let s=yKe(r,n).lines,i=Math.min(...s.filter(o=>o.trim()).map(o=>o.length-o.trimStart().length));return s.map(o=>o.slice(i).trimEnd()).join(` -`).trimEnd().replaceAll(AKe," ")}var dZr=/^(~~)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,bKe=class extends K3{del(e){let n=dZr.exec(e);if(!n)return;let r=n[2];return{type:"del",raw:n[0],text:r,tokens:this.lexer.inlineTokens(r)}}};function pZr(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r--)n++;return n%2===1}function hZr(t,e,n){let r=t.indexOf(e,n);for(;r>=0&&pZr(t,r);)r=t.indexOf(e,r+e.length);return r}function Ksn(t){return/\\[A-Za-z]+|[_^=+*/<>()[\]|±≤≥≠≈∈→⇒∞∫∑√-]/.test(t)}function mZr(t){let e="",n="";if(t.startsWith("$$"))e="$$",n="$$";else if(t.startsWith("\\("))e="\\(",n="\\)";else if(t.startsWith("\\["))e="\\[",n="\\]";else if(t.startsWith("$")&&!/^\$\s/.test(t))e="$",n="$";else return;let r=hZr(t,n,e.length);if(r>=0&&e==="$"&&(/\s$/.test(t.slice(e.length,r))||/^\d/.test(t.slice(r+1))||/^[A-Z_][A-Z0-9_]*(?:[^A-Za-z0-9_\s])?$/.test(t.slice(e.length,r))&&/^[A-Za-z_][A-Za-z0-9_]*/.test(t.slice(r+1))||t.slice(e.length,r).includes("`")))return;if(r<0){let o=t.slice(e.length);return e.startsWith("\\")||Ksn(o)?{type:"latex",raw:t,text:o,pending:!0}:void 0}let s=t.slice(e.length,r);return!s||s.includes(` -`)?void 0:{type:"latex",raw:t.slice(0,r+n.length),text:s}}function fZr(t){let e=/^ {0,3}\$\$[ \t]*(?:\n)?([\s\S]*?)\$\$[ \t]*(?:\n|$)/.exec(t);if(e?.[1])return{type:"latexBlock",raw:e[0],text:e[1].trim()};let n=/^ {0,3}\\\[[ \t]*(?:\n)?([\s\S]*?)\\\][ \t]*(?:\n|$)/.exec(t);if(n?.[1])return{type:"latexBlock",raw:n[0],text:n[1].trim()};let r=/^ {0,3}\\\[[ \t]*(?:\n)?([\s\S]*)$/.exec(t);if(r)return{type:"latexBlock",raw:r[0],text:r[1],pending:!0};let s=/^ {0,3}\$\$[ \t]*(?:\n)?([\s\S]*)$/.exec(t);if(s?.[1]&&Ksn(s[1]))return{type:"latexBlock",raw:s[0],text:s[1],pending:!0}}var gZr=[{name:"latexBlock",level:"block",start(t){let e=/(?:^|\n) {0,3}(?:\$\$|\\\[)/.exec(t);return e?e.index+(e[0].startsWith(` -`)?1:0):void 0},tokenizer:fZr},{name:"latex",level:"inline",start(t){let e=[t.indexOf("$"),t.indexOf("\\("),t.indexOf("\\[")].filter(n=>n>=0);return e.length>0?Math.min(...e):void 0},tokenizer:mZr}];function _Ke(t){let e=t[t.length-1];if(e?.type==="list"){_Ke(e.items[e.items.length-1]?.tokens??[]);return}if(e?.type==="blockquote"){_Ke(e.tokens??[]);return}if(e?.type!=="code")return;let n=/^(`{3,}|~{3,})/.exec(e.raw)?.[1],r=e.raw.split(` -`).pop();!n||!r||r.length>=n.length||r!==n[0]?.repeat(r.length)||(e.text=e.text.slice(0,-r.length).replace(/\n$/,""))}var SKe=new vM;SKe.setOptions({tokenizer:new bKe});SKe.use({extensions:[...gZr]});var Hc=class{text;paddingX;paddingY;defaultTextStyle;theme;options;defaultStylePrefix;cachedText;cachedWidth;cachedLines;constructor(e,n,r,s,i,o){this.text=e,this.paddingX=n,this.paddingY=r,this.theme=s,this.defaultTextStyle=i,this.options=o?{...o}:{}}setText(e){this.text=e,this.invalidate()}invalidate(){this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}render(e){if(this.cachedLines&&this.cachedText===this.text&&this.cachedWidth===e)return this.cachedLines;let n=Math.max(1,e-this.paddingX*2),r=this.options.transform?.(this.text,n)??this.text;if(!r||r.trim()===""){let g=[];return this.cachedText=this.text,this.cachedWidth=e,this.cachedLines=g,g}let s=r.replace(/\t/g," "),i=SKe.lexer(s);_Ke(i);let o=[];for(let g=0;g0?f:[""]}applyDefaultStyle(e){if(!this.defaultTextStyle)return e;let n=e;return this.defaultTextStyle.color&&(n=this.defaultTextStyle.color(n)),this.defaultTextStyle.bold&&(n=this.theme.bold(n)),this.defaultTextStyle.italic&&(n=this.theme.italic(n)),this.defaultTextStyle.strikethrough&&(n=this.theme.strikethrough(n)),this.defaultTextStyle.underline&&(n=this.theme.underline(n)),n}getDefaultStylePrefix(){if(!this.defaultTextStyle)return"";if(this.defaultStylePrefix!==void 0)return this.defaultStylePrefix;let e="\0",n=e;this.defaultTextStyle.color&&(n=this.defaultTextStyle.color(n)),this.defaultTextStyle.bold&&(n=this.theme.bold(n)),this.defaultTextStyle.italic&&(n=this.theme.italic(n)),this.defaultTextStyle.strikethrough&&(n=this.theme.strikethrough(n)),this.defaultTextStyle.underline&&(n=this.theme.underline(n));let r=n.indexOf(e);return this.defaultStylePrefix=r>=0?n.slice(0,r):"",this.defaultStylePrefix}getStylePrefix(e){let r=e("\0"),s=r.indexOf("\0");return s>=0?r.slice(0,s):""}getDefaultInlineStyleContext(){return{applyText:e=>this.applyDefaultStyle(e),stylePrefix:this.getDefaultStylePrefix()}}renderToken(e,n,r,s){let i=[];switch(e.type){case"heading":{let o=e.depth,a=`${"#".repeat(o)} `,c;o===1?c=h=>this.theme.heading(this.theme.bold(this.theme.underline(h))):c=h=>this.theme.heading(this.theme.bold(h));let u={applyText:c,stylePrefix:this.getStylePrefix(c)},l=this.renderInlineTokens(e.tokens||[],u),d=o>=3?c(a)+l:l;i.push(d),r&&r!=="space"&&i.push("");break}case"paragraph":{let o=this.renderInlineTokens(e.tokens||[],s);i.push(o),r&&r!=="list"&&r!=="space"&&i.push("");break}case"text":i.push(this.renderInlineTokens([e],s));break;case"latexBlock":{let o=e,a=!o.pending&&this.options.renderLatex!==!1?IX(o.text,{display:!0})??o.raw.trim():o.raw.trim();for(let c of a.split(` -`))i.push(this.applyDefaultStyle(c));r&&r!=="space"&&i.push("");break}case"code":{let o=this.theme.codeBlockIndent??" ";if(i.push(this.theme.codeBlockBorder(`\`\`\`${e.lang||""}`)),this.theme.highlightCode){let a=this.theme.highlightCode(e.text,e.lang);for(let c of a)i.push(`${o}${c}`)}else{let a=e.text.split(` -`);for(let c of a)i.push(`${o}${this.theme.codeBlock(c)}`)}i.push(this.theme.codeBlockBorder("```")),r&&r!=="space"&&i.push("");break}case"list":{let o=this.renderList(e,0,n,s);i.push(...o);break}case"table":{let o=this.renderTable(e,n,r,s);i.push(...o);break}case"blockquote":{let o=m=>this.theme.quote(this.theme.italic(m)),a=this.getStylePrefix(o),c=m=>{if(!a)return o(m);let f=m.replace(/\x1b\[0m/g,`\x1B[0m${a}`);return o(f)},u=Math.max(1,n-2),l={applyText:m=>m,stylePrefix:a},d=e.tokens||[],h=[];for(let m=0;m0&&h[h.length-1]==="";)h.pop();for(let m of h){let f=c(m),g=Xm(f,u);for(let A of g)i.push(this.theme.quoteBorder("\u2502 ")+A)}r&&r!=="space"&&i.push("");break}case"hr":i.push(this.theme.hr("\u2500".repeat(Math.min(n,80)))),r&&r!=="space"&&i.push("");break;case"html":"raw"in e&&typeof e.raw=="string"&&i.push(this.applyDefaultStyle(e.raw.trim()));break;case"space":i.push("");break;default:"text"in e&&typeof e.text=="string"&&i.push(e.text)}return i}renderInlineTokens(e,n){let r="",s=n??this.getDefaultInlineStyleContext(),{applyText:i,stylePrefix:o}=s,a=c=>c.split(` -`).map(l=>i(l)).join(` -`);for(let c of e)switch(c.type){case"latex":{let u=c,l=!u.pending&&this.options.renderLatex!==!1?IX(u.text)??u.raw:u.raw;r+=a(l);break}case"escape":r+=a(this.options.preserveBackslashEscapes?c.raw:c.text);break;case"text":c.tokens&&c.tokens.length>0?r+=this.renderInlineTokens(c.tokens,s):r+=a(c.text);break;case"paragraph":r+=this.renderInlineTokens(c.tokens||[],s);break;case"strong":{let u=this.renderInlineTokens(c.tokens||[],s);r+=this.theme.bold(u)+o;break}case"em":{let u=this.renderInlineTokens(c.tokens||[],s);r+=this.theme.italic(u)+o;break}case"codespan":r+=this.theme.code(c.text)+o;break;case"link":{let u=this.renderInlineTokens(c.tokens||[],s),l=this.theme.link(this.theme.underline(u));if(qc().hyperlinks)r+=jA(l,c.href)+o;else{let d=c.href.startsWith("mailto:")?c.href.slice(7):c.href;c.text===c.href||c.text===d?r+=l+o:r+=l+this.theme.linkUrl(` (${c.href})`)+o}break}case"br":r+=` -`;break;case"del":{let u=this.renderInlineTokens(c.tokens||[],s);r+=this.theme.strikethrough(u)+o;break}case"html":"raw"in c&&typeof c.raw=="string"&&(r+=a(c.raw));break;default:"text"in c&&typeof c.text=="string"&&(r+=a(c.text))}for(;o&&r.endsWith(o);)r=r.slice(0,-o.length);return r}getOrderedListMarker(e){let n=/^(?: {0,3})(\d{1,9}[.)])[ \t]+/.exec(e.raw);return n?`${n[1]} `:void 0}getUnorderedListMarker(e){let n=/^(?: {0,3})([-+*])(?:[ \t]+|(?=\r?\n|$))/.exec(e.raw);return n?`${n[1]} `:void 0}renderList(e,n,r,s){let i=[],o=" ".repeat(n),a=typeof e.start=="number"?e.start:1;for(let c=0;ci.length>0),s=0;for(let i of r)s=Math.max(s,nn(i));return n===void 0?s:Math.min(s,n)}wrapCellText(e,n,r=""){let s=Xm(e,Math.max(1,n));return s.map((i,o)=>{let a=ox+w,0);if(m>c){h=new Array(o).fill(1);let x=c-o;if(x>0){let w=d.reduce((G,$)=>G+Math.max(0,$-1),0),R=d.map(G=>{let $=Math.max(0,G-1);return w>0?Math.floor($/w*x):0});for(let G=0;GG+$,0),P=x-N;for(let G=0;P>0&&Gw+R,0)}let f=l.reduce((x,w)=>x+w,0)+a,g;if(f<=n)g=l.map((x,w)=>Math.max(x,h[w]));else{let x=l.reduce((P,G,$)=>P+Math.max(0,G-h[$]),0),w=Math.max(0,c-m);g=h.map((P,G)=>{let $=l[G],Q=Math.max(0,$-P),H=0;return x>0&&(H=Math.floor(Q/x*w)),P+H});let R=g.reduce((P,G)=>P+G,0),N=c-R;for(;N>0;){let P=!1;for(let G=0;G0;G++)g[G]"\u2500".repeat(x));i.push(`\u250C\u2500${A.join("\u2500\u252C\u2500")}\u2500\u2510`);let y=e.header.map((x,w)=>{let R=this.renderInlineTokens(x.tokens||[],s);return this.wrapCellText(R,g[w],s?.stylePrefix)}),b=Math.max(...y.map(x=>x.length));for(let x=0;x{let P=R[x]||"",G=P+" ".repeat(Math.max(0,g[N]-nn(P)));return this.theme.bold(G)});i.push(`\u2502 ${w.join(" \u2502 ")} \u2502`)}let C=`\u251C\u2500${g.map(x=>"\u2500".repeat(x)).join("\u2500\u253C\u2500")}\u2500\u2524`;i.push(C);for(let x=0;x{let $=this.renderInlineTokens(P.tokens||[],s);return this.wrapCellText($,g[G],s?.stylePrefix)}),N=Math.max(...R.map(P=>P.length));for(let P=0;P{let H=$[P]||"";return H+" ".repeat(Math.max(0,g[Q]-nn(H)))});i.push(`\u2502 ${G.join(" \u2502 ")} \u2502`)}x"\u2500".repeat(x));return i.push(`\u2514\u2500${I.join("\u2500\u2534\u2500")}\u2500\u2518`),r&&r!=="space"&&i.push(""),i}};p();var BN=class{child;onMouse;constructor(e,n){this.child=e,this.onMouse=n}render(e){return this.child.render(e)}handleMouse(e){return Xw(this.child,e)??this.onMouse(e)}invalidate(){this.child.invalidate()}};p();var PN=class extends _n{child;followEnd;primary;overscroll;scrollbarTrackStyle;scrollbarThumbStyle;currentScrollbar;scrollbarHideDelayMs;currentScrollTop=0;contentHeight=0;currentViewportHeight=0;followingEnd;followSuppressedAtEnd=!1;requestRenderCallback;transientScrollbarVisible=!1;scrollbarActive=!1;scrollbarHideTimer;constructor(e,n={}){if(super(),n.axis!==void 0&&n.axis!=="vertical")throw new Error(`Unsupported ScrollView axis: ${n.axis}`);this.child=e,this.children.push(e),this.followEnd=(n.follow??"none")==="end",this.followingEnd=this.followEnd,this.primary=n.primary??!1,this.overscroll=n.overscroll??"chain",this.currentScrollbar=n.scrollbar??"hidden",this.scrollbarTrackStyle=n.scrollbarTrackStyle??(r=>`\x1B[90m${r}\x1B[39m`),this.scrollbarThumbStyle=n.scrollbarThumbStyle??(r=>`\x1B[37m${r}\x1B[39m`),this.scrollbarHideDelayMs=Math.max(0,Math.floor(n.scrollbarHideDelayMs??1e3))}get scrollTop(){return this.currentScrollTop}get isFollowingEnd(){return this.followingEnd}get viewportHeight(){return this.currentViewportHeight}get scrollbar(){return this.currentScrollbar}get isScrollbarVisible(){return this.scrollbar==="always"?this.currentViewportHeight>0:this.scrollbar==="auto"&&this.contentHeight>this.currentViewportHeight&&this.transientScrollbarVisible}get isScrollbarActive(){return this.scrollbarActive}setScrollbar(e){e!==this.currentScrollbar&&(this.currentScrollbar=e,e!=="auto"?this.hideTransientScrollbar():this.scrollbarActive&&this.markScrollbarActivity(),this.requestRenderCallback?.())}getContentWidth(e){return this.scrollbar==="always"&&e>1?e-1:e}markScrollbarActivity(){this.scrollbar!=="auto"||this.contentHeight<=this.currentViewportHeight||(this.transientScrollbarVisible=!0,this.scrollbarHideTimer&&(clearTimeout(this.scrollbarHideTimer),this.scrollbarHideTimer=void 0),!this.scrollbarActive&&(this.scrollbarHideTimer=setTimeout(()=>{this.scrollbarHideTimer=void 0,this.transientScrollbarVisible=!1,this.requestRenderCallback?.()},this.scrollbarHideDelayMs),this.scrollbarHideTimer.unref()))}hideTransientScrollbar(){this.transientScrollbarVisible=!1,this.scrollbarHideTimer&&(clearTimeout(this.scrollbarHideTimer),this.scrollbarHideTimer=void 0)}setScrollbarActive(e){e!==this.scrollbarActive&&(this.scrollbarActive=e,this.markScrollbarActivity(),this.requestRenderCallback?.())}scrollTo(e,n={}){let r=Number.isFinite(e)?Math.trunc(e):this.currentScrollTop,s=Math.max(0,this.contentHeight-this.currentViewportHeight),i=Math.max(0,Math.min(s,r)),o=n.disableFollow===!0&&i===s,a=!o&&this.followEnd&&i===s;if(i===this.currentScrollTop&&a===this.followingEnd&&o===this.followSuppressedAtEnd)return;let c=i!==this.currentScrollTop;this.currentScrollTop=i,this.followingEnd=a,this.followSuppressedAtEnd=o,c&&this.markScrollbarActivity(),this.requestRenderCallback?.()}scrollBy(e){let n=Number.isFinite(e)?Math.trunc(e):0;if(n===0)return 0;let r=Math.max(0,this.contentHeight-this.currentViewportHeight),s=this.followingEnd?r:this.currentScrollTop,i=Math.max(0,Math.min(r,s+n)),o=i-s,a=this.followingEnd;return this.currentScrollTop=i,this.followingEnd=this.followEnd&&i===r,this.followSuppressedAtEnd=!1,o!==0&&this.markScrollbarActivity(),(o!==0||this.followingEnd!==a)&&this.requestRenderCallback?.(),n-o}scrollToStart(){let e=this.currentScrollTop!==0||this.followingEnd!==(this.followEnd&&this.contentHeight<=this.currentViewportHeight);this.currentScrollTop=0,this.followingEnd=this.followEnd&&this.contentHeight<=this.currentViewportHeight,this.followSuppressedAtEnd=!1,e&&(this.markScrollbarActivity(),this.requestRenderCallback?.())}scrollToEnd(){let e=Math.max(0,this.contentHeight-this.currentViewportHeight),n=this.currentScrollTop!==e||this.followingEnd!==this.followEnd;this.currentScrollTop=e,this.followingEnd=this.followEnd,this.followSuppressedAtEnd=!1,n&&(this.markScrollbarActivity(),this.requestRenderCallback?.())}updateLayout(e,n,r){this.contentHeight=Math.max(0,Math.floor(e)),this.currentViewportHeight=Math.max(0,Math.floor(n)),this.requestRenderCallback=r;let s=Math.max(0,this.contentHeight-this.currentViewportHeight);this.followingEnd?this.currentScrollTop=s:this.currentScrollTop=Math.max(0,Math.min(this.currentScrollTop,s)),this.currentScrollTop`${s} `)}[AH](){return{type:"scroll",component:this.child,state:this}}};p();var ON=class{items;filteredItems;theme;selectedIndex=0;mousePressedIndex;maxVisible;onChange;onCancel;searchInput;searchEnabled;submenuComponent=null;submenuItemIndex=null;navigateAfterClose=null;constructor(e,n,r,s,i,o={}){this.items=e,this.filteredItems=e,this.maxVisible=n,this.theme=r,this.onChange=s,this.onCancel=i,this.searchEnabled=o.enableSearch??!1,this.searchEnabled&&(this.searchInput=new jo)}updateValue(e,n){let r=this.items.find(s=>s.id===e);r&&(r.currentValue=n)}selectItem(e){let r=(this.searchEnabled?this.filteredItems:this.items).findIndex(s=>s.id===e);r!==-1&&(this.selectedIndex=r)}invalidate(){this.submenuComponent?.invalidate?.()}render(e){return this.submenuComponent?this.submenuComponent.render(e):this.renderMainList(e)}renderMainList(e){let n=[];if(this.searchEnabled&&this.searchInput&&(n.push(...this.searchInput.render(e)),n.push("")),this.items.length===0)return n.push(this.theme.hint(" No settings available")),this.searchEnabled&&this.addHintLine(n,e),n;let r=this.getDisplayItems();if(r.length===0)return n.push(pr(this.theme.hint(" No matching settings"),e)),this.addHintLine(n,e),n;let{startIndex:s,endIndex:i}=this.getVisibleRange(r),o=Math.min(36,Math.max(...this.items.map(c=>nn(c.label))));for(let c=s;c0||i=i)){if(e.type==="press")return this.mousePressedIndex=o,this.selectedIndex=o,{handled:!0,focus:!0};if(e.type==="click")return this.selectedIndex=this.mousePressedIndex??o,this.mousePressedIndex=void 0,this.activateItem(),{handled:!0}}}handleInput(e){if(this.submenuComponent){this.submenuComponent.handleInput?.(e);return}let n=ms(),r=this.getDisplayItems();if(n.matches(e,"tui.select.up")){if(r.length===0)return;this.selectedIndex=this.selectedIndex===0?r.length-1:this.selectedIndex-1}else if(n.matches(e,"tui.select.down")){if(r.length===0)return;this.selectedIndex=this.selectedIndex===r.length-1?0:this.selectedIndex+1}else n.matches(e,"tui.select.confirm")||e===" "&&(!this.searchEnabled||this.searchInput?.getValue().length===0)?this.activateItem():n.matches(e,"tui.select.cancel")?this.onCancel():this.searchEnabled&&this.searchInput&&(this.searchInput.handleInput(e),this.applyFilter(this.searchInput.getValue()))}getDisplayItems(){return this.searchEnabled?this.filteredItems:this.items}getVisibleRange(e){let n=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),e.length-this.maxVisible));return{startIndex:n,endIndex:Math.min(n+this.maxVisible,e.length)}}activateItem(){let e=this.getDisplayItems()[this.selectedIndex];if(e){if(e.submenu)this.submenuItemIndex=this.selectedIndex,this.submenuComponent=e.submenu(e.currentValue,(n,r)=>{n!==void 0&&(e.currentValue=n,this.onChange(e.id,n)),r?.navigateTo&&(this.navigateAfterClose=r.navigateTo),this.closeSubmenu()});else if(e.values&&e.values.length>0){let r=(e.values.indexOf(e.currentValue)+1)%e.values.length,s=e.values[r];e.currentValue=s,this.onChange(e.id,s)}}}closeSubmenu(){if(this.submenuComponent=null,this.navigateAfterClose!==null){let e=this.navigateAfterClose;this.navigateAfterClose=null,this.submenuItemIndex=null,this.selectItem(e),this.activateItem()}else this.submenuItemIndex!==null&&(this.selectedIndex=this.submenuItemIndex,this.submenuItemIndex=null)}applyFilter(e){this.filteredItems=Wl(this.items,e,n=>n.label),this.selectedIndex=0}addHintLine(e,n){e.push(""),e.push(pr(this.theme.hint(this.searchEnabled?" Type to search \xB7 Enter/Space to change \xB7 Esc to cancel":" Enter/Space to change \xB7 Esc to cancel"),n))}};p();var Nt=class{lines;constructor(e=1){this.lines=e}setLines(e){this.lines=e}invalidate(){}render(e){let n=[];for(let r=0;ra.component.render(n.width)),i=DM(r,s.map(a=>a.length),void 0,this.gap),o=[];for(let a=0;a0)for(let u=0;u=6?"complete":"incomplete":bZr(t):e.startsWith("]")?_Zr(t):e.startsWith("P")?SZr(t):e.startsWith("_")?CZr(t):e.startsWith("O")?e.length>=2?"complete":"incomplete":(e.length===1,"complete")}function bZr(t){if(!t.startsWith(`${l0}[`))return"complete";if(t.length<3)return"incomplete";let e=t.slice(2),n=e[e.length-1],r=n.charCodeAt(0);if(r>=64&&r<=126){if(e.startsWith("<")){if(/^<\d+;\d+;\d+[Mm]$/.test(e))return"complete";if(n==="M"||n==="m"){let i=e.slice(1,-1).split(";");if(i.length===3&&i.every(o=>/^\d+$/.test(o)))return"complete"}return"incomplete"}return"complete"}return"incomplete"}function _Zr(t){return!t.startsWith(`${l0}]`)||t.endsWith(`${l0}\\`)||t.endsWith("\x07")?"complete":"incomplete"}function SZr(t){return!t.startsWith(`${l0}P`)||t.endsWith(`${l0}\\`)?"complete":"incomplete"}function CZr(t){return!t.startsWith(`${l0}_`)||t.endsWith(`${l0}\\`)?"complete":"incomplete"}function IZr(t){let e=t.match(/^\x1b\[(\d+)(?::\d*)?(?::\d+)?u$/);if(!e)return;let n=parseInt(e[1],10);return n>=32?n:void 0}function Jsn(t){let e=[],n=0;for(;nr.length)return{sequences:e,remainder:r}}else e.push(r[0]),n++}return{sequences:e,remainder:""}}var _H=class extends Xsn.EventEmitter{buffer="";timeout=null;timeoutMs;escapeTimeoutMs;pasteMode=!1;pasteBuffer="";pendingKittyPrintableCodepoint;constructor(e={}){super(),this.timeoutMs=e.timeout??AZr,this.escapeTimeoutMs=e.escapeTimeout??yZr}process(e){this.timeout&&(clearTimeout(this.timeout),this.timeout=null);let n;if(Buffer.isBuffer(e))if(e.length===1&&e[0]>127){let i=e[0]-128;n=`\x1B${String.fromCharCode(i)}`}else n=e.toString();else n=e;if(n.length===0&&this.buffer.length===0){this.emitDataSequence("");return}if(this.buffer+=n,this.pasteMode){this.pasteBuffer+=this.buffer,this.buffer="";let i=this.pasteBuffer.indexOf(qbe);if(i!==-1){let o=this.pasteBuffer.slice(0,i),a=this.pasteBuffer.slice(i+qbe.length);this.pasteMode=!1,this.pasteBuffer="",this.pendingKittyPrintableCodepoint=void 0,this.emit("paste",o),a.length>0&&this.process(a)}return}let r=this.buffer.indexOf(zsn);if(r!==-1){if(r>0){let o=this.buffer.slice(0,r),a=Jsn(o);for(let c of a.sequences)this.emitDataSequence(c)}this.pendingKittyPrintableCodepoint=void 0,this.buffer=this.buffer.slice(r+zsn.length),this.pasteMode=!0,this.pasteBuffer=this.buffer,this.buffer="";let i=this.pasteBuffer.indexOf(qbe);if(i!==-1){let o=this.pasteBuffer.slice(0,i),a=this.pasteBuffer.slice(i+qbe.length);this.pasteMode=!1,this.pasteBuffer="",this.pendingKittyPrintableCodepoint=void 0,this.emit("paste",o),a.length>0&&this.process(a)}return}let s=Jsn(this.buffer);this.buffer=s.remainder;for(let i of s.sequences)this.emitDataSequence(i);if(this.buffer.length>0){let i=this.buffer===l0?this.escapeTimeoutMs:this.timeoutMs;this.timeout=setTimeout(()=>{let o=this.flush();for(let a of o)this.emitDataSequence(a)},i)}}emitDataSequence(e){let n=e.length===1?e.codePointAt(0):void 0;if(n!==void 0&&n===this.pendingKittyPrintableCodepoint){this.pendingKittyPrintableCodepoint=void 0;return}this.pendingKittyPrintableCodepoint=IZr(e),this.emit("data",e)}flush(){if(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.buffer.length===0)return[];let e=[this.buffer];return this.buffer="",this.pendingKittyPrintableCodepoint=void 0,e}clear(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.buffer="",this.pasteMode=!1,this.pasteBuffer="",this.pendingKittyPrintableCodepoint=void 0}getBuffer(){return this.buffer}destroy(){this.clear()}};p();var jbe=Gt(require("node:fs"),1),ain=require("node:module"),IKe=Gt(require("node:path"),1);p();var tin=require("node:module"),CKe=Gt(require("node:path"),1);p();var Zsn=require("node:module"),eT=require("node:path"),ein=require("node:url"),xZr=(0,Zsn.createRequire)(_),wZr="@earendil-works/pi-tui";function Hbe(t,e={}){let n=(0,eT.dirname)((0,ein.fileURLToPath)(e.moduleUrl??_)),r=[];try{let s=(e.resolvePackage??xZr.resolve)(wZr);r.push((0,eT.join)((0,eT.dirname)(s),"..",t))}catch{}return r.push((0,eT.join)(n,"..",t),(0,eT.join)(n,t),(0,eT.join)((0,eT.dirname)(e.execPath??process.execPath),t)),Array.from(new Set(r))}var TZr=(0,tin.createRequire)(_),Vbe;function vZr(t){return typeof t!="object"||t===null?!1:typeof t.isModifierPressed=="function"}function RZr(){if(Vbe!==void 0)return Vbe??void 0;Vbe=null;let t=process.arch;if(t!=="x64"&&t!=="arm64")return;let e;if(process.platform==="darwin")e=CKe.join("native","darwin","prebuilds",`darwin-${t}`,"darwin-modifiers.node");else if(process.platform==="win32")e=CKe.join("native","win32","prebuilds",`win32-${t}`,"win32-console-mode.node");else return;for(let n of Hbe(e))try{let r=TZr(n);if(vZr(r))return Vbe=r,r}catch{}}function nin(t){let e=RZr();if(!e)return!1;try{return e.isModifierPressed(t)===!0}catch{return!1}}var kZr=(0,ain.createRequire)(_),NZr=1e3,rin="\x1B]9;4;3\x07",sin="\x1B]9;4;0\x07",DZr="\x1B[13;2u",BZr=7,PZr=150,OZr=`\x1B[>${BZr}u\x1B[?u\x1B[c`;function iin(t){let e=t.match(/^\x1b\[\?(\d+)u$/);if(e)return{type:"kitty-flags",flags:Number.parseInt(e[1],10)};if(/^\x1b\[\?[\d;]*c$/.test(t))return{type:"device-attributes"}}function oin(t){return t==="\x1B["||/^\x1b\[\?[\d;]*$/.test(t)}function MZr(){return process.platform==="darwin"&&process.env.TERM_PROGRAM==="Apple_Terminal"}function LZr(){if(!(process.platform==="win32"||process.pid<=0))try{process.kill(process.pid,"SIGWINCH")}catch{}}function FZr(t,e,n){return e&&t==="\r"&&n?DZr:t}var QZr=10,UZr=100;function $Zr(t=process.env){let e=Number(t.PI_TUI_ESC_TIMEOUT);return Number.isFinite(e)&&e>0?e:t.SSH_CONNECTION||t.SSH_TTY?UZr:QZr}var YC=class{wasRaw=!1;inputHandler;resizeHandler;_kittyProtocolActive=!1;_modifyOtherKeysActive=!1;keyboardProtocolPushed=!1;keyboardProtocolNegotiationBuffer="";keyboardProtocolBufferFlushTimer;stdinBuffer;stdinDataHandler;progressInterval;writeLogPath=(()=>{let e=process.env.PI_TUI_WRITE_LOG||"";if(!e)return"";try{if(jbe.statSync(e).isDirectory()){let n=new Date,r=`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}_${String(n.getHours()).padStart(2,"0")}-${String(n.getMinutes()).padStart(2,"0")}-${String(n.getSeconds()).padStart(2,"0")}`;return IKe.join(e,`tui-${r}-${process.pid}.log`)}}catch{}return e})();get kittyProtocolActive(){return this._kittyProtocolActive}get modifyOtherKeysActive(){return this._modifyOtherKeysActive}start(e,n){this.inputHandler=e,this.resizeHandler=n,this.wasRaw=process.stdin.isRaw||!1,process.stdin.setRawMode&&process.stdin.setRawMode(!0),process.stdin.setEncoding("utf8"),process.stdin.resume(),process.stdout.write("\x1B[?2004h"),process.stdout.on("resize",this.resizeHandler),LZr(),this.enableWindowsVTInput(),this.queryAndEnableKittyProtocol()}setupStdinBuffer(){this.stdinBuffer=new _H({escapeTimeout:$Zr()}),this.stdinBuffer.on("data",e=>{let n=this.readKeyboardProtocolNegotiationSequence(e);if(n==="pending"){this.scheduleKeyboardProtocolNegotiationBufferFlush();return}this.handleKeyboardProtocolNegotiationSequence(n)||this.forwardInputSequence(e)}),this.stdinBuffer.on("paste",e=>{this.inputHandler&&this.inputHandler(`\x1B[200~${e}\x1B[201~`)}),this.stdinDataHandler=e=>{this.stdinBuffer.process(e)}}queryAndEnableKittyProtocol(){this.setupStdinBuffer(),process.stdin.on("data",this.stdinDataHandler),this.keyboardProtocolPushed=!0,this.clearKeyboardProtocolNegotiationBuffer(),process.stdout.write(OZr)}handleKeyboardProtocolNegotiationSequence(e){return e?(this.clearKeyboardProtocolNegotiationBuffer(),e.type==="kitty-flags"?(e.flags!==0?(this.disableModifyOtherKeys(),this._kittyProtocolActive||(this._kittyProtocolActive=!0,eH(!0))):this.enableModifyOtherKeys(),!0):(this._kittyProtocolActive||this.enableModifyOtherKeys(),!0)):!1}readKeyboardProtocolNegotiationSequence(e){if(this.keyboardProtocolNegotiationBuffer){let r=this.keyboardProtocolNegotiationBuffer+e,s=iin(r);if(s)return this.clearKeyboardProtocolNegotiationBuffer(),s;if(oin(r))return this.setKeyboardProtocolNegotiationBuffer(r),"pending";this.flushKeyboardProtocolNegotiationBufferAsInput()}let n=iin(e);if(n)return n;if(oin(e))return this.setKeyboardProtocolNegotiationBuffer(e),"pending"}setKeyboardProtocolNegotiationBuffer(e){this.clearKeyboardProtocolNegotiationBufferFlushTimer(),this.keyboardProtocolNegotiationBuffer=e}clearKeyboardProtocolNegotiationBuffer(){this.clearKeyboardProtocolNegotiationBufferFlushTimer(),this.keyboardProtocolNegotiationBuffer=""}flushKeyboardProtocolNegotiationBufferAsInput(){if(!this.keyboardProtocolNegotiationBuffer)return;let e=this.keyboardProtocolNegotiationBuffer;this.clearKeyboardProtocolNegotiationBuffer(),this.forwardInputSequence(e)}scheduleKeyboardProtocolNegotiationBufferFlush(){!this.keyboardProtocolNegotiationBuffer||this.keyboardProtocolBufferFlushTimer||(this.keyboardProtocolBufferFlushTimer=setTimeout(()=>{this.keyboardProtocolBufferFlushTimer=void 0,this.flushKeyboardProtocolNegotiationBufferAsInput()},PZr))}clearKeyboardProtocolNegotiationBufferFlushTimer(){this.keyboardProtocolBufferFlushTimer&&(clearTimeout(this.keyboardProtocolBufferFlushTimer),this.keyboardProtocolBufferFlushTimer=void 0)}forwardInputSequence(e){if(!this.inputHandler)return;let n=e==="\r"&&(MZr()||process.platform==="win32"),r=FZr(e,n,n&&nin("shift"));this.inputHandler(r)}enableModifyOtherKeys(){this._kittyProtocolActive||this._modifyOtherKeysActive||(process.stdout.write("\x1B[>4;2m"),this._modifyOtherKeysActive=!0)}disableModifyOtherKeys(){this._modifyOtherKeysActive&&(process.stdout.write("\x1B[>4;0m"),this._modifyOtherKeysActive=!1)}enableWindowsVTInput(){if(process.platform==="win32")try{let e=process.arch;if(e!=="x64"&&e!=="arm64")return;let n=IKe.join("native","win32","prebuilds",`win32-${e}`,"win32-console-mode.node");for(let r of Hbe(n))try{kZr(r).enableVirtualTerminalInput?.();return}catch{}}catch{}}async drainInput(e=1e3,n=50){let r=this.keyboardProtocolPushed||this._kittyProtocolActive;this.clearKeyboardProtocolNegotiationBuffer(),r&&(process.stdout.write("\x1B[{i=Date.now()};process.stdin.on("data",o);let a=Date.now()+e;try{for(;;){let c=Date.now(),u=a-c;if(u<=0||c-i>=n)break;await new Promise(l=>setTimeout(l,Math.min(n,u)))}}finally{process.stdin.removeListener("data",o),this.inputHandler=s}}stop(){this.clearProgressInterval()&&process.stdout.write(sin),process.stdout.write("\x1B[?2004l");let e=this.keyboardProtocolPushed||this._kittyProtocolActive;this.clearKeyboardProtocolNegotiationBuffer(),e&&(process.stdout.write("\x1B[0?process.stdout.write(`\x1B[${e}B`):e<0&&process.stdout.write(`\x1B[${-e}A`)}hideCursor(){process.stdout.write("\x1B[?25l")}showCursor(){process.stdout.write("\x1B[?25h")}clearLine(){process.stdout.write("\x1B[K")}clearFromCursor(){process.stdout.write("\x1B[J")}clearScreen(){process.stdout.write("\x1B[2J\x1B[H")}setTitle(e){process.stdout.write(`\x1B]0;${e}\x07`)}setProgress(e){e?(process.stdout.write(rin),this.progressInterval||(this.progressInterval=setInterval(()=>{process.stdout.write(rin)},NZr))):(this.clearProgressInterval(),process.stdout.write(sin))}clearProgressInterval(){return this.progressInterval?(clearInterval(this.progressInterval),this.progressInterval=void 0,!0):!1}};p();p();var GZr=uH(),WZr=/^[\x20-\x7e]*$/;function qZr(t){let e=[],n=[],r=0,s=!1,i=()=>{s&&(e.push(" "),r+=1,s=!1)};for(let o=0;o0&&(s=!0),c+=1,u+=1;continue}let l=u+1;for(;l0&&(s=!0),c+=d;continue}i(),e.push(l),n.push({textStart:r,textEnd:r+l.length,row:o,startCol:c,endCol:c+d,linearColumns:!1}),r+=l.length,c+=d}r>0&&(s=!0)}return{text:e.join(""),spans:n}}function HZr(t){return t.replace(/\s+/gu," ").trim()}function VZr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jZr(t,e){if(!e)return[];let n=new RegExp(VZr(e),"giu"),r=[],s=0;for(let i of t.text.matchAll(n)){let o=i.index,a=o+i[0].length;for(;s=a)break;if(l.textEnd<=o)continue;let d=l.linearColumns?l.startCol+Math.max(o,l.textStart)-l.textStart:l.startCol,h=l.linearColumns?l.startCol+Math.min(a,l.textEnd)-l.textStart:l.endCol,m=c[c.length-1];m&&m.row===l.row&&d<=m.endCol?m.endCol=Math.max(m.endCol,h):c.push({row:l.row,startCol:d,endCol:h})}for(;s0&&r.push({segments:c})}return r}var Ybe=class{sourceLines;corpus;normalizedQuery;matches=[];search(e,n){let r=this.sourceLines?.length!==e.length;if(!r&&this.sourceLines){for(let o=0;o`\x1B[2m${e}\x1B[22m`});onQueryChange;navigationButtonStyle;resultCount=0;resultIndex=-1;previousButtonStart=-1;previousButtonEnd=-1;nextButtonStart=-1;nextButtonEnd=-1;hoveredNavigationDirection;_focused=!1;constructor(e,n=r=>r){this.onQueryChange=e,this.navigationButtonStyle=n}get focused(){return this._focused}set focused(e){this._focused=e,this.input.focused=e}setResult(e,n){this.resultIndex=e,this.resultCount=n}getNavigationDirectionAt(e,n){if(e===2){if(n>=this.previousButtonStart&&n=this.nextButtonStart&&nQ?Q.split("+").map(H=>process.platform==="darwin"&&H.toLowerCase()==="alt"?"Option":H.charAt(0).toUpperCase()+H.slice(1)).join("+"):"Unbound",i=ms(),o=s(i.getKeys("tui.altScreen.searchPrevious")[0]),a=s(i.getKeys("tui.altScreen.searchNext")[0]),u=this.input.getValue()?this.resultCount===0?"No matches":`${this.resultIndex+1}/${this.resultCount}`:"",l=Math.max(0,r-3),d=pr(u,l,""),h=d?`\x1B[2m ${d} \x1B[22m`:"",m=Math.max(0,r-nn(h)),f=pr(this.input.render(Math.max(1,m))[0]??"",m,""),g=" ".repeat(Math.max(0,m-nn(f))),A=`${f}${g}${h}`,y=`\u2191 ${o}`,b=`\u2193 ${a}`,S=" \xB7 ",C=1,I=Math.max(0,r-C*2-1),x=nn(y)+nn(S)+nn(b);x>I&&(y="\u2191",b="\u2193",S=" ",x=nn(y)+nn(S)+nn(b));let w=x<=I,R=w?this.navigationButtonStyle(y,this.hoveredNavigationDirection===-1)+S+this.navigationButtonStyle(b,this.hoveredNavigationDirection===1):"",N=w?C*2:0,P=R&&r>x+N?1:0,G=Math.max(0,r-(w?x:0)-N-P),$=1+G+C;return this.previousButtonStart=w?$:-1,this.previousButtonEnd=w?$+nn(y):-1,this.nextButtonStart=w?this.previousButtonEnd+nn(S):-1,this.nextButtonEnd=w?this.nextButtonStart+nn(b):-1,n===1?["\u250C","\u2502","\u2514"]:[`\u250C${"\u2500".repeat(r)}\u2510`,`\u2502${A}\u2502`,`\u2514${"\u2500".repeat(G)}${R?" ":""}${R}${R?" ":""}${"\u2500".repeat(P)}\u2518`]}};p();var YZr=1e3,zbe=class{entries=[];nextId=0;requestRender;constructor(e){this.requestRender=e}flash(e,n=YZr){let r=this.nextId++,s=setTimeout(()=>{let i=this.entries.findIndex(o=>o.id===r);i!==-1&&(this.entries.splice(i,1),this.requestRender())},Math.max(0,n));s.unref(),this.entries.push({id:r,message:e,timer:s}),this.requestRender()}dispose(){for(let e of this.entries)clearTimeout(e.timer);this.entries.length=0}invalidate(){}render(e){return this.entries.map(n=>`\x1B[7m${pr(` ${n.message} `,e,"")}\x1B[27m`)}};p();var KZr=/^(?:\x1b\]133;[ABC](?:\x07|\x1b\\))+/;function xX(t,e){let n=Math.max(t.x,e.x),r=Math.max(t.y,e.y),s=Math.min(t.x+t.width,e.x+e.width),i=Math.min(t.y+t.height,e.y+e.height);return{x:n,y:r,width:Math.max(0,s-n),height:Math.max(0,i-r)}}function Xbe(t,e,n){let r=Math.max(1,Math.floor(n)),s=t.renderCache.get(e);s||(s=new Map,t.renderCache.set(e,s));let i=s.get(r);return i||(i=e.render(r),s.set(r,i)),i}function cin(t,e,n){return Xbe(t,e,n).length}function zZr(t,e,n){return Xbe(t,e,n).reduce((r,s)=>Math.max(r,nn(s)),0)}function lin(t,e){return t.parent=e,t}function uin(t,e){t.rect.y+=e;for(let n of t.children)uin(n,e)}function din(t,e){t.clip=xX(e,t.rect);for(let n of t.children)din(n,t.clip)}function Jbe(t,e,n,r,s,i,o){let a=Math.max(1,Math.floor(s)),c=$be(e);if(!c){let b=Xbe(t,e,a),S=i===void 0?b.length:Math.max(0,Math.floor(i)),C=0;if(b.length>S&&S>0){let I=b.findIndex(x=>x.includes(KA));I>=S&&(C=I-S+1)}return{component:e,rect:{x:n,y:r,width:a,height:S},clip:xX(o,{x:n,y:r,width:a,height:S}),children:[],lines:b,lineOffset:C,layer:0}}if(c.type==="scroll"){let b=c.state.scrollTop,S=c.state.getContentWidth(a),C=Jbe(t,c.component,n,r-b,S,void 0,o),I=C.rect.height,x=i===void 0?I:Math.max(0,Math.floor(i));c.state.updateLayout(I,x,t.requestRender),uin(C,b-c.state.scrollTop);let w=c.state;(c.state.primary||!t.primaryScrollView)&&(t.primaryScrollView=w);let R={x:n,y:r,width:a,height:x},N=xX(o,R),P={component:e,rect:R,clip:N,children:[C],scrollView:w,scrollContentLines:Xbe(t,c.component,S),layer:0};return C.parent=P,din(C,N),P}let u=EH(c.entries,t.viewport),l=Math.max(0,u.length-1)*c.gap;if(c.type==="vstack"){let b=u.map(N=>typeof N.basis=="number"?N.basis:cin(t,N.component,a)),S=DM(u,b,i,c.gap),C=S.reduce((N,P)=>N+P,0)+l,I=i===void 0?C:Math.max(0,Math.floor(i)),x={x:n,y:r,width:a,height:I},w={component:e,rect:x,clip:xX(o,x),children:[],layer:0},R=r;for(let N=0;Ntypeof b.basis=="number"?b.basis:zZr(t,b.component,a)),h=DM(u,d,a,c.gap),m=u.map((b,S)=>cin(t,b.component,Math.max(1,h[S]))),f=i===void 0?m.reduce((b,S)=>Math.max(b,S),0):Math.max(0,i),g={x:n,y:r,width:a,height:f},A={component:e,rect:g,clip:xX(o,g),children:[],layer:0},y=n;for(let b=0;br;if(!t.scrollView.isScrollbarVisible&&!s)return;let i=Math.min(2,r),o=Math.max(i,Math.min(r,Math.round(r*r/n))),a=Math.max(0,n-r),c=r-o,u=a===0?0:Math.round(t.scrollView.scrollTop/a*c),l=t.rect.x+t.rect.width-1;if(!(l=t.clip.x+t.clip.width))return{column:l,trackTop:t.rect.y,trackHeight:r,thumbTop:t.rect.y+u,thumbHeight:o,maxScrollTop:a}}function XZr(t,e,n){let r=SH(t);if(!(!r||!t.scrollView))for(let s=0;s=t.clip.y+t.clip.height||i<0||i>=e.length)continue;let a=i>=r.thumbTop&&i=n&&(Hl(c)||!e[o])?e[o]=c:e[o]=jC(e[o]??"",c,t.rect.x,t.rect.width,n)}}for(let r of t.children)pin(r,e,n);if(t.scrollView&&t.scrollContentLines&&t.scrollView.scrollTop>0&&t.rect.height>0)for(let r=t.scrollView.scrollTop-1;r>=0;r--){let s=t.scrollContentLines[r]??"",i=Dbe(s);if(i){let o=t.scrollView.scrollTop-r;if(o=n&&(e[t.rect.y]=c)}break}if(s!=="")break}XZr(t,e,n)}function TKe(t,e,n,r){let s=Math.max(1,Math.floor(e)),i=Math.max(1,Math.floor(n)),o={viewport:{width:s,height:i},renderCache:new Map,requestRender:r,primaryScrollView:void 0},a=Jbe(o,t,0,0,s,i,{x:0,y:0,width:s,height:i}),c=Array.from({length:i},()=>"");return pin(a,c,s),{root:a,width:s,height:i,lines:c,...o.primaryScrollView===void 0?{}:{primaryScrollView:o.primaryScrollView}}}function wKe(t,e,n){return e>=t.x&&e=t.y&&n{if(wKe(i.clip,e,n)){r.push({box:i,depth:o});for(let a of i.children)s(a,o+1)}};return s(t.root,0),r.sort((i,o)=>o.box.layer-i.box.layer||o.depth-i.depth),r.map(({box:i})=>i)}function HE(t,e){let n=r=>{if(r.scrollView===e)return r;for(let s of r.children){let i=n(s);if(i)return i}};return n(t.root)}function Zbe(t,e,n){let r=[],s=(i,o)=>{if(wKe(i.clip,e,n)){i.scrollView&&wKe(i.rect,e,n)&&r.push({scrollView:i.scrollView,depth:o});for(let a of i.children)s(a,o+1)}};return s(t.root,0),r.sort((i,o)=>o.depth-i.depth),r.map(i=>i.scrollView)}var ZZr="\x1B[?1049h",min="\x1B[?1049l",fin="\x1B[?7l",gin="\x1B[?7h",ees="\x1B[?1000h\x1B[?1002h\x1B[?1004h\x1B[?1006h",tes="\x1B[?1000h\x1B[?1002h\x1B[?1003h\x1B[?1004h\x1B[?1006h",nes="\x1B[?1006l\x1B[?1004l\x1B[?1003l\x1B[?1002l\x1B[?1000l",res="\x1B[I",ses="\x1B[O",e_e="\x1B[?2026h",t_e="\x1B[?2026l",Ain=/^(?:\x1b\]133;[ABC](?:\x07|\x1b\\))+/,ies=/^\x1b\]133;A(?:\x07|\x1b\\)/,yin=4,oes=5,aes=16,ces=32*1024*1024,les=64*1024*1024,Ein=500,ues=new Set(["/","-"]),des=dH(),u0=class extends pH{mode="fullscreen";[pKe]=!0;previousScreen=[];lastDocument=[];previousScreenWidth=0;previousScreenHeight=0;layoutRoot;currentLayout;implicitDocument;implicitScrollView;flashes;altScreenActive=!1;imageProtocol=null;savedCapabilities;uploadedKittyImages=new Map;selectionAnchor;selectionFocus;selectionGranularity="character";selectionInitialRange;lastClick;selectionDragPointer;selectionAutoScrollDirection=0;selectionAutoScrollTimer;selectionPressActive=!1;scrollbarDrag;scrollbarHover;scrollToEndIndicatorRect;activeSearch;pressedUrl;selectionDragged=!1;mouseCapture;mousePressTarget;mousePressPoint;mousePressMoved=!1;lastComponentClick;wheelScrollLines;mouseEnabled;searchMatchStyle;searchCurrentMatchStyle;searchNavigationButtonStyle;scrollToEndIndicator;openUrl;onRightClickPaste;copyOnSelect;copySelection;constructor(e,n,r,s={}){super(e,n,r),this.implicitDocument={render:i=>super.render(i),handleMouse:i=>super.handleMouse(i),invalidate:()=>{for(let i of this.children)i.invalidate()}},this.implicitScrollView=new PN(this.implicitDocument,{follow:"end",primary:!0}),this.flashes=new zbe(()=>this.requestRender()),this.wheelScrollLines=Math.max(1,Math.floor(s.wheelScrollLines??1)),this.mouseEnabled=s.mouse??!0,this.searchMatchStyle=s.searchMatchStyle??(i=>`\x1B[4m${i}\x1B[24m`),this.searchCurrentMatchStyle=s.searchCurrentMatchStyle??(i=>`\x1B[1;7m${i}\x1B[22;27m`),this.searchNavigationButtonStyle=s.searchNavigationButtonStyle??(i=>i),this.scrollToEndIndicator=s.scrollToEndIndicator,this.openUrl=s.openUrl,this.onRightClickPaste=s.onRightClickPaste,this.copyOnSelect=s.copyOnSelect??!0,this.copySelection=s.copySelection,this.addInputListener(i=>this.handleViewportInput(i))}get viewportTop(){return this.getPrimaryScrollView().scrollTop}get isFollowingOutput(){return this.getPrimaryScrollView().isFollowingEnd}getCopyOnSelect(){return this.copyOnSelect}setCopyOnSelect(e){this.copyOnSelect=e}hasActiveSelection(){return this.getActiveSelectionText()!==void 0}async copyActiveSelectionToClipboard(){let e=this.getActiveSelectionText();return e?this.copyTextToClipboard(e):!1}setLayoutRoot(e){this.layoutRoot!==e&&(this.layoutRoot=e,this.currentLayout=void 0,this.requestRender())}render(e){return this.layoutRoot?.render(e)??super.render(e)}getMountedRoots(){return this.layoutRoot?[this.layoutRoot]:this.children}getPrimaryScrollView(){return this.currentLayout?.primaryScrollView??this.implicitScrollView}beforeTerminalStart(){this.stopSelectionAutoScroll(),this.selectionPressActive=!1,this.stopScrollbarHover(),this.stopScrollbarDrag(),this.flashes.dispose(),this.altScreenActive=!0;let e=qc();this.imageProtocol=e.images,this.uploadedKittyImages.clear(),e.images==="iterm2"&&(this.savedCapabilities=e,AX({...e,images:null}),this.invalidate()),this.lastDocument=[],this.selectionAnchor=void 0,this.selectionFocus=void 0,this.selectionGranularity="character",this.selectionInitialRange=void 0,this.lastClick=void 0,this.pressedUrl=void 0,this.selectionDragged=!1,this.clearComponentMouseGesture(),this.lastComponentClick=void 0,this.resetRenderState();let n=process.env.TERM?.toLowerCase()??"",r=process.env.TMUX!==void 0||process.env.ZELLIJ!==void 0||process.env.STY!==void 0||n.startsWith("tmux")||n.startsWith("screen")?ees:tes;this.terminal.write(`${ZZr}${fin}${this.mouseEnabled?r:""}\x1B[2J\x1B[H\x1B[?25l`)}beforeTerminalStop(e){this.closeSearch(),this.stopSelectionAutoScroll(),this.selectionPressActive=!1,this.stopScrollbarHover(),this.stopScrollbarDrag(),this.clearComponentMouseGesture(),this.flashes.dispose(),this.altScreenActive&&(this.terminal.write(`${e_e}${this.deleteKittyImages()}${this.mouseEnabled?nes:""}${gin}${t_e}`),this.uploadedKittyImages.clear())}afterTerminalStop(e){if(this.altScreenActive){if(this.altScreenActive=!1,e.preserveScreen)this.terminal.write(`${e_e}${min}\x1B[?25h${t_e}`);else{let n=Math.max(1,this.terminal.columns),r=this.render(n).map(i=>i.replace(Ain,""));this.lastDocument=this.applyLineResets(r.map(i=>i.replaceAll(KA,""))).map(i=>Hl(i)||nn(i)<=n?i:ic(i,0,n,!0));let s=`${e_e}${min}${fin}`;for(let i=0;i0&&(s+=`\r -`),s+=`\r\x1B[2K${this.lastDocument[i]??""}`;s+=`\x1B[0m${gin}\r -\x1B[?25h${t_e}`,this.terminal.write(s)}this.savedCapabilities&&(AX(this.savedCapabilities),this.savedCapabilities=void 0)}}deleteKittyImages(){return this.imageProtocol==="kitty"?Nbe():""}prepareKittyScreen(e){let n=new Set,r=e.map(c=>{let u=psn(c);if(!u)return c;n.add(u.imageId);let l=this.uploadedKittyImages.get(u.imageId),d={transmissionGeneration:u.transmissionGeneration,transmissionBytes:u.transmissionBytes,estimatedDecodedBytes:u.estimatedDecodedBytes};return l&&this.uploadedKittyImages.delete(u.imageId),this.uploadedKittyImages.set(u.imageId,d),l?.transmissionGeneration===u.transmissionGeneration?u.replacementLine:c}),s=0,i=0,o=0;for(let[c,u]of this.uploadedKittyImages)n.has(c)||(s+=1,i+=u.transmissionBytes,o+=u.estimatedDecodedBytes);let a="";for(let[c,u]of this.uploadedKittyImages){if(s<=aes&&i<=ces&&o<=les)break;n.has(c)||(a+=aH(c),this.uploadedKittyImages.delete(c),s-=1,i-=u.transmissionBytes,o-=u.estimatedDecodedBytes)}return{lines:r,evictedImageDeletion:a}}resetRenderState(){this.previousScreen=[],this.previousScreenWidth=0,this.previousScreenHeight=0,this.currentLayout=void 0}scrollBy(e){this.getPrimaryScrollView().scrollBy(e),this.requestRender()}scrollToTop(){this.getPrimaryScrollView().scrollToStart(),this.requestRender()}scrollToBottom(){this.getPrimaryScrollView().scrollToEnd(),this.requestRender()}scrollToPrompt(e){if(!this.currentLayout)return;let n=this.getPrimaryScrollView(),r=HE(this.currentLayout,n)?.scrollContentLines;if(r){for(let s=n.scrollTop+e;s>=0&&sthis.updateSearchQuery(r),this.searchNavigationButtonStyle),n={component:e,index:new Ybe,query:"",matches:[],selectedIndex:-1,anchorRow:this.getPrimaryScrollView().scrollTop,selectionMode:"query"};this.activeSearch=n,n.overlay=this.showOverlay(e,{anchor:"top-right",width:"40%",minWidth:32,margin:1})}closeSearch(){let e=this.activeSearch;e&&(this.activeSearch=void 0,e.overlay?.hide(),this.requestRender())}updateSearchQuery(e){let n=this.activeSearch;if(!n||e===n.query)return;let r=n.matches[n.selectedIndex];n.anchorRow=r?.segments[0]?.row??this.getPrimaryScrollView().scrollTop,n.query=e,n.selectionMode="query",n.component.setResult(-1,0),this.requestRender()}navigateSearch(e){let n=this.activeSearch;n?.query&&(n.selectionMode=e<0?"previous":"next",this.requestRender())}getSearchNavigationDirectionAt(e,n){let r=this.activeSearch,s=r?.overlay?.getBounds();if(!(!r||!s)&&!(e=s.col+s.width||n=s.row+s.height))return r.component.getNavigationDirectionAt(n-s.row,e-s.col)}handleSearchMouseEvent(e){let n=this.activeSearch;if(!n)return!1;let r=this.getSearchNavigationDirectionAt(e.x,e.y);return n.component.setHoveredNavigationDirection(r)&&this.requestRender(),r===void 0||e.release||(e.button&32)!==0||(e.button&3)!==0?!1:(this.navigateSearch(r),!0)}refreshSearch(e){let n=this.activeSearch;if(!n)return!1;let r=e.primaryScrollView??this.implicitScrollView,s=HE(e,r),i=s?.scrollContentLines;if(!i||!n.query.trim())return n.matches=[],n.selectedIndex=-1,n.selectedKey=void 0,n.selectionMode="retain",n.component.setResult(-1,0),!1;let o=n.selectionMode!=="retain",a=n.index.search(i,n.query),c=a.matches;if(n.matches=c,!a.changed&&n.selectionMode==="retain")return!1;let u=a.changed?n.selectedKey?c.findIndex(y=>xKe(y)===n.selectedKey):-1:n.selectedIndex,l=-1;if(c.length>0)if(n.selectionMode==="query"){let y=0,b=c.length;for(;y=0?u:Math.min(n.selectedIndex,c.length-1);l=y<0?0:(y+1)%c.length}else if(n.selectionMode==="previous"){let y=u>=0?u:Math.min(n.selectedIndex,c.length-1);l=y<0?c.length-1:(y-1+c.length)%c.length}else l=u>=0?u:Math.min(Math.max(0,n.selectedIndex),c.length-1);if(n.selectedIndex=l,n.selectedKey=l>=0?xKe(c[l]):void 0,n.selectionMode="retain",n.component.setResult(l,c.length),!o)return!1;let d=c[l],h=d?.segments[0],m=d?.segments[d.segments.length-1];if(!s||!h||!m||r.viewportHeight<=0)return!1;let f=r.scrollTop,g=f+r.viewportHeight-1,A=f;return(h.rowg)&&(A=h.row-Math.floor(r.viewportHeight/3)),r.scrollTo(A,{disableFollow:!0}),r.scrollTop!==f}flash(e,n){this.flashes.flash(e,n)}shouldDeferViewportInputToOverlay(){return this.isOverlayFocused()&&this.activeSearch?.overlay?.isFocused()!==!0}clearComponentMouseGesture(){this.mouseCapture=void 0,this.mousePressTarget=void 0,this.mousePressPoint=void 0,this.mousePressMoved=!1}handleViewportInput(e){if(e===ses){let o=this.selectionPressActive,a=o&&this.getSelectionBounds()!==void 0;return this.selectionPressActive=!1,this.stopSelectionAutoScroll(),this.stopScrollbarHover(),this.activeSearch?.component.setHoveredNavigationDirection(void 0)&&this.requestRender(),this.stopScrollbarDrag(),this.pressedUrl=void 0,this.selectionDragged=!1,this.clearComponentMouseGesture(),this.lastComponentClick=void 0,o&&(this.selectionAnchor=void 0,this.selectionFocus=void 0,this.selectionGranularity="character",this.selectionInitialRange=void 0,a&&this.requestRender()),this.lastClick=void 0,{consume:!0}}if(e===res)return{consume:!0};let n=this.parseWheelEvent(e);if(n){let o=this.createMouseEvent("wheel",n.button,n.x,n.y,{wheelDelta:n.direction*this.getWheelScrollLines(n.button)}),a=this.dispatchMouseToOverlay(o),c=a.result??(a.hit?void 0:this.dispatchMouseToLayout(o));return c?(this.applyMouseDispatchResult(o,c)&&this.requestRender(),{consume:!0}):this.shouldDeferViewportInputToOverlay()?void 0:(this.routeWheel(n),{consume:!0})}let r=this.parseSgrMouseEvent(e);if(r)return this.handleMouseEvent(r),{consume:!0};if(this.isMouseSequence(e))return{consume:!0};let s=ms(),i=tH(e);if(s.matches(e,"tui.altScreen.search"))return i||this.toggleSearch(),{consume:!0};if(this.activeSearch?.overlay?.isFocused()){if(s.matches(e,"tui.altScreen.searchNext"))return i||this.navigateSearch(1),{consume:!0};if(s.matches(e,"tui.altScreen.searchPrevious"))return i||this.navigateSearch(-1),{consume:!0};if(s.matches(e,"tui.altScreen.searchClose"))return i||this.closeSearch(),{consume:!0}}if(!this.shouldDeferViewportInputToOverlay()){if(s.matches(e,"tui.altScreen.pageUp"))return i||this.scrollBy(-Math.max(1,this.getPrimaryScrollView().viewportHeight-yin)),{consume:!0};if(s.matches(e,"tui.altScreen.pageDown"))return i||this.scrollBy(Math.max(1,this.getPrimaryScrollView().viewportHeight-yin)),{consume:!0};if(s.matches(e,"tui.altScreen.halfPageUp"))return i||this.scrollBy(-Math.max(1,Math.floor(this.getPrimaryScrollView().viewportHeight/2))),{consume:!0};if(s.matches(e,"tui.altScreen.halfPageDown"))return i||this.scrollBy(Math.max(1,Math.floor(this.getPrimaryScrollView().viewportHeight/2))),{consume:!0};if(s.matches(e,"tui.altScreen.lineUp"))return i||this.scrollBy(-1),{consume:!0};if(s.matches(e,"tui.altScreen.lineDown"))return i||this.scrollBy(1),{consume:!0};if(s.matches(e,"tui.altScreen.previousPrompt"))return i||this.scrollToPrompt(-1),{consume:!0};if(s.matches(e,"tui.altScreen.nextPrompt"))return i||this.scrollToPrompt(1),{consume:!0};if(s.matches(e,"tui.altScreen.top"))return i||this.scrollToTop(),{consume:!0};if(s.matches(e,"tui.altScreen.bottom"))return i||this.scrollToBottom(),{consume:!0}}}decodeMouseButton(e){switch(e&3){case 0:return"left";case 1:return"middle";case 2:return"right";default:return"none"}}createMouseEvent(e,n,r,s,i={}){return{type:e,button:e==="wheel"?"none":this.decodeMouseButton(n),x:r,y:s,screenX:r,screenY:s,width:Math.max(1,this.terminal.columns),height:Math.max(1,this.terminal.rows),shift:(n&4)!==0,alt:(n&8)!==0,ctrl:(n&16)!==0,...i.wheelDelta===void 0?{}:{wheelDelta:i.wheelDelta},...i.clickCount===void 0?{}:{clickCount:i.clickCount}}}dispatchMouseToLayout(e){if(!this.currentLayout)return;let n=new Set,r=hin(this.currentLayout,e.screenX,e.screenY);for(let s of r){if(n.has(s.component)||$be(s.component)&&s.component.handleMouse===_n.prototype.handleMouse)continue;n.add(s.component);let i=Xw(s.component,{...e,x:e.screenX-s.rect.x,y:e.screenY-s.rect.y,width:s.rect.width,height:s.rect.height});if(i)return i}}applyMouseDispatchResult(e,n){let r=this.resolveMouseFocusTarget(n.focusTarget??n.target.component),s=n.focus===!0&&this.getFocusedComponent()!==r;return n.focus&&this.setFocus(r),n.capture&&(this.mouseCapture=n.target),n.render??(s||e.type==="press"||e.type==="click"||e.type==="drag"||e.type==="wheel")}dispatchMouseToTarget(e,n){return Xw(n.component,Dsn(e,n))}getComponentClickCount(e,n,r){let s=Date.now(),i=this.lastComponentClick,o=i&&s-i.timestamp<=Ein&&i.component===e.component&&i.x===n&&i.y===r?i.count%3+1:1;return this.lastComponentClick={timestamp:s,count:o,component:e.component,x:n,y:r},o}clearTextSelection(){this.stopSelectionAutoScroll(),this.selectionPressActive=!1,this.selectionAnchor=void 0,this.selectionFocus=void 0,this.selectionGranularity="character",this.selectionInitialRange=void 0,this.pressedUrl=void 0,this.selectionDragged=!1}handleMouseEvent(e){let n=(e.button&32)!==0,r=e.release?"release":n?this.decodeMouseButton(e.button)==="none"?"move":"drag":"press",s=this.createMouseEvent(r,e.button,e.x,e.y);if(this.mouseCapture||this.mousePressTarget){let a=this.mouseCapture??this.mousePressTarget;this.mousePressPoint&&(e.x!==this.mousePressPoint.x||e.y!==this.mousePressPoint.y)&&(this.mousePressMoved=!0,this.lastComponentClick=void 0);let c=!1,u=this.dispatchMouseToTarget(s,a);if(u&&(c=this.applyMouseDispatchResult(s,u)),e.release){if(!this.mousePressMoved&&this.mousePressPoint?.x===e.x&&this.mousePressPoint.y===e.y){let l=this.createMouseEvent("click",e.button,e.x,e.y,{clickCount:this.getComponentClickCount(a,e.x,e.y)}),d=this.dispatchMouseToTarget(l,a);d&&(c=this.applyMouseDispatchResult(l,d)||c)}this.clearComponentMouseGesture()}c&&this.requestRender();return}if(this.handleSearchMouseEvent(e))return;let i=this.dispatchMouseToOverlay(s);if(i.hit)this.stopScrollbarHover();else{if(this.handleScrollToEndIndicatorMouseEvent(e))return;let a=this.handleScrollbarMouseEvent(e);if(this.scrollbarDrag||this.updateScrollbarHover(e.x,e.y),a)return}let o=i.result??(i.hit?void 0:this.dispatchMouseToLayout(s));if(o){let a=this.applyMouseDispatchResult(s,o);r==="press"&&(this.clearTextSelection(),this.mousePressTarget=o.target,this.mousePressPoint={x:e.x,y:e.y},this.mousePressMoved=!1),a&&this.requestRender();return}this.handleRightClickPaste(e)||this.handleSelectionMouseEvent(e)}parseWheelEvent(e){let n=/^\x1b\[<(\d+);(\d+);(\d+)[Mm]$/.exec(e);if(n){let r=Number.parseInt(n[1],10);if((r&64)===0)return;let s=r&3;return s!==0&&s!==1?void 0:{direction:s===0?-1:1,x:Number.parseInt(n[2],10)-1,y:Number.parseInt(n[3],10)-1,button:r}}if(e.length===6&&e.startsWith("\x1B[M")){let r=e.charCodeAt(3)-32;if((r&64)===0)return;let s=r&3;return s!==0&&s!==1?void 0:{direction:s===0?-1:1,x:e.charCodeAt(4)-33,y:e.charCodeAt(5)-33,button:r}}}getWheelScrollLines(e){return(e&8)!==0?this.wheelScrollLines*oes:this.wheelScrollLines}routeWheel(e){let n=e.direction*this.getWheelScrollLines(e.button),r=new Set;for(let i of this.currentLayout?Zbe(this.currentLayout,e.x,e.y):[])if(r.add(i),n=i.scrollBy(n),n===0||i.overscroll==="contain")break;let s=this.getPrimaryScrollView();n!==0&&!r.has(s)&&s.scrollBy(n),this.updateScrollbarHover(e.x,e.y),this.requestRender()}parseSgrMouseEvent(e){let n=/^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/.exec(e);if(n)return{button:Number.parseInt(n[1],10),x:Number.parseInt(n[2],10)-1,y:Number.parseInt(n[3],10)-1,release:n[4]==="m"}}handleRightClickPaste(e){if(!this.onRightClickPaste||process.platform!=="win32"||process.env.TERM_PROGRAM?.toLowerCase()==="vscode"||e.release||e.button!==2)return!1;try{this.onRightClickPaste()}catch{}return!0}handleScrollToEndIndicatorMouseEvent(e){let n=this.scrollToEndIndicatorRect;return!n||e.release||(e.button&32)!==0||(e.button&3)!==0||e.y!==n.row||e.x=n.column+n.width?!1:(this.scrollToBottom(),!0)}getScrollbarTargetAt(e,n,r=!1){if(!(this.hasOverlay()||!this.currentLayout))for(let s of Zbe(this.currentLayout,e,n)){let i=HE(this.currentLayout,s),o=i?SH(i,r):void 0;if(o&&e===o.column&&n>=o.trackTop&&n=n.geometry.thumbTop&&e.ye.col>=u.start&&e.colu.selectable&&l.selectable&&(u.joiner||l.joiner),a=r[i].start,c=r[i].end;for(let u=i;u>0&&o(r[u-1],r[u]);u--)a=r[u-1].start;for(let u=i;u=i?1:0,this.selectionAutoScrollDirection===0){this.stopSelectionAutoScroll();return}this.selectionAutoScrollTimer||(this.selectionAutoScrollTimer=setInterval(()=>this.autoScrollSelection(),50),this.selectionAutoScrollTimer.unref())}autoScrollSelection(){let e=this.selectionAnchor?.scrollView,n=this.selectionDragPointer,r=this.selectionAutoScrollDirection;if(!e||!n||r===0){this.stopSelectionAutoScroll();return}if(e.scrollBy(r)===r){this.stopSelectionAutoScroll();return}let i=this.getScrollSelectionPoint(e,n.x,n.y);i&&this.updateSelectionFocus(i),this.requestRender()}stopSelectionAutoScroll(){this.selectionAutoScrollTimer&&(clearInterval(this.selectionAutoScrollTimer),this.selectionAutoScrollTimer=void 0),this.selectionAutoScrollDirection=0,this.selectionDragPointer=void 0}handleSelectionMouseEvent(e){let n=e.button&3;if(n!==0&&!(e.release&&n===3))return;let r=this.selectionAnchor?.scrollView,s=this.getSelectionPoint(e,r);if(e.release){if(!this.selectionPressActive||(this.selectionPressActive=!1,this.stopSelectionAutoScroll(),!this.selectionAnchor))return;this.updateSelectionFocus(s);let l=!this.selectionDragged&&this.selectionAnchor.scrollView===s.scrollView&&this.selectionAnchor.row===s.row&&this.selectionAnchor.col===s.col,d=l?this.pressedUrl:void 0;if(this.pressedUrl=void 0,d&&this.openUrl){this.selectionAnchor=void 0,this.selectionFocus=void 0;try{this.openUrl(d)}catch{}this.requestRender();return}if(l){let h=this.createMouseEvent("click",e.button,e.x,e.y,{clickCount:this.lastClick?.count??1}),m=this.dispatchMouseToOverlay(h),f=m.result??(m.hit?void 0:this.dispatchMouseToLayout(h));if(f){let g=this.applyMouseDispatchResult(h,f);this.clearTextSelection(),g&&this.requestRender();return}}this.copyOnSelect&&this.copySelectionToClipboard(),this.requestRender();return}if((e.button&32)!==0){if(!this.selectionPressActive||!this.selectionAnchor)return;this.selectionDragged=!0,this.lastClick=void 0,this.pressedUrl=void 0,this.updateSelectionFocus(s),this.updateSelectionAutoScroll(e),this.requestRender();return}this.stopSelectionAutoScroll(),this.selectionPressActive=!0;let i=!this.hasOverlay()&&this.currentLayout?Zbe(this.currentLayout,e.x,e.y)[0]:void 0,o=this.getSelectionPoint(e,i),a=this.getWordSelection(o),c=this.getClickCount(o,a),u=c===2?a:c===3?this.getLineSelection(o):void 0;this.selectionGranularity=u?c===2?"word":"line":"character",this.selectionInitialRange=u,this.selectionAnchor=u?.start??o,this.selectionFocus=u?.end??o,this.selectionDragged=!1,this.pressedUrl=u?void 0:Mbe(this.previousScreen[Math.max(0,Math.min(this.terminal.rows-1,e.y))]??"",Math.max(0,Math.min(this.terminal.columns-1,e.x))),this.requestRender()}getSelectionBounds(){if(!this.selectionAnchor||!this.selectionFocus||this.selectionAnchor.scrollView!==this.selectionFocus.scrollView)return;let e=this.selectionAnchor.rowi&&(s+=r(e.slice(i,o))),s+=a.code,o+=a.length,i=o}return im)break;for(let S of b.segments){let C=i.rect.y+S.row-s.scrollTop;if(C=u)continue;let I=Math.max(l,i.rect.x+S.startCol),x=Math.min(d,i.rect.x+S.endCol);if(x<=I)continue;let w=o.get(C)??[];w.push({startCol:I,endCol:x,current:y===r.selectedIndex}),o.set(C,w)}}let A=[...e];for(let[y,b]of o){let S=A[y]??"";if(Hl(S))continue;let C=nn(S);for(let I of b.sort((x,w)=>w.startCol-x.startCol)){let x=Math.min(I.startCol,C),w=Math.min(I.endCol,C);if(w<=x)continue;let R=ic(S,0,x,!0),N=ic(S,x,w-x,!0),P=ic(S,w,Math.max(0,C-w),!0);S=`${R}${this.applySearchTextHighlight(N,I.current)}${P}`}A[y]=S}return A}applySelectionHighlight(e){let n="\x1B[7m",r=0;for(;r{if(lo||ls.end.row||Hl(u))return u;let d=nn(u),h=this.getSelectionColumns(u,l,s,a,c);if(h.end<=h.start)return u;let m=ic(u,0,h.start,!0),f=ic(u,h.start,h.end-h.start,!0),g=ic(u,h.end,Math.max(0,d-h.end),!0);return`${m}${this.applySelectionHighlight(f)}${g}`})}isMouseSequence(e){return/^\x1b\[<\d+;\d+;\d+[Mm]$/.test(e)||e.length===6&&e.startsWith("\x1B[M")}compositeScrollToEndIndicator(e,n,r){this.scrollToEndIndicatorRect=void 0;let s=n.primaryScrollView??this.implicitScrollView;if(!this.scrollToEndIndicator||!s.followEnd||s.isFollowingEnd)return e;let i=HE(n,s),o=i?.clip;if(!o||o.width<=0||o.height<=0)return e;let a=o.y+o.height-1;if(a>=e.length||Hl(e[a]??""))return e;let c=i?SH(i)?.column:void 0,u=Math.max(0,(c??o.x+o.width)-o.x),l=pr(this.scrollToEndIndicator(),u,""),d=nn(l);if(d===0)return e;let h=o.x+Math.floor((u-d)/2),m=[...e];return m[a]=jC(m[a]??"",l,h,d,r),this.scrollToEndIndicatorRect={row:a,column:h,width:d},m}compositeFlashes(e,n,r){let s=this.flashes.render(n).slice(-r);if(s.length===0)return e;let i=[...e];for(;i.lengththis.requestRender());this.refreshSearch(s)&&(s=TKe(r,e,n,()=>this.requestRender()));let i=s.lines.map(m=>m.replace(Ain,""));i=this.applySearchHighlights(i,s),i=this.compositeScrollToEndIndicator(i,s,e),i=this.compositeOverlays(i,e,n),i.length>n&&(i=i.slice(i.length-n)),i=this.applySelection(i,s),i=this.compositeFlashes(i,e,n);let o=this.extractCursorPosition(i,n);i=this.applyLineResets(i).map(m=>Hl(m)||nn(m)<=e?m:ic(m,0,e,!0));let a=this.previousScreen.length===0||this.previousScreenWidth!==e||this.previousScreenHeight!==n,c=i.some((m,f)=>m!==this.previousScreen[f]&&(Hl(m)||Hl(this.previousScreen[f]??""))),u=a||c,l=this.uploadedKittyImages.size>0,d=u&&this.imageProtocol==="kitty"?this.prepareKittyScreen(i):{lines:i,evictedImageDeletion:""},h=e_e;if(a){this.fullRedrawCount+=1;let m=this.imageProtocol==="kitty"&&l?z9e():this.deleteKittyImages();h+=`${m}\x1B[2J`}else c&&(this.imageProtocol==="iterm2"?h+="\x1B[2J":this.imageProtocol==="kitty"&&(h+=z9e()));h+=d.evictedImageDeletion;for(let m=0;m=55296&&e.charCodeAt(s-1)<=56319&&e.charCodeAt(s)>=56320&&e.charCodeAt(s)<=57343&&s--,s===n){this.flush();continue}this.buffer+=e.slice(n,s),n=s,this.buffer.length===_in&&this.flush()}}flush(){this.buffer&&(this.write(this.buffer),this.writtenChars+=this.buffer.length,this.buffer="")}get length(){return this.writtenChars+this.buffer.length}};function Cin(t){let e=t.indexOf(bin);if(e===-1)return;let n=e+bin.length,r=t.indexOf(";",n);if(r===-1)return;let s=[],i=1;for(let o of t.slice(n,r).split(",")){let[a,c]=o.split("=",2);if(c===void 0)continue;let u=Number(c);!Number.isInteger(u)||u<=0||u>4294967295||(a==="i"?s.push(u):a==="r"&&(i=u))}return{ids:s,rows:i}}function vKe(t){return Cin(t)?.ids??[]}function pes(t){return Cin(t)?.rows??1}function hes(){return!!process.env.TERMUX_VERSION}var JA=class extends pH{mode="regular";previousLines=[];previousKittyImageIds=new Set;previousWidth=0;previousHeight=0;cursorRow=0;hardwareCursorRow=0;maxLinesRendered=0;previousViewportTop=0;captureRenderState(){return{previousLines:[...this.previousLines],previousWidth:this.previousWidth,previousHeight:this.previousHeight,cursorRow:this.cursorRow,hardwareCursorRow:this.hardwareCursorRow,maxLinesRendered:this.maxLinesRendered,previousViewportTop:this.previousViewportTop}}restoreRenderState(e){this.previousLines=e.previousLines.map(n=>Hl(n)?"":n),this.previousKittyImageIds=new Set,this.previousWidth=e.previousWidth,this.previousHeight=e.previousHeight,this.cursorRow=e.cursorRow,this.hardwareCursorRow=e.hardwareCursorRow,this.maxLinesRendered=e.maxLinesRendered,this.previousViewportTop=e.previousViewportTop}resetRenderState(){this.previousLines=[],this.previousWidth=-1,this.previousHeight=-1,this.cursorRow=0,this.hardwareCursorRow=0,this.maxLinesRendered=0,this.previousViewportTop=0}beforeTerminalStop(e){if(e.preserveScreen||this.previousLines.length===0)return;this.terminal.write(" ");let r=this.previousLines.length-this.hardwareCursorRow;r>0?this.terminal.write(`\x1B[${r}B`):r<0&&this.terminal.write(`\x1B[${-r}A`),this.terminal.write(`\r -`)}collectKittyImageIds(e){let n=new Set;for(let r of e)for(let s of vKe(r))n.add(s);return n}deleteKittyImages(e){let n="";for(let r of e)n+=aH(r);return n}getKittyImageReservedRows(e,n,r=e.length-1){let s=pes(e[n]??"");if(s<=1)return 1;let i=Math.min(s,r-n+1,e.length-n),o=1;for(;o0)break;o++}return o}expandChangedRangeForKittyImages(e,n,r){let s=e,i=n,o=a=>{for(let c=0;c=e||c<=n&&u>=e)&&(s=Math.min(s,c),i=Math.max(i,u))}};return o(this.previousLines),o(r),{firstChanged:s,lastChanged:i}}deleteChangedKittyImages(e,n){if(e<0||n0?this.previousViewportTop+this.previousHeight:n,o=s?Math.max(0,i-n):this.previousViewportTop,a=o,c=this.hardwareCursorRow,u=P=>{let G=c-o;return P-a-G},l=this.render(e);this.hasOverlayEntries&&(l=this.compositeOverlays(l,e,n));let d=this.extractCursorPosition(l,n);l=this.applyLineResets(l);let h=P=>{this.fullRedrawCount+=1;let G=new wX(Q=>this.terminal.write(Q));G.append("\x1B[?2026h"),P&&(G.append(this.deleteKittyImages(this.previousKittyImageIds)),G.append("\x1B[2J\x1B[H\x1B[3J"));for(let Q=0;Q0&&G.append(`\r -`);let H=l[Q],re=Hl(H)?this.getKittyImageReservedRows(l,Q):1;if(re>1&&re<=n){for(let Z=1;Z{if(m===void 0)return;let G=LM.join(m,"pi-tui-debug.log"),$=`[${new Date().toISOString()}] fullRender: ${P} (prev=${this.previousLines.length}, new=${l.length}, height=${n}) -`;tT.mkdirSync(LM.dirname(G),{recursive:!0}),tT.appendFileSync(G,$)};if(this.previousLines.length===0&&!r&&!s){f("first render"),h(!1);return}if(r){f(`terminal width changed (${this.previousWidth} -> ${e})`),h(!0);return}if(s&&!hes()){f(`terminal height changed (${this.previousHeight} -> ${n})`),h(!0);return}if(this.getClearOnShrink()&&l.lengththis.previousLines.length;if(b&&(g===-1&&(g=this.previousLines.length),A=l.length-1),g!==-1){let P=this.expandChangedRangeForKittyImages(g,A,l);g=P.firstChanged,A=P.lastChanged}let S=b&&g===this.previousLines.length&&g>0;if(g===-1){this.positionHardwareCursor(d,l.length),this.previousViewportTop=o,this.previousHeight=n;return}if(g>=l.length){if(this.previousLines.length>l.length){let P=new wX(re=>this.terminal.write(re));P.append("\x1B[?2026h"),P.append(this.deleteChangedKittyImages(g,A));let G=Math.max(0,l.length-1);if(G0?P.append(`\x1B[${$}B`):$<0&&P.append(`\x1B[${-$}A`),P.append("\r");let Q=this.previousLines.length-l.length;if(Q>n){f(`extraLines > height (${Q} > ${n})`),h(!0);return}let H=l.length===0?0:1;Q>0&&H>0&&P.append(`\x1B[${H}B`);for(let re=0;re0&&P.append(`\x1B[${oe}A`),P.append("\x1B[?2026l"),P.flush(),this.cursorRow=G,this.hardwareCursorRow=G}this.positionHardwareCursor(d,l.length),this.previousLines=l,this.previousKittyImageIds=this.collectKittyImageIds(l),this.previousWidth=e,this.previousHeight=n,this.previousViewportTop=o;return}if(gthis.terminal.write(P));C.append("\x1B[?2026h"),C.append(this.deleteChangedKittyImages(g,A));let I=o+n-1,x=S?g-1:g;if(x>I){let P=Math.max(0,Math.min(n-1,c-o)),G=n-1-P;G>0&&C.append(`\x1B[${G}B`);let $=x-I;C.append(`\r -`.repeat($)),o+=$,a+=$,c=x}let w=u(x);w>0?C.append(`\x1B[${w}B`):w<0&&C.append(`\x1B[${-w}A`),C.append(S?`\r -`:"\r");let R=Math.min(A,l.length-1);for(let P=g;P<=R;P++){P>g&&C.append(`\r -`);let G=l[P],$=Hl(G),Q=$?this.getKittyImageReservedRows(l,P,R):1;if(Q>1){let H=P-a;if(H<0||H+Q>n){f(`kitty image pre-clear would scroll (${H} + ${Q} > ${n})`),h(!0);return}C.append("\x1B[2K");for(let oe=1;oee){let H=LM.join(this.logDirectory??Sin.tmpdir(),"pi-tui-crash.log"),oe=[`Crash at ${new Date().toISOString()}`,`Terminal width: ${e}`,`Line ${P} visible width: ${nn(G)}`,"","=== All rendered lines ===",...l.map((Z,q)=>`[${q}] (w=${nn(Z)}) ${Z}`),""].join(` -`);tT.mkdirSync(LM.dirname(H),{recursive:!0}),tT.writeFileSync(H,oe),this.stop();let re=[`Rendered line ${P} exceeds terminal width (${nn(G)} > ${e}).`,"","This is likely caused by a custom TUI component not truncating its output.","Use visibleWidth() to measure and truncateToWidth() to truncate lines.","",`Debug log written to: ${H}`].join(` -`);throw new Error(re)}C.append(G)}let N=R;if(this.previousLines.length>l.length){if(R0?o+=`\x1B[${i}B`:i<0&&(o+=`\x1B[${-i}A`),o+=`\x1B[${s+1}G`,o&&this.terminal.write(o),this.hardwareCursorRow=r,this.getShowHardwareCursor()?this.terminal.showCursor():this.terminal.hideCursor()}};p();var Iin=require("node:fs"),xin=5e3;function FM(t){if(t)try{t.close()}catch{}}function CH(t,e,n){try{let r=(0,Iin.watch)(t,e);return r.on("error",n),r}catch{return n(),null}}p();var DX=Gt(FKe(),1),phn=Gt(QKe(),1),hhn=Gt(UKe(),1),mhn=Gt(GKe(),1),fhn=Gt(WKe(),1),ghn=Gt(qKe(),1),Ahn=Gt(HKe(),1),yhn=Gt(jKe(),1),Ehn=Gt(YKe(),1),bhn=Gt(zKe(),1),_hn=Gt(JKe(),1),Shn=Gt(XKe(),1),Chn=Gt(ZKe(),1),Ihn=Gt(eze(),1),xhn=Gt(tze(),1),whn=Gt(nze(),1),Thn=Gt(rze(),1),vhn=Gt(sze(),1),Rhn=Gt(ize(),1),khn=Gt(dze(),1),Nhn=Gt(hze(),1);p();function Son(t){if(!(!Number.isInteger(t)||t<0||t>1114111))return String.fromCodePoint(t)}function ins(t){switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"apos":return"'"}if(t.startsWith("#x")||t.startsWith("#X"))return Son(Number.parseInt(t.slice(2),16));if(t.startsWith("#"))return Son(Number.parseInt(t.slice(1),10))}function Con(t,e){let n=t.indexOf(";",e+1);if(n===-1||n-e>16)return;let r=t.slice(e+1,n),s=ins(r);if(s!==void 0)return{text:s,length:n-e+1}}var Kos={python:whn.default,java:Ehn.default,go:Ahn.default,javascript:bhn.default,cpp:mhn.default,typescript:Nhn.default,php:xhn.default,ruby:Thn.default,c:hhn.default,csharp:fhn.default,nix:Chn.default,bash:phn.default,rust:vhn.default,scala:Rhn.default,kotlin:_hn.default,swift:khn.default,dart:ghn.default,groovy:yhn.default,perl:Ihn.default,lua:Shn.default};for(let[t,e]of Object.entries(Kos))DX.default.registerLanguage(t,e);var Cze;function Dhn(){return Cze||(Cze=new Promise(t=>{setImmediate(()=>{Promise.resolve().then(()=>Gt(lhn(),1)).then(()=>t(),()=>{t()})})})),Cze}var uhn="",dhn="hljs-";function zos(t){let e=/\sclass\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(t),n=e?.[1]??e?.[2];if(n){for(let r of n.split(/\s+/))if(r.startsWith(dhn))return r.slice(dhn.length)}}function Jos(t,e){let n=e[t];if(n)return n;let r=t.indexOf(".");if(r!==-1){let i=e[t.slice(0,r)];if(i)return i}let s=t.indexOf("-");if(s!==-1){let i=e[t.slice(0,s)];if(i)return i}}function Xos(t,e){for(let n=t.length-1;n>=0;n--){let r=t[n];if(!r)continue;let s=Jos(r,e);if(s)return s}return e.default}function Zos(t,e){if(!t.startsWith(""||n===" "||n===" "||n===` -`||n==="\r"}function eas(t,e={}){let n="",r="",s=[],i=()=>{if(!r)return;let a=Xos(s,e);n+=a?a(r):r,r=""},o=0;for(;o",o+5);if(a!==-1){i();let c=t.slice(o,a+1),u=zos(c);s.push(u),o=a+1;continue}}if(t.startsWith(uhn,o)){i(),s.length>0&&s.pop(),o+=uhn.length;continue}if(t[o]==="&"){let a=Con(t,o);if(a){r+=a.text,o+=a.length;continue}}r+=t[o],o++}return i(),n}function Ize(t,e={}){let n=e.language?DX.default.highlight(t,{language:e.language,ignoreIllegals:e.ignoreIllegals}).value:DX.default.highlightAuto(t,e.languageSubset).value;return eas(n,e.theme)}function xze(t){return DX.default.getLanguage(t)!==void 0}var Rze;function Ohn(t){Rze=t}function y_e(t){let e=t.replace("#","");if(e.length!==6)throw new Error(`Invalid hex color: ${t}`);let n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),s=parseInt(e.substring(4,6),16);if(Number.isNaN(n)||Number.isNaN(r)||Number.isNaN(s))throw new Error(`Invalid hex color: ${t}`);return{r:n,g:r,b:s}}var BX=[0,95,135,175,215,255],kze=Array.from({length:24},(t,e)=>8+e*10);function wze(t){let e=1/0,n=0;for(let r=0;rthis.fg("thinkingOff",n);case"minimal":return n=>this.fg("thinkingMinimal",n);case"low":return n=>this.fg("thinkingLow",n);case"medium":return n=>this.fg("thinkingMedium",n);case"high":return n=>this.fg("thinkingHigh",n);case"xhigh":return n=>this.fg("thinkingXhigh",n);case"max":return n=>this.fg("thinkingMax",n);default:return n=>this.fg("thinkingOff",n)}}getBashModeBorderColor(){return e=>this.fg("bashMode",e)}},Tze;function Qhn(){if(!Tze){let t=k9e(),e=$M.join(t,"dark.json"),n=$M.join(t,"light.json");Tze={dark:JSON.parse(Mi(ZA.readFileSync(e,"utf-8"))),light:JSON.parse(Mi(ZA.readFileSync(n,"utf-8")))}}return Tze}function E_e(){return Bze().map(({name:t})=>t)}function Bze(){let t=k9e(),e=[],n=new Set,r=s=>{n.has(s.name)||(n.add(s.name),e.push(s))};for(let s of Object.keys(Qhn()))r({name:s,path:$M.join(t,`${s}.json`)});for(let s of ias())r(s);for(let[s,i]of kH.entries())r({name:s,path:i.sourcePath});return e.sort((s,i)=>s.name.localeCompare(i.name))}function ias(){let t=gbe(),e=[];if(!ZA.existsSync(t))return e;for(let n of ZA.readdirSync(t)){if(!n.endsWith(".json"))continue;let r=$M.join(t,n);try{let s=NH(r);s.name&&e.push({name:s.name,path:r})}catch{}}return e}function oas(t){if(t.includes("/"))throw new Error(`Invalid theme name "${t}": theme names cannot contain "/" because it is reserved for automatic light/dark theme settings.`)}function aas(t,e){if(Rze)return Rze(t,e);if(typeof e!="object"||e===null||!("colors"in e))throw new Error(`Invalid theme "${t}": expected an object with a "colors" map.`);return e}function Nze(t,e){let n;try{n=JSON.parse(Mi(e))}catch(r){throw new Error(`Failed to parse theme ${t}: ${r}`)}return aas(t,n)}function Pze(t){let e=Qhn();if(t in e)return e[t];let n=kH.get(t);if(n?.sourcePath){let o=ZA.readFileSync(n.sourcePath,"utf-8");return Nze(n.sourcePath,o)}if(n)throw new Error(`Theme "${t}" does not have a source path for export`);let r=gbe(),s=$M.join(r,`${t}.json`);if(!ZA.existsSync(s))throw new Error(`Theme not found: ${t}`);let i=ZA.readFileSync(s,"utf-8");return Nze(t,i)}function Uhn(t,e,n){let r=e??(qc().trueColor?"truecolor":"256color"),s=Lhn(Fhn(t.colors),t.vars),i={},o={},a=new Set(["selectedBg","searchMatchBg","userMessageBg","customMessageBg","toolPendingBg","toolSuccessBg","toolErrorBg"]);for(let[c,u]of Object.entries(s))a.has(c)?o[c]=u:i[c]=u;return new GM(i,o,r,{name:t.name,sourcePath:n})}function NH(t,e){let n=ZA.readFileSync(t,"utf-8"),r=Nze(t,n);return Uhn(r,e,t)}function OX(t,e){let n=kH.get(t);if(n)return n;let r=Pze(t);return Uhn(r,e)}function b_e(t){try{return OX(t)}catch{return}}function rT(t){if(!t)return;let e=t.indexOf("/");if(e===-1||t.indexOf("/",e+1)!==-1)return;let n=t.slice(0,e).trim(),r=t.slice(e+1).trim();if(!(!n||!r))return{lightTheme:n,darkTheme:r}}function DH(t,e){let n=rT(t);if(n)return e==="light"?n.lightTheme:n.darkTheme;if(!t?.includes("/")&&typeof t=="string")return t}function cas(t){let e=t.split(";");for(let n=e.length-1;n>=0;n--){let r=parseInt(e[n].trim(),10);if(Number.isInteger(r)&&r>=0&&r<=255)return r}}function $hn({r:t,g:e,b:n}){let r=s=>{let i=s/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*r(t)+.7152*r(e)+.0722*r(n)}function las(t){return $hn(y_e(Lze(t)))}function uas(t){return $hn(t)>=.5?"light":"dark"}function BH(t={}){let n=(t.env??process.env).COLORFGBG||"",r=cas(n);return r!==void 0?{theme:las(r)>=.5?"light":"dark",source:"COLORFGBG",detail:`background color index ${r}`,confidence:"high"}:{theme:"dark",source:"fallback",detail:"no terminal background hint found",confidence:"low"}}async function Oze({ui:t,timeoutMs:e,env:n}){try{let r=await t.queryTerminalBackgroundColor({timeoutMs:e});if(r)return{theme:uas(r),source:"terminal background",detail:`OSC 11 background rgb(${r.r}, ${r.g}, ${r.b})`,confidence:"high"}}catch{}return BH({env:n})}async function MX({ui:t,timeoutMs:e,env:n}){let r;try{r=t.queryTerminalColorScheme?.({timeoutMs:e})}catch{}let s=Oze({ui:t,timeoutMs:e,env:n});try{let i=await r;if(i)return i}catch{}return(await s).theme}function Mze(){return BH().theme}var Ghn=Symbol.for("@earendil-works/pi-coding-agent:theme"),das=Symbol.for("@mariozechner/pi-coding-agent:theme"),Se=new Proxy({},{get(t,e){let n=globalThis[Ghn];if(!n)throw new Error("Theme not initialized. Call initTheme() first.");return n[e]}});function RH(t){globalThis[Ghn]=t,globalThis[das]=t}var XA,PX,UM,WM,kH=new Map;function PH(t){kH.clear();for(let e of t)e.name&&(oas(e.name),kH.set(e.name,e))}function KC(t,e=!1){let n=t??Mze();XA=n;try{RH(OX(n)),e&&Hhn()}catch{XA="dark",RH(OX("dark"))}}function qM(t,e=!1){XA=t;try{return RH(OX(t)),e&&Hhn(),WM&&WM(),{success:!0}}catch(n){return XA="dark",RH(OX("dark")),{success:!1,error:n instanceof Error?n.message:String(n)}}}function Whn(t){RH(t),XA="",d0(),WM&&WM()}function qhn(t){WM=t}function Hhn(){if(d0(),!XA||XA==="dark"||XA==="light")return;let t=gbe(),e=XA,n=`${e}.json`,r=$M.join(t,n);if(!ZA.existsSync(r))return;let s=()=>{UM&&clearTimeout(UM),UM=setTimeout(()=>{if(UM=void 0,XA===e&&ZA.existsSync(r))try{let i=NH(r);kH.set(e,i),RH(i),WM&&WM()}catch{}},100)};PX=CH(t,(i,o)=>{if(XA===e){if(!o){s();return}o===n&&s()}},()=>{FM(PX),PX=void 0})??void 0}function d0(){UM&&(clearTimeout(UM),UM=void 0),FM(PX),PX=void 0}function Lze(t){let e=["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"];if(t<16)return e[t];if(t<232){let s=t-16,i=Math.floor(s/36),o=Math.floor(s%36/6),a=s%6,c=u=>(u===0?0:55+u*40).toString(16).padStart(2,"0");return`#${c(i)}${c(o)}${c(a)}`}let r=(8+(t-232)*10).toString(16).padStart(2,"0");return`#${r}${r}${r}`}function Fze(t){let e=t??XA??Mze(),n=e==="light",r=Pze(e),s=Lhn(Fhn(r.colors),r.vars),i=n?"#000000":"#e5e5e7",o={};for(let[a,c]of Object.entries(s))typeof c=="number"?o[a]=Lze(c):c===""?o[a]=i:o[a]=c;return o}function Qze(t){let e=t??XA??Mze();try{let n=Pze(e),r=n.export;if(!r)return{};let s=n.vars??{},i=o=>{if(o===void 0)return;let a=Dze(o,s);if(typeof a=="number")return Lze(a);if(a!=="")return a};return{pageBg:i(r.pageBg),cardBg:i(r.cardBg),infoBg:i(r.infoBg)}}catch{return{}}}var Phn,vze;function pas(t){return{keyword:e=>t.fg("syntaxKeyword",e),built_in:e=>t.fg("syntaxType",e),literal:e=>t.fg("syntaxNumber",e),number:e=>t.fg("syntaxNumber",e),regexp:e=>t.fg("syntaxString",e),string:e=>t.fg("syntaxString",e),comment:e=>t.fg("syntaxComment",e),doctag:e=>t.fg("syntaxComment",e),meta:e=>t.fg("muted",e),function:e=>t.fg("syntaxFunction",e),title:e=>t.fg("syntaxFunction",e),class:e=>t.fg("syntaxType",e),type:e=>t.fg("syntaxType",e),tag:e=>t.fg("syntaxPunctuation",e),name:e=>t.fg("syntaxKeyword",e),attr:e=>t.fg("syntaxVariable",e),variable:e=>t.fg("syntaxVariable",e),params:e=>t.fg("syntaxVariable",e),operator:e=>t.fg("syntaxOperator",e),punctuation:e=>t.fg("syntaxPunctuation",e),emphasis:e=>t.italic(e),strong:e=>t.bold(e),link:e=>t.underline(e),addition:e=>t.fg("toolDiffAdded",e),deletion:e=>t.fg("toolDiffRemoved",e)}}function Vhn(t){return(Phn!==t||!vze)&&(Phn=t,vze=pas(t)),vze}function sT(t,e){let n=e&&xze(e)?e:void 0;if(!n)return t.split(` -`).map(s=>Se.fg("mdCodeBlock",s));let r={language:n,ignoreIllegals:!0,theme:Vhn(Se)};try{return Ize(t,r).split(` -`)}catch{return t.split(` -`)}}function LN(t){let e=t.split(".").pop()?.toLowerCase();return e?{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",ps1:"powershell",sql:"sql",html:"html",htm:"html",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",md:"markdown",markdown:"markdown",dockerfile:"dockerfile",makefile:"makefile",cmake:"cmake",lua:"lua",perl:"perl",r:"r",scala:"scala",clj:"clojure",ex:"elixir",exs:"elixir",erl:"erlang",hs:"haskell",ml:"ocaml",vim:"vim",graphql:"graphql",proto:"protobuf",tf:"hcl",hcl:"hcl"}[e]:void 0}function Fh(){return{heading:t=>Se.fg("mdHeading",t),link:t=>Se.fg("mdLink",t),linkUrl:t=>Se.fg("mdLinkUrl",t),code:t=>Se.fg("mdCode",t),codeBlock:t=>Se.fg("mdCodeBlock",t),codeBlockBorder:t=>Se.fg("mdCodeBlockBorder",t),quote:t=>Se.fg("mdQuote",t),quoteBorder:t=>Se.fg("mdQuoteBorder",t),hr:t=>Se.fg("mdHr",t),listBullet:t=>Se.fg("mdListBullet",t),bold:t=>Se.bold(t),italic:t=>Se.italic(t),underline:t=>Se.underline(t),strikethrough:t=>en.strikethrough(t),highlightCode:(t,e)=>{let n=e&&xze(e)?e:void 0;if(!n)return t.split(` -`).map(s=>Se.fg("mdCodeBlock",s));let r={language:n,ignoreIllegals:!0,theme:Vhn(Se)};try{return Ize(t,r).split(` -`)}catch{return t.split(` -`).map(s=>Se.fg("mdCodeBlock",s))}}}}function p0(){return{selectedPrefix:t=>Se.fg("accent",t),selectedText:t=>Se.fg("accent",t),description:t=>Se.fg("muted",t),scrollInfo:t=>Se.fg("muted",t),noMatch:t=>Se.fg("muted",t)}}function LX(){return{borderColor:t=>Se.fg("borderMuted",t),selectList:p0()}}function OH(){return{label:(t,e)=>e?Se.fg("accent",t):t,value:(t,e)=>e?Se.fg("accent",t):Se.fg("muted",t),description:t=>Se.fg("dim",t),cursor:Se.fg("accent","\u2192 "),hint:t=>Se.fg("dim",t)}}p();var Ogn=Gt(E0e(),1);var Uds=t=>t.replace(/\r\n/g,` -`).replace(/\r/g,` -`),$ds=t=>{let e=Uds(Mi(t));if(!e.startsWith("---"))return{yamlString:null,body:e};let n=e.indexOf(` ----`,3);return n===-1?{yamlString:null,body:e}:{yamlString:e.slice(4,n),body:e.slice(n+4).trim()}},JM=t=>{let{yamlString:e,body:n}=$ds(t);return e?{frontmatter:(0,Ogn.parse)(e)??{},body:n}:{frontmatter:{},body:n}},b0e=t=>JM(t).body;p();function Mgn(t,e){return new Promise((n,r)=>{if(e?.aborted){r(new Error("Aborted"));return}let s=setTimeout(n,t);e?.addEventListener("abort",()=>{clearTimeout(s),r(new Error("Aborted"))})})}p();p();p();p();function Gds(t,e){if(e+8>t.length)return 1;let r=(t[e]<<8|t[e+1])===18761,s=u=>r?t[u]|t[u+1]<<8:t[u]<<8|t[u+1],o=(u=>r?t[u]|t[u+1]<<8|t[u+2]<<16|t[u+3]<<24:(t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3])>>>0)(e+4),a=e+o;if(a+2>t.length)return 1;let c=s(a);for(let u=0;ut.length)return 1;if(s(l)===274){let d=s(l+8);return d>=1&&d<=8?d:1}}return 1}function Wds(t){let e=2;for(;e=t.length)return-1;let s=e+4;if(s+6>t.length)return-1;if(Lgn(t,s))return s+6}if(e+4>t.length)return-1;let r=t[e+2]<<8|t[e+3];e+=2+r}return-1}function qds(t){let e=12;for(;e+8<=t.length;){let n=String.fromCharCode(t[e],t[e+1],t[e+2],t[e+3]),r=t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24,s=e+8;if(n==="EXIF")return s+r>t.length?-1:r>=6&&Lgn(t,s)?s+6:s;e=s+r+r%2}return-1}function Lgn(t,e){return t[e]===69&&t[e+1]===120&&t[e+2]===105&&t[e+3]===102&&t[e+4]===0&&t[e+5]===0}function Hds(t){let e=-1;return t.length>=2&&t[0]===255&&t[1]===216?e=Wds(t):t.length>=12&&t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80&&(e=qds(t)),e===-1?1:Gds(t,e)}function _0e(t,e,n){let r=e.get_width(),s=e.get_height(),i=e.get_raw_pixels(),o=new Uint8Array(i.length);for(let a=0;ai*c+(c-1-o));return t.fliph(s),s}case 6:return _0e(t,e,(s,i,o,a)=>s*a+(a-1-i));case 7:{let s=_0e(t,e,(i,o,a,c)=>(a-1-i)*c+o);return t.fliph(s),s}case 8:return _0e(t,e,(s,i,o,a)=>(o-1-s)*a+i);default:return e}}p();var Wgn=require("module"),ZH=Gt(require("path"),1),qgn=require("url"),nps=(0,Wgn.createRequire)(_),JH=nps("fs"),v0e="photon_rs_bg.wasm",XH=null,T0e=null;function rps(t){return typeof t=="string"?t:t instanceof URL?(0,qgn.fileURLToPath)(t):null}function sps(){let t=ZH.dirname(process.execPath);return[ZH.join(t,v0e),ZH.join(t,"photon",v0e),ZH.join(process.cwd(),v0e)]}function ips(){let t=JH.readFileSync.bind(JH),e=sps(),n=JH,r=((...s)=>{let[i,o]=s;if(rps(i)?.endsWith(v0e))try{return t(...s)}catch(c){let u=c;if(u?.code&&u.code!=="ENOENT")throw c;for(let l of e)if(JH.existsSync(l))return o===void 0?t(l):t(l,o);throw c}return t(...s)});try{n.readFileSync=r}catch{Object.defineProperty(JH,"readFileSync",{value:r,writable:!0,configurable:!0})}return()=>{try{n.readFileSync=t}catch{Object.defineProperty(JH,"readFileSync",{value:t,writable:!0,configurable:!0})}}}async function e5(){return XH||T0e||(T0e=(async()=>{let t=ips();try{return XH=await Promise.resolve().then(()=>Gt(Ggn(),1)),XH}catch{return XH=null,XH}finally{t()}})(),T0e)}async function IJe(t){let e=await e5();if(!e)return null;try{let n=e.PhotonImage.new_from_byteslice(t),r=S0e(e,n,t);r!==n&&n.free();try{return new Uint8Array(r.get_bytes())}finally{r.free()}}catch{return null}}async function R0e(t,e){if(e==="image/png")return{data:t,mimeType:e};let n=new Uint8Array(Buffer.from(t,"base64")),r=await IJe(n);return r?{data:Buffer.from(r).toString("base64"),mimeType:"image/png"}:null}p();var Ygn=require("node:worker_threads");p();var ops=4.5*1024*1024,aps={maxWidth:2e3,maxHeight:2e3,maxBytes:ops,jpegQuality:80};function Hgn(t,e){let n=Buffer.from(t).toString("base64");return{data:n,encodedSize:Buffer.byteLength(n,"utf-8"),mimeType:e}}async function Vgn(t,e,n){let r={...aps,...n},s=Math.ceil(t.byteLength/3)*4,i=await e5();if(!i)return null;let o;try{let m=function(y,b,S){let C=i.resize(o,y,b,i.SamplingFilter.Lanczos3);try{let I=[Hgn(C.get_bytes(),"image/png")];for(let x of S)I.push(Hgn(C.get_bytes_jpeg(x),"image/jpeg"));return I}finally{C.free()}},a=i.PhotonImage.new_from_byteslice(t);o=S0e(i,a,t),o!==a&&a.free();let c=o.get_width(),u=o.get_height(),l=e.split("/")[1]??"png";if(c<=r.maxWidth&&u<=r.maxHeight&&sr.maxWidth&&(h=Math.round(h*r.maxWidth/d),d=r.maxWidth),h>r.maxHeight&&(d=Math.round(d*r.maxHeight/h),h=r.maxHeight);let f=Array.from(new Set([r.jpegQuality,85,70,55,40])),g=d,A=h;for(;;){let y=m(g,A,f);for(let C of y)if(C.encodedSize{let c=!1,u=d=>{c||(c=!0,o(d))},l=d=>{c||(c=!0,a(d))};s.once("message",d=>{if(!lps(d)){l(new Error("Invalid image resize worker response"));return}if(d.error){l(new Error(d.error));return}u(d.result??null)}),s.once("error",l),s.once("exit",d=>{c||l(new Error(`Image resize worker exited with code ${d}`))}),s.postMessage({inputBytes:i,mimeType:n,options:r},[i.buffer])})}finally{s.terminate().catch(()=>{})}}async function k0e(t,e,n){let r=_.endsWith(".ts"),s=new URL(r?"./image-resize-worker.ts":"./image-resize-worker.js",_);if(typeof process.versions.bun=="string")try{return await jgn("./src/utils/image-resize-worker.ts",t,e,n)}catch{}try{return await jgn(s,t,e,n)}catch{return Vgn(t,e,n)}}function N0e(t){if(!t.wasResized)return;let e=t.originalWidth/t.width;return`[Image: original ${t.originalWidth}x${t.originalHeight}, displayed at ${t.width}x${t.height}. Multiply coordinates by ${e.toFixed(2)} to map to original image.]`}function zgn(t){return t.split(";")[0]?.trim().toLowerCase()??t.toLowerCase()}function dps(t){switch(zgn(t)){case"image/png":return"image/png";case"image/jpeg":case"image/jpg":return"image/jpeg";case"image/gif":return"image/gif";case"image/webp":return"image/webp";default:return null}}async function pps(t,e){let n=dps(e);if(n)return{bytes:t,mimeType:n};let r=await IJe(t);return r?{bytes:r,mimeType:"image/png",convertedFrom:zgn(e)}:null}function Kgn(t,e){if(!(!t||t===e))return`[Image converted from ${t} to ${e}.]`}async function t5(t,e,n){let r=n?.autoResizeImages??!0,s=await pps(t,e);if(!s)return{ok:!1,message:"[Image omitted: could not be converted to a supported inline image format.]"};if(r){let a=await k0e(s.bytes,s.mimeType,n?.resizeOptions);if(!a)return{ok:!1,message:"[Image omitted: could not be resized below the inline image size limit.]"};let c=[],u=Kgn(s.convertedFrom,a.mimeType);u&&c.push(u);let l=N0e(a);return l&&c.push(l),{ok:!0,data:a.data,mimeType:a.mimeType,hints:c}}let i=[],o=Kgn(s.convertedFrom,s.mimeType);return o&&i.push(o),{ok:!0,data:Buffer.from(s.bytes).toString("base64"),mimeType:s.mimeType,hints:i}}async function Jgn(t,e){if(!t.some(i=>i.type==="image"))return t;let n=e?.autoResizeImages??!0,r=[],s=!1;for(let i of t){if(i.type!=="image"){r.push(i);continue}let o=await t5(Buffer.from(i.data,"base64"),i.mimeType,{autoResizeImages:n});if(!o.ok){r.push(i);continue}if(o.data===i.data&&o.mimeType===i.mimeType&&o.hints.length===0){r.push(i);continue}r.push({type:"image",data:o.data,mimeType:o.mimeType}),o.hints.length>0&&r.push({type:"text",text:o.hints.join(` -`)}),s=!0}return s?r:t}p();var xJe=require("node:path");var hps="unknown";function wJe(){return["Use /login to log into a provider via OAuth or API key. See:",` ${(0,xJe.join)(Yw(),"providers.md")}`,` ${(0,xJe.join)(Yw(),"models.md")}`].join(` -`)}function n5(){return`No models available. ${wJe()}`}function TJe(){return`No model selected. - -${wJe()} - -Then use /model to select a model.`}function D0e(t){return`No API key found for ${t===hps?"the selected model":t}. - -${wJe()}`}p();var tAn=require("node:crypto"),nAn=require("node:fs"),rAn=require("node:os"),sAn=require("node:path");p();function mps({onlyFirst:t=!1}={}){let s="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(s,t?void 0:"g")}var fps=mps();function r5(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(fps,"")}p();var fZ=require("node:fs"),gZ=require("node:path"),AZ=require("child_process");function gps(t){let e=t.replace(/\//g,"\\").toLowerCase();return/^[a-z]:\\windows\\(?:system32|sysnative)\\bash\.exe$/.test(e)}function mZ(t){return gps(t)?{shell:t,args:["-s"],commandTransport:"stdin"}:{shell:t,args:["-c"]}}function B0e(t){if(process.platform==="win32"){try{let e=(0,AZ.spawnSync)("where",[t],{encoding:"utf-8",timeout:5e3,windowsHide:!0});if(e.status===0&&e.stdout){let n=e.stdout.trim().split(/\r?\n/)[0];if(n&&(0,fZ.existsSync)(n))return n}}catch{}return null}try{let e=(0,AZ.spawnSync)("which",[t],{encoding:"utf-8",timeout:5e3});if(e.status===0&&e.stdout){let n=e.stdout.trim().split(/\r?\n/)[0];if(n)return n}}catch{}return null}function s5(t){if(t){if((0,fZ.existsSync)(t))return mZ(t);throw new Error(`Custom shell path not found: ${t}`)}if(process.platform==="win32"){let n=[],r=process.env.ProgramFiles;r&&n.push(`${r}\\Git\\bin\\bash.exe`);let s=process.env["ProgramFiles(x86)"];s&&n.push(`${s}\\Git\\bin\\bash.exe`);for(let o of n)if((0,fZ.existsSync)(o))return mZ(o);let i=B0e("bash.exe");if(i)return mZ(i);throw new Error(`No bash shell found. Options: - 1. Install Git for Windows: https://git-scm.com/download/win - 2. Add your bash to PATH (Cygwin, MSYS2, etc.) - 3. Set shellPath in settings.json - -Searched Git Bash in: -${n.map(o=>` ${o}`).join(` -`)}`)}if((0,fZ.existsSync)("/bin/bash"))return mZ("/bin/bash");let e=B0e("bash");return e?mZ(e):{shell:"sh",args:["-c"]}}var Aps=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-Command"];function O0e(){if(process.platform!=="win32")throw new Error("The powershell tool is only available on Windows.");let t=B0e("pwsh.exe")??B0e("powershell.exe");if(!t)throw new Error("No PowerShell executable found. Install PowerShell or add powershell.exe/pwsh.exe to PATH.");return{shell:t,args:[...Aps]}}function vJe(){let t=j3(),e=Object.keys(process.env).find(o=>o.toLowerCase()==="path")??"PATH",n=process.env[e]??"",i=n.split(gZ.delimiter).filter(Boolean).includes(t)?n:[t,n].filter(Boolean).join(gZ.delimiter);return{...process.env,[e]:i}}function M0e(t){return Array.from(t).filter(e=>{let n=e.codePointAt(0);return n===void 0?!1:n===9||n===10||n===13?!0:!(n<=31||n>=65529&&n<=65531)}).join("")}var P0e=new Set;function Xgn(t){P0e.add(t)}function Zgn(t){P0e.delete(t)}function KN(){for(let t of P0e)L0e(t);P0e.clear()}function L0e(t){if(process.platform==="win32")try{(0,AZ.spawn)((0,gZ.join)(process.env.SystemRoot??"C:\\Windows","System32","taskkill.exe"),["/F","/T","/PID",String(t)],{stdio:"ignore",detached:!0,windowsHide:!0}).once("error",()=>{})}catch{}else try{process.kill(-t,"SIGKILL")}catch{try{process.kill(t,"SIGKILL")}catch{}}}p();var ny=2e3,Li=51200;function eAn(t){if(t.length===0)return[];let e=t.split(` -`);return t.endsWith(` -`)&&e.pop(),e}function ma(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}function YE(t,e={}){let n=e.maxLines??2e3,r=e.maxBytes??51200,s=Buffer.byteLength(t,"utf-8"),i=eAn(t),o=i.length;if(o<=n&&s<=r)return{content:t,truncated:!1,truncatedBy:null,totalLines:o,totalBytes:s,outputLines:o,outputBytes:s,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r};if(Buffer.byteLength(i[0],"utf-8")>r)return{content:"",truncated:!0,truncatedBy:"bytes",totalLines:o,totalBytes:s,outputLines:0,outputBytes:0,lastLinePartial:!1,firstLineExceedsLimit:!0,maxLines:n,maxBytes:r};let c=[],u=0,l="lines";for(let m=0;m0?1:0);if(u+g>r){l="bytes";break}c.push(f),u+=g}c.length>=n&&u<=r&&(l="lines");let d=c.join(` -`),h=Buffer.byteLength(d,"utf-8");return{content:d,truncated:!0,truncatedBy:l,totalLines:o,totalBytes:s,outputLines:c.length,outputBytes:h,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r}}function XC(t,e={}){let n=e.maxLines??2e3,r=e.maxBytes??51200,s=Buffer.byteLength(t,"utf-8"),i=eAn(t),o=i.length;if(o<=n&&s<=r)return{content:t,truncated:!1,truncatedBy:null,totalLines:o,totalBytes:s,outputLines:o,outputBytes:s,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r};let a=[],c=0,u="lines",l=!1;for(let m=i.length-1;m>=0&&a.length0?1:0);if(c+g>r){if(u="bytes",a.length===0){let A=yps(f,r);a.unshift(A),c=Buffer.byteLength(A,"utf-8"),l=!0}break}a.unshift(f),c+=g}a.length>=n&&c<=r&&(u="lines");let d=a.join(` -`),h=Buffer.byteLength(d,"utf-8");return{content:d,truncated:!0,truncatedBy:u,totalLines:o,totalBytes:s,outputLines:a.length,outputBytes:h,lastLinePartial:l,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r}}function yps(t,e){let n=Buffer.from(t,"utf-8");if(n.length<=e)return t;let r=n.length-e;for(;r{if(a)return;let m=(0,tAn.randomBytes)(8).toString("hex");a=(0,sAn.join)((0,rAn.tmpdir)(),`pi-bash-${m}.log`),c=(0,nAn.createWriteStream)(a);for(let f of s)c.write(f)},d=new TextDecoder,h=m=>{u+=m.length;let f=M0e(r5(d.decode(m,{stream:!0}))).replace(/\r/g,"");for(u>51200&&l(),c&&c.write(f),s.push(f),i+=f.length;i>o&&s.length>1;){let g=s.shift();i-=g.length}r?.onChunk&&r.onChunk(f)};try{let m=await n.exec(t,e,{onData:h,signal:r?.signal}),f=s.join(""),g=XC(f);g.truncated&&l(),c&&c.end();let A=r?.signal?.aborted??!1;return{output:g.truncated?g.content:f,exitCode:A?void 0:m.exitCode??void 0,cancelled:A,truncated:g.truncated,fullOutputPath:a}}catch(m){if(r?.signal?.aborted){let f=s.join(""),g=XC(f);return g.truncated&&l(),c&&c.end(),{output:g.truncated?g.content:f,exitCode:void 0,cancelled:!0,truncated:g.truncated,fullOutputPath:a}}throw c&&c.end(),m}}p();p();p();var Eps=`The conversation history before this point was compacted into the following summary: - - -`,bps=` -`,_ps=`The following is a summary of a branch that this conversation came back from: - - -`,Sps="";function Cps(t){let e=`Ran \`${t.command}\` -`;return t.output?e+=`\`\`\` -${t.output} -\`\`\``:e+="(no output)",t.cancelled?e+=` - -(command cancelled)`:t.exitCode!==null&&t.exitCode!==void 0&&t.exitCode!==0&&(e+=` - -Command exited with code ${t.exitCode}`),t.truncated&&t.fullOutputPath&&(e+=` - -[Output truncated. Full output: ${t.fullOutputPath}]`),e}function F0e(t,e,n){return{role:"branchSummary",summary:t,fromId:e,timestamp:new Date(n).getTime()}}function o5(t,e,n){return{role:"compactionSummary",summary:t,tokensBefore:e,timestamp:new Date(n).getTime()}}function Q0e(t,e,n,r,s){return{role:"custom",customType:t,content:e,display:n,details:r,timestamp:new Date(s).getTime()}}function aT(t){return t.map(e=>{switch(e.role){case"bashExecution":return e.excludeFromContext?void 0:{role:"user",content:[{type:"text",text:Cps(e)}],timestamp:e.timestamp};case"custom":return{role:"user",content:typeof e.content=="string"?[{type:"text",text:e.content}]:e.content,timestamp:e.timestamp};case"branchSummary":return{role:"user",content:[{type:"text",text:_ps+e.summary+Sps}],timestamp:e.timestamp};case"compactionSummary":return{role:"user",content:[{type:"text",text:Eps+e.summary+bps}],timestamp:e.timestamp};case"user":case"assistant":case"toolResult":return e;default:let n=e;return}}).filter(e=>e!==void 0)}p();p();var DJe=require("crypto"),mi=require("fs"),c5=require("fs/promises"),f0=require("path"),aAn=require("readline"),PJe=require("string_decoder");var zN=3;function RJe(){return tl()}function $0e(t){if(!/^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/.test(t))throw new Error("Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '.', and start and end with an alphanumeric character")}function KE(t){for(let e=0;e<100;e++){let n=(0,DJe.randomUUID)().slice(0,8);if(!t.has(n))return n}return(0,DJe.randomUUID)()}function Ips(t){let e=new Set,n=null;for(let r of t){if(r.type==="session"){r.version=2;continue}if(r.id=KE(e),r.parentId=n,n=r.id,r.type==="compaction"){let s=r;if(typeof s.firstKeptEntryIndex=="number"){let i=t[s.firstKeptEntryIndex];i&&i.type!=="session"&&(s.firstKeptEntryId=i.id),delete s.firstKeptEntryIndex}}}}function xps(t){for(let e of t){if(e.type==="session"){e.version=3;continue}if(e.type==="message"){let n=e;n.message&&n.message.role==="hookMessage"&&(n.message.role="custom")}}}function cAn(t){let n=t.find(r=>r.type==="session")?.version??1;return n>=zN?!1:(n<2&&Ips(t),n<3&&xps(t),!0)}function lAn(t){cAn(t)}function uAn(t){let e=[],n=t.trim().split(` -`);for(let r of n)if(r.trim())try{let s=JSON.parse(r);e.push(s)}catch{}return e}function yZ(t){for(let e=t.length-1;e>=0;e--)if(t[e].type==="compaction")return t[e];return null}function wps(t,e){if(e)return e;let n=new Map;for(let r of t)n.set(r.id,r);return n}function dAn(t,e,n){let r=wps(t,n),s;if(e===null)return[];if(e&&(s=r.get(e)),s??=t[t.length-1],!s)return[];let i=[],o=s;for(;o;)i.push(o),o=o.parentId?r.get(o.parentId):void 0;return i.reverse(),i}function Tps(t){let e="off",n=null;for(let r of t)r.type==="thinking_level_change"?e=r.thinkingLevel:r.type==="model_change"?n={provider:r.provider,modelId:r.modelId}:r.type==="message"&&r.message.role==="assistant"&&(n={provider:r.message.provider,modelId:r.message.model});return{thinkingLevel:e,model:n}}function g0(t){if(t.type==="message"){let e=t.message;return(e.role==="user"||e.role==="assistant"||e.role==="toolResult")&&e.content==null?[{...e,content:[]}]:[e]}return t.type==="custom_message"?[Q0e(t.customType,t.content??[],t.display,t.details,t.timestamp)]:t.type==="branch_summary"&&t.summary?[F0e(t.summary,t.fromId,t.timestamp)]:t.type==="compaction"?[o5(t.summary,t.tokensBefore,t.timestamp)]:[]}function q0e(t,e,n){let r=dAn(t,e,n),s=null;for(let c of r)c.type==="compaction"&&(s=c);if(!s)return r;let i=r.findIndex(c=>c.id===s.id);if(i<0)return r;let o=[s],a=!1;for(let c=0;ci.endsWith(".jsonl")).map(i=>(0,f0.join)(n,i)).map(i=>({path:i,header:kps(i)})).filter(i=>i.header!==null&&(!r||mAn(hAn(i.header),r))).map(({path:i})=>({path:i,mtime:(0,mi.statSync)(i).mtime})).sort((i,o)=>o.mtime.getTime()-i.mtime.getTime())[0]?.path||null}catch{return null}}function fAn(t){return typeof t.role=="string"&&"content"in t}function Dps(t){let e=t.content;return typeof e=="string"?e:e.filter(n=>n.type==="text").map(n=>n.text).join(" ")}function Bps(t){let e=t.message;if(!fAn(e)||e.role!=="user"&&e.role!=="assistant")return;let n=e.timestamp;if(typeof n=="number")return n;let r=new Date(t.timestamp).getTime();return Number.isNaN(r)?void 0:r}async function Pps(t){try{let e=await(0,c5.stat)(t),n=null,r=0,s="",i=[],o,a,c=(0,aAn.createInterface)({input:(0,mi.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0});for await(let m of c){let f=W0e(m);if(!f)continue;if(!n){if(f.type!=="session")return null;n=f;continue}if(f.type==="session_info"&&(o=f.name?.trim()||void 0),f.type!=="message")continue;r++;let g=Bps(f);typeof g=="number"&&(a=Math.max(a??0,g));let A=f.message;if(!fAn(A)||A.role!=="user"&&A.role!=="assistant")continue;let y=Dps(A);y&&(i.push(y),!s&&A.role==="user"&&(s=y))}if(!n)return null;let u=typeof n.cwd=="string"?n.cwd:"",l=n.parentSession,d=typeof n.timestamp=="string"?new Date(n.timestamp).getTime():NaN,h=typeof a=="number"&&a>0?new Date(a):Number.isNaN(d)?e.mtime:new Date(d);return{path:t,id:n.id,cwd:u,name:o,parentSessionPath:l,created:new Date(n.timestamp),modified:h,messageCount:r,firstMessage:s||"(no messages)",allMessagesText:i.join(" ")}}catch{return null}}var Ops=10;async function gAn(t,e){let n=new Array(t.length).fill(null),r=new Set,s=0,i=()=>{let o=s++,a=t[o];if(!a)return;let c;c=Pps(a).then(u=>{n[o]=u}).catch(()=>{n[o]=null}).finally(()=>{r.delete(c),e()}),r.add(c)};for(;s0;){for(;s0&&await Promise.race(r)}return n}async function oAn(t,e,n=0,r){let s=[];if(!(0,mi.existsSync)(t))return s;try{let o=(await(0,c5.readdir)(t)).filter(l=>l.endsWith(".jsonl")).map(l=>(0,f0.join)(t,l)),a=r??o.length,c=0,u=await gAn(o,()=>{c++,e?.(n+c,a)});for(let l of u)l&&s.push(l)}catch{}return s}var eo=class t{sessionId="";sessionFile;sessionDir;cwd;persist;flushed=!1;fileEntries=[];byId=new Map;labelsById=new Map;labelTimestampsById=new Map;leafId=null;constructor(e,n,r,s,i,o){this.cwd=jn(e),this.sessionDir=Mo(n),this.persist=s,s&&this.sessionDir&&!(0,mi.existsSync)(this.sessionDir)&&(0,mi.mkdirSync)(this.sessionDir,{recursive:!0}),r?this._setSessionFile(r,o):o?.length?this._loadEntries(o,i):this.newSession(i)}setSessionFile(e){this._setSessionFile(e)}_setSessionFile(e,n){if(this.sessionFile=jn(e),(0,mi.existsSync)(this.sessionFile)){let r=n??kJe(this.sessionFile);if(r.length===0){let s=this.sessionFile;if((0,mi.statSync)(s).size>0)throw new Error(`Session file is not a valid ${An} session: ${s}`);this.newSession(),this.sessionFile=s,this._rewriteFile(),this.flushed=!0;return}this._loadEntries(r),this.flushed=!0}else{let r=this.sessionFile;this.newSession(),this.sessionFile=r}}newSession(e){e?.id!==void 0&&$0e(e.id),this.sessionId=e?.id??RJe();let n=new Date().toISOString(),r={type:"session",version:zN,id:this.sessionId,timestamp:n,cwd:this.cwd,parentSession:e?.parentSession};if(this.fileEntries=[r],this.byId.clear(),this.labelsById.clear(),this.labelTimestampsById.clear(),this.leafId=null,this.flushed=!1,this.persist){let s=n.replace(/[:.]/g,"-");this.sessionFile=(0,f0.join)(this.getSessionDir(),`${s}_${this.sessionId}.jsonl`)}return this.sessionFile}_loadEntries(e,n){let r=e.find(s=>s.type==="session");r?(this.fileEntries=e,this.sessionId=r.id,cAn(this.fileEntries)&&this._rewriteFile()):(this.newSession(n),this.fileEntries=this.fileEntries.concat(e)),this._buildIndex()}_buildIndex(){this.byId.clear(),this.labelsById.clear(),this.labelTimestampsById.clear(),this.leafId=null;for(let e of this.fileEntries)e.type!=="session"&&(this.byId.set(e.id,e),this.leafId=e.id,e.type==="label"&&(e.label?(this.labelsById.set(e.targetId,e.label),this.labelTimestampsById.set(e.targetId,e.timestamp)):(this.labelsById.delete(e.targetId),this.labelTimestampsById.delete(e.targetId))))}_rewriteFile(){if(!this.persist||!this.sessionFile)return;let e=(0,mi.openSync)(this.sessionFile,"w");try{for(let n of this.fileEntries)(0,mi.writeFileSync)(e,`${JSON.stringify(n)} -`)}finally{(0,mi.closeSync)(e)}}isPersisted(){return this.persist}getCwd(){return this.cwd}getSessionDir(){return this.sessionDir}usesDefaultSessionDir(){return this.sessionDir===U0e(this.cwd)}getSessionId(){return this.sessionId}getSessionFile(){return this.sessionFile}_persist(e){if(!this.persist||!this.sessionFile)return;if(!this.fileEntries.some(r=>r.type==="message"&&r.message.role==="assistant")){this.flushed?(0,mi.appendFileSync)(this.sessionFile,`${JSON.stringify(e)} -`):this.flushed=!1;return}if(this.flushed)(0,mi.appendFileSync)(this.sessionFile,`${JSON.stringify(e)} -`);else{let r=(0,mi.openSync)(this.sessionFile,"wx");try{for(let s of this.fileEntries)(0,mi.writeFileSync)(r,`${JSON.stringify(s)} -`)}finally{(0,mi.closeSync)(r)}this.flushed=!0}}_appendEntry(e){this.fileEntries.push(e),this.byId.set(e.id,e),this.leafId=e.id,this._persist(e)}appendMessage(e){let n={type:"message",id:KE(this.byId),parentId:this.leafId,timestamp:new Date().toISOString(),message:e};return this._appendEntry(n),n.id}appendThinkingLevelChange(e){let n={type:"thinking_level_change",id:KE(this.byId),parentId:this.leafId,timestamp:new Date().toISOString(),thinkingLevel:e};return this._appendEntry(n),n.id}appendModelChange(e,n){let r={type:"model_change",id:KE(this.byId),parentId:this.leafId,timestamp:new Date().toISOString(),provider:e,modelId:n};return this._appendEntry(r),r.id}appendCompaction(e,n,r,s,i,o){let a={type:"compaction",id:KE(this.byId),parentId:this.leafId,timestamp:new Date().toISOString(),summary:e,firstKeptEntryId:n,tokensBefore:r,details:s,usage:o,fromHook:i};return this._appendEntry(a),a.id}appendCustomEntry(e,n){let r={type:"custom",customType:e,data:n,id:KE(this.byId),parentId:this.leafId,timestamp:new Date().toISOString()};return this._appendEntry(r),r.id}appendSessionInfo(e){let n=e.replace(/[\r\n]+/g," ").trim(),r={type:"session_info",id:KE(this.byId),parentId:this.leafId,timestamp:new Date().toISOString(),name:n};return this._appendEntry(r),r.id}getSessionName(){let e=this.getEntries();for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.type==="session_info")return r.name?.trim()||void 0}}appendCustomMessageEntry(e,n,r,s){let i={type:"custom_message",customType:e,content:n,display:r,details:s,id:KE(this.byId),parentId:this.leafId,timestamp:new Date().toISOString()};return this._appendEntry(i),i.id}getLeafId(){return this.leafId}getLeafEntry(){return this.leafId?this.byId.get(this.leafId):void 0}getEntry(e){return this.byId.get(e)}getChildren(e){let n=[];for(let r of this.byId.values())r.parentId===e&&n.push(r);return n}getLabel(e){return this.labelsById.get(e)}appendLabelChange(e,n){if(!this.byId.has(e))throw new Error(`Entry ${e} not found`);let r={type:"label",id:KE(this.byId),parentId:this.leafId,timestamp:new Date().toISOString(),targetId:e,label:n};return this._appendEntry(r),n?(this.labelsById.set(e,n),this.labelTimestampsById.set(e,r.timestamp)):(this.labelsById.delete(e),this.labelTimestampsById.delete(e)),r.id}getBranch(e){let n=[],r=e??this.leafId,s=r?this.byId.get(r):void 0;for(;s;)n.push(s),s=s.parentId?this.byId.get(s.parentId):void 0;return n.reverse(),n}buildContextEntries(){return q0e(this.getEntries(),this.leafId,this.byId)}buildSessionContext(){return EZ(this.getEntries(),this.leafId,this.byId)}getHeader(){let e=this.fileEntries.find(n=>n.type==="session");return e||null}getEntries(){return this.fileEntries.filter(e=>e.type!=="session")}getTree(){let e=this.getEntries(),n=new Map,r=[];for(let i of e){let o=this.labelsById.get(i.id),a=this.labelTimestampsById.get(i.id);n.set(i.id,{entry:i,children:[],label:o,labelTimestamp:a})}for(let i of e){let o=n.get(i.id);if(i.parentId===null||i.parentId===i.id)r.push(o);else{let a=n.get(i.parentId);a?a.children.push(o):r.push(o)}}let s=[...r];for(;s.length>0;){let i=s.pop();i.children.sort((o,a)=>new Date(o.entry.timestamp).getTime()-new Date(a.entry.timestamp).getTime()),s.push(...i.children)}return r}branch(e){if(!this.byId.has(e))throw new Error(`Entry ${e} not found`);this.leafId=e}resetLeaf(){this.leafId=null}branchWithSummary(e,n,r,s,i){if(e!==null&&!this.byId.has(e))throw new Error(`Entry ${e} not found`);let o=this.leafId??"root";this.leafId=e;let a={type:"branch_summary",id:KE(this.byId),parentId:e,timestamp:new Date().toISOString(),fromId:o,summary:n,details:r,usage:i,fromHook:s};return this._appendEntry(a),a.id}createBranchedSession(e){let n=this.sessionFile,r=this.getBranch(e);if(r.length===0)throw new Error(`Entry ${e} not found`);let s=[],i=new Map,o=[],a=null;for(let y of r){if(y.type==="label"){o.push(y.id);continue}for(let b of o)i.set(b,y.id);o.length=0,s.push(y.type==="compaction"?{...y,parentId:a,firstKeptEntryId:i.get(y.firstKeptEntryId)??y.firstKeptEntryId}:{...y,parentId:a}),a=y.id}let c=RJe(),u=new Date().toISOString(),l=u.replace(/[:.]/g,"-"),d=(0,f0.join)(this.getSessionDir(),`${l}_${c}.jsonl`),h={type:"session",version:zN,id:c,timestamp:u,cwd:this.cwd,parentSession:this.persist?n:void 0},m=new Set(s.map(y=>y.id)),f=[];for(let[y,b]of this.labelsById)m.has(y)&&f.push({targetId:y,label:b,timestamp:this.labelTimestampsById.get(y)});if(this.persist){let b=s[s.length-1]?.id||null,S=[];for(let{targetId:I,label:x,timestamp:w}of f){let R={type:"label",id:KE(new Set(m)),parentId:b,timestamp:w,targetId:I,label:x};m.add(R.id),S.push(R),b=R.id}return this.fileEntries=[h,...s,...S],this.sessionId=c,this.sessionFile=d,this._buildIndex(),this.fileEntries.some(I=>I.type==="message"&&I.message.role==="assistant")?(this._rewriteFile(),this.flushed=!0):this.flushed=!1,d}let g=[],A=s[s.length-1]?.id||null;for(let{targetId:y,label:b,timestamp:S}of f){let C={type:"label",id:KE(new Set([...m,...g.map(I=>I.id)])),parentId:A,timestamp:S,targetId:y,label:b};g.push(C),A=C.id}this.fileEntries=[h,...s,...g],this.sessionId=c,this._buildIndex()}static create(e,n,r){let s=n?Mo(n):a5(e);return new t(e,s,void 0,!0,r)}static open(e,n,r){let s=jn(e),i=null,o;if(r===void 0&&(0,mi.existsSync)(s))try{i=pAn(s)}catch(u){if(!(u instanceof G0e))throw u;o=kJe(s);let l=o[0];i=l?.type==="session"?l:null}let a=r??(i?hAn(i):void 0)??process.cwd(),c=n?Mo(n):(0,f0.resolve)(s,"..");return new t(a,c,s,!0,void 0,o)}static continueRecent(e,n){let r=n?Mo(n):a5(e),s=n!==void 0&&r!==U0e(e),i=Nps(r,s?e:void 0);return i?new t(e,r,i,!0):new t(e,r,void 0,!0)}static inMemory(e=process.cwd(),n,r){return new t(e,"",void 0,!1,n,r)}static forkFrom(e,n,r,s){let i=jn(e),o=jn(n),a=kJe(i);if(a.length===0)throw new Error(`Cannot fork: source session file is empty or invalid: ${i}`);if(!a.find(g=>g.type==="session"))throw new Error(`Cannot fork: source session has no header: ${i}`);let u=r?Mo(r):a5(o);(0,mi.existsSync)(u)||(0,mi.mkdirSync)(u,{recursive:!0}),s?.id!==void 0&&$0e(s.id);let l=s?.id??RJe(),d=new Date().toISOString(),h=d.replace(/[:.]/g,"-"),m=(0,f0.join)(u,`${h}_${l}.jsonl`);(0,mi.writeFileSync)(m,`${JSON.stringify({type:"session",version:zN,id:l,timestamp:d,cwd:o,parentSession:i})} -`,{flag:"wx"});for(let g of a)g.type!=="session"&&(0,mi.appendFileSync)(m,`${JSON.stringify(g)} -`);return new t(o,u,m,!0)}static async list(e,n,r){let s=n?Mo(n):a5(e),i=n!==void 0&&s!==U0e(e),o=jn(e),a=(await oAn(s,r)).filter(c=>!i||mAn(c.cwd,o));return a.sort((c,u)=>u.modified.getTime()-c.modified.getTime()),a}static async listAll(e,n){let r=typeof e=="string"?Mo(e):void 0,s=typeof e=="function"?e:n;if(r){let o=await oAn(r,s);return o.sort((a,c)=>c.modified.getTime()-a.modified.getTime()),o}let i=grn();try{if(!(0,mi.existsSync)(i))return[];let a=(await(0,c5.readdir)(i,{withFileTypes:!0})).filter(f=>f.isDirectory()||f.isSymbolicLink()).map(f=>(0,f0.join)(i,f.name)),c=0,u=[];for(let f of a)try{let g=(await(0,c5.readdir)(f)).filter(A=>A.endsWith(".jsonl"));u.push(g.map(A=>(0,f0.join)(f,A))),c+=g.length}catch{u.push([])}let l=0,d=[],h=u.flat(),m=await gAn(h,()=>{l++,s?.(l,c)});for(let f of m)f&&d.push(f);return d.sort((f,g)=>g.modified.getTime()-f.modified.getTime()),d}catch{return[]}}};p();function H0e(){return{read:new Set,written:new Set,edited:new Set}}function bZ(t,e){if(t.role==="assistant"&&!(!("content"in t)||!Array.isArray(t.content)))for(let n of t.content){if(typeof n!="object"||n===null||!("type"in n)||n.type!=="toolCall"||!("arguments"in n)||!("name"in n))continue;let r=n.arguments;if(!r)continue;let s=typeof r.path=="string"?r.path:void 0;if(s)switch(n.name){case"read":e.read.add(s);break;case"write":e.written.add(s);break;case"edit":e.edited.add(s);break}}}function V0e(t){let e=new Set([...t.edited,...t.written]),n=[...t.read].filter(s=>!e.has(s)).sort(),r=[...e].sort();return{readFiles:n,modifiedFiles:r}}function j0e(t,e){let n=[];return t.length>0&&n.push(` -${t.join(` -`)} -`),e.length>0&&n.push(` -${e.join(` -`)} -`),n.length===0?"":` - -${n.join(` - -`)}`}var Mps=2e3;function Lps(t,e){if(t.length<=e)return t;let n=t.length-e;return`${t.slice(0,e)} - -[... ${n} more characters truncated]`}function ZM(t){let e=[];for(let n of t)if(n.role==="user"){let r=yc(n.content,"");r&&e.push(`[User]: ${r}`)}else if(n.role==="assistant"){let r=[],s=[];for(let i of n.content)if(i.type==="thinking")r.push(i.thinking);else if(i.type==="toolCall"){let o=i.arguments,a=Object.entries(o).map(([c,u])=>`${c}=${JSON.stringify(u)}`).join(", ");s.push(`${i.name}(${a})`)}r.length>0&&e.push(`[Assistant thinking]: ${r.join(` -`)}`),n.content.some(i=>i.type==="text")&&e.push(`[Assistant]: ${yc(n.content)}`),s.length>0&&e.push(`[Assistant tool calls]: ${s.join("; ")}`)}else if(n.role==="toolResult"){let r=yc(n.content,"");r&&e.push(`[Tool result]: ${Lps(r,Mps)}`)}return e.join(` - -`)}var Y0e=`You are a context summarization assistant. Your task is to read a conversation between a user and an AI assistant, then produce a structured summary following the exact format specified. - -Do NOT continue the conversation. Do NOT respond to any questions in the conversation. ONLY output the structured summary.`;function Fps(t,e,n){let r=H0e();if(n>=0){let s=e[n];if(!s.fromHook&&s.details){let i=s.details;if(Array.isArray(i.readFiles))for(let o of i.readFiles)r.read.add(o);if(Array.isArray(i.modifiedFiles))for(let o of i.modifiedFiles)r.edited.add(o)}}for(let s of t)bZ(s,r);return r}function AAn(t){if(t.type!=="compaction")return g0(t)[0]}function Qps(t,e){return{input:t.input+e.input,output:t.output+e.output,cacheRead:t.cacheRead+e.cacheRead,cacheWrite:t.cacheWrite+e.cacheWrite,...t.cacheWrite1h!==void 0||e.cacheWrite1h!==void 0?{cacheWrite1h:(t.cacheWrite1h??0)+(e.cacheWrite1h??0)}:{},...t.reasoning!==void 0||e.reasoning!==void 0?{reasoning:(t.reasoning??0)+(e.reasoning??0)}:{},totalTokens:t.totalTokens+e.totalTokens,cost:{input:t.cost.input+e.cost.input,output:t.cost.output+e.cost.output,cacheRead:t.cost.cacheRead+e.cost.cacheRead,cacheWrite:t.cost.cacheWrite+e.cost.cacheWrite,total:t.cost.total+e.cost.total}}}var EAn={enabled:!0,reserveTokens:16384,keepRecentTokens:2e4};function eL(t){return t.totalTokens||t.input+t.output+t.cacheRead+t.cacheWrite}function bAn(t){if(t.role==="assistant"&&"usage"in t){let e=t;if(e.stopReason!=="aborted"&&e.stopReason!=="error"&&e.usage&&eL(e.usage)>0)return e.usage}}function _An(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type==="message"){let r=bAn(n.message);if(r)return r}}}function Ups(t){for(let e=t.length-1;e>=0;e--){let n=bAn(t[e]);if(n)return{usage:n,index:e}}}function SZ(t){let e=Ups(t);if(!e){let s=0;for(let i of t)s+=cT(i);return{tokens:s,usageTokens:0,trailingTokens:s,lastUsageIndex:null}}let n=eL(e.usage),r=0;for(let s=e.index+1;se-n.reserveTokens:!1}var $ps=4800;function yAn(t){if(typeof t=="string")return t.length;let e=0;for(let n of t)n.type==="text"&&n.text?e+=n.text.length:n.type==="image"&&(e+=$ps);return e}function cT(t){let e=0;switch(t.role){case"user":return e=yAn(t.content),Math.ceil(e/4);case"assistant":{let n=t;for(let r of n.content)r.type==="text"?e+=r.text.length:r.type==="thinking"?e+=r.thinking.length:r.type==="toolCall"&&(e+=r.name.length+JSON.stringify(r.arguments).length);return Math.ceil(e/4)}case"custom":case"toolResult":return e=yAn(t.content),Math.ceil(e/4);case"bashExecution":return e=t.command.length+t.output.length,Math.ceil(e/4);case"branchSummary":case"compactionSummary":return e=t.summary.length,Math.ceil(e/4)}return 0}function Gps(t){switch(t.role){case"user":case"assistant":case"bashExecution":case"custom":case"branchSummary":case"compactionSummary":return!0;case"toolResult":return!1}return!1}function Wps(t){switch(t.role){case"user":case"bashExecution":case"custom":case"branchSummary":case"compactionSummary":return!0;case"assistant":case"toolResult":return!1}return!1}function SAn(t){return t.type==="compaction"?!1:g0(t).some(Wps)}function qps(t,e,n){let r=[];for(let s=e;s=n;r--)if(SAn(t[r]))return r;return-1}function MJe(t,e,n,r){let s=qps(t,e,n);if(s.length===0)return{firstKeptEntryIndex:e,turnStartIndex:-1,isSplitTurn:!1};let i=0,o=s[0];for(let l=n-1;l>=e;l--){let d=t[l],h=g0(d).reduce((m,f)=>m+cT(f),0);if(h!==0&&(i+=h,i>=r)){for(let m=0;m=l){o=s[m];break}break}}for(;o>e;){let l=t[o-1];if(l.type==="compaction"||g0(l).length>0)break;o--}let a=t[o],c=SAn(a),u=c?-1:OJe(t,o,e);return{firstKeptEntryIndex:o,turnStartIndex:u,isSplitTurn:!c&&u!==-1}}var Hps=`The messages above are a conversation to summarize. Create a structured context checkpoint summary that another LLM will use to continue the work. - -Use this EXACT format: - -## Goal -[What is the user trying to accomplish? Can be multiple items if the session covers different tasks.] - -## Constraints & Preferences -- [Any constraints, preferences, or requirements mentioned by user] -- [Or "(none)" if none were mentioned] - -## Progress -### Done -- [x] [Completed tasks/changes] - -### In Progress -- [ ] [Current work] - -### Blocked -- [Issues preventing progress, if any] - -## Key Decisions -- **[Decision]**: [Brief rationale] - -## Next Steps -1. [Ordered list of what should happen next] - -## Critical Context -- [Any data, examples, or references needed to continue] -- [Or "(none)" if not applicable] - -Keep each section concise. Preserve exact file paths, function names, and error messages.`,Vps=`Update the existing structured summary with new information. RULES: -- PRESERVE all existing information from the previous summary -- ADD new progress, decisions, and context from the new messages -- UPDATE the Progress section: move items from "In Progress" to "Done" when completed -- UPDATE "Next Steps" based on what was accomplished -- PRESERVE exact file paths, function names, and error messages -- If something is no longer relevant, you may remove it +`))}return f=>{try{return m(f)}catch(g){throw g.stack+=` + ============= +${h}`,g}}}},"./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/formatters.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.statements=s.statement=s.smart=s.program=s.expression=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js");let{assertExpressionStatement:c}=a;function u(d){return{code:m=>`/* @babel/template */; +${m}`,validate:()=>{},unwrap:m=>d(m.program.body.slice(1))}}s.smart=u(d=>d.length>1?d:d[0]),s.statements=u(d=>d),s.statement=u(d=>{if(d.length===0)throw new Error("Found nothing to return.");if(d.length>1)throw new Error("Found multiple statements but wanted one");return d[0]});let l=s.expression={code:d=>`( +${d} +)`,validate:d=>{if(d.program.body.length>1)throw new Error("Found multiple statements but wanted one");if(l.unwrap(d).start===0)throw new Error("Parse result included parens.")},unwrap:({program:d})=>{let[m]=d.body;return c(m),m.expression}};s.program={code:d=>d,validate:()=>{},unwrap:d=>d.program}},"./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/index.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.statements=s.statement=s.smart=s.program=s.expression=s.default=void 0;var a=o("./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/formatters.js"),c=o("./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/builder.js");let u=s.smart=(0,c.default)(a.smart),l=s.statement=(0,c.default)(a.statement),d=s.statements=(0,c.default)(a.statements),m=s.expression=(0,c.default)(a.expression),h=s.program=(0,c.default)(a.program);s.default=Object.assign(u.bind(void 0),{smart:u,statement:l,statements:d,expression:m,program:h,ast:u.ast})},"./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/literal.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(l,d,m){let{metadata:h,names:f}=(function(g,A,y){let E="BABEL_TPL$",_=A.join("");do E="$$"+E;while(_.includes(E));let{names:S,code:C}=(function(w,k){let N=[],O=w[0];for(let W=1;W{let A={};return g.forEach((y,E)=>{A[f[E]]=y}),y=>{let E=(0,a.normalizeReplacements)(y);return E&&Object.keys(E).forEach(_=>{if(hasOwnProperty.call(A,_))throw new Error("Unexpected replacement overlap.")}),l.unwrap((0,u.default)(h,E?Object.assign(E,A):A))}}};var a=o("./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/options.js"),c=o("./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/parse.js"),u=o("./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/populate.js")},"./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/options.js"(i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.merge=function(a,c){let{placeholderWhitelist:u=a.placeholderWhitelist,placeholderPattern:l=a.placeholderPattern,preserveComments:d=a.preserveComments,syntacticPlaceholders:m=a.syntacticPlaceholders}=c;return{parser:Object.assign({},a.parser,c.parser),placeholderWhitelist:u,placeholderPattern:l,preserveComments:d,syntacticPlaceholders:m}},s.normalizeReplacements=function(a){if(Array.isArray(a))return a.reduce((c,u,l)=>(c["$"+l]=u,c),{});if(typeof a=="object"||a==null)return a||void 0;throw new Error("Template replacements must be an array, object, null, or undefined")},s.validate=function(a){if(a!=null&&typeof a!="object")throw new Error("Unknown template options.");let c=a||{},{placeholderWhitelist:u,placeholderPattern:l,preserveComments:d,syntacticPlaceholders:m}=c,h=(function(f,g){if(f==null)return{};var A={};for(var y in f)if({}.hasOwnProperty.call(f,y)){if(g.indexOf(y)!==-1)continue;A[y]=f[y]}return A})(c,o);if(u!=null&&!(u instanceof Set))throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined");if(l!=null&&!(l instanceof RegExp)&&l!==!1)throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined");if(d!=null&&typeof d!="boolean")throw new Error("'.preserveComments' must be a boolean, null, or undefined");if(m!=null&&typeof m!="boolean")throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined");if(m===!0&&(u!=null||l!=null))throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible with '.syntacticPlaceholders: true'");return{parser:h,placeholderWhitelist:u||void 0,placeholderPattern:l??void 0,preserveComments:d??void 0,syntacticPlaceholders:m??void 0}};let o=["placeholderWhitelist","placeholderPattern","preserveComments","syntacticPlaceholders"]},"./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/parse.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(w,k,N){let{placeholderWhitelist:O,placeholderPattern:W,preserveComments:$,syntacticPlaceholders:G}=N,q=(function(Y,z,j){let se=(z.plugins||[]).slice();j!==!1&&se.push("placeholders"),z=Object.assign({allowAwaitOutsideFunction:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowYieldOutsideFunction:!0,sourceType:"module"},z,{plugins:se});try{return(0,c.parse)(Y,z)}catch(Ae){let De=Ae.loc;throw De&&(Ae.message+=` +`+(0,u.codeFrameColumns)(Y,{start:De}),Ae.code="BABEL_TEMPLATE_PARSE_ERROR"),Ae}})(k,N.parser,G);_(q,{preserveComments:$}),w.validate(q);let ce={syntactic:{placeholders:[],placeholderNames:new Set},legacy:{placeholders:[],placeholderNames:new Set},placeholderWhitelist:O,placeholderPattern:W,syntacticPlaceholders:G};return S(q,I,ce),Object.assign({ast:q},ce.syntactic.placeholders.length?ce.syntactic:ce.legacy)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"),c=o("./node_modules/.pnpm/@babel+parser@7.29.3/node_modules/@babel/parser/lib/index.js"),u=o("./stubs/babel-codeframe.mjs");let{isCallExpression:l,isExpressionStatement:d,isFunction:m,isIdentifier:h,isJSXIdentifier:f,isNewExpression:g,isPlaceholder:A,isStatement:y,isStringLiteral:E,removePropertiesDeep:_,traverse:S}=a,C=/^[_$A-Z0-9]+$/;function I(w,k,N){var O;let W,$=N.syntactic.placeholders.length>0;if(A(w)){if(N.syntacticPlaceholders===!1)throw new Error("%%foo%%-style placeholders can't be used when '.syntacticPlaceholders' is false.");W=w.name.name,$=!0}else{if($||N.syntacticPlaceholders)return;if(h(w)||f(w))W=w.name;else{if(!E(w))return;W=w.value}}if($&&(N.placeholderPattern!=null||N.placeholderWhitelist!=null))throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible with '.syntacticPlaceholders: true'");if(!($||N.placeholderPattern!==!1&&(N.placeholderPattern||C).test(W)||(O=N.placeholderWhitelist)!=null&&O.has(W)))return;k=k.slice();let{node:G,key:q}=k[k.length-1],ce;E(w)||A(w,{expectedNode:"StringLiteral"})?ce="string":g(G)&&q==="arguments"||l(G)&&q==="arguments"||m(G)&&q==="params"?ce="param":d(G)&&!A(w)?(ce="statement",k=k.slice(0,-1)):ce=y(w)&&A(w)?"statement":"other";let{placeholders:Y,placeholderNames:z}=$?N.syntactic:N.legacy;Y.push({name:W,type:ce,resolve:j=>(function(se,Ae){let De=se;for(let ie=0;ie{if(!hasOwnProperty.call(E,S.name)){let C=S.name;throw new Error(`Error: No substitution given for "${C}". If this is not meant to be a + placeholder you may want to consider passing one of the following options to @babel/template: + - { placeholderPattern: false, placeholderWhitelist: new Set(['${C}'])} + - { placeholderPattern: /^${C}$/ }`)}}),Object.keys(E).forEach(S=>{if(!y.placeholderNames.has(S))throw new Error(`Unknown substitution "${S}" given`)})),y.placeholders.slice().reverse().forEach(S=>{try{var C;(function(I,w,k){I.isDuplicate&&(Array.isArray(k)?k=k.map(G=>u(G)):typeof k=="object"&&(k=u(k)));let{parent:N,key:O,index:W}=I.resolve(w);if(I.type==="string"){if(typeof k=="string"&&(k=g(k)),!k||!f(k))throw new Error("Expected string substitution")}else if(I.type==="statement")W===void 0?k?Array.isArray(k)?k=c(k):typeof k=="string"?k=d(m(k)):h(k)||(k=d(k)):k=l():k&&!Array.isArray(k)&&(typeof k=="string"&&(k=m(k)),h(k)||(k=d(k)));else if(I.type==="param"){if(typeof k=="string"&&(k=m(k)),W===void 0)throw new Error("Assertion failure.")}else if(typeof k=="string"&&(k=m(k)),Array.isArray(k))throw new Error("Cannot replace single expression with an array.");function $(G,q,ce){let Y=G[q];G[q]=ce,Y.type!=="Identifier"&&Y.type!=="Placeholder"||(Y.typeAnnotation&&(ce.typeAnnotation=Y.typeAnnotation),Y.optional&&(ce.optional=Y.optional),Y.decorators&&(ce.decorators=Y.decorators))}if(W===void 0)A(N,O,k),$(N,O,k);else{let G=N[O].slice();I.type==="statement"||I.type==="param"?k==null?G.splice(W,1):Array.isArray(k)?G.splice(W,1,...k):$(G,W,k):$(G,W,k),A(N,O,G),N[O]=G}})(S,_,(C=E&&E[S.name])!=null?C:null)}catch(I){throw I.message=`@babel/template placeholder "${S.name}": ${I.message}`,I}}),_};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js");let{blockStatement:c,cloneNode:u,emptyStatement:l,expressionStatement:d,identifier:m,isStatement:h,isStringLiteral:f,stringLiteral:g,validate:A}=a},"./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/string.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(l,d,m){let h;return d=l.code(d),f=>{let g=(0,a.normalizeReplacements)(f);return h||(h=(0,c.default)(l,d,m)),l.unwrap((0,u.default)(h,g))}};var a=o("./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/options.js"),c=o("./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/parse.js"),u=o("./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/populate.js")},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/cache.js"(i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.clear=function(){c(),u()},s.clearPath=c,s.clearScope=u,s.getCachedPaths=function(l){let{parent:d,parentPath:m}=l;return o.get(d)},s.getOrCreateCachedPaths=function(l,d){let m=o.get(l);return m||o.set(l,m=new Map),m},s.scope=s.path=void 0;let o=s.path=new WeakMap,a=s.scope=new WeakMap;function c(){s.path=o=new WeakMap}function u(){s.scope=a=new WeakMap}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/context.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var a=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/index.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"),u=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/context.js"),l=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/hub.js");let{VISITOR_KEYS:d}=c;s.default=class{constructor(m,h,f,g){this.queue=null,this.priorityQueue=null,this.parentPath=g,this.scope=m,this.state=f,this.opts=h}shouldVisit(m){let h=this.opts;if(h.enter||h.exit||h[m.type])return!0;let f=d[m.type];if(f==null||!f.length)return!1;for(let g of f)if(m[g])return!0;return!1}create(m,h,f,g){let{parentPath:A}=this,y=A==null?m.type==="Program"||m.type==="File"?new l.default:void 0:A.hub;return a.default.get({parentPath:A,parent:m,container:h,key:f,listKey:g,hub:y})}maybeQueue(m,h){this.queue&&(h?this.queue.push(m):this.priorityQueue.push(m))}visitMultiple(m,h,f){if(m.length===0)return!1;let g=[];for(let A=0;A{let y=[];do y.unshift(A);while((A=A.parentPath)&&A!==this);return y.lengthf.indexOf(A.parentKey)&&(h=A)}return h})},s.getFunctionParent=function(){return this.findParent(u=>u.isFunction())},s.getStatementParent=function(){let u=this;do{if(!u.parentPath||Array.isArray(u.container)&&u.isStatement())break;u=u.parentPath}while(u);if(u&&(u.isProgram()||u.isFile()))throw new Error("File/Program node, we can't possibly find a statement parent to this");return u},s.inType=function(...u){let l=this;for(;l;){if(u.includes(l.node.type))return!0;l=l.parentPath}return!1},s.isAncestor=function(u){return u.isDescendant(this)},s.isDescendant=function(u){return!!this.findParent(l=>l===u)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js");let{VISITOR_KEYS:c}=a},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/comments.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.addComment=function(d,m,h){c(this.node,d,m,h)},s.addComments=function(d,m){u(this.node,d,m)},s.shareCommentsWithSiblings=function(){if(typeof this.key=="string")return;let d=this.node;if(!d)return;let m=d.trailingComments,h=d.leadingComments;if(!m&&!h)return;let f=this.getSibling(this.key-1),g=this.getSibling(this.key+1),A=!!f.node,y=!!g.node;A&&(h&&f.addComments("trailing",l(h,f.node.trailingComments)),m&&!y&&f.addComments("trailing",m)),y&&(m&&g.addComments("leading",l(m,g.node.leadingComments)),h&&!A&&g.addComments("leading",h))};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js");let{addComment:c,addComments:u}=a;function l(d,m){if(m==null||!m.length)return d;let h=new Set(m);return d.filter(f=>!h.has(f))}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/context.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s._call=m,s._forceSetScope=function(){var S;let C,I=this.parentPath;for(((this.key==="key"||this.listKey==="decorators")&&I.isMethod()||this.key==="discriminant"&&I.isSwitchStatement())&&(I=I.parentPath);I&&!C;)C=I.scope,I=I.parentPath;this.scope=this.getScope(C),(S=this.scope)==null||S.init()},s._getQueueContexts=function(){let S=this,C=this.contexts;for(;!C.length&&(S=S.parentPath,S);)C=S.contexts;return C},s._resyncKey=y,s._resyncList=E,s._resyncParent=A,s._resyncRemoved=function(){this.key!=null&&this.container&&this.container[this.key]===this.node||u._markRemoved.call(this)},s.call=d,s.isDenylisted=h,s.popContext=function(){this.contexts.pop(),this.contexts.length>0?this.setContext(this.contexts[this.contexts.length-1]):this.setContext(void 0)},s.pushContext=function(S){this.contexts.push(S),this.setContext(S)},s.requeue=function(S=this){if(S.removed)return;let C=this.contexts;for(let I of C)I.maybeQueue(S)},s.requeueComputedKeyAndDecorators=function(){let{context:S,node:C}=this;if(!l.isPrivate(C)&&C.computed&&S.maybeQueue(this.get("key")),C.decorators)for(let I of this.get("decorators"))S.maybeQueue(I)},s.resync=function(){this.removed||(A.call(this),E.call(this),y.call(this))},s.setContext=function(S){return this.skipKeys!=null&&(this.skipKeys={}),this._traverseFlags=0,S&&(this.context=S,this.state=S.state,this.opts=S.opts),g.call(this),this},s.setKey=_,s.setScope=g,s.setup=function(S,C,I,w){this.listKey=I,this.container=C,this.parentPath=S||this.parentPath,_.call(this,w)},s.skip=function(){this.shouldSkip=!0},s.skipKey=function(S){this.skipKeys==null&&(this.skipKeys={}),this.skipKeys[S]=!0},s.stop=function(){this._traverseFlags|=c.SHOULD_SKIP|c.SHOULD_STOP},s.visit=function(){var S,C;if(!this.node||this.isDenylisted()||(S=(C=this.opts).shouldSkip)!=null&&S.call(C,this))return!1;let I=this.context;return this.shouldSkip||d.call(this,"enter")?(this.debug("Skip..."),this.shouldStop):(f(this,I),this.debug("Recursing into..."),this.shouldStop=(0,a.traverseNode)(this.node,this.opts,this.scope,this.state,this,this.skipKeys),f(this,I),d.call(this,"exit"),this.shouldStop)};var a=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/traverse-node.js"),c=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/index.js"),u=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/removal.js"),l=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js");function d(S){let C=this.opts;return this.debug(S),!(!this.node||!m.call(this,C[S]))||!!this.node&&m.call(this,(I=C[this.node.type])==null?void 0:I[S]);var I}function m(S){if(!S)return!1;for(let C of S){if(!C)continue;let I=this.node;if(!I)return!0;let w=C.call(this.state,this,this.state);if(w&&typeof w=="object"&&typeof w.then=="function")throw new Error("You appear to be using a plugin with an async traversal visitor, which your current version of Babel does not support. If you're using a published plugin, you may need to upgrade your @babel/core version.");if(w)throw new Error(`Unexpected return value from visitor method ${C}`);if(this.node!==I||this._traverseFlags>0)return!0}return!1}function h(){var S;let C=(S=this.opts.denylist)!=null?S:this.opts.blacklist;return C?.includes(this.node.type)}function f(S,C){S.context!==C&&(S.context=C,S.state=C.state,S.opts=C.opts)}function g(){var S,C;if((S=this.opts)!=null&&S.noScope)return;let I,w=this.parentPath;for(((this.key==="key"||this.listKey==="decorators")&&w.isMethod()||this.key==="discriminant"&&w.isSwitchStatement())&&(w=w.parentPath);w&&!I;){var k;if((k=w.opts)!=null&&k.noScope)return;I=w.scope,w=w.parentPath}this.scope=this.getScope(I),(C=this.scope)==null||C.init()}function A(){this.parentPath&&(this.parent=this.parentPath.node)}function y(){if(this.container&&this.node!==this.container[this.key]){if(Array.isArray(this.container)){for(let S=0;S($e=arguments[0])==null?void 0:$e.specCompliant)()}={}){if(!this.isArrowFunctionExpression())throw this.buildCodeFrameError("Cannot convert non-arrow function to a function expression.");let $e=this;var He;X||($e=(He=$e.ensureFunctionName(!1))!=null?He:$e);let{thisBinding:mt,fnPath:st}=me($e,X,Te,_e);if(st.ensureBlock(),(function(ze,rt){ze.node.type=rt})(st,"FunctionExpression"),!X){let ze=mt?null:st.scope.generateUidIdentifier("arrowCheckId");return ze&&st.parentPath.scope.push({id:ze,init:O([])}),st.get("body").unshiftContainer("body",y(g(this.hub.addHelper("newArrowCheck"),[z(),E(ze?ze.name:mt)]))),st.replaceWith(g(w(st.node,E("bind")),[ze?E(ze.name):z()])),st.get("callee.object")}return st},s.ensureBlock=function(){let Te=this.get("body"),_e=Te.node;if(Array.isArray(Te))throw new Error("Can't convert array path to a block statement");if(!_e)throw new Error("Can't convert node without a body");if(Te.isBlockStatement())return _e;let X=[],$e,He,mt="body";Te.isStatement()?(He="body",$e=0,X.push(Te.node)):(mt+=".body.0",this.isFunction()?($e="argument",X.push($(Te.node))):($e="expression",X.push(y(Te.node)))),this.node.body=f(X);let st=this.get(mt);return l.setup.call(Te,st,He?st.node[He]:st.node,He,$e),this.node},s.ensureFunctionName=function(Te){if(this.node.id)return this;let _e=ie(this.node,this.parent);if(_e==null)return this;let{name:X}=_e;if(!Te&&/[\uD800-\uDFFF]/.test(X)||X.startsWith("get ")||X.startsWith("set "))return null;X=Ae(X.replace(/[/ ]/g,"_"));let $e=E(X);ee($e,_e.originalNode);let He={needsRename:!1,name:X},{scope:mt}=this,st=mt.getOwnBinding(X);if(st?st.kind==="param"&&(He.needsRename=!0):(mt.parent.hasBinding(X)||mt.hasGlobal(X))&&this.traverse(be,He),!He.needsRename)return this.node.id=$e,mt.getProgramParent().references[$e.name]=!0,this;if(mt.hasBinding($e.name)&&!mt.hasGlobal($e.name))return mt.rename($e.name),this.node.id=$e,mt.getProgramParent().references[$e.name]=!0,this;if(!De(this.node))return null;let ze=mt.generateUidIdentifier($e.name),rt=[];for(let on=0,Ft=(function(Qt){let Mt=Qt.params.findIndex(Xe=>Pe(Xe)||we(Xe));return Mt===-1?Qt.params.length:Mt})(this.node);on0)throw new Error("It doesn't make sense to split exported specifiers.");let Te=this.get("declaration");if(this.isExportDefaultDeclaration()){let He=Te.isFunctionDeclaration()||Te.isClassDeclaration(),mt=Te.isFunctionExpression()||Te.isClassExpression(),st=Te.isScope()?Te.scope.parent:Te.scope,ze=Te.node.id,rt=!1;ze?mt&&st.hasBinding(ze.name)&&(rt=!0,ze=st.generateUidIdentifier(ze.name)):(rt=!0,ze=st.generateUidIdentifier("default"),(He||mt)&&(Te.node.id=oe(ze)));let Ct=He?Te.node:ne("var",[Z(oe(ze),Te.node)]),on=te(null,[V(oe(ze),E("default"))]);return this.insertAfter(on),this.replaceWith(Ct),rt&&st.registerDeclaration(this),this}if(this.get("specifiers").length>0)throw new Error("It doesn't make sense to split exported specifiers.");let _e=Te.getOuterBindingIdentifiers(),X=Object.keys(_e).map(He=>V(E(He),E(He))),$e=te(null,X);return this.insertAfter($e),this.replaceWith(Te.node),this},s.toComputedKey=function(){let Te;if(this.isMemberExpression())Te=this.node.property;else{if(!this.isProperty()&&!this.isMethod())throw new ReferenceError("todo");Te=this.node.key}return this.node.computed||_(Te)&&(Te=ce(Te.name)),Te},s.unwrapFunctionEnvironment=function(){if(!this.isArrowFunctionExpression()&&!this.isFunctionExpression()&&!this.isFunctionDeclaration())throw this.buildCodeFrameError("Can only unwrap the environment of a function.");me(this)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"),c=o("./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/index.js"),u=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/visitors.js"),l=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/context.js");let{arrowFunctionExpression:d,assignmentExpression:m,binaryExpression:h,blockStatement:f,callExpression:g,conditionalExpression:A,expressionStatement:y,identifier:E,isIdentifier:_,jsxIdentifier:S,logicalExpression:C,LOGICAL_OPERATORS:I,memberExpression:w,metaProperty:k,numericLiteral:N,objectExpression:O,restElement:W,returnStatement:$,sequenceExpression:G,spreadElement:q,stringLiteral:ce,super:Y,thisExpression:z,toExpression:j,unaryExpression:se,toBindingIdentifierName:Ae,isFunction:De,isAssignmentPattern:Pe,isRestElement:we,getFunctionName:ie,cloneNode:oe,variableDeclaration:ne,variableDeclarator:Z,exportNamedDeclaration:te,exportSpecifier:V,inherits:ee}=a;s.arrowFunctionToShadowed=function(){this.isArrowFunctionExpression()&&this.arrowFunctionToExpression()};let ae=(0,u.environmentVisitor)({CallExpression(Te,{allSuperCalls:_e}){Te.get("callee").isSuper()&&_e.push(Te)}});function me(Te,_e=!0,X=!0,$e=!0){let He,mt=Te.findParent(Mt=>Mt.isArrowFunctionExpression()?(He!=null||(He=Mt),!1):Mt.isFunction()||Mt.isProgram()||Mt.isClassProperty({static:!1})||Mt.isClassPrivateProperty({static:!1})),st=mt.isClassMethod({kind:"constructor"});if(mt.isClassProperty()||mt.isClassPrivateProperty())if(He)mt=He;else{if(!X)throw Te.buildCodeFrameError("Unable to transform arrow inside class property");Te.replaceWith(g(d([],j(Te.node)),[])),mt=Te.get("callee"),Te=mt.get("body")}let{thisPaths:ze,argumentsPaths:rt,newTargetPaths:Ct,superProps:on,superCalls:Ft}=(function(Mt){let Xe=[],Me=[],Je=[],yt=[],Vt=[];return Mt.traverse(Se,{thisPaths:Xe,argumentsPaths:Me,newTargetPaths:Je,superProps:yt,superCalls:Vt}),{thisPaths:Xe,argumentsPaths:Me,newTargetPaths:Je,superProps:yt,superCalls:Vt}})(Te);if(st&&Ft.length>0){if(!X)throw Ft[0].buildCodeFrameError("When using '@babel/plugin-transform-arrow-functions', it's not possible to compile `super()` in an arrow function without compiling classes.\nPlease add '@babel/plugin-transform-classes' to your Babel configuration.");if(!$e)throw Ft[0].buildCodeFrameError("When using '@babel/plugin-transform-parameters', it's not possible to compile `super()` in an arrow function with default or rest parameters without compiling classes.\nPlease add '@babel/plugin-transform-classes' to your Babel configuration.");let Mt=[];mt.traverse(ae,{allSuperCalls:Mt});let Xe=(function(Me){return ye(Me,"supercall",()=>{let Je=Me.scope.generateUidIdentifier("args");return d([W(Je)],g(Y(),[q(E(Je.name))]))})})(mt);Mt.forEach(Me=>{let Je=E(Xe);Je.loc=Me.node.callee.loc,Me.get("callee").replaceWith(Je)})}if(rt.length>0){let Mt=ye(mt,"arguments",()=>{let Xe=()=>E("arguments");return mt.scope.path.isProgram()?A(h("===",se("typeof",Xe()),ce("undefined")),mt.scope.buildUndefinedNode(),Xe()):Xe()});rt.forEach(Xe=>{let Me=E(Mt);Me.loc=Xe.node.loc,Xe.replaceWith(Me)})}if(Ct.length>0){let Mt=ye(mt,"newtarget",()=>k(E("new"),E("target")));Ct.forEach(Xe=>{let Me=E(Mt);Me.loc=Xe.node.loc,Xe.replaceWith(Me)})}if(on.length>0){if(!X)throw on[0].buildCodeFrameError("When using '@babel/plugin-transform-arrow-functions', it's not possible to compile `super.prop` in an arrow function without compiling classes.\nPlease add '@babel/plugin-transform-classes' to your Babel configuration.");on.reduce((Mt,Xe)=>Mt.concat((function(Me){if(Me.parentPath.isAssignmentExpression()&&Me.parentPath.node.operator!=="="){let yt=Me.parentPath,Vt=yt.node.operator.slice(0,-1),dn=yt.node.right,An=(function(Fn){return I.includes(Fn)})(Vt);if(Me.node.computed){let Fn=Me.scope.generateDeclaredUidIdentifier("tmp"),{object:qe,property:ht}=Me.node;yt.get("left").replaceWith(w(qe,m("=",Fn,ht),!0)),yt.get("right").replaceWith(Je(An?"=":Vt,w(qe,E(Fn.name),!0),dn))}else{let Fn=Me.node.object,qe=Me.node.property;yt.get("left").replaceWith(w(Fn,qe)),yt.get("right").replaceWith(Je(An?"=":Vt,w(Fn,E(qe.name)),dn))}return An?yt.replaceWith(C(Vt,yt.node.left,yt.node.right)):yt.node.operator="=",[yt.get("left"),yt.get("right").get("left")]}if(Me.parentPath.isUpdateExpression()){let yt=Me.parentPath,Vt=Me.scope.generateDeclaredUidIdentifier("tmp"),dn=Me.node.computed?Me.scope.generateDeclaredUidIdentifier("prop"):null,An=[m("=",Vt,w(Me.node.object,dn?m("=",dn,Me.node.property):Me.node.property,Me.node.computed)),m("=",w(Me.node.object,dn?E(dn.name):Me.node.property,Me.node.computed),h(Me.parentPath.node.operator[0],E(Vt.name),N(1)))];return Me.parentPath.node.prefix||An.push(E(Vt.name)),yt.replaceWith(G(An)),[yt.get("expressions.0.right"),yt.get("expressions.1.left")]}return[Me];function Je(yt,Vt,dn){return yt==="="?m("=",Vt,dn):h(yt,Vt,dn)}})(Xe)),[]).forEach(Mt=>{let Xe=Mt.node.computed?"":Mt.get("property").node.name,Me=Mt.parentPath,Je=Me.isAssignmentExpression({left:Mt.node}),yt=Me.isCallExpression({callee:Mt.node}),Vt=Me.isTaggedTemplateExpression({tag:Mt.node}),dn=(function(qe,ht,Zt){return ye(qe,`superprop_${ht?"set":"get"}:${Zt||""}`,()=>{let dt=[],gt;if(Zt)gt=w(Y(),E(Zt));else{let tt=qe.scope.generateUidIdentifier("prop");dt.unshift(tt),gt=w(Y(),E(tt.name),!0)}if(ht){let tt=qe.scope.generateUidIdentifier("value");dt.push(tt),gt=m("=",gt,E(tt.name))}return d(dt,gt)})})(mt,Je,Xe),An=[];if(Mt.node.computed&&An.push(Mt.get("property").node),Je){let qe=Me.node.right;An.push(qe)}let Fn=g(E(dn),An);yt?(Me.unshiftContainer("arguments",z()),Mt.replaceWith(w(Fn,E("call"))),ze.push(Me.get("arguments.0"))):Je?Me.replaceWith(Fn):Vt?(Mt.replaceWith(g(w(Fn,E("bind"),!1),[z()])),ze.push(Mt.get("arguments.0"))):Mt.replaceWith(Fn)})}let Qt;return(ze.length>0||!_e)&&(Qt=(function(Mt,Xe){return ye(Mt,"this",Me=>{if(!Xe||!ge(Mt))return z();Mt.traverse(ue,{supers:new WeakSet,thisBinding:Me})})})(mt,st),(_e||st&&ge(mt))&&(ze.forEach(Mt=>{let Xe=Mt.isJSX()?S(Qt):E(Qt);Xe.loc=Mt.node.loc,Mt.replaceWith(Xe)}),_e||(Qt=null))),{thisBinding:Qt,fnPath:Te}}function ge(Te){return Te.isClassMethod()&&!!Te.parentPath.parentPath.node.superClass}let ue=(0,u.environmentVisitor)({CallExpression(Te,{supers:_e,thisBinding:X}){Te.get("callee").isSuper()&&(_e.has(Te.node)||(_e.add(Te.node),Te.replaceWithMultiple([Te.node,m("=",E(X),E("this"))])))}});function ye(Te,_e,X){let $e="binding:"+_e,He=Te.getData($e);if(!He){let mt=Te.scope.generateUidIdentifier(_e);He=mt.name,Te.setData($e,He),Te.scope.push({id:mt,init:X(He)})}return He}let Se=(0,u.environmentVisitor)({ThisExpression(Te,{thisPaths:_e}){_e.push(Te)},JSXIdentifier(Te,{thisPaths:_e}){Te.node.name==="this"&&(Te.parentPath.isJSXMemberExpression({object:Te.node})||Te.parentPath.isJSXOpeningElement({name:Te.node}))&&_e.push(Te)},CallExpression(Te,{superCalls:_e}){Te.get("callee").isSuper()&&_e.push(Te)},MemberExpression(Te,{superProps:_e}){Te.get("object").isSuper()&&_e.push(Te)},Identifier(Te,{argumentsPaths:_e}){if(!Te.isReferencedIdentifier({name:"arguments"}))return;let X=Te.scope;do{if(X.hasOwnBinding("arguments"))return void X.rename("arguments");if(X.path.isFunction()&&!X.path.isArrowFunctionExpression())break}while(X=X.parent);_e.push(Te)},MetaProperty(Te,{newTargetPaths:_e}){Te.get("meta").isIdentifier({name:"new"})&&Te.get("property").isIdentifier({name:"target"})&&_e.push(Te)}}),be={"ReferencedIdentifier|BindingIdentifier"(Te,_e){Te.node.name===_e.name&&(_e.needsRename=!0,Te.stop())},Scope(Te,_e){Te.scope.hasOwnBinding(_e.name)&&Te.skip()}}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/evaluation.js"(i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.evaluate=function(){let f={confident:!0,deoptPath:null,seen:new Map},g=m(this,f);return f.confident||(g=void 0),{confident:f.confident,deopt:f.deoptPath,value:g}},s.evaluateTruthy=function(){let f=this.evaluate();if(f.confident)return!!f.value};let o=["Number","String","Math"],a=["isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent",null,null],c=["random"];function u(f){return o.includes(f)}function l(f,g){g.confident&&(g.deoptPath=f,g.confident=!1)}let d=new Map([["undefined",void 0],["Infinity",1/0],["NaN",NaN]]);function m(f,g){let{node:A}=f,{seen:y}=g;if(y.has(A)){let E=y.get(A);return E.resolved?E.value:void l(f,g)}{let E={resolved:!1};y.set(A,E);let _=(function(S,C){if(C.confident){if(S.isSequenceExpression()){let w=S.get("expressions");return m(w[w.length-1],C)}if(S.isStringLiteral()||S.isNumericLiteral()||S.isBooleanLiteral())return S.node.value;if(S.isNullLiteral())return null;if(S.isTemplateLiteral())return h(S,S.node.quasis,C);if(S.isTaggedTemplateExpression()&&S.get("tag").isMemberExpression()){let w=S.get("tag.object"),{node:{name:k}}=w,N=S.get("tag.property");if(w.isIdentifier()&&k==="String"&&!S.scope.getBinding(k)&&N.isIdentifier()&&N.node.name==="raw")return h(S,S.node.quasi.quasis,C,!0)}if(S.isConditionalExpression()){let w=m(S.get("test"),C);return C.confident?m(w?S.get("consequent"):S.get("alternate"),C):void 0}if(S.isExpressionWrapper())return m(S.get("expression"),C);if(S.isMemberExpression()&&!S.parentPath.isCallExpression({callee:S.node})){let w=S.get("property"),k=S.get("object");if(k.isLiteral()){let N=k.node.value,O=typeof N,W=null;if(S.node.computed){if(W=m(w,C),!C.confident)return}else w.isIdentifier()&&(W=w.node.name);if(!(O!=="number"&&O!=="string"||W==null||typeof W!="number"&&typeof W!="string"))return N[W]}}if(S.isReferencedIdentifier()){let w=S.scope.getBinding(S.node.name);if(w){if(w.constantViolations.length>0||S.node.start1?void l(O,C):W}if(S.isUnaryExpression({prefix:!0})){if(S.node.operator==="void")return;let w=S.get("argument");if(S.node.operator==="typeof"&&(w.isFunction()||w.isClass()))return"function";let k=m(w,C);if(!C.confident)return;switch(S.node.operator){case"!":return!k;case"+":return+k;case"-":return-k;case"~":return~k;case"typeof":return typeof k}}if(S.isArrayExpression()){let w=[],k=S.get("elements");for(let N of k){let O=N.evaluate();if(!O.confident)return void l(O.deopt,C);w.push(O.value)}return w}if(S.isObjectExpression()){let w={},k=S.get("properties");for(let N of k){if(N.isObjectMethod()||N.isSpreadElement())return void l(N,C);let O=N.get("key"),W;if(N.node.computed){if(W=O.evaluate(),!W.confident)return void l(W.deopt,C);W=W.value}else W=O.isIdentifier()?O.node.name:O.node.value;let $=N.get("value").evaluate();if(!$.confident)return void l($.deopt,C);$=$.value,w[W]=$}return w}if(S.isLogicalExpression()){let w=C.confident,k=m(S.get("left"),C),N=C.confident;C.confident=w;let O=m(S.get("right"),C),W=C.confident;switch(S.node.operator){case"||":return C.confident=N&&(!!k||W),C.confident?k||O:void 0;case"&&":return C.confident=N&&(!k||W),C.confident?k&&O:void 0;case"??":return C.confident=N&&(k!=null||W),C.confident?k??O:void 0}}if(S.isBinaryExpression()){let w=m(S.get("left"),C);if(!C.confident)return;let k=m(S.get("right"),C);if(!C.confident)return;switch(S.node.operator){case"-":return w-k;case"+":return w+k;case"/":return w/k;case"*":return w*k;case"%":return w%k;case"**":return Math.pow(w,k);case"<":return w":return w>k;case"<=":return w<=k;case">=":return w>=k;case"==":return w==k;case"!=":return w!=k;case"===":return w===k;case"!==":return w!==k;case"|":return w|k;case"&":return w&k;case"^":return w^k;case"<<":return w<>":return w>>k;case">>>":return w>>>k}}if(S.isCallExpression()){let w=S.get("callee"),k,N;if(w.isIdentifier()&&!S.scope.getBinding(w.node.name)&&(u(w.node.name)||(function(O){return a.includes(O)})(w.node.name))&&(N=global[w.node.name]),w.isMemberExpression()){let O=w.get("object"),W=w.get("property");if(O.isIdentifier()&&W.isIdentifier()&&u(O.node.name)&&!(function($){return c.includes($)})(W.node.name)){k=global[O.node.name];let $=W.node.name;hasOwnProperty.call(k,$)&&(N=k[$])}if(O.isLiteral()&&W.isIdentifier()){let $=typeof O.node.value;$!=="string"&&$!=="number"||(k=O.node.value,N=k[W.node.name])}}if(N){let O=S.get("arguments").map(W=>m(W,C));return C.confident?N.apply(k,O):void 0}}l(S,C)}})(f,g);return g.confident&&(E.resolved=!0,E.value=_),_}}function h(f,g,A,y=!1){let E="",_=0,S=f.isTemplateLiteral()?f.get("expressions"):f.get("quasi.expressions");for(let C of g){if(!A.confident)break;E+=y?C.value.raw:C.value.cooked;let I=S[_++];I&&(E+=String(m(I,A)))}if(A.confident)return E}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/family.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s._getKey=_,s._getPattern=S,s.get=function(C,I=!0){I===!0&&(I=this.context);let w=C.split(".");return w.length===1?_.call(this,C,I):S.call(this,w,I)},s.getAllNextSiblings=function(){let C=this.key,I=this.getSibling(++C),w=[];for(;I.node;)w.push(I),I=this.getSibling(++C);return w},s.getAllPrevSiblings=function(){let C=this.key,I=this.getSibling(--C),w=[];for(;I.node;)w.push(I),I=this.getSibling(--C);return w},s.getAssignmentIdentifiers=function(){return u(this.node)},s.getBindingIdentifierPaths=function(C=!1,I=!1){let w=[this],k=Object.create(null);for(;w.length;){let N=w.shift();if(!N||!N.node)continue;let O=l.keys[N.node.type];if(N.isIdentifier())C?(k[N.node.name]=k[N.node.name]||[]).push(N):k[N.node.name]=N;else{if(N.isExportDeclaration()){let W=N.get("declaration");W.isDeclaration()&&w.push(W);continue}if(I){if(N.isFunctionDeclaration()){w.push(N.get("id"));continue}if(N.isFunctionExpression())continue}if(O)for(let W=0;WI.path)},s.getNextSibling=function(){return this.getSibling(this.key+1)},s.getOpposite=function(){return this.key==="left"?this.getSibling("right"):this.key==="right"?this.getSibling("left"):null},s.getOuterBindingIdentifierPaths=function(C=!1){return this.getBindingIdentifierPaths(C,!0)},s.getOuterBindingIdentifiers=function(C){return d(this.node,C)},s.getPrevSibling=function(){return this.getSibling(this.key-1)},s.getSibling=function(C){return a.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:C}).setContext(this.context)};var a=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/index.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js");let{getAssignmentIdentifiers:u,getBindingIdentifiers:l,getOuterBindingIdentifiers:d,numericLiteral:m,unaryExpression:h}=c;function f(C,I,w){return C&&I.push(...E(C,w)),I}function g(C){C.forEach(I=>{I.type=1})}function A(C,I){C.forEach(w=>{w.path.isBreakStatement({label:null})&&(I?w.path.replaceWith(h("void",m(0))):w.path.remove())})}function y(C,I){let w=[];if(I.canHaveBreak){let k=[];for(let N=0;N0&&$.every(G=>G.type===1)){k.length>0&&$.every(G=>G.path.isBreakStatement({label:null}))?(g(k),w.push(...k),k.some(G=>G.path.isDeclaration())&&(w.push(...$),I.shouldPreserveBreak||A($,!0)),I.shouldPreserveBreak||A($,!1)):(w.push(...$),I.shouldPopulateBreak||I.shouldPreserveBreak||A($,!0));break}if(N===C.length-1)w.push(...$);else{k=[];for(let G=0;G<$.length;G++){let q=$[G];q.type===1&&w.push(q),q.type===0&&k.push(q)}}}}else if(C.length)for(let k=C.length-1;k>=0;k--){let N=E(C[k],I);if(N.length>1||N.length===1&&!N[0].path.isVariableDeclaration()&&!N[0].path.isEmptyStatement()){w.push(...N);break}}return w}function E(C,I){let w=[];if(C.isIfStatement())w=f(C.get("consequent"),w,I),w=f(C.get("alternate"),w,I);else{if(C.isDoExpression()||C.isFor()||C.isWhile()||C.isLabeledStatement())return f(C.get("body"),w,I);if(C.isProgram()||C.isBlockStatement())return y(C.get("body"),I);if(C.isFunction())return E(C.get("body"),I);if(C.isTryStatement())w=f(C.get("block"),w,I),w=f(C.get("handler"),w,I);else{if(C.isCatchClause())return f(C.get("body"),w,I);if(C.isSwitchStatement())return(function(k,N,O){let W=[];for(let $=0;$a.default.get({listKey:C,parentPath:this,parent:w,container:k,key:O}).setContext(I)):a.default.get({parentPath:this,parent:w,container:w,key:C}).setContext(I)}function S(C,I){let w=this;for(let k of C)w=k==="."?w.parentPath:Array.isArray(w)?w[k]:w.get(k,I);return w}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/index.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=s.SHOULD_STOP=s.SHOULD_SKIP=s.REMOVED=void 0;var a=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/lib/virtual-types.js"),c=o("./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"),u=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/index.js"),l=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/scope/index.js"),d=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"),m=d,h=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/cache.js"),f=o("./node_modules/.pnpm/@babel+generator@7.29.1/node_modules/@babel/generator/lib/index.js"),g=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/ancestry.js"),A=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/inference/index.js"),y=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/replacement.js"),E=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/evaluation.js"),_=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/conversion.js"),S=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/introspection.js"),C=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/context.js"),I=C,w=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/removal.js"),k=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/modification.js"),N=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/family.js"),O=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/comments.js"),W=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js");let{validate:$}=d,G=c("babel"),q=(s.REMOVED=1,s.SHOULD_STOP=2,s.SHOULD_SKIP=4,s.default=class RWn{constructor(z,j){this.contexts=[],this.state=null,this._traverseFlags=0,this.skipKeys=null,this.parentPath=null,this.container=null,this.listKey=null,this.key=null,this.node=null,this.type=null,this._store=null,this.parent=j,this.hub=z,this.data=null,this.context=null,this.scope=null}get removed(){return(1&this._traverseFlags)>0}set removed(z){z?this._traverseFlags|=1:this._traverseFlags&=-2}get shouldStop(){return(2&this._traverseFlags)>0}set shouldStop(z){z?this._traverseFlags|=2:this._traverseFlags&=-3}get shouldSkip(){return(4&this._traverseFlags)>0}set shouldSkip(z){z?this._traverseFlags|=4:this._traverseFlags&=-5}static get({hub:z,parentPath:j,parent:se,container:Ae,listKey:De,key:Pe}){if(!z&&j&&(z=j.hub),!se)throw new Error("To get a node path the parent needs to exist");let we=Ae[Pe],ie=h.getOrCreateCachedPaths(se,j),oe=ie.get(we);return oe||(oe=new RWn(z,se),we&&ie.set(we,oe)),C.setup.call(oe,j,Ae,De,Pe),oe}getScope(z){return this.isScope()?new l.default(this):z}setData(z,j){return this.data==null&&(this.data=Object.create(null)),this.data[z]=j}getData(z,j){this.data==null&&(this.data=Object.create(null));let se=this.data[z];return se===void 0&&j!==void 0&&(se=this.data[z]=j),se}hasNode(){return this.node!=null}buildCodeFrameError(z,j=SyntaxError){return this.hub.buildError(this.node,z,j)}traverse(z,j){(0,u.default)(this.node,z,this.scope,j,this)}set(z,j){$(this.node,z,j),this.node[z]=j}getPathLocation(){let z=[],j=this;do{let se=j.key;j.inList&&(se=`${j.listKey}[${se}]`),z.unshift(se)}while(j=j.parentPath);return z.join(".")}debug(z){G.enabled&&G(`${this.getPathLocation()} ${this.type}: ${z}`)}toString(){return(0,f.default)(this.node).code}get inList(){return!!this.listKey}set inList(z){z||(this.listKey=null)}get parentKey(){return this.listKey||this.key}}),ce={findParent:g.findParent,find:g.find,getFunctionParent:g.getFunctionParent,getStatementParent:g.getStatementParent,getEarliestCommonAncestorFrom:g.getEarliestCommonAncestorFrom,getDeepestCommonAncestorFrom:g.getDeepestCommonAncestorFrom,getAncestry:g.getAncestry,isAncestor:g.isAncestor,isDescendant:g.isDescendant,inType:g.inType,getTypeAnnotation:A.getTypeAnnotation,isBaseType:A.isBaseType,couldBeBaseType:A.couldBeBaseType,baseTypeStrictlyMatches:A.baseTypeStrictlyMatches,isGenericType:A.isGenericType,replaceWithMultiple:y.replaceWithMultiple,replaceWithSourceString:y.replaceWithSourceString,replaceWith:y.replaceWith,replaceExpressionWithStatements:y.replaceExpressionWithStatements,replaceInline:y.replaceInline,evaluateTruthy:E.evaluateTruthy,evaluate:E.evaluate,toComputedKey:_.toComputedKey,ensureBlock:_.ensureBlock,unwrapFunctionEnvironment:_.unwrapFunctionEnvironment,arrowFunctionToExpression:_.arrowFunctionToExpression,splitExportDeclaration:_.splitExportDeclaration,ensureFunctionName:_.ensureFunctionName,matchesPattern:S.matchesPattern,isStatic:S.isStatic,isNodeType:S.isNodeType,canHaveVariableDeclarationOrExpression:S.canHaveVariableDeclarationOrExpression,canSwapBetweenExpressionAndStatement:S.canSwapBetweenExpressionAndStatement,isCompletionRecord:S.isCompletionRecord,isStatementOrBlock:S.isStatementOrBlock,referencesImport:S.referencesImport,getSource:S.getSource,willIMaybeExecuteBefore:S.willIMaybeExecuteBefore,_guessExecutionStatusRelativeTo:S._guessExecutionStatusRelativeTo,resolve:S.resolve,isConstantExpression:S.isConstantExpression,isInStrictMode:S.isInStrictMode,isDenylisted:I.isDenylisted,visit:I.visit,skip:I.skip,skipKey:I.skipKey,stop:I.stop,setContext:I.setContext,requeue:I.requeue,requeueComputedKeyAndDecorators:I.requeueComputedKeyAndDecorators,remove:w.remove,insertBefore:k.insertBefore,insertAfter:k.insertAfter,unshiftContainer:k.unshiftContainer,pushContainer:k.pushContainer,getOpposite:N.getOpposite,getCompletionRecords:N.getCompletionRecords,getSibling:N.getSibling,getPrevSibling:N.getPrevSibling,getNextSibling:N.getNextSibling,getAllNextSiblings:N.getAllNextSiblings,getAllPrevSiblings:N.getAllPrevSiblings,get:N.get,getAssignmentIdentifiers:N.getAssignmentIdentifiers,getBindingIdentifiers:N.getBindingIdentifiers,getOuterBindingIdentifiers:N.getOuterBindingIdentifiers,getBindingIdentifierPaths:N.getBindingIdentifierPaths,getOuterBindingIdentifierPaths:N.getOuterBindingIdentifierPaths,shareCommentsWithSiblings:O.shareCommentsWithSiblings,addComment:O.addComment,addComments:O.addComments};Object.assign(q.prototype,ce),q.prototype.arrowFunctionToShadowed=_.arrowFunctionToShadowed,Object.assign(q.prototype,{has:S.has,is:S.is,isnt:S.isnt,equals:S.equals,hoist:k.hoist,updateSiblingKeys:k.updateSiblingKeys,call:I.call,isBlacklisted:I.isBlacklisted,setScope:I.setScope,resync:I.resync,popContext:I.popContext,pushContext:I.pushContext,setup:I.setup,setKey:I.setKey}),q.prototype._guessExecutionStatusRelativeToDifferentFunctions=S._guessExecutionStatusRelativeTo,q.prototype._guessExecutionStatusRelativeToDifferentFunctions=S._guessExecutionStatusRelativeTo,Object.assign(q.prototype,{_getTypeAnnotation:A._getTypeAnnotation,_replaceWith:y._replaceWith,_resolve:S._resolve,_call:I._call,_resyncParent:I._resyncParent,_resyncKey:I._resyncKey,_resyncList:I._resyncList,_resyncRemoved:I._resyncRemoved,_getQueueContexts:I._getQueueContexts,_removeFromScope:w._removeFromScope,_callRemovalHooks:w._callRemovalHooks,_remove:w._remove,_markRemoved:w._markRemoved,_assertUnremoved:w._assertUnremoved,_containerInsert:k._containerInsert,_containerInsertBefore:k._containerInsertBefore,_containerInsertAfter:k._containerInsertAfter,_verifyNodeList:k._verifyNodeList,_getKey:N._getKey,_getPattern:N._getPattern});for(let Y of m.TYPES){let z=`is${Y}`,j=m[z];q.prototype[z]=function(se){return j(this.node,se)},q.prototype[`assert${Y}`]=function(se){if(!j(this.node,se))throw new TypeError(`Expected node path of type ${Y}`)}}Object.assign(q.prototype,W);for(let Y of Object.keys(a))Y.startsWith("_")||m.TYPES.includes(Y)||m.TYPES.push(Y)},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/inference/index.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s._getTypeAnnotation=q,s.baseTypeStrictlyMatches=function(Y){let z=this.getTypeAnnotation(),j=Y.getTypeAnnotation();return!l(z)&&f(z)?j.type===z.type:!1},s.couldBeBaseType=function(Y){let z=this.getTypeAnnotation();if(l(z))return!0;if(N(z)){for(let j of z.types)if(l(j)||ce(Y,j,!0))return!0;return!1}return ce(Y,z,!0)},s.getTypeAnnotation=function(){let Y=this.getData("typeAnnotation");return Y??(Y=q.call(this)||u(),(k(Y)||C(Y))&&(Y=Y.typeAnnotation),this.setData("typeAnnotation",Y),Y)},s.isBaseType=function(Y,z){return ce(Y,this.getTypeAnnotation(),z)},s.isGenericType=function(Y){let z=this.getTypeAnnotation();return Y==="Array"&&(S(z)||d(z)||w(z))?!0:g(z)&&A(z.id,{name:Y})||I(z)&&A(z.typeName,{name:Y})};var a=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/inference/inferers.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js");let{anyTypeAnnotation:u,isAnyTypeAnnotation:l,isArrayTypeAnnotation:d,isBooleanTypeAnnotation:m,isEmptyTypeAnnotation:h,isFlowBaseAnnotation:f,isGenericTypeAnnotation:g,isIdentifier:A,isMixedTypeAnnotation:y,isNumberTypeAnnotation:E,isStringTypeAnnotation:_,isTSArrayType:S,isTSTypeAnnotation:C,isTSTypeReference:I,isTupleTypeAnnotation:w,isTypeAnnotation:k,isUnionTypeAnnotation:N,isVoidTypeAnnotation:O,stringTypeAnnotation:W,voidTypeAnnotation:$}=c,G=new WeakSet;function q(){let Y=this.node;if(Y){if(Y.typeAnnotation)return Y.typeAnnotation;if(!G.has(Y)){G.add(Y);try{var z;let j=a[Y.type];if(j)return j.call(this,Y);if(j=a[this.parentPath.type],(z=j)!=null&&z.validParent)return this.parentPath.getTypeAnnotation()}finally{G.delete(Y)}}}else if(this.key==="init"&&this.parentPath.isVariableDeclarator()){let j=this.parentPath.parentPath,se=j.parentPath;return j.key==="left"&&se.isForInStatement()?W():j.key==="left"&&se.isForOfStatement()?u():$()}}function ce(Y,z,j){if(Y==="string")return _(z);if(Y==="number")return E(z);if(Y==="boolean")return m(z);if(Y==="any")return l(z);if(Y==="mixed")return y(z);if(Y==="empty")return h(z);if(Y==="void")return O(z);if(j)return!1;throw new Error(`Unknown base type ${Y}`)}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(A){if(!this.isReferenced())return;let y=this.scope.getBinding(A.name);if(y)return y.identifier.typeAnnotation?y.identifier.typeAnnotation:(function(E,_,S){let C=[],I=[],w=h(E,_,I),k=g(E,_,S);if(k){let N=h(E,k.ifStatement);w=w.filter(O=>!N.includes(O)),C.push(k.typeAnnotation)}if(w.length){w.push(...I);for(let N of w)C.push(N.getTypeAnnotation())}if(C.length)return(0,c.createUnionType)(C)})(y,this,A.name);if(A.name==="undefined")return m();if(A.name==="NaN"||A.name==="Infinity")return d();A.name};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"),c=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/inference/util.js");let{BOOLEAN_NUMBER_BINARY_OPERATORS:u,createTypeAnnotationBasedOnTypeof:l,numberTypeAnnotation:d,voidTypeAnnotation:m}=a;function h(A,y,E){let _=A.constantViolations.slice();return _.unshift(A.path),_.filter(S=>{let C=(S=S.resolve())._guessExecutionStatusRelativeTo(y);return E&&C==="unknown"&&E.push(S),C==="before"})}function f(A,y){let E=y.node.operator,_=y.get("right").resolve(),S=y.get("left").resolve(),C,I,w;if(S.isIdentifier({name:A})?C=_:_.isIdentifier({name:A})&&(C=S),C)return E==="==="?C.getTypeAnnotation():u.includes(E)?d():void 0;if(E!=="==="&&E!=="=="||(S.isUnaryExpression({operator:"typeof"})?(I=S,w=_):_.isUnaryExpression({operator:"typeof"})&&(I=_,w=S),!I)||!I.get("argument").isIdentifier({name:A})||(w=w.resolve(),!w.isLiteral()))return;let k=w.node.value;return typeof k=="string"?l(k):void 0}function g(A,y,E){let _=(function(I,w,k){let N;for(;N=w.parentPath;){if(N.isIfStatement()||N.isConditionalExpression())return w.key==="test"?void 0:N;if(N.isFunction()&&(k==null||N.parentPath.scope.getBinding(k)!==I))return;w=N}})(A,y,E);if(!_)return;let S=[_.get("test")],C=[];for(let I=0;Id(f)))return c?c(h):l(h);if(h.every(f=>m(f))&&u)return u(h)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js");let{createFlowUnionType:c,createTSUnionType:u,createUnionTypeAnnotation:l,isFlowType:d,isTSType:m}=a},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/introspection.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s._guessExecutionStatusRelativeTo=function(w){return C(this,w,new Map)},s._resolve=I,s.canHaveVariableDeclarationOrExpression=function(){return(this.key==="init"||this.key==="left")&&this.parentPath.isFor()},s.canSwapBetweenExpressionAndStatement=function(w){return this.key!=="body"||!this.parentPath.isArrowFunctionExpression()?!1:this.isExpression()?l(w):this.isBlockStatement()?d(w):!1},s.getSource=function(){let w=this.node;if(w.end){let k=this.hub.getCode();if(k)return k.slice(w.start,w.end)}return""},s.isCompletionRecord=function(w){let k=this,N=!0;do{let{type:O,container:W}=k;if(!N&&(k.isFunction()||O==="StaticBlock"))return!!w;if(N=!1,Array.isArray(W)&&k.key!==W.length-1)return!1}while((k=k.parentPath)&&!k.isProgram()&&!k.isDoExpression());return!0},s.isConstantExpression=function(){if(this.isIdentifier()){let w=this.scope.getBinding(this.node.name);return!!w&&w.constant}if(this.isLiteral())return!this.isRegExpLiteral()&&(!this.isTemplateLiteral()||this.get("expressions").every(w=>w.isConstantExpression()));if(this.isUnaryExpression())return this.node.operator==="void"&&this.get("argument").isConstantExpression();if(this.isBinaryExpression()){let{operator:w}=this.node;return w!=="in"&&w!=="instanceof"&&this.get("left").isConstantExpression()&&this.get("right").isConstantExpression()}return this.isMemberExpression()?!this.node.computed&&this.get("object").isIdentifier({name:"Symbol"})&&!this.scope.hasBinding("Symbol",{noGlobals:!0}):this.isCallExpression()?this.node.arguments.length===1&&this.get("callee").matchesPattern("Symbol.for")&&!this.scope.hasBinding("Symbol",{noGlobals:!0})&&this.get("arguments")[0].isStringLiteral():!1},s.isInStrictMode=function(){return!!(this.isProgram()?this:this.parentPath).find(k=>{if(k.isProgram({sourceType:"module"})||k.isClass())return!0;if(k.isArrowFunctionExpression()&&!k.get("body").isBlockStatement())return!1;let N;if(k.isFunction())N=k.node.body;else{if(!k.isProgram())return!1;N=k.node}for(let O of N.directives)if(O.value.value==="use strict")return!0;return!1})},s.isNodeType=function(w){return g(this.type,w)},s.isStatementOrBlock=function(){return!this.parentPath.isLabeledStatement()&&!l(this.container)&&c.includes(this.key)},s.isStatic=function(){return this.scope.isStatic(this.node)},s.matchesPattern=function(w,k){return A(this.node,w,k)},s.referencesImport=function(w,k){if(!this.isReferencedIdentifier()){if(this.isJSXMemberExpression()&&this.node.property.name===k||(this.isMemberExpression()||this.isOptionalMemberExpression())&&(this.node.computed?f(this.node.property,{value:k}):this.node.property.name===k)){let $=this.get("object");return $.isReferencedIdentifier()&&$.referencesImport(w,"*")}return!1}let N=this.scope.getBinding(this.node.name);if(N?.kind!=="module")return!1;let O=N.path,W=O.parentPath;return!W.isImportDeclaration()||W.node.source.value!==w?!1:!!(!k||O.isImportDefaultSpecifier()&&k==="default"||O.isImportNamespaceSpecifier()&&k==="*"||O.isImportSpecifier()&&m(O.node.imported,{name:k}))},s.resolve=function(w,k){return I.call(this,w,k)||this},s.willIMaybeExecuteBefore=function(w){return this._guessExecutionStatusRelativeTo(w)!=="after"};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js");let{STATEMENT_OR_BLOCK_KEYS:c,VISITOR_KEYS:u,isBlockStatement:l,isExpression:d,isIdentifier:m,isLiteral:h,isStringLiteral:f,isType:g,matchesPattern:A}=a;function y(w){return w.isProgram()?w:(w.parentPath.scope.getFunctionParent()||w.parentPath.scope.getProgramParent()).path}function E(w,k){switch(w){case"LogicalExpression":case"AssignmentPattern":return k==="right";case"ConditionalExpression":case"IfStatement":return k==="consequent"||k==="alternate";case"WhileStatement":case"DoWhileStatement":case"ForInStatement":case"ForOfStatement":return k==="body";case"ForStatement":return k==="body"||k==="update";case"SwitchStatement":return k==="cases";case"TryStatement":return k==="handler";case"OptionalMemberExpression":return k==="property";case"OptionalCallExpression":return k==="arguments";default:return!1}}function _(w,k){for(let N=0;Nae.node===ie.node))continue;if(V.key!=="callee"||!V.parentPath.isCallExpression())return"unknown";let ee=C(we,V,oe);if(te&&te!==ee)return"unknown";te=ee}return te})(z,j,se);return De.set(j.node,Pe),Pe})(w,O.target,N);let W={target:k.getAncestry(),this:w.getAncestry()};if(W.target.includes(w))return"after";if(W.this.includes(k))return"before";let $,G={target:0,this:0};for(;!$&&G.this=0?$=z:G.this++}if(!$)throw new Error("Internal Babel error - The two compared nodes don't appear to belong to the same program.");if(_(W.this,G.this-1)||_(W.target,G.target-1))return"unknown";let q={this:W.this[G.this-1],target:W.target[G.target-1]};if(q.target.listKey&&q.this.listKey&&q.target.container===q.this.container)return q.target.key>q.this.key?"before":"after";let ce=u[$.type],Y=ce.indexOf(q.this.parentKey);return ce.indexOf(q.target.parentKey)>Y?"before":"after"}function I(w,k){var N;if((N=k)==null||!N.includes(this))if((k=k||[]).push(this),this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve(w,k)}else if(this.isReferencedIdentifier()){let O=this.scope.getBinding(this.node.name);if(!O||!O.constant||O.kind==="module")return;if(O.path!==this){let W=O.path.resolve(w,k);return this.find($=>$.node===W.node)?void 0:W}}else{if(this.isTypeCastExpression())return this.get("expression").resolve(w,k);if(w&&this.isMemberExpression()){let O=this.toComputedKey();if(!h(O))return;let W=O.value,$=this.get("object").resolve(w,k);if($.isObjectExpression()){let G=$.get("properties");for(let q of G){if(!q.isProperty())continue;let ce=q.get("key"),Y=q.isnt("computed")&&ce.isIdentifier({name:W});if(Y=Y||ce.isLiteral({value:W}),Y)return q.get("value").resolve(w,k)}}else if($.isArrayExpression()&&!isNaN(+W)){let G=$.get("elements")[W];if(G)return G.resolve(w,k)}}}}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/lib/hoister.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"),c=a;let{react:u}=a,{cloneNode:l,jsxExpressionContainer:d,variableDeclaration:m,variableDeclarator:h}=c,f={ReferencedIdentifier(g,A){if(g.isJSXIdentifier()&&u.isCompatTag(g.node.name)&&!g.parentPath.isJSXMemberExpression())return;if(g.node.name==="this"){let E=g.scope;do if(E.path.isFunction()&&!E.path.isArrowFunctionExpression())break;while(E=E.parent);E&&A.breakOnScopePaths.push(E.path)}let y=g.scope.getBinding(g.node.name);if(y){for(let E of y.constantViolations)if(E.scope!==y.path.scope)return A.mutableBinding=!0,void g.stop();y===A.scope.getBinding(g.node.name)&&(A.bindings[g.node.name]=y)}}};s.default=class{constructor(g,A){this.breakOnScopePaths=void 0,this.bindings=void 0,this.mutableBinding=void 0,this.scopes=void 0,this.scope=void 0,this.path=void 0,this.attachAfter=void 0,this.breakOnScopePaths=[],this.bindings={},this.mutableBinding=!1,this.scopes=[],this.scope=A,this.path=g,this.attachAfter=!1}isCompatibleScope(g){for(let A of Object.keys(this.bindings)){let y=this.bindings[A];if(!g.bindingIdentifierEquals(A,y.identifier))return!1}return!0}getCompatibleScopes(){let g=this.path.scope;do if(!this.isCompatibleScope(g)||(this.scopes.push(g),this.breakOnScopePaths.includes(g.path)))break;while(g=g.parent)}getAttachmentPath(){let g=this._getAttachmentPath();if(!g)return;let A=g.scope;if(A.path===g&&(A=g.scope.parent),A.path.isProgram()||A.path.isFunction())for(let y of Object.keys(this.bindings)){if(!A.hasOwnBinding(y))continue;let E=this.bindings[y];if(!(E.kind==="param"||E.path.parentKey==="params")&&this.getAttachmentParentForPath(E.path).key>=g.key){this.attachAfter=!0,g=E.path;for(let _ of E.constantViolations)this.getAttachmentParentForPath(_).key>g.key&&(g=_)}}return g}_getAttachmentPath(){let g=this.scopes.pop();if(g){if(g.path.isFunction()){if(!this.hasOwnParamBindings(g))return this.getNextScopeAttachmentParent();{if(this.scope===g)return;let A=g.path.get("body").get("body");for(let y=0;yw(we)?_(we):we));if(this.isNodeType("Expression")&&!this.isJSXElement()&&!De.isJSXElement()||De.isForStatement()&&this.key==="init"){let we=this;if(we.node){let ie=we.node,{scope:oe}=this;if(oe.path.isPattern())return f(ie),we.replaceWith(y(h([],ie),[])),we.get("callee.body").insertAfter(Ae),[we];if(Y(we))Ae.unshift(ie);else if(C(ie)&&O(ie.callee))Ae.unshift(ie),Ae.push(W());else if((function(ne,Z){if(!S(ne)||!k(ne.left))return!1;let te=Z.getBlockParent();return te.hasOwnBinding(ne.left.name)&&te.getOwnBinding(ne.left.name).constantViolations.length<=1})(ie,oe))Ae.unshift(ie),Ae.push(E(ie.left));else if(oe.isPure(ie,!0))Ae.push(ie);else{De.isMethod({computed:!0,key:ie})&&(oe=oe.parent);let ne=oe.generateDeclaredUidIdentifier();Ae.unshift(_(g("=",E(ne),ie))),Ae.push(_(E(ne)))}}return this.replaceExpressionWithStatements(Ae)}if(Array.isArray(this.container))return q.call(this,Ae);if(this.isStatementOrBlock()){let we=this.node,ie=we&&(!this.isExpressionStatement()||we.expression!=null),[oe]=this.replaceWith(A(ie?[we]:[]));return oe.pushContainer("body",Ae)}throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?")},s.insertBefore=function(se){l._assertUnremoved.call(this);let Ae=j.call(this,se),{parentPath:De,parent:Pe}=this;if(De.isExpressionStatement()||De.isLabeledStatement()||I(Pe)||De.isExportDefaultDeclaration()&&this.isDeclaration())return De.insertBefore(Ae);if(this.isNodeType("Expression")&&!this.isJSXElement()||De.isForStatement()&&this.key==="init")return this.node&&Ae.push(this.node),this.replaceExpressionWithStatements(Ae);if(Array.isArray(this.container))return G.call(this,Ae);if(this.isStatementOrBlock()){let we=this.node,ie=we&&(!this.isExpressionStatement()||we.expression!=null),[oe]=this.replaceWith(A(ie?[we]:[]));return oe.unshiftContainer("body",Ae)}throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?")},s.pushContainer=function(se,Ae){l._assertUnremoved.call(this);let De=j.call(this,Ae),Pe=this.node[se];return c.default.get({parentPath:this,parent:this.node,container:Pe,listKey:se,key:Pe.length}).setContext(this.context).replaceWithMultiple(De)},s.unshiftContainer=function(se,Ae){l._assertUnremoved.call(this);let De=j.call(this,Ae),Pe=this.node[se],we=c.default.get({parentPath:this,parent:this.node,container:Pe,listKey:se,key:0}).setContext(this.context);return G.call(we,De)},s.updateSiblingKeys=z;var a=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/cache.js"),c=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/index.js"),u=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/context.js"),l=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/removal.js"),d=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"),m=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/lib/hoister.js");let{arrowFunctionExpression:h,assertExpression:f,assignmentExpression:g,blockStatement:A,callExpression:y,cloneNode:E,expressionStatement:_,isAssignmentExpression:S,isCallExpression:C,isExportNamedDeclaration:I,isExpression:w,isIdentifier:k,isSequenceExpression:N,isSuper:O,thisExpression:W}=d;function $(se,Ae){z.call(this,se,Ae.length);let De=[];this.container.splice(se,0,...Ae);for(let ie=0;iese[se.length-1];function Y(se){return N(se.parent)&&(ce(se.parent.expressions)!==se.node||Y(se.parentPath))}function z(se,Ae){if(!this.parent)return;let De=(0,a.getCachedPaths)(this);if(De)for(let[,Pe]of De)typeof Pe.key=="number"&&Pe.container===this.container&&Pe.key>=se&&(Pe.key+=Ae)}function j(se){if(!se)return[];Array.isArray(se)||(se=[se]);for(let Ae=0;Aethis.scope.removeBinding(S))}function g(){if(this.parentPath){for(let _ of a.hooks)if(_(this,this.parentPath))return!0}}function A(){Array.isArray(this.container)?(this.container.splice(this.key,1),m.updateSiblingKeys.call(this,this.key,-1)):u._replaceWith.call(this,null)}function y(){var _;this._traverseFlags|=l.SHOULD_SKIP|l.REMOVED,this.parent&&((_=(0,c.getCachedPaths)(this))==null||_.delete(this.node)),this.node=null}function E(){if(this.removed)throw this.buildCodeFrameError("NodePath has been removed so is read-only.")}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/replacement.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s._replaceWith=Z,s.replaceExpressionWithStatements=function(V){f.resync.call(this);let ee=[],ae=te(V,ee);if(ae){for(let $e of ee)this.scope.push({id:$e});return this.replaceWith(ae)[0].get("expressions")}let me=this.getFunctionParent(),ge=me?.node.async,ue=me?.node.generator,ye=A([],_(V));this.replaceWith(C(ye,[]));let Se=this.get("callee");Se.get("body").scope.hoistVariables($e=>this.scope.push({id:$e}));let be=Se.getCompletionRecords();for(let $e of be){if(!$e.isExpressionStatement())continue;let He=$e.findParent(mt=>mt.isLoop());if(He){let mt=He.getData("expressionReplacementReturnUid");mt?mt=O(mt.name):(mt=Se.scope.generateDeclaredUidIdentifier("ret"),Se.get("body").pushContainer("body",we(I(mt))),He.setData("expressionReplacementReturnUid",mt)),$e.get("expression").replaceWith(y("=",I(mt),$e.node.expression))}else $e.replaceWith(we($e.node.expression))}Se.arrowFunctionToExpression();let Te=Se,_e=ge&&c.default.hasType(Te.node.body,"AwaitExpression",g),X=ue&&c.default.hasType(Te.node.body,"YieldExpression",g);return _e&&(Te.set("async",!0),X||this.replaceWith(E(this.node))),X&&(Te.set("generator",!0),this.replaceWith(ne(this.node,!0))),Te.get("body.body")},s.replaceInline=function(V){if(f.resync.call(this),Array.isArray(V)){if(Array.isArray(this.container)){V=d._verifyNodeList.call(this,V);let ee=d._containerInsertAfter.call(this,V);return this.remove(),ee}return this.replaceWithMultiple(V)}return this.replaceWith(V)},s.replaceWith=function(V){if(f.resync.call(this),this.removed)throw new Error("You can't replace this node, we've already removed it");let ee=V instanceof u.default?V.node:V;if(!ee)throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");if(this.node===ee)return[this];if(this.isProgram()&&!se(ee))throw new Error("You can only replace a Program root node with another Program node");if(Array.isArray(ee))throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");if(typeof ee=="string")throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");let ae="";if(this.isNodeType("Statement")&&Y(ee)&&(this.canHaveVariableDeclarationOrExpression()||this.canSwapBetweenExpressionAndStatement(ee)||this.parentPath.isExportDefaultDeclaration()||(ee=k(ee),ae="expression")),this.isNodeType("Expression")&&Ae(ee)&&!this.canHaveVariableDeclarationOrExpression()&&!this.canSwapBetweenExpressionAndStatement(ee))return this.replaceExpressionWithStatements([ee]);let me=this.node;return me&&(G(ee,me),Pe(me)),Z.call(this,ee),this.type=ee.type,f.setScope.call(this),this.requeue(),[ae?this.get(ae):this]},s.replaceWithMultiple=function(V){var ee;f.resync.call(this);let ae=d._verifyNodeList.call(this,V);W(ae[0],this.node),$(ae[ae.length-1],this.node),(ee=(0,l.getCachedPaths)(this))==null||ee.delete(this.node),this.node=this.container[this.key]=null;let me=this.insertAfter(V);return this.node?this.requeue():this.remove(),me},s.replaceWithSourceString=function(V){let ee;f.resync.call(this);try{V=`(${V})`,ee=(0,m.parse)(V)}catch(me){let ge=me.loc;throw ge&&(me.message+=` - make sure this is an expression. +`+(0,a.codeFrameColumns)(V,{start:{line:ge.line,column:ge.column+1}}),me.code="BABEL_REPLACE_SOURCE_ERROR"),me}let ae=ee.program.body[0].expression;return c.default.removeProperties(ae),this.replaceWith(ae)};var a=o("./stubs/babel-codeframe.mjs"),c=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/index.js"),u=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/index.js"),l=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/cache.js"),d=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/modification.js"),m=o("./node_modules/.pnpm/@babel+parser@7.29.3/node_modules/@babel/parser/lib/index.js"),h=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"),f=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/context.js");let{FUNCTION_TYPES:g,arrowFunctionExpression:A,assignmentExpression:y,awaitExpression:E,blockStatement:_,buildUndefinedNode:S,callExpression:C,cloneNode:I,conditionalExpression:w,expressionStatement:k,getBindingIdentifiers:N,identifier:O,inheritLeadingComments:W,inheritTrailingComments:$,inheritsComments:G,isBlockStatement:q,isEmptyStatement:ce,isExpression:Y,isExpressionStatement:z,isIfStatement:j,isProgram:se,isStatement:Ae,isVariableDeclaration:De,removeComments:Pe,returnStatement:we,sequenceExpression:ie,validate:oe,yieldExpression:ne}=h;function Z(V){var ee;if(!this.container)throw new ReferenceError("Container is falsy");this.inList?oe(this.parent,this.key,[V]):oe(this.parent,this.key,V),this.debug(`Replace with ${V?.type}`),(ee=(0,l.getCachedPaths)(this))==null||ee.set(V,this).delete(this.node),this.node=V,this.container[this.key]=V}function te(V,ee){let ae=[],me=!0;for(let ge of V)if(ce(ge)||(me=!1),Y(ge))ae.push(ge);else if(z(ge))ae.push(ge.expression);else if(De(ge)){if(ge.kind!=="var")return;for(let ue of ge.declarations){let ye=N(ue);for(let Se of Object.keys(ye))ee.push(I(ye[Se]));ue.init&&ae.push(y("=",ue.id,ue.init))}me=!0}else if(j(ge)){let ue=ge.consequent?te([ge.consequent],ee):S(),ye=ge.alternate?te([ge.alternate],ee):S();if(!ue||!ye)return;ae.push(w(ge.test,ue,ye))}else if(q(ge)){let ue=te(ge.body,ee);if(!ue)return;ae.push(ue)}else{if(!ce(ge))return;V.indexOf(ge)===0&&(me=!0)}return me&&ae.push(S()),ae.length===1?ae[0]:ie(ae)}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/scope/binding.js"(i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0,s.default=class{constructor({identifier:o,scope:a,path:c,kind:u}){this.identifier=void 0,this.scope=void 0,this.path=void 0,this.kind=void 0,this.constantViolations=[],this.constant=!0,this.referencePaths=[],this.referenced=!1,this.references=0,this.identifier=o,this.scope=a,this.path=c,this.kind=u,u!=="var"&&u!=="hoisted"||!(function(l){let d=!l.isVariableDeclarator()||l.node.init;for(let{parentPath:m,key:h}=l;m;{parentPath:m,key:h}=m){if(m.isFunctionParent())return!1;if(h==="left"&&m.isForXStatement()||d&&h==="body"&&m.isLoop())return!0}return!1})(c)||this.reassign(c),this.clearValue()}deoptValue(){this.clearValue(),this.hasDeoptedValue=!0}setValue(o){this.hasDeoptedValue||(this.hasValue=!0,this.value=o)}clearValue(){this.hasDeoptedValue=!1,this.hasValue=!1,this.value=null}reassign(o){this.constant=!1,this.constantViolations.includes(o)||this.constantViolations.push(o)}reference(o){this.referencePaths.includes(o)||(this.referenced=!0,this.references++,this.referencePaths.push(o))}dereference(){this.references--,this.referenced=!!this.references}}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/scope/index.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var a=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/scope/lib/renamer.js"),c=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/index.js"),u=(o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/scope/traverseForScope.js"),o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/scope/binding.js")),l=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"),d=l,m=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/cache.js");let h=o("./node_modules/.pnpm/@babel+helper-globals@7.28.0/node_modules/@babel/helper-globals/data/builtin-lower.json"),f=o("./node_modules/.pnpm/@babel+helper-globals@7.28.0/node_modules/@babel/helper-globals/data/builtin-upper.json"),{assignmentExpression:g,callExpression:A,cloneNode:y,getBindingIdentifiers:E,identifier:_,isArrayExpression:S,isBinary:C,isCallExpression:I,isClass:w,isClassBody:k,isClassDeclaration:N,isExportAllDeclaration:O,isExportDefaultDeclaration:W,isExportNamedDeclaration:$,isFunctionDeclaration:G,isIdentifier:q,isImportDeclaration:ce,isLiteral:Y,isMemberExpression:z,isMethod:j,isModuleSpecifier:se,isNullLiteral:Ae,isObjectExpression:De,isProperty:Pe,isPureish:we,isRegExpLiteral:ie,isSuper:oe,isTaggedTemplateExpression:ne,isTemplateLiteral:Z,isThisExpression:te,isUnaryExpression:V,isVariableDeclaration:ee,expressionStatement:ae,matchesPattern:me,memberExpression:ge,numericLiteral:ue,toIdentifier:ye,variableDeclaration:Se,variableDeclarator:be,isObjectProperty:Te,isTopicReference:_e,isMetaProperty:X,isPrivateName:$e,isExportDeclaration:He,buildUndefinedNode:mt,sequenceExpression:st}=l;function ze(Xe,Me){switch(Xe?.type){default:var Je;if(ce(Xe)||He(Xe))if((O(Xe)||$(Xe)||ce(Xe))&&Xe.source)ze(Xe.source,Me);else if(($(Xe)||ce(Xe))&&(Je=Xe.specifiers)!=null&&Je.length)for(let yt of Xe.specifiers)ze(yt,Me);else(W(Xe)||$(Xe))&&Xe.declaration&&ze(Xe.declaration,Me);else se(Xe)?ze(Xe.local,Me):!Y(Xe)||Ae(Xe)||ie(Xe)||Z(Xe)||Me.push(Xe.value);break;case"MemberExpression":case"OptionalMemberExpression":case"JSXMemberExpression":ze(Xe.object,Me),ze(Xe.property,Me);break;case"Identifier":case"JSXIdentifier":Me.push(Xe.name);break;case"CallExpression":case"OptionalCallExpression":case"NewExpression":ze(Xe.callee,Me);break;case"ObjectExpression":case"ObjectPattern":for(let yt of Xe.properties)ze(yt,Me);break;case"SpreadElement":case"RestElement":case"UnaryExpression":case"UpdateExpression":ze(Xe.argument,Me);break;case"ObjectProperty":case"ObjectMethod":case"ClassProperty":case"ClassMethod":case"ClassPrivateProperty":case"ClassPrivateMethod":ze(Xe.key,Me);break;case"ThisExpression":Me.push("this");break;case"Super":Me.push("super");break;case"Import":case"ImportExpression":Me.push("import");break;case"DoExpression":Me.push("do");break;case"YieldExpression":Me.push("yield"),ze(Xe.argument,Me);break;case"AwaitExpression":Me.push("await"),ze(Xe.argument,Me);break;case"AssignmentExpression":ze(Xe.left,Me);break;case"VariableDeclarator":case"FunctionExpression":case"FunctionDeclaration":case"ClassExpression":case"ClassDeclaration":case"PrivateName":ze(Xe.id,Me);break;case"ParenthesizedExpression":ze(Xe.expression,Me);break;case"MetaProperty":ze(Xe.meta,Me),ze(Xe.property,Me);break;case"JSXElement":ze(Xe.openingElement,Me);break;case"JSXOpeningElement":ze(Xe.name,Me);break;case"JSXFragment":ze(Xe.openingFragment,Me);break;case"JSXOpeningFragment":Me.push("Fragment");break;case"JSXNamespacedName":ze(Xe.namespace,Me),ze(Xe.name,Me)}}function rt(Xe){Xe.references=Object.create(null),Xe.uids=Object.create(null),Xe.bindings=Object.create(null),Xe.globals=Object.create(null)}var Ct=Symbol.for("should not be considered a local binding");let on={ForStatement(Xe){let Me=Xe.get("init");if(Me.isVar()){let{scope:Je}=Xe;(Je.getFunctionParent()||Je.getProgramParent()).registerBinding("var",Me)}},Declaration(Xe){Xe.isBlockScoped()||Xe.isImportDeclaration()||Xe.isExportDeclaration()||(Xe.scope.getFunctionParent()||Xe.scope.getProgramParent()).registerDeclaration(Xe)},ImportDeclaration(Xe){Xe.scope.getBlockParent().registerDeclaration(Xe)},TSImportEqualsDeclaration(Xe){Xe.scope.getBlockParent().registerDeclaration(Xe)},ReferencedIdentifier(Xe,Me){d.isTSQualifiedName(Xe.parent)&&Xe.parent.right===Xe.node||Xe.parentPath.isTSImportEqualsDeclaration()||Me.references.push(Xe)},ForXStatement(Xe,Me){let Je=Xe.get("left");if(Je.isPattern()||Je.isIdentifier())Me.constantViolations.push(Xe);else if(Je.isVar()){let{scope:yt}=Xe;(yt.getFunctionParent()||yt.getProgramParent()).registerBinding("var",Je)}},ExportDeclaration:{exit(Xe){let{node:Me,scope:Je}=Xe;if(O(Me))return;let yt=Me.declaration;if(N(yt)||G(yt)){let Vt=yt.id;if(!Vt)return;let dn=Je.getBinding(Vt.name);dn?.reference(Xe)}else if(ee(yt))for(let Vt of yt.declarations)for(let dn of Object.keys(E(Vt))){let An=Je.getBinding(dn);An?.reference(Xe)}}},LabeledStatement(Xe){Xe.scope.getBlockParent().registerDeclaration(Xe)},AssignmentExpression(Xe,Me){Me.assignments.push(Xe)},UpdateExpression(Xe,Me){Me.constantViolations.push(Xe)},UnaryExpression(Xe,Me){Xe.node.operator==="delete"&&Me.constantViolations.push(Xe)},BlockScoped(Xe){let Me=Xe.scope;if(Me.path===Xe&&(Me=Me.parent),Me.getBlockParent().registerDeclaration(Xe),Xe.isClassDeclaration()&&Xe.node.id){let Je=Xe.node.id.name;Xe.scope.bindings[Je]=Xe.scope.parent.getBinding(Je)}},CatchClause(Xe){Xe.scope.registerBinding("let",Xe)},Function(Xe){let Me=Xe.get("params");for(let Je of Me)Xe.scope.registerBinding("param",Je);Xe.isFunctionExpression()&&Xe.node.id&&!Xe.node.id[Ct]&&Xe.scope.registerBinding("local",Xe.get("id"),Xe)},ClassExpression(Xe){Xe.node.id&&!Xe.node.id[Ct]&&Xe.scope.registerBinding("local",Xe.get("id"),Xe)},TSTypeAnnotation(Xe){Xe.skip()}},Ft,Qt=0;class Mt{constructor(Me){this.uid=void 0,this.path=void 0,this.block=void 0,this.inited=void 0,this.labels=void 0,this.bindings=void 0,this.referencesSet=void 0,this.globals=void 0,this.uidsSet=void 0,this.data=void 0,this.crawling=void 0;let{node:Je}=Me,yt=m.scope.get(Je);if(yt?.path===Me)return yt;m.scope.set(Je,this),this.uid=Qt++,this.block=Je,this.path=Me,this.labels=new Map,this.inited=!1,Object.defineProperties(this,{references:{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)},uids:{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)}})}get parent(){var Me;let Je,yt=this.path;do{var Vt;let dn=yt.key==="key"||yt.listKey==="decorators";yt=yt.parentPath,dn&&yt.isMethod()&&(yt=yt.parentPath),(Vt=yt)!=null&&Vt.isScope()&&(Je=yt)}while(yt&&!Je);return(Me=Je)==null?void 0:Me.scope}get references(){throw new Error("Scope#references is not available in Babel 8. Use Scope#referencesSet instead.")}get uids(){throw new Error("Scope#uids is not available in Babel 8. Use Scope#uidsSet instead.")}generateDeclaredUidIdentifier(Me){let Je=this.generateUidIdentifier(Me);return this.push({id:Je}),y(Je)}generateUidIdentifier(Me){return _(this.generateUid(Me))}generateUid(Me="temp"){let Je;Me=ye(Me).replace(/^_+/,"").replace(/\d+$/g,"");let yt=0;do Je=`_${Me}`,yt>=11?Je+=yt-1:yt>=9?Je+=yt-9:yt>=1&&(Je+=yt+1),yt++;while(this.hasLabel(Je)||this.hasBinding(Je)||this.hasGlobal(Je)||this.hasReference(Je));let Vt=this.getProgramParent();return Vt.references[Je]=!0,Vt.uids[Je]=!0,Je}generateUidBasedOnNode(Me,Je){let yt=[];ze(Me,yt);let Vt=yt.join("$");return Vt=Vt.replace(/^_/,"")||Je||"ref",this.generateUid(Vt.slice(0,20))}generateUidIdentifierBasedOnNode(Me,Je){return _(this.generateUidBasedOnNode(Me,Je))}isStatic(Me){if(te(Me)||oe(Me)||_e(Me))return!0;if(q(Me)){let Je=this.getBinding(Me.name);return Je?Je.constant:this.hasBinding(Me.name)}return!1}maybeGenerateMemoised(Me,Je){if(this.isStatic(Me))return null;{let yt=this.generateUidIdentifierBasedOnNode(Me);return Je?yt:(this.push({id:yt}),y(yt))}}checkBlockScopedCollisions(Me,Je,yt,Vt){if(Je!=="param"&&Me.kind!=="local"&&(Je==="let"||Me.kind==="let"||Me.kind==="const"||Me.kind==="module"||Me.kind==="param"&&Je==="const"))throw this.path.hub.buildError(Vt,`Duplicate declaration "${yt}"`,TypeError)}rename(Me,Je){let yt=this.getBinding(Me);yt&&(Je||(Je=this.generateUidIdentifier(Me).name),new a.default(yt,Me,Je).rename(arguments[2]))}dump(){let Me="-".repeat(60);console.log(Me);let Je=this;do{console.log("#",Je.block.type);for(let yt of Object.keys(Je.bindings)){let Vt=Je.bindings[yt];console.log(" -",yt,{constant:Vt.constant,references:Vt.references,violations:Vt.constantViolations.length,kind:Vt.kind})}}while(Je=Je.parent);console.log(Me)}hasLabel(Me){return!!this.getLabel(Me)}getLabel(Me){return this.labels.get(Me)}registerLabel(Me){this.labels.set(Me.node.label.name,Me)}registerDeclaration(Me){if(Me.isLabeledStatement())this.registerLabel(Me);else if(Me.isFunctionDeclaration())this.registerBinding("hoisted",Me.get("id"),Me);else if(Me.isVariableDeclaration()){let Je=Me.get("declarations"),{kind:yt}=Me.node;for(let Vt of Je)this.registerBinding(yt==="using"||yt==="await using"?"const":yt,Vt)}else if(Me.isClassDeclaration()){if(Me.node.declare)return;this.registerBinding("let",Me)}else if(Me.isImportDeclaration()){let Je=Me.node.importKind==="type"||Me.node.importKind==="typeof",yt=Me.get("specifiers");for(let Vt of yt){let dn=Je||Vt.isImportSpecifier()&&(Vt.node.importKind==="type"||Vt.node.importKind==="typeof");this.registerBinding(dn?"unknown":"module",Vt)}}else if(Me.isExportDeclaration()){let Je=Me.get("declaration");(Je.isClassDeclaration()||Je.isFunctionDeclaration()||Je.isVariableDeclaration())&&this.registerDeclaration(Je)}else this.registerBinding("unknown",Me)}buildUndefinedNode(){return mt()}registerConstantViolation(Me){let Je=Me.getAssignmentIdentifiers();for(let Vt of Object.keys(Je)){var yt;(yt=this.getBinding(Vt))==null||yt.reassign(Me)}}registerBinding(Me,Je,yt=Je){if(!Me)throw new ReferenceError("no `kind`");if(Je.isVariableDeclaration()){let An=Je.get("declarations");for(let Fn of An)this.registerBinding(Me,Fn);return}let Vt=this.getProgramParent(),dn=Je.getOuterBindingIdentifiers(!0);for(let An of Object.keys(dn)){Vt.references[An]=!0;for(let Fn of dn[An]){let qe=this.getOwnBinding(An);if(qe){if(qe.identifier===Fn)continue;this.checkBlockScopedCollisions(qe,Me,An,Fn)}qe?qe.reassign(yt):this.bindings[An]=new u.default({identifier:Fn,scope:this,path:yt,kind:Me})}}}addGlobal(Me){this.globals[Me.name]=Me}hasUid(Me){let Je=this;do if(Je.uids[Me])return!0;while(Je=Je.parent);return!1}hasGlobal(Me){let Je=this;do if(Je.globals[Me])return!0;while(Je=Je.parent);return!1}hasReference(Me){return!!this.getProgramParent().references[Me]}isPure(Me,Je){if(q(Me)){let An=this.getBinding(Me.name);return!!An&&(!Je||An.constant)}if(te(Me)||X(Me)||_e(Me)||$e(Me))return!0;var yt,Vt,dn;if(w(Me))return!(Me.superClass&&!this.isPure(Me.superClass,Je))&&!(((yt=Me.decorators)==null?void 0:yt.length)>0)&&this.isPure(Me.body,Je);if(k(Me)){for(let An of Me.body)if(!this.isPure(An,Je))return!1;return!0}if(C(Me))return this.isPure(Me.left,Je)&&this.isPure(Me.right,Je);if(S(Me)||Me?.type==="TupleExpression"){for(let An of Me.elements)if(An!==null&&!this.isPure(An,Je))return!1;return!0}if(De(Me)||Me?.type==="RecordExpression"){for(let An of Me.properties)if(!this.isPure(An,Je))return!1;return!0}if(j(Me))return!(Me.computed&&!this.isPure(Me.key,Je))&&!(((Vt=Me.decorators)==null?void 0:Vt.length)>0);if(Pe(Me))return!(Me.computed&&!this.isPure(Me.key,Je))&&!(((dn=Me.decorators)==null?void 0:dn.length)>0)&&!((Te(Me)||Me.static)&&Me.value!==null&&!this.isPure(Me.value,Je));if(V(Me))return this.isPure(Me.argument,Je);if(Z(Me)){for(let An of Me.expressions)if(!this.isPure(An,Je))return!1;return!0}return ne(Me)?me(Me.tag,"String.raw")&&!this.hasBinding("String",{noGlobals:!0})&&this.isPure(Me.quasi,Je):z(Me)?!Me.computed&&q(Me.object)&&Me.object.name==="Symbol"&&q(Me.property)&&Me.property.name!=="for"&&!this.hasBinding("Symbol",{noGlobals:!0}):I(Me)?me(Me.callee,"Symbol.for")&&!this.hasBinding("Symbol",{noGlobals:!0})&&Me.arguments.length===1&&d.isStringLiteral(Me.arguments[0]):we(Me)}setData(Me,Je){return this.data[Me]=Je}getData(Me){let Je=this;do{let yt=Je.data[Me];if(yt!=null)return yt}while(Je=Je.parent)}removeData(Me){let Je=this;do Je.data[Me]!=null&&(Je.data[Me]=null);while(Je=Je.parent)}init(){this.inited||(this.inited=!0,this.crawl())}crawl(){let Me=this.path;rt(this),this.data=Object.create(null);let Je=this;do{if(Je.crawling)return;if(Je.path.isProgram())break}while(Je=Je.parent);let yt=Je,Vt={references:[],constantViolations:[],assignments:[]};if(this.crawling=!0,Ft||(Ft=c.default.visitors.merge([{Scope(dn){rt(dn.scope)}},on])),Me.type!=="Program"){let dn=Ft[Me.type];if(dn)for(let An of dn.enter)An.call(Vt,Me,Vt)}Me.traverse(Ft,Vt),this.crawling=!1;for(let dn of Vt.assignments){let An=dn.getAssignmentIdentifiers();for(let Fn of Object.keys(An))dn.scope.getBinding(Fn)||yt.addGlobal(An[Fn]);dn.scope.registerConstantViolation(dn)}for(let dn of Vt.references){let An=dn.scope.getBinding(dn.node.name);An?An.reference(dn):yt.addGlobal(dn.node)}for(let dn of Vt.constantViolations)dn.scope.registerConstantViolation(dn)}push(Me){let Je=this.path;Je.isPattern()?Je=this.getPatternParent().path:Je.isBlockStatement()||Je.isProgram()||(Je=this.getBlockParent().path),Je.isSwitchStatement()&&(Je=(this.getFunctionParent()||this.getProgramParent()).path);let{init:yt,unique:Vt,kind:dn="var",id:An}=Me;if(!yt&&!Vt&&(dn==="var"||dn==="let")&&(function(dt){return dt.isFunctionExpression()&&!dt.node.id||dt.isArrowFunctionExpression()})(Je)&&I(Je.parent,{callee:Je.node})&&Je.parent.arguments.length<=Je.node.params.length&&q(An))return Je.pushContainer("params",An),void Je.scope.registerBinding("param",Je.get("params")[Je.node.params.length-1]);(Je.isLoop()||Je.isCatchClause()||Je.isFunction())&&(Je.ensureBlock(),Je=Je.get("body"));let Fn=Me._blockHoist==null?2:Me._blockHoist,qe=`declaration:${dn}:${Fn}`,ht=!Vt&&Je.getData(qe);if(!ht){let dt=Se(dn,[]);dt._blockHoist=Fn,[ht]=Je.unshiftContainer("body",[dt]),Vt||Je.setData(qe,ht)}let Zt=be(An,yt),Ze=ht.node.declarations.push(Zt);Je.scope.registerBinding(dn,ht.get("declarations")[Ze-1])}getProgramParent(){let Me=this;do if(Me.path.isProgram())return Me;while(Me=Me.parent);throw new Error("Couldn't find a Program")}getFunctionParent(){let Me=this;do if(Me.path.isFunctionParent())return Me;while(Me=Me.parent);return null}getBlockParent(){let Me=this;do if(Me.path.isBlockParent())return Me;while(Me=Me.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")}getPatternParent(){let Me=this;do if(!Me.path.isPattern())return Me.getBlockParent();while(Me=Me.parent.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")}getAllBindings(){let Me=Object.create(null),Je=this;do{for(let yt of Object.keys(Je.bindings))!(yt in Me)&&(Me[yt]=Je.bindings[yt]);Je=Je.parent}while(Je);return Me}bindingIdentifierEquals(Me,Je){return this.getBindingIdentifier(Me)===Je}getBinding(Me){let Je,yt=this;do{let dn=yt.getOwnBinding(Me);var Vt;if(dn){if((Vt=Je)==null||!Vt.isPattern()||dn.kind==="param"||dn.kind==="local")return dn}else if(!dn&&Me==="arguments"&&yt.path.isFunction()&&!yt.path.isArrowFunctionExpression())break;Je=yt.path}while(yt=yt.parent)}getOwnBinding(Me){return this.bindings[Me]}getBindingIdentifier(Me){var Je;return(Je=this.getBinding(Me))==null?void 0:Je.identifier}getOwnBindingIdentifier(Me){let Je=this.bindings[Me];return Je?.identifier}hasOwnBinding(Me){return!!this.getOwnBinding(Me)}hasBinding(Me,Je){if(!Me)return!1;let yt,Vt,dn;typeof Je=="object"?(yt=Je.noGlobals,Vt=Je.noUids,dn=Je.upToScope):typeof Je=="boolean"&&(yt=Je);let An=this;do{if(dn===An)break;if(An.hasOwnBinding(Me))return!0}while(An=An.parent);return!(Vt||!this.hasUid(Me))||!(yt||!Mt.globals.includes(Me))||!(yt||!Mt.contextVariables.includes(Me))}parentHasBinding(Me,Je){var yt;return(yt=this.parent)==null?void 0:yt.hasBinding(Me,Je)}moveBindingTo(Me,Je){let yt=this.getBinding(Me);yt&&(yt.scope.removeOwnBinding(Me),yt.scope=Je,Je.bindings[Me]=yt)}removeOwnBinding(Me){delete this.bindings[Me]}removeBinding(Me){var Je;(Je=this.getBinding(Me))==null||Je.scope.removeOwnBinding(Me);let yt=this;do yt.uids[Me]&&(yt.uids[Me]=!1);while(yt=yt.parent)}hoistVariables(Me=Je=>this.push({id:Je})){this.crawl();let Je=new Set;for(let yt of Object.keys(this.bindings)){let Vt=this.bindings[yt];if(!Vt)continue;let{path:dn}=Vt;if(!dn.isVariableDeclarator())continue;let{parent:An,parentPath:Fn}=dn;if(An.kind!=="var"||Je.has(An))continue;let qe;Je.add(dn.parent);let ht=[];for(let Zt of An.declarations){qe!=null||(qe=Zt.id),Zt.init&&ht.push(g("=",Zt.id,Zt.init));let Ze=Object.keys(E(Zt,!1,!0,!0));for(let dt of Ze)Me(_(dt),Zt.init!=null)}if(Fn.parentPath.isForXStatement({left:An}))Fn.replaceWith(qe);else if(ht.length===0)Fn.remove();else{let Zt=ht.length===1?ht[0]:st(ht);Fn.parentPath.isForStatement({init:An})?Fn.replaceWith(Zt):Fn.replaceWith(ae(Zt))}}}}s.default=Mt,Mt.globals=[...h,...f],Mt.contextVariables=["arguments","undefined","Infinity","NaN"],Mt.prototype._renameFromMap=function(Xe,Me,Je,yt){Xe[Me]&&(Xe[Je]=yt,Xe[Me]=null)},Mt.prototype.traverse=function(Xe,Me,Je){(0,c.default)(Xe,Me,this,Je,this.path)},Mt.prototype._generateUid=function(Xe,Me){let Je=Xe;return Me>1&&(Je+=Me),`_${Je}`},Mt.prototype.toArray=function(Xe,Me,Je){if(q(Xe)){let dn=this.getBinding(Xe.name);if(dn!=null&&dn.constant&&dn.path.isGenericType("Array"))return Xe}if(S(Xe))return Xe;if(q(Xe,{name:"arguments"}))return A(ge(ge(ge(_("Array"),_("prototype")),_("slice")),_("call")),[Xe]);let yt,Vt=[Xe];return Me===!0?yt="toConsumableArray":typeof Me=="number"?(Vt.push(ue(Me)),yt="slicedToArray"):yt="toArray",Je&&(Vt.unshift(this.path.hub.addHelper(yt)),yt="maybeArrayLike"),A(this.path.hub.addHelper(yt),Vt)},Mt.prototype.getAllBindingsOfKind=function(...Xe){let Me=Object.create(null);for(let Je of Xe){let yt=this;do{for(let Vt of Object.keys(yt.bindings)){let dn=yt.bindings[Vt];dn.kind===Je&&(Me[Vt]=dn)}yt=yt.parent}while(yt)}return Me},Object.defineProperties(Mt.prototype,{parentBlock:{configurable:!0,enumerable:!0,get(){return this.path.parent}},hub:{configurable:!0,enumerable:!0,get(){return this.path.hub}}})},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/scope/lib/renamer.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"),c=a,u=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/traverse-node.js"),l=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/visitors.js"),d=o("./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/path/context.js");let{getAssignmentIdentifiers:m}=c,h={ReferencedIdentifier({node:f},g){f.name===g.oldName&&(f.name=g.newName)},Scope(f,g){f.scope.bindingIdentifierEquals(g.oldName,g.binding.identifier)||(f.skip(),f.isMethod()&&(f.requeueComputedKeyAndDecorators?f.requeueComputedKeyAndDecorators():d.requeueComputedKeyAndDecorators.call(f)),f.isSwitchStatement()&&f.context.maybeQueue(f.get("discriminant")))},ObjectProperty({node:f,scope:g},A){let{name:y}=f.key;var E;!f.shorthand||y!==A.oldName&&y!==A.newName||g.getBindingIdentifier(y)!==A.binding.identifier||(f.shorthand=!1,(E=f.extra)!=null&&E.shorthand&&(f.extra.shorthand=!1))},"AssignmentExpression|Declaration|VariableDeclarator"(f,g){if(f.isVariableDeclaration())return;let A=f.isAssignmentExpression()?m(f.node):f.getOuterBindingIdentifiers();for(let y in A)y===g.oldName&&(A[y].name=g.newName)}};s.default=class{constructor(f,g,A){this.newName=A,this.oldName=g,this.binding=f}maybeConvertFromExportDeclaration(f){let g=f.parentPath;if(g.isExportDeclaration()){if(g.isExportDefaultDeclaration()){let{declaration:A}=g.node;if(a.isDeclaration(A)&&!A.id)return}g.isExportAllDeclaration()||g.splitExportDeclaration()}}maybeConvertFromClassFunctionDeclaration(f){return f}maybeConvertFromClassFunctionExpression(f){return f}rename(){let{binding:f,oldName:g,newName:A}=this,{scope:y,path:E}=f,_=E.find(I=>I.isDeclaration()||I.isFunctionExpression()||I.isClassExpression());_&&_.getOuterBindingIdentifiers()[g]===f.identifier&&this.maybeConvertFromExportDeclaration(_);let S=arguments[0]||y.block,C={discriminant:!0};a.isMethod(S)&&(S.computed&&(C.key=!0),a.isObjectMethod(S)||(C.decorators=!0)),(0,u.traverseNode)(S,(0,l.explode)(h),y,this,y.path,C),arguments[0]||(y.removeOwnBinding(g),y.bindings[A]=f,this.binding.identifier.name=A),_&&(this.maybeConvertFromClassFunctionDeclaration(E),this.maybeConvertFromClassFunctionExpression(E))}}},"./node_modules/.pnpm/@babel+traverse@7.29.0/node_modules/@babel/traverse/lib/scope/traverseForScope.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(m,h,f){let g=(0,u.explode)(h);if(g.enter||g.exit)throw new Error("Should not be used with enter/exit visitors.");(function A(y,E,_,S,C,I,w,k){if(!_)return;let N=k||c.NodePath.get({hub:w,parentPath:y,parent:E,container:S,listKey:I,key:C});l._forceSetScope.call(N);let O=g[_.type];if(O!=null&&O.enter)for(let $ of O.enter)$.call(f,N,f);if(N.shouldSkip)return;let W=d[_.type];if(W!=null&&W.length){for(let $ of W){let G=_[$];if(G)if(Array.isArray(G))for(let q=0;qj.toString()),se}),ce[Y]=z)}return ce}function w($){$.enter&&!Array.isArray($.enter)&&($.enter=[$.enter]),$.exit&&!Array.isArray($.exit)&&($.exit=[$.exit])}function k($,G){let q=c[`is${$}`],ce=function(Y){if(q.call(Y))return G.apply(this,arguments)};return ce.toString=()=>G.toString(),ce}function N($){return!!$.startsWith("_")||$==="enter"||$==="exit"||$==="shouldSkip"||$==="denylist"||$==="noScope"||$==="skipKeys"||$==="blacklist"}function O($,G){for(let q of["enter","exit"])G[q]&&($[q]=[].concat($[q]||[],G[q]))}let W={FunctionParent($){$.isArrowFunctionExpression()||($.skip(),$.isMethod()&&($.requeueComputedKeyAndDecorators?$.requeueComputedKeyAndDecorators():l.requeueComputedKeyAndDecorators.call($)))},Property($){$.isObjectProperty()||($.skip(),$.requeueComputedKeyAndDecorators?$.requeueComputedKeyAndDecorators():l.requeueComputedKeyAndDecorators.call($))}}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/asserts/assertNode.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c){if(!(0,a.default)(c)){var u;let l=(u=c?.type)!=null?u:JSON.stringify(c);throw new TypeError(`Not a valid node of type "${l}"`)}};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isNode.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/asserts/generated/index.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.assertAccessor=function(l,d){u("Accessor",l,d)},s.assertAnyTypeAnnotation=function(l,d){u("AnyTypeAnnotation",l,d)},s.assertArgumentPlaceholder=function(l,d){u("ArgumentPlaceholder",l,d)},s.assertArrayExpression=function(l,d){u("ArrayExpression",l,d)},s.assertArrayPattern=function(l,d){u("ArrayPattern",l,d)},s.assertArrayTypeAnnotation=function(l,d){u("ArrayTypeAnnotation",l,d)},s.assertArrowFunctionExpression=function(l,d){u("ArrowFunctionExpression",l,d)},s.assertAssignmentExpression=function(l,d){u("AssignmentExpression",l,d)},s.assertAssignmentPattern=function(l,d){u("AssignmentPattern",l,d)},s.assertAwaitExpression=function(l,d){u("AwaitExpression",l,d)},s.assertBigIntLiteral=function(l,d){u("BigIntLiteral",l,d)},s.assertBinary=function(l,d){u("Binary",l,d)},s.assertBinaryExpression=function(l,d){u("BinaryExpression",l,d)},s.assertBindExpression=function(l,d){u("BindExpression",l,d)},s.assertBlock=function(l,d){u("Block",l,d)},s.assertBlockParent=function(l,d){u("BlockParent",l,d)},s.assertBlockStatement=function(l,d){u("BlockStatement",l,d)},s.assertBooleanLiteral=function(l,d){u("BooleanLiteral",l,d)},s.assertBooleanLiteralTypeAnnotation=function(l,d){u("BooleanLiteralTypeAnnotation",l,d)},s.assertBooleanTypeAnnotation=function(l,d){u("BooleanTypeAnnotation",l,d)},s.assertBreakStatement=function(l,d){u("BreakStatement",l,d)},s.assertCallExpression=function(l,d){u("CallExpression",l,d)},s.assertCatchClause=function(l,d){u("CatchClause",l,d)},s.assertClass=function(l,d){u("Class",l,d)},s.assertClassAccessorProperty=function(l,d){u("ClassAccessorProperty",l,d)},s.assertClassBody=function(l,d){u("ClassBody",l,d)},s.assertClassDeclaration=function(l,d){u("ClassDeclaration",l,d)},s.assertClassExpression=function(l,d){u("ClassExpression",l,d)},s.assertClassImplements=function(l,d){u("ClassImplements",l,d)},s.assertClassMethod=function(l,d){u("ClassMethod",l,d)},s.assertClassPrivateMethod=function(l,d){u("ClassPrivateMethod",l,d)},s.assertClassPrivateProperty=function(l,d){u("ClassPrivateProperty",l,d)},s.assertClassProperty=function(l,d){u("ClassProperty",l,d)},s.assertCompletionStatement=function(l,d){u("CompletionStatement",l,d)},s.assertConditional=function(l,d){u("Conditional",l,d)},s.assertConditionalExpression=function(l,d){u("ConditionalExpression",l,d)},s.assertContinueStatement=function(l,d){u("ContinueStatement",l,d)},s.assertDebuggerStatement=function(l,d){u("DebuggerStatement",l,d)},s.assertDecimalLiteral=function(l,d){u("DecimalLiteral",l,d)},s.assertDeclaration=function(l,d){u("Declaration",l,d)},s.assertDeclareClass=function(l,d){u("DeclareClass",l,d)},s.assertDeclareExportAllDeclaration=function(l,d){u("DeclareExportAllDeclaration",l,d)},s.assertDeclareExportDeclaration=function(l,d){u("DeclareExportDeclaration",l,d)},s.assertDeclareFunction=function(l,d){u("DeclareFunction",l,d)},s.assertDeclareInterface=function(l,d){u("DeclareInterface",l,d)},s.assertDeclareModule=function(l,d){u("DeclareModule",l,d)},s.assertDeclareModuleExports=function(l,d){u("DeclareModuleExports",l,d)},s.assertDeclareOpaqueType=function(l,d){u("DeclareOpaqueType",l,d)},s.assertDeclareTypeAlias=function(l,d){u("DeclareTypeAlias",l,d)},s.assertDeclareVariable=function(l,d){u("DeclareVariable",l,d)},s.assertDeclaredPredicate=function(l,d){u("DeclaredPredicate",l,d)},s.assertDecorator=function(l,d){u("Decorator",l,d)},s.assertDirective=function(l,d){u("Directive",l,d)},s.assertDirectiveLiteral=function(l,d){u("DirectiveLiteral",l,d)},s.assertDoExpression=function(l,d){u("DoExpression",l,d)},s.assertDoWhileStatement=function(l,d){u("DoWhileStatement",l,d)},s.assertEmptyStatement=function(l,d){u("EmptyStatement",l,d)},s.assertEmptyTypeAnnotation=function(l,d){u("EmptyTypeAnnotation",l,d)},s.assertEnumBody=function(l,d){u("EnumBody",l,d)},s.assertEnumBooleanBody=function(l,d){u("EnumBooleanBody",l,d)},s.assertEnumBooleanMember=function(l,d){u("EnumBooleanMember",l,d)},s.assertEnumDeclaration=function(l,d){u("EnumDeclaration",l,d)},s.assertEnumDefaultedMember=function(l,d){u("EnumDefaultedMember",l,d)},s.assertEnumMember=function(l,d){u("EnumMember",l,d)},s.assertEnumNumberBody=function(l,d){u("EnumNumberBody",l,d)},s.assertEnumNumberMember=function(l,d){u("EnumNumberMember",l,d)},s.assertEnumStringBody=function(l,d){u("EnumStringBody",l,d)},s.assertEnumStringMember=function(l,d){u("EnumStringMember",l,d)},s.assertEnumSymbolBody=function(l,d){u("EnumSymbolBody",l,d)},s.assertExistsTypeAnnotation=function(l,d){u("ExistsTypeAnnotation",l,d)},s.assertExportAllDeclaration=function(l,d){u("ExportAllDeclaration",l,d)},s.assertExportDeclaration=function(l,d){u("ExportDeclaration",l,d)},s.assertExportDefaultDeclaration=function(l,d){u("ExportDefaultDeclaration",l,d)},s.assertExportDefaultSpecifier=function(l,d){u("ExportDefaultSpecifier",l,d)},s.assertExportNamedDeclaration=function(l,d){u("ExportNamedDeclaration",l,d)},s.assertExportNamespaceSpecifier=function(l,d){u("ExportNamespaceSpecifier",l,d)},s.assertExportSpecifier=function(l,d){u("ExportSpecifier",l,d)},s.assertExpression=function(l,d){u("Expression",l,d)},s.assertExpressionStatement=function(l,d){u("ExpressionStatement",l,d)},s.assertExpressionWrapper=function(l,d){u("ExpressionWrapper",l,d)},s.assertFile=function(l,d){u("File",l,d)},s.assertFlow=function(l,d){u("Flow",l,d)},s.assertFlowBaseAnnotation=function(l,d){u("FlowBaseAnnotation",l,d)},s.assertFlowDeclaration=function(l,d){u("FlowDeclaration",l,d)},s.assertFlowPredicate=function(l,d){u("FlowPredicate",l,d)},s.assertFlowType=function(l,d){u("FlowType",l,d)},s.assertFor=function(l,d){u("For",l,d)},s.assertForInStatement=function(l,d){u("ForInStatement",l,d)},s.assertForOfStatement=function(l,d){u("ForOfStatement",l,d)},s.assertForStatement=function(l,d){u("ForStatement",l,d)},s.assertForXStatement=function(l,d){u("ForXStatement",l,d)},s.assertFunction=function(l,d){u("Function",l,d)},s.assertFunctionDeclaration=function(l,d){u("FunctionDeclaration",l,d)},s.assertFunctionExpression=function(l,d){u("FunctionExpression",l,d)},s.assertFunctionParameter=function(l,d){u("FunctionParameter",l,d)},s.assertFunctionParent=function(l,d){u("FunctionParent",l,d)},s.assertFunctionTypeAnnotation=function(l,d){u("FunctionTypeAnnotation",l,d)},s.assertFunctionTypeParam=function(l,d){u("FunctionTypeParam",l,d)},s.assertGenericTypeAnnotation=function(l,d){u("GenericTypeAnnotation",l,d)},s.assertIdentifier=function(l,d){u("Identifier",l,d)},s.assertIfStatement=function(l,d){u("IfStatement",l,d)},s.assertImmutable=function(l,d){u("Immutable",l,d)},s.assertImport=function(l,d){u("Import",l,d)},s.assertImportAttribute=function(l,d){u("ImportAttribute",l,d)},s.assertImportDeclaration=function(l,d){u("ImportDeclaration",l,d)},s.assertImportDefaultSpecifier=function(l,d){u("ImportDefaultSpecifier",l,d)},s.assertImportExpression=function(l,d){u("ImportExpression",l,d)},s.assertImportNamespaceSpecifier=function(l,d){u("ImportNamespaceSpecifier",l,d)},s.assertImportOrExportDeclaration=function(l,d){u("ImportOrExportDeclaration",l,d)},s.assertImportSpecifier=function(l,d){u("ImportSpecifier",l,d)},s.assertIndexedAccessType=function(l,d){u("IndexedAccessType",l,d)},s.assertInferredPredicate=function(l,d){u("InferredPredicate",l,d)},s.assertInterfaceDeclaration=function(l,d){u("InterfaceDeclaration",l,d)},s.assertInterfaceExtends=function(l,d){u("InterfaceExtends",l,d)},s.assertInterfaceTypeAnnotation=function(l,d){u("InterfaceTypeAnnotation",l,d)},s.assertInterpreterDirective=function(l,d){u("InterpreterDirective",l,d)},s.assertIntersectionTypeAnnotation=function(l,d){u("IntersectionTypeAnnotation",l,d)},s.assertJSX=function(l,d){u("JSX",l,d)},s.assertJSXAttribute=function(l,d){u("JSXAttribute",l,d)},s.assertJSXClosingElement=function(l,d){u("JSXClosingElement",l,d)},s.assertJSXClosingFragment=function(l,d){u("JSXClosingFragment",l,d)},s.assertJSXElement=function(l,d){u("JSXElement",l,d)},s.assertJSXEmptyExpression=function(l,d){u("JSXEmptyExpression",l,d)},s.assertJSXExpressionContainer=function(l,d){u("JSXExpressionContainer",l,d)},s.assertJSXFragment=function(l,d){u("JSXFragment",l,d)},s.assertJSXIdentifier=function(l,d){u("JSXIdentifier",l,d)},s.assertJSXMemberExpression=function(l,d){u("JSXMemberExpression",l,d)},s.assertJSXNamespacedName=function(l,d){u("JSXNamespacedName",l,d)},s.assertJSXOpeningElement=function(l,d){u("JSXOpeningElement",l,d)},s.assertJSXOpeningFragment=function(l,d){u("JSXOpeningFragment",l,d)},s.assertJSXSpreadAttribute=function(l,d){u("JSXSpreadAttribute",l,d)},s.assertJSXSpreadChild=function(l,d){u("JSXSpreadChild",l,d)},s.assertJSXText=function(l,d){u("JSXText",l,d)},s.assertLVal=function(l,d){u("LVal",l,d)},s.assertLabeledStatement=function(l,d){u("LabeledStatement",l,d)},s.assertLiteral=function(l,d){u("Literal",l,d)},s.assertLogicalExpression=function(l,d){u("LogicalExpression",l,d)},s.assertLoop=function(l,d){u("Loop",l,d)},s.assertMemberExpression=function(l,d){u("MemberExpression",l,d)},s.assertMetaProperty=function(l,d){u("MetaProperty",l,d)},s.assertMethod=function(l,d){u("Method",l,d)},s.assertMiscellaneous=function(l,d){u("Miscellaneous",l,d)},s.assertMixedTypeAnnotation=function(l,d){u("MixedTypeAnnotation",l,d)},s.assertModuleDeclaration=function(l,d){(0,c.default)("assertModuleDeclaration","assertImportOrExportDeclaration"),u("ModuleDeclaration",l,d)},s.assertModuleExpression=function(l,d){u("ModuleExpression",l,d)},s.assertModuleSpecifier=function(l,d){u("ModuleSpecifier",l,d)},s.assertNewExpression=function(l,d){u("NewExpression",l,d)},s.assertNoop=function(l,d){u("Noop",l,d)},s.assertNullLiteral=function(l,d){u("NullLiteral",l,d)},s.assertNullLiteralTypeAnnotation=function(l,d){u("NullLiteralTypeAnnotation",l,d)},s.assertNullableTypeAnnotation=function(l,d){u("NullableTypeAnnotation",l,d)},s.assertNumberLiteral=function(l,d){(0,c.default)("assertNumberLiteral","assertNumericLiteral"),u("NumberLiteral",l,d)},s.assertNumberLiteralTypeAnnotation=function(l,d){u("NumberLiteralTypeAnnotation",l,d)},s.assertNumberTypeAnnotation=function(l,d){u("NumberTypeAnnotation",l,d)},s.assertNumericLiteral=function(l,d){u("NumericLiteral",l,d)},s.assertObjectExpression=function(l,d){u("ObjectExpression",l,d)},s.assertObjectMember=function(l,d){u("ObjectMember",l,d)},s.assertObjectMethod=function(l,d){u("ObjectMethod",l,d)},s.assertObjectPattern=function(l,d){u("ObjectPattern",l,d)},s.assertObjectProperty=function(l,d){u("ObjectProperty",l,d)},s.assertObjectTypeAnnotation=function(l,d){u("ObjectTypeAnnotation",l,d)},s.assertObjectTypeCallProperty=function(l,d){u("ObjectTypeCallProperty",l,d)},s.assertObjectTypeIndexer=function(l,d){u("ObjectTypeIndexer",l,d)},s.assertObjectTypeInternalSlot=function(l,d){u("ObjectTypeInternalSlot",l,d)},s.assertObjectTypeProperty=function(l,d){u("ObjectTypeProperty",l,d)},s.assertObjectTypeSpreadProperty=function(l,d){u("ObjectTypeSpreadProperty",l,d)},s.assertOpaqueType=function(l,d){u("OpaqueType",l,d)},s.assertOptionalCallExpression=function(l,d){u("OptionalCallExpression",l,d)},s.assertOptionalIndexedAccessType=function(l,d){u("OptionalIndexedAccessType",l,d)},s.assertOptionalMemberExpression=function(l,d){u("OptionalMemberExpression",l,d)},s.assertParenthesizedExpression=function(l,d){u("ParenthesizedExpression",l,d)},s.assertPattern=function(l,d){u("Pattern",l,d)},s.assertPatternLike=function(l,d){u("PatternLike",l,d)},s.assertPipelineBareFunction=function(l,d){u("PipelineBareFunction",l,d)},s.assertPipelinePrimaryTopicReference=function(l,d){u("PipelinePrimaryTopicReference",l,d)},s.assertPipelineTopicExpression=function(l,d){u("PipelineTopicExpression",l,d)},s.assertPlaceholder=function(l,d){u("Placeholder",l,d)},s.assertPrivate=function(l,d){u("Private",l,d)},s.assertPrivateName=function(l,d){u("PrivateName",l,d)},s.assertProgram=function(l,d){u("Program",l,d)},s.assertProperty=function(l,d){u("Property",l,d)},s.assertPureish=function(l,d){u("Pureish",l,d)},s.assertQualifiedTypeIdentifier=function(l,d){u("QualifiedTypeIdentifier",l,d)},s.assertRecordExpression=function(l,d){u("RecordExpression",l,d)},s.assertRegExpLiteral=function(l,d){u("RegExpLiteral",l,d)},s.assertRegexLiteral=function(l,d){(0,c.default)("assertRegexLiteral","assertRegExpLiteral"),u("RegexLiteral",l,d)},s.assertRestElement=function(l,d){u("RestElement",l,d)},s.assertRestProperty=function(l,d){(0,c.default)("assertRestProperty","assertRestElement"),u("RestProperty",l,d)},s.assertReturnStatement=function(l,d){u("ReturnStatement",l,d)},s.assertScopable=function(l,d){u("Scopable",l,d)},s.assertSequenceExpression=function(l,d){u("SequenceExpression",l,d)},s.assertSpreadElement=function(l,d){u("SpreadElement",l,d)},s.assertSpreadProperty=function(l,d){(0,c.default)("assertSpreadProperty","assertSpreadElement"),u("SpreadProperty",l,d)},s.assertStandardized=function(l,d){u("Standardized",l,d)},s.assertStatement=function(l,d){u("Statement",l,d)},s.assertStaticBlock=function(l,d){u("StaticBlock",l,d)},s.assertStringLiteral=function(l,d){u("StringLiteral",l,d)},s.assertStringLiteralTypeAnnotation=function(l,d){u("StringLiteralTypeAnnotation",l,d)},s.assertStringTypeAnnotation=function(l,d){u("StringTypeAnnotation",l,d)},s.assertSuper=function(l,d){u("Super",l,d)},s.assertSwitchCase=function(l,d){u("SwitchCase",l,d)},s.assertSwitchStatement=function(l,d){u("SwitchStatement",l,d)},s.assertSymbolTypeAnnotation=function(l,d){u("SymbolTypeAnnotation",l,d)},s.assertTSAnyKeyword=function(l,d){u("TSAnyKeyword",l,d)},s.assertTSArrayType=function(l,d){u("TSArrayType",l,d)},s.assertTSAsExpression=function(l,d){u("TSAsExpression",l,d)},s.assertTSBaseType=function(l,d){u("TSBaseType",l,d)},s.assertTSBigIntKeyword=function(l,d){u("TSBigIntKeyword",l,d)},s.assertTSBooleanKeyword=function(l,d){u("TSBooleanKeyword",l,d)},s.assertTSCallSignatureDeclaration=function(l,d){u("TSCallSignatureDeclaration",l,d)},s.assertTSConditionalType=function(l,d){u("TSConditionalType",l,d)},s.assertTSConstructSignatureDeclaration=function(l,d){u("TSConstructSignatureDeclaration",l,d)},s.assertTSConstructorType=function(l,d){u("TSConstructorType",l,d)},s.assertTSDeclareFunction=function(l,d){u("TSDeclareFunction",l,d)},s.assertTSDeclareMethod=function(l,d){u("TSDeclareMethod",l,d)},s.assertTSEntityName=function(l,d){u("TSEntityName",l,d)},s.assertTSEnumBody=function(l,d){u("TSEnumBody",l,d)},s.assertTSEnumDeclaration=function(l,d){u("TSEnumDeclaration",l,d)},s.assertTSEnumMember=function(l,d){u("TSEnumMember",l,d)},s.assertTSExportAssignment=function(l,d){u("TSExportAssignment",l,d)},s.assertTSExpressionWithTypeArguments=function(l,d){u("TSExpressionWithTypeArguments",l,d)},s.assertTSExternalModuleReference=function(l,d){u("TSExternalModuleReference",l,d)},s.assertTSFunctionType=function(l,d){u("TSFunctionType",l,d)},s.assertTSImportEqualsDeclaration=function(l,d){u("TSImportEqualsDeclaration",l,d)},s.assertTSImportType=function(l,d){u("TSImportType",l,d)},s.assertTSIndexSignature=function(l,d){u("TSIndexSignature",l,d)},s.assertTSIndexedAccessType=function(l,d){u("TSIndexedAccessType",l,d)},s.assertTSInferType=function(l,d){u("TSInferType",l,d)},s.assertTSInstantiationExpression=function(l,d){u("TSInstantiationExpression",l,d)},s.assertTSInterfaceBody=function(l,d){u("TSInterfaceBody",l,d)},s.assertTSInterfaceDeclaration=function(l,d){u("TSInterfaceDeclaration",l,d)},s.assertTSIntersectionType=function(l,d){u("TSIntersectionType",l,d)},s.assertTSIntrinsicKeyword=function(l,d){u("TSIntrinsicKeyword",l,d)},s.assertTSLiteralType=function(l,d){u("TSLiteralType",l,d)},s.assertTSMappedType=function(l,d){u("TSMappedType",l,d)},s.assertTSMethodSignature=function(l,d){u("TSMethodSignature",l,d)},s.assertTSModuleBlock=function(l,d){u("TSModuleBlock",l,d)},s.assertTSModuleDeclaration=function(l,d){u("TSModuleDeclaration",l,d)},s.assertTSNamedTupleMember=function(l,d){u("TSNamedTupleMember",l,d)},s.assertTSNamespaceExportDeclaration=function(l,d){u("TSNamespaceExportDeclaration",l,d)},s.assertTSNeverKeyword=function(l,d){u("TSNeverKeyword",l,d)},s.assertTSNonNullExpression=function(l,d){u("TSNonNullExpression",l,d)},s.assertTSNullKeyword=function(l,d){u("TSNullKeyword",l,d)},s.assertTSNumberKeyword=function(l,d){u("TSNumberKeyword",l,d)},s.assertTSObjectKeyword=function(l,d){u("TSObjectKeyword",l,d)},s.assertTSOptionalType=function(l,d){u("TSOptionalType",l,d)},s.assertTSParameterProperty=function(l,d){u("TSParameterProperty",l,d)},s.assertTSParenthesizedType=function(l,d){u("TSParenthesizedType",l,d)},s.assertTSPropertySignature=function(l,d){u("TSPropertySignature",l,d)},s.assertTSQualifiedName=function(l,d){u("TSQualifiedName",l,d)},s.assertTSRestType=function(l,d){u("TSRestType",l,d)},s.assertTSSatisfiesExpression=function(l,d){u("TSSatisfiesExpression",l,d)},s.assertTSStringKeyword=function(l,d){u("TSStringKeyword",l,d)},s.assertTSSymbolKeyword=function(l,d){u("TSSymbolKeyword",l,d)},s.assertTSTemplateLiteralType=function(l,d){u("TSTemplateLiteralType",l,d)},s.assertTSThisType=function(l,d){u("TSThisType",l,d)},s.assertTSTupleType=function(l,d){u("TSTupleType",l,d)},s.assertTSType=function(l,d){u("TSType",l,d)},s.assertTSTypeAliasDeclaration=function(l,d){u("TSTypeAliasDeclaration",l,d)},s.assertTSTypeAnnotation=function(l,d){u("TSTypeAnnotation",l,d)},s.assertTSTypeAssertion=function(l,d){u("TSTypeAssertion",l,d)},s.assertTSTypeElement=function(l,d){u("TSTypeElement",l,d)},s.assertTSTypeLiteral=function(l,d){u("TSTypeLiteral",l,d)},s.assertTSTypeOperator=function(l,d){u("TSTypeOperator",l,d)},s.assertTSTypeParameter=function(l,d){u("TSTypeParameter",l,d)},s.assertTSTypeParameterDeclaration=function(l,d){u("TSTypeParameterDeclaration",l,d)},s.assertTSTypeParameterInstantiation=function(l,d){u("TSTypeParameterInstantiation",l,d)},s.assertTSTypePredicate=function(l,d){u("TSTypePredicate",l,d)},s.assertTSTypeQuery=function(l,d){u("TSTypeQuery",l,d)},s.assertTSTypeReference=function(l,d){u("TSTypeReference",l,d)},s.assertTSUndefinedKeyword=function(l,d){u("TSUndefinedKeyword",l,d)},s.assertTSUnionType=function(l,d){u("TSUnionType",l,d)},s.assertTSUnknownKeyword=function(l,d){u("TSUnknownKeyword",l,d)},s.assertTSVoidKeyword=function(l,d){u("TSVoidKeyword",l,d)},s.assertTaggedTemplateExpression=function(l,d){u("TaggedTemplateExpression",l,d)},s.assertTemplateElement=function(l,d){u("TemplateElement",l,d)},s.assertTemplateLiteral=function(l,d){u("TemplateLiteral",l,d)},s.assertTerminatorless=function(l,d){u("Terminatorless",l,d)},s.assertThisExpression=function(l,d){u("ThisExpression",l,d)},s.assertThisTypeAnnotation=function(l,d){u("ThisTypeAnnotation",l,d)},s.assertThrowStatement=function(l,d){u("ThrowStatement",l,d)},s.assertTopicReference=function(l,d){u("TopicReference",l,d)},s.assertTryStatement=function(l,d){u("TryStatement",l,d)},s.assertTupleExpression=function(l,d){u("TupleExpression",l,d)},s.assertTupleTypeAnnotation=function(l,d){u("TupleTypeAnnotation",l,d)},s.assertTypeAlias=function(l,d){u("TypeAlias",l,d)},s.assertTypeAnnotation=function(l,d){u("TypeAnnotation",l,d)},s.assertTypeCastExpression=function(l,d){u("TypeCastExpression",l,d)},s.assertTypeParameter=function(l,d){u("TypeParameter",l,d)},s.assertTypeParameterDeclaration=function(l,d){u("TypeParameterDeclaration",l,d)},s.assertTypeParameterInstantiation=function(l,d){u("TypeParameterInstantiation",l,d)},s.assertTypeScript=function(l,d){u("TypeScript",l,d)},s.assertTypeofTypeAnnotation=function(l,d){u("TypeofTypeAnnotation",l,d)},s.assertUnaryExpression=function(l,d){u("UnaryExpression",l,d)},s.assertUnaryLike=function(l,d){u("UnaryLike",l,d)},s.assertUnionTypeAnnotation=function(l,d){u("UnionTypeAnnotation",l,d)},s.assertUpdateExpression=function(l,d){u("UpdateExpression",l,d)},s.assertUserWhitespacable=function(l,d){u("UserWhitespacable",l,d)},s.assertV8IntrinsicIdentifier=function(l,d){u("V8IntrinsicIdentifier",l,d)},s.assertVariableDeclaration=function(l,d){u("VariableDeclaration",l,d)},s.assertVariableDeclarator=function(l,d){u("VariableDeclarator",l,d)},s.assertVariance=function(l,d){u("Variance",l,d)},s.assertVoidPattern=function(l,d){u("VoidPattern",l,d)},s.assertVoidTypeAnnotation=function(l,d){u("VoidTypeAnnotation",l,d)},s.assertWhile=function(l,d){u("While",l,d)},s.assertWhileStatement=function(l,d){u("WhileStatement",l,d)},s.assertWithStatement=function(l,d){u("WithStatement",l,d)},s.assertYieldExpression=function(l,d){u("YieldExpression",l,d)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/is.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/deprecationWarning.js");function u(l,d,m){if(!(0,a.default)(l,d,m))throw new Error(`Expected type "${l}" with option ${JSON.stringify(m)}, but instead got "${d.type}".`)}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(u){let l=(0,c.default)(u);return l.length===1?l[0]:(0,a.unionTypeAnnotation)(l)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js");s.default=function(c){switch(c){case"string":return(0,a.stringTypeAnnotation)();case"number":return(0,a.numberTypeAnnotation)();case"undefined":return(0,a.voidTypeAnnotation)();case"boolean":return(0,a.booleanTypeAnnotation)();case"function":return(0,a.genericTypeAnnotation)((0,a.identifier)("Function"));case"object":return(0,a.genericTypeAnnotation)((0,a.identifier)("Object"));case"symbol":return(0,a.genericTypeAnnotation)((0,a.identifier)("Symbol"));case"bigint":return(0,a.anyTypeAnnotation)()}throw new Error("Invalid typeof value: "+c)}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/lowercase.js");Object.keys(a).forEach(function(u){u!=="default"&&u!=="__esModule"&&(u in s&&s[u]===a[u]||Object.defineProperty(s,u,{enumerable:!0,get:function(){return a[u]}}))});var c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/uppercase.js");Object.keys(c).forEach(function(u){u!=="default"&&u!=="__esModule"&&(u in s&&s[u]===c[u]||Object.defineProperty(s,u,{enumerable:!0,get:function(){return c[u]}}))})},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/lowercase.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.anyTypeAnnotation=function(){return{type:"AnyTypeAnnotation"}},s.argumentPlaceholder=function(){return{type:"ArgumentPlaceholder"}},s.arrayExpression=function(A=[]){let y={type:"ArrayExpression",elements:A},E=d.ArrayExpression;return l(E.elements,y,"elements",A,1),y},s.arrayPattern=function(A){let y={type:"ArrayPattern",elements:A},E=d.ArrayPattern;return l(E.elements,y,"elements",A,1),y},s.arrayTypeAnnotation=function(A){let y={type:"ArrayTypeAnnotation",elementType:A},E=d.ArrayTypeAnnotation;return l(E.elementType,y,"elementType",A,1),y},s.arrowFunctionExpression=function(A,y,E=!1){let _={type:"ArrowFunctionExpression",params:A,body:y,async:E,expression:null},S=d.ArrowFunctionExpression;return l(S.params,_,"params",A,1),l(S.body,_,"body",y,1),l(S.async,_,"async",E),_},s.assignmentExpression=function(A,y,E){let _={type:"AssignmentExpression",operator:A,left:y,right:E},S=d.AssignmentExpression;return l(S.operator,_,"operator",A),l(S.left,_,"left",y,1),l(S.right,_,"right",E,1),_},s.assignmentPattern=function(A,y){let E={type:"AssignmentPattern",left:A,right:y},_=d.AssignmentPattern;return l(_.left,E,"left",A,1),l(_.right,E,"right",y,1),E},s.awaitExpression=function(A){let y={type:"AwaitExpression",argument:A},E=d.AwaitExpression;return l(E.argument,y,"argument",A,1),y},s.bigIntLiteral=function(A){typeof A=="bigint"&&(A=A.toString());let y={type:"BigIntLiteral",value:A},E=d.BigIntLiteral;return l(E.value,y,"value",A),y},s.binaryExpression=function(A,y,E){let _={type:"BinaryExpression",operator:A,left:y,right:E},S=d.BinaryExpression;return l(S.operator,_,"operator",A),l(S.left,_,"left",y,1),l(S.right,_,"right",E,1),_},s.bindExpression=function(A,y){let E={type:"BindExpression",object:A,callee:y},_=d.BindExpression;return l(_.object,E,"object",A,1),l(_.callee,E,"callee",y,1),E},s.blockStatement=function(A,y=[]){let E={type:"BlockStatement",body:A,directives:y},_=d.BlockStatement;return l(_.body,E,"body",A,1),l(_.directives,E,"directives",y,1),E},s.booleanLiteral=function(A){let y={type:"BooleanLiteral",value:A},E=d.BooleanLiteral;return l(E.value,y,"value",A),y},s.booleanLiteralTypeAnnotation=function(A){let y={type:"BooleanLiteralTypeAnnotation",value:A},E=d.BooleanLiteralTypeAnnotation;return l(E.value,y,"value",A),y},s.booleanTypeAnnotation=function(){return{type:"BooleanTypeAnnotation"}},s.breakStatement=function(A=null){let y={type:"BreakStatement",label:A},E=d.BreakStatement;return l(E.label,y,"label",A,1),y},s.callExpression=function(A,y){let E={type:"CallExpression",callee:A,arguments:y},_=d.CallExpression;return l(_.callee,E,"callee",A,1),l(_.arguments,E,"arguments",y,1),E},s.catchClause=function(A=null,y){let E={type:"CatchClause",param:A,body:y},_=d.CatchClause;return l(_.param,E,"param",A,1),l(_.body,E,"body",y,1),E},s.classAccessorProperty=function(A,y=null,E=null,_=null,S=!1,C=!1){let I={type:"ClassAccessorProperty",key:A,value:y,typeAnnotation:E,decorators:_,computed:S,static:C},w=d.ClassAccessorProperty;return l(w.key,I,"key",A,1),l(w.value,I,"value",y,1),l(w.typeAnnotation,I,"typeAnnotation",E,1),l(w.decorators,I,"decorators",_,1),l(w.computed,I,"computed",S),l(w.static,I,"static",C),I},s.classBody=function(A){let y={type:"ClassBody",body:A},E=d.ClassBody;return l(E.body,y,"body",A,1),y},s.classDeclaration=function(A=null,y=null,E,_=null){let S={type:"ClassDeclaration",id:A,superClass:y,body:E,decorators:_},C=d.ClassDeclaration;return l(C.id,S,"id",A,1),l(C.superClass,S,"superClass",y,1),l(C.body,S,"body",E,1),l(C.decorators,S,"decorators",_,1),S},s.classExpression=function(A=null,y=null,E,_=null){let S={type:"ClassExpression",id:A,superClass:y,body:E,decorators:_},C=d.ClassExpression;return l(C.id,S,"id",A,1),l(C.superClass,S,"superClass",y,1),l(C.body,S,"body",E,1),l(C.decorators,S,"decorators",_,1),S},s.classImplements=function(A,y=null){let E={type:"ClassImplements",id:A,typeParameters:y},_=d.ClassImplements;return l(_.id,E,"id",A,1),l(_.typeParameters,E,"typeParameters",y,1),E},s.classMethod=function(A="method",y,E,_,S=!1,C=!1,I=!1,w=!1){let k={type:"ClassMethod",kind:A,key:y,params:E,body:_,computed:S,static:C,generator:I,async:w},N=d.ClassMethod;return l(N.kind,k,"kind",A),l(N.key,k,"key",y,1),l(N.params,k,"params",E,1),l(N.body,k,"body",_,1),l(N.computed,k,"computed",S),l(N.static,k,"static",C),l(N.generator,k,"generator",I),l(N.async,k,"async",w),k},s.classPrivateMethod=function(A="method",y,E,_,S=!1){let C={type:"ClassPrivateMethod",kind:A,key:y,params:E,body:_,static:S},I=d.ClassPrivateMethod;return l(I.kind,C,"kind",A),l(I.key,C,"key",y,1),l(I.params,C,"params",E,1),l(I.body,C,"body",_,1),l(I.static,C,"static",S),C},s.classPrivateProperty=function(A,y=null,E=null,_=!1){let S={type:"ClassPrivateProperty",key:A,value:y,decorators:E,static:_},C=d.ClassPrivateProperty;return l(C.key,S,"key",A,1),l(C.value,S,"value",y,1),l(C.decorators,S,"decorators",E,1),l(C.static,S,"static",_),S},s.classProperty=function(A,y=null,E=null,_=null,S=!1,C=!1){let I={type:"ClassProperty",key:A,value:y,typeAnnotation:E,decorators:_,computed:S,static:C},w=d.ClassProperty;return l(w.key,I,"key",A,1),l(w.value,I,"value",y,1),l(w.typeAnnotation,I,"typeAnnotation",E,1),l(w.decorators,I,"decorators",_,1),l(w.computed,I,"computed",S),l(w.static,I,"static",C),I},s.conditionalExpression=function(A,y,E){let _={type:"ConditionalExpression",test:A,consequent:y,alternate:E},S=d.ConditionalExpression;return l(S.test,_,"test",A,1),l(S.consequent,_,"consequent",y,1),l(S.alternate,_,"alternate",E,1),_},s.continueStatement=function(A=null){let y={type:"ContinueStatement",label:A},E=d.ContinueStatement;return l(E.label,y,"label",A,1),y},s.debuggerStatement=function(){return{type:"DebuggerStatement"}},s.decimalLiteral=function(A){let y={type:"DecimalLiteral",value:A},E=d.DecimalLiteral;return l(E.value,y,"value",A),y},s.declareClass=function(A,y=null,E=null,_){let S={type:"DeclareClass",id:A,typeParameters:y,extends:E,body:_},C=d.DeclareClass;return l(C.id,S,"id",A,1),l(C.typeParameters,S,"typeParameters",y,1),l(C.extends,S,"extends",E,1),l(C.body,S,"body",_,1),S},s.declareExportAllDeclaration=function(A,y=null){let E={type:"DeclareExportAllDeclaration",source:A,attributes:y},_=d.DeclareExportAllDeclaration;return l(_.source,E,"source",A,1),l(_.attributes,E,"attributes",y,1),E},s.declareExportDeclaration=function(A=null,y=null,E=null,_=null){let S={type:"DeclareExportDeclaration",declaration:A,specifiers:y,source:E,attributes:_},C=d.DeclareExportDeclaration;return l(C.declaration,S,"declaration",A,1),l(C.specifiers,S,"specifiers",y,1),l(C.source,S,"source",E,1),l(C.attributes,S,"attributes",_,1),S},s.declareFunction=function(A){let y={type:"DeclareFunction",id:A},E=d.DeclareFunction;return l(E.id,y,"id",A,1),y},s.declareInterface=function(A,y=null,E=null,_){let S={type:"DeclareInterface",id:A,typeParameters:y,extends:E,body:_},C=d.DeclareInterface;return l(C.id,S,"id",A,1),l(C.typeParameters,S,"typeParameters",y,1),l(C.extends,S,"extends",E,1),l(C.body,S,"body",_,1),S},s.declareModule=function(A,y,E=null){let _={type:"DeclareModule",id:A,body:y,kind:E},S=d.DeclareModule;return l(S.id,_,"id",A,1),l(S.body,_,"body",y,1),l(S.kind,_,"kind",E),_},s.declareModuleExports=function(A){let y={type:"DeclareModuleExports",typeAnnotation:A},E=d.DeclareModuleExports;return l(E.typeAnnotation,y,"typeAnnotation",A,1),y},s.declareOpaqueType=function(A,y=null,E=null){let _={type:"DeclareOpaqueType",id:A,typeParameters:y,supertype:E},S=d.DeclareOpaqueType;return l(S.id,_,"id",A,1),l(S.typeParameters,_,"typeParameters",y,1),l(S.supertype,_,"supertype",E,1),_},s.declareTypeAlias=function(A,y=null,E){let _={type:"DeclareTypeAlias",id:A,typeParameters:y,right:E},S=d.DeclareTypeAlias;return l(S.id,_,"id",A,1),l(S.typeParameters,_,"typeParameters",y,1),l(S.right,_,"right",E,1),_},s.declareVariable=function(A){let y={type:"DeclareVariable",id:A},E=d.DeclareVariable;return l(E.id,y,"id",A,1),y},s.declaredPredicate=function(A){let y={type:"DeclaredPredicate",value:A},E=d.DeclaredPredicate;return l(E.value,y,"value",A,1),y},s.decorator=function(A){let y={type:"Decorator",expression:A},E=d.Decorator;return l(E.expression,y,"expression",A,1),y},s.directive=function(A){let y={type:"Directive",value:A},E=d.Directive;return l(E.value,y,"value",A,1),y},s.directiveLiteral=function(A){let y={type:"DirectiveLiteral",value:A},E=d.DirectiveLiteral;return l(E.value,y,"value",A),y},s.doExpression=function(A,y=!1){let E={type:"DoExpression",body:A,async:y},_=d.DoExpression;return l(_.body,E,"body",A,1),l(_.async,E,"async",y),E},s.doWhileStatement=function(A,y){let E={type:"DoWhileStatement",test:A,body:y},_=d.DoWhileStatement;return l(_.test,E,"test",A,1),l(_.body,E,"body",y,1),E},s.emptyStatement=function(){return{type:"EmptyStatement"}},s.emptyTypeAnnotation=function(){return{type:"EmptyTypeAnnotation"}},s.enumBooleanBody=function(A){let y={type:"EnumBooleanBody",members:A,explicitType:null,hasUnknownMembers:null},E=d.EnumBooleanBody;return l(E.members,y,"members",A,1),y},s.enumBooleanMember=function(A){let y={type:"EnumBooleanMember",id:A,init:null},E=d.EnumBooleanMember;return l(E.id,y,"id",A,1),y},s.enumDeclaration=function(A,y){let E={type:"EnumDeclaration",id:A,body:y},_=d.EnumDeclaration;return l(_.id,E,"id",A,1),l(_.body,E,"body",y,1),E},s.enumDefaultedMember=function(A){let y={type:"EnumDefaultedMember",id:A},E=d.EnumDefaultedMember;return l(E.id,y,"id",A,1),y},s.enumNumberBody=function(A){let y={type:"EnumNumberBody",members:A,explicitType:null,hasUnknownMembers:null},E=d.EnumNumberBody;return l(E.members,y,"members",A,1),y},s.enumNumberMember=function(A,y){let E={type:"EnumNumberMember",id:A,init:y},_=d.EnumNumberMember;return l(_.id,E,"id",A,1),l(_.init,E,"init",y,1),E},s.enumStringBody=function(A){let y={type:"EnumStringBody",members:A,explicitType:null,hasUnknownMembers:null},E=d.EnumStringBody;return l(E.members,y,"members",A,1),y},s.enumStringMember=function(A,y){let E={type:"EnumStringMember",id:A,init:y},_=d.EnumStringMember;return l(_.id,E,"id",A,1),l(_.init,E,"init",y,1),E},s.enumSymbolBody=function(A){let y={type:"EnumSymbolBody",members:A,hasUnknownMembers:null},E=d.EnumSymbolBody;return l(E.members,y,"members",A,1),y},s.existsTypeAnnotation=function(){return{type:"ExistsTypeAnnotation"}},s.exportAllDeclaration=function(A,y=null){let E={type:"ExportAllDeclaration",source:A,attributes:y},_=d.ExportAllDeclaration;return l(_.source,E,"source",A,1),l(_.attributes,E,"attributes",y,1),E},s.exportDefaultDeclaration=function(A){let y={type:"ExportDefaultDeclaration",declaration:A},E=d.ExportDefaultDeclaration;return l(E.declaration,y,"declaration",A,1),y},s.exportDefaultSpecifier=function(A){let y={type:"ExportDefaultSpecifier",exported:A},E=d.ExportDefaultSpecifier;return l(E.exported,y,"exported",A,1),y},s.exportNamedDeclaration=function(A=null,y=[],E=null,_=null){let S={type:"ExportNamedDeclaration",declaration:A,specifiers:y,source:E,attributes:_},C=d.ExportNamedDeclaration;return l(C.declaration,S,"declaration",A,1),l(C.specifiers,S,"specifiers",y,1),l(C.source,S,"source",E,1),l(C.attributes,S,"attributes",_,1),S},s.exportNamespaceSpecifier=function(A){let y={type:"ExportNamespaceSpecifier",exported:A},E=d.ExportNamespaceSpecifier;return l(E.exported,y,"exported",A,1),y},s.exportSpecifier=function(A,y){let E={type:"ExportSpecifier",local:A,exported:y},_=d.ExportSpecifier;return l(_.local,E,"local",A,1),l(_.exported,E,"exported",y,1),E},s.expressionStatement=function(A){let y={type:"ExpressionStatement",expression:A},E=d.ExpressionStatement;return l(E.expression,y,"expression",A,1),y},s.file=function(A,y=null,E=null){let _={type:"File",program:A,comments:y,tokens:E},S=d.File;return l(S.program,_,"program",A,1),l(S.comments,_,"comments",y,1),l(S.tokens,_,"tokens",E),_},s.forInStatement=function(A,y,E){let _={type:"ForInStatement",left:A,right:y,body:E},S=d.ForInStatement;return l(S.left,_,"left",A,1),l(S.right,_,"right",y,1),l(S.body,_,"body",E,1),_},s.forOfStatement=function(A,y,E,_=!1){let S={type:"ForOfStatement",left:A,right:y,body:E,await:_},C=d.ForOfStatement;return l(C.left,S,"left",A,1),l(C.right,S,"right",y,1),l(C.body,S,"body",E,1),l(C.await,S,"await",_),S},s.forStatement=function(A=null,y=null,E=null,_){let S={type:"ForStatement",init:A,test:y,update:E,body:_},C=d.ForStatement;return l(C.init,S,"init",A,1),l(C.test,S,"test",y,1),l(C.update,S,"update",E,1),l(C.body,S,"body",_,1),S},s.functionDeclaration=function(A=null,y,E,_=!1,S=!1){let C={type:"FunctionDeclaration",id:A,params:y,body:E,generator:_,async:S},I=d.FunctionDeclaration;return l(I.id,C,"id",A,1),l(I.params,C,"params",y,1),l(I.body,C,"body",E,1),l(I.generator,C,"generator",_),l(I.async,C,"async",S),C},s.functionExpression=function(A=null,y,E,_=!1,S=!1){let C={type:"FunctionExpression",id:A,params:y,body:E,generator:_,async:S},I=d.FunctionExpression;return l(I.id,C,"id",A,1),l(I.params,C,"params",y,1),l(I.body,C,"body",E,1),l(I.generator,C,"generator",_),l(I.async,C,"async",S),C},s.functionTypeAnnotation=function(A=null,y,E=null,_){let S={type:"FunctionTypeAnnotation",typeParameters:A,params:y,rest:E,returnType:_},C=d.FunctionTypeAnnotation;return l(C.typeParameters,S,"typeParameters",A,1),l(C.params,S,"params",y,1),l(C.rest,S,"rest",E,1),l(C.returnType,S,"returnType",_,1),S},s.functionTypeParam=function(A=null,y){let E={type:"FunctionTypeParam",name:A,typeAnnotation:y},_=d.FunctionTypeParam;return l(_.name,E,"name",A,1),l(_.typeAnnotation,E,"typeAnnotation",y,1),E},s.genericTypeAnnotation=function(A,y=null){let E={type:"GenericTypeAnnotation",id:A,typeParameters:y},_=d.GenericTypeAnnotation;return l(_.id,E,"id",A,1),l(_.typeParameters,E,"typeParameters",y,1),E},s.identifier=function(A){let y={type:"Identifier",name:A},E=d.Identifier;return l(E.name,y,"name",A),y},s.ifStatement=function(A,y,E=null){let _={type:"IfStatement",test:A,consequent:y,alternate:E},S=d.IfStatement;return l(S.test,_,"test",A,1),l(S.consequent,_,"consequent",y,1),l(S.alternate,_,"alternate",E,1),_},s.import=function(){return{type:"Import"}},s.importAttribute=function(A,y){let E={type:"ImportAttribute",key:A,value:y},_=d.ImportAttribute;return l(_.key,E,"key",A,1),l(_.value,E,"value",y,1),E},s.importDeclaration=function(A,y,E=null){let _={type:"ImportDeclaration",specifiers:A,source:y,attributes:E},S=d.ImportDeclaration;return l(S.specifiers,_,"specifiers",A,1),l(S.source,_,"source",y,1),l(S.attributes,_,"attributes",E,1),_},s.importDefaultSpecifier=function(A){let y={type:"ImportDefaultSpecifier",local:A},E=d.ImportDefaultSpecifier;return l(E.local,y,"local",A,1),y},s.importExpression=function(A,y=null){let E={type:"ImportExpression",source:A,options:y},_=d.ImportExpression;return l(_.source,E,"source",A,1),l(_.options,E,"options",y,1),E},s.importNamespaceSpecifier=function(A){let y={type:"ImportNamespaceSpecifier",local:A},E=d.ImportNamespaceSpecifier;return l(E.local,y,"local",A,1),y},s.importSpecifier=function(A,y){let E={type:"ImportSpecifier",local:A,imported:y},_=d.ImportSpecifier;return l(_.local,E,"local",A,1),l(_.imported,E,"imported",y,1),E},s.indexedAccessType=function(A,y){let E={type:"IndexedAccessType",objectType:A,indexType:y},_=d.IndexedAccessType;return l(_.objectType,E,"objectType",A,1),l(_.indexType,E,"indexType",y,1),E},s.inferredPredicate=function(){return{type:"InferredPredicate"}},s.interfaceDeclaration=function(A,y=null,E=null,_){let S={type:"InterfaceDeclaration",id:A,typeParameters:y,extends:E,body:_},C=d.InterfaceDeclaration;return l(C.id,S,"id",A,1),l(C.typeParameters,S,"typeParameters",y,1),l(C.extends,S,"extends",E,1),l(C.body,S,"body",_,1),S},s.interfaceExtends=function(A,y=null){let E={type:"InterfaceExtends",id:A,typeParameters:y},_=d.InterfaceExtends;return l(_.id,E,"id",A,1),l(_.typeParameters,E,"typeParameters",y,1),E},s.interfaceTypeAnnotation=function(A=null,y){let E={type:"InterfaceTypeAnnotation",extends:A,body:y},_=d.InterfaceTypeAnnotation;return l(_.extends,E,"extends",A,1),l(_.body,E,"body",y,1),E},s.interpreterDirective=function(A){let y={type:"InterpreterDirective",value:A},E=d.InterpreterDirective;return l(E.value,y,"value",A),y},s.intersectionTypeAnnotation=function(A){let y={type:"IntersectionTypeAnnotation",types:A},E=d.IntersectionTypeAnnotation;return l(E.types,y,"types",A,1),y},s.jSXAttribute=s.jsxAttribute=function(A,y=null){let E={type:"JSXAttribute",name:A,value:y},_=d.JSXAttribute;return l(_.name,E,"name",A,1),l(_.value,E,"value",y,1),E},s.jSXClosingElement=s.jsxClosingElement=function(A){let y={type:"JSXClosingElement",name:A},E=d.JSXClosingElement;return l(E.name,y,"name",A,1),y},s.jSXClosingFragment=s.jsxClosingFragment=function(){return{type:"JSXClosingFragment"}},s.jSXElement=s.jsxElement=function(A,y=null,E,_=null){let S={type:"JSXElement",openingElement:A,closingElement:y,children:E,selfClosing:_},C=d.JSXElement;return l(C.openingElement,S,"openingElement",A,1),l(C.closingElement,S,"closingElement",y,1),l(C.children,S,"children",E,1),l(C.selfClosing,S,"selfClosing",_),S},s.jSXEmptyExpression=s.jsxEmptyExpression=function(){return{type:"JSXEmptyExpression"}},s.jSXExpressionContainer=s.jsxExpressionContainer=function(A){let y={type:"JSXExpressionContainer",expression:A},E=d.JSXExpressionContainer;return l(E.expression,y,"expression",A,1),y},s.jSXFragment=s.jsxFragment=function(A,y,E){let _={type:"JSXFragment",openingFragment:A,closingFragment:y,children:E},S=d.JSXFragment;return l(S.openingFragment,_,"openingFragment",A,1),l(S.closingFragment,_,"closingFragment",y,1),l(S.children,_,"children",E,1),_},s.jSXIdentifier=s.jsxIdentifier=function(A){let y={type:"JSXIdentifier",name:A},E=d.JSXIdentifier;return l(E.name,y,"name",A),y},s.jSXMemberExpression=s.jsxMemberExpression=function(A,y){let E={type:"JSXMemberExpression",object:A,property:y},_=d.JSXMemberExpression;return l(_.object,E,"object",A,1),l(_.property,E,"property",y,1),E},s.jSXNamespacedName=s.jsxNamespacedName=function(A,y){let E={type:"JSXNamespacedName",namespace:A,name:y},_=d.JSXNamespacedName;return l(_.namespace,E,"namespace",A,1),l(_.name,E,"name",y,1),E},s.jSXOpeningElement=s.jsxOpeningElement=function(A,y,E=!1){let _={type:"JSXOpeningElement",name:A,attributes:y,selfClosing:E},S=d.JSXOpeningElement;return l(S.name,_,"name",A,1),l(S.attributes,_,"attributes",y,1),l(S.selfClosing,_,"selfClosing",E),_},s.jSXOpeningFragment=s.jsxOpeningFragment=function(){return{type:"JSXOpeningFragment"}},s.jSXSpreadAttribute=s.jsxSpreadAttribute=function(A){let y={type:"JSXSpreadAttribute",argument:A},E=d.JSXSpreadAttribute;return l(E.argument,y,"argument",A,1),y},s.jSXSpreadChild=s.jsxSpreadChild=function(A){let y={type:"JSXSpreadChild",expression:A},E=d.JSXSpreadChild;return l(E.expression,y,"expression",A,1),y},s.jSXText=s.jsxText=function(A){let y={type:"JSXText",value:A},E=d.JSXText;return l(E.value,y,"value",A),y},s.labeledStatement=function(A,y){let E={type:"LabeledStatement",label:A,body:y},_=d.LabeledStatement;return l(_.label,E,"label",A,1),l(_.body,E,"body",y,1),E},s.logicalExpression=function(A,y,E){let _={type:"LogicalExpression",operator:A,left:y,right:E},S=d.LogicalExpression;return l(S.operator,_,"operator",A),l(S.left,_,"left",y,1),l(S.right,_,"right",E,1),_},s.memberExpression=function(A,y,E=!1,_=null){let S={type:"MemberExpression",object:A,property:y,computed:E,optional:_},C=d.MemberExpression;return l(C.object,S,"object",A,1),l(C.property,S,"property",y,1),l(C.computed,S,"computed",E),l(C.optional,S,"optional",_),S},s.metaProperty=function(A,y){let E={type:"MetaProperty",meta:A,property:y},_=d.MetaProperty;return l(_.meta,E,"meta",A,1),l(_.property,E,"property",y,1),E},s.mixedTypeAnnotation=function(){return{type:"MixedTypeAnnotation"}},s.moduleExpression=function(A){let y={type:"ModuleExpression",body:A},E=d.ModuleExpression;return l(E.body,y,"body",A,1),y},s.newExpression=function(A,y){let E={type:"NewExpression",callee:A,arguments:y},_=d.NewExpression;return l(_.callee,E,"callee",A,1),l(_.arguments,E,"arguments",y,1),E},s.noop=function(){return{type:"Noop"}},s.nullLiteral=function(){return{type:"NullLiteral"}},s.nullLiteralTypeAnnotation=function(){return{type:"NullLiteralTypeAnnotation"}},s.nullableTypeAnnotation=function(A){let y={type:"NullableTypeAnnotation",typeAnnotation:A},E=d.NullableTypeAnnotation;return l(E.typeAnnotation,y,"typeAnnotation",A,1),y},s.numberLiteral=function(A){return(0,c.default)("NumberLiteral","NumericLiteral","The node type "),m(A)},s.numberLiteralTypeAnnotation=function(A){let y={type:"NumberLiteralTypeAnnotation",value:A},E=d.NumberLiteralTypeAnnotation;return l(E.value,y,"value",A),y},s.numberTypeAnnotation=function(){return{type:"NumberTypeAnnotation"}},s.numericLiteral=m,s.objectExpression=function(A){let y={type:"ObjectExpression",properties:A},E=d.ObjectExpression;return l(E.properties,y,"properties",A,1),y},s.objectMethod=function(A="method",y,E,_,S=!1,C=!1,I=!1){let w={type:"ObjectMethod",kind:A,key:y,params:E,body:_,computed:S,generator:C,async:I},k=d.ObjectMethod;return l(k.kind,w,"kind",A),l(k.key,w,"key",y,1),l(k.params,w,"params",E,1),l(k.body,w,"body",_,1),l(k.computed,w,"computed",S),l(k.generator,w,"generator",C),l(k.async,w,"async",I),w},s.objectPattern=function(A){let y={type:"ObjectPattern",properties:A},E=d.ObjectPattern;return l(E.properties,y,"properties",A,1),y},s.objectProperty=function(A,y,E=!1,_=!1,S=null){let C={type:"ObjectProperty",key:A,value:y,computed:E,shorthand:_,decorators:S},I=d.ObjectProperty;return l(I.key,C,"key",A,1),l(I.value,C,"value",y,1),l(I.computed,C,"computed",E),l(I.shorthand,C,"shorthand",_),l(I.decorators,C,"decorators",S,1),C},s.objectTypeAnnotation=function(A,y=[],E=[],_=[],S=!1){let C={type:"ObjectTypeAnnotation",properties:A,indexers:y,callProperties:E,internalSlots:_,exact:S},I=d.ObjectTypeAnnotation;return l(I.properties,C,"properties",A,1),l(I.indexers,C,"indexers",y,1),l(I.callProperties,C,"callProperties",E,1),l(I.internalSlots,C,"internalSlots",_,1),l(I.exact,C,"exact",S),C},s.objectTypeCallProperty=function(A){let y={type:"ObjectTypeCallProperty",value:A,static:null},E=d.ObjectTypeCallProperty;return l(E.value,y,"value",A,1),y},s.objectTypeIndexer=function(A=null,y,E,_=null){let S={type:"ObjectTypeIndexer",id:A,key:y,value:E,variance:_,static:null},C=d.ObjectTypeIndexer;return l(C.id,S,"id",A,1),l(C.key,S,"key",y,1),l(C.value,S,"value",E,1),l(C.variance,S,"variance",_,1),S},s.objectTypeInternalSlot=function(A,y,E,_,S){let C={type:"ObjectTypeInternalSlot",id:A,value:y,optional:E,static:_,method:S},I=d.ObjectTypeInternalSlot;return l(I.id,C,"id",A,1),l(I.value,C,"value",y,1),l(I.optional,C,"optional",E),l(I.static,C,"static",_),l(I.method,C,"method",S),C},s.objectTypeProperty=function(A,y,E=null){let _={type:"ObjectTypeProperty",key:A,value:y,variance:E,kind:null,method:null,optional:null,proto:null,static:null},S=d.ObjectTypeProperty;return l(S.key,_,"key",A,1),l(S.value,_,"value",y,1),l(S.variance,_,"variance",E,1),_},s.objectTypeSpreadProperty=function(A){let y={type:"ObjectTypeSpreadProperty",argument:A},E=d.ObjectTypeSpreadProperty;return l(E.argument,y,"argument",A,1),y},s.opaqueType=function(A,y=null,E=null,_){let S={type:"OpaqueType",id:A,typeParameters:y,supertype:E,impltype:_},C=d.OpaqueType;return l(C.id,S,"id",A,1),l(C.typeParameters,S,"typeParameters",y,1),l(C.supertype,S,"supertype",E,1),l(C.impltype,S,"impltype",_,1),S},s.optionalCallExpression=function(A,y,E){let _={type:"OptionalCallExpression",callee:A,arguments:y,optional:E},S=d.OptionalCallExpression;return l(S.callee,_,"callee",A,1),l(S.arguments,_,"arguments",y,1),l(S.optional,_,"optional",E),_},s.optionalIndexedAccessType=function(A,y){let E={type:"OptionalIndexedAccessType",objectType:A,indexType:y,optional:null},_=d.OptionalIndexedAccessType;return l(_.objectType,E,"objectType",A,1),l(_.indexType,E,"indexType",y,1),E},s.optionalMemberExpression=function(A,y,E=!1,_){let S={type:"OptionalMemberExpression",object:A,property:y,computed:E,optional:_},C=d.OptionalMemberExpression;return l(C.object,S,"object",A,1),l(C.property,S,"property",y,1),l(C.computed,S,"computed",E),l(C.optional,S,"optional",_),S},s.parenthesizedExpression=function(A){let y={type:"ParenthesizedExpression",expression:A},E=d.ParenthesizedExpression;return l(E.expression,y,"expression",A,1),y},s.pipelineBareFunction=function(A){let y={type:"PipelineBareFunction",callee:A},E=d.PipelineBareFunction;return l(E.callee,y,"callee",A,1),y},s.pipelinePrimaryTopicReference=function(){return{type:"PipelinePrimaryTopicReference"}},s.pipelineTopicExpression=function(A){let y={type:"PipelineTopicExpression",expression:A},E=d.PipelineTopicExpression;return l(E.expression,y,"expression",A,1),y},s.placeholder=function(A,y){let E={type:"Placeholder",expectedNode:A,name:y},_=d.Placeholder;return l(_.expectedNode,E,"expectedNode",A),l(_.name,E,"name",y,1),E},s.privateName=function(A){let y={type:"PrivateName",id:A},E=d.PrivateName;return l(E.id,y,"id",A,1),y},s.program=function(A,y=[],E="script",_=null){let S={type:"Program",body:A,directives:y,sourceType:E,interpreter:_},C=d.Program;return l(C.body,S,"body",A,1),l(C.directives,S,"directives",y,1),l(C.sourceType,S,"sourceType",E),l(C.interpreter,S,"interpreter",_,1),S},s.qualifiedTypeIdentifier=function(A,y){let E={type:"QualifiedTypeIdentifier",id:A,qualification:y},_=d.QualifiedTypeIdentifier;return l(_.id,E,"id",A,1),l(_.qualification,E,"qualification",y,1),E},s.recordExpression=function(A){let y={type:"RecordExpression",properties:A},E=d.RecordExpression;return l(E.properties,y,"properties",A,1),y},s.regExpLiteral=h,s.regexLiteral=function(A,y=""){return(0,c.default)("RegexLiteral","RegExpLiteral","The node type "),h(A,y)},s.restElement=f,s.restProperty=function(A){return(0,c.default)("RestProperty","RestElement","The node type "),f(A)},s.returnStatement=function(A=null){let y={type:"ReturnStatement",argument:A},E=d.ReturnStatement;return l(E.argument,y,"argument",A,1),y},s.sequenceExpression=function(A){let y={type:"SequenceExpression",expressions:A},E=d.SequenceExpression;return l(E.expressions,y,"expressions",A,1),y},s.spreadElement=g,s.spreadProperty=function(A){return(0,c.default)("SpreadProperty","SpreadElement","The node type "),g(A)},s.staticBlock=function(A){let y={type:"StaticBlock",body:A},E=d.StaticBlock;return l(E.body,y,"body",A,1),y},s.stringLiteral=function(A){let y={type:"StringLiteral",value:A},E=d.StringLiteral;return l(E.value,y,"value",A),y},s.stringLiteralTypeAnnotation=function(A){let y={type:"StringLiteralTypeAnnotation",value:A},E=d.StringLiteralTypeAnnotation;return l(E.value,y,"value",A),y},s.stringTypeAnnotation=function(){return{type:"StringTypeAnnotation"}},s.super=function(){return{type:"Super"}},s.switchCase=function(A=null,y){let E={type:"SwitchCase",test:A,consequent:y},_=d.SwitchCase;return l(_.test,E,"test",A,1),l(_.consequent,E,"consequent",y,1),E},s.switchStatement=function(A,y){let E={type:"SwitchStatement",discriminant:A,cases:y},_=d.SwitchStatement;return l(_.discriminant,E,"discriminant",A,1),l(_.cases,E,"cases",y,1),E},s.symbolTypeAnnotation=function(){return{type:"SymbolTypeAnnotation"}},s.taggedTemplateExpression=function(A,y){let E={type:"TaggedTemplateExpression",tag:A,quasi:y},_=d.TaggedTemplateExpression;return l(_.tag,E,"tag",A,1),l(_.quasi,E,"quasi",y,1),E},s.templateElement=function(A,y=!1){let E={type:"TemplateElement",value:A,tail:y},_=d.TemplateElement;return l(_.value,E,"value",A),l(_.tail,E,"tail",y),E},s.templateLiteral=function(A,y){let E={type:"TemplateLiteral",quasis:A,expressions:y},_=d.TemplateLiteral;return l(_.quasis,E,"quasis",A,1),l(_.expressions,E,"expressions",y,1),E},s.thisExpression=function(){return{type:"ThisExpression"}},s.thisTypeAnnotation=function(){return{type:"ThisTypeAnnotation"}},s.throwStatement=function(A){let y={type:"ThrowStatement",argument:A},E=d.ThrowStatement;return l(E.argument,y,"argument",A,1),y},s.topicReference=function(){return{type:"TopicReference"}},s.tryStatement=function(A,y=null,E=null){let _={type:"TryStatement",block:A,handler:y,finalizer:E},S=d.TryStatement;return l(S.block,_,"block",A,1),l(S.handler,_,"handler",y,1),l(S.finalizer,_,"finalizer",E,1),_},s.tSAnyKeyword=s.tsAnyKeyword=function(){return{type:"TSAnyKeyword"}},s.tSArrayType=s.tsArrayType=function(A){let y={type:"TSArrayType",elementType:A},E=d.TSArrayType;return l(E.elementType,y,"elementType",A,1),y},s.tSAsExpression=s.tsAsExpression=function(A,y){let E={type:"TSAsExpression",expression:A,typeAnnotation:y},_=d.TSAsExpression;return l(_.expression,E,"expression",A,1),l(_.typeAnnotation,E,"typeAnnotation",y,1),E},s.tSBigIntKeyword=s.tsBigIntKeyword=function(){return{type:"TSBigIntKeyword"}},s.tSBooleanKeyword=s.tsBooleanKeyword=function(){return{type:"TSBooleanKeyword"}},s.tSCallSignatureDeclaration=s.tsCallSignatureDeclaration=function(A=null,y,E=null){let _={type:"TSCallSignatureDeclaration",typeParameters:A,parameters:y,typeAnnotation:E},S=d.TSCallSignatureDeclaration;return l(S.typeParameters,_,"typeParameters",A,1),l(S.parameters,_,"parameters",y,1),l(S.typeAnnotation,_,"typeAnnotation",E,1),_},s.tSConditionalType=s.tsConditionalType=function(A,y,E,_){let S={type:"TSConditionalType",checkType:A,extendsType:y,trueType:E,falseType:_},C=d.TSConditionalType;return l(C.checkType,S,"checkType",A,1),l(C.extendsType,S,"extendsType",y,1),l(C.trueType,S,"trueType",E,1),l(C.falseType,S,"falseType",_,1),S},s.tSConstructSignatureDeclaration=s.tsConstructSignatureDeclaration=function(A=null,y,E=null){let _={type:"TSConstructSignatureDeclaration",typeParameters:A,parameters:y,typeAnnotation:E},S=d.TSConstructSignatureDeclaration;return l(S.typeParameters,_,"typeParameters",A,1),l(S.parameters,_,"parameters",y,1),l(S.typeAnnotation,_,"typeAnnotation",E,1),_},s.tSConstructorType=s.tsConstructorType=function(A=null,y,E=null){let _={type:"TSConstructorType",typeParameters:A,parameters:y,typeAnnotation:E},S=d.TSConstructorType;return l(S.typeParameters,_,"typeParameters",A,1),l(S.parameters,_,"parameters",y,1),l(S.typeAnnotation,_,"typeAnnotation",E,1),_},s.tSDeclareFunction=s.tsDeclareFunction=function(A=null,y=null,E,_=null){let S={type:"TSDeclareFunction",id:A,typeParameters:y,params:E,returnType:_},C=d.TSDeclareFunction;return l(C.id,S,"id",A,1),l(C.typeParameters,S,"typeParameters",y,1),l(C.params,S,"params",E,1),l(C.returnType,S,"returnType",_,1),S},s.tSDeclareMethod=s.tsDeclareMethod=function(A=null,y,E=null,_,S=null){let C={type:"TSDeclareMethod",decorators:A,key:y,typeParameters:E,params:_,returnType:S},I=d.TSDeclareMethod;return l(I.decorators,C,"decorators",A,1),l(I.key,C,"key",y,1),l(I.typeParameters,C,"typeParameters",E,1),l(I.params,C,"params",_,1),l(I.returnType,C,"returnType",S,1),C},s.tSEnumBody=s.tsEnumBody=function(A){let y={type:"TSEnumBody",members:A},E=d.TSEnumBody;return l(E.members,y,"members",A,1),y},s.tSEnumDeclaration=s.tsEnumDeclaration=function(A,y){let E={type:"TSEnumDeclaration",id:A,members:y},_=d.TSEnumDeclaration;return l(_.id,E,"id",A,1),l(_.members,E,"members",y,1),E},s.tSEnumMember=s.tsEnumMember=function(A,y=null){let E={type:"TSEnumMember",id:A,initializer:y},_=d.TSEnumMember;return l(_.id,E,"id",A,1),l(_.initializer,E,"initializer",y,1),E},s.tSExportAssignment=s.tsExportAssignment=function(A){let y={type:"TSExportAssignment",expression:A},E=d.TSExportAssignment;return l(E.expression,y,"expression",A,1),y},s.tSExpressionWithTypeArguments=s.tsExpressionWithTypeArguments=function(A,y=null){let E={type:"TSExpressionWithTypeArguments",expression:A,typeParameters:y},_=d.TSExpressionWithTypeArguments;return l(_.expression,E,"expression",A,1),l(_.typeParameters,E,"typeParameters",y,1),E},s.tSExternalModuleReference=s.tsExternalModuleReference=function(A){let y={type:"TSExternalModuleReference",expression:A},E=d.TSExternalModuleReference;return l(E.expression,y,"expression",A,1),y},s.tSFunctionType=s.tsFunctionType=function(A=null,y,E=null){let _={type:"TSFunctionType",typeParameters:A,parameters:y,typeAnnotation:E},S=d.TSFunctionType;return l(S.typeParameters,_,"typeParameters",A,1),l(S.parameters,_,"parameters",y,1),l(S.typeAnnotation,_,"typeAnnotation",E,1),_},s.tSImportEqualsDeclaration=s.tsImportEqualsDeclaration=function(A,y){let E={type:"TSImportEqualsDeclaration",id:A,moduleReference:y,isExport:null},_=d.TSImportEqualsDeclaration;return l(_.id,E,"id",A,1),l(_.moduleReference,E,"moduleReference",y,1),E},s.tSImportType=s.tsImportType=function(A,y=null,E=null){let _={type:"TSImportType",argument:A,qualifier:y,typeParameters:E},S=d.TSImportType;return l(S.argument,_,"argument",A,1),l(S.qualifier,_,"qualifier",y,1),l(S.typeParameters,_,"typeParameters",E,1),_},s.tSIndexSignature=s.tsIndexSignature=function(A,y=null){let E={type:"TSIndexSignature",parameters:A,typeAnnotation:y},_=d.TSIndexSignature;return l(_.parameters,E,"parameters",A,1),l(_.typeAnnotation,E,"typeAnnotation",y,1),E},s.tSIndexedAccessType=s.tsIndexedAccessType=function(A,y){let E={type:"TSIndexedAccessType",objectType:A,indexType:y},_=d.TSIndexedAccessType;return l(_.objectType,E,"objectType",A,1),l(_.indexType,E,"indexType",y,1),E},s.tSInferType=s.tsInferType=function(A){let y={type:"TSInferType",typeParameter:A},E=d.TSInferType;return l(E.typeParameter,y,"typeParameter",A,1),y},s.tSInstantiationExpression=s.tsInstantiationExpression=function(A,y=null){let E={type:"TSInstantiationExpression",expression:A,typeParameters:y},_=d.TSInstantiationExpression;return l(_.expression,E,"expression",A,1),l(_.typeParameters,E,"typeParameters",y,1),E},s.tSInterfaceBody=s.tsInterfaceBody=function(A){let y={type:"TSInterfaceBody",body:A},E=d.TSInterfaceBody;return l(E.body,y,"body",A,1),y},s.tSInterfaceDeclaration=s.tsInterfaceDeclaration=function(A,y=null,E=null,_){let S={type:"TSInterfaceDeclaration",id:A,typeParameters:y,extends:E,body:_},C=d.TSInterfaceDeclaration;return l(C.id,S,"id",A,1),l(C.typeParameters,S,"typeParameters",y,1),l(C.extends,S,"extends",E,1),l(C.body,S,"body",_,1),S},s.tSIntersectionType=s.tsIntersectionType=function(A){let y={type:"TSIntersectionType",types:A},E=d.TSIntersectionType;return l(E.types,y,"types",A,1),y},s.tSIntrinsicKeyword=s.tsIntrinsicKeyword=function(){return{type:"TSIntrinsicKeyword"}},s.tSLiteralType=s.tsLiteralType=function(A){let y={type:"TSLiteralType",literal:A},E=d.TSLiteralType;return l(E.literal,y,"literal",A,1),y},s.tSMappedType=s.tsMappedType=function(A,y=null,E=null){let _={type:"TSMappedType",typeParameter:A,typeAnnotation:y,nameType:E},S=d.TSMappedType;return l(S.typeParameter,_,"typeParameter",A,1),l(S.typeAnnotation,_,"typeAnnotation",y,1),l(S.nameType,_,"nameType",E,1),_},s.tSMethodSignature=s.tsMethodSignature=function(A,y=null,E,_=null){let S={type:"TSMethodSignature",key:A,typeParameters:y,parameters:E,typeAnnotation:_,kind:null},C=d.TSMethodSignature;return l(C.key,S,"key",A,1),l(C.typeParameters,S,"typeParameters",y,1),l(C.parameters,S,"parameters",E,1),l(C.typeAnnotation,S,"typeAnnotation",_,1),S},s.tSModuleBlock=s.tsModuleBlock=function(A){let y={type:"TSModuleBlock",body:A},E=d.TSModuleBlock;return l(E.body,y,"body",A,1),y},s.tSModuleDeclaration=s.tsModuleDeclaration=function(A,y){let E={type:"TSModuleDeclaration",id:A,body:y,kind:null},_=d.TSModuleDeclaration;return l(_.id,E,"id",A,1),l(_.body,E,"body",y,1),E},s.tSNamedTupleMember=s.tsNamedTupleMember=function(A,y,E=!1){let _={type:"TSNamedTupleMember",label:A,elementType:y,optional:E},S=d.TSNamedTupleMember;return l(S.label,_,"label",A,1),l(S.elementType,_,"elementType",y,1),l(S.optional,_,"optional",E),_},s.tSNamespaceExportDeclaration=s.tsNamespaceExportDeclaration=function(A){let y={type:"TSNamespaceExportDeclaration",id:A},E=d.TSNamespaceExportDeclaration;return l(E.id,y,"id",A,1),y},s.tSNeverKeyword=s.tsNeverKeyword=function(){return{type:"TSNeverKeyword"}},s.tSNonNullExpression=s.tsNonNullExpression=function(A){let y={type:"TSNonNullExpression",expression:A},E=d.TSNonNullExpression;return l(E.expression,y,"expression",A,1),y},s.tSNullKeyword=s.tsNullKeyword=function(){return{type:"TSNullKeyword"}},s.tSNumberKeyword=s.tsNumberKeyword=function(){return{type:"TSNumberKeyword"}},s.tSObjectKeyword=s.tsObjectKeyword=function(){return{type:"TSObjectKeyword"}},s.tSOptionalType=s.tsOptionalType=function(A){let y={type:"TSOptionalType",typeAnnotation:A},E=d.TSOptionalType;return l(E.typeAnnotation,y,"typeAnnotation",A,1),y},s.tSParameterProperty=s.tsParameterProperty=function(A){let y={type:"TSParameterProperty",parameter:A},E=d.TSParameterProperty;return l(E.parameter,y,"parameter",A,1),y},s.tSParenthesizedType=s.tsParenthesizedType=function(A){let y={type:"TSParenthesizedType",typeAnnotation:A},E=d.TSParenthesizedType;return l(E.typeAnnotation,y,"typeAnnotation",A,1),y},s.tSPropertySignature=s.tsPropertySignature=function(A,y=null){let E={type:"TSPropertySignature",key:A,typeAnnotation:y},_=d.TSPropertySignature;return l(_.key,E,"key",A,1),l(_.typeAnnotation,E,"typeAnnotation",y,1),E},s.tSQualifiedName=s.tsQualifiedName=function(A,y){let E={type:"TSQualifiedName",left:A,right:y},_=d.TSQualifiedName;return l(_.left,E,"left",A,1),l(_.right,E,"right",y,1),E},s.tSRestType=s.tsRestType=function(A){let y={type:"TSRestType",typeAnnotation:A},E=d.TSRestType;return l(E.typeAnnotation,y,"typeAnnotation",A,1),y},s.tSSatisfiesExpression=s.tsSatisfiesExpression=function(A,y){let E={type:"TSSatisfiesExpression",expression:A,typeAnnotation:y},_=d.TSSatisfiesExpression;return l(_.expression,E,"expression",A,1),l(_.typeAnnotation,E,"typeAnnotation",y,1),E},s.tSStringKeyword=s.tsStringKeyword=function(){return{type:"TSStringKeyword"}},s.tSSymbolKeyword=s.tsSymbolKeyword=function(){return{type:"TSSymbolKeyword"}},s.tSTemplateLiteralType=s.tsTemplateLiteralType=function(A,y){let E={type:"TSTemplateLiteralType",quasis:A,types:y},_=d.TSTemplateLiteralType;return l(_.quasis,E,"quasis",A,1),l(_.types,E,"types",y,1),E},s.tSThisType=s.tsThisType=function(){return{type:"TSThisType"}},s.tSTupleType=s.tsTupleType=function(A){let y={type:"TSTupleType",elementTypes:A},E=d.TSTupleType;return l(E.elementTypes,y,"elementTypes",A,1),y},s.tSTypeAliasDeclaration=s.tsTypeAliasDeclaration=function(A,y=null,E){let _={type:"TSTypeAliasDeclaration",id:A,typeParameters:y,typeAnnotation:E},S=d.TSTypeAliasDeclaration;return l(S.id,_,"id",A,1),l(S.typeParameters,_,"typeParameters",y,1),l(S.typeAnnotation,_,"typeAnnotation",E,1),_},s.tSTypeAnnotation=s.tsTypeAnnotation=function(A){let y={type:"TSTypeAnnotation",typeAnnotation:A},E=d.TSTypeAnnotation;return l(E.typeAnnotation,y,"typeAnnotation",A,1),y},s.tSTypeAssertion=s.tsTypeAssertion=function(A,y){let E={type:"TSTypeAssertion",typeAnnotation:A,expression:y},_=d.TSTypeAssertion;return l(_.typeAnnotation,E,"typeAnnotation",A,1),l(_.expression,E,"expression",y,1),E},s.tSTypeLiteral=s.tsTypeLiteral=function(A){let y={type:"TSTypeLiteral",members:A},E=d.TSTypeLiteral;return l(E.members,y,"members",A,1),y},s.tSTypeOperator=s.tsTypeOperator=function(A,y="keyof"){let E={type:"TSTypeOperator",typeAnnotation:A,operator:y},_=d.TSTypeOperator;return l(_.typeAnnotation,E,"typeAnnotation",A,1),l(_.operator,E,"operator",y),E},s.tSTypeParameter=s.tsTypeParameter=function(A=null,y=null,E){let _={type:"TSTypeParameter",constraint:A,default:y,name:E},S=d.TSTypeParameter;return l(S.constraint,_,"constraint",A,1),l(S.default,_,"default",y,1),l(S.name,_,"name",E),_},s.tSTypeParameterDeclaration=s.tsTypeParameterDeclaration=function(A){let y={type:"TSTypeParameterDeclaration",params:A},E=d.TSTypeParameterDeclaration;return l(E.params,y,"params",A,1),y},s.tSTypeParameterInstantiation=s.tsTypeParameterInstantiation=function(A){let y={type:"TSTypeParameterInstantiation",params:A},E=d.TSTypeParameterInstantiation;return l(E.params,y,"params",A,1),y},s.tSTypePredicate=s.tsTypePredicate=function(A,y=null,E=null){let _={type:"TSTypePredicate",parameterName:A,typeAnnotation:y,asserts:E},S=d.TSTypePredicate;return l(S.parameterName,_,"parameterName",A,1),l(S.typeAnnotation,_,"typeAnnotation",y,1),l(S.asserts,_,"asserts",E),_},s.tSTypeQuery=s.tsTypeQuery=function(A,y=null){let E={type:"TSTypeQuery",exprName:A,typeParameters:y},_=d.TSTypeQuery;return l(_.exprName,E,"exprName",A,1),l(_.typeParameters,E,"typeParameters",y,1),E},s.tSTypeReference=s.tsTypeReference=function(A,y=null){let E={type:"TSTypeReference",typeName:A,typeParameters:y},_=d.TSTypeReference;return l(_.typeName,E,"typeName",A,1),l(_.typeParameters,E,"typeParameters",y,1),E},s.tSUndefinedKeyword=s.tsUndefinedKeyword=function(){return{type:"TSUndefinedKeyword"}},s.tSUnionType=s.tsUnionType=function(A){let y={type:"TSUnionType",types:A},E=d.TSUnionType;return l(E.types,y,"types",A,1),y},s.tSUnknownKeyword=s.tsUnknownKeyword=function(){return{type:"TSUnknownKeyword"}},s.tSVoidKeyword=s.tsVoidKeyword=function(){return{type:"TSVoidKeyword"}},s.tupleExpression=function(A=[]){let y={type:"TupleExpression",elements:A},E=d.TupleExpression;return l(E.elements,y,"elements",A,1),y},s.tupleTypeAnnotation=function(A){let y={type:"TupleTypeAnnotation",types:A},E=d.TupleTypeAnnotation;return l(E.types,y,"types",A,1),y},s.typeAlias=function(A,y=null,E){let _={type:"TypeAlias",id:A,typeParameters:y,right:E},S=d.TypeAlias;return l(S.id,_,"id",A,1),l(S.typeParameters,_,"typeParameters",y,1),l(S.right,_,"right",E,1),_},s.typeAnnotation=function(A){let y={type:"TypeAnnotation",typeAnnotation:A},E=d.TypeAnnotation;return l(E.typeAnnotation,y,"typeAnnotation",A,1),y},s.typeCastExpression=function(A,y){let E={type:"TypeCastExpression",expression:A,typeAnnotation:y},_=d.TypeCastExpression;return l(_.expression,E,"expression",A,1),l(_.typeAnnotation,E,"typeAnnotation",y,1),E},s.typeParameter=function(A=null,y=null,E=null){let _={type:"TypeParameter",bound:A,default:y,variance:E,name:null},S=d.TypeParameter;return l(S.bound,_,"bound",A,1),l(S.default,_,"default",y,1),l(S.variance,_,"variance",E,1),_},s.typeParameterDeclaration=function(A){let y={type:"TypeParameterDeclaration",params:A},E=d.TypeParameterDeclaration;return l(E.params,y,"params",A,1),y},s.typeParameterInstantiation=function(A){let y={type:"TypeParameterInstantiation",params:A},E=d.TypeParameterInstantiation;return l(E.params,y,"params",A,1),y},s.typeofTypeAnnotation=function(A){let y={type:"TypeofTypeAnnotation",argument:A},E=d.TypeofTypeAnnotation;return l(E.argument,y,"argument",A,1),y},s.unaryExpression=function(A,y,E=!0){let _={type:"UnaryExpression",operator:A,argument:y,prefix:E},S=d.UnaryExpression;return l(S.operator,_,"operator",A),l(S.argument,_,"argument",y,1),l(S.prefix,_,"prefix",E),_},s.unionTypeAnnotation=function(A){let y={type:"UnionTypeAnnotation",types:A},E=d.UnionTypeAnnotation;return l(E.types,y,"types",A,1),y},s.updateExpression=function(A,y,E=!1){let _={type:"UpdateExpression",operator:A,argument:y,prefix:E},S=d.UpdateExpression;return l(S.operator,_,"operator",A),l(S.argument,_,"argument",y,1),l(S.prefix,_,"prefix",E),_},s.v8IntrinsicIdentifier=function(A){let y={type:"V8IntrinsicIdentifier",name:A},E=d.V8IntrinsicIdentifier;return l(E.name,y,"name",A),y},s.variableDeclaration=function(A,y){let E={type:"VariableDeclaration",kind:A,declarations:y},_=d.VariableDeclaration;return l(_.kind,E,"kind",A),l(_.declarations,E,"declarations",y,1),E},s.variableDeclarator=function(A,y=null){let E={type:"VariableDeclarator",id:A,init:y},_=d.VariableDeclarator;return l(_.id,E,"id",A,1),l(_.init,E,"init",y,1),E},s.variance=function(A){let y={type:"Variance",kind:A},E=d.Variance;return l(E.kind,y,"kind",A),y},s.voidPattern=function(){return{type:"VoidPattern"}},s.voidTypeAnnotation=function(){return{type:"VoidTypeAnnotation"}},s.whileStatement=function(A,y){let E={type:"WhileStatement",test:A,body:y},_=d.WhileStatement;return l(_.test,E,"test",A,1),l(_.body,E,"body",y,1),E},s.withStatement=function(A,y){let E={type:"WithStatement",object:A,body:y},_=d.WithStatement;return l(_.object,E,"object",A,1),l(_.body,E,"body",y,1),E},s.yieldExpression=function(A=null,y=!1){let E={type:"YieldExpression",argument:A,delegate:y},_=d.YieldExpression;return l(_.argument,E,"argument",A,1),l(_.delegate,E,"delegate",y),E};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/validate.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/deprecationWarning.js"),u=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/utils.js");let{validateInternal:l}=a,{NODE_FIELDS:d}=u;function m(A){let y={type:"NumericLiteral",value:A},E=d.NumericLiteral;return l(E.value,y,"value",A),y}function h(A,y=""){let E={type:"RegExpLiteral",pattern:A,flags:y},_=d.RegExpLiteral;return l(_.pattern,E,"pattern",A),l(_.flags,E,"flags",y),E}function f(A){let y={type:"RestElement",argument:A},E=d.RestElement;return l(E.argument,y,"argument",A,1),y}function g(A){let y={type:"SpreadElement",argument:A},E=d.SpreadElement;return l(E.argument,y,"argument",A,1),y}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/uppercase.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.JSXIdentifier=s.JSXFragment=s.JSXExpressionContainer=s.JSXEmptyExpression=s.JSXElement=s.JSXClosingFragment=s.JSXClosingElement=s.JSXAttribute=s.IntersectionTypeAnnotation=s.InterpreterDirective=s.InterfaceTypeAnnotation=s.InterfaceExtends=s.InterfaceDeclaration=s.InferredPredicate=s.IndexedAccessType=s.ImportSpecifier=s.ImportNamespaceSpecifier=s.ImportExpression=s.ImportDefaultSpecifier=s.ImportDeclaration=s.ImportAttribute=s.Import=s.IfStatement=s.Identifier=s.GenericTypeAnnotation=s.FunctionTypeParam=s.FunctionTypeAnnotation=s.FunctionExpression=s.FunctionDeclaration=s.ForStatement=s.ForOfStatement=s.ForInStatement=s.File=s.ExpressionStatement=s.ExportSpecifier=s.ExportNamespaceSpecifier=s.ExportNamedDeclaration=s.ExportDefaultSpecifier=s.ExportDefaultDeclaration=s.ExportAllDeclaration=s.ExistsTypeAnnotation=s.EnumSymbolBody=s.EnumStringMember=s.EnumStringBody=s.EnumNumberMember=s.EnumNumberBody=s.EnumDefaultedMember=s.EnumDeclaration=s.EnumBooleanMember=s.EnumBooleanBody=s.EmptyTypeAnnotation=s.EmptyStatement=s.DoWhileStatement=s.DoExpression=s.DirectiveLiteral=s.Directive=s.Decorator=s.DeclaredPredicate=s.DeclareVariable=s.DeclareTypeAlias=s.DeclareOpaqueType=s.DeclareModuleExports=s.DeclareModule=s.DeclareInterface=s.DeclareFunction=s.DeclareExportDeclaration=s.DeclareExportAllDeclaration=s.DeclareClass=s.DecimalLiteral=s.DebuggerStatement=s.ContinueStatement=s.ConditionalExpression=s.ClassProperty=s.ClassPrivateProperty=s.ClassPrivateMethod=s.ClassMethod=s.ClassImplements=s.ClassExpression=s.ClassDeclaration=s.ClassBody=s.ClassAccessorProperty=s.CatchClause=s.CallExpression=s.BreakStatement=s.BooleanTypeAnnotation=s.BooleanLiteralTypeAnnotation=s.BooleanLiteral=s.BlockStatement=s.BindExpression=s.BinaryExpression=s.BigIntLiteral=s.AwaitExpression=s.AssignmentPattern=s.AssignmentExpression=s.ArrowFunctionExpression=s.ArrayTypeAnnotation=s.ArrayPattern=s.ArrayExpression=s.ArgumentPlaceholder=s.AnyTypeAnnotation=void 0,s.TSNumberKeyword=s.TSNullKeyword=s.TSNonNullExpression=s.TSNeverKeyword=s.TSNamespaceExportDeclaration=s.TSNamedTupleMember=s.TSModuleDeclaration=s.TSModuleBlock=s.TSMethodSignature=s.TSMappedType=s.TSLiteralType=s.TSIntrinsicKeyword=s.TSIntersectionType=s.TSInterfaceDeclaration=s.TSInterfaceBody=s.TSInstantiationExpression=s.TSInferType=s.TSIndexedAccessType=s.TSIndexSignature=s.TSImportType=s.TSImportEqualsDeclaration=s.TSFunctionType=s.TSExternalModuleReference=s.TSExpressionWithTypeArguments=s.TSExportAssignment=s.TSEnumMember=s.TSEnumDeclaration=s.TSEnumBody=s.TSDeclareMethod=s.TSDeclareFunction=s.TSConstructorType=s.TSConstructSignatureDeclaration=s.TSConditionalType=s.TSCallSignatureDeclaration=s.TSBooleanKeyword=s.TSBigIntKeyword=s.TSAsExpression=s.TSArrayType=s.TSAnyKeyword=s.SymbolTypeAnnotation=s.SwitchStatement=s.SwitchCase=s.Super=s.StringTypeAnnotation=s.StringLiteralTypeAnnotation=s.StringLiteral=s.StaticBlock=s.SpreadProperty=s.SpreadElement=s.SequenceExpression=s.ReturnStatement=s.RestProperty=s.RestElement=s.RegexLiteral=s.RegExpLiteral=s.RecordExpression=s.QualifiedTypeIdentifier=s.Program=s.PrivateName=s.Placeholder=s.PipelineTopicExpression=s.PipelinePrimaryTopicReference=s.PipelineBareFunction=s.ParenthesizedExpression=s.OptionalMemberExpression=s.OptionalIndexedAccessType=s.OptionalCallExpression=s.OpaqueType=s.ObjectTypeSpreadProperty=s.ObjectTypeProperty=s.ObjectTypeInternalSlot=s.ObjectTypeIndexer=s.ObjectTypeCallProperty=s.ObjectTypeAnnotation=s.ObjectProperty=s.ObjectPattern=s.ObjectMethod=s.ObjectExpression=s.NumericLiteral=s.NumberTypeAnnotation=s.NumberLiteralTypeAnnotation=s.NumberLiteral=s.NullableTypeAnnotation=s.NullLiteralTypeAnnotation=s.NullLiteral=s.Noop=s.NewExpression=s.ModuleExpression=s.MixedTypeAnnotation=s.MetaProperty=s.MemberExpression=s.LogicalExpression=s.LabeledStatement=s.JSXText=s.JSXSpreadChild=s.JSXSpreadAttribute=s.JSXOpeningFragment=s.JSXOpeningElement=s.JSXNamespacedName=s.JSXMemberExpression=void 0,s.YieldExpression=s.WithStatement=s.WhileStatement=s.VoidTypeAnnotation=s.VoidPattern=s.Variance=s.VariableDeclarator=s.VariableDeclaration=s.V8IntrinsicIdentifier=s.UpdateExpression=s.UnionTypeAnnotation=s.UnaryExpression=s.TypeofTypeAnnotation=s.TypeParameterInstantiation=s.TypeParameterDeclaration=s.TypeParameter=s.TypeCastExpression=s.TypeAnnotation=s.TypeAlias=s.TupleTypeAnnotation=s.TupleExpression=s.TryStatement=s.TopicReference=s.ThrowStatement=s.ThisTypeAnnotation=s.ThisExpression=s.TemplateLiteral=s.TemplateElement=s.TaggedTemplateExpression=s.TSVoidKeyword=s.TSUnknownKeyword=s.TSUnionType=s.TSUndefinedKeyword=s.TSTypeReference=s.TSTypeQuery=s.TSTypePredicate=s.TSTypeParameterInstantiation=s.TSTypeParameterDeclaration=s.TSTypeParameter=s.TSTypeOperator=s.TSTypeLiteral=s.TSTypeAssertion=s.TSTypeAnnotation=s.TSTypeAliasDeclaration=s.TSTupleType=s.TSThisType=s.TSTemplateLiteralType=s.TSSymbolKeyword=s.TSStringKeyword=s.TSSatisfiesExpression=s.TSRestType=s.TSQualifiedName=s.TSPropertySignature=s.TSParenthesizedType=s.TSParameterProperty=s.TSOptionalType=s.TSObjectKeyword=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/lowercase.js");o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/deprecationWarning.js");function c(u){return a[u]}s.ArrayExpression=c("arrayExpression"),s.AssignmentExpression=c("assignmentExpression"),s.BinaryExpression=c("binaryExpression"),s.InterpreterDirective=c("interpreterDirective"),s.Directive=c("directive"),s.DirectiveLiteral=c("directiveLiteral"),s.BlockStatement=c("blockStatement"),s.BreakStatement=c("breakStatement"),s.CallExpression=c("callExpression"),s.CatchClause=c("catchClause"),s.ConditionalExpression=c("conditionalExpression"),s.ContinueStatement=c("continueStatement"),s.DebuggerStatement=c("debuggerStatement"),s.DoWhileStatement=c("doWhileStatement"),s.EmptyStatement=c("emptyStatement"),s.ExpressionStatement=c("expressionStatement"),s.File=c("file"),s.ForInStatement=c("forInStatement"),s.ForStatement=c("forStatement"),s.FunctionDeclaration=c("functionDeclaration"),s.FunctionExpression=c("functionExpression"),s.Identifier=c("identifier"),s.IfStatement=c("ifStatement"),s.LabeledStatement=c("labeledStatement"),s.StringLiteral=c("stringLiteral"),s.NumericLiteral=c("numericLiteral"),s.NullLiteral=c("nullLiteral"),s.BooleanLiteral=c("booleanLiteral"),s.RegExpLiteral=c("regExpLiteral"),s.LogicalExpression=c("logicalExpression"),s.MemberExpression=c("memberExpression"),s.NewExpression=c("newExpression"),s.Program=c("program"),s.ObjectExpression=c("objectExpression"),s.ObjectMethod=c("objectMethod"),s.ObjectProperty=c("objectProperty"),s.RestElement=c("restElement"),s.ReturnStatement=c("returnStatement"),s.SequenceExpression=c("sequenceExpression"),s.ParenthesizedExpression=c("parenthesizedExpression"),s.SwitchCase=c("switchCase"),s.SwitchStatement=c("switchStatement"),s.ThisExpression=c("thisExpression"),s.ThrowStatement=c("throwStatement"),s.TryStatement=c("tryStatement"),s.UnaryExpression=c("unaryExpression"),s.UpdateExpression=c("updateExpression"),s.VariableDeclaration=c("variableDeclaration"),s.VariableDeclarator=c("variableDeclarator"),s.WhileStatement=c("whileStatement"),s.WithStatement=c("withStatement"),s.AssignmentPattern=c("assignmentPattern"),s.ArrayPattern=c("arrayPattern"),s.ArrowFunctionExpression=c("arrowFunctionExpression"),s.ClassBody=c("classBody"),s.ClassExpression=c("classExpression"),s.ClassDeclaration=c("classDeclaration"),s.ExportAllDeclaration=c("exportAllDeclaration"),s.ExportDefaultDeclaration=c("exportDefaultDeclaration"),s.ExportNamedDeclaration=c("exportNamedDeclaration"),s.ExportSpecifier=c("exportSpecifier"),s.ForOfStatement=c("forOfStatement"),s.ImportDeclaration=c("importDeclaration"),s.ImportDefaultSpecifier=c("importDefaultSpecifier"),s.ImportNamespaceSpecifier=c("importNamespaceSpecifier"),s.ImportSpecifier=c("importSpecifier"),s.ImportExpression=c("importExpression"),s.MetaProperty=c("metaProperty"),s.ClassMethod=c("classMethod"),s.ObjectPattern=c("objectPattern"),s.SpreadElement=c("spreadElement"),s.Super=c("super"),s.TaggedTemplateExpression=c("taggedTemplateExpression"),s.TemplateElement=c("templateElement"),s.TemplateLiteral=c("templateLiteral"),s.YieldExpression=c("yieldExpression"),s.AwaitExpression=c("awaitExpression"),s.Import=c("import"),s.BigIntLiteral=c("bigIntLiteral"),s.ExportNamespaceSpecifier=c("exportNamespaceSpecifier"),s.OptionalMemberExpression=c("optionalMemberExpression"),s.OptionalCallExpression=c("optionalCallExpression"),s.ClassProperty=c("classProperty"),s.ClassAccessorProperty=c("classAccessorProperty"),s.ClassPrivateProperty=c("classPrivateProperty"),s.ClassPrivateMethod=c("classPrivateMethod"),s.PrivateName=c("privateName"),s.StaticBlock=c("staticBlock"),s.ImportAttribute=c("importAttribute"),s.AnyTypeAnnotation=c("anyTypeAnnotation"),s.ArrayTypeAnnotation=c("arrayTypeAnnotation"),s.BooleanTypeAnnotation=c("booleanTypeAnnotation"),s.BooleanLiteralTypeAnnotation=c("booleanLiteralTypeAnnotation"),s.NullLiteralTypeAnnotation=c("nullLiteralTypeAnnotation"),s.ClassImplements=c("classImplements"),s.DeclareClass=c("declareClass"),s.DeclareFunction=c("declareFunction"),s.DeclareInterface=c("declareInterface"),s.DeclareModule=c("declareModule"),s.DeclareModuleExports=c("declareModuleExports"),s.DeclareTypeAlias=c("declareTypeAlias"),s.DeclareOpaqueType=c("declareOpaqueType"),s.DeclareVariable=c("declareVariable"),s.DeclareExportDeclaration=c("declareExportDeclaration"),s.DeclareExportAllDeclaration=c("declareExportAllDeclaration"),s.DeclaredPredicate=c("declaredPredicate"),s.ExistsTypeAnnotation=c("existsTypeAnnotation"),s.FunctionTypeAnnotation=c("functionTypeAnnotation"),s.FunctionTypeParam=c("functionTypeParam"),s.GenericTypeAnnotation=c("genericTypeAnnotation"),s.InferredPredicate=c("inferredPredicate"),s.InterfaceExtends=c("interfaceExtends"),s.InterfaceDeclaration=c("interfaceDeclaration"),s.InterfaceTypeAnnotation=c("interfaceTypeAnnotation"),s.IntersectionTypeAnnotation=c("intersectionTypeAnnotation"),s.MixedTypeAnnotation=c("mixedTypeAnnotation"),s.EmptyTypeAnnotation=c("emptyTypeAnnotation"),s.NullableTypeAnnotation=c("nullableTypeAnnotation"),s.NumberLiteralTypeAnnotation=c("numberLiteralTypeAnnotation"),s.NumberTypeAnnotation=c("numberTypeAnnotation"),s.ObjectTypeAnnotation=c("objectTypeAnnotation"),s.ObjectTypeInternalSlot=c("objectTypeInternalSlot"),s.ObjectTypeCallProperty=c("objectTypeCallProperty"),s.ObjectTypeIndexer=c("objectTypeIndexer"),s.ObjectTypeProperty=c("objectTypeProperty"),s.ObjectTypeSpreadProperty=c("objectTypeSpreadProperty"),s.OpaqueType=c("opaqueType"),s.QualifiedTypeIdentifier=c("qualifiedTypeIdentifier"),s.StringLiteralTypeAnnotation=c("stringLiteralTypeAnnotation"),s.StringTypeAnnotation=c("stringTypeAnnotation"),s.SymbolTypeAnnotation=c("symbolTypeAnnotation"),s.ThisTypeAnnotation=c("thisTypeAnnotation"),s.TupleTypeAnnotation=c("tupleTypeAnnotation"),s.TypeofTypeAnnotation=c("typeofTypeAnnotation"),s.TypeAlias=c("typeAlias"),s.TypeAnnotation=c("typeAnnotation"),s.TypeCastExpression=c("typeCastExpression"),s.TypeParameter=c("typeParameter"),s.TypeParameterDeclaration=c("typeParameterDeclaration"),s.TypeParameterInstantiation=c("typeParameterInstantiation"),s.UnionTypeAnnotation=c("unionTypeAnnotation"),s.Variance=c("variance"),s.VoidTypeAnnotation=c("voidTypeAnnotation"),s.EnumDeclaration=c("enumDeclaration"),s.EnumBooleanBody=c("enumBooleanBody"),s.EnumNumberBody=c("enumNumberBody"),s.EnumStringBody=c("enumStringBody"),s.EnumSymbolBody=c("enumSymbolBody"),s.EnumBooleanMember=c("enumBooleanMember"),s.EnumNumberMember=c("enumNumberMember"),s.EnumStringMember=c("enumStringMember"),s.EnumDefaultedMember=c("enumDefaultedMember"),s.IndexedAccessType=c("indexedAccessType"),s.OptionalIndexedAccessType=c("optionalIndexedAccessType"),s.JSXAttribute=c("jsxAttribute"),s.JSXClosingElement=c("jsxClosingElement"),s.JSXElement=c("jsxElement"),s.JSXEmptyExpression=c("jsxEmptyExpression"),s.JSXExpressionContainer=c("jsxExpressionContainer"),s.JSXSpreadChild=c("jsxSpreadChild"),s.JSXIdentifier=c("jsxIdentifier"),s.JSXMemberExpression=c("jsxMemberExpression"),s.JSXNamespacedName=c("jsxNamespacedName"),s.JSXOpeningElement=c("jsxOpeningElement"),s.JSXSpreadAttribute=c("jsxSpreadAttribute"),s.JSXText=c("jsxText"),s.JSXFragment=c("jsxFragment"),s.JSXOpeningFragment=c("jsxOpeningFragment"),s.JSXClosingFragment=c("jsxClosingFragment"),s.Noop=c("noop"),s.Placeholder=c("placeholder"),s.V8IntrinsicIdentifier=c("v8IntrinsicIdentifier"),s.ArgumentPlaceholder=c("argumentPlaceholder"),s.BindExpression=c("bindExpression"),s.Decorator=c("decorator"),s.DoExpression=c("doExpression"),s.ExportDefaultSpecifier=c("exportDefaultSpecifier"),s.RecordExpression=c("recordExpression"),s.TupleExpression=c("tupleExpression"),s.DecimalLiteral=c("decimalLiteral"),s.ModuleExpression=c("moduleExpression"),s.TopicReference=c("topicReference"),s.PipelineTopicExpression=c("pipelineTopicExpression"),s.PipelineBareFunction=c("pipelineBareFunction"),s.PipelinePrimaryTopicReference=c("pipelinePrimaryTopicReference"),s.VoidPattern=c("voidPattern"),s.TSParameterProperty=c("tsParameterProperty"),s.TSDeclareFunction=c("tsDeclareFunction"),s.TSDeclareMethod=c("tsDeclareMethod"),s.TSQualifiedName=c("tsQualifiedName"),s.TSCallSignatureDeclaration=c("tsCallSignatureDeclaration"),s.TSConstructSignatureDeclaration=c("tsConstructSignatureDeclaration"),s.TSPropertySignature=c("tsPropertySignature"),s.TSMethodSignature=c("tsMethodSignature"),s.TSIndexSignature=c("tsIndexSignature"),s.TSAnyKeyword=c("tsAnyKeyword"),s.TSBooleanKeyword=c("tsBooleanKeyword"),s.TSBigIntKeyword=c("tsBigIntKeyword"),s.TSIntrinsicKeyword=c("tsIntrinsicKeyword"),s.TSNeverKeyword=c("tsNeverKeyword"),s.TSNullKeyword=c("tsNullKeyword"),s.TSNumberKeyword=c("tsNumberKeyword"),s.TSObjectKeyword=c("tsObjectKeyword"),s.TSStringKeyword=c("tsStringKeyword"),s.TSSymbolKeyword=c("tsSymbolKeyword"),s.TSUndefinedKeyword=c("tsUndefinedKeyword"),s.TSUnknownKeyword=c("tsUnknownKeyword"),s.TSVoidKeyword=c("tsVoidKeyword"),s.TSThisType=c("tsThisType"),s.TSFunctionType=c("tsFunctionType"),s.TSConstructorType=c("tsConstructorType"),s.TSTypeReference=c("tsTypeReference"),s.TSTypePredicate=c("tsTypePredicate"),s.TSTypeQuery=c("tsTypeQuery"),s.TSTypeLiteral=c("tsTypeLiteral"),s.TSArrayType=c("tsArrayType"),s.TSTupleType=c("tsTupleType"),s.TSOptionalType=c("tsOptionalType"),s.TSRestType=c("tsRestType"),s.TSNamedTupleMember=c("tsNamedTupleMember"),s.TSUnionType=c("tsUnionType"),s.TSIntersectionType=c("tsIntersectionType"),s.TSConditionalType=c("tsConditionalType"),s.TSInferType=c("tsInferType"),s.TSParenthesizedType=c("tsParenthesizedType"),s.TSTypeOperator=c("tsTypeOperator"),s.TSIndexedAccessType=c("tsIndexedAccessType"),s.TSMappedType=c("tsMappedType"),s.TSTemplateLiteralType=c("tsTemplateLiteralType"),s.TSLiteralType=c("tsLiteralType"),s.TSExpressionWithTypeArguments=c("tsExpressionWithTypeArguments"),s.TSInterfaceDeclaration=c("tsInterfaceDeclaration"),s.TSInterfaceBody=c("tsInterfaceBody"),s.TSTypeAliasDeclaration=c("tsTypeAliasDeclaration"),s.TSInstantiationExpression=c("tsInstantiationExpression"),s.TSAsExpression=c("tsAsExpression"),s.TSSatisfiesExpression=c("tsSatisfiesExpression"),s.TSTypeAssertion=c("tsTypeAssertion"),s.TSEnumBody=c("tsEnumBody"),s.TSEnumDeclaration=c("tsEnumDeclaration"),s.TSEnumMember=c("tsEnumMember"),s.TSModuleDeclaration=c("tsModuleDeclaration"),s.TSModuleBlock=c("tsModuleBlock"),s.TSImportType=c("tsImportType"),s.TSImportEqualsDeclaration=c("tsImportEqualsDeclaration"),s.TSExternalModuleReference=c("tsExternalModuleReference"),s.TSNonNullExpression=c("tsNonNullExpression"),s.TSExportAssignment=c("tsExportAssignment"),s.TSNamespaceExportDeclaration=c("tsNamespaceExportDeclaration"),s.TSTypeAnnotation=c("tsTypeAnnotation"),s.TSTypeParameterInstantiation=c("tsTypeParameterInstantiation"),s.TSTypeParameterDeclaration=c("tsTypeParameterDeclaration"),s.TSTypeParameter=c("tsTypeParameter"),s.NumberLiteral=a.numberLiteral,s.RegexLiteral=a.regexLiteral,s.RestProperty=a.restProperty,s.SpreadProperty=a.spreadProperty},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/productions.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.buildUndefinedNode=function(){return(0,a.unaryExpression)("void",(0,a.numericLiteral)(0),!0)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/react/buildChildren.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(u){let l=[];for(let d=0;d(0,u.isTSTypeAnnotation)(h)?h.typeAnnotation:h),m=(0,c.default)(d);return m.length===1?m[0]:(0,a.tsUnionType)(m)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js"),u=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/clone.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c){return(0,a.default)(c,!1)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneNode.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneDeep.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c){return(0,a.default)(c)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneNode.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c){return(0,a.default)(c,!0,!0)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneNode.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneNode.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(f,g=!0,A=!1){return m(f,g,A,new Map)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/index.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js");let{hasOwn:u}={hasOwn:Function.call.bind(Object.prototype.hasOwnProperty)};function l(f,g,A,y){return f&&typeof f.type=="string"?m(f,g,A,y):f}function d(f,g,A,y){return Array.isArray(f)?f.map(E=>l(E,g,A,y)):l(f,g,A,y)}function m(f,g=!0,A=!1,y){if(!f)return f;let{type:E}=f,_={type:f.type};if((0,c.isIdentifier)(f))_.name=f.name,u(f,"optional")&&typeof f.optional=="boolean"&&(_.optional=f.optional),u(f,"typeAnnotation")&&(_.typeAnnotation=g?d(f.typeAnnotation,!0,A,y):f.typeAnnotation),u(f,"decorators")&&(_.decorators=g?d(f.decorators,!0,A,y):f.decorators);else{if(!u(a.NODE_FIELDS,E))throw new Error(`Unknown node type: "${E}"`);for(let S of Object.keys(a.NODE_FIELDS[E]))u(f,S)&&(_[S]=g?(0,c.isFile)(f)&&S==="comments"?h(f.comments,g,A,y):d(f[S],!0,A,y):f[S])}return u(f,"loc")&&(_.loc=A?null:f.loc),u(f,"leadingComments")&&(_.leadingComments=h(f.leadingComments,g,A,y)),u(f,"innerComments")&&(_.innerComments=h(f.innerComments,g,A,y)),u(f,"trailingComments")&&(_.trailingComments=h(f.trailingComments,g,A,y)),u(f,"extra")&&(_.extra=Object.assign({},f.extra)),_}function h(f,g,A,y){return f&&g?f.map(E=>{let _=y.get(E);if(_)return _;let{type:S,value:C,loc:I}=E,w={type:S,value:C,loc:I};return A&&(w.loc=null),y.set(E,w),w}):f}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c){return(0,a.default)(c,!1,!0)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneNode.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/addComment.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c,u,l,d){return(0,a.default)(c,u,[{type:d?"CommentLine":"CommentBlock",value:l}])};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/addComments.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/addComments.js"(i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(o,a,c){if(!c||!o)return o;let u=`${a}Comments`;return o[u]?a==="leading"?o[u]=c.concat(o[u]):o[u].push(...c):o[u]=c,o}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritInnerComments.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c,u){(0,a.default)("innerComments",c,u)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/inherit.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritLeadingComments.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c,u){(0,a.default)("leadingComments",c,u)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/inherit.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritTrailingComments.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c,u){(0,a.default)("trailingComments",c,u)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/inherit.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritsComments.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(l,d){return(0,a.default)(l,d),(0,c.default)(l,d),(0,u.default)(l,d),l};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritTrailingComments.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritLeadingComments.js"),u=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritInnerComments.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/removeComments.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c){return a.COMMENT_KEYS.forEach(u=>{c[u]=null}),c};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/constants/index.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/constants/generated/index.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.WHILE_TYPES=s.USERWHITESPACABLE_TYPES=s.UNARYLIKE_TYPES=s.TYPESCRIPT_TYPES=s.TSTYPE_TYPES=s.TSTYPEELEMENT_TYPES=s.TSENTITYNAME_TYPES=s.TSBASETYPE_TYPES=s.TERMINATORLESS_TYPES=s.STATEMENT_TYPES=s.STANDARDIZED_TYPES=s.SCOPABLE_TYPES=s.PUREISH_TYPES=s.PROPERTY_TYPES=s.PRIVATE_TYPES=s.PATTERN_TYPES=s.PATTERNLIKE_TYPES=s.OBJECTMEMBER_TYPES=s.MODULESPECIFIER_TYPES=s.MODULEDECLARATION_TYPES=s.MISCELLANEOUS_TYPES=s.METHOD_TYPES=s.LVAL_TYPES=s.LOOP_TYPES=s.LITERAL_TYPES=s.JSX_TYPES=s.IMPORTOREXPORTDECLARATION_TYPES=s.IMMUTABLE_TYPES=s.FUNCTION_TYPES=s.FUNCTIONPARENT_TYPES=s.FUNCTIONPARAMETER_TYPES=s.FOR_TYPES=s.FORXSTATEMENT_TYPES=s.FLOW_TYPES=s.FLOWTYPE_TYPES=s.FLOWPREDICATE_TYPES=s.FLOWDECLARATION_TYPES=s.FLOWBASEANNOTATION_TYPES=s.EXPRESSION_TYPES=s.EXPRESSIONWRAPPER_TYPES=s.EXPORTDECLARATION_TYPES=s.ENUMMEMBER_TYPES=s.ENUMBODY_TYPES=s.DECLARATION_TYPES=s.CONDITIONAL_TYPES=s.COMPLETIONSTATEMENT_TYPES=s.CLASS_TYPES=s.BLOCK_TYPES=s.BLOCKPARENT_TYPES=s.BINARY_TYPES=s.ACCESSOR_TYPES=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/index.js");s.STANDARDIZED_TYPES=a.FLIPPED_ALIAS_KEYS.Standardized,s.EXPRESSION_TYPES=a.FLIPPED_ALIAS_KEYS.Expression,s.BINARY_TYPES=a.FLIPPED_ALIAS_KEYS.Binary,s.SCOPABLE_TYPES=a.FLIPPED_ALIAS_KEYS.Scopable,s.BLOCKPARENT_TYPES=a.FLIPPED_ALIAS_KEYS.BlockParent,s.BLOCK_TYPES=a.FLIPPED_ALIAS_KEYS.Block,s.STATEMENT_TYPES=a.FLIPPED_ALIAS_KEYS.Statement,s.TERMINATORLESS_TYPES=a.FLIPPED_ALIAS_KEYS.Terminatorless,s.COMPLETIONSTATEMENT_TYPES=a.FLIPPED_ALIAS_KEYS.CompletionStatement,s.CONDITIONAL_TYPES=a.FLIPPED_ALIAS_KEYS.Conditional,s.LOOP_TYPES=a.FLIPPED_ALIAS_KEYS.Loop,s.WHILE_TYPES=a.FLIPPED_ALIAS_KEYS.While,s.EXPRESSIONWRAPPER_TYPES=a.FLIPPED_ALIAS_KEYS.ExpressionWrapper,s.FOR_TYPES=a.FLIPPED_ALIAS_KEYS.For,s.FORXSTATEMENT_TYPES=a.FLIPPED_ALIAS_KEYS.ForXStatement,s.FUNCTION_TYPES=a.FLIPPED_ALIAS_KEYS.Function,s.FUNCTIONPARENT_TYPES=a.FLIPPED_ALIAS_KEYS.FunctionParent,s.PUREISH_TYPES=a.FLIPPED_ALIAS_KEYS.Pureish,s.DECLARATION_TYPES=a.FLIPPED_ALIAS_KEYS.Declaration,s.FUNCTIONPARAMETER_TYPES=a.FLIPPED_ALIAS_KEYS.FunctionParameter,s.PATTERNLIKE_TYPES=a.FLIPPED_ALIAS_KEYS.PatternLike,s.LVAL_TYPES=a.FLIPPED_ALIAS_KEYS.LVal,s.TSENTITYNAME_TYPES=a.FLIPPED_ALIAS_KEYS.TSEntityName,s.LITERAL_TYPES=a.FLIPPED_ALIAS_KEYS.Literal,s.IMMUTABLE_TYPES=a.FLIPPED_ALIAS_KEYS.Immutable,s.USERWHITESPACABLE_TYPES=a.FLIPPED_ALIAS_KEYS.UserWhitespacable,s.METHOD_TYPES=a.FLIPPED_ALIAS_KEYS.Method,s.OBJECTMEMBER_TYPES=a.FLIPPED_ALIAS_KEYS.ObjectMember,s.PROPERTY_TYPES=a.FLIPPED_ALIAS_KEYS.Property,s.UNARYLIKE_TYPES=a.FLIPPED_ALIAS_KEYS.UnaryLike,s.PATTERN_TYPES=a.FLIPPED_ALIAS_KEYS.Pattern,s.CLASS_TYPES=a.FLIPPED_ALIAS_KEYS.Class;let c=s.IMPORTOREXPORTDECLARATION_TYPES=a.FLIPPED_ALIAS_KEYS.ImportOrExportDeclaration;s.EXPORTDECLARATION_TYPES=a.FLIPPED_ALIAS_KEYS.ExportDeclaration,s.MODULESPECIFIER_TYPES=a.FLIPPED_ALIAS_KEYS.ModuleSpecifier,s.ACCESSOR_TYPES=a.FLIPPED_ALIAS_KEYS.Accessor,s.PRIVATE_TYPES=a.FLIPPED_ALIAS_KEYS.Private,s.FLOW_TYPES=a.FLIPPED_ALIAS_KEYS.Flow,s.FLOWTYPE_TYPES=a.FLIPPED_ALIAS_KEYS.FlowType,s.FLOWBASEANNOTATION_TYPES=a.FLIPPED_ALIAS_KEYS.FlowBaseAnnotation,s.FLOWDECLARATION_TYPES=a.FLIPPED_ALIAS_KEYS.FlowDeclaration,s.FLOWPREDICATE_TYPES=a.FLIPPED_ALIAS_KEYS.FlowPredicate,s.ENUMBODY_TYPES=a.FLIPPED_ALIAS_KEYS.EnumBody,s.ENUMMEMBER_TYPES=a.FLIPPED_ALIAS_KEYS.EnumMember,s.JSX_TYPES=a.FLIPPED_ALIAS_KEYS.JSX,s.MISCELLANEOUS_TYPES=a.FLIPPED_ALIAS_KEYS.Miscellaneous,s.TYPESCRIPT_TYPES=a.FLIPPED_ALIAS_KEYS.TypeScript,s.TSTYPEELEMENT_TYPES=a.FLIPPED_ALIAS_KEYS.TSTypeElement,s.TSTYPE_TYPES=a.FLIPPED_ALIAS_KEYS.TSType,s.TSBASETYPE_TYPES=a.FLIPPED_ALIAS_KEYS.TSBaseType,s.MODULEDECLARATION_TYPES=c},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/constants/index.js"(i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.UPDATE_OPERATORS=s.UNARY_OPERATORS=s.STRING_UNARY_OPERATORS=s.STATEMENT_OR_BLOCK_KEYS=s.NUMBER_UNARY_OPERATORS=s.NUMBER_BINARY_OPERATORS=s.LOGICAL_OPERATORS=s.INHERIT_KEYS=s.FOR_INIT_KEYS=s.FLATTENABLE_KEYS=s.EQUALITY_BINARY_OPERATORS=s.COMPARISON_BINARY_OPERATORS=s.COMMENT_KEYS=s.BOOLEAN_UNARY_OPERATORS=s.BOOLEAN_NUMBER_BINARY_OPERATORS=s.BOOLEAN_BINARY_OPERATORS=s.BINARY_OPERATORS=s.ASSIGNMENT_OPERATORS=void 0,s.STATEMENT_OR_BLOCK_KEYS=["consequent","body","alternate"],s.FLATTENABLE_KEYS=["body","expressions"],s.FOR_INIT_KEYS=["left","init"],s.COMMENT_KEYS=["leadingComments","trailingComments","innerComments"];let o=s.LOGICAL_OPERATORS=["||","&&","??"],a=(s.UPDATE_OPERATORS=["++","--"],s.BOOLEAN_NUMBER_BINARY_OPERATORS=[">","<",">=","<="]),c=s.EQUALITY_BINARY_OPERATORS=["==","===","!=","!=="],u=s.COMPARISON_BINARY_OPERATORS=[...c,"in","instanceof"],l=s.BOOLEAN_BINARY_OPERATORS=[...u,...a],d=s.NUMBER_BINARY_OPERATORS=["-","/","%","*","**","&","|",">>",">>>","<<","^"],m=(s.BINARY_OPERATORS=["+",...d,...l,"|>"],s.ASSIGNMENT_OPERATORS=["=","+=",...d.map(g=>g+"="),...o.map(g=>g+"=")],s.BOOLEAN_UNARY_OPERATORS=["delete","!"]),h=s.NUMBER_UNARY_OPERATORS=["+","-","~"],f=s.STRING_UNARY_OPERATORS=["typeof"];s.UNARY_OPERATORS=["void","throw",...m,...h,...f],s.INHERIT_KEYS={optional:["typeAnnotation","typeParameters","returnType"],force:["start","loc","end"]},s.BLOCK_SCOPED_SYMBOL=Symbol.for("var used to be block scoped"),s.NOT_LOCAL_BINDING=Symbol.for("should not be considered a local binding")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/ensureBlock.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c,u="body"){let l=(0,a.default)(c[u],c);return c[u]=l,l};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toBlock.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function m(h,f){let g=[],A=!0;for(let y of h)if((0,c.isEmptyStatement)(y)||(A=!1),(0,c.isExpression)(y))g.push(y);else if((0,c.isExpressionStatement)(y))g.push(y.expression);else if((0,c.isVariableDeclaration)(y)){if(y.kind!=="var")return;for(let E of y.declarations){let _=(0,a.default)(E);for(let S of Object.keys(_))f.push({kind:y.kind,id:(0,d.default)(_[S])});E.init&&g.push((0,u.assignmentExpression)("=",E.id,E.init))}A=!0}else if((0,c.isIfStatement)(y)){let E=y.consequent?m([y.consequent],f):(0,l.buildUndefinedNode)(),_=y.alternate?m([y.alternate],f):(0,l.buildUndefinedNode)();if(!E||!_)return;g.push((0,u.conditionalExpression)(y.test,E,_))}else if((0,c.isBlockStatement)(y)){let E=m(y.body,f);if(!E)return;g.push(E)}else{if(!(0,c.isEmptyStatement)(y))return;h.indexOf(y)===0&&(A=!0)}return A&&g.push((0,l.buildUndefinedNode)()),g.length===1?g[0]:(0,u.sequenceExpression)(g)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js"),u=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js"),l=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/productions.js"),d=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneNode.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c){return(c=(0,a.default)(c))!=="eval"&&c!=="arguments"||(c="_"+c),c};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toIdentifier.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toBlock.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(u,l){if((0,a.isBlockStatement)(u))return u;let d=[];return(0,a.isEmptyStatement)(u)?d=[]:((0,a.isStatement)(u)||(u=(0,a.isFunction)(l)?(0,c.returnStatement)(u):(0,c.expressionStatement)(u)),d=[u]),(0,c.blockStatement)(d)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toComputedKey.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(u,l=u.key||u.property){return!u.computed&&(0,a.isIdentifier)(l)&&(l=(0,c.stringLiteral)(l.name)),l};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toExpression.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js");s.default=function(c){if((0,a.isExpressionStatement)(c)&&(c=c.expression),(0,a.isExpression)(c))return c;if((0,a.isClass)(c)?(c.type="ClassExpression",c.abstract=!1):(0,a.isFunction)(c)&&(c.type="FunctionExpression"),!(0,a.isExpression)(c))throw new Error(`cannot turn ${c.type} to an expression`);return c}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toIdentifier.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(u){u+="";let l="";for(let d of u)l+=(0,c.isIdentifierChar)(d.codePointAt(0))?d:"-";return l=l.replace(/^[-0-9]+/,""),l=l.replace(/[-\s]+(.)?/g,function(d,m){return m?m.toUpperCase():""}),(0,a.default)(l)||(l=`_${l}`),l||"_"};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isValidIdentifier.js"),c=o("./node_modules/.pnpm/@babel+helper-validator-identifier@7.28.5/node_modules/@babel/helper-validator-identifier/lib/index.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toKeyAlias.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=l;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneNode.js"),u=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js");function l(d,m=d.key){let h;return d.kind==="method"?l.increment()+"":(h=(0,a.isIdentifier)(m)?m.name:(0,a.isStringLiteral)(m)?JSON.stringify(m.value):JSON.stringify((0,u.default)((0,c.default)(m))),d.computed&&(h=`[${h}]`),d.static&&(h=`static:${h}`),h)}l.uid=0,l.increment=function(){return l.uid>=Number.MAX_SAFE_INTEGER?l.uid=0:l.uid++}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toSequenceExpression.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c,u){if(c==null||!c.length)return;let l=[],d=(0,a.default)(c,l);if(d){for(let m of l)u.push(m);return d}};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toStatement.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js");s.default=function(u,l){if((0,a.isStatement)(u))return u;let d,m=!1;if((0,a.isClass)(u))m=!0,d="ClassDeclaration";else if((0,a.isFunction)(u))m=!0,d="FunctionDeclaration";else if((0,a.isAssignmentExpression)(u))return(0,c.expressionStatement)(u);if(m&&!u.id&&(d=!1),!d){if(l)return!1;throw new Error(`cannot turn ${u.type} to a statement`)}return u.type=d,u}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/valueToNode.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isValidIdentifier.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js");s.default=function l(d){if(d===void 0)return(0,c.identifier)("undefined");if(d===!0||d===!1)return(0,c.booleanLiteral)(d);if(d===null)return(0,c.nullLiteral)();if(typeof d=="string")return(0,c.stringLiteral)(d);if(typeof d=="number"){let m;if(Number.isFinite(d))m=(0,c.numericLiteral)(Math.abs(d));else{let h;h=Number.isNaN(d)?(0,c.numericLiteral)(0):(0,c.numericLiteral)(1),m=(0,c.binaryExpression)("/",h,(0,c.numericLiteral)(0))}return(d<0||Object.is(d,-0))&&(m=(0,c.unaryExpression)("-",m)),m}if(typeof d=="bigint")return d<0?(0,c.unaryExpression)("-",(0,c.bigIntLiteral)(-d)):(0,c.bigIntLiteral)(d);if((function(m){return u(m)==="[object RegExp]"})(d)){let m=d.source,h=/\/([a-z]*)$/.exec(d.toString())[1];return(0,c.regExpLiteral)(m,h)}if(Array.isArray(d))return(0,c.arrayExpression)(d.map(l));if((function(m){if(typeof m!="object"||m===null||Object.prototype.toString.call(m)!=="[object Object]")return!1;let h=Object.getPrototypeOf(m);return h===null||Object.getPrototypeOf(h)===null})(d)){let m=[];for(let h of Object.keys(d)){let f,g=!1;(0,a.default)(h)?h==="__proto__"?(g=!0,f=(0,c.stringLiteral)(h)):f=(0,c.identifier)(h):f=(0,c.stringLiteral)(h),m.push((0,c.objectProperty)(f,l(d[h]),g))}return(0,c.objectExpression)(m)}throw new Error("don't know how to turn this value into a node")};let u=Function.call.bind(Object.prototype.toString)},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/core.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.patternLikeCommon=s.importAttributes=s.functionTypeAnnotationCommon=s.functionDeclarationCommon=s.functionCommon=s.classMethodOrPropertyUnionShapeCommon=s.classMethodOrPropertyCommon=s.classMethodOrDeclareMethodCommon=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/is.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isValidIdentifier.js"),u=o("./node_modules/.pnpm/@babel+helper-validator-identifier@7.28.5/node_modules/@babel/helper-validator-identifier/lib/index.js"),l=o("./node_modules/.pnpm/@babel+helper-string-parser@7.27.1/node_modules/@babel/helper-string-parser/lib/index.js"),d=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/constants/index.js"),m=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/utils.js");let h=(I=!1)=>({unionShape:{discriminator:"computed",shapes:[{name:"computed",value:[!0],properties:{key:{validate:(0,m.assertNodeType)("Expression")}}},{name:"nonComputed",value:[!1],properties:{key:{validate:I?(0,m.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","PrivateName"):(0,m.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral")}}}]}});s.classMethodOrPropertyUnionShapeCommon=h;let f=(0,m.defineAliasedType)("Standardized");f("ArrayExpression",{fields:{elements:{validate:(0,m.arrayOf)((0,m.assertNodeOrValueType)("null","Expression","SpreadElement")),default:process.env.BABEL_TYPES_8_BREAKING?void 0:[]}},visitor:["elements"],aliases:["Expression"]}),f("AssignmentExpression",{fields:{operator:{validate:process.env.BABEL_TYPES_8_BREAKING?Object.assign((function(){let I=(0,m.assertOneOf)(...d.ASSIGNMENT_OPERATORS),w=(0,m.assertOneOf)("=");return function(k,N,O){((0,a.default)("Pattern",k.left)?w:I)(k,N,O)}})(),{oneOf:d.ASSIGNMENT_OPERATORS}):(0,m.assertValueType)("string")},left:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.assertNodeType)("Identifier","MemberExpression","OptionalMemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0,m.assertNodeType)("LVal","OptionalMemberExpression")},right:{validate:(0,m.assertNodeType)("Expression")}},builder:["operator","left","right"],visitor:["left","right"],aliases:["Expression"]}),f("BinaryExpression",{builder:["operator","left","right"],fields:{operator:{validate:(0,m.assertOneOf)(...d.BINARY_OPERATORS)},left:{validate:(function(){let I=(0,m.assertNodeType)("Expression"),w=(0,m.assertNodeType)("Expression","PrivateName");return Object.assign(function(k,N,O){(k.operator==="in"?w:I)(k,N,O)},{oneOfNodeTypes:["Expression","PrivateName"]})})()},right:{validate:(0,m.assertNodeType)("Expression")}},visitor:["left","right"],aliases:["Binary","Expression"]}),f("InterpreterDirective",{builder:["value"],fields:{value:{validate:(0,m.assertValueType)("string")}}}),f("Directive",{visitor:["value"],fields:{value:{validate:(0,m.assertNodeType)("DirectiveLiteral")}}}),f("DirectiveLiteral",{builder:["value"],fields:{value:{validate:(0,m.assertValueType)("string")}}}),f("BlockStatement",{builder:["body","directives"],visitor:["directives","body"],fields:{directives:{validate:(0,m.arrayOfType)("Directive"),default:[]},body:(0,m.validateArrayOfType)("Statement")},aliases:["Scopable","BlockParent","Block","Statement"]}),f("BreakStatement",{visitor:["label"],fields:{label:{validate:(0,m.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),f("CallExpression",{visitor:["callee","typeParameters","typeArguments","arguments"],builder:["callee","arguments"],aliases:["Expression"],fields:Object.assign({callee:{validate:(0,m.assertNodeType)("Expression","Super","V8IntrinsicIdentifier")},arguments:(0,m.validateArrayOfType)("Expression","SpreadElement","ArgumentPlaceholder"),typeArguments:{validate:(0,m.assertNodeType)("TypeParameterInstantiation"),optional:!0}},process.env.BABEL_TYPES_8_BREAKING?{}:{optional:{validate:(0,m.assertValueType)("boolean"),optional:!0},typeParameters:{validate:(0,m.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}})}),f("CatchClause",{visitor:["param","body"],fields:{param:{validate:(0,m.assertNodeType)("Identifier","ArrayPattern","ObjectPattern"),optional:!0},body:{validate:(0,m.assertNodeType)("BlockStatement")}},aliases:["Scopable","BlockParent"]}),f("ConditionalExpression",{visitor:["test","consequent","alternate"],fields:{test:{validate:(0,m.assertNodeType)("Expression")},consequent:{validate:(0,m.assertNodeType)("Expression")},alternate:{validate:(0,m.assertNodeType)("Expression")}},aliases:["Expression","Conditional"]}),f("ContinueStatement",{visitor:["label"],fields:{label:{validate:(0,m.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),f("DebuggerStatement",{aliases:["Statement"]}),f("DoWhileStatement",{builder:["test","body"],visitor:["body","test"],fields:{test:{validate:(0,m.assertNodeType)("Expression")},body:{validate:(0,m.assertNodeType)("Statement")}},aliases:["Statement","BlockParent","Loop","While","Scopable"]}),f("EmptyStatement",{aliases:["Statement"]}),f("ExpressionStatement",{visitor:["expression"],fields:{expression:{validate:(0,m.assertNodeType)("Expression")}},aliases:["Statement","ExpressionWrapper"]}),f("File",{builder:["program","comments","tokens"],visitor:["program"],fields:{program:{validate:(0,m.assertNodeType)("Program")},comments:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.assertEach)((0,m.assertNodeType)("CommentBlock","CommentLine")):Object.assign(()=>{},{each:{oneOfNodeTypes:["CommentBlock","CommentLine"]}}),optional:!0},tokens:{validate:(0,m.assertEach)(Object.assign(()=>{},{type:"any"})),optional:!0}}}),f("ForInStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.assertNodeType)("VariableDeclaration","Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0,m.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,m.assertNodeType)("Expression")},body:{validate:(0,m.assertNodeType)("Statement")}}}),f("ForStatement",{visitor:["init","test","update","body"],aliases:["Scopable","Statement","For","BlockParent","Loop"],fields:{init:{validate:(0,m.assertNodeType)("VariableDeclaration","Expression"),optional:!0},test:{validate:(0,m.assertNodeType)("Expression"),optional:!0},update:{validate:(0,m.assertNodeType)("Expression"),optional:!0},body:{validate:(0,m.assertNodeType)("Statement")}}});let g=()=>({params:(0,m.validateArrayOfType)("FunctionParameter"),generator:{default:!1},async:{default:!1}});s.functionCommon=g;let A=()=>({returnType:{validate:(0,m.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},typeParameters:{validate:(0,m.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0}});s.functionTypeAnnotationCommon=A;let y=()=>Object.assign({},g(),{declare:{validate:(0,m.assertValueType)("boolean"),optional:!0},id:{validate:(0,m.assertNodeType)("Identifier"),optional:!0}});s.functionDeclarationCommon=y,f("FunctionDeclaration",{builder:["id","params","body","generator","async"],visitor:["id","typeParameters","params","predicate","returnType","body"],fields:Object.assign({},y(),A(),{body:{validate:(0,m.assertNodeType)("BlockStatement")},predicate:{validate:(0,m.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}}),aliases:["Scopable","Function","BlockParent","FunctionParent","Statement","Pureish","Declaration"],validate:process.env.BABEL_TYPES_8_BREAKING?(function(){let I=(0,m.assertNodeType)("Identifier");return function(w,k,N){(0,a.default)("ExportDefaultDeclaration",w)||I(N,"id",N.id)}})():void 0}),f("FunctionExpression",{inherits:"FunctionDeclaration",aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:Object.assign({},g(),A(),{id:{validate:(0,m.assertNodeType)("Identifier"),optional:!0},body:{validate:(0,m.assertNodeType)("BlockStatement")},predicate:{validate:(0,m.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}})});let E=()=>({typeAnnotation:{validate:(0,m.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},optional:{validate:(0,m.assertValueType)("boolean"),optional:!0},decorators:{validate:(0,m.arrayOfType)("Decorator"),optional:!0}});s.patternLikeCommon=E,f("Identifier",{builder:["name"],visitor:["typeAnnotation","decorators"],aliases:["Expression","FunctionParameter","PatternLike","LVal","TSEntityName"],fields:Object.assign({},E(),{name:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.chain)((0,m.assertValueType)("string"),Object.assign(function(I,w,k){if(!(0,c.default)(k,!1))throw new TypeError(`"${k}" is not a valid identifier name`)},{type:"string"})):(0,m.assertValueType)("string")}}),validate:process.env.BABEL_TYPES_8_BREAKING?function(I,w,k){let N=/\.(\w+)$/.exec(w.toString());if(!N)return;let[,O]=N,W={computed:!1};if(O==="property"){if((0,a.default)("MemberExpression",I,W)||(0,a.default)("OptionalMemberExpression",I,W))return}else if(O==="key"){if((0,a.default)("Property",I,W)||(0,a.default)("Method",I,W))return}else if(O==="exported"){if((0,a.default)("ExportSpecifier",I))return}else if(O==="imported"){if((0,a.default)("ImportSpecifier",I,{imported:k}))return}else if(O==="meta"&&(0,a.default)("MetaProperty",I,{meta:k}))return;if(((0,u.isKeyword)(k.name)||(0,u.isReservedWord)(k.name,!1))&&k.name!=="this")throw new TypeError(`"${k.name}" is not a valid identifier`)}:void 0}),f("IfStatement",{visitor:["test","consequent","alternate"],aliases:["Statement","Conditional"],fields:{test:{validate:(0,m.assertNodeType)("Expression")},consequent:{validate:(0,m.assertNodeType)("Statement")},alternate:{optional:!0,validate:(0,m.assertNodeType)("Statement")}}}),f("LabeledStatement",{visitor:["label","body"],aliases:["Statement"],fields:{label:{validate:(0,m.assertNodeType)("Identifier")},body:{validate:(0,m.assertNodeType)("Statement")}}}),f("StringLiteral",{builder:["value"],fields:{value:{validate:(0,m.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),f("NumericLiteral",{builder:["value"],deprecatedAlias:"NumberLiteral",fields:{value:{validate:(0,m.chain)((0,m.assertValueType)("number"),Object.assign(function(I,w,k){(1/k<0||!Number.isFinite(k))&&new Error(`NumericLiterals must be non-negative finite numbers. You can use t.valueToNode(${k}) instead.`)},{type:"number"}))}},aliases:["Expression","Pureish","Literal","Immutable"]}),f("NullLiteral",{aliases:["Expression","Pureish","Literal","Immutable"]}),f("BooleanLiteral",{builder:["value"],fields:{value:{validate:(0,m.assertValueType)("boolean")}},aliases:["Expression","Pureish","Literal","Immutable"]}),f("RegExpLiteral",{builder:["pattern","flags"],deprecatedAlias:"RegexLiteral",aliases:["Expression","Pureish","Literal"],fields:{pattern:{validate:(0,m.assertValueType)("string")},flags:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.chain)((0,m.assertValueType)("string"),Object.assign(function(I,w,k){let N=/[^dgimsuvy]/.exec(k);if(N)throw new TypeError(`"${N[0]}" is not a valid RegExp flag`)},{type:"string"})):(0,m.assertValueType)("string"),default:""}}}),f("LogicalExpression",{builder:["operator","left","right"],visitor:["left","right"],aliases:["Binary","Expression"],fields:{operator:{validate:(0,m.assertOneOf)(...d.LOGICAL_OPERATORS)},left:{validate:(0,m.assertNodeType)("Expression")},right:{validate:(0,m.assertNodeType)("Expression")}}}),f("MemberExpression",{builder:["object","property","computed",...process.env.BABEL_TYPES_8_BREAKING?[]:["optional"]],visitor:["object","property"],aliases:["Expression","LVal","PatternLike"],unionShape:{discriminator:"computed",shapes:[{name:"computed",value:[!0],properties:{property:{validate:(0,m.assertNodeType)("Expression")}}},{name:"nonComputed",value:[!1],properties:{property:{validate:(0,m.assertNodeType)("Identifier","PrivateName")}}}]},fields:Object.assign({object:{validate:(0,m.assertNodeType)("Expression","Super")},property:{validate:(function(){let I=(0,m.assertNodeType)("Identifier","PrivateName"),w=(0,m.assertNodeType)("Expression"),k=function(N,O,W){(N.computed?w:I)(N,O,W)};return k.oneOfNodeTypes=["Expression","Identifier","PrivateName"],k})()},computed:{default:!1}},process.env.BABEL_TYPES_8_BREAKING?{}:{optional:{validate:(0,m.assertValueType)("boolean"),optional:!0}})}),f("NewExpression",{inherits:"CallExpression"}),f("Program",{visitor:["directives","body"],builder:["body","directives","sourceType","interpreter"],fields:{sourceType:{validate:(0,m.assertOneOf)("script","module"),default:"script"},interpreter:{validate:(0,m.assertNodeType)("InterpreterDirective"),default:null,optional:!0},directives:{validate:(0,m.arrayOfType)("Directive"),default:[]},body:(0,m.validateArrayOfType)("Statement")},aliases:["Scopable","BlockParent","Block"]}),f("ObjectExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:(0,m.validateArrayOfType)("ObjectMethod","ObjectProperty","SpreadElement")}}),f("ObjectMethod",Object.assign({builder:["kind","key","params","body","computed","generator","async"],visitor:["decorators","key","typeParameters","params","returnType","body"]},h(),{fields:Object.assign({},g(),A(),{kind:Object.assign({validate:(0,m.assertOneOf)("method","get","set")},process.env.BABEL_TYPES_8_BREAKING?{}:{default:"method"}),computed:{default:!1},key:{validate:(function(){let I=(0,m.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral"),w=(0,m.assertNodeType)("Expression"),k=function(N,O,W){(N.computed?w:I)(N,O,W)};return k.oneOfNodeTypes=["Expression","Identifier","StringLiteral","NumericLiteral","BigIntLiteral"],k})()},decorators:{validate:(0,m.arrayOfType)("Decorator"),optional:!0},body:{validate:(0,m.assertNodeType)("BlockStatement")}}),aliases:["UserWhitespacable","Function","Scopable","BlockParent","FunctionParent","Method","ObjectMember"]})),f("ObjectProperty",{builder:["key","value","computed","shorthand",...process.env.BABEL_TYPES_8_BREAKING?[]:["decorators"]],unionShape:{discriminator:"computed",shapes:[{name:"computed",value:[!0],properties:{key:{validate:(0,m.assertNodeType)("Expression")}}},{name:"nonComputed",value:[!1],properties:{key:{validate:(0,m.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","DecimalLiteral","PrivateName")}}}]},fields:{computed:{default:!1},key:{validate:(function(){let I=(0,m.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","DecimalLiteral","PrivateName"),w=(0,m.assertNodeType)("Expression");return Object.assign(function(k,N,O){(k.computed?w:I)(k,N,O)},{oneOfNodeTypes:["Expression","Identifier","StringLiteral","NumericLiteral","BigIntLiteral","DecimalLiteral","PrivateName"]})})()},value:{validate:(0,m.assertNodeType)("Expression","PatternLike")},shorthand:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.chain)((0,m.assertValueType)("boolean"),Object.assign(function(I,w,k){if(k){if(I.computed)throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");if(!(0,a.default)("Identifier",I.key))throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier")}},{type:"boolean"})):(0,m.assertValueType)("boolean"),default:!1},decorators:{validate:(0,m.arrayOfType)("Decorator"),optional:!0}},visitor:["decorators","key","value"],aliases:["UserWhitespacable","Property","ObjectMember"],validate:process.env.BABEL_TYPES_8_BREAKING?(function(){let I=(0,m.assertNodeType)("Identifier","Pattern","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"),w=(0,m.assertNodeType)("Expression");return function(k,N,O){((0,a.default)("ObjectPattern",k)?I:w)(O,"value",O.value)}})():void 0}),f("RestElement",{visitor:["argument","typeAnnotation"],builder:["argument"],aliases:["FunctionParameter","PatternLike","LVal"],deprecatedAlias:"RestProperty",fields:Object.assign({},E(),{argument:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0,m.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression","RestElement","AssignmentPattern")}}),validate:process.env.BABEL_TYPES_8_BREAKING?function(I,w){let k=/(\w+)\[(\d+)\]/.exec(w.toString());if(!k)throw new Error("Internal Babel error: malformed key.");let[,N,O]=k;if(I[N].length>+O+1)throw new TypeError(`RestElement must be last element of ${N}`)}:void 0}),f("ReturnStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,m.assertNodeType)("Expression"),optional:!0}}}),f("SequenceExpression",{visitor:["expressions"],fields:{expressions:(0,m.validateArrayOfType)("Expression")},aliases:["Expression"]}),f("ParenthesizedExpression",{visitor:["expression"],aliases:["Expression","ExpressionWrapper"],fields:{expression:{validate:(0,m.assertNodeType)("Expression")}}}),f("SwitchCase",{visitor:["test","consequent"],fields:{test:{validate:(0,m.assertNodeType)("Expression"),optional:!0},consequent:(0,m.validateArrayOfType)("Statement")}}),f("SwitchStatement",{visitor:["discriminant","cases"],aliases:["Statement","BlockParent","Scopable"],fields:{discriminant:{validate:(0,m.assertNodeType)("Expression")},cases:(0,m.validateArrayOfType)("SwitchCase")}}),f("ThisExpression",{aliases:["Expression"]}),f("ThrowStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,m.assertNodeType)("Expression")}}}),f("TryStatement",{visitor:["block","handler","finalizer"],aliases:["Statement"],fields:{block:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.chain)((0,m.assertNodeType)("BlockStatement"),Object.assign(function(I){if(!I.handler&&!I.finalizer)throw new TypeError("TryStatement expects either a handler or finalizer, or both")},{oneOfNodeTypes:["BlockStatement"]})):(0,m.assertNodeType)("BlockStatement")},handler:{optional:!0,validate:(0,m.assertNodeType)("CatchClause")},finalizer:{optional:!0,validate:(0,m.assertNodeType)("BlockStatement")}}}),f("UnaryExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!0},argument:{validate:(0,m.assertNodeType)("Expression")},operator:{validate:(0,m.assertOneOf)(...d.UNARY_OPERATORS)}},visitor:["argument"],aliases:["UnaryLike","Expression"]}),f("UpdateExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!1},argument:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.assertNodeType)("Identifier","MemberExpression"):(0,m.assertNodeType)("Expression")},operator:{validate:(0,m.assertOneOf)(...d.UPDATE_OPERATORS)}},visitor:["argument"],aliases:["Expression"]}),f("VariableDeclaration",{builder:["kind","declarations"],visitor:["declarations"],aliases:["Statement","Declaration"],fields:{declare:{validate:(0,m.assertValueType)("boolean"),optional:!0},kind:{validate:(0,m.assertOneOf)("var","let","const","using","await using")},declarations:(0,m.validateArrayOfType)("VariableDeclarator")},validate:process.env.BABEL_TYPES_8_BREAKING?(()=>{let I=(0,m.assertNodeType)("Identifier","Placeholder"),w=(0,m.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","Placeholder"),k=(0,m.assertNodeType)("Identifier","VoidPattern","Placeholder");return function(N,O,W){let{kind:$,declarations:G}=W,q=(0,a.default)("ForXStatement",N,{left:W});if(q&&G.length!==1)throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${N.type}`);for(let ce of G)$==="const"||$==="let"||$==="var"?q||ce.init?w(ce,"id",ce.id):I(ce,"id",ce.id):k(ce,"id",ce.id)}})():void 0}),f("VariableDeclarator",{visitor:["id","init"],fields:{id:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","VoidPattern"):(0,m.assertNodeType)("LVal","VoidPattern")},definite:{optional:!0,validate:(0,m.assertValueType)("boolean")},init:{optional:!0,validate:(0,m.assertNodeType)("Expression")}}}),f("WhileStatement",{visitor:["test","body"],aliases:["Statement","BlockParent","Loop","While","Scopable"],fields:{test:{validate:(0,m.assertNodeType)("Expression")},body:{validate:(0,m.assertNodeType)("Statement")}}}),f("WithStatement",{visitor:["object","body"],aliases:["Statement"],fields:{object:{validate:(0,m.assertNodeType)("Expression")},body:{validate:(0,m.assertNodeType)("Statement")}}}),f("AssignmentPattern",{visitor:["left","right","decorators"],builder:["left","right"],aliases:["FunctionParameter","Pattern","PatternLike","LVal"],fields:Object.assign({},E(),{left:{validate:(0,m.assertNodeType)("Identifier","ObjectPattern","ArrayPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression")},right:{validate:(0,m.assertNodeType)("Expression")},decorators:{validate:(0,m.arrayOfType)("Decorator"),optional:!0}})}),f("ArrayPattern",{visitor:["elements","typeAnnotation"],builder:["elements"],aliases:["FunctionParameter","Pattern","PatternLike","LVal"],fields:Object.assign({},E(),{elements:{validate:(0,m.chain)((0,m.assertValueType)("array"),(0,m.assertEach)((0,m.assertNodeOrValueType)("null","PatternLike")))}})}),f("ArrowFunctionExpression",{builder:["params","body","async"],visitor:["typeParameters","params","predicate","returnType","body"],aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:Object.assign({},g(),A(),{expression:{validate:(0,m.assertValueType)("boolean")},body:{validate:(0,m.assertNodeType)("BlockStatement","Expression")},predicate:{validate:(0,m.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}})}),f("ClassBody",{visitor:["body"],fields:{body:(0,m.validateArrayOfType)("ClassMethod","ClassPrivateMethod","ClassProperty","ClassPrivateProperty","ClassAccessorProperty","TSDeclareMethod","TSIndexSignature","StaticBlock")}}),f("ClassExpression",{builder:["id","superClass","body","decorators"],visitor:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body"],aliases:["Scopable","Class","Expression"],fields:{id:{validate:(0,m.assertNodeType)("Identifier"),optional:!0},typeParameters:{validate:(0,m.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0},body:{validate:(0,m.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,m.assertNodeType)("Expression")},superTypeParameters:{validate:(0,m.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0},implements:{validate:(0,m.arrayOfType)("TSExpressionWithTypeArguments","ClassImplements"),optional:!0},decorators:{validate:(0,m.arrayOfType)("Decorator"),optional:!0},mixins:{validate:(0,m.assertNodeType)("InterfaceExtends"),optional:!0}}}),f("ClassDeclaration",{inherits:"ClassExpression",aliases:["Scopable","Class","Statement","Declaration"],fields:{id:{validate:(0,m.assertNodeType)("Identifier"),optional:!0},typeParameters:{validate:(0,m.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0},body:{validate:(0,m.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,m.assertNodeType)("Expression")},superTypeParameters:{validate:(0,m.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0},implements:{validate:(0,m.arrayOfType)("TSExpressionWithTypeArguments","ClassImplements"),optional:!0},decorators:{validate:(0,m.arrayOfType)("Decorator"),optional:!0},mixins:{validate:(0,m.assertNodeType)("InterfaceExtends"),optional:!0},declare:{validate:(0,m.assertValueType)("boolean"),optional:!0},abstract:{validate:(0,m.assertValueType)("boolean"),optional:!0}},validate:process.env.BABEL_TYPES_8_BREAKING?(function(){let I=(0,m.assertNodeType)("Identifier");return function(w,k,N){(0,a.default)("ExportDefaultDeclaration",w)||I(N,"id",N.id)}})():void 0});let _=s.importAttributes={attributes:{optional:!0,validate:(0,m.arrayOfType)("ImportAttribute")}};_.assertions={deprecated:!0,optional:!0,validate:(0,m.arrayOfType)("ImportAttribute")},f("ExportAllDeclaration",{builder:["source","attributes"],visitor:["source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:Object.assign({source:{validate:(0,m.assertNodeType)("StringLiteral")},exportKind:(0,m.validateOptional)((0,m.assertOneOf)("type","value"))},_)}),f("ExportDefaultDeclaration",{visitor:["declaration"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:{declaration:(0,m.validateType)("TSDeclareFunction","FunctionDeclaration","ClassDeclaration","Expression"),exportKind:(0,m.validateOptional)((0,m.assertOneOf)("value"))}}),f("ExportNamedDeclaration",{builder:["declaration","specifiers","source","attributes"],visitor:["declaration","specifiers","source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:Object.assign({declaration:{optional:!0,validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.chain)((0,m.assertNodeType)("Declaration"),Object.assign(function(I,w,k){if(k&&I.specifiers.length)throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");if(k&&I.source)throw new TypeError("Cannot export a declaration from a source")},{oneOfNodeTypes:["Declaration"]})):(0,m.assertNodeType)("Declaration")}},_,{specifiers:{default:[],validate:(0,m.arrayOf)((function(){let I=(0,m.assertNodeType)("ExportSpecifier","ExportDefaultSpecifier","ExportNamespaceSpecifier"),w=(0,m.assertNodeType)("ExportSpecifier");return process.env.BABEL_TYPES_8_BREAKING?Object.assign(function(k,N,O){(k.source?I:w)(k,N,O)},{oneOfNodeTypes:["ExportSpecifier","ExportDefaultSpecifier","ExportNamespaceSpecifier"]}):I})())},source:{validate:(0,m.assertNodeType)("StringLiteral"),optional:!0},exportKind:(0,m.validateOptional)((0,m.assertOneOf)("type","value"))})}),f("ExportSpecifier",{visitor:["local","exported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,m.assertNodeType)("Identifier")},exported:{validate:(0,m.assertNodeType)("Identifier","StringLiteral")},exportKind:{validate:(0,m.assertOneOf)("type","value"),optional:!0}}}),f("ForOfStatement",{visitor:["left","right","body"],builder:["left","right","body","await"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(function(){if(!process.env.BABEL_TYPES_8_BREAKING)return(0,m.assertNodeType)("VariableDeclaration","LVal");let I=(0,m.assertNodeType)("VariableDeclaration"),w=(0,m.assertNodeType)("Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression");return Object.assign(function(k,N,O){(0,a.default)("VariableDeclaration",O)?I(k,N,O):w(k,N,O)},{oneOfNodeTypes:["VariableDeclaration","Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]})})()},right:{validate:(0,m.assertNodeType)("Expression")},body:{validate:(0,m.assertNodeType)("Statement")},await:{default:!1}}}),f("ImportDeclaration",{builder:["specifiers","source","attributes"],visitor:["specifiers","source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration"],fields:Object.assign({},_,{module:{optional:!0,validate:(0,m.assertValueType)("boolean")},phase:{default:null,validate:(0,m.assertOneOf)("source","defer")},specifiers:(0,m.validateArrayOfType)("ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier"),source:{validate:(0,m.assertNodeType)("StringLiteral")},importKind:{validate:(0,m.assertOneOf)("type","typeof","value"),optional:!0}})}),f("ImportDefaultSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,m.assertNodeType)("Identifier")}}}),f("ImportNamespaceSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,m.assertNodeType)("Identifier")}}}),f("ImportSpecifier",{visitor:["imported","local"],builder:["local","imported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,m.assertNodeType)("Identifier")},imported:{validate:(0,m.assertNodeType)("Identifier","StringLiteral")},importKind:{validate:(0,m.assertOneOf)("type","typeof","value"),optional:!0}}}),f("ImportExpression",{visitor:["source","options"],aliases:["Expression"],fields:{phase:{default:null,validate:(0,m.assertOneOf)("source","defer")},source:{validate:(0,m.assertNodeType)("Expression")},options:{validate:(0,m.assertNodeType)("Expression"),optional:!0}}}),f("MetaProperty",{visitor:["meta","property"],aliases:["Expression"],fields:{meta:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.chain)((0,m.assertNodeType)("Identifier"),Object.assign(function(I,w,k){let N;switch(k.name){case"function":N="sent";break;case"new":N="target";break;case"import":N="meta"}if(!(0,a.default)("Identifier",I.property,{name:N}))throw new TypeError("Unrecognised MetaProperty")},{oneOfNodeTypes:["Identifier"]})):(0,m.assertNodeType)("Identifier")},property:{validate:(0,m.assertNodeType)("Identifier")}}});let S=()=>({abstract:{validate:(0,m.assertValueType)("boolean"),optional:!0},accessibility:{validate:(0,m.assertOneOf)("public","private","protected"),optional:!0},static:{default:!1},override:{default:!1},computed:{default:!1},optional:{validate:(0,m.assertValueType)("boolean"),optional:!0},key:{validate:(0,m.chain)((function(){let I=(0,m.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral"),w=(0,m.assertNodeType)("Expression");return function(k,N,O){(k.computed?w:I)(k,N,O)}})(),(0,m.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","Expression"))}});s.classMethodOrPropertyCommon=S;let C=()=>Object.assign({},g(),S(),{params:(0,m.validateArrayOfType)("FunctionParameter","TSParameterProperty"),kind:{validate:(0,m.assertOneOf)("get","set","method","constructor"),default:"method"},access:{validate:(0,m.chain)((0,m.assertValueType)("string"),(0,m.assertOneOf)("public","private","protected")),optional:!0},decorators:{validate:(0,m.arrayOfType)("Decorator"),optional:!0}});s.classMethodOrDeclareMethodCommon=C,f("ClassMethod",Object.assign({aliases:["Function","Scopable","BlockParent","FunctionParent","Method"],builder:["kind","key","params","body","computed","static","generator","async"],visitor:["decorators","key","typeParameters","params","returnType","body"]},h(),{fields:Object.assign({},C(),A(),{body:{validate:(0,m.assertNodeType)("BlockStatement")}})})),f("ObjectPattern",{visitor:["decorators","properties","typeAnnotation"],builder:["properties"],aliases:["FunctionParameter","Pattern","PatternLike","LVal"],fields:Object.assign({},E(),{properties:(0,m.validateArrayOfType)("RestElement","ObjectProperty")})}),f("SpreadElement",{visitor:["argument"],aliases:["UnaryLike"],deprecatedAlias:"SpreadProperty",fields:{argument:{validate:(0,m.assertNodeType)("Expression")}}}),f("Super",{aliases:["Expression"]}),f("TaggedTemplateExpression",{visitor:["tag","typeParameters","quasi"],builder:["tag","quasi"],aliases:["Expression"],fields:{tag:{validate:(0,m.assertNodeType)("Expression")},quasi:{validate:(0,m.assertNodeType)("TemplateLiteral")},typeParameters:{validate:(0,m.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0}}}),f("TemplateElement",{builder:["value","tail"],fields:{value:{validate:(0,m.chain)((0,m.assertShape)({raw:{validate:(0,m.assertValueType)("string")},cooked:{validate:(0,m.assertValueType)("string"),optional:!0}}),function(I){let w=I.value.raw,k=!1,N=()=>{throw new Error("Internal @babel/types error.")},{str:O,firstInvalidLoc:W}=(0,l.readStringContents)("template",w,0,0,0,{unterminated(){k=!0},strictNumericEscape:N,invalidEscapeSequence:N,numericSeparatorInEscapeSequence:N,unexpectedNumericSeparator:N,invalidDigit:N,invalidCodePoint:N});if(!k)throw new Error("Invalid raw");I.value.cooked=W?null:O})},tail:{default:!1}}}),f("TemplateLiteral",{visitor:["quasis","expressions"],aliases:["Expression","Literal"],fields:{quasis:(0,m.validateArrayOfType)("TemplateElement"),expressions:{validate:(0,m.chain)((0,m.assertValueType)("array"),(0,m.assertEach)((0,m.assertNodeType)("Expression","TSType")),function(I,w,k){if(I.quasis.length!==k.length+1)throw new TypeError(`Number of ${I.type} quasis should be exactly one more than the number of expressions. +Expected ${k.length+1} quasis but got ${I.quasis.length}`)})}}}),f("YieldExpression",{builder:["argument","delegate"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{delegate:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.chain)((0,m.assertValueType)("boolean"),Object.assign(function(I,w,k){if(k&&!I.argument)throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument")},{type:"boolean"})):(0,m.assertValueType)("boolean"),default:!1},argument:{optional:!0,validate:(0,m.assertNodeType)("Expression")}}}),f("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:(0,m.assertNodeType)("Expression")}}}),f("Import",{aliases:["Expression"]}),f("BigIntLiteral",{builder:["value"],fields:{value:{validate:(0,m.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),f("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,m.assertNodeType)("Identifier")}}}),f("OptionalMemberExpression",{builder:["object","property","computed","optional"],visitor:["object","property"],aliases:["Expression"],fields:{object:{validate:(0,m.assertNodeType)("Expression")},property:{validate:(function(){let I=(0,m.assertNodeType)("Identifier"),w=(0,m.assertNodeType)("Expression");return Object.assign(function(k,N,O){(k.computed?w:I)(k,N,O)},{oneOfNodeTypes:["Expression","Identifier"]})})()},computed:{default:!1},optional:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.chain)((0,m.assertValueType)("boolean"),(0,m.assertOptionalChainStart)()):(0,m.assertValueType)("boolean")}}}),f("OptionalCallExpression",{visitor:["callee","typeParameters","typeArguments","arguments"],builder:["callee","arguments","optional"],aliases:["Expression"],fields:Object.assign({callee:{validate:(0,m.assertNodeType)("Expression")},arguments:(0,m.validateArrayOfType)("Expression","SpreadElement","ArgumentPlaceholder"),optional:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,m.chain)((0,m.assertValueType)("boolean"),(0,m.assertOptionalChainStart)()):(0,m.assertValueType)("boolean")},typeArguments:{validate:(0,m.assertNodeType)("TypeParameterInstantiation"),optional:!0}},{typeParameters:{validate:(0,m.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}})}),f("ClassProperty",Object.assign({visitor:["decorators","variance","key","typeAnnotation","value"],builder:["key","value","typeAnnotation","decorators","computed","static"],aliases:["Property"]},h(),{fields:Object.assign({},S(),{value:{validate:(0,m.assertNodeType)("Expression"),optional:!0},definite:{validate:(0,m.assertValueType)("boolean"),optional:!0},typeAnnotation:{validate:(0,m.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0,m.arrayOfType)("Decorator"),optional:!0},readonly:{validate:(0,m.assertValueType)("boolean"),optional:!0},declare:{validate:(0,m.assertValueType)("boolean"),optional:!0},variance:{validate:(0,m.assertNodeType)("Variance"),optional:!0}})})),f("ClassAccessorProperty",Object.assign({visitor:["decorators","key","typeAnnotation","value"],builder:["key","value","typeAnnotation","decorators","computed","static"],aliases:["Property","Accessor"]},h(!0),{fields:Object.assign({},S(),{key:{validate:(0,m.chain)((function(){let I=(0,m.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","PrivateName"),w=(0,m.assertNodeType)("Expression");return function(k,N,O){(k.computed?w:I)(k,N,O)}})(),(0,m.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","Expression","PrivateName"))},value:{validate:(0,m.assertNodeType)("Expression"),optional:!0},definite:{validate:(0,m.assertValueType)("boolean"),optional:!0},typeAnnotation:{validate:(0,m.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0,m.arrayOfType)("Decorator"),optional:!0},readonly:{validate:(0,m.assertValueType)("boolean"),optional:!0},declare:{validate:(0,m.assertValueType)("boolean"),optional:!0},variance:{validate:(0,m.assertNodeType)("Variance"),optional:!0}})})),f("ClassPrivateProperty",{visitor:["decorators","variance","key","typeAnnotation","value"],builder:["key","value","decorators","static"],aliases:["Property","Private"],fields:{key:{validate:(0,m.assertNodeType)("PrivateName")},value:{validate:(0,m.assertNodeType)("Expression"),optional:!0},typeAnnotation:{validate:(0,m.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0,m.arrayOfType)("Decorator"),optional:!0},static:{validate:(0,m.assertValueType)("boolean"),default:!1},readonly:{validate:(0,m.assertValueType)("boolean"),optional:!0},optional:{validate:(0,m.assertValueType)("boolean"),optional:!0},definite:{validate:(0,m.assertValueType)("boolean"),optional:!0},variance:{validate:(0,m.assertNodeType)("Variance"),optional:!0}}}),f("ClassPrivateMethod",{builder:["kind","key","params","body","static"],visitor:["decorators","key","typeParameters","params","returnType","body"],aliases:["Function","Scopable","BlockParent","FunctionParent","Method","Private"],fields:Object.assign({},C(),A(),{kind:{validate:(0,m.assertOneOf)("get","set","method"),default:"method"},key:{validate:(0,m.assertNodeType)("PrivateName")},body:{validate:(0,m.assertNodeType)("BlockStatement")}})}),f("PrivateName",{visitor:["id"],aliases:["Private"],fields:{id:{validate:(0,m.assertNodeType)("Identifier")}}}),f("StaticBlock",{visitor:["body"],fields:{body:(0,m.validateArrayOfType)("Statement")},aliases:["Scopable","BlockParent","FunctionParent"]}),f("ImportAttribute",{visitor:["key","value"],fields:{key:{validate:(0,m.assertNodeType)("Identifier","StringLiteral")},value:{validate:(0,m.assertNodeType)("StringLiteral")}}})},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/deprecated-aliases.js"(i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.DEPRECATED_ALIASES=void 0,s.DEPRECATED_ALIASES={ModuleDeclaration:"ImportOrExportDeclaration"}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/experimental.js"(i,s,o){"use strict";var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/utils.js");(0,a.default)("ArgumentPlaceholder",{}),(0,a.default)("BindExpression",{visitor:["object","callee"],aliases:["Expression"],fields:process.env.BABEL_TYPES_8_BREAKING?{object:{validate:(0,a.assertNodeType)("Expression")},callee:{validate:(0,a.assertNodeType)("Expression")}}:{object:{validate:Object.assign(()=>{},{oneOfNodeTypes:["Expression"]})},callee:{validate:Object.assign(()=>{},{oneOfNodeTypes:["Expression"]})}}}),(0,a.default)("Decorator",{visitor:["expression"],fields:{expression:{validate:(0,a.assertNodeType)("Expression")}}}),(0,a.default)("DoExpression",{visitor:["body"],builder:["body","async"],aliases:["Expression"],fields:{body:{validate:(0,a.assertNodeType)("BlockStatement")},async:{validate:(0,a.assertValueType)("boolean"),default:!1}}}),(0,a.default)("ExportDefaultSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,a.assertNodeType)("Identifier")}}}),(0,a.default)("RecordExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:(0,a.validateArrayOfType)("ObjectProperty","SpreadElement")}}),(0,a.default)("TupleExpression",{fields:{elements:{validate:(0,a.arrayOfType)("Expression","SpreadElement"),default:[]}},visitor:["elements"],aliases:["Expression"]}),(0,a.default)("DecimalLiteral",{builder:["value"],fields:{value:{validate:(0,a.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,a.default)("ModuleExpression",{visitor:["body"],fields:{body:{validate:(0,a.assertNodeType)("Program")}},aliases:["Expression"]}),(0,a.default)("TopicReference",{aliases:["Expression"]}),(0,a.default)("PipelineTopicExpression",{builder:["expression"],visitor:["expression"],fields:{expression:{validate:(0,a.assertNodeType)("Expression")}},aliases:["Expression"]}),(0,a.default)("PipelineBareFunction",{builder:["callee"],visitor:["callee"],fields:{callee:{validate:(0,a.assertNodeType)("Expression")}},aliases:["Expression"]}),(0,a.default)("PipelinePrimaryTopicReference",{aliases:["Expression"]}),(0,a.default)("VoidPattern",{aliases:["Pattern","PatternLike","FunctionParameter"]})},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/flow.js"(i,s,o){"use strict";var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/core.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/utils.js");let u=(0,c.defineAliasedType)("Flow"),l=d=>{let m=d==="DeclareClass";u(d,{builder:["id","typeParameters","extends","body"],visitor:["id","typeParameters","extends",...m?["mixins","implements"]:[],"body"],aliases:["FlowDeclaration","Statement","Declaration"],fields:Object.assign({id:(0,c.validateType)("Identifier"),typeParameters:(0,c.validateOptionalType)("TypeParameterDeclaration"),extends:(0,c.validateOptional)((0,c.arrayOfType)("InterfaceExtends"))},m?{mixins:(0,c.validateOptional)((0,c.arrayOfType)("InterfaceExtends")),implements:(0,c.validateOptional)((0,c.arrayOfType)("ClassImplements"))}:{},{body:(0,c.validateType)("ObjectTypeAnnotation")})})};u("AnyTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),u("ArrayTypeAnnotation",{visitor:["elementType"],aliases:["FlowType"],fields:{elementType:(0,c.validateType)("FlowType")}}),u("BooleanTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),u("BooleanLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:(0,c.validate)((0,c.assertValueType)("boolean"))}}),u("NullLiteralTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),u("ClassImplements",{visitor:["id","typeParameters"],fields:{id:(0,c.validateType)("Identifier"),typeParameters:(0,c.validateOptionalType)("TypeParameterInstantiation")}}),l("DeclareClass"),u("DeclareFunction",{builder:["id"],visitor:["id","predicate"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,c.validateType)("Identifier"),predicate:(0,c.validateOptionalType)("DeclaredPredicate")}}),l("DeclareInterface"),u("DeclareModule",{builder:["id","body","kind"],visitor:["id","body"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,c.validateType)("Identifier","StringLiteral"),body:(0,c.validateType)("BlockStatement"),kind:(0,c.validateOptional)((0,c.assertOneOf)("CommonJS","ES"))}}),u("DeclareModuleExports",{visitor:["typeAnnotation"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{typeAnnotation:(0,c.validateType)("TypeAnnotation")}}),u("DeclareTypeAlias",{visitor:["id","typeParameters","right"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,c.validateType)("Identifier"),typeParameters:(0,c.validateOptionalType)("TypeParameterDeclaration"),right:(0,c.validateType)("FlowType")}}),u("DeclareOpaqueType",{visitor:["id","typeParameters","supertype"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,c.validateType)("Identifier"),typeParameters:(0,c.validateOptionalType)("TypeParameterDeclaration"),supertype:(0,c.validateOptionalType)("FlowType"),impltype:(0,c.validateOptionalType)("FlowType")}}),u("DeclareVariable",{visitor:["id"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,c.validateType)("Identifier")}}),u("DeclareExportDeclaration",{visitor:["declaration","specifiers","source","attributes"],aliases:["FlowDeclaration","Statement","Declaration"],fields:Object.assign({declaration:(0,c.validateOptionalType)("Flow"),specifiers:(0,c.validateOptional)((0,c.arrayOfType)("ExportSpecifier","ExportNamespaceSpecifier")),source:(0,c.validateOptionalType)("StringLiteral"),default:(0,c.validateOptional)((0,c.assertValueType)("boolean"))},a.importAttributes)}),u("DeclareExportAllDeclaration",{visitor:["source","attributes"],aliases:["FlowDeclaration","Statement","Declaration"],fields:Object.assign({source:(0,c.validateType)("StringLiteral"),exportKind:(0,c.validateOptional)((0,c.assertOneOf)("type","value"))},a.importAttributes)}),u("DeclaredPredicate",{visitor:["value"],aliases:["FlowPredicate"],fields:{value:(0,c.validateType)("Flow")}}),u("ExistsTypeAnnotation",{aliases:["FlowType"]}),u("FunctionTypeAnnotation",{builder:["typeParameters","params","rest","returnType"],visitor:["typeParameters","this","params","rest","returnType"],aliases:["FlowType"],fields:{typeParameters:(0,c.validateOptionalType)("TypeParameterDeclaration"),params:(0,c.validateArrayOfType)("FunctionTypeParam"),rest:(0,c.validateOptionalType)("FunctionTypeParam"),this:(0,c.validateOptionalType)("FunctionTypeParam"),returnType:(0,c.validateType)("FlowType")}}),u("FunctionTypeParam",{visitor:["name","typeAnnotation"],fields:{name:(0,c.validateOptionalType)("Identifier"),typeAnnotation:(0,c.validateType)("FlowType"),optional:(0,c.validateOptional)((0,c.assertValueType)("boolean"))}}),u("GenericTypeAnnotation",{visitor:["id","typeParameters"],aliases:["FlowType"],fields:{id:(0,c.validateType)("Identifier","QualifiedTypeIdentifier"),typeParameters:(0,c.validateOptionalType)("TypeParameterInstantiation")}}),u("InferredPredicate",{aliases:["FlowPredicate"]}),u("InterfaceExtends",{visitor:["id","typeParameters"],fields:{id:(0,c.validateType)("Identifier","QualifiedTypeIdentifier"),typeParameters:(0,c.validateOptionalType)("TypeParameterInstantiation")}}),l("InterfaceDeclaration"),u("InterfaceTypeAnnotation",{visitor:["extends","body"],aliases:["FlowType"],fields:{extends:(0,c.validateOptional)((0,c.arrayOfType)("InterfaceExtends")),body:(0,c.validateType)("ObjectTypeAnnotation")}}),u("IntersectionTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:(0,c.validate)((0,c.arrayOfType)("FlowType"))}}),u("MixedTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),u("EmptyTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),u("NullableTypeAnnotation",{visitor:["typeAnnotation"],aliases:["FlowType"],fields:{typeAnnotation:(0,c.validateType)("FlowType")}}),u("NumberLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:(0,c.validate)((0,c.assertValueType)("number"))}}),u("NumberTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),u("ObjectTypeAnnotation",{visitor:["properties","indexers","callProperties","internalSlots"],aliases:["FlowType"],builder:["properties","indexers","callProperties","internalSlots","exact"],fields:{properties:(0,c.validate)((0,c.arrayOfType)("ObjectTypeProperty","ObjectTypeSpreadProperty")),indexers:{validate:(0,c.arrayOfType)("ObjectTypeIndexer"),optional:!0,default:[]},callProperties:{validate:(0,c.arrayOfType)("ObjectTypeCallProperty"),optional:!0,default:[]},internalSlots:{validate:(0,c.arrayOfType)("ObjectTypeInternalSlot"),optional:!0,default:[]},exact:{validate:(0,c.assertValueType)("boolean"),default:!1},inexact:(0,c.validateOptional)((0,c.assertValueType)("boolean"))}}),u("ObjectTypeInternalSlot",{visitor:["id","value"],builder:["id","value","optional","static","method"],aliases:["UserWhitespacable"],fields:{id:(0,c.validateType)("Identifier"),value:(0,c.validateType)("FlowType"),optional:(0,c.validate)((0,c.assertValueType)("boolean")),static:(0,c.validate)((0,c.assertValueType)("boolean")),method:(0,c.validate)((0,c.assertValueType)("boolean"))}}),u("ObjectTypeCallProperty",{visitor:["value"],aliases:["UserWhitespacable"],fields:{value:(0,c.validateType)("FlowType"),static:(0,c.validate)((0,c.assertValueType)("boolean"))}}),u("ObjectTypeIndexer",{visitor:["variance","id","key","value"],builder:["id","key","value","variance"],aliases:["UserWhitespacable"],fields:{id:(0,c.validateOptionalType)("Identifier"),key:(0,c.validateType)("FlowType"),value:(0,c.validateType)("FlowType"),static:(0,c.validate)((0,c.assertValueType)("boolean")),variance:(0,c.validateOptionalType)("Variance")}}),u("ObjectTypeProperty",{visitor:["key","value","variance"],aliases:["UserWhitespacable"],fields:{key:(0,c.validateType)("Identifier","StringLiteral"),value:(0,c.validateType)("FlowType"),kind:(0,c.validate)((0,c.assertOneOf)("init","get","set")),static:(0,c.validate)((0,c.assertValueType)("boolean")),proto:(0,c.validate)((0,c.assertValueType)("boolean")),optional:(0,c.validate)((0,c.assertValueType)("boolean")),variance:(0,c.validateOptionalType)("Variance"),method:(0,c.validate)((0,c.assertValueType)("boolean"))}}),u("ObjectTypeSpreadProperty",{visitor:["argument"],aliases:["UserWhitespacable"],fields:{argument:(0,c.validateType)("FlowType")}}),u("OpaqueType",{visitor:["id","typeParameters","supertype","impltype"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,c.validateType)("Identifier"),typeParameters:(0,c.validateOptionalType)("TypeParameterDeclaration"),supertype:(0,c.validateOptionalType)("FlowType"),impltype:(0,c.validateType)("FlowType")}}),u("QualifiedTypeIdentifier",{visitor:["qualification","id"],builder:["id","qualification"],fields:{id:(0,c.validateType)("Identifier"),qualification:(0,c.validateType)("Identifier","QualifiedTypeIdentifier")}}),u("StringLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:(0,c.validate)((0,c.assertValueType)("string"))}}),u("StringTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),u("SymbolTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),u("ThisTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),u("TupleTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:(0,c.validate)((0,c.arrayOfType)("FlowType"))}}),u("TypeofTypeAnnotation",{visitor:["argument"],aliases:["FlowType"],fields:{argument:(0,c.validateType)("FlowType")}}),u("TypeAlias",{visitor:["id","typeParameters","right"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,c.validateType)("Identifier"),typeParameters:(0,c.validateOptionalType)("TypeParameterDeclaration"),right:(0,c.validateType)("FlowType")}}),u("TypeAnnotation",{visitor:["typeAnnotation"],fields:{typeAnnotation:(0,c.validateType)("FlowType")}}),u("TypeCastExpression",{visitor:["expression","typeAnnotation"],aliases:["ExpressionWrapper","Expression"],fields:{expression:(0,c.validateType)("Expression"),typeAnnotation:(0,c.validateType)("TypeAnnotation")}}),u("TypeParameter",{visitor:["bound","default","variance"],fields:{name:(0,c.validate)((0,c.assertValueType)("string")),bound:(0,c.validateOptionalType)("TypeAnnotation"),default:(0,c.validateOptionalType)("FlowType"),variance:(0,c.validateOptionalType)("Variance")}}),u("TypeParameterDeclaration",{visitor:["params"],fields:{params:(0,c.validate)((0,c.arrayOfType)("TypeParameter"))}}),u("TypeParameterInstantiation",{visitor:["params"],fields:{params:(0,c.validate)((0,c.arrayOfType)("FlowType"))}}),u("UnionTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:(0,c.validate)((0,c.arrayOfType)("FlowType"))}}),u("Variance",{builder:["kind"],fields:{kind:(0,c.validate)((0,c.assertOneOf)("minus","plus"))}}),u("VoidTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),u("EnumDeclaration",{aliases:["Statement","Declaration"],visitor:["id","body"],fields:{id:(0,c.validateType)("Identifier"),body:(0,c.validateType)("EnumBooleanBody","EnumNumberBody","EnumStringBody","EnumSymbolBody")}}),u("EnumBooleanBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:(0,c.validate)((0,c.assertValueType)("boolean")),members:(0,c.validateArrayOfType)("EnumBooleanMember"),hasUnknownMembers:(0,c.validate)((0,c.assertValueType)("boolean"))}}),u("EnumNumberBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:(0,c.validate)((0,c.assertValueType)("boolean")),members:(0,c.validateArrayOfType)("EnumNumberMember"),hasUnknownMembers:(0,c.validate)((0,c.assertValueType)("boolean"))}}),u("EnumStringBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:(0,c.validate)((0,c.assertValueType)("boolean")),members:(0,c.validateArrayOfType)("EnumStringMember","EnumDefaultedMember"),hasUnknownMembers:(0,c.validate)((0,c.assertValueType)("boolean"))}}),u("EnumSymbolBody",{aliases:["EnumBody"],visitor:["members"],fields:{members:(0,c.validateArrayOfType)("EnumDefaultedMember"),hasUnknownMembers:(0,c.validate)((0,c.assertValueType)("boolean"))}}),u("EnumBooleanMember",{aliases:["EnumMember"],builder:["id"],visitor:["id","init"],fields:{id:(0,c.validateType)("Identifier"),init:(0,c.validateType)("BooleanLiteral")}}),u("EnumNumberMember",{aliases:["EnumMember"],visitor:["id","init"],fields:{id:(0,c.validateType)("Identifier"),init:(0,c.validateType)("NumericLiteral")}}),u("EnumStringMember",{aliases:["EnumMember"],visitor:["id","init"],fields:{id:(0,c.validateType)("Identifier"),init:(0,c.validateType)("StringLiteral")}}),u("EnumDefaultedMember",{aliases:["EnumMember"],visitor:["id"],fields:{id:(0,c.validateType)("Identifier")}}),u("IndexedAccessType",{visitor:["objectType","indexType"],aliases:["FlowType"],fields:{objectType:(0,c.validateType)("FlowType"),indexType:(0,c.validateType)("FlowType")}}),u("OptionalIndexedAccessType",{visitor:["objectType","indexType"],aliases:["FlowType"],fields:{objectType:(0,c.validateType)("FlowType"),indexType:(0,c.validateType)("FlowType"),optional:(0,c.validate)((0,c.assertValueType)("boolean"))}})},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/index.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"ALIAS_KEYS",{enumerable:!0,get:function(){return a.ALIAS_KEYS}}),Object.defineProperty(s,"BUILDER_KEYS",{enumerable:!0,get:function(){return a.BUILDER_KEYS}}),Object.defineProperty(s,"DEPRECATED_ALIASES",{enumerable:!0,get:function(){return u.DEPRECATED_ALIASES}}),Object.defineProperty(s,"DEPRECATED_KEYS",{enumerable:!0,get:function(){return a.DEPRECATED_KEYS}}),Object.defineProperty(s,"FLIPPED_ALIAS_KEYS",{enumerable:!0,get:function(){return a.FLIPPED_ALIAS_KEYS}}),Object.defineProperty(s,"NODE_FIELDS",{enumerable:!0,get:function(){return a.NODE_FIELDS}}),Object.defineProperty(s,"NODE_PARENT_VALIDATIONS",{enumerable:!0,get:function(){return a.NODE_PARENT_VALIDATIONS}}),Object.defineProperty(s,"NODE_UNION_SHAPES__PRIVATE",{enumerable:!0,get:function(){return a.NODE_UNION_SHAPES__PRIVATE}}),Object.defineProperty(s,"PLACEHOLDERS",{enumerable:!0,get:function(){return c.PLACEHOLDERS}}),Object.defineProperty(s,"PLACEHOLDERS_ALIAS",{enumerable:!0,get:function(){return c.PLACEHOLDERS_ALIAS}}),Object.defineProperty(s,"PLACEHOLDERS_FLIPPED_ALIAS",{enumerable:!0,get:function(){return c.PLACEHOLDERS_FLIPPED_ALIAS}}),s.TYPES=void 0,Object.defineProperty(s,"VISITOR_KEYS",{enumerable:!0,get:function(){return a.VISITOR_KEYS}}),o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/core.js"),o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/flow.js"),o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/jsx.js"),o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/misc.js"),o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/experimental.js"),o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/typescript.js");var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/utils.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/placeholders.js"),u=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/deprecated-aliases.js");Object.keys(u.DEPRECATED_ALIASES).forEach(l=>{a.FLIPPED_ALIAS_KEYS[l]=a.FLIPPED_ALIAS_KEYS[u.DEPRECATED_ALIASES[l]]});for(let{types:l,set:d}of a.allExpandedTypes)for(let m of l){let h=a.FLIPPED_ALIAS_KEYS[m];h?h.forEach(d.add,d):d.add(m)}s.TYPES=[].concat(Object.keys(a.VISITOR_KEYS),Object.keys(a.FLIPPED_ALIAS_KEYS),Object.keys(a.DEPRECATED_KEYS))},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/jsx.js"(i,s,o){"use strict";var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/utils.js");let c=(0,a.defineAliasedType)("JSX");c("JSXAttribute",{visitor:["name","value"],aliases:["Immutable"],fields:{name:{validate:(0,a.assertNodeType)("JSXIdentifier","JSXNamespacedName")},value:{optional:!0,validate:(0,a.assertNodeType)("JSXElement","JSXFragment","StringLiteral","JSXExpressionContainer")}}}),c("JSXClosingElement",{visitor:["name"],aliases:["Immutable"],fields:{name:{validate:(0,a.assertNodeType)("JSXIdentifier","JSXMemberExpression","JSXNamespacedName")}}}),c("JSXElement",{builder:["openingElement","closingElement","children","selfClosing"],visitor:["openingElement","children","closingElement"],aliases:["Immutable","Expression"],fields:Object.assign({openingElement:{validate:(0,a.assertNodeType)("JSXOpeningElement")},closingElement:{optional:!0,validate:(0,a.assertNodeType)("JSXClosingElement")},children:(0,a.validateArrayOfType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement","JSXFragment")},{selfClosing:{validate:(0,a.assertValueType)("boolean"),optional:!0}})}),c("JSXEmptyExpression",{}),c("JSXExpressionContainer",{visitor:["expression"],aliases:["Immutable"],fields:{expression:{validate:(0,a.assertNodeType)("Expression","JSXEmptyExpression")}}}),c("JSXSpreadChild",{visitor:["expression"],aliases:["Immutable"],fields:{expression:{validate:(0,a.assertNodeType)("Expression")}}}),c("JSXIdentifier",{builder:["name"],fields:{name:{validate:(0,a.assertValueType)("string")}}}),c("JSXMemberExpression",{visitor:["object","property"],fields:{object:{validate:(0,a.assertNodeType)("JSXMemberExpression","JSXIdentifier")},property:{validate:(0,a.assertNodeType)("JSXIdentifier")}}}),c("JSXNamespacedName",{visitor:["namespace","name"],fields:{namespace:{validate:(0,a.assertNodeType)("JSXIdentifier")},name:{validate:(0,a.assertNodeType)("JSXIdentifier")}}}),c("JSXOpeningElement",{builder:["name","attributes","selfClosing"],visitor:["name","typeParameters","typeArguments","attributes"],aliases:["Immutable"],fields:Object.assign({name:{validate:(0,a.assertNodeType)("JSXIdentifier","JSXMemberExpression","JSXNamespacedName")},selfClosing:{default:!1},attributes:(0,a.validateArrayOfType)("JSXAttribute","JSXSpreadAttribute"),typeArguments:{validate:(0,a.assertNodeType)("TypeParameterInstantiation"),optional:!0}},{typeParameters:{validate:(0,a.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}})}),c("JSXSpreadAttribute",{visitor:["argument"],fields:{argument:{validate:(0,a.assertNodeType)("Expression")}}}),c("JSXText",{aliases:["Immutable"],builder:["value"],fields:{value:{validate:(0,a.assertValueType)("string")}}}),c("JSXFragment",{builder:["openingFragment","closingFragment","children"],visitor:["openingFragment","children","closingFragment"],aliases:["Immutable","Expression"],fields:{openingFragment:{validate:(0,a.assertNodeType)("JSXOpeningFragment")},closingFragment:{validate:(0,a.assertNodeType)("JSXClosingFragment")},children:(0,a.validateArrayOfType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement","JSXFragment")}}),c("JSXOpeningFragment",{aliases:["Immutable"]}),c("JSXClosingFragment",{aliases:["Immutable"]})},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/misc.js"(i,s,o){"use strict";var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/utils.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/placeholders.js"),u=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/core.js");let l=(0,a.defineAliasedType)("Miscellaneous");l("Noop",{visitor:[]}),l("Placeholder",{visitor:[],builder:["expectedNode","name"],fields:Object.assign({name:{validate:(0,a.assertNodeType)("Identifier")},expectedNode:{validate:(0,a.assertOneOf)(...c.PLACEHOLDERS)}},(0,u.patternLikeCommon)())}),l("V8IntrinsicIdentifier",{builder:["name"],fields:{name:{validate:(0,a.assertValueType)("string")}}})},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/placeholders.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.PLACEHOLDERS_FLIPPED_ALIAS=s.PLACEHOLDERS_ALIAS=s.PLACEHOLDERS=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/utils.js");let c=s.PLACEHOLDERS=["Identifier","StringLiteral","Expression","Statement","Declaration","BlockStatement","ClassBody","Pattern"],u=s.PLACEHOLDERS_ALIAS={Declaration:["Statement"],Pattern:["PatternLike","LVal"]};for(let d of c){let m=a.ALIAS_KEYS[d];m!=null&&m.length&&(u[d]=m)}let l=s.PLACEHOLDERS_FLIPPED_ALIAS={};Object.keys(u).forEach(d=>{u[d].forEach(m=>{hasOwnProperty.call(l,m)||(l[m]=[]),l[m].push(d)})})},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/typescript.js"(i,s,o){"use strict";var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/utils.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/core.js"),u=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/is.js");let l=(0,a.defineAliasedType)("TypeScript"),d=(0,a.assertValueType)("boolean"),m=()=>({returnType:{validate:(0,a.assertNodeType)("TSTypeAnnotation","Noop"),optional:!0},typeParameters:{validate:(0,a.assertNodeType)("TSTypeParameterDeclaration","Noop"),optional:!0}});l("TSParameterProperty",{aliases:["LVal"],visitor:["parameter"],fields:{accessibility:{validate:(0,a.assertOneOf)("public","private","protected"),optional:!0},readonly:{validate:(0,a.assertValueType)("boolean"),optional:!0},parameter:{validate:(0,a.assertNodeType)("Identifier","AssignmentPattern")},override:{validate:(0,a.assertValueType)("boolean"),optional:!0},decorators:{validate:(0,a.arrayOfType)("Decorator"),optional:!0}}}),l("TSDeclareFunction",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","params","returnType"],fields:Object.assign({},(0,c.functionDeclarationCommon)(),m())}),l("TSDeclareMethod",Object.assign({visitor:["decorators","key","typeParameters","params","returnType"]},(0,c.classMethodOrPropertyUnionShapeCommon)(),{fields:Object.assign({},(0,c.classMethodOrDeclareMethodCommon)(),m())})),l("TSQualifiedName",{aliases:["TSEntityName"],visitor:["left","right"],fields:{left:(0,a.validateType)("TSEntityName"),right:(0,a.validateType)("Identifier")}});let h=()=>({typeParameters:(0,a.validateOptionalType)("TSTypeParameterDeclaration"),parameters:(0,a.validateArrayOfType)("ArrayPattern","Identifier","ObjectPattern","RestElement"),typeAnnotation:(0,a.validateOptionalType)("TSTypeAnnotation")}),f={aliases:["TSTypeElement"],visitor:["typeParameters","parameters","typeAnnotation"],fields:h()};l("TSCallSignatureDeclaration",f),l("TSConstructSignatureDeclaration",f);let g=()=>({key:(0,a.validateType)("Expression"),computed:{default:!1},optional:(0,a.validateOptional)(d)});l("TSPropertySignature",{aliases:["TSTypeElement"],visitor:["key","typeAnnotation"],fields:Object.assign({},g(),{readonly:(0,a.validateOptional)(d),typeAnnotation:(0,a.validateOptionalType)("TSTypeAnnotation"),kind:{optional:!0,validate:(0,a.assertOneOf)("get","set")}})}),l("TSMethodSignature",{aliases:["TSTypeElement"],visitor:["key","typeParameters","parameters","typeAnnotation"],fields:Object.assign({},h(),g(),{kind:{validate:(0,a.assertOneOf)("method","get","set")}})}),l("TSIndexSignature",{aliases:["TSTypeElement"],visitor:["parameters","typeAnnotation"],fields:{readonly:(0,a.validateOptional)(d),static:(0,a.validateOptional)(d),parameters:(0,a.validateArrayOfType)("Identifier"),typeAnnotation:(0,a.validateOptionalType)("TSTypeAnnotation")}});let A=["TSAnyKeyword","TSBooleanKeyword","TSBigIntKeyword","TSIntrinsicKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"];for(let S of A)l(S,{aliases:["TSType","TSBaseType"],visitor:[],fields:{}});l("TSThisType",{aliases:["TSType","TSBaseType"],visitor:[],fields:{}});let y={aliases:["TSType"],visitor:["typeParameters","parameters","typeAnnotation"]};l("TSFunctionType",Object.assign({},y,{fields:h()})),l("TSConstructorType",Object.assign({},y,{fields:Object.assign({},h(),{abstract:(0,a.validateOptional)(d)})})),l("TSTypeReference",{aliases:["TSType"],visitor:["typeName","typeParameters"],fields:{typeName:(0,a.validateType)("TSEntityName"),typeParameters:(0,a.validateOptionalType)("TSTypeParameterInstantiation")}}),l("TSTypePredicate",{aliases:["TSType"],visitor:["parameterName","typeAnnotation"],builder:["parameterName","typeAnnotation","asserts"],fields:{parameterName:(0,a.validateType)("Identifier","TSThisType"),typeAnnotation:(0,a.validateOptionalType)("TSTypeAnnotation"),asserts:(0,a.validateOptional)(d)}}),l("TSTypeQuery",{aliases:["TSType"],visitor:["exprName","typeParameters"],fields:{exprName:(0,a.validateType)("TSEntityName","TSImportType"),typeParameters:(0,a.validateOptionalType)("TSTypeParameterInstantiation")}}),l("TSTypeLiteral",{aliases:["TSType"],visitor:["members"],fields:{members:(0,a.validateArrayOfType)("TSTypeElement")}}),l("TSArrayType",{aliases:["TSType"],visitor:["elementType"],fields:{elementType:(0,a.validateType)("TSType")}}),l("TSTupleType",{aliases:["TSType"],visitor:["elementTypes"],fields:{elementTypes:(0,a.validateArrayOfType)("TSType","TSNamedTupleMember")}}),l("TSOptionalType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0,a.validateType)("TSType")}}),l("TSRestType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0,a.validateType)("TSType")}}),l("TSNamedTupleMember",{visitor:["label","elementType"],builder:["label","elementType","optional"],fields:{label:(0,a.validateType)("Identifier"),optional:{validate:d,default:!1},elementType:(0,a.validateType)("TSType")}});let E={aliases:["TSType"],visitor:["types"],fields:{types:(0,a.validateArrayOfType)("TSType")}};l("TSUnionType",E),l("TSIntersectionType",E),l("TSConditionalType",{aliases:["TSType"],visitor:["checkType","extendsType","trueType","falseType"],fields:{checkType:(0,a.validateType)("TSType"),extendsType:(0,a.validateType)("TSType"),trueType:(0,a.validateType)("TSType"),falseType:(0,a.validateType)("TSType")}}),l("TSInferType",{aliases:["TSType"],visitor:["typeParameter"],fields:{typeParameter:(0,a.validateType)("TSTypeParameter")}}),l("TSParenthesizedType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0,a.validateType)("TSType")}}),l("TSTypeOperator",{aliases:["TSType"],visitor:["typeAnnotation"],builder:["typeAnnotation","operator"],fields:{operator:{validate:(0,a.assertValueType)("string"),default:"keyof"},typeAnnotation:(0,a.validateType)("TSType")}}),l("TSIndexedAccessType",{aliases:["TSType"],visitor:["objectType","indexType"],fields:{objectType:(0,a.validateType)("TSType"),indexType:(0,a.validateType)("TSType")}}),l("TSMappedType",{aliases:["TSType"],visitor:["typeParameter","nameType","typeAnnotation"],builder:["typeParameter","typeAnnotation","nameType"],fields:Object.assign({},{typeParameter:(0,a.validateType)("TSTypeParameter")},{readonly:(0,a.validateOptional)((0,a.assertOneOf)(!0,!1,"+","-")),optional:(0,a.validateOptional)((0,a.assertOneOf)(!0,!1,"+","-")),typeAnnotation:(0,a.validateOptionalType)("TSType"),nameType:(0,a.validateOptionalType)("TSType")})}),l("TSTemplateLiteralType",{aliases:["TSType","TSBaseType"],visitor:["quasis","types"],fields:{quasis:(0,a.validateArrayOfType)("TemplateElement"),types:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("TSType")),function(S,C,I){if(S.quasis.length!==I.length+1)throw new TypeError(`Number of ${S.type} quasis should be exactly one more than the number of types. +Expected ${I.length+1} quasis but got ${S.quasis.length}`)})}}}),l("TSLiteralType",{aliases:["TSType","TSBaseType"],visitor:["literal"],fields:{literal:{validate:(function(){let S=(0,a.assertNodeType)("NumericLiteral","BigIntLiteral"),C=(0,a.assertOneOf)("-"),I=(0,a.assertNodeType)("NumericLiteral","StringLiteral","BooleanLiteral","BigIntLiteral","TemplateLiteral"),w=function(k,N,O){(0,u.default)("UnaryExpression",O)?(C(O,"operator",O.operator),S(O,"argument",O.argument)):I(k,N,O)};return w.oneOfNodeTypes=["NumericLiteral","StringLiteral","BooleanLiteral","BigIntLiteral","TemplateLiteral","UnaryExpression"],w})()}}}),l("TSExpressionWithTypeArguments",{aliases:["TSType"],visitor:["expression","typeParameters"],fields:{expression:(0,a.validateType)("TSEntityName"),typeParameters:(0,a.validateOptionalType)("TSTypeParameterInstantiation")}}),l("TSInterfaceDeclaration",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","extends","body"],fields:{declare:(0,a.validateOptional)(d),id:(0,a.validateType)("Identifier"),typeParameters:(0,a.validateOptionalType)("TSTypeParameterDeclaration"),extends:(0,a.validateOptional)((0,a.arrayOfType)("TSExpressionWithTypeArguments")),body:(0,a.validateType)("TSInterfaceBody")}}),l("TSInterfaceBody",{visitor:["body"],fields:{body:(0,a.validateArrayOfType)("TSTypeElement")}}),l("TSTypeAliasDeclaration",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","typeAnnotation"],fields:{declare:(0,a.validateOptional)(d),id:(0,a.validateType)("Identifier"),typeParameters:(0,a.validateOptionalType)("TSTypeParameterDeclaration"),typeAnnotation:(0,a.validateType)("TSType")}}),l("TSInstantiationExpression",{aliases:["Expression"],visitor:["expression","typeParameters"],fields:{expression:(0,a.validateType)("Expression"),typeParameters:(0,a.validateOptionalType)("TSTypeParameterInstantiation")}});let _={aliases:["Expression","LVal","PatternLike"],visitor:["expression","typeAnnotation"],fields:{expression:(0,a.validateType)("Expression"),typeAnnotation:(0,a.validateType)("TSType")}};l("TSAsExpression",_),l("TSSatisfiesExpression",_),l("TSTypeAssertion",{aliases:["Expression","LVal","PatternLike"],visitor:["typeAnnotation","expression"],fields:{typeAnnotation:(0,a.validateType)("TSType"),expression:(0,a.validateType)("Expression")}}),l("TSEnumBody",{visitor:["members"],fields:{members:(0,a.validateArrayOfType)("TSEnumMember")}}),l("TSEnumDeclaration",{aliases:["Statement","Declaration"],visitor:["id","members"],fields:{declare:(0,a.validateOptional)(d),const:(0,a.validateOptional)(d),id:(0,a.validateType)("Identifier"),members:(0,a.validateArrayOfType)("TSEnumMember"),initializer:(0,a.validateOptionalType)("Expression"),body:(0,a.validateOptionalType)("TSEnumBody")}}),l("TSEnumMember",{visitor:["id","initializer"],fields:{id:(0,a.validateType)("Identifier","StringLiteral"),initializer:(0,a.validateOptionalType)("Expression")}}),l("TSModuleDeclaration",{aliases:["Statement","Declaration"],visitor:["id","body"],fields:Object.assign({kind:{validate:(0,a.assertOneOf)("global","module","namespace")},declare:(0,a.validateOptional)(d)},{global:(0,a.validateOptional)(d)},{id:(0,a.validateType)("Identifier","StringLiteral"),body:(0,a.validateType)("TSModuleBlock","TSModuleDeclaration")})}),l("TSModuleBlock",{aliases:["Scopable","Block","BlockParent","FunctionParent"],visitor:["body"],fields:{body:(0,a.validateArrayOfType)("Statement")}}),l("TSImportType",{aliases:["TSType"],builder:["argument","qualifier","typeParameters"],visitor:["argument","options","qualifier","typeParameters"],fields:Object.assign({},{argument:(0,a.validateType)("StringLiteral")},{qualifier:(0,a.validateOptionalType)("TSEntityName")},{typeParameters:(0,a.validateOptionalType)("TSTypeParameterInstantiation")},{options:{validate:(0,a.assertNodeType)("ObjectExpression"),optional:!0}})}),l("TSImportEqualsDeclaration",{aliases:["Statement","Declaration"],visitor:["id","moduleReference"],fields:Object.assign({},{isExport:(0,a.validate)(d)},{id:(0,a.validateType)("Identifier"),moduleReference:(0,a.validateType)("TSEntityName","TSExternalModuleReference"),importKind:{validate:(0,a.assertOneOf)("type","value"),optional:!0}})}),l("TSExternalModuleReference",{visitor:["expression"],fields:{expression:(0,a.validateType)("StringLiteral")}}),l("TSNonNullExpression",{aliases:["Expression","LVal","PatternLike"],visitor:["expression"],fields:{expression:(0,a.validateType)("Expression")}}),l("TSExportAssignment",{aliases:["Statement"],visitor:["expression"],fields:{expression:(0,a.validateType)("Expression")}}),l("TSNamespaceExportDeclaration",{aliases:["Statement"],visitor:["id"],fields:{id:(0,a.validateType)("Identifier")}}),l("TSTypeAnnotation",{visitor:["typeAnnotation"],fields:{typeAnnotation:{validate:(0,a.assertNodeType)("TSType")}}}),l("TSTypeParameterInstantiation",{visitor:["params"],fields:{params:(0,a.validateArrayOfType)("TSType")}}),l("TSTypeParameterDeclaration",{visitor:["params"],fields:{params:(0,a.validateArrayOfType)("TSTypeParameter")}}),l("TSTypeParameter",{builder:["constraint","default","name"],visitor:["constraint","default"],fields:{name:{validate:(0,a.assertValueType)("string")},in:{validate:(0,a.assertValueType)("boolean"),optional:!0},out:{validate:(0,a.assertValueType)("boolean"),optional:!0},const:{validate:(0,a.assertValueType)("boolean"),optional:!0},constraint:{validate:(0,a.assertNodeType)("TSType"),optional:!0},default:{validate:(0,a.assertNodeType)("TSType"),optional:!0}}})},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/utils.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.allExpandedTypes=s.VISITOR_KEYS=s.NODE_UNION_SHAPES__PRIVATE=s.NODE_PARENT_VALIDATIONS=s.NODE_FIELDS=s.FLIPPED_ALIAS_KEYS=s.DEPRECATED_KEYS=s.BUILDER_KEYS=s.ALIAS_KEYS=void 0,s.arrayOf=_,s.arrayOfType=S,s.assertEach=C,s.assertNodeOrValueType=function(...q){function ce(Y,z,j){let se=y(j);for(let Ae of q)if(se===Ae||(0,a.default)(Ae,j))return void(0,c.validateChild)(Y,z,j);throw new TypeError(`Property ${z} of ${Y.type} expected node to be of a type ${JSON.stringify(q)} but instead got ${JSON.stringify(j?.type)}`)}return ce.oneOfNodeOrValueTypes=q,ce},s.assertNodeType=w,s.assertOneOf=function(...q){function ce(Y,z,j){if(!q.includes(j))throw new TypeError(`Property ${z} expected value to be one of ${JSON.stringify(q)} but got ${JSON.stringify(j)}`)}return ce.oneOf=q,ce},s.assertOptionalChainStart=function(){return function(q){var ce;let Y=q;for(;q;){let{type:z}=Y;if(z!=="OptionalCallExpression"){if(z!=="OptionalMemberExpression")break;if(Y.optional)return;Y=Y.object}else{if(Y.optional)return;Y=Y.callee}}throw new TypeError(`Non-optional ${q.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(ce=Y)==null?void 0:ce.type}`)}},s.assertShape=function(q){let ce=Object.keys(q);function Y(z,j,se){let Ae=[];for(let De of ce)try{(0,c.validateField)(z,De,se[De],q[De])}catch(Pe){if(Pe instanceof TypeError){Ae.push(Pe.message);continue}throw Pe}if(Ae.length)throw new TypeError(`Property ${j} of ${z.type} expected to have the following: +${Ae.join(` +`)}`)}return Y.shapeOf=q,Y},s.assertValueType=k,s.chain=N,s.default=G,s.defineAliasedType=function(...q){return(ce,Y={})=>{let z=Y.aliases;var j;z||(Y.inherits&&(z=(j=$[Y.inherits].aliases)==null?void 0:j.slice()),z!=null||(z=[]),Y.aliases=z);let se=q.filter(Ae=>!z.includes(Ae));z.unshift(...se),G(ce,Y)}},s.validate=E,s.validateArrayOfType=function(...q){return E(S(...q))},s.validateOptional=function(q){return{validate:q,optional:!0}},s.validateOptionalType=function(...q){return{validate:w(...q),optional:!0}},s.validateType=function(...q){return E(w(...q))};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/is.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/validate.js");let u=s.VISITOR_KEYS={},l=s.ALIAS_KEYS={},d=s.FLIPPED_ALIAS_KEYS={},m=s.NODE_FIELDS={},h=s.BUILDER_KEYS={},f=s.DEPRECATED_KEYS={},g=s.NODE_PARENT_VALIDATIONS={},A=s.NODE_UNION_SHAPES__PRIVATE={};function y(q){return Array.isArray(q)?"array":q===null?"null":typeof q}function E(q){return{validate:q}}function _(q){return N(k("array"),C(q))}function S(...q){return _(w(...q))}function C(q){let ce=process.env.BABEL_TYPES_8_BREAKING?c.validateChild:()=>{};function Y(z,j,se){if(!Array.isArray(se))return;let Ae=0,De={toString:()=>`${j}[${Ae}]`};for(;Ae=2&&"type"in q[0]&&q[0].type==="array"&&!("each"in q[1]))throw new Error('An assertValueType("array") validator can only be followed by an assertEach(...) validator.');return ce}let O=new Set(["aliases","builder","deprecatedAlias","fields","inherits","visitor","validate","unionShape"]),W=new Set(["default","optional","deprecated","validate"]),$={};function G(q,ce={}){let Y=ce.inherits&&$[ce.inherits]||{},z=ce.fields;if(!z&&(z={},Y.fields)){let De=Object.getOwnPropertyNames(Y.fields);for(let Pe of De){let we=Y.fields[Pe],ie=we.default;if(Array.isArray(ie)?ie.length>0:ie&&typeof ie=="object")throw new Error("field defaults can only be primitives or empty arrays currently");z[Pe]={default:Array.isArray(ie)?[]:ie,optional:we.optional,deprecated:we.deprecated,validate:we.validate}}}let j=ce.visitor||Y.visitor||[],se=ce.aliases||Y.aliases||[],Ae=ce.builder||Y.builder||ce.visitor||[];for(let De of Object.keys(ce))if(!O.has(De))throw new Error(`Unknown type option "${De}" on ${q}`);ce.deprecatedAlias&&(f[ce.deprecatedAlias]=q);for(let De of j.concat(Ae))z[De]=z[De]||{};for(let De of Object.keys(z)){let Pe=z[De];Pe.default===void 0||Ae.includes(De)||(Pe.optional=!0),Pe.default===void 0?Pe.default=null:Pe.validate||Pe.default==null||(Pe.validate=k(y(Pe.default)));for(let we of Object.keys(Pe))if(!W.has(we))throw new Error(`Unknown field key "${we}" on ${q}.${De}`)}u[q]=ce.visitor=j,h[q]=ce.builder=Ae,m[q]=ce.fields=z,l[q]=ce.aliases=se,se.forEach(De=>{d[De]=d[De]||[],d[De].push(q)}),ce.validate&&(g[q]=ce.validate),ce.unionShape&&(A[q]=ce.unionShape),$[q]=ce}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/index.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var a={react:!0,assertNode:!0,createTypeAnnotationBasedOnTypeof:!0,createUnionTypeAnnotation:!0,createFlowUnionType:!0,createTSUnionType:!0,cloneNode:!0,clone:!0,cloneDeep:!0,cloneDeepWithoutLoc:!0,cloneWithoutLoc:!0,addComment:!0,addComments:!0,inheritInnerComments:!0,inheritLeadingComments:!0,inheritsComments:!0,inheritTrailingComments:!0,removeComments:!0,ensureBlock:!0,toBindingIdentifierName:!0,toBlock:!0,toComputedKey:!0,toExpression:!0,toIdentifier:!0,toKeyAlias:!0,toStatement:!0,valueToNode:!0,appendToMemberExpression:!0,inherits:!0,prependToMemberExpression:!0,removeProperties:!0,removePropertiesDeep:!0,removeTypeDuplicates:!0,getAssignmentIdentifiers:!0,getBindingIdentifiers:!0,getOuterBindingIdentifiers:!0,getFunctionName:!0,traverse:!0,traverseFast:!0,shallowEqual:!0,is:!0,isBinding:!0,isBlockScoped:!0,isImmutable:!0,isLet:!0,isNode:!0,isNodesEquivalent:!0,isPlaceholderType:!0,isReferenced:!0,isScope:!0,isSpecifierDefault:!0,isType:!0,isValidES3Identifier:!0,isValidIdentifier:!0,isVar:!0,matchesPattern:!0,validate:!0,buildMatchMemberExpression:!0,__internal__deprecationWarning:!0};Object.defineProperty(s,"__internal__deprecationWarning",{enumerable:!0,get:function(){return An.default}}),Object.defineProperty(s,"addComment",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(s,"addComments",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(s,"appendToMemberExpression",{enumerable:!0,get:function(){return ne.default}}),Object.defineProperty(s,"assertNode",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(s,"buildMatchMemberExpression",{enumerable:!0,get:function(){return Vt.default}}),Object.defineProperty(s,"clone",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(s,"cloneDeep",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(s,"cloneDeepWithoutLoc",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(s,"cloneNode",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(s,"cloneWithoutLoc",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(s,"createFlowUnionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(s,"createTSUnionType",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(s,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(s,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(s,"ensureBlock",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(s,"getAssignmentIdentifiers",{enumerable:!0,get:function(){return me.default}}),Object.defineProperty(s,"getBindingIdentifiers",{enumerable:!0,get:function(){return ge.default}}),Object.defineProperty(s,"getFunctionName",{enumerable:!0,get:function(){return ye.default}}),Object.defineProperty(s,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return ue.default}}),Object.defineProperty(s,"inheritInnerComments",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(s,"inheritLeadingComments",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(s,"inheritTrailingComments",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(s,"inherits",{enumerable:!0,get:function(){return Z.default}}),Object.defineProperty(s,"inheritsComments",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(s,"is",{enumerable:!0,get:function(){return _e.default}}),Object.defineProperty(s,"isBinding",{enumerable:!0,get:function(){return X.default}}),Object.defineProperty(s,"isBlockScoped",{enumerable:!0,get:function(){return $e.default}}),Object.defineProperty(s,"isImmutable",{enumerable:!0,get:function(){return He.default}}),Object.defineProperty(s,"isLet",{enumerable:!0,get:function(){return mt.default}}),Object.defineProperty(s,"isNode",{enumerable:!0,get:function(){return st.default}}),Object.defineProperty(s,"isNodesEquivalent",{enumerable:!0,get:function(){return ze.default}}),Object.defineProperty(s,"isPlaceholderType",{enumerable:!0,get:function(){return rt.default}}),Object.defineProperty(s,"isReferenced",{enumerable:!0,get:function(){return Ct.default}}),Object.defineProperty(s,"isScope",{enumerable:!0,get:function(){return on.default}}),Object.defineProperty(s,"isSpecifierDefault",{enumerable:!0,get:function(){return Ft.default}}),Object.defineProperty(s,"isType",{enumerable:!0,get:function(){return Qt.default}}),Object.defineProperty(s,"isValidES3Identifier",{enumerable:!0,get:function(){return Mt.default}}),Object.defineProperty(s,"isValidIdentifier",{enumerable:!0,get:function(){return Xe.default}}),Object.defineProperty(s,"isVar",{enumerable:!0,get:function(){return Me.default}}),Object.defineProperty(s,"matchesPattern",{enumerable:!0,get:function(){return Je.default}}),Object.defineProperty(s,"prependToMemberExpression",{enumerable:!0,get:function(){return te.default}}),s.react=void 0,Object.defineProperty(s,"removeComments",{enumerable:!0,get:function(){return G.default}}),Object.defineProperty(s,"removeProperties",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(s,"removePropertiesDeep",{enumerable:!0,get:function(){return ee.default}}),Object.defineProperty(s,"removeTypeDuplicates",{enumerable:!0,get:function(){return ae.default}}),Object.defineProperty(s,"shallowEqual",{enumerable:!0,get:function(){return Te.default}}),Object.defineProperty(s,"toBindingIdentifierName",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(s,"toBlock",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(s,"toComputedKey",{enumerable:!0,get:function(){return se.default}}),Object.defineProperty(s,"toExpression",{enumerable:!0,get:function(){return Ae.default}}),Object.defineProperty(s,"toIdentifier",{enumerable:!0,get:function(){return De.default}}),Object.defineProperty(s,"toKeyAlias",{enumerable:!0,get:function(){return Pe.default}}),Object.defineProperty(s,"toStatement",{enumerable:!0,get:function(){return we.default}}),Object.defineProperty(s,"traverse",{enumerable:!0,get:function(){return Se.default}}),Object.defineProperty(s,"traverseFast",{enumerable:!0,get:function(){return be.default}}),Object.defineProperty(s,"validate",{enumerable:!0,get:function(){return yt.default}}),Object.defineProperty(s,"valueToNode",{enumerable:!0,get:function(){return ie.default}});var c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/react/isReactComponent.js"),u=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/react/isCompatTag.js"),l=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/react/buildChildren.js"),d=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/asserts/assertNode.js"),m=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/asserts/generated/index.js");Object.keys(m).forEach(function(qe){qe!=="default"&&qe!=="__esModule"&&(Object.prototype.hasOwnProperty.call(a,qe)||qe in s&&s[qe]===m[qe]||Object.defineProperty(s,qe,{enumerable:!0,get:function(){return m[qe]}}))});var h=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js"),f=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js"),g=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js"),A=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/productions.js");Object.keys(A).forEach(function(qe){qe!=="default"&&qe!=="__esModule"&&(Object.prototype.hasOwnProperty.call(a,qe)||qe in s&&s[qe]===A[qe]||Object.defineProperty(s,qe,{enumerable:!0,get:function(){return A[qe]}}))});var y=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js");Object.keys(y).forEach(function(qe){qe!=="default"&&qe!=="__esModule"&&(Object.prototype.hasOwnProperty.call(a,qe)||qe in s&&s[qe]===y[qe]||Object.defineProperty(s,qe,{enumerable:!0,get:function(){return y[qe]}}))});var E=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneNode.js"),_=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/clone.js"),S=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneDeep.js"),C=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js"),I=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js"),w=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/addComment.js"),k=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/addComments.js"),N=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritInnerComments.js"),O=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritLeadingComments.js"),W=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritsComments.js"),$=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/inheritTrailingComments.js"),G=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/comments/removeComments.js"),q=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/constants/generated/index.js");Object.keys(q).forEach(function(qe){qe!=="default"&&qe!=="__esModule"&&(Object.prototype.hasOwnProperty.call(a,qe)||qe in s&&s[qe]===q[qe]||Object.defineProperty(s,qe,{enumerable:!0,get:function(){return q[qe]}}))});var ce=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/constants/index.js");Object.keys(ce).forEach(function(qe){qe!=="default"&&qe!=="__esModule"&&(Object.prototype.hasOwnProperty.call(a,qe)||qe in s&&s[qe]===ce[qe]||Object.defineProperty(s,qe,{enumerable:!0,get:function(){return ce[qe]}}))});var Y=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/ensureBlock.js"),z=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js"),j=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toBlock.js"),se=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toComputedKey.js"),Ae=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toExpression.js"),De=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toIdentifier.js"),Pe=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toKeyAlias.js"),we=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toStatement.js"),ie=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/valueToNode.js"),oe=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/index.js");Object.keys(oe).forEach(function(qe){qe!=="default"&&qe!=="__esModule"&&(Object.prototype.hasOwnProperty.call(a,qe)||qe in s&&s[qe]===oe[qe]||Object.defineProperty(s,qe,{enumerable:!0,get:function(){return oe[qe]}}))});var ne=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js"),Z=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/inherits.js"),te=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js"),V=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/removeProperties.js"),ee=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js"),ae=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js"),me=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js"),ge=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js"),ue=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js"),ye=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/retrievers/getFunctionName.js"),Se=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/traverse/traverse.js");Object.keys(Se).forEach(function(qe){qe!=="default"&&qe!=="__esModule"&&(Object.prototype.hasOwnProperty.call(a,qe)||qe in s&&s[qe]===Se[qe]||Object.defineProperty(s,qe,{enumerable:!0,get:function(){return Se[qe]}}))});var be=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/traverse/traverseFast.js"),Te=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/shallowEqual.js"),_e=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/is.js"),X=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isBinding.js"),$e=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isBlockScoped.js"),He=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isImmutable.js"),mt=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isLet.js"),st=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isNode.js"),ze=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isNodesEquivalent.js"),rt=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isPlaceholderType.js"),Ct=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isReferenced.js"),on=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isScope.js"),Ft=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isSpecifierDefault.js"),Qt=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isType.js"),Mt=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isValidES3Identifier.js"),Xe=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isValidIdentifier.js"),Me=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isVar.js"),Je=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/matchesPattern.js"),yt=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/validate.js"),Vt=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js"),dn=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js");Object.keys(dn).forEach(function(qe){qe!=="default"&&qe!=="__esModule"&&(Object.prototype.hasOwnProperty.call(a,qe)||qe in s&&s[qe]===dn[qe]||Object.defineProperty(s,qe,{enumerable:!0,get:function(){return dn[qe]}}))});var An=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/deprecationWarning.js"),Fn=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/converters/toSequenceExpression.js");s.react={isReactComponent:c.default,isCompatTag:u.default,buildChildren:l.default},s.toSequenceExpression=Fn.default,process.env.BABEL_TYPES_8_BREAKING&&console.warn("BABEL_TYPES_8_BREAKING is not supported anymore. Use the latest Babel 8.0.0 pre-release instead!")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c,u,l=!1){return c.object=(0,a.memberExpression)(c.object,c.property,c.computed),c.property=u,c.computed=!!l,c};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/builders/generated/index.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function u(l){let d=Array.from(l),m=new Map,h=new Map,f=new Set,g=[];for(let A=0;Ag.value.raw).join(""):f.value!==void 0?String(f.value):null})(d):(0,a.isIdentifier)(d)?d.name:(0,a.isPrivateName)(d)?d.id.name:null;return h==null?null:{name:m+h,originalNode:d}};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js");function c(u){if(!u.computed||(0,a.isLiteral)(u.key))return u.key}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js");s.default=function(c,u){return(0,a.default)(c,u,!0)}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/traverse/traverse.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(u,l,d){typeof l=="function"&&(l={enter:l});let{enter:m,exit:h}=l;c(u,m,h,d,[])};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/index.js");function c(u,l,d,m,h){let f=a.VISITOR_KEYS[u.type];if(f){l&&l(u,h,m);for(let g of f){let A=u[g];if(Array.isArray(A))for(let y=0;y` at ${_}`).join(` +`)}})(1,2);d||console.warn(`${u}\`${a}\` has been deprecated, please migrate to \`${c}\` +${m}`)};let o=new Set},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/inherit.js"(i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(o,a,c){a&&c&&(a[o]=Array.from(new Set([].concat(a[o],c[o]).filter(Boolean))))}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(u,l){let d=u.value.split(/\r\n|\n|\r/),m=0;for(let f=0;f(0,a.default)(d,l,u)};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/matchesPattern.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/generated/index.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.isAccessor=function(l,d){return!l||l.type!=="ClassAccessorProperty"?!1:d==null||(0,a.default)(l,d)},s.isAnyTypeAnnotation=function(l,d){return!!l&&l.type==="AnyTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isArgumentPlaceholder=function(l,d){return!!l&&l.type==="ArgumentPlaceholder"&&(d==null||(0,a.default)(l,d))},s.isArrayExpression=function(l,d){return!!l&&l.type==="ArrayExpression"&&(d==null||(0,a.default)(l,d))},s.isArrayPattern=function(l,d){return!!l&&l.type==="ArrayPattern"&&(d==null||(0,a.default)(l,d))},s.isArrayTypeAnnotation=function(l,d){return!!l&&l.type==="ArrayTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isArrowFunctionExpression=function(l,d){return!!l&&l.type==="ArrowFunctionExpression"&&(d==null||(0,a.default)(l,d))},s.isAssignmentExpression=function(l,d){return!!l&&l.type==="AssignmentExpression"&&(d==null||(0,a.default)(l,d))},s.isAssignmentPattern=function(l,d){return!!l&&l.type==="AssignmentPattern"&&(d==null||(0,a.default)(l,d))},s.isAwaitExpression=function(l,d){return!!l&&l.type==="AwaitExpression"&&(d==null||(0,a.default)(l,d))},s.isBigIntLiteral=function(l,d){return!!l&&l.type==="BigIntLiteral"&&(d==null||(0,a.default)(l,d))},s.isBinary=function(l,d){if(!l)return!1;switch(l.type){case"BinaryExpression":case"LogicalExpression":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isBinaryExpression=function(l,d){return!!l&&l.type==="BinaryExpression"&&(d==null||(0,a.default)(l,d))},s.isBindExpression=function(l,d){return!!l&&l.type==="BindExpression"&&(d==null||(0,a.default)(l,d))},s.isBlock=function(l,d){if(!l)return!1;switch(l.type){case"BlockStatement":case"Program":case"TSModuleBlock":break;case"Placeholder":if(l.expectedNode==="BlockStatement")break;default:return!1}return d==null||(0,a.default)(l,d)},s.isBlockParent=function(l,d){if(!l)return!1;switch(l.type){case"BlockStatement":case"CatchClause":case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"FunctionDeclaration":case"FunctionExpression":case"Program":case"ObjectMethod":case"SwitchStatement":case"WhileStatement":case"ArrowFunctionExpression":case"ForOfStatement":case"ClassMethod":case"ClassPrivateMethod":case"StaticBlock":case"TSModuleBlock":break;case"Placeholder":if(l.expectedNode==="BlockStatement")break;default:return!1}return d==null||(0,a.default)(l,d)},s.isBlockStatement=function(l,d){return!!l&&l.type==="BlockStatement"&&(d==null||(0,a.default)(l,d))},s.isBooleanLiteral=function(l,d){return!!l&&l.type==="BooleanLiteral"&&(d==null||(0,a.default)(l,d))},s.isBooleanLiteralTypeAnnotation=function(l,d){return!!l&&l.type==="BooleanLiteralTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isBooleanTypeAnnotation=function(l,d){return!!l&&l.type==="BooleanTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isBreakStatement=function(l,d){return!!l&&l.type==="BreakStatement"&&(d==null||(0,a.default)(l,d))},s.isCallExpression=function(l,d){return!!l&&l.type==="CallExpression"&&(d==null||(0,a.default)(l,d))},s.isCatchClause=function(l,d){return!!l&&l.type==="CatchClause"&&(d==null||(0,a.default)(l,d))},s.isClass=function(l,d){if(!l)return!1;switch(l.type){case"ClassExpression":case"ClassDeclaration":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isClassAccessorProperty=function(l,d){return!!l&&l.type==="ClassAccessorProperty"&&(d==null||(0,a.default)(l,d))},s.isClassBody=function(l,d){return!!l&&l.type==="ClassBody"&&(d==null||(0,a.default)(l,d))},s.isClassDeclaration=function(l,d){return!!l&&l.type==="ClassDeclaration"&&(d==null||(0,a.default)(l,d))},s.isClassExpression=function(l,d){return!!l&&l.type==="ClassExpression"&&(d==null||(0,a.default)(l,d))},s.isClassImplements=function(l,d){return!!l&&l.type==="ClassImplements"&&(d==null||(0,a.default)(l,d))},s.isClassMethod=function(l,d){return!!l&&l.type==="ClassMethod"&&(d==null||(0,a.default)(l,d))},s.isClassPrivateMethod=function(l,d){return!!l&&l.type==="ClassPrivateMethod"&&(d==null||(0,a.default)(l,d))},s.isClassPrivateProperty=function(l,d){return!!l&&l.type==="ClassPrivateProperty"&&(d==null||(0,a.default)(l,d))},s.isClassProperty=function(l,d){return!!l&&l.type==="ClassProperty"&&(d==null||(0,a.default)(l,d))},s.isCompletionStatement=function(l,d){if(!l)return!1;switch(l.type){case"BreakStatement":case"ContinueStatement":case"ReturnStatement":case"ThrowStatement":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isConditional=function(l,d){if(!l)return!1;switch(l.type){case"ConditionalExpression":case"IfStatement":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isConditionalExpression=function(l,d){return!!l&&l.type==="ConditionalExpression"&&(d==null||(0,a.default)(l,d))},s.isContinueStatement=function(l,d){return!!l&&l.type==="ContinueStatement"&&(d==null||(0,a.default)(l,d))},s.isDebuggerStatement=function(l,d){return!!l&&l.type==="DebuggerStatement"&&(d==null||(0,a.default)(l,d))},s.isDecimalLiteral=function(l,d){return!!l&&l.type==="DecimalLiteral"&&(d==null||(0,a.default)(l,d))},s.isDeclaration=function(l,d){if(!l)return!1;switch(l.type){case"FunctionDeclaration":case"VariableDeclaration":case"ClassDeclaration":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ImportDeclaration":case"DeclareClass":case"DeclareFunction":case"DeclareInterface":case"DeclareModule":case"DeclareModuleExports":case"DeclareTypeAlias":case"DeclareOpaqueType":case"DeclareVariable":case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":case"InterfaceDeclaration":case"OpaqueType":case"TypeAlias":case"EnumDeclaration":case"TSDeclareFunction":case"TSInterfaceDeclaration":case"TSTypeAliasDeclaration":case"TSEnumDeclaration":case"TSModuleDeclaration":case"TSImportEqualsDeclaration":break;case"Placeholder":if(l.expectedNode==="Declaration")break;default:return!1}return d==null||(0,a.default)(l,d)},s.isDeclareClass=function(l,d){return!!l&&l.type==="DeclareClass"&&(d==null||(0,a.default)(l,d))},s.isDeclareExportAllDeclaration=function(l,d){return!!l&&l.type==="DeclareExportAllDeclaration"&&(d==null||(0,a.default)(l,d))},s.isDeclareExportDeclaration=function(l,d){return!!l&&l.type==="DeclareExportDeclaration"&&(d==null||(0,a.default)(l,d))},s.isDeclareFunction=function(l,d){return!!l&&l.type==="DeclareFunction"&&(d==null||(0,a.default)(l,d))},s.isDeclareInterface=function(l,d){return!!l&&l.type==="DeclareInterface"&&(d==null||(0,a.default)(l,d))},s.isDeclareModule=function(l,d){return!!l&&l.type==="DeclareModule"&&(d==null||(0,a.default)(l,d))},s.isDeclareModuleExports=function(l,d){return!!l&&l.type==="DeclareModuleExports"&&(d==null||(0,a.default)(l,d))},s.isDeclareOpaqueType=function(l,d){return!!l&&l.type==="DeclareOpaqueType"&&(d==null||(0,a.default)(l,d))},s.isDeclareTypeAlias=function(l,d){return!!l&&l.type==="DeclareTypeAlias"&&(d==null||(0,a.default)(l,d))},s.isDeclareVariable=function(l,d){return!!l&&l.type==="DeclareVariable"&&(d==null||(0,a.default)(l,d))},s.isDeclaredPredicate=function(l,d){return!!l&&l.type==="DeclaredPredicate"&&(d==null||(0,a.default)(l,d))},s.isDecorator=function(l,d){return!!l&&l.type==="Decorator"&&(d==null||(0,a.default)(l,d))},s.isDirective=function(l,d){return!!l&&l.type==="Directive"&&(d==null||(0,a.default)(l,d))},s.isDirectiveLiteral=function(l,d){return!!l&&l.type==="DirectiveLiteral"&&(d==null||(0,a.default)(l,d))},s.isDoExpression=function(l,d){return!!l&&l.type==="DoExpression"&&(d==null||(0,a.default)(l,d))},s.isDoWhileStatement=function(l,d){return!!l&&l.type==="DoWhileStatement"&&(d==null||(0,a.default)(l,d))},s.isEmptyStatement=function(l,d){return!!l&&l.type==="EmptyStatement"&&(d==null||(0,a.default)(l,d))},s.isEmptyTypeAnnotation=function(l,d){return!!l&&l.type==="EmptyTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isEnumBody=function(l,d){if(!l)return!1;switch(l.type){case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isEnumBooleanBody=function(l,d){return!!l&&l.type==="EnumBooleanBody"&&(d==null||(0,a.default)(l,d))},s.isEnumBooleanMember=function(l,d){return!!l&&l.type==="EnumBooleanMember"&&(d==null||(0,a.default)(l,d))},s.isEnumDeclaration=function(l,d){return!!l&&l.type==="EnumDeclaration"&&(d==null||(0,a.default)(l,d))},s.isEnumDefaultedMember=function(l,d){return!!l&&l.type==="EnumDefaultedMember"&&(d==null||(0,a.default)(l,d))},s.isEnumMember=function(l,d){if(!l)return!1;switch(l.type){case"EnumBooleanMember":case"EnumNumberMember":case"EnumStringMember":case"EnumDefaultedMember":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isEnumNumberBody=function(l,d){return!!l&&l.type==="EnumNumberBody"&&(d==null||(0,a.default)(l,d))},s.isEnumNumberMember=function(l,d){return!!l&&l.type==="EnumNumberMember"&&(d==null||(0,a.default)(l,d))},s.isEnumStringBody=function(l,d){return!!l&&l.type==="EnumStringBody"&&(d==null||(0,a.default)(l,d))},s.isEnumStringMember=function(l,d){return!!l&&l.type==="EnumStringMember"&&(d==null||(0,a.default)(l,d))},s.isEnumSymbolBody=function(l,d){return!!l&&l.type==="EnumSymbolBody"&&(d==null||(0,a.default)(l,d))},s.isExistsTypeAnnotation=function(l,d){return!!l&&l.type==="ExistsTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isExportAllDeclaration=function(l,d){return!!l&&l.type==="ExportAllDeclaration"&&(d==null||(0,a.default)(l,d))},s.isExportDeclaration=function(l,d){if(!l)return!1;switch(l.type){case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isExportDefaultDeclaration=function(l,d){return!!l&&l.type==="ExportDefaultDeclaration"&&(d==null||(0,a.default)(l,d))},s.isExportDefaultSpecifier=function(l,d){return!!l&&l.type==="ExportDefaultSpecifier"&&(d==null||(0,a.default)(l,d))},s.isExportNamedDeclaration=function(l,d){return!!l&&l.type==="ExportNamedDeclaration"&&(d==null||(0,a.default)(l,d))},s.isExportNamespaceSpecifier=function(l,d){return!!l&&l.type==="ExportNamespaceSpecifier"&&(d==null||(0,a.default)(l,d))},s.isExportSpecifier=function(l,d){return!!l&&l.type==="ExportSpecifier"&&(d==null||(0,a.default)(l,d))},s.isExpression=function(l,d){if(!l)return!1;switch(l.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"StringLiteral":case"NumericLiteral":case"NullLiteral":case"BooleanLiteral":case"RegExpLiteral":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ParenthesizedExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":case"ArrowFunctionExpression":case"ClassExpression":case"ImportExpression":case"MetaProperty":case"Super":case"TaggedTemplateExpression":case"TemplateLiteral":case"YieldExpression":case"AwaitExpression":case"Import":case"BigIntLiteral":case"OptionalMemberExpression":case"OptionalCallExpression":case"TypeCastExpression":case"JSXElement":case"JSXFragment":case"BindExpression":case"DoExpression":case"RecordExpression":case"TupleExpression":case"DecimalLiteral":case"ModuleExpression":case"TopicReference":case"PipelineTopicExpression":case"PipelineBareFunction":case"PipelinePrimaryTopicReference":case"TSInstantiationExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":break;case"Placeholder":switch(l.expectedNode){case"Expression":case"Identifier":case"StringLiteral":break;default:return!1}break;default:return!1}return d==null||(0,a.default)(l,d)},s.isExpressionStatement=function(l,d){return!!l&&l.type==="ExpressionStatement"&&(d==null||(0,a.default)(l,d))},s.isExpressionWrapper=function(l,d){if(!l)return!1;switch(l.type){case"ExpressionStatement":case"ParenthesizedExpression":case"TypeCastExpression":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isFile=function(l,d){return!!l&&l.type==="File"&&(d==null||(0,a.default)(l,d))},s.isFlow=function(l,d){if(!l)return!1;switch(l.type){case"AnyTypeAnnotation":case"ArrayTypeAnnotation":case"BooleanTypeAnnotation":case"BooleanLiteralTypeAnnotation":case"NullLiteralTypeAnnotation":case"ClassImplements":case"DeclareClass":case"DeclareFunction":case"DeclareInterface":case"DeclareModule":case"DeclareModuleExports":case"DeclareTypeAlias":case"DeclareOpaqueType":case"DeclareVariable":case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":case"DeclaredPredicate":case"ExistsTypeAnnotation":case"FunctionTypeAnnotation":case"FunctionTypeParam":case"GenericTypeAnnotation":case"InferredPredicate":case"InterfaceExtends":case"InterfaceDeclaration":case"InterfaceTypeAnnotation":case"IntersectionTypeAnnotation":case"MixedTypeAnnotation":case"EmptyTypeAnnotation":case"NullableTypeAnnotation":case"NumberLiteralTypeAnnotation":case"NumberTypeAnnotation":case"ObjectTypeAnnotation":case"ObjectTypeInternalSlot":case"ObjectTypeCallProperty":case"ObjectTypeIndexer":case"ObjectTypeProperty":case"ObjectTypeSpreadProperty":case"OpaqueType":case"QualifiedTypeIdentifier":case"StringLiteralTypeAnnotation":case"StringTypeAnnotation":case"SymbolTypeAnnotation":case"ThisTypeAnnotation":case"TupleTypeAnnotation":case"TypeofTypeAnnotation":case"TypeAlias":case"TypeAnnotation":case"TypeCastExpression":case"TypeParameter":case"TypeParameterDeclaration":case"TypeParameterInstantiation":case"UnionTypeAnnotation":case"Variance":case"VoidTypeAnnotation":case"EnumDeclaration":case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":case"EnumBooleanMember":case"EnumNumberMember":case"EnumStringMember":case"EnumDefaultedMember":case"IndexedAccessType":case"OptionalIndexedAccessType":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isFlowBaseAnnotation=function(l,d){if(!l)return!1;switch(l.type){case"AnyTypeAnnotation":case"BooleanTypeAnnotation":case"NullLiteralTypeAnnotation":case"MixedTypeAnnotation":case"EmptyTypeAnnotation":case"NumberTypeAnnotation":case"StringTypeAnnotation":case"SymbolTypeAnnotation":case"ThisTypeAnnotation":case"VoidTypeAnnotation":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isFlowDeclaration=function(l,d){if(!l)return!1;switch(l.type){case"DeclareClass":case"DeclareFunction":case"DeclareInterface":case"DeclareModule":case"DeclareModuleExports":case"DeclareTypeAlias":case"DeclareOpaqueType":case"DeclareVariable":case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":case"InterfaceDeclaration":case"OpaqueType":case"TypeAlias":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isFlowPredicate=function(l,d){if(!l)return!1;switch(l.type){case"DeclaredPredicate":case"InferredPredicate":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isFlowType=function(l,d){if(!l)return!1;switch(l.type){case"AnyTypeAnnotation":case"ArrayTypeAnnotation":case"BooleanTypeAnnotation":case"BooleanLiteralTypeAnnotation":case"NullLiteralTypeAnnotation":case"ExistsTypeAnnotation":case"FunctionTypeAnnotation":case"GenericTypeAnnotation":case"InterfaceTypeAnnotation":case"IntersectionTypeAnnotation":case"MixedTypeAnnotation":case"EmptyTypeAnnotation":case"NullableTypeAnnotation":case"NumberLiteralTypeAnnotation":case"NumberTypeAnnotation":case"ObjectTypeAnnotation":case"StringLiteralTypeAnnotation":case"StringTypeAnnotation":case"SymbolTypeAnnotation":case"ThisTypeAnnotation":case"TupleTypeAnnotation":case"TypeofTypeAnnotation":case"UnionTypeAnnotation":case"VoidTypeAnnotation":case"IndexedAccessType":case"OptionalIndexedAccessType":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isFor=function(l,d){if(!l)return!1;switch(l.type){case"ForInStatement":case"ForStatement":case"ForOfStatement":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isForInStatement=function(l,d){return!!l&&l.type==="ForInStatement"&&(d==null||(0,a.default)(l,d))},s.isForOfStatement=function(l,d){return!!l&&l.type==="ForOfStatement"&&(d==null||(0,a.default)(l,d))},s.isForStatement=function(l,d){return!!l&&l.type==="ForStatement"&&(d==null||(0,a.default)(l,d))},s.isForXStatement=function(l,d){if(!l)return!1;switch(l.type){case"ForInStatement":case"ForOfStatement":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isFunction=function(l,d){if(!l)return!1;switch(l.type){case"FunctionDeclaration":case"FunctionExpression":case"ObjectMethod":case"ArrowFunctionExpression":case"ClassMethod":case"ClassPrivateMethod":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isFunctionDeclaration=function(l,d){return!!l&&l.type==="FunctionDeclaration"&&(d==null||(0,a.default)(l,d))},s.isFunctionExpression=function(l,d){return!!l&&l.type==="FunctionExpression"&&(d==null||(0,a.default)(l,d))},s.isFunctionParameter=function(l,d){if(!l)return!1;switch(l.type){case"Identifier":case"RestElement":case"AssignmentPattern":case"ArrayPattern":case"ObjectPattern":case"VoidPattern":break;case"Placeholder":if(l.expectedNode==="Identifier")break;default:return!1}return d==null||(0,a.default)(l,d)},s.isFunctionParent=function(l,d){if(!l)return!1;switch(l.type){case"FunctionDeclaration":case"FunctionExpression":case"ObjectMethod":case"ArrowFunctionExpression":case"ClassMethod":case"ClassPrivateMethod":case"StaticBlock":case"TSModuleBlock":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isFunctionTypeAnnotation=function(l,d){return!!l&&l.type==="FunctionTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isFunctionTypeParam=function(l,d){return!!l&&l.type==="FunctionTypeParam"&&(d==null||(0,a.default)(l,d))},s.isGenericTypeAnnotation=function(l,d){return!!l&&l.type==="GenericTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isIdentifier=function(l,d){return!!l&&l.type==="Identifier"&&(d==null||(0,a.default)(l,d))},s.isIfStatement=function(l,d){return!!l&&l.type==="IfStatement"&&(d==null||(0,a.default)(l,d))},s.isImmutable=function(l,d){if(!l)return!1;switch(l.type){case"StringLiteral":case"NumericLiteral":case"NullLiteral":case"BooleanLiteral":case"BigIntLiteral":case"JSXAttribute":case"JSXClosingElement":case"JSXElement":case"JSXExpressionContainer":case"JSXSpreadChild":case"JSXOpeningElement":case"JSXText":case"JSXFragment":case"JSXOpeningFragment":case"JSXClosingFragment":case"DecimalLiteral":break;case"Placeholder":if(l.expectedNode==="StringLiteral")break;default:return!1}return d==null||(0,a.default)(l,d)},s.isImport=function(l,d){return!!l&&l.type==="Import"&&(d==null||(0,a.default)(l,d))},s.isImportAttribute=function(l,d){return!!l&&l.type==="ImportAttribute"&&(d==null||(0,a.default)(l,d))},s.isImportDeclaration=function(l,d){return!!l&&l.type==="ImportDeclaration"&&(d==null||(0,a.default)(l,d))},s.isImportDefaultSpecifier=function(l,d){return!!l&&l.type==="ImportDefaultSpecifier"&&(d==null||(0,a.default)(l,d))},s.isImportExpression=function(l,d){return!!l&&l.type==="ImportExpression"&&(d==null||(0,a.default)(l,d))},s.isImportNamespaceSpecifier=function(l,d){return!!l&&l.type==="ImportNamespaceSpecifier"&&(d==null||(0,a.default)(l,d))},s.isImportOrExportDeclaration=u,s.isImportSpecifier=function(l,d){return!!l&&l.type==="ImportSpecifier"&&(d==null||(0,a.default)(l,d))},s.isIndexedAccessType=function(l,d){return!!l&&l.type==="IndexedAccessType"&&(d==null||(0,a.default)(l,d))},s.isInferredPredicate=function(l,d){return!!l&&l.type==="InferredPredicate"&&(d==null||(0,a.default)(l,d))},s.isInterfaceDeclaration=function(l,d){return!!l&&l.type==="InterfaceDeclaration"&&(d==null||(0,a.default)(l,d))},s.isInterfaceExtends=function(l,d){return!!l&&l.type==="InterfaceExtends"&&(d==null||(0,a.default)(l,d))},s.isInterfaceTypeAnnotation=function(l,d){return!!l&&l.type==="InterfaceTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isInterpreterDirective=function(l,d){return!!l&&l.type==="InterpreterDirective"&&(d==null||(0,a.default)(l,d))},s.isIntersectionTypeAnnotation=function(l,d){return!!l&&l.type==="IntersectionTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isJSX=function(l,d){if(!l)return!1;switch(l.type){case"JSXAttribute":case"JSXClosingElement":case"JSXElement":case"JSXEmptyExpression":case"JSXExpressionContainer":case"JSXSpreadChild":case"JSXIdentifier":case"JSXMemberExpression":case"JSXNamespacedName":case"JSXOpeningElement":case"JSXSpreadAttribute":case"JSXText":case"JSXFragment":case"JSXOpeningFragment":case"JSXClosingFragment":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isJSXAttribute=function(l,d){return!!l&&l.type==="JSXAttribute"&&(d==null||(0,a.default)(l,d))},s.isJSXClosingElement=function(l,d){return!!l&&l.type==="JSXClosingElement"&&(d==null||(0,a.default)(l,d))},s.isJSXClosingFragment=function(l,d){return!!l&&l.type==="JSXClosingFragment"&&(d==null||(0,a.default)(l,d))},s.isJSXElement=function(l,d){return!!l&&l.type==="JSXElement"&&(d==null||(0,a.default)(l,d))},s.isJSXEmptyExpression=function(l,d){return!!l&&l.type==="JSXEmptyExpression"&&(d==null||(0,a.default)(l,d))},s.isJSXExpressionContainer=function(l,d){return!!l&&l.type==="JSXExpressionContainer"&&(d==null||(0,a.default)(l,d))},s.isJSXFragment=function(l,d){return!!l&&l.type==="JSXFragment"&&(d==null||(0,a.default)(l,d))},s.isJSXIdentifier=function(l,d){return!!l&&l.type==="JSXIdentifier"&&(d==null||(0,a.default)(l,d))},s.isJSXMemberExpression=function(l,d){return!!l&&l.type==="JSXMemberExpression"&&(d==null||(0,a.default)(l,d))},s.isJSXNamespacedName=function(l,d){return!!l&&l.type==="JSXNamespacedName"&&(d==null||(0,a.default)(l,d))},s.isJSXOpeningElement=function(l,d){return!!l&&l.type==="JSXOpeningElement"&&(d==null||(0,a.default)(l,d))},s.isJSXOpeningFragment=function(l,d){return!!l&&l.type==="JSXOpeningFragment"&&(d==null||(0,a.default)(l,d))},s.isJSXSpreadAttribute=function(l,d){return!!l&&l.type==="JSXSpreadAttribute"&&(d==null||(0,a.default)(l,d))},s.isJSXSpreadChild=function(l,d){return!!l&&l.type==="JSXSpreadChild"&&(d==null||(0,a.default)(l,d))},s.isJSXText=function(l,d){return!!l&&l.type==="JSXText"&&(d==null||(0,a.default)(l,d))},s.isLVal=function(l,d){if(!l)return!1;switch(l.type){case"Identifier":case"MemberExpression":case"RestElement":case"AssignmentPattern":case"ArrayPattern":case"ObjectPattern":case"TSParameterProperty":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":break;case"Placeholder":switch(l.expectedNode){case"Pattern":case"Identifier":break;default:return!1}break;default:return!1}return d==null||(0,a.default)(l,d)},s.isLabeledStatement=function(l,d){return!!l&&l.type==="LabeledStatement"&&(d==null||(0,a.default)(l,d))},s.isLiteral=function(l,d){if(!l)return!1;switch(l.type){case"StringLiteral":case"NumericLiteral":case"NullLiteral":case"BooleanLiteral":case"RegExpLiteral":case"TemplateLiteral":case"BigIntLiteral":case"DecimalLiteral":break;case"Placeholder":if(l.expectedNode==="StringLiteral")break;default:return!1}return d==null||(0,a.default)(l,d)},s.isLogicalExpression=function(l,d){return!!l&&l.type==="LogicalExpression"&&(d==null||(0,a.default)(l,d))},s.isLoop=function(l,d){if(!l)return!1;switch(l.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":case"ForOfStatement":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isMemberExpression=function(l,d){return!!l&&l.type==="MemberExpression"&&(d==null||(0,a.default)(l,d))},s.isMetaProperty=function(l,d){return!!l&&l.type==="MetaProperty"&&(d==null||(0,a.default)(l,d))},s.isMethod=function(l,d){if(!l)return!1;switch(l.type){case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isMiscellaneous=function(l,d){if(!l)return!1;switch(l.type){case"Noop":case"Placeholder":case"V8IntrinsicIdentifier":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isMixedTypeAnnotation=function(l,d){return!!l&&l.type==="MixedTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isModuleDeclaration=function(l,d){return(0,c.default)("isModuleDeclaration","isImportOrExportDeclaration"),u(l,d)},s.isModuleExpression=function(l,d){return!!l&&l.type==="ModuleExpression"&&(d==null||(0,a.default)(l,d))},s.isModuleSpecifier=function(l,d){if(!l)return!1;switch(l.type){case"ExportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":case"ExportNamespaceSpecifier":case"ExportDefaultSpecifier":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isNewExpression=function(l,d){return!!l&&l.type==="NewExpression"&&(d==null||(0,a.default)(l,d))},s.isNoop=function(l,d){return!!l&&l.type==="Noop"&&(d==null||(0,a.default)(l,d))},s.isNullLiteral=function(l,d){return!!l&&l.type==="NullLiteral"&&(d==null||(0,a.default)(l,d))},s.isNullLiteralTypeAnnotation=function(l,d){return!!l&&l.type==="NullLiteralTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isNullableTypeAnnotation=function(l,d){return!!l&&l.type==="NullableTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isNumberLiteral=function(l,d){return(0,c.default)("isNumberLiteral","isNumericLiteral"),!!l&&l.type==="NumberLiteral"&&(d==null||(0,a.default)(l,d))},s.isNumberLiteralTypeAnnotation=function(l,d){return!!l&&l.type==="NumberLiteralTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isNumberTypeAnnotation=function(l,d){return!!l&&l.type==="NumberTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isNumericLiteral=function(l,d){return!!l&&l.type==="NumericLiteral"&&(d==null||(0,a.default)(l,d))},s.isObjectExpression=function(l,d){return!!l&&l.type==="ObjectExpression"&&(d==null||(0,a.default)(l,d))},s.isObjectMember=function(l,d){if(!l)return!1;switch(l.type){case"ObjectMethod":case"ObjectProperty":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isObjectMethod=function(l,d){return!!l&&l.type==="ObjectMethod"&&(d==null||(0,a.default)(l,d))},s.isObjectPattern=function(l,d){return!!l&&l.type==="ObjectPattern"&&(d==null||(0,a.default)(l,d))},s.isObjectProperty=function(l,d){return!!l&&l.type==="ObjectProperty"&&(d==null||(0,a.default)(l,d))},s.isObjectTypeAnnotation=function(l,d){return!!l&&l.type==="ObjectTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isObjectTypeCallProperty=function(l,d){return!!l&&l.type==="ObjectTypeCallProperty"&&(d==null||(0,a.default)(l,d))},s.isObjectTypeIndexer=function(l,d){return!!l&&l.type==="ObjectTypeIndexer"&&(d==null||(0,a.default)(l,d))},s.isObjectTypeInternalSlot=function(l,d){return!!l&&l.type==="ObjectTypeInternalSlot"&&(d==null||(0,a.default)(l,d))},s.isObjectTypeProperty=function(l,d){return!!l&&l.type==="ObjectTypeProperty"&&(d==null||(0,a.default)(l,d))},s.isObjectTypeSpreadProperty=function(l,d){return!!l&&l.type==="ObjectTypeSpreadProperty"&&(d==null||(0,a.default)(l,d))},s.isOpaqueType=function(l,d){return!!l&&l.type==="OpaqueType"&&(d==null||(0,a.default)(l,d))},s.isOptionalCallExpression=function(l,d){return!!l&&l.type==="OptionalCallExpression"&&(d==null||(0,a.default)(l,d))},s.isOptionalIndexedAccessType=function(l,d){return!!l&&l.type==="OptionalIndexedAccessType"&&(d==null||(0,a.default)(l,d))},s.isOptionalMemberExpression=function(l,d){return!!l&&l.type==="OptionalMemberExpression"&&(d==null||(0,a.default)(l,d))},s.isParenthesizedExpression=function(l,d){return!!l&&l.type==="ParenthesizedExpression"&&(d==null||(0,a.default)(l,d))},s.isPattern=function(l,d){if(!l)return!1;switch(l.type){case"AssignmentPattern":case"ArrayPattern":case"ObjectPattern":case"VoidPattern":break;case"Placeholder":if(l.expectedNode==="Pattern")break;default:return!1}return d==null||(0,a.default)(l,d)},s.isPatternLike=function(l,d){if(!l)return!1;switch(l.type){case"Identifier":case"MemberExpression":case"RestElement":case"AssignmentPattern":case"ArrayPattern":case"ObjectPattern":case"VoidPattern":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":break;case"Placeholder":switch(l.expectedNode){case"Pattern":case"Identifier":break;default:return!1}break;default:return!1}return d==null||(0,a.default)(l,d)},s.isPipelineBareFunction=function(l,d){return!!l&&l.type==="PipelineBareFunction"&&(d==null||(0,a.default)(l,d))},s.isPipelinePrimaryTopicReference=function(l,d){return!!l&&l.type==="PipelinePrimaryTopicReference"&&(d==null||(0,a.default)(l,d))},s.isPipelineTopicExpression=function(l,d){return!!l&&l.type==="PipelineTopicExpression"&&(d==null||(0,a.default)(l,d))},s.isPlaceholder=function(l,d){return!!l&&l.type==="Placeholder"&&(d==null||(0,a.default)(l,d))},s.isPrivate=function(l,d){if(!l)return!1;switch(l.type){case"ClassPrivateProperty":case"ClassPrivateMethod":case"PrivateName":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isPrivateName=function(l,d){return!!l&&l.type==="PrivateName"&&(d==null||(0,a.default)(l,d))},s.isProgram=function(l,d){return!!l&&l.type==="Program"&&(d==null||(0,a.default)(l,d))},s.isProperty=function(l,d){if(!l)return!1;switch(l.type){case"ObjectProperty":case"ClassProperty":case"ClassAccessorProperty":case"ClassPrivateProperty":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isPureish=function(l,d){if(!l)return!1;switch(l.type){case"FunctionDeclaration":case"FunctionExpression":case"StringLiteral":case"NumericLiteral":case"NullLiteral":case"BooleanLiteral":case"RegExpLiteral":case"ArrowFunctionExpression":case"BigIntLiteral":case"DecimalLiteral":break;case"Placeholder":if(l.expectedNode==="StringLiteral")break;default:return!1}return d==null||(0,a.default)(l,d)},s.isQualifiedTypeIdentifier=function(l,d){return!!l&&l.type==="QualifiedTypeIdentifier"&&(d==null||(0,a.default)(l,d))},s.isRecordExpression=function(l,d){return!!l&&l.type==="RecordExpression"&&(d==null||(0,a.default)(l,d))},s.isRegExpLiteral=function(l,d){return!!l&&l.type==="RegExpLiteral"&&(d==null||(0,a.default)(l,d))},s.isRegexLiteral=function(l,d){return(0,c.default)("isRegexLiteral","isRegExpLiteral"),!!l&&l.type==="RegexLiteral"&&(d==null||(0,a.default)(l,d))},s.isRestElement=function(l,d){return!!l&&l.type==="RestElement"&&(d==null||(0,a.default)(l,d))},s.isRestProperty=function(l,d){return(0,c.default)("isRestProperty","isRestElement"),!!l&&l.type==="RestProperty"&&(d==null||(0,a.default)(l,d))},s.isReturnStatement=function(l,d){return!!l&&l.type==="ReturnStatement"&&(d==null||(0,a.default)(l,d))},s.isScopable=function(l,d){if(!l)return!1;switch(l.type){case"BlockStatement":case"CatchClause":case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"FunctionDeclaration":case"FunctionExpression":case"Program":case"ObjectMethod":case"SwitchStatement":case"WhileStatement":case"ArrowFunctionExpression":case"ClassExpression":case"ClassDeclaration":case"ForOfStatement":case"ClassMethod":case"ClassPrivateMethod":case"StaticBlock":case"TSModuleBlock":break;case"Placeholder":if(l.expectedNode==="BlockStatement")break;default:return!1}return d==null||(0,a.default)(l,d)},s.isSequenceExpression=function(l,d){return!!l&&l.type==="SequenceExpression"&&(d==null||(0,a.default)(l,d))},s.isSpreadElement=function(l,d){return!!l&&l.type==="SpreadElement"&&(d==null||(0,a.default)(l,d))},s.isSpreadProperty=function(l,d){return(0,c.default)("isSpreadProperty","isSpreadElement"),!!l&&l.type==="SpreadProperty"&&(d==null||(0,a.default)(l,d))},s.isStandardized=function(l,d){if(!l)return!1;switch(l.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"InterpreterDirective":case"Directive":case"DirectiveLiteral":case"BlockStatement":case"BreakStatement":case"CallExpression":case"CatchClause":case"ConditionalExpression":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"File":case"ForInStatement":case"ForStatement":case"FunctionDeclaration":case"FunctionExpression":case"Identifier":case"IfStatement":case"LabeledStatement":case"StringLiteral":case"NumericLiteral":case"NullLiteral":case"BooleanLiteral":case"RegExpLiteral":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"Program":case"ObjectExpression":case"ObjectMethod":case"ObjectProperty":case"RestElement":case"ReturnStatement":case"SequenceExpression":case"ParenthesizedExpression":case"SwitchCase":case"SwitchStatement":case"ThisExpression":case"ThrowStatement":case"TryStatement":case"UnaryExpression":case"UpdateExpression":case"VariableDeclaration":case"VariableDeclarator":case"WhileStatement":case"WithStatement":case"AssignmentPattern":case"ArrayPattern":case"ArrowFunctionExpression":case"ClassBody":case"ClassExpression":case"ClassDeclaration":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExportSpecifier":case"ForOfStatement":case"ImportDeclaration":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":case"ImportExpression":case"MetaProperty":case"ClassMethod":case"ObjectPattern":case"SpreadElement":case"Super":case"TaggedTemplateExpression":case"TemplateElement":case"TemplateLiteral":case"YieldExpression":case"AwaitExpression":case"Import":case"BigIntLiteral":case"ExportNamespaceSpecifier":case"OptionalMemberExpression":case"OptionalCallExpression":case"ClassProperty":case"ClassAccessorProperty":case"ClassPrivateProperty":case"ClassPrivateMethod":case"PrivateName":case"StaticBlock":case"ImportAttribute":break;case"Placeholder":switch(l.expectedNode){case"Identifier":case"StringLiteral":case"BlockStatement":case"ClassBody":break;default:return!1}break;default:return!1}return d==null||(0,a.default)(l,d)},s.isStatement=function(l,d){if(!l)return!1;switch(l.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"FunctionDeclaration":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":case"ClassDeclaration":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ForOfStatement":case"ImportDeclaration":case"DeclareClass":case"DeclareFunction":case"DeclareInterface":case"DeclareModule":case"DeclareModuleExports":case"DeclareTypeAlias":case"DeclareOpaqueType":case"DeclareVariable":case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":case"InterfaceDeclaration":case"OpaqueType":case"TypeAlias":case"EnumDeclaration":case"TSDeclareFunction":case"TSInterfaceDeclaration":case"TSTypeAliasDeclaration":case"TSEnumDeclaration":case"TSModuleDeclaration":case"TSImportEqualsDeclaration":case"TSExportAssignment":case"TSNamespaceExportDeclaration":break;case"Placeholder":switch(l.expectedNode){case"Statement":case"Declaration":case"BlockStatement":break;default:return!1}break;default:return!1}return d==null||(0,a.default)(l,d)},s.isStaticBlock=function(l,d){return!!l&&l.type==="StaticBlock"&&(d==null||(0,a.default)(l,d))},s.isStringLiteral=function(l,d){return!!l&&l.type==="StringLiteral"&&(d==null||(0,a.default)(l,d))},s.isStringLiteralTypeAnnotation=function(l,d){return!!l&&l.type==="StringLiteralTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isStringTypeAnnotation=function(l,d){return!!l&&l.type==="StringTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isSuper=function(l,d){return!!l&&l.type==="Super"&&(d==null||(0,a.default)(l,d))},s.isSwitchCase=function(l,d){return!!l&&l.type==="SwitchCase"&&(d==null||(0,a.default)(l,d))},s.isSwitchStatement=function(l,d){return!!l&&l.type==="SwitchStatement"&&(d==null||(0,a.default)(l,d))},s.isSymbolTypeAnnotation=function(l,d){return!!l&&l.type==="SymbolTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isTSAnyKeyword=function(l,d){return!!l&&l.type==="TSAnyKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSArrayType=function(l,d){return!!l&&l.type==="TSArrayType"&&(d==null||(0,a.default)(l,d))},s.isTSAsExpression=function(l,d){return!!l&&l.type==="TSAsExpression"&&(d==null||(0,a.default)(l,d))},s.isTSBaseType=function(l,d){if(!l)return!1;switch(l.type){case"TSAnyKeyword":case"TSBooleanKeyword":case"TSBigIntKeyword":case"TSIntrinsicKeyword":case"TSNeverKeyword":case"TSNullKeyword":case"TSNumberKeyword":case"TSObjectKeyword":case"TSStringKeyword":case"TSSymbolKeyword":case"TSUndefinedKeyword":case"TSUnknownKeyword":case"TSVoidKeyword":case"TSThisType":case"TSTemplateLiteralType":case"TSLiteralType":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isTSBigIntKeyword=function(l,d){return!!l&&l.type==="TSBigIntKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSBooleanKeyword=function(l,d){return!!l&&l.type==="TSBooleanKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSCallSignatureDeclaration=function(l,d){return!!l&&l.type==="TSCallSignatureDeclaration"&&(d==null||(0,a.default)(l,d))},s.isTSConditionalType=function(l,d){return!!l&&l.type==="TSConditionalType"&&(d==null||(0,a.default)(l,d))},s.isTSConstructSignatureDeclaration=function(l,d){return!!l&&l.type==="TSConstructSignatureDeclaration"&&(d==null||(0,a.default)(l,d))},s.isTSConstructorType=function(l,d){return!!l&&l.type==="TSConstructorType"&&(d==null||(0,a.default)(l,d))},s.isTSDeclareFunction=function(l,d){return!!l&&l.type==="TSDeclareFunction"&&(d==null||(0,a.default)(l,d))},s.isTSDeclareMethod=function(l,d){return!!l&&l.type==="TSDeclareMethod"&&(d==null||(0,a.default)(l,d))},s.isTSEntityName=function(l,d){if(!l)return!1;switch(l.type){case"Identifier":case"TSQualifiedName":break;case"Placeholder":if(l.expectedNode==="Identifier")break;default:return!1}return d==null||(0,a.default)(l,d)},s.isTSEnumBody=function(l,d){return!!l&&l.type==="TSEnumBody"&&(d==null||(0,a.default)(l,d))},s.isTSEnumDeclaration=function(l,d){return!!l&&l.type==="TSEnumDeclaration"&&(d==null||(0,a.default)(l,d))},s.isTSEnumMember=function(l,d){return!!l&&l.type==="TSEnumMember"&&(d==null||(0,a.default)(l,d))},s.isTSExportAssignment=function(l,d){return!!l&&l.type==="TSExportAssignment"&&(d==null||(0,a.default)(l,d))},s.isTSExpressionWithTypeArguments=function(l,d){return!!l&&l.type==="TSExpressionWithTypeArguments"&&(d==null||(0,a.default)(l,d))},s.isTSExternalModuleReference=function(l,d){return!!l&&l.type==="TSExternalModuleReference"&&(d==null||(0,a.default)(l,d))},s.isTSFunctionType=function(l,d){return!!l&&l.type==="TSFunctionType"&&(d==null||(0,a.default)(l,d))},s.isTSImportEqualsDeclaration=function(l,d){return!!l&&l.type==="TSImportEqualsDeclaration"&&(d==null||(0,a.default)(l,d))},s.isTSImportType=function(l,d){return!!l&&l.type==="TSImportType"&&(d==null||(0,a.default)(l,d))},s.isTSIndexSignature=function(l,d){return!!l&&l.type==="TSIndexSignature"&&(d==null||(0,a.default)(l,d))},s.isTSIndexedAccessType=function(l,d){return!!l&&l.type==="TSIndexedAccessType"&&(d==null||(0,a.default)(l,d))},s.isTSInferType=function(l,d){return!!l&&l.type==="TSInferType"&&(d==null||(0,a.default)(l,d))},s.isTSInstantiationExpression=function(l,d){return!!l&&l.type==="TSInstantiationExpression"&&(d==null||(0,a.default)(l,d))},s.isTSInterfaceBody=function(l,d){return!!l&&l.type==="TSInterfaceBody"&&(d==null||(0,a.default)(l,d))},s.isTSInterfaceDeclaration=function(l,d){return!!l&&l.type==="TSInterfaceDeclaration"&&(d==null||(0,a.default)(l,d))},s.isTSIntersectionType=function(l,d){return!!l&&l.type==="TSIntersectionType"&&(d==null||(0,a.default)(l,d))},s.isTSIntrinsicKeyword=function(l,d){return!!l&&l.type==="TSIntrinsicKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSLiteralType=function(l,d){return!!l&&l.type==="TSLiteralType"&&(d==null||(0,a.default)(l,d))},s.isTSMappedType=function(l,d){return!!l&&l.type==="TSMappedType"&&(d==null||(0,a.default)(l,d))},s.isTSMethodSignature=function(l,d){return!!l&&l.type==="TSMethodSignature"&&(d==null||(0,a.default)(l,d))},s.isTSModuleBlock=function(l,d){return!!l&&l.type==="TSModuleBlock"&&(d==null||(0,a.default)(l,d))},s.isTSModuleDeclaration=function(l,d){return!!l&&l.type==="TSModuleDeclaration"&&(d==null||(0,a.default)(l,d))},s.isTSNamedTupleMember=function(l,d){return!!l&&l.type==="TSNamedTupleMember"&&(d==null||(0,a.default)(l,d))},s.isTSNamespaceExportDeclaration=function(l,d){return!!l&&l.type==="TSNamespaceExportDeclaration"&&(d==null||(0,a.default)(l,d))},s.isTSNeverKeyword=function(l,d){return!!l&&l.type==="TSNeverKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSNonNullExpression=function(l,d){return!!l&&l.type==="TSNonNullExpression"&&(d==null||(0,a.default)(l,d))},s.isTSNullKeyword=function(l,d){return!!l&&l.type==="TSNullKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSNumberKeyword=function(l,d){return!!l&&l.type==="TSNumberKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSObjectKeyword=function(l,d){return!!l&&l.type==="TSObjectKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSOptionalType=function(l,d){return!!l&&l.type==="TSOptionalType"&&(d==null||(0,a.default)(l,d))},s.isTSParameterProperty=function(l,d){return!!l&&l.type==="TSParameterProperty"&&(d==null||(0,a.default)(l,d))},s.isTSParenthesizedType=function(l,d){return!!l&&l.type==="TSParenthesizedType"&&(d==null||(0,a.default)(l,d))},s.isTSPropertySignature=function(l,d){return!!l&&l.type==="TSPropertySignature"&&(d==null||(0,a.default)(l,d))},s.isTSQualifiedName=function(l,d){return!!l&&l.type==="TSQualifiedName"&&(d==null||(0,a.default)(l,d))},s.isTSRestType=function(l,d){return!!l&&l.type==="TSRestType"&&(d==null||(0,a.default)(l,d))},s.isTSSatisfiesExpression=function(l,d){return!!l&&l.type==="TSSatisfiesExpression"&&(d==null||(0,a.default)(l,d))},s.isTSStringKeyword=function(l,d){return!!l&&l.type==="TSStringKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSSymbolKeyword=function(l,d){return!!l&&l.type==="TSSymbolKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSTemplateLiteralType=function(l,d){return!!l&&l.type==="TSTemplateLiteralType"&&(d==null||(0,a.default)(l,d))},s.isTSThisType=function(l,d){return!!l&&l.type==="TSThisType"&&(d==null||(0,a.default)(l,d))},s.isTSTupleType=function(l,d){return!!l&&l.type==="TSTupleType"&&(d==null||(0,a.default)(l,d))},s.isTSType=function(l,d){if(!l)return!1;switch(l.type){case"TSAnyKeyword":case"TSBooleanKeyword":case"TSBigIntKeyword":case"TSIntrinsicKeyword":case"TSNeverKeyword":case"TSNullKeyword":case"TSNumberKeyword":case"TSObjectKeyword":case"TSStringKeyword":case"TSSymbolKeyword":case"TSUndefinedKeyword":case"TSUnknownKeyword":case"TSVoidKeyword":case"TSThisType":case"TSFunctionType":case"TSConstructorType":case"TSTypeReference":case"TSTypePredicate":case"TSTypeQuery":case"TSTypeLiteral":case"TSArrayType":case"TSTupleType":case"TSOptionalType":case"TSRestType":case"TSUnionType":case"TSIntersectionType":case"TSConditionalType":case"TSInferType":case"TSParenthesizedType":case"TSTypeOperator":case"TSIndexedAccessType":case"TSMappedType":case"TSTemplateLiteralType":case"TSLiteralType":case"TSExpressionWithTypeArguments":case"TSImportType":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isTSTypeAliasDeclaration=function(l,d){return!!l&&l.type==="TSTypeAliasDeclaration"&&(d==null||(0,a.default)(l,d))},s.isTSTypeAnnotation=function(l,d){return!!l&&l.type==="TSTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isTSTypeAssertion=function(l,d){return!!l&&l.type==="TSTypeAssertion"&&(d==null||(0,a.default)(l,d))},s.isTSTypeElement=function(l,d){if(!l)return!1;switch(l.type){case"TSCallSignatureDeclaration":case"TSConstructSignatureDeclaration":case"TSPropertySignature":case"TSMethodSignature":case"TSIndexSignature":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isTSTypeLiteral=function(l,d){return!!l&&l.type==="TSTypeLiteral"&&(d==null||(0,a.default)(l,d))},s.isTSTypeOperator=function(l,d){return!!l&&l.type==="TSTypeOperator"&&(d==null||(0,a.default)(l,d))},s.isTSTypeParameter=function(l,d){return!!l&&l.type==="TSTypeParameter"&&(d==null||(0,a.default)(l,d))},s.isTSTypeParameterDeclaration=function(l,d){return!!l&&l.type==="TSTypeParameterDeclaration"&&(d==null||(0,a.default)(l,d))},s.isTSTypeParameterInstantiation=function(l,d){return!!l&&l.type==="TSTypeParameterInstantiation"&&(d==null||(0,a.default)(l,d))},s.isTSTypePredicate=function(l,d){return!!l&&l.type==="TSTypePredicate"&&(d==null||(0,a.default)(l,d))},s.isTSTypeQuery=function(l,d){return!!l&&l.type==="TSTypeQuery"&&(d==null||(0,a.default)(l,d))},s.isTSTypeReference=function(l,d){return!!l&&l.type==="TSTypeReference"&&(d==null||(0,a.default)(l,d))},s.isTSUndefinedKeyword=function(l,d){return!!l&&l.type==="TSUndefinedKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSUnionType=function(l,d){return!!l&&l.type==="TSUnionType"&&(d==null||(0,a.default)(l,d))},s.isTSUnknownKeyword=function(l,d){return!!l&&l.type==="TSUnknownKeyword"&&(d==null||(0,a.default)(l,d))},s.isTSVoidKeyword=function(l,d){return!!l&&l.type==="TSVoidKeyword"&&(d==null||(0,a.default)(l,d))},s.isTaggedTemplateExpression=function(l,d){return!!l&&l.type==="TaggedTemplateExpression"&&(d==null||(0,a.default)(l,d))},s.isTemplateElement=function(l,d){return!!l&&l.type==="TemplateElement"&&(d==null||(0,a.default)(l,d))},s.isTemplateLiteral=function(l,d){return!!l&&l.type==="TemplateLiteral"&&(d==null||(0,a.default)(l,d))},s.isTerminatorless=function(l,d){if(!l)return!1;switch(l.type){case"BreakStatement":case"ContinueStatement":case"ReturnStatement":case"ThrowStatement":case"YieldExpression":case"AwaitExpression":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isThisExpression=function(l,d){return!!l&&l.type==="ThisExpression"&&(d==null||(0,a.default)(l,d))},s.isThisTypeAnnotation=function(l,d){return!!l&&l.type==="ThisTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isThrowStatement=function(l,d){return!!l&&l.type==="ThrowStatement"&&(d==null||(0,a.default)(l,d))},s.isTopicReference=function(l,d){return!!l&&l.type==="TopicReference"&&(d==null||(0,a.default)(l,d))},s.isTryStatement=function(l,d){return!!l&&l.type==="TryStatement"&&(d==null||(0,a.default)(l,d))},s.isTupleExpression=function(l,d){return!!l&&l.type==="TupleExpression"&&(d==null||(0,a.default)(l,d))},s.isTupleTypeAnnotation=function(l,d){return!!l&&l.type==="TupleTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isTypeAlias=function(l,d){return!!l&&l.type==="TypeAlias"&&(d==null||(0,a.default)(l,d))},s.isTypeAnnotation=function(l,d){return!!l&&l.type==="TypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isTypeCastExpression=function(l,d){return!!l&&l.type==="TypeCastExpression"&&(d==null||(0,a.default)(l,d))},s.isTypeParameter=function(l,d){return!!l&&l.type==="TypeParameter"&&(d==null||(0,a.default)(l,d))},s.isTypeParameterDeclaration=function(l,d){return!!l&&l.type==="TypeParameterDeclaration"&&(d==null||(0,a.default)(l,d))},s.isTypeParameterInstantiation=function(l,d){return!!l&&l.type==="TypeParameterInstantiation"&&(d==null||(0,a.default)(l,d))},s.isTypeScript=function(l,d){if(!l)return!1;switch(l.type){case"TSParameterProperty":case"TSDeclareFunction":case"TSDeclareMethod":case"TSQualifiedName":case"TSCallSignatureDeclaration":case"TSConstructSignatureDeclaration":case"TSPropertySignature":case"TSMethodSignature":case"TSIndexSignature":case"TSAnyKeyword":case"TSBooleanKeyword":case"TSBigIntKeyword":case"TSIntrinsicKeyword":case"TSNeverKeyword":case"TSNullKeyword":case"TSNumberKeyword":case"TSObjectKeyword":case"TSStringKeyword":case"TSSymbolKeyword":case"TSUndefinedKeyword":case"TSUnknownKeyword":case"TSVoidKeyword":case"TSThisType":case"TSFunctionType":case"TSConstructorType":case"TSTypeReference":case"TSTypePredicate":case"TSTypeQuery":case"TSTypeLiteral":case"TSArrayType":case"TSTupleType":case"TSOptionalType":case"TSRestType":case"TSNamedTupleMember":case"TSUnionType":case"TSIntersectionType":case"TSConditionalType":case"TSInferType":case"TSParenthesizedType":case"TSTypeOperator":case"TSIndexedAccessType":case"TSMappedType":case"TSTemplateLiteralType":case"TSLiteralType":case"TSExpressionWithTypeArguments":case"TSInterfaceDeclaration":case"TSInterfaceBody":case"TSTypeAliasDeclaration":case"TSInstantiationExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSEnumBody":case"TSEnumDeclaration":case"TSEnumMember":case"TSModuleDeclaration":case"TSModuleBlock":case"TSImportType":case"TSImportEqualsDeclaration":case"TSExternalModuleReference":case"TSNonNullExpression":case"TSExportAssignment":case"TSNamespaceExportDeclaration":case"TSTypeAnnotation":case"TSTypeParameterInstantiation":case"TSTypeParameterDeclaration":case"TSTypeParameter":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isTypeofTypeAnnotation=function(l,d){return!!l&&l.type==="TypeofTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isUnaryExpression=function(l,d){return!!l&&l.type==="UnaryExpression"&&(d==null||(0,a.default)(l,d))},s.isUnaryLike=function(l,d){if(!l)return!1;switch(l.type){case"UnaryExpression":case"SpreadElement":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isUnionTypeAnnotation=function(l,d){return!!l&&l.type==="UnionTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isUpdateExpression=function(l,d){return!!l&&l.type==="UpdateExpression"&&(d==null||(0,a.default)(l,d))},s.isUserWhitespacable=function(l,d){if(!l)return!1;switch(l.type){case"ObjectMethod":case"ObjectProperty":case"ObjectTypeInternalSlot":case"ObjectTypeCallProperty":case"ObjectTypeIndexer":case"ObjectTypeProperty":case"ObjectTypeSpreadProperty":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isV8IntrinsicIdentifier=function(l,d){return!!l&&l.type==="V8IntrinsicIdentifier"&&(d==null||(0,a.default)(l,d))},s.isVariableDeclaration=function(l,d){return!!l&&l.type==="VariableDeclaration"&&(d==null||(0,a.default)(l,d))},s.isVariableDeclarator=function(l,d){return!!l&&l.type==="VariableDeclarator"&&(d==null||(0,a.default)(l,d))},s.isVariance=function(l,d){return!!l&&l.type==="Variance"&&(d==null||(0,a.default)(l,d))},s.isVoidPattern=function(l,d){return!!l&&l.type==="VoidPattern"&&(d==null||(0,a.default)(l,d))},s.isVoidTypeAnnotation=function(l,d){return!!l&&l.type==="VoidTypeAnnotation"&&(d==null||(0,a.default)(l,d))},s.isWhile=function(l,d){if(!l)return!1;switch(l.type){case"DoWhileStatement":case"WhileStatement":break;default:return!1}return d==null||(0,a.default)(l,d)},s.isWhileStatement=function(l,d){return!!l&&l.type==="WhileStatement"&&(d==null||(0,a.default)(l,d))},s.isWithStatement=function(l,d){return!!l&&l.type==="WithStatement"&&(d==null||(0,a.default)(l,d))},s.isYieldExpression=function(l,d){return!!l&&l.type==="YieldExpression"&&(d==null||(0,a.default)(l,d))};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/shallowEqual.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/deprecationWarning.js");function u(l,d){if(!l)return!1;switch(l.type){case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ImportDeclaration":break;default:return!1}return d==null||(0,a.default)(l,d)}},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/is.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(d,m,h){return m?(0,c.default)(m.type,d)?h===void 0||(0,a.default)(m,h):!h&&m.type==="Placeholder"&&d in l.FLIPPED_ALIAS_KEYS&&(0,u.default)(m.expectedNode,d):!1};var a=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/utils/shallowEqual.js"),c=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isType.js"),u=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isPlaceholderType.js"),l=o("./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/definitions/index.js")},"./node_modules/.pnpm/@babel+types@7.29.0/node_modules/@babel/types/lib/validators/isBinding.js"(i,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(c,u,l){if(l&&c.type==="Identifier"&&u.type==="ObjectProperty"&&l.type==="ObjectExpression")return!1;let d=a.default.keys[u.type];if(d)for(let m=0;mm.length)return!1;for(let A=0,y=h.length-1;Aie});var a={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},c={isSpaceSeparator:oe=>typeof oe=="string"&&a.Space_Separator.test(oe),isIdStartChar:oe=>typeof oe=="string"&&(oe>="a"&&oe<="z"||oe>="A"&&oe<="Z"||oe==="$"||oe==="_"||a.ID_Start.test(oe)),isIdContinueChar:oe=>typeof oe=="string"&&(oe>="a"&&oe<="z"||oe>="A"&&oe<="Z"||oe>="0"&&oe<="9"||oe==="$"||oe==="_"||oe==="\u200C"||oe==="\u200D"||a.ID_Continue.test(oe)),isDigit:oe=>typeof oe=="string"&&/[0-9]/.test(oe),isHexDigit:oe=>typeof oe=="string"&&/[0-9A-Fa-f]/.test(oe)};let u,l,d,m,h,f,g,A,y;function E(oe,ne,Z){let te=oe[ne];if(te!=null&&typeof te=="object")if(Array.isArray(te))for(let V=0;V0;){let Z=N();if(!c.isHexDigit(Z))throw j(O());oe+=O()}return String.fromCodePoint(parseInt(oe,16))}let ce={start(){if(g.type==="eof")throw se();Y()},beforePropertyName(){switch(g.type){case"identifier":case"string":return A=g.value,void(l="afterPropertyName");case"punctuator":return void z();case"eof":throw se()}},afterPropertyName(){if(g.type==="eof")throw se();l="beforePropertyValue"},beforePropertyValue(){if(g.type==="eof")throw se();Y()},beforeArrayValue(){if(g.type==="eof")throw se();g.type!=="punctuator"||g.value!=="]"?Y():z()},afterPropertyValue(){if(g.type==="eof")throw se();switch(g.value){case",":return void(l="beforePropertyName");case"}":z()}},afterArrayValue(){if(g.type==="eof")throw se();switch(g.value){case",":return void(l="beforeArrayValue");case"]":z()}},end(){}};function Y(){let oe;switch(g.type){case"punctuator":switch(g.value){case"{":oe={};break;case"[":oe=[]}break;case"null":case"boolean":case"numeric":case"string":oe=g.value}if(y===void 0)y=oe;else{let ne=d[d.length-1];Array.isArray(ne)?ne.push(oe):Object.defineProperty(ne,A,{value:oe,writable:!0,enumerable:!0,configurable:!0})}if(oe!==null&&typeof oe=="object")d.push(oe),l=Array.isArray(oe)?"beforeArrayValue":"beforePropertyName";else{let ne=d[d.length-1];l=ne==null?"end":Array.isArray(ne)?"afterArrayValue":"afterPropertyValue"}}function z(){d.pop();let oe=d[d.length-1];l=oe==null?"end":Array.isArray(oe)?"afterArrayValue":"afterPropertyValue"}function j(oe){return Pe(oe===void 0?`JSON5: invalid end of input at ${h}:${f}`:`JSON5: invalid character '${De(oe)}' at ${h}:${f}`)}function se(){return Pe(`JSON5: invalid end of input at ${h}:${f}`)}function Ae(){return f-=5,Pe(`JSON5: invalid identifier character at ${h}:${f}`)}function De(oe){let ne={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(ne[oe])return ne[oe];if(oe<" "){let Z=oe.charCodeAt(0).toString(16);return"\\x"+("00"+Z).substring(Z.length)}return oe}function Pe(oe){let ne=new SyntaxError(oe);return ne.lineNumber=h,ne.columnNumber=f,ne}let ie={parse:function(oe,ne){u=String(oe),l="start",d=[],m=0,h=1,f=0,g=void 0,A=void 0,y=void 0;do g=k(),ce[l]();while(g.type!=="eof");return typeof ne=="function"?E({"":y},"",ne):y},stringify:function(oe,ne,Z){let te=[],V,ee,ae,me="",ge="";if(ne==null||typeof ne!="object"||Array.isArray(ne)||(Z=ne.space,ae=ne.quote,ne=ne.replacer),typeof ne=="function")ee=ne;else if(Array.isArray(ne)){V=[];for(let be of ne){let Te;typeof be=="string"?Te=be:(typeof be=="number"||be instanceof String||be instanceof Number)&&(Te=String(be)),Te!==void 0&&V.indexOf(Te)<0&&V.push(Te)}}return Z instanceof Number?Z=Number(Z):Z instanceof String&&(Z=String(Z)),typeof Z=="number"?Z>0&&(Z=Math.min(10,Math.floor(Z)),ge=" ".substr(0,Z)):typeof Z=="string"&&(ge=Z.substr(0,10)),ue("",{"":oe});function ue(be,Te){let _e=Te[be];switch(_e!=null&&(typeof _e.toJSON5=="function"?_e=_e.toJSON5(be):typeof _e.toJSON=="function"&&(_e=_e.toJSON(be))),ee&&(_e=ee.call(Te,be,_e)),_e instanceof Number?_e=Number(_e):_e instanceof String?_e=String(_e):_e instanceof Boolean&&(_e=_e.valueOf()),_e){case null:return"null";case!0:return"true";case!1:return"false"}return typeof _e=="string"?ye(_e):typeof _e=="number"?String(_e):typeof _e=="object"?Array.isArray(_e)?(function(X){if(te.indexOf(X)>=0)throw TypeError("Converting circular structure to JSON5");te.push(X);let $e=me;me+=ge;let He,mt=[];for(let st=0;st=0)throw TypeError("Converting circular structure to JSON5");te.push(X);let $e=me;me+=ge;let He,mt=V||Object.keys(X),st=[];for(let ze of mt){let rt=ue(ze,X);if(rt!==void 0){let Ct=Se(ze)+":";ge!==""&&(Ct+=" "),Ct+=rt,st.push(Ct)}}if(st.length===0)He="{}";else{let ze;if(ge==="")ze=st.join(","),He="{"+ze+"}";else{let rt=`, +`+me;ze=st.join(rt),He=`{ +`+me+ze+`, +`+$e+"}"}}return te.pop(),me=$e,He})(_e):void 0}function ye(be){let Te={"'":.1,'"':.2},_e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},X="";for(let He=0;HeTe[He]a})},"./stubs/helper-compilation-targets.mjs"(i,s,o){"use strict";function a(){return{}}o.r(s),o.d(s,{default:()=>a})},"./node_modules/.pnpm/@babel+helper-globals@7.28.0/node_modules/@babel/helper-globals/data/builtin-lower.json"(i){"use strict";i.exports=JSON.parse('["decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","globalThis","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"]')},"./node_modules/.pnpm/@babel+helper-globals@7.28.0/node_modules/@babel/helper-globals/data/builtin-upper.json"(i){"use strict";i.exports=JSON.parse('["AggregateError","Array","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","Error","EvalError","FinalizationRegistry","Float16Array","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","Intl","Iterator","JSON","Map","Math","NaN","Number","Object","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","String","Symbol","SyntaxError","TypeError","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","URIError","WeakMap","WeakRef","WeakSet"]')},"./node_modules/.pnpm/@babel+preset-typescript@7.28.5_@babel+core@7.29.0/node_modules/@babel/preset-typescript/package.json"(i){"use strict";i.exports={version:"7.28.5"}}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}n.n=i=>{var s=i&&i.__esModule?()=>i.default:()=>i;return n.d(s,{a:s}),s},n.d=(i,s)=>{for(var o in s)n.o(s,o)&&!n.o(i,o)&&Object.defineProperty(i,o,{enumerable:!0,get:s[o]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.nmd=i=>(i.paths=[],i.children||(i.children=[]),i);var r={};(()=>{"use strict";n.d(r,{default:()=>yT});var i=n("./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/index.js"),s=n("./node_modules/.pnpm/@babel+plugin-proposal-decorators@7.29.0_@babel+core@7.29.0/node_modules/@babel/plugin-proposal-decorators/lib/index.js"),o=n("./node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.29.0/node_modules/@babel/plugin-syntax-class-properties/lib/index.js"),a=n("./node_modules/.pnpm/@babel+plugin-syntax-import-assertions@7.28.6_@babel+core@7.29.0/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js"),c=n("./node_modules/.pnpm/@babel+plugin-syntax-jsx@7.28.6_@babel+core@7.29.0/node_modules/@babel/plugin-syntax-jsx/lib/index.js"),u=n("./node_modules/.pnpm/@babel+plugin-transform-explicit-resource-management@7.28.6_@babel+core@7.29.0/node_modules/@babel/plugin-transform-explicit-resource-management/lib/index.js"),l=n("./node_modules/.pnpm/@babel+plugin-transform-export-namespace-from@7.27.1_@babel+core@7.29.0/node_modules/@babel/plugin-transform-export-namespace-from/lib/index.js"),d=n("./node_modules/.pnpm/@babel+plugin-transform-react-jsx@7.28.6_@babel+core@7.29.0/node_modules/@babel/plugin-transform-react-jsx/lib/index.js"),m=n("./node_modules/.pnpm/@babel+plugin-transform-typescript@7.28.6_@babel+core@7.29.0/node_modules/@babel/plugin-transform-typescript/lib/index.js"),h=n("./node_modules/.pnpm/babel-plugin-parameter-decorator@1.0.16/node_modules/babel-plugin-parameter-decorator/lib/index.js"),f=n.n(h),g=n("./node_modules/.pnpm/@babel+helper-plugin-utils@7.28.6/node_modules/@babel/helper-plugin-utils/lib/index.js");function A(B,H,pe=!1){return i.types.decorator(i.types.functionExpression(null,[i.types.identifier("target"),i.types.identifier("key")],i.types.blockStatement([i.types.returnStatement(i.types.callExpression(H,[i.types.identifier("target"),i.types.identifier(pe?"undefined":"key"),i.types.numericLiteral(B)]))])))}function y(B,H){if(H.type!=="ClassMethod"||H.node.type!=="ClassMethod"||H.node.key.type!=="Identifier")return;let pe=H,xe=pe.get("params")||[];for(let We of xe){if((We.node.type==="Identifier"||We.node.type==="ObjectPattern"?We.node:We.node.type==="TSParameterProperty"&&We.node.parameter.type==="Identifier"?We.node.parameter:null)==null)continue;let At;for(let kt of We.node.decorators||[])pe.node.kind==="constructor"?(At=A(We.key,kt.expression,!0),B.node.decorators||(B.node.decorators=[]),B.node.decorators.push(At)):(At=A(We.key,kt.expression,!1),pe.node.decorators||(pe.node.decorators=[]),pe.node.decorators.push(At));At&&(We.node.decorators=null)}}function E(){return i.types.unaryExpression("void",i.types.numericLiteral(0))}function _(B){return B==null?null:B.type==="ClassProperty"||B.type==="Identifier"||B.type==="ObjectPattern"?B:B.type==="AssignmentPattern"&&B.left.type==="Identifier"?B.left:B.type==="TSParameterProperty"?_(B.parameter):null}function S(B,H){let pe=_(H);if(pe==null||!pe.typeAnnotation||pe.typeAnnotation.type!=="TSTypeAnnotation")return E();let xe=pe.typeAnnotation.typeAnnotation;return k(B.node.id?B.node.id.name:"",xe)}function C(B,H){let pe=w(H.typeName);return I(B,pe)?i.types.identifier("Object"):i.types.conditionalExpression(i.types.binaryExpression("===",i.types.unaryExpression("typeof",pe),i.types.stringLiteral("undefined")),i.types.identifier("Object"),i.types.cloneDeep(pe))}function I(B,H){switch(H.type){case"Identifier":return H.name===B;case"MemberExpression":return I(B,H.object);default:throw new Error(`The property expression at ${H.start} is not valid as a Type to be used in Reflect.metadata`)}}function w(B){return B.type==="Identifier"?i.types.identifier(B.name):i.types.memberExpression(w(B.left),B.right)}function k(B,H){if(H===void 0)return i.types.identifier("Object");switch(H.type){case"TSVoidKeyword":case"TSUndefinedKeyword":case"TSNullKeyword":case"TSNeverKeyword":return E();case"TSParenthesizedType":return k(B,H.typeAnnotation);case"TSFunctionType":case"TSConstructorType":return i.types.identifier("Function");case"TSArrayType":case"TSTupleType":return i.types.identifier("Array");case"TSTypePredicate":case"TSBooleanKeyword":return i.types.identifier("Boolean");case"TSStringKeyword":return i.types.identifier("String");case"TSObjectKeyword":return i.types.identifier("Object");case"TSLiteralType":switch(H.literal.type){case"StringLiteral":return i.types.identifier("String");case"NumericLiteral":return i.types.identifier("Number");case"BooleanLiteral":return i.types.identifier("Boolean");default:throw new Error("Bad type for decorator"+H.literal)}case"TSNumberKeyword":case"TSBigIntKeyword":return i.types.identifier("Number");case"TSSymbolKeyword":return i.types.identifier("Symbol");case"TSTypeReference":return C(B,H);case"TSIntersectionType":case"TSUnionType":return N(B,H.types);case"TSConditionalType":return N(B,[H.trueType,H.falseType]);case"TSTypeQuery":case"TSTypeOperator":case"TSIndexedAccessType":case"TSMappedType":case"TSTypeLiteral":case"TSAnyKeyword":case"TSUnknownKeyword":case"TSThisType":break;default:throw new Error("Bad type for decorator")}return i.types.identifier("Object")}function N(B,H){let pe;for(let xe of H){for(;xe.type==="TSParenthesizedType";)xe=xe.typeAnnotation;if(xe.type==="TSNeverKeyword"||xe.type==="TSNullKeyword"||xe.type==="TSUndefinedKeyword")continue;let We=k(B,xe);if(i.types.isIdentifier(We)&&We.name==="Object")return We;if(pe){if(!i.types.isIdentifier(pe)||!i.types.isIdentifier(We)||pe.name!==We.name)return i.types.identifier("Object")}else pe=We}return pe||E()}function O(B,H){return i.types.decorator(i.types.logicalExpression("||",i.types.optionalCallExpression(i.types.memberExpression(i.types.identifier("Reflect"),i.types.identifier("metadata")),[i.types.stringLiteral(B),H],!0),i.types.arrowFunctionExpression([i.types.identifier("t")],i.types.identifier("t"))))}function W(B,H){let pe=H.node,xe=B.node;switch(pe.type){case"ClassMethod":{let We=pe.kind==="constructor"?xe.decorators:pe.decorators;if(!We||We.length===0)return;We.push(O("design:type",i.types.identifier("Function"))),We.push(O("design:paramtypes",i.types.arrayExpression(pe.params.map(At=>S(B,At)))));break}case"ClassProperty":if(!pe.decorators||pe.decorators.length===0||!pe.typeAnnotation||pe.typeAnnotation.type!=="TSTypeAnnotation")return;pe.decorators.push(O("design:type",S(B,pe)))}}let $=(0,g.declare)(B=>(B.assertVersion(7),{visitor:{Program(H){H.traverse({ClassDeclaration(pe){for(let xe of pe.get("body").get("body"))xe.type!=="ClassMethod"&&xe.type!=="ClassProperty"||(y(pe,xe),W(pe,xe));pe.parentPath.scope.crawl()}})}}}));function G({template:B,types:H}){return{name:"@import-meta-env/babel",visitor:{Identifier(pe){if(!H.isIdentifier(pe)||!H.isMemberExpression(pe.parentPath)&&!H.isOptionalMemberExpression(pe.parentPath)||!H.isMemberExpression(pe.parentPath.node))return;let xe=pe.parentPath.node;if(!H.isMetaProperty(xe.object))return;let We=xe.object;We.meta.name==="import"&&We.property.name==="meta"&&xe.property.name==="env"&&pe.parentPath.replaceWith(B.expression.ast("process.env"))}}}}function q(B){return{name:"import-meta-resolve",visitor:{Program(H){let pe=[];if(H.traverse({MemberExpression(xe){let{node:We}=xe;We.object.type==="MetaProperty"&&We.object.meta.name==="import"&&We.object.property.name==="meta"&&We.property.type==="Identifier"&&We.property.name==="resolve"&&pe.push(xe)}}),pe.length!==0)for(let xe of pe)xe.replaceWith({type:"ExpressionStatement",expression:{type:"Identifier",name:"jitiESMResolve"}})}}}}var ce=n("./node_modules/.pnpm/@babel+template@7.28.6/node_modules/@babel/template/lib/index.js");let Y=/^[A-Za-z]:\//;function z(B=""){return B&&B.replace(/\\/g,"/").replace(Y,H=>H.toUpperCase())}let j=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,se=/^[A-Za-z]:$/,Ae=function(B){return j.test(B)},De=function(B){let H=z(B).replace(/\/$/,"").split("/").slice(0,-1);return H.length===1&&se.test(H[0])&&(H[0]+="/"),H.join("/")||(Ae(B)?"/":".")};var Pe=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],we=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],ie="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",oe={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ne="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Z={5:ne,"5module":ne+" export import",6:ne+" const class extends export import super"},te=/^in(stanceof)?$/,V=new RegExp("["+ie+"]"),ee=new RegExp("["+ie+"\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]");function ae(B,H){for(var pe=65536,xe=0;xeB)return!1;if((pe+=H[xe+1])>=B)return!0}return!1}function me(B,H){return B<65?B===36:B<91||(B<97?B===95:B<123||(B<=65535?B>=170&&V.test(String.fromCharCode(B)):H!==!1&&ae(B,we)))}function ge(B,H){return B<48?B===36:B<58||!(B<65)&&(B<91||(B<97?B===95:B<123||(B<=65535?B>=170&&ee.test(String.fromCharCode(B)):H!==!1&&(ae(B,we)||ae(B,Pe)))))}var ue=function(B,H){H===void 0&&(H={}),this.label=B,this.keyword=H.keyword,this.beforeExpr=!!H.beforeExpr,this.startsExpr=!!H.startsExpr,this.isLoop=!!H.isLoop,this.isAssign=!!H.isAssign,this.prefix=!!H.prefix,this.postfix=!!H.postfix,this.binop=H.binop||null,this.updateContext=null};function ye(B,H){return new ue(B,{beforeExpr:!0,binop:H})}var Se={beforeExpr:!0},be={startsExpr:!0},Te={};function _e(B,H){return H===void 0&&(H={}),H.keyword=B,Te[B]=new ue(B,H)}var X={num:new ue("num",be),regexp:new ue("regexp",be),string:new ue("string",be),name:new ue("name",be),privateId:new ue("privateId",be),eof:new ue("eof"),bracketL:new ue("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new ue("]"),braceL:new ue("{",{beforeExpr:!0,startsExpr:!0}),braceR:new ue("}"),parenL:new ue("(",{beforeExpr:!0,startsExpr:!0}),parenR:new ue(")"),comma:new ue(",",Se),semi:new ue(";",Se),colon:new ue(":",Se),dot:new ue("."),question:new ue("?",Se),questionDot:new ue("?."),arrow:new ue("=>",Se),template:new ue("template"),invalidTemplate:new ue("invalidTemplate"),ellipsis:new ue("...",Se),backQuote:new ue("`",be),dollarBraceL:new ue("${",{beforeExpr:!0,startsExpr:!0}),eq:new ue("=",{beforeExpr:!0,isAssign:!0}),assign:new ue("_=",{beforeExpr:!0,isAssign:!0}),incDec:new ue("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new ue("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:ye("||",1),logicalAND:ye("&&",2),bitwiseOR:ye("|",3),bitwiseXOR:ye("^",4),bitwiseAND:ye("&",5),equality:ye("==/!=/===/!==",6),relational:ye("/<=/>=",7),bitShift:ye("<>/>>>",8),plusMin:new ue("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:ye("%",10),star:ye("*",10),slash:ye("/",10),starstar:new ue("**",{beforeExpr:!0}),coalesce:ye("??",1),_break:_e("break"),_case:_e("case",Se),_catch:_e("catch"),_continue:_e("continue"),_debugger:_e("debugger"),_default:_e("default",Se),_do:_e("do",{isLoop:!0,beforeExpr:!0}),_else:_e("else",Se),_finally:_e("finally"),_for:_e("for",{isLoop:!0}),_function:_e("function",be),_if:_e("if"),_return:_e("return",Se),_switch:_e("switch"),_throw:_e("throw",Se),_try:_e("try"),_var:_e("var"),_const:_e("const"),_while:_e("while",{isLoop:!0}),_with:_e("with"),_new:_e("new",{beforeExpr:!0,startsExpr:!0}),_this:_e("this",be),_super:_e("super",be),_class:_e("class",be),_extends:_e("extends",Se),_export:_e("export"),_import:_e("import",be),_null:_e("null",be),_true:_e("true",be),_false:_e("false",be),_in:_e("in",{beforeExpr:!0,binop:7}),_instanceof:_e("instanceof",{beforeExpr:!0,binop:7}),_typeof:_e("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:_e("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:_e("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},$e=/\r\n?|\n|\u2028|\u2029/,He=new RegExp($e.source,"g");function mt(B){return B===10||B===13||B===8232||B===8233}function st(B,H,pe){pe===void 0&&(pe=B.length);for(var xe=H;xe>10),56320+(1023&B)))}var yt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Vt=function(B,H){this.line=B,this.column=H};Vt.prototype.offset=function(B){return new Vt(this.line,this.column+B)};var dn=function(B,H,pe){this.start=H,this.end=pe,B.sourceFile!==null&&(this.source=B.sourceFile)};function An(B,H){for(var pe=1,xe=0;;){var We=st(B,xe,H);if(We<0)return new Vt(pe,H-xe);++pe,xe=We}}var Fn={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},qe=!1;function ht(B){var H={};for(var pe in Fn)H[pe]=B&&Qt(B,pe)?B[pe]:Fn[pe];if(H.ecmaVersion==="latest"?H.ecmaVersion=1e8:H.ecmaVersion==null?(!qe&&typeof console=="object"&&console.warn&&(qe=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. +Defaulting to 2020, but this will stop working in the future.`)),H.ecmaVersion=11):H.ecmaVersion>=2015&&(H.ecmaVersion-=2009),H.allowReserved==null&&(H.allowReserved=H.ecmaVersion<5),B&&B.allowHashBang!=null||(H.allowHashBang=H.ecmaVersion>=14),Mt(H.onToken)){var xe=H.onToken;H.onToken=function(We){return xe.push(We)}}if(Mt(H.onComment)&&(H.onComment=(function(We,At){return function(kt,Yt,Gn,yr,Ur,Ws){var vo={type:kt?"Block":"Line",value:Yt,start:Gn,end:yr};We.locations&&(vo.loc=new dn(this,Ur,Ws)),We.ranges&&(vo.range=[Gn,yr]),At.push(vo)}})(H,H.onComment)),H.sourceType==="commonjs"&&H.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return H}var Zt=256,Ze=259;function dt(B,H){return 2|(B?4:0)|(H?8:0)}var gt=function(B,H,pe){this.options=B=ht(B),this.sourceFile=B.sourceFile,this.keywords=Me(Z[B.ecmaVersion>=6?6:B.sourceType==="module"?"5module":5]);var xe="";B.allowReserved!==!0&&(xe=oe[B.ecmaVersion>=6?6:B.ecmaVersion===5?5:3],B.sourceType==="module"&&(xe+=" await")),this.reservedWords=Me(xe);var We=(xe?xe+" ":"")+oe.strict;this.reservedWordsStrict=Me(We),this.reservedWordsStrictBind=Me(We+" "+oe.strictBind),this.input=String(H),this.containsEsc=!1,pe?(this.pos=pe,this.lineStart=this.input.lastIndexOf(` +`,pe-1)+1,this.curLine=this.input.slice(0,this.lineStart).split($e).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=X.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=B.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&B.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?2:1),this.regexpState=null,this.privateNameStack=[]},tt={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};gt.prototype.parse=function(){var B=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(B)},tt.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},tt.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},tt.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},tt.canAwait.get=function(){for(var B=this.scopeStack.length-1;B>=0;B--){var H=this.scopeStack[B].flags;if(768&H)return!1;if(2&H)return(4&H)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},tt.allowReturn.get=function(){return!!this.inFunction||!!(this.options.allowReturnOutsideFunction&&1&this.currentVarScope().flags)},tt.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},tt.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},tt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},tt.allowNewDotTarget.get=function(){for(var B=this.scopeStack.length-1;B>=0;B--){var H=this.scopeStack[B].flags;if(768&H||2&H&&!(16&H))return!0}return!1},tt.allowUsing.get=function(){var B=this.currentScope().flags;return!(1024&B)&&!(!this.inModule&&1&B)},tt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Zt)>0},gt.extend=function(){for(var B=[],H=arguments.length;H--;)B[H]=arguments[H];for(var pe=this,xe=0;xe=,?^&]/.test(We)||We==="!"&&this.input.charAt(xe+1)==="=")}B+=H[0].length,rt.lastIndex=B,B+=rt.exec(this.input)[0].length,this.input[B]===";"&&B++}},Dt.eat=function(B){return this.type===B&&(this.next(),!0)},Dt.isContextual=function(B){return this.type===X.name&&this.value===B&&!this.containsEsc},Dt.eatContextual=function(B){return!!this.isContextual(B)&&(this.next(),!0)},Dt.expectContextual=function(B){this.eatContextual(B)||this.unexpected()},Dt.canInsertSemicolon=function(){return this.type===X.eof||this.type===X.braceR||$e.test(this.input.slice(this.lastTokEnd,this.start))},Dt.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Dt.semicolon=function(){this.eat(X.semi)||this.insertSemicolon()||this.unexpected()},Dt.afterTrailingComma=function(B,H){if(this.type===B)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),H||this.next(),!0},Dt.expect=function(B){this.eat(B)||this.unexpected()},Dt.unexpected=function(B){this.raise(B??this.start,"Unexpected token")};var ke=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Dt.checkPatternErrors=function(B,H){if(B){B.trailingComma>-1&&this.raiseRecoverable(B.trailingComma,"Comma is not permitted after the rest element");var pe=H?B.parenthesizedAssign:B.parenthesizedBind;pe>-1&&this.raiseRecoverable(pe,H?"Assigning to rvalue":"Parenthesized pattern")}},Dt.checkExpressionErrors=function(B,H){if(!B)return!1;var pe=B.shorthandAssign,xe=B.doubleProto;if(!H)return pe>=0||xe>=0;pe>=0&&this.raise(pe,"Shorthand property assignments are valid only in destructuring patterns"),xe>=0&&this.raiseRecoverable(xe,"Redefinition of __proto__ property")},Dt.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(At,!1,!B);case X._class:return B&&this.unexpected(),this.parseClass(At,!0);case X._if:return this.parseIfStatement(At);case X._return:return this.parseReturnStatement(At);case X._switch:return this.parseSwitchStatement(At);case X._throw:return this.parseThrowStatement(At);case X._try:return this.parseTryStatement(At);case X._const:case X._var:return xe=xe||this.value,B&&xe!=="var"&&this.unexpected(),this.parseVarStatement(At,xe);case X._while:return this.parseWhileStatement(At);case X._with:return this.parseWithStatement(At);case X.braceL:return this.parseBlock(!0,At);case X.semi:return this.parseEmptyStatement(At);case X._export:case X._import:if(this.options.ecmaVersion>10&&We===X._import){rt.lastIndex=this.pos;var kt=rt.exec(this.input),Yt=this.pos+kt[0].length,Gn=this.input.charCodeAt(Yt);if(Gn===40||Gn===46)return this.parseExpressionStatement(At,this.parseExpression())}return this.options.allowImportExportEverywhere||(H||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),We===X._import?this.parseImport(At):this.parseExport(At,pe);default:if(this.isAsyncFunction())return B&&this.unexpected(),this.next(),this.parseFunctionStatement(At,!0,!B);var yr=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(yr)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),yr==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(At,!1,yr),this.semicolon(),this.finishNode(At,"VariableDeclaration");var Ur=this.value,Ws=this.parseExpression();return We===X.name&&Ws.type==="Identifier"&&this.eat(X.colon)?this.parseLabeledStatement(At,Ur,Ws,B):this.parseExpressionStatement(At,Ws)}},Ue.parseBreakContinueStatement=function(B,H){var pe=H==="break";this.next(),this.eat(X.semi)||this.insertSemicolon()?B.label=null:this.type!==X.name?this.unexpected():(B.label=this.parseIdent(),this.semicolon());for(var xe=0;xe=6?this.eat(X.semi):this.semicolon(),this.finishNode(B,"DoWhileStatement")},Ue.parseForStatement=function(B){this.next();var H=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(lt),this.enterScope(0),this.expect(X.parenL),this.type===X.semi)return H>-1&&this.unexpected(H),this.parseFor(B,null);var pe=this.isLet();if(this.type===X._var||this.type===X._const||pe){var xe=this.startNode(),We=pe?"let":this.value;return this.next(),this.parseVar(xe,!0,We),this.finishNode(xe,"VariableDeclaration"),this.parseForAfterInit(B,xe,H)}var At=this.isContextual("let"),kt=!1,Yt=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Yt){var Gn=this.startNode();return this.next(),Yt==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(Gn,!0,Yt),this.finishNode(Gn,"VariableDeclaration"),this.parseForAfterInit(B,Gn,H)}var yr=this.containsEsc,Ur=new ke,Ws=this.start,vo=H>-1?this.parseExprSubscripts(Ur,"await"):this.parseExpression(!0,Ur);return this.type===X._in||(kt=this.options.ecmaVersion>=6&&this.isContextual("of"))?(H>-1?(this.type===X._in&&this.unexpected(H),B.await=!0):kt&&this.options.ecmaVersion>=8&&(vo.start!==Ws||yr||vo.type!=="Identifier"||vo.name!=="async"?this.options.ecmaVersion>=9&&(B.await=!1):this.unexpected()),At&&kt&&this.raise(vo.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(vo,!1,Ur),this.checkLValPattern(vo),this.parseForIn(B,vo)):(this.checkExpressionErrors(Ur,!0),H>-1&&this.unexpected(H),this.parseFor(B,vo))},Ue.parseForAfterInit=function(B,H,pe){return(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&H.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===X._in?pe>-1&&this.unexpected(pe):B.await=pe>-1),this.parseForIn(B,H)):(pe>-1&&this.unexpected(pe),this.parseFor(B,H))},Ue.parseFunctionStatement=function(B,H,pe){return this.next(),this.parseFunction(B,Lt|(pe?0:Bt),!1,H)},Ue.parseIfStatement=function(B){return this.next(),B.test=this.parseParenExpression(),B.consequent=this.parseStatement("if"),B.alternate=this.eat(X._else)?this.parseStatement("if"):null,this.finishNode(B,"IfStatement")},Ue.parseReturnStatement=function(B){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(X.semi)||this.insertSemicolon()?B.argument=null:(B.argument=this.parseExpression(),this.semicolon()),this.finishNode(B,"ReturnStatement")},Ue.parseSwitchStatement=function(B){var H;this.next(),B.discriminant=this.parseParenExpression(),B.cases=[],this.expect(X.braceL),this.labels.push(Ge),this.enterScope(1024);for(var pe=!1;this.type!==X.braceR;)if(this.type===X._case||this.type===X._default){var xe=this.type===X._case;H&&this.finishNode(H,"SwitchCase"),B.cases.push(H=this.startNode()),H.consequent=[],this.next(),xe?H.test=this.parseExpression():(pe&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),pe=!0,H.test=null),this.expect(X.colon)}else H||this.unexpected(),H.consequent.push(this.parseStatement(null));return this.exitScope(),H&&this.finishNode(H,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(B,"SwitchStatement")},Ue.parseThrowStatement=function(B){return this.next(),$e.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),B.argument=this.parseExpression(),this.semicolon(),this.finishNode(B,"ThrowStatement")};var vt=[];Ue.parseCatchClauseParam=function(){var B=this.parseBindingAtom(),H=B.type==="Identifier";return this.enterScope(H?32:0),this.checkLValPattern(B,H?4:2),this.expect(X.parenR),B},Ue.parseTryStatement=function(B){if(this.next(),B.block=this.parseBlock(),B.handler=null,this.type===X._catch){var H=this.startNode();this.next(),this.eat(X.parenL)?H.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),H.param=null,this.enterScope(0)),H.body=this.parseBlock(!1),this.exitScope(),B.handler=this.finishNode(H,"CatchClause")}return B.finalizer=this.eat(X._finally)?this.parseBlock():null,B.handler||B.finalizer||this.raise(B.start,"Missing catch or finally clause"),this.finishNode(B,"TryStatement")},Ue.parseVarStatement=function(B,H,pe){return this.next(),this.parseVar(B,!1,H,pe),this.semicolon(),this.finishNode(B,"VariableDeclaration")},Ue.parseWhileStatement=function(B){return this.next(),B.test=this.parseParenExpression(),this.labels.push(lt),B.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(B,"WhileStatement")},Ue.parseWithStatement=function(B){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),B.object=this.parseParenExpression(),B.body=this.parseStatement("with"),this.finishNode(B,"WithStatement")},Ue.parseEmptyStatement=function(B){return this.next(),this.finishNode(B,"EmptyStatement")},Ue.parseLabeledStatement=function(B,H,pe,xe){for(var We=0,At=this.labels;We=0;Yt--){var Gn=this.labels[Yt];if(Gn.statementStart!==B.start)break;Gn.statementStart=this.start,Gn.kind=kt}return this.labels.push({name:H,kind:kt,statementStart:this.start}),B.body=this.parseStatement(xe?xe.indexOf("label")===-1?xe+"label":xe:"label"),this.labels.pop(),B.label=pe,this.finishNode(B,"LabeledStatement")},Ue.parseExpressionStatement=function(B,H){return B.expression=H,this.semicolon(),this.finishNode(B,"ExpressionStatement")},Ue.parseBlock=function(B,H,pe){for(B===void 0&&(B=!0),H===void 0&&(H=this.startNode()),H.body=[],this.expect(X.braceL),B&&this.enterScope(0);this.type!==X.braceR;){var xe=this.parseStatement(null);H.body.push(xe)}return pe&&(this.strict=!1),this.next(),B&&this.exitScope(),this.finishNode(H,"BlockStatement")},Ue.parseFor=function(B,H){return B.init=H,this.expect(X.semi),B.test=this.type===X.semi?null:this.parseExpression(),this.expect(X.semi),B.update=this.type===X.parenR?null:this.parseExpression(),this.expect(X.parenR),B.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(B,"ForStatement")},Ue.parseForIn=function(B,H){var pe=this.type===X._in;return this.next(),H.type==="VariableDeclaration"&&H.declarations[0].init!=null&&(!pe||this.options.ecmaVersion<8||this.strict||H.kind!=="var"||H.declarations[0].id.type!=="Identifier")&&this.raise(H.start,(pe?"for-in":"for-of")+" loop variable declaration may not have an initializer"),B.left=H,B.right=pe?this.parseExpression():this.parseMaybeAssign(),this.expect(X.parenR),B.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(B,pe?"ForInStatement":"ForOfStatement")},Ue.parseVar=function(B,H,pe,xe){for(B.declarations=[],B.kind=pe;;){var We=this.startNode();if(this.parseVarId(We,pe),this.eat(X.eq)?We.init=this.parseMaybeAssign(H):xe||pe!=="const"||this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of")?xe||pe!=="using"&&pe!=="await using"||!(this.options.ecmaVersion>=17)||this.type===X._in||this.isContextual("of")?xe||We.id.type==="Identifier"||H&&(this.type===X._in||this.isContextual("of"))?We.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+pe+" declaration"):this.unexpected(),B.declarations.push(this.finishNode(We,"VariableDeclarator")),!this.eat(X.comma))break}return B},Ue.parseVarId=function(B,H){B.id=H==="using"||H==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(B.id,H==="var"?1:2,!1)};var Lt=1,Bt=2;function bn(B,H){var pe=H.key.name,xe=B[pe],We="true";return H.type!=="MethodDefinition"||H.kind!=="get"&&H.kind!=="set"||(We=(H.static?"s":"i")+H.kind),xe==="iget"&&We==="iset"||xe==="iset"&&We==="iget"||xe==="sget"&&We==="sset"||xe==="sset"&&We==="sget"?(B[pe]="true",!1):!!xe||(B[pe]=We,!1)}function yn(B,H){var pe=B.computed,xe=B.key;return!pe&&(xe.type==="Identifier"&&xe.name===H||xe.type==="Literal"&&xe.value===H)}Ue.parseFunction=function(B,H,pe,xe,We){this.initFunction(B),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!xe)&&(this.type===X.star&&H&Bt&&this.unexpected(),B.generator=this.eat(X.star)),this.options.ecmaVersion>=8&&(B.async=!!xe),H&Lt&&(B.id=4&H&&this.type!==X.name?null:this.parseIdent(),!B.id||H&Bt||this.checkLValSimple(B.id,this.strict||B.generator||B.async?this.treatFunctionsAsVar?1:2:3));var At=this.yieldPos,kt=this.awaitPos,Yt=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(dt(B.async,B.generator)),H&Lt||(B.id=this.type===X.name?this.parseIdent():null),this.parseFunctionParams(B),this.parseFunctionBody(B,pe,!1,We),this.yieldPos=At,this.awaitPos=kt,this.awaitIdentPos=Yt,this.finishNode(B,H&Lt?"FunctionDeclaration":"FunctionExpression")},Ue.parseFunctionParams=function(B){this.expect(X.parenL),B.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Ue.parseClass=function(B,H){this.next();var pe=this.strict;this.strict=!0,this.parseClassId(B,H),this.parseClassSuper(B);var xe=this.enterClassBody(),We=this.startNode(),At=!1;for(We.body=[],this.expect(X.braceL);this.type!==X.braceR;){var kt=this.parseClassElement(B.superClass!==null);kt&&(We.body.push(kt),kt.type==="MethodDefinition"&&kt.kind==="constructor"?(At&&this.raiseRecoverable(kt.start,"Duplicate constructor in the same class"),At=!0):kt.key&&kt.key.type==="PrivateIdentifier"&&bn(xe,kt)&&this.raiseRecoverable(kt.key.start,"Identifier '#"+kt.key.name+"' has already been declared"))}return this.strict=pe,this.next(),B.body=this.finishNode(We,"ClassBody"),this.exitClassBody(),this.finishNode(B,H?"ClassDeclaration":"ClassExpression")},Ue.parseClassElement=function(B){if(this.eat(X.semi))return null;var H=this.options.ecmaVersion,pe=this.startNode(),xe="",We=!1,At=!1,kt="method",Yt=!1;if(this.eatContextual("static")){if(H>=13&&this.eat(X.braceL))return this.parseClassStaticBlock(pe),pe;this.isClassElementNameStart()||this.type===X.star?Yt=!0:xe="static"}if(pe.static=Yt,!xe&&H>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==X.star||this.canInsertSemicolon()?xe="async":At=!0),!xe&&(H>=9||!At)&&this.eat(X.star)&&(We=!0),!xe&&!At&&!We){var Gn=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?kt=Gn:xe=Gn)}if(xe?(pe.computed=!1,pe.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),pe.key.name=xe,this.finishNode(pe.key,"Identifier")):this.parseClassElementName(pe),H<13||this.type===X.parenL||kt!=="method"||We||At){var yr=!pe.static&&yn(pe,"constructor"),Ur=yr&&B;yr&&kt!=="method"&&this.raise(pe.key.start,"Constructor can't have get/set modifier"),pe.kind=yr?"constructor":kt,this.parseClassMethod(pe,We,At,Ur)}else this.parseClassField(pe);return pe},Ue.isClassElementNameStart=function(){return this.type===X.name||this.type===X.privateId||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword},Ue.parseClassElementName=function(B){this.type===X.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),B.computed=!1,B.key=this.parsePrivateIdent()):this.parsePropertyName(B)},Ue.parseClassMethod=function(B,H,pe,xe){var We=B.key;B.kind==="constructor"?(H&&this.raise(We.start,"Constructor can't be a generator"),pe&&this.raise(We.start,"Constructor can't be an async method")):B.static&&yn(B,"prototype")&&this.raise(We.start,"Classes may not have a static property named prototype");var At=B.value=this.parseMethod(H,pe,xe);return B.kind==="get"&&At.params.length!==0&&this.raiseRecoverable(At.start,"getter should have no params"),B.kind==="set"&&At.params.length!==1&&this.raiseRecoverable(At.start,"setter should have exactly one param"),B.kind==="set"&&At.params[0].type==="RestElement"&&this.raiseRecoverable(At.params[0].start,"Setter cannot use rest params"),this.finishNode(B,"MethodDefinition")},Ue.parseClassField=function(B){return yn(B,"constructor")?this.raise(B.key.start,"Classes can't have a field named 'constructor'"):B.static&&yn(B,"prototype")&&this.raise(B.key.start,"Classes can't have a static field named 'prototype'"),this.eat(X.eq)?(this.enterScope(576),B.value=this.parseMaybeAssign(),this.exitScope()):B.value=null,this.semicolon(),this.finishNode(B,"PropertyDefinition")},Ue.parseClassStaticBlock=function(B){B.body=[];var H=this.labels;for(this.labels=[],this.enterScope(320);this.type!==X.braceR;){var pe=this.parseStatement(null);B.body.push(pe)}return this.next(),this.exitScope(),this.labels=H,this.finishNode(B,"StaticBlock")},Ue.parseClassId=function(B,H){this.type===X.name?(B.id=this.parseIdent(),H&&this.checkLValSimple(B.id,2,!1)):(H===!0&&this.unexpected(),B.id=null)},Ue.parseClassSuper=function(B){B.superClass=this.eat(X._extends)?this.parseExprSubscripts(null,!1):null},Ue.enterClassBody=function(){var B={declared:Object.create(null),used:[]};return this.privateNameStack.push(B),B.declared},Ue.exitClassBody=function(){var B=this.privateNameStack.pop(),H=B.declared,pe=B.used;if(this.options.checkPrivateFields)for(var xe=this.privateNameStack.length,We=xe===0?null:this.privateNameStack[xe-1],At=0;At=11&&(this.eatContextual("as")?(B.exported=this.parseModuleExportName(),this.checkExport(H,B.exported,this.lastTokStart)):B.exported=null),this.expectContextual("from"),this.type!==X.string&&this.unexpected(),B.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(B.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(B,"ExportAllDeclaration")},Ue.parseExport=function(B,H){if(this.next(),this.eat(X.star))return this.parseExportAllDeclaration(B,H);if(this.eat(X._default))return this.checkExport(H,"default",this.lastTokStart),B.declaration=this.parseExportDefaultDeclaration(),this.finishNode(B,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())B.declaration=this.parseExportDeclaration(B),B.declaration.type==="VariableDeclaration"?this.checkVariableExport(H,B.declaration.declarations):this.checkExport(H,B.declaration.id,B.declaration.id.start),B.specifiers=[],B.source=null,this.options.ecmaVersion>=16&&(B.attributes=[]);else{if(B.declaration=null,B.specifiers=this.parseExportSpecifiers(H),this.eatContextual("from"))this.type!==X.string&&this.unexpected(),B.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(B.attributes=this.parseWithClause());else{for(var pe=0,xe=B.specifiers;pe=16&&(B.attributes=[])}this.semicolon()}return this.finishNode(B,"ExportNamedDeclaration")},Ue.parseExportDeclaration=function(B){return this.parseStatement(null)},Ue.parseExportDefaultDeclaration=function(){var B;if(this.type===X._function||(B=this.isAsyncFunction())){var H=this.startNode();return this.next(),B&&this.next(),this.parseFunction(H,4|Lt,!1,B)}if(this.type===X._class){var pe=this.startNode();return this.parseClass(pe,"nullableID")}var xe=this.parseMaybeAssign();return this.semicolon(),xe},Ue.checkExport=function(B,H,pe){B&&(typeof H!="string"&&(H=H.type==="Identifier"?H.name:H.value),Qt(B,H)&&this.raiseRecoverable(pe,"Duplicate export '"+H+"'"),B[H]=!0)},Ue.checkPatternExport=function(B,H){var pe=H.type;if(pe==="Identifier")this.checkExport(B,H,H.start);else if(pe==="ObjectPattern")for(var xe=0,We=H.properties;xe=16&&(B.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(B,"ImportDeclaration")},Ue.parseImportSpecifier=function(){var B=this.startNode();return B.imported=this.parseModuleExportName(),this.eatContextual("as")?B.local=this.parseIdent():(this.checkUnreserved(B.imported),B.local=B.imported),this.checkLValSimple(B.local,2),this.finishNode(B,"ImportSpecifier")},Ue.parseImportDefaultSpecifier=function(){var B=this.startNode();return B.local=this.parseIdent(),this.checkLValSimple(B.local,2),this.finishNode(B,"ImportDefaultSpecifier")},Ue.parseImportNamespaceSpecifier=function(){var B=this.startNode();return this.next(),this.expectContextual("as"),B.local=this.parseIdent(),this.checkLValSimple(B.local,2),this.finishNode(B,"ImportNamespaceSpecifier")},Ue.parseImportSpecifiers=function(){var B=[],H=!0;if(this.type===X.name&&(B.push(this.parseImportDefaultSpecifier()),!this.eat(X.comma)))return B;if(this.type===X.star)return B.push(this.parseImportNamespaceSpecifier()),B;for(this.expect(X.braceL);!this.eat(X.braceR);){if(H)H=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;B.push(this.parseImportSpecifier())}return B},Ue.parseWithClause=function(){var B=[];if(!this.eat(X._with))return B;this.expect(X.braceL);for(var H={},pe=!0;!this.eat(X.braceR);){if(pe)pe=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;var xe=this.parseImportAttribute(),We=xe.key.type==="Identifier"?xe.key.name:xe.key.value;Qt(H,We)&&this.raiseRecoverable(xe.key.start,"Duplicate attribute key '"+We+"'"),H[We]=!0,B.push(xe)}return B},Ue.parseImportAttribute=function(){var B=this.startNode();return B.key=this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(X.colon),this.type!==X.string&&this.unexpected(),B.value=this.parseExprAtom(),this.finishNode(B,"ImportAttribute")},Ue.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===X.string){var B=this.parseLiteral(this.value);return yt.test(B.value)&&this.raise(B.start,"An export name cannot include a lone surrogate."),B}return this.parseIdent(!0)},Ue.adaptDirectivePrologue=function(B){for(var H=0;H=5&&B.type==="ExpressionStatement"&&B.expression.type==="Literal"&&typeof B.expression.value=="string"&&(this.input[B.start]==='"'||this.input[B.start]==="'")};var xn=gt.prototype;xn.toAssignable=function(B,H,pe){if(this.options.ecmaVersion>=6&&B)switch(B.type){case"Identifier":this.inAsync&&B.name==="await"&&this.raise(B.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":B.type="ObjectPattern",pe&&this.checkPatternErrors(pe,!0);for(var xe=0,We=B.properties;xe=8&&!Yt&&Gn.name==="async"&&!this.canInsertSemicolon()&&this.eat(X._function))return this.overrideContext(Kn.f_expr),this.parseFunction(this.startNodeAt(At,kt),0,!1,!0,H);if(We&&!this.canInsertSemicolon()){if(this.eat(X.arrow))return this.parseArrowExpression(this.startNodeAt(At,kt),[Gn],!1,H);if(this.options.ecmaVersion>=8&&Gn.name==="async"&&this.type===X.name&&!Yt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return Gn=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(X.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(At,kt),[Gn],!0,H)}return Gn;case X.regexp:var yr=this.value;return(xe=this.parseLiteral(yr.value)).regex={pattern:yr.pattern,flags:yr.flags},xe;case X.num:case X.string:return this.parseLiteral(this.value);case X._null:case X._true:case X._false:return(xe=this.startNode()).value=this.type===X._null?null:this.type===X._true,xe.raw=this.type.keyword,this.next(),this.finishNode(xe,"Literal");case X.parenL:var Ur=this.start,Ws=this.parseParenAndDistinguishExpression(We,H);return B&&(B.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Ws)&&(B.parenthesizedAssign=Ur),B.parenthesizedBind<0&&(B.parenthesizedBind=Ur)),Ws;case X.bracketL:return xe=this.startNode(),this.next(),xe.elements=this.parseExprList(X.bracketR,!0,!0,B),this.finishNode(xe,"ArrayExpression");case X.braceL:return this.overrideContext(Kn.b_expr),this.parseObj(!1,B);case X._function:return xe=this.startNode(),this.next(),this.parseFunction(xe,0);case X._class:return this.parseClass(this.startNode(),!1);case X._new:return this.parseNew();case X.backQuote:return this.parseTemplate();case X._import:return this.options.ecmaVersion>=11?this.parseExprImport(pe):this.unexpected();default:return this.parseExprAtomDefault()}},pn.parseExprAtomDefault=function(){this.unexpected()},pn.parseExprImport=function(B){var H=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===X.parenL&&!B)return this.parseDynamicImport(H);if(this.type===X.dot){var pe=this.startNodeAt(H.start,H.loc&&H.loc.start);return pe.name="import",H.meta=this.finishNode(pe,"Identifier"),this.parseImportMeta(H)}this.unexpected()},pn.parseDynamicImport=function(B){if(this.next(),B.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(X.parenR)?B.options=null:(this.expect(X.comma),this.afterTrailingComma(X.parenR)?B.options=null:(B.options=this.parseMaybeAssign(),this.eat(X.parenR)||(this.expect(X.comma),this.afterTrailingComma(X.parenR)||this.unexpected())));else if(!this.eat(X.parenR)){var H=this.start;this.eat(X.comma)&&this.eat(X.parenR)?this.raiseRecoverable(H,"Trailing comma is not allowed in import()"):this.unexpected(H)}return this.finishNode(B,"ImportExpression")},pn.parseImportMeta=function(B){this.next();var H=this.containsEsc;return B.property=this.parseIdent(!0),B.property.name!=="meta"&&this.raiseRecoverable(B.property.start,"The only valid meta property for import is 'import.meta'"),H&&this.raiseRecoverable(B.start,"'import.meta' must not contain escaped characters"),this.options.sourceType==="module"||this.options.allowImportExportEverywhere||this.raiseRecoverable(B.start,"Cannot use 'import.meta' outside a module"),this.finishNode(B,"MetaProperty")},pn.parseLiteral=function(B){var H=this.startNode();return H.value=B,H.raw=this.input.slice(this.start,this.end),H.raw.charCodeAt(H.raw.length-1)===110&&(H.bigint=H.value!=null?H.value.toString():H.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(H,"Literal")},pn.parseParenExpression=function(){this.expect(X.parenL);var B=this.parseExpression();return this.expect(X.parenR),B},pn.shouldParseArrow=function(B){return!this.canInsertSemicolon()},pn.parseParenAndDistinguishExpression=function(B,H){var pe,xe=this.start,We=this.startLoc,At=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var kt,Yt=this.start,Gn=this.startLoc,yr=[],Ur=!0,Ws=!1,vo=new ke,Al=this.yieldPos,Lg=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==X.parenR;){if(Ur?Ur=!1:this.expect(X.comma),At&&this.afterTrailingComma(X.parenR,!0)){Ws=!0;break}if(this.type===X.ellipsis){kt=this.start,yr.push(this.parseParenItem(this.parseRestBinding())),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}yr.push(this.parseMaybeAssign(!1,vo,this.parseParenItem))}var yf=this.lastTokEnd,wp=this.lastTokEndLoc;if(this.expect(X.parenR),B&&this.shouldParseArrow(yr)&&this.eat(X.arrow))return this.checkPatternErrors(vo,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Al,this.awaitPos=Lg,this.parseParenArrowList(xe,We,yr,H);yr.length&&!Ws||this.unexpected(this.lastTokStart),kt&&this.unexpected(kt),this.checkExpressionErrors(vo,!0),this.yieldPos=Al||this.yieldPos,this.awaitPos=Lg||this.awaitPos,yr.length>1?((pe=this.startNodeAt(Yt,Gn)).expressions=yr,this.finishNodeAt(pe,"SequenceExpression",yf,wp)):pe=yr[0]}else pe=this.parseParenExpression();if(this.options.preserveParens){var xm=this.startNodeAt(xe,We);return xm.expression=pe,this.finishNode(xm,"ParenthesizedExpression")}return pe},pn.parseParenItem=function(B){return B},pn.parseParenArrowList=function(B,H,pe,xe){return this.parseArrowExpression(this.startNodeAt(B,H),pe,!1,xe)};var Wr=[];pn.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var B=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===X.dot){var H=this.startNodeAt(B.start,B.loc&&B.loc.start);H.name="new",B.meta=this.finishNode(H,"Identifier"),this.next();var pe=this.containsEsc;return B.property=this.parseIdent(!0),B.property.name!=="target"&&this.raiseRecoverable(B.property.start,"The only valid meta property for new is 'new.target'"),pe&&this.raiseRecoverable(B.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(B.start,"'new.target' can only be used in functions and class static block"),this.finishNode(B,"MetaProperty")}var xe=this.start,We=this.startLoc;return B.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),xe,We,!0,!1),this.eat(X.parenL)?B.arguments=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1):B.arguments=Wr,this.finishNode(B,"NewExpression")},pn.parseTemplateElement=function(B){var H=B.isTagged,pe=this.startNode();return this.type===X.invalidTemplate?(H||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),pe.value={raw:this.value.replace(/\r\n?/g,` +`),cooked:null}):pe.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` +`),cooked:this.value},this.next(),pe.tail=this.type===X.backQuote,this.finishNode(pe,"TemplateElement")},pn.parseTemplate=function(B){B===void 0&&(B={});var H=B.isTagged;H===void 0&&(H=!1);var pe=this.startNode();this.next(),pe.expressions=[];var xe=this.parseTemplateElement({isTagged:H});for(pe.quasis=[xe];!xe.tail;)this.type===X.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(X.dollarBraceL),pe.expressions.push(this.parseExpression()),this.expect(X.braceR),pe.quasis.push(xe=this.parseTemplateElement({isTagged:H}));return this.next(),this.finishNode(pe,"TemplateLiteral")},pn.isAsyncProp=function(B){return!B.computed&&B.key.type==="Identifier"&&B.key.name==="async"&&(this.type===X.name||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===X.star)&&!$e.test(this.input.slice(this.lastTokEnd,this.start))},pn.parseObj=function(B,H){var pe=this.startNode(),xe=!0,We={};for(pe.properties=[],this.next();!this.eat(X.braceR);){if(xe)xe=!1;else if(this.expect(X.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(X.braceR))break;var At=this.parseProperty(B,H);B||this.checkPropClash(At,We,H),pe.properties.push(At)}return this.finishNode(pe,B?"ObjectPattern":"ObjectExpression")},pn.parseProperty=function(B,H){var pe,xe,We,At,kt=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(X.ellipsis))return B?(kt.argument=this.parseIdent(!1),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(kt,"RestElement")):(kt.argument=this.parseMaybeAssign(!1,H),this.type===X.comma&&H&&H.trailingComma<0&&(H.trailingComma=this.start),this.finishNode(kt,"SpreadElement"));this.options.ecmaVersion>=6&&(kt.method=!1,kt.shorthand=!1,(B||H)&&(We=this.start,At=this.startLoc),B||(pe=this.eat(X.star)));var Yt=this.containsEsc;return this.parsePropertyName(kt),!B&&!Yt&&this.options.ecmaVersion>=8&&!pe&&this.isAsyncProp(kt)?(xe=!0,pe=this.options.ecmaVersion>=9&&this.eat(X.star),this.parsePropertyName(kt)):xe=!1,this.parsePropertyValue(kt,B,pe,xe,We,At,H,Yt),this.finishNode(kt,"Property")},pn.parseGetterSetter=function(B){var H=B.key.name;this.parsePropertyName(B),B.value=this.parseMethod(!1),B.kind=H;var pe=B.kind==="get"?0:1;if(B.value.params.length!==pe){var xe=B.value.start;B.kind==="get"?this.raiseRecoverable(xe,"getter should have no params"):this.raiseRecoverable(xe,"setter should have exactly one param")}else B.kind==="set"&&B.value.params[0].type==="RestElement"&&this.raiseRecoverable(B.value.params[0].start,"Setter cannot use rest params")},pn.parsePropertyValue=function(B,H,pe,xe,We,At,kt,Yt){(pe||xe)&&this.type===X.colon&&this.unexpected(),this.eat(X.colon)?(B.value=H?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,kt),B.kind="init"):this.options.ecmaVersion>=6&&this.type===X.parenL?(H&&this.unexpected(),B.method=!0,B.value=this.parseMethod(pe,xe),B.kind="init"):H||Yt||!(this.options.ecmaVersion>=5)||B.computed||B.key.type!=="Identifier"||B.key.name!=="get"&&B.key.name!=="set"||this.type===X.comma||this.type===X.braceR||this.type===X.eq?this.options.ecmaVersion>=6&&!B.computed&&B.key.type==="Identifier"?((pe||xe)&&this.unexpected(),this.checkUnreserved(B.key),B.key.name!=="await"||this.awaitIdentPos||(this.awaitIdentPos=We),H?B.value=this.parseMaybeDefault(We,At,this.copyNode(B.key)):this.type===X.eq&&kt?(kt.shorthandAssign<0&&(kt.shorthandAssign=this.start),B.value=this.parseMaybeDefault(We,At,this.copyNode(B.key))):B.value=this.copyNode(B.key),B.kind="init",B.shorthand=!0):this.unexpected():((pe||xe)&&this.unexpected(),this.parseGetterSetter(B))},pn.parsePropertyName=function(B){if(this.options.ecmaVersion>=6){if(this.eat(X.bracketL))return B.computed=!0,B.key=this.parseMaybeAssign(),this.expect(X.bracketR),B.key;B.computed=!1}return B.key=this.type===X.num||this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},pn.initFunction=function(B){B.id=null,this.options.ecmaVersion>=6&&(B.generator=B.expression=!1),this.options.ecmaVersion>=8&&(B.async=!1)},pn.parseMethod=function(B,H,pe){var xe=this.startNode(),We=this.yieldPos,At=this.awaitPos,kt=this.awaitIdentPos;return this.initFunction(xe),this.options.ecmaVersion>=6&&(xe.generator=B),this.options.ecmaVersion>=8&&(xe.async=!!H),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|dt(H,xe.generator)|(pe?128:0)),this.expect(X.parenL),xe.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(xe,!1,!0,!1),this.yieldPos=We,this.awaitPos=At,this.awaitIdentPos=kt,this.finishNode(xe,"FunctionExpression")},pn.parseArrowExpression=function(B,H,pe,xe){var We=this.yieldPos,At=this.awaitPos,kt=this.awaitIdentPos;return this.enterScope(16|dt(pe,!1)),this.initFunction(B),this.options.ecmaVersion>=8&&(B.async=!!pe),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,B.params=this.toAssignableList(H,!0),this.parseFunctionBody(B,!0,!1,xe),this.yieldPos=We,this.awaitPos=At,this.awaitIdentPos=kt,this.finishNode(B,"ArrowFunctionExpression")},pn.parseFunctionBody=function(B,H,pe,xe){var We=H&&this.type!==X.braceL,At=this.strict,kt=!1;if(We)B.body=this.parseMaybeAssign(xe),B.expression=!0,this.checkParams(B,!1);else{var Yt=this.options.ecmaVersion>=7&&!this.isSimpleParamList(B.params);At&&!Yt||(kt=this.strictDirective(this.end))&&Yt&&this.raiseRecoverable(B.start,"Illegal 'use strict' directive in function with non-simple parameter list");var Gn=this.labels;this.labels=[],kt&&(this.strict=!0),this.checkParams(B,!At&&!kt&&!H&&!pe&&this.isSimpleParamList(B.params)),this.strict&&B.id&&this.checkLValSimple(B.id,5),B.body=this.parseBlock(!1,void 0,kt&&!At),B.expression=!1,this.adaptDirectivePrologue(B.body.body),this.labels=Gn}this.exitScope()},pn.isSimpleParamList=function(B){for(var H=0,pe=B;H-1||We.functions.indexOf(B)>-1||We.var.indexOf(B)>-1,We.lexical.push(B),this.inModule&&1&We.flags&&delete this.undefinedExports[B]}else if(H===4)this.currentScope().lexical.push(B);else if(H===3){var At=this.currentScope();xe=this.treatFunctionsAsVar?At.lexical.indexOf(B)>-1:At.lexical.indexOf(B)>-1||At.var.indexOf(B)>-1,At.functions.push(B)}else for(var kt=this.scopeStack.length-1;kt>=0;--kt){var Yt=this.scopeStack[kt];if(Yt.lexical.indexOf(B)>-1&&!(32&Yt.flags&&Yt.lexical[0]===B)||!this.treatFunctionsAsVarInScope(Yt)&&Yt.functions.indexOf(B)>-1){xe=!0;break}if(Yt.var.push(B),this.inModule&&1&Yt.flags&&delete this.undefinedExports[B],Yt.flags&Ze)break}xe&&this.raiseRecoverable(pe,"Identifier '"+B+"' has already been declared")},Ps.checkLocalExport=function(B){this.scopeStack[0].lexical.indexOf(B.name)===-1&&this.scopeStack[0].var.indexOf(B.name)===-1&&(this.undefinedExports[B.name]=B)},Ps.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Ps.currentVarScope=function(){for(var B=this.scopeStack.length-1;;B--){var H=this.scopeStack[B];if(771&H.flags)return H}},Ps.currentThisScope=function(){for(var B=this.scopeStack.length-1;;B--){var H=this.scopeStack[B];if(771&H.flags&&!(16&H.flags))return H}};var os=function(B,H,pe){this.type="",this.start=H,this.end=0,B.options.locations&&(this.loc=new dn(B,pe)),B.options.directSourceFile&&(this.sourceFile=B.options.directSourceFile),B.options.ranges&&(this.range=[H,0])},To=gt.prototype;function mi(B,H,pe,xe){return B.type=H,B.end=pe,this.options.locations&&(B.loc.end=xe),this.options.ranges&&(B.range[1]=pe),B}To.startNode=function(){return new os(this,this.start,this.startLoc)},To.startNodeAt=function(B,H){return new os(this,B,H)},To.finishNode=function(B,H){return mi.call(this,B,H,this.lastTokEnd,this.lastTokEndLoc)},To.finishNodeAt=function(B,H,pe,xe){return mi.call(this,B,H,pe,xe)},To.copyNode=function(B){var H=new os(this,B.start,this.startLoc);for(var pe in B)H[pe]=B[pe];return H};var Yn="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Sp=Yn+" Extended_Pictographic",Vd=Sp+" EBase EComp EMod EPres ExtPict",Am={9:Yn,10:Sp,11:Sp,12:Vd,13:Vd,14:Vd},Yd={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},ym="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",_c="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Jt=_c+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Xt=Jt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Dn=Xt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Wn=Dn+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",lr={9:_c,10:Jt,11:Xt,12:Dn,13:Wn,14:Wn+" Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz"},Qr={};function Sr(B){var H=Qr[B]={binary:Me(Am[B]+" "+ym),binaryOfStrings:Me(Yd[B]),nonBinary:{General_Category:Me(ym),Script:Me(lr[B])}};H.nonBinary.Script_Extensions=H.nonBinary.Script,H.nonBinary.gc=H.nonBinary.General_Category,H.nonBinary.sc=H.nonBinary.Script,H.nonBinary.scx=H.nonBinary.Script_Extensions}for(var Jn=0,_i=[9,10,11,12,13,14];Jn<_i.length;Jn+=1)Sr(_i[Jn]);var mn=gt.prototype,$s=function(B,H){this.parent=B,this.base=H||this};$s.prototype.separatedFrom=function(B){for(var H=this;H;H=H.parent)for(var pe=B;pe;pe=pe.parent)if(H.base===pe.base&&H!==pe)return!0;return!1},$s.prototype.sibling=function(){return new $s(this.parent,this.base)};var Nr=function(B){this.parser=B,this.validFlags="gim"+(B.options.ecmaVersion>=6?"uy":"")+(B.options.ecmaVersion>=9?"s":"")+(B.options.ecmaVersion>=13?"d":"")+(B.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Qr[B.options.ecmaVersion>=14?14:B.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function Ms(B){return B===105||B===109||B===115}function ga(B){return B===36||B>=40&&B<=43||B===46||B===63||B>=91&&B<=94||B>=123&&B<=125}function va(B){return B>=65&&B<=90||B>=97&&B<=122}Nr.prototype.reset=function(B,H,pe){var xe=pe.indexOf("v")!==-1,We=pe.indexOf("u")!==-1;this.start=0|B,this.source=H+"",this.flags=pe,xe&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=We&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=We&&this.parser.options.ecmaVersion>=9)},Nr.prototype.raise=function(B){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+B)},Nr.prototype.at=function(B,H){H===void 0&&(H=!1);var pe=this.source,xe=pe.length;if(B>=xe)return-1;var We=pe.charCodeAt(B);if(!H&&!this.switchU||We<=55295||We>=57344||B+1>=xe)return We;var At=pe.charCodeAt(B+1);return At>=56320&&At<=57343?(We<<10)+At-56613888:We},Nr.prototype.nextIndex=function(B,H){H===void 0&&(H=!1);var pe=this.source,xe=pe.length;if(B>=xe)return xe;var We,At=pe.charCodeAt(B);return!H&&!this.switchU||At<=55295||At>=57344||B+1>=xe||(We=pe.charCodeAt(B+1))<56320||We>57343?B+1:B+2},Nr.prototype.current=function(B){return B===void 0&&(B=!1),this.at(this.pos,B)},Nr.prototype.lookahead=function(B){return B===void 0&&(B=!1),this.at(this.nextIndex(this.pos,B),B)},Nr.prototype.advance=function(B){B===void 0&&(B=!1),this.pos=this.nextIndex(this.pos,B)},Nr.prototype.eat=function(B,H){return H===void 0&&(H=!1),this.current(H)===B&&(this.advance(H),!0)},Nr.prototype.eatChars=function(B,H){H===void 0&&(H=!1);for(var pe=this.pos,xe=0,We=B;xe-1&&this.raise(B.start,"Duplicate regular expression flag"),kt==="u"&&(xe=!0),kt==="v"&&(We=!0)}this.options.ecmaVersion>=15&&xe&&We&&this.raise(B.start,"Invalid regular expression flag")},mn.validateRegExpPattern=function(B){this.regexp_pattern(B),!B.switchN&&this.options.ecmaVersion>=9&&(function(H){for(var pe in H)return!0;return!1})(B.groupNames)&&(B.switchN=!0,this.regexp_pattern(B))},mn.regexp_pattern=function(B){B.pos=0,B.lastIntValue=0,B.lastStringValue="",B.lastAssertionIsQuantifiable=!1,B.numCapturingParens=0,B.maxBackReference=0,B.groupNames=Object.create(null),B.backReferenceNames.length=0,B.branchID=null,this.regexp_disjunction(B),B.pos!==B.source.length&&(B.eat(41)&&B.raise("Unmatched ')'"),(B.eat(93)||B.eat(125))&&B.raise("Lone quantifier brackets")),B.maxBackReference>B.numCapturingParens&&B.raise("Invalid escape");for(var H=0,pe=B.backReferenceNames;H=16;for(H&&(B.branchID=new $s(B.branchID,null)),this.regexp_alternative(B);B.eat(124);)H&&(B.branchID=B.branchID.sibling()),this.regexp_alternative(B);H&&(B.branchID=B.branchID.parent),this.regexp_eatQuantifier(B,!0)&&B.raise("Nothing to repeat"),B.eat(123)&&B.raise("Lone quantifier brackets")},mn.regexp_alternative=function(B){for(;B.pos=9&&(pe=B.eat(60)),B.eat(61)||B.eat(33))return this.regexp_disjunction(B),B.eat(41)||B.raise("Unterminated group"),B.lastAssertionIsQuantifiable=!pe,!0}return B.pos=H,!1},mn.regexp_eatQuantifier=function(B,H){return H===void 0&&(H=!1),!!this.regexp_eatQuantifierPrefix(B,H)&&(B.eat(63),!0)},mn.regexp_eatQuantifierPrefix=function(B,H){return B.eat(42)||B.eat(43)||B.eat(63)||this.regexp_eatBracedQuantifier(B,H)},mn.regexp_eatBracedQuantifier=function(B,H){var pe=B.pos;if(B.eat(123)){var xe=0,We=-1;if(this.regexp_eatDecimalDigits(B)&&(xe=B.lastIntValue,B.eat(44)&&this.regexp_eatDecimalDigits(B)&&(We=B.lastIntValue),B.eat(125)))return We!==-1&&We=16){var pe=this.regexp_eatModifiers(B),xe=B.eat(45);if(pe||xe){for(var We=0;We-1&&B.raise("Duplicate regular expression modifiers")}if(xe){var kt=this.regexp_eatModifiers(B);pe||kt||B.current()!==58||B.raise("Invalid regular expression modifiers");for(var Yt=0;Yt-1||pe.indexOf(Gn)>-1)&&B.raise("Duplicate regular expression modifiers")}}}}if(B.eat(58)){if(this.regexp_disjunction(B),B.eat(41))return!0;B.raise("Unterminated group")}}B.pos=H}return!1},mn.regexp_eatCapturingGroup=function(B){if(B.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(B):B.current()===63&&B.raise("Invalid group"),this.regexp_disjunction(B),B.eat(41))return B.numCapturingParens+=1,!0;B.raise("Unterminated group")}return!1},mn.regexp_eatModifiers=function(B){for(var H="",pe=0;(pe=B.current())!==-1&&Ms(pe);)H+=Je(pe),B.advance();return H},mn.regexp_eatExtendedAtom=function(B){return B.eat(46)||this.regexp_eatReverseSolidusAtomEscape(B)||this.regexp_eatCharacterClass(B)||this.regexp_eatUncapturingGroup(B)||this.regexp_eatCapturingGroup(B)||this.regexp_eatInvalidBracedQuantifier(B)||this.regexp_eatExtendedPatternCharacter(B)},mn.regexp_eatInvalidBracedQuantifier=function(B){return this.regexp_eatBracedQuantifier(B,!0)&&B.raise("Nothing to repeat"),!1},mn.regexp_eatSyntaxCharacter=function(B){var H=B.current();return!!ga(H)&&(B.lastIntValue=H,B.advance(),!0)},mn.regexp_eatPatternCharacters=function(B){for(var H=B.pos,pe=0;(pe=B.current())!==-1&&!ga(pe);)B.advance();return B.pos!==H},mn.regexp_eatExtendedPatternCharacter=function(B){var H=B.current();return!(H===-1||H===36||H>=40&&H<=43||H===46||H===63||H===91||H===94||H===124)&&(B.advance(),!0)},mn.regexp_groupSpecifier=function(B){if(B.eat(63)){this.regexp_eatGroupName(B)||B.raise("Invalid group");var H=this.options.ecmaVersion>=16,pe=B.groupNames[B.lastStringValue];if(pe)if(H)for(var xe=0,We=pe;xe=11,xe=B.current(pe);return B.advance(pe),xe===92&&this.regexp_eatRegExpUnicodeEscapeSequence(B,pe)&&(xe=B.lastIntValue),(function(We){return me(We,!0)||We===36||We===95})(xe)?(B.lastIntValue=xe,!0):(B.pos=H,!1)},mn.regexp_eatRegExpIdentifierPart=function(B){var H=B.pos,pe=this.options.ecmaVersion>=11,xe=B.current(pe);return B.advance(pe),xe===92&&this.regexp_eatRegExpUnicodeEscapeSequence(B,pe)&&(xe=B.lastIntValue),(function(We){return ge(We,!0)||We===36||We===95||We===8204||We===8205})(xe)?(B.lastIntValue=xe,!0):(B.pos=H,!1)},mn.regexp_eatAtomEscape=function(B){return!!(this.regexp_eatBackReference(B)||this.regexp_eatCharacterClassEscape(B)||this.regexp_eatCharacterEscape(B)||B.switchN&&this.regexp_eatKGroupName(B))||(B.switchU&&(B.current()===99&&B.raise("Invalid unicode escape"),B.raise("Invalid escape")),!1)},mn.regexp_eatBackReference=function(B){var H=B.pos;if(this.regexp_eatDecimalEscape(B)){var pe=B.lastIntValue;if(B.switchU)return pe>B.maxBackReference&&(B.maxBackReference=pe),!0;if(pe<=B.numCapturingParens)return!0;B.pos=H}return!1},mn.regexp_eatKGroupName=function(B){if(B.eat(107)){if(this.regexp_eatGroupName(B))return B.backReferenceNames.push(B.lastStringValue),!0;B.raise("Invalid named reference")}return!1},mn.regexp_eatCharacterEscape=function(B){return this.regexp_eatControlEscape(B)||this.regexp_eatCControlLetter(B)||this.regexp_eatZero(B)||this.regexp_eatHexEscapeSequence(B)||this.regexp_eatRegExpUnicodeEscapeSequence(B,!1)||!B.switchU&&this.regexp_eatLegacyOctalEscapeSequence(B)||this.regexp_eatIdentityEscape(B)},mn.regexp_eatCControlLetter=function(B){var H=B.pos;if(B.eat(99)){if(this.regexp_eatControlLetter(B))return!0;B.pos=H}return!1},mn.regexp_eatZero=function(B){return B.current()===48&&!ka(B.lookahead())&&(B.lastIntValue=0,B.advance(),!0)},mn.regexp_eatControlEscape=function(B){var H=B.current();return H===116?(B.lastIntValue=9,B.advance(),!0):H===110?(B.lastIntValue=10,B.advance(),!0):H===118?(B.lastIntValue=11,B.advance(),!0):H===102?(B.lastIntValue=12,B.advance(),!0):H===114&&(B.lastIntValue=13,B.advance(),!0)},mn.regexp_eatControlLetter=function(B){var H=B.current();return!!va(H)&&(B.lastIntValue=H%32,B.advance(),!0)},mn.regexp_eatRegExpUnicodeEscapeSequence=function(B,H){H===void 0&&(H=!1);var pe,xe=B.pos,We=H||B.switchU;if(B.eat(117)){if(this.regexp_eatFixedHexDigits(B,4)){var At=B.lastIntValue;if(We&&At>=55296&&At<=56319){var kt=B.pos;if(B.eat(92)&&B.eat(117)&&this.regexp_eatFixedHexDigits(B,4)){var Yt=B.lastIntValue;if(Yt>=56320&&Yt<=57343)return B.lastIntValue=1024*(At-55296)+(Yt-56320)+65536,!0}B.pos=kt,B.lastIntValue=At}return!0}if(We&&B.eat(123)&&this.regexp_eatHexDigits(B)&&B.eat(125)&&(pe=B.lastIntValue)>=0&&pe<=1114111)return!0;We&&B.raise("Invalid unicode escape"),B.pos=xe}return!1},mn.regexp_eatIdentityEscape=function(B){if(B.switchU)return!!this.regexp_eatSyntaxCharacter(B)||!!B.eat(47)&&(B.lastIntValue=47,!0);var H=B.current();return!(H===99||B.switchN&&H===107)&&(B.lastIntValue=H,B.advance(),!0)},mn.regexp_eatDecimalEscape=function(B){B.lastIntValue=0;var H=B.current();if(H>=49&&H<=57){do B.lastIntValue=10*B.lastIntValue+(H-48),B.advance();while((H=B.current())>=48&&H<=57);return!0}return!1};function Dr(B){return va(B)||B===95}function Ra(B){return Dr(B)||ka(B)}function ka(B){return B>=48&&B<=57}function Cp(B){return B>=48&&B<=57||B>=65&&B<=70||B>=97&&B<=102}function Hn(B){return B>=65&&B<=70?B-65+10:B>=97&&B<=102?B-97+10:B-48}function Em(B){return B>=48&&B<=55}mn.regexp_eatCharacterClassEscape=function(B){var H=B.current();if((function(We){return We===100||We===68||We===115||We===83||We===119||We===87})(H))return B.lastIntValue=-1,B.advance(),1;var pe=!1;if(B.switchU&&this.options.ecmaVersion>=9&&((pe=H===80)||H===112)){var xe;if(B.lastIntValue=-1,B.advance(),B.eat(123)&&(xe=this.regexp_eatUnicodePropertyValueExpression(B))&&B.eat(125))return pe&&xe===2&&B.raise("Invalid property name"),xe;B.raise("Invalid property name")}return 0},mn.regexp_eatUnicodePropertyValueExpression=function(B){var H=B.pos;if(this.regexp_eatUnicodePropertyName(B)&&B.eat(61)){var pe=B.lastStringValue;if(this.regexp_eatUnicodePropertyValue(B)){var xe=B.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(B,pe,xe),1}}if(B.pos=H,this.regexp_eatLoneUnicodePropertyNameOrValue(B)){var We=B.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(B,We)}return 0},mn.regexp_validateUnicodePropertyNameAndValue=function(B,H,pe){Qt(B.unicodeProperties.nonBinary,H)||B.raise("Invalid property name"),B.unicodeProperties.nonBinary[H].test(pe)||B.raise("Invalid property value")},mn.regexp_validateUnicodePropertyNameOrValue=function(B,H){return B.unicodeProperties.binary.test(H)?1:B.switchV&&B.unicodeProperties.binaryOfStrings.test(H)?2:void B.raise("Invalid property name")},mn.regexp_eatUnicodePropertyName=function(B){var H=0;for(B.lastStringValue="";Dr(H=B.current());)B.lastStringValue+=Je(H),B.advance();return B.lastStringValue!==""},mn.regexp_eatUnicodePropertyValue=function(B){var H=0;for(B.lastStringValue="";Ra(H=B.current());)B.lastStringValue+=Je(H),B.advance();return B.lastStringValue!==""},mn.regexp_eatLoneUnicodePropertyNameOrValue=function(B){return this.regexp_eatUnicodePropertyValue(B)},mn.regexp_eatCharacterClass=function(B){if(B.eat(91)){var H=B.eat(94),pe=this.regexp_classContents(B);return B.eat(93)||B.raise("Unterminated character class"),H&&pe===2&&B.raise("Negated character class may contain strings"),!0}return!1},mn.regexp_classContents=function(B){return B.current()===93?1:B.switchV?this.regexp_classSetExpression(B):(this.regexp_nonEmptyClassRanges(B),1)},mn.regexp_nonEmptyClassRanges=function(B){for(;this.regexp_eatClassAtom(B);){var H=B.lastIntValue;if(B.eat(45)&&this.regexp_eatClassAtom(B)){var pe=B.lastIntValue;!B.switchU||H!==-1&&pe!==-1||B.raise("Invalid character class"),H!==-1&&pe!==-1&&H>pe&&B.raise("Range out of order in character class")}}},mn.regexp_eatClassAtom=function(B){var H=B.pos;if(B.eat(92)){if(this.regexp_eatClassEscape(B))return!0;if(B.switchU){var pe=B.current();(pe===99||Em(pe))&&B.raise("Invalid class escape"),B.raise("Invalid escape")}B.pos=H}var xe=B.current();return xe!==93&&(B.lastIntValue=xe,B.advance(),!0)},mn.regexp_eatClassEscape=function(B){var H=B.pos;if(B.eat(98))return B.lastIntValue=8,!0;if(B.switchU&&B.eat(45))return B.lastIntValue=45,!0;if(!B.switchU&&B.eat(99)){if(this.regexp_eatClassControlLetter(B))return!0;B.pos=H}return this.regexp_eatCharacterClassEscape(B)||this.regexp_eatCharacterEscape(B)},mn.regexp_classSetExpression=function(B){var H,pe=1;if(!this.regexp_eatClassSetRange(B))if(H=this.regexp_eatClassSetOperand(B)){H===2&&(pe=2);for(var xe=B.pos;B.eatChars([38,38]);)B.current()!==38&&(H=this.regexp_eatClassSetOperand(B))?H!==2&&(pe=1):B.raise("Invalid character in character class");if(xe!==B.pos)return pe;for(;B.eatChars([45,45]);)this.regexp_eatClassSetOperand(B)||B.raise("Invalid character in character class");if(xe!==B.pos)return pe}else B.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(B)){if(!(H=this.regexp_eatClassSetOperand(B)))return pe;H===2&&(pe=2)}},mn.regexp_eatClassSetRange=function(B){var H=B.pos;if(this.regexp_eatClassSetCharacter(B)){var pe=B.lastIntValue;if(B.eat(45)&&this.regexp_eatClassSetCharacter(B)){var xe=B.lastIntValue;return pe!==-1&&xe!==-1&&pe>xe&&B.raise("Range out of order in character class"),!0}B.pos=H}return!1},mn.regexp_eatClassSetOperand=function(B){return this.regexp_eatClassSetCharacter(B)?1:this.regexp_eatClassStringDisjunction(B)||this.regexp_eatNestedClass(B)},mn.regexp_eatNestedClass=function(B){var H=B.pos;if(B.eat(91)){var pe=B.eat(94),xe=this.regexp_classContents(B);if(B.eat(93))return pe&&xe===2&&B.raise("Negated character class may contain strings"),xe;B.pos=H}if(B.eat(92)){var We=this.regexp_eatCharacterClassEscape(B);if(We)return We;B.pos=H}return null},mn.regexp_eatClassStringDisjunction=function(B){var H=B.pos;if(B.eatChars([92,113])){if(B.eat(123)){var pe=this.regexp_classStringDisjunctionContents(B);if(B.eat(125))return pe}else B.raise("Invalid escape");B.pos=H}return null},mn.regexp_classStringDisjunctionContents=function(B){for(var H=this.regexp_classString(B);B.eat(124);)this.regexp_classString(B)===2&&(H=2);return H},mn.regexp_classString=function(B){for(var H=0;this.regexp_eatClassSetCharacter(B);)H++;return H===1?1:2},mn.regexp_eatClassSetCharacter=function(B){var H=B.pos;if(B.eat(92))return!(!this.regexp_eatCharacterEscape(B)&&!this.regexp_eatClassSetReservedPunctuator(B))||(B.eat(98)?(B.lastIntValue=8,!0):(B.pos=H,!1));var pe=B.current();return!(pe<0||pe===B.lookahead()&&(function(xe){return xe===33||xe>=35&&xe<=38||xe>=42&&xe<=44||xe===46||xe>=58&&xe<=64||xe===94||xe===96||xe===126})(pe))&&!(function(xe){return xe===40||xe===41||xe===45||xe===47||xe>=91&&xe<=93||xe>=123&&xe<=125})(pe)&&(B.advance(),B.lastIntValue=pe,!0)},mn.regexp_eatClassSetReservedPunctuator=function(B){var H=B.current();return!!(function(pe){return pe===33||pe===35||pe===37||pe===38||pe===44||pe===45||pe>=58&&pe<=62||pe===64||pe===96||pe===126})(H)&&(B.lastIntValue=H,B.advance(),!0)},mn.regexp_eatClassControlLetter=function(B){var H=B.current();return!(!ka(H)&&H!==95)&&(B.lastIntValue=H%32,B.advance(),!0)},mn.regexp_eatHexEscapeSequence=function(B){var H=B.pos;if(B.eat(120)){if(this.regexp_eatFixedHexDigits(B,2))return!0;B.switchU&&B.raise("Invalid escape"),B.pos=H}return!1},mn.regexp_eatDecimalDigits=function(B){var H=B.pos,pe=0;for(B.lastIntValue=0;ka(pe=B.current());)B.lastIntValue=10*B.lastIntValue+(pe-48),B.advance();return B.pos!==H},mn.regexp_eatHexDigits=function(B){var H=B.pos,pe=0;for(B.lastIntValue=0;Cp(pe=B.current());)B.lastIntValue=16*B.lastIntValue+Hn(pe),B.advance();return B.pos!==H},mn.regexp_eatLegacyOctalEscapeSequence=function(B){if(this.regexp_eatOctalDigit(B)){var H=B.lastIntValue;if(this.regexp_eatOctalDigit(B)){var pe=B.lastIntValue;H<=3&&this.regexp_eatOctalDigit(B)?B.lastIntValue=64*H+8*pe+B.lastIntValue:B.lastIntValue=8*H+pe}else B.lastIntValue=H;return!0}return!1},mn.regexp_eatOctalDigit=function(B){var H=B.current();return Em(H)?(B.lastIntValue=H-48,B.advance(),!0):(B.lastIntValue=0,!1)},mn.regexp_eatFixedHexDigits=function(B,H){var pe=B.pos;B.lastIntValue=0;for(var xe=0;xe=this.input.length?this.finishToken(X.eof):B.override?B.override(this):void this.readToken(this.fullCharCodeAtPos())},ci.readToken=function(B){return me(B,this.options.ecmaVersion>=6)||B===92?this.readWord():this.getTokenFromCode(B)},ci.fullCharCodeAt=function(B){var H=this.input.charCodeAt(B);if(H<=55295||H>=56320)return H;var pe=this.input.charCodeAt(B+1);return pe<=56319||pe>=57344?H:(H<<10)+pe-56613888},ci.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},ci.skipBlockComment=function(){var B=this.options.onComment&&this.curPosition(),H=this.pos,pe=this.input.indexOf("*/",this.pos+=2);if(pe===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=pe+2,this.options.locations)for(var xe=void 0,We=H;(xe=st(this.input,We,this.pos))>-1;)++this.curLine,We=this.lineStart=xe;this.options.onComment&&this.options.onComment(!0,this.input.slice(H+2,pe),H,this.pos,B,this.curPosition())},ci.skipLineComment=function(B){for(var H=this.pos,pe=this.options.onComment&&this.curPosition(),xe=this.input.charCodeAt(this.pos+=B);this.pos8&&B<14||B>=5760&&ze.test(String.fromCharCode(B))))break e;++this.pos}}},ci.finishToken=function(B,H){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var pe=this.type;this.type=B,this.value=H,this.updateContext(pe)},ci.readToken_dot=function(){var B=this.input.charCodeAt(this.pos+1);if(B>=48&&B<=57)return this.readNumber(!0);var H=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&B===46&&H===46?(this.pos+=3,this.finishToken(X.ellipsis)):(++this.pos,this.finishToken(X.dot))},ci.readToken_slash=function(){var B=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):B===61?this.finishOp(X.assign,2):this.finishOp(X.slash,1)},ci.readToken_mult_modulo_exp=function(B){var H=this.input.charCodeAt(this.pos+1),pe=1,xe=B===42?X.star:X.modulo;return this.options.ecmaVersion>=7&&B===42&&H===42&&(++pe,xe=X.starstar,H=this.input.charCodeAt(this.pos+2)),H===61?this.finishOp(X.assign,pe+1):this.finishOp(xe,pe)},ci.readToken_pipe_amp=function(B){var H=this.input.charCodeAt(this.pos+1);return H===B?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(X.assign,3):this.finishOp(B===124?X.logicalOR:X.logicalAND,2):H===61?this.finishOp(X.assign,2):this.finishOp(B===124?X.bitwiseOR:X.bitwiseAND,1)},ci.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(X.assign,2):this.finishOp(X.bitwiseXOR,1)},ci.readToken_plus_min=function(B){var H=this.input.charCodeAt(this.pos+1);return H===B?H!==45||this.inModule||this.input.charCodeAt(this.pos+2)!==62||this.lastTokEnd!==0&&!$e.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(X.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):H===61?this.finishOp(X.assign,2):this.finishOp(X.plusMin,1)},ci.readToken_lt_gt=function(B){var H=this.input.charCodeAt(this.pos+1),pe=1;return H===B?(pe=B===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+pe)===61?this.finishOp(X.assign,pe+1):this.finishOp(X.bitShift,pe)):H!==33||B!==60||this.inModule||this.input.charCodeAt(this.pos+2)!==45||this.input.charCodeAt(this.pos+3)!==45?(H===61&&(pe=2),this.finishOp(X.relational,pe)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},ci.readToken_eq_excl=function(B){var H=this.input.charCodeAt(this.pos+1);return H===61?this.finishOp(X.equality,this.input.charCodeAt(this.pos+2)===61?3:2):B===61&&H===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(X.arrow)):this.finishOp(B===61?X.eq:X.prefix,1)},ci.readToken_question=function(){var B=this.options.ecmaVersion;if(B>=11){var H=this.input.charCodeAt(this.pos+1);if(H===46){var pe=this.input.charCodeAt(this.pos+2);if(pe<48||pe>57)return this.finishOp(X.questionDot,2)}if(H===63)return B>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(X.assign,3):this.finishOp(X.coalesce,2)}return this.finishOp(X.question,1)},ci.readToken_numberSign=function(){var B=35;if(this.options.ecmaVersion>=13&&(++this.pos,me(B=this.fullCharCodeAtPos(),!0)||B===92))return this.finishToken(X.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Je(B)+"'")},ci.getTokenFromCode=function(B){switch(B){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(X.parenL);case 41:return++this.pos,this.finishToken(X.parenR);case 59:return++this.pos,this.finishToken(X.semi);case 44:return++this.pos,this.finishToken(X.comma);case 91:return++this.pos,this.finishToken(X.bracketL);case 93:return++this.pos,this.finishToken(X.bracketR);case 123:return++this.pos,this.finishToken(X.braceL);case 125:return++this.pos,this.finishToken(X.braceR);case 58:return++this.pos,this.finishToken(X.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(X.backQuote);case 48:var H=this.input.charCodeAt(this.pos+1);if(H===120||H===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(H===111||H===79)return this.readRadixNumber(8);if(H===98||H===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(B);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(B);case 124:case 38:return this.readToken_pipe_amp(B);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(B);case 60:case 62:return this.readToken_lt_gt(B);case 61:case 33:return this.readToken_eq_excl(B);case 63:return this.readToken_question();case 126:return this.finishOp(X.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Je(B)+"'")},ci.finishOp=function(B,H){var pe=this.input.slice(this.pos,this.pos+H);return this.pos+=H,this.finishToken(B,pe)},ci.readRegexp=function(){for(var B,H,pe=this.pos;;){this.pos>=this.input.length&&this.raise(pe,"Unterminated regular expression");var xe=this.input.charAt(this.pos);if($e.test(xe)&&this.raise(pe,"Unterminated regular expression"),B)B=!1;else{if(xe==="[")H=!0;else if(xe==="]"&&H)H=!1;else if(xe==="/"&&!H)break;B=xe==="\\"}++this.pos}var We=this.input.slice(pe,this.pos);++this.pos;var At=this.pos,kt=this.readWord1();this.containsEsc&&this.unexpected(At);var Yt=this.regexpState||(this.regexpState=new Nr(this));Yt.reset(pe,We,kt),this.validateRegExpFlags(Yt),this.validateRegExpPattern(Yt);var Gn=null;try{Gn=new RegExp(We,kt)}catch{}return this.finishToken(X.regexp,{pattern:We,flags:kt,value:Gn})},ci.readInt=function(B,H,pe){for(var xe=this.options.ecmaVersion>=12&&H===void 0,We=pe&&this.input.charCodeAt(this.pos)===48,At=this.pos,kt=0,Yt=0,Gn=0,yr=H??1/0;Gn=97?Ur-97+10:Ur>=65?Ur-65+10:Ur>=48&&Ur<=57?Ur-48:1/0)>=B)break;Yt=Ur,kt=kt*B+Ws}}return xe&&Yt===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===At||H!=null&&this.pos-At!==H?null:kt},ci.readRadixNumber=function(B){var H=this.pos;this.pos+=2;var pe=this.readInt(B);return pe==null&&this.raise(this.start+2,"Expected number in radix "+B),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(pe=Ip(this.input.slice(H,this.pos)),++this.pos):me(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,pe)},ci.readNumber=function(B){var H=this.pos;B||this.readInt(10,void 0,!0)!==null||this.raise(H,"Invalid number");var pe=this.pos-H>=2&&this.input.charCodeAt(H)===48;pe&&this.strict&&this.raise(H,"Invalid number");var xe=this.input.charCodeAt(this.pos);if(!pe&&!B&&this.options.ecmaVersion>=11&&xe===110){var We=Ip(this.input.slice(H,this.pos));return++this.pos,me(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,We)}pe&&/[89]/.test(this.input.slice(H,this.pos))&&(pe=!1),xe!==46||pe||(++this.pos,this.readInt(10),xe=this.input.charCodeAt(this.pos)),xe!==69&&xe!==101||pe||((xe=this.input.charCodeAt(++this.pos))!==43&&xe!==45||++this.pos,this.readInt(10)===null&&this.raise(H,"Invalid number")),me(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var At,kt=(At=this.input.slice(H,this.pos),pe?parseInt(At,8):parseFloat(At.replace(/_/g,"")));return this.finishToken(X.num,kt)},ci.readCodePoint=function(){var B;if(this.input.charCodeAt(this.pos)===123){this.options.ecmaVersion<6&&this.unexpected();var H=++this.pos;B=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,B>1114111&&this.invalidStringToken(H,"Code point out of bounds")}else B=this.readHexChar(4);return B},ci.readString=function(B){for(var H="",pe=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var xe=this.input.charCodeAt(this.pos);if(xe===B)break;xe===92?(H+=this.input.slice(pe,this.pos),H+=this.readEscapedChar(!1),pe=this.pos):xe===8232||xe===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(mt(xe)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return H+=this.input.slice(pe,this.pos++),this.finishToken(X.string,H)};var _m={};ci.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(B){if(B!==_m)throw B;this.readInvalidTemplateToken()}this.inTemplateElement=!1},ci.invalidStringToken=function(B,H){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw _m;this.raise(B,H)},ci.readTmplToken=function(){for(var B="",H=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var pe=this.input.charCodeAt(this.pos);if(pe===96||pe===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos!==this.start||this.type!==X.template&&this.type!==X.invalidTemplate?(B+=this.input.slice(H,this.pos),this.finishToken(X.template,B)):pe===36?(this.pos+=2,this.finishToken(X.dollarBraceL)):(++this.pos,this.finishToken(X.backQuote));if(pe===92)B+=this.input.slice(H,this.pos),B+=this.readEscapedChar(!0),H=this.pos;else if(mt(pe)){switch(B+=this.input.slice(H,this.pos),++this.pos,pe){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:B+=` +`;break;default:B+=String.fromCharCode(pe)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),H=this.pos}else++this.pos}},ci.readInvalidTemplateToken=function(){for(;this.pos=48&&H<=55){var xe=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],We=parseInt(xe,8);return We>255&&(xe=xe.slice(0,-1),We=parseInt(xe,8)),this.pos+=xe.length-1,H=this.input.charCodeAt(this.pos),xe==="0"&&H!==56&&H!==57||!this.strict&&!B||this.invalidStringToken(this.pos-1-xe.length,B?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(We)}return mt(H)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(H)}},ci.readHexChar=function(B){var H=this.pos,pe=this.readInt(16,B);return pe===null&&this.invalidStringToken(H,"Bad character escape sequence"),pe},ci.readWord1=function(){this.containsEsc=!1;for(var B="",H=!0,pe=this.pos,xe=this.options.ecmaVersion>=6;this.pos{mu.ok(typeof B=="string","'name' must be a string"),Array.isArray(H)||(H=[H]);let xe="The ";if(B.endsWith(" argument"))xe+=`${B} `;else{let Yt=B.includes(".")?"property":"argument";xe+=`"${B}" ${Yt} `}xe+="must be ";let We=[],At=[],kt=[];for(let Yt of H)mu.ok(typeof Yt=="string","All expected entries have to be of type string"),XE.has(Yt)?We.push(Yt.toLowerCase()):WS.exec(Yt)===null?(mu.ok(Yt!=="object",'The value "object" should be written as "Object"'),kt.push(Yt)):At.push(Yt);if(At.length>0){let Yt=We.indexOf("object");Yt!==-1&&(We.slice(Yt,1),At.push("Object"))}return We.length>0&&(xe+=`${We.length>1?"one of type":"of type"} ${ZE(We,"or")}`,(At.length>0||kt.length>0)&&(xe+=" or ")),At.length>0&&(xe+=`an instance of ${ZE(At,"or")}`,kt.length>0&&(xe+=" or ")),kt.length>0&&(kt.length>1?xe+=`one of ${ZE(kt,"or")}`:(kt[0].toLowerCase()!==kt[0]&&(xe+="an "),xe+=`${kt[0]}`)),xe+=`. Received ${(function(Yt){if(Yt==null)return String(Yt);if(typeof Yt=="function"&&Yt.name)return`function ${Yt.name}`;if(typeof Yt=="object")return Yt.constructor&&Yt.constructor.name?`an instance of ${Yt.constructor.name}`:`${(0,zd.inspect)(Yt,{depth:-1})}`;let Gn=(0,zd.inspect)(Yt,{colors:!1});return Gn.length>28&&(Gn=`${Gn.slice(0,25)}...`),`type ${typeof Yt} (${Gn})`})(pe)}`,xe},TypeError),Vu.ERR_INVALID_MODULE_SPECIFIER=gd("ERR_INVALID_MODULE_SPECIFIER",(B,H,pe=void 0)=>`Invalid module "${B}" ${H}${pe?` imported from ${pe}`:""}`,TypeError),Vu.ERR_INVALID_PACKAGE_CONFIG=gd("ERR_INVALID_PACKAGE_CONFIG",(B,H,pe)=>`Invalid package config ${B}${H?` while importing ${H}`:""}${pe?`. ${pe}`:""}`,Error),Vu.ERR_INVALID_PACKAGE_TARGET=gd("ERR_INVALID_PACKAGE_TARGET",(B,H,pe,xe=!1,We=void 0)=>{let At=typeof pe=="string"&&!xe&&pe.length>0&&!pe.startsWith("./");return H==="."?(mu.ok(xe===!1),`Invalid "exports" main target ${JSON.stringify(pe)} defined in the package config ${B}package.json${We?` imported from ${We}`:""}${At?'; targets must start with "./"':""}`):`Invalid "${xe?"imports":"exports"}" target ${JSON.stringify(pe)} defined for '${H}' in the package config ${B}package.json${We?` imported from ${We}`:""}${At?'; targets must start with "./"':""}`},Error),Vu.ERR_MODULE_NOT_FOUND=gd("ERR_MODULE_NOT_FOUND",(B,H,pe=!1)=>`Cannot find ${pe?"module":"package"} '${B}' imported from ${H}`,Error),Vu.ERR_NETWORK_IMPORT_DISALLOWED=gd("ERR_NETWORK_IMPORT_DISALLOWED","import of '%s' by %s is not supported: %s",Error),Vu.ERR_PACKAGE_IMPORT_NOT_DEFINED=gd("ERR_PACKAGE_IMPORT_NOT_DEFINED",(B,H,pe)=>`Package import specifier "${B}" is not defined${H?` in package ${H}package.json`:""} imported from ${pe}`,TypeError),Vu.ERR_PACKAGE_PATH_NOT_EXPORTED=gd("ERR_PACKAGE_PATH_NOT_EXPORTED",(B,H,pe=void 0)=>H==="."?`No "exports" main defined in ${B}package.json${pe?` imported from ${pe}`:""}`:`Package subpath '${H}' is not defined by "exports" in ${B}package.json${pe?` imported from ${pe}`:""}`,Error),Vu.ERR_UNSUPPORTED_DIR_IMPORT=gd("ERR_UNSUPPORTED_DIR_IMPORT","Directory import '%s' is not supported resolving ES modules imported from %s",Error),Vu.ERR_UNSUPPORTED_RESOLVE_REQUEST=gd("ERR_UNSUPPORTED_RESOLVE_REQUEST",'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',TypeError),Vu.ERR_UNKNOWN_FILE_EXTENSION=gd("ERR_UNKNOWN_FILE_EXTENSION",(B,H)=>`Unknown file extension "${B}" for ${H}`,TypeError),Vu.ERR_INVALID_ARG_VALUE=gd("ERR_INVALID_ARG_VALUE",(B,H,pe="is invalid")=>{let xe=(0,zd.inspect)(H);return xe.length>128&&(xe=`${xe.slice(0,128)}...`),`The ${B.includes(".")?"property":"argument"} '${B}' ${pe}. Received ${xe}`},TypeError);let Gk=(function(B){let H="__node_internal_"+B.name;return Object.defineProperty(B,"name",{value:H}),B})(function(B){let H=YA();return H&&(h_=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY),Error.captureStackTrace(B),H&&(Error.stackTraceLimit=h_),B}),{ERR_INVALID_PACKAGE_CONFIG:Be}=Vu,{ERR_UNKNOWN_FILE_EXTENSION:b}=Vu,R=Object.freeze(["node","import"]);new Set(R),RegExp.prototype[Symbol.replace];let{ERR_INVALID_MODULE_SPECIFIER:P,ERR_INVALID_PACKAGE_CONFIG:U,ERR_INVALID_PACKAGE_TARGET:le,ERR_MODULE_NOT_FOUND:ve,ERR_PACKAGE_IMPORT_NOT_DEFINED:Oe,ERR_PACKAGE_PATH_NOT_EXPORTED:Ye,ERR_UNSUPPORTED_DIR_IMPORT:Ve,ERR_UNSUPPORTED_RESOLVE_REQUEST:Rt}=Vu;function an(B){return typeof B!="string"||B.startsWith("file://")?zc((0,xc.fileURLToPath)(B)):zc(B)}function sr(B){return(0,xc.pathToFileURL)(an(B)).toString()}function Nn(B,H){return{name:"import-meta-paths",visitor:{Program(pe){let xe=[],We=[],At=[];pe.traverse({MemberExpression(kt){let{node:Yt}=kt;if(Yt.object.type==="MetaProperty"&&Yt.object.meta.name==="import"&&Yt.object.property.name==="meta"&&Yt.property.type==="Identifier")switch(Yt.property.name){case"url":xe.push(kt);break;case"dirname":We.push(kt);break;case"filename":At.push(kt)}}});for(let kt of xe)kt.replaceWith(ce.smart.ast`${H.filename?JSON.stringify(sr(H.filename)):"require('url').pathToFileURL(__filename).toString()"}`);for(let kt of We)kt.replaceWith(ce.smart.ast`${H.filename?JSON.stringify(De(an(sr(H.filename)))):"__dirname"}`);for(let kt of At)kt.replaceWith(ce.smart.ast`${H.filename?JSON.stringify(an(sr(H.filename))):"__filename"}`)}}}}var Pr=n("./node_modules/.pnpm/@babel+helper-module-imports@7.28.6/node_modules/@babel/helper-module-imports/lib/index.js"),oo=n("./node_modules/.pnpm/@babel+helper-module-transforms@7.28.6_@babel+core@7.29.0/node_modules/@babel/helper-module-transforms/lib/index.js"),Ko=n("./node_modules/.pnpm/@babel+helper-simple-access@7.27.1/node_modules/@babel/helper-simple-access/lib/index.js");function Or(B,H,pe){B.replaceWith((0,oo.buildDynamicImport)(B.node,!0,!1,xe=>((We,At,kt)=>{let Yt=i.template.expression.ast`jitiImport(${We})`;return kt?Yt:i.types.callExpression(i.types.memberExpression(Yt,i.types.identifier("then")),[i.types.arrowFunctionExpression([i.types.identifier("m")],i.types.callExpression(At.addHelper("interopRequireWildcard"),[i.types.identifier("m")]))])})(xe,pe,H)))}let Ba="@babel/plugin-transform-modules-commonjs/customWrapperPlugin";function gh(B,H){if(B)for(let pe of B){let xe=H(pe);if(xe!=null)return xe}}let AT=(0,g.declare)((B,H)=>{let{strictNamespace:pe=!1,mjsStrictNamespace:xe=pe,allowTopLevelThis:We,strict:At,strictMode:kt,noInterop:Yt,importInterop:Gn,lazy:yr=!1,allowCommonJSExports:Ur=!0,loose:Ws=!1,async:vo=!1}=H,Al=B.assumption("constantReexports")??Ws,Lg=B.assumption("enumerableModuleMeta")??Ws,yf=B.assumption("noIncompleteNsImportDetection")??!1;if(!(typeof yr=="boolean"||typeof yr=="function"||Array.isArray(yr)&&yr.every(Cr=>typeof Cr=="string")))throw new Error(".lazy must be a boolean, array of strings, or a function");if(typeof pe!="boolean")throw new TypeError(".strictNamespace must be a boolean, or undefined");if(typeof xe!="boolean")throw new TypeError(".mjsStrictNamespace must be a boolean, or undefined");let wp=Cr=>i.template.expression.ast` + (function(){ + throw new Error( + "The CommonJS '" + "${Cr}" + "' variable is not available in ES6 modules." + + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + + "Babel config for this file."); + })() + `,xm={ReferencedIdentifier(Cr){let ao=Cr.node.name;if(ao!=="module"&&ao!=="exports")return;let Go=Cr.scope.getBinding(ao);this.scope.getBinding(ao)!==Go||Cr.parentPath.isObjectProperty({value:Cr.node})&&Cr.parentPath.parentPath.isObjectPattern()||Cr.parentPath.isAssignmentExpression({left:Cr.node})||Cr.isAssignmentExpression({left:Cr.node})||Cr.replaceWith(wp(ao))},UpdateExpression(Cr){let ao=Cr.get("argument");if(!ao.isIdentifier())return;let Go=ao.node.name;if(Go!=="module"&&Go!=="exports")return;let Ad=Cr.scope.getBinding(Go);this.scope.getBinding(Go)===Ad&&Cr.replaceWith(i.types.assignmentExpression(Cr.node.operator[0]+"=",ao.node,wp(Go)))},AssignmentExpression(Cr){let ao=Cr.get("left");if(ao.isIdentifier()){let Go=ao.node.name;if(Go!=="module"&&Go!=="exports")return;let Ad=Cr.scope.getBinding(Go);if(this.scope.getBinding(Go)!==Ad)return;let yl=Cr.get("right");yl.replaceWith(i.types.sequenceExpression([yl.node,wp(Go)]))}else if(ao.isPattern()){let Go=ao.getOuterBindingIdentifiers(),Ad=Object.keys(Go).find(yl=>(yl==="module"||yl==="exports")&&this.scope.getBinding(yl)===Cr.scope.getBinding(yl));if(Ad){let yl=Cr.get("right");yl.replaceWith(i.types.sequenceExpression([yl.node,wp(Ad)]))}}}};return{name:"transform-modules-commonjs",pre(){this.file.set("@babel/plugin-transform-modules-*","commonjs"),yr&&(function(Cr,ao){let Go=Cr.get(Ba);Go||Cr.set(Ba,Go=[]),Go.push(ao)})(this.file,(Cr=>({name:"babel-plugin-transform-modules-commonjs/lazy",version:"7.24.7",getWrapperPayload:(ao,Go)=>(0,oo.isSideEffectImport)(Go)||Go.reexportAll?null:Cr===!0?ao.includes(".")?null:"lazy/function":Array.isArray(Cr)?Cr.includes(ao)?"lazy/function":null:typeof Cr=="function"?Cr(ao)?"lazy/function":null:void 0,buildRequireWrapper(ao,Go,Ad,yl){if(Ad==="lazy/function")return!!yl&&i.template.statement.ast` + function ${ao}() { + const data = ${Go}; + ${ao} = function(){ return data; }; + return data; + } + `},wrapReference(ao,Go){if(Go==="lazy/function")return i.types.callExpression(ao,[])}}))(yr))},visitor:{["CallExpression"+(B.types.importExpression?"|ImportExpression":"")](Cr){if(Cr.isCallExpression()&&!i.types.isImport(Cr.node.callee))return;let{scope:ao}=Cr;do ao.rename("require");while(ao=ao.parent);Or(Cr,Yt,this.file)},Program:{exit(Cr,ao){if(!(0,Pr.isModule)(Cr))return;Cr.scope.rename("exports"),Cr.scope.rename("module"),Cr.scope.rename("require"),Cr.scope.rename("__filename"),Cr.scope.rename("__dirname"),Ur||(process.env.BABEL_8_BREAKING?(0,Ko.A)(Cr,new Set(["module","exports"])):(0,Ko.A)(Cr,new Set(["module","exports"]),!1),Cr.traverse(xm,{scope:Cr.scope}));let Go=(0,oo.getModuleName)(this.file.opts,H);Go&&(Go=i.types.stringLiteral(Go));let Ad=(function(zA){let yd=zA.get(Ba);return{getWrapperPayload:(...Fg)=>gh(yd,Tp=>Tp.getWrapperPayload?.(...Fg)),wrapReference:(...Fg)=>gh(yd,Tp=>Tp.wrapReference?.(...Fg)),buildRequireWrapper:(...Fg)=>gh(yd,Tp=>Tp.buildRequireWrapper?.(...Fg))}})(this.file),{meta:yl,headers:$k}=(0,oo.rewriteModuleStatementsAndPrepareHeader)(Cr,{exportName:"exports",constantReexports:Al,enumerableModuleMeta:Lg,strict:At,strictMode:kt,allowTopLevelThis:We,noInterop:Yt,importInterop:Gn,wrapReference:Ad.wrapReference,getWrapperPayload:Ad.getWrapperPayload,esNamespaceOnly:typeof ao.filename=="string"&&/\.mjs$/.test(ao.filename)?xe:pe,noIncompleteNsImportDetection:yf,filename:this.file.opts.filename});for(let[zA,yd]of yl.source){let Fg=vo?i.types.awaitExpression(i.types.callExpression(i.types.identifier("jitiImport"),[i.types.stringLiteral(zA)])):i.types.callExpression(i.types.identifier("require"),[i.types.stringLiteral(zA)]),Tp;if((0,oo.isSideEffectImport)(yd)){if(yr&&yd.wrap==="function")throw new Error("Assertion failure");Tp=i.types.expressionStatement(Fg)}else{let Wk=(0,oo.wrapInterop)(Cr,Fg,yd.interop)||Fg;if(yd.wrap){let KA=Ad.buildRequireWrapper(yd.name,Wk,yd.wrap,yd.referenced);if(KA===!1)continue;Tp=KA}Tp??=i.template.statement.ast` + var ${yd.name} = ${Wk}; + `}Tp.loc=yd.loc,$k.push(Tp,...(0,oo.buildNamespaceInitStatements)(yl,yd,Al,Ad.wrapReference))}(0,oo.ensureStatementsHoisted)($k),Cr.unshiftContainer("body",$k),Cr.get("body").forEach(zA=>{$k.includes(zA.node)&&zA.isVariableDeclaration()&&zA.scope.registerDeclaration(zA)})}}}}});function yT(B){let H={babelrc:!1,configFile:!1,compact:!1,retainLines:typeof B.retainLines!="boolean"||B.retainLines,filename:"",cwd:"/",...B.babel,plugins:[[AT,{allowTopLevelThis:!0,noInterop:!B.interopDefault,async:B.async}],[Nn,{filename:B.filename}],[G],[q],[o.A],[l.A],[u.A]]};B.jsx&&H.plugins.push([c.default],[d.A,Object.assign({},B.jsx)]),B.ts&&(H.plugins.push([m.default,{allowDeclareFields:!0,isTSX:B.jsx&&/\.[cm]?tsx$/.test(B.filename||"")}]),H.plugins.unshift([$],[s.A,{legacy:!0}]),H.plugins.push(f(),a.A)),B.babel&&Array.isArray(B.babel.plugins)&&H.plugins?.push(...B.babel.plugins);try{return{code:(0,i.transformSync)(B.source,H)?.code||""}}catch(pe){return{error:pe,code:"exports.__JITI_ERROR__ = "+JSON.stringify({filename:B.filename,line:pe.loc?.line||0,column:pe.loc?.column||0,code:pe.code?.replace("BABEL_","").replace("PARSE_ERROR","ParseError"),message:pe.message?.replace("/: ","").replace(/\(.+\)\s*$/,"")})}}}})(),kWn.exports=r.default})()});function i5i(t){throw t}function MWn(t,e={}){return e.transform||(e={...e,transform:PWn.default}),(0,DWn.default)(t,e,{onError:i5i,nativeImport:s5i,createRequire:NWn.createRequire})}var NWn,DWn,PWn,s5i,OWn=v(()=>{p();NWn=require("node:module"),DWn=Ot(Sut(),1),PWn=Ot(BWn(),1);s5i=t=>import(t)});var LWn={};br(LWn,{createJiti:()=>MWn});var FWn=v(()=>{p();OWn()});function o5i(t){throw t}function c5i(...t){return Cut||(Cut=(0,Iut.createRequire)(x)("../dist/babel.cjs")),Cut(...t)}function UWn(t,e={}){return e.transform||(e={...e,transform:c5i}),(0,QWn.default)(t,e,{onError:o5i,nativeImport:a5i,createRequire:Iut.createRequire})}var Iut,QWn,a5i,Cut,GWn=v(()=>{p();Iut=require("node:module"),QWn=Ot(Sut(),1);a5i=t=>import(t)});var $Wn={};br($Wn,{createJiti:()=>UWn});var WWn=v(()=>{p();GWn()});function l5i(t,e){try{return Promise.resolve(e(wut))}catch(n){return Promise.reject(n)}}var wut,qD,Tut=v(()=>{p();wut={startSpan:l5i,addEvent:()=>{},setAttributes:()=>{},setStatus:()=>{}};Object.freeze(wut);qD=wut});function HWn(t){return Array.isArray(t)?[...t]:t}function Vie(t){let e={};if(!t)return e;for(let[n,r]of Object.entries(t))r!==void 0&&(e[n]=HWn(r));return e}function u5i(t,e){let n=Vie(t);for(let[r,i]of Object.entries(e))i!==void 0&&(n[r]=HWn(i));return n}function qWn(t){return t.status==="ok"?{status:"ok"}:t.error?{status:"error",error:{name:t.error.name,message:t.error.message}}:{status:"error"}}function d5i(t){try{if(t instanceof Error)return{status:"error",error:{name:t.name,message:t.message}}}catch{}return{status:"error"}}function vut(t,e,n,r){e.settled||(n&&!e.explicitStatus&&(e.status=d5i(r)),e.settled=!0,e.endSequence=t.nextEndSequence++)}function p5i(t,e,n){let r=n.name,i=Vie(n.attributes);return{id:t.nextSpanId++,parentId:e?.id??null,name:r,attributes:i,events:[],status:{status:"ok"},explicitStatus:!1,settled:!1}}function jWn(t,e,n,r){if(e?.settled)return qD.startSpan(n,r);let i;try{i=p5i(t,e,n),t.spans.push(i)}catch{return qD.startSpan(n,r)}let s={startSpan:(a,c)=>jWn(t,i,a,c),addEvent(a,c){if(!i.settled)try{i.events.push({name:a,attributes:Vie(c)})}catch{}},setAttributes(a){if(!i.settled)try{i.attributes=u5i(i.attributes,a)}catch{}},setStatus(a){if(!i.settled)try{i.status=qWn(a),i.explicitStatus=!0}catch{}}},o;try{o=r(s)}catch(a){return vut(t,i,!0,a),Promise.reject(a)}return Promise.resolve(o).then(a=>(vut(t,i,!1),a),a=>{throw vut(t,i,!0,a),a})}var Yie,VWn=v(()=>{p();Tut();Yie=class{state={spans:[],nextSpanId:1,nextEndSequence:1};startSpan(e,n){return jWn(this.state,void 0,e,n)}getSpans(){return this.state.spans.map(e=>({id:e.id,parentId:e.parentId,name:e.name,attributes:Vie(e.attributes),events:e.events.map(n=>({name:n.name,attributes:Vie(n.attributes)})),status:qWn(e.status),settled:e.settled,...e.endSequence===void 0?{}:{endSequence:e.endSequence}}))}}});function YWn(t){return t}function zWn(t){return(n,r,i)=>t.startSpan({name:n,attributes:r},s=>i(s,zWn(s)))}function KWn(t,e){return zWn(t)}var Rut=v(()=>{p();Tut();VWn()});function BRe(t){kut=t}function zie(){if(!kut)throw new Error("No default stream function configured. Pass streamFn explicitly or call setDefaultStreamFn().");return kut}var kut,NRe=v(()=>{p()});function m5i(t,e,n,r,i){let s=JWn();return DRe(t,e,n,async o=>{s.push(o)},r,i).then(o=>{s.end(o)}),s}function h5i(t,e,n,r){if(t.messages.length===0)throw new Error("Cannot continue: no messages in context");if(t.messages[t.messages.length-1].role==="assistant")throw new Error("Cannot continue from message role: assistant");let i=JWn();return PRe(t,e,async s=>{i.push(s)},n,r).then(s=>{i.end(s)}),i}async function DRe(t,e,n,r,i,s){let o=ZWn(e,t),a=[...o],c={...e,messages:[...e.messages,...o]};await r({type:"agent_start"}),await r({type:"turn_start"});for(let u of o)await r({type:"message_start",message:u}),await r({type:"message_end",message:u});return await XWn(c,a,n,i,r,s??zie()),a}async function PRe(t,e,n,r,i){if(t.messages.length===0)throw new Error("Cannot continue: no messages in context");if(t.messages[t.messages.length-1].role==="assistant")throw new Error("Cannot continue from message role: assistant");let s=[],o={...t};return await n({type:"agent_start"}),await n({type:"turn_start"}),await XWn(o,s,e,r,n,i??zie()),s}function JWn(){return new mB(t=>t.type==="agent_end",t=>t.type==="agent_end"?t.messages:[])}async function XWn(t,e,n,r,i,s){let o=t,a=n,c,u=!1,l=await a.getSteeringMessages?.()||[];for(;;){let d=!0;for(;d||l.length>0;){let h=[];if(c){let _=await a.prepareNextTurn?.(c);_&&(o=_.context??o,h=_.messages??[],a={...a,model:_.model??a.model,reasoning:_.thinkingLevel===void 0?a.reasoning:_.thinkingLevel==="off"?void 0:_.thinkingLevel}),l.length===0&&(l=await a.getSteeringMessages?.()||[]),await i({type:"turn_start"})}for(let _ of ZWn(o,[...h,...l]))await i({type:"message_start",message:_}),await i({type:"message_end",message:_}),o.messages.push(_),e.push(_);l=[];let f=await a.prepareRequest?.({context:o,model:a.model,thinkingLevel:a.reasoning??"off"},r);f&&(o=f.context??o,a={...a,model:f.model??a.model,reasoning:f.thinkingLevel===void 0?a.reasoning:f.thinkingLevel==="off"?void 0:f.thinkingLevel});let g=await g5i(o,a,r,i,s);if(e.push(g),g.stopReason==="error"||g.stopReason==="aborted"){c={message:g,toolResults:[],context:o,newMessages:e},await a.finishTurn?.(c,r),await i({type:"turn_end",message:g,toolResults:[]}),await i({type:"agent_end",messages:e});return}let A=g.content.filter(_=>_.type==="toolCall"),y=[];if(d=!1,A.length>0){let _=g.stopReason==="length"?await A5i(A,i):await y5i(o,g,a,r,i);y.push(..._.messages),d=!_.terminate;for(let S of y)o.messages.push(S),e.push(S)}c={message:g,toolResults:y,context:o,newMessages:e};let E=await a.finishTurn?.(c,r);if(await i({type:"turn_end",message:g,toolResults:y}),E?.action==="end"){await i({type:"agent_end",messages:e});return}u=E?.action==="continue",l=await a.getSteeringMessages?.()||[],(d||l.length>0)&&(u=!1)}let m=await a.getFollowUpMessages?.()||[];if(m.length>0){u=!1,l=m;continue}if(u){u=!1;continue}break}await i({type:"agent_end",messages:e})}function ZWn(t,e){let n=-1;for(let l=e.length-1;l>=0;l--)if(e[l].role==="system"){n=l;break}let r=e[n],i=r?e.map((l,d)=>d===n?But(r,f5i):l):e,s=A3e(Nm([...t.messages,...i]),(t.tools??[]).map(fB)),o=s.toolsAdded.length===0&&s.toolsRemoved.length===0;if(r)return o&&!r.toolsAdded?.length&&!r.toolsRemoved?.length?e:i.map((l,d)=>d===n?But(r,s):l);if(o)return e;let a=But({role:"system",content:"",timestamp:Date.now()},s),c=e.findIndex(l=>l.role!=="system"),u=c===-1?e.length:c;return[...e.slice(0,u),a,...e.slice(u)]}function But(t,{toolsAdded:e,toolsRemoved:n}){let{toolsAdded:r,toolsRemoved:i,...s}=t;return{...s,...e.length>0?{toolsAdded:e}:{},...n.length>0?{toolsRemoved:n}:{}}}async function g5i(t,e,n,r,i){let s=t.messages;e.transformContext&&(s=await e.transformContext(s,n));let o=await e.convertToLlm(s),a=Id({messages:o}),c=(e.getApiKey?await e.getApiKey(e.model.provider):void 0)||e.apiKey,u=await i(e.model,a,{...e,apiKey:c,signal:n}),l=null,d=!1;for await(let h of u)switch(h.type){case"start":l=h.partial,t.messages.push(l),d=!0,await r({type:"message_start",message:{...l}});break;case"text_start":case"text_delta":case"text_end":case"thinking_start":case"thinking_delta":case"thinking_end":case"toolcall_start":case"toolcall_delta":case"toolcall_end":l&&(l=h.partial,t.messages[t.messages.length-1]=l,await r({type:"message_update",assistantMessageEvent:h,message:{...l}}));break;case"done":case"error":{let f=await u.result();return d?t.messages[t.messages.length-1]=f:t.messages.push(f),d||await r({type:"message_start",message:{...f}}),await r({type:"message_end",message:f}),f}}let m=await u.result();return d?t.messages[t.messages.length-1]=m:(t.messages.push(m),await r({type:"message_start",message:{...m}})),await r({type:"message_end",message:m}),m}async function A5i(t,e){let n=[];for(let r of t){await e({type:"tool_execution_start",toolCallId:r.id,toolName:r.name,args:r.arguments});let i={toolCall:r,result:HR(`Tool call "${r.name}" was not executed: the response hit the output token limit, so its arguments may be truncated. Re-issue the tool call with complete arguments.`),isError:!0};await Kie(i,e);let s=Nut(i);await Dut(s,e),n.push(s)}return{messages:n,terminate:!1}}async function y5i(t,e,n,r,i){let s=e.content.filter(a=>a.type==="toolCall"),o=s.some(a=>t.tools?.find(c=>c.name===a.name)?.executionMode==="sequential");return n.toolExecution==="sequential"||o?E5i(t,e,s,n,r,i):b5i(t,e,s,n,r,i)}async function E5i(t,e,n,r,i,s){let o=[],a=[];for(let c of n){await s({type:"tool_execution_start",toolCallId:c.id,toolName:c.name,args:c.arguments});let u=await tHn(t,e,c,r,i),l;if(u.kind==="immediate")l={toolCall:c,result:u.result,isError:u.isError};else{let m=await nHn(u,i,s);l=await rHn(t,e,u,m,r,i)}await Kie(l,s);let d=Nut(l);if(await Dut(d,s),o.push(l),a.push(d),i?.aborted)break}return{messages:a,terminate:eHn(o)}}async function b5i(t,e,n,r,i,s){let o=[];for(let u of n){await s({type:"tool_execution_start",toolCallId:u.id,toolName:u.name,args:u.arguments});let l=await tHn(t,e,u,r,i);if(l.kind==="immediate"){let d={toolCall:u,result:l.result,isError:l.isError};if(await Kie(d,s),o.push(d),i?.aborted)break;continue}if(o.push(async()=>{if(i?.aborted){let h={toolCall:u,result:HR("Operation aborted"),isError:!0};return await Kie(h,s),h}let d=await nHn(l,i,s),m=await rHn(t,e,l,d,r,i);return await Kie(m,s),m}),i?.aborted)break}let a=await Promise.all(o.map(u=>typeof u=="function"?u():Promise.resolve(u))),c=[];for(let u of a){let l=Nut(u);await Dut(l,s),c.push(l)}return{messages:c,terminate:eHn(a)}}function eHn(t){return t.length>0&&t.every(e=>e.result.terminate===!0)}function _5i(t,e){if(!t.prepareArguments)return e;let n=t.prepareArguments(e.arguments);return n===e.arguments?e:{...e,arguments:n}}async function tHn(t,e,n,r,i){let s=t.tools?.find(o=>o.name===n.name);if(!s)return{kind:"immediate",result:HR(`Tool ${n.name} not found`),isError:!0};try{let o=_5i(s,n),a=xF(s,o);if(r.beforeToolCall){let c=await r.beforeToolCall({assistantMessage:e,toolCall:n,args:a,context:t},i);if(i?.aborted)return{kind:"immediate",result:HR("Operation aborted"),isError:!0};if(c?.block){let u=HR(c.reason||"Tool execution was blocked");return c.terminate===!0&&(u.terminate=!0),{kind:"immediate",result:u,isError:!0}}}return i?.aborted?{kind:"immediate",result:HR("Operation aborted"),isError:!0}:{kind:"prepared",toolCall:n,tool:s,args:a}}catch(o){return{kind:"immediate",result:HR(o instanceof Error?o.message:String(o)),isError:!0}}}async function nHn(t,e,n){let r=[],i=!0;try{let s=await t.tool.execute(t.toolCall.id,t.args,e,o=>{i&&r.push(Promise.resolve(n({type:"tool_execution_update",toolCallId:t.toolCall.id,toolName:t.toolCall.name,args:t.toolCall.arguments,partialResult:o})))});return i=!1,await Promise.all(r),{result:s,isError:!1}}catch(s){return i=!1,await Promise.all(r),{result:HR(s instanceof Error?s.message:String(s)),isError:!0}}finally{i=!1}}async function rHn(t,e,n,r,i,s){let o=r.result,a=r.isError;if(i.afterToolCall)try{let c=await i.afterToolCall({assistantMessage:e,toolCall:n.toolCall,args:n.args,result:o,isError:a,context:t},s);c&&(o={...o,content:c.content??o.content,details:c.details??o.details,usage:c.usage??o.usage,terminate:c.terminate??o.terminate},a=c.isError??a)}catch(c){o=HR(c instanceof Error?c.message:String(c)),a=!0}return{toolCall:n.toolCall,result:o,isError:a}}function HR(t){return{content:[{type:"text",text:t}],details:{}}}async function Kie(t,e){await e({type:"tool_execution_end",toolCallId:t.toolCall.id,toolName:t.toolCall.name,result:t.result,isError:t.isError})}function Nut(t){return{role:"toolResult",toolCallId:t.toolCall.id,toolName:t.toolCall.name,content:t.result.content??[],details:t.result.details,usage:t.result.usage,isError:t.isError,timestamp:Date.now()}}async function Dut(t,e){await e({type:"message_start",message:t}),await e({type:"message_end",message:t})}var f5i,Put=v(()=>{p();qo();NRe();f5i={toolsAdded:[],toolsRemoved:[]}});function x5i(t){return t.filter(e=>e.role==="system"||e.role==="user"||e.role==="assistant"||e.role==="toolResult")}function I5i(t){let e=t?.tools?.slice()??[],n=t?.messages?.slice()??[],r=pAe(t?.systemPrompt,e.map(fB));return n[0]?.role!=="system"&&r&&n.unshift(r),{get systemPrompt(){return g3e(n)},model:t?.model??C5i,thinkingLevel:t?.thinkingLevel??"off",get tools(){return e},set tools(i){e=i.slice()},get messages(){return n},set messages(i){n=i.slice()},isStreaming:!1,streamingMessage:void 0,pendingToolCalls:new Set,errorMessage:void 0}}var S5i,C5i,MRe,Jie,iHn=v(()=>{p();qo();Put();NRe();S5i={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},C5i={id:"unknown",name:"unknown",api:"unknown",provider:"unknown",baseUrl:"",reasoning:!1,input:[],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:0,maxTokens:0};MRe=class{messages=[];mode;constructor(e){this.mode=e}enqueue(e){this.messages.push(e)}hasItems(){return this.messages.length>0}peek(){if(this.mode==="all")return this.messages.slice();let e=this.messages[0];return e?[e]:[]}drain(){let e=this.peek();return this.messages=this.messages.slice(e.length),e}clear(){this.messages=[]}},Jie=class{_state;listeners=new Set;steeringQueue;followUpQueue;convertToLlm;transformContext;streamFunction;getApiKey;onPayload;onResponse;beforeToolCall;afterToolCall;finishTurn;prepareRequest;prepareNextTurn;prepareNextTurnWithContext;activeRun;sessionId;thinkingBudgets;transport;maxRetryDelayMs;toolExecution;constructor(e){let n=e??{};this._state=I5i(n.initialState),this.convertToLlm=n.convertToLlm??x5i,this.transformContext=n.transformContext,this.streamFunction=n.streamFn??zie(),this.getApiKey=n.getApiKey,this.onPayload=n.onPayload,this.onResponse=n.onResponse,this.beforeToolCall=n.beforeToolCall,this.afterToolCall=n.afterToolCall,this.finishTurn=n.finishTurn,this.prepareRequest=n.prepareRequest,this.prepareNextTurn=n.prepareNextTurn,this.prepareNextTurnWithContext=n.prepareNextTurnWithContext,this.steeringQueue=new MRe(n.steeringMode??"one-at-a-time"),this.followUpQueue=new MRe(n.followUpMode??"one-at-a-time"),this.sessionId=n.sessionId,this.thinkingBudgets=n.thinkingBudgets,this.transport=n.transport??"auto",this.maxRetryDelayMs=n.maxRetryDelayMs,this.toolExecution=n.toolExecution??"parallel"}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}get state(){return this._state}set steeringMode(e){this.steeringQueue.mode=e}get steeringMode(){return this.steeringQueue.mode}set followUpMode(e){this.followUpQueue.mode=e}get followUpMode(){return this.followUpQueue.mode}steer(e){this.steeringQueue.enqueue(e)}followUp(e){this.followUpQueue.enqueue(e)}clearSteeringQueue(){this.steeringQueue.clear()}clearFollowUpQueue(){this.followUpQueue.clear()}clearAllQueues(){this.clearSteeringQueue(),this.clearFollowUpQueue()}hasQueuedMessages(){return this.steeringQueue.hasItems()||this.followUpQueue.hasItems()}peekQueuedMessages(){let e=this.steeringQueue.peek();return e.length>0?e:this.followUpQueue.peek()}get signal(){return this.activeRun?.abortController.signal}abort(){this.activeRun?.abortController.abort()}waitForIdle(){return this.activeRun?.promise??Promise.resolve()}reset(){if(this.activeRun)throw new Error("Agent is already processing. Wait for completion before resetting.");let e=kf(this._state.messages);this._state.messages=e?[e]:[],this._state.isStreaming=!1,this._state.streamingMessage=void 0,this._state.pendingToolCalls=new Set,this._state.errorMessage=void 0,this.clearFollowUpQueue(),this.clearSteeringQueue()}async prompt(e,n){if(this.activeRun)throw new Error("Agent is already processing a prompt. Use steer() or followUp() to queue messages, or wait for completion.");let r=this.normalizePromptInput(e,n);await this.runPromptMessages(r)}async continue(){if(this.activeRun)throw new Error("Agent is already processing. Wait for completion before continuing.");let e=this._state.messages[this._state.messages.length-1];if(!e||this._state.messages.every(n=>n.role==="system"))throw new Error("No messages to continue from");if(e.role==="assistant"){let n=this.steeringQueue.drain();if(n.length>0){await this.runPromptMessages(n,{skipInitialSteeringPoll:!0});return}let r=this.followUpQueue.drain();if(r.length>0){await this.runPromptMessages(r);return}throw new Error("Cannot continue from message role: assistant")}await this.runContinuation()}normalizePromptInput(e,n){if(Array.isArray(e))return e;if(typeof e!="string")return[e];let r=[{type:"text",text:e}];return n&&n.length>0&&r.push(...n),[{role:"user",content:r,timestamp:Date.now()}]}async runPromptMessages(e,n={}){await this.runWithLifecycle(async r=>{await DRe(e,this.createContextSnapshot(),this.createLoopConfig(n),i=>this.processEvents(i),r,this.streamFunction)})}async runContinuation(){await this.runWithLifecycle(async e=>{await PRe(this.createContextSnapshot(),this.createLoopConfig(),n=>this.processEvents(n),e,this.streamFunction)})}createContextSnapshot(){return{messages:this._state.messages.slice(),tools:this._state.tools.slice()}}createLoopConfig(e={}){let n=e.skipInitialSteeringPoll===!0;return{model:this._state.model,reasoning:this._state.thinkingLevel==="off"?void 0:this._state.thinkingLevel,sessionId:this.sessionId,onPayload:this.onPayload,onResponse:this.onResponse,transport:this.transport,thinkingBudgets:this.thinkingBudgets,maxRetryDelayMs:this.maxRetryDelayMs,toolExecution:this.toolExecution,beforeToolCall:this.beforeToolCall,afterToolCall:this.afterToolCall,finishTurn:this.finishTurn,prepareRequest:this.prepareRequest,prepareNextTurn:this.prepareNextTurnWithContext||this.prepareNextTurn?async r=>this.prepareNextTurnWithContext?await this.prepareNextTurnWithContext(r,this.signal):await this.prepareNextTurn?.(this.signal):void 0,convertToLlm:this.convertToLlm,transformContext:this.transformContext,getApiKey:this.getApiKey,getSteeringMessages:async()=>n?(n=!1,[]):this.steeringQueue.drain(),getFollowUpMessages:async()=>this.followUpQueue.drain()}}async runWithLifecycle(e){if(this.activeRun)throw new Error("Agent is already processing.");let n=new AbortController,r=()=>{},i=new Promise(s=>{r=s});this.activeRun={promise:i,resolve:r,abortController:n},this._state.isStreaming=!0,this._state.streamingMessage=void 0,this._state.errorMessage=void 0;try{await e(n.signal)}catch(s){await this.handleRunFailure(s,n.signal.aborted)}finally{this.finishRun()}}async handleRunFailure(e,n){let r={role:"assistant",content:[{type:"text",text:""}],api:this._state.model.api,provider:this._state.model.provider,model:this._state.model.id,usage:S5i,stopReason:n?"aborted":"error",errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()};await this.processEvents({type:"message_start",message:r}),await this.processEvents({type:"message_end",message:r}),await this.processEvents({type:"turn_end",message:r,toolResults:[]}),await this.processEvents({type:"agent_end",messages:[r]})}finishRun(){this._state.isStreaming=!1,this._state.streamingMessage=void 0,this._state.pendingToolCalls=new Set,this.activeRun?.resolve(),this.activeRun=void 0}async processEvents(e){switch(e.type){case"message_start":this._state.streamingMessage=e.message;break;case"message_update":this._state.streamingMessage=e.message;break;case"message_end":this._state.streamingMessage=void 0,this._state.messages.push(e.message);break;case"tool_execution_start":{let r=new Set(this._state.pendingToolCalls);r.add(e.toolCallId),this._state.pendingToolCalls=r;break}case"tool_execution_end":{let r=new Set(this._state.pendingToolCalls);r.delete(e.toolCallId),this._state.pendingToolCalls=r;break}case"turn_end":e.message.role==="assistant"&&e.message.errorMessage&&(this._state.errorMessage=e.message.errorMessage);break;case"agent_end":this._state.streamingMessage=void 0;break}let n=this.activeRun?.abortController.signal;if(!n)throw new Error("Agent listener invoked outside active run");for(let r of this.listeners)await r(e,n)}}});function DA(t){class e extends Error{_tag=t;constructor(r){super(r.message),this.name=t,Object.assign(this,r)}toJSON(){let r={};for(let i of Object.keys(this))i!=="_tag"&&(r[i]=this[i]);return{_tag:t,message:this.message,...r}}static is(r){return r instanceof e}}return e}function w5i(t,e){let n=e[t._tag];return n(t)}var Ir,jD,nV,ORe,xQ,rV,iV,gw,VD,sV,oV,qR,SQ,wE,jR,_g,Xie=v(()=>{p();Ir={ok(t){return{ok:!0,value:t}},err(t){return{ok:!1,error:t}},isOk(t){return t.ok},isErr(t){return!t.ok}};jD=class extends DA("LaneBusy"){},nV=class extends DA("OperationMismatch"){},ORe=class extends DA("NoActiveRun"){},xQ=class extends DA("NoActiveOperation"){},rV=class extends DA("NothingToResume"){},iV=class extends DA("NothingToCompact"){},gw=class extends DA("InvalidMessage"){},VD=class extends DA("InvalidNavigation"){},sV=class extends DA("UnknownSkill"){},oV=class extends DA("UnknownTemplate"){},qR=class extends DA("UnknownTarget"){},SQ=class extends DA("InvalidLane"){},wE=class extends DA("Closed"){},jR=class extends Error{cause;constructor(e,n){super(e),this.name="HarnessFault",this.cause=n}},_g=class extends Error{constructor(){super("AgentHarness was closed while the operation was active"),this.name="HarnessClosed"}}});function Lut(t){return Object.freeze({token:Symbol(t)})}function Zie(t,e,n){return new Mut(n,t,e)}function PA(t,e){let n=e.abortSignal,r=n===void 0?t:AbortSignal.any([n,t]);return Zie(Out,r,e)}function QRe(t){return Zie(Out,void 0,t)}function cHn(t){let e=new AbortController;return{context:PA(e.signal,t),cancel:n=>e.abort(n)}}function VR(t,e){let n=e.abortSignal;return n===void 0?t:n.aborted?Promise.reject(sHn(n)):new Promise((r,i)=>{let s=()=>i(sHn(n));n.addEventListener("abort",s,{once:!0}),t.then(o=>{n.removeEventListener("abort",s),r(o)},o=>{n.removeEventListener("abort",s),i(o)})})}function sHn(t){let e=t.reason;return e instanceof Error?e:new DOMException("The operation was aborted","AbortError")}var Out,LRe,FRe,Mut,oHn,aHn,lHn=v(()=>{p();Out=Object.freeze({token:Symbol("chord.abortSignal")}),LRe=class{get abortSignal(){return this.value(Out)}},FRe=class extends LRe{#e;constructor(e){super(),this.#e=e}value(e){}toString(){return this.#e}},Mut=class extends LRe{#e;#t;#n;constructor(e,n,r){super(),this.#e=e,this.#t=n,this.#n=r}value(e){return e.token===this.#t.token?this.#n:this.#e.value(e)}toString(){return`${this.#e}.WithValue(${this.#t.token.description??"anonymous"})`}},oHn=new FRe("[Context BACKGROUND_CONTEXT]"),aHn=new FRe("[Context TODO_CONTEXT]")});function Kh(t){return t.value(uHn)??qD}function URe(t,e){return Zie(uHn,t,e)}var uHn,TE=v(()=>{p();lHn();Rut();uHn=Lut("pi.telemetryContext")});function dHn(){let t={status:"open"},e=new AbortController,n=()=>{if(t.status==="aborting")throw new Jh(t.cancellation);if(t.status==="closed")throw t.error};return{gate:{admit(r){return n(),r()},signal:e.signal},control:{beginAbort(r){t.status==="open"&&(t={status:"aborting",cancellation:r})},signalAbort(){t.status!=="aborting"||e.signal.aborted||e.abort(new Jh(t.cancellation))},close(r){t.status!=="closed"&&(t={status:"closed",error:r},e.signal.aborted||e.abort(r))}}}}var Jh,aV=v(()=>{p();Jh=class extends Error{cancellation;constructor(e){super("Abort requested"),this.name="AbortRequested",this.cancellation=e}}});var cV,GRe,$Re=v(()=>{p();TE();aV();cV=class extends Error{constructor(e){super(`${e} is not implemented until its later AgentHarness slice`),this.name="SliceNotImplemented"}},GRe=class{operationId;completion;gate;context;waitForRetry;closeSignal;deferredPermits;control;closeController;resolveCompletion;rejectCompletion;constructor(e,n){this.operationId=e.operationId,this.context=QRe(n),this.waitForRetry=e.waitForRetry??!1,this.deferredPermits=e.pollDeferred===!0?1:0;let r,i;this.completion=new Promise((a,c)=>{r=a,i=c}),this.resolveCompletion=r,this.rejectCompletion=i,this.completion.catch(()=>{});let{gate:s,control:o}=dHn();this.gate=s,this.control=o,this.closeController=new AbortController,this.closeSignal=this.closeController.signal}settle(e){this.resolveCompletion(e)}fail(e){this.rejectCompletion(e)}beginAbort(e){this.control.beginAbort(e)}signalAbort(){this.control.signalAbort()}closeGate(e){this.control.close(e),this.closeSignal.aborted||this.closeController.abort(e),this.rejectCompletion(e)}}});function gHn(t){let e=`Ran \`${t.command}\` +`;return t.output?e+=`\`\`\` +${t.output} +\`\`\``:e+="(no output)",t.cancelled?e+=` -## Constraints & Preferences -- [Preserve existing, add new ones discovered] +(command cancelled)`:t.exitCode!==null&&t.exitCode!==void 0&&t.exitCode!==0&&(e+=` -## Progress -### Done -- [x] [Include previously done items AND newly completed items] +Command exited with code ${t.exitCode}`),t.truncated&&t.fullOutputPath&&(e+=` -### In Progress -- [ ] [Current work - update based on progress] +[Output truncated. Full output: ${t.fullOutputPath}]`),e}function YR(t,e,n){return{role:"branchSummary",summary:t,fromId:e,timestamp:typeof n=="number"?n:new Date(n).getTime()}}function zR(t,e,n){return{role:"compactionSummary",summary:t,tokensBefore:e,timestamp:typeof n=="number"?n:new Date(n).getTime()}}function T5i(t,e,n,r,i){return{role:"custom",customType:t,content:e,display:n,details:r,timestamp:typeof i=="number"?i:new Date(i).getTime()}}function YD(t){return t.map(e=>{switch(e.role){case"bashExecution":return e.excludeFromContext?void 0:{role:"user",content:[{type:"text",text:gHn(e)}],timestamp:e.timestamp};case"custom":return{role:"user",content:typeof e.content=="string"?[{type:"text",text:e.content}]:e.content,timestamp:e.timestamp};case"branchSummary":return{role:"user",content:[{type:"text",text:hHn+e.summary+fHn}],timestamp:e.timestamp};case"compactionSummary":return{role:"user",content:[{type:"text",text:pHn+e.summary+mHn}],timestamp:e.timestamp};case"system":case"user":case"assistant":case"toolResult":return e;default:return}}).filter(e=>e!==void 0)}var pHn,mHn,hHn,fHn,CQ=v(()=>{p();pHn=`The conversation history before this point was compacted into the following summary: -### Blocked -- [Current blockers - remove if resolved] + +`,mHn=` +`,hHn=`The following is a summary of a branch that this conversation came back from: -## Key Decisions -- **[Decision]**: [Brief rationale] (preserve all previous, add new) + +`,fHn=""});function Fut(t){let e,n=-1;for(let r=t.length-1;r>=0;r--){let i=t[r];if(i?.type==="compaction"){e=i,n=r;break}}return e===void 0?[...t]:[e,...t.slice(n+1)]}function AHn(t){return t.role!=="assistant"||t.stopReason!=="error"&&t.stopReason!=="aborted"&&t.stopReason!=="deferred"}function Qut(t){switch(t.type){case"message":return AHn(t.message)?[t.message]:[];case"compaction":return[zR(t.summary,t.tokensBefore,t.timestamp),...t.retainedTail.filter(AHn)];case"branch_summary":return t.summary?[YR(t.summary,t.fromId,t.timestamp)]:[];case"custom":return[]}}async function yHn(t,e,n){e??={};let r=Fut(t),i=[];for(let s of r){if(s.type!=="custom"){i.push(...Qut(s));continue}let o=e.entryProjectors?.[s.customType];o!==void 0&&i.push(...await o(s,n)??[])}return i}var Uut=v(()=>{p();CQ()});function hp(t){return{ok:!0,value:t}}function fp(t){return{ok:!1,error:t}}function fS(t){if(!t.ok)throw t.error;return t.value}function EHn(t){return t.ok?t.value:void 0}function lV(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);try{return new Error(JSON.stringify(t))}catch{return new Error(String(t))}}var WRe,HRe,KR,IQ,vb=v(()=>{p();WRe=class extends Error{code;path;constructor(e,n,r,i){super(n,i===void 0?void 0:{cause:i}),this.name="FileError",this.code=e,this.path=r}},HRe=class extends Error{code;constructor(e,n,r){super(n,r===void 0?void 0:{cause:r}),this.name="ExecutionError",this.code=e}},KR=class extends Error{code;constructor(e,n,r){super(n,r===void 0?void 0:{cause:r}),this.name="CompactionError",this.code=e}},IQ=class extends Error{code;constructor(e,n,r){super(n,r===void 0?void 0:{cause:r}),this.name="BranchSummaryError",this.code=e}}});function qRe(){return{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}function uV(t,e){return{input:t.input+e.input,output:t.output+e.output,cacheRead:t.cacheRead+e.cacheRead,cacheWrite:t.cacheWrite+e.cacheWrite,...t.cacheWrite1h===void 0&&e.cacheWrite1h===void 0?{}:{cacheWrite1h:(t.cacheWrite1h??0)+(e.cacheWrite1h??0)},...t.reasoning===void 0&&e.reasoning===void 0?{}:{reasoning:(t.reasoning??0)+(e.reasoning??0)},totalTokens:t.totalTokens+e.totalTokens,cost:{input:t.cost.input+e.cost.input,output:t.cost.output+e.cost.output,cacheRead:t.cost.cacheRead+e.cost.cacheRead,cacheWrite:t.cost.cacheWrite+e.cost.cacheWrite,total:t.cost.total+e.cost.total}}}var jRe=v(()=>{p()});function VRe(){return{read:new Set,written:new Set,edited:new Set}}function ese(t,e){if(t.role==="assistant"&&!(!("content"in t)||!Array.isArray(t.content)))for(let n of t.content){if(typeof n!="object"||n===null||!("type"in n)||n.type!=="toolCall"||!("arguments"in n)||!("name"in n))continue;let r=n.arguments;if(!r)continue;let i=typeof r.path=="string"?r.path:void 0;if(i)switch(n.name){case"read":e.read.add(i);break;case"write":e.written.add(i);break;case"edit":e.edited.add(i);break}}}function YRe(t){let e=new Set([...t.edited,...t.written]),n=[...t.read].filter(i=>!e.has(i)).sort(),r=[...e].sort();return{readFiles:n,modifiedFiles:r}}function zRe(t,e){let n=[];return t.length>0&&n.push(` +${t.join(` +`)} +`),e.length>0&&n.push(` +${e.join(` +`)} +`),n.length===0?"":` -## Next Steps -1. [Update based on current state] +${n.join(` -## Critical Context -- [Preserve important context, add new if needed] +`)}`}function R5i(t){try{return JSON.stringify(t)??"undefined"}catch{return"[unserializable]"}}function k5i(t,e){if(t.length<=e)return t;let n=t.length-e;return`${t.slice(0,e)} -Keep each section concise. Preserve exact file paths, function names, and error messages.`,jps=`The messages above are NEW conversation messages to incorporate into the existing summary provided in tags. +[... ${n} more characters truncated]`}function zD(t){let e=[];for(let n of t)if(n.role==="user"){let r=aa(n.content,"");r&&e.push(`[User]: ${r}`)}else if(n.role==="assistant"){let r=[],i=[];for(let s of n.content)if(s.type==="thinking")r.push(s.thinking);else if(s.type==="toolCall"){let o=s.arguments,a=Object.entries(o).map(([c,u])=>`${c}=${R5i(u)}`).join(", ");i.push(`${s.name}(${a})`)}r.length>0&&e.push(`[Assistant thinking]: ${r.join(` +`)}`),n.content.some(s=>s.type==="text")&&e.push(`[Assistant]: ${aa(n.content)}`),i.length>0&&e.push(`[Assistant tool calls]: ${i.join("; ")}`)}else if(n.role==="toolResult"){let r=aa(n.content,"");r&&e.push(`[Tool result]: ${k5i(r,v5i)}`)}return e.join(` -${Vps}`;function K0e(t,e){if(t.stopReason==="error")return`${e} failed: ${t.errorMessage||"Unknown error"}`;if(t.stopReason==="length")return`${e} failed: generation hit the token cap and the summary is incomplete`}function CAn(t,e,n,r,s,i,o,a){let c={maxTokens:e,signal:i,apiKey:n,headers:r,env:s,sessionId:a};return t.reasoning&&o&&o!=="off"&&(c.reasoning=o),c}async function z0e(t,e,n,r,s,i){let o={...n,cacheRetention:"none",sessionId:n.sessionId??tl()};return x7(async()=>r?(await r(t,e,o)).result():n8e(t,e,o),s,o.signal,i)}async function IAn(t,e,n,r,s,i,o,a,c,u,l,d,h,m){return(await _Z(t,e,n,r,s,i,o,a,c,u,l,d,h,m)).text}function xAn(t){return{systemPrompt:Y0e,messages:[{role:"user",content:[{type:"text",text:t}],timestamp:Date.now()}]}}async function _Z(t,e,n,r,s,i,o,a,c,u,l,d,h,m){let f=Math.min(Math.floor(.8*n),e.maxTokens>0?e.maxTokens:Number.POSITIVE_INFINITY),g=a?jps:Hps;o&&(g=`${g} +`)}var v5i,KRe=v(()=>{p();qo();v5i=2e3});function B5i(t){try{return JSON.stringify(t)??"undefined"}catch{return"[unserializable]"}}function N5i(t,e,n){let r=VRe();if(n>=0){let i=e[n];if(typeof i.details=="object"&&i.details!==null&&!Array.isArray(i.details)){if(Array.isArray(i.details.readFiles))for(let s of i.details.readFiles)typeof s=="string"&&r.read.add(s);if(Array.isArray(i.details.modifiedFiles))for(let s of i.details.modifiedFiles)typeof s=="string"&&r.edited.add(s)}}for(let i of t)ese(i,r);return r}function D5i(t){if(t.type==="message")return t.message;if(t.type==="branch_summary")return YR(t.summary,t.fromId,t.timestamp);if(t.type==="compaction")return zR(t.summary,t.tokensBefore,t.timestamp)}function Gut(t){if(t.type!=="compaction")return D5i(t)}function tse(t,e){return{...t,signal:e.abortSignal,telemetryContext:Kh(e),cacheRetention:"none",sessionId:t.sessionId??Oc()}}async function JRe(t,e,n,r,i,s,o){let a=tse(r,o);return mte(()=>t.completeSimple(e,n,a),i,a.signal,s)}function XRe(t){return t.totalTokens||t.input+t.output+t.cacheRead+t.cacheWrite}function _Hn(t){if(t.role==="assistant"&&"usage"in t){let e=t;if(e.stopReason!=="aborted"&&e.stopReason!=="error"&&e.usage&&XRe(e.usage)>0)return e.usage}}function xHn(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type==="message"){let r=_Hn(n.message);if(r)return r}}}function P5i(t){for(let e=t.length-1;e>=0;e--){let n=_Hn(t[e]);if(n)return{usage:n,index:e}}}function Wut(t){let e=P5i(t);if(!e){let i=0;for(let s of t)i+=wQ(s);return{tokens:i,usageTokens:0,trailingTokens:i,lastUsageIndex:null}}let n=XRe(e.usage),r=0;for(let i=e.index+1;ie-n.reserveTokens:!1}function bHn(t){if(typeof t=="string")return t.length;let e=0;for(let n of t)n.type==="text"&&n.text?e+=n.text.length:n.type==="image"&&(e+=M5i);return e}function wQ(t){let e=0;switch(t.role){case"user":return e=bHn(t.content),Math.ceil(e/4);case"assistant":{let n=t;for(let r of n.content)r.type==="text"?e+=r.text.length:r.type==="thinking"?e+=r.thinking.length:r.type==="toolCall"&&(e+=r.name.length+B5i(r.arguments).length);return Math.ceil(e/4)}case"custom":case"toolResult":return e=bHn(t.content),Math.ceil(e/4);case"bashExecution":return e=t.command.length+t.output.length,Math.ceil(e/4);case"branchSummary":case"compactionSummary":return e=t.summary.length,Math.ceil(e/4)}return 0}function O5i(t,e,n){let r=[];for(let i=e;i=n;r--){let i=t[r];if(i.type==="branch_summary")return r;if(i.type==="message"){let s=i.message.role;if(s==="user"||s==="bashExecution")return r}}return-1}function qut(t,e,n,r){let i=O5i(t,e,n);if(i.length===0)return{firstKeptEntryIndex:e,turnStartIndex:-1,isSplitTurn:!1};let s=0,o=i[0];for(let l=n-1;l>=e;l--){let d=t[l];if(d.type!=="message")continue;let m=wQ(d.message);if(s+=m,s>=r){for(let h=0;h=l){o=i[h];break}break}}for(;o>e;){let l=t[o-1];if(l.type==="compaction"||l.type==="message")break;o--}let a=t[o],c=a.type==="message"&&a.message.role==="user",u=c?-1:Hut(t,o,e);return{firstKeptEntryIndex:o,turnStartIndex:u,isSplitTurn:!c&&u!==-1}}async function SHn(t,e,n,r,i,s,o,a,c,u){let l=await jut(t,e,n,r,i,s,o,a,c,u);return l.ok?hp(l.value.text):fp(l.error)}function jut(t,e,n,r,i,s,o,a,c,u){return $ut(t,{model:n,reserveTokens:r,customInstructions:i,previousSummary:s,thinkingLevel:o},(l,d,m)=>JRe(e,n,l,d,a,c,m),u)}async function $ut(t,e,n,r){let{model:i,reserveTokens:s,customInstructions:o,previousSummary:a,thinkingLevel:c}=e,u=Math.min(Math.floor(.8*s),i.maxTokens>0?i.maxTokens:Number.POSITIVE_INFINITY),l=a?F5i:L5i;o&&(l=`${l} -Additional focus: ${o}`);let A=aT(t),b=` -${ZM(A)} +Additional focus: ${o}`);let d=YD(t),h=` +${zD(d)} -`;a&&(b+=` +`;a&&(h+=` ${a} -`),b+=g;let S=CAn(e,f,r,s,l,i,c,m),C=await z0e(e,xAn(b),S,u,d,h),I=K0e(C,"Summarization");if(I)throw new Error(I);if(C.content.some(w=>w.type==="toolCall"))throw new Error("Summarization attempted to call a tool");return{text:yc(C.content),usage:C.usage}}function LJe(t,e){if(t.length>0&&t[t.length-1].type==="compaction")return;let n=-1;for(let f=t.length-1;f>=0;f--)if(t[f].type==="compaction"){n=f;break}let r,s=0;if(n>=0){let f=t[n];r=f.summary;let g=t.findIndex(A=>A.id===f.firstKeptEntryId);s=g>=0?g:n+1}let i=t.length,o=SZ(EZ(t).messages).tokens,a=MJe(t,s,i,e.keepRecentTokens),c=t[a.firstKeptEntryIndex];if(!c?.id)return;let u=c.id,l=a.isSplitTurn?a.turnStartIndex:a.firstKeptEntryIndex,d=[];for(let f=s;f0){let R="No prior history.",N;if(m.length>0){let G=await _Z(m,e,S.reserveTokens,n,r,i,s,y,o,a,c,u,l,d);R=G.text,N=G.usage}let P=await Kps(f,e,S.reserveTokens,n,r,c,i,o,a,u,l,d);C=`${R} +`),h+=l;let f=[{role:"user",content:[{type:"text",text:h}],timestamp:Date.now()}],g=i.reasoning&&c&&c!=="off"?{maxTokens:u,reasoning:c}:{maxTokens:u},A=await n({systemPrompt:eke,messages:f},tse(g,r),r);if(A.stopReason==="aborted")return fp(new KR("aborted",A.errorMessage||"Summarization aborted"));if(A.stopReason==="error")return fp(new KR("summarization_failed",`Summarization failed: ${A.errorMessage||"Unknown error"}`));let y=aa(A.content);return hp({text:y,usage:A.usage})}function TQ(t,e){if(t.length===0||t[t.length-1].type==="compaction")return hp(void 0);let n=-1;for(let h=t.length-1;h>=0;h--)if(t[h].type==="compaction"){n=h;break}let r,i=t;if(n>=0){let h=t[n];r=h.summary,i=[...h.retainedTail.map((g,A)=>({type:"message",id:`${h.id}:retained:${A}`,parentId:A===0?h.id:`${h.id}:retained:${A-1}`,seq:h.seq,timestamp:g.timestamp,message:g})),...t.slice(n+1)]}let s=i.length,o=Wut(Fut(t).flatMap(Qut)).tokens,a=qut(i,0,s,e.keepRecentTokens),c=a.isSplitTurn?a.turnStartIndex:a.firstKeptEntryIndex,u=[];for(let h=0;hJRe(e,n,c,u,s,o,l),a)}async function Vut(t,e,n,r){let{model:i,customInstructions:s,thinkingLevel:o}=e,{messagesToSummarize:a,turnPrefixMessages:c,retainedTail:u,isSplitTurn:l,tokensBefore:d,previousSummary:m,fileOps:h,settings:f}=t,g,A;if(l&&c.length>0){let S="No prior history.",C;if(a.length>0){let w=await $ut(a,{model:i,reserveTokens:f.reserveTokens,customInstructions:s,previousSummary:m,thinkingLevel:o},n,r);if(!w.ok)return fp(w.error);S=w.value.text,C=w.value.usage}let I=await U5i(c,i,f.reserveTokens,o,n,r);if(!I.ok)return fp(I.error);g=`${S} --- **Turn Context (split turn):** -${P.text}`,I=N?Qps(N,P.usage):P.usage}else{let R=await _Z(m,e,S.reserveTokens,n,r,i,s,y,o,a,c,u,l,d);C=R.text,I=R.usage}let{readFiles:x,modifiedFiles:w}=V0e(b);if(C+=j0e(x,w),!h)throw new Error("First kept entry has no UUID - session may need migration");return{summary:C,firstKeptEntryId:h,tokensBefore:A,usage:I,details:{readFiles:x,modifiedFiles:w}}}async function Kps(t,e,n,r,s,i,o,a,c,u,l,d){let h=Math.min(Math.floor(.5*n),e.maxTokens>0?e.maxTokens:Number.POSITIVE_INFINITY),m=aT(t),g=` -${ZM(m)} - - -${Yps}`,A=await z0e(e,xAn(g),CAn(e,h,r,s,i,o,a,d),c,u,l),y=K0e(A,"Turn prefix summarization");if(y)throw new Error(y);if(A.content.some(b=>b.type==="toolCall"))throw new Error("Turn prefix summarization attempted to call a tool");return{text:yc(A.content),usage:A.usage}}function X0e(t,e,n){if(!e)return{entries:[],commonAncestorId:null};let r=new Set(t.getBranch(e).map(c=>c.id)),s=t.getBranch(n),i=null;for(let c=s.length-1;c>=0;c--)if(r.has(s[c].id)){i=s[c].id;break}let o=[],a=e;for(;a&&a!==i;){let c=t.getEntry(a);if(!c)break;o.push(c),a=c.parentId}return o.reverse(),{entries:o,commonAncestorId:i}}function zps(t){switch(t.type){case"message":return t.message.role==="toolResult"?void 0:t.message;case"custom_message":return Q0e(t.customType,t.content,t.display,t.details,t.timestamp);case"branch_summary":return F0e(t.summary,t.fromId,t.timestamp);case"compaction":return o5(t.summary,t.tokensBefore,t.timestamp);case"thinking_level_change":case"model_change":case"custom":case"label":case"session_info":return}}function FJe(t,e=0){let n=[],r=H0e(),s=0;for(let i of t)if(i.type==="branch_summary"&&!i.fromHook&&i.details){let o=i.details;if(Array.isArray(o.readFiles))for(let a of o.readFiles)r.read.add(a);if(Array.isArray(o.modifiedFiles))for(let a of o.modifiedFiles)r.edited.add(a)}for(let i=t.length-1;i>=0;i--){let o=t[i],a=zps(o);if(!a)continue;bZ(a,r);let c=cT(a);if(e>0&&s+c>e){(o.type==="compaction"||o.type==="branch_summary")&&s -${b} +${I.value.text}`,A=C?uV(C,I.value.usage):I.value.usage}else{let S=await $ut(a,{model:i,reserveTokens:f.reserveTokens,customInstructions:s,previousSummary:m,thinkingLevel:o},n,r);if(!S.ok)return fp(S.error);g=S.value.text,A=S.value.usage}let{readFiles:y,modifiedFiles:E}=YRe(h);return g+=zRe(y,E),hp({summary:g,tokensBefore:d,usage:A,retainedTail:u,details:{readFiles:y,modifiedFiles:E}})}async function U5i(t,e,n,r,i,s){let o=Math.min(Math.floor(.5*n),e.maxTokens>0?e.maxTokens:Number.POSITIVE_INFINITY),a=YD(t),l=[{role:"user",content:[{type:"text",text:` +${zD(a)} -${S}`}],timestamp:Date.now()}],x=Math.min(4096,n.maxTokens>0?n.maxTokens:Number.POSITIVE_INFINITY),N=await z0e(n,{systemPrompt:Y0e,messages:I},{apiKey:r,headers:s,env:i,signal:o,maxTokens:x},l,d,h);if(N.stopReason==="aborted")return{aborted:!0};let P=K0e(N,"Branch summarization");if(P)return{error:P};if(N.content.some(H=>H.type==="toolCall"))return{error:"Branch summarization attempted to call a tool"};let G=yc(N.content);G=Jps+G;let{readFiles:$,modifiedFiles:Q}=V0e(A);return G+=j0e($,Q),{summary:G||"No summary generated",usage:N.usage,readFiles:$,modifiedFiles:Q}}p();var th="medium",eSe=["off","minimal","low","medium","high","xhigh","max"];p();var zE=require("fs"),lT=require("path");function vAn(t){let e=t.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);if(e)return{r:Number.parseInt(e[1],16),g:Number.parseInt(e[2],16),b:Number.parseInt(e[3],16)};let n=t.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(n)return{r:Number.parseInt(n[1],10),g:Number.parseInt(n[2],10),b:Number.parseInt(n[3],10)}}function Xps(t,e,n){let r=s=>{let i=s/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*r(t)+.7152*r(e)+.0722*r(n)}function QJe(t,e){let n=vAn(t);if(!n)return t;let r=s=>Math.min(255,Math.max(0,Math.round(s*e)));return`rgb(${r(n.r)}, ${r(n.g)}, ${r(n.b)})`}function RAn(t){let e=vAn(t);return e?Xps(e.r,e.g,e.b)>.5?{pageBg:QJe(t,.96),cardBg:t,infoBg:`rgb(${Math.min(255,e.r+10)}, ${Math.min(255,e.g+5)}, ${Math.max(0,e.b-20)})`}:{pageBg:QJe(t,.7),cardBg:QJe(t,.85),infoBg:`rgb(${Math.min(255,e.r+20)}, ${Math.min(255,e.g+15)}, ${e.b})`}:{pageBg:"rgb(24, 24, 30)",cardBg:"rgb(30, 30, 36)",infoBg:"rgb(60, 55, 40)"}}function Zps(t){let e=Fze(t),n=[];for(let[o,a]of Object.entries(e))n.push(`--${o}: ${a};`);let r=Qze(t),s=e.userMessageBg||"#343541",i=RAn(s);return n.push(`--exportPageBg: ${r.pageBg??i.pageBg};`),n.push(`--exportCardBg: ${r.cardBg??i.cardBg};`),n.push(`--exportInfoBg: ${r.infoBg??i.infoBg};`),n.join(` - `)}function kAn(t,e){let n=drn(),r=(0,zE.readFileSync)((0,lT.join)(n,"template.html"),"utf-8"),s=(0,zE.readFileSync)((0,lT.join)(n,"template.css"),"utf-8"),i=(0,zE.readFileSync)((0,lT.join)(n,"template.js"),"utf-8"),o=(0,zE.readFileSync)((0,lT.join)(n,"vendor","marked.min.js"),"utf-8"),a=(0,zE.readFileSync)((0,lT.join)(n,"vendor","highlight.min.js"),"utf-8"),c=Zps(e),u=Fze(e),l=Qze(e),d=RAn(u.userMessageBg||"#343541"),h=l.pageBg??d.pageBg,m=l.cardBg??d.cardBg,f=l.infoBg??d.infoBg,g=Buffer.from(JSON.stringify(t)).toString("base64"),A=s.replace("{{THEME_VARS}}",c).replace("{{BODY_BG}}",h).replace("{{CONTAINER_BG}}",m).replace("{{INFO_BG}}",f);return r.replace("{{CSS}}",A).replace("{{JS}}",i).replace("{{SESSION_DATA}}",g).replace("{{MARKED_JS}}",o).replace("{{HIGHLIGHT_JS}}",a)}var TAn=new Set(["bash","read","write","edit","ls"]);function ehs(t,e){let n={};for(let r of t){if(r.type!=="message")continue;let s=r.message;if(s.role==="assistant"&&Array.isArray(s.content)){for(let i of s.content)if(i.type==="toolCall"&&!TAn.has(i.name)){let o=e.renderCall(i.id,i.name,i.arguments);o&&(n[i.id]={callHtml:o})}}if(s.role==="toolResult"&&s.toolCallId){let i=s.toolName||"",o=n[s.toolCallId];if(o||!TAn.has(i)){let a=e.renderResult(s.toolCallId,i,s.content,s.details,s.isError||!1);a&&(n[s.toolCallId]={...o,resultHtmlCollapsed:a.collapsed,resultHtmlExpanded:a.expanded})}}}return n}async function NAn(t,e,n){let r=typeof n=="string"?{outputPath:n}:n||{},s=t.getSessionFile();if(!s)throw new Error("Cannot export in-memory session to HTML");if(!(0,zE.existsSync)(s))throw new Error("Nothing to export yet - start a conversation first");let i=t.getEntries(),o;r.toolRenderer&&(o=ehs(i,r.toolRenderer),Object.keys(o).length===0&&(o=void 0));let a={header:t.getHeader(),entries:i,leafId:t.getLeafId(),systemPrompt:e?.systemPrompt,tools:e?.tools?.map(l=>({name:l.name,description:l.description,parameters:l.parameters})),renderedTools:o},c=kAn(a,r.themeName),u=r.outputPath?Mo(r.outputPath):void 0;if(!u){let l=(0,lT.basename)(s,".jsonl");u=`${An}-session-${l}.html`}return(0,zE.writeFileSync)(u,c,"utf8"),u}async function DAn(t,e){let n=typeof e=="string"?{outputPath:e}:e||{},r=jn(t);if(!(0,zE.existsSync)(r))throw new Error(`File not found: ${r}`);let s=eo.open(r),i={header:s.getHeader(),entries:s.getEntries(),leafId:s.getLeafId(),systemPrompt:void 0,tools:void 0},o=kAn(i,n.themeName),a=n.outputPath?Mo(n.outputPath):void 0;if(!a){let c=(0,lT.basename)(r,".jsonl");a=`${An}-session-${c}.html`}return(0,zE.writeFileSync)(a,o,"utf8"),a}p();p();var IZ=["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"];function BAn(t){if(t<16)return IZ[t];if(t<232){let r=t-16,s=Math.floor(r/36),i=Math.floor(r%36/6),o=r%6,a=u=>u===0?0:55+u*40,c=u=>a(u).toString(16).padStart(2,"0");return`#${c(s)}${c(i)}${c(o)}`}let n=(8+(t-232)*10).toString(16).padStart(2,"0");return`#${n}${n}${n}`}function PAn(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function ths(){return{fg:null,bg:null,bold:!1,dim:!1,italic:!1,underline:!1}}function nhs(t){let e=[];return t.fg&&e.push(`color:${t.fg}`),t.bg&&e.push(`background-color:${t.bg}`),t.bold&&e.push("font-weight:bold"),t.dim&&e.push("opacity:0.6"),t.italic&&e.push("font-style:italic"),t.underline&&e.push("text-decoration:underline"),e.join(";")}function rhs(t){return t.fg!==null||t.bg!==null||t.bold||t.dim||t.italic||t.underline}function shs(t,e){let n=0;for(;n=30&&r<=37)e.fg=IZ[r-30];else if(r===38){if(t[n+1]===5&&t.length>n+2)e.fg=BAn(t[n+2]),n+=2;else if(t[n+1]===2&&t.length>n+4){let s=t[n+2],i=t[n+3],o=t[n+4];e.fg=`rgb(${s},${i},${o})`,n+=4}}else if(r===39)e.fg=null;else if(r>=40&&r<=47)e.bg=IZ[r-40];else if(r===48){if(t[n+1]===5&&t.length>n+2)e.bg=BAn(t[n+2]),n+=2;else if(t[n+1]===2&&t.length>n+4){let s=t[n+2],i=t[n+3],o=t[n+4];e.bg=`rgb(${s},${i},${o})`,n+=4}}else r===49?e.bg=null:r>=90&&r<=97?e.fg=IZ[r-90+8]:r>=100&&r<=107&&(e.bg=IZ[r-100+8]);n++}}var UJe=/\x1b\[([\d;]*)m/g;function ihs(t){let e=ths(),n="",r=0,s=!1;UJe.lastIndex=0;let i=UJe.exec(t);for(;i!==null;){let a=t.slice(r,i.index);a&&(n+=PAn(a));let c=i[1],u=c?c.split(";").map(l=>parseInt(l,10)||0):[0];s&&(n+="",s=!1),shs(u,e),rhs(e)&&(n+=``,s=!0),r=i.index+i[0].length,i=UJe.exec(t)}let o=t.slice(r);return o&&(n+=PAn(o)),s&&(n+=""),n}function tSe(t){return t.map(e=>`
    ${ihs(e)||" "}
    `).join("")}var ohs=/\x1b\[[\d;]*m/g;function OAn(t){return t.replace(ohs,"").trim().length===0}function MAn(t){let e=0,n=t.length;for(;ee&&OAn(t[n-1]);)n--;return t.slice(e,n)}function LAn(t){let{getToolDefinition:e,theme:n,cwd:r,width:s=100}=t,i=new Map,o=new Map,a=new Map,c=new Map,u=d=>{let h=a.get(d);return h||(h={},a.set(d,h)),h},l=(d,h,m,f,g)=>({args:c.get(d),toolCallId:d,invalidate:()=>{},lastComponent:h,state:u(d),cwd:r,executionStarted:!0,argsComplete:!0,isPartial:f,expanded:m,showImages:!1,isError:g});return{renderCall(d,h,m){try{c.set(d,m);let f=e(h);if(!f?.renderCall)return;let g=f.renderCall(m,n,l(d,i.get(d),!1,!0,!1));i.set(d,g);let A=g.render(s);return tSe(A)}catch{return}},renderResult(d,h,m,f,g){try{let A=e(h);if(!A?.renderResult)return;let y={content:m,details:f,isError:g},b=A.renderResult(y,{expanded:!1,isPartial:!1},n,l(d,o.get(d),!1,!1,g));o.set(d,b);let S=tSe(MAn(b.render(s))),C=A.renderResult(y,{expanded:!0,isPartial:!1},n,l(d,o.get(d),!0,!1,g));o.set(d,C);let I=tSe(MAn(C.render(s)));return{...S&&S!==I?{collapsed:S}:{},expanded:I}}catch{return}}}}p();p();var S0=Gt(require("node:fs"),1),Gbn=require("node:module"),dg=Gt(require("node:path"),1),Wbn=require("node:url");var gCe={};Ir(gCe,{AGENT_TELEMETRY_SCHEMAS:()=>gyn,AI_TELEMETRY_SCHEMA:()=>dXe,Agent:()=>RZ,AgentHarness:()=>hfs,BACKGROUND_CONTEXT:()=>JAn,BRANCH_SUMMARY_PREFIX:()=>syn,BRANCH_SUMMARY_SUFFIX:()=>iyn,BranchSummaryError:()=>rL,COMPACTION_SUMMARY_PREFIX:()=>nyn,COMPACTION_SUMMARY_SUFFIX:()=>ryn,Closed:()=>ry,CompactionError:()=>gT,DEFAULT_COMPACTION_SETTINGS:()=>BZ,DEFAULT_MAX_BYTES:()=>ZE,DEFAULT_MAX_LINES:()=>rD,ExecutionError:()=>hSe,FileError:()=>pSe,GREP_MAX_LINE_LENGTH:()=>Dqa,HARNESS_TELEMETRY_SCHEMA:()=>pXe,HarnessClosed:()=>ef,HarnessFault:()=>pT,InMemoryTelemetryContext:()=>wZ,InvalidLane:()=>nL,InvalidMessage:()=>ZC,InvalidNavigation:()=>ZN,JSONL_STORAGE_VERSION:()=>sI,JsonlSessionRepo:()=>rCe,LaneBusy:()=>XN,MemorySessionRepo:()=>iCe,NOOP_TELEMETRY_CONTEXT:()=>JN,NoActiveOperation:()=>tL,NoActiveRun:()=>oSe,NothingToCompact:()=>d5,NothingToResume:()=>u5,OperationMismatch:()=>l5,Result:()=>Cr,SessionBranchExistsError:()=>LZ,SessionInvalidBranchError:()=>E5,SessionInvariantError:()=>ln,SessionPendingAssistantMessageError:()=>nD,SessionUnknownTargetError:()=>FZ,SliceNotImplemented:()=>m5,StorageBackedSession:()=>bT,TODO_CONTEXT:()=>XAn,TaggedError:()=>lg,UnknownSkill:()=>p5,UnknownTarget:()=>dT,UnknownTemplate:()=>h5,agentLoop:()=>dhs,agentLoopContinue:()=>phs,appendList:()=>PZ,applyShellOutputUpdate:()=>R5,awaitWithContext:()=>hT,bashExecutionToText:()=>oyn,branchTip:()=>Ro,branchTipInventoryPrefix:()=>fXe,calculateContextTokens:()=>ESe,classifyForkAddress:()=>XSe,collectEntriesForBranchSummary:()=>byn,commitWrite:()=>hXe,compact:()=>myn,convertToLlm:()=>eD,createBashTool:()=>ebn,createBranchSummaryMessage:()=>mT,createCompactionSummaryMessage:()=>fT,createContextKey:()=>YJe,createCustomMessage:()=>Ihs,createEditTool:()=>Ebn,createForkSnapshot:()=>I5,createReadTool:()=>Ibn,createTypedSpanStarter:()=>WAn,createWriteTool:()=>xbn,defineTelemetrySchema:()=>$An,deleteList:()=>AT,deleteValue:()=>fa,entryLabel:()=>_0,err:()=>_d,estimateContextTokens:()=>ZJe,estimateTokens:()=>sL,executeShellWithCapture:()=>Egs,findCutPoint:()=>tXe,findTurnStartIndex:()=>eXe,formatPromptTemplateInvocation:()=>SXe,formatSize:()=>IT,formatSkillInvocation:()=>kXe,formatSkillsForSystemPrompt:()=>Ffs,generateBranchSummary:()=>_yn,generateSummary:()=>hyn,generateSummaryWithUsage:()=>nXe,getLastAssistantUsage:()=>pyn,getOrThrow:()=>A0,getOrUndefined:()=>lyn,getTelemetryContext:()=>Qh,insertEntry:()=>Sd,insertUsage:()=>sy,laneConfig:()=>nh,laneState:()=>pl,list:()=>vSe,loadPromptTemplates:()=>vyn,loadSkills:()=>Hyn,loadSourcedPromptTemplates:()=>Whs,loadSourcedSkills:()=>mms,matchError:()=>Chs,ok:()=>bd,operationMeta:()=>yT,operationPreparation:()=>E0,operationPreparationPrefix:()=>gXe,operationResult:()=>A5,operationScopeOf:()=>Hu,operationState:()=>y0,operationToolArgs:()=>y5,operationToolArgsPrefix:()=>OZ,operationToolMemo:()=>RSe,operationToolMemoPrefix:()=>MZ,parseCommandArgs:()=>Vhs,pendingAssistantFrames:()=>eI,pendingEntry:()=>bc,pendingToolOutput:()=>ET,pendingToolOutputPrefix:()=>AXe,prepareBranchEntries:()=>QZ,prepareCompaction:()=>iL,prepareStorageCommit:()=>xSe,reduceLaneSnapshot:()=>$En,resolveListReadOptions:()=>mXe,runAgentLoop:()=>rSe,runAgentLoopContinue:()=>sSe,sanitizeBinaryOutput:()=>XEn,serializeConversation:()=>tD,sessionName:()=>b0,setDefaultStreamFn:()=>nSe,setValue:()=>xr,shouldCompact:()=>bSe,startAiSpan:()=>fyn,startHarnessSpan:()=>CSe,streamProxy:()=>_gs,substituteArgs:()=>Nyn,toError:()=>f5,truncateHead:()=>oCe,truncateLine:()=>Gfs,truncateTail:()=>aCe,utf8ByteLength:()=>iI,uuidv7:()=>tl,validateCommittedWrites:()=>wSe,value:()=>dl,withAbortSignal:()=>ug,withCancel:()=>ZAn,withContextValue:()=>kZ,withTelemetryContext:()=>uSe,withoutAbortSignal:()=>lSe});p();p();p();function ahs(t,e){try{return Promise.resolve(e($Je))}catch(n){return Promise.reject(n)}}var $Je={startSpan:ahs,addEvent:()=>{},setAttributes:()=>{},setStatus:()=>{}};Object.freeze($Je);var JN=$Je;p();function FAn(t){return Array.isArray(t)?[...t]:t}function xZ(t){let e={};if(!t)return e;for(let[n,r]of Object.entries(t))r!==void 0&&(e[n]=FAn(r));return e}function chs(t,e){let n=xZ(t);for(let[r,s]of Object.entries(e))s!==void 0&&(n[r]=FAn(s));return n}function QAn(t){return t.status==="ok"?{status:"ok"}:t.error?{status:"error",error:{name:t.error.name,message:t.error.message}}:{status:"error"}}function lhs(t){try{if(t instanceof Error)return{status:"error",error:{name:t.name,message:t.message}}}catch{}return{status:"error"}}function GJe(t,e,n,r){e.settled||(n&&!e.explicitStatus&&(e.status=lhs(r)),e.settled=!0,e.endSequence=t.nextEndSequence++)}function uhs(t,e,n){let r=n.name,s=xZ(n.attributes);return{id:t.nextSpanId++,parentId:e?.id??null,name:r,attributes:s,events:[],status:{status:"ok"},explicitStatus:!1,settled:!1}}function UAn(t,e,n,r){if(e?.settled)return JN.startSpan(n,r);let s;try{s=uhs(t,e,n),t.spans.push(s)}catch{return JN.startSpan(n,r)}let i={startSpan:(a,c)=>UAn(t,s,a,c),addEvent(a,c){if(!s.settled)try{s.events.push({name:a,attributes:xZ(c)})}catch{}},setAttributes(a){if(!s.settled)try{s.attributes=chs(s.attributes,a)}catch{}},setStatus(a){if(!s.settled)try{s.status=QAn(a),s.explicitStatus=!0}catch{}}},o;try{o=r(i)}catch(a){return GJe(t,s,!0,a),Promise.reject(a)}return Promise.resolve(o).then(a=>(GJe(t,s,!1),a),a=>{throw GJe(t,s,!0,a),a})}var wZ=class{state={spans:[],nextSpanId:1,nextEndSequence:1};startSpan(e,n){return UAn(this.state,void 0,e,n)}getSpans(){return this.state.spans.map(e=>({id:e.id,parentId:e.parentId,name:e.name,attributes:xZ(e.attributes),events:e.events.map(n=>({name:n.name,attributes:xZ(n.attributes)})),status:QAn(e.status),settled:e.settled,...e.endSequence===void 0?{}:{endSequence:e.endSequence}}))}};function $An(t){return t}function GAn(t){return(n,r,s)=>t.startSpan({name:n,attributes:r},i=>s(i,GAn(i)))}function WAn(t,e){return GAn(t)}p();p();p();var WJe;function nSe(t){WJe=t}function TZ(){if(!WJe)throw new Error("No default stream function configured. Pass streamFn explicitly or call setDefaultStreamFn().");return WJe}function dhs(t,e,n,r,s){let i=qAn();return rSe(t,e,n,async o=>{i.push(o)},r,s).then(o=>{i.end(o)}),i}function phs(t,e,n,r){if(t.messages.length===0)throw new Error("Cannot continue: no messages in context");if(t.messages[t.messages.length-1].role==="assistant")throw new Error("Cannot continue from message role: assistant");let s=qAn();return sSe(t,e,async i=>{s.push(i)},n,r).then(i=>{s.end(i)}),s}async function rSe(t,e,n,r,s,i){let o=[...t],a={...e,messages:[...e.messages,...t]};await r({type:"agent_start"}),await r({type:"turn_start"});for(let c of t)await r({type:"message_start",message:c}),await r({type:"message_end",message:c});return await HAn(a,o,n,s,r,i??TZ()),o}async function sSe(t,e,n,r,s){if(t.messages.length===0)throw new Error("Cannot continue: no messages in context");if(t.messages[t.messages.length-1].role==="assistant")throw new Error("Cannot continue from message role: assistant");let i=[],o={...t};return await n({type:"agent_start"}),await n({type:"turn_start"}),await HAn(o,i,e,r,n,s??TZ()),i}function qAn(){return new RR(t=>t.type==="agent_end",t=>t.type==="agent_end"?t.messages:[])}async function HAn(t,e,n,r,s,i){let o=t,a=n,c,u=await a.getSteeringMessages?.()||[];for(;;){let l=!0;for(;l||u.length>0;){if(c){let g=await a.prepareNextTurn?.(c);g&&(o=g.context??o,a={...a,model:g.model??a.model,reasoning:g.thinkingLevel===void 0?a.reasoning:g.thinkingLevel==="off"?void 0:g.thinkingLevel}),u.length===0&&(u=await a.getSteeringMessages?.()||[]),await s({type:"turn_start"})}if(u.length>0){for(let g of u)await s({type:"message_start",message:g}),await s({type:"message_end",message:g}),o.messages.push(g),e.push(g);u=[]}let h=await hhs(o,a,r,s,i);if(e.push(h),h.stopReason==="error"||h.stopReason==="aborted"){await s({type:"turn_end",message:h,toolResults:[]}),await s({type:"agent_end",messages:e});return}let m=h.content.filter(g=>g.type==="toolCall"),f=[];if(l=!1,m.length>0){let g=h.stopReason==="length"?await mhs(m,s):await fhs(o,h,a,r,s);f.push(...g.messages),l=!g.terminate;for(let A of f)o.messages.push(A),e.push(A)}if(await s({type:"turn_end",message:h,toolResults:f}),c={message:h,toolResults:f,context:o,newMessages:e},await a.shouldStopAfterTurn?.(c)){await s({type:"agent_end",messages:e});return}u=await a.getSteeringMessages?.()||[]}let d=await a.getFollowUpMessages?.()||[];if(d.length>0){u=d;continue}break}await s({type:"agent_end",messages:e})}async function hhs(t,e,n,r,s){let i=t.messages;e.transformContext&&(i=await e.transformContext(i,n));let o=await e.convertToLlm(i),a={systemPrompt:t.systemPrompt,messages:o,tools:t.tools},c=(e.getApiKey?await e.getApiKey(e.model.provider):void 0)||e.apiKey,u=await s(e.model,a,{...e,apiKey:c,signal:n}),l=null,d=!1;for await(let m of u)switch(m.type){case"start":l=m.partial,t.messages.push(l),d=!0,await r({type:"message_start",message:{...l}});break;case"text_start":case"text_delta":case"text_end":case"thinking_start":case"thinking_delta":case"thinking_end":case"toolcall_start":case"toolcall_delta":case"toolcall_end":l&&(l=m.partial,t.messages[t.messages.length-1]=l,await r({type:"message_update",assistantMessageEvent:m,message:{...l}}));break;case"done":case"error":{let f=await u.result();return d?t.messages[t.messages.length-1]=f:t.messages.push(f),d||await r({type:"message_start",message:{...f}}),await r({type:"message_end",message:f}),f}}let h=await u.result();return d?t.messages[t.messages.length-1]=h:(t.messages.push(h),await r({type:"message_start",message:{...h}})),await r({type:"message_end",message:h}),h}async function mhs(t,e){let n=[];for(let r of t){await e({type:"tool_execution_start",toolCallId:r.id,toolName:r.name,args:r.arguments});let s={toolCall:r,result:uT(`Tool call "${r.name}" was not executed: the response hit the output token limit, so its arguments may be truncated. Re-issue the tool call with complete arguments.`),isError:!0};await vZ(s,e);let i=qJe(s);await HJe(i,e),n.push(i)}return{messages:n,terminate:!1}}async function fhs(t,e,n,r,s){let i=e.content.filter(a=>a.type==="toolCall"),o=i.some(a=>t.tools?.find(c=>c.name===a.name)?.executionMode==="sequential");return n.toolExecution==="sequential"||o?ghs(t,e,i,n,r,s):Ahs(t,e,i,n,r,s)}async function ghs(t,e,n,r,s,i){let o=[],a=[];for(let c of n){await i({type:"tool_execution_start",toolCallId:c.id,toolName:c.name,args:c.arguments});let u=await jAn(t,e,c,r,s),l;if(u.kind==="immediate")l={toolCall:c,result:u.result,isError:u.isError};else{let h=await YAn(u,s,i);l=await KAn(t,e,u,h,r,s)}await vZ(l,i);let d=qJe(l);if(await HJe(d,i),o.push(l),a.push(d),s?.aborted)break}return{messages:a,terminate:VAn(o)}}async function Ahs(t,e,n,r,s,i){let o=[];for(let u of n){await i({type:"tool_execution_start",toolCallId:u.id,toolName:u.name,args:u.arguments});let l=await jAn(t,e,u,r,s);if(l.kind==="immediate"){let d={toolCall:u,result:l.result,isError:l.isError};if(await vZ(d,i),o.push(d),s?.aborted)break;continue}if(o.push(async()=>{if(s?.aborted){let m={toolCall:u,result:uT("Operation aborted"),isError:!0};return await vZ(m,i),m}let d=await YAn(l,s,i),h=await KAn(t,e,l,d,r,s);return await vZ(h,i),h}),s?.aborted)break}let a=await Promise.all(o.map(u=>typeof u=="function"?u():Promise.resolve(u))),c=[];for(let u of a){let l=qJe(u);await HJe(l,i),c.push(l)}return{messages:c,terminate:VAn(a)}}function VAn(t){return t.length>0&&t.every(e=>e.result.terminate===!0)}function yhs(t,e){if(!t.prepareArguments)return e;let n=t.prepareArguments(e.arguments);return n===e.arguments?e:{...e,arguments:n}}async function jAn(t,e,n,r,s){let i=t.tools?.find(o=>o.name===n.name);if(!i)return{kind:"immediate",result:uT(`Tool ${n.name} not found`),isError:!0};try{let o=yhs(i,n),a=cM(i,o);if(r.beforeToolCall){let c=await r.beforeToolCall({assistantMessage:e,toolCall:n,args:a,context:t},s);if(s?.aborted)return{kind:"immediate",result:uT("Operation aborted"),isError:!0};if(c?.block){let u=uT(c.reason||"Tool execution was blocked");return c.terminate===!0&&(u.terminate=!0),{kind:"immediate",result:u,isError:!0}}}return s?.aborted?{kind:"immediate",result:uT("Operation aborted"),isError:!0}:{kind:"prepared",toolCall:n,tool:i,args:a}}catch(o){return{kind:"immediate",result:uT(o instanceof Error?o.message:String(o)),isError:!0}}}async function YAn(t,e,n){let r=[],s=!0;try{let i=await t.tool.execute(t.toolCall.id,t.args,e,o=>{s&&r.push(Promise.resolve(n({type:"tool_execution_update",toolCallId:t.toolCall.id,toolName:t.toolCall.name,args:t.toolCall.arguments,partialResult:o})))});return s=!1,await Promise.all(r),{result:i,isError:!1}}catch(i){return s=!1,await Promise.all(r),{result:uT(i instanceof Error?i.message:String(i)),isError:!0}}finally{s=!1}}async function KAn(t,e,n,r,s,i){let o=r.result,a=r.isError;if(s.afterToolCall)try{let c=await s.afterToolCall({assistantMessage:e,toolCall:n.toolCall,args:n.args,result:o,isError:a,context:t},i);c&&(o={...o,content:c.content??o.content,details:c.details??o.details,usage:c.usage??o.usage,terminate:c.terminate??o.terminate},a=c.isError??a)}catch(c){o=uT(c instanceof Error?c.message:String(c)),a=!0}return{toolCall:n.toolCall,result:o,isError:a}}function uT(t){return{content:[{type:"text",text:t}],details:{}}}async function vZ(t,e){await e({type:"tool_execution_end",toolCallId:t.toolCall.id,toolName:t.toolCall.name,result:t.result,isError:t.isError})}function qJe(t){return{role:"toolResult",toolCallId:t.toolCall.id,toolName:t.toolCall.name,content:t.result.content??[],details:t.result.details,usage:t.result.usage,...t.result.addedToolNames?.length?{addedToolNames:t.result.addedToolNames}:{},isError:t.isError,timestamp:Date.now()}}async function HJe(t,e){await e({type:"message_start",message:t}),await e({type:"message_end",message:t})}function Ehs(t){return t.filter(e=>e.role==="user"||e.role==="assistant"||e.role==="toolResult")}var bhs={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},_hs={id:"unknown",name:"unknown",api:"unknown",provider:"unknown",baseUrl:"",reasoning:!1,input:[],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:0,maxTokens:0};function Shs(t){let e=t?.tools?.slice()??[],n=t?.messages?.slice()??[];return{systemPrompt:t?.systemPrompt??"",model:t?.model??_hs,thinkingLevel:t?.thinkingLevel??"off",get tools(){return e},set tools(r){e=r.slice()},get messages(){return n},set messages(r){n=r.slice()},isStreaming:!1,streamingMessage:void 0,pendingToolCalls:new Set,errorMessage:void 0}}var iSe=class{messages=[];mode;constructor(e){this.mode=e}enqueue(e){this.messages.push(e)}hasItems(){return this.messages.length>0}drain(){if(this.mode==="all"){let n=this.messages.slice();return this.messages=[],n}let e=this.messages[0];return e?(this.messages=this.messages.slice(1),[e]):[]}clear(){this.messages=[]}},RZ=class{_state;listeners=new Set;steeringQueue;followUpQueue;convertToLlm;transformContext;streamFunction;getApiKey;onPayload;onResponse;beforeToolCall;afterToolCall;shouldStopAfterTurn;prepareNextTurn;prepareNextTurnWithContext;activeRun;sessionId;thinkingBudgets;transport;maxRetryDelayMs;toolExecution;constructor(e){let n=e??{};this._state=Shs(n.initialState),this.convertToLlm=n.convertToLlm??Ehs,this.transformContext=n.transformContext,this.streamFunction=n.streamFn??TZ(),this.getApiKey=n.getApiKey,this.onPayload=n.onPayload,this.onResponse=n.onResponse,this.beforeToolCall=n.beforeToolCall,this.afterToolCall=n.afterToolCall,this.shouldStopAfterTurn=n.shouldStopAfterTurn,this.prepareNextTurn=n.prepareNextTurn,this.prepareNextTurnWithContext=n.prepareNextTurnWithContext,this.steeringQueue=new iSe(n.steeringMode??"one-at-a-time"),this.followUpQueue=new iSe(n.followUpMode??"one-at-a-time"),this.sessionId=n.sessionId,this.thinkingBudgets=n.thinkingBudgets,this.transport=n.transport??"auto",this.maxRetryDelayMs=n.maxRetryDelayMs,this.toolExecution=n.toolExecution??"parallel"}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}get state(){return this._state}set steeringMode(e){this.steeringQueue.mode=e}get steeringMode(){return this.steeringQueue.mode}set followUpMode(e){this.followUpQueue.mode=e}get followUpMode(){return this.followUpQueue.mode}steer(e){this.steeringQueue.enqueue(e)}followUp(e){this.followUpQueue.enqueue(e)}clearSteeringQueue(){this.steeringQueue.clear()}clearFollowUpQueue(){this.followUpQueue.clear()}clearAllQueues(){this.clearSteeringQueue(),this.clearFollowUpQueue()}hasQueuedMessages(){return this.steeringQueue.hasItems()||this.followUpQueue.hasItems()}get signal(){return this.activeRun?.abortController.signal}abort(){this.activeRun?.abortController.abort()}waitForIdle(){return this.activeRun?.promise??Promise.resolve()}reset(){if(this.activeRun)throw new Error("Agent is already processing. Wait for completion before resetting.");this._state.messages=[],this._state.isStreaming=!1,this._state.streamingMessage=void 0,this._state.pendingToolCalls=new Set,this._state.errorMessage=void 0,this.clearFollowUpQueue(),this.clearSteeringQueue()}async prompt(e,n){if(this.activeRun)throw new Error("Agent is already processing a prompt. Use steer() or followUp() to queue messages, or wait for completion.");let r=this.normalizePromptInput(e,n);await this.runPromptMessages(r)}async continue(){if(this.activeRun)throw new Error("Agent is already processing. Wait for completion before continuing.");let e=this._state.messages[this._state.messages.length-1];if(!e)throw new Error("No messages to continue from");if(e.role==="assistant"){let n=this.steeringQueue.drain();if(n.length>0){await this.runPromptMessages(n,{skipInitialSteeringPoll:!0});return}let r=this.followUpQueue.drain();if(r.length>0){await this.runPromptMessages(r);return}throw new Error("Cannot continue from message role: assistant")}await this.runContinuation()}normalizePromptInput(e,n){if(Array.isArray(e))return e;if(typeof e!="string")return[e];let r=[{type:"text",text:e}];return n&&n.length>0&&r.push(...n),[{role:"user",content:r,timestamp:Date.now()}]}async runPromptMessages(e,n={}){await this.runWithLifecycle(async r=>{await rSe(e,this.createContextSnapshot(),this.createLoopConfig(n),s=>this.processEvents(s),r,this.streamFunction)})}async runContinuation(){await this.runWithLifecycle(async e=>{await sSe(this.createContextSnapshot(),this.createLoopConfig(),n=>this.processEvents(n),e,this.streamFunction)})}createContextSnapshot(){return{systemPrompt:this._state.systemPrompt,messages:this._state.messages.slice(),tools:this._state.tools.slice()}}createLoopConfig(e={}){let n=e.skipInitialSteeringPoll===!0,r=this.shouldStopAfterTurn;return{model:this._state.model,reasoning:this._state.thinkingLevel==="off"?void 0:this._state.thinkingLevel,sessionId:this.sessionId,onPayload:this.onPayload,onResponse:this.onResponse,transport:this.transport,thinkingBudgets:this.thinkingBudgets,maxRetryDelayMs:this.maxRetryDelayMs,toolExecution:this.toolExecution,beforeToolCall:this.beforeToolCall,afterToolCall:this.afterToolCall,shouldStopAfterTurn:r?async s=>await r(s,this.signal):void 0,prepareNextTurn:this.prepareNextTurnWithContext||this.prepareNextTurn?async s=>this.prepareNextTurnWithContext?await this.prepareNextTurnWithContext(s,this.signal):await this.prepareNextTurn?.(this.signal):void 0,convertToLlm:this.convertToLlm,transformContext:this.transformContext,getApiKey:this.getApiKey,getSteeringMessages:async()=>n?(n=!1,[]):this.steeringQueue.drain(),getFollowUpMessages:async()=>this.followUpQueue.drain()}}async runWithLifecycle(e){if(this.activeRun)throw new Error("Agent is already processing.");let n=new AbortController,r=()=>{},s=new Promise(i=>{r=i});this.activeRun={promise:s,resolve:r,abortController:n},this._state.isStreaming=!0,this._state.streamingMessage=void 0,this._state.errorMessage=void 0;try{await e(n.signal)}catch(i){await this.handleRunFailure(i,n.signal.aborted)}finally{this.finishRun()}}async handleRunFailure(e,n){let r={role:"assistant",content:[{type:"text",text:""}],api:this._state.model.api,provider:this._state.model.provider,model:this._state.model.id,usage:bhs,stopReason:n?"aborted":"error",errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()};await this.processEvents({type:"message_start",message:r}),await this.processEvents({type:"message_end",message:r}),await this.processEvents({type:"turn_end",message:r,toolResults:[]}),await this.processEvents({type:"agent_end",messages:[r]})}finishRun(){this._state.isStreaming=!1,this._state.streamingMessage=void 0,this._state.pendingToolCalls=new Set,this.activeRun?.resolve(),this.activeRun=void 0}async processEvents(e){switch(e.type){case"message_start":this._state.streamingMessage=e.message;break;case"message_update":this._state.streamingMessage=e.message;break;case"message_end":this._state.streamingMessage=void 0,this._state.messages.push(e.message);break;case"tool_execution_start":{let r=new Set(this._state.pendingToolCalls);r.add(e.toolCallId),this._state.pendingToolCalls=r;break}case"tool_execution_end":{let r=new Set(this._state.pendingToolCalls);r.delete(e.toolCallId),this._state.pendingToolCalls=r;break}case"turn_end":e.message.role==="assistant"&&e.message.errorMessage&&(this._state.errorMessage=e.message.errorMessage);break;case"agent_end":this._state.streamingMessage=void 0;break}let n=this.activeRun?.abortController.signal;if(!n)throw new Error("Agent listener invoked outside active run");for(let r of this.listeners)await r(e,n)}};p();p();var Cr={ok(t){return{ok:!0,value:t}},err(t){return{ok:!1,error:t}},isOk(t){return t.ok},isErr(t){return!t.ok}};function lg(t){class e extends Error{_tag=t;constructor(r){super(r.message),this.name=t,Object.assign(this,r)}toJSON(){let r={};for(let s of Object.keys(this))s!=="_tag"&&(r[s]=this[s]);return{_tag:t,message:this.message,...r}}static is(r){return r instanceof e}}return e}var XN=class extends lg("LaneBusy"){},l5=class extends lg("OperationMismatch"){},oSe=class extends lg("NoActiveRun"){},tL=class extends lg("NoActiveOperation"){},u5=class extends lg("NothingToResume"){},d5=class extends lg("NothingToCompact"){},ZC=class extends lg("InvalidMessage"){},ZN=class extends lg("InvalidNavigation"){},p5=class extends lg("UnknownSkill"){},h5=class extends lg("UnknownTemplate"){},dT=class extends lg("UnknownTarget"){},nL=class extends lg("InvalidLane"){},ry=class extends lg("Closed"){},pT=class extends Error{cause;constructor(e,n){super(e),this.name="HarnessFault",this.cause=n}},ef=class extends Error{constructor(){super("AgentHarness was closed while the operation was active"),this.name="HarnessClosed"}};function Chs(t,e){let n=e[t._tag];return n(t)}p();p();p();var jJe=Object.freeze({token:Symbol("chord.abortSignal")}),aSe=class{get abortSignal(){return this.value(jJe)}},cSe=class extends aSe{#e;constructor(e){super(),this.#e=e}value(e){}toString(){return this.#e}},VJe=class extends aSe{#e;#t;#n;constructor(e,n,r){super(),this.#e=e,this.#t=n,this.#n=r}value(e){return e.token===this.#t.token?this.#n:this.#e.value(e)}toString(){return`${this.#e}.WithValue(${this.#t.token.description??"anonymous"})`}},JAn=new cSe("[Context BACKGROUND_CONTEXT]"),XAn=new cSe("[Context TODO_CONTEXT]");function YJe(t){return Object.freeze({token:Symbol(t)})}function kZ(t,e,n){return new VJe(n,t,e)}function ug(t,e){let n=e.abortSignal,r=n===void 0?t:AbortSignal.any([n,t]);return kZ(jJe,r,e)}function lSe(t){return kZ(jJe,void 0,t)}function ZAn(t){let e=new AbortController;return{context:ug(e.signal,t),cancel:n=>e.abort(n)}}function hT(t,e){let n=e.abortSignal;return n===void 0?t:n.aborted?Promise.reject(zAn(n)):new Promise((r,s)=>{let i=()=>s(zAn(n));n.addEventListener("abort",i,{once:!0}),t.then(o=>{n.removeEventListener("abort",i),r(o)},o=>{n.removeEventListener("abort",i),s(o)})})}function zAn(t){let e=t.reason;return e instanceof Error?e:new DOMException("The operation was aborted","AbortError")}var eyn=YJe("pi.telemetryContext");function Qh(t){return t.value(eyn)??JN}function uSe(t,e){return kZ(eyn,t,e)}p();var Uh=class extends Error{cancellation;constructor(e){super("Abort requested"),this.name="AbortRequested",this.cancellation=e}};function tyn(){let t={status:"open"},e=new AbortController,n=()=>{if(t.status==="aborting")throw new Uh(t.cancellation);if(t.status==="closed")throw t.error};return{gate:{admit(r){return n(),r()},signal:e.signal},control:{beginAbort(r){t.status==="open"&&(t={status:"aborting",cancellation:r})},signalAbort(){t.status!=="aborting"||e.signal.aborted||e.abort(new Uh(t.cancellation))},close(r){t.status!=="closed"&&(t={status:"closed",error:r},e.signal.aborted||e.abort(r))}}}}var m5=class extends Error{constructor(e){super(`${e} is not implemented until its later AgentHarness slice`),this.name="SliceNotImplemented"}},dSe=class{operationId;completion;gate;context;waitForRetry;closeSignal;deferredPermits;control;closeController;resolveCompletion;rejectCompletion;constructor(e,n){this.operationId=e.operationId,this.context=lSe(n),this.waitForRetry=e.waitForRetry??!1,this.deferredPermits=e.pollDeferred===!0?1:0;let r,s;this.completion=new Promise((a,c)=>{r=a,s=c}),this.resolveCompletion=r,this.rejectCompletion=s,this.completion.catch(()=>{});let{gate:i,control:o}=tyn();this.gate=i,this.control=o,this.closeController=new AbortController,this.closeSignal=this.closeController.signal}settle(e){this.resolveCompletion(e)}fail(e){this.rejectCompletion(e)}beginAbort(e){this.control.beginAbort(e)}signalAbort(){this.control.signalAbort()}closeGate(e){this.control.close(e),this.closeSignal.aborted||this.closeController.abort(e),this.rejectCompletion(e)}};p();p();p();var nyn=`The conversation history before this point was compacted into the following summary: - - -`,ryn=` -`,syn=`The following is a summary of a branch that this conversation came back from: - - -`,iyn="";function oyn(t){let e=`Ran \`${t.command}\` -`;return t.output?e+=`\`\`\` -${t.output} -\`\`\``:e+="(no output)",t.cancelled?e+=` - -(command cancelled)`:t.exitCode!==null&&t.exitCode!==void 0&&t.exitCode!==0&&(e+=` - -Command exited with code ${t.exitCode}`),t.truncated&&t.fullOutputPath&&(e+=` - -[Output truncated. Full output: ${t.fullOutputPath}]`),e}function mT(t,e,n){return{role:"branchSummary",summary:t,fromId:e,timestamp:typeof n=="number"?n:new Date(n).getTime()}}function fT(t,e,n){return{role:"compactionSummary",summary:t,tokensBefore:e,timestamp:typeof n=="number"?n:new Date(n).getTime()}}function Ihs(t,e,n,r,s){return{role:"custom",customType:t,content:e,display:n,details:r,timestamp:typeof s=="number"?s:new Date(s).getTime()}}function eD(t){return t.map(e=>{switch(e.role){case"bashExecution":return e.excludeFromContext?void 0:{role:"user",content:[{type:"text",text:oyn(e)}],timestamp:e.timestamp};case"custom":return{role:"user",content:typeof e.content=="string"?[{type:"text",text:e.content}]:e.content,timestamp:e.timestamp};case"branchSummary":return{role:"user",content:[{type:"text",text:syn+e.summary+iyn}],timestamp:e.timestamp};case"compactionSummary":return{role:"user",content:[{type:"text",text:nyn+e.summary+ryn}],timestamp:e.timestamp};case"user":case"assistant":case"toolResult":return e;default:return}}).filter(e=>e!==void 0)}p();function KJe(t){let e,n=-1;for(let r=t.length-1;r>=0;r--){let s=t[r];if(s?.type==="compaction"){e=s,n=r;break}}return e===void 0?[...t]:[e,...t.slice(n+1)]}function ayn(t){return t.role!=="assistant"||t.stopReason!=="error"&&t.stopReason!=="aborted"&&t.stopReason!=="deferred"}function zJe(t){switch(t.type){case"message":return ayn(t.message)?[t.message]:[];case"compaction":return[fT(t.summary,t.tokensBefore,t.timestamp),...t.retainedTail.filter(ayn)];case"branch_summary":return t.summary?[mT(t.summary,t.fromId,t.timestamp)]:[];case"custom":return[]}}async function cyn(t,e,n){e??={};let r=KJe(t),s=[];for(let i of r){if(i.type!=="custom"){s.push(...zJe(i));continue}let o=e.entryProjectors?.[i.customType];o!==void 0&&s.push(...await o(i,n)??[])}return s}p();function bd(t){return{ok:!0,value:t}}function _d(t){return{ok:!1,error:t}}function A0(t){if(!t.ok)throw t.error;return t.value}function lyn(t){return t.ok?t.value:void 0}function f5(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);try{return new Error(JSON.stringify(t))}catch{return new Error(String(t))}}var pSe=class extends Error{code;path;constructor(e,n,r,s){super(n,s===void 0?void 0:{cause:s}),this.name="FileError",this.code=e,this.path=r}},hSe=class extends Error{code;constructor(e,n,r){super(n,r===void 0?void 0:{cause:r}),this.name="ExecutionError",this.code=e}},gT=class extends Error{code;constructor(e,n,r){super(n,r===void 0?void 0:{cause:r}),this.name="CompactionError",this.code=e}},rL=class extends Error{code;constructor(e,n,r){super(n,r===void 0?void 0:{cause:r}),this.name="BranchSummaryError",this.code=e}};p();function mSe(){return{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}function g5(t,e){return{input:t.input+e.input,output:t.output+e.output,cacheRead:t.cacheRead+e.cacheRead,cacheWrite:t.cacheWrite+e.cacheWrite,...t.cacheWrite1h===void 0&&e.cacheWrite1h===void 0?{}:{cacheWrite1h:(t.cacheWrite1h??0)+(e.cacheWrite1h??0)},...t.reasoning===void 0&&e.reasoning===void 0?{}:{reasoning:(t.reasoning??0)+(e.reasoning??0)},totalTokens:t.totalTokens+e.totalTokens,cost:{input:t.cost.input+e.cost.input,output:t.cost.output+e.cost.output,cacheRead:t.cost.cacheRead+e.cost.cacheRead,cacheWrite:t.cost.cacheWrite+e.cost.cacheWrite,total:t.cost.total+e.cost.total}}}p();function fSe(){return{read:new Set,written:new Set,edited:new Set}}function NZ(t,e){if(t.role==="assistant"&&!(!("content"in t)||!Array.isArray(t.content)))for(let n of t.content){if(typeof n!="object"||n===null||!("type"in n)||n.type!=="toolCall"||!("arguments"in n)||!("name"in n))continue;let r=n.arguments;if(!r)continue;let s=typeof r.path=="string"?r.path:void 0;if(s)switch(n.name){case"read":e.read.add(s);break;case"write":e.written.add(s);break;case"edit":e.edited.add(s);break}}}function gSe(t){let e=new Set([...t.edited,...t.written]),n=[...t.read].filter(s=>!e.has(s)).sort(),r=[...e].sort();return{readFiles:n,modifiedFiles:r}}function ASe(t,e){let n=[];return t.length>0&&n.push(` -${t.join(` -`)} -`),e.length>0&&n.push(` -${e.join(` -`)} -`),n.length===0?"":` - -${n.join(` - -`)}`}var xhs=2e3;function whs(t){try{return JSON.stringify(t)??"undefined"}catch{return"[unserializable]"}}function Ths(t,e){if(t.length<=e)return t;let n=t.length-e;return`${t.slice(0,e)} - -[... ${n} more characters truncated]`}function tD(t){let e=[];for(let n of t)if(n.role==="user"){let r=yc(n.content,"");r&&e.push(`[User]: ${r}`)}else if(n.role==="assistant"){let r=[],s=[];for(let i of n.content)if(i.type==="thinking")r.push(i.thinking);else if(i.type==="toolCall"){let o=i.arguments,a=Object.entries(o).map(([c,u])=>`${c}=${whs(u)}`).join(", ");s.push(`${i.name}(${a})`)}r.length>0&&e.push(`[Assistant thinking]: ${r.join(` -`)}`),n.content.some(i=>i.type==="text")&&e.push(`[Assistant]: ${yc(n.content)}`),s.length>0&&e.push(`[Assistant tool calls]: ${s.join("; ")}`)}else if(n.role==="toolResult"){let r=yc(n.content,"");r&&e.push(`[Tool result]: ${Ths(r,xhs)}`)}return e.join(` - -`)}function vhs(t){try{return JSON.stringify(t)??"undefined"}catch{return"[unserializable]"}}function Rhs(t,e,n){let r=fSe();if(n>=0){let s=e[n];if(typeof s.details=="object"&&s.details!==null&&!Array.isArray(s.details)){if(Array.isArray(s.details.readFiles))for(let i of s.details.readFiles)typeof i=="string"&&r.read.add(i);if(Array.isArray(s.details.modifiedFiles))for(let i of s.details.modifiedFiles)typeof i=="string"&&r.edited.add(i)}}for(let s of t)NZ(s,r);return r}function khs(t){if(t.type==="message")return t.message;if(t.type==="branch_summary")return mT(t.summary,t.fromId,t.timestamp);if(t.type==="compaction")return fT(t.summary,t.tokensBefore,t.timestamp)}function JJe(t){if(t.type!=="compaction")return khs(t)}function DZ(t,e){return{...t,signal:e.abortSignal,telemetryContext:Qh(e),cacheRetention:"none",sessionId:t.sessionId??tl()}}async function ySe(t,e,n,r,s,i,o){let a=DZ(r,o);return x7(()=>t.completeSimple(e,n,a),s,a.signal,i)}var BZ={enabled:!0,reserveTokens:16384,keepRecentTokens:2e4};function ESe(t){return t.totalTokens||t.input+t.output+t.cacheRead+t.cacheWrite}function dyn(t){if(t.role==="assistant"&&"usage"in t){let e=t;if(e.stopReason!=="aborted"&&e.stopReason!=="error"&&e.usage&&ESe(e.usage)>0)return e.usage}}function pyn(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type==="message"){let r=dyn(n.message);if(r)return r}}}function Nhs(t){for(let e=t.length-1;e>=0;e--){let n=dyn(t[e]);if(n)return{usage:n,index:e}}}function ZJe(t){let e=Nhs(t);if(!e){let s=0;for(let i of t)s+=sL(i);return{tokens:s,usageTokens:0,trailingTokens:s,lastUsageIndex:null}}let n=ESe(e.usage),r=0;for(let s=e.index+1;se-n.reserveTokens:!1}var Dhs=4800;function uyn(t){if(typeof t=="string")return t.length;let e=0;for(let n of t)n.type==="text"&&n.text?e+=n.text.length:n.type==="image"&&(e+=Dhs);return e}function sL(t){let e=0;switch(t.role){case"user":return e=uyn(t.content),Math.ceil(e/4);case"assistant":{let n=t;for(let r of n.content)r.type==="text"?e+=r.text.length:r.type==="thinking"?e+=r.thinking.length:r.type==="toolCall"&&(e+=r.name.length+vhs(r.arguments).length);return Math.ceil(e/4)}case"custom":case"toolResult":return e=uyn(t.content),Math.ceil(e/4);case"bashExecution":return e=t.command.length+t.output.length,Math.ceil(e/4);case"branchSummary":case"compactionSummary":return e=t.summary.length,Math.ceil(e/4)}return 0}function Bhs(t,e,n){let r=[];for(let s=e;s=n;r--){let s=t[r];if(s.type==="branch_summary")return r;if(s.type==="message"){let i=s.message.role;if(i==="user"||i==="bashExecution")return r}}return-1}function tXe(t,e,n,r){let s=Bhs(t,e,n);if(s.length===0)return{firstKeptEntryIndex:e,turnStartIndex:-1,isSplitTurn:!1};let i=0,o=s[0];for(let l=n-1;l>=e;l--){let d=t[l];if(d.type!=="message")continue;let h=sL(d.message);if(i+=h,i>=r){for(let m=0;m=l){o=s[m];break}break}}for(;o>e;){let l=t[o-1];if(l.type==="compaction"||l.type==="message")break;o--}let a=t[o],c=a.type==="message"&&a.message.role==="user",u=c?-1:eXe(t,o,e);return{firstKeptEntryIndex:o,turnStartIndex:u,isSplitTurn:!c&&u!==-1}}var _Se=`You are a context summarization assistant. Your task is to read a conversation between a user and an AI assistant, then produce a structured summary following the exact format specified. +${Q5i}`}],timestamp:Date.now()}],d=e.reasoning&&r&&r!=="off"?{maxTokens:o,reasoning:r}:{maxTokens:o},m=await i({systemPrompt:eke,messages:l},tse(d,s),s);return m.stopReason==="aborted"?fp(new KR("aborted",m.errorMessage||"Turn prefix summarization aborted")):m.stopReason==="error"?fp(new KR("summarization_failed",`Turn prefix summarization failed: ${m.errorMessage||"Unknown error"}`)):hp({text:aa(m.content),usage:m.usage})}var nse,M5i,eke,L5i,F5i,Q5i,dV=v(()=>{p();qo();TE();CQ();Uut();vb();jRe();KRe();KRe();nse={enabled:!0,reserveTokens:16384,keepRecentTokens:2e4};M5i=4800;eke=`You are a context summarization assistant. Your task is to read a conversation between a user and an AI assistant, then produce a structured summary following the exact format specified. -Do NOT continue the conversation. Do NOT respond to any questions in the conversation. ONLY output the structured summary.`,Phs=`The messages above are a conversation to summarize. Create a structured context checkpoint summary that another LLM will use to continue the work. +Do NOT continue the conversation. Do NOT respond to any questions in the conversation. ONLY output the structured summary.`,L5i=`The messages above are a conversation to summarize. Create a structured context checkpoint summary that another LLM will use to continue the work. Use this EXACT format: @@ -1681,7 +1586,7 @@ Use this EXACT format: - [Any data, examples, or references needed to continue] - [Or "(none)" if not applicable] -Keep each section concise. Preserve exact file paths, function names, and error messages.`,Ohs=`The messages above are NEW conversation messages to incorporate into the existing summary provided in tags. +Keep each section concise. Preserve exact file paths, function names, and error messages.`,F5i=`The messages above are NEW conversation messages to incorporate into the existing summary provided in tags. Update the existing structured summary with new information. RULES: - PRESERVE all existing information from the previous summary @@ -1718,17 +1623,7 @@ Use this EXACT format: ## Critical Context - [Preserve important context, add new if needed] -Keep each section concise. Preserve exact file paths, function names, and error messages.`;async function hyn(t,e,n,r,s,i,o,a,c,u){let l=await nXe(t,e,n,r,s,i,o,a,c,u);return l.ok?bd(l.value.text):_d(l.error)}function nXe(t,e,n,r,s,i,o,a,c,u){return XJe(t,{model:n,reserveTokens:r,customInstructions:s,previousSummary:i,thinkingLevel:o},(l,d,h)=>ySe(e,n,l,d,a,c,h),u)}async function XJe(t,e,n,r){let{model:s,reserveTokens:i,customInstructions:o,previousSummary:a,thinkingLevel:c}=e,u=Math.min(Math.floor(.8*i),s.maxTokens>0?s.maxTokens:Number.POSITIVE_INFINITY),l=a?Ohs:Phs;o&&(l=`${l} - -Additional focus: ${o}`);let d=eD(t),m=` -${tD(d)} - - -`;a&&(m+=` -${a} - - -`),m+=l;let f=[{role:"user",content:[{type:"text",text:m}],timestamp:Date.now()}],g=s.reasoning&&c&&c!=="off"?{maxTokens:u,reasoning:c}:{maxTokens:u},A=await n({systemPrompt:_Se,messages:f},DZ(g,r),r);if(A.stopReason==="aborted")return _d(new gT("aborted",A.errorMessage||"Summarization aborted"));if(A.stopReason==="error")return _d(new gT("summarization_failed",`Summarization failed: ${A.errorMessage||"Unknown error"}`));let y=yc(A.content);return bd({text:y,usage:A.usage})}function iL(t,e){if(t.length===0||t[t.length-1].type==="compaction")return bd(void 0);let n=-1;for(let m=t.length-1;m>=0;m--)if(t[m].type==="compaction"){n=m;break}let r,s=t;if(n>=0){let m=t[n];r=m.summary,s=[...m.retainedTail.map((g,A)=>({type:"message",id:`${m.id}:retained:${A}`,parentId:A===0?m.id:`${m.id}:retained:${A-1}`,seq:m.seq,timestamp:g.timestamp,message:g})),...t.slice(n+1)]}let i=s.length,o=ZJe(KJe(t).flatMap(zJe)).tokens,a=tXe(s,0,i,e.keepRecentTokens),c=a.isSplitTurn?a.turnStartIndex:a.firstKeptEntryIndex,u=[];for(let m=0;mySe(e,n,c,u,i,o,l),a)}async function rXe(t,e,n,r){let{model:s,customInstructions:i,thinkingLevel:o}=e,{messagesToSummarize:a,turnPrefixMessages:c,retainedTail:u,isSplitTurn:l,tokensBefore:d,previousSummary:h,fileOps:m,settings:f}=t,g,A;if(l&&c.length>0){let C="No prior history.",I;if(a.length>0){let w=await XJe(a,{model:s,reserveTokens:f.reserveTokens,customInstructions:i,previousSummary:h,thinkingLevel:o},n,r);if(!w.ok)return _d(w.error);C=w.value.text,I=w.value.usage}let x=await Lhs(c,s,f.reserveTokens,o,n,r);if(!x.ok)return _d(x.error);g=`${C} - ---- - -**Turn Context (split turn):** +Be concise. Focus on what's needed to understand the kept suffix.`});function zut(t){let e=new Set;for(let n of t){if(e.has(n.name))throw new TypeError(`Duplicate tool name: ${JSON.stringify(n.name)}`);e.add(n.name)}}function Kut(t){if(!Number.isSafeInteger(t.maxRetries)||t.maxRetries<0||t.maxRetries===Number.MAX_SAFE_INTEGER||!Number.isSafeInteger(t.baseDelayMs)||t.baseDelayMs<0||t.maxAgentDelayMs!==void 0&&(!Number.isSafeInteger(t.maxAgentDelayMs)||t.maxAgentDelayMs<0))throw new RangeError("Retry policy values must be finite non-negative safe integers")}function Jut(t){if(!Number.isSafeInteger(t.reserveTokens)||t.reserveTokens<0||!Number.isSafeInteger(t.keepRecentTokens)||t.keepRecentTokens<0)throw new RangeError("Compaction token counts must be finite non-negative safe integers")}var Yut,IHn=v(()=>{p();qo();Yut={enabled:!0,maxRetries:3,baseDelayMs:1e3,maxAgentDelayMs:KN}});var tke,Xut,wHn=v(()=>{p();tke=class{listeners=new Map;watchListeners=new Set;deliveryTail=Promise.resolve();closedError;on(e,n){if(this.closedError!==void 0)throw this.closedError;let r=(s,o)=>n(s,o),i=this.listeners.get(e);return i===void 0&&(i=new Set,this.listeners.set(e,i)),i.add(r),()=>i?.delete(r)}emit(e,n){return this.emitBatch([e],n)}emitBatch(e,n){if(this.closedError!==void 0||e.length===0)return Promise.resolve();let r=e.map(s=>{let o=structuredClone(s);return{payload:o,recipients:this.snapshotRecipients(o)}}),i=this.deliveryTail.then(async()=>{for(let{payload:s,recipients:o}of r)await this.deliver(s,o,!0,n)});return this.deliveryTail=i.catch(()=>{}),i}watch(e,n,r,i){if(this.closedError!==void 0)throw this.closedError;return this.installWatcher(e,n,i)}async watchFromSnapshot(e,n,r){if(this.closedError!==void 0)throw this.closedError;let i=this.installWatcher(void 0,n,async(s,o)=>{let a=await e(s);return o(),a});try{return i.setSnapshot(await e(r)),i}catch(s){throw i.unsubscribe(),s}}close(e){this.closedError??=e,this.deliveryTail.finally(()=>{this.listeners.clear(),this.watchListeners.clear()})}installWatcher(e,n,r){let i,s=r===void 0?void 0:async a=>{let c=!1,u=await r(a,()=>{if(c)throw new Error("Resnapshot boundary was already marked");c=!0,this.enqueueBarrier(()=>i.markResnapshotBoundary())});if(!c)throw new Error("Resnapshot capture did not mark its boundary");return u};i=new Xut(e,s,async(a,c,u)=>{if(c.type==="handler_error")return;let l=a instanceof Error?a:new Error(String(a)),d="lane"in c&&typeof c.lane=="string"?c.lane:void 0;await this.emit({type:"handler_error",kind:"event",event:c.type,error:l.message,...l.stack===void 0?{}:{stack:l.stack},...d===void 0?{}:{lane:d}},u)});let o=(a,c)=>{n(a)&&i.push(a,c)};return this.watchListeners.add(o),i.setUnsubscribe(()=>this.watchListeners.delete(o)),i}enqueueBarrier(e){let n=this.deliveryTail.then(e);this.deliveryTail=n.catch(()=>{})}snapshotRecipients(e){return[...this.listeners.get(e.type)??[],...this.watchListeners]}async deliver(e,n,r,i){for(let s of n)try{await s(structuredClone(e),i)}catch(o){if(!r||e.type==="handler_error")continue;let a=o instanceof Error?o:new Error(String(o)),c="lane"in e&&typeof e.lane=="string"?e.lane:void 0,u={type:"handler_error",kind:"event",event:e.type,error:a.message,...a.stack===void 0?{}:{stack:a.stack},...c===void 0?{}:{lane:c}};await this.deliver(u,this.snapshotRecipients(u),!1,i)}}},Xut=class{snapshot;resnapshotCallback;onError;buffer=[];listener;unsubscribeCallback;deliveryTail=Promise.resolve();epoch=0;resnapshotState;state="buffering";constructor(e,n,r){this.snapshot=e,this.resnapshotCallback=n,this.onError=r}setSnapshot(e){this.snapshot=e}start(e){if(this.state!=="buffering")throw new Error("WatchHandle.start() may be called only once");this.state="started",this.listener=e;let n=this.buffer;this.buffer=[];for(let r of n)this.enqueue(r.event,r.context,r.epoch)}async resnapshot(e){if(this.state==="unsubscribed")throw new Error("WatchHandle is unsubscribed");if(this.resnapshotCallback===void 0)throw new Error("WatchHandle does not support resnapshot");if(this.resnapshotState!==void 0)throw new Error("WatchHandle resnapshot is already in progress");let n,r=new Promise(s=>{n=s}),i={phase:"dropping",held:[],reached:r,resolveReached:n};this.epoch++,this.resnapshotState=i;try{let s=await this.resnapshotCallback(e);await r,this.snapshot=s,this.resnapshotState=void 0;for(let o of i.held)this.push(o.event,o.context);return s}catch(s){this.resnapshotState=void 0;for(let o of i.held)this.push(o.event,o.context);throw s}}markResnapshotBoundary(){let e=this.resnapshotState;e===void 0||e.phase!=="dropping"||(e.phase="holding",e.resolveReached())}unsubscribe(){this.state!=="unsubscribed"&&(this.state="unsubscribed",this.buffer=[],this.listener=void 0,this.unsubscribeCallback?.(),this.unsubscribeCallback=void 0)}push(e,n){if(this.state!=="unsubscribed"&&this.resnapshotState?.phase!=="dropping"){if(this.resnapshotState?.phase==="holding"){this.resnapshotState.held.push({event:e,context:n});return}if(this.state==="buffering"){this.buffer.push({event:e,context:n,epoch:this.epoch});return}this.enqueue(e,n,this.epoch)}}setUnsubscribe(e){this.unsubscribeCallback=e}enqueue(e,n,r){let i=this.listener;i!==void 0&&(this.deliveryTail=this.deliveryTail.then(async()=>{this.state==="started"&&r===this.epoch&&await i(e,n)}).catch(async s=>{try{await this.onError(s,e,n)}catch{}}))}}});function THn(t,e,n,r){return Kh(r).startSpan({name:t,attributes:e},i=>n(i,URe(i,r)))}function nke(t,e,n,r){return Kh(r).startSpan({name:t,attributes:e},i=>n(i,URe(i,r)))}var tdt,G5i,$5i,Zut,edt,ndt,vHn,rdt=v(()=>{p();TE();tdt={version:1,spans:{"pi.ai.request":{description:"One logical request to an AI provider",parents:{kind:"any"},startAttributes:{"pi.ai.operation":{type:"string",required:!0,values:["stream","fetch_deferred","cancel_deferred","generate_images"],description:"Logical provider operation"},"pi.ai.provider":{type:"string",required:!0,description:"Selected provider id"},"pi.ai.model":{type:"string",required:!0,description:"Requested model id"},"pi.ai.api":{type:"string",required:!0,description:"Provider API id"},"pi.ai.streaming":{type:"boolean",required:!0,description:"Whether this operation returns a stream"},"pi.ai.deferred":{type:"boolean",required:!1,description:"Whether the operation requests or participates in deferred execution"}},endAttributes:{"pi.ai.response.model":{type:"string",description:"Concrete response model"},"pi.ai.response.id":{type:"string",cardinality:"high",description:"Provider response id"},"pi.ai.response.stop_reason":{type:"string",values:["stop","length","tool_use","error","aborted","deferred"],description:"Normalized terminal response reason"},"pi.ai.http.status_code":{type:"number",description:"Final HTTP status"},"pi.ai.usage.input_tokens":{type:"number",description:"Reported input tokens"},"pi.ai.usage.output_tokens":{type:"number",description:"Reported output tokens"},"pi.ai.usage.cache_read_tokens":{type:"number",description:"Reported cache-read tokens"},"pi.ai.usage.cache_write_tokens":{type:"number",description:"Reported cache-write tokens"},"pi.ai.usage.reasoning_tokens":{type:"number",description:"Reported reasoning tokens"},"pi.ai.usage.total_tokens":{type:"number",description:"Reported total tokens"},"pi.ai.usage.cost":{type:"number",description:"Reported total cost"},"pi.ai.stream.chunk_count":{type:"number",description:"Streamed update chunk count"},"pi.ai.stream.time_to_first_chunk_ms":{type:"number",description:"Elapsed milliseconds to first update chunk"},"pi.ai.error.type":{type:"string",cardinality:"low",description:"Provider or transport error class"}},status:{default:"ok",errorWhen:"The operation throws or returns an error result"}}}};G5i=["before_run","before_drive","before_run_end","transform_context","before_request","before_payload","after_response","before_tool","after_tool","before_compaction","before_navigation"],$5i=["run_start","run_resume","run_suspend","operation_abort","run_end","fault","handler_error","turn_start","turn_end","retry_scheduled","retry_start","retry_end","message_start","message_update","message_end","tool_start","tool_update","tool_end","entry_added","queue_update","value_update","config_update","compaction_start","compaction_end","navigation_start","navigation_end","lane_created","usage"],Zut={"pi.session.id":{type:"string",required:!0,cardinality:"high",description:"Session id"},"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.operation.recovery":{type:"boolean",required:!0,description:"Whether this invocation resumes durable work"}},edt={"pi.error.code":{type:"string",cardinality:"low",description:"Stable operation error code"},"pi.error.type":{type:"string",cardinality:"low",description:"Low-cardinality operation error class"}},ndt={version:1,spans:{"pi.harness.run":{description:"One admitted in-process run invocation",parents:{kind:"root_or_external"},startAttributes:{...Zut,"pi.operation.kind":{type:"string",required:!0,values:["run"],description:"Run operation kind"}},endAttributes:{"pi.operation.outcome":{type:"string",values:["completed","aborted","failed","suspended"],description:"Run invocation outcome"},...edt},status:{default:"ok",errorWhen:"The run fails or throws"}},"pi.harness.compaction":{description:"One admitted in-process manual compaction invocation",parents:{kind:"root_or_external"},startAttributes:{...Zut,"pi.operation.kind":{type:"string",required:!0,values:["compaction"],description:"Compaction operation kind"}},endAttributes:{"pi.operation.outcome":{type:"string",values:["completed","declined","aborted","failed"],description:"Compaction invocation outcome"},...edt},status:{default:"ok",errorWhen:"The compaction fails or throws"}},"pi.harness.navigation":{description:"One admitted in-process navigation invocation",parents:{kind:"root_or_external"},startAttributes:{...Zut,"pi.operation.kind":{type:"string",required:!0,values:["navigation"],description:"Navigation operation kind"}},endAttributes:{"pi.operation.outcome":{type:"string",values:["completed","declined","aborted","failed"],description:"Navigation invocation outcome"},...edt},status:{default:"ok",errorWhen:"The navigation fails or throws"}},"pi.harness.checkpoint":{description:"One run checkpoint",parents:{kind:"spans",spans:["pi.harness.run"]},startAttributes:{"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.checkpoint.kind":{type:"string",required:!0,values:["normal","abort_reconcile"],description:"Checkpoint purpose"}},endAttributes:{},status:{default:"ok",errorWhen:"Checkpoint work throws"}},"pi.harness.turn":{description:"One assistant response and its tool batch",parents:{kind:"spans",spans:["pi.harness.run"]},startAttributes:{"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.turn.id":{type:"string",required:!0,cardinality:"high",description:"Invocation-local turn id"}},endAttributes:{},status:{default:"ok",errorWhen:"Turn work throws"}},"pi.harness.step":{description:"One durable retry attempt",parents:{kind:"spans",spans:["pi.harness.turn","pi.harness.checkpoint","pi.harness.compaction","pi.harness.navigation"]},startAttributes:{"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.step.kind":{type:"string",required:!0,values:["assistant","compaction","branch_summary"],description:"Retryable step kind"},"pi.step.attempt":{type:"number",required:!0,description:"One-based durable attempt number"},"pi.compaction.reason":{type:"string",required:!1,values:["manual","threshold","overflow"],description:"Compaction trigger"}},endAttributes:{"pi.step.outcome":{type:"string",values:["succeeded","retry","failed","aborted","deferred","overflow"],description:"Attempt outcome"}},status:{default:"ok",errorWhen:"The attempt retries, fails, or throws"}},"pi.harness.tool":{description:"One raw phase-2 tool execution",parents:{kind:"spans",spans:["pi.harness.turn","pi.harness.run"]},startAttributes:{"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.turn.id":{type:"string",required:!1,cardinality:"high",description:"Invocation-local live turn id"},"pi.tool.name":{type:"string",required:!0,description:"Tool name"},"pi.tool.call_id":{type:"string",required:!0,cardinality:"high",description:"Tool call id"},"pi.tool.replay":{type:"string",required:!0,values:["never","safe"],description:"Declared replay policy"},"pi.tool.recovery":{type:"boolean",required:!0,description:"Whether this is recovery execution"}},endAttributes:{"pi.tool.is_error":{type:"boolean",description:"Whether raw phase-2 execution returned an error"}},status:{default:"ok",errorWhen:"Raw phase-2 execution returns an error"}},"pi.harness.hook":{description:"One registered hook handler invocation",parents:{kind:"any"},startAttributes:{"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!1,cardinality:"high",description:"Durable operation id when accepted"},"pi.hook.name":{type:"string",required:!0,values:G5i,description:"Hook name"},"pi.hook.registration_id":{type:"string",required:!1,description:"Optional hook registration metadata"}},endAttributes:{"pi.hook.outcome":{type:"string",values:["completed","skipped","blocked","failed"],description:"Handler outcome"}},status:{default:"ok",errorWhen:"The handler throws"}},"pi.harness.sleep":{description:"One retry delay",parents:{kind:"spans",spans:["pi.harness.run","pi.harness.compaction","pi.harness.navigation","pi.harness.turn","pi.harness.checkpoint"]},startAttributes:{"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.sleep.delay_ms":{type:"number",required:!0,description:"Requested delay in milliseconds"}},endAttributes:{"pi.sleep.outcome":{type:"string",values:["elapsed","aborted"],description:"Delay outcome"}},status:{default:"ok",errorWhen:"Sleep work throws"}},"pi.harness.event_handler":{description:"One passive event listener invocation",parents:{kind:"any"},startAttributes:{"pi.event.type":{type:"string",required:!0,cardinality:"low",values:$5i,description:"Delivered harness event type"},"pi.lane.name":{type:"string",required:!1,cardinality:"high",description:"Lane name for lane-scoped events"}},endAttributes:{},status:{default:"ok",errorWhen:"The listener throws"}},"pi.session.write":{description:"One committed session transaction",parents:{kind:"any"},startAttributes:{"pi.session.id":{type:"string",required:!0,cardinality:"high",description:"Session id"},"pi.lane.name":{type:"string",required:!1,cardinality:"high",description:"Lane name when supplied by the caller"},"pi.operation.id":{type:"string",required:!1,cardinality:"high",description:"Durable operation id when supplied by the caller"},"pi.session.item_count":{type:"number",required:!0,description:"Number of writes in the transaction"},"pi.session.item_kinds":{type:"string[]",required:!0,elementValues:["entry","usage","value","list"],description:"Distinct write kinds in the transaction"}},endAttributes:{"pi.session.first_seq":{type:"number",description:"First committed sequence in the transaction"},"pi.session.last_seq":{type:"number",description:"Last committed sequence in the transaction"}},status:{default:"ok",errorWhen:"Storage rejects the transaction"}}}},vHn=[tdt,ndt]});function vQ(t,e){let n={...t};for(let r of["transport","timeoutMs","maxRetries","maxRetryDelayMs","cacheRetention","deferred"]){if(!(r in e))continue;let i=e[r];i===void 0?delete n[r]:Object.assign(n,{[r]:i})}if("headers"in e)if(e.headers===void 0)delete n.headers;else{let r={...n.headers};for(let[i,s]of Object.entries(e.headers))s===void 0?delete r[i]:r[i]=s;n.headers=r}if("metadata"in e)if(e.metadata===void 0)delete n.metadata;else{let r={...n.metadata};for(let[i,s]of Object.entries(e.metadata))s===void 0?delete r[i]:r[i]=s;n.metadata=r}return n}function W5i(t,e){let n={};for(let r of["transport","timeoutMs","maxRetries","maxRetryDelayMs","cacheRetention","deferred"])t[r]!==e[r]&&Object.assign(n,{[r]:e[r]});if(t.headers!==e.headers)if(e.headers===void 0)n.headers=void 0;else{let r={};for(let i of Object.keys(t.headers??{}))i in e.headers||(r[i]=void 0);for(let[i,s]of Object.entries(e.headers))t.headers?.[i]!==s&&(r[i]=s);t.headers===void 0&&Object.keys(r).length===0?n.headers={}:Object.keys(r).length!==0&&(n.headers=r)}if(t.metadata!==e.metadata)if(e.metadata===void 0)n.metadata=void 0;else{let r={};for(let i of Object.keys(t.metadata??{}))i in e.metadata||(r[i]=void 0);for(let[i,s]of Object.entries(e.metadata))t.metadata?.[i]!==s&&(r[i]=s);t.metadata===void 0&&Object.keys(r).length===0?n.metadata={}:Object.keys(r).length!==0&&(n.metadata=r)}return n}var rke,rse=v(()=>{p();TE();rdt();rke=class{registrations=new Map;reportError;closedError;constructor(e){this.reportError=e}on(e,n,r={}){if(this.closedError!==void 0)throw this.closedError;let i=this.registrations.get(e)??[],s={...r.id===void 0?{}:{id:r.id},handler:(o,a)=>n(o,a)};return i.push(s),this.registrations.set(e,i),()=>{let o=i.indexOf(s);o!==-1&&i.splice(o,1)}}has(e){return(this.registrations.get(e)?.length??0)!==0}runWithGate(e,n,r,i){return r.admit(()=>{let s=PA(r.signal,i);return s.abortSignal?.throwIfAborted(),this.runAdmitted(e,n,s)})}runToolWithGate(e,n,r,i){return r.admit(()=>{let s=PA(r.signal,i);return s.abortSignal?.throwIfAborted(),e==="before_tool"?this.beforeTool(n,s):this.afterTool(n,s)})}close(e){this.closedError??=e}async runAdmitted(e,n,r){if(this.closedError!==void 0)throw this.closedError;return await this.aggregate(e,n,r)}async aggregate(e,n,r){switch(e){case"before_run":return this.beforeRun(n,r);case"before_drive":await this.invokeAllFailClosed(e,n,r);return;case"before_run_end":{let i;return await this.invokeAll(e,n,s=>{let o=s;o?.followUp!==void 0&&(i=o.followUp)},r),i===void 0?void 0:{followUp:i}}case"transform_context":return this.transformContext(n,r);case"before_request":return this.beforeRequest(n,r);case"before_payload":return this.beforePayload(n,r);case"after_response":return this.afterResponse(n,r);case"before_tool":return this.beforeTool(n,r);case"after_tool":return this.afterTool(n,r);case"before_compaction":return this.firstStructural(e,n,"compaction",r);case"before_navigation":return this.firstStructural(e,n,"summary",r)}}async beforeRun(e,n){let r=e.prompt,i=[];for(let s of this.registrationsFor("before_run"))try{let o=await s.handler({...e,prompt:r},n);o?.messages!==void 0&&(i=[...i,...o.messages],r=[...r,...o.messages])}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),"before_run",e.lane,n)}return i.length===0?void 0:{messages:i}}async beforeTool(e,n){let r=e.args,i;for(let s of this.registrationsFor("before_tool"))try{let o=await this.invokeToolRegistration("before_tool",s,{...e,args:r},n);if(o?.args!==void 0&&(r=o.args),o?.block!==void 0){i=o.block;break}}catch(o){let a=o instanceof Error?o:new Error(String(o));await this.reportError(a,"before_tool",e.lane,n),i={reason:a.message};break}return{...r===e.args?{}:{args:r},...i===void 0?{}:{block:i}}}async transformContext(e,n){let r=e.messages,i=e.systemPrompt;for(let s of this.registrationsFor("transform_context"))try{let o=await s.handler({...e,messages:r,systemPrompt:i},n);o?.messages!==void 0&&(r=o.messages),o?.systemPrompt!==void 0&&(i=o.systemPrompt)}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),"transform_context",e.lane,n)}return{messages:r,systemPrompt:i}}async beforeRequest(e,n){let r=e.streamOptions,i=!1;for(let s of this.registrationsFor("before_request"))try{let o=await s.handler({...e,streamOptions:r},n);o?.streamOptions!==void 0&&(r=vQ(r,o.streamOptions),i=!0)}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),"before_request",e.lane,n)}return i?{streamOptions:W5i(e.streamOptions,r)}:void 0}async beforePayload(e,n){let r=e.payload;for(let i of this.registrationsFor("before_payload"))try{let s=await i.handler({...e,payload:r},n);s?.payload!==void 0&&(r=s.payload)}catch(s){await this.reportError(s instanceof Error?s:new Error(String(s)),"before_payload",e.lane,n)}return{payload:r}}async afterResponse(e,n){let r=e.message;for(let i of this.registrationsFor("after_response"))try{let s=await i.handler({...e,message:r},n);s?.message!==void 0&&(r=s.message)}catch(s){await this.reportError(s instanceof Error?s:new Error(String(s)),"after_response",e.lane,n)}return{message:r}}async afterTool(e,n){let r={content:e.content,details:e.details,isError:e.isError,usage:e.usage},i={};for(let s of this.registrationsFor("after_tool"))try{let o=await this.invokeToolRegistration("after_tool",s,{...e,...r},n);if(o===void 0)continue;o.content!==void 0&&(i.content=o.content),o.details!==void 0&&(i.details=o.details),o.isError!==void 0&&(i.isError=o.isError),o.usage!==void 0&&(i.usage=o.usage),o.terminate!==void 0&&(i.terminate=o.terminate),r={content:o.content===void 0?r.content:o.content,details:o.details===void 0?r.details:o.details,isError:o.isError===void 0?r.isError:o.isError,usage:o.usage===void 0?r.usage:o.usage}}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),"after_tool",e.lane,n)}return Object.keys(i).length===0?void 0:i}async firstStructural(e,n,r,i){for(let s of this.registrationsFor(e))try{let o=await s.handler(n,i);if(o==null||typeof o!="object")continue;let a=o;if(a.decline===!0&&a[r]!==void 0){await this.reportError(new Error(`${e} hook cannot return both decline and ${r}`),e,n.lane,i);continue}if(a.decline===!0||a[r]!==void 0)return o}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),e,n.lane,i)}}invokeToolRegistration(e,n,r,i){return nke("pi.harness.hook",{"pi.lane.name":r.lane,"pi.operation.id":r.runId,"pi.hook.name":e,...n.id===void 0?{}:{"pi.hook.registration_id":n.id}},async(s,o)=>{try{let a=await n.handler(r,o),c=e==="before_tool"&&a!==null&&typeof a=="object"&&"block"in a&&a.block!==void 0;return s.setAttributes({"pi.hook.outcome":c?"blocked":"completed"}),a}catch(a){throw s.setAttributes({"pi.hook.outcome":"failed"}),s.setStatus({status:"error"}),a}},i)}registrationsFor(e){return[...this.registrations.get(e)??[]]}async invokeAllFailClosed(e,n,r){for(let i of this.registrationsFor(e))try{await i.handler(n,r)}catch(s){let o=s instanceof Error?s:new Error(String(s));throw await this.reportError(o,e,n.lane,r),o}}async invokeAll(e,n,r,i){for(let s of this.registrationsFor(e))try{r(await s.handler(n,i))}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),e,n.lane,i)}}}});function gp(t){return{kind:"entry",entry:t}}function vE(t){return{kind:"usage",row:t}}function idt(t,e,n){switch(t.kind){case"entry":return{kind:"entry",...t.entry,seq:e,timestamp:n};case"usage":return{kind:"usage",...t.row,seq:e};case"value":return t.op==="set"?{kind:"value",op:"set",seq:e,namespace:t.namespace,key:t.key,value:t.value}:{kind:"value",op:"delete",seq:e,namespace:t.namespace,key:t.key};case"list":return t.op==="append"?{kind:"list",op:"append",seq:e,namespace:t.namespace,key:t.key,value:t.value}:{kind:"list",op:"delete",seq:e,namespace:t.namespace,key:t.key}}}function RHn(t,e,n){return{...t,seq:e,timestamp:n}}function ike(t,e,n){let r=t.map((i,s)=>idt(i,e+s,n));return{writes:r,result:{firstSeq:e,seqs:r.map(i=>i.seq),timestamp:n}}}function ske(t,e,n){let r=e-1,i=new Set,s=new Set;for(let o of t){if(o.seq<=r)throw new Error(`Non-monotonic storage sequence: ${o.seq}`);if(r=o.seq,!(o.kind!=="entry"&&o.kind!=="usage")){if(n.hasEntryOrUsageId(o.id)||i.has(o.id))throw new Error(`Duplicate entry or usage id: ${o.id}`);if(o.kind==="entry"&&o.parentId!==null&&!n.hasEntryId(o.parentId)&&!s.has(o.parentId))throw new Error(`Missing parent entry: ${o.parentId}`);i.add(o.id),o.kind==="entry"&&s.add(o.id)}}}var Rb=v(()=>{p()});var oke,kHn=v(()=>{p();oke=class{tail=Promise.resolve();sealedError;run(e){if(this.sealedError!==void 0)return Promise.reject(this.sealedError);let n=this.tail.then(()=>{if(this.sealedError!==void 0)throw this.sealedError;return e()});return this.tail=n.then(()=>{},()=>{}),n}seal(e){return this.sealedError??=e,this.tail}}});function BHn(t,e){if(t.length===0)throw new TypeError("Value namespace must not be empty");if(t.includes("\0"))throw new TypeError("Value namespace must not contain \\u0000");if(e.includes("\0"))throw new TypeError("Value key must not contain \\u0000")}function nu(t,e=""){return BHn(t,e),Object.freeze({namespace:t,key:e,kind:"value"})}function ake(t,e=""){return BHn(t,e),Object.freeze({namespace:t,key:e,kind:"list"})}function fr(t,e){return{kind:"value",op:"set",namespace:t.namespace,key:t.key,value:e}}function Ga(t){return{kind:"value",op:"delete",namespace:t.namespace,key:t.key}}function ise(t,e){return{kind:"list",op:"append",namespace:t.namespace,key:t.key,value:e}}function JR(t){return{kind:"list",op:"delete",namespace:t.namespace,key:t.key}}function sdt(t={}){let e=t.limit??1e3;if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("List read limit must be a positive safe integer");return{...t.cursor===void 0?{}:{cursor:t.cursor},order:t.order??"asc",limit:Math.min(e,1e4)}}var Mo,odt,xg,Ml,pV,XR,gS,mV,cke,AS,sse,ose,adt,ll,ZR,Aw,cdt,yw,yS,Ap=v(()=>{p();Mo=t=>nu("pi.branch.tip",t),odt=()=>nu("pi.branch.tip"),xg=t=>nu("pi.lane.config",t),Ml=t=>nu("pi.lane.state",t),pV=t=>nu("pi.result",t),XR=t=>nu("pi.op.meta",t),gS=t=>nu("pi.op.state",t),mV=(t,e,n)=>nu("pi.op.tool_args",`${t}:${e}:${n}`),cke=(t,e,n)=>nu("pi.op.tool_memo",`${t}:${e}:${n}`),AS=(t,e)=>nu("pi.op.preparation",`${t}:${e}`),sse=(t,e)=>nu("pi.op.tool_args",e===void 0?`${t}:`:`${t}:${e}:`),ose=(t,e)=>nu("pi.op.tool_memo",e===void 0?`${t}:`:`${t}:${e}:`),adt=t=>nu("pi.op.preparation",`${t}:`),ll=t=>nu("pi.pending.entry",t),ZR=(t,e)=>nu("pi.pending.tool_output",`${t}:${e}`),Aw=(t,e)=>ake("pi.pending.assistant_frame",`${t}:${e}`),cdt=t=>nu("pi.pending.tool_output",`${t}:`),yw=nu("pi.session.name"),yS=t=>nu("pi.entry.label",t)});var un,hV,ase,KD,cse,ldt,udt,ek,yp=v(()=>{p();kN();Rb();kHn();Ap();un=class extends Error{constructor(e){super(e),this.name="SessionInvariantError"}},hV=class extends Error{branch;reason;constructor(e,n){super(`Invalid branch ${JSON.stringify(e)}: ${n}`),this.name="SessionInvalidBranchError",this.branch=e,this.reason=n}},ase=class extends Error{branch;constructor(e){super(`Branch already exists: ${e}`),this.name="SessionBranchExistsError",this.branch=e}},KD=class extends Error{constructor(){super("Cannot persist a pending assistant message"),this.name="SessionPendingAssistantMessageError"}},cse=class extends Error{targetId;constructor(e){super(`Unknown target: ${e}`),this.name="SessionUnknownTargetError",this.targetId=e}},ldt=class{storage;release;active=!0;commitResult;endPromise;constructor(e,n){this.storage=e,this.release=n}commit(e,n){if(this.assertActive(),this.commitResult!==void 0)return Promise.reject(new Error("SessionMutator commit already attempted"));try{for(let r of e)if(r.kind==="entry"&&r.entry.type==="message"&&r.entry.message.role==="assistant"&&r.entry.message.stopReason==="pending")throw new KD;this.commitResult=this.storage.commit(e,n)}catch(r){this.commitResult=Promise.reject(r)}return this.commitResult}end(e){return this.endPromise!==void 0?this.endPromise:(this.active=!1,this.endPromise=this.settle().finally(this.release),this.endPromise)}getEntries(e,n){return this.assertActive(),this.storage.getEntries(e,n)}getStats(e){return this.assertActive(),this.storage.getStats(e)}getValue(e,n){return this.assertActive(),this.storage.getValue(e,n)}scanValues(e,n){return this.assertActive(),this.storage.scanValues(e,n)}readList(e,n,r){return this.assertActive(),this.storage.readList(e,n,r)}scanBranch(e,n){return this.assertActive(),this.storage.scanBranch(e,n)}settle(){return this.commitResult?.then(()=>{},()=>{})??Promise.resolve()}assertActive(){if(!this.active)throw new Error("SessionMutator cannot be used outside its mutation callback")}},udt=class{name;session;constructor(e,n){this.name=e,this.session=n}getTipId(e){return this.session.getBranchTip(this.name,e)}async findEntries(e,n){e??={};let r=e.start??await this.getTipId(n);return r===null?[]:this.session.scanBranch({...e,start:r,order:e.order??"newestFirst"},n)}async findEntry(e,n){return e??={},(await this.findEntries({...e,limit:e.limit===void 0?1:Math.min(e.limit,1)},n))[0]}appendMessage(e,n){return this.session.appendToBranch(this.name,{type:"message",message:e},n)}appendCustomEntry(e,n,r){return this.session.appendToBranch(this.name,{type:"custom",customType:e,...n===void 0?{}:{data:n}},r)}},ek=class{metadata;idGenerator;storage;mutationLine;onClose;branches=new Map;closedError=new Error("Session is closed");state="open";closePromise;constructor(e,n,r={}){this.metadata=e,this.idGenerator=r.idGenerator??{next:Oc},this.storage=n,this.mutationLine=r.mutationLine??new oke,this.onClose=r.onClose}async beginMutation(e){this.assertOpen();let n,r,i=new Promise((c,u)=>{n=c,r=u}),s,o=new Promise(c=>{s=c});return this.mutationLine.run(async()=>{n(new ldt(this.storage,s)),await o}).catch(r),i}async mutate(e,n){let r=await this.beginMutation(n);try{return await e(r,n)}finally{await r.end(n)}}async getEntries(e,n){return this.assertOpen(),this.storage.getEntries(e,n)}async getEntry(e,n){return(await this.getEntries([e],n)).get(e)}async getValue(e,n){return this.assertOpen(),this.storage.getValue(e,n)}async scanValues(e,n){return this.assertOpen(),this.storage.scanValues(e,n)}async readList(e,n,r){return this.assertOpen(),this.storage.readList(e,n,r)}async scanBranch(e,n){return this.assertOpen(),this.storage.scanBranch(e,n)}async getStats(e){return this.assertOpen(),this.storage.getStats(e)}async getName(e){return(await this.getValue(yw,e))?.value}async getLabel(e,n){return(await this.getValue(yS(e),n))?.value}async findEntries(e,n){e??={},this.assertOpen();let r=e.order??"desc";if(e.cursor!==void 0){if(r==="asc"&&e.cursor.seq===Number.MAX_SAFE_INTEGER)return[];if(r==="desc"&&e.cursor.seq<=1)return[]}return this.storage.scanEntries({type:e.type,customType:e.customType,order:r,limit:e.limit,...e.cursor===void 0?{}:r==="asc"?{fromSeq:e.cursor.seq+1}:{toSeq:e.cursor.seq-1}},n)}async findEntry(e,n){return e??={},(await this.findEntries({...e,limit:e.limit===void 0?1:Math.min(e.limit,1)},n))[0]}async branch(e,n){if(this.assertValidBranchName(e),await this.getValue(Mo(e),n)!==void 0)return this.getOrCreateBranchObject(e)}async createBranch(e,n,r){return this.assertOpen(),this.assertValidBranchName(e),await this.mutate(async i=>{if(await i.getValue(Mo(e),r)!==void 0)throw new ase(e);if(n!==null&&!(await i.getEntries([n],r)).has(n))throw new cse(n);await i.commit([fr(Mo(e),n)],r)},r),this.getOrCreateBranchObject(e)}setValue(e,n,r){return this.mutate(async i=>{await i.commit([fr(e,n)],r)},r)}deleteValue(e,n){return this.mutate(async r=>{await r.commit([Ga(e)],n)},n)}appendList(e,n,r){return this.mutate(async i=>{await i.commit([ise(e,n)],r)},r)}deleteList(e,n){return this.mutate(async r=>{await r.commit([JR(e)],n)},n)}setName(e,n){return e===void 0?this.deleteValue(yw,n):this.setValue(yw,e,n)}setLabel(e,n,r){let i=yS(e);return n===void 0?this.deleteValue(i,r):this.setValue(i,n,r)}close(e){return this.closePromise!==void 0?this.closePromise:(this.state="closing",this.closePromise=this.mutationLine.seal(this.closedError).then(()=>this.storage.close(e)).finally(()=>{this.state="closed",this.onClose?.()}),this.closePromise)}async getBranchTip(e,n){let r=await this.getValue(Mo(e),n);if(r===void 0)throw new un(`Unknown branch: ${e}`);return r.value}async appendToBranch(e,n,r){if(this.assertOpen(),n.type==="message"&&n.message.role==="assistant"&&n.message.stopReason==="pending")throw new KD;let i=this.idGenerator.next();return await this.mutate(async s=>{let o=await s.getValue(Mo(e),r);if(o===void 0)throw new un(`Unknown branch: ${e}`);await s.commit([gp(n.type==="message"?{id:i,parentId:o.value,type:"message",message:n.message}:{id:i,parentId:o.value,type:"custom",customType:n.customType,...n.data===void 0?{}:{data:n.data}}),fr(Mo(e),i)],r)},r),i}getOrCreateBranchObject(e){let n=this.branches.get(e);return n===void 0&&(n=new udt(e,this),this.branches.set(e,n)),n}assertValidBranchName(e){if(e.length===0)throw new hV(e,"branch name must not be empty");if(e.includes("\0"))throw new hV(e,"branch name must not contain \\u0000")}assertOpen(){if(this.state!=="open")throw this.closedError}}});async function DHn(t,e,n,r,i){if(!n)return{entries:[],commonAncestorId:null};let s=new Set((await t.findEntries({start:n},i)).map(l=>l.id)),o=await t.findEntries({start:r},i),a=null;for(let l of o)if(s.has(l.id)){a=l.id;break}let c=[],u=n;for(;u&&u!==a;){let l=await e.getEntry(u,i);if(!l)throw new Error(`Corrupt session: entry ${u} not found`);c.push(l),u=l.parentId}return c.reverse(),{entries:c,commonAncestorId:a}}function H5i(t){switch(t.type){case"message":return t.message.role==="toolResult"?void 0:t.message;case"branch_summary":return YR(t.summary,t.fromId,t.timestamp);case"compaction":return zR(t.summary,t.tokensBefore,t.timestamp);case"custom":return}}function lse(t,e=0){let n=[],r=VRe(),i=0;for(let s of t)if(!(s.type!=="branch_summary"||typeof s.details!="object"||s.details===null||Array.isArray(s.details))){if(Array.isArray(s.details.readFiles))for(let o of s.details.readFiles)typeof o=="string"&&r.read.add(o);if(Array.isArray(s.details.modifiedFiles))for(let o of s.details.modifiedFiles)typeof o=="string"&&r.edited.add(o)}for(let s=t.length-1;s>=0;s--){let o=t[s],a=H5i(o);if(!a)continue;ese(a,r);let c=wQ(a);if(e>0&&i+c>e){(o.type==="compaction"||o.type==="branch_summary")&&iJRe(r,i,m,h,c,u,f),n)}async function ddt(t,e,n,r){let{customInstructions:i,replaceInstructions:s}=e,{messages:o,fileOps:a}=t;if(o.length===0)return hp({summary:"No content to summarize",readFiles:[],modifiedFiles:[]});let c=YD(o),u=zD(c),l;s&&i?l=i:i?l=`${NHn} -${x.value.text}`,A=I?g5(I,x.value.usage):x.value.usage}else{let C=await XJe(a,{model:s,reserveTokens:f.reserveTokens,customInstructions:i,previousSummary:h,thinkingLevel:o},n,r);if(!C.ok)return _d(C.error);g=C.value.text,A=C.value.usage}let{readFiles:y,modifiedFiles:b}=gSe(m);return g+=ASe(y,b),bd({summary:g,tokensBefore:d,usage:A,retainedTail:u,details:{readFiles:y,modifiedFiles:b}})}async function Lhs(t,e,n,r,s,i){let o=Math.min(Math.floor(.5*n),e.maxTokens>0?e.maxTokens:Number.POSITIVE_INFINITY),a=eD(t),l=[{role:"user",content:[{type:"text",text:` -${tD(a)} +Additional focus: ${i}`:l=NHn;let m=[{role:"user",content:[{type:"text",text:` +${u} -${Mhs}`}],timestamp:Date.now()}],d=e.reasoning&&r&&r!=="off"?{maxTokens:o,reasoning:r}:{maxTokens:o},h=await s({systemPrompt:_Se,messages:l},DZ(d,i),i);return h.stopReason==="aborted"?_d(new gT("aborted",h.errorMessage||"Turn prefix summarization aborted")):h.stopReason==="error"?_d(new gT("summarization_failed",`Turn prefix summarization failed: ${h.errorMessage||"Unknown error"}`)):bd({text:yc(h.content),usage:h.usage})}p();var sXe={enabled:!0,maxRetries:3,baseDelayMs:1e3};function iXe(t){let e=new Set;for(let n of t){if(e.has(n.name))throw new TypeError(`Duplicate tool name: ${JSON.stringify(n.name)}`);e.add(n.name)}}function oXe(t){if(!Number.isSafeInteger(t.maxRetries)||t.maxRetries<0||t.maxRetries===Number.MAX_SAFE_INTEGER||!Number.isSafeInteger(t.baseDelayMs)||t.baseDelayMs<0)throw new RangeError("Retry policy values must be finite non-negative safe integers")}function aXe(t){if(!Number.isSafeInteger(t.reserveTokens)||t.reserveTokens<0||!Number.isSafeInteger(t.keepRecentTokens)||t.keepRecentTokens<0)throw new RangeError("Compaction token counts must be finite non-negative safe integers")}p();var SSe=class{listeners=new Map;watchListeners=new Set;deliveryTail=Promise.resolve();closedError;on(e,n){if(this.closedError!==void 0)throw this.closedError;let r=(i,o)=>n(i,o),s=this.listeners.get(e);return s===void 0&&(s=new Set,this.listeners.set(e,s)),s.add(r),()=>s?.delete(r)}emit(e,n){return this.emitBatch([e],n)}emitBatch(e,n){if(this.closedError!==void 0||e.length===0)return Promise.resolve();let r=e.map(i=>{let o=structuredClone(i);return{payload:o,recipients:this.snapshotRecipients(o)}}),s=this.deliveryTail.then(async()=>{for(let{payload:i,recipients:o}of r)await this.deliver(i,o,!0,n)});return this.deliveryTail=s.catch(()=>{}),s}watch(e,n,r,s){if(this.closedError!==void 0)throw this.closedError;return this.installWatcher(e,n,s)}async watchFromSnapshot(e,n,r){if(this.closedError!==void 0)throw this.closedError;let s=this.installWatcher(void 0,n,async(i,o)=>{let a=await e(i);return o(),a});try{return s.setSnapshot(await e(r)),s}catch(i){throw s.unsubscribe(),i}}close(e){this.closedError??=e,this.deliveryTail.finally(()=>{this.listeners.clear(),this.watchListeners.clear()})}installWatcher(e,n,r){let s,i=r===void 0?void 0:async a=>{let c=!1,u=await r(a,()=>{if(c)throw new Error("Resnapshot boundary was already marked");c=!0,this.enqueueBarrier(()=>s.markResnapshotBoundary())});if(!c)throw new Error("Resnapshot capture did not mark its boundary");return u};s=new cXe(e,i,async(a,c,u)=>{if(c.type==="handler_error")return;let l=a instanceof Error?a:new Error(String(a)),d="lane"in c&&typeof c.lane=="string"?c.lane:void 0;await this.emit({type:"handler_error",kind:"event",event:c.type,error:l.message,...l.stack===void 0?{}:{stack:l.stack},...d===void 0?{}:{lane:d}},u)});let o=(a,c)=>{n(a)&&s.push(a,c)};return this.watchListeners.add(o),s.setUnsubscribe(()=>this.watchListeners.delete(o)),s}enqueueBarrier(e){let n=this.deliveryTail.then(e);this.deliveryTail=n.catch(()=>{})}snapshotRecipients(e){return[...this.listeners.get(e.type)??[],...this.watchListeners]}async deliver(e,n,r,s){for(let i of n)try{await i(structuredClone(e),s)}catch(o){if(!r||e.type==="handler_error")continue;let a=o instanceof Error?o:new Error(String(o)),c="lane"in e&&typeof e.lane=="string"?e.lane:void 0,u={type:"handler_error",kind:"event",event:e.type,error:a.message,...a.stack===void 0?{}:{stack:a.stack},...c===void 0?{}:{lane:c}};await this.deliver(u,this.snapshotRecipients(u),!1,s)}}},cXe=class{snapshot;resnapshotCallback;onError;buffer=[];listener;unsubscribeCallback;deliveryTail=Promise.resolve();epoch=0;resnapshotState;state="buffering";constructor(e,n,r){this.snapshot=e,this.resnapshotCallback=n,this.onError=r}setSnapshot(e){this.snapshot=e}start(e){if(this.state!=="buffering")throw new Error("WatchHandle.start() may be called only once");this.state="started",this.listener=e;let n=this.buffer;this.buffer=[];for(let r of n)this.enqueue(r.event,r.context,r.epoch)}async resnapshot(e){if(this.state==="unsubscribed")throw new Error("WatchHandle is unsubscribed");if(this.resnapshotCallback===void 0)throw new Error("WatchHandle does not support resnapshot");if(this.resnapshotState!==void 0)throw new Error("WatchHandle resnapshot is already in progress");let n,r=new Promise(i=>{n=i}),s={phase:"dropping",held:[],reached:r,resolveReached:n};this.epoch++,this.resnapshotState=s;try{let i=await this.resnapshotCallback(e);await r,this.snapshot=i,this.resnapshotState=void 0;for(let o of s.held)this.push(o.event,o.context);return i}catch(i){this.resnapshotState=void 0;for(let o of s.held)this.push(o.event,o.context);throw i}}markResnapshotBoundary(){let e=this.resnapshotState;e===void 0||e.phase!=="dropping"||(e.phase="holding",e.resolveReached())}unsubscribe(){this.state!=="unsubscribed"&&(this.state="unsubscribed",this.buffer=[],this.listener=void 0,this.unsubscribeCallback?.(),this.unsubscribeCallback=void 0)}push(e,n){if(this.state!=="unsubscribed"&&this.resnapshotState?.phase!=="dropping"){if(this.resnapshotState?.phase==="holding"){this.resnapshotState.held.push({event:e,context:n});return}if(this.state==="buffering"){this.buffer.push({event:e,context:n,epoch:this.epoch});return}this.enqueue(e,n,this.epoch)}}setUnsubscribe(e){this.unsubscribeCallback=e}enqueue(e,n,r){let s=this.listener;s!==void 0&&(this.deliveryTail=this.deliveryTail.then(async()=>{this.state==="started"&&r===this.epoch&&await s(e,n)}).catch(async i=>{try{await this.onError(i,e,n)}catch{}}))}};p();p();var dXe={version:1,spans:{"pi.ai.request":{description:"One logical request to an AI provider",parents:{kind:"any"},startAttributes:{"pi.ai.operation":{type:"string",required:!0,values:["stream","fetch_deferred","cancel_deferred","generate_images"],description:"Logical provider operation"},"pi.ai.provider":{type:"string",required:!0,description:"Selected provider id"},"pi.ai.model":{type:"string",required:!0,description:"Requested model id"},"pi.ai.api":{type:"string",required:!0,description:"Provider API id"},"pi.ai.streaming":{type:"boolean",required:!0,description:"Whether this operation returns a stream"},"pi.ai.deferred":{type:"boolean",required:!1,description:"Whether the operation requests or participates in deferred execution"}},endAttributes:{"pi.ai.response.model":{type:"string",description:"Concrete response model"},"pi.ai.response.id":{type:"string",cardinality:"high",description:"Provider response id"},"pi.ai.response.stop_reason":{type:"string",values:["stop","length","tool_use","error","aborted","deferred"],description:"Normalized terminal response reason"},"pi.ai.http.status_code":{type:"number",description:"Final HTTP status"},"pi.ai.usage.input_tokens":{type:"number",description:"Reported input tokens"},"pi.ai.usage.output_tokens":{type:"number",description:"Reported output tokens"},"pi.ai.usage.cache_read_tokens":{type:"number",description:"Reported cache-read tokens"},"pi.ai.usage.cache_write_tokens":{type:"number",description:"Reported cache-write tokens"},"pi.ai.usage.reasoning_tokens":{type:"number",description:"Reported reasoning tokens"},"pi.ai.usage.total_tokens":{type:"number",description:"Reported total tokens"},"pi.ai.usage.cost":{type:"number",description:"Reported total cost"},"pi.ai.stream.chunk_count":{type:"number",description:"Streamed update chunk count"},"pi.ai.stream.time_to_first_chunk_ms":{type:"number",description:"Elapsed milliseconds to first update chunk"},"pi.ai.error.type":{type:"string",cardinality:"low",description:"Provider or transport error class"}},status:{default:"ok",errorWhen:"The operation throws or returns an error result"}}}};function fyn(t,e,n,r){return Qh(r).startSpan({name:t,attributes:e},s=>n(s,uSe(s,r)))}var Fhs=["before_run","before_drive","before_run_end","transform_context","before_request","before_payload","after_response","before_tool","after_tool","before_compaction","before_navigation"],Qhs=["run_start","run_resume","run_suspend","operation_abort","run_end","fault","handler_error","turn_start","turn_end","retry_scheduled","retry_start","retry_end","message_start","message_update","message_end","tool_start","tool_update","tool_end","entry_added","queue_update","value_update","config_update","compaction_start","compaction_end","navigation_start","navigation_end","lane_created","usage"],lXe={"pi.session.id":{type:"string",required:!0,cardinality:"high",description:"Session id"},"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.operation.recovery":{type:"boolean",required:!0,description:"Whether this invocation resumes durable work"}},uXe={"pi.error.code":{type:"string",cardinality:"low",description:"Stable operation error code"},"pi.error.type":{type:"string",cardinality:"low",description:"Low-cardinality operation error class"}},pXe={version:1,spans:{"pi.harness.run":{description:"One admitted in-process run invocation",parents:{kind:"root_or_external"},startAttributes:{...lXe,"pi.operation.kind":{type:"string",required:!0,values:["run"],description:"Run operation kind"}},endAttributes:{"pi.operation.outcome":{type:"string",values:["completed","aborted","failed","suspended"],description:"Run invocation outcome"},...uXe},status:{default:"ok",errorWhen:"The run fails or throws"}},"pi.harness.compaction":{description:"One admitted in-process manual compaction invocation",parents:{kind:"root_or_external"},startAttributes:{...lXe,"pi.operation.kind":{type:"string",required:!0,values:["compaction"],description:"Compaction operation kind"}},endAttributes:{"pi.operation.outcome":{type:"string",values:["completed","declined","aborted","failed"],description:"Compaction invocation outcome"},...uXe},status:{default:"ok",errorWhen:"The compaction fails or throws"}},"pi.harness.navigation":{description:"One admitted in-process navigation invocation",parents:{kind:"root_or_external"},startAttributes:{...lXe,"pi.operation.kind":{type:"string",required:!0,values:["navigation"],description:"Navigation operation kind"}},endAttributes:{"pi.operation.outcome":{type:"string",values:["completed","declined","aborted","failed"],description:"Navigation invocation outcome"},...uXe},status:{default:"ok",errorWhen:"The navigation fails or throws"}},"pi.harness.checkpoint":{description:"One run checkpoint",parents:{kind:"spans",spans:["pi.harness.run"]},startAttributes:{"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.checkpoint.kind":{type:"string",required:!0,values:["normal","abort_reconcile"],description:"Checkpoint purpose"}},endAttributes:{},status:{default:"ok",errorWhen:"Checkpoint work throws"}},"pi.harness.turn":{description:"One assistant response and its tool batch",parents:{kind:"spans",spans:["pi.harness.run"]},startAttributes:{"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.turn.id":{type:"string",required:!0,cardinality:"high",description:"Invocation-local turn id"}},endAttributes:{},status:{default:"ok",errorWhen:"Turn work throws"}},"pi.harness.step":{description:"One durable retry attempt",parents:{kind:"spans",spans:["pi.harness.turn","pi.harness.checkpoint","pi.harness.compaction","pi.harness.navigation"]},startAttributes:{"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.step.kind":{type:"string",required:!0,values:["assistant","compaction","branch_summary"],description:"Retryable step kind"},"pi.step.attempt":{type:"number",required:!0,description:"One-based durable attempt number"},"pi.compaction.reason":{type:"string",required:!1,values:["manual","threshold","overflow"],description:"Compaction trigger"}},endAttributes:{"pi.step.outcome":{type:"string",values:["succeeded","retry","failed","aborted","deferred","overflow"],description:"Attempt outcome"}},status:{default:"ok",errorWhen:"The attempt retries, fails, or throws"}},"pi.harness.tool":{description:"One raw phase-2 tool execution",parents:{kind:"spans",spans:["pi.harness.turn","pi.harness.run"]},startAttributes:{"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.turn.id":{type:"string",required:!1,cardinality:"high",description:"Invocation-local live turn id"},"pi.tool.name":{type:"string",required:!0,description:"Tool name"},"pi.tool.call_id":{type:"string",required:!0,cardinality:"high",description:"Tool call id"},"pi.tool.replay":{type:"string",required:!0,values:["never","safe"],description:"Declared replay policy"},"pi.tool.recovery":{type:"boolean",required:!0,description:"Whether this is recovery execution"}},endAttributes:{"pi.tool.is_error":{type:"boolean",description:"Whether raw phase-2 execution returned an error"}},status:{default:"ok",errorWhen:"Raw phase-2 execution returns an error"}},"pi.harness.hook":{description:"One registered hook handler invocation",parents:{kind:"any"},startAttributes:{"pi.lane.name":{type:"string",required:!0,cardinality:"high",description:"Lane name"},"pi.operation.id":{type:"string",required:!1,cardinality:"high",description:"Durable operation id when accepted"},"pi.hook.name":{type:"string",required:!0,values:Fhs,description:"Hook name"},"pi.hook.registration_id":{type:"string",required:!1,description:"Optional hook registration metadata"}},endAttributes:{"pi.hook.outcome":{type:"string",values:["completed","skipped","blocked","failed"],description:"Handler outcome"}},status:{default:"ok",errorWhen:"The handler throws"}},"pi.harness.sleep":{description:"One retry delay",parents:{kind:"spans",spans:["pi.harness.run","pi.harness.compaction","pi.harness.navigation","pi.harness.turn","pi.harness.checkpoint"]},startAttributes:{"pi.operation.id":{type:"string",required:!0,cardinality:"high",description:"Durable operation id"},"pi.sleep.delay_ms":{type:"number",required:!0,description:"Requested delay in milliseconds"}},endAttributes:{"pi.sleep.outcome":{type:"string",values:["elapsed","aborted"],description:"Delay outcome"}},status:{default:"ok",errorWhen:"Sleep work throws"}},"pi.harness.event_handler":{description:"One passive event listener invocation",parents:{kind:"any"},startAttributes:{"pi.event.type":{type:"string",required:!0,cardinality:"low",values:Qhs,description:"Delivered harness event type"},"pi.lane.name":{type:"string",required:!1,cardinality:"high",description:"Lane name for lane-scoped events"}},endAttributes:{},status:{default:"ok",errorWhen:"The listener throws"}},"pi.session.write":{description:"One committed session transaction",parents:{kind:"any"},startAttributes:{"pi.session.id":{type:"string",required:!0,cardinality:"high",description:"Session id"},"pi.lane.name":{type:"string",required:!1,cardinality:"high",description:"Lane name when supplied by the caller"},"pi.operation.id":{type:"string",required:!1,cardinality:"high",description:"Durable operation id when supplied by the caller"},"pi.session.item_count":{type:"number",required:!0,description:"Number of writes in the transaction"},"pi.session.item_kinds":{type:"string[]",required:!0,elementValues:["entry","usage","value","list"],description:"Distinct write kinds in the transaction"}},endAttributes:{"pi.session.first_seq":{type:"number",description:"First committed sequence in the transaction"},"pi.session.last_seq":{type:"number",description:"Last committed sequence in the transaction"}},status:{default:"ok",errorWhen:"Storage rejects the transaction"}}}},gyn=[dXe,pXe];function CSe(t,e,n,r){return Qh(r).startSpan({name:t,attributes:e},s=>n(s,uSe(s,r)))}var ISe=class{registrations=new Map;reportError;closedError;constructor(e){this.reportError=e}on(e,n,r={}){if(this.closedError!==void 0)throw this.closedError;let s=this.registrations.get(e)??[],i={...r.id===void 0?{}:{id:r.id},handler:(o,a)=>n(o,a)};return s.push(i),this.registrations.set(e,s),()=>{let o=s.indexOf(i);o!==-1&&s.splice(o,1)}}has(e){return(this.registrations.get(e)?.length??0)!==0}runWithGate(e,n,r,s){return r.admit(()=>{let i=ug(r.signal,s);return i.abortSignal?.throwIfAborted(),this.runAdmitted(e,n,i)})}runToolWithGate(e,n,r,s){return r.admit(()=>{let i=ug(r.signal,s);return i.abortSignal?.throwIfAborted(),e==="before_tool"?this.beforeTool(n,i):this.afterTool(n,i)})}close(e){this.closedError??=e}async runAdmitted(e,n,r){if(this.closedError!==void 0)throw this.closedError;return await this.aggregate(e,n,r)}async aggregate(e,n,r){switch(e){case"before_run":return this.beforeRun(n,r);case"before_drive":await this.invokeAllFailClosed(e,n,r);return;case"before_run_end":{let s;return await this.invokeAll(e,n,i=>{let o=i;o?.followUp!==void 0&&(s=o.followUp)},r),s===void 0?void 0:{followUp:s}}case"transform_context":return this.transformContext(n,r);case"before_request":return this.beforeRequest(n,r);case"before_payload":return this.beforePayload(n,r);case"after_response":return this.afterResponse(n,r);case"before_tool":return this.beforeTool(n,r);case"after_tool":return this.afterTool(n,r);case"before_compaction":return this.firstStructural(e,n,"compaction",r);case"before_navigation":return this.firstStructural(e,n,"summary",r)}}async beforeRun(e,n){let r=e.prompt,s=[];for(let i of this.registrationsFor("before_run"))try{let o=await i.handler({...e,prompt:r},n);o?.messages!==void 0&&(s=[...s,...o.messages],r=[...r,...o.messages])}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),"before_run",e.lane,n)}return s.length===0?void 0:{messages:s}}async beforeTool(e,n){let r=e.args,s;for(let i of this.registrationsFor("before_tool"))try{let o=await this.invokeToolRegistration("before_tool",i,{...e,args:r},n);if(o?.args!==void 0&&(r=o.args),o?.block!==void 0){s=o.block;break}}catch(o){let a=o instanceof Error?o:new Error(String(o));await this.reportError(a,"before_tool",e.lane,n),s={reason:a.message};break}return{...r===e.args?{}:{args:r},...s===void 0?{}:{block:s}}}async transformContext(e,n){let r=e.messages,s=e.systemPrompt;for(let i of this.registrationsFor("transform_context"))try{let o=await i.handler({...e,messages:r,systemPrompt:s},n);o?.messages!==void 0&&(r=o.messages),o?.systemPrompt!==void 0&&(s=o.systemPrompt)}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),"transform_context",e.lane,n)}return{messages:r,systemPrompt:s}}async beforeRequest(e,n){let r=e.streamOptions,s=!1;for(let i of this.registrationsFor("before_request"))try{let o=await i.handler({...e,streamOptions:r},n);o?.streamOptions!==void 0&&(r=oL(r,o.streamOptions),s=!0)}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),"before_request",e.lane,n)}return s?{streamOptions:Uhs(e.streamOptions,r)}:void 0}async beforePayload(e,n){let r=e.payload;for(let s of this.registrationsFor("before_payload"))try{let i=await s.handler({...e,payload:r},n);i?.payload!==void 0&&(r=i.payload)}catch(i){await this.reportError(i instanceof Error?i:new Error(String(i)),"before_payload",e.lane,n)}return{payload:r}}async afterResponse(e,n){let r=e.message;for(let s of this.registrationsFor("after_response"))try{let i=await s.handler({...e,message:r},n);i?.message!==void 0&&(r=i.message)}catch(i){await this.reportError(i instanceof Error?i:new Error(String(i)),"after_response",e.lane,n)}return{message:r}}async afterTool(e,n){let r={content:e.content,details:e.details,isError:e.isError,usage:e.usage},s={};for(let i of this.registrationsFor("after_tool"))try{let o=await this.invokeToolRegistration("after_tool",i,{...e,...r},n);if(o===void 0)continue;o.content!==void 0&&(s.content=o.content),o.details!==void 0&&(s.details=o.details),o.isError!==void 0&&(s.isError=o.isError),o.usage!==void 0&&(s.usage=o.usage),o.terminate!==void 0&&(s.terminate=o.terminate),r={content:o.content===void 0?r.content:o.content,details:o.details===void 0?r.details:o.details,isError:o.isError===void 0?r.isError:o.isError,usage:o.usage===void 0?r.usage:o.usage}}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),"after_tool",e.lane,n)}return Object.keys(s).length===0?void 0:s}async firstStructural(e,n,r,s){for(let i of this.registrationsFor(e))try{let o=await i.handler(n,s);if(o==null||typeof o!="object")continue;let a=o;if(a.decline===!0&&a[r]!==void 0){await this.reportError(new Error(`${e} hook cannot return both decline and ${r}`),e,n.lane,s);continue}if(a.decline===!0||a[r]!==void 0)return o}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),e,n.lane,s)}}invokeToolRegistration(e,n,r,s){return CSe("pi.harness.hook",{"pi.lane.name":r.lane,"pi.operation.id":r.runId,"pi.hook.name":e,...n.id===void 0?{}:{"pi.hook.registration_id":n.id}},async(i,o)=>{try{let a=await n.handler(r,o),c=e==="before_tool"&&a!==null&&typeof a=="object"&&"block"in a&&a.block!==void 0;return i.setAttributes({"pi.hook.outcome":c?"blocked":"completed"}),a}catch(a){throw i.setAttributes({"pi.hook.outcome":"failed"}),i.setStatus({status:"error"}),a}},s)}registrationsFor(e){return[...this.registrations.get(e)??[]]}async invokeAllFailClosed(e,n,r){for(let s of this.registrationsFor(e))try{await s.handler(n,r)}catch(i){let o=i instanceof Error?i:new Error(String(i));throw await this.reportError(o,e,n.lane,r),o}}async invokeAll(e,n,r,s){for(let i of this.registrationsFor(e))try{r(await i.handler(n,s))}catch(o){await this.reportError(o instanceof Error?o:new Error(String(o)),e,n.lane,s)}}};function oL(t,e){let n={...t};for(let r of["transport","timeoutMs","maxRetries","maxRetryDelayMs","cacheRetention","deferred"]){if(!(r in e))continue;let s=e[r];s===void 0?delete n[r]:Object.assign(n,{[r]:s})}if("headers"in e)if(e.headers===void 0)delete n.headers;else{let r={...n.headers};for(let[s,i]of Object.entries(e.headers))i===void 0?delete r[s]:r[s]=i;n.headers=r}if("metadata"in e)if(e.metadata===void 0)delete n.metadata;else{let r={...n.metadata};for(let[s,i]of Object.entries(e.metadata))i===void 0?delete r[s]:r[s]=i;n.metadata=r}return n}function Uhs(t,e){let n={};for(let r of["transport","timeoutMs","maxRetries","maxRetryDelayMs","cacheRetention","deferred"])t[r]!==e[r]&&Object.assign(n,{[r]:e[r]});if(t.headers!==e.headers)if(e.headers===void 0)n.headers=void 0;else{let r={};for(let s of Object.keys(t.headers??{}))s in e.headers||(r[s]=void 0);for(let[s,i]of Object.entries(e.headers))t.headers?.[s]!==i&&(r[s]=i);t.headers===void 0&&Object.keys(r).length===0?n.headers={}:Object.keys(r).length!==0&&(n.headers=r)}if(t.metadata!==e.metadata)if(e.metadata===void 0)n.metadata=void 0;else{let r={};for(let s of Object.keys(t.metadata??{}))s in e.metadata||(r[s]=void 0);for(let[s,i]of Object.entries(e.metadata))t.metadata?.[s]!==i&&(r[s]=i);t.metadata===void 0&&Object.keys(r).length===0?n.metadata={}:Object.keys(r).length!==0&&(n.metadata=r)}return n}p();$k();p();function Sd(t){return{kind:"entry",entry:t}}function sy(t){return{kind:"usage",row:t}}function hXe(t,e,n){switch(t.kind){case"entry":return{kind:"entry",...t.entry,seq:e,timestamp:n};case"usage":return{kind:"usage",...t.row,seq:e};case"value":return t.op==="set"?{kind:"value",op:"set",seq:e,namespace:t.namespace,key:t.key,value:t.value}:{kind:"value",op:"delete",seq:e,namespace:t.namespace,key:t.key};case"list":return t.op==="append"?{kind:"list",op:"append",seq:e,namespace:t.namespace,key:t.key,value:t.value}:{kind:"list",op:"delete",seq:e,namespace:t.namespace,key:t.key}}}function Ayn(t,e,n){return{...t,seq:e,timestamp:n}}function xSe(t,e,n){let r=t.map((s,i)=>hXe(s,e+i,n));return{writes:r,result:{firstSeq:e,seqs:r.map(s=>s.seq),timestamp:n}}}function wSe(t,e,n){let r=e-1,s=new Set,i=new Set;for(let o of t){if(o.seq<=r)throw new Error(`Non-monotonic storage sequence: ${o.seq}`);if(r=o.seq,!(o.kind!=="entry"&&o.kind!=="usage")){if(n.hasEntryOrUsageId(o.id)||s.has(o.id))throw new Error(`Duplicate entry or usage id: ${o.id}`);if(o.kind==="entry"&&o.parentId!==null&&!n.hasEntryId(o.parentId)&&!i.has(o.parentId))throw new Error(`Missing parent entry: ${o.parentId}`);s.add(o.id),o.kind==="entry"&&i.add(o.id)}}}p();var TSe=class{tail=Promise.resolve();sealedError;run(e){if(this.sealedError!==void 0)return Promise.reject(this.sealedError);let n=this.tail.then(()=>{if(this.sealedError!==void 0)throw this.sealedError;return e()});return this.tail=n.then(()=>{},()=>{}),n}seal(e){return this.sealedError??=e,this.tail}};p();function yyn(t,e){if(t.length===0)throw new TypeError("Value namespace must not be empty");if(t.includes("\0"))throw new TypeError("Value namespace must not contain \\u0000");if(e.includes("\0"))throw new TypeError("Value key must not contain \\u0000")}function dl(t,e=""){return yyn(t,e),Object.freeze({namespace:t,key:e,kind:"value"})}function vSe(t,e=""){return yyn(t,e),Object.freeze({namespace:t,key:e,kind:"list"})}function xr(t,e){return{kind:"value",op:"set",namespace:t.namespace,key:t.key,value:e}}function fa(t){return{kind:"value",op:"delete",namespace:t.namespace,key:t.key}}function PZ(t,e){return{kind:"list",op:"append",namespace:t.namespace,key:t.key,value:e}}function AT(t){return{kind:"list",op:"delete",namespace:t.namespace,key:t.key}}function mXe(t={}){let e=t.limit??1e3;if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("List read limit must be a positive safe integer");return{...t.cursor===void 0?{}:{cursor:t.cursor},order:t.order??"asc",limit:Math.min(e,1e4)}}var Ro=t=>dl("pi.branch.tip",t),fXe=()=>dl("pi.branch.tip"),nh=t=>dl("pi.lane.config",t),pl=t=>dl("pi.lane.state",t),A5=t=>dl("pi.result",t),yT=t=>dl("pi.op.meta",t),y0=t=>dl("pi.op.state",t),y5=(t,e,n)=>dl("pi.op.tool_args",`${t}:${e}:${n}`),RSe=(t,e,n)=>dl("pi.op.tool_memo",`${t}:${e}:${n}`),E0=(t,e)=>dl("pi.op.preparation",`${t}:${e}`),OZ=(t,e)=>dl("pi.op.tool_args",e===void 0?`${t}:`:`${t}:${e}:`),MZ=(t,e)=>dl("pi.op.tool_memo",e===void 0?`${t}:`:`${t}:${e}:`),gXe=t=>dl("pi.op.preparation",`${t}:`),bc=t=>dl("pi.pending.entry",t),ET=(t,e)=>dl("pi.pending.tool_output",`${t}:${e}`),eI=(t,e)=>vSe("pi.pending.assistant_frame",`${t}:${e}`),AXe=t=>dl("pi.pending.tool_output",`${t}:`),b0=dl("pi.session.name"),_0=t=>dl("pi.entry.label",t);var ln=class extends Error{constructor(e){super(e),this.name="SessionInvariantError"}},E5=class extends Error{branch;reason;constructor(e,n){super(`Invalid branch ${JSON.stringify(e)}: ${n}`),this.name="SessionInvalidBranchError",this.branch=e,this.reason=n}},LZ=class extends Error{branch;constructor(e){super(`Branch already exists: ${e}`),this.name="SessionBranchExistsError",this.branch=e}},nD=class extends Error{constructor(){super("Cannot persist a pending assistant message"),this.name="SessionPendingAssistantMessageError"}},FZ=class extends Error{targetId;constructor(e){super(`Unknown target: ${e}`),this.name="SessionUnknownTargetError",this.targetId=e}},yXe=class{storage;release;active=!0;commitResult;endPromise;constructor(e,n){this.storage=e,this.release=n}commit(e,n){if(this.assertActive(),this.commitResult!==void 0)return Promise.reject(new Error("SessionMutator commit already attempted"));try{for(let r of e)if(r.kind==="entry"&&r.entry.type==="message"&&r.entry.message.role==="assistant"&&r.entry.message.stopReason==="pending")throw new nD;this.commitResult=this.storage.commit(e,n)}catch(r){this.commitResult=Promise.reject(r)}return this.commitResult}end(e){return this.endPromise!==void 0?this.endPromise:(this.active=!1,this.endPromise=this.settle().finally(this.release),this.endPromise)}getEntries(e,n){return this.assertActive(),this.storage.getEntries(e,n)}getStats(e){return this.assertActive(),this.storage.getStats(e)}getValue(e,n){return this.assertActive(),this.storage.getValue(e,n)}scanValues(e,n){return this.assertActive(),this.storage.scanValues(e,n)}readList(e,n,r){return this.assertActive(),this.storage.readList(e,n,r)}scanBranch(e,n){return this.assertActive(),this.storage.scanBranch(e,n)}settle(){return this.commitResult?.then(()=>{},()=>{})??Promise.resolve()}assertActive(){if(!this.active)throw new Error("SessionMutator cannot be used outside its mutation callback")}},EXe=class{name;session;constructor(e,n){this.name=e,this.session=n}getTipId(e){return this.session.getBranchTip(this.name,e)}async findEntries(e,n){e??={};let r=e.start??await this.getTipId(n);return r===null?[]:this.session.scanBranch({...e,start:r,order:e.order??"newestFirst"},n)}async findEntry(e,n){return e??={},(await this.findEntries({...e,limit:e.limit===void 0?1:Math.min(e.limit,1)},n))[0]}appendMessage(e,n){return this.session.appendToBranch(this.name,{type:"message",message:e},n)}appendCustomEntry(e,n,r){return this.session.appendToBranch(this.name,{type:"custom",customType:e,...n===void 0?{}:{data:n}},r)}},bT=class{metadata;idGenerator;storage;mutationLine;onClose;branches=new Map;closedError=new Error("Session is closed");state="open";closePromise;constructor(e,n,r={}){this.metadata=e,this.idGenerator=r.idGenerator??{next:tl},this.storage=n,this.mutationLine=r.mutationLine??new TSe,this.onClose=r.onClose}async beginMutation(e){this.assertOpen();let n,r,s=new Promise((c,u)=>{n=c,r=u}),i,o=new Promise(c=>{i=c});return this.mutationLine.run(async()=>{n(new yXe(this.storage,i)),await o}).catch(r),s}async mutate(e,n){let r=await this.beginMutation(n);try{return await e(r,n)}finally{await r.end(n)}}async getEntries(e,n){return this.assertOpen(),this.storage.getEntries(e,n)}async getEntry(e,n){return(await this.getEntries([e],n)).get(e)}async getValue(e,n){return this.assertOpen(),this.storage.getValue(e,n)}async scanValues(e,n){return this.assertOpen(),this.storage.scanValues(e,n)}async readList(e,n,r){return this.assertOpen(),this.storage.readList(e,n,r)}async scanBranch(e,n){return this.assertOpen(),this.storage.scanBranch(e,n)}async getStats(e){return this.assertOpen(),this.storage.getStats(e)}async getName(e){return(await this.getValue(b0,e))?.value}async getLabel(e,n){return(await this.getValue(_0(e),n))?.value}async findEntries(e,n){e??={},this.assertOpen();let r=e.order??"desc";if(e.cursor!==void 0){if(r==="asc"&&e.cursor.seq===Number.MAX_SAFE_INTEGER)return[];if(r==="desc"&&e.cursor.seq<=1)return[]}return this.storage.scanEntries({type:e.type,customType:e.customType,order:r,limit:e.limit,...e.cursor===void 0?{}:r==="asc"?{fromSeq:e.cursor.seq+1}:{toSeq:e.cursor.seq-1}},n)}async findEntry(e,n){return e??={},(await this.findEntries({...e,limit:e.limit===void 0?1:Math.min(e.limit,1)},n))[0]}async branch(e,n){if(this.assertValidBranchName(e),await this.getValue(Ro(e),n)!==void 0)return this.getOrCreateBranchObject(e)}async createBranch(e,n,r){return this.assertOpen(),this.assertValidBranchName(e),await this.mutate(async s=>{if(await s.getValue(Ro(e),r)!==void 0)throw new LZ(e);if(n!==null&&!(await s.getEntries([n],r)).has(n))throw new FZ(n);await s.commit([xr(Ro(e),n)],r)},r),this.getOrCreateBranchObject(e)}setValue(e,n,r){return this.mutate(async s=>{await s.commit([xr(e,n)],r)},r)}deleteValue(e,n){return this.mutate(async r=>{await r.commit([fa(e)],n)},n)}appendList(e,n,r){return this.mutate(async s=>{await s.commit([PZ(e,n)],r)},r)}deleteList(e,n){return this.mutate(async r=>{await r.commit([AT(e)],n)},n)}setName(e,n){return e===void 0?this.deleteValue(b0,n):this.setValue(b0,e,n)}setLabel(e,n,r){let s=_0(e);return n===void 0?this.deleteValue(s,r):this.setValue(s,n,r)}close(e){return this.closePromise!==void 0?this.closePromise:(this.state="closing",this.closePromise=this.mutationLine.seal(this.closedError).then(()=>this.storage.close(e)).finally(()=>{this.state="closed",this.onClose?.()}),this.closePromise)}async getBranchTip(e,n){let r=await this.getValue(Ro(e),n);if(r===void 0)throw new ln(`Unknown branch: ${e}`);return r.value}async appendToBranch(e,n,r){if(this.assertOpen(),n.type==="message"&&n.message.role==="assistant"&&n.message.stopReason==="pending")throw new nD;let s=this.idGenerator.next();return await this.mutate(async i=>{let o=await i.getValue(Ro(e),r);if(o===void 0)throw new ln(`Unknown branch: ${e}`);await i.commit([Sd(n.type==="message"?{id:s,parentId:o.value,type:"message",message:n.message}:{id:s,parentId:o.value,type:"custom",customType:n.customType,...n.data===void 0?{}:{data:n.data}}),xr(Ro(e),s)],r)},r),s}getOrCreateBranchObject(e){let n=this.branches.get(e);return n===void 0&&(n=new EXe(e,this),this.branches.set(e,n)),n}assertValidBranchName(e){if(e.length===0)throw new E5(e,"branch name must not be empty");if(e.includes("\0"))throw new E5(e,"branch name must not contain \\u0000")}assertOpen(){if(this.state!=="open")throw this.closedError}};p();p();async function byn(t,e,n,r,s){if(!n)return{entries:[],commonAncestorId:null};let i=new Set((await t.findEntries({start:n},s)).map(l=>l.id)),o=await t.findEntries({start:r},s),a=null;for(let l of o)if(i.has(l.id)){a=l.id;break}let c=[],u=n;for(;u&&u!==a;){let l=await e.getEntry(u,s);if(!l)throw new Error(`Corrupt session: entry ${u} not found`);c.push(l),u=l.parentId}return c.reverse(),{entries:c,commonAncestorId:a}}function $hs(t){switch(t.type){case"message":return t.message.role==="toolResult"?void 0:t.message;case"branch_summary":return mT(t.summary,t.fromId,t.timestamp);case"compaction":return fT(t.summary,t.tokensBefore,t.timestamp);case"custom":return}}function QZ(t,e=0){let n=[],r=fSe(),s=0;for(let i of t)if(!(i.type!=="branch_summary"||typeof i.details!="object"||i.details===null||Array.isArray(i.details))){if(Array.isArray(i.details.readFiles))for(let o of i.details.readFiles)typeof o=="string"&&r.read.add(o);if(Array.isArray(i.details.modifiedFiles))for(let o of i.details.modifiedFiles)typeof o=="string"&&r.edited.add(o)}for(let i=t.length-1;i>=0;i--){let o=t[i],a=$hs(o);if(!a)continue;NZ(a,r);let c=sL(a);if(e>0&&s+c>e){(o.type==="compaction"||o.type==="branch_summary")&&s{p();qo();CQ();vb();dV();KRe();q5i=`The user explored a different conversation branch before returning here. Summary of that exploration: -`,Eyn=`Create a structured summary of this conversation branch for context when returning later. +`,NHn=`Create a structured summary of this conversation branch for context when returning later. Use this EXACT format: @@ -1781,542 +1672,660 @@ Use this EXACT format: ## Next Steps 1. [What should happen next to continue this work] -Keep each section concise. Preserve exact file paths, function names, and error messages.`;function _yn(t,e,n){let{models:r,model:s,customInstructions:i,replaceInstructions:o,reserveTokens:a=16384,retry:c,callbacks:u}=e,l=s.contextWindow||128e3,d=QZ(t,l-a);return bXe(d,{customInstructions:i,replaceInstructions:o},(h,m,f)=>ySe(r,s,h,m,c,u,f),n)}async function bXe(t,e,n,r){let{customInstructions:s,replaceInstructions:i}=e,{messages:o,fileOps:a}=t;if(o.length===0)return bd({summary:"No content to summarize",readFiles:[],modifiedFiles:[]});let c=eD(o),u=tD(c),l;i&&s?l=s:s?l=`${Eyn} - -Additional focus: ${s}`:l=Eyn;let h=[{role:"user",content:[{type:"text",text:` -${u} - - -${l}`}],timestamp:Date.now()}],m=await n({systemPrompt:_Se,messages:h},DZ({maxTokens:2048},r),r);if(m.stopReason==="aborted")return _d(new rL("aborted",m.errorMessage||"Branch summary aborted"));if(m.stopReason==="error")return _d(new rL("summarization_failed",`Branch summary failed: ${m.errorMessage||"Unknown error"}`));let f=yc(m.content);f=Ghs+f;let{readFiles:g,modifiedFiles:A}=gSe(a);return f+=ASe(g,A),bd({summary:f||"No summary generated",usage:m.usage,readFiles:g,modifiedFiles:A})}p();function Syn(t){return{content:[{type:"text",text:t}],details:void 0}}function kSe(t,e,n=!1){return{kind:"immediate",toolCall:t,result:Syn(e),isError:!0,terminate:n}}function Cyn(t,e){let n=e.find(r=>r.name===t.name);if(!n)return kSe(t,`Tool ${JSON.stringify(t.name)} is unavailable`);try{let r=n.prepareArguments?n.prepareArguments(t.arguments):t.arguments,s=r===t.arguments?t:{...t,arguments:r},i=cM(n,s);return{toolCall:t,tool:n,args:i}}catch(r){return kSe(t,r instanceof Error?r.message:String(r))}}function Iyn(t,e){if(e?.block)return kSe(t.toolCall,e.block.reason,e.block.terminate===!0);if(!e?.args)return{toolCall:t.toolCall,tool:t.tool,args:t.args};try{let n=cM(t.tool,{...t.toolCall,arguments:e.args});return{toolCall:t.toolCall,tool:t.tool,args:n}}catch(n){return kSe(t.toolCall,n instanceof Error?n.message:String(n))}}function xyn(t,e,n,r,s,i){let o=!0;return e.admit(async()=>{let a=ug(e.signal,i);a.abortSignal?.throwIfAborted();try{return{result:await t.tool.execute(t.toolCall.id,t.args,(u,l)=>{o&&n(u,l)},r,s,a),isError:!1}}catch(c){return{result:Syn(c instanceof Error?c.message:String(c)),isError:!0}}finally{o=!1}})}function wyn(t,e,n){let r=n?{...e.result,content:n.content===void 0?e.result.content:n.content,details:n.details===void 0?e.result.details:n.details,usage:n.usage===void 0?e.result.usage:n.usage,terminate:n.terminate===void 0?e.result.terminate:n.terminate}:e.result;return{toolCall:t.toolCall,result:r,isError:n?.isError??e.isError,terminate:r.terminate===!0}}function NSe(t,e){return{content:t.content,details:t.details,...t.usage===void 0?{}:{usage:t.usage},...t.addedToolNames===void 0?{}:{addedToolNames:t.addedToolNames},...e?{terminate:!0}:{}}}function _Xe(t){return{role:"toolResult",toolCallId:t.toolCall.id,toolName:t.toolCall.name,content:t.result.content??[],...t.result.details===void 0?{}:{details:t.result.details},...t.result.usage===void 0?{}:{usage:t.result.usage},...t.result.addedToolNames?.length?{addedToolNames:t.result.addedToolNames}:{},isError:t.isError,timestamp:Date.now()}}p();var Tyn=Gt(E0e(),1);async function vyn(t,e,n){let r=[],s=[];for(let i of Array.isArray(e)?e:[e]){let o=await t.fileInfo(i,n);if(!o.ok){o.error.code!=="not_found"&&s.push({type:"warning",code:"file_info_failed",message:o.error.message,path:i});continue}let a=o.value,c=await kyn(t,a,s,n);if(c==="directory"){let u=await qhs(t,a.path,n);r.push(...u.promptTemplates),s.push(...u.diagnostics)}else if(c==="file"&&a.name.endsWith(".md")){let u=await Ryn(t,a.path,a.name,n);u.promptTemplate&&r.push(u.promptTemplate),s.push(...u.diagnostics)}}return{promptTemplates:r,diagnostics:s}}async function Whs(t,e,n,r){let s=[],i=[];for(let o of e){let a=await vyn(t,o.path,r);for(let c of a.promptTemplates)s.push({promptTemplate:n?n(c,o.source,r):c,source:o.source});for(let c of a.diagnostics)i.push({...c,source:o.source})}return{promptTemplates:s,diagnostics:i}}async function qhs(t,e,n){let r=[],s=[],i=await t.listDir(e,n);if(!i.ok)return s.push({type:"warning",code:"list_failed",message:i.error.message,path:e}),{promptTemplates:r,diagnostics:s};let o=i.value;for(let a of o.sort((c,u)=>c.name.localeCompare(u.name))){if(await kyn(t,a,s,n)!=="file"||!a.name.endsWith(".md"))continue;let u=await Ryn(t,a.path,a.name,n);u.promptTemplate&&r.push(u.promptTemplate),s.push(...u.diagnostics)}return{promptTemplates:r,diagnostics:s}}async function Ryn(t,e,n,r){let s=[],i=await t.readTextFile(e,r);if(!i.ok)return s.push({type:"warning",code:"read_failed",message:i.error.message,path:e}),{promptTemplate:null,diagnostics:s};let o=Hhs(i.value);if(!o.ok)return s.push({type:"warning",code:"parse_failed",message:o.error.message,path:e}),{promptTemplate:null,diagnostics:s};let{frontmatter:a,body:c}=o.value,u=c.split(` -`).find(d=>d.trim()),l=typeof a.description=="string"?a.description:"";return!l&&u&&(l=u.slice(0,60),u.length>60&&(l+="...")),{promptTemplate:{name:n.replace(/\.md$/i,""),description:l,content:c},diagnostics:s}}async function kyn(t,e,n,r){if(e.kind==="file"||e.kind==="directory")return e.kind;let s=await t.canonicalPath(e.path,r);if(!s.ok){s.error.code!=="not_found"&&n.push({type:"warning",code:"file_info_failed",message:s.error.message,path:e.path});return}let i=await t.fileInfo(s.value,r);if(!i.ok){i.error.code!=="not_found"&&n.push({type:"warning",code:"file_info_failed",message:i.error.message,path:e.path});return}return i.value.kind==="file"||i.value.kind==="directory"?i.value.kind:void 0}function Hhs(t){try{let e=t.replace(/\r\n/g,` +Keep each section concise. Preserve exact file paths, function names, and error messages.`});function MHn(t){return{content:[{type:"text",text:t}],details:void 0}}function uke(t,e,n=!1){return{kind:"immediate",toolCall:t,result:MHn(e),isError:!0,terminate:n}}function OHn(t,e){let n=e.find(r=>r.name===t.name);if(!n)return uke(t,`Tool ${JSON.stringify(t.name)} is unavailable`);try{let r=n.prepareArguments?n.prepareArguments(t.arguments):t.arguments,i=r===t.arguments?t:{...t,arguments:r},s=xF(n,i);return{toolCall:t,tool:n,args:s}}catch(r){return uke(t,r instanceof Error?r.message:String(r))}}function LHn(t,e){if(e?.block)return uke(t.toolCall,e.block.reason,e.block.terminate===!0);if(!e?.args)return{toolCall:t.toolCall,tool:t.tool,args:t.args};try{let n=xF(t.tool,{...t.toolCall,arguments:e.args});return{toolCall:t.toolCall,tool:t.tool,args:n}}catch(n){return uke(t.toolCall,n instanceof Error?n.message:String(n))}}function FHn(t,e,n,r,i,s){let o=!0;return e.admit(async()=>{let a=PA(e.signal,s);a.abortSignal?.throwIfAborted();try{return{result:await t.tool.execute(t.toolCall.id,t.args,(u,l)=>{o&&n(u,l)},r,i,a),isError:!1}}catch(c){return{result:MHn(c instanceof Error?c.message:String(c)),isError:!0}}finally{o=!1}})}function QHn(t,e,n){let r=n?{...e.result,content:n.content===void 0?e.result.content:n.content,details:n.details===void 0?e.result.details:n.details,usage:n.usage===void 0?e.result.usage:n.usage,terminate:n.terminate===void 0?e.result.terminate:n.terminate}:e.result;return{toolCall:t.toolCall,result:r,isError:n?.isError??e.isError,terminate:r.terminate===!0}}function dke(t,e){return{content:t.content,details:t.details,...t.usage===void 0?{}:{usage:t.usage},...e?{terminate:!0}:{}}}function pdt(t){return{role:"toolResult",toolCallId:t.toolCall.id,toolName:t.toolCall.name,content:t.result.content??[],...t.result.details===void 0?{}:{details:t.result.details},...t.result.usage===void 0?{}:{usage:t.result.usage},isError:t.isError,timestamp:Date.now()}}var mdt=v(()=>{p();qo();TE()});async function GHn(t,e,n){let r=[],i=[];for(let s of Array.isArray(e)?e:[e]){let o=await t.fileInfo(s,n);if(!o.ok){o.error.code!=="not_found"&&i.push({type:"warning",code:"file_info_failed",message:o.error.message,path:s});continue}let a=o.value,c=await WHn(t,a,i,n);if(c==="directory"){let u=await V5i(t,a.path,n);r.push(...u.promptTemplates),i.push(...u.diagnostics)}else if(c==="file"&&a.name.endsWith(".md")){let u=await $Hn(t,a.path,a.name,n);u.promptTemplate&&r.push(u.promptTemplate),i.push(...u.diagnostics)}}return{promptTemplates:r,diagnostics:i}}async function j5i(t,e,n,r){let i=[],s=[];for(let o of e){let a=await GHn(t,o.path,r);for(let c of a.promptTemplates)i.push({promptTemplate:n?n(c,o.source,r):c,source:o.source});for(let c of a.diagnostics)s.push({...c,source:o.source})}return{promptTemplates:i,diagnostics:s}}async function V5i(t,e,n){let r=[],i=[],s=await t.listDir(e,n);if(!s.ok)return i.push({type:"warning",code:"list_failed",message:s.error.message,path:e}),{promptTemplates:r,diagnostics:i};let o=s.value;for(let a of o.sort((c,u)=>c.name.localeCompare(u.name))){if(await WHn(t,a,i,n)!=="file"||!a.name.endsWith(".md"))continue;let u=await $Hn(t,a.path,a.name,n);u.promptTemplate&&r.push(u.promptTemplate),i.push(...u.diagnostics)}return{promptTemplates:r,diagnostics:i}}async function $Hn(t,e,n,r){let i=[],s=await t.readTextFile(e,r);if(!s.ok)return i.push({type:"warning",code:"read_failed",message:s.error.message,path:e}),{promptTemplate:null,diagnostics:i};let o=Y5i(s.value);if(!o.ok)return i.push({type:"warning",code:"parse_failed",message:o.error.message,path:e}),{promptTemplate:null,diagnostics:i};let{frontmatter:a,body:c}=o.value,u=c.split(` +`).find(d=>d.trim()),l=typeof a.description=="string"?a.description:"";return!l&&u&&(l=u.slice(0,60),u.length>60&&(l+="...")),{promptTemplate:{name:n.replace(/\.md$/i,""),description:l,content:c},diagnostics:i}}async function WHn(t,e,n,r){if(e.kind==="file"||e.kind==="directory")return e.kind;let i=await t.canonicalPath(e.path,r);if(!i.ok){i.error.code!=="not_found"&&n.push({type:"warning",code:"file_info_failed",message:i.error.message,path:e.path});return}let s=await t.fileInfo(i.value,r);if(!s.ok){s.error.code!=="not_found"&&n.push({type:"warning",code:"file_info_failed",message:s.error.message,path:e.path});return}return s.value.kind==="file"||s.value.kind==="directory"?s.value.kind:void 0}function Y5i(t){try{let e=t.replace(/\r\n/g,` `).replace(/\r/g,` `);if(!e.startsWith("---"))return{ok:!0,value:{frontmatter:{},body:e}};let n=e.indexOf(` ----`,3);if(n===-1)return{ok:!0,value:{frontmatter:{},body:e}};let r=e.slice(4,n),s=e.slice(n+4).trim();return{ok:!0,value:{frontmatter:(0,Tyn.parse)(r)??{},body:s}}}catch(e){return{ok:!1,error:f5(e)}}}function Vhs(t){let e=[],n="",r=null;for(let s=0;se[parseInt(i,10)-1]??""),n=n.replace(/\$\{@:(\d+)(?::(\d+))?\}/g,(s,i,o)=>{let a=parseInt(i,10)-1;return a<0&&(a=0),o?e.slice(a,a+parseInt(o,10)).join(" "):e.slice(a).join(" ")});let r=e.join(" ");return n=n.replace(/\$ARGUMENTS/g,r),n=n.replace(/\$@/g,r),n}function SXe(t,e=[]){return Nyn(t.content,e)}p();var Wyn=Gt(OSe(),1),qyn=Gt(E0e(),1);var Uyn=64,$yn=1024,hms=[".gitignore",".ignore",".fdignore"];function kXe(t,e){let n=` -References are relative to ${bms(t.filePath)}. +---`,3);if(n===-1)return{ok:!0,value:{frontmatter:{},body:e}};let r=e.slice(4,n),i=e.slice(n+4).trim();return{ok:!0,value:{frontmatter:(0,UHn.parse)(r)??{},body:i}}}catch(e){return{ok:!1,error:lV(e)}}}function z5i(t){let e=[],n="",r=null;for(let i=0;ie[parseInt(s,10)-1]??""),n=n.replace(/\$\{@:(\d+)(?::(\d+))?\}/g,(i,s,o)=>{let a=parseInt(s,10)-1;return a<0&&(a=0),o?e.slice(a,a+parseInt(o,10)).join(" "):e.slice(a).join(" ")});let r=e.join(" ");return n=n.replace(/\$ARGUMENTS/g,r),n=n.replace(/\$@/g,r),n}function hdt(t,e=[]){return HHn(t.content,e)}var UHn,fdt=v(()=>{p();UHn=Ot(Wve(),1);vb()});var yke=re((JEc,Ake)=>{p();function zHn(t){return Array.isArray(t)?t:[t]}var gV=void 0,kb="",gdt=" ",Sg="\\",K5i=/[.*+?()[\]{}^$|\\/]/,J5i=/^ +$/,X5i=/(?:[^\\]|^)\\$/,Z5i=/^\\!/,e3i=/^\\#/,t3i=/\r?\n/g,n3i="//",AV=47,qHn=46,Ew="/",KHn="node-ignore";typeof Symbol<"u"&&(KHn=Symbol.for("node-ignore"));var JHn=KHn,RQ=(t,e,n)=>(Object.defineProperty(t,e,{value:n}),n),XHn=()=>!1,r3i=t=>{let{length:e}=t;return t.slice(0,e-e%2)},i3i={alnum:"0-9A-Za-z",alpha:"A-Za-z",blank:" \\t",cntrl:"\\x00-\\x1f\\x7f",digit:"0-9",graph:"!-.0-~",lower:"a-z",print:" -.0-~",punct:"!-.:-@\\[-`{-~",space:" \\t\\n\\r",upper:"A-Z",xdigit:"0-9A-Fa-f"},s3i="\\]^-[",pke=t=>s3i.indexOf(t)<0?t:Sg+t,o3i="(?!\\/)",a3i=(t,e)=>{if(t)return`[^\\/${e}]`;let n=`[${e}]`;return new RegExp(n).test("/")?o3i+n:n},c3i=(t,e)=>{let{length:n}=t,r=e+1,i=kb,s=t[r];(s==="!"||s==="^")&&(i="^",r++);let o=kb,a=kb;for(;;){let c=t[r];if(c===gV)return null;if(c===Sg){let u=t[r+1];if(u===gV)return null;o+=pke(u),a=u,r++}else if(c==="-"&&a&&r+1u&&t[l-1]===":"){let d=i3i[t.slice(u,l-1)];if(d===gV)return null;o+=d,a=kb,r=l}else o+=pke("["),a="[",r=u-2}else o+=pke(c),a=c;if(r++,t[r]==="]")return{end:r,source:a3i(i,o)}}},l3i="[]",fV="\0",u3i=new RegExp(`${fV}(\\d+)${fV}`,"g"),jHn="\uE000",d3i=t=>{let e=[],n=o=>`${fV}${e.push(o)-1}${fV}`,{length:r}=t,i=kb,s=0;for(;skb,"\uFEFF"],[/[\r\n]+$/,()=>kb],[/((?:\\\\)*?)(\\? +)$/,(t,e,n)=>e+(n.indexOf("\\")===0?gdt:kb)],[/(\\+?) /g,(t,e)=>{let{length:n}=e;return e.slice(0,n-n%2)+gdt}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]","?"],[/^\//,()=>"^",Ew],[/\//g,()=>"\\/",Ew],[/^\^*(?:\\\*\\\*\\\/)+/,()=>"^(?:.*\\/)?","*"],[Adt,(t,e)=>!t||t[0]==="^"?t:(p3i.test(e)?"^":"(?:^|\\/)")+t],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,n)=>e+6{let r=n.replace(/\\\*/g,"[^\\/]*");return e+r},"*"],[/(^|[^\\])((?:\\\\)*)\\\*$/,(t,e,n)=>n.length/2%2===0?e+n+jHn:t,"*"],[/\\\\\\(?=[$.|*+(){^])/g,()=>Sg,Sg+Sg],[/\\\\/g,()=>Sg,Sg+Sg],[/\\\[([^\]/]*?)(\\*)($|\])/g,(t,e,n,r)=>`\\[${e}${r3i(n)}${r}`,"["],[Adt,t=>{let e=t[t.length-1];return!e||e===jHn?t:e===Ew?`${t}$`:`${t}(?=$|\\/$)`}]],h3i=/(^|\\\/)?\uE000$/,hke="regex",fke="checkRegex",VHn="_",f3i={[hke](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[fke](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},mke="[^\\/]*",g3i=t=>{if(t.indexOf(mke)<0)return t;let e=[],{length:n}=t,r=0;for(;r0);"*+?".indexOf(t[u])>=0&&u++,e.push({boundary:t.slice(r,u)}),r=u}else a==="^"||a==="$"?(e.push({boundary:a}),r++):(e.push({single:a}),r++)}let i=kb,s=[],o=()=>{let a;s.forEach((c,u)=>{c.wildcard&&(a=u)}),s.forEach((c,u)=>{if(!c.wildcard){i+=c.single;return}i+=u===a?mke:`(?:(?!${s[u+1].single})[^\\/])*`}),s=[]};return e.forEach(a=>{if(a.boundary===void 0){s.push(a);return}o(),i+=a.boundary}),o(),i},A3i=t=>{let{source:e,sources:n}=d3i(t),r=m3i.reduce((i,[s,o,a])=>s===Adt?o(i,t):a!==gV&&i.indexOf(a)<0?i:s.test(i)?i.replace(s,o.bind(t)):i,e);return n.length?r.replace(u3i,(i,s)=>n[s]):r},ZHn=t=>{let e=t.indexOf(Ew);return e<0||e===t.length-1},y3i=t=>{let e=t.length-1,n=t.lastIndexOf(Ew,t[e]===Ew?e-1:e);return n<0?t:t.slice(n+1)},YHn=t=>{if(t.charCodeAt(0)===AV||t.indexOf(n3i)>=0){let r=t.split(Ew).filter(Boolean);return r.pop(),r.length?r.join(Ew)+Ew:kb}let e=t.length-1,n=t.lastIndexOf(Ew,t.charCodeAt(e)===AV?e-1:e);return n<0?kb:t.slice(0,n+1)},gke=t=>typeof t=="string",E3i=t=>t&&gke(t)&&!J5i.test(t)&&!X5i.test(t)&&t.indexOf("#")!==0,b3i=t=>t.split(t3i).filter(Boolean),ydt=class{constructor(e,n,r,i,s,o){this.pattern=e,this.mark=n,this.negative=s,RQ(this,"body",r),RQ(this,"ignoreCase",i),RQ(this,"regexPrefix",o)}get _basenameOnly(){return RQ(this,"_basenameOnly",ZHn(this.body))}get regex(){let e=VHn+hke;return this[e]?this[e]:this._make(hke,e)}get checkRegex(){let e=VHn+fke;return this[e]?this[e]:this._make(fke,e)}_make(e,n){let r=g3i(this.regexPrefix.replace(h3i,f3i[e])),i=this.ignoreCase?new RegExp(r,"i"):new RegExp(r);return RQ(this,n,i)}},_3i=({pattern:t,mark:e},n)=>{let r=!1,i=t;i.indexOf("!")===0&&(r=!0,i=i.substr(1)),i=i.replace(Z5i,"!").replace(e3i,"#");let s=A3i(i);return new ydt(t,e,i,n,r,s)},Edt=class{constructor(e){this._ignoreCase=e,this._rules=[],this._basenameCount=0}_add(e){if(e&&e[JHn]){this._rules=this._rules.concat(e._rules._rules),this._basenameCount+=e._rules._basenameCount,this._added=!0;return}if(gke(e)&&(e={pattern:e}),E3i(e.pattern)){let n=_3i(e,this._ignoreCase);this._added=!0,this._rules.push(n),ZHn(n.body)&&this._basenameCount++}}add(e){return this._added=!1,zHn(gke(e)?b3i(e):e).forEach(this._add,this),this._added}test(e,n,r){let i=!1,s=!1,o,a=this._rules,{length:c}=a,u=this._basenameCount*2>=c,l=u?y3i(e):e;for(let m=0;m{throw new e(t)},tk=(t,e,n)=>gke(t)?t?tk.isNotRelative(t)?n(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${e}\``,TypeError),eqn=t=>{let e=t.charCodeAt(0);if(e===AV)return!0;if(e!==qHn)return!1;if(t.length===1)return!0;let n=t.charCodeAt(1);return n===AV?!0:n!==qHn?!1:t.length===2||t.charCodeAt(2)===AV};tk.isNotRelative=eqn;tk.convert=t=>t;var bdt=class{constructor({ignorecase:e=!0,ignoreCase:n=e,allowRelativePaths:r=!1}={}){RQ(this,JHn,!0),this._rules=new Edt(n),this._strictPathCheck=!r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,n,r){let i=e&&tk.convert(e);return tk(i,e,this._strictPathCheck?x3i:XHn),this._t(i,n,r)}checkIgnore(e){if(e.charCodeAt(e.length-1)!==AV)return this.test(e);let n=YHn(e);if(n){let r=this._t(n,this._testCache,!0);if(r.ignored)return r}return this._rules.test(e,!1,fke)}_t(e,n,r){if(e in n)return n[e];let i=YHn(e),s=i?this._t(i,n,r):gV;return n[e]=s&&s.ignored?s:this._rules.test(e,r,hke)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return zHn(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},_dt=t=>new bdt(t),S3i=t=>tk(t&&tk.convert(t),t,XHn),tqn=()=>{let t=n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/");tk.convert=t;let e=/^[a-z]:\//i;tk.isNotRelative=n=>e.test(n)||eqn(n)};typeof process<"u"&&process.platform==="win32"&&tqn();Ake.exports=_dt;_dt.default=_dt;Ake.exports.isPathValid=S3i;RQ(Ake.exports,Symbol.for("setupWindows"),tqn)});function Sdt(t,e){let n=` +References are relative to ${B3i(t.filePath)}. ${t.content} `;return e?`${n} -${e}`:n}async function Hyn(t,e,n){let r=[],s=[];for(let i of Array.isArray(e)?e:[e]){let o=await t.fileInfo(i,n);if(!o.ok){o.error.code!=="not_found"&&s.push({type:"warning",code:"file_info_failed",message:o.error.message,path:i});continue}let a=o.value;if(await MSe(t,a,s,n)!=="directory")continue;let c=await Vyn(t,a.path,!0,(0,Wyn.default)(),a.path,n);r.push(...c.skills),s.push(...c.diagnostics)}return{skills:r,diagnostics:s}}async function mms(t,e,n,r){let s=[],i=[];for(let o of e){let a=await Hyn(t,o.path,r);for(let c of a.skills)s.push({skill:n?n(c,o.source,r):c,source:o.source});for(let c of a.diagnostics)i.push({...c,source:o.source})}return{skills:s,diagnostics:i}}async function Vyn(t,e,n,r,s,i){let o=[],a=[],c=await t.fileInfo(e,i);if(!c.ok)return c.error.code!=="not_found"&&a.push({type:"warning",code:"file_info_failed",message:c.error.message,path:e}),{skills:o,diagnostics:a};let u=c.value;if(await MSe(t,u,a,i)!=="directory")return{skills:o,diagnostics:a};await fms(t,r,e,s,a,i);let l=await t.listDir(e,i);if(!l.ok)return a.push({type:"warning",code:"list_failed",message:l.error.message,path:e}),{skills:o,diagnostics:a};let d=l.value;for(let h of d){if(h.name!=="SKILL.md")continue;let m=h.path;if(await MSe(t,h,a,i)!=="file")continue;let g=RXe(s,m);if(r.ignores(g))continue;let A=await Gyn(t,m,u.name,i);return A.skill&&o.push(A.skill),a.push(...A.diagnostics),{skills:o,diagnostics:a}}for(let h of d.sort((m,f)=>m.name.localeCompare(f.name))){if(h.name.startsWith(".")||h.name==="node_modules")continue;let m=h.path,f=await MSe(t,h,a,i);if(!f)continue;let g=RXe(s,m),A=f==="directory"?`${g}/`:g;if(r.ignores(A))continue;if(f==="directory"){let b=await Vyn(t,m,!1,r,s,i);o.push(...b.skills),a.push(...b.diagnostics);continue}if(f!=="file"||!n||!h.name.endsWith(".md"))continue;let y=await Gyn(t,m,u.name,i);y.skill&&o.push(y.skill),a.push(...y.diagnostics)}return{skills:o,diagnostics:a}}async function fms(t,e,n,r,s,i){let o=RXe(r,n),a=o?`${o}/`:"";for(let c of hms){let u=await t.joinPath([n,c],i);if(!u.ok){s.push({type:"warning",code:"file_info_failed",message:u.error.message,path:n});continue}let l=u.value,d=await t.fileInfo(l,i);if(!d.ok){d.error.code!=="not_found"&&s.push({type:"warning",code:"file_info_failed",message:d.error.message,path:l});continue}if(d.value.kind!=="file")continue;let h=await t.readTextFile(l,i);if(!h.ok){s.push({type:"warning",code:"read_failed",message:h.error.message,path:l});continue}let m=h.value.split(/\r?\n/).map(f=>gms(f,a)).filter(f=>!!f);m.length>0&&e.add(m)}}function gms(t,e){let n=t.trim();if(!n||n.startsWith("#")&&!n.startsWith("\\#"))return null;let r=t,s=!1;r.startsWith("!")?(s=!0,r=r.slice(1)):r.startsWith("\\!")&&(r=r.slice(1)),r.startsWith("/")&&(r=r.slice(1));let i=e?`${e}${r}`:r;return s?`!${i}`:i}async function Gyn(t,e,n,r){let s=[],i=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()==="SKILL.md",o=await t.readTextFile(e,r);if(!o.ok)return s.push({type:"warning",code:"read_failed",message:o.error.message,path:e}),{skill:null,diagnostics:s};let a=Ems(o.value);if(!a.ok)return i&&s.push({type:"warning",code:"parse_failed",message:a.error.message,path:e}),{skill:null,diagnostics:s};let{frontmatter:c,body:u}=a.value,l=typeof c.description=="string"?c.description:void 0;if(!i&&(!l||l.trim()===""))return{skill:null,diagnostics:s};for(let m of yms(l))s.push({type:"warning",code:"invalid_metadata",message:m,path:e});let h=(typeof c.name=="string"?c.name:void 0)||n;for(let m of Ams(h,n))s.push({type:"warning",code:"invalid_metadata",message:m,path:e});return!l||l.trim()===""?{skill:null,diagnostics:s}:{skill:{name:h,description:l,content:u,filePath:e,disableModelInvocation:c["disable-model-invocation"]===!0},diagnostics:s}}function Ams(t,e){let n=[];return t!==e&&n.push(`name "${t}" does not match parent directory "${e}"`),t.length>Uyn&&n.push(`name exceeds ${Uyn} characters (${t.length})`),/^[a-z0-9-]+$/.test(t)||n.push("name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)"),(t.startsWith("-")||t.endsWith("-"))&&n.push("name must not start or end with a hyphen"),t.includes("--")&&n.push("name must not contain consecutive hyphens"),n}function yms(t){let e=[];return!t||t.trim()===""?e.push("description is required"):t.length>$yn&&e.push(`description exceeds ${$yn} characters (${t.length})`),e}function Ems(t){try{let e=t.replace(/\r\n/g,` +${e}`:n}async function aqn(t,e,n){let r=[],i=[];for(let s of Array.isArray(e)?e:[e]){let o=await t.fileInfo(s,n);if(!o.ok){o.error.code!=="not_found"&&i.push({type:"warning",code:"file_info_failed",message:o.error.message,path:s});continue}let a=o.value;if(await Eke(t,a,i,n)!=="directory")continue;let c=await cqn(t,a.path,!0,(0,sqn.default)(),a.path,n);r.push(...c.skills),i.push(...c.diagnostics)}return{skills:r,diagnostics:i}}async function I3i(t,e,n,r){let i=[],s=[];for(let o of e){let a=await aqn(t,o.path,r);for(let c of a.skills)i.push({skill:n?n(c,o.source,r):c,source:o.source});for(let c of a.diagnostics)s.push({...c,source:o.source})}return{skills:i,diagnostics:s}}async function cqn(t,e,n,r,i,s){let o=[],a=[],c=await t.fileInfo(e,s);if(!c.ok)return c.error.code!=="not_found"&&a.push({type:"warning",code:"file_info_failed",message:c.error.message,path:e}),{skills:o,diagnostics:a};let u=c.value;if(await Eke(t,u,a,s)!=="directory")return{skills:o,diagnostics:a};await w3i(t,r,e,i,a,s);let l=await t.listDir(e,s);if(!l.ok)return a.push({type:"warning",code:"list_failed",message:l.error.message,path:e}),{skills:o,diagnostics:a};let d=l.value;for(let m of d){if(m.name!=="SKILL.md")continue;let h=m.path;if(await Eke(t,m,a,s)!=="file")continue;let g=xdt(i,h);if(r.ignores(g))continue;let A=await iqn(t,h,u.name,s);return A.skill&&o.push(A.skill),a.push(...A.diagnostics),{skills:o,diagnostics:a}}for(let m of d.sort((h,f)=>h.name.localeCompare(f.name))){if(m.name.startsWith(".")||m.name==="node_modules")continue;let h=m.path,f=await Eke(t,m,a,s);if(!f)continue;let g=xdt(i,h),A=f==="directory"?`${g}/`:g;if(r.ignores(A))continue;if(f==="directory"){let E=await cqn(t,h,!1,r,i,s);o.push(...E.skills),a.push(...E.diagnostics);continue}if(f!=="file"||!n||!m.name.endsWith(".md"))continue;let y=await iqn(t,h,u.name,s);y.skill&&o.push(y.skill),a.push(...y.diagnostics)}return{skills:o,diagnostics:a}}async function w3i(t,e,n,r,i,s){let o=xdt(r,n),a=o?`${o}/`:"";for(let c of C3i){let u=await t.joinPath([n,c],s);if(!u.ok){i.push({type:"warning",code:"file_info_failed",message:u.error.message,path:n});continue}let l=u.value,d=await t.fileInfo(l,s);if(!d.ok){d.error.code!=="not_found"&&i.push({type:"warning",code:"file_info_failed",message:d.error.message,path:l});continue}if(d.value.kind!=="file")continue;let m=await t.readTextFile(l,s);if(!m.ok){i.push({type:"warning",code:"read_failed",message:m.error.message,path:l});continue}let h=m.value.split(/\r?\n/).map(f=>T3i(f,a)).filter(f=>!!f);h.length>0&&e.add(h)}}function T3i(t,e){let n=t.trim();if(!n||n.startsWith("#")&&!n.startsWith("\\#"))return null;let r=t,i=!1;r.startsWith("!")?(i=!0,r=r.slice(1)):r.startsWith("\\!")&&(r=r.slice(1)),r.startsWith("/")&&(r=r.slice(1));let s=e?`${e}${r}`:r;return i?`!${s}`:s}async function iqn(t,e,n,r){let i=[],s=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()==="SKILL.md",o=await t.readTextFile(e,r);if(!o.ok)return i.push({type:"warning",code:"read_failed",message:o.error.message,path:e}),{skill:null,diagnostics:i};let a=k3i(o.value);if(!a.ok)return s&&i.push({type:"warning",code:"parse_failed",message:a.error.message,path:e}),{skill:null,diagnostics:i};let{frontmatter:c,body:u}=a.value,l=typeof c.description=="string"?c.description:void 0;if(!s&&(!l||l.trim()===""))return{skill:null,diagnostics:i};for(let h of R3i(l))i.push({type:"warning",code:"invalid_metadata",message:h,path:e});let m=(typeof c.name=="string"?c.name:void 0)||n;for(let h of v3i(m,n))i.push({type:"warning",code:"invalid_metadata",message:h,path:e});return!l||l.trim()===""?{skill:null,diagnostics:i}:{skill:{name:m,description:l,content:u,filePath:e,disableModelInvocation:c["disable-model-invocation"]===!0},diagnostics:i}}function v3i(t,e){let n=[];return t!==e&&n.push(`name "${t}" does not match parent directory "${e}"`),t.length>nqn&&n.push(`name exceeds ${nqn} characters (${t.length})`),/^[a-z0-9-]+$/.test(t)||n.push("name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)"),(t.startsWith("-")||t.endsWith("-"))&&n.push("name must not start or end with a hyphen"),t.includes("--")&&n.push("name must not contain consecutive hyphens"),n}function R3i(t){let e=[];return!t||t.trim()===""?e.push("description is required"):t.length>rqn&&e.push(`description exceeds ${rqn} characters (${t.length})`),e}function k3i(t){try{let e=t.replace(/\r\n/g,` `).replace(/\r/g,` `);if(!e.startsWith("---"))return{ok:!0,value:{frontmatter:{},body:e}};let n=e.indexOf(` ----`,3);if(n===-1)return{ok:!0,value:{frontmatter:{},body:e}};let r=e.slice(4,n),s=e.slice(n+4).trim();return{ok:!0,value:{frontmatter:(0,qyn.parse)(r)??{},body:s}}}catch(e){return{ok:!1,error:f5(e)}}}async function MSe(t,e,n,r){if(e.kind==="file"||e.kind==="directory")return e.kind;let s=await t.canonicalPath(e.path,r);if(!s.ok){s.error.code!=="not_found"&&n.push({type:"warning",code:"file_info_failed",message:s.error.message,path:e.path});return}let i=await t.fileInfo(s.value,r);if(!i.ok){i.error.code!=="not_found"&&n.push({type:"warning",code:"file_info_failed",message:i.error.message,path:e.path});return}return i.value.kind==="file"||i.value.kind==="directory"?i.value.kind:void 0}function bms(t){let e=t.replace(/[\\/]+$/,""),n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===2&&e[1]===":"?e.slice(0,3):n<=0?"/":e.slice(0,n)}function RXe(t,e){let n=t.replace(/\\/g,"/").replace(/\/+$/,""),r=e.replace(/\\/g,"/").replace(/\/+$/,"");return r===n?"":r.startsWith(`${n}/`)?r.slice(n.length+1):r.replace(/^\/+/,"")}p();p();function Hu(t){return{control:t.control,settings:t.settings,latestAssistantEntryId:t.latestAssistantEntryId}}p();function $Z(t,e){return e.map(n=>{let r={...n,parentId:t};return t=n.id,r})}function NXe(t,e,n){let r=n===void 0?{}:{runId:n};return t.type==="message"?[{type:"message_start",lane:e,...r,message:t.message},{type:"message_end",lane:e,...r,message:t.message,entryId:t.id},{type:"entry_added",lane:e,entry:t}]:[{type:"entry_added",lane:e,entry:t}]}function tI(t,e,n,r,s=0){return t.flatMap((i,o)=>NXe(Ayn(i,e.seqs[s+o],e.timestamp),n,r))}function LSe(t,e,n){return t.continueOperation(n,async(r,s,i,o)=>{if(r.tipId===null)throw new ln("Run operation has no Branch tip");return{kind:"return",result:(await o.scanBranch({start:r.tipId,stopAtType:"compaction",order:"newestFirst"},e.context)).reverse()}},e.context)}async function FSe(t,e,n){let r=await LSe(t,e,n);return r.kind==="cancel_requested"?r:{kind:"result",value:await cyn(r.value,{entryProjectors:t.readConfig().entryProjectors},e.context)}}function nI(t,e,n){return Promise.all(e.map(async r=>{let s=await t.getValue(bc(r.entryId),n);if(s===void 0)throw new ln(`Pending ${r.kind} entry ${r.entryId} is missing its payload`);if(s.value.type==="message")return{entryId:r.entryId,kind:r.kind,type:"message",message:s.value.payload};if(r.kind!=="write")throw new ln(`Pending ${r.kind} entry ${r.entryId} is not a message`);return{entryId:r.entryId,kind:"write",type:"custom",customType:s.value.customType,...s.value.payload===void 0?{}:{data:s.value.payload}}}))}p();p();async function JE(t,e,n,r){let[s,i,o,a]=await Promise.all([t.scanValues(OZ(e),r),t.scanValues(MZ(e),r),t.scanValues(gXe(e),r),t.scanValues(AXe(e),r)]),c=new Set;if(n.at==="tools")for(let l of n.batch.calls)l.status==="outcome_ready"&&c.add(l.resultEntryId);let u;return(n.at==="assistant.effect_pending"||n.at==="deferred.effect_pending")&&(u=AT(eI(e,n.responseEntryId))),[fa(yT(e)),fa(y0(e)),...s.map(({address:l})=>fa(l)),...i.map(({address:l})=>fa(l)),...o.map(({address:l})=>fa(l)),...a.map(({address:l})=>fa(l)),...u===void 0?[]:[u],...[...c].map(l=>fa(bc(l)))]}function XE(t,e,n,r){if(e==="failed"!=(r!==void 0))throw new ln("Only a failed operation result may carry an error");return{operationId:t.operationId,kind:t.intent.kind,status:e,...r===void 0?{}:{error:r},fromTipId:t.sourceTipId,tipId:n,startedAt:t.startedAt,endedAt:Date.now()}}function DXe(t){let e=t.readConfig().retryPolicy;return e.enabled?{maxAttempts:e.maxRetries+1,baseDelayMs:e.baseDelayMs}:{maxAttempts:1,baseDelayMs:e.baseDelayMs}}function aL(t,e,n,r,s){let i=t.readConfig();return{...n,at:"assistant.ready",generationContext:{stepId:t.session.idGenerator.next(),triggerEntryId:r,configuration:e.configuration,streamOptions:i.streamOptions,retryPolicy:DXe(t),overflowRecoveryUsed:s},nextAttempt:1}}async function GZ(t,e,n,r,s,i,o){let a=n.inbox.filter(S=>S.kind==="steer"),c=r.settings.steeringMode==="all"?a:a.slice(0,1),u=n.inbox.filter(S=>S.kind==="write"||c.some(C=>C.entryId===S.entryId)),l=S=>Promise.all(S.map(async C=>{let I=await s.getValue(bc(C.entryId),e.context);if(I===void 0)throw new ln(`Pending ${C.kind} entry ${C.entryId} is missing its payload`);if(C.kind!=="write"&&I.value.type!=="message")throw new ln(`Queued ${C.kind} entry ${C.entryId} is not a message`);return{item:C,pending:I.value}})),d=await l(u),h=S=>S.type==="message"||t.readConfig().entryProjectors[S.customType]!==void 0;if(o&&!d.some(({pending:S})=>h(S))){let S=n.inbox.filter(I=>I.kind==="followUp"),C=r.settings.followUpMode==="all"?S:S.slice(0,1);u=[...u,...C].sort((I,x)=>n.inbox.indexOf(I)-n.inbox.indexOf(x)),d=await l(u)}let m=i,f,g=d.map(({item:S,pending:C})=>{let I=C.type==="message"?{id:S.entryId,parentId:m,type:"message",message:C.payload}:{id:S.entryId,parentId:m,type:"custom",customType:C.customType,...C.payload===void 0?{}:{data:C.payload}};return m=S.entryId,h(C)&&(f=S.entryId),I}),A=new Set(u.map(S=>S.entryId)),y=n.inbox.filter(S=>!A.has(S.entryId)),b=u.length===0?void 0:await nI(s,y,e.context);return{entries:g,writes:[...g.map(S=>Sd(S)),...u.map(S=>fa(bc(S.entryId))),...g.length===0?[]:[xr(Ro(t.name),m)]],tipId:m,inbox:y,...f===void 0?{}:{triggerEntryId:f},...b===void 0?{}:{queues:b}}}function ST(t,e,n,r,s){return[...tI(t.entries,e,r,s,n),...t.queues===void 0?[]:[{type:"queue_update",lane:r,queues:t.queues}]]}async function QSe(t,e,n,r,s,i=[]){let o=await FSe(t,e,n);if(o.kind==="cancel_requested")return{kind:"continue"};let a=await t.hooks.runWithGate("before_run_end",{lane:t.name,runId:e.operationId,messages:o.value},e.gate,e.context),c=a?.followUp===void 0?void 0:{id:t.session.idGenerator.next(),message:{role:"user",content:a.followUp,timestamp:Date.now()}},u=await t.continueOperation(n,async(l,d,h,m)=>{let f=await GZ(t,e,l,d,m,l.tipId,!0);if(f.triggerEntryId!==void 0)return{kind:"commit",writes:f.writes,operationState:aL(t,l,d,f.triggerEntryId,!1),lane:{tipId:f.tipId,inbox:f.inbox},materialize:()=>({kind:"continue"}),events:b=>[...i,...ST(f,b,0,t.name,e.operationId)]};if(f.entries.length===s.length&&f.entries.every((b,S)=>b.id===s[S])&&c!==void 0){let b={id:c.id,parentId:f.tipId,type:"message",message:c.message},S=f.writes.length;return{kind:"commit",writes:[...f.writes,Sd(b),xr(Ro(t.name),c.id)],operationState:aL(t,l,d,c.id,!1),lane:{tipId:c.id,inbox:f.inbox},materialize:()=>({kind:"continue"}),events:C=>[...i,...ST(f,C,0,t.name,e.operationId),...NXe({...b,seq:C.seqs[S],timestamp:C.timestamp},t.name,e.operationId)]}}if(f.tipId===null)throw new ln("Completed run has no tip");if(r.includeFinalAssistant&&d.latestAssistantEntryId===null)throw new ln("Completed run is missing its final assistant");let A=XE(h,"completed",f.tipId),y=await JE(m,e.operationId,d,e.context);return{kind:"finish",writes:[...f.writes,...y],record:A,lane:{tipId:f.tipId,inbox:f.inbox},materialize:()=>({kind:"settled",outcome:A}),events:b=>[...i,...ST(f,b,0,t.name,e.operationId),{type:"run_end",lane:t.name,runId:e.operationId,status:"completed",fromTipId:h.sourceTipId,tipId:f.tipId,endedAt:A.endedAt}]}},e.context);return u.kind==="cancel_requested"?{kind:"continue"}:u.value}p();function S5(t,e){let n=t*2**Math.max(0,e-1);return Number.isSafeInteger(n)?n:Number.MAX_SAFE_INTEGER}function USe(t,e,n=Date.now()){let r=n+S5(t,e);return Number.isSafeInteger(r)?r:Number.MAX_SAFE_INTEGER}function $Se(t,e){return new Promise((n,r)=>{let s,i=()=>{s!==void 0&&clearTimeout(s),e.removeEventListener("abort",o)},o=()=>{i(),r(e.reason)},a=()=>{let c=t-Date.now();if(c<=0){i(),n();return}s=setTimeout(a,Math.min(c,2147483647))};e.addEventListener("abort",o,{once:!0}),e.aborted?o():a()})}var C5=class extends Error{constructor(){super("Structural generation was cancelled"),this.name="StructuralCancelled"}};function Yyn(t){return{read:[...t.read],written:[...t.written],edited:[...t.edited]}}function WSe(t){return{kind:"compaction",messagesToSummarize:t.messagesToSummarize,turnPrefixMessages:t.turnPrefixMessages,retainedTail:t.retainedTail,isSplitTurn:t.isSplitTurn,tokensBefore:t.tokensBefore,...t.previousSummary===void 0?{}:{previousSummary:t.previousSummary},fileOps:Yyn(t.fileOps),settings:t.settings}}function Kyn(t){return{kind:"branch_summary",messages:t.messages,fileOps:Yyn(t.fileOps),totalTokens:t.totalTokens}}function zyn(t){return{read:new Set(t.read),written:new Set(t.written),edited:new Set(t.edited)}}function Jyn(t){return{messagesToSummarize:t.messagesToSummarize,turnPrefixMessages:t.turnPrefixMessages,retainedTail:t.retainedTail,isSplitTurn:t.isSplitTurn,tokensBefore:t.tokensBefore,...t.previousSummary===void 0?{}:{previousSummary:t.previousSummary},fileOps:zyn(t.fileOps),settings:t.settings}}function Xyn(t){return{messages:t.messages,fileOps:zyn(t.fileOps),totalTokens:t.totalTokens}}function WZ(t){return t.boundary.kind==="commit_navigation"?"branch_summary":"compaction"}function GSe(t){if(t.reason!==void 0)return t.reason;if(t.boundary.kind==="finish")return"manual";throw new ln(`In-run compaction task ${t.taskId} is missing its reason`)}function _ms(t){if(t.boundary.kind!=="commit_navigation")throw new ln(`Summary task ${t.taskId} is not a navigation`);return t.boundary}async function Sms(t,e,n){return t.continueOperation(n,async(r,s,i,o)=>{let a=WZ(s.task),c=await o.getValue(E0(e.operationId,s.task.taskId),e.context);if(c?.value.kind!==a)throw new ln(`Structural task ${s.task.taskId} is missing its ${a} preparation`);if(s.task.boundary.kind==="commit_navigation"){let u=s.task.boundary.targetId;if(!(await o.getEntries([u],e.context)).has(u))throw new ln(`Navigation target ${u} is missing`)}return{kind:"return",result:c.value.kind==="compaction"?Jyn(c.value):Xyn(c.value)}},e.context)}function Cms(t,e,n){return{resultEntryId:e,configuration:n,streamOptions:{...t.readConfig().streamOptions,deferred:!1},retryPolicy:DXe(t)}}function Zyn(t,e,n,r){return{type:"usage",lane:r,row:{...t,seq:n.seqs[e]},totals:n.stats.usage}}function qZ(t,e,n){return{code:t,message:e,...n===void 0?{}:{details:n}}}async function CT(t,e,n,r){let s=(r.kind==="compaction"||r.kind==="branch_summary")&&r.fromHook&&r.result.usage!==void 0?t.session.idGenerator.next():void 0,i=await t.continueOperation(n,async(a,c,u,l)=>{let d=WZ(c.task),h;if((r.kind==="compaction"||r.kind==="branch_summary")&&r.kind!==d)throw new ln(`Structural ${r.kind} result does not match ${d} task ${c.task.taskId}`);let m=[],f=[],g=a.tipId;if(s!==void 0&&(r.kind==="compaction"||r.kind==="branch_summary")){let b=r.result.usage;if(b===void 0)throw new ln("Hook usage id exists without structural usage");let S={id:s,usage:b,adjustment:!1},C=m.length;m.push(sy(S)),f.push(I=>[Zyn(S,C,I,t.name)])}if(r.kind==="compaction"){let b={id:r.resultEntryId,parentId:a.tipId,type:"compaction",summary:r.result.summary,retainedTail:r.result.retainedTail,tokensBefore:r.result.tokensBefore,...r.result.details===void 0?{}:{details:r.result.details},...r.result.usage===void 0?{}:{usage:r.result.usage},fromHook:r.fromHook},S=m.length;m.push(Sd(b),xr(Ro(t.name),r.resultEntryId)),g=r.resultEntryId,f.push(C=>tI([b],C,t.name,e.operationId,S))}else if(r.kind==="branch_summary"){let b=_ms(c.task),S={id:r.resultEntryId,parentId:b.targetId,type:"branch_summary",fromId:u.sourceTipId,summary:r.result.summary,details:{readFiles:r.result.readFiles,modifiedFiles:r.result.modifiedFiles},...r.result.usage===void 0?{}:{usage:r.result.usage},fromHook:r.fromHook};m.push(xr(Ro(t.name),b.targetId));let C=m.length;m.push(Sd(S),xr(Ro(t.name),r.resultEntryId)),b.label!==void 0&&m.push(xr(_0(b.targetId),b.label)),g=r.resultEntryId,f.push(I=>tI([S],I,t.name,e.operationId,C))}let A=c.at==="summary.ready"?c.nextAttempt:c.at==="summary.effect_pending"?c.attempt:void 0;A!==void 0&&A>1&&f.push(()=>[{type:"retry_end",lane:t.name,runId:e.operationId,step:c.task.taskId,attempt:A,success:r.kind==="compaction"||r.kind==="branch_summary",...r.kind==="failed"?{finalError:r.error.message}:{}}]),r.kind==="compaction"&&f.push(b=>[{type:"compaction_end",lane:t.name,runId:e.operationId,reason:GSe(c.task),status:"completed",entryId:r.resultEntryId,endedAt:h??b.timestamp}]);let y=b=>f.flatMap(S=>S(b));switch(c.task.boundary.kind){case"resume_checkpoint":{if(r.kind==="branch_summary")throw new ln("Run compaction boundary received a branch summary");if(r.kind==="compaction"||r.kind==="declined"&&c.task.reason==="threshold"){if(g===null)throw new ln("Run compaction has no Branch tip");let x=c.task.boundary.resumeAfter.continuation,w=await GZ(t,e,a,c,l,g,r.kind==="declined"&&x.kind==="may_finish");if(r.kind==="declined"&&w.triggerEntryId===void 0&&x.kind==="may_finish")return{kind:"return",result:{kind:"finish_pending",entryIds:w.entries.map(P=>P.id)}};let R=m.length;m.push(...w.writes);let N;if(w.triggerEntryId!==void 0||x.kind==="need_assistant"){let P=w.triggerEntryId===void 0&&x.kind==="need_assistant"?x.overflowRecoveryUsed:!1;N=aL(t,a,c,w.triggerEntryId??c.task.boundary.resumeAfter.triggerEntryId,P)}else N={...Hu(c),at:"checkpoint",...c.task.boundary.resumeAfter};return{kind:"commit",writes:m,operationState:N,lane:{tipId:w.tipId,inbox:w.inbox},materialize:()=>({kind:"continue"}),events:P=>[...r.kind==="compaction"?y(P):[{type:"compaction_end",lane:t.name,runId:e.operationId,reason:"threshold",status:"declined",endedAt:P.timestamp}],...ST(w,P,R,t.name,e.operationId)]}}if(a.tipId===null)throw new ln("Failed run has no Branch tip");let b=r.kind==="declined"?qZ("compaction_declined","Overflow compaction was declined"):r.error,S=await JE(l,e.operationId,c,e.context),C=XE(u,"failed",a.tipId,b),I=r.kind==="declined"?{type:"compaction_end",lane:t.name,runId:e.operationId,reason:GSe(c.task),status:"declined",endedAt:C.endedAt}:{type:"compaction_end",lane:t.name,runId:e.operationId,reason:GSe(c.task),status:"failed",error:r.error,endedAt:C.endedAt};return{kind:"finish",writes:[...m,...S],record:C,materialize:()=>({kind:"settled",outcome:C}),events:x=>[...y(x),I,{type:"run_end",lane:t.name,runId:e.operationId,status:"failed",error:b,fromTipId:u.sourceTipId,tipId:a.tipId,endedAt:C.endedAt}]}}case"finish":{if(r.kind==="branch_summary")throw new ln("Compaction finish boundary received a branch summary");if(r.kind!=="compaction"&&a.tipId===null)throw new ln("Standalone compaction has no Branch tip");let b=r.kind==="failed"?r.error:void 0,S=r.kind==="declined"?"declined":r.kind==="failed"?"failed":"completed",C=await JE(l,e.operationId,c,e.context),I=XE(u,S,g,b);h=I.endedAt;let x=r.kind==="compaction"?void 0:r.kind==="declined"?{type:"compaction_end",lane:t.name,runId:e.operationId,reason:"manual",status:"declined",endedAt:I.endedAt}:{type:"compaction_end",lane:t.name,runId:e.operationId,reason:"manual",status:"failed",error:r.error,endedAt:I.endedAt};return{kind:"finish",writes:[...m,...C],record:I,...r.kind==="compaction"?{lane:{tipId:g}}:{},materialize:()=>({kind:"settled",outcome:I}),events:w=>[...y(w),...x===void 0?[]:[x]]}}case"commit_navigation":{if(r.kind==="compaction")throw new ln("Navigation boundary received a compaction result");let b=r.kind==="failed"?r.error:void 0,S=r.kind==="declined"?"declined":r.kind==="failed"?"failed":"completed",C=await JE(l,e.operationId,c,e.context),I=XE(u,S,g,b),x=r.kind==="branch_summary"?{type:"navigation_end",lane:t.name,runId:e.operationId,status:"completed",fromTipId:u.sourceTipId,tipId:g,endedAt:I.endedAt}:r.kind==="declined"?{type:"navigation_end",lane:t.name,runId:e.operationId,status:"declined",fromTipId:u.sourceTipId,tipId:g,endedAt:I.endedAt}:{type:"navigation_end",lane:t.name,runId:e.operationId,status:"failed",error:r.error,fromTipId:u.sourceTipId,tipId:g,endedAt:I.endedAt};return{kind:"finish",writes:[...m,...C],record:I,...r.kind==="branch_summary"?{lane:{tipId:g}}:{},materialize:()=>({kind:"settled",outcome:I}),events:w=>[...y(w),x]}}}},e.context);if(i.kind==="cancel_requested")return{kind:"continue"};if(i.value.kind!=="finish_pending")return i.value;let o=n.task.boundary;if(o.kind!=="resume_checkpoint"||o.resumeAfter.continuation.kind!=="may_finish")throw new ln("Structural finish mediation requires a resumable finish boundary");return QSe(t,e,n,o.resumeAfter.continuation,i.value.entryIds,[{type:"compaction_end",lane:t.name,runId:e.operationId,reason:"threshold",status:"declined",endedAt:Date.now()}])}async function jyn(t,e,n){let r=t.session.idGenerator.next(),s=await t.continueOperation(n,(i,o)=>{let a={...Hu(o),at:"summary.ready",task:o.task,summaryContext:Cms(t,r,i.configuration),nextAttempt:1};return{kind:"commit",writes:[],operationState:a,materialize:()=>({kind:"continue"})}},e.context);return s.kind==="cancel_requested"?{kind:"continue"}:s.value}async function eEn(t,e,n){let r=await Sms(t,e,n);if(r.kind==="cancel_requested")return{kind:"continue"};if(n.task.boundary.kind==="commit_navigation"){if(!("messages"in r.value))throw new ln("Navigation task has invalid durable preparation");let i=await t.hooks.runWithGate("before_navigation",{lane:t.name,runId:e.operationId,targetId:n.task.boundary.targetId,preparation:r.value,...n.task.customInstructions===void 0?{}:{customInstructions:n.task.customInstructions}},e.gate,e.context);return i?.decline===!0?CT(t,e,n,{kind:"declined"}):i?.summary!==void 0?CT(t,e,n,{kind:"branch_summary",resultEntryId:t.session.idGenerator.next(),result:i.summary,fromHook:!0}):jyn(t,e,n)}if(!("messagesToSummarize"in r.value))throw new ln("Compaction task has invalid durable preparation");let s=await t.hooks.runWithGate("before_compaction",{lane:t.name,runId:e.operationId,reason:GSe(n.task),preparation:r.value,...n.task.customInstructions===void 0?{}:{customInstructions:n.task.customInstructions}},e.gate,e.context);return s?.decline===!0?CT(t,e,n,{kind:"declined"}):s?.compaction!==void 0?CT(t,e,n,{kind:"compaction",resultEntryId:t.session.idGenerator.next(),result:s.compaction,fromHook:!0}):jyn(t,e,n)}function Ims(t){return{...Hu(t),at:"summary.effect_pending",task:t.task,summaryContext:t.summaryContext,attempt:t.nextAttempt,usageIds:[]}}function tEn(t,e){return{...Hu(t),at:"summary.retry_wait",task:t.task,summaryContext:t.summaryContext,nextAttempt:t.attempt+1,notBefore:USe(t.summaryContext.retryPolicy.baseDelayMs,t.attempt),errorMessage:e}}function xms(t){return{...Hu(t),at:"summary.ready",task:t.task,summaryContext:t.summaryContext,nextAttempt:t.nextAttempt}}async function wms(t,e,n){return t.continueOperation(n,(r,s)=>{let i=Ims(s);return{kind:"commit",writes:[],operationState:i,materialize:()=>i}},e.context)}async function Tms(t,e,n,r,s){return t.continueOperation(n,(i,o)=>{let a={...o,request:{index:r,usageId:s}};return{kind:"commit",writes:[],operationState:a,materialize:()=>a}},e.context)}async function vms(t,e,n,r,s){await t.settleOperation(n,(i,o)=>{let a={...o,usageIds:[...o.usageIds,r]};delete a.request;let c={id:r,usage:s.usage,adjustment:!1};return{kind:"commit",writes:[sy(c)],operationState:a,materialize:()=>{},events:u=>[Zyn(c,0,u,t.name)]}},e.context)}function Rms(t,e,n,r){return{...t,transport:e.transport,timeoutMs:e.timeoutMs,maxRetries:e.maxRetries,maxRetryDelayMs:e.maxRetryDelayMs,headers:e.headers,metadata:e.metadata,cacheRetention:"none",deferred:!1,signal:n.abortSignal,telemetryContext:Qh(n),onPayload:r}}async function kms(t,e,n,r,s){let i=0,o,a=async(c,u,l)=>{let d={...n.summaryContext.streamOptions,deferred:!1},h=await t.hooks.runWithGate("before_request",{lane:t.name,runId:e.operationId,model:r,step:WZ(n.task),attempt:n.attempt,streamOptions:d},e.gate,l).catch(async b=>{throw b instanceof Uh?(await b.cancellation,new C5):b}),m={...h?.streamOptions===void 0?d:oL(d,h.streamOptions),deferred:!1},f=t.session.idGenerator.next(),g=await Tms(t,e,n,i,f);if(i+=1,g.kind==="cancel_requested")throw new C5;let A=ug(e.gate.signal,l),y;try{y=await e.gate.admit(()=>t.models.completeSimple(r,c,Rms(u,m,A,async(b,S)=>(await t.hooks.runWithGate("before_payload",{lane:t.name,runId:e.operationId,model:S,payload:b},e.gate,A))?.payload)))}catch(b){throw b instanceof Uh?(await b.cancellation,new C5):b}return o=y,await vms(t,e,g.value,f,y),y};try{if(WZ(n.task)==="compaction"){if(!("messagesToSummarize"in s))throw new ln("Compaction summary has invalid durable preparation");let u=await rXe(s,{model:r,customInstructions:n.task.customInstructions,thinkingLevel:n.summaryContext.configuration.thinkingLevel},a,e.context);return u.ok?{kind:"compaction",result:u.value,retryable:o!==void 0&&z_(o)}:{kind:"error",error:qZ(u.error.code,u.error.message),retryable:o!==void 0&&z_(o)}}if(!("messages"in s))throw new ln("Branch summary has invalid durable preparation");let c=await bXe(s,{customInstructions:n.task.customInstructions},a,e.context);return c.ok?{kind:"branch_summary",result:c.value,retryable:o!==void 0&&z_(o)}:{kind:"error",error:qZ(c.error.code,c.error.message),retryable:o!==void 0&&z_(o)}}catch(c){if(c instanceof C5)return{kind:"cancel_requested"};throw c}}async function Nms(t,e,n){return t.continueOperation(n,async(r,s,i,o)=>{let a=WZ(s.task),c=await o.getValue(E0(e.operationId,s.task.taskId),e.context);if(c===void 0||c.value.kind!==a)throw new ln(`Structural task ${s.task.taskId} has invalid durable preparation`);return{kind:"return",result:c.value.kind==="compaction"?Jyn(c.value):Xyn(c.value)}},e.context)}async function Dms(t,e,n,r){if(r.kind==="cancel_requested")return{kind:"continue"};if(r.kind==="compaction")return CT(t,e,n,{kind:"compaction",resultEntryId:n.summaryContext.resultEntryId,result:r.result,fromHook:!1});if(r.kind==="branch_summary")return CT(t,e,n,{kind:"branch_summary",resultEntryId:n.summaryContext.resultEntryId,result:r.result,fromHook:!1});if(r.error.code==="aborted"&&t.state.operation.state.control.status==="running")throw new ln("Structural provider response is aborted while durable control is running");if(r.retryable&&n.attempt({kind:"commit",writes:[],operationState:s,materialize:()=>({kind:"continue"}),events:()=>[{type:"retry_scheduled",lane:t.name,runId:e.operationId,step:n.task.taskId,attempt:s.nextAttempt,maxAttempts:n.summaryContext.retryPolicy.maxAttempts,delayMs:S5(n.summaryContext.retryPolicy.baseDelayMs,n.attempt),notBefore:s.notBefore,errorMessage:r.error.message}]}),e.context);return i.kind==="cancel_requested"?{kind:"continue"}:i.value}return CT(t,e,n,{kind:"failed",error:r.error})}async function nEn(t,e,n){let r=await Nms(t,e,n);if(r.kind==="cancel_requested")return{kind:"continue"};let s=n.summaryContext.configuration.model,i=t.models.getModel(s.provider,s.modelId);if(i===void 0)return CT(t,e,n,{kind:"failed",error:qZ("model_unavailable","The configured model is unavailable in this process",s)});let o=await wms(t,e,n);if(o.kind==="cancel_requested")return{kind:"continue"};let a=await kms(t,e,o.value,i,r.value);return Dms(t,e,o.value,a)}async function rEn(t,e,n){if(Date.now()$Se(n.notBefore,e.gate.signal))}let r=await t.continueOperation(n,(s,i)=>{let o=xms(i);return{kind:"commit",writes:[],operationState:o,materialize:()=>({kind:"continue"}),events:()=>[{type:"retry_start",lane:t.name,runId:e.operationId,step:i.task.taskId,attempt:i.nextAttempt}]}},e.context);return r.kind==="cancel_requested"?{kind:"continue"}:r.value}async function sEn(t,e,n){let r=qZ("structural_interrupted","Structural summary attempt was interrupted and its external outcome is unknown");if(n.attempt>=n.summaryContext.retryPolicy.maxAttempts)return CT(t,e,n,{kind:"failed",error:r});let s=tEn(n,r.message),i=await t.continueOperation(n,()=>({kind:"commit",writes:[],operationState:s,materialize:()=>({kind:"continue"}),events:()=>[{type:"retry_scheduled",lane:t.name,runId:e.operationId,step:n.task.taskId,attempt:s.nextAttempt,maxAttempts:n.summaryContext.retryPolicy.maxAttempts,delayMs:S5(n.summaryContext.retryPolicy.baseDelayMs,n.attempt),notBefore:s.notBefore,errorMessage:r.message,recovery:!0}]}),e.context);return i.kind==="cancel_requested"?{kind:"continue"}:i.value}async function iEn(t,e,n){let r=n.settings.compaction,s=t.state.configuration.model,i=t.models.getModel(s.provider,s.modelId);if(!r.enabled||i===void 0)return{kind:"result",value:void 0};let o=await LSe(t,e,n);if(o.kind==="cancel_requested")return o;let a=o.value.findIndex(l=>l.id===n.triggerEntryId),c=-1;for(let l=o.value.length-1;l>=0;l--)if(o.value[l].type==="compaction"){c=l;break}if(c>=a&&c!==-1)return{kind:"result",value:void 0};if(a===-1)throw new ln(`Checkpoint trigger ${n.triggerEntryId} is missing from its Branch`);let u=iL(o.value,r);if(!u.ok)throw u.error;return u.value===void 0||!bSe(u.value.tokensBefore,i.contextWindow,r)?{kind:"result",value:void 0}:{kind:"result",value:{taskId:t.session.idGenerator.next(),preparation:WSe(u.value)}}}async function oEn(t,e,n){if(n.generationContext.overflowRecoveryUsed)return;let r=await LSe(t,e,n);if(r.kind==="cancel_requested")return;let s=iL(r.value,n.settings.compaction);if(!s.ok)throw s.error;if(s.value!==void 0)return{taskId:t.session.idGenerator.next(),preparation:WSe(s.value)}}function aEn(t,e,n){return t.continueOperation(n,async(r,s,i,o)=>{if(s.targetId!==null&&!(await o.getEntries([s.targetId],e.context)).has(s.targetId))throw new ln(`Navigation target ${s.targetId} is missing`);if(s.targetId===i.sourceTipId)throw new ln("Navigation target must differ from its source tip");if(s.targetId===null&&s.label!==void 0)throw new ln("Root navigation cannot set a label");let a=[xr(Ro(t.name),s.targetId)];s.label!==void 0&&s.targetId!==null&&a.push(xr(_0(s.targetId),s.label));let c=await JE(o,e.operationId,s,e.context),u=XE(i,"completed",s.targetId);return{kind:"finish",writes:[...a,...c],record:u,lane:{tipId:s.targetId},materialize:()=>({kind:"settled",outcome:u}),events:()=>[{type:"navigation_end",lane:t.name,runId:e.operationId,status:"completed",fromTipId:i.sourceTipId,tipId:s.targetId,endedAt:u.endedAt}]}},e.context).then(r=>r.kind==="cancel_requested"?{kind:"continue"}:r.value)}p();p();async function cEn(t,e,n){let r=await t.continueOperation(n,async(c,u,l,d)=>{if(l.intent.kind!=="run")throw new ln("Run operation has non-run intent");let h=await d.getEntries(l.intent.promptEntryIds,e.context);return{kind:"return",result:l.intent.promptEntryIds.map(f=>{let g=h.get(f);if(g?.type!=="message")throw new ln(`Run prompt entry ${f} is missing its message`);return g.message})}},e.context);if(r.kind==="cancel_requested")return{kind:"continue"};let i=(await t.hooks.runWithGate("before_run",{lane:t.name,runId:e.operationId,prompt:r.value,resources:t.readConfig().resources},e.gate,e.context))?.messages??[];for(let c of i)if(c.role==="assistant"&&c.stopReason==="pending")throw new ln("before_run returned a pending assistant message");let o=i.map(c=>({id:t.session.idGenerator.next(),message:c})),a=await t.continueOperation(n,(c,u)=>{let l=$Z(c.tipId,o.map(({id:m,message:f})=>({id:m,type:"message",message:f}))),d=l.at(-1)?.id??c.tipId;if(d===null)throw new ln("Run start has no trigger entry");let h={...Hu(u),at:"checkpoint",continuation:{kind:"need_assistant",overflowRecoveryUsed:!1},triggerEntryId:d};return{kind:"commit",writes:[...l.map(m=>Sd(m)),...l.length===0?[]:[xr(Ro(t.name),d)]],operationState:h,lane:{tipId:d},materialize:()=>({kind:"continue"}),events:m=>tI(l,m,t.name,e.operationId)}},e.context);return a.kind==="cancel_requested"?{kind:"continue"}:a.value}async function lEn(t,e,n){let r=await iEn(t,e,n);if(r.kind==="cancel_requested")return{kind:"continue"};let s=await t.continueOperation(n,async(i,o,a,c)=>{let u=await GZ(t,e,i,o,c,i.tipId,r.value===void 0&&o.continuation.kind==="may_finish");if(u.triggerEntryId!==void 0)return{kind:"commit",writes:u.writes,operationState:aL(t,i,o,u.triggerEntryId,!1),lane:{tipId:u.tipId,inbox:u.inbox},materialize:()=>({kind:"continue"}),events:l=>ST(u,l,0,t.name,e.operationId)};if(r.value!==void 0){let l={...Hu(o),at:"summary.deciding",task:{taskId:r.value.taskId,reason:"threshold",boundary:{kind:"resume_checkpoint",resumeAfter:{continuation:o.continuation,triggerEntryId:o.triggerEntryId}}}};return{kind:"commit",writes:[...u.writes,xr(E0(e.operationId,r.value.taskId),r.value.preparation)],operationState:l,lane:{tipId:u.tipId,inbox:u.inbox},materialize:()=>({kind:"continue"}),events:d=>[...ST(u,d,0,t.name,e.operationId),{type:"compaction_start",lane:t.name,runId:e.operationId,reason:"threshold",startedAt:d.timestamp}]}}return o.continuation.kind==="need_assistant"?{kind:"commit",writes:u.writes,operationState:aL(t,i,o,o.triggerEntryId,o.continuation.overflowRecoveryUsed),lane:{tipId:u.tipId,inbox:u.inbox},materialize:()=>({kind:"continue"}),events:l=>ST(u,l,0,t.name,e.operationId)}:{kind:"return",result:{kind:"finish_pending",entryIds:u.entries.map(l=>l.id)}}},e.context);if(s.kind==="cancel_requested")return{kind:"continue"};if(s.value.kind!=="finish_pending")return s.value;if(n.continuation.kind!=="may_finish")throw new ln("Checkpoint finish mediation requires a finish continuation");return QSe(t,e,n,n.continuation,s.value.entryIds)}p();p();function Bms(t,e,n){let r=t.streamOptions;return{transport:r.transport,timeoutMs:r.timeoutMs,maxRetries:r.maxRetries,maxRetryDelayMs:r.maxRetryDelayMs,headers:r.headers,metadata:r.metadata,cacheRetention:r.cacheRetention,deferred:r.deferred,...t.thinkingLevel==="off"?{}:{reasoning:t.thinkingLevel},signal:n.abortSignal,telemetryContext:Qh(n),onPayload:t.beforePayload===void 0?void 0:(s,i)=>t.beforePayload?.(s,i,n),onResponse:s=>{e({status:s.status,headers:s.headers})}}}function Pms(t){return t.type!=="start"&&t.type!=="done"&&t.type!=="error"}async function BXe(t,e,n,r){let s=!1;for await(let a of t)if(a.type==="start"){if(s)throw new Error("Assistant message stream emitted more than one start event");s=!0,await e.start({...a.partial},a,r)}else if(Pms(a)){if(!s)throw new Error(`Assistant message stream emitted ${a.type} before start`);await e.update({...a.partial},a,r)}else if(a.type==="done"&&!s)throw new Error("Assistant message stream emitted done before start");let i=await t.result(),o=i;if(n!==void 0)try{o=await n(i,r)}catch(a){if(!(a instanceof Uh))throw a;await a.cancellation}return await e.end(o,r),o}async function uEn(t,e,n){let r={messages:t.slice(),systemPrompt:e.systemPrompt};e.transformContext&&(r=await e.transformContext(r,n));let s=await e.toProviderMessages(r.messages,n),i={systemPrompt:r.systemPrompt,messages:s,tools:e.tools},o={},a=await e.request(i,Bms(e,u=>{o=u},n),n),c=e.afterResponse;return BXe(a,e.observer,c===void 0?void 0:(u,l)=>c(u,o,l),n)}p();p();async function HZ(t,e,n,r){let s=[],i;for(;;){let o=await t.readList(eI(e,n),{order:"asc",limit:1e3,...i===void 0?{}:{cursor:i}},r);if(s.push(...o.map(({value:a})=>a)),o.length<1e3)return s;i={seq:o[o.length-1].seq}}}function dEn(t,e,n,r){let s=!1,i=Promise.resolve();return{write(o){if(s)return;let a=t.command(c=>r(c)?{kind:"commit",writes:[n(o)],next:c,materialize:()=>{}}:{kind:"return",result:void 0},e.context).then(()=>{});i=a,a.catch(()=>{})},seal(){s=!0},async drain(){await i}}}function pEn(t,e,n){let r=eI(e.operationId,n);return dEn(t,e,s=>PZ(r,s),s=>{let i=s.operation?.state;return i===void 0?!1:(i.at==="assistant.effect_pending"||i.at==="deferred.effect_pending")&&i.responseEntryId===n})}function hEn(t,e,n,r,s){let i=ET(e.operationId,s);return dEn(t,e,o=>xr(i,o),o=>{let a=o.operation;if(a?.state.at!=="tools")return!1;let c=a.state.batch;return c.turnId===n&&c.calls.some(u=>u.sourceIndex===r&&u.resultEntryId===s&&u.status==="effect_pending")})}function HSe(t,e,n,r=!1){let s=pEn(t,e,n),i=new S7,o={lane:t.name,runId:e.operationId,...r?{recovery:!0}:{}},a=async()=>{s.seal(),await s.drain()};return{observer:{start(c,u,l){let d=i.encode(u);return d!==void 0&&s.write(d),t.emitBatch([{type:"message_start",...o,message:c}],l)},update(c,u,l){let d=i.encode(u);return d!==void 0&&s.write(d),t.emitBatch([{type:"message_update",...o,message:c,event:u,...d===void 0?{}:{frame:d}}],l)},end(c,u){return t.emitBatch([{type:"message_end",...o,message:c,entryId:n}],u)}},async afterResponse(c,u,l){return await a(),(await t.hooks.runWithGate("after_response",{lane:t.name,runId:e.operationId,...u,message:c},e.gate,l))?.message??c},close:a}}async function VSe(t,e,n,r){let s=await t.continueOperation(n,async(i,o,a,c)=>{if(i.tipId===null)throw new ln("Failed run has no Branch tip");let u=XE(a,"failed",i.tipId,r);return{kind:"finish",writes:await JE(c,e.operationId,o,e.context),record:u,materialize:()=>({kind:"settled",outcome:u}),events:()=>[{type:"run_end",lane:t.name,runId:e.operationId,status:"failed",error:r,fromTipId:a.sourceTipId,tipId:i.tipId,endedAt:u.endedAt}]}},e.context);return s.kind==="cancel_requested"?{kind:"continue"}:s.value}function Oms(t){let e=Number.parseInt(t.slice(0,8)+t.slice(9,13),16);if(!Number.isSafeInteger(e))throw new ln(`Invalid reserved UUIDv7 ${t}`);return e}function qSe(t,e){return{code:"assistant_error",message:e.errorMessage??`${t==="assistant"?"Assistant":"Deferred"} request ended with ${e.stopReason}`}}function PXe(t,e){return{...t,stopReason:"error",errorMessage:e}}function Mms(t,e){return{...e,stopReason:"aborted",errorMessage:e.errorMessage??`${t==="assistant"?"Assistant":"Deferred"} request was cancelled`}}function Lms(t,e){let n=t.deferred,r=e.generationContext.configuration.model;return t.stopReason==="deferred"&&n!==void 0&&n.id.length!==0&&n.provider===r.provider&&n.modelId===r.modelId&&n.api===t.api}async function cL(t,e,n,r,s={}){let i=n.at==="assistant.effect_pending"&&(a3(r,n.contextWindow)||C7(r,n.intendedOutputLimit)),o=i&&!n.generationContext.overflowRecoveryUsed?await oEn(t,e,n):void 0;return t.settleOperation(n,async(a,c,u,l)=>{let d=c.at==="assistant.effect_pending"?"assistant":"deferred",h=n.responseEntryId,m=c.at==="assistant.effect_pending"?c.generationContext.configuration:c.configuration,f=c.at==="assistant.effect_pending"?c.generationContext.stepId:`${c.stepId}:poll:${c.poll}`,g={...Hu(c),latestAssistantEntryId:h},A=r,y,b;if(c.control.status==="cancel_requested")A=Mms(d,r),y={...g,at:"checkpoint",continuation:{kind:"may_finish",includeFinalAssistant:!0},triggerEntryId:h};else{if(r.stopReason==="aborted")throw new ln(`${d==="assistant"?"Assistant":"Deferred"} response is aborted while durable control is running`);if(c.at==="assistant.effect_pending"&&i)A=PXe(r,r.errorMessage??"Assistant request exceeded the context window"),c.generationContext.overflowRecoveryUsed||o===void 0?b=qSe(d,A):y={...g,at:"summary.deciding",task:{taskId:o.taskId,reason:"overflow",boundary:{kind:"resume_checkpoint",resumeAfter:{continuation:{kind:"need_assistant",overflowRecoveryUsed:!0},triggerEntryId:c.generationContext.triggerEntryId}}}};else if(r.stopReason==="deferred")c.at==="assistant.effect_pending"?Lms(r,c)?y={...g,at:"deferred.suspended",stepId:c.generationContext.stepId,sourceEntryId:h,poll:0,configuration:m,streamOptions:c.generationContext.streamOptions}:(A=PXe(r,"Provider returned an invalid deferred handle"),b=qSe(d,A)):y={...g,at:"deferred.suspended",stepId:c.stepId,sourceEntryId:h,poll:c.poll,configuration:m,streamOptions:c.streamOptions};else if(r.stopReason==="error")c.at==="assistant.effect_pending"&&(s.recovery===!0||z_(r))&&c.attemptG.type==="toolCall"?[{sourceIndex:$}]:[]);if(P.length!==0){let G=Oms(h),$=P.map(({sourceIndex:Q})=>({status:"planned",sourceIndex:Q,resultEntryId:t.session.idGenerator.next(G)}));y={...g,at:"tools",batch:{assistantEntryId:h,configuration:m,turnId:f,calls:$}}}else r.stopReason==="toolUse"?(A=PXe(r,"Provider reported tool use without any tool calls"),b=qSe(d,A)):y={...g,at:"checkpoint",continuation:{kind:"may_finish",includeFinalAssistant:!0},triggerEntryId:h}}}let S={id:h,parentId:a.tipId,type:"message",message:A},C={id:n.usageId,usage:A.usage,entryId:h,adjustment:!1};if(y===void 0&&b===void 0)throw new ln("Response settlement has no durable disposition");let I=b===void 0?void 0:XE(u,"failed",h,b),x=I===void 0?[]:await JE(l,e.operationId,c,e.context),w=[Sd(S),sy(C),xr(Ro(t.name),h),...I===void 0?[AT(eI(e.operationId,h))]:x,...y?.at==="summary.deciding"&&o!==void 0?[xr(E0(e.operationId,o.taskId),o.preparation)]:[]],R=P=>({...S,seq:P.seqs[0],timestamp:P.timestamp}),N=P=>{let G=R(P),$=[{type:"entry_added",lane:t.name,entry:G,...s},{type:"usage",lane:t.name,row:{...C,seq:P.seqs[1]},totals:P.stats.usage}];if(c.at==="assistant.effect_pending"){if(s.recovery!==!0&&c.attempt>1&&y?.at!=="assistant.retry_wait"){let Q=A.stopReason!=="error"&&A.stopReason!=="aborted";$.push({type:"retry_end",lane:t.name,runId:e.operationId,step:f,attempt:c.attempt,success:Q,...Q?{}:{finalError:A.errorMessage??`Assistant request ended with ${A.stopReason}`}})}s.recovery!==!0&&y?.at==="assistant.retry_wait"&&$.push({type:"retry_scheduled",lane:t.name,runId:e.operationId,step:f,attempt:y.nextAttempt,maxAttempts:y.generationContext.retryPolicy.maxAttempts,delayMs:S5(c.generationContext.retryPolicy.baseDelayMs,c.attempt),notBefore:y.notBefore,errorMessage:y.errorMessage}),s.recovery!==!0&&y?.at!=="tools"&&y?.at!=="assistant.retry_wait"&&$.push({type:"turn_end",lane:t.name,runId:e.operationId,turnId:f,message:A,toolResults:[]}),y?.at==="summary.deciding"&&$.push({type:"compaction_start",lane:t.name,runId:e.operationId,reason:"overflow",startedAt:P.timestamp})}else y?.at!=="tools"&&$.push({type:"turn_end",lane:t.name,runId:e.operationId,turnId:f,message:A,toolResults:[],...s});return(c.at==="deferred.effect_pending"||s.recovery!==!0)&&y?.at==="deferred.suspended"&&A.deferred!==void 0&&$.push({type:"run_suspend",lane:t.name,runId:e.operationId,reason:"deferred",deferred:A.deferred,poll:y.poll,...c.at==="deferred.effect_pending"?s:{}}),I!==void 0&&b!==void 0&&$.push({type:"run_end",lane:t.name,runId:e.operationId,status:"failed",error:b,fromTipId:u.sourceTipId,tipId:h,endedAt:I.endedAt}),$};if(I!==void 0)return{kind:"finish",writes:w,record:I,lane:{tipId:h},materialize:()=>({kind:"settled",outcome:I}),events:N};if(y===void 0)throw new ln("Response settlement is missing its next state");return{kind:"commit",writes:w,operationState:y,lane:{tipId:h},materialize:()=>({kind:"continue"}),events:N}},e.context)}function Fms(t){return{code:"model_unavailable",message:"The configured model is unavailable in this process",details:t}}async function OXe(t,e,n){let r=(await t.getEntries([e.sourceEntryId],n)).get(e.sourceEntryId);if(r?.type!=="message"||r.message.role!=="assistant"||r.message.stopReason!=="deferred"||r.message.deferred===void 0)throw new ln(`Deferred source ${e.sourceEntryId} is missing its assistant handle`);let s=r.message.deferred,i=e.configuration.model;if(s.id.length===0||s.provider!==i.provider||s.modelId!==i.modelId||s.api!==r.message.api)throw new ln(`Deferred source ${e.sourceEntryId} has an invalid handle`);return s}async function Qms(t,e,n){return t.continueOperation(n,async(r,s,i,o)=>({kind:"return",result:await OXe(o,n,e.context)}),e.context)}async function Ums(t,e,n){let r=await Qms(t,e,n);if(r.kind==="cancel_requested")return r;if(e.deferredPermits===0)return{kind:"waiting",source:r.value};let s=n.configuration.model,i=t.models.getModel(s.provider,s.modelId);if(i===void 0)return{kind:"configuration_failure"};let o={...n.streamOptions,deferred:!1},a=n.at==="deferred.suspended"?n.poll+1:n.poll,c=await t.hooks.runWithGate("before_request",{lane:t.name,runId:e.operationId,model:i,step:"deferred",attempt:a,streamOptions:o},e.gate,e.context);return{kind:"ready",source:r.value,model:i,poll:a,streamOptions:{...c?.streamOptions===void 0?o:oL(o,c.streamOptions),deferred:!1}}}async function $ms(t,e,n,r,s){let i=Date.now(),o={at:"deferred.effect_pending",stepId:n.stepId,sourceEntryId:n.sourceEntryId,poll:r.poll,responseEntryId:t.session.idGenerator.next(i),usageId:t.session.idGenerator.next(i),configuration:n.configuration,streamOptions:n.streamOptions};return t.continueOperation(n,(a,c)=>{let u={...Hu(c),...o};return{kind:"commit",writes:n.at==="deferred.effect_pending"?[AT(eI(e.operationId,n.responseEntryId))]:[],operationState:u,materialize:()=>(e.deferredPermits--,u),events:()=>[{type:"run_resume",lane:t.name,runId:e.operationId,...s?{recovery:!0}:{}},{type:"turn_start",lane:t.name,runId:e.operationId,turnId:`${o.stepId}:poll:${o.poll}`,...s?{recovery:!0}:{}}]}},e.context)}async function Gms(t,e,n,r,s){let i=HSe(t,e,r.responseEntryId,s),o={},a=ug(e.gate.signal,e.context),c=e.gate.admit(()=>t.models.streamDeferred(n.model,n.source,{wait:0,signal:a.abortSignal,telemetryContext:Qh(a),timeoutMs:n.streamOptions.timeoutMs,maxRetries:n.streamOptions.maxRetries,maxRetryDelayMs:n.streamOptions.maxRetryDelayMs,headers:n.streamOptions.headers,onPayload:async(u,l)=>(await t.hooks.runWithGate("before_payload",{lane:t.name,runId:e.operationId,model:l,payload:u},e.gate,e.context))?.payload,onResponse:u=>{o={status:u.status,headers:u.headers}}}));try{return await BXe(c,i.observer,(u,l)=>i.afterResponse(u,o,l),e.context)}finally{await i.close()}}async function mEn(t,e,n,r){let s=await Ums(t,e,n);if(s.kind==="cancel_requested")return{kind:"continue"};if(s.kind==="waiting")return{kind:"waiting",outcome:{kind:"waiting",operationId:e.operationId,reason:"deferred",deferred:s.source}};if(s.kind==="configuration_failure")return VSe(t,e,n,Fms(n.configuration.model));let i=await $ms(t,e,n,s,r);if(i.kind==="cancel_requested")return{kind:"continue"};let o=await Gms(t,e,s,i.value,r);return cL(t,e,i.value,o,r?{recovery:!0}:{})}function Wms(t,e,n){return mEn(t,e,n,!1)}function qms(t,e,n){return mEn(t,e,n,!0)}function fEn(t,e,n){return n.at==="deferred.suspended"?Wms(t,e,n):qms(t,e,n)}p();function gEn(t,e){return{code:t,message:t==="model_unavailable"?"The configured model is unavailable in this process":"One or more configured tools are unavailable in this process",details:e}}async function Hms(t,e){let n=t.readConfig();if(n.systemPrompt===void 0)return"";if(typeof n.systemPrompt=="string")return n.systemPrompt;let r=n.toolContext,s=typeof r=="function"?await r(e):r;return n.systemPrompt(s,e)}async function Vms(t,e,n){let r=n.generationContext.configuration.model,s=t.models.getModel(r.provider,r.modelId);if(s===void 0)return{kind:"configuration_failure",error:gEn("model_unavailable",r)};let i=t.readConfig(),o=new Map(i.tools.map(m=>[m.name,m])),a=n.generationContext.configuration.activeToolNames.filter(m=>!o.has(m));if(a.length!==0)return{kind:"configuration_failure",error:gEn("configured_tools_unavailable",{tools:a})};let c=n.generationContext.configuration.activeToolNames.map(m=>{let f=o.get(m);if(f===void 0)throw new ln(`Configured tool ${m} disappeared during resolution`);return{name:f.name,description:f.description,parameters:f.parameters,...f.constrainedSampling===void 0?{}:{constrainedSampling:f.constrainedSampling}}}),u=await FSe(t,e,n);if(u.kind==="cancel_requested")return u;let l=await Hms(t,e.context),d=await t.hooks.runWithGate("before_request",{lane:t.name,runId:e.operationId,model:s,step:"assistant",attempt:n.nextAttempt,streamOptions:n.generationContext.streamOptions},e.gate,e.context),h=d?.streamOptions===void 0?n.generationContext.streamOptions:oL(n.generationContext.streamOptions,d.streamOptions);return{kind:"ready",model:s,tools:c,messages:u.value,systemPrompt:l,streamOptions:h,toProviderMessages:i.toProviderMessages}}async function jms(t,e,n,r){let s=Date.now(),i={at:"assistant.effect_pending",generationContext:n.generationContext,attempt:n.nextAttempt,responseEntryId:t.session.idGenerator.next(s),usageId:t.session.idGenerator.next(s),intendedOutputLimit:r.model.maxTokens,contextWindow:r.model.contextWindow};return t.continueOperation(n,(o,a)=>{let c={...Hu(a),...i};return{kind:"commit",writes:[],operationState:c,materialize:()=>c,events:()=>n.nextAttempt===1?[{type:"turn_start",lane:t.name,runId:e.operationId,turnId:n.generationContext.stepId}]:[]}},e.context)}async function Yms(t,e,n,r){let s=HSe(t,e,n.responseEntryId);try{return await uEn(r.messages,{model:r.model,systemPrompt:r.systemPrompt,tools:r.tools,thinkingLevel:n.generationContext.configuration.thinkingLevel,streamOptions:r.streamOptions,transformContext:async(i,o)=>{let a=await t.hooks.runWithGate("transform_context",{lane:t.name,runId:e.operationId,...i},e.gate,o);return{messages:a?.messages??i.messages,systemPrompt:a?.systemPrompt??i.systemPrompt}},toProviderMessages:r.toProviderMessages,beforePayload:async(i,o,a)=>(await t.hooks.runWithGate("before_payload",{lane:t.name,runId:e.operationId,model:o,payload:i},e.gate,a))?.payload,afterResponse:s.afterResponse,request:(i,o,a)=>{let c=ug(e.gate.signal,a);return e.gate.admit(()=>t.models.streamSimple(r.model,i,{...o,sessionId:`${t.session.metadata.id}:${t.name}`,signal:c.abortSignal,telemetryContext:Qh(c)}))},observer:s.observer},e.context)}finally{await s.close()}}async function Kms(t,e,n){if(Date.now()$Se(n.notBefore,e.gate.signal))}let r=await t.continueOperation(n,(s,i)=>{let o={...Hu(i),at:"assistant.ready",generationContext:n.generationContext,nextAttempt:n.nextAttempt};return{kind:"commit",writes:[],operationState:o,materialize:()=>({kind:"continue"}),events:()=>[{type:"retry_start",lane:t.name,runId:e.operationId,step:n.generationContext.stepId,attempt:n.nextAttempt}]}},e.context);return r.kind==="cancel_requested"?{kind:"continue"}:r.value}async function AEn(t,e,n){if(n.at==="assistant.retry_wait")return Kms(t,e,n);let r=await Vms(t,e,n);if(r.kind==="configuration_failure")return VSe(t,e,n,r.error);if(r.kind==="cancel_requested")return{kind:"continue"};let s=await jms(t,e,n,r);if(s.kind==="cancel_requested")return{kind:"continue"};let i=await Yms(t,e,s.value,r);return cL(t,e,s.value,i)}p();p();var yEn={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}};function EEn(t,e){let n="Assistant request was interrupted. The preceding content is the latest committed partial; newer live output may be missing and the external outcome is unknown.";return e===void 0?{role:"assistant",content:[],api:"unknown",provider:t.provider,model:t.modelId,usage:yEn,stopReason:"error",errorMessage:n,timestamp:Date.now()}:{...e,usage:yEn,stopReason:"error",errorMessage:n}}async function bEn(t,e,n){let r=await t.continueOperation(n,async(i,o,a,c)=>({kind:"return",result:await HZ(c,e.operationId,n.responseEntryId,e.context)}),e.context);if(r.kind==="cancel_requested")return{kind:"continue"};let s=EEn(n.generationContext.configuration.model,o3(r.value));return await t.emitBatch([{type:"message_start",lane:t.name,runId:e.operationId,message:s,recovery:!0},{type:"message_end",lane:t.name,runId:e.operationId,message:s,entryId:n.responseEntryId,recovery:!0}],e.context),cL(t,e,n,s,{recovery:!0})}async function MXe(t,e,n){let r=await t.settleOperation(n,async(o,a,c,u)=>({kind:"return",result:await HZ(u,e.operationId,n.responseEntryId,e.context)}),e.context),s=n.at==="assistant.effect_pending"?n.generationContext.configuration.model:n.configuration.model,i=EEn(s,o3(r));return await t.emitBatch([{type:"message_start",lane:t.name,runId:e.operationId,message:i,recovery:!0},{type:"message_end",lane:t.name,runId:e.operationId,message:i,entryId:n.responseEntryId,recovery:!0}],e.context),cL(t,e,n,i,{recovery:!0})}p();p();async function SEn(t,e,n){return t.command(async(r,s)=>{let i=(await s.getEntries([n.assistantEntryId],e.context)).get(n.assistantEntryId);if(i?.type!=="message"||i.message.role!=="assistant")throw new ln("Tool batch assistant entry is invalid");let o=new Map;for(let a of n.calls){let c=i.message.content[a.sourceIndex];if(c?.type!=="toolCall")throw new ln(`Tool call source index ${a.sourceIndex} does not name a tool-call block`);o.set(a.sourceIndex,c)}return{kind:"return",result:{assistant:i.message,calls:o}}},e.context)}function _En(t){return typeof t=="object"&&t!==null&&"role"in t&&t.role==="toolResult"}function VZ(t,e){let n=t.calls.get(e.sourceIndex);if(n===void 0)throw new ln(`Tool call source index ${e.sourceIndex} is invalid`);return n}function jSe(t,e){return{...Hu(t),at:"tools",batch:e}}async function zms(t,e,n){return t.command(async(r,s)=>{let i=r.operation;if(i?.state.at!=="tools")return{kind:"return",result:void 0};let o=i.state.batch,a=o.calls.findIndex(d=>d.status!=="completed");if(a===-1)return{kind:"return",result:void 0};let c=[];for(;af.status==="completed").map(f=>f.resultEntryId),h=await s.getEntries(d,e.context),m=new Map(u.map(f=>[f.call.resultEntryId,f.message]));l=o.calls.map(f=>{let g=m.get(f.resultEntryId)??(()=>{let A=h.get(f.resultEntryId);return A?.type==="message"&&_En(A.message)?A.message:void 0})();if(g===void 0)throw new ln(`Completed tool call ${f.resultEntryId} is missing its result entry`);return g})}return{kind:"return",result:{items:u,...l===void 0?{}:{turnResults:l}}}},e.context)}async function Jms(t,e,n,r){let s=r.items.map(i=>i.message.usage===void 0?void 0:t.session.idGenerator.next());return t.settleOperation(n,async(i,o,a,c)=>{let u=o.batch,l=[],d=[],h=[],m=i.tipId;for(let[S,C]of r.items.entries()){let I={id:C.call.resultEntryId,parentId:m,type:"message",message:C.message,...C.call.terminate?{terminate:!0}:{}};d.push({entry:I,seqIndex:l.length}),l.push(Sd(I),fa(bc(C.call.resultEntryId)));let x=s[S];if(x!==void 0&&C.message.usage!==void 0){let w={id:x,usage:C.message.usage,entryId:C.call.resultEntryId,adjustment:!1};h.push({row:w,seqIndex:l.length}),l.push(sy(w))}m=C.call.resultEntryId}let f=u.calls.map(S=>{let C=r.items.find(I=>I.call.sourceIndex===S.sourceIndex&&I.call.resultEntryId===S.resultEntryId);return C===void 0?S:{status:"completed",sourceIndex:S.sourceIndex,resultEntryId:S.resultEntryId,terminate:C.call.terminate}}),g=f.every(S=>S.status==="completed"),A=i.configuration,y=[];for(let S of r.items)for(let C of S.message.addedToolNames??[])!A.activeToolNames.includes(C)&&!y.includes(C)&&y.push(C);y.length!==0&&(A={...A,activeToolNames:[...A.activeToolNames,...y]},l.push(xr(nh(t.name),A))),l.push(xr(Ro(t.name),m));let b;if(g){let S=f.every(x=>x.status==="completed"&&x.terminate);b={...Hu(o),at:"checkpoint",continuation:S?{kind:"may_finish",includeFinalAssistant:!1}:{kind:"need_assistant",overflowRecoveryUsed:!1},triggerEntryId:m};let I=await c.scanValues(OZ(e.operationId,n.batch.turnId),e.context);l.push(...I.map(({address:x})=>fa(x)))}else b=jSe(o,{...u,calls:f});return{kind:"commit",writes:l,operationState:b,lane:{tipId:m,configuration:A},materialize:()=>g,events:S=>{let C=[];for(let{entry:I,seqIndex:x}of d){C.push({type:"entry_added",lane:t.name,entry:{...I,seq:S.seqs[x],timestamp:S.timestamp}});let w=h.find(R=>R.row.entryId===I.id);w!==void 0&&C.push({type:"usage",lane:t.name,row:{...w.row,seq:S.seqs[w.seqIndex]},totals:S.stats.usage})}return y.length!==0&&C.push({type:"config_update",lane:t.name,property:"activeTools",previous:i.configuration.activeToolNames,value:A.activeToolNames}),C}}},e.context)}async function YSe(t,e,n,r,s){let i=await zms(t,e,r);if(i===void 0)return;await t.emitBatch(i.items.flatMap(({call:a,message:c})=>[{type:"message_start",lane:t.name,runId:e.operationId,message:c,...s?{recovery:!0}:{}},{type:"message_end",lane:t.name,runId:e.operationId,message:c,entryId:a.resultEntryId,...s?{recovery:!0}:{}}]),e.context),await Jms(t,e,n,i)&&i.turnResults!==void 0&&await t.emitBatch([{type:"turn_end",lane:t.name,runId:e.operationId,turnId:n.batch.turnId,message:r.assistant,toolResults:i.turnResults,...s?{recovery:!0}:{}}],e.context)}var Xms="[Tool execution was interrupted. The preceding output is the latest durable progress snapshot; newer live output may be missing, and the external outcome is unknown.]",LXe=class extends Error{constructor(){super("Tool invocation no longer owns its durable effect"),this.name="ToolInvocationEnded"}};function wEn(t){let e=t.state.operation;if(e?.state.at==="tools")return{run:e.state,batch:e.state.batch}}function Zms(t,e,n){return t.calls.find(r=>r.sourceIndex===e&&r.resultEntryId===n)}function TEn(t,e){return{...t,calls:t.calls.map(n=>n.sourceIndex===e.sourceIndex&&n.resultEntryId===e.resultEntryId?e:n)}}function CEn(t){if(t.length===0)throw new TypeError("Tool invocation memo name must not be empty");if(t.includes(":"))throw new TypeError("Tool invocation memo name must not contain ':'")}function efs(t,e,n,r){let s=!0,i=a=>{let c=a.operation;return c?.state.at!=="tools"?!1:Zms(c.state.batch,r.sourceIndex,r.resultEntryId)?.status==="effect_pending"},o=()=>new LXe;return{invocation:{invocationId:r.resultEntryId,operationId:e.operationId,turnId:n.turnId,getMemo(a){return CEn(a),s?t.command(async(c,u)=>i(c)?{kind:"return",result:(await u.getValue(RSe(e.operationId,r.resultEntryId,a),e.context))?.value}:{kind:"reject",error:o()},e.context):Promise.reject(o())},setMemo(a,c){return CEn(a),s?t.command(u=>{if(!i(u))return{kind:"reject",error:o()};let l=RSe(e.operationId,r.resultEntryId,a);return{kind:"commit",writes:[c===void 0?fa(l):xr(l,c)],next:u,materialize:()=>{}}},e.context):Promise.reject(o())}},expire(){s=!1}}}function FXe(t,e,n={}){return{role:"toolResult",toolCallId:t.id,toolName:t.name,content:e,...n.details===void 0?{}:{details:n.details},...n.usage===void 0?{}:{usage:n.usage},isError:!0,timestamp:Date.now()}}function KSe(t){return{toolCall:t,message:FXe(t,[{type:"text",text:"Tool execution was cancelled before completion."}]),terminate:!1}}function QXe(t,e){return{toolCall:t,message:FXe(t,[...e?.content??[],{type:"text",text:Xms}],e===void 0?{}:{details:e.details,usage:e.usage}),terminate:!1}}function tfs(t){return{toolCall:t,message:FXe(t,[{type:"text",text:`Tool call ${JSON.stringify(t.name)} was not executed because the assistant response hit the output token limit, so its arguments may be truncated. Re-issue the tool call with complete arguments.`}]),terminate:!1}}function IEn(t){return{toolCall:t.toolCall,message:_Xe(t),terminate:t.terminate}}async function nfs(t,e,n,r,s,i,o,a){return t.continueOperation(n,(c,u)=>{let l={status:"effect_pending",sourceIndex:r.sourceIndex,resultEntryId:r.resultEntryId,replay:o};return{kind:"commit",writes:[xr(y5(e.operationId,u.batch.turnId,r.sourceIndex),i)],operationState:jSe(u,TEn(u.batch,l)),materialize:()=>l,events:()=>[{type:"tool_start",lane:t.name,runId:e.operationId,turnId:u.batch.turnId,toolCallId:s.id,toolName:s.name,args:i,...a?{recovery:!0}:{}}]}},e.context)}async function lL(t,e,n,r,s,i){await t.settleOperation(n,async(o,a,c,u)=>{let{toolCall:l}=s,d=await u.scanValues(MZ(e.operationId,r.resultEntryId),e.context),h=a.control.status==="running"&&s.terminate,m={status:"outcome_ready",sourceIndex:r.sourceIndex,resultEntryId:r.resultEntryId,terminate:h};return{kind:"commit",writes:[xr(bc(r.resultEntryId),{type:"message",payload:s.message}),fa(ET(e.operationId,r.resultEntryId)),...d.map(({address:f})=>fa(f))],operationState:jSe(a,TEn(a.batch,m)),materialize:()=>{},events:()=>[...r.status==="planned"?[{type:"tool_start",lane:t.name,runId:e.operationId,turnId:a.batch.turnId,toolCallId:l.id,toolName:l.name,args:l.arguments,...i?{recovery:!0}:{}}]:[],{type:"tool_end",lane:t.name,runId:e.operationId,turnId:a.batch.turnId,toolCallId:l.id,toolName:l.name,result:NSe(s.message,h),isError:s.message.isError,terminate:h,...i?{recovery:!0}:{}}]}},e.context)}async function rfs(t,e,n,r,s){return t.command(async(i,o)=>{let a=await o.getValue(y5(e.operationId,n.turnId,r.sourceIndex),e.context);if(a===void 0)throw new ln(`Tool call ${r.resultEntryId} is missing persisted arguments`);return{kind:"commit",writes:[fa(ET(e.operationId,r.resultEntryId))],next:i,materialize:()=>a.value,events:()=>[{type:"tool_start",lane:t.name,runId:e.operationId,turnId:n.turnId,toolCallId:s.id,toolName:s.name,args:a.value,recovery:!0}]}},e.context)}function vEn(t,e,n){return t.command(async(r,s)=>({kind:"return",result:(await s.getValue(ET(e.operationId,n.resultEntryId),e.context))?.value}),e.context)}async function sfs(t,e){let n=t.readConfig().toolContext;return typeof n=="function"?await n(e.context):n}async function REn(t,e,n,r,s,i,o){let a=efs(t,e,n,r),c=hEn(t,e,n.turnId,r.sourceIndex,r.resultEntryId),u=Promise.resolve(),l=g=>{u=t.emitBatch([{type:"tool_update",lane:t.name,runId:e.operationId,turnId:n.turnId,toolCallId:s.toolCall.id,toolName:s.toolCall.name,partialResult:g,...o?{recovery:!0}:{}}],e.context),u.catch(()=>{})},d;try{d=xyn(s,e.gate,(g,A)=>{l(g),A?.checkpoint===!0&&c.write(g)},i,a.invocation,e.context)}catch(g){if(a.expire(),c.seal(),await c.drain(),!(g instanceof Uh))throw g;return await g.cancellation,o?QXe(s.toolCall,void 0):KSe(s.toolCall)}let h=await d.finally(()=>{a.expire(),c.seal()});await u,await c.drain();let m;try{m=await t.hooks.runToolWithGate("after_tool",{lane:t.name,runId:e.operationId,toolCallId:s.toolCall.id,toolName:s.toolCall.name,args:s.args,content:h.result.content,...h.result.details===void 0?{}:{details:h.result.details},isError:h.isError,...h.result.usage===void 0?{}:{usage:h.result.usage}},e.gate,e.context)}catch(g){if(!(g instanceof Uh))throw g;m=void 0}let f=wyn(s,h,m);return{toolCall:f.toolCall,message:_Xe(f),terminate:f.terminate}}async function ifs(t,e,n,r,s){let i=VZ(n,r);if(n.assistant.stopReason==="length")return{kind:"outcome",outcome:tfs(i)};let o=Cyn(i,s);if("kind"in o)return{kind:"outcome",outcome:IEn(o)};let a;try{a=await t.hooks.runToolWithGate("before_tool",{lane:t.name,runId:e.operationId,toolCallId:i.id,toolName:i.name,args:o.args},e.gate,e.context)}catch(u){if(!(u instanceof Uh))throw u;return await u.cancellation,{kind:"outcome",outcome:KSe(i)}}let c=Iyn(o,a);return"kind"in c?{kind:"outcome",outcome:IEn(c)}:{kind:"ready",cleared:c}}async function kEn(t,e,n,r,s,i,o,a){let c=await ifs(t,e,r,s,i);if(c.kind==="outcome")return{completion:lL(t,e,n,s,c.outcome,a)};let u=await nfs(t,e,n,s,c.cleared.toolCall,c.cleared.args,c.cleared.tool.replay??"never",a);return{completion:u.kind==="cancel_requested"?lL(t,e,n,s,KSe(c.cleared.toolCall),a):REn(t,e,n.batch,u.value,c.cleared,o,a).then(l=>lL(t,e,n,u.value,l,a))}}async function NEn(t,e,n,r,s,i,o,a){let c=VZ(r,s),u=i.get(c.name);if(!a&&s.replay==="safe"&&u?.replay==="safe"){let d=await rfs(t,e,n.batch,s,c),h={toolCall:c,tool:u,args:d};return{completion:REn(t,e,n.batch,s,h,o,!0).then(m=>lL(t,e,n,s,m,!0))}}let l=await vEn(t,e,s);return{completion:lL(t,e,n,s,QXe(c,l),!0)}}async function xEn(t,e,n,r,s,i){let{batch:o}=n;for(let a=0;a<=o.calls.length*2+1;a+=1){await YSe(t,e,n,r,i);let c=wEn(t);if(c===void 0)return{kind:"continue"};let u=c.batch.calls.find(d=>d.status!=="completed");if(u===void 0)throw new ln("Tool batch remained open after every call completed");if(u.status==="outcome_ready")throw new ln("Ready tool outcome was not materialized");if(c.run.control.status==="cancel_requested"){let d=VZ(r,u);if(u.status==="planned")await lL(t,e,c.run,u,KSe(d),i);else{let h=await vEn(t,e,u);await lL(t,e,c.run,u,QXe(d,h),i)}continue}if(s===void 0)throw new ln("Running tool batch is missing execution context");await(u.status==="planned"?await kEn(t,e,c.run,r,u,s.tools,s.toolContext,i):await NEn(t,e,c.run,r,u,s.toolsByName,s.toolContext,!1)).completion}throw new ln("Sequential tool batch exceeded its bounded transition count")}async function ofs(t,e,n,r,s,i,o,a){let{batch:c}=n,u=Promise.resolve(),l=()=>{let h=u.then(()=>YSe(t,e,n,r,a));return u=h.catch(()=>{}),h},d=[];for(let h of c.calls){if(h.status==="completed"||h.status==="outcome_ready")continue;let f=(h.status==="planned"?await kEn(t,e,n,r,h,s,o,a):await NEn(t,e,n,r,h,i,o,t.state.operation.state.control.status==="cancel_requested")).completion.then(async()=>{await l()});f.catch(()=>{}),d.push(f)}return await Promise.all(d),await l(),{kind:"continue"}}async function zSe(t,e,n){let r=n.batch,s=r.calls.some(h=>h.status==="effect_pending"||h.status==="outcome_ready");s&&await t.emitBatch([{type:"turn_start",lane:t.name,runId:e.operationId,turnId:r.turnId,recovery:!0}],e.context);let i=await SEn(t,e,r);await YSe(t,e,n,i,s);let o=wEn(t);if(o===void 0)return{kind:"continue"};if(o.run.control.status==="cancel_requested")return xEn(t,e,o.run,i,void 0,s);let a=t.readConfig(),c=new Set(r.configuration.activeToolNames),u=a.tools.filter(h=>c.has(h.name)),l=new Map(u.map(h=>[h.name,h])),d=await sfs(t,e);return n.settings.toolExecution==="sequential"?xEn(t,e,o.run,i,{tools:u,toolsByName:l,toolContext:d},s):ofs(t,e,o.run,i,u,l,d,s)}async function DEn(t,e,n,r){let s=n.configuration.model,i=t.models.getModel(s.provider,s.modelId);if(i!==void 0)try{await t.models.cancelDeferred(i,r,{signal:e.closeSignal,telemetryContext:Qh(e.context),timeoutMs:n.streamOptions.timeoutMs,maxRetries:n.streamOptions.maxRetries,maxRetryDelayMs:n.streamOptions.maxRetryDelayMs,headers:n.streamOptions.headers})}catch{}}async function BEn(t,e,n){return t.settleOperation(n,async(r,s,i,o)=>({kind:"return",result:await OXe(o,n,e.context)}),e.context)}async function PEn(t,e,n){return t.settleOperation(n,async(r,s,i,o)=>{if(s.control.status!=="cancel_requested")throw new ln("Cancellation reconciliation requires cancelled durable control");let a=XE(i,"aborted",r.tipId),c=await JE(o,e.operationId,s,e.context),u=[];if(i.intent.kind==="run"){switch(s.at){case"summary.deciding":case"summary.ready":case"summary.effect_pending":case"summary.retry_wait":if(s.task.boundary.kind!=="resume_checkpoint"||s.task.reason===void 0)throw new ln("Cancelled run summary has an invalid result boundary");u.push({type:"compaction_end",lane:t.name,runId:e.operationId,reason:s.task.reason,status:"aborted",endedAt:a.endedAt});break;default:break}u.push({type:"run_end",lane:t.name,runId:e.operationId,status:"aborted",fromTipId:i.sourceTipId,tipId:r.tipId,endedAt:a.endedAt})}else i.intent.kind==="compaction"?u.push({type:"compaction_end",lane:t.name,runId:e.operationId,reason:"manual",status:"aborted",endedAt:a.endedAt}):u.push({type:"navigation_end",lane:t.name,runId:e.operationId,status:"aborted",fromTipId:i.sourceTipId,tipId:r.tipId,endedAt:a.endedAt});return{kind:"finish",writes:c,record:a,materialize:()=>({kind:"settled",outcome:a}),events:()=>u}},e.context)}async function OEn(t,e){let n=t.state.operation;if(n===null||n.meta.operationId!==e.operationId)throw new ln(`Drive ${e.operationId} has no matching operation to reconcile`);if(n.state.control.status!=="cancel_requested")throw new ln(`Operation ${e.operationId} is not cancelled`);e.beginAbort(Promise.resolve()),e.signalAbort();let r=n.state;switch(r.at){case"assistant.effect_pending":return MXe(t,e,r);case"tools":return zSe(t,e,r);case"deferred.suspended":{let s=await BEn(t,e,r);return await DEn(t,e,r,s),PEn(t,e,r)}case"deferred.effect_pending":{let s=await BEn(t,e,r);return await DEn(t,e,r,s),MXe(t,e,r)}case"starting":case"checkpoint":case"assistant.ready":case"assistant.retry_wait":case"summary.deciding":case"summary.ready":case"summary.effect_pending":case"summary.retry_wait":case"navigation.ready_to_commit":return PEn(t,e,r)}}function UXe(t,e){let n=t.state.operation;if(n===null||n.meta.operationId!==e.operationId)throw new ln(`Drive ${e.operationId} has no matching current operation`);return n}async function MEn(t,e){let n=UXe(t,e);if(n.state.control.status==="running")try{await t.hooks.runWithGate("before_drive",{lane:t.name,runId:e.operationId,operation:n.meta.intent.kind},e.gate,e.context)}catch(r){if(!(r instanceof Uh))throw r;await r.cancellation}for(;;){n=UXe(t,e);let r=n.state,s;try{if(r.control.status==="cancel_requested")s=await OEn(t,e);else switch(r.at){case"starting":s=await cEn(t,e,r);break;case"checkpoint":s=await lEn(t,e,r);break;case"assistant.ready":case"assistant.retry_wait":s=await AEn(t,e,r);break;case"assistant.effect_pending":s=await bEn(t,e,r);break;case"tools":s=await zSe(t,e,r);break;case"deferred.suspended":case"deferred.effect_pending":s=await fEn(t,e,r);break;case"summary.deciding":s=await eEn(t,e,r);break;case"summary.ready":s=await nEn(t,e,r);break;case"summary.effect_pending":s=await sEn(t,e,r);break;case"summary.retry_wait":s=await rEn(t,e,r);break;case"navigation.ready_to_commit":s=await aEn(t,e,r);break}}catch(o){if(!(o instanceof Uh))throw o;await o.cancellation,s={kind:"continue"}}if(s.kind==="settled")return{kind:"settled",outcome:s.outcome};if(s.kind==="waiting")return s.outcome;let i=UXe(t,e).state;if(i===r&&i.control.status!=="cancel_requested")throw new ln(`Drive procedure made no progress from ${r.at}`)}}function afs(t){return t===null||typeof t!="object"&&typeof t!="function"?!1:"then"in t&&typeof t.then=="function"}function cfs(t,e){return t.filter(n=>n.kind===e)}function lfs(t,e){let n=new Set(e.map(r=>r.entryId));return t.filter(r=>!n.has(r.entryId))}function ufs(t,e,n){let r=!1,s=!1,i=[],o=[];for(let a of t)a.kind==="write"||a.kind==="nextRun"||a.kind==="steer"&&(e==="all"||!r)||a.kind==="followUp"&&(n==="all"||!s)?(i.push(a),a.kind==="steer"&&(r=!0),a.kind==="followUp"&&(s=!0)):o.push(a);return{selected:i,remainder:o}}function $Xe(t){return{compaction:t.compaction,steeringMode:t.steeringMode,followUpMode:t.followUpMode,toolExecution:t.toolExecution}}function rI(t,e,n=t.inbox,r=t.lastOperationId){return{currentOperationId:e,lastOperationId:r,inbox:n}}function GXe(t,e){return e.type==="message"?{id:t,parentId:null,type:"message",message:e.payload}:{id:t,parentId:null,type:"custom",customType:e.customType,...e.payload===void 0?{}:{data:e.payload}}}function dfs(t){let{state:e}=t;switch(e.at){case"assistant.ready":case"assistant.effect_pending":case"assistant.retry_wait":return e.generationContext.configuration.model;case"tools":return e.batch.configuration.model;case"deferred.suspended":case"deferred.effect_pending":return e.configuration.model;case"summary.ready":case"summary.effect_pending":case"summary.retry_wait":return e.summaryContext.configuration.model;default:return}}var JSe=class{name;session;models;hooks;emitBatch;onFault;installWatch;config;stateChange;resolveStateChange;idleOwner;activeDrive;state;closedError;constructor(e,n,r,s,i,o,a,c,u){this.session=n,this.models=r,this.hooks=s,this.name=e,this.state=i,this.onFault=o,this.emitBatch=a,this.installWatch=c,this.config=u;let l;this.stateChange=new Promise(d=>{l=d}),this.resolveStateChange=l}async getTipId(e){return this.assertOpen(),this.state.tipId}async getResult(e,n){return this.assertOpen(),(await this.session.getValue(A5(e),n))?.value}readConfig(){return this.config()}mismatch(e,n,r){return new l5({lane:this.name,expectedOperationId:e,...n===null?{}:{currentOperationId:n},...r===null?{}:{lastOperationId:r},message:`Operation ${e} does not own lane ${JSON.stringify(this.name)}`})}async readLane(e,n){this.assertOpen();try{return await this.session.mutate(async r=>{this.assertOpen();try{return await e(this.state,r)}catch(s){throw this.closedError!==void 0?this.closedError:this.onFault(s,n)}},n)}catch(r){throw this.closedError!==void 0?this.closedError:r}}async command(e,n){for(this.assertOpen();this.idleOwner!==void 0;)await hT(Promise.race([this.idleOwner,this.stateChange]),n),this.assertOpen();let r;try{r=await this.session.mutate(async s=>{if(this.assertOpen(),this.idleOwner!==void 0)return{kind:"idle_blocked",owner:this.idleOwner,change:this.stateChange};try{let i=await e(this.state,s);switch(i.kind){case"return":return{kind:"return",result:i.result};case"reject":return{kind:"reject",error:i.error};case"commit":{let o=await s.commit(i.writes,n);this.state=i.next,this.signalStateChange();let a=i.materialize(o);if(afs(a))throw new TypeError("Lane command materialize() must be synchronous");let c=i.events?.(o)??[],u=c.length===0?void 0:this.emitBatch(c,n);return{kind:"return",result:a,...u===void 0?{}:{delivery:u}}}}}catch(i){throw this.closedError!==void 0?this.closedError:this.onFault(i,n)}},n)}catch(s){throw this.closedError!==void 0?this.closedError:s}if(r.kind==="idle_blocked")return await hT(Promise.race([r.owner,r.change]),n),this.assertOpen(),this.command(e,n);if(r.kind==="reject")throw r.error;return await r.delivery,r.result}settleOperation(e,n,r){return this.command(async(s,i)=>{let o=s.operation,a=await n(s,o.state,o.meta,i);if(a.kind==="commit")return{kind:"commit",writes:[...a.writes,xr(y0(o.meta.operationId),a.operationState),...a.lane?.inbox===void 0?[]:[xr(pl(this.name),rI(s,o.meta.operationId,a.lane.inbox))]],next:{...s,...a.lane,operation:{meta:o.meta,state:a.operationState}},materialize:a.materialize,...a.events===void 0?{}:{events:a.events}};if(a.kind!=="finish")return a;let c=a.lane?.inbox??s.inbox;return{kind:"commit",writes:[...a.writes,xr(A5(o.meta.operationId),a.record),xr(pl(this.name),rI(s,null,c,o.meta.operationId))],next:{...s,...a.lane,inbox:c,lastOperationId:o.meta.operationId,operation:null},materialize:a.materialize,...a.events===void 0?{}:{events:a.events}}},r)}continueOperation(e,n,r){return this.settleOperation(e,async(s,i,o,a)=>{if(i.control.status==="cancel_requested")return{kind:"return",result:{kind:"cancel_requested"}};let c=await n(s,i,o,a);return c.kind==="return"?{kind:"return",result:{kind:"result",value:c.result}}:{...c,materialize:u=>({kind:"result",value:c.materialize(u)})}},r)}async accept(e,n){if(this.closedError instanceof ef)return Cr.err(new ry({message:this.closedError.message}));this.assertOpen();let r=Date.now(),s=e.operationId??this.session.idGenerator.next(r),i=this.readConfig();return e.kind==="compaction"?this.acceptCompaction(e,s,r,i,n):e.kind==="navigation"?this.acceptNavigation(e,s,r,i,n):this.acceptRun(e,s,r,i,n)}async acceptRun(e,n,r,s,i){let o;switch(e.kind){case"prompt":if(typeof e.prompt!="string")o=Array.isArray(e.prompt)?e.prompt:[e.prompt];else{let c=e.images??[];o=e.prompt.length===0&&c.length===0?[]:[{role:"user",content:[...e.prompt.length===0?[]:[{type:"text",text:e.prompt}],...c],timestamp:r}]}break;case"skill":{let c=s.resources.skills?.find(u=>u.name===e.name);if(c===void 0)return Cr.err(new p5({name:e.name,message:`Unknown skill: ${e.name}`}));o=[{role:"user",content:[{type:"text",text:kXe(c,e.additionalInstructions)}],timestamp:r}];break}case"prompt_template":{let c=s.resources.promptTemplates?.find(l=>l.name===e.name);if(c===void 0)return Cr.err(new h5({name:e.name,message:`Unknown prompt template: ${e.name}`}));let u=SXe(c,e.args);o=u.length===0?[]:[{role:"user",content:[{type:"text",text:u}],timestamp:r}];break}}for(let c of o)if(c.role==="assistant"&&c.stopReason==="pending")return Cr.err(new ZC({lane:this.name,reason:"pending_assistant",message:"Cannot accept a pending assistant message"}));let a=o.map(c=>({id:this.session.idGenerator.next(r),message:c}));return this.command(async(c,u)=>{if(c.operation!==null)return{kind:"return",result:Cr.err(new XN({lane:this.name,operationId:c.operation.meta.operationId,operationKind:c.operation.meta.intent.kind,message:`Lane ${JSON.stringify(this.name)} already has an active operation`}))};let{selected:l,remainder:d}=ufs(c.inbox,s.steeringMode,s.followUpMode),h=await Promise.all(l.map(async C=>{let I=await u.getValue(bc(C.entryId),i);if(I===void 0)throw new ln(`Pending ${C.kind} entry ${C.entryId} is missing its payload`);if(C.kind!=="write"&&I.value.type!=="message")throw new ln(`Pending ${C.kind} entry ${C.entryId} is not a message`);if(I.value.type==="message"&&I.value.payload.role==="assistant"&&I.value.payload.stopReason==="pending")throw new ln(`Pending ${C.kind} entry ${C.entryId} contains a pending assistant`);return{item:C,pending:I.value}})),m=l.some(C=>C.kind!=="write");if(a.length===0&&!m)return{kind:"return",result:Cr.err(new ZC({lane:this.name,reason:"empty",message:"Acceptance must append at least one message"}))};let f=$Z(c.tipId,[...h.map(({item:C,pending:I})=>GXe(C.entryId,I)),...a.map(({id:C,message:I})=>({id:C,parentId:null,type:"message",message:I}))]),g=f[f.length-1].id,A={operationId:n,lane:this.name,sourceTipId:c.tipId,startedAt:r,intent:{kind:"run",promptEntryIds:a.map(({id:C})=>C)}},y={at:"starting",control:{status:"running"},settings:$Xe(s),latestAssistantEntryId:null},b=await nI(u,d,i),S={...c,tipId:g,inbox:d,operation:{meta:A,state:y}};return{kind:"commit",writes:[...f.map(C=>Sd(C)),...l.map(C=>fa(bc(C.entryId))),xr(Ro(this.name),g),xr(yT(n),A),xr(y0(n),y),xr(pl(this.name),rI(c,n,d))],next:S,materialize:()=>Cr.ok({operationId:n,kind:"run",startedAt:r}),events:C=>{let I=[{type:"run_start",runId:n,startedAt:r,lane:this.name},...tI(f,C,this.name,n)];return l.length>0&&I.push({type:"queue_update",queues:b,lane:this.name}),I}}},i)}acceptCompaction(e,n,r,s,i){let o=this.session.idGenerator.next(r);return this.command(async(a,c)=>{if(a.operation!==null)return{kind:"return",result:Cr.err(new XN({lane:this.name,operationId:a.operation.meta.operationId,operationKind:a.operation.meta.intent.kind,message:`Lane ${JSON.stringify(this.name)} already has an active operation`}))};let u=a.tipId===null?[]:(await c.scanBranch({start:a.tipId,stopAtType:"compaction",order:"newestFirst"},i)).reverse(),l=iL(u,s.compaction);if(!l.ok)throw l.error;if(l.value===void 0)return{kind:"return",result:Cr.err(new d5({lane:this.name,message:`Lane ${JSON.stringify(this.name)} has nothing to compact`}))};let d={operationId:n,lane:this.name,sourceTipId:a.tipId,startedAt:r,intent:{kind:"compaction",...e.customInstructions===void 0?{}:{customInstructions:e.customInstructions}}},h={at:"summary.deciding",control:{status:"running"},settings:$Xe(s),latestAssistantEntryId:null,task:{taskId:o,reason:"manual",...e.customInstructions===void 0?{}:{customInstructions:e.customInstructions},boundary:{kind:"finish"}}};return{kind:"commit",writes:[xr(E0(n,o),WSe(l.value)),xr(yT(n),d),xr(y0(n),h),xr(pl(this.name),rI(a,n))],next:{...a,operation:{meta:d,state:h}},materialize:()=>Cr.ok({operationId:n,kind:"compaction",startedAt:r}),events:()=>[{type:"compaction_start",lane:this.name,runId:n,reason:"manual",startedAt:r}]}},i)}async acceptNavigation(e,n,r,s,i){let o=this.session.idGenerator.next(r),a=e.targetId,c=e.options??{},u=c.summarize??!1;for(;;){let l=this.state.tipId,d;if(u&&l!==null&&a!==null&&(await this.session.getEntries([a],i)).has(a)){let[f,g]=await Promise.all([this.session.scanBranch({start:l,order:"newestFirst"},i),this.session.scanBranch({start:a,order:"newestFirst"},i)]),A=new Set(f.map(b=>b.id)),y=g.find(b=>A.has(b.id))?.id??null;d=QZ(f.slice(0,y===null?f.length:f.findIndex(b=>b.id===y)).reverse())}let h=await this.command(async(m,f)=>{if(m.operation!==null)return{kind:"return",result:Cr.err(new XN({lane:this.name,operationId:m.operation.meta.operationId,operationKind:m.operation.meta.intent.kind,message:`Lane ${JSON.stringify(this.name)} already has an active operation`}))};if(m.tipId!==l)return{kind:"return",result:void 0};if(a===m.tipId)return{kind:"return",result:Cr.err(new ZN({lane:this.name,reason:"current_tip",message:"Navigation target must differ from the current tip"}))};if(a===null&&c.label!==void 0)return{kind:"return",result:Cr.err(new ZN({lane:this.name,reason:"root_label",message:"Root navigation cannot set a label"}))};if(u&&(m.tipId===null||a===null))return{kind:"return",result:Cr.err(new ZN({lane:this.name,reason:m.tipId===null?"source_root":"target_root",message:"Summarized navigation requires non-root source and target entries"}))};if(a!==null&&!(await f.getEntries([a],i)).has(a))return{kind:"return",result:Cr.err(new dT({targetId:a,message:`Unknown target: ${a}`}))};let g={kind:"navigation",targetId:a,summarize:u,...c.label===void 0?{}:{label:c.label},...c.customInstructions===void 0?{}:{customInstructions:c.customInstructions}},A={operationId:n,lane:this.name,sourceTipId:m.tipId,startedAt:r,intent:g},y={control:{status:"running"},settings:$Xe(s),latestAssistantEntryId:null},b,S=[];if(u){if(m.tipId===null||a===null||d===void 0)throw new ln("Validated summarized navigation is missing its preparation");S.push(xr(E0(n,o),Kyn(d))),b={...y,at:"summary.deciding",task:{taskId:o,...c.customInstructions===void 0?{}:{customInstructions:c.customInstructions},boundary:{kind:"commit_navigation",targetId:a,...c.label===void 0?{}:{label:c.label}}}}}else b={...y,at:"navigation.ready_to_commit",targetId:a,...c.label===void 0?{}:{label:c.label}};return S.push(xr(yT(n),A),xr(y0(n),b),xr(pl(this.name),rI(m,n))),{kind:"commit",writes:S,next:{...m,operation:{meta:A,state:b}},materialize:()=>Cr.ok({operationId:n,kind:"navigation",startedAt:r}),events:()=>[{type:"navigation_start",lane:this.name,runId:n,targetId:a,startedAt:r}]}},i);if(h!==void 0)return h}}async drive(e,n){if(this.closedError instanceof ef)return Cr.err(new ry({message:this.closedError.message}));for(this.assertOpen();;){let r=await this.command(async(s,i)=>{let o=n.abortSignal;if(o?.aborted){let c=o.reason;return{kind:"reject",error:c instanceof Error?c:new DOMException("The operation was aborted","AbortError")}}if(s.operation?.meta.operationId===e.operationId){if(this.activeDrive===void 0){let c=new dSe(e,n);return this.activeDrive=c,this.signalStateChange(),{kind:"return",result:{kind:"observe",drive:c,installed:!0}}}return{kind:"return",result:this.activeDrive.operationId===e.operationId?{kind:"observe",drive:this.activeDrive,installed:!1}:{kind:"occupied",drive:this.activeDrive}}}let a=await i.getValue(A5(e.operationId),n);return a===void 0?{kind:"return",result:{kind:"mismatch",error:this.mismatch(e.operationId,s.operation?.meta.operationId??null,s.lastOperationId)}}:{kind:"return",result:{kind:"settled",outcome:a.value}}},n);if(r.kind==="settled")return Cr.ok({kind:"settled",outcome:r.outcome});if(r.kind==="mismatch")return Cr.err(r.error);if(r.kind==="occupied"){await hT(r.drive.completion,n);continue}return r.installed&&MEn(this,r.drive).then(s=>{this.activeDrive===r.drive&&(this.activeDrive=void 0,this.signalStateChange()),r.drive.settle(s)},s=>{let i=this.closedError;if(i===void 0)try{i=this.onFault(s,r.drive.context)}catch(o){i=o}this.activeDrive===r.drive&&(this.activeDrive=void 0,this.signalStateChange()),r.drive.fail(i)}),Cr.ok(await hT(r.drive.completion,n))}}async requestOperationAbort(e,n){if(this.closedError instanceof ef)return Cr.err(new ry({message:this.closedError.message}));this.assertOpen();let r=this.activeDrive?.operationId===e?this.activeDrive:void 0,s,i,o=new Promise((u,l)=>{s=u,i=l});o.catch(()=>{}),r?.beginAbort(o);let a=!1,c=u=>{a||(a=!0,s(),u&&r?.signalAbort())};try{let u=await this.command(async(l,d)=>{let h=l.operation;if(h?.meta.operationId!==e)return{kind:"return",result:Cr.err(this.mismatch(e,h?.meta.operationId??null,l.lastOperationId))};if(h.state.control.status==="cancel_requested")return{kind:"return",result:Cr.ok({operationId:e,newlyRequested:!1,steer:[],followUp:[]})};let m=l.inbox.filter(I=>I.kind==="steer"||I.kind==="followUp"),f=await Promise.all(m.map(async I=>{let x=await d.getValue(bc(I.entryId),n);if(x?.value.type!=="message")throw new ln(`Pending ${I.kind} entry ${I.entryId} is missing its message`);return{item:I,message:x.value.payload}})),g=f.filter(({item:I})=>I.kind==="steer").map(({message:I})=>I),A=f.filter(({item:I})=>I.kind==="followUp").map(({message:I})=>I),y=new Set(m.map(I=>I.entryId)),b=l.inbox.filter(I=>!y.has(I.entryId)),S=await nI(d,b,n),C={...h.state,control:{status:"cancel_requested",requestedAt:Date.now()}};return{kind:"commit",writes:[...m.map(I=>fa(bc(I.entryId))),xr(y0(e),C),xr(pl(this.name),rI(l,e,b))],next:{...l,inbox:b,operation:{meta:h.meta,state:C}},materialize:()=>(c(!0),Cr.ok({operationId:e,newlyRequested:!0,steer:g,followUp:A})),events:()=>[{type:"operation_abort",operationId:e,steer:g,followUp:A,lane:this.name},...m.length===0?[]:[{type:"queue_update",queues:S,lane:this.name}]]}},n);return c(u.ok&&u.value.newlyRequested===!1),u}catch(u){throw a||i(u),u}}requestAbort(e,n){return this.requestOperationAbort(e,n)}inspectExecution(e){return this.readLane(n=>{let r=n.operation,s=r===null?void 0:dfs(r),i=r===null?null:{id:r.meta.operationId,kind:r.meta.intent.kind,status:r.state.control.status==="cancel_requested"?"aborting":"open",startedAt:r.meta.startedAt,...s===void 0?{}:{capturedModel:s}};return{lane:this.name,tipId:n.tipId,configuredModel:n.configuration.model,current:i,lastOperationId:n.lastOperationId}},e)}async prompt(...e){return e.length===3?this.driveRunRequest({kind:"prompt",prompt:e[0],...e[1]===void 0?{}:{images:e[1]}},e[2]):this.driveRunRequest({kind:"prompt",prompt:e[0]},e[1])}skill(e,n,r){return this.driveRunRequest({kind:"skill",name:e,...n===void 0?{}:{additionalInstructions:n}},r)}promptFromTemplate(e,n,r){return this.driveRunRequest({kind:"prompt_template",name:e,...n===void 0?{}:{args:n}},r)}async driveRunRequest(e,n){let r=await this.accept(e,n);if(!r.ok)switch(r.error._tag){case"LaneBusy":case"InvalidMessage":case"UnknownSkill":case"UnknownTemplate":case"Closed":return Cr.err(r.error);default:throw this.onFault(new ln(`Run acceptance returned ${r.error._tag}`),n)}let s=await this.drive({operationId:r.value.operationId,waitForRetry:!0},n);if(!s.ok){if(s.error._tag==="Closed")return Cr.err(s.error);throw this.onFault(new ln(`Accepted run ${r.value.operationId} no longer matches its lane`),n)}if(s.value.kind==="settled")return Cr.ok(s.value.outcome);if(s.value.reason==="deferred")return Cr.ok({operationId:r.value.operationId,status:"suspended",deferred:s.value.deferred});throw this.onFault(new ln(`Run ${r.value.operationId} returned an unwaited retry`),n)}async compact(e,n){let r=await this.accept({kind:"compaction",...e?.customInstructions===void 0?{}:{customInstructions:e.customInstructions}},n);if(!r.ok)switch(r.error._tag){case"LaneBusy":case"NothingToCompact":case"Closed":return Cr.err(r.error);default:throw this.onFault(new ln(`Compaction acceptance returned ${r.error._tag}`),n)}let s=await this.driveStructuralAdmission(r.value,n);if(!s.ok)return s;let i=await this.continueAfterStructural(s.value,n);return i.ok?Cr.ok({compaction:s.value,...i.value===void 0?{}:{run:i.value}}):i}async navigateTree(e,n,r){let s=await this.accept({kind:"navigation",targetId:e,...n===void 0?{}:{options:n}},r);if(!s.ok)switch(s.error._tag){case"LaneBusy":case"InvalidNavigation":case"UnknownTarget":case"Closed":return Cr.err(s.error);default:throw this.onFault(new ln(`Navigation acceptance returned ${s.error._tag}`),r)}let i=await this.driveStructuralAdmission(s.value,r);if(!i.ok)return i;let o=await this.continueAfterStructural(i.value,r);return o.ok?Cr.ok({navigation:i.value,...o.value===void 0?{}:{run:o.value}}):o}async driveStructuralAdmission(e,n){let r=await this.drive({operationId:e.operationId,waitForRetry:!0},n);if(!r.ok){if(r.error._tag==="Closed")return Cr.err(r.error);throw this.onFault(new ln(`Accepted ${e.kind} ${e.operationId} no longer matches its lane`),n)}if(r.value.kind==="settled")return Cr.ok(r.value.outcome);throw this.onFault(new ln(`${e.kind} ${e.operationId} returned ${r.value.reason}`),n)}async continueAfterStructural(e,n){if(e.status==="aborted")return Cr.ok(void 0);let r=await this.accept({kind:"prompt",prompt:""},n);if(!r.ok)switch(r.error._tag){case"InvalidMessage":case"LaneBusy":return Cr.ok(void 0);case"Closed":return Cr.err(r.error);default:throw this.onFault(new ln(`Structural continuation acceptance returned ${r.error._tag}`),n)}let s=await this.drive({operationId:r.value.operationId,waitForRetry:!0},n);if(!s.ok){if(s.error._tag==="Closed")return Cr.err(s.error);throw this.onFault(new ln(`Continuation run ${r.value.operationId} no longer matches its lane`),n)}if(s.value.kind==="settled")return Cr.ok(s.value.outcome);if(s.value.reason==="deferred")return Cr.ok({operationId:r.value.operationId,status:"suspended",deferred:s.value.deferred});throw this.onFault(new ln(`Continuation run ${r.value.operationId} returned an unwaited retry`),n)}async resume(e){if(this.closedError instanceof ef)return Cr.err(new ry({message:this.closedError.message}));this.assertOpen();let n=await this.command(s=>{let i=s.operation;return i===null?{kind:"return",result:Cr.err(new u5({lane:this.name,message:`Lane ${JSON.stringify(this.name)} has no active operation to resume`}))}:{kind:"return",result:Cr.ok({operationId:i.meta.operationId})}},e);if(!n.ok)return n;let r=await this.drive({operationId:n.value.operationId,pollDeferred:!0,waitForRetry:!0},e);if(!r.ok){if(r.error._tag==="Closed")return Cr.err(r.error);throw this.onFault(new ln(`Operation ${n.value.operationId} no longer matches its lane`),e)}if(r.value.kind==="settled")return Cr.ok(r.value.outcome);if(r.value.reason==="deferred")return Cr.ok({operationId:n.value.operationId,status:"suspended",deferred:r.value.deferred});throw this.onFault(new ln(`Operation ${n.value.operationId} returned an unwaited retry`),e)}async abort(e){if(this.closedError instanceof ef)return Cr.err(new ry({message:this.closedError.message}));this.assertOpen();let n=await this.command(i=>({kind:"return",result:i.operation?.meta.operationId}),e);if(n===void 0)return Cr.err(new tL({lane:this.name,message:`Lane ${JSON.stringify(this.name)} has no active operation`}));let r=await this.requestAbort(n,e);if(!r.ok)return r.error._tag==="Closed"?Cr.err(r.error):Cr.err(new tL({lane:this.name,message:`Lane ${JSON.stringify(this.name)} no longer has the inspected operation`}));let s=await this.drive({operationId:n},e);if(!s.ok&&s.error._tag==="Closed")return Cr.err(s.error);if(!s.ok)throw this.onFault(new ln(`Cancelled operation ${n} no longer matches its lane`),e);return Cr.ok({operationId:n,steer:r.value.steer,followUp:r.value.followUp})}steer(e,n,r){return this.enqueue("steer",e,n,r)}followUp(e,n,r){return this.enqueue("followUp",e,n,r)}nextRun(e,n,r){return this.enqueue("nextRun",e,n,r)}async enqueue(e,n,r,s){if(this.closedError instanceof ef)return Cr.err(new ry({message:this.closedError.message}));this.assertOpen();let i=Date.now(),o;if(typeof n=="string"){if(n.length===0&&(r===void 0||r.length===0))return Cr.err(new ZC({lane:this.name,reason:"empty",message:"Queued input must contain text or an image"}));o={role:"user",content:[...n.length===0?[]:[{type:"text",text:n}],...r??[]],timestamp:i}}else{if(n.role==="assistant"&&n.stopReason==="pending")return Cr.err(new ZC({lane:this.name,reason:"pending_assistant",message:"Cannot queue a pending assistant message"}));if(r!==void 0&&r.length>0&&n.role!=="user")return Cr.err(new ZC({lane:this.name,reason:"images_with_non_user",message:"Images can be added only to queued user messages"}));o=r===void 0||r.length===0||n.role!=="user"?structuredClone(n):{...structuredClone(n),content:[...typeof n.content=="string"?n.content.length===0?[]:[{type:"text",text:n.content}]:n.content,...r]}}let a=this.session.idGenerator.next(i);return this.command(async(c,u)=>{let l=[...c.inbox,{entryId:a,kind:e}],d=[...await nI(u,c.inbox,s),{entryId:a,kind:e,type:"message",message:o}];return{kind:"commit",writes:[xr(bc(a),{type:"message",payload:o}),xr(pl(this.name),rI(c,c.operation?.meta.operationId??null,l))],next:{...c,inbox:l},materialize:()=>Cr.ok({entryId:a}),events:()=>[{type:"queue_update",queues:d,lane:this.name}]}},s)}async cancelQueued(e,n){return this.closedError instanceof ef?Cr.err(new ry({message:this.closedError.message})):(this.assertOpen(),this.command(async(r,s)=>{let i=r.inbox.find(c=>c.entryId===e);if(i===void 0){let c=(await s.getEntries([e],n)).has(e);return{kind:"return",result:Cr.ok({kind:c?"already_consumed":"not_found"})}}if(await s.getValue(bc(e),n)===void 0)throw new ln(`Queued ${i.kind} entry ${e} is missing its payload`);let o=r.inbox.filter(c=>c.entryId!==e),a=await nI(s,o,n);return{kind:"commit",writes:[fa(bc(e)),xr(pl(this.name),rI(r,r.operation?.meta.operationId??null,o))],next:{...r,inbox:o},materialize:()=>Cr.ok({kind:"cancelled"}),events:()=>[{type:"queue_update",queues:a,lane:this.name}]}},n))}async recordUsage(e,n,r){return this.closedError instanceof ef?Cr.err(new ry({message:this.closedError.message})):(this.assertOpen(),this.command(s=>{let i=this.session.idGenerator.next(),o={id:i,usage:e,adjustment:!0,...n?.entryId===void 0?{}:{entryId:n.entryId},...n?.details===void 0?{}:{details:n.details}};return{kind:"commit",writes:[sy(o)],next:s,materialize:()=>Cr.ok({usageId:i}),events:a=>[{type:"usage",lane:this.name,row:{...o,seq:a.seqs[0]},totals:a.stats.usage}]}},r))}async waitForIdle(e){for(;;){let n=await this.command(r=>({kind:"return",result:r.operation===null&&this.activeDrive===void 0?{kind:"idle"}:{kind:"wait",drive:this.activeDrive,change:this.stateChange}}),e);if(n.kind==="idle")return;await hT(n.drive===void 0?n.change:n.drive.completion.then(()=>{}),e)}}async runWhenIdle(e,n){let r,s;for(;;){let i=await this.command(o=>{if(o.operation!==null||this.activeDrive!==void 0)return{kind:"return",result:{kind:"wait",drive:this.activeDrive,change:this.stateChange}};let a,c=new Promise(u=>{a=u});return r=c,s=a,this.idleOwner=c,this.signalStateChange(),{kind:"return",result:{kind:"claimed"}}},n);if(i.kind==="claimed")break;await hT(i.drive===void 0?i.change:i.drive.completion.then(()=>{}),n)}if(r===void 0||s===void 0)throw this.onFault(new ln("Idle callback claim was not published"),n);try{this.assertOpen(),await e(n)}finally{this.idleOwner===r&&(this.idleOwner=void 0),s(),this.signalStateChange()}}async getModel(e){return this.assertOpen(),this.models.getModel(this.state.configuration.model.provider,this.state.configuration.model.modelId)}setModel(e,n){return this.setConfiguration(r=>({...r,model:{...e}}),(r,s)=>({type:"config_update",property:"model",previous:r.model,value:s.model}),n)}async getThinkingLevel(e){return this.assertOpen(),this.state.configuration.thinkingLevel}setThinkingLevel(e,n){return this.setConfiguration(r=>({...r,thinkingLevel:e}),(r,s)=>({type:"config_update",property:"thinkingLevel",previous:r.thinkingLevel,value:s.thinkingLevel}),n)}async getActiveTools(e){return this.assertOpen(),this.state.configuration.activeToolNames}setActiveTools(e,n){return this.setConfiguration(r=>({...r,activeToolNames:e}),(r,s)=>({type:"config_update",property:"activeTools",previous:r.activeToolNames,value:s.activeToolNames}),n)}watch(e){return this.readLane(async(n,r)=>{let s=this.installWatch({},i=>i.type==="usage"||!("lane"in i)||i.lane===this.name,e,(i,o)=>this.readLane(async(a,c)=>{let u=await this.captureLaneSnapshot(a,c,i);return o(),u},i));try{return s.snapshot=await this.captureLaneSnapshot(n,r,e),s}catch(i){throw s.unsubscribe(),i}},e)}async captureLaneSnapshot(e,n,r){let s=structuredClone(e),i=s.tipId===null?[]:(await n.scanBranch({start:s.tipId,stopAtType:"compaction",order:"newestFirst"},r)).reverse(),o=await nI(n,s.inbox,r),a;if(s.lastOperationId!==null){let d=await n.getValue(A5(s.lastOperationId),r);if(d===void 0)throw new ln(`Lane ${JSON.stringify(this.name)} is missing result ${s.lastOperationId}`);a=d.value}let c=await n.getStats(r),u=s.operation,l=null;if(u!==null){let d=[],h,m,f,g=async y=>o3(await HZ(n,u.meta.operationId,y,r)),A=u.state;switch(A.at){case"assistant.retry_wait":m={attempt:A.nextAttempt,maxAttempts:A.generationContext.retryPolicy.maxAttempts,nextAttemptAt:A.notBefore};break;case"assistant.effect_pending":h=await g(A.responseEntryId);break;case"deferred.suspended":case"deferred.effect_pending":{let y=(await n.getEntries([A.sourceEntryId],r)).get(A.sourceEntryId);if(y?.type!=="message"||y.message.role!=="assistant"||y.message.deferred===void 0)throw new ln("Deferred source is missing its assistant handle");f={handle:y.message.deferred,poll:A.poll},A.at==="deferred.effect_pending"&&(h=await g(A.responseEntryId));break}case"tools":{let{batch:y}=A,b=(await n.getEntries([y.assistantEntryId],r)).get(y.assistantEntryId);if(b?.type!=="message"||b.message.role!=="assistant")throw new ln("Tool batch assistant entry is invalid");for(let S of y.calls){if(S.status==="planned"||S.status==="completed")continue;let C=b.message.content[S.sourceIndex];if(C?.type!=="toolCall")throw new ln(`Tool call source index ${S.sourceIndex} does not name a tool-call block`);let I=await n.getValue(y5(u.meta.operationId,y.turnId,S.sourceIndex),r);if(S.status==="effect_pending"){if(I===void 0)throw new ln(`Tool call ${C.id} is missing persisted arguments`);let w=await n.getValue(ET(u.meta.operationId,S.resultEntryId),r);d.push({status:"running",toolCallId:C.id,toolName:C.name,args:I.value,...w===void 0?{}:{result:w.value}});continue}let x=await n.getValue(bc(S.resultEntryId),r);if(x?.value.type!=="message"||x.value.payload.role!=="toolResult")throw new ln(`Tool call ${S.resultEntryId} is missing its staged result`);if(x.value.payload.toolCallId!==C.id||x.value.payload.toolName!==C.name)throw new ln(`Tool call ${S.resultEntryId} has a mismatched staged result`);d.push({status:"settled",toolCallId:C.id,toolName:C.name,args:I?.value??C.arguments,result:NSe(x.value.payload,S.terminate),isError:x.value.payload.isError})}break}case"summary.retry_wait":m={attempt:A.nextAttempt,maxAttempts:A.summaryContext.retryPolicy.maxAttempts,nextAttemptAt:A.notBefore};break;default:break}l={id:u.meta.operationId,kind:u.meta.intent.kind,startedAt:u.meta.startedAt,fromTipId:u.meta.sourceTipId,status:u.state.control.status==="cancel_requested"?"aborting":"open",...m===void 0?{}:{retry:m},...f===void 0?{}:{deferred:f},...h===void 0?{}:{streamingMessage:h},runningTools:d}}return structuredClone({lane:this.name,transcript:i,tipId:s.tipId,...a===void 0?{}:{lastResult:a},configuration:s.configuration,stats:c,operation:l,queues:o,faulted:this.closedError instanceof pT})}async setConfiguration(e,n,r){await this.command(s=>{let i=e(s.configuration);return{kind:"commit",writes:[xr(nh(this.name),i)],next:{...s,configuration:i},materialize:()=>{},events:()=>[{...n(s.configuration,i),lane:this.name}]}},r)}async findEntries(e,n){e??={},this.assertOpen();let r=e.start??this.state.tipId;return r===null?[]:this.session.scanBranch({...e,start:r,order:e.order??"newestFirst"},n)}async findEntry(e,n){return e??={},(await this.findEntries({...e,limit:e.limit===void 0?1:Math.min(e.limit,1)},n))[0]}appendMessage(e,n){return this.append({type:"message",payload:e},n)}appendCustomEntry(e,n,r){return this.append({type:"custom",customType:e,...n===void 0?{}:{payload:n}},r)}append(e,n){if(this.assertOpen(),e.type==="message"&&e.payload.role==="assistant"&&e.payload.stopReason==="pending")return Promise.reject(new nD);let r=this.session.idGenerator.next();return this.command(async(s,i)=>{if(s.operation===null){let u=cfs(s.inbox,"write"),l=await Promise.all(u.map(async f=>{let g=await i.getValue(bc(f.entryId),n);if(g===void 0)throw new ln(`Pending write ${f.entryId} is missing its payload`);return GXe(f.entryId,g.value)})),d=lfs(s.inbox,u),h=u.length===0?void 0:await nI(i,d,n),m=$Z(s.tipId,[...l,GXe(r,e)]);return{kind:"commit",writes:[...m.map(f=>Sd(f)),...u.map(f=>fa(bc(f.entryId))),xr(Ro(this.name),r),xr(pl(this.name),rI(s,null,d))],next:{...s,tipId:r,inbox:d},materialize:()=>r,events:f=>[...tI(m,f,this.name),...h===void 0?[]:[{type:"queue_update",queues:h,lane:this.name}]]}}let o=s.operation,a=[...s.inbox,{entryId:r,kind:"write"}],c=[...await nI(i,s.inbox,n),e.type==="message"?{entryId:r,kind:"write",type:"message",message:e.payload}:{entryId:r,kind:"write",type:"custom",customType:e.customType,...e.payload===void 0?{}:{data:e.payload}}];return{kind:"commit",writes:[xr(bc(r),e),xr(pl(this.name),rI(s,o.meta.operationId,a))],next:{...s,inbox:a},materialize:()=>r,events:()=>[{type:"queue_update",queues:c,lane:this.name}]}},n)}seal(e){return this.closedError??=e,this.activeDrive?.closeGate(e),this.signalStateChange(),this.idleOwner??Promise.resolve()}signalStateChange(){this.resolveStateChange();let e;this.stateChange=new Promise(n=>{e=n}),this.resolveStateChange=e}assertOpen(){if(this.closedError!==void 0)throw this.closedError}};p();function WXe(t){return t.at.startsWith("summary.")}function pfs(t,e){return t.kind==="compaction"?WXe(e)&&e.task.boundary.kind==="finish":t.kind==="navigation"?e.at==="navigation.ready_to_commit"?!t.summarize&&e.targetId===t.targetId&&e.label===t.label:t.summarize&&WXe(e)&&e.task.boundary.kind==="commit_navigation"&&e.task.boundary.targetId===t.targetId&&e.task.boundary.label===t.label&&e.task.customInstructions===t.customInstructions:e.at!=="navigation.ready_to_commit"&&(!WXe(e)||e.task.boundary.kind==="resume_checkpoint")}function LEn(t,e){let{tip:n,configuration:r,laneState:s}=e;if(n===void 0&&r===void 0&&s===void 0)return{kind:"absent"};if(n!==void 0&&r===void 0&&s===void 0)return{kind:"branch",tip:n};if(n===void 0)throw new ln(`Lane ${JSON.stringify(t)} is missing branch.tip`);if(r===void 0)throw new ln(`Lane ${JSON.stringify(t)} is missing lane.config`);if(s===void 0)throw new ln(`Lane ${JSON.stringify(t)} is missing lane.state`);return{kind:"lane",tip:n,configuration:r,laneState:s}}async function FEn(t,e,n){let[r,s,i]=await Promise.all([t.getValue(Ro(e),n),t.getValue(nh(e),n),t.getValue(pl(e),n)]);return LEn(e,{tip:r,configuration:s,laneState:i})}function QEn(t,e){return t.mutate(async n=>{let[r,s,i]=await Promise.all([n.scanValues(fXe(),e),n.scanValues(nh(""),e),n.scanValues(pl(""),e)]),o=new Map(r.map(d=>[d.address.key,d])),a=new Map(s.map(d=>[d.address.key,d])),c=new Map(i.map(d=>[d.address.key,d])),u=new Set([...o.keys(),...a.keys(),...c.keys()]),l=new Map;for(let d of u){let h=LEn(d,{tip:o.get(d),configuration:a.get(d),laneState:c.get(d)});h.kind==="lane"&&l.set(d,await qXe(n,d,h,e))}return l},e)}async function qXe(t,e,n,r){let s=n.laneState.value.currentOperationId,i=null;if(s!==null){let[o,a]=await Promise.all([t.getValue(yT(s),r),t.getValue(y0(s),r)]);if(o===void 0)throw new ln(`Operation ${s} is missing op.meta`);if(a===void 0)throw new ln(`Operation ${s} is missing op.state`);if(o.value.operationId!==s)throw new ln(`Operation ${s} metadata names operation ${JSON.stringify(o.value.operationId)}`);if(o.value.lane!==e)throw new ln(`Operation ${s} belongs to lane ${JSON.stringify(o.value.lane)}, not ${JSON.stringify(e)}`);if(!pfs(o.value.intent,a.value))throw new ln(`Operation ${s} intent ${o.value.intent.kind} does not match state ${a.value.at}`);i={meta:o.value,state:a.value}}return{tipId:n.tip.value,configuration:n.configuration.value,inbox:n.laneState.value.inbox,lastOperationId:n.laneState.value.lastOperationId,operation:i}}var HXe=class{session;models;hooks;events;lanesByName=new Map;seed;configStore;closePromise;closedError;faultError;constructor(e,n,r){this.session=e.session,this.models=e.models,this.seed=n,this.events=new SSe,this.hooks=new ISe((s,i,o,a)=>this.events.emit({type:"handler_error",kind:"hook",hook:i,error:s.message,...s.stack===void 0?{}:{stack:s.stack},lane:o},a)),this.configStore={value:{tools:e.tools??[],resources:e.resources??{},streamOptions:e.streamOptions??{},retryPolicy:e.retry??sXe,compaction:e.compaction??BZ,steeringMode:e.steeringMode??"all",followUpMode:e.followUpMode??"all",toolExecution:e.toolExecution??"parallel",toolContext:e.toolContext,systemPrompt:e.systemPrompt,toProviderMessages:e.toProviderMessages??(s=>eD(s)),entryProjectors:e.entryProjectors??{}}};for(let[s,i]of r)this.lanesByName.set(s,this.buildLane(s,i))}async lane(e,n,r){if(this.assertOpen(),e.length===0||e.includes("\0")){let c=e.length===0?"lane name must not be empty":"lane name must not contain \\u0000";throw new nL({lane:e,reason:c,message:`Invalid lane ${JSON.stringify(e)}: ${c}`})}let s=r===void 0?{}:n,i=r??n,o,a;try{await this.session.mutate(async c=>{if(this.assertOpen(),o=this.lanesByName.get(e),o!==void 0)return;let u=await FEn(c,e,i);if(u.kind==="lane"){let f=await qXe(c,e,u,i);o=this.buildLane(e,f),this.lanesByName.set(e,o);return}let l=u.kind==="branch"?u.tip.value:s.createAt??null;if(u.kind==="absent"&&l!==null&&!(await c.getEntries([l],i)).has(l))throw new dT({targetId:l,message:`Unknown target: ${l}`});let d={model:{...this.seed.model},thinkingLevel:this.seed.thinkingLevel,activeToolNames:[...this.seed.activeToolNames]},h={tipId:l,configuration:d,inbox:[],lastOperationId:null,operation:null},m=[...u.kind==="absent"?[xr(Ro(e),l)]:[],xr(nh(e),d),xr(pl(e),{currentOperationId:null,lastOperationId:null,inbox:[]})];await c.commit(m,i),o=this.buildLane(e,h),this.lanesByName.set(e,o),a=this.events.emitBatch([{type:"lane_created",lane:e,at:l}],i)},i)}catch(c){throw this.closedError!==void 0?this.closedError:c instanceof nL||c instanceof dT?c:this.fault(c,i)}if(await a,o===void 0)throw this.fault(new ln(`Lane ${JSON.stringify(e)} was not published`),i);return o}async lanes(e){return this.assertOpen(),(await Promise.all([...this.lanesByName.values()].map(r=>r.inspectExecution(e)))).map(r=>({name:r.lane,tipId:r.tipId,operation:r.current}))}getName(e){return this.assertOpen(),this.session.getName(e)}async setName(e,n){this.assertOpen();let r;try{await this.session.mutate(async s=>{this.assertOpen(),await s.commit([e===void 0?fa(b0):xr(b0,e)],n),r=this.events.emitBatch([{type:"value_update",value:"session_name",name:e}],n)},n)}catch(s){throw this.closedError!==void 0?this.closedError:this.fault(s,n)}await r}getLabel(e,n){return this.assertOpen(),this.session.getLabel(e,n)}async setLabel(e,n,r){this.assertOpen();let s;try{await this.session.mutate(async i=>{this.assertOpen();let o=_0(e);await i.commit([n===void 0?fa(o):xr(o,n)],r),s=this.events.emitBatch([{type:"value_update",value:"entry_label",targetId:e,label:n}],r)},r)}catch(i){throw this.closedError!==void 0?this.closedError:this.fault(i,r)}await s}getTools(e){return this.getConfig("tools",e)}setTools(e,n){return iXe(e),this.setConfig("tools",e,()=>({type:"config_update",property:"tools"}),n)}getResources(e){return this.getConfig("resources",e)}setResources(e,n){return this.setConfig("resources",e,()=>({type:"config_update",property:"resources"}),n)}getStreamOptions(e){return this.getConfig("streamOptions",e)}setStreamOptions(e,n){return this.setConfig("streamOptions",e,(r,s)=>({type:"config_update",property:"streamOptions",previous:r,value:s}),n)}getRetryPolicy(e){return this.getConfig("retryPolicy",e)}setRetryPolicy(e,n){return oXe(e),this.setConfig("retryPolicy",e,(r,s)=>({type:"config_update",property:"retryPolicy",previous:r,value:s}),n)}getCompactionSettings(e){return this.getConfig("compaction",e)}setCompactionSettings(e,n){return aXe(e),this.setConfig("compaction",e,(r,s)=>({type:"config_update",property:"compactionSettings",previous:r,value:s}),n)}getSteeringMode(e){return this.getConfig("steeringMode",e)}setSteeringMode(e,n){return this.setConfig("steeringMode",e,(r,s)=>({type:"config_update",property:"steeringMode",previous:r,value:s}),n)}getFollowUpMode(e){return this.getConfig("followUpMode",e)}setFollowUpMode(e,n){return this.setConfig("followUpMode",e,(r,s)=>({type:"config_update",property:"followUpMode",previous:r,value:s}),n)}async watchSession(e){throw new m5("watchSession")}fault(e,n){if(this.faultError!==void 0)return this.faultError;if(this.closedError!==void 0)return this.closedError;let r=e instanceof Error?e:new Error(String(e)),s=new pT("AgentHarness storage or invariant fault",r);this.faultError=s;for(let i of this.lanesByName.values())i.seal(s);return this.hooks.close(s),this.events.emit({type:"fault",code:"harness_fault",message:s.message},n),this.events.close(s),s}close(e){if(this.closePromise!==void 0)return this.closePromise;let n=new ef;this.closedError=n;let r=[...this.lanesByName.values()].map(i=>i.seal(n));this.hooks.close(n),this.events.close(n);let s=this.session.close(e);return this.closePromise=Promise.all([s,...r]).then(()=>{}),this.closePromise}buildLane(e,n){return new JSe(e,this.session,this.models,this.hooks,n,(r,s)=>this.fault(r,s),(r,s)=>this.events.emitBatch(r,s),(r,s,i,o)=>this.events.watch(r,s,i,o),()=>this.configStore.value)}async getConfig(e,n){return this.assertOpen(),this.configStore.value[e]}async setConfig(e,n,r,s){this.assertOpen();let i=this.configStore.value[e];this.configStore.value={...this.configStore.value,[e]:n},await this.events.emit(r(i,n),s)}assertOpen(){if(this.faultError!==void 0)throw this.faultError;if(this.closedError!==void 0)throw this.closedError}};async function UEn(t,e){let n=t.tools??[];iXe(n),oXe(t.retry??sXe),aXe(t.compaction??BZ);let r={model:{provider:t.model.provider,modelId:t.model.id},thinkingLevel:t.thinkingLevel??"off",activeToolNames:[...t.activeToolNames??n.map(s=>s.name)]};try{let s=await QEn(t.session,e),i=[...s].flatMap(([o,a])=>{let c=a.operation;return c===null?[]:[{lane:o,operationId:c.meta.operationId,kind:c.meta.intent.kind,startedAt:c.meta.startedAt,...c.state.control.status==="cancel_requested"?{aborting:!0}:{}}]});return{harness:new HXe(t,r,s),open:i}}catch(s){throw new pT("AgentHarness storage or invariant fault",s)}}var hfs={create:UEn};p();function mfs(t,e){let n=t.runningTools.findIndex(r=>r.toolCallId===e.toolCallId);n===-1?t.runningTools.push(e):t.runningTools[n]=e}function iy(t,e){return t.operation?.id===e?t.operation:void 0}function $En(t,e){if(!("lane"in e&&e.lane!==void 0&&e.lane!==t.lane&&e.type!=="usage"))switch(e.type){case"run_start":t.operation={id:e.runId,kind:"run",startedAt:e.startedAt,fromTipId:t.tipId,status:"open",runningTools:[]};return;case"compaction_start":if(t.operation!==null)return;t.operation={id:e.runId,kind:"compaction",startedAt:e.startedAt,fromTipId:t.tipId,status:"open",runningTools:[]};return;case"navigation_start":t.operation={id:e.runId,kind:"navigation",startedAt:e.startedAt,fromTipId:t.tipId,status:"open",runningTools:[]};return;case"operation_abort":{let n=iy(t,e.operationId);n!==void 0&&(n.status="aborting");return}case"run_resume":{let n=iy(t,e.runId);n!==void 0&&delete n.deferred;return}case"run_suspend":{let n=iy(t,e.runId);if(n===void 0)return;delete n.streamingMessage,n.deferred={handle:e.deferred,poll:e.poll};return}case"retry_scheduled":{let n=iy(t,e.runId);n!==void 0&&(n.retry={attempt:e.attempt,maxAttempts:e.maxAttempts,nextAttemptAt:e.notBefore});return}case"retry_start":case"retry_end":{let n=iy(t,e.runId);n!==void 0&&delete n.retry;return}case"message_start":{if(e.runId===void 0||e.message.role!=="assistant"||e.message.stopReason!=="pending")return;let n=iy(t,e.runId);n!==void 0&&(n.streamingMessage=e.message);return}case"message_update":{if(e.message.role!=="assistant")return;let n=iy(t,e.runId);n!==void 0&&(n.streamingMessage=e.message);return}case"message_end":{if(e.runId===void 0)return;let n=iy(t,e.runId);n!==void 0&&delete n.streamingMessage;return}case"tool_start":{let n=iy(t,e.runId);if(n===void 0)return;mfs(n,{status:"running",toolCallId:e.toolCallId,toolName:e.toolName,args:e.args});return}case"tool_update":{let r=iy(t,e.runId)?.runningTools.find(s=>s.toolCallId===e.toolCallId);r?.status==="running"&&(r.result=e.partialResult);return}case"tool_end":{let n=iy(t,e.runId);if(n===void 0)return;let r=n.runningTools.findIndex(i=>i.toolCallId===e.toolCallId),s=n.runningTools[r];if(s===void 0)return;n.runningTools[r]={status:"settled",toolCallId:e.toolCallId,toolName:e.toolName,args:s.args,result:e.result,isError:e.isError};return}case"entry_added":{if(e.entry.type==="message"&&e.entry.message.role==="toolResult"){let n=t.operation;if(n!==null){let r=e.entry.message.toolCallId,s=n.runningTools.findIndex(i=>i.toolCallId===r);s!==-1&&n.runningTools.splice(s,1)}}e.entry.type==="compaction"?t.transcript.splice(0,t.transcript.length,e.entry):t.transcript.push(e.entry),t.tipId=e.entry.id,e.entry.type==="message"&&(t.stats.messageCount+=1);return}case"queue_update":t.queues=e.queues;return;case"usage":t.stats.usage=e.totals;return;case"config_update":if(!("lane"in e)||e.lane!==t.lane)return;switch(e.property){case"model":t.configuration.model=e.value;return;case"thinkingLevel":t.configuration.thinkingLevel=e.value;return;case"activeTools":t.configuration.activeToolNames=e.value;return}return;case"run_end":{let n=iy(t,e.runId);if(n?.kind!=="run")return;let r={operationId:e.runId,kind:"run",status:e.status,...e.status==="failed"?{error:e.error}:{},fromTipId:e.fromTipId,tipId:e.tipId,startedAt:n.startedAt,endedAt:e.endedAt};t.lastResult=r,t.operation=null,t.tipId=e.tipId;return}case"compaction_end":{let n=iy(t,e.runId);if(n?.kind!=="compaction")return;let r={operationId:e.runId,kind:"compaction",status:e.status,...e.status==="failed"?{error:e.error}:{},fromTipId:n.fromTipId,tipId:t.tipId,startedAt:n.startedAt,endedAt:e.endedAt};t.lastResult=r,t.operation=null;return}case"navigation_end":return"rebase";case"fault":t.faulted=!0;return;case"handler_error":case"turn_start":case"turn_end":case"value_update":case"lane_created":return}}p();p();p();function XSe(t,e,n){switch(t.namespace){case"pi.session.name":return"copy";case"pi.entry.label":return n(t.key)?"copy":"exclude";case"pi.branch.tip":case"pi.lane.config":case"pi.lane.state":return"reconstruct";case"pi.result":return"exclude"}if(t.namespace.startsWith("pi.op.")||t.namespace.startsWith("pi.pending."))return"exclude";if(t.namespace==="pi"||t.namespace.startsWith("pi."))throw new Error(`Unknown reserved fork namespace: ${t.namespace}`);return e==="tree"?"copy":"exclude"}function ffs(t,e){return t.filter(n=>n.address.namespace===e.namespace)}function VXe(t,e){return t.find(n=>n.address.namespace===e.namespace&&n.address.key===e.key)}function I5(t,e){let n=new Map(t.entries.map(l=>[l.id,l])),r=ffs(t.scalarValues,Ro(""));Afs(t,n,r,e);let{entryIds:s,destinationTips:i}=gfs(n,r,e),o=new Map;for(let l of s)o.set(l,n.get(l));let a=[],c=Math.max(0,...[...o.values()].map(l=>l.seq))+1,u=(l,d)=>{a.push({address:dl(l.namespace,l.key),value:d,seq:c++})};for(let[l,d]of i){let h=VXe(t.scalarValues,nh(l));u(Ro(l),d),h!==void 0&&(u(nh(l),h.value),u(pl(l),{currentOperationId:null,lastOperationId:null,inbox:[]}))}for(let l of t.scalarValues)switch(XSe(l.address,e.scope,d=>s.has(d))){case"copy":u(l.address,l.value);break;case"exclude":case"reconstruct":break}return{entries:o,scalarValues:a,nextSeq:c}}function ZSe(t){let e=[];for(let n of t.entries.values())e.push({kind:"entry",...n});for(let n of t.scalarValues)e.push({kind:"value",op:"set",seq:n.seq,namespace:n.address.namespace,key:n.address.key,value:n.value});return e.sort((n,r)=>n.seq-r.seq)}function gfs(t,e,n){let r=new Set,s=new Map;if(n.scope==="tree"){for(let i of t.keys())r.add(i);for(let i of e)s.set(i.address.key,i.value)}else{let i=e.find(l=>l.address.key===n.branch);if(i===void 0)throw new Error(`Unknown source branch: ${n.branch}`);let o=n.entryId??i.value,a=o===null,c=null,u=i.value;for(;u!==null;){let l=t.get(u);if(l===void 0)throw new Error(`Corrupt source branch: missing parent ${u}`);l.id===o?(a=!0,c=n.position==="before"?l.parentId:l.id,n.position!=="before"&&r.add(l.id)):a&&r.add(l.id),u=l.parentId}if(!a)throw new Error(`Fork entry ${o} is not on source branch ${JSON.stringify(n.branch)}`);s.set(n.branch,c)}return{entryIds:r,destinationTips:s}}function Afs(t,e,n,r){let s=new Set(n.map(i=>i.address.key));for(let i of t.scalarValues)if((i.address.namespace===nh("").namespace||i.address.namespace===pl("").namespace)&&!s.has(i.address.key))throw new Error(`Source session branch ${JSON.stringify(i.address.key)} is missing branch.tip`);for(let i of n){let o=VXe(t.scalarValues,nh(i.address.key)),a=VXe(t.scalarValues,pl(i.address.key));if(o===void 0!=(a===void 0))throw new Error(`Source session branch ${JSON.stringify(i.address.key)} has incomplete lane state`);if(r.scope==="branch"&&i.address.key===r.branch&&o===void 0)throw new Error(`Source branch ${JSON.stringify(r.branch)} is not a configured AgentLane`);if((t.entriesComplete!==!1||r.scope==="tree")&&i.value!==null&&!e.has(i.value))throw new Error(`Source session branch ${JSON.stringify(i.address.key)} has an unknown tip`)}}p();p();$k();p();p();var sI=1;function GEn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function jXe(t,e){return Number.isSafeInteger(t)&&t>=e}function yfs(t){return GEn(t)&&t.type==="session"&&t.version===3&&typeof t.id=="string"&&typeof t.cwd=="string"&&typeof t.timestamp=="string"&&Number.isFinite(Date.parse(t.timestamp))&&(t.parentSession===void 0||typeof t.parentSession=="string")}function Efs(t){return GEn(t)&&t.kind==="header"&&t.v===4&&typeof t.id=="string"&&typeof t.cwd=="string"&&jXe(t.storageVersion,1)&&jXe(t.createdAt,0)&&(t.nextSeq===void 0||jXe(t.nextSeq,1))&&(t.parentSessionId===void 0||typeof t.parentSessionId=="string")&&(t.legacyParentSessionPath===void 0||typeof t.legacyParentSessionPath=="string")}function w5(t){let e;try{e=JSON.parse(t)}catch(n){return _d(new Error("Invalid JSONL session header: not valid JSON",{cause:n}))}return Efs(e)?bd({format:"v4",header:e}):yfs(e)?bd({format:"v3-legacy",header:e}):_d(new Error("Unsupported JSONL session header"))}p();$k();async function bfs(t,e,n){let r=await t.readTextLines(e,{maxLines:1},n);if(!r.ok||r.value[0]===void 0)return;let s=w5(r.value[0]);return s.ok?s.value.header.id:void 0}async function KXe(t,e,n){let r={id:e.id,createdAt:Date.parse(e.timestamp),storageVersion:1,cwd:e.cwd};if(e.parentSession!==void 0){let s=await bfs(t,e.parentSession,n);s!==void 0?r.parentSessionId=s:r.legacyParentSessionPath=e.parentSession}return r}async function WEn(t,e,n){return{v:4,kind:"header",...await KXe(t,e,n)}}function _fs(t,e){let n;try{n=JSON.parse(t)}catch(s){throw new Error(`Invalid legacy v3 JSONL record at line ${e}: not valid JSON`,{cause:s})}let r=n.type;if(r!=="message"&&r!=="custom"&&r!=="custom_message"&&r!=="branch_summary"&&r!=="compaction"&&r!=="model_change"&&r!=="thinking_level_change"&&r!=="active_tools_change"&&r!=="session_info"&&r!=="label")throw new Error(`Unsupported legacy v3 record type at line ${e}: ${String(r)}`);return n}function qEn(t){return{role:"custom",customType:t.customType,content:t.content,details:t.details,display:t.display,timestamp:Date.parse(t.timestamp)}}function Sfs(t){return t.type!=="model_change"&&t.type!=="thinking_level_change"&&t.type!=="active_tools_change"&&t.type!=="session_info"&&t.type!=="label"}var YXe=class{resolvedIds=new Map;entriesById;remintedIds;constructor(e,n){this.entriesById=e,this.remintedIds=n}resolve(e){let n=[],r=new Set,s=e,i=null;for(;s!==null;){let o=this.remintedIds.get(s);if(o!==void 0){i=o;break}if(this.resolvedIds.has(s)){i=this.resolvedIds.get(s)??null;break}if(r.has(s))throw new Error(`Cycle in legacy v3 parent chain at entry: ${s}`);r.add(s);let a=this.entriesById.get(s);if(a===void 0)throw new Error(`Missing legacy v3 entry reference: ${s}`);n.push(s),s=a.parentId}for(let o of n)this.resolvedIds.set(o,i);return i}};function Cfs(t,e){let n=t.resolve(e);if(n===null)throw new Error(`Legacy v3 entry reference has no retained ancestor: ${e}`);return n}function HEn(t,e){return e==="root"?null:t.resolve(e)}function Ifs(t,e){switch(t.type){case"message":return[t.message];case"custom_message":return[qEn(t)];case"branch_summary":return t.summary?[mT(t.summary,HEn(e,t.fromId),t.timestamp)]:[];case"compaction":return[fT(t.summary,t.tokensBefore,t.timestamp)];case"custom":case"model_change":case"thinking_level_change":case"active_tools_change":case"session_info":case"label":return[]}}function xfs(t,e,n){let r=[],s=new Set,i=t.parentId;for(;i!==null;){if(s.has(i))throw new Error(`Cycle in legacy v3 parent chain at entry: ${i}`);s.add(i);let o=e.get(i);if(o===void 0)throw new Error(`Missing legacy v3 parent entry: ${i}`);if(r.push(o),i===t.firstKeptEntryId)return r.reverse().flatMap(a=>Ifs(a,n));i=o.parentId}throw new Error(`Legacy v3 compaction ${t.id} firstKeptEntryId is not on its parent branch: ${t.firstKeptEntryId}`)}function wfs(t,e,n,r){let s={kind:"entry",id:Cfs(r,t.id),parentId:r.resolve(t.parentId),seq:e,timestamp:Date.parse(t.timestamp)};return t.type==="message"?{...s,type:"message",message:t.message}:t.type==="custom_message"?{...s,type:"message",message:qEn(t)}:t.type==="branch_summary"?{...s,type:"branch_summary",fromId:HEn(r,t.fromId),summary:t.summary,details:t.details,usage:t.usage,fromHook:t.fromHook??!1}:t.type==="compaction"?{...s,type:"compaction",summary:t.summary,retainedTail:xfs(t,n,r),tokensBefore:t.tokensBefore,details:t.details,usage:t.usage,fromHook:t.fromHook??!1}:{...s,type:"custom",customType:t.customType,data:t.data}}var Tfs=new Set(["off","minimal","low","medium","high","xhigh","max"]);function vfs(t,e){let n,r,s,i=!1,o=!1,a=!1,c=new Set,u=e;for(;u!==null&&(!i||!o||!a);){if(c.has(u))throw new Error(`Cycle in legacy v3 parent chain at entry: ${u}`);c.add(u);let l=t.get(u);if(l===void 0)throw new Error(`Missing legacy v3 entry reference: ${u}`);l.type==="model_change"&&!i?(i=!0,typeof l.provider=="string"&&l.provider.length!==0&&typeof l.modelId=="string"&&l.modelId.length!==0&&(n={provider:l.provider,modelId:l.modelId})):l.type==="thinking_level_change"&&!o?(o=!0,typeof l.thinkingLevel=="string"&&Tfs.has(l.thinkingLevel)&&(r=l.thinkingLevel)):l.type==="active_tools_change"&&!a&&(a=!0,Array.isArray(l.activeToolNames)&&l.activeToolNames.every(d=>typeof d=="string")&&(s=[...l.activeToolNames])),u=l.parentId}if(!(n===void 0||r===void 0))return{model:n,thinkingLevel:r,activeToolNames:s??[]}}function Rfs(t,e,n,r){let s=[],i;for(let l of t)l.type==="session_info"&&(i=l);i?.name&&s.push({kind:"value",op:"set",seq:r+s.length,namespace:b0.namespace,key:b0.key,value:i.name});let o=new Map;for(let l of t){if(l.type!=="label")continue;let d=n.resolve(l.targetId);d!==null&&(l.label?o.set(d,l.label):o.delete(d))}for(let[l,d]of o){let h=_0(l);s.push({kind:"value",op:"set",seq:r+s.length,namespace:h.namespace,key:h.key,value:d})}let a=t.at(-1),c=Ro("main");s.push({kind:"value",op:"set",seq:r+s.length,namespace:c.namespace,key:c.key,value:a===void 0?null:n.resolve(a.id)});let u=vfs(e,a?.id??null);if(u!==void 0){let l=nh("main");s.push({kind:"value",op:"set",seq:r+s.length,namespace:l.namespace,key:l.key,value:u});let d=pl("main");s.push({kind:"value",op:"set",seq:r+s.length,namespace:d.namespace,key:d.key,value:{currentOperationId:null,lastOperationId:null,inbox:[]}})}return s}function kfs(t){let e=mSe();for(let n of t){let r;n.type==="message"?(n.message.role==="assistant"||n.message.role==="toolResult")&&(r=n.message.usage):(n.type==="compaction"||n.type==="branch_summary")&&(r=n.usage),r!==void 0&&(e=g5(e,r))}return e}function VEn(t){let e=t.map((u,l)=>_fs(u,l+2)),n=new Map;for(let u of e){if(n.has(u.id))throw new Error(`Duplicate legacy v3 entry id: ${u.id}`);n.set(u.id,u)}let r=e.filter(Sfs),s=new Map(r.map(u=>[u.id,tl(Date.parse(u.timestamp))])),i=new YXe(n,s),o=r.map((u,l)=>wfs(u,l+1,n,i)),a=Rfs(e,n,i,o.length+1),c=[...o,...a];return{writes:c,importedUsage:kfs(e),nextSeq:c.length+1}}p();$k();p();function eCe(t,e){return`${t}\0${e}`}function Nfs(t,e){let n=Array.from(t,i=>i.codePointAt(0)),r=Array.from(e,i=>i.codePointAt(0)),s=Math.min(n.length,r.length);for(let i=0;ithis.entries.has(n)||this.usage.has(n),hasEntryId:n=>this.entries.has(n)})}applyValidated(e){for(let n of e){switch(n.kind){case"entry":{let{kind:r,...s}=n;this.entries.set(s.id,s),this.entriesBySeq.push(s),s.type==="message"&&(this.stats={...this.stats,messageCount:this.stats.messageCount+1});break}case"usage":{let{kind:r,...s}=n;this.usage.set(s.id,s),this.stats={...this.stats,usage:g5(this.stats.usage,s.usage)};break}case"value":{let r=eCe(n.namespace,n.key);n.op==="delete"?this.scalarValues.delete(r):this.scalarValues.set(r,{address:dl(n.namespace,n.key),value:n.value,seq:n.seq});break}case"list":{let r=eCe(n.namespace,n.key);if(n.op==="delete")this.listValues.delete(r);else{let s=this.listValues.get(r),i={seq:n.seq,value:n.value};s===void 0?this.listValues.set(r,{address:vSe(n.namespace,n.key),elements:[i]}):s.elements.push(i)}break}}this.nextSeq=n.seq+1}return this.stats}advanceNextSeq(e){if(!Number.isSafeInteger(e)||e<1)throw new Error(`Invalid storage sequence high-water mark: ${e}`);this.nextSeq=Math.max(this.nextSeq,e)}getEntries(e){let n=new Map;for(let r of e){let s=this.entries.get(r);s!==void 0&&n.set(r,s)}return n}getValue(e){return this.scalarValues.get(eCe(e.namespace,e.key))}scanValues(e){return[...this.scalarValues.values()].filter(n=>n.address.namespace===e.namespace&&n.address.key.startsWith(e.key)).sort((n,r)=>Nfs(n.address.key,r.address.key))}readList(e,n){let r=mXe(n),i=(this.listValues.get(eCe(e.namespace,e.key))?.elements??[]).filter(a=>r.cursor===void 0?!0:r.order==="asc"?a.seq>r.cursor.seq:a.seqe.type===void 0||a.type===e.type).filter(a=>e.customType===void 0||a.customType===e.customType).filter(a=>e.cursor===void 0||(e.order==="oldestFirst"?a.seq>e.cursor.seq:a.seq({id:n.id,parentId:n.parentId,seq:n.seq,timestamp:n.timestamp,type:n.type,...n.customType===void 0?{}:{customType:n.customType}}))}scanEntries(e){let n=e.limit===void 0?Number.POSITIVE_INFINITY:Math.max(0,Math.trunc(e.limit)),r=[],s=e.order==="desc",i=s?this.entriesBySeq.length-1:0;for(;i>=0&&i=e.fromSeq)&&(e.toSeq===void 0||o.seq<=e.toSeq)&&r.push(o),i+=s?-1:1}return r}scanUsage(e){let n=[...this.usage.values()].filter(r=>e.fromSeq===void 0||r.seq>=e.fromSeq).filter(r=>e.toSeq===void 0||r.seq<=e.toSeq).sort((r,s)=>e.order==="desc"?s.seq-r.seq:r.seq-s.seq);return e.limit===void 0?n:n.slice(0,Math.max(0,e.limit))}getStats(){return this.stats}snapshotEntriesAndValues(){return{entries:[...this.entries.values()].sort((e,n)=>e.seq-n.seq),scalarValues:[...this.scalarValues.values()]}}};function nCe(t,e){if(!t.ok)throw new Error(`${e}: ${t.error.message}`,{cause:t.error});return t.value}function Dfs(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function jEn(t,e,n){if(!Number.isSafeInteger(t)||t{p();sqn=Ot(yke(),1),oqn=Ot(Wve(),1);vb();nqn=64,rqn=1024,C3i=[".gitignore",".ignore",".fdignore"]});function Od(t){return{control:t.control,settings:t.settings,latestAssistantEntryId:t.latestAssistantEntryId}}var JD=v(()=>{p()});function use(t,e){return e.map(n=>{let r={...n,parentId:t};return t=n.id,r})}function Idt(t,e,n){let r=n===void 0?{}:{runId:n};return t.type==="message"?[{type:"message_start",lane:e,...r,message:t.message},{type:"message_end",lane:e,...r,message:t.message,entryId:t.id},{type:"entry_added",lane:e,entry:t}]:[{type:"entry_added",lane:e,entry:t}]}function bw(t,e,n,r,i=0){return t.flatMap((s,o)=>Idt(RHn(s,e.seqs[i+o],e.timestamp),n,r))}function bke(t,e,n){return t.continueOperation(n,async(r,i,s,o)=>{if(r.tipId===null)throw new un("Run operation has no Branch tip");return{kind:"return",result:(await o.scanBranch({start:r.tipId,stopAtType:"compaction",order:"newestFirst"},e.context)).reverse()}},e.context)}async function _ke(t,e,n){let r=await bke(t,e,n);return r.kind==="cancel_requested"?r:{kind:"result",value:await yHn(r.value,{entryProjectors:t.readConfig().entryProjectors},e.context)}}function _w(t,e,n){return Promise.all(e.map(async r=>{let i=await t.getValue(ll(r.entryId),n);if(i===void 0)throw new un(`Pending ${r.kind} entry ${r.entryId} is missing its payload`);if(i.value.type==="message")return{entryId:r.entryId,kind:r.kind,type:"message",message:i.value.payload};if(r.kind!=="write")throw new un(`Pending ${r.kind} entry ${r.entryId} is not a message`);return{entryId:r.entryId,kind:"write",type:"custom",customType:i.value.customType,...i.value.payload===void 0?{}:{data:i.value.payload}}}))}var yV=v(()=>{p();Rb();Uut();yp();Ap()});async function Bb(t,e,n,r){let[i,s,o,a]=await Promise.all([t.scanValues(sse(e),r),t.scanValues(ose(e),r),t.scanValues(adt(e),r),t.scanValues(cdt(e),r)]),c=new Set;if(n.at==="tools")for(let l of n.batch.calls)l.status==="outcome_ready"&&c.add(l.resultEntryId);let u;return(n.at==="assistant.effect_pending"||n.at==="deferred.effect_pending")&&(u=JR(Aw(e,n.responseEntryId))),[Ga(XR(e)),Ga(gS(e)),...i.map(({address:l})=>Ga(l)),...s.map(({address:l})=>Ga(l)),...o.map(({address:l})=>Ga(l)),...a.map(({address:l})=>Ga(l)),...u===void 0?[]:[u],...[...c].map(l=>Ga(ll(l)))]}function Nb(t,e,n,r){if(e==="failed"!=(r!==void 0))throw new un("Only a failed operation result may carry an error");return{operationId:t.operationId,kind:t.intent.kind,status:e,...r===void 0?{}:{error:r},fromTipId:t.sourceTipId,tipId:n,startedAt:t.startedAt,endedAt:Date.now()}}var dse=v(()=>{p();yp();Ap()});function wdt(t){let e=t.readConfig().retryPolicy;return{maxAttempts:e.enabled?e.maxRetries+1:1,baseDelayMs:e.baseDelayMs,maxAgentDelayMs:e.maxAgentDelayMs??KN}}function kQ(t,e,n,r,i){let s=t.readConfig();return{...n,at:"assistant.ready",generationContext:{stepId:t.session.idGenerator.next(),triggerEntryId:r,configuration:e.configuration,streamOptions:s.streamOptions,retryPolicy:wdt(t),overflowRecoveryUsed:i},nextAttempt:1}}async function pse(t,e,n,r,i,s,o){let a=n.inbox.filter(_=>_.kind==="steer"),c=r.settings.steeringMode==="all"?a:a.slice(0,1),u=n.inbox.filter(_=>_.kind==="write"||c.some(S=>S.entryId===_.entryId)),l=_=>Promise.all(_.map(async S=>{let C=await i.getValue(ll(S.entryId),e.context);if(C===void 0)throw new un(`Pending ${S.kind} entry ${S.entryId} is missing its payload`);if(S.kind!=="write"&&C.value.type!=="message")throw new un(`Queued ${S.kind} entry ${S.entryId} is not a message`);return{item:S,pending:C.value}})),d=await l(u),m=_=>_.type==="message"||t.readConfig().entryProjectors[_.customType]!==void 0;if(o&&!d.some(({pending:_})=>m(_))){let _=n.inbox.filter(C=>C.kind==="followUp"),S=r.settings.followUpMode==="all"?_:_.slice(0,1);u=[...u,...S].sort((C,I)=>n.inbox.indexOf(C)-n.inbox.indexOf(I)),d=await l(u)}let h=s,f,g=d.map(({item:_,pending:S})=>{let C=S.type==="message"?{id:_.entryId,parentId:h,type:"message",message:S.payload}:{id:_.entryId,parentId:h,type:"custom",customType:S.customType,...S.payload===void 0?{}:{data:S.payload}};return h=_.entryId,m(S)&&(f=_.entryId),C}),A=new Set(u.map(_=>_.entryId)),y=n.inbox.filter(_=>!A.has(_.entryId)),E=u.length===0?void 0:await _w(i,y,e.context);return{entries:g,writes:[...g.map(_=>gp(_)),...u.map(_=>Ga(ll(_.entryId))),...g.length===0?[]:[fr(Mo(t.name),h)]],tipId:h,inbox:y,...f===void 0?{}:{triggerEntryId:f},...E===void 0?{}:{queues:E}}}function nk(t,e,n,r,i){return[...bw(t.entries,e,r,i,n),...t.queues===void 0?[]:[{type:"queue_update",lane:r,queues:t.queues}]]}async function xke(t,e,n,r,i,s=[]){let o=await _ke(t,e,n);if(o.kind==="cancel_requested")return{kind:"continue"};let a=await t.hooks.runWithGate("before_run_end",{lane:t.name,runId:e.operationId,messages:o.value},e.gate,e.context),c=a?.followUp===void 0?void 0:{id:t.session.idGenerator.next(),message:{role:"user",content:a.followUp,timestamp:Date.now()}},u=await t.continueOperation(n,async(l,d,m,h)=>{let f=await pse(t,e,l,d,h,l.tipId,!0);if(f.triggerEntryId!==void 0)return{kind:"commit",writes:f.writes,operationState:kQ(t,l,d,f.triggerEntryId,!1),lane:{tipId:f.tipId,inbox:f.inbox},materialize:()=>({kind:"continue"}),events:E=>[...s,...nk(f,E,0,t.name,e.operationId)]};if(f.entries.length===i.length&&f.entries.every((E,_)=>E.id===i[_])&&c!==void 0){let E={id:c.id,parentId:f.tipId,type:"message",message:c.message},_=f.writes.length;return{kind:"commit",writes:[...f.writes,gp(E),fr(Mo(t.name),c.id)],operationState:kQ(t,l,d,c.id,!1),lane:{tipId:c.id,inbox:f.inbox},materialize:()=>({kind:"continue"}),events:S=>[...s,...nk(f,S,0,t.name,e.operationId),...Idt({...E,seq:S.seqs[_],timestamp:S.timestamp},t.name,e.operationId)]}}if(f.tipId===null)throw new un("Completed run has no tip");if(r.includeFinalAssistant&&d.latestAssistantEntryId===null)throw new un("Completed run is missing its final assistant");let A=Nb(m,"completed",f.tipId),y=await Bb(h,e.operationId,d,e.context);return{kind:"finish",writes:[...f.writes,...y],record:A,lane:{tipId:f.tipId,inbox:f.inbox},materialize:()=>({kind:"settled",outcome:A}),events:E=>[...s,...nk(f,E,0,t.name,e.operationId),{type:"run_end",lane:t.name,runId:e.operationId,status:"completed",fromTipId:m.sourceTipId,tipId:f.tipId,endedAt:A.endedAt}]}},e.context);return u.kind==="cancel_requested"?{kind:"continue"}:u.value}var Tdt=v(()=>{p();qo();Rb();yp();Ap();yV();dse()});function Ske(t,e,n=Date.now()){let r=n+Wx(t,e);return Number.isSafeInteger(r)?r:Number.MAX_SAFE_INTEGER}function Cke(t,e){return new Promise((n,r)=>{let i,s=()=>{i!==void 0&&clearTimeout(i),e.removeEventListener("abort",o)},o=()=>{s(),r(e.reason)},a=()=>{let c=t-Date.now();if(c<=0){s(),n();return}i=setTimeout(a,Math.min(c,2147483647))};e.addEventListener("abort",o,{once:!0}),e.aborted?o():a()})}var Ike=v(()=>{p();qo()});function uqn(t){return{read:[...t.read],written:[...t.written],edited:[...t.edited]}}function Tke(t){return{kind:"compaction",messagesToSummarize:t.messagesToSummarize,turnPrefixMessages:t.turnPrefixMessages,retainedTail:t.retainedTail,isSplitTurn:t.isSplitTurn,tokensBefore:t.tokensBefore,...t.previousSummary===void 0?{}:{previousSummary:t.previousSummary},fileOps:uqn(t.fileOps),settings:t.settings}}function dqn(t){return{kind:"branch_summary",messages:t.messages,fileOps:uqn(t.fileOps),totalTokens:t.totalTokens}}function pqn(t){return{read:new Set(t.read),written:new Set(t.written),edited:new Set(t.edited)}}function mqn(t){return{messagesToSummarize:t.messagesToSummarize,turnPrefixMessages:t.turnPrefixMessages,retainedTail:t.retainedTail,isSplitTurn:t.isSplitTurn,tokensBefore:t.tokensBefore,...t.previousSummary===void 0?{}:{previousSummary:t.previousSummary},fileOps:pqn(t.fileOps),settings:t.settings}}function hqn(t){return{messages:t.messages,fileOps:pqn(t.fileOps),totalTokens:t.totalTokens}}function mse(t){return t.boundary.kind==="commit_navigation"?"branch_summary":"compaction"}function wke(t){if(t.reason!==void 0)return t.reason;if(t.boundary.kind==="finish")return"manual";throw new un(`In-run compaction task ${t.taskId} is missing its reason`)}function N3i(t){if(t.boundary.kind!=="commit_navigation")throw new un(`Summary task ${t.taskId} is not a navigation`);return t.boundary}async function D3i(t,e,n){return t.continueOperation(n,async(r,i,s,o)=>{let a=mse(i.task),c=await o.getValue(AS(e.operationId,i.task.taskId),e.context);if(c?.value.kind!==a)throw new un(`Structural task ${i.task.taskId} is missing its ${a} preparation`);if(i.task.boundary.kind==="commit_navigation"){let u=i.task.boundary.targetId;if(!(await o.getEntries([u],e.context)).has(u))throw new un(`Navigation target ${u} is missing`)}return{kind:"return",result:c.value.kind==="compaction"?mqn(c.value):hqn(c.value)}},e.context)}function P3i(t,e,n){return{resultEntryId:e,configuration:n,streamOptions:{...t.readConfig().streamOptions,deferred:!1},retryPolicy:wdt(t)}}function fqn(t,e,n,r){return{type:"usage",lane:r,row:{...t,seq:n.seqs[e]},totals:n.stats.usage}}function hse(t,e,n){return{code:t,message:e,...n===void 0?{}:{details:n}}}async function rk(t,e,n,r){let i=(r.kind==="compaction"||r.kind==="branch_summary")&&r.fromHook&&r.result.usage!==void 0?t.session.idGenerator.next():void 0,s=await t.continueOperation(n,async(a,c,u,l)=>{let d=mse(c.task),m;if((r.kind==="compaction"||r.kind==="branch_summary")&&r.kind!==d)throw new un(`Structural ${r.kind} result does not match ${d} task ${c.task.taskId}`);let h=[],f=[],g=a.tipId;if(i!==void 0&&(r.kind==="compaction"||r.kind==="branch_summary")){let E=r.result.usage;if(E===void 0)throw new un("Hook usage id exists without structural usage");let _={id:i,usage:E,adjustment:!1},S=h.length;h.push(vE(_)),f.push(C=>[fqn(_,S,C,t.name)])}if(r.kind==="compaction"){let E={id:r.resultEntryId,parentId:a.tipId,type:"compaction",summary:r.result.summary,retainedTail:r.result.retainedTail,tokensBefore:r.result.tokensBefore,...r.result.details===void 0?{}:{details:r.result.details},...r.result.usage===void 0?{}:{usage:r.result.usage},fromHook:r.fromHook},_=h.length;h.push(gp(E),fr(Mo(t.name),r.resultEntryId)),g=r.resultEntryId,f.push(S=>bw([E],S,t.name,e.operationId,_))}else if(r.kind==="branch_summary"){let E=N3i(c.task),_={id:r.resultEntryId,parentId:E.targetId,type:"branch_summary",fromId:u.sourceTipId,summary:r.result.summary,details:{readFiles:r.result.readFiles,modifiedFiles:r.result.modifiedFiles},...r.result.usage===void 0?{}:{usage:r.result.usage},fromHook:r.fromHook};h.push(fr(Mo(t.name),E.targetId));let S=h.length;h.push(gp(_),fr(Mo(t.name),r.resultEntryId)),E.label!==void 0&&h.push(fr(yS(E.targetId),E.label)),g=r.resultEntryId,f.push(C=>bw([_],C,t.name,e.operationId,S))}let A=c.at==="summary.ready"?c.nextAttempt:c.at==="summary.effect_pending"?c.attempt:void 0;A!==void 0&&A>1&&f.push(()=>[{type:"retry_end",lane:t.name,runId:e.operationId,step:c.task.taskId,attempt:A,success:r.kind==="compaction"||r.kind==="branch_summary",...r.kind==="failed"?{finalError:r.error.message}:{}}]),r.kind==="compaction"&&f.push(E=>[{type:"compaction_end",lane:t.name,runId:e.operationId,reason:wke(c.task),status:"completed",entryId:r.resultEntryId,endedAt:m??E.timestamp}]);let y=E=>f.flatMap(_=>_(E));switch(c.task.boundary.kind){case"resume_checkpoint":{if(r.kind==="branch_summary")throw new un("Run compaction boundary received a branch summary");if(r.kind==="compaction"||r.kind==="declined"&&c.task.reason==="threshold"){if(g===null)throw new un("Run compaction has no Branch tip");let I=c.task.boundary.resumeAfter.continuation,w=await pse(t,e,a,c,l,g,r.kind==="declined"&&I.kind==="may_finish");if(r.kind==="declined"&&w.triggerEntryId===void 0&&I.kind==="may_finish")return{kind:"return",result:{kind:"finish_pending",entryIds:w.entries.map(O=>O.id)}};let k=h.length;h.push(...w.writes);let N;if(w.triggerEntryId!==void 0||I.kind==="need_assistant"){let O=w.triggerEntryId===void 0&&I.kind==="need_assistant"?I.overflowRecoveryUsed:!1;N=kQ(t,a,c,w.triggerEntryId??c.task.boundary.resumeAfter.triggerEntryId,O)}else N={...Od(c),at:"checkpoint",...c.task.boundary.resumeAfter};return{kind:"commit",writes:h,operationState:N,lane:{tipId:w.tipId,inbox:w.inbox},materialize:()=>({kind:"continue"}),events:O=>[...r.kind==="compaction"?y(O):[{type:"compaction_end",lane:t.name,runId:e.operationId,reason:"threshold",status:"declined",endedAt:O.timestamp}],...nk(w,O,k,t.name,e.operationId)]}}if(a.tipId===null)throw new un("Failed run has no Branch tip");let E=r.kind==="declined"?hse("compaction_declined","Overflow compaction was declined"):r.error,_=await Bb(l,e.operationId,c,e.context),S=Nb(u,"failed",a.tipId,E),C=r.kind==="declined"?{type:"compaction_end",lane:t.name,runId:e.operationId,reason:wke(c.task),status:"declined",endedAt:S.endedAt}:{type:"compaction_end",lane:t.name,runId:e.operationId,reason:wke(c.task),status:"failed",error:r.error,endedAt:S.endedAt};return{kind:"finish",writes:[...h,..._],record:S,materialize:()=>({kind:"settled",outcome:S}),events:I=>[...y(I),C,{type:"run_end",lane:t.name,runId:e.operationId,status:"failed",error:E,fromTipId:u.sourceTipId,tipId:a.tipId,endedAt:S.endedAt}]}}case"finish":{if(r.kind==="branch_summary")throw new un("Compaction finish boundary received a branch summary");if(r.kind!=="compaction"&&a.tipId===null)throw new un("Standalone compaction has no Branch tip");let E=r.kind==="failed"?r.error:void 0,_=r.kind==="declined"?"declined":r.kind==="failed"?"failed":"completed",S=await Bb(l,e.operationId,c,e.context),C=Nb(u,_,g,E);m=C.endedAt;let I=r.kind==="compaction"?void 0:r.kind==="declined"?{type:"compaction_end",lane:t.name,runId:e.operationId,reason:"manual",status:"declined",endedAt:C.endedAt}:{type:"compaction_end",lane:t.name,runId:e.operationId,reason:"manual",status:"failed",error:r.error,endedAt:C.endedAt};return{kind:"finish",writes:[...h,...S],record:C,...r.kind==="compaction"?{lane:{tipId:g}}:{},materialize:()=>({kind:"settled",outcome:C}),events:w=>[...y(w),...I===void 0?[]:[I]]}}case"commit_navigation":{if(r.kind==="compaction")throw new un("Navigation boundary received a compaction result");let E=r.kind==="failed"?r.error:void 0,_=r.kind==="declined"?"declined":r.kind==="failed"?"failed":"completed",S=await Bb(l,e.operationId,c,e.context),C=Nb(u,_,g,E),I=r.kind==="branch_summary"?{type:"navigation_end",lane:t.name,runId:e.operationId,status:"completed",fromTipId:u.sourceTipId,tipId:g,endedAt:C.endedAt}:r.kind==="declined"?{type:"navigation_end",lane:t.name,runId:e.operationId,status:"declined",fromTipId:u.sourceTipId,tipId:g,endedAt:C.endedAt}:{type:"navigation_end",lane:t.name,runId:e.operationId,status:"failed",error:r.error,fromTipId:u.sourceTipId,tipId:g,endedAt:C.endedAt};return{kind:"finish",writes:[...h,...S],record:C,...r.kind==="branch_summary"?{lane:{tipId:g}}:{},materialize:()=>({kind:"settled",outcome:C}),events:w=>[...y(w),I]}}}},e.context);if(s.kind==="cancel_requested")return{kind:"continue"};if(s.value.kind!=="finish_pending")return s.value;let o=n.task.boundary;if(o.kind!=="resume_checkpoint"||o.resumeAfter.continuation.kind!=="may_finish")throw new un("Structural finish mediation requires a resumable finish boundary");return xke(t,e,n,o.resumeAfter.continuation,s.value.entryIds,[{type:"compaction_end",lane:t.name,runId:e.operationId,reason:"threshold",status:"declined",endedAt:Date.now()}])}async function lqn(t,e,n){let r=t.session.idGenerator.next(),i=await t.continueOperation(n,(s,o)=>{let a={...Od(o),at:"summary.ready",task:o.task,summaryContext:P3i(t,r,s.configuration),nextAttempt:1};return{kind:"commit",writes:[],operationState:a,materialize:()=>({kind:"continue"})}},e.context);return i.kind==="cancel_requested"?{kind:"continue"}:i.value}async function gqn(t,e,n){let r=await D3i(t,e,n);if(r.kind==="cancel_requested")return{kind:"continue"};if(n.task.boundary.kind==="commit_navigation"){if(!("messages"in r.value))throw new un("Navigation task has invalid durable preparation");let s=await t.hooks.runWithGate("before_navigation",{lane:t.name,runId:e.operationId,targetId:n.task.boundary.targetId,preparation:r.value,...n.task.customInstructions===void 0?{}:{customInstructions:n.task.customInstructions}},e.gate,e.context);return s?.decline===!0?rk(t,e,n,{kind:"declined"}):s?.summary!==void 0?rk(t,e,n,{kind:"branch_summary",resultEntryId:t.session.idGenerator.next(),result:s.summary,fromHook:!0}):lqn(t,e,n)}if(!("messagesToSummarize"in r.value))throw new un("Compaction task has invalid durable preparation");let i=await t.hooks.runWithGate("before_compaction",{lane:t.name,runId:e.operationId,reason:wke(n.task),preparation:r.value,...n.task.customInstructions===void 0?{}:{customInstructions:n.task.customInstructions}},e.gate,e.context);return i?.decline===!0?rk(t,e,n,{kind:"declined"}):i?.compaction!==void 0?rk(t,e,n,{kind:"compaction",resultEntryId:t.session.idGenerator.next(),result:i.compaction,fromHook:!0}):lqn(t,e,n)}function M3i(t){return{...Od(t),at:"summary.effect_pending",task:t.task,summaryContext:t.summaryContext,attempt:t.nextAttempt,usageIds:[]}}function Aqn(t,e){return{...Od(t),at:"summary.retry_wait",task:t.task,summaryContext:t.summaryContext,nextAttempt:t.attempt+1,notBefore:Ske(t.summaryContext.retryPolicy,t.attempt),errorMessage:e}}function O3i(t){return{...Od(t),at:"summary.ready",task:t.task,summaryContext:t.summaryContext,nextAttempt:t.nextAttempt}}async function L3i(t,e,n){return t.continueOperation(n,(r,i)=>{let s=M3i(i);return{kind:"commit",writes:[],operationState:s,materialize:()=>s}},e.context)}async function F3i(t,e,n,r,i){return t.continueOperation(n,(s,o)=>{let a={...o,request:{index:r,usageId:i}};return{kind:"commit",writes:[],operationState:a,materialize:()=>a}},e.context)}async function Q3i(t,e,n,r,i){await t.settleOperation(n,(s,o)=>{let a={...o,usageIds:[...o.usageIds,r]};delete a.request;let c={id:r,usage:i.usage,adjustment:!1};return{kind:"commit",writes:[vE(c)],operationState:a,materialize:()=>{},events:u=>[fqn(c,0,u,t.name)]}},e.context)}function U3i(t,e,n,r){return{...t,transport:e.transport,timeoutMs:e.timeoutMs,maxRetries:e.maxRetries,maxRetryDelayMs:e.maxRetryDelayMs,headers:e.headers,metadata:e.metadata,cacheRetention:"none",deferred:!1,signal:n.abortSignal,telemetryContext:Kh(n),onPayload:r}}async function G3i(t,e,n,r,i){let s=0,o,a=async(c,u,l)=>{let d={...n.summaryContext.streamOptions,deferred:!1},m=await t.hooks.runWithGate("before_request",{lane:t.name,runId:e.operationId,model:r,step:mse(n.task),attempt:n.attempt,streamOptions:d},e.gate,l).catch(async E=>{throw E instanceof Jh?(await E.cancellation,new EV):E}),h={...m?.streamOptions===void 0?d:vQ(d,m.streamOptions),deferred:!1},f=t.session.idGenerator.next(),g=await F3i(t,e,n,s,f);if(s+=1,g.kind==="cancel_requested")throw new EV;let A=PA(e.gate.signal,l),y;try{y=await e.gate.admit(()=>t.models.completeSimple(r,c,U3i(u,h,A,async(E,_)=>(await t.hooks.runWithGate("before_payload",{lane:t.name,runId:e.operationId,model:_,payload:E},e.gate,A))?.payload)))}catch(E){throw E instanceof Jh?(await E.cancellation,new EV):E}return o=y,await Q3i(t,e,g.value,f,y),y};try{if(mse(n.task)==="compaction"){if(!("messagesToSummarize"in i))throw new un("Compaction summary has invalid durable preparation");let u=await Vut(i,{model:r,customInstructions:n.task.customInstructions,thinkingLevel:n.summaryContext.configuration.thinkingLevel},a,e.context);return u.ok?{kind:"compaction",result:u.value,retryable:o!==void 0&&Jy(o)}:{kind:"error",error:hse(u.error.code,u.error.message),retryable:o!==void 0&&Jy(o)}}if(!("messages"in i))throw new un("Branch summary has invalid durable preparation");let c=await ddt(i,{customInstructions:n.task.customInstructions},a,e.context);return c.ok?{kind:"branch_summary",result:c.value,retryable:o!==void 0&&Jy(o)}:{kind:"error",error:hse(c.error.code,c.error.message),retryable:o!==void 0&&Jy(o)}}catch(c){if(c instanceof EV)return{kind:"cancel_requested"};throw c}}async function $3i(t,e,n){return t.continueOperation(n,async(r,i,s,o)=>{let a=mse(i.task),c=await o.getValue(AS(e.operationId,i.task.taskId),e.context);if(c===void 0||c.value.kind!==a)throw new un(`Structural task ${i.task.taskId} has invalid durable preparation`);return{kind:"return",result:c.value.kind==="compaction"?mqn(c.value):hqn(c.value)}},e.context)}async function W3i(t,e,n,r){if(r.kind==="cancel_requested")return{kind:"continue"};if(r.kind==="compaction")return rk(t,e,n,{kind:"compaction",resultEntryId:n.summaryContext.resultEntryId,result:r.result,fromHook:!1});if(r.kind==="branch_summary")return rk(t,e,n,{kind:"branch_summary",resultEntryId:n.summaryContext.resultEntryId,result:r.result,fromHook:!1});if(r.error.code==="aborted"&&t.state.operation.state.control.status==="running")throw new un("Structural provider response is aborted while durable control is running");if(r.retryable&&n.attempt({kind:"commit",writes:[],operationState:i,materialize:()=>({kind:"continue"}),events:()=>[{type:"retry_scheduled",lane:t.name,runId:e.operationId,step:n.task.taskId,attempt:i.nextAttempt,maxAttempts:n.summaryContext.retryPolicy.maxAttempts,delayMs:Wx(n.summaryContext.retryPolicy,n.attempt),notBefore:i.notBefore,errorMessage:r.error.message}]}),e.context);return s.kind==="cancel_requested"?{kind:"continue"}:s.value}return rk(t,e,n,{kind:"failed",error:r.error})}async function yqn(t,e,n){let r=await $3i(t,e,n);if(r.kind==="cancel_requested")return{kind:"continue"};let i=n.summaryContext.configuration.model,s=t.models.getModel(i.provider,i.modelId);if(s===void 0)return rk(t,e,n,{kind:"failed",error:hse("model_unavailable","The configured model is unavailable in this process",i)});let o=await L3i(t,e,n);if(o.kind==="cancel_requested")return{kind:"continue"};let a=await G3i(t,e,o.value,s,r.value);return W3i(t,e,o.value,a)}async function Eqn(t,e,n){if(Date.now()Cke(n.notBefore,e.gate.signal))}let r=await t.continueOperation(n,(i,s)=>{let o=O3i(s);return{kind:"commit",writes:[],operationState:o,materialize:()=>({kind:"continue"}),events:()=>[{type:"retry_start",lane:t.name,runId:e.operationId,step:s.task.taskId,attempt:s.nextAttempt}]}},e.context);return r.kind==="cancel_requested"?{kind:"continue"}:r.value}async function bqn(t,e,n){let r=hse("structural_interrupted","Structural summary attempt was interrupted and its external outcome is unknown");if(n.attempt>=n.summaryContext.retryPolicy.maxAttempts)return rk(t,e,n,{kind:"failed",error:r});let i=Aqn(n,r.message),s=await t.continueOperation(n,()=>({kind:"commit",writes:[],operationState:i,materialize:()=>({kind:"continue"}),events:()=>[{type:"retry_scheduled",lane:t.name,runId:e.operationId,step:n.task.taskId,attempt:i.nextAttempt,maxAttempts:n.summaryContext.retryPolicy.maxAttempts,delayMs:Wx(n.summaryContext.retryPolicy,n.attempt),notBefore:i.notBefore,errorMessage:r.message,recovery:!0}]}),e.context);return s.kind==="cancel_requested"?{kind:"continue"}:s.value}async function _qn(t,e,n){let r=n.settings.compaction,i=t.state.configuration.model,s=t.models.getModel(i.provider,i.modelId);if(!r.enabled||s===void 0)return{kind:"result",value:void 0};let o=await bke(t,e,n);if(o.kind==="cancel_requested")return o;let a=o.value.findIndex(l=>l.id===n.triggerEntryId),c=-1;for(let l=o.value.length-1;l>=0;l--)if(o.value[l].type==="compaction"){c=l;break}if(c>=a&&c!==-1)return{kind:"result",value:void 0};if(a===-1)throw new un(`Checkpoint trigger ${n.triggerEntryId} is missing from its Branch`);let u=TQ(o.value,r);if(!u.ok)throw u.error;return u.value===void 0||!ZRe(u.value.tokensBefore,s.contextWindow,r)?{kind:"result",value:void 0}:{kind:"result",value:{taskId:t.session.idGenerator.next(),preparation:Tke(u.value)}}}async function xqn(t,e,n){if(n.generationContext.overflowRecoveryUsed)return;let r=await bke(t,e,n);if(r.kind==="cancel_requested")return;let i=TQ(r.value,n.settings.compaction);if(!i.ok)throw i.error;if(i.value!==void 0)return{taskId:t.session.idGenerator.next(),preparation:Tke(i.value)}}function Sqn(t,e,n){return t.continueOperation(n,async(r,i,s,o)=>{if(i.targetId!==null&&!(await o.getEntries([i.targetId],e.context)).has(i.targetId))throw new un(`Navigation target ${i.targetId} is missing`);if(i.targetId===s.sourceTipId)throw new un("Navigation target must differ from its source tip");if(i.targetId===null&&i.label!==void 0)throw new un("Root navigation cannot set a label");let a=[fr(Mo(t.name),i.targetId)];i.label!==void 0&&i.targetId!==null&&a.push(fr(yS(i.targetId),i.label));let c=await Bb(o,e.operationId,i,e.context),u=Nb(s,"completed",i.targetId);return{kind:"finish",writes:[...a,...c],record:u,lane:{tipId:i.targetId},materialize:()=>({kind:"settled",outcome:u}),events:()=>[{type:"navigation_end",lane:t.name,runId:e.operationId,status:"completed",fromTipId:s.sourceTipId,tipId:i.targetId,endedAt:u.endedAt}]}},e.context).then(r=>r.kind==="cancel_requested"?{kind:"continue"}:r.value)}var EV,fse=v(()=>{p();qo();lke();dV();TE();aV();rse();Rb();yp();JD();Ap();yV();Tdt();Ike();dse();EV=class extends Error{constructor(){super("Structural generation was cancelled"),this.name="StructuralCancelled"}}});async function Cqn(t,e,n){let r=await t.continueOperation(n,async(c,u,l,d)=>{if(l.intent.kind!=="run")throw new un("Run operation has non-run intent");let m=await d.getEntries(l.intent.promptEntryIds,e.context);return{kind:"return",result:l.intent.promptEntryIds.map(f=>{let g=m.get(f);if(g?.type!=="message")throw new un(`Run prompt entry ${f} is missing its message`);return g.message})}},e.context);if(r.kind==="cancel_requested")return{kind:"continue"};let s=(await t.hooks.runWithGate("before_run",{lane:t.name,runId:e.operationId,prompt:r.value,resources:t.readConfig().resources},e.gate,e.context))?.messages??[];for(let c of s)if(c.role==="assistant"&&c.stopReason==="pending")throw new un("before_run returned a pending assistant message");let o=s.map(c=>({id:t.session.idGenerator.next(),message:c})),a=await t.continueOperation(n,(c,u)=>{let l=use(c.tipId,o.map(({id:h,message:f})=>({id:h,type:"message",message:f}))),d=l.at(-1)?.id??c.tipId;if(d===null)throw new un("Run start has no trigger entry");let m={...Od(u),at:"checkpoint",continuation:{kind:"need_assistant",overflowRecoveryUsed:!1},triggerEntryId:d};return{kind:"commit",writes:[...l.map(h=>gp(h)),...l.length===0?[]:[fr(Mo(t.name),d)]],operationState:m,lane:{tipId:d},materialize:()=>({kind:"continue"}),events:h=>bw(l,h,t.name,e.operationId)}},e.context);return a.kind==="cancel_requested"?{kind:"continue"}:a.value}async function Iqn(t,e,n){let r=await _qn(t,e,n);if(r.kind==="cancel_requested")return{kind:"continue"};let i=await t.continueOperation(n,async(s,o,a,c)=>{let u=await pse(t,e,s,o,c,s.tipId,r.value===void 0&&o.continuation.kind==="may_finish");if(u.triggerEntryId!==void 0)return{kind:"commit",writes:u.writes,operationState:kQ(t,s,o,u.triggerEntryId,!1),lane:{tipId:u.tipId,inbox:u.inbox},materialize:()=>({kind:"continue"}),events:l=>nk(u,l,0,t.name,e.operationId)};if(r.value!==void 0){let l={...Od(o),at:"summary.deciding",task:{taskId:r.value.taskId,reason:"threshold",boundary:{kind:"resume_checkpoint",resumeAfter:{continuation:o.continuation,triggerEntryId:o.triggerEntryId}}}};return{kind:"commit",writes:[...u.writes,fr(AS(e.operationId,r.value.taskId),r.value.preparation)],operationState:l,lane:{tipId:u.tipId,inbox:u.inbox},materialize:()=>({kind:"continue"}),events:d=>[...nk(u,d,0,t.name,e.operationId),{type:"compaction_start",lane:t.name,runId:e.operationId,reason:"threshold",startedAt:d.timestamp}]}}return o.continuation.kind==="need_assistant"?{kind:"commit",writes:u.writes,operationState:kQ(t,s,o,o.triggerEntryId,o.continuation.overflowRecoveryUsed),lane:{tipId:u.tipId,inbox:u.inbox},materialize:()=>({kind:"continue"}),events:l=>nk(u,l,0,t.name,e.operationId)}:{kind:"return",result:{kind:"finish_pending",entryIds:u.entries.map(l=>l.id)}}},e.context);if(i.kind==="cancel_requested")return{kind:"continue"};if(i.value.kind!=="finish_pending")return i.value;if(n.continuation.kind!=="may_finish")throw new un("Checkpoint finish mediation requires a finish continuation");return xke(t,e,n,n.continuation,i.value.entryIds)}var wqn=v(()=>{p();Rb();yp();JD();Ap();yV();Tdt();fse()});function H3i(t,e,n){let r=t.streamOptions;return{transport:r.transport,timeoutMs:r.timeoutMs,maxRetries:r.maxRetries,maxRetryDelayMs:r.maxRetryDelayMs,headers:r.headers,metadata:r.metadata,cacheRetention:r.cacheRetention,deferred:r.deferred,...t.thinkingLevel==="off"?{}:{reasoning:t.thinkingLevel},signal:n.abortSignal,telemetryContext:Kh(n),onPayload:t.beforePayload===void 0?void 0:(i,s)=>t.beforePayload?.(i,s,n),onResponse:i=>{e({status:i.status,headers:i.headers})}}}function q3i(t){return t.type!=="start"&&t.type!=="done"&&t.type!=="error"}async function vdt(t,e,n,r){let i=!1;for await(let a of t)if(a.type==="start"){if(i)throw new Error("Assistant message stream emitted more than one start event");i=!0,await e.start({...a.partial},a,r)}else if(q3i(a)){if(!i)throw new Error(`Assistant message stream emitted ${a.type} before start`);await e.update({...a.partial},a,r)}else if(a.type==="done"&&!i)throw new Error("Assistant message stream emitted done before start");let s=await t.result(),o=s;if(n!==void 0)try{o=await n(s,r)}catch(a){if(!(a instanceof Jh))throw a;await a.cancellation}return await e.end(o,r),o}async function Tqn(t,e,n){let r={messages:t.slice(),systemPrompt:e.systemPrompt};e.transformContext&&(r=await e.transformContext(r,n));let i=await e.toProviderMessages(r.messages,n),s={systemPrompt:r.systemPrompt,messages:i,tools:e.tools},o={},a=await e.request(s,H3i(e,u=>{o=u},n),n),c=e.afterResponse;return vdt(a,e.observer,c===void 0?void 0:(u,l)=>c(u,o,l),n)}var Rdt=v(()=>{p();TE();aV()});async function gse(t,e,n,r){let i=[],s;for(;;){let o=await t.readList(Aw(e,n),{order:"asc",limit:1e3,...s===void 0?{}:{cursor:s}},r);if(i.push(...o.map(({value:a})=>a)),o.length<1e3)return i;s={seq:o[o.length-1].seq}}}function vqn(t,e,n,r){let i=!1,s=Promise.resolve();return{write(o){if(i)return;let a=t.command(c=>r(c)?{kind:"commit",writes:[n(o)],next:c,materialize:()=>{}}:{kind:"return",result:void 0},e.context).then(()=>{});s=a,a.catch(()=>{})},seal(){i=!0},async drain(){await s}}}function Rqn(t,e,n){let r=Aw(e.operationId,n);return vqn(t,e,i=>ise(r,i),i=>{let s=i.operation?.state;return s===void 0?!1:(s.at==="assistant.effect_pending"||s.at==="deferred.effect_pending")&&s.responseEntryId===n})}function kqn(t,e,n,r,i){let s=ZR(e.operationId,i);return vqn(t,e,o=>fr(s,o),o=>{let a=o.operation;if(a?.state.at!=="tools")return!1;let c=a.state.batch;return c.turnId===n&&c.calls.some(u=>u.sourceIndex===r&&u.resultEntryId===i&&u.status==="effect_pending")})}var Ase=v(()=>{p();Ap()});function Rke(t,e,n,r=!1){let i=Rqn(t,e,n),s=new ute,o={lane:t.name,runId:e.operationId,...r?{recovery:!0}:{}},a=async()=>{i.seal(),await i.drain()};return{observer:{start(c,u,l){let d=s.encode(u);return d!==void 0&&i.write(d),t.emitBatch([{type:"message_start",...o,message:c}],l)},update(c,u,l){let d=s.encode(u);return d!==void 0&&i.write(d),t.emitBatch([{type:"message_update",...o,message:c,event:u,...d===void 0?{}:{frame:d}}],l)},end(c,u){return t.emitBatch([{type:"message_end",...o,message:c,entryId:n}],u)}},async afterResponse(c,u,l){return await a(),(await t.hooks.runWithGate("after_response",{lane:t.name,runId:e.operationId,...u,message:c},e.gate,l))?.message??c},close:a}}async function kke(t,e,n,r){let i=await t.continueOperation(n,async(s,o,a,c)=>{if(s.tipId===null)throw new un("Failed run has no Branch tip");let u=Nb(a,"failed",s.tipId,r);return{kind:"finish",writes:await Bb(c,e.operationId,o,e.context),record:u,materialize:()=>({kind:"settled",outcome:u}),events:()=>[{type:"run_end",lane:t.name,runId:e.operationId,status:"failed",error:r,fromTipId:a.sourceTipId,tipId:s.tipId,endedAt:u.endedAt}]}},e.context);return i.kind==="cancel_requested"?{kind:"continue"}:i.value}function j3i(t){let e=Number.parseInt(t.slice(0,8)+t.slice(9,13),16);if(!Number.isSafeInteger(e))throw new un(`Invalid reserved UUIDv7 ${t}`);return e}function vke(t,e){return{code:"assistant_error",message:e.errorMessage??`${t==="assistant"?"Assistant":"Deferred"} request ended with ${e.stopReason}`}}function kdt(t,e){return{...t,stopReason:"error",errorMessage:e}}function V3i(t,e){return{...e,stopReason:"aborted",errorMessage:e.errorMessage??`${t==="assistant"?"Assistant":"Deferred"} request was cancelled`}}function Y3i(t,e){let n=t.deferred,r=e.generationContext.configuration.model;return t.stopReason==="deferred"&&n!==void 0&&n.id.length!==0&&n.provider===r.provider&&n.modelId===r.modelId&&n.api===t.api}async function BQ(t,e,n,r,i={}){let s=n.at==="assistant.effect_pending"&&(rF(r,n.contextWindow)||dte(r,n.intendedOutputLimit)),o=s&&!n.generationContext.overflowRecoveryUsed?await xqn(t,e,n):void 0;return t.settleOperation(n,async(a,c,u,l)=>{let d=c.at==="assistant.effect_pending"?"assistant":"deferred",m=n.responseEntryId,h=c.at==="assistant.effect_pending"?c.generationContext.configuration:c.configuration,f=c.at==="assistant.effect_pending"?c.generationContext.stepId:`${c.stepId}:poll:${c.poll}`,g={...Od(c),latestAssistantEntryId:m},A=r,y,E;if(c.control.status==="cancel_requested")A=V3i(d,r),y={...g,at:"checkpoint",continuation:{kind:"may_finish",includeFinalAssistant:!0},triggerEntryId:m};else{if(r.stopReason==="aborted")throw new un(`${d==="assistant"?"Assistant":"Deferred"} response is aborted while durable control is running`);if(c.at==="assistant.effect_pending"&&s)A=kdt(r,r.errorMessage??"Assistant request exceeded the context window"),c.generationContext.overflowRecoveryUsed||o===void 0?E=vke(d,A):y={...g,at:"summary.deciding",task:{taskId:o.taskId,reason:"overflow",boundary:{kind:"resume_checkpoint",resumeAfter:{continuation:{kind:"need_assistant",overflowRecoveryUsed:!0},triggerEntryId:c.generationContext.triggerEntryId}}}};else if(r.stopReason==="deferred")c.at==="assistant.effect_pending"?Y3i(r,c)?y={...g,at:"deferred.suspended",stepId:c.generationContext.stepId,sourceEntryId:m,poll:0,configuration:h,streamOptions:c.generationContext.streamOptions}:(A=kdt(r,"Provider returned an invalid deferred handle"),E=vke(d,A)):y={...g,at:"deferred.suspended",stepId:c.stepId,sourceEntryId:m,poll:c.poll,configuration:h,streamOptions:c.streamOptions};else if(r.stopReason==="error")c.at==="assistant.effect_pending"&&(i.recovery===!0||Jy(r))&&c.attemptW.type==="toolCall"?[{sourceIndex:$}]:[]);if(O.length!==0){let W=j3i(m),$=O.map(({sourceIndex:G})=>({status:"planned",sourceIndex:G,resultEntryId:t.session.idGenerator.next(W)}));y={...g,at:"tools",batch:{assistantEntryId:m,configuration:h,turnId:f,calls:$}}}else r.stopReason==="toolUse"?(A=kdt(r,"Provider reported tool use without any tool calls"),E=vke(d,A)):y={...g,at:"checkpoint",continuation:{kind:"may_finish",includeFinalAssistant:!0},triggerEntryId:m}}}let _={id:m,parentId:a.tipId,type:"message",message:A},S={id:n.usageId,usage:A.usage,entryId:m,adjustment:!1};if(y===void 0&&E===void 0)throw new un("Response settlement has no durable disposition");let C=E===void 0?void 0:Nb(u,"failed",m,E),I=C===void 0?[]:await Bb(l,e.operationId,c,e.context),w=[gp(_),vE(S),fr(Mo(t.name),m),...C===void 0?[JR(Aw(e.operationId,m))]:I,...y?.at==="summary.deciding"&&o!==void 0?[fr(AS(e.operationId,o.taskId),o.preparation)]:[]],k=O=>({..._,seq:O.seqs[0],timestamp:O.timestamp}),N=O=>{let W=k(O),$=[{type:"entry_added",lane:t.name,entry:W,...i},{type:"usage",lane:t.name,row:{...S,seq:O.seqs[1]},totals:O.stats.usage}];if(c.at==="assistant.effect_pending"){if(i.recovery!==!0&&c.attempt>1&&y?.at!=="assistant.retry_wait"){let G=A.stopReason!=="error"&&A.stopReason!=="aborted";$.push({type:"retry_end",lane:t.name,runId:e.operationId,step:f,attempt:c.attempt,success:G,...G?{}:{finalError:A.errorMessage??`Assistant request ended with ${A.stopReason}`}})}i.recovery!==!0&&y?.at==="assistant.retry_wait"&&$.push({type:"retry_scheduled",lane:t.name,runId:e.operationId,step:f,attempt:y.nextAttempt,maxAttempts:y.generationContext.retryPolicy.maxAttempts,delayMs:Wx(c.generationContext.retryPolicy,c.attempt),notBefore:y.notBefore,errorMessage:y.errorMessage}),i.recovery!==!0&&y?.at!=="tools"&&y?.at!=="assistant.retry_wait"&&$.push({type:"turn_end",lane:t.name,runId:e.operationId,turnId:f,message:A,toolResults:[]}),y?.at==="summary.deciding"&&$.push({type:"compaction_start",lane:t.name,runId:e.operationId,reason:"overflow",startedAt:O.timestamp})}else y?.at!=="tools"&&$.push({type:"turn_end",lane:t.name,runId:e.operationId,turnId:f,message:A,toolResults:[],...i});return(c.at==="deferred.effect_pending"||i.recovery!==!0)&&y?.at==="deferred.suspended"&&A.deferred!==void 0&&$.push({type:"run_suspend",lane:t.name,runId:e.operationId,reason:"deferred",deferred:A.deferred,poll:y.poll,...c.at==="deferred.effect_pending"?i:{}}),C!==void 0&&E!==void 0&&$.push({type:"run_end",lane:t.name,runId:e.operationId,status:"failed",error:E,fromTipId:u.sourceTipId,tipId:m,endedAt:C.endedAt}),$};if(C!==void 0)return{kind:"finish",writes:w,record:C,lane:{tipId:m},materialize:()=>({kind:"settled",outcome:C}),events:N};if(y===void 0)throw new un("Response settlement is missing its next state");return{kind:"commit",writes:w,operationState:y,lane:{tipId:m},materialize:()=>({kind:"continue"}),events:N}},e.context)}var Bke=v(()=>{p();qo();Rb();yp();JD();Ap();Ase();Ike();fse();dse()});function z3i(t){return{code:"model_unavailable",message:"The configured model is unavailable in this process",details:t}}async function Bdt(t,e,n){let r=(await t.getEntries([e.sourceEntryId],n)).get(e.sourceEntryId);if(r?.type!=="message"||r.message.role!=="assistant"||r.message.stopReason!=="deferred"||r.message.deferred===void 0)throw new un(`Deferred source ${e.sourceEntryId} is missing its assistant handle`);let i=r.message.deferred,s=e.configuration.model;if(i.id.length===0||i.provider!==s.provider||i.modelId!==s.modelId||i.api!==r.message.api)throw new un(`Deferred source ${e.sourceEntryId} has an invalid handle`);return i}async function K3i(t,e,n){return t.continueOperation(n,async(r,i,s,o)=>({kind:"return",result:await Bdt(o,n,e.context)}),e.context)}async function J3i(t,e,n){let r=await K3i(t,e,n);if(r.kind==="cancel_requested")return r;if(e.deferredPermits===0)return{kind:"waiting",source:r.value};let i=n.configuration.model,s=t.models.getModel(i.provider,i.modelId);if(s===void 0)return{kind:"configuration_failure"};let o={...n.streamOptions,deferred:!1},a=n.at==="deferred.suspended"?n.poll+1:n.poll,c=await t.hooks.runWithGate("before_request",{lane:t.name,runId:e.operationId,model:s,step:"deferred",attempt:a,streamOptions:o},e.gate,e.context);return{kind:"ready",source:r.value,model:s,poll:a,streamOptions:{...c?.streamOptions===void 0?o:vQ(o,c.streamOptions),deferred:!1}}}async function X3i(t,e,n,r,i){let s=Date.now(),o={at:"deferred.effect_pending",stepId:n.stepId,sourceEntryId:n.sourceEntryId,poll:r.poll,responseEntryId:t.session.idGenerator.next(s),usageId:t.session.idGenerator.next(s),configuration:n.configuration,streamOptions:n.streamOptions};return t.continueOperation(n,(a,c)=>{let u={...Od(c),...o};return{kind:"commit",writes:n.at==="deferred.effect_pending"?[JR(Aw(e.operationId,n.responseEntryId))]:[],operationState:u,materialize:()=>(e.deferredPermits--,u),events:()=>[{type:"run_resume",lane:t.name,runId:e.operationId,...i?{recovery:!0}:{}},{type:"turn_start",lane:t.name,runId:e.operationId,turnId:`${o.stepId}:poll:${o.poll}`,...i?{recovery:!0}:{}}]}},e.context)}async function Z3i(t,e,n,r,i){let s=Rke(t,e,r.responseEntryId,i),o={},a=PA(e.gate.signal,e.context),c=e.gate.admit(()=>t.models.streamDeferred(n.model,n.source,{wait:0,signal:a.abortSignal,telemetryContext:Kh(a),timeoutMs:n.streamOptions.timeoutMs,maxRetries:n.streamOptions.maxRetries,maxRetryDelayMs:n.streamOptions.maxRetryDelayMs,headers:n.streamOptions.headers,onPayload:async(u,l)=>(await t.hooks.runWithGate("before_payload",{lane:t.name,runId:e.operationId,model:l,payload:u},e.gate,e.context))?.payload,onResponse:u=>{o={status:u.status,headers:u.headers}}}));try{return await vdt(c,s.observer,(u,l)=>s.afterResponse(u,o,l),e.context)}finally{await s.close()}}async function Bqn(t,e,n,r){let i=await J3i(t,e,n);if(i.kind==="cancel_requested")return{kind:"continue"};if(i.kind==="waiting")return{kind:"waiting",outcome:{kind:"waiting",operationId:e.operationId,reason:"deferred",deferred:i.source}};if(i.kind==="configuration_failure")return kke(t,e,n,z3i(n.configuration.model));let s=await X3i(t,e,n,i,r);if(s.kind==="cancel_requested")return{kind:"continue"};let o=await Z3i(t,e,i,s.value,r);return BQ(t,e,s.value,o,r?{recovery:!0}:{})}function e4i(t,e,n){return Bqn(t,e,n,!1)}function t4i(t,e,n){return Bqn(t,e,n,!0)}function Nqn(t,e,n){return n.at==="deferred.suspended"?e4i(t,e,n):t4i(t,e,n)}var Ndt=v(()=>{p();TE();Rdt();rse();yp();JD();Ap();Bke()});function Dqn(t,e){return{code:t,message:t==="model_unavailable"?"The configured model is unavailable in this process":"One or more configured tools are unavailable in this process",details:e}}async function n4i(t,e){let n=t.readConfig();if(n.systemPrompt===void 0)return"";if(typeof n.systemPrompt=="string")return n.systemPrompt;let r=n.toolContext,i=typeof r=="function"?await r(e):r;return n.systemPrompt(i,e)}async function r4i(t,e,n){let r=n.generationContext.configuration.model,i=t.models.getModel(r.provider,r.modelId);if(i===void 0)return{kind:"configuration_failure",error:Dqn("model_unavailable",r)};let s=t.readConfig(),o=new Map(s.tools.map(h=>[h.name,h])),a=n.generationContext.configuration.activeToolNames.filter(h=>!o.has(h));if(a.length!==0)return{kind:"configuration_failure",error:Dqn("configured_tools_unavailable",{tools:a})};let c=n.generationContext.configuration.activeToolNames.map(h=>{let f=o.get(h);if(f===void 0)throw new un(`Configured tool ${h} disappeared during resolution`);return{name:f.name,description:f.description,parameters:f.parameters,...f.constrainedSampling===void 0?{}:{constrainedSampling:f.constrainedSampling}}}),u=await _ke(t,e,n);if(u.kind==="cancel_requested")return u;let l=await n4i(t,e.context),d=await t.hooks.runWithGate("before_request",{lane:t.name,runId:e.operationId,model:i,step:"assistant",attempt:n.nextAttempt,streamOptions:n.generationContext.streamOptions},e.gate,e.context),m=d?.streamOptions===void 0?n.generationContext.streamOptions:vQ(n.generationContext.streamOptions,d.streamOptions);return{kind:"ready",model:i,tools:c,messages:u.value,systemPrompt:l,streamOptions:m,toProviderMessages:s.toProviderMessages}}async function i4i(t,e,n,r){let i=Date.now(),s={at:"assistant.effect_pending",generationContext:n.generationContext,attempt:n.nextAttempt,responseEntryId:t.session.idGenerator.next(i),usageId:t.session.idGenerator.next(i),intendedOutputLimit:r.model.maxTokens,contextWindow:r.model.contextWindow};return t.continueOperation(n,(o,a)=>{let c={...Od(a),...s};return{kind:"commit",writes:[],operationState:c,materialize:()=>c,events:()=>n.nextAttempt===1?[{type:"turn_start",lane:t.name,runId:e.operationId,turnId:n.generationContext.stepId}]:[]}},e.context)}async function s4i(t,e,n,r){let i=Rke(t,e,n.responseEntryId);try{return await Tqn(r.messages,{model:r.model,systemPrompt:r.systemPrompt,tools:r.tools,thinkingLevel:n.generationContext.configuration.thinkingLevel,streamOptions:r.streamOptions,transformContext:async(s,o)=>{let a=await t.hooks.runWithGate("transform_context",{lane:t.name,runId:e.operationId,...s},e.gate,o);return{messages:a?.messages??s.messages,systemPrompt:a?.systemPrompt??s.systemPrompt}},toProviderMessages:r.toProviderMessages,beforePayload:async(s,o,a)=>(await t.hooks.runWithGate("before_payload",{lane:t.name,runId:e.operationId,model:o,payload:s},e.gate,a))?.payload,afterResponse:i.afterResponse,request:(s,o,a)=>{let c=PA(e.gate.signal,a);return e.gate.admit(()=>t.models.streamSimple(r.model,s,{...o,sessionId:`${t.session.metadata.id}:${t.name}`,signal:c.abortSignal,telemetryContext:Kh(c)}))},observer:i.observer},e.context)}finally{await i.close()}}async function o4i(t,e,n){if(Date.now()Cke(n.notBefore,e.gate.signal))}let r=await t.continueOperation(n,(i,s)=>{let o={...Od(s),at:"assistant.ready",generationContext:n.generationContext,nextAttempt:n.nextAttempt};return{kind:"commit",writes:[],operationState:o,materialize:()=>({kind:"continue"}),events:()=>[{type:"retry_start",lane:t.name,runId:e.operationId,step:n.generationContext.stepId,attempt:n.nextAttempt}]}},e.context);return r.kind==="cancel_requested"?{kind:"continue"}:r.value}async function Pqn(t,e,n){if(n.at==="assistant.retry_wait")return o4i(t,e,n);let r=await r4i(t,e,n);if(r.kind==="configuration_failure")return kke(t,e,n,r.error);if(r.kind==="cancel_requested")return{kind:"continue"};let i=await i4i(t,e,n,r);if(i.kind==="cancel_requested")return{kind:"continue"};let s=await s4i(t,e,i.value,r);return BQ(t,e,i.value,s)}var Mqn=v(()=>{p();TE();Rdt();rse();yp();JD();yV();Bke();Ike()});function Lqn(t,e){let n="Assistant request was interrupted. The preceding content is the latest committed partial; newer live output may be missing and the external outcome is unknown.";return e===void 0?{role:"assistant",content:[],api:"unknown",provider:t.provider,model:t.modelId,usage:Oqn,stopReason:"error",errorMessage:n,timestamp:Date.now()}:{...e,usage:Oqn,stopReason:"error",errorMessage:n}}async function Fqn(t,e,n){let r=await t.continueOperation(n,async(s,o,a,c)=>({kind:"return",result:await gse(c,e.operationId,n.responseEntryId,e.context)}),e.context);if(r.kind==="cancel_requested")return{kind:"continue"};let i=Lqn(n.generationContext.configuration.model,W4(r.value));return await t.emitBatch([{type:"message_start",lane:t.name,runId:e.operationId,message:i,recovery:!0},{type:"message_end",lane:t.name,runId:e.operationId,message:i,entryId:n.responseEntryId,recovery:!0}],e.context),BQ(t,e,n,i,{recovery:!0})}async function Ddt(t,e,n){let r=await t.settleOperation(n,async(o,a,c,u)=>({kind:"return",result:await gse(u,e.operationId,n.responseEntryId,e.context)}),e.context),i=n.at==="assistant.effect_pending"?n.generationContext.configuration.model:n.configuration.model,s=Lqn(i,W4(r));return await t.emitBatch([{type:"message_start",lane:t.name,runId:e.operationId,message:s,recovery:!0},{type:"message_end",lane:t.name,runId:e.operationId,message:s,entryId:n.responseEntryId,recovery:!0}],e.context),BQ(t,e,n,s,{recovery:!0})}var Oqn,Pdt=v(()=>{p();qo();Ase();Bke();Oqn={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}});async function Uqn(t,e,n){return t.command(async(r,i)=>{let s=(await i.getEntries([n.assistantEntryId],e.context)).get(n.assistantEntryId);if(s?.type!=="message"||s.message.role!=="assistant")throw new un("Tool batch assistant entry is invalid");let o=new Map;for(let a of n.calls){let c=s.message.content[a.sourceIndex];if(c?.type!=="toolCall")throw new un(`Tool call source index ${a.sourceIndex} does not name a tool-call block`);o.set(a.sourceIndex,c)}return{kind:"return",result:{assistant:s.message,calls:o}}},e.context)}function Qqn(t){return typeof t=="object"&&t!==null&&"role"in t&&t.role==="toolResult"}function yse(t,e){let n=t.calls.get(e.sourceIndex);if(n===void 0)throw new un(`Tool call source index ${e.sourceIndex} is invalid`);return n}function Nke(t,e){return{...Od(t),at:"tools",batch:e}}async function a4i(t,e,n){return t.command(async(r,i)=>{let s=r.operation;if(s?.state.at!=="tools")return{kind:"return",result:void 0};let o=s.state.batch,a=o.calls.findIndex(d=>d.status!=="completed");if(a===-1)return{kind:"return",result:void 0};let c=[];for(;af.status==="completed").map(f=>f.resultEntryId),m=await i.getEntries(d,e.context),h=new Map(u.map(f=>[f.call.resultEntryId,f.message]));l=o.calls.map(f=>{let g=h.get(f.resultEntryId)??(()=>{let A=m.get(f.resultEntryId);return A?.type==="message"&&Qqn(A.message)?A.message:void 0})();if(g===void 0)throw new un(`Completed tool call ${f.resultEntryId} is missing its result entry`);return g})}return{kind:"return",result:{items:u,...l===void 0?{}:{turnResults:l}}}},e.context)}async function c4i(t,e,n,r){let i=r.items.map(s=>s.message.usage===void 0?void 0:t.session.idGenerator.next());return t.settleOperation(n,async(s,o,a,c)=>{let u=o.batch,l=[],d=[],m=[],h=s.tipId;for(let[y,E]of r.items.entries()){let _={id:E.call.resultEntryId,parentId:h,type:"message",message:E.message,...E.call.terminate?{terminate:!0}:{}};d.push({entry:_,seqIndex:l.length}),l.push(gp(_),Ga(ll(E.call.resultEntryId)));let S=i[y];if(S!==void 0&&E.message.usage!==void 0){let C={id:S,usage:E.message.usage,entryId:E.call.resultEntryId,adjustment:!1};m.push({row:C,seqIndex:l.length}),l.push(vE(C))}h=E.call.resultEntryId}let f=u.calls.map(y=>{let E=r.items.find(_=>_.call.sourceIndex===y.sourceIndex&&_.call.resultEntryId===y.resultEntryId);return E===void 0?y:{status:"completed",sourceIndex:y.sourceIndex,resultEntryId:y.resultEntryId,terminate:E.call.terminate}}),g=f.every(y=>y.status==="completed");l.push(fr(Mo(t.name),h));let A;if(g){let y=f.every(S=>S.status==="completed"&&S.terminate);A={...Od(o),at:"checkpoint",continuation:y?{kind:"may_finish",includeFinalAssistant:!1}:{kind:"need_assistant",overflowRecoveryUsed:!1},triggerEntryId:h};let _=await c.scanValues(sse(e.operationId,n.batch.turnId),e.context);l.push(..._.map(({address:S})=>Ga(S)))}else A=Nke(o,{...u,calls:f});return{kind:"commit",writes:l,operationState:A,lane:{tipId:h,configuration:s.configuration},materialize:()=>g,events:y=>{let E=[];for(let{entry:_,seqIndex:S}of d){E.push({type:"entry_added",lane:t.name,entry:{..._,seq:y.seqs[S],timestamp:y.timestamp}});let C=m.find(I=>I.row.entryId===_.id);C!==void 0&&E.push({type:"usage",lane:t.name,row:{...C.row,seq:y.seqs[C.seqIndex]},totals:y.stats.usage})}return E}}},e.context)}async function Dke(t,e,n,r,i){let s=await a4i(t,e,r);if(s===void 0)return;await t.emitBatch(s.items.flatMap(({call:a,message:c})=>[{type:"message_start",lane:t.name,runId:e.operationId,message:c,...i?{recovery:!0}:{}},{type:"message_end",lane:t.name,runId:e.operationId,message:c,entryId:a.resultEntryId,...i?{recovery:!0}:{}}]),e.context),await c4i(t,e,n,s)&&s.turnResults!==void 0&&await t.emitBatch([{type:"turn_end",lane:t.name,runId:e.operationId,turnId:n.batch.turnId,message:r.assistant,toolResults:s.turnResults,...i?{recovery:!0}:{}}],e.context)}var Gqn=v(()=>{p();Rb();yp();JD();Ap()});function qqn(t){let e=t.state.operation;if(e?.state.at==="tools")return{run:e.state,batch:e.state.batch}}function u4i(t,e,n){return t.calls.find(r=>r.sourceIndex===e&&r.resultEntryId===n)}function jqn(t,e){return{...t,calls:t.calls.map(n=>n.sourceIndex===e.sourceIndex&&n.resultEntryId===e.resultEntryId?e:n)}}function $qn(t){if(t.length===0)throw new TypeError("Tool invocation memo name must not be empty");if(t.includes(":"))throw new TypeError("Tool invocation memo name must not contain ':'")}function d4i(t,e,n,r){let i=!0,s=a=>{let c=a.operation;return c?.state.at!=="tools"?!1:u4i(c.state.batch,r.sourceIndex,r.resultEntryId)?.status==="effect_pending"},o=()=>new Mdt;return{invocation:{invocationId:r.resultEntryId,operationId:e.operationId,turnId:n.turnId,getMemo(a){return $qn(a),i?t.command(async(c,u)=>s(c)?{kind:"return",result:(await u.getValue(cke(e.operationId,r.resultEntryId,a),e.context))?.value}:{kind:"reject",error:o()},e.context):Promise.reject(o())},setMemo(a,c){return $qn(a),i?t.command(u=>{if(!s(u))return{kind:"reject",error:o()};let l=cke(e.operationId,r.resultEntryId,a);return{kind:"commit",writes:[c===void 0?Ga(l):fr(l,c)],next:u,materialize:()=>{}}},e.context):Promise.reject(o())}},expire(){i=!1}}}function Odt(t,e,n={}){return{role:"toolResult",toolCallId:t.id,toolName:t.name,content:e,...n.details===void 0?{}:{details:n.details},...n.usage===void 0?{}:{usage:n.usage},isError:!0,timestamp:Date.now()}}function Pke(t){return{toolCall:t,message:Odt(t,[{type:"text",text:"Tool execution was cancelled before completion."}]),terminate:!1}}function Ldt(t,e){return{toolCall:t,message:Odt(t,[...e?.content??[],{type:"text",text:l4i}],e===void 0?{}:{details:e.details,usage:e.usage}),terminate:!1}}function p4i(t){return{toolCall:t,message:Odt(t,[{type:"text",text:`Tool call ${JSON.stringify(t.name)} was not executed because the assistant response hit the output token limit, so its arguments may be truncated. Re-issue the tool call with complete arguments.`}]),terminate:!1}}function Wqn(t){return{toolCall:t.toolCall,message:pdt(t),terminate:t.terminate}}async function m4i(t,e,n,r,i,s,o,a){return t.continueOperation(n,(c,u)=>{let l={status:"effect_pending",sourceIndex:r.sourceIndex,resultEntryId:r.resultEntryId,replay:o};return{kind:"commit",writes:[fr(mV(e.operationId,u.batch.turnId,r.sourceIndex),s)],operationState:Nke(u,jqn(u.batch,l)),materialize:()=>l,events:()=>[{type:"tool_start",lane:t.name,runId:e.operationId,turnId:u.batch.turnId,toolCallId:i.id,toolName:i.name,args:s,...a?{recovery:!0}:{}}]}},e.context)}async function NQ(t,e,n,r,i,s){await t.settleOperation(n,async(o,a,c,u)=>{let{toolCall:l}=i,d=await u.scanValues(ose(e.operationId,r.resultEntryId),e.context),m=a.control.status==="running"&&i.terminate,h={status:"outcome_ready",sourceIndex:r.sourceIndex,resultEntryId:r.resultEntryId,terminate:m};return{kind:"commit",writes:[fr(ll(r.resultEntryId),{type:"message",payload:i.message}),Ga(ZR(e.operationId,r.resultEntryId)),...d.map(({address:f})=>Ga(f))],operationState:Nke(a,jqn(a.batch,h)),materialize:()=>{},events:()=>[...r.status==="planned"?[{type:"tool_start",lane:t.name,runId:e.operationId,turnId:a.batch.turnId,toolCallId:l.id,toolName:l.name,args:l.arguments,...s?{recovery:!0}:{}}]:[],{type:"tool_end",lane:t.name,runId:e.operationId,turnId:a.batch.turnId,toolCallId:l.id,toolName:l.name,result:dke(i.message,m),isError:i.message.isError,terminate:m,...s?{recovery:!0}:{}}]}},e.context)}async function h4i(t,e,n,r,i){return t.command(async(s,o)=>{let a=await o.getValue(mV(e.operationId,n.turnId,r.sourceIndex),e.context);if(a===void 0)throw new un(`Tool call ${r.resultEntryId} is missing persisted arguments`);return{kind:"commit",writes:[Ga(ZR(e.operationId,r.resultEntryId))],next:s,materialize:()=>a.value,events:()=>[{type:"tool_start",lane:t.name,runId:e.operationId,turnId:n.turnId,toolCallId:i.id,toolName:i.name,args:a.value,recovery:!0}]}},e.context)}function Vqn(t,e,n){return t.command(async(r,i)=>({kind:"return",result:(await i.getValue(ZR(e.operationId,n.resultEntryId),e.context))?.value}),e.context)}async function f4i(t,e){let n=t.readConfig().toolContext;return typeof n=="function"?await n(e.context):n}async function Yqn(t,e,n,r,i,s,o){let a=d4i(t,e,n,r),c=kqn(t,e,n.turnId,r.sourceIndex,r.resultEntryId),u=Promise.resolve(),l=g=>{u=t.emitBatch([{type:"tool_update",lane:t.name,runId:e.operationId,turnId:n.turnId,toolCallId:i.toolCall.id,toolName:i.toolCall.name,partialResult:g,...o?{recovery:!0}:{}}],e.context),u.catch(()=>{})},d;try{d=FHn(i,e.gate,(g,A)=>{l(g),A?.checkpoint===!0&&c.write(g)},s,a.invocation,e.context)}catch(g){if(a.expire(),c.seal(),await c.drain(),!(g instanceof Jh))throw g;return await g.cancellation,o?Ldt(i.toolCall,void 0):Pke(i.toolCall)}let m=await d.finally(()=>{a.expire(),c.seal()});await u,await c.drain();let h;try{h=await t.hooks.runToolWithGate("after_tool",{lane:t.name,runId:e.operationId,toolCallId:i.toolCall.id,toolName:i.toolCall.name,args:i.args,content:m.result.content,...m.result.details===void 0?{}:{details:m.result.details},isError:m.isError,...m.result.usage===void 0?{}:{usage:m.result.usage}},e.gate,e.context)}catch(g){if(!(g instanceof Jh))throw g;h=void 0}let f=QHn(i,m,h);return{toolCall:f.toolCall,message:pdt(f),terminate:f.terminate}}async function g4i(t,e,n,r,i){let s=yse(n,r);if(n.assistant.stopReason==="length")return{kind:"outcome",outcome:p4i(s)};let o=OHn(s,i);if("kind"in o)return{kind:"outcome",outcome:Wqn(o)};let a;try{a=await t.hooks.runToolWithGate("before_tool",{lane:t.name,runId:e.operationId,toolCallId:s.id,toolName:s.name,args:o.args},e.gate,e.context)}catch(u){if(!(u instanceof Jh))throw u;return await u.cancellation,{kind:"outcome",outcome:Pke(s)}}let c=LHn(o,a);return"kind"in c?{kind:"outcome",outcome:Wqn(c)}:{kind:"ready",cleared:c}}async function zqn(t,e,n,r,i,s,o,a){let c=await g4i(t,e,r,i,s);if(c.kind==="outcome")return{completion:NQ(t,e,n,i,c.outcome,a)};let u=await m4i(t,e,n,i,c.cleared.toolCall,c.cleared.args,c.cleared.tool.replay??"never",a);return{completion:u.kind==="cancel_requested"?NQ(t,e,n,i,Pke(c.cleared.toolCall),a):Yqn(t,e,n.batch,u.value,c.cleared,o,a).then(l=>NQ(t,e,n,u.value,l,a))}}async function Kqn(t,e,n,r,i,s,o,a){let c=yse(r,i),u=s.get(c.name);if(!a&&i.replay==="safe"&&u?.replay==="safe"){let d=await h4i(t,e,n.batch,i,c),m={toolCall:c,tool:u,args:d};return{completion:Yqn(t,e,n.batch,i,m,o,!0).then(h=>NQ(t,e,n,i,h,!0))}}let l=await Vqn(t,e,i);return{completion:NQ(t,e,n,i,Ldt(c,l),!0)}}async function Hqn(t,e,n,r,i,s){let{batch:o}=n;for(let a=0;a<=o.calls.length*2+1;a+=1){await Dke(t,e,n,r,s);let c=qqn(t);if(c===void 0)return{kind:"continue"};let u=c.batch.calls.find(d=>d.status!=="completed");if(u===void 0)throw new un("Tool batch remained open after every call completed");if(u.status==="outcome_ready")throw new un("Ready tool outcome was not materialized");if(c.run.control.status==="cancel_requested"){let d=yse(r,u);if(u.status==="planned")await NQ(t,e,c.run,u,Pke(d),s);else{let m=await Vqn(t,e,u);await NQ(t,e,c.run,u,Ldt(d,m),s)}continue}if(i===void 0)throw new un("Running tool batch is missing execution context");await(u.status==="planned"?await zqn(t,e,c.run,r,u,i.tools,i.toolContext,s):await Kqn(t,e,c.run,r,u,i.toolsByName,i.toolContext,!1)).completion}throw new un("Sequential tool batch exceeded its bounded transition count")}async function A4i(t,e,n,r,i,s,o,a){let{batch:c}=n,u=Promise.resolve(),l=()=>{let m=u.then(()=>Dke(t,e,n,r,a));return u=m.catch(()=>{}),m},d=[];for(let m of c.calls){if(m.status==="completed"||m.status==="outcome_ready")continue;let f=(m.status==="planned"?await zqn(t,e,n,r,m,i,o,a):await Kqn(t,e,n,r,m,s,o,t.state.operation.state.control.status==="cancel_requested")).completion.then(async()=>{await l()});f.catch(()=>{}),d.push(f)}return await Promise.all(d),await l(),{kind:"continue"}}async function Mke(t,e,n){let r=n.batch,i=r.calls.some(m=>m.status==="effect_pending"||m.status==="outcome_ready");i&&await t.emitBatch([{type:"turn_start",lane:t.name,runId:e.operationId,turnId:r.turnId,recovery:!0}],e.context);let s=await Uqn(t,e,r);await Dke(t,e,n,s,i);let o=qqn(t);if(o===void 0)return{kind:"continue"};if(o.run.control.status==="cancel_requested")return Hqn(t,e,o.run,s,void 0,i);let a=t.readConfig(),c=new Set(r.configuration.activeToolNames),u=a.tools.filter(m=>c.has(m.name)),l=new Map(u.map(m=>[m.name,m])),d=await f4i(t,e);return n.settings.toolExecution==="sequential"?Hqn(t,e,o.run,s,{tools:u,toolsByName:l,toolContext:d},i):A4i(t,e,o.run,s,u,l,d,i)}var l4i,Mdt,Fdt=v(()=>{p();aV();mdt();yp();Ap();Ase();Gqn();l4i="[Tool execution was interrupted. The preceding output is the latest durable progress snapshot; newer live output may be missing, and the external outcome is unknown.]",Mdt=class extends Error{constructor(){super("Tool invocation no longer owns its durable effect"),this.name="ToolInvocationEnded"}}});async function Jqn(t,e,n,r){let i=n.configuration.model,s=t.models.getModel(i.provider,i.modelId);if(s!==void 0)try{await t.models.cancelDeferred(s,r,{signal:e.closeSignal,telemetryContext:Kh(e.context),timeoutMs:n.streamOptions.timeoutMs,maxRetries:n.streamOptions.maxRetries,maxRetryDelayMs:n.streamOptions.maxRetryDelayMs,headers:n.streamOptions.headers})}catch{}}async function Xqn(t,e,n){return t.settleOperation(n,async(r,i,s,o)=>({kind:"return",result:await Bdt(o,n,e.context)}),e.context)}async function Zqn(t,e,n){return t.settleOperation(n,async(r,i,s,o)=>{if(i.control.status!=="cancel_requested")throw new un("Cancellation reconciliation requires cancelled durable control");let a=Nb(s,"aborted",r.tipId),c=await Bb(o,e.operationId,i,e.context),u=[];if(s.intent.kind==="run"){switch(i.at){case"summary.deciding":case"summary.ready":case"summary.effect_pending":case"summary.retry_wait":if(i.task.boundary.kind!=="resume_checkpoint"||i.task.reason===void 0)throw new un("Cancelled run summary has an invalid result boundary");u.push({type:"compaction_end",lane:t.name,runId:e.operationId,reason:i.task.reason,status:"aborted",endedAt:a.endedAt});break;default:break}u.push({type:"run_end",lane:t.name,runId:e.operationId,status:"aborted",fromTipId:s.sourceTipId,tipId:r.tipId,endedAt:a.endedAt})}else s.intent.kind==="compaction"?u.push({type:"compaction_end",lane:t.name,runId:e.operationId,reason:"manual",status:"aborted",endedAt:a.endedAt}):u.push({type:"navigation_end",lane:t.name,runId:e.operationId,status:"aborted",fromTipId:s.sourceTipId,tipId:r.tipId,endedAt:a.endedAt});return{kind:"finish",writes:c,record:a,materialize:()=>({kind:"settled",outcome:a}),events:()=>u}},e.context)}async function e5n(t,e){let n=t.state.operation;if(n===null||n.meta.operationId!==e.operationId)throw new un(`Drive ${e.operationId} has no matching operation to reconcile`);if(n.state.control.status!=="cancel_requested")throw new un(`Operation ${e.operationId} is not cancelled`);e.beginAbort(Promise.resolve()),e.signalAbort();let r=n.state;switch(r.at){case"assistant.effect_pending":return Ddt(t,e,r);case"tools":return Mke(t,e,r);case"deferred.suspended":{let i=await Xqn(t,e,r);return await Jqn(t,e,r,i),Zqn(t,e,r)}case"deferred.effect_pending":{let i=await Xqn(t,e,r);return await Jqn(t,e,r,i),Ddt(t,e,r)}case"starting":case"checkpoint":case"assistant.ready":case"assistant.retry_wait":case"summary.deciding":case"summary.ready":case"summary.effect_pending":case"summary.retry_wait":case"navigation.ready_to_commit":return Zqn(t,e,r)}}var t5n=v(()=>{p();TE();yp();Ndt();Pdt();dse();Fdt()});function Qdt(t,e){let n=t.state.operation;if(n===null||n.meta.operationId!==e.operationId)throw new un(`Drive ${e.operationId} has no matching current operation`);return n}async function n5n(t,e){let n=Qdt(t,e);if(n.state.control.status==="running")try{await t.hooks.runWithGate("before_drive",{lane:t.name,runId:e.operationId,operation:n.meta.intent.kind},e.gate,e.context)}catch(r){if(!(r instanceof Jh))throw r;await r.cancellation}for(;;){n=Qdt(t,e);let r=n.state,i;try{if(r.control.status==="cancel_requested")i=await e5n(t,e);else switch(r.at){case"starting":i=await Cqn(t,e,r);break;case"checkpoint":i=await Iqn(t,e,r);break;case"assistant.ready":case"assistant.retry_wait":i=await Pqn(t,e,r);break;case"assistant.effect_pending":i=await Fqn(t,e,r);break;case"tools":i=await Mke(t,e,r);break;case"deferred.suspended":case"deferred.effect_pending":i=await Nqn(t,e,r);break;case"summary.deciding":i=await gqn(t,e,r);break;case"summary.ready":i=await yqn(t,e,r);break;case"summary.effect_pending":i=await bqn(t,e,r);break;case"summary.retry_wait":i=await Eqn(t,e,r);break;case"navigation.ready_to_commit":i=await Sqn(t,e,r);break}}catch(o){if(!(o instanceof Jh))throw o;await o.cancellation,i={kind:"continue"}}if(i.kind==="settled")return{kind:"settled",outcome:i.outcome};if(i.kind==="waiting")return i.outcome;let s=Qdt(t,e).state;if(s===r&&s.control.status!=="cancel_requested")throw new un(`Drive procedure made no progress from ${r.at}`)}}var r5n=v(()=>{p();aV();yp();wqn();Ndt();Mqn();t5n();Pdt();fse();Fdt()});function y4i(t){return t===null||typeof t!="object"&&typeof t!="function"?!1:"then"in t&&typeof t.then=="function"}function E4i(t,e){return t.filter(n=>n.kind===e)}function b4i(t,e){let n=new Set(e.map(r=>r.entryId));return t.filter(r=>!n.has(r.entryId))}function _4i(t,e,n){let r=!1,i=!1,s=[],o=[];for(let a of t)a.kind==="write"||a.kind==="nextRun"||a.kind==="steer"&&(e==="all"||!r)||a.kind==="followUp"&&(n==="all"||!i)?(s.push(a),a.kind==="steer"&&(r=!0),a.kind==="followUp"&&(i=!0)):o.push(a);return{selected:s,remainder:o}}function Udt(t){return{compaction:t.compaction,steeringMode:t.steeringMode,followUpMode:t.followUpMode,toolExecution:t.toolExecution}}function xw(t,e,n=t.inbox,r=t.lastOperationId){return{currentOperationId:e,lastOperationId:r,inbox:n}}function Gdt(t,e){return e.type==="message"?{id:t,parentId:null,type:"message",message:e.payload}:{id:t,parentId:null,type:"custom",customType:e.customType,...e.payload===void 0?{}:{data:e.payload}}}function x4i(t){let{state:e}=t;switch(e.at){case"assistant.ready":case"assistant.effect_pending":case"assistant.retry_wait":return e.generationContext.configuration.model;case"tools":return e.batch.configuration.model;case"deferred.suspended":case"deferred.effect_pending":return e.configuration.model;case"summary.ready":case"summary.effect_pending":case"summary.retry_wait":return e.summaryContext.configuration.model;default:return}}var Oke,i5n=v(()=>{p();qo();lke();dV();TE();mdt();fdt();Xie();Rb();yp();Ap();Cdt();fse();r5n();Ase();yV();$Re();Oke=class{name;session;models;hooks;emitBatch;onFault;installWatch;config;stateChange;resolveStateChange;idleOwner;activeDrive;state;closedError;constructor(e,n,r,i,s,o,a,c,u){this.session=n,this.models=r,this.hooks=i,this.name=e,this.state=s,this.onFault=o,this.emitBatch=a,this.installWatch=c,this.config=u;let l;this.stateChange=new Promise(d=>{l=d}),this.resolveStateChange=l}async getTipId(e){return this.assertOpen(),this.state.tipId}async getResult(e,n){return this.assertOpen(),(await this.session.getValue(pV(e),n))?.value}readConfig(){return this.config()}mismatch(e,n,r){return new nV({lane:this.name,expectedOperationId:e,...n===null?{}:{currentOperationId:n},...r===null?{}:{lastOperationId:r},message:`Operation ${e} does not own lane ${JSON.stringify(this.name)}`})}async readLane(e,n){this.assertOpen();try{return await this.session.mutate(async r=>{this.assertOpen();try{return await e(this.state,r)}catch(i){throw this.closedError!==void 0?this.closedError:this.onFault(i,n)}},n)}catch(r){throw this.closedError!==void 0?this.closedError:r}}async command(e,n){for(this.assertOpen();this.idleOwner!==void 0;)await VR(Promise.race([this.idleOwner,this.stateChange]),n),this.assertOpen();let r;try{r=await this.session.mutate(async i=>{if(this.assertOpen(),this.idleOwner!==void 0)return{kind:"idle_blocked",owner:this.idleOwner,change:this.stateChange};try{let s=await e(this.state,i);switch(s.kind){case"return":return{kind:"return",result:s.result};case"reject":return{kind:"reject",error:s.error};case"commit":{let o=await i.commit(s.writes,n);this.state=s.next,this.signalStateChange();let a=s.materialize(o);if(y4i(a))throw new TypeError("Lane command materialize() must be synchronous");let c=s.events?.(o)??[],u=c.length===0?void 0:this.emitBatch(c,n);return{kind:"return",result:a,...u===void 0?{}:{delivery:u}}}}}catch(s){throw this.closedError!==void 0?this.closedError:this.onFault(s,n)}},n)}catch(i){throw this.closedError!==void 0?this.closedError:i}if(r.kind==="idle_blocked")return await VR(Promise.race([r.owner,r.change]),n),this.assertOpen(),this.command(e,n);if(r.kind==="reject")throw r.error;return await r.delivery,r.result}settleOperation(e,n,r){return this.command(async(i,s)=>{let o=i.operation,a=await n(i,o.state,o.meta,s);if(a.kind==="commit")return{kind:"commit",writes:[...a.writes,fr(gS(o.meta.operationId),a.operationState),...a.lane?.inbox===void 0?[]:[fr(Ml(this.name),xw(i,o.meta.operationId,a.lane.inbox))]],next:{...i,...a.lane,operation:{meta:o.meta,state:a.operationState}},materialize:a.materialize,...a.events===void 0?{}:{events:a.events}};if(a.kind!=="finish")return a;let c=a.lane?.inbox??i.inbox;return{kind:"commit",writes:[...a.writes,fr(pV(o.meta.operationId),a.record),fr(Ml(this.name),xw(i,null,c,o.meta.operationId))],next:{...i,...a.lane,inbox:c,lastOperationId:o.meta.operationId,operation:null},materialize:a.materialize,...a.events===void 0?{}:{events:a.events}}},r)}continueOperation(e,n,r){return this.settleOperation(e,async(i,s,o,a)=>{if(s.control.status==="cancel_requested")return{kind:"return",result:{kind:"cancel_requested"}};let c=await n(i,s,o,a);return c.kind==="return"?{kind:"return",result:{kind:"result",value:c.result}}:{...c,materialize:u=>({kind:"result",value:c.materialize(u)})}},r)}async accept(e,n){if(this.closedError instanceof _g)return Ir.err(new wE({message:this.closedError.message}));this.assertOpen();let r=Date.now(),i=e.operationId??this.session.idGenerator.next(r),s=this.readConfig();return e.kind==="compaction"?this.acceptCompaction(e,i,r,s,n):e.kind==="navigation"?this.acceptNavigation(e,i,r,s,n):this.acceptRun(e,i,r,s,n)}async acceptRun(e,n,r,i,s){let o;switch(e.kind){case"prompt":if(typeof e.prompt!="string")o=Array.isArray(e.prompt)?e.prompt:[e.prompt];else{let c=e.images??[];o=e.prompt.length===0&&c.length===0?[]:[{role:"user",content:[...e.prompt.length===0?[]:[{type:"text",text:e.prompt}],...c],timestamp:r}]}break;case"skill":{let c=i.resources.skills?.find(u=>u.name===e.name);if(c===void 0)return Ir.err(new sV({name:e.name,message:`Unknown skill: ${e.name}`}));o=[{role:"user",content:[{type:"text",text:Sdt(c,e.additionalInstructions)}],timestamp:r}];break}case"prompt_template":{let c=i.resources.promptTemplates?.find(l=>l.name===e.name);if(c===void 0)return Ir.err(new oV({name:e.name,message:`Unknown prompt template: ${e.name}`}));let u=hdt(c,e.args);o=u.length===0?[]:[{role:"user",content:[{type:"text",text:u}],timestamp:r}];break}}for(let c of o)if(c.role==="assistant"&&c.stopReason==="pending")return Ir.err(new gw({lane:this.name,reason:"pending_assistant",message:"Cannot accept a pending assistant message"}));let a=o.map(c=>({id:this.session.idGenerator.next(r),message:c}));return this.command(async(c,u)=>{if(c.operation!==null)return{kind:"return",result:Ir.err(new jD({lane:this.name,operationId:c.operation.meta.operationId,operationKind:c.operation.meta.intent.kind,message:`Lane ${JSON.stringify(this.name)} already has an active operation`}))};let{selected:l,remainder:d}=_4i(c.inbox,i.steeringMode,i.followUpMode),m=await Promise.all(l.map(async S=>{let C=await u.getValue(ll(S.entryId),s);if(C===void 0)throw new un(`Pending ${S.kind} entry ${S.entryId} is missing its payload`);if(S.kind!=="write"&&C.value.type!=="message")throw new un(`Pending ${S.kind} entry ${S.entryId} is not a message`);if(C.value.type==="message"&&C.value.payload.role==="assistant"&&C.value.payload.stopReason==="pending")throw new un(`Pending ${S.kind} entry ${S.entryId} contains a pending assistant`);return{item:S,pending:C.value}})),h=l.some(S=>S.kind!=="write");if(a.length===0&&!h)return{kind:"return",result:Ir.err(new gw({lane:this.name,reason:"empty",message:"Acceptance must append at least one message"}))};let f=use(c.tipId,[...m.map(({item:S,pending:C})=>Gdt(S.entryId,C)),...a.map(({id:S,message:C})=>({id:S,parentId:null,type:"message",message:C}))]),g=f[f.length-1].id,A={operationId:n,lane:this.name,sourceTipId:c.tipId,startedAt:r,intent:{kind:"run",promptEntryIds:a.map(({id:S})=>S)}},y={at:"starting",control:{status:"running"},settings:Udt(i),latestAssistantEntryId:null},E=await _w(u,d,s),_={...c,tipId:g,inbox:d,operation:{meta:A,state:y}};return{kind:"commit",writes:[...f.map(S=>gp(S)),...l.map(S=>Ga(ll(S.entryId))),fr(Mo(this.name),g),fr(XR(n),A),fr(gS(n),y),fr(Ml(this.name),xw(c,n,d))],next:_,materialize:()=>Ir.ok({operationId:n,kind:"run",startedAt:r}),events:S=>{let C=[{type:"run_start",runId:n,startedAt:r,lane:this.name},...bw(f,S,this.name,n)];return l.length>0&&C.push({type:"queue_update",queues:E,lane:this.name}),C}}},s)}acceptCompaction(e,n,r,i,s){let o=this.session.idGenerator.next(r);return this.command(async(a,c)=>{if(a.operation!==null)return{kind:"return",result:Ir.err(new jD({lane:this.name,operationId:a.operation.meta.operationId,operationKind:a.operation.meta.intent.kind,message:`Lane ${JSON.stringify(this.name)} already has an active operation`}))};let u=a.tipId===null?[]:(await c.scanBranch({start:a.tipId,stopAtType:"compaction",order:"newestFirst"},s)).reverse(),l=TQ(u,i.compaction);if(!l.ok)throw l.error;if(l.value===void 0)return{kind:"return",result:Ir.err(new iV({lane:this.name,message:`Lane ${JSON.stringify(this.name)} has nothing to compact`}))};let d={operationId:n,lane:this.name,sourceTipId:a.tipId,startedAt:r,intent:{kind:"compaction",...e.customInstructions===void 0?{}:{customInstructions:e.customInstructions}}},m={at:"summary.deciding",control:{status:"running"},settings:Udt(i),latestAssistantEntryId:null,task:{taskId:o,reason:"manual",...e.customInstructions===void 0?{}:{customInstructions:e.customInstructions},boundary:{kind:"finish"}}};return{kind:"commit",writes:[fr(AS(n,o),Tke(l.value)),fr(XR(n),d),fr(gS(n),m),fr(Ml(this.name),xw(a,n))],next:{...a,operation:{meta:d,state:m}},materialize:()=>Ir.ok({operationId:n,kind:"compaction",startedAt:r}),events:()=>[{type:"compaction_start",lane:this.name,runId:n,reason:"manual",startedAt:r}]}},s)}async acceptNavigation(e,n,r,i,s){let o=this.session.idGenerator.next(r),a=e.targetId,c=e.options??{},u=c.summarize??!1;for(;;){let l=this.state.tipId,d;if(u&&l!==null&&a!==null&&(await this.session.getEntries([a],s)).has(a)){let[f,g]=await Promise.all([this.session.scanBranch({start:l,order:"newestFirst"},s),this.session.scanBranch({start:a,order:"newestFirst"},s)]),A=new Set(f.map(E=>E.id)),y=g.find(E=>A.has(E.id))?.id??null;d=lse(f.slice(0,y===null?f.length:f.findIndex(E=>E.id===y)).reverse())}let m=await this.command(async(h,f)=>{if(h.operation!==null)return{kind:"return",result:Ir.err(new jD({lane:this.name,operationId:h.operation.meta.operationId,operationKind:h.operation.meta.intent.kind,message:`Lane ${JSON.stringify(this.name)} already has an active operation`}))};if(h.tipId!==l)return{kind:"return",result:void 0};if(a===h.tipId)return{kind:"return",result:Ir.err(new VD({lane:this.name,reason:"current_tip",message:"Navigation target must differ from the current tip"}))};if(a===null&&c.label!==void 0)return{kind:"return",result:Ir.err(new VD({lane:this.name,reason:"root_label",message:"Root navigation cannot set a label"}))};if(u&&(h.tipId===null||a===null))return{kind:"return",result:Ir.err(new VD({lane:this.name,reason:h.tipId===null?"source_root":"target_root",message:"Summarized navigation requires non-root source and target entries"}))};if(a!==null&&!(await f.getEntries([a],s)).has(a))return{kind:"return",result:Ir.err(new qR({targetId:a,message:`Unknown target: ${a}`}))};let g={kind:"navigation",targetId:a,summarize:u,...c.label===void 0?{}:{label:c.label},...c.customInstructions===void 0?{}:{customInstructions:c.customInstructions}},A={operationId:n,lane:this.name,sourceTipId:h.tipId,startedAt:r,intent:g},y={control:{status:"running"},settings:Udt(i),latestAssistantEntryId:null},E,_=[];if(u){if(h.tipId===null||a===null||d===void 0)throw new un("Validated summarized navigation is missing its preparation");_.push(fr(AS(n,o),dqn(d))),E={...y,at:"summary.deciding",task:{taskId:o,...c.customInstructions===void 0?{}:{customInstructions:c.customInstructions},boundary:{kind:"commit_navigation",targetId:a,...c.label===void 0?{}:{label:c.label}}}}}else E={...y,at:"navigation.ready_to_commit",targetId:a,...c.label===void 0?{}:{label:c.label}};return _.push(fr(XR(n),A),fr(gS(n),E),fr(Ml(this.name),xw(h,n))),{kind:"commit",writes:_,next:{...h,operation:{meta:A,state:E}},materialize:()=>Ir.ok({operationId:n,kind:"navigation",startedAt:r}),events:()=>[{type:"navigation_start",lane:this.name,runId:n,targetId:a,startedAt:r}]}},s);if(m!==void 0)return m}}async drive(e,n){if(this.closedError instanceof _g)return Ir.err(new wE({message:this.closedError.message}));for(this.assertOpen();;){let r=await this.command(async(i,s)=>{let o=n.abortSignal;if(o?.aborted){let c=o.reason;return{kind:"reject",error:c instanceof Error?c:new DOMException("The operation was aborted","AbortError")}}if(i.operation?.meta.operationId===e.operationId){if(this.activeDrive===void 0){let c=new GRe(e,n);return this.activeDrive=c,this.signalStateChange(),{kind:"return",result:{kind:"observe",drive:c,installed:!0}}}return{kind:"return",result:this.activeDrive.operationId===e.operationId?{kind:"observe",drive:this.activeDrive,installed:!1}:{kind:"occupied",drive:this.activeDrive}}}let a=await s.getValue(pV(e.operationId),n);return a===void 0?{kind:"return",result:{kind:"mismatch",error:this.mismatch(e.operationId,i.operation?.meta.operationId??null,i.lastOperationId)}}:{kind:"return",result:{kind:"settled",outcome:a.value}}},n);if(r.kind==="settled")return Ir.ok({kind:"settled",outcome:r.outcome});if(r.kind==="mismatch")return Ir.err(r.error);if(r.kind==="occupied"){await VR(r.drive.completion,n);continue}return r.installed&&n5n(this,r.drive).then(i=>{this.activeDrive===r.drive&&(this.activeDrive=void 0,this.signalStateChange()),r.drive.settle(i)},i=>{let s=this.closedError;if(s===void 0)try{s=this.onFault(i,r.drive.context)}catch(o){s=o}this.activeDrive===r.drive&&(this.activeDrive=void 0,this.signalStateChange()),r.drive.fail(s)}),Ir.ok(await VR(r.drive.completion,n))}}async requestOperationAbort(e,n){if(this.closedError instanceof _g)return Ir.err(new wE({message:this.closedError.message}));this.assertOpen();let r=this.activeDrive?.operationId===e?this.activeDrive:void 0,i,s,o=new Promise((u,l)=>{i=u,s=l});o.catch(()=>{}),r?.beginAbort(o);let a=!1,c=u=>{a||(a=!0,i(),u&&r?.signalAbort())};try{let u=await this.command(async(l,d)=>{let m=l.operation;if(m?.meta.operationId!==e)return{kind:"return",result:Ir.err(this.mismatch(e,m?.meta.operationId??null,l.lastOperationId))};if(m.state.control.status==="cancel_requested")return{kind:"return",result:Ir.ok({operationId:e,newlyRequested:!1,steer:[],followUp:[]})};let h=l.inbox.filter(C=>C.kind==="steer"||C.kind==="followUp"),f=await Promise.all(h.map(async C=>{let I=await d.getValue(ll(C.entryId),n);if(I?.value.type!=="message")throw new un(`Pending ${C.kind} entry ${C.entryId} is missing its message`);return{item:C,message:I.value.payload}})),g=f.filter(({item:C})=>C.kind==="steer").map(({message:C})=>C),A=f.filter(({item:C})=>C.kind==="followUp").map(({message:C})=>C),y=new Set(h.map(C=>C.entryId)),E=l.inbox.filter(C=>!y.has(C.entryId)),_=await _w(d,E,n),S={...m.state,control:{status:"cancel_requested",requestedAt:Date.now()}};return{kind:"commit",writes:[...h.map(C=>Ga(ll(C.entryId))),fr(gS(e),S),fr(Ml(this.name),xw(l,e,E))],next:{...l,inbox:E,operation:{meta:m.meta,state:S}},materialize:()=>(c(!0),Ir.ok({operationId:e,newlyRequested:!0,steer:g,followUp:A})),events:()=>[{type:"operation_abort",operationId:e,steer:g,followUp:A,lane:this.name},...h.length===0?[]:[{type:"queue_update",queues:_,lane:this.name}]]}},n);return c(u.ok&&u.value.newlyRequested===!1),u}catch(u){throw a||s(u),u}}requestAbort(e,n){return this.requestOperationAbort(e,n)}inspectExecution(e){return this.readLane(n=>{let r=n.operation,i=r===null?void 0:x4i(r),s=r===null?null:{id:r.meta.operationId,kind:r.meta.intent.kind,status:r.state.control.status==="cancel_requested"?"aborting":"open",startedAt:r.meta.startedAt,...i===void 0?{}:{capturedModel:i}};return{lane:this.name,tipId:n.tipId,configuredModel:n.configuration.model,current:s,lastOperationId:n.lastOperationId}},e)}async prompt(...e){return e.length===3?this.driveRunRequest({kind:"prompt",prompt:e[0],...e[1]===void 0?{}:{images:e[1]}},e[2]):this.driveRunRequest({kind:"prompt",prompt:e[0]},e[1])}skill(e,n,r){return this.driveRunRequest({kind:"skill",name:e,...n===void 0?{}:{additionalInstructions:n}},r)}promptFromTemplate(e,n,r){return this.driveRunRequest({kind:"prompt_template",name:e,...n===void 0?{}:{args:n}},r)}async driveRunRequest(e,n){let r=await this.accept(e,n);if(!r.ok)switch(r.error._tag){case"LaneBusy":case"InvalidMessage":case"UnknownSkill":case"UnknownTemplate":case"Closed":return Ir.err(r.error);default:throw this.onFault(new un(`Run acceptance returned ${r.error._tag}`),n)}let i=await this.drive({operationId:r.value.operationId,waitForRetry:!0},n);if(!i.ok){if(i.error._tag==="Closed")return Ir.err(i.error);throw this.onFault(new un(`Accepted run ${r.value.operationId} no longer matches its lane`),n)}if(i.value.kind==="settled")return Ir.ok(i.value.outcome);if(i.value.reason==="deferred")return Ir.ok({operationId:r.value.operationId,status:"suspended",deferred:i.value.deferred});throw this.onFault(new un(`Run ${r.value.operationId} returned an unwaited retry`),n)}async compact(e,n){let r=await this.accept({kind:"compaction",...e?.customInstructions===void 0?{}:{customInstructions:e.customInstructions}},n);if(!r.ok)switch(r.error._tag){case"LaneBusy":case"NothingToCompact":case"Closed":return Ir.err(r.error);default:throw this.onFault(new un(`Compaction acceptance returned ${r.error._tag}`),n)}let i=await this.driveStructuralAdmission(r.value,n);if(!i.ok)return i;let s=await this.continueAfterStructural(i.value,n);return s.ok?Ir.ok({compaction:i.value,...s.value===void 0?{}:{run:s.value}}):s}async navigateTree(e,n,r){let i=await this.accept({kind:"navigation",targetId:e,...n===void 0?{}:{options:n}},r);if(!i.ok)switch(i.error._tag){case"LaneBusy":case"InvalidNavigation":case"UnknownTarget":case"Closed":return Ir.err(i.error);default:throw this.onFault(new un(`Navigation acceptance returned ${i.error._tag}`),r)}let s=await this.driveStructuralAdmission(i.value,r);if(!s.ok)return s;let o=await this.continueAfterStructural(s.value,r);return o.ok?Ir.ok({navigation:s.value,...o.value===void 0?{}:{run:o.value}}):o}async driveStructuralAdmission(e,n){let r=await this.drive({operationId:e.operationId,waitForRetry:!0},n);if(!r.ok){if(r.error._tag==="Closed")return Ir.err(r.error);throw this.onFault(new un(`Accepted ${e.kind} ${e.operationId} no longer matches its lane`),n)}if(r.value.kind==="settled")return Ir.ok(r.value.outcome);throw this.onFault(new un(`${e.kind} ${e.operationId} returned ${r.value.reason}`),n)}async continueAfterStructural(e,n){if(e.status==="aborted")return Ir.ok(void 0);let r=await this.accept({kind:"prompt",prompt:""},n);if(!r.ok)switch(r.error._tag){case"InvalidMessage":case"LaneBusy":return Ir.ok(void 0);case"Closed":return Ir.err(r.error);default:throw this.onFault(new un(`Structural continuation acceptance returned ${r.error._tag}`),n)}let i=await this.drive({operationId:r.value.operationId,waitForRetry:!0},n);if(!i.ok){if(i.error._tag==="Closed")return Ir.err(i.error);throw this.onFault(new un(`Continuation run ${r.value.operationId} no longer matches its lane`),n)}if(i.value.kind==="settled")return Ir.ok(i.value.outcome);if(i.value.reason==="deferred")return Ir.ok({operationId:r.value.operationId,status:"suspended",deferred:i.value.deferred});throw this.onFault(new un(`Continuation run ${r.value.operationId} returned an unwaited retry`),n)}async resume(e){if(this.closedError instanceof _g)return Ir.err(new wE({message:this.closedError.message}));this.assertOpen();let n=await this.command(i=>{let s=i.operation;return s===null?{kind:"return",result:Ir.err(new rV({lane:this.name,message:`Lane ${JSON.stringify(this.name)} has no active operation to resume`}))}:{kind:"return",result:Ir.ok({operationId:s.meta.operationId})}},e);if(!n.ok)return n;let r=await this.drive({operationId:n.value.operationId,pollDeferred:!0,waitForRetry:!0},e);if(!r.ok){if(r.error._tag==="Closed")return Ir.err(r.error);throw this.onFault(new un(`Operation ${n.value.operationId} no longer matches its lane`),e)}if(r.value.kind==="settled")return Ir.ok(r.value.outcome);if(r.value.reason==="deferred")return Ir.ok({operationId:n.value.operationId,status:"suspended",deferred:r.value.deferred});throw this.onFault(new un(`Operation ${n.value.operationId} returned an unwaited retry`),e)}async abort(e){if(this.closedError instanceof _g)return Ir.err(new wE({message:this.closedError.message}));this.assertOpen();let n=await this.command(s=>({kind:"return",result:s.operation?.meta.operationId}),e);if(n===void 0)return Ir.err(new xQ({lane:this.name,message:`Lane ${JSON.stringify(this.name)} has no active operation`}));let r=await this.requestAbort(n,e);if(!r.ok)return r.error._tag==="Closed"?Ir.err(r.error):Ir.err(new xQ({lane:this.name,message:`Lane ${JSON.stringify(this.name)} no longer has the inspected operation`}));let i=await this.drive({operationId:n},e);if(!i.ok&&i.error._tag==="Closed")return Ir.err(i.error);if(!i.ok)throw this.onFault(new un(`Cancelled operation ${n} no longer matches its lane`),e);return Ir.ok({operationId:n,steer:r.value.steer,followUp:r.value.followUp})}steer(e,n,r){return this.enqueue("steer",e,n,r)}followUp(e,n,r){return this.enqueue("followUp",e,n,r)}nextRun(e,n,r){return this.enqueue("nextRun",e,n,r)}async enqueue(e,n,r,i){if(this.closedError instanceof _g)return Ir.err(new wE({message:this.closedError.message}));this.assertOpen();let s=Date.now(),o;if(typeof n=="string"){if(n.length===0&&(r===void 0||r.length===0))return Ir.err(new gw({lane:this.name,reason:"empty",message:"Queued input must contain text or an image"}));o={role:"user",content:[...n.length===0?[]:[{type:"text",text:n}],...r??[]],timestamp:s}}else{if(n.role==="assistant"&&n.stopReason==="pending")return Ir.err(new gw({lane:this.name,reason:"pending_assistant",message:"Cannot queue a pending assistant message"}));if(r!==void 0&&r.length>0&&n.role!=="user")return Ir.err(new gw({lane:this.name,reason:"images_with_non_user",message:"Images can be added only to queued user messages"}));o=r===void 0||r.length===0||n.role!=="user"?structuredClone(n):{...structuredClone(n),content:[...typeof n.content=="string"?n.content.length===0?[]:[{type:"text",text:n.content}]:n.content,...r]}}let a=this.session.idGenerator.next(s);return this.command(async(c,u)=>{let l=[...c.inbox,{entryId:a,kind:e}],d=[...await _w(u,c.inbox,i),{entryId:a,kind:e,type:"message",message:o}];return{kind:"commit",writes:[fr(ll(a),{type:"message",payload:o}),fr(Ml(this.name),xw(c,c.operation?.meta.operationId??null,l))],next:{...c,inbox:l},materialize:()=>Ir.ok({entryId:a}),events:()=>[{type:"queue_update",queues:d,lane:this.name}]}},i)}async cancelQueued(e,n){return this.closedError instanceof _g?Ir.err(new wE({message:this.closedError.message})):(this.assertOpen(),this.command(async(r,i)=>{let s=r.inbox.find(c=>c.entryId===e);if(s===void 0){let c=(await i.getEntries([e],n)).has(e);return{kind:"return",result:Ir.ok({kind:c?"already_consumed":"not_found"})}}if(await i.getValue(ll(e),n)===void 0)throw new un(`Queued ${s.kind} entry ${e} is missing its payload`);let o=r.inbox.filter(c=>c.entryId!==e),a=await _w(i,o,n);return{kind:"commit",writes:[Ga(ll(e)),fr(Ml(this.name),xw(r,r.operation?.meta.operationId??null,o))],next:{...r,inbox:o},materialize:()=>Ir.ok({kind:"cancelled"}),events:()=>[{type:"queue_update",queues:a,lane:this.name}]}},n))}async recordUsage(e,n,r){return this.closedError instanceof _g?Ir.err(new wE({message:this.closedError.message})):(this.assertOpen(),this.command(i=>{let s=this.session.idGenerator.next(),o={id:s,usage:e,adjustment:!0,...n?.entryId===void 0?{}:{entryId:n.entryId},...n?.details===void 0?{}:{details:n.details}};return{kind:"commit",writes:[vE(o)],next:i,materialize:()=>Ir.ok({usageId:s}),events:a=>[{type:"usage",lane:this.name,row:{...o,seq:a.seqs[0]},totals:a.stats.usage}]}},r))}async waitForIdle(e){for(;;){let n=await this.command(r=>({kind:"return",result:r.operation===null&&this.activeDrive===void 0?{kind:"idle"}:{kind:"wait",drive:this.activeDrive,change:this.stateChange}}),e);if(n.kind==="idle")return;await VR(n.drive===void 0?n.change:n.drive.completion.then(()=>{}),e)}}async runWhenIdle(e,n){let r,i;for(;;){let s=await this.command(o=>{if(o.operation!==null||this.activeDrive!==void 0)return{kind:"return",result:{kind:"wait",drive:this.activeDrive,change:this.stateChange}};let a,c=new Promise(u=>{a=u});return r=c,i=a,this.idleOwner=c,this.signalStateChange(),{kind:"return",result:{kind:"claimed"}}},n);if(s.kind==="claimed")break;await VR(s.drive===void 0?s.change:s.drive.completion.then(()=>{}),n)}if(r===void 0||i===void 0)throw this.onFault(new un("Idle callback claim was not published"),n);try{this.assertOpen(),await e(n)}finally{this.idleOwner===r&&(this.idleOwner=void 0),i(),this.signalStateChange()}}async getModel(e){return this.assertOpen(),this.models.getModel(this.state.configuration.model.provider,this.state.configuration.model.modelId)}setModel(e,n){return this.setConfiguration(r=>({...r,model:{...e}}),(r,i)=>({type:"config_update",property:"model",previous:r.model,value:i.model}),n)}async getThinkingLevel(e){return this.assertOpen(),this.state.configuration.thinkingLevel}setThinkingLevel(e,n){return this.setConfiguration(r=>({...r,thinkingLevel:e}),(r,i)=>({type:"config_update",property:"thinkingLevel",previous:r.thinkingLevel,value:i.thinkingLevel}),n)}async getActiveTools(e){return this.assertOpen(),this.state.configuration.activeToolNames}setActiveTools(e,n){return this.setConfiguration(r=>({...r,activeToolNames:e}),(r,i)=>({type:"config_update",property:"activeTools",previous:r.activeToolNames,value:i.activeToolNames}),n)}watch(e){return this.readLane(async(n,r)=>{let i=this.installWatch({},s=>s.type==="usage"||!("lane"in s)||s.lane===this.name,e,(s,o)=>this.readLane(async(a,c)=>{let u=await this.captureLaneSnapshot(a,c,s);return o(),u},s));try{return i.snapshot=await this.captureLaneSnapshot(n,r,e),i}catch(s){throw i.unsubscribe(),s}},e)}async captureLaneSnapshot(e,n,r){let i=structuredClone(e),s=i.tipId===null?[]:(await n.scanBranch({start:i.tipId,stopAtType:"compaction",order:"newestFirst"},r)).reverse(),o=await _w(n,i.inbox,r),a;if(i.lastOperationId!==null){let d=await n.getValue(pV(i.lastOperationId),r);if(d===void 0)throw new un(`Lane ${JSON.stringify(this.name)} is missing result ${i.lastOperationId}`);a=d.value}let c=await n.getStats(r),u=i.operation,l=null;if(u!==null){let d=[],m,h,f,g=async y=>W4(await gse(n,u.meta.operationId,y,r)),A=u.state;switch(A.at){case"assistant.retry_wait":h={attempt:A.nextAttempt,maxAttempts:A.generationContext.retryPolicy.maxAttempts,nextAttemptAt:A.notBefore};break;case"assistant.effect_pending":m=await g(A.responseEntryId);break;case"deferred.suspended":case"deferred.effect_pending":{let y=(await n.getEntries([A.sourceEntryId],r)).get(A.sourceEntryId);if(y?.type!=="message"||y.message.role!=="assistant"||y.message.deferred===void 0)throw new un("Deferred source is missing its assistant handle");f={handle:y.message.deferred,poll:A.poll},A.at==="deferred.effect_pending"&&(m=await g(A.responseEntryId));break}case"tools":{let{batch:y}=A,E=(await n.getEntries([y.assistantEntryId],r)).get(y.assistantEntryId);if(E?.type!=="message"||E.message.role!=="assistant")throw new un("Tool batch assistant entry is invalid");for(let _ of y.calls){if(_.status==="planned"||_.status==="completed")continue;let S=E.message.content[_.sourceIndex];if(S?.type!=="toolCall")throw new un(`Tool call source index ${_.sourceIndex} does not name a tool-call block`);let C=await n.getValue(mV(u.meta.operationId,y.turnId,_.sourceIndex),r);if(_.status==="effect_pending"){if(C===void 0)throw new un(`Tool call ${S.id} is missing persisted arguments`);let w=await n.getValue(ZR(u.meta.operationId,_.resultEntryId),r);d.push({status:"running",toolCallId:S.id,toolName:S.name,args:C.value,...w===void 0?{}:{result:w.value}});continue}let I=await n.getValue(ll(_.resultEntryId),r);if(I?.value.type!=="message"||I.value.payload.role!=="toolResult")throw new un(`Tool call ${_.resultEntryId} is missing its staged result`);if(I.value.payload.toolCallId!==S.id||I.value.payload.toolName!==S.name)throw new un(`Tool call ${_.resultEntryId} has a mismatched staged result`);d.push({status:"settled",toolCallId:S.id,toolName:S.name,args:C?.value??S.arguments,result:dke(I.value.payload,_.terminate),isError:I.value.payload.isError})}break}case"summary.retry_wait":h={attempt:A.nextAttempt,maxAttempts:A.summaryContext.retryPolicy.maxAttempts,nextAttemptAt:A.notBefore};break;default:break}l={id:u.meta.operationId,kind:u.meta.intent.kind,startedAt:u.meta.startedAt,fromTipId:u.meta.sourceTipId,status:u.state.control.status==="cancel_requested"?"aborting":"open",...h===void 0?{}:{retry:h},...f===void 0?{}:{deferred:f},...m===void 0?{}:{streamingMessage:m},runningTools:d}}return structuredClone({lane:this.name,transcript:s,tipId:i.tipId,...a===void 0?{}:{lastResult:a},configuration:i.configuration,stats:c,operation:l,queues:o,faulted:this.closedError instanceof jR})}async setConfiguration(e,n,r){await this.command(i=>{let s=e(i.configuration);return{kind:"commit",writes:[fr(xg(this.name),s)],next:{...i,configuration:s},materialize:()=>{},events:()=>[{...n(i.configuration,s),lane:this.name}]}},r)}async findEntries(e,n){e??={},this.assertOpen();let r=e.start??this.state.tipId;return r===null?[]:this.session.scanBranch({...e,start:r,order:e.order??"newestFirst"},n)}async findEntry(e,n){return e??={},(await this.findEntries({...e,limit:e.limit===void 0?1:Math.min(e.limit,1)},n))[0]}appendMessage(e,n){return this.append({type:"message",payload:e},n)}appendCustomEntry(e,n,r){return this.append({type:"custom",customType:e,...n===void 0?{}:{payload:n}},r)}append(e,n){if(this.assertOpen(),e.type==="message"&&e.payload.role==="assistant"&&e.payload.stopReason==="pending")return Promise.reject(new KD);let r=this.session.idGenerator.next();return this.command(async(i,s)=>{if(i.operation===null){let u=E4i(i.inbox,"write"),l=await Promise.all(u.map(async f=>{let g=await s.getValue(ll(f.entryId),n);if(g===void 0)throw new un(`Pending write ${f.entryId} is missing its payload`);return Gdt(f.entryId,g.value)})),d=b4i(i.inbox,u),m=u.length===0?void 0:await _w(s,d,n),h=use(i.tipId,[...l,Gdt(r,e)]);return{kind:"commit",writes:[...h.map(f=>gp(f)),...u.map(f=>Ga(ll(f.entryId))),fr(Mo(this.name),r),fr(Ml(this.name),xw(i,null,d))],next:{...i,tipId:r,inbox:d},materialize:()=>r,events:f=>[...bw(h,f,this.name),...m===void 0?[]:[{type:"queue_update",queues:m,lane:this.name}]]}}let o=i.operation,a=[...i.inbox,{entryId:r,kind:"write"}],c=[...await _w(s,i.inbox,n),e.type==="message"?{entryId:r,kind:"write",type:"message",message:e.payload}:{entryId:r,kind:"write",type:"custom",customType:e.customType,...e.payload===void 0?{}:{data:e.payload}}];return{kind:"commit",writes:[fr(ll(r),e),fr(Ml(this.name),xw(i,o.meta.operationId,a))],next:{...i,inbox:a},materialize:()=>r,events:()=>[{type:"queue_update",queues:c,lane:this.name}]}},n)}seal(e){return this.closedError??=e,this.activeDrive?.closeGate(e),this.signalStateChange(),this.idleOwner??Promise.resolve()}signalStateChange(){this.resolveStateChange();let e;this.stateChange=new Promise(n=>{e=n}),this.resolveStateChange=e}assertOpen(){if(this.closedError!==void 0)throw this.closedError}}});function $dt(t){return t.at.startsWith("summary.")}function S4i(t,e){return t.kind==="compaction"?$dt(e)&&e.task.boundary.kind==="finish":t.kind==="navigation"?e.at==="navigation.ready_to_commit"?!t.summarize&&e.targetId===t.targetId&&e.label===t.label:t.summarize&&$dt(e)&&e.task.boundary.kind==="commit_navigation"&&e.task.boundary.targetId===t.targetId&&e.task.boundary.label===t.label&&e.task.customInstructions===t.customInstructions:e.at!=="navigation.ready_to_commit"&&(!$dt(e)||e.task.boundary.kind==="resume_checkpoint")}function s5n(t,e){let{tip:n,configuration:r,laneState:i}=e;if(n===void 0&&r===void 0&&i===void 0)return{kind:"absent"};if(n!==void 0&&r===void 0&&i===void 0)return{kind:"branch",tip:n};if(n===void 0)throw new un(`Lane ${JSON.stringify(t)} is missing branch.tip`);if(r===void 0)throw new un(`Lane ${JSON.stringify(t)} is missing lane.config`);if(i===void 0)throw new un(`Lane ${JSON.stringify(t)} is missing lane.state`);return{kind:"lane",tip:n,configuration:r,laneState:i}}async function o5n(t,e,n){let[r,i,s]=await Promise.all([t.getValue(Mo(e),n),t.getValue(xg(e),n),t.getValue(Ml(e),n)]);return s5n(e,{tip:r,configuration:i,laneState:s})}function a5n(t,e){return t.mutate(async n=>{let[r,i,s]=await Promise.all([n.scanValues(odt(),e),n.scanValues(xg(""),e),n.scanValues(Ml(""),e)]),o=new Map(r.map(d=>[d.address.key,d])),a=new Map(i.map(d=>[d.address.key,d])),c=new Map(s.map(d=>[d.address.key,d])),u=new Set([...o.keys(),...a.keys(),...c.keys()]),l=new Map;for(let d of u){let m=s5n(d,{tip:o.get(d),configuration:a.get(d),laneState:c.get(d)});m.kind==="lane"&&l.set(d,await Wdt(n,d,m,e))}return l},e)}async function Wdt(t,e,n,r){let i=n.laneState.value.currentOperationId,s=null;if(i!==null){let[o,a]=await Promise.all([t.getValue(XR(i),r),t.getValue(gS(i),r)]);if(o===void 0)throw new un(`Operation ${i} is missing op.meta`);if(a===void 0)throw new un(`Operation ${i} is missing op.state`);if(o.value.operationId!==i)throw new un(`Operation ${i} metadata names operation ${JSON.stringify(o.value.operationId)}`);if(o.value.lane!==e)throw new un(`Operation ${i} belongs to lane ${JSON.stringify(o.value.lane)}, not ${JSON.stringify(e)}`);if(!S4i(o.value.intent,a.value))throw new un(`Operation ${i} intent ${o.value.intent.kind} does not match state ${a.value.at}`);s={meta:o.value,state:a.value}}return{tipId:n.tip.value,configuration:n.configuration.value,inbox:n.laneState.value.inbox,lastOperationId:n.laneState.value.lastOperationId,operation:s}}var c5n=v(()=>{p();yp();Ap()});async function l5n(t,e){let n=t.tools??[];zut(n),Kut(t.retry??Yut),Jut(t.compaction??nse);let r={model:{provider:t.model.provider,modelId:t.model.id},thinkingLevel:t.thinkingLevel??"off",activeToolNames:[...t.activeToolNames??n.map(i=>i.name)]};try{let i=await a5n(t.session,e),s=[...i].flatMap(([o,a])=>{let c=a.operation;return c===null?[]:[{lane:o,operationId:c.meta.operationId,kind:c.meta.intent.kind,startedAt:c.meta.startedAt,...c.state.control.status==="cancel_requested"?{aborting:!0}:{}}]});return{harness:new Hdt(t,r,i),open:s}}catch(i){throw new jR("AgentHarness storage or invariant fault",i)}}var Hdt,u5n=v(()=>{p();dV();IHn();wHn();rse();CQ();Xie();yp();Ap();i5n();c5n();$Re();Hdt=class{session;models;hooks;events;lanesByName=new Map;seed;configStore;closePromise;closedError;faultError;constructor(e,n,r){this.session=e.session,this.models=e.models,this.seed=n,this.events=new tke,this.hooks=new rke((i,s,o,a)=>this.events.emit({type:"handler_error",kind:"hook",hook:s,error:i.message,...i.stack===void 0?{}:{stack:i.stack},lane:o},a)),this.configStore={value:{tools:e.tools??[],resources:e.resources??{},streamOptions:e.streamOptions??{},retryPolicy:e.retry??Yut,compaction:e.compaction??nse,steeringMode:e.steeringMode??"all",followUpMode:e.followUpMode??"all",toolExecution:e.toolExecution??"parallel",toolContext:e.toolContext,systemPrompt:e.systemPrompt,toProviderMessages:e.toProviderMessages??(i=>YD(i)),entryProjectors:e.entryProjectors??{}}};for(let[i,s]of r)this.lanesByName.set(i,this.buildLane(i,s))}async lane(e,n,r){if(this.assertOpen(),e.length===0||e.includes("\0")){let c=e.length===0?"lane name must not be empty":"lane name must not contain \\u0000";throw new SQ({lane:e,reason:c,message:`Invalid lane ${JSON.stringify(e)}: ${c}`})}let i=r===void 0?{}:n,s=r??n,o,a;try{await this.session.mutate(async c=>{if(this.assertOpen(),o=this.lanesByName.get(e),o!==void 0)return;let u=await o5n(c,e,s);if(u.kind==="lane"){let f=await Wdt(c,e,u,s);o=this.buildLane(e,f),this.lanesByName.set(e,o);return}let l=u.kind==="branch"?u.tip.value:i.createAt??null;if(u.kind==="absent"&&l!==null&&!(await c.getEntries([l],s)).has(l))throw new qR({targetId:l,message:`Unknown target: ${l}`});let d={model:{...this.seed.model},thinkingLevel:this.seed.thinkingLevel,activeToolNames:[...this.seed.activeToolNames]},m={tipId:l,configuration:d,inbox:[],lastOperationId:null,operation:null},h=[...u.kind==="absent"?[fr(Mo(e),l)]:[],fr(xg(e),d),fr(Ml(e),{currentOperationId:null,lastOperationId:null,inbox:[]})];await c.commit(h,s),o=this.buildLane(e,m),this.lanesByName.set(e,o),a=this.events.emitBatch([{type:"lane_created",lane:e,at:l}],s)},s)}catch(c){throw this.closedError!==void 0?this.closedError:c instanceof SQ||c instanceof qR?c:this.fault(c,s)}if(await a,o===void 0)throw this.fault(new un(`Lane ${JSON.stringify(e)} was not published`),s);return o}async lanes(e){return this.assertOpen(),(await Promise.all([...this.lanesByName.values()].map(r=>r.inspectExecution(e)))).map(r=>({name:r.lane,tipId:r.tipId,operation:r.current}))}getName(e){return this.assertOpen(),this.session.getName(e)}async setName(e,n){this.assertOpen();let r;try{await this.session.mutate(async i=>{this.assertOpen(),await i.commit([e===void 0?Ga(yw):fr(yw,e)],n),r=this.events.emitBatch([{type:"value_update",value:"session_name",name:e}],n)},n)}catch(i){throw this.closedError!==void 0?this.closedError:this.fault(i,n)}await r}getLabel(e,n){return this.assertOpen(),this.session.getLabel(e,n)}async setLabel(e,n,r){this.assertOpen();let i;try{await this.session.mutate(async s=>{this.assertOpen();let o=yS(e);await s.commit([n===void 0?Ga(o):fr(o,n)],r),i=this.events.emitBatch([{type:"value_update",value:"entry_label",targetId:e,label:n}],r)},r)}catch(s){throw this.closedError!==void 0?this.closedError:this.fault(s,r)}await i}getTools(e){return this.getConfig("tools",e)}setTools(e,n){return zut(e),this.setConfig("tools",e,()=>({type:"config_update",property:"tools"}),n)}getResources(e){return this.getConfig("resources",e)}setResources(e,n){return this.setConfig("resources",e,()=>({type:"config_update",property:"resources"}),n)}getStreamOptions(e){return this.getConfig("streamOptions",e)}setStreamOptions(e,n){return this.setConfig("streamOptions",e,(r,i)=>({type:"config_update",property:"streamOptions",previous:r,value:i}),n)}getRetryPolicy(e){return this.getConfig("retryPolicy",e)}setRetryPolicy(e,n){return Kut(e),this.setConfig("retryPolicy",e,(r,i)=>({type:"config_update",property:"retryPolicy",previous:r,value:i}),n)}getCompactionSettings(e){return this.getConfig("compaction",e)}setCompactionSettings(e,n){return Jut(e),this.setConfig("compaction",e,(r,i)=>({type:"config_update",property:"compactionSettings",previous:r,value:i}),n)}getSteeringMode(e){return this.getConfig("steeringMode",e)}setSteeringMode(e,n){return this.setConfig("steeringMode",e,(r,i)=>({type:"config_update",property:"steeringMode",previous:r,value:i}),n)}getFollowUpMode(e){return this.getConfig("followUpMode",e)}setFollowUpMode(e,n){return this.setConfig("followUpMode",e,(r,i)=>({type:"config_update",property:"followUpMode",previous:r,value:i}),n)}async watchSession(e){throw new cV("watchSession")}fault(e,n){if(this.faultError!==void 0)return this.faultError;if(this.closedError!==void 0)return this.closedError;let r=e instanceof Error?e:new Error(String(e)),i=new jR("AgentHarness storage or invariant fault",r);this.faultError=i;for(let s of this.lanesByName.values())s.seal(i);return this.hooks.close(i),this.events.emit({type:"fault",code:"harness_fault",message:i.message},n),this.events.close(i),i}close(e){if(this.closePromise!==void 0)return this.closePromise;let n=new _g;this.closedError=n;let r=[...this.lanesByName.values()].map(s=>s.seal(n));this.hooks.close(n),this.events.close(n);let i=this.session.close(e);return this.closePromise=Promise.all([i,...r]).then(()=>{}),this.closePromise}buildLane(e,n){return new Oke(e,this.session,this.models,this.hooks,n,(r,i)=>this.fault(r,i),(r,i)=>this.events.emitBatch(r,i),(r,i,s,o)=>this.events.watch(r,i,s,o),()=>this.configStore.value)}async getConfig(e,n){return this.assertOpen(),this.configStore.value[e]}async setConfig(e,n,r,i){this.assertOpen();let s=this.configStore.value[e];this.configStore.value={...this.configStore.value,[e]:n},await this.events.emit(r(s,n),i)}assertOpen(){if(this.faultError!==void 0)throw this.faultError;if(this.closedError!==void 0)throw this.closedError}}});var C4i,d5n=v(()=>{p();Xie();$Re();u5n();C4i={create:l5n}});function I4i(t,e){let n=t.runningTools.findIndex(r=>r.toolCallId===e.toolCallId);n===-1?t.runningTools.push(e):t.runningTools[n]=e}function RE(t,e){return t.operation?.id===e?t.operation:void 0}function p5n(t,e){if(!("lane"in e&&e.lane!==void 0&&e.lane!==t.lane&&e.type!=="usage"))switch(e.type){case"run_start":t.operation={id:e.runId,kind:"run",startedAt:e.startedAt,fromTipId:t.tipId,status:"open",runningTools:[]};return;case"compaction_start":if(t.operation!==null)return;t.operation={id:e.runId,kind:"compaction",startedAt:e.startedAt,fromTipId:t.tipId,status:"open",runningTools:[]};return;case"navigation_start":t.operation={id:e.runId,kind:"navigation",startedAt:e.startedAt,fromTipId:t.tipId,status:"open",runningTools:[]};return;case"operation_abort":{let n=RE(t,e.operationId);n!==void 0&&(n.status="aborting");return}case"run_resume":{let n=RE(t,e.runId);n!==void 0&&delete n.deferred;return}case"run_suspend":{let n=RE(t,e.runId);if(n===void 0)return;delete n.streamingMessage,n.deferred={handle:e.deferred,poll:e.poll};return}case"retry_scheduled":{let n=RE(t,e.runId);n!==void 0&&(n.retry={attempt:e.attempt,maxAttempts:e.maxAttempts,nextAttemptAt:e.notBefore});return}case"retry_start":case"retry_end":{let n=RE(t,e.runId);n!==void 0&&delete n.retry;return}case"message_start":{if(e.runId===void 0||e.message.role!=="assistant"||e.message.stopReason!=="pending")return;let n=RE(t,e.runId);n!==void 0&&(n.streamingMessage=e.message);return}case"message_update":{if(e.message.role!=="assistant")return;let n=RE(t,e.runId);n!==void 0&&(n.streamingMessage=e.message);return}case"message_end":{if(e.runId===void 0)return;let n=RE(t,e.runId);n!==void 0&&delete n.streamingMessage;return}case"tool_start":{let n=RE(t,e.runId);if(n===void 0)return;I4i(n,{status:"running",toolCallId:e.toolCallId,toolName:e.toolName,args:e.args});return}case"tool_update":{let r=RE(t,e.runId)?.runningTools.find(i=>i.toolCallId===e.toolCallId);r?.status==="running"&&(r.result=e.partialResult);return}case"tool_end":{let n=RE(t,e.runId);if(n===void 0)return;let r=n.runningTools.findIndex(s=>s.toolCallId===e.toolCallId),i=n.runningTools[r];if(i===void 0)return;n.runningTools[r]={status:"settled",toolCallId:e.toolCallId,toolName:e.toolName,args:i.args,result:e.result,isError:e.isError};return}case"entry_added":{if(e.entry.type==="message"&&e.entry.message.role==="toolResult"){let n=t.operation;if(n!==null){let r=e.entry.message.toolCallId,i=n.runningTools.findIndex(s=>s.toolCallId===r);i!==-1&&n.runningTools.splice(i,1)}}e.entry.type==="compaction"?t.transcript.splice(0,t.transcript.length,e.entry):t.transcript.push(e.entry),t.tipId=e.entry.id,e.entry.type==="message"&&(t.stats.messageCount+=1);return}case"queue_update":t.queues=e.queues;return;case"usage":t.stats.usage=e.totals;return;case"config_update":if(!("lane"in e)||e.lane!==t.lane)return;switch(e.property){case"model":t.configuration.model=e.value;return;case"thinkingLevel":t.configuration.thinkingLevel=e.value;return;case"activeTools":t.configuration.activeToolNames=e.value;return}return;case"run_end":{let n=RE(t,e.runId);if(n?.kind!=="run")return;let r={operationId:e.runId,kind:"run",status:e.status,...e.status==="failed"?{error:e.error}:{},fromTipId:e.fromTipId,tipId:e.tipId,startedAt:n.startedAt,endedAt:e.endedAt};t.lastResult=r,t.operation=null,t.tipId=e.tipId;return}case"compaction_end":{let n=RE(t,e.runId);if(n?.kind!=="compaction")return;let r={operationId:e.runId,kind:"compaction",status:e.status,...e.status==="failed"?{error:e.error}:{},fromTipId:n.fromTipId,tipId:t.tipId,startedAt:n.startedAt,endedAt:e.endedAt};t.lastResult=r,t.operation=null;return}case"navigation_end":return"rebase";case"fault":t.faulted=!0;return;case"handler_error":case"turn_start":case"turn_end":case"value_update":case"lane_created":return}}var m5n=v(()=>{p()});function bV(t,e){if(e.tip===void 0)throw new Error(`Unknown source branch: ${t.branch}`);let n=t.entryId??e.tip,r=n===null,i=null,s=e.tip;for(;s!==null;){let o=e.getParent(s);if(o===void 0)throw new Error(`Corrupt source branch: missing parent ${s}`);s===n?(r=!0,i=t.position==="before"?o:s,t.position!=="before"&&e.selectEntry(s)):r&&e.selectEntry(s),s=o}if(!r)throw new Error(`Fork entry ${n} is not on source branch ${JSON.stringify(t.branch)}`);return{scope:"branch",branch:t.branch,destinationTip:i}}function Sw(t,e,n){switch(t.namespace){case"pi.session.name":return t;case"pi.entry.label":return n(t.key)?t:void 0;case"pi.branch.tip":return e.scope==="tree"?t:t.key===e.branch?{...t,value:e.destinationTip}:void 0;case"pi.lane.config":return e.scope==="tree"||t.key===e.branch?t:void 0;case"pi.lane.state":return e.scope==="tree"||t.key===e.branch?{...t,value:{currentOperationId:null,lastOperationId:null,inbox:[]}}:void 0;case"pi.result":return}if(!(t.namespace.startsWith("pi.op.")||t.namespace.startsWith("pi.pending."))){if(t.namespace==="pi"||t.namespace.startsWith("pi."))throw new Error(`Unknown reserved fork namespace: ${t.namespace}`);return e.scope==="tree"?t:void 0}}var Ese=v(()=>{p()});function w4i(t,e){return t.filter(n=>n.address.namespace===e.namespace)}function h5n(t,e){return t.find(n=>n.address.namespace===e.namespace&&n.address.key===e.key)}function f5n(t,e){let n=new Map(t.entries.map(u=>[u.id,u])),r=w4i(t.scalarValues,Mo(""));v4i(t,n,r,e);let{entryIds:i,plan:s}=T4i(n,r,e),o=new Map;for(let u of i)o.set(u,n.get(u));let a=[],c=Math.max(0,...[...o.values()].map(u=>u.seq))+1;for(let u of t.scalarValues){let l=Sw({kind:"value",op:"set",seq:u.seq,namespace:u.address.namespace,key:u.address.key,value:u.value},s,d=>i.has(d));l!==void 0&&a.push({address:nu(l.namespace,l.key),value:l.value,seq:c++})}return{entries:o,scalarValues:a,nextSeq:c}}function T4i(t,e,n){let r=new Set;if(n.scope==="tree"){for(let o of t.keys())r.add(o);return{entryIds:r,plan:{scope:"tree"}}}let i=e.find(o=>o.address.key===n.branch),s=bV(n,{tip:i?.value,getParent:o=>t.get(o)?.parentId,selectEntry:o=>r.add(o)});return{entryIds:r,plan:s}}function v4i(t,e,n,r){let i=new Set(n.map(s=>s.address.key));for(let s of t.scalarValues)if((s.address.namespace===xg("").namespace||s.address.namespace===Ml("").namespace)&&!i.has(s.address.key))throw new Error(`Source session branch ${JSON.stringify(s.address.key)} is missing branch.tip`);for(let s of n){let o=h5n(t.scalarValues,xg(s.address.key)),a=h5n(t.scalarValues,Ml(s.address.key));if(o===void 0!=(a===void 0))throw new Error(`Source session branch ${JSON.stringify(s.address.key)} has incomplete lane state`);if(r.scope==="branch"&&s.address.key===r.branch&&o===void 0)throw new Error(`Source branch ${JSON.stringify(r.branch)} is not a configured AgentLane`);if((t.entriesComplete!==!1||r.scope==="tree")&&s.value!==null&&!e.has(s.value))throw new Error(`Source session branch ${JSON.stringify(s.address.key)} has an unknown tip`)}}var g5n=v(()=>{p();Ese();Ap()});var Db,DQ=v(()=>{p();Db=1});function A5n(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function qdt(t,e){return Number.isSafeInteger(t)&&t>=e}function R4i(t){return A5n(t)&&t.type==="session"&&t.version===3&&typeof t.id=="string"&&typeof t.cwd=="string"&&typeof t.timestamp=="string"&&Number.isFinite(Date.parse(t.timestamp))&&(t.parentSession===void 0||typeof t.parentSession=="string")}function k4i(t){return A5n(t)&&t.kind==="header"&&t.v===4&&typeof t.id=="string"&&typeof t.cwd=="string"&&qdt(t.storageVersion,1)&&qdt(t.createdAt,0)&&(t.nextSeq===void 0||qdt(t.nextSeq,1))&&(t.parentSessionId===void 0||typeof t.parentSessionId=="string")&&(t.legacyParentSessionPath===void 0||typeof t.legacyParentSessionPath=="string")}function PQ(t){let e;try{e=JSON.parse(t)}catch(n){return fp(new Error("Invalid JSONL session header: not valid JSON",{cause:n}))}return k4i(e)?hp({format:"v4",header:e}):R4i(e)?hp({format:"v3-legacy",header:e}):fp(new Error("Unsupported JSONL session header"))}var Lke=v(()=>{p();vb();DQ()});function ho(t,e){if(!t.ok)throw new Error(`${e}: ${t.error.message}`,{cause:t.error});return t.value}async function MQ(t,e,n){let r=ho(await t.readLine(n),`Failed to read JSONL storage ${e}`);if(r===void 0||!r.terminated||r.text==="")throw new Error(`Invalid JSONL storage ${e}: missing header`);let i=PQ(r.text);if(!i.ok)throw new Error(`Invalid JSONL storage ${e}: invalid header`,{cause:i.error});return i.value}function B4i(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function y5n(t,e,n){if(!Number.isSafeInteger(t)||t{ho(await t.appendFile(i,s,n),`Failed to append JSONL storage ${e}`)}),ho(await t.renameFile(i,e,n),`Failed to publish JSONL storage ${e}`)}catch(s){throw await t.remove(i,{force:!0},n),s}}async function bse(t,e,n,r,i){await Vdt(t,e,r,async s=>{await s(`${JSON.stringify(n)} +`),await i(o=>s(`${jdt(o)} +`))})}var _se=v(()=>{p();Lke()});function Qke(t,e){return`${t}\0${e}`}async function E5n(t,e,n){let r=await MQ(t,e.path,n);if(r.format!=="v4")throw new Error(`Invalid JSONL storage ${e.path}: expected format 4 header`);let i=r.header;if(i.id!==e.id||i.cwd!==e.cwd)throw new Error(`Session identity does not match header: ${e.id}`);if(i.storageVersion!==1)throw new Error(`Session ${e.id} uses unsupported storage version ${i.storageVersion}`);return i}function D4i(t,e){if(e===void 0||t.length===0)return!1;let n=t[0],r=t.at(-1);if(n.seq>=e)return!0;if(r.seq>=e)throw new Error(`JSONL transaction crosses fork sequence boundary ${e}`);return!1}async function*b5n(t,e,n,r){for(;;){let i=ho(await t.readLine(r),`Failed to read JSONL fork source ${e}`);if(i===void 0||!i.terminated)break;let s=Fke(i.text);if(D4i(s,n))break;yield s}}function P4i(t,e){if(e.scope==="tree")return{scope:"tree"};let n=bV(e,{tip:t.getBranchTip(e.branch),getParent:r=>t.getParent(r),selectEntry:r=>t.selectEntry(r)});if(!t.hasCompleteLane(e.branch))throw new Error(`Source branch ${JSON.stringify(e.branch)} is not a configured AgentLane`);return n}function M4i(t,e,n,r){switch(t.kind){case"entry":return r(t.id)?t:void 0;case"value":return t.op!=="set"||e.getCurrentScalarSeq(t.namespace,t.key)!==t.seq?void 0:Sw(t,n,r);case"list":return t.op!=="append"||!e.isSurvivingListElement(t.namespace,t.key,t.seq)?void 0:Sw(t,n,r);case"usage":return}}async function O4i(t,e,n){let r=new Ydt;if(t.kind==="legacy-v3"){for(let s of t.normalized.entryStructures())r.applyEntry(s.id,s.parentId);return r.applyWrites(t.normalized.values),{index:r,nextSeq:t.normalized.nextSeq}}let i=ho(await e.openTextLineReader(t.metadata.path,n),`Failed to open JSONL fork source ${t.metadata.path}`);try{let s=await E5n(i,t.metadata,n),o=t.kind==="open"?t.nextSeq:void 0,a=0;for await(let c of b5n(i,t.metadata.path,o,n))r.applyWrites(c),c.length!==0&&(a=c.at(-1).seq);return{index:r,nextSeq:t.kind==="open"?t.nextSeq:Math.max(s.nextSeq??1,a+1)}}finally{await i.close(n)}}async function*L4i(t,e,n,r,i){if(t.kind==="legacy-v3"){yield*t.normalized.writes(i,r);return}let s=ho(await e.openTextLineReader(t.metadata.path,i),`Failed to open JSONL fork source ${t.metadata.path}`);try{await E5n(s,t.metadata,i);for await(let o of b5n(s,t.metadata.path,n,i))yield*o}finally{await s.close(i)}}async function _5n(t,e){let{index:n,nextSeq:r}=await O4i(t.input,t.fileSystem,e),i=t.fork;t.input.kind==="legacy-v3"&&i.scope==="branch"&&i.entryId!==void 0&&(i={...i,entryId:t.input.normalized.translateForkEntryId(i.entryId)});let s=P4i(n,i),o=a=>s.scope==="tree"?!0:n.isEntrySelected(a);await bse(t.fileSystem,t.destinationPath,{...t.destinationHeader,nextSeq:r},e,async a=>{let c=L4i(t.input,t.fileSystem,r,o,e);for await(let u of c){let l=M4i(u,n,s,o);l!==void 0&&await a([l])}})}var Ydt,x5n=v(()=>{p();Ese();_se();DQ();Ydt=class{currentScalarSeqs=new Map;branchTips=new Map;firstSurvivingListSeqs=new Map;entryParents=new Map;copiedEntryIds=new Set;laneConfigs=new Set;laneStates=new Set;applyEntry(e,n){this.entryParents.set(e,n)}applyWrites(e){for(let n of e)switch(n.kind){case"entry":this.applyEntry(n.id,n.parentId);break;case"value":{let r=Qke(n.namespace,n.key);n.op==="delete"?this.currentScalarSeqs.delete(r):this.currentScalarSeqs.set(r,n.seq),this.applyLaneValue(n);break}case"list":{let r=Qke(n.namespace,n.key);n.op==="delete"?this.firstSurvivingListSeqs.delete(r):this.firstSurvivingListSeqs.has(r)||this.firstSurvivingListSeqs.set(r,n.seq);break}case"usage":break}}applyLaneValue(e){let n=e.op==="set";switch(e.namespace){case"pi.branch.tip":n?this.branchTips.set(e.key,e.value):this.branchTips.delete(e.key);break;case"pi.lane.config":n?this.laneConfigs.add(e.key):this.laneConfigs.delete(e.key);break;case"pi.lane.state":n?this.laneStates.add(e.key):this.laneStates.delete(e.key);break}}getBranchTip(e){return this.branchTips.get(e)}hasCompleteLane(e){return this.laneConfigs.has(e)&&this.laneStates.has(e)}getCurrentScalarSeq(e,n){return this.currentScalarSeqs.get(Qke(e,n))}isSurvivingListElement(e,n,r){let i=this.firstSurvivingListSeqs.get(Qke(e,n));return i!==void 0&&r>=i}getParent(e){return this.entryParents.get(e)}selectEntry(e){this.copiedEntryIds.add(e)}isEntrySelected(e){return this.copiedEntryIds.has(e)}}});async function F4i(t,e,n){let r=await t.readTextLines(e,{maxLines:1},n);if(!r.ok||r.value[0]===void 0)return;let i=PQ(r.value[0]);return i.ok?i.value.header.id:void 0}async function zdt(t,e,n){let r={id:e.id,createdAt:Date.parse(e.timestamp),storageVersion:1,cwd:e.cwd};if(e.parentSession!==void 0){let i=await F4i(t,e.parentSession,n);i!==void 0?r.parentSessionId=i:r.legacyParentSessionPath=e.parentSession}return r}async function Q4i(t,e,n){return{v:4,kind:"header",...await zdt(t,e,n)}}function C5n(t){let e;try{e=JSON.parse(t)}catch(r){throw new Error("Invalid legacy v3 JSONL record: not valid JSON",{cause:r})}let n=e?.type;if(n!=="message"&&n!=="custom"&&n!=="custom_message"&&n!=="branch_summary"&&n!=="compaction"&&n!=="model_change"&&n!=="thinking_level_change"&&n!=="active_tools_change"&&n!=="session_info"&&n!=="label")throw new Error(`Unsupported legacy v3 record type: ${String(n)}`);return e}function I5n(t){return{role:"custom",customType:t.customType,content:t.content,details:t.details,display:t.display,timestamp:Date.parse(t.timestamp)}}function OQ(t){return t.type!=="model_change"&&t.type!=="thinking_level_change"&&t.type!=="active_tools_change"&&t.type!=="session_info"&&t.type!=="label"}function w5n(t){return e=>{if(e===null)return null;let n=t.get(e)?.mappedId;if(n===void 0)throw new Error(`Missing legacy v3 entry reference: ${e}`);return n}}function T5n(t,e){return e==="root"?null:t(e)}function U4i(t,e){switch(t.type){case"message":return t.message;case"custom_message":return I5n(t);case"branch_summary":return t.summary?YR(t.summary,T5n(e,t.fromId),t.timestamp):void 0;case"compaction":return zR(t.summary,t.tokensBefore,t.timestamp);case"custom":case"model_change":case"thinking_level_change":case"active_tools_change":case"session_info":case"label":return}}function*S5n(t,e){let n=t.parentId;for(;n!==null;){let r=e.get(n);if(yield r,n===t.firstKeptEntryId)return;n=r.parentId}throw new Error(`Legacy v3 compaction ${t.id} firstKeptEntryId is not on its parent branch: ${t.firstKeptEntryId}`)}function G4i(t,e,n,r){let i={kind:"entry",id:e.mappedId,parentId:r(e.parentId),seq:e.seq,timestamp:Date.parse(t.timestamp)};return t.type==="message"?{...i,type:"message",message:t.message}:t.type==="custom_message"?{...i,type:"message",message:I5n(t)}:t.type==="branch_summary"?{...i,type:"branch_summary",fromId:T5n(r,t.fromId),summary:t.summary,details:t.details,usage:t.usage,fromHook:t.fromHook??!1}:t.type==="compaction"?{...i,type:"compaction",summary:t.summary,retainedTail:n,tokensBefore:t.tokensBefore,details:t.details,usage:t.usage,fromHook:t.fromHook??!1}:{...i,type:"custom",customType:t.customType,data:t.data}}function $4i(t,e){let n=new Set(["model_change","thinking_level_change","active_tools_change"]),r,i,s,o=e;for(;o!==null&&n.size!==0;){let a=t.get(o);if(n.delete(a.type))switch(a.type){case"model_change":r={provider:a.provider,modelId:a.modelId};break;case"thinking_level_change":i=a.thinkingLevel;break;case"active_tools_change":s=[...a.activeToolNames];break}o=a.parentId}if(!(r===void 0||i===void 0))return{model:r,thinkingLevel:i,activeToolNames:s??[]}}function W4i(t,e,n,r){let i=t.parentId===null?null:r.get(t.parentId)?.mappedId;if(i===void 0)throw new Error(`Legacy v3 entry ${t.id} has a missing or forward parent at line ${e}: ${t.parentId}`);let s={id:t.id,parentId:t.parentId,mappedId:i};if(!OQ(t))switch(t.type){case"label":return{...s,type:t.type,targetId:t.targetId,label:t.label};case"model_change":return{...s,type:t.type,provider:t.provider,modelId:t.modelId};case"thinking_level_change":return{...s,type:t.type,thinkingLevel:t.thinkingLevel};case"active_tools_change":return{...s,type:t.type,activeToolNames:t.activeToolNames};case"session_info":return{...s,type:t.type}}if(t.id===null)throw new Error("Legacy v3 entry reference has no retained ancestor: null");let o={...s,mappedId:Oc(Date.parse(t.timestamp)),seq:n};switch(t.type){case"branch_summary":return{...o,type:t.type,fromId:t.fromId};case"compaction":return{...o,type:t.type,firstKeptEntryId:t.firstKeptEntryId};default:return{...o,type:t.type}}}function H4i(t){switch(t.type){case"message":return t.message.role==="assistant"||t.message.role==="toolResult"?t.message.usage:void 0;case"compaction":case"branch_summary":return t.usage;default:return}}async function q4i(t,e){let n=new Map,r=1,i=qRe(),s,o=null;for(;;){let a=ho(await t.readLine(e),"Failed to read legacy v3 source");if(a===void 0||!a.terminated)break;let c=n.size+2,u=C5n(a.text);if(n.has(u.id))throw new Error(`Duplicate legacy v3 entry id: ${u.id}`);let l=W4i(u,c,r,n);n.set(u.id,l),OQ(l)&&r++,o=u.id,u.type==="session_info"&&(s=u.name);let d=H4i(u);d!==void 0&&(i=uV(i,d))}return{entries:n,nextSeq:r,importedUsage:i,name:s,finalId:o}}function j4i(t){let{entries:e,name:n,finalId:r}=t,i=w5n(e),s=t.nextSeq,o=[];n&&o.push({...fr(yw,n),seq:s++});let a=new Map;for(let u of e.values()){if(u.type!=="label")continue;let l=i(u.targetId);l!==null&&(u.label?a.set(l,u.label):a.delete(l))}for(let[u,l]of a)o.push({...fr(yS(u),l),seq:s++});o.push({...fr(Mo("main"),i(r)),seq:s++});let c=$4i(e,r);return c!==void 0&&(o.push({...fr(xg("main"),c),seq:s++}),o.push({...fr(Ml("main"),{currentOperationId:null,lastOperationId:null,inbox:[]}),seq:s++})),o}var xV,Kdt=v(()=>{p();kN();CQ();jRe();Ap();Lke();_se();DQ();xV=class t{header;importedUsage;nextSeq;values;fileSystem;path;entries;resolveLegacyId;constructor(e,n,r,i,s,o,a){this.fileSystem=e,this.path=n,this.header=r,this.entries=i,this.resolveLegacyId=w5n(i),this.importedUsage=s,this.values=o,this.nextSeq=a}static async read(e,n,r){let i=ho(await e.openTextLineReader(n,r),`Failed to open legacy v3 source ${n}`);try{let s=await MQ(i,n,r);if(s.format!=="v3-legacy")throw new Error(`Invalid legacy v3 JSONL storage ${n}: expected format 3 header`);let o=await q4i(i,r),a=j4i(o);return new t(e,n,await Q4i(e,s.header,r),o.entries,o.importedUsage,a,o.nextSeq+a.length)}finally{await i.close(r)}}*entryStructures(){for(let e of this.entries.values())OQ(e)&&(yield{id:e.mappedId,parentId:this.resolveLegacyId(e.parentId),seq:e.seq})}translateForkEntryId(e){let n=this.entries.get(e);if(n===void 0)throw new Error(`Legacy v3 fork entry does not exist: ${e}`);if(!OQ(n))throw new Error(`Legacy v3 fork entry is not a retained entry: ${e}`);return n.mappedId}collectRequiredTailMessageIds(e){let n=new Set;for(let r of this.entries.values())if(!(r.type!=="compaction"||!(e===void 0||e(r.mappedId))))for(let s of S5n(r,this.entries))OQ(s)&&s.type!=="custom"&&n.add(s.id);return n}async*writes(e,n){let r=this.collectRequiredTailMessageIds(n),i=new Map;for await(let{entry:s,indexed:o}of this.readCapturedEntries(e)){if(r.has(s.id)){let c=U4i(s,this.resolveLegacyId);c!==void 0&&i.set(s.id,c)}if(!OQ(o)||!OQ(s)||n!==void 0&&!n(o.mappedId))continue;let a=[];if(o.type==="compaction"){for(let c of S5n(o,this.entries)){let u=i.get(c.id);u!==void 0&&a.push(u)}a.reverse()}yield G4i(s,o,a,this.resolveLegacyId)}yield*this.values}async*readCapturedEntries(e){let n=ho(await this.fileSystem.openTextLineReader(this.path,e),`Failed to reopen legacy v3 source ${this.path}`);try{let r=await MQ(n,this.path,e);if(r.format!=="v3-legacy"||r.header.id!==this.header.id||r.header.cwd!==this.header.cwd)throw new Error("Legacy v3 source header changed");for(let i of this.entries.values()){let s=ho(await n.readLine(e),"Failed to reread legacy v3 source");if(s===void 0||!s.terminated)throw new Error("Legacy v3 source ended before captured entries");let o=C5n(s.text);if(o.id!==i.id||o.type!==i.type)throw new Error("Legacy v3 source changed");yield{entry:o,indexed:i}}}finally{await n.close(e)}}}});function xse(t,e){return`${t}\0${e}`}function V4i(t,e){let n=Array.from(t,s=>s.codePointAt(0)),r=Array.from(e,s=>s.codePointAt(0)),i=Math.min(n.length,r.length);for(let s=0;s{p();jRe();Rb();Ese();Ap();SV=class t{entries;entriesBySeq;scalarValues;listValues;usage;stats;nextSeq;constructor(){this.entries=new Map,this.entriesBySeq=[],this.scalarValues=new Map,this.listValues=new Map,this.usage=new Map,this.stats={messageCount:0,usage:qRe()},this.nextSeq=1}prepareCommit(e,n){let r=ike(e,this.nextSeq,n);return this.validateCommitted(r.writes),r}validateCommitted(e){ske(e,this.nextSeq,{hasEntryOrUsageId:n=>this.entries.has(n)||this.usage.has(n),hasEntryId:n=>this.entries.has(n)})}applyValidated(e){for(let n of e){switch(n.kind){case"entry":{let{kind:r,...i}=n;this.entries.set(i.id,i),this.entriesBySeq.push(i),i.type==="message"&&(this.stats={...this.stats,messageCount:this.stats.messageCount+1});break}case"usage":{let{kind:r,...i}=n;this.usage.set(i.id,i),this.stats={...this.stats,usage:uV(this.stats.usage,i.usage)};break}case"value":n.op==="delete"?this.scalarValues.delete(xse(n.namespace,n.key)):this.applyValueSetOrListAppend(n);break;case"list":n.op==="delete"?this.listValues.delete(xse(n.namespace,n.key)):this.applyValueSetOrListAppend(n);break}this.nextSeq=n.seq+1}return this.stats}createFork(e){let n=this.selectForkPlan(e),r=o=>n.scope==="tree"?!0:n.entryIds.has(o),i=new t,s=0;for(let o of this.entriesBySeq)r(o.id)&&(i.entries.set(o.id,o),i.entriesBySeq.push(o),o.type==="message"&&s++);i.stats={...i.stats,messageCount:s};for(let o of this.scalarValues.values()){let a=Sw({kind:"value",op:"set",seq:o.seq,namespace:o.address.namespace,key:o.address.key,value:o.value},n,r);a!==void 0&&i.applyValueSetOrListAppend(a)}for(let o of this.listValues.values())for(let a of o.elements){let c=Sw({kind:"list",op:"append",seq:a.seq,namespace:o.address.namespace,key:o.address.key,value:a.value},n,r);c!==void 0&&i.applyValueSetOrListAppend(c)}return i.nextSeq=this.nextSeq,i}selectForkPlan(e){if(e.scope==="tree")return{scope:"tree"};let n=new Set,r=bV(e,{tip:this.getValue(Mo(e.branch))?.value,getParent:i=>this.entries.get(i)?.parentId,selectEntry:i=>n.add(i)});if(this.getValue(xg(e.branch))===void 0||this.getValue(Ml(e.branch))===void 0)throw new Error(`Source branch ${JSON.stringify(e.branch)} is not a configured AgentLane`);return{...r,entryIds:n}}applyValueSetOrListAppend(e){let n=xse(e.namespace,e.key);if(e.kind==="value"){this.scalarValues.set(n,{address:nu(e.namespace,e.key),value:e.value,seq:e.seq});return}let r={seq:e.seq,value:e.value},i=this.listValues.get(n);i===void 0?this.listValues.set(n,{address:ake(e.namespace,e.key),elements:[r]}):i.elements.push(r)}advanceNextSeq(e){if(!Number.isSafeInteger(e)||e<1)throw new Error(`Invalid storage sequence high-water mark: ${e}`);this.nextSeq=Math.max(this.nextSeq,e)}getEntries(e){let n=new Map;for(let r of e){let i=this.entries.get(r);i!==void 0&&n.set(r,i)}return n}getValue(e){return this.scalarValues.get(xse(e.namespace,e.key))}scanValues(e){return[...this.scalarValues.values()].filter(n=>n.address.namespace===e.namespace&&n.address.key.startsWith(e.key)).sort((n,r)=>V4i(n.address.key,r.address.key))}readList(e,n){let r=sdt(n),s=(this.listValues.get(xse(e.namespace,e.key))?.elements??[]).filter(a=>r.cursor===void 0?!0:r.order==="asc"?a.seq>r.cursor.seq:a.seqe.type===void 0||a.type===e.type).filter(a=>e.customType===void 0||a.customType===e.customType).filter(a=>e.cursor===void 0||(e.order==="oldestFirst"?a.seq>e.cursor.seq:a.seq({id:n.id,parentId:n.parentId,seq:n.seq,timestamp:n.timestamp,type:n.type,...n.customType===void 0?{}:{customType:n.customType}}))}scanEntries(e){let n=e.limit===void 0?Number.POSITIVE_INFINITY:Math.max(0,Math.trunc(e.limit)),r=[],i=e.order==="desc",s=i?this.entriesBySeq.length-1:0;for(;s>=0&&s=e.fromSeq)&&(e.toSeq===void 0||o.seq<=e.toSeq)&&r.push(o),s+=i?-1:1}return r}scanUsage(e){let n=[...this.usage.values()].filter(r=>e.fromSeq===void 0||r.seq>=e.fromSeq).filter(r=>e.toSeq===void 0||r.seq<=e.toSeq).sort((r,i)=>e.order==="desc"?i.seq-r.seq:r.seq-i.seq);return e.limit===void 0?n:n.slice(0,Math.max(0,e.limit))}getStats(){return this.stats}getNextSeq(){return this.nextSeq}}});function Y4i(t){if(t.endsWith(` `))return{lines:t.slice(0,-1).split(` `),torn:!1};let e=t.lastIndexOf(` `);return e===-1?{lines:[],torn:!0}:{lines:t.slice(0,e).split(` -`),torn:!0}}async function tCe(t,e,n,r){let s=`${e}.tmp`;try{nCe(await t.writeFile(s,n,r),`Failed to stage JSONL storage ${e}`),nCe(await t.renameFile(s,e,r),`Failed to publish JSONL storage ${e}`)}catch(i){throw await t.remove(s,{force:!0},r),i}}var v5=class t{fileSystem;path;now;header;backing;storageState=new T5;commitQueue=Promise.resolve();state="open";closePromise;constructor(e,n,r){this.fileSystem=e.fileSystem,this.path=e.path,this.now=e.now??Date.now,this.header=n,this.backing=r}static async create(e,n,r,s){let i=new t(e,n,{kind:"v4"}),o=i.storageState.prepareCommit(r,i.now()),a=o.writes.length===0?[]:[o.writes];return await tCe(e.fileSystem,e.path,zXe(n,a),s),i.storageState.applyValidated(o.writes),i}static async createFromForkSnapshot(e,n,r,s){let i=ZSe(r),o={...n,nextSeq:r.nextSeq};return await tCe(e.fileSystem,e.path,zXe(o,i.map(a=>[a])),s),t.open(e,s)}static async open(e,n){let r=nCe(await e.fileSystem.readTextFile(e.path,n),`Failed to read JSONL storage ${e.path}`),{lines:s,torn:i}=Ofs(r);if(s[0]===void 0||s[0]==="")throw new Error(`Invalid JSONL storage ${e.path}: missing header`);let o=w5(s[0]);if(!o.ok)throw new Error(`Invalid JSONL storage ${e.path}: invalid header`,{cause:o.error});if(o.value.format==="v3-legacy")return t.openLegacyV3(e,o.value.header,s.slice(1),n);let a=o.value.header;if(a.storageVersion!==1)throw new Error(`Session ${a.id} uses unsupported storage version ${a.storageVersion}`);let c=new t(e,a,{kind:"v4"});for(let u=1;u{p();kN();Rb();Jdt();_se();Kdt();DQ();CV=class t{fileSystem;path;now;header;backing;storageState=new SV;commitQueue=Promise.resolve();state="open";closePromise;constructor(e,n,r){this.fileSystem=e.fileSystem,this.path=e.path,this.now=e.now??Date.now,this.header=n,this.backing=r}static async create(e,n,r,i){let s=new t(e,n,{kind:"v4"}),o=s.storageState.prepareCommit(r,s.now());return await bse(e.fileSystem,e.path,n,i,async a=>{o.writes.length!==0&&await a(o.writes)}),s.storageState.applyValidated(o.writes),s}static async open(e,n){let r=ho(await e.fileSystem.openTextLineReader(e.path,n),`Failed to read JSONL storage ${e.path}`),i=await MQ(r,e.path,n).finally(()=>r.close(n));return i.format==="v3-legacy"?t.openLegacyV3(e,n):t.openV4(e,i.header,n)}static async openV4(e,n,r){let i=ho(await e.fileSystem.readTextFile(e.path,r),`Failed to read JSONL storage ${e.path}`),{lines:s,torn:o}=Y4i(i);if(n.storageVersion!==1)throw new Error(`Session ${n.id} uses unsupported storage version ${n.storageVersion}`);let a=new t(e,n,{kind:"v4"});for(let c=1;cc(`${s.join(` `)} -`,n),c}static async openLegacyV3(e,n,r,s){let{writes:i,importedUsage:o,nextSeq:a}=VEn(r),c={...await WEn(e.fileSystem,n,s),nextSeq:a},u=new t(e,c,{kind:"v3",importedUsage:o,baselineWrites:i});return u.replayCommitted(i),u}replayCommitted(e){this.storageState.validateCommitted(e),this.storageState.applyValidated(e)}async commit(e,n){if(this.state!=="open")throw new Error("JsonlStorage is closed");let r=this.commitQueue.then(()=>this.applyCommit(e,n));return this.commitQueue=r.then(()=>{},()=>{}),r}async applyCommit(e,n){if(this.backing.kind==="v3"&&e.length!==0)return this.upgradeLegacyV3ToV4(this.backing,e,n);let r=this.storageState.prepareCommit(e,this.now());r.writes.length!==0&&nCe(await this.fileSystem.appendFile(this.path,`${YEn(r.writes)} -`,n),`Failed to append JSONL storage ${this.path}`);let s=this.storageState.applyValidated(r.writes);return{...r.result,stats:this.withImportedUsage(s)}}async upgradeLegacyV3ToV4(e,n,r){let s=this.now(),i=this.storageState.prepareCommit([sy({id:tl(s),usage:e.importedUsage,adjustment:!0,details:{source:"v3-import"}}),...n],s),o=i.result.firstSeq+i.writes.length,a={...this.header,nextSeq:o};await tCe(this.fileSystem,this.path,zXe(a,[...e.baselineWrites.map(u=>[u]),i.writes]),r);let c=this.storageState.applyValidated(i.writes);return this.backing={kind:"v4"},{...i.result,firstSeq:i.result.firstSeq+1,seqs:i.result.seqs.slice(1),stats:c}}getEntries(e,n){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.storageState.getEntries(e))}getValue(e,n){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.storageState.getValue(e))}scanValues(e,n){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.storageState.scanValues(e))}async readList(e,n,r){if(this.state!=="open")throw new Error("JsonlStorage is closed");return this.storageState.readList(e,n)}async scanBranch(e,n){if(this.state!=="open")throw new Error("JsonlStorage is closed");return this.storageState.scanBranch(e)}async scanBranchStructure(e,n){if(this.state!=="open")throw new Error("JsonlStorage is closed");return this.storageState.scanBranchStructure(e)}scanEntries(e,n){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.storageState.scanEntries(e))}scanUsage(e,n){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.storageState.scanUsage(e))}getStats(e){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.withImportedUsage(this.storageState.getStats()))}withImportedUsage(e){return this.backing.kind==="v4"?e:{...e,usage:this.backing.importedUsage}}captureForkSource(e){if(this.state!=="open")return Promise.reject(new Error("JsonlStorage is closed"));let n=this.commitQueue.then(()=>this.storageState.snapshotEntriesAndValues());return this.commitQueue=n.then(()=>{},()=>{}),n}close(e){return this.closePromise!==void 0?this.closePromise:(this.state="closing",this.closePromise=this.commitQueue.then(()=>{this.state="closed"}),this.closePromise)}};function op(t,e){if(!t.ok)throw new Error(`${e}: ${t.error.message}`,{cause:t.error});return t.value}function JXe(t,e,n){return{id:t.id,createdAt:t.createdAt,storageVersion:t.storageVersion,cwd:t.cwd,path:e,modifiedAt:n,...t.parentSessionId===void 0?{}:{parentSessionId:t.parentSessionId},...t.legacyParentSessionPath===void 0?{}:{legacyParentSessionPath:t.legacyParentSessionPath}}}function Mfs(t){return`--${t.replace(/^[/\\]/,"").replace(/[/\\:]/g,"-")}--`}function Lfs(t,e){return`${new Date(t).toISOString().replace(/[:.]/g,"-")}_${encodeURIComponent(e)}.jsonl`}var rCe=class{fileSystem;sessionsRootInput;now;openSessions=new Map;pendingCreates=new Set;closed=!1;closePromise;constructor(e){this.fileSystem=e.fileSystem,this.sessionsRootInput=e.sessionsRoot,this.now=e.now??Date.now}async create(e,n){this.assertOpen();let r=this.now(),{cwd:s,id:i}=await this.resolveCreateDestination(e.cwd,e.id,r,n),o=this.sessionKey(s,i);if(this.openSessions.has(o)||this.pendingCreates.has(o))throw new Error(`Session already exists: ${i}`);this.pendingCreates.add(o);let a,c;try{a=await this.resolveNewSessionPath(s,r,i,n);let u={v:4,kind:"header",id:i,storageVersion:1,createdAt:r,cwd:s,...e.parentSessionId===void 0?{}:{parentSessionId:e.parentSessionId}};c=await v5.create({fileSystem:this.fileSystem,path:a,now:this.now},u,[],n);let l=op(await this.fileSystem.fileInfo(a,n),`Failed to read session ${a}`);return this.publishOpenSession(JXe(u,a,l.mtimeMs),c,o)}catch(u){throw await c?.close(n).catch(()=>{}),a!==void 0&&await this.fileSystem.remove(a,{force:!0},n),u}finally{this.pendingCreates.delete(o)}}async open(e,n){this.assertOpen();let r=this.sessionKey(e.cwd,e.id);if(this.openSessions.has(r))throw new Error(`Session is already open: ${e.id}`);let s;try{return s=await this.loadStorage(e,n),this.publishOpenSession(e,s,r)}catch(i){throw await s?.close(n),i}}async list(e,n){e??={},this.assertOpen();let r=e.cwd===void 0?void 0:op(await this.fileSystem.absolutePath(e.cwd,n),`Failed to resolve session cwd ${e.cwd}`),s=await this.root(n);if(!op(await this.fileSystem.exists(s,n),`Failed to check sessions root ${s}`))return[];let i=r===void 0?await this.sessionDirectories(s,n):[await this.sessionDirectory(r,n)],o=[];for(let a of i)o.push(...await this.listDirectory(a,r,n));return o.sort((a,c)=>c.createdAt-a.createdAt||a.id.localeCompare(c.id)||a.cwd.localeCompare(c.cwd))}async delete(e,n){this.assertOpen();let r=this.sessionKey(e.cwd,e.id);if(this.openSessions.has(r))throw new Error(`Session is open: ${e.id}`);if(!op(await this.fileSystem.exists(e.path,n),`Failed to check session ${e.path}`))throw new Error(`Session file does not exist: ${e.path}`);op(await this.fileSystem.remove(e.path,void 0,n),`Failed to delete session ${e.path}`)}async fork(e,n,r){this.assertOpen();let s=this.now(),i=this.openSessions.get(this.sessionKey(e.cwd,e.id)),o=await(i===void 0?this.loadClosedForkSourceSnapshot(e,r):i.captureForkSource(r)),{cwd:a,id:c}=await this.resolveCreateDestination(e.cwd,n.id,s,r),u=this.sessionKey(a,c);if(this.openSessions.has(u)||this.pendingCreates.has(u))throw new Error(`Session already exists: ${c}`);this.pendingCreates.add(u);let l,d;try{l=await this.resolveNewSessionPath(a,s,c,r);let h=I5(o,n),m={v:4,kind:"header",id:c,storageVersion:1,createdAt:s,cwd:a,parentSessionId:e.id};d=await v5.createFromForkSnapshot({fileSystem:this.fileSystem,path:l,now:this.now},m,h,r);let f=op(await this.fileSystem.fileInfo(l,r),`Failed to read session ${l}`);return this.publishOpenSession(JXe(m,l,f.mtimeMs),d,u)}catch(h){throw await d?.close(r).catch(()=>{}),l!==void 0&&await this.fileSystem.remove(l,{force:!0},r),h}finally{this.pendingCreates.delete(u)}}close(e){return this.closePromise!==void 0?this.closePromise:(this.closed=!0,this.closePromise=Promise.resolve(),this.closePromise)}async resolveCreateDestination(e,n,r,s){let i=n??tl(r);return{cwd:op(await this.fileSystem.absolutePath(e,s),`Failed to resolve session cwd ${e}`),id:i}}async listDirectory(e,n,r){if(!op(await this.fileSystem.exists(e,r),`Failed to check sessions directory ${e}`))return[];let s=op(await this.fileSystem.listDir(e,r),`Failed to list sessions directory ${e}`).filter(o=>o.kind!=="directory"&&o.name.endsWith(".jsonl")),i=[];for(let o of s){let a=await this.readSessionMetadata(o,r);a!==void 0&&(n===void 0||a.cwd===n)&&i.push(a)}return i}async readSessionMetadata(e,n){let r=op(await this.fileSystem.readTextLines(e.path,{maxLines:1},n),`Failed to read session header ${e.path}`);if(r[0]===void 0)return;let s=w5(r[0]);if(s.ok)return s.value.format==="v3-legacy"?{...await KXe(this.fileSystem,s.value.header,n),path:e.path,modifiedAt:e.mtimeMs}:JXe(s.value.header,e.path,e.mtimeMs)}async sessionDirectories(e,n){return op(await this.fileSystem.listDir(e,n),`Failed to list sessions root ${e}`).filter(r=>r.kind==="directory").map(r=>r.path)}async sessionDirectory(e,n){return op(await this.fileSystem.joinPath([await this.root(n),Mfs(e)],n),`Failed to resolve sessions directory for ${e}`)}async resolveNewSessionPath(e,n,r,s){let i=await this.sessionDirectory(e,s);return await this.assertSessionIdAvailable(i,r,s),op(await this.fileSystem.createDir(i,void 0,s),`Failed to create sessions directory ${i}`),op(await this.fileSystem.joinPath([i,Lfs(n,r)],s),`Failed to resolve path for session ${r}`)}async assertSessionIdAvailable(e,n,r){if(!op(await this.fileSystem.exists(e,r),`Failed to check sessions directory ${e}`))return;let s=`_${encodeURIComponent(n)}.jsonl`;if(op(await this.fileSystem.listDir(e,r),`Failed to list sessions directory ${e}`).some(o=>o.kind!=="directory"&&o.name.endsWith(s)))throw new Error(`Session already exists: ${n}`)}async loadClosedForkSourceSnapshot(e,n){let r=await this.loadStorage(e,n);try{return await r.captureForkSource(n)}finally{await r.close(n)}}publishOpenSession(e,n,r){if(this.openSessions.has(r))throw new Error(`Session is already open: ${e.id}`);let s=new bT(e,n,{onClose:()=>{this.openSessions.get(r)===n&&this.openSessions.delete(r)}});return this.openSessions.set(r,n),s}sessionKey(e,n){return`${e}\0${n}`}async loadStorage(e,n){if(!op(await this.fileSystem.exists(e.path,n),`Failed to check session ${e.path}`))throw new Error(`Session file does not exist: ${e.path}`);let r=await v5.open({fileSystem:this.fileSystem,path:e.path,now:this.now},n);try{if(r.header.id!==e.id||r.header.cwd!==e.cwd)throw new Error(`Session identity does not match header: ${e.id}`);if(r.header.storageVersion!==1)throw new Error(`Session ${e.id} uses unsupported storage version ${r.header.storageVersion}`);return r}catch(s){throw await r.close(n),s}}root(e){return this.fileSystem.absolutePath(this.sessionsRootInput,e).then(n=>op(n,`Failed to resolve sessions root ${this.sessionsRootInput}`))}assertOpen(){if(this.closed)throw new Error("JsonlSessionRepo is closed")}};p();$k();var sCe=class t{now;storageState=new T5;commitQueue=Promise.resolve();state="open";closePromise;constructor(e={}){this.now=e.now??Date.now}async commit(e,n){if(this.state!=="open")throw new Error("MemoryStorage is closed");let r=this.commitQueue.then(()=>{let s=this.storageState.prepareCommit(e,this.now()),i=this.storageState.applyValidated(s.writes);return{...s.result,stats:i}});return this.commitQueue=r.then(()=>{},()=>{}),r}getEntries(e,n){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.getEntries(e))}getValue(e,n){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.getValue(e))}scanValues(e,n){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.scanValues(e))}async readList(e,n,r){if(this.state!=="open")throw new Error("MemoryStorage is closed");return this.storageState.readList(e,n)}async scanBranch(e,n){if(this.state!=="open")throw new Error("MemoryStorage is closed");return this.storageState.scanBranch(e)}async scanBranchStructure(e,n){if(this.state!=="open")throw new Error("MemoryStorage is closed");return this.storageState.scanBranchStructure(e)}scanEntries(e,n){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.scanEntries(e))}scanUsage(e,n){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.scanUsage(e))}getStats(e){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.getStats())}captureForkSource(e){if(this.state!=="open")return Promise.reject(new Error("MemoryStorage is closed"));let n=this.commitQueue.then(()=>this.storageState.snapshotEntriesAndValues());return this.commitQueue=n.then(()=>{},()=>{}),n}close(e){return this.closePromise!==void 0?this.closePromise:(this.state="closing",this.closePromise=this.commitQueue.then(()=>{this.state="closed"}),this.closePromise)}static fromSnapshot(e,n){let r=new t(e),s=ZSe(n);return r.storageState.validateCommitted(s),r.storageState.applyValidated(s),r}},KEn=1,XXe=class{metadata;idGenerator;session;onClose;admitted=new Set;closedError=new Error("Session is closed");state="open";closePromise;constructor(e,n){this.session=e,this.metadata=e.metadata,this.idGenerator=e.idGenerator,this.onClose=n}async beginMutation(e){let n,r=new Promise(o=>{n=o});this.admitted.add(r);let s;try{s=await this.admit(()=>this.session.beginMutation(e))}catch(o){throw this.admitted.delete(r),n(),o}if(this.state!=="open")throw await s.end(e),this.admitted.delete(r),n(),this.closedError;let i=!1;return{commit:(o,a)=>s.commit(o,a),end:async o=>{try{await s.end(o)}finally{i||(i=!0,this.admitted.delete(r),n())}},getEntries:(o,a)=>s.getEntries(o,a),getStats:o=>s.getStats(o),getValue:(o,a)=>s.getValue(o,a),scanValues:(o,a)=>s.scanValues(o,a),readList:(o,a,c)=>s.readList(o,a,c),scanBranch:(o,a)=>s.scanBranch(o,a)}}mutate(e,n){return this.admit(()=>this.session.mutate((r,s)=>{if(this.state!=="open")throw this.closedError;return e(r,s)},n))}getEntries(e,n){return this.admit(()=>this.session.getEntries(e,n))}getEntry(e,n){return this.admit(()=>this.session.getEntry(e,n))}getValue(e,n){return this.admit(()=>this.session.getValue(e,n))}scanValues(e,n){return this.admit(()=>this.session.scanValues(e,n))}readList(e,n,r){return this.admit(()=>this.session.readList(e,n,r))}scanBranch(e,n){return this.admit(()=>this.session.scanBranch(e,n))}getStats(e){return this.admit(()=>this.session.getStats(e))}getName(e){return this.admit(()=>this.session.getName(e))}getLabel(e,n){return this.admit(()=>this.session.getLabel(e,n))}findEntries(e,n){return this.admit(()=>this.session.findEntries(e,n))}findEntry(e,n){return this.admit(()=>this.session.findEntry(e,n))}async branch(e,n){let r=await this.admit(()=>this.session.branch(e,n));return r===void 0?void 0:this.wrapBranch(r)}async createBranch(e,n,r){return this.wrapBranch(await this.admit(()=>this.session.createBranch(e,n,r)))}setValue(e,n,r){return this.admit(()=>this.session.setValue(e,n,r))}deleteValue(e,n){return this.admit(()=>this.session.deleteValue(e,n))}appendList(e,n,r){return this.admit(()=>this.session.appendList(e,n,r))}deleteList(e,n){return this.admit(()=>this.session.deleteList(e,n))}setName(e,n){return this.admit(()=>this.session.setName(e,n))}setLabel(e,n,r){return this.admit(()=>this.session.setLabel(e,n,r))}close(e){return this.closePromise!==void 0?this.closePromise:(this.state="closing",this.closePromise=Promise.allSettled([...this.admitted]).then(()=>{this.state="closed",this.onClose()}),this.closePromise)}wrapBranch(e){return{name:e.name,getTipId:n=>this.admit(()=>e.getTipId(n)),findEntries:(n,r)=>this.admit(()=>e.findEntries(n,r)),findEntry:(n,r)=>this.admit(()=>e.findEntry(n,r)),appendMessage:(n,r)=>this.admit(()=>e.appendMessage(n,r)),appendCustomEntry:(n,r,s)=>this.admit(()=>e.appendCustomEntry(n,r,s))}}admit(e){if(this.state!=="open")return Promise.reject(this.closedError);let n;try{n=e()}catch(r){n=Promise.reject(r)}return this.admitted.add(n),n.then(()=>this.admitted.delete(n),()=>this.admitted.delete(n)),n}},iCe=class{now;sessions=new Map;pendingIds=new Set;closed=!1;closePromise;constructor(e={}){this.now=e.now??Date.now}async create(e,n){this.assertOpen();let r=this.now(),s=e.id??tl(r);this.reserveId(s);let i={id:s,createdAt:r,storageVersion:KEn,...e.parentSessionId===void 0?{}:{parentSessionId:e.parentSessionId}},o=new sCe({now:this.now}),a=new bT(i,o);try{let c={metadata:i,storage:o,session:a,open:!0};return this.sessions.set(s,c),this.openRecord(c)}catch(c){throw await a.close(n),c}finally{this.pendingIds.delete(s)}}open(e,n){this.assertOpen();let r=this.sessions.get(e.id);return r===void 0?Promise.reject(new Error(`Unknown session: ${e.id}`)):r.open?Promise.reject(new Error(`Session is already open: ${e.id}`)):(r.open=!0,Promise.resolve(this.openRecord(r)))}list(e,n){return this.assertOpen(),Promise.resolve([...this.sessions.values()].map(({metadata:r})=>r))}async delete(e,n){this.assertOpen();let r=this.sessions.get(e.id);if(r===void 0)throw new Error(`Unknown session: ${e.id}`);if(r.open)throw new Error(`Session is open: ${e.id}`);await r.session.close(n),this.sessions.delete(e.id)}async fork(e,n,r){this.assertOpen();let s=this.sessions.get(e.id);if(s===void 0)throw new Error(`Unknown session: ${e.id}`);let i=this.now(),o=n.id??tl(i);this.reserveId(o);try{let a=I5(await s.storage.captureForkSource(r),n),c=sCe.fromSnapshot({now:this.now},a),u={id:o,createdAt:i,storageVersion:KEn,parentSessionId:s.metadata.id},l=new bT(u,c),d={metadata:u,storage:c,session:l,open:!0};return this.sessions.set(o,d),this.openRecord(d)}finally{this.pendingIds.delete(o)}}close(e){return this.closePromise!==void 0?this.closePromise:(this.closed=!0,this.closePromise=Promise.all([...this.sessions.values()].map(({session:n})=>n.close(e))).then(()=>{}),this.closePromise)}openRecord(e){return new XXe(e.session,()=>{e.open=!1})}reserveId(e){if(this.sessions.has(e)||this.pendingIds.has(e))throw new Error(`Session already exists: ${e}`);this.pendingIds.add(e)}assertOpen(){if(this.closed)throw new Error("MemorySessionRepo is closed")}};p();function Ffs(t){let e=t.filter(r=>!r.disableModelInvocation);if(e.length===0)return"";let n=["The following skills provide specialized instructions for specific tasks.","Read the full skill file when the task matches its description.","When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.","",""];for(let r of e)n.push(" "),n.push(` ${ZXe(r.name)}`),n.push(` ${ZXe(r.description)}`),n.push(` ${ZXe(r.filePath)}`),n.push(" ");return n.push(""),n.join(` -`)}function ZXe(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}p();p();p();p();p();var rD=2e3,ZE=51200,Dqa=500,zEn=globalThis.Buffer,Qfs=/[^\x00-\x7f]/;function iI(t){if(zEn)return zEn.byteLength(t,"utf8");let e=t.search(Qfs);if(e===-1)return t.length;let n=e;for(let r=e;r=55296&&s<=56319&&r+1=56320&&i<=57343?(n+=4,r++):n+=3}else n+=3}return n}function JEn(t){if(t.length===0)return[];let e=t.split(` +`)),a}static async openLegacyV3(e,n){let r=await xV.read(e.fileSystem,e.path,n),i=new t(e,{...r.header,nextSeq:r.nextSeq},{kind:"v3",source:r});for await(let s of r.writes(n))i.replayCommitted([s]);return i}replayCommitted(e){this.storageState.validateCommitted(e),this.storageState.applyValidated(e)}async commit(e,n){if(this.state!=="open")throw new Error("JsonlStorage is closed");let r=this.commitQueue.then(()=>this.applyCommit(e,n));return this.commitQueue=r.then(()=>{},()=>{}),r}async applyCommit(e,n){if(this.backing.kind==="v3"&&e.length!==0)return this.upgradeLegacyV3ToV4(this.backing.source,e,n);let r=this.storageState.prepareCommit(e,this.now());r.writes.length!==0&&ho(await this.fileSystem.appendFile(this.path,`${jdt(r.writes)} +`,n),`Failed to append JSONL storage ${this.path}`);let i=this.storageState.applyValidated(r.writes);return{...r.result,stats:this.withImportedUsage(i)}}async upgradeLegacyV3ToV4(e,n,r){let i=this.now(),s=this.storageState.prepareCommit([vE({id:Oc(i),usage:e.importedUsage,adjustment:!0,details:{source:"v3-import"}}),...n],i),o=s.result.firstSeq+s.writes.length,a={...this.header,nextSeq:o};await bse(this.fileSystem,this.path,a,r,async u=>{for await(let l of e.writes(r))await u([l]);await u(s.writes)});let c=this.storageState.applyValidated(s.writes);return this.backing={kind:"v4"},{...s.result,firstSeq:s.result.firstSeq+1,seqs:s.result.seqs.slice(1),stats:c}}getEntries(e,n){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.storageState.getEntries(e))}getValue(e,n){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.storageState.getValue(e))}scanValues(e,n){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.storageState.scanValues(e))}async readList(e,n,r){if(this.state!=="open")throw new Error("JsonlStorage is closed");return this.storageState.readList(e,n)}async scanBranch(e,n){if(this.state!=="open")throw new Error("JsonlStorage is closed");return this.storageState.scanBranch(e)}async scanBranchStructure(e,n){if(this.state!=="open")throw new Error("JsonlStorage is closed");return this.storageState.scanBranchStructure(e)}scanEntries(e,n){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.storageState.scanEntries(e))}scanUsage(e,n){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.storageState.scanUsage(e))}getStats(e){return this.state!=="open"?Promise.reject(new Error("JsonlStorage is closed")):Promise.resolve(this.withImportedUsage(this.storageState.getStats()))}withImportedUsage(e){return this.backing.kind==="v4"?e:{...e,usage:this.backing.source.importedUsage}}isLegacyV3(){return this.backing.kind==="v3"}captureForkNextSeq(e){if(this.state!=="open")return Promise.reject(new Error("JsonlStorage is closed"));let n=this.commitQueue.then(()=>this.storageState.getNextSeq());return this.commitQueue=n.then(()=>{},()=>{}),n}close(e){return this.closePromise!==void 0?this.closePromise:(this.state="closing",this.closePromise=this.commitQueue.then(()=>{this.state="closed"}),this.closePromise)}}});function Zdt(t,e,n){return{id:t.id,createdAt:t.createdAt,storageVersion:t.storageVersion,cwd:t.cwd,path:e,modifiedAt:n,...t.parentSessionId===void 0?{}:{parentSessionId:t.parentSessionId},...t.legacyParentSessionPath===void 0?{}:{legacyParentSessionPath:t.legacyParentSessionPath}}}function z4i(t){return`--${t.replace(/^[/\\]/,"").replace(/[/\\:]/g,"-")}--`}function K4i(t,e){return`${new Date(t).toISOString().replace(/[:.]/g,"-")}_${encodeURIComponent(e)}.jsonl`}var Uke,v5n=v(()=>{p();kN();yp();Lke();x5n();_se();Kdt();Xdt();DQ();Uke=class{fileSystem;sessionsRootInput;now;openSessions=new Map;pendingCreates=new Set;closed=!1;closePromise;constructor(e){this.fileSystem=e.fileSystem,this.sessionsRootInput=e.sessionsRoot,this.now=e.now??Date.now}async create(e,n){this.assertOpen();let r=this.now(),{cwd:i,id:s}=await this.resolveCreateDestination(e.cwd,e.id,r,n),o=this.sessionKey(i,s);if(this.openSessions.has(o)||this.pendingCreates.has(o))throw new Error(`Session already exists: ${s}`);this.pendingCreates.add(o);let a,c;try{a=await this.resolveNewSessionPath(i,r,s,n);let u={v:4,kind:"header",id:s,storageVersion:1,createdAt:r,cwd:i,...e.parentSessionId===void 0?{}:{parentSessionId:e.parentSessionId}};c=await CV.create({fileSystem:this.fileSystem,path:a,now:this.now},u,[],n);let l=ho(await this.fileSystem.fileInfo(a,n),`Failed to read session ${a}`);return this.publishOpenSession(Zdt(u,a,l.mtimeMs),c,o)}catch(u){throw await c?.close(n).catch(()=>{}),a!==void 0&&await this.fileSystem.remove(a,{force:!0},n),u}finally{this.pendingCreates.delete(o)}}async open(e,n){this.assertOpen();let r=this.sessionKey(e.cwd,e.id);if(this.openSessions.has(r))throw new Error(`Session is already open: ${e.id}`);let i;try{return i=await this.loadStorage(e,n),this.publishOpenSession(e,i,r)}catch(s){throw await i?.close(n),s}}async list(e,n){e??={},this.assertOpen();let r=e.cwd===void 0?void 0:ho(await this.fileSystem.absolutePath(e.cwd,n),`Failed to resolve session cwd ${e.cwd}`),i=await this.root(n);if(!ho(await this.fileSystem.exists(i,n),`Failed to check sessions root ${i}`))return[];let s=r===void 0?await this.sessionDirectories(i,n):[await this.sessionDirectory(r,n)],o=[];for(let a of s)o.push(...await this.listDirectory(a,r,n));return o.sort((a,c)=>c.createdAt-a.createdAt||a.id.localeCompare(c.id)||a.cwd.localeCompare(c.cwd))}async delete(e,n){this.assertOpen();let r=this.sessionKey(e.cwd,e.id);if(this.openSessions.has(r))throw new Error(`Session is open: ${e.id}`);if(!ho(await this.fileSystem.exists(e.path,n),`Failed to check session ${e.path}`))throw new Error(`Session file does not exist: ${e.path}`);ho(await this.fileSystem.remove(e.path,void 0,n),`Failed to delete session ${e.path}`)}async fork(e,n,r){this.assertOpen();let i=this.now(),s=e.cwd,o=n.id??Oc(i),a=this.sessionKey(s,o);if(this.openSessions.has(a)||this.pendingCreates.has(a))throw new Error(`Session already exists: ${o}`);this.pendingCreates.add(a);let c=this.openSessions.get(this.sessionKey(e.cwd,e.id)),u,l;try{let d=await this.resolveForkInput(e,c,r);u=await this.resolveNewSessionPath(s,i,o,r);let m={v:4,kind:"header",id:o,storageVersion:1,createdAt:i,cwd:s,parentSessionId:e.id};await _5n({input:d,fileSystem:this.fileSystem,destinationPath:u,destinationHeader:m,fork:n},r),l=await CV.open({fileSystem:this.fileSystem,path:u,now:this.now},r);let h=ho(await this.fileSystem.fileInfo(u,r),`Failed to read session ${u}`);return this.publishOpenSession(Zdt(m,u,h.mtimeMs),l,a)}catch(d){throw await l?.close(r).catch(()=>{}),u!==void 0&&await this.fileSystem.remove(u,{force:!0},r),d}finally{this.pendingCreates.delete(a)}}close(e){return this.closePromise!==void 0?this.closePromise:(this.closed=!0,this.closePromise=Promise.resolve(),this.closePromise)}async resolveCreateDestination(e,n,r,i){let s=n??Oc(r);return{cwd:ho(await this.fileSystem.absolutePath(e,i),`Failed to resolve session cwd ${e}`),id:s}}async listDirectory(e,n,r){if(!ho(await this.fileSystem.exists(e,r),`Failed to check sessions directory ${e}`))return[];let i=ho(await this.fileSystem.listDir(e,r),`Failed to list sessions directory ${e}`).filter(o=>o.kind!=="directory"&&o.name.endsWith(".jsonl")),s=[];for(let o of i){let a=await this.readSessionMetadata(o,r);a!==void 0&&(n===void 0||a.cwd===n)&&s.push(a)}return s}async readSessionMetadata(e,n){let r=ho(await this.fileSystem.readTextLines(e.path,{maxLines:1},n),`Failed to read session header ${e.path}`);if(r[0]===void 0)return;let i=PQ(r[0]);if(i.ok)return i.value.format==="v3-legacy"?{...await zdt(this.fileSystem,i.value.header,n),path:e.path,modifiedAt:e.mtimeMs}:Zdt(i.value.header,e.path,e.mtimeMs)}async sessionDirectories(e,n){return ho(await this.fileSystem.listDir(e,n),`Failed to list sessions root ${e}`).filter(r=>r.kind==="directory").map(r=>r.path)}async sessionDirectory(e,n){return ho(await this.fileSystem.joinPath([await this.root(n),z4i(e)],n),`Failed to resolve sessions directory for ${e}`)}async resolveNewSessionPath(e,n,r,i){let s=await this.sessionDirectory(e,i);return await this.assertSessionIdAvailable(s,r,i),ho(await this.fileSystem.createDir(s,void 0,i),`Failed to create sessions directory ${s}`),ho(await this.fileSystem.joinPath([s,K4i(n,r)],i),`Failed to resolve path for session ${r}`)}async assertSessionIdAvailable(e,n,r){if(!ho(await this.fileSystem.exists(e,r),`Failed to check sessions directory ${e}`))return;let i=`_${encodeURIComponent(n)}.jsonl`;if(ho(await this.fileSystem.listDir(e,r),`Failed to list sessions directory ${e}`).some(o=>o.kind!=="directory"&&o.name.endsWith(i)))throw new Error(`Session already exists: ${n}`)}async resolveForkInput(e,n,r){if(n!==void 0){if(n.isLegacyV3())throw new Error("Cannot fork an open legacy v3 JSONL session; commit a non-empty transaction to upgrade it to format 4 first");let i=await n.captureForkNextSeq(r);return{kind:"open",metadata:e,nextSeq:i}}if(await this.isLegacyV3ForkSource(e,r)){let i=await xV.read(this.fileSystem,e.path,r);if(i.header.id!==e.id||i.header.cwd!==e.cwd)throw new Error(`Session identity does not match header: ${e.id}`);return{kind:"legacy-v3",normalized:i}}return{kind:"closed",metadata:e}}async isLegacyV3ForkSource(e,n){let r=ho(await this.fileSystem.readTextLines(e.path,{maxLines:1},n),`Failed to read session header ${e.path}`);if(r[0]===void 0)return!1;let i=PQ(r[0]);return i.ok&&i.value.format==="v3-legacy"}publishOpenSession(e,n,r){if(this.openSessions.has(r))throw new Error(`Session is already open: ${e.id}`);let i=new ek(e,n,{onClose:()=>{this.openSessions.get(r)===n&&this.openSessions.delete(r)}});return this.openSessions.set(r,n),i}sessionKey(e,n){return`${e}\0${n}`}async loadStorage(e,n){if(!ho(await this.fileSystem.exists(e.path,n),`Failed to check session ${e.path}`))throw new Error(`Session file does not exist: ${e.path}`);let r=await CV.open({fileSystem:this.fileSystem,path:e.path,now:this.now},n);try{if(r.header.id!==e.id||r.header.cwd!==e.cwd)throw new Error(`Session identity does not match header: ${e.id}`);if(r.header.storageVersion!==1)throw new Error(`Session ${e.id} uses unsupported storage version ${r.header.storageVersion}`);return r}catch(i){throw await r.close(n),i}}root(e){return this.fileSystem.absolutePath(this.sessionsRootInput,e).then(n=>ho(n,`Failed to resolve sessions root ${this.sessionsRootInput}`))}assertOpen(){if(this.closed)throw new Error("JsonlSessionRepo is closed")}}});var R5n=v(()=>{p();v5n();Xdt();DQ()});var ept,k5n,tpt,Gke,B5n=v(()=>{p();kN();Jdt();yp();ept=class t{now;storageState=new SV;commitQueue=Promise.resolve();state="open";closePromise;constructor(e={}){this.now=e.now??Date.now}async commit(e,n){if(this.state!=="open")throw new Error("MemoryStorage is closed");let r=this.commitQueue.then(()=>{let i=this.storageState.prepareCommit(e,this.now()),s=this.storageState.applyValidated(i.writes);return{...i.result,stats:s}});return this.commitQueue=r.then(()=>{},()=>{}),r}getEntries(e,n){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.getEntries(e))}getValue(e,n){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.getValue(e))}scanValues(e,n){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.scanValues(e))}async readList(e,n,r){if(this.state!=="open")throw new Error("MemoryStorage is closed");return this.storageState.readList(e,n)}async scanBranch(e,n){if(this.state!=="open")throw new Error("MemoryStorage is closed");return this.storageState.scanBranch(e)}async scanBranchStructure(e,n){if(this.state!=="open")throw new Error("MemoryStorage is closed");return this.storageState.scanBranchStructure(e)}scanEntries(e,n){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.scanEntries(e))}scanUsage(e,n){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.scanUsage(e))}getStats(e){return this.state!=="open"?Promise.reject(new Error("MemoryStorage is closed")):Promise.resolve(this.storageState.getStats())}fork(e){if(this.state!=="open")return Promise.reject(new Error("MemoryStorage is closed"));let n=this.commitQueue.then(()=>{let r=new t({now:this.now});return r.storageState=this.storageState.createFork(e),r});return this.commitQueue=n.then(()=>{},()=>{}),n}close(e){return this.closePromise!==void 0?this.closePromise:(this.state="closing",this.closePromise=this.commitQueue.then(()=>{this.state="closed"}),this.closePromise)}},k5n=1,tpt=class{metadata;idGenerator;session;onClose;admitted=new Set;closedError=new Error("Session is closed");state="open";closePromise;constructor(e,n){this.session=e,this.metadata=e.metadata,this.idGenerator=e.idGenerator,this.onClose=n}async beginMutation(e){let n,r=new Promise(o=>{n=o});this.admitted.add(r);let i;try{i=await this.admit(()=>this.session.beginMutation(e))}catch(o){throw this.admitted.delete(r),n(),o}if(this.state!=="open")throw await i.end(e),this.admitted.delete(r),n(),this.closedError;let s=!1;return{commit:(o,a)=>i.commit(o,a),end:async o=>{try{await i.end(o)}finally{s||(s=!0,this.admitted.delete(r),n())}},getEntries:(o,a)=>i.getEntries(o,a),getStats:o=>i.getStats(o),getValue:(o,a)=>i.getValue(o,a),scanValues:(o,a)=>i.scanValues(o,a),readList:(o,a,c)=>i.readList(o,a,c),scanBranch:(o,a)=>i.scanBranch(o,a)}}mutate(e,n){return this.admit(()=>this.session.mutate((r,i)=>{if(this.state!=="open")throw this.closedError;return e(r,i)},n))}getEntries(e,n){return this.admit(()=>this.session.getEntries(e,n))}getEntry(e,n){return this.admit(()=>this.session.getEntry(e,n))}getValue(e,n){return this.admit(()=>this.session.getValue(e,n))}scanValues(e,n){return this.admit(()=>this.session.scanValues(e,n))}readList(e,n,r){return this.admit(()=>this.session.readList(e,n,r))}scanBranch(e,n){return this.admit(()=>this.session.scanBranch(e,n))}getStats(e){return this.admit(()=>this.session.getStats(e))}getName(e){return this.admit(()=>this.session.getName(e))}getLabel(e,n){return this.admit(()=>this.session.getLabel(e,n))}findEntries(e,n){return this.admit(()=>this.session.findEntries(e,n))}findEntry(e,n){return this.admit(()=>this.session.findEntry(e,n))}async branch(e,n){let r=await this.admit(()=>this.session.branch(e,n));return r===void 0?void 0:this.wrapBranch(r)}async createBranch(e,n,r){return this.wrapBranch(await this.admit(()=>this.session.createBranch(e,n,r)))}setValue(e,n,r){return this.admit(()=>this.session.setValue(e,n,r))}deleteValue(e,n){return this.admit(()=>this.session.deleteValue(e,n))}appendList(e,n,r){return this.admit(()=>this.session.appendList(e,n,r))}deleteList(e,n){return this.admit(()=>this.session.deleteList(e,n))}setName(e,n){return this.admit(()=>this.session.setName(e,n))}setLabel(e,n,r){return this.admit(()=>this.session.setLabel(e,n,r))}close(e){return this.closePromise!==void 0?this.closePromise:(this.state="closing",this.closePromise=Promise.allSettled([...this.admitted]).then(()=>{this.state="closed",this.onClose()}),this.closePromise)}wrapBranch(e){return{name:e.name,getTipId:n=>this.admit(()=>e.getTipId(n)),findEntries:(n,r)=>this.admit(()=>e.findEntries(n,r)),findEntry:(n,r)=>this.admit(()=>e.findEntry(n,r)),appendMessage:(n,r)=>this.admit(()=>e.appendMessage(n,r)),appendCustomEntry:(n,r,i)=>this.admit(()=>e.appendCustomEntry(n,r,i))}}admit(e){if(this.state!=="open")return Promise.reject(this.closedError);let n;try{n=e()}catch(r){n=Promise.reject(r)}return this.admitted.add(n),n.then(()=>this.admitted.delete(n),()=>this.admitted.delete(n)),n}},Gke=class{now;sessions=new Map;pendingIds=new Set;closed=!1;closePromise;constructor(e={}){this.now=e.now??Date.now}async create(e,n){this.assertOpen();let r=this.now(),i=e.id??Oc(r);this.reserveId(i);let s={id:i,createdAt:r,storageVersion:k5n,...e.parentSessionId===void 0?{}:{parentSessionId:e.parentSessionId}},o=new ept({now:this.now}),a=new ek(s,o);try{let c={metadata:s,storage:o,session:a,open:!0};return this.sessions.set(i,c),this.openRecord(c)}catch(c){throw await a.close(n),c}finally{this.pendingIds.delete(i)}}open(e,n){this.assertOpen();let r=this.sessions.get(e.id);return r===void 0?Promise.reject(new Error(`Unknown session: ${e.id}`)):r.open?Promise.reject(new Error(`Session is already open: ${e.id}`)):(r.open=!0,Promise.resolve(this.openRecord(r)))}list(e,n){return this.assertOpen(),Promise.resolve([...this.sessions.values()].map(({metadata:r})=>r))}async delete(e,n){this.assertOpen();let r=this.sessions.get(e.id);if(r===void 0)throw new Error(`Unknown session: ${e.id}`);if(r.open)throw new Error(`Session is open: ${e.id}`);await r.session.close(n),this.sessions.delete(e.id)}async fork(e,n,r){this.assertOpen();let i=this.sessions.get(e.id);if(i===void 0)throw new Error(`Unknown session: ${e.id}`);let s=this.now(),o=n.id??Oc(s);this.reserveId(o);try{let a=await i.storage.fork(n),c={id:o,createdAt:s,storageVersion:k5n,parentSessionId:i.metadata.id},u=new ek(c,a),l={metadata:c,storage:a,session:u,open:!0};return this.sessions.set(o,l),this.openRecord(l)}finally{this.pendingIds.delete(o)}}close(e){return this.closePromise!==void 0?this.closePromise:(this.closed=!0,this.closePromise=Promise.all([...this.sessions.values()].map(({session:n})=>n.close(e))).then(()=>{}),this.closePromise)}openRecord(e){return new tpt(e.session,()=>{e.open=!1})}reserveId(e){if(this.sessions.has(e)||this.pendingIds.has(e))throw new Error(`Session already exists: ${e}`);this.pendingIds.add(e)}assertOpen(){if(this.closed)throw new Error("MemorySessionRepo is closed")}}});var N5n=v(()=>{p();Rb();g5n();Ese();R5n();B5n();yp();JD();Ap()});function J4i(t){let e=t.filter(r=>!r.disableModelInvocation);if(e.length===0)return"";let n=["The following skills provide specialized instructions for specific tasks.","Read the full skill file when the task matches its description.","When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.","",""];for(let r of e)n.push(" "),n.push(` ${npt(r.name)}`),n.push(` ${npt(r.description)}`),n.push(` ${npt(r.filePath)}`),n.push(" ");return n.push(""),n.join(` +`)}function npt(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}var D5n=v(()=>{p()});var P5n=v(()=>{p()});function Cw(t){if(M5n)return M5n.byteLength(t,"utf8");let e=t.search(X4i);if(e===-1)return t.length;let n=e;for(let r=e;r=55296&&i<=56319&&r+1=56320&&s<=57343?(n+=4,r++):n+=3}else n+=3}return n}function O5n(t){if(t.length===0)return[];let e=t.split(` `);return t.endsWith(` -`)&&e.pop(),e}function Ufs(t){let e="";for(let n=0;n=55296&&r<=56319){if(n+1=56320&&s<=57343){e+=t[n]+t[n+1],n++;continue}}e+="\uFFFD"}else r>=56320&&r<=57343?e+="\uFFFD":e+=t[n]}return e}function IT(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}function oCe(t,e={}){let n=e.maxLines??2e3,r=e.maxBytes??51200,s=iI(t),i=JEn(t),o=i.length;if(o<=n&&s<=r)return{content:t,truncated:!1,truncatedBy:null,totalLines:o,totalBytes:s,outputLines:o,outputBytes:s,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r};if(iI(i[0])>r)return{content:"",truncated:!0,truncatedBy:"bytes",totalLines:o,totalBytes:s,outputLines:0,outputBytes:0,lastLinePartial:!1,firstLineExceedsLimit:!0,maxLines:n,maxBytes:r};let c=[],u=0,l="lines";for(let m=0;m0?1:0);if(u+g>r){l="bytes";break}c.push(f),u+=g}c.length>=n&&u<=r&&(l="lines");let d=c.join(` -`),h=iI(d);return{content:d,truncated:!0,truncatedBy:l,totalLines:o,totalBytes:s,outputLines:c.length,outputBytes:h,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r}}function aCe(t,e={}){let n=e.maxLines??2e3,r=e.maxBytes??51200,s=iI(t),i=JEn(t),o=i.length;if(o<=n&&s<=r)return{content:t,truncated:!1,truncatedBy:null,totalLines:o,totalBytes:s,outputLines:o,outputBytes:s,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r};let a=[],c=0,u="lines",l=!1;for(let m=i.length-1;m>=0&&a.length0?1:0);if(c+g>r){if(u="bytes",a.length===0){let A=$fs(f,r);a.unshift(A),c=iI(A),l=!0}break}a.unshift(f),c+=g}a.length>=n&&c<=r&&(u="lines");let d=a.join(` -`),h=iI(d);return{content:d,truncated:!0,truncatedBy:u,totalLines:o,totalBytes:s,outputLines:a.length,outputBytes:h,lastLinePartial:l,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r}}function $fs(t,e){if(e<=0)return"";let n=0,r=t.length,s=!1;for(let o=t.length;o>0;){let a=o-1,c=t.charCodeAt(a),u,l=!1;if(c>=56320&&c<=57343&&a>0){let d=t.charCodeAt(a-1);d>=55296&&d<=56319?(a--,u=4):(u=3,l=!0)}else c>=55296&&c<=57343?(u=3,l=!0):u=c<=127?1:c<=2047?2:3;if(n+u>e)break;n+=u,r=a,s||=l,o=a}let i=t.slice(r);return s?Ufs(i):i}function Gfs(t,e=500){return t.length<=e?{text:t,wasTruncated:!1}:{text:`${t.slice(0,e)}... [truncated]`,wasTruncated:!0}}var Fqa=100*1024,Wfs=/[\x00-\x08\x0b-\x1f\ufff9-\ufffb]/g,Qqa=new TextEncoder,Uqa=new TextDecoder;function R5(t,e){switch(e.kind){case"replace":return e.output;case"append":return{text:`${t?.text??""}${e.text}`,...e.metadata};case"slide":return{text:`${t?.text.slice(e.drop)??""}${e.text}`,...e.metadata};case"metadata":return{text:t?.text??"",...e.metadata}}}function XEn(t){return t.replace(Wfs,"")}var ZEn=2147483647/1e3,qfs=2e3,Hfs=Oe.Object({command:Oe.String({description:"Bash command to execute"}),timeout:Oe.Optional(Oe.Number({description:"Timeout in seconds (optional, no default timeout)"}))});function Vfs(t){if(t!==void 0){if(!Number.isFinite(t)||t<=0)throw new Error("Invalid timeout: must be a finite number of seconds");if(t>ZEn)throw new Error(`Invalid timeout: maximum is ${ZEn} seconds`)}}function ebn(t){return{name:"bash",label:"bash",description:`Execute a bash command in the current working directory. Returns combined stdout and stderr. Output is truncated to last ${2e3} lines or ${51200/1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.`,parameters:Hfs,async execute(e,{command:n,timeout:r},s,i,o,a){Vfs(r);let{env:c}=i,u={command:t?.commandPrefix?`${t.commandPrefix} -${n}`:n,cwd:c.cwd,env:{},inheritEnv:!0};await t?.prepare?.(u,i,a);let l,d=Date.now(),h,m=!0;s({content:[],details:void 0});let f=await c.exec(u.command,{cwd:u.cwd,env:u.env,inheritEnv:u.inheritEnv,timeout:r,capture:{limits:{maxBytes:51200,maxLines:2e3,retain:"tail"},spill:!0},onUpdate:b=>{if(!m)return;l=R5(l,b);let S={content:[{type:"text",text:l.text}],details:{truncation:l.truncation.truncated?l.truncation:void 0,fullOutputPath:l.spillPath}},C=Date.now(),I=JSON.stringify(S),x=C-d>=qfs&&I!==h;s(S,x?{checkpoint:!0}:void 0),x&&(d=C,h=I)}},a);m=!1;let g=l?.text??"",A=f.ok?{text:g,...f.value}:l,y;if(A?.truncation.truncated){y={truncation:A.truncation,fullOutputPath:A.spillPath};let b=A.truncation.totalLines-A.truncation.outputLines+1,S=A.truncation.totalLines;if(A.truncation.lastLinePartial){let C=IT(A.lastLineBytes??A.truncation.outputBytes);g+=` +`)&&e.pop(),e}function Z4i(t){let e="";for(let n=0;n=55296&&r<=56319){if(n+1=56320&&i<=57343){e+=t[n]+t[n+1],n++;continue}}e+="\uFFFD"}else r>=56320&&r<=57343?e+="\uFFFD":e+=t[n]}return e}function ik(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}function $ke(t,e={}){let n=e.maxLines??2e3,r=e.maxBytes??51200,i=Cw(t),s=O5n(t),o=s.length;if(o<=n&&i<=r)return{content:t,truncated:!1,truncatedBy:null,totalLines:o,totalBytes:i,outputLines:o,outputBytes:i,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r};if(Cw(s[0])>r)return{content:"",truncated:!0,truncatedBy:"bytes",totalLines:o,totalBytes:i,outputLines:0,outputBytes:0,lastLinePartial:!1,firstLineExceedsLimit:!0,maxLines:n,maxBytes:r};let c=[],u=0,l="lines";for(let h=0;h0?1:0);if(u+g>r){l="bytes";break}c.push(f),u+=g}c.length>=n&&u<=r&&(l="lines");let d=c.join(` +`),m=Cw(d);return{content:d,truncated:!0,truncatedBy:l,totalLines:o,totalBytes:i,outputLines:c.length,outputBytes:m,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r}}function Wke(t,e={}){let n=e.maxLines??2e3,r=e.maxBytes??51200,i=Cw(t),s=O5n(t),o=s.length;if(o<=n&&i<=r)return{content:t,truncated:!1,truncatedBy:null,totalLines:o,totalBytes:i,outputLines:o,outputBytes:i,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r};let a=[],c=0,u="lines",l=!1;for(let h=s.length-1;h>=0&&a.length0?1:0);if(c+g>r){if(u="bytes",a.length===0){let A=e8i(f,r);a.unshift(A),c=Cw(A),l=!0}break}a.unshift(f),c+=g}a.length>=n&&c<=r&&(u="lines");let d=a.join(` +`),m=Cw(d);return{content:d,truncated:!0,truncatedBy:u,totalLines:o,totalBytes:i,outputLines:a.length,outputBytes:m,lastLinePartial:l,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r}}function e8i(t,e){if(e<=0)return"";let n=0,r=t.length,i=!1;for(let o=t.length;o>0;){let a=o-1,c=t.charCodeAt(a),u,l=!1;if(c>=56320&&c<=57343&&a>0){let d=t.charCodeAt(a-1);d>=55296&&d<=56319?(a--,u=4):(u=3,l=!0)}else c>=55296&&c<=57343?(u=3,l=!0):u=c<=127?1:c<=2047?2:3;if(n+u>e)break;n+=u,r=a,i||=l,o=a}let s=t.slice(r);return i?Z4i(s):s}function t8i(t,e=500){return t.length<=e?{text:t,wasTruncated:!1}:{text:`${t.slice(0,e)}... [truncated]`,wasTruncated:!0}}var XD,Pb,vSc,M5n,X4i,IV=v(()=>{p();XD=2e3,Pb=51200,vSc=500,M5n=globalThis.Buffer,X4i=/[^\x00-\x7f]/});function wV(t,e){switch(e.kind){case"replace":return e.output;case"append":return{text:`${t?.text??""}${e.text}`,...e.metadata};case"slide":return{text:`${t?.text.slice(e.drop)??""}${e.text}`,...e.metadata};case"metadata":return{text:t?.text??"",...e.metadata}}}function L5n(t){return t.replace(n8i,"")}var PSc,n8i,MSc,OSc,Hke=v(()=>{p();P5n();IV();PSc=100*1024,n8i=/[\x00-\x08\x0b-\x1f\ufff9-\ufffb]/g,MSc=new TextEncoder,OSc=new TextDecoder});function s8i(t){if(t!==void 0){if(!Number.isFinite(t)||t<=0)throw new Error("Invalid timeout: must be a finite number of seconds");if(t>F5n)throw new Error(`Invalid timeout: maximum is ${F5n} seconds`)}}function Q5n(t){return{name:"bash",label:"bash",description:`Execute a bash command in the current working directory. Returns combined stdout and stderr. Output is truncated to last ${2e3} lines or ${51200/1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.`,parameters:i8i,async execute(e,{command:n,timeout:r},i,s,o,a){s8i(r);let{env:c}=s,u={command:t?.commandPrefix?`${t.commandPrefix} +${n}`:n,cwd:c.cwd,env:{},inheritEnv:!0};await t?.prepare?.(u,s,a);let l,d=Date.now(),m,h=!0;i({content:[],details:void 0});let f=await c.exec(u.command,{cwd:u.cwd,env:u.env,inheritEnv:u.inheritEnv,timeout:r,capture:{limits:{maxBytes:51200,maxLines:2e3,retain:"tail"},spill:!0},onUpdate:E=>{if(!h)return;l=wV(l,E);let _={content:[{type:"text",text:l.text}],details:{truncation:l.truncation.truncated?l.truncation:void 0,fullOutputPath:l.spillPath}},S=Date.now(),C=JSON.stringify(_),I=S-d>=r8i&&C!==m;i(_,I?{checkpoint:!0}:void 0),I&&(d=S,m=C)}},a);h=!1;let g=l?.text??"",A=f.ok?{text:g,...f.value}:l,y;if(A?.truncation.truncated){y={truncation:A.truncation,fullOutputPath:A.spillPath};let E=A.truncation.totalLines-A.truncation.outputLines+1,_=A.truncation.totalLines;if(A.truncation.lastLinePartial){let S=ik(A.lastLineBytes??A.truncation.outputBytes);g+=` -[Showing last ${IT(A.truncation.outputBytes)} of line ${S} (line is ${C}). Full output: ${A.spillPath}]`}else A.truncation.truncatedBy==="lines"?g+=` +[Showing last ${ik(A.truncation.outputBytes)} of line ${_} (line is ${S}). Full output: ${A.spillPath}]`}else A.truncation.truncatedBy==="lines"?g+=` -[Showing lines ${b}-${S} of ${A.truncation.totalLines}. Full output: ${A.spillPath}]`:g+=` +[Showing lines ${E}-${_} of ${A.truncation.totalLines}. Full output: ${A.spillPath}]`:g+=` -[Showing lines ${b}-${S} of ${A.truncation.totalLines} (${IT(51200)} limit). Full output: ${A.spillPath}]`}if(!f.ok){let b=f.error.code==="timeout"?`Command timed out after ${r} seconds`:f.error.code==="aborted"?"Command aborted":f.error.message;throw new Error(g?`${g} +[Showing lines ${E}-${_} of ${A.truncation.totalLines} (${ik(51200)} limit). Full output: ${A.spillPath}]`}if(!f.ok){let E=f.error.code==="timeout"?`Command timed out after ${r} seconds`:f.error.code==="aborted"?"Command aborted":f.error.message;throw new Error(g?`${g} -${b}`:b,{cause:f.error})}if(f.value.exitCode!==0)throw new Error(`${g?`${g} +${E}`:E,{cause:f.error})}if(f.value.exitCode!==0)throw new Error(`${g?`${g} -`:""}Command exited with code ${f.value.exitCode}`);return{content:[{type:"text",text:g||"(no output)"}],details:y}}}}p();p();p();p();var sD=class{diff(e,n,r={}){let s;typeof r=="function"?(s=r,r={}):"callback"in r&&(s=r.callback);let i=this.castInput(e,r),o=this.castInput(n,r),a=this.removeEmpty(this.tokenize(i,r)),c=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(a,c,r,s)}diffWithOptionsObj(e,n,r,s){var i;let o=b=>{if(b=this.postProcess(b,r),s){setTimeout(function(){s(b)},0);return}else return b},a=n.length,c=e.length,u=1,l=a+c;r.maxEditLength!=null&&(l=Math.min(l,r.maxEditLength));let d=(i=r.timeout)!==null&&i!==void 0?i:1/0,h=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(m[0],n,e,0,r);if(m[0].oldPos+1>=c&&f+1>=a)return o(this.buildValues(m[0].lastComponent,n,e));let g=-1/0,A=1/0,y=()=>{for(let b=Math.max(g,-u);b<=Math.min(A,u);b+=2){let S,C=m[b-1],I=m[b+1];C&&(m[b-1]=void 0);let x=!1;if(I){let R=I.oldPos-b;x=I&&0<=R&&R=c&&f+1>=a)return o(this.buildValues(S.lastComponent,n,e))||!0;m[b]=S,S.oldPos+1>=c&&(A=Math.min(A,b-1)),f+1>=a&&(g=Math.max(g,b+1))}u++};if(s)(function b(){setTimeout(function(){if(u>l||Date.now()>h)return s(void 0);y()||b()},0)})();else for(;u<=l&&Date.now()<=h;){let b=y();if(b)return b}}addToPath(e,n,r,s,i){let o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:e.oldPos+s,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(e,n,r,s,i){let o=n.length,a=r.length,c=e.oldPos,u=c-s,l=0;for(;u+1h.length?f:h}),l.value=this.join(d)}else l.value=this.join(n.slice(c,c+l.count));c+=l.count,l.added||(u+=l.count)}}return s}};p();p();function eZe(t,e){let n;for(n=0;ne.length&&(n=t.length-e.length);let r=e.length;t.length0&&e[o]!=e[i];)i=s[i];e[o]==e[i]&&i++}i=0;for(let o=n;o0&&t[o]!=e[i];)i=s[i];t[o]==e[i]&&i++}return i}function rZe(t,e){let n=[];for(let r of Array.from(e.segment(t))){let s=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(s)?n[n.length-1]+=s:n.push(s)}return n}function uCe(t,e){if(e)return N5(t,e)[1];let n;for(n=t.length-1;n>=0&&t[n].match(/\s/);n--);return t.substring(n+1)}function uL(t,e){if(e)return N5(t,e)[0];let n=t.match(/^\s*/);return n?n[0]:""}function N5(t,e){if(!e)return[uL(t),uCe(t)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');let n=rZe(t,e),r=n[0],s=n[n.length-1],i=/\s/.test(r)?r:"",o=/\s/.test(s)?s:"";return[i,o]}var dCe="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Yfs=new RegExp(`[${dCe}]+|\\s+|[^${dCe}]`,"ug"),sZe=class extends sD{equals(e,n,r){return r.ignoreCase&&(e=e.toLowerCase(),n=n.toLowerCase()),e.trim()===n.trim()}tokenize(e,n={}){let r;if(n.intlSegmenter){let o=n.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=rZe(e,o)}else r=e.match(Yfs)||[];let s=[],i=null;return r.forEach(o=>{/\s/.test(o)?i==null?s.push(o):s.push(s.pop()+o):i!=null&&/\s/.test(i)?s[s.length-1]==i?s.push(s.pop()+o):s.push(i+o):s.push(o),i=o}),s}join(e){return e.map((n,r)=>r==0?n:n.replace(/^\s+/,"")).join("")}postProcess(e,n){if(!e||n.oneChangePerToken)return e;let r=null,s=null,i=null;return e.forEach(o=>{o.added?s=o:o.removed?i=o:((s||i)&&tbn(r,i,s,o,n.intlSegmenter),r=o,s=null,i=null)}),(s||i)&&tbn(r,i,s,null,n.intlSegmenter),e}},nbn=new sZe;function oZe(t,e,n){return n?.ignoreWhitespace!=null&&!n.ignoreWhitespace?sbn(t,e,n):nbn.diff(t,e,n)}function tbn(t,e,n,r,s){if(e&&n){let[i,o]=N5(e.value,s),[a,c]=N5(n.value,s);if(t){let u=eZe(i,a);t.value=lCe(t.value,a,u),e.value=k5(e.value,u),n.value=k5(n.value,u)}if(r){let u=tZe(o,c);r.value=cCe(r.value,c,u),e.value=jZ(e.value,u),n.value=jZ(n.value,u)}}else if(n){if(t){let i=uL(n.value,s);n.value=n.value.substring(i.length)}if(r){let i=uL(r.value,s);r.value=r.value.substring(i.length)}}else if(t&&r){let i=uL(r.value,s),[o,a]=N5(e.value,s),c=eZe(i,o);e.value=k5(e.value,c);let u=tZe(k5(i,c),a);e.value=jZ(e.value,u),r.value=cCe(r.value,i,u),t.value=lCe(t.value,i,i.slice(0,i.length-u.length))}else if(r){let i=uL(r.value,s),o=uCe(e.value,s),a=nZe(o,i);e.value=jZ(e.value,a)}else if(t){let i=uCe(t.value,s),o=uL(e.value,s),a=nZe(i,o);e.value=k5(e.value,a)}}var iZe=class extends sD{tokenize(e){let n=new RegExp(`(\\r?\\n)|[${dCe}]+|[^\\S\\n\\r]+|[^${dCe}]`,"ug");return e.match(n)||[]}},rbn=new iZe;function sbn(t,e,n){return rbn.diff(t,e,n)}p();var aZe=class extends sD{constructor(){super(...arguments),this.tokenize=Kfs}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(` +`:""}Command exited with code ${f.value.exitCode}`);return{content:[{type:"text",text:g||"(no output)"}],details:y}}}}var F5n,r8i,i8i,U5n=v(()=>{p();Vm();Hke();IV();F5n=2147483647/1e3,r8i=2e3,i8i=Ne.Object({command:Ne.String({description:"Bash command to execute"}),timeout:Ne.Optional(Ne.Number({description:"Timeout in seconds (optional, no default timeout)"}))})});var ZD,rpt=v(()=>{p();ZD=class{diff(e,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(e,r),o=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(a,c,r,i)}diffWithOptionsObj(e,n,r,i){var s;let o=E=>{if(E=this.postProcess(E,r),i){setTimeout(function(){i(E)},0);return}else return E},a=n.length,c=e.length,u=1,l=a+c;r.maxEditLength!=null&&(l=Math.min(l,r.maxEditLength));let d=(s=r.timeout)!==null&&s!==void 0?s:1/0,m=Date.now()+d,h=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(h[0],n,e,0,r);if(h[0].oldPos+1>=c&&f+1>=a)return o(this.buildValues(h[0].lastComponent,n,e));let g=-1/0,A=1/0,y=()=>{for(let E=Math.max(g,-u);E<=Math.min(A,u);E+=2){let _,S=h[E-1],C=h[E+1];S&&(h[E-1]=void 0);let I=!1;if(C){let k=C.oldPos-E;I=C&&0<=k&&k=c&&f+1>=a)return o(this.buildValues(_.lastComponent,n,e))||!0;h[E]=_,_.oldPos+1>=c&&(A=Math.min(A,E-1)),f+1>=a&&(g=Math.max(g,E+1))}u++};if(i)(function E(){setTimeout(function(){if(u>l||Date.now()>m)return i(void 0);y()||E()},0)})();else for(;u<=l&&Date.now()<=m;){let E=y();if(E)return E}}addToPath(e,n,r,i,s){let o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(e,n,r,i,s){let o=n.length,a=r.length,c=e.oldPos,u=c-i,l=0;for(;u+1m.length?f:m}),l.value=this.join(d)}else l.value=this.join(n.slice(c,c+l.count));c+=l.count,l.added||(u+=l.count)}}return i}}});function ipt(t,e){let n;for(n=0;ne.length&&(n=t.length-e.length);let r=e.length;t.length0&&e[o]!=e[s];)s=i[s];e[o]==e[s]&&s++}s=0;for(let o=n;o0&&t[o]!=e[s];)s=i[s];t[o]==e[s]&&s++}return s}function apt(t,e){let n=[];for(let r of Array.from(e.segment(t))){let i=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(i)?n[n.length-1]+=i:n.push(i)}return n}function Vke(t,e){if(e)return vV(t,e)[1];let n;for(n=t.length-1;n>=0&&t[n].match(/\s/);n--);return t.substring(n+1)}function LQ(t,e){if(e)return vV(t,e)[0];let n=t.match(/^\s*/);return n?n[0]:""}function vV(t,e){if(!e)return[LQ(t),Vke(t)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');let n=apt(t,e),r=n[0],i=n[n.length-1],s=/\s/.test(r)?r:"",o=/\s/.test(i)?i:"";return[s,o]}var G5n=v(()=>{p()});function upt(t,e,n){return n?.ignoreWhitespace!=null&&!n.ignoreWhitespace?q5n(t,e,n):W5n.diff(t,e,n)}function $5n(t,e,n,r,i){if(e&&n){let[s,o]=vV(e.value,i),[a,c]=vV(n.value,i);if(t){let u=ipt(s,a);t.value=jke(t.value,a,u),e.value=TV(e.value,u),n.value=TV(n.value,u)}if(r){let u=spt(o,c);r.value=qke(r.value,c,u),e.value=Sse(e.value,u),n.value=Sse(n.value,u)}}else if(n){if(t){let s=LQ(n.value,i);n.value=n.value.substring(s.length)}if(r){let s=LQ(r.value,i);r.value=r.value.substring(s.length)}}else if(t&&r){let s=LQ(r.value,i),[o,a]=vV(e.value,i),c=ipt(s,o);e.value=TV(e.value,c);let u=spt(TV(s,c),a);e.value=Sse(e.value,u),r.value=qke(r.value,s,u),t.value=jke(t.value,s,s.slice(0,s.length-u.length))}else if(r){let s=LQ(r.value,i),o=Vke(e.value,i),a=opt(o,s);e.value=Sse(e.value,a)}else if(t){let s=Vke(t.value,i),o=LQ(e.value,i),a=opt(s,o);e.value=TV(e.value,a)}}function q5n(t,e,n){return H5n.diff(t,e,n)}var Yke,a8i,cpt,W5n,lpt,H5n,j5n=v(()=>{p();rpt();G5n();Yke="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",a8i=new RegExp(`[${Yke}]+|\\s+|[^${Yke}]`,"ug"),cpt=class extends ZD{equals(e,n,r){return r.ignoreCase&&(e=e.toLowerCase(),n=n.toLowerCase()),e.trim()===n.trim()}tokenize(e,n={}){let r;if(n.intlSegmenter){let o=n.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=apt(e,o)}else r=e.match(a8i)||[];let i=[],s=null;return r.forEach(o=>{/\s/.test(o)?s==null?i.push(o):i.push(i.pop()+o):s!=null&&/\s/.test(s)?i[i.length-1]==s?i.push(i.pop()+o):i.push(s+o):i.push(o),s=o}),i}join(e){return e.map((n,r)=>r==0?n:n.replace(/^\s+/,"")).join("")}postProcess(e,n){if(!e||n.oneChangePerToken)return e;let r=null,i=null,s=null;return e.forEach(o=>{o.added?i=o:o.removed?s=o:((i||s)&&$5n(r,s,i,o,n.intlSegmenter),r=o,i=null,s=null)}),(i||s)&&$5n(r,s,i,null,n.intlSegmenter),e}},W5n=new cpt;lpt=class extends ZD{tokenize(e){let n=new RegExp(`(\\r?\\n)|[${Yke}]+|[^\\S\\n\\r]+|[^${Yke}]`,"ug");return e.match(n)||[]}},H5n=new lpt});function eP(t,e,n){return V5n.diff(t,e,n)}function c8i(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,` +`));let n=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i{p();rpt();dpt=class extends ZD{constructor(){super(...arguments),this.tokenize=c8i}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(` `))&&(e=e.trim()),(!r.newlineIsToken||!n.includes(` `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(` `)&&(e=e.slice(0,-1)),n.endsWith(` -`)&&(n=n.slice(0,-1))),super.equals(e,n,r)}},ibn=new aZe;function iD(t,e,n){return ibn.diff(t,e,n)}function Kfs(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,` -`));let n=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let s=0;s"u"&&(a.context=4);let c=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){let{callback:l}=a;iD(n,r,Object.assign(Object.assign({},a),{callback:d=>{let h=u(d);l(h)}}))}else return u(iD(n,r,a));function u(l){if(!l)return;l.push({value:"",lines:[]});function d(b){return b.map(function(S){return" "+S})}let h=[],m=0,f=0,g=[],A=1,y=1;for(let b=0;b0?d(I.lines.slice(-c)):[],m-=g.length,f-=g.length)}for(let I of C)g.push((S.added?"+":"-")+I);S.added?y+=C.length:A+=C.length}else{if(m)if(C.length<=c*2&&b1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(r=>pCe(r,e)).join(` -`)}let n=[];e.includeIndex&&t.oldFileName==t.newFileName&&n.push("Index: "+t.oldFileName),e.includeUnderline&&n.push("==================================================================="),e.includeFileHeaders&&(n.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),n.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader)));for(let r=0;r"u"&&(a.context=4);let c=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){let{callback:l}=a;eP(n,r,Object.assign(Object.assign({},a),{callback:d=>{let m=u(d);l(m)}}))}else return u(eP(n,r,a));function u(l){if(!l)return;l.push({value:"",lines:[]});function d(E){return E.map(function(_){return" "+_})}let m=[],h=0,f=0,g=[],A=1,y=1;for(let E=0;E0?d(C.lines.slice(-c)):[],h-=g.length,f-=g.length)}for(let C of S)g.push((_.added?"+":"-")+C);_.added?y+=S.length:A+=S.length}else{if(h)if(S.length<=c*2&&E1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(r=>zke(r,e)).join(` +`)}let n=[];e.includeIndex&&t.oldFileName==t.newFileName&&n.push("Index: "+t.oldFileName),e.includeUnderline&&n.push("==================================================================="),e.includeFileHeaders&&(n.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),n.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader)));for(let r=0;r{a(c?pCe(c,o.headerOptions):void 0)}}))}else{let a=cZe(t,e,n,r,s,i,o);return a?pCe(a,o?.headerOptions):void 0}}function zfs(t){let e=t.endsWith(` +`}function Ise(t,e,n,r,i,s,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:a}=o;mpt(t,e,n,r,i,s,Object.assign(Object.assign({},o),{callback:c=>{a(c?zke(c,o.headerOptions):void 0)}}))}else{let a=mpt(t,e,n,r,i,s,o);return a?zke(a,o?.headerOptions):void 0}}function l8i(t){let e=t.endsWith(` `),n=t.split(` `).map(r=>r+` -`);return e?n.pop():n.push(n.pop().slice(0,-1)),n}function cbn(t){let e=t.indexOf(`\r +`);return e?n.pop():n.push(n.pop().slice(0,-1)),n}var Y5n,Cse,z5n=v(()=>{p();ppt();Y5n={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0},Cse={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0}});var Kke=v(()=>{p();j5n();ppt();z5n()});function J5n(t){let e=t.indexOf(`\r `),n=t.indexOf(` `);return n===-1||e===-1?` `:ee.trimEnd()).join(` -`).replace(/[\u2018\u2019\u201A\u201B]/g,"'").replace(/[\u201C\u201D\u201E\u201F]/g,'"').replace(/[\u2010\u2011\u2012\u2013\u2014\u2015\u2212]/g,"-").replace(/[\u00A0\u2002-\u200A\u202F\u205F\u3000]/g," ")}function ubn(t){return t.match(/[^\n]*\n|[^\n]+/g)??[]}function Jfs(t){let e=0;return ubn(t).map(n=>{let r={start:e,end:e+n.length};return e=r.end,r})}function Xfs(t,e){let n=e.matchIndex,r=e.matchIndex+e.matchLength,s=-1;for(let o=0;o=a.start&&n=t.length)throw new Error("Replacement range is outside the base content.");return{startLine:s,endLine:i+1}}function dbn(t,e,n=0){let r=t;for(let s=e.length-1;s>=0;s--){let i=e[s],o=i.matchIndex-n;r=r.substring(0,o)+i.newText+r.substring(o+i.matchLength)}return r}function Zfs(t,e,n){let r=ubn(t),s=Jfs(e);if(r.length!==s.length)throw new Error("Cannot preserve unchanged lines because the base content has a different line count.");let i=[],o=[...n].sort((u,l)=>u.matchIndex-l.matchIndex);for(let u of o){let l=Xfs(s,u),d=i[i.length-1];if(d&&l.startLine({oldText:hCe(l.oldText),newText:hCe(l.newText)}));for(let l=0;labn(t,l.oldText)).some(l=>l.usedFuzzyMatch),o=i?zZ(t):t,a=[];for(let l=0;l1)throw ngs(n,l,r.length,m);a.push({editIndex:l,matchIndex:h.index,matchLength:h.matchLength,newText:d.newText})}a.sort((l,d)=>l.matchIndex-d.matchIndex);for(let l=1;lh.matchIndex)throw new Error(`edits[${d.editIndex}] and edits[${h.editIndex}] overlap in ${n}. Merge them into one edit or target disjoint regions.`)}let c=t,u=i?Zfs(t,o,a):dbn(o,a);if(c===u)throw sgs(n,r.length);return{baseContent:c,newContent:u}}function mbn(t,e,n,r=4){return KZ(t,t,e,n,void 0,void 0,{context:r,headerOptions:YZ})}function fbn(t,e,n=4){let r=iD(t,e),s=[],i=t.split(` +`).replace(/[\u2018\u2019\u201A\u201B]/g,"'").replace(/[\u201C\u201D\u201E\u201F]/g,'"').replace(/[\u2010\u2011\u2012\u2013\u2014\u2015\u2212]/g,"-").replace(/[\u00A0\u2002-\u200A\u202F\u205F\u3000]/g," ")}function Z5n(t){return t.match(/[^\n]*\n|[^\n]+/g)??[]}function u8i(t){let e=0;return Z5n(t).map(n=>{let r={start:e,end:e+n.length};return e=r.end,r})}function d8i(t,e){let n=e.matchIndex,r=e.matchIndex+e.matchLength,i=-1;for(let o=0;o=a.start&&n=t.length)throw new Error("Replacement range is outside the base content.");return{startLine:i,endLine:s+1}}function e3n(t,e,n=0){let r=t;for(let i=e.length-1;i>=0;i--){let s=e[i],o=s.matchIndex-n;r=r.substring(0,o)+s.newText+r.substring(o+s.matchLength)}return r}function p8i(t,e,n){let r=Z5n(t),i=u8i(e);if(r.length!==i.length)throw new Error("Cannot preserve unchanged lines because the base content has a different line count.");let s=[],o=[...n].sort((u,l)=>u.matchIndex-l.matchIndex);for(let u of o){let l=d8i(i,u),d=s[s.length-1];if(d&&l.startLine({oldText:Jke(l.oldText),newText:Jke(l.newText)}));for(let l=0;lK5n(t,l.oldText)).some(l=>l.usedFuzzyMatch),o=s?wse(t):t,a=[];for(let l=0;l1)throw f8i(n,l,r.length,h);a.push({editIndex:l,matchIndex:m.index,matchLength:m.matchLength,newText:d.newText})}a.sort((l,d)=>l.matchIndex-d.matchIndex);for(let l=1;lm.matchIndex)throw new Error(`edits[${d.editIndex}] and edits[${m.editIndex}] overlap in ${n}. Merge them into one edit or target disjoint regions.`)}let c=t,u=s?p8i(t,o,a):e3n(o,a);if(c===u)throw A8i(n,r.length);return{baseContent:c,newContent:u}}function r3n(t,e,n,r=4){return Ise(t,t,e,n,void 0,void 0,{context:r,headerOptions:Cse})}function i3n(t,e,n=4){let r=eP(t,e),i=[],s=t.split(` `),o=e.split(` -`),a=Math.max(i.length,o.length),c=String(a).length,u=1,l=1,d=!1,h;for(let m=0;m0&&(s.push(` ${"".padStart(c," ")} ...`),u+=C,l+=C)}else if(b){let S=Math.max(0,g.length-n);S>0&&(s.push(` ${"".padStart(c," ")} ...`),u+=S,l+=S);for(let C of g.slice(S)){let I=String(u).padStart(c," ");s.push(` ${I} ${C}`),u++,l++}}else u+=g.length,l+=g.length;d=!1}}return{diff:s.join(` -`),firstChangedLine:h}}p();var gbn=new WeakMap;function igs(t){let e=gbn.get(t);return e||(e={queues:new Map,registration:Promise.resolve()},gbn.set(t,e)),e}async function ogs(t,e,n){let r=A0(await t.absolutePath(e,n)),s=await t.canonicalPath(r,n);if(s.ok)return s.value;if(s.error.code==="not_found"||s.error.code==="not_supported")return r;throw s.error}async function mCe(t,e,n,r){let s=igs(t),i=s.registration.then(async()=>{let l=await ogs(t,e,r),d=s.queues.get(l)??Promise.resolve(),h=()=>{},m=new Promise(g=>{h=g}),f=d.then(()=>m);return s.queues.set(l,f),{key:l,currentQueue:d,chainedQueue:f,releaseNext:h}});s.registration=i.then(()=>{},()=>{});let{key:o,currentQueue:a,chainedQueue:c,releaseNext:u}=await i;await a;try{return await n()}finally{u(),s.queues.get(o)===c&&s.queues.delete(o)}}p();var ags=/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g,cgs="\u202F";function lgs(t){let e=t.replace(ags," ");return e.startsWith("@")?e.slice(1):e}async function JZ(t,e,n){return A0(await t.absolutePath(lgs(e),n))}async function Abn(t,e,n){let r=await JZ(t,e,n),s=[r,r.replace(/ (AM|PM)\./gi,`${cgs}$1.`),r.normalize("NFD"),r.replace(/'/g,"\u2019"),r.normalize("NFD").replace(/'/g,"\u2019")];for(let i of new Set(s))if(A0(await t.exists(i,n)))return i;return r}var ugs=Oe.Object({oldText:Oe.String({description:"Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call."}),newText:Oe.String({description:"Replacement text for this targeted edit."})},{}),dgs=Oe.Object({path:Oe.String({description:"Path to the file to edit (relative or absolute)"}),edits:Oe.Array(ugs,{description:"One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead."})},{});function ybn(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.oldText=="string"&&typeof e.newText=="string"}function pgs(t){if(!t||typeof t!="object")return t;let e=t;if(typeof e.edits=="string")try{let a=JSON.parse(e.edits);Array.isArray(a)?e.edits=a:ybn(a)&&(e.edits=[a])}catch{}else ybn(e.edits)&&(e.edits=[e.edits]);let n=e;if(typeof n.oldText!="string"||typeof n.newText!="string")return e;let r=Array.isArray(n.edits)?[...n.edits]:[];r.push({oldText:n.oldText,newText:n.newText});let{oldText:s,newText:i,...o}=n;return{...o,edits:r}}function hgs(t){if(!Array.isArray(t.edits)||t.edits.length===0)throw new Error("Edit tool input is invalid. edits must contain at least one replacement.");return{path:t.path,edits:t.edits}}function uZe(t,e){return new Error(`Could not edit file: ${t}. Error code: ${e.code}.`,{cause:e})}function Ebn(){return{name:"edit",label:"edit",description:"Edit a single file using exact text replacement. Every edits[].oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit instead of emitting overlapping edits. Do not include large unchanged regions just to connect distant changes.",parameters:dgs,prepareArguments:pgs,async execute(t,e,n,{env:r},s,i){let{path:o,edits:a}=hgs(e),c=await JZ(r,o,i);return mCe(r,c,async()=>{if(i.abortSignal?.aborted)throw new Error("Operation aborted");let u=await r.fileInfo(c,i);if(!u.ok)throw uZe(o,u.error);if(u.value.kind!=="file"&&u.value.kind!=="symlink")throw new Error(`Could not edit file: ${o}. Path is not a file.`);let l=await r.readTextFile(c,i);if(!l.ok)throw uZe(o,l.error);if(i.abortSignal?.aborted)throw new Error("Operation aborted");let{bom:d,text:h}=pbn(l.value),m=cbn(h),f=hCe(h),{baseContent:g,newContent:A}=hbn(f,a,o);if(i.abortSignal?.aborted)throw new Error("Operation aborted");let y=d+lbn(A,m),b=await r.writeFile(c,y,i);if(!b.ok)throw uZe(o,b.error);if(i.abortSignal?.aborted)throw new Error("Operation aborted");let S=fbn(g,A);return{content:[{type:"text",text:`Successfully replaced ${a.length} block(s) in ${o}.`}],details:{diff:S.diff,patch:mbn(o,g,A),firstChangedLine:S.firstChangedLine}}},i)}}}p();p();var pZe=[137,80,78,71,13,10,26,10];function _bn(t){if(bbn(t,[255,216,255]))return t[3]===247?void 0:"image/jpeg";if(bbn(t,pZe))return mgs(t)&&!fgs(t)?"image/png":void 0;if(dL(t,0,"GIF"))return"image/gif";if(dL(t,0,"RIFF")&&dL(t,8,"WEBP"))return"image/webp";if(dL(t,0,"BM")&&ggs(t))return"image/bmp"}function Sbn(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="";for(let r=0;r>2],n+=e[(s&3)<<4|(i??0)>>4],n+=i===void 0?"=":e[(i&15)<<2|(o??0)>>6],n+=o===void 0?"=":e[o&63]}return n}function mgs(t){return t.length>=16&&Cbn(t,pZe.length)===13&&dL(t,12,"IHDR")}function fgs(t){let e=pZe.length;for(;e+8<=t.length;){let n=Cbn(t,e),r=e+4;if(dL(t,r,"acTL"))return!0;if(dL(t,r,"IDAT"))return!1;let s=e+8+n+4;if(s<=e||s>t.length)return!1;e=s}return!1}function ggs(t){if(t.length<26)return!1;let e=dZe(t,2),n=dZe(t,10),r=dZe(t,14);if(e!==0&&e<26||n<14+r||e!==0&&n>=e)return!1;let s,i;if(r===12)s=fCe(t,22),i=fCe(t,24);else if(r>=40&&r<=124){if(t.length<30)return!1;s=fCe(t,26),i=fCe(t,28)}else return!1;return s===1&&[1,4,8,16,24,32].includes(i)}function fCe(t,e){return(t[e]??0)+((t[e+1]??0)<<8)}function Cbn(t,e){return(t[e]??0)*16777216+((t[e+1]??0)<<16)+((t[e+2]??0)<<8)+(t[e+3]??0)}function dZe(t,e){return(t[e]??0)+((t[e+1]??0)<<8)+((t[e+2]??0)<<16)+(t[e+3]??0)*16777216}function bbn(t,e){return t.lengtht[r]===n)}function dL(t,e,n){if(t.length0?` -${x.hints.join(` -`)}`:"";return{content:[{type:"text",text:`Read image file [${x.mimeType}]${w}`},{type:"image",data:x.data,mimeType:x.mimeType}],details:void 0}}return d==="image/bmp"?{content:[{type:"text",text:`Read image file [image/bmp] -[Image omitted: configure an imageProcessor to convert BMP images.]`}],details:void 0}:{content:[{type:"text",text:`Read image file [${d}]`},{type:"image",data:Sbn(l),mimeType:d}],details:void 0}}let m=new TextDecoder().decode(l).split(` -`),f=m.length,g=r?Math.max(0,r-1):0,A=g+1;if(g>=m.length)throw new Error(`Offset ${r} is beyond end of file (${m.length} lines total)`);let y,b;if(s!==void 0){let x=Math.min(g+s,m.length);y=m.slice(g,x).join(` -`),b=x-g}else y=m.slice(g).join(` -`);let S=oCe(y),C,I;if(S.firstLineExceedsLimit){let x=IT(new TextEncoder().encode(m[g]).byteLength);C=`[Line ${A} is ${x}, exceeds ${IT(51200)} limit. Use bash: sed -n '${A}p' ${n} | head -c ${51200}]`,I={truncation:S}}else if(S.truncated){let x=A+S.outputLines-1,w=x+1;C=S.content,S.truncatedBy==="lines"?C+=` - -[Showing lines ${A}-${x} of ${f}. Use offset=${w} to continue.]`:C+=` - -[Showing lines ${A}-${x} of ${f} (${IT(51200)} limit). Use offset=${w} to continue.]`,I={truncation:S}}else if(b!==void 0&&g+b{if(o.abortSignal?.aborted)throw new Error("Operation aborted");if(A0(await s.writeFile(a,n,o)),o.abortSignal?.aborted)throw new Error("Operation aborted");return{content:[{type:"text",text:`Successfully wrote to ${e}`}],details:void 0}},o)}}}p();function wbn(t){return{output:t.text,truncation:{content:t.text,...t.truncation},...t.spillPath===void 0?{}:{fullOutputPath:t.spillPath},lastLineBytes:t.lastLineBytes??0}}async function Egs(t,e,n,r){let s,i=await t.exec(e,{cwd:n?.cwd,env:n?.env,inheritEnv:n?.inheritEnv,timeout:n?.timeout,capture:{limits:{maxBytes:51200,maxLines:2e3,retain:"tail"},spill:!0},onUpdate:(a,c)=>{let u=s;s=R5(s,a);let l=a.kind==="append"||a.kind==="slide"?a.text:a.kind==="replace"&&u===void 0?s.text:void 0;l&&n?.onChunk?.(l,()=>wbn(s),c)}},r);if(s===void 0){let{content:a,...c}=aCe("");s={text:a,truncation:c}}let o=wbn(s);return i.ok?bd({...o,exitCode:i.value.exitCode,cancelled:!1,truncated:i.value.truncation.truncated}):i.error.code==="aborted"||r.abortSignal?.aborted?bd({...o,exitCode:void 0,cancelled:!0,truncated:o.truncation.truncated}):n?.returnExecutionErrors?bd({...o,exitCode:void 0,cancelled:!1,truncated:o.truncation.truncated,executionError:i.error}):_d(i.error)}p();var hZe=class extends RR{constructor(){super(e=>e.type==="done"||e.type==="error",e=>{if(e.type==="done")return e.message;if(e.type==="error")return e.error;throw new Error("Unexpected event type")})}};function bgs(t){return{temperature:t.temperature,samplingParams:t.samplingParams,maxTokens:t.maxTokens,reasoning:t.reasoning,cacheRetention:t.cacheRetention,sessionId:t.sessionId,headers:t.headers,metadata:t.metadata,transport:t.transport,thinkingBudgets:t.thinkingBudgets,maxRetryDelayMs:t.maxRetryDelayMs}}function _gs(t,e,n){let r=new hZe;return(async()=>{let s={role:"assistant",stopReason:"pending",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},timestamp:Date.now()},i,o=()=>{i&&i.cancel("Request aborted by user").catch(()=>{})};n.signal&&n.signal.addEventListener("abort",o);try{let a=await fetch(`${n.proxyUrl}/api/stream`,{method:"POST",headers:{Authorization:`Bearer ${n.authToken}`,"Content-Type":"application/json"},body:JSON.stringify({model:t,context:e,options:bgs(n)}),signal:n.signal});if(!a.ok){let h=`Proxy error: ${a.status} ${a.statusText}`;try{let m=await a.json();m.error&&(h=`Proxy error: ${m.error}`)}catch{}throw new Error(h)}i=a.body.getReader();let c=new TextDecoder,u="",l=!1,d=h=>{if(!h.startsWith("data: "))return;let m=h.slice(6).trim();if(!m)return;let f=JSON.parse(m),g=Sgs(f,s);g&&((g.type==="done"||g.type==="error")&&(l=!0),r.push(g))};for(;;){let{done:h,value:m}=await i.read();if(h)break;if(n.signal?.aborted)throw new Error("Request aborted by user");u+=c.decode(m,{stream:!0});let f=u.split(` -`);u=f.pop()||"";for(let g of f)d(g)}if(n.signal?.aborted)throw new Error("Request aborted by user");u+=c.decode(),u&&d(u),l||(s.stopReason="error",s.errorMessage="Connection closed by proxy server before the response completed",r.push({type:"error",reason:"error",error:s})),r.end()}catch(a){let c=a instanceof Error?a.message:String(a),u=n.signal?.aborted?"aborted":"error";s.stopReason=u,s.errorMessage=c,r.push({type:"error",reason:u,error:s}),r.end()}finally{n.signal&&n.signal.removeEventListener("abort",o)}})(),r}function Sgs(t,e){switch(t.type){case"start":return{type:"start",partial:e};case"text_start":return e.content[t.contentIndex]={type:"text",text:""},{type:"text_start",contentIndex:t.contentIndex,partial:e};case"text_delta":{let n=e.content[t.contentIndex];if(n?.type==="text")return n.text+=t.delta,{type:"text_delta",contentIndex:t.contentIndex,delta:t.delta,partial:e};throw new Error("Received text_delta for non-text content")}case"text_end":{let n=e.content[t.contentIndex];if(n?.type==="text")return n.textSignature=t.contentSignature,{type:"text_end",contentIndex:t.contentIndex,content:n.text,partial:e};throw new Error("Received text_end for non-text content")}case"thinking_start":return e.content[t.contentIndex]={type:"thinking",thinking:""},{type:"thinking_start",contentIndex:t.contentIndex,partial:e};case"thinking_delta":{let n=e.content[t.contentIndex];if(n?.type==="thinking")return n.thinking+=t.delta,{type:"thinking_delta",contentIndex:t.contentIndex,delta:t.delta,partial:e};throw new Error("Received thinking_delta for non-thinking content")}case"thinking_end":{let n=e.content[t.contentIndex];if(n?.type==="thinking")return n.thinkingSignature=t.contentSignature,{type:"thinking_end",contentIndex:t.contentIndex,content:n.thinking,partial:e};throw new Error("Received thinking_end for non-thinking content")}case"toolcall_start":return e.content[t.contentIndex]={type:"toolCall",id:t.id,name:t.toolName,arguments:{},partialJson:""},{type:"toolcall_start",contentIndex:t.contentIndex,partial:e};case"toolcall_delta":{let n=e.content[t.contentIndex];if(n?.type==="toolCall")return n.partialJson+=t.delta,n.arguments=va(n.partialJson)||{},e.content[t.contentIndex]={...n},{type:"toolcall_delta",contentIndex:t.contentIndex,delta:t.delta,partial:e};throw new Error("Received toolcall_delta for non-toolCall content")}case"toolcall_end":{let n=e.content[t.contentIndex];return n?.type==="toolCall"?(Object.assign(n,t.toolCall),delete n.partialJson,{type:"toolcall_end",contentIndex:t.contentIndex,toolCall:n,partial:e}):void 0}case"done":return e.stopReason=t.reason,e.usage=t.usage,t.providerThinkingLevel!==void 0&&(e.providerThinkingLevel=t.providerThinkingLevel),{type:"done",reason:t.reason,message:e};case"error":return e.stopReason=t.reason,e.errorMessage=t.errorMessage,e.usage=t.usage,t.providerThinkingLevel!==void 0&&(e.providerThinkingLevel=t.providerThinkingLevel),{type:"error",reason:t.reason,error:e};default:{let n=t;console.warn(`Unhandled proxy event type: ${t.type}`);return}}}p();p();var mZe={};p();p();var Dbn=require("node:module"),Bbn=Gt(vbn(),1),Pbn=Gt(Nbn(),1);function Cgs(t){throw t}var Igs=t=>import(t);function Obn(t,e={}){return e.transform||(e={...e,transform:Pbn.default}),(0,Bbn.default)(t,e,{onError:Cgs,nativeImport:Igs,createRequire:Dbn.createRequire})}p();var Mbn=require("node:events");function D5(){let t=new Mbn.EventEmitter;return{emit:(e,n)=>{t.emit(e,n)},on:(e,n)=>{let r=async s=>{try{await n(s)}catch(i){console.error(`Event handler error (${e}):`,i)}};return t.on(e,r),()=>t.off(e,r)},clear:()=>{t.removeAllListeners()}}}p();var Lbn=require("node:child_process");async function Fbn(t,e,n,r){return new Promise(s=>{let i=(0,Lbn.spawn)(t,e,{cwd:n,shell:!1,stdio:["ignore","pipe","pipe"]}),o="",a="",c=!1,u,l=()=>{c||(c=!0,i.kill("SIGTERM"),setTimeout(()=>{i.killed||i.kill("SIGKILL")},5e3))};r?.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l,{once:!0})),r?.timeout&&r.timeout>0&&(u=setTimeout(()=>{l()},r.timeout)),i.stdout?.on("data",d=>{o+=d.toString()}),i.stderr?.on("data",d=>{a+=d.toString()}),q3(i).then(d=>{u&&clearTimeout(u),r?.signal&&r.signal.removeEventListener("abort",l),s({stdout:o,stderr:a,code:d??0,killed:c})}).catch(d=>{u&&clearTimeout(u),r?.signal&&r.signal.removeEventListener("abort",l),s({stdout:o,stderr:a,code:1,killed:c})})})}p();var Ubn=require("node:fs");var xgs=["extensions","skills","prompts","themes"];function Qbn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function pL(t){try{let e=JSON.parse(Mi((0,Ubn.readFileSync)(t,"utf-8")));if(!Qbn(e)||!Qbn(e.pi))return null;let n={};for(let r of xgs){let s=e.pi[r];Array.isArray(s)&&s.every(i=>typeof i=="string")&&(n[r]=s)}return n}catch{return null}}p();function B5(t,e){return{path:t,source:e.source,scope:e.scope,origin:e.origin,baseDir:e.baseDir}}function rh(t,e){return{path:t,source:e.source,scope:e.scope??"temporary",origin:e.origin??"top-level",baseDir:e.baseDir}}p();var fZe=process.env.PI_TIMING==="1",ACe=new Map;function XZ(t="main"){fZe&&ACe.set(t,{timings:[],lastTime:Date.now()})}function ap(t,e="main"){if(!fZe)return;let n=Date.now();ACe.has(e)||XZ(e);let r=ACe.get(e);r.timings.push({label:t,ms:n-r.lastTime}),r.lastTime=n}function wgs(t,e){let n=e.filter(r=>r.ms>=0);if(n.length!==0){console.error(` ---- ${t} ---`);for(let r of n)console.error(` ${r.label}: ${r.ms}ms`);console.error(` TOTAL: ${n.reduce((r,s)=>r+s.ms,0)}ms`),console.error(`${"-".repeat(t.length+8)} -`)}}function ZZ(){if(fZe)for(let[t,e]of ACe)wgs(`Startup Timings: ${t}`,e.timings)}var gZe={typebox:wAe,"typebox/compile":Rye,"typebox/value":vye,"@sinclair/typebox":wAe,"@sinclair/typebox/compile":Rye,"@sinclair/typebox/value":vye,"@earendil-works/pi-agent-core":gCe,"@earendil-works/pi-tui":TX,"@earendil-works/pi-ai":g3,"@earendil-works/pi-ai/compat":g3,"@earendil-works/pi-ai/oauth":mZe,"@earendil-works/pi-ai/providers/all":Z7,"@earendil-works/pi-coding-agent":yCe,"@mariozechner/pi-agent-core":gCe,"@mariozechner/pi-tui":TX,"@mariozechner/pi-ai":g3,"@mariozechner/pi-ai/compat":g3,"@mariozechner/pi-ai/oauth":mZe,"@mariozechner/pi-ai/providers/all":Z7,"@mariozechner/pi-coding-agent":yCe},B5a=(0,Gbn.createRequire)(_),Tgs="sea"in process.features&&process.features.sea===!0||process.getBuiltinModule("node:sea")?.isSea()===!0,vgs=!wN&&dg.extname((0,Wbn.fileURLToPath)(_))===".ts";var eee,EZe=0,yZe=new Map;function bZe(){yZe.clear(),eee=void 0,EZe++}function Rgs(t){let e=jn(t);return eee!==void 0&&eee!==e&&bZe(),eee=e,{cwd:e,generation:EZe}}function P5(){let t=()=>{throw new Error("Extension runtime not initialized. Action methods cannot be called during extension loading.")},e={},n=new Set,s={sendMessage:t,sendUserMessage:t,appendEntry:t,setSessionName:t,getSessionName:t,setLabel:t,getActiveTools:t,getAllTools:t,setActiveTools:t,refreshTools:()=>{},getCommands:t,setModel:()=>Promise.reject(new Error("Extension runtime not initialized")),getThinkingLevel:t,setThinkingLevel:t,flagValues:new Map,pendingProviderRegistrations:[],pendingNativeProviderRegistrations:[],assertActive:()=>{if(e.staleMessage)throw new Error(e.staleMessage)},invalidate:i=>{if(!e.staleMessage){e.staleMessage=i??"This extension ctx is stale after session replacement or reload. Do not use a captured pi or command ctx after ctx.newSession(), ctx.fork(), ctx.switchSession(), or ctx.reload(). For newSession, fork, and switchSession, move post-replacement work into withSession and use the ctx passed to withSession. For reload, do not use the old ctx after await ctx.reload().";for(let o of n)o();n.clear()}},trackEventBusSubscription:i=>{let o=!0,a=()=>{o&&(o=!1,n.delete(a),i())};return n.add(a),a},registerProvider:(i,o,a="")=>{s.pendingProviderRegistrations.push({name:i,config:o,extensionPath:a})},registerNativeProvider:(i,o="")=>{s.pendingNativeProviderRegistrations.push({provider:i,extensionPath:o})},unregisterProvider:i=>{s.pendingProviderRegistrations=s.pendingProviderRegistrations.filter(o=>o.name!==i),s.pendingNativeProviderRegistrations=s.pendingNativeProviderRegistrations.filter(o=>o.provider.id!==i)}};return s}function kgs(t,e,n,r){let s=new Map,i=[],o=[],a="loading",c=()=>{if(a==="failed")throw new Error(`Extension "${t.path}" failed to load and its API is no longer active.`);e.assertActive()},u=h=>{a==="loading"?i.push(h):h()},l=()=>{s.clear(),i.length=0,o.length=0};return{api:{on(h,m){c();let f=t.handlers.get(h)??[];f.push(m),t.handlers.set(h,f)},registerTool(h){c(),t.tools.set(h.name,{definition:h,sourceInfo:t.sourceInfo}),e.refreshTools()},registerCommand(h,m){c(),t.commands.set(h,{name:h,sourceInfo:t.sourceInfo,...m})},registerShortcut(h,m){c(),t.shortcuts.set(h,{shortcut:h,extensionPath:t.path,...m})},registerFlag(h,m){if(c(),m.default!==void 0&&typeof m.default!==m.type)throw new Error(`Invalid default for flag "${h}": expected ${m.type}, got ${typeof m.default}`);t.flags.set(h,{name:h,extensionPath:t.path,...m}),m.default!==void 0&&!e.flagValues.has(h)&&(a==="loading"?s.has(h)||s.set(h,m.default):e.flagValues.set(h,m.default))},registerMessageRenderer(h,m){c(),t.messageRenderers.set(h,m)},registerMarkdownTransformer(h){c(),t.markdownTransformer=h},registerEntryRenderer(h,m){c(),t.entryRenderers??=new Map,t.entryRenderers.set(h,m)},getFlag(h){if(c(),!!t.flags.has(h))return e.flagValues.has(h)?e.flagValues.get(h):s.get(h)},sendMessage(h,m){c(),e.sendMessage(h,m)},sendUserMessage(h,m){c(),e.sendUserMessage(h,m)},appendEntry(h,m){c(),e.appendEntry(h,m)},setSessionName(h){c(),e.setSessionName(h)},getSessionName(){return c(),e.getSessionName()},setLabel(h,m){c(),e.setLabel(h,m)},exec(h,m,f){return c(),Fbn(h,m,f?.cwd??n,f)},getActiveTools(){return c(),e.getActiveTools()},getAllTools(){return c(),e.getAllTools()},setActiveTools(h){c(),e.setActiveTools(h)},getCommands(){return c(),e.getCommands()},setModel(h){return c(),e.setModel(h)},getThinkingLevel(){return c(),e.getThinkingLevel()},setThinkingLevel(h){c(),e.setThinkingLevel(h)},registerProvider(h,m){if(c(),typeof h=="string"){if(!m)throw new Error("Provider config is required when registering by name");u(()=>e.registerProvider(h,m,t.path));return}u(()=>e.registerNativeProvider(h,t.path))},unregisterProvider(h){c(),u(()=>e.unregisterProvider(h,t.path))},events:{emit(h,m){c(),r.emit(h,m)},on(h,m){c();let f=e.trackEventBusSubscription(r.on(h,m));return a==="loading"&&o.push(f),f}}},commit:()=>{if(a==="loading"){e.assertActive();for(let[h,m]of s)e.flagValues.has(h)||e.flagValues.set(h,m);for(let h of i)h();a="active",l()}},discard:()=>{if(a==="loading"){a="failed";for(let h of o)h();l()}}}}function $bn(t){return t!==void 0&&eee===t.cwd&&EZe===t.generation}async function Ngs(t,e){if($bn(e)){let i=yZe.get(t);if(i)return i}let s=await Obn(_,{moduleCache:!1,...wN||Tgs||rrn?{virtualModules:gZe,tryNative:!1}:vgs?{virtualModules:gZe,tsconfigPaths:!0}:{virtualModules:gZe,tryNative:!1}}).import(t,{default:!0});if(typeof s=="function")return $bn(e)&&yZe.set(t,s),s}function Dgs(t,e){let n=t.startsWith("<")&&t.endsWith(">")?t.slice(1,-1).split(":")[0]||"temporary":"local",r=t.startsWith("<")?void 0:dg.dirname(e);return{path:t,resolvedPath:e,sourceInfo:rh(t,{source:n,baseDir:r}),handlers:new Map,tools:new Map,messageRenderers:new Map,entryRenderers:new Map,commands:new Map,flags:new Map,shortcuts:new Map}}async function qbn(t,e,n,r,s,i){let o=Dgs(e,n),a=kgs(o,i,r,s);try{await t(a.api),a.commit()}catch(c){throw a.discard(),c}return ap(`${e} factory`,"extensions"),o}async function Bgs(t,e,n,r,s){let i=jn(t,e,{normalizeUnicodeSpaces:!0});try{let o=await Ngs(i,s);return ap(`${t} module import`,"extensions"),o?{extension:await qbn(o,t,i,e,n,r),error:null}:{extension:null,error:`Extension does not export a valid factory function: ${t}`}}catch(o){return{extension:null,error:`Failed to load extension: ${o instanceof Error?o.message:String(o)}`}}}async function _Ze(t,e,n,r,s=""){let i=jn(e);return qbn(t,s,s,i,n,r)}async function Hbn(t,e,n,r,s=!1){let i=[],o=[],a=s?Rgs(e):void 0,c=a?.cwd??jn(e),u=n??D5(),l=r??P5();for(let d of t){let{extension:h,error:m}=await Bgs(d,c,u,l,a);if(m){o.push({path:d,error:m});continue}h&&i.push(h)}return{extensions:i,errors:o,runtime:l}}async function Vbn(t,e,n,r){return Hbn(t,e,n,r)}async function ECe(t,e,n,r){return Hbn(t,e,n,r,!0)}function Pgs(t){return t.endsWith(".ts")||t.endsWith(".js")}function jbn(t){let e=dg.join(t,"package.json");if(S0.existsSync(e)){let s=pL(e);if(s?.extensions?.length){let i=[];for(let o of s.extensions){let a=dg.resolve(t,o);S0.existsSync(a)&&i.push(a)}if(i.length>0)return i}}let n=dg.join(t,"index.ts"),r=dg.join(t,"index.js");return S0.existsSync(n)?[n]:S0.existsSync(r)?[r]:null}function AZe(t){if(!S0.existsSync(t))return[];let e=[];try{let n=S0.readdirSync(t,{withFileTypes:!0});for(let r of n){let s=dg.join(t,r.name);if((r.isFile()||r.isSymbolicLink())&&Pgs(r.name)){e.push(s);continue}if(r.isDirectory()||r.isSymbolicLink()){let i=jbn(s);i&&e.push(...i)}}}catch{return[]}return e}async function SZe(t,e,n=ls(),r){let s=jn(e),i=jn(n),o=[],a=new Set,c=d=>{for(let h of d){let m=dg.resolve(h);a.has(m)||(a.add(m),o.push(h))}},u=dg.join(s,ws,"extensions");c(AZe(u));let l=dg.join(i,"extensions");c(AZe(l));for(let d of t){let h=jn(d,s,{normalizeUnicodeSpaces:!0});if(S0.existsSync(h)&&S0.statSync(h).isDirectory()){let m=jbn(h);if(m){c(m);continue}c(AZe(h));continue}c([h])}return Vbn(o,s,r)}p();var Ogs=["app.interrupt","app.clear","app.exit","app.suspend","app.thinking.cycle","app.model.cycleForward","app.model.cycleBackward","app.model.select","app.tools.expand","app.thinking.toggle","app.editor.external","app.message.copy","app.message.followUp","tui.input.submit","tui.select.confirm","tui.select.cancel","tui.input.copy","tui.editor.deleteToLineEnd"],Mgs=t=>{let e={};for(let[n,r]of Object.entries(t)){if(r===void 0)continue;let s=Array.isArray(r)?r:[r],i=Ogs.includes(n);for(let o of s){let a=o.toLowerCase();e[a]?.restrictOverride&&!i||(e[a]={keybinding:n,restrictOverride:i})}}return e};async function tee(t,e){return t.hasHandlers("session_shutdown")?(await t.emit(e),!0):!1}async function Ybn(t,e,n){let r=[];for(let s of t.extensions){let i=s.handlers.get("project_trust");if(!(!i||i.length===0))for(let o of i)try{let a=await o(e,n);if(a.trusted==="undecided")continue;return{result:a,errors:r}}catch(a){r.push({extensionPath:s.path,event:e.type,error:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0})}}return{errors:r}}var CZe={select:async()=>{},confirm:async()=>!1,input:async()=>{},notify:()=>{},onTerminalInput:()=>()=>{},setStatus:()=>{},setWorkingMessage:()=>{},setWorkingVisible:()=>{},setWorkingIndicator:()=>{},setHiddenThinkingLabel:()=>{},setWidget:()=>{},setFooter:()=>{},setHeader:()=>{},setTitle:()=>{},custom:async()=>{},pasteToEditor:()=>{},setEditorText:()=>{},getEditorText:()=>"",editor:async()=>{},addAutocompleteProvider:()=>{},setEditorComponent:()=>{},getEditorComponent:()=>{},get theme(){return Se},getAllThemes:()=>[],getTheme:()=>{},setTheme:t=>({success:!1,error:"UI not available"}),getToolsExpanded:()=>!1,setToolsExpanded:()=>{}},hL=class{extensions;runtime;uiContext;mode="print";cwd;sessionManager;modelRegistry;errorListeners=new Set;getModel=()=>{};getScopedModels=()=>[];isIdleFn=()=>!0;isProjectTrustedFn=()=>!0;getSignalFn=()=>{};waitForIdleFn=async()=>{};abortFn=()=>{};hasPendingMessagesFn=()=>!1;getContextUsageFn=()=>{};compactFn=()=>{};getSystemPromptFn=()=>"";getSystemPromptOptionsFn=()=>({cwd:this.cwd});newSessionHandler=async()=>({cancelled:!1});forkHandler=async()=>({cancelled:!1});navigateTreeHandler=async()=>({cancelled:!1});switchSessionHandler=async()=>({cancelled:!1});reloadHandler=async()=>{};shutdownHandler=()=>{};shortcutDiagnostics=[];commandDiagnostics=[];staleMessage;uiPromptDepth=0;activeUIPrompt;constructor(e,n,r,s,i){this.extensions=e,this.runtime=n,this.uiContext=CZe,this.cwd=r,this.sessionManager=s,this.modelRegistry=i}bindCore(e,n,r){this.runtime.sendMessage=e.sendMessage,this.runtime.sendUserMessage=e.sendUserMessage,this.runtime.appendEntry=e.appendEntry,this.runtime.setSessionName=e.setSessionName,this.runtime.getSessionName=e.getSessionName,this.runtime.setLabel=e.setLabel,this.runtime.getActiveTools=e.getActiveTools,this.runtime.getAllTools=e.getAllTools,this.runtime.setActiveTools=e.setActiveTools,this.runtime.refreshTools=e.refreshTools,this.runtime.getCommands=e.getCommands,this.runtime.setModel=e.setModel,this.runtime.getThinkingLevel=e.getThinkingLevel,this.runtime.setThinkingLevel=e.setThinkingLevel,this.getModel=n.getModel,this.getScopedModels=n.getScopedModels,this.isIdleFn=n.isIdle,this.isProjectTrustedFn=n.isProjectTrusted,this.getSignalFn=n.getSignal,this.abortFn=n.abort,this.hasPendingMessagesFn=n.hasPendingMessages,this.shutdownHandler=n.shutdown,this.getContextUsageFn=n.getContextUsage,this.compactFn=n.compact,this.getSystemPromptFn=n.getSystemPrompt,this.getSystemPromptOptionsFn=n.getSystemPromptOptions??(()=>({cwd:this.cwd}));for(let{name:s,config:i,extensionPath:o}of this.runtime.pendingProviderRegistrations)try{r?.registerProvider?r.registerProvider(s,i):this.modelRegistry.registerProvider(s,i)}catch(a){this.emitError({extensionPath:o,event:"register_provider",error:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0})}this.runtime.pendingProviderRegistrations=[];for(let{provider:s,extensionPath:i}of this.runtime.pendingNativeProviderRegistrations)try{r?.registerNativeProvider?r.registerNativeProvider(s):this.modelRegistry.registerProvider(s)}catch(o){this.emitError({extensionPath:i,event:"register_provider",error:o instanceof Error?o.message:String(o),stack:o instanceof Error?o.stack:void 0})}this.runtime.pendingNativeProviderRegistrations=[],this.runtime.registerProvider=(s,i)=>{if(r?.registerProvider){r.registerProvider(s,i);return}this.modelRegistry.registerProvider(s,i)},this.runtime.registerNativeProvider=s=>{if(r?.registerNativeProvider){r.registerNativeProvider(s);return}this.modelRegistry.registerProvider(s)},this.runtime.unregisterProvider=s=>{if(r?.unregisterProvider){r.unregisterProvider(s);return}this.modelRegistry.unregisterProvider(s)}}bindCommandContext(e){if(e){this.waitForIdleFn=e.waitForIdle,this.newSessionHandler=e.newSession,this.forkHandler=e.fork,this.navigateTreeHandler=e.navigateTree,this.switchSessionHandler=e.switchSession,this.reloadHandler=e.reload;return}this.waitForIdleFn=async()=>{},this.newSessionHandler=async()=>({cancelled:!1}),this.forkHandler=async()=>({cancelled:!1}),this.navigateTreeHandler=async()=>({cancelled:!1}),this.switchSessionHandler=async()=>({cancelled:!1}),this.reloadHandler=async()=>{}}setUIContext(e,n="print"){this.uiContext=e?this.wrapUIPromptContext(e):CZe,this.mode=n}wrapUIPromptContext(e){return{...e,select:(n,r,s)=>this.withUIPrompt("select",n,()=>e.select(n,r,s)),confirm:(n,r,s)=>this.withUIPrompt("confirm",n,()=>e.confirm(n,r,s)),input:(n,r,s)=>this.withUIPrompt("input",n,()=>e.input(n,r,s)),editor:(n,r)=>this.withUIPrompt("editor",n,()=>e.editor(n,r)),custom:(n,r)=>this.withUIPrompt("custom",void 0,()=>e.custom(n,r))}}withUIPrompt(e,n,r){this.uiPromptDepth++===0&&(this.activeUIPrompt={kind:e,title:n},this.emitUIPromptEvent({type:"ui_prompt_start",reason:"ui_prompt",kind:e,...n?{title:n}:{}}));let i=()=>{if(--this.uiPromptDepth>0)return;this.uiPromptDepth=0;let o=this.activeUIPrompt??{kind:e,title:n};this.activeUIPrompt=void 0,this.emitUIPromptEvent({type:"ui_prompt_end",reason:"ui_prompt",kind:o.kind,...o.title?{title:o.title}:{}})};try{return r().finally(i)}catch(o){throw i(),o}}emitUIPromptEvent(e){queueMicrotask(()=>{this.emit(e)})}getUIContext(){return this.uiContext}hasUI(){return this.uiContext!==CZe}getExtensionPaths(){return this.extensions.map(e=>e.path)}getAllRegisteredTools(){let e=new Map;for(let n of this.extensions)for(let r of n.tools.values())e.has(r.definition.name)||e.set(r.definition.name,r);return Array.from(e.values())}getToolDefinition(e){for(let n of this.extensions){let r=n.tools.get(e);if(r)return r.definition}}getFlags(){let e=new Map;for(let n of this.extensions)for(let[r,s]of n.flags)e.has(r)||e.set(r,s);return e}setFlagValue(e,n){this.runtime.flagValues.set(e,n)}getFlagValues(){return new Map(this.runtime.flagValues)}getShortcuts(e){this.shortcutDiagnostics=[];let n=Mgs(e),r=new Map,s=(i,o)=>{this.shortcutDiagnostics.push({type:"warning",message:i,path:o}),this.hasUI()||console.warn(i)};for(let i of this.extensions)for(let[o,a]of i.shortcuts){let c=o.toLowerCase(),u=n[c];if(u?.restrictOverride===!0){s(`Extension shortcut '${o}' from ${a.extensionPath} conflicts with built-in shortcut. Skipping.`,a.extensionPath);continue}u?.restrictOverride===!1&&s(`Extension shortcut conflict: '${o}' is built-in shortcut for ${u.keybinding} and ${a.extensionPath}. Using ${a.extensionPath}.`,a.extensionPath);let l=r.get(c);l&&s(`Extension shortcut conflict: '${o}' registered by both ${l.extensionPath} and ${a.extensionPath}. Using ${a.extensionPath}.`,a.extensionPath),r.set(c,a)}return r}getShortcutDiagnostics(){return this.shortcutDiagnostics}invalidate(e="This extension ctx is stale after session replacement or reload. Do not use a captured pi or command ctx after ctx.newSession(), ctx.fork(), ctx.switchSession(), or ctx.reload(). For newSession, fork, and switchSession, move post-replacement work into withSession and use the ctx passed to withSession. For reload, do not use the old ctx after await ctx.reload()."){this.staleMessage||(this.staleMessage=e,this.runtime.invalidate(e))}assertActive(){if(this.staleMessage)throw new Error(this.staleMessage)}onError(e){return this.errorListeners.add(e),()=>this.errorListeners.delete(e)}emitError(e){for(let n of this.errorListeners)n(e)}hasHandlers(e){for(let n of this.extensions){let r=n.handlers.get(e);if(r&&r.length>0)return!0}return!1}getMessageRenderer(e){for(let n of this.extensions){let r=n.messageRenderers.get(e);if(r)return r}}getMarkdownTransformers(){return this.extensions.flatMap(e=>e.markdownTransformer?[e.markdownTransformer]:[])}getEntryRenderer(e){for(let n of this.extensions){let r=n.entryRenderers?.get(e);if(r)return r}}resolveRegisteredCommands(){let e=[],n=new Map;for(let i of this.extensions)for(let o of i.commands.values())e.push(o),n.set(o.name,(n.get(o.name)??0)+1);let r=new Map,s=new Set;return e.map(i=>{let o=(r.get(i.name)??0)+1;r.set(i.name,o);let a=(n.get(i.name)??0)>1?`${i.name}:${o}`:i.name;if(s.has(a)){let c=o;do c++,a=`${i.name}:${c}`;while(s.has(a))}return s.add(a),{...i,invocationName:a}})}getModelRegistry(){return this.modelRegistry}getRegisteredCommands(){return this.commandDiagnostics=[],this.resolveRegisteredCommands()}getCommandDiagnostics(){return this.commandDiagnostics}getCommand(e){return this.resolveRegisteredCommands().find(n=>n.invocationName===e)}shutdown(){this.shutdownHandler()}getActiveTools(){return this.assertActive(),this.runtime.getActiveTools()}createContext(){let e=this,n=this.getModel,r=this.getScopedModels;return{get ui(){return e.assertActive(),e.uiContext},get mode(){return e.assertActive(),e.mode},get hasUI(){return e.assertActive(),e.hasUI()},get cwd(){return e.assertActive(),e.cwd},get sessionManager(){return e.assertActive(),e.sessionManager},get modelRegistry(){return e.assertActive(),e.modelRegistry},get model(){return e.assertActive(),n()},get scopedModels(){return e.assertActive(),r()},get thinkingLevel(){return e.assertActive(),e.runtime.getThinkingLevel()},isIdle:()=>(e.assertActive(),e.isIdleFn()),isProjectTrusted:()=>(e.assertActive(),e.isProjectTrustedFn()),get signal(){return e.assertActive(),e.getSignalFn()},abort:()=>{e.assertActive(),e.abortFn()},hasPendingMessages:()=>(e.assertActive(),e.hasPendingMessagesFn()),shutdown:()=>{e.assertActive(),e.shutdownHandler()},getContextUsage:()=>(e.assertActive(),e.getContextUsageFn()),compact:s=>{e.assertActive(),e.compactFn(s)},getSystemPrompt:()=>(e.assertActive(),e.getSystemPromptFn())}}createCommandContext(){let e=Object.defineProperties({},Object.getOwnPropertyDescriptors(this.createContext()));return e.getSystemPromptOptions=()=>(this.assertActive(),this.getSystemPromptOptionsFn()),e.waitForIdle=()=>(this.assertActive(),this.waitForIdleFn()),e.newSession=n=>(this.assertActive(),this.newSessionHandler(n)),e.fork=(n,r)=>(this.assertActive(),this.forkHandler(n,r)),e.navigateTree=(n,r)=>(this.assertActive(),this.navigateTreeHandler(n,r)),e.switchSession=(n,r)=>(this.assertActive(),this.switchSessionHandler(n,r)),e.reload=()=>(this.assertActive(),this.reloadHandler()),e}isSessionBeforeEvent(e){return e.type==="session_before_switch"||e.type==="session_before_fork"||e.type==="session_before_compact"||e.type==="session_before_tree"}async emit(e){let n=this.createContext(),r;for(let s of this.extensions){let i=s.handlers.get(e.type);if(!(!i||i.length===0))for(let o of i)try{let a=await o(e,n);if(this.isSessionBeforeEvent(e)&&a&&(r=a,r.cancel))return r}catch(a){let c=a instanceof Error?a.message:String(a),u=a instanceof Error?a.stack:void 0;this.emitError({extensionPath:s.path,event:e.type,error:c,stack:u})}}return r}async emitMessageEnd(e){let n=this.createContext(),r=e.message,s=!1;for(let i of this.extensions){let o=i.handlers.get("message_end");if(!(!o||o.length===0))for(let a of o)try{let c={...e,message:r},u=await a(c,n);if(!u?.message)continue;if(u.message.role!==r.role){this.emitError({extensionPath:i.path,event:"message_end",error:"message_end handlers must return a message with the same role"});continue}r=u.message,s=!0}catch(c){let u=c instanceof Error?c.message:String(c),l=c instanceof Error?c.stack:void 0;this.emitError({extensionPath:i.path,event:"message_end",error:u,stack:l})}}return s?r:void 0}async emitToolResult(e){let n=this.createContext(),r={...e},s=!1;for(let i of this.extensions){let o=i.handlers.get("tool_result");if(!(!o||o.length===0))for(let a of o)try{let c=await a(r,n);if(!c)continue;c.content!==void 0&&(r.content=c.content,s=!0),c.details!==void 0&&(r.details=c.details,s=!0),c.isError!==void 0&&(r.isError=c.isError,s=!0),c.usage!==void 0&&(r.usage=c.usage,s=!0)}catch(c){let u=c instanceof Error?c.message:String(c),l=c instanceof Error?c.stack:void 0;this.emitError({extensionPath:i.path,event:"tool_result",error:u,stack:l})}}if(s)return{content:r.content,details:r.details,isError:r.isError,usage:r.usage}}async emitToolCall(e){let n=this.createContext(),r;for(let s of this.extensions){let i=s.handlers.get("tool_call");if(!(!i||i.length===0))for(let o of i){let a=await o(e,n);if(a&&(r=a,r.block))return r}}return r}async emitUserBash(e){let n=this.createContext();for(let r of this.extensions){let s=r.handlers.get("user_bash");if(!(!s||s.length===0))for(let i of s)try{let o=await i(e,n);if(o)return o}catch(o){let a=o instanceof Error?o.message:String(o),c=o instanceof Error?o.stack:void 0;this.emitError({extensionPath:r.path,event:"user_bash",error:a,stack:c})}}}async emitContext(e){let n=this.createContext(),r=structuredClone(e);for(let s of this.extensions){let i=s.handlers.get("context");if(!(!i||i.length===0))for(let o of i)try{let c=await o({type:"context",messages:r},n);c&&c.messages&&(r=c.messages)}catch(a){let c=a instanceof Error?a.message:String(a),u=a instanceof Error?a.stack:void 0;this.emitError({extensionPath:s.path,event:"context",error:c,stack:u})}}return r}async emitBeforeProviderRequest(e){let n=this.createContext(),r=e;for(let s of this.extensions){let i=s.handlers.get("before_provider_request");if(!(!i||i.length===0))for(let o of i)try{let c=await o({type:"before_provider_request",payload:r},n);c!==void 0&&(r=c)}catch(a){let c=a instanceof Error?a.message:String(a),u=a instanceof Error?a.stack:void 0;this.emitError({extensionPath:s.path,event:"before_provider_request",error:c,stack:u})}}return r}async emitBeforeProviderHeaders(e){let n=this.createContext();for(let r of this.extensions){let s=r.handlers.get("before_provider_headers");if(!(!s||s.length===0))for(let i of s)try{await i({type:"before_provider_headers",headers:e},n)}catch(o){let a=o instanceof Error?o.message:String(o),c=o instanceof Error?o.stack:void 0;this.emitError({extensionPath:r.path,event:"before_provider_headers",error:a,stack:c})}}return e}async emitBeforeAgentStart(e,n,r,s){let i=r,o=Object.defineProperties({},Object.getOwnPropertyDescriptors(this.createContext()));o.getSystemPrompt=()=>(this.assertActive(),i);let a=[],c=!1;for(let u of this.extensions){let l=u.handlers.get("before_agent_start");if(!(!l||l.length===0))for(let d of l)try{let m=await d({type:"before_agent_start",prompt:e,images:n,systemPrompt:i,systemPromptOptions:s},o);if(m){let f=m;f.message&&a.push(f.message),f.systemPrompt!==void 0&&(i=f.systemPrompt,c=!0)}}catch(h){let m=h instanceof Error?h.message:String(h),f=h instanceof Error?h.stack:void 0;this.emitError({extensionPath:u.path,event:"before_agent_start",error:m,stack:f})}}if(a.length>0||c)return{messages:a.length>0?a:void 0,systemPrompt:c?i:void 0}}async emitResourcesDiscover(e,n){let r=this.createContext(),s=[],i=[],o=[];for(let a of this.extensions){let c=a.handlers.get("resources_discover");if(!(!c||c.length===0))for(let u of c)try{let h=await u({type:"resources_discover",cwd:e,reason:n},r);h?.skillPaths?.length&&s.push(...h.skillPaths.map(m=>({path:m,extensionPath:a.path}))),h?.promptPaths?.length&&i.push(...h.promptPaths.map(m=>({path:m,extensionPath:a.path}))),h?.themePaths?.length&&o.push(...h.themePaths.map(m=>({path:m,extensionPath:a.path})))}catch(l){let d=l instanceof Error?l.message:String(l),h=l instanceof Error?l.stack:void 0;this.emitError({extensionPath:a.path,event:"resources_discover",error:d,stack:h})}}return{skillPaths:s,promptPaths:i,themePaths:o}}async emitInput(e,n,r,s){let i=this.createContext(),o=e,a=n;for(let c of this.extensions)for(let u of c.handlers.get("input")??[])try{let d=await u({type:"input",text:o,images:a,source:r,streamingBehavior:s},i);if(d?.action==="handled")return d;d?.action==="transform"&&(o=d.text,a=d.images??a)}catch(l){this.emitError({extensionPath:c.path,event:"input",error:l instanceof Error?l.message:String(l),stack:l instanceof Error?l.stack:void 0})}return o!==e||a!==n?{action:"transform",text:o,images:a}:{action:"continue"}}};p();function oI(t){return t}function IZe(t){return t.toolName==="bash"}function xZe(t){return t.toolName==="powershell"}function wZe(t){return t.toolName==="read"}function TZe(t){return t.toolName==="edit"}function vZe(t){return t.toolName==="write"}function RZe(t){return t.toolName==="grep"}function kZe(t){return t.toolName==="find"}function NZe(t){return t.toolName==="ls"}function DZe(t,e){return e.toolName===t}p();p();function cp(t,e){return{name:t.name,label:t.label,description:t.description,parameters:t.parameters,constrainedSampling:t.constrainedSampling,prepareArguments:t.prepareArguments,executionMode:t.executionMode,execute:(n,r,s,i,o)=>t.execute(n,r,s,i,o??e?.())}}function Kbn(t){return{name:t.name,label:t.label,description:t.description,parameters:t.parameters,constrainedSampling:t.constrainedSampling,prepareArguments:t.prepareArguments,executionMode:t.executionMode,execute:async(e,n,r,s)=>t.execute(e,n,r,s)}}function bCe(t,e){let n=cp(t.definition,()=>e.createContext()),r=n.execute;return{...n,execute:async(s,i,o,a)=>{let c=e.getActiveTools(),u=await r(s,i,o,a),l=e.getActiveTools();if(!c.every(m=>l.includes(m)))return u;let d=new Set(c),h=l.filter(m=>!d.has(m));return h.length===0?u:{...u,addedToolNames:[...new Set([...u.addedToolNames??[],...h])]}}}}function O5(t,e){return t.map(n=>bCe(n,e))}p();p();p();var _Ce=require("child_process");var BZe=new Map,Lgs=/^[A-Za-z_][A-Za-z0-9_]*$/,Fgs=/^[A-Za-z_][A-Za-z0-9_]*/;function M5(t,e){if(!e)return;let n=t[t.length-1];if(n?.type==="literal"){n.value+=e;return}t.push({type:"literal",value:e})}function Qgs(t){let e=[],n=0;for(;nJbn(n,e)===void 0)}function see(t){return nee(t).type==="command"}function e_n(t,e){return Zbn(t,e).length===0}function PZe(t,e){let n=nee(t);return n.type==="command"?Ggs(n.config):Xbn(n.parts,e)}function $gs(t){try{let{shell:e,args:n,commandTransport:r}=s5(),s=r==="stdin",i=(0,_Ce.spawnSync)(e,s?n:[...n,t],{encoding:"utf-8",input:s?t:void 0,timeout:1e4,stdio:[s?"pipe":"ignore","pipe","ignore"],shell:!1,windowsHide:!0});return i.error?i.error.code==="ENOENT"?{executed:!1,value:void 0}:{executed:!0,value:void 0}:i.status!==0?{executed:!0,value:void 0}:{executed:!0,value:(i.stdout??"").trim()||void 0}}catch{return{executed:!1,value:void 0}}}function zbn(t){try{return(0,_Ce.execSync)(t,{encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{return}}function t_n(t){let e=t.slice(1);return process.platform==="win32"?(()=>{let n=$gs(e);return n.executed?n.value:zbn(e)})():zbn(e)}function Ggs(t){if(BZe.has(t))return BZe.get(t);let e=t_n(t);return BZe.set(t,e),e}function Wgs(t,e){let n=nee(t);return n.type==="command"?t_n(n.config):Xbn(n.parts,e)}function OZe(t,e,n){let r=Wgs(t,n);if(r!==void 0)return r;let s=nee(t);if(s.type==="command")throw new Error(`Failed to resolve ${e} from shell command: ${s.config.slice(1)}`);if(s.type==="template"){let i=Zbn(t,n);if(i.length===1)throw new Error(`Failed to resolve ${e} from environment variable: ${i[0]}`);if(i.length>1)throw new Error(`Failed to resolve ${e} from environment variables: ${i.join(", ")}`)}throw new Error(`Failed to resolve ${e}`)}function iee(t,e,n){if(!t)return;let r={};for(let[s,i]of Object.entries(t))r[s]=OZe(i,`${e} header "${s}"`,n);return Object.keys(r).length>0?r:void 0}function FZe(t,e){if(!e)return t;let n={...t,...e},r=t,s=e,i=n;for(let o of["openRouterRouting","vercelGatewayRouting","chatTemplateKwargs","chatTemplateArgs"]){let a=r?.[o],c=s[o];(typeof a=="object"&&a!==null||typeof c=="object"&&c!==null)&&(i[o]={...a,...c})}return n}function qgs(t,e){return{...t,name:e.name??t.name,reasoning:e.reasoning??t.reasoning,thinkingLevelMap:e.thinkingLevelMap?{...t.thinkingLevelMap,...e.thinkingLevelMap}:t.thinkingLevelMap,input:e.input??t.input,cost:e.cost?{input:e.cost.input??t.cost.input,output:e.cost.output??t.cost.output,cacheRead:e.cost.cacheRead??t.cost.cacheRead,cacheWrite:e.cost.cacheWrite??t.cost.cacheWrite,tiers:e.cost.tiers??t.cost.tiers}:t.cost,contextWindow:e.contextWindow??t.contextWindow,maxTokens:e.maxTokens??t.maxTokens,samplingParams:e.samplingParams?{...t.samplingParams,...e.samplingParams}:t.samplingParams,compat:FZe(t.compat,e.compat)}}function Hgs(t,e,n,r){let s=e.api??n.api??r?.api;if(!s)throw new Error(`Provider ${t}, model ${e.id}: no "api" specified. Set at provider or model level.`);let i=e.baseUrl??n.baseUrl??r?.baseUrl;if(!i)throw new Error(`Provider ${t}: "baseUrl" is required when defining custom models.`);if(e.contextWindow!==void 0&&e.contextWindow<=0)throw new Error(`Provider ${t}, model ${e.id}: invalid contextWindow`);if(e.maxTokens!==void 0&&e.maxTokens<=0)throw new Error(`Provider ${t}, model ${e.id}: invalid maxTokens`);return{id:e.id,name:e.name??e.id,api:s,provider:t,baseUrl:i,reasoning:e.reasoning??!1,thinkingLevelMap:e.thinkingLevelMap,input:e.input??["text"],cost:e.cost??{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:e.contextWindow??128e3,maxTokens:e.maxTokens??16384,samplingParams:e.samplingParams,headers:void 0,compat:FZe(n.compat,e.compat)}}function r_n(t,e,n){return t.find(r=>r.id===e)??(n?t.find(r=>r.api===n):void 0)??t.find(r=>r.api==="openai-completions")??t[0]}function MZe(t,e,n){if(!n)return[...e];if(n.oauth&&!n.baseUrl)throw new Error(`Provider ${t}: "baseUrl" is required when "oauth" is set.`);let r=n.modelOverrides&&Object.keys(n.modelOverrides).length>0;if(!n.models?.length&&!n.baseUrl&&!n.headers&&!n.compat&&!r&&!n.apiKey&&!n.oauth&&n.authHeader===void 0)throw new Error(`Provider ${t}: must specify "baseUrl", "headers", "compat", "modelOverrides", or "models".`);let s=e.map(i=>({...i,baseUrl:n.oauth==="radius"?i.baseUrl:n.baseUrl??i.baseUrl,compat:FZe(i.compat,n.compat)}));for(let i of n.models??[]){let o=s.findIndex(u=>u.id===i.id),a=r_n(s,i.id,i.api??n.api),c=Hgs(t,i,n,a);o>=0?s[o]=c:s.push(c)}return s}function LZe(t,e,n){return n?n.models?n.models.map(r=>{let s=r_n(e,r.id,r.api??n.api),i=r.api??n.api??s?.api;if(!i)throw new Error(`Provider ${t}, model ${r.id}: no "api" specified. Set at provider or model level.`);let o=r.baseUrl??n.baseUrl??s?.baseUrl;if(!o)throw new Error(`Provider ${t}: "baseUrl" is required when defining custom models.`);return{...r,api:i,provider:t,baseUrl:o,headers:void 0}}):n.baseUrl?e.map(r=>({...r,baseUrl:n.baseUrl})):[...e]:[...e]}function Vgs(t){return{name:t.name,isSubscription:t.isSubscription,login:async e=>({...await t.login({onAuth:r=>e.notify({type:"auth_url",...r}),onDeviceCode:r=>e.notify({type:"device_code",...r}),onPrompt:r=>e.prompt({type:"text",...r}),onProgress:r=>e.notify({type:"progress",message:r}),onManualCodeInput:()=>e.prompt({type:"manual_code",message:"Paste the authorization code"}),onSelect:r=>e.prompt({type:"select",...r}),signal:e.signal}),type:"oauth"}),refresh:async(e,n)=>({...await t.refreshToken(e,n),type:"oauth"}),toAuth:async e=>({apiKey:t.getApiKey(e)})}}function s_n(t,e,n){let r=t.headers||e?{...t.headers,...e}:void 0;if(n){if(!t.apiKey)throw new Error("authHeader requires a resolved API key");r={...r,Authorization:`Bearer ${t.apiKey}`}}return{...t,headers:r}}function i_n(t,e){return e?.apiKey??t?.apiKey}function QZe(t,e){if(!(!t?.headers&&!e?.headers))return{...t?.headers,...e?.headers}}async function n_n(t,e,n){let r={...n};for(let s of new Set(t.flatMap(ree))){if(r[s]!==void 0)continue;let i=await e.env(s);i!==void 0&&(r[s]=i)}return Object.keys(r).length>0?r:void 0}function jgs(t,e,n,r){let s=e?.auth.apiKey,i=i_n(n,r),o=r?.oauth??e?.auth.oauth;if(!s&&i===void 0&&o)return;let a=QZe(n,r),c=r?.authHeader??n?.authHeader??!1;return{name:s?.name??"API key",login:s?.login??(async u=>({type:"api_key",key:await u.prompt({type:"secret",message:"Enter API key"})})),check:async u=>{if(u.credential){if(s?.check)return s.check(u);if(u.credential.key)return{type:"api_key",source:"stored credential"};let d=await s?.resolve(u);return d?{type:"api_key",source:d.source}:void 0}if(i!==void 0){if(see(i))return{type:"api_key",source:"configured API key"};let d=ree(i);for(let h of d)if(await u.ctx.env(h)===void 0)return;return{type:"api_key",source:"configured API key"}}if(s?.check)return s.check(u);let l=await s?.resolve(u);return l?{type:"api_key",source:l.source}:void 0},resolve:async u=>{let l;if(u.credential)l=s?await s.resolve(u):u.credential.key?{auth:{apiKey:u.credential.key},env:u.credential.env,source:"stored credential"}:void 0;else if(i!==void 0){let f=await n_n([i],u.ctx),g=OZe(i,`API key for provider "${t}"`,f);l=s?await s.resolve({...u,credential:{type:"api_key",key:g}}):{auth:{apiKey:g},source:"configured API key"}}else l=await s?.resolve(u);if(!l)return;let d={...u.credential?.env??{},...l.env??{}},h=await n_n(Object.values(a??{}),u.ctx,d),m=iee(a,`provider "${t}"`,h);return{...l,auth:s_n(l.auth,m,c)}}}}function Ygs(t,e,n,r){let s=r?.oauth?Vgs(r.oauth):e?.auth.oauth;if(!s)return;let i=QZe(n,r),o=r?.authHeader??n?.authHeader??!1;return{...s,toAuth:async a=>{let c=await s.toAuth(a),u=a.env,l=iee(i,`provider "${t}"`,typeof u=="object"&&u!==null?u:void 0);return s_n(c,l,o)}}}function o_n(t,e,n){let r=e?.models?.find(o=>o.id===t.id),s=n?.models?.find(o=>o.id===t.id),i={...e?.modelOverrides?.[t.id]?.headers,...r?.headers,...s?.headers};return Object.keys(i).length>0?i:void 0}function a_n(t,e,n,r){if(r.streamSimple&&!r.api)throw new Error(`Provider ${t}: "api" is required when registering streamSimple.`);LZe(t,MZe(t,e?.getModels()??[],n),r)}function c_n(t,e,n,r){let s=n.getProvider(t),i,o,a=()=>r&&o?{...r,models:o}:r,c=()=>{let A=LZe(t,MZe(t,e?.getModels()??[],s),a());return i&&r?.oauth?.modifyModels&&(A=r.oauth.modifyModels(A,i)),A.map(y=>{let b=s?.modelOverrides?.[y.id];return b?qgs(y,b):y})};c();let u=jgs(t,e,s,r),l=Ygs(t,e,s,r);if(!u&&!l)throw new Error(`Provider ${t}: no authentication method configured.`);let d=A=>e?.getModels().some(y=>y.api===A.api)??!1,h=(A,y,b,S)=>_h(A,async()=>{if(r?.streamSimple&&A.api===r.api)return r.streamSimple(A,y,b);if(e&&d(A))return S?e.streamSimple(A,y,b):e.stream(A,y,b);let C=uM(A.api);if(!C)throw new Error(`No API provider registered for api: ${A.api}`);return S?C.streamSimple(A,y,b):C.stream(A,y,b)}),m={id:t,name:r?.name??s?.name??e?.name??r?.oauth?.name??t,baseUrl:r?.baseUrl??s?.baseUrl??e?.baseUrl,headers:e?.headers,auth:{...u?{apiKey:u}:{},...l?{oauth:l}:{}},getModels:c,refreshModels:e?.refreshModels||r?.refreshModels||r?.oauth?.modifyModels?async A=>{await e?.refreshModels?.(A);let y;if(r?.refreshModels&&(y=await r.refreshModels(A)),A.signal.aborted)return;let b=A.credential?.type==="oauth"?A.credential:void 0;await A.publish({update:()=>{y&&(LZe(t,MZe(t,e?.getModels()??[],s),{...r,models:y}),o=y),i=b}})}:void 0,filterModels:e?.filterModels?(A,y)=>e.filterModels(A,y):void 0,stream:(A,y,b)=>h(A,y,b,!1),streamSimple:(A,y,b)=>h(A,y,b,!0)},f=e?.fetchDeferred;f&&(m.fetchDeferred=(A,y,b)=>f(A,y,b));let g=e?.cancelDeferred;return g&&(m.cancelDeferred=(A,y,b)=>g(A,y,b)),m}function l_n(t,e,n,r){return iee(o_n(t,e,n),`model "${t.provider}/${t.id}"`,r)}function u_n(t,e,n){let r=iee({...QZe(e,n),...o_n(t,e,n)},`model "${t.provider}/${t.id}"`);return{headers:t.headers||r?{...t.headers,...r}:void 0,authHeader:n?.authHeader??e?.authHeader??!1}}function UZe(t,e){let n=i_n(t,e);if(n===void 0)return;if(see(n))return{configured:!0,source:"models_json_command"};let r=ree(n);return r.length>0?e_n(n)?{configured:!0,source:"environment",label:r.join(", ")}:{configured:!1}:{configured:!0,source:e?.apiKey!==void 0?"fallback":"models_json_key"}}var L5=class{runtime;constructor(e){this.runtime=e}refresh(e){return this.runtime.refresh(e)}getError(){return this.runtime.getError()}getAll(){return[...this.runtime.getModels()]}getAvailable(){return[...this.runtime.getAvailableSnapshot()]}find(e,n){return this.runtime.getModel(e,n)}hasConfiguredAuth(e){return this.runtime.hasConfiguredAuth(e.provider)}async getApiKeyAndHeaders(e){try{let n=await this.runtime.getAuth(e);if(!n){let r=this.runtime.getCompatibilityRequestConfig(e);return r.authHeader?{ok:!1,error:`No API key found for "${e.provider}"`}:{ok:!0,headers:r.headers}}return{ok:!0,apiKey:n.auth.apiKey,headers:n.auth.headers,...n.auth.baseUrl?{baseUrl:n.auth.baseUrl}:{},env:n.env}}catch(n){let r=n instanceof Error?n.cause:void 0,s=r instanceof Error?r.message:n instanceof Error?n.message:String(n);return{ok:!1,error:s==="authHeader requires a resolved API key"?`No API key found for "${e.provider}"`:s}}}getProviderAuthStatus(e){return this.runtime.getProviderAuthStatus(e)}getProvider(e){return this.runtime.getProvider(e)}complete(e,n,r){return this.runtime.complete(e,n,r)}getProviderDisplayName(e){return this.runtime.getProvider(e)?.name??e}getProviderAuth(e){return this.runtime.getAuth(e)}async getApiKeyForProvider(e){try{return(await this.runtime.getAuth(e))?.auth.apiKey}catch{return}}isUsingOAuth(e){return this.runtime.isUsingOAuth(e.provider)}registerProvider(e,n){if(typeof e=="string"){if(!n)throw new Error("Provider config is required when registering by name");this.runtime.registerProvider(e,n);return}this.runtime.registerNativeProvider(e)}unregisterProvider(e){this.runtime.unregisterProvider(e)}getRegisteredProviderConfig(e){return this.runtime.getRegisteredProviderConfig(e)}getRegisteredNativeProvider(e){return this.runtime.getRegisteredNativeProvider(e)}getRegisteredProviderIds(){return this.runtime.getRegisteredProviderIds()}};p();var C0=require("fs"),oy=require("path");function Kgs(t){let e=[],n="",r=null;for(let s=0;s{if(s){let l=s==="@"||s==="ARGUMENTS"?n:e[parseInt(s,10)-1];return l||i}if(o){let l=parseInt(o,10)-1;if(l<0&&(l=0),a){let d=parseInt(a,10);return e.slice(l,l+d).join(" ")}return e.slice(l).join(" ")}if(c==="ARGUMENTS"||c==="@")return n;let u=parseInt(c,10)-1;return e[u]??""})}function d_n(t,e){try{let n=(0,C0.readFileSync)(t,"utf-8"),{frontmatter:r,body:s}=JM(n),i=(0,oy.basename)(t).replace(/\.md$/,""),o=r.description||"";if(!o){let a=s.split(` -`).find(c=>c.trim());a&&(o=a.slice(0,60),a.length>60&&(o+="..."))}return{name:i,description:o,...r["argument-hint"]&&{argumentHint:r["argument-hint"]},content:s,sourceInfo:e,filePath:t}}catch{return null}}function $Ze(t,e){let n=[];if(!(0,C0.existsSync)(t))return n;try{let r=(0,C0.readdirSync)(t,{withFileTypes:!0});for(let s of r){let i=(0,oy.join)(t,s.name),o=s.isFile();if(s.isSymbolicLink())try{o=(0,C0.statSync)(i).isFile()}catch{continue}if(o&&s.name.endsWith(".md")){let a=d_n(i,e(i));a&&n.push(a)}}}catch{return n}return n}function p_n(t){let e=jn(t.cwd),n=jn(t.agentDir),r=t.promptPaths,s=t.includeDefaults,i=[],o=(0,oy.join)(n,"prompts"),a=(0,oy.resolve)(e,ws,"prompts"),c=(l,d)=>{let h=(0,oy.resolve)(d);if(l===h)return!0;let m=h.endsWith(oy.sep)?h:`${h}${oy.sep}`;return l.startsWith(m)},u=l=>c(l,o)?rh(l,{source:"local",scope:"user",baseDir:o}):c(l,a)?rh(l,{source:"local",scope:"project",baseDir:a}):rh(l,{source:"local",baseDir:(0,C0.statSync)(l).isDirectory()?l:(0,oy.dirname)(l)});s&&(i.push(...$Ze(o,u)),i.push(...$Ze(a,u)));for(let l of r){let d=jn(l,e,{trim:!0});if((0,C0.existsSync)(d))try{let h=(0,C0.statSync)(d);if(h.isDirectory())i.push(...$Ze(d,u));else if(h.isFile()&&d.endsWith(".md")){let m=d_n(d,u(d));m&&i.push(m)}}catch{}}return i}function SCe(t,e){if(!t.startsWith("/"))return t;let n=t.match(/^\/([^\s]+)(?:\s+([\s\S]*))?$/);if(!n)return t;let r=n[1],s=n[2]??"",i=e.find(o=>o.name===r);if(i){let o=Kgs(s);return zgs(i.content,o)}return t}p();var F5=require("node:fs"),h_n=require("node:path");function CCe(t,e,n){let r=jn(e??`session-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,process.cwd()),s=(0,h_n.dirname)(r);(0,F5.existsSync)(s)||(0,F5.mkdirSync)(s,{recursive:!0});let i=new Date().toISOString(),o={type:"session",version:zN,id:t.getSessionId(),timestamp:i,cwd:t.getCwd()},a=[JSON.stringify(o)],c=null;for(let u of t.getBranch())a.push(JSON.stringify({...u,parentId:c})),c=u.id;for(let u of n?.(c,i)??[])a.push(JSON.stringify(u));return(0,F5.writeFileSync)(r,`${a.join(` -`)} -`),r}p();p();var ay=require("fs"),g_n=Gt(OSe(),1),hl=require("path");var m_n=64,f_n=1024,Jgs=[".gitignore",".ignore",".fdignore"];function WZe(t){return t.split(hl.sep).join("/")}function Xgs(t,e){let n=t.trim();if(!n||n.startsWith("#")&&!n.startsWith("\\#"))return null;let r=t,s=!1;r.startsWith("!")?(s=!0,r=r.slice(1)):r.startsWith("\\!")&&(r=r.slice(1)),r.startsWith("/")&&(r=r.slice(1));let i=e?`${e}${r}`:r;return s?`!${i}`:i}function Zgs(t,e,n){let r=(0,hl.relative)(n,e),s=r?`${WZe(r)}/`:"";for(let i of Jgs){let o=(0,hl.join)(e,i);if((0,ay.existsSync)(o))try{let c=(0,ay.readFileSync)(o,"utf-8").split(/\r?\n/).map(u=>Xgs(u,s)).filter(u=>!!u);c.length>0&&t.add(c)}catch{}}}function eAs(t){let e=[];return t.length>m_n&&e.push(`name exceeds ${m_n} characters (${t.length})`),/^[a-z0-9-]+$/.test(t)||e.push("name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)"),(t.startsWith("-")||t.endsWith("-"))&&e.push("name must not start or end with a hyphen"),t.includes("--")&&e.push("name must not contain consecutive hyphens"),e}function tAs(t){let e=[];return typeof t!="string"||t.trim()===""?e.push("description is required"):t.length>f_n&&e.push(`description exceeds ${f_n} characters (${t.length})`),e}function nAs(t,e,n){switch(n){case"user":return rh(t,{source:"local",scope:"user",baseDir:e});case"project":return rh(t,{source:"local",scope:"project",baseDir:e});case"path":return rh(t,{source:"local",baseDir:e});default:return rh(t,{source:n,baseDir:e})}}function A_n(t){let{dir:e,source:n}=t;return oee(e,n,!0)}function oee(t,e,n,r,s){let i=[],o=[];if(!(0,ay.existsSync)(t))return{skills:i,diagnostics:o};let a=s??t,c=r??(0,g_n.default)();Zgs(c,t,a);try{let u=(0,ay.readdirSync)(t,{withFileTypes:!0});for(let l of u){if(l.name!=="SKILL.md")continue;let d=(0,hl.join)(t,l.name),h=l.isFile();if(l.isSymbolicLink())try{h=(0,ay.statSync)(d).isFile()}catch{continue}let m=WZe((0,hl.relative)(a,d));if(!h||c.ignores(m))continue;let f=qZe(d,e);return f.skill&&i.push(f.skill),o.push(...f.diagnostics),{skills:i,diagnostics:o}}for(let l of u){if(l.name.startsWith(".")||l.name==="node_modules")continue;let d=(0,hl.join)(t,l.name),h=l.isDirectory(),m=l.isFile();if(l.isSymbolicLink())try{let y=(0,ay.statSync)(d);h=y.isDirectory(),m=y.isFile()}catch{continue}let f=WZe((0,hl.relative)(a,d)),g=h?`${f}/`:f;if(c.ignores(g))continue;if(h){let y=oee(d,e,!1,c,a);i.push(...y.skills),o.push(...y.diagnostics);continue}if(!m||!n||!l.name.endsWith(".md"))continue;let A=qZe(d,e);A.skill&&i.push(A.skill),o.push(...A.diagnostics)}}catch{}return{skills:i,diagnostics:o}}function qZe(t,e){let n=[],r=(0,hl.basename)(t)==="SKILL.md",s;try{s=(0,ay.readFileSync)(t,"utf-8")}catch(f){let g=f instanceof Error?f.message:"failed to read skill file";return n.push({type:"warning",message:g,path:t}),{skill:null,diagnostics:n}}let i;try{({frontmatter:i}=JM(s))}catch(f){if(r){let g=f instanceof Error?f.message:"failed to parse skill file";n.push({type:"warning",message:g,path:t})}return{skill:null,diagnostics:n}}let o=i.description,a=typeof o=="string"&&o.trim()!=="";if(!r&&!a)return{skill:null,diagnostics:n};let c=(0,hl.dirname)(t),u=(0,hl.basename)(c),l=tAs(o);for(let f of l)n.push({type:"warning",message:f,path:t});let h=(typeof i.name=="string"?i.name:void 0)||u,m=eAs(h);for(let f of m)n.push({type:"warning",message:f,path:t});return a?{skill:{name:h,description:o,filePath:t,baseDir:c,sourceInfo:nAs(t,c,e),disableModelInvocation:i["disable-model-invocation"]===!0},diagnostics:n}:{skill:null,diagnostics:n}}function aee(t,e="read"){let n=t.filter(s=>!s.disableModelInvocation);if(n.length===0)return"";let r=[` - -The following skills provide specialized instructions for specific tasks.`,e==="read"?"Use the read tool to load a skill's file when the task matches its description.":"Use bash to load a skill's file when the task matches its description.","When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.","",""];for(let s of n)r.push(" "),r.push(` ${GZe(s.name)}`),r.push(` ${GZe(s.description)}`),r.push(` ${GZe(s.filePath)}`),r.push(" ");return r.push(""),r.join(` -`)}function GZe(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function ICe(t){let{agentDir:e,skillPaths:n,includeDefaults:r}=t,s=jn(t.cwd),i=jn(e??ls()),o=new Map,a=new Set,c=[],u=[];function l(g){c.push(...g.diagnostics);for(let A of g.skills){let y=fu(A.filePath);if(a.has(y))continue;let b=o.get(A.name);b?u.push({type:"collision",message:`name "${A.name}" collision`,path:A.filePath,collision:{resourceType:"skill",name:A.name,winnerPath:b.filePath,loserPath:A.filePath}}):(o.set(A.name,A),a.add(y))}}r&&(l(oee((0,hl.join)(i,"skills"),"user",!0)),l(oee((0,hl.resolve)(s,ws,"skills"),"project",!0)));let d=(0,hl.join)(i,"skills"),h=(0,hl.resolve)(s,ws,"skills"),m=(g,A)=>{let y=(0,hl.resolve)(A);if(g===y)return!0;let b=y.endsWith(hl.sep)?y:`${y}${hl.sep}`;return g.startsWith(b)},f=g=>{if(!r){if(m(g,d))return"user";if(m(g,h))return"project"}return"path"};for(let g of n){let A=jn(g,s,{trim:!0});if(!(0,ay.existsSync)(A)){c.push({type:"warning",message:"skill path does not exist",path:A});continue}try{let y=(0,ay.statSync)(A),b=f(A);if(y.isDirectory())l(oee(A,b,!0));else if(y.isFile()&&A.endsWith(".md")){let S=qZe(A,b);S.skill?l({skills:[S.skill],diagnostics:S.diagnostics}):c.push(...S.diagnostics)}else c.push({type:"warning",message:"skill path is not a markdown file",path:A})}catch(y){let b=y instanceof Error?y.message:"failed to read skill path";c.push({type:"warning",message:b,path:A})}}return{skills:Array.from(o.values()),diagnostics:[...c,...u]}}function y_n(t){let{customPrompt:e,selectedTools:n,toolSnippets:r,promptGuidelines:s,appendSystemPrompt:i,cwd:o,contextFiles:a,skills:c}=t,u=o.replace(/\\/g,"/"),l=i?` - -${i}`:"",d=a??[],h=c??[],m=n||["read","bash","edit","write"],f=["read","bash"].find(H=>m.includes(H));if(e){let H=e;if(l&&(H+=l),d.length>0){H+=` - - - -`,H+=`Project-specific instructions and guidelines: +`),a=Math.max(s.length,o.length),c=String(a).length,u=1,l=1,d=!1,m;for(let h=0;h0&&(i.push(` ${"".padStart(c," ")} ...`),u+=S,l+=S)}else if(E){let _=Math.max(0,g.length-n);_>0&&(i.push(` ${"".padStart(c," ")} ...`),u+=_,l+=_);for(let S of g.slice(_)){let C=String(u).padStart(c," ");i.push(` ${C} ${S}`),u++,l++}}else u+=g.length,l+=g.length;d=!1}}return{diff:i.join(` +`),firstChangedLine:m}}var s3n=v(()=>{p();Kke()});function y8i(t){let e=o3n.get(t);return e||(e={queues:new Map,registration:Promise.resolve()},o3n.set(t,e)),e}async function E8i(t,e,n){let r=fS(await t.absolutePath(e,n)),i=await t.canonicalPath(r,n);if(i.ok)return i.value;if(i.error.code==="not_found"||i.error.code==="not_supported")return r;throw i.error}async function Xke(t,e,n,r){let i=y8i(t),s=i.registration.then(async()=>{let l=await E8i(t,e,r),d=i.queues.get(l)??Promise.resolve(),m=()=>{},h=new Promise(g=>{m=g}),f=d.then(()=>h);return i.queues.set(l,f),{key:l,currentQueue:d,chainedQueue:f,releaseNext:m}});i.registration=s.then(()=>{},()=>{});let{key:o,currentQueue:a,chainedQueue:c,releaseNext:u}=await s;await a;try{return await n()}finally{u(),i.queues.get(o)===c&&i.queues.delete(o)}}var o3n,fpt=v(()=>{p();vb();o3n=new WeakMap});function x8i(t){let e=t.replace(b8i," ");return e.startsWith("@")?e.slice(1):e}async function Tse(t,e,n){return fS(await t.absolutePath(x8i(e),n))}async function a3n(t,e,n){let r=await Tse(t,e,n),i=[r,r.replace(/ (AM|PM)\./gi,`${_8i}$1.`),r.normalize("NFD"),r.replace(/'/g,"\u2019"),r.normalize("NFD").replace(/'/g,"\u2019")];for(let s of new Set(i))if(fS(await t.exists(s,n)))return s;return r}var b8i,_8i,Zke=v(()=>{p();vb();b8i=/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g,_8i="\u202F"});function c3n(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.oldText=="string"&&typeof e.newText=="string"}function I8i(t){if(!t||typeof t!="object")return t;let e=t;if(typeof e.edits=="string")try{let a=JSON.parse(e.edits);Array.isArray(a)?e.edits=a:c3n(a)&&(e.edits=[a])}catch{}else c3n(e.edits)&&(e.edits=[e.edits]);let n=e;if(typeof n.oldText!="string"||typeof n.newText!="string")return e;let r=Array.isArray(n.edits)?[...n.edits]:[];r.push({oldText:n.oldText,newText:n.newText});let{oldText:i,newText:s,...o}=n;return{...o,edits:r}}function w8i(t){if(!Array.isArray(t.edits)||t.edits.length===0)throw new Error("Edit tool input is invalid. edits must contain at least one replacement.");return{path:t.path,edits:t.edits}}function gpt(t,e){return new Error(`Could not edit file: ${t}. Error code: ${e.code}.`,{cause:e})}function l3n(){return{name:"edit",label:"edit",description:"Edit a single file using exact text replacement. Every edits[].oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit instead of emitting overlapping edits. Do not include large unchanged regions just to connect distant changes.",parameters:C8i,prepareArguments:I8i,async execute(t,e,n,{env:r},i,s){let{path:o,edits:a}=w8i(e),c=await Tse(r,o,s);return Xke(r,c,async()=>{if(s.abortSignal?.aborted)throw new Error("Operation aborted");let u=await r.fileInfo(c,s);if(!u.ok)throw gpt(o,u.error);if(u.value.kind!=="file"&&u.value.kind!=="symlink")throw new Error(`Could not edit file: ${o}. Path is not a file.`);let l=await r.readTextFile(c,s);if(!l.ok)throw gpt(o,l.error);if(s.abortSignal?.aborted)throw new Error("Operation aborted");let{bom:d,text:m}=t3n(l.value),h=J5n(m),f=Jke(m),{baseContent:g,newContent:A}=n3n(f,a,o);if(s.abortSignal?.aborted)throw new Error("Operation aborted");let y=d+X5n(A,h),E=await r.writeFile(c,y,s);if(!E.ok)throw gpt(o,E.error);if(s.abortSignal?.aborted)throw new Error("Operation aborted");let _=i3n(g,A);return{content:[{type:"text",text:`Successfully replaced ${a.length} block(s) in ${o}.`}],details:{diff:_.diff,patch:r3n(o,g,A),firstChangedLine:_.firstChangedLine}}},s)}}}var S8i,C8i,u3n=v(()=>{p();Vm();s3n();fpt();Zke();S8i=Ne.Object({oldText:Ne.String({description:"Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call."}),newText:Ne.String({description:"Replacement text for this targeted edit."})},{}),C8i=Ne.Object({path:Ne.String({description:"Path to the file to edit (relative or absolute)"}),edits:Ne.Array(S8i,{description:"One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead."})},{})});function p3n(t){if(d3n(t,[255,216,255]))return t[3]===247?void 0:"image/jpeg";if(d3n(t,ypt))return T8i(t)&&!v8i(t)?"image/png":void 0;if(tP(t,0,"GIF87a")||tP(t,0,"GIF89a"))return"image/gif";if(tP(t,0,"RIFF")&&tP(t,8,"WEBP"))return"image/webp";if(tP(t,0,"BM")&&R8i(t))return"image/bmp"}function m3n(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="";for(let r=0;r>2],n+=e[(i&3)<<4|(s??0)>>4],n+=s===void 0?"=":e[(s&15)<<2|(o??0)>>6],n+=o===void 0?"=":e[o&63]}return n}function T8i(t){return t.length>=16&&h3n(t,ypt.length)===13&&tP(t,12,"IHDR")}function v8i(t){let e=ypt.length;for(;e+8<=t.length;){let n=h3n(t,e),r=e+4;if(tP(t,r,"acTL"))return!0;if(tP(t,r,"IDAT"))return!1;let i=e+8+n+4;if(i<=e||i>t.length)return!1;e=i}return!1}function R8i(t){if(t.length<26)return!1;let e=Apt(t,2),n=Apt(t,10),r=Apt(t,14);if(e!==0&&e<26||n<14+r||e!==0&&n>=e)return!1;let i,s;if(r===12)i=e1e(t,22),s=e1e(t,24);else if(r>=40&&r<=124){if(t.length<30)return!1;i=e1e(t,26),s=e1e(t,28)}else return!1;return i===1&&[1,4,8,16,24,32].includes(s)}function e1e(t,e){return(t[e]??0)+((t[e+1]??0)<<8)}function h3n(t,e){return(t[e]??0)*16777216+((t[e+1]??0)<<16)+((t[e+2]??0)<<8)+(t[e+3]??0)}function Apt(t,e){return(t[e]??0)+((t[e+1]??0)<<8)+((t[e+2]??0)<<16)+(t[e+3]??0)*16777216}function d3n(t,e){return t.lengtht[r]===n)}function tP(t,e,n){if(t.length{p();ypt=[137,80,78,71,13,10,26,10]});function g3n(t){return{name:"read",label:"read",description:`Read the contents of a file. Supports text files and images (jpg, png, gif, webp, bmp). Images are sent as attachments. For text files, output is truncated to ${2e3} lines or ${51200/1024}KB (whichever is hit first). Use offset/limit for large files. When you need the full file, continue with offset until complete.`,parameters:k8i,async execute(e,{path:n,offset:r,limit:i},s,{env:o},a,c){let u=await a3n(o,n,c),l=fS(await o.readBinaryFile(u,c)),d=p3n(l);if(d){if(t?.imageProcessor){let I=await t.imageProcessor(l,d,{autoResizeImages:t.autoResizeImages??!0},c);if(!I.ok)return{content:[{type:"text",text:`Read image file [${d}] +${I.message}`}],details:void 0};let w=I.hints.length>0?` +${I.hints.join(` +`)}`:"";return{content:[{type:"text",text:`Read image file [${I.mimeType}]${w}`},{type:"image",data:I.data,mimeType:I.mimeType}],details:void 0}}return d==="image/bmp"?{content:[{type:"text",text:`Read image file [image/bmp] +[Image omitted: configure an imageProcessor to convert BMP images.]`}],details:void 0}:{content:[{type:"text",text:`Read image file [${d}]`},{type:"image",data:m3n(l),mimeType:d}],details:void 0}}let h=new TextDecoder().decode(l).split(` +`),f=h.length,g=r?Math.max(0,r-1):0,A=g+1;if(g>=h.length)throw new Error(`Offset ${r} is beyond end of file (${h.length} lines total)`);let y,E;if(i!==void 0){let I=Math.min(g+i,h.length);y=h.slice(g,I).join(` +`),E=I-g}else y=h.slice(g).join(` +`);let _=$ke(y),S,C;if(_.firstLineExceedsLimit){let I=ik(new TextEncoder().encode(h[g]).byteLength);S=`[Line ${A} is ${I}, exceeds ${ik(51200)} limit. Use bash: sed -n '${A}p' ${n} | head -c ${51200}]`,C={truncation:_}}else if(_.truncated){let I=A+_.outputLines-1,w=I+1;S=_.content,_.truncatedBy==="lines"?S+=` -`;for(let{path:oe,content:re}of d)H+=` -${re} - +[Showing lines ${A}-${I} of ${f}. Use offset=${w} to continue.]`:S+=` -`;H+=` -`}return f&&h.length>0&&(H+=aee(h,f)),H+=` -Current working directory: ${u} -`,H}let g=V3(),A=Yw(),y=hbe(),b=m.filter(H=>!!r?.[H]),S=b.length>0?b.map(H=>`- ${H}: ${r[H]}`).join(` -`):"(none)",C=[],I=new Set,x=H=>{I.has(H)||(I.add(H),C.push(H))},w=m.includes("bash"),R=m.includes("powershell"),N=m.includes("grep"),P=m.includes("find"),G=m.includes("ls");(w||R)&&!N&&!P&&!G&&x(w&&R?"Use bash or PowerShell for file operations like listing, searching, and finding files":R?"Use PowerShell for file operations like listing, searching, and finding files":"Use bash for file operations like ls, rg, find");for(let H of s??[]){let oe=H.trim();oe.length>0&&x(oe)}x("Be concise in your responses"),x("Show file paths clearly when working with files");let $=C.map(H=>`- ${H}`).join(` -`),Q=`You are an expert coding assistant operating inside pi, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files. +[Showing lines ${A}-${I} of ${f} (${ik(51200)} limit). Use offset=${w} to continue.]`,C={truncation:_}}else if(E!==void 0&&g+E{p();Vm();vb();IV();f3n();Zke();k8i=Ne.Object({path:Ne.String({description:"Path to the file to read (relative or absolute)"}),offset:Ne.Optional(Ne.Number({description:"Line number to start reading from (1-indexed)"})),limit:Ne.Optional(Ne.Number({description:"Maximum number of lines to read"}))})});function y3n(){return{name:"write",label:"write",description:"Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.",parameters:B8i,async execute(t,{path:e,content:n},r,{env:i},s,o){let a=await Tse(i,e,o);return Xke(i,a,async()=>{if(o.abortSignal?.aborted)throw new Error("Operation aborted");if(fS(await i.writeFile(a,n,o)),o.abortSignal?.aborted)throw new Error("Operation aborted");return{content:[{type:"text",text:`Successfully wrote to ${e}`}],details:void 0}},o)}}}var B8i,E3n=v(()=>{p();Vm();vb();fpt();Zke();B8i=Ne.Object({path:Ne.String({description:"Path to the file to write (relative or absolute)"}),content:Ne.String({description:"Content to write to the file"})})});var b3n=v(()=>{p();U5n();u3n();A3n();E3n()});function _3n(t){return{output:t.text,truncation:{content:t.text,...t.truncation},...t.spillPath===void 0?{}:{fullOutputPath:t.spillPath},lastLineBytes:t.lastLineBytes??0}}async function N8i(t,e,n,r){let i,s=await t.exec(e,{cwd:n?.cwd,env:n?.env,inheritEnv:n?.inheritEnv,timeout:n?.timeout,capture:{limits:{maxBytes:51200,maxLines:2e3,retain:"tail"},spill:!0},onUpdate:(a,c)=>{let u=i;i=wV(i,a);let l=a.kind==="append"||a.kind==="slide"?a.text:a.kind==="replace"&&u===void 0?i.text:void 0;l&&n?.onChunk?.(l,()=>_3n(i),c)}},r);if(i===void 0){let{content:a,...c}=Wke("");i={text:a,truncation:c}}let o=_3n(i);return s.ok?hp({...o,exitCode:s.value.exitCode,cancelled:!1,truncated:s.value.truncation.truncated}):s.error.code==="aborted"||r.abortSignal?.aborted?hp({...o,exitCode:void 0,cancelled:!0,truncated:o.truncation.truncated}):n?.returnExecutionErrors?hp({...o,exitCode:void 0,cancelled:!1,truncated:o.truncation.truncated,executionError:s.error}):fp(s.error)}var x3n=v(()=>{p();vb();Hke();IV()});function D8i(t){return{temperature:t.temperature,samplingParams:t.samplingParams,maxTokens:t.maxTokens,reasoning:t.reasoning,cacheRetention:t.cacheRetention,sessionId:t.sessionId,headers:t.headers,metadata:t.metadata,transport:t.transport,thinkingBudgets:t.thinkingBudgets,maxRetryDelayMs:t.maxRetryDelayMs}}function P8i(t,e,n){let r=new Ept;return(async()=>{let i={role:"assistant",stopReason:"pending",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},timestamp:Date.now()},s,o=()=>{s&&s.cancel("Request aborted by user").catch(()=>{})};n.signal&&n.signal.addEventListener("abort",o);try{let a=await fetch(`${n.proxyUrl}/api/stream`,{method:"POST",headers:{Authorization:`Bearer ${n.authToken}`,"Content-Type":"application/json"},body:JSON.stringify({model:t,context:e,options:D8i(n)}),signal:n.signal});if(!a.ok){let m=`Proxy error: ${a.status} ${a.statusText}`;try{let h=await a.json();h.error&&(m=`Proxy error: ${h.error}`)}catch{}throw new Error(m)}s=a.body.getReader();let c=new TextDecoder,u="",l=!1,d=m=>{if(!m.startsWith("data: "))return;let h=m.slice(6).trim();if(!h)return;let f=JSON.parse(h),g=M8i(f,i);g&&((g.type==="done"||g.type==="error")&&(l=!0),r.push(g))};for(;;){let{done:m,value:h}=await s.read();if(m)break;if(n.signal?.aborted)throw new Error("Request aborted by user");u+=c.decode(h,{stream:!0});let f=u.split(` +`);u=f.pop()||"";for(let g of f)d(g)}if(n.signal?.aborted)throw new Error("Request aborted by user");u+=c.decode(),u&&d(u),l||(i.stopReason="error",i.errorMessage="Connection closed by proxy server before the response completed",r.push({type:"error",reason:"error",error:i})),r.end()}catch(a){let c=a instanceof Error?a.message:String(a),u=n.signal?.aborted?"aborted":"error";i.stopReason=u,i.errorMessage=c,r.push({type:"error",reason:u,error:i}),r.end()}finally{n.signal&&n.signal.removeEventListener("abort",o)}})(),r}function M8i(t,e){switch(t.type){case"start":return{type:"start",partial:e};case"text_start":return e.content[t.contentIndex]={type:"text",text:""},{type:"text_start",contentIndex:t.contentIndex,partial:e};case"text_delta":{let n=e.content[t.contentIndex];if(n?.type==="text")return n.text+=t.delta,{type:"text_delta",contentIndex:t.contentIndex,delta:t.delta,partial:e};throw new Error("Received text_delta for non-text content")}case"text_end":{let n=e.content[t.contentIndex];if(n?.type==="text")return n.textSignature=t.contentSignature,{type:"text_end",contentIndex:t.contentIndex,content:n.text,partial:e};throw new Error("Received text_end for non-text content")}case"thinking_start":return e.content[t.contentIndex]={type:"thinking",thinking:""},{type:"thinking_start",contentIndex:t.contentIndex,partial:e};case"thinking_delta":{let n=e.content[t.contentIndex];if(n?.type==="thinking")return n.thinking+=t.delta,{type:"thinking_delta",contentIndex:t.contentIndex,delta:t.delta,partial:e};throw new Error("Received thinking_delta for non-thinking content")}case"thinking_end":{let n=e.content[t.contentIndex];if(n?.type==="thinking")return n.thinkingSignature=t.contentSignature,{type:"thinking_end",contentIndex:t.contentIndex,content:n.thinking,partial:e};throw new Error("Received thinking_end for non-thinking content")}case"toolcall_start":return e.content[t.contentIndex]={type:"toolCall",id:t.id,name:t.toolName,arguments:{},partialJson:""},{type:"toolcall_start",contentIndex:t.contentIndex,partial:e};case"toolcall_delta":{let n=e.content[t.contentIndex];if(n?.type==="toolCall")return n.partialJson+=t.delta,n.arguments=ec(n.partialJson)||{},e.content[t.contentIndex]={...n},{type:"toolcall_delta",contentIndex:t.contentIndex,delta:t.delta,partial:e};throw new Error("Received toolcall_delta for non-toolCall content")}case"toolcall_end":{let n=e.content[t.contentIndex];return n?.type==="toolCall"?(Object.assign(n,t.toolCall),delete n.partialJson,{type:"toolcall_end",contentIndex:t.contentIndex,toolCall:n,partial:e}):void 0}case"done":return e.stopReason=t.reason,e.usage=t.usage,t.providerThinkingLevel!==void 0&&(e.providerThinkingLevel=t.providerThinkingLevel),{type:"done",reason:t.reason,message:e};case"error":return e.stopReason=t.reason,e.errorMessage=t.errorMessage,e.usage=t.usage,t.providerThinkingLevel!==void 0&&(e.providerThinkingLevel=t.providerThinkingLevel),{type:"error",reason:t.reason,error:e};default:{let n=t;console.warn(`Unhandled proxy event type: ${t.type}`);return}}}var Ept,S3n=v(()=>{p();qo();Ept=class extends mB{constructor(){super(e=>e.type==="done"||e.type==="error",e=>{if(e.type==="done")return e.message;if(e.type==="error")return e.error;throw new Error("Unexpected event type")})}}});var C3n=v(()=>{p()});var I3n=v(()=>{p()});var t1e={};br(t1e,{AGENT_TELEMETRY_SCHEMAS:()=>vHn,AI_TELEMETRY_SCHEMA:()=>tdt,Agent:()=>Jie,AgentHarness:()=>C4i,BACKGROUND_CONTEXT:()=>oHn,BRANCH_SUMMARY_PREFIX:()=>hHn,BRANCH_SUMMARY_SUFFIX:()=>fHn,BranchSummaryError:()=>IQ,COMPACTION_SUMMARY_PREFIX:()=>pHn,COMPACTION_SUMMARY_SUFFIX:()=>mHn,Closed:()=>wE,CompactionError:()=>KR,DEFAULT_COMPACTION_SETTINGS:()=>nse,DEFAULT_MAX_BYTES:()=>Pb,DEFAULT_MAX_LINES:()=>XD,ExecutionError:()=>HRe,FileError:()=>WRe,GREP_MAX_LINE_LENGTH:()=>vSc,HARNESS_TELEMETRY_SCHEMA:()=>ndt,HarnessClosed:()=>_g,HarnessFault:()=>jR,InMemoryTelemetryContext:()=>Yie,InvalidLane:()=>SQ,InvalidMessage:()=>gw,InvalidNavigation:()=>VD,JSONL_STORAGE_VERSION:()=>Db,JsonlSessionRepo:()=>Uke,LaneBusy:()=>jD,MemorySessionRepo:()=>Gke,NOOP_TELEMETRY_CONTEXT:()=>qD,NoActiveOperation:()=>xQ,NoActiveRun:()=>ORe,NothingToCompact:()=>iV,NothingToResume:()=>rV,OperationMismatch:()=>nV,Result:()=>Ir,SessionBranchExistsError:()=>ase,SessionInvalidBranchError:()=>hV,SessionInvariantError:()=>un,SessionPendingAssistantMessageError:()=>KD,SessionUnknownTargetError:()=>cse,SliceNotImplemented:()=>cV,StorageBackedSession:()=>ek,TODO_CONTEXT:()=>aHn,TaggedError:()=>DA,UnknownSkill:()=>sV,UnknownTarget:()=>qR,UnknownTemplate:()=>oV,agentLoop:()=>m5i,agentLoopContinue:()=>h5i,appendList:()=>ise,applyShellOutputUpdate:()=>wV,awaitWithContext:()=>VR,bashExecutionToText:()=>gHn,branchTip:()=>Mo,branchTipInventoryPrefix:()=>odt,calculateContextTokens:()=>XRe,collectEntriesForBranchSummary:()=>DHn,commitWrite:()=>idt,compact:()=>CHn,convertToLlm:()=>YD,createBashTool:()=>Q5n,createBranchSummaryMessage:()=>YR,createCompactionSummaryMessage:()=>zR,createContextKey:()=>Lut,createCustomMessage:()=>T5i,createEditTool:()=>l3n,createForkSnapshot:()=>f5n,createReadTool:()=>g3n,createTypedSpanStarter:()=>KWn,createWriteTool:()=>y3n,defineTelemetrySchema:()=>YWn,deleteList:()=>JR,deleteValue:()=>Ga,entryLabel:()=>yS,err:()=>fp,estimateContextTokens:()=>Wut,estimateTokens:()=>wQ,executeShellWithCapture:()=>N8i,findCutPoint:()=>qut,findTurnStartIndex:()=>Hut,formatPromptTemplateInvocation:()=>hdt,formatSize:()=>ik,formatSkillInvocation:()=>Sdt,formatSkillsForSystemPrompt:()=>J4i,generateBranchSummary:()=>PHn,generateSummary:()=>SHn,generateSummaryWithUsage:()=>jut,getLastAssistantUsage:()=>xHn,getOrThrow:()=>fS,getOrUndefined:()=>EHn,getTelemetryContext:()=>Kh,insertEntry:()=>gp,insertUsage:()=>vE,laneConfig:()=>xg,laneState:()=>Ml,list:()=>ake,loadPromptTemplates:()=>GHn,loadSkills:()=>aqn,loadSourcedPromptTemplates:()=>j5i,loadSourcedSkills:()=>I3i,matchError:()=>w5i,ok:()=>hp,operationMeta:()=>XR,operationPreparation:()=>AS,operationPreparationPrefix:()=>adt,operationResult:()=>pV,operationScopeOf:()=>Od,operationState:()=>gS,operationToolArgs:()=>mV,operationToolArgsPrefix:()=>sse,operationToolMemo:()=>cke,operationToolMemoPrefix:()=>ose,parseCommandArgs:()=>z5i,pendingAssistantFrames:()=>Aw,pendingEntry:()=>ll,pendingToolOutput:()=>ZR,pendingToolOutputPrefix:()=>cdt,prepareBranchEntries:()=>lse,prepareCompaction:()=>TQ,prepareStorageCommit:()=>ike,projectForkCurrentStateWrite:()=>Sw,reduceLaneSnapshot:()=>p5n,resolveListReadOptions:()=>sdt,runAgentLoop:()=>DRe,runAgentLoopContinue:()=>PRe,sanitizeBinaryOutput:()=>L5n,serializeConversation:()=>zD,sessionName:()=>yw,setDefaultStreamFn:()=>BRe,setValue:()=>fr,shouldCompact:()=>ZRe,startAiSpan:()=>THn,startHarnessSpan:()=>nke,streamProxy:()=>P8i,substituteArgs:()=>HHn,toError:()=>lV,truncateHead:()=>$ke,truncateLine:()=>t8i,truncateTail:()=>Wke,utf8ByteLength:()=>Cw,uuidv7:()=>Oc,validateCommittedWrites:()=>ske,value:()=>nu,withAbortSignal:()=>PA,withCancel:()=>cHn,withContextValue:()=>Zie,withTelemetryContext:()=>URe,withoutAbortSignal:()=>QRe});var bpt=v(()=>{p();qo();Rut();iHn();Put();d5n();lke();dV();TE();CQ();fdt();Xie();m5n();N5n();Cdt();D5n();rdt();b3n();vb();Hke();x3n();IV();S3n();C3n();NRe();I3n()});var _pt={};var w3n=v(()=>{p()});var T3n={};br(T3n,{VIRTUAL_MODULES:()=>O8i});var O8i,v3n=v(()=>{p();bpt();cR();w3n();OIe();Tr();Vm();nne();GCe();Mb();O8i={typebox:vSe,"typebox/compile":WCe,"typebox/value":UCe,"@sinclair/typebox":vSe,"@sinclair/typebox/compile":WCe,"@sinclair/typebox/value":UCe,"@earendil-works/pi-agent-core":t1e,"@earendil-works/pi-tui":Ure,"@earendil-works/pi-ai":s8,"@earendil-works/pi-ai/compat":s8,"@earendil-works/pi-ai/oauth":_pt,"@earendil-works/pi-ai/providers/all":sne,"@earendil-works/pi-coding-agent":n1e,"@mariozechner/pi-agent-core":t1e,"@mariozechner/pi-tui":Ure,"@mariozechner/pi-ai":s8,"@mariozechner/pi-ai/compat":s8,"@mariozechner/pi-ai/oauth":_pt,"@mariozechner/pi-ai/providers/all":sne,"@mariozechner/pi-coding-agent":n1e}});function Q8i(){return R3n??=(P3n?Promise.resolve().then(()=>(FWn(),LWn)):Promise.resolve().then(()=>(WWn(),$Wn))).then(t=>t.createJiti),R3n}function B3n(){return k3n??=Promise.resolve().then(()=>(v3n(),T3n)).then(t=>t.VIRTUAL_MODULES),k3n}function U8i(){if(r1e)return r1e;let t=am.dirname((0,i1e.fileURLToPath)(x)),e=am.resolve(t,"../..","index.js"),n=xpt.resolve("typebox"),r=xpt.resolve("typebox/compile"),i=xpt.resolve("typebox/value"),s=am.resolve(t,"../../../../"),o=(h,f)=>{let g=am.join(s,h);return Ob.existsSync(g)?g:(0,i1e.fileURLToPath)(V8i.resolve(f))},a=e,c=o("agent/dist/index.js","@earendil-works/pi-agent-core"),u=o("tui/dist/index.js","@earendil-works/pi-tui"),l=o("ai/dist/compat.js","@earendil-works/pi-ai/compat"),d=o("ai/dist/oauth.js","@earendil-works/pi-ai/oauth"),m=o("ai/dist/providers/all.js","@earendil-works/pi-ai/providers/all");return r1e={"@earendil-works/pi-coding-agent":a,"@earendil-works/pi-agent-core":c,"@earendil-works/pi-tui":u,"@earendil-works/pi-ai/providers/all":m,"@earendil-works/pi-ai/compat":l,"@earendil-works/pi-ai/oauth":d,"@earendil-works/pi-ai":l,"@mariozechner/pi-coding-agent":a,"@mariozechner/pi-agent-core":c,"@mariozechner/pi-tui":u,"@mariozechner/pi-ai/providers/all":m,"@mariozechner/pi-ai/compat":l,"@mariozechner/pi-ai/oauth":d,"@mariozechner/pi-ai":l,typebox:n,"typebox/compile":r,"typebox/value":i,"@sinclair/typebox":n,"@sinclair/typebox/compile":r,"@sinclair/typebox/value":i},r1e}function wpt(){Cpt.clear(),vse=void 0,Ipt++}function G8i(t){let e=Vn(t);return vse!==void 0&&vse!==e&&wpt(),vse=e,{cwd:e,generation:Ipt}}function RV(){let t=()=>{throw new Error("Extension runtime not initialized. Action methods cannot be called during extension loading.")},e={},n=new Set,i={sendMessage:t,sendUserMessage:t,appendEntry:t,setSessionName:t,getSessionName:t,setLabel:t,getActiveTools:t,getAllTools:t,setActiveTools:t,refreshTools:()=>{},getCommands:t,setModel:()=>Promise.reject(new Error("Extension runtime not initialized")),getThinkingLevel:t,setThinkingLevel:t,flagValues:new Map,pendingProviderRegistrations:[],pendingNativeProviderRegistrations:[],assertActive:()=>{if(e.staleMessage)throw new Error(e.staleMessage)},invalidate:s=>{if(!e.staleMessage){e.staleMessage=s??"This extension ctx is stale after session replacement or reload. Do not use a captured pi or command ctx after ctx.newSession(), ctx.fork(), ctx.switchSession(), or ctx.reload(). For newSession, fork, and switchSession, move post-replacement work into withSession and use the ctx passed to withSession. For reload, do not use the old ctx after await ctx.reload().";for(let o of n)o();n.clear()}},trackEventBusSubscription:s=>{let o=!0,a=()=>{o&&(o=!1,n.delete(a),s())};return n.add(a),a},registerProvider:(s,o,a="")=>{i.pendingProviderRegistrations.push({name:s,config:o,extensionPath:a})},registerNativeProvider:(s,o="")=>{i.pendingNativeProviderRegistrations.push({provider:s,extensionPath:o})},unregisterProvider:s=>{i.pendingProviderRegistrations=i.pendingProviderRegistrations.filter(o=>o.name!==s),i.pendingNativeProviderRegistrations=i.pendingNativeProviderRegistrations.filter(o=>o.provider.id!==s)}};return i}function $8i(t,e,n,r){let i=new Map,s=[],o=[],a="loading",c=()=>{if(a==="failed")throw new Error(`Extension "${t.path}" failed to load and its API is no longer active.`);e.assertActive()},u=m=>{a==="loading"?s.push(m):m()},l=()=>{i.clear(),s.length=0,o.length=0};return{api:{on(m,h){c();let f=(...A)=>h(...A),g=t.handlers.get(m)??[];return g.push(f),t.handlers.set(m,g),()=>{let A=t.handlers.get(m);if(!A)return;let y=A.indexOf(f);y!==-1&&(A.splice(y,1),A.length===0&&t.handlers.delete(m))}},registerTool(m){if(c(),typeof m.parameters!="object"||m.parameters===null||Array.isArray(m.parameters))throw new Error(`Tool "${m.name}" registered by extension "${t.path}" must define an object parameter schema.`);t.tools.set(m.name,{definition:m,sourceInfo:t.sourceInfo}),e.refreshTools()},registerCommand(m,h){c(),t.commands.set(m,{name:m,sourceInfo:t.sourceInfo,...h})},registerShortcut(m,h){c(),t.shortcuts.set(m,{shortcut:m,extensionPath:t.path,...h})},registerFlag(m,h){if(c(),h.default!==void 0&&typeof h.default!==h.type)throw new Error(`Invalid default for flag "${m}": expected ${h.type}, got ${typeof h.default}`);t.flags.set(m,{name:m,extensionPath:t.path,...h}),h.default!==void 0&&!e.flagValues.has(m)&&(a==="loading"?i.has(m)||i.set(m,h.default):e.flagValues.set(m,h.default))},registerMessageRenderer(m,h){c(),t.messageRenderers.set(m,h)},registerMarkdownTransformer(m){c(),t.markdownTransformer=m},registerEntryRenderer(m,h){c(),t.entryRenderers??=new Map,t.entryRenderers.set(m,h)},getFlag(m){if(c(),!!t.flags.has(m))return e.flagValues.has(m)?e.flagValues.get(m):i.get(m)},sendMessage(m,h){c(),e.sendMessage(m,h)},sendUserMessage(m,h){c(),e.sendUserMessage(m,h)},appendEntry(m,h){c(),e.appendEntry(m,h)},setSessionName(m){c(),e.setSessionName(m)},getSessionName(){return c(),e.getSessionName()},setLabel(m,h){c(),e.setLabel(m,h)},exec(m,h,f){return c(),CWn(m,h,f?.cwd??n,f)},getActiveTools(){return c(),e.getActiveTools()},getAllTools(){return c(),e.getAllTools()},setActiveTools(m){c(),e.setActiveTools(m)},getCommands(){return c(),e.getCommands()},setModel(m){return c(),e.setModel(m)},getThinkingLevel(){return c(),e.getThinkingLevel()},setThinkingLevel(m){c(),e.setThinkingLevel(m)},registerProvider(m,h){if(c(),typeof m=="string"){if(!h)throw new Error("Provider config is required when registering by name");u(()=>e.registerProvider(m,h,t.path));return}u(()=>e.registerNativeProvider(m,t.path))},unregisterProvider(m){c(),u(()=>e.unregisterProvider(m,t.path))},events:{emit(m,h){c(),r.emit(m,h)},on(m,h){c();let f=e.trackEventBusSubscription(r.on(m,h));return a==="loading"&&o.push(f),f}}},commit:()=>{if(a==="loading"){e.assertActive();for(let[m,h]of i)e.flagValues.has(m)||e.flagValues.set(m,h);for(let m of s)m();a="active",l()}},discard:()=>{if(a==="loading"){a="failed";for(let m of o)m();l()}}}}function N3n(t){return t!==void 0&&vse===t.cwd&&Ipt===t.generation}async function W8i(t,e){if(N3n(e)){let a=Cpt.get(t);if(a)return a}let n=await Q8i(),r=P3n?{virtualModules:await B3n(),tryNative:!1}:F8i?{virtualModules:await B3n(),tsconfigPaths:!0}:{alias:U8i()},o=await n(x,{moduleCache:!1,...r}).import(t,{default:!0});if(typeof o=="function")return N3n(e)&&Cpt.set(t,o),o}function H8i(t,e){let n=t.startsWith("<")&&t.endsWith(">")?t.slice(1,-1).split(":")[0]||"temporary":"local",r=t.startsWith("<")?void 0:am.dirname(e);return{path:t,resolvedPath:e,sourceInfo:ih(t,{source:n,baseDir:r}),handlers:new Map,tools:new Map,messageRenderers:new Map,entryRenderers:new Map,commands:new Map,flags:new Map,shortcuts:new Map}}async function M3n(t,e,n,r,i,s){let o=H8i(e,n),a=$8i(o,s,r,i);try{await t(a.api),a.commit()}catch(c){throw a.discard(),c}return om(`${e} factory`,"extensions"),o}async function q8i(t,e,n,r,i){let s=Vn(t,e,{normalizeUnicodeSpaces:!0});try{let o=await W8i(s,i);return om(`${t} module import`,"extensions"),o?{extension:await M3n(o,t,s,e,n,r),error:null}:{extension:null,error:`Extension does not export a valid factory function: ${t}`}}catch(o){return{extension:null,error:`Failed to load extension: ${o instanceof Error?o.message:String(o)}`}}}async function Tpt(t,e,n,r,i=""){let s=Vn(e);return M3n(t,i,i,s,n,r)}async function O3n(t,e,n,r,i=!1){let s=[],o=[],a=i?G8i(e):void 0,c=a?.cwd??Vn(e),u=n??eV(),l=r??RV();for(let d of t){let{extension:m,error:h}=await q8i(d,c,u,l,a);if(h){o.push({path:d,error:h});continue}m&&s.push(m)}return{extensions:s,errors:o,runtime:l}}async function L3n(t,e,n,r){return O3n(t,e,n,r)}async function s1e(t,e,n,r){return O3n(t,e,n,r,!0)}function j8i(t){return t.endsWith(".ts")||t.endsWith(".js")}function F3n(t){let e=am.join(t,"package.json");if(Ob.existsSync(e)){let i=bQ(e);if(i?.extensions?.length){let s=[];for(let o of i.extensions){let a=am.resolve(t,o);Ob.existsSync(a)&&s.push(a)}if(s.length>0)return s}}let n=am.join(t,"index.ts"),r=am.join(t,"index.js");return Ob.existsSync(n)?[n]:Ob.existsSync(r)?[r]:null}function Spt(t){if(!Ob.existsSync(t))return[];let e=[];try{let n=Ob.readdirSync(t,{withFileTypes:!0});for(let r of n){let i=am.join(t,r.name);if((r.isFile()||r.isSymbolicLink())&&j8i(r.name)){e.push(i);continue}if(r.isDirectory()||r.isSymbolicLink()){let s=F3n(i);s&&e.push(...s)}}}catch{return[]}return e}async function vpt(t,e,n=ii(),r){let i=Vn(e),s=Vn(n),o=[],a=new Set,c=d=>{for(let m of d){let h=am.resolve(m);a.has(h)||(a.add(h),o.push(m))}},u=am.join(i,Bi,"extensions");c(Spt(u));let l=am.join(s,"extensions");c(Spt(l));for(let d of t){let m=Vn(d,i,{normalizeUnicodeSpaces:!0});if(Ob.existsSync(m)&&Ob.statSync(m).isDirectory()){let h=F3n(m);if(h){c(h);continue}c(Spt(m));continue}c([m])}return L3n(o,i,r)}var Ob,D3n,am,i1e,V8i,xpt,L8i,F8i,P3n,R3n,k3n,r1e,vse,Ipt,Cpt,Rpt=v(()=>{p();Ob=Ot(require("node:fs"),1),D3n=require("node:module"),am=Ot(require("node:path"),1),i1e=require("node:url");Qs();fc();RRe();IWn();_ut();_Q();jie();V8i={},xpt=(0,D3n.createRequire)(x),L8i="sea"in process.features&&process.features.sea===!0||process.getBuiltinModule("node:sea")?.isSea()===!0,F8i=!yD&&am.extname((0,i1e.fileURLToPath)(x))===".ts",P3n=yD||L8i||GRn;r1e=null;Ipt=0,Cpt=new Map});function Bpt(t){return t.split(ru.sep).join("/")}function z8i(t,e){let n=t.trim();if(!n||n.startsWith("#")&&!n.startsWith("\\#"))return null;let r=t,i=!1;r.startsWith("!")?(i=!0,r=r.slice(1)):r.startsWith("\\!")&&(r=r.slice(1)),r.startsWith("/")&&(r=r.slice(1));let s=e?`${e}${r}`:r;return i?`!${s}`:s}function K8i(t,e,n){let r=(0,ru.relative)(n,e),i=r?`${Bpt(r)}/`:"";for(let s of Y8i){let o=(0,ru.join)(e,s);if((0,kE.existsSync)(o))try{let c=(0,kE.readFileSync)(o,"utf-8").split(/\r?\n/).map(u=>z8i(u,i)).filter(u=>!!u);c.length>0&&t.add(c)}catch{}}}function J8i(t){let e=[];return t.length>Q3n&&e.push(`name exceeds ${Q3n} characters (${t.length})`),/^[a-z0-9-]+$/.test(t)||e.push("name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)"),(t.startsWith("-")||t.endsWith("-"))&&e.push("name must not start or end with a hyphen"),t.includes("--")&&e.push("name must not contain consecutive hyphens"),e}function X8i(t){let e=[];return typeof t!="string"||t.trim()===""?e.push("description is required"):t.length>U3n&&e.push(`description exceeds ${U3n} characters (${t.length})`),e}function Z8i(t,e,n){switch(n){case"user":return ih(t,{source:"local",scope:"user",baseDir:e});case"project":return ih(t,{source:"local",scope:"project",baseDir:e});case"path":return ih(t,{source:"local",baseDir:e});default:return ih(t,{source:n,baseDir:e})}}function $3n(t){let{dir:e,source:n}=t;return Rse(e,n,!0)}function Rse(t,e,n,r,i){let s=[],o=[];if(!(0,kE.existsSync)(t))return{skills:s,diagnostics:o};let a=i??t,c=r??(0,G3n.default)();K8i(c,t,a);try{let u=(0,kE.readdirSync)(t,{withFileTypes:!0});for(let l of u){if(l.name!=="SKILL.md")continue;let d=(0,ru.join)(t,l.name),m=l.isFile();if(l.isSymbolicLink())try{m=(0,kE.statSync)(d).isFile()}catch{continue}let h=Bpt((0,ru.relative)(a,d));if(!m||c.ignores(h))continue;let f=Npt(d,e);return f.skill&&s.push(f.skill),o.push(...f.diagnostics),{skills:s,diagnostics:o}}for(let l of u){if(l.name.startsWith(".")||l.name==="node_modules")continue;let d=(0,ru.join)(t,l.name),m=l.isDirectory(),h=l.isFile();if(l.isSymbolicLink())try{let y=(0,kE.statSync)(d);m=y.isDirectory(),h=y.isFile()}catch{continue}let f=Bpt((0,ru.relative)(a,d)),g=m?`${f}/`:f;if(c.ignores(g))continue;if(m){let y=Rse(d,e,!1,c,a);s.push(...y.skills),o.push(...y.diagnostics);continue}if(!h||!n||!l.name.endsWith(".md"))continue;let A=Npt(d,e);A.skill&&s.push(A.skill),o.push(...A.diagnostics)}}catch{}return{skills:s,diagnostics:o}}function Npt(t,e){let n=[],r=(0,ru.basename)(t)==="SKILL.md",i;try{i=(0,kE.readFileSync)(t,"utf-8")}catch(f){let g=f instanceof Error?f.message:"failed to read skill file";return n.push({type:"warning",message:g,path:t}),{skill:null,diagnostics:n}}let s;try{({frontmatter:s}=hQ(i))}catch(f){if(r){let g=f instanceof Error?f.message:"failed to parse skill file";n.push({type:"warning",message:g,path:t})}return{skill:null,diagnostics:n}}let o=s.description,a=typeof o=="string"&&o.trim()!=="";if(!r&&!a)return{skill:null,diagnostics:n};let c=(0,ru.dirname)(t),u=(0,ru.basename)(c),l=X8i(o);for(let f of l)n.push({type:"warning",message:f,path:t});let m=(typeof s.name=="string"?s.name:void 0)||u,h=J8i(m);for(let f of h)n.push({type:"warning",message:f,path:t});return a?{skill:{name:m,description:o,filePath:t,baseDir:c,sourceInfo:Z8i(t,c,e),disableModelInvocation:s["disable-model-invocation"]===!0},diagnostics:n}:{skill:null,diagnostics:n}}function o1e(t,e="read"){let n=t.filter(i=>!i.disableModelInvocation);if(n.length===0)return"";let r=[` -In addition to the tools above, you may have access to other custom tools depending on the project. +The following skills provide specialized instructions for specific tasks.`,e==="read"?"Use the read tool to load a skill's file when the task matches its description.":"Use bash to load a skill's file when the task matches its description.","When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.","",""];for(let i of n)r.push(" "),r.push(` ${kpt(i.name)}`),r.push(` ${kpt(i.description)}`),r.push(` ${kpt(i.filePath)}`),r.push(" ");return r.push(""),r.join(` +`)}function kpt(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function a1e(t){let{agentDir:e,skillPaths:n,includeDefaults:r}=t,i=Vn(t.cwd),s=Vn(e??ii()),o=new Map,a=new Set,c=[],u=[];function l(g){c.push(...g.diagnostics);for(let A of g.skills){let y=cd(A.filePath);if(a.has(y))continue;let E=o.get(A.name);E?u.push({type:"collision",message:`name "${A.name}" collision`,path:A.filePath,collision:{resourceType:"skill",name:A.name,winnerPath:E.filePath,loserPath:A.filePath}}):(o.set(A.name,A),a.add(y))}}r&&(l(Rse((0,ru.join)(s,"skills"),"user",!0)),l(Rse((0,ru.resolve)(i,Bi,"skills"),"project",!0)));let d=(0,ru.join)(s,"skills"),m=(0,ru.resolve)(i,Bi,"skills"),h=(g,A)=>{let y=(0,ru.resolve)(A);if(g===y)return!0;let E=y.endsWith(ru.sep)?y:`${y}${ru.sep}`;return g.startsWith(E)},f=g=>{if(!r){if(h(g,d))return"user";if(h(g,m))return"project"}return"path"};for(let g of n){let A=Vn(g,i,{trim:!0});if(!(0,kE.existsSync)(A)){c.push({type:"warning",message:"skill path does not exist",path:A});continue}try{let y=(0,kE.statSync)(A),E=f(A);if(y.isDirectory())l(Rse(A,E,!0));else if(y.isFile()&&A.endsWith(".md")){let _=Npt(A,E);_.skill?l({skills:[_.skill],diagnostics:_.diagnostics}):c.push(..._.diagnostics)}else c.push({type:"warning",message:"skill path is not a markdown file",path:A})}catch(y){let E=y instanceof Error?y.message:"failed to read skill path";c.push({type:"warning",message:E,path:A})}}return{skills:Array.from(o.values()),diagnostics:[...c,...u]}}var kE,G3n,ru,Q3n,U3n,Y8i,c1e=v(()=>{p();kE=require("fs"),G3n=Ot(yke(),1),ru=require("path");Qs();Tie();fc();_Q();Q3n=64,U3n=1024,Y8i=[".gitignore",".ignore",".fdignore"]});function nP(t){return{customPrompt:t.customPrompt,forceSystemPrompt:t.forceSystemPrompt,selectedTools:[...t.selectedTools??["read","bash","edit","write"]],toolSnippets:{...t.toolSnippets??{}},toolGuidelines:Object.fromEntries(Object.entries(t.toolGuidelines??{}).map(([e,n])=>[e,[...n]])),promptGuidelines:[...t.promptGuidelines??[]],appendSystemPrompt:t.appendSystemPrompt??"",sections:{...t.sections??{}},cwd:t.cwd,contextFiles:(t.contextFiles??[]).map(e=>({...e})),skills:(t.skills??[]).map(e=>({...e}))}}function tji(t){return["Project-specific instructions and guidelines:",...t.map(({path:e,content:n})=>` +${n} +`)].join(` -Guidelines: -${$} +`)}function nji(t,e,n){let r=[],i=new Set,s=d=>{let m=d.trim();!m||i.has(m)||(i.add(m),r.push(m))},o=t.includes("bash"),a=t.includes("powershell"),c=t.includes("grep"),u=t.includes("find"),l=t.includes("ls");(o||a)&&!c&&!u&&!l&&s(o&&a?"Use bash or PowerShell for file operations like listing, searching, and finding files":a?"Use PowerShell for file operations like listing, searching, and finding files":"Use bash for file operations like ls, rg, find");for(let d of t)for(let m of e[d]??[])s(m);for(let d of n)s(d);return s("Be concise in your responses"),s("Show file paths clearly when working with files"),r.map(d=>`- ${d}`).join(` +`)}function Dpt(t){let e=nP(t),{customPrompt:n,selectedTools:r,toolSnippets:i,toolGuidelines:s,promptGuidelines:o,appendSystemPrompt:a,sections:c,cwd:u,contextFiles:l,skills:d}=e;for(let g of Object.keys(c))if(!eji.test(g)||g==="preamble")throw new Error(`Invalid system prompt section name: ${g}`);let m={};if(n)m.preamble=n;else{m.preamble="You are an expert coding assistant operating inside pi, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.";let g=r.filter(y=>!!i[y]),A=g.length>0?g.map(y=>`- ${y}: ${i[y]}`).join(` +`):"(none)";m.tools=`${A} -Pi documentation (read only when the user asks about pi itself, its SDK, extensions, themes, skills, or TUI): -- Main documentation: ${g} -- Additional docs: ${A} -- Examples: ${y} (extensions, custom tools, SDK) +In addition to the tools above, you may have access to other custom tools depending on the project.`,m.rules=nji(r,s,o),m.docs=`Pi documentation (read only when the user asks about pi itself, its SDK, extensions, themes, skills, or TUI): +- Main documentation: ${D8()} +- Additional docs: ${IR()} +- Examples: ${Dwe()} (extensions, custom tools, SDK) - When reading pi docs or examples, resolve docs/... under Additional docs and examples/... under Examples, not the current working directory - When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), pi packages (docs/packages.md), environment variables (docs/environment-variables.md) - When working on pi topics, read the docs and examples, and follow .md cross-references before implementing -- Always read pi .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`;if(l&&(Q+=l),d.length>0){Q+=` - - - -`,Q+=`Project-specific instructions and guidelines: - -`;for(let{path:H,content:oe}of d)Q+=` -${oe} - - -`;Q+=` -`}return f&&h.length>0&&(Q+=aee(h,f)),Q+=` -Current working directory: ${u}`,Q}p();var v_n=require("node:fs"),R_n=require("node:fs/promises"),k_n=require("child_process");p();var rAs={type:"json_schema",strict:"prefer"};function cee(){return process.env.PI_EXPERIMENTAL==="1"}function oD(){return cee()?rAs:void 0}p();var E_n=require("node:crypto"),b_n=require("node:fs"),__n=require("node:os"),S_n=require("node:path");function sAs(t){let e=(0,E_n.randomBytes)(8).toString("hex");return(0,S_n.join)((0,__n.tmpdir)(),`${t}-${e}.log`)}function HZe(t){return Buffer.byteLength(t,"utf-8")}var xCe=class{maxLines;maxBytes;maxRollingBytes;tempFilePrefix;decoder=new TextDecoder;rawChunks=[];tailText="";tailBytes=0;tailStartsAtLineBoundary=!0;totalRawBytes=0;totalDecodedBytes=0;completedLines=0;totalLines=0;currentLineBytes=0;hasOpenLine=!1;finished=!1;tempFilePath;tempFileStream;constructor(e={}){this.maxLines=e.maxLines??2e3,this.maxBytes=e.maxBytes??51200,this.maxRollingBytes=Math.max(this.maxBytes*2,1),this.tempFilePrefix=e.tempFilePrefix??"pi-output"}append(e){if(this.finished)throw new Error("Cannot append to a finished output accumulator");this.totalRawBytes+=e.length,this.appendDecodedText(this.decoder.decode(e,{stream:!0})),this.tempFileStream||this.shouldUseTempFile()?(this.ensureTempFile(),this.tempFileStream?.write(e)):e.length>0&&this.rawChunks.push(e)}finish(){this.finished||(this.finished=!0,this.appendDecodedText(this.decoder.decode()),this.shouldUseTempFile()&&this.ensureTempFile())}snapshot(e={}){let n=XC(this.getSnapshotText(),{maxLines:this.maxLines,maxBytes:this.maxBytes}),r=this.totalLines>this.maxLines||this.totalDecodedBytes>this.maxBytes,s=r?n.truncatedBy??(this.totalDecodedBytes>this.maxBytes?"bytes":"lines"):null,i={...n,truncated:r,truncatedBy:s,totalLines:this.totalLines,totalBytes:this.totalDecodedBytes,maxLines:this.maxLines,maxBytes:this.maxBytes};return e.persistIfTruncated&&i.truncated&&this.ensureTempFile(),{content:i.content,truncation:i,fullOutputPath:this.tempFilePath}}async closeTempFile(){if(!this.tempFileStream)return;let e=this.tempFileStream;this.tempFileStream=void 0,await new Promise((n,r)=>{let s=o=>{e.off("finish",i),r(o)},i=()=>{e.off("error",s),n()};e.once("error",s),e.once("finish",i),e.end()})}getLastLineBytes(){return this.currentLineBytes}appendDecodedText(e){if(e.length===0)return;let n=HZe(e);this.totalDecodedBytes+=n,this.tailText+=e,this.tailBytes+=n,this.tailBytes>this.maxRollingBytes*2&&this.trimTail();let r=0,s=-1;for(let i=e.indexOf(` -`);i!==-1;i=e.indexOf(` -`,i+1))r++,s=i;if(r===0)this.currentLineBytes+=n,this.hasOpenLine=!0;else{this.completedLines+=r;let i=e.slice(s+1);this.currentLineBytes=HZe(i),this.hasOpenLine=i.length>0}this.totalLines=this.completedLines+(this.hasOpenLine?1:0)}trimTail(){let e=Buffer.from(this.tailText,"utf-8");if(e.length<=this.maxRollingBytes){this.tailBytes=e.length;return}let n=e.length-this.maxRollingBytes;for(;nthis.maxBytes||this.totalDecodedBytes>this.maxBytes||this.totalLines>this.maxLines}ensureTempFile(){if(!this.tempFilePath){this.tempFilePath=sAs(this.tempFilePrefix),this.tempFileStream=(0,b_n.createWriteStream)(this.tempFilePath);for(let e of this.rawChunks)this.tempFileStream.write(e);this.rawChunks=[]}}};p();p();function iAs(t,e){let n=process.platform==="darwin"&&t.toLowerCase()==="alt"?"option":t;return e.capitalize?n.charAt(0).toUpperCase()+n.slice(1):n}function mL(t,e={}){return t.split("/").map(n=>n.split("+").map(r=>iAs(r,e)).join("+")).join("/")}function C_n(t,e={}){return t.length===0?"":mL(t.join("/"),e)}function ra(t){return C_n(ms().getKeys(t))}function oc(t){return C_n(ms().getKeys(t),{capitalize:!0})}function er(t,e){return Se.fg("dim",ra(t))+Se.fg("muted",` ${e}`)}function ml(t,e){return Se.fg("dim",mL(t))+Se.fg("muted",` ${e}`)}p();function fL(t,e,n,r=0){if(!t)return{visualLines:[],skippedCount:0};let i=new yt(t,r,0).render(n);if(i.length<=e)return{visualLines:i,skippedCount:0};let o=i.slice(-e),a=i.length-e;return{visualLines:o,skippedCount:a}}p();var I_n=Gt(require("node:os"),1),x_n=require("node:url");function lee(t){if(typeof t!="string")return"";let e=I_n.homedir();return t.startsWith(e)?`~${t.slice(e.length)}`:t}function oAs(t,e,n){if(!qc().hyperlinks)return t;let r=jn(e,n);return jA(t,(0,x_n.pathToFileURL)(r).href)}function fl(t){return typeof t=="string"?t:t==null?"":null}function xT(t){return t.replace(/\t/g," ")}function uee(t){return t.replace(/\r/g,"")}function eb(t,e){if(!t)return"";let n=t.content.filter(o=>o.type==="text"),r=t.content.filter(o=>o.type==="image"),s=n.map(o=>M0e(r5(o.text||"")).replace(/\r/g,"")).join(` -`),i=qc();if(r.length>0&&(!i.images||!e)){let o=r.map(a=>{let c=a.mimeType??"image/unknown",u=a.data&&a.mimeType?cH(a.data,a.mimeType)??void 0:void 0;return RM(c,u)}).join(` -`);s=s?`${s} -${o}`:o}return s}function gL(t){return t.fg("error","[invalid arg]")}function aD(t,e,n,r){if(t===null)return gL(e);let s=t||r?.emptyFallback;return s?oAs(e.fg("accent",lee(s)),s,n):e.fg("toolOutput","...")}var aAs=5,w_n=100,VZe=class extends _n{state={cachedWidth:void 0,cachedLines:void 0,cachedSkipped:void 0}};function cAs(t){return`${(t/1e3).toFixed(1)}s`}function lAs(t,e){let n=fl(t?.command),r=t?.timeout,s=r?Se.fg("muted",` (timeout ${r}s)`):"",i=n===null?gL(Se):n||Se.fg("toolOutput","...");return Se.fg("toolTitle",Se.bold(`${e} ${i}`))+s}function uAs(t,e,n,r,s,i){let o=t.state;t.clear();let a=eb(e,r).trim(),c=e.details?.truncation,u=e.details?.fullOutputPath;if(!n.isPartial&&c?.truncated&&u&&a.endsWith("]")){let l=a.lastIndexOf(` +- Always read pi .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`}a&&(m.addendum=a),l.length>0&&(m.project_context=tji(l));let h=["read","bash"].find(g=>r.includes(g));if(h&&d.length>0){let g=o1e(d,h).trim();g&&(m.skills=g)}m.cwd=u.replace(/\\/g,"/");for(let[g,A]of Object.entries(c))A&&(m[g]=A);let f={preamble:m.preamble};for(let[g,A]of Object.entries(m))g!=="preamble"&&(f[g]=`<${g}> +${A} +`);return f}function rji(t){return t.forceSystemPrompt!==void 0?{content:t.forceSystemPrompt}:{content:"",sections:Dpt(t)}}function l1e(t){return kc({role:"system",...rji(t),timestamp:0})}function W3n(t,e){let n={};for(let[r,i]of Object.entries(e))t[r]!==i&&(n[r]=i);for(let r of Object.keys(t))e[r]===void 0&&(n[r]=null);return Object.keys(n).length>0?n:void 0}var eji,Ppt=v(()=>{p();qo();Qs();c1e();eji=/^[a-z][a-z0-9_-]*$/});function oji(t){if(typeof t!="object"||t===null)return!1;let e=t,n=e.operations!==void 0,r=e.result!==void 0;if(n===r)return!1;if(n){let o=e.operations;return typeof o!="object"||o===null?!1:typeof o.exec=="function"}let i=e.result;if(typeof i!="object"||i===null)return!1;let s=i;return typeof s.output=="string"&&"exitCode"in s&&(s.exitCode===void 0||typeof s.exitCode=="number")&&typeof s.cancelled=="boolean"&&typeof s.truncated=="boolean"&&(s.fullOutputPath===void 0||typeof s.fullOutputPath=="string")}async function kse(t,e){return t.hasHandlers("session_shutdown")?(await t.emit(e),!0):!1}function Cg(t,e){return t.map(n=>({ext:n,handlers:n.handlers.get(e)?.slice()??[]}))}function H3n(t,e){return t.length===e.length&&t.every((n,r)=>n===e[r])}function aji(t,e,n){if(H3n(n,e))return t;let r=kf(t);return r?[r,...n]:n}async function q3n(t,e,n){let r=[];for(let{ext:i,handlers:s}of Cg(t.extensions,"project_trust"))for(let o of s)try{let a=await o(e,n);if(a.trusted==="undecided")continue;return{result:a,errors:r}}catch(a){r.push({extensionPath:i.path,event:e.type,error:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0})}return{errors:r}}var iji,sji,Mpt,FQ,Bse=v(()=>{p();qo();pi();Ppt();iji=["app.interrupt","app.clear","app.exit","app.suspend","app.thinking.cycle","app.model.cycleForward","app.model.cycleBackward","app.model.select","app.tools.expand","app.thinking.toggle","app.editor.external","app.message.copy","app.message.followUp","tui.input.submit","tui.select.confirm","tui.select.cancel","tui.input.copy","tui.editor.deleteToLineEnd"],sji=t=>{let e={};for(let[n,r]of Object.entries(t)){if(r===void 0)continue;let i=Array.isArray(r)?r:[r],s=iji.includes(n);for(let o of i){let a=o.toLowerCase();e[a]?.restrictOverride&&!s||(e[a]={keybinding:n,restrictOverride:s})}}return e};Mpt={select:async()=>{},confirm:async()=>!1,input:async()=>{},notify:()=>{},onTerminalInput:()=>()=>{},setStatus:()=>{},setWorkingMessage:()=>{},setWorkingVisible:()=>{},setWorkingIndicator:()=>{},setHiddenThinkingLabel:()=>{},setWidget:()=>{},setFooter:()=>{},setHeader:()=>{},setTitle:()=>{},custom:async()=>{},pasteToEditor:()=>{},setEditorText:()=>{},getEditorText:()=>"",editor:async()=>{},addAutocompleteProvider:()=>{},setEditorComponent:()=>{},getEditorComponent:()=>{},get theme(){return Ee},getAllThemes:()=>[],getTheme:()=>{},setTheme:t=>({success:!1,error:"UI not available"}),getToolsExpanded:()=>!1,setToolsExpanded:()=>{}},FQ=class{extensions;runtime;uiContext;mode="print";cwd;sessionManager;modelRegistry;errorListeners=new Set;getModel=()=>{};getScopedModels=()=>[];isIdleFn=()=>!0;isProjectTrustedFn=()=>!0;getSignalFn=()=>{};waitForIdleFn=async()=>{};abortFn=()=>{};hasPendingMessagesFn=()=>!1;getContextUsageFn=()=>{};compactFn=()=>{};getSystemPromptFn=()=>"";getSystemPromptOptionsFn=()=>nP({cwd:this.cwd});newSessionHandler=async()=>({cancelled:!1});forkHandler=async()=>({cancelled:!1});navigateTreeHandler=async()=>({cancelled:!1});switchSessionHandler=async()=>({cancelled:!1});reloadHandler=async()=>{};shutdownHandler=()=>{};shortcutDiagnostics=[];commandDiagnostics=[];staleMessage;uiPromptDepth=0;activeUIPrompt;constructor(e,n,r,i,s){this.extensions=e,this.runtime=n,this.uiContext=Mpt,this.cwd=r,this.sessionManager=i,this.modelRegistry=s}bindCore(e,n,r){this.runtime.sendMessage=e.sendMessage,this.runtime.sendUserMessage=e.sendUserMessage,this.runtime.appendEntry=e.appendEntry,this.runtime.setSessionName=e.setSessionName,this.runtime.getSessionName=e.getSessionName,this.runtime.setLabel=e.setLabel,this.runtime.getActiveTools=e.getActiveTools,this.runtime.getAllTools=e.getAllTools,this.runtime.setActiveTools=e.setActiveTools,this.runtime.refreshTools=e.refreshTools,this.runtime.getCommands=e.getCommands,this.runtime.setModel=e.setModel,this.runtime.getThinkingLevel=e.getThinkingLevel,this.runtime.setThinkingLevel=e.setThinkingLevel,this.getModel=n.getModel,this.getScopedModels=n.getScopedModels,this.isIdleFn=n.isIdle,this.isProjectTrustedFn=n.isProjectTrusted,this.getSignalFn=n.getSignal,this.abortFn=n.abort,this.hasPendingMessagesFn=n.hasPendingMessages,this.shutdownHandler=n.shutdown,this.getContextUsageFn=n.getContextUsage,this.compactFn=n.compact,this.getSystemPromptFn=n.getSystemPrompt,this.getSystemPromptOptionsFn=n.getSystemPromptOptions??(()=>nP({cwd:this.cwd}));for(let{name:i,config:s,extensionPath:o}of this.runtime.pendingProviderRegistrations)try{r?.registerProvider?r.registerProvider(i,s):this.modelRegistry.registerProvider(i,s)}catch(a){this.emitError({extensionPath:o,event:"register_provider",error:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0})}this.runtime.pendingProviderRegistrations=[];for(let{provider:i,extensionPath:s}of this.runtime.pendingNativeProviderRegistrations)try{r?.registerNativeProvider?r.registerNativeProvider(i):this.modelRegistry.registerProvider(i)}catch(o){this.emitError({extensionPath:s,event:"register_provider",error:o instanceof Error?o.message:String(o),stack:o instanceof Error?o.stack:void 0})}this.runtime.pendingNativeProviderRegistrations=[],this.runtime.registerProvider=(i,s)=>{if(r?.registerProvider){r.registerProvider(i,s);return}this.modelRegistry.registerProvider(i,s)},this.runtime.registerNativeProvider=i=>{if(r?.registerNativeProvider){r.registerNativeProvider(i);return}this.modelRegistry.registerProvider(i)},this.runtime.unregisterProvider=i=>{if(r?.unregisterProvider){r.unregisterProvider(i);return}this.modelRegistry.unregisterProvider(i)}}bindCommandContext(e){if(e){this.waitForIdleFn=e.waitForIdle,this.newSessionHandler=e.newSession,this.forkHandler=e.fork,this.navigateTreeHandler=e.navigateTree,this.switchSessionHandler=e.switchSession,this.reloadHandler=e.reload;return}this.waitForIdleFn=async()=>{},this.newSessionHandler=async()=>({cancelled:!1}),this.forkHandler=async()=>({cancelled:!1}),this.navigateTreeHandler=async()=>({cancelled:!1}),this.switchSessionHandler=async()=>({cancelled:!1}),this.reloadHandler=async()=>{}}setUIContext(e,n="print"){this.uiContext=e?this.wrapUIPromptContext(e):Mpt,this.mode=n}wrapUIPromptContext(e){return{...e,select:(n,r,i)=>this.withUIPrompt("select",n,()=>e.select(n,r,i)),confirm:(n,r,i)=>this.withUIPrompt("confirm",n,()=>e.confirm(n,r,i)),input:(n,r,i)=>this.withUIPrompt("input",n,()=>e.input(n,r,i)),editor:(n,r)=>this.withUIPrompt("editor",n,()=>e.editor(n,r)),custom:(n,r)=>this.withUIPrompt("custom",void 0,()=>e.custom(n,r))}}withUIPrompt(e,n,r){this.uiPromptDepth++===0&&(this.activeUIPrompt={kind:e,title:n},this.emitUIPromptEvent({type:"ui_prompt_start",reason:"ui_prompt",kind:e,...n?{title:n}:{}}));let s=()=>{if(--this.uiPromptDepth>0)return;this.uiPromptDepth=0;let o=this.activeUIPrompt??{kind:e,title:n};this.activeUIPrompt=void 0,this.emitUIPromptEvent({type:"ui_prompt_end",reason:"ui_prompt",kind:o.kind,...o.title?{title:o.title}:{}})};try{return r().finally(s)}catch(o){throw s(),o}}emitUIPromptEvent(e){queueMicrotask(()=>{this.emit(e)})}getUIContext(){return this.uiContext}hasUI(){return this.uiContext!==Mpt}getExtensionPaths(){return this.extensions.map(e=>e.path)}getAllRegisteredTools(){let e=new Map;for(let n of this.extensions)for(let r of n.tools.values())e.has(r.definition.name)||e.set(r.definition.name,r);return Array.from(e.values())}getToolDefinition(e){for(let n of this.extensions){let r=n.tools.get(e);if(r)return r.definition}}getFlags(){let e=new Map;for(let n of this.extensions)for(let[r,i]of n.flags)e.has(r)||e.set(r,i);return e}setFlagValue(e,n){this.runtime.flagValues.set(e,n)}getFlagValues(){return new Map(this.runtime.flagValues)}getShortcuts(e){this.shortcutDiagnostics=[];let n=sji(e),r=new Map,i=(s,o)=>{this.shortcutDiagnostics.push({type:"warning",message:s,path:o}),this.hasUI()||console.warn(s)};for(let s of this.extensions)for(let[o,a]of s.shortcuts){let c=o.toLowerCase(),u=n[c];if(u?.restrictOverride===!0){i(`Extension shortcut '${o}' from ${a.extensionPath} conflicts with built-in shortcut. Skipping.`,a.extensionPath);continue}u?.restrictOverride===!1&&i(`Extension shortcut conflict: '${o}' is built-in shortcut for ${u.keybinding} and ${a.extensionPath}. Using ${a.extensionPath}.`,a.extensionPath);let l=r.get(c);l&&i(`Extension shortcut conflict: '${o}' registered by both ${l.extensionPath} and ${a.extensionPath}. Using ${a.extensionPath}.`,a.extensionPath),r.set(c,a)}return r}getShortcutDiagnostics(){return this.shortcutDiagnostics}invalidate(e="This extension ctx is stale after session replacement or reload. Do not use a captured pi or command ctx after ctx.newSession(), ctx.fork(), ctx.switchSession(), or ctx.reload(). For newSession, fork, and switchSession, move post-replacement work into withSession and use the ctx passed to withSession. For reload, do not use the old ctx after await ctx.reload()."){this.staleMessage||(this.staleMessage=e,this.runtime.invalidate(e))}assertActive(){if(this.staleMessage)throw new Error(this.staleMessage)}onError(e){return this.errorListeners.add(e),()=>this.errorListeners.delete(e)}emitError(e){for(let n of this.errorListeners)n(e)}hasHandlers(e){for(let n of this.extensions){let r=n.handlers.get(e);if(r&&r.length>0)return!0}return!1}getMessageRenderer(e){for(let n of this.extensions){let r=n.messageRenderers.get(e);if(r)return r}}getMarkdownTransformers(){return this.extensions.flatMap(e=>e.markdownTransformer?[e.markdownTransformer]:[])}getEntryRenderer(e){for(let n of this.extensions){let r=n.entryRenderers?.get(e);if(r)return r}}resolveRegisteredCommands(){let e=[],n=new Map;for(let s of this.extensions)for(let o of s.commands.values())e.push(o),n.set(o.name,(n.get(o.name)??0)+1);let r=new Map,i=new Set;return e.map(s=>{let o=(r.get(s.name)??0)+1;r.set(s.name,o);let a=(n.get(s.name)??0)>1?`${s.name}:${o}`:s.name;if(i.has(a)){let c=o;do c++,a=`${s.name}:${c}`;while(i.has(a))}return i.add(a),{...s,invocationName:a}})}getModelRegistry(){return this.modelRegistry}getRegisteredCommands(){return this.commandDiagnostics=[],this.resolveRegisteredCommands()}getCommandDiagnostics(){return this.commandDiagnostics}getCommand(e){return this.resolveRegisteredCommands().find(n=>n.invocationName===e)}shutdown(){this.shutdownHandler()}getActiveTools(){return this.assertActive(),this.runtime.getActiveTools()}createContext(){let e=this,n=this.getModel,r=this.getScopedModels;return{get ui(){return e.assertActive(),e.uiContext},get mode(){return e.assertActive(),e.mode},get hasUI(){return e.assertActive(),e.hasUI()},get cwd(){return e.assertActive(),e.cwd},get sessionManager(){return e.assertActive(),e.sessionManager},get modelRegistry(){return e.assertActive(),e.modelRegistry},get model(){return e.assertActive(),n()},get scopedModels(){return e.assertActive(),r()},get thinkingLevel(){return e.assertActive(),e.runtime.getThinkingLevel()},isIdle:()=>(e.assertActive(),e.isIdleFn()),isProjectTrusted:()=>(e.assertActive(),e.isProjectTrustedFn()),get signal(){return e.assertActive(),e.getSignalFn()},abort:()=>{e.assertActive(),e.abortFn()},hasPendingMessages:()=>(e.assertActive(),e.hasPendingMessagesFn()),shutdown:()=>{e.assertActive(),e.shutdownHandler()},getContextUsage:()=>(e.assertActive(),e.getContextUsageFn()),compact:i=>{e.assertActive(),e.compactFn(i)},getSystemPrompt:()=>(e.assertActive(),e.getSystemPromptFn())}}createCommandContext(){let e=Object.defineProperties({},Object.getOwnPropertyDescriptors(this.createContext()));return e.getSystemPromptOptions=()=>(this.assertActive(),this.getSystemPromptOptionsFn()),e.waitForIdle=()=>(this.assertActive(),this.waitForIdleFn()),e.newSession=n=>(this.assertActive(),this.newSessionHandler(n)),e.fork=(n,r)=>(this.assertActive(),this.forkHandler(n,r)),e.navigateTree=(n,r)=>(this.assertActive(),this.navigateTreeHandler(n,r)),e.switchSession=(n,r)=>(this.assertActive(),this.switchSessionHandler(n,r)),e.reload=()=>(this.assertActive(),this.reloadHandler()),e}async emitBoundary(e,n){let r=this.createContext(),i=[],s=!1,o=await n(i),a=!0;for(let{ext:c,handlers:u}of Cg(this.extensions,e.type))for(let l of u){let d={...e,entries:i,continue:s,context:o};try{let m=await l(d,r);m?.entries!==void 0&&(i=m.entries),m?.continue!==void 0&&(s=m.continue)}catch(m){this.emitError({extensionPath:c.path,event:e.type,error:m instanceof Error?m.message:String(m),stack:m instanceof Error?m.stack:void 0})}try{o=await n(i),a=!0}catch(m){a=!1,this.emitError({extensionPath:c.path,event:e.type,error:`Invalid boundary entries: ${m instanceof Error?m.message:String(m)}`,stack:m instanceof Error?m.stack:void 0})}}return a?{entries:i,continue:s,context:o,valid:!0}:{entries:[],continue:!1,context:o,valid:!1}}isSessionBeforeEvent(e){return e.type==="session_before_switch"||e.type==="session_before_fork"||e.type==="session_before_compact"||e.type==="session_before_tree"}async emit(e){let n=this.createContext(),r;for(let{ext:i,handlers:s}of Cg(this.extensions,e.type))for(let o of s)try{let a=await o(e,n);if(this.isSessionBeforeEvent(e)&&a&&(r=a,r.cancel))return r}catch(a){let c=a instanceof Error?a.message:String(a),u=a instanceof Error?a.stack:void 0;this.emitError({extensionPath:i.path,event:e.type,error:c,stack:u})}return r}async emitCacheWarmingDecision(e){let n=this.createContext(),r=e.action;for(let{ext:i,handlers:s}of Cg(this.extensions,e.type))for(let o of s)try{let a=await o(e,n);a?.action!==void 0&&(r=a.action)}catch(a){this.emitError({extensionPath:i.path,event:e.type,error:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0})}return r}async emitMessageEnd(e){let n=this.createContext(),r=e.message,i=!1;for(let{ext:s,handlers:o}of Cg(this.extensions,"message_end"))for(let a of o)try{let c={...e,message:r},u=await a(c,n);if(!u?.message)continue;if(u.message.role!==r.role){this.emitError({extensionPath:s.path,event:"message_end",error:"message_end handlers must return a message with the same role"});continue}r=u.message,i=!0}catch(c){let u=c instanceof Error?c.message:String(c),l=c instanceof Error?c.stack:void 0;this.emitError({extensionPath:s.path,event:"message_end",error:u,stack:l})}return i?r:void 0}async emitToolResult(e){let n=this.createContext(),r={...e},i=!1;for(let{ext:s,handlers:o}of Cg(this.extensions,"tool_result"))for(let a of o)try{let c=await a(r,n);if(!c)continue;c.content!==void 0&&(r.content=c.content,i=!0),c.details!==void 0&&(r.details=c.details,i=!0),c.isError!==void 0&&(r.isError=c.isError,i=!0),c.usage!==void 0&&(r.usage=c.usage,i=!0)}catch(c){let u=c instanceof Error?c.message:String(c),l=c instanceof Error?c.stack:void 0;this.emitError({extensionPath:s.path,event:"tool_result",error:u,stack:l})}if(i)return{content:r.content,details:r.details,isError:r.isError,usage:r.usage}}async emitToolCall(e){let n=this.createContext(),r;for(let{handlers:i}of Cg(this.extensions,"tool_call"))for(let s of i){let o=await s(e,n);if(o&&(r=o,r.block))return r}return r}async emitUserBash(e){let n=this.createContext();for(let{ext:r,handlers:i}of Cg(this.extensions,"user_bash"))for(let s of i)try{let o=await s(e,n);if(o===void 0)continue;if(!oji(o))throw new Error("Invalid user_bash handler result: return undefined for local execution or exactly one valid { operations } or { result } object");return o}catch(o){let a=o instanceof Error?o.message:String(o),c=o instanceof Error?o.stack:void 0;throw this.emitError({extensionPath:r.path,event:"user_bash",error:a,stack:c}),o}}async emitContext(e){let n=this.createContext(),r=structuredClone(e);for(let{ext:i,handlers:s}of Cg(this.extensions,"context"))for(let o of s)try{let a=r.filter(m=>m.role!=="system"),c=a.slice(),d=(await o({type:"context",messages:a},n))?.messages??(H3n(a,c)?void 0:a);if(!d)continue;r=aji(r,c,d)}catch(a){let c=a instanceof Error?a.message:String(a),u=a instanceof Error?a.stack:void 0;this.emitError({extensionPath:i.path,event:"context",error:c,stack:u})}for(let{ext:i,handlers:s}of Cg(this.extensions,"context_with_system"))for(let o of s)try{let a=r[0]?.role==="system";r=(await o({type:"context_with_system",messages:r},n))?.messages??r,a&&r[0]?.role!=="system"&&this.emitError({extensionPath:i.path,event:"context_with_system",error:"Handler removed the leading system message; the request has no prompt or initial tool declarations. Keep it at index 0 or replace a dropped prefix with getCurrentSystemMessage()."})}catch(a){let c=a instanceof Error?a.message:String(a),u=a instanceof Error?a.stack:void 0;this.emitError({extensionPath:i.path,event:"context_with_system",error:c,stack:u})}return r}async emitBeforeProviderRequest(e){let n=this.createContext(),r=e;for(let{ext:i,handlers:s}of Cg(this.extensions,"before_provider_request"))for(let o of s)try{let c=await o({type:"before_provider_request",payload:r},n);c!==void 0&&(r=c)}catch(a){let c=a instanceof Error?a.message:String(a),u=a instanceof Error?a.stack:void 0;this.emitError({extensionPath:i.path,event:"before_provider_request",error:c,stack:u})}return r}async emitBeforeProviderHeaders(e){let n=this.createContext();for(let{ext:r,handlers:i}of Cg(this.extensions,"before_provider_headers"))for(let s of i)try{await s({type:"before_provider_headers",headers:e},n)}catch(o){let a=o instanceof Error?o.message:String(o),c=o instanceof Error?o.stack:void 0;this.emitError({extensionPath:r.path,event:"before_provider_headers",error:a,stack:c})}return e}async emitBeforeAgentStart(e,n,r){let i=nP(r),s=()=>l1e(i),o=Object.defineProperties({},Object.getOwnPropertyDescriptors(this.createContext()));o.getSystemPrompt=()=>(this.assertActive(),s());let a=[];for(let{ext:c,handlers:u}of Cg(this.extensions,"before_agent_start"))for(let l of u)try{let m=await l({type:"before_agent_start",prompt:e,images:n,get systemPrompt(){return s()},systemPromptOptions:i},o);if(m){let h=m;h.message&&a.push(h.message),h.systemPrompt!==void 0&&(i.forceSystemPrompt=h.systemPrompt)}}catch(d){let m=d instanceof Error?d.message:String(d),h=d instanceof Error?d.stack:void 0;this.emitError({extensionPath:c.path,event:"before_agent_start",error:m,stack:h})}return{messages:a,systemPromptOptions:i}}async emitResourcesDiscover(e,n){let r=this.createContext(),i=[],s=[],o=[];for(let{ext:a,handlers:c}of Cg(this.extensions,"resources_discover"))for(let u of c)try{let m=await u({type:"resources_discover",cwd:e,reason:n},r);m?.skillPaths?.length&&i.push(...m.skillPaths.map(h=>({path:h,extensionPath:a.path}))),m?.promptPaths?.length&&s.push(...m.promptPaths.map(h=>({path:h,extensionPath:a.path}))),m?.themePaths?.length&&o.push(...m.themePaths.map(h=>({path:h,extensionPath:a.path})))}catch(l){let d=l instanceof Error?l.message:String(l),m=l instanceof Error?l.stack:void 0;this.emitError({extensionPath:a.path,event:"resources_discover",error:d,stack:m})}return{skillPaths:i,promptPaths:s,themePaths:o}}async emitInput(e,n,r,i){let s=this.createContext(),o=e,a=n;for(let{ext:c,handlers:u}of Cg(this.extensions,"input"))for(let l of u)try{let m=await l({type:"input",text:o,images:a,source:r,streamingBehavior:i},s);if(m?.action==="handled")return m;m?.action==="transform"&&(o=m.text,a=m.images??a)}catch(d){this.emitError({extensionPath:c.path,event:"input",error:d instanceof Error?d.message:String(d),stack:d instanceof Error?d.stack:void 0})}return o!==e||a!==n?{action:"transform",text:o,images:a}:{action:"continue"}}}});function ES(t){return t}function Opt(t){return t.toolName==="bash"}function Lpt(t){return t.toolName==="powershell"}function Fpt(t){return t.toolName==="read"}function Qpt(t){return t.toolName==="edit"}function Upt(t){return t.toolName==="write"}function Gpt(t){return t.toolName==="grep"}function $pt(t){return t.toolName==="find"}function Wpt(t){return t.toolName==="ls"}function Hpt(t,e){return e.toolName===t}var j3n=v(()=>{p()});function cm(t,e){return{name:t.name,label:t.label,description:t.description,parameters:t.parameters,constrainedSampling:t.constrainedSampling,prepareArguments:t.prepareArguments,executionMode:t.executionMode,execute:(n,r,i,s,o)=>t.execute(n,r,i,s,o??e?.())}}function V3n(t){return{name:t.name,label:t.label,description:t.description,parameters:t.parameters,constrainedSampling:t.constrainedSampling,prepareArguments:t.prepareArguments,executionMode:t.executionMode,execute:async(e,n,r,i)=>t.execute(e,n,r,i)}}var bS=v(()=>{p()});function u1e(t,e){return cm(t.definition,()=>e.createContext())}function kV(t,e){return t.map(n=>u1e(n,e))}var Y3n=v(()=>{p();bS()});var qpt=v(()=>{p();Rpt();Bse();j3n();Y3n()});function BV(t,e){if(!e)return;let n=t[t.length-1];if(n?.type==="literal"){n.value+=e;return}t.push({type:"literal",value:e})}function uji(t){let e=[],n=0;for(;nK3n(n,e)===void 0)}function Pse(t){return Nse(t).type==="command"}function Z3n(t,e){return X3n(t,e).length===0}function Vpt(t,e){let n=Nse(t);return n.type==="command"?mji(n.config):J3n(n.parts,e)}function pji(t){try{let{shell:e,args:n,commandTransport:r}=jj(),i=r==="stdin",s=(0,d1e.spawnSync)(e,i?n:[...n,t],{encoding:"utf-8",input:i?t:void 0,timeout:1e4,stdio:[i?"pipe":"ignore","pipe","ignore"],shell:!1,windowsHide:!0});return s.error?s.error.code==="ENOENT"?{executed:!1,value:void 0}:{executed:!0,value:void 0}:s.status!==0?{executed:!0,value:void 0}:{executed:!0,value:(s.stdout??"").trim()||void 0}}catch{return{executed:!1,value:void 0}}}function z3n(t){try{return(0,d1e.execSync)(t,{encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{return}}function e4n(t){let e=t.slice(1);return process.platform==="win32"?(()=>{let n=pji(e);return n.executed?n.value:z3n(e)})():z3n(e)}function mji(t){if(jpt.has(t))return jpt.get(t);let e=e4n(t);return jpt.set(t,e),e}function hji(t,e){let n=Nse(t);return n.type==="command"?e4n(n.config):J3n(n.parts,e)}function Ypt(t,e,n){let r=hji(t,n);if(r!==void 0)return r;let i=Nse(t);if(i.type==="command")throw new Error(`Failed to resolve ${e} from shell command: ${i.config.slice(1)}`);if(i.type==="template"){let s=X3n(t,n);if(s.length===1)throw new Error(`Failed to resolve ${e} from environment variable: ${s[0]}`);if(s.length>1)throw new Error(`Failed to resolve ${e} from environment variables: ${s.join(", ")}`)}throw new Error(`Failed to resolve ${e}`)}function Mse(t,e,n){if(!t)return;let r={};for(let[i,s]of Object.entries(t))r[i]=Ypt(s,`${e} header "${i}"`,n);return Object.keys(r).length>0?r:void 0}var d1e,jpt,cji,lji,zpt=v(()=>{p();d1e=require("child_process");pw();jpt=new Map,cji=/^[A-Za-z_][A-Za-z0-9_]*$/,lji=/^[A-Za-z_][A-Za-z0-9_]*/});function Xpt(t,e){if(!e)return t;let n={...t,...e},r=t,i=e,s=n;for(let o of["openRouterRouting","vercelGatewayRouting","chatTemplateKwargs","chatTemplateArgs"]){let a=r?.[o],c=i[o];(typeof a=="object"&&a!==null||typeof c=="object"&&c!==null)&&(s[o]={...a,...c})}return n}function fji(t,e){return e?{...t,...e,images:e.images?{...t?.images,...e.images,resize:e.images.resize?{...t?.images?.resize,...e.images.resize}:t?.images?.resize}:t?.images}:t}function gji(t,e){return{...t,name:e.name??t.name,reasoning:e.reasoning??t.reasoning,thinkingLevelMap:e.thinkingLevelMap?{...t.thinkingLevelMap,...e.thinkingLevelMap}:t.thinkingLevelMap,input:e.input??t.input,inputLimits:fji(t.inputLimits,e.inputLimits),cost:e.cost?{input:e.cost.input??t.cost.input,output:e.cost.output??t.cost.output,cacheRead:e.cost.cacheRead??t.cost.cacheRead,cacheWrite:e.cost.cacheWrite??t.cost.cacheWrite,tiers:e.cost.tiers??t.cost.tiers}:t.cost,promptCache:e.promptCache?{...t.promptCache,...e.promptCache}:t.promptCache,contextWindow:e.contextWindow??t.contextWindow,maxTokens:e.maxTokens??t.maxTokens,samplingParams:e.samplingParams?{...t.samplingParams,...e.samplingParams}:t.samplingParams,compat:Xpt(t.compat,e.compat)}}function Aji(t,e,n,r){let i=e.api??n.api??r?.api;if(!i)throw new Error(`Provider ${t}, model ${e.id}: no "api" specified. Set at provider or model level.`);let s=e.baseUrl??n.baseUrl??r?.baseUrl;if(!s)throw new Error(`Provider ${t}: "baseUrl" is required when defining custom models.`);if(e.contextWindow!==void 0&&e.contextWindow<=0)throw new Error(`Provider ${t}, model ${e.id}: invalid contextWindow`);if(e.maxTokens!==void 0&&e.maxTokens<=0)throw new Error(`Provider ${t}, model ${e.id}: invalid maxTokens`);return{id:e.id,name:e.name??e.id,api:i,provider:t,baseUrl:s,reasoning:e.reasoning??!1,thinkingLevelMap:e.thinkingLevelMap,input:e.input??["text"],inputLimits:e.inputLimits,cost:e.cost??{input:0,output:0,cacheRead:0,cacheWrite:0},promptCache:e.promptCache,contextWindow:e.contextWindow??128e3,maxTokens:e.maxTokens??16384,samplingParams:e.samplingParams,headers:void 0,compat:Xpt(n.compat,e.compat)}}function n4n(t,e,n){return t.find(r=>r.id===e)??(n?t.find(r=>r.api===n):void 0)??t.find(r=>r.api==="openai-completions")??t[0]}function Kpt(t,e,n){if(!n)return[...e];if(n.oauth&&!n.baseUrl)throw new Error(`Provider ${t}: "baseUrl" is required when "oauth" is set.`);let r=n.modelOverrides&&Object.keys(n.modelOverrides).length>0;if(!n.models?.length&&!n.baseUrl&&!n.headers&&!n.compat&&!r&&!n.apiKey&&!n.oauth&&n.authHeader===void 0)throw new Error(`Provider ${t}: must specify "baseUrl", "headers", "compat", "modelOverrides", or "models".`);let i=e.map(s=>({...s,baseUrl:n.oauth==="radius"?s.baseUrl:n.baseUrl??s.baseUrl,compat:Xpt(s.compat,n.compat)}));for(let s of n.models??[]){let o=i.findIndex(u=>u.id===s.id),a=n4n(i,s.id,s.api??n.api),c=Aji(t,s,n,a);o>=0?i[o]=c:i.push(c)}return i}function Jpt(t,e,n){return n?n.models?n.models.map(r=>{let i=n4n(e,r.id,r.api??n.api),s=r.api??n.api??i?.api;if(!s)throw new Error(`Provider ${t}, model ${r.id}: no "api" specified. Set at provider or model level.`);let o=r.baseUrl??n.baseUrl??i?.baseUrl;if(!o)throw new Error(`Provider ${t}: "baseUrl" is required when defining custom models.`);return{...r,api:s,provider:t,baseUrl:o,headers:void 0}}):n.baseUrl?e.map(r=>({...r,baseUrl:n.baseUrl})):[...e]:[...e]}function yji(t){return{name:t.name,isSubscription:t.isSubscription,login:async e=>({...await t.login({onAuth:r=>e.notify({type:"auth_url",...r}),onDeviceCode:r=>e.notify({type:"device_code",...r}),onPrompt:r=>e.prompt({type:"text",...r}),onProgress:r=>e.notify({type:"progress",message:r}),onManualCodeInput:()=>e.prompt({type:"manual_code",message:"Paste the authorization code"}),onSelect:r=>e.prompt({type:"select",...r}),signal:e.signal}),type:"oauth"}),refresh:async(e,n)=>({...await t.refreshToken(e,n),type:"oauth"}),toAuth:async e=>({apiKey:t.getApiKey(e)})}}function r4n(t,e,n){let r=t.headers||e?{...t.headers,...e}:void 0;if(n){if(!t.apiKey)throw new Error("authHeader requires a resolved API key");r={...r,Authorization:`Bearer ${t.apiKey}`}}return{...t,headers:r}}function i4n(t,e){return e?.apiKey??t?.apiKey}function Zpt(t,e){if(!(!t?.headers&&!e?.headers))return{...t?.headers,...e?.headers}}async function t4n(t,e,n){let r={...n};for(let i of new Set(t.flatMap(Dse))){if(r[i]!==void 0)continue;let s=await e.env(i);s!==void 0&&(r[i]=s)}return Object.keys(r).length>0?r:void 0}function Eji(t,e,n,r){let i=e?.auth.apiKey,s=i4n(n,r),o=r?.oauth??e?.auth.oauth;if(!i&&s===void 0&&o)return;let a=Zpt(n,r),c=r?.authHeader??n?.authHeader??!1;return{name:i?.name??"API key",login:i?.login??(async u=>({type:"api_key",key:await u.prompt({type:"secret",message:"Enter API key"})})),check:async u=>{if(u.credential){if(i?.check)return i.check(u);if(u.credential.key)return{type:"api_key",source:"stored credential"};let d=await i?.resolve(u);return d?{type:"api_key",source:d.source}:void 0}if(s!==void 0){if(Pse(s))return{type:"api_key",source:"configured API key"};let d=Dse(s);for(let m of d)if(await u.ctx.env(m)===void 0)return;return{type:"api_key",source:"configured API key"}}if(i?.check)return i.check(u);let l=await i?.resolve(u);return l?{type:"api_key",source:l.source}:void 0},resolve:async u=>{let l;if(u.credential)l=i?await i.resolve(u):u.credential.key?{auth:{apiKey:u.credential.key},env:u.credential.env,source:"stored credential"}:void 0;else if(s!==void 0){let f=await t4n([s],u.ctx),g=Ypt(s,`API key for provider "${t}"`,f);l=i?await i.resolve({...u,credential:{type:"api_key",key:g}}):{auth:{apiKey:g},source:"configured API key"}}else l=await i?.resolve(u);if(!l)return;let d={...u.credential?.env??{},...l.env??{}},m=await t4n(Object.values(a??{}),u.ctx,d),h=Mse(a,`provider "${t}"`,m);return{...l,auth:r4n(l.auth,h,c)}}}}function bji(t,e,n,r){let i=r?.oauth?yji(r.oauth):e?.auth.oauth;if(!i)return;let s=Zpt(n,r),o=r?.authHeader??n?.authHeader??!1;return{...i,toAuth:async a=>{let c=await i.toAuth(a),u=a.env,l=Mse(s,`provider "${t}"`,typeof u=="object"&&u!==null?u:void 0);return r4n(c,l,o)}}}function s4n(t,e,n){let r=e?.models?.find(o=>o.id===t.id),i=n?.models?.find(o=>o.id===t.id),s={...e?.modelOverrides?.[t.id]?.headers,...r?.headers,...i?.headers};return Object.keys(s).length>0?s:void 0}function o4n(t,e,n,r){if(r.streamSimple&&!r.api)throw new Error(`Provider ${t}: "api" is required when registering streamSimple.`);Jpt(t,Kpt(t,e?.getModels()??[],n),r)}function a4n(t,e,n,r){let i=n.getProvider(t),s,o,a=()=>r&&o?{...r,models:o}:r,c=()=>{let A=Jpt(t,Kpt(t,e?.getModels()??[],i),a());return s&&r?.oauth?.modifyModels&&(A=r.oauth.modifyModels(A,s)),A.map(y=>{let E=i?.modelOverrides?.[y.id];return E?gji(y,E):y})};c();let u=Eji(t,e,i,r),l=bji(t,e,i,r);if(!u&&!l)throw new Error(`Provider ${t}: no authentication method configured.`);let d=A=>e?.getModels().some(y=>y.api===A.api)??!1,m=(A,y,E,_)=>Th(A,async()=>{if(r?.streamSimple&&A.api===r.api)return r.streamSimple(A,y,E);if(e&&d(A))return _?e.streamSimple(A,y,E):e.stream(A,y,E);let S=CF(A.api);if(!S)throw new Error(`No API provider registered for api: ${A.api}`);return _?S.streamSimple(A,y,E):S.stream(A,y,E)}),h={id:t,name:r?.name??i?.name??e?.name??r?.oauth?.name??t,baseUrl:r?.baseUrl??i?.baseUrl??e?.baseUrl,headers:e?.headers,auth:{...u?{apiKey:u}:{},...l?{oauth:l}:{}},getModels:c,refreshModels:e?.refreshModels||r?.refreshModels||r?.oauth?.modifyModels?async A=>{await e?.refreshModels?.(A);let y;if(r?.refreshModels&&(y=await r.refreshModels(A)),A.signal.aborted)return;let E=A.credential?.type==="oauth"?A.credential:void 0;await A.publish({update:()=>{y&&(Jpt(t,Kpt(t,e?.getModels()??[],i),{...r,models:y}),o=y),s=E}})}:void 0,filterModels:e?.filterModels?(A,y)=>e.filterModels(A,y):void 0,stream:(A,y,E)=>m(A,y,E,!1),streamSimple:(A,y,E)=>m(A,y,E,!0)},f=e?.fetchDeferred;f&&(h.fetchDeferred=(A,y,E)=>f(A,y,E));let g=e?.cancelDeferred;return g&&(h.cancelDeferred=(A,y,E)=>g(A,y,E)),h}function c4n(t,e,n,r){return Mse(s4n(t,e,n),`model "${t.provider}/${t.id}"`,r)}function l4n(t,e,n){let r=Mse({...Zpt(e,n),...s4n(t,e,n)},`model "${t.provider}/${t.id}"`);return{headers:t.headers||r?{...t.headers,...r}:void 0,authHeader:n?.authHeader??e?.authHeader??!1}}function emt(t,e){let n=i4n(t,e);if(n===void 0)return;if(Pse(n))return{configured:!0,source:"models_json_command"};let r=Dse(n);return r.length>0?Z3n(n)?{configured:!0,source:"environment",label:r.join(", ")}:{configured:!1}:{configured:!0,source:e?.apiKey!==void 0?"fallback":"models_json_key"}}var tmt=v(()=>{p();qo();cR();zpt()});var NV,nmt=v(()=>{p();tmt();NV=class{runtime;constructor(e){this.runtime=e}refresh(e){return this.runtime.refresh(e)}getError(){return this.runtime.getError()}getAll(){return[...this.runtime.getModels()]}getAvailable(){return[...this.runtime.getAvailableSnapshot()]}find(e,n){return this.runtime.getModel(e,n)}hasConfiguredAuth(e){return this.runtime.hasConfiguredAuth(e.provider)}async getApiKeyAndHeaders(e){try{let n=await this.runtime.getAuth(e);if(!n){let r=this.runtime.getCompatibilityRequestConfig(e);return r.authHeader?{ok:!1,error:`No API key found for "${e.provider}"`}:{ok:!0,headers:r.headers}}return{ok:!0,apiKey:n.auth.apiKey,headers:n.auth.headers,...n.auth.baseUrl?{baseUrl:n.auth.baseUrl}:{},env:n.env}}catch(n){let r=n instanceof Error?n.cause:void 0,i=r instanceof Error?r.message:n instanceof Error?n.message:String(n);return{ok:!1,error:i==="authHeader requires a resolved API key"?`No API key found for "${e.provider}"`:i}}}getProviderAuthStatus(e){return this.runtime.getProviderAuthStatus(e)}getProvider(e){return this.runtime.getProvider(e)}stream(e,n,r){return this.runtime.stream(e,n,r)}streamSimple(e,n,r){return this.runtime.streamSimple(e,n,r)}complete(e,n,r){return this.runtime.complete(e,n,r)}getProviderDisplayName(e){return this.runtime.getProvider(e)?.name??e}getProviderAuth(e){return this.runtime.getAuth(e)}async getApiKeyForProvider(e){try{return(await this.runtime.getAuth(e))?.auth.apiKey}catch{return}}isUsingOAuth(e){return this.runtime.isUsingOAuth(e.provider)}registerProvider(e,n){if(typeof e=="string"){if(!n)throw new Error("Provider config is required when registering by name");this.runtime.registerProvider(e,n);return}this.runtime.registerNativeProvider(e)}unregisterProvider(e){this.runtime.unregisterProvider(e)}getRegisteredProviderConfig(e){return this.runtime.getRegisteredProviderConfig(e)}getRegisteredNativeProvider(e){return this.runtime.getRegisteredNativeProvider(e)}getRegisteredProviderIds(){return this.runtime.getRegisteredProviderIds()}}});function _ji(t){let e=[],n="",r=null;for(let i=0;i{if(i){let l=i==="@"||i==="ARGUMENTS"?n:e[parseInt(i,10)-1];return l||s}if(o){let l=parseInt(o,10)-1;if(l<0&&(l=0),a){let d=parseInt(a,10);return e.slice(l,l+d).join(" ")}return e.slice(l).join(" ")}if(c==="ARGUMENTS"||c==="@")return n;let u=parseInt(c,10)-1;return e[u]??""})}function u4n(t,e){let n=[],r;try{r=(0,_S.readFileSync)(t,"utf-8")}catch(u){let l=u instanceof Error?u.message:"failed to read prompt template file";return n.push({type:"warning",message:l,path:t}),{template:null,diagnostics:n}}let i,s;try{({frontmatter:i,body:s}=hQ(r))}catch(u){let l=u instanceof Error?u.message:"failed to parse prompt template file";return n.push({type:"warning",message:l,path:t}),{template:null,diagnostics:n}}let o=(0,BE.basename)(t).replace(/\.md$/,""),a=typeof i.description=="string"?i.description:"";if(!a){let u=s.split(` +`).find(l=>l.trim());u&&(a=u.slice(0,60),u.length>60&&(a+="..."))}let c=typeof i["argument-hint"]=="string"?i["argument-hint"]:void 0;return{template:{name:o,description:a,...c&&{argumentHint:c},content:s,sourceInfo:e,filePath:t},diagnostics:n}}function rmt(t,e){let n=[],r=[];if(!(0,_S.existsSync)(t))return{templates:n,diagnostics:r};try{let i=(0,_S.readdirSync)(t,{withFileTypes:!0});for(let s of i){let o=(0,BE.join)(t,s.name),a=s.isFile();if(s.isSymbolicLink())try{a=(0,_S.statSync)(o).isFile()}catch{continue}if(a&&s.name.endsWith(".md")){let c=u4n(o,e(o));c.template&&n.push(c.template),r.push(...c.diagnostics)}}}catch{return{templates:n,diagnostics:r}}return{templates:n,diagnostics:r}}function d4n(t){let e=Vn(t.cwd),n=Vn(t.agentDir),r=t.promptPaths,i=t.includeDefaults,s=[],o=[],a=m=>{s.push(...m.templates),o.push(...m.diagnostics)},c=(0,BE.join)(n,"prompts"),u=(0,BE.resolve)(e,Bi,"prompts"),l=(m,h)=>{let f=(0,BE.resolve)(h);if(m===f)return!0;let g=f.endsWith(BE.sep)?f:`${f}${BE.sep}`;return m.startsWith(g)},d=m=>l(m,c)?ih(m,{source:"local",scope:"user",baseDir:c}):l(m,u)?ih(m,{source:"local",scope:"project",baseDir:u}):ih(m,{source:"local",baseDir:(0,_S.statSync)(m).isDirectory()?m:(0,BE.dirname)(m)});i&&(a(rmt(c,d)),a(rmt(u,d)));for(let m of r){let h=Vn(m,e,{trim:!0});if((0,_S.existsSync)(h))try{let f=(0,_S.statSync)(h);if(f.isDirectory())a(rmt(h,d));else if(f.isFile()&&h.endsWith(".md")){let g=u4n(h,d(h));g.template&&s.push(g.template),o.push(...g.diagnostics)}}catch(f){let g=f instanceof Error?f.message:"failed to read prompt template path";o.push({type:"warning",message:g,path:h})}}return{templates:s,diagnostics:o}}function imt(t,e){if(!t.startsWith("/"))return t;let n=t.match(/^\/([^\s]+)(?:\s+([\s\S]*))?$/);if(!n)return t;let r=n[1],i=n[2]??"",s=e.find(o=>o.name===r);if(s){let o=_ji(i);return xji(s.content,o)}return t}var _S,BE,smt=v(()=>{p();_S=require("fs"),BE=require("path");Qs();Tie();fc();_Q()});function omt(t,e){let n=new Date().toISOString(),i=[{type:"session",version:HD,id:t.getSessionId(),timestamp:n,cwd:t.getCwd()}],s=null;for(let o of t.getBranch())i.push({...o,parentId:s}),s=o.id;return i.push(...e?.(s,n)??[]),`${i.map(o=>JSON.stringify(o)).join(` +`)} +`}function p1e(t,e,n){let r=Vn(e??`session-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,process.cwd()),i=(0,p4n.dirname)(r);return(0,DV.existsSync)(i)||(0,DV.mkdirSync)(i,{recursive:!0}),(0,DV.writeFileSync)(r,omt(t,n)),r}var DV,p4n,m1e=v(()=>{p();DV=require("node:fs"),p4n=require("node:path");fc();fw()});function Sji(t){let e=(0,m4n.randomBytes)(8).toString("hex");return(0,g4n.join)((0,f4n.tmpdir)(),`${t}-${e}.log`)}function amt(t){return Buffer.byteLength(t,"utf-8")}var m4n,h4n,f4n,g4n,h1e,A4n=v(()=>{p();m4n=require("node:crypto"),h4n=require("node:fs"),f4n=require("node:os"),g4n=require("node:path");Eg();h1e=class{maxLines;maxBytes;maxRollingBytes;tempFilePrefix;decoder=new TextDecoder;rawChunks=[];tailText="";tailBytes=0;tailStartsAtLineBoundary=!0;totalRawBytes=0;totalDecodedBytes=0;completedLines=0;totalLines=0;currentLineBytes=0;hasOpenLine=!1;finished=!1;tempFilePath;tempFileStream;constructor(e={}){this.maxLines=e.maxLines??2e3,this.maxBytes=e.maxBytes??51200,this.maxRollingBytes=Math.max(this.maxBytes*2,1),this.tempFilePrefix=e.tempFilePrefix??"pi-output"}append(e){if(this.finished)throw new Error("Cannot append to a finished output accumulator");this.totalRawBytes+=e.length,this.appendDecodedText(this.decoder.decode(e,{stream:!0})),this.tempFileStream||this.shouldUseTempFile()?(this.ensureTempFile(),this.tempFileStream?.write(e)):e.length>0&&this.rawChunks.push(e)}finish(){this.finished||(this.finished=!0,this.appendDecodedText(this.decoder.decode()),this.shouldUseTempFile()&&this.ensureTempFile())}snapshot(e={}){let n=mw(this.getSnapshotText(),{maxLines:this.maxLines,maxBytes:this.maxBytes}),r=this.totalLines>this.maxLines||this.totalDecodedBytes>this.maxBytes,i=r?n.truncatedBy??(this.totalDecodedBytes>this.maxBytes?"bytes":"lines"):null,s={...n,truncated:r,truncatedBy:i,totalLines:this.totalLines,totalBytes:this.totalDecodedBytes,maxLines:this.maxLines,maxBytes:this.maxBytes};return e.persistIfTruncated&&s.truncated&&this.ensureTempFile(),{content:s.content,truncation:s,fullOutputPath:this.tempFilePath}}async closeTempFile(){if(!this.tempFileStream)return;let e=this.tempFileStream;this.tempFileStream=void 0,await new Promise((n,r)=>{let i=o=>{e.off("finish",s),r(o)},s=()=>{e.off("error",i),n()};e.once("error",i),e.once("finish",s),e.end()})}getLastLineBytes(){return this.currentLineBytes}appendDecodedText(e){if(e.length===0)return;let n=amt(e);this.totalDecodedBytes+=n,this.tailText+=e,this.tailBytes+=n,this.tailBytes>this.maxRollingBytes*2&&this.trimTail();let r=0,i=-1;for(let s=e.indexOf(` +`);s!==-1;s=e.indexOf(` +`,s+1))r++,i=s;if(r===0)this.currentLineBytes+=n,this.hasOpenLine=!0;else{this.completedLines+=r;let s=e.slice(i+1);this.currentLineBytes=amt(s),this.hasOpenLine=s.length>0}this.totalLines=this.completedLines+(this.hasOpenLine?1:0)}trimTail(){let e=Buffer.from(this.tailText,"utf-8");if(e.length<=this.maxRollingBytes){this.tailBytes=e.length;return}let n=e.length-this.maxRollingBytes;for(;nthis.maxBytes||this.totalDecodedBytes>this.maxBytes||this.totalLines>this.maxLines}ensureTempFile(){if(!this.tempFilePath){this.tempFilePath=Sji(this.tempFilePrefix),this.tempFileStream=(0,h4n.createWriteStream)(this.tempFilePath);for(let e of this.rawChunks)this.tempFileStream.write(e);this.rawChunks=[]}}}});function Cji(t,e){let n=process.platform==="darwin"&&t.toLowerCase()==="alt"?"option":t;return e.capitalize?n.charAt(0).toUpperCase()+n.slice(1):n}function QQ(t,e={}){return t.split("/").map(n=>n.split("+").map(r=>Cji(r,e)).join("+")).join("/")}function y4n(t,e={}){return t.length===0?"":QQ(t.join("/"),e)}function Ca(t){return y4n(Ai().getKeys(t))}function qc(t){return y4n(Ai().getKeys(t),{capitalize:!0})}function nr(t,e){return Ee.fg("dim",Ca(t))+Ee.fg("muted",` ${e}`)}function iu(t,e){return Ee.fg("dim",QQ(t))+Ee.fg("muted",` ${e}`)}var ha=v(()=>{p();Tr();pi()});function UQ(t,e,n,r=0){if(!t)return{visualLines:[],skippedCount:0};let s=new Et(t,r,0).render(n);if(s.length<=e)return{visualLines:s,skippedCount:0};let o=s.slice(-e),a=s.length-e;return{visualLines:o,skippedCount:a}}var f1e=v(()=>{p();Tr()});function Ose(t){if(typeof t!="string")return"";let e=E4n.homedir();return t.startsWith(e)?`~${t.slice(e.length)}`:t}function Iji(t,e,n){if(!Dl().hyperlinks)return t;let r=Vn(e,n);return gE(t,(0,b4n.pathToFileURL)(r).href)}function su(t){return typeof t=="string"?t:t==null?"":null}function sk(t){return t.replace(/\t/g," ")}function Lse(t){return t.replace(/\r/g,"")}function Lb(t,e){if(!t)return"";let n=t.content.filter(o=>o.type==="text"),r=t.content.filter(o=>o.type==="image"),i=n.map(o=>lRe(qj(o.text||"")).replace(/\r/g,"")).join(` +`),s=Dl();if(r.length>0&&(!s.images||!e)){let o=r.map(a=>{let c=a.mimeType??"image/unknown",u=a.data&&a.mimeType?ej(a.data,a.mimeType)??void 0:void 0;return qF(c,u)}).join(` +`);i=i?`${i} +${o}`:o}return i}function GQ(t){return t.fg("error","[invalid arg]")}function rP(t,e,n,r){if(t===null)return GQ(e);let i=t||r?.emptyFallback;return i?Iji(e.fg("accent",Ose(i)),i,n):e.fg("toolOutput","...")}var E4n,b4n,ok=v(()=>{p();E4n=Ot(require("node:os"),1),b4n=require("node:url");Tr();sRe();fc();pw()});function Tji(t){let e=t/1e3;if(e<60)return`${e.toFixed(1)}s`;let n=Math.floor(e),r=Math.floor(n/60),i=n%60;return r<60?`${r}m ${i}s`:`${Math.floor(r/60)}h ${r%60}m ${i}s`}function vji(t,e){let n=su(t?.command),r=t?.timeout,i=r?Ee.fg("muted",` (timeout ${r}s)`):"",s=n===null?GQ(Ee):n||Ee.fg("toolOutput","...");return Ee.fg("toolTitle",Ee.bold(`${e} ${s}`))+i}function Rji(t,e,n,r,i,s){let o=t.state;t.clear();let a=Lb(e,r).trim(),c=e.details?.truncation,u=e.details?.fullOutputPath;if(!n.isPartial&&c?.truncated&&u&&a.endsWith("]")){let l=a.lastIndexOf(` [`);l!==-1&&a.slice(l).includes(u)&&(a=a.slice(0,l).trimEnd())}if(a){let l=a.split(` -`).map(d=>Se.fg("toolOutput",d)).join(` -`);n.expanded?t.addChild(new yt(` -${l}`,0,0)):t.addChild({render:d=>{if(o.cachedLines===void 0||o.cachedWidth!==d){let h=fL(l,aAs,d);o.cachedLines=h.visualLines,o.cachedSkipped=h.skippedCount,o.cachedWidth=d}if(o.cachedSkipped&&o.cachedSkipped>0){let h=Se.fg("muted",`... (${o.cachedSkipped} earlier lines,`)+` ${er("app.tools.expand","to expand")}${Se.fg("muted",")")}`;return["",pr(h,d,"..."),...o.cachedLines??[]]}return["",...o.cachedLines??[]]},invalidate:()=>{o.cachedWidth=void 0,o.cachedLines=void 0,o.cachedSkipped=void 0}})}if(c?.truncated||u){let l=[];u&&l.push(`Full output: ${u}`),c?.truncated&&(c.truncatedBy==="lines"?l.push(`Truncated: showing ${c.outputLines} of ${c.totalLines} lines`):l.push(`Truncated: ${c.outputLines} lines shown (${ma(c.maxBytes??51200)} limit)`)),t.addChild(new yt(` -${Se.fg("warning",`[${l.join(". ")}]`)}`,0,0))}if(s!==void 0){let l=n.isPartial?"Elapsed":"Took",d=i??Date.now();t.addChild(new yt(` -${Se.fg("muted",`${l} ${cAs(d-s)}`)}`,0,0))}}function dee(t){return{renderCall(e,n,r){let s=r.state;r.executionStarted&&s.startedAt===void 0&&(s.startedAt=Date.now(),s.endedAt=void 0);let i=r.lastComponent??new yt("",0,0);return i.setText(lAs(e,t)),i},renderResult(e,n,r,s){let i=s.state;i.startedAt!==void 0&&n.isPartial&&!i.interval&&(i.interval=setInterval(()=>s.invalidate(),1e3)),(!n.isPartial||s.isError)&&(i.endedAt??=Date.now(),i.interval&&(clearInterval(i.interval),i.interval=void 0));let o=s.lastComponent??new VZe;return uAs(o,e,n,s.showImages,i.startedAt,i.endedAt),o.invalidate(),o}}}var N_n=2147483647,dAs=N_n/1e3;function pAs(t){if(t===void 0)return;if(!Number.isFinite(t)||t<=0)throw new Error("Invalid timeout: must be a finite number of seconds");let e=t*1e3;if(e>N_n)throw new Error(`Invalid timeout: maximum is ${dAs} seconds`);return e}var hAs=Oe.Object({command:Oe.String({description:"Shell command to execute"}),timeout:Oe.Optional(Oe.Number({description:"Timeout in seconds (optional, no default timeout)"}))}),T_n={snippet:"Execute bash commands (ls, grep, find, etc.)",guidelines:["You can inspect PI_* environment variables for current model and session details."]};function jZe(t,e){return{exec:async(n,r,{onData:s,signal:i,timeout:o,env:a})=>{let c=pAs(o);if(i?.aborted)throw new Error("aborted");let u=e();try{await(0,R_n.access)(r,v_n.constants.F_OK)}catch{throw new Error(`Working directory does not exist: ${r} -Cannot execute ${t} commands.`)}let l=u.commandTransport==="stdin",d=(0,k_n.spawn)(u.shell,l?u.args:[...u.args,n],{cwd:r,detached:process.platform!=="win32",env:a??vJe(),stdio:[l?"pipe":"ignore","pipe","pipe"],windowsHide:!0});l&&(d.stdin?.on("error",()=>{}),d.stdin?.end(n)),d.pid&&Xgn(d.pid);let h=!1,m,f=()=>{d.pid&&L0e(d.pid)};try{c!==void 0&&(m=setTimeout(()=>{h=!0,d.pid&&L0e(d.pid)},c)),d.stdout?.on("data",s),d.stderr?.on("data",s),i&&(i.aborted?f():i.addEventListener("abort",f,{once:!0}));let g=await q3(d);if(i?.aborted)throw new Error("aborted");if(h)throw new Error(`timeout:${o}`);return{exitCode:g}}finally{d.pid&&Zgn(d.pid),m&&clearTimeout(m),i&&i.removeEventListener("abort",f)}}}}function Q5(t){return jZe("bash",()=>s5(t?.shellPath))}function mAs(t,e,n,r,s){let i={...vJe()};if(delete i.PI_SESSION_ID,delete i.PI_SESSION_FILE,delete i.PI_PROVIDER,delete i.PI_MODEL,delete i.PI_REASONING_LEVEL,r&&s){let a=s.model;i.PI_SESSION_ID=s.sessionManager.getSessionId();let c=s.sessionManager.getSessionFile();c&&(i.PI_SESSION_FILE=c),a&&(i.PI_PROVIDER=a.provider,i.PI_MODEL=a.id),s.thinkingLevel&&(i.PI_REASONING_LEVEL=s.thinkingLevel)}let o={command:t,cwd:e,env:i};return n?n(o):o}function YZe(t,e,n){let r=n?.operations??Q5({shellPath:n?.shellPath}),s=n?.commandPrefix,i=n?.exposeSessionEnvironment??!0,o=n?.spawnHook;return{name:e.name,label:e.label,description:`Execute a ${e.shellName} command in the current working directory. Returns stdout and stderr. Output is truncated to last ${2e3} lines or ${51200/1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.`,promptSnippet:e.promptSnippet,promptGuidelines:i&&e.promptGuidelines?[...e.promptGuidelines]:void 0,parameters:hAs,constrainedSampling:oD(),async execute(a,{command:c,timeout:u},l,d,h){let m=s?`${s} -${c}`:c,f=mAs(m,h?.cwd||t,o,i,h),g=new xCe({tempFilePrefix:e.tempFilePrefix}),A=!0,y,b=!1,S=0,C=()=>{if(!d||!b)return;b=!1,S=Date.now();let G=g.snapshot({persistIfTruncated:!0});d({content:[{type:"text",text:G.content||""}],details:{truncation:G.truncation.truncated?G.truncation:void 0,fullOutputPath:G.fullOutputPath}})},I=()=>{y&&(clearTimeout(y),y=void 0)},x=()=>{if(!d)return;b=!0;let G=w_n-(Date.now()-S);if(G<=0){I(),C();return}y??=setTimeout(()=>{y=void 0,C()},G)};d&&d({content:[],details:void 0});let w=G=>{A&&(g.append(G),x())},R=async()=>{A=!1,g.finish(),I(),C();let G=g.snapshot({persistIfTruncated:!0});return await g.closeTempFile(),G},N=(G,$="(no output)")=>{let Q=G.truncation,H=G.content||$,oe;if(Q.truncated){oe={truncation:Q,fullOutputPath:G.fullOutputPath};let re=Q.totalLines-Q.outputLines+1,Z=Q.totalLines;if(Q.lastLinePartial){let q=ma(g.getLastLineBytes());H+=` +`).map(d=>Ee.fg("toolOutput",d)).join(` +`);n.expanded?t.addChild(new Et(` +${l}`,0,0)):t.addChild({render:d=>{if(o.cachedLines===void 0||o.cachedWidth!==d){let m=UQ(l,wji,d);o.cachedLines=m.visualLines,o.cachedSkipped=m.skippedCount,o.cachedWidth=d}if(o.cachedSkipped&&o.cachedSkipped>0){let m=Ee.fg("muted",`... (${o.cachedSkipped} earlier lines,`)+` ${nr("app.tools.expand","to expand")}${Ee.fg("muted",")")}`;return["",dr(m,d,"..."),...o.cachedLines??[]]}return["",...o.cachedLines??[]]},invalidate:()=>{o.cachedWidth=void 0,o.cachedLines=void 0,o.cachedSkipped=void 0}})}if(c?.truncated||u){let l=[];u&&l.push(`Full output: ${u}`),c?.truncated&&(c.truncatedBy==="lines"?l.push(`Truncated: showing ${c.outputLines} of ${c.totalLines} lines`):l.push(`Truncated: ${c.outputLines} lines shown (${Ua(c.maxBytes??51200)} limit)`)),t.addChild(new Et(` +${Ee.fg("warning",`[${l.join(". ")}]`)}`,0,0))}if(i!==void 0){let l=n.isPartial?"Elapsed":"Took",d=s??Date.now();t.addChild(new Et(` +${Ee.fg("muted",`${l} ${Tji(d-i)}`)}`,0,0))}}function Fse(t){return{renderCall(e,n,r){let i=r.state;r.executionStarted&&i.startedAt===void 0&&(i.startedAt=Date.now(),i.endedAt=void 0);let s=r.lastComponent??new Et("",0,0);return s.setText(vji(e,t)),s},renderResult(e,n,r,i){let s=i.state;s.startedAt!==void 0&&n.isPartial&&!s.interval&&(s.interval=setInterval(()=>i.invalidate(),1e3)),(!n.isPartial||i.isError)&&(s.endedAt??=Date.now(),s.interval&&(clearInterval(s.interval),s.interval=void 0));let o=i.lastComponent??new cmt;return Rji(o,e,n,i.showImages,s.startedAt,s.endedAt),o.invalidate(),o}}}var wji,_4n,cmt,lmt=v(()=>{p();Tr();ha();f1e();pi();ok();Eg();wji=5,_4n=100,cmt=class extends gn{state={cachedWidth:void 0,cachedLines:void 0,cachedSkipped:void 0}}});function Bji(t){if(t===void 0)return;if(!Number.isFinite(t)||t<=0)throw new Error("Invalid timeout: must be a finite number of seconds");let e=t*1e3;if(e>T4n)throw new Error(`Invalid timeout: maximum is ${kji} seconds`);return e}function umt(t,e){return{exec:async(n,r,{onData:i,signal:s,timeout:o,env:a})=>{let c=Bji(o);if(s?.aborted)throw new Error("aborted");let u=e();try{await(0,C4n.access)(r,S4n.constants.F_OK)}catch{throw new Error(`Working directory does not exist: ${r} +Cannot execute ${t} commands.`)}let l=u.commandTransport==="stdin",d=(0,w4n.spawn)(u.shell,l?u.args:[...u.args,n],{cwd:r,detached:process.platform!=="win32",env:a??eut(),stdio:[l?"pipe":"ignore","pipe","pipe"],windowsHide:!0});l&&(d.stdin?.on("error",()=>{}),d.stdin?.end(n)),d.pid&&f$n(d.pid);let m=!1,h,f=()=>{d.pid&&uRe(d.pid)};try{c!==void 0&&(h=setTimeout(()=>{m=!0,d.pid&&uRe(d.pid)},c)),d.stdout?.on("data",i),d.stderr?.on("data",i),s&&(s.aborted?f():s.addEventListener("abort",f,{once:!0}));let g=await B8(d);if(s?.aborted)throw new Error("aborted");if(m)throw new Error(`timeout:${o}`);let A=d.signalCode;return{exitCode:g??(A?128+(I4n.constants.signals[A]??0):1)}}finally{d.pid&&g$n(d.pid),h&&clearTimeout(h),s&&s.removeEventListener("abort",f)}}}}function PV(t){return umt("bash",()=>jj(t?.shellPath))}function Dji(t,e,n,r,i){let s={...eut()};if(delete s.PI_SESSION_ID,delete s.PI_SESSION_FILE,delete s.PI_PROVIDER,delete s.PI_MODEL,delete s.PI_REASONING_LEVEL,r&&i){let a=i.model;s.PI_SESSION_ID=i.sessionManager.getSessionId();let c=i.sessionManager.getSessionFile();c&&(s.PI_SESSION_FILE=c),a&&(s.PI_PROVIDER=a.provider,s.PI_MODEL=a.id),i.thinkingLevel&&(s.PI_REASONING_LEVEL=i.thinkingLevel)}let o={command:t,cwd:e,env:s};return n?n(o):o}function dmt(t,e,n){let r=n?.operations??PV({shellPath:n?.shellPath}),i=n?.commandPrefix,s=n?.exposeSessionEnvironment??!0,o=n?.spawnHook;return{name:e.name,label:e.label,description:`Execute a ${e.shellName} command in the current working directory. Returns stdout and stderr. Output is truncated to last ${2e3} lines or ${51200/1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.`,promptSnippet:e.promptSnippet,promptGuidelines:s&&e.promptGuidelines?[...e.promptGuidelines]:void 0,parameters:Nji,constrainedSampling:{type:"json_schema",strict:"prefer"},async execute(a,{command:c,timeout:u},l,d,m){let h=i?`${i} +${c}`:c,f=Dji(h,m?.cwd||t,o,s,m),g=new h1e({tempFilePrefix:e.tempFilePrefix}),A=!0,y,E=!1,_=0,S=()=>{if(!d||!E)return;E=!1,_=Date.now();let W=g.snapshot({persistIfTruncated:!0});d({content:[{type:"text",text:W.content||""}],details:{truncation:W.truncation.truncated?W.truncation:void 0,fullOutputPath:W.fullOutputPath}})},C=()=>{y&&(clearTimeout(y),y=void 0)},I=()=>{if(!d)return;E=!0;let W=_4n-(Date.now()-_);if(W<=0){C(),S();return}y??=setTimeout(()=>{y=void 0,S()},W)};d&&d({content:[],details:void 0});let w=W=>{A&&(g.append(W),I())},k=async()=>{A=!1,g.finish(),C(),S();let W=g.snapshot({persistIfTruncated:!0});return await g.closeTempFile(),W},N=(W,$="(no output)")=>{let G=W.truncation,q=W.content||$,ce;if(G.truncated){ce={truncation:G,fullOutputPath:W.fullOutputPath};let Y=G.totalLines-G.outputLines+1,z=G.totalLines;if(G.lastLinePartial){let j=Ua(g.getLastLineBytes());q+=` -[Showing last ${ma(Q.outputBytes)} of line ${Z} (line is ${q}). Full output: ${G.fullOutputPath}]`}else Q.truncatedBy==="lines"?H+=` +[Showing last ${Ua(G.outputBytes)} of line ${z} (line is ${j}). Full output: ${W.fullOutputPath}]`}else G.truncatedBy==="lines"?q+=` -[Showing lines ${re}-${Z} of ${Q.totalLines}. Full output: ${G.fullOutputPath}]`:H+=` +[Showing lines ${Y}-${z} of ${G.totalLines}. Full output: ${W.fullOutputPath}]`:q+=` -[Showing lines ${re}-${Z} of ${Q.totalLines} (${ma(51200)} limit). Full output: ${G.fullOutputPath}]`}return{text:H,details:oe}},P=(G,$)=>`${G?`${G} +[Showing lines ${Y}-${z} of ${G.totalLines} (${Ua(51200)} limit). Full output: ${W.fullOutputPath}]`}return{text:q,details:ce}},O=(W,$)=>`${W?`${W} -`:""}${$}`;try{let G;try{G=(await r.exec(f.command,f.cwd,{onData:w,signal:l,timeout:u,env:f.env})).exitCode}catch(oe){let re=await R(),{text:Z}=N(re,"");if(oe instanceof Error&&oe.message==="aborted")throw new Error(P(Z,"Command aborted"));if(oe instanceof Error&&oe.message.startsWith("timeout:")){let q=oe.message.split(":")[1];throw new Error(P(Z,`Command timed out after ${q} seconds`))}throw oe}let $=await R(),{text:Q,details:H}=N($);if(G!==0&&G!==null)throw new Error(P(Q,`Command exited with code ${G}`));return{content:[{type:"text",text:Q}],details:H}}finally{I()}},...dee(e.prompt)}}var fAs={name:"bash",label:"bash",shellName:"bash",prompt:"$",promptSnippet:T_n.snippet,promptGuidelines:T_n.guidelines,tempFilePrefix:"pi-bash"};function U5(t,e){return YZe(t,fAs,e)}function $5(t,e){let n=U5(t,e),r=cp(n);return Object.assign(r,{promptSnippet:n.promptSnippet,promptGuidelines:n.promptGuidelines}),r}p();p();var JZe=require("fs"),q5=require("fs/promises");p();var F_n=require("fs"),TCe=require("fs/promises");p();var hee=require("node:fs"),D_n=require("node:fs/promises");var gAs="\u202F";function B_n(t){return t.replace(/ (AM|PM)\./gi,`${gAs}$1.`)}function P_n(t){return t.normalize("NFD")}function wCe(t){return t.replace(/'/g,"\u2019")}function pee(t){try{return(0,hee.accessSync)(t,hee.constants.F_OK),!0}catch{return!1}}async function aI(t){try{return await(0,D_n.access)(t,hee.constants.F_OK),!0}catch{return!1}}function $h(t,e){return jn(t,e,{normalizeUnicodeSpaces:!0,stripAtPrefix:!0})}function O_n(t,e){let n=$h(t,e);if(pee(n))return n;let r=B_n(n);if(r!==n&&pee(r))return r;let s=P_n(n);if(s!==n&&pee(s))return s;let i=wCe(n);if(i!==n&&pee(i))return i;let o=wCe(s);return o!==n&&pee(o)?o:n}async function M_n(t,e){let n=$h(t,e);if(await aI(n))return n;let r=B_n(n);if(r!==n&&await aI(r))return r;let s=P_n(n);if(s!==n&&await aI(s))return s;let i=wCe(n);if(i!==n&&await aI(i))return i;let o=wCe(s);return o!==n&&await aI(o)?o:n}function Q_n(t){let e=t.indexOf(`\r +`:""}${$}`;try{let W;try{W=(await r.exec(f.command,f.cwd,{onData:w,signal:l,timeout:u,env:f.env})).exitCode}catch(ce){let Y=await k(),{text:z}=N(Y,"");if(ce instanceof Error&&ce.message==="aborted")throw new Error(O(z,"Command aborted"));if(ce instanceof Error&&ce.message.startsWith("timeout:")){let j=ce.message.split(":")[1];throw new Error(O(z,`Command timed out after ${j} seconds`))}throw ce}let $=await k(),{text:G,details:q}=N($);if(W===null)throw new Error(O(G,"Command terminated without an exit code"));if(W!==0)throw new Error(O(G,`Command exited with code ${W}`));return{content:[{type:"text",text:G}],details:q}}finally{C()}},...Fse(e.prompt)}}function MV(t,e){return dmt(t,Pji,e)}function OV(t,e){let n=MV(t,e),r=cm(n);return Object.assign(r,{promptSnippet:n.promptSnippet,promptGuidelines:n.promptGuidelines}),r}var S4n,C4n,I4n,w4n,T4n,kji,Nji,x4n,Pji,Qse=v(()=>{p();S4n=require("node:fs"),C4n=require("node:fs/promises"),I4n=require("node:os"),w4n=require("child_process");Vm();FF();pw();A4n();lmt();bS();Eg();T4n=2147483647,kji=T4n/1e3;Nji=Ne.Object({command:Ne.String({description:"Shell command to execute"}),timeout:Ne.Optional(Ne.Number({description:"Timeout in seconds (optional, no default timeout)"}))}),x4n={snippet:"Execute bash commands (ls, grep, find, etc.)",guidelines:["You can inspect PI_* environment variables for current model and session details."]};Pji={name:"bash",label:"bash",shellName:"bash",prompt:"$",promptSnippet:x4n.snippet,promptGuidelines:x4n.guidelines,tempFilePrefix:"pi-bash"}});function R4n(t){return t.replace(/ (AM|PM)\./gi,`${Mji}$1.`)}function k4n(t){return t.normalize("NFD")}function g1e(t){return t.replace(/'/g,"\u2019")}function Use(t){try{return(0,Gse.accessSync)(t,Gse.constants.F_OK),!0}catch{return!1}}async function Iw(t){try{return await(0,v4n.access)(t,Gse.constants.F_OK),!0}catch{return!1}}function Xh(t,e){return Vn(t,e,{normalizeUnicodeSpaces:!0,stripAtPrefix:!0})}function B4n(t,e){let n=Xh(t,e);if(Use(n))return n;let r=R4n(n);if(r!==n&&Use(r))return r;let i=k4n(n);if(i!==n&&Use(i))return i;let s=g1e(n);if(s!==n&&Use(s))return s;let o=g1e(i);return o!==n&&Use(o)?o:n}async function N4n(t,e){let n=Xh(t,e);if(await Iw(n))return n;let r=R4n(n);if(r!==n&&await Iw(r))return r;let i=k4n(n);if(i!==n&&await Iw(i))return i;let s=g1e(n);if(s!==n&&await Iw(s))return s;let o=g1e(i);return o!==n&&await Iw(o)?o:n}var Gse,v4n,Mji,ww=v(()=>{p();Gse=require("node:fs"),v4n=require("node:fs/promises");fc();Mji="\u202F"});function M4n(t){let e=t.indexOf(`\r `),n=t.indexOf(` `);return n===-1||e===-1?` `:ee.trimEnd()).join(` -`).replace(/[\u2018\u2019\u201A\u201B]/g,"'").replace(/[\u201C\u201D\u201E\u201F]/g,'"').replace(/[\u2010\u2011\u2012\u2013\u2014\u2015\u2212]/g,"-").replace(/[\u00A0\u2002-\u200A\u202F\u205F\u3000]/g," ")}function $_n(t){return t.match(/[^\n]*\n|[^\n]+/g)??[]}function AAs(t){let e=0;return $_n(t).map(n=>{let r={start:e,end:e+n.length};return e=r.end,r})}function yAs(t,e){let n=e.matchIndex,r=e.matchIndex+e.matchLength,s=-1;for(let o=0;o=a.start&&n=t.length)throw new Error("Replacement range is outside the base content.");return{startLine:s,endLine:i+1}}function G_n(t,e,n=0){let r=t;for(let s=e.length-1;s>=0;s--){let i=e[s],o=i.matchIndex-n;r=r.substring(0,o)+i.newText+r.substring(o+i.matchLength)}return r}function EAs(t,e,n){let r=$_n(t),s=AAs(e);if(r.length!==s.length)throw new Error("Cannot preserve unchanged lines because the base content has a different line count.");let i=[],o=[...n].sort((u,l)=>u.matchIndex-l.matchIndex);for(let u of o){let l=yAs(s,u),d=i[i.length-1];if(d&&l.startLine({oldText:mee(l.oldText),newText:mee(l.newText)}));for(let l=0;lL_n(t,l.oldText)).some(l=>l.usedFuzzyMatch),o=i?fee(t):t,a=[];for(let l=0;l1)throw SAs(n,l,r.length,m);a.push({editIndex:l,matchIndex:h.index,matchLength:h.matchLength,newText:d.newText})}a.sort((l,d)=>l.matchIndex-d.matchIndex);for(let l=1;lh.matchIndex)throw new Error(`edits[${d.editIndex}] and edits[${h.editIndex}] overlap in ${n}. Merge them into one edit or target disjoint regions.`)}let c=t,u=i?EAs(t,o,a):G_n(o,a);if(c===u)throw IAs(n,r.length);return{baseContent:c,newContent:u}}function vCe(t,e,n,r=4){return KZ(t,t,e,n,void 0,void 0,{context:r,headerOptions:YZ})}function gee(t,e,n=4){let r=iD(t,e),s=[],i=t.split(` +`).replace(/[\u2018\u2019\u201A\u201B]/g,"'").replace(/[\u201C\u201D\u201E\u201F]/g,'"').replace(/[\u2010\u2011\u2012\u2013\u2014\u2015\u2212]/g,"-").replace(/[\u00A0\u2002-\u200A\u202F\u205F\u3000]/g," ")}function L4n(t){return t.match(/[^\n]*\n|[^\n]+/g)??[]}function Oji(t){let e=0;return L4n(t).map(n=>{let r={start:e,end:e+n.length};return e=r.end,r})}function Lji(t,e){let n=e.matchIndex,r=e.matchIndex+e.matchLength,i=-1;for(let o=0;o=a.start&&n=t.length)throw new Error("Replacement range is outside the base content.");return{startLine:i,endLine:s+1}}function F4n(t,e,n=0){let r=t;for(let i=e.length-1;i>=0;i--){let s=e[i],o=s.matchIndex-n;r=r.substring(0,o)+s.newText+r.substring(o+s.matchLength)}return r}function Fji(t,e,n){let r=L4n(t),i=Oji(e);if(r.length!==i.length)throw new Error("Cannot preserve unchanged lines because the base content has a different line count.");let s=[],o=[...n].sort((u,l)=>u.matchIndex-l.matchIndex);for(let u of o){let l=Lji(i,u),d=s[s.length-1];if(d&&l.startLine({oldText:$se(l.oldText),newText:$se(l.newText)}));for(let l=0;lD4n(t,l.oldText)).some(l=>l.usedFuzzyMatch),o=s?Wse(t):t,a=[];for(let l=0;l1)throw Gji(n,l,r.length,h);a.push({editIndex:l,matchIndex:m.index,matchLength:m.matchLength,newText:d.newText})}a.sort((l,d)=>l.matchIndex-d.matchIndex);for(let l=1;lm.matchIndex)throw new Error(`edits[${d.editIndex}] and edits[${m.editIndex}] overlap in ${n}. Merge them into one edit or target disjoint regions.`)}let c=t,u=s?Fji(t,o,a):F4n(o,a);if(c===u)throw Wji(n,r.length);return{baseContent:c,newContent:u}}function y1e(t,e,n,r=4){return Ise(t,t,e,n,void 0,void 0,{context:r,headerOptions:Cse})}function Hse(t,e,n=4){let r=eP(t,e),i=[],s=t.split(` `),o=e.split(` -`),a=Math.max(i.length,o.length),c=String(a).length,u=1,l=1,d=!1,h;for(let m=0;m0&&(s.push(` ${"".padStart(c," ")} ...`),u+=C,l+=C)}else if(b){let S=Math.max(0,g.length-n);S>0&&(s.push(` ${"".padStart(c," ")} ...`),u+=S,l+=S);for(let C of g.slice(S)){let I=String(u).padStart(c," ");s.push(` ${I} ${C}`),u++,l++}}else u+=g.length,l+=g.length;d=!1}}return{diff:s.join(` -`),firstChangedLine:h}}async function W_n(t,e,n){let r=$h(t,n);try{try{await(0,TCe.access)(r,F_n.constants.R_OK)}catch(u){let l=u instanceof Error&&"code"in u?`Error code: ${u.code}`:String(u);return{error:`Could not edit file: ${t}. ${l}.`}}let s=await(0,TCe.readFile)(r,"utf-8"),{text:i}=rX(s),o=mee(i),{baseContent:a,newContent:c}=KZe(o,e,t);return gee(a,c)}catch(s){return{error:s instanceof Error?s.message:String(s)}}}p();var H_n=require("node:fs/promises"),V_n=require("node:path"),RCe=new Map,q_n=Promise.resolve();function xAs(t){return typeof t=="object"&&t!==null&&"code"in t&&(t.code==="ENOENT"||t.code==="ENOTDIR")}async function wAs(t){let e=(0,V_n.resolve)(t);try{return await(0,H_n.realpath)(e)}catch(n){if(xAs(n))return e;throw n}}async function cD(t,e){let n=q_n.then(async()=>{let a=await wAs(t),c=RCe.get(a)??Promise.resolve(),u,l=new Promise(h=>{u=h}),d=c.then(()=>l);return RCe.set(a,d),{key:a,currentQueue:c,chainedQueue:d,releaseNext:u}});q_n=n.then(()=>{},()=>{});let{key:r,currentQueue:s,chainedQueue:i,releaseNext:o}=await n;await s;try{return await e()}finally{o(),RCe.get(r)===i&&RCe.delete(r)}}p();p();function zZe(t){let e=t.match(/^([+-\s])(\s*\d*)\s(.*)$/);return e?{prefix:e[1],lineNum:e[2],content:e[3]}:null}function G5(t){return t.replace(/\t/g," ")}function TAs(t,e){let n=oZe(t,e),r="",s="",i=!0,o=!0;for(let a of n)if(a.removed){let c=a.value;if(i){let u=c.match(/^(\s*)/)?.[1]||"";c=c.slice(u.length),r+=u,i=!1}c&&(r+=Se.inverse(c))}else if(a.added){let c=a.value;if(o){let u=c.match(/^(\s*)/)?.[1]||"";c=c.slice(u.length),s+=u,o=!1}c&&(s+=Se.inverse(c))}else r+=a.value,s+=a.value;return{removedLine:r,addedLine:s}}function W5(t,e={}){let n=t.split(` -`),r=[],s=0;for(;st),{preview:void 0,previewArgsKey:void 0,previewPending:!1,settledError:!1})}function RAs(t,e){if(e instanceof Vl){let r=e;return t.callComponent=r,r}if(t.callComponent)return t.callComponent;let n=vAs();return t.callComponent=n,n}function j_n(t){if(!t)return null;let e=typeof t.path=="string"?t.path:typeof t.file_path=="string"?t.file_path:null;return e?Array.isArray(t.edits)&&t.edits.length>0&&t.edits.every(n=>typeof n?.oldText=="string"&&typeof n?.newText=="string")?{path:e,edits:t.edits}:typeof t.oldText=="string"&&typeof t.newText=="string"?{path:e,edits:[{oldText:t.oldText,newText:t.newText}]}:null:null}function kAs(t,e,n){let r=aD(fl(t?.file_path??t?.path),e,n);return`${e.fg("toolTitle",e.bold("edit"))} ${r}`}function NAs(t,e,n,r,s){let i=fl(t?.file_path??t?.path),o=e&&!("error"in e)?e.diff:void 0,a=e&&"error"in e?e.error:void 0;if(s){let u=n.content.filter(l=>l.type==="text").map(l=>l.text||"").join(` -`);return!u||u===a?void 0:r.fg("error",u)}let c=n.details?.diff;if(c&&c!==o)return W5(c,{filePath:i??void 0})}function DAs(t,e,n){return t?"error"in t?r=>n.bg("toolErrorBg",r):r=>n.bg("toolSuccessBg",r):e?r=>n.bg("toolErrorBg",r):r=>n.bg("toolPendingBg",r)}function Y_n(t,e,n,r){if(t.setBgFn(DAs(t.preview,t.settledError,n)),t.clear(),t.addChild(new yt(kAs(e,n,r),0,0)),!t.preview)return t;let s="error"in t.preview?n.fg("error",t.preview.error):W5(t.preview.diff);return t.addChild(new Nt(1)),t.addChild(new yt(s,0,0)),t}function K_n(t,e,n){let r=t.preview,s=r===void 0||("error"in r&&"error"in e?r.error!==e.error:"error"in r!="error"in e)||!("error"in r)&&!("error"in e)&&(r.diff!==e.diff||r.firstChangedLine!==e.firstChangedLine);return t.preview=e,t.previewArgsKey=n,t.previewPending=!1,s}var kCe={renderCall(t,e,n){let r=RAs(n.state,n.lastComponent),s=j_n(t),i=s?JSON.stringify({path:s.path,edits:s.edits}):void 0;if(r.previewArgsKey!==i&&(r.preview=void 0,r.previewArgsKey=i,r.previewPending=!1,r.settledError=!1),n.argsComplete&&s&&!r.preview&&!r.previewPending){r.previewPending=!0;let o=i;W_n(s.path,s.edits,n.cwd).then(a=>{r.previewArgsKey===o&&(K_n(r,a,o),n.invalidate())})}return Y_n(r,t,e,n.cwd)},renderResult(t,e,n,r){let s=r.state.callComponent,i=j_n(r.args),o=i?JSON.stringify({path:i.path,edits:i.edits}):void 0,a=t,c=r.isError?void 0:a.details?.diff,u=!1;s&&(typeof c=="string"&&(u=K_n(s,{diff:c,firstChangedLine:a.details?.firstChangedLine},o)||u),s.settledError!==r.isError&&(s.settledError=r.isError,u=!0),u&&Y_n(s,r.args,n,r.cwd));let l=NAs(r.args,s?.preview,a,n,r.isError),d=r.lastComponent??new _n;return d.clear(),l&&(d.addChild(new Nt(1)),d.addChild(new yt(l,1,0))),d}};var BAs=Oe.Object({oldText:Oe.String({description:"Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call."}),newText:Oe.String({description:"Replacement text for this targeted edit."})},{}),PAs=Oe.Object({path:Oe.String({description:"Path to the file to edit (relative or absolute)"}),edits:Oe.Array(BAs,{description:"One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead."})},{}),z_n={snippet:"Make precise file edits with exact text replacement, including multiple disjoint edits in one call",guidelines:["Use edit for precise changes (edits[].oldText must match exactly)","When changing multiple separate locations in one file, use one edit call with multiple entries in edits[] instead of multiple edit calls","Each edits[].oldText is matched against the original file, not after earlier edits are applied. Do not emit overlapping or nested edits. Merge nearby changes into one edit.","Keep edits[].oldText as small as possible while still being unique in the file. Do not pad with large unchanged regions."]};function J_n(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.oldText=="string"&&typeof e.newText=="string"}var OAs={readFile:t=>(0,q5.readFile)(t),writeFile:(t,e)=>(0,q5.writeFile)(t,e,"utf-8"),access:t=>(0,q5.access)(t,JZe.constants.R_OK|JZe.constants.W_OK)};function MAs(t){if(!t||typeof t!="object")return t;let e=t;if(typeof e.edits=="string")try{let a=JSON.parse(e.edits);Array.isArray(a)?e.edits=a:J_n(a)&&(e.edits=[a])}catch{}else J_n(e.edits)&&(e.edits=[e.edits]);let n=e;if(typeof n.oldText!="string"||typeof n.newText!="string")return e;let r=Array.isArray(n.edits)?[...n.edits]:[];r.push({oldText:n.oldText,newText:n.newText});let{oldText:s,newText:i,...o}=n;return{...o,edits:r}}function LAs(t){if(!Array.isArray(t.edits)||t.edits.length===0)throw new Error("Edit tool input is invalid. edits must contain at least one replacement.");return{path:t.path,edits:t.edits}}function H5(t,e){let n=e?.operations??OAs;return{name:"edit",label:"edit",description:"Edit a single file using exact text replacement. Every edits[].oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit instead of emitting overlapping edits. Do not include large unchanged regions just to connect distant changes.",promptSnippet:z_n.snippet,promptGuidelines:[...z_n.guidelines],parameters:PAs,constrainedSampling:oD(),renderShell:"self",prepareArguments:MAs,async execute(r,s,i,o,a){let{path:c,edits:u}=LAs(s),l=$h(c,a?.cwd||t);return cD(l,async()=>{let d=()=>{if(i?.aborted)throw new Error("Operation aborted")};d();try{await n.access(l)}catch(w){d();let R=w instanceof Error&&"code"in w?`Error code: ${w.code}`:String(w);throw new Error(`Could not edit file: ${c}. ${R}.`)}d();let m=(await n.readFile(l)).toString("utf-8");d();let{bom:f,text:g}=rX(m),A=Q_n(g),y=mee(g),{baseContent:b,newContent:S}=KZe(y,u,c);d();let C=f+U_n(S,A);await n.writeFile(l,C),d();let I=gee(b,S),x=vCe(c,b,S);return{content:[{type:"text",text:`Successfully replaced ${u.length} block(s) in ${c}.`}],details:{diff:I.diff,patch:x,firstChangedLine:I.firstChangedLine}}})},...kCe}}function V5(t,e){return cp(H5(t,e))}p();var n0n=require("node:readline"),r0n=require("child_process"),DCe=Gt(require("path"),1);p();var XZe=require("child_process"),lp=require("fs"),yL=require("os"),cI=require("path"),X_n=require("stream"),Z_n=require("stream/promises");p();var FAs=new Set([408,425,429,500,502,503,504]);async function AL(t,e=void 0,n={}){let r=n.maxRetries===void 0||!Number.isFinite(n.maxRetries)?2:Math.max(0,Math.floor(n.maxRetries)),s=n.retryOnStatus??!0,i=e?.signal??void 0,o=n.timeoutMs!==void 0&&n.timeoutMs>0?AbortSignal.timeout(n.timeoutMs):void 0,a=n.attemptTimeoutMs!==void 0&&n.attemptTimeoutMs>0?n.attemptTimeoutMs:void 0;for(let c=0;;c++){i?.throwIfAborted(),o?.throwIfAborted();let u=a?AbortSignal.timeout(a):void 0,l=[i,o,u].filter(h=>h!==void 0),d=l.length>1?AbortSignal.any(l):l[0];try{let h=await fetch(t,d?{...e,signal:d}:e);if(!(s&&FAs.has(h.status)&&c=r)throw h}}}var Aee=j3(),QAs=1e4,UAs=12e4;function $As(){let t=process.env.PI_OFFLINE;return t?t==="1"||t.toLowerCase()==="true"||t.toLowerCase()==="yes":!1}var ZZe={fd:{name:"fd",repo:"sharkdp/fd",binaryName:"fd",systemBinaryNames:["fd","fdfind"],tagPrefix:"v",getAssetName:(t,e,n)=>e==="darwin"?`fd-v${t}-${n==="arm64"?"aarch64":"x86_64"}-apple-darwin.tar.gz`:e==="linux"?`fd-v${t}-${n==="arm64"?"aarch64":"x86_64"}-unknown-linux-musl.tar.gz`:e==="win32"?`fd-v${t}-${n==="arm64"?"aarch64":"x86_64"}-pc-windows-msvc.zip`:null},rg:{name:"ripgrep",repo:"BurntSushi/ripgrep",binaryName:"rg",tagPrefix:"",getAssetName:(t,e,n)=>e==="darwin"?`ripgrep-${t}-${n==="arm64"?"aarch64":"x86_64"}-apple-darwin.tar.gz`:e==="linux"?`ripgrep-${t}-${n==="arm64"?"aarch64":"x86_64"}-unknown-linux-musl.tar.gz`:e==="win32"?`ripgrep-${t}-${n==="arm64"?"aarch64":"x86_64"}-pc-windows-msvc.zip`:null}};function GAs(t){try{let e=(0,XZe.spawnSync)(t,["--version"],{stdio:"pipe"});return e.error===void 0||e.error===null}catch{return!1}}function WAs(t){let e=ZZe[t];if(!e)return null;let n=(0,cI.join)(Aee,e.binaryName+((0,yL.platform)()==="win32"?".exe":""));if((0,lp.existsSync)(n))return n;let r=e.systemBinaryNames??[e.binaryName];for(let s of r)if(GAs(s))return s;return null}async function qAs(t){let e=await AL(`https://github.com/${t}/releases/latest`,{headers:{"User-Agent":`${An}-coding-agent`},redirect:"manual"},{timeoutMs:QAs});try{await e.body?.cancel()}catch{}let n=e.status>=300&&e.status<400?e.headers.get("location"):null;if(!n)throw new Error(`Failed to resolve latest ${t} release: HTTP ${e.status} without redirect`);let r=new URL(n,"https://github.com").pathname.split("/").pop();if(!r||!n.includes("/releases/tag/"))throw new Error(`Failed to resolve latest ${t} release: unexpected redirect to ${n}`);return decodeURIComponent(r).replace(/^v/,"")}async function HAs(t,e){let n=await AL(t,void 0,{timeoutMs:UAs});if(!n.ok)throw new Error(`Download failed with HTTP ${n.status}: ${t}`);if(!n.body)throw new Error("No response body");let r=(0,lp.createWriteStream)(e);await(0,Z_n.pipeline)(X_n.Readable.fromWeb(n.body),r)}function VAs(t,e){let n=[t];for(;n.length>0;){let r=n.pop();if(!r)continue;let s=(0,lp.readdirSync)(r,{withFileTypes:!0});for(let i of s){let o=(0,cI.join)(r,i.name);if(i.isFile()&&i.name===e)return o;i.isDirectory()&&n.push(o)}}return null}function jAs(t){if(t.error?.message)return t.error.message;let e=t.stderr?.toString().trim();if(e)return e;let n=t.stdout?.toString().trim();return n||`exit status ${t.status??"unknown"}`}function yee(t,e){let n=(0,XZe.spawnSync)(t,e,{stdio:"pipe"});return!n.error&&n.status===0?null:`${t}: ${jAs(n)}`}function YAs(t,e,n){let r=yee("tar",["xzf",t,"-C",e]);if(r)throw new Error(`Failed to extract ${n}: ${r}`)}function KAs(){let t=process.env.SystemRoot??process.env.WINDIR;if(t){let e=(0,cI.join)(t,"System32","tar.exe");if((0,lp.existsSync)(e))return e}return"tar.exe"}function zAs(t,e,n){let r=[];if((0,yL.platform)()==="win32"){let s=yee(KAs(),["xf",t,"-C",e]);if(!s)return;r.push(s);let o=yee("powershell.exe",["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-Command","& { param($archive, $destination) $ErrorActionPreference = 'Stop'; Expand-Archive -LiteralPath $archive -DestinationPath $destination -Force }",t,e]);if(!o)return;r.push(o)}else{let s=yee("unzip",["-q",t,"-d",e]);if(!s)return;r.push(s);let i=yee("tar",["xf",t,"-C",e]);if(!i)return;r.push(i)}throw new Error(`Failed to extract ${n}: ${r.join("; ")}`)}async function JAs(t){let e=ZZe[t];if(!e)throw new Error(`Unknown tool: ${t}`);let n=(0,yL.platform)(),r=(0,yL.arch)(),s=t==="fd"&&n==="darwin"&&r==="x64"?"10.3.0":await qAs(e.repo),i=e.getAssetName(s,n,r);if(!i)throw new Error(`Unsupported platform: ${n}/${r}`);(0,lp.mkdirSync)(Aee,{recursive:!0});let o=`https://github.com/${e.repo}/releases/download/${e.tagPrefix}${s}/${i}`,a=(0,cI.join)(Aee,i),c=n==="win32"?".exe":"",u=(0,cI.join)(Aee,e.binaryName+c);await HAs(o,a);let l=(0,cI.join)(Aee,`extract_tmp_${e.binaryName}_${process.pid}_${Date.now()}_${Math.random().toString(36).slice(2,10)}`);(0,lp.mkdirSync)(l,{recursive:!0});try{if(i.endsWith(".tar.gz"))YAs(a,l,i);else if(i.endsWith(".zip"))zAs(a,l,i);else throw new Error(`Unsupported archive format: ${i}`);let d=e.binaryName+c,h=(0,cI.join)(l,i.replace(/\.(tar\.gz|zip)$/,"")),f=[(0,cI.join)(h,d),(0,cI.join)(l,d)].find(g=>(0,lp.existsSync)(g));if(f||(f=VAs(l,d)??void 0),f)(0,lp.renameSync)(f,u);else throw new Error(`Binary not found in archive: expected ${d} under ${l}`);n!=="win32"&&(0,lp.chmodSync)(u,493)}finally{(0,lp.rmSync)(a,{force:!0}),(0,lp.rmSync)(l,{recursive:!0,force:!0})}return u}var XAs={fd:"fd",rg:"ripgrep"};async function EL(t,e){let n=WAs(t);if(n)return n;let r=ZZe[t];if(r){if($As()){e?.({type:"warning",message:`${r.name} not found. Offline mode enabled, skipping download.`});return}if((0,yL.platform)()==="android"){let s=XAs[t]??t;e?.({type:"warning",message:`${r.name} not found. Install with: pkg install ${s}`});return}e?.({type:"info",message:`${r.name} not found. Downloading...`});try{let s=await JAs(t);return e?.({type:"info",message:`${r.name} installed to ${s}`}),s}catch(s){let i=[];for(let o=s,a=0;o instanceof Error&&a<5;o=o.cause,a++)i.includes(o.message)||i.push(o.message);e?.({type:"warning",message:`Failed to download ${r.name}: ${i.length>0?i.join(": "):String(s)}`});return}}}p();function ZAs(t,e){let n=fl(t?.pattern),r=fl(t?.path),s=r!==null?lee(r||"."):null,i=t?.limit,o=gL(e),a=e.fg("toolTitle",e.bold("find"))+" "+(n===null?o:e.fg("accent",n||""))+e.fg("toolOutput",` in ${s===null?o:s}`);return i!==void 0&&(a+=e.fg("toolOutput",` (limit ${i})`)),a}function eys(t,e,n,r){let s=eb(t,r).trim(),i="";if(s){let c=s.split(` -`),u=e.expanded?c.length:20,l=c.slice(0,u),d=c.length-u;i+=` -${l.map(h=>n.fg("toolOutput",h)).join(` -`)}`,d>0&&(i+=`${n.fg("muted",` -... (${d} more lines,`)} ${er("app.tools.expand","to expand")}${n.fg("muted",")")}`)}let o=t.details?.resultLimitReached,a=t.details?.truncation;if(o||a?.truncated){let c=[];o&&c.push(`${o} results limit`),a?.truncated&&c.push(`${ma(a.maxBytes??51200)} limit`),i+=` -${n.fg("warning",`[Truncated: ${c.join(", ")}]`)}`}return i}var NCe={renderCall(t,e,n){let r=n.lastComponent??new yt("",0,0);return r.setText(ZAs(t,e)),r},renderResult(t,e,n,r){let s=r.lastComponent??new yt("",0,0);return s.setText(eys(t,e,n,r.showImages)),s}};function e0n(t,e,n=DCe.default){let r=t.endsWith(n.sep)||n.sep==="\\"&&t.endsWith("/"),i=(n.isAbsolute(t)?n.relative(e,t):t).split(n.sep).join("/");return r&&!i.endsWith("/")?`${i}/`:i}var tys=Oe.Object({pattern:Oe.String({description:"Glob pattern to match files, e.g. '*.ts', '**/*.json', or 'src/**/*.spec.ts'"}),path:Oe.Optional(Oe.String({description:"Directory to search in (default: current directory)"})),limit:Oe.Optional(Oe.Number({description:"Maximum number of results (default: 1000)"}))}),nys={snippet:"Find files by glob pattern (respects .gitignore)",guidelines:[]},t0n=1e3,rys={exists:aI,glob:()=>[]};function j5(t,e){let n=e?.operations;return{name:"find",label:"find",description:`Search for files by glob pattern. Returns matching file paths relative to the search directory. Respects .gitignore. Output is truncated to ${t0n} results or ${51200/1024}KB (whichever is hit first).`,promptSnippet:nys.snippet,parameters:tys,async execute(r,{pattern:s,path:i,limit:o},a,c,u){return new Promise((l,d)=>{if(a?.aborted){d(new Error("Operation aborted"));return}let h=!1,m,f=A=>{h||(h=!0,a?.removeEventListener("abort",g),m=void 0,A())},g=()=>{m?.(),f(()=>d(new Error("Operation aborted")))};a?.addEventListener("abort",g,{once:!0}),(async()=>{try{let A=$h(i||".",u?.cwd||t),y=o??t0n,b=n??rys;if(n?.glob){if(!await b.exists(A)){f(()=>d(new Error(`Path not found: ${A}`)));return}if(a?.aborted){f(()=>d(new Error("Operation aborted")));return}let $=await b.glob(s,A,{ignore:["**/node_modules/**","**/.git/**"],limit:y});if(a?.aborted){f(()=>d(new Error("Operation aborted")));return}if($.length===0){f(()=>l({content:[{type:"text",text:"No files found matching pattern"}],details:void 0}));return}let Q=$.map(be=>e0n(be,A)),H=Q.length>=y,oe=Q.join(` -`),re=YE(oe,{maxLines:Number.MAX_SAFE_INTEGER}),Z=re.content,q={},ce=[];H&&(ce.push(`${y} results limit reached`),q.resultLimitReached=y),re.truncated&&(ce.push(`${ma(51200)} limit reached`),q.truncation=re),ce.length>0&&(Z+=` - -[${ce.join(". ")}]`),f(()=>l({content:[{type:"text",text:Z}],details:Object.keys(q).length>0?q:void 0}));return}let S=await EL("fd");if(a?.aborted){f(()=>d(new Error("Operation aborted")));return}if(!S){f(()=>d(new Error("fd is not available and could not be downloaded")));return}let C=["--glob","--color=never","--hidden"],I=!1;for(let $=A;;){if(await aI(DCe.default.join($,".git"))){I=!0;break}let Q=DCe.default.dirname($);if(Q===$)break;$=Q}I||C.push("--no-require-git"),C.push("--max-results",String(y));let x=s;s.includes("/")&&(C.push("--full-path"),!s.startsWith("/")&&!s.startsWith("**/")&&s!=="**"&&(x=`**/${s}`),process.platform==="win32"&&(x=x.replaceAll("/",String.raw`[/\\]`))),C.push("--",x,A);let w=(0,r0n.spawn)(S,C,{stdio:["ignore","pipe","pipe"]}),R=(0,n0n.createInterface)({input:w.stdout}),N="",P=[];m=()=>{w.killed||w.kill()};let G=()=>{R.close()};w.stderr?.on("data",$=>{N+=$.toString()}),R.on("line",$=>{P.push($)}),w.on("error",$=>{G(),f(()=>d(new Error(`Failed to run fd: ${$.message}`)))}),w.on("close",$=>{if(G(),a?.aborted){f(()=>d(new Error("Operation aborted")));return}let Q=P.join(` -`);if($!==0){let Be=N.trim()||`fd exited with code ${$}`;if(!Q){f(()=>d(new Error(Be)));return}}if(!Q){f(()=>l({content:[{type:"text",text:"No files found matching pattern"}],details:void 0}));return}let H=[];for(let Be of P){let Me=Be.replace(/\r$/,"").trim();Me&&H.push(e0n(Me,A))}let oe=H.length>=y,re=H.join(` -`),Z=YE(re,{maxLines:Number.MAX_SAFE_INTEGER}),q=Z.content,ce={},be=[];oe&&(be.push(`${y} results limit reached. Use limit=${y*2} for more, or refine pattern`),ce.resultLimitReached=y),Z.truncated&&(be.push(`${ma(51200)} limit reached`),ce.truncation=Z),be.length>0&&(q+=` - -[${be.join(". ")}]`),f(()=>l({content:[{type:"text",text:q}],details:Object.keys(ce).length>0?ce:void 0}))})}catch(A){if(a?.aborted){f(()=>d(new Error("Operation aborted")));return}let y=A instanceof Error?A:new Error(String(A));f(()=>d(y))}})()})},...NCe}}function Y5(t,e){return cp(j5(t,e))}p();var PCe=require("node:fs/promises"),o0n=require("node:readline"),a0n=require("child_process"),eet=Gt(require("path"),1);p();function sys(t,e){let n=fl(t?.pattern),r=fl(t?.path),s=r!==null?lee(r||"."):null,i=fl(t?.glob),o=t?.limit,a=gL(e),c=e.fg("toolTitle",e.bold("grep"))+" "+(n===null?a:e.fg("accent",`/${n||""}/`))+e.fg("toolOutput",` in ${s===null?a:s}`);return i&&(c+=e.fg("toolOutput",` (${i})`)),o!==void 0&&(c+=e.fg("toolOutput",` limit ${o}`)),c}function iys(t,e,n,r){let s=eb(t,r).trim(),i="";if(s){let u=s.split(` -`),l=e.expanded?u.length:15,d=u.slice(0,l),h=u.length-l;i+=` -${d.map(m=>n.fg("toolOutput",m)).join(` -`)}`,h>0&&(i+=`${n.fg("muted",` -... (${h} more lines,`)} ${er("app.tools.expand","to expand")}${n.fg("muted",")")}`)}let o=t.details?.matchLimitReached,a=t.details?.truncation,c=t.details?.linesTruncated;if(o||a?.truncated||c){let u=[];o&&u.push(`${o} matches limit`),a?.truncated&&u.push(`${ma(a.maxBytes??51200)} limit`),c&&u.push("some lines truncated"),i+=` -${n.fg("warning",`[Truncated: ${u.join(", ")}]`)}`}return i}var BCe={renderCall(t,e,n){let r=n.lastComponent??new yt("",0,0);return r.setText(sys(t,e)),r},renderResult(t,e,n,r){let s=r.lastComponent??new yt("",0,0);return s.setText(iys(t,e,n,r.showImages)),s}};var oys=Oe.Object({pattern:Oe.String({description:"Search pattern (regex or literal string)"}),path:Oe.Optional(Oe.String({description:"Directory or file to search (default: current directory)"})),glob:Oe.Optional(Oe.String({description:"Filter files by glob pattern, e.g. '*.ts' or '**/*.spec.ts'"})),ignoreCase:Oe.Optional(Oe.Boolean({description:"Case-insensitive search (default: false)"})),literal:Oe.Optional(Oe.Boolean({description:"Treat pattern as literal string instead of regex (default: false)"})),context:Oe.Optional(Oe.Number({description:"Number of lines to show before and after each match (default: 0)"})),limit:Oe.Optional(Oe.Number({description:"Maximum number of matches to return (default: 100)"}))}),ays={snippet:"Search file contents for patterns (respects .gitignore)",guidelines:[]},i0n=100,cys={isDirectory:async t=>(await(0,PCe.stat)(t)).isDirectory(),readFile:t=>(0,PCe.readFile)(t,"utf-8")};function K5(t,e){let n=e?.operations;return{name:"grep",label:"grep",description:`Search file contents for a pattern. Returns matching lines with file paths and line numbers. Respects .gitignore. Output is truncated to ${i0n} matches or ${51200/1024}KB (whichever is hit first). Long lines are truncated to ${500} chars.`,promptSnippet:ays.snippet,parameters:oys,async execute(r,{pattern:s,path:i,glob:o,ignoreCase:a,literal:c,context:u,limit:l},d,h,m){return new Promise((f,g)=>{if(d?.aborted){g(new Error("Operation aborted"));return}let A=!1,y=b=>{A||(A=!0,b())};(async()=>{try{let b=await EL("rg");if(!b){y(()=>g(new Error("ripgrep (rg) is not available and could not be downloaded")));return}let S=$h(i||".",m?.cwd||t),C=n??cys,I;try{I=await C.isDirectory(S)}catch{y(()=>g(new Error(`Path not found: ${S}`)));return}let x=u&&u>0?u:0,w=Math.max(1,l??i0n),R=ne=>{if(I){let J=eet.default.relative(S,ne);if(J&&!J.startsWith(".."))return J.replace(/\\/g,"/")}return eet.default.basename(ne)},N=new Map,P=async ne=>{let J=N.get(ne);if(!J){try{J=(await C.readFile(ne)).replace(/\r\n/g,` +`),a=Math.max(s.length,o.length),c=String(a).length,u=1,l=1,d=!1,m;for(let h=0;h0&&(i.push(` ${"".padStart(c," ")} ...`),u+=S,l+=S)}else if(E){let _=Math.max(0,g.length-n);_>0&&(i.push(` ${"".padStart(c," ")} ...`),u+=_,l+=_);for(let S of g.slice(_)){let C=String(u).padStart(c," ");i.push(` ${C} ${S}`),u++,l++}}else u+=g.length,l+=g.length;d=!1}}return{diff:i.join(` +`),firstChangedLine:m}}async function Q4n(t,e,n){let r=Xh(t,n);try{try{await(0,A1e.access)(r,P4n.constants.R_OK)}catch(u){let l=u instanceof Error&&"code"in u?`Error code: ${u.code}`:String(u);return{error:`Could not edit file: ${t}. ${l}.`}}let i=await(0,A1e.readFile)(r,"utf-8"),{text:s}=dre(i),o=$se(s),{baseContent:a,newContent:c}=pmt(o,e,t);return Hse(a,c)}catch(i){return{error:i instanceof Error?i.message:String(i)}}}var P4n,A1e,E1e=v(()=>{p();Kke();P4n=require("fs"),A1e=require("fs/promises");nm();ww()});function Hji(t){return typeof t=="object"&&t!==null&&"code"in t&&(t.code==="ENOENT"||t.code==="ENOTDIR")}async function qji(t){let e=(0,$4n.resolve)(t);try{return await(0,G4n.realpath)(e)}catch(n){if(Hji(n))return e;throw n}}async function iP(t,e){let n=U4n.then(async()=>{let a=await qji(t),c=b1e.get(a)??Promise.resolve(),u,l=new Promise(m=>{u=m}),d=c.then(()=>l);return b1e.set(a,d),{key:a,currentQueue:c,chainedQueue:d,releaseNext:u}});U4n=n.then(()=>{},()=>{});let{key:r,currentQueue:i,chainedQueue:s,releaseNext:o}=await n;await i;try{return await e()}finally{o(),b1e.get(r)===s&&b1e.delete(r)}}var G4n,$4n,b1e,U4n,_1e=v(()=>{p();G4n=require("node:fs/promises"),$4n=require("node:path"),b1e=new Map,U4n=Promise.resolve()});function mmt(t){let e=t.match(/^([+-\s])(\s*\d*)\s(.*)$/);return e?{prefix:e[1],lineNum:e[2],content:e[3]}:null}function LV(t){return t.replace(/\t/g," ")}function jji(t,e){let n=upt(t,e),r="",i="",s=!0,o=!0;for(let a of n)if(a.removed){let c=a.value;if(s){let u=c.match(/^(\s*)/)?.[1]||"";c=c.slice(u.length),r+=u,s=!1}c&&(r+=Ee.inverse(c))}else if(a.added){let c=a.value;if(o){let u=c.match(/^(\s*)/)?.[1]||"";c=c.slice(u.length),i+=u,o=!1}c&&(i+=Ee.inverse(c))}else r+=a.value,i+=a.value;return{removedLine:r,addedLine:i}}function FV(t,e={}){let n=t.split(` +`),r=[],i=0;for(;i{p();Kke();pi()});function Vji(){return Object.assign(new Ou(1,1,t=>t),{preview:void 0,previewArgsKey:void 0,previewPending:!1,settledError:!1})}function Yji(t,e){if(e instanceof Ou){let r=e;return t.callComponent=r,r}if(t.callComponent)return t.callComponent;let n=Vji();return t.callComponent=n,n}function W4n(t){if(!t)return null;let e=typeof t.path=="string"?t.path:typeof t.file_path=="string"?t.file_path:null;return e?Array.isArray(t.edits)&&t.edits.length>0&&t.edits.every(n=>typeof n?.oldText=="string"&&typeof n?.newText=="string")?{path:e,edits:t.edits}:typeof t.oldText=="string"&&typeof t.newText=="string"?{path:e,edits:[{oldText:t.oldText,newText:t.newText}]}:null:null}function zji(t,e,n){let r=rP(su(t?.file_path??t?.path),e,n);return`${e.fg("toolTitle",e.bold("edit"))} ${r}`}function Kji(t,e,n,r,i){let s=su(t?.file_path??t?.path),o=e&&!("error"in e)?e.diff:void 0,a=e&&"error"in e?e.error:void 0;if(i){let u=n.content.filter(l=>l.type==="text").map(l=>l.text||"").join(` +`);return!u||u===a?void 0:r.fg("error",u)}let c=n.details?.diff;if(c&&c!==o)return FV(c,{filePath:s??void 0})}function Jji(t,e,n){return t?"error"in t?r=>n.bg("toolErrorBg",r):r=>n.bg("toolSuccessBg",r):e?r=>n.bg("toolErrorBg",r):r=>n.bg("toolPendingBg",r)}function H4n(t,e,n,r){if(t.setBgFn(Jji(t.preview,t.settledError,n)),t.clear(),t.addChild(new Et(zji(e,n,r),0,0)),!t.preview)return t;let i="error"in t.preview?n.fg("error",t.preview.error):FV(t.preview.diff);return t.addChild(new Tt(1)),t.addChild(new Et(i,0,0)),t}function q4n(t,e,n){let r=t.preview,i=r===void 0||("error"in r&&"error"in e?r.error!==e.error:"error"in r!="error"in e)||!("error"in r)&&!("error"in e)&&(r.diff!==e.diff||r.firstChangedLine!==e.firstChangedLine);return t.preview=e,t.previewArgsKey=n,t.previewPending=!1,i}var x1e,fmt=v(()=>{p();Tr();hmt();E1e();ok();x1e={renderCall(t,e,n){let r=Yji(n.state,n.lastComponent),i=W4n(t),s=i?JSON.stringify({path:i.path,edits:i.edits}):void 0;if(r.previewArgsKey!==s&&(r.preview=void 0,r.previewArgsKey=s,r.previewPending=!1,r.settledError=!1),n.argsComplete&&i&&!r.preview&&!r.previewPending){r.previewPending=!0;let o=s;Q4n(i.path,i.edits,n.cwd).then(a=>{r.previewArgsKey===o&&(q4n(r,a,o),n.invalidate())})}return H4n(r,t,e,n.cwd)},renderResult(t,e,n,r){let i=r.state.callComponent,s=W4n(r.args),o=s?JSON.stringify({path:s.path,edits:s.edits}):void 0,a=t,c=r.isError?void 0:a.details?.diff,u=!1;i&&(typeof c=="string"&&(u=q4n(i,{diff:c,firstChangedLine:a.details?.firstChangedLine},o)||u),i.settledError!==r.isError&&(i.settledError=r.isError,u=!0),u&&H4n(i,r.args,n,r.cwd));let l=Kji(r.args,i?.preview,a,n,r.isError),d=r.lastComponent??new gn;return d.clear(),l&&(d.addChild(new Tt(1)),d.addChild(new Et(l,1,0))),d}}});function V4n(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.oldText=="string"&&typeof e.newText=="string"}function tVi(t){if(!t||typeof t!="object")return t;let e=t;if(typeof e.edits=="string")try{let a=JSON.parse(e.edits);Array.isArray(a)?e.edits=a:V4n(a)&&(e.edits=[a])}catch{}else V4n(e.edits)&&(e.edits=[e.edits]);let n=e;if(typeof n.oldText!="string"||typeof n.newText!="string")return e;let r=Array.isArray(n.edits)?[...n.edits]:[];r.push({oldText:n.oldText,newText:n.newText});let{oldText:i,newText:s,...o}=n;return{...o,edits:r}}function nVi(t){if(!Array.isArray(t.edits)||t.edits.length===0)throw new Error("Edit tool input is invalid. edits must contain at least one replacement.");return{path:t.path,edits:t.edits}}function UV(t,e){let n=e?.operations??eVi;return{name:"edit",label:"edit",description:"Edit a single file using exact text replacement. Every edits[].oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit instead of emitting overlapping edits. Do not include large unchanged regions just to connect distant changes.",promptSnippet:j4n.snippet,promptGuidelines:[...j4n.guidelines],parameters:Zji,constrainedSampling:{type:"json_schema",strict:"prefer"},renderShell:"self",prepareArguments:tVi,async execute(r,i,s,o,a){let{path:c,edits:u}=nVi(i),l=Xh(c,a?.cwd||t);return iP(l,async()=>{let d=()=>{if(s?.aborted)throw new Error("Operation aborted")};d();try{await n.access(l)}catch(w){d();let k=w instanceof Error&&"code"in w?`Error code: ${w.code}`:String(w);throw new Error(`Could not edit file: ${c}. ${k}.`)}d();let h=(await n.readFile(l)).toString("utf-8");d();let{bom:f,text:g}=dre(h),A=M4n(g),y=$se(g),{baseContent:E,newContent:_}=pmt(y,u,c);d();let S=f+O4n(_,A);await n.writeFile(l,S),d();let C=Hse(E,_),I=y1e(c,E,_);return{content:[{type:"text",text:`Successfully replaced ${u.length} block(s) in ${c}.`}],details:{diff:C.diff,patch:I,firstChangedLine:C.firstChangedLine}}})},...x1e}}function GV(t,e){return cm(UV(t,e))}var gmt,QV,Xji,Zji,j4n,eVi,Amt=v(()=>{p();gmt=require("fs"),QV=require("fs/promises");Vm();nm();E1e();_1e();ww();fmt();bS();Xji=Ne.Object({oldText:Ne.String({description:"Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call."}),newText:Ne.String({description:"Replacement text for this targeted edit."})},{}),Zji=Ne.Object({path:Ne.String({description:"Path to the file to edit (relative or absolute)"}),edits:Ne.Array(Xji,{description:"One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead."})},{}),j4n={snippet:"Make precise file edits with exact text replacement, including multiple disjoint edits in one call",guidelines:["Use edit for precise changes (edits[].oldText must match exactly)","When changing multiple separate locations in one file, use one edit call with multiple entries in edits[] instead of multiple edit calls","Each edits[].oldText is matched against the original file, not after earlier edits are applied. Do not emit overlapping or nested edits. Merge nearby changes into one edit.","Keep edits[].oldText as small as possible while still being unique in the file. Do not pad with large unchanged regions."]};eVi={readFile:t=>(0,QV.readFile)(t),writeFile:(t,e)=>(0,QV.writeFile)(t,e,"utf-8"),access:t=>(0,QV.access)(t,gmt.constants.R_OK|gmt.constants.W_OK)}});async function $Q(t,e=void 0,n={}){let r=n.maxRetries===void 0||!Number.isFinite(n.maxRetries)?2:Math.max(0,Math.floor(n.maxRetries)),i=n.retryOnStatus??!0,s=e?.signal??void 0,o=n.timeoutMs!==void 0&&n.timeoutMs>0?AbortSignal.timeout(n.timeoutMs):void 0,a=n.attemptTimeoutMs!==void 0&&n.attemptTimeoutMs>0?n.attemptTimeoutMs:void 0;for(let c=0;;c++){s?.throwIfAborted(),o?.throwIfAborted();let u=a?AbortSignal.timeout(a):void 0,l=[s,o,u].filter(m=>m!==void 0),d=l.length>1?AbortSignal.any(l):l[0];try{let m=await fetch(t,d?{...e,signal:d}:e);if(!(i&&rVi.has(m.status)&&c=r)throw m}}}var rVi,S1e=v(()=>{p();rVi=new Set([408,425,429,500,502,503,504])});function oVi(){let t=process.env.PI_OFFLINE;return t?t==="1"||t.toLowerCase()==="true"||t.toLowerCase()==="yes":!1}function aVi(t){try{let e=(0,ymt.spawnSync)(t,["--version"],{stdio:"pipe"});return e.error===void 0||e.error===null}catch{return!1}}function cVi(t){let e=Emt[t];if(!e)return null;let n=(0,Tw.join)(qse,e.binaryName+((0,WQ.platform)()==="win32"?".exe":""));if((0,lm.existsSync)(n))return n;let r=e.systemBinaryNames??[e.binaryName];for(let i of r)if(aVi(i))return i;return null}async function lVi(t){let e=await $Q(`https://github.com/${t}/releases/latest`,{headers:{"User-Agent":`${hn}-coding-agent`},redirect:"manual"},{timeoutMs:iVi});try{await e.body?.cancel()}catch{}let n=e.status>=300&&e.status<400?e.headers.get("location"):null;if(!n)throw new Error(`Failed to resolve latest ${t} release: HTTP ${e.status} without redirect`);let r=new URL(n,"https://github.com").pathname.split("/").pop();if(!r||!n.includes("/releases/tag/"))throw new Error(`Failed to resolve latest ${t} release: unexpected redirect to ${n}`);return decodeURIComponent(r).replace(/^v/,"")}async function uVi(t,e){let n=await $Q(t,void 0,{timeoutMs:sVi});if(!n.ok)throw new Error(`Download failed with HTTP ${n.status}: ${t}`);if(!n.body)throw new Error("No response body");let r=(0,lm.createWriteStream)(e);await(0,z4n.pipeline)(Y4n.Readable.fromWeb(n.body),r)}function dVi(t,e){let n=[t];for(;n.length>0;){let r=n.pop();if(!r)continue;let i=(0,lm.readdirSync)(r,{withFileTypes:!0});for(let s of i){let o=(0,Tw.join)(r,s.name);if(s.isFile()&&s.name===e)return o;s.isDirectory()&&n.push(o)}}return null}function pVi(t){if(t.error?.message)return t.error.message;let e=t.stderr?.toString().trim();if(e)return e;let n=t.stdout?.toString().trim();return n||`exit status ${t.status??"unknown"}`}function jse(t,e){let n=(0,ymt.spawnSync)(t,e,{stdio:"pipe"});return!n.error&&n.status===0?null:`${t}: ${pVi(n)}`}function mVi(t,e,n){let r=jse("tar",["xzf",t,"-C",e]);if(r)throw new Error(`Failed to extract ${n}: ${r}`)}function hVi(){let t=process.env.SystemRoot??process.env.WINDIR;if(t){let e=(0,Tw.join)(t,"System32","tar.exe");if((0,lm.existsSync)(e))return e}return"tar.exe"}function fVi(t,e,n){let r=[];if((0,WQ.platform)()==="win32"){let i=jse(hVi(),["xf",t,"-C",e]);if(!i)return;r.push(i);let o=jse("powershell.exe",["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-Command","& { param($archive, $destination) $ErrorActionPreference = 'Stop'; Expand-Archive -LiteralPath $archive -DestinationPath $destination -Force }",t,e]);if(!o)return;r.push(o)}else{let i=jse("unzip",["-q",t,"-d",e]);if(!i)return;r.push(i);let s=jse("tar",["xf",t,"-C",e]);if(!s)return;r.push(s)}throw new Error(`Failed to extract ${n}: ${r.join("; ")}`)}async function gVi(t){let e=Emt[t];if(!e)throw new Error(`Unknown tool: ${t}`);let n=(0,WQ.platform)(),r=(0,WQ.arch)(),i=t==="fd"&&n==="darwin"&&r==="x64"?"10.3.0":await lVi(e.repo),s=e.getAssetName(i,n,r);if(!s)throw new Error(`Unsupported platform: ${n}/${r}`);(0,lm.mkdirSync)(qse,{recursive:!0});let o=`https://github.com/${e.repo}/releases/download/${e.tagPrefix}${i}/${s}`,a=(0,Tw.join)(qse,s),c=n==="win32"?".exe":"",u=(0,Tw.join)(qse,e.binaryName+c);await uVi(o,a);let l=(0,Tw.join)(qse,`extract_tmp_${e.binaryName}_${process.pid}_${Date.now()}_${Math.random().toString(36).slice(2,10)}`);(0,lm.mkdirSync)(l,{recursive:!0});try{if(s.endsWith(".tar.gz"))mVi(a,l,s);else if(s.endsWith(".zip"))fVi(a,l,s);else throw new Error(`Unsupported archive format: ${s}`);let d=e.binaryName+c,m=(0,Tw.join)(l,s.replace(/\.(tar\.gz|zip)$/,"")),f=[(0,Tw.join)(m,d),(0,Tw.join)(l,d)].find(g=>(0,lm.existsSync)(g));if(f||(f=dVi(l,d)??void 0),f)(0,lm.renameSync)(f,u);else throw new Error(`Binary not found in archive: expected ${d} under ${l}`);n!=="win32"&&(0,lm.chmodSync)(u,493)}finally{(0,lm.rmSync)(a,{force:!0}),(0,lm.rmSync)(l,{recursive:!0,force:!0})}return u}async function HQ(t,e){let n=cVi(t);if(n)return n;let r=Emt[t];if(r){if(oVi()){e?.({type:"warning",message:`${r.name} not found. Offline mode enabled, skipping download.`});return}if((0,WQ.platform)()==="android"){let i=AVi[t]??t;e?.({type:"warning",message:`${r.name} not found. Install with: pkg install ${i}`});return}e?.({type:"info",message:`${r.name} not found. Downloading...`});try{let i=await gVi(t);return e?.({type:"info",message:`${r.name} installed to ${i}`}),i}catch(i){let s=[];for(let o=i,a=0;o instanceof Error&&a<5;o=o.cause,a++)s.includes(o.message)||s.push(o.message);e?.({type:"warning",message:`Failed to download ${r.name}: ${s.length>0?s.join(": "):String(i)}`});return}}}var ymt,lm,WQ,Tw,Y4n,z4n,qse,iVi,sVi,Emt,AVi,C1e=v(()=>{p();ymt=require("child_process"),lm=require("fs"),WQ=require("os"),Tw=require("path"),Y4n=require("stream"),z4n=require("stream/promises");Qs();S1e();qse=P8(),iVi=1e4,sVi=12e4;Emt={fd:{name:"fd",repo:"sharkdp/fd",binaryName:"fd",systemBinaryNames:["fd","fdfind"],tagPrefix:"v",getAssetName:(t,e,n)=>e==="darwin"?`fd-v${t}-${n==="arm64"?"aarch64":"x86_64"}-apple-darwin.tar.gz`:e==="linux"?`fd-v${t}-${n==="arm64"?"aarch64":"x86_64"}-unknown-linux-musl.tar.gz`:e==="win32"?`fd-v${t}-${n==="arm64"?"aarch64":"x86_64"}-pc-windows-msvc.zip`:null},rg:{name:"ripgrep",repo:"BurntSushi/ripgrep",binaryName:"rg",tagPrefix:"",getAssetName:(t,e,n)=>e==="darwin"?`ripgrep-${t}-${n==="arm64"?"aarch64":"x86_64"}-apple-darwin.tar.gz`:e==="linux"?`ripgrep-${t}-${n==="arm64"?"aarch64":"x86_64"}-unknown-linux-musl.tar.gz`:e==="win32"?`ripgrep-${t}-${n==="arm64"?"aarch64":"x86_64"}-pc-windows-msvc.zip`:null}};AVi={fd:"fd",rg:"ripgrep"}});function yVi(t,e){let n=su(t?.pattern),r=su(t?.path),i=r!==null?Ose(r||"."):null,s=t?.limit,o=GQ(e),a=e.fg("toolTitle",e.bold("find"))+" "+(n===null?o:e.fg("accent",n||""))+e.fg("toolOutput",` in ${i===null?o:i}`);return s!==void 0&&(a+=e.fg("toolOutput",` (limit ${s})`)),a}function EVi(t,e,n,r){let i=Lb(t,r).trim(),s="";if(i){let c=i.split(` +`),u=e.expanded?c.length:20,l=c.slice(0,u),d=c.length-u;s+=` +${l.map(m=>n.fg("toolOutput",m)).join(` +`)}`,d>0&&(s+=`${n.fg("muted",` +... (${d} more lines,`)} ${nr("app.tools.expand","to expand")}${n.fg("muted",")")}`)}let o=t.details?.resultLimitReached,a=t.details?.truncation;if(o||a?.truncated){let c=[];o&&c.push(`${o} results limit`),a?.truncated&&c.push(`${Ua(a.maxBytes??51200)} limit`),s+=` +${n.fg("warning",`[Truncated: ${c.join(", ")}]`)}`}return s}var I1e,bmt=v(()=>{p();Tr();ha();ok();Eg();I1e={renderCall(t,e,n){let r=n.lastComponent??new Et("",0,0);return r.setText(yVi(t,e)),r},renderResult(t,e,n,r){let i=r.lastComponent??new Et("",0,0);return i.setText(EVi(t,e,n,r.showImages)),i}}});function K4n(t,e,n=w1e.default){let r=t.endsWith(n.sep)||n.sep==="\\"&&t.endsWith("/"),s=(n.isAbsolute(t)?n.relative(e,t):t).split(n.sep).join("/");return r&&!s.endsWith("/")?`${s}/`:s}function $V(t,e){let n=e?.operations;return{name:"find",label:"find",description:`Search for files by glob pattern. Returns matching file paths relative to the search directory. Respects .gitignore. Output is truncated to ${J4n} results or ${51200/1024}KB (whichever is hit first).`,promptSnippet:_Vi.snippet,parameters:bVi,async execute(r,{pattern:i,path:s,limit:o},a,c,u){return new Promise((l,d)=>{if(a?.aborted){d(new Error("Operation aborted"));return}let m=!1,h,f=A=>{m||(m=!0,a?.removeEventListener("abort",g),h=void 0,A())},g=()=>{h?.(),f(()=>d(new Error("Operation aborted")))};a?.addEventListener("abort",g,{once:!0}),(async()=>{try{let A=Xh(s||".",u?.cwd||t),y=o??J4n,E=n??xVi;if(n?.glob){if(!await E.exists(A)){f(()=>d(new Error(`Path not found: ${A}`)));return}if(a?.aborted){f(()=>d(new Error("Operation aborted")));return}let $=await E.glob(i,A,{ignore:["**/node_modules/**","**/.git/**"],limit:y});if(a?.aborted){f(()=>d(new Error("Operation aborted")));return}if($.length===0){f(()=>l({content:[{type:"text",text:"No files found matching pattern"}],details:void 0}));return}let G=$.map(Ae=>K4n(Ae,A)),q=G.length>=y,ce=G.join(` +`),Y=wb(ce,{maxLines:Number.MAX_SAFE_INTEGER}),z=Y.content,j={},se=[];q&&(se.push(`${y} results limit reached`),j.resultLimitReached=y),Y.truncated&&(se.push(`${Ua(51200)} limit reached`),j.truncation=Y),se.length>0&&(z+=` + +[${se.join(". ")}]`),f(()=>l({content:[{type:"text",text:z}],details:Object.keys(j).length>0?j:void 0}));return}let _=await HQ("fd");if(a?.aborted){f(()=>d(new Error("Operation aborted")));return}if(!_){f(()=>d(new Error("fd is not available and could not be downloaded")));return}let S=["--glob","--color=never","--hidden"],C=!1;for(let $=A;;){if(await Iw(w1e.default.join($,".git"))){C=!0;break}let G=w1e.default.dirname($);if(G===$)break;$=G}C||S.push("--no-require-git"),S.push("--max-results",String(y));let I=i;i.includes("/")&&(S.push("--full-path"),!i.startsWith("/")&&!i.startsWith("**/")&&i!=="**"&&(I=`**/${i}`),process.platform==="win32"&&(I=I.replaceAll("/",String.raw`[/\\]`))),S.push("--",I,A);let w=(0,Z4n.spawn)(_,S,{stdio:["ignore","pipe","pipe"]}),k=(0,X4n.createInterface)({input:w.stdout}),N="",O=[];h=()=>{w.killed||w.kill()};let W=()=>{k.close()};w.stderr?.on("data",$=>{N+=$.toString()}),k.on("line",$=>{O.push($)}),w.on("error",$=>{W(),f(()=>d(new Error(`Failed to run fd: ${$.message}`)))}),w.on("close",$=>{if(W(),a?.aborted){f(()=>d(new Error("Operation aborted")));return}let G=O.join(` +`);if($!==0){let De=N.trim()||`fd exited with code ${$}`;if(!G){f(()=>d(new Error(De)));return}}if(!G){f(()=>l({content:[{type:"text",text:"No files found matching pattern"}],details:void 0}));return}let q=[];for(let De of O){let Pe=De.replace(/\r$/,"").trim();Pe&&q.push(K4n(Pe,A))}let ce=q.length>=y,Y=q.join(` +`),z=wb(Y,{maxLines:Number.MAX_SAFE_INTEGER}),j=z.content,se={},Ae=[];ce&&(Ae.push(`${y} results limit reached. Use limit=${y*2} for more, or refine pattern`),se.resultLimitReached=y),z.truncated&&(Ae.push(`${Ua(51200)} limit reached`),se.truncation=z),Ae.length>0&&(j+=` + +[${Ae.join(". ")}]`),f(()=>l({content:[{type:"text",text:j}],details:Object.keys(se).length>0?se:void 0}))})}catch(A){if(a?.aborted){f(()=>d(new Error("Operation aborted")));return}let y=A instanceof Error?A:new Error(String(A));f(()=>d(y))}})()})},...I1e}}function WV(t,e){return cm($V(t,e))}var X4n,Z4n,w1e,bVi,_Vi,J4n,xVi,_mt=v(()=>{p();X4n=require("node:readline"),Z4n=require("child_process"),w1e=Ot(require("path"),1);Vm();C1e();ww();bmt();bS();Eg();bVi=Ne.Object({pattern:Ne.String({description:"Glob pattern to match files, e.g. '*.ts', '**/*.json', or 'src/**/*.spec.ts'"}),path:Ne.Optional(Ne.String({description:"Directory to search in (default: current directory)"})),limit:Ne.Optional(Ne.Number({description:"Maximum number of results (default: 1000)"}))}),_Vi={snippet:"Find files by glob pattern (respects .gitignore)",guidelines:[]},J4n=1e3,xVi={exists:Iw,glob:()=>[]}});function SVi(t,e){let n=su(t?.pattern),r=su(t?.path),i=r!==null?Ose(r||"."):null,s=su(t?.glob),o=t?.limit,a=GQ(e),c=e.fg("toolTitle",e.bold("grep"))+" "+(n===null?a:e.fg("accent",`/${n||""}/`))+e.fg("toolOutput",` in ${i===null?a:i}`);return s&&(c+=e.fg("toolOutput",` (${s})`)),o!==void 0&&(c+=e.fg("toolOutput",` limit ${o}`)),c}function CVi(t,e,n,r){let i=Lb(t,r).trim(),s="";if(i){let u=i.split(` +`),l=e.expanded?u.length:15,d=u.slice(0,l),m=u.length-l;s+=` +${d.map(h=>n.fg("toolOutput",h)).join(` +`)}`,m>0&&(s+=`${n.fg("muted",` +... (${m} more lines,`)} ${nr("app.tools.expand","to expand")}${n.fg("muted",")")}`)}let o=t.details?.matchLimitReached,a=t.details?.truncation,c=t.details?.linesTruncated;if(o||a?.truncated||c){let u=[];o&&u.push(`${o} matches limit`),a?.truncated&&u.push(`${Ua(a.maxBytes??51200)} limit`),c&&u.push("some lines truncated"),s+=` +${n.fg("warning",`[Truncated: ${u.join(", ")}]`)}`}return s}var T1e,xmt=v(()=>{p();Tr();ha();ok();Eg();T1e={renderCall(t,e,n){let r=n.lastComponent??new Et("",0,0);return r.setText(SVi(t,e)),r},renderResult(t,e,n,r){let i=r.lastComponent??new Et("",0,0);return i.setText(CVi(t,e,n,r.showImages)),i}}});function HV(t,e){let n=e?.operations;return{name:"grep",label:"grep",description:`Search file contents for a pattern. Returns matching lines with file paths and line numbers. Respects .gitignore. Output is truncated to ${t8n} matches or ${51200/1024}KB (whichever is hit first). Long lines are truncated to ${500} chars.`,promptSnippet:wVi.snippet,parameters:IVi,async execute(r,{pattern:i,path:s,glob:o,ignoreCase:a,literal:c,context:u,limit:l},d,m,h){return new Promise((f,g)=>{if(d?.aborted){g(new Error("Operation aborted"));return}let A=!1,y=E=>{A||(A=!0,E())};(async()=>{try{let E=await HQ("rg");if(!E){y(()=>g(new Error("ripgrep (rg) is not available and could not be downloaded")));return}let _=Xh(s||".",h?.cwd||t),S=n??TVi,C;try{C=await S.isDirectory(_)}catch{y(()=>g(new Error(`Path not found: ${_}`)));return}let I=u&&u>0?u:0,w=Math.max(1,l??t8n),k=ne=>{if(C){let Z=Smt.default.relative(_,ne);if(Z&&!Z.startsWith(".."))return Z.replace(/\\/g,"/")}return Smt.default.basename(ne)},N=new Map,O=async ne=>{let Z=N.get(ne);if(!Z){try{Z=(await S.readFile(ne)).replace(/\r\n/g,` `).replace(/\r/g,` `).split(` -`)}catch{J=[]}N.set(ne,J)}return J},G=["--json","--line-number","--color=never","--hidden"];a&&G.push("--ignore-case"),c&&G.push("--fixed-strings"),o&&G.push("--glob",o),G.push("--",s,S);let $=(0,a0n.spawn)(b,G,{stdio:["ignore","pipe","pipe"]}),Q=(0,o0n.createInterface)({input:$.stdout}),H="",oe=0,re=!1,Z=!1,q=!1,ce=!1,be=[],Be=()=>{Q.close(),d?.removeEventListener("abort",Re)},Me=(ne=!1)=>{$.killed||(ce=ne,$.kill())},Re=()=>{q=!0,Me()};d?.addEventListener("abort",Re,{once:!0}),$.stderr?.on("data",ne=>{H+=ne.toString()});let se=async(ne,J)=>{let te=R(ne),j=await P(ne);if(!j.length)return[`${te}:${J}: (unable to read file)`];let X=[],ae=x>0?Math.max(1,J-x):J,me=x>0?Math.min(j.length,J+x):J;for(let Ae=ae;Ae<=me;Ae++){let ye=(j[Ae-1]??"").replace(/\r/g,""),Ie=Ae===J,{text:Ee,wasTruncated:Te}=i5(ye);Te&&(Z=!0),Ie?X.push(`${te}:${Ae}: ${Ee}`):X.push(`${te}-${Ae}- ${Ee}`)}return X},ie=[];Q.on("line",ne=>{if(!ne.trim()||oe>=w)return;let J;try{J=JSON.parse(ne)}catch{return}if(J.type==="match"){oe++;let te=J.data?.path?.text,j=J.data?.line_number,X=J.data?.lines?.text;te&&typeof j=="number"&&ie.push({filePath:te,lineNumber:j,lineText:X}),oe>=w&&(re=!0,Me(!0))}}),$.on("error",ne=>{Be(),y(()=>g(new Error(`Failed to run ripgrep: ${ne.message}`)))}),$.on("close",async ne=>{if(Be(),q){y(()=>g(new Error("Operation aborted")));return}if(!ce&&ne!==0&&ne!==1){let me=H.trim()||`ripgrep exited with code ${ne}`;y(()=>g(new Error(me)));return}if(oe===0){y(()=>f({content:[{type:"text",text:"No matches found"}],details:void 0}));return}for(let me of ie)if(x===0&&me.lineText!==void 0){let Ae=R(me.filePath),ue=me.lineText.replace(/\r\n/g,` -`).replace(/\r/g,"").replace(/\n$/,""),{text:ye,wasTruncated:Ie}=i5(ue);Ie&&(Z=!0),be.push(`${Ae}:${me.lineNumber}: ${ye}`)}else{let Ae=await se(me.filePath,me.lineNumber);be.push(...Ae)}let J=be.join(` -`),te=YE(J,{maxLines:Number.MAX_SAFE_INTEGER}),j=te.content,X={},ae=[];re&&(ae.push(`${w} matches limit reached. Use limit=${w*2} for more, or refine pattern`),X.matchLimitReached=w),te.truncated&&(ae.push(`${ma(51200)} limit reached`),X.truncation=te),Z&&(ae.push(`Some lines truncated to ${500} chars. Use read tool to see full lines`),X.linesTruncated=!0),ae.length>0&&(j+=` - -[${ae.join(". ")}]`),y(()=>f({content:[{type:"text",text:j}],details:Object.keys(X).length>0?X:void 0}))})}catch(b){y(()=>g(b))}})()})},...BCe}}function z5(t,e){return cp(K5(t,e))}p();var MCe=require("node:fs/promises"),l0n=Gt(require("path"),1);p();function lys(t,e,n){let r=t?.limit,s=aD(fl(t?.path),e,n,{emptyFallback:"."}),i=`${e.fg("toolTitle",e.bold("ls"))} ${s}`;return r!==void 0&&(i+=e.fg("toolOutput",` (limit ${r})`)),i}function uys(t,e,n,r){let s=eb(t,r).trim(),i="";if(s){let c=s.split(` -`),u=e.expanded?c.length:20,l=c.slice(0,u),d=c.length-u;i+=` -${l.map(h=>n.fg("toolOutput",h)).join(` -`)}`,d>0&&(i+=`${n.fg("muted",` -... (${d} more lines,`)} ${er("app.tools.expand","to expand")}${n.fg("muted",")")}`)}let o=t.details?.entryLimitReached,a=t.details?.truncation;if(o||a?.truncated){let c=[];o&&c.push(`${o} entries limit`),a?.truncated&&c.push(`${ma(a.maxBytes??51200)} limit`),i+=` -${n.fg("warning",`[Truncated: ${c.join(", ")}]`)}`}return i}var OCe={renderCall(t,e,n){let r=n.lastComponent??new yt("",0,0);return r.setText(lys(t,e,n.cwd)),r},renderResult(t,e,n,r){let s=r.lastComponent??new yt("",0,0);return s.setText(uys(t,e,n,r.showImages)),s}};var dys=Oe.Object({path:Oe.Optional(Oe.String({description:"Directory to list (default: current directory)"})),limit:Oe.Optional(Oe.Number({description:"Maximum number of entries to return (default: 500)"}))}),pys={snippet:"List directory contents",guidelines:[]},c0n=500,hys={exists:aI,stat:MCe.stat,readdir:MCe.readdir};function J5(t,e){let n=e?.operations??hys;return{name:"ls",label:"ls",description:`List directory contents. Returns entries sorted alphabetically, with '/' suffix for directories. Includes dotfiles. Output is truncated to ${c0n} entries or ${51200/1024}KB (whichever is hit first).`,promptSnippet:pys.snippet,parameters:dys,async execute(r,{path:s,limit:i},o,a,c){return new Promise((u,l)=>{if(o?.aborted){l(new Error("Operation aborted"));return}let d=()=>l(new Error("Operation aborted"));o?.addEventListener("abort",d,{once:!0}),(async()=>{try{let h=$h(s||".",c?.cwd||t),m=i??c0n;if(!await n.exists(h)){l(new Error(`Path not found: ${h}`));return}if(!(await n.stat(h)).isDirectory()){l(new Error(`Not a directory: ${h}`));return}let g;try{g=await n.readdir(h)}catch(w){l(new Error(`Cannot read directory: ${w.message}`));return}g.sort((w,R)=>w.toLowerCase().localeCompare(R.toLowerCase()));let A=[],y=!1;for(let w of g){if(A.length>=m){y=!0;break}let R=l0n.default.join(h,w),N="";try{(await n.stat(R)).isDirectory()&&(N="/")}catch{continue}A.push(w+N)}if(o?.removeEventListener("abort",d),A.length===0){u({content:[{type:"text",text:"(empty directory)"}],details:void 0});return}let b=A.join(` -`),S=YE(b,{maxLines:Number.MAX_SAFE_INTEGER}),C=S.content,I={},x=[];y&&(x.push(`${m} entries limit reached. Use limit=${m*2} for more`),I.entryLimitReached=m),S.truncated&&(x.push(`${ma(51200)} limit reached`),I.truncation=S),x.length>0&&(C+=` - -[${x.join(". ")}]`),u({content:[{type:"text",text:C}],details:Object.keys(I).length>0?I:void 0})}catch(h){o?.removeEventListener("abort",d),l(h)}})()})},...OCe}}function X5(t,e){return cp(J5(t,e))}p();var mys=`try { [Console]::OutputEncoding=[System.Text.Encoding]::UTF8 } catch {} -`,u0n={snippet:"Execute PowerShell commands",guidelines:["You can inspect PI_* environment variables for current model and session details."]};function LCe(){let t=jZe("PowerShell",O0e);return{exec:(e,n,r)=>t.exec(`${mys}${e}`,n,r)}}var fys={name:"powershell",label:"powershell",shellName:"PowerShell",prompt:"PS>",promptSnippet:u0n.snippet,promptGuidelines:u0n.guidelines,tempFilePrefix:"pi-powershell"};function Z5(t,e){return YZe(t,fys,{...e,operations:e?.operations??LCe()})}function Eee(t,e){let n=Z5(t,e),r=cp(n);return Object.assign(r,{promptSnippet:n.promptSnippet,promptGuidelines:n.promptGuidelines}),r}p();var g0n=require("fs"),UCe=require("fs/promises");p();var h0n=require("node:fs/promises"),d0n=4100,net=[137,80,78,71,13,10,26,10];function gys(t){return p0n(t,[255,216,255])?t[3]===247?null:"image/jpeg":p0n(t,net)?Ays(t)&&!yys(t)?"image/png":null:bL(t,0,"GIF")?"image/gif":bL(t,0,"RIFF")&&bL(t,8,"WEBP")?"image/webp":bL(t,0,"BM")&&Eys(t)?"image/bmp":null}async function e4(t){let e=await(0,h0n.open)(t,"r");try{let n=Buffer.alloc(d0n),{bytesRead:r}=await e.read(n,0,d0n,0);return gys(n.subarray(0,r))}finally{await e.close()}}function Ays(t){return t.length>=16&&m0n(t,net.length)===13&&bL(t,12,"IHDR")}function yys(t){let e=net.length;for(;e+8<=t.length;){let n=m0n(t,e),r=e+4;if(bL(t,r,"acTL"))return!0;if(bL(t,r,"IDAT"))return!1;let s=e+8+n+4;if(s<=e||s>t.length)return!1;e=s}return!1}function Eys(t){if(t.length<26)return!1;let e=tet(t,2),n=tet(t,10),r=tet(t,14);if(e!==0&&e<26||n<14+r||e!==0&&n>=e)return!1;let s,i;if(r===12)s=FCe(t,22),i=FCe(t,24);else if(r>=40&&r<=124){if(t.length<30)return!1;s=FCe(t,26),i=FCe(t,28)}else return!1;return s===1&&[1,4,8,16,24,32].includes(i)}function FCe(t,e){return(t[e]??0)+((t[e+1]??0)<<8)}function m0n(t,e){return(t[e]??0)*16777216+((t[e+1]??0)<<16)+((t[e+2]??0)<<8)+(t[e+3]??0)}function tet(t,e){return(t[e]??0)+((t[e+1]??0)<<8)+((t[e+2]??0)<<16)+(t[e+3]??0)*16777216}function p0n(t,e){return t.lengtht[r]===n)}function bL(t,e,n){if(t.length0&&t[e-1]==="";)e--;return t.slice(0,e)}function Cys(t){return t.split(Gh.sep).join("/")}function Iys(t){let e=(0,Gh.dirname)(V3()),n=(0,Gh.relative)((0,Gh.resolve)(e),(0,Gh.resolve)(t));if(n===""||n===".."||n.startsWith(`..${Gh.sep}`)||(0,Gh.isAbsolute)(n))return;let r=Cys(n);if(r==="README.md"||r.startsWith("docs/")||r.startsWith("examples/"))return{kind:"docs",label:r}}function xys(t,e){let n=fl(t?.file_path??t?.path);if(!n)return;let r=$h(n,e),s=(0,Gh.basename)(r);if(s==="SKILL.md")return{kind:"skill",label:(0,Gh.basename)((0,Gh.dirname)(r))||s};let i=Iys(r);if(i)return i;if(bys.has(s))return{kind:"resource",label:Jnn(r,e)}}function wys(t,e,n){let r=n.fg("dim",` (${ra("app.tools.expand")} to expand)`);return t.kind==="skill"?n.fg("customMessageLabel","\x1B[1m[skill]\x1B[22m ")+n.fg("customMessageText",t.label)+ret(e,n)+r:n.fg("toolTitle",n.bold(`read ${t.kind}`))+" "+n.fg("accent",t.label)+ret(e,n)+r}function Tys(t,e,n,r,s,i,o){if(!n.expanded&&!o)return"";let a=fl(t?.file_path??t?.path),c=eb(e,s),u=!o&&a?LN(a):void 0,l=u?sT(xT(c),u):c.split(` -`),d=Sys(l),h=n.expanded?d.length:10,m=d.slice(0,h),f=d.length-h,g=` -${m.map(y=>u?xT(y):r.fg("toolOutput",xT(y))).join(` +`)}catch{Z=[]}N.set(ne,Z)}return Z},W=["--json","--line-number","--color=never","--hidden"];a&&W.push("--ignore-case"),c&&W.push("--fixed-strings"),o&&W.push("--glob",o),W.push("--",i,_);let $=(0,r8n.spawn)(E,W,{stdio:["ignore","pipe","pipe"]}),G=(0,n8n.createInterface)({input:$.stdout}),q="",ce=0,Y=!1,z=!1,j=!1,se=!1,Ae=[],De=()=>{G.close(),d?.removeEventListener("abort",we)},Pe=(ne=!1)=>{$.killed||(se=ne,$.kill())},we=()=>{j=!0,Pe()};d?.addEventListener("abort",we,{once:!0}),$.stderr?.on("data",ne=>{q+=ne.toString()});let ie=async(ne,Z)=>{let te=k(ne),V=await O(ne);if(!V.length)return[`${te}:${Z}: (unable to read file)`];let ee=[],ae=I>0?Math.max(1,Z-I):Z,me=I>0?Math.min(V.length,Z+I):Z;for(let ge=ae;ge<=me;ge++){let ye=(V[ge-1]??"").replace(/\r/g,""),Se=ge===Z,{text:be,wasTruncated:Te}=Vj(ye);Te&&(z=!0),Se?ee.push(`${te}:${ge}: ${be}`):ee.push(`${te}-${ge}- ${be}`)}return ee},oe=[];G.on("line",ne=>{if(!ne.trim()||ce>=w)return;let Z;try{Z=JSON.parse(ne)}catch{return}if(Z.type==="match"){ce++;let te=Z.data?.path?.text,V=Z.data?.line_number,ee=Z.data?.lines?.text;te&&typeof V=="number"&&oe.push({filePath:te,lineNumber:V,lineText:ee}),ce>=w&&(Y=!0,Pe(!0))}}),$.on("error",ne=>{De(),y(()=>g(new Error(`Failed to run ripgrep: ${ne.message}`)))}),$.on("close",async ne=>{if(De(),j){y(()=>g(new Error("Operation aborted")));return}if(!se&&ne!==0&&ne!==1){let me=q.trim()||`ripgrep exited with code ${ne}`;y(()=>g(new Error(me)));return}if(ce===0){y(()=>f({content:[{type:"text",text:"No matches found"}],details:void 0}));return}for(let me of oe)if(I===0&&me.lineText!==void 0){let ge=k(me.filePath),ue=me.lineText.replace(/\r\n/g,` +`).replace(/\r/g,"").replace(/\n$/,""),{text:ye,wasTruncated:Se}=Vj(ue);Se&&(z=!0),Ae.push(`${ge}:${me.lineNumber}: ${ye}`)}else{let ge=await ie(me.filePath,me.lineNumber);Ae.push(...ge)}let Z=Ae.join(` +`),te=wb(Z,{maxLines:Number.MAX_SAFE_INTEGER}),V=te.content,ee={},ae=[];Y&&(ae.push(`${w} matches limit reached. Use limit=${w*2} for more, or refine pattern`),ee.matchLimitReached=w),te.truncated&&(ae.push(`${Ua(51200)} limit reached`),ee.truncation=te),z&&(ae.push(`Some lines truncated to ${500} chars. Use read tool to see full lines`),ee.linesTruncated=!0),ae.length>0&&(V+=` + +[${ae.join(". ")}]`),y(()=>f({content:[{type:"text",text:V}],details:Object.keys(ee).length>0?ee:void 0}))})}catch(E){y(()=>g(E))}})()})},...T1e}}function qV(t,e){return cm(HV(t,e))}var v1e,n8n,r8n,Smt,IVi,wVi,t8n,TVi,Cmt=v(()=>{p();v1e=require("node:fs/promises"),n8n=require("node:readline"),r8n=require("child_process"),Smt=Ot(require("path"),1);Vm();C1e();ww();xmt();bS();Eg();IVi=Ne.Object({pattern:Ne.String({description:"Search pattern (regex or literal string)"}),path:Ne.Optional(Ne.String({description:"Directory or file to search (default: current directory)"})),glob:Ne.Optional(Ne.String({description:"Filter files by glob pattern, e.g. '*.ts' or '**/*.spec.ts'"})),ignoreCase:Ne.Optional(Ne.Boolean({description:"Case-insensitive search (default: false)"})),literal:Ne.Optional(Ne.Boolean({description:"Treat pattern as literal string instead of regex (default: false)"})),context:Ne.Optional(Ne.Number({description:"Number of lines to show before and after each match (default: 0)"})),limit:Ne.Optional(Ne.Number({description:"Maximum number of matches to return (default: 100)"}))}),wVi={snippet:"Search file contents for patterns (respects .gitignore)",guidelines:[]},t8n=100,TVi={isDirectory:async t=>(await(0,v1e.stat)(t)).isDirectory(),readFile:t=>(0,v1e.readFile)(t,"utf-8")}});function vVi(t,e,n){let r=t?.limit,i=rP(su(t?.path),e,n,{emptyFallback:"."}),s=`${e.fg("toolTitle",e.bold("ls"))} ${i}`;return r!==void 0&&(s+=e.fg("toolOutput",` (limit ${r})`)),s}function RVi(t,e,n,r){let i=Lb(t,r).trim(),s="";if(i){let c=i.split(` +`),u=e.expanded?c.length:20,l=c.slice(0,u),d=c.length-u;s+=` +${l.map(m=>n.fg("toolOutput",m)).join(` +`)}`,d>0&&(s+=`${n.fg("muted",` +... (${d} more lines,`)} ${nr("app.tools.expand","to expand")}${n.fg("muted",")")}`)}let o=t.details?.entryLimitReached,a=t.details?.truncation;if(o||a?.truncated){let c=[];o&&c.push(`${o} entries limit`),a?.truncated&&c.push(`${Ua(a.maxBytes??51200)} limit`),s+=` +${n.fg("warning",`[Truncated: ${c.join(", ")}]`)}`}return s}var R1e,Imt=v(()=>{p();Tr();ha();ok();Eg();R1e={renderCall(t,e,n){let r=n.lastComponent??new Et("",0,0);return r.setText(vVi(t,e,n.cwd)),r},renderResult(t,e,n,r){let i=r.lastComponent??new Et("",0,0);return i.setText(RVi(t,e,n,r.showImages)),i}}});function jV(t,e){let n=e?.operations??NVi;return{name:"ls",label:"ls",description:`List directory contents. Returns entries sorted alphabetically, with '/' suffix for directories. Includes dotfiles. Output is truncated to ${i8n} entries or ${51200/1024}KB (whichever is hit first).`,promptSnippet:BVi.snippet,parameters:kVi,async execute(r,{path:i,limit:s},o,a,c){return new Promise((u,l)=>{if(o?.aborted){l(new Error("Operation aborted"));return}let d=()=>l(new Error("Operation aborted"));o?.addEventListener("abort",d,{once:!0}),(async()=>{try{let m=Xh(i||".",c?.cwd||t),h=s??i8n;if(!await n.exists(m)){l(new Error(`Path not found: ${m}`));return}if(!(await n.stat(m)).isDirectory()){l(new Error(`Not a directory: ${m}`));return}let g;try{g=await n.readdir(m)}catch(w){l(new Error(`Cannot read directory: ${w.message}`));return}g.sort((w,k)=>w.toLowerCase().localeCompare(k.toLowerCase()));let A=[],y=!1;for(let w of g){if(A.length>=h){y=!0;break}let k=s8n.default.join(m,w),N="";try{(await n.stat(k)).isDirectory()&&(N="/")}catch{continue}A.push(w+N)}if(o?.removeEventListener("abort",d),A.length===0){u({content:[{type:"text",text:"(empty directory)"}],details:void 0});return}let E=A.join(` +`),_=wb(E,{maxLines:Number.MAX_SAFE_INTEGER}),S=_.content,C={},I=[];y&&(I.push(`${h} entries limit reached. Use limit=${h*2} for more`),C.entryLimitReached=h),_.truncated&&(I.push(`${Ua(51200)} limit reached`),C.truncation=_),I.length>0&&(S+=` + +[${I.join(". ")}]`),u({content:[{type:"text",text:S}],details:Object.keys(C).length>0?C:void 0})}catch(m){o?.removeEventListener("abort",d),l(m)}})()})},...R1e}}function VV(t,e){return cm(jV(t,e))}var k1e,s8n,kVi,BVi,i8n,NVi,wmt=v(()=>{p();k1e=require("node:fs/promises"),s8n=Ot(require("path"),1);Vm();ww();Imt();bS();Eg();kVi=Ne.Object({path:Ne.Optional(Ne.String({description:"Directory to list (default: current directory)"})),limit:Ne.Optional(Ne.Number({description:"Maximum number of entries to return (default: 500)"}))}),BVi={snippet:"List directory contents",guidelines:[]},i8n=500,NVi={exists:Iw,stat:k1e.stat,readdir:k1e.readdir}});function B1e(){let t=umt("PowerShell",cRe);return{exec:(e,n,r)=>t.exec(`${DVi}${e}`,n,r)}}function YV(t,e){return dmt(t,PVi,{...e,operations:e?.operations??B1e()})}function Vse(t,e){let n=YV(t,e),r=cm(n);return Object.assign(r,{promptSnippet:n.promptSnippet,promptGuidelines:n.promptGuidelines}),r}var DVi,o8n,PVi,Tmt=v(()=>{p();pw();Qse();bS();DVi=`try { [Console]::OutputEncoding=[System.Text.Encoding]::UTF8 } catch {} +`,o8n={snippet:"Execute PowerShell commands",guidelines:["You can inspect PI_* environment variables for current model and session details."]};PVi={name:"powershell",label:"powershell",shellName:"PowerShell",prompt:"PS>",promptSnippet:o8n.snippet,promptGuidelines:o8n.guidelines,tempFilePrefix:"pi-powershell"}});function kmt(t){return c8n(t,[255,216,255])?t[3]===247?null:"image/jpeg":c8n(t,Rmt)?MVi(t)&&!OVi(t)?"image/png":null:sP(t,0,"GIF87a")||sP(t,0,"GIF89a")?"image/gif":sP(t,0,"RIFF")&&sP(t,8,"WEBP")?"image/webp":sP(t,0,"BM")&&LVi(t)?"image/bmp":null}async function zV(t){let e=await(0,l8n.open)(t,"r");try{let n=Buffer.alloc(a8n),{bytesRead:r}=await e.read(n,0,a8n,0);return kmt(n.subarray(0,r))}finally{await e.close()}}function MVi(t){return t.length>=16&&u8n(t,Rmt.length)===13&&sP(t,12,"IHDR")}function OVi(t){let e=Rmt.length;for(;e+8<=t.length;){let n=u8n(t,e),r=e+4;if(sP(t,r,"acTL"))return!0;if(sP(t,r,"IDAT"))return!1;let i=e+8+n+4;if(i<=e||i>t.length)return!1;e=i}return!1}function LVi(t){if(t.length<26)return!1;let e=vmt(t,2),n=vmt(t,10),r=vmt(t,14);if(e!==0&&e<26||n<14+r||e!==0&&n>=e)return!1;let i,s;if(r===12)i=N1e(t,22),s=N1e(t,24);else if(r>=40&&r<=124){if(t.length<30)return!1;i=N1e(t,26),s=N1e(t,28)}else return!1;return i===1&&[1,4,8,16,24,32].includes(s)}function N1e(t,e){return(t[e]??0)+((t[e+1]??0)<<8)}function u8n(t,e){return(t[e]??0)*16777216+((t[e+1]??0)<<16)+((t[e+2]??0)<<8)+(t[e+3]??0)}function vmt(t,e){return(t[e]??0)+((t[e+1]??0)<<8)+((t[e+2]??0)<<16)+(t[e+3]??0)*16777216}function c8n(t,e){return t.lengtht[r]===n)}function sP(t,e,n){if(t.length{p();l8n=require("node:fs/promises"),a8n=4100,Rmt=[137,80,78,71,13,10,26,10]});function Bmt(t,e){if(t?.offset===void 0&&t?.limit===void 0)return"";let n=t.offset??1,r=t.limit!==void 0?n+t.limit-1:"";return e.fg("warning",`:${n}${r?`-${r}`:""}`)}function QVi(t,e,n){let r=rP(su(t?.file_path??t?.path),e,n);return`${e.fg("toolTitle",e.bold("read"))} ${r}${Bmt(t,e)}`}function UVi(t){let e=t.length;for(;e>0&&t[e-1]==="";)e--;return t.slice(0,e)}function GVi(t){return t.split(Zh.sep).join("/")}function $Vi(t){let e=(0,Zh.dirname)(D8()),n=(0,Zh.relative)((0,Zh.resolve)(e),(0,Zh.resolve)(t));if(n===""||n===".."||n.startsWith(`..${Zh.sep}`)||(0,Zh.isAbsolute)(n))return;let r=GVi(n);if(r==="README.md"||r.startsWith("docs/")||r.startsWith("examples/"))return{kind:"docs",label:r}}function WVi(t,e){let n=su(t?.file_path??t?.path);if(!n)return;let r=Xh(n,e),i=(0,Zh.basename)(r);if(i==="SKILL.md")return{kind:"skill",label:(0,Zh.basename)((0,Zh.dirname)(r))||i};let s=$Vi(r);if(s)return s;if(FVi.has(i))return{kind:"resource",label:MRn(r,e)}}function HVi(t,e,n){let r=n.fg("dim",` (${Ca("app.tools.expand")} to expand)`);return t.kind==="skill"?n.fg("customMessageLabel","\x1B[1m[skill]\x1B[22m ")+n.fg("customMessageText",t.label)+Bmt(e,n)+r:n.fg("toolTitle",n.bold(`read ${t.kind}`))+" "+n.fg("accent",t.label)+Bmt(e,n)+r}function qVi(t,e,n,r,i,s,o){if(!n.expanded&&!o)return"";let a=su(t?.file_path??t?.path),c=Lb(e,i),u=!o&&a?kD(a):void 0,l=u?FR(sk(c),u):c.split(` +`),d=UVi(l),m=n.expanded?d.length:10,h=d.slice(0,m),f=d.length-m,g=` +${h.map(y=>u?sk(y):r.fg("toolOutput",sk(y))).join(` `)}`;f>0&&(g+=`${r.fg("muted",` -... (${f} more lines,`)} ${er("app.tools.expand","to expand")}${r.fg("muted",")")}`);let A=e.details?.truncation;return A?.truncated&&(A.firstLineExceedsLimit?g+=` -${r.fg("warning",`[First line exceeds ${ma(A.maxBytes??51200)} limit]`)}`:A.truncatedBy==="lines"?g+=` +... (${f} more lines,`)} ${nr("app.tools.expand","to expand")}${r.fg("muted",")")}`);let A=e.details?.truncation;return A?.truncated&&(A.firstLineExceedsLimit?g+=` +${r.fg("warning",`[First line exceeds ${Ua(A.maxBytes??51200)} limit]`)}`:A.truncatedBy==="lines"?g+=` ${r.fg("warning",`[Truncated: showing ${A.outputLines} of ${A.totalLines} lines (${A.maxLines??2e3} line limit)]`)}`:g+=` -${r.fg("warning",`[Truncated: ${A.outputLines} lines shown (${ma(A.maxBytes??51200)} limit)]`)}`),g}var QCe={renderCall(t,e,n){let r=t,s=n.lastComponent??new yt("",0,0),i=n.expanded?void 0:xys(r,n.cwd);return s.setText(i?wys(i,r,e):_ys(r,e,n.cwd)),s},renderResult(t,e,n,r){let s=r.lastComponent??new yt("",0,0);return s.setText(Tys(r.args,t,e,n,r.showImages,r.cwd,r.isError)),s}};var vys=Oe.Object({path:Oe.String({description:"Path to the file to read (relative or absolute)"}),offset:Oe.Optional(Oe.Number({description:"Line number to start reading from (1-indexed)"})),limit:Oe.Optional(Oe.Number({description:"Maximum number of lines to read"}))}),f0n={snippet:"Read file contents",guidelines:["Use read to examine files instead of cat or sed."]},Rys={readFile:t=>(0,UCe.readFile)(t),access:t=>(0,UCe.access)(t,g0n.constants.R_OK),detectImageMimeType:e4};function kys(t){if(!(!t||t.input.includes("image")))return"[Current model does not support images. The image will be omitted from this request.]"}function t4(t,e){let n=e?.autoResizeImages??!0,r=e?.operations??Rys;return{name:"read",label:"read",description:`Read the contents of a file. Supports text files and images (jpg, png, gif, webp, bmp). Images are sent as attachments. For text files, output is truncated to ${2e3} lines or ${51200/1024}KB (whichever is hit first). Use offset/limit for large files. When you need the full file, continue with offset until complete.`,promptSnippet:f0n.snippet,promptGuidelines:[...f0n.guidelines],parameters:vys,constrainedSampling:oD(),async execute(s,{path:i,offset:o,limit:a},c,u,l){return new Promise((d,h)=>{if(c?.aborted){h(new Error("Operation aborted"));return}let m=!1,f=()=>{m=!0,h(new Error("Operation aborted"))};c?.addEventListener("abort",f,{once:!0}),(async()=>{try{let g=await M_n(i,l?.cwd||t);if(m||(await r.access(g),m))return;let A=r.detectImageMimeType?await r.detectImageMimeType(g):void 0,y,b,S=kys(l?.model);if(A){let C=await r.readFile(g),I=await t5(C,A,{autoResizeImages:n});if(I.ok){let x=`Read image file [${I.mimeType}]`;I.hints.length>0&&(x+=` +${r.fg("warning",`[Truncated: ${A.outputLines} lines shown (${Ua(A.maxBytes??51200)} limit)]`)}`),g}var Zh,FVi,D1e,Nmt=v(()=>{p();Zh=require("node:path");Tr();Qs();ha();pi();fc();ww();ok();Eg();FVi=new Set(["AGENTS.override.md","AGENTS.md","AGENTS.MD","CLAUDE.md","CLAUDE.MD"]);D1e={renderCall(t,e,n){let r=t,i=n.lastComponent??new Et("",0,0),s=n.expanded?void 0:WVi(r,n.cwd);return i.setText(s?HVi(s,r,e):QVi(r,e,n.cwd)),i},renderResult(t,e,n,r){let i=r.lastComponent??new Et("",0,0);return i.setText(qVi(r.args,t,e,n,r.showImages,r.cwd,r.isError)),i}}});function YVi(t){if(!(!t||t.input.includes("image")))return"[Current model does not support images. The image will be omitted from this request.]"}function KV(t,e){let n=e?.autoResizeImages??!0,r=e?.resizeOptions,i=e?.operations??VVi;return{name:"read",label:"read",description:`Read the contents of a file. Supports text files and images (jpg, png, gif, webp, bmp). Images are sent as attachments. For text files, output is truncated to ${2e3} lines or ${51200/1024}KB (whichever is hit first). Use offset/limit for large files. When you need the full file, continue with offset until complete.`,promptSnippet:d8n.snippet,promptGuidelines:[...d8n.guidelines],parameters:jVi,constrainedSampling:{type:"json_schema",strict:"prefer"},async execute(s,{path:o,offset:a,limit:c},u,l,d){return new Promise((m,h)=>{if(u?.aborted){h(new Error("Operation aborted"));return}let f=!1,g=()=>{f=!0,h(new Error("Operation aborted"))};u?.addEventListener("abort",g,{once:!0}),(async()=>{try{let A=await N4n(o,d?.cwd||t);if(f||(await i.access(A),f))return;let y=i.detectImageMimeType?await i.detectImageMimeType(A):void 0,E,_,S=YVi(d?.model);if(y){let C=await i.readFile(A),I=await $D(C,y,{autoResizeImages:n,resizeOptions:d?.model?.inputLimits?.images?.resize??r});if(I.ok){let w=`Read image file [${I.mimeType}]`;I.hints.length>0&&(w+=` ${I.hints.join(` -`)}`),S&&(x+=` -${S}`),y=[{type:"text",text:x},{type:"image",data:I.data,mimeType:I.mimeType}]}else{let x=`Read image file [${A}] -${I.message}`;S&&(x+=` -${S}`),y=[{type:"text",text:x}]}}else{let x=(await r.readFile(g)).toString("utf-8").split(` -`),w=x.length,R=o?Math.max(0,o-1):0,N=R+1;if(R>=x.length)throw new Error(`Offset ${o} is beyond end of file (${x.length} lines total)`);let P,G;if(a!==void 0){let H=Math.min(R+a,x.length);P=x.slice(R,H).join(` -`),G=H-R}else P=x.slice(R).join(` -`);let $=YE(P),Q;if($.firstLineExceedsLimit){let H=ma(Buffer.byteLength(x[R],"utf-8"));Q=`[Line ${N} is ${H}, exceeds ${ma(51200)} limit. Use bash: sed -n '${N}p' ${i} | head -c ${51200}]`,b={truncation:$}}else if($.truncated){let H=N+$.outputLines-1,oe=H+1;Q=$.content,$.truncatedBy==="lines"?Q+=` +`)}`),S&&(w+=` +${S}`),E=[{type:"text",text:w},{type:"image",data:I.data,mimeType:I.mimeType}]}else{let w=`Read image file [${y}] +${I.message}`;S&&(w+=` +${S}`),E=[{type:"text",text:w}]}}else{let w=(await i.readFile(A)).toString("utf-8").split(` +`),k=w.length,N=a?Math.max(0,a-1):0,O=N+1;if(N>=w.length)throw new Error(`Offset ${a} is beyond end of file (${w.length} lines total)`);let W,$;if(c!==void 0){let ce=Math.min(N+c,w.length);W=w.slice(N,ce).join(` +`),$=ce-N}else W=w.slice(N).join(` +`);let G=wb(W),q;if(G.firstLineExceedsLimit){let ce=Ua(Buffer.byteLength(w[N],"utf-8"));q=`[Line ${O} is ${ce}, exceeds ${Ua(51200)} limit. Use bash: sed -n '${O}p' ${o} | head -c ${51200}]`,_={truncation:G}}else if(G.truncated){let ce=O+G.outputLines-1,Y=ce+1;q=G.content,G.truncatedBy==="lines"?q+=` -[Showing lines ${N}-${H} of ${w}. Use offset=${oe} to continue.]`:Q+=` +[Showing lines ${O}-${ce} of ${k}. Use offset=${Y} to continue.]`:q+=` -[Showing lines ${N}-${H} of ${w} (${ma(51200)} limit). Use offset=${oe} to continue.]`,b={truncation:$}}else if(G!==void 0&&R+G0&&t[e-1]==="";)e--;return t.slice(0,e)}function Oys(t,e,n,r,s){let i=fl(t?.file_path??t?.path),o=fl(t?.content),a=aD(i,n,s),c=`${n.fg("toolTitle",n.bold("write"))} ${a}`;if(o===null)c+=` +[${ce} more lines in file. Use offset=${Y} to continue.]`}else q=G.content;E=[{type:"text",text:q}]}if(f)return;u?.removeEventListener("abort",g),m({content:E,details:_})}catch(A){u?.removeEventListener("abort",g),f||h(A)}})()})},...D1e}}function qQ(t,e){return cm(KV(t,e))}var p8n,P1e,jVi,d8n,VVi,Dmt=v(()=>{p();p8n=require("fs"),P1e=require("fs/promises");Vm();vie();Yse();ww();Nmt();bS();Eg();jVi=Ne.Object({path:Ne.String({description:"Path to the file to read (relative or absolute)"}),offset:Ne.Optional(Ne.Number({description:"Line number to start reading from (1-indexed)"})),limit:Ne.Optional(Ne.Number({description:"Maximum number of lines to read"}))}),d8n={snippet:"Read file contents",guidelines:["Use read to examine files instead of cat or sed."]},VVi={readFile:t=>(0,P1e.readFile)(t),access:t=>(0,P1e.access)(t,p8n.constants.R_OK),detectImageMimeType:zV}});function Mmt(t,e){return FR(t,e)[0]??""}function KVi(t){let e=Math.min(zVi,t.normalizedLines.length);if(e===0)return;let n=t.normalizedLines.slice(0,e).join(` +`),r=FR(n,t.lang);for(let i=0;i0&&t[e-1]==="";)e--;return t.slice(0,e)}function ZVi(t,e,n,r,i){let s=su(t?.file_path??t?.path),o=su(t?.content),a=rP(s,n,i),c=`${n.fg("toolTitle",n.bold("write"))} ${a}`;if(o===null)c+=` -${n.fg("error","[invalid content arg - expected string]")}`;else if(o){let u=i?LN(i):void 0,l=u?r?.highlightedLines??sT(xT(uee(o)),u):uee(o).split(` -`),d=Pys(l),h=d.length,m=e.expanded?d.length:10,f=d.slice(0,m),g=d.length-m;c+=` +${n.fg("error","[invalid content arg - expected string]")}`;else if(o){let u=s?kD(s):void 0,l=u?r?.highlightedLines??FR(sk(Lse(o)),u):Lse(o).split(` +`),d=XVi(l),m=d.length,h=e.expanded?d.length:10,f=d.slice(0,h),g=d.length-h;c+=` -${f.map(A=>u?A:n.fg("toolOutput",xT(A))).join(` +${f.map(A=>u?A:n.fg("toolOutput",sk(A))).join(` `)}`,g>0&&(c+=`${n.fg("muted",` -... (${g} more lines, ${h} total,`)} ${er("app.tools.expand","to expand")}${n.fg("muted",")")}`)}return c}function Mys(t,e){if(!t.isError)return;let n=t.content.filter(r=>r.type==="text").map(r=>r.text||"").join(` +... (${g} more lines, ${m} total,`)} ${nr("app.tools.expand","to expand")}${n.fg("muted",")")}`)}return c}function eYi(t,e){if(!t.isError)return;let n=t.content.filter(r=>r.type==="text").map(r=>r.text||"").join(` `);if(n)return` -${e.fg("error",n)}`}var GCe={renderCall(t,e,n){let r=t,s=fl(r?.file_path??r?.path),i=fl(r?.content),o=n.lastComponent??new set;return i!==null?o.cache=n.argsComplete?$Ce(s,i):Bys(o.cache,s,i):o.cache=void 0,o.setText(Oys(r,{expanded:n.expanded,isPartial:n.isPartial},e,o.cache,n.cwd)),o},renderResult(t,e,n,r){let s=Mys({...t,isError:r.isError},n);if(!s){let o=r.lastComponent??new _n;return o.clear(),o}let i=r.lastComponent??new yt("",0,0);return i.setText(s),i}};var Lys=Oe.Object({path:Oe.String({description:"Path to the file to write (relative or absolute)"}),content:Oe.String({description:"Content to write to the file"})}),A0n={snippet:"Create or overwrite files",guidelines:["Use write only for new files or complete rewrites."]},Fys={writeFile:(t,e)=>(0,WCe.writeFile)(t,e,"utf-8"),mkdir:t=>(0,WCe.mkdir)(t,{recursive:!0}).then(()=>{})};function n4(t,e){let n=e?.operations??Fys;return{name:"write",label:"write",description:"Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.",promptSnippet:A0n.snippet,promptGuidelines:[...A0n.guidelines],parameters:Lys,constrainedSampling:oD(),async execute(r,{path:s,content:i},o,a,c){let u=$h(s,c?.cwd||t),l=(0,y0n.dirname)(u);return cD(u,async()=>{let d=()=>{if(o?.aborted)throw new Error("Operation aborted")};return d(),await n.mkdir(l),d(),await n.writeFile(u,i),d(),{content:[{type:"text",text:`Successfully wrote to ${s}`}],details:void 0}})},...GCe}}function r4(t,e){return cp(n4(t,e))}function E0n(t,e){return{read:t4(t,e?.read),bash:U5(t,e?.bash),powershell:Z5(t,e?.powershell),edit:H5(t,e?.edit),write:n4(t,e?.write),grep:K5(t,e?.grep),find:j5(t,e?.find),ls:J5(t,e?.ls)}}function oet(t,e){return[_L(t,e?.read),$5(t,e?.bash),V5(t,e?.edit),r4(t,e?.write)]}function aet(t,e){return[_L(t,e?.read),z5(t,e?.grep),Y5(t,e?.find),X5(t,e?.ls)]}p();function bee(){return{input:0,output:0,cacheRead:0,cacheWrite:0,cost:0}}function wT(t,e){t.input+=e.input,t.output+=e.output,t.cacheRead+=e.cacheRead,t.cacheWrite+=e.cacheWrite,t.cost+=e.cost.total}function b0n(t){let e=new Map;for(let n of t){let r,s;if(n.type==="message"&&n.message.role==="assistant"?(r=`${n.message.provider}/${n.message.responseModel??n.message.model}`,s=n.message.usage):n.type==="message"&&n.message.role==="toolResult"&&n.message.usage?(r="Tools/summaries",s=n.message.usage):(n.type==="branch_summary"||n.type==="compaction")&&n.usage&&(r="Tools/summaries",s=n.usage),!r||!s)continue;let i=e.get(r);i||(i=bee(),e.set(r,i)),wT(i,s)}return Array.from(e,([n,r])=>({key:n,cost:r.cost,tokens:r.input+r.output+r.cacheRead+r.cacheWrite})).filter(n=>n.cost>0||n.tokens>0).sort((n,r)=>r.cost-n.cost)}function HCe(t){let e=t.match(/^\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/);return e?{name:e[1],location:e[2],content:e[3],userMessage:e[4]?.trim()||void 0}:null}function _0n(t){return t?Object.fromEntries(Object.entries(t).filter(e=>e[1]!==null)):void 0}function S0n(t){let e=0;for(let n of t)e+=cT(n);return e}var s4=class{agent;sessionManager;settingsManager;_scopedModels;_unsubscribeAgent;_eventListeners=[];_isAgentRunActive=!1;_idleWaitPromise;_resolveIdleWait;_steeringMessages=[];_followUpMessages=[];_pendingNextTurnMessages=[];_pendingCustomMessages=[];_compactionAbortController=void 0;_autoCompactionAbortController=void 0;_overflowRecoveryAttempted=!1;_branchSummaryAbortController=void 0;_retryAbortController=void 0;_retryAttempt=0;_bashAbortControllers=new Set;_pendingBashMessages=[];_extensionRunner;_turnIndex=0;_resourceLoader;_customTools;_baseToolDefinitions=new Map;_cwd;_extensionRunnerRef;_initialActiveToolNames;_allowedToolNames;_excludedToolNames;_baseToolsOverride;_sessionStartEvent;_extensionUIContext;_extensionMode="print";_extensionCommandContextActions;_extensionAbortHandler;_extensionShutdownHandler;_extensionErrorListener;_extensionErrorUnsubscriber;_modelRuntime;_toolRegistry=new Map;_toolDefinitions=new Map;_toolPromptSnippets=new Map;_toolPromptGuidelines=new Map;_baseSystemPrompt="";_baseSystemPromptOptions;_systemPromptOverride;constructor(e){this.agent=e.agent,this.sessionManager=e.sessionManager,this.settingsManager=e.settingsManager,this._scopedModels=e.scopedModels??[],this._resourceLoader=e.resourceLoader,this._customTools=e.customTools??[],this._cwd=e.cwd,this._modelRuntime=e.modelRuntime,this._extensionRunnerRef=e.extensionRunnerRef,this._initialActiveToolNames=e.initialActiveToolNames,this._allowedToolNames=e.allowedToolNames?new Set(e.allowedToolNames):void 0,this._excludedToolNames=e.excludedToolNames?new Set(e.excludedToolNames):void 0,this._baseToolsOverride=e.baseToolsOverride,this._sessionStartEvent=e.sessionStartEvent??{type:"session_start",reason:"startup"},this._unsubscribeAgent=this.agent.subscribe(this._handleAgentEvent),this._installAgentToolHooks(),this._installAgentNextTurnRefresh(),this._buildRuntime({activeToolNames:this._initialActiveToolNames,includeAllExtensionTools:!0})}get modelRuntime(){return this._modelRuntime}async _getRequiredRequestAuth(e){let n;try{n=await this._modelRuntime.getAuth(e)}catch(s){let i=s instanceof Error?s.cause:void 0;throw i instanceof Error&&i.message==="authHeader requires a resolved API key"?new Error(D0e(e.provider)):s}if(n&&(n.auth.apiKey||n.auth.headers))return{model:n.auth.baseUrl?{...e,baseUrl:n.auth.baseUrl}:e,apiKey:n.auth.apiKey,headers:_0n(n.auth.headers),env:n.env};throw this._modelRuntime.isUsingOAuth(e.provider)?new Error(`Authentication failed for "${e.provider}". Credentials may have expired or network is unavailable. Run '/login ${e.provider}' to re-authenticate.`):new Error(D0e(e.provider))}async _getSummarizationRequestAuth(e){if(this.agent.streamFunction===pN)return this._getRequiredRequestAuth(e);try{let n=await this._modelRuntime.getAuth(e);return n?{model:n.auth.baseUrl?{...e,baseUrl:n.auth.baseUrl}:e,apiKey:n.auth.apiKey,headers:_0n(n.auth.headers),env:n.env}:{model:e}}catch{return{model:e}}}_installAgentToolHooks(){this.agent.beforeToolCall=async({toolCall:e,args:n})=>{let r=this._extensionRunner;if(r.hasHandlers("tool_call"))try{return await r.emitToolCall({type:"tool_call",toolName:e.name,toolCallId:e.id,input:n})}catch(s){throw s instanceof Error?s:new Error(`Extension failed, blocking execution: ${String(s)}`)}},this.agent.afterToolCall=async({toolCall:e,args:n,result:r,isError:s})=>{let i=this._extensionRunner,o=i.hasHandlers("tool_result")?await i.emitToolResult({type:"tool_result",toolName:e.name,toolCallId:e.id,input:n,content:r.content,details:r.details,isError:s,usage:r.usage}):void 0,a=o?.content??r.content??[],c=await Jgn(a,{autoResizeImages:this.settingsManager.getImageAutoResize()});if(!(!o&&c===a))return{content:c,details:o?.details,isError:o?.isError??s,usage:o?.usage}}}async _compactBeforeNextAssistantResponse(e){let n=this.model,r=this.settingsManager.getCompactionSettings();return!n||n.contextWindow<=0||!CZ(SZ(e.messages).tokens,n.contextWindow,r)?e:(await this._runAutoCompaction("threshold",!1),{...e,messages:this.agent.state.messages.slice()})}_installAgentNextTurnRefresh(){let e=this.agent.prepareNextTurnWithContext??(this.agent.prepareNextTurn?async(n,r)=>await this.agent.prepareNextTurn?.(r):void 0);this.agent.prepareNextTurnWithContext=async(n,r)=>{let s=await this._compactBeforeNextAssistantResponse(n.context),i=await e?.({...n,context:s},r),o=i?.context??s;return{...i,context:{...o,systemPrompt:this._systemPromptOverride??this._baseSystemPrompt,tools:this.agent.state.tools.slice()},model:this.agent.state.model,thinkingLevel:this.agent.state.thinkingLevel}}}_emit(e){for(let n of this._eventListeners)n(e)}_emitQueueUpdate(){this._emit({type:"queue_update",steering:[...this._steeringMessages],followUp:[...this._followUpMessages]})}async _emitSessionCompactFailed(e){this._extensionRunner.hasHandlers("session_compact_failed")&&await this._extensionRunner.emit({type:"session_compact_failed",...e})}_getIdleWaitPromise(){return this._idleWaitPromise||(this._idleWaitPromise=new Promise(e=>{this._resolveIdleWait=e})),this._idleWaitPromise}_resolveIdleWaitIfIdle(){if(!this.isIdle||!this._resolveIdleWait)return;let e=this._resolveIdleWait;this._idleWaitPromise=void 0,this._resolveIdleWait=void 0,e()}async _emitAgentSettled(){this._isAgentRunActive=!1;try{await this._extensionRunner.emit({type:"agent_settled"}),this._emit({type:"agent_settled"})}finally{this._resolveIdleWaitIfIdle()}}_lastAssistantMessage=void 0;_handleAgentEvent=async e=>{if(e.type==="message_start"&&e.message.role==="user"){this._overflowRecoveryAttempted=!1;let n=yc(e.message.content,"");if(n){let r=this._steeringMessages.indexOf(n);if(r!==-1)this._steeringMessages.splice(r,1),this._emitQueueUpdate();else{let s=this._followUpMessages.indexOf(n);s!==-1&&(this._followUpMessages.splice(s,1),this._emitQueueUpdate())}}}if(await this._emitExtensionEvent(e),this._emit(e.type==="agent_end"?{...e,willRetry:this._willRetryAfterAgentEnd(e)}:e),e.type==="message_end"&&(e.message.role==="custom"?this.sessionManager.appendCustomMessageEntry(e.message.customType,e.message.content,e.message.display,e.message.details):(e.message.role==="user"||e.message.role==="assistant"||e.message.role==="toolResult")&&this.sessionManager.appendMessage(e.message),e.message.role==="assistant")){this._lastAssistantMessage=e.message;let n=e.message;n.stopReason!=="error"&&n.stopReason!=="length"&&(this._overflowRecoveryAttempted=!1),n.stopReason!=="error"&&this._retryAttempt>0&&(this._emit({type:"auto_retry_end",success:!0,attempt:this._retryAttempt}),this._retryAttempt=0)}e.type==="turn_end"&&this._flushPendingCustomMessages()};_willRetryAfterAgentEnd(e){let n=this.settingsManager.getRetrySettings();if(!n.enabled||this._retryAttempt>=n.maxRetries)return!1;for(let r=e.messages.length-1;r>=0;r--){let s=e.messages[r];if(s.role==="assistant")return this._isRetryableError(s)}return!1}_findLastAssistantMessage(){let e=this.agent.state.messages;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.role==="assistant")return r}}_replaceMessageInPlace(e,n){if(e===n)return;let r=e;for(let s of Object.keys(r))delete r[s];Object.assign(r,n)}async _emitExtensionEvent(e){if(e.type==="agent_start")this._turnIndex=0,await this._extensionRunner.emit({type:"agent_start"});else if(e.type==="agent_end")await this._extensionRunner.emit({type:"agent_end",messages:e.messages});else if(e.type==="turn_start"){let n={type:"turn_start",turnIndex:this._turnIndex,timestamp:Date.now()};await this._extensionRunner.emit(n)}else if(e.type==="turn_end"){let n={type:"turn_end",turnIndex:this._turnIndex,message:e.message,toolResults:e.toolResults};await this._extensionRunner.emit(n),this._turnIndex++}else if(e.type==="message_start"){let n={type:"message_start",message:e.message};await this._extensionRunner.emit(n)}else if(e.type==="message_update"){let n={type:"message_update",message:e.message,assistantMessageEvent:e.assistantMessageEvent};await this._extensionRunner.emit(n)}else if(e.type==="message_end"){let n={type:"message_end",message:e.message},r=await this._extensionRunner.emitMessageEnd(n);if(r){let s=(r.role==="user"||r.role==="assistant"||r.role==="toolResult"||r.role==="custom")&&r.content==null?{...r,content:[]}:r;this._replaceMessageInPlace(e.message,s)}}else if(e.type==="tool_execution_start"){let n={type:"tool_execution_start",toolCallId:e.toolCallId,toolName:e.toolName,args:e.args};await this._extensionRunner.emit(n)}else if(e.type==="tool_execution_update"){let n={type:"tool_execution_update",toolCallId:e.toolCallId,toolName:e.toolName,args:e.args,partialResult:e.partialResult};await this._extensionRunner.emit(n)}else if(e.type==="tool_execution_end"){let n={type:"tool_execution_end",toolCallId:e.toolCallId,toolName:e.toolName,result:e.result,isError:e.isError};await this._extensionRunner.emit(n)}}subscribe(e){return this._eventListeners.push(e),()=>{let n=this._eventListeners.indexOf(e);n!==-1&&this._eventListeners.splice(n,1)}}_disconnectFromAgent(){this._unsubscribeAgent&&(this._unsubscribeAgent(),this._unsubscribeAgent=void 0)}dispose(){try{this.abortRetry(),this.abortCompaction(),this.abortBranchSummary(),this.abortBash(),this.agent.abort()}catch{}this._extensionRunner.invalidate("This extension ctx is stale after session replacement or reload. Do not use a captured pi or command ctx after ctx.newSession(), ctx.fork(), ctx.switchSession(), or ctx.reload(). For newSession, fork, and switchSession, move post-replacement work into withSession and use the ctx passed to withSession. For reload, do not use the old ctx after await ctx.reload()."),this._disconnectFromAgent(),this._eventListeners=[],tVe(this.sessionId)}get state(){return this.agent.state}get model(){return this.agent.state.model}get thinkingLevel(){return this.agent.state.thinkingLevel}get isStreaming(){return this._isAgentRunActive}get isIdle(){return!this._isAgentRunActive&&!this.isCompacting}get systemPrompt(){return this.agent.state.systemPrompt}get retryAttempt(){return this._retryAttempt}getActiveToolNames(){return this.agent.state.tools.map(e=>e.name)}getAllTools(){return Array.from(this._toolDefinitions.values()).map(({definition:e,sourceInfo:n})=>({name:e.name,description:e.description,parameters:e.parameters,promptGuidelines:e.promptGuidelines,sourceInfo:n}))}getToolDefinition(e){return this._toolDefinitions.get(e)?.definition}setActiveToolsByName(e){let n=[],r=[];for(let s of e){let i=this._toolRegistry.get(s);i&&(n.push(i),r.push(s))}this.agent.state.tools=n,this._baseSystemPrompt=this._rebuildSystemPrompt(r),this.agent.state.systemPrompt=this._systemPromptOverride??this._baseSystemPrompt}get isCompacting(){return this._autoCompactionAbortController!==void 0||this._compactionAbortController!==void 0||this._branchSummaryAbortController!==void 0}get messages(){return this.agent.state.messages}get steeringMode(){return this.agent.steeringMode}get followUpMode(){return this.agent.followUpMode}get sessionFile(){return this.sessionManager.getSessionFile()}get sessionId(){return this.sessionManager.getSessionId()}get sessionName(){return this.sessionManager.getSessionName()}get scopedModels(){return this._scopedModels}setScopedModels(e){this._scopedModels=e}get promptTemplates(){return this._resourceLoader.getPrompts().prompts}_normalizePromptSnippet(e){if(!e)return;let n=e.replace(/[\r\n]+/g," ").replace(/\s+/g," ").trim();return n.length>0?n:void 0}_normalizePromptGuidelines(e){if(!e||e.length===0)return[];let n=new Set;for(let r of e){let s=r.trim();s.length>0&&n.add(s)}return Array.from(n)}_rebuildSystemPrompt(e){let n=e.filter(l=>this._toolRegistry.has(l)),r={},s=[];for(let l of n){let d=this._toolPromptSnippets.get(l);d&&(r[l]=d);let h=this._toolPromptGuidelines.get(l);h&&s.push(...h)}let i=this._resourceLoader.getSystemPrompt(),o=this._resourceLoader.getAppendSystemPrompt(),a=o.length>0?o.join(` +${e.fg("error",n)}`}var Pmt,zVi,O1e,Omt=v(()=>{p();Tr();ha();pi();ok();Pmt=class extends Et{cache;constructor(){super("",0,0)}},zVi=50;O1e={renderCall(t,e,n){let r=t,i=su(r?.file_path??r?.path),s=su(r?.content),o=n.lastComponent??new Pmt;return s!==null?o.cache=n.argsComplete?M1e(i,s):JVi(o.cache,i,s):o.cache=void 0,o.setText(ZVi(r,{expanded:n.expanded,isPartial:n.isPartial},e,o.cache,n.cwd)),o},renderResult(t,e,n,r){let i=eYi({...t,isError:r.isError},n);if(!i){let o=r.lastComponent??new gn;return o.clear(),o}let s=r.lastComponent??new Et("",0,0);return s.setText(i),s}}});function JV(t,e){let n=e?.operations??nYi;return{name:"write",label:"write",description:"Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.",promptSnippet:m8n.snippet,promptGuidelines:[...m8n.guidelines],parameters:tYi,constrainedSampling:{type:"json_schema",strict:"prefer"},async execute(r,{path:i,content:s},o,a,c){let u=Xh(i,c?.cwd||t),l=(0,h8n.dirname)(u);return iP(u,async()=>{let d=()=>{if(o?.aborted)throw new Error("Operation aborted")};return d(),await n.mkdir(l),d(),await n.writeFile(u,s),d(),{content:[{type:"text",text:`Successfully wrote to ${i}`}],details:void 0}})},...O1e}}function XV(t,e){return cm(JV(t,e))}var L1e,h8n,tYi,m8n,nYi,Lmt=v(()=>{p();L1e=require("fs/promises"),h8n=require("path");Vm();_1e();ww();Omt();bS();tYi=Ne.Object({path:Ne.String({description:"Path to the file to write (relative or absolute)"}),content:Ne.String({description:"Content to write to the file"})}),m8n={snippet:"Create or overwrite files",guidelines:["Use write only for new files or complete rewrites."]},nYi={writeFile:(t,e)=>(0,L1e.writeFile)(t,e,"utf-8"),mkdir:t=>(0,L1e.mkdir)(t,{recursive:!0}).then(()=>{})}});function f8n(t,e){return{read:KV(t,e?.read),bash:MV(t,e?.bash),powershell:YV(t,e?.powershell),edit:UV(t,e?.edit),write:JV(t,e?.write),grep:HV(t,e?.grep),find:$V(t,e?.find),ls:jV(t,e?.ls)}}function Fmt(t,e){return[qQ(t,e?.read),OV(t,e?.bash),GV(t,e?.edit),XV(t,e?.write)]}function Qmt(t,e){return[qQ(t,e?.read),qV(t,e?.grep),WV(t,e?.find),VV(t,e?.ls)]}var F1e=v(()=>{p();Qse();Amt();_1e();_mt();Cmt();wmt();Tmt();Dmt();Eg();Lmt();Qse();Amt();_mt();Cmt();wmt();Tmt();Dmt();Lmt()});function zse(){return{input:0,output:0,cacheRead:0,cacheWrite:0,cost:0}}function xS(t,e){t.input+=e.input,t.output+=e.output,t.cacheRead+=e.cacheRead,t.cacheWrite+=e.cacheWrite,t.cost+=e.cost.total}function g8n(t){let e=new Map;for(let n of t){let r,i;if(n.type==="message"&&n.message.role==="assistant"?(r=`${n.message.provider}/${n.message.responseModel??n.message.model}`,i=n.message.usage):n.type==="usage"?(r=`${n.provider}/${n.model}`,i=n.usage):n.type==="message"&&n.message.role==="toolResult"&&n.message.usage?(r="Tools/summaries",i=n.message.usage):(n.type==="branch_summary"||n.type==="compaction")&&n.usage&&(r="Tools/summaries",i=n.usage),!r||!i)continue;let s=e.get(r);s||(s=zse(),e.set(r,s)),xS(s,i)}return Array.from(e,([n,r])=>({key:n,cost:r.cost,tokens:r.input+r.output+r.cacheRead+r.cacheWrite})).filter(n=>n.cost>0||n.tokens>0).sort((n,r)=>r.cost-n.cost)}var Q1e=v(()=>{p()});function G1e(t){let e=t.match(/^\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/);return e?{name:e[1],location:e[2],content:e[3],userMessage:e[4]?.trim()||void 0}:null}function A8n(t){return t?Object.fromEntries(Object.entries(t).filter(e=>e[1]!==null)):void 0}function y8n(t){let e=0;for(let n of t)e+=NA(n);return e}var E8n,U1e,ZV,$1e=v(()=>{p();E8n=require("node:fs"),U1e=require("node:path");qo();cR();pi();Tie();vie();p$n();h$n();Rie();S$n();CRe();Aut();$ie();Eut();_Wn();qpt();Bse();GR();nmt();smt();m1e();fw();_Q();Ppt();Qse();F1e();bS();Q1e();ZV=class{agent;sessionManager;settingsManager;_scopedModels;_unsubscribeAgent;_eventListeners=[];_isAgentRunActive=!1;_agentRunAbortRequested=!1;_idleWaitPromise;_resolveIdleWait;_steeringMessages=[];_followUpMessages=[];_pendingNextTurnMessages=[];_pendingCustomMessages=[];_compactionAbortController=void 0;_autoCompactionAbortController=void 0;_overflowRecoveryAttempted=!1;_branchSummaryAbortController=void 0;_retryAbortController=void 0;_retryAttempt=0;_bashAbortControllers=new Set;_pendingBashMessages=[];_extensionRunner;_turnIndex=0;_entryIdsByMessage=new WeakMap;_boundaryDispatchedMessages=new WeakSet;_lastAssistantMessage;_lastAssistantToolResults=[];_lastActivityOutcome="completed";_isBeforeSettle=!1;_abortDuringBeforeSettle=!1;_isEmittingAgentSettled=!1;_deferredSettledActions=[];_resourceLoader;_customTools;_baseToolDefinitions=new Map;_cwd;_extensionRunnerRef;_initialActiveToolNames;_allowedToolNames;_excludedToolNames;_baseToolsOverride;_sessionStartEvent;_extensionUIContext;_extensionMode="print";_extensionCommandContextActions;_extensionAbortHandler;_extensionShutdownHandler;_extensionErrorListener;_extensionErrorUnsubscriber;_modelRuntime;_cacheWarmer;_toolRegistry=new Map;_toolDefinitions=new Map;_toolPromptSnippets=new Map;_toolPromptGuidelines=new Map;_baseSystemPromptOptions;_runSystemPromptOptions;constructor(e){this.agent=e.agent,this.sessionManager=e.sessionManager,this.settingsManager=e.settingsManager,this._scopedModels=e.scopedModels??[],this._resourceLoader=e.resourceLoader,this._customTools=e.customTools??[],this._cwd=e.cwd,this._modelRuntime=e.modelRuntime,this._cacheWarmer=e.cacheWarmer,this._cacheWarmer&&(this._cacheWarmer.onWarmed=n=>this._emit({type:"entry_appended",entry:n})),this._extensionRunnerRef=e.extensionRunnerRef,this._initialActiveToolNames=e.initialActiveToolNames,this._allowedToolNames=e.allowedToolNames?new Set(e.allowedToolNames):void 0,this._excludedToolNames=e.excludedToolNames?new Set(e.excludedToolNames):void 0,this._baseToolsOverride=e.baseToolsOverride,this._sessionStartEvent=e.sessionStartEvent??{type:"session_start",reason:"startup"},this._unsubscribeAgent=this.agent.subscribe(this._handleAgentEvent),this._installAgentToolHooks(),this._installAgentNextTurnRefresh(),this._installAgentRequestProjection(),this._installAgentBoundaryHooks(),this._installAgentForcedPromptProjection(),this._buildRuntime({activeToolNames:this._initialActiveToolNames,includeAllExtensionTools:!0}),this._initialActiveToolNames===void 0&&this._restoreToolsFromTranscript()}get modelRuntime(){return this._modelRuntime}async _getRequiredRequestAuth(e,n){let r;try{r=await this._modelRuntime.getAuth(e,{signal:n})}catch(s){let o=s instanceof Error?s.cause:void 0;throw o instanceof Error&&o.message==="authHeader requires a resolved API key"?new Error(iRe(e.provider)):s}if(r&&(r.auth.apiKey||r.auth.headers))return{model:r.auth.baseUrl?{...e,baseUrl:r.auth.baseUrl}:e,apiKey:r.auth.apiKey,headers:A8n(r.auth.headers),env:r.env};throw this._modelRuntime.isUsingOAuth(e.provider)?new Error(`Authentication failed for "${e.provider}". Credentials may have expired or network is unavailable. Run '/login ${e.provider}' to re-authenticate.`):new Error(iRe(e.provider))}async _getSummarizationRequestAuth(e,n){if(this.agent.streamFunction===iD)return this._getRequiredRequestAuth(e,n);try{let r=await this._modelRuntime.getAuth(e,{signal:n});return r?{model:r.auth.baseUrl?{...e,baseUrl:r.auth.baseUrl}:e,apiKey:r.auth.apiKey,headers:A8n(r.auth.headers),env:r.env}:{model:e}}catch(r){if(n?.aborted)throw r;return{model:e}}}_installAgentToolHooks(){this.agent.beforeToolCall=async({toolCall:e,args:n})=>{let r=this._extensionRunner;if(r.hasHandlers("tool_call"))try{return await r.emitToolCall({type:"tool_call",toolName:e.name,toolCallId:e.id,input:n})}catch(i){throw i instanceof Error?i:new Error(`Extension failed, blocking execution: ${String(i)}`)}},this.agent.afterToolCall=async({toolCall:e,args:n,result:r,isError:i})=>{let s=this._extensionRunner,o=s.hasHandlers("tool_result")?await s.emitToolResult({type:"tool_result",toolName:e.name,toolCallId:e.id,input:n,content:r.content,details:r.details,isError:i,usage:r.usage}):void 0,a=o?.content??r.content??[],c=this.model?.inputLimits?.images?.resize,u=await m$n(a,{autoResizeImages:this.settingsManager.getImageAutoResize(),...c?{resizeOptions:c}:{}});if(!(!o&&u===a))return{content:u,details:o?.details,isError:o?.isError??i,usage:o?.usage}}}async _compactBeforeNextAssistantResponse(e){let n=this.model,r=this.settingsManager.getCompactionSettings(n),i=this.sessionManager.buildSessionProjection();return!n||n.contextWindow<=0||!Uie(Jj(i,this.sessionManager.getBranch()).tokens,n.contextWindow,r)?{...e,messages:i.messages}:(await this._runAutoCompaction("threshold",!1),{...e,messages:this.sessionManager.buildSessionProjection().messages})}_installAgentRequestProjection(){let e=this.agent.prepareRequest;this.agent.prepareRequest=async(n,r)=>{let i={...n.context,messages:this.sessionManager.buildSessionProjection().messages,tools:this.agent.state.tools.slice()},s=await e?.({...n,context:i,model:this.agent.state.model,thinkingLevel:this.agent.state.thinkingLevel},r);return{...s,context:s?.context??i,model:s?.model??this.agent.state.model,thinkingLevel:s?.thinkingLevel??this.agent.state.thinkingLevel}}}async _dispatchTurnEndBoundary(e,n){this._lastActivityOutcome=e.stopReason==="aborted"?"aborted":e.stopReason==="error"?"error":"completed";let r=this._findPersistedMessageEntryId(e);if(!this._extensionRunner.hasHandlers("turn_end"))return!1;if(!r)return this._extensionRunner.emitError({extensionPath:"",event:"turn_end",error:"turn_end could not resolve the persisted assistant entry ID"}),!1;let i=n.flatMap(o=>{let a=this._findPersistedMessageEntryId(o);return a?[a]:[]}),s=await this._extensionRunner.emitBoundary({type:"turn_end",turnIndex:this._turnIndex,message:e,toolResults:n,messageEntryId:r,toolResultEntryIds:i,outcome:this._lastActivityOutcome},o=>this._buildBoundaryContext(o,"turn_end"));return this._commitBoundaryDrafts(s.entries),s.continue&&!this._buildBoundaryContext([],"turn_end").canContinue?(this._reportInvalidBoundaryContinuation("turn_end"),!1):s.continue}_installAgentBoundaryHooks(){let e=this.agent.finishTurn;this.agent.finishTurn=async(n,r)=>{this._boundaryDispatchedMessages.add(n.message);let i=await this._dispatchTurnEndBoundary(n.message,n.toolResults),s=await e?.(n,r);if(s?.action==="end")return s;if(i||s?.action==="continue")return{action:"continue"}}}_installAgentNextTurnRefresh(){let e=this.agent.prepareNextTurnWithContext??(this.agent.prepareNextTurn?async(n,r)=>await this.agent.prepareNextTurn?.(r):void 0);this.agent.prepareNextTurnWithContext=async(n,r)=>{let i=await this._compactBeforeNextAssistantResponse({...n.context,messages:this.sessionManager.buildSessionProjection().messages}),s=await e?.({...n,context:i},r),o=s?.context??i,a=this._runSystemPromptOptions??this._baseSystemPromptOptions,c=nP({...a,selectedTools:this.getActiveToolNames(),toolSnippets:{...this._baseSystemPromptOptions.toolSnippets,...a.toolSnippets},toolGuidelines:{...this._baseSystemPromptOptions.toolGuidelines,...a.toolGuidelines}}),u=this._preparePromptAndToolLoadout(c,o.messages);return this._runSystemPromptOptions=c,{...s,context:{...o,tools:this.agent.state.tools.slice()},messages:u?[...s?.messages??[],u]:s?.messages,model:this.agent.state.model,thinkingLevel:this.agent.state.thinkingLevel}}}_refreshFinalizedContext(){let e=this.sessionManager.buildSessionProjection();for(let n of e.entries)for(let r of n.messages)this._entryIdsByMessage.set(r,n.sourceEntry.id);this.agent.state.messages=e.messages}_applyBoundaryDrafts(e,n){let r=[];for(let i of n){let s;switch(i.type){case"custom":s=e.appendCustomEntry(i.customType,i.data);break;case"custom_message":s=e.appendCustomMessageEntry(i.customType,i.content,i.display,i.details);break;case"context_edit":s=e.appendContextEdit(i.targetId,i.replacement);break;case"compaction":{let a=Jj(e.buildSessionProjection(),e.getBranch()).tokens;s=e.appendCompaction(i.summary,i.firstKeptEntryId,a,i.details,!0,i.usage);break}}let o=e.getEntry(s);o&&r.push(o)}return r}_createBoundaryPreviewManager(e){let n=this.sessionManager.getHeader();if(!n)throw new Error("Session header is missing");let r=Js.inMemory(this._cwd,void 0,[n,...this.sessionManager.getBranch()]);return this._applyBoundaryDrafts(r,e),r}_getPendingBoundaryMessages(){return[...this.agent.peekQueuedMessages(),...this._pendingCustomMessages]}_buildBoundaryContext(e,n){let r=this._createBoundaryPreviewManager(e).buildSessionProjection(),i=this._getPendingBoundaryMessages(),s=IE(r.messages),o=s[s.length-1]?.role,c=s.some(l=>l.role!=="system")&&o!=="assistant",u=this._pendingCustomMessages.length>0;return{contextEntries:r.entries,contextMessages:r.messages,llmMessages:s,pendingMessages:i,canContinue:c||u||(n==="turn_end"?this.agent.hasQueuedMessages():o==="assistant"&&this.agent.hasQueuedMessages())}}_commitBoundaryDrafts(e){let n=this._applyBoundaryDrafts(this.sessionManager,e);this._refreshFinalizedContext();for(let r of n)this._emit({type:"entry_appended",entry:r})}_reportInvalidBoundaryContinuation(e){this._extensionRunner.emitError({extensionPath:"",event:e,error:`${e} requested continuation without runnable model context`})}_emit(e){for(let n of this._eventListeners)n(e)}_emitQueueUpdate(){this._emit({type:"queue_update",steering:[...this._steeringMessages],followUp:[...this._followUpMessages]})}async _emitSessionCompactFailed(e){this._extensionRunner.hasHandlers("session_compact_failed")&&await this._extensionRunner.emit({type:"session_compact_failed",...e})}_getIdleWaitPromise(){return this._idleWaitPromise||(this._idleWaitPromise=new Promise(e=>{this._resolveIdleWait=e})),this._idleWaitPromise}_resolveIdleWaitIfIdle(){if(!this.isIdle||!this._resolveIdleWait)return;let e=this._resolveIdleWait;this._idleWaitPromise=void 0,this._resolveIdleWait=void 0,e()}async _emitAgentSettled(){this._cacheWarmer?.onAgentSettled(),this._isAgentRunActive=!1,this._isEmittingAgentSettled=!0;try{await this._extensionRunner.emit({type:"agent_settled"}),this._emit({type:"agent_settled"})}finally{this._isEmittingAgentSettled=!1}let e=this._deferredSettledActions.splice(0);if(e.length>0){try{for(let n of e)await n()}finally{this._resolveIdleWaitIfIdle()}return}this._resolveIdleWaitIfIdle()}_handleAgentEvent=async e=>{if(e.type==="message_start"&&e.message.role==="user"){this._overflowRecoveryAttempted=!1;let n=aa(e.message.content,"");if(n){let r=this._steeringMessages.indexOf(n);if(r!==-1)this._steeringMessages.splice(r,1),this._emitQueueUpdate();else{let i=this._followUpMessages.indexOf(n);i!==-1&&(this._followUpMessages.splice(i,1),this._emitQueueUpdate())}}}if(await this._emitExtensionEvent(e),this._emit(e.type==="agent_end"?{...e,willRetry:this._willRetryAfterAgentEnd(e)}:e),e.type==="message_end"){let n;if(e.message.role==="custom"?n=this.sessionManager.appendCustomMessageEntry(e.message.customType,e.message.content,e.message.display,e.message.details):(e.message.role==="system"||e.message.role==="user"||e.message.role==="assistant"||e.message.role==="toolResult")&&(n=this.sessionManager.appendMessage(e.message)),n&&this._entryIdsByMessage.set(e.message,n),e.message.role==="assistant"){let r=e.message;this._lastAssistantMessage=r,r.stopReason!=="error"&&r.stopReason!=="length"&&(this._overflowRecoveryAttempted=!1),r.stopReason!=="error"&&this._retryAttempt>0&&(this._emit({type:"auto_retry_end",success:!0,attempt:this._retryAttempt}),this._retryAttempt=0)}}e.type==="turn_end"&&(this._lastAssistantToolResults=e.toolResults,this._flushPendingCustomMessages())};_willRetryAfterAgentEnd(e){if(this._agentRunAbortRequested)return!1;let n=this.settingsManager.getRetrySettings();if(!n.enabled||this._retryAttempt>=n.maxRetries)return!1;for(let r=e.messages.length-1;r>=0;r--){let i=e.messages[r];if(i.role==="assistant")return this._isRetryableError(i)}return!1}_findPersistedMessageEntryId(e){let n=this._entryIdsByMessage.get(e);if(n)return n;for(let o of[...this.sessionManager.getBranch()].reverse())if(o.type==="message"&&o.message===e)return o.id;let r=this.agent.state.messages.indexOf(e);if(r<0)return;let i=this.sessionManager.buildSessionProjection(),s=0;for(let o of i.entries)for(let a=0;athis._findPersistedMessageEntryId(o));if(r.some((o,a)=>i[a]===void 0&&this.agent.state.messages.includes(o)))throw new Error("Cannot persist recovery omission because a projected message has no source entry");for(let o of i){if(!o)continue;let a=this.sessionManager.appendContextEdit(o,null),c=this.sessionManager.getEntry(a);c&&this._emit({type:"entry_appended",entry:c})}this._refreshFinalizedContext()}_findLastAssistantMessage(){let e=this.agent.state.messages;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.role==="assistant")return r}}_replaceMessageInPlace(e,n){if(e===n)return;let r=e;for(let i of Object.keys(r))delete r[i];Object.assign(r,n)}async _emitExtensionEvent(e){if(e.type==="agent_start")this._turnIndex=0,await this._extensionRunner.emit({type:"agent_start"});else if(e.type==="agent_end")await this._extensionRunner.emit({type:"agent_end",messages:e.messages});else if(e.type==="turn_start"){let n={type:"turn_start",turnIndex:this._turnIndex,timestamp:Date.now()};await this._extensionRunner.emit(n)}else if(e.type==="turn_end")e.message.role==="assistant"&&!this._boundaryDispatchedMessages.delete(e.message)&&await this._dispatchTurnEndBoundary(e.message,e.toolResults),this._turnIndex++;else if(e.type==="message_start"){let n={type:"message_start",message:e.message};await this._extensionRunner.emit(n)}else if(e.type==="message_update"){let n={type:"message_update",message:e.message,assistantMessageEvent:e.assistantMessageEvent};await this._extensionRunner.emit(n)}else if(e.type==="message_end"){let n={type:"message_end",message:e.message},r=await this._extensionRunner.emitMessageEnd(n);if(r){let i=(r.role==="user"||r.role==="assistant"||r.role==="toolResult"||r.role==="custom")&&r.content==null?{...r,content:[]}:r;this._replaceMessageInPlace(e.message,i)}}else if(e.type==="tool_execution_start"){let n={type:"tool_execution_start",toolCallId:e.toolCallId,toolName:e.toolName,args:e.args};await this._extensionRunner.emit(n)}else if(e.type==="tool_execution_update"){let n={type:"tool_execution_update",toolCallId:e.toolCallId,toolName:e.toolName,args:e.args,partialResult:e.partialResult};await this._extensionRunner.emit(n)}else if(e.type==="tool_execution_end"){let n={type:"tool_execution_end",toolCallId:e.toolCallId,toolName:e.toolName,result:e.result,isError:e.isError};await this._extensionRunner.emit(n)}}subscribe(e){return this._eventListeners.push(e),()=>{let n=this._eventListeners.indexOf(e);n!==-1&&this._eventListeners.splice(n,1)}}_disconnectFromAgent(){this._unsubscribeAgent&&(this._unsubscribeAgent(),this._unsubscribeAgent=void 0)}dispose(){try{this.abortRetry(),this.abortCompaction(),this.abortBranchSummary(),this.abortBash(),this.agent.abort()}catch{}this._extensionRunner.invalidate("This extension ctx is stale after session replacement or reload. Do not use a captured pi or command ctx after ctx.newSession(), ctx.fork(), ctx.switchSession(), or ctx.reload(). For newSession, fork, and switchSession, move post-replacement work into withSession and use the ctx passed to withSession. For reload, do not use the old ctx after await ctx.reload()."),this._disconnectFromAgent(),this._eventListeners=[],this._cacheWarmer&&(this._cacheWarmer.onWarmed=void 0,this._cacheWarmer.cancel()),XKe(this.sessionId)}refreshContext(){this._refreshFinalizedContext()}get state(){return this.agent.state}get cacheWarmingStatus(){return this._cacheWarmer?.status}setCacheWarmingMode(e){this.settingsManager.setCacheWarmingMode(e),this._cacheWarmer?.onModeChanged()}get model(){return this.agent.state.model}get thinkingLevel(){return this.agent.state.thinkingLevel}get isStreaming(){return this._isAgentRunActive}get isIdle(){return!this._isAgentRunActive&&!this.isCompacting}get systemPrompt(){return l1e(this._runSystemPromptOptions??this._baseSystemPromptOptions)}get retryAttempt(){return this._retryAttempt}getActiveToolNames(){return this.agent.state.tools.map(e=>e.name)}getAllTools(){return Array.from(this._toolDefinitions.values()).map(({definition:e,sourceInfo:n})=>({name:e.name,description:e.description,parameters:e.parameters,promptGuidelines:e.promptGuidelines,sourceInfo:n}))}getToolDefinition(e){return this._toolDefinitions.get(e)?.definition}setActiveToolsByName(e){let n=[],r=[];for(let i of e){let s=this._toolRegistry.get(i);s&&(n.push(s),r.push(i))}this.agent.state.tools=n,this._rebuildSystemPrompt(r)}get isCompacting(){return this._autoCompactionAbortController!==void 0||this._compactionAbortController!==void 0||this._branchSummaryAbortController!==void 0}get messages(){return this.agent.state.messages}get steeringMode(){return this.agent.steeringMode}get followUpMode(){return this.agent.followUpMode}get sessionFile(){return this.sessionManager.getSessionFile()}get sessionId(){return this.sessionManager.getSessionId()}get sessionName(){return this.sessionManager.getSessionName()}get scopedModels(){return this._scopedModels}setScopedModels(e){this._scopedModels=e}get promptTemplates(){return this._resourceLoader.getPrompts().prompts}_normalizePromptSnippet(e){if(!e)return;let n=e.replace(/[\r\n]+/g," ").replace(/\s+/g," ").trim();return n.length>0?n:void 0}_normalizePromptGuidelines(e){if(!e||e.length===0)return[];let n=new Set;for(let r of e){let i=r.trim();i.length>0&&n.add(i)}return Array.from(n)}_rebuildSystemPrompt(e){let n=e.filter(u=>this._toolRegistry.has(u)),r={};for(let u of this._toolRegistry.keys()){let l=this._toolPromptSnippets.get(u);l&&(r[u]=l)}let i=this._resourceLoader.getSystemPrompt(),s=this._resourceLoader.getAppendSystemPrompt(),o=s.length>0?s.join(` -`):void 0,c=this._resourceLoader.getSkills().skills,u=this._resourceLoader.getAgentsFiles().agentsFiles;return this._baseSystemPromptOptions={cwd:this._cwd,skills:c,contextFiles:u,customPrompt:i,appendSystemPrompt:a,selectedTools:n,toolSnippets:r,promptGuidelines:s},y_n(this._baseSystemPromptOptions)}async _runAgentPrompt(e){this._isAgentRunActive=!0;try{for(await this.agent.prompt(e);await this._handlePostAgentRun();)await this.agent.continue()}finally{this._systemPromptOverride=void 0,this._flushPendingBashMessages(),this._flushPendingCustomMessages(),await this._emitAgentSettled()}}async _handlePostAgentRun(){let e=this._lastAssistantMessage;return this._lastAssistantMessage=void 0,e?this._isRetryableError(e)&&await this._prepareRetry(e)||(e.stopReason==="error"&&this._retryAttempt>0&&(this._emit({type:"auto_retry_end",success:!1,attempt:this._retryAttempt,finalError:e.errorMessage}),this._retryAttempt=0),await this._checkCompaction(e))?!0:this.agent.hasQueuedMessages():!1}async prompt(e,n){let r=n?.expandPromptTemplates??!0,s=n?.preflightResult,i;try{if(r&&e.startsWith("/")&&await this._tryExecuteExtensionCommand(e)){s?.(!0);return}if(this._compactionAbortController!==void 0)throw new Error("Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry.");let o=e,a=n?.images;if(this._extensionRunner.hasHandlers("input")){let m=await this._extensionRunner.emitInput(o,a,n?.source??"interactive",this.isStreaming?n?.streamingBehavior:void 0);if(m.action==="handled"){s?.(!0);return}m.action==="transform"&&(o=m.text,a=m.images??a)}let c=o;if(r&&(c=this._expandSkillCommand(c),c=SCe(c,[...this.promptTemplates])),this.isStreaming){if(!n?.streamingBehavior)throw new Error("Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.");n.streamingBehavior==="followUp"?await this._queueFollowUp(c,a):await this._queueSteer(c,a),s?.(!0);return}if(this._flushPendingBashMessages(),this._flushPendingCustomMessages(),!this.model)throw new Error(TJe());if(!(this._modelRuntime.hasConfiguredAuth(this.model.provider)||await this._modelRuntime.checkAuth(this.model.provider)!==void 0))throw this._modelRuntime.isUsingOAuth(this.model.provider)?new Error(`Authentication failed for "${this.model.provider}". Credentials may have expired or network is unavailable. Run '/login ${this.model.provider}' to re-authenticate.`):new Error(D0e(this.model.provider));let l=this._findLastAssistantMessage();l&&await this._checkCompaction(l,!1),i=[];let d=[{type:"text",text:c}];a&&d.push(...a),i.push({role:"user",content:d,timestamp:Date.now()});for(let m of this._pendingNextTurnMessages)i.push(m);this._pendingNextTurnMessages=[];let h=await this._extensionRunner.emitBeforeAgentStart(c,a,this._baseSystemPrompt,this._baseSystemPromptOptions);if(h?.messages)for(let m of h.messages)i.push({role:"custom",customType:m.customType,content:m.content??[],display:m.display,details:m.details,timestamp:Date.now()});h?.systemPrompt!==void 0?(this._systemPromptOverride=h.systemPrompt,this.agent.state.systemPrompt=h.systemPrompt):(this._systemPromptOverride=void 0,this.agent.state.systemPrompt=this._baseSystemPrompt)}catch(o){throw s?.(!1),o}i&&(s?.(!0),await this._runAgentPrompt(i))}async _tryExecuteExtensionCommand(e){let n=e.indexOf(" "),r=n===-1?e.slice(1):e.slice(1,n),s=n===-1?"":e.slice(n+1),i=this._extensionRunner.getCommand(r);if(!i)return!1;let o=this._extensionRunner.createCommandContext();try{return await i.handler(s,o),!0}catch(a){return this._extensionRunner.emitError({extensionPath:`command:${r}`,event:"command",error:a instanceof Error?a.message:String(a)}),!0}}_expandSkillCommand(e){if(!e.startsWith("/skill:"))return e;let n=e.indexOf(" "),r=n===-1?e.slice(7):e.slice(7,n),s=n===-1?"":e.slice(n+1).trim(),i=this.resourceLoader.getSkills().skills.find(o=>o.name===r);if(!i)return e;try{let o=(0,C0n.readFileSync)(i.filePath,"utf-8"),a=b0e(o).trim(),c=` -References are relative to ${i.baseDir}. +`):"",a=this._resourceLoader.getSkills().skills,c=this._resourceLoader.getAgentsFiles().agentsFiles;this._baseSystemPromptOptions=nP({cwd:this._cwd,skills:a,contextFiles:c,customPrompt:i,appendSystemPrompt:o,selectedTools:n,toolSnippets:r,toolGuidelines:Object.fromEntries(this._toolPromptGuidelines)})}_preparePromptAndToolLoadout(e,n=this.agent.state.messages){e.selectedTools=[...new Set(e.selectedTools)].filter(i=>this._toolRegistry.has(i)),this.agent.state.tools=e.selectedTools.flatMap(i=>{let s=this._toolRegistry.get(i);return s?[s]:[]});let r=W3n(kf(n)?.sections??{},Dpt(e));return r?{role:"system",content:"",sections:r,timestamp:Date.now()}:void 0}_installAgentForcedPromptProjection(){let e=this.agent.transformContext;this.agent.transformContext=async(n,r)=>{let i=e?await e(n,r):n,s=this._runSystemPromptOptions?.forceSystemPrompt;if(s===void 0)return i;let o=kf(i);return[{role:"system",content:s,...o?.toolsAdded?{toolsAdded:o.toolsAdded}:{},timestamp:o?.timestamp??Date.now()},...i.filter(c=>c.role!=="system")]}}_restoreToolsFromTranscript(){let e=kf(this.sessionManager.buildSessionContext().messages);if(!e)return;let n=(e.toolsAdded??[]).map(r=>r.name).filter(r=>this._toolRegistry.has(r));this.agent.state.tools=n.flatMap(r=>{let i=this._toolRegistry.get(r);return i?[i]:[]}),this._rebuildSystemPrompt(n)}async _runAgentPrompt(e){this._agentRunAbortRequested=!1,this._isAgentRunActive=!0;try{for(await this.agent.prompt(e);!this._agentRunAbortRequested;){if(await this._handlePostAgentRun()){if(this._agentRunAbortRequested)break;await this.agent.continue();continue}if(this._agentRunAbortRequested||!await this._runBeforeSettleBoundary()||this._agentRunAbortRequested)break;await this.agent.continue()}}finally{this._agentRunAbortRequested&&this._finishCancelledRetry(),this._runSystemPromptOptions=void 0,this._flushPendingBashMessages(),this._flushPendingCustomMessages(),await this._emitAgentSettled()}}async _handlePostAgentRun(){let e=this._lastAssistantMessage,n=this._lastAssistantToolResults;return this._lastAssistantMessage=void 0,this._lastAssistantToolResults=[],this._agentRunAbortRequested?(this._finishCancelledRetry(),!1):e?this._isRetryableError(e)&&await this._prepareRetry(e)?(this._agentRunAbortRequested&&this._finishCancelledRetry(),!this._agentRunAbortRequested):this._agentRunAbortRequested?(this._finishCancelledRetry(),!1):(e.stopReason==="error"&&this._retryAttempt>0&&(this._emit({type:"auto_retry_end",success:!1,attempt:this._retryAttempt,finalError:e.errorMessage}),this._retryAttempt=0),await this._checkCompaction(e,!0,n)?!this._agentRunAbortRequested:!this._agentRunAbortRequested&&this.agent.hasQueuedMessages()):this.agent.hasQueuedMessages()}async _runBeforeSettleBoundary(){if(!this._extensionRunner.hasHandlers("agent_before_settle"))return this.agent.hasQueuedMessages();this._isBeforeSettle=!0,this._abortDuringBeforeSettle=!1;try{let e=await this._extensionRunner.emitBoundary({type:"agent_before_settle",outcome:this._lastActivityOutcome},i=>this._buildBoundaryContext(i,"agent_before_settle"));this._commitBoundaryDrafts(e.entries),this._flushPendingCustomMessages();let n=this._buildBoundaryContext([],"agent_before_settle");if(this._abortDuringBeforeSettle)return!1;let r=e.continue||this.agent.hasQueuedMessages();return r&&!n.canContinue?(e.continue&&this._reportInvalidBoundaryContinuation("agent_before_settle"),!1):r}finally{this._isBeforeSettle=!1}}async _runInputHandlers(e,n,r,i){if(!this._extensionRunner.hasHandlers("input"))return{text:e,images:n};let s=await this._extensionRunner.emitInput(e,n,r,i);if(s.action!=="handled")return s.action==="transform"?{text:s.text,images:s.images??n}:{text:e,images:n}}async _normalizePromptImages(e){if(!e)return{images:[],hints:[]};let n=[],r=[];for(let i of e){let s=await $D(Buffer.from(i.data,"base64"),i.mimeType,{autoResizeImages:this.settingsManager.getImageAutoResize(),resizeOptions:this.model?.inputLimits?.images?.resize});if(!s.ok){r.push(s.message);continue}n.push({type:"image",data:s.data,mimeType:s.mimeType}),r.push(...s.hints)}return{images:n,hints:r}}async prompt(e,n){if(this._isEmittingAgentSettled){this._deferredSettledActions.push(async()=>await this.prompt(e,n));return}let r=n?.expandPromptTemplates??!0,i=n?.preflightResult,s;try{if(r&&e.startsWith("/")&&await this._tryExecuteExtensionCommand(e)){i?.(!0);return}if(this._compactionAbortController!==void 0)throw new Error("Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry.");let o=await this._runInputHandlers(e,n?.images,n?.source??"interactive",this.isStreaming?n?.streamingBehavior:void 0);if(!o){i?.(!0);return}let{text:a,images:c}=o,u=a;if(r&&(u=this._expandSkillCommand(u),u=imt(u,[...this.promptTemplates])),this.isStreaming){if(!n?.streamingBehavior)throw new Error("Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.");n.streamingBehavior==="followUp"?await this._queueFollowUp(u,c):await this._queueSteer(u,c),i?.(!0);return}if(this._flushPendingBashMessages(),this._flushPendingCustomMessages(),!this.model)throw new Error(Zlt());if(!(this._modelRuntime.hasConfiguredAuth(this.model.provider)||await this._modelRuntime.checkAuth(this.model.provider)!==void 0))throw this._modelRuntime.isUsingOAuth(this.model.provider)?new Error(`Authentication failed for "${this.model.provider}". Credentials may have expired or network is unavailable. Run '/login ${this.model.provider}' to re-authenticate.`):new Error(iRe(this.model.provider));let d=this._findLastAssistantMessage();d&&await this._checkCompaction(d,!1);let m=this._baseSystemPromptOptions.selectedTools,h=await this._extensionRunner.emitBeforeAgentStart(u,c,this._baseSystemPromptOptions);h.systemPromptOptions.selectedTools.length!==m.length||h.systemPromptOptions.selectedTools.some((_,S)=>_!==m[S])||(h.systemPromptOptions.selectedTools=this.getActiveToolNames());let g=await this._normalizePromptImages(c),A=g.hints.length>0?`${u} + +${g.hints.join(` +`)}`:u;s=[];let y=[{type:"text",text:A}];y.push(...g.images),s.push({role:"user",content:y,timestamp:Date.now()});for(let _ of this._pendingNextTurnMessages)s.push(_);this._pendingNextTurnMessages=[];for(let _ of h.messages)s.push({role:"custom",customType:_.customType,content:_.content??[],display:_.display,details:_.details,timestamp:Date.now()});let E=this._preparePromptAndToolLoadout(h.systemPromptOptions);this._runSystemPromptOptions=h.systemPromptOptions,E&&s.unshift(E)}catch(o){throw i?.(!1),o}s&&(i?.(!0),await this._runAgentPrompt(s))}async _tryExecuteExtensionCommand(e){let n=e.indexOf(" "),r=n===-1?e.slice(1):e.slice(1,n),i=n===-1?"":e.slice(n+1),s=this._extensionRunner.getCommand(r);if(!s)return!1;let o=this._extensionRunner.createCommandContext();try{return await s.handler(i,o),!0}catch(a){return this._extensionRunner.emitError({extensionPath:`command:${r}`,event:"command",error:a instanceof Error?a.message:String(a)}),!0}}_expandSkillCommand(e){if(!e.startsWith("/skill:"))return e;let n=e.indexOf(" "),r=n===-1?e.slice(7):e.slice(7,n),i=n===-1?"":e.slice(n+1).trim(),s=this.resourceLoader.getSkills().skills.find(o=>o.name===r);if(!s)return e;try{let o=(0,E8n.readFileSync)(s.filePath,"utf-8"),a=Hve(o).trim(),c=` +References are relative to ${s.baseDir}. ${a} -`;return s?`${c} +`;return i?`${c} -${s}`:c}catch(o){return this._extensionRunner.emitError({extensionPath:i.filePath,event:"skill_expansion",error:o instanceof Error?o.message:String(o)}),e}}async steer(e,n){e.startsWith("/")&&this._throwIfExtensionCommand(e);let r=this._expandSkillCommand(e);r=SCe(r,[...this.promptTemplates]),await this._queueSteer(r,n)}async followUp(e,n){e.startsWith("/")&&this._throwIfExtensionCommand(e);let r=this._expandSkillCommand(e);r=SCe(r,[...this.promptTemplates]),await this._queueFollowUp(r,n)}async _queueSteer(e,n){this._steeringMessages.push(e),this._emitQueueUpdate();let r=[{type:"text",text:e}];n&&r.push(...n),this.agent.steer({role:"user",content:r,timestamp:Date.now()})}async _queueFollowUp(e,n){this._followUpMessages.push(e),this._emitQueueUpdate();let r=[{type:"text",text:e}];n&&r.push(...n),this.agent.followUp({role:"user",content:r,timestamp:Date.now()})}_throwIfExtensionCommand(e){let n=e.indexOf(" "),r=n===-1?e.slice(1):e.slice(1,n);if(this._extensionRunner.getCommand(r))throw new Error(`Extension command "/${r}" cannot be queued. Use prompt() or execute the command when not streaming.`)}async sendCustomMessage(e,n){let r={role:"custom",customType:e.customType,content:e.content??[],display:e.display,details:e.details,timestamp:Date.now()};n?.deliverAs==="nextTurn"?this._pendingNextTurnMessages.push(r):this.isStreaming&&n?.triggerTurn!==!1?n?.deliverAs==="followUp"?this.agent.followUp(r):this.agent.steer(r):n?.triggerTurn?await this._runAgentPrompt(r):this.isStreaming?this._pendingCustomMessages.push(r):this._appendCustomMessage(r)}_appendCustomMessage(e){this.agent.state.messages.push(e),this.sessionManager.appendCustomMessageEntry(e.customType,e.content,e.display,e.details),this._emit({type:"message_start",message:e}),this._emit({type:"message_end",message:e})}_flushPendingCustomMessages(){if(this._pendingCustomMessages.length===0)return;let e=this._pendingCustomMessages;this._pendingCustomMessages=[];for(let n of e)this._appendCustomMessage(n)}async sendUserMessage(e,n){let r,s;if(typeof e=="string")r=e;else{let i=[];s=[];for(let o of e)o.type==="text"?i.push(o.text):s.push(o);r=i.join(` -`),s.length===0&&(s=void 0)}await this.prompt(r,{expandPromptTemplates:n?.expandPromptTemplates??!1,streamingBehavior:n?.deliverAs,images:s,source:"extension"})}clearQueue(){let e=[...this._steeringMessages],n=[...this._followUpMessages];return this._steeringMessages=[],this._followUpMessages=[],this.agent.clearAllQueues(),this._emitQueueUpdate(),{steering:e,followUp:n}}get pendingMessageCount(){return this._steeringMessages.length+this._followUpMessages.length}getSteeringMessages(){return this._steeringMessages}getFollowUpMessages(){return this._followUpMessages}get resourceLoader(){return this._resourceLoader}async abort(){this.abortRetry(),this.abortCompaction(),this.abortBranchSummary(),this.agent.abort(),await this.waitForIdle()}async waitForIdle(){this.isIdle||await this._getIdleWaitPromise()}async _emitModelSelect(e,n,r){cd(n,e)||await this._extensionRunner.emit({type:"model_select",model:e,previousModel:n,source:r})}async setModel(e,n={}){if(!await this._modelRuntime.checkAuth(e.provider))throw new Error(`No API key for ${e.provider}/${e.id}`);let r=this.model,s=this._getThinkingLevelForModelSwitch(e);this.agent.state.model=e,this.sessionManager.appendModelChange(e.provider,e.id),n.persist&&(this.settingsManager.setDefaultModelAndProvider(e.provider,e.id),this._addPersistedDefaultToNonEmptyScope(e)),this.setThinkingLevel(s),await this._emitModelSelect(e,r,"set")}_addPersistedDefaultToNonEmptyScope(e){if(this._scopedModels.length===0||this._scopedModels.some(s=>cd(s.model,e)))return;this._scopedModels=[...this._scopedModels,{model:e}];let n=this.settingsManager.getEnabledModels();if(!n?.length)return;let r=`${e.provider}/${e.id}`;n.some(s=>s.toLowerCase()===r.toLowerCase())||this.settingsManager.setEnabledModels([...n,r])}async cycleModel(e="forward",n={}){return this._scopedModels.length>0?this._cycleScopedModel(e,n):this._cycleAvailableModel(e,n)}async _cycleScopedModel(e,n){let r=new Set(this._modelRuntime.getAvailableSnapshot().map(d=>`${d.provider}\0${d.id}`)),s=this._scopedModels.filter(d=>r.has(`${d.model.provider}\0${d.model.id}`));if(s.length<=1)return;let i=this.model,o=s.findIndex(d=>cd(d.model,i));o===-1&&(o=0);let a=s.length,c=e==="forward"?(o+1)%a:(o-1+a)%a,u=s[c],l=this._getThinkingLevelForModelSwitch(u.model,u.thinkingLevel);return this.agent.state.model=u.model,this.sessionManager.appendModelChange(u.model.provider,u.model.id),n.persist&&(this.settingsManager.setDefaultModelAndProvider(u.model.provider,u.model.id),this._addPersistedDefaultToNonEmptyScope(u.model)),this.setThinkingLevel(l),await this._emitModelSelect(u.model,i,"cycle"),{model:u.model,thinkingLevel:this.thinkingLevel,isScoped:!0}}async _cycleAvailableModel(e,n){let r=this._modelRuntime.getAvailableSnapshot();if(r.length<=1)return;let s=this.model,i=r.findIndex(l=>cd(l,s));i===-1&&(i=0);let o=r.length,a=e==="forward"?(i+1)%o:(i-1+o)%o,c=r[a],u=this._getThinkingLevelForModelSwitch(c);return this.agent.state.model=c,this.sessionManager.appendModelChange(c.provider,c.id),n.persist&&(this.settingsManager.setDefaultModelAndProvider(c.provider,c.id),this._addPersistedDefaultToNonEmptyScope(c)),this.setThinkingLevel(u),await this._emitModelSelect(c,s,"cycle"),{model:c,thinkingLevel:this.thinkingLevel,isScoped:!1}}setThinkingLevel(e,n={}){let r=this.getAvailableThinkingLevels(),s=r.includes(e)?e:this._clampThinkingLevel(e,r),i=this.agent.state.thinkingLevel,o=s!==i;this.agent.state.thinkingLevel=s,n.persist&&this.settingsManager.setDefaultThinkingLevel(e),o&&(this.sessionManager.appendThinkingLevelChange(s),this._emit({type:"thinking_level_changed",level:s}),this._extensionRunner.emit({type:"thinking_level_select",level:s,previousLevel:i}))}cycleThinkingLevel(e={}){if(!this.supportsThinking())return;let n=this.getAvailableThinkingLevels(),s=(n.indexOf(this.thinkingLevel)+1)%n.length,i=n[s];return this.setThinkingLevel(i,e),i}getAvailableThinkingLevels(){return this.model?NR(this.model):[...eSe]}supportsThinking(){return!!this.model?.reasoning}_getThinkingLevelForModelSwitch(e,n){if(n!==void 0)return n;if(e){let r=this.settingsManager.getModelThinkingLevel(e.provider,e.id);if(r!==void 0)return r}return this.settingsManager.getDefaultThinkingLevel()??this.thinkingLevel??th}_clampThinkingLevel(e,n){return this.model?uu(this.model,e):"off"}syncQueueModesFromSettings(){this.agent.steeringMode=this.settingsManager.getSteeringMode(),this.agent.followUpMode=this.settingsManager.getFollowUpMode()}setSteeringMode(e){this.agent.steeringMode=e,this.settingsManager.setSteeringMode(e)}setFollowUpMode(e){this.agent.followUpMode=e,this.settingsManager.setFollowUpMode(e)}async _runDefaultCompaction(e,n,r,s,i,o,a,c){return J0e(e,n,r,s,i,o,this.thinkingLevel,this.agent.streamFunction,a,this.settingsManager.getRetrySettings(),this._summarizationRetryCallbacks({source:"compaction",reason:c}),void 0)}_clearManualCompactionState(){this._compactionAbortController=void 0,this._resolveIdleWaitIfIdle()}async compact(e){await this.abort(),this._compactionAbortController=new AbortController,this._emit({type:"compaction_start",reason:"manual"});let n=!1;try{if(!this.model)throw new Error(TJe());let{model:r,apiKey:s,headers:i,env:o}=await this._getSummarizationRequestAuth(this.model),a=this.sessionManager.getBranch(),c=this.settingsManager.getCompactionSettings(),u=LJe(a,c);if(!u)throw a[a.length-1]?.type==="compaction"?new Error("Already compacted"):new Error("Nothing to compact (session too small)");let l;if(this._extensionRunner.hasHandlers("session_before_compact")){let I=await this._extensionRunner.emit({type:"session_before_compact",preparation:u,branchEntries:a,customInstructions:e,reason:"manual",willRetry:!1,signal:this._compactionAbortController.signal});if(I?.cancel)throw new Error("Compaction cancelled");I?.compaction&&(l=I.compaction,n=!0)}let d,h,m,f,g;if(l)d=l.summary,h=l.firstKeptEntryId,m=l.tokensBefore,f=l.usage,g=l.details;else{let I=await this._runDefaultCompaction(u,r,s,i,e,this._compactionAbortController.signal,o,"manual");d=I.summary,h=I.firstKeptEntryId,m=I.tokensBefore,f=I.usage,g=I.details}if(this._compactionAbortController.signal.aborted)throw new Error("Compaction cancelled");this.sessionManager.appendCompaction(d,h,m,g,n,f);let A=this.sessionManager.getEntries(),y=this.sessionManager.buildSessionContext();this.agent.state.messages=y.messages;let b=S0n(y.messages),S=A.find(I=>I.type==="compaction"&&I.summary===d);this._extensionRunner&&S&&await this._extensionRunner.emit({type:"session_compact",compactionEntry:S,fromExtension:n,reason:"manual",willRetry:!1});let C={summary:d,firstKeptEntryId:h,tokensBefore:m,estimatedTokensAfter:b,usage:f,details:g};return this._clearManualCompactionState(),this._emit({type:"compaction_end",reason:"manual",result:C,aborted:!1,willRetry:!1}),C}catch(r){let s=r instanceof Error?r.message:String(r),i=s==="Compaction cancelled"||r instanceof Error&&r.name==="AbortError",o=i?void 0:`Compaction failed: ${s}`;throw this._clearManualCompactionState(),this._emit({type:"compaction_end",reason:"manual",result:void 0,aborted:i,willRetry:!1,errorMessage:o}),await this._emitSessionCompactFailed({reason:"manual",errorMessage:o,aborted:i,willRetry:!1,fromExtension:n}),r}finally{this._clearManualCompactionState()}}abortCompaction(){this._compactionAbortController?.abort(),this._autoCompactionAbortController?.abort()}abortBranchSummary(){this._branchSummaryAbortController?.abort()}async _checkCompaction(e,n=!0){let r=this.settingsManager.getCompactionSettings();if(!r.enabled||n&&e.stopReason==="aborted")return!1;let s=this.model?.contextWindow??0,i=this.model&&e.provider===this.model.provider&&e.model===this.model.id,o=yZ(this.sessionManager.getBranch());if(o!==null&&e.timestamp<=new Date(o.timestamp).getTime())return!1;let c=i&&a3(e,s),u=i&&C7(e,this.model?.maxTokens??0);if(c||u){let h=e.stopReason!=="stop";if(!h)return await this._runAutoCompaction("overflow",!1);if(this._overflowRecoveryAttempted){let f=c?"Context overflow recovery failed after one compact-and-retry attempt. Try reducing context or switching to a larger-context model.":"Truncated response recovery failed after one compact-and-retry attempt.";return this._emit({type:"compaction_end",reason:"overflow",result:void 0,aborted:!1,willRetry:!1,errorMessage:f}),await this._emitSessionCompactFailed({reason:"overflow",errorMessage:f,aborted:!1,willRetry:!1,fromExtension:!1}),!1}this._overflowRecoveryAttempted=!0;let m=this.agent.state.messages;return m.length>0&&m[m.length-1].role==="assistant"&&(this.agent.state.messages=m.slice(0,-1)),await this._runAutoCompaction("overflow",h)}let l,d=e.usage?eL(e.usage):0;if(e.stopReason==="error"||d===0){let h=this.agent.state.messages,m=SZ(h);if(m.lastUsageIndex!==null){let f=h[m.lastUsageIndex];if(o&&f.role==="assistant"&&f.timestamp<=new Date(o.timestamp).getTime())return!1}l=m.tokens}else l=d;return CZ(l,s,r)?await this._runAutoCompaction("threshold",!1):!1}async _runAutoCompaction(e,n){let r=this.settingsManager.getCompactionSettings(),s=!1,i=!1;try{if(!this.model)return!1;let{model:o,apiKey:a,headers:c,env:u}=await this._getSummarizationRequestAuth(this.model),l=this.sessionManager.getBranch(),d=LJe(l,r);if(!d)return!1;this._emit({type:"compaction_start",reason:e}),this._autoCompactionAbortController=new AbortController,s=!0;let h;if(this._extensionRunner.hasHandlers("session_before_compact")){let w=await this._extensionRunner.emit({type:"session_before_compact",preparation:d,branchEntries:l,customInstructions:void 0,reason:e,willRetry:n,signal:this._autoCompactionAbortController.signal});if(w?.cancel)return this._emit({type:"compaction_end",reason:e,result:void 0,aborted:!0,willRetry:!1}),await this._emitSessionCompactFailed({reason:e,aborted:!0,willRetry:!1,fromExtension:!1}),!1;w?.compaction&&(h=w.compaction,i=!0)}let m,f,g,A,y;if(h)m=h.summary,f=h.firstKeptEntryId,g=h.tokensBefore,A=h.usage,y=h.details;else{let w=await this._runDefaultCompaction(d,o,a,c,void 0,this._autoCompactionAbortController.signal,u,e);m=w.summary,f=w.firstKeptEntryId,g=w.tokensBefore,A=w.usage,y=w.details}if(this._autoCompactionAbortController.signal.aborted)return this._emit({type:"compaction_end",reason:e,result:void 0,aborted:!0,willRetry:!1}),await this._emitSessionCompactFailed({reason:e,aborted:!0,willRetry:!1,fromExtension:i}),!1;this.sessionManager.appendCompaction(m,f,g,y,i,A);let b=this.sessionManager.getEntries(),S=this.sessionManager.buildSessionContext();this.agent.state.messages=S.messages;let C=S0n(S.messages),I=b.find(w=>w.type==="compaction"&&w.summary===m);this._extensionRunner&&I&&await this._extensionRunner.emit({type:"session_compact",compactionEntry:I,fromExtension:i,reason:e,willRetry:n});let x={summary:m,firstKeptEntryId:f,tokensBefore:g,estimatedTokensAfter:C,usage:A,details:y};if(this._emit({type:"compaction_end",reason:e,result:x,aborted:!1,willRetry:n}),n){let w=this.agent.state.messages,R=w[w.length-1];return R?.role==="assistant"&&(R.stopReason==="error"||R.stopReason==="length")&&(this.agent.state.messages=w.slice(0,-1)),!0}return this.agent.hasQueuedMessages()}catch(o){let a=o instanceof Error?o.message:"compaction failed";if(s){let c=e==="overflow"?`Context overflow recovery failed: ${a}`:`Auto-compaction failed: ${a}`;this._emit({type:"compaction_end",reason:e,result:void 0,aborted:!1,willRetry:!1,errorMessage:c}),await this._emitSessionCompactFailed({reason:e,errorMessage:c,aborted:!1,willRetry:!1,fromExtension:i})}return!1}finally{this._autoCompactionAbortController=void 0,this._resolveIdleWaitIfIdle()}}setAutoCompactionEnabled(e){this.settingsManager.setCompactionEnabled(e)}get autoCompactionEnabled(){return this.settingsManager.getCompactionEnabled()}async bindExtensions(e){e.uiContext!==void 0&&(this._extensionUIContext=e.uiContext),e.mode!==void 0&&(this._extensionMode=e.mode),e.commandContextActions!==void 0&&(this._extensionCommandContextActions=e.commandContextActions),e.abortHandler!==void 0&&(this._extensionAbortHandler=e.abortHandler),e.shutdownHandler!==void 0&&(this._extensionShutdownHandler=e.shutdownHandler),e.onError!==void 0&&(this._extensionErrorListener=e.onError),this._applyExtensionBindings(this._extensionRunner),await this._extensionRunner.emit(this._sessionStartEvent),await this.extendResourcesFromExtensions(this._sessionStartEvent.reason==="reload"?"reload":"startup")}async extendResourcesFromExtensions(e){if(!this._extensionRunner.hasHandlers("resources_discover"))return;let{skillPaths:n,promptPaths:r,themePaths:s}=await this._extensionRunner.emitResourcesDiscover(this._cwd,e);if(n.length===0&&r.length===0&&s.length===0)return;let i={skillPaths:this.buildExtensionResourcePaths(n),promptPaths:this.buildExtensionResourcePaths(r),themePaths:this.buildExtensionResourcePaths(s)};this._resourceLoader.extendResources(i),this._baseSystemPrompt=this._rebuildSystemPrompt(this.getActiveToolNames()),this.agent.state.systemPrompt=this._baseSystemPrompt}buildExtensionResourcePaths(e){return e.map(n=>{let r=this.getExtensionSourceLabel(n.extensionPath),s=n.extensionPath.startsWith("<")?void 0:(0,qCe.dirname)(n.extensionPath);return{path:n.path,metadata:{source:r,scope:"temporary",origin:"top-level",baseDir:s}}})}getExtensionSourceLabel(e){return e.startsWith("<")?`extension:${e.replace(/[<>]/g,"")}`:`extension:${(0,qCe.basename)(e).replace(/\.(ts|js)$/,"")}`}_applyExtensionBindings(e){e.setUIContext(this._extensionUIContext,this._extensionMode),e.bindCommandContext(this._extensionCommandContextActions),this._extensionErrorUnsubscriber?.(),this._extensionErrorUnsubscriber=this._extensionErrorListener?e.onError(this._extensionErrorListener):void 0}_refreshCurrentModelFromRegistry(){let e=this.model;if(!e)return;let n=this._modelRuntime.getModel(e.provider,e.id);!n||n===e||(this.agent.state.model=n)}_bindExtensionCore(e){let n=()=>{let r=e.getRegisteredCommands().map(o=>({name:o.invocationName,description:o.description,source:"extension",sourceInfo:o.sourceInfo})),s=this.promptTemplates.map(o=>({name:o.name,description:o.description,source:"prompt",sourceInfo:o.sourceInfo})),i=this._resourceLoader.getSkills().skills.map(o=>({name:`skill:${o.name}`,description:o.description,source:"skill",sourceInfo:o.sourceInfo}));return[...r,...s,...i]};e.bindCore({sendMessage:(r,s)=>{this.sendCustomMessage(r,s).catch(i=>{e.emitError({extensionPath:"",event:"send_message",error:i instanceof Error?i.message:String(i)})})},sendUserMessage:(r,s)=>{this.sendUserMessage(r,s).catch(i=>{e.emitError({extensionPath:"",event:"send_user_message",error:i instanceof Error?i.message:String(i)})})},appendEntry:(r,s)=>{let i=this.sessionManager.appendCustomEntry(r,s),o=this.sessionManager.getEntry(i);o&&this._emit({type:"entry_appended",entry:o})},setSessionName:r=>{this.setSessionName(r)},getSessionName:()=>this.sessionManager.getSessionName(),setLabel:(r,s)=>{this.sessionManager.appendLabelChange(r,s)},getActiveTools:()=>this.getActiveToolNames(),getAllTools:()=>this.getAllTools(),setActiveTools:r=>this.setActiveToolsByName(r),refreshTools:()=>this._refreshToolRegistry(),getCommands:n,setModel:async r=>this._modelRuntime.hasConfiguredAuth(r.provider)?(await this.setModel(r),!0):!1,getThinkingLevel:()=>this.thinkingLevel,setThinkingLevel:r=>this.setThinkingLevel(r)},{getModel:()=>this.model,getScopedModels:()=>this._scopedModels,isIdle:()=>this.isIdle,isProjectTrusted:()=>this.settingsManager.isProjectTrusted(),getSignal:()=>this.agent.signal,abort:()=>{if(this._extensionAbortHandler){this._extensionAbortHandler();return}this.abort()},hasPendingMessages:()=>this.pendingMessageCount>0,shutdown:()=>{this._extensionShutdownHandler?.()},getContextUsage:()=>this.getContextUsage(),compact:r=>{(async()=>{try{let s=await this.compact(r?.customInstructions);r?.onComplete?.(s)}catch(s){let i=s instanceof Error?s:new Error(String(s));r?.onError?.(i)}})()},getSystemPrompt:()=>this.systemPrompt,getSystemPromptOptions:()=>this._baseSystemPromptOptions},{registerProvider:(r,s)=>{this._modelRuntime.registerProvider(r,s),this._refreshCurrentModelFromRegistry()},registerNativeProvider:r=>{this._modelRuntime.registerNativeProvider(r),this._refreshCurrentModelFromRegistry()},unregisterProvider:r=>{this._modelRuntime.unregisterProvider(r),this._refreshCurrentModelFromRegistry()}})}_refreshToolRegistry(e){let n=new Set(this._toolRegistry.keys()),r=this.getActiveToolNames(),s=this._allowedToolNames,i=this._excludedToolNames,o=g=>(!s||s.has(g))&&!i?.has(g),c=[...this._extensionRunner.getAllRegisteredTools(),...this._customTools.map(g=>({definition:g,sourceInfo:rh(``,{source:"sdk"})}))].filter(g=>o(g.definition.name)),u=new Map(Array.from(this._baseToolDefinitions.entries()).filter(([g])=>o(g)).map(([g,A])=>[g,{definition:A,sourceInfo:rh(``,{source:"builtin"})}]));for(let g of c)u.set(g.definition.name,{definition:g.definition,sourceInfo:g.sourceInfo});this._toolDefinitions=u,this._toolPromptSnippets=new Map(Array.from(u.values()).map(({definition:g})=>{let A=this._normalizePromptSnippet(g.promptSnippet);return A?[g.name,A]:void 0}).filter(g=>g!==void 0)),this._toolPromptGuidelines=new Map(Array.from(u.values()).map(({definition:g})=>{let A=this._normalizePromptGuidelines(g.promptGuidelines);return A.length>0?[g.name,A]:void 0}).filter(g=>g!==void 0));let l=this._extensionRunner,d=O5(c,l),h=O5(Array.from(this._baseToolDefinitions.values()).filter(g=>o(g.name)).map(g=>({definition:g,sourceInfo:rh(``,{source:"builtin"})})),l),m=new Map(h.map(g=>[g.name,g]));for(let g of d)m.set(g.name,g);this._toolRegistry=m;let f=(e?.activeToolNames?[...e.activeToolNames]:[...r]).filter(g=>o(g));if(s)for(let g of this._toolRegistry.keys())s.has(g)&&f.push(g);else if(e?.includeAllExtensionTools)for(let g of d)f.push(g.name);else if(!e?.activeToolNames)for(let g of this._toolRegistry.keys())n.has(g)||f.push(g);this.setActiveToolsByName([...new Set(f)])}_buildRuntime(e){let n=this.settingsManager.getImageAutoResize(),r=this.settingsManager.getShellCommandPrefix(),s=this.settingsManager.getShellPath(),i=this._baseToolsOverride?Object.fromEntries(Object.entries(this._baseToolsOverride).map(([u,l])=>[u,Kbn(l)])):E0n(this._cwd,{read:{autoResizeImages:n},bash:{commandPrefix:r,shellPath:s}});this._baseToolDefinitions=new Map(Object.entries(i).map(([u,l])=>[u,l]));let o=this._resourceLoader.getExtensions();if(e.flagValues)for(let[u,l]of e.flagValues)o.runtime.flagValues.set(u,l);this._extensionRunner=new hL(o.extensions,o.runtime,this._cwd,this.sessionManager,new L5(this._modelRuntime)),this._extensionRunnerRef&&(this._extensionRunnerRef.current=this._extensionRunner),this._bindExtensionCore(this._extensionRunner),this._applyExtensionBindings(this._extensionRunner);let a=this._baseToolsOverride?Object.keys(this._baseToolsOverride):["read","bash","edit","write"],c=e.activeToolNames??a;this._refreshToolRegistry({activeToolNames:c,includeAllExtensionTools:e.includeAllExtensionTools})}async reload(e){let n=this._extensionRunner,r=n.getFlagValues();await tee(n,{type:"session_shutdown",reason:"reload"}),n.invalidate(),await this.settingsManager.reload(),this.syncQueueModesFromSettings(),e8e(),await this._resourceLoader.reload(),this._buildRuntime({activeToolNames:this.getActiveToolNames(),flagValues:r,includeAllExtensionTools:!0}),(this._extensionUIContext||this._extensionCommandContextActions||this._extensionShutdownHandler||this._extensionErrorListener)&&(await e?.beforeSessionStart?.(),await this._extensionRunner.emit({type:"session_start",reason:"reload"}),await this.extendResourcesFromExtensions("reload"))}_isRetryableError(e){return a3(e,this.model?.contextWindow??0)?!1:z_(e)}_summarizationRetryCallbacks(e){return{onRetryScheduled:(n,r,s,i)=>{this._emit({type:"summarization_retry_scheduled",attempt:n,maxAttempts:r,delayMs:s,errorMessage:i})},onRetryAttemptStart:()=>{this._emit({type:"summarization_retry_attempt_start",...e})},onRetryFinished:()=>{this._emit({type:"summarization_retry_finished"})}}}async _prepareRetry(e){let n=this.settingsManager.getRetrySettings();if(!n.enabled)return!1;if(this._retryAttempt++,this._retryAttempt>n.maxRetries)return this._retryAttempt--,!1;let r=n.baseDelayMs*2**(this._retryAttempt-1);this._emit({type:"auto_retry_start",attempt:this._retryAttempt,maxAttempts:n.maxRetries,delayMs:r,errorMessage:e.errorMessage||"Unknown error"});let s=this.agent.state.messages;s.length>0&&s[s.length-1].role==="assistant"&&(this.agent.state.messages=s.slice(0,-1)),this._retryAbortController=new AbortController;try{await Mgn(r,this._retryAbortController.signal)}catch{let i=this._retryAttempt;return this._retryAttempt=0,this._emit({type:"auto_retry_end",success:!1,attempt:i,finalError:"Retry cancelled"}),!1}finally{this._retryAbortController=void 0}return!0}abortRetry(){this._retryAbortController?.abort()}get isRetrying(){return this._retryAbortController!==void 0}get autoRetryEnabled(){return this.settingsManager.getRetryEnabled()}setAutoRetryEnabled(e){this.settingsManager.setRetryEnabled(e)}async executeBash(e,n,r){let s=new AbortController;this._bashAbortControllers.add(s);let i=this.settingsManager.getShellCommandPrefix(),o=this.settingsManager.getShellPath(),a=i?`${i} -${e}`:e;try{let c=await iAn(a,this.sessionManager.getCwd(),r?.operations??Q5({shellPath:o}),{onChunk:u=>{n?.(u),this._emit({type:"bash_execution_update",id:r?.id,delta:u})},signal:s.signal});return this.recordBashResult(e,c,r),c}finally{this._bashAbortControllers.delete(s)}}recordBashResult(e,n,r){let s={role:"bashExecution",command:e,output:n.output,exitCode:n.exitCode,cancelled:n.cancelled,truncated:n.truncated,fullOutputPath:n.fullOutputPath,timestamp:Date.now(),excludeFromContext:r?.excludeFromContext};this.isStreaming?this._pendingBashMessages.push(s):(this.agent.state.messages.push(s),this.sessionManager.appendMessage(s))}abortBash(){for(let e of[...this._bashAbortControllers])e.abort()}get isBashRunning(){return this._bashAbortControllers.size>0}get hasPendingBashMessages(){return this._pendingBashMessages.length>0}_flushPendingBashMessages(){if(this._pendingBashMessages.length!==0){for(let e of this._pendingBashMessages)this.agent.state.messages.push(e),this.sessionManager.appendMessage(e);this._pendingBashMessages=[]}}setSessionName(e){this.sessionManager.appendSessionInfo(e);let n={type:"session_info_changed",name:this.sessionManager.getSessionName()};this._emit(n),this._extensionRunner.emit(n)}async navigateTree(e,n={}){if(this.isStreaming)throw new Error("Wait for the current response to finish before navigating the session tree.");let r=this.sessionManager.getLeafId();if(e===r)return{cancelled:!1};if(n.summarize&&!this.model)throw new Error("No model available for summarization");let s=this.sessionManager.getEntry(e);if(!s)throw new Error(`Entry ${e} not found`);let{entries:i,commonAncestorId:o}=X0e(this.sessionManager,r,e),a=n.customInstructions,c=n.replaceInstructions,u=n.label,l={targetId:e,oldLeafId:r,commonAncestorId:o,entriesToSummarize:i,userWantsSummary:n.summarize??!1,customInstructions:a,replaceInstructions:c,label:u};this._branchSummaryAbortController=new AbortController;try{let d,h=!1;if(this._extensionRunner.hasHandlers("session_before_tree")){let C=await this._extensionRunner.emit({type:"session_before_tree",preparation:l,signal:this._branchSummaryAbortController.signal});if(C?.cancel)return{cancelled:!0};C?.summary&&n.summarize&&(d=C.summary,h=!0),C?.customInstructions!==void 0&&(a=C.customInstructions),C?.replaceInstructions!==void 0&&(c=C.replaceInstructions),C?.label!==void 0&&(u=C.label)}let m,f,g;if(n.summarize&&i.length>0&&!d){let C=this.model,{model:I,apiKey:x,headers:w,env:R}=await this._getSummarizationRequestAuth(C),N=this.settingsManager.getBranchSummarySettings(),P=await Z0e(i,{model:I,apiKey:x,headers:w,env:R,signal:this._branchSummaryAbortController.signal,customInstructions:a,replaceInstructions:c,reserveTokens:N.reserveTokens,streamFn:this.agent.streamFunction,retry:this.settingsManager.getRetrySettings(),callbacks:this._summarizationRetryCallbacks({source:"branchSummary"})});if(P.aborted)return{cancelled:!0,aborted:!0};if(P.error)throw new Error(P.error);m=P.summary,g=P.usage,f={readFiles:P.readFiles||[],modifiedFiles:P.modifiedFiles||[]}}else d&&(m=d.summary,f=d.details,g=d.usage);let A,y;s.type==="message"&&s.message.role==="user"?(A=s.parentId,y=yc(s.message.content,"")):s.type==="custom_message"?(A=s.parentId,y=yc(s.content,"")):A=e;let b;if(m){let C=this.sessionManager.branchWithSummary(A,m,f,h,g);b=this.sessionManager.getEntry(C),u&&this.sessionManager.appendLabelChange(C,u)}else A===null?this.sessionManager.resetLeaf():this.sessionManager.branch(A);u&&!m&&this.sessionManager.appendLabelChange(e,u);let S=this.sessionManager.buildSessionContext();return this.agent.state.messages=S.messages,await this._extensionRunner.emit({type:"session_tree",newLeafId:this.sessionManager.getLeafId(),oldLeafId:r,summaryEntry:b,fromExtension:m?h:void 0}),{editorText:y,cancelled:!1,summaryEntry:b}}finally{this._branchSummaryAbortController=void 0,this._resolveIdleWaitIfIdle()}}getUserMessagesForForking(){let e=this.sessionManager.getEntries(),n=[];for(let r of e){if(r.type!=="message"||r.message.role!=="user")continue;let s=yc(r.message.content,"");s&&n.push({entryId:r.id,text:s})}return n}getSessionStats(){let e=0,n=0,r=0,s=0,i=0,o=bee();for(let a of this.sessionManager.getEntries()){if((a.type==="branch_summary"||a.type==="compaction")&&a.usage&&wT(o,a.usage),a.type!=="message")continue;s++;let c=a.message;if(c.role==="user")e++;else if(c.role==="toolResult")r++,c.usage&&wT(o,c.usage);else if(c.role==="assistant"){n++;let u=c;Array.isArray(u.content)&&(i+=u.content.filter(l=>l.type==="toolCall").length),wT(o,u.usage)}}return{sessionFile:this.sessionFile,sessionId:this.sessionId,userMessages:e,assistantMessages:n,toolCalls:i,toolResults:r,totalMessages:s,tokens:{input:o.input,output:o.output,cacheRead:o.cacheRead,cacheWrite:o.cacheWrite,total:o.input+o.output+o.cacheRead+o.cacheWrite},cost:o.cost,contextUsage:this.getContextUsage()}}getContextUsage(){let e=this.model;if(!e)return;let n=e.contextWindow??0;if(n<=0)return;let r=this.sessionManager.getBranch(),s=yZ(r);if(s){let a=r.lastIndexOf(s),c=!1;for(let u=r.length-1;u>a;u--){let l=r[u];if(l.type==="message"&&l.message.role==="assistant"){let d=l.message;if(d.stopReason!=="aborted"&&d.stopReason!=="error"&&eL(d.usage)>0){c=!0;break}}}if(!c)return{tokens:null,contextWindow:n,percent:null}}let i=SZ(this.messages),o=i.tokens/n*100;return{tokens:i.tokens,contextWindow:n,percent:o}}async exportToHtml(e,n={}){let r=[n.themeName,this.settingsManager.getTheme()].find(i=>i!==void 0&&b_e(i)!==void 0),s=LAn({getToolDefinition:i=>this.getToolDefinition(i),theme:Se,cwd:this.sessionManager.getCwd()});return await NAn(this.sessionManager,this.state,{outputPath:e,themeName:r,toolRenderer:s})}exportToJsonl(e){return CCe(this.sessionManager,e)}getLastAssistantText(){let e=this.messages.slice().reverse().find(r=>{if(r.role!=="assistant")return!1;let s=r;return!(s.stopReason==="aborted"&&s.content.length===0)});if(!e)return;let n="";for(let r of e.content)r.type==="text"&&(n+=r.text);return n.trim()||void 0}createReplacedSessionContext(){let e=Object.defineProperties({},Object.getOwnPropertyDescriptors(this._extensionRunner.createCommandContext()));return e.sendMessage=(n,r)=>this.sendCustomMessage(n,r),e.sendUserMessage=(n,r)=>this.sendUserMessage(n,r),e}hasExtensionHandlers(e){return this._extensionRunner.hasHandlers(e)}get extensionRunner(){return this._extensionRunner}};p();var Wh=require("fs"),TL=require("path"),Iet=Gt(Iee(),1),xet=require("timers/promises");p();function tSn(t){if(t.reason!==void 0)return t.reason;let e=new Error("The operation was aborted");return e.name="AbortError",e}function wL(t){return t??new AbortController().signal}function lI(t,e){return e?e.aborted?(t.catch(()=>{}),Promise.reject(tSn(e))):new Promise((n,r)=>{let s=!1,i=()=>e.removeEventListener("abort",o),o=()=>{s||(s=!0,i(),r(tSn(e)))};e.addEventListener("abort",o,{once:!0}),t.then(a=>{s||(s=!0,i(),n(a))},a=>{s||(s=!0,i(),r(a))}),e.aborted&&o()}):t}var Cet={encoding:"utf-8",mode:384},rIe,xee=class{authPath;constructor(e=(0,TL.join)(ls(),"auth.json")){this.authPath=Mo(e)}ensureParentDir(){let e=(0,TL.dirname)(this.authPath);(0,Wh.existsSync)(e)||(0,Wh.mkdirSync)(e,{recursive:!0,mode:448})}ensureFileExists(){(0,Wh.existsSync)(this.authPath)||(0,Wh.writeFileSync)(this.authPath,"{}",Cet)}acquireLockSyncWithRetry(e){let s;for(let i=1;i<=10;i++)try{return Iet.default.lockSync(e,{realpath:!1})}catch(o){if((typeof o=="object"&&o!==null&&"code"in o?String(o.code):void 0)!=="ELOCKED"||i===10)throw o;s=o;let c=Date.now();for(;Date.now()-c<20;);}throw s??new Error("Failed to acquire auth storage lock")}withLock(e){this.ensureParentDir(),this.ensureFileExists();let n;try{n=this.acquireLockSyncWithRetry(this.authPath);let r=(0,Wh.existsSync)(this.authPath)?(0,Wh.readFileSync)(this.authPath,"utf-8"):void 0,{result:s,next:i}=e(r);return i!==void 0&&(0,Wh.writeFileSync)(this.authPath,i,Cet),s}finally{n&&n()}}async acquireLockAsync(e,n){let i=Date.now()+3e4,o=0;for(;;){e?.throwIfAborted();let a;try{a=await Iet.default.lock(this.authPath,{realpath:!1,retries:0,stale:3e4,onCompromised:n})}catch(c){e?.throwIfAborted();let u=typeof c=="object"&&c!==null&&"code"in c?String(c.code):void 0,l=i-Date.now();if(u!=="ELOCKED"||l<=0)throw c;let d=Math.min(10*2**o,2e3/2);o++;let h=Math.min(Math.round(d*(1+Math.random())),l);e?await(0,xet.setTimeout)(h,void 0,{signal:e}):await(0,xet.setTimeout)(h);continue}return e?.aborted&&(await a(),e.throwIfAborted()),a}}async withLockAsync(e,n){n?.signal?.throwIfAborted(),this.ensureParentDir(),this.ensureFileExists();let r,s=!1,i,o=()=>{if(s)throw i??new Error("Auth storage lock was compromised")};try{r=await this.acquireLockAsync(n?.signal,l=>{s=!0,i=l}),o(),n?.signal?.throwIfAborted();let a=(0,Wh.existsSync)(this.authPath)?(0,Wh.readFileSync)(this.authPath,"utf-8"):void 0,{result:c,next:u}=await e(a);return o(),n?.signal?.throwIfAborted(),u!==void 0&&(0,Wh.writeFileSync)(this.authPath,u,Cet),o(),c}finally{if(r)try{await r()}catch{}}}},sIe=class{authPath;data;constructor(e=(0,TL.join)(ls(),"auth.json")){this.authPath=Mo(e)}load(){if(this.data)return this.data;let e;try{e=JSON.parse(Mi((0,Wh.readFileSync)(this.authPath,"utf-8")))}catch(n){if(n.code==="ENOENT")return this.data={},this.data;throw new Error(`Failed to read auth.json: ${n instanceof Error?n.message:String(n)}`)}if(typeof e!="object"||e===null||Array.isArray(e))throw new Error("Invalid auth.json: expected an object");for(let[n,r]of Object.entries(e)){if(typeof r!="object"||r===null||Array.isArray(r))throw new Error(`Invalid auth.json credential for provider "${n}"`);let s=r;if(s.type==="api_key"){let i=s.key===void 0||typeof s.key=="string",o=s.env===void 0||typeof s.env=="object"&&s.env!==null&&!Array.isArray(s.env)&&Object.values(s.env).every(a=>typeof a=="string");if(i&&o)continue}else if(s.type==="oauth"&&typeof s.access=="string"&&typeof s.refresh=="string"&&typeof s.expires=="number"&&Number.isFinite(s.expires))continue;throw new Error(`Invalid auth.json credential for provider "${n}"`)}return this.data=e,this.data}async read(e,n){n?.signal?.throwIfAborted();let r=this.load()[e];if(n?.signal?.throwIfAborted(),!!r)return r.type!=="api_key"||!r.key||see(r.key)?structuredClone(r):{...r,key:PZe(r.key,r.env)}}async list(e){e?.signal?.throwIfAborted();let n=Object.entries(this.load()).map(([r,s])=>({providerId:r,type:s.type}));return e?.signal?.throwIfAborted(),n}async modify(e,n,r){throw new Error("Read-only credential storage cannot modify auth.json")}async delete(e,n){throw new Error("Read-only credential storage cannot modify auth.json")}},wet=class{value;asyncChain=Promise.resolve();withLock(e){let{result:n,next:r}=e(this.value);return r!==void 0&&(this.value=r),n}withLockAsync(e,n){let r=this.asyncChain,s=(async()=>{await r.catch(()=>{}),n?.signal?.throwIfAborted();let{result:i,next:o}=await e(this.value);return n?.signal?.throwIfAborted(),o!==void 0&&(this.value=o),i})();return this.asyncChain=s.catch(()=>{}),lI(s,n?.signal)}},u4=class t{storage;authPath;readState;constructor(e,n){if(this.storage=e,this.authPath=n,this.readState=n&&rIe?.authPath===n?rIe.readState:{data:{}},n&&!rIe&&(rIe={authPath:n,readState:this.readState}),n){let r=jw(n);if(r!==void 0&&r===this.readState.revision)return}this.reload()}static create(e=(0,TL.join)(ls(),"auth.json")){let n=Mo(e);return new t(new xee(n),n)}static fromStorage(e){return new t(e)}static inMemory(e={}){let n=new wet;return n.withLock(()=>({result:void 0,next:JSON.stringify(e,null,2)})),t.fromStorage(n)}parseStorageData(e){return e?JSON.parse(Mi(e)):{}}updateReadState(e,n){this.readState.data=e,this.readState.revision=n}reload(){let e,n;try{this.storage.withLock(r=>(e=r,n=this.authPath?jw(this.authPath):void 0,{result:void 0})),this.updateReadState(this.parseStorageData(e),n)}catch{}}async reloadFromStorageAsync(e){return this.storage.withLockAsync(async n=>{let r=this.parseStorageData(n),s=this.authPath?jw(this.authPath):void 0;return this.updateReadState(r,s),{result:r}},e)}async readLatestData(e){if(e?.signal?.throwIfAborted(),!this.authPath){let s=this.reloadFromStorageAsync(e);return e?.signal?s:s.catch(()=>this.readState.data)}let n=jw(this.authPath);if(n!==void 0&&n===this.readState.revision)return this.readState.data;if(!this.readState.reload){let s=new AbortController,i={controller:s,promise:this.reloadFromStorageAsync({signal:s.signal}),readers:0};this.readState.reload=i,i.promise.then(()=>{this.readState.reload===i&&(this.readState.reload=void 0)},()=>{this.readState.reload===i&&(this.readState.reload=void 0)})}let r=this.readState.reload;r.readers++;try{let s=lI(r.promise,e?.signal);return e?.signal?await s:await s.catch(()=>this.readState.data)}finally{r.readers--,r.readers===0&&this.readState.reload===r&&(this.readState.reload=void 0,r.controller.abort())}}async read(e,n){let r=(await this.readLatestData(n))[e];return n?.signal?.throwIfAborted(),r?.type!=="api_key"||r.key===void 0?r:{...r,key:PZe(r.key,r.env)}}async modify(e,n,r){let s=this.readState.data,i,o=await this.storage.withLockAsync(async a=>{let c=this.parseStorageData(a),u=await n(c[e]);if(u===void 0)return s=c,i=this.authPath?jw(this.authPath):void 0,{result:c[e]};let l={...c,[e]:u};return s=l,{result:u,next:JSON.stringify(l,null,2)}},r);return this.updateReadState(s,i),o}async delete(e,n){let r=this.readState.data;await this.storage.withLockAsync(async s=>{let i=this.parseStorageData(s);return delete i[e],r=i,{result:void 0,next:JSON.stringify(i,null,2)}},n),this.updateReadState(r)}async list(e){let n=Object.entries(await this.readLatestData(e));return e?.signal?.throwIfAborted(),n.map(([r,s])=>({providerId:r,type:s.type}))}};function nSn(t,e=(0,TL.join)(ls(),"auth.json")){try{return JSON.parse(Mi((0,Wh.readFileSync)(Mo(e),"utf-8")))[t]}catch{return}}p();p();p();p();var Tet=(t,e,n)=>{let r=t instanceof RegExp?rSn(t,n):t,s=e instanceof RegExp?rSn(e,n):e,i=r!==null&&s!=null&&mEs(r,s,n);return i&&{start:i[0],end:i[1],pre:n.slice(0,i[0]),body:n.slice(i[0]+r.length,i[1]),post:n.slice(i[1]+s.length)}},rSn=(t,e)=>{let n=e.match(t);return n?n[0]:null},mEs=(t,e,n)=>{let r,s,i,o,a,c=n.indexOf(t),u=n.indexOf(e,c+1),l=c;if(c>=0&&u>0){if(t===e)return[c,u];for(r=[],i=n.length;l>=0&&!a;){if(l===c)r.push(l),c=n.indexOf(t,l+1);else if(r.length===1){let d=r.pop();d!==void 0&&(a=[d,u])}else s=r.pop(),s!==void 0&&s=0?c:u}r.length&&o!==void 0&&(a=[i,o])}return a};var sSn="\0SLASH"+Math.random()+"\0",iSn="\0OPEN"+Math.random()+"\0",ket="\0CLOSE"+Math.random()+"\0",oSn="\0COMMA"+Math.random()+"\0",aSn="\0PERIOD"+Math.random()+"\0",fEs=new RegExp(sSn,"g"),gEs=new RegExp(iSn,"g"),AEs=new RegExp(ket,"g"),yEs=new RegExp(oSn,"g"),EEs=new RegExp(aSn,"g"),bEs=/\\\\/g,_Es=/\\{/g,SEs=/\\}/g,CEs=/\\,/g,IEs=/\\\./g,xEs=1e5,wEs=4e6;function vet(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function TEs(t){return t.replace(bEs,sSn).replace(_Es,iSn).replace(SEs,ket).replace(CEs,oSn).replace(IEs,aSn)}function vEs(t){return t.replace(fEs,"\\").replace(gEs,"{").replace(AEs,"}").replace(yEs,",").replace(EEs,".")}function cSn(t){if(!t)return[""];let e=[],n=Tet("{","}",t);if(!n)return t.split(",");let{pre:r,body:s,post:i}=n,o=r.split(",");o[o.length-1]+="{"+s+"}";let a=cSn(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function lSn(t,e={}){if(!t)return[];let{max:n=xEs,maxLength:r=wEs}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),Ret(TEs(t),n,r,!0).map(vEs)}function REs(t){return"{"+t+"}"}function kEs(t){return/^-?0\d/.test(t)}function NEs(t,e){return t<=e}function DEs(t,e){return t>=e}function wee(t,e,n,r,s,i){let o=[],a=0;for(let c=0;c=r)return o;let l=t[c]+e+n[u];if(!(i&&!l)){if(a+l.length>s)return o;o.push(l),a+=l.length}}return o}function BEs(t,e,n,r){let s=t.split(/\.\./),i=[];if(s[0]===void 0||s[1]===void 0)return i;let o=vet(s[0]),a=vet(s[1]),c=Math.max(s[0].length,s[1].length),u=s.length===3&&s[2]!==void 0?Math.max(Math.abs(vet(s[2])),1):1,l=NEs;a0){let y=new Array(A+1).join("0");f<0?g="-"+y+g.slice(1):g=y+g}}if(m+g.length>r)break;i.push(g),m+=g.length}return i}function Ret(t,e,n,r){let s=[""],i=!1,o=!0;for(;;){let a=Tet("{","}",t);if(!a)return wee(s,t,[""],e,n,i);let c=a.pre;if(/\$$/.test(c)){if(s=wee(s,c+"{"+a.body+"}",[""],e,n,i&&!a.post.length),o=!1,!a.post.length)break;t=a.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),d=u||l,h=a.body.indexOf(",")>=0;if(!d&&!h){if(a.post.match(/,(?!,).*\}/)){t=a.pre+"{"+a.body+ket+a.post,r=!0;continue}return wee(s,c+"{"+a.body+"}"+a.post,[""],e,n,i)}o&&(i=r&&!d,o=!1);let m;if(d)m=BEs(a.body,l,e,n);else{let f=cSn(a.body);if(f.length===1&&f[0]!==void 0&&(f=Ret(f[0],e,n,!1).map(REs),f.length===1)){if(s=wee(s,c+f[0],[""],e,n,i&&!a.post.length),!a.post.length)break;t=a.post;continue}let g=i&&!a.post.length&&!c;for(let y=0;g&&y=e||A+C.length>n)break e;m.push(C),A+=C.length}}}}if(s=wee(s,c,m,e,n,i&&!a.post.length),!a.post.length)break;t=a.post}return s}p();var Tee=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};p();p();var PEs={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},vee=t=>t.replace(/[[\]\\-]/g,"\\$&"),OEs=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),uSn=t=>t.join(""),dSn=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],s=[],i=n+1,o=!1,a=!1,c=!1,u=!1,l=n,d="";e:for(;id?r.push(vee(d)+"-"+vee(g)):g===d&&r.push(vee(g)),d="",i++;continue}if(t.startsWith("-]",i+1)){r.push(vee(g+"-")),i+=2;continue}if(t.startsWith("-",i+1)){d=g,i+=2;continue}r.push(vee(g)),i++}if(ln?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");var pg,MEs=new Set(["!","?","+","*","@"]),Net=t=>MEs.has(t),pSn=t=>Net(t.type),LEs=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),FEs=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),QEs=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),hSn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),UEs="(?!(?:^|/)\\.\\.?(?:$|/))",iIe="(?!\\.)",$Es=new Set(["[","."]),GEs=new Set(["..","."]),WEs=new Set("().*{}+?[]^$\\!"),qEs=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Det="[^/]",mSn=Det+"*?",fSn=Det+"+?",HEs=0,vL=class{type;#e;#t;#n=!1;#r=[];#i;#s;#c;#o=!1;#a;#l;#p=!1;id=++HEs;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#o&&this.#c.push(this),this.#s=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#l=this.#r.map(e=>String(e)).join("")}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#o)return this;this.toString(),this.#o=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let n=e,r=n.#i;for(;r;){for(let s=n.#s+1;!r.type&&stypeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#o&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let e=this.#i;for(let n=0;ntypeof m!="string"),u=this.#r.map(m=>{let[f,g,A,y]=typeof m=="string"?pg.#x(m,this.#t,c):m.toRegExpSource(e);return this.#t=this.#t||A,this.#n=this.#n||y,f}).join(""),l="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&GEs.has(this.#r[0]))){let f=$Es,g=n&&f.has(u.charAt(0))||u.startsWith("\\.")&&f.has(u.charAt(2))||u.startsWith("\\.\\.")&&f.has(u.charAt(4)),A=!n&&!e&&f.has(u.charAt(0));l=g?UEs:A?iIe:""}let d="";return this.isEnd()&&this.#e.#o&&this.#i?.type==="!"&&(d="(?:$|\\/)"),[l+u+d,dD(u),this.#t=!!this.#t,this.#n]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#b(n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString(),u=this;return u.#r=[c],u.type=null,u.#t=void 0,[c,dD(this.toString()),!1,!1]}let o=!r||e||n||!iIe?"":this.#b(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#p)a=(this.isStart()&&!n?iIe:"")+fSn;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?iIe:"")+mSn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+c}return[a,dD(i),this.#t=!!this.#t,this.#n]}#E(){if(pSn(this)){let e=0,n=!1;do{n=!0;for(let r=0;r{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,s,i,o]=n.toRegExpSource(e);return this.#n=this.#n||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#x(e,n,r=!1){let s=!1,i="",o=!1,a=!1;for(let c=0;cn?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var _c=(t,e,n={})=>(Tee(e),!n.nocomment&&e.charAt(0)==="#"?!1:new d4(e,n).match(t)),VEs=/^\*+([^+@!?*[(]*)$/,jEs=t=>e=>!e.startsWith(".")&&e.endsWith(t),YEs=t=>e=>e.endsWith(t),KEs=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),zEs=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),JEs=/^\*+\.\*+$/,XEs=t=>!t.startsWith(".")&&t.includes("."),ZEs=t=>t!=="."&&t!==".."&&t.includes("."),ebs=/^\.\*+$/,tbs=t=>t!=="."&&t!==".."&&t.startsWith("."),nbs=/^\*+$/,rbs=t=>t.length!==0&&!t.startsWith("."),sbs=t=>t.length!==0&&t!=="."&&t!=="..",ibs=/^\?+([^+@!?*[(]*)?$/,obs=([t,e=""])=>{let n=ySn([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},abs=([t,e=""])=>{let n=ESn([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},cbs=([t,e=""])=>{let n=ESn([t]);return e?r=>n(r)&&r.endsWith(e):n},lbs=([t,e=""])=>{let n=ySn([t]);return e?r=>n(r)&&r.endsWith(e):n},ySn=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},ESn=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},bSn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",gSn={win32:{sep:"\\"},posix:{sep:"/"}},ubs=bSn==="win32"?gSn.win32.sep:gSn.posix.sep;_c.sep=ubs;var qh=Symbol("globstar **");_c.GLOBSTAR=qh;var dbs="[^/]",pbs=dbs+"*?",hbs="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",mbs="(?:(?!(?:\\/|^)\\.).)*?",fbs=(t,e={})=>n=>_c(n,t,e);_c.filter=fbs;var nb=(t,e={})=>Object.assign({},t,e),gbs=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return _c;let e=_c;return Object.assign((r,s,i={})=>e(r,s,nb(t,i)),{Minimatch:class extends e.Minimatch{constructor(s,i={}){super(s,nb(t,i))}static defaults(s){return e.defaults(nb(t,s)).Minimatch}},AST:class extends e.AST{constructor(s,i,o={}){super(s,i,nb(t,o))}static fromGlob(s,i={}){return e.AST.fromGlob(s,nb(t,i))}},unescape:(r,s={})=>e.unescape(r,nb(t,s)),escape:(r,s={})=>e.escape(r,nb(t,s)),filter:(r,s={})=>e.filter(r,nb(t,s)),defaults:r=>e.defaults(nb(t,r)),makeRe:(r,s={})=>e.makeRe(r,nb(t,s)),braceExpand:(r,s={})=>e.braceExpand(r,nb(t,s)),match:(r,s,i={})=>e.match(r,s,nb(t,i)),sep:e.sep,GLOBSTAR:qh})};_c.defaults=gbs;var _Sn=(t,e={})=>(Tee(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:lSn(t,{max:e.braceExpandMax}));_c.braceExpand=_Sn;var Abs=(t,e={})=>new d4(t,e).makeRe();_c.makeRe=Abs;var ybs=(t,e,n={})=>{let r=new d4(e,n);return t=t.filter(s=>r.match(s)),r.options.nonull&&!t.length&&t.push(e),t};_c.match=ybs;var ASn=/[?*]|[+@!]\(.*?\)|\[|\]/,Ebs=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d4=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,n={}){Tee(e),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=e,this.platform=n.platform||bSn,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((i,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=i[0]===""&&i[1]===""&&(i[2]==="?"||!ASn.test(i[2]))&&!ASn.test(i[3]),u=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(l=>this.parse(l))];if(u)return[i[0],...i.slice(1).map(l=>this.parse(l))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let s=r;for(;n[s+1]==="**";)s++;s!==r&&n.splice(r,s-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,s)=>{let i=r[r.length-1];return s==="**"&&i==="**"?r:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(s),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let s=1;ss&&r.splice(s+1,o-s);let a=r[s+1],c=r[s+2],u=r[s+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(s,1);let l=r.slice(0);l[s]="**",e.push(l),s--}if(!this.preserveMultipleSlashes){for(let o=1;on.length)}partsMatch(e,n,r=!1){let s=0,i=0,o=[],a="";for(;s=2&&(e=this.levelTwoFileOptimize(e)),n.includes(qh)?this.#e(e,n,r,s,i):this.#n(e,n,r,s,i)}#e(e,n,r,s,i){let o=n.indexOf(qh,i),a=n.lastIndexOf(qh),[c,u,l]=r?[n.slice(i,o),n.slice(o+1),[]]:[n.slice(i,o),n.slice(o+1,a),n.slice(a+1)];if(c.length){let b=e.slice(s,s+c.length);if(!this.#n(b,c,r,0,0))return!1;s+=c.length,i+=c.length}let d=0;if(l.length){if(l.length+s>e.length)return!1;let b=e.length-l.length;if(this.#n(e,l,r,b,0))d=l.length;else{if(e[e.length-1]!==""||s+l.length===e.length||(b--,!this.#n(e,l,r,b,0)))return!1;d=l.length+1}}if(!u.length){let b=!!d;for(let S=s;S{let u=c.map(d=>{if(d instanceof RegExp)for(let h of d.flags.split(""))s.add(h);return typeof d=="string"?Ebs(d):d===qh?qh:d._src});u.forEach((d,h)=>{let m=u[h+1],f=u[h-1];d!==qh||f===qh||(f===void 0?m!==void 0&&m!==qh?u[h+1]="(?:\\/|"+r+"\\/)?"+m:u[h]=r:m===void 0?u[h-1]=f+"(?:\\/|\\/"+r+")?":m!==qh&&(u[h-1]=f+"(?:\\/|\\/"+r+"\\/)"+m,u[h+1]=qh))});let l=u.filter(d=>d!==qh);if(this.partial&&l.length>=1){let d=[];for(let h=1;h<=l.length;h++)d.push(l.slice(0,h).join("/"));return"(?:"+d.join("|")+")"}return l.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];i="^"+o+i+a+"$",this.partial&&(i="^(?:\\/|"+o+i.slice(1,-1)+a+")$"),this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let i=this.set;this.debug(this.pattern,"set",i);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a of i){let c=s;if(r.matchBase&&a.length===1&&(c=[o]),this.matchOne(c,a,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return _c.defaults(e).Minimatch}};_c.AST=vL;_c.Minimatch=d4;_c.escape=Bet;_c.unescape=dD;var p4={"amazon-bedrock":"us.anthropic.claude-opus-4-6-v1","ant-ling":"Ring-2.6-1T",anthropic:"claude-opus-4-8",openai:"gpt-5.5","azure-openai-responses":"gpt-5.4","openai-codex":"gpt-5.5",radius:"auto",nvidia:"nvidia/nemotron-3-super-120b-a12b",deepseek:"deepseek-v4-pro",google:"gemini-3.1-pro-preview","google-vertex":"gemini-3.1-pro-preview","github-copilot":"gpt-5.4",openrouter:"moonshotai/kimi-k2.6","vercel-ai-gateway":"zai/glm-5.1",xai:"grok-4.6",groq:"openai/gpt-oss-120b",cerebras:"gpt-oss-120b",zai:"glm-5.3","zai-coding-cn":"glm-5.3",mistral:"devstral-medium-latest",minimax:"MiniMax-M2.7","minimax-cn":"MiniMax-M2.7",moonshotai:"kimi-k2.6","moonshotai-cn":"kimi-k2.6",huggingface:"moonshotai/Kimi-K2.6",fireworks:"accounts/fireworks/models/kimi-k2p6",together:"moonshotai/Kimi-K2.6",baseten:"zai-org/GLM-5.2",opencode:"kimi-k2.6","opencode-go":"kimi-k2.6","kimi-coding":"kimi-for-coding","cloudflare-workers-ai":"@cf/moonshotai/kimi-k2.6","cloudflare-ai-gateway":"workers-ai/@cf/moonshotai/kimi-k2.6","qwen-token-plan":"qwen3.7-max","qwen-token-plan-cn":"qwen3.7-max","qwen-token-plan-individual":"qwen3.8-max",xiaomi:"mimo-v2.5-pro","xiaomi-token-plan-cn":"mimo-v2.5-pro","xiaomi-token-plan-ams":"mimo-v2.5-pro","xiaomi-token-plan-sgp":"mimo-v2.5-pro"};function SSn(t){return t.endsWith("-latest")?!0:!/-\d{8}$/.test(t)}function kee(t,e){let n=t.trim();if(!n)return;let r=n.toLowerCase(),s=e.filter(a=>`${a.provider}/${a.id}`.toLowerCase()===r);if(s.length===1)return s[0];if(s.length>1)return;let i=n.indexOf("/");if(i!==-1){let a=n.substring(0,i).trim(),c=n.substring(i+1).trim();if(a&&c){let u=e.filter(l=>l.provider.toLowerCase()===a.toLowerCase()&&l.id.toLowerCase()===c.toLowerCase());if(u.length===1)return u[0];if(u.length>1)return}}let o=e.filter(a=>a.id.toLowerCase()===r);return o.length===1?o[0]:void 0}function bbs(t,e){let n=kee(t,e);if(n)return n;let r=e.filter(o=>o.id.toLowerCase().includes(t.toLowerCase())||o.name?.toLowerCase().includes(t.toLowerCase()));if(r.length===0)return;let s=r.filter(o=>SSn(o.id)),i=r.filter(o=>!SSn(o.id));return s.length>0?(s.sort((o,a)=>a.id.localeCompare(o.id)),s[0]):(i.sort((o,a)=>a.id.localeCompare(o.id)),i[0])}function _bs(t,e,n){let r=n.filter(o=>o.provider===t);if(r.length===0)return;let s=p4[t];return{...s?r.find(o=>o.id===s)??r[0]:r[0],id:e,name:e}}function Ree(t,e,n){let r=bbs(t,e);if(r)return{model:r,thinkingLevel:void 0,warning:void 0};let s=t.lastIndexOf(":");if(s===-1)return{model:void 0,thinkingLevel:void 0,warning:void 0};let i=t.substring(0,s),o=t.substring(s+1);if(oX(o)){let a=Ree(i,e,n);return a.model?{model:a.model,thinkingLevel:a.warning?void 0:o,warning:a.warning}:a}else{if(!(n?.allowInvalidThinkingLevelFallback??!0))return{model:void 0,thinkingLevel:void 0,warning:void 0};let c=Ree(i,e,n);return c.model?{model:c.model,thinkingLevel:void 0,warning:`Invalid thinking level "${o}" in pattern "${t}". Using default instead.`}:c}}function oIe(t,e){let n=[...e],r=[],s=[];for(let i of t){if(i.includes("*")||i.includes("?")||i.includes("[")){let u=i.lastIndexOf(":"),l=i,d;if(u!==-1){let f=i.substring(u+1);oX(f)&&(d=f,l=i.substring(0,u))}let h=kee(l,n);if(h){r.find(f=>cd(f.model,h))||r.push({model:h,thinkingLevel:d});continue}let m=n.filter(f=>{let g=`${f.provider}/${f.id}`;return _c(g,l,{nocase:!0})||_c(f.id,l,{nocase:!0})});if(m.length===0){s.push({type:"warning",code:"no-match",message:`No models match pattern "${i}"`,pattern:i});continue}for(let f of m)r.find(g=>cd(g.model,f))||r.push({model:f,thinkingLevel:d});continue}let{model:o,thinkingLevel:a,warning:c}=Ree(i,n);if(c&&s.push({type:"warning",code:"invalid-thinking-level",message:c,pattern:i}),!o){s.push({type:"warning",code:"no-match",message:`No models match pattern "${i}"`,pattern:i});continue}r.find(u=>cd(u.model,o))||r.push({model:o,thinkingLevel:a})}return{scopedModels:r,diagnostics:s}}async function Pet(t,e,n){return oIe(t,await e.getAvailable(void 0,n))}async function CSn(t,e,n){let{scopedModels:r,diagnostics:s}=await Pet(t,e,n);for(let i of s)console.warn(en.yellow(`Warning: ${i.message}`));return r}function uI(t){let{cliProvider:e,cliModel:n,cliThinking:r,modelRuntime:s}=t;if(!n)return{model:void 0,warning:void 0,error:void 0};let i=[...s.getModels()];if(i.length===0)return{model:void 0,warning:void 0,error:"No models available. Check your installation or add models to models.json."};let o=new Map;for(let g of i)o.set(g.provider.toLowerCase(),g.provider);let a=e?o.get(e.toLowerCase()):void 0;if(e&&!a)return{model:void 0,warning:void 0,error:`Unknown provider "${e}". Use --list-models to see available providers/models.`};let c=n,u=!1;if(!a){let g=n.indexOf("/");if(g!==-1){let A=n.substring(0,g),y=o.get(A.toLowerCase());y&&(a=y,c=n.substring(g+1),u=!0)}}if(!a){let g=n.toLowerCase(),A=i.filter(y=>y.id.toLowerCase()===g||`${y.provider}/${y.id}`.toLowerCase()===g);if(A.length===1)return{model:A[0],warning:void 0,thinkingLevel:void 0,error:void 0};if(A.length>1){let y=A.filter(C=>s.hasConfiguredAuth(C.provider));if(y.length===1)return{model:y[0],warning:void 0,thinkingLevel:void 0,error:void 0};let b=A.map(C=>`${C.provider}/${C.id}`).sort((C,I)=>C.localeCompare(I)).join(", "),S=y.length===0?"No matching provider is authenticated.":"More than one matching provider is authenticated.";return{model:void 0,warning:void 0,thinkingLevel:void 0,error:`Model "${n}" is ambiguous across providers: ${b}. ${S} Use --provider or provider/model.`}}}if(e&&a){let g=`${a}/`;n.toLowerCase().startsWith(g.toLowerCase())&&(c=n.substring(g.length))}let l=a?i.filter(g=>g.provider===a):i,{model:d,thinkingLevel:h,warning:m}=Ree(c,l,{allowInvalidThinkingLevelFallback:!1});if(d){if(u){let g=i.filter(A=>A.id.toLowerCase()===n.toLowerCase()&&!cd(A,d));if(g.length>0&&!s.hasConfiguredAuth(d.provider)){let A=g.filter(y=>s.hasConfiguredAuth(y.provider));if(A.length===1)return{model:A[0],thinkingLevel:void 0,warning:void 0,error:void 0}}}return{model:d,thinkingLevel:h,warning:m,error:void 0}}if(u){let g=n.toLowerCase(),A=i.find(b=>b.id.toLowerCase()===g||`${b.provider}/${b.id}`.toLowerCase()===g);if(A)return{model:A,warning:void 0,thinkingLevel:void 0,error:void 0};let y=Ree(n,i,{allowInvalidThinkingLevelFallback:!1});if(y.model)return{model:y.model,thinkingLevel:y.thinkingLevel,warning:y.warning,error:void 0}}if(a){let g=c,A;if(!r){let b=c.lastIndexOf(":");if(b!==-1){let S=c.substring(b+1);oX(S)&&(g=c.substring(0,b),A=S)}}let y=_bs(a,g,i);if(y){let b=r??A,S=b&&b!=="off"?{...y,reasoning:!0}:y,C=m?`${m} Model "${g}" not found for provider "${a}". Using custom model id.`:`Model "${g}" not found for provider "${a}". Using custom model id.`;return{model:S,thinkingLevel:A,warning:C,error:void 0}}}let f=a?`${a}/${c}`:n;return{model:void 0,thinkingLevel:void 0,warning:m,error:`Model "${f}" not found. Use --list-models to see available models.`}}async function ISn(t){let{cliProvider:e,cliModel:n,scopedModels:r,isContinuing:s,defaultProvider:i,defaultModelId:o,defaultThinkingLevel:a,modelThinkingLevels:c,modelRuntime:u}=t,l,d=th;if(e&&n){let m=uI({cliProvider:e,cliModel:n,modelRuntime:u});if(m.error&&(console.error(en.red(m.error)),process.exit(1)),m.model)return{model:m.model,thinkingLevel:th,fallbackMessage:void 0}}if(r.length>0&&!s){let m=r[0],f=c?.[`${m.model.provider}/${m.model.id}`];return{model:m.model,thinkingLevel:m.thinkingLevel??f??a??th,fallbackMessage:void 0}}if(i&&o){let m=u.getModel(i,o);if(m&&u.hasConfiguredAuth(m.provider)){l=m;let f=c?.[`${i}/${o}`];return f?d=f:a&&(d=a),{model:l,thinkingLevel:d,fallbackMessage:void 0}}}let h=[...u.getAvailableSnapshot()];if(h.length>0){for(let m of Object.keys(p4)){let f=p4[m],g=h.find(A=>A.provider===m&&A.id===f);if(g)return{model:g,thinkingLevel:th,fallbackMessage:void 0}}return{model:h[0],thinkingLevel:th,fallbackMessage:void 0}}return{model:void 0,thinkingLevel:th,fallbackMessage:void 0}}p();var Dee=require("node:path");p();var RSn=require("node:fs/promises");p();function xSn(t){return t.replace(/"(?:\\.|[^"\\])*"|\/\/[^\n]*/g,e=>e[0]==='"'?e:"").replace(/"(?:\\.|[^"\\])*"|,(\s*[}\]])/g,(e,n)=>n??(e[0]==='"'?e:""))}var wSn=Oe.Object({p50:Oe.Optional(Oe.Number()),p75:Oe.Optional(Oe.Number()),p90:Oe.Optional(Oe.Number()),p99:Oe.Optional(Oe.Number())}),Sbs=Oe.Object({allow_fallbacks:Oe.Optional(Oe.Boolean()),require_parameters:Oe.Optional(Oe.Boolean()),data_collection:Oe.Optional(Oe.Union([Oe.Literal("deny"),Oe.Literal("allow")])),zdr:Oe.Optional(Oe.Boolean()),enforce_distillable_text:Oe.Optional(Oe.Boolean()),order:Oe.Optional(Oe.Array(Oe.String())),only:Oe.Optional(Oe.Array(Oe.String())),ignore:Oe.Optional(Oe.Array(Oe.String())),quantizations:Oe.Optional(Oe.Array(Oe.String())),sort:Oe.Optional(Oe.Union([Oe.String(),Oe.Object({by:Oe.Optional(Oe.String()),partition:Oe.Optional(Oe.Union([Oe.String(),Oe.Null()]))})])),max_price:Oe.Optional(Oe.Object({prompt:Oe.Optional(Oe.Union([Oe.Number(),Oe.String()])),completion:Oe.Optional(Oe.Union([Oe.Number(),Oe.String()])),image:Oe.Optional(Oe.Union([Oe.Number(),Oe.String()])),audio:Oe.Optional(Oe.Union([Oe.Number(),Oe.String()])),request:Oe.Optional(Oe.Union([Oe.Number(),Oe.String()]))})),preferred_min_throughput:Oe.Optional(Oe.Union([Oe.Number(),wSn])),preferred_max_latency:Oe.Optional(Oe.Union([Oe.Number(),wSn]))}),Cbs=Oe.Object({only:Oe.Optional(Oe.Array(Oe.String())),order:Oe.Optional(Oe.Array(Oe.String()))}),RL=Oe.Union([Oe.String(),Oe.Null()]),kSn=Oe.Object({off:Oe.Optional(RL),minimal:Oe.Optional(RL),low:Oe.Optional(RL),medium:Oe.Optional(RL),high:Oe.Optional(RL),xhigh:Oe.Optional(RL),max:Oe.Optional(RL)}),Ibs=Oe.Union([Oe.String(),Oe.Number(),Oe.Boolean(),Oe.Null()]),xbs=Oe.Object({$var:Oe.Union([Oe.Literal("thinking.enabled"),Oe.Literal("thinking.effort")]),omitWhenOff:Oe.Optional(Oe.Boolean())}),TSn=Oe.Union([Ibs,xbs]),wbs=Oe.Object({supportsStore:Oe.Optional(Oe.Boolean()),supportsDeveloperRole:Oe.Optional(Oe.Boolean()),supportsReasoningEffort:Oe.Optional(Oe.Boolean()),supportsUsageInStreaming:Oe.Optional(Oe.Boolean()),supportsFinishReason:Oe.Optional(Oe.Boolean()),maxTokensField:Oe.Optional(Oe.Union([Oe.Literal("max_completion_tokens"),Oe.Literal("max_tokens")])),requiresToolResultName:Oe.Optional(Oe.Boolean()),requiresAssistantAfterToolResult:Oe.Optional(Oe.Boolean()),requiresThinkingAsText:Oe.Optional(Oe.Boolean()),requiresReasoningContentOnAssistantMessages:Oe.Optional(Oe.Boolean()),thinkingFormat:Oe.Optional(Oe.Union([Oe.Literal("openai"),Oe.Literal("openrouter"),Oe.Literal("together"),Oe.Literal("baseten"),Oe.Literal("deepseek"),Oe.Literal("zai"),Oe.Literal("qwen"),Oe.Literal("chat-template"),Oe.Literal("qwen-chat-template"),Oe.Literal("string-thinking"),Oe.Literal("ant-ling")])),chatTemplateKwargs:Oe.Optional(Oe.Record(Oe.String(),TSn)),chatTemplateArgs:Oe.Optional(Oe.Record(Oe.String(),TSn)),cacheControlFormat:Oe.Optional(Oe.Literal("anthropic")),openRouterRouting:Oe.Optional(Sbs),vercelGatewayRouting:Oe.Optional(Cbs),supportsOpenAIGrammarTools:Oe.Optional(Oe.Boolean()),supportsStrictMode:Oe.Optional(Oe.Boolean()),sendSessionAffinityHeaders:Oe.Optional(Oe.Boolean()),deferredToolsMode:Oe.Optional(Oe.Literal("kimi")),sessionAffinityFormat:Oe.Optional(Oe.Union([Oe.Literal("openai"),Oe.Literal("openai-nosession"),Oe.Literal("openrouter")])),supportsLongCacheRetention:Oe.Optional(Oe.Boolean()),vllmPriority:Oe.Optional(Oe.Number())}),Tbs=Oe.Object({supportsDeveloperRole:Oe.Optional(Oe.Boolean()),sessionAffinityFormat:Oe.Optional(Oe.Union([Oe.Literal("openai"),Oe.Literal("openai-nosession"),Oe.Literal("openrouter")])),supportsLongCacheRetention:Oe.Optional(Oe.Boolean()),supportsStrictMode:Oe.Optional(Oe.Boolean()),supportsOpenAIGrammarTools:Oe.Optional(Oe.Boolean()),supportsAdditionalTools:Oe.Optional(Oe.Boolean()),supportsToolSearch:Oe.Optional(Oe.Boolean()),supportsMaxOutputTokens:Oe.Optional(Oe.Boolean())}),vbs=Oe.Object({supportsEagerToolInputStreaming:Oe.Optional(Oe.Boolean()),supportsLongCacheRetention:Oe.Optional(Oe.Boolean()),sendSessionAffinityHeaders:Oe.Optional(Oe.Boolean()),supportsCacheControlOnTools:Oe.Optional(Oe.Boolean()),supportsTemperature:Oe.Optional(Oe.Boolean()),forceAdaptiveThinking:Oe.Optional(Oe.Boolean()),allowEmptySignature:Oe.Optional(Oe.Boolean()),supportsStrictTools:Oe.Optional(Oe.Boolean()),supportsMidConvoEffort:Oe.Optional(Oe.Boolean()),supportsToolReferences:Oe.Optional(Oe.Boolean())}),Oet=Oe.Union([wbs,Tbs,vbs]),NSn={input:Oe.Number(),output:Oe.Number(),cacheRead:Oe.Number(),cacheWrite:Oe.Number()},DSn=Oe.Object({inputTokensAbove:Oe.Number(),...NSn}),Rbs=Oe.Object({...NSn,tiers:Oe.Optional(Oe.Array(DSn))}),kbs=Oe.Object({id:Oe.String({minLength:1}),name:Oe.Optional(Oe.String({minLength:1})),api:Oe.Optional(Oe.String({minLength:1})),baseUrl:Oe.Optional(Oe.String({minLength:1})),reasoning:Oe.Optional(Oe.Boolean()),thinkingLevelMap:Oe.Optional(kSn),input:Oe.Optional(Oe.Array(Oe.Union([Oe.Literal("text"),Oe.Literal("image")]))),cost:Oe.Optional(Rbs),contextWindow:Oe.Optional(Oe.Number()),maxTokens:Oe.Optional(Oe.Number()),samplingParams:Oe.Optional(Oe.Record(Oe.String(),Oe.Unknown())),headers:Oe.Optional(Oe.Record(Oe.String(),Oe.String())),compat:Oe.Optional(Oet)}),Nbs=Oe.Object({name:Oe.Optional(Oe.String({minLength:1})),reasoning:Oe.Optional(Oe.Boolean()),thinkingLevelMap:Oe.Optional(kSn),input:Oe.Optional(Oe.Array(Oe.Union([Oe.Literal("text"),Oe.Literal("image")]))),cost:Oe.Optional(Oe.Object({input:Oe.Optional(Oe.Number()),output:Oe.Optional(Oe.Number()),cacheRead:Oe.Optional(Oe.Number()),cacheWrite:Oe.Optional(Oe.Number()),tiers:Oe.Optional(Oe.Array(DSn))})),contextWindow:Oe.Optional(Oe.Number()),maxTokens:Oe.Optional(Oe.Number()),samplingParams:Oe.Optional(Oe.Record(Oe.String(),Oe.Unknown())),headers:Oe.Optional(Oe.Record(Oe.String(),Oe.String())),compat:Oe.Optional(Oet)}),Dbs=Oe.Object({name:Oe.Optional(Oe.String({minLength:1})),baseUrl:Oe.Optional(Oe.String({minLength:1})),apiKey:Oe.Optional(Oe.String({minLength:1})),api:Oe.Optional(Oe.String({minLength:1})),oauth:Oe.Optional(Oe.Literal("radius")),headers:Oe.Optional(Oe.Record(Oe.String(),Oe.String())),compat:Oe.Optional(Oet),authHeader:Oe.Optional(Oe.Boolean()),models:Oe.Optional(Oe.Array(kbs)),modelOverrides:Oe.Optional(Oe.Record(Oe.String(),Nbs))}),Bbs=Oe.Object({providers:Oe.Record(Oe.String(),Dbs)}),vSn=Nw(Bbs);function Pbs(t){if(t.keyword==="required"){let r=t.params.requiredProperties?.[0];if(r){let s=t.instancePath.replace(/^\//,"").replace(/\//g,".");return s?`${s}.${r}`:r}}return t.instancePath.replace(/^\//,"").replace(/\//g,".")||"root"}function BSn(t){if(typeof t!="object"||t===null||Object.isFrozen(t))return t;for(let e of Object.values(t))BSn(e);return Object.freeze(t)}var Nee=class t{providers;error;constructor(e,n){this.providers=e,this.error=n}static async load(e){if(!e)return new t(new Map);let n=Mo(e),r;try{r=await(0,RSn.readFile)(n,"utf-8")}catch(a){return a.code==="ENOENT"?new t(new Map):new t(new Map,`Failed to load models.json: ${a instanceof Error?a.message:a} +${i}`:c}catch(o){return this._extensionRunner.emitError({extensionPath:s.filePath,event:"skill_expansion",error:o instanceof Error?o.message:String(o)}),e}}async _queueUserInput(e,n,r,i){e.startsWith("/")&&this._throwIfExtensionCommand(e);let s=await this._runInputHandlers(e,n,i,this.isStreaming?r:void 0);if(!s)return;let o=this._expandSkillCommand(s.text);o=imt(o,[...this.promptTemplates]),r==="steer"?await this._queueSteer(o,s.images):await this._queueFollowUp(o,s.images)}async steer(e,n,r){await this._queueUserInput(e,n,"steer",r?.source??"interactive")}async followUp(e,n,r){await this._queueUserInput(e,n,"followUp",r?.source??"interactive")}async _queueSteer(e,n){this._steeringMessages.push(e),this._emitQueueUpdate();let r=[{type:"text",text:e}];n&&r.push(...n),this.agent.steer({role:"user",content:r,timestamp:Date.now()})}async _queueFollowUp(e,n){this._followUpMessages.push(e),this._emitQueueUpdate();let r=[{type:"text",text:e}];n&&r.push(...n),this.agent.followUp({role:"user",content:r,timestamp:Date.now()})}_throwIfExtensionCommand(e){let n=e.indexOf(" "),r=n===-1?e.slice(1):e.slice(1,n);if(this._extensionRunner.getCommand(r))throw new Error(`Extension command "/${r}" cannot be queued. Use prompt() or execute the command when not streaming.`)}async sendCustomMessage(e,n){let r={role:"custom",customType:e.customType,content:e.content??[],display:e.display,details:e.details,timestamp:Date.now()};if(n?.deliverAs==="nextTurn")this._pendingNextTurnMessages.push(r);else if(this.isStreaming&&n?.triggerTurn!==!1)n?.deliverAs==="followUp"?this.agent.followUp(r):this.agent.steer(r);else if(n?.triggerTurn){if(this._isEmittingAgentSettled){this._deferredSettledActions.push(async()=>await this._runAgentPrompt(r));return}await this._runAgentPrompt(r)}else this.isStreaming?this._pendingCustomMessages.push(r):this._appendCustomMessage(r)}_appendCustomMessage(e){this.sessionManager.appendCustomMessageEntry(e.customType,e.content,e.display,e.details),this._refreshFinalizedContext(),this._emit({type:"message_start",message:e}),this._emit({type:"message_end",message:e})}_flushPendingCustomMessages(){if(this._pendingCustomMessages.length===0)return;let e=this._pendingCustomMessages;this._pendingCustomMessages=[];for(let n of e)this._appendCustomMessage(n)}async sendUserMessage(e,n){let r,i;if(typeof e=="string")r=e;else{let s=[];i=[];for(let o of e)o.type==="text"?s.push(o.text):i.push(o);r=s.join(` +`),i.length===0&&(i=void 0)}await this.prompt(r,{expandPromptTemplates:n?.expandPromptTemplates??!1,streamingBehavior:n?.deliverAs,images:i,source:"extension"})}clearQueue(){let e=[...this._steeringMessages],n=[...this._followUpMessages];return this._steeringMessages=[],this._followUpMessages=[],this.agent.clearAllQueues(),this._emitQueueUpdate(),{steering:e,followUp:n}}get pendingMessageCount(){return this._steeringMessages.length+this._followUpMessages.length}getSteeringMessages(){return this._steeringMessages}getFollowUpMessages(){return this._followUpMessages}get resourceLoader(){return this._resourceLoader}async abort(){this._isAgentRunActive&&(this._agentRunAbortRequested=!0),this.abortRetry(),this.abortCompaction(),this.abortBranchSummary(),this._isBeforeSettle&&(this._abortDuringBeforeSettle=!0),this.agent.abort(),await this.waitForIdle()}async waitForIdle(){this.isIdle||await this._getIdleWaitPromise()}async _emitModelSelect(e,n,r){Zd(n,e)||await this._extensionRunner.emit({type:"model_select",model:e,previousModel:n,source:r})}async setModel(e,n={}){if(!await this._modelRuntime.checkAuth(e.provider))throw new Error(`No API key for ${e.provider}/${e.id}`);let r=this.model,i=this._getThinkingLevelForModelSwitch(e);this.agent.state.model=e,this.sessionManager.appendModelChange(e.provider,e.id),n.persist&&(this.settingsManager.setDefaultModelAndProvider(e.provider,e.id),this._addPersistedDefaultToNonEmptyScope(e)),this.setThinkingLevel(i),await this._emitModelSelect(e,r,"set")}_addPersistedDefaultToNonEmptyScope(e){if(this._scopedModels.length===0||this._scopedModels.some(i=>Zd(i.model,e)))return;this._scopedModels=[...this._scopedModels,{model:e}];let n=this.settingsManager.getEnabledModels();if(!n?.length)return;let r=`${e.provider}/${e.id}`;n.some(i=>i.toLowerCase()===r.toLowerCase())||this.settingsManager.setEnabledModels([...n,r])}async cycleModel(e="forward",n={}){return this._scopedModels.length>0?this._cycleScopedModel(e,n):this._cycleAvailableModel(e,n)}async _cycleScopedModel(e,n){let r=new Set(this._modelRuntime.getAvailableSnapshot().map(d=>`${d.provider}\0${d.id}`)),i=this._scopedModels.filter(d=>r.has(`${d.model.provider}\0${d.model.id}`));if(i.length<=1)return;let s=this.model,o=i.findIndex(d=>Zd(d.model,s));o===-1&&(o=0);let a=i.length,c=e==="forward"?(o+1)%a:(o-1+a)%a,u=i[c],l=this._getThinkingLevelForModelSwitch(u.model,u.thinkingLevel);return this.agent.state.model=u.model,this.sessionManager.appendModelChange(u.model.provider,u.model.id),n.persist&&(this.settingsManager.setDefaultModelAndProvider(u.model.provider,u.model.id),this._addPersistedDefaultToNonEmptyScope(u.model)),this.setThinkingLevel(l),await this._emitModelSelect(u.model,s,"cycle"),{model:u.model,thinkingLevel:this.thinkingLevel,isScoped:!0}}async _cycleAvailableModel(e,n){let r=this._modelRuntime.getAvailableSnapshot();if(r.length<=1)return;let i=this.model,s=r.findIndex(l=>Zd(l,i));s===-1&&(s=0);let o=r.length,a=e==="forward"?(s+1)%o:(s-1+o)%o,c=r[a],u=this._getThinkingLevelForModelSwitch(c);return this.agent.state.model=c,this.sessionManager.appendModelChange(c.provider,c.id),n.persist&&(this.settingsManager.setDefaultModelAndProvider(c.provider,c.id),this._addPersistedDefaultToNonEmptyScope(c)),this.setThinkingLevel(u),await this._emitModelSelect(c,i,"cycle"),{model:c,thinkingLevel:this.thinkingLevel,isScoped:!1}}setThinkingLevel(e,n={}){let r=this.getAvailableThinkingLevels(),i=r.includes(e)?e:this._clampThinkingLevel(e,r),s=this.agent.state.thinkingLevel,o=i!==s;this.agent.state.thinkingLevel=i,n.persist&&this.settingsManager.setDefaultThinkingLevel(e),o&&(this.sessionManager.appendThinkingLevelChange(i),this._emit({type:"thinking_level_changed",level:i}),this._extensionRunner.emit({type:"thinking_level_select",level:i,previousLevel:s}))}cycleThinkingLevel(e={}){if(!this.supportsThinking())return;let n=this.getAvailableThinkingLevels(),i=(n.indexOf(this.thinkingLevel)+1)%n.length,s=n[i];return this.setThinkingLevel(s,e),s}getAvailableThinkingLevels(){return this.model?gB(this.model):[...TRe]}supportsThinking(){return!!this.model?.reasoning}_getThinkingLevelForModelSwitch(e,n){if(n!==void 0)return n;if(e){let r=this.settingsManager.getModelThinkingLevel(e.provider,e.id);if(r!==void 0)return r}return this.settingsManager.getDefaultThinkingLevel()??this.thinkingLevel??rh}_clampThinkingLevel(e,n){return this.model?Wl(this.model,e):"off"}syncQueueModesFromSettings(){this.agent.steeringMode=this.settingsManager.getSteeringMode(),this.agent.followUpMode=this.settingsManager.getFollowUpMode()}setSteeringMode(e){this.agent.steeringMode=e,this.settingsManager.setSteeringMode(e)}setFollowUpMode(e){this.agent.followUpMode=e,this.settingsManager.setFollowUpMode(e)}async _runDefaultCompaction(e,n,r,i,s,o,a,c){return _Re(e,n,r,i,s,o,this.thinkingLevel,this.agent.streamFunction,a,this.settingsManager.getRetrySettings(),this._summarizationRetryCallbacks({source:"compaction",reason:c}),void 0)}_clearManualCompactionState(){this._compactionAbortController=void 0,this._resolveIdleWaitIfIdle()}async compact(e){await this.abort(),this._compactionAbortController=new AbortController,this._emit({type:"compaction_start",reason:"manual"});let n=!1,r=!1;try{let i=this.model;if(!i)throw new Error(Zlt());let s=this.settingsManager.getCompactionSettings(i),{model:o,apiKey:a,headers:c,env:u}=await this._getSummarizationRequestAuth(i,this._compactionAbortController.signal),l=this.sessionManager.getBranch(),d=mut(l,s);if(!d)throw l[l.length-1]?.type==="compaction"?new Error("Already compacted"):new Error("Nothing to compact (session too small)");let m;if(this._extensionRunner.hasHandlers("session_before_compact")){let I=await this._extensionRunner.emit({type:"session_before_compact",preparation:d,branchEntries:l,customInstructions:e,reason:"manual",willRetry:!1,signal:this._compactionAbortController.signal});if(I?.cancel)throw r=!0,new Error("Compaction cancelled");I?.compaction&&(m=I.compaction,n=!0)}let h,f,g,A,y;if(m)h=m.summary,f=m.firstKeptEntryId,g=m.tokensBefore,A=m.usage,y=m.details;else{let I=await this._runDefaultCompaction(d,o,a,c,e,this._compactionAbortController.signal,u,"manual");h=I.summary,f=I.firstKeptEntryId,g=I.tokensBefore,A=I.usage,y=I.details}if(this._compactionAbortController.signal.aborted)throw new Error("Compaction cancelled");this.sessionManager.appendCompaction(h,f,g,y,n,A);let E=this.sessionManager.getEntries();this._refreshFinalizedContext();let _=y8n(this.sessionManager.buildSessionProjection().messages),S=E.find(I=>I.type==="compaction"&&I.summary===h);this._extensionRunner&&S&&await this._extensionRunner.emit({type:"session_compact",compactionEntry:S,fromExtension:n,reason:"manual",willRetry:!1});let C={summary:h,firstKeptEntryId:f,tokensBefore:g,estimatedTokensAfter:_,usage:A,details:y};return this._clearManualCompactionState(),this._emit({type:"compaction_end",reason:"manual",result:C,aborted:!1,willRetry:!1}),C}catch(i){let s=i instanceof Error?i.message:String(i),o=this._compactionAbortController.signal.aborted||r,a=o?void 0:`Compaction failed: ${s}`;throw this._clearManualCompactionState(),this._emit({type:"compaction_end",reason:"manual",result:void 0,aborted:o,willRetry:!1,errorMessage:a}),await this._emitSessionCompactFailed({reason:"manual",errorMessage:a,aborted:o,willRetry:!1,fromExtension:n}),i}finally{this._clearManualCompactionState()}}abortCompaction(){this._compactionAbortController?.abort(),this._autoCompactionAbortController?.abort()}abortBranchSummary(){this._branchSummaryAbortController?.abort()}async _checkCompaction(e,n=!0,r=[]){let i=this.settingsManager.getCompactionSettings(this.model);if(!i.enabled||n&&e.stopReason==="aborted")return!1;let s=this.model?.contextWindow??0,o=this.model&&e.provider===this.model.provider&&e.model===this.model.id,a=Oie(this.sessionManager.getBranch());if(a!==null&&e.timestamp<=new Date(a.timestamp).getTime())return!1;let u=this.sessionManager.buildSessionProjection(),l=this._findPersistedMessageEntryId(e),d=l===void 0||u.entries.some(O=>O.sourceEntry.id===l&&O.messages.some(W=>W.role==="assistant")),m=this.sessionManager.getBranch(),h=l?m.findIndex(O=>O.id===l):-1,f=h>=0?m.slice(h+1):[],g=f.some(O=>O.type==="context_edit"),A=f.filter(O=>O.type==="context_edit"&&O.targetId===l).at(-1),y=l===void 0||!f.some(O=>O.type==="compaction")&&A?.replacement!==null,E=d&&!g,_=e.stopReason==="error"&&rF(e),S=o&&(_&&y||E&&rF(e,s)),C=o&&d&&dte(e,this.model?.maxTokens??0);if(S||C){let O=e.stopReason!=="stop";if(!O)return await this._runAutoCompaction("overflow",!1);if(this._overflowRecoveryAttempted){let W=S?"Context overflow recovery failed after one compact-and-retry attempt. Try reducing context or switching to a larger-context model.":"Truncated response recovery failed after one compact-and-retry attempt.";return this._emit({type:"compaction_end",reason:"overflow",result:void 0,aborted:!1,willRetry:!1,errorMessage:W}),await this._emitSessionCompactFailed({reason:"overflow",errorMessage:W,aborted:!1,willRetry:!1,fromExtension:!1}),!1}return this._overflowRecoveryAttempted=!0,this._omitRecoveryAttempt(e,r),await this._runAutoCompaction("overflow",O)}let I,w=u,k=w.entries.some(O=>O.sourceEntry.type==="context_edit"),N=e.usage?EQ(e.usage):0;if(k)I=Jj(w,m).tokens;else if(e.stopReason==="error"||N===0){let O=this.agent.state.messages,W=dut(O);if(W.lastUsageIndex!==null){let $=O[W.lastUsageIndex];if(a&&$.role==="assistant"&&$.timestamp<=new Date(a.timestamp).getTime())return!1}I=W.tokens}else I=N;return Uie(I,s,i)?await this._runAutoCompaction("threshold",!1):!1}async _runAutoCompaction(e,n){let r=this.model,i=this.settingsManager.getCompactionSettings(r),s,o=!1,a=!1,c=!1;try{if(!r)return!1;let u=this.sessionManager.getBranch(),l=mut(u,i);if(!l)return!1;s=new AbortController,this._autoCompactionAbortController=s,o=!0,this._emit({type:"compaction_start",reason:e}),s.signal.throwIfAborted();let{model:d,apiKey:m,headers:h,env:f}=await this._getSummarizationRequestAuth(r,s.signal);s.signal.throwIfAborted();let g;if(this._extensionRunner.hasHandlers("session_before_compact")){let N=await this._extensionRunner.emit({type:"session_before_compact",preparation:l,branchEntries:u,customInstructions:void 0,reason:e,willRetry:n,signal:s.signal});if(N?.cancel)throw c=!0,new Error("Compaction cancelled");N?.compaction&&(g=N.compaction,a=!0)}s.signal.throwIfAborted();let A,y,E,_,S;if(g)A=g.summary,y=g.firstKeptEntryId,E=g.tokensBefore,_=g.usage,S=g.details;else{let N=await this._runDefaultCompaction(l,d,m,h,void 0,s.signal,f,e);A=N.summary,y=N.firstKeptEntryId,E=N.tokensBefore,_=N.usage,S=N.details}s.signal.throwIfAborted(),this.sessionManager.appendCompaction(A,y,E,S,a,_);let C=this.sessionManager.getEntries();this._refreshFinalizedContext();let I=y8n(this.sessionManager.buildSessionProjection().messages),w=C.find(N=>N.type==="compaction"&&N.summary===A);this._extensionRunner&&w&&await this._extensionRunner.emit({type:"session_compact",compactionEntry:w,fromExtension:a,reason:e,willRetry:n});let k={summary:A,firstKeptEntryId:y,tokensBefore:E,estimatedTokensAfter:I,usage:_,details:S};return this._emit({type:"compaction_end",reason:e,result:k,aborted:!1,willRetry:n}),n?!0:this.agent.hasQueuedMessages()}catch(u){let l=u instanceof Error?u.message:"compaction failed",d=s?.signal.aborted===!0||c;if(o){let m=d?void 0:e==="overflow"?`Context overflow recovery failed: ${l}`:`Auto-compaction failed: ${l}`;this._emit({type:"compaction_end",reason:e,result:void 0,aborted:d,willRetry:!1,errorMessage:m}),await this._emitSessionCompactFailed({reason:e,errorMessage:m,aborted:d,willRetry:!1,fromExtension:a})}return!1}finally{this._autoCompactionAbortController===s&&(this._autoCompactionAbortController=void 0),this._resolveIdleWaitIfIdle()}}setAutoCompactionEnabled(e){this.settingsManager.setCompactionEnabled(e)}get autoCompactionEnabled(){return this.settingsManager.getCompactionEnabled()}async bindExtensions(e){e.uiContext!==void 0&&(this._extensionUIContext=e.uiContext),e.mode!==void 0&&(this._extensionMode=e.mode),e.commandContextActions!==void 0&&(this._extensionCommandContextActions=e.commandContextActions),e.abortHandler!==void 0&&(this._extensionAbortHandler=e.abortHandler),e.shutdownHandler!==void 0&&(this._extensionShutdownHandler=e.shutdownHandler),e.onError!==void 0&&(this._extensionErrorListener=e.onError),this._applyExtensionBindings(this._extensionRunner),await this._extensionRunner.emit(this._sessionStartEvent),await this.extendResourcesFromExtensions(this._sessionStartEvent.reason==="reload"?"reload":"startup")}async extendResourcesFromExtensions(e){if(!this._extensionRunner.hasHandlers("resources_discover"))return;let{skillPaths:n,promptPaths:r,themePaths:i}=await this._extensionRunner.emitResourcesDiscover(this._cwd,e);if(n.length===0&&r.length===0&&i.length===0)return;let s={skillPaths:this.buildExtensionResourcePaths(n),promptPaths:this.buildExtensionResourcePaths(r),themePaths:this.buildExtensionResourcePaths(i)};this._resourceLoader.extendResources(s),this._rebuildSystemPrompt(this.getActiveToolNames())}buildExtensionResourcePaths(e){return e.map(n=>{let r=this.getExtensionSourceLabel(n.extensionPath),i=n.extensionPath.startsWith("<")?void 0:(0,U1e.dirname)(n.extensionPath);return{path:n.path,metadata:{source:r,scope:"temporary",origin:"top-level",baseDir:i}}})}getExtensionSourceLabel(e){return e.startsWith("<")?`extension:${e.replace(/[<>]/g,"")}`:`extension:${(0,U1e.basename)(e).replace(/\.(ts|js)$/,"")}`}_applyExtensionBindings(e){e.setUIContext(this._extensionUIContext,this._extensionMode),e.bindCommandContext(this._extensionCommandContextActions),this._extensionErrorUnsubscriber?.(),this._extensionErrorUnsubscriber=this._extensionErrorListener?e.onError(this._extensionErrorListener):void 0}_refreshCurrentModelFromRegistry(){let e=this.model;if(!e)return;let n=this._modelRuntime.getModel(e.provider,e.id);!n||n===e||(this.agent.state.model=n)}_bindExtensionCore(e){let n=()=>{let r=e.getRegisteredCommands().map(o=>({name:o.invocationName,description:o.description,source:"extension",sourceInfo:o.sourceInfo})),i=this.promptTemplates.map(o=>({name:o.name,description:o.description,source:"prompt",sourceInfo:o.sourceInfo})),s=this._resourceLoader.getSkills().skills.map(o=>({name:`skill:${o.name}`,description:o.description,source:"skill",sourceInfo:o.sourceInfo}));return[...r,...i,...s]};e.bindCore({sendMessage:(r,i)=>{this.sendCustomMessage(r,i).catch(s=>{e.emitError({extensionPath:"",event:"send_message",error:s instanceof Error?s.message:String(s)})})},sendUserMessage:(r,i)=>{this.sendUserMessage(r,i).catch(s=>{e.emitError({extensionPath:"",event:"send_user_message",error:s instanceof Error?s.message:String(s)})})},appendEntry:(r,i)=>{let s=this.sessionManager.appendCustomEntry(r,i),o=this.sessionManager.getEntry(s);o&&this._emit({type:"entry_appended",entry:o})},setSessionName:r=>{this.setSessionName(r)},getSessionName:()=>this.sessionManager.getSessionName(),setLabel:(r,i)=>{this.sessionManager.appendLabelChange(r,i)},getActiveTools:()=>this.getActiveToolNames(),getAllTools:()=>this.getAllTools(),setActiveTools:r=>this.setActiveToolsByName(r),refreshTools:()=>this._refreshToolRegistry(),getCommands:n,setModel:async r=>this._modelRuntime.hasConfiguredAuth(r.provider)?(await this.setModel(r),!0):!1,getThinkingLevel:()=>this.thinkingLevel,setThinkingLevel:r=>this.setThinkingLevel(r)},{getModel:()=>this.model,getScopedModels:()=>this._scopedModels,isIdle:()=>this.isIdle,isProjectTrusted:()=>this.settingsManager.isProjectTrusted(),getSignal:()=>this.agent.signal,abort:()=>{if(this._extensionAbortHandler){this._extensionAbortHandler();return}this.abort()},hasPendingMessages:()=>this.pendingMessageCount>0,shutdown:()=>{this._extensionShutdownHandler?.()},getContextUsage:()=>this.getContextUsage(),compact:r=>{(async()=>{try{let i=await this.compact(r?.customInstructions);r?.onComplete?.(i)}catch(i){let s=i instanceof Error?i:new Error(String(i));r?.onError?.(s)}})()},getSystemPrompt:()=>this.systemPrompt,getSystemPromptOptions:()=>this._baseSystemPromptOptions},{registerProvider:(r,i)=>{this._modelRuntime.registerProvider(r,i),this._refreshCurrentModelFromRegistry()},registerNativeProvider:r=>{this._modelRuntime.registerNativeProvider(r),this._refreshCurrentModelFromRegistry()},unregisterProvider:r=>{this._modelRuntime.unregisterProvider(r),this._refreshCurrentModelFromRegistry()}})}_refreshToolRegistry(e){let n=new Set(this._toolRegistry.keys()),r=this.getActiveToolNames(),i=this._allowedToolNames,s=this._excludedToolNames,o=g=>(!i||i.has(g))&&!s?.has(g),c=[...this._extensionRunner.getAllRegisteredTools(),...this._customTools.map(g=>({definition:g,sourceInfo:ih(``,{source:"sdk"})}))].filter(g=>o(g.definition.name)),u=new Map(Array.from(this._baseToolDefinitions.entries()).filter(([g])=>o(g)).map(([g,A])=>[g,{definition:A,sourceInfo:ih(``,{source:"builtin"})}]));for(let g of c)u.set(g.definition.name,{definition:g.definition,sourceInfo:g.sourceInfo});this._toolDefinitions=u,this._toolPromptSnippets=new Map(Array.from(u.values()).map(({definition:g})=>{let A=this._normalizePromptSnippet(g.promptSnippet);return A?[g.name,A]:void 0}).filter(g=>g!==void 0)),this._toolPromptGuidelines=new Map(Array.from(u.values()).map(({definition:g})=>{let A=this._normalizePromptGuidelines(g.promptGuidelines);return A.length>0?[g.name,A]:void 0}).filter(g=>g!==void 0));let l=this._extensionRunner,d=kV(c,l),m=kV(Array.from(this._baseToolDefinitions.values()).filter(g=>o(g.name)).map(g=>({definition:g,sourceInfo:ih(``,{source:"builtin"})})),l),h=new Map(m.map(g=>[g.name,g]));for(let g of d)h.set(g.name,g);this._toolRegistry=h;let f=(e?.activeToolNames?[...e.activeToolNames]:[...r]).filter(g=>o(g));if(i)for(let g of this._toolRegistry.keys())i.has(g)&&f.push(g);else if(e?.includeAllExtensionTools)for(let g of d)f.push(g.name);else if(!e?.activeToolNames)for(let g of this._toolRegistry.keys())n.has(g)||f.push(g);this.setActiveToolsByName([...new Set(f)])}_buildRuntime(e){let n=this.settingsManager.getImageAutoResize(),r=this.settingsManager.getShellCommandPrefix(),i=this.settingsManager.getShellPath(),s=this._baseToolsOverride?Object.fromEntries(Object.entries(this._baseToolsOverride).map(([u,l])=>[u,V3n(l)])):f8n(this._cwd,{read:{autoResizeImages:n},bash:{commandPrefix:r,shellPath:i}});this._baseToolDefinitions=new Map(Object.entries(s).map(([u,l])=>[u,l]));let o=this._resourceLoader.getExtensions();if(e.flagValues)for(let[u,l]of e.flagValues)o.runtime.flagValues.set(u,l);this._extensionRunner=new FQ(o.extensions,o.runtime,this._cwd,this.sessionManager,new NV(this._modelRuntime)),this._extensionRunnerRef&&(this._extensionRunnerRef.current=this._extensionRunner),this._bindExtensionCore(this._extensionRunner),this._applyExtensionBindings(this._extensionRunner);let a=this._baseToolsOverride?Object.keys(this._baseToolsOverride):["read","bash","edit","write"],c=e.activeToolNames??a;this._refreshToolRegistry({activeToolNames:c,includeAllExtensionTools:e.includeAllExtensionTools})}async reload(e){let n=this._extensionRunner,r=n.getFlagValues();await kse(n,{type:"session_shutdown",reason:"reload"}),n.invalidate(),await this.settingsManager.reload(),this.syncQueueModesFromSettings(),git(),await this._resourceLoader.reload(),this._buildRuntime({activeToolNames:this.getActiveToolNames(),flagValues:r,includeAllExtensionTools:!0}),(this._extensionUIContext||this._extensionCommandContextActions||this._extensionShutdownHandler||this._extensionErrorListener)&&(await e?.beforeSessionStart?.(),await this._extensionRunner.emit({type:"session_start",reason:"reload"}),await this.extendResourcesFromExtensions("reload"))}_isRetryableError(e){return rF(e,this.model?.contextWindow??0)?!1:Jy(e)}_summarizationRetryCallbacks(e){return{onRetryScheduled:(n,r,i,s)=>{this._emit({type:"summarization_retry_scheduled",attempt:n,maxAttempts:r,delayMs:i,errorMessage:s})},onRetryAttemptStart:()=>{this._emit({type:"summarization_retry_attempt_start",...e})},onRetryFinished:()=>{this._emit({type:"summarization_retry_finished"})}}}_finishCancelledRetry(){if(this._retryAttempt===0)return;let e=this._retryAttempt;this._retryAttempt=0,this._emit({type:"auto_retry_end",success:!1,attempt:e,finalError:"Retry cancelled"})}async _prepareRetry(e){let n=this.settingsManager.getRetrySettings();if(!n.enabled)return!1;if(this._retryAttempt++,this._retryAttempt>n.maxRetries)return this._retryAttempt--,!1;let r=Wx(n,this._retryAttempt);this._emit({type:"auto_retry_start",attempt:this._retryAttempt,maxAttempts:n.maxRetries,delayMs:r,errorMessage:e.errorMessage||"Unknown error"}),this._omitRecoveryAttempt(e),this._retryAbortController=new AbortController;try{await d$n(r,this._retryAbortController.signal)}catch{return this._finishCancelledRetry(),!1}finally{this._retryAbortController=void 0}return!0}abortRetry(){this._retryAbortController?.abort()}get isRetrying(){return this._retryAbortController!==void 0}get autoRetryEnabled(){return this.settingsManager.getRetryEnabled()}setAutoRetryEnabled(e){this.settingsManager.setRetryEnabled(e)}async executeBash(e,n,r){let i=new AbortController;this._bashAbortControllers.add(i);let s=this.settingsManager.getShellCommandPrefix(),o=this.settingsManager.getShellPath(),a=s?`${s} +${e}`:e;try{let c=await x$n(a,this.sessionManager.getCwd(),r?.operations??PV({shellPath:o}),{onChunk:u=>{n?.(u),this._emit({type:"bash_execution_update",id:r?.id,delta:u})},signal:i.signal});return this.recordBashResult(e,c,r),c}finally{this._bashAbortControllers.delete(i)}}recordBashResult(e,n,r){let i={role:"bashExecution",command:e,output:n.output,exitCode:n.exitCode,cancelled:n.cancelled,truncated:n.truncated,fullOutputPath:n.fullOutputPath,timestamp:Date.now(),excludeFromContext:r?.excludeFromContext};this.isStreaming?this._pendingBashMessages.push(i):(this.sessionManager.appendMessage(i),this._refreshFinalizedContext())}abortBash(){for(let e of[...this._bashAbortControllers])e.abort()}get isBashRunning(){return this._bashAbortControllers.size>0}get hasPendingBashMessages(){return this._pendingBashMessages.length>0}_flushPendingBashMessages(){if(this._pendingBashMessages.length!==0){for(let e of this._pendingBashMessages)this.sessionManager.appendMessage(e);this._pendingBashMessages=[],this._refreshFinalizedContext()}}setSessionName(e){this.sessionManager.appendSessionInfo(e);let n={type:"session_info_changed",name:this.sessionManager.getSessionName()};this._emit(n),this._extensionRunner.emit(n)}async navigateTree(e,n={}){if(this.isStreaming)throw new Error("Wait for the current response to finish before navigating the session tree.");if(this.isCompacting)throw new Error("Wait for the current compaction or tree navigation to finish before navigating the session tree.");let r=this.sessionManager.getLeafId();if(e===r)return{cancelled:!1};if(n.summarize&&!this.model)throw new Error("No model available for summarization");let i=this.sessionManager.getEntry(e);if(!i)throw new Error(`Entry ${e} not found`);let{entries:s,commonAncestorId:o}=IRe(this.sessionManager,r,e),a=n.customInstructions,c=n.replaceInstructions,u=n.label,l={targetId:e,oldLeafId:r,commonAncestorId:o,entriesToSummarize:s,userWantsSummary:n.summarize??!1,customInstructions:a,replaceInstructions:c,label:u};this._branchSummaryAbortController=new AbortController;try{let d,m=!1;if(this._extensionRunner.hasHandlers("session_before_tree")){let _=await this._extensionRunner.emit({type:"session_before_tree",preparation:l,signal:this._branchSummaryAbortController.signal});if(_?.cancel)return{cancelled:!0};_?.summary&&n.summarize&&(d=_.summary,m=!0),_?.customInstructions!==void 0&&(a=_.customInstructions),_?.replaceInstructions!==void 0&&(c=_.replaceInstructions),_?.label!==void 0&&(u=_.label)}let h,f,g;if(n.summarize&&s.length>0&&!d){let _=this.model,{model:S,apiKey:C,headers:I,env:w}=await this._getSummarizationRequestAuth(_),k=this.settingsManager.getBranchSummarySettings(),N=await wRe(s,{model:S,apiKey:C,headers:I,env:w,signal:this._branchSummaryAbortController.signal,customInstructions:a,replaceInstructions:c,reserveTokens:k.reserveTokens,streamFn:this.agent.streamFunction,retry:this.settingsManager.getRetrySettings(),callbacks:this._summarizationRetryCallbacks({source:"branchSummary"})});if(N.aborted)return{cancelled:!0,aborted:!0};if(N.error)throw new Error(N.error);h=N.summary,g=N.usage,f={readFiles:N.readFiles||[],modifiedFiles:N.modifiedFiles||[]}}else d&&(h=d.summary,f=d.details,g=d.usage);let A,y;i.type==="message"&&i.message.role==="user"?(A=i.parentId,y=aa(i.message.content,"")):i.type==="custom_message"?(A=i.parentId,y=aa(i.content,"")):A=e;let E;if(h){let _=this.sessionManager.branchWithSummary(A,h,f,m,g);E=this.sessionManager.getEntry(_),u&&this.sessionManager.appendLabelChange(_,u)}else A===null?this.sessionManager.resetLeaf():this.sessionManager.branch(A);return u&&!h&&this.sessionManager.appendLabelChange(e,u),this._refreshFinalizedContext(),this._restoreToolsFromTranscript(),await this._extensionRunner.emit({type:"session_tree",newLeafId:this.sessionManager.getLeafId(),oldLeafId:r,summaryEntry:E,fromExtension:h?m:void 0}),{editorText:y,cancelled:!1,summaryEntry:E}}finally{this._branchSummaryAbortController=void 0,this._resolveIdleWaitIfIdle()}}getUserMessagesForForking(){let e=this.sessionManager.getEntries(),n=[];for(let r of e){if(r.type!=="message"||r.message.role!=="user")continue;let i=aa(r.message.content,"");i&&n.push({entryId:r.id,text:i})}return n}getSessionStats(){let e=0,n=0,r=0,i=0,s=0,o=zse();for(let a of this.sessionManager.getEntries()){if(a.type==="usage"?xS(o,a.usage):(a.type==="branch_summary"||a.type==="compaction")&&a.usage&&xS(o,a.usage),a.type!=="message")continue;i++;let c=a.message;if(c.role==="user")e++;else if(c.role==="toolResult")r++,c.usage&&xS(o,c.usage);else if(c.role==="assistant"){n++;let u=c;Array.isArray(u.content)&&(s+=u.content.filter(l=>l.type==="toolCall").length),xS(o,u.usage)}}return{sessionFile:this.sessionFile,sessionId:this.sessionId,userMessages:e,assistantMessages:n,toolCalls:s,toolResults:r,totalMessages:i,tokens:{input:o.input,output:o.output,cacheRead:o.cacheRead,cacheWrite:o.cacheWrite,total:o.input+o.output+o.cacheRead+o.cacheWrite},cost:o.cost,contextUsage:this.getContextUsage()}}getContextUsage(){let e=this.model;if(!e)return;let n=e.contextWindow??0;if(n<=0)return;let r=this.sessionManager.buildSessionProjection(),i=this.sessionManager.getBranch(),s=Oie(i);if(s){let c=new Set(r.entries.flatMap(d=>d.messages.some(m=>m.role==="assistant"&&m.stopReason!=="aborted"&&m.stopReason!=="error"&&EQ(m.usage)>0)?[d.sourceEntry.id]:[])),u=i.findIndex(d=>d.id===s.id);if(!i.slice(u+1).some(d=>c.has(d.id)))return{tokens:null,contextWindow:n,percent:null}}let o=Jj(r,i),a=o.tokens/n*100;return{tokens:o.tokens,contextWindow:n,percent:a}}async exportToHtml(e,n={}){let r=[n.themeName,this.settingsManager.getTheme()].find(s=>s!==void 0&&HTe(s)!==void 0),i=bWn({getToolDefinition:s=>this.getToolDefinition(s),theme:Ee,cwd:this.sessionManager.getCwd()});return await mWn(this.sessionManager,this.state,{outputPath:e,themeName:r,toolRenderer:i})}exportToJsonl(e){return p1e(this.sessionManager,e)}async summarizeForBugReport(e){let n=this.model;if(!n)throw new Error("No model selected");let{model:r,apiKey:i,headers:s,env:o}=await this._getSummarizationRequestAuth(n);return oWn({messages:this.messages,hint:e.hint,model:r,apiKey:i,headers:s,env:o,signal:e.signal,thinkingLevel:this.thinkingLevel,streamFn:this.agent.streamFunction,retry:this.settingsManager.getRetrySettings(),sessionId:this.sessionId})}getLastAssistantText(){let e=this.messages.slice().reverse().find(r=>{if(r.role!=="assistant")return!1;let i=r;return!(i.stopReason==="aborted"&&i.content.length===0)});if(!e)return;let n="";for(let r of e.content)r.type==="text"&&(n+=r.text);return n.trim()||void 0}createReplacedSessionContext(){let e=Object.defineProperties({},Object.getOwnPropertyDescriptors(this._extensionRunner.createCommandContext()));return e.sendMessage=(n,r)=>this.sendCustomMessage(n,r),e.sendUserMessage=(n,r)=>this.sendUserMessage(n,r),e}hasExtensionHandlers(e){return this._extensionRunner.hasHandlers(e)}get extensionRunner(){return this._extensionRunner}}});var _8n=re((ykc,b8n)=>{p();var oP=require("constants"),rYi=process.cwd,W1e=null,iYi=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return W1e||(W1e=rYi.call(process)),W1e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Umt=process.chdir,process.chdir=function(t){W1e=null,Umt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Umt));var Umt;b8n.exports=sYi;function sYi(t){oP.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||n(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=r(t.chmod),t.fchmod=r(t.fchmod),t.lchmod=r(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,d,m){m&&process.nextTick(m)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,d,m,h){h&&process.nextTick(h)},t.lchownSync=function(){}),iYi==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(l){function d(m,h,f){var g=Date.now(),A=0;l(m,h,function y(E){if(E&&(E.code==="EACCES"||E.code==="EPERM"||E.code==="EBUSY")&&Date.now()-g<6e4){setTimeout(function(){t.stat(h,function(_,S){_&&_.code==="ENOENT"?l(m,h,y):f(E)})},A),A<100&&(A+=10);return}f&&f(E)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(l){function d(m,h,f,g,A,y){var E;if(y&&typeof y=="function"){var _=0;E=function(S,C,I){if(S&&S.code==="EAGAIN"&&_<10)return _++,l.call(t,m,h,f,g,A,E);y.apply(this,arguments)}}return l.call(t,m,h,f,g,A,E)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(l){return function(d,m,h,f,g){for(var A=0;;)try{return l.call(t,d,m,h,f,g)}catch(y){if(y.code==="EAGAIN"&&A<10){A++;continue}throw y}}})(t.readSync);function e(l){l.lchmod=function(d,m,h){l.open(d,oP.O_WRONLY|oP.O_SYMLINK,m,function(f,g){if(f){h&&h(f);return}l.fchmod(g,m,function(A){l.close(g,function(y){h&&h(A||y)})})})},l.lchmodSync=function(d,m){var h=l.openSync(d,oP.O_WRONLY|oP.O_SYMLINK,m),f=!0,g;try{g=l.fchmodSync(h,m),f=!1}finally{if(f)try{l.closeSync(h)}catch{}else l.closeSync(h)}return g}}function n(l){oP.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(d,m,h,f){l.open(d,oP.O_SYMLINK,function(g,A){if(g){f&&f(g);return}l.futimes(A,m,h,function(y){l.close(A,function(E){f&&f(y||E)})})})},l.lutimesSync=function(d,m,h){var f=l.openSync(d,oP.O_SYMLINK),g,A=!0;try{g=l.futimesSync(f,m,h),A=!1}finally{if(A)try{l.closeSync(f)}catch{}else l.closeSync(f)}return g}):l.futimes&&(l.lutimes=function(d,m,h,f){f&&process.nextTick(f)},l.lutimesSync=function(){})}function r(l){return l&&function(d,m,h){return l.call(t,d,m,function(f){u(f)&&(f=null),h&&h.apply(this,arguments)})}}function i(l){return l&&function(d,m){try{return l.call(t,d,m)}catch(h){if(!u(h))throw h}}}function s(l){return l&&function(d,m,h,f){return l.call(t,d,m,h,function(g){u(g)&&(g=null),f&&f.apply(this,arguments)})}}function o(l){return l&&function(d,m,h){try{return l.call(t,d,m,h)}catch(f){if(!u(f))throw f}}}function a(l){return l&&function(d,m,h){typeof m=="function"&&(h=m,m=null);function f(g,A){A&&(A.uid<0&&(A.uid+=4294967296),A.gid<0&&(A.gid+=4294967296)),h&&h.apply(this,arguments)}return m?l.call(t,d,m,f):l.call(t,d,f)}}function c(l){return l&&function(d,m){var h=m?l.call(t,d,m):l.call(t,d);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function u(l){if(!l||l.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var C8n=re((bkc,S8n)=>{p();var x8n=require("stream").Stream;S8n.exports=oYi;function oYi(t){return{ReadStream:e,WriteStream:n};function e(r,i){if(!(this instanceof e))return new e(r,i);x8n.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),a=0,c=o.length;athis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(l,d){if(l){s.emit("error",l),s.readable=!1;return}s.fd=d,s.emit("open",d),s._read()})}function n(r,i){if(!(this instanceof n))return new n(r,i);x8n.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,a=s.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var w8n=re((xkc,I8n)=>{"use strict";p();I8n.exports=cYi;var aYi=Object.getPrototypeOf||function(t){return t.__proto__};function cYi(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:aYi(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}});var Hmt=re((Ckc,Wmt)=>{p();var ou=require("fs"),lYi=_8n(),uYi=C8n(),dYi=w8n(),H1e=require("util"),sh,j1e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(sh=Symbol.for("graceful-fs.queue"),j1e=Symbol.for("graceful-fs.previous")):(sh="___graceful-fs.queue",j1e="___graceful-fs.previous");function pYi(){}function R8n(t,e){Object.defineProperty(t,sh,{get:function(){return e}})}var jQ=pYi;H1e.debuglog?jQ=H1e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(jQ=function(){var t=H1e.format.apply(H1e,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t)});ou[sh]||(T8n=global[sh]||[],R8n(ou,T8n),ou.close=(function(t){function e(n,r){return t.call(ou,n,function(i){i||v8n(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(e,j1e,{value:t}),e})(ou.close),ou.closeSync=(function(t){function e(n){t.apply(ou,arguments),v8n()}return Object.defineProperty(e,j1e,{value:t}),e})(ou.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){jQ(ou[sh]),require("assert").equal(ou[sh].length,0)}));var T8n;global[sh]||R8n(global,ou[sh]);Wmt.exports=Gmt(dYi(ou));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ou.__patched&&(Wmt.exports=Gmt(ou),ou.__patched=!0);function Gmt(t){lYi(t),t.gracefulify=Gmt,t.createReadStream=C,t.createWriteStream=I;var e=t.readFile;t.readFile=n;function n(N,O,W){return typeof O=="function"&&(W=O,O=null),$(N,O,W);function $(G,q,ce,Y){return e(G,q,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?eY([$,[G,q,ce],z,Y||Date.now(),Date.now()]):typeof ce=="function"&&ce.apply(this,arguments)})}}var r=t.writeFile;t.writeFile=i;function i(N,O,W,$){return typeof W=="function"&&($=W,W=null),G(N,O,W,$);function G(q,ce,Y,z,j){return r(q,ce,Y,function(se){se&&(se.code==="EMFILE"||se.code==="ENFILE")?eY([G,[q,ce,Y,z],se,j||Date.now(),Date.now()]):typeof z=="function"&&z.apply(this,arguments)})}}var s=t.appendFile;s&&(t.appendFile=o);function o(N,O,W,$){return typeof W=="function"&&($=W,W=null),G(N,O,W,$);function G(q,ce,Y,z,j){return s(q,ce,Y,function(se){se&&(se.code==="EMFILE"||se.code==="ENFILE")?eY([G,[q,ce,Y,z],se,j||Date.now(),Date.now()]):typeof z=="function"&&z.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=c);function c(N,O,W,$){return typeof W=="function"&&($=W,W=0),G(N,O,W,$);function G(q,ce,Y,z,j){return a(q,ce,Y,function(se){se&&(se.code==="EMFILE"||se.code==="ENFILE")?eY([G,[q,ce,Y,z],se,j||Date.now(),Date.now()]):typeof z=="function"&&z.apply(this,arguments)})}}var u=t.readdir;t.readdir=d;var l=/^v[0-5]\./;function d(N,O,W){typeof O=="function"&&(W=O,O=null);var $=l.test(process.version)?function(ce,Y,z,j){return u(ce,G(ce,Y,z,j))}:function(ce,Y,z,j){return u(ce,Y,G(ce,Y,z,j))};return $(N,O,W);function G(q,ce,Y,z){return function(j,se){j&&(j.code==="EMFILE"||j.code==="ENFILE")?eY([$,[q,ce,Y],j,z||Date.now(),Date.now()]):(se&&se.sort&&se.sort(),typeof Y=="function"&&Y.call(this,j,se))}}}if(process.version.substr(0,4)==="v0.8"){var m=uYi(t);y=m.ReadStream,_=m.WriteStream}var h=t.ReadStream;h&&(y.prototype=Object.create(h.prototype),y.prototype.open=E);var f=t.WriteStream;f&&(_.prototype=Object.create(f.prototype),_.prototype.open=S),Object.defineProperty(t,"ReadStream",{get:function(){return y},set:function(N){y=N},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return _},set:function(N){_=N},enumerable:!0,configurable:!0});var g=y;Object.defineProperty(t,"FileReadStream",{get:function(){return g},set:function(N){g=N},enumerable:!0,configurable:!0});var A=_;Object.defineProperty(t,"FileWriteStream",{get:function(){return A},set:function(N){A=N},enumerable:!0,configurable:!0});function y(N,O){return this instanceof y?(h.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function E(){var N=this;k(N.path,N.flags,N.mode,function(O,W){O?(N.autoClose&&N.destroy(),N.emit("error",O)):(N.fd=W,N.emit("open",W),N.read())})}function _(N,O){return this instanceof _?(f.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function S(){var N=this;k(N.path,N.flags,N.mode,function(O,W){O?(N.destroy(),N.emit("error",O)):(N.fd=W,N.emit("open",W))})}function C(N,O){return new t.ReadStream(N,O)}function I(N,O){return new t.WriteStream(N,O)}var w=t.open;t.open=k;function k(N,O,W,$){return typeof W=="function"&&($=W,W=null),G(N,O,W,$);function G(q,ce,Y,z,j){return w(q,ce,Y,function(se,Ae){se&&(se.code==="EMFILE"||se.code==="ENFILE")?eY([G,[q,ce,Y,z],se,j||Date.now(),Date.now()]):typeof z=="function"&&z.apply(this,arguments)})}}return t}function eY(t){jQ("ENQUEUE",t[0].name,t[1]),ou[sh].push(t),$mt()}var q1e;function v8n(){for(var t=Date.now(),e=0;e2&&(ou[sh][e][3]=t,ou[sh][e][4]=t);$mt()}function $mt(){if(clearTimeout(q1e),q1e=void 0,ou[sh].length!==0){var t=ou[sh].shift(),e=t[0],n=t[1],r=t[2],i=t[3],s=t[4];if(i===void 0)jQ("RETRY",e.name,n),e.apply(null,n);else if(Date.now()-i>=6e4){jQ("TIMEOUT",e.name,n);var o=n.pop();typeof o=="function"&&o.call(null,r)}else{var a=Date.now()-s,c=Math.max(s-i,1),u=Math.min(c*1.2,100);a>=u?(jQ("RETRY",e.name,n),e.apply(null,n.concat([i]))):ou[sh].push(t)}q1e===void 0&&(q1e=setTimeout($mt,0))}}});var B8n=re((wkc,k8n)=>{p();function Fb(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}k8n.exports=Fb;Fb.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Fb.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Fb.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var r=this,i=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n);return this._options.unref&&i.unref(),!0};Fb.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Fb.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Fb.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Fb.prototype.start=Fb.prototype.try;Fb.prototype.errors=function(){return this._errors};Fb.prototype.attempts=function(){return this._attempts};Fb.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,n=0,r=0;r=n&&(e=i,n=o)}return e}});var N8n=re(VQ=>{p();var mYi=B8n();VQ.operation=function(t){var e=VQ.timeouts(t);return new mYi(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};VQ.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)e[n]=t[n];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],i=0;i{p();D8n.exports=N8n()});var M8n=re((Nkc,V1e)=>{p();V1e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&V1e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&V1e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var U8n=re((Pkc,rY)=>{p();var Ol=global.process,YQ=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};YQ(Ol)?(O8n=require("assert"),tY=M8n(),L8n=/^win/i.test(Ol.platform),Kse=require("events"),typeof Kse!="function"&&(Kse=Kse.EventEmitter),Ol.__signal_exit_emitter__?um=Ol.__signal_exit_emitter__:(um=Ol.__signal_exit_emitter__=new Kse,um.count=0,um.emitted={}),um.infinite||(um.setMaxListeners(1/0),um.infinite=!0),rY.exports=function(t,e){if(!YQ(global.process))return function(){};O8n.equal(typeof t,"function","a callback must be provided for exit handler"),nY===!1&&qmt();var n="exit";e&&e.alwaysLast&&(n="afterexit");var r=function(){um.removeListener(n,t),um.listeners("exit").length===0&&um.listeners("afterexit").length===0&&Y1e()};return um.on(n,t),r},Y1e=function(){!nY||!YQ(global.process)||(nY=!1,tY.forEach(function(e){try{Ol.removeListener(e,z1e[e])}catch{}}),Ol.emit=K1e,Ol.reallyExit=jmt,um.count-=1)},rY.exports.unload=Y1e,zQ=function(e,n,r){um.emitted[e]||(um.emitted[e]=!0,um.emit(e,n,r))},z1e={},tY.forEach(function(t){z1e[t]=function(){if(YQ(global.process)){var n=Ol.listeners(t);n.length===um.count&&(Y1e(),zQ("exit",null,t),zQ("afterexit",null,t),L8n&&t==="SIGHUP"&&(t="SIGINT"),Ol.kill(Ol.pid,t))}}}),rY.exports.signals=function(){return tY},nY=!1,qmt=function(){nY||!YQ(global.process)||(nY=!0,um.count+=1,tY=tY.filter(function(e){try{return Ol.on(e,z1e[e]),!0}catch{return!1}}),Ol.emit=Q8n,Ol.reallyExit=F8n)},rY.exports.load=qmt,jmt=Ol.reallyExit,F8n=function(e){YQ(global.process)&&(Ol.exitCode=e||0,zQ("exit",Ol.exitCode,null),zQ("afterexit",Ol.exitCode,null),jmt.call(Ol,Ol.exitCode))},K1e=Ol.emit,Q8n=function(e,n){if(e==="exit"&&YQ(global.process)){n!==void 0&&(Ol.exitCode=n);var r=K1e.apply(this,arguments);return zQ("exit",Ol.exitCode,null),zQ("afterexit",Ol.exitCode,null),r}else return K1e.apply(this,arguments)}):rY.exports=function(){return function(){}};var O8n,tY,L8n,Kse,um,Y1e,zQ,z1e,nY,qmt,jmt,F8n,K1e,Q8n});var $8n=re((Okc,Vmt)=>{"use strict";p();var G8n=Symbol();function hYi(t,e,n){let r=e[G8n];if(r)return e.stat(t,(s,o)=>{if(s)return n(s);n(null,o.mtime,r)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,s=>{if(s)return n(s);e.stat(t,(o,a)=>{if(o)return n(o);let c=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,G8n,{value:c}),n(null,a.mtime,c)})})}function fYi(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Vmt.exports.probe=hYi;Vmt.exports.getMtime=fYi});var V8n=re((Fkc,Xse)=>{"use strict";p();var gYi=require("path"),Kmt=Hmt(),AYi=P8n(),yYi=U8n(),W8n=$8n(),ak={};function Jse(t,e){return e.lockfilePath||`${t}.lock`}function Jmt(t,e,n){if(!e.realpath)return n(null,gYi.resolve(t));e.fs.realpath(t,n)}function zmt(t,e,n){let r=Jse(t,e);e.fs.mkdir(r,i=>{if(!i)return W8n.probe(r,e.fs,(s,o,a)=>{if(s)return e.fs.rmdir(r,()=>{}),n(s);n(null,o,a)});if(i.code!=="EEXIST")return n(i);if(e.stale<=0)return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(r,(s,o)=>{if(s)return s.code==="ENOENT"?zmt(t,{...e,stale:0},n):n(s);if(!H8n(o,e))return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));q8n(t,e,a=>{if(a)return n(a);zmt(t,{...e,stale:0},n)})})})}function H8n(t,e){return t.mtime.getTime(){if(r&&r.code!=="ENOENT")return n(r);n()})}function J1e(t,e){let n=ak[t];n.updateTimeout||(n.updateDelay=n.updateDelay||e.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,e.fs.stat(n.lockfilePath,(r,i)=>{let s=n.lastUpdate+e.stale{let u=n.lastUpdate+e.stale{throw r},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),Jmt(t,e,(r,i)=>{if(r)return n(r);let s=AYi.operation(e.retries);s.attempt(()=>{zmt(i,e,(o,a,c)=>{if(s.retry(o))return;if(o)return n(s.mainError());let u=ak[i]={lockfilePath:Jse(i,e),mtime:a,mtimePrecision:c,options:e,lastUpdate:Date.now()};J1e(i,e),n(null,l=>{if(u.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));j8n(i,{...e,realpath:!1},l)})})})})}function j8n(t,e,n){e={fs:Kmt,realpath:!0,...e},Jmt(t,e,(r,i)=>{if(r)return n(r);let s=ak[i];if(!s)return n(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));s.updateTimeout&&clearTimeout(s.updateTimeout),s.released=!0,delete ak[i],q8n(i,e,n)})}function bYi(t,e,n){e={stale:1e4,realpath:!0,fs:Kmt,...e},e.stale=Math.max(e.stale||0,2e3),Jmt(t,e,(r,i)=>{if(r)return n(r);e.fs.stat(Jse(i,e),(s,o)=>s?s.code==="ENOENT"?n(null,!1):n(s):n(null,!H8n(o,e)))})}function _Yi(){return ak}yYi(()=>{for(let t in ak){let e=ak[t].options;try{e.fs.rmdirSync(Jse(t,e))}catch{}}});Xse.exports.lock=EYi;Xse.exports.unlock=j8n;Xse.exports.check=bYi;Xse.exports.getLocks=_Yi});var z8n=re((Ukc,Y8n)=>{"use strict";p();var xYi=Hmt();function SYi(t){let e=["mkdir","realpath","stat","rmdir","utimes"],n={...t};return e.forEach(r=>{n[r]=(...i)=>{let s=i.pop(),o;try{o=t[`${r}Sync`](...i)}catch(a){return s(a)}s(null,o)}}),n}function CYi(t){return(...e)=>new Promise((n,r)=>{e.push((i,s)=>{i?r(i):n(s)}),t(...e)})}function IYi(t){return(...e)=>{let n,r;if(e.push((i,s)=>{n=i,r=s}),t(...e),n)throw n;return r}}function wYi(t){if(t={...t},t.fs=SYi(t.fs||xYi),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}Y8n.exports={toPromise:CYi,toSync:IYi,toSyncOptions:wYi}});var Zse=re(($kc,aP)=>{"use strict";p();var iY=V8n(),{toPromise:X1e,toSync:Z1e,toSyncOptions:Xmt}=z8n();async function K8n(t,e){let n=await X1e(iY.lock)(t,e);return X1e(n)}function TYi(t,e){let n=Z1e(iY.lock)(t,Xmt(e));return Z1e(n)}function vYi(t,e){return X1e(iY.unlock)(t,e)}function RYi(t,e){return Z1e(iY.unlock)(t,Xmt(e))}function kYi(t,e){return X1e(iY.check)(t,e)}function BYi(t,e){return Z1e(iY.check)(t,Xmt(e))}aP.exports=K8n;aP.exports.lock=K8n;aP.exports.unlock=vYi;aP.exports.lockSync=TYi;aP.exports.unlockSync=RYi;aP.exports.check=kYi;aP.exports.checkSync=BYi});function J8n(t){if(t.reason!==void 0)return t.reason;let e=new Error("The operation was aborted");return e.name="AbortError",e}function KQ(t){return t??new AbortController().signal}function vw(t,e){return e?e.aborted?(t.catch(()=>{}),Promise.reject(J8n(e))):new Promise((n,r)=>{let i=!1,s=()=>e.removeEventListener("abort",o),o=()=>{i||(i=!0,s(),r(J8n(e)))};e.addEventListener("abort",o,{once:!0}),t.then(a=>{i||(i=!0,s(),n(a))},a=>{i||(i=!0,s(),r(a))}),e.aborted&&o()}):t}var eoe=v(()=>{p()});function X8n(t,e=(0,JQ.join)(ii(),"auth.json")){try{return JSON.parse(zs((0,ef.readFileSync)(Vo(e),"utf-8")))[t]}catch{return}}var ef,JQ,eht,tht,Zmt,eBe,toe,tBe,nht,sY,noe=v(()=>{p();ef=require("fs"),JQ=require("path"),eht=Ot(Zse(),1),tht=require("timers/promises");Qs();eoe();fc();nm();zpt();Zmt={encoding:"utf-8",mode:384},toe=class{authPath;constructor(e=(0,JQ.join)(ii(),"auth.json")){this.authPath=Vo(e)}ensureParentDir(){let e=(0,JQ.dirname)(this.authPath);(0,ef.existsSync)(e)||(0,ef.mkdirSync)(e,{recursive:!0,mode:448})}ensureFileExists(){(0,ef.existsSync)(this.authPath)||(0,ef.writeFileSync)(this.authPath,"{}",Zmt)}acquireLockSyncWithRetry(e){let i;for(let s=1;s<=10;s++)try{return eht.default.lockSync(e,{realpath:!1})}catch(o){if((typeof o=="object"&&o!==null&&"code"in o?String(o.code):void 0)!=="ELOCKED"||s===10)throw o;i=o;let c=Date.now();for(;Date.now()-c<20;);}throw i??new Error("Failed to acquire auth storage lock")}withLock(e){this.ensureParentDir(),this.ensureFileExists();let n;try{n=this.acquireLockSyncWithRetry(this.authPath);let r=(0,ef.existsSync)(this.authPath)?(0,ef.readFileSync)(this.authPath,"utf-8"):void 0,{result:i,next:s}=e(r);return s!==void 0&&(0,ef.writeFileSync)(this.authPath,s,Zmt),i}finally{n&&n()}}async acquireLockAsync(e,n){let s=Date.now()+3e4,o=0;for(;;){e?.throwIfAborted();let a;try{a=await eht.default.lock(this.authPath,{realpath:!1,retries:0,stale:3e4,onCompromised:n})}catch(c){e?.throwIfAborted();let u=typeof c=="object"&&c!==null&&"code"in c?String(c.code):void 0,l=s-Date.now();if(u!=="ELOCKED"||l<=0)throw c;let d=Math.min(10*2**o,2e3/2);o++;let m=Math.min(Math.round(d*(1+Math.random())),l);e?await(0,tht.setTimeout)(m,void 0,{signal:e}):await(0,tht.setTimeout)(m);continue}return e?.aborted&&(await a(),e.throwIfAborted()),a}}async withLockAsync(e,n){n?.signal?.throwIfAborted(),this.ensureParentDir(),this.ensureFileExists();let r,i=!1,s,o=()=>{if(i)throw s??new Error("Auth storage lock was compromised")};try{r=await this.acquireLockAsync(n?.signal,l=>{i=!0,s=l}),o(),n?.signal?.throwIfAborted();let a=(0,ef.existsSync)(this.authPath)?(0,ef.readFileSync)(this.authPath,"utf-8"):void 0,{result:c,next:u}=await e(a);return o(),n?.signal?.throwIfAborted(),u!==void 0&&(0,ef.writeFileSync)(this.authPath,u,Zmt),o(),c}finally{if(r)try{await r()}catch{}}}},tBe=class{authPath;data;constructor(e=(0,JQ.join)(ii(),"auth.json")){this.authPath=Vo(e)}load(){if(this.data)return this.data;let e;try{e=JSON.parse(zs((0,ef.readFileSync)(this.authPath,"utf-8")))}catch(n){if(n.code==="ENOENT")return this.data={},this.data;throw new Error(`Failed to read auth.json: ${n instanceof Error?n.message:String(n)}`)}if(typeof e!="object"||e===null||Array.isArray(e))throw new Error("Invalid auth.json: expected an object");for(let[n,r]of Object.entries(e)){if(typeof r!="object"||r===null||Array.isArray(r))throw new Error(`Invalid auth.json credential for provider "${n}"`);let i=r;if(i.type==="api_key"){let s=i.key===void 0||typeof i.key=="string",o=i.env===void 0||typeof i.env=="object"&&i.env!==null&&!Array.isArray(i.env)&&Object.values(i.env).every(a=>typeof a=="string");if(s&&o)continue}else if(i.type==="oauth"&&typeof i.access=="string"&&typeof i.refresh=="string"&&typeof i.expires=="number"&&Number.isFinite(i.expires))continue;throw new Error(`Invalid auth.json credential for provider "${n}"`)}return this.data=e,this.data}async read(e,n){n?.signal?.throwIfAborted();let r=this.load()[e];if(n?.signal?.throwIfAborted(),!!r)return r.type!=="api_key"||!r.key||Pse(r.key)?structuredClone(r):{...r,key:Vpt(r.key,r.env)}}async list(e){e?.signal?.throwIfAborted();let n=Object.entries(this.load()).map(([r,i])=>({providerId:r,type:i.type}));return e?.signal?.throwIfAborted(),n}async modify(e,n,r){throw new Error("Read-only credential storage cannot modify auth.json")}async delete(e,n){throw new Error("Read-only credential storage cannot modify auth.json")}},nht=class{value;asyncChain=Promise.resolve();withLock(e){let{result:n,next:r}=e(this.value);return r!==void 0&&(this.value=r),n}withLockAsync(e,n){let r=this.asyncChain,i=(async()=>{await r.catch(()=>{}),n?.signal?.throwIfAborted();let{result:s,next:o}=await e(this.value);return n?.signal?.throwIfAborted(),o!==void 0&&(this.value=o),s})();return this.asyncChain=i.catch(()=>{}),vw(i,n?.signal)}},sY=class t{storage;authPath;readState;constructor(e,n){if(this.storage=e,this.authPath=n,this.readState=n&&eBe?.authPath===n?eBe.readState:{data:{}},n&&!eBe&&(eBe={authPath:n,readState:this.readState}),n){let r=CR(n);if(r!==void 0&&r===this.readState.revision)return}this.reload()}static create(e=(0,JQ.join)(ii(),"auth.json")){let n=Vo(e);return new t(new toe(n),n)}static fromStorage(e){return new t(e)}static inMemory(e={}){let n=new nht;return n.withLock(()=>({result:void 0,next:JSON.stringify(e,null,2)})),t.fromStorage(n)}parseStorageData(e){return e?JSON.parse(zs(e)):{}}updateReadState(e,n){this.readState.data=e,this.readState.revision=n}reload(){let e,n;try{this.storage.withLock(r=>(e=r,n=this.authPath?CR(this.authPath):void 0,{result:void 0})),this.updateReadState(this.parseStorageData(e),n)}catch{}}async reloadFromStorageAsync(e){return this.storage.withLockAsync(async n=>{let r=this.parseStorageData(n),i=this.authPath?CR(this.authPath):void 0;return this.updateReadState(r,i),{result:r}},e)}async readLatestData(e){if(e?.signal?.throwIfAborted(),!this.authPath){let i=this.reloadFromStorageAsync(e);return e?.signal?i:i.catch(()=>this.readState.data)}let n=CR(this.authPath);if(n!==void 0&&n===this.readState.revision)return this.readState.data;if(!this.readState.reload){let i=new AbortController,s={controller:i,promise:this.reloadFromStorageAsync({signal:i.signal}),readers:0};this.readState.reload=s,s.promise.then(()=>{this.readState.reload===s&&(this.readState.reload=void 0)},()=>{this.readState.reload===s&&(this.readState.reload=void 0)})}let r=this.readState.reload;r.readers++;try{let i=vw(r.promise,e?.signal);return e?.signal?await i:await i.catch(()=>this.readState.data)}finally{r.readers--,r.readers===0&&this.readState.reload===r&&(this.readState.reload=void 0,r.controller.abort())}}async read(e,n){let r=(await this.readLatestData(n))[e];return n?.signal?.throwIfAborted(),r?.type!=="api_key"||r.key===void 0?r:{...r,key:Vpt(r.key,r.env)}}async modify(e,n,r){let i=this.readState.data,s,o=await this.storage.withLockAsync(async a=>{let c=this.parseStorageData(a),u=await n(c[e]);if(u===void 0)return i=c,s=this.authPath?CR(this.authPath):void 0,{result:c[e]};let l={...c,[e]:u};return i=l,{result:u,next:JSON.stringify(l,null,2)}},r);return this.updateReadState(i,s),o}async delete(e,n){let r=this.readState.data;await this.storage.withLockAsync(async i=>{let s=this.parseStorageData(i);return delete s[e],r=s,{result:void 0,next:JSON.stringify(s,null,2)}},n),this.updateReadState(r)}async list(e){let n=Object.entries(await this.readLatestData(e));return e?.signal?.throwIfAborted(),n.map(([r,i])=>({providerId:r,type:i.type}))}}});var rht,Z8n,NYi,ejn=v(()=>{p();rht=(t,e,n)=>{let r=t instanceof RegExp?Z8n(t,n):t,i=e instanceof RegExp?Z8n(e,n):e,s=r!==null&&i!=null&&NYi(r,i,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+i.length)}},Z8n=(t,e)=>{let n=e.match(t);return n?n[0]:null},NYi=(t,e,n)=>{let r,i,s,o,a,c=n.indexOf(t),u=n.indexOf(e,c+1),l=c;if(c>=0&&u>0){if(t===e)return[c,u];for(r=[],s=n.length;l>=0&&!a;){if(l===c)r.push(l),c=n.indexOf(t,l+1);else if(r.length===1){let d=r.pop();d!==void 0&&(a=[d,u])}else i=r.pop(),i!==void 0&&i=0?c:u}r.length&&o!==void 0&&(a=[s,o])}return a}});function iht(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function VYi(t){return t.replace(FYi,tjn).replace(QYi,njn).replace(UYi,aht).replace(GYi,rjn).replace($Yi,ijn)}function YYi(t){return t.replace(DYi,"\\").replace(PYi,"{").replace(MYi,"}").replace(OYi,",").replace(LYi,".")}function sht(t,e){for(let n=0;n=e}function roe(t,e,n,r,i,s){let o=[],a=0;for(let c=0;c=r)return o;let l=t[c]+e+n[u];if(!(s&&!l)){if(a+l.length>i)return o;o.push(l),a+=l.length}}return o}function e9i(t,e,n,r){let i=t.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=iht(i[0]),a=iht(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(iht(i[2])),1):1,l=XYi;a0){let y=new Array(A+1).join("0");f<0?g="-"+y+g.slice(1):g=y+g}}if(h+g.length>r)break;s.push(g),h+=g.length}return s}function oht(t,e,n,r,i,s,o){if(i>r)return[t];let a=[""],c=0,u=!1,l=!0;for(;;){let d=rht("{","}",t);if(!d)return roe(a,t,[""],e,n,u);let m=d.pre;if(/\$$/.test(m)){if(a=roe(a,m+"{"+d.body+"}",[""],e,n,u&&!d.post.length),l=!1,!d.post.length)break;t=d.post;continue}let h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),g=h||f,A=d.body.indexOf(",")>=0;if(!g&&!A){if(c=e||S+k.length>n)break e;y.push(k),S+=k.length}}}}if(a=roe(a,m,y,e,n,u&&!d.post.length),!d.post.length)break;t=d.post}return a}var tjn,njn,aht,rjn,ijn,DYi,PYi,MYi,OYi,LYi,FYi,QYi,UYi,GYi,$Yi,WYi,HYi,qYi,jYi,ojn=v(()=>{p();ejn();tjn="\0SLASH"+Math.random()+"\0",njn="\0OPEN"+Math.random()+"\0",aht="\0CLOSE"+Math.random()+"\0",rjn="\0COMMA"+Math.random()+"\0",ijn="\0PERIOD"+Math.random()+"\0",DYi=new RegExp(tjn,"g"),PYi=new RegExp(njn,"g"),MYi=new RegExp(aht,"g"),OYi=new RegExp(rjn,"g"),LYi=new RegExp(ijn,"g"),FYi=/\\\\/g,QYi=/\\{/g,UYi=/\\}/g,GYi=/\\,/g,$Yi=/\\\./g,WYi=1e5,HYi=4e6,qYi=1e3,jYi=1e3});var ioe,ajn=v(()=>{p();ioe=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")}});var t9i,soe,n9i,cjn,ljn,ujn=v(()=>{p();t9i={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},soe=t=>t.replace(/[[\]\\-]/g,"\\$&"),n9i=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),cjn=t=>t.join(""),ljn=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,c=!1,u=!1,l=n,d="";e:for(;sd?r.push(soe(d)+"-"+soe(g)):g===d&&r.push(soe(g)),d="",s++;continue}if(t.startsWith("-]",s+1)){r.push(soe(g+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=g,s+=2;continue}r.push(soe(g)),s++}if(l{p();cP=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!0}={})=>n?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1")});var MA,r9i,cht,djn,i9i,s9i,o9i,pjn,a9i,rBe,c9i,l9i,u9i,d9i,lht,mjn,hjn,p9i,XQ,uht=v(()=>{p();ujn();nBe();r9i=new Set(["!","?","+","*","@"]),cht=t=>r9i.has(t),djn=t=>cht(t.type),i9i=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),s9i=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),o9i=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),pjn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),a9i="(?!(?:^|/)\\.\\.?(?:$|/))",rBe="(?!\\.)",c9i=new Set(["[","."]),l9i=new Set(["..","."]),u9i=new Set("().*{}+?[]^$\\!"),d9i=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),lht="[^/]",mjn=lht+"*?",hjn=lht+"+?",p9i=0,XQ=class{type;#e;#t;#n=!1;#r=[];#i;#s;#o;#a=!1;#c;#l;#d=!1;id=++p9i;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?r:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e==="!"&&!this.#e.#a&&this.#o.push(this),this.#s=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#l=this.#r.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#o.pop();){if(e.type!=="!")continue;let n=e,r=n.#i;for(;r;){for(let i=n.#s+1;!r.type&&itypeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let e=this.#i;for(let n=0;ntypeof h!="string"),u=this.#r.map(h=>{let[f,g,A,y]=typeof h=="string"?MA.#I(h,this.#t,c):h.toRegExpSource(e);return this.#t=this.#t||A,this.#n=this.#n||y,f}).join(""),l="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&l9i.has(this.#r[0]))){let f=c9i,g=n&&f.has(u.charAt(0))||u.startsWith("\\.")&&f.has(u.charAt(2))||u.startsWith("\\.\\.")&&f.has(u.charAt(4)),A=!n&&!e&&f.has(u.charAt(0));l=g?a9i:A?rBe:""}let d="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(d="(?:$|\\/)"),[l+u+d,cP(u),this.#t=!!this.#t,this.#n]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#r=[c],u.type=null,u.#t=void 0,[c,cP(this.toString()),!1,!1]}let o=!r||e||n||!rBe?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#d)a=(this.isStart()&&!n?rBe:"")+hjn;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?rBe:"")+mjn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,cP(s),this.#t=!!this.#t,this.#n]}#E(){if(djn(this)){let e=0,n=!1;do{n=!0;for(let r=0;r{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#n=this.#n||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#I(e,n,r=!1){let i=!1,s="",o=!1,a=!1;for(let c=0;c{p();dht=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!1}={})=>n?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")});var ul,m9i,h9i,f9i,g9i,A9i,y9i,E9i,b9i,_9i,x9i,S9i,C9i,I9i,w9i,T9i,v9i,R9i,k9i,Ajn,yjn,Ejn,fjn,B9i,tf,N9i,D9i,P9i,M9i,O9i,Qb,L9i,bjn,F9i,Q9i,gjn,U9i,oY,mht=v(()=>{p();ojn();ajn();uht();pht();nBe();uht();pht();nBe();ul=(t,e,n={})=>(ioe(e),!n.nocomment&&e.charAt(0)==="#"?!1:new oY(e,n).match(t)),m9i=/^\*+([^+@!?*[(]*)$/,h9i=t=>e=>!e.startsWith(".")&&e.endsWith(t),f9i=t=>e=>e.endsWith(t),g9i=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),A9i=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),y9i=/^\*+\.\*+$/,E9i=t=>!t.startsWith(".")&&t.includes("."),b9i=t=>t!=="."&&t!==".."&&t.includes("."),_9i=/^\.\*+$/,x9i=t=>t!=="."&&t!==".."&&t.startsWith("."),S9i=/^\*+$/,C9i=t=>t.length!==0&&!t.startsWith("."),I9i=t=>t.length!==0&&t!=="."&&t!=="..",w9i=/^\?+([^+@!?*[(]*)?$/,T9i=([t,e=""])=>{let n=Ajn([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},v9i=([t,e=""])=>{let n=yjn([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},R9i=([t,e=""])=>{let n=yjn([t]);return e?r=>n(r)&&r.endsWith(e):n},k9i=([t,e=""])=>{let n=Ajn([t]);return e?r=>n(r)&&r.endsWith(e):n},Ajn=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},yjn=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},Ejn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",fjn={win32:{sep:"\\"},posix:{sep:"/"}},B9i=Ejn==="win32"?fjn.win32.sep:fjn.posix.sep;ul.sep=B9i;tf=Symbol("globstar **");ul.GLOBSTAR=tf;N9i="[^/]",D9i=N9i+"*?",P9i="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",M9i="(?:(?!(?:\\/|^)\\.).)*?",O9i=(t,e={})=>n=>ul(n,t,e);ul.filter=O9i;Qb=(t,e={})=>Object.assign({},t,e),L9i=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return ul;let e=ul;return Object.assign((r,i,s={})=>e(r,i,Qb(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,Qb(t,s))}static defaults(i){return e.defaults(Qb(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,Qb(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,Qb(t,s))}},unescape:(r,i={})=>e.unescape(r,Qb(t,i)),escape:(r,i={})=>e.escape(r,Qb(t,i)),filter:(r,i={})=>e.filter(r,Qb(t,i)),defaults:r=>e.defaults(Qb(t,r)),makeRe:(r,i={})=>e.makeRe(r,Qb(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,Qb(t,i)),match:(r,i,s={})=>e.match(r,i,Qb(t,s)),sep:e.sep,GLOBSTAR:tf})};ul.defaults=L9i;bjn=(t,e={})=>(ioe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:sjn(t,{max:e.braceExpandMax}));ul.braceExpand=bjn;F9i=(t,e={})=>new oY(t,e).makeRe();ul.makeRe=F9i;Q9i=(t,e,n={})=>{let r=new oY(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};ul.match=Q9i;gjn=/[?*]|[+@!]\(.*?\)|\[|\]/,U9i=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),oY=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,n={}){ioe(e),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=e,this.platform=n.platform||Ejn,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!gjn.test(s[2]))&&!gjn.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(l=>this.parse(l))];if(u)return[s[0],...s.slice(1).map(l=>this.parse(l))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;ii&&r.splice(i+1,o-i);let a=r[i+1],c=r[i+2],u=r[i+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}if(!this.preserveMultipleSlashes){for(let o=1;on.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i=2&&(e=this.levelTwoFileOptimize(e)),n.includes(tf)?this.#e(e,n,r,i,s):this.#n(e,n,r,i,s)}#e(e,n,r,i,s){let o=n.indexOf(tf,s),a=n.lastIndexOf(tf),[c,u,l]=r?[n.slice(s,o),n.slice(o+1),[]]:[n.slice(s,o),n.slice(o+1,a),n.slice(a+1)];if(c.length){let E=e.slice(i,i+c.length);if(!this.#n(E,c,r,0,0))return!1;i+=c.length,s+=c.length}let d=0;if(l.length){if(l.length+i>e.length)return!1;let E=e.length-l.length;if(this.#n(e,l,r,E,0))d=l.length;else{if(e[e.length-1]!==""||i+l.length===e.length||(E--,!this.#n(e,l,r,E,0)))return!1;d=l.length+1}}if(!u.length){let E=!!d;for(let _=i;_{let u=c.map(d=>{if(d instanceof RegExp)for(let m of d.flags.split(""))i.add(m);return typeof d=="string"?U9i(d):d===tf?tf:d._src});u.forEach((d,m)=>{let h=u[m+1],f=u[m-1];d!==tf||f===tf||(f===void 0?h!==void 0&&h!==tf?u[m+1]="(?:\\/|"+r+"\\/)?"+h:u[m]=r:h===void 0?u[m-1]=f+"(?:\\/|\\/"+r+")?":h!==tf&&(u[m-1]=f+"(?:\\/|\\/"+r+"\\/)"+h,u[m+1]=tf))});let l=u.filter(d=>d!==tf);if(this.partial&&l.length>=1){let d=[];for(let m=1;m<=l.length;m++)d.push(l.slice(0,m).join("/"));return"(?:"+d.join("|")+")"}return l.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a of s){let c=i;if(r.matchBase&&a.length===1&&(c=[o]),this.matchOne(c,a,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return ul.defaults(e).Minimatch}};ul.AST=XQ;ul.Minimatch=oY;ul.escape=dht;ul.unescape=cP});function _jn(t){return t.endsWith("-latest")?!0:!/-\d{8}$/.test(t)}function aoe(t,e){let n=t.trim();if(!n)return;let r=n.toLowerCase(),i=e.filter(a=>`${a.provider}/${a.id}`.toLowerCase()===r);if(i.length===1)return i[0];if(i.length>1)return;let s=n.indexOf("/");if(s!==-1){let a=n.substring(0,s).trim(),c=n.substring(s+1).trim();if(a&&c){let u=e.filter(l=>l.provider.toLowerCase()===a.toLowerCase()&&l.id.toLowerCase()===c.toLowerCase());if(u.length===1)return u[0];if(u.length>1)return}}let o=e.filter(a=>a.id.toLowerCase()===r);return o.length===1?o[0]:void 0}function G9i(t,e){let n=aoe(t,e);if(n)return n;let r=e.filter(o=>o.id.toLowerCase().includes(t.toLowerCase())||o.name?.toLowerCase().includes(t.toLowerCase()));if(r.length===0)return;let i=r.filter(o=>_jn(o.id)),s=r.filter(o=>!_jn(o.id));return i.length>0?(i.sort((o,a)=>a.id.localeCompare(o.id)),i[0]):(s.sort((o,a)=>a.id.localeCompare(o.id)),s[0])}function $9i(t,e,n){let r=n.filter(o=>o.provider===t);if(r.length===0)return;let i=ZQ[t];return{...i?r.find(o=>o.id===i)??r[0]:r[0],id:e,name:e}}function ooe(t,e,n){let r=G9i(t,e);if(r)return{model:r,thinkingLevel:void 0,warning:void 0};let i=t.lastIndexOf(":");if(i===-1)return{model:void 0,thinkingLevel:void 0,warning:void 0};let s=t.substring(0,i),o=t.substring(i+1);if(hre(o)){let a=ooe(s,e,n);return a.model?{model:a.model,thinkingLevel:a.warning?void 0:o,warning:a.warning}:a}else{if(!(n?.allowInvalidThinkingLevelFallback??!0))return{model:void 0,thinkingLevel:void 0,warning:void 0};let c=ooe(s,e,n);return c.model?{model:c.model,thinkingLevel:void 0,warning:`Invalid thinking level "${o}" in pattern "${t}". Using default instead.`}:c}}function iBe(t,e){let n=[...e],r=[],i=[];for(let s of t){if(s.includes("*")||s.includes("?")||s.includes("[")){let u=s.lastIndexOf(":"),l=s,d;if(u!==-1){let f=s.substring(u+1);hre(f)&&(d=f,l=s.substring(0,u))}let m=aoe(l,n);if(m){r.find(f=>Zd(f.model,m))||r.push({model:m,thinkingLevel:d});continue}let h=n.filter(f=>{let g=`${f.provider}/${f.id}`;return ul(g,l,{nocase:!0})||ul(f.id,l,{nocase:!0})});if(h.length===0){i.push({type:"warning",code:"no-match",message:`No models match pattern "${s}"`,pattern:s});continue}for(let f of h)r.find(g=>Zd(g.model,f))||r.push({model:f,thinkingLevel:d});continue}let{model:o,thinkingLevel:a,warning:c}=ooe(s,n);if(c&&i.push({type:"warning",code:"invalid-thinking-level",message:c,pattern:s}),!o){i.push({type:"warning",code:"no-match",message:`No models match pattern "${s}"`,pattern:s});continue}r.find(u=>Zd(u.model,o))||r.push({model:o,thinkingLevel:a})}return{scopedModels:r,diagnostics:i}}async function hht(t,e,n){return iBe(t,await e.getAvailable(void 0,n))}async function xjn(t,e,n){let{scopedModels:r,diagnostics:i}=await hht(t,e,n);for(let s of i)console.warn(tn.yellow(`Warning: ${s.message}`));return r}function Rw(t){let{cliProvider:e,cliModel:n,cliThinking:r,modelRuntime:i}=t;if(!n)return{model:void 0,warning:void 0,error:void 0};let s=[...i.getModels()];if(s.length===0)return{model:void 0,warning:void 0,error:"No models available. Check your installation or add models to models.json."};let o=new Map;for(let g of s)o.set(g.provider.toLowerCase(),g.provider);let a=e?o.get(e.toLowerCase()):void 0;if(e&&!a)return{model:void 0,warning:void 0,error:`Unknown provider "${e}". Use --list-models to see available providers/models.`};let c=n,u=!1;if(!a){let g=n.indexOf("/");if(g!==-1){let A=n.substring(0,g),y=o.get(A.toLowerCase());y&&(a=y,c=n.substring(g+1),u=!0)}}if(!a){let g=n.toLowerCase(),A=s.filter(y=>y.id.toLowerCase()===g||`${y.provider}/${y.id}`.toLowerCase()===g);if(A.length===1)return{model:A[0],warning:void 0,thinkingLevel:void 0,error:void 0};if(A.length>1){let y=A.filter(S=>i.hasConfiguredAuth(S.provider));if(y.length===1)return{model:y[0],warning:void 0,thinkingLevel:void 0,error:void 0};let E=A.map(S=>`${S.provider}/${S.id}`).sort((S,C)=>S.localeCompare(C)).join(", "),_=y.length===0?"No matching provider is authenticated.":"More than one matching provider is authenticated.";return{model:void 0,warning:void 0,thinkingLevel:void 0,error:`Model "${n}" is ambiguous across providers: ${E}. ${_} Use --provider or provider/model.`}}}if(e&&a){let g=`${a}/`;n.toLowerCase().startsWith(g.toLowerCase())&&(c=n.substring(g.length))}let l=a?s.filter(g=>g.provider===a):s,{model:d,thinkingLevel:m,warning:h}=ooe(c,l,{allowInvalidThinkingLevelFallback:!1});if(d){if(u){let g=s.filter(A=>A.id.toLowerCase()===n.toLowerCase()&&!Zd(A,d));if(g.length>0&&!i.hasConfiguredAuth(d.provider)){let A=g.filter(y=>i.hasConfiguredAuth(y.provider));if(A.length===1)return{model:A[0],thinkingLevel:void 0,warning:void 0,error:void 0}}}return{model:d,thinkingLevel:m,warning:h,error:void 0}}if(u){let g=n.toLowerCase(),A=s.find(E=>E.id.toLowerCase()===g||`${E.provider}/${E.id}`.toLowerCase()===g);if(A)return{model:A,warning:void 0,thinkingLevel:void 0,error:void 0};let y=ooe(n,s,{allowInvalidThinkingLevelFallback:!1});if(y.model)return{model:y.model,thinkingLevel:y.thinkingLevel,warning:y.warning,error:void 0}}if(a){let g=c,A;if(!r){let E=c.lastIndexOf(":");if(E!==-1){let _=c.substring(E+1);hre(_)&&(g=c.substring(0,E),A=_)}}let y=$9i(a,g,s);if(y){let E=r??A,_=E&&E!=="off"?{...y,reasoning:!0}:y,S=h?`${h} Model "${g}" not found for provider "${a}". Using custom model id.`:`Model "${g}" not found for provider "${a}". Using custom model id.`;return{model:_,thinkingLevel:A,warning:S,error:void 0}}}let f=a?`${a}/${c}`:n;return{model:void 0,thinkingLevel:void 0,warning:h,error:`Model "${f}" not found. Use --list-models to see available models.`}}async function Sjn(t){let{cliProvider:e,cliModel:n,scopedModels:r,isContinuing:i,defaultProvider:s,defaultModelId:o,defaultThinkingLevel:a,modelThinkingLevels:c,modelRuntime:u}=t,l,d=rh;if(e&&n){let h=Rw({cliProvider:e,cliModel:n,modelRuntime:u});if(h.error&&(console.error(tn.red(h.error)),process.exit(1)),h.model)return{model:h.model,thinkingLevel:rh,fallbackMessage:void 0}}if(r.length>0&&!i){let h=r[0],f=c?.[`${h.model.provider}/${h.model.id}`];return{model:h.model,thinkingLevel:h.thinkingLevel??f??a??rh,fallbackMessage:void 0}}if(s&&o){let h=u.getModel(s,o);if(h&&u.hasConfiguredAuth(h.provider)){l=h;let f=c?.[`${s}/${o}`];return f?d=f:a&&(d=a),{model:l,thinkingLevel:d,fallbackMessage:void 0}}}let m=[...u.getAvailableSnapshot()];if(m.length>0){for(let h of Object.keys(ZQ)){let f=ZQ[h],g=m.find(A=>A.provider===h&&A.id===f);if(g)return{model:g,thinkingLevel:rh,fallbackMessage:void 0}}return{model:m[0],thinkingLevel:rh,fallbackMessage:void 0}}return{model:void 0,thinkingLevel:rh,fallbackMessage:void 0}}var ZQ,eU=v(()=>{p();qo();gb();mht();Fwe();$ie();ZQ={"amazon-bedrock":"us.anthropic.claude-opus-4-6-v1","ant-ling":"Ring-2.6-1T",anthropic:"claude-opus-4-8",openai:"gpt-5.5","azure-openai-responses":"gpt-5.4","openai-codex":"gpt-5.5",radius:"balanced",nvidia:"nvidia/nemotron-3-super-120b-a12b",deepseek:"deepseek-v4-pro",google:"gemini-3.1-pro-preview","google-vertex":"gemini-3.1-pro-preview","github-copilot":"gpt-5.4",openrouter:"moonshotai/kimi-k2.6","vercel-ai-gateway":"zai/glm-5.1",xai:"grok-4.7",groq:"openai/gpt-oss-120b",cerebras:"gpt-oss-120b",zai:"glm-5.3","zai-coding-cn":"glm-5.3",mistral:"devstral-medium-latest",minimax:"MiniMax-M2.7","minimax-cn":"MiniMax-M2.7",moonshotai:"kimi-k2.6","moonshotai-cn":"kimi-k2.6",huggingface:"moonshotai/Kimi-K2.6",fireworks:"accounts/fireworks/models/kimi-k2p6",together:"moonshotai/Kimi-K2.6",baseten:"zai-org/GLM-5.2",opencode:"kimi-k2.6","opencode-go":"kimi-k2.6","kimi-coding":"kimi-for-coding",meta:"muse-spark-1.3","cloudflare-workers-ai":"@cf/moonshotai/kimi-k2.6","cloudflare-ai-gateway":"workers-ai/@cf/moonshotai/kimi-k2.6","qwen-token-plan":"qwen3.7-max","qwen-token-plan-cn":"qwen3.7-max","qwen-token-plan-individual":"qwen3.8-max",xiaomi:"mimo-v2.5-pro","xiaomi-token-plan-cn":"mimo-v2.5-pro","xiaomi-token-plan-ams":"mimo-v2.5-pro","xiaomi-token-plan-sgp":"mimo-v2.5-pro"}});function Cjn(t){return t.replace(/"(?:\\.|[^"\\])*"|\/\/[^\n]*/g,e=>e[0]==='"'?e:"").replace(/"(?:\\.|[^"\\])*"|,(\s*[}\]])/g,(e,n)=>n??(e[0]==='"'?e:""))}var Ijn=v(()=>{p()});function t6i(t){if(t.keyword==="required"){let r=t.params.requiredProperties?.[0];if(r){let i=t.instancePath.replace(/^\//,"").replace(/\//g,".");return i?`${i}.${r}`:r}}return t.instancePath.replace(/^\//,"").replace(/\//g,".")||"root"}function Ojn(t){if(typeof t!="object"||t===null||Object.isFrozen(t))return t;for(let e of Object.values(t))Ojn(e);return Object.freeze(t)}var Rjn,wjn,W9i,H9i,tU,kjn,q9i,j9i,Tjn,V9i,Y9i,Bjn,Njn,Djn,Pjn,z9i,Mjn,K9i,fht,J9i,X9i,Z9i,e6i,vjn,coe,Ljn=v(()=>{p();Rjn=require("node:fs/promises");Vm();nne();Ijn();fc();nm();wjn=Ne.Object({p50:Ne.Optional(Ne.Number()),p75:Ne.Optional(Ne.Number()),p90:Ne.Optional(Ne.Number()),p99:Ne.Optional(Ne.Number())}),W9i=Ne.Object({allow_fallbacks:Ne.Optional(Ne.Boolean()),require_parameters:Ne.Optional(Ne.Boolean()),data_collection:Ne.Optional(Ne.Union([Ne.Literal("deny"),Ne.Literal("allow")])),zdr:Ne.Optional(Ne.Boolean()),enforce_distillable_text:Ne.Optional(Ne.Boolean()),order:Ne.Optional(Ne.Array(Ne.String())),only:Ne.Optional(Ne.Array(Ne.String())),ignore:Ne.Optional(Ne.Array(Ne.String())),quantizations:Ne.Optional(Ne.Array(Ne.String())),sort:Ne.Optional(Ne.Union([Ne.String(),Ne.Object({by:Ne.Optional(Ne.String()),partition:Ne.Optional(Ne.Union([Ne.String(),Ne.Null()]))})])),max_price:Ne.Optional(Ne.Object({prompt:Ne.Optional(Ne.Union([Ne.Number(),Ne.String()])),completion:Ne.Optional(Ne.Union([Ne.Number(),Ne.String()])),image:Ne.Optional(Ne.Union([Ne.Number(),Ne.String()])),audio:Ne.Optional(Ne.Union([Ne.Number(),Ne.String()])),request:Ne.Optional(Ne.Union([Ne.Number(),Ne.String()]))})),preferred_min_throughput:Ne.Optional(Ne.Union([Ne.Number(),wjn])),preferred_max_latency:Ne.Optional(Ne.Union([Ne.Number(),wjn]))}),H9i=Ne.Object({only:Ne.Optional(Ne.Array(Ne.String())),order:Ne.Optional(Ne.Array(Ne.String()))}),tU=Ne.Union([Ne.String(),Ne.Null()]),kjn=Ne.Object({off:Ne.Optional(tU),minimal:Ne.Optional(tU),low:Ne.Optional(tU),medium:Ne.Optional(tU),high:Ne.Optional(tU),xhigh:Ne.Optional(tU),max:Ne.Optional(tU)}),q9i=Ne.Union([Ne.String(),Ne.Number(),Ne.Boolean(),Ne.Null()]),j9i=Ne.Object({$var:Ne.Union([Ne.Literal("thinking.enabled"),Ne.Literal("thinking.effort")]),omitWhenOff:Ne.Optional(Ne.Boolean())}),Tjn=Ne.Union([q9i,j9i]),V9i=Ne.Object({supportsStore:Ne.Optional(Ne.Boolean()),supportsDeveloperRole:Ne.Optional(Ne.Boolean()),supportsReasoningEffort:Ne.Optional(Ne.Boolean()),supportsUsageInStreaming:Ne.Optional(Ne.Boolean()),supportsFinishReason:Ne.Optional(Ne.Boolean()),maxTokensField:Ne.Optional(Ne.Union([Ne.Literal("max_completion_tokens"),Ne.Literal("max_tokens")])),requiresToolResultName:Ne.Optional(Ne.Boolean()),requiresAssistantAfterToolResult:Ne.Optional(Ne.Boolean()),requiresThinkingAsText:Ne.Optional(Ne.Boolean()),requiresReasoningContentOnAssistantMessages:Ne.Optional(Ne.Boolean()),thinkingFormat:Ne.Optional(Ne.Union([Ne.Literal("openai"),Ne.Literal("openrouter"),Ne.Literal("together"),Ne.Literal("baseten"),Ne.Literal("deepseek"),Ne.Literal("zai"),Ne.Literal("qwen"),Ne.Literal("chat-template"),Ne.Literal("qwen-chat-template"),Ne.Literal("string-thinking"),Ne.Literal("ant-ling")])),chatTemplateKwargs:Ne.Optional(Ne.Record(Ne.String(),Tjn)),chatTemplateArgs:Ne.Optional(Ne.Record(Ne.String(),Tjn)),cacheControlFormat:Ne.Optional(Ne.Literal("anthropic")),openRouterRouting:Ne.Optional(W9i),vercelGatewayRouting:Ne.Optional(H9i),supportsOpenAIGrammarTools:Ne.Optional(Ne.Boolean()),supportsStrictMode:Ne.Optional(Ne.Boolean()),sendSessionAffinityHeaders:Ne.Optional(Ne.Boolean()),sessionAffinityFormat:Ne.Optional(Ne.Union([Ne.Literal("openai"),Ne.Literal("openai-nosession"),Ne.Literal("openrouter")])),supportsLongCacheRetention:Ne.Optional(Ne.Boolean()),vllmPriority:Ne.Optional(Ne.Number())}),Y9i=Ne.Object({supportsDeveloperRole:Ne.Optional(Ne.Boolean()),sessionAffinityFormat:Ne.Optional(Ne.Union([Ne.Literal("openai"),Ne.Literal("openai-nosession"),Ne.Literal("openrouter")])),supportsLongCacheRetention:Ne.Optional(Ne.Boolean()),supportsStrictMode:Ne.Optional(Ne.Boolean()),supportsOpenAIGrammarTools:Ne.Optional(Ne.Boolean()),supportsMaxOutputTokens:Ne.Optional(Ne.Boolean())}),Bjn={input:Ne.Number(),output:Ne.Number(),cacheRead:Ne.Number(),cacheWrite:Ne.Number()},Njn=Ne.Object({inputTokensAbove:Ne.Number(),...Bjn}),Djn=Ne.Object({...Bjn,tiers:Ne.Optional(Ne.Array(Njn))}),Pjn=Ne.Object({short:Ne.Optional(Ne.Number({exclusiveMinimum:0})),long:Ne.Optional(Ne.Number({exclusiveMinimum:0}))}),z9i=Ne.Object({maxWidth:Ne.Optional(Ne.Integer({minimum:1})),maxHeight:Ne.Optional(Ne.Integer({minimum:1})),maxBytes:Ne.Optional(Ne.Integer({minimum:1})),jpegQuality:Ne.Optional(Ne.Integer({minimum:1,maximum:100}))}),Mjn=Ne.Object({maxRequestBytes:Ne.Optional(Ne.Integer({minimum:1})),images:Ne.Optional(Ne.Object({resize:Ne.Optional(z9i),maxPerMessage:Ne.Optional(Ne.Integer({minimum:1})),maxPerRequest:Ne.Optional(Ne.Integer({minimum:1}))}))}),K9i=Ne.Object({supportsEagerToolInputStreaming:Ne.Optional(Ne.Boolean()),supportsLongCacheRetention:Ne.Optional(Ne.Boolean()),sendSessionAffinityHeaders:Ne.Optional(Ne.Boolean()),supportsCacheControlOnTools:Ne.Optional(Ne.Boolean()),supportsTemperature:Ne.Optional(Ne.Boolean()),forceAdaptiveThinking:Ne.Optional(Ne.Boolean()),allowEmptySignature:Ne.Optional(Ne.Boolean()),supportsStrictTools:Ne.Optional(Ne.Boolean()),supportsMidConvoEffort:Ne.Optional(Ne.Boolean()),allowedFallbackModels:Ne.Optional(Ne.Array(Ne.Object({provider:Ne.String({minLength:1}),model:Ne.String({minLength:1}),cost:Djn}),{maxItems:3}))}),fht=Ne.Union([V9i,Y9i,K9i]),J9i=Ne.Object({id:Ne.String({minLength:1}),name:Ne.Optional(Ne.String({minLength:1})),api:Ne.Optional(Ne.String({minLength:1})),baseUrl:Ne.Optional(Ne.String({minLength:1})),reasoning:Ne.Optional(Ne.Boolean()),thinkingLevelMap:Ne.Optional(kjn),input:Ne.Optional(Ne.Array(Ne.Union([Ne.Literal("text"),Ne.Literal("image")]))),inputLimits:Ne.Optional(Mjn),cost:Ne.Optional(Djn),promptCache:Ne.Optional(Pjn),contextWindow:Ne.Optional(Ne.Number()),maxTokens:Ne.Optional(Ne.Number()),samplingParams:Ne.Optional(Ne.Record(Ne.String(),Ne.Unknown())),headers:Ne.Optional(Ne.Record(Ne.String(),Ne.String())),compat:Ne.Optional(fht)}),X9i=Ne.Object({name:Ne.Optional(Ne.String({minLength:1})),reasoning:Ne.Optional(Ne.Boolean()),thinkingLevelMap:Ne.Optional(kjn),input:Ne.Optional(Ne.Array(Ne.Union([Ne.Literal("text"),Ne.Literal("image")]))),inputLimits:Ne.Optional(Mjn),cost:Ne.Optional(Ne.Object({input:Ne.Optional(Ne.Number()),output:Ne.Optional(Ne.Number()),cacheRead:Ne.Optional(Ne.Number()),cacheWrite:Ne.Optional(Ne.Number()),tiers:Ne.Optional(Ne.Array(Njn))})),promptCache:Ne.Optional(Pjn),contextWindow:Ne.Optional(Ne.Number()),maxTokens:Ne.Optional(Ne.Number()),samplingParams:Ne.Optional(Ne.Record(Ne.String(),Ne.Unknown())),headers:Ne.Optional(Ne.Record(Ne.String(),Ne.String())),compat:Ne.Optional(fht)}),Z9i=Ne.Object({name:Ne.Optional(Ne.String({minLength:1})),baseUrl:Ne.Optional(Ne.String({minLength:1})),apiKey:Ne.Optional(Ne.String({minLength:1})),api:Ne.Optional(Ne.String({minLength:1})),oauth:Ne.Optional(Ne.Literal("radius")),headers:Ne.Optional(Ne.Record(Ne.String(),Ne.String())),compat:Ne.Optional(fht),authHeader:Ne.Optional(Ne.Boolean()),models:Ne.Optional(Ne.Array(J9i)),modelOverrides:Ne.Optional(Ne.Record(Ne.String(),X9i))}),e6i=Ne.Object({providers:Ne.Record(Ne.String(),Z9i)}),vjn=oR(e6i);coe=class t{providers;error;constructor(e,n){this.providers=e,this.error=n}static async load(e){if(!e)return new t(new Map);let n=Vo(e),r;try{r=await(0,Rjn.readFile)(n,"utf-8")}catch(a){return a.code==="ENOENT"?new t(new Map):new t(new Map,`Failed to load models.json: ${a instanceof Error?a.message:a} -File: ${n}`)}let s;try{s=JSON.parse(xSn(Mi(r)))}catch(a){return new t(new Map,`Failed to parse models.json: ${a instanceof Error?a.message:a} +File: ${n}`)}let i;try{i=JSON.parse(Cjn(zs(r)))}catch(a){return new t(new Map,`Failed to parse models.json: ${a instanceof Error?a.message:a} -File: ${n}`)}if(!vSn.Check(s)){let a=vSn.Errors(s).map(c=>` - ${Pbs(c)}: ${c.message}`).join(` +File: ${n}`)}if(!vjn.Check(i)){let a=vjn.Errors(i).map(c=>` - ${t6i(c)}: ${c.message}`).join(` `)||"Unknown schema error";return new t(new Map,`Invalid models.json schema: ${a} -File: ${n}`)}let i=s,o=new Map;for(let[a,c]of Object.entries(i.providers))o.set(a,BSn(structuredClone(c)));return new t(o)}getProvider(e){return this.providers.get(e)}getProviderIds(){return[...this.providers.keys()]}getError(){return this.error}};p();var PSn=require("node:path");var aIe,h4=class{entries=new Map;async read(e,n){n?.signal?.throwIfAborted();let r=this.entries.get(e);return r?structuredClone(r):void 0}async write(e,n,r){r?.signal?.throwIfAborted(),this.entries.set(e,structuredClone(n))}async delete(e,n){n?.signal?.throwIfAborted(),this.entries.delete(e)}},cIe=class{storage;path;readState;constructor(e=(0,PSn.join)(ls(),"models-store.json")){this.path=Mo(e),this.storage=new xee(this.path),this.readState=aIe?.path===this.path?aIe.readState:{data:{}},aIe||(aIe={path:this.path,readState:this.readState})}parse(e){return e?JSON.parse(Mi(e)):{}}updateReadState(e,n,r){e.data=n,e.revision=r}reloadFromStorage(e,n){return this.storage.withLockAsync(async r=>{let s=this.parse(r);return this.updateReadState(e,s,jw(this.path)),{result:s}},n)}async readLatest(e,n){n?.signal?.throwIfAborted();let r=jw(this.path);if(r!==void 0&&r===e.revision)return e.data;if(!e.reload){let i=new AbortController,o={controller:i,promise:this.reloadFromStorage(e,{signal:i.signal}),readers:0};e.reload=o,o.promise.then(()=>{e.reload===o&&(e.reload=void 0)},()=>{e.reload===o&&(e.reload=void 0)})}let s=e.reload;s.readers++;try{return await lI(s.promise,n?.signal)}finally{s.readers--,s.readers===0&&e.reload===s&&(e.reload=void 0,s.controller.abort())}}async read(e,n){let r=(await this.readLatest(this.readState,n))[e];return n?.signal?.throwIfAborted(),r?structuredClone(r):void 0}async write(e,n,r){let s;await this.storage.withLockAsync(async i=>{let o=this.parse(i);return o[e]=structuredClone(n),s=o,{result:void 0,next:JSON.stringify(o,null,2)}},r),s&&this.updateReadState(this.readState,s)}async delete(e,n){let r;await this.storage.withLockAsync(async s=>{let i=this.parse(s);return delete i[e],r=i,{result:void 0,next:JSON.stringify(i,null,2)}},n),r&&this.updateReadState(this.readState,r)}};p();p();function pD(t){let e=process.versions.bun?`bun/${process.versions.bun}`:`node/${process.version}`;return`pi/${t} (${process.platform}; ${e}; ${process.arch})`}var Obs="https://pi.dev",Mbs=4e3,Lbs=14400*1e3;function Fbs(t,e){let n=[...t];for(let r of e){let s=n.findIndex(i=>i.id===r.id);s>=0?n[s]=r:n.push(r)}return n}function Qbs(t,e){let n=Array.isArray(e)?e:typeof e=="object"&&e!==null&&"models"in e&&Array.isArray(e.models)?e.models:typeof e=="object"&&e!==null?Object.values(e):void 0;if(!n)throw new Error(`Invalid model catalog for provider "${t}"`);return n.filter(r=>typeof r=="object"&&r!==null&&"id"in r).map(r=>({...r,provider:t}))}function OSn(t,e){return t?e!==void 0&&(t.lastModified===void 0||t.lastModified<=e)?[]:t.models:[]}function MSn(t,e=Obs,n){let r=[];return{...t,getModels:()=>Fbs(t.getModels(),r),refreshModels:async s=>{let i=s.stored,o=OSn(i,n).filter(g=>g.provider===t.id);if(!await s.publish({update:()=>{r=o}})||!s.allowNetwork||s.signal.aborted||!s.force&&i?.checkedAt!==void 0&&i.lastModified!==void 0&&Date.now()-i.checkedAt{r=f}})}}}p();var lIe=class{store;overrides=new Map;constructor(e){this.store=e}setRuntimeApiKey(e,n){this.overrides.set(e,n)}removeRuntimeApiKey(e){this.overrides.delete(e)}hasRuntimeApiKey(e){return this.overrides.has(e)}async read(e,n){n?.signal?.throwIfAborted();let r=this.overrides.get(e);return r?{type:"api_key",key:r}:this.store.read(e,n)}async list(e){let n=new Map((await this.store.list(e)).map(r=>[r.providerId,r]));e?.signal?.throwIfAborted();for(let r of this.overrides.keys())n.set(r,{providerId:r,type:"api_key"});return[...n.values()]}modify(e,n,r){return this.store.modify(e,n,r)}async delete(e,n){n?.signal?.throwIfAborted(),await this.store.delete(e,n),this.overrides.delete(e)}};var I0=class extends Error{providerId;operation;credential;constructor(e,n,r,s){super(`Credential ${n} committed for ${e}, but local synchronization failed`,s),this.name="CredentialSynchronizationError",this.providerId=e,this.operation=n,this.credential=r}};function LSn(t,e){if(!t&&!e)return;let n={...t};for(let[r,s]of Object.entries(e??{})){let i=r.toLowerCase();for(let o of Object.keys(n))o.toLowerCase()===i&&delete n[o];n[r]=s}return n}var Hh=class t{models;credentials;defaultBuiltins;builtins=new Map;nativeExtensionProviders=new Map;extensionProviders=new Map;compositionErrors=new Map;modelsPath;modelNetworkEnabled;config;snapshot={all:[],available:[],configuredProviders:new Set,storedProviders:new Set,auth:new Map};availabilityRefreshSeq=0;availabilityErrorSeq=0;providerAvailabilitySeq=new Map;availabilityError;credentialOperations=new Map;constructor(e,n,r,s,i,o){this.credentials=e,this.config=n,this.modelsPath=r,this.modelNetworkEnabled=o,this.defaultBuiltins=new Map(i.map(a=>[a.id,a]));for(let[a,c]of this.defaultBuiltins)this.builtins.set(a,c);this.models=H8({credentials:e,modelsStore:s}),this.rebuildProviders()}static async create(e={}){let n=new lIe(e.credentials??u4.create(e.authPath)),r=e.modelsPath===null?void 0:e.modelsPath??(0,Dee.join)(ls(),"models.json"),s=await Nee.load(r),i=e.modelsStore??(r?new cIe(e.modelsStorePath??(0,Dee.join)((0,Dee.dirname)(r),"models-store.json")):new h4),o=Y6e(),a=EEe().map(m=>m.id==="radius"?m:MSn(m,e.catalogBaseUrl,o)),c=new t(n,s,r,i,a,process.env.PI_OFFLINE===void 0);c.configureRadiusProviders(),c.rebuildProviders();let u=c.modelNetworkEnabled&&e.allowModelNetwork===!0,l=u&&e.modelRefreshTimeoutMs!==void 0?new AbortController:void 0,d=l?setTimeout(()=>l.abort(),e.modelRefreshTimeoutMs):void 0,h=l?e.signal?AbortSignal.any([e.signal,l.signal]):l.signal:e.signal;try{e.refreshOnCreate!==!1&&await c.refresh({allowNetwork:u,signal:h})}finally{d&&clearTimeout(d)}return c}configureRadiusProviders(){this.builtins.clear();for(let[e,n]of this.defaultBuiltins)this.builtins.set(e,n);for(let e of this.config.getProviderIds()){let n=this.config.getProvider(e);n?.oauth!=="radius"||!n.baseUrl||this.builtins.set(e,X7({id:e,name:n.name??e,gateway:n.baseUrl.replace(/\/v1\/?$/u,"")}))}}providerIds(){return new Set([...this.builtins.keys(),...this.nativeExtensionProviders.keys(),...this.config.getProviderIds(),...this.extensionProviders.keys()])}recomposeProvider(e){let n=this.nativeExtensionProviders.get(e)??this.builtins.get(e),r=this.extensionProviders.get(e);if(!n&&!this.config.getProvider(e)&&!r){this.models.deleteProvider(e),this.compositionErrors.delete(e);return}if(n&&!this.config.getProvider(e)&&!r){this.models.setProvider(n),this.compositionErrors.delete(e);return}try{this.models.setProvider(c_n(e,n,this.config,r)),this.compositionErrors.delete(e)}catch(s){this.compositionErrors.set(e,s instanceof Error?s.message:String(s)),n?this.models.setProvider(n):this.models.deleteProvider(e)}}rebuildProviders(){this.models.clearProviders(),this.compositionErrors.clear();for(let e of this.providerIds())this.recomposeProvider(e);this.updateModelSnapshot()}updateModelSnapshot(){let e=[...this.models.getModels()];this.snapshot={...this.snapshot,all:e,available:e.filter(n=>this.snapshot.configuredProviders.has(n.provider))}}async runAvailabilityRefresh(e,n,r){let s=this.models.getProviders(),[i,o,a]=await Promise.all([this.models.getAvailable(void 0,{signal:r}),Promise.all(s.map(async l=>[l.id,await this.models.checkAuth(l.id,{signal:r})])),this.credentials.list({signal:r})]);if(e!==this.availabilityRefreshSeq)return;let c=new Map(o),u=new Set(o.filter(l=>l[1]!==void 0).map(([l])=>l));this.snapshot={all:[...this.models.getModels()],available:[...i],configuredProviders:u,storedProviders:new Set(a.map(l=>l.providerId)),auth:c},n===this.availabilityErrorSeq&&(this.availabilityError=void 0)}queueAvailabilityRefresh(e){let n=++this.availabilityRefreshSeq;for(let[i,o]of this.providerAvailabilitySeq)this.providerAvailabilitySeq.set(i,o+1);let r=++this.availabilityErrorSeq,s=wL(e);return this.runAvailabilityRefresh(n,r,s).catch(i=>{throw r===this.availabilityErrorSeq&&!s.aborted&&(this.availabilityError=i instanceof Error?i.message:String(i)),i})}async refreshProviderAvailability(e,n){++this.availabilityRefreshSeq;let r=(this.providerAvailabilitySeq.get(e)??0)+1;this.providerAvailabilitySeq.set(e,r);let s=++this.availabilityErrorSeq;try{let[i,o,a]=await Promise.all([this.models.getAvailable(e,{signal:n}),this.models.checkAuth(e,{signal:n}),this.credentials.read(e,{signal:n})]);if(n.throwIfAborted(),this.providerAvailabilitySeq.get(e)!==r)return;let c=new Set(this.snapshot.configuredProviders),u=new Set(this.snapshot.storedProviders),l=new Map(this.snapshot.auth);o?(c.add(e),l.set(e,o)):(c.delete(e),l.delete(e)),a?u.add(e):u.delete(e);let d=[...this.models.getModels()],h=new Map([...this.snapshot.available.filter(m=>m.provider!==e),...i].map(m=>[`${m.provider}\0${m.id}`,m]));this.snapshot={all:d,available:d.flatMap(m=>h.get(`${m.provider}\0${m.id}`)??[]),configuredProviders:c,storedProviders:u,auth:l},s===this.availabilityErrorSeq&&(this.availabilityError=void 0)}catch(i){throw this.providerAvailabilitySeq.get(e)===r&&s===this.availabilityErrorSeq&&!n.aborted&&(this.availabilityError=i instanceof Error?i.message:String(i)),i}}getProviders(){return this.models.getProviders()}getProvider(e){return this.models.getProvider(e)}getModels(e){return this.models.getModels(e)}getModel(e,n){return this.models.getModel(e,n)}async checkAuth(e,n){return this.models.checkAuth(e,n)}async getAvailable(e,n){if(e){let r=++this.availabilityErrorSeq;try{let s=await this.models.getAvailable(e,n);return r===this.availabilityErrorSeq&&(this.availabilityError=void 0),s}catch(s){throw r===this.availabilityErrorSeq&&!n?.signal?.aborted&&(this.availabilityError=s instanceof Error?s.message:String(s)),s}}return await this.queueAvailabilityRefresh(n?.signal),this.snapshot.available}getAvailableSnapshot(){return this.snapshot.available}getError(){let e=[],n=this.config.getError();n&&e.push(n);for(let[r,s]of this.compositionErrors)e.push(`Provider "${r}": ${s}`);return this.availabilityError&&e.push(`Availability refresh: ${this.availabilityError}`),e.length>0?e.join(` +File: ${n}`)}let s=i,o=new Map;for(let[a,c]of Object.entries(s.providers))o.set(a,Ojn(structuredClone(c)));return new t(o)}getProvider(e){return this.providers.get(e)}getProviderIds(){return[...this.providers.keys()]}getError(){return this.error}}});var Fjn,sBe,aY,oBe,ght=v(()=>{p();Fjn=require("node:path");Qs();eoe();fc();nm();noe();aY=class{entries=new Map;async read(e,n){n?.signal?.throwIfAborted();let r=this.entries.get(e);return r?structuredClone(r):void 0}async write(e,n,r){r?.signal?.throwIfAborted(),this.entries.set(e,structuredClone(n))}async delete(e,n){n?.signal?.throwIfAborted(),this.entries.delete(e)}},oBe=class{storage;path;readState;constructor(e=(0,Fjn.join)(ii(),"models-store.json")){this.path=Vo(e),this.storage=new toe(this.path),this.readState=sBe?.path===this.path?sBe.readState:{data:{}},sBe||(sBe={path:this.path,readState:this.readState})}parse(e){return e?JSON.parse(zs(e)):{}}updateReadState(e,n,r){e.data=n,e.revision=r}reloadFromStorage(e,n){return this.storage.withLockAsync(async r=>{let i=this.parse(r);return this.updateReadState(e,i,CR(this.path)),{result:i}},n)}async readLatest(e,n){n?.signal?.throwIfAborted();let r=CR(this.path);if(r!==void 0&&r===e.revision)return e.data;if(!e.reload){let s=new AbortController,o={controller:s,promise:this.reloadFromStorage(e,{signal:s.signal}),readers:0};e.reload=o,o.promise.then(()=>{e.reload===o&&(e.reload=void 0)},()=>{e.reload===o&&(e.reload=void 0)})}let i=e.reload;i.readers++;try{return await vw(i.promise,n?.signal)}finally{i.readers--,i.readers===0&&e.reload===i&&(e.reload=void 0,i.controller.abort())}}async read(e,n){let r=(await this.readLatest(this.readState,n))[e];return n?.signal?.throwIfAborted(),r?structuredClone(r):void 0}async write(e,n,r){let i;await this.storage.withLockAsync(async s=>{let o=this.parse(s);return o[e]=structuredClone(n),i=o,{result:void 0,next:JSON.stringify(o,null,2)}},r),i&&this.updateReadState(this.readState,i)}async delete(e,n){let r;await this.storage.withLockAsync(async i=>{let s=this.parse(i);return delete s[e],r=s,{result:void 0,next:JSON.stringify(s,null,2)}},n),r&&this.updateReadState(this.readState,r)}}});function s6i(t,e){let n=[...t];for(let r of e){let i=n.findIndex(s=>s.id===r.id);i>=0?n[i]=r:n.push(r)}return n}function o6i(t,e){let n=Array.isArray(e)?e:typeof e=="object"&&e!==null&&"models"in e&&Array.isArray(e.models)?e.models:typeof e=="object"&&e!==null?Object.values(e):void 0;if(!n)throw new Error(`Invalid model catalog for provider "${t}"`);return n.filter(r=>typeof r=="object"&&r!==null&&"id"in r).map(r=>({...r,provider:t}))}function Qjn(t,e){return t?e!==void 0&&(t.lastModified===void 0||t.lastModified<=e)?[]:t.models:[]}function Ujn(t,e=n6i,n){let r=[];return{...t,getModels:()=>s6i(t.getModels(),r),refreshModels:async i=>{let s=i.stored,o=Qjn(s,n).filter(g=>g.provider===t.id);if(!await i.publish({update:()=>{r=o}})||!i.allowNetwork||i.signal.aborted||!i.force&&s?.checkedAt!==void 0&&s.lastModified!==void 0&&Date.now()-s.checkedAt{r=f}})}}}var n6i,r6i,i6i,Gjn=v(()=>{p();Qs();S1e();Yj();n6i="https://pi.dev",r6i=4e3,i6i=14400*1e3});var aBe,$jn=v(()=>{p();aBe=class{store;overrides=new Map;constructor(e){this.store=e}setRuntimeApiKey(e,n){this.overrides.set(e,n)}removeRuntimeApiKey(e){this.overrides.delete(e)}hasRuntimeApiKey(e){return this.overrides.has(e)}async read(e,n){n?.signal?.throwIfAborted();let r=this.overrides.get(e);return r?{type:"api_key",key:r}:this.store.read(e,n)}async list(e){let n=new Map((await this.store.list(e)).map(r=>[r.providerId,r]));e?.signal?.throwIfAborted();for(let r of this.overrides.keys())n.set(r,{providerId:r,type:"api_key"});return[...n.values()]}modify(e,n,r){return this.store.modify(e,n,r)}async delete(e,n){n?.signal?.throwIfAborted(),await this.store.delete(e,n),this.overrides.delete(e)}}});function Wjn(t,e){if(!t&&!e)return;let n={...t};for(let[r,i]of Object.entries(e??{})){let s=r.toLowerCase();for(let o of Object.keys(n))o.toLowerCase()===s&&delete n[o];n[r]=i}return n}var loe,SS,nf,lP=v(()=>{p();loe=require("node:path");qo();OIe();Qs();eoe();noe();Ljn();ght();tmt();Gjn();$jn();SS=class extends Error{providerId;operation;credential;constructor(e,n,r,i){super(`Credential ${n} committed for ${e}, but local synchronization failed`,i),this.name="CredentialSynchronizationError",this.providerId=e,this.operation=n,this.credential=r}};nf=class t{models;credentials;defaultBuiltins;builtins=new Map;nativeExtensionProviders=new Map;extensionProviders=new Map;compositionErrors=new Map;modelsPath;modelNetworkEnabled;config;snapshot={all:[],available:[],configuredProviders:new Set,storedProviders:new Set,auth:new Map};availabilityRefreshSeq=0;availabilityErrorSeq=0;providerAvailabilitySeq=new Map;availabilityError;credentialOperations=new Map;constructor(e,n,r,i,s,o){this.credentials=e,this.config=n,this.modelsPath=r,this.modelNetworkEnabled=o,this.defaultBuiltins=new Map(s.map(a=>[a.id,a]));for(let[a,c]of this.defaultBuiltins)this.builtins.set(a,c);this.models=rJ({credentials:e,modelsStore:i}),this.rebuildProviders()}static async create(e={}){let n=new aBe(e.credentials??sY.create(e.authPath)),r=e.modelsPath===null?void 0:e.modelsPath??(0,loe.join)(ii(),"models.json"),i=await coe.load(r),s=e.modelsStore??(r?new oBe(e.modelsStorePath??(0,loe.join)((0,loe.dirname)(r),"models-store.json")):new aY),o=uit(),a=MIe().map(h=>h.id==="radius"?h:Ujn(h,e.catalogBaseUrl,o)),c=new t(n,i,r,s,a,process.env.PI_OFFLINE===void 0);c.configureRadiusProviders(),c.rebuildProviders();let u=c.modelNetworkEnabled&&e.allowModelNetwork===!0,l=u&&e.modelRefreshTimeoutMs!==void 0?new AbortController:void 0,d=l?setTimeout(()=>l.abort(),e.modelRefreshTimeoutMs):void 0,m=l?e.signal?AbortSignal.any([e.signal,l.signal]):l.signal:e.signal;try{e.refreshOnCreate!==!1&&await c.refresh({allowNetwork:u,signal:m})}finally{d&&clearTimeout(d)}return c}configureRadiusProviders(){this.builtins.clear();for(let[e,n]of this.defaultBuiltins)this.builtins.set(e,n);for(let e of this.config.getProviderIds()){let n=this.config.getProvider(e);n?.oauth!=="radius"||!n.baseUrl||this.builtins.set(e,ine({id:e,name:n.name??e,gateway:n.baseUrl.replace(/\/v1\/?$/u,"")}))}}providerIds(){return new Set([...this.builtins.keys(),...this.nativeExtensionProviders.keys(),...this.config.getProviderIds(),...this.extensionProviders.keys()])}recomposeProvider(e){let n=this.nativeExtensionProviders.get(e)??this.builtins.get(e),r=this.extensionProviders.get(e);if(!n&&!this.config.getProvider(e)&&!r){this.models.deleteProvider(e),this.compositionErrors.delete(e);return}if(n&&!this.config.getProvider(e)&&!r){this.models.setProvider(n),this.compositionErrors.delete(e);return}try{this.models.setProvider(a4n(e,n,this.config,r)),this.compositionErrors.delete(e)}catch(i){this.compositionErrors.set(e,i instanceof Error?i.message:String(i)),n?this.models.setProvider(n):this.models.deleteProvider(e)}}rebuildProviders(){this.models.clearProviders(),this.compositionErrors.clear();for(let e of this.providerIds())this.recomposeProvider(e);this.updateModelSnapshot()}updateModelSnapshot(){let e=[...this.models.getModels()];this.snapshot={...this.snapshot,all:e,available:e.filter(n=>this.snapshot.configuredProviders.has(n.provider))}}async runAvailabilityRefresh(e,n,r){let i=this.models.getProviders(),[s,o,a]=await Promise.all([this.models.getAvailable(void 0,{signal:r}),Promise.all(i.map(async l=>[l.id,await this.models.checkAuth(l.id,{signal:r})])),this.credentials.list({signal:r})]);if(e!==this.availabilityRefreshSeq)return;let c=new Map(o),u=new Set(o.filter(l=>l[1]!==void 0).map(([l])=>l));this.snapshot={all:[...this.models.getModels()],available:[...s],configuredProviders:u,storedProviders:new Set(a.map(l=>l.providerId)),auth:c},n===this.availabilityErrorSeq&&(this.availabilityError=void 0)}queueAvailabilityRefresh(e){let n=++this.availabilityRefreshSeq;for(let[s,o]of this.providerAvailabilitySeq)this.providerAvailabilitySeq.set(s,o+1);let r=++this.availabilityErrorSeq,i=KQ(e);return this.runAvailabilityRefresh(n,r,i).catch(s=>{throw r===this.availabilityErrorSeq&&!i.aborted&&(this.availabilityError=s instanceof Error?s.message:String(s)),s})}async refreshProviderAvailability(e,n){++this.availabilityRefreshSeq;let r=(this.providerAvailabilitySeq.get(e)??0)+1;this.providerAvailabilitySeq.set(e,r);let i=++this.availabilityErrorSeq;try{let[s,o,a]=await Promise.all([this.models.getAvailable(e,{signal:n}),this.models.checkAuth(e,{signal:n}),this.credentials.read(e,{signal:n})]);if(n.throwIfAborted(),this.providerAvailabilitySeq.get(e)!==r)return;let c=new Set(this.snapshot.configuredProviders),u=new Set(this.snapshot.storedProviders),l=new Map(this.snapshot.auth);o?(c.add(e),l.set(e,o)):(c.delete(e),l.delete(e)),a?u.add(e):u.delete(e);let d=[...this.models.getModels()],m=new Map([...this.snapshot.available.filter(h=>h.provider!==e),...s].map(h=>[`${h.provider}\0${h.id}`,h]));this.snapshot={all:d,available:d.flatMap(h=>m.get(`${h.provider}\0${h.id}`)??[]),configuredProviders:c,storedProviders:u,auth:l},i===this.availabilityErrorSeq&&(this.availabilityError=void 0)}catch(s){throw this.providerAvailabilitySeq.get(e)===r&&i===this.availabilityErrorSeq&&!n.aborted&&(this.availabilityError=s instanceof Error?s.message:String(s)),s}}getProviders(){return this.models.getProviders()}getProvider(e){return this.models.getProvider(e)}getModels(e){return this.models.getModels(e)}getModel(e,n){return this.models.getModel(e,n)}async checkAuth(e,n){return this.models.checkAuth(e,n)}async getAvailable(e,n){if(e){let r=++this.availabilityErrorSeq;try{let i=await this.models.getAvailable(e,n);return r===this.availabilityErrorSeq&&(this.availabilityError=void 0),i}catch(i){throw r===this.availabilityErrorSeq&&!n?.signal?.aborted&&(this.availabilityError=i instanceof Error?i.message:String(i)),i}}return await this.queueAvailabilityRefresh(n?.signal),this.snapshot.available}getAvailableSnapshot(){return this.snapshot.available}getError(){let e=[],n=this.config.getError();n&&e.push(n);for(let[r,i]of this.compositionErrors)e.push(`Provider "${r}": ${i}`);return this.availabilityError&&e.push(`Availability refresh: ${this.availabilityError}`),e.length>0?e.join(` -`):void 0}getRegisteredProviderConfig(e){return this.extensionProviders.get(e)}getRegisteredProviderIds(){return[...new Set([...this.extensionProviders.keys(),...this.nativeExtensionProviders.keys()])]}getRegisteredNativeProvider(e){return this.nativeExtensionProviders.get(e)}getCompatibilityRequestConfig(e){return u_n(e,this.config.getProvider(e.provider),this.extensionProviders.get(e.provider))}isUsingOAuth(e){return this.snapshot.auth.get(e)?.type==="oauth"}isUsingSubscription(e){return this.isUsingOAuth(e)&&this.models.getProvider(e)?.auth.oauth?.isSubscription===!0}hasConfiguredAuth(e){return this.snapshot.configuredProviders.has(e)}async getAuth(e,n={}){if(typeof e=="string")return this.models.getAuth(e,n);let r=await this.models.getAuth(e,n);if(!r)return;let s=l_n(e,this.config.getProvider(e.provider),this.extensionProviders.get(e.provider),{...r.env??{},...n.env??{}});return{...r,auth:{...r.auth,headers:LSn(r.auth.headers,s)}}}enqueueCredentialOperation(e,n,r){let s=this.credentialOperations.get(e)??Promise.resolve(),i,o=new Promise(u=>{i=u}),a=(async()=>(await s.catch(()=>{}),n.throwIfAborted(),i?.(),r()))(),c=a.catch(()=>{});return this.credentialOperations.set(e,c),c.then(()=>{this.credentialOperations.get(e)===c&&this.credentialOperations.delete(e)}),lI(o,n).then(()=>a)}async synchronizeCredentialState(e,n,r,s){try{s.throwIfAborted(),this.recomposeProvider(e);let i=this.compositionErrors.get(e);if(i)throw new Error(i);let o=await this.models.refresh({allowNetwork:!1,providers:[e],signal:s});o.aborted&&s.throwIfAborted();let a=o.errors.get(e);if(a)throw a;this.updateModelSnapshot(),await this.refreshProviderAvailability(e,s)}catch(i){throw new I0(e,n,r,{cause:i})}}setRuntimeApiKey(e,n,r={}){let s=wL(r.signal);return this.enqueueCredentialOperation(e,s,async()=>{this.credentials.setRuntimeApiKey(e,n),await this.synchronizeCredentialState(e,"setRuntimeApiKey",{type:"api_key",key:n},s)})}removeRuntimeApiKey(e,n={}){let r=wL(n.signal);return this.enqueueCredentialOperation(e,r,async()=>{this.credentials.removeRuntimeApiKey(e),await this.synchronizeCredentialState(e,"removeRuntimeApiKey",void 0,r)})}listCredentials(e){return this.credentials.list(e)}getProviderAuthStatus(e){if(this.credentials.hasRuntimeApiKey(e))return{configured:!0,source:"runtime"};if(this.snapshot.storedProviders.has(e))return{configured:!0,source:"stored"};let n=UZe(this.config.getProvider(e),this.extensionProviders.get(e));if(n)return n;let r=this.snapshot.auth.get(e);return r?{configured:!0,source:"environment",label:r.source}:{configured:!1}}async prepareRequest(e,n){let r=this.models.getProvider(e.provider);if(!r)throw new ho("provider",`Unknown provider: ${e.provider}`);let s=await this.getAuth(e,{apiKey:n?.apiKey,env:n?.env,signal:n?.signal});if(!s)throw new ho("auth",`Provider is not configured: ${e.provider}`);let{transformHeaders:i,...o}=n??{},a=o,c=LSn(s.auth.headers,a.headers);i&&(c=await i(c??{}));let u=s.env||a.env?{...s.env??{},...a.env??{}}:void 0;return{provider:r,model:s.auth.baseUrl?{...e,baseUrl:s.auth.baseUrl}:e,options:{...a,apiKey:a.apiKey??s.auth.apiKey,headers:c,env:u}}}stream(e,n,r){return _h(e,async()=>{let s=await this.prepareRequest(e,r);return s.provider.stream(s.model,n,s.options)})}complete(e,n,r){return this.stream(e,n,r).result()}streamSimple(e,n,r){return _h(e,async()=>{let s=await this.prepareRequest(e,r);return s.provider.streamSimple(s.model,n,s.options)})}completeSimple(e,n,r){return this.streamSimple(e,n,r).result()}streamDeferred(e,n,r){return _h(e,async()=>{let s=await this.prepareRequest(e,r);if(!s.provider.fetchDeferred)throw new ho("provider",`Provider ${e.provider} does not support deferred responses`);return s.provider.fetchDeferred(s.model,n,s.options)})}async fetchDeferred(e,n,r){return this.streamDeferred(e,n,r).result()}async cancelDeferred(e,n,r){let s=await this.prepareRequest(e,r);if(!s.provider.cancelDeferred)throw new ho("provider",`Provider ${e.provider} does not support deferred responses`);await s.provider.cancelDeferred(s.model,n,s.options)}login(e,n,r){let s=wL(r.signal);return this.enqueueCredentialOperation(e,s,async()=>{let i=await this.models.login(e,n,{...r,signal:s});return await this.synchronizeCredentialState(e,"login",i,s),i})}logout(e,n={}){let r=wL(n.signal);return this.enqueueCredentialOperation(e,r,async()=>{await this.models.logout(e,{signal:r}),await this.synchronizeCredentialState(e,"logout",void 0,r)})}async refresh(e={}){if(this.config=await Nee.load(this.modelsPath),this.configureRadiusProviders(),e.providers){for(let i of new Set(e.providers))this.recomposeProvider(i);this.updateModelSnapshot()}else this.rebuildProviders();let n={...e,allowNetwork:e.allowNetwork??this.modelNetworkEnabled},r=await this.models.refresh(n)??{aborted:n.signal?.aborted??!1,errors:new Map},s=new Map(r.errors);if(this.updateModelSnapshot(),e.providers)await Promise.all([...new Set(e.providers)].map(async i=>{try{await this.refreshProviderAvailability(i,wL(e.signal))}catch(o){e.signal?.aborted||s.set(i,o instanceof Error?o:new Error(String(o)))}}));else try{await this.queueAvailabilityRefresh(e.signal)}catch{}return{aborted:r.aborted||(e.signal?.aborted??!1),errors:s}}registerNativeProvider(e){if(!e.id.trim())throw new Error("Provider id must not be empty.");this.extensionProviders.delete(e.id),this.nativeExtensionProviders.set(e.id,e),this.recomposeProvider(e.id),this.updateModelSnapshot(),this.refresh({allowNetwork:!1})}registerProvider(e,n){a_n(e,this.builtins.get(e),this.config.getProvider(e),n),this.nativeExtensionProviders.delete(e);let s={...this.extensionProviders.get(e)};for(let[i,o]of Object.entries(n))o!==void 0&&(s[i]=o);if(this.extensionProviders.set(e,s),this.recomposeProvider(e),this.updateModelSnapshot(),this.snapshot.storedProviders.has(e)||UZe(this.config.getProvider(e),s)?.configured){let i=new Set(this.snapshot.configuredProviders).add(e),o=new Map(this.snapshot.auth);o.get(e)||o.set(e,{type:s.oauth&&!s.apiKey?"oauth":"api_key",source:"configured provider"}),this.snapshot={...this.snapshot,auth:o,configuredProviders:i,available:this.snapshot.all.filter(a=>i.has(a.provider))}}this.refresh({allowNetwork:!1})}unregisterProvider(e){this.extensionProviders.delete(e),this.nativeExtensionProviders.delete(e),this.recomposeProvider(e),this.updateModelSnapshot(),this.refresh({allowNetwork:!1})}};p();var ZIn=require("node:crypto"),On=require("node:fs"),exn=require("node:os"),Sn=require("node:path"),A4=Gt(OSe(),1);var cy=Gt(ttt(),1);p();var ott=Gt(GIn(),1);function qIn(t){let e=t.match(/^git@([^:]+):(.+)$/);if(e){let c=e[2]??"",u=c.indexOf("@");if(u<0)return{repo:t};let l=c.slice(0,u),d=c.slice(u+1);return!l||!d?{repo:t}:{repo:`git@${e[1]??""}:${l}`,ref:d}}if(t.includes("://"))try{let c=new URL(t),u=c.pathname.replace(/^\/+/,""),l=u.indexOf("@");if(l<0)return{repo:t};let d=u.slice(0,l),h=u.slice(l+1);return!d||!h?{repo:t}:(c.pathname=`/${d}`,{repo:c.toString().replace(/\/$/,""),ref:h})}catch{return{repo:t}}let n=t.indexOf("/");if(n<0)return{repo:t};let r=t.slice(0,n),s=t.slice(n+1),i=s.indexOf("@");if(i<0)return{repo:t};let o=s.slice(0,i),a=s.slice(i+1);return!o||!a?{repo:t}:{repo:`${r}/${o}`,ref:a}}function aCs(t){try{return decodeURIComponent(t)}catch{return null}}function WIn(t,e){let n=aCs(t);if(n===null)return!0;let r=[t,n];for(let s of r)if(s.includes("\0")||s.includes("\\")||s.startsWith("/")||!e&&s.includes("/")||s.split("/").includes(".."))return!0;return!1}function att(t){if(t.path.startsWith("/"))return null;let e=t.path.replace(/\.git$/,"").replace(/^\/+/,"");return!t.host||!e||e.split("/").length<2||WIn(t.host,!1)||WIn(e,!0)?null:{type:"git",repo:t.repo,host:t.host,path:e,ref:t.ref,pinned:!!t.ref}}function cCs(t){let{repo:e,ref:n}=qIn(t),r=e,s="",i="",o=e.match(/^git@([^:]+):(.+)$/);if(o)s=o[1]??"",i=o[2]??"";else if(e.startsWith("https://")||e.startsWith("http://")||e.startsWith("ssh://")||e.startsWith("git://"))try{let a=new URL(e);s=a.hostname,i=a.pathname.replace(/^\/+/,"")}catch{return null}else{let a=e.indexOf("/");if(a<0||(s=e.slice(0,a),i=e.slice(a+1),!s.includes(".")&&s!=="localhost"))return null;r=`https://${e}`}return att({repo:r,host:s,path:i,ref:n})}function Uee(t){let e=t.trim(),n=e.startsWith("git:"),r=n?e.slice(4).trim():e;if(!n&&!/^(https?|ssh|git):\/\//i.test(r))return null;let s=qIn(r),i=[s.ref?`${s.repo}#${s.ref}`:void 0,r].filter(a=>!!a);for(let a of i){let c=ott.default.fromUrl(a);if(c){if(s.ref&&c.project?.includes("@"))continue;let u=!s.repo.startsWith("http://")&&!s.repo.startsWith("https://")&&!s.repo.startsWith("ssh://")&&!s.repo.startsWith("git://")&&!s.repo.startsWith("git@");return att({repo:u?`https://${s.repo}`:s.repo,host:c.domain||"",path:`${c.user}/${c.project}`,ref:c.committish||s.ref||void 0})}}let o=[s.ref?`https://${s.repo}#${s.ref}`:void 0,`https://${r}`].filter(a=>!!a);for(let a of o){let c=ott.default.fromUrl(a);if(c){if(s.ref&&c.project?.includes("@"))continue;return att({repo:`https://${s.repo}`,host:c.domain||"",path:`${c.user}/${c.project}`,ref:c.committish||s.ref||void 0})}}return cCs(r)}p();var gD;var $ee=Promise.resolve();function lCs(){return gD?gD.rawStdoutWrite:process.stdout.write.bind(process.stdout)}async function HIn(t){for(;;)try{await new Promise((e,n)=>{try{lCs()(t,r=>{r?n(r):e()})}catch(r){n(r instanceof Error?r:new Error(String(r)))}});return}catch(e){let n=e instanceof Error?e:new Error(String(e)),r=n.code;if(r!=="ENOBUFS"&&r!=="EAGAIN"&&r!=="EWOULDBLOCK")throw n;await new Promise(s=>setTimeout(s,10))}}function xIe(){if(gD)return;let t=process.stdout.write.bind(process.stdout),e=process.stderr.write.bind(process.stderr),n=process.stdout.write;process.stdout.write=((r,s,i)=>typeof s=="function"?e(String(r),s):e(String(r),i)),gD={rawStdoutWrite:t,rawStderrWrite:e,originalStdoutWrite:n}}function VIn(){gD&&(process.stdout.write=gD.originalStdoutWrite,gD=void 0)}function jIn(){return gD!==void 0}function g4(t){t.length!==0&&($ee=$ee.then(()=>HIn(t)),$ee.catch(()=>{process.exit(1)}))}async function AD(){for(;;){let t=$ee;if(await t,t===$ee)return}}async function wIe(){await AD(),await HIn("")}function ctt(){if(process.platform!=="linux"||Object.keys(process.env).length>0)return process.env;try{let t=(0,On.readFileSync)("/proc/self/environ","utf-8"),e={};for(let n of t.split("\0")){let r=n.indexOf("=");r>0&&(e[n.slice(0,r)]=n.slice(r+1))}return e}catch{return process.env}}var pI=1e4,YIn=4,uCs=4;function kL(){let t=process.env.PI_OFFLINE;return t?t==="1"||t.toLowerCase()==="true"||t.toLowerCase()==="yes":!1}function dCs(t){return(0,cy.valid)(t??"")!==null}function pCs(t){return t?(0,cy.validRange)(t)??void 0:void 0}function KIn(t){return t.origin==="package"?4:(t.scope==="project"?0:2)+(t.source==="local"?0:1)}var TIe=["extensions","skills","prompts","themes"],hCs={extensions:/\.(ts|js)$/,skills:/\.md$/,prompts:/\.md$/,themes:/\.json$/},mCs=[".gitignore",".ignore",".fdignore"];function oh(t){return t.split(Sn.sep).join("/")}function ltt(){return process.env.HOME||(0,exn.homedir)()}function fCs(t){let e=(0,Sn.join)(t,"tmp","extensions");return(0,On.mkdirSync)(e,{recursive:!0,mode:448}),(0,On.chmodSync)(e,448),e}function gCs(t,e){let n=t.trim();if(!n||n.startsWith("#")&&!n.startsWith("\\#"))return null;let r=t,s=!1;r.startsWith("!")?(s=!0,r=r.slice(1)):r.startsWith("\\!")&&(r=r.slice(1)),r.startsWith("/")&&(r=r.slice(1));let i=e?`${e}${r}`:r;return s?`!${i}`:i}function Wee(t,e,n){let r=(0,Sn.relative)(n,e),s=r?`${oh(r)}/`:"";for(let i of mCs){let o=(0,Sn.join)(e,i);if((0,On.existsSync)(o))try{let c=(0,On.readFileSync)(o,"utf-8").split(/\r?\n/).map(u=>gCs(u,s)).filter(u=>!!u);c.length>0&&t.add(c)}catch{}}}function ACs(t){return t.startsWith("!")||t.startsWith("+")||t.startsWith("-")||t.includes("*")||t.includes("?")}function utt(t){return t.startsWith("!")||t.startsWith("+")||t.startsWith("-")}function yCs(t){return t.includes("*")||t.includes("?")}function ECs(t,e){return(0,On.globSync)(t,{cwd:e}).map(n=>(0,Sn.resolve)(e,n)).filter(n=>(0,Sn.relative)(e,n).split(Sn.sep).every(r=>r===".."||!r.startsWith("."))).sort((n,r)=>nr?1:0)}function bCs(t){let e=[],n=[];for(let r of t)ACs(r)?n.push(r):e.push(r);return{plain:e,patterns:n}}function txn(t,e,n=!0,r,s){let i=[];if(!(0,On.existsSync)(t))return i;let o=s??t,a=r??(0,A4.default)();Wee(a,t,o);try{let c=(0,On.readdirSync)(t,{withFileTypes:!0});for(let u of c){if(u.name.startsWith(".")||n&&u.name==="node_modules")continue;let l=(0,Sn.join)(t,u.name),d=u.isDirectory(),h=u.isFile();if(u.isSymbolicLink())try{let g=(0,On.statSync)(l);d=g.isDirectory(),h=g.isFile()}catch{continue}let m=oh((0,Sn.relative)(o,l)),f=d?`${m}/`:m;a.ignores(f)||(d?i.push(...txn(l,e,n,a,o)):h&&e.test(u.name)&&i.push(l))}}catch{}return i}function ptt(t,e,n,r){let s=[];if(!(0,On.existsSync)(t))return s;let i=r??t,o=n??(0,A4.default)();Wee(o,t,i);try{let a=(0,On.readdirSync)(t,{withFileTypes:!0});for(let c of a){if(c.name!=="SKILL.md")continue;let u=(0,Sn.join)(t,c.name),l=c.isFile();if(c.isSymbolicLink())try{l=(0,On.statSync)(u).isFile()}catch{continue}let d=oh((0,Sn.relative)(i,u));if(l&&!o.ignores(d))return s.push(u),s}for(let c of a){if(c.name.startsWith(".")||c.name==="node_modules")continue;let u=(0,Sn.join)(t,c.name),l=c.isDirectory(),d=c.isFile();if(c.isSymbolicLink())try{let f=(0,On.statSync)(u);l=f.isDirectory(),d=f.isFile()}catch{continue}let h=oh((0,Sn.relative)(i,u));if(d&&c.name.endsWith(".md")&&!o.ignores(h)&&(e==="pi"&&t===i||e==="agents"&&t!==i)){s.push(u);continue}l&&(o.ignores(`${h}/`)||s.push(...ptt(u,e,o,i)))}}catch{}return s}function vIe(t,e){return ptt(t,e)}function _Cs(t){let e=(0,Sn.resolve)(t);for(;;){if((0,On.existsSync)((0,Sn.join)(e,".git")))return e;let n=(0,Sn.dirname)(e);if(n===e)return null;e=n}}function SCs(t){let e=[],n=(0,Sn.resolve)(t),r=_Cs(n),s=n;for(;e.push((0,Sn.join)(s,".agents","skills")),!(r&&s===r);){let i=(0,Sn.dirname)(s);if(i===s)break;s=i}return e}function zIn(t){let e=[];if(!(0,On.existsSync)(t))return e;let n=(0,A4.default)();Wee(n,t,t);try{let r=(0,On.readdirSync)(t,{withFileTypes:!0});for(let s of r){if(s.name.startsWith(".")||s.name==="node_modules")continue;let i=(0,Sn.join)(t,s.name),o=s.isFile();if(s.isSymbolicLink())try{o=(0,On.statSync)(i).isFile()}catch{continue}let a=oh((0,Sn.relative)(t,i));n.ignores(a)||o&&s.name.endsWith(".md")&&e.push(i)}}catch{}return e}function JIn(t){let e=[];if(!(0,On.existsSync)(t))return e;let n=(0,A4.default)();Wee(n,t,t);try{let r=(0,On.readdirSync)(t,{withFileTypes:!0});for(let s of r){if(s.name.startsWith(".")||s.name==="node_modules")continue;let i=(0,Sn.join)(t,s.name),o=s.isFile();if(s.isSymbolicLink())try{o=(0,On.statSync)(i).isFile()}catch{continue}let a=oh((0,Sn.relative)(t,i));n.ignores(a)||o&&s.name.endsWith(".json")&&e.push(i)}}catch{}return e}function XIn(t){let e=(0,Sn.join)(t,"package.json");if((0,On.existsSync)(e)){let s=pL(e);if(s?.extensions?.length){let i=[];for(let o of s.extensions){let a=(0,Sn.resolve)(t,o);(0,On.existsSync)(a)&&i.push(a)}if(i.length>0)return i}}let n=(0,Sn.join)(t,"index.ts"),r=(0,Sn.join)(t,"index.js");return(0,On.existsSync)(n)?[n]:(0,On.existsSync)(r)?[r]:null}function dtt(t){let e=[];if(!(0,On.existsSync)(t))return e;let n=XIn(t);if(n)return n;let r=(0,A4.default)();Wee(r,t,t);try{let s=(0,On.readdirSync)(t,{withFileTypes:!0});for(let i of s){if(i.name.startsWith(".")||i.name==="node_modules")continue;let o=(0,Sn.join)(t,i.name),a=i.isDirectory(),c=i.isFile();if(i.isSymbolicLink())try{let d=(0,On.statSync)(o);a=d.isDirectory(),c=d.isFile()}catch{continue}let u=oh((0,Sn.relative)(t,o)),l=a?`${u}/`:u;if(!r.ignores(l)){if(c&&(i.name.endsWith(".ts")||i.name.endsWith(".js")))e.push(o);else if(a){let d=XIn(o);d&&e.push(...d)}}}}catch{}return e}function RIe(t,e){return e==="skills"?ptt(t,"pi"):e==="extensions"?dtt(t):txn(t,hCs[e])}function NIe(t,e,n){let r=oh((0,Sn.relative)(n,t)),s=(0,Sn.basename)(t),i=oh(t),o=s==="SKILL.md",a=o?(0,Sn.dirname)(t):void 0,c=o?oh((0,Sn.relative)(n,a)):void 0,u=o?(0,Sn.basename)(a):void 0,l=o?oh(a):void 0;return e.some(d=>{let h=oh(d);return _c(r,h)||_c(s,h)||_c(i,h)?!0:o?_c(c,h)||_c(u,h)||_c(l,h):!1})}function CCs(t){let e=t.startsWith("./")||t.startsWith(".\\")?t.slice(2):t;return oh(e)}function Gee(t,e,n){if(e.length===0)return!1;let r=oh((0,Sn.relative)(n,t)),s=(0,Sn.basename)(t),i=oh(t),o=s==="SKILL.md",a=o?(0,Sn.dirname)(t):void 0,c=o?oh((0,Sn.relative)(n,a)):void 0,u=o?oh(a):void 0;return e.some(l=>{let d=CCs(l);return d===r||d===i?!0:o?d===c||d===u:!1})}function ICs(t){return t.filter(e=>e.startsWith("!")||e.startsWith("+")||e.startsWith("-"))}function xCs(t,e,n){let r=ICs(e),s=r.filter(c=>c.startsWith("!")).map(c=>c.slice(1)),i=r.filter(c=>c.startsWith("+")).map(c=>c.slice(1)),o=r.filter(c=>c.startsWith("-")).map(c=>c.slice(1)),a=!0;return s.length>0&&NIe(t,s,n)&&(a=!1),i.length>0&&Gee(t,i,n)&&(a=!0),o.length>0&&Gee(t,o,n)&&(a=!1),a}function kIe(t,e,n){let r=[],s=[],i=[],o=[];for(let c of e)c.startsWith("+")?i.push(c.slice(1)):c.startsWith("-")?o.push(c.slice(1)):c.startsWith("!")?s.push(c.slice(1)):r.push(c);let a;if(r.length===0?a=[...t]:a=t.filter(c=>NIe(c,r,n)),s.length>0&&(a=a.filter(c=>!NIe(c,s,n))),i.length>0)for(let c of t)!a.includes(c)&&Gee(c,i,n)&&a.push(c);return o.length>0&&(a=a.filter(c=>!Gee(c,o,n))),new Set(a)}function wCs(t,e,n){let r=new Map;for(let s of e){let i=s.slice(s.startsWith("+")||s.startsWith("-")||s.startsWith("!")?1:0),o=!s.startsWith("-")&&!s.startsWith("!"),a=s.startsWith("+")||s.startsWith("-");for(let c of t)(a?Gee(c,[i],n):NIe(c,[i],n))&&r.set(c,o)}return r}var jh=class{cwd;agentDir;settingsManager;globalNpmRoot;globalNpmRootCommandKey;progressCallback;constructor(e){this.cwd=jn(e.cwd),this.agentDir=jn(e.agentDir),this.settingsManager=e.settingsManager}setProgressCallback(e){this.progressCallback=e}addSourceToSettings(e,n){let r=n?.local?"project":"user",i=(r==="project"?this.settingsManager.getProjectSettings():this.settingsManager.getGlobalSettings()).packages??[],o=this.normalizePackageSourceForSettings(e,r),a=i.findIndex(u=>this.packageSourcesMatch(u,e,r));if(a!==-1){let u=i[a];if(this.getPackageSourceString(u)===o)return!1;let l=[...i];return l[a]=typeof u=="string"?o:{...u,source:o},r==="project"?this.settingsManager.setProjectPackages(l):this.settingsManager.setPackages(l),!0}let c=[...i,o];return r==="project"?this.settingsManager.setProjectPackages(c):this.settingsManager.setPackages(c),!0}removeSourceFromSettings(e,n){let r=n?.local?"project":"user",i=(r==="project"?this.settingsManager.getProjectSettings():this.settingsManager.getGlobalSettings()).packages??[],o=i.filter(c=>!this.packageSourcesMatch(c,e,r));return o.length!==i.length?(r==="project"?this.settingsManager.setProjectPackages(o):this.settingsManager.setPackages(o),!0):!1}getInstalledPath(e,n){let r=this.parseSource(e);if(r.type==="npm"){let s=this.getNpmInstallPath(r,n);return(0,On.existsSync)(s)?s:void 0}if(r.type==="git"){let s=this.getGitInstallPath(r,n);return(0,On.existsSync)(s)?s:void 0}if(r.type==="local"){let s=this.getBaseDirForScope(n),i=this.resolvePathFromBase(r.path,s);return(0,On.existsSync)(i)?i:void 0}}emitProgress(e){this.progressCallback?.(e)}async withProgress(e,n,r,s){this.emitProgress({type:"start",action:e,source:n,message:r});try{await s(),this.emitProgress({type:"complete",action:e,source:n})}catch(i){let o=i instanceof Error?i.message:String(i);throw this.emitProgress({type:"error",action:e,source:n,message:o}),i}}async resolve(e){let n=this.createAccumulator(),r=this.settingsManager.getGlobalSettings(),s=this.settingsManager.getProjectSettings(),i=[];for(let u of s.packages??[])i.push({pkg:u,scope:"project"});for(let u of r.packages??[])i.push({pkg:u,scope:"user"});let o=this.dedupePackages(i);await this.resolvePackageSources(o,n,e);let a=this.agentDir,c=(0,Sn.join)(this.cwd,ws);for(let u of TIe){let l=this.getTargetMap(n,u),d=r[u]??[],h=s[u]??[];this.resolveLocalEntries(h,u,l,{source:"local",scope:"project",origin:"top-level"},c),this.resolveLocalEntries(d,u,l,{source:"local",scope:"user",origin:"top-level"},a)}return this.addAutoDiscoveredResources(n,r,s,a,c),this.toResolvedPaths(n)}async resolveExtensionSources(e,n){let r=this.createAccumulator(),s=n?.temporary?"temporary":n?.local?"project":"user",i=e.map(o=>({pkg:o,scope:s}));return await this.resolvePackageSources(i,r),this.toResolvedPaths(r)}listConfiguredPackages(){let e=this.settingsManager.getGlobalSettings(),n=this.settingsManager.getProjectSettings(),r=[];for(let s of e.packages??[]){let i=typeof s=="string"?s:s.source;r.push({source:i,scope:"user",filtered:typeof s=="object",installedPath:this.getInstalledPath(i,"user")})}for(let s of n.packages??[]){let i=typeof s=="string"?s:s.source;r.push({source:i,scope:"project",filtered:typeof s=="object",installedPath:this.getInstalledPath(i,"project")})}return r}async install(e,n){let r=this.parseSource(e),s=n?.local?"project":"user";this.assertProjectTrustedForScope(s),await this.withProgress("install",e,`Installing ${e}...`,async()=>{if(r.type==="npm"){await this.installNpm(r,s,!1);return}if(r.type==="git"){await this.installGit(r,s);return}if(r.type==="local"){let i=this.resolvePath(r.path);if(!(0,On.existsSync)(i))throw new Error(`Path does not exist: ${i}`);return}throw new Error(`Unsupported install source: ${e}`)})}async installAndPersist(e,n){await this.install(e,n),this.addSourceToSettings(e,n)}async remove(e,n){let r=this.parseSource(e),s=n?.local?"project":"user";this.assertProjectTrustedForScope(s),await this.withProgress("remove",e,`Removing ${e}...`,async()=>{if(r.type==="npm"){await this.uninstallNpm(r,s);return}if(r.type==="git"){await this.removeGit(r,s);return}if(r.type!=="local")throw new Error(`Unsupported remove source: ${e}`)})}async removeAndPersist(e,n){return await this.remove(e,n),this.removeSourceFromSettings(e,n)}async update(e){let n=this.settingsManager.getGlobalSettings(),r=this.settingsManager.getProjectSettings(),s=e?this.getPackageIdentity(e):void 0,i=!1,o=[];for(let a of n.packages??[]){let c=typeof a=="string"?a:a.source;s&&this.getPackageIdentity(c,"user")!==s||(i=!0,o.push({source:c,scope:"user"}))}for(let a of r.packages??[]){let c=typeof a=="string"?a:a.source;s&&this.getPackageIdentity(c,"project")!==s||(i=!0,o.push({source:c,scope:"project"}))}if(e&&!i)throw new Error(this.buildNoMatchingPackageMessage(e,[...n.packages??[],...r.packages??[]]));await this.updateConfiguredSources(o)}async updateConfiguredSources(e){if(kL()||e.length===0)return;let n=[],r=[];for(let u of e){let l=this.parseSource(u.source);l.type==="npm"?l.pinned||n.push({...u,parsed:l}):l.type==="git"&&r.push({...u,parsed:l})}let s=n.map(u=>async()=>({entry:u,shouldUpdate:await this.shouldUpdateNpmSource(u.parsed,u.scope)})),i=await this.runWithConcurrency(s,YIn),o=[],a=[];for(let u of i)u.shouldUpdate&&(u.entry.scope==="user"?o.push(u.entry):a.push(u.entry));let c=[];if(o.length>0&&c.push(this.updateNpmBatch(o,"user")),a.length>0&&c.push(this.updateNpmBatch(a,"project")),r.length>0){let u=r.map(l=>async()=>this.withProgress("update",l.source,`Updating ${l.source}...`,async()=>{await this.updateGit(l.parsed,l.scope)}));c.push(this.runWithConcurrency(u,uCs).then(()=>{}))}await Promise.all(c)}async shouldUpdateNpmSource(e,n){let r=this.getManagedNpmInstallPath(e,n),s=(0,On.existsSync)(r)?this.getInstalledNpmVersion(r):void 0;if(!s)return!0;try{let i=await this.getLatestNpmVersion(e.version?e.spec:e.name,e.range);return(0,cy.gt)(i,s)}catch{return!0}}async updateNpmBatch(e,n){if(e.length===0)return;let r=e.length===1?e[0].source:`${n} npm packages`,s=e.length===1?`Updating ${e[0].source}...`:`Updating ${n} npm packages...`,i=e.map(o=>o.parsed.version?o.parsed.spec:`${o.parsed.name}@latest`);await this.withProgress("update",r,s,async()=>{await this.installNpmBatch(i,n)})}async installNpmBatch(e,n){let r=this.getNpmInstallRoot(n,!1);this.ensureNpmProject(r),await this.runNpmCommand(this.getNpmInstallArgs(e,r))}async checkForAvailableUpdates(){if(kL())return[];let e=this.settingsManager.getGlobalSettings(),n=this.settingsManager.getProjectSettings(),r=[];for(let a of n.packages??[])r.push({pkg:a,scope:"project"});for(let a of e.packages??[])r.push({pkg:a,scope:"user"});let i=this.dedupePackages(r).filter(a=>a.scope!=="temporary").map(a=>async()=>{let c=typeof a.pkg=="string"?a.pkg:a.pkg.source,u=this.parseSource(c);if(u.type==="local"||u.pinned)return;if(u.type==="npm"){let h=this.getNpmInstallPath(u,a.scope);return!(0,On.existsSync)(h)||!await this.npmHasAvailableUpdate(u,h)?void 0:{source:c,displayName:u.name,type:"npm",scope:a.scope}}let l=this.getGitInstallPath(u,a.scope);if(!(!(0,On.existsSync)(l)||!await this.gitHasAvailableUpdate(l)))return{source:c,displayName:`${u.host}/${u.path}`,type:"git",scope:a.scope}});return(await this.runWithConcurrency(i,YIn)).filter(a=>a!==void 0)}async resolvePackageSources(e,n,r){for(let{pkg:s,scope:i}of e){let o=typeof s=="string"?s:s.source,a=typeof s=="object"?s:void 0,c=this.findAutoloadDeltaBase(s,i,e),u=c?.source??o,l=c?.scope??i,d=this.parseSource(u),h={source:o,scope:i,origin:"package"};if(d.type==="local"){let f=this.getBaseDirForScope(l);this.resolveLocalExtensionSource(d,n,a,h,f);continue}let m=async()=>{if(kL())return!1;if(!r)return await this.installParsedSource(d,l),!0;let f=await r(u);if(f==="skip")return!1;if(f==="error")throw new Error(`Missing source: ${u}`);return await this.installParsedSource(d,l),!0};if(d.type==="npm"){let f=this.getNpmInstallPath(d,l);if(!(0,On.existsSync)(f)||!await this.installedNpmMatchesConfiguredVersion(d,f)){if(!await m())continue;f=this.getNpmInstallPath(d,l)}h.baseDir=f,this.collectPackageResources(f,n,a,h);continue}if(d.type==="git"){let f=this.getGitInstallPath(d,l);if((0,On.existsSync)(f))l==="temporary"&&!d.pinned&&!kL()&&await this.refreshTemporaryGitSource(d,u);else if(!await m())continue;h.baseDir=f,this.collectPackageResources(f,n,a,h)}}}findAutoloadDeltaBase(e,n,r){if(n!=="project"||typeof e!="object"||e.autoload!==!1)return;let s=this.getPackageIdentity(e.source,n),i=r.find(o=>o.scope==="user"&&this.getPackageIdentity(this.getPackageSourceString(o.pkg),"user")===s);return i?{source:this.getPackageSourceString(i.pkg),scope:"user"}:void 0}resolveLocalExtensionSource(e,n,r,s,i){let o=this.resolvePathFromBase(e.path,i);if((0,On.existsSync)(o))try{let a=(0,On.statSync)(o);if(a.isFile()){s.baseDir=(0,Sn.dirname)(o),this.addResource(n.extensions,o,s,!0);return}a.isDirectory()&&(s.baseDir=o,this.collectPackageResources(o,n,r,s)||this.addResource(n.extensions,o,s,!0))}catch{return}}async installParsedSource(e,n){if(e.type==="npm"){await this.installNpm(e,n,n==="temporary");return}if(e.type==="git"){await this.installGit(e,n);return}}getPackageSourceString(e){return typeof e=="string"?e:e.source}getSourceMatchKeyForInput(e){let n=this.parseSource(e);return n.type==="npm"?`npm:${n.name}`:n.type==="git"?`git:${n.host}/${n.path}`:`local:${this.resolvePath(n.path)}`}getSourceMatchKeyForSettings(e,n){let r=this.parseSource(e);if(r.type==="npm")return`npm:${r.name}`;if(r.type==="git")return`git:${r.host}/${r.path}`;let s=this.getBaseDirForScope(n);return`local:${this.resolvePathFromBase(r.path,s)}`}buildNoMatchingPackageMessage(e,n){let r=this.findSuggestedConfiguredSource(e,n);return r?`No matching package found for ${e}. Did you mean ${r}?`:`No matching package found for ${e}`}findSuggestedConfiguredSource(e,n){let r=e.trim(),s=new Set;for(let i of n){let o=this.getPackageSourceString(i),a=this.parseSource(o);if(a.type==="npm"){(r===a.name||r===a.spec)&&s.add(o);continue}if(a.type==="git"){let c=`${a.host}/${a.path}`,u=a.ref?`${c}@${a.ref}`:void 0;(r===c||u&&r===u)&&s.add(o)}}return s.values().next().value}packageSourcesMatch(e,n,r){let s=this.getSourceMatchKeyForSettings(this.getPackageSourceString(e),r),i=this.getSourceMatchKeyForInput(n);return s===i}normalizePackageSourceForSettings(e,n){let r=this.parseSource(e);if(r.type!=="local")return e;let s=this.getBaseDirForScope(n),i=this.resolvePath(r.path);return(0,Sn.relative)(s,i)||"."}parseSource(e){if(e.startsWith("npm:")){let r=e.slice(4).trim(),{name:s,version:i}=this.parseNpmSpec(r);return{type:"npm",spec:r,name:s,version:i,range:pCs(i),pinned:dCs(i)}}if(UE(e))return{type:"local",path:e};let n=Uee(e);return n||{type:"local",path:e}}async installedNpmMatchesConfiguredVersion(e,n){let r=this.getInstalledNpmVersion(n);return r?e.range?(0,cy.satisfies)(r,e.range):!0:!1}async npmHasAvailableUpdate(e,n){if(kL())return!1;let r=this.getInstalledNpmVersion(n);if(!r)return!1;try{let s=await this.getLatestNpmVersion(e.version?e.spec:e.name,e.range);return(0,cy.gt)(s,r)}catch{return!1}}getInstalledNpmVersion(e){let n=(0,Sn.join)(e,"package.json");if((0,On.existsSync)(n))try{let r=(0,On.readFileSync)(n,"utf-8");return JSON.parse(Mi(r)).version}catch{return}}async getLatestNpmVersion(e,n){let r=this.getNpmCommand(),i=(await this.runCommandCapture(r.command,[...r.args,"view",e,"version","--json"],{cwd:this.cwd,timeoutMs:pI})).trim();if(!i)throw new Error("Empty response from npm view");let o=JSON.parse(i);if(typeof o=="string")return o;if(Array.isArray(o)){let a=o.filter(u=>typeof u=="string"&&u.length>0),c=n?(0,cy.maxSatisfying)(a,n):[...a].sort(cy.rcompare)[0];if(c)return c}throw new Error("Unexpected response from npm view")}async gitHasAvailableUpdate(e){if(kL())return!1;try{let n=await this.runCommandCapture("git",["rev-parse","HEAD"],{cwd:e,timeoutMs:pI}),r=await this.getRemoteGitHead(e);return n.trim()!==r.trim()}catch{return!1}}async getRemoteGitHead(e){let n=await this.getGitUpstreamRef(e);if(n){let o=(await this.runGitRemoteCommand(e,["ls-remote","origin",n])).match(/^([0-9a-f]{40})\s+/m);if(o?.[1])return o[1]}let s=(await this.runGitRemoteCommand(e,["ls-remote","origin","HEAD"])).match(/^([0-9a-f]{40})\s+HEAD$/m);if(!s?.[1])throw new Error("Failed to determine remote HEAD");return s[1]}async getLocalGitUpdateTarget(e){try{let r=(await this.runCommandCapture("git",["rev-parse","--abbrev-ref","@{upstream}"],{cwd:e,timeoutMs:pI})).trim();if(!r.startsWith("origin/"))throw new Error(`Unsupported upstream remote: ${r}`);let s=r.slice(7);if(!s)throw new Error("Missing upstream branch name");return{ref:"@{upstream}",head:await this.runCommandCapture("git",["rev-parse","@{upstream}"],{cwd:e,timeoutMs:pI}),fetchArgs:["fetch","--prune","--no-tags","origin",`+refs/heads/${s}:refs/remotes/origin/${s}`]}}catch{await this.runCommand("git",["remote","set-head","origin","-a"],{cwd:e}).catch(()=>{});let n=await this.runCommandCapture("git",["rev-parse","origin/HEAD"],{cwd:e,timeoutMs:pI}),s=(await this.runCommandCapture("git",["symbolic-ref","refs/remotes/origin/HEAD"],{cwd:e,timeoutMs:pI}).catch(()=>"")).trim().replace(/^refs\/remotes\/origin\//,"");return s?{ref:"origin/HEAD",head:n,fetchArgs:["fetch","--prune","--no-tags","origin",`+refs/heads/${s}:refs/remotes/origin/${s}`]}:{ref:"origin/HEAD",head:n,fetchArgs:["fetch","--prune","--no-tags","origin","+HEAD:refs/remotes/origin/HEAD"]}}}async getGitUpstreamRef(e){try{let r=(await this.runCommandCapture("git",["rev-parse","--abbrev-ref","@{upstream}"],{cwd:e,timeoutMs:pI})).trim();if(!r.startsWith("origin/"))return;let s=r.slice(7);return s?`refs/heads/${s}`:void 0}catch{return}}runGitRemoteCommand(e,n){return this.runCommandCapture("git",n,{cwd:e,timeoutMs:pI,env:{GIT_TERMINAL_PROMPT:"0"}})}async runWithConcurrency(e,n){if(e.length===0)return[];let r=new Array(e.length),s=0,i=Math.max(1,Math.min(n,e.length)),o=async()=>{for(;;){let a=s;if(s+=1,a>=e.length)return;r[a]=await e[a]()}};return await Promise.all(Array.from({length:i},()=>o())),r}getPackageIdentity(e,n){let r=this.parseSource(e);if(r.type==="npm")return`npm:${r.name}`;if(r.type==="git")return`git:${r.host}/${r.path}`;if(n){let s=this.getBaseDirForScope(n);return`local:${this.resolvePathFromBase(r.path,s)}`}return`local:${this.resolvePath(r.path)}`}dedupePackages(e){let n=[],r=new Map;for(let s of e){let i=this.getPackageIdentity(this.getPackageSourceString(s.pkg),s.scope),o=r.get(i);if(o===void 0){r.set(i,n.length),n.push(s);continue}let a=n[o];a?.scope==="project"&&s.scope==="user"?typeof a.pkg=="object"&&a.pkg.autoload===!1&&n.push(s):s.scope==="project"&&(n[o]=s)}return n}parseNpmSpec(e){let n=e.match(/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/);if(!n)return{name:e};let r=n[1]??e,s=n[2];return{name:r,version:s}}assertProjectTrustedForScope(e){if(e==="project"&&!this.settingsManager.isProjectTrusted())throw new Error("Project is not trusted; refusing to access project package storage")}getNpmCommand(){let e=this.settingsManager.getNpmCommand();if(!e||e.length===0)return{command:"npm",args:[]};let[n,...r]=e;if(!n)throw new Error("Invalid npmCommand: first array entry must be a non-empty command");return{command:n,args:r}}getPackageManagerName(){let e=this.getNpmCommand(),n=[e.command,...e.args],r=n.lastIndexOf("--"),s=r>=0?n[r+1]:e.command;return s?(0,Sn.basename)(s).replace(/\.(cmd|exe)$/i,""):""}async runNpmCommand(e,n){let r=this.getNpmCommand();await this.runCommand(r.command,[...r.args,...e],n)}getGitDependencyInstallArgs(){let e=this.settingsManager.getNpmCommand();return e&&e.length>0?["install"]:["install","--omit=dev"]}runNpmCommandSync(e){let n=this.getNpmCommand();return this.runCommandSync(n.command,[...n.args,...e])}getNpmInstallArgs(e,n){let r=this.getPackageManagerName();return r==="bun"?["install",...e,"--cwd",n,"--omit=peer"]:r==="pnpm"?["install",...e,"--prefix",n,"--config.auto-install-peers=false","--config.strict-peer-dependencies=false","--config.strict-dep-builds=false"]:["install",...e,"--prefix",n,"--legacy-peer-deps"]}async installNpm(e,n,r){let s=this.getNpmInstallRoot(n,r);this.ensureNpmProject(s),await this.runNpmCommand(this.getNpmInstallArgs([e.spec],s))}async uninstallNpm(e,n){let r=this.getNpmInstallRoot(n,!1);if(!(0,On.existsSync)(r))return;let s=this.getPackageManagerName();if(s==="bun"){await this.runNpmCommand(["uninstall",e.name,"--cwd",r]);return}let i=["uninstall",e.name,"--prefix",r];s!=="pnpm"&&i.push("--legacy-peer-deps"),await this.runNpmCommand(i)}async installGit(e,n){let r=this.getGitInstallPath(e,n);if((0,On.existsSync)(r)){if(e.ref){await this.ensureGitRef(r,["fetch","origin",e.ref],"FETCH_HEAD");return}let i=await this.getLocalGitUpdateTarget(r);await this.ensureGitRef(r,i.fetchArgs,i.ref);return}let s=this.getGitInstallRoot(n);s&&this.ensureGitIgnore(s),(0,On.mkdirSync)((0,Sn.dirname)(r),{recursive:!0}),(0,On.rmSync)(this.getGitUpdateMarkerPath(r),{force:!0});try{await this.runCommand("git",["clone",e.repo,r]),e.ref&&await this.runCommand("git",["checkout",e.ref],{cwd:r});let i=(0,Sn.join)(r,"package.json");(0,On.existsSync)(i)&&await this.runNpmCommand(this.getGitDependencyInstallArgs(),{cwd:r})}catch(i){throw(0,On.rmSync)(r,{recursive:!0,force:!0}),this.pruneEmptyGitParents(r,s),i}}async updateGit(e,n){let r=this.getGitInstallPath(e,n);if(!(0,On.existsSync)(r)){await this.installGit(e,n);return}if(e.ref){await this.ensureGitRef(r,["fetch","origin",e.ref],"FETCH_HEAD");return}let s=await this.getLocalGitUpdateTarget(r);await this.ensureGitRef(r,s.fetchArgs,s.ref)}hasMissingGitDependencies(e){let n=(0,Sn.join)(e,"package.json");if(!(0,On.existsSync)(n))return!1;try{let r=JSON.parse(Mi((0,On.readFileSync)(n,"utf-8")));if(!r.dependencies||typeof r.dependencies!="object"||Array.isArray(r.dependencies))return!1;let s=(0,Sn.resolve)(e,"node_modules");return Object.keys(r.dependencies).some(i=>{let o=(0,Sn.resolve)(s,i);return o.startsWith(`${s}${Sn.sep}`)?!(0,On.existsSync)(o):!1})}catch{return!1}}async repairMissingGitDependencies(e){this.hasMissingGitDependencies(e)&&await this.runNpmCommand(this.getGitDependencyInstallArgs(),{cwd:e})}getGitUpdateMarkerPath(e){return(0,Sn.join)((0,Sn.dirname)(e),`.${(0,Sn.basename)(e)}.pi-update-incomplete`)}async cleanAndInstallGitDependencies(e,n){try{await this.runCommand("git",["clean","-fdx"],{cwd:e})}catch(s){throw await this.repairMissingGitDependencies(e).catch(()=>{}),s}let r=(0,Sn.join)(e,"package.json");(0,On.existsSync)(r)&&await this.runNpmCommand(this.getGitDependencyInstallArgs(),{cwd:e}),(0,On.rmSync)(n,{force:!0})}async ensureGitRef(e,n,r){await this.runCommand("git",n,{cwd:e});let s=await this.runCommandCapture("git",["rev-parse","HEAD"],{cwd:e,timeoutMs:pI}),i=`${r}^{commit}`,o=await this.runCommandCapture("git",["rev-parse",i],{cwd:e,timeoutMs:pI}),a=this.getGitUpdateMarkerPath(e);if(s.trim()===o.trim()){(0,On.existsSync)(a)?await this.cleanAndInstallGitDependencies(e,a):await this.repairMissingGitDependencies(e);return}(0,On.writeFileSync)(a,"","utf-8"),await this.runCommand("git",["reset","--hard",i],{cwd:e}),await this.cleanAndInstallGitDependencies(e,a)}async refreshTemporaryGitSource(e,n){if(!kL())try{await this.withProgress("pull",n,`Refreshing ${n}...`,async()=>{await this.updateGit(e,"temporary")})}catch{}}async removeGit(e,n){let r=this.getGitInstallPath(e,n);(0,On.rmSync)(r,{recursive:!0,force:!0}),(0,On.rmSync)(this.getGitUpdateMarkerPath(r),{force:!0}),this.pruneEmptyGitParents(r,this.getGitInstallRoot(n))}pruneEmptyGitParents(e,n){if(!n)return;let r=(0,Sn.resolve)(n),s=(0,Sn.dirname)(e);for(;s.startsWith(r)&&s!==r;){if(!(0,On.existsSync)(s)){s=(0,Sn.dirname)(s);continue}if((0,On.readdirSync)(s).length>0)break;try{(0,On.rmSync)(s,{recursive:!0,force:!0})}catch{break}s=(0,Sn.dirname)(s)}}ensureNpmProject(e){(0,On.existsSync)(e)||(0,On.mkdirSync)(e,{recursive:!0}),Xnn(e),this.ensureGitIgnore(e);let n=(0,Sn.join)(e,"package.json");(0,On.existsSync)(n)||(0,On.writeFileSync)(n,JSON.stringify({name:"pi-extensions",private:!0},null,2),"utf-8")}ensureGitIgnore(e){(0,On.existsSync)(e)||(0,On.mkdirSync)(e,{recursive:!0});let n=(0,Sn.join)(e,".gitignore");(0,On.existsSync)(n)||(0,On.writeFileSync)(n,`* +`):void 0}getRegisteredProviderConfig(e){return this.extensionProviders.get(e)}getRegisteredProviderIds(){return[...new Set([...this.extensionProviders.keys(),...this.nativeExtensionProviders.keys()])]}getRegisteredNativeProvider(e){return this.nativeExtensionProviders.get(e)}getCompatibilityRequestConfig(e){return l4n(e,this.config.getProvider(e.provider),this.extensionProviders.get(e.provider))}isUsingOAuth(e){return this.snapshot.auth.get(e)?.type==="oauth"}isUsingSubscription(e){return this.isUsingOAuth(e)&&this.models.getProvider(e)?.auth.oauth?.isSubscription===!0}hasConfiguredAuth(e){return this.snapshot.configuredProviders.has(e)}async getAuth(e,n={}){if(typeof e=="string")return this.models.getAuth(e,n);let r=await this.models.getAuth(e,n);if(!r)return;let i=c4n(e,this.config.getProvider(e.provider),this.extensionProviders.get(e.provider),{...r.env??{},...n.env??{}});return{...r,auth:{...r.auth,headers:Wjn(r.auth.headers,i)}}}enqueueCredentialOperation(e,n,r){let i=this.credentialOperations.get(e)??Promise.resolve(),s,o=new Promise(u=>{s=u}),a=(async()=>(await i.catch(()=>{}),n.throwIfAborted(),s?.(),r()))(),c=a.catch(()=>{});return this.credentialOperations.set(e,c),c.then(()=>{this.credentialOperations.get(e)===c&&this.credentialOperations.delete(e)}),vw(o,n).then(()=>a)}async synchronizeCredentialState(e,n,r,i){try{i.throwIfAborted(),this.recomposeProvider(e);let s=this.compositionErrors.get(e);if(s)throw new Error(s);let o=await this.models.refresh({allowNetwork:!1,providers:[e],signal:i});o.aborted&&i.throwIfAborted();let a=o.errors.get(e);if(a)throw a;this.updateModelSnapshot(),await this.refreshProviderAvailability(e,i)}catch(s){throw new SS(e,n,r,{cause:s})}}setRuntimeApiKey(e,n,r={}){let i=KQ(r.signal);return this.enqueueCredentialOperation(e,i,async()=>{this.credentials.setRuntimeApiKey(e,n),await this.synchronizeCredentialState(e,"setRuntimeApiKey",{type:"api_key",key:n},i)})}removeRuntimeApiKey(e,n={}){let r=KQ(n.signal);return this.enqueueCredentialOperation(e,r,async()=>{this.credentials.removeRuntimeApiKey(e),await this.synchronizeCredentialState(e,"removeRuntimeApiKey",void 0,r)})}listCredentials(e){return this.credentials.list(e)}getProviderAuthStatus(e){if(this.credentials.hasRuntimeApiKey(e))return{configured:!0,source:"runtime"};if(this.snapshot.storedProviders.has(e))return{configured:!0,source:"stored"};let n=emt(this.config.getProvider(e),this.extensionProviders.get(e));if(n)return n;let r=this.snapshot.auth.get(e);return r?{configured:!0,source:"environment",label:r.source}:{configured:!1}}async prepareRequest(e,n){let r=this.models.getProvider(e.provider);if(!r)throw new ko("provider",`Unknown provider: ${e.provider}`);let i=await this.getAuth(e,{apiKey:n?.apiKey,env:n?.env,signal:n?.signal});if(!i)throw new ko("auth",`Provider is not configured: ${e.provider}`);let{transformHeaders:s,...o}=n??{},a=o,c=Wjn(i.auth.headers,a.headers);s&&(c=await s(c??{}));let u=i.env||a.env?{...i.env??{},...a.env??{}}:void 0;return{provider:r,model:i.auth.baseUrl?{...e,baseUrl:i.auth.baseUrl}:e,options:{...a,apiKey:a.apiKey??i.auth.apiKey,headers:c,env:u}}}stream(e,n,r){let i=Id(n);return Th(e,async()=>{let s=await this.prepareRequest(e,r);return s.provider.stream(s.model,i,s.options)})}complete(e,n,r){return this.stream(e,n,r).result()}streamSimple(e,n,r){let i=Id(n);return Th(e,async()=>{let s=await this.prepareRequest(e,r);return s.provider.streamSimple(s.model,i,s.options)})}completeSimple(e,n,r){return this.streamSimple(e,n,r).result()}streamDeferred(e,n,r){return Th(e,async()=>{let i=await this.prepareRequest(e,r);if(!i.provider.fetchDeferred)throw new ko("provider",`Provider ${e.provider} does not support deferred responses`);return i.provider.fetchDeferred(i.model,n,i.options)})}async fetchDeferred(e,n,r){return this.streamDeferred(e,n,r).result()}async cancelDeferred(e,n,r){let i=await this.prepareRequest(e,r);if(!i.provider.cancelDeferred)throw new ko("provider",`Provider ${e.provider} does not support deferred responses`);await i.provider.cancelDeferred(i.model,n,i.options)}login(e,n,r){let i=KQ(r.signal);return this.enqueueCredentialOperation(e,i,async()=>{let s=await this.models.login(e,n,{...r,signal:i});return await this.synchronizeCredentialState(e,"login",s,i),s})}logout(e,n={}){let r=KQ(n.signal);return this.enqueueCredentialOperation(e,r,async()=>{await this.models.logout(e,{signal:r}),await this.synchronizeCredentialState(e,"logout",void 0,r)})}async refresh(e={}){if(this.config=await coe.load(this.modelsPath),this.configureRadiusProviders(),e.providers){for(let s of new Set(e.providers))this.recomposeProvider(s);this.updateModelSnapshot()}else this.rebuildProviders();let n={...e,allowNetwork:e.allowNetwork??this.modelNetworkEnabled},r=await this.models.refresh(n)??{aborted:n.signal?.aborted??!1,errors:new Map},i=new Map(r.errors);if(this.updateModelSnapshot(),e.providers)await Promise.all([...new Set(e.providers)].map(async s=>{try{await this.refreshProviderAvailability(s,KQ(e.signal))}catch(o){e.signal?.aborted||i.set(s,o instanceof Error?o:new Error(String(o)))}}));else try{await this.queueAvailabilityRefresh(e.signal)}catch{}return{aborted:r.aborted||(e.signal?.aborted??!1),errors:i}}registerNativeProvider(e){if(!e.id.trim())throw new Error("Provider id must not be empty.");this.extensionProviders.delete(e.id),this.nativeExtensionProviders.set(e.id,e),this.recomposeProvider(e.id),this.updateModelSnapshot(),this.refresh({allowNetwork:!1})}registerProvider(e,n){o4n(e,this.builtins.get(e),this.config.getProvider(e),n),this.nativeExtensionProviders.delete(e);let i={...this.extensionProviders.get(e)};for(let[s,o]of Object.entries(n))o!==void 0&&(i[s]=o);if(this.extensionProviders.set(e,i),this.recomposeProvider(e),this.updateModelSnapshot(),this.snapshot.storedProviders.has(e)||emt(this.config.getProvider(e),i)?.configured){let s=new Set(this.snapshot.configuredProviders).add(e),o=new Map(this.snapshot.auth);o.get(e)||o.set(e,{type:i.oauth&&!i.apiKey?"oauth":"api_key",source:"configured provider"}),this.snapshot={...this.snapshot,auth:o,configuredProviders:s,available:this.snapshot.all.filter(a=>s.has(a.provider))}}this.refresh({allowNetwork:!1})}unregisterProvider(e){this.extensionProviders.delete(e),this.nativeExtensionProviders.delete(e),this.recomposeProvider(e),this.updateModelSnapshot(),this.refresh({allowNetwork:!1})}}});var cY=re((fBc,Hjn)=>{"use strict";p();var a6i="2.0.0",c6i=Number.MAX_SAFE_INTEGER||9007199254740991,l6i=16,u6i=250,d6i=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Hjn.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:l6i,MAX_SAFE_BUILD_LENGTH:u6i,MAX_SAFE_INTEGER:c6i,RELEASE_TYPES:d6i,SEMVER_SPEC_VERSION:a6i,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var uoe=re((ABc,qjn)=>{"use strict";p();var p6i=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};qjn.exports=p6i});var lY=re((kw,jjn)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:Aht,MAX_SAFE_BUILD_LENGTH:m6i,MAX_LENGTH:h6i}=cY(),f6i=uoe();kw=jjn.exports={};var g6i=kw.re=[],A6i=kw.safeRe=[],gr=kw.src=[],y6i=kw.safeSrc=[],Ar=kw.t={},E6i=0,yht="[a-zA-Z0-9-]",b6i=[["\\s",1],["\\d",h6i],[yht,m6i]],_6i=t=>{for(let[e,n]of b6i)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},Ss=(t,e,n)=>{let r=_6i(e),i=E6i++;f6i(t,i,e),Ar[t]=i,gr[i]=e,y6i[i]=r,g6i[i]=new RegExp(e,n?"g":void 0),A6i[i]=new RegExp(r,n?"g":void 0)};Ss("NUMERICIDENTIFIER","0|[1-9]\\d*");Ss("NUMERICIDENTIFIERLOOSE","\\d+");Ss("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${yht}*`);Ss("MAINVERSION",`(${gr[Ar.NUMERICIDENTIFIER]})\\.(${gr[Ar.NUMERICIDENTIFIER]})\\.(${gr[Ar.NUMERICIDENTIFIER]})`);Ss("MAINVERSIONLOOSE",`(${gr[Ar.NUMERICIDENTIFIERLOOSE]})\\.(${gr[Ar.NUMERICIDENTIFIERLOOSE]})\\.(${gr[Ar.NUMERICIDENTIFIERLOOSE]})`);Ss("PRERELEASEIDENTIFIER",`(?:${gr[Ar.NONNUMERICIDENTIFIER]}|${gr[Ar.NUMERICIDENTIFIER]})`);Ss("PRERELEASEIDENTIFIERLOOSE",`(?:${gr[Ar.NONNUMERICIDENTIFIER]}|${gr[Ar.NUMERICIDENTIFIERLOOSE]})`);Ss("PRERELEASE",`(?:-(${gr[Ar.PRERELEASEIDENTIFIER]}(?:\\.${gr[Ar.PRERELEASEIDENTIFIER]})*))`);Ss("PRERELEASELOOSE",`(?:-?(${gr[Ar.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${gr[Ar.PRERELEASEIDENTIFIERLOOSE]})*))`);Ss("BUILDIDENTIFIER",`${yht}+`);Ss("BUILD",`(?:\\+(${gr[Ar.BUILDIDENTIFIER]}(?:\\.${gr[Ar.BUILDIDENTIFIER]})*))`);Ss("FULLPLAIN",`v?${gr[Ar.MAINVERSION]}${gr[Ar.PRERELEASE]}?${gr[Ar.BUILD]}?`);Ss("FULL",`^${gr[Ar.FULLPLAIN]}$`);Ss("LOOSEPLAIN",`[v=\\s]*${gr[Ar.MAINVERSIONLOOSE]}${gr[Ar.PRERELEASELOOSE]}?${gr[Ar.BUILD]}?`);Ss("LOOSE",`^${gr[Ar.LOOSEPLAIN]}$`);Ss("GTLT","((?:<|>)?=?)");Ss("XRANGEIDENTIFIERLOOSE",`${gr[Ar.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Ss("XRANGEIDENTIFIER",`${gr[Ar.NUMERICIDENTIFIER]}|x|X|\\*`);Ss("XRANGEPLAIN",`[v=\\s]*(${gr[Ar.XRANGEIDENTIFIER]})(?:\\.(${gr[Ar.XRANGEIDENTIFIER]})(?:\\.(${gr[Ar.XRANGEIDENTIFIER]})(?:${gr[Ar.PRERELEASE]})?${gr[Ar.BUILD]}?)?)?`);Ss("XRANGEPLAINLOOSE",`[v=\\s]*(${gr[Ar.XRANGEIDENTIFIERLOOSE]})(?:\\.(${gr[Ar.XRANGEIDENTIFIERLOOSE]})(?:\\.(${gr[Ar.XRANGEIDENTIFIERLOOSE]})(?:${gr[Ar.PRERELEASELOOSE]})?${gr[Ar.BUILD]}?)?)?`);Ss("XRANGE",`^${gr[Ar.GTLT]}\\s*${gr[Ar.XRANGEPLAIN]}$`);Ss("XRANGELOOSE",`^${gr[Ar.GTLT]}\\s*${gr[Ar.XRANGEPLAINLOOSE]}$`);Ss("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Aht}})(?:\\.(\\d{1,${Aht}}))?(?:\\.(\\d{1,${Aht}}))?`);Ss("COERCE",`${gr[Ar.COERCEPLAIN]}(?:$|[^\\d])`);Ss("COERCEFULL",gr[Ar.COERCEPLAIN]+`(?:${gr[Ar.PRERELEASE]})?(?:${gr[Ar.BUILD]})?(?:$|[^\\d])`);Ss("COERCERTL",gr[Ar.COERCE],!0);Ss("COERCERTLFULL",gr[Ar.COERCEFULL],!0);Ss("LONETILDE","(?:~>?)");Ss("TILDETRIM",`(\\s*)${gr[Ar.LONETILDE]}\\s+`,!0);kw.tildeTrimReplace="$1~";Ss("TILDE",`^${gr[Ar.LONETILDE]}${gr[Ar.XRANGEPLAIN]}$`);Ss("TILDELOOSE",`^${gr[Ar.LONETILDE]}${gr[Ar.XRANGEPLAINLOOSE]}$`);Ss("LONECARET","(?:\\^)");Ss("CARETTRIM",`(\\s*)${gr[Ar.LONECARET]}\\s+`,!0);kw.caretTrimReplace="$1^";Ss("CARET",`^${gr[Ar.LONECARET]}${gr[Ar.XRANGEPLAIN]}$`);Ss("CARETLOOSE",`^${gr[Ar.LONECARET]}${gr[Ar.XRANGEPLAINLOOSE]}$`);Ss("COMPARATORLOOSE",`^${gr[Ar.GTLT]}\\s*(${gr[Ar.LOOSEPLAIN]})$|^$`);Ss("COMPARATOR",`^${gr[Ar.GTLT]}\\s*(${gr[Ar.FULLPLAIN]})$|^$`);Ss("COMPARATORTRIM",`(\\s*)${gr[Ar.GTLT]}\\s*(${gr[Ar.LOOSEPLAIN]}|${gr[Ar.XRANGEPLAIN]})`,!0);kw.comparatorTrimReplace="$1$2$3";Ss("HYPHENRANGE",`^\\s*(${gr[Ar.XRANGEPLAIN]})\\s+-\\s+(${gr[Ar.XRANGEPLAIN]})\\s*$`);Ss("HYPHENRANGELOOSE",`^\\s*(${gr[Ar.XRANGEPLAINLOOSE]})\\s+-\\s+(${gr[Ar.XRANGEPLAINLOOSE]})\\s*$`);Ss("STAR","(<|>)?=?\\s*\\*");Ss("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Ss("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var cBe=re((bBc,Vjn)=>{"use strict";p();var x6i=Object.freeze({loose:!0}),S6i=Object.freeze({}),C6i=t=>t?typeof t!="object"?x6i:t:S6i;Vjn.exports=C6i});var Eht=re((xBc,Kjn)=>{"use strict";p();var Yjn=/^[0-9]+$/,zjn=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tzjn(e,t);Kjn.exports={compareIdentifiers:zjn,rcompareIdentifiers:I6i}});var oh=re((CBc,Xjn)=>{"use strict";p();var lBe=uoe(),{MAX_LENGTH:Jjn,MAX_SAFE_INTEGER:uBe}=cY(),{safeRe:dBe,t:pBe}=lY(),w6i=cBe(),{compareIdentifiers:bht}=Eht(),T6i=(t,e)=>{let n=e.split(".");if(n.length>t.length)return!1;for(let r=0;rJjn)throw new TypeError(`version is longer than ${Jjn} characters`);lBe("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?dBe[pBe.LOOSE]:dBe[pBe.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>uBe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>uBe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>uBe||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&se.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],i=e.prerelease[n];if(lBe("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return bht(r,i)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],i=e.build[n];if(lBe("build compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return bht(r,i)}while(++n)}inc(e,n,r){if(e.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let i=`-${n}`.match(this.options.loose?dBe[pBe.PRERELEASELOOSE]:dBe[pBe.PRERELEASE]);if(!i||i[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let s=[n,i];if(r===!1&&(s=[n]),T6i(this.prerelease,n)){let o=this.prerelease[n.split(".").length];isNaN(o)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Xjn.exports=_ht});var uP=re((wBc,eVn)=>{"use strict";p();var Zjn=oh(),v6i=(t,e,n=!1)=>{if(t instanceof Zjn)return t;try{return new Zjn(t,e)}catch(r){if(!n)return null;throw r}};eVn.exports=v6i});var nVn=re((vBc,tVn)=>{"use strict";p();var R6i=uP(),k6i=(t,e)=>{let n=R6i(t,e);return n?n.version:null};tVn.exports=k6i});var iVn=re((kBc,rVn)=>{"use strict";p();var B6i=uP(),N6i=(t,e)=>{let n=B6i(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};rVn.exports=N6i});var aVn=re((NBc,oVn)=>{"use strict";p();var sVn=oh(),D6i=(t,e,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new sVn(t instanceof sVn?t.version:t,n).inc(e,r,i).version}catch{return null}};oVn.exports=D6i});var uVn=re((PBc,lVn)=>{"use strict";p();var cVn=uP(),P6i=(t,e)=>{let n=cVn(t,null,!0),r=cVn(e,null,!0),i=n.compare(r);if(i===0)return null;let s=i>0,o=s?n:r,a=s?r:n,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return n.major!==r.major?l+"major":n.minor!==r.minor?l+"minor":n.patch!==r.patch?l+"patch":"prerelease"};lVn.exports=P6i});var pVn=re((OBc,dVn)=>{"use strict";p();var M6i=oh(),O6i=(t,e)=>new M6i(t,e).major;dVn.exports=O6i});var hVn=re((FBc,mVn)=>{"use strict";p();var L6i=oh(),F6i=(t,e)=>new L6i(t,e).minor;mVn.exports=F6i});var gVn=re((UBc,fVn)=>{"use strict";p();var Q6i=oh(),U6i=(t,e)=>new Q6i(t,e).patch;fVn.exports=U6i});var yVn=re(($Bc,AVn)=>{"use strict";p();var G6i=uP(),$6i=(t,e)=>{let n=G6i(t,e);return n&&n.prerelease.length?n.prerelease:null};AVn.exports=$6i});var Ub=re((HBc,bVn)=>{"use strict";p();var EVn=oh(),W6i=(t,e,n)=>new EVn(t,n).compare(new EVn(e,n));bVn.exports=W6i});var xVn=re((jBc,_Vn)=>{"use strict";p();var H6i=Ub(),q6i=(t,e,n)=>H6i(e,t,n);_Vn.exports=q6i});var CVn=re((YBc,SVn)=>{"use strict";p();var j6i=Ub(),V6i=(t,e)=>j6i(t,e,!0);SVn.exports=V6i});var mBe=re((KBc,wVn)=>{"use strict";p();var IVn=oh(),Y6i=(t,e,n)=>{let r=new IVn(t,n),i=new IVn(e,n);return r.compare(i)||r.compareBuild(i)};wVn.exports=Y6i});var vVn=re((XBc,TVn)=>{"use strict";p();var z6i=mBe(),K6i=(t,e)=>t.sort((n,r)=>z6i(n,r,e));TVn.exports=K6i});var kVn=re((eNc,RVn)=>{"use strict";p();var J6i=mBe(),X6i=(t,e)=>t.sort((n,r)=>J6i(r,n,e));RVn.exports=X6i});var doe=re((nNc,BVn)=>{"use strict";p();var Z6i=Ub(),ezi=(t,e,n)=>Z6i(t,e,n)>0;BVn.exports=ezi});var hBe=re((iNc,NVn)=>{"use strict";p();var tzi=Ub(),nzi=(t,e,n)=>tzi(t,e,n)<0;NVn.exports=nzi});var xht=re((oNc,DVn)=>{"use strict";p();var rzi=Ub(),izi=(t,e,n)=>rzi(t,e,n)===0;DVn.exports=izi});var Sht=re((cNc,PVn)=>{"use strict";p();var szi=Ub(),ozi=(t,e,n)=>szi(t,e,n)!==0;PVn.exports=ozi});var fBe=re((uNc,MVn)=>{"use strict";p();var azi=Ub(),czi=(t,e,n)=>azi(t,e,n)>=0;MVn.exports=czi});var gBe=re((pNc,OVn)=>{"use strict";p();var lzi=Ub(),uzi=(t,e,n)=>lzi(t,e,n)<=0;OVn.exports=uzi});var Cht=re((hNc,LVn)=>{"use strict";p();var dzi=xht(),pzi=Sht(),mzi=doe(),hzi=fBe(),fzi=hBe(),gzi=gBe(),Azi=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return dzi(t,n,r);case"!=":return pzi(t,n,r);case">":return mzi(t,n,r);case">=":return hzi(t,n,r);case"<":return fzi(t,n,r);case"<=":return gzi(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};LVn.exports=Azi});var QVn=re((gNc,FVn)=>{"use strict";p();var yzi=oh(),Ezi=uP(),{safeRe:ABe,t:yBe}=lY(),bzi=(t,e)=>{if(t instanceof yzi)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?ABe[yBe.COERCEFULL]:ABe[yBe.COERCE]);else{let c=e.includePrerelease?ABe[yBe.COERCERTLFULL]:ABe[yBe.COERCERTL],u;for(;(u=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||u.index+u[0].length!==n.index+n[0].length)&&(n=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(n===null)return null;let r=n[2],i=n[3]||"0",s=n[4]||"0",o=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return Ezi(`${r}.${i}.${s}${o}${a}`,e)};FVn.exports=bzi});var GVn=re((yNc,UVn)=>{"use strict";p();var _zi=uP(),xzi=cY(),Szi=oh(),Czi=(t,e,n)=>{if(!xzi.RELEASE_TYPES.includes(e))return null;let r=Izi(t,n);return r&&wzi(r,e)},Izi=(t,e)=>{let n=t instanceof Szi?t.version:t;return _zi(n,e)},wzi=(t,e)=>{if(Tzi(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},Tzi=t=>t.startsWith("pre");UVn.exports=Czi});var WVn=re((bNc,$Vn)=>{"use strict";p();var Iht=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,n)}return this}};$Vn.exports=Iht});var Gb=re((xNc,VVn)=>{"use strict";p();var vzi=/\s+/g,wht=class t{constructor(e,n){if(n=kzi(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof Tht)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(vzi," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!qVn(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Qzi(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let n=this.set[e];for(let r=0;r0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Fzi,"");let r=((this.options.includePrerelease&&Ozi)|(this.options.loose&&Lzi))+":"+e,i=HVn.get(r);if(i)return i;let s=this.options.loose,o=s?Ig[ah.HYPHENRANGELOOSE]:Ig[ah.HYPHENRANGE];e=e.replace(o,Kzi(this.options.includePrerelease)),dl("hyphen replace",e),e=e.replace(Ig[ah.COMPARATORTRIM],Dzi),dl("comparator trim",e),e=e.replace(Ig[ah.TILDETRIM],Pzi),dl("tilde trim",e),e=e.replace(Ig[ah.CARETTRIM],Mzi),dl("caret trim",e);let a=e.split(" ").map(d=>Uzi(d,this.options)).join(" ").split(/\s+/).map(d=>zzi(d,this.options));s&&(a=a.filter(d=>(dl("loose invalid filter",d,this.options),!!d.match(Ig[ah.COMPARATORLOOSE])))),dl("range list",a);let c=new Map,u=a.map(d=>new Tht(d,this.options));for(let d of u){if(qVn(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return HVn.set(r,l),l}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(r=>jVn(r,n)&&e.set.some(i=>jVn(i,n)&&r.every(s=>i.every(o=>s.intersects(o,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Bzi(e,this.options)}catch{return!1}for(let n=0;nt.value==="<0.0.0-0",Qzi=t=>t.value==="",jVn=(t,e)=>{let n=!0,r=t.slice(),i=r.pop();for(;n&&r.length;)n=r.every(s=>i.intersects(s,e)),i=r.pop();return n},Uzi=(t,e)=>(t=t.replace(Ig[ah.BUILD],""),dl("comp",t,e),t=Hzi(t,e),dl("caret",t),t=$zi(t,e),dl("tildes",t),t=jzi(t,e),dl("xrange",t),t=Yzi(t,e),dl("stars",t),t),Ep=t=>!t||t.toLowerCase()==="x"||t==="*",Gzi=(t,e,n)=>Ep(t)&&!Ep(e)||Ep(e)&&n&&!Ep(n),$zi=(t,e)=>t.trim().split(/\s+/).map(n=>Wzi(n,e)).join(" "),Wzi=(t,e)=>{let n=e.loose?Ig[ah.TILDELOOSE]:Ig[ah.TILDE],r=e.includePrerelease?"-0":"";return t.replace(n,(i,s,o,a,c)=>{dl("tilde",t,i,s,o,a,c);let u;return Ep(s)?u="":Ep(o)?u=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Ep(a)?u=`>=${s}.${o}.0${r} <${s}.${+o+1}.0-0`:c?(dl("replaceTilde pr",c),u=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`):u=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`,dl("tilde return",u),u})},Hzi=(t,e)=>t.trim().split(/\s+/).map(n=>qzi(n,e)).join(" "),qzi=(t,e)=>{dl("caret",t,e);let n=e.loose?Ig[ah.CARETLOOSE]:Ig[ah.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(i,s,o,a,c)=>{dl("caret",t,i,s,o,a,c);let u;return Ep(s)?u="":Ep(o)?u=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Ep(a)?s==="0"?u=`>=${s}.${o}.0${r} <${s}.${+o+1}.0-0`:u=`>=${s}.${o}.0${r} <${+s+1}.0.0-0`:c?(dl("replaceCaret pr",c),s==="0"?o==="0"?u=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`:u=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`:u=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`):(dl("no pr"),s==="0"?o==="0"?u=`>=${s}.${o}.${a} <${s}.${o}.${+a+1}-0`:u=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`:u=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),dl("caret return",u),u})},jzi=(t,e)=>(dl("replaceXRanges",t,e),t.split(/\s+/).map(n=>Vzi(n,e)).join(" ")),Vzi=(t,e)=>{t=t.trim();let n=e.loose?Ig[ah.XRANGELOOSE]:Ig[ah.XRANGE];return t.replace(n,(r,i,s,o,a,c)=>{if(dl("xRange",t,r,i,s,o,a,c),Gzi(s,o,a))return t;let u=Ep(s),l=u||Ep(o),d=l||Ep(a),m=d;return i==="="&&m&&(i=""),c=e.includePrerelease?"-0":"",u?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&m?(l&&(o=0),a=0,i===">"?(i=">=",l?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",l?s=+s+1:o=+o+1),i==="<"&&(c="-0"),r=`${i+s}.${o}.${a}${c}`):l?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`),dl("xRange return",r),r})},Yzi=(t,e)=>(dl("replaceStars",t,e),t.trim().replace(Ig[ah.STAR],"")),zzi=(t,e)=>(dl("replaceGTE0",t,e),t.trim().replace(Ig[e.includePrerelease?ah.GTE0PRE:ah.GTE0],"")),Kzi=t=>(e,n,r,i,s,o,a,c,u,l,d,m)=>(Ep(r)?n="":Ep(i)?n=`>=${r}.0.0${t?"-0":""}`:Ep(s)?n=`>=${r}.${i}.0${t?"-0":""}`:o?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,Ep(u)?c="":Ep(l)?c=`<${+u+1}.0.0-0`:Ep(d)?c=`<${u}.${+l+1}.0-0`:m?c=`<=${u}.${l}.${d}-${m}`:t?c=`<${u}.${l}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),Jzi=(t,e,n)=>{for(let r=0;r0){let i=t[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var poe=re((CNc,ZVn)=>{"use strict";p();var moe=Symbol("SemVer ANY"),kht=class t{static get ANY(){return moe}constructor(e,n){if(n=YVn(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Rht("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===moe?this.value="":this.value=this.operator+this.semver.version,Rht("comp",this)}parse(e){let n=this.options.loose?zVn[KVn.COMPARATORLOOSE]:zVn[KVn.COMPARATOR],r=e.match(n);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new JVn(r[2],this.options.loose):this.semver=moe}toString(){return this.value}test(e){if(Rht("Comparator.test",e,this.options.loose),this.semver===moe||e===moe)return!0;if(typeof e=="string")try{e=new JVn(e,this.options)}catch{return!1}return vht(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new XVn(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new XVn(this.value,n).test(e.semver):(n=YVn(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||vht(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||vht(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};ZVn.exports=kht;var YVn=cBe(),{safeRe:zVn,t:KVn}=lY(),vht=Cht(),Rht=uoe(),JVn=oh(),XVn=Gb()});var hoe=re((wNc,eYn)=>{"use strict";p();var Xzi=Gb(),Zzi=(t,e,n)=>{try{e=new Xzi(e,n)}catch{return!1}return e.test(t)};eYn.exports=Zzi});var nYn=re((vNc,tYn)=>{"use strict";p();var e7i=Gb(),t7i=(t,e)=>new e7i(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));tYn.exports=t7i});var iYn=re((kNc,rYn)=>{"use strict";p();var n7i=oh(),r7i=Gb(),i7i=(t,e,n)=>{let r=null,i=null,s=null;try{s=new r7i(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===-1)&&(r=o,i=new n7i(r,n))}),r};rYn.exports=i7i});var oYn=re((NNc,sYn)=>{"use strict";p();var s7i=oh(),o7i=Gb(),a7i=(t,e,n)=>{let r=null,i=null,s=null;try{s=new o7i(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===1)&&(r=o,i=new s7i(r,n))}),r};sYn.exports=a7i});var lYn=re((PNc,cYn)=>{"use strict";p();var Bht=oh(),c7i=Gb(),aYn=doe(),l7i=(t,e)=>{t=new c7i(t,e);let n=new Bht("0.0.0");if(t.test(n)||(n=new Bht("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r{let a=new Bht(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||aYn(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!n||aYn(n,s))&&(n=s)}return n&&t.test(n)?n:null};cYn.exports=l7i});var dYn=re((ONc,uYn)=>{"use strict";p();var u7i=Gb(),d7i=(t,e)=>{try{return new u7i(t,e).range||"*"}catch{return null}};uYn.exports=d7i});var EBe=re((FNc,fYn)=>{"use strict";p();var p7i=oh(),hYn=poe(),{ANY:m7i}=hYn,h7i=Gb(),f7i=hoe(),pYn=doe(),mYn=hBe(),g7i=gBe(),A7i=fBe(),y7i=(t,e,n,r)=>{t=new p7i(t,r),e=new h7i(e,r);let i,s,o,a,c;switch(n){case">":i=pYn,s=g7i,o=mYn,a=">",c=">=";break;case"<":i=mYn,s=A7i,o=pYn,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(f7i(t,e,r))return!1;for(let u=0;u{h.semver===m7i&&(h=new hYn(">=0.0.0")),d=d||h,m=m||h,i(h.semver,d.semver,r)?d=h:o(h.semver,m.semver,r)&&(m=h)}),d.operator===a||d.operator===c||(!m.operator||m.operator===a)&&s(t,m.semver))return!1;if(m.operator===c&&o(t,m.semver))return!1}return!0};fYn.exports=y7i});var AYn=re((UNc,gYn)=>{"use strict";p();var E7i=EBe(),b7i=(t,e,n)=>E7i(t,e,">",n);gYn.exports=b7i});var EYn=re(($Nc,yYn)=>{"use strict";p();var _7i=EBe(),x7i=(t,e,n)=>_7i(t,e,"<",n);yYn.exports=x7i});var xYn=re((HNc,_Yn)=>{"use strict";p();var bYn=Gb(),S7i=(t,e,n)=>(t=new bYn(t,n),e=new bYn(e,n),t.intersects(e,n));_Yn.exports=S7i});var CYn=re((jNc,SYn)=>{"use strict";p();var C7i=hoe(),I7i=Ub();SYn.exports=(t,e,n)=>{let r=[],i=null,s=null,o=t.sort((l,d)=>I7i(l,d,n));for(let l of o)C7i(l,e,n)?(s=l,i||(i=l)):(s&&r.push([i,s]),s=null,i=null);i&&r.push([i,null]);let a=[];for(let[l,d]of r)l===d?a.push(l):!d&&l===o[0]?a.push("*"):d?l===o[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length{"use strict";p();var IYn=Gb(),Pht=poe(),{ANY:Nht}=Pht,Dht=hoe(),Mht=Ub(),w7i=(t,e,n={})=>{if(t===e)return!0;t=new IYn(t,n),e=new IYn(e,n);let r=!1;e:for(let i of t.set){for(let s of e.set){let o=v7i(i,s,n);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},T7i=[new Pht(">=0.0.0-0")],wYn=[new Pht(">=0.0.0")],v7i=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Nht){if(e.length===1&&e[0].semver===Nht)return!0;n.includePrerelease?t=T7i:t=wYn}if(e.length===1&&e[0].semver===Nht){if(n.includePrerelease)return!0;e=wYn}let r=new Set,i,s;for(let h of t)h.operator===">"||h.operator===">="?i=TYn(i,h,n):h.operator==="<"||h.operator==="<="?s=vYn(s,h,n):r.add(h.semver);if(r.size>1)return null;let o;if(i&&s){if(o=Mht(i.semver,s.semver,n),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let h of r){if(i&&!Dht(h,String(i),n)||s&&!Dht(h,String(s),n))return null;for(let f of e)if(!Dht(h,String(f),n))return!1;return!0}let a,c,u,l,d=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let h of e){if(l=l||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",i){if(m&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===m.major&&h.semver.minor===m.minor&&h.semver.patch===m.patch&&(m=!1),h.operator===">"||h.operator===">="){if(a=TYn(i,h,n),a===h&&a!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(s){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(c=vYn(s,h,n),c===h&&c!==s)return!1}else if(s.operator==="<="&&!h.test(s.semver))return!1}if(!h.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&l&&!i&&o!==0||m||d)},TYn=(t,e,n)=>{if(!t)return e;let r=Mht(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},vYn=(t,e,n)=>{if(!t)return e;let r=Mht(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};RYn.exports=w7i});var Lht=re((KNc,DYn)=>{"use strict";p();var Oht=lY(),BYn=cY(),R7i=oh(),NYn=Eht(),k7i=uP(),B7i=nVn(),N7i=iVn(),D7i=aVn(),P7i=uVn(),M7i=pVn(),O7i=hVn(),L7i=gVn(),F7i=yVn(),Q7i=Ub(),U7i=xVn(),G7i=CVn(),$7i=mBe(),W7i=vVn(),H7i=kVn(),q7i=doe(),j7i=hBe(),V7i=xht(),Y7i=Sht(),z7i=fBe(),K7i=gBe(),J7i=Cht(),X7i=QVn(),Z7i=GVn(),eKi=poe(),tKi=Gb(),nKi=hoe(),rKi=nYn(),iKi=iYn(),sKi=oYn(),oKi=lYn(),aKi=dYn(),cKi=EBe(),lKi=AYn(),uKi=EYn(),dKi=xYn(),pKi=CYn(),mKi=kYn();DYn.exports={parse:k7i,valid:B7i,clean:N7i,inc:D7i,diff:P7i,major:M7i,minor:O7i,patch:L7i,prerelease:F7i,compare:Q7i,rcompare:U7i,compareLoose:G7i,compareBuild:$7i,sort:W7i,rsort:H7i,gt:q7i,lt:j7i,eq:V7i,neq:Y7i,gte:z7i,lte:K7i,cmp:J7i,coerce:X7i,truncate:Z7i,Comparator:eKi,Range:tKi,satisfies:nKi,toComparators:rKi,maxSatisfying:iKi,minSatisfying:sKi,minVersion:oKi,validRange:aKi,outside:cKi,gtr:lKi,ltr:uKi,intersects:dKi,simplifyRange:pKi,subset:mKi,SemVer:R7i,re:Oht.re,src:Oht.src,tokens:Oht.t,SEMVER_SPEC_VERSION:BYn.SEMVER_SPEC_VERSION,RELEASE_TYPES:BYn.RELEASE_TYPES,compareIdentifiers:NYn.compareIdentifiers,rcompareIdentifiers:NYn.rcompareIdentifiers}});var QYn=re(_Be=>{"use strict";p();var MYn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hKi=MYn(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tracing=t.metrics=void 0;var e=require("node:diagnostics_channel");t.metrics=(0,e.channel)("lru-cache:metrics"),t.tracing=(0,e.tracingChannel)("lru-cache")}),fKi=MYn(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultPerf=void 0,t.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(_Be,"__esModule",{value:!0});_Be.LRUCache=void 0;var Lu=hKi(),gKi=fKi(),Fht=()=>Lu.metrics.hasSubscribers||Lu.tracing.hasSubscribers,OYn=new Set,PYn=typeof process=="object"&&process?process:{},AKi=(t,e,n,r)=>{typeof PYn.emitWarning=="function"?PYn.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},yKi=t=>!OYn.has(t),dP=t=>!!t&&t===Math.floor(t)&&t>0&&isFinite(t),LYn=t=>dP(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?bBe:null:null,bBe=class extends Array{constructor(t){super(t),this.fill(0)}},EKi=class foe{heap;length;static#e=!1;static create(e){let n=LYn(e);if(!n)return[];foe.#e=!0;let r=new foe(e,n);return foe.#e=!1,r}constructor(e,n){if(!foe.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},bKi=class FYn{#e;#t;#n;#r;#i;#s;#o;#a;get perf(){return this.#a}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#c;#l;#d;#p;#u;#h;#f;#A;#g;#x;#y;#S;#C;#E;#b;#I;#L;#_;#N;static unsafeExposeInternals(e){return{starts:e.#C,ttls:e.#E,autopurgeTimers:e.#b,sizes:e.#S,keyMap:e.#d,keyList:e.#p,valList:e.#u,next:e.#h,prev:e.#f,get head(){return e.#A},get tail(){return e.#g},free:e.#x,isBackgroundFetch:n=>e.#m(n),backgroundFetch:(n,r,i,s)=>e.#U(n,r,i,s),moveToTail:n=>e.#O(n),indexes:n=>e.#T(n),rindexes:n=>e.#v(n),isStale:n=>e.#w(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#s}get memoMethod(){return this.#o}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:u,onInsert:l,disposeAfter:d,noDisposeOnSet:m,noUpdateTTL:h,maxSize:f=0,maxEntrySize:g=0,sizeCalculation:A,fetchMethod:y,memoMethod:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:I,ignoreFetchAbort:w,backgroundFetchSize:k=1,perf:N}=e;if(this.backgroundFetchSize=k,N!==void 0&&typeof N?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#a=N??gKi.defaultPerf,n!==0&&!dP(n))throw new TypeError("max option must be a nonnegative integer");let O=n?LYn(n):Array;if(!O)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=f,this.maxEntrySize=g||this.#t,this.sizeCalculation=A,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=E,y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=y,this.#L=!!y,this.#d=new Map,this.#p=Array.from({length:n}).fill(void 0),this.#u=Array.from({length:n}).fill(void 0),this.#h=new O(n),this.#f=new O(n),this.#A=0,this.#g=0,this.#x=EKi.create(n),this.#c=0,this.#l=0,typeof u=="function"&&(this.#n=u),typeof l=="function"&&(this.#r=l),typeof d=="function"?(this.#i=d,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#I=!!this.#n,this.#N=!!this.#r,this.#_=!!this.#i,this.noDisposeOnSet=!!m,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!w,this.maxEntrySize!==0){if(this.#t!==0&&!dP(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!dP(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#Y()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=dP(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!dP(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#G()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let W="LRU_CACHE_UNBOUNDED";yKi(W)&&(OYn.add(W),AKi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",W,FYn))}}getRemainingTTL(e){return this.#d.has(e)?1/0:0}#G(){let e=new bBe(this.#e),n=new bBe(this.#e);this.#E=e,this.#C=n;let r=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#b=r,this.#$=(c,u,l=this.#a.now())=>{n[c]=u!==0?l:0,e[c]=u,i(c,u)},this.#D=c=>{n[c]=e[c]!==0?this.#a.now():0,i(c,e[c])};let i=this.ttlAutopurge?(c,u)=>{if(r?.[c]&&(clearTimeout(r[c]),r[c]=void 0),u&&u!==0&&r){let l=setTimeout(()=>{this.#w(c)?(this.#R(this.#p[c],"expire"),r[c]=void 0):i(c,a(c))},u+1);l.unref&&l.unref(),r[c]=l}}:()=>{};this.#k=(c,u)=>{if(e[u]){let l=e[u],d=n[u];if(!l||!d)return;c.ttl=l,c.start=d,c.now=s||o();let m=c.now-d;c.remainingTTL=l-m}};let s=0,o=()=>{let c=this.#a.now();if(this.ttlResolution>0){s=c;let u=setTimeout(()=>s=0,this.ttlResolution);u.unref&&u.unref()}return c};this.getRemainingTTL=c=>{let u=this.#d.get(c);return u===void 0?0:a(u)};let a=c=>{let u=e[c],l=n[c];if(!u||!l)return 1/0;let d=(s||o())-l;return u-d};this.#w=c=>{let u=n[c],l=e[c];return!!l&&!!u&&(s||o())-u>l}}#D=()=>{};#k=()=>{};#$=()=>{};#w=()=>!1;#Y(){let e=new bBe(this.#e);this.#l=0,this.#S=e,this.#P=n=>{this.#l-=e[n],e[n]=0},this.#W=(n,r,i,s)=>{if(!dP(i)){if(this.#m(r))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!dP(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#F=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#l>s;)this.#Q(!0)}this.#l+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#l)}}#P=e=>{};#F=(e,n,r)=>{};#W=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:e=this.allowStale}={}){if(this.#c)for(let n=this.#g;this.#H(n)&&((e||!this.#w(n))&&(yield n),n!==this.#A);)n=this.#f[n]}*#v({allowStale:e=this.allowStale}={}){if(this.#c)for(let n=this.#A;this.#H(n)&&((e||!this.#w(n))&&(yield n),n!==this.#g);)n=this.#h[n]}#H(e){return e!==void 0&&this.#d.get(this.#p[e])===e}*entries(){for(let e of this.#T())this.#u[e]!==void 0&&this.#p[e]!==void 0&&!this.#m(this.#u[e])&&(yield[this.#p[e],this.#u[e]])}*rentries(){for(let e of this.#v())this.#u[e]!==void 0&&this.#p[e]!==void 0&&!this.#m(this.#u[e])&&(yield[this.#p[e],this.#u[e]])}*keys(){for(let e of this.#T()){let n=this.#p[e];n!==void 0&&!this.#m(this.#u[e])&&(yield n)}}*rkeys(){for(let e of this.#v()){let n=this.#p[e];n!==void 0&&!this.#m(this.#u[e])&&(yield n)}}*values(){for(let e of this.#T())this.#u[e]!==void 0&&!this.#m(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#v())this.#u[e]!==void 0&&!this.#m(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#T()){let i=this.#u[r],s=this.#m(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#p[r],this))return this.#M(this.#p[r],n)}}forEach(e,n=this){for(let r of this.#T()){let i=this.#u[r],s=this.#m(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#p[r],this)}}rforEach(e,n=this){for(let r of this.#v()){let i=this.#u[r],s=this.#m(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#p[r],this)}}purgeStale(){let e=!1;for(let n of this.#v({allowStale:!0}))this.#w(n)&&(this.#R(this.#p[n],"expire"),e=!0);return e}info(e){let n=this.#d.get(e);if(n===void 0)return;let r=this.#u[n],i=this.#m(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#E&&this.#C){let o=this.#E[n],a=this.#C[n];if(o&&a){let c=o-(this.#a.now()-a);s.ttl=c,s.start=Date.now()}}return this.#S&&(s.size=this.#S[n]),s}dump(){let e=[];for(let n of this.#T({allowStale:!0})){let r=this.#p[n],i=this.#u[n],s=this.#m(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#E&&this.#C){o.ttl=this.#E[n];let a=this.#a.now()-this.#C[n];o.start=Math.floor(Date.now()-a)}this.#S&&(o.size=this.#S[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=this.#a.now()-i}this.#B(n,r.value,r)}}set(e,n,r={}){let{status:i=Lu.metrics.hasSubscribers?{}:void 0}=r;r.status=i,i&&(i.op="set",i.key=e,n!==void 0&&(i.value=n),i.cache=this);let s=this.#B(e,n,r);return i&&Lu.metrics.hasSubscribers&&Lu.metrics.publish(i),s}#B(e,n,r,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=r,l=this.#m(n);if(n===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:d=this.noUpdateTTL}=r;u&&!l&&(u.value=n);let m=this.#W(e,n,r.size||0,c,u);if(this.maxEntrySize&&m>this.maxEntrySize)return this.#R(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let h=this.#c===0?void 0:this.#d.get(e);if(h===void 0)h=this.#c===0?this.#g:this.#x.length!==0?this.#x.pop():this.#c===this.#e?this.#Q(!1):this.#c,this.#p[h]=e,this.#u[h]=n,this.#d.set(e,h),this.#h[this.#g]=h,this.#f[h]=this.#g,this.#g=h,this.#c++,this.#F(h,m,u),u&&(u.set="add"),d=!1,this.#N&&!l&&this.#r?.(n,e,"add");else{this.#O(h);let f=this.#u[h];if(n!==f){if(!a)if(this.#m(f)){f!==i&&f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=f;g!==void 0&&g!==n&&(this.#I&&this.#n?.(g,e,"set"),this.#_&&this.#y?.push([g,e,"set"]))}else this.#I&&this.#n?.(f,e,"set"),this.#_&&this.#y?.push([f,e,"set"]);if(this.#P(h),this.#F(h,m,u),this.#u[h]=n,!l){let g=f&&this.#m(f)?f.__staleWhileFetching:f,A=g===void 0?"add":n!==g?"replace":"update";u&&(u.set=A,g!==void 0&&(u.oldValue=g)),this.#N&&this.onInsert?.(n,e,A)}}else l||(u&&(u.set="update"),this.#N&&this.onInsert?.(n,e,"update"))}if(s!==0&&!this.#E&&this.#G(),this.#E&&(d||this.#$(h,s,o),u&&this.#k(u,h)),!a&&this.#_&&this.#y){let f=this.#y,g;for(;g=f?.shift();)this.#i?.(...g)}return this}pop(){try{for(;this.#c;){let e=this.#u[this.#A];if(this.#Q(!0),this.#m(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#_&&this.#y){let e=this.#y,n;for(;n=e?.shift();)this.#i?.(...n)}}}#Q(e){let n=this.#A,r=this.#p[n],i=this.#u[n],s=this.#m(i);s&&i.__abortController.abort(new Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#I||this.#_)&&o!==void 0&&(this.#I&&this.#n?.(o,r,"evict"),this.#_&&this.#y?.push([o,r,"evict"])),this.#P(n),this.#b?.[n]&&(clearTimeout(this.#b[n]),this.#b[n]=void 0),e&&(this.#p[n]=void 0,this.#u[n]=void 0,this.#x.push(n)),this.#c===1?(this.#A=this.#g=0,this.#x.length=0):this.#A=this.#h[n],this.#d.delete(r),this.#c--,n}has(e,n={}){let{status:r=Lu.metrics.hasSubscribers?{}:void 0}=n;n.status=r,r&&(r.op="has",r.key=e,r.cache=this);let i=this.#z(e,n);return Lu.metrics.hasSubscribers&&Lu.metrics.publish(r),i}#z(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#d.get(e);if(s!==void 0){let o=this.#u[s];if(this.#m(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#w(s))i&&(i.has="stale",this.#k(i,s));else return r&&this.#D(s),i&&(i.has="hit",this.#k(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{status:r=Fht()?{}:void 0}=n;r&&(r.op="peek",r.key=e,r.cache=this),n.status=r;let i=this.#K(e,n);return Lu.metrics.hasSubscribers&&Lu.metrics.publish(r),i}#K(e,n){let{status:r,allowStale:i=this.allowStale}=n,s=this.#d.get(e);if(s===void 0||!i&&this.#w(s)){r&&(r.peek=s===void 0?"miss":"stale");return}let o=this.#u[s],a=this.#m(o)?o.__staleWhileFetching:o;return r&&(a!==void 0?(r.peek="hit",r.value=a):r.peek="miss"),a}#U(e,n,r,i){let s=n===void 0?void 0:this.#u[n];if(this.#m(s))return s;let o=new AbortController,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:i},u=(g,A=!1)=>{let{aborted:y}=o.signal,E=r.ignoreFetchAbort&&g!==void 0,_=r.ignoreFetchAbort||!!(r.allowStaleOnFetchAbort&&g!==void 0);if(r.status&&(y&&!A?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,E&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),y&&!E&&!A)return d(o.signal.reason,_);let S=h,C=this.#u[n];return(C===h||C===void 0&&E&&A)&&(g===void 0?S.__staleWhileFetching!==void 0?this.#u[n]=S.__staleWhileFetching:this.#R(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.#B(e,g,c.options,S))),g},l=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),d(g,!1)),d=(g,A)=>{let{aborted:y}=o.signal,E=y&&r.allowStaleOnFetchAbort,_=E||r.allowStaleOnFetchRejection,S=_||r.noDeleteOnFetchRejection,C=h;if(this.#u[n]===h&&(!S||!A&&C.__staleWhileFetching===void 0?this.#R(e,"fetch"):E||(this.#u[n]=C.__staleWhileFetching)),_)return r.status&&C.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),C.__staleWhileFetching;if(C.__returned===C)throw g},m=(g,A)=>{let y=this.#s?.(e,s,c);o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=E=>u(E,!0)))}),y&&y instanceof Promise?y.then(E=>g(E===void 0?void 0:E),A):y!==void 0&&g(y)};r.status&&(r.status.fetchDispatched=!0);let h=new Promise(m).then(u,l),f=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.#B(e,f,{...c.options,status:void 0}),n=this.#d.get(e)):this.#u[n]=f,f}#m(e){if(!this.#L)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof AbortController}fetch(e,n={}){let r=Lu.tracing.hasSubscribers,{status:i=Fht()?{}:void 0}=n;n.status=i,i&&n.context&&(i.context=n.context);let s=this.#q(e,n);return i&&r&&(i.trace=!0,Lu.tracing.tracePromise(()=>s,i).catch(()=>{})),s}async#q(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:g,forceRefresh:A=!1,status:y,signal:E}=n;if(y&&(y.op="fetch",y.key=e,A&&(y.forceRefresh=!0),y.cache=this),!this.#L)return y&&(y.fetch="get"),this.#M(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:y});let _={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:f,ignoreFetchAbort:h,status:y,signal:E},S=this.#d.get(e);if(S===void 0){y&&(y.fetch="miss");let C=this.#U(e,S,_,g);return C.__returned=C}else{let C=this.#u[S];if(this.#m(C)){let N=r&&C.__staleWhileFetching!==void 0;return y&&(y.fetch="inflight",N&&(y.returnedStale=!0)),N?C.__staleWhileFetching:C.__returned=C}let I=this.#w(S);if(!A&&!I)return y&&(y.fetch="hit"),this.#O(S),i&&this.#D(S),y&&this.#k(y,S),C;let w=this.#U(e,S,_,g),k=w.__staleWhileFetching!==void 0&&r;return y&&(y.fetch=I?"stale":"refresh",k&&I&&(y.returnedStale=!0)),k?w.__staleWhileFetching:w.__returned=w}}forceFetch(e,n={}){let r=Lu.tracing.hasSubscribers,{status:i=Fht()?{}:void 0}=n;n.status=i,i&&n.context&&(i.context=n.context);let s=this.#J(e,n);return i&&r&&(i.trace=!0,Lu.tracing.tracePromise(()=>s,i).catch(()=>{})),s}async#J(e,n={}){let r=await this.#q(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let{status:r=Lu.metrics.hasSubscribers?{}:void 0}=n;n.status=r,r&&(r.op="memo",r.key=e,n.context&&(r.context=n.context),r.cache=this);let i=this.#X(e,n);return r&&(r.value=i),Lu.metrics.hasSubscribers&&Lu.metrics.publish(r),i}#X(e,n={}){let r=this.#o;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...a}=n;s&&o&&(s.forceRefresh=!0);let c=this.#M(e,a),u=o||c===void 0;if(s&&(s.memo=u?"miss":"hit",u||(s.value=c)),!u)return c;let l=r(e,c,{options:a,context:i});return s&&(s.value=l),this.#B(e,l,a),l}get(e,n={}){let{status:r=Lu.metrics.hasSubscribers?{}:void 0}=n;n.status=r,r&&(r.op="get",r.key=e,r.cache=this);let i=this.#M(e,n);return r&&(i!==void 0&&(r.value=i),Lu.metrics.hasSubscribers&&Lu.metrics.publish(r)),i}#M(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#d.get(e);if(a===void 0){o&&(o.get="miss");return}let c=this.#u[a],u=this.#m(c);return o&&this.#k(o,a),this.#w(a)?u?(o&&(o.get="stale-fetching"),r&&c.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),c.__staleWhileFetching):void 0):(s||this.#R(e,"expire"),o&&(o.get="stale"),r?(o&&(o.returnedStale=!0),c):void 0):(o&&(o.get=u?"fetching":"hit"),this.#O(a),i&&this.#D(a),u?c.__staleWhileFetching:c)}#j(e,n){this.#f[n]=e,this.#h[e]=n}#O(e){e!==this.#g&&(e===this.#A?this.#A=this.#h[e]:this.#j(this.#f[e],this.#h[e]),this.#j(this.#g,e),this.#g=e)}delete(e){return this.#R(e,"delete")}#R(e,n){Lu.metrics.hasSubscribers&&Lu.metrics.publish({op:"delete",delete:n,key:e,cache:this});let r=!1;if(this.#c!==0){let i=this.#d.get(e);if(i!==void 0)if(this.#b?.[i]&&(clearTimeout(this.#b[i]),this.#b[i]=void 0),r=!0,this.#c===1)this.#V(n);else{this.#P(i);let s=this.#u[i];if(this.#m(s)?s.__abortController.abort(new Error("deleted")):(this.#I||this.#_)&&(this.#I&&this.#n?.(s,e,n),this.#_&&this.#y?.push([s,e,n])),this.#d.delete(e),this.#p[i]=void 0,this.#u[i]=void 0,i===this.#g)this.#g=this.#f[i];else if(i===this.#A)this.#A=this.#h[i];else{let o=this.#f[i];this.#h[o]=this.#h[i];let a=this.#h[i];this.#f[a]=this.#f[i]}this.#c--,this.#x.push(i)}}if(this.#_&&this.#y?.length){let i=this.#y,s;for(;s=i?.shift();)this.#i?.(...s)}return r}clear(){return this.#V("delete")}#V(e){for(let n of this.#v({allowStale:!0})){let r=this.#u[n];if(this.#m(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#p[n];this.#I&&this.#n?.(r,i,e),this.#_&&this.#y?.push([r,i,e])}}if(this.#d.clear(),this.#u.fill(void 0),this.#p.fill(void 0),this.#E&&this.#C){this.#E.fill(0),this.#C.fill(0);for(let n of this.#b??[])n!==void 0&&clearTimeout(n);this.#b?.fill(void 0)}if(this.#S&&this.#S.fill(0),this.#A=0,this.#g=0,this.#x.length=0,this.#l=0,this.#c=0,this.#_&&this.#y){let n=this.#y,r;for(;r=n?.shift();)this.#i?.(...r)}}};_Be.LRUCache=bKi});var $Yn=re((tDc,GYn)=>{"use strict";p();var Ia=(...t)=>t.every(e=>e)?t.join(""):"",ud=t=>t?encodeURIComponent(t):"",UYn=t=>t.toLowerCase().replace(/^\W+/g,"").replace(/(?`git@${t}:${e}/${n}.git${Ia("#",r)}`,sshurltemplate:({domain:t,user:e,project:n,committish:r})=>`git+ssh://git@${t}/${e}/${n}.git${Ia("#",r)}`,edittemplate:({domain:t,user:e,project:n,committish:r,editpath:i,path:s})=>`https://${t}/${e}/${n}${Ia("/",i,"/",ud(r||"HEAD"),"/",s)}`,browsetemplate:({domain:t,user:e,project:n,committish:r,treepath:i})=>`https://${t}/${e}/${n}${Ia("/",i,"/",ud(r))}`,browsetreetemplate:({domain:t,user:e,project:n,committish:r,treepath:i,path:s,fragment:o,hashformat:a})=>`https://${t}/${e}/${n}/${i}/${ud(r||"HEAD")}/${s}${Ia("#",a(o||""))}`,browseblobtemplate:({domain:t,user:e,project:n,committish:r,blobpath:i,path:s,fragment:o,hashformat:a})=>`https://${t}/${e}/${n}/${i}/${ud(r||"HEAD")}/${s}${Ia("#",a(o||""))}`,docstemplate:({domain:t,user:e,project:n,treepath:r,committish:i})=>`https://${t}/${e}/${n}${Ia("/",r,"/",ud(i))}#readme`,httpstemplate:({auth:t,domain:e,user:n,project:r,committish:i})=>`git+https://${Ia(t,"@")}${e}/${n}/${r}.git${Ia("#",i)}`,filetemplate:({domain:t,user:e,project:n,committish:r,path:i})=>`https://${t}/${e}/${n}/raw/${ud(r||"HEAD")}/${i}`,shortcuttemplate:({type:t,user:e,project:n,committish:r})=>`${t}:${e}/${n}${Ia("#",r)}`,pathtemplate:({user:t,project:e,committish:n})=>`${t}/${e}${Ia("#",n)}`,bugstemplate:({domain:t,user:e,project:n})=>`https://${t}/${e}/${n}/issues`,hashformat:UYn},pP={};pP.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:t,user:e,project:n,committish:r,path:i})=>`https://${Ia(t,"@")}raw.githubusercontent.com/${e}/${n}/${ud(r||"HEAD")}/${i}`,gittemplate:({auth:t,domain:e,user:n,project:r,committish:i})=>`git://${Ia(t,"@")}${e}/${n}/${r}.git${Ia("#",i)}`,tarballtemplate:({domain:t,user:e,project:n,committish:r})=>`https://codeload.${t}/${e}/${n}/tar.gz/${ud(r||"HEAD")}`,extract:t=>{let[,e,n,r,i]=t.pathname.split("/",5);if(!(r&&r!=="tree")&&(r||(i=t.hash.slice(1)),n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!e||!n)))return{user:e,project:n,committish:i}}};pP.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:t,user:e,project:n,committish:r,treepath:i,path:s,editpath:o})=>`https://${t}/${e}/${n}${Ia("/",i,"/",ud(r||"HEAD"),"/",s,o)}`,tarballtemplate:({domain:t,user:e,project:n,committish:r})=>`https://${t}/${e}/${n}/get/${ud(r||"HEAD")}.tar.gz`,extract:t=>{let[,e,n,r]=t.pathname.split("/",4);if(!["get"].includes(r)&&(n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!e||!n)))return{user:e,project:n,committish:t.hash.slice(1)}}};pP.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:({domain:t,user:e,project:n,committish:r})=>`https://${t}/api/v4/projects/${ud(e+"/"+n)}/repository/archive.tar.gz?sha=${ud(r||"HEAD")}`,extract:t=>{let e=t.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let n=e.split("/"),r=n.pop();r.endsWith(".git")&&(r=r.slice(0,-4));let i=n.join("/");if(!(!i||!r))return{user:i,project:r,committish:t.hash.slice(1)}}};pP.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:t,project:e,committish:n})=>`git@${t}:${e}.git${Ia("#",n)}`,sshurltemplate:({domain:t,project:e,committish:n})=>`git+ssh://git@${t}/${e}.git${Ia("#",n)}`,edittemplate:({domain:t,user:e,project:n,committish:r,editpath:i})=>`https://${t}/${e}/${n}${Ia("/",ud(r))}/${i}`,browsetemplate:({domain:t,project:e,committish:n})=>`https://${t}/${e}${Ia("/",ud(n))}`,browsetreetemplate:({domain:t,project:e,committish:n,path:r,hashformat:i})=>`https://${t}/${e}${Ia("/",ud(n))}${Ia("#",i(r))}`,browseblobtemplate:({domain:t,project:e,committish:n,path:r,hashformat:i})=>`https://${t}/${e}${Ia("/",ud(n))}${Ia("#",i(r))}`,docstemplate:({domain:t,project:e,committish:n})=>`https://${t}/${e}${Ia("/",ud(n))}`,httpstemplate:({domain:t,project:e,committish:n})=>`git+https://${t}/${e}.git${Ia("#",n)}`,filetemplate:({user:t,project:e,committish:n,path:r})=>`https://gist.githubusercontent.com/${t}/${e}/raw${Ia("/",ud(n))}/${r}`,shortcuttemplate:({type:t,project:e,committish:n})=>`${t}:${e}${Ia("#",n)}`,pathtemplate:({project:t,committish:e})=>`${t}${Ia("#",e)}`,bugstemplate:({domain:t,project:e})=>`https://${t}/${e}`,gittemplate:({domain:t,project:e,committish:n})=>`git://${t}/${e}.git${Ia("#",n)}`,tarballtemplate:({project:t,committish:e})=>`https://codeload.github.com/gist/${t}/tar.gz/${ud(e||"HEAD")}`,extract:t=>{let[,e,n,r]=t.pathname.split("/",4);if(r!=="raw"){if(!n){if(!e)return;n=e,e=null}return n.endsWith(".git")&&(n=n.slice(0,-4)),{user:e,project:n,committish:t.hash.slice(1)}}},hashformat:function(t){return t&&"file-"+UYn(t)}};pP.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:t,user:e,project:n,committish:r,path:i})=>`https://${t}/${e}/${n}/blob/${ud(r)||"HEAD"}/${i}`,httpstemplate:({domain:t,user:e,project:n,committish:r})=>`https://${t}/${e}/${n}${Ia("#",r)}`,tarballtemplate:({domain:t,user:e,project:n,committish:r})=>`https://${t}/${e}/${n}/archive/${ud(r)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:t=>{let[,e,n,r]=t.pathname.split("/",4);if(!["archive"].includes(r)&&(n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!e||!n)))return{user:e,project:n,committish:t.hash.slice(1)}}};for(let[t,e]of Object.entries(pP))pP[t]=Object.assign({},_Ki,e);GYn.exports=pP});var Uht=re((rDc,HYn)=>{p();var xKi=require("url"),Qht=(t,e,n)=>{let r=t.indexOf(n);return t.lastIndexOf(e,r>-1?r:1/0)},WYn=t=>{try{return new xKi.URL(t)}catch{}},SKi=(t,e)=>{let n=t.indexOf(":"),r=t.slice(0,n+1);if(Object.prototype.hasOwnProperty.call(e,r)||t.substr(n,3)==="://")return t;let i=t.indexOf("@");return i>-1?i>n?`git+ssh://${t}`:t:`${t.slice(0,n+1)}//${t.slice(n+1)}`},CKi=t=>{let e=Qht(t,"@","#"),n=Qht(t,":","#");return n>e&&(t=t.slice(0,n)+"/"+t.slice(n+1)),Qht(t,":","#")===-1&&t.indexOf("//")===-1&&(t=`git+ssh://${t}`),t};HYn.exports=(t,e)=>{let n=e?SKi(t,e):t;return WYn(n)||WYn(CKi(n))}});var jYn=re((sDc,qYn)=>{"use strict";p();var IKi=Uht(),wKi=t=>{let e=t.indexOf("#"),n=t.indexOf("/"),r=t.indexOf("/",n+1),i=t.indexOf(":"),s=/\s/.exec(t),o=t.indexOf("@"),a=!s||e>-1&&s.index>e,c=o===-1||e>-1&&o>e,u=i===-1||e>-1&&i>e,l=r===-1||e>-1&&r>e,d=n>0,m=e>-1?t[e-1]!=="/":!t.endsWith("/"),h=!t.startsWith(".");return a&&d&&m&&h&&c&&u&&l};qYn.exports=(t,e,{gitHosts:n,protocols:r})=>{if(!t)return;let i=wKi(t)?`github:${t}`:t,s=IKi(i,r);if(!s)return;let o=n.byShortcut[s.protocol],a=n.byDomain[s.hostname.startsWith("www.")?s.hostname.slice(4):s.hostname],c=o||a;if(!c)return;let u=n[o||a],l=null;r[s.protocol]?.auth&&(s.username||s.password)&&(l=`${s.username}${s.password?":"+s.password:""}`);let d=null,m=null,h=null,f=null;try{if(o){let g=s.pathname.startsWith("/")?s.pathname.slice(1):s.pathname,A=g.indexOf("@");A>-1&&(g=g.slice(A+1));let y=g.lastIndexOf("/");y>-1?(m=decodeURIComponent(g.slice(0,y)),m||(m=null),h=decodeURIComponent(g.slice(y+1))):h=decodeURIComponent(g),h.endsWith(".git")&&(h=h.slice(0,-4)),s.hash&&(d=decodeURIComponent(s.hash.slice(1))),f="shortcut"}else{if(!u.protocols.includes(s.protocol))return;let g=u.extract(s);if(!g)return;m=g.user&&decodeURIComponent(g.user),h=decodeURIComponent(g.project),d=decodeURIComponent(g.committish),f=r[s.protocol]?.name||s.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[c,m,l,h,d,f,e]}});var YYn=re((aDc,VYn)=>{"use strict";p();var{LRUCache:TKi}=QYn(),vKi=$Yn(),RKi=jYn(),kKi=Uht(),Ght=new TKi({max:1e3});function BKi(t){try{let{protocol:e,hostname:n,pathname:r}=new URL(t);if(!n)return null;let i=/(?:git\+)http:$/.test(e)?"http:":"https:",s=r.replace(/\.git$/,"");return`${i}//${n}${s}`}catch{return null}}var xBe=class t{constructor(e,n,r,i,s,o,a={}){Object.assign(this,t.#e[e],{type:e,user:n,auth:r,project:i,committish:s,default:o,opts:a})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(e,n){t.#e[e]=n,t.#e.byDomain[n.domain]=e,t.#e.byShortcut[`${e}:`]=e,t.#t[`${e}:`]={name:e}}static fromUrl(e,n){if(typeof e!="string")return;let r=e+JSON.stringify(n||{});if(!Ght.has(r)){let i=RKi(e,n,{gitHosts:t.#e,protocols:t.#t});Ght.set(r,i?new t(...i):void 0)}return Ght.get(r)}static fromManifest(e,n={}){if(!e||typeof e!="object")return;let r=e.repository,i=r&&(typeof r=="string"?r:typeof r=="object"&&typeof r.url=="string"?r.url:null);if(!i)throw new Error("no repository");let s=i&&t.fromUrl(i.replace(/^git\+/,""),n)||null;if(s)return s;let o=BKi(i);return t.fromUrl(o,n)||o}static parseUrl(e){return kKi(e)}#n(e,n){if(typeof e!="function")return null;let r={...this,...this.opts,...n};r.path||(r.path=""),r.path.startsWith("/")&&(r.path=r.path.slice(1)),r.noCommittish&&(r.committish=null);let i=e(r);return r.noGitPlus&&i.startsWith("git+")?i.slice(4):i}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#n(this.sshtemplate,e)}sshurl(e){return this.#n(this.sshurltemplate,e)}browse(e,...n){return typeof e!="string"?this.#n(this.browsetemplate,e):typeof n[0]!="string"?this.#n(this.browsetreetemplate,{...n[0],path:e}):this.#n(this.browsetreetemplate,{...n[1],fragment:n[0],path:e})}browseFile(e,...n){return typeof n[0]!="string"?this.#n(this.browseblobtemplate,{...n[0],path:e}):this.#n(this.browseblobtemplate,{...n[1],fragment:n[0],path:e})}docs(e){return this.#n(this.docstemplate,e)}bugs(e){return this.#n(this.bugstemplate,e)}https(e){return this.#n(this.httpstemplate,e)}git(e){return this.#n(this.gittemplate,e)}shortcut(e){return this.#n(this.shortcuttemplate,e)}path(e){return this.#n(this.pathtemplate,e)}tarball(e){return this.#n(this.tarballtemplate,{...e,noCommittish:!1})}file(e,n){return this.#n(this.filetemplate,{...n,path:e})}edit(e,n){return this.#n(this.edittemplate,{...n,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)}};for(let[t,e]of Object.entries(vKi))xBe.addHost(t,e);VYn.exports=xBe});function KYn(t){let e=t.match(/^git@([^:]+):(.+)$/);if(e){let c=e[2]??"",u=c.indexOf("@");if(u<0)return{repo:t};let l=c.slice(0,u),d=c.slice(u+1);return!l||!d?{repo:t}:{repo:`git@${e[1]??""}:${l}`,ref:d}}if(t.includes("://"))try{let c=new URL(t),u=c.pathname.replace(/^\/+/,""),l=u.indexOf("@");if(l<0)return{repo:t};let d=u.slice(0,l),m=u.slice(l+1);return!d||!m?{repo:t}:(c.pathname=`/${d}`,{repo:c.toString().replace(/\/$/,""),ref:m})}catch{return{repo:t}}let n=t.indexOf("/");if(n<0)return{repo:t};let r=t.slice(0,n),i=t.slice(n+1),s=i.indexOf("@");if(s<0)return{repo:t};let o=i.slice(0,s),a=i.slice(s+1);return!o||!a?{repo:t}:{repo:`${r}/${o}`,ref:a}}function NKi(t){try{return decodeURIComponent(t)}catch{return null}}function zYn(t,e){let n=NKi(t);if(n===null)return!0;let r=[t,n];for(let i of r)if(i.includes("\0")||i.includes("\\")||i.startsWith("/")||!e&&i.includes("/")||i.split("/").includes(".."))return!0;return!1}function Wht(t){if(t.path.startsWith("/"))return null;let e=t.path.replace(/\.git$/,"").replace(/^\/+/,"");return!t.host||!e||e.split("/").length<2||zYn(t.host,!1)||zYn(e,!0)?null:{type:"git",repo:t.repo,host:t.host,path:e,ref:t.ref,pinned:!!t.ref}}function DKi(t){let{repo:e,ref:n}=KYn(t),r=e,i="",s="",o=e.match(/^git@([^:]+):(.+)$/);if(o)i=o[1]??"",s=o[2]??"";else if(e.startsWith("https://")||e.startsWith("http://")||e.startsWith("ssh://")||e.startsWith("git://"))try{let a=new URL(e);i=a.hostname,s=a.pathname.replace(/^\/+/,"")}catch{return null}else{let a=e.indexOf("/");if(a<0||(i=e.slice(0,a),s=e.slice(a+1),!i.includes(".")&&i!=="localhost"))return null;r=`https://${e}`}return Wht({repo:r,host:i,path:s,ref:n})}function goe(t){let e=t.trim(),n=e.startsWith("git:"),r=n?e.slice(4).trim():e;if(!n&&!/^(https?|ssh|git):\/\//i.test(r))return null;let i=KYn(r),s=[i.ref?`${i.repo}#${i.ref}`:void 0,r].filter(a=>!!a);for(let a of s){let c=$ht.default.fromUrl(a);if(c){if(i.ref&&c.project?.includes("@"))continue;let u=!i.repo.startsWith("http://")&&!i.repo.startsWith("https://")&&!i.repo.startsWith("ssh://")&&!i.repo.startsWith("git://")&&!i.repo.startsWith("git@");return Wht({repo:u?`https://${i.repo}`:i.repo,host:c.domain||"",path:`${c.user}/${c.project}`,ref:c.committish||i.ref||void 0})}}let o=[i.ref?`https://${i.repo}#${i.ref}`:void 0,`https://${r}`].filter(a=>!!a);for(let a of o){let c=$ht.default.fromUrl(a);if(c){if(i.ref&&c.project?.includes("@"))continue;return Wht({repo:`https://${i.repo}`,host:c.domain||"",path:`${c.user}/${c.project}`,ref:c.committish||i.ref||void 0})}}return DKi(r)}var $ht,Hht=v(()=>{p();$ht=Ot(YYn(),1)});function PKi(){return mP?mP.rawStdoutWrite:process.stdout.write.bind(process.stdout)}async function JYn(t){for(;;)try{await new Promise((e,n)=>{try{PKi()(t,r=>{r?n(r):e()})}catch(r){n(r instanceof Error?r:new Error(String(r)))}});return}catch(e){let n=e instanceof Error?e:new Error(String(e)),r=n.code;if(r!=="ENOBUFS"&&r!=="EAGAIN"&&r!=="EWOULDBLOCK")throw n;await new Promise(i=>setTimeout(i,10))}}function SBe(){if(mP)return;let t=process.stdout.write.bind(process.stdout),e=process.stderr.write.bind(process.stderr),n=process.stdout.write;process.stdout.write=((r,i,s)=>typeof i=="function"?e(String(r),i):e(String(r),s)),mP={rawStdoutWrite:t,rawStderrWrite:e,originalStdoutWrite:n}}function XYn(){mP&&(process.stdout.write=mP.originalStdoutWrite,mP=void 0)}function ZYn(){return mP!==void 0}function uY(t){t.length!==0&&(Aoe=Aoe.then(()=>JYn(t)),Aoe.catch(()=>{process.exit(1)}))}async function hP(){for(;;){let t=Aoe;if(await t,t===Aoe)return}}async function CBe(){await hP(),await JYn("")}var mP,Aoe,yoe=v(()=>{p();Aoe=Promise.resolve()});function qht(){if(process.platform!=="linux"||Object.keys(process.env).length>0)return process.env;try{let t=(0,Ln.readFileSync)("/proc/self/environ","utf-8"),e={};for(let n of t.split("\0")){let r=n.indexOf("=");r>0&&(e[n.slice(0,r)]=n.slice(r+1))}return e}catch{return process.env}}function nU(){let t=process.env.PI_OFFLINE;return t?t==="1"||t.toLowerCase()==="true"||t.toLowerCase()==="yes":!1}function OKi(t){return(0,NE.valid)(t??"")!==null}function LKi(t){return t?(0,NE.validRange)(t)??void 0:void 0}function t9n(t){return t.origin==="package"?4:(t.scope==="project"?0:2)+(t.source==="local"?0:1)}function ch(t){return t.split(Sn.sep).join("/")}function jht(){return process.env.HOME||(0,o9n.homedir)()}function UKi(t){let e=(0,Sn.join)(t,"tmp","extensions");return(0,Ln.mkdirSync)(e,{recursive:!0,mode:448}),(0,Ln.chmodSync)(e,448),e}function GKi(t,e){let n=t.trim();if(!n||n.startsWith("#")&&!n.startsWith("\\#"))return null;let r=t,i=!1;r.startsWith("!")?(i=!0,r=r.slice(1)):r.startsWith("\\!")&&(r=r.slice(1)),r.startsWith("/")&&(r=r.slice(1));let s=e?`${e}${r}`:r;return i?`!${s}`:s}function boe(t,e,n){let r=(0,Sn.relative)(n,e),i=r?`${ch(r)}/`:"";for(let s of QKi){let o=(0,Sn.join)(e,s);if((0,Ln.existsSync)(o))try{let c=(0,Ln.readFileSync)(o,"utf-8").split(/\r?\n/).map(u=>GKi(u,i)).filter(u=>!!u);c.length>0&&t.add(c)}catch{}}}function $Ki(t){return t.startsWith("!")||t.startsWith("+")||t.startsWith("-")||t.includes("*")||t.includes("?")}function Vht(t){return t.startsWith("!")||t.startsWith("+")||t.startsWith("-")}function WKi(t){return t.includes("*")||t.includes("?")}function HKi(t,e){return(0,Ln.globSync)(t,{cwd:e}).map(n=>(0,Sn.resolve)(e,n)).filter(n=>(0,Sn.relative)(e,n).split(Sn.sep).every(r=>r===".."||!r.startsWith("."))).sort((n,r)=>nr?1:0)}function qKi(t){let e=[],n=[];for(let r of t)$Ki(r)?n.push(r):e.push(r);return{plain:e,patterns:n}}function a9n(t,e,n=!0,r,i){let s=[];if(!(0,Ln.existsSync)(t))return s;let o=i??t,a=r??(0,dY.default)();boe(a,t,o);try{let c=(0,Ln.readdirSync)(t,{withFileTypes:!0});for(let u of c){if(u.name.startsWith(".")||n&&u.name==="node_modules")continue;let l=(0,Sn.join)(t,u.name),d=u.isDirectory(),m=u.isFile();if(u.isSymbolicLink())try{let g=(0,Ln.statSync)(l);d=g.isDirectory(),m=g.isFile()}catch{continue}let h=ch((0,Sn.relative)(o,l)),f=d?`${h}/`:h;a.ignores(f)||(d?s.push(...a9n(l,e,n,a,o)):m&&e.test(u.name)&&s.push(l))}}catch{}return s}function zht(t,e,n,r){let i=[];if(!(0,Ln.existsSync)(t))return i;let s=r??t,o=n??(0,dY.default)();boe(o,t,s);try{let a=(0,Ln.readdirSync)(t,{withFileTypes:!0});for(let c of a){if(c.name!=="SKILL.md")continue;let u=(0,Sn.join)(t,c.name),l=c.isFile();if(c.isSymbolicLink())try{l=(0,Ln.statSync)(u).isFile()}catch{continue}let d=ch((0,Sn.relative)(s,u));if(l&&!o.ignores(d))return i.push(u),i}for(let c of a){if(c.name.startsWith(".")||c.name==="node_modules")continue;let u=(0,Sn.join)(t,c.name),l=c.isDirectory(),d=c.isFile();if(c.isSymbolicLink())try{let f=(0,Ln.statSync)(u);l=f.isDirectory(),d=f.isFile()}catch{continue}let m=ch((0,Sn.relative)(s,u));if(d&&c.name.endsWith(".md")&&!o.ignores(m)&&(e==="pi"&&t===s||e==="agents"&&t!==s)){i.push(u);continue}l&&(o.ignores(`${m}/`)||i.push(...zht(u,e,o,s)))}}catch{}return i}function wBe(t,e){return zht(t,e)}function jKi(t){let e=(0,Sn.resolve)(t);for(;;){if((0,Ln.existsSync)((0,Sn.join)(e,".git")))return e;let n=(0,Sn.dirname)(e);if(n===e)return null;e=n}}function VKi(t){let e=[],n=(0,Sn.resolve)(t),r=jKi(n),i=n;for(;e.push((0,Sn.join)(i,".agents","skills")),!(r&&i===r);){let s=(0,Sn.dirname)(i);if(s===i)break;i=s}return e}function n9n(t){let e=[];if(!(0,Ln.existsSync)(t))return e;let n=(0,dY.default)();boe(n,t,t);try{let r=(0,Ln.readdirSync)(t,{withFileTypes:!0});for(let i of r){if(i.name.startsWith(".")||i.name==="node_modules")continue;let s=(0,Sn.join)(t,i.name),o=i.isFile();if(i.isSymbolicLink())try{o=(0,Ln.statSync)(s).isFile()}catch{continue}let a=ch((0,Sn.relative)(t,s));n.ignores(a)||o&&i.name.endsWith(".md")&&e.push(s)}}catch{}return e}function r9n(t){let e=[];if(!(0,Ln.existsSync)(t))return e;let n=(0,dY.default)();boe(n,t,t);try{let r=(0,Ln.readdirSync)(t,{withFileTypes:!0});for(let i of r){if(i.name.startsWith(".")||i.name==="node_modules")continue;let s=(0,Sn.join)(t,i.name),o=i.isFile();if(i.isSymbolicLink())try{o=(0,Ln.statSync)(s).isFile()}catch{continue}let a=ch((0,Sn.relative)(t,s));n.ignores(a)||o&&i.name.endsWith(".json")&&e.push(s)}}catch{}return e}function i9n(t){let e=(0,Sn.join)(t,"package.json");if((0,Ln.existsSync)(e)){let i=bQ(e);if(i?.extensions?.length){let s=[];for(let o of i.extensions){let a=(0,Sn.resolve)(t,o);(0,Ln.existsSync)(a)&&s.push(a)}if(s.length>0)return s}}let n=(0,Sn.join)(t,"index.ts"),r=(0,Sn.join)(t,"index.js");return(0,Ln.existsSync)(n)?[n]:(0,Ln.existsSync)(r)?[r]:null}function Yht(t){let e=[];if(!(0,Ln.existsSync)(t))return e;let n=i9n(t);if(n)return n;let r=(0,dY.default)();boe(r,t,t);try{let i=(0,Ln.readdirSync)(t,{withFileTypes:!0});for(let s of i){if(s.name.startsWith(".")||s.name==="node_modules")continue;let o=(0,Sn.join)(t,s.name),a=s.isDirectory(),c=s.isFile();if(s.isSymbolicLink())try{let d=(0,Ln.statSync)(o);a=d.isDirectory(),c=d.isFile()}catch{continue}let u=ch((0,Sn.relative)(t,o)),l=a?`${u}/`:u;if(!r.ignores(l)){if(c&&(s.name.endsWith(".ts")||s.name.endsWith(".js")))e.push(o);else if(a){let d=i9n(o);d&&e.push(...d)}}}}catch{}return e}function TBe(t,e){return e==="skills"?zht(t,"pi"):e==="extensions"?Yht(t):a9n(t,FKi[e])}function RBe(t,e,n){let r=ch((0,Sn.relative)(n,t)),i=(0,Sn.basename)(t),s=ch(t),o=i==="SKILL.md",a=o?(0,Sn.dirname)(t):void 0,c=o?ch((0,Sn.relative)(n,a)):void 0,u=o?(0,Sn.basename)(a):void 0,l=o?ch(a):void 0;return e.some(d=>{let m=ch(d);return ul(r,m)||ul(i,m)||ul(s,m)?!0:o?ul(c,m)||ul(u,m)||ul(l,m):!1})}function YKi(t){let e=t.startsWith("./")||t.startsWith(".\\")?t.slice(2):t;return ch(e)}function Eoe(t,e,n){if(e.length===0)return!1;let r=ch((0,Sn.relative)(n,t)),i=(0,Sn.basename)(t),s=ch(t),o=i==="SKILL.md",a=o?(0,Sn.dirname)(t):void 0,c=o?ch((0,Sn.relative)(n,a)):void 0,u=o?ch(a):void 0;return e.some(l=>{let d=YKi(l);return d===r||d===s?!0:o?d===c||d===u:!1})}function zKi(t){return t.filter(e=>e.startsWith("!")||e.startsWith("+")||e.startsWith("-"))}function KKi(t,e,n){let r=zKi(e),i=r.filter(c=>c.startsWith("!")).map(c=>c.slice(1)),s=r.filter(c=>c.startsWith("+")).map(c=>c.slice(1)),o=r.filter(c=>c.startsWith("-")).map(c=>c.slice(1)),a=!0;return i.length>0&&RBe(t,i,n)&&(a=!1),s.length>0&&Eoe(t,s,n)&&(a=!0),o.length>0&&Eoe(t,o,n)&&(a=!1),a}function vBe(t,e,n){let r=[],i=[],s=[],o=[];for(let c of e)c.startsWith("+")?s.push(c.slice(1)):c.startsWith("-")?o.push(c.slice(1)):c.startsWith("!")?i.push(c.slice(1)):r.push(c);let a;if(r.length===0?a=[...t]:a=t.filter(c=>RBe(c,r,n)),i.length>0&&(a=a.filter(c=>!RBe(c,i,n))),s.length>0)for(let c of t)!a.includes(c)&&Eoe(c,s,n)&&a.push(c);return o.length>0&&(a=a.filter(c=>!Eoe(c,o,n))),new Set(a)}function JKi(t,e,n){let r=new Map;for(let i of e){let s=i.slice(i.startsWith("+")||i.startsWith("-")||i.startsWith("!")?1:0),o=!i.startsWith("-")&&!i.startsWith("!"),a=i.startsWith("+")||i.startsWith("-");for(let c of t)(a?Eoe(c,[s],n):RBe(c,[s],n))&&r.set(c,o)}return r}var s9n,Ln,o9n,Sn,dY,NE,Bw,e9n,MKi,IBe,FKi,QKi,rf,pY=v(()=>{p();s9n=require("node:crypto"),Ln=require("node:fs"),o9n=require("node:os"),Sn=require("node:path"),dY=Ot(yke(),1);mht();NE=Ot(Lht(),1);Qs();FF();Hht();fc();nm();yoe();_ut();Bw=1e4,e9n=4,MKi=4;IBe=["extensions","skills","prompts","themes"],FKi={extensions:/\.(ts|js)$/,skills:/\.md$/,prompts:/\.md$/,themes:/\.json$/},QKi=[".gitignore",".ignore",".fdignore"];rf=class{cwd;agentDir;settingsManager;globalNpmRoot;globalNpmRootCommandKey;progressCallback;constructor(e){this.cwd=Vn(e.cwd),this.agentDir=Vn(e.agentDir),this.settingsManager=e.settingsManager}setProgressCallback(e){this.progressCallback=e}addSourceToSettings(e,n){let r=n?.local?"project":"user",s=(r==="project"?this.settingsManager.getProjectSettings():this.settingsManager.getGlobalSettings()).packages??[],o=this.normalizePackageSourceForSettings(e,r),a=s.findIndex(u=>this.packageSourcesMatch(u,e,r));if(a!==-1){let u=s[a];if(this.getPackageSourceString(u)===o)return!1;let l=[...s];return l[a]=typeof u=="string"?o:{...u,source:o},r==="project"?this.settingsManager.setProjectPackages(l):this.settingsManager.setPackages(l),!0}let c=[...s,o];return r==="project"?this.settingsManager.setProjectPackages(c):this.settingsManager.setPackages(c),!0}removeSourceFromSettings(e,n){let r=n?.local?"project":"user",s=(r==="project"?this.settingsManager.getProjectSettings():this.settingsManager.getGlobalSettings()).packages??[],o=s.filter(c=>!this.packageSourcesMatch(c,e,r));return o.length!==s.length?(r==="project"?this.settingsManager.setProjectPackages(o):this.settingsManager.setPackages(o),!0):!1}getInstalledPath(e,n){let r=this.parseSource(e);if(r.type==="npm"){let i=this.getNpmInstallPath(r,n);return(0,Ln.existsSync)(i)?i:void 0}if(r.type==="git"){let i=this.getGitInstallPath(r,n);return(0,Ln.existsSync)(i)?i:void 0}if(r.type==="local"){let i=this.getBaseDirForScope(n),s=this.resolvePathFromBase(r.path,i);return(0,Ln.existsSync)(s)?s:void 0}}emitProgress(e){this.progressCallback?.(e)}async withProgress(e,n,r,i){this.emitProgress({type:"start",action:e,source:n,message:r});try{await i(),this.emitProgress({type:"complete",action:e,source:n})}catch(s){let o=s instanceof Error?s.message:String(s);throw this.emitProgress({type:"error",action:e,source:n,message:o}),s}}async resolve(e){let n=this.createAccumulator(),r=this.settingsManager.getGlobalSettings(),i=this.settingsManager.getProjectSettings(),s=[];for(let u of i.packages??[])s.push({pkg:u,scope:"project"});for(let u of r.packages??[])s.push({pkg:u,scope:"user"});let o=this.dedupePackages(s);await this.resolvePackageSources(o,n,e);let a=this.agentDir,c=(0,Sn.join)(this.cwd,Bi);for(let u of IBe){let l=this.getTargetMap(n,u),d=r[u]??[],m=i[u]??[];this.resolveLocalEntries(m,u,l,{source:"local",scope:"project",origin:"top-level"},c),this.resolveLocalEntries(d,u,l,{source:"local",scope:"user",origin:"top-level"},a)}return this.addAutoDiscoveredResources(n,r,i,a,c),this.toResolvedPaths(n)}async resolveExtensionSources(e,n){let r=this.createAccumulator(),i=n?.temporary?"temporary":n?.local?"project":"user",s=e.map(o=>({pkg:o,scope:i}));return await this.resolvePackageSources(s,r),this.toResolvedPaths(r)}listConfiguredPackages(){let e=this.settingsManager.getGlobalSettings(),n=this.settingsManager.getProjectSettings(),r=[];for(let i of e.packages??[]){let s=typeof i=="string"?i:i.source;r.push({source:s,scope:"user",filtered:typeof i=="object",installedPath:this.getInstalledPath(s,"user")})}for(let i of n.packages??[]){let s=typeof i=="string"?i:i.source;r.push({source:s,scope:"project",filtered:typeof i=="object",installedPath:this.getInstalledPath(s,"project")})}return r}async install(e,n){let r=this.parseSource(e),i=n?.local?"project":"user";this.assertProjectTrustedForScope(i),await this.withProgress("install",e,`Installing ${e}...`,async()=>{if(r.type==="npm"){await this.installNpm(r,i,!1);return}if(r.type==="git"){await this.installGit(r,i);return}if(r.type==="local"){let s=this.resolvePath(r.path);if(!(0,Ln.existsSync)(s))throw new Error(`Path does not exist: ${s}`);return}throw new Error(`Unsupported install source: ${e}`)})}async installAndPersist(e,n){await this.install(e,n),this.addSourceToSettings(e,n)}async remove(e,n){let r=this.parseSource(e),i=n?.local?"project":"user";this.assertProjectTrustedForScope(i),await this.withProgress("remove",e,`Removing ${e}...`,async()=>{if(r.type==="npm"){await this.uninstallNpm(r,i);return}if(r.type==="git"){await this.removeGit(r,i);return}if(r.type!=="local")throw new Error(`Unsupported remove source: ${e}`)})}async removeAndPersist(e,n){return await this.remove(e,n),this.removeSourceFromSettings(e,n)}async update(e){let n=this.settingsManager.getGlobalSettings(),r=this.settingsManager.getProjectSettings(),i=e?this.getPackageIdentity(e):void 0,s=!1,o=[];for(let a of n.packages??[]){let c=typeof a=="string"?a:a.source;i&&this.getPackageIdentity(c,"user")!==i||(s=!0,o.push({source:c,scope:"user"}))}for(let a of r.packages??[]){let c=typeof a=="string"?a:a.source;i&&this.getPackageIdentity(c,"project")!==i||(s=!0,o.push({source:c,scope:"project"}))}if(e&&!s)throw new Error(this.buildNoMatchingPackageMessage(e,[...n.packages??[],...r.packages??[]]));await this.updateConfiguredSources(o)}async updateConfiguredSources(e){if(nU()||e.length===0)return;let n=[],r=[];for(let u of e){let l=this.parseSource(u.source);l.type==="npm"?l.pinned||n.push({...u,parsed:l}):l.type==="git"&&r.push({...u,parsed:l})}let i=n.map(u=>async()=>({entry:u,shouldUpdate:await this.shouldUpdateNpmSource(u.parsed,u.scope)})),s=await this.runWithConcurrency(i,e9n),o=[],a=[];for(let u of s)u.shouldUpdate&&(u.entry.scope==="user"?o.push(u.entry):a.push(u.entry));let c=[];if(o.length>0&&c.push(this.updateNpmBatch(o,"user")),a.length>0&&c.push(this.updateNpmBatch(a,"project")),r.length>0){let u=r.map(l=>async()=>this.withProgress("update",l.source,`Updating ${l.source}...`,async()=>{await this.updateGit(l.parsed,l.scope)}));c.push(this.runWithConcurrency(u,MKi).then(()=>{}))}await Promise.all(c)}async shouldUpdateNpmSource(e,n){let r=this.getManagedNpmInstallPath(e,n),i=(0,Ln.existsSync)(r)?this.getInstalledNpmVersion(r):void 0;if(!i)return!0;try{let s=await this.getLatestNpmVersion(e.version?e.spec:e.name,e.range);return(0,NE.gt)(s,i)}catch{return!0}}async updateNpmBatch(e,n){if(e.length===0)return;let r=e.length===1?e[0].source:`${n} npm packages`,i=e.length===1?`Updating ${e[0].source}...`:`Updating ${n} npm packages...`,s=e.map(o=>o.parsed.version?o.parsed.spec:`${o.parsed.name}@latest`);await this.withProgress("update",r,i,async()=>{await this.installNpmBatch(s,n)})}async installNpmBatch(e,n){let r=this.getNpmInstallRoot(n,!1);this.ensureNpmProject(r),await this.runNpmCommand(this.getNpmInstallArgs(e,r))}async checkForAvailableUpdates(){if(nU())return[];let e=this.settingsManager.getGlobalSettings(),n=this.settingsManager.getProjectSettings(),r=[];for(let a of n.packages??[])r.push({pkg:a,scope:"project"});for(let a of e.packages??[])r.push({pkg:a,scope:"user"});let s=this.dedupePackages(r).filter(a=>a.scope!=="temporary").map(a=>async()=>{let c=typeof a.pkg=="string"?a.pkg:a.pkg.source,u=this.parseSource(c);if(u.type==="local"||u.pinned)return;if(u.type==="npm"){let m=this.getNpmInstallPath(u,a.scope);return!(0,Ln.existsSync)(m)||!await this.npmHasAvailableUpdate(u,m)?void 0:{source:c,displayName:u.name,type:"npm",scope:a.scope}}let l=this.getGitInstallPath(u,a.scope);if(!(!(0,Ln.existsSync)(l)||!await this.gitHasAvailableUpdate(l)))return{source:c,displayName:`${u.host}/${u.path}`,type:"git",scope:a.scope}});return(await this.runWithConcurrency(s,e9n)).filter(a=>a!==void 0)}async resolvePackageSources(e,n,r){for(let{pkg:i,scope:s}of e){let o=typeof i=="string"?i:i.source,a=typeof i=="object"?i:void 0,c=this.findAutoloadDeltaBase(i,s,e),u=c?.source??o,l=c?.scope??s,d=this.parseSource(u),m={source:o,scope:s,origin:"package"};if(d.type==="local"){let f=this.getBaseDirForScope(l);this.resolveLocalExtensionSource(d,n,a,m,f);continue}let h=async()=>{if(nU())return!1;if(!r)return await this.installParsedSource(d,l),!0;let f=await r(u);if(f==="skip")return!1;if(f==="error")throw new Error(`Missing source: ${u}`);return await this.installParsedSource(d,l),!0};if(d.type==="npm"){let f=this.getNpmInstallPath(d,l);if(!(0,Ln.existsSync)(f)||!await this.installedNpmMatchesConfiguredVersion(d,f)){if(!await h())continue;f=this.getNpmInstallPath(d,l)}m.baseDir=f,this.collectPackageResources(f,n,a,m);continue}if(d.type==="git"){let f=this.getGitInstallPath(d,l);if((0,Ln.existsSync)(f))l==="temporary"&&!d.pinned&&!nU()&&await this.refreshTemporaryGitSource(d,u);else if(!await h())continue;m.baseDir=f,this.collectPackageResources(f,n,a,m)}}}findAutoloadDeltaBase(e,n,r){if(n!=="project"||typeof e!="object"||e.autoload!==!1)return;let i=this.getPackageIdentity(e.source,n),s=r.find(o=>o.scope==="user"&&this.getPackageIdentity(this.getPackageSourceString(o.pkg),"user")===i);return s?{source:this.getPackageSourceString(s.pkg),scope:"user"}:void 0}resolveLocalExtensionSource(e,n,r,i,s){let o=this.resolvePathFromBase(e.path,s);if((0,Ln.existsSync)(o))try{let a=(0,Ln.statSync)(o);if(a.isFile()){i.baseDir=(0,Sn.dirname)(o),this.addResource(n.extensions,o,i,!0);return}a.isDirectory()&&(i.baseDir=o,this.collectPackageResources(o,n,r,i)||this.addResource(n.extensions,o,i,!0))}catch{return}}async installParsedSource(e,n){if(e.type==="npm"){await this.installNpm(e,n,n==="temporary");return}if(e.type==="git"){await this.installGit(e,n);return}}getPackageSourceString(e){return typeof e=="string"?e:e.source}getSourceMatchKeyForInput(e){let n=this.parseSource(e);return n.type==="npm"?`npm:${n.name}`:n.type==="git"?`git:${n.host}/${n.path}`:`local:${this.resolvePath(n.path)}`}getSourceMatchKeyForSettings(e,n){let r=this.parseSource(e);if(r.type==="npm")return`npm:${r.name}`;if(r.type==="git")return`git:${r.host}/${r.path}`;let i=this.getBaseDirForScope(n);return`local:${this.resolvePathFromBase(r.path,i)}`}buildNoMatchingPackageMessage(e,n){let r=this.findSuggestedConfiguredSource(e,n);return r?`No matching package found for ${e}. Did you mean ${r}?`:`No matching package found for ${e}`}findSuggestedConfiguredSource(e,n){let r=e.trim(),i=new Set;for(let s of n){let o=this.getPackageSourceString(s),a=this.parseSource(o);if(a.type==="npm"){(r===a.name||r===a.spec)&&i.add(o);continue}if(a.type==="git"){let c=`${a.host}/${a.path}`,u=a.ref?`${c}@${a.ref}`:void 0;(r===c||u&&r===u)&&i.add(o)}}return i.values().next().value}packageSourcesMatch(e,n,r){let i=this.getSourceMatchKeyForSettings(this.getPackageSourceString(e),r),s=this.getSourceMatchKeyForInput(n);return i===s}normalizePackageSourceForSettings(e,n){let r=this.parseSource(e);if(r.type!=="local")return e;let i=this.getBaseDirForScope(n),s=this.resolvePath(r.path);return(0,Sn.relative)(i,s)||"."}parseSource(e){if(e.startsWith("npm:")){let r=e.slice(4).trim(),{name:i,version:s}=this.parseNpmSpec(r);return{type:"npm",spec:r,name:i,version:s,range:LKi(s),pinned:OKi(s)}}if(Ab(e))return{type:"local",path:e};let n=goe(e);return n||{type:"local",path:e}}async installedNpmMatchesConfiguredVersion(e,n){let r=this.getInstalledNpmVersion(n);return r?e.range?(0,NE.satisfies)(r,e.range):!0:!1}async npmHasAvailableUpdate(e,n){if(nU())return!1;let r=this.getInstalledNpmVersion(n);if(!r)return!1;try{let i=await this.getLatestNpmVersion(e.version?e.spec:e.name,e.range);return(0,NE.gt)(i,r)}catch{return!1}}getInstalledNpmVersion(e){let n=(0,Sn.join)(e,"package.json");if((0,Ln.existsSync)(n))try{let r=(0,Ln.readFileSync)(n,"utf-8");return JSON.parse(zs(r)).version}catch{return}}async getLatestNpmVersion(e,n){let r=this.getNpmCommand(),s=(await this.runCommandCapture(r.command,[...r.args,"view",e,"version","--json"],{cwd:this.cwd,timeoutMs:Bw})).trim();if(!s)throw new Error("Empty response from npm view");let o=JSON.parse(s);if(typeof o=="string")return o;if(Array.isArray(o)){let a=o.filter(u=>typeof u=="string"&&u.length>0),c=n?(0,NE.maxSatisfying)(a,n):[...a].sort(NE.rcompare)[0];if(c)return c}throw new Error("Unexpected response from npm view")}async gitHasAvailableUpdate(e){if(nU())return!1;try{let n=await this.runCommandCapture("git",["rev-parse","HEAD"],{cwd:e,timeoutMs:Bw}),r=await this.getRemoteGitHead(e);return n.trim()!==r.trim()}catch{return!1}}async getRemoteGitHead(e){let n=await this.getGitUpstreamRef(e);if(n){let o=(await this.runGitRemoteCommand(e,["ls-remote","origin",n])).match(/^([0-9a-f]{40})\s+/m);if(o?.[1])return o[1]}let i=(await this.runGitRemoteCommand(e,["ls-remote","origin","HEAD"])).match(/^([0-9a-f]{40})\s+HEAD$/m);if(!i?.[1])throw new Error("Failed to determine remote HEAD");return i[1]}async getLocalGitUpdateTarget(e){try{let r=(await this.runCommandCapture("git",["rev-parse","--abbrev-ref","@{upstream}"],{cwd:e,timeoutMs:Bw})).trim();if(!r.startsWith("origin/"))throw new Error(`Unsupported upstream remote: ${r}`);let i=r.slice(7);if(!i)throw new Error("Missing upstream branch name");return{ref:"@{upstream}",head:await this.runCommandCapture("git",["rev-parse","@{upstream}"],{cwd:e,timeoutMs:Bw}),fetchArgs:["fetch","--prune","--no-tags","origin",`+refs/heads/${i}:refs/remotes/origin/${i}`]}}catch{await this.runCommand("git",["remote","set-head","origin","-a"],{cwd:e}).catch(()=>{});let n=await this.runCommandCapture("git",["rev-parse","origin/HEAD"],{cwd:e,timeoutMs:Bw}),i=(await this.runCommandCapture("git",["symbolic-ref","refs/remotes/origin/HEAD"],{cwd:e,timeoutMs:Bw}).catch(()=>"")).trim().replace(/^refs\/remotes\/origin\//,"");return i?{ref:"origin/HEAD",head:n,fetchArgs:["fetch","--prune","--no-tags","origin",`+refs/heads/${i}:refs/remotes/origin/${i}`]}:{ref:"origin/HEAD",head:n,fetchArgs:["fetch","--prune","--no-tags","origin","+HEAD:refs/remotes/origin/HEAD"]}}}async getGitUpstreamRef(e){try{let r=(await this.runCommandCapture("git",["rev-parse","--abbrev-ref","@{upstream}"],{cwd:e,timeoutMs:Bw})).trim();if(!r.startsWith("origin/"))return;let i=r.slice(7);return i?`refs/heads/${i}`:void 0}catch{return}}runGitRemoteCommand(e,n){return this.runCommandCapture("git",n,{cwd:e,timeoutMs:Bw,env:{GIT_TERMINAL_PROMPT:"0"}})}async runWithConcurrency(e,n){if(e.length===0)return[];let r=new Array(e.length),i=0,s=Math.max(1,Math.min(n,e.length)),o=async()=>{for(;;){let a=i;if(i+=1,a>=e.length)return;r[a]=await e[a]()}};return await Promise.all(Array.from({length:s},()=>o())),r}getPackageIdentity(e,n){let r=this.parseSource(e);if(r.type==="npm")return`npm:${r.name}`;if(r.type==="git")return`git:${r.host}/${r.path}`;if(n){let i=this.getBaseDirForScope(n);return`local:${this.resolvePathFromBase(r.path,i)}`}return`local:${this.resolvePath(r.path)}`}dedupePackages(e){let n=[],r=new Map;for(let i of e){let s=this.getPackageIdentity(this.getPackageSourceString(i.pkg),i.scope),o=r.get(s);if(o===void 0){r.set(s,n.length),n.push(i);continue}let a=n[o];a?.scope==="project"&&i.scope==="user"?typeof a.pkg=="object"&&a.pkg.autoload===!1&&n.push(i):i.scope==="project"&&(n[o]=i)}return n}parseNpmSpec(e){let n=e.match(/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/);if(!n)return{name:e};let r=n[1]??e,i=n[2];return{name:r,version:i}}assertProjectTrustedForScope(e){if(e==="project"&&!this.settingsManager.isProjectTrusted())throw new Error("Project is not trusted; refusing to access project package storage")}getNpmCommand(){let e=this.settingsManager.getNpmCommand();if(!e||e.length===0)return{command:"npm",args:[]};let[n,...r]=e;if(!n)throw new Error("Invalid npmCommand: first array entry must be a non-empty command");return{command:n,args:r}}getPackageManagerName(){let e=this.getNpmCommand(),n=[e.command,...e.args],r=n.lastIndexOf("--"),i=r>=0?n[r+1]:e.command;return i?(0,Sn.basename)(i).replace(/\.(cmd|exe)$/i,""):""}async runNpmCommand(e,n){let r=this.getNpmCommand();await this.runCommand(r.command,[...r.args,...e],n)}getGitDependencyInstallArgs(){let e=this.settingsManager.getNpmCommand();return e&&e.length>0?["install"]:["install","--omit=dev"]}runNpmCommandSync(e){let n=this.getNpmCommand();return this.runCommandSync(n.command,[...n.args,...e])}getNpmInstallArgs(e,n){let r=this.getPackageManagerName();return r==="bun"?["install",...e,"--cwd",n,"--omit=peer"]:r==="pnpm"?["install",...e,"--prefix",n,"--config.auto-install-peers=false","--config.strict-peer-dependencies=false","--config.strict-dep-builds=false"]:["install",...e,"--prefix",n,"--legacy-peer-deps"]}async installNpm(e,n,r){let i=this.getNpmInstallRoot(n,r);this.ensureNpmProject(i),await this.runNpmCommand(this.getNpmInstallArgs([e.spec],i))}async uninstallNpm(e,n){let r=this.getNpmInstallRoot(n,!1);if(!(0,Ln.existsSync)(r))return;let i=this.getPackageManagerName();if(i==="bun"){await this.runNpmCommand(["uninstall",e.name,"--cwd",r]);return}let s=["uninstall",e.name,"--prefix",r];i!=="pnpm"&&s.push("--legacy-peer-deps"),await this.runNpmCommand(s)}async installGit(e,n){let r=this.getGitInstallPath(e,n);if((0,Ln.existsSync)(r)){if(e.ref){await this.ensureGitRef(r,["fetch","origin",e.ref],"FETCH_HEAD");return}let s=await this.getLocalGitUpdateTarget(r);await this.ensureGitRef(r,s.fetchArgs,s.ref);return}let i=this.getGitInstallRoot(n);i&&this.ensureGitIgnore(i),(0,Ln.mkdirSync)((0,Sn.dirname)(r),{recursive:!0}),(0,Ln.rmSync)(this.getGitUpdateMarkerPath(r),{force:!0});try{await this.runCommand("git",["clone",e.repo,r]),e.ref&&await this.runCommand("git",["checkout",e.ref],{cwd:r});let s=(0,Sn.join)(r,"package.json");(0,Ln.existsSync)(s)&&await this.runNpmCommand(this.getGitDependencyInstallArgs(),{cwd:r})}catch(s){throw(0,Ln.rmSync)(r,{recursive:!0,force:!0}),this.pruneEmptyGitParents(r,i),s}}async updateGit(e,n){let r=this.getGitInstallPath(e,n);if(!(0,Ln.existsSync)(r)){await this.installGit(e,n);return}if(e.ref){await this.ensureGitRef(r,["fetch","origin",e.ref],"FETCH_HEAD");return}let i=await this.getLocalGitUpdateTarget(r);await this.ensureGitRef(r,i.fetchArgs,i.ref)}hasMissingGitDependencies(e){let n=(0,Sn.join)(e,"package.json");if(!(0,Ln.existsSync)(n))return!1;try{let r=JSON.parse(zs((0,Ln.readFileSync)(n,"utf-8")));if(!r.dependencies||typeof r.dependencies!="object"||Array.isArray(r.dependencies))return!1;let i=(0,Sn.resolve)(e,"node_modules");return Object.keys(r.dependencies).some(s=>{let o=(0,Sn.resolve)(i,s);return o.startsWith(`${i}${Sn.sep}`)?!(0,Ln.existsSync)(o):!1})}catch{return!1}}async repairMissingGitDependencies(e){this.hasMissingGitDependencies(e)&&await this.runNpmCommand(this.getGitDependencyInstallArgs(),{cwd:e})}getGitUpdateMarkerPath(e){return(0,Sn.join)((0,Sn.dirname)(e),`.${(0,Sn.basename)(e)}.pi-update-incomplete`)}async cleanAndInstallGitDependencies(e,n){try{await this.runCommand("git",["clean","-fdx"],{cwd:e})}catch(i){throw await this.repairMissingGitDependencies(e).catch(()=>{}),i}let r=(0,Sn.join)(e,"package.json");(0,Ln.existsSync)(r)&&await this.runNpmCommand(this.getGitDependencyInstallArgs(),{cwd:e}),(0,Ln.rmSync)(n,{force:!0})}async ensureGitRef(e,n,r){await this.runCommand("git",n,{cwd:e});let i=await this.runCommandCapture("git",["rev-parse","HEAD"],{cwd:e,timeoutMs:Bw}),s=`${r}^{commit}`,o=await this.runCommandCapture("git",["rev-parse",s],{cwd:e,timeoutMs:Bw}),a=this.getGitUpdateMarkerPath(e);if(i.trim()===o.trim()){(0,Ln.existsSync)(a)?await this.cleanAndInstallGitDependencies(e,a):await this.repairMissingGitDependencies(e);return}(0,Ln.writeFileSync)(a,"","utf-8"),await this.runCommand("git",["reset","--hard",s],{cwd:e}),await this.cleanAndInstallGitDependencies(e,a)}async refreshTemporaryGitSource(e,n){if(!nU())try{await this.withProgress("pull",n,`Refreshing ${n}...`,async()=>{await this.updateGit(e,"temporary")})}catch{}}async removeGit(e,n){let r=this.getGitInstallPath(e,n);(0,Ln.rmSync)(r,{recursive:!0,force:!0}),(0,Ln.rmSync)(this.getGitUpdateMarkerPath(r),{force:!0}),this.pruneEmptyGitParents(r,this.getGitInstallRoot(n))}pruneEmptyGitParents(e,n){if(!n)return;let r=(0,Sn.resolve)(n),i=(0,Sn.dirname)(e);for(;i.startsWith(r)&&i!==r;){if(!(0,Ln.existsSync)(i)){i=(0,Sn.dirname)(i);continue}if((0,Ln.readdirSync)(i).length>0)break;try{(0,Ln.rmSync)(i,{recursive:!0,force:!0})}catch{break}i=(0,Sn.dirname)(i)}}ensureNpmProject(e){(0,Ln.existsSync)(e)||(0,Ln.mkdirSync)(e,{recursive:!0}),ORn(e),this.ensureGitIgnore(e);let n=(0,Sn.join)(e,"package.json");(0,Ln.existsSync)(n)||(0,Ln.writeFileSync)(n,JSON.stringify({name:"pi-extensions",private:!0},null,2),"utf-8")}ensureGitIgnore(e){(0,Ln.existsSync)(e)||(0,Ln.mkdirSync)(e,{recursive:!0});let n=(0,Sn.join)(e,".gitignore");(0,Ln.existsSync)(n)||(0,Ln.writeFileSync)(n,`* !.gitignore -`,"utf-8")}getNpmInstallRoot(e,n){return n?this.getTemporaryDir("npm"):e==="project"?(this.assertProjectTrustedForScope(e),(0,Sn.join)(this.cwd,ws,"npm")):(0,Sn.join)(this.agentDir,"npm")}getGlobalNpmRoot(){let e=this.getNpmCommand(),n=[e.command,...e.args].join("\0");if(this.globalNpmRoot&&this.globalNpmRootCommandKey===n)return this.globalNpmRoot;if(this.getPackageManagerName()==="bun"){let r=this.runNpmCommandSync(["pm","bin","-g"]).trim();this.globalNpmRoot=(0,Sn.join)((0,Sn.dirname)(r),"install","global","node_modules")}else this.globalNpmRoot=this.runNpmCommandSync(["root","-g"]).trim();return this.globalNpmRootCommandKey=n,this.globalNpmRoot}getPnpmGlobalPackagePath(e){if(this.getPackageManagerName()!=="pnpm")return;let n=this.runNpmCommandSync(["list","-g","--depth","0","--json"]),r=JSON.parse(n);for(let s of r){let i=s.dependencies?.[e]?.path;if(i)return i}}getManagedNpmInstallPath(e,n){return n==="temporary"?(0,Sn.join)(this.getTemporaryDir("npm"),"node_modules",e.name):n==="project"?(this.assertProjectTrustedForScope(n),(0,Sn.join)(this.cwd,ws,"npm","node_modules",e.name)):(0,Sn.join)(this.agentDir,"npm","node_modules",e.name)}getLegacyGlobalNpmInstallPath(e){try{return this.getPnpmGlobalPackagePath(e.name)??(0,Sn.join)(this.getGlobalNpmRoot(),e.name)}catch{return}}getNpmInstallPath(e,n){let r=this.getManagedNpmInstallPath(e,n);if(n!=="user"||(0,On.existsSync)(r))return r;let s=this.getLegacyGlobalNpmInstallPath(e);return s&&(0,On.existsSync)(s)?s:r}getGitInstallPath(e,n){if(n==="temporary")return this.getTemporaryDir(`git-${e.host}`,e.path);let r=this.getGitInstallRoot(n);if(!r)throw new Error("Missing git install root");return this.resolveManagedPath(r,e.host,e.path)}getGitInstallRoot(e){if(e!=="temporary")return e==="project"?(this.assertProjectTrustedForScope(e),(0,Sn.join)(this.cwd,ws,"git")):(0,Sn.join)(this.agentDir,"git")}getTemporaryDir(e,n){let r=this.resolveManagedPath(fCs(this.agentDir),e),s=(0,ZIn.createHash)("sha256").update(`${e}-${n??""}`).digest("hex").slice(0,8);return this.resolveManagedPath(r,s,n??"")}resolveManagedPath(e,...n){let r=(0,Sn.resolve)(e),s=(0,Sn.resolve)(r,...n);if(s!==r&&!s.startsWith(`${r}${Sn.sep}`))throw new Error(`Refusing to use path outside package install root: ${s}`);return s}getBaseDirForScope(e){return e==="project"?(this.assertProjectTrustedForScope(e),(0,Sn.join)(this.cwd,ws)):e==="user"?this.agentDir:this.cwd}resolvePath(e){return jn(e,this.cwd,{homeDir:ltt(),trim:!0})}resolvePathFromBase(e,n){return jn(e,n,{homeDir:ltt(),trim:!0})}collectPackageResources(e,n,r,s){if(r){for(let a of TIe){let c=r[a],u=this.getTargetMap(n,a);r.autoload===!1?this.applyPackageDeltaFilter(e,c??[],a,u,s):c!==void 0?this.applyPackageFilter(e,c,a,u,s):this.collectDefaultResources(e,a,u,s)}return!0}let i=pL((0,Sn.join)(e,"package.json"));if(i){for(let a of TIe){let c=i[a];this.addManifestEntries(c,e,a,this.getTargetMap(n,a),s)}return!0}let o=!1;for(let a of TIe){let c=(0,Sn.join)(e,a);if((0,On.existsSync)(c)){let u=RIe(c,a);for(let l of u)this.addResource(this.getTargetMap(n,a),l,s,!0);o=!0}}return o}collectDefaultResources(e,n,r,s){let o=pL((0,Sn.join)(e,"package.json"))?.[n];if(o){this.addManifestEntries(o,e,n,r,s);return}let a=(0,Sn.join)(e,n);if((0,On.existsSync)(a)){let c=RIe(a,n);for(let u of c)this.addResource(r,u,s,!0)}}applyPackageFilter(e,n,r,s,i){let{allFiles:o}=this.collectManifestFiles(e,r);if(n.length===0){for(let c of o)this.addResource(s,c,i,!1);return}let a=kIe(o,n,e);for(let c of o){let u=a.has(c);this.addResource(s,c,i,u)}}applyPackageDeltaFilter(e,n,r,s,i){if(n.length===0)return;let{allFiles:o}=this.collectManifestFiles(e,r),a=wCs(o,n,e);for(let[c,u]of a)this.addResource(s,c,i,u)}collectManifestFiles(e,n){let s=pL((0,Sn.join)(e,"package.json"))?.[n];if(s&&s.length>0){let a=this.collectFilesFromManifestEntries(s,e,n),c=s.filter(utt),u=c.length>0?kIe(a,c,e):new Set(a);return{allFiles:Array.from(u),enabledByManifest:u}}let i=(0,Sn.join)(e,n);if(!(0,On.existsSync)(i))return{allFiles:[],enabledByManifest:new Set};let o=RIe(i,n);return{allFiles:o,enabledByManifest:new Set(o)}}addManifestEntries(e,n,r,s,i){if(!e)return;let o=this.collectFilesFromManifestEntries(e,n,r),a=e.filter(utt),c=kIe(o,a,n);for(let u of o)c.has(u)&&this.addResource(s,u,i,!0)}collectFilesFromManifestEntries(e,n,r){let i=e.filter(o=>!utt(o)).flatMap(o=>yCs(o)?ECs(o,n):[(0,Sn.resolve)(n,o)]);return this.collectFilesFromPaths(i,r)}resolveLocalEntries(e,n,r,s,i){if(e.length===0)return;let{plain:o,patterns:a}=bCs(e),c=o.map(d=>this.resolvePathFromBase(d,i)),u=this.collectFilesFromPaths(c,n),l=kIe(u,a,i);for(let d of u)this.addResource(r,d,s,l.has(d))}addAutoDiscoveredResources(e,n,r,s,i){let o={source:"auto",scope:"user",origin:"top-level",baseDir:s},a={source:"auto",scope:"project",origin:"top-level",baseDir:i},c={extensions:n.extensions??[],skills:n.skills??[],prompts:n.prompts??[],themes:n.themes??[]},u={extensions:r.extensions??[],skills:r.skills??[],prompts:r.prompts??[],themes:r.themes??[]},l={extensions:(0,Sn.join)(s,"extensions"),skills:(0,Sn.join)(s,"skills"),prompts:(0,Sn.join)(s,"prompts"),themes:(0,Sn.join)(s,"themes")},d={extensions:(0,Sn.join)(i,"extensions"),skills:(0,Sn.join)(i,"skills"),prompts:(0,Sn.join)(i,"prompts"),themes:(0,Sn.join)(i,"themes")},h=(0,Sn.join)(ltt(),".agents","skills"),m=this.settingsManager.isProjectTrusted(),f=m?SCs(this.cwd).filter(b=>(0,Sn.resolve)(b)!==(0,Sn.resolve)(h)):[],g=(b,S,C,I,x)=>{let w=this.getTargetMap(e,b);for(let R of S){let N=xCs(R,I,x);this.addResource(w,R,C,N)}};m&&(g("extensions",dtt(d.extensions),a,u.extensions,i),g("skills",vIe(d.skills,"pi"),a,u.skills,i));for(let b of f){let S=(0,Sn.dirname)(b),C={...a,baseDir:S};g("skills",vIe(b,"agents"),C,u.skills,S)}m&&(g("prompts",zIn(d.prompts),a,u.prompts,i),g("themes",JIn(d.themes),a,u.themes,i)),g("extensions",dtt(l.extensions),o,c.extensions,s),g("skills",vIe(l.skills,"pi"),o,c.skills,s);let A=(0,Sn.dirname)(h),y={...o,baseDir:A};g("skills",vIe(h,"agents"),y,c.skills,A),g("prompts",zIn(l.prompts),o,c.prompts,s),g("themes",JIn(l.themes),o,c.themes,s)}collectFilesFromPaths(e,n){let r=[];for(let s of e)if((0,On.existsSync)(s))try{let i=(0,On.statSync)(s);i.isFile()?r.push(s):i.isDirectory()&&r.push(...RIe(s,n))}catch{}return r}getTargetMap(e,n){switch(n){case"extensions":return e.extensions;case"skills":return e.skills;case"prompts":return e.prompts;case"themes":return e.themes;default:throw new Error(`Unknown resource type: ${n}`)}}addResource(e,n,r,s){n&&(e.has(n)||e.set(n,{metadata:r,enabled:s}))}createAccumulator(){return{extensions:new Map,skills:new Map,prompts:new Map,themes:new Map}}toResolvedPaths(e){let n=r=>{let s=Array.from(r.entries()).map(([o,{metadata:a,enabled:c}])=>({path:o,enabled:c,metadata:a}));s.sort((o,a)=>KIn(o.metadata)-KIn(a.metadata));let i=new Set;return s.filter(o=>{let a=fu(o.path);return i.has(a)?!1:(i.add(a),!0)})};return{extensions:n(e.extensions),skills:n(e.skills),prompts:n(e.prompts),themes:n(e.themes)}}spawnCommand(e,n,r){let s=ctt();return W3(e,n,{cwd:r?.cwd,stdio:jIn()?["ignore",2,2]:"inherit",env:s})}spawnCaptureCommand(e,n,r){let s=ctt(),i=r?.env?{...s,...r.env}:s;return W3(e,n,{cwd:r?.cwd,stdio:["ignore","pipe","pipe"],env:i})}runCommandCapture(e,n,r){return new Promise((s,i)=>{let o=this.spawnCaptureCommand(e,n,r),a="",c="",u=!1,l=typeof r?.timeoutMs=="number"?setTimeout(()=>{u=!0,o.kill()},r.timeoutMs):void 0;o.stdout?.on("data",d=>{a+=d.toString()}),o.stderr?.on("data",d=>{c+=d.toString()}),o.once("error",d=>{l&&clearTimeout(l),i(d)}),o.once("close",(d,h)=>{if(l&&clearTimeout(l),u){i(new Error(`${e} ${n.join(" ")} timed out after ${r?.timeoutMs}ms`));return}if(d===0){s(a.trim());return}let m=d===null?`signal ${h??"unknown"}`:`code ${d}`;i(new Error(`${e} ${n.join(" ")} failed with ${m}: ${c||a}`))})})}runCommand(e,n,r){return new Promise((s,i)=>{let o=this.spawnCommand(e,n,r);o.on("error",i),o.on("exit",a=>{a===0?s():i(new Error(`${e} ${n.join(" ")} failed with code ${a}`))})})}runCommandSync(e,n){let r=ctt(),s=Vw(e,n,{stdio:["ignore","pipe","pipe"],encoding:"utf-8",env:r});if(s.error||s.status!==0)throw new Error(`Failed to run ${e} ${n.join(" ")}: ${s.error?.message||s.stderr||s.stdout}`);return(s.stdout||s.stderr||"").trim()}};p();var Fa=require("node:fs"),Qi=require("node:path");p();var PIe=require("child_process"),Vu=require("fs"),ly=require("path");function DIe(t){let e=t;for(;;){let n=(0,ly.join)(e,".git");if((0,Vu.existsSync)(n))try{let s=(0,Vu.statSync)(n);if(s.isFile()){let i=(0,Vu.readFileSync)(n,"utf8").trim();if(i.startsWith("gitdir: ")){let o=(0,ly.resolve)(e,i.slice(8).trim()),a=(0,ly.join)(o,"HEAD");if(!(0,Vu.existsSync)(a))return null;let c=(0,ly.join)(o,"commondir"),u=(0,Vu.existsSync)(c)?(0,ly.resolve)(o,(0,Vu.readFileSync)(c,"utf8").trim()):o;return{repoDir:e,commonGitDir:u,headPath:a}}}else if(s.isDirectory()){let i=(0,ly.join)(n,"HEAD");return(0,Vu.existsSync)(i)?{repoDir:e,commonGitDir:n,headPath:i}:null}}catch{return null}let r=(0,ly.dirname)(e);if(r===e)return null;e=r}}function TCs(t){let e=(0,PIe.spawnSync)("git",["--no-optional-locks","symbolic-ref","--quiet","--short","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]});return(e.status===0?e.stdout.trim():"")||null}function vCs(t){return new Promise(e=>{(0,PIe.execFile)("git",["--no-optional-locks","symbolic-ref","--quiet","--short","HEAD"],{cwd:t,encoding:"utf8"},(n,r)=>{if(n){e(null);return}let s=r.trim();e(s||null)})})}function RCs(){return process.platform==="linux"&&!!(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP)}function kCs(t){return/^\/mnt\/[a-z](?:\/|$)/i.test(t)}function NCs(t){return RCs()&&kCs(t)}var BIe=class t{cwd;static WATCH_DEBOUNCE_MS=500;extensionStatuses=new Map;cachedBranch=void 0;gitPaths=void 0;headWatcher=null;headWatchFilePath=null;headWatchFileListener=null;reftableWatcher=null;reftableTablesListWatcher=null;reftableTablesListPath=null;branchChangeCallbacks=new Set;availableProviderCount=0;refreshTimer=null;gitWatcherRetryTimer=null;refreshInFlight=!1;refreshPending=!1;disposed=!1;constructor(e){this.cwd=e,this.gitPaths=DIe(e),this.setupGitWatcher()}getGitBranch(){return this.cachedBranch===void 0&&(this.cachedBranch=this.resolveGitBranchSync()),this.cachedBranch}getExtensionStatuses(){return this.extensionStatuses}onBranchChange(e){return this.branchChangeCallbacks.add(e),()=>this.branchChangeCallbacks.delete(e)}setExtensionStatus(e,n){n===void 0?this.extensionStatuses.delete(e):this.extensionStatuses.set(e,n)}clearExtensionStatuses(){this.extensionStatuses.clear()}getAvailableProviderCount(){return this.availableProviderCount}setAvailableProviderCount(e){this.availableProviderCount=e}setCwd(e){this.cwd!==e&&(this.cwd=e,this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null),this.clearGitWatchers(),this.cachedBranch=void 0,this.gitPaths=DIe(e),this.setupGitWatcher(),this.notifyBranchChange())}dispose(){this.disposed=!0,this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null),this.clearGitWatchers(),this.branchChangeCallbacks.clear()}notifyBranchChange(){for(let e of this.branchChangeCallbacks)e()}scheduleRefresh(){if(!(this.disposed||this.refreshTimer)){if(this.refreshInFlight){this.refreshPending=!0;return}this.refreshTimer=setTimeout(()=>{this.refreshTimer=null,this.refreshGitBranchAsync()},t.WATCH_DEBOUNCE_MS)}}async refreshGitBranchAsync(){if(!this.disposed){if(this.refreshInFlight){this.refreshPending=!0;return}this.refreshInFlight=!0;try{let e=await this.resolveGitBranchAsync();if(this.disposed)return;if(this.cachedBranch!==void 0&&this.cachedBranch!==e){this.cachedBranch=e,this.notifyBranchChange();return}this.cachedBranch=e}finally{this.refreshInFlight=!1,this.refreshPending&&!this.disposed&&(this.refreshPending=!1,this.scheduleRefresh())}}}resolveGitBranchSync(){try{if(!this.gitPaths)return null;let e=(0,Vu.readFileSync)(this.gitPaths.headPath,"utf8").trim();if(e.startsWith("ref: refs/heads/")){let n=e.slice(16);return n===".invalid"?TCs(this.gitPaths.repoDir)??"detached":n}return"detached"}catch{return null}}async resolveGitBranchAsync(){try{if(!this.gitPaths)return null;let e=(0,Vu.readFileSync)(this.gitPaths.headPath,"utf8").trim();if(e.startsWith("ref: refs/heads/")){let n=e.slice(16);return n===".invalid"?await vCs(this.gitPaths.repoDir)??"detached":n}return"detached"}catch{return null}}clearGitWatchers(){FM(this.headWatcher),this.headWatcher=null,this.headWatchFilePath&&this.headWatchFileListener&&((0,Vu.unwatchFile)(this.headWatchFilePath,this.headWatchFileListener),this.headWatchFilePath=null,this.headWatchFileListener=null),FM(this.reftableWatcher),this.reftableWatcher=null,FM(this.reftableTablesListWatcher),this.reftableTablesListWatcher=null,this.reftableTablesListPath&&((0,Vu.unwatchFile)(this.reftableTablesListPath),this.reftableTablesListPath=null),this.gitWatcherRetryTimer&&(clearTimeout(this.gitWatcherRetryTimer),this.gitWatcherRetryTimer=null)}scheduleGitWatcherRetry(){this.disposed||this.gitWatcherRetryTimer||(this.gitWatcherRetryTimer=setTimeout(()=>{this.gitWatcherRetryTimer=null,this.setupGitWatcher()},xin))}handleGitWatcherError(){this.clearGitWatchers(),this.scheduleGitWatcherRetry()}setupGitWatcher(){if(this.clearGitWatchers(),!this.gitPaths)return;let e=NCs(this.gitPaths.repoDir);if(this.headWatcher=CH((0,ly.dirname)(this.gitPaths.headPath),(r,s)=>{(!s||s==="HEAD")&&this.scheduleRefresh()},()=>this.handleGitWatcherError()),e&&(this.headWatchFilePath=this.gitPaths.headPath,this.headWatchFileListener=(r,s)=>{(r.mtimeMs!==s.mtimeMs||r.ctimeMs!==s.ctimeMs||r.size!==s.size)&&this.scheduleRefresh()},(0,Vu.watchFile)(this.headWatchFilePath,{interval:1e3},this.headWatchFileListener)),!this.headWatcher&&!e)return;let n=(0,ly.join)(this.gitPaths.commonGitDir,"reftable");if((0,Vu.existsSync)(n)){if(this.reftableWatcher=CH(n,()=>{this.scheduleRefresh()},()=>this.handleGitWatcherError()),!this.reftableWatcher)return;let r=(0,ly.join)(n,"tables.list");if((0,Vu.existsSync)(r)){if(this.reftableTablesListPath=r,this.reftableTablesListWatcher=CH(r,()=>{this.scheduleRefresh()},()=>this.handleGitWatcherError()),!this.reftableTablesListWatcher)return;(0,Vu.watchFile)(r,{interval:250},(s,i)=>{(s.mtimeMs!==i.mtimeMs||s.ctimeMs!==i.ctimeMs||s.size!==i.size)&&this.scheduleRefresh()})}}}};p();var uPn=require("crypto"),LT=require("fs"),SF=require("path"),dPn=Gt(Iee(),1);p();var aot=require("node:events"),vI=Gt(aPn(),1),lot=3e5,BQs=2e3,Uwe=[{label:"30 sec",timeoutMs:3e4},{label:"1 min",timeoutMs:6e4},{label:"2 min",timeoutMs:12e4},{label:"5 min",timeoutMs:3e5},{label:"disabled",timeoutMs:0}],PQs=globalThis.fetch,oot;function $we(t){if(typeof t=="string"){let e=t.trim();return e.toLowerCase()==="disabled"?0:e.length===0?void 0:$we(Number(e))}if(!(typeof t!="number"||!Number.isFinite(t)||t<0))return Math.floor(t)}function Gwe(t){let e=Uwe.find(n=>n.timeoutMs===t);return e?e.label:`${t/1e3} sec`}function uot(t){let e=t?.trim();e&&(process.env.HTTP_PROXY??=e,process.env.HTTPS_PROXY??=e)}var OQs=t=>{};function dot(t){return t instanceof aot.EventEmitter&&aot.EventEmitter.prototype.on.call(t,"error",OQs),t}function cot(t,e){return dot(new vI.Client(t,e))}function MQs(t,e){let n=e;return n.connections===1?cot(t,n):dot(new vI.Pool(t,{...n,factory:cot}))}function mV(t=lot){let e=$we(t);if(e===void 0)throw new Error(`Invalid HTTP idle timeout: ${String(t)}`);let n=dot(new vI.EnvHttpProxyAgent({allowH2:!1,proxyTunnel:!0,bodyTimeout:e,connect:{autoSelectFamilyAttemptTimeout:BQs},headersTimeout:e,clientFactory:cot,factory:MQs}));vI.setGlobalDispatcher(n),(oot===void 0?globalThis.fetch===PQs:globalThis.fetch===oot)&&(vI.install?.(),oot=globalThis.fetch)}function cPn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function pPn(t,e){let n={...t};for(let r of Object.keys(e)){let s=e[r];if(s===void 0)continue;let i=t[r];n[r]=cPn(i)&&cPn(s)?pPn(i,s):s}return n}function _F(t,e){return pPn(t,e)}function lPn(t,e){let n=$we(t);if(n!==void 0)return n;if(t!==void 0)throw new Error(`Invalid ${e} setting: ${String(t)}`)}function pot(t,e,n){return{scope:t,...n?{path:n}:{},error:e instanceof Error?e:new Error(String(e))}}var hot=class{globalSettingsPath;projectSettingsPath;constructor(e,n){let r=jn(e),s=jn(n);this.globalSettingsPath=(0,SF.join)(s,"settings.json"),this.projectSettingsPath=(0,SF.join)(r,ws,"settings.json")}acquireLockSyncWithRetry(e){let s;for(let i=1;i<=10;i++)try{return dPn.default.lockSync(e,{realpath:!1})}catch(o){if((typeof o=="object"&&o!==null&&"code"in o?String(o.code):void 0)!=="ELOCKED"||i===10)throw o;s=o;let c=Date.now();for(;Date.now()-c<20;);}throw s??new Error("Failed to acquire settings lock")}withLock(e,n){let r=e==="global"?this.globalSettingsPath:this.projectSettingsPath,s=(0,SF.dirname)(r),i;try{let o=(0,LT.existsSync)(r);o&&(i=this.acquireLockSyncWithRetry(r));let a=o?(0,LT.readFileSync)(r,"utf-8"):void 0,c=n(a);c!==void 0&&((0,LT.existsSync)(s)||(0,LT.mkdirSync)(s,{recursive:!0}),i||(i=this.acquireLockSyncWithRetry(r)),(0,LT.writeFileSync)(r,c,"utf-8"))}finally{i&&i()}}},mot=class{global;project;withLock(e,n){let r=e==="global"?this.global:this.project,s=n(r);s!==void 0&&(e==="global"?this.global=s:this.project=s)}},El=class t{storage;globalSettings;projectSettings;settings;projectTrusted;modifiedFields=new Set;modifiedNestedFields=new Map;modifiedProjectFields=new Set;modifiedProjectNestedFields=new Map;globalSettingsLoadError=null;projectSettingsLoadError=null;writeQueue=Promise.resolve();errors;settingsPaths;constructor(e,n,r,s=null,i=null,o=[],a=!0,c={}){this.storage=e,this.globalSettings=n,this.projectSettings=r,this.projectTrusted=a,this.globalSettingsLoadError=s,this.projectSettingsLoadError=i,this.errors=[...o],this.settingsPaths=c,this.settings=_F(this.globalSettings,this.projectSettings)}static create(e,n=ls(),r={}){let s=jn(e),i=jn(n),o=new hot(s,i);return t.fromStorageWithPaths(o,r,{global:(0,SF.join)(i,"settings.json"),project:(0,SF.join)(s,ws,"settings.json")})}static fromStorage(e,n={}){return t.fromStorageWithPaths(e,n)}static fromStorageWithPaths(e,n,r={}){let s=n.projectTrusted??!0,i=t.tryLoadFromStorage(e,"global"),o=t.tryLoadFromStorage(e,"project",s),a=[];return i.error&&a.push(pot("global",i.error,r.global)),o.error&&a.push(pot("project",o.error,r.project)),new t(e,i.settings,o.settings,i.error,o.error,a,s,r)}static inMemory(e={},n={}){let r=new mot,s=t.migrateSettings(structuredClone(e));return r.withLock("global",()=>JSON.stringify(s,null,2)),t.fromStorage(r,n)}static loadFromStorage(e,n,r=!0){if(n==="project"&&!r)return{};let s;if(e.withLock(n,o=>{s=o}),!s)return{};let i=JSON.parse(Mi(s));return t.migrateSettings(i)}static tryLoadFromStorage(e,n,r=!0){try{return{settings:t.loadFromStorage(e,n,r),error:null}}catch(s){return{settings:{},error:s}}}static migrateSettings(e){if("queueMode"in e&&!("steeringMode"in e)&&(e.steeringMode=e.queueMode,delete e.queueMode),!("transport"in e)&&typeof e.websockets=="boolean"&&(e.transport=e.websockets?"websocket":"sse",delete e.websockets),"skills"in e&&typeof e.skills=="object"&&e.skills!==null&&!Array.isArray(e.skills)){let n=e.skills;n.enableSkillCommands!==void 0&&e.enableSkillCommands===void 0&&(e.enableSkillCommands=n.enableSkillCommands),Array.isArray(n.customDirectories)&&n.customDirectories.length>0?e.skills=n.customDirectories:delete e.skills}if("retry"in e&&typeof e.retry=="object"&&e.retry!==null&&!Array.isArray(e.retry)){let n=e.retry,r=typeof n.provider=="object"&&n.provider!==null?n.provider:void 0;typeof n.maxDelayMs=="number"&&(r?.maxRetryDelayMs===void 0||r?.maxRetryDelayMs===null)&&(n.provider={...r??{},maxRetryDelayMs:n.maxDelayMs}),delete n.maxDelayMs}return e}getGlobalSettings(){return structuredClone(this.globalSettings)}getProjectSettings(){return structuredClone(this.projectSettings)}isProjectTrusted(){return this.projectTrusted}setProjectTrusted(e){if(this.projectTrusted===e)return;if(this.projectTrusted=e,this.modifiedProjectFields.clear(),this.modifiedProjectNestedFields.clear(),!e){this.projectSettings={},this.projectSettingsLoadError=null,this.settings=_F(this.globalSettings,this.projectSettings);return}let n=t.tryLoadFromStorage(this.storage,"project",e);this.projectSettings=n.settings,this.projectSettingsLoadError=n.error,n.error&&this.recordError("project",n.error),this.settings=_F(this.globalSettings,this.projectSettings)}async reload(){await this.writeQueue;let e=t.tryLoadFromStorage(this.storage,"global");e.error?(this.globalSettingsLoadError=e.error,this.recordError("global",e.error)):(this.globalSettings=e.settings,this.globalSettingsLoadError=null),this.modifiedFields.clear(),this.modifiedNestedFields.clear(),this.modifiedProjectFields.clear(),this.modifiedProjectNestedFields.clear();let n=t.tryLoadFromStorage(this.storage,"project",this.projectTrusted);n.error?(this.projectSettingsLoadError=n.error,this.recordError("project",n.error)):(this.projectSettings=n.settings,this.projectSettingsLoadError=null),this.settings=_F(this.globalSettings,this.projectSettings)}applyOverrides(e){this.settings=_F(this.settings,e)}markModified(e,n){this.modifiedFields.add(e),n&&(this.modifiedNestedFields.has(e)||this.modifiedNestedFields.set(e,new Set),this.modifiedNestedFields.get(e).add(n))}markProjectModified(e,n){this.modifiedProjectFields.add(e),n&&(this.modifiedProjectNestedFields.has(e)||this.modifiedProjectNestedFields.set(e,new Set),this.modifiedProjectNestedFields.get(e).add(n))}assertProjectTrustedForWrite(){if(!this.projectTrusted)throw new Error("Project is not trusted; refusing to write project settings")}recordError(e,n){this.errors.push(pot(e,n,this.settingsPaths[e]))}clearModifiedScope(e){if(e==="global"){this.modifiedFields.clear(),this.modifiedNestedFields.clear();return}this.modifiedProjectFields.clear(),this.modifiedProjectNestedFields.clear()}enqueueWrite(e,n){this.writeQueue=this.writeQueue.then(()=>{e==="project"&&this.assertProjectTrustedForWrite(),n(),this.clearModifiedScope(e)}).catch(r=>{this.recordError(e,r)})}cloneModifiedNestedFields(e){let n=new Map;for(let[r,s]of e.entries())n.set(r,new Set(s));return n}persistScopedSettings(e,n,r,s){this.storage.withLock(e,i=>{let o=i?t.migrateSettings(JSON.parse(Mi(i))):{},a={...o};for(let c of r){let u=n[c];if(s.has(c)&&typeof u=="object"&&u!==null){let l=s.get(c),d=o[c]??{},h=u,m={...d};for(let f of l)m[f]=h[f];a[c]=m}else a[c]=u}return JSON.stringify(a,null,2)})}save(){if(this.settings=_F(this.globalSettings,this.projectSettings),this.globalSettingsLoadError)return;let e=structuredClone(this.globalSettings),n=new Set(this.modifiedFields),r=this.cloneModifiedNestedFields(this.modifiedNestedFields);this.enqueueWrite("global",()=>{this.persistScopedSettings("global",e,n,r)})}saveProjectSettings(e){if(this.assertProjectTrustedForWrite(),this.projectSettings=structuredClone(e),this.settings=_F(this.globalSettings,this.projectSettings),this.projectSettingsLoadError)return;let n=structuredClone(this.projectSettings),r=new Set(this.modifiedProjectFields),s=this.cloneModifiedNestedFields(this.modifiedProjectNestedFields);this.enqueueWrite("project",()=>{this.persistScopedSettings("project",n,r,s)})}updateProjectSettings(e,n){this.assertProjectTrustedForWrite();let r=structuredClone(this.projectSettings);n(r),this.markProjectModified(e),this.saveProjectSettings(r)}async flush(){await this.writeQueue}drainErrors(){let e=[...this.errors];return this.errors=[],e}getLastChangelogVersion(){return this.settings.lastChangelogVersion}setLastChangelogVersion(e){this.globalSettings.lastChangelogVersion=e,this.markModified("lastChangelogVersion"),this.save()}getSessionDir(){let e=this.settings.sessionDir;return e&&Mo(e)}getDefaultProvider(){return this.settings.defaultProvider}getDefaultModel(){return this.settings.defaultModel}setDefaultProvider(e){this.globalSettings.defaultProvider=e,this.markModified("defaultProvider"),this.save()}setDefaultModel(e){this.globalSettings.defaultModel=e,this.markModified("defaultModel"),this.save()}setDefaultModelAndProvider(e,n){this.globalSettings.defaultProvider=e,this.globalSettings.defaultModel=n,this.markModified("defaultProvider"),this.markModified("defaultModel"),this.save()}getSteeringMode(){return this.settings.steeringMode||"one-at-a-time"}setSteeringMode(e){this.globalSettings.steeringMode=e,this.markModified("steeringMode"),this.save()}getFollowUpMode(){return this.settings.followUpMode||"one-at-a-time"}setFollowUpMode(e){this.globalSettings.followUpMode=e,this.markModified("followUpMode"),this.save()}getThemeSetting(){let e=this.settings.theme;if(typeof e=="string")return e}getTheme(){let e=this.getThemeSetting();return e?.includes("/")?void 0:e}setTheme(e){this.globalSettings.theme=e,this.markModified("theme"),this.save()}getDefaultThinkingLevel(){return this.settings.defaultThinkingLevel}setDefaultThinkingLevel(e){this.globalSettings.defaultThinkingLevel=e,this.markModified("defaultThinkingLevel"),this.save()}getModelThinkingLevel(e,n){return this.settings.modelThinkingLevels?.[`${e}/${n}`]}getAllModelThinkingLevels(){return{...this.settings.modelThinkingLevels??{}}}setModelThinkingLevel(e,n,r){this.globalSettings.modelThinkingLevels||(this.globalSettings.modelThinkingLevels={}),this.globalSettings.modelThinkingLevels[`${e}/${n}`]=r,this.markModified("modelThinkingLevels"),this.save()}removeModelThinkingLevel(e,n){this.globalSettings.modelThinkingLevels&&(delete this.globalSettings.modelThinkingLevels[`${e}/${n}`],Object.keys(this.globalSettings.modelThinkingLevels).length===0&&delete this.globalSettings.modelThinkingLevels,this.markModified("modelThinkingLevels"),this.save())}getTransport(){return this.settings.transport??"auto"}setTransport(e){this.globalSettings.transport=e,this.markModified("transport"),this.save()}getCompactionEnabled(){return this.settings.compaction?.enabled??!0}setCompactionEnabled(e){this.globalSettings.compaction||(this.globalSettings.compaction={}),this.globalSettings.compaction.enabled=e,this.markModified("compaction","enabled"),this.save()}getCompactionReserveTokens(){return this.settings.compaction?.reserveTokens??16384}getCompactionKeepRecentTokens(){return this.settings.compaction?.keepRecentTokens??2e4}getCompactionSettings(){return{enabled:this.getCompactionEnabled(),reserveTokens:this.getCompactionReserveTokens(),keepRecentTokens:this.getCompactionKeepRecentTokens()}}getBranchSummarySettings(){return{reserveTokens:this.settings.branchSummary?.reserveTokens??16384,skipPrompt:this.settings.branchSummary?.skipPrompt??!1}}getBranchSummarySkipPrompt(){return this.settings.branchSummary?.skipPrompt??!1}getRetryEnabled(){return this.settings.retry?.enabled??!0}setRetryEnabled(e){this.globalSettings.retry||(this.globalSettings.retry={}),this.globalSettings.retry.enabled=e,this.markModified("retry","enabled"),this.save()}getRetrySettings(){return{enabled:this.getRetryEnabled(),maxRetries:this.settings.retry?.maxRetries??3,baseDelayMs:this.settings.retry?.baseDelayMs??2e3}}getHttpIdleTimeoutMs(){return lPn(this.settings.httpIdleTimeoutMs,"httpIdleTimeoutMs")??lot}setHttpIdleTimeoutMs(e){if(!Number.isFinite(e)||e<0)throw new Error(`Invalid httpIdleTimeoutMs setting: ${String(e)}`);this.globalSettings.httpIdleTimeoutMs=Math.floor(e),this.markModified("httpIdleTimeoutMs"),this.save()}getProviderRetrySettings(){return{timeoutMs:this.settings.retry?.provider?.timeoutMs,maxRetries:this.settings.retry?.provider?.maxRetries,maxRetryDelayMs:this.settings.retry?.provider?.maxRetryDelayMs??6e4}}getWebSocketConnectTimeoutMs(){return lPn(this.settings.websocketConnectTimeoutMs,"websocketConnectTimeoutMs")}getHideThinkingBlock(){return this.settings.hideThinkingBlock??!1}getShowCacheMissNotices(){return this.settings.showCacheMissNotices??!1}getExternalEditorCommand(){let e=this.settings.externalEditor;if(typeof e=="string"&&e.trim()!=="")return e;let n=process.env.VISUAL||process.env.EDITOR;return n||(process.platform==="win32"?"notepad":"nano")}setHideThinkingBlock(e){this.globalSettings.hideThinkingBlock=e,this.markModified("hideThinkingBlock"),this.save()}setShowCacheMissNotices(e){this.globalSettings.showCacheMissNotices=e,this.markModified("showCacheMissNotices"),this.save()}getShellPath(){let e=this.settings.shellPath;return e&&Mo(e)}setShellPath(e){this.globalSettings.shellPath=e,this.markModified("shellPath"),this.save()}getQuietStartup(){return this.settings.quietStartup??!1}setQuietStartup(e){this.globalSettings.quietStartup=e,this.markModified("quietStartup"),this.save()}getDefaultProjectTrust(){let e=this.globalSettings.defaultProjectTrust;return e==="always"||e==="never"?e:"ask"}setDefaultProjectTrust(e){this.globalSettings.defaultProjectTrust=e,this.markModified("defaultProjectTrust"),this.save()}getShellCommandPrefix(){return this.settings.shellCommandPrefix}setShellCommandPrefix(e){this.globalSettings.shellCommandPrefix=e,this.markModified("shellCommandPrefix"),this.save()}getNpmCommand(){return this.settings.npmCommand?[...this.settings.npmCommand]:void 0}setNpmCommand(e){this.globalSettings.npmCommand=e?[...e]:void 0,this.markModified("npmCommand"),this.save()}getCollapseChangelog(){return this.settings.collapseChangelog??!1}setCollapseChangelog(e){this.globalSettings.collapseChangelog=e,this.markModified("collapseChangelog"),this.save()}getEnableInstallTelemetry(){return this.settings.enableInstallTelemetry??!0}setEnableInstallTelemetry(e){this.globalSettings.enableInstallTelemetry=e,this.markModified("enableInstallTelemetry"),this.save()}getEnableAnalytics(){return this.settings.enableAnalytics??!1}getTrackingId(){return this.settings.trackingId}setEnableAnalytics(e){this.globalSettings.enableAnalytics=e,this.markModified("enableAnalytics"),e&&!this.globalSettings.trackingId&&(this.globalSettings.trackingId=(0,uPn.randomUUID)(),this.markModified("trackingId")),this.save()}getPackages(){return[...this.settings.packages??[]]}setPackages(e){this.globalSettings.packages=e,this.markModified("packages"),this.save()}setProjectPackages(e){this.updateProjectSettings("packages",n=>{n.packages=e})}getExtensionPaths(){return[...this.settings.extensions??[]]}setExtensionPaths(e){this.globalSettings.extensions=e,this.markModified("extensions"),this.save()}setProjectExtensionPaths(e){this.updateProjectSettings("extensions",n=>{n.extensions=e})}getSkillPaths(){return[...this.settings.skills??[]]}setSkillPaths(e){this.globalSettings.skills=e,this.markModified("skills"),this.save()}setProjectSkillPaths(e){this.updateProjectSettings("skills",n=>{n.skills=e})}getPromptTemplatePaths(){return[...this.settings.prompts??[]]}setPromptTemplatePaths(e){this.globalSettings.prompts=e,this.markModified("prompts"),this.save()}setProjectPromptTemplatePaths(e){this.updateProjectSettings("prompts",n=>{n.prompts=e})}getThemePaths(){return[...this.settings.themes??[]]}setThemePaths(e){this.globalSettings.themes=e,this.markModified("themes"),this.save()}setProjectThemePaths(e){this.updateProjectSettings("themes",n=>{n.themes=e})}getEnableSkillCommands(){return this.settings.enableSkillCommands??!0}setEnableSkillCommands(e){this.globalSettings.enableSkillCommands=e,this.markModified("enableSkillCommands"),this.save()}getThinkingBudgets(){return this.settings.thinkingBudgets}getTerminalCapabilityOverrides(){let e=this.settings.terminal,n=e?.images;return{...n==="kitty"||n==="iterm2"?{images:n}:n===!1?{images:null}:{},...typeof e?.trueColor=="boolean"?{trueColor:e.trueColor}:{},...typeof e?.hyperlinks=="boolean"?{hyperlinks:e.hyperlinks}:{}}}getShowImages(){return this.settings.terminal?.showImages??!0}setShowImages(e){this.globalSettings.terminal||(this.globalSettings.terminal={}),this.globalSettings.terminal.showImages=e,this.markModified("terminal","showImages"),this.save()}getImageWidthCells(){let e=this.settings.terminal?.imageWidthCells;return typeof e!="number"||!Number.isFinite(e)?60:Math.max(1,Math.floor(e))}setImageWidthCells(e){this.globalSettings.terminal||(this.globalSettings.terminal={}),this.globalSettings.terminal.imageWidthCells=Math.max(1,Math.floor(e)),this.markModified("terminal","imageWidthCells"),this.save()}getClearOnShrink(){return this.settings.terminal?.clearOnShrink!==void 0?this.settings.terminal.clearOnShrink:process.env.PI_CLEAR_ON_SHRINK==="1"}setClearOnShrink(e){this.globalSettings.terminal||(this.globalSettings.terminal={}),this.globalSettings.terminal.clearOnShrink=e,this.markModified("terminal","clearOnShrink"),this.save()}getShowTerminalProgress(){return this.settings.terminal?.showTerminalProgress??!1}setShowTerminalProgress(e){this.globalSettings.terminal||(this.globalSettings.terminal={}),this.globalSettings.terminal.showTerminalProgress=e,this.markModified("terminal","showTerminalProgress"),this.save()}getTuiMode(){return this.settings.tuiMode==="fullscreen"?"fullscreen":"regular"}setTuiMode(e){this.globalSettings.tuiMode=e,this.markModified("tuiMode"),this.save()}getFullscreenExitOutput(){return this.settings.fullscreenExitOutput==="resume-hint"?"resume-hint":"transcript"}setFullscreenExitOutput(e){this.globalSettings.fullscreenExitOutput=e,this.markModified("fullscreenExitOutput"),this.save()}getFullscreenScrollbar(){let e=this.settings.fullscreenScrollbar;return e==="always"||e==="hidden"?e:"auto"}setFullscreenScrollbar(e){this.globalSettings.fullscreenScrollbar=e,this.markModified("fullscreenScrollbar"),this.save()}getFullscreenCopyOnSelect(){return this.settings.fullscreenCopyOnSelect??!0}setFullscreenCopyOnSelect(e){this.globalSettings.fullscreenCopyOnSelect=e,this.markModified("fullscreenCopyOnSelect"),this.save()}getImageAutoResize(){return this.settings.images?.autoResize??!0}setImageAutoResize(e){this.globalSettings.images||(this.globalSettings.images={}),this.globalSettings.images.autoResize=e,this.markModified("images","autoResize"),this.save()}getBlockImages(){return this.settings.images?.blockImages??!1}setBlockImages(e){this.globalSettings.images||(this.globalSettings.images={}),this.globalSettings.images.blockImages=e,this.markModified("images","blockImages"),this.save()}getEnabledModels(){return this.settings.enabledModels}getDefaultTools(){let e=this.settings.defaultTools;return e?[...e]:void 0}setEnabledModels(e){this.globalSettings.enabledModels=e,this.markModified("enabledModels"),this.save()}getDoubleEscapeAction(){return this.settings.doubleEscapeAction??"tree"}setDoubleEscapeAction(e){this.globalSettings.doubleEscapeAction=e,this.markModified("doubleEscapeAction"),this.save()}getTreeFilterMode(){let e=this.settings.treeFilterMode;return e&&["default","no-tools","user-only","labeled-only","all"].includes(e)?e:"default"}setTreeFilterMode(e){this.globalSettings.treeFilterMode=e,this.markModified("treeFilterMode"),this.save()}getShowHardwareCursor(){return this.settings.showHardwareCursor??process.env.PI_HARDWARE_CURSOR==="1"}setShowHardwareCursor(e){this.globalSettings.showHardwareCursor=e,this.markModified("showHardwareCursor"),this.save()}getEditorPaddingX(){return this.settings.editorPaddingX??0}setEditorPaddingX(e){this.globalSettings.editorPaddingX=Math.max(0,Math.min(3,Math.floor(e))),this.markModified("editorPaddingX"),this.save()}getOutputPad(){return this.settings.outputPad===0?0:1}setOutputPad(e){this.globalSettings.outputPad=e,this.markModified("outputPad"),this.save()}getAutocompleteMaxVisible(){return this.settings.autocompleteMaxVisible??5}setAutocompleteMaxVisible(e){this.globalSettings.autocompleteMaxVisible=Math.max(3,Math.min(20,Math.floor(e))),this.markModified("autocompleteMaxVisible"),this.save()}getCodeBlockIndent(){return this.settings.markdown?.codeBlockIndent??" "}getMermaidRenderingMode(){let e=this.settings.markdown?.mermaid;return e==="off"||e==="final"?e:"streaming"}setMermaidRenderingMode(e){this.globalSettings.markdown??={},this.globalSettings.markdown.mermaid=e,this.markModified("markdown","mermaid"),this.save()}getWarnings(){return{...this.settings.warnings??{}}}setWarnings(e){this.globalSettings.warnings={...e},this.markModified("warnings"),this.save()}};function hPn(t,e){if(t){if((0,Fa.existsSync)(t))try{return Mi((0,Fa.readFileSync)(t,"utf-8"))}catch(n){return console.error(en.yellow(`Warning: Could not read ${e} file ${t}: ${n}`)),t}return t}}function fot(t){let e=["AGENTS.override.md","AGENTS.md","AGENTS.MD","CLAUDE.md","CLAUDE.MD"];for(let n of e){let r=(0,Qi.join)(t,n);if((0,Fa.existsSync)(r))try{if(!(0,Fa.statSync)(r).isFile())continue;return{path:r,content:Mi((0,Fa.readFileSync)(r,"utf-8"))}}catch(s){console.error(en.yellow(`Warning: Could not read ${r}: ${s}`))}}return null}function LQs(t){let e=DIe(t);if(!e)return;let n=fu(e.commonGitDir),r=fu(e.repoDir),s=(0,Qi.dirname)(n);if(!r.startsWith(`${s}${Qi.sep}`)||fu((0,Qi.join)(s,".git"))!==n)return;let i=fot(r);return i?(0,Qi.join)(s,(0,Qi.basename)(i.path)):void 0}function got(t){let e=jn(t.cwd),n=jn(t.agentDir),r=[],s=new Set,i=fot(n);i&&(r.push(i),s.add(i.path));let o=[],a=LQs(e),c=e;for(;;){let u=fot(c),l=a!==void 0&&fu(u?.path??"")===a;u&&!l&&!s.has(u.path)&&(o.unshift(u),s.add(u.path));let d=(0,Qi.dirname)(c);if(d===c)break;c=d}return r.push(...o),r}var B0=class{cwd;agentDir;settingsManager;eventBus;packageManager;additionalExtensionPaths;additionalSkillPaths;additionalPromptTemplatePaths;additionalThemePaths;extensionFactories;noExtensions;noSkills;noPromptTemplates;noThemes;noContextFiles;systemPromptSource;appendSystemPromptSource;extensionsOverride;skillsOverride;promptsOverride;themesOverride;agentsFilesOverride;systemPromptOverride;appendSystemPromptOverride;extensionsResult;skills;skillDiagnostics;prompts;promptDiagnostics;themes;themeDiagnostics;agentsFiles;systemPrompt;systemPromptSourcePath;appendSystemPrompt;appendSystemPromptSourcePaths;lastSkillPaths;extensionSkillSourceInfos;extensionPromptSourceInfos;extensionThemeSourceInfos;resourceMetadataByPath;lastPromptPaths;lastThemePaths;loaded;constructor(e){this.cwd=jn(e.cwd),this.agentDir=jn(e.agentDir),this.settingsManager=e.settingsManager??El.create(this.cwd,this.agentDir),this.eventBus=e.eventBus??D5(),this.packageManager=new jh({cwd:this.cwd,agentDir:this.agentDir,settingsManager:this.settingsManager}),this.additionalExtensionPaths=e.additionalExtensionPaths??[],this.additionalSkillPaths=e.additionalSkillPaths??[],this.additionalPromptTemplatePaths=e.additionalPromptTemplatePaths??[],this.additionalThemePaths=e.additionalThemePaths??[],this.extensionFactories=e.extensionFactories??[],this.noExtensions=e.noExtensions??!1,this.noSkills=e.noSkills??!1,this.noPromptTemplates=e.noPromptTemplates??!1,this.noThemes=e.noThemes??!1,this.noContextFiles=e.noContextFiles??!1,this.systemPromptSource=e.systemPrompt,this.appendSystemPromptSource=e.appendSystemPrompt,this.extensionsOverride=e.extensionsOverride,this.skillsOverride=e.skillsOverride,this.promptsOverride=e.promptsOverride,this.themesOverride=e.themesOverride,this.agentsFilesOverride=e.agentsFilesOverride,this.systemPromptOverride=e.systemPromptOverride,this.appendSystemPromptOverride=e.appendSystemPromptOverride,this.extensionsResult={extensions:[],errors:[],runtime:P5()},this.skills=[],this.skillDiagnostics=[],this.prompts=[],this.promptDiagnostics=[],this.themes=[],this.themeDiagnostics=[],this.agentsFiles=[],this.appendSystemPrompt=[],this.appendSystemPromptSourcePaths=[],this.lastSkillPaths=[],this.extensionSkillSourceInfos=new Map,this.extensionPromptSourceInfos=new Map,this.extensionThemeSourceInfos=new Map,this.resourceMetadataByPath=new Map,this.lastPromptPaths=[],this.lastThemePaths=[],this.loaded=!1}getExtensions(){return this.extensionsResult}getSkills(){return{skills:this.skills,diagnostics:this.skillDiagnostics}}getPrompts(){return{prompts:this.prompts,diagnostics:this.promptDiagnostics}}getThemes(){return{themes:this.themes,diagnostics:this.themeDiagnostics}}getAgentsFiles(){return{agentsFiles:this.agentsFiles}}getSystemPrompt(){return this.systemPrompt}getSystemPromptSource(){return this.systemPromptSourcePath?{path:this.systemPromptSourcePath}:void 0}getAppendSystemPrompt(){return this.appendSystemPrompt}getAppendSystemPromptSources(){return this.appendSystemPromptSourcePaths.map(e=>({path:e}))}extendResources(e){let n=this.normalizeExtensionPaths(e.skillPaths??[]),r=this.normalizeExtensionPaths(e.promptPaths??[]),s=this.normalizeExtensionPaths(e.themePaths??[]);for(let i of n)this.extensionSkillSourceInfos.set(i.path,B5(i.path,i.metadata));for(let i of r)this.extensionPromptSourceInfos.set(i.path,B5(i.path,i.metadata));for(let i of s)this.extensionThemeSourceInfos.set(i.path,B5(i.path,i.metadata));n.length>0&&(this.lastSkillPaths=this.mergePaths(this.lastSkillPaths,n.map(i=>i.path)),this.updateSkillsFromPaths(this.lastSkillPaths,this.resourceMetadataByPath)),r.length>0&&(this.lastPromptPaths=this.mergePaths(this.lastPromptPaths,r.map(i=>i.path)),this.updatePromptsFromPaths(this.lastPromptPaths,this.resourceMetadataByPath)),s.length>0&&(this.lastThemePaths=this.mergePaths(this.lastThemePaths,s.map(i=>i.path)),this.updateThemesFromPaths(this.lastThemePaths,this.resourceMetadataByPath))}async loadProjectTrustExtensions(){return this.settingsManager.setProjectTrusted(!1),await this.settingsManager.reload(),this.loadCurrentExtensionSet({includeInlineFactories:!0})}async reload(e){XZ("extensions"),this.loaded&&bZe();let n;if(e?.resolveProjectTrust){n=await this.loadProjectTrustExtensions();let $=await e.resolveProjectTrust({extensionsResult:n});this.settingsManager.setProjectTrusted($)}await this.settingsManager.reload();let r=await this.packageManager.resolve(),s=await this.packageManager.resolveExtensionSources(this.additionalExtensionPaths,{temporary:!0});this.resourceMetadataByPath=new Map;let i=this.resourceMetadataByPath;this.extensionSkillSourceInfos=new Map,this.extensionPromptSourceInfos=new Map,this.extensionThemeSourceInfos=new Map;let o=$=>{for(let Q of $)i.has(Q.path)||i.set(Q.path,Q.metadata);return $.filter(Q=>Q.enabled)},a=$=>o($).map(Q=>Q.path),c=a(r.extensions),u=o(r.skills),l=a(r.prompts),d=a(r.themes),h=u.map($=>this.mapSkillPath($,i));for(let $ of s.extensions)i.has($.path)||i.set($.path,{source:"cli",scope:"temporary",origin:"top-level"});for(let $ of s.skills)i.has($.path)||i.set($.path,{source:"cli",scope:"temporary",origin:"top-level"});let m=a(s.extensions),f=a(s.skills),g=a(s.prompts),A=a(s.themes),y=this.noExtensions?m:this.mergePaths(m,c),b=await this.loadFinalExtensionSet(y,n);for(let $ of this.additionalExtensionPaths)if(UE($)){let Q=this.resolveResourcePath($);(0,Fa.existsSync)(Q)||b.errors.push({path:Q,error:`Extension path does not exist: ${Q}`})}this.extensionsResult=this.extensionsOverride?this.extensionsOverride(b):b,this.applyExtensionSourceInfo(this.extensionsResult.extensions,i);let S=this.noSkills?this.mergePaths(f,this.additionalSkillPaths):this.mergePaths([...f,...h],this.additionalSkillPaths);this.lastSkillPaths=S,this.updateSkillsFromPaths(S,i);for(let $ of this.additionalSkillPaths)if(UE($)){let Q=this.resolveResourcePath($);!(0,Fa.existsSync)(Q)&&!this.skillDiagnostics.some(H=>H.path===Q)&&this.skillDiagnostics.push({type:"error",message:"Skill path does not exist",path:Q})}let C=this.noPromptTemplates?this.mergePaths(g,this.additionalPromptTemplatePaths):this.mergePaths([...g,...l],this.additionalPromptTemplatePaths);this.lastPromptPaths=C,this.updatePromptsFromPaths(C,i);for(let $ of this.additionalPromptTemplatePaths)if(UE($)){let Q=this.resolveResourcePath($);!(0,Fa.existsSync)(Q)&&!this.promptDiagnostics.some(H=>H.path===Q)&&this.promptDiagnostics.push({type:"error",message:"Prompt template path does not exist",path:Q})}let I=this.noThemes?this.mergePaths(A,this.additionalThemePaths):this.mergePaths([...A,...d],this.additionalThemePaths);this.lastThemePaths=I,this.updateThemesFromPaths(I,i);for(let $ of this.additionalThemePaths){let Q=this.resolveResourcePath($);!(0,Fa.existsSync)(Q)&&!this.themeDiagnostics.some(H=>H.path===Q)&&this.themeDiagnostics.push({type:"error",message:"Theme path does not exist",path:Q})}let x={agentsFiles:this.noContextFiles?[]:got({cwd:this.cwd,agentDir:this.agentDir})},w=this.agentsFilesOverride?this.agentsFilesOverride(x):x;this.agentsFiles=w.agentsFiles;let R=this.systemPromptSource??this.discoverSystemPromptFile(),N=hPn(R,"system prompt");this.systemPrompt=this.systemPromptOverride?this.systemPromptOverride(N):N,this.systemPromptSourcePath=R&&(0,Fa.existsSync)(R)?jn(R):void 0;let P=this.appendSystemPromptSource;if(!P){let $=this.discoverAppendSystemPromptFile();P=$?[$]:[]}let G=P.map($=>hPn($,"append system prompt")).filter($=>$!==void 0);this.appendSystemPrompt=this.appendSystemPromptOverride?this.appendSystemPromptOverride(G):G,this.appendSystemPromptSourcePaths=P.filter($=>(0,Fa.existsSync)($)).map($=>jn($)),this.loaded=!0}async loadCurrentExtensionSet(e){let n=await this.packageManager.resolve(),r=await this.packageManager.resolveExtensionSources(this.additionalExtensionPaths,{temporary:!0}),s=n.extensions.filter(u=>u.enabled).map(u=>u.path),i=r.extensions.filter(u=>u.enabled).map(u=>u.path),o=this.noExtensions?i:this.mergePaths(i,s),a=await ECe(o,this.cwd,this.eventBus);if(!e.includeInlineFactories)return a;let c=await this.loadExtensionFactories(a.runtime);return a.extensions.push(...c.extensions),a.errors.push(...c.errors),a}resolveExtensionLoadPath(e){return jn(e,this.cwd,{normalizeUnicodeSpaces:!0})}async loadFinalExtensionSet(e,n){if(!n){let d=await ECe(e,this.cwd,this.eventBus),h=await this.loadExtensionFactories(d.runtime);return d.extensions.push(...h.extensions),d.errors.push(...h.errors),this.addExtensionConflictDiagnostics(d),d}let r=new Map(n.extensions.filter(d=>!d.path.startsWith("[d.resolvedPath,d])),s=new Set(n.errors.map(d=>this.resolveExtensionLoadPath(d.path))),i=e.filter(d=>{let h=this.resolveExtensionLoadPath(d);return!r.has(h)&&!s.has(h)}),o=await ECe(i,this.cwd,this.eventBus,n.runtime),a=new Map(r);for(let d of o.extensions)a.set(d.resolvedPath,d);let c=n.extensions.filter(d=>d.path.startsWith("a.get(this.resolveExtensionLoadPath(d))).filter(d=>d!==void 0);u.push(...c);let l={extensions:u,errors:[...n.errors,...o.errors],runtime:n.runtime};return this.addExtensionConflictDiagnostics(l),l}addExtensionConflictDiagnostics(e){let n=this.detectExtensionConflicts(e.extensions);for(let r of n)e.errors.push({path:r.path,error:r.message})}mapSkillPath(e,n){if(e.metadata.source!=="auto"&&e.metadata.origin!=="package")return e.path;try{if(!(0,Fa.statSync)(e.path).isDirectory())return e.path}catch{return e.path}let r=(0,Qi.join)(e.path,"SKILL.md");return(0,Fa.existsSync)(r)?(n.has(r)||n.set(r,e.metadata),r):e.path}normalizeExtensionPaths(e){return e.map(n=>{let r=n.metadata.baseDir?{...n.metadata,baseDir:this.resolveResourcePath(n.metadata.baseDir)}:n.metadata;return{path:this.resolveResourcePath(n.path),metadata:r}})}updateSkillsFromPaths(e,n){let r;this.noSkills&&e.length===0?r={skills:[],diagnostics:[]}:r=ICe({cwd:this.cwd,agentDir:this.agentDir,skillPaths:e,includeDefaults:!1});let s=this.skillsOverride?this.skillsOverride(r):r;this.skills=s.skills.map(i=>({...i,sourceInfo:this.findSourceInfoForPath(i.filePath,this.extensionSkillSourceInfos,n)??i.sourceInfo??this.getDefaultSourceInfoForPath(i.filePath)})),this.skillDiagnostics=s.diagnostics}updatePromptsFromPaths(e,n){let r;if(this.noPromptTemplates&&e.length===0)r={prompts:[],diagnostics:[]};else{let i=p_n({cwd:this.cwd,agentDir:this.agentDir,promptPaths:e,includeDefaults:!1});r=this.dedupePrompts(i)}let s=this.promptsOverride?this.promptsOverride(r):r;this.prompts=s.prompts.map(i=>({...i,sourceInfo:this.findSourceInfoForPath(i.filePath,this.extensionPromptSourceInfos,n)??i.sourceInfo??this.getDefaultSourceInfoForPath(i.filePath)})),this.promptDiagnostics=s.diagnostics}updateThemesFromPaths(e,n){let r;if(this.noThemes&&e.length===0)r={themes:[],diagnostics:[]};else{let i=this.loadThemes(e,!1),o=this.dedupeThemes(i.themes);r={themes:o.themes,diagnostics:[...i.diagnostics,...o.diagnostics]}}let s=this.themesOverride?this.themesOverride(r):r;this.themes=s.themes.map(i=>{let o=i.sourcePath;return i.sourceInfo=o?this.findSourceInfoForPath(o,this.extensionThemeSourceInfos,n)??i.sourceInfo??this.getDefaultSourceInfoForPath(o):i.sourceInfo,i}),this.themeDiagnostics=s.diagnostics}applyExtensionSourceInfo(e,n){for(let r of e){r.sourceInfo=this.findSourceInfoForPath(r.path,void 0,n)??this.getDefaultSourceInfoForPath(r.path);for(let s of r.commands.values())s.sourceInfo=r.sourceInfo;for(let s of r.tools.values())s.sourceInfo=r.sourceInfo}}findSourceInfoForPath(e,n,r){if(!e)return;if(e.startsWith("<"))return this.getDefaultSourceInfoForPath(e);let s=(0,Qi.resolve)(e);if(n)for(let[i,o]of n.entries()){let a=(0,Qi.resolve)(i);if(s===a||s.startsWith(`${a}${Qi.sep}`))return{...o,path:e}}if(r){let i=r.get(s)??r.get(e);if(i)return B5(e,i);for(let[o,a]of r.entries()){let c=(0,Qi.resolve)(o);if(s===c||s.startsWith(`${c}${Qi.sep}`))return B5(e,a)}}}getDefaultSourceInfoForPath(e){if(e.startsWith("<")&&e.endsWith(">"))return{path:e,source:e.slice(1,-1).split(":")[0]||"temporary",scope:"temporary",origin:"top-level"};let n=(0,Qi.resolve)(e),r=[(0,Qi.join)(this.agentDir,"skills"),(0,Qi.join)(this.agentDir,"prompts"),(0,Qi.join)(this.agentDir,"themes"),(0,Qi.join)(this.agentDir,"extensions")],s=[(0,Qi.join)(this.cwd,ws,"skills"),(0,Qi.join)(this.cwd,ws,"prompts"),(0,Qi.join)(this.cwd,ws,"themes"),(0,Qi.join)(this.cwd,ws,"extensions")];for(let i of r)if(this.isUnderPath(n,i))return{path:e,source:"local",scope:"user",origin:"top-level",baseDir:i};for(let i of s)if(this.isUnderPath(n,i))return{path:e,source:"local",scope:"project",origin:"top-level",baseDir:i};return{path:e,source:"local",scope:"temporary",origin:"top-level",baseDir:(0,Fa.statSync)(n).isDirectory()?n:(0,Qi.resolve)(n,"..")}}mergePaths(e,n){let r=[],s=new Set;for(let i of[...e,...n]){let o=this.resolveResourcePath(i),a=fu(o);s.has(a)||(s.add(a),r.push(o))}return r}resolveResourcePath(e){return jn(e,this.cwd,{trim:!0})}loadThemes(e,n=!0){let r=[],s=[];if(n){let i=[(0,Qi.join)(this.agentDir,"themes"),(0,Qi.join)(this.cwd,ws,"themes")];for(let o of i)this.loadThemesFromDir(o,r,s)}for(let i of e){let o=this.resolveResourcePath(i);if(!(0,Fa.existsSync)(o)){s.push({type:"warning",message:"theme path does not exist",path:o});continue}try{let a=(0,Fa.statSync)(o);a.isDirectory()?this.loadThemesFromDir(o,r,s):a.isFile()&&o.endsWith(".json")?this.loadThemeFromFile(o,r,s):s.push({type:"warning",message:"theme path is not a json file",path:o})}catch(a){let c=a instanceof Error?a.message:"failed to read theme path";s.push({type:"warning",message:c,path:o})}}return{themes:r,diagnostics:s}}loadThemesFromDir(e,n,r){if((0,Fa.existsSync)(e))try{let s=(0,Fa.readdirSync)(e,{withFileTypes:!0});for(let i of s){let o=i.isFile();if(i.isSymbolicLink())try{o=(0,Fa.statSync)((0,Qi.join)(e,i.name)).isFile()}catch{continue}o&&i.name.endsWith(".json")&&this.loadThemeFromFile((0,Qi.join)(e,i.name),n,r)}}catch(s){let i=s instanceof Error?s.message:"failed to read theme directory";r.push({type:"warning",message:i,path:e})}}loadThemeFromFile(e,n,r){try{n.push(NH(e))}catch(s){let i=s instanceof Error?s.message:"failed to load theme";r.push({type:"warning",message:i,path:e})}}async loadExtensionFactories(e){let n=[],r=[];for(let[s,i]of this.extensionFactories.entries()){let o=typeof i!="function",a=o?i.factory:i,c=``;try{let u=await _Ze(a,this.cwd,this.eventBus,e,c);u.hidden=o&&i.hidden,n.push(u)}catch(u){let l=u instanceof Error?u.message:"failed to load extension";r.push({path:c,error:l})}}return{extensions:n,errors:r}}dedupePrompts(e){let n=new Map,r=[];for(let s of e){let i=n.get(s.name);i?r.push({type:"collision",message:`name "/${s.name}" collision`,path:s.filePath,collision:{resourceType:"prompt",name:s.name,winnerPath:i.filePath,loserPath:s.filePath}}):n.set(s.name,s)}return{prompts:Array.from(n.values()),diagnostics:r}}dedupeThemes(e){let n=new Map,r=[];for(let s of e){let i=s.name??"unnamed",o=n.get(i);o?r.push({type:"collision",message:`name "${i}" collision`,path:s.sourcePath,collision:{resourceType:"theme",name:i,winnerPath:o.sourcePath??"",loserPath:s.sourcePath??""}}):n.set(i,s)}return{themes:Array.from(n.values()),diagnostics:r}}discoverSystemPromptFile(){let e=(0,Qi.join)(this.cwd,ws,"SYSTEM.md");if(this.settingsManager.isProjectTrusted()&&(0,Fa.existsSync)(e))return e;let n=(0,Qi.join)(this.agentDir,"SYSTEM.md");if((0,Fa.existsSync)(n))return n}discoverAppendSystemPromptFile(){let e=(0,Qi.join)(this.cwd,ws,"APPEND_SYSTEM.md");if(this.settingsManager.isProjectTrusted()&&(0,Fa.existsSync)(e))return e;let n=(0,Qi.join)(this.agentDir,"APPEND_SYSTEM.md");if((0,Fa.existsSync)(n))return n}isUnderPath(e,n){let r=(0,Qi.resolve)(n);if(e===r)return!0;let s=r.endsWith(Qi.sep)?r:`${r}${Qi.sep}`;return e.startsWith(s)}detectExtensionConflicts(e){let n=[],r=new Map,s=new Map;for(let i of e){for(let o of i.tools.keys()){let a=r.get(o);a&&a!==i.path?n.push({path:i.path,message:`Tool "${o}" conflicts with ${a}`}):r.set(o,i.path)}for(let o of i.flags.keys()){let a=s.get(o);a&&a!==i.path?n.push({path:i.path,message:`Flag "--${o}" conflicts with ${a}`}):s.set(o,i.path)}}return n}};p();var Eot=require("node:path");p();p();function FQs(t){return t?t==="1"||t.toLowerCase()==="true"||t.toLowerCase()==="yes":!1}function Wwe(t,e=process.env.PI_TELEMETRY){return e!==void 0?FQs(e):t.getEnableInstallTelemetry()}var QQs="openrouter.ai",UQs="integrate.api.nvidia.com",$Qs="api.cloudflare.com",GQs="gateway.ai.cloudflare.com",WQs="opencode.ai";function qwe(t,e){try{return new URL(t).hostname===e}catch{return!1}}function qQs(t){return t.provider==="openrouter"||t.baseUrl.includes(QQs)}function HQs(t){return t.provider==="nvidia"||qwe(t.baseUrl,UQs)}function VQs(t){return t.provider==="cloudflare-workers-ai"||t.provider==="cloudflare-ai-gateway"||qwe(t.baseUrl,$Qs)||qwe(t.baseUrl,GQs)}function jQs(t,e){if(Wwe(e)){if(qQs(t))return{"HTTP-Referer":"https://pi.dev","X-OpenRouter-Title":"pi","X-OpenRouter-Categories":"cli-agent"};if(HQs(t))return{"X-BILLING-INVOKE-ORIGIN":"Pi"};if(VQs(t))return{"User-Agent":"pi-coding-agent"}}}function YQs(t,e){if(e&&!(t.provider!=="opencode"&&t.provider!=="opencode-go"&&!qwe(t.baseUrl,WQs)))return{"x-opencode-session":e,"x-opencode-client":"pi"}}function mPn(t,e,n,...r){let s={...YQs(t,n),...jQs(t,e)};for(let i of r)i&&Object.assign(s,i);return Object.keys(s).length>0?s:void 0}p();var P0=require("node:fs"),FT=require("node:path");p();var fPn=require("node:fs");function Aot(t,e){let n=t.getSessionFile();if(!n)return;let r=t.getCwd();if(!(!r||(0,fPn.existsSync)(r)))return{sessionFile:n,sessionCwd:r,fallbackCwd:e}}function KQs(t){let e=t.sessionFile?` +`,"utf-8")}getNpmInstallRoot(e,n){return n?this.getTemporaryDir("npm"):e==="project"?(this.assertProjectTrustedForScope(e),(0,Sn.join)(this.cwd,Bi,"npm")):(0,Sn.join)(this.agentDir,"npm")}getGlobalNpmRoot(){let e=this.getNpmCommand(),n=[e.command,...e.args].join("\0");if(this.globalNpmRoot&&this.globalNpmRootCommandKey===n)return this.globalNpmRoot;if(this.getPackageManagerName()==="bun"){let r=this.runNpmCommandSync(["pm","bin","-g"]).trim();this.globalNpmRoot=(0,Sn.join)((0,Sn.dirname)(r),"install","global","node_modules")}else this.globalNpmRoot=this.runNpmCommandSync(["root","-g"]).trim();return this.globalNpmRootCommandKey=n,this.globalNpmRoot}getPnpmGlobalPackagePath(e){if(this.getPackageManagerName()!=="pnpm")return;let n=this.runNpmCommandSync(["list","-g","--depth","0","--json"]),r=JSON.parse(n);for(let i of r){let s=i.dependencies?.[e]?.path;if(s)return s}}getManagedNpmInstallPath(e,n){return n==="temporary"?(0,Sn.join)(this.getTemporaryDir("npm"),"node_modules",e.name):n==="project"?(this.assertProjectTrustedForScope(n),(0,Sn.join)(this.cwd,Bi,"npm","node_modules",e.name)):(0,Sn.join)(this.agentDir,"npm","node_modules",e.name)}getLegacyGlobalNpmInstallPath(e){try{return this.getPnpmGlobalPackagePath(e.name)??(0,Sn.join)(this.getGlobalNpmRoot(),e.name)}catch{return}}getNpmInstallPath(e,n){let r=this.getManagedNpmInstallPath(e,n);if(n!=="user"||(0,Ln.existsSync)(r))return r;let i=this.getLegacyGlobalNpmInstallPath(e);return i&&(0,Ln.existsSync)(i)?i:r}getGitInstallPath(e,n){if(n==="temporary")return this.getTemporaryDir(`git-${e.host}`,e.path);let r=this.getGitInstallRoot(n);if(!r)throw new Error("Missing git install root");return this.resolveManagedPath(r,e.host,e.path)}getGitInstallRoot(e){if(e!=="temporary")return e==="project"?(this.assertProjectTrustedForScope(e),(0,Sn.join)(this.cwd,Bi,"git")):(0,Sn.join)(this.agentDir,"git")}getTemporaryDir(e,n){let r=this.resolveManagedPath(UKi(this.agentDir),e),i=(0,s9n.createHash)("sha256").update(`${e}-${n??""}`).digest("hex").slice(0,8);return this.resolveManagedPath(r,i,n??"")}resolveManagedPath(e,...n){let r=(0,Sn.resolve)(e),i=(0,Sn.resolve)(r,...n);if(i!==r&&!i.startsWith(`${r}${Sn.sep}`))throw new Error(`Refusing to use path outside package install root: ${i}`);return i}getBaseDirForScope(e){return e==="project"?(this.assertProjectTrustedForScope(e),(0,Sn.join)(this.cwd,Bi)):e==="user"?this.agentDir:this.cwd}resolvePath(e){return Vn(e,this.cwd,{homeDir:jht(),trim:!0})}resolvePathFromBase(e,n){return Vn(e,n,{homeDir:jht(),trim:!0})}collectPackageResources(e,n,r,i){if(r){for(let a of IBe){let c=r[a],u=this.getTargetMap(n,a);r.autoload===!1?this.applyPackageDeltaFilter(e,c??[],a,u,i):c!==void 0?this.applyPackageFilter(e,c,a,u,i):this.collectDefaultResources(e,a,u,i)}return!0}let s=bQ((0,Sn.join)(e,"package.json"));if(s){for(let a of IBe){let c=s[a];this.addManifestEntries(c,e,a,this.getTargetMap(n,a),i)}return!0}let o=!1;for(let a of IBe){let c=(0,Sn.join)(e,a);if((0,Ln.existsSync)(c)){let u=TBe(c,a);for(let l of u)this.addResource(this.getTargetMap(n,a),l,i,!0);o=!0}}return o}collectDefaultResources(e,n,r,i){let o=bQ((0,Sn.join)(e,"package.json"))?.[n];if(o){this.addManifestEntries(o,e,n,r,i);return}let a=(0,Sn.join)(e,n);if((0,Ln.existsSync)(a)){let c=TBe(a,n);for(let u of c)this.addResource(r,u,i,!0)}}applyPackageFilter(e,n,r,i,s){let{allFiles:o}=this.collectManifestFiles(e,r);if(n.length===0){for(let c of o)this.addResource(i,c,s,!1);return}let a=vBe(o,n,e);for(let c of o){let u=a.has(c);this.addResource(i,c,s,u)}}applyPackageDeltaFilter(e,n,r,i,s){if(n.length===0)return;let{allFiles:o}=this.collectManifestFiles(e,r),a=JKi(o,n,e);for(let[c,u]of a)this.addResource(i,c,s,u)}collectManifestFiles(e,n){let i=bQ((0,Sn.join)(e,"package.json"))?.[n];if(i&&i.length>0){let a=this.collectFilesFromManifestEntries(i,e,n),c=i.filter(Vht),u=c.length>0?vBe(a,c,e):new Set(a);return{allFiles:Array.from(u),enabledByManifest:u}}let s=(0,Sn.join)(e,n);if(!(0,Ln.existsSync)(s))return{allFiles:[],enabledByManifest:new Set};let o=TBe(s,n);return{allFiles:o,enabledByManifest:new Set(o)}}addManifestEntries(e,n,r,i,s){if(!e)return;let o=this.collectFilesFromManifestEntries(e,n,r),a=e.filter(Vht),c=vBe(o,a,n);for(let u of o)c.has(u)&&this.addResource(i,u,s,!0)}collectFilesFromManifestEntries(e,n,r){let s=e.filter(o=>!Vht(o)).flatMap(o=>WKi(o)?HKi(o,n):[(0,Sn.resolve)(n,o)]);return this.collectFilesFromPaths(s,r)}resolveLocalEntries(e,n,r,i,s){if(e.length===0)return;let{plain:o,patterns:a}=qKi(e),c=o.map(d=>this.resolvePathFromBase(d,s)),u=this.collectFilesFromPaths(c,n),l=vBe(u,a,s);for(let d of u)this.addResource(r,d,i,l.has(d))}addAutoDiscoveredResources(e,n,r,i,s){let o={source:"auto",scope:"user",origin:"top-level",baseDir:i},a={source:"auto",scope:"project",origin:"top-level",baseDir:s},c={extensions:n.extensions??[],skills:n.skills??[],prompts:n.prompts??[],themes:n.themes??[]},u={extensions:r.extensions??[],skills:r.skills??[],prompts:r.prompts??[],themes:r.themes??[]},l={extensions:(0,Sn.join)(i,"extensions"),skills:(0,Sn.join)(i,"skills"),prompts:(0,Sn.join)(i,"prompts"),themes:(0,Sn.join)(i,"themes")},d={extensions:(0,Sn.join)(s,"extensions"),skills:(0,Sn.join)(s,"skills"),prompts:(0,Sn.join)(s,"prompts"),themes:(0,Sn.join)(s,"themes")},m=(0,Sn.join)(jht(),".agents","skills"),h=this.settingsManager.isProjectTrusted(),f=h?VKi(this.cwd).filter(E=>(0,Sn.resolve)(E)!==(0,Sn.resolve)(m)):[],g=(E,_,S,C,I)=>{let w=this.getTargetMap(e,E);for(let k of _){let N=KKi(k,C,I);this.addResource(w,k,S,N)}};h&&(g("extensions",Yht(d.extensions),a,u.extensions,s),g("skills",wBe(d.skills,"pi"),a,u.skills,s));for(let E of f){let _=(0,Sn.dirname)(E),S={...a,baseDir:_};g("skills",wBe(E,"agents"),S,u.skills,_)}h&&(g("prompts",n9n(d.prompts),a,u.prompts,s),g("themes",r9n(d.themes),a,u.themes,s)),g("extensions",Yht(l.extensions),o,c.extensions,i),g("skills",wBe(l.skills,"pi"),o,c.skills,i);let A=(0,Sn.dirname)(m),y={...o,baseDir:A};g("skills",wBe(m,"agents"),y,c.skills,A),g("prompts",n9n(l.prompts),o,c.prompts,i),g("themes",r9n(l.themes),o,c.themes,i)}collectFilesFromPaths(e,n){let r=[];for(let i of e)if((0,Ln.existsSync)(i))try{let s=(0,Ln.statSync)(i);s.isFile()?r.push(i):s.isDirectory()&&r.push(...TBe(i,n))}catch{}return r}getTargetMap(e,n){switch(n){case"extensions":return e.extensions;case"skills":return e.skills;case"prompts":return e.prompts;case"themes":return e.themes;default:throw new Error(`Unknown resource type: ${n}`)}}addResource(e,n,r,i){n&&(e.has(n)||e.set(n,{metadata:r,enabled:i}))}createAccumulator(){return{extensions:new Map,skills:new Map,prompts:new Map,themes:new Map}}toResolvedPaths(e){let n=r=>{let i=Array.from(r.entries()).map(([o,{metadata:a,enabled:c}])=>({path:o,enabled:c,metadata:a}));i.sort((o,a)=>t9n(o.metadata)-t9n(a.metadata));let s=new Set;return i.filter(o=>{let a=cd(o.path);return s.has(a)?!1:(s.add(a),!0)})};return{extensions:n(e.extensions),skills:n(e.skills),prompts:n(e.prompts),themes:n(e.themes)}}spawnCommand(e,n,r){let i=qht();return k8(e,n,{cwd:r?.cwd,stdio:ZYn()?["ignore",2,2]:"inherit",env:i})}spawnCaptureCommand(e,n,r){let i=qht(),s=r?.env?{...i,...r.env}:i;return k8(e,n,{cwd:r?.cwd,stdio:["ignore","pipe","pipe"],env:s})}runCommandCapture(e,n,r){return new Promise((i,s)=>{let o=this.spawnCaptureCommand(e,n,r),a="",c="",u=!1,l=typeof r?.timeoutMs=="number"?setTimeout(()=>{u=!0,o.kill()},r.timeoutMs):void 0;o.stdout?.on("data",d=>{a+=d.toString()}),o.stderr?.on("data",d=>{c+=d.toString()}),o.once("error",d=>{l&&clearTimeout(l),s(d)}),o.once("close",(d,m)=>{if(l&&clearTimeout(l),u){s(new Error(`${e} ${n.join(" ")} timed out after ${r?.timeoutMs}ms`));return}if(d===0){i(a.trim());return}let h=d===null?`signal ${m??"unknown"}`:`code ${d}`;s(new Error(`${e} ${n.join(" ")} failed with ${h}: ${c||a}`))})})}runCommand(e,n,r){return new Promise((i,s)=>{let o=this.spawnCommand(e,n,r);o.on("error",s),o.on("exit",a=>{a===0?i():s(new Error(`${e} ${n.join(" ")} failed with code ${a}`))})})}runCommandSync(e,n){let r=qht(),i=SR(e,n,{stdio:["ignore","pipe","pipe"],encoding:"utf-8",env:r});if(i.error||i.status!==0)throw new Error(`Failed to run ${e} ${n.join(" ")}: ${i.error?.message||i.stderr||i.stdout}`);return(i.stdout||i.stderr||"").trim()}}});function kBe(t){let e=t;for(;;){let n=(0,DE.join)(e,".git");if((0,Ld.existsSync)(n))try{let i=(0,Ld.statSync)(n);if(i.isFile()){let s=(0,Ld.readFileSync)(n,"utf8").trim();if(s.startsWith("gitdir: ")){let o=(0,DE.resolve)(e,s.slice(8).trim()),a=(0,DE.join)(o,"HEAD");if(!(0,Ld.existsSync)(a))return null;let c=(0,DE.join)(o,"commondir"),u=(0,Ld.existsSync)(c)?(0,DE.resolve)(o,(0,Ld.readFileSync)(c,"utf8").trim()):o;return{repoDir:e,commonGitDir:u,headPath:a}}}else if(i.isDirectory()){let s=(0,DE.join)(n,"HEAD");return(0,Ld.existsSync)(s)?{repoDir:e,commonGitDir:n,headPath:s}:null}}catch{return null}let r=(0,DE.dirname)(e);if(r===e)return null;e=r}}function XKi(t){let e=(0,NBe.spawnSync)("git",["--no-optional-locks","symbolic-ref","--quiet","--short","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]});return(e.status===0?e.stdout.trim():"")||null}function ZKi(t){return new Promise(e=>{(0,NBe.execFile)("git",["--no-optional-locks","symbolic-ref","--quiet","--short","HEAD"],{cwd:t,encoding:"utf8"},(n,r)=>{if(n){e(null);return}let i=r.trim();e(i||null)})})}function eJi(){return process.platform==="linux"&&!!(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP)}function tJi(t){return/^\/mnt\/[a-z](?:\/|$)/i.test(t)}function nJi(t){return eJi()&&tJi(t)}var NBe,Ld,DE,BBe,Kht=v(()=>{p();NBe=require("child_process"),Ld=require("fs"),DE=require("path");Jot();BBe=class t{cwd;static WATCH_DEBOUNCE_MS=500;extensionStatuses=new Map;cachedBranch=void 0;gitPaths=void 0;headWatcher=null;headWatchFilePath=null;headWatchFileListener=null;reftableWatcher=null;reftableTablesListWatcher=null;reftableTablesListPath=null;branchChangeCallbacks=new Set;availableProviderCount=0;refreshTimer=null;gitWatcherRetryTimer=null;refreshInFlight=!1;refreshPending=!1;disposed=!1;constructor(e){this.cwd=e,this.gitPaths=kBe(e),this.setupGitWatcher()}getGitBranch(){return this.cachedBranch===void 0&&(this.cachedBranch=this.resolveGitBranchSync()),this.cachedBranch}getExtensionStatuses(){return this.extensionStatuses}onBranchChange(e){return this.branchChangeCallbacks.add(e),()=>this.branchChangeCallbacks.delete(e)}setExtensionStatus(e,n){n===void 0?this.extensionStatuses.delete(e):this.extensionStatuses.set(e,n)}clearExtensionStatuses(){this.extensionStatuses.clear()}getAvailableProviderCount(){return this.availableProviderCount}setAvailableProviderCount(e){this.availableProviderCount=e}setCwd(e){this.cwd!==e&&(this.cwd=e,this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null),this.clearGitWatchers(),this.cachedBranch=void 0,this.gitPaths=kBe(e),this.setupGitWatcher(),this.notifyBranchChange())}dispose(){this.disposed=!0,this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null),this.clearGitWatchers(),this.branchChangeCallbacks.clear()}notifyBranchChange(){for(let e of this.branchChangeCallbacks)e()}scheduleRefresh(){if(!(this.disposed||this.refreshTimer)){if(this.refreshInFlight){this.refreshPending=!0;return}this.refreshTimer=setTimeout(()=>{this.refreshTimer=null,this.refreshGitBranchAsync()},t.WATCH_DEBOUNCE_MS)}}async refreshGitBranchAsync(){if(!this.disposed){if(this.refreshInFlight){this.refreshPending=!0;return}this.refreshInFlight=!0;try{let e=await this.resolveGitBranchAsync();if(this.disposed)return;if(this.cachedBranch!==void 0&&this.cachedBranch!==e){this.cachedBranch=e,this.notifyBranchChange();return}this.cachedBranch=e}finally{this.refreshInFlight=!1,this.refreshPending&&!this.disposed&&(this.refreshPending=!1,this.scheduleRefresh())}}}resolveGitBranchSync(){try{if(!this.gitPaths)return null;let e=(0,Ld.readFileSync)(this.gitPaths.headPath,"utf8").trim();if(e.startsWith("ref: refs/heads/")){let n=e.slice(16);return n===".invalid"?XKi(this.gitPaths.repoDir)??"detached":n}return"detached"}catch{return null}}async resolveGitBranchAsync(){try{if(!this.gitPaths)return null;let e=(0,Ld.readFileSync)(this.gitPaths.headPath,"utf8").trim();if(e.startsWith("ref: refs/heads/")){let n=e.slice(16);return n===".invalid"?await ZKi(this.gitPaths.repoDir)??"detached":n}return"detached"}catch{return null}}clearGitWatchers(){tQ(this.headWatcher),this.headWatcher=null,this.headWatchFilePath&&this.headWatchFileListener&&((0,Ld.unwatchFile)(this.headWatchFilePath,this.headWatchFileListener),this.headWatchFilePath=null,this.headWatchFileListener=null),tQ(this.reftableWatcher),this.reftableWatcher=null,tQ(this.reftableTablesListWatcher),this.reftableTablesListWatcher=null,this.reftableTablesListPath&&((0,Ld.unwatchFile)(this.reftableTablesListPath),this.reftableTablesListPath=null),this.gitWatcherRetryTimer&&(clearTimeout(this.gitWatcherRetryTimer),this.gitWatcherRetryTimer=null)}scheduleGitWatcherRetry(){this.disposed||this.gitWatcherRetryTimer||(this.gitWatcherRetryTimer=setTimeout(()=>{this.gitWatcherRetryTimer=null,this.setupGitWatcher()},FBn))}handleGitWatcherError(){this.clearGitWatchers(),this.scheduleGitWatcherRetry()}setupGitWatcher(){if(this.clearGitWatchers(),!this.gitPaths)return;let e=nJi(this.gitPaths.repoDir);if(this.headWatcher=pj((0,DE.dirname)(this.gitPaths.headPath),(r,i)=>{(!i||i==="HEAD")&&this.scheduleRefresh()},()=>this.handleGitWatcherError()),e&&(this.headWatchFilePath=this.gitPaths.headPath,this.headWatchFileListener=(r,i)=>{(r.mtimeMs!==i.mtimeMs||r.ctimeMs!==i.ctimeMs||r.size!==i.size)&&this.scheduleRefresh()},(0,Ld.watchFile)(this.headWatchFilePath,{interval:1e3},this.headWatchFileListener)),!this.headWatcher&&!e)return;let n=(0,DE.join)(this.gitPaths.commonGitDir,"reftable");if((0,Ld.existsSync)(n)){if(this.reftableWatcher=pj(n,()=>{this.scheduleRefresh()},()=>this.handleGitWatcherError()),!this.reftableWatcher)return;let r=(0,DE.join)(n,"tables.list");if((0,Ld.existsSync)(r)){if(this.reftableTablesListPath=r,this.reftableTablesListWatcher=pj(r,()=>{this.scheduleRefresh()},()=>this.handleGitWatcherError()),!this.reftableTablesListWatcher)return;(0,Ld.watchFile)(r,{interval:250},(i,s)=>{(i.mtimeMs!==s.mtimeMs||i.ctimeMs!==s.ctimeMs||i.size!==s.size)&&this.scheduleRefresh()})}}}}});var Oo=re((wDc,c9n)=>{"use strict";p();c9n.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kRequestOrigin:Symbol("request origin"),kOriginless:Symbol("originless"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2Options:Symbol("http2 options"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHostAuthority:Symbol("host authority"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}});var rft=re((vDc,p9n)=>{"use strict";p();var mY=0,Jht=1e3,Xht=(Jht>>1)-1,fP,Zht=Symbol("kFastTimer"),ck=[],eft=-2,tft=-1,u9n=0,l9n=1;function nft(){mY+=Xht;let t=0,e=ck.length;for(;t=n._idleStart+n._idleTimeout&&(n._state=tft,n._idleStart=-1,n._onTimeout(n._timerArg)),n._state===tft?(n._state=eft,--e!==0&&(ck[t]=ck[e])):++t}ck.length=e,ck.length!==0&&d9n()}function d9n(){fP?.refresh?fP.refresh():(clearTimeout(fP),fP=setTimeout(nft,Xht),fP?.unref())}var DBe=class{[Zht]=!0;_state=eft;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,n,r){this._onTimeout=e,this._idleTimeout=n,this._timerArg=r,this.refresh()}refresh(){this._state===eft&&ck.push(this),(!fP||ck.length===1)&&d9n(),this._state=u9n}clear(){this._state=tft,this._idleStart=-1}};p9n.exports={setTimeout(t,e,n){return e<=Jht?setTimeout(t,e,n):new DBe(t,e,n)},clearTimeout(t){t[Zht]?t.clear():clearTimeout(t)},setFastTimeout(t,e,n){return new DBe(t,e,n)},clearFastTimeout(t){t.clear()},now(){return mY},tick(t=0){mY+=t-Jht+1,nft(),nft()},reset(){mY=0,ck.length=0,clearTimeout(fP),fP=null},kFastTimer:Zht}});var Wi=re((kDc,F9n)=>{"use strict";p();var m9n=Symbol.for("undici.error.UND_ERR"),jc=class extends Error{constructor(e,n){super(e,n),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[m9n]===!0}get[m9n](){return!0}},h9n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),ift=class extends jc{constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[h9n]===!0}get[h9n](){return!0}},f9n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),sft=class extends jc{constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[f9n]===!0}get[f9n](){return!0}},g9n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),oft=class extends jc{constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[g9n]===!0}get[g9n](){return!0}},A9n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),aft=class extends jc{constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[A9n]===!0}get[A9n](){return!0}},y9n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),cft=class extends jc{constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[y9n]===!0}get[y9n](){return!0}},E9n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),lft=class extends jc{constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[E9n]===!0}get[E9n](){return!0}},b9n=Symbol.for("undici.error.UND_ERR_ABORT"),PBe=class extends jc{constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[b9n]===!0}get[b9n](){return!0}},_9n=Symbol.for("undici.error.UND_ERR_ABORTED"),uft=class extends PBe{constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[_9n]===!0}get[_9n](){return!0}},x9n=Symbol.for("undici.error.UND_ERR_INFO"),dft=class extends jc{constructor(e,n){super(e,n),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[x9n]===!0}get[x9n](){return!0}},S9n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),pft=class extends jc{constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[S9n]===!0}get[S9n](){return!0}},C9n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),mft=class extends jc{constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[C9n]===!0}get[C9n](){return!0}},I9n=Symbol.for("undici.error.UND_ERR_DESTROYED"),hft=class extends jc{constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[I9n]===!0}get[I9n](){return!0}},w9n=Symbol.for("undici.error.UND_ERR_CLOSED"),fft=class extends jc{constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[w9n]===!0}get[w9n](){return!0}},T9n=Symbol.for("undici.error.UND_ERR_SOCKET"),gft=class extends jc{constructor(e,n){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=n}static[Symbol.hasInstance](e){return e&&e[T9n]===!0}get[T9n](){return!0}},v9n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Aft=class extends jc{constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[v9n]===!0}get[v9n](){return!0}},R9n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),yft=class extends jc{constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[R9n]===!0}get[R9n](){return!0}},k9n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Eft=class extends Error{constructor(e,n,r){super(e),this.name="HTTPParserError",this.code=n?`HPE_${n}`:void 0,this.data=r?r.toString():void 0}static[Symbol.hasInstance](e){return e&&e[k9n]===!0}get[k9n](){return!0}},B9n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),bft=class extends jc{constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[B9n]===!0}get[B9n](){return!0}},N9n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),_ft=class extends jc{constructor(e,n,{headers:r,data:i}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=n,this.data=i,this.headers=r}static[Symbol.hasInstance](e){return e&&e[N9n]===!0}get[N9n](){return!0}},D9n=Symbol.for("undici.error.UND_ERR_RESPONSE"),xft=class extends jc{constructor(e,n,{headers:r,body:i}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=n,this.body=i,this.headers=r}static[Symbol.hasInstance](e){return e&&e[D9n]===!0}get[D9n](){return!0}},P9n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Sft=class extends jc{constructor(e,n,r={}){super(n,{cause:e,...r}),this.name="SecureProxyConnectionError",this.message=n||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[P9n]===!0}get[P9n](){return!0}},M9n=Symbol.for("undici.error.UND_ERR_PRX_CONN"),Cft=class extends jc{constructor(e,n,r={}){super(n,{cause:e,...r}),this.name="ProxyConnectionError",this.message=n||"Proxy Connection failed",this.code="UND_ERR_PRX_CONN",this.cause=e}static[Symbol.hasInstance](e){return e&&e[M9n]===!0}get[M9n](){return!0}},O9n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Ift=class extends jc{constructor(e){super(e),this.name="MaxOriginsReachedError",this.message=e||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](e){return e&&e[O9n]===!0}get[O9n](){return!0}},wft=class extends jc{constructor(e,n){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=n||"UND_ERR_SOCKS5"}},L9n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),Tft=class extends jc{constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[L9n]===!0}get[L9n](){return!0}};F9n.exports={AbortError:PBe,HTTPParserError:Eft,UndiciError:jc,HeadersTimeoutError:sft,HeadersOverflowError:oft,BodyTimeoutError:aft,RequestContentLengthMismatchError:pft,ConnectTimeoutError:ift,InvalidArgumentError:cft,InvalidReturnValueError:lft,RequestAbortedError:uft,ClientDestroyedError:hft,ClientClosedError:fft,InformationalError:dft,SocketError:gft,NotSupportedError:Aft,ResponseContentLengthMismatchError:mft,BalancedPoolMissingUpstreamError:yft,ResponseExceededMaxSizeError:bft,RequestRetryError:_ft,ResponseError:xft,SecureProxyConnectionError:Sft,ProxyConnectionError:Cft,MaxOriginsReachedError:Ift,Socks5ProxyError:wft,MessageSizeExceededError:Tft}});var OBe=re((NDc,Q9n)=>{"use strict";p();var vft=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],MBe={};Object.setPrototypeOf(MBe,null);for(let t=0;t{"use strict";p();var{wellknownHeaderNames:U9n,headerNameLowerCasedRecord:rJi}=OBe(),Rft=class t{value=null;left=null;middle=null;right=null;code;constructor(e,n,r){if(r===void 0||r>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(r))>127)throw new TypeError("key must be ascii string");e.length!==++r?this.middle=new t(e,n,r):this.value=n}add(e,n){let r=e.length;if(r===0)throw new TypeError("Unreachable");let i=0,s=this;for(;;){let o=e.charCodeAt(i);if(o>127)throw new TypeError("key must be ascii string");if(s.code===o)if(r===++i){s.value=n;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,n,i);break}else if(s.code=65&&(s|=32);i!==null;){if(s===i.code){if(n===++r)return i;i=i.middle;break}i=i.code{"use strict";p();var _oe=require("node:assert"),{kDestroyed:z9n,kBodyUsed:hY,kListeners:QBe,kBody:H9n}=Oo(),{IncomingMessage:iJi}=require("node:http"),K9n=require("node:stream"),sJi=require("node:net"),{stringify:oJi}=require("node:querystring"),{EventEmitter:aJi,addAbortListener:cJi}=require("node:events"),FBe=rft(),{InvalidArgumentError:bp,ConnectTimeoutError:lJi}=Wi(),{headerNameLowerCasedRecord:uJi}=OBe(),{tree:J9n}=W9n(),GBe=class{constructor(e){this[H9n]=e,this[hY]=!1}async*[Symbol.asyncIterator](){_oe(!this[hY],"disturbed"),this[hY]=!0,yield*this[H9n]}};function q9n(){}function dJi(t){return $Be(t)?(r6n(t)===0&&t.on("data",function(){_oe(!1)}),typeof t.readableDidRead!="boolean"&&(t[hY]=!1,aJi.prototype.on.call(t,"data",function(){this[hY]=!0})),t):t&&typeof t.pipeTo=="function"?new GBe(t):t&&c6n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&n6n(t)?new GBe(t):t}function $Be(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}function X9n(t){return t instanceof Blob}function Z9n(t){return t.includes("?")||t.includes("#")}function pJi(t,e){if(Z9n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let n=oJi(e);return n&&(t+="?"+n),t}function e6n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}function UBe(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}function t6n(t){if(typeof t=="string"){if(t=new URL(t),!UBe(t.origin||t.protocol))throw new bp("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new bp("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&e6n(t.port)===!1)throw new bp("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new bp("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new bp("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new bp("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new bp("Invalid URL origin: the origin must be a string or null/undefined.");if(!UBe(t.origin||t.protocol))throw new bp("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,n=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,r=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return n[n.length-1]==="/"&&(n=n.slice(0,n.length-1)),r&&r[0]!=="/"&&(r=`/${r}`),new URL(`${n}${r}`)}if(!UBe(t.origin||t.protocol))throw new bp("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}function mJi(t){if(t=t6n(t),t.pathname!=="/"||t.search||t.hash)throw new bp("invalid url");return t}function hJi(t){if(t[0]==="["){let n=t.indexOf("]");return _oe(n!==-1),t.substring(1,n)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}function fJi(t){if(!t)return null;_oe(typeof t=="string");let e=hJi(t);return sJi.isIP(e)?"":e}function gJi(t){return JSON.parse(JSON.stringify(t))}function AJi(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}function n6n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}function yJi(t){let e=Object.getPrototypeOf(t);return Object.hasOwn(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}function r6n(t){if(t==null)return 0;if($Be(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(X9n(t))return t.size!=null?t.size:null;if(a6n(t))return t.byteLength}return null}function i6n(t){return t&&!!(t.destroyed||t[z9n]||K9n.isDestroyed?.(t))}function s6n(t,e){if(!(t==null||!$Be(t)||i6n(t))){if(typeof t.destroy=="function"){Object.getPrototypeOf(t).constructor===iJi&&(t.socket=null);try{t.destroy(e)}catch{}}else e&&queueMicrotask(()=>{t.emit("error",e)});t.destroyed!==!0&&(t[z9n]=!0)}}var EJi=/timeout=(\d+)/;function bJi(t){let e=t.match(EJi);return e?parseInt(e[1],10)*1e3:null}function o6n(t){return typeof t=="string"?uJi[t]??t.toLowerCase():J9n.lookup(t)??t.toString("latin1").toLowerCase()}function _Ji(t){return J9n.lookup(t)??t.toString("latin1").toLowerCase()}function xJi(t,e){e===void 0&&(e={});for(let n=0;no.toString("latin1")):t[n+1].toString("latin1");r==="__proto__"?Object.defineProperty(e,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[r]=s}else{let s=typeof t[n+1]=="string"?t[n+1]:Array.isArray(t[n+1])?t[n+1].map(o=>o.toString("latin1")):t[n+1].toString("latin1");e[r]=s}}return e}function SJi(t){if(t==null)return[];if(!Array.isArray(t)){let s=[];for(let[o,a]of Object.entries(t))if(Array.isArray(a))for(let c of a)s.push(o,`${c}`);else s.push(o,`${a}`);return s}let e=t.length,n=new Array(e),r,i;for(let s=0;sBuffer.from(e))}function a6n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}function wJi(t,e,n){if(!t||typeof t!="object")throw new bp("handler must be an object");if(typeof t.onRequestStart!="function")throw new bp("invalid onRequestStart method");if(typeof t.onResponseError!="function")throw new bp("invalid onResponseError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new bp("invalid onBodySent method");if(typeof t.onRequestSent!="function"&&t.onRequestSent!==void 0)throw new bp("invalid onRequestSent method");if(n||e==="CONNECT"){if(typeof t.onRequestUpgrade!="function")throw new bp("invalid onRequestUpgrade method")}else{if(typeof t.onResponseStart!="function")throw new bp("invalid onResponseStart method");if(typeof t.onResponseData!="function")throw new bp("invalid onResponseData method");if(typeof t.onResponseEnd!="function")throw new bp("invalid onResponseEnd method")}}function TJi(t){return!!(t&&(K9n.isDisturbed(t)||t[hY]))}function vJi(t){return{localAddress:t.localAddress,localPort:t.localPort,remoteAddress:t.remoteAddress,remotePort:t.remotePort,remoteFamily:t.remoteFamily,timeout:t.timeout,bytesWritten:t.bytesWritten,bytesRead:t.bytesRead}}function RJi(t){let e;return new ReadableStream({start(){e=t[Symbol.asyncIterator]()},pull(n){return e.next().then(({done:r,value:i})=>{if(r)return queueMicrotask(()=>{n.close(),n.byobRequest?.respond(0)});{let s=Buffer.isBuffer(i)?i:Buffer.from(i);return s.byteLength?n.enqueue(new Uint8Array(s)):this.pull(n)}})},cancel(){return e.return()},type:"bytes"})}function c6n(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}function kJi(t,e){return!t||"aborted"in t?cJi(t,e)[Symbol.dispose]:typeof t.addEventListener=="function"?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.once("abort",e),()=>t.removeListener("abort",e))}var l6n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function BJi(t){return l6n[t]===1}var NJi=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function DJi(t){if(t.length>=12)return NJi.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return q9n;let n=null,r=null,i=FBe.setFastTimeout(()=>{n=setImmediate(()=>{r=setImmediate(()=>j9n(t.deref(),e))})},e.timeout);return()=>{FBe.clearFastTimeout(i),clearImmediate(n),clearImmediate(r)}}:(t,e)=>{if(!e.timeout)return q9n;let n=null,r=FBe.setFastTimeout(()=>{n=setImmediate(()=>{j9n(t.deref(),e)})},e.timeout);return()=>{FBe.clearFastTimeout(r),clearImmediate(n)}};function j9n(t,e){if(t==null)return;let n="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?n+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:n+=` (attempted address: ${e.hostname}:${e.port},`,n+=` timeout: ${e.timeout}ms)`,s6n(t,new lJi(n))}var V9n=null,Y9n=null;function $Ji(t){if(t===V9n)return Y9n;let e=WJi(t);return V9n=t,Y9n=e,e}function WJi(t){if(t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p")switch(t[4]){case":":return"http:";case"s":if(t[5]===":")return"https:"}return t.slice(0,t.indexOf(":")+1)}var HJi={__proto__:null,enumerable:!0},kft={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT",query:"QUERY",QUERY:"QUERY"},u6n={...kft,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(kft,null);Object.setPrototypeOf(u6n,null);d6n.exports={kEnumerableProperty:HJi,isDisturbed:TJi,isBlobLike:X9n,parseOrigin:mJi,parseURL:t6n,getServerName:fJi,isStream:$Be,isIterable:n6n,hasSafeIterator:yJi,isAsyncIterable:AJi,isDestroyed:i6n,headerNameToString:o6n,bufferToLowerCasedHeaderName:_Ji,addListener:FJi,removeAllListeners:QJi,errorRequest:UJi,parseRawHeaders:SJi,toRawHeaders:CJi,encodeRawHeaders:IJi,parseHeaders:xJi,parseKeepAliveTimeout:bJi,destroy:s6n,bodyLength:r6n,deepClone:gJi,ReadableStreamFrom:RJi,isBuffer:a6n,assertRequestHandler:wJi,getSocketInfo:vJi,isFormDataLike:c6n,pathHasQueryOrFragment:Z9n,serializePathWithQuery:pJi,addAbortListener:kJi,isValidHTTPToken:DJi,isValidHeaderValue:MJi,isTokenCharCode:BJi,parseRangeHeader:LJi,normalizedMethodRecordsBase:kft,normalizedMethodRecords:u6n,isValidPort:e6n,isHttpOrHttpsPrefixed:UBe,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:dJi,setupConnectTimeout:GJi,getProtocolFromUrlString:$Ji}});var Dft=re((FDc,g6n)=>{"use strict";p();var{kConnected:p6n,kPending:m6n,kRunning:h6n,kSize:f6n,kFree:qJi,kQueued:jJi}=Oo(),Bft=class{constructor(e){this.connected=e[p6n],this.pending=e[m6n],this.running=e[h6n],this.size=e[f6n]}},Nft=class{constructor(e){this.connected=e[p6n],this.free=e[qJi],this.pending=e[m6n],this.queued=e[jJi],this.running=e[h6n],this.size=e[f6n]}};g6n.exports={ClientStats:Bft,PoolStats:Nft}});var gP=re((UDc,y6n)=>{"use strict";p();var $a=require("node:diagnostics_channel"),Lft=require("node:util"),rU=Lft.debuglog("undici"),xoe=Lft.debuglog("fetch"),WBe=Lft.debuglog("websocket"),PE={beforeConnect:$a.channel("undici:client:beforeConnect"),connected:$a.channel("undici:client:connected"),connectError:$a.channel("undici:client:connectError"),sendHeaders:$a.channel("undici:client:sendHeaders"),create:$a.channel("undici:request:create"),bodySent:$a.channel("undici:request:bodySent"),bodyChunkSent:$a.channel("undici:request:bodyChunkSent"),bodyChunkReceived:$a.channel("undici:request:bodyChunkReceived"),headers:$a.channel("undici:request:headers"),trailers:$a.channel("undici:request:trailers"),error:$a.channel("undici:request:error"),open:$a.channel("undici:websocket:open"),close:$a.channel("undici:websocket:close"),socketError:$a.channel("undici:websocket:socket_error"),ping:$a.channel("undici:websocket:ping"),pong:$a.channel("undici:websocket:pong"),proxyConnected:$a.channel("undici:proxy:connected")},Pft=!1;function A6n(t=rU){if(!Pft){if(PE.beforeConnect.hasSubscribers||PE.connected.hasSubscribers||PE.connectError.hasSubscribers||PE.sendHeaders.hasSubscribers){Pft=!0;return}Pft=!0,$a.subscribe("undici:client:beforeConnect",e=>{let{connectParams:{version:n,protocol:r,port:i,host:s}}=e;t("connecting to %s%s using %s%s",s,i?`:${i}`:"",r,n)}),$a.subscribe("undici:client:connected",e=>{let{connectParams:{version:n,protocol:r,port:i,host:s}}=e;t("connected to %s%s using %s%s",s,i?`:${i}`:"",r,n)}),$a.subscribe("undici:client:connectError",e=>{let{connectParams:{version:n,protocol:r,port:i,host:s},error:o}=e;t("connection to %s%s using %s%s errored - %s",s,i?`:${i}`:"",r,n,o.message)}),$a.subscribe("undici:client:sendHeaders",e=>{let{request:{method:n,path:r,origin:i}}=e;t("sending request to %s %s%s",n,i,r)})}}var Mft=!1;function VJi(t=rU){if(!Mft){if(PE.headers.hasSubscribers||PE.trailers.hasSubscribers||PE.error.hasSubscribers){Mft=!0;return}Mft=!0,$a.subscribe("undici:request:headers",e=>{let{request:{method:n,path:r,origin:i},response:{statusCode:s}}=e;t("received response to %s %s%s - HTTP %d",n,i,r,s)}),$a.subscribe("undici:request:trailers",e=>{let{request:{method:n,path:r,origin:i}}=e;t("trailers received from %s %s%s",n,i,r)}),$a.subscribe("undici:request:error",e=>{let{request:{method:n,path:r,origin:i},error:s}=e;t("request to %s %s%s errored - %s",n,i,r,s.message)})}}var Oft=!1;function YJi(t=WBe){if(!Oft){if(PE.open.hasSubscribers||PE.close.hasSubscribers||PE.socketError.hasSubscribers||PE.ping.hasSubscribers||PE.pong.hasSubscribers){Oft=!0;return}Oft=!0,$a.subscribe("undici:websocket:open",e=>{if(e.address!=null){let{address:n,port:r}=e.address;t("connection opened %s%s",n,r?`:${r}`:"")}else t("connection opened")}),$a.subscribe("undici:websocket:close",e=>{let{websocket:n,code:r,reason:i}=e;t("closed connection to %s - %s %s",n.url,r,i)}),$a.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),$a.subscribe("undici:websocket:ping",e=>{t("ping received")}),$a.subscribe("undici:websocket:pong",e=>{t("pong received")})}}(rU.enabled||xoe.enabled)&&(A6n(xoe.enabled?xoe:rU),VJi(xoe.enabled?xoe:rU));WBe.enabled&&(A6n(rU.enabled?rU:WBe),YJi(WBe));y6n.exports={channels:PE}});var _6n=re(($Dc,b6n)=>{"use strict";p();var{InvalidArgumentError:ra,NotSupportedError:zJi}=Wi(),Nw=require("node:assert"),{isValidHTTPToken:Qft,isValidHeaderValue:Soe,isStream:KJi,destroy:JJi,isBuffer:XJi,isFormDataLike:ZJi,isIterable:eXi,hasSafeIterator:tXi,isBlobLike:nXi,serializePathWithQuery:rXi,parseHeaders:Fft,assertRequestHandler:iXi,getServerName:sXi,normalizedMethodRecords:oXi,getProtocolFromUrlString:aXi}=Zi(),{channels:OA}=gP(),{headerNameLowerCasedRecord:E6n}=OBe(),cXi=/[^\u0021-\u00ff]/;function lXi(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}var $b=Symbol("handler"),AP=Symbol("controller"),Uft=Symbol("resume"),Gft=class{#e=!1;#t=null;#n=!1;#r;[Uft]=null;rawHeaders=null;rawTrailers=null;constructor(e){this.#r=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[Uft]?.())}abort(e){this.#n||(this.#n=!0,this.#t=e,this.#r(e))}get aborted(){return this.#n}get reason(){return this.#t}get paused(){return this.#e}},$ft=class{constructor(e,{path:n,method:r,body:i,headers:s,query:o,idempotent:a,blocking:c,upgrade:u,headersTimeout:l,bodyTimeout:d,reset:m,expectContinue:h,servername:f,throwOnError:g,maxRedirections:A,typeOfService:y},E){if(typeof n!="string")throw new ra("path must be a string");if(n[0]!=="/"&&!(n.startsWith("http://")||n.startsWith("https://"))&&r!=="CONNECT")throw new ra("path must be an absolute URL or start with a slash");if(cXi.test(n))throw new ra("invalid request path");if(typeof r!="string")throw new ra("method must be a string");if(oXi[r]===void 0&&!Qft(r))throw new ra("invalid request method");if(u&&typeof u!="string")throw new ra("upgrade must be a string");if(u&&!Soe(u))throw new ra("invalid upgrade header");if(l!=null&&(!Number.isFinite(l)||l<0))throw new ra("invalid headersTimeout");if(d!=null&&(!Number.isFinite(d)||d<0))throw new ra("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new ra("invalid reset");if(h!=null&&typeof h!="boolean")throw new ra("invalid expectContinue");if(g!=null)throw new ra("invalid throwOnError");if(A!=null&&A!==0)throw new ra("maxRedirections is not supported, use the redirect interceptor");if(y!=null&&(!Number.isInteger(y)||y<0||y>255))throw new ra("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=l,this.bodyTimeout=d,this.method=r,this.typeOfService=y,this.abort=null,i==null)this.body=null;else if(KJi(i)){this.body=i;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=function(){JJi(this)},this.body.on("end",this.endHandler)),this.errorHandler=S=>{this.abort?this.abort(S):this.error=S},this.body.on("error",this.errorHandler)}else if(XJi(i))this.body=i.byteLength?i:null;else if(ArrayBuffer.isView(i))this.body=i.buffer.byteLength?Buffer.from(i.buffer,i.byteOffset,i.byteLength):null;else if(i instanceof ArrayBuffer)this.body=i.byteLength?Buffer.from(i):null;else if(typeof i=="string")this.body=i.length?Buffer.from(i):null;else if(ZJi(i)||eXi(i)||nXi(i))this.body=i;else throw new ra("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=u||null,this.path=o?rXi(n,o):n,this.origin=e,this.protocol=aXi(e),this.idempotent=a??(r==="HEAD"||r==="GET"||r==="QUERY"),this.blocking=c??this.method!=="HEAD",this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=h??!1,Array.isArray(s)){if(s.length%2!==0)throw new ra("headers array must be even");for(let _=0;_{"use strict";p();var uXi=require("node:events"),{kOriginless:dXi,kUrl:Wft}=Oo(),Hft=class extends uXi{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let n=Array.isArray(e[0])?e[0]:e,r=this[dXi]===!0?null:this[Wft]?.origin,i=this.dispatch.bind(this);for(let a of n)if(a!=null){if(typeof a!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof a}`);if(i=a(i,r),i==null||typeof i!="function"||i.length!==2)throw new TypeError("invalid interceptor")}let s=i,o=this;return i=function(a,c){return a&&typeof a=="object"&&!a.origin&&o[Wft]&&(a=Object.assign({},a,{origin:o[Wft].origin})),s(a,c)},new Proxy(this,{get:(a,c)=>c==="dispatch"?i:a[c]})}};x6n.exports=Hft});var sU=re((jDc,C6n)=>{"use strict";p();var pXi=require("node:buffer"),mXi=fY(),{ClientDestroyedError:qft,ClientClosedError:hXi,InvalidArgumentError:Coe}=Wi(),{kDestroy:fXi,kClose:gXi,kClosed:Ioe,kDestroyed:gY,kDispatch:AXi}=Oo(),yP=Symbol("onDestroyed"),iU=Symbol("onClosed"),jft=Symbol("webSocketOptions"),S6n=Symbol("eventSourceOptions"),Vft=class extends mXi{[gY]=!1;[yP]=null;[Ioe]=!1;[iU]=null;constructor(e){super(),this[jft]=e?.webSocket??{},this[S6n]=e?.eventSource??{}}get webSocketOptions(){return{maxFragments:this[jft].maxFragments??131072,maxPayloadSize:this[jft].maxPayloadSize??128*1024*1024}}get eventSourceOptions(){return{maxEventSize:this[S6n].maxEventSize??pXi.kStringMaxLength}}get destroyed(){return this[gY]}get closed(){return this[Ioe]}close(e){if(e===void 0)return new Promise((r,i)=>{this.close((s,o)=>s?i(s):r(o))});if(typeof e!="function")throw new Coe("invalid callback");if(this[gY]){let r=new qft;queueMicrotask(()=>e(r,null));return}if(this[Ioe]){this[iU]?this[iU].push(e):queueMicrotask(()=>e(null,null));return}this[Ioe]=!0,this[iU]??=[],this[iU].push(e);let n=()=>{let r=this[iU];this[iU]=null;for(let i=0;ithis.destroy()).then(()=>queueMicrotask(n))}destroy(e,n){if(typeof e=="function"&&(n=e,e=null),n===void 0)return new Promise((i,s)=>{this.destroy(e,(o,a)=>o?s(o):i(a))});if(typeof n!="function")throw new Coe("invalid callback");if(this[gY]){this[yP]?this[yP].push(n):queueMicrotask(()=>n(null,null));return}e||(e=new qft),this[gY]=!0,this[yP]??=[],this[yP].push(n);let r=()=>{let i=this[yP];this[yP]=null;for(let s=0;squeueMicrotask(r))}dispatch(e,n){if(!n||typeof n!="object")throw new Coe("handler must be an object");try{if(!e||typeof e!="object")throw new Coe("opts must be an object.");if(e.dispatcher)throw new Coe("opts.dispatcher is not supported by instance methods. Pass opts.dispatcher to the top-level undici functions or call the dispatcher instance method directly.");if(this[gY]||this[yP])throw new qft;if(this[Ioe])throw new hXi;return this[AXi](e,n)}catch(r){if(typeof n.onResponseError!="function")throw r;return n.onResponseError(null,r),!1}}};C6n.exports=Vft});var oU=re((zDc,v6n)=>{"use strict";p();var I6n=require("node:net"),w6n=require("node:assert"),T6n=Zi(),{InvalidArgumentError:yXi,ConnectTimeoutError:EXi}=Wi(),Yft,bXi=class{constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry(n=>{if(this._sessionCache.size=this._maxCachedSessions){for(let[i,s]of this._sessionCache)if(s.deref()===void 0){this._sessionCache.delete(i);return}let r=this._sessionCache.keys().next();r.done||this._sessionCache.delete(r.value)}this._sessionCache.set(e,new WeakRef(n)),this._sessionRegistry.register(n,e)}}};function _Xi({allowH2:t,preferH2:e,useH2c:n,maxCachedSessions:r,socketPath:i,timeout:s,session:o,...a}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new yXi("maxCachedSessions must be a positive integer or zero");let c={path:i,...a},u=new bXi(r??100);return s=s??1e4,t=t??!0,function({hostname:d,host:m,protocol:h,port:f,servername:g,localAddress:A,httpSocket:y},E){let _;if(h==="https:"){Yft||(Yft=require("node:tls")),g=g||c.servername||T6n.getServerName(m)||null;let C=g||d;w6n(C);let I=o||u.get(C)||null;f=f||443,_=Yft.connect({highWaterMark:16384,...c,servername:g,session:I,localAddress:A,ALPNProtocols:t?e?["h2","http/1.1"]:["http/1.1","h2"]:["http/1.1"],socket:y,port:f,host:d}),_.on("session",function(w){u.set(C,w)})}else{w6n(!y,"httpSocket can only be sent on TLS update"),f=f||80;let C={highWaterMark:64*1024,...c,localAddress:A,port:f,host:d},I=I6n.isIP(d);I!==0&&g&&g!==d&&(C.host=g,C.lookup=(w,k,N)=>{k.all?N(null,[{address:d,family:I}]):N(null,d,I)}),_=I6n.connect(C),n===!0&&(_.alpnProtocol="h2")}if(c.keepAlive==null||c.keepAlive){let C=c.keepAliveInitialDelay===void 0?6e4:c.keepAliveInitialDelay;_.setKeepAlive(!0,C)}let S=T6n.setupConnectTimeout(new WeakRef(_),{timeout:s,hostname:d,port:f});return _.setNoDelay(!0).once(h==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(S),E){let C=E;E=null,C(null,this)}}).on("error",function(C){if(queueMicrotask(S),E){let I=E;E=null,I(xXi(C,this,{timeout:s,hostname:d,port:f}))}}),_}}function xXi(t,e,n){if(t instanceof AggregateError&&(t.code==="ETIMEDOUT"||t.errors.some(r=>r!=null&&r.code==="ETIMEDOUT"))){let r="Connect Timeout Error";Array.isArray(e.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${e.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${n.hostname}:${n.port},`,r+=` timeout: ${n.timeout}ms)`;let i=new EXi(r);return i.cause=t,i}return t}v6n.exports=_Xi});var R6n=re(zft=>{"use strict";p();Object.defineProperty(zft,"__esModule",{value:!0});zft.enumToMap=SXi;function SXi(t,e=[],n=[]){let r=(e?.length??0)===0,i=(n?.length??0)===0;return Object.fromEntries(Object.entries(t).filter(([,s])=>typeof s=="number"&&(r||e.includes(s))&&(i||!n.includes(s))))}});var k6n=re(it=>{"use strict";p();Object.defineProperty(it,"__esModule",{value:!0});it.SPECIAL_HEADERS=it.MINOR=it.MAJOR=it.HTAB_SP_VCHAR_OBS_TEXT=it.QUOTED_STRING=it.CONNECTION_TOKEN_CHARS=it.HEADER_CHARS=it.TOKEN=it.HEX=it.URL_CHAR=it.USERINFO_CHARS=it.MARK=it.ALPHANUM=it.NUM=it.HEX_MAP=it.NUM_MAP=it.ALPHA=it.STATUSES_HTTP=it.H_METHOD_MAP=it.METHOD_MAP=it.METHODS_RTSP=it.METHODS_ICE=it.METHODS_HTTP=it.HEADER_STATE=it.FINISH=it.STATUSES=it.METHODS=it.LENIENT_FLAGS=it.FLAGS=it.TYPE=it.ERROR=void 0;var CXi=R6n();it.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38};it.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};it.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512};it.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512};it.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46};it.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599};it.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};it.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8};it.METHODS_HTTP=[it.METHODS.DELETE,it.METHODS.GET,it.METHODS.HEAD,it.METHODS.POST,it.METHODS.PUT,it.METHODS.CONNECT,it.METHODS.OPTIONS,it.METHODS.TRACE,it.METHODS.COPY,it.METHODS.LOCK,it.METHODS.MKCOL,it.METHODS.MOVE,it.METHODS.PROPFIND,it.METHODS.PROPPATCH,it.METHODS.SEARCH,it.METHODS.UNLOCK,it.METHODS.BIND,it.METHODS.REBIND,it.METHODS.UNBIND,it.METHODS.ACL,it.METHODS.REPORT,it.METHODS.MKACTIVITY,it.METHODS.CHECKOUT,it.METHODS.MERGE,it.METHODS["M-SEARCH"],it.METHODS.NOTIFY,it.METHODS.SUBSCRIBE,it.METHODS.UNSUBSCRIBE,it.METHODS.PATCH,it.METHODS.PURGE,it.METHODS.MKCALENDAR,it.METHODS.LINK,it.METHODS.UNLINK,it.METHODS.PRI,it.METHODS.SOURCE,it.METHODS.QUERY];it.METHODS_ICE=[it.METHODS.SOURCE];it.METHODS_RTSP=[it.METHODS.OPTIONS,it.METHODS.DESCRIBE,it.METHODS.ANNOUNCE,it.METHODS.SETUP,it.METHODS.PLAY,it.METHODS.PAUSE,it.METHODS.TEARDOWN,it.METHODS.GET_PARAMETER,it.METHODS.SET_PARAMETER,it.METHODS.REDIRECT,it.METHODS.RECORD,it.METHODS.FLUSH,it.METHODS.GET,it.METHODS.POST];it.METHOD_MAP=(0,CXi.enumToMap)(it.METHODS);it.H_METHOD_MAP=Object.fromEntries(Object.entries(it.METHODS).filter(([t])=>t.startsWith("H")));it.STATUSES_HTTP=[it.STATUSES.CONTINUE,it.STATUSES.SWITCHING_PROTOCOLS,it.STATUSES.PROCESSING,it.STATUSES.EARLY_HINTS,it.STATUSES.RESPONSE_IS_STALE,it.STATUSES.REVALIDATION_FAILED,it.STATUSES.DISCONNECTED_OPERATION,it.STATUSES.HEURISTIC_EXPIRATION,it.STATUSES.MISCELLANEOUS_WARNING,it.STATUSES.OK,it.STATUSES.CREATED,it.STATUSES.ACCEPTED,it.STATUSES.NON_AUTHORITATIVE_INFORMATION,it.STATUSES.NO_CONTENT,it.STATUSES.RESET_CONTENT,it.STATUSES.PARTIAL_CONTENT,it.STATUSES.MULTI_STATUS,it.STATUSES.ALREADY_REPORTED,it.STATUSES.TRANSFORMATION_APPLIED,it.STATUSES.IM_USED,it.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,it.STATUSES.MULTIPLE_CHOICES,it.STATUSES.MOVED_PERMANENTLY,it.STATUSES.FOUND,it.STATUSES.SEE_OTHER,it.STATUSES.NOT_MODIFIED,it.STATUSES.USE_PROXY,it.STATUSES.SWITCH_PROXY,it.STATUSES.TEMPORARY_REDIRECT,it.STATUSES.PERMANENT_REDIRECT,it.STATUSES.BAD_REQUEST,it.STATUSES.UNAUTHORIZED,it.STATUSES.PAYMENT_REQUIRED,it.STATUSES.FORBIDDEN,it.STATUSES.NOT_FOUND,it.STATUSES.METHOD_NOT_ALLOWED,it.STATUSES.NOT_ACCEPTABLE,it.STATUSES.PROXY_AUTHENTICATION_REQUIRED,it.STATUSES.REQUEST_TIMEOUT,it.STATUSES.CONFLICT,it.STATUSES.GONE,it.STATUSES.LENGTH_REQUIRED,it.STATUSES.PRECONDITION_FAILED,it.STATUSES.PAYLOAD_TOO_LARGE,it.STATUSES.URI_TOO_LONG,it.STATUSES.UNSUPPORTED_MEDIA_TYPE,it.STATUSES.RANGE_NOT_SATISFIABLE,it.STATUSES.EXPECTATION_FAILED,it.STATUSES.IM_A_TEAPOT,it.STATUSES.PAGE_EXPIRED,it.STATUSES.ENHANCE_YOUR_CALM,it.STATUSES.MISDIRECTED_REQUEST,it.STATUSES.UNPROCESSABLE_ENTITY,it.STATUSES.LOCKED,it.STATUSES.FAILED_DEPENDENCY,it.STATUSES.TOO_EARLY,it.STATUSES.UPGRADE_REQUIRED,it.STATUSES.PRECONDITION_REQUIRED,it.STATUSES.TOO_MANY_REQUESTS,it.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,it.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,it.STATUSES.LOGIN_TIMEOUT,it.STATUSES.NO_RESPONSE,it.STATUSES.RETRY_WITH,it.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,it.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,it.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,it.STATUSES.INVALID_X_FORWARDED_FOR,it.STATUSES.REQUEST_HEADER_TOO_LARGE,it.STATUSES.SSL_CERTIFICATE_ERROR,it.STATUSES.SSL_CERTIFICATE_REQUIRED,it.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,it.STATUSES.INVALID_TOKEN,it.STATUSES.CLIENT_CLOSED_REQUEST,it.STATUSES.INTERNAL_SERVER_ERROR,it.STATUSES.NOT_IMPLEMENTED,it.STATUSES.BAD_GATEWAY,it.STATUSES.SERVICE_UNAVAILABLE,it.STATUSES.GATEWAY_TIMEOUT,it.STATUSES.HTTP_VERSION_NOT_SUPPORTED,it.STATUSES.VARIANT_ALSO_NEGOTIATES,it.STATUSES.INSUFFICIENT_STORAGE,it.STATUSES.LOOP_DETECTED,it.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,it.STATUSES.NOT_EXTENDED,it.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,it.STATUSES.WEB_SERVER_UNKNOWN_ERROR,it.STATUSES.WEB_SERVER_IS_DOWN,it.STATUSES.CONNECTION_TIMEOUT,it.STATUSES.ORIGIN_IS_UNREACHABLE,it.STATUSES.TIMEOUT_OCCURED,it.STATUSES.SSL_HANDSHAKE_FAILED,it.STATUSES.INVALID_SSL_CERTIFICATE,it.STATUSES.RAILGUN_ERROR,it.STATUSES.SITE_IS_OVERLOADED,it.STATUSES.SITE_IS_FROZEN,it.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,it.STATUSES.NETWORK_READ_TIMEOUT,it.STATUSES.NETWORK_CONNECT_TIMEOUT];it.ALPHA=[];for(let t=65;t<=90;t++)it.ALPHA.push(String.fromCharCode(t)),it.ALPHA.push(String.fromCharCode(t+32));it.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};it.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};it.NUM=["0","1","2","3","4","5","6","7","8","9"];it.ALPHANUM=it.ALPHA.concat(it.NUM);it.MARK=["-","_",".","!","~","*","'","(",")"];it.USERINFO_CHARS=it.ALPHANUM.concat(it.MARK).concat(["%",";",":","&","=","+","$",","]);it.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(it.ALPHANUM);it.HEX=it.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);it.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(it.ALPHANUM);it.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&it.HEADER_CHARS.push(t);it.CONNECTION_TOKEN_CHARS=it.HEADER_CHARS.filter(t=>t!==44);it.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&it.QUOTED_STRING.push(t);it.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)it.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)it.HTAB_SP_VCHAR_OBS_TEXT.push(t);it.MAJOR=it.NUM_MAP;it.MINOR=it.MAJOR;it.SPECIAL_HEADERS={connection:it.HEADER_STATE.CONNECTION,"content-length":it.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":it.HEADER_STATE.CONNECTION,"transfer-encoding":it.HEADER_STATE.TRANSFER_ENCODING,upgrade:it.HEADER_STATE.UPGRADE};it.default={ERROR:it.ERROR,TYPE:it.TYPE,FLAGS:it.FLAGS,LENIENT_FLAGS:it.LENIENT_FLAGS,METHODS:it.METHODS,STATUSES:it.STATUSES,FINISH:it.FINISH,HEADER_STATE:it.HEADER_STATE,ALPHA:it.ALPHA,NUM_MAP:it.NUM_MAP,HEX_MAP:it.HEX_MAP,NUM:it.NUM,ALPHANUM:it.ALPHANUM,MARK:it.MARK,USERINFO_CHARS:it.USERINFO_CHARS,URL_CHAR:it.URL_CHAR,HEX:it.HEX,TOKEN:it.TOKEN,HEADER_CHARS:it.HEADER_CHARS,CONNECTION_TOKEN_CHARS:it.CONNECTION_TOKEN_CHARS,QUOTED_STRING:it.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:it.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:it.MAJOR,MINOR:it.MINOR,SPECIAL_HEADERS:it.SPECIAL_HEADERS,METHODS_HTTP:it.METHODS_HTTP,METHODS_ICE:it.METHODS_ICE,METHODS_RTSP:it.METHODS_RTSP,METHOD_MAP:it.METHOD_MAP,H_METHOD_MAP:it.H_METHOD_MAP,STATUSES_HTTP:it.STATUSES_HTTP}});var Jft=re((tPc,B6n)=>{"use strict";p();var{Buffer:IXi}=require("node:buffer"),wXi="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCq/ZAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAygCHCICQQJrDvwBAfkBAgMEBQYHCAkKCwwNDg8QERL4ARP3ARQV9gEWF/UBGBkaGxwdHh8g/QH7ASH0ASIjJCUmJygpKivzASwtLi8wMTLyAfEBMzTwAe8BNTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5P+gFQUVJT7gHtAVTsAVXrAVZXWFla6gFbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHpAegBzwHnAdAB5gHRAdIB0wHUAeUB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMBAPwBC0EADOMBC0EODOIBC0ENDOEBC0EPDOABC0EQDN8BC0ETDN4BC0EUDN0BC0EVDNwBC0EWDNsBC0EXDNoBC0EYDNkBC0EZDNgBC0EaDNcBC0EbDNYBC0EcDNUBC0EdDNQBC0EeDNMBC0EfDNIBC0EgDNEBC0EhDNABC0EIDM8BC0EiDM4BC0EkDM0BC0EjDMwBC0EHDMsBC0ElDMoBC0EmDMkBC0EnDMgBC0EoDMcBC0ESDMYBC0ERDMUBC0EpDMQBC0EqDMMBC0ErDMIBC0EsDMEBC0HeAQzAAQtBLgy/AQtBLwy+AQtBMAy9AQtBMQy8AQtBMgy7AQtBMwy6AQtBNAy5AQtB3wEMuAELQTUMtwELQTkMtgELQQwMtQELQTYMtAELQTcMswELQTgMsgELQT4MsQELQToMsAELQeABDK8BC0ELDK4BC0E/DK0BC0E7DKwBC0EKDKsBC0E8DKoBC0E9DKkBC0HhAQyoAQtBwQAMpwELQcAADKYBC0HCAAylAQtBCQykAQtBLQyjAQtBwwAMogELQcQADKEBC0HFAAygAQtBxgAMnwELQccADJ4BC0HIAAydAQtByQAMnAELQcoADJsBC0HLAAyaAQtBzAAMmQELQc0ADJgBC0HOAAyXAQtBzwAMlgELQdAADJUBC0HRAAyUAQtB0gAMkwELQdMADJIBC0HVAAyRAQtB1AAMkAELQdYADI8BC0HXAAyOAQtB2AAMjQELQdkADIwBC0HaAAyLAQtB2wAMigELQdwADIkBC0HdAAyIAQtB3gAMhwELQd8ADIYBC0HgAAyFAQtB4QAMhAELQeIADIMBC0HjAAyCAQtB5AAMgQELQeUADIABC0HiAQx/C0HmAAx+C0HnAAx9C0EGDHwLQegADHsLQQUMegtB6QAMeQtBBAx4C0HqAAx3C0HrAAx2C0HsAAx1C0HtAAx0C0EDDHMLQe4ADHILQe8ADHELQfAADHALQfIADG8LQfEADG4LQfMADG0LQfQADGwLQfUADGsLQfYADGoLQQIMaQtB9wAMaAtB+AAMZwtB+QAMZgtB+gAMZQtB+wAMZAtB/AAMYwtB/QAMYgtB/gAMYQtB/wAMYAtBgAEMXwtBgQEMXgtBggEMXQtBgwEMXAtBhAEMWwtBhQEMWgtBhgEMWQtBhwEMWAtBiAEMVwtBiQEMVgtBigEMVQtBiwEMVAtBjAEMUwtBjQEMUgtBjgEMUQtBjwEMUAtBkAEMTwtBkQEMTgtBkgEMTQtBkwEMTAtBlAEMSwtBlQEMSgtBlgEMSQtBlwEMSAtBmAEMRwtBmQEMRgtBmgEMRQtBmwEMRAtBnAEMQwtBnQEMQgtBngEMQQtBnwEMQAtBoAEMPwtBoQEMPgtBogEMPQtBowEMPAtBpAEMOwtBpQEMOgtBpgEMOQtBpwEMOAtBqAEMNwtBqQEMNgtBqgEMNQtBqwEMNAtBrAEMMwtBrQEMMgtBrgEMMQtBrwEMMAtBsAEMLwtBsQEMLgtBsgEMLQtBswEMLAtBtAEMKwtBtQEMKgtBtgEMKQtBtwEMKAtBuAEMJwtBuQEMJgtBugEMJQtBuwEMJAtBvAEMIwtBvQEMIgtBvgEMIQtBvwEMIAtBwAEMHwtBwQEMHgtBwgEMHQtBAQwcC0HDAQwbC0HEAQwaC0HFAQwZC0HGAQwYC0HHAQwXC0HIAQwWC0HJAQwVC0HKAQwUC0HLAQwTC0HMAQwSC0HNAQwRC0HOAQwQC0HPAQwPC0HQAQwOC0HRAQwNC0HSAQwMC0HTAQwLC0HUAQwKC0HVAQwJC0HWAQwIC0HjAQwHC0HXAQwGC0HYAQwFC0HZAQwEC0HaAQwDC0HbAQwCC0HdAQwBC0HcAQshAgNAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcCpgKlAqQCowKiAqECoAKfApgCkAKMAosCigKBAv4B/QH8AfsB+gH5AfgB9wH1AfMB8AHrAekB6AHnAeYB5QHkAeMB4gHhAeAB3wHeAd0B3AHaAdkB2AHXAdYB1QHUAdMB0gHRAdABzwHOAc0BzAHLAcoByQHIAccBxgHFAcQBwwHCAcEBwAG/Ab4BvQG8AbsBugG5AbgBtwG2AbUBtAGzAbIBsQGwAa8BrgGtAawBqwGqAakBqAGnAaYBpQGkAaMBogGfAZ4BmQGYAZcBlgGVAZQBkwGSAZEBkAGPAY0BjAGHAYYBhQGEAYMBggF9fHt6eXZ1dFBRUlNUVQsgASAERw1yQf0BIQIMvgMLIAEgBEcNmAFB2wEhAgy9AwsgASAERw3xAUGOASECDLwDCyABIARHDfwBQYQBIQIMuwMLIAEgBEcNigJB/wAhAgy6AwsgASAERw2RAkH9ACECDLkDCyABIARHDZQCQfsAIQIMuAMLIAEgBEcNHkEeIQIMtwMLIAEgBEcNGUEYIQIMtgMLIAEgBEcNygJBzQAhAgy1AwsgASAERw3VAkHGACECDLQDCyABIARHDdYCQcMAIQIMswMLIAEgBEcN3AJBOCECDLIDCyADLQAwQQFGDa0DDIkDC0EAIQACQAJAAkAgAy0AKkUNACADLQArRQ0AIAMvATIiAkECcUUNAQwCCyADLwEyIgJBAXFFDQELQQEhACADLQAoQQFGDQAgAy8BNCIGQeQAa0HkAEkNACAGQcwBRg0AIAZBsAJGDQAgAkHAAHENAEEAIQAgAkGIBHFBgARGDQAgAkEocUEARyEACyADQQA7ATIgA0EAOgAxAkAgAEUEQCADQQA6ADEgAy0ALkEEcQ0BDLEDCyADQgA3AyALIANBADoAMSADQQE6ADYMSAtBACEAAkAgAygCOCICRQ0AIAIoAjAiAkUNACADIAIRAAAhAAsgAEUNSCAAQRVHDWIgA0EENgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMrwMLIAEgBEYEQEEGIQIMrwMLIAEtAABBCkcNGSABQQFqIQEMGgsgA0IANwMgQRIhAgyUAwsgASAERw2KA0EjIQIMrAMLIAEgBEYEQEEHIQIMrAMLAkACQCABLQAAQQprDgQBGBgAGAsgAUEBaiEBQRAhAgyTAwsgAUEBaiEBIANBL2otAABBAXENF0EAIQIgA0EANgIcIAMgATYCFCADQZkgNgIQIANBGTYCDAyrAwsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFoNGEEIIQIMqgMLIAEgBEcEQCADQQk2AgggAyABNgIEQRQhAgyRAwtBCSECDKkDCyADKQMgUA2uAgxDCyABIARGBEBBCyECDKgDCyABLQAAQQpHDRYgAUEBaiEBDBcLIANBL2otAABBAXFFDRkMJgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0ZDEILQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGgwkC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRsMMgsgA0Evai0AAEEBcUUNHAwiC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADRwMQgtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0dDCALIAEgBEYEQEETIQIMoAMLAkAgAS0AACIAQQprDgQfIyMAIgsgAUEBaiEBDB8LQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIgxCCyABIARGBEBBFiECDJ4DCyABLQAAQcDBAGotAABBAUcNIwyDAwsCQANAIAEtAABBsDtqLQAAIgBBAUcEQAJAIABBAmsOAgMAJwsgAUEBaiEBQSEhAgyGAwsgBCABQQFqIgFHDQALQRghAgydAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAFBAWoiARA0IgANIQxBC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADSMMKgsgASAERgRAQRwhAgybAwsgA0EKNgIIIAMgATYCBEEAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADSVBJCECDIEDCyABIARHBEADQCABLQAAQbA9ai0AACIAQQNHBEAgAEEBaw4FGBomggMlJgsgBCABQQFqIgFHDQALQRshAgyaAwtBGyECDJkDCwNAIAEtAABBsD9qLQAAIgBBA0cEQCAAQQFrDgUPEScTJicLIAQgAUEBaiIBRw0AC0EeIQIMmAMLIAEgBEcEQCADQQs2AgggAyABNgIEQQchAgz/AgtBHyECDJcDCyABIARGBEBBICECDJcDCwJAIAEtAABBDWsOFC4/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8APwtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQMlgMLIANBL2ohAgNAIAEgBEYEQEEhIQIMlwMLAkACQAJAIAEtAAAiAEEJaw4YAgApKQEpKSkpKSkpKSkpKSkpKSkpKSkCJwsgAUEBaiEBIANBL2otAABBAXFFDQoMGAsgAUEBaiEBDBcLIAFBAWohASACLQAAQQJxDQALQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDJUDCyADLQAuQYABcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUN5gIgAEEVRgRAIANBJDYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDJQDC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAyTAwtBACECIANBADYCHCADIAE2AhQgA0G+IDYCECADQQI2AgwMkgMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABIAynaiIBEDIiAEUNKyADQQc2AhwgAyABNgIUIAMgADYCDAyRAwsgAy0ALkHAAHFFDQELQQAhAAJAIAMoAjgiAkUNACACKAJYIgJFDQAgAyACEQAAIQALIABFDSsgAEEVRgRAIANBCjYCHCADIAE2AhQgA0HrGTYCECADQRU2AgxBACECDJADC0EAIQIgA0EANgIcIAMgATYCFCADQZMMNgIQIANBEzYCDAyPAwtBACECIANBADYCHCADIAE2AhQgA0GCFTYCECADQQI2AgwMjgMLQQAhAiADQQA2AhwgAyABNgIUIANB3RQ2AhAgA0EZNgIMDI0DC0EAIQIgA0EANgIcIAMgATYCFCADQeYdNgIQIANBGTYCDAyMAwsgAEEVRg09QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIsDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFDSggA0ENNgIcIAMgATYCFCADIAA2AgwMigMLIABBFUYNOkEAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAyJAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwoCyADQQ42AhwgAyAANgIMIAMgAUEBajYCFAyIAwsgAEEVRg03QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIcDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCcLIANBDzYCHCADIAA2AgwgAyABQQFqNgIUDIYDC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAyFAwsgAEEVRg0zQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIQDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFDSUgA0ERNgIcIAMgATYCFCADIAA2AgwMgwMLIABBFUYNMEEAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAyCAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwlCyADQRI2AhwgAyAANgIMIAMgAUEBajYCFAyBAwsgA0Evai0AAEEBcUUNAQtBFyECDOYCC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAz+AgsgAEE7Rw0AIAFBAWohAQwMC0EAIQIgA0EANgIcIAMgATYCFCADQZIYNgIQIANBAjYCDAz8AgsgAEEVRg0oQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDPsCCyADQRQ2AhwgAyABNgIUIAMgADYCDAz6AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQz1AgsgA0EVNgIcIAMgADYCDCADIAFBAWo2AhQM+QILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM8wILIANBFzYCHCADIAA2AgwgAyABQQFqNgIUDPgCCyAAQRVGDSNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM9wILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEMHQsgA0EZNgIcIAMgADYCDCADIAFBAWo2AhQM9gILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM7wILIANBGjYCHCADIAA2AgwgAyABQQFqNgIUDPUCCyAAQRVGDR9BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwM9AILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwbCyADQRw2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8wILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQzrAgsgA0EdNgIcIAMgADYCDCADIAFBAWo2AhRBACECDPICCyAAQTtHDQEgAUEBaiEBC0EmIQIM1wILQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDO8CCyABIARHBEADQCABLQAAQSBHDYQCIAQgAUEBaiIBRw0AC0EsIQIM7wILQSwhAgzuAgsgASAERgRAQTQhAgzuAgsCQAJAA0ACQCABLQAAQQprDgQCAAADAAsgBCABQQFqIgFHDQALQTQhAgzvAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDZ8CIANBMjYCHCADIAE2AhQgAyAANgIMQQAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDJ8CCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM7QILIAEgBEcEQAJAA0AgAS0AAEEwayIAQf8BcUEKTwRAQTohAgzXAgsgAykDICILQpmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEAgA0EAOwE0IAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBmRE2AhAgA0EJNgIMQQAhAgyrAgtBxwEhAgyRAgsgASAERgRAQeABIQIMqgILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyrAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqgILQcYBIQIMkAILIAEgBEYEQEHfASECDKkCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqgILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKkCC0HFASECDI8CCyABIARGBEBB3gEhAgyoAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKkCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0CCyABQQFqIQFBigEhAgyMAgsgAUEBaiEBQY0BIQIMiwILIAFBAWohAUGWASECDIoCCyABQQFqIQFBlwEhAgyJAgsgAUEBaiEBQZgBIQIMiAILIAFBAWohAUGlASECDIcCCyABQQFqIQFBpgEhAgyGAgsgAUEBaiEBQawBIQIMhQILIAFBAWohAUG0ASECDIQCCyABQQFqIQFBtwEhAgyDAgsgAUEBaiEBQb4BIQIMggILIAEgBEYEQEHWASECDJsCCyABLQAAQc4ARw1IIAFBAWohAUG9ASECDIECCyABIARGBEBB1QEhAgyaAgsCQAJAAkAgAS0AAEHCAGsOEgBKSkpKSkpKSkoBSkpKSkpKAkoLIAFBAWohAUG4ASECDIICCyABQQFqIQFBuwEhAgyBAgsgAUEBaiEBQbwBIQIMgAILQdQBIQIgASAERg2YAiADKAIAIgAgBCABa2ohBSABIABrQQdqIQYCQANAIAEtAAAgAEGo1QBqLQAARw1FIABBB0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAgsgA0EANgIAIAZBAWohAUEbDEULIAEgBEYEQEHTASECDJgCCwJAAkAgAS0AAEHJAGsOBwBHR0dHRwFHCyABQQFqIQFBuQEhAgz/AQsgAUEBaiEBQboBIQIM/gELQdIBIQIgASAERg2WAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw1DIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyXAgsgA0EANgIAIAZBAWohAUEPDEMLQdEBIQIgASAERg2VAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw1CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyWAgsgA0EANgIAIAZBAWohAUEgDEILQdABIQIgASAERg2UAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw1BIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyVAgsgA0EANgIAIAZBAWohAUESDEELIAEgBEYEQEHPASECDJQCCwJAAkAgAS0AAEHFAGsODgBDQ0NDQ0NDQ0NDQ0MBQwsgAUEBaiEBQbUBIQIM+wELIAFBAWohAUG2ASECDPoBC0HOASECIAEgBEYNkgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBntUAai0AAEcNPyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkwILIANBADYCACAGQQFqIQFBBww/C0HNASECIAEgBEYNkQIgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBmNUAai0AAEcNPiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkgILIANBADYCACAGQQFqIQFBKAw+CyABIARGBEBBzAEhAgyRAgsCQAJAAkAgAS0AAEHFAGsOEQBBQUFBQUFBQUEBQUFBQUECQQsgAUEBaiEBQbEBIQIM+QELIAFBAWohAUGyASECDPgBCyABQQFqIQFBswEhAgz3AQtBywEhAiABIARGDY8CIAMoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQZHVAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJACCyADQQA2AgAgBkEBaiEBQRoMPAtBygEhAiABIARGDY4CIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQY3VAGotAABHDTsgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADI8CCyADQQA2AgAgBkEBaiEBQSEMOwsgASAERgRAQckBIQIMjgILAkACQCABLQAAQcEAaw4UAD09PT09PT09PT09PT09PT09PQE9CyABQQFqIQFBrQEhAgz1AQsgAUEBaiEBQbABIQIM9AELIAEgBEYEQEHIASECDI0CCwJAAkAgAS0AAEHVAGsOCwA8PDw8PDw8PDwBPAsgAUEBaiEBQa4BIQIM9AELIAFBAWohAUGvASECDPMBC0HHASECIAEgBEYNiwIgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNOCAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjAILIANBADYCACAGQQFqIQFBKgw4CyABIARGBEBBxgEhAgyLAgsgAS0AAEHQAEcNOCABQQFqIQFBJQw3C0HFASECIAEgBEYNiQIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBgdUAai0AAEcNNiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMigILIANBADYCACAGQQFqIQFBDgw2CyABIARGBEBBxAEhAgyJAgsgAS0AAEHFAEcNNiABQQFqIQFBqwEhAgzvAQsgASAERgRAQcMBIQIMiAILAkACQAJAAkAgAS0AAEHCAGsODwABAjk5OTk5OTk5OTk5AzkLIAFBAWohAUGnASECDPEBCyABQQFqIQFBqAEhAgzwAQsgAUEBaiEBQakBIQIM7wELIAFBAWohAUGqASECDO4BC0HCASECIAEgBEYNhgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB/tQAai0AAEcNMyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhwILIANBADYCACAGQQFqIQFBFAwzC0HBASECIAEgBEYNhQIgAygCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABB+dQAai0AAEcNMiAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhgILIANBADYCACAGQQFqIQFBKwwyC0HAASECIAEgBEYNhAIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB9tQAai0AAEcNMSAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhQILIANBADYCACAGQQFqIQFBLAwxC0G/ASECIAEgBEYNgwIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNMCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhAILIANBADYCACAGQQFqIQFBEQwwC0G+ASECIAEgBEYNggIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB8tQAai0AAEcNLyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgwILIANBADYCACAGQQFqIQFBLgwvCyABIARGBEBBvQEhAgyCAgsCQAJAAkACQAJAIAEtAABBwQBrDhUANDQ0NDQ0NDQ0NAE0NAI0NAM0NAQ0CyABQQFqIQFBmwEhAgzsAQsgAUEBaiEBQZwBIQIM6wELIAFBAWohAUGdASECDOoBCyABQQFqIQFBogEhAgzpAQsgAUEBaiEBQaQBIQIM6AELIAEgBEYEQEG8ASECDIECCwJAAkAgAS0AAEHSAGsOAwAwATALIAFBAWohAUGjASECDOgBCyABQQFqIQFBBAwtC0G7ASECIAEgBEYN/wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8NQAai0AAEcNLCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgAILIANBADYCACAGQQFqIQFBHQwsCyABIARGBEBBugEhAgz/AQsCQAJAIAEtAABByQBrDgcBLi4uLi4ALgsgAUEBaiEBQaEBIQIM5gELIAFBAWohAUEiDCsLIAEgBEYEQEG5ASECDP4BCyABLQAAQdAARw0rIAFBAWohAUGgASECDOQBCyABIARGBEBBuAEhAgz9AQsCQAJAIAEtAABBxgBrDgsALCwsLCwsLCwsASwLIAFBAWohAUGeASECDOQBCyABQQFqIQFBnwEhAgzjAQtBtwEhAiABIARGDfsBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQezUAGotAABHDSggAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPwBCyADQQA2AgAgBkEBaiEBQQ0MKAtBtgEhAiABIARGDfoBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQEGuASECDPMBCwJAAkACQAJAIAEtAABBLWsOIwAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAEkJCQkJAIkJCQDJAsgAUEBaiEBQY4BIQIM3AELIAFBAWohAUGPASECDNsBCyABQQFqIQFBlAEhAgzaAQsgAUEBaiEBQZUBIQIM2QELQa0BIQIgASAERg3xASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHX1ABqLQAARw0eIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzyAQsgA0EANgIAIAZBAWohAUELDB4LIAEgBEYEQEGsASECDPEBCwJAAkAgAS0AAEHBAGsOAwAgASALIAFBAWohAUGQASECDNgBCyABQQFqIQFBkwEhAgzXAQsgASAERgRAQasBIQIM8AELAkACQCABLQAAQcEAaw4PAB8fHx8fHx8fHx8fHx8BHwsgAUEBaiEBQZEBIQIM1wELIAFBAWohAUGSASECDNYBCyABIARGBEBBqgEhAgzvAQsgAS0AAEHMAEcNHCABQQFqIQFBCgwbC0GpASECIAEgBEYN7QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABB0dQAai0AAEcNGiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7gELIANBADYCACAGQQFqIQFBHgwaC0GoASECIAEgBEYN7AEgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBytQAai0AAEcNGSAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7QELIANBADYCACAGQQFqIQFBFQwZC0GnASECIAEgBEYN6wEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBx9QAai0AAEcNGCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7AELIANBADYCACAGQQFqIQFBFwwYC0GmASECIAEgBEYN6gEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBwdQAai0AAEcNFyAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6wELIANBADYCACAGQQFqIQFBGAwXCyABIARGBEBBpQEhAgzqAQsCQAJAIAEtAABByQBrDgcAGRkZGRkBGQsgAUEBaiEBQYsBIQIM0QELIAFBAWohAUGMASECDNABC0GkASECIAEgBEYN6AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBptUAai0AAEcNFSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6QELIANBADYCACAGQQFqIQFBCQwVC0GjASECIAEgBEYN5wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBpNUAai0AAEcNFCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6AELIANBADYCACAGQQFqIQFBHwwUC0GiASECIAEgBEYN5gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBvtQAai0AAEcNEyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5wELIANBADYCACAGQQFqIQFBAgwTC0GhASECIAEgBEYN5QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGA0AgAS0AACAAQbzUAGotAABHDREgAEEBRg0CIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADOUBCyABIARGBEBBoAEhAgzlAQtBASABLQAAQd8ARw0RGiABQQFqIQFBhwEhAgzLAQsgA0EANgIAIAZBAWohAUGIASECDMoBC0GfASECIAEgBEYN4gEgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNDyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4wELIANBADYCACAGQQFqIQFBKQwPC0GeASECIAEgBEYN4QEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBuNQAai0AAEcNDiAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4gELIANBADYCACAGQQFqIQFBLQwOCyABIARGBEBBnQEhAgzhAQsgAS0AAEHFAEcNDiABQQFqIQFBhAEhAgzHAQsgASAERgRAQZwBIQIM4AELAkACQCABLQAAQcwAaw4IAA8PDw8PDwEPCyABQQFqIQFBggEhAgzHAQsgAUEBaiEBQYMBIQIMxgELQZsBIQIgASAERg3eASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEGz1ABqLQAARw0LIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzfAQsgA0EANgIAIAZBAWohAUEjDAsLQZoBIQIgASAERg3dASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGw1ABqLQAARw0KIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzeAQsgA0EANgIAIAZBAWohAUEADAoLIAEgBEYEQEGZASECDN0BCwJAAkAgAS0AAEHIAGsOCAAMDAwMDAwBDAsgAUEBaiEBQf0AIQIMxAELIAFBAWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC0GKASECDMUBCwJAIAEgBEcEQANAIAEtAABBoNAAai0AACIAQQNHBEACQCAAQQFrDgJJAAQLQfAAIQIMrwELIAQgAUEBaiIBRw0AC0GIASECDMYBC0GIASECDMUBCyADQQA2AhwgAyABNgIUIANB2yA2AhAgA0EHNgIMQQAhAgzEAQsgASAERgRAQYkBIQIMxAELAkACQAJAIAEtAABBoNIAai0AAEEBaw4DRgIAAQtB8gAhAgysAQsgA0EANgIcIAMgATYCFCADQbQSNgIQIANBBzYCDEEAIQIMxAELQeoAIQIMqgELIAEgBEcEQCABQQFqIQFB7wAhAgyqAQtBhwEhAgzCAQsgBCABIgBGBEBBhgEhAgzCAQsgAC0AACIBQS9GBEAgAEEBaiEBQe4AIQIMqQELIAFBCWsiAkEXSw0BIAAhAUEBIAJ0QZuAgARxDUEMAQsgBCABIgBGBEBBhQEhAgzBAQsgAC0AAEEvRw0AIABBAWohAQwDC0EAIQIgA0EANgIcIAMgADYCFCADQdsgNgIQIANBBzYCDAy/AQsCQAJAAkACQAJAA0AgAS0AAEGgzgBqLQAAIgBBBUcEQAJAAkAgAEEBaw4IRwUGBwgABAEIC0HrACECDK0BCyABQQFqIQFB7QAhAgysAQsgBCABQQFqIgFHDQALQYQBIQIMwwELIAFBAWoMFAsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgzBAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgzAAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy/AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMvgELIAEgBEYEQEGDASECDL4BCwJAIAEtAABBoM4Aai0AAEEBaw4IPgQFBgAIAgMHCyABQQFqIQELQQMhAgyjAQsgAUEBagwNC0EAIQIgA0EANgIcIANB0RI2AhAgA0EHNgIMIAMgAUEBajYCFAy6AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgy5AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgy4AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy3AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMtgELQewAIQIMnAELIAEgBEYEQEGCASECDLUBCyABQQFqDAILIAEgBEYEQEGBASECDLQBCyABQQFqDAELIAEgBEYNASABQQFqCyEBQQQhAgyYAQtBgAEhAgywAQsDQCABLQAAQaDMAGotAAAiAEECRwRAIABBAUcEQEHpACECDJkBCwwxCyAEIAFBAWoiAUcNAAtB/wAhAgyvAQsgASAERgRAQf4AIQIMrwELAkAgAS0AAEEJaw43LwMGLwQGBgYGBgYGBgYGBgYGBgYGBgYFBgYCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0HnACECDIcBCyABIARGBEBB+gAhAgygAQsCQCABLQAAQQlrDgQgAAAgAAsgAUEBaiEBQeYAIQIMhgELIAEgBEYEQEH5ACECDJ8BCwJAIAEtAABBCWsOBB8AAB8AC0EAIQACQCADKAI4IgJFDQAgAigCOCICRQ0AIAMgAhEAACEACyAARQRAQeIBIQIMhgELIABBFUcEQCADQQA2AhwgAyABNgIUIANByQ02AhAgA0EaNgIMQQAhAgyfAQsgA0H4ADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDJ4BCyABIARHBEAgA0ENNgIIIAMgATYCBEHkACECDIUBC0H3ACECDJ0BCyABIARGBEBB9gAhAgydAQsCQAJAAkAgAS0AAEHIAGsOCwABCwsLCwsLCwsCCwsgAUEBaiEBQd0AIQIMhQELIAFBAWohAUHgACECDIQBCyABQQFqIQFB4wAhAgyDAQtB9QAhAiABIARGDZsBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUNWSAAQRVHDQEgA0EFNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMfAtBywAhAgxiC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAx6CyADIAMvATJBgAFyOwEyDDsLIAEgBEcEQCADQRE2AgggAyABNgIEQcoAIQIMYAtB1wAhAgx4CyABIARGBEBB1gAhAgx4CwJAAkACQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQeMAaw4TAEBAQEBAQEBAQEBAQAFAQEACA0ALIAFBAWohAUHGACECDGELIAFBAWohAUHHACECDGALIAFBAWohAUHIACECDF8LIAFBAWohAUHJACECDF4LQdUAIQIgBCABIgBGDXYgBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0IQQQgAUEFRg0KGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx2C0HUACECIAQgASIARg11IAQgAWsgAygCACIBaiEGIAAgAWtBD2ohBwNAIAFBgMgAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNB0EDIAFBD0YNCRogAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdQtB0wAhAiAEIAEiAEYNdCAEIAFrIAMoAgAiAWohBiAAIAFrQQ5qIQcDQCABQeLHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQYgAUEORg0HIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHQLQdIAIQIgBCABIgBGDXMgBCABayADKAIAIgFqIQUgACABa0EBaiEGA0AgAUHgxwBqLQAAIAAtAAAiB0EgciAHIAdBwQBrQf8BcUEaSRtB/wFxRw0FIAFBAUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBTYCAAxzCyABIARGBEBB0QAhAgxzCwJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB7gBrDgcAOTk5OTkBOQsgAUEBaiEBQcMAIQIMWgsgAUEBaiEBQcQAIQIMWQsgA0EANgIAIAZBAWohAUHFACECDFgLQdAAIQIgBCABIgBGDXAgBCABayADKAIAIgFqIQYgACABa0EJaiEHA0AgAUHWxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0CQQIgAUEJRg0EGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxwC0HPACECIAQgASIARg1vIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwNAIAFB0McAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQVGDQIgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMbwsgACEBIANBADYCAAwzC0EBCzoALCADQQA2AgAgB0EBaiEBC0EtIQIMUgsCQANAIAEtAABB0MUAai0AAEEBRw0BIAQgAUEBaiIBRw0AC0HNACECDGsLQcIAIQIMUQsgASAERgRAQcwAIQIMagsgAS0AAEE6RgRAIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0zIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMagsgA0EANgIcIAMgATYCFCADQecRNgIQIANBCjYCDEEAIQIMaQsCQAJAIAMtACxBAmsOAgABJwsgA0Ezai0AAEECcUUNJiADLQAuQQJxDSYgA0EANgIcIAMgATYCFCADQaYUNgIQIANBCzYCDEEAIQIMaQsgAy0AMkEgcUUNJSADLQAuQQJxDSUgA0EANgIcIAMgATYCFCADQb0TNgIQIANBDzYCDEEAIQIMaAtBACEAAkAgAygCOCICRQ0AIAIoAkgiAkUNACADIAIRAAAhAAsgAEUEQEHBACECDE8LIABBFUcEQCADQQA2AhwgAyABNgIUIANBpg82AhAgA0EcNgIMQQAhAgxoCyADQcoANgIcIAMgATYCFCADQYUcNgIQIANBFTYCDEEAIQIMZwsgASAERwRAA0AgAS0AAEHAwQBqLQAAQQFHDRcgBCABQQFqIgFHDQALQcQAIQIMZwtBxAAhAgxmCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUE2IQIMUgsgAUEBaiEBQTchAgxRCyABQQFqIQFBOCECDFALDBULIAQgAUEBaiIBRw0AC0E8IQIMZgtBPCECDGULIAEgBEYEQEHIACECDGULIANBEjYCCCADIAE2AgQCQAJAAkACQAJAIAMtACxBAWsOBBQAAQIJCyADLQAyQSBxDQNB4AEhAgxPCwJAIAMvATIiAEEIcUUNACADLQAoQQFHDQAgAy0ALkEIcUUNAgsgAyAAQff7A3FBgARyOwEyDAsLIAMgAy8BMkEQcjsBMgwECyADQQA2AgQgAyABIAEQMSIABEAgA0HBADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxmCyABQQFqIQEMWAsgA0EANgIcIAMgATYCFCADQfQTNgIQIANBBDYCDEEAIQIMZAtBxwAhAiABIARGDWMgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCAAQcDFAGotAAAgAS0AAEEgckcNASAAQQZGDUogAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMZAsgA0EANgIADAULAkAgASAERwRAA0AgAS0AAEHAwwBqLQAAIgBBAUcEQCAAQQJHDQMgAUEBaiEBDAULIAQgAUEBaiIBRw0AC0HFACECDGQLQcUAIQIMYwsLIANBADoALAwBC0ELIQIMRwtBPyECDEYLAkACQANAIAEtAAAiAEEgRwRAAkAgAEEKaw4EAwUFAwALIABBLEYNAwwECyAEIAFBAWoiAUcNAAtBxgAhAgxgCyADQQg6ACwMDgsgAy0AKEEBRw0CIAMtAC5BCHENAiADKAIEIQAgA0EANgIEIAMgACABEDEiAARAIANBwgA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMXwsgAUEBaiEBDFALQTshAgxECwJAA0AgAS0AACIAQSBHIABBCUdxDQEgBCABQQFqIgFHDQALQcMAIQIMXQsLQTwhAgxCCwJAAkAgASAERwRAA0AgAS0AACIAQSBHBEAgAEEKaw4EAwQEAwQLIAQgAUEBaiIBRw0AC0E/IQIMXQtBPyECDFwLIAMgAy8BMkEgcjsBMgwKCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNTiADQT42AhwgAyABNgIUIAMgADYCDEEAIQIMWgsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkYNAwwMCyAEIAFBAWoiAUcNAAtBNyECDFsLQTchAgxaCyABQQFqIQEMBAtBOyECIAQgASIARg1YIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwJAA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEMPwsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMWQsgA0EANgIAIAAhAQwFC0E6IQIgBCABIgBGDVcgBCABayADKAIAIgFqIQYgACABa0EIaiEHAkADQCABQbTBAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEIRgRAQQUhAQw+CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxYCyADQQA2AgAgACEBDAQLQTkhAiAEIAEiAEYNViAEIAFrIAMoAgAiAWohBiAAIAFrQQNqIQcCQANAIAFBsMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQNGBEBBBiEBDD0LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFcLIANBADYCACAAIQEMAwsCQANAIAEtAAAiAEEgRwRAIABBCmsOBAcEBAcCCyAEIAFBAWoiAUcNAAtBOCECDFYLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCADLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIANBAToALCADIAMvATIgAXI7ATIgACEBDAELIAMgAy8BMkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgtBLyECDCsLIANBADYCHCADIAE2AhQgA0GEEzYCECADQQs2AgxBACECDEMLQeEBIQIMKQsgASAERgRAQS4hAgxCCyADQQA2AgQgA0ESNgIIIAMgASABEDEiAA0BC0EuIQIMJwsgA0EtNgIcIAMgATYCFCADIAA2AgxBACECDD8LQQAhAAJAIAMoAjgiAkUNACACKAJMIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2AA2AhwgAyABNgIUIANBsxs2AhAgA0EVNgIMQQAhAgw+C0HMACECDCQLIANBADYCHCADIAE2AhQgA0GzDjYCECADQR02AgxBACECDDwLIAEgBEYEQEHOACECDDwLIAEtAAAiAEEgRg0CIABBOkYNAQsgA0EAOgAsQQkhAgwhCyADKAIEIQAgA0EANgIEIAMgACABEDAiAA0BDAILIAMtAC5BAXEEQEHeASECDCALIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0CIANBKjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgw4CyADQcsANgIcIAMgADYCDCADIAFBAWo2AhRBACECDDcLIAFBAWohAUHAACECDB0LIAFBAWohAQwsCyABIARGBEBBKyECDDULAkAgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQcAAcUUNBgsgAy0AMkGAAXEEQEEAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ0SIABBFUYEQCADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgw2CyADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMQQAhAgw1CyADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyADQQE6ADALIAIgAi8BAEHAAHI7AQALQSshAgwYCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgwwCyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgwvCyADQQA2AhwgAyABNgIUIANBpQs2AhAgA0ECNgIMQQAhAgwuC0EBIQcgAy8BMiIFQQhxRQRAIAMpAyBCAFIhBwsCQCADLQAwBEBBASEAIAMtAClBBUYNASAFQcAAcUUgB3FFDQELAkAgAy0AKCICQQJGBEBBASEAIAMvATQiBkHlAEYNAkEAIQAgBUHAAHENAiAGQeQARg0CIAZB5gBrQQJJDQIgBkHMAUYNAiAGQbACRg0CDAELQQAhACAFQcAAcQ0BC0ECIQAgBUEIcQ0AIAVBgARxBEACQCACQQFHDQAgAy0ALkEKcQ0AQQUhAAwCC0EEIQAMAQsgBUEgcUUEQCADEDZBAEdBAnQhAAwBC0EAQQMgAykDIFAbIQALIABBAWsOBQIABwEDBAtBESECDBMLIANBAToAMQwpC0EAIQICQCADKAI4IgBFDQAgACgCMCIARQ0AIAMgABEAACECCyACRQ0mIAJBFUYEQCADQQM2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwrC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAwqCyADQQA2AhwgAyABNgIUIANB+SA2AhAgA0EPNgIMQQAhAgwpC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAADQELQQ4hAgwOCyAAQRVGBEAgA0ECNgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMJwsgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDEEAIQIMJgtBKiECDAwLIAEgBEcEQCADQQk2AgggAyABNgIEQSkhAgwMC0EmIQIMJAsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFQEQEElIQIMJAsgAygCBCEAIANBADYCBCADIAAgASAMp2oiARAyIgBFDQAgA0EFNgIcIAMgATYCFCADIAA2AgxBACECDCMLQQ8hAgwJC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FxYAAQIDBAUGBxQUFBQUFBQICQoLDA0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFA4PEBESExQLQgIhCgwWC0IDIQoMFQtCBCEKDBQLQgUhCgwTC0IGIQoMEgtCByEKDBELQgghCgwQC0IJIQoMDwtCCiEKDA4LQgshCgwNC0IMIQoMDAtCDSEKDAsLQg4hCgwKC0IPIQoMCQtCCiEKDAgLQgshCgwHC0IMIQoMBgtCDSEKDAULQg4hCgwEC0IPIQoMAwsgA0EANgIcIAMgATYCFCADQZ8VNgIQIANBDDYCDEEAIQIMIQsgASAERgRAQSIhAgwhC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsONxUUAAECAwQFBgcWFhYWFhYWCAkKCwwNFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYODxAREhMWC0ICIQoMFAtCAyEKDBMLQgQhCgwSC0IFIQoMEQtCBiEKDBALQgchCgwPC0IIIQoMDgtCCSEKDA0LQgohCgwMC0ILIQoMCwtCDCEKDAoLQg0hCgwJC0IOIQoMCAtCDyEKDAcLQgohCgwGC0ILIQoMBQtCDCEKDAQLQg0hCgwDC0IOIQoMAgtCDyEKDAELQgEhCgsgAUEBaiEBIAMpAyAiC0L//////////w9YBEAgAyALQgSGIAqENwMgDAILIANBADYCHCADIAE2AhQgA0G1CTYCECADQQw2AgxBACECDB4LQSchAgwEC0EoIQIMAwsgAyABOgAsIANBADYCACAHQQFqIQFBDCECDAILIANBADYCACAGQQFqIQFBCiECDAELIAFBAWohAUEIIQIMAAsAC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwXC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwWC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwVC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwUC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwTC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwSC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwRC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwQC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwPC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwOC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwNC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwMC0EAIQIgA0EANgIcIAMgATYCFCADQZkTNgIQIANBCzYCDAwLC0EAIQIgA0EANgIcIAMgATYCFCADQZ0JNgIQIANBCzYCDAwKC0EAIQIgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDAwJC0EAIQIgA0EANgIcIAMgATYCFCADQbEQNgIQIANBCjYCDAwIC0EAIQIgA0EANgIcIAMgATYCFCADQbsdNgIQIANBAjYCDAwHC0EAIQIgA0EANgIcIAMgATYCFCADQZYWNgIQIANBAjYCDAwGC0EAIQIgA0EANgIcIAMgATYCFCADQfkYNgIQIANBAjYCDAwFC0EAIQIgA0EANgIcIAMgATYCFCADQcQYNgIQIANBAjYCDAwECyADQQI2AhwgAyABNgIUIANBqR42AhAgA0EWNgIMQQAhAgwDC0HeACECIAEgBEYNAiAJQQhqIQcgAygCACEFAkACQCABIARHBEAgBUGWyABqIQggBCAFaiABayEGIAVBf3NBCmoiBSABaiEAA0AgAS0AACAILQAARwRAQQIhCAwDCyAFRQRAQQAhCCAAIQEMAwsgBUEBayEFIAhBAWohCCAEIAFBAWoiAUcNAAsgBiEFIAQhAQsgB0EBNgIAIAMgBTYCAAwBCyADQQA2AgAgByAINgIACyAHIAE2AgQgCSgCDCEAAkACQCAJKAIIQQFrDgIEAQALIANBADYCHCADQcIeNgIQIANBFzYCDCADIABBAWo2AhRBACECDAMLIANBADYCHCADIAA2AhQgA0HXHjYCECADQQk2AgxBACECDAILIAEgBEYEQEEoIQIMAgsgA0EJNgIIIAMgATYCBEEnIQIMAQsgASAERgRAQQEhAgwBCwNAAkACQAJAIAEtAABBCmsOBAABAQABCyABQQFqIQEMAQsgAUEBaiEBIAMtAC5BIHENAEEAIQIgA0EANgIcIAMgATYCFCADQaEhNgIQIANBBTYCDAwCC0EBIQIgASAERw0ACwsgCUEQaiQAIAJFBEAgAygCDCEADAELIAMgAjYCHEEAIQAgAygCBCIBRQ0AIAMgASAEIAMoAggRAQAiAUUNACADIAQ2AhQgAyABNgIMIAEhAAsgAAu+AgECfyAAQQA6AAAgAEHkAGoiAUEBa0EAOgAAIABBADoAAiAAQQA6AAEgAUEDa0EAOgAAIAFBAmtBADoAACAAQQA6AAMgAUEEa0EAOgAAQQAgAGtBA3EiASAAaiIAQQA2AgBB5AAgAWtBfHEiAiAAaiIBQQRrQQA2AgACQCACQQlJDQAgAEEANgIIIABBADYCBCABQQhrQQA2AgAgAUEMa0EANgIAIAJBGUkNACAAQQA2AhggAEEANgIUIABBADYCECAAQQA2AgwgAUEQa0EANgIAIAFBFGtBADYCACABQRhrQQA2AgAgAUEca0EANgIAIAIgAEEEcUEYciICayIBQSBJDQAgACACaiEAA0AgAEIANwMYIABCADcDECAAQgA3AwggAEIANwMAIABBIGohACABQSBrIgFBH0sNAAsLC1YBAX8CQCAAKAIMDQACQAJAAkACQCAALQAxDgMBAAMCCyAAKAI4IgFFDQAgASgCMCIBRQ0AIAAgAREAACIBDQMLQQAPCwALIABByhk2AhBBDiEBCyABCxoAIAAoAgxFBEAgAEHeHzYCECAAQRU2AgwLCxQAIAAoAgxBFUYEQCAAQQA2AgwLCxQAIAAoAgxBFkYEQCAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsrAAJAIABBJ08NAEL//////wkgAK2IQgGDUA0AIABBAnRB0DhqKAIADwsACxcAIABBL08EQAALIABBAnRB7DlqKAIAC78JAQF/QfQtIQECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQeQAaw70A2NiAAFhYWFhYWECAwQFYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQYHCAkKCwwNDg9hYWFhYRBhYWFhYWFhYWFhYRFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWESExQVFhcYGRobYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1NmE3ODk6YWFhYWFhYWE7YWFhPGFhYWE9Pj9hYWFhYWFhYUBhYUFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFCQ0RFRkdISUpLTE1OT1BRUlNhYWFhYWFhYVRVVldYWVpbYVxdYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhXmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYV9gYQtB6iwPC0GYJg8LQe0xDwtBoDcPC0HJKQ8LQbQpDwtBli0PC0HrKw8LQaI1DwtB2zQPC0HgKQ8LQeMkDwtB1SQPC0HuJA8LQeYlDwtByjQPC0HQNw8LQao1DwtB9SwPC0H2Jg8LQYIiDwtB8jMPC0G+KA8LQec3DwtBzSEPC0HAIQ8LQbglDwtByyUPC0GWJA8LQY80DwtBzTUPC0HdKg8LQe4zDwtBnDQPC0GeMQ8LQfQ1DwtB5SIPC0GvJQ8LQZkxDwtBsjYPC0H5Ng8LQcQyDwtB3SwPC0GCMQ8LQcExDwtBjTcPC0HJJA8LQew2DwtB5yoPC0HIIw8LQeIhDwtByTcPC0GlIg8LQZQiDwtB2zYPC0HeNQ8LQYYmDwtBvCsPC0GLMg8LQaAjDwtB9jAPC0GALA8LQYkrDwtBpCYPC0HyIw8LQYEoDwtBqzIPC0HrJw8LQcI2DwtBoiQPC0HPKg8LQdwjDwtBhycPC0HkNA8LQbciDwtBrTEPC0HVIg8LQa80DwtB3iYPC0HWMg8LQfQ0DwtBgTgPC0H0Nw8LQZI2DwtBnScPC0GCKQ8LQY0jDwtB1zEPC0G9NQ8LQbQ3DwtB2DAPC0G2Jw8LQZo4DwtBpyoPC0HEJw8LQa4jDwtB9SIPCwALQcomIQELIAELFwAgACAALwEuQf7/A3EgAUEAR3I7AS4LGgAgACAALwEuQf3/A3EgAUEAR0EBdHI7AS4LGgAgACAALwEuQfv/A3EgAUEAR0ECdHI7AS4LGgAgACAALwEuQff/A3EgAUEAR0EDdHI7AS4LGgAgACAALwEuQe//A3EgAUEAR0EEdHI7AS4LGgAgACAALwEuQd//A3EgAUEAR0EFdHI7AS4LGgAgACAALwEuQb//A3EgAUEAR0EGdHI7AS4LGgAgACAALwEuQf/+A3EgAUEAR0EHdHI7AS4LGgAgACAALwEuQf/9A3EgAUEAR0EIdHI7AS4LGgAgACAALwEuQf/7A3EgAUEAR0EJdHI7AS4LPgECfwJAIAAoAjgiA0UNACADKAIEIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHhEjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIIIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH8ETYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIMIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHsCjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIQIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH6HjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIUIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHLEDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIYIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG3HzYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIcIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG/FTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIsIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH+CDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIgIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEGMHTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIkIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHmFTYCEEEYIQQLIAQLOAAgAAJ/IAAvATJBFHFBFEYEQEEBIAAtAChBAUYNARogAC8BNEHlAEYMAQsgAC0AKUEFRgs6ADALWQECfwJAIAAtAChBAUYNACAALwE0IgFB5ABrQeQASQ0AIAFBzAFGDQAgAUGwAkYNACAALwEyIgBBwABxDQBBASECIABBiARxQYAERg0AIABBKHFFIQILIAILjAEBAn8CQAJAAkAgAC0AKkUNACAALQArRQ0AIAAvATIiAUECcUUNAQwCCyAALwEyIgFBAXFFDQELQQEhAiAALQAoQQFGDQAgAC8BNCIAQeQAa0HkAEkNACAAQcwBRg0AIABBsAJGDQAgAUHAAHENAEEAIQIgAUGIBHFBgARGDQAgAUEocUEARyECCyACC1cAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",Kft;Object.defineProperty(B6n,"exports",{get:()=>Kft||(Kft=IXi.from(wXi,"base64"))})});var D6n=re((rPc,N6n)=>{"use strict";p();var{Buffer:TXi}=require("node:buffer"),vXi="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCuzaAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAxMvIB8QEzNPAB7wE1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk/6AVBRUlPuAe0BVOwBVesBVldYWVrqAVtcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAekB6AHPAecB0AHmAdEB0gHTAdQB5QHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wEA/AELQQAM4wELQQ4M4gELQQ0M4QELQQ8M4AELQRAM3wELQRMM3gELQRQM3QELQRUM3AELQRYM2wELQRcM2gELQRgM2QELQRkM2AELQRoM1wELQRsM1gELQRwM1QELQR0M1AELQR4M0wELQR8M0gELQSAM0QELQSEM0AELQQgMzwELQSIMzgELQSQMzQELQSMMzAELQQcMywELQSUMygELQSYMyQELQScMyAELQSgMxwELQRIMxgELQREMxQELQSkMxAELQSoMwwELQSsMwgELQSwMwQELQd4BDMABC0EuDL8BC0EvDL4BC0EwDL0BC0ExDLwBC0EyDLsBC0EzDLoBC0E0DLkBC0HfAQy4AQtBNQy3AQtBOQy2AQtBDAy1AQtBNgy0AQtBNwyzAQtBOAyyAQtBPgyxAQtBOgywAQtB4AEMrwELQQsMrgELQT8MrQELQTsMrAELQQoMqwELQTwMqgELQT0MqQELQeEBDKgBC0HBAAynAQtBwAAMpgELQcIADKUBC0EJDKQBC0EtDKMBC0HDAAyiAQtBxAAMoQELQcUADKABC0HGAAyfAQtBxwAMngELQcgADJ0BC0HJAAycAQtBygAMmwELQcsADJoBC0HMAAyZAQtBzQAMmAELQc4ADJcBC0HPAAyWAQtB0AAMlQELQdEADJQBC0HSAAyTAQtB0wAMkgELQdUADJEBC0HUAAyQAQtB1gAMjwELQdcADI4BC0HYAAyNAQtB2QAMjAELQdoADIsBC0HbAAyKAQtB3AAMiQELQd0ADIgBC0HeAAyHAQtB3wAMhgELQeAADIUBC0HhAAyEAQtB4gAMgwELQeMADIIBC0HkAAyBAQtB5QAMgAELQeIBDH8LQeYADH4LQecADH0LQQYMfAtB6AAMewtBBQx6C0HpAAx5C0EEDHgLQeoADHcLQesADHYLQewADHULQe0ADHQLQQMMcwtB7gAMcgtB7wAMcQtB8AAMcAtB8gAMbwtB8QAMbgtB8wAMbQtB9AAMbAtB9QAMawtB9gAMagtBAgxpC0H3AAxoC0H4AAxnC0H5AAxmC0H6AAxlC0H7AAxkC0H8AAxjC0H9AAxiC0H+AAxhC0H/AAxgC0GAAQxfC0GBAQxeC0GCAQxdC0GDAQxcC0GEAQxbC0GFAQxaC0GGAQxZC0GHAQxYC0GIAQxXC0GJAQxWC0GKAQxVC0GLAQxUC0GMAQxTC0GNAQxSC0GOAQxRC0GPAQxQC0GQAQxPC0GRAQxOC0GSAQxNC0GTAQxMC0GUAQxLC0GVAQxKC0GWAQxJC0GXAQxIC0GYAQxHC0GZAQxGC0GaAQxFC0GbAQxEC0GcAQxDC0GdAQxCC0GeAQxBC0GfAQxAC0GgAQw/C0GhAQw+C0GiAQw9C0GjAQw8C0GkAQw7C0GlAQw6C0GmAQw5C0GnAQw4C0GoAQw3C0GpAQw2C0GqAQw1C0GrAQw0C0GsAQwzC0GtAQwyC0GuAQwxC0GvAQwwC0GwAQwvC0GxAQwuC0GyAQwtC0GzAQwsC0G0AQwrC0G1AQwqC0G2AQwpC0G3AQwoC0G4AQwnC0G5AQwmC0G6AQwlC0G7AQwkC0G8AQwjC0G9AQwiC0G+AQwhC0G/AQwgC0HAAQwfC0HBAQweC0HCAQwdC0EBDBwLQcMBDBsLQcQBDBoLQcUBDBkLQcYBDBgLQccBDBcLQcgBDBYLQckBDBULQcoBDBQLQcsBDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISMkJScoKZ4DmwOaA5EDigODA4AD/QL7AvgC8gLxAu8C7QLoAucC5gLlAuQC3ALbAtoC2QLYAtcC1gLVAs8CzgLMAssCygLJAsgCxwLGAsQCwwK+ArwCugK5ArgCtwK2ArUCtAKzArICsQKwAq4CrQKpAqgCpwKmAqUCpAKjAqICoQKgAp8CmAKQAowCiwKKAoEC/gH9AfwB+wH6AfkB+AH3AfUB8wHwAesB6QHoAecB5gHlAeQB4wHiAeEB4AHfAd4B3QHcAdoB2QHYAdcB1gHVAdQB0wHSAdEB0AHPAc4BzQHMAcsBygHJAcgBxwHGAcUBxAHDAcIBwQHAAb8BvgG9AbwBuwG6AbkBuAG3AbYBtQG0AbMBsgGxAbABrwGuAa0BrAGrAaoBqQGoAacBpgGlAaQBowGiAZ8BngGZAZgBlwGWAZUBlAGTAZIBkQGQAY8BjQGMAYcBhgGFAYQBgwGCAX18e3p5dnV0UFFSU1RVCyABIARHDXJB/QEhAgy+AwsgASAERw2YAUHbASECDL0DCyABIARHDfEBQY4BIQIMvAMLIAEgBEcN/AFBhAEhAgy7AwsgASAERw2KAkH/ACECDLoDCyABIARHDZECQf0AIQIMuQMLIAEgBEcNlAJB+wAhAgy4AwsgASAERw0eQR4hAgy3AwsgASAERw0ZQRghAgy2AwsgASAERw3KAkHNACECDLUDCyABIARHDdUCQcYAIQIMtAMLIAEgBEcN1gJBwwAhAgyzAwsgASAERw3cAkE4IQIMsgMLIAMtADBBAUYNrQMMiQMLQQAhAAJAAkACQCADLQAqRQ0AIAMtACtFDQAgAy8BMiICQQJxRQ0BDAILIAMvATIiAkEBcUUNAQtBASEAIAMtAChBAUYNACADLwE0IgZB5ABrQeQASQ0AIAZBzAFGDQAgBkGwAkYNACACQcAAcQ0AQQAhACACQYgEcUGABEYNACACQShxQQBHIQALIANBADsBMiADQQA6ADECQCAARQRAIANBADoAMSADLQAuQQRxDQEMsQMLIANCADcDIAsgA0EAOgAxIANBAToANgxIC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAARQ1IIABBFUcNYiADQQQ2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgyvAwsgASAERgRAQQYhAgyvAwsgAS0AAEEKRw0ZIAFBAWohAQwaCyADQgA3AyBBEiECDJQDCyABIARHDYoDQSMhAgysAwsgASAERgRAQQchAgysAwsCQAJAIAEtAABBCmsOBAEYGAAYCyABQQFqIQFBECECDJMDCyABQQFqIQEgA0Evai0AAEEBcQ0XQQAhAiADQQA2AhwgAyABNgIUIANBmSA2AhAgA0EZNgIMDKsDCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMWg0YQQghAgyqAwsgASAERwRAIANBCTYCCCADIAE2AgRBFCECDJEDC0EJIQIMqQMLIAMpAyBQDa4CDEMLIAEgBEYEQEELIQIMqAMLIAEtAABBCkcNFiABQQFqIQEMFwsgA0Evai0AAEEBcUUNGQwmC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRkMQgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0aDCQLQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGwwyCyADQS9qLQAAQQFxRQ0cDCILQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANHAxCC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADR0MIAsgASAERgRAQRMhAgygAwsCQCABLQAAIgBBCmsOBB8jIwAiCyABQQFqIQEMHwtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0iDEILIAEgBEYEQEEWIQIMngMLIAEtAABBwMEAai0AAEEBRw0jDIMDCwJAA0AgAS0AAEGwO2otAAAiAEEBRwRAAkAgAEECaw4CAwAnCyABQQFqIQFBISECDIYDCyAEIAFBAWoiAUcNAAtBGCECDJ0DCyADKAIEIQBBACECIANBADYCBCADIAAgAUEBaiIBEDQiAA0hDEELQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIwwqCyABIARGBEBBHCECDJsDCyADQQo2AgggAyABNgIEQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANJUEkIQIMgQMLIAEgBEcEQANAIAEtAABBsD1qLQAAIgBBA0cEQCAAQQFrDgUYGiaCAyUmCyAEIAFBAWoiAUcNAAtBGyECDJoDC0EbIQIMmQMLA0AgAS0AAEGwP2otAAAiAEEDRwRAIABBAWsOBQ8RJxMmJwsgBCABQQFqIgFHDQALQR4hAgyYAwsgASAERwRAIANBCzYCCCADIAE2AgRBByECDP8CC0EfIQIMlwMLIAEgBEYEQEEgIQIMlwMLAkAgAS0AAEENaw4ULj8/Pz8/Pz8/Pz8/Pz8/Pz8/PwA/C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAyWAwsgA0EvaiECA0AgASAERgRAQSEhAgyXAwsCQAJAAkAgAS0AACIAQQlrDhgCACkpASkpKSkpKSkpKSkpKSkpKSkpKQInCyABQQFqIQEgA0Evai0AAEEBcUUNCgwYCyABQQFqIQEMFwsgAUEBaiEBIAItAABBAnENAAtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwMlQMLIAMtAC5BgAFxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ3mAiAAQRVGBEAgA0EkNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMlAMLQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDJMDC0EAIQIgA0EANgIcIAMgATYCFCADQb4gNgIQIANBAjYCDAySAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEgDKdqIgEQMiIARQ0rIANBBzYCHCADIAE2AhQgAyAANgIMDJEDCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlgiAkUNACADIAIRAAAhAAsgAEUNKyAAQRVGBEAgA0EKNgIcIAMgATYCFCADQesZNgIQIANBFTYCDEEAIQIMkAMLQQAhAiADQQA2AhwgAyABNgIUIANBkww2AhAgA0ETNgIMDI8DC0EAIQIgA0EANgIcIAMgATYCFCADQYIVNgIQIANBAjYCDAyOAwtBACECIANBADYCHCADIAE2AhQgA0HdFDYCECADQRk2AgwMjQMLQQAhAiADQQA2AhwgAyABNgIUIANB5h02AhAgA0EZNgIMDIwDCyAAQRVGDT1BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMiwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUNKCADQQ02AhwgAyABNgIUIAMgADYCDAyKAwsgAEEVRg06QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIkDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCgLIANBDjYCHCADIAA2AgwgAyABQQFqNgIUDIgDCyAAQRVGDTdBACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMhwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUEQCABQQFqIQEMJwsgA0EPNgIcIAMgADYCDCADIAFBAWo2AhQMhgMLQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDIUDCyAAQRVGDTNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwMhAMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUNJSADQRE2AhwgAyABNgIUIAMgADYCDAyDAwsgAEEVRg0wQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIIDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNACCyADQSA2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzPAgsgA0ELNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzgILIANBDDYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM0CC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAzMAgsCQANAAkAgAS0AAEEKaw4EAAICAAILIAQgAUEBaiIBRw0AC0H9ASECDMwCCwJAAkAgAy0ANkEBRw0AQQAhAAJAIAMoAjgiAkUNACACKAJgIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB/AE2AhwgAyABNgIUIANB3Bk2AhAgA0EVNgIMQQAhAgzNAgtB3AEhAgyzAgsgA0EANgIcIAMgATYCFCADQfkLNgIQIANBHzYCDEEAIQIMywILAkACQCADLQAoQQFrDgIEAQALQdsBIQIMsgILQdQBIQIMsQILIANBAjoAMUEAIQACQCADKAI4IgJFDQAgAigCACICRQ0AIAMgAhEAACEACyAARQRAQd0BIQIMsQILIABBFUcEQCADQQA2AhwgAyABNgIUIANBtAw2AhAgA0EQNgIMQQAhAgzKAgsgA0H7ATYCHCADIAE2AhQgA0GBGjYCECADQRU2AgxBACECDMkCCyABIARGBEBB+gEhAgzJAgsgAS0AAEHIAEYNASADQQE6ACgLQcABIQIMrgILQdoBIQIMrQILIAEgBEcEQCADQQw2AgggAyABNgIEQdkBIQIMrQILQfkBIQIMxQILIAEgBEYEQEH4ASECDMUCCyABLQAAQcgARw0EIAFBAWohAUHYASECDKsCCyABIARGBEBB9wEhAgzEAgsCQAJAIAEtAABBxQBrDhAABQUFBQUFBQUFBQUFBQUBBQsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEHBAGsOFQABAgNaBAUGWlpaBwgJCgsMDQ4PEFoLIAFBAWohAUH7ACECDJICCyABQQFqIQFB/AAhAgyRAgsgAUEBaiEBQYEBIQIMkAILIAFBAWohAUGFASECDI8CCyABQQFqIQFBhgEhAgyOAgsgAUEBaiEBQYkBIQIMjQILIAFBAWohAUGKASECDIwCCyABQQFqIQFBjQEhAgyLAgsgAUEBaiEBQZYBIQIMigILIAFBAWohAUGXASECDIkCCyABQQFqIQFBmAEhAgyIAgsgAUEBaiEBQaUBIQIMhwILIAFBAWohAUGmASECDIYCCyABQQFqIQFBrAEhAgyFAgsgAUEBaiEBQbQBIQIMhAILIAFBAWohAUG3ASECDIMCCyABQQFqIQFBvgEhAgyCAgsgASAERgRAQdYBIQIMmwILIAEtAABBzgBHDUggAUEBaiEBQb0BIQIMgQILIAEgBEYEQEHVASECDJoCCwJAAkACQCABLQAAQcIAaw4SAEpKSkpKSkpKSgFKSkpKSkoCSgsgAUEBaiEBQbgBIQIMggILIAFBAWohAUG7ASECDIECCyABQQFqIQFBvAEhAgyAAgtB1AEhAiABIARGDZgCIAMoAgAiACAEIAFraiEFIAEgAGtBB2ohBgJAA0AgAS0AACAAQajVAGotAABHDUUgAEEHRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJkCCyADQQA2AgAgBkEBaiEBQRsMRQsgASAERgRAQdMBIQIMmAILAkACQCABLQAAQckAaw4HAEdHR0dHAUcLIAFBAWohAUG5ASECDP8BCyABQQFqIQFBugEhAgz+AQtB0gEhAiABIARGDZYCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQabVAGotAABHDUMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJcCCyADQQA2AgAgBkEBaiEBQQ8MQwtB0QEhAiABIARGDZUCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQaTVAGotAABHDUIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYCCyADQQA2AgAgBkEBaiEBQSAMQgtB0AEhAiABIARGDZQCIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDUEgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJUCCyADQQA2AgAgBkEBaiEBQRIMQQsgASAERgRAQc8BIQIMlAILAkACQCABLQAAQcUAaw4OAENDQ0NDQ0NDQ0NDQwFDCyABQQFqIQFBtQEhAgz7AQsgAUEBaiEBQbYBIQIM+gELQc4BIQIgASAERg2SAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGe1QBqLQAARw0/IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyTAgsgA0EANgIAIAZBAWohAUEHDD8LQc0BIQIgASAERg2RAiADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGY1QBqLQAARw0+IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAySAgsgA0EANgIAIAZBAWohAUEoDD4LIAEgBEYEQEHMASECDJECCwJAAkACQCABLQAAQcUAaw4RAEFBQUFBQUFBQQFBQUFBQQJBCyABQQFqIQFBsQEhAgz5AQsgAUEBaiEBQbIBIQIM+AELIAFBAWohAUGzASECDPcBC0HLASECIAEgBEYNjwIgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBkdUAai0AAEcNPCAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkAILIANBADYCACAGQQFqIQFBGgw8C0HKASECIAEgBEYNjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyFAgsgA0EANgIAIAZBAWohAUEsDDELQb8BIQIgASAERg2DAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0wIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyEAgsgA0EANgIAIAZBAWohAUERDDALQb4BIQIgASAERg2CAiADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEHy1ABqLQAARw0vIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyDAgsgA0EANgIAIAZBAWohAUEuDC8LIAEgBEYEQEG9ASECDIICCwJAAkACQAJAAkAgAS0AAEHBAGsOFQA0NDQ0NDQ0NDQ0ATQ0AjQ0AzQ0BDQLIAFBAWohAUGbASECDOwBCyABQQFqIQFBnAEhAgzrAQsgAUEBaiEBQZ0BIQIM6gELIAFBAWohAUGiASECDOkBCyABQQFqIQFBpAEhAgzoAQsgASAERgRAQbwBIQIMgQILAkACQCABLQAAQdIAaw4DADABMAsgAUEBaiEBQaMBIQIM6AELIAFBAWohAUEEDC0LQbsBIQIgASAERg3/ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHw1ABqLQAARw0sIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyAAgsgA0EANgIAIAZBAWohAUEdDCwLIAEgBEYEQEG6ASECDP8BCwJAAkAgAS0AAEHJAGsOBwEuLi4uLgAuCyABQQFqIQFBoQEhAgzmAQsgAUEBaiEBQSIMKwsgASAERgRAQbkBIQIM/gELIAEtAABB0ABHDSsgAUEBaiEBQaABIQIM5AELIAEgBEYEQEG4ASECDP0BCwJAAkAgAS0AAEHGAGsOCwAsLCwsLCwsLCwBLAsgAUEBaiEBQZ4BIQIM5AELIAFBAWohAUGfASECDOMBC0G3ASECIAEgBEYN+wEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB7NQAai0AAEcNKCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM/AELIANBADYCACAGQQFqIQFBDQwoC0G2ASECIAEgBEYN+gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNJyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+wELIANBADYCACAGQQFqIQFBDAwnC0G1ASECIAEgBEYN+QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6tQAai0AAEcNJiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+gELIANBADYCACAGQQFqIQFBAwwmC0G0ASECIAEgBEYN+AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6NQAai0AAEcNJSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+QELIANBADYCACAGQQFqIQFBJgwlCyABIARGBEBBswEhAgz4AQsCQAJAIAEtAABB1ABrDgIAAScLIAFBAWohAUGZASECDN8BCyABQQFqIQFBmgEhAgzeAQtBsgEhAiABIARGDfYBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQebUAGotAABHDSMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPcBCyADQQA2AgAgBkEBaiEBQScMIwtBsQEhAiABIARGDfUBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQeTUAGotAABHDSIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPYBCyADQQA2AgAgBkEBaiEBQRwMIgtBsAEhAiABIARGDfQBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQd7UAGotAABHDSEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPUBCyADQQA2AgAgBkEBaiEBQQYMIQtBrwEhAiABIARGDfMBIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQdnUAGotAABHDSAgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPQBCyADQQA2AgAgBkEBaiEBQRkMIAsgASAERgRAQa4BIQIM8wELAkACQAJAAkAgAS0AAEEtaw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEBB5QAhAgyLAQtBACEAQQEhBUEBIQdBACECAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgAS0AAEEwaw4KCgkAAQIDBAUGCAsLQQIMBgtBAwwFC0EEDAQLQQUMAwtBBgwCC0EHDAELQQgLIQJBACEFQQAhBwwCC0EJIQJBASEAQQAhBUEAIQcMAQtBACEFQQEhAgsgAyACOgArIAFBAWohAQJAAkAgAy0ALkEQcQ0AAkACQAJAIAMtACoOAwEAAgQLIAdFDQMMAgsgAA0BDAILIAVFDQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ0CIANB4gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ19IANB4wA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5AA2AhwgAyABNgIUIAMgADYCDAyLAQtB1AAhAgxxCyADLQApQSJGDYYBQdMAIQIMcAtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsgAEUEQEHVACECDHALIABBFUcEQCADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgyJAQsgA0HhADYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDIgBCyABIARGBEBB4AAhAgyIAQsCQAJAAkACQAJAIAEtAABBCmsOBAEEBAAECyABQQFqIQEMAQsgAUEBaiEBIANBL2otAABBAXFFDQELQdIAIQIMcAsgA0EANgIcIAMgATYCFCADQbYRNgIQIANBCTYCDEEAIQIMiAELIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIcBCyABIARGBEBB3wAhAgyHAQsgAS0AAEEKRgRAIAFBAWohAQwJCyADLQAuQcAAcQ0IIANBADYCHCADIAE2AhQgA0G2ETYCECADQQI2AgxBACECDIYBCyABIARGBEBB3QAhAgyGAQsgAS0AACICQQ1GBEAgAUEBaiEBQdAAIQIMbQsgASEAIAJBCWsOBAUBAQUBCyAEIAEiAEYEQEHcACECDIUBCyAALQAAQQpHDQAgAEEBagwCC0EAIQIgA0EANgIcIAMgADYCFCADQcotNgIQIANBBzYCDAyDAQsgASAERgRAQdsAIQIMgwELAkAgAS0AAEEJaw4EAwAAAwALIAFBAWoLIQFBzgAhAgxoCyABIARGBEBB2gAhAgyBAQsgAS0AAEEJaw4EAAEBAAELQQAhAiADQQA2AhwgA0GaEjYCECADQQc2AgwgAyABQQFqNgIUDH8LIANBgBI7ASpBACEAAkAgAygCOCICRQ0AIAIoAjgiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HZADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDH4LQc0AIQIMZAsgA0EANgIcIAMgATYCFCADQckNNgIQIANBGjYCDEEAIQIMfAsgASAERgRAQdkAIQIMfAsgAS0AAEEgRw09IAFBAWohASADLQAuQQFxDT0gA0EANgIcIAMgATYCFCADQcIcNgIQIANBHjYCDEEAIQIMewsgASAERgRAQdgAIQIMewsCQAJAAkACQAJAIAEtAAAiAEEKaw4EAgMDAAELIAFBAWohAUEsIQIMZQsgAEE6Rw0BIANBADYCHCADIAE2AhQgA0HnETYCECADQQo2AgxBACECDH0LIAFBAWohASADQS9qLQAAQQFxRQ1zIAMtADJBgAFxRQRAIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsCQAJAIAAOFk1MSwEBAQEBAQEBAQEBAQEBAQEBAQABCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgx+CyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgx9C0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ1ZIABBFUcNASADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgx8C0HLACECDGILQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDHoLIAMgAy8BMkGAAXI7ATIMOwsgASAERwRAIANBETYCCCADIAE2AgRBygAhAgxgC0HXACECDHgLIAEgBEYEQEHWACECDHgLAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAQEBAQEBAQEBAQEBAAUBAQAIDQAsgAUEBaiEBQcYAIQIMYQsgAUEBaiEBQccAIQIMYAsgAUEBaiEBQcgAIQIMXwsgAUEBaiEBQckAIQIMXgtB1QAhAiAEIAEiAEYNdiAEIAFrIAMoAgAiAWohBiAAIAFrQQVqIQcDQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQhBBCABQQVGDQoaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHYLQdQAIQIgBCABIgBGDXUgBCABayADKAIAIgFqIQYgACABa0EPaiEHA0AgAUGAyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0HQQMgAUEPRg0JGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx1C0HTACECIAQgASIARg10IAQgAWsgAygCACIBaiEGIAAgAWtBDmohBwNAIAFB4scAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNBiABQQ5GDQcgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdAtB0gAhAiAEIAEiAEYNcyAEIAFrIAMoAgAiAWohBSAAIAFrQQFqIQYDQCABQeDHAGotAAAgAC0AACIHQSByIAcgB0HBAGtB/wFxQRpJG0H/AXFHDQUgAUEBRg0CIAFBAWohASAEIABBAWoiAEcNAAsgAyAFNgIADHMLIAEgBEYEQEHRACECDHMLAkACQCABLQAAIgBBIHIgACAAQcEAa0H/AXFBGkkbQf8BcUHuAGsOBwA5OTk5OQE5CyABQQFqIQFBwwAhAgxaCyABQQFqIQFBxAAhAgxZCyADQQA2AgAgBkEBaiEBQcUAIQIMWAtB0AAhAiAEIAEiAEYNcCAEIAFrIAMoAgAiAWohBiAAIAFrQQlqIQcDQCABQdbHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQJBAiABQQlGDQQaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHALQc8AIQIgBCABIgBGDW8gBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUHQxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxvCyAAIQEgA0EANgIADDMLQQELOgAsIANBADYCACAHQQFqIQELQS0hAgxSCwJAA0AgAS0AAEHQxQBqLQAAQQFHDQEgBCABQQFqIgFHDQALQc0AIQIMawtBwgAhAgxRCyABIARGBEBBzAAhAgxqCyABLQAAQTpGBEAgAygCBCEAIANBADYCBCADIAAgARAwIgBFDTMgA0HLADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxqCyADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgxpCwJAAkAgAy0ALEECaw4CAAEnCyADQTNqLQAAQQJxRQ0mIAMtAC5BAnENJiADQQA2AhwgAyABNgIUIANBphQ2AhAgA0ELNgIMQQAhAgxpCyADLQAyQSBxRQ0lIAMtAC5BAnENJSADQQA2AhwgAyABNgIUIANBvRM2AhAgA0EPNgIMQQAhAgxoC0EAIQACQCADKAI4IgJFDQAgAigCSCICRQ0AIAMgAhEAACEACyAARQRAQcEAIQIMTwsgAEEVRwRAIANBADYCHCADIAE2AhQgA0GmDzYCECADQRw2AgxBACECDGgLIANBygA2AhwgAyABNgIUIANBhRw2AhAgA0EVNgIMQQAhAgxnCyABIARHBEAgASECA0AgBCACIgFrQRBOBEAgAUEQaiEC/Qz/////////////////////IAH9AAAAIg1BB/1sIA39DODg4ODg4ODg4ODg4ODg4OD9bv0MX19fX19fX19fX19fX19fX/0mIA39DAkJCQkJCQkJCQkJCQkJCQn9I/1Q/VL9ZEF/c2giAEEQRg0BIAAgAWohAQwYCyABIARGBEBBxAAhAgxpCyABLQAAQcDBAGotAABBAUcNFyAEIAFBAWoiAkcNAAtBxAAhAgxnC0HEACECDGYLIAEgBEcEQANAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXEiAEEJRg0AIABBIEYNAAJAAkACQAJAIABB4wBrDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTYhAgxSCyABQQFqIQFBNyECDFELIAFBAWohAUE4IQIMUAsMFQsgBCABQQFqIgFHDQALQTwhAgxmC0E8IQIMZQsgASAERgRAQcgAIQIMZQsgA0ESNgIIIAMgATYCBAJAAkACQAJAAkAgAy0ALEEBaw4EFAABAgkLIAMtADJBIHENA0HgASECDE8LAkAgAy8BMiIAQQhxRQ0AIAMtAChBAUcNACADLQAuQQhxRQ0CCyADIABB9/sDcUGABHI7ATIMCwsgAyADLwEyQRByOwEyDAQLIANBADYCBCADIAEgARAxIgAEQCADQcEANgIcIAMgADYCDCADIAFBAWo2AhRBACECDGYLIAFBAWohAQxYCyADQQA2AhwgAyABNgIUIANB9BM2AhAgA0EENgIMQQAhAgxkC0HHACECIAEgBEYNYyADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIABBwMUAai0AACABLQAAQSByRw0BIABBBkYNSiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAxkCyADQQA2AgAMBQsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkcNAyABQQFqIQEMBQsgBCABQQFqIgFHDQALQcUAIQIMZAtBxQAhAgxjCwsgA0EAOgAsDAELQQshAgxHC0E/IQIMRgsCQAJAA0AgAS0AACIAQSBHBEACQCAAQQprDgQDBQUDAAsgAEEsRg0DDAQLIAQgAUEBaiIBRw0AC0HGACECDGALIANBCDoALAwOCyADLQAoQQFHDQIgAy0ALkEIcQ0CIAMoAgQhACADQQA2AgQgAyAAIAEQMSIABEAgA0HCADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxfCyABQQFqIQEMUAtBOyECDEQLAkADQCABLQAAIgBBIEcgAEEJR3ENASAEIAFBAWoiAUcNAAtBwwAhAgxdCwtBPCECDEILAkACQCABIARHBEADQCABLQAAIgBBIEcEQCAAQQprDgQDBAQDBAsgBCABQQFqIgFHDQALQT8hAgxdC0E/IQIMXAsgAyADLwEyQSByOwEyDAoLIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQ1OIANBPjYCHCADIAE2AhQgAyAANgIMQQAhAgxaCwJAIAEgBEcEQANAIAEtAABBwMMAai0AACIAQQFHBEAgAEECRg0DDAwLIAQgAUEBaiIBRw0AC0E3IQIMWwtBNyECDFoLIAFBAWohAQwEC0E7IQIgBCABIgBGDVggBCABayADKAIAIgFqIQYgACABa0EFaiEHAkADQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEFRgRAQQchAQw/CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxZCyADQQA2AgAgACEBDAULQTohAiAEIAEiAEYNVyAEIAFrIAMoAgAiAWohBiAAIAFrQQhqIQcCQANAIAFBtMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQhGBEBBBSEBDD4LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFgLIANBADYCACAAIQEMBAtBOSECIAQgASIARg1WIAQgAWsgAygCACIBaiEGIAAgAWtBA2ohBwJAA0AgAUGwwQBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBA0YEQEEGIQEMPQsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMVwsgA0EANgIAIAAhAQwDCwJAA0AgAS0AACIAQSBHBEAgAEEKaw4EBwQEBwILIAQgAUEBaiIBRw0AC0E4IQIMVgsgAEEsRw0BIAFBAWohAEEBIQECQAJAAkACQAJAIAMtACxBBWsOBAMBAgQACyAAIQEMBAtBAiEBDAELQQQhAQsgA0EBOgAsIAMgAy8BMiABcjsBMiAAIQEMAQsgAyADLwEyQQhyOwEyIAAhAQtBPiECDDsLIANBADoALAtBOSECDDkLIAEgBEYEQEE2IQIMUgsCQAJAAkACQAJAIAEtAABBCmsOBAACAgECCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNAiADQTM2AhwgAyABNgIUIAMgADYCDEEAIQIMVQsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDAYLIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxUCyADLQAuQQFxBEBB3wEhAgw7CyADKAIEIQAgA0EANgIEIAMgACABEDEiAA0BDEkLQTQhAgw5CyADQTU2AhwgAyABNgIUIAMgADYCDEEAIQIMUQtBNSECDDcLIANBL2otAABBAXENACADQQA2AhwgAyABNgIUIANB6xY2AhAgA0EZNgIMQQAhAgxPC0EzIQIMNQsgASAERgRAQTIhAgxOCwJAIAEtAABBCkYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZIXNgIQIANBAzYCDEEAIQIMTgtBMiECDDQLIAEgBEYEQEExIQIMTQsCQCABLQAAIgBBCUYNACAAQSBGDQBBASECAkAgAy0ALEEFaw4EBgQFAA0LIAMgAy8BMkEIcjsBMgwMCyADLQAuQQFxRQ0BIAMtACxBCEcNACADQQA6ACwLQT0hAgwyCyADQQA2AhwgAyABNgIUIANBwhY2AhAgA0EKNgIMQQAhAgxKC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyDAYLIAEgBEYEQEEwIQIMRwsgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQQFxDQAgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMRgtBMCECDCwLIAFBAWohAUExIQIMKwsgASAERgRAQS8hAgxECyABLQAAIgBBCUcgAEEgR3FFBEAgAUEBaiEBIAMtAC5BAXENASADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgxEC0EBIQICQAJAAkACQAJAAkAgAy0ALEECaw4HBQQEAwECAAQLIAMgAy8BMkEIcjsBMgwDC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyC0EvIQIMKwsgA0EANgIcIAMgATYCFCADQYQTNgIQIANBCzYCDEEAIQIMQwtB4QEhAgwpCyABIARGBEBBLiECDEILIANBADYCBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCHCADIAE2AhQgA0HlCzYCECADQRE2AgxBACECDC8LIANBADYCHCADIAE2AhQgA0GlCzYCECADQQI2AgxBACECDC4LQQEhByADLwEyIgVBCHFFBEAgAykDIEIAUiEHCwJAIAMtADAEQEEBIQAgAy0AKUEFRg0BIAVBwABxRSAHcUUNAQsCQCADLQAoIgJBAkYEQEEBIQAgAy8BNCIGQeUARg0CQQAhACAFQcAAcQ0CIAZB5ABGDQIgBkHmAGtBAkkNAiAGQcwBRg0CIAZBsAJGDQIMAQtBACEAIAVBwABxDQELQQIhACAFQQhxDQAgBUGABHEEQAJAIAJBAUcNACADLQAuQQpxDQBBBSEADAILQQQhAAwBCyAFQSBxRQRAIAMQNkEAR0ECdCEADAELQQBBAyADKQMgUBshAAsgAEEBaw4FAgAHAQMEC0ERIQIMEwsgA0EBOgAxDCkLQQAhAgJAIAMoAjgiAEUNACAAKAIwIgBFDQAgAyAAEQAAIQILIAJFDSYgAkEVRgRAIANBAzYCHCADIAE2AhQgA0HSGzYCECADQRU2AgxBACECDCsLQQAhAiADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMDCoLIANBADYCHCADIAE2AhQgA0H5IDYCECADQQ82AgxBACECDCkLQQAhAAJAIAMoAjgiAkUNACACKAIwIgJFDQAgAyACEQAAIQALIAANAQtBDiECDA4LIABBFUYEQCADQQI2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwnCyADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMQQAhAgwmC0EqIQIMDAsgASAERwRAIANBCTYCCCADIAE2AgRBKSECDAwLQSYhAgwkCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMVARAQSUhAgwkCyADKAIEIQAgA0EANgIEIAMgACABIAynaiIBEDIiAEUNACADQQU2AhwgAyABNgIUIAMgADYCDEEAIQIMIwtBDyECDAkLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQTBrDjcXFgABAgMEBQYHFBQUFBQUFAgJCgsMDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUDg8QERITFAtCAiEKDBYLQgMhCgwVC0IEIQoMFAtCBSEKDBMLQgYhCgwSC0IHIQoMEQtCCCEKDBALQgkhCgwPC0IKIQoMDgtCCyEKDA0LQgwhCgwMC0INIQoMCwtCDiEKDAoLQg8hCgwJC0IKIQoMCAtCCyEKDAcLQgwhCgwGC0INIQoMBQtCDiEKDAQLQg8hCgwDCyADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMQQAhAgwhCyABIARGBEBBIiECDCELQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FRQAAQIDBAUGBxYWFhYWFhYICQoLDA0WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg4PEBESExYLQgIhCgwUC0IDIQoMEwtCBCEKDBILQgUhCgwRC0IGIQoMEAtCByEKDA8LQgghCgwOC0IJIQoMDQtCCiEKDAwLQgshCgwLC0IMIQoMCgtCDSEKDAkLQg4hCgwIC0IPIQoMBwtCCiEKDAYLQgshCgwFC0IMIQoMBAtCDSEKDAMLQg4hCgwCC0IPIQoMAQtCASEKCyABQQFqIQEgAykDICILQv//////////D1gEQCADIAtCBIYgCoQ3AyAMAgsgA0EANgIcIAMgATYCFCADQbUJNgIQIANBDDYCDEEAIQIMHgtBJyECDAQLQSghAgwDCyADIAE6ACwgA0EANgIAIAdBAWohAUEMIQIMAgsgA0EANgIAIAZBAWohAUEKIQIMAQsgAUEBaiEBQQghAgwACwALQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBcLQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBYLQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBULQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDBQLQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDBMLQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBILQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBELQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBALQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDA8LQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDA4LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDA0LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDAwLQQAhAiADQQA2AhwgAyABNgIUIANBmRM2AhAgA0ELNgIMDAsLQQAhAiADQQA2AhwgAyABNgIUIANBnQk2AhAgA0ELNgIMDAoLQQAhAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMDAkLQQAhAiADQQA2AhwgAyABNgIUIANBsRA2AhAgA0EKNgIMDAgLQQAhAiADQQA2AhwgAyABNgIUIANBux02AhAgA0ECNgIMDAcLQQAhAiADQQA2AhwgAyABNgIUIANBlhY2AhAgA0ECNgIMDAYLQQAhAiADQQA2AhwgAyABNgIUIANB+Rg2AhAgA0ECNgIMDAULQQAhAiADQQA2AhwgAyABNgIUIANBxBg2AhAgA0ECNgIMDAQLIANBAjYCHCADIAE2AhQgA0GpHjYCECADQRY2AgxBACECDAMLQd4AIQIgASAERg0CIAlBCGohByADKAIAIQUCQAJAIAEgBEcEQCAFQZbIAGohCCAEIAVqIAFrIQYgBUF/c0EKaiIFIAFqIQADQCABLQAAIAgtAABHBEBBAiEIDAMLIAVFBEBBACEIIAAhAQwDCyAFQQFrIQUgCEEBaiEIIAQgAUEBaiIBRw0ACyAGIQUgBCEBCyAHQQE2AgAgAyAFNgIADAELIANBADYCACAHIAg2AgALIAcgATYCBCAJKAIMIQACQAJAIAkoAghBAWsOAgQBAAsgA0EANgIcIANBwh42AhAgA0EXNgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HqLA8LQZgmDwtB7TEPC0GgNw8LQckpDwtBtCkPC0GWLQ8LQesrDwtBojUPC0HbNA8LQeApDwtB4yQPC0HVJA8LQe4kDwtB5iUPC0HKNA8LQdA3DwtBqjUPC0H1LA8LQfYmDwtBgiIPC0HyMw8LQb4oDwtB5zcPC0HNIQ8LQcAhDwtBuCUPC0HLJQ8LQZYkDwtBjzQPC0HNNQ8LQd0qDwtB7jMPC0GcNA8LQZ4xDwtB9DUPC0HlIg8LQa8lDwtBmTEPC0GyNg8LQfk2DwtBxDIPC0HdLA8LQYIxDwtBwTEPC0GNNw8LQckkDwtB7DYPC0HnKg8LQcgjDwtB4iEPC0HJNw8LQaUiDwtBlCIPC0HbNg8LQd41DwtBhiYPC0G8Kw8LQYsyDwtBoCMPC0H2MA8LQYAsDwtBiSsPC0GkJg8LQfIjDwtBgSgPC0GrMg8LQesnDwtBwjYPC0GiJA8LQc8qDwtB3CMPC0GHJw8LQeQ0DwtBtyIPC0GtMQ8LQdUiDwtBrzQPC0HeJg8LQdYyDwtB9DQPC0GBOA8LQfQ3DwtBkjYPC0GdJw8LQYIpDwtBjSMPC0HXMQ8LQb01DwtBtDcPC0HYMA8LQbYnDwtBmjgPC0GnKg8LQcQnDwtBriMPC0H1Ig8LAAtByiYhAQsgAQsXACAAIAAvAS5B/v8DcSABQQBHcjsBLgsaACAAIAAvAS5B/f8DcSABQQBHQQF0cjsBLgsaACAAIAAvAS5B+/8DcSABQQBHQQJ0cjsBLgsaACAAIAAvAS5B9/8DcSABQQBHQQN0cjsBLgsaACAAIAAvAS5B7/8DcSABQQBHQQR0cjsBLgsaACAAIAAvAS5B3/8DcSABQQBHQQV0cjsBLgsaACAAIAAvAS5Bv/8DcSABQQBHQQZ0cjsBLgsaACAAIAAvAS5B//4DcSABQQBHQQd0cjsBLgsaACAAIAAvAS5B//0DcSABQQBHQQh0cjsBLgsaACAAIAAvAS5B//sDcSABQQBHQQl0cjsBLgs+AQJ/AkAgACgCOCIDRQ0AIAMoAgQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeESNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAggiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfwRNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAgwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQewKNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfoeNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQcsQNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhgiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQbcfNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQb8VNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQf4INgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQYwdNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeYVNgIQQRghBAsgBAs4ACAAAn8gAC8BMkEUcUEURgRAQQEgAC0AKEEBRg0BGiAALwE0QeUARgwBCyAALQApQQVGCzoAMAtZAQJ/AkAgAC0AKEEBRg0AIAAvATQiAUHkAGtB5ABJDQAgAUHMAUYNACABQbACRg0AIAAvATIiAEHAAHENAEEBIQIgAEGIBHFBgARGDQAgAEEocUUhAgsgAguMAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQAgAC8BMiIBQQJxRQ0BDAILIAAvATIiAUEBcUUNAQtBASECIAAtAChBAUYNACAALwE0IgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNACABQcAAcQ0AQQAhAiABQYgEcUGABEYNACABQShxQQBHIQILIAILcwAgAEEQav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAP0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEwav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEgav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",Xft;Object.defineProperty(N6n,"exports",{get:()=>Xft||(Xft=TXi.from(vXi,"base64"))})});var woe=re((sPc,G6n)=>{"use strict";p();var P6n=["GET","HEAD","POST"],RXi=new Set(P6n),kXi=[101,204,205,304],M6n=[301,302,303,307,308],BXi=new Set(M6n),O6n=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],NXi=new Set(O6n),L6n=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],DXi=["",...L6n],PXi=new Set(L6n),MXi=["follow","manual","error"],F6n=["GET","HEAD","OPTIONS","TRACE","QUERY"],OXi=new Set(F6n),LXi=["navigate","same-origin","no-cors","cors"],FXi=["omit","same-origin","include"],QXi=["default","no-store","reload","no-cache","force-cache","only-if-cached"],UXi=["content-encoding","content-language","content-location","content-type","content-length"],GXi=["half"],Q6n=["CONNECT","TRACE","TRACK"],$Xi=new Set(Q6n),U6n=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],WXi=new Set(U6n);G6n.exports={subresource:U6n,forbiddenMethods:Q6n,requestBodyHeader:UXi,referrerPolicy:DXi,requestRedirect:MXi,requestMode:LXi,requestCredentials:FXi,requestCache:QXi,redirectStatus:M6n,corsSafeListedMethods:P6n,nullBodyStatus:kXi,safeMethods:F6n,badPorts:O6n,requestDuplex:GXi,subresourceSet:WXi,badPortsSet:NXi,redirectStatusSet:BXi,corsSafeListedMethodsSet:RXi,safeMethodsSet:OXi,forbiddenMethodsSet:$Xi,referrerPolicyTokens:PXi}});var egt=re((aPc,$6n)=>{"use strict";p();var Zft=Symbol.for("undici.globalOrigin.1");function HXi(){return globalThis[Zft]}function qXi(t){if(t===void 0){Object.defineProperty(globalThis,Zft,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,Zft,{value:e,writable:!0,enumerable:!1,configurable:!1})}$6n.exports={getGlobalOrigin:HXi,setGlobalOrigin:qXi}});var qBe=re((lPc,W6n)=>{"use strict";p();var jXi=new TextDecoder;function VXi(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),jXi.decode(t))}W6n.exports={utf8DecodeBytes:VXi}});var Dw=re((dPc,V6n)=>{"use strict";p();var H6n=require("node:assert"),{utf8DecodeBytes:YXi}=qBe();function zXi(t,e,n){let r="";for(;n.positione)return String.fromCharCode.apply(null,t);let n="",r=0,i=65535;for(;re&&(i=e-r),n+=String.fromCharCode.apply(null,t.subarray(r,r+=i));return n}var eZi=/[^\x00-\xFF]/;function tZi(t){return H6n(!eZi.test(t)),t}function nZi(t){return JSON.parse(YXi(t))}function rZi(t,e=!0,n=!0){return j6n(t,e,n,q6n)}function j6n(t,e,n,r){let i=0,s=t.length-1;if(e)for(;i0&&r(t.charCodeAt(s));)s--;return i===0&&s===t.length-1?t:t.slice(i,s+1)}function iZi(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return H6n(typeof e=="string"),e}V6n.exports={collectASequenceOfCodePoints:zXi,collectASequenceOfCodePointsFast:KXi,forgivingBase64:XXi,isASCIIWhitespace:q6n,isomorphicDecode:ZXi,isomorphicEncode:tZi,parseJSONFromBytes:nZi,removeASCIIWhitespace:rZi,removeChars:j6n,serializeJavascriptValueToJSONString:iZi}});var Wb=re((mPc,Z6n)=>{"use strict";p();var VBe=require("node:assert"),{forgivingBase64:sZi,collectASequenceOfCodePoints:tgt,collectASequenceOfCodePointsFast:Toe,isomorphicDecode:oZi,removeASCIIWhitespace:aZi,removeChars:cZi}=Dw(),lZi=new TextEncoder,voe=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,uZi=/[\u000A\u000D\u0009\u0020]/u,dZi=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function pZi(t){VBe(t.protocol==="data:");let e=K6n(t,!0);e=e.slice(5);let n={position:0},r=Toe(",",e,n),i=r.length;if(r=aZi(r,!0,!0),n.position>=e.length)return"failure";n.position++;let s=e.slice(i+1),o=J6n(s);if(/;(?:\u0020*)base64$/ui.test(r)){let c=oZi(o);if(o=sZi(c),o==="failure")return"failure";r=r.slice(0,-6),r=r.replace(/(\u0020+)$/u,""),r=r.slice(0,-1)}r.startsWith(";")&&(r="text/plain"+r);let a=ngt(r);return a==="failure"&&(a=ngt("text/plain;charset=US-ASCII")),{mimeType:a,body:o}}function K6n(t,e=!1){if(!e)return t.href;let n=t.href,r=t.hash.length,i=r===0?n:n.substring(0,n.length-r);return!r&&n.endsWith("#")?i.slice(0,-1):i}function J6n(t){let e=lZi.encode(t);return mZi(e)}function Y6n(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function z6n(t){return t>=48&&t<=57?t-48:(t&223)-55}function mZi(t){let e=t.length,n=new Uint8Array(e),r=0,i=0;for(;i=t.length)return"failure";e.position++;let r=Toe(";",t,e);if(r=jBe(r,!1,!0),r.length===0||!voe.test(r))return"failure";let i=n.toLowerCase(),s=r.toLowerCase(),o={type:i,subtype:s,parameters:new Map,essence:`${i}/${s}`};for(;e.positionuZi.test(u),t,e);let a=tgt(u=>u!==";"&&u!=="=",t,e);if(a=a.toLowerCase(),e.position=t.length)break;let c=null;if(t[e.position]==='"')c=X6n(t,e,!0),Toe(";",t,e);else if(c=Toe(";",t,e),c=jBe(c,!1,!0),c.length===0)continue;a.length!==0&&voe.test(a)&&(c.length===0||dZi.test(c))&&!o.parameters.has(a)&&o.parameters.set(a,c)}return o}function X6n(t,e,n=!1){let r=e.position,i="";for(VBe(t[e.position]==='"'),e.position++;i+=tgt(o=>o!=='"'&&o!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){i+="\\";break}i+=t[e.position],e.position++}else{VBe(s==='"');break}}return n?i:t.slice(r,e.position)}function hZi(t){VBe(t!=="failure");let{parameters:e,essence:n}=t,r=n;for(let[i,s]of e.entries())r+=";",r+=i,r+="=",voe.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),r+=s;return r}function fZi(t){return t===13||t===10||t===9||t===32}function jBe(t,e=!0,n=!0){return cZi(t,e,n,fZi)}function gZi(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}Z6n.exports={dataURLProcessor:pZi,URLSerializer:K6n,stringPercentDecode:J6n,parseMIMEType:ngt,collectAnHTTPQuotedString:X6n,serializeAMimeType:hZi,removeHTTPWhitespace:jBe,minimizeSupportedMimeType:gZi,HTTP_TOKEN_CODEPOINTS:voe}});var lh=re((fPc,tzn)=>{"use strict";p();var AZi=require("node:assert"),{types:Fu,inspect:yZi}=require("node:util"),{markAsUncloneable:EZi}=require("node:worker_threads"),rgt=1,igt=2,YBe=3,zBe=4,sgt=5,KBe=6,ogt=7,ME=8,ezn=Function.call.bind(Function.prototype[Symbol.hasInstance]),Pt={converters:{},util:{},errors:{},is:{}};Pt.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};Pt.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",n=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return Pt.errors.exception({header:t.prefix,message:n})};Pt.errors.invalidArgument=function(t){return Pt.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};Pt.brandCheck=function(t,e){if(!ezn(e,t)){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}};Pt.brandCheckMultiple=function(t){let e=t.map(n=>Pt.util.MakeTypeAssertion(n));return n=>{if(e.every(r=>!r(n))){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}}};Pt.argumentLengthCheck=function({length:t},e,n){if(tezn(t,e)};Pt.util.Type=function(t){switch(typeof t){case"undefined":return rgt;case"boolean":return igt;case"string":return YBe;case"symbol":return zBe;case"number":return sgt;case"bigint":return KBe;case"function":case"object":return t===null?ogt:ME}};Pt.util.Types={UNDEFINED:rgt,BOOLEAN:igt,STRING:YBe,SYMBOL:zBe,NUMBER:sgt,BIGINT:KBe,NULL:ogt,OBJECT:ME};Pt.util.TypeValueToString=function(t){switch(Pt.util.Type(t)){case rgt:return"Undefined";case igt:return"Boolean";case YBe:return"String";case zBe:return"Symbol";case sgt:return"Number";case KBe:return"BigInt";case ogt:return"Null";case ME:return"Object"}};Pt.util.markAsUncloneable=EZi;Pt.util.ConvertToInt=function(t,e,n,r){let i,s;e===64?(i=Math.pow(2,53)-1,n==="unsigned"?s=0:s=Math.pow(-2,53)+1):n==="unsigned"?(s=0,i=Math.pow(2,e)-1):(s=-Math.pow(2,e-1),i=Math.pow(2,e-1)-1);let o=Number(t);if(o===0&&(o=0),Pt.util.HasFlag(r,Pt.attributes.EnforceRange)){if(Number.isNaN(o)||o===Number.POSITIVE_INFINITY||o===Number.NEGATIVE_INFINITY)throw Pt.errors.exception({header:"Integer conversion",message:`Could not convert ${Pt.util.Stringify(t)} to an integer.`});if(o=Pt.util.IntegerPart(o),oi)throw Pt.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${i}, got ${o}.`});return o}return!Number.isNaN(o)&&Pt.util.HasFlag(r,Pt.attributes.Clamp)?(o=Math.min(Math.max(o,s),i),Math.floor(o)%2===0?o=Math.floor(o):o=Math.ceil(o),o):Number.isNaN(o)||o===0&&Object.is(0,o)||o===Number.POSITIVE_INFINITY||o===Number.NEGATIVE_INFINITY?0:(o=Pt.util.IntegerPart(o),o=o%Math.pow(2,e),n==="signed"&&o>=Math.pow(2,e-1)?o-Math.pow(2,e):o)};Pt.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};Pt.util.Stringify=function(t){switch(Pt.util.Type(t)){case zBe:return`Symbol(${t.description})`;case ME:return yZi(t);case YBe:return`"${t}"`;case KBe:return`${t}n`;default:return`${t}`}};Pt.util.IsResizableArrayBuffer=function(t){if(Fu.isArrayBuffer(t))return t.resizable;if(Fu.isSharedArrayBuffer(t))return t.growable;throw Pt.errors.exception({header:"IsResizableArrayBuffer",message:`"${Pt.util.Stringify(t)}" is not an array buffer.`})};Pt.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};Pt.sequenceConverter=function(t){return(e,n,r,i)=>{if(Pt.util.Type(e)!==ME)throw Pt.errors.exception({header:n,message:`${r} (${Pt.util.Stringify(e)}) is not iterable.`});let s=typeof i=="function"?i():e?.[Symbol.iterator]?.(),o=[],a=0;if(s===void 0||typeof s.next!="function")throw Pt.errors.exception({header:n,message:`${r} is not iterable.`});for(;;){let{done:c,value:u}=s.next();if(c)break;o.push(t(u,n,`${r}[${a++}]`))}return o}};Pt.recordConverter=function(t,e){return(n,r,i)=>{if(Pt.util.Type(n)!==ME)throw Pt.errors.exception({header:r,message:`${i} ("${Pt.util.TypeValueToString(n)}") is not an Object.`});let s={};if(!Fu.isProxy(n)){let a=[...Object.getOwnPropertyNames(n),...Object.getOwnPropertySymbols(n)];for(let c of a){let u=Pt.util.Stringify(c),l=t(c,r,`Key ${u} in ${i}`),d=e(n[c],r,`${i}[${u}]`);s[l]=d}return s}let o=Reflect.ownKeys(n);for(let a of o)if(Reflect.getOwnPropertyDescriptor(n,a)?.enumerable){let u=t(a,r,i),l=e(n[a],r,i);s[u]=l}return s}};Pt.interfaceConverter=function(t,e){return(n,r,i)=>{if(!t(n))throw Pt.errors.exception({header:r,message:`Expected ${i} ("${Pt.util.Stringify(n)}") to be an instance of ${e}.`});return n}};Pt.dictionaryConverter=function(t){return t.sort((e,n)=>(e.key>n.key)-(e.key{let i={};if(e!=null&&Pt.util.Type(e)!==ME)throw Pt.errors.exception({header:n,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let s of t){let{key:o,defaultValue:a,required:c,converter:u}=s;if(c===!0&&(e==null||!Object.hasOwn(e,o)))throw Pt.errors.exception({header:n,message:`Missing required key "${o}".`});let l=e?.[o],d=a!==void 0;if(d&&l===void 0&&(l=a()),c||d||l!==void 0){if(l=u(l,n,`${r}.${o}`),s.allowedValues&&!s.allowedValues.includes(l))throw Pt.errors.exception({header:n,message:`${l} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});i[o]=l}}return i}};Pt.nullableConverter=function(t){return(e,n,r)=>e===null?e:t(e,n,r)};Pt.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};Pt.is.ReadableStream=Pt.util.MakeTypeAssertion(ReadableStream);Pt.is.Blob=Pt.util.MakeTypeAssertion(Blob);Pt.is.URLSearchParams=Pt.util.MakeTypeAssertion(URLSearchParams);Pt.is.File=Pt.util.MakeTypeAssertion(File);Pt.is.URL=Pt.util.MakeTypeAssertion(URL);Pt.is.AbortSignal=Pt.util.MakeTypeAssertion(AbortSignal);Pt.is.MessagePort=Pt.util.MakeTypeAssertion(MessagePort);Pt.is.BufferSource=function(t){return Fu.isArrayBuffer(t)||ArrayBuffer.isView(t)&&Fu.isArrayBuffer(t.buffer)};Pt.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,n=e,r=0,i=0;if(Fu.isTypedArray(e)||Fu.isDataView(e)?(n=e.buffer,r=e.byteOffset,i=e.byteLength):(AZi(Fu.isAnyArrayBuffer(e)),i=e.byteLength),n.detached)return new Uint8Array(0);let s=new Uint8Array(i),o=new Uint8Array(n,r,i);return s.set(o),s};Pt.converters.DOMString=function(t,e,n,r){if(t===null&&Pt.util.HasFlag(r,Pt.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw Pt.errors.exception({header:e,message:`${n} is a symbol, which cannot be converted to a DOMString.`});return String(t)};Pt.converters.ByteString=function(t,e,n){if(typeof t=="symbol")throw Pt.errors.exception({header:e,message:`${n} is a symbol, which cannot be converted to a ByteString.`});let r=String(t);for(let i=0;i255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${i} has a value of ${r.charCodeAt(i)} which is greater than 255.`);return r};Pt.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};Pt.converters.boolean=function(t){return!!t};Pt.converters.any=function(t){return t};Pt.converters["long long"]=function(t,e,n){return Pt.util.ConvertToInt(t,64,"signed",0,e,n)};Pt.converters["unsigned long long"]=function(t,e,n){return Pt.util.ConvertToInt(t,64,"unsigned",0,e,n)};Pt.converters["unsigned long"]=function(t,e,n){return Pt.util.ConvertToInt(t,32,"unsigned",0,e,n)};Pt.converters["unsigned short"]=function(t,e,n,r){return Pt.util.ConvertToInt(t,16,"unsigned",r,e,n)};Pt.converters.ArrayBuffer=function(t,e,n,r){if(Pt.util.Type(t)!==ME||!Fu.isArrayBuffer(t))throw Pt.errors.conversionFailed({prefix:e,argument:`${n} ("${Pt.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!Pt.util.HasFlag(r,Pt.attributes.AllowResizable)&&Pt.util.IsResizableArrayBuffer(t))throw Pt.errors.exception({header:e,message:`${n} cannot be a resizable ArrayBuffer.`});return t};Pt.converters.SharedArrayBuffer=function(t,e,n,r){if(Pt.util.Type(t)!==ME||!Fu.isSharedArrayBuffer(t))throw Pt.errors.conversionFailed({prefix:e,argument:`${n} ("${Pt.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!Pt.util.HasFlag(r,Pt.attributes.AllowResizable)&&Pt.util.IsResizableArrayBuffer(t))throw Pt.errors.exception({header:e,message:`${n} cannot be a resizable SharedArrayBuffer.`});return t};Pt.converters.TypedArray=function(t,e,n,r,i){if(Pt.util.Type(t)!==ME||!Fu.isTypedArray(t)||t.constructor.name!==e.name)throw Pt.errors.conversionFailed({prefix:n,argument:`${r} ("${Pt.util.Stringify(t)}")`,types:[e.name]});if(!Pt.util.HasFlag(i,Pt.attributes.AllowShared)&&Fu.isSharedArrayBuffer(t.buffer))throw Pt.errors.exception({header:n,message:`${r} cannot be a view on a shared array buffer.`});if(!Pt.util.HasFlag(i,Pt.attributes.AllowResizable)&&Pt.util.IsResizableArrayBuffer(t.buffer))throw Pt.errors.exception({header:n,message:`${r} cannot be a view on a resizable array buffer.`});return t};Pt.converters.DataView=function(t,e,n,r){if(Pt.util.Type(t)!==ME||!Fu.isDataView(t))throw Pt.errors.conversionFailed({prefix:e,argument:`${n} ("${Pt.util.Stringify(t)}")`,types:["DataView"]});if(!Pt.util.HasFlag(r,Pt.attributes.AllowShared)&&Fu.isSharedArrayBuffer(t.buffer))throw Pt.errors.exception({header:e,message:`${n} cannot be a view on a shared array buffer.`});if(!Pt.util.HasFlag(r,Pt.attributes.AllowResizable)&&Pt.util.IsResizableArrayBuffer(t.buffer))throw Pt.errors.exception({header:e,message:`${n} cannot be a view on a resizable array buffer.`});return t};Pt.converters.ArrayBufferView=function(t,e,n,r){if(Pt.util.Type(t)!==ME||!Fu.isArrayBufferView(t))throw Pt.errors.conversionFailed({prefix:e,argument:`${n} ("${Pt.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!Pt.util.HasFlag(r,Pt.attributes.AllowShared)&&Fu.isSharedArrayBuffer(t.buffer))throw Pt.errors.exception({header:e,message:`${n} cannot be a view on a shared array buffer.`});if(!Pt.util.HasFlag(r,Pt.attributes.AllowResizable)&&Pt.util.IsResizableArrayBuffer(t.buffer))throw Pt.errors.exception({header:e,message:`${n} cannot be a view on a resizable array buffer.`});return t};Pt.converters.BufferSource=function(t,e,n,r){if(Fu.isArrayBuffer(t))return Pt.converters.ArrayBuffer(t,e,n,r);if(Fu.isArrayBufferView(t))return r&=~Pt.attributes.AllowShared,Pt.converters.ArrayBufferView(t,e,n,r);throw Fu.isSharedArrayBuffer(t)?Pt.errors.exception({header:e,message:`${n} cannot be a SharedArrayBuffer.`}):Pt.errors.conversionFailed({prefix:e,argument:`${n} ("${Pt.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};Pt.converters.AllowSharedBufferSource=function(t,e,n,r){if(Fu.isArrayBuffer(t))return Pt.converters.ArrayBuffer(t,e,n,r);if(Fu.isSharedArrayBuffer(t))return Pt.converters.SharedArrayBuffer(t,e,n,r);if(Fu.isArrayBufferView(t))return r|=Pt.attributes.AllowShared,Pt.converters.ArrayBufferView(t,e,n,r);throw Pt.errors.conversionFailed({prefix:e,argument:`${n} ("${Pt.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};Pt.converters["sequence"]=Pt.sequenceConverter(Pt.converters.ByteString);Pt.converters["sequence>"]=Pt.sequenceConverter(Pt.converters["sequence"]);Pt.converters["record"]=Pt.recordConverter(Pt.converters.ByteString,Pt.converters.ByteString);Pt.converters.Blob=Pt.interfaceConverter(Pt.is.Blob,"Blob");Pt.converters.AbortSignal=Pt.interfaceConverter(Pt.is.AbortSignal,"AbortSignal");Pt.converters.EventHandlerNonNull=function(t){return Pt.util.Type(t)!==ME?null:typeof t=="function"?t:()=>{}};Pt.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};tzn.exports={webidl:Pt}});var OE=re((APc,fzn)=>{"use strict";p();var{Transform:bZi}=require("node:stream"),nzn=require("node:zlib"),{redirectStatusSet:_Zi,referrerPolicyTokens:xZi,badPortsSet:SZi}=woe(),{getGlobalOrigin:rzn}=egt(),{collectAnHTTPQuotedString:CZi,parseMIMEType:IZi}=Wb(),{performance:wZi}=require("node:perf_hooks"),{ReadableStreamFrom:TZi,isValidHTTPToken:izn,normalizedMethodRecordsBase:vZi}=Zi(),koe=require("node:assert"),{isUint8Array:RZi}=require("node:util/types"),{webidl:bP}=lh(),{isomorphicEncode:agt,collectASequenceOfCodePoints:aU,removeChars:kZi}=Dw();function szn(t){let e=t.urlList,n=e.length;return n===0?null:e[n-1].toString()}function BZi(t,e){if(!_Zi.has(t.status))return null;let n=t.headersList.get("location",!0);return n!==null&&azn(n)&&(ozn(n)||(n=NZi(n)),n=new URL(n,szn(t))),n&&!n.hash&&(n.hash=e),n}function ozn(t){for(let e=0;e126||n<32)return!1}return!0}function NZi(t){return Buffer.from(t,"binary").toString("utf8")}function _P(t){return t.urlList[t.urlList.length-1]}function DZi(t){let e=_P(t);return mzn(e)&&SZi.has(e.port)?"blocked":"allowed"}function PZi(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}function MZi(t){for(let e=0;e=32&&n<=126||n>=128&&n<=255))return!1}return!0}var OZi=izn;function azn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}function LZi(t){let e=(t.headersList.get("referrer-policy",!0)??"").split(","),n="";if(e.length)for(let r=e.length;r!==0;r--){let i=e[r-1].trim();if(xZi.has(i)){n=i;break}}return n}function FZi(t,e){let n=LZi(e);n!==""&&(t.referrerPolicy=n)}function QZi(){return"allowed"}function UZi(){return"success"}function GZi(){return"success"}function $Zi(t){if(!EP(_P(t)))return;let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}function WZi(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&lgt(t.origin)&&!lgt(_P(t))&&(e=null);break;case"same-origin":Roe(t,_P(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}function AY(t,e){return t}function HZi(t,e,n){return!t?.startTime||t.startTime4096&&(r=i),e){case"no-referrer":return"no-referrer";case"origin":return i??cgt(n,!0);case"unsafe-url":return r;case"strict-origin":{let s=_P(t);return EP(r)&&!EP(s)?"no-referrer":i}case"strict-origin-when-cross-origin":{let s=_P(t);return Roe(r,s)?r:EP(r)&&!EP(s)?"no-referrer":i}case"same-origin":return Roe(t,r)?r:"no-referrer";case"origin-when-cross-origin":return Roe(t,r)?r:i;case"no-referrer-when-downgrade":{let s=_P(t);return EP(r)&&!EP(s)?"no-referrer":r}}}function cgt(t,e=!1){return koe(bP.is.URL(t)),t=new URL(t),pzn(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}var zZi=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),KZi=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function lzn(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),KZi(t)):zZi(t)}function JZi(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||lzn(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}function EP(t){return bP.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:JZi(t.origin):!1}function XZi(t){}function Roe(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}function ZZi(t){return t.controller.state==="aborted"}function ees(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}function tes(t){return vZi[t.toLowerCase()]??t}var nes=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function uzn(t,e,n=0,r=1){class i{#e;#t;#n;constructor(o,a){this.#e=o,this.#t=a,this.#n=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let o=this.#n,a=e(this.#e),c=a.length;if(o>=c)return{value:void 0,done:!0};let{[n]:u,[r]:l}=a[o];this.#n=o+1;let d;switch(this.#t){case"key":d=u;break;case"value":d=l;break;case"key+value":d=[u,l];break}return{value:d,done:!1}}}return delete i.prototype.constructor,Object.setPrototypeOf(i.prototype,nes),Object.defineProperties(i.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,o){return new i(s,o)}}function res(t,e,n,r=0,i=1){let s=uzn(t,n,r,i),o={keys:{writable:!0,enumerable:!0,configurable:!0,value:function(){return bP.brandCheck(this,e),s(this,"key")}},values:{writable:!0,enumerable:!0,configurable:!0,value:function(){return bP.brandCheck(this,e),s(this,"value")}},entries:{writable:!0,enumerable:!0,configurable:!0,value:function(){return bP.brandCheck(this,e),s(this,"key+value")}},forEach:{writable:!0,enumerable:!0,configurable:!0,value:function(c,u=globalThis){if(bP.brandCheck(this,e),bP.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof c!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:l,1:d}of s(this,"key+value"))c.call(u,d,l,this)}}};return Object.defineProperties(e.prototype,{...o,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:o.entries.value}})}function ies(t,e,n){let r=e,i=n;try{let s=t.stream.getReader();dzn(s,r,i)}catch(s){i(s)}}function ses(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}async function dzn(t,e,n){try{let r=[],i=0;do{let{done:s,value:o}=await t.read();if(s){e(Buffer.concat(r,i));return}if(!RZi(o)){n(new TypeError("Received non-Uint8Array chunk"));return}r.push(o),i+=o.length}while(!0)}catch(r){n(r)}}function pzn(t){koe("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}function lgt(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}function mzn(t){koe("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}function oes(t,e){let n=t;if(!n.startsWith("bytes"))return"failure";let r={position:5};if(e&&aU(c=>c===" "||c===" ",n,r),n.charCodeAt(r.position)!==61)return"failure";r.position++,e&&aU(c=>c===" "||c===" ",n,r);let i=aU(c=>{let u=c.charCodeAt(0);return u>=48&&u<=57},n,r),s=i.length?Number(i):null;if(e&&aU(c=>c===" "||c===" ",n,r),n.charCodeAt(r.position)!==45)return"failure";r.position++,e&&aU(c=>c===" "||c===" ",n,r);let o=aU(c=>{let u=c.charCodeAt(0);return u>=48&&u<=57},n,r),a=o.length?Number(o):null;return r.positiona?"failure":{rangeStartValue:s,rangeEndValue:a}}function aes(t,e,n){let r="bytes ";return r+=agt(`${t}`),r+="-",r+=agt(`${e}`),r+="/",r+=agt(`${n}`),r}var ugt=class extends bZi{#e;constructor(e){super(),this.#e=e}_transform(e,n,r){if(!this._inflateStream){if(e.length===0){r();return}this._inflateStream=(e[0]&15)===8?nzn.createInflate(this.#e):nzn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",i=>this.destroy(i))}this._inflateStream.write(e,n,r)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function ces(t){return new ugt(t)}function les(t){let e=null,n=null,r=null,i=hzn("content-type",t);if(i===null)return"failure";for(let s of i){let o=IZi(s);o==="failure"||o.essence==="*/*"||(r=o,r.essence!==n?(e=null,r.parameters.has("charset")&&(e=r.parameters.get("charset")),n=r.essence):!r.parameters.has("charset")&&e!==null&&r.parameters.set("charset",e))}return r??"failure"}function ues(t){let e=t,n={position:0},r=[],i="";for(;n.positions!=='"'&&s!==",",e,n),n.positions===9||s===32),r.push(i),i=""}return r}function hzn(t,e){let n=e.get(t,!0);return n===null?null:ues(n)}function des(t){return!1}function pes(t){return!!(t.username||t.password)}function mes(t){return t!=null&&t!=="client"&&t!=="no-traversable"}var dgt=class{get baseUrl(){return rzn()}get origin(){return this.baseUrl?.origin}policyContainer=czn()},pgt=class{settingsObject=new dgt},hes=new pgt;fzn.exports={isAborted:ZZi,isCancelled:ees,isValidEncodedURL:ozn,ReadableStreamFrom:TZi,tryUpgradeRequestToAPotentiallyTrustworthyURL:XZi,clampAndCoarsenConnectionTimingInfo:HZi,coarsenedSharedCurrentTime:qZi,determineRequestsReferrer:YZi,makePolicyContainer:czn,clonePolicyContainer:VZi,appendFetchMetadata:$Zi,appendRequestOriginHeader:WZi,TAOCheck:GZi,corsCheck:UZi,crossOriginResourcePolicyCheck:QZi,createOpaqueTimingInfo:jZi,setRequestReferrerPolicyOnRedirect:FZi,isValidHTTPToken:izn,requestBadPort:DZi,requestCurrentURL:_P,responseURL:szn,responseLocationURL:BZi,isURLPotentiallyTrustworthy:EP,isValidReasonPhrase:MZi,sameOrigin:Roe,normalizeMethod:tes,iteratorMixin:res,createIterator:uzn,isValidHeaderName:OZi,isValidHeaderValue:azn,isErrorLike:PZi,fullyReadBody:ies,readableStreamClose:ses,urlIsLocal:pzn,urlHasHttpsScheme:lgt,urlIsHttpHttpsScheme:mzn,readAllBytes:dzn,simpleRangeHeaderValue:oes,buildContentRange:aes,createInflate:ces,extractMimeType:les,getDecodeSplit:hzn,environmentSettingsObject:hes,isOriginIPPotentiallyTrustworthy:lzn,hasAuthenticationEntry:des,includesCredentials:pes,isTraversableNavigable:mes}});var yY=re((EPc,hgt)=>{"use strict";p();var fes={__proto__:null,"node:crypto":()=>require("node:crypto"),"node:sqlite":()=>require("node:sqlite")};function ges(t){try{return fes[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}var gzn=["crypto","sqlite"];function Aes(t){if(gzn.includes(t))return ges(`node:${t}`);throw new TypeError(`unknown feature: ${t}`)}var mgt=class{#e=new Map;clear(){this.#e.clear()}has(e){return this.#e.get(e)??this.#t(e)}set(e,n){if(gzn.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,n)}#t(e){let n=Aes(e);return this.#e.set(e,n),n}},Azn=new mgt;hgt.exports.runtimeFeatures=Azn;hgt.exports.default=Azn});var JBe=re((_Pc,Ezn)=>{"use strict";p();var{iteratorMixin:yes}=OE(),{kEnumerableProperty:EY}=Zi(),{webidl:fa}=lh(),yzn=require("node:util"),{runtimeFeatures:Ees}=yY(),bes=Ees.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),Pw=class t{#e=[];#t=null;constructor(e=void 0){if(fa.util.markAsUncloneable(this),e!==void 0)throw fa.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,n,r=void 0){fa.brandCheck(this,t);let i="FormData.append";fa.argumentLengthCheck(arguments,2,i),e=fa.converters.USVString(e),arguments.length===3||fa.is.Blob(n)?(n=fa.converters.Blob(n,i,"value"),r!==void 0&&(r=fa.converters.USVString(r))):n=fa.converters.USVString(n);let s=fgt(e,n,r);this.#e.push(s)}delete(e){fa.brandCheck(this,t),fa.argumentLengthCheck(arguments,1,"FormData.delete"),e=fa.converters.USVString(e),this.#e=this.#e.filter(r=>r.name!==e)}get(e){fa.brandCheck(this,t),fa.argumentLengthCheck(arguments,1,"FormData.get"),e=fa.converters.USVString(e);let r=this.#e.findIndex(i=>i.name===e);return r===-1?null:this.#e[r].value}getAll(e){return fa.brandCheck(this,t),fa.argumentLengthCheck(arguments,1,"FormData.getAll"),e=fa.converters.USVString(e),this.#e.filter(r=>r.name===e).map(r=>r.value)}has(e){return fa.brandCheck(this,t),fa.argumentLengthCheck(arguments,1,"FormData.has"),e=fa.converters.USVString(e),this.#e.findIndex(r=>r.name===e)!==-1}set(e,n,r=void 0){fa.brandCheck(this,t);let i="FormData.set";fa.argumentLengthCheck(arguments,2,i),e=fa.converters.USVString(e),arguments.length===3||fa.is.Blob(n)?(n=fa.converters.Blob(n,i,"value"),r!==void 0&&(r=fa.converters.USVString(r))):n=fa.converters.USVString(n);let s=fgt(e,n,r),o=this.#e.findIndex(a=>a.name===e);o!==-1?this.#e=[...this.#e.slice(0,o),s,...this.#e.slice(o+1).filter(a=>a.name!==e)]:this.#e.push(s)}[yzn.inspect.custom](e,n){let r=this.#e.reduce((s,o)=>(s[o.name]?Array.isArray(s[o.name])?s[o.name].push(o.value):s[o.name]=[s[o.name],o.value]:s[o.name]=o.value,s),{__proto__:null});n.depth??=e,n.colors??=!0;let i=yzn.formatWithOptions(n,r);return`FormData ${i.slice(i.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,n){e.#e=n}static getFormDataBoundary(e){let n=e.#t;return n??(e.#t=`----formdata-undici-0${`${bes(1e11)}`.padStart(11,"0")}`)}},{getFormDataState:_es,setFormDataState:xes,getFormDataBoundary:Ses}=Pw;Reflect.deleteProperty(Pw,"getFormDataState");Reflect.deleteProperty(Pw,"setFormDataState");Reflect.deleteProperty(Pw,"getFormDataBoundary");yes("FormData",Pw,_es,"name","value");Object.defineProperties(Pw.prototype,{append:EY,delete:EY,get:EY,getAll:EY,has:EY,set:EY,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function fgt(t,e,n){if(typeof e!="string"){if(fa.is.File(e)||(e=new File([e],"blob",{type:e.type})),n!==void 0){let r={type:e.type,lastModified:e.lastModified};e=new File([e],n,r)}}return{name:t,value:e}}fa.is.FormData=fa.util.MakeTypeAssertion(Pw);Ezn.exports={FormData:Pw,makeEntry:fgt,setFormDataState:xes,getFormDataBoundary:Ses}});var xzn=re((SPc,_zn)=>{"use strict";p();var{bufferToLowerCasedHeaderName:Ces}=Zi(),{HTTP_TOKEN_CODEPOINTS:Ies}=Wb(),{makeEntry:wes}=JBe(),{webidl:ggt}=lh(),Agt=require("node:assert"),{isomorphicDecode:bzn}=Dw(),Tes=Buffer.from("--"),ygt=new TextDecoder,ves=new TextDecoder("utf-8",{ignoreBOM:!0});function Res(t){for(let e=0;e70)return!1;for(let n=0;n=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===39||r===45||r===95))return!1}return!0}function Bes(t,e){Agt(e!=="failure"&&e.essence==="multipart/form-data");let n=e.parameters.get("boundary");if(n===void 0)throw LA("missing boundary in content-type header");let r=Buffer.from(`--${n}`,"utf8"),i=[],s={position:0},o=t.indexOf(r);if(o===-1)throw LA("no boundary found in multipart body");for(s.position=o;;){if(t.subarray(s.position,s.position+r.length).equals(r))s.position+=r.length;else throw LA("expected a value starting with -- and the boundary");if(Pes(t,Tes,s))return i;if(t[s.position]!==13||t[s.position+1]!==10)throw LA("expected CRLF");s.position+=2;let a=Des(t,s),{name:c,filename:u,contentType:l,encoding:d}=a;s.position+=2;let m;{let f=t.indexOf(r.subarray(2),s.position);if(f===-1)throw LA("expected boundary after body");m=t.subarray(s.position,f-4),s.position+=m.length,d==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)throw LA("expected CRLF");s.position+=2;let h;u!==null?(l??="text/plain",Res(l)||(l=""),h=new File([m],u,{type:l})):h=ves.decode(Buffer.from(m)),Agt(ggt.is.USVString(c)),Agt(typeof h=="string"&&ggt.is.USVString(h)||ggt.is.File(h)),i.push(wes(c,h,u))}}function Nes(t,e){t[e.position]===59&&e.position++,Hb(o=>o===32||o===9,t,e);let n=Hb(o=>bgt(o)&&o!==61&&o!==42,t,e);if(n.length===0)return null;let r=n.toString("ascii").toLowerCase(),i=t[e.position]===42;if(i&&e.position++,t[e.position]!==61)return null;e.position++,Hb(o=>o===32||o===9,t,e);let s;if(i){let o=Hb(a=>a!==32&&a!==13&&a!==10&&a!==59,t,e);if(o[0]!==117&&o[0]!==85||o[1]!==116&&o[1]!==84||o[2]!==102&&o[2]!==70||o[3]!==45||o[4]!==56)throw LA("unknown encoding, expected utf-8''");s=decodeURIComponent(ygt.decode(o.subarray(7)))}else if(t[e.position]===34){e.position++;let o=Hb(a=>a!==10&&a!==13&&a!==34,t,e);if(t[e.position]!==34)throw LA("Closing quote not found");e.position++,s=ygt.decode(o).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let o=Hb(a=>bgt(a)&&a!==59,t,e);s=ygt.decode(o)}return{name:r,value:s,extended:i}}function Des(t,e){let n=null,r=null,i=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10){if(n===null)throw LA("header name is null");return{name:n,filename:r,contentType:i,encoding:s}}let o=Hb(a=>a!==10&&a!==13&&a!==58,t,e);if(o=Egt(o,!0,!0,a=>a===9||a===32),!Ies.test(o.toString()))throw LA("header name does not match the field-name token production");if(t[e.position]!==58)throw LA("expected :");switch(e.position++,Hb(a=>a===32||a===9,t,e),Ces(o)){case"content-disposition":{n=r=null;let a=!1;if(Hb(u=>bgt(u),t,e).toString("ascii").toLowerCase()!=="form-data")throw LA("expected form-data for content-disposition header");for(;e.positionc!==10&&c!==13,t,e);a=Egt(a,!1,!0,c=>c===9||c===32),i=bzn(a);break}case"content-transfer-encoding":{let a=Hb(c=>c!==10&&c!==13,t,e);a=Egt(a,!1,!0,c=>c===9||c===32),s=bzn(a);break}default:Hb(a=>a!==10&&a!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw LA("expected CRLF");e.position+=2}}function Hb(t,e,n){let r=n.position;for(;r0&&r(t[s]);)s--;return i===0&&s===t.length-1?t:t.subarray(i,s+1)}function Pes(t,e,n){if(t.length{"use strict";p();var Sgt=Zi(),{ReadableStreamFrom:Les,readableStreamClose:Fes,fullyReadBody:Qes,extractMimeType:Ues}=OE(),{FormData:Szn,setFormDataState:Ges,getFormDataBoundary:$es}=JBe(),{webidl:CS}=lh(),_gt=require("node:assert"),{isErrored:xgt,isDisturbed:Wes}=require("node:stream"),{isUint8Array:Hes}=require("node:util/types"),{serializeAMimeType:qes}=Wb(),{multipartFormDataParser:jes}=xzn(),{parseJSONFromBytes:Ves}=Dw(),{utf8DecodeBytes:Yes}=qBe(),{ReadableStreamTee:zes}=require("node:stream/web"),XBe=new TextEncoder;function Kes(){}var Jes=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!Wes(e)&&!xgt(e)&&e.cancel("Response object has been garbage collected").catch(Kes)});function Izn(t,e=!1){let n=null,r=null;CS.is.ReadableStream(t)?n=t:CS.is.Blob(t)?n=t.stream():n=new ReadableStream({pull(){},start(u){r=u},cancel(){},type:"bytes"}),_gt(CS.is.ReadableStream(n));let i=null,s=null,o=null,a=null;if(typeof t=="string")s=t,a="text/plain;charset=UTF-8";else if(CS.is.URLSearchParams(t))s=t.toString(),a="application/x-www-form-urlencoded;charset=UTF-8";else if(CS.is.BufferSource(t))s=CS.util.getCopyOfBytesHeldByBufferSource(t);else if(CS.is.FormData(t)){let u=$es(t),l=`--${u}\r +Content-Disposition: form-data`;let d=y=>y.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),m=y=>y.replace(/\r?\n|\r/g,`\r +`),h=[],f=new Uint8Array([13,10]);o=0;let g=!1;for(let[y,E]of t)if(typeof E=="string"){let _=XBe.encode(l+`; name="${d(m(y))}"\r +\r +${m(E)}\r +`);h.push(_),o+=_.byteLength}else{let _=XBe.encode(`${l}; name="${d(m(y))}"`+(E.name?`; filename="${d(E.name)}"`:"")+`\r +Content-Type: ${E.type||"application/octet-stream"}\r +\r +`);h.push(_,E,f),typeof E.size=="number"?o+=_.byteLength+E.size+f.byteLength:g=!0}let A=XBe.encode(`--${u}--\r +`);h.push(A),o+=A.byteLength,g&&(o=null),s=t,i=async function*(){for(let y of h)y.stream?yield*y.stream():yield y},a=`multipart/form-data; boundary=${u}`}else if(CS.is.Blob(t))s=t,o=t.size,t.type&&(a=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(Sgt.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");n=CS.is.ReadableStream(t)?t:Les(t)}return(typeof s=="string"||Hes(s))&&(i=()=>(o=typeof s=="string"?Buffer.byteLength(s):s.length,s)),i!=null&&(async()=>{let u=i(),l=u?.[Symbol.asyncIterator]?.();if(l)for await(let d of l){if(xgt(n))break;d.length&&r.enqueue(new Uint8Array(d))}else u?.length&&!xgt(n)&&r.enqueue(typeof u=="string"?XBe.encode(u):new Uint8Array(u));queueMicrotask(()=>Fes(r))})(),[{stream:n,source:s,length:o},a]}function Xes(t,e=!1){return CS.is.ReadableStream(t)&&(_gt(!Sgt.isDisturbed(t),"The body has already been consumed."),_gt(!t.locked,"The stream is locked.")),Izn(t,e)}function Zes(t){let{0:e,1:n}=zes?.(t.stream,!0)??t.stream.tee();return t.stream=e,{stream:n,length:t.length,source:t.source}}function ets(t,e){return{blob(){return bY(this,r=>{let i=Czn(e(this));return i===null?i="":i&&(i=qes(i)),new Blob([r],{type:i})},t,e)},arrayBuffer(){return bY(this,r=>new Uint8Array(r).buffer,t,e)},text(){return bY(this,Yes,t,e)},json(){return bY(this,Ves,t,e)},formData(){return bY(this,r=>{let i=Czn(e(this));if(i!==null)switch(i.essence){case"multipart/form-data":{let s=jes(r,i),o=new Szn;return Ges(o,s),o}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(r.toString()),o=new Szn;for(let[a,c]of s)o.append(a,c);return o}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t,e)},bytes(){return bY(this,r=>new Uint8Array(r),t,e)},textStream(){let r=e(this);if(Cgt(r))throw new TypeError("Body is unusable: Body has already been read");if(r.body==null){let o,a=new ReadableStream({start:c=>{o=c},pull:()=>Promise.resolve(),cancel:()=>Promise.resolve()},{size:()=>1});return o.close(),a}let i=r.body.stream,s=new TextDecoderStream("UTF-8");return i.pipeThrough(s)}}}function tts(t,e){Object.assign(t.prototype,ets(t,e))}function bY(t,e,n,r){try{CS.brandCheck(t,n)}catch(a){return Promise.reject(a)}if(t=r(t),Cgt(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let i=Promise.withResolvers(),s=i.reject,o=a=>{try{i.resolve(e(a))}catch(c){s(c)}};return t.body==null?(o(Buffer.allocUnsafe(0)),i.promise):(Qes(t.body,o,s),i.promise)}function Cgt(t){let e=t.body;return e!=null&&(e.stream.locked||Sgt.isDisturbed(e.stream))}function Czn(t){let e=t.headersList,n=Ues(e);return n==="failure"?null:n}wzn.exports={extractBody:Izn,safelyExtractBody:Xes,cloneBody:Zes,mixinBody:tts,streamRegistry:Jes,bodyUnusable:Cgt}});var Gzn=re((TPc,Uzn)=>{"use strict";p();var Ni=require("node:assert"),Xr=Zi(),{channels:Tzn}=gP(),Igt=rft(),{RequestContentLengthMismatchError:cU,ResponseContentLengthMismatchError:vzn,RequestAbortedError:Ozn,InvalidArgumentError:nts,HeadersTimeoutError:rts,HeadersOverflowError:its,SocketError:lU,InformationalError:SY,BodyTimeoutError:sts,HTTPParserError:ots,ResponseExceededMaxSizeError:ats}=Wi(),{kUrl:Lzn,kReset:FA,kClient:nNe,kParser:pl,kBlocking:Poe,kRunning:Fd,kPending:Dgt,kSize:Rzn,kWriting:xP,kQueue:IS,kNoRef:Noe,kKeepAliveDefaultTimeout:cts,kHostHeader:lts,kPendingIdx:uts,kRunningIdx:qb,kError:wg,kPipelining:eNe,kSocket:uU,kKeepAliveTimeoutValue:rNe,kMaxHeadersSize:dts,kKeepAliveMaxTimeout:pts,kKeepAliveTimeoutThreshold:mts,kHeadersTimeout:hts,kBodyTimeout:fts,kStrictContentLength:Rgt,kMaxRequests:kzn,kCounter:gts,kMaxResponseSize:Ats,kOnError:Bzn,kResume:lk,kHTTPContext:Fzn,kClosed:kgt}=Oo(),LE=k6n(),wgt=Buffer.alloc(0),ZBe=Buffer[Symbol.species],yts=Xr.removeAllListeners,dU=Symbol("kIdleSocketValidation"),CY=Symbol("kIdleSocketValidationTimeout"),Pgt=Symbol("kSocketUsed"),Nzn=Symbol("kTypeOfService"),Tgt;function Ets(){let t=process.env.JEST_WORKER_ID?Jft():void 0,e,n=process.arch!=="ppc64";if(process.env.UNDICI_NO_WASM_SIMD==="1"?n=!1:process.env.UNDICI_NO_WASM_SIMD==="0"&&(n=!0),n)try{e=new WebAssembly.Module(D6n())}catch{}return e||(e=new WebAssembly.Module(t||Jft())),new WebAssembly.Instance(e,{env:{wasm_on_url:(r,i,s)=>0,wasm_on_status:(r,i,s)=>{Ni(Qu.ptr===r);let o=i-wS+Mw.byteOffset;return Qu.onStatus(new ZBe(Mw.buffer,o,s))},wasm_on_message_begin:r=>(Ni(Qu.ptr===r),Qu.onMessageBegin()),wasm_on_header_field:(r,i,s)=>{Ni(Qu.ptr===r);let o=i-wS+Mw.byteOffset;return Qu.onHeaderField(new ZBe(Mw.buffer,o,s))},wasm_on_header_value:(r,i,s)=>{Ni(Qu.ptr===r);let o=i-wS+Mw.byteOffset;return Qu.onHeaderValue(new ZBe(Mw.buffer,o,s))},wasm_on_headers_complete:(r,i,s,o)=>(Ni(Qu.ptr===r),Qu.onHeadersComplete(i,s===1,o===1)),wasm_on_body:(r,i,s)=>{Ni(Qu.ptr===r);let o=i-wS+Mw.byteOffset;return Qu.onBody(new ZBe(Mw.buffer,o,s))},wasm_on_message_complete:r=>(Ni(Qu.ptr===r),Qu.onMessageComplete())}})}var vgt=null,Qu=null,Mw=null,Boe=0,wS=null,xY=null,bts=0,Doe=1,IY=2|Doe,tNe=4|Doe,Bgt=8|bts,Ngt=class{constructor(e,n,{exports:r}){this.llhttp=r,this.ptr=this.llhttp.llhttp_alloc(LE.TYPE.RESPONSE),this.client=e,this.socket=n,this.timeout=null,this.timeoutWeakRef=new WeakRef(this),this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[dts],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength=-1,this.connectionKeepAlive=!1,this.maxResponseSize=e[Ats]}setTimeout(e,n){e!==this.timeoutValue||n&Doe^this.timeoutType&Doe?(this.timeout&&(Igt.clearTimeout(this.timeout),this.timeout=null),e&&(n&Doe?this.timeout=Igt.setFastTimeout(Dzn,e,this.timeoutWeakRef):(this.timeout=setTimeout(Dzn,e,this.timeoutWeakRef),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=n}resume(){this.socket.destroyed||!this.paused||(Ni(this.ptr!=null),Ni(Qu===null),this.llhttp.llhttp_resume(this.ptr),Ni(this.timeoutType===tNe),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||wgt),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Ni(Qu===null),Ni(this.ptr!=null),Ni(!this.paused);let{socket:n,llhttp:r}=this;e.length>Boe&&(wS&&r.free(wS),Boe=Math.ceil(e.length/4096)*4096,wS=r.malloc(Boe)),(xY===null||xY.buffer!==r.memory.buffer||xY.byteOffset!==wS||xY.byteLength!==Boe)&&(xY=new Uint8Array(r.memory.buffer,wS,Boe)),xY.set(e);try{let i;try{Mw=e,Qu=this,i=r.llhttp_execute(this.ptr,wS,e.length)}finally{Qu=null,Mw=null}if(i!==LE.ERROR.OK){let s=e.subarray(r.llhttp_get_error_pos(this.ptr)-wS);if(i===LE.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(i===LE.ERROR.PAUSED)this.paused=!0,n.unshift(s);else throw this.createError(i,s)}}catch(i){Xr.destroy(n,i)}}finish(){Ni(Qu===null),Ni(this.ptr!=null);let{llhttp:e}=this;if(this.paused){let r;do e.llhttp_resume(this.ptr),this.paused=!1,r=this.socket.read()||wgt,this.execute(r);while(this.paused&&r.length>0);this.paused&&(e.llhttp_resume(this.ptr),this.paused=!1)}let n;try{Qu=this,n=e.llhttp_finish(this.ptr)}finally{Qu=null}return n===LE.ERROR.OK?null:n===LE.ERROR.PAUSED||n===LE.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(n,wgt)}createError(e,n){let{llhttp:r,contentLength:i,bytesRead:s}=this;if(i!==-1&&s!==i)return new vzn;let o=r.llhttp_get_error_reason(this.ptr),a="";if(o){let c=new Uint8Array(r.memory.buffer,o).indexOf(0);a="Response does not match the HTTP/1.1 protocol ("+Buffer.from(r.memory.buffer,o,c).toString()+")"}return new ots(a,LE.ERROR[e],n)}destroy(){Ni(Qu===null),Ni(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Igt.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){let{socket:e,client:n}=this;if(e.destroyed)return-1;if(n[Fd]===0)return Xr.destroy(e,new lU("bad response",Xr.getSocketInfo(e))),-1;let r=n[IS][n[qb]];return r?(r.onResponseStarted(),0):-1}onHeaderField(e){let n=this.headers.length;return(n&1)===0?this.headers.push(e):this.headers[n-1]=Buffer.concat([this.headers[n-1],e]),this.trackHeader(e.length),0}onHeaderValue(e){let n=this.headers.length;(n&1)===1?(this.headers.push(e),n+=1):this.headers[n-1]=Buffer.concat([this.headers[n-1],e]);let r=this.headers[n-2];if(r.length===10){let i=Xr.bufferToLowerCasedHeaderName(r);i==="keep-alive"?this.keepAlive+=e.toString():i==="connection"&&(this.connectionKeepAlive=this.headers[n-1].length===10&&Xr.bufferToLowerCasedHeaderName(this.headers[n-1])==="keep-alive")}else if(r.length===14&&Xr.bufferToLowerCasedHeaderName(r)==="content-length"){this.contentLength===-1&&(this.contentLength=0);for(let i=0;i=this.headersMaxSize&&Xr.destroy(this.socket,new its)}onUpgrade(e){let{upgrade:n,client:r,socket:i,headers:s,statusCode:o}=this;Ni(n),Ni(r[uU]===i),Ni(!i.destroyed),Ni(!this.paused),Ni((s.length&1)===0);let a=r[IS][r[qb]];Ni(a),Ni(a.upgrade||a.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,i.unshift(e),i[pl].destroy(),i[pl]=null,i[nNe]=null,i[wg]=null,yts(i),r[uU]=null,r[Fzn]=null,r[IS][r[qb]++]=null,r.emit("disconnect",r[Lzn],[r],new SY("upgrade"));try{a.onRequestUpgrade(o,s,i)}catch(c){Xr.destroy(i,c)}r[lk]()}onHeadersComplete(e,n,r){let{client:i,socket:s,headers:o,statusText:a}=this;if(s.destroyed)return-1;if(i[Fd]===0)return Xr.destroy(s,new lU("bad response",Xr.getSocketInfo(s))),-1;let c=i[IS][i[qb]];if(!c)return-1;if(Ni(!this.upgrade),Ni(this.statusCode<200),e===100)return Xr.destroy(s,new lU("bad response",Xr.getSocketInfo(s))),-1;if(n&&!c.upgrade)return Xr.destroy(s,new lU("bad upgrade",Xr.getSocketInfo(s))),-1;if(Ni(this.timeoutType===IY),this.statusCode=e,this.shouldKeepAlive=r||c.method==="HEAD"&&!s[FA]&&this.connectionKeepAlive,this.statusCode>=200){let l=c.bodyTimeout!=null?c.bodyTimeout:i[fts];this.setTimeout(l,tNe)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(c.method==="CONNECT")return Ni(i[Fd]===1),this.upgrade=!0,2;if(n)return Ni(i[Fd]===1),this.upgrade=!0,2;if(Ni((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&i[eNe]){let l=this.keepAlive?Xr.parseKeepAliveTimeout(this.keepAlive):null;if(l!=null){let d=Math.min(l-i[mts],i[pts]);d<=0?s[FA]=!0:i[rNe]=d}else i[rNe]=i[cts]}else s[FA]=!0;let u=c.onResponseStart(e,o,this.resume,a)===!1;return c.aborted?-1:c.method==="HEAD"||e<200?1:(s[Poe]&&(s[Poe]=!1,i[lk]()),u?LE.ERROR.PAUSED:0)}onBody(e){let{client:n,socket:r,statusCode:i,maxResponseSize:s}=this;if(r.destroyed)return-1;let o=n[IS][n[qb]];return Ni(o),Ni(this.timeoutType===tNe),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Ni(i>=200),s>-1&&this.bytesRead+e.length>s?(Xr.destroy(r,new ats),-1):(this.bytesRead+=e.length,o.onResponseData(e)===!1?LE.ERROR.PAUSED:0)}onMessageComplete(){let{client:e,socket:n,statusCode:r,upgrade:i,headers:s,contentLength:o,bytesRead:a,shouldKeepAlive:c}=this;if(n.destroyed&&(!r||c))return-1;if(i)return 0;Ni(r>=100),Ni((this.headers.length&1)===0);let u=e[IS][e[qb]];if(Ni(u),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength=-1,this.keepAlive="",this.connectionKeepAlive=!1,this.headers=[],this.headersSize=0,r<200)return 0;if(u.method!=="HEAD"&&o!==-1&&a!==o)return Xr.destroy(n,new vzn),-1;if(u.onResponseEnd(s),e[IS][e[qb]++]=null,n[Pgt]=e[Dgt]===0,n[xP])return Ni(e[Fd]===0),Xr.destroy(n,new SY("reset")),LE.ERROR.PAUSED;if(c){if(n[FA]&&e[Fd]===0)return Xr.destroy(n,new SY("reset")),LE.ERROR.PAUSED;e[eNe]==null||e[eNe]===1?setImmediate(e[lk]):e[lk]()}else return Xr.destroy(n,new SY("reset")),LE.ERROR.PAUSED;return 0}};function Dzn(t){let e=t.deref();if(!e)return;let{socket:n,timeoutType:r,client:i,paused:s}=e;r===IY?(!n[xP]||n.writableNeedDrain||i[Fd]>1)&&(Ni(!s,"cannot be paused while waiting for headers"),Xr.destroy(n,new rts)):r===tNe?s||Xr.destroy(n,new sts):r===Bgt&&(Ni(i[Fd]===0&&i[rNe]),Xr.destroy(n,new SY("socket idle timeout")))}function _ts(t,e){if(t[uU]=e,vgt||(vgt=Ets()),e.errored)throw e.errored;if(e.destroyed)throw new lU("destroyed");return e[Noe]=!1,e[xP]=!1,e[FA]=!1,e[Poe]=!1,e[dU]=0,e[CY]=null,e[Pgt]=!1,e[pl]=new Ngt(t,e,vgt),Xr.addListener(e,"error",xts),Xr.addListener(e,"readable",Sts),Xr.addListener(e,"end",Cts),Xr.addListener(e,"close",Its),e[kgt]=!1,e.on("close",wts),{version:"h1",defaultPipelining:1,write(n){return Bts(t,n)},resume(){vts(t)},destroy(n,r){e[kgt]?queueMicrotask(r):(e.on("close",r),e.destroy(n))},get destroyed(){return e.destroyed},busy(n){return!!(e[xP]||e[FA]||e[Poe]||e[dU]===1||n&&(t[Fd]>0&&!n.idempotent||t[Fd]>0&&(n.upgrade||n.method==="CONNECT")||t[Fd]>0&&Xr.bodyLength(n.body)!==0&&(Xr.isStream(n.body)||Xr.isAsyncIterable(n.body)||Xr.isFormDataLike(n.body))))}}}function xts(t){Ni(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[pl];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let n=e.finish();n&&(this[wg]=n,this[nNe][Bzn](n));return}this[wg]=t,this[nNe][Bzn](t)}function Sts(){this[pl]?.readMore()}function Cts(){let t=this[pl];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Xr.destroy(this,e);return}Xr.destroy(this,new lU("other side closed",Xr.getSocketInfo(this)))}function Its(){let t=this[pl];Qzn(this),t&&(!this[wg]&&t.statusCode&&!t.shouldKeepAlive&&(this[wg]=t.finish()||this[wg]),this[pl].destroy(),this[pl]=null);let e=this[wg]||new lU("closed",Xr.getSocketInfo(this)),n=this[nNe];if(n[uU]=null,n[Fzn]=null,n.destroyed){Ni(n[Dgt]===0);let r=n[IS].splice(n[qb]);for(let i=0;i0&&e.code!=="UND_ERR_INFO"){let r=n[IS][n[qb]];n[IS][n[qb]++]=null,Xr.errorRequest(n,r,e)}n[uts]=n[qb],Ni(n[Fd]===0),n.emit("disconnect",n[Lzn],[n],e),n[lk]()}function wts(){this[kgt]=!0}function Qzn(t){t[CY]&&(clearImmediate(t[CY]),t[CY]=null),t[dU]=0}function Tts(t,e){e[dU]=1,e[CY]=setImmediate(()=>{e[CY]=null,e[dU]=2,t[uU]===e&&!e.destroyed&&t[lk]()})}function vts(t){let e=t[uU];if(e&&!e.destroyed){if(t[Rzn]===0?!e[Noe]&&e.unref&&(e.unref(),e[Noe]=!0):e[Noe]&&e.ref&&(e.ref(),e[Noe]=!1),t[Fd]===0&&t[Dgt]>0&&e[Pgt]){if(e[dU]===0)return Tts(t,e),e[pl].readMore(),e.destroyed,void 0;if(e[dU]===1)return e[pl].readMore(),e.destroyed,void 0}if(t[Fd]===0&&(e[pl].readMore(),e.destroyed))return;if(t[Rzn]===0)e[pl].timeoutType!==Bgt&&e[pl].setTimeout(t[rNe],Bgt);else if(t[Fd]>0&&e[pl].statusCode<200&&e[pl].timeoutType!==IY){let n=t[IS][t[qb]],r=n.headersTimeout!=null?n.headersTimeout:t[hts];e[pl].setTimeout(r,IY)}}}function Rts(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}function kts(t,e){if(typeof t.setTypeOfService!="function")return;let n=e.typeOfService;if(!(n===void 0||t[Nzn]===n))try{t.setTypeOfService(n),t[Nzn]=n}catch{}}function Bts(t,e){let{method:n,path:r,host:i,upgrade:s,blocking:o,reset:a}=e,{body:c,headers:u,contentLength:l}=e,d=n==="PUT"||n==="POST"||n==="PATCH"||n==="QUERY"||n==="PROPFIND"||n==="PROPPATCH";if(Xr.isFormDataLike(c)){Tgt||(Tgt=_Y().extractBody);let[A,y]=Tgt(c);e.contentType==null&&u.push("content-type",y),c=A.stream,l=A.length}else if(Xr.isBlobLike(c)&&e.contentType==null){let A=c.type;if(A){let y=`${A}`;if(!Xr.isValidHeaderValue(y))return Xr.errorRequest(t,e,new nts("invalid content-type header")),!1;u.push("content-type",y)}}c&&typeof c.read=="function"&&c.read(0);let m=Xr.bodyLength(c);if(l=m??l,l===null&&(l=e.contentLength),l===0&&!d&&(l=null),Rts(n)&&l>0&&e.contentLength!==null&&e.contentLength!==l){if(t[Rgt])return Xr.errorRequest(t,e,new cU),!1;process.emitWarning(new cU)}let h=t[uU];Qzn(h);let f=A=>{e.aborted||e.completed||(Xr.errorRequest(t,e,A||new Ozn),Xr.destroy(c),Xr.destroy(h,new SY("aborted")))};try{e.onRequestStart(f,null)}catch(A){Xr.errorRequest(t,e,A)}if(e.aborted)return!1;n==="HEAD"&&(h[FA]=!0),(s||n==="CONNECT")&&(h[FA]=!0),a!=null&&(h[FA]=a),t[kzn]&&++h[gts]>=t[kzn]&&(h[FA]=!0),o&&(h[Poe]=!0),kts(h,e);let g=`${n} ${r} HTTP/1.1\r +`;if(typeof i=="string"?g+=`host: ${i}\r +`:g+=t[lts],s?g+=`connection: upgrade\r +upgrade: ${s}\r +`:t[eNe]&&!h[FA]?g+=`connection: keep-alive\r +`:g+=`connection: close\r +`,Array.isArray(u))for(let A=0;A{e.removeListener("error",h)}),!c){let f=new Ozn;queueMicrotask(()=>h(f))}},h=function(f){if(!c){if(c=!0,Ni(i.destroyed||i[xP]&&n[Fd]<=1),i.off("drain",d).off("error",h),e.removeListener("data",l).removeListener("end",h).removeListener("close",m),!f)try{u.end()}catch(g){f=g}u.destroy(f),f&&(f.code!=="UND_ERR_INFO"||f.message!=="reset")?Xr.destroy(e,f):Xr.destroy(e)}};e.on("data",l).on("end",h).on("error",h).on("close",m),e.resume&&e.resume(),i.on("drain",d).on("error",h),e.errorEmitted??e.errored?setImmediate(h,e.errored):(e.endEmitted??e.readableEnded)&&setImmediate(h,null),(e.closeEmitted??e.closed)&&setImmediate(m)}function Pzn(t,e,n,r,i,s,o,a){try{e?Xr.isBuffer(e)&&(Ni(s===e.byteLength,"buffer body must have content length"),i.cork(),i.write(`${o}content-length: ${s}\r +\r +`,"latin1"),i.write(e),i.uncork(),r.onBodySent(e),!a&&r.reset!==!1&&(i[FA]=!0)):s===0?i.write(`${o}content-length: 0\r +\r +`,"latin1"):(Ni(s===null,"no body must not have content length"),i.write(`${o}\r +`,"latin1")),r.onRequestSent(),n[lk]()}catch(c){t(c)}}async function Dts(t,e,n,r,i,s,o,a){try{if(s!=null&&s!==e.size)throw new cU;let c=Buffer.from(await e.arrayBuffer());i.cork(),i.write(`${o}content-length: ${s}\r +\r +`,"latin1"),i.write(c),i.uncork(),r.onBodySent(c),r.onRequestSent(),!a&&r.reset!==!1&&(i[FA]=!0),n[lk]()}catch(c){t(c)}}async function Mzn(t,e,n,r,i,s,o,a){Ni(s!==0||n[Fd]===0,"iterator body cannot be pipelined");let c=null;function u(){if(c){let m=c;c=null,m()}}let l=()=>new Promise((m,h)=>{Ni(c===null),i[wg]?h(i[wg]):c=m});i.on("close",u).on("drain",u);let d=new iNe({abort:t,socket:i,request:r,contentLength:s,client:n,expectsPayload:a,header:o});try{for await(let m of e){if(i[wg])throw i[wg];d.write(m)||await l()}d.end()}catch(m){d.destroy(m)}finally{i.off("close",u).off("drain",u)}}var iNe=class{constructor({abort:e,socket:n,request:r,contentLength:i,client:s,expectsPayload:o,header:a}){this.socket=n,this.request=r,this.contentLength=i,this.client=s,this.bytesWritten=0,this.expectsPayload=o,this.header=a,this.abort=e,n[xP]=!0}write(e){let{socket:n,request:r,contentLength:i,client:s,bytesWritten:o,expectsPayload:a,header:c}=this;if(n[wg])throw n[wg];if(n.destroyed)return!1;let u=e instanceof Uint8Array?e.byteLength:Buffer.byteLength(e);if(!u)return!0;if(i!==null&&o+u>i){if(s[Rgt])throw new cU;process.emitWarning(new cU)}n.cork(),o===0&&(!a&&r.reset!==!1&&(n[FA]=!0),i===null?n.write(`${c}transfer-encoding: chunked\r +`,"latin1"):n.write(`${c}content-length: ${i}\r +\r +`,"latin1")),i===null&&n.write(`\r +${u.toString(16)}\r +`,"latin1"),this.bytesWritten+=u;let l=n.write(e);return n.uncork(),r.onBodySent(e),l||n[pl].timeout&&n[pl].timeoutType===IY&&n[pl].timeout.refresh&&n[pl].timeout.refresh(),l}end(){let{socket:e,contentLength:n,client:r,bytesWritten:i,expectsPayload:s,header:o,request:a}=this;if(a.onRequestSent(),e[xP]=!1,e[wg])throw e[wg];if(!e.destroyed){if(i===0?s?e.write(`${o}content-length: 0\r +\r +`,"latin1"):e.write(`${o}\r +`,"latin1"):n===null&&e.write(`\r +0\r +\r +`,"latin1"),n!==null&&i!==n){if(r[Rgt])throw new cU;process.emitWarning(new cU)}e[pl].timeout&&e[pl].timeoutType===IY&&e[pl].timeout.refresh&&e[pl].timeout.refresh(),r[lk]()}}destroy(e){let{socket:n,client:r,abort:i}=this;n[xP]=!1,e&&(Ni(r[Fd]<=1,"pipeline should only contain this request"),i(e))}};Uzn.exports=_ts});var y7n=re((RPc,A7n)=>{"use strict";p();var Lw=require("node:assert"),{pipeline:Pts}=require("node:stream"),Bs=Zi(),{RequestContentLengthMismatchError:Lgt,RequestAbortedError:Mts,SocketError:Foe,InformationalError:Tg,InvalidArgumentError:Ots,HeadersTimeoutError:Jzn,BodyTimeoutError:Lts,ResponseExceededMaxSizeError:Fts}=Wi(),{kUrl:Ugt,kReset:uNe,kClient:uh,kRunning:SP,kPending:Ggt,kQueue:Ow,kPendingIdx:FE,kRunningIdx:pU,kError:Qd,kSocket:yc,kStrictContentLength:Qts,kOnError:kY,kMaxConcurrentStreams:vY,kHTTP2Session:ml,kHostAuthority:Uts,kResume:uk,kSize:sNe,kHTTPContext:dNe,kClosed:Fgt,kKeepAliveDefaultTimeout:Gts,kHeadersTimeout:$gt,kBodyTimeout:$ts,kEnableConnectProtocol:Ooe,kRemoteSettings:wY,kHTTP2Stream:Xzn,kHTTP2SessionState:TS,kHTTP2Options:Moe,kMaxResponseSize:Wts}=Oo(),{channels:$zn}=gP(),CP=Symbol("open streams"),oNe=Symbol("request stream id"),mU=Symbol("request stream"),aNe=Symbol("request stream cleanup"),au=Symbol("request stream state"),hU=Symbol("received goaway"),Wzn=Symbol("goaway replay attempts"),Hzn=Symbol("refused stream retry"),Hts=1,qzn,cNe;try{cNe=require("node:http2")}catch{cNe={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:qts,HTTP2_HEADER_METHOD:jzn,HTTP2_HEADER_PATH:Vzn,HTTP2_HEADER_SCHEME:Mgt,HTTP2_HEADER_CONTENT_LENGTH:jts,HTTP2_HEADER_EXPECT:Vts,HTTP2_HEADER_STATUS:RY,HTTP2_HEADER_PROTOCOL:Yts,NGHTTP2_NO_ERROR:Zzn,NGHTTP2_REFUSED_STREAM:e7n}}=cNe;function zts(t,e){return t[Qd]||(e===Zzn?new Tg(`HTTP/2: "GOAWAY" frame received with code ${e}`):new Foe(`HTTP/2: "GOAWAY" frame received with code ${e}`,Bs.getSocketInfo(t[yc])))}function t7n(t,e){let n=t[uh],r=t[yc];if(n[ml]===t&&(n[yc]=null,n[dNe]=null,n[ml]=null),r!=null&&r[Qd]==null&&(r[Qd]=e),!t.closed&&!t.destroyed)try{t.destroy(e)}catch{}Bs.destroy(r,e)}function Kts(t,e){let n=Number.isInteger(e)?e:Number.MAX_SAFE_INTEGER;for(let r=t[pU];rn))return r}return t[FE]}function Qoe(t){t[oNe]=null,t[mU]=null,t[aNe]=null}function n7n(t,e,n){let r=t[aNe],i=t[mU];Qoe(t),r?.(i),t[oNe]=e.id,t[mU]=e,t[aNe]=n}function r7n(t){let e=t[aNe],n=t[mU];Qoe(t),e?.(n)}function Jts(t,e){t[Ow].splice(t[FE]+1,0,e)}function i7n(t,e,n=!1){let r=t[Ow],i=t[pU];if(i=t[FE]||(r.splice(s,1),t[FE]--,n&&t[FE]e,peerMaxConcurrentStreams:t[Moe].maxConcurrentStreams,settings:{enablePush:!1,...n!=null?{initialWindowSize:n}:null}});return t[yc]=e,i[CP]=0,i[uh]=t,i[yc]=e,i[TS]={idleTimeout:null,noStreamsTimeout:null,refed:!0,ping:{interval:t[Moe].pingInterval===0?null:setInterval(cns,t[Moe].pingInterval,i).unref()}},i[hU]=!1,i[Ooe]=!1,i[wY]=!1,r&&Bs.addListener(i,"connect",ons.bind(i,r)),Bs.addListener(i,"error",lns),Bs.addListener(i,"frameError",uns),Bs.addListener(i,"goaway",dns),Bs.addListener(i,"close",pns),Bs.addListener(i,"remoteSettings",ans),TY(i),t[ml]=i,e[ml]=i,Bs.addListener(e,"error",hns),Bs.addListener(e,"end",fns),Bs.addListener(e,"close",mns),e[Fgt]=!1,e.on("close",gns),{version:"h2",defaultPipelining:1/0,write(s){return Ens(t,s)},resume(){nns(t)},destroy(s,o){e[Fgt]?queueMicrotask(o):e.destroy(s).on("close",o)},get destroyed(){return e.destroyed},busy(s){if(i[wY]===!1&&t[SP]>0||t[SP]>=t[vY])return!0;if(s!=null)if(t[SP]>0){if((s.upgrade==="websocket"||s.method==="CONNECT")&&i[wY]===!1)return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&i[wY]===!1;return!1}}}function Qgt(t){let e=t[TS];e.refed===!1&&(e.refed=!0,t.ref())}function TY(t){let e=t[TS];e.refed===!0&&(e.refed=!1,t.unref())}function nns(t){let e=t[yc],n=t[ml];e?.destroyed===!1&&(t[sNe]===0||t[vY]===0?TY(n):Qgt(n),t[sNe]===0&&n[CP]===0?a7n(n):BY(n),t[vY]===0&&t[SP]===0&&t[Ggt]>0?rns(n):Wgt(n))}function Wgt(t){let e=t[TS];e?.noStreamsTimeout!=null&&(clearTimeout(e.noStreamsTimeout),e.noStreamsTimeout=null)}function rns(t){let e=t[uh],n=t[TS],r=e[$gt];!r||n.noStreamsTimeout!=null||(n.noStreamsTimeout=setTimeout(ins,r,t).unref())}function ins(t){let e=t[uh],n=t[TS];if(n.noStreamsTimeout=null,e[ml]!==t||e[vY]!==0||e[SP]!==0||e[Ggt]===0)return;let r=new Jzn(`HTTP/2: server did not accept a new stream within ${e[$gt]}`),i=e[Ow].splice(e[FE]);for(let s=0;s{if(!(e.aborted||e.completed)){if(C=C||new Mts,Bs.errorRequest(t,e,C),f.stream!=null){r7n(e);let w=f.stream;w.close(),w.destroyed||Bs.destroy(w),t[kY](C),jgt(f,I)}Bs.destroy(f.body,C)}};f.abort=g;let A=null;try{e.onRequestStart(g,null)}catch(C){Bs.errorRequest(t,e,C)}if(e.aborted)return!1;if(c||s==="CONNECT")return Qgt(i),c==="websocket"?i[Ooe]===!1?(Bs.errorRequest(t,e,new Tg("HTTP/2: Extended CONNECT protocol not supported by server")),TY(i),!1):(h[jzn]="CONNECT",h[Yts]="websocket",h[Vzn]=o,d==="ws:"||d==="wss:"?h[Mgt]=d==="ws:"?"http":"https":h[Mgt]=d==="http:"?"http":"https",A=Ogt(t,e,i,g,h,{endStream:!1,signal:l}),A==null?(TY(i),!1):(Yzn(A,f),!0)):(A=Ogt(t,e,i,g,h,{endStream:!1,signal:l}),A==null?(TY(i),!1):(Yzn(A,f),!0));h[Vzn]=o,h[Mgt]=d==="http:"?"http":"https";let y=s==="PUT"||s==="POST"||s==="PATCH"||s==="QUERY"||s==="PROPFIND"||s==="PROPPATCH",E=f.body;E&&typeof E.read=="function"&&E.read(0);let _=Bs.bodyLength(E);if(Bs.isFormDataLike(E)){qzn??=_Y().extractBody;let[C,I]=qzn(E);h["content-type"]=I,E=C.stream,_=C.length}if(_==null&&(_=e.contentLength),_===0&&!y&&(_=null),Ans(s)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[Qts])return Bs.errorRequest(t,e,new Lgt),!1;process.emitWarning(new Lgt)}if(_!=null&&(Lw(E||_===0,"no body must not have content length"),h[jts]=`${_}`),Qgt(i),$zn.sendHeaders.hasSubscribers){let C="";for(let I in h)C+=`${I}: ${h[I]}\r +`;$zn.sendHeaders.publish({request:e,headers:C,socket:i[yc]})}let S=E===null||_===0;return f.body=E,f.contentLength=_,f.expectsPayload=y,u&&(h[Vts]="100-continue"),A=Ogt(t,e,i,g,h,{endStream:S,signal:l}),A==null?!1:(A[Xzn]=!0,A[au]=f,f.stream=A,BY(i),++i[CP],n&&A.setTimeout(n),A[ml]=i,A.on("close",qgt),n7n(e,A,Vgt),u&&A.once("continue",lNe),A.on("response",Ygt),A.on("headers",f7n),A.on("end",zgt),A.on("error",Kgt),A.on("frameError",Jgt),A.on("aborted",g7n),(n||r)&&A.on("timeout",Xgt),A.on("trailers",Zgt),u||lNe.call(A),!0)}function bns(t){t.off("error",fU),t.off("continue",lNe),t.off("response",Ygt),t.off("headers",f7n),t.off("end",zgt),t.off("error",Kgt),t.off("frameError",Jgt),t.off("aborted",g7n),t.off("timeout",Xgt),t.off("trailers",Zgt),t.off("data",pNe)}function Vgt(t){if(t==null)return;let e=t[au];if(e==null)return;let{request:n}=e;n[mU]===t&&Qoe(n),!t.destroyed&&!t.closed&&(bns(t),t.once("error",fU))}function pNe(t){let e=this,n=e[au];if(n==null)return;let{request:r,maxResponseSize:i}=n;if(!(r.aborted||r.completed)){if(i>-1&&n.bytesRead+t.length>i){n.abort(new Fts);return}n.bytesRead+=t.length,r.onResponseData(t)===!1&&e.pause()}}function f7n(t){let n=this[au];if(n==null)return;let{request:r}=n;if(r.aborted||r.completed)return;let i=t[RY];delete t[RY],r.onResponseStart(Number(i),t,fU,"")}function Ygt(t){let e=this,n=e[au];if(n==null)return;let{request:r}=n;e.off("response",Ygt),n.body!=null&&!n.bodySent&&!e.writableEnded&&(e.removeListener("continue",lNe),e.end());let i=t[RY];if(delete t[RY],r.onResponseStarted(),n.responseReceived=!0,(n.headersTimeout||n.bodyTimeout)&&e.setTimeout(n.bodyTimeout),r.aborted||r.completed){Vgt(e);return}r.onResponseStart(Number(i),t,e.resume.bind(e),"")===!1&&e.pause(),e.on("data",pNe)}function zgt(){let t=this,e=t[au];if(e==null)return;let{request:n}=e;t.off("end",zgt),e.responseReceived?!n.aborted&&!n.completed&&(e.pendingEnd=!0,qgt.call(t)):e.abort(new Tg("HTTP/2: stream half-closed (remote)"),!0)}function _ns(t,e){let{client:n,request:r}=e;return e.responseReceived||r.aborted||r.completed||r[Hzn]||!s7n(r)?!1:(r[Hzn]=!0,o7n(r),e.stream=null,e.requestFinalized=!0,i7n(n,r),n[Ow].splice(n[FE],0,r),n[uk](),!0)}function Kgt(t){let e=this,n=e[au];n!=null&&(e.off("error",Kgt),typeof e.rstCode=="number"&&e.rstCode!==Zzn&&(t.http2ErrorCode=e.rstCode),!(e.rstCode===e7n&&_ns(e,n))&&n.abort(t))}function Jgt(t,e){let n=this,r=n[au];r!=null&&(n.off("frameError",Jgt),r.abort(new Tg(`HTTP/2: "frameError" received - type ${t}, code ${e}`)))}function g7n(){this.off("data",pNe)}function Xgt(){let t=this,e=t[au];if(e==null)return;t.off("timeout",Xgt);let n=e.responseReceived?new Lts(`HTTP/2: "stream timeout after ${e.bodyTimeout}"`):new Jzn(`HTTP/2: "headers timeout after ${e.headersTimeout}"`);e.abort(n)}function Zgt(t){let e=this,n=e[au];if(n==null)return;let{request:r}=n;e.off("trailers",Zgt),e.off("data",pNe),!(r.aborted||r.completed)&&(n.trailers=t)}function lNe(){let t=this,e=t[au];e.bodySent=!0;let{abort:n,body:r,client:i,contentLength:s,expectsPayload:o,request:a}=e;!r||s===0?zzn(n,t,null,i,a,i[yc],s,o):Bs.isBuffer(r)?zzn(n,t,r,i,a,i[yc],s,o):Bs.isBlobLike(r)?typeof r.stream=="function"?Kzn(n,t,r.stream(),i,a,i[yc],s,o):Sns(n,t,r,i,a,i[yc],s,o):Bs.isStream(r)?xns(n,i[yc],o,t,r,i,a,s):Bs.isIterable(r)?Kzn(n,t,r,i,a,i[yc],s,o):Lw(!1)}function zzn(t,e,n,r,i,s,o,a){try{n!=null&&Bs.isBuffer(n)&&(Lw(o===n.byteLength,"buffer body must have content length"),e.cork(),e.write(n),e.uncork(),e.end(),i.onBodySent(n)),a||(s[uNe]=!0),i.onRequestSent(),r[uk]()}catch(c){t(c)}}function xns(t,e,n,r,i,s,o,a){Lw(a!==0||s[SP]===0,"stream body cannot be pipelined");let c=Pts(i,r,l=>{l?(Bs.destroy(c,l),t(l)):(Bs.removeAllListeners(c),o.onRequestSent(),n||(e[uNe]=!0),s[uk]())});Bs.addListener(c,"data",u);function u(l){o.onBodySent(l)}}async function Sns(t,e,n,r,i,s,o,a){try{if(o!=null&&o!==n.size)throw new Lgt;let c=Buffer.from(await n.arrayBuffer());e.cork(),e.write(c),e.uncork(),e.end(),i.onBodySent(c),i.onRequestSent(),a||(s[uNe]=!0),r[uk]()}catch(c){t(c)}}async function Kzn(t,e,n,r,i,s,o,a){Lw(o!==0||r[SP]===0,"iterator body cannot be pipelined");let c=null;function u(){if(c){let d=c;c=null,d()}}let l=()=>new Promise((d,m)=>{Lw(c===null),s[Qd]?m(s[Qd]):c=d});e.on("close",u).on("drain",u);try{for await(let d of n){if(s[Qd])throw s[Qd];let m=e.write(d);i.onBodySent(d),m||await l()}e.end(),i.onRequestSent(),a||(s[uNe]=!0),r[uk]()}catch(d){t(d)}finally{e.off("close",u).off("drain",u)}}A7n.exports=tns});var RP=re((BPc,v7n)=>{"use strict";p();var IP=require("node:assert"),C7n=require("node:net"),Uoe=require("node:http"),TP=Zi(),{ClientStats:Cns}=Dft(),{channels:NY}=gP(),Ins=_6n(),wns=sU(),{InvalidArgumentError:wa,InformationalError:Tns,ClientDestroyedError:vns}=Wi(),Rns=oU(),{kUrl:Fw,kServerName:pk,kClient:kns,kBusy:tAt,kConnect:Bns,kResuming:gU,kRunning:qoe,kPending:joe,kSize:$oe,kQueue:jb,kConnected:Nns,kConnecting:DY,kNeedDrain:vP,kKeepAliveDefaultTimeout:E7n,kHostHeader:Dns,kPendingIdx:Vb,kRunningIdx:vS,kError:Pns,kPipelining:mNe,kKeepAliveTimeoutValue:Mns,kMaxHeadersSize:Ons,kKeepAliveMaxTimeout:Lns,kKeepAliveTimeoutThreshold:Fns,kHeadersTimeout:Qns,kBodyTimeout:Uns,kStrictContentLength:Gns,kConnector:Woe,kMaxRequests:nAt,kCounter:$ns,kClose:Wns,kDestroy:Hns,kDispatch:qns,kLocalAddress:Hoe,kMaxResponseSize:jns,kOnError:Vns,kHTTPContext:cu,kMaxConcurrentStreams:Yns,kHostAuthority:b7n,kResume:dk,kHTTP2Options:zns}=Oo(),Kns=Gzn(),Jns=y7n(),wP=Symbol("kClosedResolve"),Xns=Uoe&&Uoe.maxHeaderSize&&Number.isInteger(Uoe.maxHeaderSize)&&Uoe.maxHeaderSize>0?()=>Uoe.maxHeaderSize:()=>{throw new wa("http module not available or http.maxHeaderSize invalid")},_7n=()=>{};function Zns(t){return t[mNe]??t[cu]?.defaultPipelining??1}var x7n=!1;function Goe(t){x7n!==!0&&(process.emitWarning(`Use h2Options.${t} instead. ${t} for H2 will be deprecated in future major.`,{code:"UNDICI-H2-OPTIONS"}),x7n=!0)}function I7n(t){return t[cu]?.version==="h2"?t[Yns]:Zns(t)}var rAt=class extends wns{constructor(e,{maxHeaderSize:n,headersTimeout:r,socketTimeout:i,requestTimeout:s,connectTimeout:o,bodyTimeout:a,idleTimeout:c,keepAlive:u,keepAliveTimeout:l,maxKeepAliveTimeout:d,keepAliveMaxTimeout:m,keepAliveTimeoutThreshold:h,socketPath:f,pipelining:g,tls:A,strictContentLength:y,maxCachedSessions:E,connect:_,maxRequestsPerClient:S,localAddress:C,maxResponseSize:I,autoSelectFamily:w,autoSelectFamilyAttemptTimeout:k,maxConcurrentStreams:N,allowH2:O,useH2c:W,initialWindowSize:$,connectionWindowSize:G,pingInterval:q,webSocket:ce,h2Options:Y,eventSource:z}={}){if(u!==void 0)throw new wa("unsupported keepAlive, use pipelining=0 instead");if(i!==void 0)throw new wa("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new wa("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new wa("unsupported idleTimeout, use keepAliveTimeout instead");if(d!==void 0)throw new wa("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null){if(!Number.isInteger(n)||n<1)throw new wa("invalid maxHeaderSize")}else n=Xns();if(f!=null&&typeof f!="string")throw new wa("invalid socketPath");if(o!=null&&(!Number.isFinite(o)||o<0))throw new wa("invalid connectTimeout");if(l!=null&&(!Number.isFinite(l)||l<=0))throw new wa("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new wa("invalid keepAliveMaxTimeout");if(h!=null&&!Number.isFinite(h))throw new wa("invalid keepAliveTimeoutThreshold");if(r!=null&&(!Number.isInteger(r)||r<0))throw new wa("headersTimeout must be a positive integer or zero");if(a!=null&&(!Number.isInteger(a)||a<0))throw new wa("bodyTimeout must be a positive integer or zero");if(_!=null&&typeof _!="function"&&typeof _!="object")throw new wa("connect must be a function or an object");if(S!=null&&(!Number.isInteger(S)||S<0))throw new wa("maxRequestsPerClient must be a positive number");if(C!=null&&(typeof C!="string"||C7n.isIP(C)===0))throw new wa("localAddress must be valid string IP address");if(I!=null&&(!Number.isInteger(I)||I<-1))throw new wa("maxResponseSize must be a positive number");if(k!=null&&(!Number.isInteger(k)||k<-1))throw new wa("autoSelectFamilyAttemptTimeout must be a positive number");if(O!=null&&typeof O!="boolean")throw new wa("allowH2 must be a valid boolean value");if(O!==!1)if(Y!=null){if(Y.useH2c!=null&&typeof Y.useH2c!="boolean")throw new wa("h2Options.useH2c must be a valid boolean value");if(Y.settings?.initialWindowSize!=null&&(!Number.isInteger(Y.settings.initialWindowSize)||Y.settings.initialWindowSize<1))throw new wa("h2Options.settings.initialWindowSize must be a positive integer, greater than 0");if(Y.maxConcurrentStreams!=null&&(!Number.isInteger(Y.connectionWindowSize)||Y.maxConcurrentStreams<1))throw new wa("h2Options.maxConcurrentStreams must be a positive integer, greater than 0");if(Y.connectionWindowSize!=null&&(!Number.isInteger(Y.connectionWindowSize)||Y.connectionWindowSize<1))throw new wa("h2Options.connectionWindowSize must be a positive integer, greater than 0");if(Y.pingInterval!=null&&(typeof Y.pingInterval!="number"||!Number.isInteger(Y.pingInterval)||Y.pingInterval<0))throw new wa("h2Options.pingInterval must be a positive integer, greater or equal to 0")}else{if(W!=null&&typeof W!="boolean")throw Goe("useH2c"),new wa("useH2c must be a valid boolean value");if(N!=null&&(typeof N!="number"||N<1))throw Goe("maxConcurrentStreams"),new wa("maxConcurrentStreams must be a positive integer, greater than 0");if($!=null&&(!Number.isInteger($)||$<1))throw Goe("initialWindowSize"),new wa("initialWindowSize must be a positive integer, greater than 0");if(G!=null&&(!Number.isInteger(G)||G<1))throw Goe("connectionWindowSize"),new wa("connectionWindowSize must be a positive integer, greater than 0");if(q!=null&&(typeof q!="number"||!Number.isInteger(q)||q<0))throw Goe("pingInterval"),new wa("pingInterval must be a positive integer, greater or equal to 0")}if(super({webSocket:ce,eventSource:z}),typeof _!="function")_=Rns({...A,maxCachedSessions:E,allowH2:O,socketPath:f,useH2c:Y?.useH2c??W,timeout:o,...typeof w=="boolean"?{autoSelectFamily:w,autoSelectFamilyAttemptTimeout:k}:void 0,..._});else{let j=_;_=(se,Ae)=>j({...se,...f!=null?{socketPath:f}:null,...O!=null?{allowH2:O}:null},Ae)}this[Fw]=TP.parseOrigin(e),this[b7n]=`${this[Fw].hostname}${this[Fw].port?`:${this[Fw].port}`:""}`,this[Woe]=_,this[mNe]=g??1,this[Ons]=n,this[E7n]=l??4e3,this[Lns]=m??6e5,this[Fns]=h??2e3,this[Mns]=this[E7n],this[pk]=null,this[Hoe]=C??null,this[gU]=0,this[vP]=0,this[Dns]=`host: ${this[b7n]}\r +`,this[Uns]=a??3e5,this[Qns]=r??3e5,this[Gns]=y??!0,this[nAt]=S,this[wP]=null,this[jns]=I>-1?I:-1,this[cu]=null,this[zns]={pingInterval:Y?.pingInterval??q??6e4,connectionWindowSize:Y?.connectionWindowSize??G??524288,maxConcurrentStreams:Y?.maxConcurrentStreams??N??100,sessionOptions:{initialWindowSize:Y?.initialWindowSize??$??262144}},this[jb]=[],this[vS]=0,this[Vb]=0,this[dk]=j=>iAt(this,j),this[Vns]=j=>w7n(this,j)}get pipelining(){return this[mNe]}set pipelining(e){this[mNe]=e,this[dk](!0)}get stats(){return new Cns(this)}get[joe](){return this[jb].length-this[Vb]}get[qoe](){return this[Vb]-this[vS]}get[$oe](){return this[jb].length-this[vS]}get[Nns](){return!!this[cu]&&!this[DY]&&!this[cu].destroyed}get[tAt](){let e=this[cu]?.version==="h2";return!!(this[cu]?.busy(null)||this[$oe]>=(I7n(this)||1)||this[joe]>0&&!e)}[Bns](e){T7n(this),this.once("connect",e)}[qns](e,n){let r=new Ins(this[Fw].origin,e,n);return this[jb].push(r),this[gU]||(TP.bodyLength(r.body)==null&&TP.isIterable(r.body)?(this[gU]=1,queueMicrotask(()=>iAt(this))):this[dk](!0)),this[gU]&&this[vP]!==2&&this[tAt]&&(this[vP]=2),this[vP]<2}[Wns](){return new Promise(e=>{this[$oe]?this[wP]=e:e(null)})}[Hns](e){return new Promise(n=>{let r=this[jb].splice(this[Vb]);for(let s=0;s{this[wP]&&(this[wP](),this[wP]=null),n(null)};this[cu]?(this[cu].destroy(e,i),this[cu]=null):queueMicrotask(i),this[dk]()})}};function w7n(t,e){if(t[qoe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){IP(t[Vb]===t[vS]);let n=t[jb].splice(t[vS]);for(let r=0;r{if(s){eAt(t,s,{host:e,hostname:n,protocol:r,port:i}),t[dk]();return}if(t.destroyed){TP.destroy(o.on("error",_7n),new vns),t[dk]();return}IP(o);try{t[cu]=o.alpnProtocol==="h2"?Jns(t,o):Kns(t,o)}catch(a){o.destroy().on("error",_7n),eAt(t,a,{host:e,hostname:n,protocol:r,port:i}),t[dk]();return}t[DY]=!1,o[$ns]=0,o[nAt]=t[nAt],o[kns]=t,o[Pns]=null,NY.connected.hasSubscribers&&NY.connected.publish({connectParams:{host:e,hostname:n,protocol:r,port:i,version:t[cu]?.version,servername:t[pk],localAddress:t[Hoe]},connector:t[Woe],socket:o}),t.emit("connect",t[Fw],[t]),t[dk]()})}catch(s){eAt(t,s,{host:e,hostname:n,protocol:r,port:i}),t[dk]()}}function eAt(t,e,{host:n,hostname:r,protocol:i,port:s}){if(!t.destroyed){if(t[DY]=!1,NY.connectError.hasSubscribers&&NY.connectError.publish({connectParams:{host:n,hostname:r,protocol:i,port:s,version:t[cu]?.version,servername:t[pk],localAddress:t[Hoe]},connector:t[Woe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID"){let o=t[jb].splice(t[vS],t[qoe]);t[Vb]=t[vS];for(let a=0;a0&&t[jb][t[Vb]].servername===t[pk];){let a=t[jb].splice(t[Vb],1)[0];TP.errorRequest(t,a,e)}}else w7n(t,e);t.emit("connectionError",t[Fw],[t],e)}}function S7n(t){t[vP]=0,t.emit("drain",t[Fw],[t])}function iAt(t,e){t[gU]!==2&&(t[gU]=2,ers(t,e),t[gU]=0,t[vS]>256&&(t[jb].splice(0,t[vS]),t[Vb]-=t[vS],t[vS]=0))}function ers(t,e){for(;;){if(t.destroyed){IP(t[joe]===0);return}if(t[wP]&&!t[$oe]){t[wP](),t[wP]=null;return}if(t[cu]&&t[cu].resume(),t[tAt])t[vP]=2;else if(t[vP]===2){e?(t[vP]=1,queueMicrotask(()=>S7n(t))):S7n(t);continue}if(t[joe]===0||t[qoe]>=(I7n(t)||1))return;let n=t[jb][t[Vb]];if(n===null)return;if(t[Fw].protocol==="https:"&&t[pk]!==n.servername){if(t[qoe]>0)return;t[pk]=n.servername,t[cu]?.destroy(new Tns("servername changed"),()=>{t[cu]=null,iAt(t)})}if(t[DY])return;if(!t[cu]){t[pk]=n.servername,T7n(t);return}if(t[cu].destroyed||t[cu].busy(n))return;!n.aborted&&t[cu].write(n)?t[Vb]++:t[jb].splice(t[Vb],1)}}v7n.exports=rAt});var sAt=re((PPc,R7n)=>{"use strict";p();var hNe=class{bottom=0;top=0;list=new Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};R7n.exports=class{constructor(){this.head=this.tail=new hNe}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new hNe),this.head.push(e)}shift(){let e=this.tail,n=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),n}}});var fNe=re((OPc,Q7n)=>{"use strict";p();var{PoolStats:trs}=Dft(),nrs=sU(),rrs=sAt(),{kConnected:oAt,kSize:k7n,kRunning:B7n,kPending:N7n,kQueued:Voe,kBusy:irs,kFree:srs,kUrl:ors,kClose:ars,kDestroy:crs,kDispatch:lrs}=Oo(),Ud=Symbol("clients"),sf=Symbol("needDrain"),Yoe=Symbol("queue"),aAt=Symbol("closed resolve"),cAt=Symbol("onDrain"),D7n=Symbol("onConnect"),P7n=Symbol("onDisconnect"),M7n=Symbol("onConnectionError"),O7n=Symbol("get dispatcher"),lAt=Symbol("has dispatcher"),L7n=Symbol("add client"),F7n=Symbol("remove client"),uAt=class extends nrs{[Yoe]=new rrs;[Voe]=0;[Ud]=[];[sf]=!1;[cAt](e,n,r){let i=this[Yoe],s=!1;for(;!s;){let o=i.shift();if(!o)break;this[Voe]--,s=!e.dispatch(o.opts,o.handler)}if(e[sf]=s,!s&&this[sf]&&(this[sf]=!1,this.emit("drain",n,[this,...r])),this[aAt]&&i.isEmpty()){let o=[];for(let a=0;a{this.emit("connect",e,[this,...n])};[P7n]=(e,n,r)=>{this.emit("disconnect",e,[this,...n],r)};[M7n]=(e,n,r)=>{this.emit("connectionError",e,[this,...n],r)};get[irs](){return this[sf]}get[oAt](){let e=0;for(let{[oAt]:n}of this[Ud])e+=n;return e}get[srs](){let e=0;for(let{[oAt]:n,[sf]:r}of this[Ud])e+=n&&!r;return e}get[N7n](){let e=this[Voe];for(let{[N7n]:n}of this[Ud])e+=n;return e}get[B7n](){let e=0;for(let{[B7n]:n}of this[Ud])e+=n;return e}get[k7n](){let e=this[Voe];for(let{[k7n]:n}of this[Ud])e+=n;return e}get stats(){return new trs(this)}[ars](){if(this[Yoe].isEmpty()){let e=[];for(let n=0;n{this[aAt]=e})}[crs](e){for(;;){let r=this[Yoe].shift();if(!r)break;r.handler.onResponseError(null,e)}let n=new Array(this[Ud].length);for(let r=0;r{this[sf]&&this[cAt](e,e[ors],[e,this])}),this}[F7n](e){let n=this[Ud].indexOf(e);n!==-1&&this[Ud].splice(n,1),e.close(()=>{}),this[sf]=!this[Ud].some(r=>!r[sf]&&r.closed!==!0&&r.destroyed!==!0)}};Q7n.exports={PoolBase:uAt,kClients:Ud,kNeedDrain:sf,kAddClient:L7n,kRemoveClient:F7n,kGetDispatcher:O7n,kHasDispatcher:lAt}});var AU=re((FPc,H7n)=>{"use strict";p();var{PoolBase:urs,kClients:kP,kNeedDrain:U7n,kAddClient:G7n,kGetDispatcher:drs,kHasDispatcher:prs,kRemoveClient:$7n}=fNe(),mrs=RP(),{InvalidArgumentError:dAt}=Wi(),W7n=Zi(),{kUrl:pAt}=Oo(),hrs=oU(),zoe=Symbol("options"),Koe=Symbol("connections"),mAt=Symbol("factory");function frs(t,e){return new mrs(t,e)}var hAt=class extends urs{constructor(e,{connections:n,factory:r=frs,connect:i,connectTimeout:s,tls:o,maxCachedSessions:a,socketPath:c,autoSelectFamily:u,autoSelectFamilyAttemptTimeout:l,allowH2:d,useH2c:m,clientTtl:h,...f}={}){if(n!=null&&(!Number.isFinite(n)||n<0))throw new dAt("invalid connections");if(typeof r!="function")throw new dAt("factory must be a function.");if(i!=null&&typeof i!="function"&&typeof i!="object")throw new dAt("connect must be a function or an object");typeof i!="function"&&(i=hrs({...o,maxCachedSessions:a,allowH2:d,useH2c:m,socketPath:c,timeout:s,...typeof u=="boolean"?{autoSelectFamily:u,autoSelectFamilyAttemptTimeout:l}:void 0,...i})),super(f),this[Koe]=n||null,this[pAt]=W7n.parseOrigin(e),this[zoe]={...W7n.deepClone(f),connect:i,allowH2:d,useH2c:m,clientTtl:h,socketPath:c},this[mAt]=r,this.on("connect",(g,A)=>{if(h!=null&&h>0)for(let y of A)Object.assign(y,{ttl:Date.now()})}),this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[kP].indexOf(E);_!==-1&&this[kP].splice(_,1)}})}[drs](){let e=this[zoe].clientTtl;for(let n=0;n0&&r.ttl&&Date.now()-r.ttl>e)this[$7n](r),n--;else if(!r[U7n])return r}if(!this[Koe]||this[kP].length0&&r.ttl&&Date.now()-r.ttl>e)this[$7n](r),n--;else if(!r[U7n])return!0}if(!this[Koe]||this[kP].length{"use strict";p();var{BalancedPoolMissingUpstreamError:grs,InvalidArgumentError:Ars}=Wi(),{PoolBase:yrs,kClients:QA,kNeedDrain:Ers,kAddClient:brs,kRemoveClient:_rs,kGetDispatcher:xrs}=fNe(),Srs=AU(),{kOriginless:Crs,kUrl:gNe}=Oo(),ANe=Zi(),q7n=Symbol("factory"),yNe=Symbol("options"),j7n=Symbol("kGreatestCommonDivisor"),yU=Symbol("kCurrentWeight"),EU=Symbol("kIndex"),Yb=Symbol("kWeight"),ENe=Symbol("kMaxWeightPerServer"),bNe=Symbol("kErrorPenalty");function Irs(t,e){if(t===0)return e;for(;e!==0;){let n=e;e=t%e,t=n}return t}function wrs(t,e){return new Srs(t,e)}var fAt=class extends yrs{constructor(e=[],{factory:n=wrs,connect:r,tls:i,...s}={}){if(typeof n!="function")throw new Ars("factory must be a function.");super(s),this[Crs]=!0,r&&typeof r!="function"&&(r={...r}),i&&typeof i!="function"&&(i={...i}),this[yNe]={...ANe.deepClone(s),connect:r,tls:i},this[EU]=-1,this[yU]=0,this[ENe]=this[yNe].maxWeightPerServer||100,this[bNe]=this[yNe].errorPenalty||15,Array.isArray(e)||(e=[e]),this[q7n]=n;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let n=ANe.parseOrigin(e).origin;if(this[QA].find(i=>i[gNe].origin===n&&i.closed!==!0&&i.destroyed!==!0))return this;let r=this[q7n](n,this[yNe]);this[brs](r),r.on("connect",()=>{r[Yb]=Math.min(this[ENe],r[Yb]+this[bNe])}),r.on("connectionError",()=>{r[Yb]=Math.max(1,r[Yb]-this[bNe]),this._updateBalancedPoolStats()}),r.on("disconnect",(...i)=>{let s=i[2];s&&s.code==="UND_ERR_SOCKET"&&(r[Yb]=Math.max(1,r[Yb]-this[bNe]),this._updateBalancedPoolStats())});for(let i of this[QA])i[Yb]=this[ENe];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let n=0;ni[gNe].origin===n&&i.closed!==!0&&i.destroyed!==!0);return r&&this[_rs](r),this}getUpstream(e){let n=ANe.parseOrigin(e).origin;return this[QA].find(r=>r[gNe].origin===n&&r.closed!==!0&&r.destroyed!==!0)}get upstreams(){return this[QA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[gNe].origin)}[xrs](){if(this[QA].length===0)throw new grs;let e=0,n=-1;for(;e++this[QA][n][Yb])&&(n=this[EU]),r[Yb]>=this[yU]))return r}if(n!==-1)return this[yU]=this[QA][n][Yb],this[EU]=n,this[QA][n]}};V7n.exports=fAt});var Z7n=re(($Pc,X7n)=>{"use strict";p();var{PoolBase:Trs,kClients:Qw,kNeedDrain:z7n,kAddClient:gAt,kGetDispatcher:vrs,kHasDispatcher:Rrs,kRemoveClient:K7n}=fNe(),krs=RP(),{InvalidArgumentError:AAt}=Wi(),J7n=Zi(),{kUrl:_Ne}=Oo(),Brs=oU(),PY=Symbol("options"),Joe=Symbol("connections"),xNe=Symbol("factory"),bU=Symbol("index");function Nrs(t,e){return new krs(t,e)}var yAt=class extends Trs{constructor(e,{connections:n,factory:r=Nrs,connect:i,connectTimeout:s,tls:o,maxCachedSessions:a,socketPath:c,autoSelectFamily:u,autoSelectFamilyAttemptTimeout:l,allowH2:d,clientTtl:m,...h}={}){if(n!=null&&(!Number.isFinite(n)||n<0))throw new AAt("invalid connections");if(typeof r!="function")throw new AAt("factory must be a function.");if(i!=null&&typeof i!="function"&&typeof i!="object")throw new AAt("connect must be a function or an object");typeof i!="function"&&(i=Brs({...o,maxCachedSessions:a,allowH2:d,socketPath:c,timeout:s,...typeof u=="boolean"?{autoSelectFamily:u,autoSelectFamilyAttemptTimeout:l}:void 0,...i})),super(h),this[Joe]=n||null,this[_Ne]=J7n.parseOrigin(e),this[PY]={...J7n.deepClone(h),connect:i,allowH2:d,clientTtl:m,socketPath:c},this[xNe]=r,this[bU]=-1,this.on("connect",(f,g)=>{if(m!=null&&m>0)for(let A of g)Object.assign(A,{ttl:Date.now()})}),this.on("connectionError",(f,g,A)=>{for(let y of g){let E=this[Qw].indexOf(y);E!==-1&&this[Qw].splice(E,1)}})}[vrs](){let e=this[PY].clientTtl;if(this[Qw].length===0){let r=this[xNe](this[_Ne],this[PY]);return this[gAt](r),r}let n=0;for(;n0&&r.ttl&&Date.now()-r.ttl>e){this[K7n](r),this[bU]--;continue}if(!r[z7n])return r;n++}if(!this[Joe]||this[Qw].length0&&r.ttl&&Date.now()-r.ttl>e)this[K7n](r),n<=this[bU]&&this[bU]--,n--;else if(!r[z7n])return!0}if(!this[Joe]||this[Qw].length{"use strict";p();var{InvalidArgumentError:SNe,MaxOriginsReachedError:Drs}=Wi(),{kBusy:Prs,kClients:zb,kConnected:Mrs,kRunning:eKn,kPending:Ors,kClose:Lrs,kDestroy:Frs,kDispatch:Qrs,kUrl:Urs}=Oo(),Grs=sU(),$rs=AU(),Wrs=RP(),Hrs=Zi(),tKn=Symbol("onConnect"),nKn=Symbol("onDisconnect"),rKn=Symbol("onConnectionError"),iKn=Symbol("onDrain"),sKn=Symbol("factory"),Xoe=Symbol("options"),Zoe=Symbol("origins");function qrs(t,e){return e&&e.connections===1?new Wrs(t,e):new $rs(t,e)}var EAt=class extends Grs{constructor({factory:e=qrs,maxOrigins:n=1/0,connect:r,...i}={}){if(typeof e!="function")throw new SNe("factory must be a function.");if(r!=null&&typeof r!="function"&&typeof r!="object")throw new SNe("connect must be a function or an object");if(typeof n!="number"||Number.isNaN(n)||n<=0)throw new SNe("maxOrigins must be a number greater than 0");super(i),r&&typeof r!="function"&&(r={...r}),this[Xoe]={...Hrs.deepClone(i),maxOrigins:n,connect:r},this[sKn]=e,this[zb]=new Map,this[Zoe]=new Set,this[iKn]=(s,o)=>{this.emit("drain",s,[this,...o])},this[tKn]=(s,o)=>{this.emit("connect",s,[this,...o])},this[nKn]=(s,o,a)=>{this.emit("disconnect",s,[this,...o],a)},this[rKn]=(s,o,a)=>{this.emit("connectionError",s,[this,...o],a)}}get[eKn](){let e=0;for(let n of this[zb].values())e+=n[eKn];return e}[Qrs](e,n){let r;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))r=String(e.origin);else throw new SNe("opts.origin must be a non-empty string or URL.");let i=e.allowH2??this[Xoe].allowH2,s=i===!1?`${r}#http1-only`:r;if(this[Zoe].size>=this[Xoe].maxOrigins&&!this[Zoe].has(r))throw new Drs;let o=this[zb].get(s);if(!o){o=this[sKn](e.origin,i===!1?{...this[Xoe],allowH2:!1}:this[Xoe]);let a=()=>{if(this[zb].get(s)!==o||o[Mrs]>0||o[Prs]||o[Ors]>0)return;this[zb].delete(s),o.destroyed||o.close();let c=!1;for(let u of this[zb].keys())if(u===r||u===`${r}#http1-only`){c=!0;break}c||this[Zoe].delete(r)};o.on("drain",this[iKn]).on("connect",this[tKn]).on("disconnect",(c,u,l)=>{a(),this[nKn](c,u,l)}).on("connectionError",(c,u,l)=>{a(),this[rKn](c,u,l)}),this[zb].set(s,o),this[Zoe].add(r)}return o.dispatch(e,n)}[Lrs](){let e=[];for(let n of this[zb].values())e.push(n.close());return this[zb].clear(),Promise.all(e)}[Frs](e){let n=[];for(let r of this[zb].values())n.push(r.destroy(e));return this[zb].clear(),Promise.all(n)}get stats(){let e={};for(let n of this[zb].values())n.stats&&(e[n[Urs].origin]=n.stats);return e}};oKn.exports=EAt});var SAt=re((jPc,uKn)=>{"use strict";p();var jrs=fY(),{InvalidArgumentError:aKn}=Wi(),{toRawHeaders:bAt}=Zi(),{kOriginless:cKn,kUrl:lKn}=Oo(),_At=class{#e;constructor(e){this.#e=e}onRequestStart(e,n){this.#e.onConnect?.(r=>e.abort(r),n)}onRequestUpgrade(e,n,r,i){let s=e?.rawHeaders??bAt(r??{});this.#e.onUpgrade?.(n,s,i)}onResponseStart(e,n,r,i){let s=e?.rawHeaders??bAt(r??{});this.#e.onHeaders?.(n,s,()=>e.resume(),i)===!1&&e.pause()}onResponseData(e,n){this.#e.onData?.(n)===!1&&e.pause()}onResponseEnd(e,n){let r=e?.rawTrailers??bAt(n??{});this.#e.onComplete?.(r)}onResponseError(e,n){if(!this.#e.onError)throw n;this.#e.onError(n)}onBodySent(e){this.#e.onBodySent?.(e)}onRequestSent(){this.#e.onRequestSent?.()}onResponseStarted(){this.#e.onResponseStarted?.()}},xAt=class t extends jrs{#e;constructor(e){if(super(),!e||typeof e.dispatch!="function")throw new aKn("Argument dispatcher must implement dispatch");this.#e=e,this[lKn]=e[lKn],this[cKn]=e[cKn]}static wrapHandler(e){if(!e||typeof e!="object")throw new aKn("handler must be an object");return typeof e.onRequestStart=="function"?e:new _At(e)}dispatch(e,n){return e.allowH2!==!1&&(e={...e,allowH2:!1}),this.#e.dispatch(e,t.wrapHandler(n))}close(...e){return this.#e.close(...e)}destroy(...e){return this.#e.destroy(...e)}};uKn.exports=xAt});var mKn=re((YPc,pKn)=>{"use strict";p();var{Buffer:NP}=require("node:buffer"),CAt=require("node:net"),{InvalidArgumentError:BP}=Wi();function Vrs(t){if(CAt.isIPv4(t)){let n=t.split(".").map(Number);return{type:1,buffer:NP.from(n)}}if(CAt.isIPv6(t))return{type:4,buffer:dKn(t)};let e=NP.from(t,"utf8");if(e.length>255)throw new BP("Domain name too long (max 255 bytes)");return{type:3,buffer:NP.concat([NP.from([e.length]),e])}}function dKn(t){let e=NP.alloc(16),n=t;if(t.includes(".")){let i=t.lastIndexOf(":"),s=t.slice(i+1);if(CAt.isIPv4(s)){let o=s.split(".").map(Number),a=(o[0]<<8|o[1]).toString(16),c=(o[2]<<8|o[3]).toString(16);n=`${t.slice(0,i)}:${a}:${c}`}}let r=n.indexOf("::");if(r!==-1){let i=n.slice(0,r),s=n.slice(r+2),o=i===""?[]:i.split(":"),a=s===""?[]:s.split(":"),c=0;for(let u of o)e.writeUInt16BE(parseInt(u,16),c),c+=2;c=16-a.length*2;for(let u of a)e.writeUInt16BE(parseInt(u,16),c),c+=2}else{let i=n.split(":");for(let s=0;s{"use strict";p();var{EventEmitter:Jrs}=require("node:events"),{Buffer:xU}=require("node:buffer"),{InvalidArgumentError:MY,Socks5ProxyError:DP}=Wi(),{debuglog:Xrs}=require("node:util"),{parseAddress:Zrs}=mKn(),mk=Xrs("undici:socks5"),hKn=xU.alloc(0),CNe=5,OY={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},fKn={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},SU={IPV4:1,DOMAIN:3,IPV6:4},Uw={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},of={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},IAt=class extends Jrs{constructor(e,n={}){if(super(),!e)throw new MY("socket is required");this.socket=e,this.options=n,this.state=of.INITIAL,this.buffer=hKn,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],n.username&&n.password&&this.authMethods.push(OY.USERNAME_PASSWORD),this.authMethods.push(OY.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){mk("received data",e.length,"bytes in state",this.state),this.buffer=xU.concat([this.buffer,e]);try{switch(this.state){case of.HANDSHAKING:this.handleHandshakeResponse();break;case of.AUTHENTICATING:this.handleAuthResponse();break;case of.CONNECTING:this.handleConnectResponse();break}}catch(n){this.onError(n)}}onError(e){mk("socket error",e),this.state=of.ERROR,this.emit("error",e),this.destroy()}onClose(){mk("socket closed"),this.state=of.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=of.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==of.INITIAL)throw new MY("Handshake already started");mk("starting handshake with",this.authMethods.length,"auth methods"),this.state=of.HANDSHAKING;let e=xU.alloc(2+this.authMethods.length);e[0]=CNe,e[1]=this.authMethods.length,this.authMethods.forEach((n,r)=>{e[2+r]=n}),this.socket.write(e)}handleHandshakeResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],n=this.buffer[1];if(e!==CNe)throw new DP(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(n===OY.NO_ACCEPTABLE)throw new DP("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),mk("server selected auth method",n),n===OY.NO_AUTH)this.markAuthenticated();else if(n===OY.USERNAME_PASSWORD)this.state=of.AUTHENTICATING,this.sendAuthRequest();else throw new DP(`Unsupported authentication method: ${n}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:n}=this.options;if(!e||!n)throw new MY("Username and password required for authentication");mk("sending username/password auth");let r=xU.from(e),i=xU.from(n);if(r.length>255||i.length>255)throw new MY("Username or password too long");let s=xU.alloc(3+r.length+i.length);s[0]=1,s[1]=r.length,r.copy(s,2),s[2+r.length]=i.length,i.copy(s,3+r.length),this.socket.write(s)}handleAuthResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],n=this.buffer[1];if(e!==1)throw new DP(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(n!==0)throw new DP("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),mk("authentication successful"),this.markAuthenticated()}connect(e,n){if(this.state===of.CONNECTING||this.state===of.CONNECTED)throw new MY("Connection already in progress");if(this.state!==of.AUTHENTICATED)throw new MY("Client must be authenticated before CONNECT");mk("connecting to",e,n),this.state=of.CONNECTING;let r=this.buildConnectRequest(fKn.CONNECT,e,n);this.socket.write(r)}buildConnectRequest(e,n,r){let{type:i,buffer:s}=Zrs(n),o=xU.alloc(4+s.length+2);return o[0]=CNe,o[1]=e,o[2]=0,o[3]=i,s.copy(o,4),o.writeUInt16BE(r,4+s.length),o}handleConnectResponse(){if(this.buffer.length<4)return;let e=this.buffer[0],n=this.buffer[1],r=this.buffer[3];if(e!==CNe)throw new DP(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let i=4;if(r===SU.IPV4)i+=6;else if(r===SU.DOMAIN){if(this.buffer.length<5)return;i+=1+this.buffer[4]+2}else if(r===SU.IPV6)i+=18;else throw new DP(`Invalid address type in reply: ${r}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var{URL:yKn}=require("node:url"),wAt,eis=sU(),{ConnectTimeoutError:tis,InvalidArgumentError:eae}=Wi(),{Socks5Client:nis,STATES:ris}=AKn(),{kBusy:iis,kConnected:sis,kDispatch:EKn,kClose:ois,kDestroy:ais}=Oo(),cis=AU(),lis=oU(),{setupConnectTimeout:uis}=Zi(),{debuglog:dis}=require("node:util"),PP=dis("undici:socks5-proxy"),pis=5e3,TAt=Symbol("proxy url"),mis=Symbol("proxy headers"),bKn=Symbol("proxy auth"),_Kn=Symbol("proxy protocol"),hk=Symbol("pools"),xKn=Symbol("connector"),CU=Symbol("connect timeout"),vAt=Symbol("request tls settings"),SKn=Symbol("request tls timeout");function CKn(t,e,n){return new tis(`Connect Timeout Error (attempted address: ${t}:${e}, timeout: ${n}ms)`)}var IKn=!1,RAt=class extends eis{constructor(e,n={}){if(super(n),IKn||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),IKn=!0),!e)throw new eae("Proxy URL is mandatory");let r=typeof e=="string"?new yKn(e):e;if(r.protocol!=="socks5:"&&r.protocol!=="socks:")throw new eae("Proxy URL must use socks5:// or socks:// protocol");this[TAt]=r,this[mis]=n.headers||{},this[_Kn]=n.proxyTls?"https:":"http:";let i=n.connectTimeout??pis;if(!Number.isFinite(i)||i<0)throw new eae("invalid connectTimeout");this[CU]=i;let{timeout:s,...o}=n.requestTls||{},a=s??i;if(!Number.isFinite(a)||a<0)throw new eae("invalid requestTls.timeout");this[vAt]=o,this[SKn]=a,this[bKn]={username:n.username||(r.username?decodeURIComponent(r.username):null),password:n.password||(r.password?decodeURIComponent(r.password):null)};let c=n.proxyTls?.timeout??i;if(!Number.isFinite(c)||c<0)throw new eae("invalid proxyTls.timeout");this[xKn]=n.connect||lis({...n.proxyTls,timeout:c,servername:n.proxyTls?.servername||r.hostname}),this[hk]=new Map}async createSocks5Connection(e,n){let r=this[TAt].hostname,i=parseInt(this[TAt].port)||1080;PP("creating SOCKS5 connection to",r,i);let s=Promise.withResolvers();this[xKn]({hostname:r,host:r,port:i,protocol:this[_Kn]},(E,_)=>{E?s.reject(E):s.resolve(_)});let o=await s.promise,a=new nis(o,this[bKn]);a.on("error",E=>{PP("SOCKS5 error:",E),o.destroy()}),await a.handshake();let c=Promise.withResolvers(),u=this[CU]===0?null:setTimeout(()=>{l(),a.destroy(),c.reject(CKn(r,i,this[CU]))},this[CU]),l=()=>{clearTimeout(u),a.removeListener("authenticated",d),a.removeListener("error",m)},d=()=>{l(),c.resolve()},m=E=>{l(),c.reject(E)};a.state===ris.AUTHENTICATED?(clearTimeout(u),c.resolve()):(a.once("authenticated",d),a.once("error",m)),await c.promise,await a.connect(e,n);let h=Promise.withResolvers(),f=this[CU]===0?null:setTimeout(()=>{g(),a.destroy(),h.reject(CKn(e,n,this[CU]))},this[CU]),g=()=>{clearTimeout(f),a.removeListener("connected",A),a.removeListener("error",y)},A=E=>{PP("SOCKS5 tunnel established to",e,n,"via",E),g(),h.resolve()},y=E=>{g(),h.reject(E)};return a.once("connected",A),a.once("error",y),await h.promise,o}[EKn](e,n){let{origin:r}=e;PP("dispatching request to",r,"via SOCKS5");try{let i=String(r),s=this[hk].get(i);if(!s||s.destroyed||s.closed){s=new cis(r,{pipelining:e.pipelining,connections:e.connections,connect:async(a,c)=>{try{let u=new yKn(r),l=u.hostname,d=parseInt(u.port)||(u.protocol==="https:"?443:80);PP("establishing SOCKS5 connection to",l,d);let m=await this.createSocks5Connection(l,d),h=m;if(u.protocol==="https:"){wAt||(wAt=require("node:tls")),PP("upgrading to TLS"),h=wAt.connect({...this[vAt],socket:m,servername:this[vAt]?.servername||l});let f=Promise.withResolvers(),g=()=>{queueMicrotask(E),h.removeListener("secureConnect",A),h.removeListener("error",y)},A=()=>{g(),f.resolve()},y=_=>{g(),f.reject(_)},E=uis(new WeakRef(h),{timeout:this[SKn],hostname:l,port:d});h.once("secureConnect",A),h.once("error",y),await f.promise}c(null,h)}catch(u){PP("SOCKS5 connection error:",u),c(u)}}}),this[hk].set(i,s);let o=()=>{this[hk].get(i)!==s||s[sis]>0||s[iis]||(this[hk].delete(i),s.destroyed||s.close())};s.on("disconnect",o),s.on("connectionError",o)}return s[EKn](e,n)}catch(i){if(PP("dispatch error:",i),typeof n.onResponseError=="function")return n.onResponseError(null,i),!1;if(typeof n.onError=="function")return n.onError(i),!1;throw i}}async[ois](){let e=[];for(let n of this[hk].values())e.push(n.close());this[hk].clear(),await Promise.all(e)}async[ais](e){let n=[];for(let r of this[hk].values())n.push(r.destroy(e));this[hk].clear(),await Promise.all(n)}};wKn.exports=RAt});var MAt=re((eMc,GKn)=>{"use strict";p();var{kProxy:IU,kClose:PKn,kDestroy:MKn,kDispatch:TKn}=Oo(),his=_U(),OKn=AU(),LKn=sU(),{InvalidArgumentError:wU,RequestAbortedError:fis,SecureProxyConnectionError:vKn,ProxyConnectionError:gis}=Wi(),INe=oU(),FKn=RP(),{channels:RKn}=gP(),Ais=kAt(),{hasSafeIterator:yis}=Zi(),wNe=Symbol("proxy agent"),MP=Symbol("proxy client"),Gw=Symbol("proxy headers"),BAt=Symbol("request tls settings"),NAt=Symbol("proxy tls settings"),kKn=Symbol("connect endpoint function"),BKn=Symbol("connect endpoint function (http/1.1 only)"),NKn=Symbol("tunnel proxy"),DKn="proxy-authorization";function Eis(t){return t==="https:"?443:80}function bis(t,e){return new OKn(t,e)}var _is=()=>{};function xis(t,e){return e.connections===1?new FKn(t,e):new OKn(t,e)}function Sis(t,e){return e===!0||t!=="http:"}var DAt=class extends LKn{#e;#t;constructor(e,{headers:n={},connect:r,factory:i,proxyServername:s}){if(!e)throw new wU("Proxy URL is mandatory");super(),this[Gw]=n,this.#t=s,i?this.#e=i(e,{connect:r}):this.#e=new FKn(e,{connect:r})}[TKn](e,n){let r=n.onResponseStart;n.onResponseStart=function(a,c,u,l){if(c===407){typeof n.onResponseError=="function"&&n.onResponseError(a,new wU("Proxy Authentication Required (407)"));return}r&&r.call(this,a,c,u,l)};let{origin:i,path:s="/",headers:o={}}=e;if(e.path=i+s,!("host"in o)&&!("Host"in o)){let{host:a}=new URL(i);o.host=a}return e.headers={...this[Gw],...o},this.#t!=null&&(e.servername=this.#t),this.#e[TKn](e,n)}[PKn](){return this.#e.close()}[MKn](e){return this.#e.destroy(e)}},PAt=class extends LKn{constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new wU("Proxy uri is mandatory");let{clientFactory:n=bis}=e;if(typeof n!="function")throw new wU("Proxy opts.clientFactory must be a function.");let{proxyTunnel:r,connectTimeout:i}=e;super(e);let s=this.#e(e),{href:o,origin:a,port:c,protocol:u,username:l,password:d,hostname:m}=s;if(this[IU]={uri:o,protocol:u},this[BAt]=e.requestTls,this[NAt]=e.proxyTls,this[Gw]=e.headers||{},this[NKn]=r,e.auth&&e.token)throw new wU("opts.auth cannot be used in combination with opts.token");e.auth?this[Gw]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[Gw]["proxy-authorization"]=e.token:l&&d?this[Gw]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(l)}:${decodeURIComponent(d)}`).toString("base64")}`:l&&(this[Gw]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(l)}:`).toString("base64")}`);let h=INe({timeout:i,...e.proxyTls}),f=INe({timeout:i,...e.proxyTls,allowH2:!1});this[kKn]=INe({timeout:i,...e.requestTls}),this[BKn]=INe({timeout:i,...e.requestTls,allowH2:!1});let g=e.factory||xis,A=(y,E)=>{let{protocol:_}=new URL(y);if(this[IU].protocol==="socks5:"||this[IU].protocol==="socks:")return new Ais(this[IU].uri,{headers:this[Gw],connect:h,factory:g,username:e.username||l,password:e.password||d,connectTimeout:i,proxyTls:e.proxyTls,requestTls:e.requestTls});if(!Sis(_,this[NKn])){let S=this[IU].protocol==="https:"?(C,I)=>f(C,(w,k)=>{w&&w.code==="ERR_TLS_CERT_ALTNAME_INVALID"?I(new vKn(w)):I(w,k)}):f;return new DAt(this[IU].uri,{headers:this[Gw],connect:S,factory:g,proxyServername:this[IU].protocol==="https:"?this[NAt]?.servername||m:void 0})}return g(y,E)};u==="socks5:"||u==="socks:"?this[MP]=null:this[MP]=n(s,{connect:h}),this[wNe]=new his({...e,factory:A,connect:async(y,E)=>{if(!this[MP]){E(new wU("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${Eis(y.protocol)}`);try{let S={origin:a,port:c,path:_,signal:y.signal,headers:{...this[Gw],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[NAt]?.servername||m},{socket:C,statusCode:I}=await this[MP].connect(S);if(I!==200){C.on("error",_is).destroy(),E(new fis(`Proxy response (${I}) !== 200 when HTTP Tunneling`));return}if(RKn.proxyConnected.hasSubscribers&&RKn.proxyConnected.publish({socket:C,connectParams:S}),y.protocol!=="https:"){E(null,C);return}let w;this[BAt]?w=this[BAt].servername:w=y.servername,(y.allowH2===!1?this[BKn]:this[kKn])({...y,servername:w,httpSocket:C},E)}catch(S){S.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new vKn(S)):S.code==="UND_ERR_SOCKET"?E(new gis(S)):E(S)}}})}dispatch(e,n){let r=Cis(e.headers);if(Iis(r),r&&!("host"in r)&&!("Host"in r)){let{host:i}=new URL(e.origin);r.host=i}return this[wNe].dispatch({...e,headers:r},n)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[PKn](){let e=[this[wNe].close()];return this[MP]&&e.push(this[MP].close()),Promise.all(e)}[MKn](){let e=[this[wNe].destroy()];return this[MP]&&e.push(this[MP].destroy()),Promise.all(e)}};function Cis(t){if(Array.isArray(t)){let e={};for(let n=0;n{"use strict";p();var wis=sU(),{kClose:Tis,kDestroy:vis,kClosed:$Kn,kDestroyed:WKn,kDispatch:Ris,kNoProxyAgent:tae,kHttpProxyAgent:OP,kHttpsProxyAgent:TU}=Oo(),HKn=MAt(),kis=_U(),Bis={"http:":80,"https:":443},OAt=class extends wis{#e=null;#t=null;#n=null;constructor(e={}){super(e),this.#n=e;let{httpProxy:n,httpsProxy:r,noProxy:i,...s}=e;this[tae]=new kis(s);let o=n??process.env.http_proxy??process.env.HTTP_PROXY;o?this[OP]=new HKn({...s,uri:o}):this[OP]=this[tae];let a=r??process.env.https_proxy??process.env.HTTPS_PROXY;a?this[TU]=new HKn({...s,uri:a}):this[TU]=this[OP],this.#s()}[Ris](e,n){let r=new URL(e.origin);return this.#r(r).dispatch(e,n)}[Tis](){return Promise.all([this[tae].close(),!this[OP][$Kn]&&this[OP].close(),!this[TU][$Kn]&&this[TU].close()])}[vis](e){return Promise.all([this[tae].destroy(e),!this[OP][WKn]&&this[OP].destroy(e),!this[TU][WKn]&&this[TU].destroy(e)])}#r(e){let{protocol:n,host:r,port:i}=e;return r=r.replace(/:\d*$/,"").replace(/^\[(.+)\]$/,"$1").toLowerCase(),r.length>1&&r.charCodeAt(r.length-1)===46&&(r=r.slice(0,-1)),i=Number.parseInt(i,10)||Bis[n]||0,this.#i(r,i)?n==="https:"?this[TU]:this[OP]:this[tae]}#i(e,n){if(this.#o&&this.#s(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let r=0;r{"use strict";p();var nae=require("node:assert"),{kRetryHandlerDefaultRetry:VKn}=Oo(),{RequestRetryError:LP,RequestAbortedError:Nis}=Wi(),{isDisturbed:YKn,parseRangeHeader:zKn,wrapRequestBody:Dis}=Zi();function Pis(t){let e=new Date(t).getTime();return isNaN(e)?null:e-Date.now()}function KKn(t,e,n,r){let i=t["content-length"];if(i==null||!Number.isFinite(e.start)||!Number.isFinite(e.end))return;let s=Number(i),o=e.end-e.start+1;if(!Number.isFinite(s)||s!==o)throw new LP("Content-Length mismatch",n,{headers:t,data:{count:r}})}var LAt=class{#e;constructor(e){this.#e=e,this.target=null}pause(){this.target?.pause()}resume(){this.target?.resume()}abort(e){this.target?.abort(e),this.#e(e)}get paused(){return this.target?.paused??!1}get aborted(){return this.target?.aborted??!1}get reason(){return this.target?.reason??null}get rawHeaders(){return this.target?.rawHeaders??null}set rawHeaders(e){this.target&&(this.target.rawHeaders=e)}get rawTrailers(){return this.target?.rawTrailers??null}set rawTrailers(e){this.target&&(this.target.rawTrailers=e)}},FAt=class t{constructor(e,{dispatch:n,handler:r}){let{retryOptions:i,...s}=e,{retry:o,maxRetries:a,maxTimeout:c,minTimeout:u,timeoutFactor:l,methods:d,errorCodes:m,retryAfter:h,statusCodes:f,throwOnError:g}=i??{};this.error=null,this.dispatch=n,this.handler=r,this.opts={...s,body:Dis(e.body)},this.retryOpts={throwOnError:g??!0,retry:o??t[VKn],retryAfter:h??!0,maxTimeout:c??30*1e3,minTimeout:u??500,timeoutFactor:l??2,maxRetries:a??5,methods:d??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE","QUERY"],statusCodes:f??[500,502,503,504,429],errorCodes:m??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null,this.statusCode=null,this.headers=null,this.controllerProxy=new LAt(A=>this.#e(A)),this.retryPending=!1,this.retryTimer=null,this.aborted=!1}onResponseStartWithRetry(e,n,r,i,s){if(this.retryOpts.throwOnError){this.retryOpts.statusCodes.includes(n)===!1?this.headersSent?this.handler.onResponseError?.(this.controllerProxy,s):(this.headersSent=!0,this.checkpointResponseEnd(r),this.handler.onResponseStart?.(this.controllerProxy,n,r,i)):this.error=s;return}if(YKn(this.opts.body)){this.headersSent=!0,this.checkpointResponseEnd(r),this.handler.onResponseStart?.(this.controllerProxy,n,r,i);return}function o(a){if(!this.aborted){if(this.retryPending=!1,this.retryTimer=null,a){this.headersSent?this.handler.onResponseError?.(this.controllerProxy,a):(this.headersSent=!0,this.checkpointResponseEnd(r),this.handler.onResponseStart?.(this.controllerProxy,n,r,i)),e.resume();return}this.error=s,e.resume()}}e.pause(),this.retryPending=!0,this.retryTimer=this.retryOpts.retry(s,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},o.bind(this))??null}checkpointResponseEnd(e){if(this.end==null&&this.opts.method!=="HEAD"){let n=e["content-length"];this.end=n!=null?Number(n)-1:null,nae(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=this.end!=null}}onRequestStart(e,n){this.controllerProxy.target=e,this.headersSent||this.handler.onRequestStart?.(this.controllerProxy,n)}onBodySent(e){this.handler.onBodySent?.(e)}onRequestSent(){this.handler.onRequestSent?.()}onRequestUpgrade(e,n,r,i){this.handler.onRequestUpgrade?.(this.controllerProxy,n,r,i)}static[VKn](e,{state:n,opts:r},i){let{statusCode:s,code:o,headers:a}=e,{method:c,retryOptions:u}=r,{maxRetries:l,minTimeout:d,maxTimeout:m,timeoutFactor:h,statusCodes:f,errorCodes:g,methods:A,retryAfter:y}=u,{counter:E}=n;if(o&&o!=="UND_ERR_REQ_RETRY"&&!g.includes(o)){i(e);return}if(Array.isArray(A)&&!A.includes(c)){i(e);return}if(s!=null&&Array.isArray(f)&&!f.includes(s)){i(e);return}if(E>l){i(e);return}let _=y===!1?void 0:a?.["retry-after"];_&&(_=Number(_),_=Number.isNaN(_)?Pis(a["retry-after"]):_*1e3);let S=_===0?0:_>0?Math.min(_,m):Math.min(d*h**(E-1),m);return setTimeout(()=>i(null),S)}onResponseStart(e,n,r,i){if(n<200){this.handler.onResponseStart?.(this.controllerProxy,n,r,i);return}if(this.error=null,this.retryCount+=1,this.statusCode=n,this.headers=r,this.headersSent){if(n!==206&&(this.start>0||n!==200))throw new LP("server does not support the range header and the payload was partially consumed",n,{headers:r,data:{count:this.retryCount}});let s=zKn(r["content-range"]);if(!s)throw new LP("Content-Range mismatch",n,{headers:r,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==r.etag)throw new LP("ETag mismatch",n,{headers:r,data:{count:this.retryCount}});KKn(r,s,n,this.retryCount);let{start:o,size:a,end:c=a?a-1:null}=s;if(this.start!==o||this.end!=null&&this.end!==c)throw new LP("Content-Range mismatch",n,{headers:r,data:{count:this.retryCount}});return}if(n>=300){let s=new LP("Request failed",n,{headers:r,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,n,r,i,s);return}if(this.end==null){if(n===206){let s=zKn(r["content-range"]);if(s==null||s.end==null){this.headersSent=!0,this.handler.onResponseStart?.(this.controllerProxy,n,r,i);return}KKn(r,s,n,this.retryCount);let{start:o,size:a,end:c=a?a-1:null}=s;nae(o!=null&&Number.isFinite(o),"content-range mismatch"),nae(c!=null&&Number.isFinite(c),"invalid content-length"),this.start=o,this.end=c}if(this.end==null&&this.opts.method!=="HEAD"){let s=r["content-length"];this.end=s!=null?Number(s)-1:null}nae(Number.isFinite(this.start)),nae(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=r.etag!=null?r.etag:null,this.etag!=null&&this.etag[0]==="W"&&this.etag[1]==="/"&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(this.controllerProxy,n,r,i)}else throw new LP("Request failed",n,{headers:r,data:{count:this.retryCount}})}onResponseData(e,n){this.error||(this.start+=n.length,this.handler.onResponseData?.(this.controllerProxy,n))}onResponseEnd(e,n){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error){if(this.end!=null&&Number.isFinite(this.end)&&this.start!==this.end+1)throw new LP("Content-Range mismatch",this.statusCode,{headers:this.headers,data:{count:this.retryCount}});return this.retryCount=0,this.handler.onResponseEnd?.(this.controllerProxy,n)}this.retry()}retry(){if(this.start!==0){let e={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(e["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...e}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(e){this.handler.onResponseError?.(this.controllerProxy,e)}}onResponseError(e,n){if(this.aborted)return;if(e?.aborted||YKn(this.opts.body)||this.headersSent&&!this.resume){this.handler.onResponseError?.(this.controllerProxy,n);return}function r(i){if(!this.aborted){if(this.retryPending=!1,this.retryTimer=null,!i){this.retry();return}this.handler?.onResponseError?.(this.controllerProxy,i)}}this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryPending=!0,this.retryTimer=this.retryOpts.retry(n,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},r.bind(this))??null}#e(e){this.retryPending&&(this.aborted=!0,this.retryPending=!1,clearTimeout(this.retryTimer),this.retryTimer=null,this.handler.onResponseError?.(this.controllerProxy,e??new Nis))}};JKn.exports=FAt});var tJn=re((oMc,eJn)=>{"use strict";p();var Mis=fY(),Ois=TNe(),{kOriginless:XKn,kUrl:ZKn}=Oo(),QAt=class extends Mis{#e=null;#t=null;constructor(e,n={}){super(n),this.#e=e,this.#t=n,this[ZKn]=e[ZKn],this[XKn]=e[XKn]}dispatch(e,n){let r=new Ois({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:n});return this.#e.dispatch(e,r)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};eJn.exports=QAt});var rJn=re((cMc,nJn)=>{"use strict";p();var{InvalidArgumentError:UAt}=Wi(),Lis=RP(),GAt=class extends Lis{constructor(e,n){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new UAt("h2c-client: Only h2c protocol is supported");let{maxConcurrentStreams:r,pipelining:i,...s}=n??{},o=r??100,a=100;if(r!=null&&(!Number.isInteger(r)||r<1))throw new UAt("maxConcurrentStreams must be a positive integer, greater than 0");if(i!=null&&Number.isInteger(i)&&i>0&&(a=i),a>o)throw new UAt("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:o,pipelining:a,allowH2:!0,useH2c:!0})}};nJn.exports=GAt});var pJn=re((uMc,dJn)=>{"use strict";p();var aJn=require("node:assert"),{addAbortListener:Fis}=require("node:events"),{Readable:Qis}=require("node:stream"),{RequestAbortedError:cJn,NotSupportedError:Uis,InvalidArgumentError:Gis,AbortError:vNe}=Wi(),lJn=Zi(),{ReadableStreamFrom:$is}=Zi(),Kb=Symbol("kConsume"),RNe=Symbol("kReading"),vU=Symbol("kBody"),iJn=Symbol("kAbort"),uJn=Symbol("kContentType"),$At=Symbol("kContentLength"),WAt=Symbol("kUsed"),kNe=Symbol("kBytesRead"),Wis=()=>{},HAt=class extends Qis{constructor({resume:e,abort:n,contentType:r="",contentLength:i,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[iJn]=n,this[Kb]=null,this[kNe]=0,this[vU]=null,this[WAt]=!1,this[uJn]=r,this[$At]=Number.isFinite(i)?i:null,this[RNe]=!1}_destroy(e,n){!e&&!this._readableState.endEmitted&&(e=new cJn),e&&this[iJn](),this[WAt]?n(e):setImmediate(n,e)}on(e,n){return(e==="data"||e==="readable")&&(this[RNe]=!0,this[WAt]=!0),super.on(e,n)}addListener(e,n){return this.on(e,n)}off(e,n){let r=super.off(e,n);return(e==="data"||e==="readable")&&(this[RNe]=this.listenerCount("data")>0||this.listenerCount("readable")>0),r}removeListener(e,n){return this.off(e,n)}push(e){return e&&(this[kNe]+=e.length,this[Kb])?(BNe(this[Kb],e),this[RNe]?super.push(e):!0):super.push(e)}text(){return rae(this,"text")}json(){return rae(this,"json")}blob(){return rae(this,"blob")}bytes(){return rae(this,"bytes")}arrayBuffer(){return rae(this,"arrayBuffer")}async formData(){throw new Uis}get bodyUsed(){return lJn.isDisturbed(this)}get body(){return this[vU]||(this[vU]=$is(this),this[Kb]&&(this[vU].getReader(),aJn(this[vU].locked))),this[vU]}dump(e){let n=e?.signal;if(n!=null&&(typeof n!="object"||!("aborted"in n)))return Promise.reject(new Gis("signal must be an AbortSignal"));let r=e?.limit&&Number.isFinite(e.limit)?e.limit:128*1024;return n?.aborted?Promise.reject(n.reason??new vNe):this._readableState.closeEmitted?Promise.resolve(null):new Promise((i,s)=>{if((this[$At]&&this[$At]>r||this[kNe]>r)&&this.destroy(new vNe),n){let a=Fis(n,()=>{this.destroy(n.reason??new vNe)});this.on("close",function(){a[Symbol.dispose](),n.aborted?s(n.reason??new vNe):i(null)})}else this.on("close",i);this.on("error",Wis).on("data",()=>{this[kNe]>r&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&super.setEncoding(e),this}};function His(t){return t[vU]?.locked===!0||t[Kb]!==null}function qis(t){return lJn.isDisturbed(t)||His(t)}function rae(t,e){return aJn(!t[Kb]),new Promise((n,r)=>{if(qis(t)){let i=t._readableState;i.destroyed&&i.closeEmitted===!1?t.on("error",r).on("close",()=>{r(new TypeError("unusable"))}):r(i.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[Kb]={type:e,stream:t,resolve:n,reject:r,length:0,body:[]},t.on("error",function(i){jAt(this[Kb],i)}).on("close",function(){this[Kb].body!==null&&jAt(this[Kb],new cJn)}),jis(t[Kb])})})}function jis(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,i=e.buffer.length;for(let s=r;s0&&BNe(t,Buffer.from(n.lastChar.subarray(0,n.lastTotal-n.lastNeed))),e.endEmitted){oJn(t,e.encoding);return}for(t.stream.on("end",function(){oJn(this[Kb],this._readableState.encoding)}),t.stream.resume();t.stream.read()!=null;);}function qAt(t,e,n){if(t.length===0||e===0)return"";let r=t.length===1?t[0]:Buffer.concat(t,e),i=r.length,s=i>2&&r[0]===239&&r[1]===187&&r[2]===191?3:0;return!n||n==="utf8"||n==="utf-8"?r.utf8Slice(s,i):r.subarray(s,i).toString(n)}function sJn(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let n=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),r=0;for(let i=0;i{"use strict";p();var Vis=require("node:assert"),{AsyncResource:Yis}=require("node:async_hooks"),{Readable:zis}=pJn(),{InvalidArgumentError:LY,RequestAbortedError:mJn}=Wi(),fk=Zi();function iae(){}var NNe=class extends Yis{constructor(e,n){if(!e||typeof e!="object")throw new LY("invalid opts");let{signal:r,method:i,opaque:s,body:o,onInfo:a,responseHeaders:c,highWaterMark:u}=e;try{if(typeof n!="function")throw new LY("invalid callback");if(u!=null&&(!Number.isFinite(u)||u<0))throw new LY("invalid highWaterMark");if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new LY("signal must be an EventEmitter or EventTarget");if(i==="CONNECT")throw new LY("invalid method");if(a&&typeof a!="function")throw new LY("invalid onInfo callback");super("UNDICI_REQUEST")}catch(l){throw fk.isStream(o)&&fk.destroy(o.on("error",iae),l),l}this.method=i,this.responseHeaders=c||null,this.opaque=s||null,this.callback=n,this.res=null,this.abort=null,this.body=o,this.trailers={},this.context=null,this.controller=null,this.onInfo=a||null,this.highWaterMark=u,this.reason=null,this.removeAbortListener=null,r?.aborted?this.reason=r.reason??new mJn:r&&(this.removeAbortListener=fk.addAbortListener(r,()=>{if(this.reason=r.reason??new mJn,this.res){let l=this.res;this.res=null,fk.destroy(l.on("error",iae),this.reason)}else this.abort&&this.abort(this.reason)}))}onRequestStart(e,n){if(this.reason){e.abort(this.reason);return}Vis(this.callback),this.controller=e,this.abort=r=>e.abort(r),this.context=n}onResponseStart(e,n,r,i){let{callback:s,opaque:o,context:a,responseHeaders:c,highWaterMark:u}=this,l=e?.rawHeaders,d=c==="raw"?fk.parseRawHeaders(l):r;if(n<200){this.onInfo&&this.onInfo({statusCode:n,headers:d});return}let m=r,h=m?.["content-type"],f=m?.["content-length"],g=new zis({resume:()=>e.resume(),abort:A=>e.abort(A),contentType:h,contentLength:this.method!=="HEAD"&&f?Number(f):null,highWaterMark:u});if(this.removeAbortListener&&(g.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=g,s!==null)try{this.runInAsyncScope(s,null,null,{statusCode:n,statusText:i,headers:d,trailers:this.trailers,opaque:o,body:g,context:a})}catch(A){this.res=null,fk.destroy(g.on("error",iae),A),queueMicrotask(()=>{throw A})}}onResponseData(e,n){this.res&&this.res.push(n)===!1&&e.pause()}onResponseEnd(e,n){if(n&&typeof n=="object")for(let r of Object.keys(n))r==="__proto__"?Object.defineProperty(this.trailers,r,{value:n[r],enumerable:!0,configurable:!0,writable:!0}):this.trailers[r]=n[r];this.res?.push(null)}onResponseError(e,n){let{res:r,callback:i,body:s,opaque:o}=this;i&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(i,null,n,{opaque:o})})),r&&(this.res=null,queueMicrotask(()=>{fk.destroy(r.on("error",iae),n)})),s&&(this.body=null,fk.isStream(s)&&(s.on("error",iae),fk.destroy(s,n))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function hJn(t,e){if(e===void 0)return new Promise((n,r)=>{hJn.call(this,t,(i,s)=>i?r(i):n(s))});try{let n=new NNe(t,e);this.dispatch(t,n)}catch(n){if(typeof e!="function")throw n;let r=t?.opaque;queueMicrotask(()=>e(n,{opaque:r}))}}VAt.exports=hJn;VAt.exports.RequestHandler=NNe});var sae=re((hMc,yJn)=>{"use strict";p();var{addAbortListener:Kis}=Zi(),{RequestAbortedError:Jis}=Wi(),FY=Symbol("kListener"),$w=Symbol("kSignal");function gJn(t){t.abort?t.abort(t[$w]?.reason):t.reason=t[$w]?.reason??new Jis,AJn(t)}function Xis(t,e){if(t.reason=null,t[$w]=null,t[FY]=null,!!e){if(e.aborted){gJn(t);return}t[$w]=e,t[FY]=()=>{gJn(t)},Kis(t[$w],t[FY])}}function AJn(t){t[$w]&&("removeEventListener"in t[$w]?t[$w].removeEventListener("abort",t[FY]):t[$w].removeListener("abort",t[FY]),t[$w]=null,t[FY]=null)}yJn.exports={addSignal:Xis,removeSignal:AJn}});var xJn=re((gMc,_Jn)=>{"use strict";p();var Zis=require("node:assert"),{AsyncResource:ess}=require("node:async_hooks"),{InvalidArgumentError:QY,InvalidReturnValueError:tss}=Wi(),RU=Zi(),{addSignal:nss,removeSignal:EJn}=sae();function rss(){}function iss(t){return t.errored??t.writableErrored??t._writableState?.errored}function sss(){let t=new Error("Premature close");return t.code="ERR_STREAM_PREMATURE_CLOSE",t}function oss(t,e){let n=!1,r=()=>{t.removeListener("close",s),t.removeListener("error",o),t.removeListener("finish",a)},i=(c,u=!1)=>{n||(n=!0,r(),e(c,u))},s=()=>{let c=iss(t);i(c??(t.writableFinished?void 0:sss()))},o=c=>i(c,!0),a=()=>i();t.on("close",s),t.on("error",o),t.on("finish",a),t.closed?process.nextTick(s):t.writableFinished&&process.nextTick(a)}var YAt=class extends ess{constructor(e,n,r){if(!e||typeof e!="object")throw new QY("invalid opts");let{signal:i,method:s,opaque:o,body:a,onInfo:c,responseHeaders:u}=e;try{if(typeof r!="function")throw new QY("invalid callback");if(typeof n!="function")throw new QY("invalid factory");if(i&&typeof i.on!="function"&&typeof i.addEventListener!="function")throw new QY("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new QY("invalid method");if(c&&typeof c!="function")throw new QY("invalid onInfo callback");super("UNDICI_STREAM")}catch(l){throw RU.isStream(a)&&RU.destroy(a.on("error",rss),l),l}this.responseHeaders=u||null,this.opaque=o||null,this.factory=n,this.callback=r,this.res=null,this.abort=null,this.context=null,this.controller=null,this.trailers=null,this.body=a,this.onInfo=c||null,RU.isStream(a)&&a.on("error",l=>{this.onResponseError(this.controller,l)}),nss(this,i)}onRequestStart(e,n){if(this.reason){e.abort(this.reason);return}Zis(this.callback),this.controller=e,this.abort=r=>e.abort(r),this.context=n}onResponseStart(e,n,r,i){let{factory:s,opaque:o,context:a,responseHeaders:c}=this,u=e?.rawHeaders,l=c==="raw"?RU.parseRawHeaders(u):r;if(n<200){this.onInfo&&this.onInfo({statusCode:n,headers:l});return}if(this.factory=null,s===null)return;let d=this.runInAsyncScope(s,null,{statusCode:n,headers:l,opaque:o,context:a});if(!d||typeof d.write!="function"||typeof d.end!="function"||typeof d.on!="function")throw new tss("expected Writable");oss(d,(h,f)=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(h||!A?.readable)&&RU.destroy(A,f?void 0:h),this.callback=null,this.runInAsyncScope(g,null,h||null,{opaque:y,trailers:E}),h&&_(h)}),d.on("drain",()=>e.resume()),this.res=d,(d.writableNeedDrain!==void 0?d.writableNeedDrain:d._writableState?.needDrain)===!0&&e.pause()}onResponseData(e,n){let{res:r}=this;r&&r.write(n)===!1&&e.pause()}onResponseEnd(e,n){let{res:r}=this;EJn(this),r&&(n&&typeof n=="object"&&(this.trailers=n),r.end())}onResponseError(e,n){let{res:r,callback:i,opaque:s,body:o}=this;EJn(this),this.factory=null,r?(this.res=null,RU.destroy(r,n)):i&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(i,null,n,{opaque:s})})),o&&(this.body=null,RU.destroy(o,n))}};function bJn(t,e,n){if(n===void 0)return new Promise((r,i)=>{bJn.call(this,t,e,(s,o)=>s?i(s):r(o))});try{let r=new YAt(t,e,n);this.dispatch(t,r)}catch(r){if(typeof n!="function")throw r;let i=t?.opaque;queueMicrotask(()=>n(r,{opaque:i}))}}_Jn.exports=bJn});var wJn=re((yMc,IJn)=>{"use strict";p();var{Readable:CJn,Duplex:ass,PassThrough:css}=require("node:stream"),lss=require("node:assert"),{AsyncResource:uss}=require("node:async_hooks"),{InvalidArgumentError:oae,InvalidReturnValueError:dss,RequestAbortedError:zAt}=Wi(),FP=Zi(),{kBodyUsed:pss}=Oo(),{addSignal:mss,removeSignal:hss}=sae();function SJn(){}var UY=Symbol("resume"),KAt=class extends CJn{constructor(){super({autoDestroy:!0}),this[UY]=null,this[pss]=!0}_read(){let{[UY]:e}=this;e&&(this[UY]=null,e())}_destroy(e,n){this._read(),n(e)}},JAt=class extends CJn{constructor(e){super({autoDestroy:!0}),this[UY]=e}_read(){this[UY]()}_destroy(e,n){!e&&!this._readableState.endEmitted&&(e=new zAt),n(e)}},XAt=class extends uss{constructor(e,n){if(!e||typeof e!="object")throw new oae("invalid opts");if(typeof n!="function")throw new oae("invalid handler");let{signal:r,method:i,opaque:s,onInfo:o,responseHeaders:a}=e;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new oae("signal must be an EventEmitter or EventTarget");if(i==="CONNECT")throw new oae("invalid method");if(o&&typeof o!="function")throw new oae("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=a||null,this.handler=n,this.abort=null,this.context=null,this.onInfo=o||null,this.req=new KAt().on("error",SJn),this.ret=new ass({readableObjectMode:e.objectMode,autoDestroy:!0,read:()=>{let{body:c}=this;c?.resume&&c.resume()},write:(c,u,l)=>{let{req:d}=this;d.push(c,u)||d._readableState.destroyed?l():d[UY]=l},destroy:(c,u)=>{let{body:l,req:d,res:m,ret:h,abort:f}=this;!c&&!h._readableState.endEmitted&&(c=new zAt),f&&c&&f(),FP.destroy(l,c),FP.destroy(d,c),FP.destroy(m,c),hss(this),u(c)}}).on("prefinish",()=>{let{req:c}=this;c.push(null)}),this.res=null,mss(this,r)}onRequestStart(e,n){let{res:r}=this;if(this.reason){e.abort(this.reason);return}lss(!r,"pipeline cannot be retried"),this.abort=i=>e.abort(i),this.context=n}onResponseStart(e,n,r,i){let{opaque:s,handler:o,context:a}=this;if(n<200){if(this.onInfo){let u=e?.rawHeaders,l=this.responseHeaders==="raw"?FP.parseRawHeaders(u):r;this.onInfo({statusCode:n,headers:l})}return}this.res=new JAt(()=>e.resume());let c;try{this.handler=null;let u=e?.rawHeaders,l=this.responseHeaders==="raw"?FP.parseRawHeaders(u):r;c=this.runInAsyncScope(o,null,{statusCode:n,headers:l,opaque:s,body:this.res,context:a})}catch(u){throw this.res.on("error",SJn),u}if(!c||typeof c.on!="function")throw new dss("expected Readable");c.on("data",u=>{let{ret:l,body:d}=this;!l.push(u)&&d.pause&&d.pause()}).on("error",u=>{let{ret:l}=this;FP.destroy(l,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||FP.destroy(u,new zAt)}),this.body=c}onResponseData(e,n){let{res:r}=this;r.push(n)===!1&&e.pause()}onResponseEnd(e,n){let{res:r}=this;r.push(null)}onResponseError(e,n){let{ret:r}=this;this.handler=null,FP.destroy(r,n)}};function fss(t,e){try{let n=new XAt(t,e);return this.dispatch({...t,body:n.req},n),n.ret}catch(n){return new css().destroy(n)}}IJn.exports=fss});var DJn=re((bMc,NJn)=>{"use strict";p();var{InvalidArgumentError:ZAt,SocketError:TJn}=Wi(),{AsyncResource:gss}=require("node:async_hooks"),Ass=require("node:assert"),vJn=Zi(),{kHTTP2Stream:RJn}=Oo(),{addSignal:yss,removeSignal:kJn}=sae(),eyt=class extends gss{constructor(e,n){if(!e||typeof e!="object")throw new ZAt("invalid opts");if(typeof n!="function")throw new ZAt("invalid callback");let{signal:r,opaque:i,responseHeaders:s}=e;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new ZAt("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=i||null,this.callback=n,this.abort=null,this.context=null,yss(this,r)}onRequestStart(e,n){if(this.reason){e.abort(this.reason);return}Ass(this.callback),this.abort=r=>e.abort(r),this.context=n}onResponseStart(){throw new TJn("bad upgrade",null)}onRequestUpgrade(e,n,r,i){let s=i[RJn]===!0?200:101;if(n!==s){let d=i[RJn]===!0?null:vJn.getSocketInfo(i);e.abort(new TJn("bad upgrade",d));return}let{callback:o,opaque:a,context:c}=this;kJn(this),this.callback=null;let u=e?.rawHeaders,l=this.responseHeaders==="raw"?vJn.parseRawHeaders(u):r;this.runInAsyncScope(o,null,null,{headers:l,socket:i,opaque:a,context:c})}onResponseError(e,n){let{callback:r,opaque:i}=this;kJn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,n,{opaque:i})}))}};function BJn(t,e){if(e===void 0)return new Promise((n,r)=>{BJn.call(this,t,(i,s)=>i?r(i):n(s))});try{let n=new eyt(t,e),r={...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"};this.dispatch(r,n)}catch(n){if(typeof e!="function")throw n;let r=t?.opaque;queueMicrotask(()=>e(n,{opaque:r}))}}NJn.exports=BJn});var LJn=re((xMc,OJn)=>{"use strict";p();var Ess=require("node:assert"),{AsyncResource:bss}=require("node:async_hooks"),{InvalidArgumentError:tyt,SocketError:_ss}=Wi(),xss=Zi(),{addSignal:Sss,removeSignal:PJn}=sae(),nyt=class extends bss{constructor(e,n){if(!e||typeof e!="object")throw new tyt("invalid opts");if(typeof n!="function")throw new tyt("invalid callback");let{signal:r,opaque:i,responseHeaders:s}=e;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new tyt("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=i||null,this.responseHeaders=s||null,this.callback=n,this.abort=null,Sss(this,r)}onRequestStart(e,n){if(this.reason){e.abort(this.reason);return}Ess(this.callback),this.abort=r=>e.abort(r),this.context=n}onResponseStart(){throw new _ss("bad connect",null)}onRequestUpgrade(e,n,r,i){let{callback:s,opaque:o,context:a}=this;PJn(this),this.callback=null;let c=r,u=e?.rawHeaders;c!=null&&(c=this.responseHeaders==="raw"?xss.parseRawHeaders(u):r),this.runInAsyncScope(s,null,null,{statusCode:n,headers:c,socket:i,opaque:o,context:a})}onResponseError(e,n){let{callback:r,opaque:i}=this;PJn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,n,{opaque:i})}))}};function MJn(t,e){if(e===void 0)return new Promise((n,r)=>{MJn.call(this,t,(i,s)=>i?r(i):n(s))});try{let n=new nyt(t,e),r={...t,method:"CONNECT"};this.dispatch(r,n)}catch(n){if(typeof e!="function")throw n;let r=t?.opaque;queueMicrotask(()=>e(n,{opaque:r}))}}OJn.exports=MJn});var FJn=re((CMc,GY)=>{"use strict";p();GY.exports.request=fJn();GY.exports.stream=xJn();GY.exports.pipeline=wJn();GY.exports.upgrade=DJn();GY.exports.connect=LJn()});var iyt=re((wMc,UJn)=>{"use strict";p();var{UndiciError:Css}=Wi(),QJn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),ryt=class extends Css{constructor(e){super(e),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[QJn]===!0}get[QJn](){return!0}};UJn.exports={MockNotMatchedError:ryt}});var kU=re((vMc,GJn)=>{"use strict";p();GJn.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log"),kTotalDispatchCount:Symbol("total dispatch count")}});var cae=re((kMc,ZJn)=>{"use strict";p();var{MockNotMatchedError:$Y}=iyt(),{kDispatches:aae,kMockAgent:Iss,kOriginalDispatch:wss,kOrigin:Tss,kGetNetConnect:vss,kTotalDispatchCount:ayt}=kU(),{serializePathWithQuery:Rss,parseHeaders:$Jn}=Zi(),{STATUS_CODES:kss}=require("node:http"),{types:{isPromise:DNe}}=require("node:util"),{InvalidArgumentError:BU}=Wi(),Jb=Symbol("request aborted");function Ww(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}function HJn(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e.toLocaleLowerCase(),n]))}function qJn(t,e){if(Array.isArray(t)){for(let n=0;n"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[n,r]of Object.entries(t.headers)){let i=qJn(e,n);if(!Ww(r,i))return!1}return!0}function Bss(t){if(typeof t!="string")return t;let e=new URLSearchParams(t),n=new URLSearchParams;for(let[r,i]of e.entries()){if(r=r.replace("[]",""),/^(['"]).*\1$/.test(i)){n.append(r,i);continue}if(i.includes(",")){let o=i.split(",");for(let a of o)n.append(r,a);continue}n.append(r,i)}return n}function syt(t){if(typeof t!="string")return t;let e=t.split("?",3);if(e.length!==2)return t;let n=new URLSearchParams(e.pop());return n.sort(),[...e,n.toString()].join("?")}function Nss(t,{path:e,method:n,body:r,headers:i}){let s=Ww(t.path,e),o=Ww(t.method,n),a=typeof t.body<"u"?Ww(t.body,r):!0,c=jJn(t,i);return s&&o&&a&&c}function VJn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):typeof t=="object"?JSON.stringify(t):t?t.toString():""}function YJn(t,e){let n=e.query?Rss(e.path,e.query):e.path,r=typeof n=="string"?syt(n):n,i=WJn(r),s=t.filter(({consumed:o})=>!o).filter(({path:o,ignoreTrailingSlash:a})=>a?Ww(WJn(syt(o)),i):Ww(syt(o),r));if(s.length===0)throw new $Y(`Mock dispatch not matched for path '${r}'`);if(s=s.filter(({method:o})=>Ww(o,e.method)),s.length===0)throw new $Y(`Mock dispatch not matched for method '${e.method}' on path '${r}'`);if(s=s.filter(({body:o})=>typeof o<"u"?Ww(o,e.body):!0),s.length===0)throw new $Y(`Mock dispatch not matched for body '${e.body}' on path '${r}'`);if(s=s.filter(o=>jJn(o,e.headers)),s.length===0){let o=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new $Y(`Mock dispatch not matched for headers '${o}' on path '${r}'`)}return s[0]}function Dss(t,e,n,r){let i={timesInvoked:0,times:1,persist:!1,consumed:!1,...r},s=typeof n=="function"?{callback:n}:{...n},o={...i,...e,pending:!0,data:{error:null,...s}};return t.push(o),t[ayt]=(t[ayt]||0)+1,o}function PNe(t,e){let n=t.findIndex(r=>r.consumed?Nss(r,e):!1);n!==-1&&t.splice(n,1)}function WJn(t){if(typeof t!="string")return t;for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}function zJn(t){let{path:e,method:n,body:r,headers:i,query:s}=t;return{path:e,method:n,body:r,headers:i,query:s}}function cyt(t){let e=Object.keys(t),n=[];for(let r=0;r=o,r.pending=s{if(d==null||typeof d!="object"){e.onResponseError(null,new BU("reply options callback must return an object"));return}oyt(i,r,n,t,e,{...u,...d})},d=>{e.onResponseError(null,d)}),!0;if(l==null||typeof l!="object")throw new BU("reply options callback must return an object");return oyt(i,r,n,t,e,{...u,...l})}return oyt(i,r,n,t,e)}function oyt(t,e,n,r,i,s){let{data:o,delay:a}=e,c=s??o;if(c.error!==null)return PNe(t,n),i.onResponseError(null,c.error),!0;let u=!1,l=null,d={paused:!1,rawHeaders:null,rawTrailers:null,pause(){this.paused=!0},resume(){this.paused=!1},abort:y=>{u||(u=!0,l!==null&&(clearTimeout(l),l=null),i.onResponseError?.(d,y))}},m=r,h=t;if(i.onRequestStart?.(d,null),u)return!0;let f=Mss(r.body,i,d,()=>u);if(DNe(f))return f.then(y=>{y!==Jb&&(y!==r.body&&(m={...r,body:y}),g())},y=>d.abort(y)),!0;if(f===Jb)return!0;f!==r.body&&(m={...r,body:f}),g();function g(){if(c.callback){let{callback:y,...E}=c,_;try{_=y(m)}catch(S){PNe(t,n),i.onResponseError(null,S);return}if(DNe(_)){_.then(S=>{if(S==null||typeof S!="object"){i.onResponseError(null,new BU("reply options callback must return an object"));return}A(h,{...E,...S})},S=>{i.onResponseError(null,S)});return}if(_==null||typeof _!="object")throw new BU("reply options callback must return an object");A(h,{...E,..._});return}typeof a=="number"&&a>0?l=setTimeout(()=>{l=null,A(h)},a):A(h)}function A(y,E=c){if(u)return;let{statusCode:_,data:S,headers:C,trailers:I}=E,w=Array.isArray(r.headers)?uyt(r.headers):r.headers,k=typeof S=="function"?S({...m,headers:w}):S;if(DNe(k))return k.then($=>A(y,{...E,data:$}));if(u)return;let N=VJn(k),O=cyt(C??{}),W=cyt(I??{});d.rawHeaders=O,d.rawTrailers=W,i.onResponseStart?.(d,_,$Jn(O),KJn(_)),i.onResponseData?.(d,Buffer.from(N)),i.onResponseEnd?.(d,$Jn(W)),PNe(y,n)}return!0}function Mss(t,e,n,r){if(typeof e.onBodySent!="function"&&typeof e.onRequestSent!="function")return t;if(t==null)return MNe(e,n,r)?t:Jb;if(t&&typeof t[Symbol.asyncIterator]=="function")return Oss(t,e,n,r);if(Lss(t)){let i=[];for(let s of t)if(r()||(i.push(s),!lyt(e,n,s)||r()))return Jb;return MNe(e,n,r)?i:Jb}return r()||!lyt(e,n,t)?Jb:MNe(e,n,r)?t:Jb}async function Oss(t,e,n,r){let i=[];for await(let s of t)if(r()||(i.push(s),!lyt(e,n,s)||r()))return Jb;return MNe(e,n,r)?{async*[Symbol.asyncIterator](){yield*i}}:Jb}function lyt(t,e,n){try{return t.onBodySent?.(n),!0}catch(r){return e.abort(r),!1}}function MNe(t,e,n){try{return t.onRequestSent?.(),!n()}catch(r){return e.abort(r),!1}}function Lss(t){return typeof t!="string"&&!Buffer.isBuffer(t)&&!ArrayBuffer.isView(t)&&typeof t[Symbol.iterator]=="function"}function Fss(){let t=this[Iss],e=this[Tss],n=this[wss];return function(i,s){if(t.isMockActive)try{JJn.call(this,i,s)}catch(o){if(o.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let a=t[vss](),c=this[aae][ayt]||this[aae].length,l=`, ${this[aae].filter(({consumed:d})=>!d).length} interceptor(s) remaining out of ${c} defined`;if(a===!1)throw new $Y(`${o.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${l}`);if(XJn(a,e))n.call(this,"__mockAgentBodyForDispatch"in i?{...i,body:i.__mockAgentBodyForDispatch}:i,s);else throw new $Y(`${o.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)${l}`)}else throw o}else n.call(this,i,s)}}function XJn(t,e){let n=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(r=>Ww(r,n.host)))}function Qss(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}function Uss(t){let{agent:e,...n}=t;if("enableCallHistory"in n&&typeof n.enableCallHistory!="boolean")throw new BU("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in n&&typeof n.acceptNonStandardSearchParameters!="boolean")throw new BU("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in n&&typeof n.ignoreTrailingSlash!="boolean")throw new BU("options.ignoreTrailingSlash must to be a boolean");return n}ZJn.exports={getResponseData:VJn,getMockDispatch:YJn,addMockDispatch:Dss,deleteMockDispatch:PNe,buildKey:zJn,generateKeyValues:cyt,matchValue:Ww,getResponse:Pss,getStatusText:KJn,mockDispatch:JJn,buildMockDispatch:Fss,checkNetConnect:XJn,buildAndValidateMockOptions:Uss,getHeaderByName:qJn,buildHeadersFromArray:uyt,normalizeSearchParams:Bss,normalizeOrigin:Qss}});var Ayt=re((NMc,gyt)=>{"use strict";p();var{getResponseData:Gss,buildKey:$ss,addMockDispatch:dyt}=cae(),{kDispatches:ONe,kDispatchKey:LNe,kDefaultHeaders:pyt,kDefaultTrailers:myt,kContentLength:hyt,kMockDispatch:FNe,kIgnoreTrailingSlash:QNe}=kU(),{InvalidArgumentError:Hw}=Wi(),{serializePathWithQuery:Wss}=Zi(),{types:{isPromise:Hss}}=require("node:util"),WY=class{constructor(e){this[FNe]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new Hw("waitInMs must be a valid integer > 0");return this[FNe].delay=e,this}persist(){return this[FNe].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new Hw("repeatTimes must be a valid integer > 0");return this[FNe].times=e,this}},fyt=class{constructor(e,n){if(typeof e!="object")throw new Hw("opts must be an object");if(typeof e.path>"u")throw new Hw("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=Wss(e.path,e.query);else{let r=new URL(e.path,"data://");e.path=r.pathname+r.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[LNe]=$ss(e),this[ONe]=n,this[QNe]=e.ignoreTrailingSlash??!1,this[pyt]={},this[myt]={},this[hyt]=!1}createMockScopeDispatchData({statusCode:e,data:n,responseOptions:r}){let i=Gss(n),s=this[hyt]?{"content-length":i.length}:{},o={...this[pyt],...s,...r.headers},a={...this[myt],...r.trailers};return{statusCode:e,data:n,headers:o,trailers:a}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new Hw("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new Hw("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=c=>{if(typeof c!="object"||c===null)throw new Hw("reply options callback must return an object");let u={data:"",responseOptions:{},...c};return this.validateReplyParameters(u),{...this.createMockScopeDispatchData(u)}},o=c=>{let u=e(c);return Hss(u)?u.then(s):s(u)},a=dyt(this[ONe],this[LNe],o,{ignoreTrailingSlash:this[QNe]});return new WY(a)}let n={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(n);let r=this.createMockScopeDispatchData(n),i=dyt(this[ONe],this[LNe],r,{ignoreTrailingSlash:this[QNe]});return new WY(i)}replyWithError(e){if(typeof e>"u")throw new Hw("error must be defined");let n=dyt(this[ONe],this[LNe],{error:e},{ignoreTrailingSlash:this[QNe]});return new WY(n)}defaultReplyHeaders(e){if(typeof e>"u")throw new Hw("headers must be defined");return this[pyt]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new Hw("trailers must be defined");return this[myt]=e,this}replyContentLength(){return this[hyt]=!0,this}};gyt.exports.MockInterceptor=fyt;gyt.exports.MockScope=WY});var _yt=re((PMc,oXn)=>{"use strict";p();var{promisify:qss}=require("node:util"),jss=RP(),{buildMockDispatch:Vss}=cae(),{kDispatches:yyt,kMockAgent:eXn,kClose:tXn,kOriginalClose:nXn,kOrigin:rXn,kOriginalDispatch:Yss,kConnected:Eyt,kIgnoreTrailingSlash:iXn}=kU(),{MockInterceptor:zss}=Ayt(),sXn=Oo(),{InvalidArgumentError:Kss}=Wi(),byt=class extends jss{constructor(e,n){if(!n||!n.agent||typeof n.agent.dispatch!="function")throw new Kss("Argument opts.agent must implement Agent");super(e,n),this[eXn]=n.agent,this[rXn]=e,this[iXn]=n.ignoreTrailingSlash??!1,this[yyt]=[],this[Eyt]=1,this[Yss]=this.dispatch,this[nXn]=this.close.bind(this),this.dispatch=Vss.call(this),this.close=this[tXn]}get[sXn.kConnected](){return this[Eyt]}intercept(e){return new zss(e&&{ignoreTrailingSlash:this[iXn],...e},this[yyt])}cleanMocks(){this[yyt]=[]}async[tXn](){await qss(this[nXn])(),this[Eyt]=0,this[eXn][sXn.kClients].delete(this[rXn])}};oXn.exports=byt});var Cyt=re((OMc,Syt)=>{"use strict";p();var{kMockCallHistoryAddLog:Jss}=kU(),{InvalidArgumentError:GP}=Wi();function QP(t,e,n,r,i){switch(e.operator){case"OR":return r.push(...n(t,i)),r;case"AND":return n(t,r);default:throw new GP("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}function Xss(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new GP("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}function UP(t){return(e,n=this.logs)=>{if(typeof e=="string"||e==null)return n.filter(r=>r[t]===e);if(e instanceof RegExp)return n.filter(r=>e.test(r[t]));throw new GP(`${t} parameter should be one of string, regexp, undefined or null`)}}function Zss(t){try{let e=new URL(t.path,t.origin);return e.search.length!==0||(e.search=new URLSearchParams(t.query).toString()),e}catch(e){throw new GP("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}var UNe=class{constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let n=Zss(e);this.fullUrl=n.toString(),this.origin=n.origin,this.path=n.pathname,this.searchParams=Object.fromEntries(n.searchParams),this.protocol=n.protocol,this.host=n.host,this.port=n.port,this.hash=n.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let e={betweenKeyValueSeparator:"->",betweenPairSeparator:"|"},n="";return this.toMap().forEach((r,i)=>{(typeof r=="string"||r===void 0||r===null)&&(n=`${n}${i}${e.betweenKeyValueSeparator}${r}${e.betweenPairSeparator}`),(typeof r=="object"&&r!==null||Array.isArray(r))&&(n=`${n}${i}${e.betweenKeyValueSeparator}${JSON.stringify(r)}${e.betweenPairSeparator}`)}),n.slice(0,-1)}},xyt=class{logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if(typeof e!="number")throw new GP("nthCall must be called with a number");if(!Number.isInteger(e))throw new GP("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new GP("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(e-1)}filterCalls(e,n){if(this.logs.length===0)return this.logs;if(typeof e=="function")return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter(r=>e.test(r.toString()));if(typeof e=="object"&&e!==null){if(Object.keys(e).length===0)return this.logs;let r={operator:"OR",...Xss(n)},i=r.operator==="AND"?this.logs:[];return"protocol"in e&&(i=QP(e.protocol,r,this.filterCallsByProtocol,i,this.logs)),"host"in e&&(i=QP(e.host,r,this.filterCallsByHost,i,this.logs)),"port"in e&&(i=QP(e.port,r,this.filterCallsByPort,i,this.logs)),"origin"in e&&(i=QP(e.origin,r,this.filterCallsByOrigin,i,this.logs)),"path"in e&&(i=QP(e.path,r,this.filterCallsByPath,i,this.logs)),"hash"in e&&(i=QP(e.hash,r,this.filterCallsByHash,i,this.logs)),"fullUrl"in e&&(i=QP(e.fullUrl,r,this.filterCallsByFullUrl,i,this.logs)),"method"in e&&(i=QP(e.method,r,this.filterCallsByMethod,i,this.logs)),[...new Set(i)]}throw new GP("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=UP.call(this,"protocol");filterCallsByHost=UP.call(this,"host");filterCallsByPort=UP.call(this,"port");filterCallsByOrigin=UP.call(this,"origin");filterCallsByPath=UP.call(this,"path");filterCallsByHash=UP.call(this,"hash");filterCallsByFullUrl=UP.call(this,"fullUrl");filterCallsByMethod=UP.call(this,"method");clear(){this.logs=[]}[Jss](e){let n=new UNe(e);return this.logs.push(n),n}*[Symbol.iterator](){for(let e of this.calls())yield e}};Syt.exports.MockCallHistory=xyt;Syt.exports.MockCallHistoryLog=UNe});var vyt=re((FMc,mXn)=>{"use strict";p();var{promisify:eos}=require("node:util"),tos=AU(),{buildMockDispatch:nos}=cae(),{kDispatches:Iyt,kMockAgent:aXn,kClose:cXn,kOriginalClose:lXn,kOrigin:uXn,kOriginalDispatch:ros,kConnected:wyt,kIgnoreTrailingSlash:dXn}=kU(),{MockInterceptor:ios}=Ayt(),pXn=Oo(),{InvalidArgumentError:sos}=Wi(),Tyt=class extends tos{constructor(e,n){if(!n||!n.agent||typeof n.agent.dispatch!="function")throw new sos("Argument opts.agent must implement Agent");super(e,n),this[aXn]=n.agent,this[uXn]=e,this[dXn]=n.ignoreTrailingSlash??!1,this[Iyt]=[],this[wyt]=1,this[ros]=this.dispatch,this[lXn]=this.close.bind(this),this.dispatch=nos.call(this),this.close=this[cXn]}get[pXn.kConnected](){return this[wyt]}intercept(e){return new ios(e&&{ignoreTrailingSlash:this[dXn],...e},this[Iyt])}cleanMocks(){this[Iyt]=[]}async[cXn](){await eos(this[lXn])(),this[wyt]=0,this[aXn][pXn.kClients].delete(this[uXn])}};mXn.exports=Tyt});var fXn=re((GMc,hXn)=>{"use strict";p();var{Transform:oos}=require("node:stream"),{Console:aos}=require("node:console"),cos=process.versions.icu?"\u2705":"Y ",los=process.versions.icu?"\u274C":"N ";hXn.exports=class{constructor({disableColors:e}={}){this.transform=new oos({transform(n,r,i){i(null,n)}}),this.logger=new aos({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let n=e.map(({method:r,path:i,data:{statusCode:s},persist:o,times:a,timesInvoked:c,origin:u})=>({Method:r,Origin:u,Path:i,"Status code":s,Persistent:o?cos:los,Invocations:c,Remaining:o?1/0:a-c}));return this.logger.table(n),this.transform.read().toString()}}});var Nyt=re((WMc,xXn)=>{"use strict";p();var{kClients:$P}=Oo(),uos=_U(),{kAgent:Ryt,kMockAgentSet:lae,kMockAgentGet:gXn,kDispatches:uae,kIsMockActive:GNe,kNetConnect:NU,kGetNetConnect:dos,kOptions:$Ne,kFactory:dae,kMockAgentRegisterCallHistory:kyt,kMockAgentIsCallHistoryEnabled:pae,kMockAgentAddCallHistoryLog:AXn,kMockAgentMockCallHistoryInstance:HY,kMockAgentAcceptsNonStandardSearchParameters:yXn,kMockCallHistoryAddLog:pos,kIgnoreTrailingSlash:EXn}=kU(),mos=_yt(),hos=vyt(),{matchValue:fos,normalizeSearchParams:gos,buildAndValidateMockOptions:Aos,normalizeOrigin:bXn}=cae(),{InvalidArgumentError:_Xn,UndiciError:yos}=Wi(),Eos=fY(),bos=fXn(),{MockCallHistory:_os}=Cyt(),Byt=class extends Eos{constructor(e={}){super(e);let n=Aos(e);if(this[NU]=!0,this[GNe]=!0,this[pae]=n.enableCallHistory??!1,this[yXn]=n.acceptNonStandardSearchParameters??!1,this[EXn]=n.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new _Xn("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new uos(e);this[Ryt]=r,this[$P]=r[$P],this[$Ne]=n,this[pae]&&this[kyt]()}get(e){let n=bXn(e),r=this[EXn]?n.replace(/\/$/,""):n,i=this[gXn](r);return i||(i=this[dae](r),this[lae](r,i)),i}dispatch(e,n){e.origin=bXn(e.origin);let r=this.get(e.origin);this[AXn](e);let i=this[yXn],s={...e};if(s.allowH2===!1){let o=`${s.origin}#http1-only`;if(!this[$P].has(o)){let a=this[dae](s.origin);a[uae]=r[uae],this[lae](o,a)}}if(i&&s.path){let[o,a]=s.path.split("?"),c=gos(a,i);s.path=`${o}?${c}`}return this[Ryt].dispatch(s,n)}async close(){this.clearCallHistory(),await this[Ryt].close(),this[$P].clear()}deactivate(){this[GNe]=!1}activate(){this[GNe]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[NU])?this[NU].push(e):this[NU]=[e];else if(typeof e>"u")this[NU]=!0;else throw new _Xn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[NU]=!1}enableCallHistory(){return this[pae]=!0,this}disableCallHistory(){return this[pae]=!1,this}getCallHistory(){return this[HY]}clearCallHistory(){this[HY]!==void 0&&this[HY].clear()}get isMockActive(){return this[GNe]}[kyt](){this[HY]===void 0&&(this[HY]=new _os)}[AXn](e){this[pae]&&(this[kyt](),this[HY][pos](e))}[lae](e,n){this[$P].set(e,n)}[dae](e){let n=Object.assign({agent:this},this[$Ne]);return this[$Ne]&&this[$Ne].connections===1?new mos(e,n):new hos(e,n)}[gXn](e){let n=this[$P].get(e);if(n)return n;if(typeof e!="string"){let r=this[dae]("http://localhost:9999");return this[lae](e,r),r}for(let[r,i]of Array.from(this[$P]))if(i&&typeof r!="string"&&fos(r,e)){let s=this[dae](e);return this[lae](e,s),s[uae]=i[uae],s}}[dos](){return this[NU]}pendingInterceptors(){let e=this[$P];return Array.from(e.entries()).flatMap(([n,r])=>r[uae].map(i=>({...i,origin:n}))).filter(({pending:n})=>n)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new bos}={}){let n=this.pendingInterceptors();if(n.length!==0)throw new yos(n.length===1?`1 interceptor is pending: + +${e.format(n)}`.trim():`${n.length} interceptors are pending: + +${e.format(n)}`.trim())}};xXn.exports=Byt});var Dyt=re((qMc,wXn)=>{"use strict";p();var{InvalidArgumentError:xos}=Wi(),{runtimeFeatures:Sos}=yY();function Cos(t={}){let{ignoreHeaders:e=[],excludeHeaders:n=[],matchHeaders:r=[],caseSensitive:i=!1}=t;return{ignore:new Set(e.map(s=>i?s:s.toLowerCase())),exclude:new Set(n.map(s=>i?s:s.toLowerCase())),match:new Set(r.map(s=>i?s:s.toLowerCase()))}}var SXn=Sos.has("crypto")?require("node:crypto"):null,Ios=SXn?.hash?t=>SXn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function IXn(t){return Array.isArray(t)&&(t.length&1)===0}function wos(t=[]){return t.length===0?()=>!1:function(n){let r;for(let i of t)if(typeof i=="string"){if(r||(r=n.toLowerCase()),r.includes(i.toLowerCase()))return!0}else if(i instanceof RegExp&&i.test(n))return!0;return!1}}function Tos(t){let e={};if(!t)return e;if(IXn(t)){for(let n=0;n{"use strict";p();var{writeFile:Ros,readFile:kos,mkdir:Bos}=require("node:fs/promises"),{dirname:Nos,resolve:TXn}=require("node:path"),{setTimeout:Dos,clearTimeout:vXn}=require("node:timers"),{InvalidArgumentError:RXn,UndiciError:Pos}=Wi(),{hashId:Mos,isUrlExcludedFactory:Oos,normalizeHeaders:kXn,createHeaderFilters:BXn}=Dyt();function Los(t,e,n){if(e===!1)return`${t.origin}${t.pathname}`;if(n){let r=String(n(t.searchParams)??"");return r?`${t.origin}${t.pathname}?${r}`:`${t.origin}${t.pathname}`}return t.toString()}function Fos(t,e,n){return e===!1?"":n?String(n(t)??""):t?String(t):""}function mae(t,e,n={}){let r=new URL(t.path,t.origin),i=t._normalizedHeaders||kXn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=i),{method:t.method||"GET",url:Los(r,n.matchQuery,n.normalizeQuery),headers:NXn(i,e,n),body:Fos(t.body,n.matchBody,n.normalizeBody)}}function NXn(t,e,n={}){if(!t||typeof t!="object")return{};let{caseSensitive:r=!1}=n,i={},{ignore:s,exclude:o,match:a}=e;for(let[c,u]of Object.entries(t)){let l=r?c:c.toLowerCase();o.has(l)||s.has(l)||a.size!==0&&!a.has(l)||(i[l]=u)}return i}function DXn(t,e,n={}){if(!t||typeof t!="object")return{};let{caseSensitive:r=!1}=n,i={},{exclude:s}=e;for(let[o,a]of Object.entries(t)){let c=r?o:o.toLowerCase();s.has(c)||(i[c]=a)}return i}function hae(t){let e=[t.method,t.url];if(t.headers&&typeof t.headers=="object"){let r=Object.keys(t.headers).sort();for(let i of r){let s=Array.isArray(t.headers[i])?t.headers[i]:[t.headers[i]];e.push(i);for(let o of s.sort())e.push(String(o))}}e.push(t.body);let n=e.join("|");return Mos(n)}var Pyt=class{#e;#t;#n=new Map;#r;#i=1/0;#s=!1;#o;constructor(e={}){this.#r=e.snapshotPath,this.#i=e.maxSnapshots||1/0,this.#s=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,normalizeBody:e.normalizeBody||void 0,matchQuery:e.matchQuery!==!1,normalizeQuery:e.normalizeQuery||void 0,caseSensitive:e.caseSensitive||!1},this.#o=BXn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=Oos(e.excludeUrls),this.#s&&this.#r&&this.#a()}async record(e,n){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let r=mae(e,this.#o,this.matchOptions),i=hae(r),s=kXn(n.headers),o={statusCode:n.statusCode,headers:DXn(s,this.#o,this.matchOptions),body:Buffer.isBuffer(n.body)?n.body.toString("base64"):Buffer.from(String(n.body||"")).toString("base64"),trailers:n.trailers};if(this.#n.size>=this.#i&&!this.#n.has(i)){let c=this.#n.keys().next().value;this.#n.delete(c)}let a=this.#n.get(i);a&&a.responses?(a.responses.push(o),a.timestamp=new Date().toISOString()):this.#n.set(i,{request:r,responses:[o],callCount:0,timestamp:new Date().toISOString()}),this.#s&&this.#r&&this.#l()}isUrlExcluded(e){let n=new URL(e.path,e.origin).toString();return this.#t(n)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let n=mae(e,this.#o,this.matchOptions),r=hae(n),i=this.#n.get(r);if(!i)return;let s=i.callCount||0,o=Math.min(s,i.responses.length-1);return i.callCount=s+1,{...i,response:i.responses[o]}}async loadSnapshots(e){let n=e||this.#r;if(!n)throw new RXn("Snapshot path is required");try{let r=await kos(TXn(n),"utf8"),i=JSON.parse(r);if(Array.isArray(i)){this.#n.clear();for(let{hash:s,snapshot:o}of i)this.#n.set(s,o)}else this.#n=new Map(Object.entries(i))}catch(r){if(r.code==="ENOENT")this.#n.clear();else throw new Pos(`Failed to load snapshots from ${n}`,{cause:r})}}async saveSnapshots(e){let n=e||this.#r;if(!n)throw new RXn("Snapshot path is required");let r=TXn(n);await Bos(Nos(r),{recursive:!0});let i=Array.from(this.#n.entries()).map(([s,o])=>({hash:s,snapshot:o}));await Ros(r,JSON.stringify(i,null,2),{flush:!0})}clear(){this.#n.clear()}getSnapshots(){return Array.from(this.#n.values())}size(){return this.#n.size}resetCallCounts(){for(let e of this.#n.values())e.callCount=0}deleteSnapshot(e){let n=mae(e,this.#o,this.matchOptions),r=hae(n);return this.#n.delete(r)}getSnapshotInfo(e){let n=mae(e,this.#o,this.matchOptions),r=hae(n),i=this.#n.get(r);return i?{hash:r,request:i.request,responseCount:i.responses?i.responses.length:i.response?1:0,callCount:i.callCount||0,timestamp:i.timestamp}:null}replaceSnapshots(e){if(this.#n.clear(),Array.isArray(e))for(let{hash:n,snapshot:r}of e)this.#n.set(n,r);else e&&typeof e=="object"&&(this.#n=new Map(Object.entries(e)))}#a(){return this.#l()}#c(){this.#e&&(vXn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#l(){this.#e=Dos(()=>{this.saveSnapshots().catch(()=>{}),this.#s?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(vXn(this.#e),this.#e=null)}async close(){this.#r&&this.#n.size!==0&&await this.saveSnapshots(),this.destroy()}};PXn.exports={SnapshotRecorder:Pyt,formatRequestKey:mae,createRequestHash:hae,filterHeadersForMatching:NXn,filterHeadersForStorage:DXn,createHeaderFilters:BXn}});var QXn=re((zMc,FXn)=>{"use strict";p();var Qos=_U(),Uos=Nyt(),{SnapshotRecorder:Gos}=MXn(),{InvalidArgumentError:$os,UndiciError:Wos}=Wi(),OXn=Zi(),{validateSnapshotMode:Hos}=Dyt(),vg=Symbol("kSnapshotRecorder"),RS=Symbol("kSnapshotMode"),fae=Symbol("kSnapshotPath"),Myt=Symbol("kSnapshotLoaded"),WNe=Symbol("kRealAgent"),LXn=!1,Oyt=class extends Uos{constructor(e={}){LXn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),LXn=!0);let{mode:n="record",snapshotPath:r=null,...i}=e;if(super(i),Hos(n),(n==="playback"||n==="update")&&!r)throw new $os(`snapshotPath is required when mode is '${n}'`);this[RS]=n,this[fae]=r,this[vg]=new Gos({snapshotPath:this[fae],mode:this[RS],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,normalizeBody:e.normalizeBody,matchQuery:e.matchQuery,normalizeQuery:e.normalizeQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[Myt]=!1,(this[RS]==="record"||this[RS]==="update"||this[RS]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[WNe]=new Qos(e)),(this[RS]==="playback"||this[RS]==="update")&&this[fae]&&this.loadSnapshots().catch(()=>{})}dispatch(e,n){let r=this[RS];if(this[vg].isUrlExcluded(e))return this[WNe].dispatch(e,n);if(r==="playback"||r==="update"){if(!this[Myt])return this.#e(e,n);let i=this[vg].findSnapshot(e);if(i)return this.#n(i,n);if(r==="update")return this.#t(e,n);{let s=new Wos(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(n.onResponseError){n.onResponseError(null,s);return}throw s}}else if(r==="record")return this.#t(e,n)}async#e(e,n){return await this.loadSnapshots(),this.dispatch(e,n)}#t(e,n){let r={statusCode:null,headers:{},trailers:{},body:[]},i=this,s={onRequestStart(a,c){return n.onRequestStart(a,{...c,history:this.history})},onRequestUpgrade(a,c,u,l){return n.onRequestUpgrade(a,c,u,l)},onResponseStart(a,c,u,l){return r.statusCode=c,r.headers=u,n.onResponseStart(a,c,u,l)},onResponseData(a,c){return r.body.push(c),n.onResponseData(a,c)},onResponseEnd(a,c){r.trailers=c;let u=Buffer.concat(r.body);i[vg].record(e,{statusCode:r.statusCode,headers:r.headers,body:u,trailers:r.trailers}).then(()=>n.onResponseEnd(a,c)).catch(l=>n.onResponseError(a,l))},onResponseError(a,c){return n.onResponseError(a,c)}};return this[WNe].dispatch(e,s)}#n(e,n){try{let{response:r}=e,i=r.headers?OXn.toRawHeaders(r.headers):[],s=r.trailers?OXn.toRawHeaders(r.trailers):[],o={rawHeaders:i,rawTrailers:s,pause(){},resume(){},abort(c){this.aborted=!0,this.reason=c},aborted:!1,paused:!1};n.onRequestStart(o),n.onResponseStart(o,r.statusCode,r.headers,r.statusMessage);let a=Buffer.from(r.body,"base64");n.onResponseData(o,a),n.onResponseEnd(o,r.trailers)}catch(r){n.onResponseError?.(null,r)}}async loadSnapshots(e){await this[vg].loadSnapshots(e||this[fae]),this[Myt]=!0,this[RS]==="playback"&&this.#r()}async saveSnapshots(e){return this[vg].saveSnapshots(e||this[fae])}#r(){for(let e of this[vg].getSnapshots()){let{request:n,responses:r,response:i}=e,s=new URL(n.url),o=this.get(s.origin),a=r?r[0]:i;a&&o.intercept({path:s.pathname+s.search,method:n.method,headers:n.headers,body:n.body}).reply(a.statusCode,a.body,{headers:a.headers,trailers:a.trailers}).persist()}}getRecorder(){return this[vg]}getMode(){return this[RS]}clearSnapshots(){this[vg].clear()}resetCallCounts(){this[vg].resetCallCounts()}deleteSnapshot(e){return this[vg].deleteSnapshot(e)}getSnapshotInfo(e){return this[vg].getSnapshotInfo(e)}replaceSnapshots(e){this[vg].replaceSnapshots(e)}async close(){this[RS]==="playback"?this[vg].destroy():await this[vg].close(),await this[WNe]?.close(),await super.close()}};FXn.exports=Oyt});var gae=re((JMc,qXn)=>{"use strict";p();var GXn=Symbol.for("undici.globalDispatcher.2"),qos=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:jos}=Wi(),Vos=_U(),UXn=SAt(),$Xn;HXn()===void 0&&WXn(new Vos);function WXn(t){if(!t||typeof t.dispatch!="function")throw new jos("Argument agent must implement Agent");try{Object.defineProperty(globalThis,GXn,{value:t,writable:!0,enumerable:!1,configurable:!1})}catch(e){if(e instanceof TypeError){$Xn=t;return}throw e}try{let e=t instanceof UXn?t:new UXn(t);Object.defineProperty(globalThis,qos,{value:e,writable:!0,enumerable:!1,configurable:!1})}catch(e){if(!(e instanceof TypeError))throw e}}function HXn(){return globalThis[GXn]??$Xn}var Yos=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];qXn.exports={setGlobalDispatcher:WXn,getGlobalDispatcher:HXn,installedExports:Yos}});var qY=re((eOc,jXn)=>{"use strict";p();var gk=require("node:assert");jXn.exports=class{#e;#t=!1;#n=!1;#r=!1;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=e}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return gk(!this.#t),gk(!this.#n),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return gk(!this.#t),gk(!this.#n),gk(!this.#r),this.#r=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return gk(!this.#t),gk(!this.#n),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return gk(!this.#t),gk(!this.#n),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#n=!0,this.#e.onResponseError?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}onRequestSent(...e){return this.#e.onRequestSent?.(...e)}}});var Qyt=re((nOc,KXn)=>{"use strict";p();var qw=Zi(),zos=require("node:assert"),{InvalidArgumentError:jY}=Wi(),{kRequestOrigin:Lyt}=Oo(),Kos=[300,301,302,303,307,308],VXn=()=>{},Fyt=class t{static buildDispatch(e,n){if(n!=null&&(!Number.isInteger(n)||n<0))throw new jY("maxRedirections must be a positive number");let r=e.dispatch.bind(e);return(i,s)=>r(i,new t(r,n,i,s))}constructor(e,n,r,i){if(n!=null&&(!Number.isInteger(n)||n<0))throw new jY("maxRedirections must be a positive number");if(r.throwOnMaxRedirect!=null&&typeof r.throwOnMaxRedirect!="boolean")throw new jY("throwOnMaxRedirect must be a boolean");this.dispatch=e,this.location=null;let{maxRedirections:s,stripHeadersOnRedirect:o,stripHeadersOnCrossOriginRedirect:a,...c}=r;this.opts=c,this.opts.body=qw.wrapRequestBody(this.opts.body),this.stripHeadersOnRedirect=zXn(o,"stripHeadersOnRedirect"),this.stripHeadersOnCrossOriginRedirect=zXn(a,"stripHeadersOnCrossOriginRedirect"),this.maxRedirections=n,this.handler=i,this.history=[]}onRequestStart(e,n){this.handler.onRequestStart?.(e,{...n,history:this.history})}onBodySent(e){this.handler.onBodySent?.(e)}onRequestSent(){this.handler.onRequestSent?.()}onRequestUpgrade(e,n,r,i){this.handler.onRequestUpgrade?.(e,n,r,i)}onResponseStart(e,n,r,i){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");let s=n===303;(n===301||n===302)&&this.opts.method==="POST"&&(this.opts.method="GET",qw.isStream(this.opts.body)&&qw.destroy(this.opts.body.on("error",VXn)),this.opts.body=null,s=!0),n===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",qw.isStream(this.opts.body)&&qw.destroy(this.opts.body.on("error",VXn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||qw.isDisturbed(this.opts.body)||Kos.indexOf(n)===-1?null:r.location;let o=this.opts[Lyt]===void 0?this.opts.origin:this.opts[Lyt];if(o&&this.history.push(new URL(this.opts.path,o)),!this.location){this.handler.onResponseStart?.(e,n,r,i);return}let a=o?new URL(this.opts.path,o):void 0,{origin:c,pathname:u,search:l}=qw.parseURL(new URL(this.location,a)),d=l?`${u}${l}`:u,m=`${c}${d}`;for(let h of this.history)if(h.toString()===m)throw new jY(`Redirect loop detected. Cannot redirect to ${c}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=Jos(this.opts.headers,s,o!==c,this.stripHeadersOnRedirect,this.stripHeadersOnCrossOriginRedirect),this.opts.path=d,this.opts.origin=c,this.opts[Lyt]=c,this.opts.query=null}onResponseData(e,n){this.location||this.handler.onResponseData?.(e,n)}onResponseEnd(e,n){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,n)}onResponseError(e,n){this.handler.onResponseError?.(e,n)}};function YXn(t,e,n,r,i){let s=qw.headerNameToString(t);return s==="host"||r?.has(s)||n&&i?.has(s)||e&&s.startsWith("content-")?!0:n?s==="authorization"||s==="cookie"||s==="proxy-authorization":!1}function zXn(t,e){if(t==null)return null;if(!Array.isArray(t))throw new jY(`${e} must be an array`);let n=new Set;for(let r of t){if(typeof r!="string")throw new jY(`${e} must contain header names`);n.add(qw.headerNameToString(r))}return n}function Jos(t,e,n,r,i){let s=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var Xos=Qyt();function Zos({maxRedirections:t,throwOnMaxRedirect:e,stripHeadersOnRedirect:n,stripHeadersOnCrossOriginRedirect:r}={}){return i=>function(o,a){let{maxRedirections:c=t,throwOnMaxRedirect:u=e,stripHeadersOnRedirect:l=n,stripHeadersOnCrossOriginRedirect:d=r,...m}=o;if(c==null||c===0)return i(o,a);let h={...m,throwOnMaxRedirect:u,stripHeadersOnRedirect:l,stripHeadersOnCrossOriginRedirect:d},f=new Xos(i,c,h,a);return i(h,f)}}JXn.exports=Zos});var eZn=re((oOc,ZXn)=>{"use strict";p();var eas=qY(),{ResponseError:tas}=Wi(),Uyt=class extends eas{#e;#t;#n;#r;#i;constructor(e,{handler:n}){super(n)}#s(e){return(this.#t??"").indexOf(e)===0}onRequestStart(e,n){return this.#e=0,this.#t=null,this.#n=null,this.#r=null,this.#i="",super.onRequestStart(e,n)}onResponseStart(e,n,r,i){if(this.#e=n,this.#r=r,this.#t=r["content-type"],this.#e<400)return super.onResponseStart(e,n,r,i);(this.#s("application/json")||this.#s("text/plain"))&&(this.#n=new TextDecoder("utf-8"))}onResponseData(e,n){if(this.#e<400)return super.onResponseData(e,n);this.#i+=this.#n?.decode(n,{stream:!0})??""}onResponseEnd(e,n){if(this.#e>=400){if(this.#i+=this.#n?.decode(void 0,{stream:!1})??"",this.#s("application/json"))try{this.#i=JSON.parse(this.#i)}catch{}let r,i=Error.stackTraceLimit;Error.stackTraceLimit=0;try{r=new tas("Response Error",this.#e,{body:this.#i,headers:this.#r})}finally{Error.stackTraceLimit=i}super.onResponseError(e,r)}else super.onResponseEnd(e,n)}onResponseError(e,n){super.onResponseError(e,n)}};ZXn.exports=()=>t=>function(n,r){return t(n,new Uyt(n,{handler:r}))}});var nZn=re((cOc,tZn)=>{"use strict";p();var nas=TNe();tZn.exports=t=>e=>function(r,i){return e(r,new nas({...r,retryOptions:{...t,...r.retryOptions}},{handler:i,dispatch:e}))}});var sZn=re((uOc,iZn)=>{"use strict";p();var{InvalidArgumentError:ras,RequestAbortedError:rZn}=Wi(),ias=qY(),Gyt=class extends ias{#e=1024*1024;#t=!1;#n=0;aborted=!1;reason=!1;constructor({maxSize:e,signal:n},r){if(e!=null&&(!Number.isFinite(e)||e<1))throw new ras("maxSize must be a number greater than 0");super(r),this.#e=e??this.#e}#r(e){this.aborted=!0,this.reason=e}onRequestStart(e,n){return e.abort=this.#r.bind(this),super.onRequestStart(e,n)}onResponseStart(e,n,r,i){let s=r["content-length"];if(s!=null&&s>this.#e)throw new rZn(`Response size (${s}) larger than maxSize (${this.#e})`);return this.aborted===!0?!0:super.onResponseStart(e,n,r,i)}onResponseError(e,n){super.onResponseError(e,this.aborted===!0?this.reason:n)}onResponseData(e,n){if(this.#n=this.#n+n.length,this.#n>this.#e)throw new rZn(`Response size (${this.#n}) larger than maxSize (${this.#e})`);return this.#n===this.#e&&(this.#t=!0),!0}onResponseEnd(e,n){if(this.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,this.#t?{}:n)}};function sas({maxSize:t}={maxSize:1024*1024}){return e=>function(r,i){let{dumpMaxSize:s=t}=r,o=new Gyt({maxSize:s,signal:r.signal},i);return e(r,o)}}iZn.exports=sas});var lZn=re((pOc,cZn)=>{"use strict";p();var{isIP:oas}=require("node:net"),{lookup:aas}=require("node:dns"),cas=qY(),{InvalidArgumentError:DU,InformationalError:las}=Wi(),{kRequestOrigin:VY}=Oo(),$yt=Math.pow(2,31)-1;function uas(t){let e=Object.getPrototypeOf(t);return Object.hasOwn(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}function oZn(t){return typeof t=="string"&&t.toLowerCase()==="host"}function das(t){if(t==null)return null;if(Array.isArray(t)){if(t.length===0||!Array.isArray(t[0]))return t;let e=[];for(let n of t)Array.isArray(n)&&n.length===2?e.push(n[0],n[1]):e.push(n);return e}if(typeof t=="object"&&uas(t)){let e=[];for(let n of t)Array.isArray(n)&&n.length===2?e.push(n[0],n[1]):e.push(n);return e}return t}function pas(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},Hyt=class{#e=0;#t=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#n,this.pick=e.pick??this.#r,this.storage=e.storage??new Wyt(e)}runLookup(e,n,r){let i=this.storage.get(e.hostname);if(i==null&&this.storage.full()){r(null,e);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...n.dns,maxTTL:this.#e,maxItems:this.#t};if(i==null)this.lookup(e,s,(o,a)=>{if(o||a==null||a.length===0){r(o??new las("No DNS entries found"));return}this.setRecords(e,a);let c=this.storage.get(e.hostname),u=this.pick(e,c,s.affinity),l;typeof u.port=="number"?l=`:${u.port}`:e.port!==""?l=`:${e.port}`:l="",r(null,new URL(`${e.protocol}//${u.family===6?`[${u.address}]`:u.address}${l}`))});else{let o=this.pick(e,i,s.affinity);if(o==null){this.storage.delete(e.hostname),this.runLookup(e,n,r);return}let a;typeof o.port=="number"?a=`:${o.port}`:e.port!==""?a=`:${e.port}`:a="",r(null,new URL(`${e.protocol}//${o.family===6?`[${o.address}]`:o.address}${a}`))}}#n(e,n,r){aas(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(i,s)=>{if(i)return r(i);let o=new Map;for(let a of s)o.set(`${a.address}:${a.family}`,a);r(null,o.values())})}#r(e,n,r){let i=null,{records:s,offset:o}=n,a;if(this.dualStack?(r==null&&(o==null||o===$yt?(n.offset=0,r=4):(n.offset++,r=(n.offset&1)===1?6:4)),s[r]!=null&&s[r].ips.length>0?a=s[r]:a=s[r===4?6:4]):a=s[r],a==null||a.ips.length===0)return i;a.offset==null||a.offset===$yt?a.offset=0:a.offset++;let c=a.offset%a.ips.length;return i=a.ips[c]??null,i==null?i:Date.now()-i.timestamp>i.ttl?(a.ips.splice(c,1),this.pick(e,n,r)):i}pickFamily(e,n){let r=this.storage.get(e.hostname)?.records;if(!r)return null;let i=r[n];if(!i)return null;i.offset==null||i.offset===$yt?i.offset=0:i.offset++;let s=i.offset%i.ips.length,o=i.ips[s]??null;return o==null||Date.now()-o.timestamp>o.ttl&&i.ips.splice(s,1),o}setRecords(e,n){let r=Date.now(),i={records:{4:null,6:null}},s=this.#e;for(let o of n){o.timestamp=r,typeof o.ttl=="number"?(o.ttl=Math.min(o.ttl,this.#e),s=Math.min(s,o.ttl)):o.ttl=this.#e;let a=i.records[o.family]??{ips:[]};a.ips.push(o),i.records[o.family]=a}this.storage.set(e.hostname,i,{ttl:s})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,n){return new qyt(this,e,n)}},qyt=class extends cas{#e=null;#t=null;#n=null;#r=null;#i=null;#s=null;#o=!0;constructor(e,{origin:n,handler:r,dispatch:i,newOrigin:s},o){super(r),this.#r=n,this.#s=s,this.#t={...o},this.#e=e,this.#n=i}onResponseError(e,n){switch(n.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){if(!this.#o){super.onResponseError(e,n);return}this.#o=!1;let r=this.#s.hostname[0]==="["?4:6,i=this.#e.pickFamily(this.#r,r);if(i==null){super.onResponseError(e,n);return}let s;typeof i.port=="number"?s=`:${i.port}`:this.#r.port!==""?s=`:${this.#r.port}`:s="";let o={...this.#t,origin:`${this.#r.protocol}//${i.family===6?`[${i.address}]`:i.address}${s}`,[VY]:this.#t[VY]===void 0?this.#r:this.#t[VY],headers:aZn(this.#r.host,this.#t.headers)};this.#n(o,this);return}super.onResponseError(e,n);break}case"ENOTFOUND":this.#e.deleteRecords(this.#r),super.onResponseError(e,n);break;default:super.onResponseError(e,n);break}}};cZn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new DU("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new DU("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new DU("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new DU("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new DU("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new DU("Invalid pick. Must be a function");if(t?.storage!=null&&(typeof t?.storage?.get!="function"||typeof t?.storage?.set!="function"||typeof t?.storage?.full!="function"||typeof t?.storage?.delete!="function"))throw new DU("Invalid storage. Must be a object with methods: { get, set, full, delete }");let e=t?.dualStack??!0,n;e?n=t?.affinity??null:n=t?.affinity??4;let r={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:n,maxItems:t?.maxItems??1/0,storage:t?.storage},i=new Hyt(r);return s=>function(a,c){if(a.origin==null)return s(a,c);let u=a.origin.constructor===URL?a.origin:new URL(a.origin);return oas(u.hostname)!==0?s(a,c):(i.runLookup(u,a,(l,d)=>{if(l)return c.onResponseError(null,l);let m={...a,servername:u.hostname,origin:d.origin,[VY]:a[VY]===void 0?u:a[VY],headers:aZn(u.host,a.headers)};s(m,i.getHandler({origin:u,dispatch:s,handler:c,newOrigin:d},a))}),!0)}}});var YY=re((hOc,bZn)=>{"use strict";p();var{safeHTTPMethods:uZn,pathHasQueryOrFragment:mas,hasSafeIterator:has,isValidHTTPToken:yae}=Zi(),{serializePathWithQuery:fas}=Zi(),{kRequestOrigin:dZn}=Oo(),gas=2147483647,pZn=["no-store","private","no-cache"],jyt=Symbol("invalid cache-control directives");function PU(t){return t.replace(/^[\t ]+|[\t ]+$/g,"")}function AZn(t,e){for(let n=0;na}),c=u+1);return e.push({value:o.substring(c),fromMalformedQuote:c>a}),e}function gZn(t,e){let n=t[jyt];n===void 0&&(n=new Set,Object.defineProperty(t,jyt,{value:n})),n.add(e)}function yas(t,e){return t[jyt]?.has(e)===!0}function Eas(t){for(let r of pZn)if(t.startsWith(r)&&t.length>r.length&&!yae(t[r.length]))return r;let e="",n=!1;for(let r=0;r=2&&d[0]==='"'&&d[d.length-1]==='"'&&(d=d.substring(1,d.length-1)),!/^[0-9]+$/.test(d)){delete e[l],n.add(l),gZn(e,l);continue}let g=Math.min(parseInt(d,10),gas);l==="min-fresh"?(!(l in e)||e[l]g)&&(e[l]=g);break}case"private":case"no-cache":{if(c){e[l]=!0;break}if(d!==void 0&&d.length===0){e[l]=!0;break}if(d){if(d[0]==='"'){d=hZn(d);let g="",A=s,y=!1,E=fZn(d,1);if(E!==-1)g=d.substring(1,E),y=!0;else{let C=[d.substring(1)];for(let I=s+1;I{"use strict";p();function Bas(t){switch(t[3]){case",":return Nas(t);case" ":return Das(t);default:return Pas(t)}}function zyt(t,e,n,r,i,s,o){let a=new Date(Date.UTC(t,e,n,r,i,s));return t>=0&&t<=99&&a.setUTCFullYear(t),a.getUTCFullYear()===t&&a.getUTCMonth()===e&&a.getUTCDate()===n&&a.getUTCHours()===r&&a.getUTCMinutes()===i&&a.getUTCSeconds()===s&&a.getUTCDay()===o?a:void 0}function Nas(t){if(t.length!==29||t[4]!==" "||t[7]!==" "||t[11]!==" "||t[16]!==" "||t[19]!==":"||t[22]!==":"||t[25]!==" "||t[26]!=="G"||t[27]!=="M"||t[28]!=="T")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let n=0;if(t[5]==="0"){let m=t.charCodeAt(6);if(m<49||m>57)return;n=m-48}else{let m=t.charCodeAt(5);if(m<49||m>51)return;let h=t.charCodeAt(6);if(h<48||h>57)return;n=(m-48)*10+(h-48)}let r=-1;if(t[8]==="J"&&t[9]==="a"&&t[10]==="n")r=0;else if(t[8]==="F"&&t[9]==="e"&&t[10]==="b")r=1;else if(t[8]==="M"&&t[9]==="a")if(t[10]==="r")r=2;else if(t[10]==="y")r=4;else return;else if(t[8]==="J")if(t[9]==="a"&&t[10]==="n")r=0;else if(t[9]==="u")if(t[10]==="n")r=5;else if(t[10]==="l")r=6;else return;else return;else if(t[8]==="A")if(t[9]==="p"&&t[10]==="r")r=3;else if(t[9]==="u"&&t[10]==="g")r=7;else return;else if(t[8]==="S"&&t[9]==="e"&&t[10]==="p")r=8;else if(t[8]==="O"&&t[9]==="c"&&t[10]==="t")r=9;else if(t[8]==="N"&&t[9]==="o"&&t[10]==="v")r=10;else if(t[8]==="D"&&t[9]==="e"&&t[10]==="c")r=11;else return;let i=t.charCodeAt(12);if(i<48||i>57)return;let s=t.charCodeAt(13);if(s<48||s>57)return;let o=t.charCodeAt(14);if(o<48||o>57)return;let a=t.charCodeAt(15);if(a<48||a>57)return;let c=(i-48)*1e3+(s-48)*100+(o-48)*10+(a-48),u=0;if(t[17]==="0"){let m=t.charCodeAt(18);if(m<48||m>57)return;u=m-48}else{let m=t.charCodeAt(17);if(m<48||m>50)return;let h=t.charCodeAt(18);if(h<48||h>57||m===50&&h>51)return;u=(m-48)*10+(h-48)}let l=0;if(t[20]==="0"){let m=t.charCodeAt(21);if(m<48||m>57)return;l=m-48}else{let m=t.charCodeAt(20);if(m<48||m>53)return;let h=t.charCodeAt(21);if(h<48||h>57)return;l=(m-48)*10+(h-48)}let d=0;if(t[23]==="0"){let m=t.charCodeAt(24);if(m<48||m>57)return;d=m-48}else{let m=t.charCodeAt(23);if(m<48||m>53)return;let h=t.charCodeAt(24);if(h<48||h>57)return;d=(m-48)*10+(h-48)}return zyt(c,r,n,u,l,d,e)}function Das(t){if(t.length!==24||t[7]!==" "||t[10]!==" "||t[19]!==" ")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let n=-1;if(t[4]==="J"&&t[5]==="a"&&t[6]==="n")n=0;else if(t[4]==="F"&&t[5]==="e"&&t[6]==="b")n=1;else if(t[4]==="M"&&t[5]==="a")if(t[6]==="r")n=2;else if(t[6]==="y")n=4;else return;else if(t[4]==="J")if(t[5]==="a"&&t[6]==="n")n=0;else if(t[5]==="u")if(t[6]==="n")n=5;else if(t[6]==="l")n=6;else return;else return;else if(t[4]==="A")if(t[5]==="p"&&t[6]==="r")n=3;else if(t[5]==="u"&&t[6]==="g")n=7;else return;else if(t[4]==="S"&&t[5]==="e"&&t[6]==="p")n=8;else if(t[4]==="O"&&t[5]==="c"&&t[6]==="t")n=9;else if(t[4]==="N"&&t[5]==="o"&&t[6]==="v")n=10;else if(t[4]==="D"&&t[5]==="e"&&t[6]==="c")n=11;else return;let r=0;if(t[8]===" "){let m=t.charCodeAt(9);if(m<49||m>57)return;r=m-48}else{let m=t.charCodeAt(8);if(m<49||m>51)return;let h=t.charCodeAt(9);if(h<48||h>57)return;r=(m-48)*10+(h-48)}let i=0;if(t[11]==="0"){let m=t.charCodeAt(12);if(m<48||m>57)return;i=m-48}else{let m=t.charCodeAt(11);if(m<48||m>50)return;let h=t.charCodeAt(12);if(h<48||h>57||m===50&&h>51)return;i=(m-48)*10+(h-48)}let s=0;if(t[14]==="0"){let m=t.charCodeAt(15);if(m<48||m>57)return;s=m-48}else{let m=t.charCodeAt(14);if(m<48||m>53)return;let h=t.charCodeAt(15);if(h<48||h>57)return;s=(m-48)*10+(h-48)}let o=0;if(t[17]==="0"){let m=t.charCodeAt(18);if(m<48||m>57)return;o=m-48}else{let m=t.charCodeAt(17);if(m<48||m>53)return;let h=t.charCodeAt(18);if(h<48||h>57)return;o=(m-48)*10+(h-48)}let a=t.charCodeAt(20);if(a<48||a>57)return;let c=t.charCodeAt(21);if(c<48||c>57)return;let u=t.charCodeAt(22);if(u<48||u>57)return;let l=t.charCodeAt(23);if(l<48||l>57)return;let d=(a-48)*1e3+(c-48)*100+(u-48)*10+(l-48);return zyt(d,n,r,i,s,o,e)}function Pas(t){let e=-1,n=-1;if(t[0]==="S")t[1]==="u"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y"?(n=0,e=6):t[1]==="a"&&t[2]==="t"&&t[3]==="u"&&t[4]==="r"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(n=6,e=8);else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")n=1,e=6;else if(t[0]==="T")t[1]==="u"&&t[2]==="e"&&t[3]==="s"&&t[4]==="d"&&t[5]==="a"&&t[6]==="y"?(n=2,e=7):t[1]==="h"&&t[2]==="u"&&t[3]==="r"&&t[4]==="s"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(n=4,e=8);else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d"&&t[3]==="n"&&t[4]==="e"&&t[5]==="s"&&t[6]==="d"&&t[7]==="a"&&t[8]==="y")n=3,e=9;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")n=5,e=6;else return;if(t[e]!==","||t.length-e-1!==23||t[e+1]!==" "||t[e+4]!=="-"||t[e+8]!=="-"||t[e+11]!==" "||t[e+14]!==":"||t[e+17]!==":"||t[e+20]!==" "||t[e+21]!=="G"||t[e+22]!=="M"||t[e+23]!=="T")return;let r=0;if(t[e+2]==="0"){let d=t.charCodeAt(e+3);if(d<49||d>57)return;r=d-48}else{let d=t.charCodeAt(e+2);if(d<49||d>51)return;let m=t.charCodeAt(e+3);if(m<48||m>57)return;r=(d-48)*10+(m-48)}let i=-1;if(t[e+5]==="J"&&t[e+6]==="a"&&t[e+7]==="n")i=0;else if(t[e+5]==="F"&&t[e+6]==="e"&&t[e+7]==="b")i=1;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="r")i=2;else if(t[e+5]==="A"&&t[e+6]==="p"&&t[e+7]==="r")i=3;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="y")i=4;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="n")i=5;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="l")i=6;else if(t[e+5]==="A"&&t[e+6]==="u"&&t[e+7]==="g")i=7;else if(t[e+5]==="S"&&t[e+6]==="e"&&t[e+7]==="p")i=8;else if(t[e+5]==="O"&&t[e+6]==="c"&&t[e+7]==="t")i=9;else if(t[e+5]==="N"&&t[e+6]==="o"&&t[e+7]==="v")i=10;else if(t[e+5]==="D"&&t[e+6]==="e"&&t[e+7]==="c")i=11;else return;let s=t.charCodeAt(e+9);if(s<48||s>57)return;let o=t.charCodeAt(e+10);if(o<48||o>57)return;let a=(s-48)*10+(o-48);a+=a<70?2e3:1900;let c=0;if(t[e+12]==="0"){let d=t.charCodeAt(e+13);if(d<48||d>57)return;c=d-48}else{let d=t.charCodeAt(e+12);if(d<48||d>50)return;let m=t.charCodeAt(e+13);if(m<48||m>57||d===50&&m>51)return;c=(d-48)*10+(m-48)}let u=0;if(t[e+15]==="0"){let d=t.charCodeAt(e+16);if(d<48||d>57)return;u=d-48}else{let d=t.charCodeAt(e+15);if(d<48||d>53)return;let m=t.charCodeAt(e+16);if(m<48||m>57)return;u=(d-48)*10+(m-48)}let l=0;if(t[e+18]==="0"){let d=t.charCodeAt(e+19);if(d<48||d>57)return;l=d-48}else{let d=t.charCodeAt(e+18);if(d<48||d>53)return;let m=t.charCodeAt(e+19);if(m<48||m>57)return;l=(d-48)*10+(m-48)}return zyt(a,i,r,c,u,l,n)}_Zn.exports={parseHttpDate:Bas}});var kZn=re((yOc,RZn)=>{"use strict";p();var qNe=Zi(),{parseCacheControlHeader:Mas,hasInvalidCacheControlDirective:xZn,parseVaryHeader:Oas,hasVaryStar:Las,isInvalidOrWildcardVaryHeader:wZn,isEtagUsable:SZn}=YY(),{parseHttpDate:Jyt}=Kyt();function Fas(){}var TZn=[200,203,204,206,300,301,308,404,405,410,414,501],Qas=[206],Eae=2147483647e3,Uas=864e5;function Gas(t){return t.replace(/^[\t ]+|[\t ]+$/g,"")}function MU(t,e){for(let n=0;nthis.#i.onResponseStart?.(e,n,r,i),o=this;if(!MU(qNe.safeHTTPMethods,this.#e.method)&&n>=200&&n<=399)return Has(this.#r,this.#e,r),s();let a=r["cache-control"],c=a?Mas(a):{};if(IZn(this.#t,r,c))return zY(this.#r,this.#e),s();let u=r["last-modified"]&&MU(TZn,n);if(!a&&!r.expires&&!u&&!this.#n)return n===304&&r.vary&&wZn(r.vary)&&zY(this.#r,this.#e),s();if(!qas(this.#t,this.#e.method,n,r,c,this.#e.headers))return n===304&&(a||IZn(this.#t,r,c))&&zY(this.#r,this.#e),s();let l=Date.now(),d=Object.hasOwn(r,"age")?Vas(r.age):void 0;if(d!==void 0&&d>=Eae)return HNe(n,this.#r,this.#e),s();let m=Object.hasOwn(r,"date")?jas(r.date):void 0;if(m===null)return HNe(n,this.#r,this.#e),s();let h=m?Math.max(0,l-m.getTime()):0,f=Math.max(h,d??0),g=typeof r.etag=="string"&&SZn(r.etag)||typeof r["last-modified"]=="string",A=Yas(this.#t,l,d,r,m,c,g)??this.#n,y=A===0&&g;if(A===void 0||f>=A&&!y)return(a||A!==void 0)&&HNe(n,this.#r,this.#e),s();let E=l-f,_=A+E;if(l>=_&&!y)return HNe(n,this.#r,this.#e),s();let S;if(this.#e.headers&&r.vary&&(S=Oas(r.vary,this.#e.headers),!S))return s();let C=E,I=zas(E,l,c,_),w=Kas(r,c),k={statusCode:n,statusMessage:i,headers:w,vary:S,cacheControlDirectives:c,cachedAt:C,staleAt:_,deleteAt:I};if(n===304){let N=W=>{if(!W)return s();if(k.statusCode=W.statusCode,k.statusMessage=W.statusMessage,k.etag=W.etag,k.vary=S??W.vary,k.headers={...W.headers,...w},s(),this.#s=this.#r.createWriteStream(this.#e,k),!(!this.#s||!W?.body))if(typeof W.body.values=="function"){let $=W.body.values(),G=()=>{for(let q of $){let ce=this.#s.write(q)===!1;if(this.#i.onResponseData?.(e,q),ce)break}};this.#s.on("error",function(){o.#s=void 0,o.#r.delete(o.#e)}).on("drain",()=>{G()}).on("close",function(){o.#s===this&&(o.#s=void 0)}),G()}else typeof W.body.on=="function"&&(W.body.on("data",$=>{this.#s.write($),this.#i.onResponseData?.(e,$)}).on("end",()=>{this.#s.end()}).on("error",()=>{this.#s=void 0,this.#r.delete(this.#e)}),this.#s.on("error",function(){o.#s=void 0,o.#r.delete(o.#e)}).on("close",function(){o.#s===this&&(o.#s=void 0)}))},O=this.#r.get(this.#e);O&&typeof O.then=="function"?O.then(N):N(O)}else{if(typeof r.etag=="string"&&SZn(r.etag)&&(k.etag=r.etag),this.#s=this.#r.createWriteStream(this.#e,k),!this.#s)return s();this.#s.on("drain",()=>e.resume()).on("error",function(){o.#s=void 0,o.#r.delete(o.#e)}).on("close",function(){o.#s===this&&(o.#s=void 0),e.resume()}),s()}}onResponseData(e,n){this.#s?.write(n)===!1&&e.pause(),this.#i.onResponseData?.(e,n)}onResponseEnd(e,n){this.#s?.end(),this.#i.onResponseEnd?.(e,n)}onResponseError(e,n){this.#s?.destroy(n),this.#s=void 0,this.#i.onResponseError?.(e,n)}};function zY(t,e){try{t.delete(e)?.catch?.(Fas)}catch{}}function HNe(t,e,n){t===304&&zY(e,n)}function IZn(t,e,n){return n["no-store"]===!0||t==="shared"&&(n.private===!0||Object.hasOwn(e,"set-cookie"))||(e.vary?wZn(e.vary):!1)}function qas(t,e,n,r,i,s){return!(!MU(qNe.safeHTTPMethods,e)||n<200||MU(Qas,n)||!MU(TZn,n)&&!r.expires&&!i.public&&i["max-age"]===void 0&&!(i.private&&t==="private")&&!(i["s-maxage"]!==void 0&&t==="shared")||i["no-store"]||t==="shared"&&(i.private===!0||Object.hasOwn(r,"set-cookie"))||r.vary&&Las(r.vary)||s!=null&&Object.hasOwn(s,"authorization")&&(!i.public&&!i["s-maxage"]&&!i["must-revalidate"]||typeof s.authorization!="string"||Array.isArray(i["no-cache"])&&MU(i["no-cache"],"authorization")||Array.isArray(i.private)&&MU(i.private,"authorization")))}function jas(t){let e=t;if(Array.isArray(e)){if(e.length!==1)return null;e=e[0]}return typeof e!="string"?null:Jyt(e)}function Vas(t){let e=t;if(Array.isArray(e)){if(e.length!==1)return Eae;e=e[0]}if(typeof e!="string"||!/^[\t ]*[0-9]+[\t ]*$/.test(e))return Eae;let n=BigInt(e.replace(/^[\t ]+|[\t ]+$/g,""));return n>=BigInt(Eae/1e3)?Eae:Number(n)*1e3}function Yas(t,e,n,r,i,s,o){if(t==="shared"){if(xZn(s,"s-maxage"))return 0;let c=s["s-maxage"];if(c!==void 0)return c>0?c*1e3:0}if(xZn(s,"max-age"))return 0;let a=s["max-age"];if(a!==void 0)return a>0?a*1e3:0;if(Object.hasOwn(r,"expires")){if(typeof r.expires!="string")return 0;let c=Jyt(r.expires);if(!c||e>=c.getTime())return 0;if(i){if(i>=c)return 0;let u=c.getTime()-i.getTime();return n!==void 0&&n>=u?0:u}return c.getTime()-e}if(typeof r["last-modified"]=="string"){let c=Jyt(r["last-modified"]);if(c)return c.getTime()>=e?void 0:(e-c.getTime())*.1}if(s.immutable)return 31536e6;if(s["no-cache"]===!0&&o)return 0}function zas(t,e,n,r){let i=-1/0,s=-1/0,o=-1/0;if(n["stale-while-revalidate"]&&(i=r+n["stale-while-revalidate"]*1e3),n["stale-if-error"]&&(s=r+n["stale-if-error"]*1e3),n.immutable&&i===-1/0&&s===-1/0&&(o=e+31536e6),i===-1/0&&s===-1/0&&o===-1/0){let a=r-t;if(a<=0)return e+Uas;let c=Math.min(Math.max(e-t,0),1e3);return r+a+c}return Math.max(r,i,s,o)}function Kas(t,e){let n=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];t.connection&&$as(n,t.connection),Array.isArray(e["no-cache"])&&n.push(...e["no-cache"]),Array.isArray(e.private)&&n.push(...e.private);let r;for(let i of n)Object.hasOwn(t,i)&&(r??={...t},delete r[i]);return r??t}RZn.exports=Xyt});var eEt=re((bOc,DZn)=>{"use strict";p();var{Writable:Jas}=require("node:stream"),{EventEmitter:Xas}=require("node:events"),{assertCacheKey:BZn,assertCacheValue:Zas}=YY(),Zyt=class extends Xas{#e=1024;#t=104857600;#n=5242880;#r=0;#i=0;#s=new Map;#o=!1;constructor(e){if(super(),e){if(typeof e!="object")throw new TypeError("MemoryCacheStore options must be an object");if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!="number"||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#t=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#n=e.maxEntrySize}}}get size(){return this.#r}isFull(){return this.#r>=this.#t||this.#i>=this.#e}get(e){BZn(e);let n=`${e.origin}:${e.path}`,r=Date.now(),i=this.#s.get(n),s=i?NZn(e,i,r):null;return s==null?void 0:{statusMessage:s.statusMessage,statusCode:s.statusCode,headers:s.headers,body:s.body,vary:s.vary?s.vary:void 0,etag:s.etag,cacheControlDirectives:s.cacheControlDirectives,cachedAt:s.cachedAt,staleAt:s.staleAt,deleteAt:s.deleteAt}}createWriteStream(e,n){BZn(e),Zas(n);let r=`${e.origin}:${e.path}`,i=this,s={...e,...n,body:[],size:0};return new Jas({write(o,a,c){typeof o=="string"&&(o=Buffer.from(o,a)),s.size+=o.byteLength,s.size>i.#n?this.destroy():s.body.push(o),c(null)},final(o){let a=i.#s.get(r);a||(a=[],i.#s.set(r,a));let c=NZn(e,a,Date.now());if(c){let u=a.indexOf(c);a.splice(u,1,s),i.#r-=c.size}else a.push(s),i.#i+=1;if(i.#r+=s.size,i.#r>i.#t||i.#i>i.#e){i.#o||(i.emit("maxSizeExceeded",{size:i.#r,maxSize:i.#t,count:i.#i,maxCount:i.#e}),i.#o=!0);for(let[u,l]of i.#s){for(let d of l.splice(0,Math.ceil(l.length/2)))i.#r-=d.size,i.#i-=1;l.length===0&&i.#s.delete(u)}i.#rn&&i.method===t.method&&ecs(t,i))return i}}function ecs(t,e){if(e.vary==null)return!0;for(let n in e.vary)if(Object.hasOwn(e.vary,n)&&!tcs(t.headers?.[n],e.vary[n]))return!1;return!0}function tcs(t,e){if(t==null&&e==null)return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0;n{"use strict";p();var ncs=require("node:assert"),tEt=class{#e=!1;#t;#n;#r;#i;constructor(e,n,r){if(typeof e!="function")throw new TypeError("callback must be a function");this.#t=e,this.#n=n,this.#i=r}onRequestStart(e,n){this.#e=!1,this.#r=n}onRequestUpgrade(e,n,r,i){this.#n.onRequestUpgrade?.(e,n,r,i)}onResponseStart(e,n,r,i){if(ncs(this.#t!=null),this.#e=n===304||this.#i&&n>=500&&n<=504,this.#t(this.#e,this.#r,n,r),this.#t=null,this.#e)return!0;this.#n.onRequestStart?.(e,this.#r),this.#n.onResponseStart?.(e,n,r,i)}onResponseData(e,n){if(!this.#e)return this.#n.onResponseData?.(e,n)}onResponseEnd(e,n){this.#e||this.#n.onResponseEnd?.(e,n)}onResponseError(e,n){if(!this.#e){if(this.#t){if(this.#i){this.#e=!0,this.#t(!0,this.#r),this.#t=null;return}this.#t(!1),this.#t=null}if(typeof this.#n.onResponseError=="function")this.#n.onResponseError(e,n);else throw n}}};PZn.exports=tEt});var WZn=re((COc,$Zn)=>{"use strict";p();var OZn=require("node:assert"),{Readable:rcs}=require("node:stream"),Xb=Zi(),WP=kZn(),ics=eEt(),scs=MZn(),{assertCacheStore:ocs,assertCacheMethods:acs,getInterceptorOrigin:ccs,makeCacheKey:lcs,normalizeHeaders:ucs,parseCacheControlHeader:UZn,isInvalidOrWildcardVaryHeader:dcs,parseVaryHeader:pcs}=YY(),{AbortError:GZn}=Wi(),{parseHttpDate:mcs}=Kyt();function hcs(t,e){if(t!==void 0){if(!Array.isArray(t))throw new TypeError(`expected ${e} to be an array or undefined, got ${typeof t}`);for(let n=0;n{};function fcs(t){return t.replace(/^[\t ]+|[\t ]+$/g,"")}function nEt(t,e){for(let n=0;nt.staleAt){if(!iEt(t,n)&&e?.["max-stale"]){let i=t.staleAt+e["max-stale"]*1e3;return r>i}return!0}if(e?.["min-fresh"]){let i=t.staleAt-r,s=e["min-fresh"]*1e3;return i<=s}return!1}function Scs(t,e){let n=t.cacheControlDirectives?.["stale-while-revalidate"];if(!n||iEt(t,e))return!1;let r=Date.now(),i=t.staleAt+n*1e3;return r<=i}function FZn(t,e,n,r,i,s){if(s?.["only-if-cached"]){let o=!1,a={paused:!1,rawHeaders:[],rawTrailers:[],pause(){this.paused=!0},resume(){this.paused=!1},abort:c=>{o=!0,r.onResponseError?.(a,c??new GZn)}};try{if(r.onRequestStart?.(a,null),o||(r.onResponseStart?.(a,504,{},"Gateway Timeout"),o))return;r.onResponseEnd?.(a,{})}catch(c){typeof r.onResponseError=="function"&&r.onResponseError(a,c)}return!0}return t(i,new WP(e,n,r))}function rEt(t,e,n,r,i,s){let o=Xb.isStream(n.body)?n.body:rcs.from(n.body??[]);OZn(!o.destroyed,"stream should not be destroyed"),OZn(!o.readableDidRead,"stream should not be readableDidRead");let a={rawHeaders:[],rawTrailers:[],resume(){o.resume()},pause(){o.pause()},get paused(){return o.isPaused()},get aborted(){return o.destroyed},get reason(){return o.errored},abort(u){o.destroy(u??new GZn)}};if(o.on("error",function(u){if(!this.readableEnded)if(typeof t.onResponseError=="function")t.onResponseError(a,u);else throw u}).on("close",function(){this.errored||t.onResponseEnd?.(a,{})}),t.onRequestStart?.(a,i),o.destroyed)return;let c={...n.headers,age:String(r)};s&&(c.warning='110 - "response is stale"'),a.rawHeaders=Xb.toRawHeaders(c),t.onResponseStart?.(a,n.statusCode,c,n.statusMessage),e.method==="HEAD"?o.destroy():o.on("data",function(u){t.onResponseData?.(a,u)})}function QZn(t,e,n,r,i,s,o){if(!o)return FZn(t,e,n,r,i,s);if(e.type==="shared"&&Object.hasOwn(o.headers,"set-cookie"))return Xb.isStream(o.body)&&o.body.on("error",KY).destroy(),jNe(e.store,n),FZn(t,e,n,r,i,s);let a=Date.now();if(a>o.deleteAt)return t(i,new WP(e,n,r));let c=Math.round((a-o.cachedAt)/1e3),u=s?.["max-age"]!==void 0&&c>=s["max-age"],l=u||xcs(o,s,e.type),d=u||Acs(o,s,i);if(l||d){if(Xb.isStream(i.body)&&Xb.bodyLength(i.body)!==0)return t(i,new WP(e,n,r));if(!d&&Scs(o,e.type))return rEt(r,i,o,c,null,!0),queueMicrotask(()=>{let f=LZn(i,o);t({...i,headers:f},new WP(e,n,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let m=!1;if(!iEt(o,e.type)){let f=o.cacheControlDirectives["stale-if-error"]??s?.["stale-if-error"];f&&(m=a{if(f){if(A===304){if(ycs(e.type,y))return Xb.isStream(o.body)&&o.body.on("error",KY).destroy(),jNe(e.store,n),t(i,new WP(e,n,r));if(Ecs(y))jNe(e.store,n);else if(bcs(o,y.vary?pcs(y.vary,i.headers):void 0))return Xb.isStream(o.body)&&o.body.on("error",KY).destroy(),jNe(e.store,n),t(i,new WP(e,n,r))}rEt(r,i,o,c,g,l)}else Xb.isStream(o.body)&&o.body.on("error",KY).destroy()},new WP(e,n,r),m))}Xb.isStream(i.body)&&i.body.on("error",KY).destroy(),rEt(r,i,o,c,null,!1)}$Zn.exports=(t={})=>{let{store:e=new ics,methods:n=["GET"],cacheByDefault:r=void 0,type:i="shared",origins:s=void 0}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(ocs(e,"opts.store"),acs(n,"opts.methods"),hcs(s,"opts.origins"),typeof r<"u"&&typeof r!="number")throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof r}`);if(typeof i<"u"&&i!=="shared"&&i!=="private")throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof i}`);let o={store:e,methods:n,cacheByDefault:r,type:i},a=[];for(let c=0;c(l,d)=>{let m=ccs(l,u);if(!m||nEt(a,l.method))return c(l,d);if(s!==void 0){let A=m.toString().toLowerCase(),y=!1;for(let E=0;EQZn(c,o,f,d,l,h,A)):QZn(c,o,f,d,l,h,g)}}});var zZn=re((wOc,YZn)=>{"use strict";p();var{createInflate:sEt,createGunzip:HZn,createBrotliDecompress:Ccs,createZstdDecompress:Ics}=require("node:zlib"),{pipeline:wcs,Transform:Tcs}=require("node:stream"),{InvalidArgumentError:vcs,ResponseExceededMaxSizeError:VZn}=Wi(),Rcs=qY(),qZn={gzip:HZn,"x-gzip":HZn,br:Ccs,deflate:sEt,compress:sEt,"x-compress":sEt,zstd:Ics},kcs=[204,304],Bcs=64*1024*1024;function Ncs(t){let e=0;return new Tcs({transform(n,r,i){let s=e+n.length;if(s>t){i(new VZn(`Decompressed response size (${s}) exceeded maxSize (${t})`));return}e=s,i(null,n)}})}var jZn=!1,oEt=class extends Rcs{#e=[];#t;#n;#r;#i;#s=0;#o=!1;#a=!1;constructor(e,{skipStatusCodes:n=kcs,skipErrorResponses:r=!0,maxSize:i=Bcs}={}){if(!Number.isSafeInteger(i)||i<1)throw new vcs("maxSize must be a positive integer");super(e),this.#n=n,this.#r=r,this.#i=i}#c(e,n){return!!(!e||n<200||this.#n.includes(n)||this.#r&&n>=400)}#l(e){let n=e.split(","),r=5;if(n.length>r)throw new Error(`too many content-encodings in response: ${n.length}, maximum allowed is ${r}`);let i=[];for(let o=n.length-1;o>=0;o--){let a=n[o].trim();if(a){if(!qZn[a])return i.length=0,i;i.push(qZn[a]())}}if(i.length<2)return i;let s=[];for(let o=0;o{if(this.#o)return;let r;for(;(r=e.read())!==null;){let i=this.#s+r.length;if(i>this.#i){this.#d(n,new VZn(`Decompressed response size (${i}) exceeded maxSize (${this.#i})`));return}if(this.#s=i,super.onResponseData(n,r)===!1)break}}),e.on("error",r=>{this.#d(n,r)})}#u(e){let n=this.#e[0];this.#p(n,e),n.on("end",()=>{this.#o||(this.#o=!0,this.#f(),super.onResponseEnd(e,this.#t))})}#h(e){let n=this.#e[this.#e.length-1];this.#p(n,e),wcs(this.#e,r=>{if(!this.#o){if(r){this.#d(e,r);return}this.#o=!0,this.#f(),super.onResponseEnd(e,this.#t)}})}#f(){this.#e.length=0}onResponseStart(e,n,r,i){let s=r["content-encoding"];if(this.#c(s,n))return super.onResponseStart(e,n,r,i);let o=this.#l(s.toLowerCase());if(o.length===0)return this.#f(),super.onResponseStart(e,n,r,i);this.#e=o;let{"content-encoding":a,"content-length":c,...u}=r;if(e?.rawHeaders){let l=e.rawHeaders;if(Array.isArray(l)){let d=[];for(let m=0;m0){this.#e[0].write(n);return}super.onResponseData(e,n)}onResponseEnd(e,n){if(this.#e.length>0){this.#a=!0,this.#t=n,this.#e[0].end();return}super.onResponseEnd(e,n)}onResponseError(e,n){if(!this.#o){this.#o=!0;for(let r of this.#e)r.destroy();this.#f(),super.onResponseError(e,n)}}};function Dcs(t={}){return jZn||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),jZn=!0),e=>(n,r)=>{if(n.method==="HEAD")return e(n,r);let i=new oEt(r,t);return e(n,i)}}YZn.exports=Dcs});var ZZn=re((vOc,XZn)=>{"use strict";p();var{RequestAbortedError:KZn}=Wi(),JZn=5*1024*1024,aEt=class{#e;#t=[];#n=JZn;#r=0;#i={};#s="";#o=!1;#a=!1;#c=!1;#l=!1;#d=null;#p=null;constructor(e,n,r=JZn){this.#e=e,this.#p=n,this.#n=r}addWaitingHandler(e){if(this.#l||this.#c)return!1;let n=this.#u(e),r=n.controller;try{if(e.onRequestStart?.(r,null),r.aborted)return n.done=!0,!0;this.#a&&e.onResponseStart?.(r,this.#r,this.#i,this.#s)}catch{return n.done=!0,!0}return r.aborted||this.#t.push(n),!0}onRequestStart(e,n){this.#d=e,this.#e.onRequestStart?.(e,n)}onRequestUpgrade(e,n,r,i){this.#e.onRequestUpgrade?.(e,n,r,i)}onResponseStart(e,n,r,i){this.#a=!0,this.#r=n,this.#i=r,this.#s=i,this.#e.onResponseStart?.(e,n,r,i);for(let s of this.#t){let{handler:o,controller:a}=s;if(s.done||a.aborted){s.done=!0;continue}try{o.onResponseStart?.(a,n,r,i)}catch{}a.aborted&&(s.done=!0)}this.#g()}onResponseData(e,n){if(!(this.#o||this.#l)){this.#c=!0,this.#e.onResponseData?.(e,n);for(let r of this.#t){let{handler:i,controller:s}=r;if(r.done||s.aborted){r.done=!0;continue}if(s.paused){this.#h(r,n);continue}try{i.onResponseData?.(s,n)}catch{}s.aborted&&(r.done=!0,r.bufferedChunks=[],r.bufferedBytes=0)}this.#g()}}onResponseEnd(e,n){if(!(this.#o||this.#l)){this.#l=!0,this.#e.onResponseEnd?.(e,n);for(let r of this.#t){if(r.done||r.controller.aborted){r.done=!0;continue}if(this.#f(r),r.done||r.controller.aborted){r.done=!0;continue}if(r.controller.paused&&r.bufferedChunks.length>0){r.pendingTrailers=n;continue}try{r.handler.onResponseEnd?.(r.controller,n)}catch{}r.done=!0}this.#g(),this.#p?.()}}onResponseError(e,n){if(!this.#l){this.#o=!0,this.#l=!0,this.#e.onResponseError?.(e,n);for(let r of this.#t)this.#A(r,n);this.#t=[],this.#p?.()}}#u(e){let n={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},r={aborted:!1,paused:!1,reason:null};return n.controller={resume:()=>{if(!r.aborted){if(r.paused=!1,this.#f(n),this.#l&&n.pendingTrailers&&n.bufferedChunks.length===0&&!r.paused&&!r.aborted){try{n.handler.onResponseEnd?.(n.controller,n.pendingTrailers)}catch{}n.pendingTrailers=null,n.done=!0}this.#g()}},pause:()=>{r.aborted||(r.paused=!0)},get paused(){return r.paused},get aborted(){return r.aborted},get reason(){return r.reason},abort:i=>{if(!r.aborted){r.aborted=!0,r.reason=i??null,n.done=!0,n.pendingTrailers=null,n.bufferedChunks=[],n.bufferedBytes=0;try{e.onResponseError?.(n.controller,r.reason??new KZn)}catch{}}}},n}#h(e,n){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let r=Buffer.from(n);if(e.bufferedChunks.push(r),e.bufferedBytes+=r.length,e.bufferedBytes>this.#n){let i=new KZn(`Deduplicated waiting handler exceeded maxBufferSize (${this.#n} bytes) while paused`);this.#A(e,i)}}#f(e){let{handler:n,controller:r}=e;for(;!e.done&&!r.aborted&&!r.paused&&e.bufferedChunks.length>0;){let i=e.bufferedChunks.shift();e.bufferedBytes-=i.length;try{n.onResponseData?.(r,i)}catch{}if(r.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#A(e,n){e.done||(e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0,e.controller.abort(n))}#g(){this.#t=this.#t.filter(e=>e.done===!1)}};XZn.exports=aEt});var ter=re((kOc,eer)=>{"use strict";p();var Pcs=require("node:diagnostics_channel"),Mcs=Zi(),Ocs=ZZn(),{getInterceptorOrigin:Lcs,normalizeHeaders:Fcs,makeCacheKey:Qcs,makeDeduplicationKey:Ucs}=YY(),VNe=Pcs.channel("undici:request:pending-requests");eer.exports=(t={})=>{let{methods:e=["GET"],skipHeaderNames:n=[],excludeHeaderNames:r=[],maxBufferSize:i=5*1024*1024}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(!Array.isArray(e))throw new TypeError(`expected opts.methods to be an array, got ${typeof e}`);for(let c of e)if(!Mcs.safeHTTPMethods.includes(c))throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${c}`);if(!Array.isArray(n))throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof n}`);if(!Array.isArray(r))throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof r}`);if(!Number.isFinite(i)||i<=0)throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${i}`);let s=new Set(n.map(c=>c.toLowerCase())),o=new Set(r.map(c=>c.toLowerCase())),a=new Map;return(c,u)=>(l,d)=>{let m=Lcs(l,u);if(!m||l.upgrade||e.includes(l.method)===!1)return c(l,d);if(l={...l,headers:Fcs(l)},s.size>0){for(let y of Object.keys(l.headers))if(s.has(y.toLowerCase()))return c(l,d)}let h=Qcs(l,m),f=Ucs(h,o),g=a.get(f);if(g)return g.addWaitingHandler(d)?!0:c(l,d);let A=new Ocs(d,()=>{a.delete(f),VNe.hasSubscribers&&VNe.publish({size:a.size,key:f,type:"removed"})},i);return a.set(f,A),VNe.hasSubscribers&&VNe.publish({size:a.size,key:f,type:"added"}),c(l,A)}}});var ier=re((DOc,rer)=>{"use strict";p();var{Writable:Gcs}=require("node:stream"),{assertCacheKey:cEt,assertCacheValue:$cs}=YY(),lEt,QE=3,ner=2*1e3*1e3*1e3;rer.exports=class{#e=ner;#t=1/0;#n;#r;#i;#s;#o;#a;#c;#l;constructor(e){if(e){if(typeof e!="object")throw new TypeError("SqliteCacheStore options must be an object");if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>ner)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#e=e.maxEntrySize}if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#t=e.maxCount}}lEt||(lEt=require("node:sqlite").DatabaseSync),this.#n=new lEt(e?.location??":memory:"),this.#n.exec(` + PRAGMA journal_mode = WAL; + PRAGMA synchronous = NORMAL; + PRAGMA temp_store = memory; + PRAGMA optimize; + + CREATE TABLE IF NOT EXISTS cacheInterceptorV${QE} ( + -- Data specific to us + id INTEGER PRIMARY KEY AUTOINCREMENT, + url TEXT NOT NULL, + method TEXT NOT NULL, + + -- Data returned to the interceptor + body BUF NULL, + deleteAt INTEGER NOT NULL, + statusCode INTEGER NOT NULL, + statusMessage TEXT NOT NULL, + headers TEXT NULL, + cacheControlDirectives TEXT NULL, + etag TEXT NULL, + vary TEXT NULL, + cachedAt INTEGER NOT NULL, + staleAt INTEGER NOT NULL + ); + + CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${QE}_getValuesQuery ON cacheInterceptorV${QE}(url, method, deleteAt); + CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${QE}_deleteByUrlQuery ON cacheInterceptorV${QE}(deleteAt); + `),this.#r=this.#n.prepare(` + SELECT + id, + body, + deleteAt, + statusCode, + statusMessage, + headers, + etag, + cacheControlDirectives, + vary, + cachedAt, + staleAt + FROM cacheInterceptorV${QE} + WHERE + url = ? + AND method = ? + ORDER BY + deleteAt ASC + `),this.#i=this.#n.prepare(` + UPDATE cacheInterceptorV${QE} SET + body = ?, + deleteAt = ?, + statusCode = ?, + statusMessage = ?, + headers = ?, + etag = ?, + cacheControlDirectives = ?, + vary = ?, + cachedAt = ?, + staleAt = ? + WHERE + id = ? + `),this.#s=this.#n.prepare(` + INSERT INTO cacheInterceptorV${QE} ( + url, + method, + body, + deleteAt, + statusCode, + statusMessage, + headers, + etag, + cacheControlDirectives, + vary, + cachedAt, + staleAt + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + `),this.#a=this.#n.prepare(`DELETE FROM cacheInterceptorV${QE} WHERE url = ?`),this.#c=this.#n.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${QE}`),this.#o=this.#n.prepare(`DELETE FROM cacheInterceptorV${QE} WHERE deleteAt <= ?`),this.#l=this.#t===1/0?null:this.#n.prepare(` + DELETE FROM cacheInterceptorV${QE} + WHERE id IN ( + SELECT + id + FROM cacheInterceptorV${QE} + ORDER BY cachedAt ASC + LIMIT ? + ) + `)}close(){this.#n.close()}get(e){cEt(e);let n=this.#u(e);return n?{body:n.body?Buffer.from(n.body.buffer,n.body.byteOffset,n.body.byteLength):void 0,statusCode:n.statusCode,statusMessage:n.statusMessage,headers:n.headers?JSON.parse(n.headers):void 0,etag:n.etag?n.etag:void 0,vary:n.vary?JSON.parse(n.vary):void 0,cacheControlDirectives:n.cacheControlDirectives?JSON.parse(n.cacheControlDirectives):void 0,cachedAt:n.cachedAt,staleAt:n.staleAt,deleteAt:n.deleteAt}:void 0}set(e,n){cEt(e);let r=this.#p(e),i=Array.isArray(n.body)?Buffer.concat(n.body):n.body,s=i?.byteLength;if(s&&s>this.#e)return;let o=this.#u(e,!0);o?this.#i.run(i,n.deleteAt,n.statusCode,n.statusMessage,n.headers?JSON.stringify(n.headers):null,n.etag?n.etag:null,n.cacheControlDirectives?JSON.stringify(n.cacheControlDirectives):null,n.vary?JSON.stringify(n.vary):null,n.cachedAt,n.staleAt,o.id):(this.#s.run(r,e.method,i,n.deleteAt,n.statusCode,n.statusMessage,n.headers?JSON.stringify(n.headers):null,n.etag?n.etag:null,n.cacheControlDirectives?JSON.stringify(n.cacheControlDirectives):null,n.vary?JSON.stringify(n.vary):null,n.cachedAt,n.staleAt),this.#d())}createWriteStream(e,n){cEt(e),$cs(n);let r=0,i=[],s=this;return new Gcs({decodeStrings:!0,write(o,a,c){r+=o.byteLength,r<=s.#e?i.push(o):this.destroy(),c()},final(o){s.set(e,{...n,body:i}),o()}})}delete(e){if(typeof e!="object")throw new TypeError(`expected key to be object, got ${typeof e}`);this.#a.run(this.#p(e))}#d(){if(Number.isFinite(this.#t)&&this.size<=this.#t)return 0;{let e=this.#o.run(Date.now()).changes;if(e)return e}{let e=this.#l?.run(Math.max(Math.floor(this.#t*.1),1)).changes;if(e)return e}return 0}get size(){let{total:e}=this.#c.get();return e}#p(e){return`${e.origin}/${e.path}`}#u(e,n=!1){let r=this.#p(e),{headers:i,method:s}=e,o=this.#r.all(r,s);if(o.length===0)return;let a=Date.now();for(let c of o){if(a>=c.deleteAt&&!n)continue;let u=!0;if(c.vary){let l=JSON.parse(c.vary);for(let d in l)if(!Wcs(i[d],l[d])){u=!1;break}}if(u)return c}}};function Wcs(t,e){if(t==null&&e==null)return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0;n{"use strict";p();var{kConstruct:Hcs}=Oo(),{kEnumerableProperty:JY}=Zi(),{iteratorMixin:qcs,isValidHeaderName:bae,isValidHeaderValue:oer}=OE(),{webidl:Lo}=lh(),uEt=require("node:assert"),YNe=require("node:util");function ser(t){return t===10||t===13||t===9||t===32}function aer(t){let e=0,n=t.length;for(;n>e&&ser(t.charCodeAt(n-1));)--n;for(;n>e&&ser(t.charCodeAt(e));)++e;return e===0&&n===t.length?t:t.substring(e,n)}function cer(t,e){if(Array.isArray(e))for(let n=0;n>","record"]})}function dEt(t,e,n){if(n=aer(n),bae(e)){if(!oer(n))throw Lo.errors.invalidArgument({prefix:"Headers.append",value:n,type:"header value"})}else throw Lo.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(uer(t)==="immutable")throw new TypeError("immutable");return KNe(t).append(e,n,!1)}function jcs(t){let e=KNe(t);if(!e)return[];if(e.sortedMap)return e.sortedMap;let n=[],r=e.toSortedArray(),i=e.cookies;if(i===null||i.length===1)return e.sortedMap=r;for(let s=0;s>1),n[u][0]<=l[0]?c=u+1:a=u;if(s!==u){for(o=s;o>c;)n[o]=n[--o];n[c]=l}}if(!r.next().done)throw new TypeError("Unreachable");return n}else{let r=0;for(let{0:i,1:{value:s}}of this.headersMap)n[r++]=[i,s],uEt(s!==null);return n.sort(ler)}}},kS=class t{#e;#t;constructor(e=void 0){Lo.util.markAsUncloneable(this),e!==Hcs&&(this.#t=new zNe,this.#e="none",e!==void 0&&(e=Lo.converters.HeadersInit(e,"Headers constructor","init"),cer(this,e)))}append(e,n){Lo.brandCheck(this,t),Lo.argumentLengthCheck(arguments,2,"Headers.append");let r="Headers.append";return e=Lo.converters.ByteString(e,r,"name"),n=Lo.converters.ByteString(n,r,"value"),dEt(this,e,n)}delete(e){if(Lo.brandCheck(this,t),Lo.argumentLengthCheck(arguments,1,"Headers.delete"),e=Lo.converters.ByteString(e,"Headers.delete","name"),!bae(e))throw Lo.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){Lo.brandCheck(this,t),Lo.argumentLengthCheck(arguments,1,"Headers.get");let n="Headers.get";if(e=Lo.converters.ByteString(e,n,"name"),!bae(e))throw Lo.errors.invalidArgument({prefix:n,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Lo.brandCheck(this,t),Lo.argumentLengthCheck(arguments,1,"Headers.has");let n="Headers.has";if(e=Lo.converters.ByteString(e,n,"name"),!bae(e))throw Lo.errors.invalidArgument({prefix:n,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,n){Lo.brandCheck(this,t),Lo.argumentLengthCheck(arguments,2,"Headers.set");let r="Headers.set";if(e=Lo.converters.ByteString(e,r,"name"),n=Lo.converters.ByteString(n,r,"value"),n=aer(n),bae(e)){if(!oer(n))throw Lo.errors.invalidArgument({prefix:r,value:n,type:"header value"})}else throw Lo.errors.invalidArgument({prefix:r,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,n,!1)}getSetCookie(){Lo.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[YNe.inspect.custom](e,n){return n.depth??=e,`Headers ${YNe.formatWithOptions(n,this.#t.entries)}`}static getHeadersGuard(e){return e.#e}static setHeadersGuard(e,n){e.#e=n}static getHeadersList(e){return e.#t}static setHeadersList(e,n){e.#t=n}},{getHeadersGuard:uer,setHeadersGuard:Vcs,getHeadersList:KNe,setHeadersList:Ycs}=kS;Reflect.deleteProperty(kS,"getHeadersGuard");Reflect.deleteProperty(kS,"setHeadersGuard");Reflect.deleteProperty(kS,"getHeadersList");Reflect.deleteProperty(kS,"setHeadersList");qcs("Headers",kS,jcs,0,1);Object.defineProperties(kS.prototype,{append:JY,delete:JY,get:JY,has:JY,set:JY,getSetCookie:JY,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[YNe.inspect.custom]:{enumerable:!1}});Lo.converters.HeadersInit=function(t,e,n){if(Lo.util.Type(t)===Lo.util.Types.OBJECT){let r=Reflect.get(t,Symbol.iterator);if(!YNe.types.isProxy(t)&&r===kS.prototype.entries)try{return KNe(t).entriesList}catch{}return typeof r=="function"?Lo.converters["sequence>"](t,e,n,r.bind(t)):Lo.converters["record"](t,e,n)}throw Lo.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};der.exports={fill:cer,compareHeaderName:ler,Headers:kS,HeadersList:zNe,getHeadersGuard:uer,setHeadersGuard:Vcs,setHeadersList:Ycs,getHeadersList:KNe}});var xae=re((LOc,Ser)=>{"use strict";p();var{Headers:Aer,HeadersList:per,fill:zcs,getHeadersGuard:Kcs,setHeadersGuard:yer,setHeadersList:Eer}=OU(),{extractBody:mer,cloneBody:Jcs,mixinBody:Xcs,streamRegistry:ber,bodyUnusable:Zcs}=_Y(),_er=Zi(),her=require("node:util"),{kEnumerableProperty:UE}=_er,{isValidReasonPhrase:els,isCancelled:tls,isAborted:nls,isErrorLike:rls,environmentSettingsObject:ils}=OE(),{redirectStatusSet:sls,nullBodyStatus:ols}=woe(),{webidl:fo}=lh(),{URLSerializer:fer}=Wb(),{kConstruct:XNe}=Oo(),pEt=require("node:assert"),{isomorphicEncode:als,serializeJavascriptValueToJSONString:cls}=Dw(),lls=new TextEncoder("utf-8"),GE=class t{#e;#t;static error(){return _ae(ZNe(),"immutable")}static json(e,n=void 0){fo.argumentLengthCheck(arguments,1,"Response.json"),n=fo.converters.ResponseInit(n);let r=lls.encode(cls(e)),i=mer(r),s=_ae(XY({}),"response");return ger(s,n,{body:i[0],type:"application/json"}),s}static redirect(e,n=302){fo.argumentLengthCheck(arguments,1,"Response.redirect"),e=fo.converters.USVString(e),n=fo.converters["unsigned short"](n);let r;try{r=new URL(e,ils.settingsObject.baseUrl)}catch(o){throw new TypeError(`Failed to parse URL from ${e}`,{cause:o})}if(!sls.has(n))throw new RangeError(`Invalid status code ${n}`);let i=_ae(XY({}),"immutable");i.#t.status=n;let s=als(fer(r));return i.#t.headersList.append("location",s,!0),i}constructor(e=null,n=void 0){if(fo.util.markAsUncloneable(this),e===XNe)return;e!==null&&(e=fo.converters.BodyInit(e,"Response","body")),n=fo.converters.ResponseInit(n),this.#t=XY({}),this.#e=new Aer(XNe),yer(this.#e,"response"),Eer(this.#e,this.#t.headersList);let r=null;if(e!=null){let[i,s]=mer(e);r={body:i,type:s}}ger(this,n,r)}get type(){return fo.brandCheck(this,t),this.#t.type}get url(){fo.brandCheck(this,t);let e=this.#t.urlList,n=e[e.length-1]??null;return n===null?"":fer(n,!0)}get redirected(){return fo.brandCheck(this,t),this.#t.urlList.length>1}get status(){return fo.brandCheck(this,t),this.#t.status}get ok(){return fo.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return fo.brandCheck(this,t),this.#t.statusText}get headers(){return fo.brandCheck(this,t),this.#e}get body(){return fo.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return fo.brandCheck(this,t),!!this.#t.body&&_er.isDisturbed(this.#t.body.stream)}clone(){if(fo.brandCheck(this,t),Zcs(this.#t))throw fo.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=mEt(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&ber.register(this,new WeakRef(this.#t.body.stream)),_ae(e,Kcs(this.#e))}[her.inspect.custom](e,n){n.depth===null&&(n.depth=2),n.colors??=!0;let r={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${her.formatWithOptions(n,r)}`}static getResponseHeaders(e){return e.#e}static setResponseHeaders(e,n){e.#e=n}static getResponseState(e){return e.#t}static setResponseState(e,n){e.#t=n}},{getResponseHeaders:uls,setResponseHeaders:dls,getResponseState:LU,setResponseState:pls}=GE;Reflect.deleteProperty(GE,"getResponseHeaders");Reflect.deleteProperty(GE,"setResponseHeaders");Reflect.deleteProperty(GE,"getResponseState");Reflect.deleteProperty(GE,"setResponseState");Xcs(GE,LU);Object.defineProperties(GE.prototype,{type:UE,url:UE,status:UE,ok:UE,redirected:UE,statusText:UE,headers:UE,clone:UE,body:UE,bodyUsed:UE,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(GE,{json:UE,redirect:UE,error:UE});function mEt(t){if(t.internalResponse)return xer(mEt(t.internalResponse),t.type);let e=XY({...t,body:null});return t.body!=null&&(e.body=Jcs(t.body)),e}function XY(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new per(t?.headersList):new per,urlList:t?.urlList?[...t.urlList]:[]}}function ZNe(t){let e=rls(t);return XY({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}function mls(t){return t.type==="error"&&t.status===0}function JNe(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(n,r){return r in e?e[r]:n[r]},set(n,r,i){return pEt(!(r in e)),n[r]=i,!0}})}function xer(t,e){if(e==="basic")return JNe(t,{type:"basic",headersList:t.headersList});if(e==="cors")return JNe(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return JNe(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return JNe(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});pEt(!1)}function hls(t,e=null){return pEt(tls(t)),nls(t)?ZNe(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):ZNe(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}function ger(t,e,n){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!els(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(LU(t).status=e.status),"statusText"in e&&e.statusText!=null&&(LU(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&zcs(uls(t),e.headers),n){if(ols.includes(t.status))throw fo.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});LU(t).body=n.body,n.type!=null&&!LU(t).headersList.contains("content-type",!0)&&LU(t).headersList.append("content-type",n.type,!0)}}function _ae(t,e){let n=new GE(XNe);pls(n,t);let r=new Aer(XNe);return dls(n,r),Eer(r,t.headersList),yer(r,e),t.urlList.length!==0&&t.body?.stream&&ber.register(n,new WeakRef(t.body.stream)),n}fo.converters.XMLHttpRequestBodyInit=function(t,e,n){return typeof t=="string"?fo.converters.USVString(t,e,n):fo.is.Blob(t)||fo.is.BufferSource(t)||fo.is.FormData(t)||fo.is.URLSearchParams(t)?t:fo.converters.DOMString(t,e,n)};fo.converters.BodyInit=function(t,e,n){return fo.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:fo.converters.XMLHttpRequestBodyInit(t,e,n)};fo.converters.ResponseInit=fo.dictionaryConverter([{key:"status",converter:fo.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:fo.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:fo.converters.HeadersInit}]);fo.is.Response=fo.util.MakeTypeAssertion(GE);Ser.exports={isNetworkError:mls,makeNetworkError:ZNe,makeResponse:XY,makeAppropriateNetworkError:hls,filterResponse:xer,Response:GE,cloneResponse:mEt,fromInnerResponse:_ae,getResponseState:LU}});var ZY=re((QOc,Oer)=>{"use strict";p();var{extractBody:fls,mixinBody:gls,cloneBody:Als,bodyUnusable:Cer}=_Y(),{Headers:ker,fill:yls,HeadersList:nDe,setHeadersGuard:hEt,getHeadersGuard:Els,setHeadersList:Ber,getHeadersList:Ier}=OU(),tDe=Zi(),wer=require("node:util"),{isValidHTTPToken:bls,sameOrigin:Ter,environmentSettingsObject:eDe}=OE(),{forbiddenMethodsSet:_ls,corsSafeListedMethodsSet:xls,referrerPolicy:Sls,requestRedirect:Cls,requestMode:Ils,requestCredentials:wls,requestCache:Tls,requestDuplex:vls}=woe(),{kEnumerableProperty:Gd,normalizedMethodRecordsBase:Rls,normalizedMethodRecords:kls}=tDe,{webidl:yi}=lh(),{URLSerializer:Bls}=Wb(),{kConstruct:rDe}=Oo(),Nls=require("node:assert"),{getMaxListeners:Ner,setMaxListeners:Dls,defaultMaxListeners:Pls}=require("node:events"),Mls=Symbol("abortController"),fEt=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),iDe=new WeakMap,gEt;try{gEt=Ner(new AbortController().signal)>0}catch{gEt=!1}function ver(t){return e;function e(){let n=t.deref();if(n!==void 0){fEt.unregister(e),this.removeEventListener("abort",e),n.abort(this.reason);let r=iDe.get(n.signal);if(r!==void 0){if(r.size!==0){for(let i of r){let s=i.deref();s!==void 0&&s.abort(this.reason)}r.clear()}iDe.delete(n.signal)}}}}var Rer=!1,Rg=class t{#e;#t;#n;#r;#i=null;constructor(e,n=void 0){if(yi.util.markAsUncloneable(this),e===rDe)return;yi.argumentLengthCheck(arguments,1,"Request constructor"),e=yi.converters.RequestInfo(e),n=yi.converters.RequestInit(n);let i=null,s=null,o=eDe.settingsObject.baseUrl,a=null;if(typeof e=="string"){this.#t=n.dispatcher;let y;try{y=new URL(e,o)}catch(E){throw new TypeError("Failed to parse URL from "+e,{cause:E})}if(y.username||y.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);i=sDe({urlList:[y]}),s="cors"}else Nls(yi.is.Request(e)),i=e.#r,a=e.#e,this.#t=n.dispatcher||e.#t;let c=eDe.settingsObject.origin,u="client";if(i.window?.constructor?.name==="EnvironmentSettingsObject"&&Ter(i.window,c)&&(u=i.window),n.window!=null)throw new TypeError(`'window' option '${u}' must be null`);"window"in n&&(u="no-window"),i=sDe({method:i.method,headersList:i.headersList,unsafeRequest:i.unsafeRequest,client:eDe.settingsObject,window:u,priority:i.priority,origin:i.origin,referrer:i.referrer,referrerPolicy:i.referrerPolicy,mode:i.mode,credentials:i.credentials,cache:i.cache,redirect:i.redirect,integrity:i.integrity,keepalive:i.keepalive,reloadNavigation:i.reloadNavigation,historyNavigation:i.historyNavigation,urlList:[...i.urlList]});let l=Object.keys(n).length!==0;if(l&&(i.mode==="navigate"&&(i.mode="same-origin"),i.reloadNavigation=!1,i.historyNavigation=!1,i.origin="client",i.referrer="client",i.referrerPolicy="",i.url=i.urlList[i.urlList.length-1],i.urlList=[i.url]),n.referrer!==void 0){let y=n.referrer;if(y==="")i.referrer="no-referrer";else{let E;try{E=new URL(y,o)}catch(_){throw new TypeError(`Referrer "${y}" is not a valid URL.`,{cause:_})}E.protocol==="about:"&&E.hostname==="client"||c&&!Ter(E,eDe.settingsObject.baseUrl)?i.referrer="client":i.referrer=E}}n.referrerPolicy!==void 0&&(i.referrerPolicy=n.referrerPolicy);let d;if(n.mode!==void 0?d=n.mode:d=s,d==="navigate")throw yi.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(d!=null&&(i.mode=d),n.credentials!==void 0&&(i.credentials=n.credentials),n.cache!==void 0&&(i.cache=n.cache),i.cache==="only-if-cached"&&i.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(n.redirect!==void 0&&(i.redirect=n.redirect),n.integrity!=null&&(i.integrity=String(n.integrity)),n.keepalive!==void 0&&(i.keepalive=!!n.keepalive),n.method!==void 0){let y=n.method,E=kls[y];if(E!==void 0)i.method=E;else{if(!bls(y))throw new TypeError(`'${y}' is not a valid HTTP method.`);let _=y.toUpperCase();if(_ls.has(_))throw new TypeError(`'${y}' HTTP method is unsupported.`);y=Rls[_]??y,i.method=y}!Rer&&i.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),Rer=!0)}n.signal!==void 0&&(a=n.signal),this.#r=i;let m=new AbortController;if(this.#e=m.signal,a!=null)if(a.aborted)m.abort(a.reason);else{this[Mls]=m;let y=new WeakRef(m),E=ver(y);gEt&&Ner(a)===Pls&&Dls(1500,a);let _=tDe.addAbortListener(a,E);fEt.register(m,{signal:a,abort:E},E),this.#i=()=>{fEt.unregister(E),_(),this.#i=null}}if(this.#n=new ker(rDe),Ber(this.#n,i.headersList),hEt(this.#n,"request"),d==="no-cors"){if(!xls.has(i.method))throw new TypeError(`'${i.method} is unsupported in no-cors mode.`);hEt(this.#n,"request-no-cors")}if(l){let y=Ier(this.#n),E=n.headers!==void 0?n.headers:new nDe(y);if(y.clear(),E instanceof nDe){for(let{name:_,value:S}of E.rawValues())y.append(_,S,!1);y.cookies=E.cookies}else yls(this.#n,E)}let h=yi.is.Request(e)?e.#r.body:null;if((n.body!=null||h!=null)&&(i.method==="GET"||i.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let f=null;if(n.body!=null){let[y,E]=fls(n.body,i.keepalive);f=y,E&&!Ier(this.#n).contains("content-type",!0)&&this.#n.append("content-type",E,!0)}let g=f??h;if(g!=null&&g.source==null){if(f!=null&&n.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(i.mode!=="same-origin"&&i.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');i.useCORSPreflightFlag=!0}let A=g;if(f==null&&h!=null){if(Cer(e.#r))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let y=new TransformStream;h.stream.pipeThrough(y),A={source:h.source,length:h.length,stream:y.readable}}this.#r.body=A}get method(){return yi.brandCheck(this,t),this.#r.method}get url(){return yi.brandCheck(this,t),Bls(this.#r.url)}get headers(){return yi.brandCheck(this,t),this.#n}get destination(){return yi.brandCheck(this,t),this.#r.destination}get referrer(){return yi.brandCheck(this,t),this.#r.referrer==="no-referrer"?"":this.#r.referrer==="client"?"about:client":this.#r.referrer.toString()}get referrerPolicy(){return yi.brandCheck(this,t),this.#r.referrerPolicy}get mode(){return yi.brandCheck(this,t),this.#r.mode}get credentials(){return yi.brandCheck(this,t),this.#r.credentials}get cache(){return yi.brandCheck(this,t),this.#r.cache}get redirect(){return yi.brandCheck(this,t),this.#r.redirect}get integrity(){return yi.brandCheck(this,t),this.#r.integrity}get keepalive(){return yi.brandCheck(this,t),this.#r.keepalive}get isReloadNavigation(){return yi.brandCheck(this,t),this.#r.reloadNavigation}get isHistoryNavigation(){return yi.brandCheck(this,t),this.#r.historyNavigation}get signal(){return yi.brandCheck(this,t),this.#e}get body(){return yi.brandCheck(this,t),this.#r.body?this.#r.body.stream:null}get bodyUsed(){return yi.brandCheck(this,t),!!this.#r.body&&tDe.isDisturbed(this.#r.body.stream)}get duplex(){return yi.brandCheck(this,t),"half"}clone(){if(yi.brandCheck(this,t),Cer(this.#r))throw new TypeError("unusable");let e=Per(this.#r),n=new AbortController;if(this.signal.aborted)n.abort(this.signal.reason);else{let r=iDe.get(this.signal);r===void 0&&(r=new Set,iDe.set(this.signal,r));let i=new WeakRef(n);r.add(i),tDe.addAbortListener(n.signal,ver(i))}return Mer(e,this.#t,n.signal,Els(this.#n))}[wer.inspect.custom](e,n){n.depth===null&&(n.depth=2),n.colors??=!0;let r={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${wer.formatWithOptions(n,r)}`}static setRequestSignal(e,n){return e.#e=n,e}static getRequestDispatcher(e){return e.#t}static setRequestDispatcher(e,n){e.#t=n}static setRequestHeaders(e,n){e.#n=n}static getRequestState(e){return e.#r}static setRequestState(e,n){e.#r=n}static removeRequestAbortListener(e){e.#i?.()}},{setRequestSignal:Ols,getRequestDispatcher:Lls,setRequestDispatcher:Fls,setRequestHeaders:Qls,getRequestState:Der,setRequestState:Uls,removeRequestAbortListener:Gls}=Rg;Reflect.deleteProperty(Rg,"setRequestSignal");Reflect.deleteProperty(Rg,"getRequestDispatcher");Reflect.deleteProperty(Rg,"setRequestDispatcher");Reflect.deleteProperty(Rg,"setRequestHeaders");Reflect.deleteProperty(Rg,"getRequestState");Reflect.deleteProperty(Rg,"setRequestState");Reflect.deleteProperty(Rg,"removeRequestAbortListener");gls(Rg,Der);function sDe(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??"auto",origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,useURLCredentials:t.useURLCredentials??void 0,traversableForUserPrompts:t.traversableForUserPrompts??"client",urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new nDe(t.headersList):new nDe}}function Per(t){let e=sDe({...t,body:null});return t.body!=null&&(e.body=Als(t.body)),e}function Mer(t,e,n,r){let i=new Rg(rDe);Uls(i,t),Fls(i,e),Ols(i,n);let s=new ker(rDe);return Qls(i,s),Ber(s,t.headersList),hEt(s,r),i}Object.defineProperties(Rg.prototype,{method:Gd,url:Gd,headers:Gd,redirect:Gd,clone:Gd,signal:Gd,duplex:Gd,destination:Gd,body:Gd,bodyUsed:Gd,isHistoryNavigation:Gd,isReloadNavigation:Gd,keepalive:Gd,integrity:Gd,cache:Gd,credentials:Gd,attribute:Gd,referrerPolicy:Gd,referrer:Gd,mode:Gd,[Symbol.toStringTag]:{value:"Request",configurable:!0}});yi.is.Request=yi.util.MakeTypeAssertion(Rg);yi.converters.RequestInfo=function(t){return typeof t=="string"?yi.converters.USVString(t):yi.is.Request(t)?t:yi.converters.USVString(t)};yi.converters.RequestInit=yi.dictionaryConverter([{key:"method",converter:yi.converters.ByteString},{key:"headers",converter:yi.converters.HeadersInit},{key:"body",converter:yi.nullableConverter(yi.converters.BodyInit)},{key:"referrer",converter:yi.converters.USVString},{key:"referrerPolicy",converter:yi.converters.DOMString,allowedValues:Sls},{key:"mode",converter:yi.converters.DOMString,allowedValues:Ils},{key:"credentials",converter:yi.converters.DOMString,allowedValues:wls},{key:"cache",converter:yi.converters.DOMString,allowedValues:Tls},{key:"redirect",converter:yi.converters.DOMString,allowedValues:Cls},{key:"integrity",converter:yi.converters.DOMString},{key:"keepalive",converter:yi.converters.boolean},{key:"signal",converter:yi.nullableConverter(t=>yi.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:yi.converters.any},{key:"duplex",converter:yi.converters.DOMString,allowedValues:vls},{key:"dispatcher",converter:yi.converters.any},{key:"priority",converter:yi.converters.DOMString,allowedValues:["high","low","auto"]}]);Oer.exports={Request:Rg,makeRequest:sDe,fromInnerRequest:Mer,cloneRequest:Per,getRequestDispatcher:Lls,getRequestState:Der,removeRequestAbortListener:Gls}});var Her=re((GOc,Wer)=>{"use strict";p();var $ls=require("node:assert"),{runtimeFeatures:Fer}=yY(),FU=new Map([["sha256",0],["sha384",1],["sha512",2]]),AEt;if(Fer.has("crypto")){AEt=require("node:crypto");let t=AEt.getHashes();t.length===0&&FU.clear();for(let e of FU.keys())t.includes(e)===!1&&FU.delete(e)}else FU.clear();var Ler=Map.prototype.get.bind(FU),yEt=Map.prototype.has.bind(FU),Wls=Fer.has("crypto")===!1||FU.size===0?()=>!0:(t,e)=>{let n=Uer(e);if(n.length===0)return!0;let r=Qer(n);for(let i of r){let s=i.alg,o=i.val,a=Ger(s,t);if($er(a,o))return!0}return!1};function Qer(t){let e=[],n=null;for(let r of t){if($ls(yEt(r.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(r),n=r;continue}let i=n.alg,s=Ler(i),o=r.alg,a=Ler(o);as?(n=r,e[0]=r,e.length=1):e.push(r))}return e}function Uer(t){let e=[];for(let n of t.split(" ")){let i=n.split("?",1)[0],s="",o=[i.slice(0,6),i.slice(7)],a=o[0];if(!yEt(a))continue;o[1]&&(s=o[1]);let c={alg:a,val:s};e.push(c)}return e}var Ger=(t,e)=>AEt.hash(t,e,"base64");function $er(t,e){let n=t.length;n!==0&&t[n-1]==="="&&(n-=1),n!==0&&t[n-1]==="="&&(n-=1);let r=e.length;if(r!==0&&e[r-1]==="="&&(r-=1),r!==0&&e[r-1]==="="&&(r-=1),n!==r)return!1;for(let i=0;i{"use strict";p();var{makeNetworkError:Wa,makeAppropriateNetworkError:Sae,filterResponse:EEt,makeResponse:oDe,fromInnerResponse:Hls,getResponseState:qls}=xae(),{HeadersList:qer}=OU(),{Request:jls,cloneRequest:jer,getRequestDispatcher:Vls,getRequestState:Yls,removeRequestAbortListener:zls}=ZY(),BS=require("node:zlib"),{makePolicyContainer:Kls,clonePolicyContainer:Jls,requestBadPort:Xls,TAOCheck:Zls,appendRequestOriginHeader:eus,responseLocationURL:tus,requestCurrentURL:$E,setRequestReferrerPolicyOnRedirect:nus,tryUpgradeRequestToAPotentiallyTrustworthyURL:rus,createOpaqueTimingInfo:IEt,appendFetchMetadata:ius,corsCheck:sus,crossOriginResourcePolicyCheck:ous,determineRequestsReferrer:aus,coarsenedSharedCurrentTime:Cae,sameOrigin:SEt,isCancelled:HP,isAborted:Ver,isErrorLike:cus,fullyReadBody:lus,readableStreamClose:uus,urlIsLocal:dus,urlIsHttpHttpsScheme:uDe,urlHasHttpsScheme:pus,clampAndCoarsenConnectionTimingInfo:mus,simpleRangeHeaderValue:hus,buildContentRange:fus,createInflate:gus,extractMimeType:Aus,hasAuthenticationEntry:yus,includesCredentials:Yer,isTraversableNavigable:Eus}=OE(),QU=require("node:assert"),{safelyExtractBody:dDe,extractBody:zer}=_Y(),{redirectStatusSet:Xer,nullBodyStatus:Zer,safeMethodsSet:bus,requestBodyHeader:_us,subresourceSet:xus}=woe(),Sus=require("node:events"),{Readable:Cus,pipeline:Ius,finished:wus,isErrored:Tus,isReadable:aDe}=require("node:stream"),{addAbortListener:vus,bufferToLowerCasedHeaderName:Rus}=Zi(),{SocketError:kus}=Wi(),{dataURLProcessor:Bus,serializeAMimeType:Nus,minimizeSupportedMimeType:Dus}=Wb(),{getGlobalDispatcher:Pus}=gae(),{webidl:wEt}=lh(),{STATUS_CODES:Mus}=require("node:http"),{bytesMatch:Ous}=Her(),{isomorphicEncode:cDe}=Dw(),Lus=["GET","HEAD"],Fus=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",bEt;function Ker(t,e,n){if(Array.isArray(n)){for(let r=0;r{a=!0,QU(c!=null),c.abort(r.signal.reason);let m=o?.deref();_Et(n,i,m,r.signal.reason,c.controller)}),l=()=>{u(),zls(r)};return c=ntr({request:i,processResponseEndOfBody:m=>{Qus(m),l()},processResponse:m=>{if(!a){if(m.aborted){_Et(n,i,o,c.serializedAbortReason,c.controller),l();return}if(m.type==="error"){n.reject(new TypeError("fetch failed",{cause:m.error})),l();return}o=new WeakRef(Hls(m,"immutable")),n.resolve(o.deref()),n=null}},dispatcher:Vls(r),requestObject:r}),n.promise}function etr(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let n=t.urlList[0],r=t.timingInfo,i=t.cacheState;uDe(n)&&r!==null&&(t.timingAllowPassed||(r=IEt({startTime:r.startTime}),i=""),r.endTime=Cae(),t.timingInfo=r,ttr(r,n.href,e,globalThis,i,"",t.status))}var ttr=performance.markResourceTiming;function _Et(t,e,n,r,i){if(t&&t.reject(r),e.body?.stream!=null&&aDe(e.body.stream)&&e.body.stream.cancel(r).catch(o=>{if(o.code!=="ERR_INVALID_STATE")throw o}),n==null)return;let s=qls(n);s.body?.stream!=null&&aDe(s.body.stream)&&i.error(r)}function ntr({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:s,useParallelQueue:o=!1,dispatcher:a=Pus(),requestObject:c=null}){QU(a);let u=null,l=!1;t.client!=null&&(u=t.client.globalObject,l=t.client.crossOriginIsolatedCapability);let d=Cae(l),m=IEt({startTime:d}),h={controller:new lDe(a),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:s,processResponseEndOfBody:i,taskDestination:u,crossOriginIsolatedCapability:l,requestObject:c};return QU(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=Jls(t.client.policyContainer):t.policyContainer=Kls()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,xus.has(t.destination),rtr(h,!1),h.controller}async function rtr(t,e){try{let n=t.request,r=null;if(n.localURLsOnly&&!dus($E(n))&&(r=Wa("local URLs only")),rus(n),Xls(n)==="blocked"&&(r=Wa("bad port")),n.referrerPolicy===""&&(n.referrerPolicy=n.policyContainer.referrerPolicy),n.referrer!=="no-referrer"&&(n.referrer=aus(n)),r===null){let s=$E(n);SEt(s,n.url)&&n.responseTainting==="basic"||s.protocol==="data:"||n.mode==="navigate"||n.mode==="websocket"?(n.responseTainting="basic",r=await Jer(t)):n.mode==="same-origin"?r=Wa('request mode cannot be "same-origin"'):n.mode==="no-cors"?n.redirect!=="follow"?r=Wa('redirect mode cannot be "follow" for "no-cors" request'):(n.responseTainting="opaque",r=await Jer(t)):uDe($E(n))?(n.responseTainting="cors",r=await itr(t)):r=Wa("URL scheme must be a HTTP(S) scheme")}if(e)return r;r.status!==0&&!r.internalResponse&&(n.responseTainting,n.responseTainting==="basic"?r=EEt(r,"basic"):n.responseTainting==="cors"?r=EEt(r,"cors"):n.responseTainting==="opaque"?r=EEt(r,"opaque"):QU(!1));let i=r.status===0?r:r.internalResponse;if(i.urlList.length===0&&i.urlList.push(...n.urlList),n.timingAllowFailed||(r.timingAllowPassed=!0),r.type==="opaque"&&i.status===206&&i.rangeRequested&&!n.headers.contains("range",!0)&&(r=i=Wa()),r.status!==0&&(n.method==="HEAD"||n.method==="CONNECT"||Zer.includes(i.status))&&(i.body=null,t.controller.dump=!0),n.integrity){let s=a=>xEt(t,Wa(a));if(n.responseTainting==="opaque"||r.body==null){s(r.error);return}let o=a=>{if(!Ous(a,n.integrity)){s("integrity mismatch");return}r.body=dDe(a)[0],xEt(t,r)};lus(r.body,o,s)}else xEt(t,r)}catch(n){t.controller.terminate(n)}}function Jer(t){if(HP(t)&&t.request.redirectCount===0)return Promise.resolve(Sae(t));let{request:e}=t,{protocol:n}=$E(e);switch(n){case"about:":return Promise.resolve(Wa("about scheme is not supported"));case"blob:":{bEt||(bEt=require("node:buffer").resolveObjectURL);let r=$E(e);if(r.search.length!==0)return Promise.resolve(Wa("NetworkError when attempting to fetch resource."));let i=bEt(r.toString());if(e.method!=="GET"||!wEt.is.Blob(i))return Promise.resolve(Wa("invalid method"));let s=oDe(),o=i.size,a=cDe(`${o}`),c=i.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let u=e.headersList.get("range",!0),l=hus(u,!0);if(l==="failure")return Promise.resolve(Wa("failed to fetch the data URL"));let{rangeStartValue:d,rangeEndValue:m}=l;if(d===null)d=o-m,m=d+m-1;else{if(d>=o)return Promise.resolve(Wa("Range start is greater than the blob's size."));(m===null||m>=o)&&(m=o-1)}let h=i.slice(d,m+1,c),f=zer(h);s.body=f[0];let g=cDe(`${h.size}`),A=fus(d,m,o);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",g,!0),s.headersList.set("content-type",c,!0),s.headersList.set("content-range",A,!0)}else{let u=zer(i);s.statusText="OK",s.body=u[0],s.headersList.set("content-length",a,!0),s.headersList.set("content-type",c,!0)}return Promise.resolve(s)}case"data:":{let r=$E(e),i=Bus(r);if(i==="failure")return Promise.resolve(Wa("failed to fetch the data URL"));let s=Nus(i.mimeType);return Promise.resolve(oDe({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:dDe(i.body)[0]}))}case"file:":return Promise.resolve(Wa("not implemented... yet..."));case"http:":case"https:":return itr(t).catch(r=>Wa(r));default:return Promise.resolve(Wa("unknown scheme"))}}function Gus(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}function xEt(t,e){let n=t.timingInfo,r=()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=n),t.controller.reportTimingSteps=()=>{if(!uDe(t.request.url))return;n.endTime=s;let a=e.cacheState,c=e.bodyInfo;e.timingAllowPassed||(n=IEt(n),a="");let u=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){u=e.status;let l=Aus(e.headersList);l!=="failure"&&(c.contentType=Dus(l))}t.request.initiatorType!=null&&ttr(n,t.request.url.href,t.request.initiatorType,globalThis,a,c,u)};let o=()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()};queueMicrotask(()=>o())};t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let i=e.type==="error"?e:e.internalResponse??e;i.body==null?r():wus(i.body.stream,()=>{r()})}async function itr(t){let e=t.request,n=null,r=null,i=t.timingInfo;if(e.serviceWorkers,n===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),r=n=await CEt(t),e.responseTainting==="cors"&&sus(e,n)==="failure")return Wa("cors failure");Zls(e,n)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||n.type==="opaque")&&ous(e.origin,e.client,e.destination,r)==="blocked"?Wa("blocked"):(Xer.has(r.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?n=Wa("unexpected redirect"):e.redirect==="manual"?n=r:e.redirect==="follow"?n=await $us(t,n):QU(!1)),n.timingInfo=i,n)}function $us(t,e){let n=t.request,r=e.internalResponse?e.internalResponse:e,i;try{if(i=tus(r,$E(n).hash),i==null)return e}catch(o){return Promise.resolve(Wa(o))}if(!uDe(i))return Promise.resolve(Wa("URL scheme must be a HTTP(S) scheme"));if(n.redirectCount===20)return Promise.resolve(Wa("redirect count exceeded"));if(n.redirectCount+=1,n.mode==="cors"&&(i.username||i.password)&&!SEt(n,i))return Promise.resolve(Wa('cross origin not allowed for request mode "cors"'));if(n.responseTainting==="cors"&&(i.username||i.password))return Promise.resolve(Wa('URL cannot contain credentials for request mode "cors"'));if(r.status!==303&&n.body!=null&&n.body.source==null)return Promise.resolve(Wa());if([301,302].includes(r.status)&&n.method==="POST"||r.status===303&&!Lus.includes(n.method)){n.method="GET",n.body=null;for(let o of _us)n.headersList.delete(o)}SEt($E(n),i)||(n.headersList.delete("authorization",!0),n.headersList.delete("proxy-authorization",!0),n.headersList.delete("cookie",!0),n.headersList.delete("host",!0)),n.body!=null&&(QU(n.body.source!=null),n.body=dDe(n.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Cae(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),n.urlList.push(i),nus(n,r),rtr(t,!0)}async function CEt(t,e=!1,n=!1){let r=t.request,i=null,s=null,o=null,a=null,c=!1;r.window==="no-window"&&r.redirect==="error"?(i=t,s=r):(r.body?.source!=null?s=jer(r):(s=jer({...r,body:null}),s.body=r.body),i={...t},i.request=s);let u=r.credentials==="include"||r.credentials==="same-origin"&&r.responseTainting==="basic",l=s.body?s.body.length:null,d=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(d="0"),l!=null&&(d=cDe(`${l}`)),d!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",d,!0),l!=null&&s.keepalive,wEt.is.URL(s.referrer)&&s.headersList.append("referer",cDe(s.referrer.href),!0),eus(s),ius(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",Fus,!0),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(pus($E(s))?s.headersList.append("accept-encoding","br, gzip, deflate, zstd",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),u&&!s.headersList.contains("authorization",!0)){let m=null;if(!(yus(s)&&(s.useURLCredentials===void 0||!Yer($E(s))))){if(Yer($E(s))&&e){let{username:h,password:f}=$E(s);m=`Basic ${Buffer.from(`${h}:${f}`).toString("base64")}`}}m!==null&&s.headersList.append("Authorization",m,!1)}if(a==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,o==null){if(s.cache==="only-if-cached")return Wa("only if cached");let m=await Wus(i,u,n);!bus.has(s.method)&&m.status>=200&&m.status<=399,c&&m.status,o==null&&(o=m)}if(o.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(o.rangeRequested=!0),o.requestIncludesCredentials=u,o.status===401&&s.responseTainting!=="cors"&&u&&(r.useURLCredentials!==void 0||Eus(r.traversableForUserPrompts))){if(r.body!=null){if(r.body.source==null)return o;r.body=dDe(r.body.source)[0]}if(r.useURLCredentials===void 0||e)return HP(t)?Sae(t):o;t.controller.connection.destroy(),o=await CEt(t,!0)}if(o.status===407)return r.window==="no-window"?Wa():HP(t)?Sae(t):Wa("proxy authentication required");if(o.status===421&&!n&&(r.body==null||r.body.source!=null)){if(HP(t))return Sae(t);t.controller.connection.destroy(),o=await CEt(t,e,!0)}return o}async function Wus(t,e=!1,n=!1){QU(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(f,g=!0){this.destroyed||(this.destroyed=!0,g&&this.abort?.(f??new DOMException("The operation was aborted.","AbortError")))}};let r=t.request,i=null,s=t.timingInfo;null==null&&(r.cache="no-store");let a=n?"yes":"no";r.mode;let c=null;if(r.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(r.body!=null){let f=async function*(y){HP(t)||(yield y,t.processRequestBodyChunkLength?.(y.byteLength))},g=()=>{HP(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},A=y=>{HP(t)||(y.name==="AbortError"?t.controller.abort():t.controller.terminate(y))};c=(async function*(){try{for await(let y of r.body.stream)yield*f(y);g()}catch(y){A(y)}})()}try{let{body:f,status:g,statusText:A,headersList:y,socket:E}=await h({body:c});if(E)i=oDe({status:g,statusText:A,headersList:y,socket:E});else{let _=f[Symbol.asyncIterator]();t.controller.next=()=>_.next(),i=oDe({status:g,statusText:A,headersList:y})}}catch(f){return f.name==="AbortError"?(t.controller.connection.destroy(),Sae(t,f)):Wa(f)}let u=()=>t.controller.resume(),l=f=>{HP(t)||t.controller.abort(f)},d=new ReadableStream({start(f){t.controller.controller=f},pull:u,cancel:l,type:"bytes"});i.body={stream:d,source:null,length:null},t.controller.resume||t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let f,g;try{let{done:y,value:E}=await t.controller.next();if(Ver(t))break;f=y?void 0:E}catch(y){t.controller.ended&&!s.encodedBodySize?f=void 0:(f=y,g=!0)}if(f===void 0){uus(t.controller.controller),Gus(t,i);return}if(s.decodedBodySize+=f?.byteLength??0,g){t.controller.terminate(f);return}let A=new Uint8Array(f);if(A.byteLength&&t.controller.controller.enqueue(A),Tus(d)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(f){Ver(t)?(i.aborted=!0,aDe(d)&&t.controller.controller.error(t.controller.serializedAbortReason)):aDe(d)&&t.controller.controller.error(new TypeError("terminated",{cause:cus(f)?f:void 0})),t.controller.connection.destroy()}return i;function h({body:f}){let g=$E(r),A=t.controller.dispatcher,y=g.pathname+g.search,E=g.search.length===0&&g.href[g.href.length-g.hash.length-1]==="?";return _(f);function _(S,C){return new Promise((I,w)=>A.dispatch({path:E?`${y}?`:y,origin:g.origin,method:r.method,body:A.isMockActive?r.body&&(r.body.source||r.body.stream):S,__mockAgentBodyForDispatch:S,headers:r.headersList.entries,maxRedirections:0,upgrade:r.mode==="websocket"?"websocket":void 0,...C===!1?{allowH2:C}:null},{body:null,abort:null,onRequestStart(k){let{connection:N}=t.controller;s.finalConnectionTimingInfo=mus(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability);let O=W=>k.abort(W);N.destroyed?O(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",O),this.abort=N.abort=O),s.finalNetworkRequestStartTime=Cae(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Cae(t.crossOriginIsolatedCapability)},onResponseStart(k,N,O,W){if(N<200)return;let $=k?.rawHeaders??[],G=new qer;Ker(G,O,$);let q=G.get("location",!0);this.body=new Cus({read:()=>k.resume()});let ce=q&&r.redirect==="follow"&&Xer.has(N),Y=[];if(r.method!=="HEAD"&&r.method!=="CONNECT"&&!Zer.includes(N)&&!ce){let j=G.get("content-encoding",!0),se=j?j.toLowerCase().split(","):[],Ae=5;if(se.length>Ae){w(new Error(`too many content-encodings in response: ${se.length}, maximum allowed is ${Ae}`));return}for(let De=se.length-1;De>=0;--De){let Pe=se[De].trim();if(Pe==="x-gzip"||Pe==="gzip")Y.push(BS.createGunzip({flush:BS.constants.Z_SYNC_FLUSH,finishFlush:BS.constants.Z_SYNC_FLUSH}));else if(Pe==="deflate")Y.push(gus({flush:BS.constants.Z_SYNC_FLUSH,finishFlush:BS.constants.Z_SYNC_FLUSH}));else if(Pe==="br")Y.push(BS.createBrotliDecompress({flush:BS.constants.BROTLI_OPERATION_FLUSH,finishFlush:BS.constants.BROTLI_OPERATION_FLUSH}));else if(Pe==="zstd")Y.push(BS.createZstdDecompress({flush:BS.constants.ZSTD_e_continue,finishFlush:BS.constants.ZSTD_e_end}));else{Y.length=0;break}}}let z=j=>this.onResponseError(k,j);I({status:N,statusText:W,headersList:G,body:Y.length?Ius(this.body,...Y,j=>{j&&this.onResponseError(k,j)}).on("error",z):this.body.on("error",z)})},onResponseData(k,N){if(t.controller.dump)return;let O=N;s.encodedBodySize+=O.byteLength,this.body.push(O)===!1&&k.pause()},onResponseEnd(){this.abort&&t.controller.off("terminated",this.abort),t.controller.ended=!0,this.body?.push(null)},onResponseError(k,N){if(this.abort&&t.controller.off("terminated",this.abort),r.mode==="websocket"&&C!==!1&&N?.code==="UND_ERR_INFO"&&N?.message==="HTTP/2: Extended CONNECT protocol not supported by server"){I(_(S,!1));return}this.body?.destroy(N),t.controller.terminate(N),w(N)},onRequestUpgrade(k,N,O,W){if(W.session!=null&&N!==200||W.session==null&&N!==101)return W.session!=null&&k.abort(new kus("bad upgrade",null)),!1;let $=k?.rawHeaders??[],G=new qer;return Ker(G,O,$),I({status:N,statusText:Mus[N],headersList:G,socket:W}),!0}}))}}}str.exports={fetch:Uus,Fetch:lDe,fetching:ntr,finalizeAndReportTiming:etr}});var ctr=re((qOc,atr)=>{"use strict";p();var Hus=require("node:assert"),{URLSerializer:otr}=Wb(),{isValidHeaderName:qus}=OE();function jus(t,e,n=!1){let r=otr(t,n),i=otr(e,n);return r===i}function Vus(t){Hus(t!==null);let e=[];for(let n of t.split(","))n=n.trim(),qus(n)&&e.push(n);return e}atr.exports={urlEquals:jus,getFieldValues:Vus}});var ptr=re((VOc,dtr)=>{"use strict";p();var TEt=require("node:assert"),{kConstruct:Yus}=Oo(),{urlEquals:zus,getFieldValues:vEt}=ctr(),{kEnumerableProperty:UU,isDisturbed:Kus}=Zi(),{webidl:Fr}=lh(),{cloneResponse:ltr,fromInnerResponse:Jus,getResponseState:Xus}=xae(),{Request:wae,fromInnerRequest:Zus,getRequestState:jw}=ZY(),{fetching:eds}=Iae(),{urlIsHttpHttpsScheme:pDe,readAllBytes:tds}=OE(),mDe=class t{#e;constructor(){arguments[0]!==Yus&&Fr.illegalConstructor(),Fr.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,n={}){Fr.brandCheck(this,t);let r="Cache.match";Fr.argumentLengthCheck(arguments,1,r),e=Fr.converters.RequestInfo(e),n=Fr.converters.CacheQueryOptions(n,r,"options");let i=this.#i(e,n,1);if(i.length!==0)return i[0]}async matchAll(e=void 0,n={}){Fr.brandCheck(this,t);let r="Cache.matchAll";return e!==void 0&&(e=Fr.converters.RequestInfo(e)),n=Fr.converters.CacheQueryOptions(n,r,"options"),this.#i(e,n)}async add(e){Fr.brandCheck(this,t),Fr.argumentLengthCheck(arguments,1,"Cache.add"),e=Fr.converters.RequestInfo(e);let r=[e];return await this.addAll(r)}async addAll(e){Fr.brandCheck(this,t);let n="Cache.addAll";Fr.argumentLengthCheck(arguments,1,n);let r=[],i=[];for(let m of e){if(m===void 0)throw Fr.errors.conversionFailed({prefix:n,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Fr.converters.RequestInfo(m),typeof m=="string")continue;let h=jw(m);if(!pDe(h.url)||h.method!=="GET")throw Fr.errors.exception({header:n,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let h=jw(new wae(m));if(!pDe(h.url))throw Fr.errors.exception({header:n,message:"Expected http/s scheme."});h.initiator="fetch",h.destination="subresource",i.push(h);let f=Promise.withResolvers();s.push(eds({request:h,processResponse(g){if(g.type==="error"||g.status===206||g.status<200||g.status>299)f.reject(Fr.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(g.headersList.contains("vary")){let A=vEt(g.headersList.get("vary"));for(let y of A)if(y==="*"){f.reject(Fr.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let E of s)E.abort();return}}},processResponseEndOfBody(g){if(g.aborted){f.reject(new DOMException("aborted","AbortError"));return}f.resolve(g)}})),r.push(f.promise)}let a=await Promise.all(r),c=[],u=0;for(let m of a){let h={type:"put",request:i[u],response:m};c.push(h),u++}let l=Promise.withResolvers(),d=null;try{this.#t(c)}catch(m){d=m}return queueMicrotask(()=>{d===null?l.resolve(void 0):l.reject(d)}),l.promise}async put(e,n){Fr.brandCheck(this,t);let r="Cache.put";Fr.argumentLengthCheck(arguments,2,r),e=Fr.converters.RequestInfo(e),n=Fr.converters.Response(n,r,"response");let i=null;if(Fr.is.Request(e)?i=jw(e):i=jw(new wae(e)),!pDe(i.url)||i.method!=="GET")throw Fr.errors.exception({header:r,message:"Expected an http/s scheme when method is not GET"});let s=Xus(n);if(s.status===206)throw Fr.errors.exception({header:r,message:"Got 206 status"});if(s.headersList.contains("vary")){let h=vEt(s.headersList.get("vary"));for(let f of h)if(f==="*")throw Fr.errors.exception({header:r,message:"Got * vary field value"})}if(s.body&&(Kus(s.body.stream)||s.body.stream.locked))throw Fr.errors.exception({header:r,message:"Response body is locked or disturbed"});let o=ltr(s),a=Promise.withResolvers();if(s.body!=null){let f=s.body.stream.getReader();tds(f,a.resolve,a.reject)}else a.resolve(void 0);let c=[],u={type:"put",request:i,response:o};c.push(u);let l=await a.promise;o.body!=null&&(o.body.source=l);let d=Promise.withResolvers(),m=null;try{this.#t(c)}catch(h){m=h}return queueMicrotask(()=>{m===null?d.resolve():d.reject(m)}),d.promise}async delete(e,n={}){Fr.brandCheck(this,t);let r="Cache.delete";Fr.argumentLengthCheck(arguments,1,r),e=Fr.converters.RequestInfo(e),n=Fr.converters.CacheQueryOptions(n,r,"options");let i=null;if(Fr.is.Request(e)){if(i=jw(e),i.method!=="GET"&&!n.ignoreMethod)return!1}else TEt(typeof e=="string"),i=jw(new wae(e));let s=[],o={type:"delete",request:i,options:n};s.push(o);let a=Promise.withResolvers(),c=null,u;try{u=this.#t(s)}catch(l){c=l}return queueMicrotask(()=>{c===null?a.resolve(!!u?.length):a.reject(c)}),a.promise}async keys(e=void 0,n={}){Fr.brandCheck(this,t);let r="Cache.keys";e!==void 0&&(e=Fr.converters.RequestInfo(e)),n=Fr.converters.CacheQueryOptions(n,r,"options");let i=null;if(e!==void 0)if(Fr.is.Request(e)){if(i=jw(e),i.method!=="GET"&&!n.ignoreMethod)return[]}else typeof e=="string"&&(i=jw(new wae(e)));let s=Promise.withResolvers(),o=[];if(e===void 0)for(let a of this.#e)o.push(a[0]);else{let a=this.#n(i,n);for(let c of a)o.push(c[0])}return queueMicrotask(()=>{let a=[];for(let c of o){let u=Zus(c,void 0,new AbortController().signal,"immutable");a.push(u)}s.resolve(Object.freeze(a))}),s.promise}#t(e){let n=this.#e,r=[...n],i=[],s=[];try{for(let o of e){if(o.type!=="delete"&&o.type!=="put")throw Fr.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(o.type==="delete"&&o.response!=null)throw Fr.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#n(o.request,o.options,i).length)throw new DOMException("???","InvalidStateError");let a;if(o.type==="delete"){if(a=this.#n(o.request,o.options),a.length===0)return[];for(let c of a){let u=n.indexOf(c);TEt(u!==-1),n.splice(u,1)}}else if(o.type==="put"){if(o.response==null)throw Fr.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let c=o.request;if(!pDe(c.url))throw Fr.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(c.method!=="GET")throw Fr.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(o.options!=null)throw Fr.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});a=this.#n(o.request);for(let u of a){let l=n.indexOf(u);TEt(l!==-1),n.splice(l,1)}n.push([o.request,o.response]),i.push([o.request,o.response])}s.push([o.request,o.response])}return s}catch(o){throw this.#e.length=0,this.#e=r,o}}#n(e,n,r){let i=[],s=r??this.#e;for(let o of s){let[a,c]=o;this.#r(e,a,c,n)&&i.push(o)}return i}#r(e,n,r=null,i){let s=new URL(e.url),o=new URL(n.url);if(i?.ignoreSearch&&(o.search="",s.search=""),!zus(s,o,!0))return!1;if(r==null||i?.ignoreVary||!r.headersList.contains("vary"))return!0;let a=vEt(r.headersList.get("vary"));for(let c of a){if(c==="*")return!1;let u=n.headersList.get(c),l=e.headersList.get(c);if(u!==l)return!1}return!0}#i(e,n,r=1/0){let i=null;if(e!==void 0)if(Fr.is.Request(e)){if(i=jw(e),i.method!=="GET"&&!n.ignoreMethod)return[]}else typeof e=="string"&&(i=jw(new wae(e)));let s=[];if(e===void 0)for(let a of this.#e)s.push(a[1]);else{let a=this.#n(i,n);for(let c of a)s.push(c[1])}let o=[];for(let a of s){let c=Jus(ltr(a),"immutable");if(o.push(c),o.length>=r)break}return Object.freeze(o)}};Object.defineProperties(mDe.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:UU,matchAll:UU,add:UU,addAll:UU,put:UU,delete:UU,keys:UU});var utr=[{key:"ignoreSearch",converter:Fr.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:Fr.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:Fr.converters.boolean,defaultValue:()=>!1}];Fr.converters.CacheQueryOptions=Fr.dictionaryConverter(utr);Fr.converters.MultiCacheQueryOptions=Fr.dictionaryConverter([...utr,{key:"cacheName",converter:Fr.converters.DOMString}]);Fr.converters.Response=Fr.interfaceConverter(Fr.is.Response,"Response");Fr.converters["sequence"]=Fr.sequenceConverter(Fr.converters.RequestInfo);dtr.exports={Cache:mDe}});var htr=re((zOc,mtr)=>{"use strict";p();var{Cache:hDe}=ptr(),{webidl:af}=lh(),{kEnumerableProperty:Tae}=Zi(),{kConstruct:vae}=Oo(),fDe=class t{#e=new Map;constructor(){arguments[0]!==vae&&af.illegalConstructor(),af.util.markAsUncloneable(this)}async match(e,n={}){if(af.brandCheck(this,t),af.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=af.converters.RequestInfo(e),n=af.converters.MultiCacheQueryOptions(n),n.cacheName!=null){if(this.#e.has(n.cacheName)){let r=this.#e.get(n.cacheName);return await new hDe(vae,r).match(e,n)}}else for(let r of this.#e.values()){let s=await new hDe(vae,r).match(e,n);if(s!==void 0)return s}}async has(e){af.brandCheck(this,t);let n="CacheStorage.has";return af.argumentLengthCheck(arguments,1,n),e=af.converters.DOMString(e,n,"cacheName"),this.#e.has(e)}async open(e){af.brandCheck(this,t);let n="CacheStorage.open";if(af.argumentLengthCheck(arguments,1,n),e=af.converters.DOMString(e,n,"cacheName"),this.#e.has(e)){let i=this.#e.get(e);return new hDe(vae,i)}let r=[];return this.#e.set(e,r),new hDe(vae,r)}async delete(e){af.brandCheck(this,t);let n="CacheStorage.delete";return af.argumentLengthCheck(arguments,1,n),e=af.converters.DOMString(e,n,"cacheName"),this.#e.delete(e)}async keys(){return af.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(fDe.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Tae,has:Tae,open:Tae,delete:Tae,keys:Tae});mtr.exports={CacheStorage:fDe}});var gtr=re((JOc,ftr)=>{"use strict";p();ftr.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var BEt=re((ZOc,btr)=>{"use strict";p();function nds(t){for(let e=0;e=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function REt(t){for(let e=0;e126||n===34||n===40||n===41||n===60||n===62||n===64||n===44||n===59||n===58||n===92||n===47||n===91||n===93||n===63||n===61||n===123||n===125)throw new Error("Invalid cookie name")}}function kEt(t){let e=t.length,n=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++n}for(;n126||r===34||r===44||r===59||r===92)throw new Error("Invalid cookie value")}}function ytr(t){for(let e=0;e126||n===59)throw new Error("Invalid cookie path")}}function Atr(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}function rds(t){if(t===" ")return;if(t.length>255)throw new Error("Invalid cookie domain");let e=0;for(let n=0;n63)throw new Error("Invalid cookie domain")}if(e===0||t.charCodeAt(t.length-1)===45)throw new Error("Invalid cookie domain")}var ids=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],sds=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gDe=Array(61).fill(0).map((t,e)=>e.toString().padStart(2,"0"));function Etr(t){return typeof t=="number"&&(t=new Date(t)),`${ids[t.getUTCDay()]}, ${gDe[t.getUTCDate()]} ${sds[t.getUTCMonth()]} ${t.getUTCFullYear()} ${gDe[t.getUTCHours()]}:${gDe[t.getUTCMinutes()]}:${gDe[t.getUTCSeconds()]} GMT`}function ods(t){if(t<0)throw new Error("Invalid cookie max-age")}function ads(t){if(t.name.length===0)return null;REt(t.name),kEt(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(ods(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(rds(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(ytr(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${Etr(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let n of t.unparsed){if(!n.includes("="))throw new Error("Invalid unparsed");let[r,...i]=n.split("="),s=r.trim(),o=i.join("=");REt(s),kEt(o),e.push(`${s}=${o}`)}return e.join("; ")}btr.exports={isCTLExcludingHtab:nds,validateCookieName:REt,validateCookiePath:ytr,validateCookieValue:kEt,toIMFDate:Etr,stringify:ads}});var Str=re((tLc,xtr)=>{"use strict";p();var{collectASequenceOfCodePointsFast:ADe}=Dw(),{maxNameValuePairSize:cds,maxAttributeValueSize:lds}=gtr(),{isCTLExcludingHtab:uds}=BEt(),dds=require("node:assert");function pds(t){if(uds(t))return null;let e="",n="",r="",i="";if(t.includes(";")){let s={position:0};e=ADe(";",t,s),n=t.slice(s.position)}else e=t;if(!e.includes("="))i=e;else{let s={position:0};r=ADe("=",e,s),i=e.slice(s.position+1)}return r=r.trim(),i=i.trim(),r.length+i.length>cds?null:{name:r,value:i,..._tr(n)}}function _tr(t,e={}){for(;;){if(t.length===0)return e;dds(t[0]===";"),t=t.slice(1);let n="";t.includes(";")?(n=ADe(";",t,{position:0}),t=t.slice(n.length)):(n=t,t="");let r="",i="";if(n.includes("=")){let o={position:0};r=ADe("=",n,o),i=n.slice(o.position+1)}else r=n;if(r=r.trim(),i=i.trim(),i.length>lds)continue;let s=r.toLowerCase();if(s==="expires"){let o=new Date(i);Number.isNaN(o.getTime())||(e.expires=o)}else if(s==="max-age"){let o=i.charCodeAt(0),a=o>=48&&o<=57,c=i[0]==="-"&&i.length>1;if(!a&&!c||/[^\d]/.test(i.slice(1)))continue;let u=Number(i);e.maxAge=u}else if(s==="domain"){let o=i;o[0]==="."&&(o=o.slice(1)),o=o.toLowerCase(),e.domain=o}else if(s==="path"){let o="";i.length===0||i[0]!=="/"?o="/":o=i,e.path=o}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let o=i.toLowerCase();o==="none"?e.sameSite="None":o==="strict"?e.sameSite="Strict":o==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${r}=${i}`)}}xtr.exports={parseSetCookie:pds,parseUnparsedAttributes:_tr}});var Ttr=re((rLc,wtr)=>{"use strict";p();var{parseSetCookie:Ctr}=Str(),{stringify:mds}=BEt(),{webidl:zo}=lh(),{Headers:hds}=OU(),yDe=zo.brandCheckMultiple([hds,globalThis.Headers].filter(Boolean));function fds(t){zo.argumentLengthCheck(arguments,1,"getCookies"),yDe(t);let e=t.get("cookie"),n={};if(!e)return n;for(let r of e.split(";")){let[i,...s]=r.split("=");n[i.trim()]=s.join("=")}return n}function gds(t,e,n){yDe(t);let r="deleteCookie";zo.argumentLengthCheck(arguments,2,r),e=zo.converters.DOMString(e,r,"name"),n=zo.converters.DeleteCookieAttributes(n),Itr(t,{name:e,value:"",expires:new Date(0),...n})}function Ads(t){zo.argumentLengthCheck(arguments,1,"getSetCookies"),yDe(t);let e=t.getSetCookie();return e?e.map(n=>Ctr(n)):[]}function yds(t){return t=zo.converters.DOMString(t),Ctr(t)}function Itr(t,e){zo.argumentLengthCheck(arguments,2,"setCookie"),yDe(t),e=zo.converters.Cookie(e);let n=mds(e);n&&t.append("set-cookie",n,!0)}zo.converters.DeleteCookieAttributes=zo.dictionaryConverter([{converter:zo.nullableConverter(zo.converters.DOMString),key:"path",defaultValue:()=>null},{converter:zo.nullableConverter(zo.converters.DOMString),key:"domain",defaultValue:()=>null}]);zo.converters.Cookie=zo.dictionaryConverter([{converter:zo.converters.DOMString,key:"name"},{converter:zo.converters.DOMString,key:"value"},{converter:zo.nullableConverter(t=>typeof t=="number"?zo.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:()=>null},{converter:zo.nullableConverter(zo.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:zo.nullableConverter(zo.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:zo.nullableConverter(zo.converters.DOMString),key:"path",defaultValue:()=>null},{converter:zo.nullableConverter(zo.converters.boolean),key:"secure",defaultValue:()=>null},{converter:zo.nullableConverter(zo.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:zo.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:zo.sequenceConverter(zo.converters.DOMString),key:"unparsed",defaultValue:()=>[]}]);wtr.exports={getCookies:fds,deleteCookie:gds,getSetCookies:Ads,setCookie:Itr,parseCookie:yds}});var _De=re((sLc,Rtr)=>{"use strict";p();var{webidl:Yr}=lh(),{kEnumerableProperty:UA}=Zi(),{kConstruct:vtr}=Oo(),e9=class t extends Event{#e;constructor(e,n={}){if(e===vtr){super(arguments[1],arguments[2]),Yr.util.markAsUncloneable(this);return}let r="MessageEvent constructor";Yr.argumentLengthCheck(arguments,1,r),e=Yr.converters.DOMString(e,r,"type"),n=Yr.converters.MessageEventInit(n,r,"eventInitDict"),super(e,n),this.#e=n,Yr.util.markAsUncloneable(this)}get data(){return Yr.brandCheck(this,t),this.#e.data}get origin(){return Yr.brandCheck(this,t),this.#e.origin}get lastEventId(){return Yr.brandCheck(this,t),this.#e.lastEventId}get source(){return Yr.brandCheck(this,t),this.#e.source}get ports(){return Yr.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,n=!1,r=!1,i=null,s="",o="",a=null,c=[]){return Yr.brandCheck(this,t),Yr.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:n,cancelable:r,data:i,origin:s,lastEventId:o,source:a,ports:c})}static createFastMessageEvent(e,n){let r=new t(vtr,e,n);return r.#e=n,r.#e.data??=null,r.#e.origin??="",r.#e.lastEventId??="",r.#e.source??=null,r.#e.ports??=[],r}},{createFastMessageEvent:Eds}=e9;delete e9.createFastMessageEvent;var EDe=class t extends Event{#e;constructor(e,n={}){let r="CloseEvent constructor";Yr.argumentLengthCheck(arguments,1,r),e=Yr.converters.DOMString(e,r,"type"),n=Yr.converters.CloseEventInit(n),super(e,n),this.#e=n,Yr.util.markAsUncloneable(this)}get wasClean(){return Yr.brandCheck(this,t),this.#e.wasClean}get code(){return Yr.brandCheck(this,t),this.#e.code}get reason(){return Yr.brandCheck(this,t),this.#e.reason}},bDe=class t extends Event{#e;constructor(e,n){let r="ErrorEvent constructor";Yr.argumentLengthCheck(arguments,1,r),super(e,n),Yr.util.markAsUncloneable(this),e=Yr.converters.DOMString(e,r,"type"),n=Yr.converters.ErrorEventInit(n??{}),this.#e=n}get message(){return Yr.brandCheck(this,t),this.#e.message}get filename(){return Yr.brandCheck(this,t),this.#e.filename}get lineno(){return Yr.brandCheck(this,t),this.#e.lineno}get colno(){return Yr.brandCheck(this,t),this.#e.colno}get error(){return Yr.brandCheck(this,t),this.#e.error}};Object.defineProperties(e9.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:UA,origin:UA,lastEventId:UA,source:UA,ports:UA,initMessageEvent:UA});Object.defineProperties(EDe.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:UA,code:UA,wasClean:UA});Object.defineProperties(bDe.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:UA,filename:UA,lineno:UA,colno:UA,error:UA});Yr.converters.MessagePort=Yr.interfaceConverter(Yr.is.MessagePort,"MessagePort");Yr.converters["sequence"]=Yr.sequenceConverter(Yr.converters.MessagePort);var NEt=[{key:"bubbles",converter:Yr.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:Yr.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:Yr.converters.boolean,defaultValue:()=>!1}];Yr.converters.MessageEventInit=Yr.dictionaryConverter([...NEt,{key:"data",converter:Yr.converters.any,defaultValue:()=>null},{key:"origin",converter:Yr.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:Yr.converters.DOMString,defaultValue:()=>""},{key:"source",converter:Yr.nullableConverter(Yr.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:Yr.converters["sequence"],defaultValue:()=>[]}]);Yr.converters.CloseEventInit=Yr.dictionaryConverter([...NEt,{key:"wasClean",converter:Yr.converters.boolean,defaultValue:()=>!1},{key:"code",converter:Yr.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:Yr.converters.USVString,defaultValue:()=>""}]);Yr.converters.ErrorEventInit=Yr.dictionaryConverter([...NEt,{key:"message",converter:Yr.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:Yr.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:Yr.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:Yr.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:Yr.converters.any}]);Rtr.exports={MessageEvent:e9,CloseEvent:EDe,ErrorEvent:bDe,createFastMessageEvent:Eds}});var qP=re((aLc,ktr)=>{"use strict";p();var bds="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",_ds={enumerable:!0,writable:!1,configurable:!1},xds={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},Sds={SENT:1,RECEIVED:2},Cds={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},Ids=65535,wds={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},Tds=Buffer.allocUnsafe(0),vds={text:1,typedArray:2,arrayBuffer:3,blob:4};ktr.exports={uid:bds,sentCloseFrameState:Sds,staticPropertyDescriptors:_ds,states:xds,opcodes:Cds,maxUnsigned16Bit:Ids,parserStates:wds,emptyBuffer:Tds,sendHints:vds}});var GU=re((lLc,Mtr)=>{"use strict";p();var{states:xDe,opcodes:t9}=qP(),{isUtf8:Rds}=require("node:buffer"),{removeHTTPWhitespace:Btr}=Wb(),{collectASequenceOfCodePointsFast:kds}=Dw();function Bds(t){return t===xDe.CONNECTING}function Nds(t){return t===xDe.OPEN}function Dds(t){return t===xDe.CLOSING}function Pds(t){return t===xDe.CLOSED}function Mds(t,e,n=(i,s)=>new Event(i,s),r={}){let i=n(t,r);e.dispatchEvent(i)}function Ods(t,e,n){t.onMessage(e,n)}function Lds(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}function Fds(t){if(t.length===0)return!1;for(let e=0;e126||n===34||n===40||n===41||n===44||n===47||n===58||n===59||n===60||n===61||n===62||n===63||n===64||n===91||n===92||n===93||n===123||n===125)return!1}return!0}function Qds(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}function Ntr(t){return t===t9.CLOSE||t===t9.PING||t===t9.PONG}function Dtr(t){return t===t9.CONTINUATION}function Ptr(t){return t===t9.TEXT||t===t9.BINARY}function Uds(t){return Ptr(t)||Dtr(t)||Ntr(t)}function Gds(t){let e={position:0},n=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}function Wds(t,e){let n;try{n=new URL(t,e)}catch(r){throw new DOMException(r,"SyntaxError")}if(n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),n.protocol!=="ws:"&&n.protocol!=="wss:")throw new DOMException("expected a ws: or wss: url","SyntaxError");if(n.hash.length||n.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return n}function Hds(t,e){if(t!==null&&t!==1e3&&(t<3e3||t>4999))throw new DOMException("invalid code","InvalidAccessError");if(e!==null){let n=Buffer.byteLength(e);if(n>123)throw new DOMException(`Reason must be less than 123 bytes; received ${n}`,"SyntaxError")}}var qds=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(Rds(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();Mtr.exports={isConnecting:Bds,isEstablished:Nds,isClosing:Dds,isClosed:Pds,fireEvent:Mds,isValidSubprotocol:Fds,isValidStatusCode:Qds,websocketMessageReceived:Ods,utf8Decode:qds,isControlFrame:Ntr,isContinuationFrame:Dtr,isTextBinaryFrame:Ptr,isValidOpcode:Uds,parseExtensions:Gds,isValidClientWindowBits:$ds,toArrayBuffer:Lds,getURLRecord:Wds,validateCloseCodeAndReason:Hds}});var r9=re((dLc,Ltr)=>{"use strict";p();var{runtimeFeatures:jds}=yY(),{maxUnsigned16Bit:Otr,opcodes:Vds}=qP(),SDe=8*1024,Rae=null,n9=SDe,Yds=jds.has("crypto")?require("node:crypto").randomFillSync:null;function DEt(){return n9===SDe&&(n9=0,Yds(Rae??=Buffer.allocUnsafeSlow(SDe),0,SDe)),[Rae[n9++],Rae[n9++],Rae[n9++],Rae[n9++]]}var PEt=class{constructor(e){this.frameData=e}createFrame(e){let n=this.frameData,r=DEt(),i=n?.byteLength??0,s=i,o=6;i>Otr?(o+=8,s=127):i>125&&(o+=2,s=126);let a=Buffer.allocUnsafe(i+o);a[0]=a[1]=0,a[0]|=128,a[0]=(a[0]&240)+e;a[o-4]=r[0],a[o-3]=r[1],a[o-2]=r[2],a[o-1]=r[3],a[1]=s,s===126?a.writeUInt16BE(i,2):s===127&&(a[2]=a[3]=0,a.writeUIntBE(i,4,6)),a[1]|=128;for(let c=0;cOtr?(s+=8,i=127):r>125&&(s+=2,i=126);let o=Buffer.allocUnsafeSlow(s);return o[0]=128|Vds.TEXT,o[1]=i|128,o[s-4]=n[0],o[s-3]=n[1],o[s-2]=n[2],o[s-1]=n[3],i===126?o.writeUInt16BE(r,2):i===127&&(o[2]=o[3]=0,o.writeUIntBE(r,4,6)),[o,e]}};Ltr.exports={WebsocketFrameSend:PEt,generateMask:DEt}});var CDe=re((mLc,Wtr)=>{"use strict";p();var{uid:zds,states:MEt,sentCloseFrameState:OEt,emptyBuffer:Ftr,opcodes:Kds}=qP(),{parseExtensions:Jds,isClosed:Xds,isClosing:Zds,isEstablished:Gtr,isConnecting:eps,validateCloseCodeAndReason:tps}=GU(),{makeRequest:nps}=ZY(),{fetching:rps}=Iae(),{Headers:ips,getHeadersList:sps}=OU(),{getDecodeSplit:ops}=OE(),{WebsocketFrameSend:aps}=r9(),cps=require("node:assert"),{runtimeFeatures:lps}=yY(),Qtr=lps.has("crypto")?require("node:crypto"):null,Utr=!1;function ups(t,e,n,r,i){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let o=nps({urlList:[s],client:n,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error",useURLCredentials:!0});if(i.headers){let l=sps(new ips(i.headers));o.headersList=l}let a=Qtr.randomBytes(16).toString("base64");o.headersList.append("sec-websocket-key",a,!0),o.headersList.append("sec-websocket-version","13",!0);for(let l of e)o.headersList.append("sec-websocket-protocol",l,!0);return o.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),rps({request:o,useParallelQueue:!0,dispatcher:i.dispatcher,processResponse(l){if(l.type==="error"||l.status!==101){if(l.socket?.session==null){Vw(r,1002,"Received network error or non-101 status code.",l.error);return}if(l.status!==200){Vw(r,1002,"Received network error or non-200 status code.",l.error);return}}if(Utr===!1&&l.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),Utr=!0),e.length!==0&&!l.headersList.get("Sec-WebSocket-Protocol")){Vw(r,1002,"Server did not respond with sent protocols.");return}if(l.socket.session==null&&l.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Vw(r,1002,'Server did not set Upgrade header to "websocket".');return}if(l.socket.session==null&&l.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Vw(r,1002,'Server did not set Connection header to "upgrade".');return}let d=l.headersList.get("Sec-WebSocket-Accept"),m=Qtr.hash("sha1",a+zds,"base64");if(d!==m){Vw(r,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let h=l.headersList.get("Sec-WebSocket-Extensions"),f;if(h!==null&&(f=Jds(h),!f.has("permessage-deflate"))){Vw(r,1002,"Sec-WebSocket-Extensions header does not match.");return}let g=l.headersList.get("Sec-WebSocket-Protocol");if(g!==null){let A=ops("sec-websocket-protocol",o.headersList);if(A===null||!A.includes(g)){Vw(r,1002,"Protocol was not set in the opening handshake.");return}}l.socket.on("data",r.onSocketData),l.socket.on("close",r.onSocketClose),l.socket.on("error",r.onSocketError),r.wasEverConnected=!0,r.onConnectionEstablished(l,f)}})}function $tr(t,e,n,r=!1){if(e??=null,n??="",r&&tps(e,n),!(Xds(t.readyState)||Zds(t.readyState)))if(!Gtr(t.readyState))Vw(t),t.readyState=MEt.CLOSING;else if(!t.closeState.has(OEt.SENT)&&!t.closeState.has(OEt.RECEIVED)){let i=new aps;n.length!==0&&e===null&&(e=1e3),cps(e===null||Number.isInteger(e)),e===null&&n.length===0?i.frameData=Ftr:e!==null&&n===null?(i.frameData=Buffer.allocUnsafe(2),i.frameData.writeUInt16BE(e,0)):e!==null&&n!==null?(i.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(n)),i.frameData.writeUInt16BE(e,0),i.frameData.write(n,2,"utf-8")):i.frameData=Ftr,t.socket.write(i.createFrame(Kds.CLOSE)),t.closeState.add(OEt.SENT),t.readyState=MEt.CLOSING}else t.readyState=MEt.CLOSING}function Vw(t,e,n,r){Gtr(t.readyState)&&$tr(t,e,n,!1),t.controller.abort(),eps(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}Wtr.exports={establishWebSocketConnection:ups,failWebsocketConnection:Vw,closeWebSocketConnection:$tr}});var qtr=re((fLc,Htr)=>{"use strict";p();var{createInflateRaw:dps,Z_DEFAULT_WINDOWBITS:pps}=require("node:zlib"),{isValidClientWindowBits:mps}=GU(),{MessageSizeExceededError:hps}=Wi(),fps=Buffer.from([0,0,255,255]),IDe=Symbol("kBuffer"),kae=Symbol("kLength"),LEt=class{#e;#t={};#n=0;constructor(e,n){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits"),this.#n=n.maxPayloadSize}decompress(e,n,r){if(!this.#e){let i=pps;if(this.#t.serverMaxWindowBits){if(!mps(this.#t.serverMaxWindowBits)){r(new Error("Invalid server_max_window_bits"));return}i=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=dps({windowBits:i})}catch(s){r(s);return}this.#e[IDe]=[],this.#e[kae]=0,this.#e.on("data",s=>{if(this.#e[kae]+=s.length,this.#n>0&&this.#e[kae]>this.#n){r(new hps),this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null;return}this.#e[IDe].push(s)}),this.#e.on("error",s=>{this.#e=null,r(s)})}this.#e.write(e),n&&this.#e.write(fps),this.#e.flush(()=>{if(!this.#e)return;let i=Buffer.concat(this.#e[IDe],this.#e[kae]);this.#e[IDe].length=0,this.#e[kae]=0,r(null,i)})}};Htr.exports={PerMessageDeflate:LEt}});var GEt=re((ALc,Ktr)=>{"use strict";p();var{Writable:gps}=require("node:stream"),Aps=require("node:assert"),{parserStates:GA,opcodes:i9,states:yps,emptyBuffer:jtr,sentCloseFrameState:Bae}=qP(),{isValidStatusCode:Eps,isValidOpcode:bps,websocketMessageReceived:Vtr,utf8Decode:_ps,isControlFrame:FEt,isTextBinaryFrame:QEt,isContinuationFrame:xps}=GU(),{failWebsocketConnection:cf}=CDe(),{WebsocketFrameSend:Ytr}=r9(),{PerMessageDeflate:Sps}=qtr(),{MessageSizeExceededError:ztr}=Wi(),UEt=class extends gps{#e=[];#t=0;#n=0;#r=!1;#i=GA.INFO;#s={};#o=[];#a;#c;#l;#d;constructor(e,n,r={}){super(),this.#c=e,this.#a=n??new Map,this.#l=r.maxFragments??0,this.#d=r.maxPayloadSize??0,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new Sps(n,r))}_write(e,n,r){this.#e.push(e),this.#n+=e.length,this.#r=!0,this.run(r)}#p(){return this.#d>0&&!FEt(this.#s.opcode)&&this.#s.payloadLength+this.#t>this.#d?(cf(this.#c,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#r;)if(this.#i===GA.INFO){if(this.#n<2)return e();let n=this.consume(2),r=(n[0]&128)!==0,i=n[0]&15,s=(n[1]&128)===128,o=!r&&i!==i9.CONTINUATION,a=n[1]&127,c=n[0]&64,u=n[0]&32,l=n[0]&16;if(!bps(i))return cf(this.#c,1002,"Invalid opcode received"),e();if(s)return cf(this.#c,1002,"Frame cannot be masked"),e();if(c!==0&&!this.#a.has("permessage-deflate")){cf(this.#c,1002,"Expected RSV1 to be clear.");return}if(u!==0||l!==0){cf(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(o&&!QEt(i)){cf(this.#c,1002,"Invalid frame type was fragmented.");return}if(QEt(i)&&this.#o.length>0){cf(this.#c,1002,"Expected continuation frame");return}if(this.#s.fragmented&&o){cf(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((a>125||o)&&FEt(i)){cf(this.#c,1002,"Control frame either too large or fragmented");return}if(xps(i)&&this.#o.length===0&&!this.#s.compressed){cf(this.#c,1002,"Unexpected continuation frame");return}if(a<=125){if(this.#s.payloadLength=a,this.#i=GA.READ_DATA,!this.#p())return}else a===126?this.#i=GA.PAYLOADLENGTH_16:a===127&&(this.#i=GA.PAYLOADLENGTH_64);QEt(i)&&(this.#s.binaryType=i,this.#s.compressed=c!==0),this.#s.opcode=i,this.#s.masked=s,this.#s.fin=r,this.#s.fragmented=o}else if(this.#i===GA.PAYLOADLENGTH_16){if(this.#n<2)return e();let n=this.consume(2);if(this.#s.payloadLength=n.readUInt16BE(0),this.#i=GA.READ_DATA,!this.#p())return}else if(this.#i===GA.PAYLOADLENGTH_64){if(this.#n<8)return e();let n=this.consume(8),r=n.readUInt32BE(0),i=n.readUInt32BE(4);if(r!==0||i>2**31-1){cf(this.#c,1009,"Received payload length > 2^31 bytes.");return}if(this.#s.payloadLength=i,this.#i=GA.READ_DATA,!this.#p())return}else if(this.#i===GA.READ_DATA){if(this.#n{if(r){let s=r instanceof ztr?1009:1007;cf(this.#c,s,r.message);return}if(this.writeFragments(i)){if(this.#d>0&&this.#t>this.#d){cf(this.#c,1009,new ztr().message);return}if(!this.#s.fin){this.#i=GA.INFO,this.#r=!0,this.run(e);return}Vtr(this.#c,this.#s.binaryType,this.consumeFragments()),this.#r=!0,this.#i=GA.INFO,this.run(e)}},this.#t),this.#r=!1;break}else{if(!this.writeFragments(n))return;!this.#s.fragmented&&this.#s.fin&&Vtr(this.#c,this.#s.binaryType,this.consumeFragments()),this.#i=GA.INFO}}}consume(e){if(e>this.#n)throw new Error("Called consume() before buffers satiated.");if(e===0)return jtr;this.#n-=e;let n=this.#e[0];if(n.length>e)return this.#e[0]=n.subarray(e,n.length),n.subarray(0,e);if(n.length===e)return this.#e.shift();{let r=0,i=Buffer.allocUnsafeSlow(e);for(;r!==e;){let s=this.#e[0],o=s.length;if(o+r===e){i.set(this.#e.shift(),r);break}else if(o+r>e){i.set(s.subarray(0,e-r),r),this.#e[0]=s.subarray(e-r);break}else i.set(this.#e.shift(),r),r+=o}return i}}writeFragments(e){return this.#l>0&&this.#o.length===this.#l?(cf(this.#c,1008,"Too many message fragments"),!1):(this.#t+=e.length,this.#o.push(e),!0)}consumeFragments(){let e=this.#o;if(e.length===1)return this.#t=0,e.shift();let n=0,r=Buffer.allocUnsafeSlow(this.#t);for(let i=0;i=2&&(n=e.readUInt16BE(0)),n!==void 0&&!Eps(n))return{code:1002,reason:"Invalid status code",error:!0};let r=e.subarray(2);r[0]===239&&r[1]===187&&r[2]===191&&(r=r.subarray(3));try{r=_ps(r)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:n,reason:r,error:!1}}parseControlFrame(e){let{opcode:n,payloadLength:r}=this.#s;if(n===i9.CLOSE){if(r===1)return cf(this.#c,1002,"Received close frame with a 1-byte body."),!1;if(this.#s.closeInfo=this.parseCloseBody(e),this.#s.closeInfo.error){let{code:i,reason:s}=this.#s.closeInfo;return cf(this.#c,i,s),!1}if(!this.#c.closeState.has(Bae.SENT)&&!this.#c.closeState.has(Bae.RECEIVED)){let i=jtr;this.#s.closeInfo.code&&(i=Buffer.allocUnsafe(2),i.writeUInt16BE(this.#s.closeInfo.code,0));let s=new Ytr(i);this.#c.socket.write(s.createFrame(i9.CLOSE)),this.#c.closeState.add(Bae.SENT)}return this.#c.readyState=yps.CLOSING,this.#c.closeState.add(Bae.RECEIVED),!1}else if(n===i9.PING){if(!this.#c.closeState.has(Bae.RECEIVED)){let i=new Ytr(e);this.#c.socket.write(i.createFrame(i9.PONG)),this.#c.onPing(e)}}else n===i9.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#s.closeInfo}};Ktr.exports={ByteParser:UEt}});var enr=re((ELc,Ztr)=>{"use strict";p();var{WebsocketFrameSend:Xtr}=r9(),{opcodes:Jtr,sendHints:$U}=qP(),Cps=sAt(),WEt=class{#e=new Cps;#t=!1;#n;constructor(e){this.#n=e}add(e,n,r){if(r!==$U.blob){if(this.#t){let s={promise:null,callback:n,frame:$Et(e,r)};this.#e.push(s)}else if(r===$U.text){let{0:s,1:o}=Xtr.createFastTextFrame(e);this.#n.cork(),this.#n.write(s),this.#n.write(o,n),this.#n.uncork()}else this.#n.write($Et(e,r),n);return}let i={promise:e.arrayBuffer().then(s=>{i.promise=null,i.frame=$Et(s,r)}),callback:n,frame:null};this.#e.push(i),this.#t||this.#r()}async#r(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let n=e.shift();n.promise!==null&&await n.promise,this.#n.write(n.frame,n.callback),n.callback=n.frame=null}this.#t=!1}};function $Et(t,e){return new Xtr(Ips(t,e)).createFrame(e===$U.text?Jtr.TEXT:Jtr.BINARY)}function Ips(t,e){switch(e){case $U.text:case $U.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case $U.arrayBuffer:case $U.blob:return new Uint8Array(t)}}Ztr.exports={SendQueue:WEt}});var onr=re((_Lc,snr)=>{"use strict";p();var{isArrayBuffer:wps}=require("node:util/types"),{webidl:$r}=lh(),{URLSerializer:Tps}=Wb(),{environmentSettingsObject:tnr}=OE(),{staticPropertyDescriptors:jP,states:Ak,sentCloseFrameState:HEt,sendHints:wDe,opcodes:qEt}=qP(),{isConnecting:vps,isEstablished:nnr,isClosing:rnr,isClosed:Rps,isValidSubprotocol:kps,fireEvent:TDe,utf8Decode:Bps,toArrayBuffer:Nps,getURLRecord:Dps}=GU(),{establishWebSocketConnection:Pps,closeWebSocketConnection:Mps,failWebsocketConnection:inr}=CDe(),{ByteParser:Ops}=GEt(),{kEnumerableProperty:Zb}=Zi(),{getGlobalDispatcher:Lps}=gae(),{ErrorEvent:Fps,CloseEvent:Qps,createFastMessageEvent:Ups}=_De(),{SendQueue:Gps}=enr(),{WebsocketFrameSend:$ps}=r9(),{channels:Yw}=gP(),Wps=Symbol.for("nodejs.ref"),Hps=Symbol.for("nodejs.unref");function qps(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}var kg=class t extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n="";#r="";#i=!0;#s;#o={onConnectionEstablished:(e,n)=>this.#d(e,n),onMessage:(e,n)=>this.#p(e,n),onParserError:e=>inr(this.#o,null,e.message),onParserDrain:()=>this.#u(),onSocketData:e=>{this.#l.write(e)||this.#o.socket.pause()},onSocketError:e=>{this.#o.readyState=Ak.CLOSING,Yw.socketError.hasSubscribers&&Yw.socketError.publish(e),this.#o.socket.destroy()},onSocketClose:()=>this.#h(),onPing:e=>{Yw.ping.hasSubscribers&&Yw.ping.publish({payload:e,websocket:this})},onPong:e=>{Yw.pong.hasSubscribers&&Yw.pong.publish({payload:e,websocket:this})},readyState:Ak.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#a;#c;#l;constructor(e,n=[]){super(),$r.util.markAsUncloneable(this);let r="WebSocket constructor";$r.argumentLengthCheck(arguments,1,r);let i=$r.converters["DOMString or sequence or WebSocketInit"](n,r,"options");e=$r.converters.USVString(e),n=i.protocols;let s=tnr.settingsObject.baseUrl,o=Dps(e,s);if(typeof n=="string"&&(n=[n]),n.length!==new Set(n.map(c=>c.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(n.length>0&&!n.every(c=>kps(c)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#a=new URL(o.href);let a=tnr.settingsObject;this.#o.controller=Pps(o,n,a,this.#o,i),this.#o.readyState=t.CONNECTING,this.#c="blob"}[Wps](){$r.brandCheck(this,t),this.#i=!0,this.#o.socket?.ref?.()}[Hps](){$r.brandCheck(this,t),this.#i=!1,this.#o.socket?.unref?.()}close(e=void 0,n=void 0){$r.brandCheck(this,t),e!==void 0&&(e=$r.converters["unsigned short"](e,"WebSocket.close","code",$r.attributes.Clamp)),n!==void 0&&(n=$r.converters.USVString(n)),e??=null,n??="",Mps(this.#o,e,n,!0)}send(e){$r.brandCheck(this,t);let n="WebSocket.send";if($r.argumentLengthCheck(arguments,1,n),e=$r.converters.WebSocketSendData(e,n,"data"),vps(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!nnr(this.#o.readyState)||rnr(this.#o.readyState)))if(typeof e=="string"){let r=Buffer.from(e);this.#t+=r.byteLength,this.#s.add(r,()=>{this.#t-=r.byteLength},wDe.text)}else wps(e)?(this.#t+=e.byteLength,this.#s.add(e,()=>{this.#t-=e.byteLength},wDe.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#s.add(e,()=>{this.#t-=e.byteLength},wDe.typedArray)):$r.is.Blob(e)&&(this.#t+=e.size,this.#s.add(e,()=>{this.#t-=e.size},wDe.blob))}get readyState(){return $r.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return $r.brandCheck(this,t),this.#t}get url(){return $r.brandCheck(this,t),Tps(this.#a)}get extensions(){return $r.brandCheck(this,t),this.#r}get protocol(){return $r.brandCheck(this,t),this.#n}get onopen(){return $r.brandCheck(this,t),this.#e.open}set onopen(e){$r.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let n=$r.converters.EventHandlerNonNull(e);n!==null?(this.addEventListener("open",n),this.#e.open=e):this.#e.open=null}get onerror(){return $r.brandCheck(this,t),this.#e.error}set onerror(e){$r.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let n=$r.converters.EventHandlerNonNull(e);n!==null?(this.addEventListener("error",n),this.#e.error=e):this.#e.error=null}get onclose(){return $r.brandCheck(this,t),this.#e.close}set onclose(e){$r.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let n=$r.converters.EventHandlerNonNull(e);n!==null?(this.addEventListener("close",n),this.#e.close=e):this.#e.close=null}get onmessage(){return $r.brandCheck(this,t),this.#e.message}set onmessage(e){$r.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let n=$r.converters.EventHandlerNonNull(e);n!==null?(this.addEventListener("message",n),this.#e.message=e):this.#e.message=null}get binaryType(){return $r.brandCheck(this,t),this.#c}set binaryType(e){$r.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#c="blob":this.#c=e}#d(e,n){this.#o.socket=e.socket,this.#i||this.#o.socket.unref?.();let r=this.#o.controller.dispatcher?.webSocketOptions?.maxFragments,i=this.#o.controller.dispatcher?.webSocketOptions?.maxPayloadSize,s=new Ops(this.#o,n,{maxFragments:r,maxPayloadSize:i});s.on("drain",()=>this.#o.onParserDrain()),s.on("error",c=>this.#o.onParserError(c)),this.#l=s,this.#s=new Gps(e.socket),this.#o.readyState=Ak.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#r=o);let a=e.headersList.get("sec-websocket-protocol");if(a!==null&&(this.#n=a),TDe("open",this),Yw.open.hasSubscribers){let c=e.headersList.entries;Yw.open.publish({address:qps(e.socket),protocol:this.#n,extensions:this.#r,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:c}})}}#p(e,n){if(this.#o.readyState!==Ak.OPEN)return;let r;if(e===qEt.TEXT)try{r=Bps(n)}catch{inr(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===qEt.BINARY&&(this.#c==="blob"?r=new Blob([n]):r=Nps(n));TDe("message",this,Ups,{origin:this.#a.origin,data:r})}#u(){this.#o.socket.resume()}#h(){let e=this.#o.closeState.has(HEt.SENT)&&this.#o.closeState.has(HEt.RECEIVED),n=1005,r="",i=this.#l?.closingInfo;i&&!i.error&&(n=i.code??1005,r=i.reason),this.#o.readyState=Ak.CLOSED,this.#o.closeState.has(HEt.RECEIVED)||(n=1006,TDe("error",this,(s,o)=>new Fps(s,o),{error:new TypeError(r)})),TDe("close",this,(s,o)=>new Qps(s,o),{wasClean:e,code:n,reason:r}),Yw.close.hasSubscribers&&Yw.close.publish({websocket:this,code:n,reason:r})}static ping(e,n){if(Buffer.isBuffer(n)){if(n.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(n!==void 0)throw new TypeError("Expected buffer payload");let r=e.#o.readyState;if(nnr(r)&&!rnr(r)&&!Rps(r)){let i=new $ps(n);e.#o.socket.write(i.createFrame(qEt.PING))}}},{ping:jps}=kg;Reflect.deleteProperty(kg,"ping");kg.CONNECTING=kg.prototype.CONNECTING=Ak.CONNECTING;kg.OPEN=kg.prototype.OPEN=Ak.OPEN;kg.CLOSING=kg.prototype.CLOSING=Ak.CLOSING;kg.CLOSED=kg.prototype.CLOSED=Ak.CLOSED;Object.defineProperties(kg.prototype,{CONNECTING:jP,OPEN:jP,CLOSING:jP,CLOSED:jP,url:Zb,readyState:Zb,bufferedAmount:Zb,onopen:Zb,onerror:Zb,onclose:Zb,close:Zb,onmessage:Zb,binaryType:Zb,send:Zb,extensions:Zb,protocol:Zb,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(kg,{CONNECTING:jP,OPEN:jP,CLOSING:jP,CLOSED:jP});$r.converters["sequence"]=$r.sequenceConverter($r.converters.DOMString);$r.converters["DOMString or sequence"]=function(t,e,n){return $r.util.Type(t)===$r.util.Types.OBJECT&&Symbol.iterator in t?$r.converters["sequence"](t):$r.converters.DOMString(t,e,n)};$r.converters.WebSocketInit=$r.dictionaryConverter([{key:"protocols",converter:$r.converters["DOMString or sequence"],defaultValue:()=>[]},{key:"dispatcher",converter:$r.converters.any,defaultValue:()=>Lps()},{key:"headers",converter:$r.nullableConverter($r.converters.HeadersInit)}]);$r.converters["DOMString or sequence or WebSocketInit"]=function(t){return $r.util.Type(t)===$r.util.Types.OBJECT&&!(Symbol.iterator in t)?$r.converters.WebSocketInit(t):{protocols:$r.converters["DOMString or sequence"](t)}};$r.converters.WebSocketSendData=function(t){return $r.util.Type(t)===$r.util.Types.OBJECT&&($r.is.Blob(t)||$r.is.BufferSource(t))?t:$r.converters.USVString(t)};snr.exports={WebSocket:kg,ping:jps}});var jEt=re((SLc,lnr)=>{"use strict";p();var{webidl:vDe}=lh(),{validateCloseCodeAndReason:Vps}=GU(),{kConstruct:anr}=Oo(),{kEnumerableProperty:cnr}=Zi();function Yps(){class t extends DOMException{get reason(){return""}}return new t().reason!==void 0?DOMException:new Proxy(DOMException,{construct(e,n,r){let i=Reflect.construct(e,n,e);return Object.setPrototypeOf(i,r.prototype),i}})}var WU=class t extends Yps(){#e;#t;constructor(e="",n=void 0){if(e=vDe.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),n===anr)return;n!==null&&(n=vDe.converters.WebSocketCloseInfo(n));let r=n.closeCode??null,i=n.reason??"";Vps(r,i),i.length!==0&&r===null&&(r=1e3),this.#e=r,this.#t=i}get closeCode(){return this.#e}get reason(){return this.#t}static createUnvalidatedWebSocketError(e,n,r){let i=new t(e,anr);return i.#e=n,i.#t=r,i}},{createUnvalidatedWebSocketError:zps}=WU;delete WU.createUnvalidatedWebSocketError;Object.defineProperties(WU.prototype,{closeCode:cnr,reason:cnr,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});vDe.is.WebSocketError=vDe.util.MakeTypeAssertion(WU);lnr.exports={WebSocketError:WU,createUnvalidatedWebSocketError:zps}});var hnr=re((ILc,mnr)=>{"use strict";p();var{addAbortListener:Kps}=require("node:events"),{environmentSettingsObject:unr,readableStreamClose:Jps}=OE(),{states:s9,opcodes:RDe,sentCloseFrameState:o9}=qP(),{webidl:Uu}=lh(),{getURLRecord:Xps,isValidSubprotocol:Zps,isEstablished:ems,utf8Decode:tms}=GU(),{establishWebSocketConnection:nms,failWebsocketConnection:VEt,closeWebSocketConnection:YEt}=CDe(),{channels:dnr}=gP(),{WebsocketFrameSend:rms}=r9(),{ByteParser:ims}=GEt(),{WebSocketError:sms,createUnvalidatedWebSocketError:oms}=jEt(),{kEnumerableProperty:kDe}=Zi(),{utf8DecodeBytes:ams}=qBe(),pnr=!1,BDe=class{#e;#t;#n;#r;#i;#s;#o=!1;#a={onConnectionEstablished:(e,n)=>this.#d(e,n),onMessage:(e,n)=>this.#p(e,n),onParserError:e=>VEt(this.#a,null,e.message),onParserDrain:()=>this.#a.socket.resume(),onSocketData:e=>{this.#c.write(e)||this.#a.socket.pause()},onSocketError:e=>{this.#a.readyState=s9.CLOSING,dnr.socketError.hasSubscribers&&dnr.socketError.publish(e),this.#a.socket.destroy()},onSocketClose:()=>this.#u(),onPing:()=>{},onPong:()=>{},readyState:s9.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,n=void 0){pnr||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),pnr=!0),Uu.argumentLengthCheck(arguments,1,"WebSocket"),e=Uu.converters.USVString(e),n!==null&&(n=Uu.converters.WebSocketStreamOptions(n));let r=unr.settingsObject.baseUrl,i=Xps(e,r),s=n.protocols;if(s.length!==new Set(s.map(a=>a.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(s.length>0&&!s.every(a=>Zps(a)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=i.toString(),this.#t=Promise.withResolvers(),this.#n=Promise.withResolvers(),n.signal!=null){let a=n.signal;if(a.aborted){this.#t.reject(a.reason),this.#n.reject(a.reason);return}Kps(a,()=>{ems(this.#a.readyState)||(VEt(this.#a),this.#a.readyState=s9.CLOSING,this.#t.reject(a.reason),this.#n.reject(a.reason),this.#o=!0)})}let o=unr.settingsObject;this.#a.controller=nms(i,s,o,this.#a,n)}get url(){return this.#e.toString()}get opened(){return this.#t.promise}get closed(){return this.#n.promise}close(e=void 0){e!==null&&(e=Uu.converters.WebSocketCloseInfo(e));let n=e.closeCode??null,r=e.reason;YEt(this.#a,n,r,!0)}#l(e){e=Uu.converters.WebSocketStreamWrite(e);let n=Promise.withResolvers(),r=null,i=null;if(Uu.is.BufferSource(e))r=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),i=RDe.BINARY;else{let s;try{s=Uu.converters.DOMString(e)}catch(o){return n.reject(o),n.promise}r=new TextEncoder().encode(s),i=RDe.TEXT}if(!this.#a.closeState.has(o9.SENT)&&!this.#a.closeState.has(o9.RECEIVED)){let s=new rms(r);this.#a.socket.write(s.createFrame(i),()=>{n.resolve(void 0)})}return n.promise}#d(e,n){this.#a.socket=e.socket;let r=this.#a.controller.dispatcher?.webSocketOptions?.maxFragments,i=this.#a.controller.dispatcher?.webSocketOptions?.maxPayloadSize,s=new ims(this.#a,n,{maxFragments:r,maxPayloadSize:i});s.on("drain",()=>this.#a.onParserDrain()),s.on("error",l=>this.#a.onParserError(l)),this.#c=s,this.#a.readyState=s9.OPEN;let o=n??"",a=e.headersList.get("sec-websocket-protocol")??"",c=new ReadableStream({start:l=>{this.#i=l},cancel:l=>this.#f(l)}),u=new WritableStream({start:l=>{this.#s=l},write:l=>this.#l(l),close:()=>YEt(this.#a,null,null),abort:l=>this.#h(l)});this.#r=c,this.#t.resolve({extensions:o,protocol:a,readable:c,writable:u})}#p(e,n){if(this.#a.readyState!==s9.OPEN)return;let r;if(e===RDe.TEXT)try{r=tms(n)}catch{VEt(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===RDe.BINARY&&(r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength));this.#i.enqueue(r)}#u(){let e=this.#a.closeState.has(o9.SENT)&&this.#a.closeState.has(o9.RECEIVED);if(this.#a.readyState=s9.CLOSED,this.#o)return;this.#a.wasEverConnected||this.#t.reject(new sms("Socket never opened"));let n=this.#c?.closingInfo,r=n?.code??1005;!this.#a.closeState.has(o9.SENT)&&!this.#a.closeState.has(o9.RECEIVED)&&(r=1006);let i=n?.reason==null?"":ams(Buffer.from(n.reason));if(e)Jps(this.#i),this.#s.error(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#n.resolve({closeCode:r,reason:i});else{let s=oms("unclean close",r,i);this.#i?.error(s),this.#s?.error(s),this.#n.reject(s)}}#h(e){let n=null,r="";Uu.is.WebSocketError(e)&&(n=e.closeCode,r=e.reason),YEt(this.#a,n,r)}#f(e){this.#h(e)}};Object.defineProperties(BDe.prototype,{url:kDe,opened:kDe,closed:kDe,close:kDe,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});Uu.converters.WebSocketStreamOptions=Uu.dictionaryConverter([{key:"protocols",converter:Uu.sequenceConverter(Uu.converters.USVString),defaultValue:()=>[]},{key:"signal",converter:Uu.nullableConverter(Uu.converters.AbortSignal),defaultValue:()=>null}]);Uu.converters.WebSocketCloseInfo=Uu.dictionaryConverter([{key:"closeCode",converter:t=>Uu.converters["unsigned short"](t,Uu.attributes.EnforceRange)},{key:"reason",converter:Uu.converters.USVString,defaultValue:()=>""}]);Uu.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?Uu.converters.USVString(t):Uu.converters.BufferSource(t)};mnr.exports={WebSocketStream:BDe}});var zEt=re((TLc,fnr)=>{"use strict";p();var{makeRequest:cms}=ZY();function lms(t){return t.indexOf("\0")===-1}function ums(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}function dms(t,e,n,r){let i=n==="no cors"?"no-cors":"cors";r&&i==="no-cors"&&(i="same-origin");let s="include";return n==="anonymous"&&(s="same-origin"),cms({urlList:[t],destination:e,mode:i,credentials:s,useURLCredentials:!0})}fnr.exports={isValidLastEventId:lms,isASCIINumber:ums,createPotentialCORSRequest:dms}});var Anr=re((RLc,gnr)=>{"use strict";p();var pms=require("node:buffer"),{Transform:mms}=require("node:stream"),{isASCIINumber:hms,isValidLastEventId:fms}=zEt(),a9=[239,187,191],KEt=10,NDe=13,gms=58,Ams=32,yms=pms.kStringMaxLength,Ems=Buffer.from("data"),bms=Buffer.from("event"),_ms=Buffer.from("id"),xms=Buffer.from("retry");function Sms(t,e){if(e>=t.length)return!1;for(let n=e;n57)return!1;return!0}function Cms(t,e){for(let n=e;n0&&a>this.maxEventSize)throw Ims();let c=e.toString("utf8",s);n.data===void 0?n.data=c:n.data+=` +${c}`,this.eventDataSize=a;return}if(DDe(e,i,xms)){Sms(e,s)&&(n.retry=e.toString("utf8",s));return}if(DDe(e,i,_ms)){Cms(e,s)&&(n.id=e.toString("utf8",s));return}if(DDe(e,i,bms)){let o=e.toString("utf8",s);o.length>0&&(n.event=o)}}processEvent(e){e.retry&&hms(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&fms(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event.data=void 0,this.event.event=void 0,this.event.id=void 0,this.event.retry=void 0,this.eventDataSize=0}hasPendingEvent(){return this.event.data!==void 0||this.event.event!==void 0||this.event.id!==void 0||this.event.retry!==void 0}hasCurrentByte(){return this.chunkIndex=this.chunks[this.chunkIndex].length;)this.chunkIndex++,this.pos=0}syncLineStartToCursor(){this.lineChunkIndex=this.chunkIndex,this.linePos=this.pos,this.dropConsumedChunks()}dropConsumedChunks(){for(;this.lineChunkIndex>0;)this.chunks.shift(),this.lineChunkIndex--,this.chunkIndex--;this.chunkIndex===this.chunks.length&&(this.chunks.length=0,this.chunkIndex=0,this.pos=0,this.lineChunkIndex=0,this.linePos=0)}readLine(){if(this.lineChunkIndex===this.chunkIndex)return this.chunks[this.chunkIndex].subarray(this.linePos,this.pos);let e=[],n=0;for(let r=this.lineChunkIndex;r<=this.chunkIndex;r++){let i=this.chunks[r],s=r===this.lineChunkIndex?this.linePos:0,o=r===this.chunkIndex?this.pos:i.length,a=i.subarray(s,o);n+=a.length,e.push(a)}return Buffer.concat(e,n)}peekBufferedByte(e){let n=this.lineChunkIndex,r=this.linePos;for(;n0&&this.lineChunkIndex{"use strict";p();var{pipeline:wms}=require("node:stream"),{fetching:Tms}=Iae(),{webidl:Bg}=lh(),{EventSourceStream:vms}=Anr(),{parseMIMEType:Rms}=Wb(),{createFastMessageEvent:kms}=_De(),{isNetworkError:ynr}=xae(),{isValidHeaderValue:Bms,kEnumerableProperty:HU}=Zi(),{environmentSettingsObject:Enr}=OE(),{createPotentialCORSRequest:Nms}=zEt(),{getGlobalDispatcher:Dms}=gae(),{isomorphicDecode:Pms}=Dw(),Mms=new TextEncoder,bnr=!1,_nr=3e3,Nae=0,xnr=1,Dae=2,Oms="anonymous",Lms="use-credentials",c9=class t extends EventTarget{#e={open:null,error:null,message:null};#t;#n=!1;#r=Nae;#i=null;#s=null;#o;#a;constructor(e,n={}){super(),Bg.util.markAsUncloneable(this);let r="EventSource constructor";Bg.argumentLengthCheck(arguments,1,r),bnr||(bnr=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=Bg.converters.USVString(e),n=Bg.converters.EventSourceInitDict(n,r,"eventSourceInitDict"),this.#o=n.node.dispatcher||n.dispatcher,this.#a={lastEventId:"",reconnectionTime:n.node.reconnectionTime};let i=Enr,s;try{s=new URL(e,i.settingsObject.baseUrl),this.#a.origin=s.origin}catch(c){throw new DOMException(c,"SyntaxError")}this.#t=s.href;let o=Oms;n.withCredentials===!0&&(o=Lms,this.#n=!0);let a=Nms(s,"",o);a.client=Enr.settingsObject,a.headersList.set("Accept","text/event-stream"),a.cache="no-store",a.initiator="other",this.#i=a,this.#c()}get readyState(){return this.#r}get url(){return this.#t}get withCredentials(){return this.#n}#c(){if(this.#r===Dae)return;this.#r=Nae;let e={request:this.#i,dispatcher:this.#o},n=r=>{if(!ynr(r))return this.#l()};e.processResponseEndOfBody=n,e.processResponse=r=>{if(ynr(r))if(r.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#l();return}let i=r.headersList.get("content-type",!0),s=i!==null?Rms(i):"failure",o=s!=="failure"&&s.essence==="text/event-stream";if(r.status!==200||o===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#r=xnr,this.dispatchEvent(new Event("open")),this.#a.origin=r.urlList[r.urlList.length-1].origin;let a=new vms({eventSourceSettings:this.#a,maxEventSize:this.#o.eventSourceOptions?.maxEventSize,push:c=>{this.dispatchEvent(kms(c.type,c.options))}});wms(r.body.stream,a,c=>{c?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#s=Tms(e)}#l(){this.#r!==Dae&&(this.#r=Nae,this.dispatchEvent(new Event("error")),setTimeout(()=>{if(this.#r===Nae){if(this.#i.headersList.delete("last-event-id",!0),this.#a.lastEventId.length){let e=Pms(Mms.encode(this.#a.lastEventId));Bms(e)&&this.#i.headersList.set("last-event-id",e,!0)}this.#c()}},this.#a.reconnectionTime)?.unref())}close(){Bg.brandCheck(this,t),this.#r!==Dae&&(this.#r=Dae,this.#s.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open);let n=Bg.converters.EventHandlerNonNull(e);n!==null?(this.addEventListener("open",n),this.#e.open=e):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message);let n=Bg.converters.EventHandlerNonNull(e);n!==null?(this.addEventListener("message",n),this.#e.message=e):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error);let n=Bg.converters.EventHandlerNonNull(e);n!==null?(this.addEventListener("error",n),this.#e.error=e):this.#e.error=null}},Snr={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Nae,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:xnr,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:Dae,writable:!1}};Object.defineProperties(c9,Snr);Object.defineProperties(c9.prototype,Snr);Object.defineProperties(c9.prototype,{close:HU,onerror:HU,onmessage:HU,onopen:HU,readyState:HU,url:HU,withCredentials:HU});Bg.converters.EventSourceInitDict=Bg.dictionaryConverter([{key:"withCredentials",converter:Bg.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:Bg.converters.any,defaultValue:()=>Dms()},{key:"node",converter:Bg.dictionaryConverter([{key:"reconnectionTime",converter:Bg.converters["unsigned long"],defaultValue:()=>_nr},{key:"dispatcher",converter:Bg.converters.any}]),defaultValue:()=>({})}]);Cnr.exports={EventSource:c9,defaultReconnectionTime:_nr}});var Bnr=re((DLc,cr)=>{"use strict";p();var Fms=RP(),Tnr=fY(),Qms=AU(),Ums=Y7n(),Gms=Z7n(),$ms=_U(),Wms=SAt(),Hms=MAt(),qms=kAt(),jms=jKn(),Vms=tJn(),Yms=rJn(),vnr=Wi(),MDe=Zi(),{InvalidArgumentError:PDe}=vnr,l9=FJn(),zms=oU(),Kms=_yt(),{MockCallHistory:Jms,MockCallHistoryLog:Xms}=Cyt(),Zms=Nyt(),ehs=vyt(),ths=QXn(),nhs=iyt(),rhs=TNe(),{getGlobalDispatcher:Rnr,setGlobalDispatcher:ihs}=gae(),shs=qY(),ohs=Qyt();Object.assign(Tnr.prototype,l9);cr.exports.Dispatcher=Tnr;cr.exports.Client=Fms;cr.exports.Pool=Qms;cr.exports.BalancedPool=Ums;cr.exports.RoundRobinPool=Gms;cr.exports.Agent=$ms;cr.exports.Dispatcher1Wrapper=Wms;cr.exports.ProxyAgent=Hms;cr.exports.Socks5ProxyAgent=qms;cr.exports.EnvHttpProxyAgent=jms;cr.exports.RetryAgent=Vms;cr.exports.H2CClient=Yms;cr.exports.RetryHandler=rhs;cr.exports.DecoratorHandler=shs;cr.exports.RedirectHandler=ohs;cr.exports.interceptors={redirect:XXn(),responseError:eZn(),retry:nZn(),dump:sZn(),dns:lZn(),cache:WZn(),decompress:zZn(),deduplicate:ter()};cr.exports.cacheStores={MemoryCacheStore:eEt()};var ahs=ier();cr.exports.cacheStores.SqliteCacheStore=ahs;cr.exports.buildConnector=zms;cr.exports.errors=vnr;cr.exports.util={parseHeaders:MDe.parseHeaders,headerNameToString:MDe.headerNameToString};function Pae(t){return(e,n,r)=>{if(typeof n=="function"&&(r=n,n=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new PDe("invalid url");if(n!=null&&typeof n!="object")throw new PDe("invalid opts");if(n&&n.path!=null){if(typeof n.path!="string")throw new PDe("invalid opts.path");let a=n.path;n.path.startsWith("/")||(a=`/${a}`),e=new URL(MDe.parseOrigin(e).origin+a)}else n||(n=typeof e=="object"?e:{}),e=MDe.parseURL(e);let{agent:i,dispatcher:s=Rnr(),...o}=n;if(i)throw new PDe("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...o,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:n.method||(n.body?"PUT":"GET")},r)}}cr.exports.setGlobalDispatcher=ihs;cr.exports.getGlobalDispatcher=Rnr;var chs=Iae().fetch,wnr=typeof __filename<"u"?__filename:void 0;function knr(t,e){if(!t||typeof t!="object")return;let n=typeof t.stack=="string"?t.stack:"",r=e.replace(/\\/g,"/");if(n&&(n.includes(e)||n.includes(r)))return;let i={};if(Error.captureStackTrace(i,knr),!i.stack)return;let s=i.stack.split(` +`).slice(1).join(` +`);t.stack=n?`${n} +${s}`:i.stack}cr.exports.fetch=function(e,n=void 0){return chs(e,n).catch(r=>{throw wnr?knr(r,wnr):r&&typeof r=="object"&&Error.captureStackTrace(r,cr.exports.fetch),r})};cr.exports.Headers=OU().Headers;cr.exports.Response=xae().Response;cr.exports.Request=ZY().Request;cr.exports.FormData=JBe().FormData;var{setGlobalOrigin:lhs,getGlobalOrigin:uhs}=egt();cr.exports.setGlobalOrigin=lhs;cr.exports.getGlobalOrigin=uhs;var{CacheStorage:dhs}=htr(),{kConstruct:phs}=Oo();cr.exports.caches=new dhs(phs);var{deleteCookie:mhs,getCookies:hhs,getSetCookies:fhs,setCookie:ghs,parseCookie:Ahs}=Ttr();cr.exports.deleteCookie=mhs;cr.exports.getCookies=hhs;cr.exports.getSetCookies=fhs;cr.exports.setCookie=ghs;cr.exports.parseCookie=Ahs;var{parseMIMEType:yhs,serializeAMimeType:Ehs}=Wb();cr.exports.parseMIMEType=yhs;cr.exports.serializeAMimeType=Ehs;var{CloseEvent:bhs,ErrorEvent:_hs,MessageEvent:xhs}=_De(),{WebSocket:Shs,ping:Chs}=onr();cr.exports.WebSocket=Shs;cr.exports.CloseEvent=bhs;cr.exports.ErrorEvent=_hs;cr.exports.MessageEvent=xhs;cr.exports.ping=Chs;cr.exports.WebSocketStream=hnr().WebSocketStream;cr.exports.WebSocketError=jEt().WebSocketError;cr.exports.request=Pae(l9.request);cr.exports.stream=Pae(l9.stream);cr.exports.pipeline=Pae(l9.pipeline);cr.exports.connect=Pae(l9.connect);cr.exports.upgrade=Pae(l9.upgrade);cr.exports.MockClient=Kms;cr.exports.MockCallHistory=Jms;cr.exports.MockCallHistoryLog=Xms;cr.exports.MockPool=ehs;cr.exports.MockAgent=Zms;cr.exports.SnapshotAgent=ths;cr.exports.mockErrors=nhs;var{EventSource:Ihs}=Inr();cr.exports.EventSource=Ihs;function whs(){globalThis.fetch=cr.exports.fetch,globalThis.Headers=cr.exports.Headers,globalThis.Response=cr.exports.Response,globalThis.Request=cr.exports.Request,globalThis.FormData=cr.exports.FormData,globalThis.WebSocket=cr.exports.WebSocket,globalThis.CloseEvent=cr.exports.CloseEvent,globalThis.ErrorEvent=cr.exports.ErrorEvent,globalThis.MessageEvent=cr.exports.MessageEvent,globalThis.EventSource=cr.exports.EventSource}cr.exports.install=whs});function LDe(t){if(typeof t=="string"){let e=t.trim();return e.toLowerCase()==="disabled"?0:e.length===0?void 0:LDe(Number(e))}if(!(typeof t!="number"||!Number.isFinite(t)||t<0))return Math.floor(t)}function FDe(t){let e=ODe.find(n=>n.timeoutMs===t);return e?e.label:`${t/1e3} sec`}function n0t(t){let e=t?.trim();e&&(process.env.HTTP_PROXY??=e,process.env.HTTPS_PROXY??=e)}function r0t(t){return t instanceof ZEt.EventEmitter&&ZEt.EventEmitter.prototype.on.call(t,"error",Rhs),t}function e0t(t,e){return r0t(new zw.Client(t,e))}function khs(t,e){let n=e;return n.connections===1?e0t(t,n):r0t(new zw.Pool(t,{...n,factory:e0t}))}function u9(t=t0t){let e=LDe(t);if(e===void 0)throw new Error(`Invalid HTTP idle timeout: ${String(t)}`);let n=r0t(new zw.EnvHttpProxyAgent({allowH2:!1,proxyTunnel:!0,bodyTimeout:e,connect:{autoSelectFamilyAttemptTimeout:Ths},headersTimeout:e,clientFactory:e0t,factory:khs}));zw.setGlobalDispatcher(n),(XEt===void 0?globalThis.fetch===vhs:globalThis.fetch===XEt)&&(zw.install?.(),XEt=globalThis.fetch)}var ZEt,zw,t0t,Ths,ODe,vhs,XEt,Rhs,Mae=v(()=>{p();ZEt=require("node:events"),zw=Ot(Bnr(),1),t0t=3e5,Ths=2e3,ODe=[{label:"30 sec",timeoutMs:3e4},{label:"1 min",timeoutMs:6e4},{label:"2 min",timeoutMs:12e4},{label:"5 min",timeoutMs:3e5},{label:"disabled",timeoutMs:0}],vhs=globalThis.fetch;Rhs=t=>{}});function s0t(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Mnr(t,e){let n={...t};for(let r of Object.keys(e)){let i=e[r];if(i===void 0)continue;let s=t[r];n[r]=s0t(s)&&s0t(i)?Mnr(s,i):i}return n}function qU(t,e){return Mnr(t,e)}function Nnr(t,e){let n=LDe(t);if(n!==void 0)return n;if(t!==void 0)throw new Error(`Invalid ${e} setting: ${String(t)}`)}function i0t(t,e,n){return{scope:t,...n?{path:n}:{},error:e instanceof Error?e:new Error(String(e))}}var Dnr,yk,jU,Pnr,Bhs,c0t,o0t,a0t,lu,Ek=v(()=>{p();qo();Dnr=require("crypto"),yk=require("fs"),jU=require("path"),Pnr=Ot(Zse(),1);Qs();fc();nm();Mae();Bhs={reserveTokens:16384,keepRecentTokens:2e4},c0t=["off","streaming","idle"];o0t=class{globalSettingsPath;projectSettingsPath;constructor(e,n){let r=Vn(e),i=Vn(n);this.globalSettingsPath=(0,jU.join)(i,"settings.json"),this.projectSettingsPath=(0,jU.join)(r,Bi,"settings.json")}acquireLockSyncWithRetry(e){let i;for(let s=1;s<=10;s++)try{return Pnr.default.lockSync(e,{realpath:!1})}catch(o){if((typeof o=="object"&&o!==null&&"code"in o?String(o.code):void 0)!=="ELOCKED"||s===10)throw o;i=o;let c=Date.now();for(;Date.now()-c<20;);}throw i??new Error("Failed to acquire settings lock")}withLock(e,n){let r=e==="global"?this.globalSettingsPath:this.projectSettingsPath,i=(0,jU.dirname)(r),s;try{let o=(0,yk.existsSync)(r);o&&(s=this.acquireLockSyncWithRetry(r));let a=o?(0,yk.readFileSync)(r,"utf-8"):void 0,c=n(a);c!==void 0&&((0,yk.existsSync)(i)||(0,yk.mkdirSync)(i,{recursive:!0}),s||(s=this.acquireLockSyncWithRetry(r)),(0,yk.writeFileSync)(r,c,"utf-8"))}finally{s&&s()}}},a0t=class{global;project;withLock(e,n){let r=e==="global"?this.global:this.project,i=n(r);i!==void 0&&(e==="global"?this.global=i:this.project=i)}},lu=class t{storage;globalSettings;projectSettings;settings;projectTrusted;modifiedFields=new Set;modifiedNestedFields=new Map;modifiedProjectFields=new Set;modifiedProjectNestedFields=new Map;globalSettingsLoadError=null;projectSettingsLoadError=null;writeQueue=Promise.resolve();errors;settingsPaths;constructor(e,n,r,i=null,s=null,o=[],a=!0,c={}){this.storage=e,this.globalSettings=n,this.projectSettings=r,this.projectTrusted=a,this.globalSettingsLoadError=i,this.projectSettingsLoadError=s,this.errors=[...o],this.settingsPaths=c,this.settings=qU(this.globalSettings,this.projectSettings)}static create(e,n=ii(),r={}){let i=Vn(e),s=Vn(n),o=new o0t(i,s);return t.fromStorageWithPaths(o,r,{global:(0,jU.join)(s,"settings.json"),project:(0,jU.join)(i,Bi,"settings.json")})}static fromStorage(e,n={}){return t.fromStorageWithPaths(e,n)}static fromStorageWithPaths(e,n,r={}){let i=n.projectTrusted??!0,s=t.tryLoadFromStorage(e,"global"),o=t.tryLoadFromStorage(e,"project",i),a=[];return s.error&&a.push(i0t("global",s.error,r.global)),o.error&&a.push(i0t("project",o.error,r.project)),new t(e,s.settings,o.settings,s.error,o.error,a,i,r)}static inMemory(e={},n={}){let r=new a0t,i=t.migrateSettings(structuredClone(e));return r.withLock("global",()=>JSON.stringify(i,null,2)),t.fromStorage(r,n)}static loadFromStorage(e,n,r=!0){if(n==="project"&&!r)return{};let i;if(e.withLock(n,o=>{i=o}),!i)return{};let s=JSON.parse(zs(i));return t.migrateSettings(s)}static tryLoadFromStorage(e,n,r=!0){try{return{settings:t.loadFromStorage(e,n,r),error:null}}catch(i){return{settings:{},error:i}}}static migrateSettings(e){if("queueMode"in e&&!("steeringMode"in e)&&(e.steeringMode=e.queueMode,delete e.queueMode),!("transport"in e)&&typeof e.websockets=="boolean"&&(e.transport=e.websockets?"websocket":"sse",delete e.websockets),"skills"in e&&typeof e.skills=="object"&&e.skills!==null&&!Array.isArray(e.skills)){let n=e.skills;n.enableSkillCommands!==void 0&&e.enableSkillCommands===void 0&&(e.enableSkillCommands=n.enableSkillCommands),Array.isArray(n.customDirectories)&&n.customDirectories.length>0?e.skills=n.customDirectories:delete e.skills}if("retry"in e&&typeof e.retry=="object"&&e.retry!==null&&!Array.isArray(e.retry)){let n=e.retry,r=typeof n.provider=="object"&&n.provider!==null?n.provider:void 0;typeof n.maxDelayMs=="number"&&(r?.maxRetryDelayMs===void 0||r?.maxRetryDelayMs===null)&&(n.provider={...r??{},maxRetryDelayMs:n.maxDelayMs}),delete n.maxDelayMs}return e}getGlobalSettings(){return structuredClone(this.globalSettings)}getProjectSettings(){return structuredClone(this.projectSettings)}isProjectTrusted(){return this.projectTrusted}setProjectTrusted(e){if(this.projectTrusted===e)return;if(this.projectTrusted=e,this.modifiedProjectFields.clear(),this.modifiedProjectNestedFields.clear(),!e){this.projectSettings={},this.projectSettingsLoadError=null,this.settings=qU(this.globalSettings,this.projectSettings);return}let n=t.tryLoadFromStorage(this.storage,"project",e);this.projectSettings=n.settings,this.projectSettingsLoadError=n.error,n.error&&this.recordError("project",n.error),this.settings=qU(this.globalSettings,this.projectSettings)}async reload(){await this.writeQueue;let e=t.tryLoadFromStorage(this.storage,"global");e.error?(this.globalSettingsLoadError=e.error,this.recordError("global",e.error)):(this.globalSettings=e.settings,this.globalSettingsLoadError=null),this.modifiedFields.clear(),this.modifiedNestedFields.clear(),this.modifiedProjectFields.clear(),this.modifiedProjectNestedFields.clear();let n=t.tryLoadFromStorage(this.storage,"project",this.projectTrusted);n.error?(this.projectSettingsLoadError=n.error,this.recordError("project",n.error)):(this.projectSettings=n.settings,this.projectSettingsLoadError=null),this.settings=qU(this.globalSettings,this.projectSettings)}applyOverrides(e){this.settings=qU(this.settings,e)}markModified(e,n){this.modifiedFields.add(e),n&&(this.modifiedNestedFields.has(e)||this.modifiedNestedFields.set(e,new Set),this.modifiedNestedFields.get(e).add(n))}markProjectModified(e,n){this.modifiedProjectFields.add(e),n&&(this.modifiedProjectNestedFields.has(e)||this.modifiedProjectNestedFields.set(e,new Set),this.modifiedProjectNestedFields.get(e).add(n))}assertProjectTrustedForWrite(){if(!this.projectTrusted)throw new Error("Project is not trusted; refusing to write project settings")}recordError(e,n){this.errors.push(i0t(e,n,this.settingsPaths[e]))}clearModifiedScope(e){if(e==="global"){this.modifiedFields.clear(),this.modifiedNestedFields.clear();return}this.modifiedProjectFields.clear(),this.modifiedProjectNestedFields.clear()}enqueueWrite(e,n){this.writeQueue=this.writeQueue.then(()=>{e==="project"&&this.assertProjectTrustedForWrite(),n(),this.clearModifiedScope(e)}).catch(r=>{this.recordError(e,r)})}cloneModifiedNestedFields(e){let n=new Map;for(let[r,i]of e.entries())n.set(r,new Set(i));return n}persistScopedSettings(e,n,r,i){this.storage.withLock(e,s=>{let o=s?t.migrateSettings(JSON.parse(zs(s))):{},a={...o};for(let c of r){let u=n[c];if(i.has(c)&&typeof u=="object"&&u!==null){let l=i.get(c),d=o[c]??{},m=u,h={...d};for(let f of l)h[f]=m[f];a[c]=h}else a[c]=u}return JSON.stringify(a,null,2)})}save(){if(this.settings=qU(this.globalSettings,this.projectSettings),this.globalSettingsLoadError)return;let e=structuredClone(this.globalSettings),n=new Set(this.modifiedFields),r=this.cloneModifiedNestedFields(this.modifiedNestedFields);this.enqueueWrite("global",()=>{this.persistScopedSettings("global",e,n,r)})}saveProjectSettings(e){if(this.assertProjectTrustedForWrite(),this.projectSettings=structuredClone(e),this.settings=qU(this.globalSettings,this.projectSettings),this.projectSettingsLoadError)return;let n=structuredClone(this.projectSettings),r=new Set(this.modifiedProjectFields),i=this.cloneModifiedNestedFields(this.modifiedProjectNestedFields);this.enqueueWrite("project",()=>{this.persistScopedSettings("project",n,r,i)})}updateProjectSettings(e,n){this.assertProjectTrustedForWrite();let r=structuredClone(this.projectSettings);n(r),this.markProjectModified(e),this.saveProjectSettings(r)}async flush(){await this.writeQueue}drainErrors(){let e=[...this.errors];return this.errors=[],e}getLastChangelogVersion(){return this.settings.lastChangelogVersion}setLastChangelogVersion(e){this.globalSettings.lastChangelogVersion=e,this.markModified("lastChangelogVersion"),this.save()}getSessionDir(){let e=this.settings.sessionDir;return e&&Vo(e)}getDefaultProvider(){return this.settings.defaultProvider}getDefaultModel(){return this.settings.defaultModel}setDefaultProvider(e){this.globalSettings.defaultProvider=e,this.markModified("defaultProvider"),this.save()}setDefaultModel(e){this.globalSettings.defaultModel=e,this.markModified("defaultModel"),this.save()}setDefaultModelAndProvider(e,n){this.globalSettings.defaultProvider=e,this.globalSettings.defaultModel=n,this.markModified("defaultProvider"),this.markModified("defaultModel"),this.save()}getSteeringMode(){return this.settings.steeringMode||"one-at-a-time"}setSteeringMode(e){this.globalSettings.steeringMode=e,this.markModified("steeringMode"),this.save()}getFollowUpMode(){return this.settings.followUpMode||"one-at-a-time"}setFollowUpMode(e){this.globalSettings.followUpMode=e,this.markModified("followUpMode"),this.save()}getThemeSetting(){let e=this.settings.theme;if(typeof e=="string")return e}getTheme(){let e=this.getThemeSetting();return e?.includes("/")?void 0:e}setTheme(e){this.globalSettings.theme=e,this.markModified("theme"),this.save()}getDefaultThinkingLevel(){return this.settings.defaultThinkingLevel}setDefaultThinkingLevel(e){this.globalSettings.defaultThinkingLevel=e,this.markModified("defaultThinkingLevel"),this.save()}getModelThinkingLevel(e,n){return this.settings.modelThinkingLevels?.[`${e}/${n}`]}getAllModelThinkingLevels(){return{...this.settings.modelThinkingLevels??{}}}setModelThinkingLevel(e,n,r){this.globalSettings.modelThinkingLevels||(this.globalSettings.modelThinkingLevels={}),this.globalSettings.modelThinkingLevels[`${e}/${n}`]=r,this.markModified("modelThinkingLevels"),this.save()}removeModelThinkingLevel(e,n){this.globalSettings.modelThinkingLevels&&(delete this.globalSettings.modelThinkingLevels[`${e}/${n}`],Object.keys(this.globalSettings.modelThinkingLevels).length===0&&delete this.globalSettings.modelThinkingLevels,this.markModified("modelThinkingLevels"),this.save())}getTransport(){return this.settings.transport??"auto"}setTransport(e){this.globalSettings.transport=e,this.markModified("transport"),this.save()}getCompactionEnabled(){return this.settings.compaction?.enabled??!0}setCompactionEnabled(e){this.globalSettings.compaction||(this.globalSettings.compaction={}),this.globalSettings.compaction.enabled=e,this.markModified("compaction","enabled"),this.save()}getCompactionTokenSetting(e,n){let r=this.settings.compaction,i=r?.[e];if(i!==void 0&&(typeof i!="number"||!Number.isSafeInteger(i)||i<0))throw new Error(`Invalid compaction.${e} setting: ${String(i)}. Expected a non-negative safe integer.`);let s=n?`${n.provider}/${n.id}`:void 0,o=s!==void 0?r?.modelOverrides?.[s]:void 0;if(o!==void 0&&!s0t(o))throw new Error(`Invalid compaction.modelOverrides["${s}"] setting: ${String(o)}. Expected an object.`);let a=o?.[e];if(a!==void 0&&(typeof a!="number"||!Number.isSafeInteger(a)||a<0))throw new Error(`Invalid compaction.modelOverrides["${s}"].${e} setting: ${String(a)}. Expected a non-negative safe integer.`);return a??i??Bhs[e]}getCompactionReserveTokens(e){return this.getCompactionTokenSetting("reserveTokens",e)}getCompactionKeepRecentTokens(e){return this.getCompactionTokenSetting("keepRecentTokens",e)}getCompactionSettings(e){return{enabled:this.getCompactionEnabled(),reserveTokens:this.getCompactionReserveTokens(e),keepRecentTokens:this.getCompactionKeepRecentTokens(e)}}getBranchSummarySettings(){return{reserveTokens:this.settings.branchSummary?.reserveTokens??16384,skipPrompt:this.settings.branchSummary?.skipPrompt??!1}}getBranchSummarySkipPrompt(){return this.settings.branchSummary?.skipPrompt??!1}getRetryEnabled(){return this.settings.retry?.enabled??!0}setRetryEnabled(e){this.globalSettings.retry||(this.globalSettings.retry={}),this.globalSettings.retry.enabled=e,this.markModified("retry","enabled"),this.save()}getRetrySettings(){return{enabled:this.getRetryEnabled(),maxRetries:this.settings.retry?.maxRetries??3,baseDelayMs:this.settings.retry?.baseDelayMs??2e3,maxAgentDelayMs:this.settings.retry?.maxAgentDelayMs??KN}}getHttpIdleTimeoutMs(){return Nnr(this.settings.httpIdleTimeoutMs,"httpIdleTimeoutMs")??t0t}setHttpIdleTimeoutMs(e){if(!Number.isFinite(e)||e<0)throw new Error(`Invalid httpIdleTimeoutMs setting: ${String(e)}`);this.globalSettings.httpIdleTimeoutMs=Math.floor(e),this.markModified("httpIdleTimeoutMs"),this.save()}getCacheWarmingMode(){let e=this.globalSettings.cacheWarming;return e!==void 0&&c0t.includes(e)?e:"streaming"}setCacheWarmingMode(e){this.globalSettings.cacheWarming=e,this.markModified("cacheWarming"),this.save()}getProviderRetrySettings(){return{timeoutMs:this.settings.retry?.provider?.timeoutMs,maxRetries:this.settings.retry?.provider?.maxRetries,maxRetryDelayMs:this.settings.retry?.provider?.maxRetryDelayMs??6e4}}getWebSocketConnectTimeoutMs(){return Nnr(this.settings.websocketConnectTimeoutMs,"websocketConnectTimeoutMs")}getHideThinkingBlock(){return this.settings.hideThinkingBlock??!1}getShowCacheMissNotices(){return this.settings.showCacheMissNotices??!1}getExternalEditorCommand(){let e=this.settings.externalEditor;if(typeof e=="string"&&e.trim()!=="")return e;let n=process.env.VISUAL||process.env.EDITOR;return n||(process.platform==="win32"?"notepad":"nano")}setHideThinkingBlock(e){this.globalSettings.hideThinkingBlock=e,this.markModified("hideThinkingBlock"),this.save()}setShowCacheMissNotices(e){this.globalSettings.showCacheMissNotices=e,this.markModified("showCacheMissNotices"),this.save()}getShellPath(){let e=this.settings.shellPath;return e&&Vo(e)}setShellPath(e){this.globalSettings.shellPath=e,this.markModified("shellPath"),this.save()}getQuietStartup(){return this.settings.quietStartup??!1}setQuietStartup(e){this.globalSettings.quietStartup=e,this.markModified("quietStartup"),this.save()}getDefaultProjectTrust(){let e=this.globalSettings.defaultProjectTrust;return e==="always"||e==="never"?e:"ask"}setDefaultProjectTrust(e){this.globalSettings.defaultProjectTrust=e,this.markModified("defaultProjectTrust"),this.save()}getShellCommandPrefix(){return this.settings.shellCommandPrefix}setShellCommandPrefix(e){this.globalSettings.shellCommandPrefix=e,this.markModified("shellCommandPrefix"),this.save()}getNpmCommand(){return this.settings.npmCommand?[...this.settings.npmCommand]:void 0}setNpmCommand(e){this.globalSettings.npmCommand=e?[...e]:void 0,this.markModified("npmCommand"),this.save()}getCollapseChangelog(){return this.settings.collapseChangelog??!1}setCollapseChangelog(e){this.globalSettings.collapseChangelog=e,this.markModified("collapseChangelog"),this.save()}getEnableInstallTelemetry(){return this.settings.enableInstallTelemetry??!0}setEnableInstallTelemetry(e){this.globalSettings.enableInstallTelemetry=e,this.markModified("enableInstallTelemetry"),this.save()}getEnableAnalytics(){return this.settings.enableAnalytics??!1}getTrackingId(){return this.settings.trackingId}setEnableAnalytics(e){this.globalSettings.enableAnalytics=e,this.markModified("enableAnalytics"),e&&!this.globalSettings.trackingId&&(this.globalSettings.trackingId=(0,Dnr.randomUUID)(),this.markModified("trackingId")),this.save()}getPackages(){return[...this.settings.packages??[]]}setPackages(e){this.globalSettings.packages=e,this.markModified("packages"),this.save()}setProjectPackages(e){this.updateProjectSettings("packages",n=>{n.packages=e})}getExtensionPaths(){return[...this.settings.extensions??[]]}setExtensionPaths(e){this.globalSettings.extensions=e,this.markModified("extensions"),this.save()}setProjectExtensionPaths(e){this.updateProjectSettings("extensions",n=>{n.extensions=e})}getSkillPaths(){return[...this.settings.skills??[]]}setSkillPaths(e){this.globalSettings.skills=e,this.markModified("skills"),this.save()}setProjectSkillPaths(e){this.updateProjectSettings("skills",n=>{n.skills=e})}getPromptTemplatePaths(){return[...this.settings.prompts??[]]}setPromptTemplatePaths(e){this.globalSettings.prompts=e,this.markModified("prompts"),this.save()}setProjectPromptTemplatePaths(e){this.updateProjectSettings("prompts",n=>{n.prompts=e})}getThemePaths(){return[...this.settings.themes??[]]}setThemePaths(e){this.globalSettings.themes=e,this.markModified("themes"),this.save()}setProjectThemePaths(e){this.updateProjectSettings("themes",n=>{n.themes=e})}getEnableSkillCommands(){return this.settings.enableSkillCommands??!0}setEnableSkillCommands(e){this.globalSettings.enableSkillCommands=e,this.markModified("enableSkillCommands"),this.save()}getThinkingBudgets(){return this.settings.thinkingBudgets}getTerminalCapabilityOverrides(){let e=this.settings.terminal,n=e?.images;return{...n==="kitty"||n==="iterm2"?{images:n}:n===!1?{images:null}:{},...typeof e?.trueColor=="boolean"?{trueColor:e.trueColor}:{},...typeof e?.hyperlinks=="boolean"?{hyperlinks:e.hyperlinks}:{}}}getShowImages(){return this.settings.terminal?.showImages??!0}setShowImages(e){this.globalSettings.terminal||(this.globalSettings.terminal={}),this.globalSettings.terminal.showImages=e,this.markModified("terminal","showImages"),this.save()}getImageWidthCells(){let e=this.settings.terminal?.imageWidthCells;return typeof e!="number"||!Number.isFinite(e)?60:Math.max(1,Math.floor(e))}setImageWidthCells(e){this.globalSettings.terminal||(this.globalSettings.terminal={}),this.globalSettings.terminal.imageWidthCells=Math.max(1,Math.floor(e)),this.markModified("terminal","imageWidthCells"),this.save()}getClearOnShrink(){return this.settings.terminal?.clearOnShrink!==void 0?this.settings.terminal.clearOnShrink:process.env.PI_CLEAR_ON_SHRINK==="1"}setClearOnShrink(e){this.globalSettings.terminal||(this.globalSettings.terminal={}),this.globalSettings.terminal.clearOnShrink=e,this.markModified("terminal","clearOnShrink"),this.save()}getShowTerminalProgress(){return this.settings.terminal?.showTerminalProgress??!1}setShowTerminalProgress(e){this.globalSettings.terminal||(this.globalSettings.terminal={}),this.globalSettings.terminal.showTerminalProgress=e,this.markModified("terminal","showTerminalProgress"),this.save()}getTuiMode(){return this.settings.tuiMode==="fullscreen"?"fullscreen":"regular"}setTuiMode(e){this.globalSettings.tuiMode=e,this.markModified("tuiMode"),this.save()}getFullscreenExitOutput(){return this.settings.fullscreenExitOutput==="resume-hint"?"resume-hint":"transcript"}setFullscreenExitOutput(e){this.globalSettings.fullscreenExitOutput=e,this.markModified("fullscreenExitOutput"),this.save()}getFullscreenScrollbar(){let e=this.settings.fullscreenScrollbar;return e==="always"||e==="hidden"?e:"auto"}setFullscreenScrollbar(e){this.globalSettings.fullscreenScrollbar=e,this.markModified("fullscreenScrollbar"),this.save()}getFullscreenCopyOnSelect(){return this.settings.fullscreenCopyOnSelect??!0}setFullscreenCopyOnSelect(e){this.globalSettings.fullscreenCopyOnSelect=e,this.markModified("fullscreenCopyOnSelect"),this.save()}getImageAutoResize(){return this.settings.images?.autoResize??!0}setImageAutoResize(e){this.globalSettings.images||(this.globalSettings.images={}),this.globalSettings.images.autoResize=e,this.markModified("images","autoResize"),this.save()}getBlockImages(){return this.settings.images?.blockImages??!1}setBlockImages(e){this.globalSettings.images||(this.globalSettings.images={}),this.globalSettings.images.blockImages=e,this.markModified("images","blockImages"),this.save()}getEnabledModels(){return this.settings.enabledModels}getDefaultTools(){let e=this.settings.defaultTools;return e?[...e]:void 0}setEnabledModels(e){this.globalSettings.enabledModels=e,this.markModified("enabledModels"),this.save()}getDoubleEscapeAction(){return this.settings.doubleEscapeAction??"tree"}setDoubleEscapeAction(e){this.globalSettings.doubleEscapeAction=e,this.markModified("doubleEscapeAction"),this.save()}getTreeFilterMode(){let e=this.settings.treeFilterMode;return e&&["default","no-tools","user-only","labeled-only","all"].includes(e)?e:"default"}setTreeFilterMode(e){this.globalSettings.treeFilterMode=e,this.markModified("treeFilterMode"),this.save()}getShowHardwareCursor(){return this.settings.showHardwareCursor??process.env.PI_HARDWARE_CURSOR==="1"}setShowHardwareCursor(e){this.globalSettings.showHardwareCursor=e,this.markModified("showHardwareCursor"),this.save()}getEditorPaddingX(){return this.settings.editorPaddingX??0}setEditorPaddingX(e){this.globalSettings.editorPaddingX=Math.max(0,Math.min(3,Math.floor(e))),this.markModified("editorPaddingX"),this.save()}getOutputPad(){return this.settings.outputPad===0?0:1}setOutputPad(e){this.globalSettings.outputPad=e,this.markModified("outputPad"),this.save()}getAutocompleteMaxVisible(){return this.settings.autocompleteMaxVisible??5}setAutocompleteMaxVisible(e){this.globalSettings.autocompleteMaxVisible=Math.max(3,Math.min(20,Math.floor(e))),this.markModified("autocompleteMaxVisible"),this.save()}getCodeBlockIndent(){return this.settings.markdown?.codeBlockIndent??" "}getMermaidRenderingMode(){let e=this.settings.markdown?.mermaid;return e==="off"||e==="final"?e:"streaming"}setMermaidRenderingMode(e){this.globalSettings.markdown??={},this.globalSettings.markdown.mermaid=e,this.markModified("markdown","mermaid"),this.save()}getWarnings(){return{...this.settings.warnings??{}}}setWarnings(e){this.globalSettings.warnings={...e},this.markModified("warnings"),this.save()}}});function Onr(t,e){if(t){if((0,Ec.existsSync)(t))try{return zs((0,Ec.readFileSync)(t,"utf-8"))}catch(n){return console.error(tn.yellow(`Warning: Could not read ${e} file ${t}: ${n}`)),t}return t}}function l0t(t){let e=["AGENTS.override.md","AGENTS.md","AGENTS.MD","CLAUDE.md","CLAUDE.MD"];for(let n of e){let r=(0,Xs.join)(t,n);if((0,Ec.existsSync)(r))try{if(!(0,Ec.statSync)(r).isFile())continue;return{path:r,content:zs((0,Ec.readFileSync)(r,"utf-8"))}}catch(i){console.error(tn.yellow(`Warning: Could not read ${r}: ${i}`))}}return null}function Nhs(t){let e=kBe(t);if(!e)return;let n=cd(e.commonGitDir),r=cd(e.repoDir),i=(0,Xs.dirname)(n);if(!r.startsWith(`${i}${Xs.sep}`)||cd((0,Xs.join)(i,".git"))!==n)return;let s=l0t(r);return s?(0,Xs.join)(i,(0,Xs.basename)(s.path)):void 0}function u0t(t){let e=Vn(t.cwd),n=Vn(t.agentDir),r=[],i=new Set,s=l0t(n);s&&(r.push(s),i.add(s.path));let o=[],a=Nhs(e),c=e;for(;;){let u=l0t(c),l=a!==void 0&&cd(u?.path??"")===a;u&&!l&&!i.has(u.path)&&(o.unshift(u),i.add(u.path));let d=(0,Xs.dirname)(c);if(d===c)break;c=d}return r.push(...o),r}var Ec,Xs,NS,Oae=v(()=>{p();Ec=require("node:fs"),Xs=require("node:path");gb();Qs();pi();fc();nm();RRe();Rpt();Kht();pY();smt();Ek();c1e();_Q();jie();NS=class{cwd;agentDir;settingsManager;eventBus;packageManager;additionalExtensionPaths;additionalSkillPaths;additionalPromptTemplatePaths;additionalThemePaths;extensionFactories;noExtensions;noSkills;noPromptTemplates;noThemes;noContextFiles;systemPromptSource;appendSystemPromptSource;extensionsOverride;skillsOverride;promptsOverride;themesOverride;agentsFilesOverride;systemPromptOverride;appendSystemPromptOverride;extensionsResult;skills;skillDiagnostics;prompts;promptDiagnostics;themes;themeDiagnostics;agentsFiles;systemPrompt;systemPromptSourcePath;appendSystemPrompt;appendSystemPromptSourcePaths;lastSkillPaths;extensionSkillSourceInfos;extensionPromptSourceInfos;extensionThemeSourceInfos;resourceMetadataByPath;lastPromptPaths;lastThemePaths;loaded;constructor(e){this.cwd=Vn(e.cwd),this.agentDir=Vn(e.agentDir),this.settingsManager=e.settingsManager??lu.create(this.cwd,this.agentDir),this.eventBus=e.eventBus??eV(),this.packageManager=new rf({cwd:this.cwd,agentDir:this.agentDir,settingsManager:this.settingsManager}),this.additionalExtensionPaths=e.additionalExtensionPaths??[],this.additionalSkillPaths=e.additionalSkillPaths??[],this.additionalPromptTemplatePaths=e.additionalPromptTemplatePaths??[],this.additionalThemePaths=e.additionalThemePaths??[],this.extensionFactories=e.extensionFactories??[],this.noExtensions=e.noExtensions??!1,this.noSkills=e.noSkills??!1,this.noPromptTemplates=e.noPromptTemplates??!1,this.noThemes=e.noThemes??!1,this.noContextFiles=e.noContextFiles??!1,this.systemPromptSource=e.systemPrompt,this.appendSystemPromptSource=e.appendSystemPrompt,this.extensionsOverride=e.extensionsOverride,this.skillsOverride=e.skillsOverride,this.promptsOverride=e.promptsOverride,this.themesOverride=e.themesOverride,this.agentsFilesOverride=e.agentsFilesOverride,this.systemPromptOverride=e.systemPromptOverride,this.appendSystemPromptOverride=e.appendSystemPromptOverride,this.extensionsResult={extensions:[],errors:[],runtime:RV()},this.skills=[],this.skillDiagnostics=[],this.prompts=[],this.promptDiagnostics=[],this.themes=[],this.themeDiagnostics=[],this.agentsFiles=[],this.appendSystemPrompt=[],this.appendSystemPromptSourcePaths=[],this.lastSkillPaths=[],this.extensionSkillSourceInfos=new Map,this.extensionPromptSourceInfos=new Map,this.extensionThemeSourceInfos=new Map,this.resourceMetadataByPath=new Map,this.lastPromptPaths=[],this.lastThemePaths=[],this.loaded=!1}getExtensions(){return this.extensionsResult}getSkills(){return{skills:this.skills,diagnostics:this.skillDiagnostics}}getPrompts(){return{prompts:this.prompts,diagnostics:this.promptDiagnostics}}getThemes(){return{themes:this.themes,diagnostics:this.themeDiagnostics}}getAgentsFiles(){return{agentsFiles:this.agentsFiles}}getSystemPrompt(){return this.systemPrompt}getSystemPromptSource(){return this.systemPromptSourcePath?{path:this.systemPromptSourcePath}:void 0}getAppendSystemPrompt(){return this.appendSystemPrompt}getAppendSystemPromptSources(){return this.appendSystemPromptSourcePaths.map(e=>({path:e}))}extendResources(e){let n=this.normalizeExtensionPaths(e.skillPaths??[]),r=this.normalizeExtensionPaths(e.promptPaths??[]),i=this.normalizeExtensionPaths(e.themePaths??[]);for(let s of n)this.extensionSkillSourceInfos.set(s.path,tV(s.path,s.metadata));for(let s of r)this.extensionPromptSourceInfos.set(s.path,tV(s.path,s.metadata));for(let s of i)this.extensionThemeSourceInfos.set(s.path,tV(s.path,s.metadata));n.length>0&&(this.lastSkillPaths=this.mergePaths(this.lastSkillPaths,n.map(s=>s.path)),this.updateSkillsFromPaths(this.lastSkillPaths,this.resourceMetadataByPath)),r.length>0&&(this.lastPromptPaths=this.mergePaths(this.lastPromptPaths,r.map(s=>s.path)),this.updatePromptsFromPaths(this.lastPromptPaths,this.resourceMetadataByPath)),i.length>0&&(this.lastThemePaths=this.mergePaths(this.lastThemePaths,i.map(s=>s.path)),this.updateThemesFromPaths(this.lastThemePaths,this.resourceMetadataByPath))}async loadProjectTrustExtensions(){return this.settingsManager.setProjectTrusted(!1),await this.settingsManager.reload(),this.loadCurrentExtensionSet({includeInlineFactories:!0})}async reload(e){Hie("extensions"),this.loaded&&wpt();let n;if(e?.resolveProjectTrust){n=await this.loadProjectTrustExtensions();let $=await e.resolveProjectTrust({extensionsResult:n});this.settingsManager.setProjectTrusted($)}await this.settingsManager.reload();let r=await this.packageManager.resolve(),i=await this.packageManager.resolveExtensionSources(this.additionalExtensionPaths,{temporary:!0});this.resourceMetadataByPath=new Map;let s=this.resourceMetadataByPath;this.extensionSkillSourceInfos=new Map,this.extensionPromptSourceInfos=new Map,this.extensionThemeSourceInfos=new Map;let o=$=>{for(let G of $)s.has(G.path)||s.set(G.path,G.metadata);return $.filter(G=>G.enabled)},a=$=>o($).map(G=>G.path),c=a(r.extensions),u=o(r.skills),l=a(r.prompts),d=a(r.themes),m=u.map($=>this.mapSkillPath($,s));for(let $ of i.extensions)s.has($.path)||s.set($.path,{source:"cli",scope:"temporary",origin:"top-level"});for(let $ of i.skills)s.has($.path)||s.set($.path,{source:"cli",scope:"temporary",origin:"top-level"});let h=a(i.extensions),f=a(i.skills),g=a(i.prompts),A=a(i.themes),y=this.noExtensions?h:this.mergePaths(h,c),E=await this.loadFinalExtensionSet(y,n);for(let $ of this.additionalExtensionPaths)if(Ab($)){let G=this.resolveResourcePath($);(0,Ec.existsSync)(G)||E.errors.push({path:G,error:`Extension path does not exist: ${G}`})}this.extensionsResult=this.extensionsOverride?this.extensionsOverride(E):E,this.applyExtensionSourceInfo(this.extensionsResult.extensions,s);let _=this.noSkills?this.mergePaths(f,this.additionalSkillPaths):this.mergePaths([...f,...m],this.additionalSkillPaths);this.lastSkillPaths=_,this.updateSkillsFromPaths(_,s);for(let $ of this.additionalSkillPaths)if(Ab($)){let G=this.resolveResourcePath($);!(0,Ec.existsSync)(G)&&!this.skillDiagnostics.some(q=>q.path===G)&&this.skillDiagnostics.push({type:"error",message:"Skill path does not exist",path:G})}let S=this.noPromptTemplates?this.mergePaths(g,this.additionalPromptTemplatePaths):this.mergePaths([...g,...l],this.additionalPromptTemplatePaths);this.lastPromptPaths=S,this.updatePromptsFromPaths(S,s);for(let $ of this.additionalPromptTemplatePaths)if(Ab($)){let G=this.resolveResourcePath($);!(0,Ec.existsSync)(G)&&!this.promptDiagnostics.some(q=>q.path===G)&&this.promptDiagnostics.push({type:"error",message:"Prompt template path does not exist",path:G})}let C=this.noThemes?this.mergePaths(A,this.additionalThemePaths):this.mergePaths([...A,...d],this.additionalThemePaths);this.lastThemePaths=C,this.updateThemesFromPaths(C,s);for(let $ of this.additionalThemePaths){let G=this.resolveResourcePath($);!(0,Ec.existsSync)(G)&&!this.themeDiagnostics.some(q=>q.path===G)&&this.themeDiagnostics.push({type:"error",message:"Theme path does not exist",path:G})}let I={agentsFiles:this.noContextFiles?[]:u0t({cwd:this.cwd,agentDir:this.agentDir})},w=this.agentsFilesOverride?this.agentsFilesOverride(I):I;this.agentsFiles=w.agentsFiles;let k=this.systemPromptSource??this.discoverSystemPromptFile(),N=Onr(k,"system prompt");this.systemPrompt=this.systemPromptOverride?this.systemPromptOverride(N):N,this.systemPromptSourcePath=k&&(0,Ec.existsSync)(k)?Vn(k):void 0;let O=this.appendSystemPromptSource;if(!O){let $=this.discoverAppendSystemPromptFile();O=$?[$]:[]}let W=O.map($=>Onr($,"append system prompt")).filter($=>$!==void 0);this.appendSystemPrompt=this.appendSystemPromptOverride?this.appendSystemPromptOverride(W):W,this.appendSystemPromptSourcePaths=O.filter($=>(0,Ec.existsSync)($)).map($=>Vn($)),this.loaded=!0}async loadCurrentExtensionSet(e){let n=await this.packageManager.resolve(),r=await this.packageManager.resolveExtensionSources(this.additionalExtensionPaths,{temporary:!0}),i=n.extensions.filter(u=>u.enabled).map(u=>u.path),s=r.extensions.filter(u=>u.enabled).map(u=>u.path),o=this.noExtensions?s:this.mergePaths(s,i),a=await s1e(o,this.cwd,this.eventBus);if(!e.includeInlineFactories)return a;let c=await this.loadExtensionFactories(a.runtime);return a.extensions.push(...c.extensions),a.errors.push(...c.errors),a}resolveExtensionLoadPath(e){return Vn(e,this.cwd,{normalizeUnicodeSpaces:!0})}async loadFinalExtensionSet(e,n){if(!n){let d=await s1e(e,this.cwd,this.eventBus),m=await this.loadExtensionFactories(d.runtime);return d.extensions.push(...m.extensions),d.errors.push(...m.errors),this.addExtensionConflictDiagnostics(d),d}let r=new Map(n.extensions.filter(d=>!d.path.startsWith("[d.resolvedPath,d])),i=new Set(n.errors.map(d=>this.resolveExtensionLoadPath(d.path))),s=e.filter(d=>{let m=this.resolveExtensionLoadPath(d);return!r.has(m)&&!i.has(m)}),o=await s1e(s,this.cwd,this.eventBus,n.runtime),a=new Map(r);for(let d of o.extensions)a.set(d.resolvedPath,d);let c=n.extensions.filter(d=>d.path.startsWith("a.get(this.resolveExtensionLoadPath(d))).filter(d=>d!==void 0);u.push(...c);let l={extensions:u,errors:[...n.errors,...o.errors],runtime:n.runtime};return this.addExtensionConflictDiagnostics(l),l}addExtensionConflictDiagnostics(e){let n=this.detectExtensionConflicts(e.extensions);for(let r of n)e.errors.push({path:r.path,error:r.message})}mapSkillPath(e,n){if(e.metadata.source!=="auto"&&e.metadata.origin!=="package")return e.path;try{if(!(0,Ec.statSync)(e.path).isDirectory())return e.path}catch{return e.path}let r=(0,Xs.join)(e.path,"SKILL.md");return(0,Ec.existsSync)(r)?(n.has(r)||n.set(r,e.metadata),r):e.path}normalizeExtensionPaths(e){return e.map(n=>{let r=n.metadata.baseDir?{...n.metadata,baseDir:this.resolveResourcePath(n.metadata.baseDir)}:n.metadata;return{path:this.resolveResourcePath(n.path),metadata:r}})}updateSkillsFromPaths(e,n){let r;this.noSkills&&e.length===0?r={skills:[],diagnostics:[]}:r=a1e({cwd:this.cwd,agentDir:this.agentDir,skillPaths:e,includeDefaults:!1});let i=this.skillsOverride?this.skillsOverride(r):r;this.skills=i.skills.map(s=>({...s,sourceInfo:this.findSourceInfoForPath(s.filePath,this.extensionSkillSourceInfos,n)??s.sourceInfo??this.getDefaultSourceInfoForPath(s.filePath)})),this.skillDiagnostics=i.diagnostics}updatePromptsFromPaths(e,n){let r;if(this.noPromptTemplates&&e.length===0)r={prompts:[],diagnostics:[]};else{let s=d4n({cwd:this.cwd,agentDir:this.agentDir,promptPaths:e,includeDefaults:!1}),o=this.dedupePrompts(s.templates);r={prompts:o.prompts,diagnostics:[...s.diagnostics,...o.diagnostics]}}let i=this.promptsOverride?this.promptsOverride(r):r;this.prompts=i.prompts.map(s=>({...s,sourceInfo:this.findSourceInfoForPath(s.filePath,this.extensionPromptSourceInfos,n)??s.sourceInfo??this.getDefaultSourceInfoForPath(s.filePath)})),this.promptDiagnostics=i.diagnostics}updateThemesFromPaths(e,n){let r;if(this.noThemes&&e.length===0)r={themes:[],diagnostics:[]};else{let s=this.loadThemes(e,!1),o=this.dedupeThemes(s.themes);r={themes:o.themes,diagnostics:[...s.diagnostics,...o.diagnostics]}}let i=this.themesOverride?this.themesOverride(r):r;this.themes=i.themes.map(s=>{let o=s.sourcePath;return s.sourceInfo=o?this.findSourceInfoForPath(o,this.extensionThemeSourceInfos,n)??s.sourceInfo??this.getDefaultSourceInfoForPath(o):s.sourceInfo,s}),this.themeDiagnostics=i.diagnostics}applyExtensionSourceInfo(e,n){for(let r of e){r.sourceInfo=this.findSourceInfoForPath(r.path,void 0,n)??this.getDefaultSourceInfoForPath(r.path);for(let i of r.commands.values())i.sourceInfo=r.sourceInfo;for(let i of r.tools.values())i.sourceInfo=r.sourceInfo}}findSourceInfoForPath(e,n,r){if(!e)return;if(e.startsWith("<"))return this.getDefaultSourceInfoForPath(e);let i=(0,Xs.resolve)(e);if(n)for(let[s,o]of n.entries()){let a=(0,Xs.resolve)(s);if(i===a||i.startsWith(`${a}${Xs.sep}`))return{...o,path:e}}if(r){let s=r.get(i)??r.get(e);if(s)return tV(e,s);for(let[o,a]of r.entries()){let c=(0,Xs.resolve)(o);if(i===c||i.startsWith(`${c}${Xs.sep}`))return tV(e,a)}}}getDefaultSourceInfoForPath(e){if(e.startsWith("<")&&e.endsWith(">"))return{path:e,source:e.slice(1,-1).split(":")[0]||"temporary",scope:"temporary",origin:"top-level"};let n=(0,Xs.resolve)(e),r=[(0,Xs.join)(this.agentDir,"skills"),(0,Xs.join)(this.agentDir,"prompts"),(0,Xs.join)(this.agentDir,"themes"),(0,Xs.join)(this.agentDir,"extensions")],i=[(0,Xs.join)(this.cwd,Bi,"skills"),(0,Xs.join)(this.cwd,Bi,"prompts"),(0,Xs.join)(this.cwd,Bi,"themes"),(0,Xs.join)(this.cwd,Bi,"extensions")];for(let s of r)if(this.isUnderPath(n,s))return{path:e,source:"local",scope:"user",origin:"top-level",baseDir:s};for(let s of i)if(this.isUnderPath(n,s))return{path:e,source:"local",scope:"project",origin:"top-level",baseDir:s};return{path:e,source:"local",scope:"temporary",origin:"top-level",baseDir:(0,Ec.statSync)(n).isDirectory()?n:(0,Xs.resolve)(n,"..")}}mergePaths(e,n){let r=[],i=new Set;for(let s of[...e,...n]){let o=this.resolveResourcePath(s),a=cd(o);i.has(a)||(i.add(a),r.push(o))}return r}resolveResourcePath(e){return Vn(e,this.cwd,{trim:!0})}loadThemes(e,n=!0){let r=[],i=[];if(n){let s=[(0,Xs.join)(this.agentDir,"themes"),(0,Xs.join)(this.cwd,Bi,"themes")];for(let o of s)this.loadThemesFromDir(o,r,i)}for(let s of e){let o=this.resolveResourcePath(s);if(!(0,Ec.existsSync)(o)){i.push({type:"warning",message:"theme path does not exist",path:o});continue}try{let a=(0,Ec.statSync)(o);a.isDirectory()?this.loadThemesFromDir(o,r,i):a.isFile()&&o.endsWith(".json")?this.loadThemeFromFile(o,r,i):i.push({type:"warning",message:"theme path is not a json file",path:o})}catch(a){let c=a instanceof Error?a.message:"failed to read theme path";i.push({type:"warning",message:c,path:o})}}return{themes:r,diagnostics:i}}loadThemesFromDir(e,n,r){if((0,Ec.existsSync)(e))try{let i=(0,Ec.readdirSync)(e,{withFileTypes:!0});for(let s of i){let o=s.isFile();if(s.isSymbolicLink())try{o=(0,Ec.statSync)((0,Xs.join)(e,s.name)).isFile()}catch{continue}o&&s.name.endsWith(".json")&&this.loadThemeFromFile((0,Xs.join)(e,s.name),n,r)}}catch(i){let s=i instanceof Error?i.message:"failed to read theme directory";r.push({type:"warning",message:s,path:e})}}loadThemeFromFile(e,n,r){try{n.push(bj(e))}catch(i){let s=i instanceof Error?i.message:"failed to load theme";r.push({type:"warning",message:s,path:e})}}async loadExtensionFactories(e){let n=[],r=[];for(let[i,s]of this.extensionFactories.entries()){let o=typeof s!="function",a=o?s.factory:s,c=``;try{let u=await Tpt(a,this.cwd,this.eventBus,e,c);u.hidden=o&&s.hidden,n.push(u)}catch(u){let l=u instanceof Error?u.message:"failed to load extension";r.push({path:c,error:l})}}return{extensions:n,errors:r}}dedupePrompts(e){let n=new Map,r=[];for(let i of e){let s=n.get(i.name);s?r.push({type:"collision",message:`name "/${i.name}" collision`,path:i.filePath,collision:{resourceType:"prompt",name:i.name,winnerPath:s.filePath,loserPath:i.filePath}}):n.set(i.name,i)}return{prompts:Array.from(n.values()),diagnostics:r}}dedupeThemes(e){let n=new Map,r=[];for(let i of e){let s=i.name??"unnamed",o=n.get(s);o?r.push({type:"collision",message:`name "${s}" collision`,path:i.sourcePath,collision:{resourceType:"theme",name:s,winnerPath:o.sourcePath??"",loserPath:i.sourcePath??""}}):n.set(s,i)}return{themes:Array.from(n.values()),diagnostics:r}}discoverSystemPromptFile(){let e=(0,Xs.join)(this.cwd,Bi,"SYSTEM.md");if(this.settingsManager.isProjectTrusted()&&(0,Ec.existsSync)(e))return e;let n=(0,Xs.join)(this.agentDir,"SYSTEM.md");if((0,Ec.existsSync)(n))return n}discoverAppendSystemPromptFile(){let e=(0,Xs.join)(this.cwd,Bi,"APPEND_SYSTEM.md");if(this.settingsManager.isProjectTrusted()&&(0,Ec.existsSync)(e))return e;let n=(0,Xs.join)(this.agentDir,"APPEND_SYSTEM.md");if((0,Ec.existsSync)(n))return n}isUnderPath(e,n){let r=(0,Xs.resolve)(n);if(e===r)return!0;let i=r.endsWith(Xs.sep)?r:`${r}${Xs.sep}`;return e.startsWith(i)}detectExtensionConflicts(e){let n=[],r=new Map,i=new Map;for(let s of e){for(let o of s.tools.keys()){let a=r.get(o);a&&a!==s.path?n.push({path:s.path,message:`Tool "${o}" conflicts with ${a}`}):r.set(o,s.path)}for(let o of s.flags.keys()){let a=i.get(o);a&&a!==s.path?n.push({path:s.path,message:`Flag "--${o}" conflicts with ${a}`}):i.set(o,s.path)}}return n}}});function Mhs(t){if(!(t<=1e4))return Math.max(1,Math.floor(Math.min(t*.9,t-1e4)))}function Ohs(t,e){let n=e?.cacheRetention??(vi("PI_CACHE_RETENTION",e?.env)==="long"?"long":"short");if(n==="none")return;let r=t.promptCache?.[n];return r===void 0?void 0:r*1e3}function Lhs(t,e){return!e?.reasoning||t.api!=="anthropic-messages"?!0:t.compat?.forceAdaptiveThinking===!0}function Fhs(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type==="message"&&n.message.role==="assistant"){let r=n.message.usage;return r.input+r.cacheRead+r.cacheWrite}}return 0}function d0t(t,e){let n={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0},...e};return $p(t,n).total}function Qhs(t){return t<0?`-$${Math.abs(t).toFixed(3)}`:`$${t.toFixed(3)}`}function Fnr(t){if(!t.economicsAvailable)return"cache economics unavailable";let e=Math.round(t.continuationProbability*100),n=t.phase==="streaming"?`${e}% continuation probability while agent is running`:`${e}% continuation probability`,r=t.action==="warm"?">=":"<";return`${n}, expected savings ${Qhs(t.expectedSavings)} ${r} $${Qnr.toFixed(3)}`}function Uhs(t,e){if(t===void 0||t<=e)return"Decision now";let n=Math.ceil((t-e)/1e3),r=Math.floor(n/3600);n%=3600;let i=Math.floor(n/60),s=n%60,o=[];return r>0&&o.push(`${r}h`),i>0&&o.push(`${i}m`),(s>0||o.length===0)&&o.push(`${s}s`),`Decision in ${o.join(" ")}`}function Unr(t,e=Date.now()){let n=t.decision;if(!n||t.state==="inactive"&&!n.economicsAvailable&&!t.extensionOverride)return`Inactive (${t.reason??"unknown reason"})`;let r=t.extensionOverride?`extension override, ${Fnr(n)}`:`${Fnr(n)} -> ${n.action}`;return t.state==="inactive"?`Stopped (${r})`:t.state==="refreshing"?`Warming cache (${r})`:`${Uhs(t.nextWarmAt,e)} (${r})`}function Gnr(t){let e=t.note?` (${t.note})`:"",n=t.usage.cost.total.toFixed(6).replace(/(\.\d{3}\d*?)0+$/,"$1");return`Cache warmed${e}: $${n}`}var Dhs,Lnr,Qnr,Phs,QDe,p0t=v(()=>{p();qo();cx();Dhs=60*6e4,Lnr=30*6e4,Qnr=.05,Phs=.15;QDe=class{run;inactive;models;sessionManager;getMode;decide;onWarmed;constructor(e,n,r,i=async s=>s.action){this.models=e,this.sessionManager=n,this.getMode=r,this.decide=i,this.inactive={state:"inactive",reason:"waiting for first request"}}get status(){if(this.getMode()==="off")return{state:"inactive",reason:"cache warming disabled"};let e=this.run;if(!e)return this.inactive;if(!e.isCurrent())return{state:"inactive",reason:"conversation context changed"};let n=this.evaluate(e),r=e.timer===void 0;return!n.economicsAvailable&&!r?{state:"inactive",reason:"cache economics unavailable"}:{state:r?"refreshing":"scheduled",nextWarmAt:e.nextWarmAt,decision:n,extensionOverride:e.extensionOverride}}start(e,n){if(this.clearRun(),this.getMode()==="off"){this.stop("cache warming disabled");return}if(!Lhs(e.model,e.options)){this.stop("request cannot be replayed safely");return}let i=Ohs(e.model,e.options);if(i===void 0){this.stop(e.options.cacheRetention==="none"?"request disabled prompt caching":"cache lifetime unavailable");return}let s=Mhs(i);if(s===void 0){this.stop("cache lifetime unavailable");return}this.run={...e,isCurrent:n,ttlMs:i,delayMs:s,refreshDeadlineAt:0,startedAt:Date.now(),controller:new AbortController,phase:"streaming",nextWarmAt:0,extensionOverride:!1},this.schedule(this.run)}onAgentSettled(){let e=this.run;if(!e)return;if(this.getMode()==="streaming"){this.stop("agent run settled");return}e.phase="idle";let n=e.startedAt+Lnr;(e.nextWarmAt>n||Date.now()>=n)&&this.stop("30-minute idle safety limit reached")}onModeChanged(){let e=this.run;if(!e)return;let n=this.getModeStopReason(e);n&&this.stop(n)}cancel(){this.stop("inactive")}clearRun(){let e=this.run;e&&(this.run=void 0,e.timer&&clearTimeout(e.timer),e.controller.abort())}stop(e,n){this.clearRun(),this.inactive={state:"inactive",reason:e,...n}}schedule(e){e.extensionOverride=!1,e.nextWarmAt=Date.now()+e.delayMs,e.refreshDeadlineAt=e.nextWarmAt+Math.floor((e.ttlMs-e.delayMs)/2);let n=e.startedAt+(e.phase==="idle"?Lnr:Dhs);if(e.nextWarmAt>n||Date.now()>=n){this.stop(e.phase==="idle"?"30-minute idle safety limit reached":"one-hour safety limit reached");return}e.timer=setTimeout(()=>{this.refresh(e)},Math.max(0,e.nextWarmAt-Date.now())),e.timer.unref?.()}async refresh(e){if(e.timer=void 0,!this.validateRun(e)||this.refreshDeadlineMissed(e))return;let n=this.evaluate(e),{warmCost:r,missCost:i,continuationProbability:s}=n,o=n.action;try{o=await this.decide({type:"cache_warming_decision",warmCost:r,missCost:i,continuationProbability:s,action:o})}catch{}if(!this.validateRun(e)||this.refreshDeadlineMissed(e))return;let a=o!==n.action;if(o==="stop"){let c=a?"stopped by extension":n.economicsAvailable?"expected savings below threshold":"cache economics unavailable";this.stop(c,{decision:n,extensionOverride:a});return}e.extensionOverride=a;try{let c=await this.models.streamSimple(e.model,e.context,{...e.options,maxTokens:1,maxRetries:0,signal:e.controller.signal}).result();if(!this.validateRun(e))return;if(c.stopReason!=="error"&&c.stopReason!=="aborted"){let u=this.sessionManager.appendUsage("cache_warm",c.provider,c.responseModel??c.model,c.usage,a?"extension override":void 0);this.onWarmed?.(u)}}catch{}this.run===e&&this.schedule(e)}refreshDeadlineMissed(e){return Date.now()<=e.refreshDeadlineAt?!1:(this.stop("cache refresh deadline missed"),!0)}validateRun(e){if(this.run!==e)return!1;let n=this.getModeStopReason(e)??(e.isCurrent()?void 0:"conversation context changed");return n?(this.stop(n),!1):!0}getModeStopReason(e){let n=this.getMode();if(n==="off")return"cache warming disabled";if(n==="streaming"&&e.phase==="idle")return"agent run settled"}evaluate(e){let n=e.model,r=Fhs(this.sessionManager.getBranch()),i=d0t(n,{cacheRead:r}),s=d0t(n,n.cost.cacheWrite>0?{cacheWrite:r}:{input:r}),o=d0t(n,{cacheRead:r,output:1}),a=Math.max(0,s-i),c=e.phase==="idle"?Phs:1,u=r>0&&(i>0||s>0),l=c*a-o;return{phase:e.phase,warmCost:o,missCost:a,continuationProbability:c,expectedSavings:l,economicsAvailable:u,action:l>=Qnr?"warm":"stop"}}}});function Ghs(t){return t?t==="1"||t.toLowerCase()==="true"||t.toLowerCase()==="yes":!1}function UDe(t,e=process.env.PI_TELEMETRY){return e!==void 0?Ghs(e):t.getEnableInstallTelemetry()}var m0t=v(()=>{p()});function GDe(t,e){try{return new URL(t).hostname===e}catch{return!1}}function Vhs(t){return t.provider==="openrouter"||t.baseUrl.includes($hs)}function Yhs(t){return t.provider==="nvidia"||GDe(t.baseUrl,Whs)}function zhs(t){return t.provider==="cloudflare-workers-ai"||t.provider==="cloudflare-ai-gateway"||GDe(t.baseUrl,Hhs)||GDe(t.baseUrl,qhs)}function Khs(t,e){if(UDe(e)){if(Vhs(t))return{"HTTP-Referer":"https://pi.dev","X-OpenRouter-Title":"pi","X-OpenRouter-Categories":"cli-agent"};if(Yhs(t))return{"X-BILLING-INVOKE-ORIGIN":"Pi"};if(zhs(t))return{"User-Agent":"pi-coding-agent"}}}function Jhs(t,e){if(e&&!(t.provider!=="opencode"&&t.provider!=="opencode-go"&&!GDe(t.baseUrl,jhs)))return{"x-opencode-session":e,"x-opencode-client":"pi"}}function $nr(t,e,n,...r){let i={...Jhs(t,n),...Khs(t,e)};for(let s of r)s&&Object.assign(i,s);return Object.keys(i).length>0?i:void 0}var $hs,Whs,Hhs,qhs,jhs,Wnr=v(()=>{p();m0t();$hs="openrouter.ai",Whs="integrate.api.nvidia.com",Hhs="api.cloudflare.com",qhs="gateway.ai.cloudflare.com",jhs="opencode.ai"});function h0t(t,e){let n=t.getSessionFile();if(!n)return;let r=t.getCwd();if(!(!r||(0,Hnr.existsSync)(r)))return{sessionFile:n,sessionCwd:r,fallbackCwd:e}}function Xhs(t){let e=t.sessionFile?` Session file: ${t.sessionFile}`:"";return`Stored session working directory does not exist: ${t.sessionCwd}${e} -Current working directory: ${t.fallbackCwd}`}function Hwe(t){return`cwd from session file does not exist +Current working directory: ${t.fallbackCwd}`}function $De(t){return`cwd from session file does not exist ${t.sessionCwd} continue in current cwd -${t.fallbackCwd}`}var YD=class extends Error{issue;constructor(e){super(KQs(e)),this.name="MissingSessionCwdError",this.issue=e}};function Vwe(t,e){let n=Aot(t,e);if(n)throw new YD(n)}p();var yot=require("node:path");function zQs(t,e){if(!e)return[];let n=[],r=t.getExtensions(),s=new Map;for(let o of r.extensions)for(let[a,c]of o.flags)s.set(a,{type:c.type});let i=[];for(let[o,a]of e){let c=s.get(o);if(!c){i.push(o);continue}if(c.type==="boolean"){r.runtime.flagValues.set(o,!0);continue}if(typeof a=="string"){r.runtime.flagValues.set(o,a);continue}n.push({type:"error",message:`Extension flag "--${o}" requires a value`})}return i.length>0&&n.push({type:"error",message:`Unknown option${i.length===1?"":"s"}: ${i.map(o=>`--${o}`).join(", ")}`}),n}async function CF(t){let e=jn(t.cwd),n=t.agentDir?jn(t.agentDir):ls(),r=t.modelRuntime??await Hh.create({authPath:(0,yot.join)(n,"auth.json"),modelsPath:(0,yot.join)(n,"models.json"),signal:t.modelRuntimeSignal}),s=t.settingsManager??El.create(e,n),i=new B0({...t.resourceLoaderOptions??{},cwd:e,agentDir:n,settingsManager:s});await i.reload(t.resourceLoaderReloadOptions);let o=[],a=i.getExtensions();for(let{name:c,config:u,extensionPath:l}of a.runtime.pendingProviderRegistrations)try{r.registerProvider(c,u)}catch(d){let h=d instanceof Error?d.message:String(d);o.push({type:"error",message:`Extension "${l}" error: ${h}`})}a.runtime.pendingProviderRegistrations=[];for(let{provider:c,extensionPath:u}of a.runtime.pendingNativeProviderRegistrations)try{r.registerNativeProvider(c)}catch(l){let d=l instanceof Error?l.message:String(l);o.push({type:"error",message:`Extension "${u}" error: ${d}`})}return a.runtime.pendingNativeProviderRegistrations=[],await r.refresh({allowNetwork:!1}),o.push(...zQs(i,t.extensionFlagValues)),{cwd:e,agentDir:n,modelRuntime:r,settingsManager:s,resourceLoader:i,diagnostics:o}}async function IF(t){return jwe({cwd:t.services.cwd,agentDir:t.services.agentDir,modelRuntime:t.services.modelRuntime,settingsManager:t.services.settingsManager,resourceLoader:t.services.resourceLoader,sessionManager:t.sessionManager,model:t.model,thinkingLevel:t.thinkingLevel,scopedModels:t.scopedModels,tools:t.tools,excludeTools:t.excludeTools,noTools:t.noTools,customTools:t.customTools,sessionStartEvent:t.sessionStartEvent})}var Zte=class extends Error{filePath;constructor(e){super(`File not found: ${e}`),this.name="SessionImportFileNotFoundError",this.filePath=e}};function JQs(t){return typeof t=="string"?t:t.filter(e=>e.type==="text"&&typeof e.text=="string").map(e=>e.text).join("")}var ene=class{rebindSession;beforeSessionInvalidate;_session;_services;createRuntime;_diagnostics;_modelFallbackMessage;constructor(e,n,r,s=[],i){this._session=e,this._services=n,this.createRuntime=r,this._diagnostics=s,this._modelFallbackMessage=i}get services(){return this._services}get session(){return this._session}get cwd(){return this._services.cwd}get diagnostics(){return this._diagnostics}get modelFallbackMessage(){return this._modelFallbackMessage}setRebindSession(e){this.rebindSession=e}setBeforeSessionInvalidate(e){this.beforeSessionInvalidate=e}async emitBeforeSwitch(e,n){let r=this.session.extensionRunner;return r.hasHandlers("session_before_switch")?{cancelled:(await r.emit({type:"session_before_switch",reason:e,targetSessionFile:n}))?.cancel===!0}:{cancelled:!1}}async emitBeforeFork(e,n){let r=this.session.extensionRunner;return r.hasHandlers("session_before_fork")?{cancelled:(await r.emit({type:"session_before_fork",entryId:e,...n}))?.cancel===!0}:{cancelled:!1}}async teardownCurrent(e,n){await this.session.abort(),await tee(this.session.extensionRunner,{type:"session_shutdown",reason:e,targetSessionFile:n}),this.beforeSessionInvalidate?.(),this.session.dispose()}apply(e){this._session=e.session,this._services=e.services,this._diagnostics=e.diagnostics,this._modelFallbackMessage=e.modelFallbackMessage}async finishSessionReplacement(e){this.rebindSession&&await this.rebindSession(this.session),e&&await e(this.session.createReplacedSessionContext())}async switchSession(e,n){let r=await this.emitBeforeSwitch("resume",e);if(r.cancelled)return r;let s=this.session.sessionFile,i=eo.open(e,void 0,n?.cwdOverride);return Vwe(i,this.cwd),await this.teardownCurrent("resume",i.getSessionFile()),this.apply(await this.createRuntime({cwd:i.getCwd(),agentDir:this.services.agentDir,sessionManager:i,sessionStartEvent:{type:"session_start",reason:"resume",previousSessionFile:s},projectTrustContext:n?.projectTrustContextFactory?.(i.getCwd())})),await this.finishSessionReplacement(n?.withSession),{cancelled:!1}}async newSession(e){let n=await this.emitBeforeSwitch("new");if(n.cancelled)return n;let r=this.session.sessionFile,s=this.session.sessionManager.getSessionDir(),i=this.session.sessionManager.isPersisted()?eo.create(this.cwd,s):eo.inMemory(this.cwd);return e?.parentSession&&i.newSession({parentSession:e.parentSession}),await this.teardownCurrent("new",i.getSessionFile()),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:i,sessionStartEvent:{type:"session_start",reason:"new",previousSessionFile:r}})),e?.setup&&(await e.setup(this.session.sessionManager),this.session.agent.state.messages=this.session.sessionManager.buildSessionContext().messages),await this.finishSessionReplacement(e?.withSession),{cancelled:!1}}async fork(e,n){let r=n?.position??"before";if((await this.emitBeforeFork(e,{position:r})).cancelled)return{cancelled:!0};let i,o,a=this.session.sessionManager.getEntry(e);if(!a)throw new Error("Invalid entry ID for forking");if(r==="at")i=a.id;else{if(a.type!=="message"||a.message.role!=="user")throw new Error("Invalid entry ID for forking");i=a.parentId,o=JQs(a.message.content)}let c=this.session.sessionFile;if(this.session.sessionManager.isPersisted()){let l=this.session.sessionFile;if(!l)throw new Error("Persisted session is missing a session file");let d=this.session.sessionManager.getSessionDir();if(!i){let f=eo.create(this.cwd,d);return f.newSession({parentSession:l}),await this.teardownCurrent("fork",f.getSessionFile()),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:f,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:c}})),await this.finishSessionReplacement(n?.withSession),{cancelled:!1,selectedText:o}}if(!(0,P0.existsSync)(l))throw new Error("This session has not been saved yet. Wait for the first assistant response before cloning or forking it.");let h=eo.open(l,d);if(!h.createBranchedSession(i))throw new Error("Failed to create forked session");return await this.teardownCurrent("fork",h.getSessionFile()),this.apply(await this.createRuntime({cwd:h.getCwd(),agentDir:this.services.agentDir,sessionManager:h,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:c}})),await this.finishSessionReplacement(n?.withSession),{cancelled:!1,selectedText:o}}let u=this.session.sessionManager;return await this.teardownCurrent("fork",u.getSessionFile()),i?u.createBranchedSession(i):u.newSession({parentSession:c}),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:u,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:c}})),await this.finishSessionReplacement(n?.withSession),{cancelled:!1,selectedText:o}}async importFromJsonl(e,n){let r=jn(e);if(!(0,P0.existsSync)(r))throw new Zte(r);let s=this.session.sessionManager.getSessionDir();(0,P0.existsSync)(s)||(0,P0.mkdirSync)(s,{recursive:!0});let i=(0,FT.join)(s,(0,FT.basename)(r)),o=(0,FT.resolve)(i)===r;if(!o){let{name:l,ext:d}=(0,FT.parse)(i),h=1;for(;(0,P0.existsSync)(i);)i=(0,FT.join)(s,`${l}-${h++}${d}`)}let a=await this.emitBeforeSwitch("resume",i);if(a.cancelled)return a;let c=this.session.sessionFile;o||(0,P0.copyFileSync)(r,i,P0.constants.COPYFILE_EXCL);let u=eo.open(i,s,n);return Vwe(u,this.cwd),await this.teardownCurrent("resume",u.getSessionFile()),this.apply(await this.createRuntime({cwd:u.getCwd(),agentDir:this.services.agentDir,sessionManager:u,sessionStartEvent:{type:"session_start",reason:"resume",previousSessionFile:c}})),await this.finishSessionReplacement(),{cancelled:!1}}async dispose(){await tee(this.session.extensionRunner,{type:"session_shutdown",reason:"quit"}),this.beforeSessionInvalidate?.(),this.session.dispose()}};async function Ywe(t,e){Vwe(e.sessionManager,e.cwd);let n=await t(e);return new ene(n.session,n.services,t,n.diagnostics,n.modelFallbackMessage)}nSe(pN);function XQs(){return ls()}async function jwe(t={}){let e=jn(t.cwd??t.sessionManager?.getCwd()??process.cwd()),n=t.agentDir?jn(t.agentDir):XQs(),r=t.resourceLoader,s=t.agentDir?(0,Eot.join)(n,"auth.json"):void 0,i=t.agentDir?(0,Eot.join)(n,"models.json"):void 0,o=t.modelRuntime??await Hh.create({authPath:s,modelsPath:i}),a=t.settingsManager??El.create(e,n),c=t.sessionManager??eo.create(e,a5(e,n));r||(r=new B0({cwd:e,agentDir:n,settingsManager:a}),await r.reload(),ap("resourceLoader.reload"));let u=c.buildSessionContext(),l=u.messages.length>0,d=c.getBranch().some(P=>P.type==="thinking_level_change"),h=t.model,m;if(!h&&l&&u.model){let P=o.getModel(u.model.provider,u.model.modelId);P&&o.hasConfiguredAuth(P.provider)&&(h=P),h||(m=`Could not restore model ${u.model.provider}/${u.model.modelId}`)}h||(h=(await ISn({scopedModels:[],isContinuing:l,defaultProvider:a.getDefaultProvider(),defaultModelId:a.getDefaultModel(),defaultThinkingLevel:a.getDefaultThinkingLevel(),modelThinkingLevels:a.getAllModelThinkingLevels(),modelRuntime:o})).model,h?m&&(m+=`. Using ${h.provider}/${h.id}`):m=n5());let f=t.thinkingLevel;if(f===void 0&&l&&(f=d?u.thinkingLevel:a.getDefaultThinkingLevel()??th),f===void 0&&h){let P=a.getModelThinkingLevel(h.provider,h.id);P&&(f=P)}f===void 0&&(f=a.getDefaultThinkingLevel()??th),h?f=uu(h,f):f="off";let g=["read","bash","edit","write"],A=a.getDefaultTools(),y=t.tools??(t.noTools==="all"?[]:void 0),b=t.excludeTools,S=b?new Set(b):void 0,C=(t.tools??(t.noTools?[]:A??g)).filter(P=>!S?.has(P)),I,x=P=>{let G=aT(P);return a.getBlockImages()?G.map($=>{if($.role==="user"||$.role==="toolResult"){let Q=$.content;if(Array.isArray(Q)&&Q.some(oe=>oe.type==="image")){let oe=Q.map(re=>re.type==="image"?{type:"text",text:"Image reading is disabled."}:re).filter((re,Z,q)=>!(re.type==="text"&&re.text==="Image reading is disabled."&&Z>0&&q[Z-1].type==="text"&&q[Z-1].text==="Image reading is disabled."));return{...$,content:oe}}}return $}):G},w={};I=new RZ({initialState:{systemPrompt:"",model:h,thinkingLevel:f,tools:[]},convertToLlm:x,streamFn:async(P,G,$)=>{let Q=a.getProviderRetrySettings(),H=a.getHttpIdleTimeoutMs(),oe=H===0?2147483647:H,re=$?.timeoutMs??Q.timeoutMs??oe,Z=$?.websocketConnectTimeoutMs??a.getWebSocketConnectTimeoutMs(),q=w.current;return o.streamSimple(P,G,{...$,timeoutMs:re,websocketConnectTimeoutMs:Z,maxRetries:$?.maxRetries??Q.maxRetries,maxRetryDelayMs:$?.maxRetryDelayMs??Q.maxRetryDelayMs,transformHeaders:async ce=>{let be=mPn(P,a,$?.sessionId,ce);return q?.hasHandlers("before_provider_headers")?q.emitBeforeProviderHeaders(be??{}):be??{}}})},onPayload:async(P,G)=>{let $=w.current;return $?.hasHandlers("before_provider_request")?$.emitBeforeProviderRequest(P):P},onResponse:async(P,G)=>{let $=w.current;$?.hasHandlers("after_provider_response")&&await $.emit({type:"after_provider_response",status:P.status,headers:P.headers})},sessionId:c.getSessionId(),transformContext:async P=>{let G=w.current;return G?G.emitContext(P):P},steeringMode:a.getSteeringMode(),followUpMode:a.getFollowUpMode(),transport:a.getTransport(),thinkingBudgets:a.getThinkingBudgets(),maxRetryDelayMs:a.getProviderRetrySettings().maxRetryDelayMs}),l?(I.state.messages=u.messages,d||c.appendThinkingLevelChange(f)):(h&&c.appendModelChange(h.provider,h.id),c.appendThinkingLevelChange(f));let R=new s4({agent:I,sessionManager:c,settingsManager:a,cwd:e,scopedModels:t.scopedModels,resourceLoader:r,customTools:t.customTools,modelRuntime:o,initialActiveToolNames:C,allowedToolNames:y,excludedToolNames:b,extensionRunnerRef:w,sessionStartEvent:t.sessionStartEvent}),N=r.getExtensions();return{session:R,extensionsResult:N,modelFallbackMessage:m}}p();var O0=require("node:fs"),yPn=require("node:os"),mb=require("node:path"),EPn=Gt(Iee(),1);var ZQs=["settings.json","extensions","skills","prompts","themes","SYSTEM.md","APPEND_SYSTEM.md"];function Kwe(t){return fu(jn(t))}function eUs(t,e){let n=Kwe(e);for(;;){let r=t[n];if(r===!0||r===!1)return{path:n,decision:r};let s=(0,mb.dirname)(n);if(s===n)return null;n=s}}function tUs(t){let e=Kwe(t),n=(0,mb.dirname)(e);return n===e?void 0:n}function zwe(t,e){let n=Kwe(t),r=[{label:"Trust",trusted:!0,updates:[{path:n,decision:!0}],savedPath:n}],s=tUs(t);return s!==void 0&&r.push({label:`Trust parent folder (${s})`,trusted:!0,updates:[{path:s,decision:!0},{path:n,decision:null}],savedPath:s}),e?.includeSessionOnly&&r.push({label:"Trust (this session only)",trusted:!0,updates:[]}),r.push({label:"Do not trust",trusted:!1,updates:[{path:n,decision:!1}],savedPath:n}),e?.includeSessionOnly&&r.push({label:"Do not trust (this session only)",trusted:!1,updates:[]}),r}function gPn(t){if(!(0,O0.existsSync)(t))return{};let e;try{e=JSON.parse(Mi((0,O0.readFileSync)(t,"utf-8")))}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`Failed to read trust store ${t}: ${s}`)}if(typeof e!="object"||e===null||Array.isArray(e))throw new Error(`Invalid trust store ${t}: expected an object`);let n={};for(let[r,s]of Object.entries(e)){if(s!==!0&&s!==!1&&s!==null)throw new Error(`Invalid trust store ${t}: value for ${JSON.stringify(r)} must be true, false, or null`);n[r]=s}return n}function nUs(t,e){let n={};for(let r of Object.keys(e).sort()){let s=e[r];(s===!0||s===!1||s===null)&&(n[r]=s)}(0,O0.mkdirSync)((0,mb.dirname)(t),{recursive:!0}),(0,O0.writeFileSync)(t,`${JSON.stringify(n,null,2)} -`,"utf-8")}function rUs(t){let e=(0,mb.dirname)(t);(0,O0.mkdirSync)(e,{recursive:!0});let n=10,r=20,s;for(let i=1;i<=n;i++)try{return EPn.default.lockSync(e,{realpath:!1,lockfilePath:`${t}.lock`})}catch(o){if((typeof o=="object"&&o!==null&&"code"in o?String(o.code):void 0)!=="ELOCKED"||i===n)throw o;s=o;let c=Date.now();for(;Date.now()-c(0,O0.existsSync)((0,mb.join)(s,i))))return!0;for(;;){let i=(0,mb.join)(r,".agents","skills");if(i!==n&&(0,O0.existsSync)(i))return!0;let o=(0,mb.dirname)(r);if(o===r)return!1;r=o}}var M0=class{trustPath;constructor(e){this.trustPath=(0,mb.join)(jn(e),"trust.json")}get(e){return this.getEntry(e)?.decision??null}getEntry(e){return APn(this.trustPath,()=>{let n=gPn(this.trustPath);return eUs(n,e)})}set(e,n){this.setMany([{path:e,decision:n}])}setMany(e){APn(this.trustPath,()=>{let n=gPn(this.trustPath);for(let{path:r,decision:s}of e){let i=Kwe(r);s===null?delete n[i]:n[i]=s}nUs(this.trustPath,n)})}};p();var CLn=require("node:readline");p();p();var xc=class extends Error{},sUs={check:`${An} auth check --provider [--json] [--credentials] [--no-refresh]`,api_key:`${An} auth print-api-key --provider [--model ]`,bearer_token:`${An} auth print-bearer-token --provider [--model ] [--min-expiry ]`};function bot(t){return t==="check"?"auth check":t==="api_key"?"auth print-api-key":"auth print-bearer-token"}function bPn(t){return sUs[t]}function _Pn(t){return t[0]==="auth"&&(t[1]===void 0||t[1]==="help"||t.includes("--help")||t.includes("-h"))}function SPn(){console.log(`Usage: +${t.fallbackCwd}`}function WDe(t,e){let n=h0t(t,e);if(n)throw new VP(n)}var Hnr,VP,HDe=v(()=>{p();Hnr=require("node:fs");VP=class extends Error{issue;constructor(e){super(Xhs(e)),this.name="MissingSessionCwdError",this.issue=e}}});function Zhs(t,e){if(!e)return[];let n=[],r=t.getExtensions(),i=new Map;for(let o of r.extensions)for(let[a,c]of o.flags)i.set(a,{type:c.type});let s=[];for(let[o,a]of e){let c=i.get(o);if(!c){s.push(o);continue}if(c.type==="boolean"){r.runtime.flagValues.set(o,!0);continue}if(typeof a=="string"){r.runtime.flagValues.set(o,a);continue}n.push({type:"error",message:`Extension flag "--${o}" requires a value`})}return s.length>0&&n.push({type:"error",message:`Unknown option${s.length===1?"":"s"}: ${s.map(o=>`--${o}`).join(", ")}`}),n}async function VU(t){let e=Vn(t.cwd),n=t.agentDir?Vn(t.agentDir):ii(),r=t.modelRuntime??await nf.create({authPath:(0,f0t.join)(n,"auth.json"),modelsPath:(0,f0t.join)(n,"models.json"),signal:t.modelRuntimeSignal}),i=t.settingsManager??lu.create(e,n),s=new NS({...t.resourceLoaderOptions??{},cwd:e,agentDir:n,settingsManager:i});await s.reload(t.resourceLoaderReloadOptions);let o=[],a=s.getExtensions();for(let{name:c,config:u,extensionPath:l}of a.runtime.pendingProviderRegistrations)try{r.registerProvider(c,u)}catch(d){let m=d instanceof Error?d.message:String(d);o.push({type:"error",message:`Extension "${l}" error: ${m}`})}a.runtime.pendingProviderRegistrations=[];for(let{provider:c,extensionPath:u}of a.runtime.pendingNativeProviderRegistrations)try{r.registerNativeProvider(c)}catch(l){let d=l instanceof Error?l.message:String(l);o.push({type:"error",message:`Extension "${u}" error: ${d}`})}return a.runtime.pendingNativeProviderRegistrations=[],await r.refresh({allowNetwork:!1}),o.push(...Zhs(s,t.extensionFlagValues)),{cwd:e,agentDir:n,modelRuntime:r,settingsManager:i,resourceLoader:s,diagnostics:o}}async function YU(t){return qDe({cwd:t.services.cwd,agentDir:t.services.agentDir,modelRuntime:t.services.modelRuntime,settingsManager:t.services.settingsManager,resourceLoader:t.services.resourceLoader,sessionManager:t.sessionManager,model:t.model,thinkingLevel:t.thinkingLevel,scopedModels:t.scopedModels,tools:t.tools,excludeTools:t.excludeTools,noTools:t.noTools,customTools:t.customTools,sessionStartEvent:t.sessionStartEvent})}var f0t,g0t=v(()=>{p();f0t=require("node:path");Qs();fc();lP();Oae();A0t();Ek()});function efs(t){return typeof t=="string"?t:t.filter(e=>e.type==="text"&&typeof e.text=="string").map(e=>e.text).join("")}async function jDe(t,e){WDe(e.sessionManager,e.cwd);let n=await t(e);return new Fae(n.session,n.services,t,n.diagnostics,n.modelFallbackMessage)}var DS,bk,Lae,Fae,VDe=v(()=>{p();DS=require("node:fs"),bk=require("node:path");fc();Bse();HDe();fw();g0t();Lae=class extends Error{filePath;constructor(e){super(`File not found: ${e}`),this.name="SessionImportFileNotFoundError",this.filePath=e}};Fae=class{rebindSession;beforeSessionInvalidate;_session;_services;createRuntime;_diagnostics;_modelFallbackMessage;constructor(e,n,r,i=[],s){this._session=e,this._services=n,this.createRuntime=r,this._diagnostics=i,this._modelFallbackMessage=s}get services(){return this._services}get session(){return this._session}get cwd(){return this._services.cwd}get diagnostics(){return this._diagnostics}get modelFallbackMessage(){return this._modelFallbackMessage}setRebindSession(e){this.rebindSession=e}setBeforeSessionInvalidate(e){this.beforeSessionInvalidate=e}async emitBeforeSwitch(e,n){let r=this.session.extensionRunner;return r.hasHandlers("session_before_switch")?{cancelled:(await r.emit({type:"session_before_switch",reason:e,targetSessionFile:n}))?.cancel===!0}:{cancelled:!1}}async emitBeforeFork(e,n){let r=this.session.extensionRunner;return r.hasHandlers("session_before_fork")?{cancelled:(await r.emit({type:"session_before_fork",entryId:e,...n}))?.cancel===!0}:{cancelled:!1}}async teardownCurrent(e,n){await this.session.abort(),await kse(this.session.extensionRunner,{type:"session_shutdown",reason:e,targetSessionFile:n}),this.beforeSessionInvalidate?.(),this.session.dispose()}apply(e){this._session=e.session,this._services=e.services,this._diagnostics=e.diagnostics,this._modelFallbackMessage=e.modelFallbackMessage}async finishSessionReplacement(e){this.rebindSession&&await this.rebindSession(this.session),e&&await e(this.session.createReplacedSessionContext())}async switchSession(e,n){let r=await this.emitBeforeSwitch("resume",e);if(r.cancelled)return r;let i=this.session.sessionFile,s=Js.open(e,void 0,n?.cwdOverride);return WDe(s,this.cwd),await this.teardownCurrent("resume",s.getSessionFile()),this.apply(await this.createRuntime({cwd:s.getCwd(),agentDir:this.services.agentDir,sessionManager:s,sessionStartEvent:{type:"session_start",reason:"resume",previousSessionFile:i},projectTrustContext:n?.projectTrustContextFactory?.(s.getCwd())})),await this.finishSessionReplacement(n?.withSession),{cancelled:!1}}async newSession(e){let n=await this.emitBeforeSwitch("new");if(n.cancelled)return n;let r=this.session.sessionFile,i=this.session.sessionManager.getSessionDir(),s=this.session.sessionManager.isPersisted()?Js.create(this.cwd,i):Js.inMemory(this.cwd);return e?.parentSession&&s.newSession({parentSession:e.parentSession}),await this.teardownCurrent("new",s.getSessionFile()),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:s,sessionStartEvent:{type:"session_start",reason:"new",previousSessionFile:r}})),e?.setup&&(await e.setup(this.session.sessionManager),this.session.refreshContext()),await this.finishSessionReplacement(e?.withSession),{cancelled:!1}}async fork(e,n){let r=n?.position??"before";if((await this.emitBeforeFork(e,{position:r})).cancelled)return{cancelled:!0};let s,o,a=this.session.sessionManager.getEntry(e);if(!a)throw new Error("Invalid entry ID for forking");if(r==="at")s=a.id;else{if(a.type!=="message"||a.message.role!=="user")throw new Error("Invalid entry ID for forking");s=a.parentId,o=efs(a.message.content)}let c=this.session.sessionFile;if(this.session.sessionManager.isPersisted()){let l=this.session.sessionFile;if(!l)throw new Error("Persisted session is missing a session file");let d=this.session.sessionManager.getSessionDir();if(!s){let f=Js.create(this.cwd,d);return f.newSession({parentSession:l}),await this.teardownCurrent("fork",f.getSessionFile()),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:f,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:c}})),await this.finishSessionReplacement(n?.withSession),{cancelled:!1,selectedText:o}}if(!(0,DS.existsSync)(l))throw new Error("This session has not been saved yet. Wait for the first assistant response before cloning or forking it.");let m=Js.open(l,d);if(!m.createBranchedSession(s))throw new Error("Failed to create forked session");return await this.teardownCurrent("fork",m.getSessionFile()),this.apply(await this.createRuntime({cwd:m.getCwd(),agentDir:this.services.agentDir,sessionManager:m,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:c}})),await this.finishSessionReplacement(n?.withSession),{cancelled:!1,selectedText:o}}let u=this.session.sessionManager;return await this.teardownCurrent("fork",u.getSessionFile()),s?u.createBranchedSession(s):u.newSession({parentSession:c}),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:u,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:c}})),await this.finishSessionReplacement(n?.withSession),{cancelled:!1,selectedText:o}}async importFromJsonl(e,n){let r=Vn(e);if(!(0,DS.existsSync)(r))throw new Lae(r);let i=this.session.sessionManager.getSessionDir();(0,DS.existsSync)(i)||(0,DS.mkdirSync)(i,{recursive:!0});let s=(0,bk.join)(i,(0,bk.basename)(r)),o=(0,bk.resolve)(s)===r;if(!o){let{name:l,ext:d}=(0,bk.parse)(s),m=1;for(;(0,DS.existsSync)(s);)s=(0,bk.join)(i,`${l}-${m++}${d}`)}let a=await this.emitBeforeSwitch("resume",s);if(a.cancelled)return a;let c=this.session.sessionFile;o||(0,DS.copyFileSync)(r,s,DS.constants.COPYFILE_EXCL);let u=Js.open(s,i,n);return WDe(u,this.cwd),await this.teardownCurrent("resume",u.getSessionFile()),this.apply(await this.createRuntime({cwd:u.getCwd(),agentDir:this.services.agentDir,sessionManager:u,sessionStartEvent:{type:"session_start",reason:"resume",previousSessionFile:c}})),await this.finishSessionReplacement(),{cancelled:!1}}async dispose(){await kse(this.session.extensionRunner,{type:"session_shutdown",reason:"quit"}),this.beforeSessionInvalidate?.(),this.session.dispose()}}});function tfs(){return ii()}async function qDe(t={}){let e=Vn(t.cwd??t.sessionManager?.getCwd()??process.cwd()),n=t.agentDir?Vn(t.agentDir):tfs(),r=t.resourceLoader,i=t.agentDir?(0,y0t.join)(n,"auth.json"):void 0,s=t.agentDir?(0,y0t.join)(n,"models.json"):void 0,o=t.modelRuntime??await nf.create({authPath:i,modelsPath:s}),a=t.settingsManager??lu.create(e,n),c=t.sessionManager??Js.create(e,AQ(e,n));r||(r=new NS({cwd:e,agentDir:n,settingsManager:a}),await r.reload(),om("resourceLoader.reload"));let u=c.buildSessionContext(),l=u.messages.length>0,d=c.getBranch().some(ce=>ce.type==="thinking_level_change"),m=t.model,h;if(!m&&l&&u.model){let ce=o.getModel(u.model.provider,u.model.modelId);ce&&o.hasConfiguredAuth(ce.provider)&&(m=ce),m||(h=`Could not restore model ${u.model.provider}/${u.model.modelId}`)}m||(m=(await Sjn({scopedModels:[],isContinuing:l,defaultProvider:a.getDefaultProvider(),defaultModelId:a.getDefaultModel(),defaultThinkingLevel:a.getDefaultThinkingLevel(),modelThinkingLevels:a.getAllModelThinkingLevels(),modelRuntime:o})).model,m?h&&(h+=`. Using ${m.provider}/${m.id}`):h=Hj());let f=t.thinkingLevel;if(f===void 0&&l&&(f=d?u.thinkingLevel:a.getDefaultThinkingLevel()??rh),f===void 0&&m){let ce=a.getModelThinkingLevel(m.provider,m.id);ce&&(f=ce)}f===void 0&&(f=a.getDefaultThinkingLevel()??rh),m?f=Wl(m,f):f="off";let g=["read","bash","edit","write"],A=a.getDefaultTools(),y=t.tools??(t.noTools==="all"?[]:void 0),E=t.excludeTools,_=E?new Set(E):void 0,S=(t.tools??(t.noTools?[]:A??g)).filter(ce=>!_?.has(ce)),C=ce=>{let Y=IE(ce);return a.getBlockImages()?Y.map(z=>{if(z.role==="user"||z.role==="toolResult"){let j=z.content;if(Array.isArray(j)&&j.some(Ae=>Ae.type==="image")){let Ae=j.map(De=>De.type==="image"?{type:"text",text:"Image reading is disabled."}:De).filter((De,Pe,we)=>!(De.type==="text"&&De.text==="Image reading is disabled."&&Pe>0&&we[Pe-1].type==="text"&&we[Pe-1].text==="Image reading is disabled."));return{...z,content:Ae}}}return z}):Y},I={},w=new QDe(o,c,()=>a.getCacheWarmingMode(),async ce=>I.current?.emitCacheWarmingDecision(ce)??ce.action),k=(ce,Y={})=>{let z=a.getProviderRetrySettings(),j=a.getHttpIdleTimeoutMs(),se=j===0?2147483647:j,Ae=I.current;return{...Y,timeoutMs:Y.timeoutMs??z.timeoutMs??se,websocketConnectTimeoutMs:Y.websocketConnectTimeoutMs??a.getWebSocketConnectTimeoutMs(),maxRetries:Y.maxRetries??z.maxRetries,maxRetryDelayMs:Y.maxRetryDelayMs??z.maxRetryDelayMs,transformHeaders:async De=>{let Pe=$nr(ce,a,Y.sessionId,De);return Ae?.hasHandlers("before_provider_headers")?Ae.emitBeforeProviderHeaders(Pe??{}):Pe??{}}}},N=ce=>{let Y=$.state.messages;return()=>{let z=$.state.model,j=$.state.messages;return z.provider===ce.provider&&z.id===ce.id&&Y.length<=j.length&&Y.every((se,Ae)=>j[Ae]===se)}},O=async ce=>{let Y=I.current;return Y?.hasHandlers("before_provider_request")?Y.emitBeforeProviderRequest(ce):ce},W=async ce=>{let Y=I.current;Y?.hasHandlers("after_provider_response")&&await Y.emit({type:"after_provider_response",status:ce.status,headers:ce.headers})},$=new Jie({initialState:{systemPrompt:"",model:m,thinkingLevel:f,tools:[],messages:u.messages},convertToLlm:C,streamFn:async(ce,Y,z)=>{let j=k(ce,z);return z?.sessionId===c.getSessionId()&&w.start({model:ce,context:Y,options:j},N(ce)),o.streamSimple(ce,Y,j)},onPayload:O,onResponse:W,sessionId:c.getSessionId(),transformContext:async ce=>{let Y=I.current;return Y?Y.emitContext(ce):ce},steeringMode:a.getSteeringMode(),followUpMode:a.getFollowUpMode(),transport:a.getTransport(),thinkingBudgets:a.getThinkingBudgets(),maxRetryDelayMs:a.getProviderRetrySettings().maxRetryDelayMs});l?d||c.appendThinkingLevelChange(f):(m&&c.appendModelChange(m.provider,m.id),c.appendThinkingLevelChange(f));let G=new ZV({agent:$,sessionManager:c,settingsManager:a,cwd:e,scopedModels:t.scopedModels,resourceLoader:r,customTools:t.customTools,modelRuntime:o,cacheWarmer:w,initialActiveToolNames:S,allowedToolNames:y,excludedToolNames:E,extensionRunnerRef:I,sessionStartEvent:t.sessionStartEvent}),q=r.getExtensions();return{session:G,extensionsResult:q,modelFallbackMessage:h}}var y0t,A0t=v(()=>{p();y0t=require("node:path");bpt();cR();Qs();fc();$1e();Rie();p0t();$ie();GR();eU();lP();Wnr();Oae();fw();Ek();jie();F1e();VDe();BRe(iD)});function YDe(t){return cd(Vn(t))}function rfs(t,e){let n=YDe(e);for(;;){let r=t[n];if(r===!0||r===!1)return{path:n,decision:r};let i=(0,e_.dirname)(n);if(i===n)return null;n=i}}function ifs(t){let e=YDe(t),n=(0,e_.dirname)(e);return n===e?void 0:n}function zDe(t,e){let n=YDe(t),r=[{label:"Trust",trusted:!0,updates:[{path:n,decision:!0}],savedPath:n}],i=ifs(t);return i!==void 0&&r.push({label:`Trust parent folder (${i})`,trusted:!0,updates:[{path:i,decision:!0},{path:n,decision:null}],savedPath:i}),e?.includeSessionOnly&&r.push({label:"Trust (this session only)",trusted:!0,updates:[]}),r.push({label:"Do not trust",trusted:!1,updates:[{path:n,decision:!1}],savedPath:n}),e?.includeSessionOnly&&r.push({label:"Do not trust (this session only)",trusted:!1,updates:[]}),r}function qnr(t){if(!(0,PS.existsSync)(t))return{};let e;try{e=JSON.parse(zs((0,PS.readFileSync)(t,"utf-8")))}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(`Failed to read trust store ${t}: ${i}`)}if(typeof e!="object"||e===null||Array.isArray(e))throw new Error(`Invalid trust store ${t}: expected an object`);let n={};for(let[r,i]of Object.entries(e)){if(i!==!0&&i!==!1&&i!==null)throw new Error(`Invalid trust store ${t}: value for ${JSON.stringify(r)} must be true, false, or null`);n[r]=i}return n}function sfs(t,e){let n={};for(let r of Object.keys(e).sort()){let i=e[r];(i===!0||i===!1||i===null)&&(n[r]=i)}(0,PS.mkdirSync)((0,e_.dirname)(t),{recursive:!0}),(0,PS.writeFileSync)(t,`${JSON.stringify(n,null,2)} +`,"utf-8")}function ofs(t){let e=(0,e_.dirname)(t);(0,PS.mkdirSync)(e,{recursive:!0});let n=10,r=20,i;for(let s=1;s<=n;s++)try{return Ynr.default.lockSync(e,{realpath:!1,lockfilePath:`${t}.lock`})}catch(o){if((typeof o=="object"&&o!==null&&"code"in o?String(o.code):void 0)!=="ELOCKED"||s===n)throw o;i=o;let c=Date.now();for(;Date.now()-c(0,PS.existsSync)((0,e_.join)(i,s))))return!0;for(;;){let s=(0,e_.join)(r,".agents","skills");if(s!==n&&(0,PS.existsSync)(s))return!0;let o=(0,e_.dirname)(r);if(o===r)return!1;r=o}}var PS,Vnr,e_,Ynr,nfs,MS,zU=v(()=>{p();PS=require("node:fs"),Vnr=require("node:os"),e_=require("node:path"),Ynr=Ot(Zse(),1);Qs();fc();nm();nfs=["settings.json","extensions","skills","prompts","themes","SYSTEM.md","APPEND_SYSTEM.md"];MS=class{trustPath;constructor(e){this.trustPath=(0,e_.join)(Vn(e),"trust.json")}get(e){return this.getEntry(e)?.decision??null}getEntry(e){return jnr(this.trustPath,()=>{let n=qnr(this.trustPath);return rfs(n,e)})}set(e,n){this.setMany([{path:e,decision:n}])}setMany(e){jnr(this.trustPath,()=>{let n=qnr(this.trustPath);for(let{path:r,decision:i}of e){let s=YDe(r);i===null?delete n[s]:n[s]=i}sfs(this.trustPath,n)})}}});function E0t(t){return t==="check"?"auth check":t==="api_key"?"auth print-api-key":"auth print-bearer-token"}function znr(t){return afs[t]}function Knr(t){return t[0]==="auth"&&(t[1]===void 0||t[1]==="help"||t.includes("--help")||t.includes("-h"))}function Jnr(){console.log(`Usage: pi auth print-api-key [--provider ] [--model ] pi auth print-bearer-token [--provider ] [--model ] [--min-expiry ] pi auth check [--provider ] [--model ] [--json] [--credentials] [--no-refresh] -Auth commands require at least one of --provider or --model. Checks refresh expired OAuth credentials by default; --no-refresh prevents this. --credentials emits the credential, or includes it in JSON output.`)}function CPn(t){if(t[0]!=="auth")return;let e=t[1]==="check"?"check":t[1]==="print-api-key"?"api_key":t[1]==="print-bearer-token"?"bearer_token":void 0;if(!e)throw new xc(`Unknown auth command "${t[1]??""}". Use "${An} auth print-api-key", "${An} auth print-bearer-token", or "${An} auth check".`);let n=[],r=!1,s=!1,i=!1,o;for(let a=2;a0){let s=t.unknownFlags.keys().next().value;throw new xc(`Unknown option --${s} for "${bot(e)}".`)}if(t.apiKey!==void 0||t.messages.length>0||t.fileArgs.length>0)throw new xc("Auth commands only accept --provider and --model");if(e==="check"){if(!n&&!r)throw new xc("Auth checks require --provider or --model ");return{provider:n,model:r}}if(!n&&!r)throw new xc("Credential printing requires --provider or --model ");return{provider:n,model:r}}function gV(t){if(t?.auth.apiKey)return t.auth.apiKey;let e=Object.entries(t?.auth.headers??{}).find(([n])=>n.toLowerCase()==="authorization")?.[1];return typeof e=="string"?/^Bearer\s+(.+)$/iu.exec(e)?.[1]:void 0}async function IPn(t,e,n={refresh:!1}){let{provider:r,model:s}=fV(t,"check"),i=r;if(s){let o=uI({cliProvider:r,cliModel:s,modelRuntime:e});if(o.error||!o.model)throw new xc(o.error??`Unable to resolve model "${s}"`);i=o.model.provider}if(!i)throw new xc("Unable to resolve an auth provider");if(e.getError())return{status:"invalid",provider:i,reason:"invalid_state"};if(!e.getProvider(i))return{status:"not_ready",provider:i,reason:"provider_not_found"};try{let o=await e.checkAuth(i);return o?n.refresh&&!await e.getAuth(i)?{status:"not_ready",provider:i,reason:"credentials_not_configured"}:{status:"ready",provider:i,authType:o.type}:{status:"not_ready",provider:i,reason:"credentials_not_configured"}}catch{return{status:"invalid",provider:i,reason:"invalid_state"}}}async function xPn(t,e,n,r){let s=await n.read(t);return!r.refresh&&s?.type==="oauth"?s.access:gV(await e.getAuth(t))}async function wPn(t){return Hh.create({credentials:t,modelsStore:new h4,allowModelNetwork:!1,refreshOnCreate:!1})}p();var iUs=30*6e4;async function TPn(t,e,n,r,s){let{provider:i,model:o}=fV(t,n),a=new Map((await e.listCredentials({signal:s})).map(l=>[l.providerId,l.type])),c=[];if(i){let l=e.getProvider(i);if(!l)throw new xc(`Unknown provider "${i}". Use --list-models to see available providers.`);if(o){let d=uI({cliProvider:l.id,cliModel:o,modelRuntime:e});if(d.error||!d.model)throw new xc(d.error??"Unable to resolve the requested provider/model");c.push({id:l.id,model:d.model})}else c.push({id:l.id})}else{for(let l of e.getProviders()){if(!a.has(l.id))continue;let d=uI({cliProvider:l.id,cliModel:o,modelRuntime:e});d.model&&!d.error&&!d.warning?.includes("Using custom model id")&&c.push({id:l.id,model:d.model})}if(c.length===0)throw new xc(`Model "${o}" not found. Use --list-models to see available models.`)}let u=[];for(let l of c){let d=a.get(l.id);if(n==="api_key"&&d==="oauth"||n==="bearer_token"&&d!=="oauth")continue;let h={...n==="bearer_token"?{minOAuthValidityMs:r??iUs}:{},signal:s},m=l.model?await e.getAuth(l.model,h):await e.getAuth(l.id,h),f=gV(m);f&&u.push({providerId:l.id,value:f})}if(u.length===1)return u[0].value;if(u.length===0){let l=c[0]?.id,d=l?a.get(l):void 0;throw i&&n==="api_key"&&d==="oauth"?new xc(`Provider "${l}" is configured with OAuth, not an API key`):i&&n==="bearer_token"&&d!=="oauth"?new xc(`Provider "${l}" is not configured with an OAuth bearer token`):new xc(`No usable ${n==="api_key"?"API key":"OAuth bearer token"} is configured`)}throw new xc(`Multiple configured providers matched (${u.map(({providerId:l})=>l).join(", ")}). Specify --provider.`)}p();var xF=require("node:fs/promises");var vPn=require("path");async function RPn(t,e){let n=e?.autoResizeImages??!0,r="",s=[];for(let i of t){let o=(0,vPn.resolve)(O_n(i,process.cwd()));try{await(0,xF.access)(o)}catch{console.error(en.red(`Error: File not found: ${o}`)),process.exit(1)}if((await(0,xF.stat)(o)).size===0)continue;let c=await e4(o);if(c){let u=await(0,xF.readFile)(o),l=await t5(u,c,{autoResizeImages:n});if(!l.ok){r+=`${l.message} -`;continue}let d={type:"image",mimeType:l.mimeType,data:l.data};s.push(d),l.hints.length>0?r+=`${l.hints.join(` +Auth commands require at least one of --provider or --model. Checks refresh expired OAuth credentials by default; --no-refresh prevents this. --credentials emits the credential, or includes it in JSON output.`)}function Xnr(t){if(t[0]!=="auth")return;let e=t[1]==="check"?"check":t[1]==="print-api-key"?"api_key":t[1]==="print-bearer-token"?"bearer_token":void 0;if(!e)throw new hl(`Unknown auth command "${t[1]??""}". Use "${hn} auth print-api-key", "${hn} auth print-bearer-token", or "${hn} auth check".`);let n=[],r=!1,i=!1,s=!1,o;for(let a=2;a0){let i=t.unknownFlags.keys().next().value;throw new hl(`Unknown option --${i} for "${E0t(e)}".`)}if(t.apiKey!==void 0||t.messages.length>0||t.fileArgs.length>0)throw new hl("Auth commands only accept --provider and --model");if(e==="check"){if(!n&&!r)throw new hl("Auth checks require --provider or --model ");return{provider:n,model:r}}if(!n&&!r)throw new hl("Credential printing requires --provider or --model ");return{provider:n,model:r}}function YP(t){if(t?.auth.apiKey)return t.auth.apiKey;let e=Object.entries(t?.auth.headers??{}).find(([n])=>n.toLowerCase()==="authorization")?.[1];return typeof e=="string"?/^Bearer\s+(.+)$/iu.exec(e)?.[1]:void 0}var hl,afs,p9=v(()=>{p();Qs();hl=class extends Error{},afs={check:`${hn} auth check --provider [--json] [--credentials] [--no-refresh]`,api_key:`${hn} auth print-api-key --provider [--model ]`,bearer_token:`${hn} auth print-bearer-token --provider [--model ] [--min-expiry ]`}});async function Znr(t,e,n={refresh:!1}){let{provider:r,model:i}=d9(t,"check"),s=r;if(i){let o=Rw({cliProvider:r,cliModel:i,modelRuntime:e});if(o.error||!o.model)throw new hl(o.error??`Unable to resolve model "${i}"`);s=o.model.provider}if(!s)throw new hl("Unable to resolve an auth provider");if(e.getError())return{status:"invalid",provider:s,reason:"invalid_state"};if(!e.getProvider(s))return{status:"not_ready",provider:s,reason:"provider_not_found"};try{let o=await e.checkAuth(s);return o?n.refresh&&!await e.getAuth(s)?{status:"not_ready",provider:s,reason:"credentials_not_configured"}:{status:"ready",provider:s,authType:o.type}:{status:"not_ready",provider:s,reason:"credentials_not_configured"}}catch{return{status:"invalid",provider:s,reason:"invalid_state"}}}async function err(t,e,n,r){let i=await n.read(t);return!r.refresh&&i?.type==="oauth"?i.access:YP(await e.getAuth(t))}async function trr(t){return nf.create({credentials:t,modelsStore:new aY,allowModelNetwork:!1,refreshOnCreate:!1})}var nrr=v(()=>{p();eU();lP();ght();p9()});async function rrr(t,e,n,r,i){let{provider:s,model:o}=d9(t,n),a=new Map((await e.listCredentials({signal:i})).map(l=>[l.providerId,l.type])),c=[];if(s){let l=e.getProvider(s);if(!l)throw new hl(`Unknown provider "${s}". Use --list-models to see available providers.`);if(o){let d=Rw({cliProvider:l.id,cliModel:o,modelRuntime:e});if(d.error||!d.model)throw new hl(d.error??"Unable to resolve the requested provider/model");c.push({id:l.id,model:d.model})}else c.push({id:l.id})}else{for(let l of e.getProviders()){if(!a.has(l.id))continue;let d=Rw({cliProvider:l.id,cliModel:o,modelRuntime:e});d.model&&!d.error&&!d.warning?.includes("Using custom model id")&&c.push({id:l.id,model:d.model})}if(c.length===0)throw new hl(`Model "${o}" not found. Use --list-models to see available models.`)}let u=[];for(let l of c){let d=a.get(l.id);if(n==="api_key"&&d==="oauth"||n==="bearer_token"&&d!=="oauth")continue;let m={...n==="bearer_token"?{minOAuthValidityMs:r??cfs}:{},signal:i},h=l.model?await e.getAuth(l.model,m):await e.getAuth(l.id,m),f=YP(h);f&&u.push({providerId:l.id,value:f})}if(u.length===1)return u[0].value;if(u.length===0){let l=c[0]?.id,d=l?a.get(l):void 0;throw s&&n==="api_key"&&d==="oauth"?new hl(`Provider "${l}" is configured with OAuth, not an API key`):s&&n==="bearer_token"&&d!=="oauth"?new hl(`Provider "${l}" is not configured with an OAuth bearer token`):new hl(`No usable ${n==="api_key"?"API key":"OAuth bearer token"} is configured`)}throw new hl(`Multiple configured providers matched (${u.map(({providerId:l})=>l).join(", ")}). Specify --provider.`)}var cfs,irr=v(()=>{p();eU();p9();cfs=30*6e4});async function orr(t,e){let n=e?.autoResizeImages??!0,r="",i=[];for(let s of t){let o=(0,srr.resolve)(B4n(s,process.cwd()));try{await(0,KU.access)(o)}catch{console.error(tn.red(`Error: File not found: ${o}`)),process.exit(1)}if((await(0,KU.stat)(o)).size===0)continue;let c=await zV(o);if(c){let u=await(0,KU.readFile)(o),l=await $D(u,c,{autoResizeImages:n});if(!l.ok){r+=`${l.message} +`;continue}let d={type:"image",mimeType:l.mimeType,data:l.data};i.push(d),l.hints.length>0?r+=`${l.hints.join(` `)} `:r+=` -`}else try{let u=Mi(await(0,xF.readFile)(o,"utf-8"));r+=` +`}else try{let u=zs(await(0,KU.readFile)(o,"utf-8"));r+=` ${u} -`}catch(u){let l=u instanceof Error?u.message:String(u);console.error(en.red(`Error: Could not read file ${o}: ${l}`)),process.exit(1)}}return{text:r,images:s}}p();function _ot({parsed:t,fileText:e,fileImages:n,stdinContent:r}){let s=[];return r!==void 0&&s.push(r),e&&s.push(e),t.messages.length>0&&(s.push(t.messages[0]),t.messages.shift()),{initialMessage:s.length>0?s.join(""):void 0,initialImages:n&&n.length>0?n:void 0}}p();function kPn(t){if(t>=1e6){let e=t/1e6;return e%1===0?`${e}M`:`${e.toFixed(1)}M`}if(t>=1e3){let e=t/1e3;return e%1===0?`${e}K`:`${e.toFixed(1)}K`}return t.toString()}async function NPn(t,e,n){let r=t.getError();r&&console.error(en.yellow(`Warning: errors loading models.json: -${r}`));let s=[...await t.getAvailable(void 0,{signal:n})];if(s.length===0){console.log(n5());return}let i=s;if(e&&(i=Wl(s,e,l=>`${l.provider} ${l.id}`)),i.length===0){console.log(`No models matching "${e}"`);return}i.sort((l,d)=>{let h=l.provider.localeCompare(d.provider);return h!==0?h:l.id.localeCompare(d.id)});let o=i.map(l=>({provider:l.provider,model:l.id,context:kPn(l.contextWindow),maxOut:kPn(l.maxTokens),thinking:l.reasoning?"yes":"no",images:l.input.includes("image")?"yes":"no"})),a={provider:"provider",model:"model",context:"context",maxOut:"max-out",thinking:"thinking",images:"images"},c={provider:Math.max(a.provider.length,...o.map(l=>l.provider.length)),model:Math.max(a.model.length,...o.map(l=>l.model.length)),context:Math.max(a.context.length,...o.map(l=>l.context.length)),maxOut:Math.max(a.maxOut.length,...o.map(l=>l.maxOut.length)),thinking:Math.max(a.thinking.length,...o.map(l=>l.thinking.length)),images:Math.max(a.images.length,...o.map(l=>l.images.length))},u=[a.provider.padEnd(c.provider),a.model.padEnd(c.model),a.context.padEnd(c.context),a.maxOut.padEnd(c.maxOut),a.thinking.padEnd(c.thinking),a.images.padEnd(c.images)].join(" ");console.log(u);for(let l of o){let d=[l.provider.padEnd(c.provider),l.model.padEnd(c.model),l.context.padEnd(c.context),l.maxOut.padEnd(c.maxOut),l.thinking.padEnd(c.thinking),l.images.padEnd(c.images)].join(" ");console.log(d)}}p();p();var OPn=require("fs");p();var Jwe=require("fs"),DPn=require("path");function oUs(t=process.platform,e=process.env){return t==="win32"||t==="linux"&&!!(e.WSL_DISTRO_NAME||e.WSL_INTEROP)}var KD=oUs(),BPn={...Zw,"tui.editor.undo":{...Zw["tui.editor.undo"],defaultKeys:process.platform==="win32"?"ctrl+z":KD?"alt+z":"ctrl+-"},"tui.altScreen.previousPrompt":{...Zw["tui.altScreen.previousPrompt"],defaultKeys:KD?"ctrl+up":["ctrl+shift+up","ctrl+up"]},"tui.altScreen.nextPrompt":{...Zw["tui.altScreen.nextPrompt"],defaultKeys:KD?"ctrl+down":["ctrl+shift+down","ctrl+down"]},"tui.altScreen.search":{...Zw["tui.altScreen.search"],defaultKeys:KD?"ctrl+f":"ctrl+shift+f"},"app.interrupt":{defaultKeys:"escape",description:"Cancel or abort"},"app.clear":{defaultKeys:"ctrl+c",description:"Clear editor"},"app.exit":{defaultKeys:"ctrl+d",description:"Exit when editor is empty"},"app.suspend":{defaultKeys:process.platform==="win32"?[]:"ctrl+z",description:"Suspend to background"},"app.thinking.cycle":{defaultKeys:"shift+tab",description:"Cycle thinking level"},"app.thinking.save":{defaultKeys:"ctrl+s",description:"Save thinking level"},"app.model.cycleForward":{defaultKeys:"ctrl+p",description:"Cycle to next model"},"app.model.cycleBackward":{defaultKeys:KD?"alt+p":"shift+ctrl+p",description:"Cycle to previous model"},"app.model.select":{defaultKeys:"ctrl+l",description:"Open model selector"},"app.tools.expand":{defaultKeys:"ctrl+o",description:"Toggle tool output"},"app.thinking.toggle":{defaultKeys:"ctrl+t",description:"Toggle thinking blocks"},"app.session.toggleNamedFilter":{defaultKeys:"ctrl+n",description:"Toggle named session filter"},"app.editor.external":{defaultKeys:"ctrl+g",description:"Open external editor"},"app.message.copy":{defaultKeys:"ctrl+x",description:"Copy message to clipboard"},"app.message.followUp":{defaultKeys:KD?"ctrl+q":"alt+enter",description:"Queue follow-up message"},"app.message.dequeue":{defaultKeys:KD?"alt+q":"alt+up",description:"Restore queued messages"},"app.clipboard.pasteImage":{defaultKeys:KD?"alt+v":"ctrl+v",description:"Paste image from clipboard (text fallback)"},"app.session.new":{defaultKeys:[],description:"Start a new session"},"app.session.tree":{defaultKeys:[],description:"Open session tree"},"app.session.fork":{defaultKeys:[],description:"Fork current session"},"app.session.resume":{defaultKeys:[],description:"Resume a session"},"app.tree.foldOrUp":{defaultKeys:process.platform==="darwin"?["alt+left","ctrl+left"]:["ctrl+left","alt+left"],description:"Fold tree branch or move up"},"app.tree.unfoldOrDown":{defaultKeys:process.platform==="darwin"?["alt+right","ctrl+right"]:["ctrl+right","alt+right"],description:"Unfold tree branch or move down"},"app.tree.editLabel":{defaultKeys:"shift+l",description:"Edit tree label"},"app.tree.toggleLabelTimestamp":{defaultKeys:"shift+t",description:"Toggle tree label timestamps"},"app.session.togglePath":{defaultKeys:"ctrl+p",description:"Toggle session path display"},"app.session.toggleSort":{defaultKeys:"ctrl+s",description:"Toggle session sort mode"},"app.session.rename":{defaultKeys:"ctrl+r",description:"Rename session"},"app.session.delete":{defaultKeys:"ctrl+d",description:"Delete session"},"app.session.deleteNoninvasive":{defaultKeys:"ctrl+backspace",description:"Delete session when query is empty"},"app.models.save":{defaultKeys:"ctrl+s",description:"Save model selection"},"app.models.enableAll":{defaultKeys:"ctrl+a",description:"Enable all models"},"app.models.clearAll":{defaultKeys:"ctrl+x",description:"Clear all models"},"app.models.toggleProvider":{defaultKeys:"ctrl+p",description:"Toggle all models for provider"},"app.models.reorderUp":{defaultKeys:"alt+up",description:"Move model up in order"},"app.models.reorderDown":{defaultKeys:"alt+down",description:"Move model down in order"},"app.tree.filter.default":{defaultKeys:"ctrl+d",description:"Tree filter: default view"},"app.tree.filter.noTools":{defaultKeys:"ctrl+t",description:"Tree filter: hide tool results"},"app.tree.filter.userOnly":{defaultKeys:"ctrl+u",description:"Tree filter: user messages only"},"app.tree.filter.labeledOnly":{defaultKeys:"ctrl+l",description:"Tree filter: labeled entries only"},"app.tree.filter.all":{defaultKeys:"ctrl+a",description:"Tree filter: show all entries"},"app.tree.filter.cycleForward":{defaultKeys:"ctrl+o",description:"Tree filter: cycle forward"},"app.tree.filter.cycleBackward":{defaultKeys:"shift+ctrl+o",description:"Tree filter: cycle backward"}},PPn={cursorUp:"tui.editor.cursorUp",cursorDown:"tui.editor.cursorDown",cursorLeft:"tui.editor.cursorLeft",cursorRight:"tui.editor.cursorRight",cursorWordLeft:"tui.editor.cursorWordLeft",cursorWordRight:"tui.editor.cursorWordRight",cursorLineStart:"tui.editor.cursorLineStart",cursorLineEnd:"tui.editor.cursorLineEnd",jumpForward:"tui.editor.jumpForward",jumpBackward:"tui.editor.jumpBackward",pageUp:"tui.editor.pageUp",pageDown:"tui.editor.pageDown",deleteCharBackward:"tui.editor.deleteCharBackward",deleteCharForward:"tui.editor.deleteCharForward",deleteWordBackward:"tui.editor.deleteWordBackward",deleteWordForward:"tui.editor.deleteWordForward",deleteToLineStart:"tui.editor.deleteToLineStart",deleteToLineEnd:"tui.editor.deleteToLineEnd",yank:"tui.editor.yank",yankPop:"tui.editor.yankPop",undo:"tui.editor.undo",newLine:"tui.input.newLine",submit:"tui.input.submit",tab:"tui.input.tab",copy:"tui.input.copy",selectUp:"tui.select.up",selectDown:"tui.select.down",selectPageUp:"tui.select.pageUp",selectPageDown:"tui.select.pageDown",selectConfirm:"tui.select.confirm",selectCancel:"tui.select.cancel",interrupt:"app.interrupt",clear:"app.clear",exit:"app.exit",suspend:"app.suspend",cycleThinkingLevel:"app.thinking.cycle",cycleModelForward:"app.model.cycleForward",cycleModelBackward:"app.model.cycleBackward",selectModel:"app.model.select",expandTools:"app.tools.expand",toggleThinking:"app.thinking.toggle",toggleSessionNamedFilter:"app.session.toggleNamedFilter",externalEditor:"app.editor.external",followUp:"app.message.followUp",dequeue:"app.message.dequeue",pasteImage:"app.clipboard.pasteImage",newSession:"app.session.new",tree:"app.session.tree",fork:"app.session.fork",resume:"app.session.resume",treeFoldOrUp:"app.tree.foldOrUp",treeUnfoldOrDown:"app.tree.unfoldOrDown",treeEditLabel:"app.tree.editLabel",treeToggleLabelTimestamp:"app.tree.toggleLabelTimestamp",toggleSessionPath:"app.session.togglePath",toggleSessionSort:"app.session.toggleSort",renameSession:"app.session.rename",deleteSession:"app.session.delete",deleteSessionNoninvasive:"app.session.deleteNoninvasive"};function aUs(t){return t in PPn}function cUs(t){let e={};for(let[n,r]of Object.entries(t)){if(typeof r=="string"){e[n]=r;continue}Array.isArray(r)&&r.every(s=>typeof s=="string")&&(e[n]=r)}return e}function Sot(t){let e={},n=!1;for(let[r,s]of Object.entries(t)){let i=aUs(r)?PPn[r]:r;if(i!==r&&(n=!0),r!==i&&Object.hasOwn(t,i)){n=!0;continue}e[i]=s}return{config:lUs(e),migrated:n}}function lUs(t){let e={};for(let r of Object.keys(BPn))Object.hasOwn(t,r)&&(e[r]=t[r]);let n=Object.keys(t).filter(r=>!Object.hasOwn(e,r)).sort();for(let r of n)e[r]=t[r];return e}function uUs(t){if((0,Jwe.existsSync)(t))try{let e=JSON.parse(Mi((0,Jwe.readFileSync)(t,"utf-8")));return typeof e!="object"||e===null?void 0:e}catch{return}}var RI=class t extends NM{configPath;constructor(e={},n){super(BPn,e),this.configPath=n}static create(e=ls()){let n=(0,DPn.join)(e,"keybindings.json"),r=t.loadFromFile(n);return new t(r,n)}reload(){this.configPath&&this.setUserBindings(t.loadFromFile(this.configPath))}getEffectiveConfig(){return this.getResolvedBindings()}static loadFromFile(e){let n=uUs(e);return n?cUs(Sot(n).config):{}}};p();p();var zD=class{intervalId;remainingSeconds;tui;onTick;onExpire;constructor(e,n,r,s){this.tui=n,this.onTick=r,this.onExpire=s,this.remainingSeconds=Math.ceil(e/1e3),this.onTick(this.remainingSeconds),this.intervalId=setInterval(()=>{this.remainingSeconds--,this.onTick(this.remainingSeconds),this.tui?.requestRender(),this.remainingSeconds<=0&&(this.dispose(),this.onExpire())},1e3)}dispose(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}};p();var Ln=class{color;constructor(e=n=>Se.fg("border",n)){this.color=e}invalidate(){}render(e){return[this.color("\u2500".repeat(Math.max(1,e)))]}};var QT=class extends _n{input;onSubmitCallback;onCancelCallback;titleText;baseTitle;countdown;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.input.focused=e}constructor(e,n,r,s,i){super(),this.onSubmitCallback=r,this.onCancelCallback=s,this.baseTitle=e,this.addChild(new Ln),this.addChild(new Nt(1)),this.titleText=new yt(Se.fg("accent",e),1,0),this.addChild(this.titleText),this.addChild(new Nt(1)),i?.timeout&&i.timeout>0&&i.tui&&(this.countdown=new zD(i.timeout,i.tui,o=>this.titleText.setText(Se.fg("accent",`${this.baseTitle} (${o}s)`)),()=>this.onCancelCallback())),this.input=new jo,this.addChild(this.input),this.addChild(new Nt(1)),this.addChild(new yt(`${er("tui.select.confirm","submit")} ${er("tui.select.cancel","cancel")}`,1,0)),this.addChild(new Nt(1)),this.addChild(new Ln)}handleInput(e){let n=ms();n.matches(e,"tui.select.confirm")||e===` -`?this.onSubmitCallback(this.input.getValue()):n.matches(e,"tui.select.cancel")?this.onCancelCallback():this.input.handleInput(e)}dispose(){this.countdown?.dispose()}};p();var L0=class extends _n{options;selectedIndex=0;listContainer;onSelectCallback;onCancelCallback;titleText;baseTitle;countdown;onToggleToolsExpanded;constructor(e,n,r,s,i){super(),this.options=n,this.onSelectCallback=r,this.onCancelCallback=s,this.onToggleToolsExpanded=i?.onToggleToolsExpanded,this.baseTitle=e,this.addChild(new Ln),this.addChild(new Nt(1)),this.titleText=new yt(Se.fg("accent",Se.bold(e)),1,0),this.addChild(this.titleText),this.addChild(new Nt(1)),i?.timeout&&i.timeout>0&&i.tui&&(this.countdown=new zD(i.timeout,i.tui,o=>this.titleText.setText(Se.fg("accent",Se.bold(`${this.baseTitle} (${o}s)`))),()=>this.onCancelCallback())),this.listContainer=new _n,this.addChild(this.listContainer),this.addChild(new Nt(1)),this.addChild(new yt(ml("\u2191\u2193","navigate")+" "+er("tui.select.confirm","select")+" "+er("tui.select.cancel","cancel"),1,0)),this.addChild(new Nt(1)),this.addChild(new Ln),this.updateList()}updateList(){this.listContainer.clear();for(let e=0;en.value===e.detectedTheme)),this.update()}update(){this.clear(),this.addChild(new Ln),this.addChild(new Nt(1)),this.addChild(new yt(Se.fg("accent",dUs.join(` -`)),1,0)),this.addChild(new Nt(1)),this.addChild(new yt(Se.fg("accent",Se.bold(`Welcome to ${An}, the minimal coding agent.`)),1,0)),this.addChild(new Nt(1)),this.step==="theme"?(this.addChild(new yt(Se.fg("text","Pick a theme."),1,0)),this.addChild(new yt(Se.fg("muted",`Detected system appearance: ${this.options.detectedTheme}`),1,0)),this.addChild(new Nt(1)),this.addOptionList(tne.map(e=>e.label),this.themeIndex)):(this.addChild(new yt(Se.fg("text","Opt-in to anonymous usage data sharing?"),1,0)),this.addChild(new yt(Se.fg("muted",`Opting in stores a tracking identifier in settings.json and enables anonymous +`}catch(u){let l=u instanceof Error?u.message:String(u);console.error(tn.red(`Error: Could not read file ${o}: ${l}`)),process.exit(1)}}return{text:r,images:i}}var KU,srr,arr=v(()=>{p();KU=require("node:fs/promises");gb();srr=require("path");ww();vie();Yse();nm()});function b0t({parsed:t,fileText:e,fileImages:n,stdinContent:r}){let i=[];return r!==void 0&&i.push(r),e&&i.push(e),t.messages.length>0&&(i.push(t.messages[0]),t.messages.shift()),{initialMessage:i.length>0?i.join(""):void 0,initialImages:n&&n.length>0?n:void 0}}var crr=v(()=>{p()});function lrr(t){if(t>=1e6){let e=t/1e6;return e%1===0?`${e}M`:`${e.toFixed(1)}M`}if(t>=1e3){let e=t/1e3;return e%1===0?`${e}K`:`${e.toFixed(1)}K`}return t.toString()}async function urr(t,e,n){let r=t.getError();r&&console.error(tn.yellow(`Warning: errors loading models.json: +${r}`));let i=[...await t.getAvailable(void 0,{signal:n})];if(i.length===0){console.log(Hj());return}let s=i;if(e&&(s=Pu(i,e,l=>`${l.provider} ${l.id}`)),s.length===0){console.log(`No models matching "${e}"`);return}s.sort((l,d)=>{let m=l.provider.localeCompare(d.provider);return m!==0?m:l.id.localeCompare(d.id)});let o=s.map(l=>({provider:l.provider,model:l.id,context:lrr(l.contextWindow),maxOut:lrr(l.maxTokens),thinking:l.reasoning?"yes":"no",images:l.input.includes("image")?"yes":"no"})),a={provider:"provider",model:"model",context:"context",maxOut:"max-out",thinking:"thinking",images:"images"},c={provider:Math.max(a.provider.length,...o.map(l=>l.provider.length)),model:Math.max(a.model.length,...o.map(l=>l.model.length)),context:Math.max(a.context.length,...o.map(l=>l.context.length)),maxOut:Math.max(a.maxOut.length,...o.map(l=>l.maxOut.length)),thinking:Math.max(a.thinking.length,...o.map(l=>l.thinking.length)),images:Math.max(a.images.length,...o.map(l=>l.images.length))},u=[a.provider.padEnd(c.provider),a.model.padEnd(c.model),a.context.padEnd(c.context),a.maxOut.padEnd(c.maxOut),a.thinking.padEnd(c.thinking),a.images.padEnd(c.images)].join(" ");console.log(u);for(let l of o){let d=[l.provider.padEnd(c.provider),l.model.padEnd(c.model),l.context.padEnd(c.context),l.maxOut.padEnd(c.maxOut),l.thinking.padEnd(c.thinking),l.images.padEnd(c.images)].join(" ");console.log(d)}}var drr=v(()=>{p();Tr();gb();Rie()});function KDe(){return process.env.PI_EXPERIMENTAL==="1"}var _0t=v(()=>{p()});function lfs(t=process.platform,e=process.env){return t==="win32"||t==="linux"&&!!(e.WSL_DISTRO_NAME||e.WSL_INTEROP)}function ufs(t){return t in hrr}function dfs(t){let e={};for(let[n,r]of Object.entries(t)){if(typeof r=="string"){e[n]=r;continue}Array.isArray(r)&&r.every(i=>typeof i=="string")&&(e[n]=r)}return e}function x0t(t){let e={},n=!1;for(let[r,i]of Object.entries(t)){let s=ufs(r)?hrr[r]:r;if(s!==r&&(n=!0),r!==s&&Object.hasOwn(t,s)){n=!0;continue}e[s]=i}return{config:pfs(e),migrated:n}}function pfs(t){let e={};for(let r of Object.keys(mrr))Object.hasOwn(t,r)&&(e[r]=t[r]);let n=Object.keys(t).filter(r=>!Object.hasOwn(e,r)).sort();for(let r of n)e[r]=t[r];return e}function mfs(t){if((0,JDe.existsSync)(t))try{let e=JSON.parse(zs((0,JDe.readFileSync)(t,"utf-8")));return typeof e!="object"||e===null?void 0:e}catch{return}}var JDe,prr,zP,mrr,hrr,Kw,m9=v(()=>{p();Tr();JDe=require("fs"),prr=require("path");Qs();nm();zP=lfs(),mrr={...BR,"tui.editor.undo":{...BR["tui.editor.undo"],defaultKeys:process.platform==="win32"?"ctrl+z":zP?"alt+z":"ctrl+-"},"tui.altScreen.previousPrompt":{...BR["tui.altScreen.previousPrompt"],defaultKeys:zP?"ctrl+up":["ctrl+shift+up","ctrl+up"]},"tui.altScreen.nextPrompt":{...BR["tui.altScreen.nextPrompt"],defaultKeys:zP?"ctrl+down":["ctrl+shift+down","ctrl+down"]},"tui.altScreen.search":{...BR["tui.altScreen.search"],defaultKeys:zP?"ctrl+f":"ctrl+shift+f"},"app.interrupt":{defaultKeys:"escape",description:"Cancel or abort"},"app.clear":{defaultKeys:"ctrl+c",description:"Clear editor"},"app.exit":{defaultKeys:"ctrl+d",description:"Exit when editor is empty"},"app.suspend":{defaultKeys:process.platform==="win32"?[]:"ctrl+z",description:"Suspend to background"},"app.thinking.cycle":{defaultKeys:"shift+tab",description:"Cycle thinking level"},"app.thinking.save":{defaultKeys:"ctrl+s",description:"Save thinking level"},"app.model.cycleForward":{defaultKeys:"ctrl+p",description:"Cycle to next model"},"app.model.cycleBackward":{defaultKeys:zP?"alt+p":"shift+ctrl+p",description:"Cycle to previous model"},"app.model.select":{defaultKeys:"ctrl+l",description:"Open model selector"},"app.tools.expand":{defaultKeys:"ctrl+o",description:"Toggle tool output"},"app.thinking.toggle":{defaultKeys:"ctrl+t",description:"Toggle thinking blocks"},"app.session.toggleNamedFilter":{defaultKeys:"ctrl+n",description:"Toggle named session filter"},"app.editor.external":{defaultKeys:"ctrl+g",description:"Open external editor"},"app.message.copy":{defaultKeys:"ctrl+x",description:"Copy selection or last assistant message"},"app.message.followUp":{defaultKeys:zP?"ctrl+q":"alt+enter",description:"Queue follow-up message"},"app.message.dequeue":{defaultKeys:zP?"alt+q":"alt+up",description:"Restore queued messages"},"app.clipboard.pasteImage":{defaultKeys:zP?"alt+v":"ctrl+v",description:"Paste image from clipboard (text fallback)"},"app.session.new":{defaultKeys:[],description:"Start a new session"},"app.session.tree":{defaultKeys:[],description:"Open session tree"},"app.session.fork":{defaultKeys:[],description:"Fork current session"},"app.session.resume":{defaultKeys:[],description:"Resume a session"},"app.tree.foldOrUp":{defaultKeys:process.platform==="darwin"?["alt+left","ctrl+left"]:["ctrl+left","alt+left"],description:"Fold tree branch or move up"},"app.tree.unfoldOrDown":{defaultKeys:process.platform==="darwin"?["alt+right","ctrl+right"]:["ctrl+right","alt+right"],description:"Unfold tree branch or move down"},"app.tree.editLabel":{defaultKeys:"shift+l",description:"Edit tree label"},"app.tree.toggleLabelTimestamp":{defaultKeys:"shift+t",description:"Toggle tree label timestamps"},"app.session.togglePath":{defaultKeys:"ctrl+p",description:"Toggle session path display"},"app.session.toggleSort":{defaultKeys:"ctrl+s",description:"Toggle session sort mode"},"app.session.rename":{defaultKeys:"ctrl+r",description:"Rename session"},"app.session.delete":{defaultKeys:"ctrl+d",description:"Delete session"},"app.session.deleteNoninvasive":{defaultKeys:"ctrl+backspace",description:"Delete session when query is empty"},"app.models.save":{defaultKeys:"ctrl+s",description:"Save model selection"},"app.models.enableAll":{defaultKeys:"ctrl+a",description:"Enable all models"},"app.models.clearAll":{defaultKeys:"ctrl+x",description:"Clear all models"},"app.models.toggleProvider":{defaultKeys:"ctrl+p",description:"Toggle all models for provider"},"app.models.reorderUp":{defaultKeys:"alt+up",description:"Move model up in order"},"app.models.reorderDown":{defaultKeys:"alt+down",description:"Move model down in order"},"app.tree.filter.default":{defaultKeys:"ctrl+d",description:"Tree filter: default view"},"app.tree.filter.noTools":{defaultKeys:"ctrl+t",description:"Tree filter: hide tool results"},"app.tree.filter.userOnly":{defaultKeys:"ctrl+u",description:"Tree filter: user messages only"},"app.tree.filter.labeledOnly":{defaultKeys:"ctrl+l",description:"Tree filter: labeled entries only"},"app.tree.filter.all":{defaultKeys:"ctrl+a",description:"Tree filter: show all entries"},"app.tree.filter.cycleForward":{defaultKeys:"ctrl+o",description:"Tree filter: cycle forward"},"app.tree.filter.cycleBackward":{defaultKeys:"shift+ctrl+o",description:"Tree filter: cycle backward"}},hrr={cursorUp:"tui.editor.cursorUp",cursorDown:"tui.editor.cursorDown",cursorLeft:"tui.editor.cursorLeft",cursorRight:"tui.editor.cursorRight",cursorWordLeft:"tui.editor.cursorWordLeft",cursorWordRight:"tui.editor.cursorWordRight",cursorLineStart:"tui.editor.cursorLineStart",cursorLineEnd:"tui.editor.cursorLineEnd",jumpForward:"tui.editor.jumpForward",jumpBackward:"tui.editor.jumpBackward",pageUp:"tui.editor.pageUp",pageDown:"tui.editor.pageDown",deleteCharBackward:"tui.editor.deleteCharBackward",deleteCharForward:"tui.editor.deleteCharForward",deleteWordBackward:"tui.editor.deleteWordBackward",deleteWordForward:"tui.editor.deleteWordForward",deleteToLineStart:"tui.editor.deleteToLineStart",deleteToLineEnd:"tui.editor.deleteToLineEnd",yank:"tui.editor.yank",yankPop:"tui.editor.yankPop",undo:"tui.editor.undo",newLine:"tui.input.newLine",submit:"tui.input.submit",tab:"tui.input.tab",copy:"tui.input.copy",selectUp:"tui.select.up",selectDown:"tui.select.down",selectPageUp:"tui.select.pageUp",selectPageDown:"tui.select.pageDown",selectConfirm:"tui.select.confirm",selectCancel:"tui.select.cancel",interrupt:"app.interrupt",clear:"app.clear",exit:"app.exit",suspend:"app.suspend",cycleThinkingLevel:"app.thinking.cycle",cycleModelForward:"app.model.cycleForward",cycleModelBackward:"app.model.cycleBackward",selectModel:"app.model.select",expandTools:"app.tools.expand",toggleThinking:"app.thinking.toggle",toggleSessionNamedFilter:"app.session.toggleNamedFilter",externalEditor:"app.editor.external",followUp:"app.message.followUp",dequeue:"app.message.dequeue",pasteImage:"app.clipboard.pasteImage",newSession:"app.session.new",tree:"app.session.tree",fork:"app.session.fork",resume:"app.session.resume",treeFoldOrUp:"app.tree.foldOrUp",treeUnfoldOrDown:"app.tree.unfoldOrDown",treeEditLabel:"app.tree.editLabel",treeToggleLabelTimestamp:"app.tree.toggleLabelTimestamp",toggleSessionPath:"app.session.togglePath",toggleSessionSort:"app.session.toggleSort",renameSession:"app.session.rename",deleteSession:"app.session.delete",deleteSessionNoninvasive:"app.session.deleteNoninvasive"};Kw=class t extends jF{configPath;constructor(e={},n){super(mrr,e),this.configPath=n}static create(e=ii()){let n=(0,prr.join)(e,"keybindings.json"),r=t.loadFromFile(n);return new t(r,n)}reload(){this.configPath&&this.setUserBindings(t.loadFromFile(this.configPath))}getEffectiveConfig(){return this.getResolvedBindings()}static loadFromFile(e){let n=mfs(e);return n?dfs(x0t(n).config):{}}}});var KP,XDe=v(()=>{p();KP=class{intervalId;remainingSeconds;tui;onTick;onExpire;constructor(e,n,r,i){this.tui=n,this.onTick=r,this.onExpire=i,this.remainingSeconds=Math.ceil(e/1e3),this.onTick(this.remainingSeconds),this.intervalId=setInterval(()=>{this.remainingSeconds--,this.onTick(this.remainingSeconds),this.tui?.requestRender(),this.remainingSeconds<=0&&(this.dispose(),this.onExpire())},1e3)}dispose(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}}});var Un,Ll=v(()=>{p();pi();Un=class{color;constructor(e=n=>Ee.fg("border",n)){this.color=e}invalidate(){}render(e){return[this.color("\u2500".repeat(Math.max(1,e)))]}}});var _k,ZDe=v(()=>{p();Tr();pi();XDe();Ll();ha();_k=class extends gn{input;onSubmitCallback;onCancelCallback;titleText;baseTitle;countdown;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.input.focused=e}constructor(e,n,r,i,s){super(),this.onSubmitCallback=r,this.onCancelCallback=i,this.baseTitle=e,this.addChild(new Un),this.addChild(new Tt(1)),this.titleText=new Et(Ee.fg("accent",e),1,0),this.addChild(this.titleText),s?.description&&(this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("text",s.description),1,0))),this.addChild(new Tt(1)),s?.timeout&&s.timeout>0&&s.tui&&(this.countdown=new KP(s.timeout,s.tui,o=>this.titleText.setText(Ee.fg("accent",`${this.baseTitle} (${o}s)`)),()=>this.onCancelCallback())),this.input=new ma,s?.initialValue&&this.input.setValue(s.initialValue),this.addChild(this.input),this.addChild(new Tt(1)),this.addChild(new Et(`${nr("tui.select.confirm","submit")} ${nr("tui.select.cancel","cancel")}`,1,0)),this.addChild(new Tt(1)),this.addChild(new Un)}handleInput(e){let n=Ai();n.matches(e,"tui.select.confirm")||e===` +`?this.onSubmitCallback(this.input.getValue()):n.matches(e,"tui.select.cancel")?this.onCancelCallback():this.input.handleInput(e)}dispose(){this.countdown?.dispose()}}});var WE,Qae=v(()=>{p();Tr();pi();XDe();Ll();ha();WE=class extends gn{options;selectedIndex=0;listContainer;onSelectCallback;onCancelCallback;titleText;baseTitle;countdown;onToggleToolsExpanded;constructor(e,n,r,i,s){super(),this.options=n,this.onSelectCallback=r,this.onCancelCallback=i,this.onToggleToolsExpanded=s?.onToggleToolsExpanded,this.baseTitle=e,this.addChild(new Un),this.addChild(new Tt(1)),this.titleText=new Et(Ee.fg("accent",Ee.bold(e)),1,0),this.addChild(this.titleText),s?.description&&(this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("text",s.description),1,0))),this.addChild(new Tt(1)),s?.timeout&&s.timeout>0&&s.tui&&(this.countdown=new KP(s.timeout,s.tui,o=>this.titleText.setText(Ee.fg("accent",Ee.bold(`${this.baseTitle} (${o}s)`))),()=>this.onCancelCallback())),this.listContainer=new gn,this.addChild(this.listContainer),this.addChild(new Tt(1)),this.addChild(new Et(iu("\u2191\u2193","navigate")+" "+nr("tui.select.confirm","select")+" "+nr("tui.select.cancel","cancel"),1,0)),this.addChild(new Tt(1)),this.addChild(new Un),this.updateList()}updateList(){this.listContainer.clear();for(let e=0;e{p();Tr();Qs();pi();Ll();ha();Uae=[{value:"dark",label:"Dark"},{value:"light",label:"Light"}],S0t=[{value:!0,label:"Share anonymous usage data"},{value:!1,label:"Don't share"}],hfs=["\u2588\u2588\u2588\u2588\u2588\u2588","\u2588\u2588 \u2588\u2588","\u2588\u2588\u2588\u2588 \u2588\u2588","\u2588\u2588 \u2588\u2588"],Gae=class extends gn{step="theme";themeIndex;analyticsIndex=0;options;constructor(e){super(),this.options=e,this.themeIndex=Math.max(0,Uae.findIndex(n=>n.value===e.detectedTheme)),this.update()}update(){this.clear(),this.addChild(new Un),this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("accent",hfs.join(` +`)),1,0)),this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("accent",Ee.bold(`Welcome to ${hn}, the minimal coding agent.`)),1,0)),this.addChild(new Tt(1)),this.step==="theme"?(this.addChild(new Et(Ee.fg("text","Pick a theme."),1,0)),this.addChild(new Et(Ee.fg("muted",`Detected system appearance: ${this.options.detectedTheme}`),1,0)),this.addChild(new Tt(1)),this.addOptionList(Uae.map(e=>e.label),this.themeIndex)):(this.addChild(new Et(Ee.fg("text","Opt-in to anonymous usage data sharing?"),1,0)),this.addChild(new Et(Ee.fg("muted",`Opting in stores a tracking identifier in settings.json and enables anonymous usage analytics. This helps us to better debug, reproduce, and resolve issues and bugs within Pi. You can observe what is shared using /privacy and make -changes anytime in settings.json.`),1,0)),this.addChild(new Nt(1)),this.addOptionList(Cot.map(e=>e.label),this.analyticsIndex)),this.addChild(new Nt(1)),this.addChild(new yt(ml("\u2191\u2193","navigate")+" "+er("tui.select.confirm",this.step==="theme"?"continue":"finish")+" "+er("tui.select.cancel","skip setup"),1,0)),this.addChild(new Nt(1)),this.addChild(new Ln)}addOptionList(e,n){for(let r=0;r"skip");return gUs(r.themes)}async function rne(t){zw(t.getTerminalCapabilityOverrides()),PH(await AUs(t));let e=BH().theme;KC(DH(t.getThemeSetting(),e)??e),kN(RI.create());let n=new JA(new YC,t.getShowHardwareCursor(),ls());return n.setClearOnShrink(t.getClearOnShrink()),n}function Xwe(t,e){t.start(),yUs(t,e)}async function yUs(t,e){let n=e.getThemeSetting();if(n&&!rT(n))return;let r=await MX({ui:t,timeoutMs:100});qM(DH(n,r)??r),t.invalidate(),t.requestRender()}async function Iot(t){t.clear(),t.requestRender(),await new Promise(e=>setTimeout(e,25))}function MPn(t=frn()){return!fUs({packageName:TN,appName:An,configDirName:ws})||!cee()||process.env[iX]?!1:!(0,OPn.existsSync)(t)}async function sne(t,e,n){let r=await rne(t);return new Promise(s=>{let i=!1,o=async c=>{i||(i=!0,await Iot(r),r.stop(),s(c))},a=new L0(e,n.map(c=>c.label),c=>{o(n.find(u=>u.label===c)?.value)},()=>{o(void 0)},{tui:r});r.addChild(a),r.setFocus(a),Xwe(r,t)})}async function LPn(t){let e=await rne(t);return new Promise(n=>{let r=!1,s=async o=>{r||(r=!0,o&&(t.setTheme(o.theme),t.setEnableAnalytics(o.shareAnalytics),await t.flush()),await Iot(e),e.stop(),n())};(async()=>{e.start();let o=await MX({ui:e,timeoutMs:100});qM(o);let a=new nne({detectedTheme:o,onThemePreview:c=>{qM(c),e.requestRender()},onSubmit:c=>{s(c)},onCancel:()=>{s(void 0)}});e.addChild(a),e.setFocus(a),e.requestRender()})()})}async function FPn(t,e,n){let r=await rne(t);return new Promise(s=>{let i=!1,o=async c=>{i||(i=!0,a.dispose(),await Iot(r),r.stop(),s(c))},a=new QT(e,n,c=>{o(c)},()=>{o(void 0)},{tui:r});r.addChild(a),r.setFocus(a),Xwe(r,t)})}function Zwe(t){return{cwd:t.cwd,mode:t.mode==="interactive"?"tui":t.mode,hasUI:t.hasUI,ui:{select:async(e,n)=>{if(t.hasUI&&t.mode==="interactive")return sne(t.settingsManager,e,n.map(r=>({label:r,value:r})))},confirm:async(e,n)=>!t.hasUI||t.mode!=="interactive"?!1:await sne(t.settingsManager,`${e} -${n}`,[{label:"Yes",value:!0},{label:"No",value:!1}])??!1,input:async(e,n)=>{if(t.hasUI&&t.mode==="interactive")return FPn(t.settingsManager,e,n)},notify:(e,n="info")=>{if(t.mode!=="interactive"){let r=n==="error"?en.red:n==="warning"?en.yellow:en.cyan;console.error(r(e))}}}}}p();p();var WPn=require("node:child_process"),qPn=require("node:fs"),HPn=require("node:fs/promises"),VPn=Gt(require("node:os"),1);p();function QPn(t){return t.toLowerCase().replace(/\s+/g," ").trim()}function EUs(t){return`${t.id} ${t.name??""} ${t.allMessagesText} ${t.cwd}`}function xot(t){return!!t.name?.trim()}function bUs(t,e){return e==="all"?!0:xot(t)}function _Us(t){let e=t.trim();if(!e)return{mode:"tokens",tokens:[],regex:null};if(e.startsWith("re:")){let a=e.slice(3).trim();if(!a)return{mode:"regex",tokens:[],regex:null,error:"Empty regex"};try{return{mode:"regex",tokens:[],regex:new RegExp(a,"i")}}catch(c){let u=c instanceof Error?c.message:String(c);return{mode:"regex",tokens:[],regex:null,error:u}}}let n=[],r="",s=!1,i=!1,o=a=>{let c=r.trim();r="",c&&n.push({kind:a,value:c})};for(let a=0;aa.trim()).filter(a=>a.length>0).map(a=>({kind:"fuzzy",value:a})),regex:null}:(o(s?"phrase":"fuzzy"),{mode:"tokens",tokens:n,regex:null})}function UPn(t,e){let n=EUs(t);if(e.mode==="regex"){if(!e.regex)return{matches:!1,score:0};let i=n.search(e.regex);return i<0?{matches:!1,score:0}:{matches:!0,score:i*.1}}if(e.tokens.length===0)return{matches:!0,score:0};let r=0,s=null;for(let i of e.tokens){if(i.kind==="phrase"){s===null&&(s=QPn(n));let a=QPn(i.value);if(!a)continue;let c=s.indexOf(a);if(c<0)return{matches:!1,score:0};r+=c*.1;continue}let o=dX(i.value,n);if(!o.matches)return{matches:!1,score:0};r+=o.score}return{matches:!0,score:r}}function $Pn(t,e,n,r="all"){let s=r==="all"?t:t.filter(c=>bUs(c,r));if(!e.trim())return s;let o=_Us(e);if(o.error)return[];if(n==="recent"){let c=[];for(let u of s)UPn(u,o).matches&&c.push(u);return c}let a=[];for(let c of s){let u=UPn(c,o);u.matches&&a.push({session:c,score:u.score})}return a.sort((c,u)=>c.score!==u.score?c.score-u.score:u.session.modified.getTime()-c.session.modified.getTime()),a.map(c=>c.session)}function GPn(t){let e=VPn.homedir();return t&&(t.startsWith(e)?`~${t.slice(e.length)}`:t)}function SUs(t){let n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4),s=Math.floor(n/36e5),i=Math.floor(n/864e5);return r<1?"now":r<60?`${r}m`:s<24?`${s}h`:i<7?`${i}d`:i<30?`${Math.floor(i/7)}w`:i<365?`${Math.floor(i/30)}mo`:`${Math.floor(i/365)}y`}function ine(t){return t&&fu(t)}var wot=class{scope;sortMode;nameFilter;requestRender;loading=!1;loadProgress=null;showPath=!1;confirmingDeletePath=null;statusMessage=null;statusTimeout=null;showRenameHint=!1;constructor(e,n,r,s){this.scope=e,this.sortMode=n,this.nameFilter=r,this.requestRender=s}setScope(e){this.scope=e}setSortMode(e){this.sortMode=e}setNameFilter(e){this.nameFilter=e}setLoading(e){this.loading=e,this.loadProgress=null}setProgress(e,n){this.loadProgress={loaded:e,total:n}}setShowPath(e){this.showPath=e}setShowRenameHint(e){this.showRenameHint=e}setConfirmingDeletePath(e){this.confirmingDeletePath=e}clearStatusTimeout(){this.statusTimeout&&(clearTimeout(this.statusTimeout),this.statusTimeout=null)}setStatusMessage(e,n){this.clearStatusTimeout(),this.statusMessage=e,!(!e||!n)&&(this.statusTimeout=setTimeout(()=>{this.statusMessage=null,this.statusTimeout=null,this.requestRender()},n))}invalidate(){}render(e){let n=this.scope==="current"?"Resume Session (Current Folder)":"Resume Session (All)",r=Se.bold(n),s=this.sortMode==="threaded"?"Threaded":this.sortMode==="recent"?"Recent":"Fuzzy",i=Se.fg("muted","Sort: ")+Se.fg("accent",s),o=this.nameFilter==="all"?"All":"Named",a=Se.fg("muted","Name: ")+Se.fg("accent",o),c;if(this.loading){let g=this.loadProgress?`${this.loadProgress.loaded}/${this.loadProgress.total}`:"...";c=`${Se.fg("muted","\u25CB Current Folder | ")}${Se.fg("accent",`Loading ${g}`)}`}else this.scope==="current"?c=`${Se.fg("accent","\u25C9 Current Folder")}${Se.fg("muted"," | \u25CB All")}`:c=`${Se.fg("muted","\u25CB Current Folder | ")}${Se.fg("accent","\u25C9 All")}`;let u=pr(`${c} ${a} ${i}`,e,""),l=Math.max(0,e-nn(u)-1),d=pr(r,l,""),h=Math.max(0,e-nn(d)-nn(u)),m,f;if(this.confirmingDeletePath!==null){let g=`Delete session? ${er("tui.select.confirm","confirm")} \xB7 ${er("tui.select.cancel","cancel")}`;m=Se.fg("error",pr(g,e,"\u2026")),f=""}else if(this.statusMessage){let g=this.statusMessage.type==="error"?"error":"accent";m=Se.fg(g,pr(this.statusMessage.message,e,"\u2026")),f=""}else{let g=this.showPath?"(on)":"(off)",A=Se.fg("muted"," \xB7 "),y=er("tui.input.tab","scope")+A+Se.fg("muted",'re: regex \xB7 "phrase" exact'),b=[er("app.session.toggleSort","sort"),er("app.session.toggleNamedFilter","named"),er("app.session.delete","delete"),er("app.session.togglePath",`path ${g}`)];this.showRenameHint&&b.push(er("app.session.rename","rename"));let S=b.join(A);m=pr(y,e,"\u2026"),f=pr(S,e,"\u2026")}return[`${d}${" ".repeat(h)}${u}`,m,f]}};function CUs(t){let e=new Map;for(let i of t){let o=ine(i.path)??i.path;e.set(o,{session:i,children:[],latestActivity:i.modified.getTime()})}let n=[];for(let i of t){let o=ine(i.path)??i.path,a=e.get(o),c=ine(i.parentSessionPath);c&&e.has(c)?e.get(c).children.push(a):n.push(a)}let r=i=>{let o=i.session.modified.getTime();for(let a of i.children)o=Math.max(o,r(a));return i.latestActivity=o,o};for(let i of n)r(i);let s=i=>{i.sort((o,a)=>a.latestActivity-o.latestActivity);for(let o of i)s(o.children)};return s(n),n}function IUs(t){let e=[],n=(r,s,i,o)=>{e.push({session:r.session,depth:s,isLast:o,ancestorContinues:i});for(let a=0;a0?!o:!1;n(r.children[a],s+1,[...i,u],c)}};for(let r=0;r{};onToggleScope;onToggleSort;onToggleNameFilter;onTogglePath;onDeleteConfirmationChange;onDeleteSession;onRenameSession;onError;maxVisible=10;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}constructor(e,n,r,s,i,o){this.allSessions=e,this.filteredSessions=[],this.searchInput=new jo,this.showCwd=n,this.sortMode=r,this.nameFilter=s,this.keybindings=i,this.currentSessionCanonicalPath=ine(o),this.filterSessions(""),this.searchInput.onSubmit=()=>{if(this.filteredSessions[this.selectedIndex]){let a=this.filteredSessions[this.selectedIndex];this.onSelect&&this.onSelect(a.session.path)}}}setSortMode(e){this.sortMode=e,this.filterSessions(this.searchInput.getValue())}setNameFilter(e){this.nameFilter=e,this.filterSessions(this.searchInput.getValue())}setSessions(e,n){this.allSessions=e,this.showCwd=n,this.filterSessions(this.searchInput.getValue())}filterSessions(e){let n=e.trim(),r=this.nameFilter==="all"?this.allSessions:this.allSessions.filter(s=>xot(s));if(this.sortMode==="threaded"&&!n){let s=CUs(r);this.filteredSessions=IUs(s)}else{let s=$Pn(r,e,this.sortMode,"all");this.filteredSessions=s.map(i=>({session:i,depth:0,isLast:!0,ancestorContinues:[]}))}this.selectedIndex=Math.min(this.selectedIndex,Math.max(0,this.filteredSessions.length-1))}setConfirmingDeletePath(e){this.confirmingDeletePath=e,this.onDeleteConfirmationChange?.(e)}startDeleteConfirmationForSelectedSession(){let e=this.filteredSessions[this.selectedIndex];if(e){if(this.isCurrentSessionPath(e.session.path)){this.onError?.("Cannot delete the currently active session");return}this.setConfirmingDeletePath(e.session.path)}}isCurrentSessionPath(e){return this.currentSessionCanonicalPath?(ine(e)??e)===this.currentSessionCanonicalPath:!1}invalidate(){}render(e){let n=[];if(n.push(...this.searchInput.render(e)),n.push(""),this.filteredSessions.length===0){let i;if(this.nameFilter==="named"){let o=ra("app.session.toggleNamedFilter");this.showCwd?i=` No named sessions found. Press ${o} to show all.`:i=` No named sessions in current folder. Press ${o} to show all, or Tab to view all.`}else this.showCwd?i=" No sessions found":i=" No sessions in current folder. Press Tab to view all.";return n.push(Se.fg("muted",pr(i,e,"\u2026"))),n}let r=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredSessions.length-this.maxVisible)),s=Math.min(r+this.maxVisible,this.filteredSessions.length);for(let i=r;i0||ss?"\u2502 ":" "),r=e.isLast?"\u2514\u2500 ":"\u251C\u2500 ";return n.join("")+r}handleInput(e){let n=ms();if(this.confirmingDeletePath!==null){if(n.matches(e,"tui.select.confirm")){let r=this.confirmingDeletePath;this.setConfirmingDeletePath(null),this.onDeleteSession?.(r);return}if(n.matches(e,"tui.select.cancel")){this.setConfirmingDeletePath(null);return}return}if(n.matches(e,"tui.input.tab")){this.onToggleScope&&this.onToggleScope();return}if(n.matches(e,"app.session.toggleSort")){this.onToggleSort?.();return}if(this.keybindings.matches(e,"app.session.toggleNamedFilter")){this.onToggleNameFilter?.();return}if(n.matches(e,"app.session.togglePath")){this.showPath=!this.showPath,this.onTogglePath?.(this.showPath);return}if(n.matches(e,"app.session.delete")){this.startDeleteConfirmationForSelectedSession();return}if(n.matches(e,"app.session.rename")){let r=this.filteredSessions[this.selectedIndex];r&&this.onRenameSession?.(r.session.path);return}if(n.matches(e,"app.session.deleteNoninvasive")){if(this.searchInput.getValue().length>0){this.searchInput.handleInput(e),this.filterSessions(this.searchInput.getValue());return}this.startDeleteConfirmationForSelectedSession();return}if(n.matches(e,"tui.select.up"))this.selectedIndex=Math.max(0,this.selectedIndex-1);else if(n.matches(e,"tui.select.down"))this.selectedIndex=Math.min(this.filteredSessions.length-1,this.selectedIndex+1);else if(n.matches(e,"tui.select.pageUp"))this.selectedIndex=Math.max(0,this.selectedIndex-this.maxVisible);else if(n.matches(e,"tui.select.pageDown"))this.selectedIndex=Math.min(this.filteredSessions.length-1,this.selectedIndex+this.maxVisible);else if(n.matches(e,"tui.select.confirm")){let r=this.filteredSessions[this.selectedIndex];r&&this.onSelect&&this.onSelect(r.session.path)}else n.matches(e,"tui.select.cancel")?this.onCancel&&this.onCancel():(this.searchInput.handleInput(e),this.filterSessions(this.searchInput.getValue()))}};async function xUs(t){let e=t.startsWith("-")?["--",t]:[t],n=(0,WPn.spawnSync)("trash",e,{encoding:"utf-8"}),r=()=>{let s=[];n.error&&s.push(n.error.message);let i=n.stderr?.trim();return i&&s.push(i.split(` -`)[0]??i),s.length===0?null:`trash: ${s.join(" \xB7 ").slice(0,200)}`};if(n.status===0||!(0,qPn.existsSync)(t))return{ok:!0,method:"trash"};try{return await(0,HPn.unlink)(t),{ok:!0,method:"unlink"}}catch(s){let i=s instanceof Error?s.message:String(s),o=r();return{ok:!1,method:"unlink",error:o?`${i} (${o})`:i}}}var UT=class extends _n{handleInput(e){if(this.mode==="rename"){if(ms().matches(e,"tui.select.cancel")){this.exitRenameMode();return}this.renameInput.handleInput(e);return}this.sessionList.handleInput(e)}canRename=!0;sessionList;header;keybindings;scope="current";sortMode="threaded";nameFilter="all";currentSessions=null;allSessions=null;currentSessionsLoader;allSessionsLoader;requestRender;renameSession;currentLoading=!1;allLoading=!1;allLoadSeq=0;mode="list";renameInput=new jo;renameTargetPath=null;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.sessionList.focused=e,this.renameInput.focused=e,e&&this.mode==="rename"&&(this.renameInput.focused=!0)}buildBaseLayout(e,n){this.clear(),this.addChild(new Nt(1)),this.addChild(new Ln(r=>Se.fg("accent",r))),this.addChild(new Nt(1)),(n?.showHeader??!0)&&(this.addChild(this.header),this.addChild(new Nt(1))),this.addChild(e),this.addChild(new Nt(1)),this.addChild(new Ln(r=>Se.fg("accent",r)))}constructor(e,n,r,s,i,o,a,c){super(),this.keybindings=a?.keybindings??RI.create(),this.currentSessionsLoader=e,this.allSessionsLoader=n,this.requestRender=o,this.header=new wot(this.scope,this.sortMode,this.nameFilter,this.requestRender);let u=a?.renameSession;this.renameSession=u,this.canRename=!!u,this.header.setShowRenameHint(a?.showRenameHint??this.canRename),this.sessionList=new Tot([],!1,this.sortMode,this.nameFilter,this.keybindings,c),this.buildBaseLayout(this.sessionList),this.renameInput.onSubmit=d=>{this.confirmRename(d)};let l=()=>this.header.setStatusMessage(null);this.sessionList.onSelect=d=>{l(),r(d)},this.sessionList.onCancel=()=>{l(),s()},this.sessionList.onExit=()=>{l(),i()},this.sessionList.onToggleScope=()=>this.toggleScope(),this.sessionList.onToggleSort=()=>this.toggleSortMode(),this.sessionList.onToggleNameFilter=()=>this.toggleNameFilter(),this.sessionList.onRenameSession=d=>{if(!u||this.scope==="current"&&this.currentLoading||this.scope==="all"&&this.allLoading)return;let m=(this.scope==="all"?this.allSessions??[]:this.currentSessions??[]).find(f=>f.path===d);this.enterRenameMode(d,m?.name)},this.sessionList.onTogglePath=d=>{this.header.setShowPath(d),this.requestRender()},this.sessionList.onDeleteConfirmationChange=d=>{this.header.setConfirmingDeletePath(d),this.requestRender()},this.sessionList.onError=d=>{this.header.setStatusMessage({type:"error",message:d},3e3),this.requestRender()},this.sessionList.onDeleteSession=async d=>{let h=await xUs(d);if(h.ok){this.currentSessions&&(this.currentSessions=this.currentSessions.filter(A=>A.path!==d)),this.allSessions&&(this.allSessions=this.allSessions.filter(A=>A.path!==d));let m=this.scope==="all"?this.allSessions??[]:this.currentSessions??[],f=this.scope==="all";this.sessionList.setSessions(m,f);let g=h.method==="trash"?"Session moved to trash":"Session deleted";this.header.setStatusMessage({type:"info",message:g},2e3),await this.refreshSessionsAfterMutation()}else{let m=h.error??"Unknown error";this.header.setStatusMessage({type:"error",message:`Failed to delete: ${m}`},3e3)}this.requestRender()},this.loadCurrentSessions()}loadCurrentSessions(){this.loadScope("current","initial")}enterRenameMode(e,n){this.mode="rename",this.renameTargetPath=e,this.renameInput.setValue(n??""),this.renameInput.focused=!0;let r=new _n;r.addChild(new yt(Se.bold("Rename Session"),1,0)),r.addChild(new Nt(1)),r.addChild(this.renameInput),r.addChild(new Nt(1)),r.addChild(new yt(Se.fg("muted",`${ra("tui.select.confirm")} to save \xB7 ${ra("tui.select.cancel")} to cancel`),1,0)),this.buildBaseLayout(r,{showHeader:!1}),this.requestRender()}exitRenameMode(){this.mode="list",this.renameTargetPath=null,this.buildBaseLayout(this.sessionList),this.requestRender()}async confirmRename(e){let n=e.trim();if(!n)return;let r=this.renameTargetPath;if(!r){this.exitRenameMode();return}let s=this.renameSession;if(!s){this.exitRenameMode();return}try{await s(r,n),await this.refreshSessionsAfterMutation()}finally{this.exitRenameMode()}}async loadScope(e,n){let r=e==="all";e==="current"?this.currentLoading=!0:this.allLoading=!0;let s=e==="all"?++this.allLoadSeq:void 0;this.header.setScope(e),this.header.setLoading(!0),this.requestRender();let i=(o,a)=>{e===this.scope&&(s!==void 0&&s!==this.allLoadSeq||(this.header.setProgress(o,a),this.requestRender()))};try{let o=await(e==="current"?this.currentSessionsLoader(i):this.allSessionsLoader(i));if(e==="current"?(this.currentSessions=o,this.currentLoading=!1):(this.allSessions=o,this.allLoading=!1),e!==this.scope||s!==void 0&&s!==this.allLoadSeq)return;this.header.setLoading(!1),this.sessionList.setSessions(o,r),this.requestRender()}catch(o){if(e==="current"?this.currentLoading=!1:this.allLoading=!1,e!==this.scope||s!==void 0&&s!==this.allLoadSeq)return;let a=o instanceof Error?o.message:String(o);this.header.setLoading(!1),this.header.setStatusMessage({type:"error",message:`Failed to load sessions: ${a}`},4e3),n==="initial"&&this.sessionList.setSessions([],r),this.requestRender()}}toggleSortMode(){this.sortMode=this.sortMode==="threaded"?"recent":this.sortMode==="recent"?"relevance":"threaded",this.header.setSortMode(this.sortMode),this.sessionList.setSortMode(this.sortMode),this.requestRender()}toggleNameFilter(){this.nameFilter=this.nameFilter==="all"?"named":"all",this.header.setNameFilter(this.nameFilter),this.sessionList.setNameFilter(this.nameFilter),this.requestRender()}async refreshSessionsAfterMutation(){await this.loadScope(this.scope,"refresh")}toggleScope(){if(this.scope==="current"){if(this.scope="all",this.header.setScope(this.scope),this.allSessions!==null){this.header.setLoading(!1),this.sessionList.setSessions(this.allSessions,!0),this.requestRender();return}this.allLoading||this.loadScope("all","toggle");return}this.scope="current",this.header.setScope(this.scope),this.header.setLoading(this.currentLoading),this.sessionList.setSessions(this.currentSessions??[],!1),this.requestRender()}getSessionList(){return this.sessionList}};async function jPn(t,e,n){let r=await rne(n);return new Promise(s=>{let i=RI.create();kN(i);let o=!1,a=new UT(t,e,c=>{o||(o=!0,r.stop(),s(c))},()=>{o||(o=!0,r.stop(),s(null))},()=>{r.stop(),process.exit(0)},()=>r.requestRender(),{showRenameHint:!1,keybindings:i});r.addChild(a),r.setFocus(a.getSessionList()),Xwe(r,n)})}p();function wUs(t){return`Trust project folder? +changes anytime in settings.json.`),1,0)),this.addChild(new Tt(1)),this.addOptionList(S0t.map(e=>e.label),this.analyticsIndex)),this.addChild(new Tt(1)),this.addChild(new Et(iu("\u2191\u2193","navigate")+" "+nr("tui.select.confirm",this.step==="theme"?"continue":"finish")+" "+nr("tui.select.cancel","skip setup"),1,0)),this.addChild(new Tt(1)),this.addChild(new Un)}addOptionList(e,n){for(let r=0;r"skip");return Efs(r.themes)}async function $ae(t){RR(t.getTerminalCapabilityOverrides()),Sj(await bfs(t));let e=xj().theme;lw(_j(t.getThemeSetting(),e)??e),CD(Kw.create());let n=new EE(new cw,t.getShowHardwareCursor(),ii());return n.setClearOnShrink(t.getClearOnShrink()),n}function ePe(t,e){t.start(),_fs(t,e)}async function _fs(t,e){let n=e.getThemeSetting();if(n&&!LR(n))return;let r=await zre({ui:t,timeoutMs:100});aQ(_j(n,r)??r),t.invalidate(),t.requestRender()}async function I0t(t){t.clear(),t.requestRender(),await new Promise(e=>setTimeout(e,25))}function grr(t=ZRn()){return!yfs({packageName:ED,appName:hn,configDirName:Bi})||!KDe()||process.env[mre]?!1:!(0,frr.existsSync)(t)}async function Wae(t,e,n){let r=await $ae(t);return new Promise(i=>{let s=!1,o=async c=>{s||(s=!0,await I0t(r),r.stop(),i(c))},a=new WE(e,n.map(c=>c.label),c=>{o(n.find(u=>u.label===c)?.value)},()=>{o(void 0)},{tui:r});r.addChild(a),r.setFocus(a),ePe(r,t)})}async function Arr(t){let e=await $ae(t);return new Promise(n=>{let r=!1,i=async o=>{r||(r=!0,o&&(t.setTheme(o.theme),t.setEnableAnalytics(o.shareAnalytics),await t.flush()),await I0t(e),e.stop(),n())};(async()=>{e.start();let o=await zre({ui:e,timeoutMs:100});aQ(o);let a=new Gae({detectedTheme:o,onThemePreview:c=>{aQ(c),e.requestRender()},onSubmit:c=>{i(c)},onCancel:()=>{i(void 0)}});e.addChild(a),e.setFocus(a),e.requestRender()})()})}async function yrr(t,e,n){let r=await $ae(t);return new Promise(i=>{let s=!1,o=async c=>{s||(s=!0,a.dispose(),await I0t(r),r.stop(),i(c))},a=new _k(e,n,c=>{o(c)},()=>{o(void 0)},{tui:r});r.addChild(a),r.setFocus(a),ePe(r,t)})}var frr,ffs,gfs,Afs,tPe=v(()=>{p();Tr();frr=require("fs");Qs();_0t();m9();pY();Ek();ZDe();Qae();C0t();pi();ffs="@earendil-works/pi-coding-agent",gfs="pi",Afs=".pi"});function nPe(t){return{cwd:t.cwd,mode:t.mode==="interactive"?"tui":t.mode,hasUI:t.hasUI,ui:{select:async(e,n)=>{if(t.hasUI&&t.mode==="interactive")return Wae(t.settingsManager,e,n.map(r=>({label:r,value:r})))},confirm:async(e,n)=>!t.hasUI||t.mode!=="interactive"?!1:await Wae(t.settingsManager,`${e} +${n}`,[{label:"Yes",value:!0},{label:"No",value:!1}])??!1,input:async(e,n)=>{if(t.hasUI&&t.mode==="interactive")return yrr(t.settingsManager,e,n)},notify:(e,n="info")=>{if(t.mode!=="interactive"){let r=n==="error"?tn.red:n==="warning"?tn.yellow:tn.cyan;console.error(r(e))}}}}}var w0t=v(()=>{p();gb();tPe()});function Err(t){return t.toLowerCase().replace(/\s+/g," ").trim()}function xfs(t){return`${t.id} ${t.name??""} ${t.allMessagesText} ${t.cwd}`}function T0t(t){return!!t.name?.trim()}function Sfs(t,e){return e==="all"?!0:T0t(t)}function Cfs(t){let e=t.trim();if(!e)return{mode:"tokens",tokens:[],regex:null};if(e.startsWith("re:")){let a=e.slice(3).trim();if(!a)return{mode:"regex",tokens:[],regex:null,error:"Empty regex"};try{return{mode:"regex",tokens:[],regex:new RegExp(a,"i")}}catch(c){let u=c instanceof Error?c.message:String(c);return{mode:"regex",tokens:[],regex:null,error:u}}}let n=[],r="",i=!1,s=!1,o=a=>{let c=r.trim();r="",c&&n.push({kind:a,value:c})};for(let a=0;aa.trim()).filter(a=>a.length>0).map(a=>({kind:"fuzzy",value:a})),regex:null}:(o(i?"phrase":"fuzzy"),{mode:"tokens",tokens:n,regex:null})}function brr(t,e){let n=xfs(t);if(e.mode==="regex"){if(!e.regex)return{matches:!1,score:0};let s=n.search(e.regex);return s<0?{matches:!1,score:0}:{matches:!0,score:s*.1}}if(e.tokens.length===0)return{matches:!0,score:0};let r=0,i=null;for(let s of e.tokens){if(s.kind==="phrase"){i===null&&(i=Err(n));let a=Err(s.value);if(!a)continue;let c=i.indexOf(a);if(c<0)return{matches:!1,score:0};r+=c*.1;continue}let o=bre(s.value,n);if(!o.matches)return{matches:!1,score:0};r+=o.score}return{matches:!0,score:r}}function _rr(t,e,n,r="all"){let i=r==="all"?t:t.filter(c=>Sfs(c,r));if(!e.trim())return i;let o=Cfs(e);if(o.error)return[];if(n==="recent"){let c=[];for(let u of i)brr(u,o).matches&&c.push(u);return c}let a=[];for(let c of i){let u=brr(c,o);u.matches&&a.push({session:c,score:u.score})}return a.sort((c,u)=>c.score!==u.score?c.score-u.score:u.session.modified.getTime()-c.session.modified.getTime()),a.map(c=>c.session)}var xrr=v(()=>{p();Tr()});function Srr(t){let e=Trr.homedir();return t&&(t.startsWith(e)?`~${t.slice(e.length)}`:t)}function Ifs(t){let n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4),i=Math.floor(n/36e5),s=Math.floor(n/864e5);return r<1?"now":r<60?`${r}m`:i<24?`${i}h`:s<7?`${s}d`:s<30?`${Math.floor(s/7)}w`:s<365?`${Math.floor(s/30)}mo`:`${Math.floor(s/365)}y`}function Hae(t){return t&&cd(t)}function wfs(t){let e=new Map;for(let s of t){let o=Hae(s.path)??s.path;e.set(o,{session:s,children:[],latestActivity:s.modified.getTime()})}let n=[];for(let s of t){let o=Hae(s.path)??s.path,a=e.get(o),c=Hae(s.parentSessionPath);c&&e.has(c)?e.get(c).children.push(a):n.push(a)}let r=s=>{let o=s.session.modified.getTime();for(let a of s.children)o=Math.max(o,r(a));return s.latestActivity=o,o};for(let s of n)r(s);let i=s=>{s.sort((o,a)=>a.latestActivity-o.latestActivity);for(let o of s)i(o.children)};return i(n),n}function Tfs(t){let e=[],n=(r,i,s,o)=>{e.push({session:r.session,depth:i,isLast:o,ancestorContinues:s});for(let a=0;a0?!o:!1;n(r.children[a],i+1,[...s,u],c)}};for(let r=0;r{let i=[];n.error&&i.push(n.error.message);let s=n.stderr?.trim();return s&&i.push(s.split(` +`)[0]??s),i.length===0?null:`trash: ${i.join(" \xB7 ").slice(0,200)}`};if(n.status===0||!(0,Irr.existsSync)(t))return{ok:!0,method:"trash"};try{return await(0,wrr.unlink)(t),{ok:!0,method:"unlink"}}catch(i){let s=i instanceof Error?i.message:String(i),o=r();return{ok:!1,method:"unlink",error:o?`${s} (${o})`:s}}}var Crr,Irr,wrr,Trr,v0t,R0t,xk,rPe=v(()=>{p();Crr=require("node:child_process"),Irr=require("node:fs"),wrr=require("node:fs/promises"),Trr=Ot(require("node:os"),1);Tr();m9();fc();pi();Ll();ha();xrr();v0t=class{scope;sortMode;nameFilter;requestRender;loading=!1;loadProgress=null;showPath=!1;confirmingDeletePath=null;statusMessage=null;statusTimeout=null;showRenameHint=!1;constructor(e,n,r,i){this.scope=e,this.sortMode=n,this.nameFilter=r,this.requestRender=i}setScope(e){this.scope=e}setSortMode(e){this.sortMode=e}setNameFilter(e){this.nameFilter=e}setLoading(e){this.loading=e,this.loadProgress=null}setProgress(e,n){this.loadProgress={loaded:e,total:n}}setShowPath(e){this.showPath=e}setShowRenameHint(e){this.showRenameHint=e}setConfirmingDeletePath(e){this.confirmingDeletePath=e}clearStatusTimeout(){this.statusTimeout&&(clearTimeout(this.statusTimeout),this.statusTimeout=null)}setStatusMessage(e,n){this.clearStatusTimeout(),this.statusMessage=e,!(!e||!n)&&(this.statusTimeout=setTimeout(()=>{this.statusMessage=null,this.statusTimeout=null,this.requestRender()},n))}invalidate(){}render(e){let n=this.scope==="current"?"Resume Session (Current Folder)":"Resume Session (All)",r=Ee.bold(n),i=this.sortMode==="threaded"?"Threaded":this.sortMode==="recent"?"Recent":"Fuzzy",s=Ee.fg("muted","Sort: ")+Ee.fg("accent",i),o=this.nameFilter==="all"?"All":"Named",a=Ee.fg("muted","Name: ")+Ee.fg("accent",o),c;if(this.loading){let g=this.loadProgress?`${this.loadProgress.loaded}/${this.loadProgress.total}`:"...";c=`${Ee.fg("muted","\u25CB Current Folder | ")}${Ee.fg("accent",`Loading ${g}`)}`}else this.scope==="current"?c=`${Ee.fg("accent","\u25C9 Current Folder")}${Ee.fg("muted"," | \u25CB All")}`:c=`${Ee.fg("muted","\u25CB Current Folder | ")}${Ee.fg("accent","\u25C9 All")}`;let u=dr(`${c} ${a} ${s}`,e,""),l=Math.max(0,e-rn(u)-1),d=dr(r,l,""),m=Math.max(0,e-rn(d)-rn(u)),h,f;if(this.confirmingDeletePath!==null){let g=`Delete session? ${nr("tui.select.confirm","confirm")} \xB7 ${nr("tui.select.cancel","cancel")}`;h=Ee.fg("error",dr(g,e,"\u2026")),f=""}else if(this.statusMessage){let g=this.statusMessage.type==="error"?"error":"accent";h=Ee.fg(g,dr(this.statusMessage.message,e,"\u2026")),f=""}else{let g=this.showPath?"(on)":"(off)",A=Ee.fg("muted"," \xB7 "),y=nr("tui.input.tab","scope")+A+Ee.fg("muted",'re: regex \xB7 "phrase" exact'),E=[nr("app.session.toggleSort","sort"),nr("app.session.toggleNamedFilter","named"),nr("app.session.delete","delete"),nr("app.session.togglePath",`path ${g}`)];this.showRenameHint&&E.push(nr("app.session.rename","rename"));let _=E.join(A);h=dr(y,e,"\u2026"),f=dr(_,e,"\u2026")}return[`${d}${" ".repeat(m)}${u}`,h,f]}};R0t=class{getSelectedSessionPath(){return this.filteredSessions[this.selectedIndex]?.session.path}allSessions=[];filteredSessions=[];selectedIndex=0;selectionTouched=!1;searchInput;showCwd=!1;sortMode="threaded";nameFilter="all";keybindings;showPath=!1;confirmingDeletePath=null;currentSessionCanonicalPath;onSelect;onCancel;onExit=()=>{};onToggleScope;onToggleSort;onToggleNameFilter;onTogglePath;onDeleteConfirmationChange;onDeleteSession;onRenameSession;onError;maxVisible=10;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}constructor(e,n,r,i,s,o){this.allSessions=e,this.filteredSessions=[],this.searchInput=new ma,this.showCwd=n,this.sortMode=r,this.nameFilter=i,this.keybindings=s,this.currentSessionCanonicalPath=Hae(o),this.filterSessions(""),this.searchInput.onSubmit=()=>{if(this.filteredSessions[this.selectedIndex]){let a=this.filteredSessions[this.selectedIndex];this.onSelect&&this.onSelect(a.session.path)}}}setSortMode(e){this.sortMode=e,this.filterSessions(this.searchInput.getValue())}setNameFilter(e){this.nameFilter=e,this.filterSessions(this.searchInput.getValue())}setSessions(e,n){let r=this.selectionTouched?this.getSelectedSessionPath():void 0;if(this.allSessions=e,this.showCwd=n,this.filterSessions(this.searchInput.getValue()),!this.selectionTouched)this.selectedIndex=0;else if(r){let i=this.filteredSessions.findIndex(s=>s.session.path===r);i>=0&&(this.selectedIndex=i)}}filterSessions(e){let n=e.trim(),r=this.nameFilter==="all"?this.allSessions:this.allSessions.filter(i=>T0t(i));if(this.sortMode==="threaded"&&!n){let i=wfs(r);this.filteredSessions=Tfs(i)}else{let i=_rr(r,e,this.sortMode,"all");this.filteredSessions=i.map(s=>({session:s,depth:0,isLast:!0,ancestorContinues:[]}))}this.selectedIndex=Math.min(this.selectedIndex,Math.max(0,this.filteredSessions.length-1))}setConfirmingDeletePath(e){this.confirmingDeletePath=e,this.onDeleteConfirmationChange?.(e)}startDeleteConfirmationForSelectedSession(){let e=this.filteredSessions[this.selectedIndex];if(e){if(this.isCurrentSessionPath(e.session.path)){this.onError?.("Cannot delete the currently active session");return}this.setConfirmingDeletePath(e.session.path)}}isCurrentSessionPath(e){return this.currentSessionCanonicalPath?(Hae(e)??e)===this.currentSessionCanonicalPath:!1}invalidate(){}render(e){let n=[];if(n.push(...this.searchInput.render(e)),n.push(""),this.filteredSessions.length===0){let s;if(this.nameFilter==="named"){let o=Ca("app.session.toggleNamedFilter");this.showCwd?s=` No named sessions found. Press ${o} to show all.`:s=` No named sessions in current folder. Press ${o} to show all, or Tab to view all.`}else this.showCwd?s=" No sessions found":s=" No sessions in current folder. Press Tab to view all.";return n.push(Ee.fg("muted",dr(s,e,"\u2026"))),n}let r=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredSessions.length-this.maxVisible)),i=Math.min(r+this.maxVisible,this.filteredSessions.length);for(let s=r;s0||ii?"\u2502 ":" "),r=e.isLast?"\u2514\u2500 ":"\u251C\u2500 ";return n.join("")+r}handleInput(e){let n=Ai();if(this.confirmingDeletePath!==null){if(n.matches(e,"tui.select.confirm")){let r=this.confirmingDeletePath;this.setConfirmingDeletePath(null),this.onDeleteSession?.(r);return}if(n.matches(e,"tui.select.cancel")){this.setConfirmingDeletePath(null);return}return}if(n.matches(e,"tui.input.tab")){this.onToggleScope&&this.onToggleScope();return}if(n.matches(e,"app.session.toggleSort")){this.onToggleSort?.();return}if(this.keybindings.matches(e,"app.session.toggleNamedFilter")){this.onToggleNameFilter?.();return}if(n.matches(e,"app.session.togglePath")){this.showPath=!this.showPath,this.onTogglePath?.(this.showPath);return}if(n.matches(e,"app.session.delete")){this.startDeleteConfirmationForSelectedSession();return}if(n.matches(e,"app.session.rename")){let r=this.filteredSessions[this.selectedIndex];r&&this.onRenameSession?.(r.session.path);return}if(n.matches(e,"app.session.deleteNoninvasive")){if(this.searchInput.getValue().length>0){this.searchInput.handleInput(e),this.filterSessions(this.searchInput.getValue());return}this.startDeleteConfirmationForSelectedSession();return}if(this.selectionTouched=!0,n.matches(e,"tui.select.up"))this.selectedIndex=Math.max(0,this.selectedIndex-1);else if(n.matches(e,"tui.select.down"))this.selectedIndex=Math.min(this.filteredSessions.length-1,this.selectedIndex+1);else if(n.matches(e,"tui.select.pageUp"))this.selectedIndex=Math.max(0,this.selectedIndex-this.maxVisible);else if(n.matches(e,"tui.select.pageDown"))this.selectedIndex=Math.min(this.filteredSessions.length-1,this.selectedIndex+this.maxVisible);else if(n.matches(e,"tui.select.confirm")){let r=this.filteredSessions[this.selectedIndex];r&&this.onSelect&&this.onSelect(r.session.path)}else n.matches(e,"tui.select.cancel")?this.onCancel&&this.onCancel():(this.searchInput.handleInput(e),this.filterSessions(this.searchInput.getValue()))}};xk=class extends gn{handleInput(e){if(this.mode==="rename"){if(Ai().matches(e,"tui.select.cancel")){this.exitRenameMode();return}this.renameInput.handleInput(e);return}this.sessionList.handleInput(e)}canRename=!0;sessionList;header;keybindings;scope="current";sortMode="threaded";nameFilter="all";currentSessions=null;allSessions=null;currentSessionsLoader;allSessionsLoader;requestRender;renameSession;currentLoad=null;allLoad=null;mode="list";renameInput=new ma;renameTargetPath=null;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.sessionList.focused=e,this.renameInput.focused=e,e&&this.mode==="rename"&&(this.renameInput.focused=!0)}buildBaseLayout(e,n){this.clear(),this.addChild(new Tt(1)),this.addChild(new Un(r=>Ee.fg("accent",r))),this.addChild(new Tt(1)),(n?.showHeader??!0)&&(this.addChild(this.header),this.addChild(new Tt(1))),this.addChild(e),this.addChild(new Tt(1)),this.addChild(new Un(r=>Ee.fg("accent",r)))}constructor(e,n,r,i,s,o,a,c){super(),this.keybindings=a?.keybindings??Kw.create(),this.currentSessionsLoader=e,this.allSessionsLoader=n,this.requestRender=o,this.header=new v0t(this.scope,this.sortMode,this.nameFilter,this.requestRender);let u=a?.renameSession;this.renameSession=u,this.canRename=!!u,this.header.setShowRenameHint(a?.showRenameHint??this.canRename),this.sessionList=new R0t([],!1,this.sortMode,this.nameFilter,this.keybindings,c),this.buildBaseLayout(this.sessionList),this.renameInput.onSubmit=d=>{this.confirmRename(d)};let l=()=>this.header.setStatusMessage(null);this.sessionList.onSelect=d=>{l(),this.cancelLoads(),r(d)},this.sessionList.onCancel=()=>{l(),this.cancelLoads(),i()},this.sessionList.onExit=()=>{l(),this.cancelLoads(),s()},this.sessionList.onToggleScope=()=>this.toggleScope(),this.sessionList.onToggleSort=()=>this.toggleSortMode(),this.sessionList.onToggleNameFilter=()=>this.toggleNameFilter(),this.sessionList.onRenameSession=d=>{if(!u||(this.scope==="current"?this.currentLoad:this.allLoad))return;let h=(this.scope==="all"?this.allSessions??[]:this.currentSessions??[]).find(f=>f.path===d);this.enterRenameMode(d,h?.name)},this.sessionList.onTogglePath=d=>{this.header.setShowPath(d),this.requestRender()},this.sessionList.onDeleteConfirmationChange=d=>{this.header.setConfirmingDeletePath(d),this.requestRender()},this.sessionList.onError=d=>{this.header.setStatusMessage({type:"error",message:d},3e3),this.requestRender()},this.sessionList.onDeleteSession=async d=>{let m=await vfs(d);if(m.ok){this.currentSessions&&(this.currentSessions=this.currentSessions.filter(A=>A.path!==d)),this.allSessions&&(this.allSessions=this.allSessions.filter(A=>A.path!==d));let h=this.scope==="all"?this.allSessions??[]:this.currentSessions??[],f=this.scope==="all";this.sessionList.setSessions(h,f);let g=m.method==="trash"?"Session moved to trash":"Session deleted";this.header.setStatusMessage({type:"info",message:g},2e3),await this.refreshSessionsAfterMutation()}else{let h=m.error??"Unknown error";this.header.setStatusMessage({type:"error",message:`Failed to delete: ${h}`},3e3)}this.requestRender()},this.loadScope("current")}cancelLoads(){this.currentLoad&&(this.currentLoad.abort(),this.currentLoad=null,this.currentSessions=null),this.allLoad&&(this.allLoad.abort(),this.allLoad=null,this.allSessions=null)}enterRenameMode(e,n){this.mode="rename",this.renameTargetPath=e,this.renameInput.setValue(n??""),this.renameInput.focused=!0;let r=new gn;r.addChild(new Et(Ee.bold("Rename Session"),1,0)),r.addChild(new Tt(1)),r.addChild(this.renameInput),r.addChild(new Tt(1)),r.addChild(new Et(Ee.fg("muted",`${Ca("tui.select.confirm")} to save \xB7 ${Ca("tui.select.cancel")} to cancel`),1,0)),this.buildBaseLayout(r,{showHeader:!1}),this.requestRender()}exitRenameMode(){this.mode="list",this.renameTargetPath=null,this.buildBaseLayout(this.sessionList),this.requestRender()}async confirmRename(e){let n=e.trim();if(!n)return;let r=this.renameTargetPath;if(!r){this.exitRenameMode();return}let i=this.renameSession;if(!i){this.exitRenameMode();return}try{await i(r,n),await this.refreshSessionsAfterMutation()}finally{this.exitRenameMode()}}async loadScope(e){if(e==="current"?this.currentLoad:this.allLoad)return;let n=e==="all",r=new AbortController;e==="current"?this.currentLoad=r:this.allLoad=r,this.header.setScope(e),this.header.setLoading(!0),this.requestRender();let i=()=>(e==="current"?this.currentLoad:this.allLoad)===r,s=(o,a,c)=>{if(i()){if(c){let u=[...c];e==="current"?this.currentSessions=u:this.allSessions=u,e===this.scope&&this.sessionList.setSessions(u,n)}e===this.scope&&(this.header.setProgress(o,a),this.requestRender())}};try{let o=await(e==="current"?this.currentSessionsLoader(s,r.signal):this.allSessionsLoader(s,r.signal));if(!i()||(e==="current"?(this.currentSessions=o,this.currentLoad=null):(this.allSessions=o,this.allLoad=null),e!==this.scope))return;this.header.setLoading(!1),this.sessionList.setSessions(o,n),this.requestRender()}catch(o){if(!i()||(e==="current"?(this.currentLoad=null,this.currentSessions=null):(this.allLoad=null,this.allSessions=null),e!==this.scope))return;let a=o instanceof Error?o.message:String(o);this.header.setLoading(!1),this.header.setStatusMessage({type:"error",message:`Failed to load sessions: ${a}`},4e3),this.sessionList.setSessions([],n),this.requestRender()}}toggleSortMode(){this.sortMode=this.sortMode==="threaded"?"recent":this.sortMode==="recent"?"relevance":"threaded",this.header.setSortMode(this.sortMode),this.sessionList.setSortMode(this.sortMode),this.requestRender()}toggleNameFilter(){this.nameFilter=this.nameFilter==="all"?"named":"all",this.header.setNameFilter(this.nameFilter),this.sessionList.setNameFilter(this.nameFilter),this.requestRender()}async refreshSessionsAfterMutation(){this.cancelLoads(),this.currentSessions=null,this.allSessions=null,await this.loadScope(this.scope)}toggleScope(){this.scope=this.scope==="current"?"all":"current";let e=this.scope==="current"?this.currentSessions:this.allSessions,n=(this.scope==="current"?this.currentLoad:this.allLoad)!==null;this.header.setScope(this.scope),this.header.setLoading(n),this.sessionList.setSessions(e??[],this.scope==="all"),this.requestRender(),e===null&&!n&&this.loadScope(this.scope)}getSessionList(){return this.sessionList}}});async function vrr(t,e,n){let r=await $ae(n);return new Promise(i=>{let s=Kw.create();CD(s);let o=!1,a=new xk(t,e,c=>{o||(o=!0,r.stop(),i(c))},()=>{o||(o=!0,r.stop(),i(null))},()=>{r.stop(),process.exit(0)},()=>r.requestRender(),{showRenameHint:!1,keybindings:s});r.addChild(a),r.setFocus(a.getSessionList()),ePe(r,n)})}var Rrr=v(()=>{p();Tr();m9();rPe();tPe()});function Rfs(t){return`Trust project folder? ${t} -This allows ${An} to load ${ws} settings and resources, install missing project packages, and execute project extensions.`}async function TUs(t,e){let n=zwe(t,{includeSessionOnly:!0}),r=await e.ui.select(wUs(t),n.map(s=>s.label));return n.find(s=>s.label===r)}function vUs(t,e){e.updates.length>0&&t.setMany(e.updates)}async function eTe(t){if(t.trustOverride!==void 0)return t.trustOverride;if(!fb(t.cwd))return!0;if(t.extensionsResult){let{result:r,errors:s}=await Ybn(t.extensionsResult,{type:"project_trust",cwd:t.cwd},t.projectTrustContext);for(let i of s)t.onExtensionError?.(`Extension "${i.extensionPath}" project_trust error: ${i.error}`);if(r){let i=r.trusted==="yes";return r.remember===!0&&t.trustStore.set(t.cwd,i),i}}let e=t.trustStore.get(t.cwd);if(e!==null)return e;switch(t.defaultProjectTrust??"ask"){case"always":return!0;case"never":return!1;case"ask":break}if(!t.projectTrustContext.hasUI)return!1;let n=await TUs(t.cwd,t.projectTrustContext);return n!==void 0?(vUs(t.trustStore,n),n.trusted):!1}p();function vot(t){return t.drainErrors().map(({scope:e,path:n,error:r})=>({type:"warning",message:n?`Invalid settings file ${n}: ${r.message}`:`Invalid ${e} settings: ${r.message}`}))}function YPn(t){let e=new Set;return t.filter(n=>{let r=`${n.type}\0${n.message}`;return e.has(r)?!1:(e.add(r),!0)})}p();p();p();function KPn(t,e){if(typeof t!="object"||t===null)return e;let n=t.error;if(typeof n!="object"||n===null)return e;let r=n.message;return typeof r=="string"&&r?r:e}function RUs(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.id=="string"&&typeof e.status?.value=="string"}function zPn(t,e){if(!t)return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};let n=()=>e.abort(t.reason);return t.addEventListener("abort",n,{once:!0}),()=>t.removeEventListener("abort",n)}function Rot(t,e){return new Promise((n,r)=>{if(e?.aborted){r(e.reason??new Error("Cancelled"));return}let s=()=>{clearTimeout(i),r(e?.reason??new Error("Cancelled"))},i=setTimeout(()=>{e?.removeEventListener("abort",s),n()},t);e?.addEventListener("abort",s,{once:!0})})}function kUs(t){if(typeof t!="object"||t===null)return;let e=t.progress;if(typeof e!="object"||e===null)return;let n=e,r=typeof n.current=="string"?n.current:typeof n.stage=="string"?n.stage:void 0,s=Array.isArray(n.stages)?n.stages.filter(a=>typeof a=="string"):[],i=typeof n.value=="number"?Math.max(0,Math.min(1,n.value)):void 0,o=i;if(r&&s.length>0){let a=s.indexOf(r);a>=0&&(o=(a+(i??0))/s.length)}return{message:r?`Loading ${r.replaceAll("_"," ")}`:"Loading model",ratio:o}}function JPn(t){if(typeof t!="object"||t===null)return;let e=t.progress,n=typeof e=="object"&&e!==null?e:t,r=0,s=0;for(let i of Object.values(n)){if(typeof i!="object"||i===null)continue;let o=i;typeof o.done!="number"||typeof o.total!="number"||(r+=o.done,s+=o.total)}if(!(s<=0))return{message:"Downloading model",ratio:r/s,detail:`${tTe(r)} / ${tTe(s)}`}}function tTe(t){if(t<1024)return`${t} B`;let e=["KiB","MiB","GiB","TiB"],n=t/1024,r=e[0];for(let s=1;s=1024;s++)n/=1024,r=e[s];return`${n>=10?n.toFixed(1):n.toFixed(2)} ${r}`}function JD(t){let e=new URL(t.trim());if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error("Server URL must use http or https");return e.hash="",e.search="",e.pathname=e.pathname.replace(/\/+$/u,"").replace(/\/v1$/u,"")||"/",e.toString().replace(/\/$/u,"")}function nTe(t){return`${JD(t)}/v1`}var wF=class{serverUrl;apiKey;constructor(e,n){this.serverUrl=JD(e),this.apiKey=n}async request(e,n={}){let r=new Headers(n.headers);n.body!==void 0&&r.set("Content-Type","application/json"),this.apiKey&&r.set("Authorization",`Bearer ${this.apiKey}`);let s=AbortSignal.timeout(15e3),i=n.signal?AbortSignal.any([n.signal,s]):s,o=await fetch(`${this.serverUrl}${e}`,{...n,headers:r,signal:i}),a;try{a=await o.json()}catch{a=void 0}if(!o.ok)throw new Error(KPn(a,`llama.cpp returned HTTP ${o.status}`));return a}async list(e={}){let n=await this.request(`/models${e.reload?"?reload=1":""}`,{signal:e.signal});if(typeof n!="object"||n===null||!Array.isArray(n.data))throw new Error("llama.cpp returned an invalid model catalog");let r=n.data;if(!r.every(RUs))throw new Error("Server is not running in llama.cpp router mode");return r}async props(e={}){let n=await this.request("/props",{signal:e.signal});if(typeof n!="object"||n===null)return{};let{models_autoload:r}=n;return typeof r=="boolean"?{models_autoload:r}:{}}async load(e,n){await this.request("/models/load",{method:"POST",body:JSON.stringify({model:e}),signal:n})}async unload(e,n){await this.request("/models/unload",{method:"POST",body:JSON.stringify({model:e}),signal:n})}async unloadAndWait(e,n){for(await this.unload(e,n);;){let r=(await this.list({signal:n})).find(s=>s.id===e);if(!r||r.status.value==="unloaded")return;await Rot(100,n)}}async download(e,n){await this.request("/models",{method:"POST",body:JSON.stringify({model:e}),signal:n})}async watch(e,n){let r=new Headers;this.apiKey&&r.set("Authorization",`Bearer ${this.apiKey}`);let s=await fetch(`${this.serverUrl}/models/sse`,{headers:r,signal:n});if(!s.ok||!s.body)throw new Error(`llama.cpp SSE returned HTTP ${s.status}`);let i=s.body.getReader(),o=new TextDecoder,a="";for(;;){let c=await i.read();if(c.done)break;a+=o.decode(c.value,{stream:!0}).replaceAll(`\r +This allows ${hn} to load ${Bi} settings and resources, install missing project packages, and execute project extensions.`}async function kfs(t,e){let n=zDe(t,{includeSessionOnly:!0}),r=await e.ui.select(Rfs(t),n.map(i=>i.label));return n.find(i=>i.label===r)}function Bfs(t,e){e.updates.length>0&&t.setMany(e.updates)}async function iPe(t){if(t.trustOverride!==void 0)return t.trustOverride;if(!t_(t.cwd))return!0;if(t.extensionsResult){let{result:r,errors:i}=await q3n(t.extensionsResult,{type:"project_trust",cwd:t.cwd},t.projectTrustContext);for(let s of i)t.onExtensionError?.(`Extension "${s.extensionPath}" project_trust error: ${s.error}`);if(r){let s=r.trusted==="yes";return r.remember===!0&&t.trustStore.set(t.cwd,s),s}}let e=t.trustStore.get(t.cwd);if(e!==null)return e;switch(t.defaultProjectTrust??"ask"){case"always":return!0;case"never":return!1;case"ask":break}if(!t.projectTrustContext.hasUI)return!1;let n=await kfs(t.cwd,t.projectTrustContext);return n!==void 0?(Bfs(t.trustStore,n),n.trusted):!1}var k0t=v(()=>{p();Qs();Bse();zU()});function B0t(t){return t.drainErrors().map(({scope:e,path:n,error:r})=>({type:"warning",message:n?`Invalid settings file ${n}: ${r.message}`:`Invalid ${e} settings: ${r.message}`}))}function krr(t){let e=new Set;return t.filter(n=>{let r=`${n.type}\0${n.message}`;return e.has(r)?!1:(e.add(r),!0)})}var Brr=v(()=>{p()});function Nrr(t,e){if(typeof t!="object"||t===null)return e;let n=t.error;if(typeof n!="object"||n===null)return e;let r=n.message;return typeof r=="string"&&r?r:e}function Nfs(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.id=="string"&&typeof e.status?.value=="string"}function Drr(t,e){if(!t)return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};let n=()=>e.abort(t.reason);return t.addEventListener("abort",n,{once:!0}),()=>t.removeEventListener("abort",n)}function N0t(t,e){return new Promise((n,r)=>{if(e?.aborted){r(e.reason??new Error("Cancelled"));return}let i=()=>{clearTimeout(s),r(e?.reason??new Error("Cancelled"))},s=setTimeout(()=>{e?.removeEventListener("abort",i),n()},t);e?.addEventListener("abort",i,{once:!0})})}function Dfs(t){if(typeof t!="object"||t===null)return;let e=t.progress;if(typeof e!="object"||e===null)return;let n=e,r=typeof n.current=="string"?n.current:typeof n.stage=="string"?n.stage:void 0,i=Array.isArray(n.stages)?n.stages.filter(a=>typeof a=="string"):[],s=typeof n.value=="number"?Math.max(0,Math.min(1,n.value)):void 0,o=s;if(r&&i.length>0){let a=i.indexOf(r);a>=0&&(o=(a+(s??0))/i.length)}return{message:r?`Loading ${r.replaceAll("_"," ")}`:"Loading model",ratio:o}}function Prr(t){if(typeof t!="object"||t===null)return;let e=t.progress,n=typeof e=="object"&&e!==null?e:t,r=0,i=0;for(let s of Object.values(n)){if(typeof s!="object"||s===null)continue;let o=s;typeof o.done!="number"||typeof o.total!="number"||(r+=o.done,i+=o.total)}if(!(i<=0))return{message:"Downloading model",ratio:r/i,detail:`${sPe(r)} / ${sPe(i)}`}}function sPe(t){if(t<1024)return`${t} B`;let e=["KiB","MiB","GiB","TiB"],n=t/1024,r=e[0];for(let i=1;i=1024;i++)n/=1024,r=e[i];return`${n>=10?n.toFixed(1):n.toFixed(2)} ${r}`}function JP(t){let e=new URL(t.trim());if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error("Server URL must use http or https");return e.hash="",e.search="",e.pathname=e.pathname.replace(/\/+$/u,"").replace(/\/v1$/u,"")||"/",e.toString().replace(/\/$/u,"")}function oPe(t){return`${JP(t)}/v1`}var JU,D0t=v(()=>{p();JU=class{serverUrl;apiKey;constructor(e,n){this.serverUrl=JP(e),this.apiKey=n}async request(e,n={}){let r=new Headers(n.headers);n.body!==void 0&&r.set("Content-Type","application/json"),this.apiKey&&r.set("Authorization",`Bearer ${this.apiKey}`);let i=AbortSignal.timeout(15e3),s=n.signal?AbortSignal.any([n.signal,i]):i,o=await fetch(`${this.serverUrl}${e}`,{...n,headers:r,signal:s}),a;try{a=await o.json()}catch{a=void 0}if(!o.ok)throw new Error(Nrr(a,`llama.cpp returned HTTP ${o.status}`));return a}async list(e={}){let n=await this.request(`/models${e.reload?"?reload=1":""}`,{signal:e.signal});if(typeof n!="object"||n===null||!Array.isArray(n.data))throw new Error("llama.cpp returned an invalid model catalog");let r=n.data;if(!r.every(Nfs))throw new Error("Server is not running in llama.cpp router mode");return r}async props(e={}){let n=e.model?`?${new URLSearchParams({model:e.model,autoload:"false"})}`:"",r=await this.request(`/props${n}`,{signal:e.signal});if(typeof r!="object"||r===null)return{};let{models_autoload:i,chat_template:s}=r;return{...typeof i=="boolean"?{models_autoload:i}:{},...typeof s=="string"?{chat_template:s}:{}}}async load(e,n){await this.request("/models/load",{method:"POST",body:JSON.stringify({model:e}),signal:n})}async unload(e,n){await this.request("/models/unload",{method:"POST",body:JSON.stringify({model:e}),signal:n})}async unloadAndWait(e,n){for(await this.unload(e,n);;){let r=(await this.list({signal:n})).find(i=>i.id===e);if(!r||r.status.value==="unloaded")return;await N0t(100,n)}}async download(e,n){await this.request("/models",{method:"POST",body:JSON.stringify({model:e}),signal:n})}async watch(e,n){let r=new Headers;this.apiKey&&r.set("Authorization",`Bearer ${this.apiKey}`);let i=await fetch(`${this.serverUrl}/models/sse`,{headers:r,signal:n});if(!i.ok||!i.body)throw new Error(`llama.cpp SSE returned HTTP ${i.status}`);let s=i.body.getReader(),o=new TextDecoder,a="";for(;;){let c=await s.read();if(c.done)break;a+=o.decode(c.value,{stream:!0}).replaceAll(`\r `,` `);let u=a.indexOf(` `);for(;u>=0;){let l=a.slice(0,u);a=a.slice(u+2);let d=l.split(` -`).filter(h=>h.startsWith("data:")).map(h=>h.slice(5).trimStart()).join(` -`);if(d)try{let h=JSON.parse(d);h&&typeof h.model=="string"&&typeof h.event=="string"&&e(h)}catch{}u=a.indexOf(` +`).filter(m=>m.startsWith("data:")).map(m=>m.slice(5).trimStart()).join(` +`);if(d)try{let m=JSON.parse(d);m&&typeof m.model=="string"&&typeof m.event=="string"&&e(m)}catch{}u=a.indexOf(` -`)}}}async loadAndWait(e,n,r){let s=new AbortController,i=zPn(r,s),o=!1,a;this.watch(c=>{if(c.model!==e||c.event!=="model_status"&&c.event!=="status_change")return;let u=c.data;u?.status==="loaded"&&(o=!0),u?.status==="unloaded"&&(a="Model failed to load");let l=kUs(c.data);l&&n(l)},s.signal).catch(()=>{});try{for(await this.load(e,r),n({message:"Loading model"});;){if(r?.aborted)throw r.reason??new Error("Cancelled");let c=(await this.list({signal:r})).find(u=>u.id===e);if(c?.status.value==="loaded")return c;if(o&&!c)return{id:e,status:{value:"loaded"}};if(c?.status.failed||a)throw new Error(c?.status.exit_code===void 0?a??"Model failed to load":`Model exited with code ${c.status.exit_code}`);await Rot(250,r)}}finally{i(),s.abort()}}async downloadAndWait(e,n,r){let s=new AbortController,i=zPn(r,s),o=!1,a,c=!1,u=0;this.watch(l=>{if(l.model===e&&(l.event==="download_finished"&&(o=!0),l.event==="download_failed"&&(a=KPn(l.data,"Download failed")),l.event==="download_progress")){c=!0;let d=JPn(l.data);d&&n(d)}},s.signal).catch(()=>{});try{for(await this.download(e,r),n({message:"Downloading model"});;){if(r?.aborted)throw r.reason??new Error("Cancelled");if(a)throw new Error(a);let l=await this.list({signal:r});u++;let d=l.find(h=>h.id===e);if(d?.status.value==="downloading"){c=!0;let h=JPn(d.status.progress);h&&n(h)}else if(o||d&&(c||u>=2))return this.list({reload:!0,signal:r});await Rot(500,r)}}finally{i(),s.abort()}}};p();var XPn=require("node:fs/promises"),ZPn=require("node:os"),rTe=require("node:path"),NUs="https://huggingface.co",DUs=/(?:^|[-_.])((?:UD-)?(?:IQ\d(?:_[A-Z0-9]+)+|Q\d(?:_[A-Z0-9]+)+|BF16|F16|F32|MXFP\d(?:_[A-Z0-9]+)*))$/iu,BUs=/-\d{5}-of-\d{5}$/u;function PUs(t,e){if(typeof t!="object"||t===null)return e;let n=t.error;return typeof n=="string"&&n?n:e}function OUs(t){let e=t?.match(/(?:^|;)t=(\d+)/u);return e?Number(e[1]):void 0}async function MUs(t){try{return(await(0,XPn.readFile)(t,"utf8")).trim()||void 0}catch{return}}async function eOn(t=process.env){let e=t.HF_TOKEN?.trim();if(e)return e;let n=[t.HF_TOKEN_PATH,t.HF_HOME?(0,rTe.join)(t.HF_HOME,"token"):void 0,t.XDG_CACHE_HOME?(0,rTe.join)(t.XDG_CACHE_HOME,"huggingface","token"):void 0,(0,rTe.join)((0,ZPn.homedir)(),".cache","huggingface","token")].filter(r=>!!r);for(let r of new Set(n)){let s=await MUs(r);if(s)return s}}var sTe=class{token;baseUrl;constructor(e,n=NUs){this.token=e,this.baseUrl=n.replace(/\/+$/u,"")}async request(e,n){let r=new Headers;this.token&&r.set("Authorization",`Bearer ${this.token}`);let s=AbortSignal.timeout(15e3),i=await fetch(`${this.baseUrl}${e}`,{headers:r,signal:n?AbortSignal.any([n,s]):s}),o;try{o=await i.json()}catch{o=void 0}if(!i.ok){let a=`Hugging Face returned HTTP ${i.status}`;if(i.status===429){let c=Number(i.headers.get("retry-after"))||OUs(i.headers.get("ratelimit"));throw new Error(c?`Hugging Face rate limit reached; retry in ${c}s`:"Hugging Face rate limit reached")}throw new Error(PUs(o,a))}return o}async search(e,n){let r=new URLSearchParams({search:e,filter:"gguf",sort:"downloads",direction:"-1",limit:"20"}),s=await this.request(`/api/models?${r}`,n);if(!Array.isArray(s))throw new Error("Hugging Face returned invalid search results");return s.flatMap(i=>{if(typeof i!="object"||i===null||typeof i.id!="string")return[];let o=i;return[{id:o.id,downloads:typeof o.downloads=="number"?o.downloads:0}]})}async details(e,n){let r=e.split("/").map(encodeURIComponent).join("/"),s=await this.request(`/api/models/${r}?blobs=true`,n);if(typeof s!="object"||s===null)throw new Error("Hugging Face returned invalid model details");let i=s,o=new Map;if(Array.isArray(i.siblings))for(let c of i.siblings){if(typeof c!="object"||c===null)continue;let u=c;if(typeof u.rfilename!="string"||!u.rfilename.toLowerCase().endsWith(".gguf"))continue;let l=u.rfilename.split("/").at(-1);if(l.toLowerCase().startsWith("mmproj"))continue;let h=l.slice(0,-5).replace(BUs,"").match(DUs)?.[1]?.toUpperCase();if(!h)continue;let m=o.get(h)??{total:0,complete:!0};typeof u.size=="number"?m.total+=u.size:m.complete=!1,o.set(h,m)}let a=[...o].map(([c,u])=>({name:c,size:u.complete?u.total:void 0})).sort((c,u)=>c.name==="Q4_K_M"?-1:u.name==="Q4_K_M"?1:(c.size??Number.MAX_SAFE_INTEGER)-(u.size??Number.MAX_SAFE_INTEGER)||c.name.localeCompare(u.name));return{id:typeof i.id=="string"?i.id:e,gated:i.gated==="auto"||i.gated==="manual"?i.gated:!1,quantizations:a}}};p();var XD="llama.cpp",kot="http://127.0.0.1:8080";function sOn(t){let e=t?.env?.LLAMA_BASE_URL;return typeof e=="string"&&e.trim()?JD(e):void 0}async function tOn(t,e){let n=sOn(e)??(await t.env("LLAMA_BASE_URL"))?.trim();return n?JD(n):void 0}function nOn(t,e){return t.status.value==="loaded"||t.status.value==="sleeping"?!0:e&&t.status.value==="unloaded"&&!t.status.failed&&t.source==="preset"}async function LUs(t,e,n){if(!e.some(r=>r.status.value==="unloaded"&&r.source==="preset"))return!1;try{return(await t.props({signal:n})).models_autoload===!0}catch{return!1}}function rOn(t,e){let n=t.meta?.n_ctx??t.meta?.n_ctx_train,r=n&&n>0?n:128e3;return{id:t.id,name:t.id,api:"openai-completions",provider:XD,baseUrl:nTe(e),reasoning:!1,input:t.architecture?.input_modalities?.includes("image")?["text","image"]:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:r,maxTokens:r,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsUsageInStreaming:!0,supportsStrictMode:!1,maxTokensField:"max_tokens"}}}function iOn(){let t=[],e=(r,s,i={})=>{t=r.filter(o=>nOn(o,i.routerAutoload===!0)).map(o=>rOn(o,s))};return{provider:{id:XD,name:"llama.cpp",baseUrl:nTe(kot),auth:{apiKey:{name:"llama.cpp server",login:async r=>{let s=await r.prompt({type:"text",message:"llama.cpp server URL",placeholder:process.env.LLAMA_BASE_URL??kot}),i=JD(s.trim()||process.env.LLAMA_BASE_URL||kot),o=(await r.prompt({type:"secret",message:"API key (optional)"})).trim();return await new wF(i,o||void 0).list({signal:r.signal}),{type:"api_key",key:o||void 0,env:{LLAMA_BASE_URL:i}}},check:async({ctx:r,credential:s})=>await tOn(r,s)?{type:"api_key",source:s?"stored credential":"LLAMA_BASE_URL"}:void 0,resolve:async({ctx:r,credential:s})=>{let i=await tOn(r,s);return i?{auth:{apiKey:s?.key??await r.env("LLAMA_API_KEY")??"local",baseUrl:nTe(i)},env:{...s?.env,LLAMA_BASE_URL:i},source:s?"stored credential":"LLAMA_BASE_URL"}:void 0}}},getModels:()=>t,refreshModels:async r=>{if(r.stored){let u=r.stored.models.filter(l=>l.provider===XD&&l.api==="openai-completions");if(!await r.publish({update:()=>{t=u}}))return}if(!r.allowNetwork||r.signal.aborted||r.credential?.type!=="api_key")return;let s=sOn(r.credential);if(!s)return;let i=new wF(s,r.credential.key),o=await i.list({signal:r.signal});if(r.signal.aborted)return;let a=await LUs(i,o,r.signal);if(r.signal.aborted)return;let c=o.filter(u=>nOn(u,a)).map(u=>rOn(u,s));await r.publish({persist:{models:c,checkedAt:Date.now()},update:()=>{t=c}})},stream:(r,s,i)=>_Ee(r,s,i),streamSimple:(r,s,i)=>pN(r,s,i)},setCatalog:e}}p();var oOn="\0download";function FUs(t){let e=t.meta?.n_ctx??t.meta?.n_ctx_train;if(e)return e>=1e3?`${Math.round(e/1e3)}k`:String(e);let n=t.status.args??[];for(let r=0;r0)return s>=1e3?`${Math.round(s/1e3)}k`:String(s)}}function QUs(t){let e=[],n=t.status.value==="loaded"||t.status.value==="sleeping";n?e.push("loaded"):t.status.value!=="unloaded"&&e.push(t.status.value);let r=n?FUs(t):void 0;return r&&e.push(`${r} context`),e.join(" \xB7 ")}function aOn(t){return{selectedPrefix:e=>t.fg("accent",e),selectedText:e=>t.fg("accent",e),description:e=>t.fg("muted",e),scrollInfo:e=>t.fg("dim",e),noMatch:e=>t.fg("warning",e)}}function AV(t,e,n,r){let s=new _n;s.addChild(new Ln(i=>t.fg("accent",i))),s.addChild(new yt(t.fg("accent",t.bold(e)),1,0));for(let i of n)s.addChild(i);return r&&(s.addChild(new Nt(1)),s.addChild(new yt(t.fg("dim",r),1,0))),s.addChild(new Ln(i=>t.fg("accent",i))),s}function UUs(t){return t>=1e6?`${(t/1e6).toFixed(t>=1e7?0:1)}M`:t>=1e3?`${(t/1e3).toFixed(t>=1e5?0:1)}k`:String(t)}var Not=class extends _n{tui;theme;keybindings;search;cache;onSelectModel;input=new jo;resultsContainer=new _n;results=[];filteredResults=[];selectedIndex=0;query="";status="Type at least 2 characters";debounce;request;closed=!1;_focused=!1;constructor(e,n,r,s,i,o){super(),this.tui=e,this.theme=n,this.keybindings=r,this.search=s,this.cache=i,this.onSelectModel=o,this.addChild(new yt(n.fg("dim","Model name or owner/repository[:quant]"),1,0)),this.addChild(this.input),this.addChild(new Nt(1)),this.addChild(this.resultsContainer),this.updateResults()}get focused(){return this._focused}set focused(e){this._focused=e,this.input.focused=e}updateResults(){this.resultsContainer.clear();let e=10,n=Math.max(0,Math.min(this.selectedIndex-Math.floor(e/2),this.filteredResults.length-e)),r=Math.min(n+e,this.filteredResults.length);for(let s=n;s0||rn.id).map(n=>n.id));this.filteredResults=this.results.filter(n=>e.has(n.id))}else this.filteredResults=this.results;this.selectedIndex=Math.min(this.selectedIndex,Math.max(0,this.filteredResults.length-1)),this.updateResults()}scheduleSearch(){if(this.debounce&&clearTimeout(this.debounce),this.request?.abort(),this.request=void 0,this.query.length<2){this.status="Type at least 2 characters",this.filterResults();return}let e=this.cache.get(this.query.toLowerCase());if(e){this.results=e,this.status=e.length===0?"No GGUF models found":"",this.filterResults();return}this.status="Searching Hugging Face\u2026",this.filterResults(),this.debounce=setTimeout(()=>{this.runSearch(this.query)},500)}async runSearch(e){let n=new AbortController;this.request=n;try{let r=await this.search(e,n.signal);if(this.cache.set(e.toLowerCase(),r),this.closed||n.signal.aborted||this.query!==e)return;this.results=r,this.selectedIndex=0,this.status=r.length===0?"No GGUF models found":"",this.filterResults()}catch(r){if(this.closed||n.signal.aborted||this.query!==e)return;this.results=[],this.status=r instanceof Error?r.message:String(r),this.filterResults()}finally{this.request===n&&(this.request=void 0)}}close(e){this.closed||(this.closed=!0,this.debounce&&clearTimeout(this.debounce),this.request?.abort(),this.onSelectModel(e))}handleInput(e){if(this.keybindings.matches(e,"tui.select.up")){this.filteredResults.length>0&&(this.selectedIndex=this.selectedIndex===0?this.filteredResults.length-1:this.selectedIndex-1,this.updateResults());return}if(this.keybindings.matches(e,"tui.select.down")){this.filteredResults.length>0&&(this.selectedIndex=this.selectedIndex===this.filteredResults.length-1?0:this.selectedIndex+1,this.updateResults());return}if(this.keybindings.matches(e,"tui.select.confirm")){let s=(/^[^/\s]+\/[^:\s]+(?::[^\s:]+)?$/u.test(this.query)?this.query:void 0)??this.filteredResults[this.selectedIndex]?.id;s&&this.close(s);return}if(this.keybindings.matches(e,"tui.select.cancel")){this.close(void 0);return}this.input.handleInput(e);let n=this.input.getValue().trim();n!==this.query&&(this.query=n,this.scheduleSearch())}},Dot=class{tui;theme;keybindings;searchCache=new Map;content;inputHandler;inputTarget;progressPromise;progressResolver;showingProgress=!1;_focused=!1;constructor(e,n,r){this.tui=e,this.theme=n,this.keybindings=r,this.content=AV(n,"llama.cpp models",[new yt(n.fg("muted","Loading\u2026"),1,1)])}get focused(){return this._focused}set focused(e){this._focused=e,this.inputTarget&&(this.inputTarget.focused=e)}setContent(e,n,r){this.inputTarget&&(this.inputTarget.focused=!1),this.progressPromise=void 0,this.progressResolver=void 0,this.showingProgress=!1,this.content=e,this.inputHandler=n,this.inputTarget=r,this.inputTarget&&(this.inputTarget.focused=this._focused),this.tui.requestRender()}showModels(e,n){let r=[...n].sort((o,a)=>+(a.status.value==="loaded")-+(o.status.value==="loaded")||o.id.localeCompare(a.id)),s=new Map(r.map(o=>[o.id,o])),i=[...r.map(o=>({value:o.id,label:o.id,description:QUs(o)})),{value:oOn,label:"Download model\u2026",description:"Hugging Face owner/repository[:quant]"}];return new Promise(o=>{let a=new Xp(i,Math.min(i.length,12),aOn(this.theme),{minPrimaryColumnWidth:36,maxPrimaryColumnWidth:56});a.onSelect=c=>{if(c.value===oOn)o({type:"download"});else{let u=s.get(c.value);u&&o({type:"model",model:u})}},a.onCancel=()=>o({type:"close"}),this.setContent(AV(this.theme,"llama.cpp models",[new yt(this.theme.fg("dim",e),1,0),new Nt(1),a],`${er("tui.select.confirm","load/unload/download")} \u2022 ${er("tui.select.cancel","close")}`),a)})}select(e,n){return new Promise(r=>{let s=new Xp(n.map(i=>({value:i,label:i})),Math.min(n.length,12),aOn(this.theme));s.onSelect=i=>r(i.value),s.onCancel=()=>r(void 0),this.setContent(AV(this.theme,e,[new Nt(1),s],`${er("tui.select.confirm","select")} \u2022 ${er("tui.select.cancel","cancel")}`),s)})}async confirm(e,n){return await this.select(`${e} +`)}}}async loadAndWait(e,n,r){let i=new AbortController,s=Drr(r,i),o=!1,a;this.watch(c=>{if(c.model!==e||c.event!=="model_status"&&c.event!=="status_change")return;let u=c.data;u?.status==="loaded"&&(o=!0),u?.status==="unloaded"&&(a="Model failed to load");let l=Dfs(c.data);l&&n(l)},i.signal).catch(()=>{});try{for(await this.load(e,r),n({message:"Loading model"});;){if(r?.aborted)throw r.reason??new Error("Cancelled");let c=(await this.list({signal:r})).find(u=>u.id===e);if(c?.status.value==="loaded")return c;if(o&&!c)return{id:e,status:{value:"loaded"}};if(c?.status.failed||a)throw new Error(c?.status.exit_code===void 0?a??"Model failed to load":`Model exited with code ${c.status.exit_code}`);await N0t(250,r)}}finally{s(),i.abort()}}async downloadAndWait(e,n,r){let i=new AbortController,s=Drr(r,i),o=!1,a,c=!1,u=0;this.watch(l=>{if(l.model===e&&(l.event==="download_finished"&&(o=!0),l.event==="download_failed"&&(a=Nrr(l.data,"Download failed")),l.event==="download_progress")){c=!0;let d=Prr(l.data);d&&n(d)}},i.signal).catch(()=>{});try{for(await this.download(e,r),n({message:"Downloading model"});;){if(r?.aborted)throw r.reason??new Error("Cancelled");if(a)throw new Error(a);let l=await this.list({signal:r});u++;let d=l.find(m=>m.id===e);if(d?.status.value==="downloading"){c=!0;let m=Prr(d.status.progress);m&&n(m)}else if(o||d&&(c||u>=2))return this.list({reload:!0,signal:r});await N0t(500,r)}}finally{s(),i.abort()}}}});function Lfs(t,e){if(typeof t!="object"||t===null)return e;let n=t.error;return typeof n=="string"&&n?n:e}function Ffs(t){let e=t?.match(/(?:^|;)t=(\d+)/u);return e?Number(e[1]):void 0}async function Qfs(t){try{return(await(0,Mrr.readFile)(t,"utf8")).trim()||void 0}catch{return}}async function Lrr(t=process.env){let e=t.HF_TOKEN?.trim();if(e)return e;let n=[t.HF_TOKEN_PATH,t.HF_HOME?(0,aPe.join)(t.HF_HOME,"token"):void 0,t.XDG_CACHE_HOME?(0,aPe.join)(t.XDG_CACHE_HOME,"huggingface","token"):void 0,(0,aPe.join)((0,Orr.homedir)(),".cache","huggingface","token")].filter(r=>!!r);for(let r of new Set(n)){let i=await Qfs(r);if(i)return i}}var Mrr,Orr,aPe,Pfs,Mfs,Ofs,cPe,Frr=v(()=>{p();Mrr=require("node:fs/promises"),Orr=require("node:os"),aPe=require("node:path"),Pfs="https://huggingface.co",Mfs=/(?:^|[-_.])((?:UD-)?(?:IQ\d(?:_[A-Z0-9]+)+|Q\d(?:_[A-Z0-9]+)+|BF16|F16|F32|MXFP\d(?:_[A-Z0-9]+)*))$/iu,Ofs=/-\d{5}-of-\d{5}$/u;cPe=class{token;baseUrl;constructor(e,n=Pfs){this.token=e,this.baseUrl=n.replace(/\/+$/u,"")}async request(e,n){let r=new Headers;this.token&&r.set("Authorization",`Bearer ${this.token}`);let i=AbortSignal.timeout(15e3),s=await fetch(`${this.baseUrl}${e}`,{headers:r,signal:n?AbortSignal.any([n,i]):i}),o;try{o=await s.json()}catch{o=void 0}if(!s.ok){let a=`Hugging Face returned HTTP ${s.status}`;if(s.status===429){let c=Number(s.headers.get("retry-after"))||Ffs(s.headers.get("ratelimit"));throw new Error(c?`Hugging Face rate limit reached; retry in ${c}s`:"Hugging Face rate limit reached")}throw new Error(Lfs(o,a))}return o}async search(e,n){let r=new URLSearchParams({search:e,filter:"gguf",sort:"downloads",direction:"-1",limit:"20"}),i=await this.request(`/api/models?${r}`,n);if(!Array.isArray(i))throw new Error("Hugging Face returned invalid search results");return i.flatMap(s=>{if(typeof s!="object"||s===null||typeof s.id!="string")return[];let o=s;return[{id:o.id,downloads:typeof o.downloads=="number"?o.downloads:0}]})}async details(e,n){let r=e.split("/").map(encodeURIComponent).join("/"),i=await this.request(`/api/models/${r}?blobs=true`,n);if(typeof i!="object"||i===null)throw new Error("Hugging Face returned invalid model details");let s=i,o=new Map;if(Array.isArray(s.siblings))for(let c of s.siblings){if(typeof c!="object"||c===null)continue;let u=c;if(typeof u.rfilename!="string"||!u.rfilename.toLowerCase().endsWith(".gguf"))continue;let l=u.rfilename.split("/").at(-1);if(l.toLowerCase().startsWith("mmproj"))continue;let m=l.slice(0,-5).replace(Ofs,"").match(Mfs)?.[1]?.toUpperCase();if(!m)continue;let h=o.get(m)??{total:0,complete:!0};typeof u.size=="number"?h.total+=u.size:h.complete=!1,o.set(m,h)}let a=[...o].map(([c,u])=>({name:c,size:u.complete?u.total:void 0})).sort((c,u)=>c.name==="Q4_K_M"?-1:u.name==="Q4_K_M"?1:(c.size??Number.MAX_SAFE_INTEGER)-(u.size??Number.MAX_SAFE_INTEGER)||c.name.localeCompare(u.name));return{id:typeof s.id=="string"?s.id:e,gated:s.gated==="auto"||s.gated==="manual"?s.gated:!1,quantizations:a}}}});function Grr(t){let e=t?.env?.LLAMA_BASE_URL;return typeof e=="string"&&e.trim()?JP(e):void 0}async function Qrr(t,e){let n=Grr(e)??(await t.env("LLAMA_BASE_URL"))?.trim();return n?JP(n):void 0}function Urr(t,e){return t.status.value==="loaded"||t.status.value==="sleeping"?!0:e&&t.status.value==="unloaded"&&!t.status.failed&&t.source==="preset"}async function Ufs(t,e,n){if(!e.some(r=>r.status.value==="unloaded"&&r.source==="preset"))return!1;try{return(await t.props({signal:n})).models_autoload===!0}catch{return!1}}function M0t(t,e,n){let r=t.meta?.n_ctx??t.meta?.n_ctx_train,i=r&&r>0?r:128e3,s=n?.chat_template?.includes("enable_thinking")===!0;return{id:t.id,name:t.id,api:"openai-completions",provider:XP,baseUrl:oPe(e),reasoning:s,...s&&{thinkingLevelMap:{off:"off",minimal:null,low:null,medium:"medium",high:null,xhigh:null}},input:t.architecture?.input_modalities?.includes("image")?["text","image"]:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:i,maxTokens:i,compat:{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsUsageInStreaming:!0,supportsStrictMode:!1,maxTokensField:"max_tokens",...s&&{thinkingFormat:"qwen-chat-template"}}}}function $rr(){let t=[],e=(r,i,s={})=>{t=r.filter(o=>Urr(o,s.routerAutoload===!0)).map(o=>M0t(o,i))};return{provider:{id:XP,name:"llama.cpp",baseUrl:oPe(P0t),auth:{apiKey:{name:"llama.cpp server",login:async r=>{let i=await r.prompt({type:"text",message:"llama.cpp server URL",placeholder:process.env.LLAMA_BASE_URL??P0t}),s=JP(i.trim()||process.env.LLAMA_BASE_URL||P0t),o=(await r.prompt({type:"secret",message:"API key (optional)"})).trim();return await new JU(s,o||void 0).list({signal:r.signal}),{type:"api_key",key:o||void 0,env:{LLAMA_BASE_URL:s}}},check:async({ctx:r,credential:i})=>await Qrr(r,i)?{type:"api_key",source:i?"stored credential":"LLAMA_BASE_URL"}:void 0,resolve:async({ctx:r,credential:i})=>{let s=await Qrr(r,i);return s?{auth:{apiKey:i?.key??await r.env("LLAMA_API_KEY")??"local",baseUrl:oPe(s)},env:{...i?.env,LLAMA_BASE_URL:s},source:i?"stored credential":"LLAMA_BASE_URL"}:void 0}}},getModels:()=>t,refreshModels:async r=>{if(r.stored){let u=r.stored.models.filter(l=>l.provider===XP&&l.api==="openai-completions");if(!await r.publish({update:()=>{t=u}}))return}if(!r.allowNetwork||r.signal.aborted||r.credential?.type!=="api_key")return;let i=Grr(r.credential);if(!i)return;let s=new JU(i,r.credential.key),o=await s.list({signal:r.signal});if(r.signal.aborted)return;let a=await Ufs(s,o,r.signal);if(r.signal.aborted)return;let c=await Promise.all(o.filter(u=>Urr(u,a)).map(async u=>{if(u.status.value!=="loaded")return M0t(u,i);let l=await s.props({model:u.id,signal:r.signal});return M0t(u,i,l)}));r.signal.aborted||await r.publish({persist:{models:c,checkedAt:Date.now()},update:()=>{t=c}})},stream:(r,i,s)=>FIe(r,i,s),streamSimple:(r,i,s)=>iD(r,i,s)},setCatalog:e}}var XP,P0t,Wrr=v(()=>{p();cR();D0t();XP="llama.cpp",P0t="http://127.0.0.1:8080"});function Gfs(t){let e=t.meta?.n_ctx??t.meta?.n_ctx_train;if(e)return e>=1e3?`${Math.round(e/1e3)}k`:String(e);let n=t.status.args??[];for(let r=0;r0)return i>=1e3?`${Math.round(i/1e3)}k`:String(i)}}function $fs(t){let e=[],n=t.status.value==="loaded"||t.status.value==="sleeping";n?e.push("loaded"):t.status.value!=="unloaded"&&e.push(t.status.value);let r=n?Gfs(t):void 0;return r&&e.push(`${r} context`),e.join(" \xB7 ")}function qrr(t){return{selectedPrefix:e=>t.fg("accent",e),selectedText:e=>t.fg("accent",e),description:e=>t.fg("muted",e),scrollInfo:e=>t.fg("dim",e),noMatch:e=>t.fg("warning",e)}}function h9(t,e,n,r){let i=new gn;i.addChild(new Un(s=>t.fg("accent",s))),i.addChild(new Et(t.fg("accent",t.bold(e)),1,0));for(let s of n)i.addChild(s);return r&&(i.addChild(new Tt(1)),i.addChild(new Et(t.fg("dim",r),1,0))),i.addChild(new Un(s=>t.fg("accent",s))),i}function Wfs(t){return t>=1e6?`${(t/1e6).toFixed(t>=1e7?0:1)}M`:t>=1e3?`${(t/1e3).toFixed(t>=1e5?0:1)}k`:String(t)}async function jrr(t,e){await t.ui.custom((n,r,i,s)=>{let o=new L0t(n,r,i);return e(o).then(()=>s(),a=>{t.ui.notify(a instanceof Error?a.message:String(a),"error"),s()}),o})}async function F0t(t,e){let n=new AbortController,r={title:e.title,model:e.model,message:e.initialMessage},i=e.run(n.signal,a=>{Object.assign(r,a),t.updateProgress(r)}).then(a=>({ok:!0,value:a}),a=>({ok:!1,error:a})),s=!1;for(i.finally(()=>{s=!0});!s&&await Promise.race([i.then(()=>"settled"),t.progress(r).then(()=>"stop")])!=="settled";)if(!(!await t.confirm(e.cancelTitle,e.cancelMessage)||s)){try{await e.cancel()}finally{n.abort(new Error("Cancelled"))}return await i,{cancelled:!0}}let o=await i;if(!o.ok)throw o.error;return{cancelled:!1,value:o.value}}var Hrr,O0t,L0t,Vrr=v(()=>{p();Tr();Ll();ha();Hrr="\0download";O0t=class extends gn{tui;theme;keybindings;search;cache;onSelectModel;input=new ma;resultsContainer=new gn;results=[];filteredResults=[];selectedIndex=0;query="";status="Type at least 2 characters";debounce;request;closed=!1;_focused=!1;constructor(e,n,r,i,s,o){super(),this.tui=e,this.theme=n,this.keybindings=r,this.search=i,this.cache=s,this.onSelectModel=o,this.addChild(new Et(n.fg("dim","Model name or owner/repository[:quant]"),1,0)),this.addChild(this.input),this.addChild(new Tt(1)),this.addChild(this.resultsContainer),this.updateResults()}get focused(){return this._focused}set focused(e){this._focused=e,this.input.focused=e}updateResults(){this.resultsContainer.clear();let e=10,n=Math.max(0,Math.min(this.selectedIndex-Math.floor(e/2),this.filteredResults.length-e)),r=Math.min(n+e,this.filteredResults.length);for(let i=n;i0||rn.id).map(n=>n.id));this.filteredResults=this.results.filter(n=>e.has(n.id))}else this.filteredResults=this.results;this.selectedIndex=Math.min(this.selectedIndex,Math.max(0,this.filteredResults.length-1)),this.updateResults()}scheduleSearch(){if(this.debounce&&clearTimeout(this.debounce),this.request?.abort(),this.request=void 0,this.query.length<2){this.status="Type at least 2 characters",this.filterResults();return}let e=this.cache.get(this.query.toLowerCase());if(e){this.results=e,this.status=e.length===0?"No GGUF models found":"",this.filterResults();return}this.status="Searching Hugging Face\u2026",this.filterResults(),this.debounce=setTimeout(()=>{this.runSearch(this.query)},500)}async runSearch(e){let n=new AbortController;this.request=n;try{let r=await this.search(e,n.signal);if(this.cache.set(e.toLowerCase(),r),this.closed||n.signal.aborted||this.query!==e)return;this.results=r,this.selectedIndex=0,this.status=r.length===0?"No GGUF models found":"",this.filterResults()}catch(r){if(this.closed||n.signal.aborted||this.query!==e)return;this.results=[],this.status=r instanceof Error?r.message:String(r),this.filterResults()}finally{this.request===n&&(this.request=void 0)}}close(e){this.closed||(this.closed=!0,this.debounce&&clearTimeout(this.debounce),this.request?.abort(),this.onSelectModel(e))}handleInput(e){if(this.keybindings.matches(e,"tui.select.up")){this.filteredResults.length>0&&(this.selectedIndex=this.selectedIndex===0?this.filteredResults.length-1:this.selectedIndex-1,this.updateResults());return}if(this.keybindings.matches(e,"tui.select.down")){this.filteredResults.length>0&&(this.selectedIndex=this.selectedIndex===this.filteredResults.length-1?0:this.selectedIndex+1,this.updateResults());return}if(this.keybindings.matches(e,"tui.select.confirm")){let i=(/^[^/\s]+\/[^:\s]+(?::[^\s:]+)?$/u.test(this.query)?this.query:void 0)??this.filteredResults[this.selectedIndex]?.id;i&&this.close(i);return}if(this.keybindings.matches(e,"tui.select.cancel")){this.close(void 0);return}this.input.handleInput(e);let n=this.input.getValue().trim();n!==this.query&&(this.query=n,this.scheduleSearch())}},L0t=class{tui;theme;keybindings;searchCache=new Map;content;inputHandler;inputTarget;progressPromise;progressResolver;showingProgress=!1;_focused=!1;constructor(e,n,r){this.tui=e,this.theme=n,this.keybindings=r,this.content=h9(n,"llama.cpp models",[new Et(n.fg("muted","Loading\u2026"),1,1)])}get focused(){return this._focused}set focused(e){this._focused=e,this.inputTarget&&(this.inputTarget.focused=e)}setContent(e,n,r){this.inputTarget&&(this.inputTarget.focused=!1),this.progressPromise=void 0,this.progressResolver=void 0,this.showingProgress=!1,this.content=e,this.inputHandler=n,this.inputTarget=r,this.inputTarget&&(this.inputTarget.focused=this._focused),this.tui.requestRender()}showModels(e,n){let r=[...n].sort((o,a)=>+(a.status.value==="loaded")-+(o.status.value==="loaded")||o.id.localeCompare(a.id)),i=new Map(r.map(o=>[o.id,o])),s=[...r.map(o=>({value:o.id,label:o.id,description:$fs(o)})),{value:Hrr,label:"Download model\u2026",description:"Hugging Face owner/repository[:quant]"}];return new Promise(o=>{let a=new eh(s,Math.min(s.length,12),qrr(this.theme),{minPrimaryColumnWidth:36,maxPrimaryColumnWidth:56});a.onSelect=c=>{if(c.value===Hrr)o({type:"download"});else{let u=i.get(c.value);u&&o({type:"model",model:u})}},a.onCancel=()=>o({type:"close"}),this.setContent(h9(this.theme,"llama.cpp models",[new Et(this.theme.fg("dim",e),1,0),new Tt(1),a],`${nr("tui.select.confirm","load/unload/download")} \u2022 ${nr("tui.select.cancel","close")}`),a)})}select(e,n){return new Promise(r=>{let i=new eh(n.map(s=>({value:s,label:s})),Math.min(n.length,12),qrr(this.theme));i.onSelect=s=>r(s.value),i.onCancel=()=>r(void 0),this.setContent(h9(this.theme,e,[new Tt(1),i],`${nr("tui.select.confirm","select")} \u2022 ${nr("tui.select.cancel","cancel")}`),i)})}async confirm(e,n){return await this.select(`${e} ${n}`,["Yes","No"])==="Yes"}async connectionError(e,n){return await this.select(`llama.cpp unavailable ${e} -${n}`,["Retry","Close"])==="Retry"?"retry":"close"}searchModels(e){return new Promise(n=>{let r=new Not(this.tui,this.theme,this.keybindings,e,this.searchCache,n);this.setContent(AV(this.theme,"Download model",[new Nt(1),r],`${er("tui.select.confirm","select")} \u2022 ${er("tui.select.cancel","back")}`),r,r)})}showStatus(e,n){this.setContent(AV(this.theme,e,[new Nt(1),new yt(this.theme.fg("muted",n),1,0)]))}progress(e){return this.progressPromise||(this.progressPromise=new Promise(n=>{this.progressResolver=n})),this.showingProgress=!0,this.updateProgress(e),this.progressPromise}updateProgress(e){if(!this.showingProgress)return;let n=[new yt(this.theme.fg("text",e.model),1,0),new Nt(1),new yt(this.theme.fg("muted",e.message),1,0)];if(e.ratio!==void 0){let s=Math.round(Math.max(0,Math.min(1,e.ratio))*40);n.push(new yt(this.theme.fg("accent",`${"\u2588".repeat(s)}${"\u2500".repeat(40-s)} ${Math.round(e.ratio*100)}%`),1,0))}e.detail&&n.push(new yt(this.theme.fg("dim",e.detail),1,0)),this.content=AV(this.theme,e.title,n,er("tui.select.cancel","stop")),this.inputHandler=void 0,this.tui.requestRender()}handleInput(e){if(this.progressResolver&&this.keybindings.matches(e,"tui.select.cancel")){let n=this.progressResolver;this.progressPromise=void 0,this.progressResolver=void 0,n();return}this.inputHandler?.handleInput?.(e),this.tui.requestRender()}render(e){return this.content.render(e).map(n=>nn(n)>e?pr(n,e,""):n)}invalidate(){this.content.invalidate()}};async function cOn(t,e){await t.ui.custom((n,r,s,i)=>{let o=new Dot(n,r,s);return e(o).then(()=>i(),a=>{t.ui.notify(a instanceof Error?a.message:String(a),"error"),i()}),o})}async function Bot(t,e){let n=new AbortController,r={title:e.title,model:e.model,message:e.initialMessage},s=e.run(n.signal,a=>{Object.assign(r,a),t.updateProgress(r)}).then(a=>({ok:!0,value:a}),a=>({ok:!1,error:a})),i=!1;for(s.finally(()=>{i=!0});!i&&await Promise.race([s.then(()=>"settled"),t.progress(r).then(()=>"stop")])!=="settled";)if(!(!await t.confirm(e.cancelTitle,e.cancelMessage)||i)){try{await e.cancel()}finally{n.abort(new Error("Cancelled"))}return await s,{cancelled:!0}}let o=await s;if(!o.ok)throw o.error;return{cancelled:!1,value:o.value}}function lOn(t){return t.status.value==="loaded"||t.status.value==="sleeping"}function uOn(t){if(!(t instanceof Error))return!1;let e=`${t.name} ${t.message}`.toLowerCase();return e.includes("fetch failed")||e.includes("timeout")||e.includes("network")}function $Us(t){return uOn(t)?"Could not connect to the server.":t instanceof Error?t.message:String(t)}function GUs(t){let e=t.indexOf(":",t.indexOf("/")+1);return e<0?{repository:t}:{repository:t.slice(0,e),quantization:t.slice(e+1)}}async function WUs(t){let e=await t.modelRegistry.getProviderAuth(XD);if(!e){t.ui.notify(`Configure llama.cpp with /login ${XD}`,"warning");return}let n=e.env?.LLAMA_BASE_URL,r=JD(typeof n=="string"&&n?n:e.auth.baseUrl??"");return new wF(r,e.auth.apiKey)}function Pot(t){let e=iOn();t.registerProvider(e.provider);let n=async(o,a,c)=>{let u=AbortSignal.timeout(15e3),l=c??await a.list({signal:u});e.setCatalog(l,a.serverUrl);let d=await o.modelRegistry.refresh({providers:[XD],allowNetwork:!0,signal:u});if(d.aborted)throw new Error("Model catalog refresh timed out.");let h=d.errors.get(XD);if(h)throw h;return l},r=async(o,a,c,u,l)=>{let d=u.filter(f=>f.id!==l.id&&lOn(f)),h=!1;if(d.length>0){let f=await a.select(`${d.length} model${d.length===1?" is":"s are"} loaded`,["Unload all and load","Keep loaded and load","Cancel"]);if(!f||f==="Cancel")return;h=f==="Unload all and load"}let m=async()=>{o.ui.notify("Restoring previously loaded models");for(let f of d)await c.loadAndWait(f.id,()=>{});await n(o,c)};if(h)for(let f of d)await c.unloadAndWait(f.id);try{if((await Bot(a,{title:"Loading model",model:l.id,initialMessage:"Starting\u2026",cancelTitle:"Stop loading?",cancelMessage:l.id,run:(y,b)=>c.loadAndWait(l.id,b,y),cancel:()=>c.unload(l.id)})).cancelled){h&&await m();return}let A=(await n(o,c)).find(y=>y.id===l.id);o.ui.notify(A?.status.value==="loaded"?`Loaded ${l.id}`:`Load started for ${l.id}`)}catch(f){if(h)try{await m()}catch{}throw f}},s=async(o,a,c,u)=>{await a.confirm("Unload model?",u.id)&&(await c.unloadAndWait(u.id),await n(o,c),o.ui.notify(`Unloaded ${u.id}`))},i=async(o,a,c)=>{let u=new sTe(await eOn()),l=await a.searchModels((A,y)=>u.search(A,y));if(!l)return;let d=GUs(l);a.showStatus("Loading model details",d.repository);let h=await u.details(d.repository);if(h.gated){let A=h.gated==="manual"?"Manual approval is required":"Accept the access terms";if(await a.select(`Hugging Face access required -${h.id} +${n}`,["Retry","Close"])==="Retry"?"retry":"close"}searchModels(e){return new Promise(n=>{let r=new O0t(this.tui,this.theme,this.keybindings,e,this.searchCache,n);this.setContent(h9(this.theme,"Download model",[new Tt(1),r],`${nr("tui.select.confirm","select")} \u2022 ${nr("tui.select.cancel","back")}`),r,r)})}showStatus(e,n){this.setContent(h9(this.theme,e,[new Tt(1),new Et(this.theme.fg("muted",n),1,0)]))}progress(e){return this.progressPromise||(this.progressPromise=new Promise(n=>{this.progressResolver=n})),this.showingProgress=!0,this.updateProgress(e),this.progressPromise}updateProgress(e){if(!this.showingProgress)return;let n=[new Et(this.theme.fg("text",e.model),1,0),new Tt(1),new Et(this.theme.fg("muted",e.message),1,0)];if(e.ratio!==void 0){let i=Math.round(Math.max(0,Math.min(1,e.ratio))*40);n.push(new Et(this.theme.fg("accent",`${"\u2588".repeat(i)}${"\u2500".repeat(40-i)} ${Math.round(e.ratio*100)}%`),1,0))}e.detail&&n.push(new Et(this.theme.fg("dim",e.detail),1,0)),this.content=h9(this.theme,e.title,n,nr("tui.select.cancel","stop")),this.inputHandler=void 0,this.tui.requestRender()}handleInput(e){if(this.progressResolver&&this.keybindings.matches(e,"tui.select.cancel")){let n=this.progressResolver;this.progressPromise=void 0,this.progressResolver=void 0,n();return}this.inputHandler?.handleInput?.(e),this.tui.requestRender()}render(e){return this.content.render(e).map(n=>rn(n)>e?dr(n,e,""):n)}invalidate(){this.content.invalidate()}}});function Yrr(t){return t.status.value==="loaded"||t.status.value==="sleeping"}function zrr(t){if(!(t instanceof Error))return!1;let e=`${t.name} ${t.message}`.toLowerCase();return e.includes("fetch failed")||e.includes("timeout")||e.includes("network")}function Hfs(t){return zrr(t)?"Could not connect to the server.":t instanceof Error?t.message:String(t)}function qfs(t){let e=t.indexOf(":",t.indexOf("/")+1);return e<0?{repository:t}:{repository:t.slice(0,e),quantization:t.slice(e+1)}}async function jfs(t){let e=await t.modelRegistry.getProviderAuth(XP);if(!e){t.ui.notify(`Configure llama.cpp with /login ${XP}`,"warning");return}let n=e.env?.LLAMA_BASE_URL,r=JP(typeof n=="string"&&n?n:e.auth.baseUrl??"");return new JU(r,e.auth.apiKey)}function Q0t(t){let e=$rr();t.registerProvider(e.provider);let n=async(o,a,c)=>{let u=AbortSignal.timeout(15e3),l=c??await a.list({signal:u});e.setCatalog(l,a.serverUrl);let d=await o.modelRegistry.refresh({providers:[XP],allowNetwork:!0,signal:u});if(d.aborted)throw new Error("Model catalog refresh timed out.");let m=d.errors.get(XP);if(m)throw m;return l},r=async(o,a,c,u,l)=>{let d=u.filter(f=>f.id!==l.id&&Yrr(f)),m=!1;if(d.length>0){let f=await a.select(`${d.length} model${d.length===1?" is":"s are"} loaded`,["Unload all and load","Keep loaded and load","Cancel"]);if(!f||f==="Cancel")return;m=f==="Unload all and load"}let h=async()=>{o.ui.notify("Restoring previously loaded models");for(let f of d)await c.loadAndWait(f.id,()=>{});await n(o,c)};if(m)for(let f of d)await c.unloadAndWait(f.id);try{if((await F0t(a,{title:"Loading model",model:l.id,initialMessage:"Starting\u2026",cancelTitle:"Stop loading?",cancelMessage:l.id,run:(y,E)=>c.loadAndWait(l.id,E,y),cancel:()=>c.unload(l.id)})).cancelled){m&&await h();return}let A=(await n(o,c)).find(y=>y.id===l.id);o.ui.notify(A?.status.value==="loaded"?`Loaded ${l.id}`:`Load started for ${l.id}`)}catch(f){if(m)try{await h()}catch{}throw f}},i=async(o,a,c,u)=>{await a.confirm("Unload model?",u.id)&&(await c.unloadAndWait(u.id),await n(o,c),o.ui.notify(`Unloaded ${u.id}`))},s=async(o,a,c)=>{let u=new cPe(await Lrr()),l=await a.searchModels((A,y)=>u.search(A,y));if(!l)return;let d=qfs(l);a.showStatus("Loading model details",d.repository);let m=await u.details(d.repository);if(m.gated){let A=m.gated==="manual"?"Manual approval is required":"Accept the access terms";if(await a.select(`Hugging Face access required +${m.id} ${A} at: -https://huggingface.co/${h.id} - -The llama.cpp server needs HF_TOKEN with access.`,["Continue","Back"])!=="Continue")return}let m=d.quantization;if(!m&&h.quantizations.length>0){let A=h.quantizations.map(b=>{let S=[b.size===void 0?void 0:tTe(b.size),b.name==="Q4_K_M"?"recommended":void 0].filter(C=>!!C).join(" \xB7 ");return S?`${b.name} \xB7 ${S}`:b.name}),y=await a.select(`Select quantization -${h.id}`,A);if(!y||(m=h.quantizations[A.indexOf(y)]?.name,!m))return}let f=m?`${h.id}:${m}`:h.id,g=await Bot(a,{title:"Downloading model",model:f,initialMessage:"Starting\u2026",cancelTitle:"Stop download?",cancelMessage:f,run:(A,y)=>c.downloadAndWait(f,y,A),cancel:()=>c.unload(f)});g.cancelled||(await n(o,c,g.value),o.ui.notify(`Downloaded ${f}`))};t.registerCommand("llama",{description:"Manage llama.cpp router models",handler:async(o,a)=>{if(a.mode!=="tui"){a.ui.notify("/llama is available in interactive mode","warning");return}let c=await WUs(a);c&&await cOn(a,async u=>{let l=async()=>{for(;;)try{return await n(a,c)}catch(h){if(await u.connectionError(c.serverUrl,$Us(h))==="close")return}},d=await l();if(d)for(;;){let h=await u.showModels(c.serverUrl,d);if(h.type==="close")return;let m;try{h.type==="download"?await i(a,u,c):lOn(h.model)?await s(a,u,c,h.model):h.model.status.value==="unloaded"?await r(a,u,c,d,h.model):a.ui.notify(`${h.model.id} is ${h.model.status.value}`,"warning")}catch(g){m=g}let f=await l();if(!f)return;d=f,m&&!uOn(m)&&a.ui.notify(m instanceof Error?m.message:String(m),"error")}})}})}var dOn=[{name:"llama.cpp",factory:Pot,hidden:!0}];p();var Hi=require("fs"),dp=require("path");var qUs="https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/CHANGELOG.md#extensions-migration",HUs="https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/docs/extensions.md";function VUs(){let t=ls(),e=(0,dp.join)(t,"auth.json"),n=(0,dp.join)(t,"oauth.json"),r=(0,dp.join)(t,"settings.json");if((0,Hi.existsSync)(e))return[];let s={},i=[];if((0,Hi.existsSync)(n))try{let o=JSON.parse(Mi((0,Hi.readFileSync)(n,"utf-8")));for(let[a,c]of Object.entries(o))s[a]={type:"oauth",...c},i.push(a);(0,Hi.renameSync)(n,`${n}.migrated`)}catch{}if((0,Hi.existsSync)(r))try{let o=(0,Hi.readFileSync)(r,"utf-8"),a=JSON.parse(Mi(o));if(a.apiKeys&&typeof a.apiKeys=="object"){for(let[c,u]of Object.entries(a.apiKeys))!s[c]&&typeof u=="string"&&(s[c]={type:"api_key",key:u},i.push(c));delete a.apiKeys,(0,Hi.writeFileSync)(r,JSON.stringify(a,null,2))}}catch{}return Object.keys(s).length>0&&((0,Hi.mkdirSync)((0,dp.dirname)(e),{recursive:!0}),(0,Hi.writeFileSync)(e,JSON.stringify(s,null,2),{mode:384})),i}function jUs(){let t=ls(),e;try{e=(0,Hi.readdirSync)(t).filter(n=>n.endsWith(".jsonl")).map(n=>(0,dp.join)(t,n))}catch{return}if(e.length!==0)for(let n of e)try{let s=(0,Hi.readFileSync)(n,"utf8").split(` -`)[0];if(!s?.trim())continue;let i=JSON.parse(s);if(i.type!=="session"||!i.cwd)continue;let a=`--${i.cwd.replace(/^[/\\]/,"").replace(/[/\\:]/g,"-")}--`,c=(0,dp.join)(t,"sessions",a);(0,Hi.existsSync)(c)||(0,Hi.mkdirSync)(c,{recursive:!0});let u=n.split("/").pop()||n.split("\\").pop(),l=(0,dp.join)(c,u);if((0,Hi.existsSync)(l))continue;(0,Hi.renameSync)(n,l)}catch{}}function pOn(t,e){let n=(0,dp.join)(t,"commands"),r=(0,dp.join)(t,"prompts");if((0,Hi.existsSync)(n)&&!(0,Hi.existsSync)(r))try{return(0,Hi.renameSync)(n,r),console.log(en.green(`Migrated ${e} commands/ \u2192 prompts/`)),!0}catch(s){console.log(en.yellow(`Warning: Could not migrate ${e} commands/ to prompts/: ${s instanceof Error?s.message:s}`))}return!1}function YUs(){let t=(0,dp.join)(ls(),"keybindings.json");if((0,Hi.existsSync)(t))try{let e=JSON.parse(Mi((0,Hi.readFileSync)(t,"utf-8")));if(typeof e!="object"||e===null||Array.isArray(e))return;let{config:n,migrated:r}=Sot(e);if(!r)return;(0,Hi.writeFileSync)(t,`${JSON.stringify(n,null,2)} -`,"utf-8")}catch{}}function KUs(){let t=ls(),e=(0,dp.join)(t,"tools"),n=j3();if(!(0,Hi.existsSync)(e))return;let r=["fd","rg","fd.exe","rg.exe"],s=!1;for(let i of r){let o=(0,dp.join)(e,i),a=(0,dp.join)(n,i);if((0,Hi.existsSync)(o))if((0,Hi.existsSync)(n)||(0,Hi.mkdirSync)(n,{recursive:!0}),(0,Hi.existsSync)(a))try{(0,Hi.rmSync)?.(o,{force:!0})}catch{}else try{(0,Hi.renameSync)(o,a),s=!0}catch{}}s&&console.log(en.green("Migrated managed binaries tools/ \u2192 bin/"))}function hOn(t,e){let n=(0,dp.join)(t,"hooks"),r=(0,dp.join)(t,"tools"),s=[];if((0,Hi.existsSync)(n)&&s.push(`${e} hooks/ directory found. Hooks have been renamed to extensions.`),(0,Hi.existsSync)(r))try{(0,Hi.readdirSync)(r).filter(a=>{let c=a.toLowerCase();return c!=="fd"&&c!=="rg"&&c!=="fd.exe"&&c!=="rg.exe"&&!a.startsWith(".")}).length>0&&s.push(`${e} tools/ directory contains custom tools. Custom tools have been merged into extensions.`)}catch{}return s}function zUs(t){let e=ls(),n=(0,dp.join)(t,ws);return pOn(e,"Global"),pOn(n,"Project"),[...hOn(e,"Global"),...hOn(n,"Project")]}async function mOn(t){if(t.length!==0){for(let e of t)console.log(en.yellow(`Warning: ${e}`));console.log(en.yellow(` -Move your extensions to the extensions/ directory.`)),console.log(en.yellow(`Migration guide: ${qUs}`)),console.log(en.yellow(`Documentation: ${HUs}`)),console.log(en.dim(` -Press any key to continue...`)),await new Promise(e=>{process.stdin.setRawMode?.(!0),process.stdin.resume(),process.stdin.once("data",()=>{process.stdin.setRawMode?.(!1),process.stdin.pause(),e()})}),console.log()}}function fOn(t){let e=VUs();jUs(),KUs(),YUs();let n=zUs(t);return{migratedAuthProviders:e,deprecationWarnings:n}}p();p();var KMn=Gt(require("node:crypto"),1),VF=Gt(require("node:fs"),1),vTe=Gt(require("node:os"),1),bl=Gt(require("node:path"),1);var zMn=require("child_process");p();function gOn(t,e,n){let r=e.usage,s=r.input+r.cacheRead+r.cacheWrite;if(!t||s<=0||r.cacheRead+r.cacheWrite===0&&!t.reportedCache)return;let i=Math.min(t.promptTokens,s)-r.cacheRead;if(i<=1024)return;let o=r.input+r.cacheWrite,a=o>0?(r.cost.input+r.cost.cacheWrite)/o:0,c=r.cacheRead>0?r.cost.cacheRead/r.cacheRead:(n.getModel(e.provider,e.model)?.cost.cacheRead??0)/1e6;return{missedTokens:i,missedCost:i*Math.max(0,a-c),idleMs:Math.max(0,e.timestamp-t.timestamp),modelChanged:`${e.provider}/${e.model}`!==t.modelKey}}function JUs(t,e){let n=t.usage,r=n.input+n.cacheRead+n.cacheWrite;if(!(r<=0))return{promptTokens:r,modelKey:`${t.provider}/${t.model}`,timestamp:t.timestamp,reportedCache:e||n.cacheRead+n.cacheWrite>0}}function Oot(t,e){let n,r={missedTokens:0,missedCost:0,missCount:0},s=new Map;for(let i of t){if(i.type==="compaction"||i.type==="branch_summary"){n=void 0;continue}if(i.type==="message"&&i.message.role==="assistant"){let o=gOn(n,i.message,e);o&&(r.missedTokens+=o.missedTokens,r.missedCost+=o.missedCost,r.missCount+=1,s.set(i.message,o)),n=JUs(i.message,n?.reportedCache??!1)??n}}return{prev:n,totals:r,misses:s}}function AOn(t,e){return Oot(t,e).totals}function yOn(t,e){return Oot(t,e).misses}function EOn(t,e,n){return gOn(Oot(t,n).prev,e,n)}p();var Mot=[{name:"settings",description:"Open settings menu"},{name:"model",description:"Select model (opens selector UI)",argumentHint:""},{name:"tree",description:"Navigate session tree (switch branches)"},{name:"thinking",description:"Set thinking level",argumentHint:""},{name:"scoped-models",description:"Enable/disable models for Ctrl+P cycling"},{name:"export",description:"Export session (HTML default, or specify path: .html/.jsonl)"},{name:"import",description:"Import and resume a session from a JSONL file"},{name:"share",description:"Share session as a secret GitHub gist"},{name:"copy",description:"Copy last agent message to clipboard"},{name:"name",description:"Set session display name"},{name:"session",description:"Show session info and stats"},{name:"changelog",description:"Show changelog entries"},{name:"hotkeys",description:"Show all keyboard shortcuts"},{name:"fork",description:"Create a new fork from a previous user message"},{name:"clone",description:"Duplicate the current session at the current position"},{name:"trust",description:"Save project trust decision for future sessions"},{name:"login",description:"Configure provider authentication",argumentHint:""},{name:"logout",description:"Remove provider authentication"},{name:"new",description:"Start a new session"},{name:"compact",description:"Manually compact the session context"},{name:"resume",description:"Resume a different session"},{name:"reload",description:"Reload keybindings, extensions, skills, prompts, themes, and context files"},{name:"quit",description:`Quit ${An}`}];p();function XUs(){return{read:QCe,bash:dee("$"),powershell:dee("PS>"),edit:kCe,write:GCe,grep:BCe,find:NCe,ls:OCe}}function bOn(t,e){let n=XUs()[t];return e?n?{...e,renderCall:e.renderCall??n.renderCall,renderResult:e.renderResult??n.renderResult}:e:n}p();var one=Gt(require("node:path"),1),iTe=require("fs"),Lot="earendil-works/pi",ZUs="packages/coding-agent",e2s=/^https:\/\/github\.com\/(?:badlogic|earendil-works)\/pi-mono(?=\/|$)/,t2s=/^[a-z][a-z0-9+.-]*:/i,n2s=/(!?\[[^\]\n]+\]\()([^\s)]+)((?:\s+[^)]*)?\))/g;function r2s(t){return`${t.major}.${t.minor}.${t.patch}`}function s2s(t){let e=typeof t=="string"?t:r2s(t);return e.startsWith("v")?e:`v${e}`}function i2s(t){let e=t.indexOf("#"),n=e===-1?t:t.slice(0,e),r=e===-1?"":t.slice(e),s=n.indexOf("?");return s===-1?{fragment:r,pathPart:n,query:""}:{fragment:r,pathPart:n.slice(0,s),query:n.slice(s)}}function o2s(t){return t.replaceAll("\\","/")}function a2s(t){let e=o2s(t),n=e.startsWith("/")?one.default.posix.normalize(e.replace(/^\/+/,"")):one.default.posix.normalize(one.default.posix.join(ZUs,e));if(!(n==="."||n.startsWith("../")||n===".."))return n}function c2s(t,e){return t.endsWith("/")?!0:!one.default.posix.basename(e).includes(".")}function l2s(t,e){let n=t.replace(e2s,`https://github.com/${Lot}`),r=`https://github.com/${Lot}`;for(let u of["blob","tree"])for(let l of["main","master"]){let d=`${r}/${u}/${l}/`;n.startsWith(d)&&(n=`${r}/${u}/${e}/${n.slice(d.length)}`)}if(n.startsWith("#")||n.startsWith("//")||t2s.test(n))return n;let{fragment:s,pathPart:i,query:o}=i2s(n);if(!i)return n;let a=a2s(i);if(!a)return n;let c=c2s(i,a)?"tree":"blob";return`https://github.com/${Lot}/${c}/${e}/${encodeURI(a)}${o}${s}`}function Fot(t,e){let n=s2s(e);return t.replace(n2s,(r,s,i,o)=>`${s}${l2s(i,n)}${o}`)}function Qot(t){if(!(0,iTe.existsSync)(t))return[];try{let n=(0,iTe.readFileSync)(t,"utf-8").split(` -`),r=[],s=[],i=null;for(let o of n)if(o.startsWith("## ")){i&&s.length>0&&r.push({...i,content:s.join(` -`).trim()});let a=o.match(/##\s+\[?(\d+)\.(\d+)\.(\d+)\]?/);a?(i={major:Number.parseInt(a[1],10),minor:Number.parseInt(a[2],10),patch:Number.parseInt(a[3],10)},s=[o]):(i=null,s=[])}else i&&s.push(o);return i&&s.length>0&&r.push({...i,content:s.join(` -`).trim()}),r}catch(e){return console.error(`Warning: Could not parse changelog: ${e}`),[]}}function u2s(t,e){return t.major!==e.major?t.major-e.major:t.minor!==e.minor?t.minor-e.minor:t.patch-e.patch}function _On(t,e){let n=e.split(".").map(Number),r={major:n[0]||0,minor:n[1]||0,patch:n[2]||0,content:""};return t.filter(s=>u2s(s,r)>0)}p();var F0=require("child_process"),Wot=require("os");p();var xOn=require("child_process"),wOn=require("crypto"),ane=require("fs"),TOn=require("os"),vOn=require("path");p();var Uot=require("module"),oTe=require("path"),SOn=require("url"),d2s=(0,Uot.createRequire)(_),p2s=(0,Uot.createRequire)((0,SOn.pathToFileURL)((0,oTe.join)((0,oTe.dirname)(process.execPath),"package.json")).href),h2s=process.platform!=="linux"||!!(process.env.DISPLAY||process.env.WAYLAND_DISPLAY);function m2s(t=[d2s,p2s]){for(let e of t)try{return e("@mariozechner/clipboard")}catch{}return null}var $T=!process.env.TERMUX_VERSION&&h2s?m2s():null;var aTe=["image/png","image/jpeg","image/webp","image/gif"],$ot=1e3,f2s=3e3,g2s=5e3,A2s=50*1024*1024;function cTe(t=process.env){return!!t.WAYLAND_DISPLAY||t.XDG_SESSION_TYPE==="wayland"}function cne(t){return t.split(";")[0]?.trim().toLowerCase()??t.toLowerCase()}function ROn(t){switch(cne(t)){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/webp":return"webp";case"image/gif":return"gif";default:return null}}function kOn(t){let e=t.map(r=>r.trim()).filter(Boolean).map(r=>({raw:r,base:cne(r)}));for(let r of aTe){let s=e.find(i=>i.base===r);if(s)return s.raw}return e.find(r=>r.base.startsWith("image/"))?.raw??null}function y2s(t){let e=cne(t);return aTe.some(n=>n===e)}async function E2s(t){let e=await e5();if(!e)return null;try{let n=e.PhotonImage.new_from_byteslice(t);try{return n.get_bytes()}finally{n.free()}}catch{return null}}function yV(t,e,n){let r=n?.timeoutMs??f2s,s=n?.maxBufferBytes??A2s,i=(0,xOn.spawnSync)(t,e,{timeout:r,maxBuffer:s,env:n?.env});return i.error?{ok:!1,stdout:Buffer.alloc(0)}:i.status!==0?{ok:!1,stdout:Buffer.alloc(0)}:{ok:!0,stdout:Buffer.isBuffer(i.stdout)?i.stdout:Buffer.from(i.stdout??"",typeof i.stdout=="string"?"utf-8":void 0)}}function b2s(){let t=yV("wl-paste",["--list-types"],{timeoutMs:$ot});if(!t.ok)return null;let e=t.stdout.toString("utf-8").split(/\r?\n/).map(s=>s.trim()).filter(Boolean),n=kOn(e);if(!n)return null;let r=yV("wl-paste",["--type",n,"--no-newline"]);return!r.ok||r.stdout.length===0?null:{bytes:r.stdout,mimeType:cne(n)}}function _2s(t=process.env){if(t.WSL_DISTRO_NAME||t.WSLENV)return!0;try{let e=(0,ane.readFileSync)("/proc/version","utf-8");return/microsoft|wsl/i.test(e)}catch{return!1}}function S2s(){let t=(0,vOn.join)((0,TOn.tmpdir)(),`pi-wsl-clip-${(0,wOn.randomUUID)()}.png`);try{let e=yV("wslpath",["-w",t],{timeoutMs:$ot});if(!e.ok)return null;let n=e.stdout.toString("utf-8").trim();if(!n)return null;let s=["Add-Type -AssemblyName System.Windows.Forms","Add-Type -AssemblyName System.Drawing",`$path = '${n.replaceAll("'","''")}'`,"$img = [System.Windows.Forms.Clipboard]::GetImage()","if ($img) { $img.Save($path, [System.Drawing.Imaging.ImageFormat]::Png); Write-Output 'ok' } else { Write-Output 'empty' }"].join("; "),i=yV("powershell.exe",["-NoProfile","-Command",s],{timeoutMs:g2s});if(!i.ok||i.stdout.toString("utf-8").trim()!=="ok")return null;let a=(0,ane.readFileSync)(t);return a.length===0?null:{bytes:new Uint8Array(a),mimeType:"image/png"}}catch{return null}finally{try{(0,ane.unlinkSync)(t)}catch{}}}function COn(){let t=yV("xclip",["-selection","clipboard","-t","TARGETS","-o"],{timeoutMs:$ot}),e=[];t.ok&&(e=t.stdout.toString("utf-8").split(/\r?\n/).map(s=>s.trim()).filter(Boolean));let n=e.length>0?kOn(e):null,r=n?[n,...aTe]:[...aTe];for(let s of r){let i=yV("xclip",["-selection","clipboard","-t",s,"-o"]);if(i.ok&&i.stdout.length>0)return{bytes:i.stdout,mimeType:cne(s)}}return null}async function IOn(){if(!$T||!$T.hasImage())return null;let t=await $T.getImageBinary();return!t||t.length===0?null:{bytes:t instanceof Uint8Array?t:Uint8Array.from(t),mimeType:"image/png"}}async function NOn(t){let e=t?.env??process.env,n=t?.platform??process.platform;if(e.TERMUX_VERSION)return null;let r=null;if(n==="linux"){let s=_2s(e),i=cTe(e);(i||s)&&(r=b2s()??COn()),!r&&s&&(r=S2s()),!r&&!i&&(r=await IOn()??COn())}else r=await IOn();if(!r)return null;if(!y2s(r.mimeType)){let s=await E2s(r.bytes);return s?{bytes:s,mimeType:"image/png"}:null}return r}function Got(t){try{(0,F0.execSync)("xclip -selection clipboard",t)}catch{(0,F0.execSync)("xsel --clipboard --input",t)}}var C2s=1e5;function I2s(t=process.env){return!!(t.SSH_CONNECTION||t.SSH_CLIENT||t.MOSH_CONNECTION)}function x2s(t){let e=Buffer.from(t).toString("base64");return e.length>C2s?!1:(process.stdout.write(`\x1B]52;c;${e}\x07`),!0)}var w2s={encoding:"utf8",maxBuffer:50*1024*1024,timeout:5e3};function T2s(){try{return{ok:!0,text:(0,F0.execFileSync)("wl-paste",["--no-newline","--type","text"],w2s)||null}}catch{return{ok:!1}}}async function qot(){if((0,Wot.platform)()==="linux"&&cTe()&&process.env.WAYLAND_DISPLAY){let t=T2s();if(t.ok)return t.text}if(!$T)return null;try{return await $T.getText()||null}catch{return null}}async function TF(t){let e=!1,n=(0,Wot.platform)();try{$T&&n!=="linux"&&(await $T.setText(t),e=!0)}catch{}let r=I2s();if(e&&!r)return;let s={input:t,timeout:5e3,stdio:["pipe","ignore","ignore"]};if(!e)try{if(n==="darwin")(0,F0.execSync)("pbcopy",s),e=!0;else if(n==="win32")(0,F0.execSync)("clip",s),e=!0;else{if(process.env.TERMUX_VERSION)try{(0,F0.execSync)("termux-clipboard-set",s),e=!0}catch{}if(!e){let i=!!process.env.WAYLAND_DISPLAY,o=!!process.env.DISPLAY;if(cTe()&&i)try{(0,F0.execSync)("which wl-copy",{stdio:"ignore"}),await new Promise(u=>{let l=(0,F0.spawn)("wl-copy",[],{stdio:["pipe","ignore","ignore"]});l.on("error",()=>u(1)),l.on("close",d=>u(d??1)),l.stdin.on("error",()=>{}),l.stdin.write(t),l.stdin.end()})===0?e=!0:o&&(Got(s),e=!0)}catch{o&&(Got(s),e=!0)}else o&&(Got(s),e=!0)}}}catch{}if(r||!e){let i=x2s(t);e=e||i}if(!e)throw new Error("Failed to copy to clipboard")}p();var lne=Gt(ttt(),1);var v2s="https://pi.dev/api/latest-version",R2s=1e4;function DOn(t){let e=t instanceof Error&&t.message?t.message:String(t),n=t instanceof Error?t.cause:void 0,r=n instanceof AggregateError?n.errors:n===void 0?[]:[n],s=r.map(o=>typeof o=="object"&&o!==null&&"code"in o&&typeof o.code=="string"?o.code:void 0).filter(o=>o!==void 0);if(s.length>0)return`${e} (${[...new Set(s)].join(", ")})`;let i=r.find(o=>o instanceof Error&&!!o.message)?.message;return i?`${e} (cause: ${i})`:e}function k2s(t,e){let n=(0,lne.valid)(t.trim()),r=(0,lne.valid)(e.trim());if(!(!n||!r))return(0,lne.compare)(n,r)}function Hot(t,e){let n=k2s(t,e);return n!==void 0?n>0:t.trim()!==e.trim()}async function Vot(t,e={}){if(process.env.PI_OFFLINE)return;let n=await AL(v2s,{headers:{"User-Agent":pD(t),accept:"application/json"}},{maxRetries:e.retry?2:0,timeoutMs:e.timeoutMs??R2s});if(!n.ok)return;let r=await n.json();if(typeof r.version!="string"||!r.version.trim())return;let s=typeof r.packageName=="string"&&r.packageName.trim()?r.packageName.trim():void 0,i=typeof r.note=="string"&&r.note.trim()?r.note.trim():void 0;return{version:r.version.trim(),packageName:s,...i?{note:i}:{}}}async function BOn(t){if(!process.env.PI_SKIP_VERSION_CHECK)try{let e=await Vot(t);return e&&Hot(e.version,t)?e:void 0}catch{return}}p();function POn(t){let e=new PN(t.document,{follow:"end",primary:!0,overscroll:"chain",scrollbar:t.scrollbar??"auto",...t.scrollbarTrackStyle===void 0?{}:{scrollbarTrackStyle:t.scrollbarTrackStyle},...t.scrollbarThumbStyle===void 0?{}:{scrollbarThumbStyle:t.scrollbarThumbStyle}}),n=new MM([{component:t.pendingMessages,shrink:1,minSize:0},{component:t.status,shrink:1,minSize:0},...t.widgetsAbove===void 0?[]:[{component:t.widgetsAbove,shrink:1,minSize:0}],{component:t.editor,shrink:1,minSize:3},...t.widgetsBelow===void 0?[]:[{component:t.widgetsBelow,shrink:1,minSize:0}],{component:t.footer,shrink:1,minSize:1}]);return{transcript:e,root:new MM([{component:e,basis:0,grow:1,shrink:1,minSize:1},{component:n,basis:"auto",grow:0,shrink:1,minSize:1}])}}p();var Ey=31,LOn=36,N2s=[255,255,255,127,255,240,255,127,255,237,255,127,255,219,255,127,255,183,255,127,255,119,254,127,63,248,254,127,223,255,254,127,223,63,252,127,159,195,251,127,111,252,244,127,247,15,247,127,247,255,247,127,247,255,227,127,247,7,232,127,239,248,103,112,15,255,187,111,241,0,208,91,253,63,236,83,193,255,239,87,159,253,238,95,159,252,174,95,31,120,172,95,63,0,80,108,127,0,220,119,255,192,63,120,255,1,248,127,255,3,156,120,255,7,140,124,255,15,206,120,255,255,207,127,255,255,207,120,255,255,223,120,255,255,223,125,255,255,63,126,255,255,255,127],D2s=Math.ceil(Ey/8),pp=Math.ceil(LOn/2),OOn=["typewriter","scanline","rain","fade","crt","glitch","dissolve"];function MOn(t,e){if(e>=LOn)return!1;let n=e*D2s+Math.floor(t/8),r=t%8;return(N2s[n]>>r&1)===0}function B2s(t,e){let n=MOn(t,e*2),r=MOn(t,e*2+1);return n&&r?"\u2588":n?"\u2580":r?"\u2584":" "}function P2s(){let t=[];for(let e=0;e{let a=o.slice(0,r).join(""),c=Math.max(0,e-n-a.length);return` ${Se.fg("accent",a)}${" ".repeat(c)}`});let s="ARMIN SAYS HI",i=Math.max(0,e-n-s.length);return this.cachedLines.push(` ${Se.fg("accent",s)}${" ".repeat(i)}`),this.cachedWidth=e,this.cachedVersion=this.gridVersion,this.cachedLines}createEmptyGrid(){return Array.from({length:pp},()=>Array(Ey).fill(" "))}initEffect(){switch(this.effect){case"typewriter":this.effectState={pos:0};break;case"scanline":this.effectState={row:0};break;case"rain":this.effectState={drops:Array.from({length:Ey},()=>({y:-Math.floor(Math.random()*pp*2),settled:0}))};break;case"fade":{let e=[];for(let n=0;n0;n--){let r=Math.floor(Math.random()*(n+1));[e[n],e[r]]=[e[r],e[n]]}this.effectState={positions:e,idx:0};break}case"crt":this.effectState={expansion:0};break;case"glitch":this.effectState={phase:0,glitchFrames:8};break;case"dissolve":{this.currentGrid=Array.from({length:pp},()=>Array.from({length:Ey},()=>{let n=[" ","\u2591","\u2592","\u2593","\u2588","\u2580","\u2584"];return n[Math.floor(Math.random()*n.length)]}));let e=[];for(let n=0;n0;n--){let r=Math.floor(Math.random()*(n+1));[e[n],e[r]]=[e[r],e[n]]}this.effectState={positions:e,idx:0};break}}}startAnimation(){let e=this.effect==="glitch"?60:30;this.interval=setInterval(()=>{let n=this.tickEffect();this.updateDisplay(),this.ui.requestRender(),n&&this.stopAnimation()},1e3/e)}stopAnimation(){this.interval&&(clearInterval(this.interval),this.interval=null)}tickEffect(){switch(this.effect){case"typewriter":return this.tickTypewriter();case"scanline":return this.tickScanline();case"rain":return this.tickRain();case"fade":return this.tickFade();case"crt":return this.tickCrt();case"glitch":return this.tickGlitch();case"dissolve":return this.tickDissolve();default:return!0}}tickTypewriter(){let e=this.effectState,n=3;for(let r=0;r=pp)return!0;this.currentGrid[s][i]=this.finalGrid[s][i],e.pos++}return!1}tickScanline(){let e=this.effectState;if(e.row>=pp)return!0;for(let n=0;n=pp-s.settled;o--)o>=0&&(this.currentGrid[o][r]=this.finalGrid[o][r]);if(s.settled>=pp)continue;n=!1;let i=-1;for(let o=pp-1-s.settled;o>=0;o--)if(this.finalGrid[o][r]!==" "){i=o;break}s.y++,s.y>=0&&s.y=0&&s.y>=i?(s.settled=pp-i,s.y=-Math.floor(Math.random()*5)-1):this.currentGrid[s.y][r]="\u2593")}return n}tickFade(){let e=this.effectState,n=15;for(let r=0;r=e.positions.length)return!0;let[s,i]=e.positions[e.idx];this.currentGrid[s][i]=this.finalGrid[s][i],e.idx++}return!1}tickCrt(){let e=this.effectState,n=Math.floor(pp/2);this.currentGrid=this.createEmptyGrid();let r=n-e.expansion,s=n+e.expansion;for(let i=Math.max(0,r);i<=Math.min(pp-1,s);i++)for(let o=0;opp}tickGlitch(){let e=this.effectState;return e.phase{let r=Math.floor(Math.random()*7)-3,s=[...n];if(Math.random()<.3)return s.slice(r).concat(s.slice(0,r)).slice(0,Ey);if(Math.random()<.2){let i=Math.floor(Math.random()*pp);return[...this.finalGrid[i]]}return s}),e.phase++,!1):(this.currentGrid=this.finalGrid.map(n=>[...n]),!0)}tickDissolve(){let e=this.effectState,n=20;for(let r=0;r=e.positions.length)return!0;let[s,i]=e.positions[e.idx];this.currentGrid[s][i]=this.finalGrid[s][i],e.idx++}return!1}updateDisplay(){this.gridVersion++}dispose(){this.stopAnimation()}};p();p();function une(t,e,n){return(r,s)=>O2s(r,{messageType:t,isStreaming:e,availableWidth:s},n)}function O2s(t,e,n){let r=t;for(let s of n)try{let i=s(r,e);typeof i=="string"&&(r=i)}catch{}return r}var M2s="\x1B]133;A\x07",L2s="\x1B]133;B\x07",F2s="\x1B]133;C\x07",Q0=class extends _n{contentContainer;hideThinkingBlock;markdownTheme;hiddenThinkingLabel;outputPad;markdownTransformers;lastMessage;hasToolCalls=!1;isStreaming=!1;thinkingVisibilityOverrides=new Map;constructor(e,n=!1,r=Fh(),s="Thinking...",i=1,o=[]){super(),this.hideThinkingBlock=n,this.markdownTheme=r,this.hiddenThinkingLabel=s,this.outputPad=i,this.markdownTransformers=o,this.contentContainer=new _n,this.addChild(this.contentContainer),e&&this.updateContent(e)}invalidate(){super.invalidate(),this.lastMessage&&this.updateContent(this.lastMessage)}setHideThinkingBlock(e){this.hideThinkingBlock=e,this.thinkingVisibilityOverrides.clear(),this.lastMessage&&this.updateContent(this.lastMessage)}setHiddenThinkingLabel(e){this.hiddenThinkingLabel=e,this.lastMessage&&this.updateContent(this.lastMessage)}setOutputPad(e){this.outputPad=e,this.lastMessage&&this.updateContent(this.lastMessage)}render(e){let n=super.render(e);return this.hasToolCalls||n.length===0||(n[0]=M2s+n[0],n[n.length-1]=L2s+F2s+n[n.length-1]),n}updateContent(e,n=this.isStreaming){this.lastMessage=e,this.isStreaming=n,this.contentContainer.clear(),e.content.some(o=>o.type==="text"&&o.text.trim()||o.type==="thinking"&&o.thinking.trim())&&this.contentContainer.addChild(new Nt(1));let s=0;for(let o=0;om.type==="text"&&m.text.trim()||m.type==="thinking"&&m.thinking.trim()),l=s++,d=this.thinkingVisibilityOverrides.get(l)??this.hideThinkingBlock,h=d?new yt(Se.italic(Se.fg("thinkingText",this.hiddenThinkingLabel)),this.outputPad,0):new Hc(c.join(` - -`),this.outputPad,0,this.markdownTheme,{color:m=>Se.fg("thinkingText",m),italic:!0},{transform:une("assistant-thinking",this.isStreaming,this.markdownTransformers)});this.contentContainer.addChild(new BN(h,m=>{if(!(m.type!=="click"||m.button!=="left"))return this.thinkingVisibilityOverrides.set(l,!d),this.lastMessage&&this.updateContent(this.lastMessage),{handled:!0}})),u&&this.contentContainer.addChild(new Nt(1))}}let i=e.content.some(o=>o.type==="toolCall");if(this.hasToolCalls=i,e.stopReason==="length")this.contentContainer.addChild(new Nt(1)),this.contentContainer.addChild(new yt(Se.fg("error","Response was truncated before completion."),this.outputPad,0));else if(!i){if(e.stopReason==="aborted"){let o=e.errorMessage&&e.errorMessage!=="Request was aborted"?e.errorMessage:"Operation aborted";this.contentContainer.addChild(new Nt(1)),this.contentContainer.addChild(new yt(Se.fg("error",o),this.outputPad,0))}else if(e.stopReason==="error"){let o=e.errorMessage||"Unknown error";this.contentContainer.addChild(new Nt(1)),this.contentContainer.addChild(new yt(Se.fg("error",`Error: ${o}`),this.outputPad,0))}}}};p();var FOn=20,GT=class extends _n{command;outputLines=[];status="running";exitCode=void 0;loader;truncationResult;fullOutputPath;expanded=!1;contentContainer;constructor(e,n,r=!1){super(),this.command=e;let s=r?"dim":"bashMode",i=a=>Se.fg(s,a);this.addChild(new Nt(1)),this.addChild(new Ln(i)),this.contentContainer=new _n,this.addChild(this.contentContainer);let o=new yt(Se.fg(s,Se.bold(`$ ${e}`)),1,0);this.contentContainer.addChild(o),this.loader=new qE(n,a=>Se.fg(s,a),a=>Se.fg("muted",a),`Running... (${ra("tui.select.cancel")} to cancel)`),this.contentContainer.addChild(this.loader),this.addChild(new Ln(i))}setExpanded(e){this.expanded=e,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}appendOutput(e){let r=r5(e).replace(/\r\n/g,` +https://huggingface.co/${m.id} + +The llama.cpp server needs HF_TOKEN with access.`,["Continue","Back"])!=="Continue")return}let h=d.quantization;if(!h&&m.quantizations.length>0){let A=m.quantizations.map(E=>{let _=[E.size===void 0?void 0:sPe(E.size),E.name==="Q4_K_M"?"recommended":void 0].filter(S=>!!S).join(" \xB7 ");return _?`${E.name} \xB7 ${_}`:E.name}),y=await a.select(`Select quantization +${m.id}`,A);if(!y||(h=m.quantizations[A.indexOf(y)]?.name,!h))return}let f=h?`${m.id}:${h}`:m.id,g=await F0t(a,{title:"Downloading model",model:f,initialMessage:"Starting\u2026",cancelTitle:"Stop download?",cancelMessage:f,run:(A,y)=>c.downloadAndWait(f,y,A),cancel:()=>c.unload(f)});g.cancelled||(await n(o,c,g.value),o.ui.notify(`Downloaded ${f}`))};t.registerCommand("llama",{description:"Manage llama.cpp router models",handler:async(o,a)=>{if(a.mode!=="tui"){a.ui.notify("/llama is available in interactive mode","warning");return}let c=await jfs(a);c&&await jrr(a,async u=>{let l=async()=>{for(;;)try{return await n(a,c)}catch(m){if(await u.connectionError(c.serverUrl,Hfs(m))==="close")return}},d=await l();if(d)for(;;){let m=await u.showModels(c.serverUrl,d);if(m.type==="close")return;let h;try{m.type==="download"?await s(a,u,c):Yrr(m.model)?await i(a,u,c,m.model):m.model.status.value==="unloaded"?await r(a,u,c,d,m.model):a.ui.notify(`${m.model.id} is ${m.model.status.value}`,"warning")}catch(g){h=g}let f=await l();if(!f)return;d=f,h&&!zrr(h)&&a.ui.notify(h instanceof Error?h.message:String(h),"error")}})}})}var Krr=v(()=>{p();D0t();Frr();Wrr();Vrr()});var Jrr,Xrr=v(()=>{p();Krr();Jrr=[{name:"llama.cpp",factory:Q0t,hidden:!0}]});function zfs(){let t=ii(),e=(0,dm.join)(t,"auth.json"),n=(0,dm.join)(t,"oauth.json"),r=(0,dm.join)(t,"settings.json");if((0,io.existsSync)(e))return[];let i={},s=[];if((0,io.existsSync)(n))try{let o=JSON.parse(zs((0,io.readFileSync)(n,"utf-8")));for(let[a,c]of Object.entries(o))i[a]={type:"oauth",...c},s.push(a);(0,io.renameSync)(n,`${n}.migrated`)}catch{}if((0,io.existsSync)(r))try{let o=(0,io.readFileSync)(r,"utf-8"),a=JSON.parse(zs(o));if(a.apiKeys&&typeof a.apiKeys=="object"){for(let[c,u]of Object.entries(a.apiKeys))!i[c]&&typeof u=="string"&&(i[c]={type:"api_key",key:u},s.push(c));delete a.apiKeys,(0,io.writeFileSync)(r,JSON.stringify(a,null,2))}}catch{}return Object.keys(i).length>0&&((0,io.mkdirSync)((0,dm.dirname)(e),{recursive:!0}),(0,io.writeFileSync)(e,JSON.stringify(i,null,2),{mode:384})),s}function Kfs(){let t=ii(),e;try{e=(0,io.readdirSync)(t).filter(n=>n.endsWith(".jsonl")).map(n=>(0,dm.join)(t,n))}catch{return}if(e.length!==0)for(let n of e)try{let i=(0,io.readFileSync)(n,"utf8").split(` +`)[0];if(!i?.trim())continue;let s=JSON.parse(i);if(s.type!=="session"||!s.cwd)continue;let a=`--${s.cwd.replace(/^[/\\]/,"").replace(/[/\\:]/g,"-")}--`,c=(0,dm.join)(t,"sessions",a);(0,io.existsSync)(c)||(0,io.mkdirSync)(c,{recursive:!0});let u=n.split("/").pop()||n.split("\\").pop(),l=(0,dm.join)(c,u);if((0,io.existsSync)(l))continue;(0,io.renameSync)(n,l)}catch{}}function Zrr(t,e){let n=(0,dm.join)(t,"commands"),r=(0,dm.join)(t,"prompts");if((0,io.existsSync)(n)&&!(0,io.existsSync)(r))try{return(0,io.renameSync)(n,r),console.log(tn.green(`Migrated ${e} commands/ \u2192 prompts/`)),!0}catch(i){console.log(tn.yellow(`Warning: Could not migrate ${e} commands/ to prompts/: ${i instanceof Error?i.message:i}`))}return!1}function Jfs(){let t=(0,dm.join)(ii(),"keybindings.json");if((0,io.existsSync)(t))try{let e=JSON.parse(zs((0,io.readFileSync)(t,"utf-8")));if(typeof e!="object"||e===null||Array.isArray(e))return;let{config:n,migrated:r}=x0t(e);if(!r)return;(0,io.writeFileSync)(t,`${JSON.stringify(n,null,2)} +`,"utf-8")}catch{}}function Xfs(){let t=ii(),e=(0,dm.join)(t,"tools"),n=P8();if(!(0,io.existsSync)(e))return;let r=["fd","rg","fd.exe","rg.exe"],i=!1;for(let s of r){let o=(0,dm.join)(e,s),a=(0,dm.join)(n,s);if((0,io.existsSync)(o))if((0,io.existsSync)(n)||(0,io.mkdirSync)(n,{recursive:!0}),(0,io.existsSync)(a))try{(0,io.rmSync)?.(o,{force:!0})}catch{}else try{(0,io.renameSync)(o,a),i=!0}catch{}}i&&console.log(tn.green("Migrated managed binaries tools/ \u2192 bin/"))}function eir(t,e){let n=(0,dm.join)(t,"hooks"),r=(0,dm.join)(t,"tools"),i=[];if((0,io.existsSync)(n)&&i.push(`${e} hooks/ directory found. Hooks have been renamed to extensions.`),(0,io.existsSync)(r))try{(0,io.readdirSync)(r).filter(a=>{let c=a.toLowerCase();return c!=="fd"&&c!=="rg"&&c!=="fd.exe"&&c!=="rg.exe"&&!a.startsWith(".")}).length>0&&i.push(`${e} tools/ directory contains custom tools. Custom tools have been merged into extensions.`)}catch{}return i}function Zfs(t){let e=ii(),n=(0,dm.join)(t,Bi);return Zrr(e,"Global"),Zrr(n,"Project"),[...eir(e,"Global"),...eir(n,"Project")]}async function tir(t){if(t.length!==0){for(let e of t)console.log(tn.yellow(`Warning: ${e}`));console.log(tn.yellow(` +Move your extensions to the extensions/ directory.`)),console.log(tn.yellow(`Migration guide: ${Vfs}`)),console.log(tn.yellow(`Documentation: ${Yfs}`)),console.log(tn.dim(` +Press any key to continue...`)),await new Promise(e=>{process.stdin.setRawMode?.(!0),process.stdin.resume(),process.stdin.once("data",()=>{process.stdin.setRawMode?.(!1),process.stdin.pause(),e()})}),console.log()}}function nir(t){let e=zfs();Kfs(),Xfs(),Jfs();let n=Zfs(t);return{migratedAuthProviders:e,deprecationWarnings:n}}var io,dm,Vfs,Yfs,rir=v(()=>{p();gb();io=require("fs"),dm=require("path");Qs();m9();nm();Vfs="https://github.com/earendil-works/pi/blob/main/packages/coding-agent/CHANGELOG.md#extensions-migration",Yfs="https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/extensions.md"});function iir(t,e,n){let r=e.usage,i=r.input+r.cacheRead+r.cacheWrite;if(!t||i<=0||r.cacheRead+r.cacheWrite===0&&!t.reportedCache)return;let s=Math.min(t.promptTokens,i)-r.cacheRead;if(s<=1024)return;let o=r.input+r.cacheWrite,a=o>0?(r.cost.input+r.cost.cacheWrite)/o:0,c=r.cacheRead>0?r.cost.cacheRead/r.cacheRead:(n.getModel(e.provider,e.model)?.cost.cacheRead??0)/1e6;return{missedTokens:s,missedCost:s*Math.max(0,a-c),idleMs:Math.max(0,e.timestamp-t.timestamp),modelChanged:`${e.provider}/${e.model}`!==t.modelKey}}function egs(t,e){let n=t.usage,r=n.input+n.cacheRead+n.cacheWrite;if(!(r<=0))return{promptTokens:r,modelKey:`${t.provider}/${t.model}`,timestamp:t.timestamp,reportedCache:e||n.cacheRead+n.cacheWrite>0}}function U0t(t,e){let n,r={missedTokens:0,missedCost:0,missCount:0},i=new Map;for(let s of t){if(s.type==="compaction"||s.type==="branch_summary"){n=void 0;continue}if(s.type==="usage"&&s.kind==="cache_warm"){let o=s.usage.input+s.usage.cacheRead+s.usage.cacheWrite;o>0&&(n={promptTokens:o,modelKey:`${s.provider}/${s.model}`,timestamp:Date.parse(s.timestamp),reportedCache:!0})}else if(s.type==="message"&&s.message.role==="assistant"){let o=iir(n,s.message,e);o&&(r.missedTokens+=o.missedTokens,r.missedCost+=o.missedCost,r.missCount+=1,i.set(s.message,o)),n=egs(s.message,n?.reportedCache??!1)??n}}return{prev:n,totals:r,misses:i}}function sir(t,e){return U0t(t,e).totals}function oir(t,e){return U0t(t,e).misses}function air(t,e,n){return iir(U0t(t,n).prev,e,n)}var cir=v(()=>{p()});function uPe(t=ii()){return(0,lPe.join)(t,"crashes.json")}function dPe(t=uPe()){try{let e=JSON.parse((0,ZP.readFileSync)(t,"utf8"));return Array.isArray(e)?e.filter(n=>typeof n=="object"&&n!==null&&typeof n.timestamp=="string"&&typeof n.message=="string"):[]}catch{return[]}}function lir(t,e){(0,ZP.mkdirSync)((0,lPe.dirname)(e),{recursive:!0}),(0,ZP.writeFileSync)(e,`${JSON.stringify(t,null,2)} +`)}function uir(t){return t.replace(/\\/g,"/").replace(/\/+$/u,"")}function G0t(t,e,n){let r=uir(e);if(!r||r.startsWith("<"))return!1;let i=/^[a-z]:\//iu.test(r),s=i?t.toLowerCase():t,o=i?r.toLowerCase():r;if(n)return s.includes(`${o}/`);let a=s.indexOf(o);for(;a!==-1;){let c=s[a+o.length];if(c===void 0||c===":"||c===")"||/\s/u.test(c))return!0;a=s.indexOf(o,a+o.length)}return!1}function dir(t,e){if(!t)return[];let n=t.split(` +`).slice(1).filter(s=>/^\s+at\s/u.test(s)).map(s=>{try{return decodeURI(s)}catch{return s}}).join(` +`).replace(/\\/g,"/"),r=[],i=new Set;for(let s of e){let o=uir(s.resolvedPath),a=s.sourceInfo.origin==="package"&&!/^(?:npm:|git:|https?:\/\/|ssh:\/\/)/u.test(s.sourceInfo.source)&&/\.[cm]?[jt]s$/u.test(s.sourceInfo.source),c=s.sourceInfo.origin==="package"&&!a&&s.sourceInfo.baseDir?s.sourceInfo.baseDir:void 0,u=o.lastIndexOf("/"),l=/\/index\.[cm]?[jt]s$/u.test(o);if(!(c?G0t(n,c,!0):l&&u!==-1?G0t(n,o.slice(0,u),!0):G0t(n,o,!1)))continue;let m=s.sourceInfo.origin==="package"&&s.sourceInfo.source?s.sourceInfo.source:s.path;i.has(m)||(i.add(m),r.push(m))}return r}function pir(t,e=uPe()){try{let{error:n}=t,r={timestamp:new Date().toISOString(),version:Nl,kind:t.kind,message:n instanceof Error?n.message||n.name:String(n),stack:n instanceof Error&&n.stack?n.stack:null,sessionFile:t.sessionFile??null,cwd:t.cwd};return lir([...dPe(e),r].slice(-tgs),e),r}catch{return}}function mir(t=uPe(),e=Date.now()){let n=dPe(t),r=[...n].reverse().find(i=>!i.notified&&e-Date.parse(i.timestamp)<=ngs);if(r){try{lir(n.map(i=>i.notified?i:{...i,notified:!0}),t)}catch{}return r}}function hir(t=uPe()){try{(0,ZP.rmSync)(t,{force:!0})}catch{}}var ZP,lPe,tgs,ngs,$0t=v(()=>{p();ZP=require("node:fs"),lPe=require("node:path");Qs();tgs=5,ngs=10080*60*1e3});var W0t,fir=v(()=>{p();Qs();W0t=[{name:"settings",description:"Open settings menu"},{name:"model",description:"Select model (opens selector UI)",argumentHint:""},{name:"tree",description:"Navigate session tree (switch branches)"},{name:"thinking",description:"Set thinking level",argumentHint:""},{name:"scoped-models",description:"Enable/disable models for Ctrl+P cycling"},{name:"export",description:"Export session (HTML default, or specify path: .html/.jsonl)"},{name:"import",description:"Import and resume a session from a JSONL file"},{name:"share",description:"Share session as a secret GitHub gist"},{name:"bug",description:"Report a bug to the Pi developers",argumentHint:""},{name:"copy",description:"Copy last agent message to clipboard"},{name:"name",description:"Set session display name"},{name:"session",description:"Show session info and stats"},{name:"changelog",description:"Show changelog entries"},{name:"hotkeys",description:"Show all keyboard shortcuts"},{name:"fork",description:"Create a new fork from a previous user message"},{name:"clone",description:"Duplicate the current session at the current position"},{name:"trust",description:"Save project trust decision for future sessions"},{name:"login",description:"Configure provider authentication",argumentHint:""},{name:"logout",description:"Remove provider authentication"},{name:"new",description:"Start a new session"},{name:"compact",description:"Manually compact the session context"},{name:"resume",description:"Resume a different session"},{name:"reload",description:"Reload keybindings, extensions, skills, prompts, themes, and context files"},{name:"quit",description:`Quit ${hn}`}]});function rgs(){return{read:D1e,bash:Fse("$"),powershell:Fse("PS>"),edit:x1e,write:O1e,grep:T1e,find:I1e,ls:R1e}}function gir(t,e){let n=rgs()[t];return e?n?{...e,renderCall:e.renderCall??n.renderCall,renderResult:e.renderResult??n.renderResult}:e:n}var Air=v(()=>{p();lmt();fmt();bmt();xmt();Imt();Nmt();Omt()});function cgs(t){return`${t.major}.${t.minor}.${t.patch}`}function lgs(t){let e=typeof t=="string"?t:cgs(t);return e.startsWith("v")?e:`v${e}`}function ugs(t){let e=t.indexOf("#"),n=e===-1?t:t.slice(0,e),r=e===-1?"":t.slice(e),i=n.indexOf("?");return i===-1?{fragment:r,pathPart:n,query:""}:{fragment:r,pathPart:n.slice(0,i),query:n.slice(i)}}function dgs(t){return t.replaceAll("\\","/")}function pgs(t){let e=dgs(t),n=e.startsWith("/")?qae.default.posix.normalize(e.replace(/^\/+/,"")):qae.default.posix.normalize(qae.default.posix.join(igs,e));if(!(n==="."||n.startsWith("../")||n===".."))return n}function mgs(t,e){return t.endsWith("/")?!0:!qae.default.posix.basename(e).includes(".")}function hgs(t,e){let n=t.replace(sgs,`https://github.com/${H0t}`),r=`https://github.com/${H0t}`;for(let u of["blob","tree"])for(let l of["main","master"]){let d=`${r}/${u}/${l}/`;n.startsWith(d)&&(n=`${r}/${u}/${e}/${n.slice(d.length)}`)}if(n.startsWith("#")||n.startsWith("//")||ogs.test(n))return n;let{fragment:i,pathPart:s,query:o}=ugs(n);if(!s)return n;let a=pgs(s);if(!a)return n;let c=mgs(s,a)?"tree":"blob";return`https://github.com/${H0t}/${c}/${e}/${encodeURI(a)}${o}${i}`}function q0t(t,e){let n=lgs(e);return t.replace(ags,(r,i,s,o)=>`${i}${hgs(s,n)}${o}`)}function j0t(t){if(!(0,pPe.existsSync)(t))return[];try{let n=(0,pPe.readFileSync)(t,"utf-8").split(` +`),r=[],i=[],s=null;for(let o of n)if(o.startsWith("## ")){s&&i.length>0&&r.push({...s,content:i.join(` +`).trim()});let a=o.match(/##\s+\[?(\d+)\.(\d+)\.(\d+)\]?/);a?(s={major:Number.parseInt(a[1],10),minor:Number.parseInt(a[2],10),patch:Number.parseInt(a[3],10)},i=[o]):(s=null,i=[])}else s&&i.push(o);return s&&i.length>0&&r.push({...s,content:i.join(` +`).trim()}),r}catch(e){return console.error(`Warning: Could not parse changelog: ${e}`),[]}}function fgs(t,e){return t.major!==e.major?t.major-e.major:t.minor!==e.minor?t.minor-e.minor:t.patch-e.patch}function yir(t,e){let n=e.split(".").map(Number),r={major:n[0]||0,minor:n[1]||0,patch:n[2]||0,content:""};return t.filter(i=>fgs(i,r)>0)}var qae,pPe,H0t,igs,sgs,ogs,ags,Eir=v(()=>{p();qae=Ot(require("node:path"),1),pPe=require("fs");Qs();H0t="earendil-works/pi",igs="packages/coding-agent",sgs=/^https:\/\/github\.com\/(?:badlogic|earendil-works)\/pi-mono(?=\/|$)/,ogs=/^[a-z][a-z0-9+.-]*:/i,ags=/(!?\[[^\]\n]+\]\()([^\s)]+)((?:\s+[^)]*)?\))/g});function n_(t,e,n){return new Promise(r=>{let i=(0,bir.spawn)(t,e,{stdio:["pipe",n?.input===void 0?"pipe":"ignore","ignore"],windowsHide:!0}),s=[],o=0,a=!1,c=d=>{a||(a=!0,clearTimeout(l),r(d))},u=()=>{i.kill("SIGKILL"),i.stdout?.destroy(),i.stdin?.destroy(),c(void 0)},l=setTimeout(u,n?.timeoutMs??3e3);i.on("error",()=>c(void 0)),i.on("close",d=>{a||c(d===0?Buffer.concat(s,o):void 0)}),i.stdout?.on("data",d=>{a||(o+=d.length,o>(n?.maxBufferBytes??50*1024*1024)?u():s.push(d))}),i.stdin?.on("error",()=>{}),i.stdin?.end(n?.input)})}var bir,V0t=v(()=>{p();bir=require("node:child_process")});function mPe(t=process.env){if(t.WSL_DISTRO_NAME||t.WSLENV)return!0;try{let e=(0,_ir.readFileSync)("/proc/version","utf-8");return/microsoft|wsl/i.test(e)}catch{return!1}}var _ir,Y0t=v(()=>{p();_ir=require("node:fs")});function Ags(t){return!!(t.SSH_CONNECTION||t.SSH_CLIENT||t.MOSH_CONNECTION)}function xir(t){let e=Buffer.from(t).toString("base64");return e.length>ggs?!1:(process.stdout.write(`\x1B]52;c;${e}\x07`),!0)}async function ygs(t){let e=(0,Cir.join)((0,jae.tmpdir)(),`pi-wsl-clip-${(0,Sir.randomUUID)()}.txt`);try{(0,hPe.writeFileSync)(e,t,{encoding:"utf8",mode:384});let n=(await n_("wslpath",["-w",e],{timeoutMs:1e3}))?.toString("utf8").trim();if(!n)return!1;let r=`Set-Clipboard -Value ([System.IO.File]::ReadAllText('${n.replaceAll("'","''")}', [System.Text.Encoding]::UTF8))`;return await n_("powershell.exe",["-NoProfile","-Command",r],{timeoutMs:5e3})!==void 0}catch{return!1}finally{try{(0,hPe.unlinkSync)(e)}catch{}}}async function z0t(){if((0,jae.platform)()==="linux"){let t=[];process.env.TERMUX_VERSION&&t.push(["termux-clipboard-get",[]]),process.env.WAYLAND_DISPLAY&&t.push(["wl-paste",["--no-newline","--type","text"]]),process.env.DISPLAY&&t.push(["xclip",["-selection","clipboard","-out"]],["xsel",["--clipboard","--output"]]);for(let[e,n]of t){let r=await n_(e,n,{timeoutMs:5e3});if(r!==void 0)return r.toString("utf8")||null}}try{return await ZF()?.getText()||null}catch{return null}}async function XU(t){let e=(0,jae.platform)(),n=process.env,r=!1;if(e!=="linux")try{let a=ZF();a?.setText&&(await a.setText(t),r=!0)}catch{}if(!r){let a=[];e==="darwin"?a.push(["pbcopy",[]]):e==="win32"?a.push(["clip",[]]):(n.TERMUX_VERSION&&a.push(["termux-clipboard-set",[]]),n.WAYLAND_DISPLAY&&a.push(["wl-copy",[]]),n.DISPLAY&&a.push(["xclip",["-selection","clipboard"]],["xsel",["--clipboard","--input"]]));for(let[c,u]of a)if(await n_(c,u,{input:t,timeoutMs:5e3})!==void 0){r=!0;break}}let i=!1;!r&&e==="linux"&&mPe(n)&&(n.WT_SESSION&&(i=xir(t)),r=i||await ygs(t));let s=e==="linux"&&!n.DISPLAY&&!n.WAYLAND_DISPLAY&&!n.TERMUX_VERSION,o=!1;if(!i&&(Ags(n)||!r&&s)&&(xir(t)?r=!0:o=!0),!r){if(o)throw new Error("Clipboard unavailable: text exceeds the OSC 52 size limit");if(e==="linux"){if(n.TERMUX_VERSION)throw new Error("Clipboard unavailable: install the Termux:API app and `termux-api` package");if(n.WAYLAND_DISPLAY)throw new Error("Clipboard unavailable: install `wl-clipboard` (`wl-copy`) or check Wayland access");if(n.DISPLAY)throw new Error("Clipboard unavailable: install `xclip` or `xsel`, or check X11 access")}throw new Error("Clipboard unavailable")}}var Sir,hPe,jae,Cir,ggs,fPe=v(()=>{p();Sir=require("node:crypto"),hPe=require("node:fs"),jae=require("node:os"),Cir=require("node:path");Tr();V0t();Y0t();ggs=1e5});function bgs(t=process.env){return!!t.WAYLAND_DISPLAY||t.XDG_SESSION_TYPE==="wayland"}function Vae(t){return t.split(";")[0]?.trim().toLowerCase()??t.toLowerCase()}function Rir(t){switch(Vae(t)){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/webp":return"webp";case"image/gif":return"gif";default:return null}}function kir(t){let e=t.map(r=>r.trim()).filter(Boolean).map(r=>({raw:r,base:Vae(r)}));for(let r of gPe){let i=e.find(s=>s.base===r);if(i)return i.raw}return e.find(r=>r.base.startsWith("image/"))?.raw??null}function _gs(t){let e=Vae(t);return gPe.some(n=>n===e)}async function xgs(t){let e=await Wj();if(!e)return null;try{let n=e.PhotonImage.new_from_byteslice(t);try{return n.get_bytes()}finally{n.free()}}catch{return null}}async function Sgs(){let t=await n_("wl-paste",["--list-types"],{timeoutMs:K0t});if(t===void 0)return;let e=t.toString("utf-8").split(/\r?\n/).map(i=>i.trim()).filter(Boolean),n=kir(e);if(!n)return null;let r=await n_("wl-paste",["--type",n,"--no-newline"]);if(r!==void 0)return r.length===0?null:{bytes:r,mimeType:Vae(n)}}async function Cgs(){let t=(0,vir.join)((0,Tir.tmpdir)(),`pi-wsl-clip-${(0,wir.randomUUID)()}.png`);try{let e=await n_("wslpath",["-w",t],{timeoutMs:K0t});if(e===void 0)return null;let n=e.toString("utf-8").trim();if(!n)return null;let i=["Add-Type -AssemblyName System.Windows.Forms","Add-Type -AssemblyName System.Drawing",`$path = '${n.replaceAll("'","''")}'`,"$img = [System.Windows.Forms.Clipboard]::GetImage()","if ($img) { $img.Save($path, [System.Drawing.Imaging.ImageFormat]::Png); Write-Output 'ok' } else { Write-Output 'empty' }"].join("; "),s=await n_("powershell.exe",["-NoProfile","-Command",i],{timeoutMs:Egs});if(s===void 0||s.toString("utf-8").trim()!=="ok")return null;let a=(0,APe.readFileSync)(t);return a.length===0?null:{bytes:new Uint8Array(a),mimeType:"image/png"}}catch{return null}finally{try{(0,APe.unlinkSync)(t)}catch{}}}async function Igs(){let t=await n_("xclip",["-selection","clipboard","-t","TARGETS","-o"],{timeoutMs:K0t}),e=[];t!==void 0&&(e=t.toString("utf-8").split(/\r?\n/).map(i=>i.trim()).filter(Boolean));let n=kir(e);if(t!==void 0&&!n)return null;let r=new Set(n?[n,...gPe]:gPe);for(let i of r){let s=await n_("xclip",["-selection","clipboard","-t",i,"-o"]);if(s!==void 0&&s.length>0)return{bytes:s,mimeType:Vae(i)}}}async function Iir(){let t=await ZF()?.getImage();if(t!==void 0)return t?.length?{bytes:t,mimeType:kmt(t)??"application/octet-stream"}:null}async function Bir(t){let e=t?.env??process.env,n=t?.platform??process.platform;if(e.TERMUX_VERSION)return null;let r;if(n==="linux"){let i=mPe(e);(bgs(e)||i)&&(r=await Sgs()),r===void 0&&(r=await Igs()),!r&&i&&(r=await Cgs()??r),r===void 0&&(r=await Iir())}else r=await Iir();if(!r)return null;if(!_gs(r.mimeType)){let i=await xgs(r.bytes);return i?{bytes:i,mimeType:"image/png"}:null}return r}var wir,APe,Tir,vir,gPe,K0t,Egs,Nir=v(()=>{p();Tr();wir=require("crypto"),APe=require("fs"),Tir=require("os"),vir=require("path");V0t();Yse();Zve();Y0t();gPe=["image/png","image/jpeg","image/webp","image/gif"],K0t=1e3,Egs=5e3});function Dir(t){let e=t instanceof Error&&t.message?t.message:String(t),n=t instanceof Error?t.cause:void 0,r=n instanceof AggregateError?n.errors:n===void 0?[]:[n],i=r.map(o=>typeof o=="object"&&o!==null&&"code"in o&&typeof o.code=="string"?o.code:void 0).filter(o=>o!==void 0);if(i.length>0)return`${e} (${[...new Set(i)].join(", ")})`;let s=r.find(o=>o instanceof Error&&!!o.message)?.message;return s?`${e} (cause: ${s})`:e}function vgs(t,e){let n=(0,Yae.valid)(t.trim()),r=(0,Yae.valid)(e.trim());if(!(!n||!r))return(0,Yae.compare)(n,r)}function J0t(t,e){let n=vgs(t,e);return n!==void 0?n>0:t.trim()!==e.trim()}async function X0t(t,e={}){if(process.env.PI_OFFLINE)return;let n=await $Q(wgs,{headers:{"User-Agent":hw(t),accept:"application/json"}},{maxRetries:e.retry?2:0,timeoutMs:e.timeoutMs??Tgs});if(!n.ok)return;let r=await n.json();if(typeof r.version!="string"||!r.version.trim())return;let i=typeof r.packageName=="string"&&r.packageName.trim()?r.packageName.trim():void 0,s=typeof r.note=="string"&&r.note.trim()?r.note.trim():void 0;return{version:r.version.trim(),packageName:i,...s?{note:s}:{}}}async function Pir(t){if(!process.env.PI_SKIP_VERSION_CHECK)try{let e=await X0t(t);return e&&J0t(e.version,t)?e:void 0}catch{return}}var Yae,wgs,Tgs,Z0t=v(()=>{p();Yae=Ot(Lht(),1);S1e();Yj();wgs="https://pi.dev/api/latest-version",Tgs=1e4});function yPe(){return rne(process.env[Rgs]??SF)}var ebt,Rgs,tbt=v(()=>{p();PIe();ebt="radius",Rgs="PI_RADIUS_GATEWAY"});async function Mir(t,e={}){let n=new FormData;for(let o of fut(t))n.append(o.name,new Blob([o.data],{type:o.contentType}),o.name);let r=await fetch(new URL("/v1/bug-reports",e.gatewayUrl??yPe()),{method:"POST",headers:e.token?{Authorization:`Bearer ${e.token}`}:void 0,body:n,signal:e.signal}),i=await r.json().catch(()=>null);if(r.ok&&i?.ok===!0&&typeof i.bug_report?.id=="string")return{id:i.bug_report.id};let s=i&&!i.ok?i.description||i.error:void 0;throw new Error(`Bug report upload failed: ${s||r.statusText||r.status}`)}var Oir=v(()=>{p();CRe();tbt()});var Jw,EPe=v(()=>{p();Tr();Ll();ha();Jw=class extends gn{loader;cancellable;signalController;constructor(e,n,r,i){super(),this.cancellable=i?.cancellable??!0;let s=o=>n.fg("border",o);this.addChild(new Un(s)),this.cancellable?this.loader=new nj(e,o=>n.fg("accent",o),o=>n.fg("muted",o),r):(this.signalController=new AbortController,this.loader=new xb(e,o=>n.fg("accent",o),o=>n.fg("muted",o),r)),this.addChild(this.loader),this.cancellable&&(this.addChild(new Tt(1)),this.addChild(new Et(nr("tui.select.cancel","cancel"),1,0))),this.addChild(new Tt(1)),this.addChild(new Un(s))}get signal(){return this.cancellable?this.loader.signal:this.signalController?.signal??new AbortController().signal}set onAbort(e){this.cancellable&&(this.loader.onAbort=e)}handleInput(e){this.cancellable&&this.loader.handleInput(e)}dispose(){"dispose"in this.loader&&typeof this.loader.dispose=="function"?this.loader.dispose():"stop"in this.loader&&typeof this.loader.stop=="function"&&this.loader.stop()}}});async function bPe(t){let e=(0,eM.mkdtempSync)((0,nbt.join)((0,Fir.tmpdir)(),"pi-editor-")),n=(0,nbt.join)(e,"prompt.md");try{(0,eM.writeFileSync)(n,t.content,"utf-8");let[r,...i]=t.command.split(" ");return process.stdout.write(`Launching external editor: ${t.command} +Pi will resume when the editor exits. +`),await new Promise(o=>{let a=(0,Lir.spawn)(r,[...i,n],{stdio:"inherit",shell:process.platform==="win32"});a.on("error",()=>o(null)),a.on("close",c=>o(c))})!==0?{status:"failed"}:{status:"complete",content:zs((0,eM.readFileSync)(n,"utf-8")).replace(/\n$/,"")}}finally{try{(0,eM.rmSync)(e,{recursive:!0,force:!0})}catch{}}}var Lir,eM,Fir,nbt,rbt=v(()=>{p();Lir=require("node:child_process"),eM=require("node:fs"),Fir=require("node:os"),nbt=require("node:path");nm()});var Sk,_Pe=v(()=>{p();Tr();rbt();pi();Ll();ha();Sk=class extends gn{editor;onSubmitCallback;onCancelCallback;tui;keybindings;externalEditorCommand;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.editor.focused=e}constructor(e,n,r,i,s,o,a,c){super(),this.tui=e,this.keybindings=n,this.externalEditorCommand=c||process.env.VISUAL||process.env.EDITOR||(process.platform==="win32"?"notepad":"nano"),this.onSubmitCallback=s,this.onCancelCallback=o;let{description:u,...l}=a??{};this.addChild(new Un),this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("accent",r),1,0)),u&&(this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("text",u),1,0))),this.addChild(new Tt(1)),this.editor=new ID(e,Kre(),l),i&&this.editor.setText(i),this.editor.onSubmit=m=>{this.onSubmitCallback(m)},this.addChild(this.editor),this.addChild(new Tt(1));let d=nr("tui.select.confirm","submit")+" "+nr("tui.input.newLine","newline")+" "+nr("tui.select.cancel","cancel")+` ${nr("app.editor.external","external editor")}`;this.addChild(new Et(d,1,0)),this.addChild(new Tt(1)),this.addChild(new Un)}handleInput(e){if(Ai().matches(e,"tui.select.cancel")){this.onCancelCallback();return}if(this.keybindings.matches(e,"app.editor.external")){this.handleOpenExternalEditor();return}this.editor.handleInput(e)}async handleOpenExternalEditor(){let e=this.editor.getText();this.tui.stop();try{let n=await bPe({command:this.externalEditorCommand,content:e});n.status==="complete"&&this.editor.setText(n.content)}finally{this.tui.start(),this.tui.requestRender(!0)}}}});function ibt(t,e,n){return[{type:"custom",customType:"pi.share",id:Qir.randomUUID().slice(0,8),parentId:e,timestamp:n,data:{systemPrompt:t.state.systemPrompt,tools:t.state.tools.map(r=>({name:r.name,description:r.description,parameters:r.parameters}))}}]}function kgs(t,e){p1e(e.sessionManager,t,(n,r)=>ibt(e,n,r))}async function Gir(t){let e=g9.mkdtempSync(xPe.join(Uir.tmpdir(),"pi-share-")),n=xPe.join(e,"session.jsonl"),r=xPe.join(e,"session.html");try{try{kgs(n,t.session)}catch(i){t.showError(`Failed to export session: ${i instanceof Error?i.message:"Unknown error"}`);return}if(await Bgs(n,t))return;try{if((0,SPe.spawnSync)("gh",["auth","status"],{encoding:"utf-8"}).status!==0){t.showError("GitHub CLI is not logged in. Run 'gh auth login' first.");return}}catch{t.showError("GitHub CLI (gh) is not installed. Install it from https://cli.github.com/");return}try{await t.session.exportToHtml(r,{themeName:Ee.name})}catch(i){t.showError(`Failed to export session: ${i instanceof Error?i.message:"Unknown error"}`);return}await Ngs(r,t)}finally{try{g9.rmSync(e,{recursive:!0,force:!0})}catch{}}}async function Bgs(t,e){if(!e.session.modelRuntime.getProvider("radius"))return!1;let r=YP(await e.session.modelRuntime.getAuth("radius",{minOAuthValidityMs:5*6e4}));if(!r)return!1;let i=new Jw(e.ui,Ee,"Uploading to Radius...");e.editorContainer.clear(),e.editorContainer.addChild(i),e.ui.setFocus(i),e.ui.requestRender(),i.onAbort=()=>{f9(i,e),e.showStatus("Share cancelled")};try{let s=g9.readFileSync(t),o=new URL("/v1/artifacts",SF);o.searchParams.set("visibility","organization"),o.searchParams.set("title","Pi session");let a=await fetch(o,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/x-ndjson","Content-Length":String(s.byteLength)},body:s,signal:i.signal});if(i.signal.aborted)return!0;let c=await a.json().catch(()=>null);if(i.signal.aborted)return!0;if(f9(i,e),!a.ok||!c?.artifact)return e.showError(`Failed to upload Radius artifact: ${c?.error||a.statusText||a.status}`),!0;let u=c.artifact.canonical_url;return e.showStatus(`Share URL: ${gE(u,u)}`),!0}catch(s){return i.signal.aborted||(f9(i,e),e.showError(`Failed to upload Radius artifact: ${s instanceof Error?s.message:"Unknown error"}`)),!0}}async function Ngs(t,e){let n=new Jw(e.ui,Ee,"Creating gist...");e.editorContainer.clear(),e.editorContainer.addChild(n),e.ui.setFocus(n),e.ui.requestRender();let r=null;n.onAbort=()=>{r?.kill(),f9(n,e),e.showStatus("Share cancelled")};try{let i=await new Promise(c=>{r=(0,SPe.spawn)("gh",["gist","create","--public=false",t]);let u="",l="";r.stdout?.on("data",d=>{u+=d.toString()}),r.stderr?.on("data",d=>{l+=d.toString()}),r.on("close",d=>c({stdout:u,stderr:l,code:d}))});if(n.signal.aborted)return;if(f9(n,e),i.code!==0){e.showError(`Failed to create gist: ${i.stderr?.trim()||"Unknown error"}`);return}let s=i.stdout?.trim(),o=s?.split("/").pop();if(!o){e.showError("Failed to parse gist ID from gh output");return}let a=XRn(o);e.showStatus(`Share URL: ${gE(a,a)} +Gist: ${gE(s,s)}`)}catch(i){n.signal.aborted||(f9(n,e),e.showError(`Failed to create gist: ${i instanceof Error?i.message:"Unknown error"}`))}}function f9(t,e){t.dispose(),e.editorContainer.clear(),e.editorContainer.addChild(e.editor),e.ui.setFocus(e.editor)}var SPe,Qir,g9,Uir,xPe,sbt=v(()=>{p();SPe=require("node:child_process"),Qir=Ot(require("node:crypto"),1),g9=Ot(require("node:fs"),1),Uir=Ot(require("node:os"),1),xPe=Ot(require("node:path"),1);PIe();Tr();p9();Qs();m1e();EPe();pi()});async function Wir(t,e){let n=await Mgs(t,e);if(!n){t.showStatus("Bug report cancelled");return}if(n.delivery==="upload"&&process.env.PI_OFFLINE){t.showError("Uploading bug reports requires online mode. Use Export as Zip instead.");return}let r;if(n.includeSummary){let s=qir(t,`Writing summary with ${t.session.model?.name??"the current model"}...`);try{r=await t.session.summarizeForBugReport({hint:n.hint,signal:s.signal})}catch(o){A9(t,s),s.signal.aborted?t.showStatus("Bug report cancelled"):t.showError(`Failed to write bug report summary: ${IPe(o)}`);return}if(A9(t,s),s.signal.aborted){t.showStatus("Bug report cancelled");return}}let i;try{i=Ogs(t.session,n,r)}catch(s){t.showError(`Failed to build bug report: ${IPe(s)}`);return}if(n.delivery==="upload"){let s=await Lgs(t,i);if(s===void 0)return;if(await CPe(t,"Upload failed",["Export as Zip","Cancel"],`${s} + +Export the report as a zip archive instead?`)!=="Export as Zip"){t.showStatus("Bug report cancelled");return}}await Fgs(t,i)}async function Mgs(t,e){let n=await Qgs(t,"Report a bug",`${Dgs} + +What went wrong? (optional)`,e);if(n===null)return;let r=await CPe(t,"Include the session transcript?",["Yes, include the transcript","No"],Pgs);if(!r)return;let i=r!=="No",s=!1;if(!i){let c=t.session.model,u=await CPe(t,`Attach a summary written by ${c?.name??"the current model"} instead?`,["Yes, generate a summary","No"],`The transcript is sent to ${c?.provider??"your provider"} with your credentials and tokens. Only the generated summary is attached; the transcript stays on your machine.`);if(!u)return;s=u!=="No"}let o=n.trim(),a=await CPe(t,"Bug report",["Upload Report","Export as Zip","Cancel"],`Description: ${o||"none"} +Transcript: ${i?"included":"not included"} +Summary: ${s?`written by ${t.session.model?.name??"the current model"}`:"none"} + +Upload sends the report to ${new URL(yPe()).host}. Export writes a zip archive to the current directory instead.`);if(!(!a||a==="Cancel"))return{hint:o||void 0,includeSession:i,includeSummary:s,delivery:a==="Upload Report"?"upload":"zip"}}function Ogs(t,e,n){let r=t.resourceLoader.getExtensions();return{metadata:nWn({hint:e.hint,sessionId:t.sessionId,cwd:t.sessionManager.getCwd(),includeSession:e.includeSession,includeSummary:n!==void 0,messageCount:t.messages.length,model:t.model,modelRuntime:t.modelRuntime,thinkingLevel:t.thinkingLevel,extensions:r.extensions,extensionErrors:r.errors,globalSettings:t.settingsManager.getGlobalSettings(),projectSettings:t.settingsManager.getProjectSettings()}),diagnostics:rWn(t.sessionManager,dPe()),summary:n,sessionJsonl:e.includeSession?omt(t.sessionManager,(i,s)=>ibt(t,i,s)):void 0}}async function Lgs(t,e){let n=qir(t,"Uploading bug report...");try{let i=t.session.modelRuntime.getProvider(ebt)?YP(await t.session.modelRuntime.getAuth(ebt,{minOAuthValidityMs:5*6e4})):void 0,s=await Mir(e,{token:i,signal:n.signal});A9(t,n),Hir(t.session,e,{delivery:"upload"}),t.showStatus(`Bug report uploaded. Report ID: ${s.id}`);return}catch(r){if(A9(t,n),n.signal.aborted){t.showStatus("Bug report cancelled");return}return IPe(r)}}async function Fgs(t,e){let n=$ir.join(process.cwd(),sWn(e.metadata.id));try{await iWn(e,n)}catch(r){t.showError(`Failed to write bug report: ${IPe(r)}`);return}Hir(t.session,e,{delivery:"zip",path:n}),t.showStatus(`Bug report exported to: ${n} +Report ID: ${e.metadata.id}`)}function Hir(t,e,n){t.sessionManager.appendCustomEntry(X$n,{id:e.metadata.id,createdAt:e.metadata.createdAt,hint:e.metadata.hint,sessionIncluded:e.metadata.session.included,summaryIncluded:e.metadata.session.summaryIncluded,...n}),e.diagnostics.crashes.length>0&&hir()}function Qgs(t,e,n,r){return new Promise(i=>{let s,o=a=>{A9(t,s),i(a)};s=new Sk(t.ui,t.keybindings,e,r,a=>o(a),()=>o(null),{description:n},t.session.settingsManager.getExternalEditorCommand()),obt(t,s)})}function CPe(t,e,n,r){return new Promise(i=>{let s,o=a=>{A9(t,s),i(a)};s=new WE(e,n,o,()=>o(),{tui:t.ui,description:r}),obt(t,s)})}function qir(t,e){let n=new Jw(t.ui,Ee,e);return obt(t,n),n}function obt(t,e){t.editorContainer.clear(),t.editorContainer.addChild(e),t.ui.setFocus(e),t.ui.requestRender()}function A9(t,e){e.dispose?.(),t.editorContainer.clear(),t.editorContainer.addChild(t.editor),t.ui.setFocus(t.editor),t.ui.requestRender()}function IPe(t){return t instanceof Error?t.message:"Unknown error"}var $ir,Dgs,Pgs,jir=v(()=>{p();$ir=Ot(require("node:path"),1);p9();CRe();Oir();$0t();tbt();m1e();EPe();_Pe();Qae();sbt();pi();Dgs="This report goes to the Pi developers (Earendil) and is not shared publicly. It includes your pi version, operating system, the current model and provider configuration (without API keys), loaded extensions, settings, and provider error diagnostics from this session.",Pgs="The transcript contains your messages, model output, tool calls and their results, including file contents and command output read during this session."});function Vir(t){let e=new TD(t.document,{follow:"end",primary:!0,overscroll:"chain",scrollbar:t.scrollbar??"auto",...t.scrollbarTrackStyle===void 0?{}:{scrollbarTrackStyle:t.scrollbarTrackStyle},...t.scrollbarThumbStyle===void 0?{}:{scrollbarThumbStyle:t.scrollbarThumbStyle}}),n=new XF([{component:t.pendingMessages,shrink:1,minSize:0},{component:t.status,shrink:1,minSize:0},...t.widgetsAbove===void 0?[]:[{component:t.widgetsAbove,shrink:1,minSize:0}],{component:t.editor,shrink:1,minSize:3},...t.widgetsBelow===void 0?[]:[{component:t.widgetsBelow,shrink:1,minSize:0}],{component:t.footer,shrink:1,minSize:0}]);return{transcript:e,root:new XF([{component:e,basis:0,grow:1,shrink:1,minSize:1},{component:n,basis:"auto",grow:0,shrink:1,minSize:1}])}}var Yir=v(()=>{p();Tr()});function Kir(t,e){if(e>=Jir)return!1;let n=e*Ggs+Math.floor(t/8),r=t%8;return(Ugs[n]>>r&1)===0}function $gs(t,e){let n=Kir(t,e*2),r=Kir(t,e*2+1);return n&&r?"\u2588":n?"\u2580":r?"\u2584":" "}function Wgs(){let t=[];for(let e=0;e{p();pi();HE=31,Jir=36,Ugs=[255,255,255,127,255,240,255,127,255,237,255,127,255,219,255,127,255,183,255,127,255,119,254,127,63,248,254,127,223,255,254,127,223,63,252,127,159,195,251,127,111,252,244,127,247,15,247,127,247,255,247,127,247,255,227,127,247,7,232,127,239,248,103,112,15,255,187,111,241,0,208,91,253,63,236,83,193,255,239,87,159,253,238,95,159,252,174,95,31,120,172,95,63,0,80,108,127,0,220,119,255,192,63,120,255,1,248,127,255,3,156,120,255,7,140,124,255,15,206,120,255,255,207,127,255,255,207,120,255,255,223,120,255,255,223,125,255,255,63,126,255,255,255,127],Ggs=Math.ceil(HE/8),pm=Math.ceil(Jir/2),zir=["typewriter","scanline","rain","fade","crt","glitch","dissolve"];ZU=class{ui;interval=null;effect;finalGrid;currentGrid;effectState={};cachedLines=[];cachedWidth=0;gridVersion=0;cachedVersion=-1;constructor(e){this.ui=e,this.effect=zir[Math.floor(Math.random()*zir.length)],this.finalGrid=Wgs(),this.currentGrid=this.createEmptyGrid(),this.initEffect(),this.startAnimation()}invalidate(){this.cachedWidth=0}render(e){if(e===this.cachedWidth&&this.cachedVersion===this.gridVersion)return this.cachedLines;let n=1,r=e-n;this.cachedLines=this.currentGrid.map(o=>{let a=o.slice(0,r).join(""),c=Math.max(0,e-n-a.length);return` ${Ee.fg("accent",a)}${" ".repeat(c)}`});let i="ARMIN SAYS HI",s=Math.max(0,e-n-i.length);return this.cachedLines.push(` ${Ee.fg("accent",i)}${" ".repeat(s)}`),this.cachedWidth=e,this.cachedVersion=this.gridVersion,this.cachedLines}createEmptyGrid(){return Array.from({length:pm},()=>Array(HE).fill(" "))}initEffect(){switch(this.effect){case"typewriter":this.effectState={pos:0};break;case"scanline":this.effectState={row:0};break;case"rain":this.effectState={drops:Array.from({length:HE},()=>({y:-Math.floor(Math.random()*pm*2),settled:0}))};break;case"fade":{let e=[];for(let n=0;n0;n--){let r=Math.floor(Math.random()*(n+1));[e[n],e[r]]=[e[r],e[n]]}this.effectState={positions:e,idx:0};break}case"crt":this.effectState={expansion:0};break;case"glitch":this.effectState={phase:0,glitchFrames:8};break;case"dissolve":{this.currentGrid=Array.from({length:pm},()=>Array.from({length:HE},()=>{let n=[" ","\u2591","\u2592","\u2593","\u2588","\u2580","\u2584"];return n[Math.floor(Math.random()*n.length)]}));let e=[];for(let n=0;n0;n--){let r=Math.floor(Math.random()*(n+1));[e[n],e[r]]=[e[r],e[n]]}this.effectState={positions:e,idx:0};break}}}startAnimation(){let e=this.effect==="glitch"?60:30;this.interval=setInterval(()=>{let n=this.tickEffect();this.updateDisplay(),this.ui.requestRender(),n&&this.stopAnimation()},1e3/e)}stopAnimation(){this.interval&&(clearInterval(this.interval),this.interval=null)}tickEffect(){switch(this.effect){case"typewriter":return this.tickTypewriter();case"scanline":return this.tickScanline();case"rain":return this.tickRain();case"fade":return this.tickFade();case"crt":return this.tickCrt();case"glitch":return this.tickGlitch();case"dissolve":return this.tickDissolve();default:return!0}}tickTypewriter(){let e=this.effectState,n=3;for(let r=0;r=pm)return!0;this.currentGrid[i][s]=this.finalGrid[i][s],e.pos++}return!1}tickScanline(){let e=this.effectState;if(e.row>=pm)return!0;for(let n=0;n=pm-i.settled;o--)o>=0&&(this.currentGrid[o][r]=this.finalGrid[o][r]);if(i.settled>=pm)continue;n=!1;let s=-1;for(let o=pm-1-i.settled;o>=0;o--)if(this.finalGrid[o][r]!==" "){s=o;break}i.y++,i.y>=0&&i.y=0&&i.y>=s?(i.settled=pm-s,i.y=-Math.floor(Math.random()*5)-1):this.currentGrid[i.y][r]="\u2593")}return n}tickFade(){let e=this.effectState,n=15;for(let r=0;r=e.positions.length)return!0;let[i,s]=e.positions[e.idx];this.currentGrid[i][s]=this.finalGrid[i][s],e.idx++}return!1}tickCrt(){let e=this.effectState,n=Math.floor(pm/2);this.currentGrid=this.createEmptyGrid();let r=n-e.expansion,i=n+e.expansion;for(let s=Math.max(0,r);s<=Math.min(pm-1,i);s++)for(let o=0;opm}tickGlitch(){let e=this.effectState;return e.phase{let r=Math.floor(Math.random()*7)-3,i=[...n];if(Math.random()<.3)return i.slice(r).concat(i.slice(0,r)).slice(0,HE);if(Math.random()<.2){let s=Math.floor(Math.random()*pm);return[...this.finalGrid[s]]}return i}),e.phase++,!1):(this.currentGrid=this.finalGrid.map(n=>[...n]),!0)}tickDissolve(){let e=this.effectState,n=20;for(let r=0;r=e.positions.length)return!0;let[i,s]=e.positions[e.idx];this.currentGrid[i][s]=this.finalGrid[i][s],e.idx++}return!1}updateDisplay(){this.gridVersion++}dispose(){this.stopAnimation()}}});function zae(t,e,n){return(r,i)=>Hgs(r,{messageType:t,isStreaming:e,availableWidth:i},n)}function Hgs(t,e,n){let r=t;for(let i of n)try{let s=i(r,e);typeof s=="string"&&(r=s)}catch{}return r}var cbt=v(()=>{p()});var qgs,jgs,Vgs,OS,lbt=v(()=>{p();Tr();pi();cbt();qgs="\x1B]133;A\x07",jgs="\x1B]133;B\x07",Vgs="\x1B]133;C\x07",OS=class extends gn{contentContainer;hideThinkingBlock;markdownTheme;hiddenThinkingLabel;outputPad;markdownTransformers;lastMessage;hasToolCalls=!1;isStreaming=!1;thinkingVisibilityOverrides=new Map;constructor(e,n=!1,r=zh(),i="Thinking...",s=1,o=[]){super(),this.hideThinkingBlock=n,this.markdownTheme=r,this.hiddenThinkingLabel=i,this.outputPad=s,this.markdownTransformers=o,this.contentContainer=new gn,this.addChild(this.contentContainer),e&&this.updateContent(e)}invalidate(){super.invalidate(),this.lastMessage&&this.updateContent(this.lastMessage)}setHideThinkingBlock(e){this.hideThinkingBlock=e,this.thinkingVisibilityOverrides.clear(),this.lastMessage&&this.updateContent(this.lastMessage)}setHiddenThinkingLabel(e){this.hiddenThinkingLabel=e,this.lastMessage&&this.updateContent(this.lastMessage)}setOutputPad(e){this.outputPad=e,this.lastMessage&&this.updateContent(this.lastMessage)}render(e){let n=super.render(e);return this.hasToolCalls||n.length===0||(n[0]=qgs+n[0],n[n.length-1]=jgs+Vgs+n[n.length-1]),n}updateContent(e,n=this.isStreaming){this.lastMessage=e,this.isStreaming=n,this.contentContainer.clear(),e.content.some(o=>o.type==="text"&&o.text.trim()||o.type==="thinking"&&o.thinking.trim())&&this.contentContainer.addChild(new Tt(1));let i=0;for(let o=0;oh.type==="text"&&h.text.trim()||h.type==="thinking"&&h.thinking.trim()),l=i++,d=this.thinkingVisibilityOverrides.get(l)??this.hideThinkingBlock,m=d?new Et(Ee.italic(Ee.fg("thinkingText",this.hiddenThinkingLabel)),this.outputPad,0):new Pl(c.join(` + +`),this.outputPad,0,this.markdownTheme,{color:h=>Ee.fg("thinkingText",h),italic:!0},{transform:zae("assistant-thinking",this.isStreaming,this.markdownTransformers)});this.contentContainer.addChild(new vA(m,h=>{if(!(h.type!=="click"||h.button!=="left"))return this.thinkingVisibilityOverrides.set(l,!d),this.lastMessage&&this.updateContent(this.lastMessage),{handled:!0}})),u&&this.contentContainer.addChild(new Tt(1))}}let s=e.content.some(o=>o.type==="toolCall");if(this.hasToolCalls=s,e.stopReason==="length")this.contentContainer.addChild(new Tt(1)),this.contentContainer.addChild(new Et(Ee.fg("error","Response was truncated before completion."),this.outputPad,0));else if(!s){if(e.stopReason==="aborted"){let o=e.errorMessage&&e.errorMessage!=="Request was aborted"?e.errorMessage:"Operation aborted";this.contentContainer.addChild(new Tt(1)),this.contentContainer.addChild(new Et(Ee.fg("error",o),this.outputPad,0))}else if(e.stopReason==="error"){let o=e.errorMessage||"Unknown error";this.contentContainer.addChild(new Tt(1)),this.contentContainer.addChild(new Et(Ee.fg("error",`Error: ${o}`),this.outputPad,0))}}}}});var Xir,Ck,ubt=v(()=>{p();Tr();Eg();sRe();pi();Ll();ha();f1e();Xir=20,Ck=class extends gn{command;outputLines=[];status="running";exitCode=void 0;loader;truncationResult;fullOutputPath;expanded=!1;contentContainer;constructor(e,n,r=!1){super(),this.command=e;let i=r?"dim":"bashMode",s=a=>Ee.fg(i,a);this.addChild(new Tt(1)),this.addChild(new Un(s)),this.contentContainer=new gn,this.addChild(this.contentContainer);let o=new Et(Ee.fg(i,Ee.bold(`$ ${e}`)),1,0);this.contentContainer.addChild(o),this.loader=new xb(n,a=>Ee.fg(i,a),a=>Ee.fg("muted",a),`Running... (${Ca("tui.select.cancel")} to cancel)`),this.contentContainer.addChild(this.loader),this.addChild(new Un(s))}setExpanded(e){this.expanded=e,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}appendOutput(e){let r=qj(e).replace(/\r\n/g,` `).replace(/\r/g,` `).split(` -`);this.outputLines.length>0&&r.length>0?(this.outputLines[this.outputLines.length-1]+=r[0],this.outputLines.push(...r.slice(1))):this.outputLines.push(...r),this.updateDisplay()}setComplete(e,n,r,s){this.exitCode=e,this.status=n?"cancelled":e!==0&&e!==void 0&&e!==null?"error":"complete",this.truncationResult=r,this.fullOutputPath=s,this.loader.stop(),this.updateDisplay()}updateDisplay(){let e=this.outputLines.join(` -`),n=XC(e,{maxLines:2e3,maxBytes:51200}),r=n.content?n.content.split(` -`):[],s=r.slice(-FOn),i=r.length-s.length;this.contentContainer.clear();let o=new yt(Se.fg("bashMode",Se.bold(`$ ${this.command}`)),1,0);if(this.contentContainer.addChild(o),r.length>0)if(this.expanded){let a=r.map(c=>Se.fg("muted",c)).join(` -`);this.contentContainer.addChild(new yt(` +`);this.outputLines.length>0&&r.length>0?(this.outputLines[this.outputLines.length-1]+=r[0],this.outputLines.push(...r.slice(1))):this.outputLines.push(...r),this.updateDisplay()}setComplete(e,n,r,i){this.exitCode=e,this.status=n?"cancelled":e!==0&&e!==void 0&&e!==null?"error":"complete",this.truncationResult=r,this.fullOutputPath=i,this.loader.stop(),this.updateDisplay()}updateDisplay(){let e=this.outputLines.join(` +`),n=mw(e,{maxLines:2e3,maxBytes:51200}),r=n.content?n.content.split(` +`):[],i=r.slice(-Xir),s=r.length-i.length;this.contentContainer.clear();let o=new Et(Ee.fg("bashMode",Ee.bold(`$ ${this.command}`)),1,0);if(this.contentContainer.addChild(o),r.length>0)if(this.expanded){let a=r.map(c=>Ee.fg("muted",c)).join(` +`);this.contentContainer.addChild(new Et(` ${a}`,1,0))}else{let c=` -${s.map(d=>Se.fg("muted",d)).join(` -`)}`,u,l;this.contentContainer.addChild({render:d=>((l===void 0||u!==d)&&(l=fL(c,FOn,d,1).visualLines,u=d),l??[]),invalidate:()=>{u=void 0,l=void 0}})}if(this.status==="running")this.contentContainer.addChild(this.loader);else{let a=[];i>0&&(this.expanded?a.push(`${Se.fg("muted","(")}${er("app.tools.expand","to collapse")}${Se.fg("muted",")")}`):a.push(`${Se.fg("muted",`... ${i} more lines (`)}${er("app.tools.expand","to expand")}${Se.fg("muted",")")}`)),this.status==="cancelled"?a.push(Se.fg("warning","(cancelled)")):this.status==="error"&&a.push(Se.fg("error",`(exit ${this.exitCode})`)),(this.truncationResult?.truncated||n.truncated)&&this.fullOutputPath&&a.push(Se.fg("warning",`Output truncated. Full output: ${this.fullOutputPath}`)),a.length>0&&this.contentContainer.addChild(new yt(` +${i.map(d=>Ee.fg("muted",d)).join(` +`)}`,u,l;this.contentContainer.addChild({render:d=>((l===void 0||u!==d)&&(l=UQ(c,Xir,d,1).visualLines,u=d),l??[]),invalidate:()=>{u=void 0,l=void 0}})}if(this.status==="running")this.contentContainer.addChild(this.loader);else{let a=[];s>0&&(this.expanded?a.push(`${Ee.fg("muted","(")}${nr("app.tools.expand","to collapse")}${Ee.fg("muted",")")}`):a.push(`${Ee.fg("muted",`... ${s} more lines (`)}${nr("app.tools.expand","to expand")}${Ee.fg("muted",")")}`)),this.status==="cancelled"?a.push(Ee.fg("warning","(cancelled)")):this.status==="error"&&a.push(Ee.fg("error",`(exit ${this.exitCode})`)),(this.truncationResult?.truncated||n.truncated)&&this.fullOutputPath&&a.push(Ee.fg("warning",`Output truncated. Full output: ${this.fullOutputPath}`)),a.length>0&&this.contentContainer.addChild(new Et(` ${a.join(` `)}`,1,0))}}getOutput(){return this.outputLines.join(` -`)}getCommand(){return this.command}};p();var RF=class extends Vl{expanded=!1;message;markdownTheme;constructor(e,n=Fh()){super(1,1,r=>Se.bg("customMessageBg",r)),this.message=e,this.markdownTheme=n,this.updateDisplay()}setExpanded(e){this.expanded=e,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}updateDisplay(){this.clear();let e=Se.fg("customMessageLabel","\x1B[1m[branch]\x1B[22m");if(this.addChild(new yt(e,0,0)),this.addChild(new Nt(1)),this.expanded){let n=`**Branch Summary** +`)}getCommand(){return this.command}}});var eG,dbt=v(()=>{p();Tr();pi();ha();eG=class extends Ou{expanded=!1;message;markdownTheme;constructor(e,n=zh()){super(1,1,r=>Ee.bg("customMessageBg",r)),this.message=e,this.markdownTheme=n,this.updateDisplay()}setExpanded(e){this.expanded=e,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}updateDisplay(){this.clear();let e=new gn,n=Ee.fg("customMessageLabel","\x1B[1m[branch]\x1B[22m");if(e.addChild(new Et(n,0,0)),e.addChild(new Tt(1)),this.expanded){let r=`**Branch Summary** -`;this.addChild(new Hc(n+this.message.summary,0,0,this.markdownTheme,{color:r=>Se.fg("customMessageText",r)}))}else this.addChild(new yt(Se.fg("customMessageText","Branch summary (")+Se.fg("dim",ra("app.tools.expand"))+Se.fg("customMessageText"," to expand)"),0,0))}};p();var kF=class extends Vl{expanded=!1;message;markdownTheme;constructor(e,n=Fh()){super(1,1,r=>Se.bg("customMessageBg",r)),this.message=e,this.markdownTheme=n,this.updateDisplay()}setExpanded(e){this.expanded=e,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}updateDisplay(){this.clear();let e=this.message.tokensBefore.toLocaleString(),n=Se.fg("customMessageLabel","\x1B[1m[compaction]\x1B[22m");if(this.addChild(new yt(n,0,0)),this.addChild(new Nt(1)),this.expanded){let r=`**Compacted from ${e} tokens** +`;e.addChild(new Pl(r+this.message.summary,0,0,this.markdownTheme,{color:i=>Ee.fg("customMessageText",i)}))}else e.addChild(new Et(Ee.fg("customMessageText","Branch summary (")+Ee.fg("dim",Ca("app.tools.expand"))+Ee.fg("customMessageText"," to expand)"),0,0));this.addChild(new vA(e,r=>{if(!(r.type!=="click"||r.button!=="left"))return this.setExpanded(!this.expanded),{handled:!0}}))}}});var tG,pbt=v(()=>{p();Tr();pi();ha();tG=class extends Ou{expanded=!1;message;markdownTheme;constructor(e,n=zh()){super(1,1,r=>Ee.bg("customMessageBg",r)),this.message=e,this.markdownTheme=n,this.updateDisplay()}setExpanded(e){this.expanded=e,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}updateDisplay(){this.clear();let e=new gn,n=this.message.tokensBefore.toLocaleString(),r=Ee.fg("customMessageLabel","\x1B[1m[compaction]\x1B[22m");if(e.addChild(new Et(r,0,0)),e.addChild(new Tt(1)),this.expanded){let i=`**Compacted from ${n} tokens** -`;this.addChild(new Hc(r+this.message.summary,0,0,this.markdownTheme,{color:s=>Se.fg("customMessageText",s)}))}else this.addChild(new yt(Se.fg("customMessageText",`Compacted from ${e} tokens (`)+Se.fg("dim",ra("app.tools.expand"))+Se.fg("customMessageText"," to expand)"),0,0))}};p();var NF=class extends NN{keybindings;workingStatusIndicator;embedWorkingStatus;actionHandlers=new Map;onEscape;onCtrlD;onPasteImage;onExtensionShortcut;constructor(e,n,r,s){super(e,n,s),this.keybindings=r,this.embedWorkingStatus=s?.embedWorkingStatus??!1}setWorkingStatusIndicator(e){this.workingStatusIndicator=e}renderTopBorder(e,n){if(!this.embedWorkingStatus||!this.workingStatusIndicator||e<=0)return super.renderTopBorder(e,n);let r=this.workingStatusIndicator.renderInBorder(Math.max(1,e-5)),s=nn(r);if(s===0)return super.renderTopBorder(e,n);let i=n>0?` \u2191 ${n} more `:void 0,o=i?nn(i):0,a=Math.floor((e-o)/2),c=()=>i!==void 0&&o+2<=e&&a-(3+s+1)>=1;if(i&&!c()&&(r=this.workingStatusIndicator.renderSpinnerInBorder(e),s=nn(r)),c()){let l=3+s+1;return this.borderColor("\u2500\u2500 ")+r+this.borderColor(` ${"\u2500".repeat(a-l)}${i}${"\u2500".repeat(e-a-o)}`)}if(e>=s+5)return this.borderColor("\u2500\u2500 ")+r+this.borderColor(` ${"\u2500".repeat(e-s-4)}`);r=this.workingStatusIndicator.renderSpinnerInBorder(e),s=nn(r);let u=Math.min(3,Math.max(0,e-s));return this.borderColor("\u2500".repeat(u))+r+this.borderColor("\u2500".repeat(Math.max(0,e-u-s)))}onAction(e,n){this.actionHandlers.set(e,n)}handleInput(e){if(!this.onExtensionShortcut?.(e)){if(this.keybindings.matches(e,"app.clipboard.pasteImage")){this.onPasteImage?.();return}if(this.keybindings.matches(e,"app.interrupt")){if(!this.isShowingAutocomplete()){let n=this.onEscape??this.actionHandlers.get("app.interrupt");if(n){n();return}}super.handleInput(e);return}if(this.keybindings.matches(e,"app.exit")&&this.getText().length===0){let n=this.onCtrlD??this.actionHandlers.get("app.exit");n&&n();return}if(this.keybindings.matches(e,"tui.editor.historyPrevious")||this.keybindings.matches(e,"tui.editor.historyNext")){super.handleInput(e);return}for(let[n,r]of this.actionHandlers)if(n!=="app.interrupt"&&n!=="app.exit"&&this.keybindings.matches(e,n)){r();return}super.handleInput(e)}}};p();var lTe=class extends _n{entry;renderer;customComponent;_expanded=!1;constructor(e,n){super(),this.entry=e,this.renderer=n,this.rebuild()}hasContent(){return this.customComponent!==void 0}setExpanded(e){this._expanded!==e&&(this._expanded=e,this.rebuild())}invalidate(){super.invalidate(),this.rebuild()}rebuild(){this.clear(),this.customComponent=void 0;let e;try{e=this.renderer(this.entry,{expanded:this._expanded},Se)}catch(n){let r=n instanceof Error?n.message:String(n),s=new Vl(1,1,i=>Se.bg("customMessageBg",i));s.addChild(new yt(Se.fg("error",`[${this.entry.customType}] renderer failed: ${r}`),0,0)),e=s}e&&(this.customComponent=e,this.addChild(new Nt(1)),this.addChild(e))}};p();var ZD=class extends _n{message;customRenderer;box;customComponent;markdownTheme;_expanded=!1;outputPad;constructor(e,n,r=Fh(),s=1){super(),this.message=e,this.customRenderer=n,this.markdownTheme=r,this.outputPad=s,this.addChild(new Nt(1)),this.box=new Vl(1,1,i=>Se.bg("customMessageBg",i)),this.rebuild()}setExpanded(e){this._expanded!==e&&(this._expanded=e,this.rebuild())}setOutputPad(e){this.outputPad!==e&&(this.outputPad=e,this.rebuild())}invalidate(){super.invalidate(),this.rebuild()}rebuild(){if(this.customComponent&&(this.removeChild(this.customComponent),this.customComponent=void 0),this.removeChild(this.box),this.customRenderer)try{let r=this.customRenderer(this.message,{expanded:this._expanded,outputPad:this.outputPad},Se);if(r){this.customComponent=r,this.addChild(r);return}}catch{}this.addChild(this.box),this.box.clear();let e=Se.fg("customMessageLabel",`\x1B[1m[${this.message.customType}]\x1B[22m`);this.box.addChild(new yt(e,0,0)),this.box.addChild(new Nt(1));let n;typeof this.message.content=="string"?n=this.message.content:n=this.message.content.filter(r=>r.type==="text").map(r=>r.text).join(` -`),this.box.addChild(new Hc(n,0,0,this.markdownTheme,{color:r=>Se.fg("customMessageText",r)}))}};p();var jot="bbbab8b9b9b6b9b8b5bcbbb8b8b7b4b7b5b2b6b5b2b8b7b4b7b6b3b6b4b1bdbcb8bab8b6bbb8b5b8b5b1bbb8b4c2bebbc1bebac0bdbabfbcb9c1bebabfbebbc0bfbcc0bdbabbb8b5c1bfbcbfbcb8bbb9b6bfbcb8c2bfbcc1bfbcbfbbb8bdb9b6b8b7b5b9b8b5b8b8b5b5b5b2b6b5b2b8b7b4b9b8b5b9b8b5b6b5b3bab8b5bcbab7bbb9b6bbb8b5bfb9b5bdb2abbcb0a8beb2aabeb5afbfbab6bebab7c0bfbcbebdbabebbb8c0bdbabfbebbc2bebbbdbab7c3c0bdc3c0bdc1bebbc2bebabfbcb8bab9b6b7b6b3b2b1aeb6b5b2b5b4b1b5b4b2b6b5b2b7b6b4b9b8b6b7b6b3bbbab7b2afaba5988fb49e90b09481b79a88b39683b09583b7a395bfb6b0c0bdbabdbbb8bebcb9c1bfbcc0bebbbdbab7bebbb8c2bfbcc0bdbac0bcb9bdb9b6c0bcb8b5b4b2b4b3b0bab9b6b9b9b6b5b4b1b5b4b1b6b5b3b9b8b5b9b8b6b9b8b6b2aeaa968174a6836eaa856eab846eaf8973ac8973b08f79b18f7ab39786b7a89dbbb3aebfbab6c2c0bdbebcb9bfbdbac3c1bdc2bebbc0bcb9bdb9b6c1bdbabfbbb8b4b3b0b9b8b5b8b7b5b4b3b1b5b4b1b8b7b4b8b7b5bab9b6bbbab7b1afad8c7a719d735ca47860a87d65a98069ae8972ae8c75af8d77aa826ba98067aa8974b39e90b6a79dbbb2adc0bdbac1bfbdbfbbb8c1bdb9bebab6c0bdb9bfbbb8c1bdbab4b2b0b7b6b4b7b6b3b4b2b0bab9b7b6b5b2b6b5b2bab9b6bab9b6958c87977663aa836bac8772b08f7aad8c77b2917db0917db0907cac8971a77d64a87f67ac8972b29887b8a89dbfbab5bfbdbac1bebac0bcb9c0bcb9c0bcb9c1bebabebab7b8b7b4b7b6b4b5b4b1b5b4b2b7b6b3b5b4b2bab9b7bab9b6b4b1ada88f7fad8973ae8d78b19684b19685b29786b69a89b29582b1917daa856ea87e66a97e66ad866ea9826baf9280b8ada6bdbbb8bebab7bfbbb8c1bdbabfbbb8bcb8b4bcb8b5b6b4b2b7b5b3b6b5b2b8b7b4b3b2afb8b7b4b6b5b2b3b2b0b3a59aab856fad8d78b0917eb19886b49b8bb49a89b39785b0917eaf8f7cab866fa77d65a77a61a87d64a9816ab08f79b5a296c1bcb8c3bfbcc2bebbbebab7bfbbb7bdbab6c2bebab8b7b4b7b6b4b6b5b3b7b6b3b6b5b2b9b8b6b4b3b1b6b1acac8f7ca9826bae8f7aaf9583b49c8cb49c8bb79d8cb59987b19380ad8e79ae8c77af8e78ac8771a3775faa826bae8972b39888bbb6b2bebbb8bfbbb8bfbbb8c0bdb9bebbb7c0bdb9b6b5b2b9b8b5b4b3b1b8b7b5b4b3b0b7b6b4b6b5b3b1a7a0aa8772a77d65a88570b49887b19b8d9c887c907a6d987f71aa907faf917daf8e7aad8c78ac8b77a8836ca9836cac8770b49b8abdb6b2c0bcb9c0bdb9bfbbb8bebab7bfbcb9bebab7b9b8b6b5b4b2b9b8b5b8b7b5b8b7b4b7b6b4b5b4b2b3a9a2ad8973a1755da9856fb398858c776a65544b776358725d526e594d9c7f6eb1907ba68672ad8e7aab8771ac856db18f79b3a092beb9b5c1bdbabdb9b5bebab7bfbbb7bebab7bcb9b6b7b6b4b6b6b3b8b7b4b5b4b2b8b6b4b7b6b3b4b3b0b4aba4a6826ba3775fb08e79b19584a88e7daa8e7db29481ad8f7c997e6da38674ac8d79ac8e7aae917f9a7c6a896a599a7c6ab3a398c1bdbabdb9b6bcb8b5bebab6bebab7bdb9b5bdb9b6b5b4b1b7b5b3b5b4b2b7b6b3b7b6b4b3b3b0b3b2b0b4aca5a7846fa97f68ae8f7bae9383b59c8bb2937fae8e79ac8b76af927eaf927eb29683b39885b2988891786a72594c6e594d978d86bdbab7bab7b3c0bcb9c0bcb9bebab7bebbb7bdb9b6b3b2b0b4b3b0b5b4b2b4b4b1b4b3b1b4b3b1b4b3b0b6ada5aa8670a57a62ad8e7ab29b8cb69d8dab856fa9826aa88069ab8771af907db49987b19684b29886b59987b39480b09787b5a9a1bcb8b5bebab7bdb9b5bebab7bfbbb8bfbbb7bbb7b4b3b2afb8b7b5b8b7b5b3b2b0b5b4b2b6b5b3b6b4b1afa299a98975a9826baf907cb39988b49a89af8e7aac8973aa856eaf8c74b1917dae907dac907db39988b29785b49785b7a090b9aca3bfbab7bcb8b5bdb9b6bcb8b4bcb8b5bdb9b5bcb8b4b5b4b2b6b5b3b4b3b0b4b3b0b9b8b5b8b6b4908b88887467aa8f7ea78976ad8973b08b74b59885b69e8eb29888b1917cb1917db1937fae907cb19686b39a8ab29886b59b8ab8a192b6aaa3b7b2afbcb8b4bcb8b5bbb7b4c0bcb9bebab7c0bcb9b6b5b2b6b5b3b4b3b0bab9b7b7b6b4b1b0ae7b716ba083709b806f716158967764b08870b29481b69b8ab69f8fb39a89b69f90b49d8db39a89b29988b49c8cb6a090b8a496baa49593867f8f8986bfbbb7bdb9b5bcb7b4bab6b3b9b5b2bab6b2b4b3b1b3b3b0b6b5b3b8b7b5b4b2b0a7a5a38f837dae917ea084725a504c63544da28370b39784b59e8db2a093a698909b918b998e8790857e95877dad998bb39c8cb5a091b9a2938d827c95908dbebab6bbb7b3bdbab7bbb7b4bdb9b6bbb7b4b4b3b0b5b4b1b8b7b5b6b5b3b8b8b5b4b2af968f8ab29a8bab9485544b483a323073655d96887f70655f61595547403e453e3c453f3d57504f655e5b90847db39c8db7a090b6a09189807aaba6a3bdb9b6c0bcb9bebab7bcb7b4bebab7bbb7b4b3b2b0b6b5b3b2b1afb7b6b4b8b7b4b5b4b1aeaba8b5a89fac998d4d44412d25244d46444e4744322b293a3230423937433a37352d2a59504c534b48524a48988a81b59f8fb19c8d827974b2afacbdb9b5bcb8b4bdb9b5bcb8b5bdb9b6bab6b2b8b7b5b5b4b2b6b6b3b9b8b5b7b6b3b6b5b2b8b6b3b9b4b1b2a9a26c64612d25242d2625312a28352d2c453d3a78675c8d7a6ea09792aea6a0615854332b29524a479f8e82b09d90a49b96c1bdb9bebab7bfbbb8bbb8b4b9b5b1b8b4b0b9b4b0b7b6b4b8b7b5b8b7b4b6b5b3b8b6b3bab9b6b9b8b5b4b3b0b7b5b2a5a29f453d3b261e1d261f1e2e2625413936857268977865b19482b5a69caca5a07c7572453d3b746963a0948cc5bfbbc0bbb8beb9b6bbb7b3bbb6b3b7b3afb8b4b0b9b5b1b7b6b3b6b5b3b5b4b2b5b4b2b7b6b3b7b6b3b8b6b3b4b2afb7b6b3b3b1ae6d6765251f1e1e18172a22212d2523443b3971625ab19888b09482a89182877e792c25243e3634766d6abeb9b5bfbbb7bebab6bcb7b3bbb6b3b9b5b1b7b3afb8b4b0b4b3b0b5b4b1b5b4b1b4b3b1b5b4b2b8b6b4b5b3b0b9b6b4b5b4b1b6b4b27f79762a2322221c1b2d2524221b1a443e3c47413f6f676281766f867971675e5a3e37352a222166605dbab7b3bdb9b5beb9b5bcb7b3bcb7b3b9b4b0bab6b2bab6b2b5b3b0b6b4b2b3b2afb7b6b3b4b4b1b4b3b0b6b4b1b5b4b1b4b3b0b9b6b29a8c8252474230292828201f181212322c2c231e1d1c16162c26252923222d26252d2523332b2a8e8885bcb8b5bcb7b3bbb6b2bcb7b3b9b4b1b9b5b1b7b2afb7b2ae7a838e9b9b9caeadacb3b2b0b3b2afb7b7b4b6b5b3b6b6b3b7b6b3b9ada4a991808e7b6f50453f2b24231a14142923221f19181d17161f18182620201d17162a22215d5654b7b3b0bbb7b3bbb6b2b8b4b0bab5b1bbb6b2bab5b1b8b4b0bab6b22c496b4c5d735f68766e727a828285929090adaba8b7b2aeb6a59ab39682a28470a387748e76674e403a1a14141d1716181211221c1c1f1918221c1b2f2827342d2c8d8884bab6b3b9b5b2bab5b1bab5b1b9b4b0bab6b2b8b4b0b9b4b0b7b2ae325e8b365f8a3a5d833f5b7a545f70646469706b6aa08f84b08e78b18e769f7e689e7f6b9e816d907766584940362d2a1c1615201b1a1a1413201a1a251e1d393331a39e9bbab5b1bcb7b3bab6b2b8b3afb8b4b0b9b4b0b9b4b1bab5b2b5b0ac3d6c9843729d44719c426e98415f805a64716f6a699d8677b1927eb3947faa89749d7a649f7f6ba487749e837186716454463f2c25231e181837302e3a33317a7471beb9b6bcb8b4bbb6b2b6b2aebab5b1b9b5b1b8b3afbab6b2b6b1adb5aeaa4877a14c7aa44e7ba345719a3a5d80586b7f767475927b6eb1927faf8e79b08e78a78169a07861a17f6aa58570a688749b83738270666f66618a8480a49e99b7b2aebab6b2bcb8b4b9b5b1b7b2aebab5b1b9b4b0b6b1aeb6b1adb2aca8b2aca84876a04a78a2517fa74771973a5d80405c7a6161677c695fac8a75b08d77b4917aaf8971ad876fa5816aa6846ea78670a98a76ac9484ab9f96b2aca8bdb8b4bcb7b3bcb8b4bcb8b4b8b3afb7b2aeb9b4b0b8b3afb8b2aeb6afabb3aeaab2aeaa4878a14b7aa34c7ba44a759b3d63873b5f825b67766f5f569c7e6caf8c77b18f79b28f78b5927caf8e78a98872aa8a76a98a76ac917fada199b7b0acb9b3afbfb9b5c1bab6bdb6b2b8b3afbab5b1b9b4b0b6afabb7b1adb3ada9b3aeaab0aba8",dne=32,QOn=32;function Q2s(){let t=[];for(let e=0;e{this.tick++,this.tick>=this.maxTicks&&this.stopAnimation(),this.cachedWidth=0,this.ui.requestRender()},80)}stopAnimation(){this.interval&&(clearInterval(this.interval),this.interval=null)}render(e){if(e===this.cachedWidth&&this.cachedTick===this.tick)return this.cachedLines;let n=Se,r=[],s=a=>{let c=a.replace(/\x1b\[[0-9;]*m/g,"").length,u=Math.max(0,Math.floor((e-c)/2));return" ".repeat(u)+a};r.push("");let i=Math.min(this.image.length,Math.floor(this.tick/this.maxTicks*(this.image.length+3)));for(let a=0;a0||this.tick>=this.maxTicks?(r.push(s(n.fg("accent","Free Kimi K2.5 via OpenCode Zen"))),r.push(s(n.fg("success",'"Powered by daxnuts"'))),r.push(s(n.fg("muted","\u2014 @thdxr")))):(r.push(""),r.push(""),r.push("")),r.push(""),o>2||this.tick>=this.maxTicks?(r.push(s(n.fg("dim","Try OpenCode"))),r.push(s(n.fg("mdLink","https://mistral.ai/news/mistral-vibe-2-0")))):(r.push(""),r.push("")),r.push(""),this.cachedLines=r,this.cachedWidth=e,this.cachedTick=this.tick,r}dispose(){this.stopAnimation()}};p();var GOn=Gt(require("node:fs"),1);var $2s="https://mariozechner.at/posts/2026-04-08-ive-sold-out/",WOn="clankolas.png",uTe,$On=!1;function G2s(){if($On)return uTe;$On=!0;try{uTe=GOn.readFileSync(prn(WOn)).toString("base64")}catch{uTe=void 0}return uTe}var dTe=class extends _n{constructor(){super(),this.addChild(new Ln(n=>Se.fg("accent",n))),this.addChild(new yt(Se.bold(Se.fg("accent","pi has joined Earendil")),1,0)),this.addChild(new Nt(1)),this.addChild(new yt(Se.fg("muted","Read the blog post:"),1,0)),this.addChild(new yt(Se.fg("mdLink",$2s),1,0)),this.addChild(new Nt(1));let e=G2s();e&&(this.addChild(new DN(e,"image/png",{fallbackColor:n=>Se.fg("muted",n)},{maxWidthCells:56,filename:WOn})),this.addChild(new Nt(1))),this.addChild(new Ln(n=>Se.fg("accent",n)))}};p();p();var qOn=require("node:child_process"),e1=require("node:fs"),HOn=require("node:os"),Kot=require("node:path");async function pTe(t){let e=(0,e1.mkdtempSync)((0,Kot.join)((0,HOn.tmpdir)(),"pi-editor-")),n=(0,Kot.join)(e,"prompt.md");try{(0,e1.writeFileSync)(n,t.content,"utf-8");let[r,...s]=t.command.split(" ");return process.stdout.write(`Launching external editor: ${t.command} -Pi will resume when the editor exits. -`),await new Promise(o=>{let a=(0,qOn.spawn)(r,[...s,n],{stdio:"inherit",shell:process.platform==="win32"});a.on("error",()=>o(null)),a.on("close",c=>o(c))})!==0?{status:"failed"}:{status:"complete",content:Mi((0,e1.readFileSync)(n,"utf-8")).replace(/\n$/,"")}}finally{try{(0,e1.rmSync)(e,{recursive:!0,force:!0})}catch{}}}var DF=class extends _n{editor;onSubmitCallback;onCancelCallback;tui;keybindings;externalEditorCommand;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.editor.focused=e}constructor(e,n,r,s,i,o,a,c){super(),this.tui=e,this.keybindings=n,this.externalEditorCommand=c||process.env.VISUAL||process.env.EDITOR||(process.platform==="win32"?"notepad":"nano"),this.onSubmitCallback=i,this.onCancelCallback=o,this.addChild(new Ln),this.addChild(new Nt(1)),this.addChild(new yt(Se.fg("accent",r),1,0)),this.addChild(new Nt(1)),this.editor=new NN(e,LX(),a),s&&this.editor.setText(s),this.editor.onSubmit=l=>{this.onSubmitCallback(l)},this.addChild(this.editor),this.addChild(new Nt(1));let u=er("tui.select.confirm","submit")+" "+er("tui.input.newLine","newline")+" "+er("tui.select.cancel","cancel")+` ${er("app.editor.external","external editor")}`;this.addChild(new yt(u,1,0)),this.addChild(new Nt(1)),this.addChild(new Ln)}handleInput(e){if(ms().matches(e,"tui.select.cancel")){this.onCancelCallback();return}if(this.keybindings.matches(e,"app.editor.external")){this.handleOpenExternalEditor();return}this.editor.handleInput(e)}async handleOpenExternalEditor(){let e=this.editor.getText();this.tui.stop();try{let n=await pTe({command:this.externalEditorCommand,content:e});n.status==="complete"&&this.editor.setText(n.content)}finally{this.tui.start(),this.tui.requestRender(!0)}}};p();var NI=require("node:path");function W2s(t){return t.replace(/[\r\n\t]/g," ").replace(/ +/g," ").trim()}function kI(t){return t<1e3?t.toString():t<1e4?`${(t/1e3).toFixed(1)}k`:t<1e6?`${Math.round(t/1e3)}k`:t<1e7?`${(t/1e6).toFixed(1)}M`:`${Math.round(t/1e6)}M`}function q2s(t,e){if(!e)return t;let n=(0,NI.resolve)(t),r=(0,NI.resolve)(e),s=(0,NI.relative)(r,n);return s===""||s!==".."&&!s.startsWith(`..${NI.sep}`)&&!(0,NI.isAbsolute)(s)?s===""?"~":`~${NI.sep}${s}`:t}var BF=class{autoCompactEnabled=!0;session;footerData;constructor(e,n){this.session=e,this.footerData=n}setSession(e){this.session=e}setAutoCompactEnabled(e){this.autoCompactEnabled=e}invalidate(){}dispose(){}render(e){let n=this.session.state,r=bee(),s;for(let re of this.session.sessionManager.getEntries())if(re.type==="message"&&re.message.role==="assistant"){wT(r,re.message.usage);let Z=re.message.usage.input+re.message.usage.cacheRead+re.message.usage.cacheWrite;s=Z>0?re.message.usage.cacheRead/Z*100:void 0}else re.type==="message"&&re.message.role==="toolResult"&&re.message.usage?wT(r,re.message.usage):(re.type==="branch_summary"||re.type==="compaction")&&re.usage&&wT(r,re.usage);let i=this.session.getContextUsage(),o=i?.contextWindow??n.model?.contextWindow??0,a=i?.percent??0,c=i?.percent!==null?a.toFixed(1):"?",u=q2s(this.session.sessionManager.getCwd(),process.env.HOME||process.env.USERPROFILE),l=this.footerData.getGitBranch();l&&(u=`${u} (${l})`);let d=this.session.sessionManager.getSessionName();d&&(u=`${u} \u2022 ${d}`);let h=[];r.input&&h.push(`\u2191${kI(r.input)}`),r.output&&h.push(`\u2193${kI(r.output)}`),r.cacheRead&&h.push(`R${kI(r.cacheRead)}`),r.cacheWrite&&h.push(`W${kI(r.cacheWrite)}`),(r.cacheRead>0||r.cacheWrite>0)&&s!==void 0&&h.push(`CH${s.toFixed(1)}%`);let m=n.model?n.model.provider==="kimi-coding"||this.session.modelRuntime.isUsingSubscription(n.model.provider):!1;if(r.cost||m){let re=`$${r.cost.toFixed(3)}${m?" (sub)":""}`;h.push(re)}let f,g=this.autoCompactEnabled?" (auto)":"",A=c==="?"?`?/${kI(o)}${g}`:`${c}%/${kI(o)}${g}`;a>90?f=Se.fg("error",A):a>70?f=Se.fg("warning",A):f=A,h.push(f),cee()&&h.push(`${Se.fg("dim","\u2022")} ${Se.bold(Se.fg("warning","xp"))}`);let y=h.join(" "),b=n.model?.id||"no-model",S=nn(y);S>e&&(y=pr(y,e,"..."),S=nn(y));let C=2,I=b;if(n.model?.reasoning){let re=n.thinkingLevel||"off";I=re==="off"?`${b} \u2022 thinking off`:`${b} \u2022 ${re}`}let x=I;this.footerData.getAvailableProviderCount()>1&&n.model&&(x=`(${n.model.provider}) ${I}`,S+C+nn(x)>e&&(x=I));let w=nn(x),R=S+C+w,N;if(R<=e){let re=" ".repeat(e-S-w);N=y+re+x}else{let re=e-S-C;if(re>0){let Z=pr(x,re,""),q=nn(Z),ce=" ".repeat(Math.max(0,e-S-q));N=y+ce+Z}else N=y}let P=Se.fg("dim",y),G=N.slice(y.length),$=Se.fg("dim",G),H=[pr(Se.fg("dim",u),e,Se.fg("dim","...")),P+$],oe=this.footerData.getExtensionStatuses();if(oe.size>0){let Z=Array.from(oe.entries()).sort(([q],[ce])=>q.localeCompare(ce)).map(([,q])=>W2s(q)).join(" ");H.push(pr(Z,e,Se.fg("dim","...")))}return H}};p();p();var VOn=require("node:child_process");function hTe(t){let[e,n]=process.platform==="darwin"?["open",[t]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",t]]:["xdg-open",[t]];(0,VOn.spawn)(e,n,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}var WT=class extends _n{contentContainer;input;tui;abortController=new AbortController;inputResolver;inputRejecter;onComplete;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.input.focused=e}constructor(e,n,r,s,i){super(),this.tui=e,this.onComplete=r;let a=i??`Login to ${s||n}`;this.addChild(new Ln),this.addChild(new yt(Se.fg("accent",Se.bold(a)),1,0)),this.contentContainer=new _n,this.addChild(this.contentContainer),this.input=new jo,this.input.onSubmit=()=>{if(this.inputResolver){let c=this.input.getValue();this.replaceInputWithSubmittedText(c),this.inputResolver(c),this.inputResolver=void 0,this.inputRejecter=void 0}},this.input.onEscape=()=>{this.cancel()},this.addChild(new Ln)}get signal(){return this.abortController.signal}replaceInputWithSubmittedText(e){this.contentContainer.children=this.contentContainer.children.map(n=>n===this.input?new yt(`> ${e}`,0,0):n)}cancel(){this.abortController.abort(),this.inputRejecter&&(this.inputRejecter(new Error("Login cancelled")),this.inputResolver=void 0,this.inputRejecter=void 0),this.onComplete(!1,"Login cancelled")}showAuth(e,n){this.contentContainer.clear(),this.contentContainer.addChild(new Nt(1));let r=`\x1B]8;;${e}\x07${e}\x1B]8;;\x07`;this.contentContainer.addChild(new yt(Se.fg("accent",r),1,0));let s=process.platform==="darwin"?"Cmd+click to open":"Ctrl+click to open",i=`\x1B]8;;${e}\x07${s}\x1B]8;;\x07`;this.contentContainer.addChild(new yt(Se.fg("dim",i),1,0)),n&&(this.contentContainer.addChild(new Nt(1)),this.contentContainer.addChild(new yt(Se.fg("warning",n),1,0))),hTe(e),this.tui.requestRender()}showDeviceCode(e){this.contentContainer.clear(),this.contentContainer.addChild(new Nt(1));let n=`\x1B]8;;${e.verificationUri}\x07${e.verificationUri}\x1B]8;;\x07`;this.contentContainer.addChild(new yt(Se.fg("accent",n),1,0));let r=process.platform==="darwin"?"Cmd+click to open":"Ctrl+click to open",s=`\x1B]8;;${e.verificationUri}\x07${r}\x1B]8;;\x07`;this.contentContainer.addChild(new yt(Se.fg("dim",s),1,0)),this.contentContainer.addChild(new Nt(1)),this.contentContainer.addChild(new yt(Se.fg("warning",`Enter code: ${e.userCode}`),1,0)),this.tui.requestRender()}showManualInput(e){return this.input.setValue(""),this.contentContainer.addChild(new Nt(1)),this.contentContainer.addChild(new yt(Se.fg("dim",e),1,0)),this.contentContainer.addChild(this.input),this.contentContainer.addChild(new yt(`(${er("tui.select.cancel","to cancel")})`,1,0)),this.tui.requestRender(),new Promise((n,r)=>{this.inputResolver=n,this.inputRejecter=r})}showPrompt(e,n){return this.contentContainer.addChild(new Nt(1)),this.contentContainer.addChild(new yt(Se.fg("text",e),1,0)),n&&this.contentContainer.addChild(new yt(Se.fg("dim",`e.g., ${n}`),1,0)),this.contentContainer.addChild(this.input),this.contentContainer.addChild(new yt(`(${er("tui.select.cancel","to cancel,")} ${er("tui.select.confirm","to submit")})`,1,0)),this.input.setValue(""),this.tui.requestRender(),new Promise((r,s)=>{this.inputResolver=r,this.inputRejecter=s})}showDetails(e){this.contentContainer.clear(),this.contentContainer.addChild(new Nt(1));for(let n of e)this.contentContainer.addChild(new yt(n,1,0));this.tui.requestRender()}showInfo(e,n=[],r=!1){this.contentContainer.addChild(new Nt(1)),this.contentContainer.addChild(new yt(Se.fg("text",e),1,0));for(let s of n){let i=s.label?`${s.label}: ${s.url}`:s.url,o=`\x1B]8;;${s.url}\x07${i}\x1B]8;;\x07`;this.contentContainer.addChild(new yt(Se.fg("accent",o),1,0))}r&&(this.contentContainer.addChild(new Nt(1)),this.contentContainer.addChild(new yt(`(${er("tui.select.cancel","to close")})`,1,0))),this.tui.requestRender()}showWaiting(e){this.contentContainer.addChild(new Nt(1)),this.contentContainer.addChild(new yt(Se.fg("dim",e),1,0)),this.contentContainer.addChild(new yt(`(${er("tui.select.cancel","to cancel")})`,1,0)),this.tui.requestRender()}showProgress(e){this.contentContainer.addChild(new yt(Se.fg("dim",e),1,0)),this.tui.requestRender()}handleInput(e){if(ms().matches(e,"tui.select.cancel")){this.cancel();return}this.input.handleInput(e)}};p();p();p();p();p();var zot=[[0,172,1],[173,173,0],[174,767,1],[768,879,0],[880,1154,1],[1155,1161,0],[1162,1424,1],[1425,1469,0],[1470,1470,1],[1471,1471,0],[1472,1472,1],[1473,1474,0],[1475,1475,1],[1476,1477,0],[1478,1478,1],[1479,1479,0],[1480,1540,1],[1541,1541,0],[1542,1551,1],[1552,1562,0],[1563,1563,1],[1564,1564,0],[1565,1610,1],[1611,1631,0],[1632,1647,1],[1648,1648,0],[1649,1749,1],[1750,1756,0],[1757,1758,1],[1759,1764,0],[1765,1766,1],[1767,1768,0],[1769,1769,1],[1770,1773,0],[1774,1806,1],[1807,1807,0],[1808,1808,1],[1809,1809,0],[1810,1839,1],[1840,1866,0],[1867,1957,1],[1958,1968,0],[1969,2026,1],[2027,2035,0],[2036,2044,1],[2045,2045,0],[2046,2069,1],[2070,2073,0],[2074,2074,1],[2075,2083,0],[2084,2084,1],[2085,2087,0],[2088,2088,1],[2089,2093,0],[2094,2136,1],[2137,2139,0],[2140,2191,1],[2192,2193,0],[2194,2199,1],[2200,2207,0],[2208,2249,1],[2250,2306,0],[2307,2361,1],[2362,2362,0],[2363,2363,1],[2364,2364,0],[2365,2368,1],[2369,2376,0],[2377,2380,1],[2381,2381,0],[2382,2384,1],[2385,2391,0],[2392,2401,1],[2402,2403,0],[2404,2432,1],[2433,2433,0],[2434,2491,1],[2492,2492,0],[2493,2493,1],[2494,2494,0],[2495,2496,1],[2497,2500,0],[2501,2508,1],[2509,2509,0],[2510,2518,1],[2519,2519,0],[2520,2529,1],[2530,2531,0],[2532,2557,1],[2558,2558,0],[2559,2560,1],[2561,2562,0],[2563,2619,1],[2620,2620,0],[2621,2624,1],[2625,2626,0],[2627,2630,1],[2631,2632,0],[2633,2634,1],[2635,2637,0],[2638,2640,1],[2641,2641,0],[2642,2671,1],[2672,2673,0],[2674,2676,1],[2677,2677,0],[2678,2688,1],[2689,2690,0],[2691,2747,1],[2748,2748,0],[2749,2752,1],[2753,2757,0],[2758,2758,1],[2759,2760,0],[2761,2764,1],[2765,2765,0],[2766,2785,1],[2786,2787,0],[2788,2809,1],[2810,2815,0],[2816,2816,1],[2817,2817,0],[2818,2875,1],[2876,2876,0],[2877,2877,1],[2878,2879,0],[2880,2880,1],[2881,2884,0],[2885,2892,1],[2893,2893,0],[2894,2900,1],[2901,2903,0],[2904,2913,1],[2914,2915,0],[2916,2945,1],[2946,2946,0],[2947,3005,1],[3006,3006,0],[3007,3007,1],[3008,3008,0],[3009,3020,1],[3021,3021,0],[3022,3030,1],[3031,3031,0],[3032,3071,1],[3072,3072,0],[3073,3075,1],[3076,3076,0],[3077,3131,1],[3132,3132,0],[3133,3133,1],[3134,3136,0],[3137,3141,1],[3142,3144,0],[3145,3145,1],[3146,3149,0],[3150,3156,1],[3157,3158,0],[3159,3169,1],[3170,3171,0],[3172,3200,1],[3201,3201,0],[3202,3259,1],[3260,3260,0],[3261,3262,1],[3263,3264,0],[3265,3265,1],[3266,3266,0],[3267,3269,1],[3270,3272,0],[3273,3273,1],[3274,3277,0],[3278,3284,1],[3285,3286,0],[3287,3297,1],[3298,3299,0],[3300,3327,1],[3328,3329,0],[3330,3386,1],[3387,3388,0],[3389,3389,1],[3390,3390,0],[3391,3392,1],[3393,3396,0],[3397,3404,1],[3405,3406,0],[3407,3414,1],[3415,3415,0],[3416,3425,1],[3426,3427,0],[3428,3456,1],[3457,3457,0],[3458,3529,1],[3530,3530,0],[3531,3534,1],[3535,3535,0],[3536,3537,1],[3538,3540,0],[3541,3541,1],[3542,3542,0],[3543,3550,1],[3551,3551,0],[3552,3632,1],[3633,3633,0],[3634,3635,1],[3636,3642,0],[3643,3654,1],[3655,3662,0],[3663,3760,1],[3761,3761,0],[3762,3763,1],[3764,3772,0],[3773,3783,1],[3784,3790,0],[3791,3863,1],[3864,3865,0],[3866,3892,1],[3893,3893,0],[3894,3894,1],[3895,3895,0],[3896,3896,1],[3897,3897,0],[3898,3952,1],[3953,3966,0],[3967,3967,1],[3968,3972,0],[3973,3973,1],[3974,3975,0],[3976,3980,1],[3981,3991,0],[3992,3992,1],[3993,4028,0],[4029,4037,1],[4038,4038,0],[4039,4140,1],[4141,4144,0],[4145,4145,1],[4146,4151,0],[4152,4152,1],[4153,4154,0],[4155,4156,1],[4157,4158,0],[4159,4183,1],[4184,4185,0],[4186,4189,1],[4190,4192,0],[4193,4208,1],[4209,4212,0],[4213,4225,1],[4226,4226,0],[4227,4228,1],[4229,4230,0],[4231,4236,1],[4237,4237,0],[4238,4252,1],[4253,4253,0],[4254,4351,1],[4352,4447,2],[4448,4607,0],[4608,4956,1],[4957,4959,0],[4960,5905,1],[5906,5908,0],[5909,5937,1],[5938,5939,0],[5940,5969,1],[5970,5971,0],[5972,6001,1],[6002,6003,0],[6004,6051,1],[6052,6052,2],[6053,6067,1],[6068,6069,0],[6070,6070,1],[6071,6077,0],[6078,6085,1],[6086,6086,0],[6087,6088,1],[6089,6099,0],[6100,6103,1],[6104,6104,3],[6105,6108,1],[6109,6109,0],[6110,6154,1],[6155,6159,0],[6160,6276,1],[6277,6278,0],[6279,6312,1],[6313,6313,0],[6314,6431,1],[6432,6434,0],[6435,6438,1],[6439,6440,0],[6441,6449,1],[6450,6450,0],[6451,6456,1],[6457,6459,0],[6460,6678,1],[6679,6680,0],[6681,6682,1],[6683,6683,0],[6684,6741,1],[6742,6742,0],[6743,6743,1],[6744,6750,0],[6751,6751,1],[6752,6752,0],[6753,6753,1],[6754,6754,0],[6755,6756,1],[6757,6764,0],[6765,6770,1],[6771,6780,0],[6781,6782,1],[6783,6783,0],[6784,6831,1],[6832,6862,0],[6863,6911,1],[6912,6915,0],[6916,6963,1],[6964,6973,0],[6974,6977,1],[6978,6979,0],[6980,7018,1],[7019,7027,0],[7028,7039,1],[7040,7041,0],[7042,7073,1],[7074,7077,0],[7078,7079,1],[7080,7081,0],[7082,7082,1],[7083,7085,0],[7086,7141,1],[7142,7142,0],[7143,7143,1],[7144,7145,0],[7146,7148,1],[7149,7149,0],[7150,7150,1],[7151,7153,0],[7154,7211,1],[7212,7219,0],[7220,7221,1],[7222,7223,0],[7224,7375,1],[7376,7378,0],[7379,7379,1],[7380,7392,0],[7393,7393,1],[7394,7400,0],[7401,7404,1],[7405,7405,0],[7406,7411,1],[7412,7412,0],[7413,7415,1],[7416,7417,0],[7418,7615,1],[7616,7679,0],[7680,8202,1],[8203,8207,0],[8208,8233,1],[8234,8238,0],[8239,8287,1],[8288,8303,0],[8304,8399,1],[8400,8432,0],[8433,8985,1],[8986,8987,2],[8988,9e3,1],[9001,9002,2],[9003,9192,1],[9193,9196,2],[9197,9199,1],[9200,9200,2],[9201,9202,1],[9203,9203,2],[9204,9724,1],[9725,9726,2],[9727,9747,1],[9748,9749,2],[9750,9799,1],[9800,9811,2],[9812,9854,1],[9855,9855,2],[9856,9874,1],[9875,9875,2],[9876,9888,1],[9889,9889,2],[9890,9897,1],[9898,9899,2],[9900,9916,1],[9917,9918,2],[9919,9923,1],[9924,9925,2],[9926,9933,1],[9934,9934,2],[9935,9939,1],[9940,9940,2],[9941,9961,1],[9962,9962,2],[9963,9969,1],[9970,9971,2],[9972,9972,1],[9973,9973,2],[9974,9977,1],[9978,9978,2],[9979,9980,1],[9981,9981,2],[9982,9988,1],[9989,9989,2],[9990,9993,1],[9994,9995,2],[9996,10023,1],[10024,10024,2],[10025,10059,1],[10060,10060,2],[10061,10061,1],[10062,10062,2],[10063,10066,1],[10067,10069,2],[10070,10070,1],[10071,10071,2],[10072,10132,1],[10133,10135,2],[10136,10159,1],[10160,10160,2],[10161,10174,1],[10175,10175,2],[10176,11034,1],[11035,11036,2],[11037,11087,1],[11088,11088,2],[11089,11092,1],[11093,11093,2],[11094,11502,1],[11503,11505,0],[11506,11743,1],[11744,11775,0],[11776,11903,1],[11904,11929,2],[11930,11930,1],[11931,12019,2],[12020,12031,1],[12032,12245,2],[12246,12271,1],[12272,12329,2],[12330,12335,0],[12336,12350,2],[12351,12352,1],[12353,12438,2],[12439,12440,1],[12441,12442,0],[12443,12543,2],[12544,12548,1],[12549,12591,2],[12592,12592,1],[12593,12643,2],[12644,12644,0],[12645,12686,2],[12687,12687,1],[12688,12771,2],[12772,12782,1],[12783,12830,2],[12831,12831,1],[12832,12871,2],[12872,12879,1],[12880,19903,2],[19904,19967,1],[19968,42124,2],[42125,42127,1],[42128,42182,2],[42183,42606,1],[42607,42610,0],[42611,42611,1],[42612,42621,0],[42622,42653,1],[42654,42655,0],[42656,42735,1],[42736,42737,0],[42738,43009,1],[43010,43010,0],[43011,43013,1],[43014,43014,0],[43015,43018,1],[43019,43019,0],[43020,43044,1],[43045,43046,0],[43047,43051,1],[43052,43052,0],[43053,43203,1],[43204,43205,0],[43206,43231,1],[43232,43249,0],[43250,43257,1],[43258,43258,0],[43259,43262,1],[43263,43263,0],[43264,43301,1],[43302,43309,0],[43310,43334,1],[43335,43345,0],[43346,43359,1],[43360,43388,2],[43389,43391,1],[43392,43394,0],[43395,43442,1],[43443,43443,0],[43444,43445,1],[43446,43449,0],[43450,43451,1],[43452,43453,0],[43454,43492,1],[43493,43493,0],[43494,43560,1],[43561,43566,0],[43567,43568,1],[43569,43570,0],[43571,43572,1],[43573,43574,0],[43575,43586,1],[43587,43587,0],[43588,43595,1],[43596,43596,0],[43597,43643,1],[43644,43644,0],[43645,43695,1],[43696,43696,0],[43697,43697,1],[43698,43700,0],[43701,43702,1],[43703,43704,0],[43705,43709,1],[43710,43711,0],[43712,43712,1],[43713,43713,0],[43714,43755,1],[43756,43757,0],[43758,43765,1],[43766,43766,0],[43767,44004,1],[44005,44005,0],[44006,44007,1],[44008,44008,0],[44009,44012,1],[44013,44013,0],[44014,44031,1],[44032,55203,2],[55204,55215,1],[55216,55238,0],[55239,55242,1],[55243,55291,0],[55292,63743,1],[63744,64255,2],[64256,64285,1],[64286,64286,0],[64287,65023,1],[65024,65039,0],[65040,65049,2],[65050,65055,1],[65056,65071,0],[65072,65106,2],[65107,65107,1],[65108,65126,2],[65127,65127,1],[65128,65131,2],[65132,65278,1],[65279,65279,0],[65280,65280,1],[65281,65376,2],[65377,65437,1],[65438,65440,0],[65441,65503,1],[65504,65510,2],[65511,65519,1],[65520,65528,0],[65529,66044,1],[66045,66045,0],[66046,66271,1],[66272,66272,0],[66273,66421,1],[66422,66426,0],[66427,68096,1],[68097,68099,0],[68100,68100,1],[68101,68102,0],[68103,68107,1],[68108,68111,0],[68112,68151,1],[68152,68154,0],[68155,68158,1],[68159,68159,0],[68160,68324,1],[68325,68326,0],[68327,68899,1],[68900,68903,0],[68904,69290,1],[69291,69292,0],[69293,69372,1],[69373,69375,0],[69376,69445,1],[69446,69456,0],[69457,69505,1],[69506,69509,0],[69510,69632,1],[69633,69633,0],[69634,69687,1],[69688,69702,0],[69703,69743,1],[69744,69744,0],[69745,69746,1],[69747,69748,0],[69749,69758,1],[69759,69761,0],[69762,69810,1],[69811,69814,0],[69815,69816,1],[69817,69818,0],[69819,69825,1],[69826,69826,0],[69827,69887,1],[69888,69890,0],[69891,69926,1],[69927,69931,0],[69932,69932,1],[69933,69940,0],[69941,70002,1],[70003,70003,0],[70004,70015,1],[70016,70017,0],[70018,70069,1],[70070,70078,0],[70079,70081,1],[70082,70083,0],[70084,70088,1],[70089,70092,0],[70093,70094,1],[70095,70095,0],[70096,70190,1],[70191,70193,0],[70194,70195,1],[70196,70196,0],[70197,70197,1],[70198,70199,0],[70200,70205,1],[70206,70206,0],[70207,70208,1],[70209,70209,0],[70210,70366,1],[70367,70367,0],[70368,70370,1],[70371,70378,0],[70379,70399,1],[70400,70401,0],[70402,70458,1],[70459,70460,0],[70461,70461,1],[70462,70462,0],[70463,70463,1],[70464,70464,0],[70465,70486,1],[70487,70487,0],[70488,70501,1],[70502,70508,0],[70509,70511,1],[70512,70516,0],[70517,70711,1],[70712,70719,0],[70720,70721,1],[70722,70724,0],[70725,70725,1],[70726,70726,0],[70727,70749,1],[70750,70750,0],[70751,70831,1],[70832,70832,0],[70833,70834,1],[70835,70840,0],[70841,70841,1],[70842,70842,0],[70843,70844,1],[70845,70845,0],[70846,70846,1],[70847,70848,0],[70849,70849,1],[70850,70851,0],[70852,71086,1],[71087,71087,0],[71088,71089,1],[71090,71093,0],[71094,71099,1],[71100,71101,0],[71102,71102,1],[71103,71104,0],[71105,71131,1],[71132,71133,0],[71134,71218,1],[71219,71226,0],[71227,71228,1],[71229,71229,0],[71230,71230,1],[71231,71232,0],[71233,71338,1],[71339,71339,0],[71340,71340,1],[71341,71341,0],[71342,71343,1],[71344,71349,0],[71350,71350,1],[71351,71351,0],[71352,71452,1],[71453,71455,0],[71456,71457,1],[71458,71461,0],[71462,71462,1],[71463,71467,0],[71468,71726,1],[71727,71735,0],[71736,71736,1],[71737,71738,0],[71739,71983,1],[71984,71984,0],[71985,71994,1],[71995,71996,0],[71997,71997,1],[71998,71999,0],[72e3,72e3,1],[72001,72001,0],[72002,72002,1],[72003,72003,0],[72004,72147,1],[72148,72151,0],[72152,72153,1],[72154,72155,0],[72156,72159,1],[72160,72160,0],[72161,72192,1],[72193,72202,0],[72203,72242,1],[72243,72248,0],[72249,72249,1],[72250,72254,0],[72255,72262,1],[72263,72263,0],[72264,72272,1],[72273,72278,0],[72279,72280,1],[72281,72283,0],[72284,72323,1],[72324,72342,0],[72343,72343,1],[72344,72345,0],[72346,72751,1],[72752,72758,0],[72759,72759,1],[72760,72765,0],[72766,72766,1],[72767,72767,0],[72768,72849,1],[72850,72871,0],[72872,72873,1],[72874,72880,0],[72881,72881,1],[72882,72883,0],[72884,72884,1],[72885,72886,0],[72887,73008,1],[73009,73014,0],[73015,73017,1],[73018,73018,0],[73019,73019,1],[73020,73021,0],[73022,73022,1],[73023,73031,0],[73032,73103,1],[73104,73105,0],[73106,73108,1],[73109,73109,0],[73110,73110,1],[73111,73111,0],[73112,73458,1],[73459,73460,0],[73461,73471,1],[73472,73474,0],[73475,73525,1],[73526,73530,0],[73531,73535,1],[73536,73536,0],[73537,73537,1],[73538,73538,0],[73539,78911,1],[78912,78912,0],[78913,78918,1],[78919,78933,0],[78934,92911,1],[92912,92916,0],[92917,92975,1],[92976,92982,0],[92983,94030,1],[94031,94031,0],[94032,94094,1],[94095,94098,0],[94099,94175,1],[94176,94179,2],[94180,94180,0],[94181,94191,1],[94192,94193,2],[94194,94207,1],[94208,100343,2],[100344,100351,1],[100352,101589,2],[101590,101631,1],[101632,101640,2],[101641,110575,1],[110576,110579,2],[110580,110580,1],[110581,110587,2],[110588,110588,1],[110589,110590,2],[110591,110591,1],[110592,110882,2],[110883,110897,1],[110898,110898,2],[110899,110927,1],[110928,110930,2],[110931,110932,1],[110933,110933,2],[110934,110947,1],[110948,110951,2],[110952,110959,1],[110960,111355,2],[111356,113820,1],[113821,113822,0],[113823,113823,1],[113824,113827,0],[113828,118527,1],[118528,118573,0],[118574,118575,1],[118576,118598,0],[118599,119140,1],[119141,119141,0],[119142,119142,1],[119143,119145,0],[119146,119149,1],[119150,119170,0],[119171,119172,1],[119173,119179,0],[119180,119209,1],[119210,119213,0],[119214,119361,1],[119362,119364,0],[119365,121343,1],[121344,121398,0],[121399,121402,1],[121403,121452,0],[121453,121460,1],[121461,121461,0],[121462,121475,1],[121476,121476,0],[121477,121498,1],[121499,121503,0],[121504,121504,1],[121505,121519,0],[121520,122879,1],[122880,122886,0],[122887,122887,1],[122888,122904,0],[122905,122906,1],[122907,122913,0],[122914,122914,1],[122915,122916,0],[122917,122917,1],[122918,122922,0],[122923,123022,1],[123023,123023,0],[123024,123183,1],[123184,123190,0],[123191,123565,1],[123566,123566,0],[123567,123627,1],[123628,123631,0],[123632,124139,1],[124140,124143,0],[124144,125135,1],[125136,125142,0],[125143,125251,1],[125252,125258,0],[125259,126979,1],[126980,126980,2],[126981,127182,1],[127183,127183,2],[127184,127373,1],[127374,127374,2],[127375,127376,1],[127377,127386,2],[127387,127487,1],[127488,127490,2],[127491,127503,1],[127504,127547,2],[127548,127551,1],[127552,127560,2],[127561,127567,1],[127568,127569,2],[127570,127583,1],[127584,127589,2],[127590,127743,1],[127744,127776,2],[127777,127788,1],[127789,127797,2],[127798,127798,1],[127799,127868,2],[127869,127869,1],[127870,127891,2],[127892,127903,1],[127904,127946,2],[127947,127950,1],[127951,127955,2],[127956,127967,1],[127968,127984,2],[127985,127987,1],[127988,127988,2],[127989,127991,1],[127992,128062,2],[128063,128063,1],[128064,128064,2],[128065,128065,1],[128066,128252,2],[128253,128254,1],[128255,128317,2],[128318,128330,1],[128331,128334,2],[128335,128335,1],[128336,128359,2],[128360,128377,1],[128378,128378,2],[128379,128404,1],[128405,128406,2],[128407,128419,1],[128420,128420,2],[128421,128506,1],[128507,128591,2],[128592,128639,1],[128640,128709,2],[128710,128715,1],[128716,128716,2],[128717,128719,1],[128720,128722,2],[128723,128724,1],[128725,128727,2],[128728,128731,1],[128732,128735,2],[128736,128746,1],[128747,128748,2],[128749,128755,1],[128756,128764,2],[128765,128991,1],[128992,129003,2],[129004,129007,1],[129008,129008,2],[129009,129291,1],[129292,129338,2],[129339,129339,1],[129340,129349,2],[129350,129350,1],[129351,129535,2],[129536,129647,1],[129648,129660,2],[129661,129663,1],[129664,129672,2],[129673,129679,1],[129680,129725,2],[129726,129726,1],[129727,129733,2],[129734,129741,1],[129742,129755,2],[129756,129759,1],[129760,129768,2],[129769,129775,1],[129776,129784,2],[129785,131071,1],[131072,196605,2],[196606,196607,1],[196608,262141,2],[262142,917503,1],[917504,921599,0],[921600,1114111,1]];var jOn=new Intl.Segmenter("en",{granularity:"grapheme"}),H2s=65039,V2s=t=>t>=127462&&t<=127487;function j2s(t){let e=0,n=zot.length-1;for(;e<=n;){let r=e+n>>1,s=zot[r];if(ts[1])e=r+1;else return s[2]}return 1}function YOn(t){let e=0,n=!1,r=0;for(let s of t){let i=s.codePointAt(0);i===H2s&&(n=!0),V2s(i)&&r++;let o=j2s(i);o>e&&(e=o)}return n||r>=2?2:e}function*qT(t){for(let{segment:e}of jOn.segment(t))yield[e,YOn(e)]}function Au(t){let e=0;for(let{segment:n}of jOn.segment(t))e+=YOn(n);return e}var hne=24,KOn=4,mne=28,Y2s=["_","-",".","/"],t1=t=>t.replace(/[A-Z]/g,e=>e.toLowerCase()),zOn=t=>t.replace(/[a-z]/g,e=>e.toUpperCase()),K2s=/[\0-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/g,JOn=t=>t.replace(K2s,"");function XOn(t){let e=t.split(` -`).map(n=>n.endsWith("\r")?n.slice(0,-1):n);return e.length>0&&e[e.length-1]===""&&e.pop(),e}var z2s=/[\p{Alphabetic}\p{N}]/u,Xot=t=>z2s.test(t),mTe=t=>Xot(t)||t==="_",J2s=10,X2s={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};function Z2s(t){let e=X2s[t];if(e!==void 0)return e;if(!t.startsWith("#"))return null;let n=t.slice(1),r=/^[xX]/.test(n),s=r?n.slice(1):n;if(!(r?/^[0-9a-fA-F]+$/:/^[0-9]+$/).test(s))return null;let i=Number.parseInt(s,r?16:10);return i>1114111||i>=55296&&i<=57343||i<32||i>=127&&i<=159?null:String.fromCodePoint(i)}function gb(t){if(!t.includes("&"))return t;let e=[...t],n="",r=0;for(;ri!=="`").join("").replaceAll("**","").replaceAll("__","")],s="";for(let i=0;i0&&Xot(r[i-1])&&r[i+1]!==void 0&&Xot(r[i+1]);(o==="*"||o==="_")&&!a||(s+=o)}return s.trim()}var t$s=new Set(["b","strong","i","em","u","s","strike","del","ins","mark","small","big","sub","sup","code","kbd","samp","var","tt","span","font","q","abbr","cite","pre"]);function n$s(t,e){let n=e+1;t[n]==="/"&&n++;let r=n;for(;n";){if(t[n]==="<")return null;n++}return t[n]===">"?{name:s,end:n+1}:null}function r$s(t){let e=[...t],n="",r=0;for(;r=e.length+n.length&&t.startsWith(e)&&t.endsWith(n)?t.slice(e.length,t.length-n.length):null}function HT(t){let e=r$s(t.trim()).trim(),n=(Jot(e,'"','"')??Jot(e,"'","'")??e).trim(),r=Jot(n,"`","`");return gb(r===null?n:e$s(r.trim()))}function s$s(t){let e=-1;for(let n of Y2s)e=Math.max(e,t.lastIndexOf(n));return e}function ZOn(t,e,n){e=Math.max(1,e);let r=[],s="",i=0;for(let o of t.split(/\s+/).filter(a=>a!=="")){let a=Au(o);if(a>e){s!==""&&(r.push(s),s="");let c="",u=0;for(let[l,d]of qT(o)){if(u+d>e&&c!==""){let h=s$s(c),m=h===-1?"":c.slice(h+1);r.push(h===-1?c:c.slice(0,h+1)),c=m,u=Au(m)}c+=l,u+=d}s=c,i=u}else s===""?(s=o,i=a):i+1+a<=e?(s+=` ${o}`,i+=1+a):(r.push(s),s=o,i=a)}if(s!==""&&r.push(s),r.length===0&&r.push(""),r.length>n){r.length=n;let o=Math.max(1,e-1),a="",c=0;for(let[u,l]of qT(r[r.length-1])){if(c+l>o)break;a+=u,c+=l}r[r.length-1]=`${a}\u2026`}return r}function DI(t,e){if(Au(t)<=e)return t;let n="",r=0;for(let[s,i]of qT(t)){if(r+i+1>e)break;n+=s,r+=i}return`${n}\u2026`}p();p();var fne="\0",bg=1,ch=2,by=4,hp=8,Zot=1,eat=2,tat=4,PF=class{w;h;ch;cls;mask;style;occupied;curStyle=tat;constructor(e,n){let r=e*n;this.w=e,this.h=n,this.ch=new Array(r).fill(" "),this.cls=new Array(r).fill("none"),this.mask=new Uint8Array(r),this.style=new Uint8Array(r),this.occupied=new Uint8Array(r)}idx(e,n){return n*this.w+e}set(e,n,r,s){if(e>=this.w||n>=this.h)return;let i=this.idx(e,n);this.ch[i]=r,this.cls[i]=s}addBits(e,n,r,s="edge"){if(e>=this.w||n>=this.h)return;let i=this.idx(e,n);this.occupied[i]||(this.mask[i]|=r,this.style[i]|=this.curStyle,this.cls[i]!=="border"&&(this.cls[i]=s))}blit(e,n,r){for(let s=0;s=this.w||a>=this.h)continue;let c=e.idx(i,s),u=this.idx(o,a);this.ch[u]=e.ch[c],this.cls[u]=e.cls[c],this.style[u]=e.style[c],this.occupied[u]=1}}junction(e,n,r){if(e>=this.w||n>=this.h)return;let s=this.idx(e,n);this.mask[s]|=r,this.cls[s]!=="border"&&(this.cls[s]="edge")}segV(e,n,r){let s=Math.min(n,r),i=Math.max(n,r);for(let o=s;o<=i;o++){let a=0;o>s&&(a|=bg),os&&(a|=by),o=0;h--)if(this.ch[this.idx(h,o)]!==" "){a=h+1;break}r=Math.max(r,a);let c=[],u="",l="",d="none";for(let h=0;hs&&e[i-1]==="";)i--;return{plain:e.slice(s,i),styled:n.slice(s,i),width:r}}};function i$s(t,e,n){for(let r=e,s=n-1;ra$s[t]??t,p$s=t=>c$s[t]??t,h$s=t=>l$s[t]??t,m$s=t=>u$s[t]??t;p();var nat=128,n1=512,tMn=24,nMn=6,gne=8,fTe=()=>({annotation:null,attrs:[],methods:[]});function gTe(t){switch(zOn(t)){case"LR":return"right";case"RL":return"left";case"BT":return"up";default:return"down"}}var VT=class{nodes=[];edges=[];index=new Map;groups=[];nodeGroup=[];curGroup=null;overCap=!1;warnings=[];dir="down";constructor(e="down"){this.dir=e}nodeIndex(e,n,r){let s=this.index.get(e);return s!==void 0?(n!==null&&(this.nodes[s].label=n,this.nodes[s].shape=r),s):this.nodes.length>=nat?(this.overCap=!0,null):(this.index.set(e,this.nodes.length),this.nodes.push({label:n??e,shape:r}),this.nodeGroup.push(this.curGroup),this.nodes.length-1)}nodeLabel(e,n){let r=this.index.get(e);return r!==void 0?(this.nodes[r].label=n,r):this.nodeIndex(e,n,"round")}pushEdge(e){return this.edges.length>=n1?(this.overCap=!0,!1):(this.edges.push(e),!0)}};var MF=1,sMn=3,f$s=2,g$s=1<<21,Ab=(t,e)=>Math.max(0,t-e),U0=t=>Math.floor(t/2);function A$s(t){let e=t.nodes.length,n=Array.from({length:e},()=>[]),r=new Array(e).fill(0);for(let u of t.edges)u.from!==u.to&&(n[u.from].push(u.to),r[u.to]++);let s=new Uint8Array(e),i=Array.from({length:e},()=>[]),o=[],a=[...Array(e).keys()].filter(u=>r[u]===0);for(let u of[...a,...Array(e).keys()])s[u]===0&&y$s(u,n,s,i,o);let c=new Array(e).fill(0);for(let u=o.length-1;u>=0;u--){let l=o[u];for(let d of i[l])c[d]=Math.max(c[d],c[l]+1)}return c}function y$s(t,e,n,r,s){let i=[{u:t,i:0}];for(n[t]=1;i.length>0;){let o=i[i.length-1],a=o.u;if(o.i[]),i=Array.from({length:r},()=>[]);for(let l of e)l.from!==l.to&&n[l.to]>n[l.from]&&(s[l.to].push(l.from),i[l.from].push(l.to));let o=new Array(r).fill(0),a=l=>{for(let d=0;d[...l]),u=rMn(e,n,o);if(u!==0){for(let l=0;l<8;l++){let d=l%2===0?t.slice(1):t.slice(0,-1).reverse(),h=l%2===0?s:i;for(let f of d)b$s(f,h,o),a(f);let m=rMn(e,n,o);if(m[...f])),u===0)break}for(let l=0;l({key:e[s].length===0?n[s]:e[s].reduce((i,o)=>i+n[o],0)/e[s].length,v:s}));r.sort((s,i)=>s.key-i.key);for(let s=0;si.from!==i.to&&e[i.to]===e[i.from]+1).map(i=>[e[i.from],n[i.from],n[i.to]]),s=0;for(let i=0;ic[2]||o[1]>c[1]&&o[2][]),a=Array.from({length:i},()=>[]);for(let l of r)l.from!==l.to&&s[l.to]>s[l.from]&&(o[l.to].push(l.from),a[l.from].push(l.to));let c=new Array(i).fill(0);for(let l of t){let d=0;for(let h of l){let m=e[h]/2;d+=m,c[h]=d,d+=m+n}}for(let l=0;l<10;l++){let d=l%2===0?t:[...t].reverse(),h=l%2===0?o:a;for(let m of d)_$s(m,h,c,e,n)}let u=Number.POSITIVE_INFINITY;for(let l=0;lMath.max(0,Math.round(c[d]-u)))}function _$s(t,e,n,r,s){let i=t.length;if(i===0)return;let o=t.map(l=>e[l].length===0?n[l]:e[l].reduce((d,h)=>d+n[h],0)/e[l].length),a=l=>r[t[l]]/2,c=new Array(i);for(let l=0;l=0;l--)u[l]=l===i-1?o[l]:Math.min(o[l],u[l+1]-a(l+1)-s-a(l));for(let l=0;l{for(let o=0;o<5;o++)if(s[o]!==i[o])return s[o]-i[o];return 0}),n=[],r=[];for(let[s,i,o,a,c]of e){let u=n.findIndex(l=>l.every(([d,h,m,f])=>h+2<=s||i+2<=d||m===o||f===a));u===-1&&(n.push([]),u=n.length-1),n[u].push([s,i,o,a]),r.push([c,u])}return{assigned:r,count:n.length}}function oMn(t,e,n,r,s){let i=[];return t.edges.forEach((o,a)=>{let c=s?n[o.from]!==n[o.to]:Math.abs(n[o.from]-n[o.to])>1;o.from!==o.to&&e[o.from]===r&&e[o.to]===r+1&&c&&i.push([Math.min(n[o.from],n[o.to]),Math.max(n[o.from],n[o.to]),o.from,o.to,a])}),i}function aMn(t,e,n,r){let s=[];return t.edges.forEach((i,o)=>{if(i.from===i.to||e[i.to]===e[i.from]+1)return;let a=n[i.from],c=n[i.to],u=r?Math.min(a.cy,c.cy):Math.min(a.cx,c.cx),l=r?Math.max(a.cy,c.cy):Math.max(a.cx,c.cx);s.push([u,l,i.from,i.to,o])}),s}function S$s(t,e,n,r,s,i){let o=iMn(n,r.layW,sMn,s.edges,t),a=new Array(s.edges.length).fill(0),c=new Array(e+1).fill(0);for(let S=0;SS.length===0?3:Math.max(...S.map(C=>r.boxH[C]+r.extraH[C]))),l=new Array(e+1).fill(0);for(let S=1;S<=e;S++)l[S]=l[S-1]+u[S-1]+Math.max(f$s,c[S-1]+1);let d=l[e]+u[e],h=Array.from({length:e+1},(S,C)=>l[C]+u[C]),m=1;n.forEach((S,C)=>{for(let I of S){let x=r.boxW[I],w=r.boxH[I],R=o[I],N=Ab(R,U0(x)),P=l[C]+U0(u[C]-w-r.extraH[I]);i[I]={x:N,y:P,w:x,h:w,cx:R,cy:P+U0(w),rank:C},m=Math.max(m,N+x),r.extraH[I]>0&&r.selfLabelW[I]>0&&(m=Math.max(m,N+x+2+r.selfLabelW[I]))}});let f=m;for(let S of s.edges){if(S.from===S.to||S.label===null)continue;let C=Math.min(Au(S.label),mne);f=t[S.to]===t[S.from]+1?Math.max(f,i[S.to].cx+2+C):Math.max(f,m+C+1)}let g=new Array(s.edges.length).fill(0),A=aMn(s,t,i,!0),y=f,b=0;if(A.length>0){let{assigned:S,count:C}=yTe(A);for(let[I,x]of S)g[I]=x;y=f+1+C,b=f+1}return{canvasW:y,canvasH:d,bandEnd:h,edgeBus:a,laneBase:b,edgeLane:g}}function C$s(t,e,n,r,s,i){let o=n.map(x=>x.length===0?0:Math.max(...x.map(w=>r.boxW[w]))),a=s.edges.filter(x=>x.from===x.to||t[x.to]===t[x.from]+1).filter(x=>x.label!==null).map(x=>Math.min(Au(x.label),mne)),c=a.length===0?0:Math.max(...a),u=Math.max(sMn+1,c+3),l=iMn(n,r.layH,1,s.edges,t),d=new Array(s.edges.length).fill(0),h=new Array(e+1).fill(0);for(let x=0;xr.extraH[x]>0&&r.selfLabelW[x]>0).map(x=>2+r.selfLabelW[x]),g=m[e]+o[e]+(f.length===0?0:Math.max(...f)),A=Array.from({length:e+1},(x,w)=>m[w]+o[w]),y=1;n.forEach((x,w)=>{let R=m[w];for(let N of x){let P=r.boxW[N],G=r.boxH[N],$=l[N],Q=Ab($,U0(G+r.extraH[N]));i[N]={x:R,y:Q,w:P,h:G,cx:R+U0(P),cy:Q+U0(G),rank:w},y=Math.max(y,Q+G+r.extraH[N])}});let b=new Array(s.edges.length).fill(0),S=aMn(s,t,i,!1),C=y,I=0;if(S.length>0){let{assigned:x,count:w}=yTe(S);for(let[R,N]of x)b[R]=N;C=y+1+w,I=y+1}return{canvasW:g,canvasH:C,bandEnd:A,edgeBus:d,laneBase:I,edgeLane:b}}function rat(t,e){let n=t.nodes.length;if(n===0)return null;let r=A$s(t),s=Math.max(...r,0),i=Array.from({length:s+1},()=>[]);for(let y=0;yZOn(y.label,hne,KOn)),a=y=>Math.max(1,y.length===0?1:Math.max(...y.map(Au))),c=e.map((y,b)=>y.kind==="frame"?Math.max(y.sub.w+2,Au(DI(t.nodes[b].label,hne))+4):y.kind==="compartments"?a(y.sections.flat())+2*MF+2:a(o[b])+2*MF+2),u=e.map((y,b)=>{if(y.kind==="frame")return y.sub.h+2;if(y.kind==="compartments"){let S=y.sections.filter(C=>C.length>0).length;return y.sections.reduce((C,I)=>C+I.length,0)+Ab(S,1)+2}return o[b].length+2}),l=new Array(n).fill(0),d=new Array(n).fill(0);for(let y of t.edges)y.from===y.to&&(l[y.from]=2,y.label!==null&&(d[y.from]=Math.max(d[y.from],Math.min(Au(y.label),mne))));for(let y=0;y0&&(c[y]=Math.max(c[y],7));let h={boxW:c,boxH:u,layW:c.map((y,b)=>y+(d[b]>0?2*(d[b]+3):0)),layH:u.map((y,b)=>y+l[b]),extraH:l,selfLabelW:d},m=Array.from({length:n},()=>({x:0,y:0,w:0,h:0,cx:0,cy:0,rank:0})),f=t.dir==="down"||t.dir==="up",g=f?S$s(r,s,i,h,t,m):C$s(r,s,i,h,t,m);if(g.canvasW*g.canvasH>g$s)return null;let A=new PF(g.canvasW,g.canvasH);for(let y=0;y{if(A.curStyle=y.line==="dotted"?Zot:y.line==="thick"?eat:tat,y.from===y.to){v$s(A,m[y.from],y);return}let S=m[y.from],C=m[y.to],I=C.rank===S.rank+1,x=g.bandEnd[S.rank]+g.edgeBus[b],w=g.laneBase+g.edgeLane[b];f?I?T$s(A,S,C,y,x):R$s(A,S,C,y,w):I?k$s(A,S,C,y,x):N$s(A,S,C,y,w)}),A.finalizeMask(),A}function sat(t,e){return e.dir==="up"?t.flipVertical():e.dir==="left"&&t.flipHorizontal(),t}function iat(t){let e=t.nodes.map(()=>({kind:"plain"})),n=rat(t,e);return n&&sat(n,t)}function oat(t,e){let n=t.nodes.map((s,i)=>{let o=[];return e[i].annotation!==null&&o.push(`\xAB${e[i].annotation}\xBB`),o.push(I$s(s.label)),{kind:"compartments",sections:[o,e[i].attrs,e[i].methods]}}),r=rat(t,n);return r&&sat(r,t)}function I$s(t){let e="",n=!1;for(let r of t)r==="~"?(e+=n?">":"<",n=!n):e+=r;return e}var cMn=t=>`n${t}`,ATe=t=>`g${t}`;function lMn(t){let e=new Map;t.groups.forEach((u,l)=>{let d=t.index.get(u.id);d!==void 0&&e.set(d,l)});let n=u=>{let l=[],d=u;for(;d!==null;)l.push(d),d=t.groups[d].parent;return l.reverse()},r=u=>{let l=e.get(u);return l===void 0?{key:cMn(u),chain:n(t.nodeGroup[u])}:{key:ATe(l),chain:n(t.groups[l].parent)}},s=new Map,i=new Array(t.groups.length).fill(!1);t.edges.forEach((u,l)=>{let d=r(u.from),h=r(u.to),m=0;for(;mm?ATe(d.chain[m]):d.key,A=h.chain.length>m?ATe(h.chain[m]):h.key;for(let b of[g,A])b.startsWith("g")&&(i[Number(b.slice(1))]=!0);let y=s.get(f);y?y.push([g,A,l]):s.set(f,[[g,A,l]])});let o=new Map;t.nodeGroup.forEach((u,l)=>{if(e.has(l))return;let d=o.get(u);d?d.push(l):o.set(u,[l])});let a=new Array(t.groups.length).fill(!1);for(let u=t.groups.length-1;u>=0;u--){let l=(o.get(u)??[]).length>0,d=t.groups.some((h,m)=>h.parent===u&&a[m]);a[u]=l||d||i[u]}let c=uMn(t,null,s,o,a);return c&&sat(c,t)}function uMn(t,e,n,r,s){let i=(r.get(e)??[]).map(cMn),o=t.groups.map((h,m)=>m).filter(h=>t.groups[h].parent===e&&s[h]);if(i.push(...o.map(ATe)),i.length===0)return new PF(1,1);let a=new Map,c=[],u=[];for(let h of i){a.set(h,c.length);let m=Number(h.slice(1));if(h.startsWith("n"))c.push({label:t.nodes[m].label,shape:t.nodes[m].shape}),u.push({kind:"plain"});else{let f=uMn(t,m,n,r,s);if(f===null)return null;c.push({label:t.groups[m].label,shape:"rect"}),u.push({kind:"frame",sub:f})}}let l=[];for(let[h,m,f]of n.get(e)??[]){let g=a.get(h),A=a.get(m);if(g===void 0||A===void 0)continue;let y=t.edges[f];l.push({from:g,to:A,label:y.label,headTo:y.headTo,headFrom:y.headFrom,line:y.line})}let d=new VT(t.dir);return d.nodes=c,d.edges=l,rat(d,u)}function EV(t,e,n,r){let{x:s,y:i,w:o,h:a}=e,c=s+o-1,u=i+a-1,l=r==="round"||r==="diamond";t.set(s,i,l?"\u256D":"\u250C","border"),t.set(c,i,l?"\u256E":"\u2510","border"),t.set(s,u,l?"\u2570":"\u2514","border"),t.set(c,u,l?"\u256F":"\u2518","border");for(let h=s+1;h{let f=DI(h,d),g=s+1+MF+U0(Ab(d,Au(f)));eMn(t,f,g,i+1+m,"text")})}function x$s(t,e,n){EV(t,e,[],"rect");let r=Math.max(1,Ab(e.w,2*MF+2)),s=e.y+1,i=!0;n.forEach((o,a)=>{if(o.length!==0){if(!i){t.set(e.x,s,"\u251C","border");for(let c=e.x+1;c=t.h)return;let[o,a,c,u]=n.line==="dotted"?["\u254E","\u254C","\u2570","\u256F"]:n.line==="thick"?["\u2503","\u2501","\u2517","\u251B"]:["\u2502","\u2500","\u2570","\u256F"];t.junction(s,r,ch),t.set(s,r+1,o,"edge"),t.set(s,r+2,c,"edge");for(let l=s+1;l=t.h)return;let s=DI(e,mne),i=r;for(let[o,a]of qT(s)){if(a===0)continue;if(i+a>t.w)break;let c=!1;for(let u=0;uMath.max(0,t-e),bV=t=>Math.floor(t/2);function dMn(t,e,n){if(e.kind==="over"){let s=bV(t[e.from]+t[e.to]),i=Math.max(t[e.to]-t[e.from]+5,n+2*aat+2);return{x:LF(s,bV(i)),w:i}}let r=n+2*aat+2;return e.kind==="left"?{x:LF(t[e.at],2+r-1),w:r}:{x:t[e.at]+2,w:r}}var pMn=t=>t===null?0:Au(t);function mMn(t){let e=t.labels.length,n=t.labels.map(f=>DI(f,hne)),r=n.map(f=>Math.max(1,Au(f))+2*aat+2),s=3,i=Array.from({length:LF(e,1)},(f,g)=>Math.max(D$s,Math.ceil(r[g]/2)+Math.ceil(r[g+1]/2)+1)),o=[];for(let f of t.items)if(f.kind==="message"){let g=pMn(f.text);f.from!==f.to?o.push([Math.min(f.from,f.to),Math.max(f.from,f.to),Math.max(g+2,4)]):f.from+10&&o.push([A.from-1,A.from,y]),A.from+10?o.push([A.at-1,A.at,g+7]):A.kind==="right"&&A.at+1f[1]-f[0]-(g[1]-g[0]));for(let[f,g,A]of o){let y=0;for(let b=f;bB$s)return null;let m=new PF(c,h);for(let f=0;f{if(f.kind!=="note")return;let A=dMn(a,f.anchor,Au(f.text));EV(m,hMn(A.x,u[g],A.w,3),[f.text],"rect")});for(let f of a)m.junction(f,s-1,ch),m.segV(f,s,d-1),m.junction(f,d,bg);return t.items.forEach((f,g)=>{let A=u[g];f.kind==="message"?O$s(m,f,a,A):f.kind==="divider"&&M$s(m,f.text,A,c)}),m.finalizeMask(),m}function P$s(t){return t.kind==="note"?4:t.kind==="divider"?2:t.from===t.to?4:t.text!==null?3:2}var hMn=(t,e,n,r)=>({x:t,y:e,w:n,h:r,cx:t+bV(n),cy:e+1,rank:0});function O$s(t,e,n,r){let s=e.dashed?"\u254C":"\u2500";if(e.from===e.to){let h=n[e.from];t.junction(h,r,hp),t.set(h+1,r,s,"edge"),t.set(h+2,r,s,"edge"),t.set(h+3,r,"\u256E","edge"),t.set(h+3,r+1,"\u2502","edge"),t.set(h+1,r+2,e.head==="cross"?"\xD7":"\u25C4","edge"),t.set(h+2,r+2,s,"edge"),t.set(h+3,r+2,"\u256F","edge"),e.text!==null&&OF(t,e.text,h+5,r+1,"text");return}let i=n[e.from],o=n[e.to],a=o>i,c=e.text!==null?r+1:r,u=Math.min(i,o),l=Math.max(i,o);t.junction(i,c,a?hp:by);for(let h=u+1;ht.split(/\s+/).filter(e=>e!=="")[0]??"",FF=t=>t.split(/\s+/).filter(e=>e!=="");function $0(t,e){let n=t.indexOf(e);return n===-1?null:[t.slice(0,n),t.slice(n+e.length)]}var QF=t=>t===""?null:t;function CV(t){let e=t[0];if(e===void 0)return null;let n=yne(e);return n===""?null:t1(n)}function CMn(t){let e=CV(SV(t));return e===null?null:e==="graph"||e==="flowchart"?"flowchart":e.startsWith("statediagram")?"state":e.startsWith("classdiagram")?"class":e==="erdiagram"?"er":e==="sequencediagram"?"sequence":null}function IMn(t){let e=SV(t),n=CV(e);if(n!=="graph"&&n!=="flowchart")return null;let r=new VT(gTe(FF(e[0])[1]??"TB")),s=[];for(let i of e.slice(1)){switch(t1(yne(i))){case"subgraph":{if(r.groups.length>=tMn||s.length>=nMn)return null;let[o,a]=F$s(i.slice(8).trim());r.groups.push({id:o,label:a,parent:s.at(-1)??null}),s.push(r.groups.length-1),r.curGroup=s.at(-1)??null;continue}case"end":s.pop(),r.curGroup=s.at(-1)??null;continue;case"classdef":case"class":case"style":case"linkstyle":case"click":case"direction":continue;default:break}if(Q$s(i,r),r.overCap)return null}return r.nodes.length===0?null:r}function F$s(t){if(t.startsWith('"')){let n=t.indexOf('"',1);if(n!==-1){let r=t.slice(1,n);return[r,gb(r)]}}let e=t.indexOf("[");if(e!==-1){let n=t.slice(0,e).trim(),r=HT(t.slice(e+1).replace(/\]+$/,"").trim());if(n!==""&&r!=="")return[n,r]}return[t,t]}function Q$s(t,e){let n=[...t],r=0,s=gMn(n,r,e);if(!s){e.warnings.push(`dropped, does not start with a node: "${t}"`);return}let i=s.group;for(r=s.next;r=_V(n,r),!(r>=n.length);){let o=$$s(n,r);if(!o){e.warnings.push(`dropped, expected a link: "${n.slice(r).join("")}"`);break}r=_V(n,o.next);let a=gMn(n,r,e);if(!a){e.warnings.push(`dropped, link has no target: "${t}"`);break}r=a.next;for(let c of i)for(let u of a.group){let l=o.left==="arrow"&&o.right!=="arrow";if(!e.pushEdge({from:l?u:c,to:l?c:u,label:o.label,headTo:l?"arrow":o.right,headFrom:l?o.right:o.left,line:o.line}))return}i=a.group}}function gMn(t,e,n){let r=AMn(t,e,n);if(!r)return null;let s=[r.index],i=r.next;for(;;){let o=_V(t,i);if(t[o]!=="&")break;let a=AMn(t,o+1,n);if(!a)return null;s.push(a.index),i=a.next}return{group:s,next:i}}function _V(t,e){for(;e"?YT(t,e+1,"]","rect"):{shape:"rect",label:null,after:e}}function YT(t,e,n,r){let s=e;for(;t[s]===" "||t[s]===" ";)s++;let i=t[s]==='"',o=e,a="",c=!1;for(;ot==="-"||t==="."||t==="="||t==="<"||t===">";function $$s(t,e){let n=_V(t,e),r="none";(t[n]==="o"||t[n]==="x")&&(t[n+1]==="-"||t[n+1]==="."||t[n+1]==="=")&&(r=t[n]==="o"?"circle":"cross",n++);let s=n;for(;n")?"arrow":"none";if(a==="none"){let c=EMn(t,n);c&&(a=c.head,n=c.next)}if(t[n]==="|"){n++;let c=n;for(;nc&&t[u]!=="<"){let l=t.slice(c,u).join(""),d=u;for(;u"))a="arrow";else{let m=EMn(t,u);m&&(a=m.head,u=m.next)}return o==="solid"&&(o=yMn(h)),{left:r,right:a,line:o,label:QF(HT(l)),next:u}}}return{left:r,right:a,line:o,label:null,next:n}}function yMn(t){return t.includes("=")?"thick":t.includes(".")?"dotted":"solid"}function EMn(t,e){let n=t[e]==="o"?"circle":t[e]==="x"?"cross":null;if(n===null)return null;let r=t[e+1];return r===void 0||r===" "||r===" "||r==="|"||r==="&"||r===";"?{head:n,next:e+1}:null}function xMn(t){let e=SV(t),n=CV(e);if(n===null||!n.startsWith("statediagram"))return null;let r=new VT,s=!1;for(let i of e.slice(1)){if(s){t1(i)==="end note"&&(s=!1);continue}let o=t1(yne(i));if(o==="direction")r.dir=gTe(FF(i)[1]??"");else if(o==="note")i.includes(":")||(s=!0);else if(o==="state"){if(G$s(i,r)===null)return null}else if(!["classdef","class","hide","scale","}","--"].includes(o)){if(i.includes("-->")){if(W$s(i,r)===null)return null}else if(q$s(i,r)===null)return null}if(r.overCap)return null}return r.nodes.length===0?null:r}function G$s(t,e){let n=t.slice(5).trim().replace(/\{$/,"").trim();if(n==="")return!0;if(n.startsWith('"')){let a=n.indexOf('"',1);if(a===-1)return null;let c=n.slice(1,a),u=n.slice(a+1).trim(),l=u.startsWith("as")?u.slice(2).trim():c;return e.nodeLabel(l,gb(c))===null?null:!0}let r="round",s=n,i=!1,o=n.indexOf("<<");return o!==-1&&(n.slice(o+2).replace(/>>$/,"").trim()==="choice"&&(r="diamond"),s=n.slice(0,o).trim(),i=!0),s===""||/\s/.test(s)||e.nodeIndex(s,i?s:null,r)===null?null:!0}function W$s(t,e){let n=t,r=null;for(;;){let s=$0(n,"-->");if(!s)break;let[i,o]=s,a=i.trimEnd().replace(/-+$/,"").trim(),c;if(r!==null){if(a!=="")return null;c=r}else{if(a==="")return null;let y=bMn(e,a,!0);if(y===null)return null;c=y}let u=o.indexOf("-->"),l=u===-1?o:o.slice(0,u),d=u===-1?"":o.slice(u),h=$0(l,":"),m=h?h[0]:l,f=h?QF(gb(h[1].trim())):null,g=m.trimStart().replace(/^>+/,"").trimEnd().replace(/-+$/,"").trim();if(g==="")return null;let A=bMn(e,g,!1);if(A===null)return null;if(!e.pushEdge({from:c,to:A,label:f,headTo:"arrow",headFrom:"none",line:"solid"}))return!0;r=A,n=d}return!0}function bMn(t,e,n){return e==="[*]"?t.nodeIndex(n?"[*]start":"[*]end","\u25CF","round"):t.nodeIndex(e,null,"round")}function q$s(t,e){let n=$0(t,":");if(n){let r=n[0].trim(),s=n[1].trim();return r===""||/\s/.test(r)||s===""||e.nodeLabel(r,gb(s))===null?null:!0}return/\s/.test(t)||e.nodeIndex(t,null,"round")===null?null:!0}var H$s=[["<|--","triangle","none","solid"],["--|>","none","triangle","solid"],["<|..","triangle","none","dotted"],["..|>","none","triangle","dotted"],["*--","diamondFill","none","solid"],["--*","none","diamondFill","solid"],["o--","diamondOpen","none","solid"],["--o","none","diamondOpen","solid"],["<--","arrow","none","solid"],["-->","none","arrow","solid"],["<..","arrow","none","dotted"],["..>","none","arrow","dotted"],["--","none","none","solid"],["..","none","none","dotted"]],V$s=4;function wMn(t){let e=SV(t),n=CV(e);if(n===null||!n.startsWith("classdiagram"))return null;let r=new VT,s=[],i=()=>{for(;s.length{let u=r.nodeIndex(c,null,"rect");return i(),u},a=null;for(let c of e.slice(1)){if(a!==null){c==="}"?a=null:_Mn(s[a],c);continue}let u=t1(yne(c));if(u==="direction"){r.dir=gTe(FF(c)[1]??"");continue}if(["note","callback","click","link","style","cssclass","classdef","namespace","}"].includes(u))continue;if(u==="class"){let h=c.slice(5).trim(),m=h.endsWith("{"),f=m?h.slice(0,-1).trim():h;if(f===""||/\s/.test(f))return null;let g=o(f);if(g===null)return null;m&&(a=g);continue}if(c.startsWith("<<")){let h=$0(c.slice(2),">>");if(!h)return null;let m=h[1].trim();if(m===""||/\s/.test(m))return null;let f=o(m);if(f===null)return null;s[f].annotation=h[0].trim();continue}let l=j$s(c);if(l){let h=o(l.from);if(h===null)return null;let m=o(l.to);if(m===null||r.edges.length>=n1)return null;r.edges.push({from:h,to:m,label:l.label,headTo:l.headTo,headFrom:l.headFrom,line:l.line});continue}let d=$0(c,":");if(d){let h=d[0].trim(),m=d[1].trim();if(h===""||/\s/.test(h)||m==="")return null;let f=o(h);if(f===null)return null;_Mn(s[f],m);continue}return null}return r.nodes.length===0?null:(i(),{graph:r,infos:s})}function _Mn(t,e){if(e.startsWith("<<")){let s=$0(e.slice(2),">>");s&&(t.annotation=s[0].trim());return}let n=gb(z$s(e.trim())),r=n.includes("(")?t.methods:t.attrs;r.length0&&mTe(e[m-1]))continue;let S=e[m+[...g].length];if(!(g.endsWith("o")&&S!==void 0&&mTe(S))){n={pos:m,op:g,headFrom:A,headTo:y,line:b};break e}}}if(!n)return null;let r=e.slice(0,n.pos).join("").trim(),s=e.slice(n.pos+[...n.op].length).join("").trim(),[i,o]=Y$s(r),[a,c]=K$s(s),u=$0(a,":"),l=(u?u[0]:a).trim(),d=u?QF(gb(u[1].trim())):null;if(i===""||l===""||/\s/.test(i)||/\s/.test(l))return null;let h=QF([o,d??"",c].filter(m=>m!=="").join(" "));return{from:i,to:l,headFrom:n.headFrom,headTo:n.headTo,line:n.line,label:h}}function Y$s(t){let e=t.trimEnd();if(e.endsWith('"')){let n=e.slice(0,-1),r=n.lastIndexOf('"');if(r!==-1)return[n.slice(0,r).trimEnd(),n.slice(r+1)]}return[e,""]}function K$s(t){let e=t.trimStart();if(e.startsWith('"')){let n=e.slice(1),r=n.indexOf('"');if(r!==-1)return[n.slice(r+1).trimStart(),n.slice(0,r)]}return[e,""]}function z$s(t){let e="",n=!1;for(let r of t)r==="~"?(e+=n?">":"<",n=!n):e+=r;return e}function TMn(t){let e=SV(t);if(CV(e)!=="erdiagram")return null;let n=new VT,r=[],s=null;for(let i of e.slice(1)){if(s!==null){i==="}"?s=null:Z$s(r[s],i);continue}let o=J$s(i);if(o){let l=FF(o.rel);if(l.length!==3)return null;let d=vMn(l[1]);if(!d)return null;let h=lat(n,r,l[0]);if(h===null)return null;let m=lat(n,r,l[2]);if(m===null||n.edges.length>=n1)return null;let f=o.label===null?"":HT(o.label);n.edges.push({from:h,to:m,label:QF([d.cardL,f,d.cardR].filter(g=>g!=="").join(" ")),headTo:"none",headFrom:"none",line:d.line});continue}let a=i.endsWith("{"),c=a?i.slice(0,-1).trim():i;if(c===""||FF(c).length!==1)return null;let u=lat(n,r,c);if(u===null)return null;a&&(s=u)}if(n.nodes.length===0)return null;for(;r.lengthvMn(s)!==null)?{rel:n,label:r}:null}var X$s=t=>{for(let e=0;e127)return!1;return!0};function vMn(t){if(t.length!==6||!X$s(t))return null;let e=t.slice(2,4),n=e==="--"?"solid":e===".."?"dotted":null;if(n===null)return null;let r=SMn(t.slice(0,2)),s=SMn(t.slice(4,6));return r===null||s===null?null:{cardL:r,cardR:s,line:n}}function SMn(t){switch(t){case"|o":case"o|":return"0..1";case"||":return"1";case"}o":case"o{":return"0..*";case"}|":case"|{":return"1..*";default:return null}}function Z$s(t,e){let n=[];for(let s of FF(e)){if(s.startsWith('"'))break;n.push(s)}if(n.length===0)return;let r=gb(n.join(" "));t.attrs.length>",!0,"arrow"],["->>",!1,"arrow"],["--x",!0,"cross"],["-x",!1,"cross"],["--)",!0,"arrow"],["-)",!1,"arrow"],["-->",!0,"arrow"],["->",!1,"arrow"]],tGs=4,uat=class{labels=[];index=new Map;items=[];participant(e,n){let r=this.index.get(e);return r!==void 0?(n!==null&&(this.labels[r]=n),r):this.labels.length>=nat?null:(this.index.set(e,this.labels.length),this.labels.push(n??e),this.labels.length-1)}};function RMn(t){let e=SV(t);if(CV(e)!=="sequencediagram")return null;let n=new uat,r=!1,s=0,i=[];for(let o of e.slice(1)){let a=yne(o),c=t1(a);if(c==="participant"||c==="actor"){let d=o.slice(a.length).trim();if(d==="")return null;let h=$0(d," as ");if(n.participant(h?h[0].trim():d,h?HT(h[1]):null)===null)return null;continue}if(c==="autonumber"){r=!0;continue}if(["activate","deactivate","create","destroy","title","acctitle","accdescr","links","link","properties"].includes(c))continue;if(c==="note"){let d=nGs(o.slice(a.length).trim(),n);if(!d||n.items.length>=n1)return null;n.items.push({kind:"note",anchor:d.anchor,text:d.text});continue}if(["loop","alt","opt","par","critical","break","else","and","option"].includes(c)){if(["else","and","option"].includes(c)){if(i.at(-1)!==!0)continue}else i.push(!0);if(n.items.length>=n1)return null;n.items.push({kind:"divider",text:gb(o)});continue}if(c==="rect"||c==="box"){i.push(!1);continue}if(c==="end"){if(i.pop()===!0){if(n.items.length>=n1)return null;n.items.push({kind:"divider",text:"end"})}continue}let u=rGs(o,n);if(!u)return null;let l=u.text;if(r&&(s++,l=l===null?`${s}.`:`${s}. ${l}`),n.items.length>=n1)return null;n.items.push({kind:"message",from:u.from,to:u.to,text:l,dashed:u.dashed,head:u.head})}return n.labels.length===0?null:n}function nGs(t,e){let n=t1(t),r,s;if(n.startsWith("over "))r="over",s=t.slice(5);else if(n.startsWith("left of "))r="left",s=t.slice(8);else if(n.startsWith("right of "))r="right",s=t.slice(9);else return null;let i=$0(s,":");if(!i)return null;let o=gb(i[1].trim()),a=i[0].split(",").map(l=>l.trim()).filter(l=>l!=="");if(a.length===0)return null;let c=e.participant(a[0],null);if(c===null)return null;if(r!=="over")return{text:o,anchor:{kind:r,at:c}};let u=c;if(a[1]!==void 0){let l=e.participant(a[1],null);if(l===null)return null;u=l}return{text:o,anchor:{kind:"over",from:Math.min(c,u),to:Math.max(c,u)}}}function rGs(t,e){let n=[...t],r=null;e:for(let d=0;dn===null?null:{canvas:n,warnings:[]};switch(CMn(t)){case"flowchart":{let n=IMn(t);if(n===null)return null;let r=n.groups.length===0?iat(n):lMn(n);return r===null?null:{canvas:r,warnings:n.warnings}}case"state":{let n=xMn(t);return n===null?null:e(iat(n))}case"class":{let n=wMn(t);return n===null?null:e(oat(n.graph,n.infos))}case"er":{let n=TMn(t);return n===null?null:e(oat(n.graph,n.infos))}case"sequence":{let n=RMn(t);return n===null?null:e(mMn(n))}default:return null}}var iGs=new vM;function oGs(t){return t.type==="code"&&t.lang?.trim().split(/\s+/,1)[0]?.toLowerCase()==="mermaid"}function DMn(t){let e=t||"\xA0",n=Math.max(0,...Array.from(e.matchAll(/`+/g),i=>i[0].length)),r="`".repeat(n+1),s=e.startsWith("`")||e.endsWith("`")?" ":"";return`${r}${s}${e}${s}${r}`}function aGs(t,e){switch(t.cls){case"border":return e.fg("borderMuted",t.text);case"text":return e.fg("text",t.text);case"edge":return e.fg("accent",t.text);case"edgeLabel":return e.fg("muted",t.text);case"title":return e.fg("accent",e.bold(t.text));case"none":return t.text}}function cGs(t,e){return t.styled.map(n=>n.map(r=>aGs(r,e)).join(""))}function BMn(t){return(e,n)=>{let r=t.getMode();return r==="off"||n.messageType==="assistant-thinking"||n.isStreaming&&r!=="streaming"?e:iGs.lexer(e).map(s=>{if(!oGs(s))return s.raw;let i=NMn(s.text);if(!i||i.width>n.availableWidth)return s.raw;if(!n.isStreaming&&i.warnings.length>0){let a=i.warnings.length>1?` (+${i.warnings.length-1} more)`:"",c=`Mermaid diagram not rendered: ${i.warnings[0]}${a}`,u=t.theme?t.theme.fg("warning",c):c;return`${s.raw} -${DMn(u)} -`}return`${(t.theme?cGs(i,t.theme):i.plain).map(DMn).join(` +`;e.addChild(new Pl(i+this.message.summary,0,0,this.markdownTheme,{color:s=>Ee.fg("customMessageText",s)}))}else e.addChild(new Et(Ee.fg("customMessageText",`Compacted from ${n} tokens (`)+Ee.fg("dim",Ca("app.tools.expand"))+Ee.fg("customMessageText"," to expand)"),0,0));this.addChild(new vA(e,i=>{if(!(i.type!=="click"||i.button!=="left"))return this.setExpanded(!this.expanded),{handled:!0}}))}}});var nG,mbt=v(()=>{p();Tr();nG=class extends ID{keybindings;workingStatusIndicator;embedWorkingStatus;actionHandlers=new Map;onEscape;onCtrlD;onPasteImage;onExtensionShortcut;constructor(e,n,r,i){super(e,n,i),this.keybindings=r,this.embedWorkingStatus=i?.embedWorkingStatus??!1}setWorkingStatusIndicator(e){this.workingStatusIndicator=e}renderTopBorder(e,n){if(!this.embedWorkingStatus||!this.workingStatusIndicator||e<=0)return super.renderTopBorder(e,n);let r=this.workingStatusIndicator.renderInBorder(Math.max(1,e-5)),i=rn(r);if(i===0)return super.renderTopBorder(e,n);let s=n>0?` \u2191 ${n} more `:void 0,o=s?rn(s):0,a=Math.floor((e-o)/2),c=()=>s!==void 0&&o+2<=e&&a-(3+i+1)>=1;if(s&&!c()&&(r=this.workingStatusIndicator.renderSpinnerInBorder(e),i=rn(r)),c()){let l=3+i+1;return this.borderColor("\u2500\u2500 ")+r+this.borderColor(` ${"\u2500".repeat(a-l)}${s}${"\u2500".repeat(e-a-o)}`)}if(e>=i+5)return this.borderColor("\u2500\u2500 ")+r+this.borderColor(` ${"\u2500".repeat(e-i-4)}`);r=this.workingStatusIndicator.renderSpinnerInBorder(e),i=rn(r);let u=Math.min(3,Math.max(0,e-i));return this.borderColor("\u2500".repeat(u))+r+this.borderColor("\u2500".repeat(Math.max(0,e-u-i)))}onAction(e,n){this.actionHandlers.set(e,n)}handleInput(e){if(!this.onExtensionShortcut?.(e)){if(this.keybindings.matches(e,"app.clipboard.pasteImage")){this.onPasteImage?.();return}if(this.keybindings.matches(e,"app.interrupt")){if(!this.isShowingAutocomplete()){let n=this.onEscape??this.actionHandlers.get("app.interrupt");if(n){n();return}}super.handleInput(e);return}if(this.keybindings.matches(e,"app.exit")&&this.getText().length===0){let n=this.onCtrlD??this.actionHandlers.get("app.exit");n&&n();return}if(this.keybindings.matches(e,"tui.editor.historyPrevious")||this.keybindings.matches(e,"tui.editor.historyNext")){super.handleInput(e);return}for(let[n,r]of this.actionHandlers)if(n!=="app.interrupt"&&n!=="app.exit"&&this.keybindings.matches(e,n)){r();return}super.handleInput(e)}}}});var wPe,Zir=v(()=>{p();Tr();pi();wPe=class extends gn{entry;renderer;customComponent;_expanded=!1;constructor(e,n){super(),this.entry=e,this.renderer=n,this.rebuild()}hasContent(){return this.customComponent!==void 0}setExpanded(e){this._expanded!==e&&(this._expanded=e,this.rebuild())}invalidate(){super.invalidate(),this.rebuild()}rebuild(){this.clear(),this.customComponent=void 0;let e;try{e=this.renderer(this.entry,{expanded:this._expanded},Ee)}catch(n){let r=n instanceof Error?n.message:String(n),i=new Ou(1,1,s=>Ee.bg("customMessageBg",s));i.addChild(new Et(Ee.fg("error",`[${this.entry.customType}] renderer failed: ${r}`),0,0)),e=i}e&&(this.customComponent=e,this.addChild(new Tt(1)),this.addChild(e))}}});var tM,hbt=v(()=>{p();Tr();pi();tM=class extends gn{message;customRenderer;box;customComponent;markdownTheme;_expanded=!1;outputPad;constructor(e,n,r=zh(),i=1){super(),this.message=e,this.customRenderer=n,this.markdownTheme=r,this.outputPad=i,this.addChild(new Tt(1)),this.box=new Ou(1,1,s=>Ee.bg("customMessageBg",s)),this.rebuild()}setExpanded(e){this._expanded!==e&&(this._expanded=e,this.rebuild())}setOutputPad(e){this.outputPad!==e&&(this.outputPad=e,this.rebuild())}invalidate(){super.invalidate(),this.rebuild()}rebuild(){if(this.customComponent&&(this.removeChild(this.customComponent),this.customComponent=void 0),this.removeChild(this.box),this.customRenderer)try{let r=this.customRenderer(this.message,{expanded:this._expanded,outputPad:this.outputPad},Ee);if(r){this.customComponent=r,this.addChild(r);return}}catch{}this.addChild(this.box),this.box.clear();let e=Ee.fg("customMessageLabel",`\x1B[1m[${this.message.customType}]\x1B[22m`);this.box.addChild(new Et(e,0,0)),this.box.addChild(new Tt(1));let n;typeof this.message.content=="string"?n=this.message.content:n=this.message.content.filter(r=>r.type==="text").map(r=>r.text).join(` +`),this.box.addChild(new Pl(n,0,0,this.markdownTheme,{color:r=>Ee.fg("customMessageText",r)}))}}});function Ygs(){let t=[];for(let e=0;e{p();pi();fbt="bbbab8b9b9b6b9b8b5bcbbb8b8b7b4b7b5b2b6b5b2b8b7b4b7b6b3b6b4b1bdbcb8bab8b6bbb8b5b8b5b1bbb8b4c2bebbc1bebac0bdbabfbcb9c1bebabfbebbc0bfbcc0bdbabbb8b5c1bfbcbfbcb8bbb9b6bfbcb8c2bfbcc1bfbcbfbbb8bdb9b6b8b7b5b9b8b5b8b8b5b5b5b2b6b5b2b8b7b4b9b8b5b9b8b5b6b5b3bab8b5bcbab7bbb9b6bbb8b5bfb9b5bdb2abbcb0a8beb2aabeb5afbfbab6bebab7c0bfbcbebdbabebbb8c0bdbabfbebbc2bebbbdbab7c3c0bdc3c0bdc1bebbc2bebabfbcb8bab9b6b7b6b3b2b1aeb6b5b2b5b4b1b5b4b2b6b5b2b7b6b4b9b8b6b7b6b3bbbab7b2afaba5988fb49e90b09481b79a88b39683b09583b7a395bfb6b0c0bdbabdbbb8bebcb9c1bfbcc0bebbbdbab7bebbb8c2bfbcc0bdbac0bcb9bdb9b6c0bcb8b5b4b2b4b3b0bab9b6b9b9b6b5b4b1b5b4b1b6b5b3b9b8b5b9b8b6b9b8b6b2aeaa968174a6836eaa856eab846eaf8973ac8973b08f79b18f7ab39786b7a89dbbb3aebfbab6c2c0bdbebcb9bfbdbac3c1bdc2bebbc0bcb9bdb9b6c1bdbabfbbb8b4b3b0b9b8b5b8b7b5b4b3b1b5b4b1b8b7b4b8b7b5bab9b6bbbab7b1afad8c7a719d735ca47860a87d65a98069ae8972ae8c75af8d77aa826ba98067aa8974b39e90b6a79dbbb2adc0bdbac1bfbdbfbbb8c1bdb9bebab6c0bdb9bfbbb8c1bdbab4b2b0b7b6b4b7b6b3b4b2b0bab9b7b6b5b2b6b5b2bab9b6bab9b6958c87977663aa836bac8772b08f7aad8c77b2917db0917db0907cac8971a77d64a87f67ac8972b29887b8a89dbfbab5bfbdbac1bebac0bcb9c0bcb9c0bcb9c1bebabebab7b8b7b4b7b6b4b5b4b1b5b4b2b7b6b3b5b4b2bab9b7bab9b6b4b1ada88f7fad8973ae8d78b19684b19685b29786b69a89b29582b1917daa856ea87e66a97e66ad866ea9826baf9280b8ada6bdbbb8bebab7bfbbb8c1bdbabfbbb8bcb8b4bcb8b5b6b4b2b7b5b3b6b5b2b8b7b4b3b2afb8b7b4b6b5b2b3b2b0b3a59aab856fad8d78b0917eb19886b49b8bb49a89b39785b0917eaf8f7cab866fa77d65a77a61a87d64a9816ab08f79b5a296c1bcb8c3bfbcc2bebbbebab7bfbbb7bdbab6c2bebab8b7b4b7b6b4b6b5b3b7b6b3b6b5b2b9b8b6b4b3b1b6b1acac8f7ca9826bae8f7aaf9583b49c8cb49c8bb79d8cb59987b19380ad8e79ae8c77af8e78ac8771a3775faa826bae8972b39888bbb6b2bebbb8bfbbb8bfbbb8c0bdb9bebbb7c0bdb9b6b5b2b9b8b5b4b3b1b8b7b5b4b3b0b7b6b4b6b5b3b1a7a0aa8772a77d65a88570b49887b19b8d9c887c907a6d987f71aa907faf917daf8e7aad8c78ac8b77a8836ca9836cac8770b49b8abdb6b2c0bcb9c0bdb9bfbbb8bebab7bfbcb9bebab7b9b8b6b5b4b2b9b8b5b8b7b5b8b7b4b7b6b4b5b4b2b3a9a2ad8973a1755da9856fb398858c776a65544b776358725d526e594d9c7f6eb1907ba68672ad8e7aab8771ac856db18f79b3a092beb9b5c1bdbabdb9b5bebab7bfbbb7bebab7bcb9b6b7b6b4b6b6b3b8b7b4b5b4b2b8b6b4b7b6b3b4b3b0b4aba4a6826ba3775fb08e79b19584a88e7daa8e7db29481ad8f7c997e6da38674ac8d79ac8e7aae917f9a7c6a896a599a7c6ab3a398c1bdbabdb9b6bcb8b5bebab6bebab7bdb9b5bdb9b6b5b4b1b7b5b3b5b4b2b7b6b3b7b6b4b3b3b0b3b2b0b4aca5a7846fa97f68ae8f7bae9383b59c8bb2937fae8e79ac8b76af927eaf927eb29683b39885b2988891786a72594c6e594d978d86bdbab7bab7b3c0bcb9c0bcb9bebab7bebbb7bdb9b6b3b2b0b4b3b0b5b4b2b4b4b1b4b3b1b4b3b1b4b3b0b6ada5aa8670a57a62ad8e7ab29b8cb69d8dab856fa9826aa88069ab8771af907db49987b19684b29886b59987b39480b09787b5a9a1bcb8b5bebab7bdb9b5bebab7bfbbb8bfbbb7bbb7b4b3b2afb8b7b5b8b7b5b3b2b0b5b4b2b6b5b3b6b4b1afa299a98975a9826baf907cb39988b49a89af8e7aac8973aa856eaf8c74b1917dae907dac907db39988b29785b49785b7a090b9aca3bfbab7bcb8b5bdb9b6bcb8b4bcb8b5bdb9b5bcb8b4b5b4b2b6b5b3b4b3b0b4b3b0b9b8b5b8b6b4908b88887467aa8f7ea78976ad8973b08b74b59885b69e8eb29888b1917cb1917db1937fae907cb19686b39a8ab29886b59b8ab8a192b6aaa3b7b2afbcb8b4bcb8b5bbb7b4c0bcb9bebab7c0bcb9b6b5b2b6b5b3b4b3b0bab9b7b7b6b4b1b0ae7b716ba083709b806f716158967764b08870b29481b69b8ab69f8fb39a89b69f90b49d8db39a89b29988b49c8cb6a090b8a496baa49593867f8f8986bfbbb7bdb9b5bcb7b4bab6b3b9b5b2bab6b2b4b3b1b3b3b0b6b5b3b8b7b5b4b2b0a7a5a38f837dae917ea084725a504c63544da28370b39784b59e8db2a093a698909b918b998e8790857e95877dad998bb39c8cb5a091b9a2938d827c95908dbebab6bbb7b3bdbab7bbb7b4bdb9b6bbb7b4b4b3b0b5b4b1b8b7b5b6b5b3b8b8b5b4b2af968f8ab29a8bab9485544b483a323073655d96887f70655f61595547403e453e3c453f3d57504f655e5b90847db39c8db7a090b6a09189807aaba6a3bdb9b6c0bcb9bebab7bcb7b4bebab7bbb7b4b3b2b0b6b5b3b2b1afb7b6b4b8b7b4b5b4b1aeaba8b5a89fac998d4d44412d25244d46444e4744322b293a3230423937433a37352d2a59504c534b48524a48988a81b59f8fb19c8d827974b2afacbdb9b5bcb8b4bdb9b5bcb8b5bdb9b6bab6b2b8b7b5b5b4b2b6b6b3b9b8b5b7b6b3b6b5b2b8b6b3b9b4b1b2a9a26c64612d25242d2625312a28352d2c453d3a78675c8d7a6ea09792aea6a0615854332b29524a479f8e82b09d90a49b96c1bdb9bebab7bfbbb8bbb8b4b9b5b1b8b4b0b9b4b0b7b6b4b8b7b5b8b7b4b6b5b3b8b6b3bab9b6b9b8b5b4b3b0b7b5b2a5a29f453d3b261e1d261f1e2e2625413936857268977865b19482b5a69caca5a07c7572453d3b746963a0948cc5bfbbc0bbb8beb9b6bbb7b3bbb6b3b7b3afb8b4b0b9b5b1b7b6b3b6b5b3b5b4b2b5b4b2b7b6b3b7b6b3b8b6b3b4b2afb7b6b3b3b1ae6d6765251f1e1e18172a22212d2523443b3971625ab19888b09482a89182877e792c25243e3634766d6abeb9b5bfbbb7bebab6bcb7b3bbb6b3b9b5b1b7b3afb8b4b0b4b3b0b5b4b1b5b4b1b4b3b1b5b4b2b8b6b4b5b3b0b9b6b4b5b4b1b6b4b27f79762a2322221c1b2d2524221b1a443e3c47413f6f676281766f867971675e5a3e37352a222166605dbab7b3bdb9b5beb9b5bcb7b3bcb7b3b9b4b0bab6b2bab6b2b5b3b0b6b4b2b3b2afb7b6b3b4b4b1b4b3b0b6b4b1b5b4b1b4b3b0b9b6b29a8c8252474230292828201f181212322c2c231e1d1c16162c26252923222d26252d2523332b2a8e8885bcb8b5bcb7b3bbb6b2bcb7b3b9b4b1b9b5b1b7b2afb7b2ae7a838e9b9b9caeadacb3b2b0b3b2afb7b7b4b6b5b3b6b6b3b7b6b3b9ada4a991808e7b6f50453f2b24231a14142923221f19181d17161f18182620201d17162a22215d5654b7b3b0bbb7b3bbb6b2b8b4b0bab5b1bbb6b2bab5b1b8b4b0bab6b22c496b4c5d735f68766e727a828285929090adaba8b7b2aeb6a59ab39682a28470a387748e76674e403a1a14141d1716181211221c1c1f1918221c1b2f2827342d2c8d8884bab6b3b9b5b2bab5b1bab5b1b9b4b0bab6b2b8b4b0b9b4b0b7b2ae325e8b365f8a3a5d833f5b7a545f70646469706b6aa08f84b08e78b18e769f7e689e7f6b9e816d907766584940362d2a1c1615201b1a1a1413201a1a251e1d393331a39e9bbab5b1bcb7b3bab6b2b8b3afb8b4b0b9b4b0b9b4b1bab5b2b5b0ac3d6c9843729d44719c426e98415f805a64716f6a699d8677b1927eb3947faa89749d7a649f7f6ba487749e837186716454463f2c25231e181837302e3a33317a7471beb9b6bcb8b4bbb6b2b6b2aebab5b1b9b5b1b8b3afbab6b2b6b1adb5aeaa4877a14c7aa44e7ba345719a3a5d80586b7f767475927b6eb1927faf8e79b08e78a78169a07861a17f6aa58570a688749b83738270666f66618a8480a49e99b7b2aebab6b2bcb8b4b9b5b1b7b2aebab5b1b9b4b0b6b1aeb6b1adb2aca8b2aca84876a04a78a2517fa74771973a5d80405c7a6161677c695fac8a75b08d77b4917aaf8971ad876fa5816aa6846ea78670a98a76ac9484ab9f96b2aca8bdb8b4bcb7b3bcb8b4bcb8b4b8b3afb7b2aeb9b4b0b8b3afb8b2aeb6afabb3aeaab2aeaa4878a14b7aa34c7ba44a759b3d63873b5f825b67766f5f569c7e6caf8c77b18f79b28f78b5927caf8e78a98872aa8a76a98a76ac917fada199b7b0acb9b3afbfb9b5c1bab6bdb6b2b8b3afbab5b1b9b4b0b6afabb7b1adb3ada9b3aeaab0aba8",Kae=32,esr=32;tsr="\x1B[0m";Jae=class{ui;image;interval=null;tick=0;maxTicks=25;cachedLines=[];cachedWidth=0;cachedTick=-1;constructor(e){this.ui=e,this.image=zgs(),this.startAnimation()}invalidate(){this.cachedWidth=0}startAnimation(){this.interval=setInterval(()=>{this.tick++,this.tick>=this.maxTicks&&this.stopAnimation(),this.cachedWidth=0,this.ui.requestRender()},80)}stopAnimation(){this.interval&&(clearInterval(this.interval),this.interval=null)}render(e){if(e===this.cachedWidth&&this.cachedTick===this.tick)return this.cachedLines;let n=Ee,r=[],i=a=>{let c=a.replace(/\x1b\[[0-9;]*m/g,"").length,u=Math.max(0,Math.floor((e-c)/2));return" ".repeat(u)+a};r.push("");let s=Math.min(this.image.length,Math.floor(this.tick/this.maxTicks*(this.image.length+3)));for(let a=0;a0||this.tick>=this.maxTicks?(r.push(i(n.fg("accent","Free Kimi K2.5 via OpenCode Zen"))),r.push(i(n.fg("success",'"Powered by daxnuts"'))),r.push(i(n.fg("muted","\u2014 @thdxr")))):(r.push(""),r.push(""),r.push("")),r.push(""),o>2||this.tick>=this.maxTicks?(r.push(i(n.fg("dim","Try OpenCode"))),r.push(i(n.fg("mdLink","https://mistral.ai/news/mistral-vibe-2-0")))):(r.push(""),r.push("")),r.push(""),this.cachedLines=r,this.cachedWidth=e,this.cachedTick=this.tick,r}dispose(){this.stopAnimation()}}});function Jgs(){if(nsr)return TPe;nsr=!0;try{TPe=rsr.readFileSync(KRn(isr)).toString("base64")}catch{TPe=void 0}return TPe}var rsr,Kgs,isr,TPe,nsr,vPe,ssr=v(()=>{p();rsr=Ot(require("node:fs"),1);Tr();Qs();pi();Ll();Kgs="https://mariozechner.at/posts/2026-04-08-ive-sold-out/",isr="clankolas.png",nsr=!1;vPe=class extends gn{constructor(){super(),this.addChild(new Un(n=>Ee.fg("accent",n))),this.addChild(new Et(Ee.bold(Ee.fg("accent","pi has joined Earendil")),1,0)),this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("muted","Read the blog post:"),1,0)),this.addChild(new Et(Ee.fg("mdLink",Kgs),1,0)),this.addChild(new Tt(1));let e=Jgs();e&&(this.addChild(new wD(e,"image/png",{fallbackColor:n=>Ee.fg("muted",n)},{maxWidthCells:56,filename:isr})),this.addChild(new Tt(1))),this.addChild(new Un(n=>Ee.fg("accent",n)))}}});function Xgs(t){return t.replace(/[\r\n\t]/g," ").replace(/ +/g," ").trim()}function Xw(t){return t<1e3?t.toString():t<1e4?`${(t/1e3).toFixed(1)}k`:t<1e6?`${Math.round(t/1e3)}k`:t<1e7?`${(t/1e6).toFixed(1)}M`:`${Math.round(t/1e6)}M`}function Zgs(t,e){if(!e)return t;let n=(0,Zw.resolve)(t),r=(0,Zw.resolve)(e),i=(0,Zw.relative)(r,n);return i===""||i!==".."&&!i.startsWith(`..${Zw.sep}`)&&!(0,Zw.isAbsolute)(i)?i===""?"~":`~${Zw.sep}${i}`:t}var Zw,rG,ybt=v(()=>{p();Zw=require("node:path");Tr();_0t();Q1e();pi();rG=class{autoCompactEnabled=!0;session;footerData;constructor(e,n){this.session=e,this.footerData=n}setSession(e){this.session=e}setAutoCompactEnabled(e){this.autoCompactEnabled=e}invalidate(){}dispose(){}render(e){let n=this.session.state,r=zse(),i;for(let Y of this.session.sessionManager.getEntries())if(Y.type==="usage")xS(r,Y.usage);else if(Y.type==="message"&&Y.message.role==="assistant"){xS(r,Y.message.usage);let z=Y.message.usage.input+Y.message.usage.cacheRead+Y.message.usage.cacheWrite;i=z>0?Y.message.usage.cacheRead/z*100:void 0}else Y.type==="message"&&Y.message.role==="toolResult"&&Y.message.usage?xS(r,Y.message.usage):(Y.type==="branch_summary"||Y.type==="compaction")&&Y.usage&&xS(r,Y.usage);let s=this.session.getContextUsage(),o=s?.contextWindow??n.model?.contextWindow??0,a=s?.percent??0,c=s?.percent!==null?a.toFixed(1):"?",u=Zgs(this.session.sessionManager.getCwd(),process.env.HOME||process.env.USERPROFILE),l=this.footerData.getGitBranch();l&&(u=`${u} (${l})`);let d=this.session.sessionManager.getSessionName();d&&(u=`${u} \u2022 ${d}`);let m=[];r.input&&m.push(`\u2191${Xw(r.input)}`),r.output&&m.push(`\u2193${Xw(r.output)}`),r.cacheRead&&m.push(`R${Xw(r.cacheRead)}`),r.cacheWrite&&m.push(`W${Xw(r.cacheWrite)}`),(r.cacheRead>0||r.cacheWrite>0)&&i!==void 0&&m.push(`CH${i.toFixed(1)}%`);let h=n.model?n.model.provider==="kimi-coding"||this.session.modelRuntime.isUsingSubscription(n.model.provider):!1;if(r.cost||h){let Y=`$${r.cost.toFixed(3)}${h?" (sub)":""}`;m.push(Y)}let f,g=this.autoCompactEnabled?" (auto)":"",A=c==="?"?`?/${Xw(o)}${g}`:`${c}%/${Xw(o)}${g}`;a>90?f=Ee.fg("error",A):a>70?f=Ee.fg("warning",A):f=A,m.push(f),KDe()&&m.push(`${Ee.fg("dim","\u2022")} ${Ee.bold(Ee.fg("warning","xp"))}`);let y=m.join(" "),E=n.model?.id||"no-model",_=rn(y);_>e&&(y=dr(y,e,"..."),_=rn(y));let S=2,C=E;if(n.model?.reasoning){let Y=n.thinkingLevel||"off";C=Y==="off"?`${E} \u2022 thinking off`:`${E} \u2022 ${Y}`}let I=C;this.footerData.getAvailableProviderCount()>1&&n.model&&(I=`(${n.model.provider}) ${C}`,_+S+rn(I)>e&&(I=C));let w=rn(I),k=_+S+w,N;if(k<=e){let Y=" ".repeat(e-_-w);N=y+Y+I}else{let Y=e-_-S;if(Y>0){let z=dr(I,Y,""),j=rn(z),se=" ".repeat(Math.max(0,e-_-j));N=y+se+z}else N=y}let O=Ee.fg("dim",y),W=N.slice(y.length),$=Ee.fg("dim",W),q=[dr(Ee.fg("dim",u),e,Ee.fg("dim","...")),O+$],ce=this.footerData.getExtensionStatuses();if(ce.size>0){let z=Array.from(ce.entries()).sort(([j],[se])=>j.localeCompare(se)).map(([,j])=>Xgs(j)).join(" ");q.push(dr(z,e,Ee.fg("dim","...")))}return q}}});function RPe(t){let[e,n]=process.platform==="darwin"?["open",[t]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",t]]:["xdg-open",[t]];(0,osr.spawn)(e,n,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}var osr,Ebt=v(()=>{p();osr=require("node:child_process")});var Ik,bbt=v(()=>{p();Tr();Ebt();pi();Ll();ha();Ik=class extends gn{contentContainer;input;tui;abortController=new AbortController;inputResolver;inputRejecter;onComplete;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.input.focused=e}constructor(e,n,r,i,s){super(),this.tui=e,this.onComplete=r;let a=s??`Login to ${i||n}`;this.addChild(new Un),this.addChild(new Et(Ee.fg("accent",Ee.bold(a)),1,0)),this.contentContainer=new gn,this.addChild(this.contentContainer),this.input=new ma,this.input.onSubmit=()=>{if(this.inputResolver){let c=this.input.getValue();this.replaceInputWithSubmittedText(c),this.inputResolver(c),this.inputResolver=void 0,this.inputRejecter=void 0}},this.input.onEscape=()=>{this.cancel()},this.addChild(new Un)}get signal(){return this.abortController.signal}replaceInputWithSubmittedText(e){this.contentContainer.children=this.contentContainer.children.map(n=>n===this.input?new Et(`> ${e}`,0,0):n)}cancel(){this.abortController.abort(),this.inputRejecter&&(this.inputRejecter(new Error("Login cancelled")),this.inputResolver=void 0,this.inputRejecter=void 0),this.onComplete(!1,"Login cancelled")}showAuth(e,n){this.contentContainer.clear(),this.contentContainer.addChild(new Tt(1));let r=`\x1B]8;;${e}\x07${e}\x1B]8;;\x07`;this.contentContainer.addChild(new Et(Ee.fg("accent",r),1,0));let i=process.platform==="darwin"?"Cmd+click to open":"Ctrl+click to open",s=`\x1B]8;;${e}\x07${i}\x1B]8;;\x07`;this.contentContainer.addChild(new Et(Ee.fg("dim",s),1,0)),n&&(this.contentContainer.addChild(new Tt(1)),this.contentContainer.addChild(new Et(Ee.fg("warning",n),1,0))),RPe(e),this.tui.requestRender()}showDeviceCode(e){this.contentContainer.clear(),this.contentContainer.addChild(new Tt(1));let n=`\x1B]8;;${e.verificationUri}\x07${e.verificationUri}\x1B]8;;\x07`;this.contentContainer.addChild(new Et(Ee.fg("accent",n),1,0));let r=process.platform==="darwin"?"Cmd+click to open":"Ctrl+click to open",i=`\x1B]8;;${e.verificationUri}\x07${r}\x1B]8;;\x07`;this.contentContainer.addChild(new Et(Ee.fg("dim",i),1,0)),this.contentContainer.addChild(new Tt(1)),this.contentContainer.addChild(new Et(Ee.fg("warning",`Enter code: ${e.userCode}`),1,0)),this.tui.requestRender()}showManualInput(e){return this.input.setValue(""),this.contentContainer.addChild(new Tt(1)),this.contentContainer.addChild(new Et(Ee.fg("dim",e),1,0)),this.contentContainer.addChild(this.input),this.contentContainer.addChild(new Et(`(${nr("tui.select.cancel","to cancel")})`,1,0)),this.tui.requestRender(),new Promise((n,r)=>{this.inputResolver=n,this.inputRejecter=r})}showPrompt(e,n){return this.contentContainer.addChild(new Tt(1)),this.contentContainer.addChild(new Et(Ee.fg("text",e),1,0)),n&&this.contentContainer.addChild(new Et(Ee.fg("dim",`e.g., ${n}`),1,0)),this.contentContainer.addChild(this.input),this.contentContainer.addChild(new Et(`(${nr("tui.select.cancel","to cancel,")} ${nr("tui.select.confirm","to submit")})`,1,0)),this.input.setValue(""),this.tui.requestRender(),new Promise((r,i)=>{this.inputResolver=r,this.inputRejecter=i})}showDetails(e){this.contentContainer.clear(),this.contentContainer.addChild(new Tt(1));for(let n of e)this.contentContainer.addChild(new Et(n,1,0));this.tui.requestRender()}showInfo(e,n=[],r=!1){this.contentContainer.addChild(new Tt(1)),this.contentContainer.addChild(new Et(Ee.fg("text",e),1,0));for(let i of n){let s=i.label?`${i.label}: ${i.url}`:i.url,o=`\x1B]8;;${i.url}\x07${s}\x1B]8;;\x07`;this.contentContainer.addChild(new Et(Ee.fg("accent",o),1,0))}r&&(this.contentContainer.addChild(new Tt(1)),this.contentContainer.addChild(new Et(`(${nr("tui.select.cancel","to close")})`,1,0))),this.tui.requestRender()}showWaiting(e){this.contentContainer.addChild(new Tt(1)),this.contentContainer.addChild(new Et(Ee.fg("dim",e),1,0)),this.contentContainer.addChild(new Et(`(${nr("tui.select.cancel","to cancel")})`,1,0)),this.tui.requestRender()}showProgress(e){this.contentContainer.addChild(new Et(Ee.fg("dim",e),1,0)),this.tui.requestRender()}handleInput(e){if(Ai().matches(e,"tui.select.cancel")){this.cancel();return}this.input.handleInput(e)}}});var _bt,asr=v(()=>{p();_bt=[[0,172,1],[173,173,0],[174,767,1],[768,879,0],[880,1154,1],[1155,1161,0],[1162,1424,1],[1425,1469,0],[1470,1470,1],[1471,1471,0],[1472,1472,1],[1473,1474,0],[1475,1475,1],[1476,1477,0],[1478,1478,1],[1479,1479,0],[1480,1540,1],[1541,1541,0],[1542,1551,1],[1552,1562,0],[1563,1563,1],[1564,1564,0],[1565,1610,1],[1611,1631,0],[1632,1647,1],[1648,1648,0],[1649,1749,1],[1750,1756,0],[1757,1758,1],[1759,1764,0],[1765,1766,1],[1767,1768,0],[1769,1769,1],[1770,1773,0],[1774,1806,1],[1807,1807,0],[1808,1808,1],[1809,1809,0],[1810,1839,1],[1840,1866,0],[1867,1957,1],[1958,1968,0],[1969,2026,1],[2027,2035,0],[2036,2044,1],[2045,2045,0],[2046,2069,1],[2070,2073,0],[2074,2074,1],[2075,2083,0],[2084,2084,1],[2085,2087,0],[2088,2088,1],[2089,2093,0],[2094,2136,1],[2137,2139,0],[2140,2191,1],[2192,2193,0],[2194,2199,1],[2200,2207,0],[2208,2249,1],[2250,2306,0],[2307,2361,1],[2362,2362,0],[2363,2363,1],[2364,2364,0],[2365,2368,1],[2369,2376,0],[2377,2380,1],[2381,2381,0],[2382,2384,1],[2385,2391,0],[2392,2401,1],[2402,2403,0],[2404,2432,1],[2433,2433,0],[2434,2491,1],[2492,2492,0],[2493,2493,1],[2494,2494,0],[2495,2496,1],[2497,2500,0],[2501,2508,1],[2509,2509,0],[2510,2518,1],[2519,2519,0],[2520,2529,1],[2530,2531,0],[2532,2557,1],[2558,2558,0],[2559,2560,1],[2561,2562,0],[2563,2619,1],[2620,2620,0],[2621,2624,1],[2625,2626,0],[2627,2630,1],[2631,2632,0],[2633,2634,1],[2635,2637,0],[2638,2640,1],[2641,2641,0],[2642,2671,1],[2672,2673,0],[2674,2676,1],[2677,2677,0],[2678,2688,1],[2689,2690,0],[2691,2747,1],[2748,2748,0],[2749,2752,1],[2753,2757,0],[2758,2758,1],[2759,2760,0],[2761,2764,1],[2765,2765,0],[2766,2785,1],[2786,2787,0],[2788,2809,1],[2810,2815,0],[2816,2816,1],[2817,2817,0],[2818,2875,1],[2876,2876,0],[2877,2877,1],[2878,2879,0],[2880,2880,1],[2881,2884,0],[2885,2892,1],[2893,2893,0],[2894,2900,1],[2901,2903,0],[2904,2913,1],[2914,2915,0],[2916,2945,1],[2946,2946,0],[2947,3005,1],[3006,3006,0],[3007,3007,1],[3008,3008,0],[3009,3020,1],[3021,3021,0],[3022,3030,1],[3031,3031,0],[3032,3071,1],[3072,3072,0],[3073,3075,1],[3076,3076,0],[3077,3131,1],[3132,3132,0],[3133,3133,1],[3134,3136,0],[3137,3141,1],[3142,3144,0],[3145,3145,1],[3146,3149,0],[3150,3156,1],[3157,3158,0],[3159,3169,1],[3170,3171,0],[3172,3200,1],[3201,3201,0],[3202,3259,1],[3260,3260,0],[3261,3262,1],[3263,3264,0],[3265,3265,1],[3266,3266,0],[3267,3269,1],[3270,3272,0],[3273,3273,1],[3274,3277,0],[3278,3284,1],[3285,3286,0],[3287,3297,1],[3298,3299,0],[3300,3327,1],[3328,3329,0],[3330,3386,1],[3387,3388,0],[3389,3389,1],[3390,3390,0],[3391,3392,1],[3393,3396,0],[3397,3404,1],[3405,3406,0],[3407,3414,1],[3415,3415,0],[3416,3425,1],[3426,3427,0],[3428,3456,1],[3457,3457,0],[3458,3529,1],[3530,3530,0],[3531,3534,1],[3535,3535,0],[3536,3537,1],[3538,3540,0],[3541,3541,1],[3542,3542,0],[3543,3550,1],[3551,3551,0],[3552,3632,1],[3633,3633,0],[3634,3635,1],[3636,3642,0],[3643,3654,1],[3655,3662,0],[3663,3760,1],[3761,3761,0],[3762,3763,1],[3764,3772,0],[3773,3783,1],[3784,3790,0],[3791,3863,1],[3864,3865,0],[3866,3892,1],[3893,3893,0],[3894,3894,1],[3895,3895,0],[3896,3896,1],[3897,3897,0],[3898,3952,1],[3953,3966,0],[3967,3967,1],[3968,3972,0],[3973,3973,1],[3974,3975,0],[3976,3980,1],[3981,3991,0],[3992,3992,1],[3993,4028,0],[4029,4037,1],[4038,4038,0],[4039,4140,1],[4141,4144,0],[4145,4145,1],[4146,4151,0],[4152,4152,1],[4153,4154,0],[4155,4156,1],[4157,4158,0],[4159,4183,1],[4184,4185,0],[4186,4189,1],[4190,4192,0],[4193,4208,1],[4209,4212,0],[4213,4225,1],[4226,4226,0],[4227,4228,1],[4229,4230,0],[4231,4236,1],[4237,4237,0],[4238,4252,1],[4253,4253,0],[4254,4351,1],[4352,4447,2],[4448,4607,0],[4608,4956,1],[4957,4959,0],[4960,5905,1],[5906,5908,0],[5909,5937,1],[5938,5939,0],[5940,5969,1],[5970,5971,0],[5972,6001,1],[6002,6003,0],[6004,6051,1],[6052,6052,2],[6053,6067,1],[6068,6069,0],[6070,6070,1],[6071,6077,0],[6078,6085,1],[6086,6086,0],[6087,6088,1],[6089,6099,0],[6100,6103,1],[6104,6104,3],[6105,6108,1],[6109,6109,0],[6110,6154,1],[6155,6159,0],[6160,6276,1],[6277,6278,0],[6279,6312,1],[6313,6313,0],[6314,6431,1],[6432,6434,0],[6435,6438,1],[6439,6440,0],[6441,6449,1],[6450,6450,0],[6451,6456,1],[6457,6459,0],[6460,6678,1],[6679,6680,0],[6681,6682,1],[6683,6683,0],[6684,6741,1],[6742,6742,0],[6743,6743,1],[6744,6750,0],[6751,6751,1],[6752,6752,0],[6753,6753,1],[6754,6754,0],[6755,6756,1],[6757,6764,0],[6765,6770,1],[6771,6780,0],[6781,6782,1],[6783,6783,0],[6784,6831,1],[6832,6862,0],[6863,6911,1],[6912,6915,0],[6916,6963,1],[6964,6973,0],[6974,6977,1],[6978,6979,0],[6980,7018,1],[7019,7027,0],[7028,7039,1],[7040,7041,0],[7042,7073,1],[7074,7077,0],[7078,7079,1],[7080,7081,0],[7082,7082,1],[7083,7085,0],[7086,7141,1],[7142,7142,0],[7143,7143,1],[7144,7145,0],[7146,7148,1],[7149,7149,0],[7150,7150,1],[7151,7153,0],[7154,7211,1],[7212,7219,0],[7220,7221,1],[7222,7223,0],[7224,7375,1],[7376,7378,0],[7379,7379,1],[7380,7392,0],[7393,7393,1],[7394,7400,0],[7401,7404,1],[7405,7405,0],[7406,7411,1],[7412,7412,0],[7413,7415,1],[7416,7417,0],[7418,7615,1],[7616,7679,0],[7680,8202,1],[8203,8207,0],[8208,8233,1],[8234,8238,0],[8239,8287,1],[8288,8303,0],[8304,8399,1],[8400,8432,0],[8433,8985,1],[8986,8987,2],[8988,9e3,1],[9001,9002,2],[9003,9192,1],[9193,9196,2],[9197,9199,1],[9200,9200,2],[9201,9202,1],[9203,9203,2],[9204,9724,1],[9725,9726,2],[9727,9747,1],[9748,9749,2],[9750,9799,1],[9800,9811,2],[9812,9854,1],[9855,9855,2],[9856,9874,1],[9875,9875,2],[9876,9888,1],[9889,9889,2],[9890,9897,1],[9898,9899,2],[9900,9916,1],[9917,9918,2],[9919,9923,1],[9924,9925,2],[9926,9933,1],[9934,9934,2],[9935,9939,1],[9940,9940,2],[9941,9961,1],[9962,9962,2],[9963,9969,1],[9970,9971,2],[9972,9972,1],[9973,9973,2],[9974,9977,1],[9978,9978,2],[9979,9980,1],[9981,9981,2],[9982,9988,1],[9989,9989,2],[9990,9993,1],[9994,9995,2],[9996,10023,1],[10024,10024,2],[10025,10059,1],[10060,10060,2],[10061,10061,1],[10062,10062,2],[10063,10066,1],[10067,10069,2],[10070,10070,1],[10071,10071,2],[10072,10132,1],[10133,10135,2],[10136,10159,1],[10160,10160,2],[10161,10174,1],[10175,10175,2],[10176,11034,1],[11035,11036,2],[11037,11087,1],[11088,11088,2],[11089,11092,1],[11093,11093,2],[11094,11502,1],[11503,11505,0],[11506,11743,1],[11744,11775,0],[11776,11903,1],[11904,11929,2],[11930,11930,1],[11931,12019,2],[12020,12031,1],[12032,12245,2],[12246,12271,1],[12272,12329,2],[12330,12335,0],[12336,12350,2],[12351,12352,1],[12353,12438,2],[12439,12440,1],[12441,12442,0],[12443,12543,2],[12544,12548,1],[12549,12591,2],[12592,12592,1],[12593,12643,2],[12644,12644,0],[12645,12686,2],[12687,12687,1],[12688,12771,2],[12772,12782,1],[12783,12830,2],[12831,12831,1],[12832,12871,2],[12872,12879,1],[12880,19903,2],[19904,19967,1],[19968,42124,2],[42125,42127,1],[42128,42182,2],[42183,42606,1],[42607,42610,0],[42611,42611,1],[42612,42621,0],[42622,42653,1],[42654,42655,0],[42656,42735,1],[42736,42737,0],[42738,43009,1],[43010,43010,0],[43011,43013,1],[43014,43014,0],[43015,43018,1],[43019,43019,0],[43020,43044,1],[43045,43046,0],[43047,43051,1],[43052,43052,0],[43053,43203,1],[43204,43205,0],[43206,43231,1],[43232,43249,0],[43250,43257,1],[43258,43258,0],[43259,43262,1],[43263,43263,0],[43264,43301,1],[43302,43309,0],[43310,43334,1],[43335,43345,0],[43346,43359,1],[43360,43388,2],[43389,43391,1],[43392,43394,0],[43395,43442,1],[43443,43443,0],[43444,43445,1],[43446,43449,0],[43450,43451,1],[43452,43453,0],[43454,43492,1],[43493,43493,0],[43494,43560,1],[43561,43566,0],[43567,43568,1],[43569,43570,0],[43571,43572,1],[43573,43574,0],[43575,43586,1],[43587,43587,0],[43588,43595,1],[43596,43596,0],[43597,43643,1],[43644,43644,0],[43645,43695,1],[43696,43696,0],[43697,43697,1],[43698,43700,0],[43701,43702,1],[43703,43704,0],[43705,43709,1],[43710,43711,0],[43712,43712,1],[43713,43713,0],[43714,43755,1],[43756,43757,0],[43758,43765,1],[43766,43766,0],[43767,44004,1],[44005,44005,0],[44006,44007,1],[44008,44008,0],[44009,44012,1],[44013,44013,0],[44014,44031,1],[44032,55203,2],[55204,55215,1],[55216,55238,0],[55239,55242,1],[55243,55291,0],[55292,63743,1],[63744,64255,2],[64256,64285,1],[64286,64286,0],[64287,65023,1],[65024,65039,0],[65040,65049,2],[65050,65055,1],[65056,65071,0],[65072,65106,2],[65107,65107,1],[65108,65126,2],[65127,65127,1],[65128,65131,2],[65132,65278,1],[65279,65279,0],[65280,65280,1],[65281,65376,2],[65377,65437,1],[65438,65440,0],[65441,65503,1],[65504,65510,2],[65511,65519,1],[65520,65528,0],[65529,66044,1],[66045,66045,0],[66046,66271,1],[66272,66272,0],[66273,66421,1],[66422,66426,0],[66427,68096,1],[68097,68099,0],[68100,68100,1],[68101,68102,0],[68103,68107,1],[68108,68111,0],[68112,68151,1],[68152,68154,0],[68155,68158,1],[68159,68159,0],[68160,68324,1],[68325,68326,0],[68327,68899,1],[68900,68903,0],[68904,69290,1],[69291,69292,0],[69293,69372,1],[69373,69375,0],[69376,69445,1],[69446,69456,0],[69457,69505,1],[69506,69509,0],[69510,69632,1],[69633,69633,0],[69634,69687,1],[69688,69702,0],[69703,69743,1],[69744,69744,0],[69745,69746,1],[69747,69748,0],[69749,69758,1],[69759,69761,0],[69762,69810,1],[69811,69814,0],[69815,69816,1],[69817,69818,0],[69819,69825,1],[69826,69826,0],[69827,69887,1],[69888,69890,0],[69891,69926,1],[69927,69931,0],[69932,69932,1],[69933,69940,0],[69941,70002,1],[70003,70003,0],[70004,70015,1],[70016,70017,0],[70018,70069,1],[70070,70078,0],[70079,70081,1],[70082,70083,0],[70084,70088,1],[70089,70092,0],[70093,70094,1],[70095,70095,0],[70096,70190,1],[70191,70193,0],[70194,70195,1],[70196,70196,0],[70197,70197,1],[70198,70199,0],[70200,70205,1],[70206,70206,0],[70207,70208,1],[70209,70209,0],[70210,70366,1],[70367,70367,0],[70368,70370,1],[70371,70378,0],[70379,70399,1],[70400,70401,0],[70402,70458,1],[70459,70460,0],[70461,70461,1],[70462,70462,0],[70463,70463,1],[70464,70464,0],[70465,70486,1],[70487,70487,0],[70488,70501,1],[70502,70508,0],[70509,70511,1],[70512,70516,0],[70517,70711,1],[70712,70719,0],[70720,70721,1],[70722,70724,0],[70725,70725,1],[70726,70726,0],[70727,70749,1],[70750,70750,0],[70751,70831,1],[70832,70832,0],[70833,70834,1],[70835,70840,0],[70841,70841,1],[70842,70842,0],[70843,70844,1],[70845,70845,0],[70846,70846,1],[70847,70848,0],[70849,70849,1],[70850,70851,0],[70852,71086,1],[71087,71087,0],[71088,71089,1],[71090,71093,0],[71094,71099,1],[71100,71101,0],[71102,71102,1],[71103,71104,0],[71105,71131,1],[71132,71133,0],[71134,71218,1],[71219,71226,0],[71227,71228,1],[71229,71229,0],[71230,71230,1],[71231,71232,0],[71233,71338,1],[71339,71339,0],[71340,71340,1],[71341,71341,0],[71342,71343,1],[71344,71349,0],[71350,71350,1],[71351,71351,0],[71352,71452,1],[71453,71455,0],[71456,71457,1],[71458,71461,0],[71462,71462,1],[71463,71467,0],[71468,71726,1],[71727,71735,0],[71736,71736,1],[71737,71738,0],[71739,71983,1],[71984,71984,0],[71985,71994,1],[71995,71996,0],[71997,71997,1],[71998,71999,0],[72e3,72e3,1],[72001,72001,0],[72002,72002,1],[72003,72003,0],[72004,72147,1],[72148,72151,0],[72152,72153,1],[72154,72155,0],[72156,72159,1],[72160,72160,0],[72161,72192,1],[72193,72202,0],[72203,72242,1],[72243,72248,0],[72249,72249,1],[72250,72254,0],[72255,72262,1],[72263,72263,0],[72264,72272,1],[72273,72278,0],[72279,72280,1],[72281,72283,0],[72284,72323,1],[72324,72342,0],[72343,72343,1],[72344,72345,0],[72346,72751,1],[72752,72758,0],[72759,72759,1],[72760,72765,0],[72766,72766,1],[72767,72767,0],[72768,72849,1],[72850,72871,0],[72872,72873,1],[72874,72880,0],[72881,72881,1],[72882,72883,0],[72884,72884,1],[72885,72886,0],[72887,73008,1],[73009,73014,0],[73015,73017,1],[73018,73018,0],[73019,73019,1],[73020,73021,0],[73022,73022,1],[73023,73031,0],[73032,73103,1],[73104,73105,0],[73106,73108,1],[73109,73109,0],[73110,73110,1],[73111,73111,0],[73112,73458,1],[73459,73460,0],[73461,73471,1],[73472,73474,0],[73475,73525,1],[73526,73530,0],[73531,73535,1],[73536,73536,0],[73537,73537,1],[73538,73538,0],[73539,78911,1],[78912,78912,0],[78913,78918,1],[78919,78933,0],[78934,92911,1],[92912,92916,0],[92917,92975,1],[92976,92982,0],[92983,94030,1],[94031,94031,0],[94032,94094,1],[94095,94098,0],[94099,94175,1],[94176,94179,2],[94180,94180,0],[94181,94191,1],[94192,94193,2],[94194,94207,1],[94208,100343,2],[100344,100351,1],[100352,101589,2],[101590,101631,1],[101632,101640,2],[101641,110575,1],[110576,110579,2],[110580,110580,1],[110581,110587,2],[110588,110588,1],[110589,110590,2],[110591,110591,1],[110592,110882,2],[110883,110897,1],[110898,110898,2],[110899,110927,1],[110928,110930,2],[110931,110932,1],[110933,110933,2],[110934,110947,1],[110948,110951,2],[110952,110959,1],[110960,111355,2],[111356,113820,1],[113821,113822,0],[113823,113823,1],[113824,113827,0],[113828,118527,1],[118528,118573,0],[118574,118575,1],[118576,118598,0],[118599,119140,1],[119141,119141,0],[119142,119142,1],[119143,119145,0],[119146,119149,1],[119150,119170,0],[119171,119172,1],[119173,119179,0],[119180,119209,1],[119210,119213,0],[119214,119361,1],[119362,119364,0],[119365,121343,1],[121344,121398,0],[121399,121402,1],[121403,121452,0],[121453,121460,1],[121461,121461,0],[121462,121475,1],[121476,121476,0],[121477,121498,1],[121499,121503,0],[121504,121504,1],[121505,121519,0],[121520,122879,1],[122880,122886,0],[122887,122887,1],[122888,122904,0],[122905,122906,1],[122907,122913,0],[122914,122914,1],[122915,122916,0],[122917,122917,1],[122918,122922,0],[122923,123022,1],[123023,123023,0],[123024,123183,1],[123184,123190,0],[123191,123565,1],[123566,123566,0],[123567,123627,1],[123628,123631,0],[123632,124139,1],[124140,124143,0],[124144,125135,1],[125136,125142,0],[125143,125251,1],[125252,125258,0],[125259,126979,1],[126980,126980,2],[126981,127182,1],[127183,127183,2],[127184,127373,1],[127374,127374,2],[127375,127376,1],[127377,127386,2],[127387,127487,1],[127488,127490,2],[127491,127503,1],[127504,127547,2],[127548,127551,1],[127552,127560,2],[127561,127567,1],[127568,127569,2],[127570,127583,1],[127584,127589,2],[127590,127743,1],[127744,127776,2],[127777,127788,1],[127789,127797,2],[127798,127798,1],[127799,127868,2],[127869,127869,1],[127870,127891,2],[127892,127903,1],[127904,127946,2],[127947,127950,1],[127951,127955,2],[127956,127967,1],[127968,127984,2],[127985,127987,1],[127988,127988,2],[127989,127991,1],[127992,128062,2],[128063,128063,1],[128064,128064,2],[128065,128065,1],[128066,128252,2],[128253,128254,1],[128255,128317,2],[128318,128330,1],[128331,128334,2],[128335,128335,1],[128336,128359,2],[128360,128377,1],[128378,128378,2],[128379,128404,1],[128405,128406,2],[128407,128419,1],[128420,128420,2],[128421,128506,1],[128507,128591,2],[128592,128639,1],[128640,128709,2],[128710,128715,1],[128716,128716,2],[128717,128719,1],[128720,128722,2],[128723,128724,1],[128725,128727,2],[128728,128731,1],[128732,128735,2],[128736,128746,1],[128747,128748,2],[128749,128755,1],[128756,128764,2],[128765,128991,1],[128992,129003,2],[129004,129007,1],[129008,129008,2],[129009,129291,1],[129292,129338,2],[129339,129339,1],[129340,129349,2],[129350,129350,1],[129351,129535,2],[129536,129647,1],[129648,129660,2],[129661,129663,1],[129664,129672,2],[129673,129679,1],[129680,129725,2],[129726,129726,1],[129727,129733,2],[129734,129741,1],[129742,129755,2],[129756,129759,1],[129760,129768,2],[129769,129775,1],[129776,129784,2],[129785,131071,1],[131072,196605,2],[196606,196607,1],[196608,262141,2],[262142,917503,1],[917504,921599,0],[921600,1114111,1]]});function nAs(t){let e=0,n=_bt.length-1;for(;e<=n;){let r=e+n>>1,i=_bt[r];if(ti[1])e=r+1;else return i[2]}return 1}function lsr(t){let e=0,n=!1,r=0;for(let i of t){let s=i.codePointAt(0);s===eAs&&(n=!0),tAs(s)&&r++;let o=nAs(s);o>e&&(e=o)}return n||r>=2?2:e}function*wk(t){for(let{segment:e}of csr.segment(t))yield[e,lsr(e)]}function dd(t){let e=0;for(let{segment:n}of csr.segment(t))e+=lsr(n);return e}var csr,eAs,tAs,Xae=v(()=>{p();asr();csr=new Intl.Segmenter("en",{granularity:"grapheme"}),eAs=65039,tAs=t=>t>=127462&&t<=127487});function msr(t){let e=t.split(` +`).map(n=>n.endsWith("\r")?n.slice(0,-1):n);return e.length>0&&e[e.length-1]===""&&e.pop(),e}function cAs(t){let e=aAs[t];if(e!==void 0)return e;if(!t.startsWith("#"))return null;let n=t.slice(1),r=/^[xX]/.test(n),i=r?n.slice(1):n;if(!(r?/^[0-9a-fA-F]+$/:/^[0-9]+$/).test(i))return null;let s=Number.parseInt(i,r?16:10);return s>1114111||s>=55296&&s<=57343||s<32||s>=127&&s<=159?null:String.fromCodePoint(s)}function r_(t){if(!t.includes("&"))return t;let e=[...t],n="",r=0;for(;rs!=="`").join("").replaceAll("**","").replaceAll("__","")],i="";for(let s=0;s0&&Sbt(r[s-1])&&r[s+1]!==void 0&&Sbt(r[s+1]);(o==="*"||o==="_")&&!a||(i+=o)}return i.trim()}function dAs(t,e){let n=e+1;t[n]==="/"&&n++;let r=n;for(;n";){if(t[n]==="<")return null;n++}return t[n]===">"?{name:i,end:n+1}:null}function pAs(t){let e=[...t],n="",r=0;for(;r=e.length+n.length&&t.startsWith(e)&&t.endsWith(n)?t.slice(e.length,t.length-n.length):null}function Tk(t){let e=pAs(t.trim()).trim(),n=(xbt(e,'"','"')??xbt(e,"'","'")??e).trim(),r=xbt(n,"`","`");return r_(r===null?n:lAs(r.trim()))}function mAs(t){let e=-1;for(let n of rAs)e=Math.max(e,t.lastIndexOf(n));return e}function hsr(t,e,n){e=Math.max(1,e);let r=[],i="",s=0;for(let o of t.split(/\s+/).filter(a=>a!=="")){let a=dd(o);if(a>e){i!==""&&(r.push(i),i="");let c="",u=0;for(let[l,d]of wk(o)){if(u+d>e&&c!==""){let m=mAs(c),h=m===-1?"":c.slice(m+1);r.push(m===-1?c:c.slice(0,m+1)),c=h,u=dd(h)}c+=l,u+=d}i=c,s=u}else i===""?(i=o,s=a):s+1+a<=e?(i+=` ${o}`,s+=1+a):(r.push(i),i=o,s=a)}if(i!==""&&r.push(i),r.length===0&&r.push(""),r.length>n){r.length=n;let o=Math.max(1,e-1),a="",c=0;for(let[u,l]of wk(r[r.length-1])){if(c+l>o)break;a+=u,c+=l}r[r.length-1]=`${a}\u2026`}return r}function eT(t,e){if(dd(t)<=e)return t;let n="",r=0;for(let[i,s]of wk(t)){if(r+s+1>e)break;n+=i,r+=s}return`${n}\u2026`}var Zae,usr,ece,rAs,nM,dsr,iAs,psr,sAs,Sbt,y9,oAs,aAs,uAs,E9=v(()=>{p();Xae();Zae=24,usr=4,ece=28,rAs=["_","-",".","/"],nM=t=>t.replace(/[A-Z]/g,e=>e.toLowerCase()),dsr=t=>t.replace(/[a-z]/g,e=>e.toUpperCase()),iAs=/[\0-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/g,psr=t=>t.replace(iAs,"");sAs=/[\p{Alphabetic}\p{N}]/u,Sbt=t=>sAs.test(t),y9=t=>Sbt(t)||t==="_",oAs=10,aAs={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};uAs=new Set(["b","strong","i","em","u","s","strike","del","ins","mark","small","big","sub","sup","code","kbd","samp","var","tt","span","font","q","abbr","cite","pre"])});function hAs(t,e,n){for(let r=e,i=n-1;r{p();Xae();tce="\0",$A=1,dh=2,qE=4,mm=8,Cbt=1,Ibt=2,wbt=4,iG=class{w;h;ch;cls;mask;style;occupied;curStyle=wbt;constructor(e,n){let r=e*n;this.w=e,this.h=n,this.ch=new Array(r).fill(" "),this.cls=new Array(r).fill("none"),this.mask=new Uint8Array(r),this.style=new Uint8Array(r),this.occupied=new Uint8Array(r)}idx(e,n){return n*this.w+e}set(e,n,r,i){if(e>=this.w||n>=this.h)return;let s=this.idx(e,n);this.ch[s]=r,this.cls[s]=i}addBits(e,n,r,i="edge"){if(e>=this.w||n>=this.h)return;let s=this.idx(e,n);this.occupied[s]||(this.mask[s]|=r,this.style[s]|=this.curStyle,this.cls[s]!=="border"&&(this.cls[s]=i))}blit(e,n,r){for(let i=0;i=this.w||a>=this.h)continue;let c=e.idx(s,i),u=this.idx(o,a);this.ch[u]=e.ch[c],this.cls[u]=e.cls[c],this.style[u]=e.style[c],this.occupied[u]=1}}junction(e,n,r){if(e>=this.w||n>=this.h)return;let i=this.idx(e,n);this.mask[i]|=r,this.cls[i]!=="border"&&(this.cls[i]="edge")}segV(e,n,r){let i=Math.min(n,r),s=Math.max(n,r);for(let o=i;o<=s;o++){let a=0;o>i&&(a|=$A),oi&&(a|=qE),o=0;m--)if(this.ch[this.idx(m,o)]!==" "){a=m+1;break}r=Math.max(r,a);let c=[],u="",l="",d="none";for(let m=0;mi&&e[s-1]==="";)s--;return{plain:e.slice(i,s),styled:n.slice(i,s),width:r}}};gAs={"\u2500":"\u254C","\u2502":"\u254E"},AAs={"\u2500":"\u2501","\u2502":"\u2503","\u250C":"\u250F","\u2510":"\u2513","\u2514":"\u2517","\u2518":"\u251B","\u251C":"\u2523","\u2524":"\u252B","\u252C":"\u2533","\u2534":"\u253B","\u253C":"\u254B"},yAs={"\u250C":"\u2514","\u2514":"\u250C","\u2510":"\u2518","\u2518":"\u2510","\u250F":"\u2517","\u2517":"\u250F","\u2513":"\u251B","\u251B":"\u2513","\u256D":"\u2570","\u2570":"\u256D","\u256E":"\u256F","\u256F":"\u256E","\u252C":"\u2534","\u2534":"\u252C","\u2533":"\u253B","\u253B":"\u2533","\u25BC":"\u25B2","\u25B2":"\u25BC","\u25BD":"\u25B3","\u25B3":"\u25BD"},EAs={"\u250C":"\u2510","\u2510":"\u250C","\u2514":"\u2518","\u2518":"\u2514","\u250F":"\u2513","\u2513":"\u250F","\u2517":"\u251B","\u251B":"\u2517","\u256D":"\u256E","\u256E":"\u256D","\u2570":"\u256F","\u256F":"\u2570","\u251C":"\u2524","\u2524":"\u251C","\u2523":"\u252B","\u252B":"\u2523","\u25B6":"\u25C4","\u25C4":"\u25B6","\u25B7":"\u25C1","\u25C1":"\u25B7"},bAs=t=>gAs[t]??t,_As=t=>AAs[t]??t,xAs=t=>yAs[t]??t,SAs=t=>EAs[t]??t});function BPe(t){switch(dsr(t)){case"LR":return"right";case"RL":return"left";case"BT":return"up";default:return"down"}}var vbt,rM,gsr,Asr,nce,kPe,vk,Rbt=v(()=>{p();E9();vbt=128,rM=512,gsr=24,Asr=6,nce=8,kPe=()=>({annotation:null,attrs:[],methods:[]});vk=class{nodes=[];edges=[];index=new Map;groups=[];nodeGroup=[];curGroup=null;overCap=!1;warnings=[];dir="down";constructor(e="down"){this.dir=e}nodeIndex(e,n,r){let i=this.index.get(e);return i!==void 0?(n!==null&&(this.nodes[i].label=n,this.nodes[i].shape=r),i):this.nodes.length>=vbt?(this.overCap=!0,null):(this.index.set(e,this.nodes.length),this.nodes.push({label:n??e,shape:r}),this.nodeGroup.push(this.curGroup),this.nodes.length-1)}nodeLabel(e,n){let r=this.index.get(e);return r!==void 0?(this.nodes[r].label=n,r):this.nodeIndex(e,n,"round")}pushEdge(e){return this.edges.length>=rM?(this.overCap=!0,!1):(this.edges.push(e),!0)}}});function wAs(t){let e=t.nodes.length,n=Array.from({length:e},()=>[]),r=new Array(e).fill(0);for(let u of t.edges)u.from!==u.to&&(n[u.from].push(u.to),r[u.to]++);let i=new Uint8Array(e),s=Array.from({length:e},()=>[]),o=[],a=[...Array(e).keys()].filter(u=>r[u]===0);for(let u of[...a,...Array(e).keys()])i[u]===0&&TAs(u,n,i,s,o);let c=new Array(e).fill(0);for(let u=o.length-1;u>=0;u--){let l=o[u];for(let d of s[l])c[d]=Math.max(c[d],c[l]+1)}return c}function TAs(t,e,n,r,i){let s=[{u:t,i:0}];for(n[t]=1;s.length>0;){let o=s[s.length-1],a=o.u;if(o.i[]),s=Array.from({length:r},()=>[]);for(let l of e)l.from!==l.to&&n[l.to]>n[l.from]&&(i[l.to].push(l.from),s[l.from].push(l.to));let o=new Array(r).fill(0),a=l=>{for(let d=0;d[...l]),u=ysr(e,n,o);if(u!==0){for(let l=0;l<8;l++){let d=l%2===0?t.slice(1):t.slice(0,-1).reverse(),m=l%2===0?i:s;for(let f of d)RAs(f,m,o),a(f);let h=ysr(e,n,o);if(h[...f])),u===0)break}for(let l=0;l({key:e[i].length===0?n[i]:e[i].reduce((s,o)=>s+n[o],0)/e[i].length,v:i}));r.sort((i,s)=>i.key-s.key);for(let i=0;is.from!==s.to&&e[s.to]===e[s.from]+1).map(s=>[e[s.from],n[s.from],n[s.to]]),i=0;for(let s=0;sc[2]||o[1]>c[1]&&o[2][]),a=Array.from({length:s},()=>[]);for(let l of r)l.from!==l.to&&i[l.to]>i[l.from]&&(o[l.to].push(l.from),a[l.from].push(l.to));let c=new Array(s).fill(0);for(let l of t){let d=0;for(let m of l){let h=e[m]/2;d+=h,c[m]=d,d+=h+n}}for(let l=0;l<10;l++){let d=l%2===0?t:[...t].reverse(),m=l%2===0?o:a;for(let h of d)kAs(h,m,c,e,n)}let u=Number.POSITIVE_INFINITY;for(let l=0;lMath.max(0,Math.round(c[d]-u)))}function kAs(t,e,n,r,i){let s=t.length;if(s===0)return;let o=t.map(l=>e[l].length===0?n[l]:e[l].reduce((d,m)=>d+n[m],0)/e[l].length),a=l=>r[t[l]]/2,c=new Array(s);for(let l=0;l=0;l--)u[l]=l===s-1?o[l]:Math.min(o[l],u[l+1]-a(l+1)-i-a(l));for(let l=0;l{for(let o=0;o<5;o++)if(i[o]!==s[o])return i[o]-s[o];return 0}),n=[],r=[];for(let[i,s,o,a,c]of e){let u=n.findIndex(l=>l.every(([d,m,h,f])=>m+2<=i||s+2<=d||h===o||f===a));u===-1&&(n.push([]),u=n.length-1),n[u].push([i,s,o,a]),r.push([c,u])}return{assigned:r,count:n.length}}function _sr(t,e,n,r,i){let s=[];return t.edges.forEach((o,a)=>{let c=i?n[o.from]!==n[o.to]:Math.abs(n[o.from]-n[o.to])>1;o.from!==o.to&&e[o.from]===r&&e[o.to]===r+1&&c&&s.push([Math.min(n[o.from],n[o.to]),Math.max(n[o.from],n[o.to]),o.from,o.to,a])}),s}function xsr(t,e,n,r){let i=[];return t.edges.forEach((s,o)=>{if(s.from===s.to||e[s.to]===e[s.from]+1)return;let a=n[s.from],c=n[s.to],u=r?Math.min(a.cy,c.cy):Math.min(a.cx,c.cx),l=r?Math.max(a.cy,c.cy):Math.max(a.cx,c.cx);i.push([u,l,s.from,s.to,o])}),i}function BAs(t,e,n,r,i,s){let o=bsr(n,r.layW,Esr,i.edges,t),a=new Array(i.edges.length).fill(0),c=new Array(e+1).fill(0);for(let _=0;__.length===0?3:Math.max(..._.map(S=>r.boxH[S]+r.extraH[S]))),l=new Array(e+1).fill(0);for(let _=1;_<=e;_++)l[_]=l[_-1]+u[_-1]+Math.max(CAs,c[_-1]+1);let d=l[e]+u[e],m=Array.from({length:e+1},(_,S)=>l[S]+u[S]),h=1;n.forEach((_,S)=>{for(let C of _){let I=r.boxW[C],w=r.boxH[C],k=o[C],N=i_(k,LS(I)),O=l[S]+LS(u[S]-w-r.extraH[C]);s[C]={x:N,y:O,w:I,h:w,cx:k,cy:O+LS(w),rank:S},h=Math.max(h,N+I),r.extraH[C]>0&&r.selfLabelW[C]>0&&(h=Math.max(h,N+I+2+r.selfLabelW[C]))}});let f=h;for(let _ of i.edges){if(_.from===_.to||_.label===null)continue;let S=Math.min(dd(_.label),ece);f=t[_.to]===t[_.from]+1?Math.max(f,s[_.to].cx+2+S):Math.max(f,h+S+1)}let g=new Array(i.edges.length).fill(0),A=xsr(i,t,s,!0),y=f,E=0;if(A.length>0){let{assigned:_,count:S}=DPe(A);for(let[C,I]of _)g[C]=I;y=f+1+S,E=f+1}return{canvasW:y,canvasH:d,bandEnd:m,edgeBus:a,laneBase:E,edgeLane:g}}function NAs(t,e,n,r,i,s){let o=n.map(I=>I.length===0?0:Math.max(...I.map(w=>r.boxW[w]))),a=i.edges.filter(I=>I.from===I.to||t[I.to]===t[I.from]+1).filter(I=>I.label!==null).map(I=>Math.min(dd(I.label),ece)),c=a.length===0?0:Math.max(...a),u=Math.max(Esr+1,c+3),l=bsr(n,r.layH,1,i.edges,t),d=new Array(i.edges.length).fill(0),m=new Array(e+1).fill(0);for(let I=0;Ir.extraH[I]>0&&r.selfLabelW[I]>0).map(I=>2+r.selfLabelW[I]),g=h[e]+o[e]+(f.length===0?0:Math.max(...f)),A=Array.from({length:e+1},(I,w)=>h[w]+o[w]),y=1;n.forEach((I,w)=>{let k=h[w];for(let N of I){let O=r.boxW[N],W=r.boxH[N],$=l[N],G=i_($,LS(W+r.extraH[N]));s[N]={x:k,y:G,w:O,h:W,cx:k+LS(O),cy:G+LS(W),rank:w},y=Math.max(y,G+W+r.extraH[N])}});let E=new Array(i.edges.length).fill(0),_=xsr(i,t,s,!1),S=y,C=0;if(_.length>0){let{assigned:I,count:w}=DPe(_);for(let[k,N]of I)E[k]=N;S=y+1+w,C=y+1}return{canvasW:g,canvasH:S,bandEnd:A,edgeBus:d,laneBase:C,edgeLane:E}}function kbt(t,e){let n=t.nodes.length;if(n===0)return null;let r=wAs(t),i=Math.max(...r,0),s=Array.from({length:i+1},()=>[]);for(let y=0;yhsr(y.label,Zae,usr)),a=y=>Math.max(1,y.length===0?1:Math.max(...y.map(dd))),c=e.map((y,E)=>y.kind==="frame"?Math.max(y.sub.w+2,dd(eT(t.nodes[E].label,Zae))+4):y.kind==="compartments"?a(y.sections.flat())+2*oG+2:a(o[E])+2*oG+2),u=e.map((y,E)=>{if(y.kind==="frame")return y.sub.h+2;if(y.kind==="compartments"){let _=y.sections.filter(S=>S.length>0).length;return y.sections.reduce((S,C)=>S+C.length,0)+i_(_,1)+2}return o[E].length+2}),l=new Array(n).fill(0),d=new Array(n).fill(0);for(let y of t.edges)y.from===y.to&&(l[y.from]=2,y.label!==null&&(d[y.from]=Math.max(d[y.from],Math.min(dd(y.label),ece))));for(let y=0;y0&&(c[y]=Math.max(c[y],7));let m={boxW:c,boxH:u,layW:c.map((y,E)=>y+(d[E]>0?2*(d[E]+3):0)),layH:u.map((y,E)=>y+l[E]),extraH:l,selfLabelW:d},h=Array.from({length:n},()=>({x:0,y:0,w:0,h:0,cx:0,cy:0,rank:0})),f=t.dir==="down"||t.dir==="up",g=f?BAs(r,i,s,m,t,h):NAs(r,i,s,m,t,h);if(g.canvasW*g.canvasH>IAs)return null;let A=new iG(g.canvasW,g.canvasH);for(let y=0;y{if(A.curStyle=y.line==="dotted"?Cbt:y.line==="thick"?Ibt:wbt,y.from===y.to){LAs(A,h[y.from],y);return}let _=h[y.from],S=h[y.to],C=S.rank===_.rank+1,I=g.bandEnd[_.rank]+g.edgeBus[E],w=g.laneBase+g.edgeLane[E];f?C?OAs(A,_,S,y,I):FAs(A,_,S,y,w):C?QAs(A,_,S,y,I):UAs(A,_,S,y,w)}),A.finalizeMask(),A}function Bbt(t,e){return e.dir==="up"?t.flipVertical():e.dir==="left"&&t.flipHorizontal(),t}function Nbt(t){let e=t.nodes.map(()=>({kind:"plain"})),n=kbt(t,e);return n&&Bbt(n,t)}function Dbt(t,e){let n=t.nodes.map((i,s)=>{let o=[];return e[s].annotation!==null&&o.push(`\xAB${e[s].annotation}\xBB`),o.push(DAs(i.label)),{kind:"compartments",sections:[o,e[s].attrs,e[s].methods]}}),r=kbt(t,n);return r&&Bbt(r,t)}function DAs(t){let e="",n=!1;for(let r of t)r==="~"?(e+=n?">":"<",n=!n):e+=r;return e}function Csr(t){let e=new Map;t.groups.forEach((u,l)=>{let d=t.index.get(u.id);d!==void 0&&e.set(d,l)});let n=u=>{let l=[],d=u;for(;d!==null;)l.push(d),d=t.groups[d].parent;return l.reverse()},r=u=>{let l=e.get(u);return l===void 0?{key:Ssr(u),chain:n(t.nodeGroup[u])}:{key:NPe(l),chain:n(t.groups[l].parent)}},i=new Map,s=new Array(t.groups.length).fill(!1);t.edges.forEach((u,l)=>{let d=r(u.from),m=r(u.to),h=0;for(;hh?NPe(d.chain[h]):d.key,A=m.chain.length>h?NPe(m.chain[h]):m.key;for(let E of[g,A])E.startsWith("g")&&(s[Number(E.slice(1))]=!0);let y=i.get(f);y?y.push([g,A,l]):i.set(f,[[g,A,l]])});let o=new Map;t.nodeGroup.forEach((u,l)=>{if(e.has(l))return;let d=o.get(u);d?d.push(l):o.set(u,[l])});let a=new Array(t.groups.length).fill(!1);for(let u=t.groups.length-1;u>=0;u--){let l=(o.get(u)??[]).length>0,d=t.groups.some((m,h)=>m.parent===u&&a[h]);a[u]=l||d||s[u]}let c=Isr(t,null,i,o,a);return c&&Bbt(c,t)}function Isr(t,e,n,r,i){let s=(r.get(e)??[]).map(Ssr),o=t.groups.map((m,h)=>h).filter(m=>t.groups[m].parent===e&&i[m]);if(s.push(...o.map(NPe)),s.length===0)return new iG(1,1);let a=new Map,c=[],u=[];for(let m of s){a.set(m,c.length);let h=Number(m.slice(1));if(m.startsWith("n"))c.push({label:t.nodes[h].label,shape:t.nodes[h].shape}),u.push({kind:"plain"});else{let f=Isr(t,h,n,r,i);if(f===null)return null;c.push({label:t.groups[h].label,shape:"rect"}),u.push({kind:"frame",sub:f})}}let l=[];for(let[m,h,f]of n.get(e)??[]){let g=a.get(m),A=a.get(h);if(g===void 0||A===void 0)continue;let y=t.edges[f];l.push({from:g,to:A,label:y.label,headTo:y.headTo,headFrom:y.headFrom,line:y.line})}let d=new vk(t.dir);return d.nodes=c,d.edges=l,kbt(d,u)}function b9(t,e,n,r){let{x:i,y:s,w:o,h:a}=e,c=i+o-1,u=s+a-1,l=r==="round"||r==="diamond";t.set(i,s,l?"\u256D":"\u250C","border"),t.set(c,s,l?"\u256E":"\u2510","border"),t.set(i,u,l?"\u2570":"\u2514","border"),t.set(c,u,l?"\u256F":"\u2518","border");for(let m=i+1;m{let f=eT(m,d),g=i+1+oG+LS(i_(d,dd(f)));fsr(t,f,g,s+1+h,"text")})}function PAs(t,e,n){b9(t,e,[],"rect");let r=Math.max(1,i_(e.w,2*oG+2)),i=e.y+1,s=!0;n.forEach((o,a)=>{if(o.length!==0){if(!s){t.set(e.x,i,"\u251C","border");for(let c=e.x+1;c=t.h)return;let[o,a,c,u]=n.line==="dotted"?["\u254E","\u254C","\u2570","\u256F"]:n.line==="thick"?["\u2503","\u2501","\u2517","\u251B"]:["\u2502","\u2500","\u2570","\u256F"];t.junction(i,r,dh),t.set(i,r+1,o,"edge"),t.set(i,r+2,c,"edge");for(let l=i+1;l=t.h)return;let i=eT(e,ece),s=r;for(let[o,a]of wk(i)){if(a===0)continue;if(s+a>t.w)break;let c=!1;for(let u=0;u{p();Tbt();Rbt();E9();Xae();oG=1,Esr=3,CAs=2,IAs=1<<21,i_=(t,e)=>Math.max(0,t-e),LS=t=>Math.floor(t/2);Ssr=t=>`n${t}`,NPe=t=>`g${t}`});function wsr(t,e,n){if(e.kind==="over"){let i=_9(t[e.from]+t[e.to]),s=Math.max(t[e.to]-t[e.from]+5,n+2*Mbt+2);return{x:aG(i,_9(s)),w:s}}let r=n+2*Mbt+2;return e.kind==="left"?{x:aG(t[e.at],2+r-1),w:r}:{x:t[e.at]+2,w:r}}function Rsr(t){let e=t.labels.length,n=t.labels.map(f=>eT(f,Zae)),r=n.map(f=>Math.max(1,dd(f))+2*Mbt+2),i=3,s=Array.from({length:aG(e,1)},(f,g)=>Math.max(GAs,Math.ceil(r[g]/2)+Math.ceil(r[g+1]/2)+1)),o=[];for(let f of t.items)if(f.kind==="message"){let g=Tsr(f.text);f.from!==f.to?o.push([Math.min(f.from,f.to),Math.max(f.from,f.to),Math.max(g+2,4)]):f.from+10&&o.push([A.from-1,A.from,y]),A.from+10?o.push([A.at-1,A.at,g+7]):A.kind==="right"&&A.at+1f[1]-f[0]-(g[1]-g[0]));for(let[f,g,A]of o){let y=0;for(let E=f;E$As)return null;let h=new iG(c,m);for(let f=0;f{if(f.kind!=="note")return;let A=wsr(a,f.anchor,dd(f.text));b9(h,vsr(A.x,u[g],A.w,3),[f.text],"rect")});for(let f of a)h.junction(f,i-1,dh),h.segV(f,i,d-1),h.junction(f,d,$A);return t.items.forEach((f,g)=>{let A=u[g];f.kind==="message"?HAs(h,f,a,A):f.kind==="divider"&&qAs(h,f.text,A,c)}),h.finalizeMask(),h}function WAs(t){return t.kind==="note"?4:t.kind==="divider"?2:t.from===t.to?4:t.text!==null?3:2}function HAs(t,e,n,r){let i=e.dashed?"\u254C":"\u2500";if(e.from===e.to){let m=n[e.from];t.junction(m,r,mm),t.set(m+1,r,i,"edge"),t.set(m+2,r,i,"edge"),t.set(m+3,r,"\u256E","edge"),t.set(m+3,r+1,"\u2502","edge"),t.set(m+1,r+2,e.head==="cross"?"\xD7":"\u25C4","edge"),t.set(m+2,r+2,i,"edge"),t.set(m+3,r+2,"\u256F","edge"),e.text!==null&&sG(t,e.text,m+5,r+1,"text");return}let s=n[e.from],o=n[e.to],a=o>s,c=e.text!==null?r+1:r,u=Math.min(s,o),l=Math.max(s,o);t.junction(s,c,a?mm:qE);for(let m=u+1;m{p();Tbt();E9();Pbt();Xae();Mbt=1,GAs=5,$As=1<<21,aG=(t,e)=>Math.max(0,t-e),_9=t=>Math.floor(t/2);Tsr=t=>t===null?0:dd(t);vsr=(t,e,n,r)=>({x:t,y:e,w:n,h:r,cx:t+_9(n),cy:e+1,rank:0})});function Bsr(t,e){let n=t.trim();return n!==""&&e.push(n),""}function jAs(t,e){let n=[...t],r="",i=!1;for(let s=0;s=gsr||i.length>=Asr)return null;let[o,a]=VAs(s.slice(8).trim());r.groups.push({id:o,label:a,parent:i.at(-1)??null}),i.push(r.groups.length-1),r.curGroup=i.at(-1)??null;continue}case"end":i.pop(),r.curGroup=i.at(-1)??null;continue;case"classdef":case"class":case"style":case"linkstyle":case"click":case"direction":continue;default:break}if(YAs(s,r),r.overCap)return null}return r.nodes.length===0?null:r}function VAs(t){if(t.startsWith('"')){let n=t.indexOf('"',1);if(n!==-1){let r=t.slice(1,n);return[r,r_(r)]}}let e=t.indexOf("[");if(e!==-1){let n=t.slice(0,e).trim(),r=Tk(t.slice(e+1).replace(/\]+$/,"").trim());if(n!==""&&r!=="")return[n,r]}return[t,t]}function YAs(t,e){let n=[...t],r=0,i=Nsr(n,r,e);if(!i){e.warnings.push(`dropped, does not start with a node: "${t}"`);return}let s=i.group;for(r=i.next;r=x9(n,r),!(r>=n.length);){let o=KAs(n,r);if(!o){e.warnings.push(`dropped, expected a link: "${n.slice(r).join("")}"`);break}r=x9(n,o.next);let a=Nsr(n,r,e);if(!a){e.warnings.push(`dropped, link has no target: "${t}"`);break}r=a.next;for(let c of s)for(let u of a.group){let l=o.left==="arrow"&&o.right!=="arrow";if(!e.pushEdge({from:l?u:c,to:l?c:u,label:o.label,headTo:l?"arrow":o.right,headFrom:l?o.right:o.left,line:o.line}))return}s=a.group}}function Nsr(t,e,n){let r=Dsr(t,e,n);if(!r)return null;let i=[r.index],s=r.next;for(;;){let o=x9(t,s);if(t[o]!=="&")break;let a=Dsr(t,o+1,n);if(!a)return null;i.push(a.index),s=a.next}return{group:i,next:s}}function x9(t,e){for(;ec+3&&t[u-1]==="-";)u--;u>c+3&&(c=u)}return{index:a,next:c}}function zAs(t,e){let n=t[e],r=t[e+1];return n==="["?r==="["?kk(t,e+2,"]]","rect"):r==="("?kk(t,e+2,")]","round"):kk(t,e+1,"]","rect"):n==="("?r==="("?kk(t,e+2,"))","round"):r==="["?kk(t,e+2,"])","round"):kk(t,e+1,")","round"):n==="{"?r==="{"?kk(t,e+2,"}}","diamond"):kk(t,e+1,"}","diamond"):n===">"?kk(t,e+1,"]","rect"):{shape:"rect",label:null,after:e}}function kk(t,e,n,r){let i=e;for(;t[i]===" "||t[i]===" ";)i++;let s=t[i]==='"',o=e,a="",c=!1;for(;o")?"arrow":"none";if(a==="none"){let c=Msr(t,n);c&&(a=c.head,n=c.next)}if(t[n]==="|"){n++;let c=n;for(;nc&&t[u]!=="<"){let l=t.slice(c,u).join(""),d=u;for(;u"))a="arrow";else{let h=Msr(t,u);h&&(a=h.head,u=h.next)}return o==="solid"&&(o=Psr(m)),{left:r,right:a,line:o,label:lG(Tk(l)),next:u}}}return{left:r,right:a,line:o,label:null,next:n}}function Psr(t){return t.includes("=")?"thick":t.includes(".")?"dotted":"solid"}function Msr(t,e){let n=t[e]==="o"?"circle":t[e]==="x"?"cross":null;if(n===null)return null;let r=t[e+1];return r===void 0||r===" "||r===" "||r==="|"||r==="&"||r===";"?{head:n,next:e+1}:null}function Gsr(t){let e=S9(t),n=C9(e);if(n===null||!n.startsWith("statediagram"))return null;let r=new vk,i=!1;for(let s of e.slice(1)){if(i){nM(s)==="end note"&&(i=!1);continue}s=$sr(s);let o=nM(ice(s));if(o==="direction")r.dir=BPe(cG(s)[1]??"");else if(o==="note")s.includes(":")||(i=!0);else if(o==="state"){if(JAs(s,r)===null)return null}else if(!["classdef","class","hide","scale","}","--"].includes(o)){if(s.includes("-->")){if(XAs(s,r)===null)return null}else if(ZAs(s,r)===null)return null}if(r.overCap)return null}return r.nodes.length===0?null:r}function JAs(t,e){let n=t.slice(5).trim().replace(/\{$/,"").trim();if(n==="")return!0;if(n.startsWith('"')){let a=n.indexOf('"',1);if(a===-1)return null;let c=n.slice(1,a),u=n.slice(a+1).trim(),l=u.startsWith("as")?u.slice(2).trim():c;return e.nodeLabel(l,r_(c))===null?null:!0}let r="round",i=n,s=!1,o=n.indexOf("<<");return o!==-1&&(n.slice(o+2).replace(/>>$/,"").trim()==="choice"&&(r="diamond"),i=n.slice(0,o).trim(),s=!0),i===""||/\s/.test(i)||e.nodeIndex(i,s?i:null,r)===null?null:!0}function XAs(t,e){let n=t,r=null;for(;;){let i=FS(n,"-->");if(!i)break;let[s,o]=i,a=s.trimEnd().replace(/-+$/,"").trim(),c;if(r!==null){if(a!=="")return null;c=r}else{if(a==="")return null;let y=Osr(e,a,!0);if(y===null)return null;c=y}let u=o.indexOf("-->"),l=u===-1?o:o.slice(0,u),d=u===-1?"":o.slice(u),m=FS(l,":"),h=m?m[0]:l,f=m?lG(r_(m[1].trim())):null,g=h.trimStart().replace(/^>+/,"").trimEnd().replace(/-+$/,"").trim();if(g==="")return null;let A=Osr(e,g,!1);if(A===null)return null;if(!e.pushEdge({from:c,to:A,label:f,headTo:"arrow",headFrom:"none",line:"solid"}))return!0;r=A,n=d}return!0}function $sr(t){let e=[...t],n=[];for(let r=0;rr+3&&e[i-1]==="-";)i--;if(i>r+3){r=i;continue}}n.push(e[r]),r++}return n.join("")}function Osr(t,e,n){return e==="[*]"?t.nodeIndex(n?"[*]start":"[*]end","\u25CF","round"):t.nodeIndex(e,null,"round")}function ZAs(t,e){let n=FS(t,":");if(n){let r=n[0].trim(),i=n[1].trim();return r===""||/\s/.test(r)||i===""||e.nodeLabel(r,r_(i))===null?null:!0}return/\s/.test(t)||e.nodeIndex(t,null,"round")===null?null:!0}function Wsr(t){let e=S9(t),n=C9(e);if(n===null||!n.startsWith("classdiagram"))return null;let r=new vk,i=[],s=()=>{for(;i.length{let u=r.nodeIndex(c,null,"rect");return s(),u},a=null;for(let c of e.slice(1)){if(a!==null){c==="}"?a=null:Lsr(i[a],c);continue}c=$sr(c);let u=nM(ice(c));if(u==="direction"){r.dir=BPe(cG(c)[1]??"");continue}if(["note","callback","click","link","style","cssclass","classdef","namespace","}"].includes(u))continue;if(u==="class"){let m=c.slice(5).trim(),h=m.endsWith("{"),f=h?m.slice(0,-1).trim():m;if(f===""||/\s/.test(f))return null;let g=o(f);if(g===null)return null;h&&(a=g);continue}if(c.startsWith("<<")){let m=FS(c.slice(2),">>");if(!m)return null;let h=m[1].trim();if(h===""||/\s/.test(h))return null;let f=o(h);if(f===null)return null;i[f].annotation=m[0].trim();continue}let l=nys(c);if(l){let m=o(l.from);if(m===null)return null;let h=o(l.to);if(h===null||r.edges.length>=rM)return null;r.edges.push({from:m,to:h,label:l.label,headTo:l.headTo,headFrom:l.headFrom,line:l.line});continue}let d=FS(c,":");if(d){let m=d[0].trim(),h=d[1].trim();if(m===""||/\s/.test(m)||h==="")return null;let f=o(m);if(f===null)return null;Lsr(i[f],h);continue}return null}return r.nodes.length===0?null:(s(),{graph:r,infos:i})}function Lsr(t,e){if(e.startsWith("<<")){let i=FS(e.slice(2),">>");i&&(t.annotation=i[0].trim());return}let n=r_(sys(e.trim())),r=n.includes("(")?t.methods:t.attrs;r.length0&&y9(e[h-1]))continue;let _=e[h+[...g].length];if(!(g.endsWith("o")&&_!==void 0&&y9(_))){n={pos:h,op:g,headFrom:A,headTo:y,line:E};break e}}}if(!n)return null;let r=e.slice(0,n.pos).join("").trim(),i=e.slice(n.pos+[...n.op].length).join("").trim(),[s,o]=rys(r),[a,c]=iys(i),u=FS(a,":"),l=(u?u[0]:a).trim(),d=u?lG(r_(u[1].trim())):null;if(s===""||l===""||/\s/.test(s)||/\s/.test(l))return null;let m=lG([o,d??"",c].filter(h=>h!=="").join(" "));return{from:s,to:l,headFrom:n.headFrom,headTo:n.headTo,line:n.line,label:m}}function rys(t){let e=t.trimEnd();if(e.endsWith('"')){let n=e.slice(0,-1),r=n.lastIndexOf('"');if(r!==-1)return[n.slice(0,r).trimEnd(),n.slice(r+1)]}return[e,""]}function iys(t){let e=t.trimStart();if(e.startsWith('"')){let n=e.slice(1),r=n.indexOf('"');if(r!==-1)return[n.slice(r+1).trimStart(),n.slice(0,r)]}return[e,""]}function sys(t){let e="",n=!1;for(let r of t)r==="~"?(e+=n?">":"<",n=!n):e+=r;return e}function Hsr(t){let e=S9(t);if(C9(e)!=="erdiagram")return null;let n=new vk,r=[],i=null;for(let s of e.slice(1)){if(i!==null){s==="}"?i=null:cys(r[i],s);continue}let o=oys(s);if(o){let l=cG(o.rel);if(l.length!==3)return null;let d=qsr(l[1]);if(!d)return null;let m=Lbt(n,r,l[0]);if(m===null)return null;let h=Lbt(n,r,l[2]);if(h===null||n.edges.length>=rM)return null;let f=o.label===null?"":Tk(o.label);n.edges.push({from:m,to:h,label:lG([d.cardL,f,d.cardR].filter(g=>g!=="").join(" ")),headTo:"none",headFrom:"none",line:d.line});continue}let a=s.endsWith("{"),c=a?s.slice(0,-1).trim():s;if(c===""||cG(c).length!==1)return null;let u=Lbt(n,r,c);if(u===null)return null;a&&(i=u)}if(n.nodes.length===0)return null;for(;r.lengthqsr(i)!==null)?{rel:n,label:r}:null}function qsr(t){if(t.length!==6||!ays(t))return null;let e=t.slice(2,4),n=e==="--"?"solid":e===".."?"dotted":null;if(n===null)return null;let r=Fsr(t.slice(0,2)),i=Fsr(t.slice(4,6));return r===null||i===null?null:{cardL:r,cardR:i,line:n}}function Fsr(t){switch(t){case"|o":case"o|":return"0..1";case"||":return"1";case"}o":case"o{":return"0..*";case"}|":case"|{":return"1..*";default:return null}}function cys(t,e){let n=[];for(let i of cG(e)){if(i.startsWith('"'))break;n.push(i)}if(n.length===0)return;let r=r_(n.join(" "));t.attrs.length=rM)return null;n.items.push({kind:"note",anchor:d.anchor,text:d.text});continue}if(["loop","alt","opt","par","critical","break","else","and","option"].includes(c)){if(["else","and","option"].includes(c)){if(s.at(-1)!==!0)continue}else s.push(!0);if(n.items.length>=rM)return null;n.items.push({kind:"divider",text:r_(o)});continue}if(c==="rect"||c==="box"){s.push(!1);continue}if(c==="end"){if(s.pop()===!0){if(n.items.length>=rM)return null;n.items.push({kind:"divider",text:"end"})}continue}let u=pys(o,n);if(!u)return null;let l=u.text;if(r&&(i++,l=l===null?`${i}.`:`${i}. ${l}`),n.items.length>=rM)return null;n.items.push({kind:"message",from:u.from,to:u.to,text:l,dashed:u.dashed,head:u.head})}return n.labels.length===0?null:n}function dys(t,e){let n=nM(t),r,i;if(n.startsWith("over "))r="over",i=t.slice(5);else if(n.startsWith("left of "))r="left",i=t.slice(8);else if(n.startsWith("right of "))r="right",i=t.slice(9);else return null;let s=FS(i,":");if(!s)return null;let o=r_(s[1].trim()),a=s[0].split(",").map(l=>l.trim()).filter(l=>l!=="");if(a.length===0)return null;let c=e.participant(a[0],null);if(c===null)return null;if(r!=="over")return{text:o,anchor:{kind:r,at:c}};let u=c;if(a[1]!==void 0){let l=e.participant(a[1],null);if(l===null)return null;u=l}return{text:o,anchor:{kind:"over",from:Math.min(c,u),to:Math.max(c,u)}}}function pys(t,e){let n=[...t],r=null;e:for(let d=0;d{p();Rbt();E9();ice=t=>t.split(/\s+/).filter(e=>e!=="")[0]??"",cG=t=>t.split(/\s+/).filter(e=>e!=="");lG=t=>t===""?null:t;Obt=t=>t==="-"||t==="."||t==="="||t==="<"||t===">";eys=[["<|--","triangle","none","solid"],["--|>","none","triangle","solid"],["<|..","triangle","none","dotted"],["..|>","none","triangle","dotted"],["*--","diamondFill","none","solid"],["--*","none","diamondFill","solid"],["o--","diamondOpen","none","solid"],["--o","none","diamondOpen","solid"],["<--","arrow","none","solid"],["-->","none","arrow","solid"],["<..","arrow","none","dotted"],["..>","none","arrow","dotted"],["--","none","none","solid"],["..","none","none","dotted"]],tys=4;ays=t=>{for(let e=0;e127)return!1;return!0};lys=[["-->>",!0,"arrow"],["->>",!1,"arrow"],["--x",!0,"cross"],["-x",!1,"cross"],["--)",!0,"arrow"],["-)",!1,"arrow"],["-->",!0,"arrow"],["->",!1,"arrow"]],uys=4,Fbt=class{labels=[];index=new Map;items=[];participant(e,n){let r=this.index.get(e);return r!==void 0?(n!==null&&(this.labels[r]=n),r):this.labels.length>=vbt?null:(this.index.set(e,this.labels.length),this.labels.push(n??e),this.labels.length-1)}}});function zsr(t){if(t=psr(t),t.trim()==="")return null;let e=mys(t);return e===null?null:{...e.canvas.toLines(),warnings:e.warnings}}function mys(t){let e=Ysr(t);if(e!==null)return e;let n=t.replace(/\s+$/,""),r=n.lastIndexOf(` +`);if(r===-1)return null;let i=Ysr(n.slice(0,r));if(i===null)return null;let s=n.slice(r+1).trim();return{canvas:i.canvas,warnings:[...i.warnings,`dropped, unreadable final line: "${s}"`]}}function Ysr(t){let e=n=>n===null?null:{canvas:n,warnings:[]};switch(Qsr(t)){case"flowchart":{let n=Usr(t);if(n===null)return null;let r=n.groups.length===0?Nbt(n):Csr(n);return r===null?null:{canvas:r,warnings:n.warnings}}case"state":{let n=Gsr(t);return n===null?null:e(Nbt(n))}case"class":{let n=Wsr(t);return n===null?null:e(Dbt(n.graph,n.infos))}case"er":{let n=Hsr(t);return n===null?null:e(Dbt(n.graph,n.infos))}case"sequence":{let n=jsr(t);return n===null?null:e(Rsr(n))}default:return null}}var Ksr=v(()=>{p();E9();Pbt();ksr();Vsr()});function fys(t){return t.type==="code"&&t.lang?.trim().split(/\s+/,1)[0]?.toLowerCase()==="mermaid"}function Jsr(t){let e=t||"\xA0",n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),r="`".repeat(n+1),i=e.startsWith("`")||e.endsWith("`")?" ":"";return`${r}${i}${e}${i}${r}`}function gys(t,e){switch(t.cls){case"border":return e.fg("borderMuted",t.text);case"text":return e.fg("text",t.text);case"edge":return e.fg("accent",t.text);case"edgeLabel":return e.fg("muted",t.text);case"title":return e.fg("accent",e.bold(t.text));case"none":return t.text}}function Ays(t,e){return t.styled.map(n=>n.map(r=>gys(r,e)).join(""))}function Xsr(t){return(e,n)=>{let r=t.getMode();return r==="off"||n.messageType==="assistant-thinking"||n.isStreaming&&r!=="streaming"?e:hys.lexer(e).map(i=>{if(!fys(i))return i.raw;let s=zsr(i.text);if(!s||s.width>n.availableWidth)return i.raw;if(!n.isStreaming&&s.warnings.length>0){let a=s.warnings.length>1?` (+${s.warnings.length-1} more)`:"",c=`Mermaid diagram not rendered: ${s.warnings[0]}${a}`,u=t.theme?t.theme.fg("warning",c):c;return`${i.raw} +${Jsr(u)} +`}return`${(t.theme?Ays(s,t.theme):s.plain).map(Jsr).join(` `)} -`}).join("")}}p();p();var dat=class{activeByRuntime=new WeakMap;refresh(e,n){n.throwIfAborted();let r=this.activeByRuntime.get(e);if(!r){let s=new AbortController,i,o=e.refresh({signal:s.signal}),a=lI(o,s.signal).finally(()=>{this.activeByRuntime.get(e)===i&&this.activeByRuntime.delete(e)});i={controller:s,promise:a,waiters:0},r=i,this.activeByRuntime.set(e,r)}return r.waiters++,lI(r.promise,n).finally(()=>{r.waiters--,r.waiters===0&&this.activeByRuntime.get(e)===r&&r.controller.abort()})}},lGs=new dat;function IV(t,e){return lGs.refresh(t,e)}p();function ETe(t){let{id:e,provider:n}=t,r=t.name?` ${t.name}`:"";return`${e} ${n} ${n}/${e} ${n} ${e}${r}`}function PMn(t){let{id:e,provider:n}=t,r=t.name?` ${t.name}`:"";return`${n} ${n}/${e} ${n} ${e}${r}`}var UF=class extends _n{searchInput;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}listContainer;allModels=[];scopedModelItems=[];activeModels=[];filteredModels=[];selectedIndex=0;currentModel;modelRuntime;onSelectCallback;onSelectAsDefaultCallback;onCancelCallback;errorMessage;refreshStatusMessage="Refreshing model catalogs\u2026";refreshStatusSuccess=!1;tui;scopedModels;defaultModel;scope="all";scopeText;scopeHintText;refreshAbortController=new AbortController;refreshTimeout;closed=!1;constructor(e,n,r,s,i,o,a,c,u){if(super(),this.tui=e,this.currentModel=n,this.modelRuntime=r,this.scopedModels=s,this.defaultModel=u,this.scope=s.length>0?"scoped":"all",this.onSelectCallback=i,this.onSelectAsDefaultCallback=c,this.onCancelCallback=o,this.addChild(new Ln),this.addChild(new Nt(1)),s.length>0)this.scopeText=new yt(this.getScopeText(),0,0),this.addChild(this.scopeText),this.scopeHintText=new yt(this.getScopeHintText(),0,0),this.addChild(this.scopeHintText);else{let l="Only showing models from configured providers. Use /login to add providers.";this.addChild(new yt(Se.fg("warning",l),0,0))}this.addChild(new Nt(1)),this.searchInput=new jo,a&&this.searchInput.setValue(a),this.searchInput.onSubmit=()=>{this.filteredModels[this.selectedIndex]&&this.handleSelect(this.filteredModels[this.selectedIndex].model)},this.addChild(this.searchInput),this.addChild(new Nt(1)),this.listContainer=new _n,this.addChild(this.listContainer),this.addChild(new Nt(1)),this.onSelectAsDefaultCallback&&this.addChild(new yt(Se.fg("dim",` ${oc("tui.select.confirm")} to select \xB7 ${oc("app.models.save")} to set as default \xB7 ${oc("tui.select.cancel")} to cancel`),0,0)),this.addChild(new Ln),this.loadModelsFromSnapshot(),a?this.filterModels(a):this.updateList(),this.tui.requestRender(),this.refreshModels()}loadModelsFromSnapshot(){let e=this.modelRuntime.getAvailableSnapshot().map(r=>({provider:r.provider,id:r.id,model:r}));this.allModels=this.sortModels(e),this.scopedModels=this.scopedModels.map(r=>{let s=this.modelRuntime.getModel(r.model.provider,r.model.id);return s?{...r,model:s}:r}),this.scopedModelItems=this.scopedModels.map(r=>({provider:r.model.provider,id:r.model.id,model:r.model})),this.activeModels=this.scope==="scoped"?this.scopedModelItems:this.allModels,this.filteredModels=this.activeModels;let n=this.filteredModels.findIndex(r=>cd(this.currentModel,r.model));this.selectedIndex=n>=0?n:Math.min(this.selectedIndex,Math.max(0,this.filteredModels.length-1))}async refreshModels(){let n=!1;this.refreshTimeout=setTimeout(()=>{n=!0,this.refreshAbortController.abort()},15e3);try{let r=await IV(this.modelRuntime,this.refreshAbortController.signal);if(this.closed)return;this.refreshStatusMessage="",r.aborted&&n?this.errorMessage="Model refresh timed out; showing cached models.":r.errors.size===1?this.errorMessage=`Could not refresh ${r.errors.keys().next().value}; showing cached models.`:r.errors.size>1?this.errorMessage=`Could not refresh ${r.errors.size} model catalogs (${[...r.errors.keys()].join(", ")}); showing cached models.`:(this.errorMessage=this.modelRuntime.getError(),this.errorMessage||(this.refreshStatusMessage="Model catalogs refreshed.",this.refreshStatusSuccess=!0)),this.loadModelsFromSnapshot(),this.filterModels(this.searchInput.getValue()),this.tui.requestRender()}catch(r){if(this.closed)return;this.refreshStatusMessage="",this.errorMessage=n?"Model refresh timed out; showing cached models.":`Could not refresh model catalogs: ${r instanceof Error?r.message:String(r)}`,this.updateList(),this.tui.requestRender()}finally{this.refreshTimeout&&clearTimeout(this.refreshTimeout)}}dispose(){this.closed||(this.closed=!0,this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.refreshAbortController.abort())}sortModels(e){let n=[...e];return n.sort((r,s)=>{let i=cd(this.currentModel,r.model),o=cd(this.currentModel,s.model);if(i&&!o)return-1;if(!i&&o)return 1;let a=this.isDefaultModel(r.model),c=this.isDefaultModel(s.model);return a&&!c?-1:!a&&c?1:r.provider.localeCompare(s.provider)}),n}getScopeText(){let e=this.scope==="all"?Se.fg("accent","all"):Se.fg("muted","all"),n=this.scope==="scoped"?Se.fg("accent","scoped"):Se.fg("muted","scoped");return`${Se.fg("muted","Scope: ")}${e}${Se.fg("muted"," | ")}${n}`}getScopeHintText(){return er("tui.input.tab","scope")+Se.fg("muted"," (all/scoped)")}isDefaultModel(e){return this.defaultModel?.provider===e.provider&&this.defaultModel.id===e.id}isDefaultSearch(e){let n=e.trim().toLowerCase();return n.length>0&&"default".startsWith(n)}setScope(e){if(this.scope===e)return;this.scope=e,this.activeModels=this.scope==="scoped"?this.scopedModelItems:this.allModels;let n=this.activeModels.findIndex(r=>cd(this.currentModel,r.model));this.selectedIndex=n>=0?n:0,this.filterModels(this.searchInput.getValue()),this.scopeText&&this.scopeText.setText(this.getScopeText())}filterModels(e){if(e){let n=Wl(this.activeModels,e,r=>{let s=this.isDefaultModel(r.model)?" default":"";return`${PMn({id:r.id,provider:r.provider,name:r.model.name})}${s}`});if(this.isDefaultSearch(e)){let r=this.activeModels.filter(i=>this.isDefaultModel(i.model)),s=new Set(r.map(i=>`${i.provider}\0${i.id}`));this.filteredModels=[...r,...n.filter(i=>!s.has(`${i.provider}\0${i.id}`))]}else this.filteredModels=n}else this.filteredModels=this.activeModels;this.selectedIndex=e?0:Math.min(this.selectedIndex,Math.max(0,this.filteredModels.length-1)),this.updateList()}updateList(){this.listContainer.clear();let e=10,n=Math.max(0,Math.min(this.selectedIndex-Math.floor(e/2),this.filteredModels.length-e)),r=Math.min(n+e,this.filteredModels.length);for(let s=n;s0||r0){let r=this.scope==="all"?"scoped":"all";this.setScope(r),this.scopeHintText&&this.scopeHintText.setText(this.getScopeHintText())}return}if(n.matches(e,"tui.select.up")){if(this.filteredModels.length===0)return;this.selectedIndex=this.selectedIndex===0?this.filteredModels.length-1:this.selectedIndex-1,this.updateList()}else if(n.matches(e,"tui.select.down")){if(this.filteredModels.length===0)return;this.selectedIndex=this.selectedIndex===this.filteredModels.length-1?0:this.selectedIndex+1,this.updateList()}else if(n.matches(e,"tui.select.confirm")){let r=this.filteredModels[this.selectedIndex];r&&this.handleSelect(r.model)}else if(n.matches(e,"tui.select.cancel"))this.dispose(),this.onCancelCallback();else if(n.matches(e,"app.models.save")&&this.onSelectAsDefaultCallback){let r=this.filteredModels[this.selectedIndex];r&&(this.dispose(),this.onSelectAsDefaultCallback(r.model))}else this.searchInput.handleInput(e),this.filterModels(this.searchInput.getValue())}handleSelect(e){this.dispose(),this.onSelectCallback(e)}getSearchInput(){return this.searchInput}};p();function bTe(t){return t==="oauth"?"subscription":"API key"}var r1=class extends _n{searchInput;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}listContainer;allProviders;filteredProviders;selectedIndex=0;mode;onSelectCallback;onCancelCallback;showAuthTypeLabels;constructor(e,n,r,s,i){super(),this.mode=e,this.allProviders=n,this.filteredProviders=n,this.showAuthTypeLabels=new Set(n.map(a=>a.authType)).size>1,this.onSelectCallback=r,this.onCancelCallback=s,this.addChild(new Ln),this.addChild(new Nt(1));let o=e==="login"?"Select provider to configure:":"Select provider to logout:";this.addChild(new zA(Se.fg("accent",Se.bold(o)),1,0)),this.addChild(new Nt(1)),this.searchInput=new jo,i&&this.searchInput.setValue(i),this.searchInput.onSubmit=()=>{let a=this.filteredProviders[this.selectedIndex];a&&this.onSelectCallback(a.id,a.authType)},this.addChild(this.searchInput),this.addChild(new Nt(1)),this.listContainer=new _n,this.addChild(this.listContainer),this.addChild(new Nt(1)),this.addChild(new Ln),this.filterProviders(i??"")}filterProviders(e){this.filteredProviders=e?Wl(this.allProviders,e,n=>`${n.name} ${n.id} ${n.authType} ${n.method?.name??""}`):this.allProviders,this.selectedIndex=Math.max(0,Math.min(this.selectedIndex,Math.max(0,this.filteredProviders.length-1))),this.updateList()}updateList(){this.listContainer.clear();let e=8,n=Math.max(0,Math.min(this.selectedIndex-Math.floor(e/2),this.filteredProviders.length-e)),r=Math.min(n+e,this.filteredProviders.length);for(let s=n;s0||re.includes(n))?null:t}function uGs(t,e,n){if(t===null)return e.filter(s=>s!==n);let r=t.indexOf(n);return r>=0?[...t.slice(0,r),...t.slice(r+1)]:LMn([...t,n],e)}function OMn(t,e,n){if(t===null)return null;let r=n??e,s=[...t];for(let i of r)s.includes(i)||s.push(i);return LMn(s,e)}function MMn(t,e,n){if(t===null)return n?e.filter(s=>!n.includes(s)):[];let r=new Set(n??t);return t.filter(s=>!r.has(s))}function dGs(t,e,n){if(t===null)return null;let r=[...t],s=r.indexOf(e);if(s<0)return r;let i=s+n;if(i<0||i>=r.length)return r;let o=[...r];return[o[s],o[i]]=[o[i],o[s]],o}function pGs(t,e){if(t===null)return e;let n=new Set(t);return[...t,...e.filter(r=>!n.has(r))]}var Ene=class extends _n{modelsById=new Map;allIds=[];enabledIds=null;filteredItems=[];selectedIndex=0;searchInput;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}listContainer;footerText;callbacks;maxVisible=8;isDirty=!1;refreshStatusText;constructor(e,n){super(),this.callbacks=n;for(let r of e.allModels){let s=`${r.provider}/${r.id}`;this.modelsById.set(s,r),this.allIds.push(s)}this.enabledIds=e.enabledModelIds===null?null:[...e.enabledModelIds],this.filteredItems=this.buildItems(),this.addChild(new Ln),this.addChild(new Nt(1)),this.addChild(new yt(Se.fg("accent",Se.bold("Model Configuration")),0,0)),this.addChild(new yt(Se.fg("muted",`Session-only. ${oc("app.models.save")} to save to settings.`),0,0)),this.addChild(new Nt(1)),this.searchInput=new jo,this.addChild(this.searchInput),this.addChild(new Nt(1)),this.listContainer=new _n,this.addChild(this.listContainer),this.addChild(new Nt(1)),e.refreshStatus&&(this.refreshStatusText=new yt(Se.fg("muted",` ${e.refreshStatus}`),0,0),this.addChild(this.refreshStatusText)),this.footerText=new yt(this.getFooterText(),0,0),this.addChild(this.footerText),this.addChild(new Ln),this.updateList()}updateModels(e,n){let r=this.filteredItems[this.selectedIndex]?.fullId;n!==void 0&&(this.enabledIds=n===null?null:[...n]),this.modelsById.clear(),this.allIds=[];for(let i of e){let o=`${i.provider}/${i.id}`;this.modelsById.set(o,i),this.allIds.push(o)}this.refresh();let s=r?this.filteredItems.findIndex(i=>i.fullId===r):-1;s>=0&&(this.selectedIndex=s,this.updateList())}setRefreshStatus(e,n){this.refreshStatusText?.setText(Se.fg(n,` ${e}`))}buildItems(){return pGs(this.enabledIds,this.allIds).map(e=>({fullId:e,model:this.modelsById.get(e),enabled:pat(this.enabledIds,e)}))}getFooterText(){let e=this.enabledIds?.filter(o=>this.modelsById.has(o)).length??this.allIds.length,n=this.enabledIds?.filter(o=>!this.modelsById.has(o)).length??0,s=this.enabledIds===null?"all enabled":`${e}/${this.allIds.length} enabled${n?` \xB7 ${n} unavailable`:""}`,i=[`${oc("tui.select.confirm")} toggle`,`${oc("app.models.enableAll")} all`,`${oc("app.models.clearAll")} clear`,`${oc("app.models.toggleProvider")} provider`,`${oc("app.models.reorderUp")}/${oc("app.models.reorderDown")} reorder`,`${oc("app.models.save")} save`,s];return this.isDirty?Se.fg("dim",` ${i.join(" \xB7 ")} `)+Se.fg("warning","(unsaved)"):Se.fg("dim",` ${i.join(" \xB7 ")}`)}refresh(){let e=this.searchInput.getValue(),n=this.buildItems();this.filteredItems=e?Wl(n,e,r=>r.model?ETe({id:r.model.id,provider:r.model.provider,name:r.model.name}):r.fullId):n,this.selectedIndex=Math.min(this.selectedIndex,Math.max(0,this.filteredItems.length-1)),this.updateList(),this.footerText.setText(this.getFooterText())}notifyChange(){this.callbacks.onChange(this.enabledIds===null?null:[...this.enabledIds])}updateList(){if(this.listContainer.clear(),this.filteredItems.length===0){this.listContainer.addChild(new yt(Se.fg("muted"," No matching models"),0,0));return}let e=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredItems.length-this.maxVisible)),n=Math.min(e+this.maxVisible,this.filteredItems.length);for(let r=e;r0||n0){let r=this.filteredItems[this.selectedIndex];this.listContainer.addChild(new Nt(1)),this.listContainer.addChild(new yt(Se.fg("muted",` ${r.model?`Model Name: ${r.model.name}`:"Model unavailable"}`),0,0))}}handleInput(e){let n=ms();if(n.matches(e,"tui.select.up")){if(this.filteredItems.length===0)return;this.selectedIndex=this.selectedIndex===0?this.filteredItems.length-1:this.selectedIndex-1,this.updateList();return}if(n.matches(e,"tui.select.down")){if(this.filteredItems.length===0)return;this.selectedIndex=this.selectedIndex===this.filteredItems.length-1?0:this.selectedIndex+1,this.updateList();return}let r=n.matches(e,"app.models.reorderUp"),s=n.matches(e,"app.models.reorderDown");if(r||s){if(this.enabledIds===null)return;let i=this.filteredItems[this.selectedIndex];if(i&&pat(this.enabledIds,i.fullId)){let o=r?-1:1,c=this.enabledIds.indexOf(i.fullId)+o;c>=0&&co.fullId):void 0;this.enabledIds=OMn(this.enabledIds,this.allIds,i),this.isDirty=!0,this.refresh(),this.notifyChange();return}if(n.matches(e,"app.models.clearAll")){let i=this.searchInput.getValue()?this.filteredItems.map(o=>o.fullId):void 0;this.enabledIds=MMn(this.enabledIds,this.allIds,i),this.isDirty=!0,this.refresh(),this.notifyChange();return}if(n.matches(e,"app.models.toggleProvider")){let i=this.filteredItems[this.selectedIndex];if(i?.model){let o=i.model.provider,a=this.allIds.filter(u=>this.modelsById.get(u).provider===o),c=a.every(u=>pat(this.enabledIds,u));this.enabledIds=c?MMn(this.enabledIds,this.allIds,a):OMn(this.enabledIds,this.allIds,a),this.isDirty=!0,this.refresh(),this.notifyChange()}return}if(n.matches(e,"app.models.save")){this.callbacks.onPersist(this.enabledIds===null?null:[...this.enabledIds]),this.isDirty=!1,this.footerText.setText(this.getFooterText());return}if(ip(e,mX.ctrl("c"))){this.searchInput.getValue()?(this.searchInput.setValue(""),this.refresh()):this.callbacks.onCancel();return}if(ip(e,mX.escape)){this.callbacks.onCancel();return}this.searchInput.handleInput(e),this.refresh()}getSearchInput(){return this.searchInput}};p();p();var hGs={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},xV=class extends _n{selectList;listChildIndex;allOptions;listLayout;searchInput;onSelectCb;onCancelCb;onSelectionChangeCb;constructor(e,n,r,s,i,o,a,c){super(),this.allOptions=r,this.listLayout=c?.layout??hGs,this.onSelectCb=i,this.onCancelCb=o,this.onSelectionChangeCb=a,this.addChild(new yt(Se.bold(Se.fg("accent",e)),0,0)),n&&(this.addChild(new Nt(1)),this.addChild(new yt(Se.fg("muted",n),0,0))),c?.searchable&&(this.addChild(new Nt(1)),this.searchInput=new jo,this.searchInput.onSubmit=()=>{this.selectList.handleInput("\r")},this.addChild(this.searchInput)),this.addChild(new Nt(1)),this.selectList=this.buildSelectList(r,s),this.listChildIndex=this.children.length,this.addChild(this.selectList),this.addChild(new Nt(1));let u=c?.searchable?" Type to filter \xB7 Enter to select \xB7 Esc to go back":" Enter to select \xB7 Esc to go back";this.addChild(new yt(Se.fg("dim",u),0,0))}buildSelectList(e,n){let r=new Xp(e,Math.min(e.length,10),p0(),this.listLayout),s=e.findIndex(i=>i.value===n);if(s!==-1&&r.setSelectedIndex(s),r.onSelect=i=>this.onSelectCb(i.value),r.onCancel=this.onCancelCb,this.onSelectionChangeCb){let i=this.onSelectionChangeCb;r.onSelectionChange=o=>i(o.value)}return r}applyFilter(e){let n=e?Wl(this.allOptions,e,s=>`${s.label} ${s.description??""}`):this.allOptions,r=this.buildSelectList(n,"");this.children[this.listChildIndex]=r,this.selectList=r}handleInput(e){if(this.searchInput){let n=ms();n.matches(e,"tui.select.up")||n.matches(e,"tui.select.down")||n.matches(e,"tui.select.confirm")||n.matches(e,"tui.select.cancel")?this.selectList.handleInput(e):(this.searchInput.handleInput(e),this.applyFilter(this.searchInput.getValue()))}else this.selectList.handleInput(e)}},_Te=class extends _n{steps;onComplete;onCancel;opts;activeComponent;context;constructor(e,n,r,s={}){super(),this.steps=e,this.onComplete=n,this.onCancel=r,this.opts=s,this.context={...s.initialContext??{}},this.activeComponent=this.buildStep(s.startAtStep??0)}buildStep(e){let n=this.steps[e],r=this.steps.length,s=r>1?`Step ${e+1}/${r} \xB7 `:"",i=typeof n.title=="function"?n.title(this.context):n.title,o=typeof n.description=="function"?n.description(this.context):n.description,a=n.options(this.context),c=n.preselect?.(this.context)??"";return new xV(i,`${s}${o}`,a,c,u=>{this.context[n.key]=u,e{e>0?(delete this.context[n.key],this.activeComponent=this.buildStep(e-1)):this.onCancel()},void 0,n.searchable||n.layout?{searchable:n.searchable,layout:n.layout}:void 0)}render(e){return this.activeComponent.render(e)}handleInput(e){this.activeComponent.handleInput?.(e)}invalidate(){this.activeComponent.invalidate?.()}};var mGs={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:46},fGs={off:"No reasoning",minimal:"Very brief reasoning (~1k tokens)",low:"Light reasoning (~2k tokens)",medium:"Moderate reasoning (~8k tokens)",high:"Deep reasoning (~16k tokens)",xhigh:"Extra-high reasoning (~32k tokens)",max:"Maximum reasoning"},hat={ask:"Ask",always:"Always trust",never:"Never trust"},gGs=new Map(Object.entries(hat).map(([t,e])=>[e,t])),mat=class extends _n{settingsList;state;constructor(e,n,r){super(),this.state={...e};let s=[{id:"anthropic-extra-usage",label:"Anthropic extra usage",description:"Warn when Anthropic subscription auth may use paid extra usage",currentValue:this.state.anthropicExtraUsage??!0?"true":"false",values:["true","false"]}];this.settingsList=new ON(s,Math.min(s.length,10),OH(),(i,o)=>{i==="anthropic-extra-usage"&&(this.state={...this.state,anthropicExtraUsage:o==="true"},n({...this.state}))},r),this.addChild(this.settingsList)}handleInput(e){this.settingsList.handleInput(e)}},FMn="__clear__";function bne(t){return`${t.provider}/${t.id}`}function AGs(t){return`${t.id} [${t.provider}]`}function QMn(t){let e=Object.keys(t).length;return e===0?"none":`${e} configured`}function yGs(t){return`${t.id} ${Se.fg("muted",`[${t.provider}]`)}`}function UMn(t,e){return t.map(n=>({value:n,label:`${n===e?"\u2713 ":" "}${n}`}))}var fat="/";function EGs(t,e){return[{value:fat,label:" Automatic",description:"Use separate themes for light and dark terminal appearance"},...UMn(t,e)]}function $Mn(t,e,n){return e&&t.includes(e)?e:t.includes(n)?n:t[0]??n}function bGs(t,e){let n=rT(t);if(n)return n;let r=t.includes("/")?void 0:t,s=$Mn(e,r,"dark");return{lightTheme:s,darkTheme:s}}var gat=class extends _n{inputComponent;callbacks;availableThemes;terminalTheme;onDone;originalThemeSetting;mode;singleTheme;lightTheme;darkTheme;constructor(e,n,r,s,i){super(),this.callbacks=s,this.availableThemes=r,this.terminalTheme=n,this.onDone=i,this.originalThemeSetting=e;let o=rT(e),a=bGs(e,r),c=o||e.includes("/")?void 0:e;this.mode=o?"automatic":"single",this.lightTheme=a.lightTheme,this.darkTheme=a.darkTheme,this.singleTheme=$Mn(r,c??(o?this.getActiveAutomaticTheme():void 0),"dark"),this.mode==="automatic"?this.showAutomaticMenu():this.showSingleMenu()}handleInput(e){this.inputComponent?.handleInput?.(e)}setContent(e,n=e){this.clear(),this.addChild(e),this.inputComponent=n}showSingleMenu(){this.mode="single";let e=new xV("Theme","Select a theme, or choose Automatic to follow terminal appearance.",EGs(this.availableThemes,this.singleTheme),this.singleTheme,n=>{if(n===fat){this.mode="automatic",this.callbacks.onThemePreview?.(this.getThemeSetting()),this.showAutomaticMenu();return}this.singleTheme=n,this.apply(n)},()=>this.cancel(),n=>{this.callbacks.onThemePreview?.(n===fat?this.getAutomaticThemeSetting():n)});this.setContent(e)}showAutomaticMenu(){this.mode="automatic";let e=new _n;e.addChild(new yt(Se.bold(Se.fg("accent","Automatic Theme")),0,0)),e.addChild(new Nt(1)),e.addChild(new yt(Se.fg("muted","Choose themes for terminal light and dark appearance."),0,0)),e.addChild(new yt(Se.fg("muted","Light/dark detection requires terminal support."),0,0)),e.addChild(new Nt(1));let n=[{id:"light-theme",label:"Light theme",description:"Theme to use in automatic mode when the terminal is light",currentValue:this.lightTheme,submenu:(s,i)=>this.createThemeSelect("Light Theme","Select the theme to use for light terminal appearance",s,i,o=>{this.lightTheme=o,this.callbacks.onThemePreview?.(this.getThemeSetting()),i(o)})},{id:"dark-theme",label:"Dark theme",description:"Theme to use in automatic mode when the terminal is dark",currentValue:this.darkTheme,submenu:(s,i)=>this.createThemeSelect("Dark Theme","Select the theme to use for dark terminal appearance",s,i,o=>{this.darkTheme=o,this.callbacks.onThemePreview?.(this.getThemeSetting()),i(o)})},{id:"apply",label:"Apply",description:"Save and go back",currentValue:"save and go back",values:["save and go back"]},{id:"single-mode",label:"Change mode",description:"Switch to one theme for light and dark",currentValue:"switch to single theme",values:["switch to single theme"]}],r=new ON(n,Math.min(n.length,10),OH(),s=>{switch(s){case"single-mode":this.mode="single",this.singleTheme=this.getActiveAutomaticTheme(),this.callbacks.onThemePreview?.(this.singleTheme),this.showSingleMenu();break;case"apply":this.apply(this.getAutomaticThemeSetting());break}},()=>this.cancel());e.addChild(r),this.setContent(e,r)}createThemeSelect(e,n,r,s,i){return new xV(e,n,UMn(this.availableThemes,r),r,i,()=>{this.callbacks.onThemePreview?.(this.getThemeSetting()),s()},o=>this.callbacks.onThemePreview?.(o))}getThemeSetting(){return this.mode==="automatic"?this.getAutomaticThemeSetting():this.singleTheme}getActiveAutomaticTheme(){return this.terminalTheme==="light"?this.lightTheme:this.darkTheme}getAutomaticThemeSetting(){return`${this.lightTheme}/${this.darkTheme}`}apply(e){this.onDone(e)}cancel(){this.callbacks.onThemePreview?.(this.originalThemeSetting),this.onDone()}},$F=class extends _n{settingsList;constructor(e,n){super();let r=qc().images,s=oc("app.message.followUp"),i=oc("app.thinking.cycle"),o={...e.warnings},a={...e.modelThinkingLevels},c=new Map(e.availableDefaultModels.map(C=>[bne(C),C])),u=c.has(e.defaultModel)?e.defaultModel:void 0,l=e.currentModel?bne(e.currentModel):void 0,d=[{id:"autocompact",label:"Auto-compact",description:"Automatically compact context when it gets too large",currentValue:e.autoCompact?"true":"false",values:["true","false"]},{id:"steering-mode",label:"Steering mode",description:"Enter while streaming queues steering messages. 'one-at-a-time': deliver one, wait for response. 'all': deliver all at once.",currentValue:e.steeringMode,values:["one-at-a-time","all"]},{id:"follow-up-mode",label:"Follow-up mode",description:`${s} queues follow-up messages until agent stops. 'one-at-a-time': deliver one, wait for response. 'all': deliver all at once.`,currentValue:e.followUpMode,values:["one-at-a-time","all"]},{id:"transport",label:"Transport",description:"Preferred transport for providers that support multiple transports",currentValue:e.transport,values:["sse","websocket","websocket-cached","auto"]},{id:"http-idle-timeout",label:"HTTP idle timeout",description:"Maximum idle gap while waiting for HTTP headers or body chunks. Disable for local models that pause longer than five minutes.",currentValue:Gwe(e.httpIdleTimeoutMs),values:Uwe.map(C=>C.label)},{id:"hide-thinking",label:"Hide thinking",description:"Hide thinking blocks in assistant responses",currentValue:e.hideThinkingBlock?"true":"false",values:["true","false"]},{id:"mermaid-rendering",label:"Mermaid diagrams",description:"Render Mermaid code blocks as Unicode diagrams",currentValue:e.mermaidRenderingMode,values:["off","final","streaming"]},{id:"cache-miss-notices",label:"Cache miss notices",description:"Show transcript notices for cache costs and provider recovery diagnostics",currentValue:e.showCacheMissNotices?"true":"false",values:["true","false"]},{id:"collapse-changelog",label:"Collapse changelog",description:"Show condensed changelog after updates",currentValue:e.collapseChangelog?"true":"false",values:["true","false"]},{id:"quiet-startup",label:"Quiet startup",description:"Disable verbose printing at startup",currentValue:e.quietStartup?"true":"false",values:["true","false"]},{id:"install-telemetry",label:"Install telemetry",description:"Send an anonymous version/update ping after changelog-detected updates",currentValue:e.enableInstallTelemetry?"true":"false",values:["true","false"]},{id:"default-project-trust",label:"Default project trust",description:"Fallback behavior when no extension or saved trust decision decides project trust",currentValue:hat[e.defaultProjectTrust],values:Object.values(hat)},{id:"double-escape-action",label:"Double-escape action",description:"Action when pressing Escape twice with empty editor",currentValue:e.doubleEscapeAction,values:["tree","fork","none"]},{id:"tree-filter-mode",label:"Tree filter mode",description:"Default filter when opening /tree",currentValue:e.treeFilterMode,values:["default","no-tools","user-only","labeled-only","all"]},{id:"warnings",label:"Warnings",description:"Enable or disable individual warnings",currentValue:"configure",submenu:(C,I)=>new mat(o,x=>{o=x,n.onWarningsChange(x)},()=>I())},{id:"model-thinking",label:"Default thinking level per model",description:`Override the default thinking level for specific models. ${i} cycles in-session.`,currentValue:QMn(a),submenu:(C,I)=>{let x=[{key:"model",title:"Per-Model Thinking Level",description:"Select a model to configure",options:()=>{let N=[...e.availableDefaultModels].sort((P,G)=>{let $=bne(P),Q=bne(G);return $===l?-1:Q===l?1:$===u?-1:Q===u?1:P.provider.localeCompare(G.provider)}).map(P=>{let G=bne(P),$=a[G];return{value:G,label:yGs(P),description:$??void 0}});return N.length===0&&N.push({value:"__none__",label:"No models available",description:"Log in to a provider or configure an API key first"}),N},preselect:()=>l??u,searchable:!0,layout:mGs},{key:"level",title:R=>{let N=c.get(R.model);return`Thinking Level for ${N?AGs(N):R.model}`},description:"Select default thinking level for this model",options:R=>{let N=c.get(R.model);if(!N)return[];let P=N.reasoning?NR(N):["off"],G=a[R.model],$=P.map(Q=>({value:Q,label:`${Q===G?"\u2713 ":" "}${Q}`,description:fGs[Q]}));return a[R.model]!==void 0&&$.push({value:FMn,label:" (clear override)",description:`Revert to global default (${e.thinkingLevel})`}),$},preselect:R=>a[R.model]}],w=()=>QMn(a);return new _Te(x,R=>{let N=c.get(R.model);N&&(R.level===FMn?(n.onModelThinkingLevelRemove(N.provider,N.id),delete a[R.model]):(n.onModelThinkingLevelChange(N.provider,N.id,R.level),a[R.model]=R.level))},()=>{I(w())},{loop:!0})}},{id:"tui-mode",label:"TUI mode",description:"Interface layout; fullscreen mode is experimental",currentValue:e.tuiMode,values:["regular","fullscreen"]},{id:"fullscreen-exit-output",label:"Fullscreen exit output",description:"Print the transcript or only a session resume hint when exiting fullscreen mode",currentValue:e.fullscreenExitOutput,values:["transcript","resume-hint"]},{id:"fullscreen-scrollbar",label:"Fullscreen scrollbar",description:"Scrollbar behavior in fullscreen mode; has no effect in regular mode",currentValue:e.fullscreenScrollbar,values:["auto","always","hidden"]},{id:"fullscreen-copy-on-select",label:"Fullscreen copy on select",description:"Automatically copy selected text in fullscreen mode; disable to copy selections with Ctrl+X",currentValue:e.fullscreenCopyOnSelect?"true":"false",values:["true","false"]},{id:"theme",label:"Theme",description:"Color theme for the interface",currentValue:e.currentTheme,submenu:(C,I)=>new gat(C,e.terminalTheme,e.availableThemes,n,I)}];r&&(d.splice(1,0,{id:"show-images",label:"Show images",description:"Render images inline in terminal",currentValue:e.showImages?"true":"false",values:["true","false"]}),d.splice(2,0,{id:"image-width-cells",label:"Image width",description:"Preferred inline image width in terminal cells",currentValue:String(e.imageWidthCells),values:["60","80","120"]})),d.splice(r?3:1,0,{id:"auto-resize-images",label:"Auto-resize images",description:"Resize large images to 2000x2000 max for better model compatibility",currentValue:e.autoResizeImages?"true":"false",values:["true","false"]});let h=d.findIndex(C=>C.id==="auto-resize-images");d.splice(h+1,0,{id:"block-images",label:"Block images",description:"Prevent images from being sent to LLM providers",currentValue:e.blockImages?"true":"false",values:["true","false"]});let m=d.findIndex(C=>C.id==="block-images");d.splice(m+1,0,{id:"skill-commands",label:"Skill commands",description:"Register skills as /skill:name commands",currentValue:e.enableSkillCommands?"true":"false",values:["true","false"]});let f=d.findIndex(C=>C.id==="skill-commands");d.splice(f+1,0,{id:"show-hardware-cursor",label:"Show hardware cursor",description:"Show the terminal cursor while still positioning it for IME support",currentValue:e.showHardwareCursor?"true":"false",values:["true","false"]});let g=d.findIndex(C=>C.id==="show-hardware-cursor");d.splice(g+1,0,{id:"editor-padding",label:"Editor padding",description:"Horizontal padding for input editor (0-3)",currentValue:String(e.editorPaddingX),values:["0","1","2","3"]});let A=d.findIndex(C=>C.id==="editor-padding");d.splice(A+1,0,{id:"output-padding",label:"Output padding",description:"Horizontal padding for user messages, assistant messages, and thinking",currentValue:String(e.outputPad),values:["0","1"]});let y=d.findIndex(C=>C.id==="output-padding");d.splice(y+1,0,{id:"autocomplete-max-visible",label:"Autocomplete max items",description:"Max visible items in autocomplete dropdown (3-20)",currentValue:String(e.autocompleteMaxVisible),values:["3","5","7","10","15","20"]});let b=d.findIndex(C=>C.id==="autocomplete-max-visible");d.splice(b+1,0,{id:"clear-on-shrink",label:"Clear on shrink",description:"Clear empty rows when content shrinks (may cause flicker)",currentValue:e.clearOnShrink?"true":"false",values:["true","false"]});let S=d.findIndex(C=>C.id==="clear-on-shrink");d.splice(S+1,0,{id:"terminal-progress",label:"Terminal progress",description:"Show OSC 9;4 progress indicators in the terminal tab bar",currentValue:e.showTerminalProgress?"true":"false",values:["true","false"]}),this.addChild(new Ln),this.settingsList=new ON(d,10,OH(),(C,I)=>{switch(C){case"autocompact":n.onAutoCompactChange(I==="true");break;case"show-images":n.onShowImagesChange(I==="true");break;case"image-width-cells":n.onImageWidthCellsChange(parseInt(I,10));break;case"auto-resize-images":n.onAutoResizeImagesChange(I==="true");break;case"block-images":n.onBlockImagesChange(I==="true");break;case"skill-commands":n.onEnableSkillCommandsChange(I==="true");break;case"steering-mode":n.onSteeringModeChange(I);break;case"follow-up-mode":n.onFollowUpModeChange(I);break;case"transport":n.onTransportChange(I);break;case"http-idle-timeout":{let x=Uwe.find(w=>w.label===I);x&&n.onHttpIdleTimeoutMsChange(x.timeoutMs);break}case"hide-thinking":n.onHideThinkingBlockChange(I==="true");break;case"mermaid-rendering":n.onMermaidRenderingModeChange(I);break;case"cache-miss-notices":n.onShowCacheMissNoticesChange(I==="true");break;case"collapse-changelog":n.onCollapseChangelogChange(I==="true");break;case"quiet-startup":n.onQuietStartupChange(I==="true");break;case"install-telemetry":n.onEnableInstallTelemetryChange(I==="true");break;case"default-project-trust":{let x=gGs.get(I);x&&n.onDefaultProjectTrustChange(x);break}case"double-escape-action":n.onDoubleEscapeActionChange(I);break;case"tree-filter-mode":n.onTreeFilterModeChange(I);break;case"show-hardware-cursor":n.onShowHardwareCursorChange(I==="true");break;case"editor-padding":n.onEditorPaddingXChange(parseInt(I,10));break;case"output-padding":n.onOutputPadChange(I==="0"?0:1);break;case"autocomplete-max-visible":n.onAutocompleteMaxVisibleChange(parseInt(I,10));break;case"clear-on-shrink":n.onClearOnShrinkChange(I==="true");break;case"terminal-progress":n.onShowTerminalProgressChange(I==="true");break;case"tui-mode":n.onTuiModeChange(I);break;case"fullscreen-exit-output":n.onFullscreenExitOutputChange(I);break;case"fullscreen-scrollbar":n.onFullscreenScrollbarChange(I);break;case"fullscreen-copy-on-select":n.onFullscreenCopyOnSelectChange(I==="true");break;case"theme":n.onThemeChange(I);break}},n.onCancel,{enableSearch:!0}),this.addChild(this.settingsList),this.addChild(new Ln)}getSettingsList(){return this.settingsList}};p();var GF=class extends Vl{expanded=!1;skillBlock;markdownTheme;constructor(e,n=Fh()){super(1,1,r=>Se.bg("customMessageBg",r)),this.skillBlock=e,this.markdownTheme=n,this.updateDisplay()}setExpanded(e){this.expanded=e,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}updateDisplay(){if(this.clear(),this.expanded){let e=Se.fg("customMessageLabel","\x1B[1m[skill]\x1B[22m");this.addChild(new yt(e,0,0));let n=`**${this.skillBlock.name}** +`}).join("")}}var hys,Zsr=v(()=>{p();Tr();Ksr();hys=new WF});function I9(t,e){return yys.refresh(t,e)}var Qbt,yys,Ubt=v(()=>{p();eoe();Qbt=class{activeByRuntime=new WeakMap;refresh(e,n){n.throwIfAborted();let r=this.activeByRuntime.get(e);if(!r){let i=new AbortController,s,o=e.refresh({signal:i.signal}),a=vw(o,i.signal).finally(()=>{this.activeByRuntime.get(e)===s&&this.activeByRuntime.delete(e)});s={controller:i,promise:a,waiters:0},r=s,this.activeByRuntime.set(e,r)}return r.waiters++,vw(r.promise,n).finally(()=>{r.waiters--,r.waiters===0&&this.activeByRuntime.get(e)===r&&r.controller.abort()})}},yys=new Qbt});function PPe(t){let{id:e,provider:n}=t,r=t.name?` ${t.name}`:"";return`${e} ${n} ${n}/${e} ${n} ${e}${r}`}function eor(t){let{id:e,provider:n}=t,r=t.name?` ${t.name}`:"";return`${n} ${n}/${e} ${n} ${e}${r}`}var MPe=v(()=>{p()});var uG,Gbt=v(()=>{p();qo();Tr();Ubt();MPe();pi();Ll();ha();uG=class extends gn{searchInput;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}listContainer;allModels=[];scopedModelItems=[];activeModels=[];filteredModels=[];selectedIndex=0;currentModel;modelRuntime;onSelectCallback;onSelectAsDefaultCallback;onCancelCallback;errorMessage;refreshStatusMessage="Refreshing model catalogs\u2026";refreshStatusSuccess=!1;tui;scopedModels;defaultModel;scope="all";scopeText;scopeHintText;refreshAbortController=new AbortController;refreshTimeout;closed=!1;constructor(e,n,r,i,s,o,a,c,u){if(super(),this.tui=e,this.currentModel=n,this.modelRuntime=r,this.scopedModels=i,this.defaultModel=u,this.scope=i.length>0?"scoped":"all",this.onSelectCallback=s,this.onSelectAsDefaultCallback=c,this.onCancelCallback=o,this.addChild(new Un),this.addChild(new Tt(1)),i.length>0)this.scopeText=new Et(this.getScopeText(),0,0),this.addChild(this.scopeText),this.scopeHintText=new Et(this.getScopeHintText(),0,0),this.addChild(this.scopeHintText);else{let l="Only showing models from configured providers. Use /login to add providers.";this.addChild(new Et(Ee.fg("warning",l),0,0))}this.addChild(new Tt(1)),this.searchInput=new ma,a&&this.searchInput.setValue(a),this.searchInput.onSubmit=()=>{this.filteredModels[this.selectedIndex]&&this.handleSelect(this.filteredModels[this.selectedIndex].model)},this.addChild(this.searchInput),this.addChild(new Tt(1)),this.listContainer=new gn,this.addChild(this.listContainer),this.addChild(new Tt(1)),this.onSelectAsDefaultCallback&&this.addChild(new Et(Ee.fg("dim",` ${qc("tui.select.confirm")} to select \xB7 ${qc("app.models.save")} to set as default \xB7 ${qc("tui.select.cancel")} to cancel`),0,0)),this.addChild(new Un),this.loadModelsFromSnapshot(),a?this.filterModels(a):this.updateList(),this.tui.requestRender(),this.refreshModels()}loadModelsFromSnapshot(){let e=this.modelRuntime.getAvailableSnapshot().map(r=>({provider:r.provider,id:r.id,model:r}));this.allModels=this.sortModels(e),this.scopedModels=this.scopedModels.map(r=>{let i=this.modelRuntime.getModel(r.model.provider,r.model.id);return i?{...r,model:i}:r}),this.scopedModelItems=this.scopedModels.map(r=>({provider:r.model.provider,id:r.model.id,model:r.model})),this.activeModels=this.scope==="scoped"?this.scopedModelItems:this.allModels,this.filteredModels=this.activeModels;let n=this.filteredModels.findIndex(r=>Zd(this.currentModel,r.model));this.selectedIndex=n>=0?n:Math.min(this.selectedIndex,Math.max(0,this.filteredModels.length-1))}async refreshModels(){let n=!1;this.refreshTimeout=setTimeout(()=>{n=!0,this.refreshAbortController.abort()},15e3);try{let r=await I9(this.modelRuntime,this.refreshAbortController.signal);if(this.closed)return;this.refreshStatusMessage="",r.aborted&&n?this.errorMessage="Model refresh timed out; showing cached models.":r.errors.size===1?this.errorMessage=`Could not refresh ${r.errors.keys().next().value}; showing cached models.`:r.errors.size>1?this.errorMessage=`Could not refresh ${r.errors.size} model catalogs (${[...r.errors.keys()].join(", ")}); showing cached models.`:(this.errorMessage=this.modelRuntime.getError(),this.errorMessage||(this.refreshStatusMessage="Model catalogs refreshed.",this.refreshStatusSuccess=!0)),this.loadModelsFromSnapshot(),this.filterModels(this.searchInput.getValue()),this.tui.requestRender()}catch(r){if(this.closed)return;this.refreshStatusMessage="",this.errorMessage=n?"Model refresh timed out; showing cached models.":`Could not refresh model catalogs: ${r instanceof Error?r.message:String(r)}`,this.updateList(),this.tui.requestRender()}finally{this.refreshTimeout&&clearTimeout(this.refreshTimeout)}}dispose(){this.closed||(this.closed=!0,this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.refreshAbortController.abort())}sortModels(e){let n=[...e];return n.sort((r,i)=>{let s=Zd(this.currentModel,r.model),o=Zd(this.currentModel,i.model);if(s&&!o)return-1;if(!s&&o)return 1;let a=this.isDefaultModel(r.model),c=this.isDefaultModel(i.model);return a&&!c?-1:!a&&c?1:r.provider.localeCompare(i.provider)}),n}getScopeText(){let e=this.scope==="all"?Ee.fg("accent","all"):Ee.fg("muted","all"),n=this.scope==="scoped"?Ee.fg("accent","scoped"):Ee.fg("muted","scoped");return`${Ee.fg("muted","Scope: ")}${e}${Ee.fg("muted"," | ")}${n}`}getScopeHintText(){return nr("tui.input.tab","scope")+Ee.fg("muted"," (all/scoped)")}isDefaultModel(e){return this.defaultModel?.provider===e.provider&&this.defaultModel.id===e.id}isDefaultSearch(e){let n=e.trim().toLowerCase();return n.length>0&&"default".startsWith(n)}setScope(e){if(this.scope===e)return;this.scope=e,this.activeModels=this.scope==="scoped"?this.scopedModelItems:this.allModels;let n=this.activeModels.findIndex(r=>Zd(this.currentModel,r.model));this.selectedIndex=n>=0?n:0,this.filterModels(this.searchInput.getValue()),this.scopeText&&this.scopeText.setText(this.getScopeText())}filterModels(e){if(e){let n=Pu(this.activeModels,e,r=>{let i=this.isDefaultModel(r.model)?" default":"";return`${eor({id:r.id,provider:r.provider,name:r.model.name})}${i}`});if(this.isDefaultSearch(e)){let r=this.activeModels.filter(s=>this.isDefaultModel(s.model)),i=new Set(r.map(s=>`${s.provider}\0${s.id}`));this.filteredModels=[...r,...n.filter(s=>!i.has(`${s.provider}\0${s.id}`))]}else this.filteredModels=n}else this.filteredModels=this.activeModels;this.selectedIndex=e?0:Math.min(this.selectedIndex,Math.max(0,this.filteredModels.length-1)),this.updateList()}updateList(){this.listContainer.clear();let e=10,n=Math.max(0,Math.min(this.selectedIndex-Math.floor(e/2),this.filteredModels.length-e)),r=Math.min(n+e,this.filteredModels.length);for(let i=n;i0||r0){let r=this.scope==="all"?"scoped":"all";this.setScope(r),this.scopeHintText&&this.scopeHintText.setText(this.getScopeHintText())}return}if(n.matches(e,"tui.select.up")){if(this.filteredModels.length===0)return;this.selectedIndex=this.selectedIndex===0?this.filteredModels.length-1:this.selectedIndex-1,this.updateList()}else if(n.matches(e,"tui.select.down")){if(this.filteredModels.length===0)return;this.selectedIndex=this.selectedIndex===this.filteredModels.length-1?0:this.selectedIndex+1,this.updateList()}else if(n.matches(e,"tui.select.confirm")){let r=this.filteredModels[this.selectedIndex];r&&this.handleSelect(r.model)}else if(n.matches(e,"tui.select.cancel"))this.dispose(),this.onCancelCallback();else if(n.matches(e,"app.models.save")&&this.onSelectAsDefaultCallback){let r=this.filteredModels[this.selectedIndex];r&&(this.dispose(),this.onSelectAsDefaultCallback(r.model))}else this.searchInput.handleInput(e),this.filterModels(this.searchInput.getValue())}handleSelect(e){this.dispose(),this.onSelectCallback(e)}getSearchInput(){return this.searchInput}}});function OPe(t){return t==="oauth"?"subscription":"API key"}var iM,$bt=v(()=>{p();Tr();pi();Ll();iM=class extends gn{searchInput;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}listContainer;allProviders;filteredProviders;selectedIndex=0;mode;onSelectCallback;onCancelCallback;showAuthTypeLabels;constructor(e,n,r,i,s){super(),this.mode=e,this.allProviders=n,this.filteredProviders=n,this.showAuthTypeLabels=new Set(n.map(a=>a.authType)).size>1,this.onSelectCallback=r,this.onCancelCallback=i,this.addChild(new Un),this.addChild(new Tt(1));let o=e==="login"?"Select provider to configure:":"Select provider to logout:";this.addChild(new yE(Ee.fg("accent",Ee.bold(o)),1,0)),this.addChild(new Tt(1)),this.searchInput=new ma,s&&this.searchInput.setValue(s),this.searchInput.onSubmit=()=>{let a=this.filteredProviders[this.selectedIndex];a&&this.onSelectCallback(a.id,a.authType)},this.addChild(this.searchInput),this.addChild(new Tt(1)),this.listContainer=new gn,this.addChild(this.listContainer),this.addChild(new Tt(1)),this.addChild(new Un),this.filterProviders(s??"")}filterProviders(e){this.filteredProviders=e?Pu(this.allProviders,e,n=>`${n.name} ${n.id} ${n.authType} ${n.method?.name??""}`):this.allProviders,this.selectedIndex=Math.max(0,Math.min(this.selectedIndex,Math.max(0,this.filteredProviders.length-1))),this.updateList()}updateList(){this.listContainer.clear();let e=8,n=Math.max(0,Math.min(this.selectedIndex-Math.floor(e/2),this.filteredProviders.length-e)),r=Math.min(n+e,this.filteredProviders.length);for(let i=n;i0||re.includes(n))?null:t}function Eys(t,e,n){if(t===null)return e.filter(i=>i!==n);let r=t.indexOf(n);return r>=0?[...t.slice(0,r),...t.slice(r+1)]:ror([...t,n],e)}function tor(t,e,n){if(t===null)return null;let r=n??e,i=[...t];for(let s of r)i.includes(s)||i.push(s);return ror(i,e)}function nor(t,e,n){if(t===null)return n?e.filter(i=>!n.includes(i)):[];let r=new Set(n??t);return t.filter(i=>!r.has(i))}function bys(t,e,n){if(t===null)return null;let r=[...t],i=r.indexOf(e);if(i<0)return r;let s=i+n;if(s<0||s>=r.length)return r;let o=[...r];return[o[i],o[s]]=[o[s],o[i]],o}function _ys(t,e){if(t===null)return e;let n=new Set(t);return[...t,...e.filter(r=>!n.has(r))]}var sce,Hbt=v(()=>{p();Tr();MPe();pi();Ll();ha();sce=class extends gn{modelsById=new Map;allIds=[];enabledIds=null;filteredItems=[];selectedIndex=0;searchInput;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}listContainer;footerText;callbacks;maxVisible=8;isDirty=!1;refreshStatusText;constructor(e,n){super(),this.callbacks=n;for(let r of e.allModels){let i=`${r.provider}/${r.id}`;this.modelsById.set(i,r),this.allIds.push(i)}this.enabledIds=e.enabledModelIds===null?null:[...e.enabledModelIds],this.filteredItems=this.buildItems(),this.addChild(new Un),this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("accent",Ee.bold("Model Configuration")),0,0)),this.addChild(new Et(Ee.fg("muted",`Session-only. ${qc("app.models.save")} to save to settings.`),0,0)),this.addChild(new Tt(1)),this.searchInput=new ma,this.addChild(this.searchInput),this.addChild(new Tt(1)),this.listContainer=new gn,this.addChild(this.listContainer),this.addChild(new Tt(1)),e.refreshStatus&&(this.refreshStatusText=new Et(Ee.fg("muted",` ${e.refreshStatus}`),0,0),this.addChild(this.refreshStatusText)),this.footerText=new Et(this.getFooterText(),0,0),this.addChild(this.footerText),this.addChild(new Un),this.updateList()}updateModels(e,n){let r=this.filteredItems[this.selectedIndex]?.fullId;n!==void 0&&(this.enabledIds=n===null?null:[...n]),this.modelsById.clear(),this.allIds=[];for(let s of e){let o=`${s.provider}/${s.id}`;this.modelsById.set(o,s),this.allIds.push(o)}this.refresh();let i=r?this.filteredItems.findIndex(s=>s.fullId===r):-1;i>=0&&(this.selectedIndex=i,this.updateList())}setRefreshStatus(e,n){this.refreshStatusText?.setText(Ee.fg(n,` ${e}`))}buildItems(){return _ys(this.enabledIds,this.allIds).map(e=>({fullId:e,model:this.modelsById.get(e),enabled:Wbt(this.enabledIds,e)}))}getFooterText(){let e=this.enabledIds?.filter(o=>this.modelsById.has(o)).length??this.allIds.length,n=this.enabledIds?.filter(o=>!this.modelsById.has(o)).length??0,i=this.enabledIds===null?"all enabled":`${e}/${this.allIds.length} enabled${n?` \xB7 ${n} unavailable`:""}`,s=[`${qc("tui.select.confirm")} toggle`,`${qc("app.models.enableAll")} all`,`${qc("app.models.clearAll")} clear`,`${qc("app.models.toggleProvider")} provider`,`${qc("app.models.reorderUp")}/${qc("app.models.reorderDown")} reorder`,`${qc("app.models.save")} save`,i];return this.isDirty?Ee.fg("dim",` ${s.join(" \xB7 ")} `)+Ee.fg("warning","(unsaved)"):Ee.fg("dim",` ${s.join(" \xB7 ")}`)}refresh(){let e=this.searchInput.getValue(),n=this.buildItems();this.filteredItems=e?Pu(n,e,r=>r.model?PPe({id:r.model.id,provider:r.model.provider,name:r.model.name}):r.fullId):n,this.selectedIndex=Math.min(this.selectedIndex,Math.max(0,this.filteredItems.length-1)),this.updateList(),this.footerText.setText(this.getFooterText())}notifyChange(){this.callbacks.onChange(this.enabledIds===null?null:[...this.enabledIds])}updateList(){if(this.listContainer.clear(),this.filteredItems.length===0){this.listContainer.addChild(new Et(Ee.fg("muted"," No matching models"),0,0));return}let e=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredItems.length-this.maxVisible)),n=Math.min(e+this.maxVisible,this.filteredItems.length);for(let r=e;r0||n0){let r=this.filteredItems[this.selectedIndex];this.listContainer.addChild(new Tt(1)),this.listContainer.addChild(new Et(Ee.fg("muted",` ${r.model?`Model Name: ${r.model.name}`:"Model unavailable"}`),0,0))}}handleInput(e){let n=Ai();if(n.matches(e,"tui.select.up")){if(this.filteredItems.length===0)return;this.selectedIndex=this.selectedIndex===0?this.filteredItems.length-1:this.selectedIndex-1,this.updateList();return}if(n.matches(e,"tui.select.down")){if(this.filteredItems.length===0)return;this.selectedIndex=this.selectedIndex===this.filteredItems.length-1?0:this.selectedIndex+1,this.updateList();return}let r=n.matches(e,"app.models.reorderUp"),i=n.matches(e,"app.models.reorderDown");if(r||i){if(this.enabledIds===null)return;let s=this.filteredItems[this.selectedIndex];if(s&&Wbt(this.enabledIds,s.fullId)){let o=r?-1:1,c=this.enabledIds.indexOf(s.fullId)+o;c>=0&&co.fullId):void 0;this.enabledIds=tor(this.enabledIds,this.allIds,s),this.isDirty=!0,this.refresh(),this.notifyChange();return}if(n.matches(e,"app.models.clearAll")){let s=this.searchInput.getValue()?this.filteredItems.map(o=>o.fullId):void 0;this.enabledIds=nor(this.enabledIds,this.allIds,s),this.isDirty=!0,this.refresh(),this.notifyChange();return}if(n.matches(e,"app.models.toggleProvider")){let s=this.filteredItems[this.selectedIndex];if(s?.model){let o=s.model.provider,a=this.allIds.filter(u=>this.modelsById.get(u).provider===o),c=a.every(u=>Wbt(this.enabledIds,u));this.enabledIds=c?nor(this.enabledIds,this.allIds,a):tor(this.enabledIds,this.allIds,a),this.isDirty=!0,this.refresh(),this.notifyChange()}return}if(n.matches(e,"app.models.save")){this.callbacks.onPersist(this.enabledIds===null?null:[...this.enabledIds]),this.isDirty=!1,this.footerText.setText(this.getFooterText());return}if(sm(e,wre.ctrl("c"))){this.searchInput.getValue()?(this.searchInput.setValue(""),this.refresh()):this.callbacks.onCancel();return}if(sm(e,wre.escape)){this.callbacks.onCancel();return}this.searchInput.handleInput(e),this.refresh()}getSearchInput(){return this.searchInput}}});var xys,w9,LPe,ior=v(()=>{p();Tr();pi();xys={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},w9=class extends gn{selectList;listChildIndex;allOptions;listLayout;searchInput;onSelectCb;onCancelCb;onSelectionChangeCb;constructor(e,n,r,i,s,o,a,c){super(),this.allOptions=r,this.listLayout=c?.layout??xys,this.onSelectCb=s,this.onCancelCb=o,this.onSelectionChangeCb=a,this.addChild(new Et(Ee.bold(Ee.fg("accent",e)),0,0)),n&&(this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("muted",n),0,0))),c?.searchable&&(this.addChild(new Tt(1)),this.searchInput=new ma,this.searchInput.onSubmit=()=>{this.selectList.handleInput("\r")},this.addChild(this.searchInput)),this.addChild(new Tt(1)),this.selectList=this.buildSelectList(r,i),this.listChildIndex=this.children.length,this.addChild(this.selectList),this.addChild(new Tt(1));let u=c?.searchable?" Type to filter \xB7 Enter to select \xB7 Esc to go back":" Enter to select \xB7 Esc to go back";this.addChild(new Et(Ee.fg("dim",u),0,0))}buildSelectList(e,n){let r=new eh(e,Math.min(e.length,10),dS(),this.listLayout),i=e.findIndex(s=>s.value===n);if(i!==-1&&r.setSelectedIndex(i),r.onSelect=s=>this.onSelectCb(s.value),r.onCancel=this.onCancelCb,this.onSelectionChangeCb){let s=this.onSelectionChangeCb;r.onSelectionChange=o=>s(o.value)}return r}applyFilter(e){let n=e?Pu(this.allOptions,e,i=>`${i.label} ${i.description??""}`):this.allOptions,r=this.buildSelectList(n,"");this.children[this.listChildIndex]=r,this.selectList=r}handleInput(e){if(this.searchInput){let n=Ai();n.matches(e,"tui.select.up")||n.matches(e,"tui.select.down")||n.matches(e,"tui.select.confirm")||n.matches(e,"tui.select.cancel")?this.selectList.handleInput(e):(this.searchInput.handleInput(e),this.applyFilter(this.searchInput.getValue()))}else this.selectList.handleInput(e)}},LPe=class extends gn{steps;onComplete;onCancel;opts;activeComponent;context;constructor(e,n,r,i={}){super(),this.steps=e,this.onComplete=n,this.onCancel=r,this.opts=i,this.context={...i.initialContext??{}},this.activeComponent=this.buildStep(i.startAtStep??0)}buildStep(e){let n=this.steps[e],r=this.steps.length,i=r>1?`Step ${e+1}/${r} \xB7 `:"",s=typeof n.title=="function"?n.title(this.context):n.title,o=typeof n.description=="function"?n.description(this.context):n.description,a=n.options(this.context),c=n.preselect?.(this.context)??"";return new w9(s,`${i}${o}`,a,c,u=>{this.context[n.key]=u,e{e>0?(delete this.context[n.key],this.activeComponent=this.buildStep(e-1)):this.onCancel()},void 0,n.searchable||n.layout?{searchable:n.searchable,layout:n.layout}:void 0)}render(e){return this.activeComponent.render(e)}handleInput(e){this.activeComponent.handleInput?.(e)}invalidate(){this.activeComponent.invalidate?.()}}});function oce(t){return`${t.provider}/${t.id}`}function wys(t){return`${t.id} [${t.provider}]`}function oor(t){let e=Object.keys(t).length;return e===0?"none":`${e} configured`}function Tys(t){return`${t.id} ${Ee.fg("muted",`[${t.provider}]`)}`}function aor(t,e){return t.map(n=>({value:n,label:`${n===e?"\u2713 ":" "}${n}`}))}function vys(t,e){return[{value:Vbt,label:" Automatic",description:"Use separate themes for light and dark terminal appearance"},...aor(t,e)]}function cor(t,e,n){return e&&t.includes(e)?e:t.includes(n)?n:t[0]??n}function Rys(t,e){let n=LR(t);if(n)return n;let r=t.includes("/")?void 0:t,i=cor(e,r,"dark");return{lightTheme:i,darkTheme:i}}var Sys,Cys,qbt,Iys,jbt,sor,Vbt,Ybt,dG,zbt=v(()=>{p();qo();Tr();Mae();Ek();pi();Ll();ha();ior();Sys={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:46},Cys={off:"No reasoning",minimal:"Very brief reasoning (~1k tokens)",low:"Light reasoning (~2k tokens)",medium:"Moderate reasoning (~8k tokens)",high:"Deep reasoning (~16k tokens)",xhigh:"Extra-high reasoning (~32k tokens)",max:"Maximum reasoning"},qbt={ask:"Ask",always:"Always trust",never:"Never trust"},Iys=new Map(Object.entries(qbt).map(([t,e])=>[e,t])),jbt=class extends gn{settingsList;state;constructor(e,n,r){super(),this.state={...e};let i=[{id:"anthropic-extra-usage",label:"Anthropic extra usage",description:"Warn when Anthropic subscription auth may use paid extra usage",currentValue:this.state.anthropicExtraUsage??!0?"true":"false",values:["true","false"]}];this.settingsList=new vD(i,Math.min(i.length,10),Cj(),(s,o)=>{s==="anthropic-extra-usage"&&(this.state={...this.state,anthropicExtraUsage:o==="true"},n({...this.state}))},r),this.addChild(this.settingsList)}handleInput(e){this.settingsList.handleInput(e)}},sor="__clear__";Vbt="/";Ybt=class extends gn{inputComponent;callbacks;availableThemes;terminalTheme;onDone;originalThemeSetting;mode;singleTheme;lightTheme;darkTheme;constructor(e,n,r,i,s){super(),this.callbacks=i,this.availableThemes=r,this.terminalTheme=n,this.onDone=s,this.originalThemeSetting=e;let o=LR(e),a=Rys(e,r),c=o||e.includes("/")?void 0:e;this.mode=o?"automatic":"single",this.lightTheme=a.lightTheme,this.darkTheme=a.darkTheme,this.singleTheme=cor(r,c??(o?this.getActiveAutomaticTheme():void 0),"dark"),this.mode==="automatic"?this.showAutomaticMenu():this.showSingleMenu()}handleInput(e){this.inputComponent?.handleInput?.(e)}setContent(e,n=e){this.clear(),this.addChild(e),this.inputComponent=n}showSingleMenu(){this.mode="single";let e=new w9("Theme","Select a theme, or choose Automatic to follow terminal appearance.",vys(this.availableThemes,this.singleTheme),this.singleTheme,n=>{if(n===Vbt){this.mode="automatic",this.callbacks.onThemePreview?.(this.getThemeSetting()),this.showAutomaticMenu();return}this.singleTheme=n,this.apply(n)},()=>this.cancel(),n=>{this.callbacks.onThemePreview?.(n===Vbt?this.getAutomaticThemeSetting():n)});this.setContent(e)}showAutomaticMenu(){this.mode="automatic";let e=new gn;e.addChild(new Et(Ee.bold(Ee.fg("accent","Automatic Theme")),0,0)),e.addChild(new Tt(1)),e.addChild(new Et(Ee.fg("muted","Choose themes for terminal light and dark appearance."),0,0)),e.addChild(new Et(Ee.fg("muted","Light/dark detection requires terminal support."),0,0)),e.addChild(new Tt(1));let n=[{id:"light-theme",label:"Light theme",description:"Theme to use in automatic mode when the terminal is light",currentValue:this.lightTheme,submenu:(i,s)=>this.createThemeSelect("Light Theme","Select the theme to use for light terminal appearance",i,s,o=>{this.lightTheme=o,this.callbacks.onThemePreview?.(this.getThemeSetting()),s(o)})},{id:"dark-theme",label:"Dark theme",description:"Theme to use in automatic mode when the terminal is dark",currentValue:this.darkTheme,submenu:(i,s)=>this.createThemeSelect("Dark Theme","Select the theme to use for dark terminal appearance",i,s,o=>{this.darkTheme=o,this.callbacks.onThemePreview?.(this.getThemeSetting()),s(o)})},{id:"apply",label:"Apply",description:"Save and go back",currentValue:"save and go back",values:["save and go back"]},{id:"single-mode",label:"Change mode",description:"Switch to one theme for light and dark",currentValue:"switch to single theme",values:["switch to single theme"]}],r=new vD(n,Math.min(n.length,10),Cj(),i=>{switch(i){case"single-mode":this.mode="single",this.singleTheme=this.getActiveAutomaticTheme(),this.callbacks.onThemePreview?.(this.singleTheme),this.showSingleMenu();break;case"apply":this.apply(this.getAutomaticThemeSetting());break}},()=>this.cancel());e.addChild(r),this.setContent(e,r)}createThemeSelect(e,n,r,i,s){return new w9(e,n,aor(this.availableThemes,r),r,s,()=>{this.callbacks.onThemePreview?.(this.getThemeSetting()),i()},o=>this.callbacks.onThemePreview?.(o))}getThemeSetting(){return this.mode==="automatic"?this.getAutomaticThemeSetting():this.singleTheme}getActiveAutomaticTheme(){return this.terminalTheme==="light"?this.lightTheme:this.darkTheme}getAutomaticThemeSetting(){return`${this.lightTheme}/${this.darkTheme}`}apply(e){this.onDone(e)}cancel(){this.callbacks.onThemePreview?.(this.originalThemeSetting),this.onDone()}},dG=class extends gn{settingsList;constructor(e,n){super();let r=Dl().images,i=qc("app.message.followUp"),s=qc("app.thinking.cycle"),o={...e.warnings},a={...e.modelThinkingLevels},c=new Map(e.availableDefaultModels.map(S=>[oce(S),S])),u=c.has(e.defaultModel)?e.defaultModel:void 0,l=e.currentModel?oce(e.currentModel):void 0,d=[{id:"autocompact",label:"Auto-compact",description:"Automatically compact context when it gets too large",currentValue:e.autoCompact?"true":"false",values:["true","false"]},{id:"steering-mode",label:"Steering mode",description:"Enter while streaming queues steering messages. 'one-at-a-time': deliver one, wait for response. 'all': deliver all at once.",currentValue:e.steeringMode,values:["one-at-a-time","all"]},{id:"follow-up-mode",label:"Follow-up mode",description:`${i} queues follow-up messages until agent stops. 'one-at-a-time': deliver one, wait for response. 'all': deliver all at once.`,currentValue:e.followUpMode,values:["one-at-a-time","all"]},{id:"transport",label:"Transport",description:"Preferred transport for providers that support multiple transports",currentValue:e.transport,values:["sse","websocket","websocket-cached","auto"]},{id:"http-idle-timeout",label:"HTTP idle timeout",description:"Maximum idle gap while waiting for HTTP headers or body chunks. Disable for local models that pause longer than five minutes.",currentValue:FDe(e.httpIdleTimeoutMs),values:ODe.map(S=>S.label)},{id:"cache-warming-mode",label:"Cache warming",description:"off; streaming while the agent runs; idle also between runs while continuation stays profitable",currentValue:e.cacheWarmingMode,values:[...c0t]},{id:"hide-thinking",label:"Hide thinking",description:"Hide thinking blocks in assistant responses",currentValue:e.hideThinkingBlock?"true":"false",values:["true","false"]},{id:"mermaid-rendering",label:"Mermaid diagrams",description:"Render Mermaid code blocks as Unicode diagrams",currentValue:e.mermaidRenderingMode,values:["off","final","streaming"]},{id:"cache-miss-notices",label:"Cache miss notices",description:"Show transcript notices for cache costs and provider recovery diagnostics",currentValue:e.showCacheMissNotices?"true":"false",values:["true","false"]},{id:"collapse-changelog",label:"Collapse changelog",description:"Show condensed changelog after updates",currentValue:e.collapseChangelog?"true":"false",values:["true","false"]},{id:"quiet-startup",label:"Quiet startup",description:"Disable verbose printing at startup",currentValue:e.quietStartup?"true":"false",values:["true","false"]},{id:"install-telemetry",label:"Install telemetry",description:"Send an anonymous version/update ping after changelog-detected updates",currentValue:e.enableInstallTelemetry?"true":"false",values:["true","false"]},{id:"default-project-trust",label:"Default project trust",description:"Fallback behavior when no extension or saved trust decision decides project trust",currentValue:qbt[e.defaultProjectTrust],values:Object.values(qbt)},{id:"double-escape-action",label:"Double-escape action",description:"Action when pressing Escape twice with empty editor",currentValue:e.doubleEscapeAction,values:["tree","fork","none"]},{id:"tree-filter-mode",label:"Tree filter mode",description:"Default filter when opening /tree",currentValue:e.treeFilterMode,values:["default","no-tools","user-only","labeled-only","all"]},{id:"warnings",label:"Warnings",description:"Enable or disable individual warnings",currentValue:"configure",submenu:(S,C)=>new jbt(o,I=>{o=I,n.onWarningsChange(I)},()=>C())},{id:"model-thinking",label:"Default thinking level per model",description:`Override the default thinking level for specific models. ${s} cycles in-session.`,currentValue:oor(a),submenu:(S,C)=>{let I=[{key:"model",title:"Per-Model Thinking Level",description:"Select a model to configure",options:()=>{let N=[...e.availableDefaultModels].sort((O,W)=>{let $=oce(O),G=oce(W);return $===l?-1:G===l?1:$===u?-1:G===u?1:O.provider.localeCompare(W.provider)}).map(O=>{let W=oce(O),$=a[W];return{value:W,label:Tys(O),description:$??void 0}});return N.length===0&&N.push({value:"__none__",label:"No models available",description:"Log in to a provider or configure an API key first"}),N},preselect:()=>l??u,searchable:!0,layout:Sys},{key:"level",title:k=>{let N=c.get(k.model);return`Thinking Level for ${N?wys(N):k.model}`},description:"Select default thinking level for this model",options:k=>{let N=c.get(k.model);if(!N)return[];let O=N.reasoning?gB(N):["off"],W=a[k.model],$=O.map(G=>({value:G,label:`${G===W?"\u2713 ":" "}${G}`,description:Cys[G]}));return a[k.model]!==void 0&&$.push({value:sor,label:" (clear override)",description:`Revert to global default (${e.thinkingLevel})`}),$},preselect:k=>a[k.model]}],w=()=>oor(a);return new LPe(I,k=>{let N=c.get(k.model);N&&(k.level===sor?(n.onModelThinkingLevelRemove(N.provider,N.id),delete a[k.model]):(n.onModelThinkingLevelChange(N.provider,N.id,k.level),a[k.model]=k.level))},()=>{C(w())},{loop:!0})}},{id:"tui-mode",label:"TUI mode",description:"Interface layout; fullscreen mode is experimental",currentValue:e.tuiMode,values:["regular","fullscreen"]},{id:"fullscreen-exit-output",label:"Fullscreen exit output",description:"Print the transcript or only a session resume hint when exiting fullscreen mode",currentValue:e.fullscreenExitOutput,values:["transcript","resume-hint"]},{id:"fullscreen-scrollbar",label:"Fullscreen scrollbar",description:"Scrollbar behavior in fullscreen mode; has no effect in regular mode",currentValue:e.fullscreenScrollbar,values:["auto","always","hidden"]},{id:"fullscreen-copy-on-select",label:"Fullscreen copy on select",description:"Automatically copy selected text in fullscreen mode; disable to copy selections with Ctrl+X",currentValue:e.fullscreenCopyOnSelect?"true":"false",values:["true","false"]},{id:"theme",label:"Theme",description:"Color theme for the interface",currentValue:e.currentTheme,submenu:(S,C)=>new Ybt(S,e.terminalTheme,e.availableThemes,n,C)}];r&&(d.splice(1,0,{id:"show-images",label:"Show images",description:"Render images inline in terminal",currentValue:e.showImages?"true":"false",values:["true","false"]}),d.splice(2,0,{id:"image-width-cells",label:"Image width",description:"Preferred inline image width in terminal cells",currentValue:String(e.imageWidthCells),values:["60","80","120"]})),d.splice(r?3:1,0,{id:"auto-resize-images",label:"Auto-resize images",description:"Resize large images to 2000x2000 max for better model compatibility",currentValue:e.autoResizeImages?"true":"false",values:["true","false"]});let m=d.findIndex(S=>S.id==="auto-resize-images");d.splice(m+1,0,{id:"block-images",label:"Block images",description:"Prevent images from being sent to LLM providers",currentValue:e.blockImages?"true":"false",values:["true","false"]});let h=d.findIndex(S=>S.id==="block-images");d.splice(h+1,0,{id:"skill-commands",label:"Skill commands",description:"Register skills as /skill:name commands",currentValue:e.enableSkillCommands?"true":"false",values:["true","false"]});let f=d.findIndex(S=>S.id==="skill-commands");d.splice(f+1,0,{id:"show-hardware-cursor",label:"Show hardware cursor",description:"Show the terminal cursor while still positioning it for IME support",currentValue:e.showHardwareCursor?"true":"false",values:["true","false"]});let g=d.findIndex(S=>S.id==="show-hardware-cursor");d.splice(g+1,0,{id:"editor-padding",label:"Editor padding",description:"Horizontal padding for input editor (0-3)",currentValue:String(e.editorPaddingX),values:["0","1","2","3"]});let A=d.findIndex(S=>S.id==="editor-padding");d.splice(A+1,0,{id:"output-padding",label:"Output padding",description:"Horizontal padding for user messages, assistant messages, and thinking",currentValue:String(e.outputPad),values:["0","1"]});let y=d.findIndex(S=>S.id==="output-padding");d.splice(y+1,0,{id:"autocomplete-max-visible",label:"Autocomplete max items",description:"Max visible items in autocomplete dropdown (3-20)",currentValue:String(e.autocompleteMaxVisible),values:["3","5","7","10","15","20"]});let E=d.findIndex(S=>S.id==="autocomplete-max-visible");d.splice(E+1,0,{id:"clear-on-shrink",label:"Clear on shrink",description:"Clear empty rows when content shrinks (may cause flicker)",currentValue:e.clearOnShrink?"true":"false",values:["true","false"]});let _=d.findIndex(S=>S.id==="clear-on-shrink");d.splice(_+1,0,{id:"terminal-progress",label:"Terminal progress",description:"Show OSC 9;4 progress indicators in the terminal tab bar",currentValue:e.showTerminalProgress?"true":"false",values:["true","false"]}),this.addChild(new Un),this.settingsList=new vD(d,10,Cj(),(S,C)=>{switch(S){case"autocompact":n.onAutoCompactChange(C==="true");break;case"show-images":n.onShowImagesChange(C==="true");break;case"image-width-cells":n.onImageWidthCellsChange(parseInt(C,10));break;case"auto-resize-images":n.onAutoResizeImagesChange(C==="true");break;case"block-images":n.onBlockImagesChange(C==="true");break;case"skill-commands":n.onEnableSkillCommandsChange(C==="true");break;case"steering-mode":n.onSteeringModeChange(C);break;case"follow-up-mode":n.onFollowUpModeChange(C);break;case"transport":n.onTransportChange(C);break;case"http-idle-timeout":{let I=ODe.find(w=>w.label===C);I&&n.onHttpIdleTimeoutMsChange(I.timeoutMs);break}case"cache-warming-mode":n.onCacheWarmingModeChange(C);break;case"hide-thinking":n.onHideThinkingBlockChange(C==="true");break;case"mermaid-rendering":n.onMermaidRenderingModeChange(C);break;case"cache-miss-notices":n.onShowCacheMissNoticesChange(C==="true");break;case"collapse-changelog":n.onCollapseChangelogChange(C==="true");break;case"quiet-startup":n.onQuietStartupChange(C==="true");break;case"install-telemetry":n.onEnableInstallTelemetryChange(C==="true");break;case"default-project-trust":{let I=Iys.get(C);I&&n.onDefaultProjectTrustChange(I);break}case"double-escape-action":n.onDoubleEscapeActionChange(C);break;case"tree-filter-mode":n.onTreeFilterModeChange(C);break;case"show-hardware-cursor":n.onShowHardwareCursorChange(C==="true");break;case"editor-padding":n.onEditorPaddingXChange(parseInt(C,10));break;case"output-padding":n.onOutputPadChange(C==="0"?0:1);break;case"autocomplete-max-visible":n.onAutocompleteMaxVisibleChange(parseInt(C,10));break;case"clear-on-shrink":n.onClearOnShrinkChange(C==="true");break;case"terminal-progress":n.onShowTerminalProgressChange(C==="true");break;case"tui-mode":n.onTuiModeChange(C);break;case"fullscreen-exit-output":n.onFullscreenExitOutputChange(C);break;case"fullscreen-scrollbar":n.onFullscreenScrollbarChange(C);break;case"fullscreen-copy-on-select":n.onFullscreenCopyOnSelectChange(C==="true");break;case"theme":n.onThemeChange(C);break}},n.onCancel,{enableSearch:!0}),this.addChild(this.settingsList),this.addChild(new Un)}getSettingsList(){return this.settingsList}}});var pG,Kbt=v(()=>{p();Tr();pi();ha();pG=class extends Ou{expanded=!1;skillBlock;markdownTheme;constructor(e,n=zh()){super(1,1,r=>Ee.bg("customMessageBg",r)),this.skillBlock=e,this.markdownTheme=n,this.updateDisplay()}setExpanded(e){this.expanded=e,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}updateDisplay(){this.clear();let e=new gn;if(this.expanded){let n=Ee.fg("customMessageLabel","\x1B[1m[skill]\x1B[22m");e.addChild(new Et(n,0,0));let r=`**${this.skillBlock.name}** -`;this.addChild(new Hc(n+this.skillBlock.content,0,0,this.markdownTheme,{color:r=>Se.fg("customMessageText",r)}))}else{let e=Se.fg("customMessageLabel","\x1B[1m[skill]\x1B[22m ")+Se.fg("customMessageText",this.skillBlock.name)+Se.fg("dim",` (${ra("app.tools.expand")} to expand)`);this.addChild(new yt(e,0,0))}}};p();var wV=class extends qE{kind;constructor(e,n,r,s,i,o){super(n,r,s,i,o),this.kind=e}dispose(){this.stop()}},TV=class extends wV{constructor(e,n,r,s){super("working",e,s??(i=>Se.fg("accent",i)),s??(i=>Se.fg("muted",i)),n,r)}renderInBorder(e){let n=super.render(e+2)[1]??"";return pr(n.startsWith(" ")?n.slice(1).trimEnd():n.trimEnd(),e,"")}renderSpinnerInBorder(e){return pr(this.getRenderedIndicator(),e,"")}},_ne=class extends wV{countdown;constructor(e,n,r,s){let i=o=>`Retrying (${n}/${r}) in ${o}s... (${ra("app.interrupt")} to cancel)`;super("retry",e,o=>Se.fg("warning",o),o=>Se.fg("muted",o),i(Math.ceil(s/1e3))),this.countdown=new zD(s,e,o=>{this.setMessage(i(o))},()=>{this.countdown=void 0})}dispose(){this.countdown?.dispose(),this.countdown=void 0,super.dispose()}},Sne=class extends wV{constructor(e,n){let r=`(${ra("app.interrupt")} to cancel)`,s=n==="manual"?`Compacting context... ${r}`:`${n==="overflow"?"Context overflow detected, ":""}Auto-compacting... ${r}`;super("compaction",e,i=>Se.fg("accent",i),i=>Se.fg("muted",i),s)}},Cne=class extends wV{constructor(e){super("branchSummary",e,n=>Se.fg("accent",n),n=>Se.fg("muted",n),`Summarizing branch... (${ra("app.interrupt")} to cancel)`)}},STe=class{invalidate(){}render(e){let n=" ".repeat(e);return[n,n]}};p();var _Gs={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},GMn={off:"No reasoning",minimal:"Very brief reasoning (~1k tokens)",low:"Light reasoning (~2k tokens)",medium:"Moderate reasoning (~8k tokens)",high:"Deep reasoning (~16k tokens)",xhigh:"Extra-high reasoning (~32k tokens)",max:"Maximum reasoning"},WF=class extends _n{searchInput;selectList;selectListChildIndex;allItems;onSelect;onCancel;onSelectAsDefault;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}constructor(e,n,r,s,i,o){super(),this.onSelect=r,this.onCancel=s,this.onSelectAsDefault=i,this.allItems=n.map(a=>({value:a,label:`${a===e?"\u2713 ":" "}${a}`,description:a===o?`${GMn[a]} \xB7 default`:GMn[a]})),this.addChild(new Ln),this.addChild(new Nt(1)),this.addChild(new yt("Thinking Level",0,0)),this.addChild(new Nt(1)),this.addChild(new yt(`${oc("app.thinking.cycle")} cycles thinking levels in-session`,0,0)),this.addChild(new Nt(1)),this.searchInput=new jo,this.searchInput.onSubmit=()=>this.selectList.handleInput("\r"),this.addChild(this.searchInput),this.addChild(new Nt(1)),this.selectList=this.buildSelectList(this.allItems,e),this.selectListChildIndex=this.children.length,this.addChild(this.selectList),this.addChild(new Nt(1)),this.addChild(new yt(Se.fg("dim",` ${oc("tui.select.confirm")} to select \xB7 ${oc("app.thinking.save")} to set as default \xB7 ${oc("tui.select.cancel")} to cancel`),0,0)),this.addChild(new Ln)}buildSelectList(e,n){let r=new Xp(e,Math.max(1,e.length),p0(),_Gs),s=e.findIndex(i=>i.value===n);return s!==-1&&r.setSelectedIndex(s),r.onSelect=i=>this.onSelect(i.value),r.onCancel=()=>this.onCancel(),r}applyFilter(e){let n=e?Wl(this.allItems,e,i=>`${i.value} ${i.description??""}`):this.allItems,r=this.selectList.getSelectedItem()?.value,s=this.buildSelectList(n,r);this.children[this.selectListChildIndex]=s,this.selectList=s}handleInput(e){let n=ms();if(n.matches(e,"app.thinking.save")&&this.onSelectAsDefault){let s=this.selectList.getSelectedItem();s&&this.onSelectAsDefault(s.value);return}if(n.matches(e,"tui.select.up")||n.matches(e,"tui.select.down")||n.matches(e,"tui.select.confirm")||n.matches(e,"tui.select.cancel")){this.selectList.handleInput(e);return}this.searchInput.handleInput(e),this.applyFilter(this.searchInput.getValue())}getSelectList(){return this.selectList}};p();var SGs=10,G0=class extends _n{contentBox;contentText;contentTextRegion;selfRenderContainer;selfRenderHeight=0;callRendererComponent;resultRendererComponent;rendererState={};imageComponents=[];imageSpacers=[];toolName;toolCallId;args;expanded=!1;showImages;imageWidthCells;isPartial=!0;toolDefinition;ui;cwd;executionStarted=!1;argsComplete=!1;result;convertedImages=new Map;hideComponent=!1;constructor(e,n,r,s={},i,o,a){super(),this.toolName=e,this.toolCallId=n,this.args=r,this.toolDefinition=i,this.showImages=s.showImages??!0,this.imageWidthCells=s.imageWidthCells??60,this.ui=o,this.cwd=a,this.addChild(new Nt(1)),this.contentBox=new Vl(1,1,c=>Se.bg("toolPendingBg",c)),this.contentText=new yt("",1,1,c=>Se.bg("toolPendingBg",c)),this.contentTextRegion=this.createResultRegion(this.contentText),this.selfRenderContainer=new _n,this.hasRendererDefinition()?this.addChild(this.getRenderShell()==="self"?this.selfRenderContainer:this.contentBox):this.addChild(this.contentTextRegion),this.updateDisplay()}getCallRenderer(){return this.toolDefinition?.renderCall}getResultRenderer(){return this.toolDefinition?.renderResult}hasRendererDefinition(){return this.toolDefinition!==void 0}getRenderShell(){return this.toolDefinition?.renderShell??"default"}getRenderContext(e){return{args:this.args,toolCallId:this.toolCallId,invalidate:()=>{this.invalidate(),this.ui.requestRender()},lastComponent:e,state:this.rendererState,cwd:this.cwd,executionStarted:this.executionStarted,argsComplete:this.argsComplete,isPartial:this.isPartial,expanded:this.expanded,showImages:this.showImages,isError:this.result?.isError??!1}}createCallFallback(){return new yt(Se.fg("toolTitle",Se.bold(this.toolName)),0,0)}createResultFallback(){let e=this.getTextOutput();if(!e)return;let n=e.split(` -`),r=this.expanded?n:n.slice(0,SGs),s=n.length-r.length,i=r.map(o=>Se.fg("toolOutput",o)).join(` -`);return s>0&&(i+=`${Se.fg("muted",` -... (${s} more lines,`)} ${er("app.tools.expand","to expand")}${Se.fg("muted",")")}`),new yt(i,0,0)}createResultRegion(e){return new BN(e,n=>{if(!(!this.result||n.type!=="click"||n.button!=="left"))return this.setExpanded(!this.expanded),{handled:!0}})}updateArgs(e){this.args=e,this.updateDisplay()}markExecutionStarted(){this.executionStarted=!0,this.updateDisplay(),this.ui.requestRender()}setArgsComplete(){this.argsComplete=!0,this.updateDisplay(),this.ui.requestRender()}updateResult(e,n=!1){this.result=e,this.isPartial=n,this.updateDisplay(),this.maybeConvertImagesForKitty()}maybeConvertImagesForKitty(){if(qc().images!=="kitty"||!this.result)return;let n=this.result.content.filter(r=>r.type==="image");for(let r=0;r{o&&(this.convertedImages.set(i,o),this.updateDisplay(),this.ui.requestRender())})}}setExpanded(e){this.expanded=e,this.updateDisplay()}setShowImages(e){this.showImages=e,this.updateDisplay()}setImageWidthCells(e){this.imageWidthCells=Math.max(1,Math.floor(e)),this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}render(e){if(this.hideComponent)return[];if(this.hasRendererDefinition()&&this.getRenderShell()==="self"){let n=this.selfRenderContainer.render(e);if(this.selfRenderHeight=n.length,n.length===0&&this.imageComponents.length===0)return[];let r=[];n.length>0&&(r.push(""),r.push(...n));for(let s=0;sthis.selfRenderHeight))return this.selfRenderContainer.handleMouse({...e,y:e.y-1,height:this.selfRenderHeight})}updateDisplay(){let e=this.isPartial?r=>Se.bg("toolPendingBg",r):this.result?.isError?r=>Se.bg("toolErrorBg",r):r=>Se.bg("toolSuccessBg",r),n=!1;if(this.hideComponent=!1,this.hasRendererDefinition()){let r=this.getRenderShell()==="self"?this.selfRenderContainer:this.contentBox;r instanceof Vl&&r.setBgFn(e),r.clear();let s=this.getCallRenderer();if(!s)r.addChild(this.createResultRegion(this.createCallFallback())),n=!0;else try{let i=s(this.args,Se,this.getRenderContext(this.callRendererComponent));this.callRendererComponent=i,r.addChild(this.createResultRegion(i)),n=!0}catch{this.callRendererComponent=void 0,r.addChild(this.createResultRegion(this.createCallFallback())),n=!0}if(this.result){let i=this.getResultRenderer();if(i)try{let o=i({content:this.result.content,details:this.result.details},{expanded:this.expanded,isPartial:this.isPartial},Se,this.getRenderContext(this.resultRendererComponent));this.resultRendererComponent=o,r.addChild(this.createResultRegion(o)),n=!0}catch{this.resultRendererComponent=void 0;let o=this.createResultFallback();o&&(r.addChild(this.createResultRegion(o)),n=!0)}else{let o=this.createResultFallback();o&&(r.addChild(this.createResultRegion(o)),n=!0)}}}else this.contentText.setCustomBgFn(e),this.contentText.setText(this.formatToolExecution()),n=!0;for(let r of this.imageComponents)this.removeChild(r);this.imageComponents=[];for(let r of this.imageSpacers)this.removeChild(r);if(this.imageSpacers=[],this.result){let r=this.result.content.filter(i=>i.type==="image"),s=qc();for(let i=0;iSe.fg("toolOutput",h)},{maxWidthCells:this.imageWidthCells});this.imageComponents.push(d),this.addChild(d)}}}this.hasRendererDefinition()&&!n&&this.imageComponents.length===0&&(this.hideComponent=!0)}getTextOutput(){return eb(this.result,this.showImages)}formatToolExecution(){let e=Se.fg("toolTitle",Se.bold(this.toolName)),n=JSON.stringify(this.args,null,2);n&&(e+=` +`;e.addChild(new Pl(r+this.skillBlock.content,0,0,this.markdownTheme,{color:i=>Ee.fg("customMessageText",i)}))}else{let n=Ee.fg("customMessageLabel","\x1B[1m[skill]\x1B[22m ")+Ee.fg("customMessageText",this.skillBlock.name)+Ee.fg("dim",` (${Ca("app.tools.expand")} to expand)`);e.addChild(new Et(n,0,0))}this.addChild(new vA(e,n=>{if(!(n.type!=="click"||n.button!=="left"))return this.setExpanded(!this.expanded),{handled:!0}}))}}});var T9,FPe,ace,cce,lce,QPe,lor=v(()=>{p();Tr();pi();XDe();ha();T9=class extends xb{kind;constructor(e,n,r,i,s,o){super(n,r,i,s,o),this.kind=e}renderInBorder(e){let n=super.render(e+2)[1]??"";return dr(n.startsWith(" ")?n.slice(1).trimEnd():n.trimEnd(),e,"")}renderSpinnerInBorder(e){return dr(this.getRenderedIndicator(),e,"")}dispose(){this.stop()}},FPe=class extends T9{constructor(e,n,r,i){super("working",e,i??(s=>Ee.fg("accent",s)),i??(s=>Ee.fg("muted",s)),n,r)}},ace=class extends T9{countdown;constructor(e,n,r,i){let s=o=>`Retrying (${n}/${r}) in ${o}s... (${Ca("app.interrupt")} to cancel)`;super("retry",e,o=>Ee.fg("warning",o),o=>Ee.fg("muted",o),s(Math.ceil(i/1e3))),this.countdown=new KP(i,e,o=>{this.setMessage(s(o))},()=>{this.countdown=void 0})}dispose(){this.countdown?.dispose(),this.countdown=void 0,super.dispose()}},cce=class extends T9{constructor(e,n){let r=`(${Ca("app.interrupt")} to cancel)`,i=n==="manual"?`Compacting context... ${r}`:`${n==="overflow"?"Context overflow detected, ":""}Auto-compacting... ${r}`;super("compaction",e,s=>Ee.fg("accent",s),s=>Ee.fg("muted",s),i)}},lce=class extends T9{constructor(e){super("branchSummary",e,n=>Ee.fg("accent",n),n=>Ee.fg("muted",n),`Summarizing branch... (${Ca("app.interrupt")} to cancel)`)}},QPe=class{invalidate(){}render(e){let n=" ".repeat(e);return[n,n]}}});var kys,uor,mG,Jbt=v(()=>{p();Tr();pi();Ll();ha();kys={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},uor={off:"No reasoning",minimal:"Very brief reasoning (~1k tokens)",low:"Light reasoning (~2k tokens)",medium:"Moderate reasoning (~8k tokens)",high:"Deep reasoning (~16k tokens)",xhigh:"Extra-high reasoning (~32k tokens)",max:"Maximum reasoning"},mG=class extends gn{searchInput;selectList;selectListChildIndex;allItems;onSelect;onCancel;onSelectAsDefault;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}constructor(e,n,r,i,s,o){super(),this.onSelect=r,this.onCancel=i,this.onSelectAsDefault=s,this.allItems=n.map(a=>({value:a,label:`${a===e?"\u2713 ":" "}${a}`,description:a===o?`${uor[a]} \xB7 default`:uor[a]})),this.addChild(new Un),this.addChild(new Tt(1)),this.addChild(new Et("Thinking Level",0,0)),this.addChild(new Tt(1)),this.addChild(new Et(`${qc("app.thinking.cycle")} cycles thinking levels in-session`,0,0)),this.addChild(new Tt(1)),this.searchInput=new ma,this.searchInput.onSubmit=()=>this.selectList.handleInput("\r"),this.addChild(this.searchInput),this.addChild(new Tt(1)),this.selectList=this.buildSelectList(this.allItems,e),this.selectListChildIndex=this.children.length,this.addChild(this.selectList),this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("dim",` ${qc("tui.select.confirm")} to select \xB7 ${qc("app.thinking.save")} to set as default \xB7 ${qc("tui.select.cancel")} to cancel`),0,0)),this.addChild(new Un)}buildSelectList(e,n){let r=new eh(e,Math.max(1,e.length),dS(),kys),i=e.findIndex(s=>s.value===n);return i!==-1&&r.setSelectedIndex(i),r.onSelect=s=>this.onSelect(s.value),r.onCancel=()=>this.onCancel(),r}applyFilter(e){let n=e?Pu(this.allItems,e,s=>`${s.value} ${s.description??""}`):this.allItems,r=this.selectList.getSelectedItem()?.value,i=this.buildSelectList(n,r);this.children[this.selectListChildIndex]=i,this.selectList=i}handleInput(e){let n=Ai();if(n.matches(e,"app.thinking.save")&&this.onSelectAsDefault){let i=this.selectList.getSelectedItem();i&&this.onSelectAsDefault(i.value);return}if(n.matches(e,"tui.select.up")||n.matches(e,"tui.select.down")||n.matches(e,"tui.select.confirm")||n.matches(e,"tui.select.cancel")){this.selectList.handleInput(e);return}this.searchInput.handleInput(e),this.applyFilter(this.searchInput.getValue())}getSelectList(){return this.selectList}}});var Bys,QS,Xbt=v(()=>{p();Tr();ok();tRe();pi();ha();Bys=10,QS=class extends gn{contentBox;contentText;contentTextRegion;selfRenderContainer;selfRenderHeight=0;callRendererComponent;resultRendererComponent;rendererState={};imageComponents=[];imageSpacers=[];toolName;toolCallId;args;expanded=!1;showImages;imageWidthCells;isPartial=!0;toolDefinition;ui;cwd;executionStarted=!1;argsComplete=!1;result;convertedImages=new Map;hideComponent=!1;constructor(e,n,r,i={},s,o,a){super(),this.toolName=e,this.toolCallId=n,this.args=r,this.toolDefinition=s,this.showImages=i.showImages??!0,this.imageWidthCells=i.imageWidthCells??60,this.ui=o,this.cwd=a,this.addChild(new Tt(1)),this.contentBox=new Ou(1,1,c=>Ee.bg("toolPendingBg",c)),this.contentText=new Et("",1,1,c=>Ee.bg("toolPendingBg",c)),this.contentTextRegion=this.createResultRegion(this.contentText),this.selfRenderContainer=new gn,this.hasRendererDefinition()?this.addChild(this.getRenderShell()==="self"?this.selfRenderContainer:this.contentBox):this.addChild(this.contentTextRegion),this.updateDisplay()}getCallRenderer(){return this.toolDefinition?.renderCall}getResultRenderer(){return this.toolDefinition?.renderResult}hasRendererDefinition(){return this.toolDefinition!==void 0}getRenderShell(){return this.toolDefinition?.renderShell??"default"}getRenderContext(e){return{args:this.args,toolCallId:this.toolCallId,invalidate:()=>{this.invalidate(),this.ui.requestRender()},lastComponent:e,state:this.rendererState,cwd:this.cwd,executionStarted:this.executionStarted,argsComplete:this.argsComplete,isPartial:this.isPartial,expanded:this.expanded,showImages:this.showImages,isError:this.result?.isError??!1}}createCallFallback(){return new Et(Ee.fg("toolTitle",Ee.bold(this.toolName)),0,0)}createResultFallback(){let e=this.getTextOutput();if(!e)return;let n=e.split(` +`),r=this.expanded?n:n.slice(0,Bys),i=n.length-r.length,s=r.map(o=>Ee.fg("toolOutput",o)).join(` +`);return i>0&&(s+=`${Ee.fg("muted",` +... (${i} more lines,`)} ${nr("app.tools.expand","to expand")}${Ee.fg("muted",")")}`),new Et(s,0,0)}createResultRegion(e){return new vA(e,n=>{if(!(!this.result||n.type!=="click"||n.button!=="left"))return this.setExpanded(!this.expanded),{handled:!0}})}updateArgs(e){this.args=e,this.updateDisplay()}markExecutionStarted(){this.executionStarted=!0,this.updateDisplay(),this.ui.requestRender()}setArgsComplete(){this.argsComplete=!0,this.updateDisplay(),this.ui.requestRender()}updateResult(e,n=!1){this.result=e,this.isPartial=n,this.updateDisplay(),this.maybeConvertImagesForKitty()}maybeConvertImagesForKitty(){if(Dl().images!=="kitty"||!this.result)return;let n=this.result.content.filter(r=>r.type==="image");for(let r=0;r{let l=this.result?.content.filter(d=>d.type==="image")[c];!u||l?.data!==s||l.mimeType!==o||(this.convertedImages.set(c,{sourceData:s,sourceMimeType:o,...u}),this.updateDisplay(),this.ui.requestRender())})}}setExpanded(e){this.expanded=e,this.updateDisplay()}setShowImages(e){this.showImages=e,this.updateDisplay()}setImageWidthCells(e){this.imageWidthCells=Math.max(1,Math.floor(e)),this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}render(e){if(this.hideComponent)return[];if(this.hasRendererDefinition()&&this.getRenderShell()==="self"){let n=this.selfRenderContainer.render(e);if(this.selfRenderHeight=n.length,n.length===0&&this.imageComponents.length===0)return[];let r=[];n.length>0&&(r.push(""),r.push(...n));for(let i=0;ithis.selfRenderHeight))return this.selfRenderContainer.handleMouse({...e,y:e.y-1,height:this.selfRenderHeight})}updateDisplay(){let e=this.isPartial?r=>Ee.bg("toolPendingBg",r):this.result?.isError?r=>Ee.bg("toolErrorBg",r):r=>Ee.bg("toolSuccessBg",r),n=!1;if(this.hideComponent=!1,this.hasRendererDefinition()){let r=this.getRenderShell()==="self"?this.selfRenderContainer:this.contentBox;r instanceof Ou&&r.setBgFn(e),r.clear();let i=this.getCallRenderer();if(!i)r.addChild(this.createResultRegion(this.createCallFallback())),n=!0;else try{let s=i(this.args,Ee,this.getRenderContext(this.callRendererComponent));this.callRendererComponent=s,r.addChild(this.createResultRegion(s)),n=!0}catch{this.callRendererComponent=void 0,r.addChild(this.createResultRegion(this.createCallFallback())),n=!0}if(this.result){let s=this.getResultRenderer();if(s)try{let o=s({content:this.result.content,details:this.result.details},{expanded:this.expanded,isPartial:this.isPartial},Ee,this.getRenderContext(this.resultRendererComponent));this.resultRendererComponent=o,r.addChild(this.createResultRegion(o)),n=!0}catch{this.resultRendererComponent=void 0;let o=this.createResultFallback();o&&(r.addChild(this.createResultRegion(o)),n=!0)}else{let o=this.createResultFallback();o&&(r.addChild(this.createResultRegion(o)),n=!0)}}}else this.contentText.setCustomBgFn(e),this.contentText.setText(this.formatToolExecution()),n=!0;for(let r of this.imageComponents)this.removeChild(r);this.imageComponents=[];for(let r of this.imageSpacers)this.removeChild(r);if(this.imageSpacers=[],this.result){let r=this.result.content.filter(s=>s.type==="image"),i=Dl();for(let s=0;sEe.fg("toolOutput",h)},{maxWidthCells:this.imageWidthCells});this.imageComponents.push(m),this.addChild(m)}}}this.hasRendererDefinition()&&!n&&this.imageComponents.length===0&&(this.hideComponent=!0)}getTextOutput(){return Lb(this.result,this.showImages)}formatToolExecution(){let e=Ee.fg("toolTitle",Ee.bold(this.toolName)),n=JSON.stringify(this.args,null,2);n&&(e+=` ${n}`);let r=this.getTextOutput();return r&&(e+=` -${r}`),e}};p();var CGs=2,IGs=4,xGs=20,wGs=2,TGs=12;function vGs(t,e){let n=Math.max(0,e-CGs),r=t.reduce((a,c)=>Math.max(a,c.bodyWidth),0),s=Math.max(0,r-n),i=t.find(a=>a.isSelected),o=0;if(i&&s>0){let a=Math.min(xGs,Math.max(IGs,Math.floor(n/3)));if(i.anchorCol>n-a){let c=Math.min(TGs,Math.max(wGs,Math.floor(n/4)));o=Math.min(s,i.anchorCol-c)}}return t.map(a=>{let c=o>0?`${a.gutter}${ic(a.body,o,n,!0)}\x1B[0m`:a.gutter+a.body;return pr(c,e,"")})}var Aat=class{flatNodes=[];filteredNodes=[];selectedIndex=0;currentLeafId;maxVisibleLines;filterMode="default";searchQuery="";toolCallMap=new Map;multipleRoots=!1;showLabelTimestamps=!1;activePathIds=new Set;visibleParentMap=new Map;visibleChildrenMap=new Map;lastSelectedId=null;foldedNodes=new Set;onSelect;onCancel;onCopy;onLabelEdit;constructor(e,n,r,s,i){this.currentLeafId=n,this.maxVisibleLines=r,this.filterMode=i??"default",this.multipleRoots=e.length>1,this.flatNodes=this.flattenTree(e),this.buildActivePath(),this.applyFilter();let o=s??n;this.selectedIndex=this.findNearestVisibleIndex(o),this.lastSelectedId=this.filteredNodes[this.selectedIndex]?.node.entry.id??null}findNearestVisibleIndex(e){if(this.filteredNodes.length===0)return 0;let n=new Map;for(let i of this.flatNodes)n.set(i.node.entry.id,i);let r=new Map(this.filteredNodes.map((i,o)=>[i.node.entry.id,o])),s=e;for(;s!==null;){let i=r.get(s);if(i!==void 0)return i;let o=n.get(s);if(!o)break;s=o.node.entry.parentId??null}return this.filteredNodes.length-1}buildActivePath(){if(this.activePathIds.clear(),!this.currentLeafId)return;let e=new Map;for(let r of this.flatNodes)e.set(r.node.entry.id,r);let n=this.currentLeafId;for(;n;){this.activePathIds.add(n);let r=e.get(n);if(!r)break;n=r.node.entry.parentId??null}}flattenTree(e){let n=[];this.toolCallMap.clear();let r=[],s=new Map,i=this.currentLeafId;{let c=[],u=[...e];for(;u.length>0;){let l=u.pop();c.push(l);for(let d=l.children.length-1;d>=0;d--)u.push(l.children[d])}for(let l=c.length-1;l>=0;l--){let d=c[l],h=i!==null&&d.entry.id===i;for(let m of d.children)s.get(m)&&(h=!0);s.set(d,h)}}let o=e.length>1,a=[...e].sort((c,u)=>Number(s.get(u))-Number(s.get(c)));for(let c=a.length-1;c>=0;c--){let u=c===a.length-1;r.push([a[c],o?1:0,o,o,u,[],o])}for(;r.length>0;){let[c,u,l,d,h,m,f]=r.pop(),g=c.entry;if(g.type==="message"&&g.message.role==="assistant"){let R=g.message.content;if(Array.isArray(R)){for(let N of R)if(typeof N=="object"&&N!==null&&"type"in N&&N.type==="toolCall"){let P=N;this.toolCallMap.set(P.id,{name:P.name,arguments:P.arguments})}}}n.push({node:c,indent:u,showConnector:d,isLast:h,gutters:m,isVirtualRootChild:f});let A=c.children,y=A.length>1,b=(()=>{let R=[],N=[];for(let P of A)s.get(P)?R.push(P):N.push(P);return[...R,...N]})(),S;y||l&&u>0?S=u+1:S=u;let C=d&&!f,I=this.multipleRoots?Math.max(0,u-1):u,x=Math.max(0,I-1),w=C?[...m,{position:x,show:!h}]:m;for(let R=b.length-1;R>=0;R--){let N=R===b.length-1;r.push([b[R],S,y,y,N,w,!1])}}return n}applyFilter(){this.filteredNodes.length>0&&(this.lastSelectedId=this.filteredNodes[this.selectedIndex]?.node.entry.id??this.lastSelectedId);let e=this.searchQuery.toLowerCase().split(/\s+/).filter(Boolean);if(this.filteredNodes=this.flatNodes.filter(n=>{let r=n.node.entry,s=r.id===this.currentLeafId;if(r.type==="message"&&r.message.role==="assistant"&&!s){let a=r.message,c=this.hasTextContent(a.content),u=a.stopReason&&a.stopReason!=="stop"&&a.stopReason!=="toolUse";if(!c&&!u)return!1}let i=!0,o=r.type==="label"||r.type==="custom"||r.type==="model_change"||r.type==="thinking_level_change"||r.type==="session_info";switch(this.filterMode){case"user-only":i=r.type==="message"&&r.message.role==="user";break;case"no-tools":i=!o&&!(r.type==="message"&&r.message.role==="toolResult");break;case"labeled-only":i=n.node.label!==void 0;break;case"all":i=!0;break;default:i=!o;break}if(!i)return!1;if(e.length>0){let a=this.getSearchableText(n.node).toLowerCase();return e.every(c=>a.includes(c))}return!0}),this.foldedNodes.size>0){let n=new Set;for(let r of this.flatNodes){let{id:s,parentId:i}=r.node.entry;i!=null&&(this.foldedNodes.has(i)||n.has(i))&&n.add(s)}this.filteredNodes=this.filteredNodes.filter(r=>!n.has(r.node.entry.id))}this.recalculateVisualStructure(),this.lastSelectedId?this.selectedIndex=this.findNearestVisibleIndex(this.lastSelectedId):this.selectedIndex>=this.filteredNodes.length&&(this.selectedIndex=Math.max(0,this.filteredNodes.length-1)),this.filteredNodes.length>0&&(this.lastSelectedId=this.filteredNodes[this.selectedIndex]?.node.entry.id??this.lastSelectedId)}recalculateVisualStructure(){if(this.filteredNodes.length===0)return;let e=new Set(this.filteredNodes.map(u=>u.node.entry.id)),n=new Map;for(let u of this.flatNodes)n.set(u.node.entry.id,u);let r=u=>{let l=n.get(u)?.node.entry.parentId??null;for(;l!==null;){if(e.has(l))return l;l=n.get(l)?.node.entry.parentId??null}return null},s=new Map,i=new Map;i.set(null,[]);for(let u of this.filteredNodes){let l=u.node.entry.id,d=r(l);s.set(l,d),i.has(d)||i.set(d,[]),i.get(d).push(l)}let o=i.get(null);this.multipleRoots=o.length>1;let a=new Map;for(let u of this.filteredNodes)a.set(u.node.entry.id,u);let c=[];for(let u=o.length-1;u>=0;u--){let l=u===o.length-1;c.push([o[u],this.multipleRoots?1:0,this.multipleRoots,this.multipleRoots,l,[],this.multipleRoots])}for(;c.length>0;){let[u,l,d,h,m,f,g]=c.pop(),A=a.get(u);if(!A)continue;A.indent=l,A.showConnector=h,A.isLast=m,A.gutters=f,A.isVirtualRootChild=g;let y=i.get(u)||[],b=y.length>1,S;b||d&&l>0?S=l+1:S=l;let C=h&&!g,I=this.multipleRoots?Math.max(0,l-1):l,x=Math.max(0,I-1),w=C?[...f,{position:x,show:!m}]:f;for(let R=y.length-1;R>=0;R--){let N=R===y.length-1;c.push([y[R],S,b,b,N,w,!1])}}this.visibleParentMap=s,this.visibleChildrenMap=i}getSearchableText(e){let n=e.entry,r=[];switch(e.label&&r.push(e.label),n.type){case"message":{let s=n.message;if(r.push(s.role),"content"in s&&s.content&&r.push(this.extractContent(s.content)),s.role==="bashExecution"){let i=s;i.command&&r.push(i.command)}break}case"custom_message":{r.push(n.customType),typeof n.content=="string"?r.push(n.content):r.push(this.extractContent(n.content));break}case"compaction":r.push("compaction");break;case"branch_summary":r.push("branch summary",n.summary);break;case"session_info":r.push("title"),n.name&&r.push(n.name);break;case"model_change":r.push("model",n.modelId);break;case"thinking_level_change":r.push("thinking",n.thinkingLevel);break;case"custom":r.push("custom",n.customType);break;case"label":r.push("label",n.label??"");break}return r.join(" ")}invalidate(){}getSearchQuery(){return this.searchQuery}getSelectedNode(){return this.filteredNodes[this.selectedIndex]?.node}copySelected(){let e=this.getSelectedNode();this.onCopy?.(e?this.getEntryCopyText(e):void 0)}updateNodeLabel(e,n,r){for(let s of this.flatNodes)if(s.node.entry.id===e){s.node.label=n,s.node.labelTimestamp=n?r??new Date().toISOString():void 0;break}}getStatusLabels(){let e="";switch(this.filterMode){case"no-tools":e+=" [no-tools]";break;case"user-only":e+=" [user]";break;case"labeled-only":e+=" [labeled]";break;case"all":e+=" [all]";break}return this.showLabelTimestamps&&(e+=" [+label time]"),e}render(e){let n=[];if(this.filteredNodes.length===0)return n.push(pr(Se.fg("muted"," No entries found"),e)),n.push(pr(Se.fg("muted",` (0/0)${this.getStatusLabels()}`),e)),n;let r=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisibleLines/2),this.filteredNodes.length-this.maxVisibleLines)),s=Math.min(r+this.maxVisibleLines,this.filteredNodes.length),i=[];for(let o=r;oZ.position===H);if(re)oe===0?g.push(re.show?"\u2502":" "):g.push(" ");else if(h&&H===m)if(oe===0)g.push(a.isLast?"\u2514":"\u251C");else if(oe===1){let Z=this.isFoldable(c.id);g.push(A?"\u229E":Z?"\u229F":"\u2500")}else g.push(" ");else g.push(" ")}let y=g.join(""),b=a.showConnector&&!a.isVirtualRootChild,S=A&&!b?Se.fg("accent","\u229E "):"",I=this.activePathIds.has(c.id)?Se.fg("accent","\u2022 "):"",x=a.node.label?Se.fg("warning",`[${a.node.label}] `):"",w=this.showLabelTimestamps&&a.node.label&&a.node.labelTimestamp?Se.fg("muted",`${this.formatLabelTimestamp(a.node.labelTimestamp)} `):"",R=this.getEntryDisplayText(a.node,u),N=Se.fg("dim",y)+S+I,P=nn(N),G=l,$=N+x+w+R;u&&(G=Se.bg("selectedBg",G),$=Se.bg("selectedBg",$)),i.push({gutter:G,body:$,anchorCol:P,bodyWidth:nn($),isSelected:u})}return n.push(...vGs(i,e)),n.push(pr(Se.fg("muted",` (${this.selectedIndex+1}/${this.filteredNodes.length})${this.getStatusLabels()}`),e)),n}getEntryDisplayText(e,n){let r=e.entry,s,i=o=>o.replace(/[\n\t]/g," ").trim();switch(r.type){case"message":{let o=r.message,a=o.role;if(a==="user"){let c=o,u=i(this.extractContent(c.content));s=Se.fg("accent","user: ")+u}else if(a==="assistant"){let c=o,u=i(this.extractContent(c.content));if(u)s=Se.fg("success","assistant: ")+u;else if(c.stopReason==="aborted")s=Se.fg("success","assistant: ")+Se.fg("muted","(aborted)");else if(c.errorMessage){let l=i(c.errorMessage).slice(0,80);s=Se.fg("success","assistant: ")+Se.fg("error",l)}else s=Se.fg("success","assistant: ")+Se.fg("muted","(no content)")}else if(a==="toolResult"){let c=o,u=c.toolCallId?this.toolCallMap.get(c.toolCallId):void 0;u?s=Se.fg("muted",this.formatToolCall(u.name,u.arguments)):s=Se.fg("muted",`[${c.toolName??"tool"}]`)}else if(a==="bashExecution"){let c=o;s=Se.fg("dim",`[bash]: ${i(c.command??"")}`)}else s=Se.fg("dim",`[${a}]`);break}case"custom_message":{let o=typeof r.content=="string"?r.content:r.content.filter(a=>a.type==="text").map(a=>a.text).join("");s=Se.fg("customMessageLabel",`[${r.customType}]: `)+i(o);break}case"compaction":{let o=Math.round(r.tokensBefore/1e3);s=Se.fg("borderAccent",`[compaction: ${o}k tokens]`);break}case"branch_summary":s=Se.fg("warning","[branch summary]: ")+i(r.summary);break;case"model_change":s=Se.fg("dim",`[model: ${r.modelId}]`);break;case"thinking_level_change":s=Se.fg("dim",`[thinking: ${r.thinkingLevel}]`);break;case"custom":s=Se.fg("dim",`[custom: ${r.customType}]`);break;case"label":s=Se.fg("dim",`[label: ${r.label??"(cleared)"}]`);break;case"session_info":s=r.name?[Se.fg("dim","[title: "),Se.fg("dim",r.name),Se.fg("dim","]")].join(""):[Se.fg("dim","[title: "),Se.italic(Se.fg("dim","empty")),Se.fg("dim","]")].join("");break;default:s=""}return n?Se.bold(s):s}formatLabelTimestamp(e){let n=new Date(e),r=new Date,s=n.getHours().toString().padStart(2,"0"),i=n.getMinutes().toString().padStart(2,"0"),o=`${s}:${i}`;if(n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate())return o;let a=n.getMonth()+1,c=n.getDate();return n.getFullYear()===r.getFullYear()?`${a}/${c} ${o}`:`${n.getFullYear().toString().slice(-2)}/${a}/${c} ${o}`}extractContent(e){return this.extractFullContent(e).slice(0,200)}extractFullContent(e){if(typeof e=="string")return e;if(!Array.isArray(e))return"";let n="";for(let r of e)typeof r=="object"&&r!==null&&"type"in r&&r.type==="text"&&(n+=r.text);return n}getEntryCopyText(e){let n=e.entry,r;switch(n.type){case"message":n.message.role==="bashExecution"?r=n.message.command:"content"in n.message&&(r=this.extractFullContent(n.message.content),!r&&n.message.role==="assistant"&&(r=n.message.errorMessage));break;case"custom_message":r=this.extractFullContent(n.content);break;case"compaction":r=n.summary;break;case"branch_summary":r=n.summary;break}return r?.trim()?r:void 0}hasTextContent(e){if(typeof e=="string")return e.trim().length>0;if(Array.isArray(e)){for(let n of e)if(typeof n=="object"&&n!==null&&"type"in n&&n.type==="text"){let r=n.text;if(r&&r.trim().length>0)return!0}}return!1}formatToolCall(e,n){let r=s=>{let i=process.env.HOME||process.env.USERPROFILE||"";return i&&s.startsWith(i)?`~${s.slice(i.length)}`:s};switch(e){case"read":{let s=r(String(n.path||n.file_path||"")),i=n.offset,o=n.limit,a=s;if(i!==void 0||o!==void 0){let c=i??1,u=o!==void 0?c+o-1:"";a+=`:${c}${u?`-${u}`:""}`}return`[read: ${a}]`}case"write":return`[write: ${r(String(n.path||n.file_path||""))}]`;case"edit":return`[edit: ${r(String(n.path||n.file_path||""))}]`;case"bash":{let s=String(n.command||"");return`[bash: ${s.replace(/[\n\t]/g," ").trim().slice(0,50)}${s.length>50?"...":""}]`}case"grep":{let s=String(n.pattern||""),i=r(String(n.path||"."));return`[grep: /${s}/ in ${i}]`}case"find":{let s=String(n.pattern||""),i=r(String(n.path||"."));return`[find: ${s} in ${i}]`}case"ls":return`[ls: ${r(String(n.path||"."))}]`;default:{let s=JSON.stringify(n).slice(0,40);return`[${e}: ${s}${JSON.stringify(n).length>40?"...":""}]`}}}handleInput(e){let n=ms();if(n.matches(e,"tui.select.up"))this.selectedIndex=this.selectedIndex===0?this.filteredNodes.length-1:this.selectedIndex-1;else if(n.matches(e,"tui.select.down"))this.selectedIndex=this.selectedIndex===this.filteredNodes.length-1?0:this.selectedIndex+1;else if(n.matches(e,"app.tree.foldOrUp")){let r=this.filteredNodes[this.selectedIndex]?.node.entry.id;r&&this.isFoldable(r)&&!this.foldedNodes.has(r)?(this.foldedNodes.add(r),this.applyFilter()):this.selectedIndex=this.findBranchSegmentStart("up")}else if(n.matches(e,"app.tree.unfoldOrDown")){let r=this.filteredNodes[this.selectedIndex]?.node.entry.id;r&&this.foldedNodes.has(r)?(this.foldedNodes.delete(r),this.applyFilter()):this.selectedIndex=this.findBranchSegmentStart("down")}else if(n.matches(e,"tui.editor.cursorLeft")||n.matches(e,"tui.select.pageUp"))this.selectedIndex=Math.max(0,this.selectedIndex-this.maxVisibleLines);else if(n.matches(e,"tui.editor.cursorRight")||n.matches(e,"tui.select.pageDown"))this.selectedIndex=Math.min(this.filteredNodes.length-1,this.selectedIndex+this.maxVisibleLines);else if(n.matches(e,"tui.select.confirm")){let r=this.filteredNodes[this.selectedIndex];r&&this.onSelect&&this.onSelect(r.node.entry.id)}else if(n.matches(e,"app.message.copy"))this.copySelected();else if(n.matches(e,"tui.select.cancel"))this.searchQuery?(this.searchQuery="",this.foldedNodes.clear(),this.applyFilter()):this.onCancel?.();else if(n.matches(e,"app.tree.filter.default"))this.filterMode="default",this.foldedNodes.clear(),this.applyFilter();else if(n.matches(e,"app.tree.filter.noTools"))this.filterMode=this.filterMode==="no-tools"?"default":"no-tools",this.foldedNodes.clear(),this.applyFilter();else if(n.matches(e,"app.tree.filter.userOnly"))this.filterMode=this.filterMode==="user-only"?"default":"user-only",this.foldedNodes.clear(),this.applyFilter();else if(n.matches(e,"app.tree.filter.labeledOnly"))this.filterMode=this.filterMode==="labeled-only"?"default":"labeled-only",this.foldedNodes.clear(),this.applyFilter();else if(n.matches(e,"app.tree.filter.all"))this.filterMode=this.filterMode==="all"?"default":"all",this.foldedNodes.clear(),this.applyFilter();else if(n.matches(e,"app.tree.filter.cycleBackward")){let r=["default","no-tools","user-only","labeled-only","all"],s=r.indexOf(this.filterMode);this.filterMode=r[(s-1+r.length)%r.length],this.foldedNodes.clear(),this.applyFilter()}else if(n.matches(e,"app.tree.filter.cycleForward")){let r=["default","no-tools","user-only","labeled-only","all"],s=r.indexOf(this.filterMode);this.filterMode=r[(s+1)%r.length],this.foldedNodes.clear(),this.applyFilter()}else if(n.matches(e,"tui.editor.deleteCharBackward"))this.searchQuery.length>0&&(this.searchQuery=this.searchQuery.slice(0,-1),this.foldedNodes.clear(),this.applyFilter());else if(n.matches(e,"app.tree.editLabel")){let r=this.filteredNodes[this.selectedIndex];r&&this.onLabelEdit&&this.onLabelEdit(r.node.entry.id,r.node.label)}else n.matches(e,"app.tree.toggleLabelTimestamp")?this.showLabelTimestamps=!this.showLabelTimestamps:![...e].some(s=>{let i=s.charCodeAt(0);return i<32||i===127||i>=128&&i<=159})&&e.length>0&&(this.searchQuery+=e,this.foldedNodes.clear(),this.applyFilter())}isFoldable(e){let n=this.visibleChildrenMap.get(e);if(!n||n.length===0)return!1;let r=this.visibleParentMap.get(e);if(r==null)return!0;let s=this.visibleChildrenMap.get(r);return s!==void 0&&s.length>1}findBranchSegmentStart(e){let n=this.filteredNodes[this.selectedIndex]?.node.entry.id;if(!n)return this.selectedIndex;let r=new Map(this.filteredNodes.map((i,o)=>[i.node.entry.id,o])),s=n;if(e==="down")for(;;){let i=this.visibleChildrenMap.get(s)??[];if(i.length===0)return r.get(s);if(i.length>1)return r.get(i[0]);s=i[0]}for(;;){let i=this.visibleParentMap.get(s)??null;if(i===null)return r.get(s);if((this.visibleChildrenMap.get(i)??[]).length>1){let a=r.get(s);if(a{let d=kGs(c);return d?l?`${u} ${d}`:`${d} ${u}`:u}),r=Math.max(1,e),s=" ",i=" \xB7 ",o=[],a="";for(let c of n){let u=a?`${a}${i}${c}`:nn(`${s}${c}`)<=r?`${s}${c}`:c;if(!a||nn(u)<=r){a=u;continue}o.push(...Xm(a.trimEnd(),r)),a=nn(`${s}${c}`)<=r?`${s}${c}`:c}return a&&o.push(...Xm(a.trimEnd(),r)),o.map(c=>Se.fg("muted",c))}},RGs=[{keys:["tui.select.up","tui.select.down"],label:"move"},{keys:["tui.editor.cursorLeft","tui.editor.cursorRight"],label:"page"},{keys:["app.tree.foldOrUp","app.tree.unfoldOrDown"],label:"branch"},{keys:["app.message.copy"],label:"copy"},{keys:["app.tree.editLabel"],label:"label"},{keys:["app.tree.toggleLabelTimestamp"],label:"label time"},{keys:["app.tree.filter.default","app.tree.filter.noTools","app.tree.filter.userOnly","app.tree.filter.labeledOnly","app.tree.filter.all"],label:"filters",labelFirst:!0},{keys:["app.tree.filter.cycleForward","app.tree.filter.cycleBackward"],label:"cycle",labelFirst:!0}];function kGs(t){let e=[];for(let n of t){let r=ms().getKeys(n)[0];r!==void 0&&e.push(r)}return e.length===0?"":mL(NGs(e)).replace(/\bpageUp\b/g,"pgup").replace(/\bpageDown\b/g,"pgdn").replace(/\bup\b/g,"\u2191").replace(/\bdown\b/g,"\u2193").replace(/\bleft\b/g,"\u2190").replace(/\bright\b/g,"\u2192")}function NGs(t){if(t.length===1)return t[0];let e=t.map(r=>{let s=r.lastIndexOf("+");return s===-1?{prefix:"",suffix:r}:{prefix:r.slice(0,s+1),suffix:r.slice(s+1)}}),n=e[0].prefix;return n&&e.every(r=>r.prefix===n)?`${n}${e.map(r=>r.suffix).join("/")}`:t.join("/")}var bat=class{input;entryId;onSubmit;onCancel;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.input.focused=e}constructor(e,n){this.entryId=e,this.input=new jo,n&&this.input.setValue(n)}invalidate(){}render(e){let n=[],s=e-2;return n.push(pr(` ${Se.fg("muted","Label (empty to remove):")}`,e)),n.push(...this.input.render(s).map(i=>pr(` ${i}`,e))),n.push(pr(` ${er("tui.select.confirm","save")} ${er("tui.select.cancel","cancel")}`,e)),n}handleInput(e){let n=ms();if(n.matches(e,"tui.select.confirm")){let r=this.input.getValue().trim();this.onSubmit?.(this.entryId,r||void 0)}else n.matches(e,"tui.select.cancel")?this.onCancel?.():this.input.handleInput(e)}},qF=class extends _n{treeList;labelInput=null;labelInputContainer;treeContainer;onLabelChangeCallback;onCopy;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.labelInput&&(this.labelInput.focused=e)}constructor(e,n,r,s,i,o,a,c){super(),this.onLabelChangeCallback=o;let u=Math.max(5,Math.floor(r/2));this.treeList=new Aat(e,n,u,a,c),this.treeList.onSelect=s,this.treeList.onCancel=i,this.treeList.onCopy=l=>this.onCopy?.(l),this.treeList.onLabelEdit=(l,d)=>this.showLabelInput(l,d),this.treeContainer=new _n,this.treeContainer.addChild(this.treeList),this.labelInputContainer=new _n,this.addChild(new Nt(1)),this.addChild(new Ln),this.addChild(new yt(Se.bold(" Session Tree"),1,0)),this.addChild(new Eat),this.addChild(new yat(this.treeList)),this.addChild(new Ln),this.addChild(new Nt(1)),this.addChild(this.treeContainer),this.addChild(this.labelInputContainer),this.addChild(new Nt(1)),this.addChild(new Ln),e.length===0&&setTimeout(()=>i(),100)}showLabelInput(e,n){this.labelInput=new bat(e,n),this.labelInput.onSubmit=(r,s)=>{this.treeList.updateNodeLabel(r,s),this.onLabelChangeCallback?.(r,s),this.hideLabelInput()},this.labelInput.onCancel=()=>this.hideLabelInput(),this.labelInput.focused=this._focused,this.treeContainer.clear(),this.labelInputContainer.clear(),this.labelInputContainer.addChild(this.labelInput)}hideLabelInput(){this.labelInput=null,this.labelInputContainer.clear(),this.treeContainer.clear(),this.treeContainer.addChild(this.treeList)}handleInput(e){this.labelInput?this.labelInput.handleInput(e):this.treeList.handleInput(e)}getTreeList(){return this.treeList}};p();function DGs(t,e){if(e===null)return"none";let n=e.decision?"trusted":"untrusted";return t!==void 0&&e.path!==t?`${n} (inherited from ${e.path})`:`${n} (${e.path})`}var Ine=class extends _n{selectedIndex;listContainer;trustOptions;savedDecision;onSelectCallback;onCancelCallback;constructor(e){super(),this.savedDecision=e.savedDecision,this.trustOptions=zwe(e.cwd),this.selectedIndex=Math.max(0,this.trustOptions.findIndex(n=>this.isSavedOption(n))),this.onSelectCallback=e.onSelect,this.onCancelCallback=e.onCancel,this.addChild(new Ln),this.addChild(new Nt(1)),this.addChild(new yt(Se.fg("accent",Se.bold("Project trust")),1,0)),this.addChild(new yt(Se.fg("muted",e.cwd),1,0)),this.addChild(new Nt(1)),this.addChild(new yt(Se.fg("muted",`Saved decision: ${DGs(this.trustOptions[0]?.savedPath,e.savedDecision)}`),1,0)),this.addChild(new yt(Se.fg("muted",`Current session: ${e.projectTrusted?"trusted":"untrusted"}`),1,0)),this.addChild(new Nt(1)),this.listContainer=new _n,this.addChild(this.listContainer),this.addChild(new Nt(1)),this.addChild(new yt(ml("\u2191\u2193","navigate")+" "+er("tui.select.confirm","save")+" "+er("tui.select.cancel","cancel"),1,0)),this.addChild(new Nt(1)),this.addChild(new Ln),this.updateList()}isSavedOption(e){return e.savedPath!==void 0&&this.savedDecision?.decision===e.trusted&&this.savedDecision.path===e.savedPath}updateList(){this.listContainer.clear();for(let e=0;eSe.bg("userMessageBg",n));e.addChild(new Hc(this.text,0,0,this.markdownTheme,{color:n=>Se.fg("userMessageText",n)},{preserveOrderedListMarkers:!0,preserveBackslashEscapes:!0,transform:une("user",!1,this.markdownTransformers)})),this.addChild(e)}render(e){let n=super.render(e);return n.length===0||(n[0]=BGs+n[0],n[n.length-1]=PGs+OGs+n[n.length-1]),n}};p();var _at=class{messages=[];selectedIndex=0;onSelect;onCancel;maxVisible=10;constructor(e,n){this.messages=e;let r=n?e.findIndex(s=>s.id===n):-1;this.selectedIndex=r>=0?r:Math.max(0,e.length-1)}invalidate(){}render(e){let n=[];if(this.messages.length===0)return n.push(Se.fg("muted"," No user messages found")),n;let r=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.messages.length-this.maxVisible)),s=Math.min(r+this.maxVisible,this.messages.length);for(let i=r;i0||sr(),100)}getMessageList(){return this.messageList}};p();var ITe=require("node:child_process"),WMn=Gt(require("node:crypto"),1),RV=Gt(require("node:fs"),1),qMn=Gt(require("node:os"),1),CTe=Gt(require("node:path"),1);p();var s1=class extends _n{loader;cancellable;signalController;constructor(e,n,r,s){super(),this.cancellable=s?.cancellable??!0;let i=o=>n.fg("border",o);this.addChild(new Ln(i)),this.cancellable?this.loader=new hH(e,o=>n.fg("accent",o),o=>n.fg("muted",o),r):(this.signalController=new AbortController,this.loader=new qE(e,o=>n.fg("accent",o),o=>n.fg("muted",o),r)),this.addChild(this.loader),this.cancellable&&(this.addChild(new Nt(1)),this.addChild(new yt(er("tui.select.cancel","cancel"),1,0))),this.addChild(new Nt(1)),this.addChild(new Ln(i))}get signal(){return this.cancellable?this.loader.signal:this.signalController?.signal??new AbortController().signal}set onAbort(e){this.cancellable&&(this.loader.onAbort=e)}handleInput(e){this.cancellable&&this.loader.handleInput(e)}dispose(){"dispose"in this.loader&&typeof this.loader.dispose=="function"?this.loader.dispose():"stop"in this.loader&&typeof this.loader.stop=="function"&&this.loader.stop()}};function MGs(t,e){CCe(e.sessionManager,t,(n,r)=>[{type:"custom",customType:"pi.share",id:WMn.randomUUID().slice(0,8),parentId:n,timestamp:r,data:{systemPrompt:e.state.systemPrompt,tools:e.state.tools.map(s=>({name:s.name,description:s.description,parameters:s.parameters}))}}])}async function HMn(t){let e=RV.mkdtempSync(CTe.join(qMn.tmpdir(),"pi-share-")),n=CTe.join(e,"session.jsonl"),r=CTe.join(e,"session.html");try{try{MGs(n,t.session)}catch(s){t.showError(`Failed to export session: ${s instanceof Error?s.message:"Unknown error"}`);return}if(await LGs(n,t))return;try{if((0,ITe.spawnSync)("gh",["auth","status"],{encoding:"utf-8"}).status!==0){t.showError("GitHub CLI is not logged in. Run 'gh auth login' first.");return}}catch{t.showError("GitHub CLI (gh) is not installed. Install it from https://cli.github.com/");return}try{await t.session.exportToHtml(r,{themeName:Se.name})}catch(s){t.showError(`Failed to export session: ${s instanceof Error?s.message:"Unknown error"}`);return}await FGs(r,t)}finally{try{RV.rmSync(e,{recursive:!0,force:!0})}catch{}}}async function LGs(t,e){if(!e.session.modelRuntime.getProvider("radius"))return!1;let r=gV(await e.session.modelRuntime.getAuth("radius",{minOAuthValidityMs:5*6e4}));if(!r)return!1;let s=new s1(e.ui,Se,"Uploading to Radius...");e.editorContainer.clear(),e.editorContainer.addChild(s),e.ui.setFocus(s),e.ui.requestRender(),s.onAbort=()=>{vV(s,e),e.showStatus("Share cancelled")};try{let i=RV.readFileSync(t),o=new URL("/v1/artifacts",yEe);o.searchParams.set("visibility","organization"),o.searchParams.set("title","Pi session");let a=await fetch(o,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/x-ndjson","Content-Length":String(i.byteLength)},body:i,signal:s.signal});if(s.signal.aborted)return!0;let c=await a.json().catch(()=>null);if(s.signal.aborted)return!0;if(vV(s,e),!a.ok||!c?.artifact)return e.showError(`Failed to upload Radius artifact: ${c?.error||a.statusText||a.status}`),!0;let u=c.artifact.canonical_url;return e.showStatus(`Share URL: ${jA(u,u)}`),!0}catch(i){return s.signal.aborted||(vV(s,e),e.showError(`Failed to upload Radius artifact: ${i instanceof Error?i.message:"Unknown error"}`)),!0}}async function FGs(t,e){let n=new s1(e.ui,Se,"Creating gist...");e.editorContainer.clear(),e.editorContainer.addChild(n),e.ui.setFocus(n),e.ui.requestRender();let r=null;n.onAbort=()=>{r?.kill(),vV(n,e),e.showStatus("Share cancelled")};try{let s=await new Promise(c=>{r=(0,ITe.spawn)("gh",["gist","create","--public=false",t]);let u="",l="";r.stdout?.on("data",d=>{u+=d.toString()}),r.stderr?.on("data",d=>{l+=d.toString()}),r.on("close",d=>c({stdout:u,stderr:l,code:d}))});if(n.signal.aborted)return;if(vV(n,e),s.code!==0){e.showError(`Failed to create gist: ${s.stderr?.trim()||"Unknown error"}`);return}let i=s.stdout?.trim(),o=i?.split("/").pop();if(!o){e.showError("Failed to parse gist ID from gh output");return}let a=mrn(o);e.showStatus(`Share URL: ${jA(a,a)} -Gist: ${jA(i,i)}`)}catch(s){n.signal.aborted||(vV(n,e),e.showError(`Failed to create gist: ${s instanceof Error?s.message:"Unknown error"}`))}}function vV(t,e){t.dispose(),e.editorContainer.clear(),e.editorContainer.addChild(e.editor),e.ui.setFocus(e.editor)}p();var xTe=class{ui;getSettingsManager;showError;onChanged;currentThemeSetting;terminalTheme=BH().theme;activeThemeName;autoSyncEnabled=!1;terminalColorSchemeUnsubscribe;constructor(e,n){this.ui=e,this.getSettingsManager=n.getSettingsManager,this.showError=n.showError,this.onChanged=n.onChanged,this.currentThemeSetting=n.initialThemeSetting,this.activeThemeName=DH(this.currentThemeSetting??this.getSettingsManager().getThemeSetting(),this.terminalTheme),KC(this.activeThemeName,!0),this.bindTerminalColorSchemeListener()}rebindTui(){this.terminalColorSchemeUnsubscribe?.(),this.bindTerminalColorSchemeListener(),this.ui.setTerminalColorSchemeNotifications(this.autoSyncEnabled)}async applyFromSettings(){let e=this.getSettingsManager(),n=this.currentThemeSetting??e.getThemeSetting(),r=rT(n);if(r){this.terminalTheme=await MX({ui:this.ui,timeoutMs:100}),this.setAutoSync(!0),this.applyThemeName(this.terminalTheme==="light"?r.lightTheme:r.darkTheme,!0);return}if(this.setAutoSync(!1),n!==void 0){this.applyThemeName(n,!0);return}let s=await Oze({ui:this.ui,timeoutMs:100});this.terminalTheme=s.theme,this.applyThemeName(s.theme).success&&s.confidence==="high"&&(e.setTheme(s.theme),await e.flush())}getThemeSelection(){return this.currentThemeSetting??this.getSettingsManager().getThemeSetting()??this.activeThemeName}setThemeName(e,n=!1){this.setAutoSync(!1);let r=this.applyThemeName(e,n);return r.success&&(this.currentThemeSetting=e),r}async setThemeSetting(e){this.currentThemeSetting=e,await this.applyFromSettings()}setThemeInstance(e){return this.setAutoSync(!1),Whn(e),this.activeThemeName="",this.notifyChanged(),{success:!0}}preview(e){let n=DH(e,this.terminalTheme)??this.activeThemeName;n&&qM(n,!0).success&&(this.ui.invalidate(),this.ui.requestRender())}disableAutoSync(){this.setAutoSync(!1)}dispose(){this.setAutoSync(!1),this.terminalColorSchemeUnsubscribe?.(),this.terminalColorSchemeUnsubscribe=void 0}getTerminalTheme(){return this.terminalTheme}applyThemeName(e,n=!1){let r=qM(e,!0);return this.activeThemeName=r.success?e:"dark",this.notifyChanged(),!r.success&&n&&this.showError(`Failed to load theme "${e}": ${r.error} -Fell back to dark theme.`),r}notifyChanged(){this.ui.invalidate(),this.onChanged()}setAutoSync(e){this.autoSyncEnabled!==e&&(this.autoSyncEnabled=e,this.ui.setTerminalColorSchemeNotifications(e))}bindTerminalColorSchemeListener(){this.terminalColorSchemeUnsubscribe=this.ui.onTerminalColorSchemeChange(e=>this.applyTerminalTheme(e))}applyTerminalTheme(e){if(!this.autoSyncEnabled)return;this.terminalTheme=e;let n=rT(this.currentThemeSetting??this.getSettingsManager().getThemeSetting());if(!n){this.setAutoSync(!1);return}let r=e==="light"?n.lightTheme:n.darkTheme;r!==this.activeThemeName&&this.applyThemeName(r)}};p();function wTe(t){let e=t.terminal??new YC;if(t.tuiMode==="fullscreen"){let n=r=>Se.bg("searchMatchBg",Se.fg("searchMatchText",r));return new u0(e,t.showHardwareCursor,t.logDirectory,{searchMatchStyle:r=>Se.underline(n(r)),searchCurrentMatchStyle:r=>Se.bold(Se.inverse(n(r))),searchNavigationButtonStyle:(r,s)=>s?Se.underline(r):r,scrollToEndIndicator:()=>{let r=oc("tui.altScreen.bottom"),s=` \u2193 Jump to latest message${r?` \xB7 ${r}`:""} `;return Se.bg("selectedBg",Se.fg("text",s))},openUrl:hTe,onRightClickPaste:t.onRightClickPaste,copyOnSelect:t.fullscreenCopyOnSelect,copySelection:async r=>{try{return await TF(r),!0}catch{return!1}}})}return new JA(e,t.showHardwareCursor,t.logDirectory)}function Sat(t){return new Proxy({},{get:(e,n)=>{let r=t(),s=Reflect.get(r,n,r);if(typeof s!="function")return s;let i=r,o=s;return(...a)=>{let c=t();if(c!==i){let u=Reflect.get(c,n,c);if(typeof u!="function")throw new TypeError(`TUI property ${String(n)} is not callable`);i=c,o=u}return Reflect.apply(o,i,a)}},set:(e,n,r)=>{let s=t();return Reflect.set(s,n,r,s)},has:(e,n)=>Reflect.has(t(),n),getPrototypeOf:()=>Reflect.getPrototypeOf(t())})}function VMn(t){return"embedWorkingStatus"in t&&t.embedWorkingStatus===!0&&"setWorkingStatusIndicator"in t&&typeof t.setWorkingStatusIndicator=="function"}function xne(t){return typeof t=="object"&&t!==null&&"setExpanded"in t&&typeof t.setExpanded=="function"}var TTe=class extends yt{getCollapsedText;getExpandedText;constructor(e,n,r=!1,s=0,i=0){super(r?n():e(),s,i),this.getCollapsedText=e,this.getExpandedText=n}setExpanded(e){this.setText(e?this.getExpandedText():this.getCollapsedText())}};function UGs(t){return"type"in t&&t.type==="custom"}function $Gs(t){return"type"in t&&t.type==="compaction_cost"}var GGs=new Set(["EIO","EPIPE","ENOTCONN"]);function WGs(t){if(!t||typeof t!="object"||!("code"in t))return!1;let e=t.code;return e!==void 0&&GGs.has(e)}var jMn="Anthropic subscription auth is active. Third-party harness usage draws from extra usage and is billed per token, not your Claude plan limits. Manage extra usage at https://claude.ai/settings/usage. Disable this warning in /settings.";function qGs(t){return typeof t=="string"&&t.startsWith("sk-ant-oat")}function HGs(t){return!!t&&t.provider==="unknown"&&t.id==="unknown"&&t.api==="unknown"}function VGs(t){return t.length>0&&!/[^a-zA-Z0-9_\-./~:@]/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}function jGs(t){if(!process.stdout.isTTY||!t.isPersisted())return;let e=t.getSessionFile();if(!e||!VF.existsSync(e))return;let n=[An];return t.usesDefaultSessionDir()||n.push("--session-dir",VGs(t.getSessionDir())),n.push("--session",t.getSessionId()),n.join(" ")}function YGs(t){return t in p4}function KGs(t,e){return e===0?`${t}. No llama.cpp models are loaded. Use /llama to load a model, then /model to select it.`:`${t}. Use /model to select a loaded llama.cpp model, or /llama to manage models.`}var YMn={oauth:0,api_key:1};function Cat(t,e,n,r){let s=Wl(t,e,n);return s.length===0?null:s.map(r)}function zGs(t){let e=new Map;for(let n of t){let r=e.get(n.id);if(r){r.authTypes.includes(n.authType)||(r.authTypes.push(n.authType),r.authTypes.sort((s,i)=>YMn[s]-YMn[i]));continue}e.set(n.id,{id:n.id,name:n.name,authTypes:[n.authType]})}return Array.from(e.values()).sort((n,r)=>n.name.localeCompare(r.name))}function JGs(t){let e=t.authTypes.map(n=>`${n} ${bTe(n)}`).join(" ");return`${t.id} ${t.name} ${e}`}function XGs(t){let e=t.authTypes.map(bTe).join("/");return t.name===t.id?e:`${t.name} \xB7 ${e}`}var jF=class t{runtimeHost;renderer;ui;mainScreenRenderState;loadedResourcesContainer;chatContainer;documentContainer;transcriptScrollView;fullscreenLayoutRoot;pendingMessagesContainer;statusContainer;defaultEditor;editor;editorComponentFactory;autocompleteProvider;autocompleteProviderWrappers=[];fdPath;editorContainer;activeSelectorToken;activeSelectorDispose;footer;footerContainer;footerDataProvider;keybindings;version;isInitialized=!1;onInputCallback;pendingUserInputs=[];activeStatusIndicator=void 0;activeWorkingIndicatorEmbedded=!1;idleStatus=new STe;workingMessage=void 0;workingVisible=!0;workingIndicatorOptions=void 0;defaultWorkingMessage="Working";defaultHiddenThinkingLabel="Thinking...";hiddenThinkingLabel=this.defaultHiddenThinkingLabel;lastSigintTime=0;lastEscapeTime=0;changelogMarkdown=void 0;startupNoticesShown=!1;anthropicSubscriptionWarningShown=!1;lastStatusSpacer=void 0;lastStatusText=void 0;managedToolStatusStarted=!1;streamingComponent=void 0;streamingMessage=void 0;pendingTools=new Map;toolOutputExpanded=!1;hideThinkingBlock=!1;outputPad=1;mermaidMarkdownTransformer=BMn({getMode:()=>this.settingsManager.getMermaidRenderingMode(),theme:Se});skillCommands=new Map;unsubscribe;signalCleanupHandlers=[];isBashMode=!1;bashComponent=void 0;pendingBashComponents=[];autoCompactionEscapeHandler;retryEscapeHandler;compactionQueuedMessages=[];shutdownRequested=!1;extensionSelector=void 0;extensionInput=void 0;extensionEditor=void 0;extensionTerminalInputSubscriptions=new Set;extensionWidgetsAbove=new Map;extensionWidgetsBelow=new Map;widgetContainerAbove;widgetContainerBelow;customFooter=void 0;headerContainer;builtInHeader=void 0;customHeader=void 0;options;onRightClickPaste=()=>{this.handleRightClickPaste()};autoTrustOnReloadCwd;themeController;get session(){return this.runtimeHost.session}get agent(){return this.session.agent}get sessionManager(){return this.session.sessionManager}get settingsManager(){return this.session.settingsManager}constructor(e,n={}){this.runtimeHost=e,zw(this.settingsManager.getTerminalCapabilityOverrides());let r=n.tuiMode??this.settingsManager.getTuiMode();this.options={...n,tuiMode:r},this.autoTrustOnReloadCwd=n.autoTrustOnReloadCwd,this.runtimeHost.setBeforeSessionInvalidate(()=>{this.resetExtensionUI()}),this.runtimeHost.setRebindSession(async()=>{await this.rebindCurrentSession({renderBeforeBind:!0}),await this.themeController.applyFromSettings()}),this.version=Ad,this.renderer=wTe({tuiMode:r,showHardwareCursor:this.settingsManager.getShowHardwareCursor(),logDirectory:ls(),onRightClickPaste:this.onRightClickPaste,fullscreenCopyOnSelect:this.settingsManager.getFullscreenCopyOnSelect()}),this.ui=Sat(()=>this.renderer),this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink()),this.headerContainer=new _n,this.loadedResourcesContainer=new _n,this.chatContainer=new _n,this.documentContainer=new _n,this.documentContainer.addChild(this.headerContainer),this.documentContainer.addChild(this.loadedResourcesContainer),this.documentContainer.addChild(this.chatContainer),this.pendingMessagesContainer=new _n,this.statusContainer=new _n,this.widgetContainerAbove=new _n,this.widgetContainerBelow=new _n,this.keybindings=RI.create(),kN(this.keybindings);let s=this.settingsManager.getEditorPaddingX(),i=this.settingsManager.getAutocompleteMaxVisible();this.defaultEditor=new NF(this.ui,LX(),this.keybindings,{paddingX:s,autocompleteMaxVisible:i,embedWorkingStatus:!0}),this.editor=this.defaultEditor,this.editorContainer=new _n,this.editorContainer.addChild(this.editor),this.footerDataProvider=new BIe(this.sessionManager.getCwd()),this.footer=new BF(this.session,this.footerDataProvider),this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled),this.footerContainer=new _n,this.footerContainer.addChild(this.footer),this.hideThinkingBlock=this.settingsManager.getHideThinkingBlock(),this.outputPad=this.settingsManager.getOutputPad(),PH(this.session.resourceLoader.getThemes().themes),this.themeController=new xTe(this.ui,{getSettingsManager:()=>this.settingsManager,showError:o=>this.showError(o),onChanged:()=>this.updateEditorBorderColor(),initialThemeSetting:n.initialThemeSetting})}getAutocompleteSourceTag(e){if(!e)return;let n=e.scope==="user"?"u":e.scope==="project"?"p":"t",r=e.source.trim();if(r==="auto"||r==="local"||r==="cli")return n;if(r.startsWith("npm:"))return`${n}:${r}`;let s=Uee(r);if(s){let i=s.ref?`@${s.ref}`:"";return`${n}:git:${s.host}/${s.path}${i}`}return n}prefixAutocompleteDescription(e,n){let r=this.getAutocompleteSourceTag(n);return r?e?`[${r}] ${e}`:`[${r}]`:e}getBuiltInCommandConflictDiagnostics(e){let n=new Set(Mot.map(r=>r.name));return e.getRegisteredCommands().filter(r=>n.has(r.name)).map(r=>({type:"warning",message:r.invocationName===r.name?`Extension command '/${r.name}' conflicts with built-in interactive command. Skipping in autocomplete.`:`Extension command '/${r.name}' conflicts with built-in interactive command. Available as '/${r.invocationName}'.`,path:r.sourceInfo.path}))}createBaseAutocompleteProvider(){let e=Mot.map(u=>({name:u.name,description:u.description,...u.argumentHint&&{argumentHint:u.argumentHint}})),n=e.find(u=>u.name==="model");n&&(n.getArgumentCompletions=u=>{let l=this.session.scopedModels.length>0?this.session.scopedModels.map(h=>h.model):this.session.modelRuntime.getAvailableSnapshot();if(l.length===0)return null;let d=l.map(h=>({id:h.id,provider:h.provider,name:h.name,label:`${h.provider}/${h.id}`}));return Cat(d,u,ETe,h=>({value:h.label,label:h.id,description:h.provider}))});let r=e.find(u=>u.name==="thinking");r&&(r.getArgumentCompletions=u=>Cat(this.session.getAvailableThinkingLevels(),u,l=>l,l=>({value:l,label:l})));let s=e.find(u=>u.name==="login");s&&(s.getArgumentCompletions=u=>{let l=zGs(this.getLoginProviderOptions());return Cat(l,u,JGs,d=>({value:d.id,label:d.id,description:XGs(d)}))});let i=this.session.promptTemplates.map(u=>({name:u.name,description:this.prefixAutocompleteDescription(u.description,u.sourceInfo),...u.argumentHint&&{argumentHint:u.argumentHint}})),o=new Set(e.map(u=>u.name)),a=this.session.extensionRunner.getRegisteredCommands().filter(u=>!o.has(u.name)).map(u=>({name:u.invocationName,description:this.prefixAutocompleteDescription(u.description,u.sourceInfo),getArgumentCompletions:u.getArgumentCompletions}));this.skillCommands.clear();let c=[];if(this.settingsManager.getEnableSkillCommands())for(let u of this.session.resourceLoader.getSkills().skills){let l=`skill:${u.name}`;this.skillCommands.set(l,u.filePath),c.push({name:l,description:this.prefixAutocompleteDescription(u.description,u.sourceInfo)})}return new J3([...e,...i,...a,...c],this.sessionManager.getCwd(),this.fdPath)}setupAutocompleteProvider(){let e=this.createBaseAutocompleteProvider(),n=[];for(let r of this.autocompleteProviderWrappers)e=r(e),n.push(...e.triggerCharacters??[]);n.length>0&&(e.triggerCharacters=[...new Set(n)]),this.autocompleteProvider=e,this.defaultEditor.setAutocompleteProvider(e),this.editor!==this.defaultEditor&&this.editor.setAutocompleteProvider?.(e)}showStartupNoticesIfNeeded(){if(!this.startupNoticesShown&&(this.startupNoticesShown=!0,!!this.changelogMarkdown)){if(this.chatContainer.children.length>0&&this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new Ln),this.settingsManager.getCollapseChangelog()){let e=this.changelogMarkdown.match(/##\s+\[?(\d+\.\d+\.\d+)\]?/),r=`Updated to v${e?e[1]:this.version}. Use ${Se.bold("/changelog")} to view full changelog.`;this.chatContainer.addChild(new yt(r,1,0))}else this.chatContainer.addChild(new yt(Se.bold(Se.fg("accent","What's New")),1,0)),this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new Hc(this.changelogMarkdown.trim(),1,0,this.getMarkdownThemeWithSettings())),this.chatContainer.addChild(new Nt(1));this.chatContainer.addChild(new Ln)}}mountInteractiveTui(e,n){for(let r of n)e.addChild(r);if(_X(e)){if(!this.fullscreenLayoutRoot)throw new Error("Fullscreen layout is not initialized");e.setLayoutRoot(this.fullscreenLayoutRoot)}}stopInteractiveTui(e){if(this.renderer.mode==="fullscreen"&&e==="transcript"){for(;this.renderer.hasOverlayEntries;)this.renderer.hideOverlay();this.switchTuiMode("regular",!1,!1),this.renderer.renderNow()}this.ui.stop({preserveScreen:this.renderer.mode==="fullscreen"})}switchTuiMode(e,n=!0,r=!0){let s=this.renderer;if(e===s.mode)return!0;if(s.hasOverlayEntries)return!1;let i=[...s.children],o=s.getFocusedComponent(),a=s.terminal,c=s.getShowHardwareCursor(),u=s.getClearOnShrink(),l=s.onDebug;s instanceof JA&&(this.mainScreenRenderState=s.captureRenderState()),s.stop({preserveScreen:!0}),s.setFocus(null),s.clear(),_X(s)&&s.setLayoutRoot(void 0);let d=wTe({tuiMode:e,showHardwareCursor:c,logDirectory:ls(),terminal:a,onRightClickPaste:this.onRightClickPaste,fullscreenCopyOnSelect:this.settingsManager.getFullscreenCopyOnSelect()});return d.setClearOnShrink(u),d.onDebug=l,d instanceof JA&&this.mainScreenRenderState&&d.restoreRenderState(this.mainScreenRenderState),this.renderer=d,this.options.tuiMode=e,this.mountInteractiveTui(d,i),d.invalidate(),d.setFocus(o),r&&(d.start(),this.themeController.rebindTui(),this.rebindExtensionTerminalInputListeners(),n&&this.settingsManager.getShowTerminalProgress()&&(this.session.isStreaming||this.session.isCompacting)&&a.setProgress(!0)),!0}async init(){if(this.isInitialized)return;if(this.registerSignalHandlers(),this.changelogMarkdown=this.getChangelogForDisplay(),this.session.scopedModels.length>0&&(this.options.verbose||!this.settingsManager.getQuietStartup())){let r=this.session.scopedModels.map(o=>{let a=o.thinkingLevel?`:${o.thinkingLevel}`:"";return`${o.model.id}${a}`}).join(", "),s=this.keybindings.getKeys("app.model.cycleForward"),i=s.length>0?Se.fg("muted",` (${mL(s.join("/"),{capitalize:!0})} to cycle)`):"";console.log(Se.fg("dim",`Model scope: ${r}${i}`))}this.renderWidgets();let e=POn({document:this.documentContainer,pendingMessages:this.pendingMessagesContainer,status:this.statusContainer,widgetsAbove:this.widgetContainerAbove,editor:this.editorContainer,widgetsBelow:this.widgetContainerBelow,footer:this.footerContainer,scrollbar:this.settingsManager.getFullscreenScrollbar(),scrollbarTrackStyle:r=>Se.fg("scrollbarTrack",r),scrollbarThumbStyle:r=>Se.fg("scrollbarThumb",r)});if(this.transcriptScrollView=e.transcript,this.fullscreenLayoutRoot=e.root,this.mountInteractiveTui(this.renderer,[this.documentContainer,this.pendingMessagesContainer,this.statusContainer,this.widgetContainerAbove,this.editorContainer,this.widgetContainerBelow,this.footerContainer]),this.defaultEditor.onAction("app.clear",()=>this.handleCtrlC()),this.defaultEditor.onCtrlD=()=>this.handleCtrlD(),this.defaultEditor.onSubmit=r=>this.handleStartupSubmit(r),this.ui.setFocus(this.editor),this.ui.start(),this.isInitialized=!0,await this.themeController.applyFromSettings(),this.options.verbose||!this.settingsManager.getQuietStartup()){let r=Se.bold(Se.fg("accent",An))+Se.fg("dim",` v${this.version}`),s=(u,l)=>er(u,l),i=[s("app.interrupt","to interrupt"),s("app.clear","to clear"),ml(`${ra("app.clear")} twice`,"to exit"),s("app.exit","to exit (empty)"),s("app.suspend","to suspend"),er("tui.editor.deleteToLineEnd","to delete to end"),s("app.thinking.cycle","to cycle thinking level"),ml(`${ra("app.model.cycleForward")}/${ra("app.model.cycleBackward")}`,"to cycle models"),s("app.model.select","to select model"),s("app.tools.expand","to expand tools"),s("app.thinking.toggle","to expand thinking"),s("app.editor.external","for external editor"),ml("/","for commands"),ml("!","to run bash"),ml("!!","to run bash (no context)"),s("app.message.followUp","to queue follow-up"),s("app.message.dequeue","to edit all queued messages"),s("app.clipboard.pasteImage","to paste image (with text fallback)"),ml("drop files","to attach")].join(` -`),o=[s("app.interrupt","interrupt"),ml(`${ra("app.clear")}/${ra("app.exit")}`,"clear/exit"),ml("/","commands"),ml("!","bash"),s("app.tools.expand","more")].join(Se.fg("muted"," \xB7 ")),a=Se.fg("dim",`Press ${ra("app.tools.expand")} to show full startup help and loaded resources.`),c=Se.fg("dim","Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.");this.builtInHeader=new TTe(()=>`${r} +${r}`),e}}});function Lys(t,e){let n=Math.max(0,e-Nys),r=t.reduce((a,c)=>Math.max(a,c.bodyWidth),0),i=Math.max(0,r-n),s=t.find(a=>a.isSelected),o=0;if(s&&i>0){let a=Math.min(Pys,Math.max(Dys,Math.floor(n/3)));if(s.anchorCol>n-a){let c=Math.min(Oys,Math.max(Mys,Math.floor(n/4)));o=Math.min(i,s.anchorCol-c)}}return t.map(a=>{let c=o>0?`${a.gutter}${Hc(a.body,o,n,!0)}\x1B[0m`:a.gutter+a.body;return dr(c,e,"")})}function Qys(t){let e=[];for(let n of t){let r=Ai().getKeys(n)[0];r!==void 0&&e.push(r)}return e.length===0?"":QQ(Uys(e)).replace(/\bpageUp\b/g,"pgup").replace(/\bpageDown\b/g,"pgdn").replace(/\bup\b/g,"\u2191").replace(/\bdown\b/g,"\u2193").replace(/\bleft\b/g,"\u2190").replace(/\bright\b/g,"\u2192")}function Uys(t){if(t.length===1)return t[0];let e=t.map(r=>{let i=r.lastIndexOf("+");return i===-1?{prefix:"",suffix:r}:{prefix:r.slice(0,i+1),suffix:r.slice(i+1)}}),n=e[0].prefix;return n&&e.every(r=>r.prefix===n)?`${n}${e.map(r=>r.suffix).join("/")}`:t.join("/")}var Nys,Dys,Pys,Mys,Oys,Zbt,e_t,t_t,Fys,n_t,hG,r_t=v(()=>{p();Tr();pi();Ll();ha();Nys=2,Dys=4,Pys=20,Mys=2,Oys=12;Zbt=class{flatNodes=[];filteredNodes=[];selectedIndex=0;currentLeafId;maxVisibleLines;filterMode="default";searchQuery="";toolCallMap=new Map;multipleRoots=!1;showLabelTimestamps=!1;activePathIds=new Set;visibleParentMap=new Map;visibleChildrenMap=new Map;lastSelectedId=null;foldedNodes=new Set;onSelect;onCancel;onCopy;onLabelEdit;constructor(e,n,r,i,s){this.currentLeafId=n,this.maxVisibleLines=r,this.filterMode=s??"default",this.multipleRoots=e.length>1,this.flatNodes=this.flattenTree(e),this.buildActivePath(),this.applyFilter();let o=i??n;this.selectedIndex=this.findNearestVisibleIndex(o),this.lastSelectedId=this.filteredNodes[this.selectedIndex]?.node.entry.id??null}findNearestVisibleIndex(e){if(this.filteredNodes.length===0)return 0;let n=new Map;for(let s of this.flatNodes)n.set(s.node.entry.id,s);let r=new Map(this.filteredNodes.map((s,o)=>[s.node.entry.id,o])),i=e;for(;i!==null;){let s=r.get(i);if(s!==void 0)return s;let o=n.get(i);if(!o)break;i=o.node.entry.parentId??null}return this.filteredNodes.length-1}buildActivePath(){if(this.activePathIds.clear(),!this.currentLeafId)return;let e=new Map;for(let r of this.flatNodes)e.set(r.node.entry.id,r);let n=this.currentLeafId;for(;n;){this.activePathIds.add(n);let r=e.get(n);if(!r)break;n=r.node.entry.parentId??null}}flattenTree(e){let n=[];this.toolCallMap.clear();let r=[],i=new Map,s=this.currentLeafId;{let c=[],u=[...e];for(;u.length>0;){let l=u.pop();c.push(l);for(let d=l.children.length-1;d>=0;d--)u.push(l.children[d])}for(let l=c.length-1;l>=0;l--){let d=c[l],m=s!==null&&d.entry.id===s;for(let h of d.children)i.get(h)&&(m=!0);i.set(d,m)}}let o=e.length>1,a=[...e].sort((c,u)=>Number(i.get(u))-Number(i.get(c)));for(let c=a.length-1;c>=0;c--){let u=c===a.length-1;r.push([a[c],o?1:0,o,o,u,[],o])}for(;r.length>0;){let[c,u,l,d,m,h,f]=r.pop(),g=c.entry;if(g.type==="message"&&g.message.role==="assistant"){let k=g.message.content;if(Array.isArray(k)){for(let N of k)if(typeof N=="object"&&N!==null&&"type"in N&&N.type==="toolCall"){let O=N;this.toolCallMap.set(O.id,{name:O.name,arguments:O.arguments})}}}n.push({node:c,indent:u,showConnector:d,isLast:m,gutters:h,isVirtualRootChild:f});let A=c.children,y=A.length>1,E=(()=>{let k=[],N=[];for(let O of A)i.get(O)?k.push(O):N.push(O);return[...k,...N]})(),_;y||l&&u>0?_=u+1:_=u;let S=d&&!f,C=this.multipleRoots?Math.max(0,u-1):u,I=Math.max(0,C-1),w=S?[...h,{position:I,show:!m}]:h;for(let k=E.length-1;k>=0;k--){let N=k===E.length-1;r.push([E[k],_,y,y,N,w,!1])}}return n}applyFilter(){this.filteredNodes.length>0&&(this.lastSelectedId=this.filteredNodes[this.selectedIndex]?.node.entry.id??this.lastSelectedId);let e=this.searchQuery.toLowerCase().split(/\s+/).filter(Boolean);if(this.filteredNodes=this.flatNodes.filter(n=>{let r=n.node.entry;if(r.type==="usage")return!1;let i=r.id===this.currentLeafId;if(r.type==="message"&&r.message.role==="assistant"&&!i){let a=r.message,c=this.hasTextContent(a.content),u=a.stopReason&&a.stopReason!=="stop"&&a.stopReason!=="toolUse";if(!c&&!u)return!1}let s=!0,o=r.type==="label"||r.type==="context_edit"||r.type==="custom"||r.type==="model_change"||r.type==="thinking_level_change"||r.type==="session_info";switch(this.filterMode){case"user-only":s=r.type==="message"&&r.message.role==="user";break;case"no-tools":s=!o&&!(r.type==="message"&&r.message.role==="toolResult");break;case"labeled-only":s=n.node.label!==void 0;break;case"all":s=!0;break;default:s=!o;break}if(!s)return!1;if(e.length>0){let a=this.getSearchableText(n.node).toLowerCase();return e.every(c=>a.includes(c))}return!0}),this.foldedNodes.size>0){let n=new Set;for(let r of this.flatNodes){let{id:i,parentId:s}=r.node.entry;s!=null&&(this.foldedNodes.has(s)||n.has(s))&&n.add(i)}this.filteredNodes=this.filteredNodes.filter(r=>!n.has(r.node.entry.id))}this.recalculateVisualStructure(),this.lastSelectedId?this.selectedIndex=this.findNearestVisibleIndex(this.lastSelectedId):this.selectedIndex>=this.filteredNodes.length&&(this.selectedIndex=Math.max(0,this.filteredNodes.length-1)),this.filteredNodes.length>0&&(this.lastSelectedId=this.filteredNodes[this.selectedIndex]?.node.entry.id??this.lastSelectedId)}recalculateVisualStructure(){if(this.filteredNodes.length===0)return;let e=new Set(this.filteredNodes.map(u=>u.node.entry.id)),n=new Map;for(let u of this.flatNodes)n.set(u.node.entry.id,u);let r=u=>{let l=n.get(u)?.node.entry.parentId??null;for(;l!==null;){if(e.has(l))return l;l=n.get(l)?.node.entry.parentId??null}return null},i=new Map,s=new Map;s.set(null,[]);for(let u of this.filteredNodes){let l=u.node.entry.id,d=r(l);i.set(l,d),s.has(d)||s.set(d,[]),s.get(d).push(l)}let o=s.get(null);this.multipleRoots=o.length>1;let a=new Map;for(let u of this.filteredNodes)a.set(u.node.entry.id,u);let c=[];for(let u=o.length-1;u>=0;u--){let l=u===o.length-1;c.push([o[u],this.multipleRoots?1:0,this.multipleRoots,this.multipleRoots,l,[],this.multipleRoots])}for(;c.length>0;){let[u,l,d,m,h,f,g]=c.pop(),A=a.get(u);if(!A)continue;A.indent=l,A.showConnector=m,A.isLast=h,A.gutters=f,A.isVirtualRootChild=g;let y=s.get(u)||[],E=y.length>1,_;E||d&&l>0?_=l+1:_=l;let S=m&&!g,C=this.multipleRoots?Math.max(0,l-1):l,I=Math.max(0,C-1),w=S?[...f,{position:I,show:!h}]:f;for(let k=y.length-1;k>=0;k--){let N=k===y.length-1;c.push([y[k],_,E,E,N,w,!1])}}this.visibleParentMap=i,this.visibleChildrenMap=s}getSearchableText(e){let n=e.entry,r=[];switch(e.label&&r.push(e.label),n.type){case"message":{let i=n.message;if(r.push(i.role),"content"in i&&i.content&&r.push(this.extractContent(i.content)),i.role==="bashExecution"){let s=i;s.command&&r.push(s.command)}break}case"custom_message":{r.push(n.customType),typeof n.content=="string"?r.push(n.content):r.push(this.extractContent(n.content));break}case"compaction":r.push("compaction");break;case"branch_summary":r.push("branch summary",n.summary);break;case"session_info":r.push("title"),n.name&&r.push(n.name);break;case"model_change":r.push("model",n.modelId);break;case"thinking_level_change":r.push("thinking",n.thinkingLevel);break;case"custom":r.push("custom",n.customType);break;case"context_edit":r.push("context edit",n.replacement===null?"omit":"replace",n.targetId);break;case"label":r.push("label",n.label??"");break}return r.join(" ")}invalidate(){}getSearchQuery(){return this.searchQuery}getSelectedNode(){return this.filteredNodes[this.selectedIndex]?.node}copySelected(){let e=this.getSelectedNode();this.onCopy?.(e?this.getEntryCopyText(e):void 0)}updateNodeLabel(e,n,r){for(let i of this.flatNodes)if(i.node.entry.id===e){i.node.label=n,i.node.labelTimestamp=n?r??new Date().toISOString():void 0;break}}getStatusLabels(){let e="";switch(this.filterMode){case"no-tools":e+=" [no-tools]";break;case"user-only":e+=" [user]";break;case"labeled-only":e+=" [labeled]";break;case"all":e+=" [all]";break}return this.showLabelTimestamps&&(e+=" [+label time]"),e}render(e){let n=[];if(this.filteredNodes.length===0)return n.push(dr(Ee.fg("muted"," No entries found"),e)),n.push(dr(Ee.fg("muted",` (0/0)${this.getStatusLabels()}`),e)),n;let r=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisibleLines/2),this.filteredNodes.length-this.maxVisibleLines)),i=Math.min(r+this.maxVisibleLines,this.filteredNodes.length),s=[];for(let o=r;oz.position===q);if(Y)ce===0?g.push(Y.show?"\u2502":" "):g.push(" ");else if(m&&q===h)if(ce===0)g.push(a.isLast?"\u2514":"\u251C");else if(ce===1){let z=this.isFoldable(c.id);g.push(A?"\u229E":z?"\u229F":"\u2500")}else g.push(" ");else g.push(" ")}let y=g.join(""),E=a.showConnector&&!a.isVirtualRootChild,_=A&&!E?Ee.fg("accent","\u229E "):"",C=this.activePathIds.has(c.id)?Ee.fg("accent","\u2022 "):"",I=a.node.label?Ee.fg("warning",`[${a.node.label}] `):"",w=this.showLabelTimestamps&&a.node.label&&a.node.labelTimestamp?Ee.fg("muted",`${this.formatLabelTimestamp(a.node.labelTimestamp)} `):"",k=this.getEntryDisplayText(a.node,u),N=Ee.fg("dim",y)+_+C,O=rn(N),W=l,$=N+I+w+k;u&&(W=Ee.bg("selectedBg",W),$=Ee.bg("selectedBg",$)),s.push({gutter:W,body:$,anchorCol:O,bodyWidth:rn($),isSelected:u})}return n.push(...Lys(s,e)),n.push(dr(Ee.fg("muted",` (${this.selectedIndex+1}/${this.filteredNodes.length})${this.getStatusLabels()}`),e)),n}getEntryDisplayText(e,n){let r=e.entry,i,s=o=>o.replace(/[\n\t]/g," ").trim();switch(r.type){case"message":{let o=r.message,a=o.role;if(a==="user"){let c=o,u=s(this.extractContent(c.content));i=Ee.fg("accent","user: ")+u}else if(a==="assistant"){let c=o,u=s(this.extractContent(c.content));if(u)i=Ee.fg("success","assistant: ")+u;else if(c.stopReason==="aborted")i=Ee.fg("success","assistant: ")+Ee.fg("muted","(aborted)");else if(c.errorMessage){let l=s(c.errorMessage).slice(0,80);i=Ee.fg("success","assistant: ")+Ee.fg("error",l)}else i=Ee.fg("success","assistant: ")+Ee.fg("muted","(no content)")}else if(a==="toolResult"){let c=o,u=c.toolCallId?this.toolCallMap.get(c.toolCallId):void 0;u?i=Ee.fg("muted",this.formatToolCall(u.name,u.arguments)):i=Ee.fg("muted",`[${c.toolName??"tool"}]`)}else if(a==="bashExecution"){let c=o;i=Ee.fg("dim",`[bash]: ${s(c.command??"")}`)}else i=Ee.fg("dim",`[${a}]`);break}case"custom_message":{let o=typeof r.content=="string"?r.content:r.content.filter(a=>a.type==="text").map(a=>a.text).join("");i=Ee.fg("customMessageLabel",`[${r.customType}]: `)+s(o);break}case"compaction":{let o=Math.round(r.tokensBefore/1e3);i=Ee.fg("borderAccent",`[compaction: ${o}k tokens]`);break}case"branch_summary":i=Ee.fg("warning","[branch summary]: ")+s(r.summary);break;case"model_change":i=Ee.fg("dim",`[model: ${r.modelId}]`);break;case"thinking_level_change":i=Ee.fg("dim",`[thinking: ${r.thinkingLevel}]`);break;case"custom":i=Ee.fg("dim",`[custom: ${r.customType}]`);break;case"context_edit":i=Ee.fg("dim",`[context ${r.replacement===null?"omit":"replace"}: ${r.targetId}]`);break;case"label":i=Ee.fg("dim",`[label: ${r.label??"(cleared)"}]`);break;case"session_info":i=r.name?[Ee.fg("dim","[title: "),Ee.fg("dim",r.name),Ee.fg("dim","]")].join(""):[Ee.fg("dim","[title: "),Ee.italic(Ee.fg("dim","empty")),Ee.fg("dim","]")].join("");break;default:i=""}return n?Ee.bold(i):i}formatLabelTimestamp(e){let n=new Date(e),r=new Date,i=n.getHours().toString().padStart(2,"0"),s=n.getMinutes().toString().padStart(2,"0"),o=`${i}:${s}`;if(n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate())return o;let a=n.getMonth()+1,c=n.getDate();return n.getFullYear()===r.getFullYear()?`${a}/${c} ${o}`:`${n.getFullYear().toString().slice(-2)}/${a}/${c} ${o}`}extractContent(e){return this.extractFullContent(e).slice(0,200)}extractFullContent(e){if(typeof e=="string")return e;if(!Array.isArray(e))return"";let n="";for(let r of e)typeof r=="object"&&r!==null&&"type"in r&&r.type==="text"&&(n+=r.text);return n}getEntryCopyText(e){let n=e.entry,r;switch(n.type){case"message":n.message.role==="bashExecution"?r=n.message.command:"content"in n.message&&(r=this.extractFullContent(n.message.content),!r&&n.message.role==="assistant"&&(r=n.message.errorMessage));break;case"custom_message":r=this.extractFullContent(n.content);break;case"compaction":r=n.summary;break;case"branch_summary":r=n.summary;break}return r?.trim()?r:void 0}hasTextContent(e){if(typeof e=="string")return e.trim().length>0;if(Array.isArray(e)){for(let n of e)if(typeof n=="object"&&n!==null&&"type"in n&&n.type==="text"){let r=n.text;if(r&&r.trim().length>0)return!0}}return!1}formatToolCall(e,n){let r=i=>{let s=process.env.HOME||process.env.USERPROFILE||"";return s&&i.startsWith(s)?`~${i.slice(s.length)}`:i};switch(e){case"read":{let i=r(String(n.path||n.file_path||"")),s=n.offset,o=n.limit,a=i;if(s!==void 0||o!==void 0){let c=s??1,u=o!==void 0?c+o-1:"";a+=`:${c}${u?`-${u}`:""}`}return`[read: ${a}]`}case"write":return`[write: ${r(String(n.path||n.file_path||""))}]`;case"edit":return`[edit: ${r(String(n.path||n.file_path||""))}]`;case"bash":{let i=String(n.command||"");return`[bash: ${i.replace(/[\n\t]/g," ").trim().slice(0,50)}${i.length>50?"...":""}]`}case"grep":{let i=String(n.pattern||""),s=r(String(n.path||"."));return`[grep: /${i}/ in ${s}]`}case"find":{let i=String(n.pattern||""),s=r(String(n.path||"."));return`[find: ${i} in ${s}]`}case"ls":return`[ls: ${r(String(n.path||"."))}]`;default:{let i=JSON.stringify(n).slice(0,40);return`[${e}: ${i}${JSON.stringify(n).length>40?"...":""}]`}}}handleInput(e){let n=Ai();if(n.matches(e,"tui.select.up"))this.selectedIndex=this.selectedIndex===0?this.filteredNodes.length-1:this.selectedIndex-1;else if(n.matches(e,"tui.select.down"))this.selectedIndex=this.selectedIndex===this.filteredNodes.length-1?0:this.selectedIndex+1;else if(n.matches(e,"app.tree.foldOrUp")){let r=this.filteredNodes[this.selectedIndex]?.node.entry.id;r&&this.isFoldable(r)&&!this.foldedNodes.has(r)?(this.foldedNodes.add(r),this.applyFilter()):this.selectedIndex=this.findBranchSegmentStart("up")}else if(n.matches(e,"app.tree.unfoldOrDown")){let r=this.filteredNodes[this.selectedIndex]?.node.entry.id;r&&this.foldedNodes.has(r)?(this.foldedNodes.delete(r),this.applyFilter()):this.selectedIndex=this.findBranchSegmentStart("down")}else if(n.matches(e,"tui.editor.cursorLeft")||n.matches(e,"tui.select.pageUp"))this.selectedIndex=Math.max(0,this.selectedIndex-this.maxVisibleLines);else if(n.matches(e,"tui.editor.cursorRight")||n.matches(e,"tui.select.pageDown"))this.selectedIndex=Math.min(this.filteredNodes.length-1,this.selectedIndex+this.maxVisibleLines);else if(n.matches(e,"tui.select.confirm")){let r=this.filteredNodes[this.selectedIndex];r&&this.onSelect&&this.onSelect(r.node.entry.id)}else if(n.matches(e,"app.message.copy"))this.copySelected();else if(n.matches(e,"tui.select.cancel"))this.searchQuery?(this.searchQuery="",this.foldedNodes.clear(),this.applyFilter()):this.onCancel?.();else if(n.matches(e,"app.tree.filter.default"))this.filterMode="default",this.foldedNodes.clear(),this.applyFilter();else if(n.matches(e,"app.tree.filter.noTools"))this.filterMode=this.filterMode==="no-tools"?"default":"no-tools",this.foldedNodes.clear(),this.applyFilter();else if(n.matches(e,"app.tree.filter.userOnly"))this.filterMode=this.filterMode==="user-only"?"default":"user-only",this.foldedNodes.clear(),this.applyFilter();else if(n.matches(e,"app.tree.filter.labeledOnly"))this.filterMode=this.filterMode==="labeled-only"?"default":"labeled-only",this.foldedNodes.clear(),this.applyFilter();else if(n.matches(e,"app.tree.filter.all"))this.filterMode=this.filterMode==="all"?"default":"all",this.foldedNodes.clear(),this.applyFilter();else if(n.matches(e,"app.tree.filter.cycleBackward")){let r=["default","no-tools","user-only","labeled-only","all"],i=r.indexOf(this.filterMode);this.filterMode=r[(i-1+r.length)%r.length],this.foldedNodes.clear(),this.applyFilter()}else if(n.matches(e,"app.tree.filter.cycleForward")){let r=["default","no-tools","user-only","labeled-only","all"],i=r.indexOf(this.filterMode);this.filterMode=r[(i+1)%r.length],this.foldedNodes.clear(),this.applyFilter()}else if(n.matches(e,"tui.editor.deleteCharBackward"))this.searchQuery.length>0&&(this.searchQuery=this.searchQuery.slice(0,-1),this.foldedNodes.clear(),this.applyFilter());else if(n.matches(e,"app.tree.editLabel")){let r=this.filteredNodes[this.selectedIndex];r&&this.onLabelEdit&&this.onLabelEdit(r.node.entry.id,r.node.label)}else n.matches(e,"app.tree.toggleLabelTimestamp")?this.showLabelTimestamps=!this.showLabelTimestamps:![...e].some(i=>{let s=i.charCodeAt(0);return s<32||s===127||s>=128&&s<=159})&&e.length>0&&(this.searchQuery+=e,this.foldedNodes.clear(),this.applyFilter())}isFoldable(e){let n=this.visibleChildrenMap.get(e);if(!n||n.length===0)return!1;let r=this.visibleParentMap.get(e);if(r==null)return!0;let i=this.visibleChildrenMap.get(r);return i!==void 0&&i.length>1}findBranchSegmentStart(e){let n=this.filteredNodes[this.selectedIndex]?.node.entry.id;if(!n)return this.selectedIndex;let r=new Map(this.filteredNodes.map((s,o)=>[s.node.entry.id,o])),i=n;if(e==="down")for(;;){let s=this.visibleChildrenMap.get(i)??[];if(s.length===0)return r.get(i);if(s.length>1)return r.get(s[0]);i=s[0]}for(;;){let s=this.visibleParentMap.get(i)??null;if(s===null)return r.get(i);if((this.visibleChildrenMap.get(s)??[]).length>1){let a=r.get(i);if(a{let d=Qys(c);return d?l?`${u} ${d}`:`${d} ${u}`:u}),r=Math.max(1,e),i=" ",s=" \xB7 ",o=[],a="";for(let c of n){let u=a?`${a}${s}${c}`:rn(`${i}${c}`)<=r?`${i}${c}`:c;if(!a||rn(u)<=r){a=u;continue}o.push(...Ag(a.trimEnd(),r)),a=rn(`${i}${c}`)<=r?`${i}${c}`:c}return a&&o.push(...Ag(a.trimEnd(),r)),o.map(c=>Ee.fg("muted",c))}},Fys=[{keys:["tui.select.up","tui.select.down"],label:"move"},{keys:["tui.editor.cursorLeft","tui.editor.cursorRight"],label:"page"},{keys:["app.tree.foldOrUp","app.tree.unfoldOrDown"],label:"branch"},{keys:["app.message.copy"],label:"copy"},{keys:["app.tree.editLabel"],label:"label"},{keys:["app.tree.toggleLabelTimestamp"],label:"label time"},{keys:["app.tree.filter.default","app.tree.filter.noTools","app.tree.filter.userOnly","app.tree.filter.labeledOnly","app.tree.filter.all"],label:"filters",labelFirst:!0},{keys:["app.tree.filter.cycleForward","app.tree.filter.cycleBackward"],label:"cycle",labelFirst:!0}];n_t=class{input;entryId;onSubmit;onCancel;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.input.focused=e}constructor(e,n){this.entryId=e,this.input=new ma,n&&this.input.setValue(n)}invalidate(){}render(e){let n=[],i=e-2;return n.push(dr(` ${Ee.fg("muted","Label (empty to remove):")}`,e)),n.push(...this.input.render(i).map(s=>dr(` ${s}`,e))),n.push(dr(` ${nr("tui.select.confirm","save")} ${nr("tui.select.cancel","cancel")}`,e)),n}handleInput(e){let n=Ai();if(n.matches(e,"tui.select.confirm")){let r=this.input.getValue().trim();this.onSubmit?.(this.entryId,r||void 0)}else n.matches(e,"tui.select.cancel")?this.onCancel?.():this.input.handleInput(e)}},hG=class extends gn{treeList;labelInput=null;labelInputContainer;treeContainer;onLabelChangeCallback;onCopy;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.labelInput&&(this.labelInput.focused=e)}constructor(e,n,r,i,s,o,a,c){super(),this.onLabelChangeCallback=o;let u=Math.max(5,Math.floor(r/2));this.treeList=new Zbt(e,n,u,a,c),this.treeList.onSelect=i,this.treeList.onCancel=s,this.treeList.onCopy=l=>this.onCopy?.(l),this.treeList.onLabelEdit=(l,d)=>this.showLabelInput(l,d),this.treeContainer=new gn,this.treeContainer.addChild(this.treeList),this.labelInputContainer=new gn,this.addChild(new Tt(1)),this.addChild(new Un),this.addChild(new Et(Ee.bold(" Session Tree"),1,0)),this.addChild(new t_t),this.addChild(new e_t(this.treeList)),this.addChild(new Un),this.addChild(new Tt(1)),this.addChild(this.treeContainer),this.addChild(this.labelInputContainer),this.addChild(new Tt(1)),this.addChild(new Un),e.length===0&&setTimeout(()=>s(),100)}showLabelInput(e,n){this.labelInput=new n_t(e,n),this.labelInput.onSubmit=(r,i)=>{this.treeList.updateNodeLabel(r,i),this.onLabelChangeCallback?.(r,i),this.hideLabelInput()},this.labelInput.onCancel=()=>this.hideLabelInput(),this.labelInput.focused=this._focused,this.treeContainer.clear(),this.labelInputContainer.clear(),this.labelInputContainer.addChild(this.labelInput)}hideLabelInput(){this.labelInput=null,this.labelInputContainer.clear(),this.treeContainer.clear(),this.treeContainer.addChild(this.treeList)}handleInput(e){this.labelInput?this.labelInput.handleInput(e):this.treeList.handleInput(e)}getTreeList(){return this.treeList}}});function Gys(t,e){if(e===null)return"none";let n=e.decision?"trusted":"untrusted";return t!==void 0&&e.path!==t?`${n} (inherited from ${e.path})`:`${n} (${e.path})`}var uce,i_t=v(()=>{p();Tr();zU();pi();Ll();ha();uce=class extends gn{selectedIndex;listContainer;trustOptions;savedDecision;onSelectCallback;onCancelCallback;constructor(e){super(),this.savedDecision=e.savedDecision,this.trustOptions=zDe(e.cwd),this.selectedIndex=Math.max(0,this.trustOptions.findIndex(n=>this.isSavedOption(n))),this.onSelectCallback=e.onSelect,this.onCancelCallback=e.onCancel,this.addChild(new Un),this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("accent",Ee.bold("Project trust")),1,0)),this.addChild(new Et(Ee.fg("muted",e.cwd),1,0)),this.addChild(new Tt(1)),this.addChild(new Et(Ee.fg("muted",`Saved decision: ${Gys(this.trustOptions[0]?.savedPath,e.savedDecision)}`),1,0)),this.addChild(new Et(Ee.fg("muted",`Current session: ${e.projectTrusted?"trusted":"untrusted"}`),1,0)),this.addChild(new Tt(1)),this.listContainer=new gn,this.addChild(this.listContainer),this.addChild(new Tt(1)),this.addChild(new Et(iu("\u2191\u2193","navigate")+" "+nr("tui.select.confirm","save")+" "+nr("tui.select.cancel","cancel"),1,0)),this.addChild(new Tt(1)),this.addChild(new Un),this.updateList()}isSavedOption(e){return e.savedPath!==void 0&&this.savedDecision?.decision===e.trusted&&this.savedDecision.path===e.savedPath}updateList(){this.listContainer.clear();for(let e=0;e{p();Tr();pi();cbt();$ys="\x1B]133;A\x07",Wys="\x1B]133;B\x07",Hys="\x1B]133;C\x07",Bk=class extends gn{text;markdownTheme;outputPad;markdownTransformers;constructor(e,n=zh(),r=1,i=[]){super(),this.text=e,this.markdownTheme=n,this.outputPad=r,this.markdownTransformers=i,this.rebuild()}setOutputPad(e){this.outputPad=e,this.rebuild()}rebuild(){this.clear();let e=new Ou(this.outputPad,1,n=>Ee.bg("userMessageBg",n));e.addChild(new Pl(this.text,0,0,this.markdownTheme,{color:n=>Ee.fg("userMessageText",n)},{preserveOrderedListMarkers:!0,preserveBackslashEscapes:!0,transform:zae("user",!1,this.markdownTransformers)})),this.addChild(e)}render(e){let n=super.render(e);return n.length===0||(n[0]=$ys+n[0],n[n.length-1]=Wys+Hys+n[n.length-1]),n}}});var o_t,fG,a_t=v(()=>{p();Tr();pi();Ll();o_t=class{messages=[];selectedIndex=0;onSelect;onCancel;maxVisible=10;constructor(e,n){this.messages=e;let r=n?e.findIndex(i=>i.id===n):-1;this.selectedIndex=r>=0?r:Math.max(0,e.length-1)}invalidate(){}render(e){let n=[];if(this.messages.length===0)return n.push(Ee.fg("muted"," No user messages found")),n;let r=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.messages.length-this.maxVisible)),i=Math.min(r+this.maxVisible,this.messages.length);for(let s=r;s0||ir(),100)}getMessageList(){return this.messageList}}});var UPe,dor=v(()=>{p();pi();UPe=class{ui;getSettingsManager;showError;onChanged;currentThemeSetting;terminalTheme=xj().theme;activeThemeName;autoSyncEnabled=!1;terminalColorSchemeUnsubscribe;constructor(e,n){this.ui=e,this.getSettingsManager=n.getSettingsManager,this.showError=n.showError,this.onChanged=n.onChanged,this.currentThemeSetting=n.initialThemeSetting,this.activeThemeName=_j(this.currentThemeSetting??this.getSettingsManager().getThemeSetting(),this.terminalTheme),lw(this.activeThemeName,!0),this.bindTerminalColorSchemeListener()}rebindTui(){this.terminalColorSchemeUnsubscribe?.(),this.bindTerminalColorSchemeListener(),this.ui.setTerminalColorSchemeNotifications(this.autoSyncEnabled)}async applyFromSettings(){let e=this.getSettingsManager(),n=this.currentThemeSetting??e.getThemeSetting(),r=LR(n);if(r){this.terminalTheme=await zre({ui:this.ui,timeoutMs:100}),this.setAutoSync(!0),this.applyThemeName(this.terminalTheme==="light"?r.lightTheme:r.darkTheme,!0);return}if(this.setAutoSync(!1),n!==void 0){this.applyThemeName(n,!0);return}let i=await sct({ui:this.ui,timeoutMs:100});this.terminalTheme=i.theme,this.applyThemeName(i.theme).success&&i.confidence==="high"&&(e.setTheme(i.theme),await e.flush())}getThemeSelection(){return this.currentThemeSetting??this.getSettingsManager().getThemeSetting()??this.activeThemeName}setThemeName(e,n=!1){this.setAutoSync(!1);let r=this.applyThemeName(e,n);return r.success&&(this.currentThemeSetting=e),r}async setThemeSetting(e){this.currentThemeSetting=e,await this.applyFromSettings()}setThemeInstance(e){return this.setAutoSync(!1),rQn(e),this.activeThemeName="",this.notifyChanged(),{success:!0}}preview(e){let n=_j(e,this.terminalTheme)??this.activeThemeName;n&&aQ(n,!0).success&&(this.ui.invalidate(),this.ui.requestRender())}disableAutoSync(){this.setAutoSync(!1)}dispose(){this.setAutoSync(!1),this.terminalColorSchemeUnsubscribe?.(),this.terminalColorSchemeUnsubscribe=void 0}getTerminalTheme(){return this.terminalTheme}applyThemeName(e,n=!1){let r=aQ(e,!0);return this.activeThemeName=r.success?e:"dark",this.notifyChanged(),!r.success&&n&&this.showError(`Failed to load theme "${e}": ${r.error} +Fell back to dark theme.`),r}notifyChanged(){this.ui.invalidate(),this.onChanged()}setAutoSync(e){this.autoSyncEnabled!==e&&(this.autoSyncEnabled=e,this.ui.setTerminalColorSchemeNotifications(e))}bindTerminalColorSchemeListener(){this.terminalColorSchemeUnsubscribe=this.ui.onTerminalColorSchemeChange(e=>this.applyTerminalTheme(e))}applyTerminalTheme(e){if(!this.autoSyncEnabled)return;this.terminalTheme=e;let n=LR(this.currentThemeSetting??this.getSettingsManager().getThemeSetting());if(!n){this.setAutoSync(!1);return}let r=e==="light"?n.lightTheme:n.darkTheme;r!==this.activeThemeName&&this.applyThemeName(r)}}});function GPe(t){let e=t.terminal??new cw;if(t.tuiMode==="fullscreen"){let n=r=>Ee.bg("searchMatchBg",Ee.fg("searchMatchText",r));return new lS(e,t.showHardwareCursor,t.logDirectory,{searchMatchStyle:r=>Ee.underline(n(r)),searchCurrentMatchStyle:r=>Ee.bold(Ee.inverse(n(r))),searchNavigationButtonStyle:(r,i)=>i?Ee.underline(r):r,scrollToEndIndicator:()=>{let r=qc("tui.altScreen.bottom"),i=` \u2193 Jump to latest message${r?` \xB7 ${r}`:""} `;return Ee.bg("selectedBg",Ee.fg("text",i))},openUrl:RPe,onRightClickPaste:t.onRightClickPaste,copyOnSelect:t.fullscreenCopyOnSelect,copySelection:async r=>{try{return await XU(r),!0}catch(i){return i instanceof Error?i.message:String(i)}}})}return new EE(e,t.showHardwareCursor,t.logDirectory)}function c_t(t){return new Proxy({},{get:(e,n)=>{let r=t(),i=Reflect.get(r,n,r);if(typeof i!="function")return i;let s=r,o=i;return(...a)=>{let c=t();if(c!==s){let u=Reflect.get(c,n,c);if(typeof u!="function")throw new TypeError(`TUI property ${String(n)} is not callable`);s=c,o=u}return Reflect.apply(o,s,a)}},set:(e,n,r)=>{let i=t();return Reflect.set(i,n,r,i)},has:(e,n)=>Reflect.has(t(),n),getPrototypeOf:()=>Reflect.getPrototypeOf(t())})}var l_t=v(()=>{p();Tr();fPe();Ebt();ha();pi()});function por(t){return"embedWorkingStatus"in t&&t.embedWorkingStatus===!0&&"setWorkingStatusIndicator"in t&&typeof t.setWorkingStatusIndicator=="function"}function dce(t){return typeof t=="object"&&t!==null&&"setExpanded"in t&&typeof t.setExpanded=="function"}function jys(t){return"type"in t&&t.type==="custom"}function Vys(t){return"type"in t&&t.type==="compaction_cost"}function Yys(t){return"type"in t&&t.type==="usage"}function Kys(t){if(!t||typeof t!="object"||!("code"in t))return!1;let e=t.code;return e!==void 0&&zys.has(e)}function Jys(t){let e=Array.isArray(t)?t.filter(o=>typeof o=="string"&&o.length>0):[];if(e.length===0)return;let n=e.map(o=>`\`${o}\``),r=n.length===1?n[0]:n.length===2?n.join(" and "):`${n.slice(0,-1).join(", ")}, and ${n[n.length-1]}`,i=e.length===1?"extension":"extensions",s=e.length===1?"it":"them";return`A stack frame came from loaded ${i} ${r}, which may be involved. Try disabling ${s} with \`${hn} config\`, or run \`${hn} -ne\` to confirm.`}function Xys(t){return typeof t=="string"&&t.startsWith("sk-ant-oat")}function hor(t){return!!t&&t.provider==="unknown"&&t.id==="unknown"&&t.api==="unknown"}function Zys(t){return t.length>0&&!/[^a-zA-Z0-9_\-./~:@]/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}function eEs(t){if(!process.stdout.isTTY||!t.isPersisted())return;let e=t.getSessionFile();if(!e||!gG.existsSync(e))return;let n=[hn];return t.usesDefaultSessionDir()||n.push("--session-dir",Zys(t.getSessionDir())),n.push("--session",t.getSessionId()),n.join(" ")}function gor(t){return t in ZQ}function tEs(t,e){return e===0?`${t}. No llama.cpp models are loaded. Use /llama to load a model, then /model to select it.`:`${t}. Use /model to select a loaded llama.cpp model, or /llama to manage models.`}function u_t(t,e,n,r){let i=Pu(t,e,n);return i.length===0?null:i.map(r)}function nEs(t){let e=new Map;for(let n of t){let r=e.get(n.id);if(r){r.authTypes.includes(n.authType)||(r.authTypes.push(n.authType),r.authTypes.sort((i,s)=>Aor[i]-Aor[s]));continue}e.set(n.id,{id:n.id,name:n.name,authTypes:[n.authType]})}return Array.from(e.values()).sort((n,r)=>n.name.localeCompare(r.name))}function rEs(t){let e=t.authTypes.map(n=>`${n} ${OPe(n)}`).join(" ");return`${t.id} ${t.name} ${e}`}function iEs(t){let e=t.authTypes.map(OPe).join("/");return t.name===t.id?e:`${t.name} \xB7 ${e}`}var yor,gG,WPe,uu,Eor,$Pe,zys,mor,Aor,AG,bor=v(()=>{p();yor=Ot(require("node:crypto"),1),gG=Ot(require("node:fs"),1),WPe=Ot(require("node:os"),1),uu=Ot(require("node:path"),1);cR();Tr();Tr();gb();Eor=require("child_process");Qs();$1e();VDe();cir();p0t();$0t();$ie();Kht();Mae();m9();GR();eU();lP();pY();HDe();fw();fir();m0t();Air();zU();Q1e();Eir();fPe();Nir();Hht();fc();Yj();pw();zat();C1e();Z0t();jir();Yir();abt();lbt();ubt();dbt();pbt();mbt();Zir();hbt();Abt();Ll();ssr();_Pe();ZDe();Qae();ybt();ha();bbt();Zsr();Gbt();$bt();Hbt();rPe();zbt();Kbt();lor();Jbt();Xbt();r_t();i_t();s_t();a_t();rbt();Ubt();MPe();sbt();pi();dor();l_t();l_t();$Pe=class extends Et{getCollapsedText;getExpandedText;constructor(e,n,r=!1,i=0,s=0){super(r?n():e(),i,s),this.getCollapsedText=e,this.getExpandedText=n}setExpanded(e){this.setText(e?this.getExpandedText():this.getCollapsedText())}};zys=new Set(["EIO","EPIPE","ENOTCONN"]);mor="Anthropic subscription auth is active. Third-party harness usage draws from extra usage and is billed per token, not your Claude plan limits. Manage extra usage at https://claude.ai/settings/usage. Disable this warning in /settings.";Aor={oauth:0,api_key:1};AG=class t{runtimeHost;renderer;ui;mainScreenRenderState;loadedResourcesContainer;chatContainer;documentContainer;transcriptScrollView;fullscreenLayoutRoot;pendingMessagesContainer;statusContainer;defaultEditor;editor;editorComponentFactory;autocompleteProvider;autocompleteProviderWrappers=[];fdPath;editorContainer;activeSelectorToken;activeSelectorDispose;footer;footerContainer;footerDataProvider;keybindings;version;isInitialized=!1;onInputCallback;pendingUserInputs=[];activeStatusIndicator=void 0;activeWorkingIndicatorEmbedded=!1;idleStatus=new QPe;workingMessage=void 0;workingVisible=!0;workingIndicatorOptions=void 0;defaultWorkingMessage="Working";defaultHiddenThinkingLabel="Thinking...";hiddenThinkingLabel=this.defaultHiddenThinkingLabel;lastSigintTime=0;lastEscapeTime=0;changelogMarkdown=void 0;startupNoticesShown=!1;anthropicSubscriptionWarningShown=!1;lastStatusSpacer=void 0;lastStatusText=void 0;managedToolStatusStarted=!1;streamingComponent=void 0;entriesRenderedByBoundaryCompaction=new Set;streamingMessage=void 0;pendingTools=new Map;toolOutputExpanded=!1;hideThinkingBlock=!1;outputPad=1;mermaidMarkdownTransformer=Xsr({getMode:()=>this.settingsManager.getMermaidRenderingMode(),theme:Ee});skillCommands=new Map;unsubscribe;signalCleanupHandlers=[];isBashMode=!1;bashComponent=void 0;pendingBashComponents=[];autoCompactionEscapeHandler;retryEscapeHandler;compactionQueuedMessages=[];shutdownRequested=!1;bugReportHintShown=!1;extensionSelector=void 0;extensionInput=void 0;extensionEditor=void 0;extensionTerminalInputSubscriptions=new Set;extensionWidgetsAbove=new Map;extensionWidgetsBelow=new Map;widgetContainerAbove;widgetContainerBelow;customFooter=void 0;headerContainer;builtInHeader=void 0;customHeader=void 0;options;onRightClickPaste=()=>{this.handleRightClickPaste()};autoTrustOnReloadCwd;themeController;get session(){return this.runtimeHost.session}get agent(){return this.session.agent}get sessionManager(){return this.session.sessionManager}get settingsManager(){return this.session.settingsManager}constructor(e,n={}){this.runtimeHost=e,RR(this.settingsManager.getTerminalCapabilityOverrides());let r=n.tuiMode??this.settingsManager.getTuiMode();this.options={...n,tuiMode:r},this.autoTrustOnReloadCwd=n.autoTrustOnReloadCwd,this.runtimeHost.setBeforeSessionInvalidate(()=>{this.resetExtensionUI()}),this.runtimeHost.setRebindSession(async()=>{await this.rebindCurrentSession({renderBeforeBind:!0}),await this.themeController.applyFromSettings()}),this.version=Nl,this.renderer=GPe({tuiMode:r,showHardwareCursor:this.settingsManager.getShowHardwareCursor(),logDirectory:ii(),terminal:n.terminal,onRightClickPaste:this.onRightClickPaste,fullscreenCopyOnSelect:this.settingsManager.getFullscreenCopyOnSelect()}),this.ui=c_t(()=>this.renderer),this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink()),this.headerContainer=new gn,this.loadedResourcesContainer=new gn,this.chatContainer=new gn,this.documentContainer=new gn,this.documentContainer.addChild(this.headerContainer),this.documentContainer.addChild(this.loadedResourcesContainer),this.documentContainer.addChild(this.chatContainer),this.pendingMessagesContainer=new gn,this.statusContainer=new gn,this.widgetContainerAbove=new gn,this.widgetContainerBelow=new gn,this.keybindings=Kw.create(),CD(this.keybindings);let i=this.settingsManager.getEditorPaddingX(),s=this.settingsManager.getAutocompleteMaxVisible();this.defaultEditor=new nG(this.ui,Kre(),this.keybindings,{paddingX:i,autocompleteMaxVisible:s,embedWorkingStatus:!0}),this.editor=this.defaultEditor,this.editorContainer=new gn,this.editorContainer.addChild(this.editor),this.footerDataProvider=new BBe(this.sessionManager.getCwd()),this.footer=new rG(this.session,this.footerDataProvider),this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled),this.footerContainer=new gn,this.footerContainer.addChild(this.footer),this.hideThinkingBlock=this.settingsManager.getHideThinkingBlock(),this.outputPad=this.settingsManager.getOutputPad(),Sj(this.session.resourceLoader.getThemes().themes),this.themeController=new UPe(this.ui,{getSettingsManager:()=>this.settingsManager,showError:o=>this.showError(o),onChanged:()=>this.updateEditorBorderColor(),initialThemeSetting:n.initialThemeSetting})}getAutocompleteSourceTag(e){if(!e)return;let n=e.scope==="user"?"u":e.scope==="project"?"p":"t",r=e.source.trim();if(r==="auto"||r==="local"||r==="cli")return n;if(r.startsWith("npm:"))return`${n}:${r}`;let i=goe(r);if(i){let s=i.ref?`@${i.ref}`:"";return`${n}:git:${i.host}/${i.path}${s}`}return n}prefixAutocompleteDescription(e,n){let r=this.getAutocompleteSourceTag(n);return r?e?`[${r}] ${e}`:`[${r}]`:e}getBuiltInCommandConflictDiagnostics(e){let n=new Set(W0t.map(r=>r.name));return e.getRegisteredCommands().filter(r=>n.has(r.name)).map(r=>({type:"warning",message:r.invocationName===r.name?`Extension command '/${r.name}' conflicts with built-in interactive command. Skipping in autocomplete.`:`Extension command '/${r.name}' conflicts with built-in interactive command. Available as '/${r.invocationName}'.`,path:r.sourceInfo.path}))}createBaseAutocompleteProvider(){let e=W0t.map(u=>({name:u.name,description:u.description,...u.argumentHint&&{argumentHint:u.argumentHint}})),n=e.find(u=>u.name==="model");n&&(n.getArgumentCompletions=u=>{let l=this.session.scopedModels.length>0?this.session.scopedModels.map(m=>m.model):this.session.modelRuntime.getAvailableSnapshot();if(l.length===0)return null;let d=l.map(m=>({id:m.id,provider:m.provider,name:m.name,label:`${m.provider}/${m.id}`}));return u_t(d,u,PPe,m=>({value:m.label,label:m.id,description:m.provider}))});let r=e.find(u=>u.name==="thinking");r&&(r.getArgumentCompletions=u=>u_t(this.session.getAvailableThinkingLevels(),u,l=>l,l=>({value:l,label:l})));let i=e.find(u=>u.name==="login");i&&(i.getArgumentCompletions=u=>{let l=nEs(this.getLoginProviderOptions());return u_t(l,u,rEs,d=>({value:d.id,label:d.id,description:iEs(d)}))});let s=this.session.promptTemplates.map(u=>({name:u.name,description:this.prefixAutocompleteDescription(u.description,u.sourceInfo),...u.argumentHint&&{argumentHint:u.argumentHint}})),o=new Set(e.map(u=>u.name)),a=this.session.extensionRunner.getRegisteredCommands().filter(u=>!o.has(u.name)).map(u=>({name:u.invocationName,description:this.prefixAutocompleteDescription(u.description,u.sourceInfo),getArgumentCompletions:u.getArgumentCompletions}));this.skillCommands.clear();let c=[];if(this.settingsManager.getEnableSkillCommands())for(let u of this.session.resourceLoader.getSkills().skills){let l=`skill:${u.name}`;this.skillCommands.set(l,u.filePath),c.push({name:l,description:this.prefixAutocompleteDescription(u.description,u.sourceInfo)})}return new W8([...e,...s,...a,...c],this.sessionManager.getCwd(),this.fdPath)}setupAutocompleteProvider(){let e=this.createBaseAutocompleteProvider(),n=[];for(let r of this.autocompleteProviderWrappers)e=r(e),n.push(...e.triggerCharacters??[]);n.length>0&&(e.triggerCharacters=[...new Set(n)]),this.autocompleteProvider=e,this.defaultEditor.setAutocompleteProvider(e),this.editor!==this.defaultEditor&&this.editor.setAutocompleteProvider?.(e)}showStartupNoticesIfNeeded(){if(!this.startupNoticesShown&&(this.startupNoticesShown=!0,!!this.changelogMarkdown)){if(this.chatContainer.children.length>0&&this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Un),this.settingsManager.getCollapseChangelog()){let e=this.changelogMarkdown.match(/##\s+\[?(\d+\.\d+\.\d+)\]?/),r=`Updated to v${e?e[1]:this.version}. Use ${Ee.bold("/changelog")} to view full changelog.`;this.chatContainer.addChild(new Et(r,1,0))}else this.chatContainer.addChild(new Et(Ee.bold(Ee.fg("accent","What's New")),1,0)),this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Pl(this.changelogMarkdown.trim(),1,0,this.getMarkdownThemeWithSettings())),this.chatContainer.addChild(new Tt(1));this.chatContainer.addChild(new Un)}}mountInteractiveTui(e,n){for(let r of n)e.addChild(r);if(Bre(e)){if(!this.fullscreenLayoutRoot)throw new Error("Fullscreen layout is not initialized");e.setLayoutRoot(this.fullscreenLayoutRoot)}}stopInteractiveTui(e){if(this.renderer.mode==="fullscreen"&&e==="transcript"){for(;this.renderer.hasOverlayEntries;)this.renderer.hideOverlay();this.switchTuiMode("regular",!1,!1),this.renderer.renderNow()}this.ui.stop({preserveScreen:this.renderer.mode==="fullscreen"})}switchTuiMode(e,n=!0,r=!0){let i=this.renderer;if(e===i.mode)return!0;if(i.hasOverlayEntries)return!1;let s=[...i.children],o=i.getFocusedComponent(),a=i.terminal,c=i.getShowHardwareCursor(),u=i.getClearOnShrink(),l=i.onDebug;i instanceof EE&&(this.mainScreenRenderState=i.captureRenderState()),i.stop({preserveScreen:!0}),i.setFocus(null),i.clear(),Bre(i)&&i.setLayoutRoot(void 0);let d=GPe({tuiMode:e,showHardwareCursor:c,logDirectory:ii(),terminal:a,onRightClickPaste:this.onRightClickPaste,fullscreenCopyOnSelect:this.settingsManager.getFullscreenCopyOnSelect()});return d.setClearOnShrink(u),d.onDebug=l,d instanceof EE&&this.mainScreenRenderState&&d.restoreRenderState(this.mainScreenRenderState),this.renderer=d,this.options.tuiMode=e,this.mountInteractiveTui(d,s),d.invalidate(),d.setFocus(o),r&&(d.start(),this.themeController.rebindTui(),this.rebindExtensionTerminalInputListeners(),n&&this.settingsManager.getShowTerminalProgress()&&(this.session.isStreaming||this.session.isCompacting)&&a.setProgress(!0)),!0}async init(){if(this.isInitialized)return;if(this.registerSignalHandlers(),this.changelogMarkdown=this.getChangelogForDisplay(),this.session.scopedModels.length>0&&(this.options.verbose||!this.settingsManager.getQuietStartup())){let r=this.session.scopedModels.map(o=>{let a=o.thinkingLevel?`:${o.thinkingLevel}`:"";return`${o.model.id}${a}`}).join(", "),i=this.keybindings.getKeys("app.model.cycleForward"),s=i.length>0?Ee.fg("muted",` (${QQ(i.join("/"),{capitalize:!0})} to cycle)`):"";console.log(Ee.fg("dim",`Model scope: ${r}${s}`))}this.renderWidgets();let e=Vir({document:this.documentContainer,pendingMessages:this.pendingMessagesContainer,status:this.statusContainer,widgetsAbove:this.widgetContainerAbove,editor:this.editorContainer,widgetsBelow:this.widgetContainerBelow,footer:this.footerContainer,scrollbar:this.settingsManager.getFullscreenScrollbar(),scrollbarTrackStyle:r=>Ee.fg("scrollbarTrack",r),scrollbarThumbStyle:r=>Ee.fg("scrollbarThumb",r)});if(this.transcriptScrollView=e.transcript,this.fullscreenLayoutRoot=e.root,this.mountInteractiveTui(this.renderer,[this.documentContainer,this.pendingMessagesContainer,this.statusContainer,this.widgetContainerAbove,this.editorContainer,this.widgetContainerBelow,this.footerContainer]),this.defaultEditor.onAction("app.clear",()=>this.handleCtrlC()),this.defaultEditor.onCtrlD=()=>this.handleCtrlD(),this.defaultEditor.onSubmit=r=>this.handleStartupSubmit(r),this.ui.setFocus(this.editor),this.ui.start(),this.isInitialized=!0,await this.themeController.applyFromSettings(),this.options.verbose||!this.settingsManager.getQuietStartup()){let r=Ee.bold(Ee.fg("accent",hn))+Ee.fg("dim",` v${this.version}`),i=(u,l)=>nr(u,l),s=[i("app.interrupt","to interrupt"),i("app.clear","to clear"),iu(`${Ca("app.clear")} twice`,"to exit"),i("app.exit","to exit (empty)"),i("app.suspend","to suspend"),nr("tui.editor.deleteToLineEnd","to delete to end"),i("app.thinking.cycle","to cycle thinking level"),iu(`${Ca("app.model.cycleForward")}/${Ca("app.model.cycleBackward")}`,"to cycle models"),i("app.model.select","to select model"),i("app.tools.expand","to expand tools"),i("app.thinking.toggle","to expand thinking"),i("app.editor.external","for external editor"),iu("/","for commands"),iu("!","to run bash"),iu("!!","to run bash (no context)"),i("app.message.followUp","to queue follow-up"),i("app.message.dequeue","to edit all queued messages"),i("app.clipboard.pasteImage","to paste image (with text fallback)"),iu("drop files","to attach")].join(` +`),o=[i("app.interrupt","interrupt"),iu(`${Ca("app.clear")}/${Ca("app.exit")}`,"clear/exit"),iu("/","commands"),iu("!","bash"),i("app.tools.expand","more")].join(Ee.fg("muted"," \xB7 ")),a=Ee.fg("dim",`Press ${Ca("app.tools.expand")} to show full startup help and loaded resources.`),c=Ee.fg("dim","Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.");this.builtInHeader=new $Pe(()=>`${r} ${o} ${a} ${c}`,()=>`${r} -${i} +${s} -${c}`,this.getStartupExpansionState(),1,0),this.headerContainer.addChild(new Nt(1)),this.headerContainer.addChild(this.builtInHeader),this.headerContainer.addChild(new Nt(1))}else this.builtInHeader=new yt("",0,0),this.headerContainer.addChild(this.builtInHeader);this.ui.requestRender();let[n]=await Promise.all([EL("fd",r=>this.showManagedToolStatus(r)),EL("rg",r=>this.showManagedToolStatus(r))]);this.fdPath=n,this.setupKeyHandlers(),this.setupEditorSubmitHandler(),this.ui.requestRender(),await this.rebindCurrentSession(),this.renderInitialMessages(),qhn(()=>{this.ui.invalidate(),this.updateEditorBorderColor(),this.ui.requestRender()}),this.footerDataProvider.onBranchChange(()=>{this.ui.requestRender()}),await this.updateAvailableProviderCount(),this.ui.renderNow(),Dhn().then(()=>{this.isInitialized&&(this.ui.invalidate(),this.ui.requestRender())})}updateTerminalTitle(){let e=bl.basename(this.sessionManager.getCwd()),n=this.sessionManager.getSessionName();n?this.ui.terminal.setTitle(`${N9e} - ${n} - ${e}`):this.ui.terminal.setTitle(`${N9e} - ${e}`)}async run(){if(await this.init(),!process.env.PI_OFFLINE){let c=new AbortController,u=setTimeout(()=>c.abort(),15e3);IV(this.session.modelRuntime,c.signal).then(()=>this.updateAvailableProviderCount()).catch(()=>{}).finally(()=>clearTimeout(u))}BOn(this.version).then(c=>{c&&this.showNewVersionNotification(c)}),this.checkForPackageUpdates().then(c=>{c.length>0&&this.showPackageUpdateNotification(c)}).finally(()=>{process.platform==="win32"&&this.isInitialized&&this.updateTerminalTitle()}),this.checkTmuxKeyboardSetup().then(c=>{c&&this.showWarning(c)});let{migratedProviders:e,startupDiagnostics:n,modelFallbackMessage:r,initialMessage:s,initialImages:i,initialMessages:o}=this.options;for(let c of n??[])c.type==="error"?this.showError(c.message):c.type==="warning"?this.showWarning(c.message):this.showStatus(c.message);e&&e.length>0&&this.showWarning(`Migrated credentials to auth.json: ${e.join(", ")}`);let a=this.session.modelRuntime.getError();if(a&&this.showError(`models.json error: ${a}`),r&&this.showWarning(r),this.maybeWarnAboutAnthropicSubscriptionAuth(),s)try{await this.session.prompt(s,{images:i})}catch(c){let u=c instanceof Error?c.message:"Unknown error occurred";this.showError(u)}if(o)for(let c of o)try{await this.session.prompt(c)}catch(u){let l=u instanceof Error?u.message:"Unknown error occurred";this.showError(l)}for(;;){let c=await this.getUserInput();try{await this.session.prompt(c)}catch(u){let l=u instanceof Error?u.message:"Unknown error occurred";this.showError(l)}}}async checkForPackageUpdates(){if(process.env.PI_OFFLINE)return[];try{return(await new jh({cwd:this.sessionManager.getCwd(),agentDir:ls(),settingsManager:this.settingsManager}).checkForAvailableUpdates()).map(r=>r.displayName)}catch{return[]}}async checkTmuxKeyboardSetup(){if(!process.env.TMUX)return;let e=s=>new Promise(i=>{let o=(0,zMn.spawn)("tmux",["show","-gv",s],{stdio:["ignore","pipe","ignore"]}),a="",c=setTimeout(()=>{o.kill(),i(void 0)},2e3);o.stdout?.on("data",u=>{a+=u.toString()}),o.on("error",()=>{clearTimeout(c),i(void 0)}),o.on("close",u=>{clearTimeout(c),i(u===0?a.trim():void 0)})}),[n,r]=await Promise.all([e("extended-keys"),e("extended-keys-format")]);if(n!==void 0){if(n!=="on"&&n!=="always")return"tmux extended-keys is off. Modified Enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.";if(r==="xterm")return"tmux extended-keys-format is xterm. Pi works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux."}}getChangelogForDisplay(){if(this.session.state.messages.length>0)return;let e=this.settingsManager.getLastChangelogVersion(),n=mbe(),r=Qot(n);if(!e){this.settingsManager.setLastChangelogVersion(Ad),this.reportInstallTelemetry(Ad);return}let s=_On(r,e);if(s.length>0)return this.settingsManager.setLastChangelogVersion(Ad),this.reportInstallTelemetry(Ad),s.map(i=>Fot(i.content,i)).join(` - -`)}reportInstallTelemetry(e){process.env.PI_OFFLINE||Wwe(this.settingsManager)&&fetch(`https://pi.dev/api/report-install?version=${encodeURIComponent(e)}`,{headers:{"User-Agent":pD(e)},signal:AbortSignal.timeout(5e3)}).then(()=>{}).catch(()=>{})}getMarkdownThemeWithSettings(){return{...Fh(),codeBlockIndent:this.settingsManager.getCodeBlockIndent()}}formatDisplayPath(e){let n=vTe.homedir(),r=e;return r.startsWith(n)&&(r=`~${r.slice(n.length)}`),r}formatExtensionDisplayPath(e){let n=this.formatDisplayPath(e);return n=n.replace(/\/index\.ts$/,"").replace(/\/index\.js$/,""),n}formatContextPath(e){let n=bl.resolve(this.sessionManager.getCwd()),r=bl.isAbsolute(e)?bl.resolve(e):bl.resolve(n,e),s=IM(r,n);return s!==void 0?s:this.formatDisplayPath(r)}getStartupExpansionState(){return this.options.verbose||this.toolOutputExpanded}getShortPath(e,n){let r=e.replace(/\\/g,"/"),s=n?.baseDir;if(s&&this.isPackageSource(n)){let c=s.replace(/\\/g,"/"),u=c.match(/^(.*\/node_modules)\/(@?[^/]+(?:\/[^/]+)?)$/);if(u?.[1]&&r.startsWith(`${u[1]}/`))return bl.posix.relative(c,r);let l=bl.relative(bl.resolve(s),bl.resolve(e));if(l&&l!=="."&&!l.startsWith("..")&&!l.startsWith(`..${bl.sep}`)&&!bl.isAbsolute(l))return l.replace(/\\/g,"/")}let i=n?.source??"",o=r.match(/node_modules\/(@?[^/]+(?:\/[^/]+)?)\/(.*)/);if(o&&i.startsWith("npm:"))return o[2];let a=r.match(/git\/[^/]+\/[^/]+\/(.*)/);return a&&i.startsWith("git:")?a[1]:this.formatDisplayPath(e)}getCompactPathLabel(e,n){let r=this.getShortPath(e,n),i=r.replace(/\\/g,"/").split("/").filter(o=>o.length>0&&o!=="~");return i.length>0?i[i.length-1]:r}getCompactPackageSourceLabel(e){let n=e?.source??"";if(n.startsWith("npm:"))return n.slice(4)||n;let r=Uee(n);return r&&r.path||n}getCompactExtensionLabel(e,n){if(!this.isPackageSource(n))return this.getCompactPathLabel(e,n);let r=this.getCompactPackageSourceLabel(n);if(!r)return this.getCompactPathLabel(e,n);let s=this.getShortPath(e,n).replace(/\\/g,"/"),i=s.startsWith("extensions/")?s.slice(11):s,o=bl.posix.parse(i);return o.name==="index"?!o.dir||o.dir==="."?r:`${r}:${o.dir}`:`${r}:${i}`}getCompactDisplayPathSegments(e){return this.formatDisplayPath(e).replace(/\\/g,"/").split("/").filter(n=>n.length>0&&n!=="~")}getCompactNonPackageExtensionLabel(e,n,r){let s=r[n]?.segments;if(!s||s.length===0)return this.getCompactPathLabel(e);for(let i=1;i<=s.length;i+=1){let o=s.slice(-i).join("/");if(r.every((c,u)=>u===n?!0:c.segments.slice(-i).join("/")!==o))return o}return s.join("/")}getCompactExtensionLabels(e){let n=e.map(r=>{let s=this.getCompactDisplayPathSegments(r.path),i=s[s.length-1];return s.length>1&&(i==="index.ts"||i==="index.js")&&s.pop(),{path:r.path,sourceInfo:r.sourceInfo,segments:s}}).filter(r=>!this.isPackageSource(r.sourceInfo));return e.map(r=>{if(this.isPackageSource(r.sourceInfo))return this.getCompactExtensionLabel(r.path,r.sourceInfo);let s=n.findIndex(i=>i.path===r.path);return s===-1?this.getCompactPathLabel(r.path,r.sourceInfo):this.getCompactNonPackageExtensionLabel(r.path,s,n)})}getDisplaySourceInfo(e){let n=e?.source??"local",r=e?.scope??"project";return n==="local"?r==="user"?{label:"user",color:"muted"}:r==="project"?{label:"project",color:"muted"}:r==="temporary"?{label:"path",scopeLabel:"temp",color:"muted"}:{label:"path",color:"muted"}:n==="cli"?{label:"path",scopeLabel:r==="temporary"?"temp":void 0,color:"muted"}:{label:n,scopeLabel:r==="user"?"user":r==="project"?"project":r==="temporary"?"temp":void 0,color:"accent"}}getScopeGroup(e){let n=e?.source??"local",r=e?.scope??"project";return n==="cli"||r==="temporary"?"path":r==="user"?"user":r==="project"?"project":"path"}isPackageSource(e){let n=e?.source??"";return n.startsWith("npm:")||n.startsWith("git:")}buildScopeGroups(e){let n={user:{scope:"user",paths:[],packages:new Map},project:{scope:"project",paths:[],packages:new Map},path:{scope:"path",paths:[],packages:new Map}};for(let r of e){let s=this.getScopeGroup(r.sourceInfo),i=n[s],o=r.sourceInfo?.source??"local";if(this.isPackageSource(r.sourceInfo)){let a=i.packages.get(o)??[];a.push(r),i.packages.set(o,a)}else i.paths.push(r)}return[n.project,n.user,n.path].filter(r=>r.paths.length>0||r.packages.size>0)}formatScopeGroups(e,n){let r=[];for(let s of e){r.push(` ${Se.fg("accent",s.scope)}`);let i=[...s.paths].sort((a,c)=>a.path.localeCompare(c.path));for(let a of i)r.push(Se.fg("dim",` ${n.formatPath(a)}`));let o=Array.from(s.packages.entries()).sort(([a],[c])=>a.localeCompare(c));for(let[a,c]of o){r.push(` ${Se.fg("mdLink",a)}`);let u=[...c].sort((l,d)=>l.path.localeCompare(d.path));for(let l of u)r.push(Se.fg("dim",` ${n.formatPackagePath(l,a)}`))}}return r.join(` -`)}findSourceInfoForPath(e,n){let r=n.get(e);if(r)return r;let s=e;for(;s.includes("/");){s=s.substring(0,s.lastIndexOf("/"));let i=n.get(s);if(i)return i}}formatPathWithSource(e,n){if(n){let r=this.getShortPath(e,n),{label:s,scopeLabel:i}=this.getDisplaySourceInfo(n);return`${i?`${s} (${i})`:s} ${r}`}return this.formatDisplayPath(e)}formatDiagnostics(e,n){let r=[],s=new Map,i=[];for(let o of e)if(o.type==="collision"&&o.collision){let a=s.get(o.collision.name)??[];a.push(o),s.set(o.collision.name,a)}else i.push(o);for(let[o,a]of s){let c=a[0]?.collision;if(c){r.push(Se.fg("warning",` "${o}" collision:`)),r.push(Se.fg("dim",` ${Se.fg("success","\u2713")} ${this.formatPathWithSource(c.winnerPath,this.findSourceInfoForPath(c.winnerPath,n))}`));for(let u of a)u.collision&&r.push(Se.fg("dim",` ${Se.fg("warning","\u2717")} ${this.formatPathWithSource(u.collision.loserPath,this.findSourceInfoForPath(u.collision.loserPath,n))} (skipped)`))}}for(let o of i)if(o.path){let a=this.formatPathWithSource(o.path,this.findSourceInfoForPath(o.path,n));r.push(Se.fg(o.type==="error"?"error":"warning",` ${a}`)),r.push(Se.fg(o.type==="error"?"error":"warning",` ${o.message}`))}else r.push(Se.fg(o.type==="error"?"error":"warning",` ${o.message}`));return r.join(` -`)}showLoadedResources(e){this.loadedResourcesContainer.clear();let n=e?.force||this.options.verbose||!this.settingsManager.getQuietStartup(),r=n||e?.showDiagnosticsWhenQuiet===!0;if(!n&&!r)return;let s=(h,m="mdHeading")=>Se.fg(m,`[${h}]`),i=(h,m)=>{let f=h.map(g=>g.trim()).filter(g=>g.length>0);return m?.sort!==!1&&f.sort((g,A)=>g.localeCompare(A)),Se.fg("dim",` ${f.join(", ")}`)},o=(h,m,f=m,g="mdHeading")=>{let A=new TTe(()=>`${s(h,g)} -${m}`,()=>`${s(h,g)} -${f}`,this.getStartupExpansionState(),0,0);this.loadedResourcesContainer.addChild(A),this.loadedResourcesContainer.addChild(new Nt(1))},a=this.session.resourceLoader.getSkills(),c=this.session.resourceLoader.getPrompts(),u=this.session.resourceLoader.getThemes(),l=e?.extensions??this.session.resourceLoader.getExtensions().extensions.filter(h=>!h.hidden).map(h=>({path:h.path,sourceInfo:h.sourceInfo})),d=new Map;for(let h of l)h.sourceInfo&&d.set(h.path,h.sourceInfo);for(let h of a.skills)h.sourceInfo&&d.set(h.filePath,h.sourceInfo);for(let h of c.prompts)h.sourceInfo&&d.set(h.filePath,h.sourceInfo);for(let h of u.themes)h.sourcePath&&h.sourceInfo&&d.set(h.sourcePath,h.sourceInfo);if(n){let h=this.session.resourceLoader.getSystemPromptSource(),m=[...h?[h]:[],...this.session.resourceLoader.getAppendSystemPromptSources(),...this.session.resourceLoader.getAgentsFiles().agentsFiles];if(m.length>0){this.loadedResourcesContainer.addChild(new Nt(1));let b=m.map(C=>Se.fg("dim",` ${this.formatDisplayPath(C.path)}`)).join(` -`),S=i(m.map(C=>this.formatContextPath(C.path)),{sort:!1});o("Context",S,b)}let f=a.skills;if(f.length>0){let b=this.buildScopeGroups(f.map(I=>({path:I.filePath,sourceInfo:I.sourceInfo}))),S=this.formatScopeGroups(b,{formatPath:I=>this.formatDisplayPath(I.path),formatPackagePath:I=>this.getShortPath(I.path,I.sourceInfo)}),C=i(f.map(I=>I.name));o("Skills",C,S)}let g=this.session.promptTemplates;if(g.length>0){let b=this.buildScopeGroups(g.map(x=>({path:x.filePath,sourceInfo:x.sourceInfo}))),S=new Map(g.map(x=>[x.filePath,x])),C=this.formatScopeGroups(b,{formatPath:x=>{let w=S.get(x.path);return w?`/${w.name}`:this.formatDisplayPath(x.path)},formatPackagePath:x=>{let w=S.get(x.path);return w?`/${w.name}`:this.formatDisplayPath(x.path)}}),I=i(g.map(x=>`/${x.name}`));o("Prompts",I,C)}if(l.length>0){let b=this.buildScopeGroups(l),S=this.formatScopeGroups(b,{formatPath:I=>this.formatExtensionDisplayPath(I.path),formatPackagePath:I=>this.formatExtensionDisplayPath(this.getShortPath(I.path,I.sourceInfo))}),C=i(this.getCompactExtensionLabels(l));o("Extensions",C,S,"mdHeading")}let y=u.themes.filter(b=>b.sourcePath);if(y.length>0){let b=this.buildScopeGroups(y.map(I=>({path:I.sourcePath,sourceInfo:I.sourceInfo}))),S=this.formatScopeGroups(b,{formatPath:I=>this.formatDisplayPath(I.path),formatPackagePath:I=>this.getShortPath(I.path,I.sourceInfo)}),C=i(y.map(I=>I.name??this.getCompactPathLabel(I.sourcePath,I.sourceInfo)));o("Themes",C,S)}}if(r){let h=a.diagnostics;if(h.length>0){let S=this.formatDiagnostics(h,d);this.loadedResourcesContainer.addChild(new yt(`${Se.fg("warning","[Skill conflicts]")} -${S}`,0,0)),this.loadedResourcesContainer.addChild(new Nt(1))}let m=c.diagnostics;if(m.length>0){let S=this.formatDiagnostics(m,d);this.loadedResourcesContainer.addChild(new yt(`${Se.fg("warning","[Prompt conflicts]")} -${S}`,0,0)),this.loadedResourcesContainer.addChild(new Nt(1))}let f=[],g=this.session.resourceLoader.getExtensions().errors;if(g.length>0)for(let S of g)f.push({type:"error",message:S.error,path:S.path});let A=this.session.extensionRunner.getCommandDiagnostics();f.push(...A),f.push(...this.getBuiltInCommandConflictDiagnostics(this.session.extensionRunner));let y=this.session.extensionRunner.getShortcutDiagnostics();if(f.push(...y),f.length>0){let S=this.formatDiagnostics(f,d);this.loadedResourcesContainer.addChild(new yt(`${Se.fg("warning","[Extension issues]")} -${S}`,0,0)),this.loadedResourcesContainer.addChild(new Nt(1))}let b=u.diagnostics;if(b.length>0){let S=this.formatDiagnostics(b,d);this.loadedResourcesContainer.addChild(new yt(`${Se.fg("warning","[Theme conflicts]")} -${S}`,0,0)),this.loadedResourcesContainer.addChild(new Nt(1))}}}async bindCurrentSessionExtensions(){let e=this.createExtensionUIContext();await this.session.bindExtensions({uiContext:e,mode:"tui",abortHandler:()=>{this.restoreQueuedMessagesToEditor({abort:!0})},commandContextActions:{waitForIdle:()=>this.session.waitForIdle(),newSession:async r=>{this.clearStatusIndicator();try{return await this.runtimeHost.newSession(r)}catch(s){return this.handleFatalRuntimeError("Failed to create session",s)}},fork:async(r,s)=>{try{let i=await this.runtimeHost.fork(r,s);return i.cancelled||(this.editor.setText(i.selectedText??""),this.showStatus("Forked to new session")),{cancelled:i.cancelled}}catch(i){return this.handleFatalRuntimeError("Failed to fork session",i)}},navigateTree:async(r,s)=>{let i=await this.session.navigateTree(r,{summarize:s?.summarize,customInstructions:s?.customInstructions,replaceInstructions:s?.replaceInstructions,label:s?.label});return i.cancelled?{cancelled:!0}:(this.chatContainer.clear(),this.renderInitialMessages(),i.editorText&&!this.editor.getText().trim()&&this.editor.setText(i.editorText),this.showStatus("Navigated to selected point"),this.flushCompactionQueue({willRetry:!1}),{cancelled:!1})},switchSession:async(r,s)=>this.handleResumeSession(r,s),reload:async()=>{await this.handleReloadCommand()}},shutdownHandler:()=>{this.shutdownRequested=!0,this.session.isIdle&&this.shutdown()},onError:r=>{this.showExtensionError(r.extensionPath,r.error,r.stack)}}),PH(this.session.resourceLoader.getThemes().themes),this.setupAutocompleteProvider();let n=this.session.extensionRunner;this.setupExtensionShortcuts(n),this.showLoadedResources({force:!1,showDiagnosticsWhenQuiet:!0}),this.showStartupNoticesIfNeeded()}applyFullscreenScrollbarSetting(){this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar())}applyRuntimeSettings(){zw(this.settingsManager.getTerminalCapabilityOverrides()),mV(this.settingsManager.getHttpIdleTimeoutMs()),this.applyFullscreenScrollbarSetting(),this.renderer instanceof u0&&this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect()),this.footer.setSession(this.session),this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled),this.footerDataProvider.setCwd(this.sessionManager.getCwd()),this.hideThinkingBlock=this.settingsManager.getHideThinkingBlock(),this.outputPad=this.settingsManager.getOutputPad(),this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());let e=this.settingsManager.getClearOnShrink();this.ui.setClearOnShrink(e),!e&&!this.activeStatusIndicator&&this.statusContainer.clear();let n=this.settingsManager.getEditorPaddingX(),r=this.settingsManager.getAutocompleteMaxVisible();this.defaultEditor.setPaddingX(n),this.defaultEditor.setAutocompleteMaxVisible(r),this.editor!==this.defaultEditor&&(this.editor.setPaddingX?.(n),this.editor.setAutocompleteMaxVisible?.(r))}async rebindCurrentSession(e={}){let n=this.session;this.unsubscribe?.(),this.unsubscribe=void 0,this.applyRuntimeSettings(),e.renderBeforeBind&&(this.renderCurrentSessionState(),this.subscribeToAgent()),await this.bindCurrentSessionExtensions(),this.session===n&&(e.renderBeforeBind||this.subscribeToAgent(),await this.updateAvailableProviderCount(),this.updateEditorBorderColor(),this.updateTerminalTitle())}async handleFatalRuntimeError(e,n){let r=n instanceof Error?n.message:String(n);this.showError(`${e}: ${r}`),d0(),this.stop("transcript"),process.exit(1)}renderCurrentSessionState(){this.loadedResourcesContainer.clear(),this.chatContainer.clear(),this.pendingMessagesContainer.clear(),this.compactionQueuedMessages=[],this.streamingComponent=void 0,this.streamingMessage=void 0,this.pendingTools.clear(),this.renderInitialMessages()}getRegisteredToolDefinition(e){return bOn(e,this.session.getToolDefinition(e))}getMarkdownTransformers(){return[this.mermaidMarkdownTransformer,...this.session.extensionRunner.getMarkdownTransformers()]}setupExtensionShortcuts(e){let n=e.getShortcuts(this.keybindings.getEffectiveConfig());if(n.size===0)return;let r=()=>({ui:this.createExtensionUIContext(),mode:"tui",hasUI:!0,cwd:this.sessionManager.getCwd(),sessionManager:this.sessionManager,modelRegistry:e.getModelRegistry(),model:this.session.model,scopedModels:this.session.scopedModels,thinkingLevel:this.session.thinkingLevel,isIdle:()=>this.session.isIdle,isProjectTrusted:()=>this.settingsManager.isProjectTrusted(),signal:this.session.agent.signal,abort:()=>{this.restoreQueuedMessagesToEditor({abort:!0})},hasPendingMessages:()=>this.session.pendingMessageCount>0,shutdown:()=>{this.shutdownRequested=!0},getContextUsage:()=>this.session.getContextUsage(),compact:s=>{(async()=>{try{let i=await this.session.compact(s?.customInstructions);s?.onComplete?.(i)}catch(i){let o=i instanceof Error?i:new Error(String(i));s?.onError?.(o)}})()},getSystemPrompt:()=>this.session.systemPrompt});this.defaultEditor.onExtensionShortcut=s=>{for(let[i,o]of n)if(ip(s,i))return Promise.resolve(o.handler(r())).catch(a=>{this.showError(`Shortcut handler error: ${a instanceof Error?a.message:String(a)}`)}),!0;return!1}}setExtensionStatus(e,n){this.footerDataProvider.setExtensionStatus(e,n),this.ui.requestRender()}setEditorWorkingStatusIndicator(e){return this.defaultEditor.setWorkingStatusIndicator(void 0),VMn(this.editor)?(this.editor.setWorkingStatusIndicator(e),!0):!1}showStatusIndicator(e){if(this.activeStatusIndicator?.dispose(),this.activeStatusIndicator=e,this.activeWorkingIndicatorEmbedded=!1,this.statusContainer.clear(),this.setEditorWorkingStatusIndicator(void 0),e instanceof TV&&this.setEditorWorkingStatusIndicator(e)){this.activeWorkingIndicatorEmbedded=!0;return}this.statusContainer.addChild(e)}clearStatusIndicator(e){if(e&&this.activeStatusIndicator?.kind!==e)return;let n=this.activeStatusIndicator,r=n?.kind==="working"&&this.activeWorkingIndicatorEmbedded;n?.dispose(),this.activeStatusIndicator=void 0,this.activeWorkingIndicatorEmbedded=!1,this.statusContainer.clear(),this.setEditorWorkingStatusIndicator(void 0),n&&!r&&this.options.tuiMode==="regular"&&this.ui.getClearOnShrink()&&this.statusContainer.addChild(this.idleStatus)}showWorkingStatusIndicator(){let e=VMn(this.editor)?n=>(this.editor.borderColor??Se.getThinkingBorderColor(this.session.thinkingLevel||"off"))(n):void 0;this.showStatusIndicator(new TV(this.ui,this.workingMessage??this.defaultWorkingMessage,this.workingIndicatorOptions,e))}setWorkingVisible(e){if(this.workingVisible=e,!e){this.clearStatusIndicator("working"),this.ui.requestRender();return}this.session.isStreaming&&this.activeStatusIndicator?.kind!=="working"&&this.showWorkingStatusIndicator(),this.ui.requestRender()}setWorkingIndicator(e){this.workingIndicatorOptions=e,this.activeStatusIndicator?.kind==="working"&&this.activeStatusIndicator.setIndicator(e),this.ui.requestRender()}setHiddenThinkingLabel(e){this.hiddenThinkingLabel=e??this.defaultHiddenThinkingLabel;for(let n of this.chatContainer.children)n instanceof Q0&&n.setHiddenThinkingLabel(this.hiddenThinkingLabel);this.streamingComponent&&this.streamingComponent.setHiddenThinkingLabel(this.hiddenThinkingLabel),this.ui.requestRender()}setExtensionWidget(e,n,r){let s=r?.placement??"aboveEditor",i=c=>{let u=c.get(e);u?.dispose&&u.dispose(),c.delete(e)};if(i(this.extensionWidgetsAbove),i(this.extensionWidgetsBelow),n===void 0){this.renderWidgets();return}let o;if(Array.isArray(n)){let c=new _n;for(let u of n.slice(0,t.MAX_WIDGET_LINES))c.addChild(new yt(u,1,0));n.length>t.MAX_WIDGET_LINES&&c.addChild(new yt(Se.fg("muted","... (widget truncated)"),1,0)),o=c}else o=n(this.ui,Se);(s==="belowEditor"?this.extensionWidgetsBelow:this.extensionWidgetsAbove).set(e,o),this.renderWidgets()}clearExtensionWidgets(){for(let e of this.extensionWidgetsAbove.values())e.dispose?.();for(let e of this.extensionWidgetsBelow.values())e.dispose?.();this.extensionWidgetsAbove.clear(),this.extensionWidgetsBelow.clear(),this.renderWidgets()}resetExtensionUI(){this.extensionSelector&&this.hideExtensionSelector(),this.extensionInput&&this.hideExtensionInput(),this.extensionEditor&&this.hideExtensionEditor(),this.ui.hideOverlay(),this.clearExtensionTerminalInputListeners(),this.setExtensionFooter(void 0),this.setExtensionHeader(void 0),this.clearExtensionWidgets(),this.footerDataProvider.clearExtensionStatuses(),this.footer.invalidate(),this.autocompleteProviderWrappers=[],this.setCustomEditorComponent(void 0),this.setupAutocompleteProvider(),this.defaultEditor.onExtensionShortcut=void 0,this.updateTerminalTitle(),this.workingMessage=void 0,this.workingVisible=!0,this.setWorkingIndicator(),this.activeStatusIndicator?.kind==="working"&&this.activeStatusIndicator.setMessage(`${this.defaultWorkingMessage} (${ra("app.interrupt")} to interrupt)`),this.setHiddenThinkingLabel()}static MAX_WIDGET_LINES=10;renderWidgets(){!this.widgetContainerAbove||!this.widgetContainerBelow||(this.renderWidgetContainer(this.widgetContainerAbove,this.extensionWidgetsAbove,!0,!0),this.renderWidgetContainer(this.widgetContainerBelow,this.extensionWidgetsBelow,!1,!1),this.ui.requestRender())}renderWidgetContainer(e,n,r,s){if(e.clear(),n.size===0){r&&e.addChild(new Nt(1));return}s&&e.addChild(new Nt(1));for(let i of n.values())e.addChild(i)}setExtensionFooter(e){this.customFooter?.dispose&&this.customFooter.dispose(),this.footerContainer.clear(),e?(this.customFooter=e(this.ui,Se,this.footerDataProvider),this.footerContainer.addChild(this.customFooter)):(this.customFooter=void 0,this.footerContainer.addChild(this.footer)),this.ui.requestRender()}setExtensionHeader(e){if(!this.builtInHeader)return;this.customHeader?.dispose&&this.customHeader.dispose();let n=this.customHeader||this.builtInHeader,r=this.headerContainer.children.indexOf(n);e?(this.customHeader=e(this.ui,Se),xne(this.customHeader)&&this.customHeader.setExpanded(this.toolOutputExpanded),r!==-1?this.headerContainer.children[r]=this.customHeader:this.headerContainer.children.unshift(this.customHeader)):(this.customHeader=void 0,xne(this.builtInHeader)&&this.builtInHeader.setExpanded(this.toolOutputExpanded),r!==-1&&(this.headerContainer.children[r]=this.builtInHeader)),this.ui.requestRender()}addExtensionTerminalInputListener(e){let n={handler:e,unsubscribe:this.ui.addInputListener(e)};return this.extensionTerminalInputSubscriptions.add(n),()=>{n.unsubscribe(),this.extensionTerminalInputSubscriptions.delete(n)}}rebindExtensionTerminalInputListeners(){for(let e of this.extensionTerminalInputSubscriptions)e.unsubscribe(),e.unsubscribe=this.ui.addInputListener(e.handler)}clearExtensionTerminalInputListeners(){for(let e of this.extensionTerminalInputSubscriptions)e.unsubscribe();this.extensionTerminalInputSubscriptions.clear()}createProjectTrustContext(e){let n=this.createExtensionUIContext();return{cwd:e,mode:"tui",hasUI:!0,ui:{select:n.select,confirm:n.confirm,input:n.input,notify:n.notify}}}createExtensionUIContext(){return{select:(e,n,r)=>this.showExtensionSelector(e,n,r),confirm:(e,n,r)=>this.showExtensionConfirm(e,n,r),input:(e,n,r)=>this.showExtensionInput(e,n,r),notify:(e,n)=>this.showExtensionNotify(e,n),onTerminalInput:e=>this.addExtensionTerminalInputListener(e),setStatus:(e,n)=>this.setExtensionStatus(e,n),setWorkingMessage:e=>{this.workingMessage=e,this.activeStatusIndicator?.kind==="working"&&this.activeStatusIndicator.setMessage(e??this.defaultWorkingMessage)},setWorkingVisible:e=>this.setWorkingVisible(e),setWorkingIndicator:e=>this.setWorkingIndicator(e),setHiddenThinkingLabel:e=>this.setHiddenThinkingLabel(e),setWidget:(e,n,r)=>this.setExtensionWidget(e,n,r),setFooter:e=>this.setExtensionFooter(e),setHeader:e=>this.setExtensionHeader(e),setTitle:e=>this.ui.terminal.setTitle(e),custom:(e,n)=>this.showExtensionCustom(e,n),pasteToEditor:e=>this.editor.handleInput(`\x1B[200~${e}\x1B[201~`),setEditorText:e=>this.editor.setText(e),getEditorText:()=>this.editor.getExpandedText?.()??this.editor.getText(),editor:(e,n)=>this.showExtensionEditor(e,n),addAutocompleteProvider:e=>{this.autocompleteProviderWrappers.push(e),this.setupAutocompleteProvider()},setEditorComponent:e=>this.setCustomEditorComponent(e),getEditorComponent:()=>this.editorComponentFactory,get theme(){return Se},getAllThemes:()=>Bze(),getTheme:e=>b_e(e),setTheme:e=>{if(e instanceof GM)return this.themeController.setThemeInstance(e);let n=this.themeController.setThemeName(e);return n.success&&this.settingsManager.getTheme()!==e&&this.settingsManager.setTheme(e),n},getToolsExpanded:()=>this.toolOutputExpanded,setToolsExpanded:e=>this.setToolsExpanded(e)}}showExtensionSelector(e,n,r){return new Promise(s=>{if(r?.signal?.aborted){s(void 0);return}let i=()=>{this.hideExtensionSelector(),s(void 0)};r?.signal?.addEventListener("abort",i,{once:!0}),this.extensionSelector=new L0(e,n,o=>{r?.signal?.removeEventListener("abort",i),this.hideExtensionSelector(),s(o)},()=>{r?.signal?.removeEventListener("abort",i),this.hideExtensionSelector(),s(void 0)},{tui:this.ui,timeout:r?.timeout,onToggleToolsExpanded:()=>this.toggleToolOutputExpansion()}),this.disposeActiveSelector(),this.editorContainer.clear(),this.editorContainer.addChild(this.extensionSelector),this.ui.setFocus(this.extensionSelector),this.ui.requestRender()})}hideExtensionSelector(){this.extensionSelector?.dispose(),this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.extensionSelector=void 0,this.ui.setFocus(this.editor),this.ui.requestRender()}async showExtensionConfirm(e,n,r){return await this.showExtensionSelector(`${e} -${n}`,["Yes","No"],r)==="Yes"}async promptForMissingSessionCwd(e){return await this.showExtensionConfirm("Session cwd not found",Hwe(e.issue))?e.issue.fallbackCwd:void 0}showExtensionInput(e,n,r){return new Promise(s=>{if(r?.signal?.aborted){s(void 0);return}let i=()=>{this.hideExtensionInput(),s(void 0)};r?.signal?.addEventListener("abort",i,{once:!0}),this.extensionInput=new QT(e,n,o=>{r?.signal?.removeEventListener("abort",i),this.hideExtensionInput(),s(o)},()=>{r?.signal?.removeEventListener("abort",i),this.hideExtensionInput(),s(void 0)},{tui:this.ui,timeout:r?.timeout}),this.disposeActiveSelector(),this.editorContainer.clear(),this.editorContainer.addChild(this.extensionInput),this.ui.setFocus(this.extensionInput),this.ui.requestRender()})}hideExtensionInput(){this.extensionInput?.dispose(),this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.extensionInput=void 0,this.ui.setFocus(this.editor),this.ui.requestRender()}showExtensionEditor(e,n){return new Promise(r=>{this.extensionEditor=new DF(this.ui,this.keybindings,e,n,s=>{this.hideExtensionEditor(),r(s)},()=>{this.hideExtensionEditor(),r(void 0)},void 0,this.settingsManager.getExternalEditorCommand()),this.disposeActiveSelector(),this.editorContainer.clear(),this.editorContainer.addChild(this.extensionEditor),this.ui.setFocus(this.extensionEditor),this.ui.requestRender()})}hideExtensionEditor(){this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.extensionEditor=void 0,this.ui.setFocus(this.editor),this.ui.requestRender()}setCustomEditorComponent(e){this.editorComponentFactory=e;let n=this.editor.getText();if(this.disposeActiveSelector(),this.editorContainer.clear(),e){let r=e(this.ui,LX(),this.keybindings);r.onSubmit=this.defaultEditor.onSubmit,r.onChange=this.defaultEditor.onChange,r.setText(n),r.borderColor!==void 0&&(r.borderColor=this.defaultEditor.borderColor),r.setPaddingX!==void 0&&r.setPaddingX(this.defaultEditor.getPaddingX()),r.setAutocompleteMaxVisible!==void 0&&r.setAutocompleteMaxVisible(this.defaultEditor.getAutocompleteMaxVisible()),r.setAutocompleteProvider&&this.autocompleteProvider&&r.setAutocompleteProvider(this.autocompleteProvider);let s=r;if("actionHandlers"in s&&s.actionHandlers instanceof Map){s.onEscape||(s.onEscape=()=>this.defaultEditor.onEscape?.()),s.onCtrlD||(s.onCtrlD=()=>this.defaultEditor.onCtrlD?.()),s.onPasteImage||(s.onPasteImage=()=>this.defaultEditor.onPasteImage?.()),s.onExtensionShortcut||(s.onExtensionShortcut=i=>this.defaultEditor.onExtensionShortcut?.(i));for(let[i,o]of this.defaultEditor.actionHandlers)s.actionHandlers.set(i,o)}this.editor=r}else this.defaultEditor.setText(n),this.editor=this.defaultEditor;this.editorContainer.addChild(this.editor),this.activeStatusIndicator instanceof TV&&(this.statusContainer.clear(),this.activeWorkingIndicatorEmbedded=this.setEditorWorkingStatusIndicator(this.activeStatusIndicator),this.activeWorkingIndicatorEmbedded||this.statusContainer.addChild(this.activeStatusIndicator)),this.ui.setFocus(this.editor),this.ui.requestRender()}showExtensionNotify(e,n){n==="error"?this.showError(e):n==="warning"?this.showWarning(e):this.showStatus(e)}async showExtensionCustom(e,n){let r=this.editor.getText(),s=n?.overlay??!1,i=()=>{this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.editor.setText(r),this.ui.setFocus(this.editor),this.ui.requestRender()};return new Promise((o,a)=>{let c,u=!1,l=d=>{if(!u){u=!0,s?this.ui.hideOverlay():i(),o(d);try{c?.dispose?.()}catch{}}};Promise.resolve(e(this.ui,Se,this.keybindings,l)).then(d=>{if(!u)if(c=d,s){let h=()=>{if(n?.overlayOptions)return typeof n.overlayOptions=="function"?n.overlayOptions():n.overlayOptions;let f=c.width;return f?{width:f}:void 0},m=this.ui.showOverlay(c,h());n?.onHandle?.(m)}else this.disposeActiveSelector(),this.editorContainer.clear(),this.editorContainer.addChild(c),this.ui.setFocus(c),this.ui.requestRender()}).catch(d=>{u||(s||i(),a(d))})})}showExtensionError(e,n,r){let s=`Extension "${e}" error: ${n}`,i=new yt(Se.fg("error",s),1,0);if(this.chatContainer.addChild(i),r){let o=r.split(` -`).slice(1).map(a=>Se.fg("dim",` ${a.trim()}`)).join(` -`);o&&this.chatContainer.addChild(new yt(o,1,0))}this.ui.requestRender()}setupKeyHandlers(){this.defaultEditor.onEscape=()=>{if(this.session.isStreaming)this.restoreQueuedMessagesToEditor({abort:!0});else if(this.session.isBashRunning)this.session.abortBash();else if(this.isBashMode)this.editor.setText(""),this.isBashMode=!1,this.updateEditorBorderColor();else if(!this.editor.getText().trim()){let e=this.settingsManager.getDoubleEscapeAction();if(e!=="none"){let n=Date.now();n-this.lastEscapeTime<500?(e==="tree"?this.showTreeSelector():this.showUserMessageSelector(),this.lastEscapeTime=0):this.lastEscapeTime=n}}},this.defaultEditor.onAction("app.clear",()=>this.handleCtrlC()),this.defaultEditor.onCtrlD=()=>this.handleCtrlD(),this.defaultEditor.onAction("app.suspend",()=>this.handleCtrlZ()),this.defaultEditor.onAction("app.thinking.cycle",()=>this.cycleThinkingLevel()),this.defaultEditor.onAction("app.model.cycleForward",()=>this.cycleModel("forward")),this.defaultEditor.onAction("app.model.cycleBackward",()=>this.cycleModel("backward")),this.ui.onDebug=()=>this.handleDebugCommand(),this.defaultEditor.onAction("app.model.select",()=>this.showModelSelector()),this.defaultEditor.onAction("app.tools.expand",()=>this.toggleToolOutputExpansion()),this.defaultEditor.onAction("app.thinking.toggle",()=>this.toggleThinkingBlockVisibility()),this.defaultEditor.onAction("app.editor.external",()=>{this.handleOpenExternalEditor()}),this.defaultEditor.onAction("app.message.copy",()=>{this.handleCopyCommand({flashConfirmation:!0,preferSelection:!0})}),this.defaultEditor.onAction("app.message.followUp",()=>this.handleFollowUp()),this.defaultEditor.onAction("app.message.dequeue",()=>this.handleDequeue()),this.defaultEditor.onAction("app.session.new",()=>this.handleClearCommand()),this.defaultEditor.onAction("app.session.tree",()=>this.showTreeSelector()),this.defaultEditor.onAction("app.session.fork",()=>this.showUserMessageSelector()),this.defaultEditor.onAction("app.session.resume",()=>this.showSessionSelector()),this.defaultEditor.onChange=e=>{let n=this.isBashMode;this.isBashMode=e.trimStart().startsWith("!"),n!==this.isBashMode&&this.updateEditorBorderColor()},this.defaultEditor.onPasteImage=()=>{this.handleClipboardPaste()}}async handleRightClickPaste(){let e=this.renderer.getFocusedComponent(),n=e?.handleInput;if(!(!e||!n))try{let r=await qot();if(!r||this.renderer.getFocusedComponent()!==e)return;n.call(e,`\x1B[200~${r}\x1B[201~`),this.ui.requestRender()}catch{}}async handleClipboardPaste(){try{let e=await NOn();if(e){let r=vTe.tmpdir(),s=ROn(e.mimeType)??"png",i=`pi-clipboard-${KMn.randomUUID()}.${s}`,o=bl.join(r,i);VF.writeFileSync(o,Buffer.from(e.bytes)),this.editor.insertTextAtCursor?.(o),this.ui.requestRender();return}let n=await qot();n&&(this.editor.insertTextAtCursor?.(n),this.ui.requestRender())}catch{}}handleStartupSubmit(e){this.editor.setText(e),this.showStatus("Startup is still in progress")}setupEditorSubmitHandler(){this.defaultEditor.onSubmit=async e=>{if(e=e.trim(),!!e){if(e==="/settings"){this.showSettingsSelector(),this.editor.setText("");return}if(e==="/scoped-models"){this.editor.setText(""),await this.showModelsSelector();return}if(e==="/model"||e.startsWith("/model ")){let n=e.startsWith("/model ")?e.slice(7).trim():void 0;this.editor.setText(""),await this.handleModelCommand(n);return}if(e==="/thinking"||e.startsWith("/thinking ")){let n=e.startsWith("/thinking ")?e.slice(10).trim():void 0;this.editor.setText(""),this.handleThinkingCommand(n);return}if(e==="/export"||e.startsWith("/export ")){await this.handleExportCommand(e),this.editor.setText("");return}if(e==="/import"||e.startsWith("/import ")){await this.handleImportCommand(e),this.editor.setText("");return}if(e==="/share"){await this.handleShareCommand(),this.editor.setText("");return}if(e==="/copy"){await this.handleCopyCommand(),this.editor.setText("");return}if(e==="/name"||e.startsWith("/name ")){this.handleNameCommand(e),this.editor.setText("");return}if(e==="/session"){this.handleSessionCommand(),this.editor.setText("");return}if(e==="/changelog"){this.handleChangelogCommand(),this.editor.setText("");return}if(e==="/hotkeys"){this.handleHotkeysCommand(),this.editor.setText("");return}if(e==="/fork"){this.showUserMessageSelector(),this.editor.setText("");return}if(e==="/clone"){this.editor.setText(""),await this.handleCloneCommand();return}if(e==="/tree"){this.showTreeSelector(),this.editor.setText("");return}if(e==="/trust"){this.showTrustSelector(),this.editor.setText("");return}if(e==="/login"||e.startsWith("/login ")){let n=e.startsWith("/login ")?e.slice(7).trim():void 0;this.editor.setText(""),await this.handleLoginCommand(n);return}if(e==="/logout"){this.showOAuthSelector("logout"),this.editor.setText("");return}if(e==="/new"){this.editor.setText(""),await this.handleClearCommand();return}if(e==="/compact"||e.startsWith("/compact ")){let n=e.startsWith("/compact ")?e.slice(9).trim():void 0;this.editor.setText(""),await this.handleCompactCommand(n);return}if(e==="/reload"){this.editor.setText(""),await this.handleReloadCommand();return}if(e==="/debug"){this.handleDebugCommand(),this.editor.setText("");return}if(e==="/arminsayshi"){this.handleArminSaysHi(),this.editor.setText("");return}if(e==="/dementedelves"){this.handleDementedDelves(),this.editor.setText("");return}if(e==="/resume"){this.showSessionSelector(),this.editor.setText("");return}if(e==="/quit"){this.editor.setText(""),await this.shutdown();return}if(e.startsWith("!")){let n=e.startsWith("!!"),r=n?e.slice(2).trim():e.slice(1).trim();if(r){if(this.session.isBashRunning){this.showWarning("A bash command is already running. Press Esc to cancel it first."),this.editor.setText(e);return}this.editor.addToHistory?.(e),await this.handleBashCommand(r,n),this.isBashMode=!1,this.updateEditorBorderColor();return}}if(this.session.isCompacting){this.isExtensionCommand(e)?(this.editor.addToHistory?.(e),this.editor.setText(""),await this.session.prompt(e)):this.queueCompactionMessage(e,"steer");return}if(this.session.isStreaming){this.editor.addToHistory?.(e),this.editor.setText(""),await this.session.prompt(e,{streamingBehavior:"steer"}),this.updatePendingMessagesDisplay(),this.ui.requestRender();return}this.flushPendingBashComponents(),this.onInputCallback?this.onInputCallback(e):this.pendingUserInputs.push(e),this.editor.addToHistory?.(e)}}}subscribeToAgent(){this.unsubscribe=this.session.subscribe(async e=>{await this.handleEvent(e)})}async handleEvent(e){switch(this.isInitialized||await this.init(),this.footer.invalidate(),e.type){case"agent_start":this.pendingTools.clear(),this.retryEscapeHandler&&(this.defaultEditor.onEscape=this.retryEscapeHandler,this.retryEscapeHandler=void 0);break;case"turn_start":this.settingsManager.getShowTerminalProgress()&&this.ui.terminal.setProgress(!0),this.workingVisible?this.activeStatusIndicator?.kind!=="working"&&this.showWorkingStatusIndicator():this.clearStatusIndicator(),this.ui.requestRender();break;case"queue_update":this.updatePendingMessagesDisplay(),this.ui.requestRender();break;case"entry_appended":e.entry.type==="custom"&&(this.addCustomEntryToChat(e.entry),this.ui.requestRender());break;case"session_info_changed":this.updateTerminalTitle(),this.footer.invalidate(),this.ui.requestRender();break;case"thinking_level_changed":this.footer.invalidate(),this.updateEditorBorderColor();break;case"message_start":e.message.role==="custom"?(this.addMessageToChat(e.message),this.ui.requestRender()):e.message.role==="user"?(this.addMessageToChat(e.message),this.updatePendingMessagesDisplay(),this.ui.requestRender()):e.message.role==="assistant"&&(this.streamingComponent=new Q0(void 0,this.hideThinkingBlock,this.getMarkdownThemeWithSettings(),this.hiddenThinkingLabel,this.outputPad,this.getMarkdownTransformers()),this.streamingMessage=e.message,this.chatContainer.addChild(this.streamingComponent),this.streamingComponent.updateContent(this.streamingMessage,!0),this.ui.requestRender());break;case"message_update":if(this.streamingComponent&&e.message.role==="assistant"){this.streamingMessage=e.message,this.streamingComponent.updateContent(this.streamingMessage,!0);for(let n of this.streamingMessage.content)if(n.type==="toolCall")if(this.pendingTools.has(n.id)){let r=this.pendingTools.get(n.id);r&&r.updateArgs(n.arguments)}else{let r=new G0(n.name,n.id,n.arguments,{showImages:this.settingsManager.getShowImages(),imageWidthCells:this.settingsManager.getImageWidthCells()},this.getRegisteredToolDefinition(n.name),this.ui,this.sessionManager.getCwd());r.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(r),this.pendingTools.set(n.id,r)}this.ui.requestRender()}break;case"message_end":if(e.message.role==="user")break;if(this.streamingComponent&&e.message.role==="assistant"){this.streamingMessage=e.message;let n;if(this.streamingMessage.stopReason==="aborted"){let r=this.session.retryAttempt;n=r>0?`Aborted after ${r} retry attempt${r>1?"s":""}`:"Operation aborted",this.streamingMessage.errorMessage=n}if(this.streamingComponent.updateContent(this.streamingMessage,!1),this.streamingMessage.stopReason==="aborted"||this.streamingMessage.stopReason==="error"){n||(n=this.streamingMessage.errorMessage||"Error");for(let[,r]of this.pendingTools.entries())r.updateResult({content:[{type:"text",text:n}],isError:!0});this.pendingTools.clear()}else{for(let[,r]of this.pendingTools.entries())r.setArgsComplete();this.maybeShowAssistantDiagnostics(this.streamingMessage),this.maybeShowCacheMissNotice(this.streamingMessage)}this.streamingComponent=void 0,this.streamingMessage=void 0,this.footer.invalidate()}this.ui.requestRender();break;case"bash_execution_update":break;case"tool_execution_start":{let n=this.pendingTools.get(e.toolCallId);n||(n=new G0(e.toolName,e.toolCallId,e.args,{showImages:this.settingsManager.getShowImages(),imageWidthCells:this.settingsManager.getImageWidthCells()},this.getRegisteredToolDefinition(e.toolName),this.ui,this.sessionManager.getCwd()),n.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(n),this.pendingTools.set(e.toolCallId,n)),n.markExecutionStarted(),this.ui.requestRender();break}case"tool_execution_update":{let n=this.pendingTools.get(e.toolCallId);n&&(n.updateResult({...e.partialResult,isError:!1},!0),this.ui.requestRender());break}case"tool_execution_end":{let n=this.pendingTools.get(e.toolCallId);n&&(n.updateResult({...e.result,isError:e.isError}),this.pendingTools.delete(e.toolCallId),this.ui.requestRender());break}case"agent_end":this.settingsManager.getShowTerminalProgress()&&this.ui.terminal.setProgress(!1),this.clearStatusIndicator("working"),this.streamingComponent&&(this.chatContainer.removeChild(this.streamingComponent),this.streamingComponent=void 0,this.streamingMessage=void 0),this.pendingTools.clear(),this.ui.requestRender();break;case"agent_settled":await this.checkShutdownRequested();break;case"compaction_start":{this.settingsManager.getShowTerminalProgress()&&this.ui.terminal.setProgress(!0),this.autoCompactionEscapeHandler=this.defaultEditor.onEscape,this.defaultEditor.onEscape=()=>{this.session.abortCompaction()},this.showStatusIndicator(new Sne(this.ui,e.reason)),this.ui.requestRender();break}case"compaction_end":{if(this.settingsManager.getShowTerminalProgress()&&this.ui.terminal.setProgress(!1),this.autoCompactionEscapeHandler&&(this.defaultEditor.onEscape=this.autoCompactionEscapeHandler,this.autoCompactionEscapeHandler=void 0),this.clearStatusIndicator("compaction"),e.aborted)e.reason==="manual"?this.showError("Compaction cancelled"):this.showStatus("Auto-compaction cancelled");else if(e.result){let n=this.sessionManager.buildContextEntries();if(n[0]?.type!=="compaction")throw new Error("Completed compaction is missing from the session context");this.chatContainer.clear(),this.renderSessionEntries(n.slice(1)),this.addMessageToChat(o5(e.result.summary,e.result.tokensBefore,new Date().toISOString())),e.result.usage&&this.addCompactionCostNotice({type:"compaction_cost",kind:"compaction",usage:e.result.usage}),this.footer.invalidate()}else e.errorMessage&&(e.reason==="manual"?this.showError(e.errorMessage):(this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(Se.fg("error",e.errorMessage),1,0))));this.flushCompactionQueue({willRetry:e.willRetry}),this.ui.requestRender();break}case"auto_retry_start":{this.retryEscapeHandler=this.defaultEditor.onEscape,this.defaultEditor.onEscape=()=>{this.session.abortRetry()},this.showStatusIndicator(new _ne(this.ui,e.attempt,e.maxAttempts,e.delayMs)),this.ui.requestRender();break}case"auto_retry_end":{this.retryEscapeHandler&&(this.defaultEditor.onEscape=this.retryEscapeHandler,this.retryEscapeHandler=void 0),this.clearStatusIndicator("retry"),e.success||this.showError(`Retry failed after ${e.attempt} attempts: ${e.finalError||"Unknown error"}`),this.ui.requestRender();break}case"summarization_retry_scheduled":{this.showError(e.errorMessage),this.showStatusIndicator(new _ne(this.ui,e.attempt,e.maxAttempts,e.delayMs)),this.ui.requestRender();break}case"summarization_retry_attempt_start":{this.clearStatusIndicator("retry"),e.source==="branchSummary"?this.showStatusIndicator(new Cne(this.ui)):this.showStatusIndicator(new Sne(this.ui,e.reason)),this.ui.requestRender();break}case"summarization_retry_finished":{this.clearStatusIndicator("retry"),this.ui.requestRender();break}}}getUserMessageText(e){return e.role!=="user"?"":(typeof e.content=="string"?[{type:"text",text:e.content}]:e.content.filter(r=>r.type==="text")).map(r=>r.text).join("")}showManagedToolStatus(e){this.managedToolStatusStarted||(this.chatContainer.addChild(new Nt(1)),this.managedToolStatusStarted=!0);let n=e.type==="warning"?`Warning: ${e.message}`:e.message,r=e.type==="warning"?"warning":"dim";this.chatContainer.addChild(new yt(Se.fg(r,n),1,0)),this.lastStatusSpacer=void 0,this.lastStatusText=void 0,this.ui.requestRender()}showStatus(e){let n=this.chatContainer.children,r=n.length>0?n[n.length-1]:void 0,s=n.length>1?n[n.length-2]:void 0;if(r&&s&&r===this.lastStatusText&&s===this.lastStatusSpacer){this.lastStatusText.setText(Se.fg("dim",e)),this.ui.requestRender();return}let i=new Nt(1),o=new yt(Se.fg("dim",e),1,0);this.chatContainer.addChild(i),this.chatContainer.addChild(o),this.lastStatusSpacer=i,this.lastStatusText=o,this.ui.requestRender()}addCustomEntryToChat(e){let n=this.session.extensionRunner.getEntryRenderer(e.customType);if(!n)return;let r=new lTe(e,n);if(r.setExpanded(this.toolOutputExpanded),!!r.hasContent()){if(this.streamingComponent){let s=this.chatContainer.children.indexOf(this.streamingComponent);if(s>=0){this.chatContainer.children.splice(s,0,r);return}}this.chatContainer.addChild(r)}}addMessageToChat(e,n){switch(e.role){case"bashExecution":{let r=new GT(e.command,this.ui,e.excludeFromContext);e.output&&r.appendOutput(e.output),r.setComplete(e.exitCode,e.cancelled,e.truncated?{truncated:!0}:void 0,e.fullOutputPath),this.chatContainer.addChild(r);break}case"custom":{if(e.display){let r=this.session.extensionRunner.getMessageRenderer(e.customType),s=new ZD(e,r,this.getMarkdownThemeWithSettings(),this.outputPad);s.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(s)}break}case"compactionSummary":{this.chatContainer.addChild(new Nt(1));let r=new kF(e,this.getMarkdownThemeWithSettings());r.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(r);break}case"branchSummary":{this.chatContainer.addChild(new Nt(1));let r=new RF(e,this.getMarkdownThemeWithSettings());r.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(r);break}case"user":{let r=this.getUserMessageText(e);if(r){this.chatContainer.children.length>0&&this.chatContainer.addChild(new Nt(1));let s=HCe(r);if(s){let i=new GF(s,this.getMarkdownThemeWithSettings());if(i.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(i),s.userMessage){this.chatContainer.addChild(new Nt(1));let o=new KT(s.userMessage,this.getMarkdownThemeWithSettings(),this.outputPad,this.getMarkdownTransformers());this.chatContainer.addChild(o)}}else{let i=new KT(r,this.getMarkdownThemeWithSettings(),this.outputPad,this.getMarkdownTransformers());this.chatContainer.addChild(i)}n?.populateHistory&&this.editor.addToHistory?.(r)}break}case"assistant":{let r=new Q0(e,this.hideThinkingBlock,this.getMarkdownThemeWithSettings(),this.hiddenThinkingLabel,this.outputPad,this.getMarkdownTransformers());this.chatContainer.addChild(r);break}case"toolResult":break;default:{let r=e}}}renderSessionItems(e,n={}){this.pendingTools.clear();let r=new Map,s=this.settingsManager.getShowCacheMissNotices()?yOn(this.sessionManager.getEntries(),this.session.modelRuntime):new Map;n.updateFooter&&(this.footer.invalidate(),this.updateEditorBorderColor());for(let i of e){if(UGs(i)){this.addCustomEntryToChat(i);continue}if($Gs(i)){this.addCompactionCostNotice(i);continue}let o=i;if(o.role==="assistant"){this.addMessageToChat(o);for(let a of o.content)if(a.type==="toolCall"){let c=new G0(a.name,a.id,a.arguments,{showImages:this.settingsManager.getShowImages(),imageWidthCells:this.settingsManager.getImageWidthCells()},this.getRegisteredToolDefinition(a.name),this.ui,this.sessionManager.getCwd());if(c.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(c),o.stopReason==="aborted"||o.stopReason==="error"){let u;if(o.stopReason==="aborted"){let l=this.session.retryAttempt;u=l>0?`Aborted after ${l} retry attempt${l>1?"s":""}`:"Operation aborted"}else u=o.errorMessage||"Error";c.updateResult({content:[{type:"text",text:u}],isError:!0})}else r.set(a.id,c)}if(o.stopReason!=="aborted"&&o.stopReason!=="error"){this.maybeShowAssistantDiagnostics(o);let a=s.get(o);a&&this.addCacheMissNotice(a)}}else if(o.role==="toolResult"){let a=r.get(o.toolCallId);a&&(a.updateResult(o),r.delete(o.toolCallId))}else this.addMessageToChat(o,n)}for(let[i,o]of r)this.pendingTools.set(i,o);this.ui.requestRender()}renderSessionEntries(e,n={}){let r=e.flatMap(s=>{if(s.type==="custom")return[s];let i=g0(s);return(s.type==="compaction"||s.type==="branch_summary")&&s.usage&&i.length>0?[...i,{type:"compaction_cost",kind:s.type,usage:s.usage}]:i});this.renderSessionItems(r,n)}addCompactionCostNotice(e){if(!this.settingsManager.getShowCacheMissNotices())return;let{usage:n}=e,r=n.input+n.output+n.cacheRead+n.cacheWrite,s=n.cost.total>=.01?` (~$${n.cost.total.toFixed(2)})`:"",i=e.kind==="compaction"?"Compaction":"Branch summary";this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(Se.fg("warning",`${i}: ${kI(r)} tokens billed${s}`),1,0))}maybeShowAssistantDiagnostics(e){if(this.settingsManager.getShowCacheMissNotices())for(let n of e.diagnostics??[]){if(n.type!=="anthropic_input_transformations")continue;let r=n.details?.transformations;if(!Array.isArray(r))continue;let s=r.flatMap(o=>{if(typeof o!="object"||o===null)return[];let a=o;if(a.type!=="thinking_dropped")return[];let c=typeof a.reason=="string"?a.reason:"unknown reason",u=typeof a.path=="string"?` at ${a.path}`:"";return[`${c}${u}`]});if(s.length===0)continue;let i=s.length===1?"thinking block":`${s.length} thinking blocks`;this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(Se.fg("warning",`Anthropic dropped ${i}: ${s.join("; ")}`),1,0))}}maybeShowCacheMissNotice(e){if(!this.settingsManager.getShowCacheMissNotices())return;let n=EOn(this.sessionManager.getEntries(),e,this.session.modelRuntime);n&&this.addCacheMissNotice(n)}addCacheMissNotice(e){if(e.missedTokens<2e4&&e.missedCost<.1)return;let n=e.missedCost>=.01?` (~$${e.missedCost.toFixed(2)})`:"",r=`${kI(e.missedTokens)} tokens re-billed${n}`,s="Cache miss";e.modelChanged?s="Cache miss after model switch":e.idleMs>=3e5&&(s=`Cache miss after ${Math.round(e.idleMs/6e4)}m idle`);let i=Se.fg("warning",`${s}: ${r}`);this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(i,1,0))}renderInitialMessages(){let e=this.sessionManager.buildContextEntries();this.renderSessionEntries(e,{updateFooter:!0,populateHistory:!0}),this.renderProjectTrustWarningIfNeeded();let r=this.sessionManager.getEntries().filter(s=>s.type==="compaction").length;if(r>0){let s=r===1?"1 time":`${r} times`;this.showStatus(`Session compacted ${s}`)}}renderProjectTrustWarningIfNeeded(){this.settingsManager.isProjectTrusted()||!fb(this.sessionManager.getCwd())||(this.chatContainer.children.length>0&&this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(Se.fg("warning",`This project is not trusted. Project ${ws} resources and packages are ignored. Use /trust to save a trust decision, then restart pi.`),1,0)))}async getUserInput(){let e=this.pendingUserInputs.shift();return e!==void 0?e:new Promise(n=>{this.onInputCallback=r=>{this.onInputCallback=void 0,n(r)}})}rebuildChatFromMessages(){this.chatContainer.clear(),this.renderSessionEntries(this.sessionManager.buildContextEntries())}handleCtrlC(){let e=Date.now();e-this.lastSigintTime<500?this.shutdown():(this.clearEditor(),this.lastSigintTime=e)}handleCtrlD(){this.shutdown()}isShuttingDown=!1;async shutdown(e){if(this.isShuttingDown)return;this.isShuttingDown=!0,e?.fromSignal&&(await this.runtimeHost.dispose(),this.themeController.disableAutoSync(),await this.ui.terminal.drainInput(1e3),this.stop(),process.exit(0)),this.themeController.disableAutoSync(),await this.ui.terminal.drainInput(1e3),this.stop(),await this.runtimeHost.dispose();let n=jGs(this.sessionManager);n&&process.stdout.write(`${en.dim("To resume this session:")} ${n} -`),process.exit(0)}emergencyTerminalExit(){this.isShuttingDown=!0,this.unregisterSignalHandlers(),KN(),process.exit(129)}uncaughtCrash(e){this.isShuttingDown&&process.exit(1),this.isShuttingDown=!0;try{this.unregisterSignalHandlers()}catch{}try{KN()}catch{}try{this.ui.stop()}catch{}console.error(`${An} exiting due to uncaughtException:`),console.error(e),process.exit(1)}async checkShutdownRequested(){this.shutdownRequested&&await this.shutdown()}registerSignalHandlers(){this.unregisterSignalHandlers();let e=["SIGTERM"];process.platform!=="win32"&&e.push("SIGHUP");for(let s of e){let i=()=>{KN(),this.shutdown({fromSignal:!0})};process.prependListener(s,i),this.signalCleanupHandlers.push(()=>process.off(s,i))}let n=s=>{throw WGs(s)&&this.emergencyTerminalExit(),s};process.stdout.on("error",n),process.stderr.on("error",n),this.signalCleanupHandlers.push(()=>process.stdout.off("error",n)),this.signalCleanupHandlers.push(()=>process.stderr.off("error",n));let r=s=>this.uncaughtCrash(s);process.prependListener("uncaughtException",r),this.signalCleanupHandlers.push(()=>process.off("uncaughtException",r))}unregisterSignalHandlers(){for(let e of this.signalCleanupHandlers)e();this.signalCleanupHandlers=[]}handleCtrlZ(){if(process.platform==="win32"){this.showStatus("Suspend to background is not supported on Windows");return}let e=setInterval(()=>{},2**30),n=()=>{};process.on("SIGINT",n),process.once("SIGCONT",()=>{clearInterval(e),process.removeListener("SIGINT",n),this.ui.start(),this.ui.requestRender(!0)});try{this.ui.stop(),process.kill(0,"SIGTSTP")}catch(r){throw clearInterval(e),process.removeListener("SIGINT",n),r}}async handleFollowUp(){let e=(this.editor.getExpandedText?.()??this.editor.getText()).trim();if(e){if(this.session.isCompacting){this.isExtensionCommand(e)?(this.editor.addToHistory?.(e),this.editor.setText(""),await this.session.prompt(e)):this.queueCompactionMessage(e,"followUp");return}this.session.isStreaming?(this.editor.addToHistory?.(e),this.editor.setText(""),await this.session.prompt(e,{streamingBehavior:"followUp"}),this.updatePendingMessagesDisplay(),this.ui.requestRender()):this.editor.onSubmit&&(this.editor.setText(""),this.editor.onSubmit(e))}}handleDequeue(){let e=this.restoreQueuedMessagesToEditor();e===0?this.showStatus("No queued messages to restore"):this.showStatus(`Restored ${e} queued message${e>1?"s":""} to editor`)}updateEditorBorderColor(){if(this.isBashMode)this.editor.borderColor=Se.getBashModeBorderColor();else{let e=this.session.thinkingLevel||"off";this.editor.borderColor=Se.getThinkingBorderColor(e)}this.activeStatusIndicator?.kind==="working"&&this.activeStatusIndicator.invalidate(),this.ui.requestRender()}cycleThinkingLevel(){let e=this.session.cycleThinkingLevel();e===void 0?this.showStatus("Current model does not support thinking"):(this.footer.invalidate(),this.updateEditorBorderColor(),this.showStatus(`Thinking level: ${e}`))}async cycleModel(e){try{let n=await this.session.cycleModel(e);if(n===void 0){let r=this.session.scopedModels.length>0?"Only one model in scope":"Only one model available";this.showStatus(r)}else{this.footer.invalidate(),this.updateEditorBorderColor();let r=n.model.reasoning&&n.thinkingLevel!=="off"?` (thinking: ${n.thinkingLevel})`:"";this.showStatus(`Switched to ${n.model.name||n.model.id}${r}`),this.maybeWarnAboutAnthropicSubscriptionAuth(n.model)}}catch(n){this.showError(n instanceof Error?n.message:String(n))}}toggleToolOutputExpansion(){this.setToolsExpanded(!this.toolOutputExpanded)}setToolsExpanded(e){if(e===this.toolOutputExpanded)return;this.toolOutputExpanded=e;let n=this.customHeader??this.builtInHeader;xne(n)&&n.setExpanded(e);for(let r of[this.loadedResourcesContainer,this.chatContainer])for(let s of r.children)xne(s)&&s.setExpanded(e);this.showStatus(`Tool output: ${e?"expanded":"collapsed"}`)}updateThinkingBlockVisibility(){for(let e of this.chatContainer.children)e instanceof Q0&&e.setHideThinkingBlock(this.hideThinkingBlock);this.ui.requestRender()}toggleThinkingBlockVisibility(){this.hideThinkingBlock=!this.hideThinkingBlock,this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock),this.updateThinkingBlockVisibility(),this.showStatus(`Thinking blocks: ${this.hideThinkingBlock?"hidden":"visible"}`)}async handleOpenExternalEditor(){let e=this.settingsManager.getExternalEditorCommand(),n=this.editor.getExpandedText?.()??this.editor.getText();this.ui.stop();try{let r=await pTe({command:e,content:n});r.status==="complete"&&this.editor.setText(r.content)}finally{this.ui.start(),this.ui.requestRender(!0)}}clearEditor(){this.editor.setText(""),this.ui.requestRender()}showError(e){this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(Se.fg("error",`Error: ${e}`),this.outputPad,0)),this.ui.requestRender()}showWarning(e){this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(Se.fg("warning",`Warning: ${e}`),1,0)),this.ui.requestRender()}showNewVersionNotification(e){let n=Se.fg("accent",`${An} update`),r=Se.fg("muted",`New version ${e.version} is available. Run `)+n,s="https://pi.dev/changelog",i=qc().hyperlinks?jA(Se.fg("accent",s),s):Se.fg("accent",s),o=Se.fg("muted","Changelog: ")+i,a=e.note?.trim();this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new Ln(c=>Se.fg("warning",c))),this.chatContainer.addChild(new yt(`${Se.bold(Se.fg("warning","Update Available"))} -${r}`,1,0)),a&&(this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new Hc(a,1,0,this.getMarkdownThemeWithSettings(),{color:c=>Se.fg("muted",c)})),this.chatContainer.addChild(new Nt(1))),this.chatContainer.addChild(new yt(o,1,0)),this.chatContainer.addChild(new Ln(c=>Se.fg("warning",c))),this.ui.requestRender()}showPackageUpdateNotification(e){let n=Se.fg("accent",`${An} update --extensions`),r=Se.fg("muted","Package updates are available. Run ")+n,s=e.map(i=>`- ${i}`).join(` -`);this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new Ln(i=>Se.fg("warning",i))),this.chatContainer.addChild(new yt(`${Se.bold(Se.fg("warning","Package Updates Available"))} +${c}`,this.getStartupExpansionState(),1,0),this.headerContainer.addChild(new Tt(1)),this.headerContainer.addChild(this.builtInHeader),this.headerContainer.addChild(new Tt(1))}else this.builtInHeader=new Et("",0,0),this.headerContainer.addChild(this.builtInHeader);this.ui.requestRender();let[n]=await Promise.all([HQ("fd",r=>this.showManagedToolStatus(r)),HQ("rg",r=>this.showManagedToolStatus(r))]);this.fdPath=n,this.setupKeyHandlers(),this.setupEditorSubmitHandler(),this.ui.requestRender(),await this.rebindCurrentSession(),this.renderInitialMessages(),iQn(()=>{this.ui.invalidate(),this.updateEditorBorderColor(),this.ui.requestRender()}),this.footerDataProvider.onBranchChange(()=>{this.ui.requestRender()}),await this.updateAvailableProviderCount(),this.ui.renderNow(),jFn().then(()=>{this.isInitialized&&(this.ui.invalidate(),this.ui.requestRender())})}updateTerminalTitle(){let e=uu.basename(this.sessionManager.getCwd()),n=this.sessionManager.getSessionName();n?this.ui.terminal.setTitle(`${Yst} - ${n} - ${e}`):this.ui.terminal.setTitle(`${Yst} - ${e}`)}async run(){if(await this.init(),!process.env.PI_OFFLINE){let u=new AbortController,l=setTimeout(()=>u.abort(),15e3);I9(this.session.modelRuntime,u.signal).then(()=>this.updateAvailableProviderCount()).catch(()=>{}).finally(()=>clearTimeout(l))}Pir(this.version).then(u=>{u&&this.showNewVersionNotification(u)}),this.checkForPackageUpdates().then(u=>{u.length>0&&this.showPackageUpdateNotification(u)}).finally(()=>{process.platform==="win32"&&this.isInitialized&&this.updateTerminalTitle()}),this.checkTmuxKeyboardSetup().then(u=>{u&&this.showWarning(u)});let{migratedProviders:e,startupDiagnostics:n,modelFallbackMessage:r,initialMessage:i,initialImages:s,initialMessages:o}=this.options;for(let u of n??[])u.type==="error"?this.showError(u.message):u.type==="warning"?this.showWarning(u.message):this.showStatus(u.message);e&&e.length>0&&this.showWarning(`Migrated credentials to auth.json: ${e.join(", ")}`);let a=this.session.modelRuntime.getError();a&&this.showError(`models.json error: ${a}`),r&&this.showWarning(r);let c=mir();if(c){let u=new Date(c.timestamp).toLocaleString();this.showWarning(`${hn} crashed on ${u} (${c.message}). Run /bug to report it; the crash details are attached automatically.`)}if(this.maybeWarnAboutAnthropicSubscriptionAuth(),i)try{await this.session.prompt(i,{images:s})}catch(u){let l=u instanceof Error?u.message:"Unknown error occurred";this.showError(l)}if(o)for(let u of o)try{await this.session.prompt(u)}catch(l){let d=l instanceof Error?l.message:"Unknown error occurred";this.showError(d)}for(;;){let u=await this.getUserInput();try{await this.session.prompt(u)}catch(l){let d=l instanceof Error?l.message:"Unknown error occurred";this.showError(d)}}}async checkForPackageUpdates(){if(process.env.PI_OFFLINE)return[];try{return(await new rf({cwd:this.sessionManager.getCwd(),agentDir:ii(),settingsManager:this.settingsManager}).checkForAvailableUpdates()).map(r=>r.displayName)}catch{return[]}}async checkTmuxKeyboardSetup(){if(!process.env.TMUX)return;let e=i=>new Promise(s=>{let o=(0,Eor.spawn)("tmux",["show","-gv",i],{stdio:["ignore","pipe","ignore"]}),a="",c=setTimeout(()=>{o.kill(),s(void 0)},2e3);o.stdout?.on("data",u=>{a+=u.toString()}),o.on("error",()=>{clearTimeout(c),s(void 0)}),o.on("close",u=>{clearTimeout(c),s(u===0?a.trim():void 0)})}),[n,r]=await Promise.all([e("extended-keys"),e("extended-keys-format")]);if(n!==void 0){if(n!=="on"&&n!=="always")return"tmux extended-keys is off. Modified Enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.";if(r==="xterm")return"tmux extended-keys-format is xterm. Pi works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux."}}getChangelogForDisplay(){if(this.session.state.messages.length>0)return;let e=this.settingsManager.getLastChangelogVersion(),n=Pwe(),r=j0t(n);if(!e){this.settingsManager.setLastChangelogVersion(Nl),this.reportInstallTelemetry(Nl);return}let i=yir(r,e);if(i.length>0)return this.settingsManager.setLastChangelogVersion(Nl),this.reportInstallTelemetry(Nl),i.map(s=>q0t(s.content,s)).join(` + +`)}reportInstallTelemetry(e){process.env.PI_OFFLINE||UDe(this.settingsManager)&&fetch(`https://pi.dev/api/report-install?version=${encodeURIComponent(e)}`,{headers:{"User-Agent":hw(e)},signal:AbortSignal.timeout(5e3)}).then(()=>{}).catch(()=>{})}getMarkdownThemeWithSettings(){return{...zh(),codeBlockIndent:this.settingsManager.getCodeBlockIndent()}}formatDisplayPath(e){let n=WPe.homedir(),r=e;return r.startsWith(n)&&(r=`~${r.slice(n.length)}`),r}formatExtensionDisplayPath(e){let n=this.formatDisplayPath(e);return n=n.replace(/\/index\.ts$/,"").replace(/\/index\.js$/,""),n}formatContextPath(e){let n=uu.resolve(this.sessionManager.getCwd()),r=uu.isAbsolute(e)?uu.resolve(e):uu.resolve(n,e),i=QF(r,n);return i!==void 0?i:this.formatDisplayPath(r)}getStartupExpansionState(){return this.options.verbose||this.toolOutputExpanded}getShortPath(e,n){let r=e.replace(/\\/g,"/"),i=n?.baseDir;if(i&&this.isPackageSource(n)){let c=i.replace(/\\/g,"/"),u=c.match(/^(.*\/node_modules)\/(@?[^/]+(?:\/[^/]+)?)$/);if(u?.[1]&&r.startsWith(`${u[1]}/`))return uu.posix.relative(c,r);let l=uu.relative(uu.resolve(i),uu.resolve(e));if(l&&l!=="."&&!l.startsWith("..")&&!l.startsWith(`..${uu.sep}`)&&!uu.isAbsolute(l))return l.replace(/\\/g,"/")}let s=n?.source??"",o=r.match(/node_modules\/(@?[^/]+(?:\/[^/]+)?)\/(.*)/);if(o&&s.startsWith("npm:"))return o[2];let a=r.match(/git\/[^/]+\/[^/]+\/(.*)/);return a&&s.startsWith("git:")?a[1]:this.formatDisplayPath(e)}getCompactPathLabel(e,n){let r=this.getShortPath(e,n),s=r.replace(/\\/g,"/").split("/").filter(o=>o.length>0&&o!=="~");return s.length>0?s[s.length-1]:r}getCompactPackageSourceLabel(e){let n=e?.source??"";if(n.startsWith("npm:"))return n.slice(4)||n;let r=goe(n);return r&&r.path||n}getCompactExtensionLabel(e,n){if(!this.isPackageSource(n))return this.getCompactPathLabel(e,n);let r=this.getCompactPackageSourceLabel(n);if(!r)return this.getCompactPathLabel(e,n);let i=this.getShortPath(e,n).replace(/\\/g,"/"),s=i.startsWith("extensions/")?i.slice(11):i,o=uu.posix.parse(s);return o.name==="index"?!o.dir||o.dir==="."?r:`${r}:${o.dir}`:`${r}:${s}`}getCompactDisplayPathSegments(e){return this.formatDisplayPath(e).replace(/\\/g,"/").split("/").filter(n=>n.length>0&&n!=="~")}getCompactNonPackageExtensionLabel(e,n,r){let i=r[n]?.segments;if(!i||i.length===0)return this.getCompactPathLabel(e);for(let s=1;s<=i.length;s+=1){let o=i.slice(-s).join("/");if(r.every((c,u)=>u===n?!0:c.segments.slice(-s).join("/")!==o))return o}return i.join("/")}getCompactExtensionLabels(e){let n=e.map(r=>{let i=this.getCompactDisplayPathSegments(r.path),s=i[i.length-1];return i.length>1&&(s==="index.ts"||s==="index.js")&&i.pop(),{path:r.path,sourceInfo:r.sourceInfo,segments:i}}).filter(r=>!this.isPackageSource(r.sourceInfo));return e.map(r=>{if(this.isPackageSource(r.sourceInfo))return this.getCompactExtensionLabel(r.path,r.sourceInfo);let i=n.findIndex(s=>s.path===r.path);return i===-1?this.getCompactPathLabel(r.path,r.sourceInfo):this.getCompactNonPackageExtensionLabel(r.path,i,n)})}getDisplaySourceInfo(e){let n=e?.source??"local",r=e?.scope??"project";return n==="local"?r==="user"?{label:"user",color:"muted"}:r==="project"?{label:"project",color:"muted"}:r==="temporary"?{label:"path",scopeLabel:"temp",color:"muted"}:{label:"path",color:"muted"}:n==="cli"?{label:"path",scopeLabel:r==="temporary"?"temp":void 0,color:"muted"}:{label:n,scopeLabel:r==="user"?"user":r==="project"?"project":r==="temporary"?"temp":void 0,color:"accent"}}getScopeGroup(e){let n=e?.source??"local",r=e?.scope??"project";return n==="cli"||r==="temporary"?"path":r==="user"?"user":r==="project"?"project":"path"}isPackageSource(e){let n=e?.source??"";return n.startsWith("npm:")||n.startsWith("git:")}buildScopeGroups(e){let n={user:{scope:"user",paths:[],packages:new Map},project:{scope:"project",paths:[],packages:new Map},path:{scope:"path",paths:[],packages:new Map}};for(let r of e){let i=this.getScopeGroup(r.sourceInfo),s=n[i],o=r.sourceInfo?.source??"local";if(this.isPackageSource(r.sourceInfo)){let a=s.packages.get(o)??[];a.push(r),s.packages.set(o,a)}else s.paths.push(r)}return[n.project,n.user,n.path].filter(r=>r.paths.length>0||r.packages.size>0)}formatScopeGroups(e,n){let r=[];for(let i of e){r.push(` ${Ee.fg("accent",i.scope)}`);let s=[...i.paths].sort((a,c)=>a.path.localeCompare(c.path));for(let a of s)r.push(Ee.fg("dim",` ${n.formatPath(a)}`));let o=Array.from(i.packages.entries()).sort(([a],[c])=>a.localeCompare(c));for(let[a,c]of o){r.push(` ${Ee.fg("mdLink",a)}`);let u=[...c].sort((l,d)=>l.path.localeCompare(d.path));for(let l of u)r.push(Ee.fg("dim",` ${n.formatPackagePath(l,a)}`))}}return r.join(` +`)}findSourceInfoForPath(e,n){let r=n.get(e);if(r)return r;let i=e;for(;i.includes("/");){i=i.substring(0,i.lastIndexOf("/"));let s=n.get(i);if(s)return s}}formatPathWithSource(e,n){if(n){let r=this.getShortPath(e,n),{label:i,scopeLabel:s}=this.getDisplaySourceInfo(n);return`${s?`${i} (${s})`:i} ${r}`}return this.formatDisplayPath(e)}formatDiagnostics(e,n){let r=[],i=new Map,s=[];for(let o of e)if(o.type==="collision"&&o.collision){let a=i.get(o.collision.name)??[];a.push(o),i.set(o.collision.name,a)}else s.push(o);for(let[o,a]of i){let c=a[0]?.collision;if(c){r.push(Ee.fg("warning",` "${o}" collision:`)),r.push(Ee.fg("dim",` ${Ee.fg("success","\u2713")} ${this.formatPathWithSource(c.winnerPath,this.findSourceInfoForPath(c.winnerPath,n))}`));for(let u of a)u.collision&&r.push(Ee.fg("dim",` ${Ee.fg("warning","\u2717")} ${this.formatPathWithSource(u.collision.loserPath,this.findSourceInfoForPath(u.collision.loserPath,n))} (skipped)`))}}for(let o of s)if(o.path){let a=this.formatPathWithSource(o.path,this.findSourceInfoForPath(o.path,n));r.push(Ee.fg(o.type==="error"?"error":"warning",` ${a}`)),r.push(Ee.fg(o.type==="error"?"error":"warning",` ${o.message}`))}else r.push(Ee.fg(o.type==="error"?"error":"warning",` ${o.message}`));return r.join(` +`)}showLoadedResources(e){this.loadedResourcesContainer.clear();let n=e?.force||this.options.verbose||!this.settingsManager.getQuietStartup(),r=n||e?.showDiagnosticsWhenQuiet===!0;if(!n&&!r)return;let i=(m,h="mdHeading")=>Ee.fg(h,`[${m}]`),s=(m,h)=>{let f=m.map(g=>g.trim()).filter(g=>g.length>0);return h?.sort!==!1&&f.sort((g,A)=>g.localeCompare(A)),Ee.fg("dim",` ${f.join(", ")}`)},o=(m,h,f=h,g="mdHeading")=>{let A=new $Pe(()=>`${i(m,g)} +${h}`,()=>`${i(m,g)} +${f}`,this.getStartupExpansionState(),0,0);this.loadedResourcesContainer.addChild(A),this.loadedResourcesContainer.addChild(new Tt(1))},a=this.session.resourceLoader.getSkills(),c=this.session.resourceLoader.getPrompts(),u=this.session.resourceLoader.getThemes(),l=e?.extensions??this.session.resourceLoader.getExtensions().extensions.filter(m=>!m.hidden).map(m=>({path:m.path,sourceInfo:m.sourceInfo})),d=new Map;for(let m of l)m.sourceInfo&&d.set(m.path,m.sourceInfo);for(let m of a.skills)m.sourceInfo&&d.set(m.filePath,m.sourceInfo);for(let m of c.prompts)m.sourceInfo&&d.set(m.filePath,m.sourceInfo);for(let m of u.themes)m.sourcePath&&m.sourceInfo&&d.set(m.sourcePath,m.sourceInfo);if(n){let m=this.session.resourceLoader.getSystemPromptSource(),h=[...m?[m]:[],...this.session.resourceLoader.getAppendSystemPromptSources(),...this.session.resourceLoader.getAgentsFiles().agentsFiles];if(h.length>0){this.loadedResourcesContainer.addChild(new Tt(1));let E=h.map(S=>Ee.fg("dim",` ${this.formatDisplayPath(S.path)}`)).join(` +`),_=s(h.map(S=>this.formatContextPath(S.path)),{sort:!1});o("Context",_,E)}let f=a.skills;if(f.length>0){let E=this.buildScopeGroups(f.map(C=>({path:C.filePath,sourceInfo:C.sourceInfo}))),_=this.formatScopeGroups(E,{formatPath:C=>this.formatDisplayPath(C.path),formatPackagePath:C=>this.getShortPath(C.path,C.sourceInfo)}),S=s(f.map(C=>C.name));o("Skills",S,_)}let g=this.session.promptTemplates;if(g.length>0){let E=this.buildScopeGroups(g.map(I=>({path:I.filePath,sourceInfo:I.sourceInfo}))),_=new Map(g.map(I=>[I.filePath,I])),S=this.formatScopeGroups(E,{formatPath:I=>{let w=_.get(I.path);return w?`/${w.name}`:this.formatDisplayPath(I.path)},formatPackagePath:I=>{let w=_.get(I.path);return w?`/${w.name}`:this.formatDisplayPath(I.path)}}),C=s(g.map(I=>`/${I.name}`));o("Prompts",C,S)}if(l.length>0){let E=this.buildScopeGroups(l),_=this.formatScopeGroups(E,{formatPath:C=>this.formatExtensionDisplayPath(C.path),formatPackagePath:C=>this.formatExtensionDisplayPath(this.getShortPath(C.path,C.sourceInfo))}),S=s(this.getCompactExtensionLabels(l));o("Extensions",S,_,"mdHeading")}let y=u.themes.filter(E=>E.sourcePath);if(y.length>0){let E=this.buildScopeGroups(y.map(C=>({path:C.sourcePath,sourceInfo:C.sourceInfo}))),_=this.formatScopeGroups(E,{formatPath:C=>this.formatDisplayPath(C.path),formatPackagePath:C=>this.getShortPath(C.path,C.sourceInfo)}),S=s(y.map(C=>C.name??this.getCompactPathLabel(C.sourcePath,C.sourceInfo)));o("Themes",S,_)}}if(r){let m=a.diagnostics;if(m.length>0){let _=this.formatDiagnostics(m,d);this.loadedResourcesContainer.addChild(new Et(`${Ee.fg("warning","[Skill conflicts]")} +${_}`,0,0)),this.loadedResourcesContainer.addChild(new Tt(1))}let h=c.diagnostics;if(h.length>0){let _=this.formatDiagnostics(h,d);this.loadedResourcesContainer.addChild(new Et(`${Ee.fg("warning","[Prompt conflicts]")} +${_}`,0,0)),this.loadedResourcesContainer.addChild(new Tt(1))}let f=[],g=this.session.resourceLoader.getExtensions().errors;if(g.length>0)for(let _ of g)f.push({type:"error",message:_.error,path:_.path});let A=this.session.extensionRunner.getCommandDiagnostics();f.push(...A),f.push(...this.getBuiltInCommandConflictDiagnostics(this.session.extensionRunner));let y=this.session.extensionRunner.getShortcutDiagnostics();if(f.push(...y),f.length>0){let _=this.formatDiagnostics(f,d);this.loadedResourcesContainer.addChild(new Et(`${Ee.fg("warning","[Extension issues]")} +${_}`,0,0)),this.loadedResourcesContainer.addChild(new Tt(1))}let E=u.diagnostics;if(E.length>0){let _=this.formatDiagnostics(E,d);this.loadedResourcesContainer.addChild(new Et(`${Ee.fg("warning","[Theme conflicts]")} +${_}`,0,0)),this.loadedResourcesContainer.addChild(new Tt(1))}}}async bindCurrentSessionExtensions(){let e=this.createExtensionUIContext();await this.session.bindExtensions({uiContext:e,mode:"tui",abortHandler:()=>{this.restoreQueuedMessagesToEditor({abort:!0})},commandContextActions:{waitForIdle:()=>this.session.waitForIdle(),newSession:async r=>{this.clearStatusIndicator();try{return await this.runtimeHost.newSession(r)}catch(i){return this.handleFatalRuntimeError("Failed to create session",i)}},fork:async(r,i)=>{try{let s=await this.runtimeHost.fork(r,i);return s.cancelled||(this.editor.setText(s.selectedText??""),this.showStatus("Forked to new session")),{cancelled:s.cancelled}}catch(s){return this.handleFatalRuntimeError("Failed to fork session",s)}},navigateTree:async(r,i)=>{let s=await this.session.navigateTree(r,{summarize:i?.summarize,customInstructions:i?.customInstructions,replaceInstructions:i?.replaceInstructions,label:i?.label});return s.cancelled?{cancelled:!0}:(this.chatContainer.clear(),this.renderInitialMessages(),s.editorText&&!this.editor.getText().trim()&&this.editor.setText(s.editorText),this.showStatus("Navigated to selected point"),this.flushCompactionQueue({willRetry:!1}),{cancelled:!1})},switchSession:async(r,i)=>this.handleResumeSession(r,i),reload:async()=>{await this.handleReloadCommand()}},shutdownHandler:()=>{this.shutdownRequested=!0,this.session.isIdle&&this.shutdown()},onError:r=>{this.showExtensionError(r.extensionPath,r.error,r.stack)}}),Sj(this.session.resourceLoader.getThemes().themes),this.setupAutocompleteProvider();let n=this.session.extensionRunner;this.setupExtensionShortcuts(n),this.showLoadedResources({force:!1,showDiagnosticsWhenQuiet:!0}),this.showStartupNoticesIfNeeded()}applyFullscreenScrollbarSetting(){this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar())}applyRuntimeSettings(){RR(this.settingsManager.getTerminalCapabilityOverrides()),u9(this.settingsManager.getHttpIdleTimeoutMs()),this.applyFullscreenScrollbarSetting(),this.renderer instanceof lS&&this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect()),this.footer.setSession(this.session),this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled),this.footerDataProvider.setCwd(this.sessionManager.getCwd()),this.hideThinkingBlock=this.settingsManager.getHideThinkingBlock(),this.outputPad=this.settingsManager.getOutputPad(),this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());let e=this.settingsManager.getClearOnShrink();this.ui.setClearOnShrink(e),!e&&!this.activeStatusIndicator&&this.statusContainer.clear();let n=this.settingsManager.getEditorPaddingX(),r=this.settingsManager.getAutocompleteMaxVisible();this.defaultEditor.setPaddingX(n),this.defaultEditor.setAutocompleteMaxVisible(r),this.editor!==this.defaultEditor&&(this.editor.setPaddingX?.(n),this.editor.setAutocompleteMaxVisible?.(r))}async rebindCurrentSession(e={}){let n=this.session;this.unsubscribe?.(),this.unsubscribe=void 0,this.applyRuntimeSettings(),e.renderBeforeBind&&(this.renderCurrentSessionState(),this.subscribeToAgent()),await this.bindCurrentSessionExtensions(),this.session===n&&(e.renderBeforeBind||this.subscribeToAgent(),await this.updateAvailableProviderCount(),this.updateEditorBorderColor(),this.updateTerminalTitle())}async handleFatalRuntimeError(e,n){let r=n instanceof Error?n.message:String(n);this.showError(`${e}: ${r}`);let i=this.getCrashExtensionHint(n);i&&this.chatContainer.addChild(new Et(Ee.fg("warning",i),this.outputPad,0)),this.recordCrash("fatal_error",n)&&this.chatContainer.addChild(new Et(Ee.fg("muted",this.crashReportInstructions()),this.outputPad,0)),uS(),this.stop("transcript"),process.exit(1)}getCrashExtensionHint(e){try{return Jys(dir(e instanceof Error?e.stack:void 0,this.session.resourceLoader.getExtensions().extensions))}catch{return}}recordCrash(e,n){try{return pir({kind:e,error:n,sessionFile:this.session.sessionFile,cwd:this.session.sessionManager.getCwd()})!==void 0}catch{return!1}}crashReportInstructions(){return`To report this crash: ${this.session.sessionFile?`run \`${hn} -r\` to resume the session, then`:"start pi and"} run /bug. The crash details are attached automatically.`}suggestBugReport(){this.bugReportHintShown||(this.bugReportHintShown=!0,this.chatContainer.addChild(new Et(Ee.fg("muted",`If this looks like a ${hn} bug, /bug sends a report to the developers.`),this.outputPad,0)),this.ui.requestRender())}maybeSuggestBugReport(e){e.stopReason!=="error"||Jy(e)||/\b(?:abort(?:ed)?|cancel(?:l?ed)?)\b/i.test(e.errorMessage??"")||this.suggestBugReport()}renderCurrentSessionState(){this.loadedResourcesContainer.clear(),this.chatContainer.clear(),this.pendingMessagesContainer.clear(),this.compactionQueuedMessages=[],this.streamingComponent=void 0,this.streamingMessage=void 0,this.pendingTools.clear(),this.renderInitialMessages()}getRegisteredToolDefinition(e){return gir(e,this.session.getToolDefinition(e))}getMarkdownTransformers(){return[this.mermaidMarkdownTransformer,...this.session.extensionRunner.getMarkdownTransformers()]}setupExtensionShortcuts(e){let n=e.getShortcuts(this.keybindings.getEffectiveConfig());if(n.size===0)return;let r=()=>({ui:this.createExtensionUIContext(),mode:"tui",hasUI:!0,cwd:this.sessionManager.getCwd(),sessionManager:this.sessionManager,modelRegistry:e.getModelRegistry(),model:this.session.model,scopedModels:this.session.scopedModels,thinkingLevel:this.session.thinkingLevel,isIdle:()=>this.session.isIdle,isProjectTrusted:()=>this.settingsManager.isProjectTrusted(),signal:this.session.agent.signal,abort:()=>{this.restoreQueuedMessagesToEditor({abort:!0})},hasPendingMessages:()=>this.session.pendingMessageCount>0,shutdown:()=>{this.shutdownRequested=!0},getContextUsage:()=>this.session.getContextUsage(),compact:i=>{(async()=>{try{let s=await this.session.compact(i?.customInstructions);i?.onComplete?.(s)}catch(s){let o=s instanceof Error?s:new Error(String(s));i?.onError?.(o)}})()},getSystemPrompt:()=>this.session.systemPrompt});this.defaultEditor.onExtensionShortcut=i=>{for(let[s,o]of n)if(sm(i,s))return Promise.resolve(o.handler(r())).catch(a=>{this.showError(`Shortcut handler error: ${a instanceof Error?a.message:String(a)}`)}),!0;return!1}}setExtensionStatus(e,n){this.footerDataProvider.setExtensionStatus(e,n),this.ui.requestRender()}setEditorWorkingStatusIndicator(e){return this.defaultEditor.setWorkingStatusIndicator(void 0),por(this.editor)?(this.editor.setWorkingStatusIndicator(e),!0):!1}showStatusIndicator(e){if(this.activeStatusIndicator?.dispose(),this.activeStatusIndicator=e,this.activeWorkingIndicatorEmbedded=!1,this.statusContainer.clear(),this.setEditorWorkingStatusIndicator(void 0),this.setEditorWorkingStatusIndicator(e)){this.activeWorkingIndicatorEmbedded=!0;return}this.statusContainer.addChild(e)}clearStatusIndicator(e){if(e&&this.activeStatusIndicator?.kind!==e)return;let n=this.activeStatusIndicator,r=this.activeWorkingIndicatorEmbedded;n?.dispose(),this.activeStatusIndicator=void 0,this.activeWorkingIndicatorEmbedded=!1,this.statusContainer.clear(),this.setEditorWorkingStatusIndicator(void 0),n&&!r&&this.options.tuiMode==="regular"&&this.ui.getClearOnShrink()&&this.statusContainer.addChild(this.idleStatus)}showWorkingStatusIndicator(){let e=por(this.editor)?n=>(this.editor.borderColor??Ee.getThinkingBorderColor(this.session.thinkingLevel||"off"))(n):void 0;this.showStatusIndicator(new FPe(this.ui,this.workingMessage??this.defaultWorkingMessage,this.workingIndicatorOptions,e))}setWorkingVisible(e){if(this.workingVisible=e,!e){this.clearStatusIndicator("working"),this.ui.requestRender();return}this.session.isStreaming&&this.activeStatusIndicator?.kind!=="working"&&this.showWorkingStatusIndicator(),this.ui.requestRender()}setWorkingIndicator(e){this.workingIndicatorOptions=e,this.activeStatusIndicator?.kind==="working"&&this.activeStatusIndicator.setIndicator(e),this.ui.requestRender()}setHiddenThinkingLabel(e){this.hiddenThinkingLabel=e??this.defaultHiddenThinkingLabel;for(let n of this.chatContainer.children)n instanceof OS&&n.setHiddenThinkingLabel(this.hiddenThinkingLabel);this.streamingComponent&&this.streamingComponent.setHiddenThinkingLabel(this.hiddenThinkingLabel),this.ui.requestRender()}setExtensionWidget(e,n,r){let i=r?.placement??"aboveEditor",s=c=>{let u=c.get(e);u?.dispose&&u.dispose(),c.delete(e)};if(s(this.extensionWidgetsAbove),s(this.extensionWidgetsBelow),n===void 0){this.renderWidgets();return}let o;if(Array.isArray(n)){let c=new gn;for(let u of n.slice(0,t.MAX_WIDGET_LINES))c.addChild(new Et(u,1,0));n.length>t.MAX_WIDGET_LINES&&c.addChild(new Et(Ee.fg("muted","... (widget truncated)"),1,0)),o=c}else o=n(this.ui,Ee);(i==="belowEditor"?this.extensionWidgetsBelow:this.extensionWidgetsAbove).set(e,o),this.renderWidgets()}clearExtensionWidgets(){for(let e of this.extensionWidgetsAbove.values())e.dispose?.();for(let e of this.extensionWidgetsBelow.values())e.dispose?.();this.extensionWidgetsAbove.clear(),this.extensionWidgetsBelow.clear(),this.renderWidgets()}resetExtensionUI(){this.extensionSelector&&this.hideExtensionSelector(),this.extensionInput&&this.hideExtensionInput(),this.extensionEditor&&this.hideExtensionEditor(),this.ui.hideOverlay(),this.clearExtensionTerminalInputListeners(),this.setExtensionFooter(void 0),this.setExtensionHeader(void 0),this.clearExtensionWidgets(),this.footerDataProvider.clearExtensionStatuses(),this.footer.invalidate(),this.autocompleteProviderWrappers=[],this.setCustomEditorComponent(void 0),this.setupAutocompleteProvider(),this.defaultEditor.onExtensionShortcut=void 0,this.updateTerminalTitle(),this.workingMessage=void 0,this.workingVisible=!0,this.setWorkingIndicator(),this.activeStatusIndicator?.kind==="working"&&this.activeStatusIndicator.setMessage(`${this.defaultWorkingMessage} (${Ca("app.interrupt")} to interrupt)`),this.setHiddenThinkingLabel()}static MAX_WIDGET_LINES=10;renderWidgets(){!this.widgetContainerAbove||!this.widgetContainerBelow||(this.renderWidgetContainer(this.widgetContainerAbove,this.extensionWidgetsAbove,!0,!0),this.renderWidgetContainer(this.widgetContainerBelow,this.extensionWidgetsBelow,!1,!1),this.ui.requestRender())}renderWidgetContainer(e,n,r,i){if(e.clear(),n.size===0){r&&e.addChild(new Tt(1));return}i&&e.addChild(new Tt(1));for(let s of n.values())e.addChild(s)}setExtensionFooter(e){this.customFooter?.dispose&&this.customFooter.dispose(),this.footerContainer.clear(),e?(this.customFooter=e(this.ui,Ee,this.footerDataProvider),this.footerContainer.addChild(this.customFooter)):(this.customFooter=void 0,this.footerContainer.addChild(this.footer)),this.ui.requestRender()}setExtensionHeader(e){if(!this.builtInHeader)return;this.customHeader?.dispose&&this.customHeader.dispose();let n=this.customHeader||this.builtInHeader,r=this.headerContainer.children.indexOf(n);e?(this.customHeader=e(this.ui,Ee),dce(this.customHeader)&&this.customHeader.setExpanded(this.toolOutputExpanded),r!==-1?this.headerContainer.children[r]=this.customHeader:this.headerContainer.children.unshift(this.customHeader)):(this.customHeader=void 0,dce(this.builtInHeader)&&this.builtInHeader.setExpanded(this.toolOutputExpanded),r!==-1&&(this.headerContainer.children[r]=this.builtInHeader)),this.ui.requestRender()}addExtensionTerminalInputListener(e){let n={handler:e,unsubscribe:this.ui.addInputListener(e)};return this.extensionTerminalInputSubscriptions.add(n),()=>{n.unsubscribe(),this.extensionTerminalInputSubscriptions.delete(n)}}rebindExtensionTerminalInputListeners(){for(let e of this.extensionTerminalInputSubscriptions)e.unsubscribe(),e.unsubscribe=this.ui.addInputListener(e.handler)}clearExtensionTerminalInputListeners(){for(let e of this.extensionTerminalInputSubscriptions)e.unsubscribe();this.extensionTerminalInputSubscriptions.clear()}createProjectTrustContext(e){let n=this.createExtensionUIContext();return{cwd:e,mode:"tui",hasUI:!0,ui:{select:n.select,confirm:n.confirm,input:n.input,notify:n.notify}}}createExtensionUIContext(){return{select:(e,n,r)=>this.showExtensionSelector(e,n,r),confirm:(e,n,r)=>this.showExtensionConfirm(e,n,r),input:(e,n,r)=>this.showExtensionInput(e,n,r),notify:(e,n)=>this.showExtensionNotify(e,n),onTerminalInput:e=>this.addExtensionTerminalInputListener(e),setStatus:(e,n)=>this.setExtensionStatus(e,n),setWorkingMessage:e=>{this.workingMessage=e,this.activeStatusIndicator?.kind==="working"&&this.activeStatusIndicator.setMessage(e??this.defaultWorkingMessage)},setWorkingVisible:e=>this.setWorkingVisible(e),setWorkingIndicator:e=>this.setWorkingIndicator(e),setHiddenThinkingLabel:e=>this.setHiddenThinkingLabel(e),setWidget:(e,n,r)=>this.setExtensionWidget(e,n,r),setFooter:e=>this.setExtensionFooter(e),setHeader:e=>this.setExtensionHeader(e),setTitle:e=>this.ui.terminal.setTitle(e),custom:(e,n)=>this.showExtensionCustom(e,n),pasteToEditor:e=>this.editor.handleInput(`\x1B[200~${e}\x1B[201~`),setEditorText:e=>this.editor.setText(e),getEditorText:()=>this.editor.getExpandedText?.()??this.editor.getText(),editor:(e,n)=>this.showExtensionEditor(e,n),addAutocompleteProvider:e=>{this.autocompleteProviderWrappers.push(e),this.setupAutocompleteProvider()},setEditorComponent:e=>this.setCustomEditorComponent(e),getEditorComponent:()=>this.editorComponentFactory,get theme(){return Ee},getAllThemes:()=>rct(),getTheme:e=>HTe(e),setTheme:e=>{if(e instanceof sQ)return this.themeController.setThemeInstance(e);let n=this.themeController.setThemeName(e);return n.success&&this.settingsManager.getTheme()!==e&&this.settingsManager.setTheme(e),n},getToolsExpanded:()=>this.toolOutputExpanded,setToolsExpanded:e=>this.setToolsExpanded(e)}}showExtensionSelector(e,n,r){return new Promise(i=>{if(r?.signal?.aborted){i(void 0);return}let s=()=>{this.hideExtensionSelector(),i(void 0)};r?.signal?.addEventListener("abort",s,{once:!0}),this.extensionSelector=new WE(e,n,o=>{r?.signal?.removeEventListener("abort",s),this.hideExtensionSelector(),i(o)},()=>{r?.signal?.removeEventListener("abort",s),this.hideExtensionSelector(),i(void 0)},{tui:this.ui,timeout:r?.timeout,onToggleToolsExpanded:()=>this.toggleToolOutputExpansion()}),this.disposeActiveSelector(),this.editorContainer.clear(),this.editorContainer.addChild(this.extensionSelector),this.ui.setFocus(this.extensionSelector),this.ui.requestRender()})}hideExtensionSelector(){this.extensionSelector?.dispose(),this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.extensionSelector=void 0,this.ui.setFocus(this.editor),this.ui.requestRender()}async showExtensionConfirm(e,n,r){return await this.showExtensionSelector(`${e} +${n}`,["Yes","No"],r)==="Yes"}async promptForMissingSessionCwd(e){return await this.showExtensionConfirm("Session cwd not found",$De(e.issue))?e.issue.fallbackCwd:void 0}showExtensionInput(e,n,r){return new Promise(i=>{if(r?.signal?.aborted){i(void 0);return}let s=()=>{this.hideExtensionInput(),i(void 0)};r?.signal?.addEventListener("abort",s,{once:!0}),this.extensionInput=new _k(e,n,o=>{r?.signal?.removeEventListener("abort",s),this.hideExtensionInput(),i(o)},()=>{r?.signal?.removeEventListener("abort",s),this.hideExtensionInput(),i(void 0)},{tui:this.ui,timeout:r?.timeout}),this.disposeActiveSelector(),this.editorContainer.clear(),this.editorContainer.addChild(this.extensionInput),this.ui.setFocus(this.extensionInput),this.ui.requestRender()})}hideExtensionInput(){this.extensionInput?.dispose(),this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.extensionInput=void 0,this.ui.setFocus(this.editor),this.ui.requestRender()}showExtensionEditor(e,n){return new Promise(r=>{this.extensionEditor=new Sk(this.ui,this.keybindings,e,n,i=>{this.hideExtensionEditor(),r(i)},()=>{this.hideExtensionEditor(),r(void 0)},void 0,this.settingsManager.getExternalEditorCommand()),this.disposeActiveSelector(),this.editorContainer.clear(),this.editorContainer.addChild(this.extensionEditor),this.ui.setFocus(this.extensionEditor),this.ui.requestRender()})}hideExtensionEditor(){this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.extensionEditor=void 0,this.ui.setFocus(this.editor),this.ui.requestRender()}setCustomEditorComponent(e){this.editorComponentFactory=e;let n=this.editor.getText();if(this.disposeActiveSelector(),this.editorContainer.clear(),e){let r=e(this.ui,Kre(),this.keybindings);r.onSubmit=this.defaultEditor.onSubmit,r.onChange=this.defaultEditor.onChange,r.setText(n),r.borderColor!==void 0&&(r.borderColor=this.defaultEditor.borderColor),r.setPaddingX!==void 0&&r.setPaddingX(this.defaultEditor.getPaddingX()),r.setAutocompleteMaxVisible!==void 0&&r.setAutocompleteMaxVisible(this.defaultEditor.getAutocompleteMaxVisible()),r.setAutocompleteProvider&&this.autocompleteProvider&&r.setAutocompleteProvider(this.autocompleteProvider);let i=r;if("actionHandlers"in i&&i.actionHandlers instanceof Map){i.onEscape||(i.onEscape=()=>this.defaultEditor.onEscape?.()),i.onCtrlD||(i.onCtrlD=()=>this.defaultEditor.onCtrlD?.()),i.onPasteImage||(i.onPasteImage=()=>this.defaultEditor.onPasteImage?.()),i.onExtensionShortcut||(i.onExtensionShortcut=s=>this.defaultEditor.onExtensionShortcut?.(s));for(let[s,o]of this.defaultEditor.actionHandlers)i.actionHandlers.set(s,o)}this.editor=r}else this.defaultEditor.setText(n),this.editor=this.defaultEditor;this.editorContainer.addChild(this.editor),this.activeStatusIndicator&&(this.statusContainer.clear(),this.activeWorkingIndicatorEmbedded=this.setEditorWorkingStatusIndicator(this.activeStatusIndicator),this.activeWorkingIndicatorEmbedded||this.statusContainer.addChild(this.activeStatusIndicator)),this.ui.setFocus(this.editor),this.ui.requestRender()}showExtensionNotify(e,n){n==="error"?this.showError(e):n==="warning"?this.showWarning(e):this.showStatus(e)}async showExtensionCustom(e,n){let r=this.editor.getText(),i=n?.overlay??!1,s=()=>{this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.editor.setText(r),this.ui.setFocus(this.editor),this.ui.requestRender()};return new Promise((o,a)=>{let c,u=!1,l=d=>{if(!u){u=!0,i?this.ui.hideOverlay():s(),o(d);try{c?.dispose?.()}catch{}}};Promise.resolve(e(this.ui,Ee,this.keybindings,l)).then(d=>{if(!u)if(c=d,i){let m=()=>{if(n?.overlayOptions)return typeof n.overlayOptions=="function"?n.overlayOptions():n.overlayOptions;let f=c.width;return f?{width:f}:void 0},h=this.ui.showOverlay(c,m());n?.onHandle?.(h)}else this.disposeActiveSelector(),this.editorContainer.clear(),this.editorContainer.addChild(c),this.ui.setFocus(c),this.ui.requestRender()}).catch(d=>{u||(i||s(),a(d))})})}showExtensionError(e,n,r){let i=`Extension "${e}" error: ${n}`,s=new Et(Ee.fg("error",i),1,0);if(this.chatContainer.addChild(s),r){let o=r.split(` +`).slice(1).map(a=>Ee.fg("dim",` ${a.trim()}`)).join(` +`);o&&this.chatContainer.addChild(new Et(o,1,0))}this.ui.requestRender()}setupKeyHandlers(){this.defaultEditor.onEscape=()=>{if(this.session.isStreaming)this.restoreQueuedMessagesToEditor({abort:!0});else if(this.session.isBashRunning)this.session.abortBash();else if(this.isBashMode)this.editor.setText(""),this.isBashMode=!1,this.updateEditorBorderColor();else if(!this.editor.getText().trim()){let e=this.settingsManager.getDoubleEscapeAction();if(e!=="none"){let n=Date.now();n-this.lastEscapeTime<500?(e==="tree"?this.showTreeSelector():this.showUserMessageSelector(),this.lastEscapeTime=0):this.lastEscapeTime=n}}},this.defaultEditor.onAction("app.clear",()=>this.handleCtrlC()),this.defaultEditor.onCtrlD=()=>this.handleCtrlD(),this.defaultEditor.onAction("app.suspend",()=>this.handleCtrlZ()),this.defaultEditor.onAction("app.thinking.cycle",()=>this.cycleThinkingLevel()),this.defaultEditor.onAction("app.model.cycleForward",()=>this.cycleModel("forward")),this.defaultEditor.onAction("app.model.cycleBackward",()=>this.cycleModel("backward")),this.ui.onDebug=()=>this.handleDebugCommand(),this.defaultEditor.onAction("app.model.select",()=>this.showModelSelector()),this.defaultEditor.onAction("app.tools.expand",()=>this.toggleToolOutputExpansion()),this.defaultEditor.onAction("app.thinking.toggle",()=>this.toggleThinkingBlockVisibility()),this.defaultEditor.onAction("app.editor.external",()=>{this.handleOpenExternalEditor()}),this.defaultEditor.onAction("app.message.copy",()=>{this.handleCopyCommand({flashConfirmation:!0,preferSelection:!0})}),this.defaultEditor.onAction("app.message.followUp",()=>this.handleFollowUp()),this.defaultEditor.onAction("app.message.dequeue",()=>this.handleDequeue()),this.defaultEditor.onAction("app.session.new",()=>this.handleClearCommand()),this.defaultEditor.onAction("app.session.tree",()=>this.showTreeSelector()),this.defaultEditor.onAction("app.session.fork",()=>this.showUserMessageSelector()),this.defaultEditor.onAction("app.session.resume",()=>this.showSessionSelector()),this.defaultEditor.onChange=e=>{let n=this.isBashMode;this.isBashMode=e.trimStart().startsWith("!"),n!==this.isBashMode&&this.updateEditorBorderColor()},this.defaultEditor.onPasteImage=()=>{this.handleClipboardPaste()}}async handleRightClickPaste(){let e=this.renderer.getFocusedComponent(),n=e?.handleInput;if(!(!e||!n))try{let r=await z0t();if(!r||this.renderer.getFocusedComponent()!==e)return;n.call(e,`\x1B[200~${r}\x1B[201~`),this.ui.requestRender()}catch{}}async handleClipboardPaste(){try{let e=await Bir();if(e){let r=WPe.tmpdir(),i=Rir(e.mimeType)??"png",s=`pi-clipboard-${yor.randomUUID()}.${i}`,o=uu.join(r,s);gG.writeFileSync(o,Buffer.from(e.bytes)),this.editor.insertTextAtCursor?.(o),this.ui.requestRender();return}let n=await z0t();n&&(this.editor.insertTextAtCursor?.(n),this.ui.requestRender())}catch{}}handleStartupSubmit(e){this.editor.setText(e),this.showStatus("Startup is still in progress")}setupEditorSubmitHandler(){this.defaultEditor.onSubmit=async e=>{if(e=e.trim(),!!e){if(e==="/settings"){this.showSettingsSelector(),this.editor.setText("");return}if(e==="/scoped-models"){this.editor.setText(""),await this.showModelsSelector();return}if(e==="/model"||e.startsWith("/model ")){let n=e.startsWith("/model ")?e.slice(7).trim():void 0;this.editor.setText(""),await this.handleModelCommand(n);return}if(e==="/thinking"||e.startsWith("/thinking ")){let n=e.startsWith("/thinking ")?e.slice(10).trim():void 0;this.editor.setText(""),this.handleThinkingCommand(n);return}if(e==="/export"||e.startsWith("/export ")){await this.handleExportCommand(e),this.editor.setText("");return}if(e==="/import"||e.startsWith("/import ")){await this.handleImportCommand(e),this.editor.setText("");return}if(e==="/share"){await this.handleShareCommand(),this.editor.setText("");return}if(e==="/bug"||e.startsWith("/bug ")){let n=e.slice(4).trim();this.editor.setText(""),await this.handleBugCommand(n||void 0);return}if(e==="/copy"){await this.handleCopyCommand(),this.editor.setText("");return}if(e==="/name"||e.startsWith("/name ")){this.handleNameCommand(e),this.editor.setText("");return}if(e==="/session"){this.handleSessionCommand(),this.editor.setText("");return}if(e==="/changelog"){this.handleChangelogCommand(),this.editor.setText("");return}if(e==="/hotkeys"){this.handleHotkeysCommand(),this.editor.setText("");return}if(e==="/fork"){this.showUserMessageSelector(),this.editor.setText("");return}if(e==="/clone"){this.editor.setText(""),await this.handleCloneCommand();return}if(e==="/tree"){this.showTreeSelector(),this.editor.setText("");return}if(e==="/trust"){this.showTrustSelector(),this.editor.setText("");return}if(e==="/login"||e.startsWith("/login ")){let n=e.startsWith("/login ")?e.slice(7).trim():void 0;this.editor.setText(""),await this.handleLoginCommand(n);return}if(e==="/logout"){this.showOAuthSelector("logout"),this.editor.setText("");return}if(e==="/new"){this.editor.setText(""),await this.handleClearCommand();return}if(e==="/compact"||e.startsWith("/compact ")){let n=e.startsWith("/compact ")?e.slice(9).trim():void 0;this.editor.setText(""),await this.handleCompactCommand(n);return}if(e==="/reload"){this.editor.setText(""),await this.handleReloadCommand();return}if(e==="/debug"){this.handleDebugCommand(),this.editor.setText("");return}if(e==="/arminsayshi"){this.handleArminSaysHi(),this.editor.setText("");return}if(e==="/dementedelves"){this.handleDementedDelves(),this.editor.setText("");return}if(e==="/resume"){this.showSessionSelector(),this.editor.setText("");return}if(e==="/quit"){this.editor.setText(""),await this.shutdown();return}if(e.startsWith("!")){let n=e.startsWith("!!"),r=n?e.slice(2).trim():e.slice(1).trim();if(r){if(this.session.isBashRunning){this.showWarning("A bash command is already running. Press Esc to cancel it first."),this.editor.setText(e);return}this.editor.addToHistory?.(e),await this.handleBashCommand(r,n),this.isBashMode=!1,this.updateEditorBorderColor();return}}if(this.session.isCompacting){this.isExtensionCommand(e)?(this.editor.addToHistory?.(e),this.editor.setText(""),await this.session.prompt(e)):this.queueCompactionMessage(e,"steer");return}if(this.session.isStreaming){this.editor.addToHistory?.(e),this.editor.setText(""),await this.session.prompt(e,{streamingBehavior:"steer"}),this.updatePendingMessagesDisplay(),this.ui.requestRender();return}this.flushPendingBashComponents(),this.onInputCallback?this.onInputCallback(e):this.pendingUserInputs.push(e),this.editor.addToHistory?.(e)}}}subscribeToAgent(){this.unsubscribe=this.session.subscribe(async e=>{await this.handleEvent(e)})}async handleEvent(e){switch(this.isInitialized||await this.init(),this.footer.invalidate(),e.type){case"agent_start":this.pendingTools.clear(),this.retryEscapeHandler&&(this.defaultEditor.onEscape=this.retryEscapeHandler,this.retryEscapeHandler=void 0);break;case"turn_start":this.settingsManager.getShowTerminalProgress()&&this.ui.terminal.setProgress(!0),this.workingVisible?this.activeStatusIndicator?.kind!=="working"&&this.showWorkingStatusIndicator():this.clearStatusIndicator(),this.ui.requestRender();break;case"queue_update":this.updatePendingMessagesDisplay(),this.ui.requestRender();break;case"entry_appended":if(this.entriesRenderedByBoundaryCompaction.delete(e.entry.id))break;if(e.entry.type==="custom")this.addCustomEntryToChat(e.entry),this.ui.requestRender();else if(e.entry.type==="usage"&&e.entry.kind==="cache_warm")this.addCacheWarmingUsage(e.entry),this.ui.requestRender();else if(e.entry.type==="custom_message"&&e.entry.display)this.addMessageToChat(zj(e.entry.customType,e.entry.content,e.entry.display,e.entry.details,e.entry.timestamp)),this.ui.requestRender();else if(e.entry.type==="compaction"){let n=this.sessionManager.buildContextEntries();if(n[0]?.id!==e.entry.id)break;this.chatContainer.clear();let r=this.sessionManager.getBranch(),i=r.findIndex(a=>a.id===e.entry.id),s=new Set(r.slice(i+1).map(a=>a.id)),o=n.slice(1);this.renderSessionEntries(o.filter(a=>!s.has(a.id))),this.addMessageToChat(gQ(e.entry.summary,e.entry.tokensBefore,e.entry.timestamp)),e.entry.usage&&this.addCompactionCostNotice({type:"compaction_cost",kind:"compaction",usage:e.entry.usage}),this.renderSessionEntries(o.filter(a=>s.has(a.id)));for(let a of s)this.entriesRenderedByBoundaryCompaction.add(a);this.footer.invalidate(),this.ui.requestRender()}break;case"session_info_changed":this.updateTerminalTitle(),this.footer.invalidate(),this.ui.requestRender();break;case"thinking_level_changed":this.footer.invalidate(),this.updateEditorBorderColor();break;case"message_start":e.message.role==="custom"?(this.addMessageToChat(e.message),this.ui.requestRender()):e.message.role==="user"?(this.addMessageToChat(e.message),this.updatePendingMessagesDisplay(),this.ui.requestRender()):e.message.role==="assistant"&&(this.streamingComponent=new OS(void 0,this.hideThinkingBlock,this.getMarkdownThemeWithSettings(),this.hiddenThinkingLabel,this.outputPad,this.getMarkdownTransformers()),this.streamingMessage=e.message,this.chatContainer.addChild(this.streamingComponent),this.streamingComponent.updateContent(this.streamingMessage,!0),this.ui.requestRender());break;case"message_update":if(this.streamingComponent&&e.message.role==="assistant"){this.streamingMessage=e.message,this.streamingComponent.updateContent(this.streamingMessage,!0);for(let n of this.streamingMessage.content)if(n.type==="toolCall")if(this.pendingTools.has(n.id)){let r=this.pendingTools.get(n.id);r&&r.updateArgs(n.arguments)}else{let r=new QS(n.name,n.id,n.arguments,{showImages:this.settingsManager.getShowImages(),imageWidthCells:this.settingsManager.getImageWidthCells()},this.getRegisteredToolDefinition(n.name),this.ui,this.sessionManager.getCwd());r.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(r),this.pendingTools.set(n.id,r)}this.ui.requestRender()}break;case"message_end":if(e.message.role==="user")break;if(this.streamingComponent&&e.message.role==="assistant"){this.streamingMessage=e.message;let n;if(this.streamingMessage.stopReason==="aborted"){let r=this.session.retryAttempt;n=r>0?`Aborted after ${r} retry attempt${r>1?"s":""}`:"Operation aborted",this.streamingMessage.errorMessage=n}if(this.streamingComponent.updateContent(this.streamingMessage,!1),this.streamingMessage.stopReason==="aborted"||this.streamingMessage.stopReason==="error"){n||(n=this.streamingMessage.errorMessage||"Error");for(let[,r]of this.pendingTools.entries())r.updateResult({content:[{type:"text",text:n}],isError:!0});this.pendingTools.clear(),this.maybeSuggestBugReport(this.streamingMessage)}else{for(let[,r]of this.pendingTools.entries())r.setArgsComplete();this.maybeShowThinkingDropNotice(this.streamingMessage),this.maybeShowCacheMissNotice(this.streamingMessage)}this.streamingComponent=void 0,this.streamingMessage=void 0,this.footer.invalidate()}this.ui.requestRender();break;case"bash_execution_update":break;case"tool_execution_start":{let n=this.pendingTools.get(e.toolCallId);n||(n=new QS(e.toolName,e.toolCallId,e.args,{showImages:this.settingsManager.getShowImages(),imageWidthCells:this.settingsManager.getImageWidthCells()},this.getRegisteredToolDefinition(e.toolName),this.ui,this.sessionManager.getCwd()),n.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(n),this.pendingTools.set(e.toolCallId,n)),n.markExecutionStarted(),this.ui.requestRender();break}case"tool_execution_update":{let n=this.pendingTools.get(e.toolCallId);n&&(n.updateResult({...e.partialResult,isError:!1},!0),this.ui.requestRender());break}case"tool_execution_end":{let n=this.pendingTools.get(e.toolCallId);n&&(n.updateResult({...e.result,isError:e.isError}),this.pendingTools.delete(e.toolCallId),this.ui.requestRender());break}case"agent_end":this.settingsManager.getShowTerminalProgress()&&this.ui.terminal.setProgress(!1),this.clearStatusIndicator("working"),this.streamingComponent&&(this.chatContainer.removeChild(this.streamingComponent),this.streamingComponent=void 0,this.streamingMessage=void 0),this.pendingTools.clear(),this.ui.requestRender();break;case"agent_settled":await this.checkShutdownRequested();break;case"compaction_start":{this.settingsManager.getShowTerminalProgress()&&this.ui.terminal.setProgress(!0),this.autoCompactionEscapeHandler=this.defaultEditor.onEscape,this.defaultEditor.onEscape=()=>{this.session.abortCompaction()},this.showStatusIndicator(new cce(this.ui,e.reason)),this.ui.requestRender();break}case"compaction_end":{if(this.settingsManager.getShowTerminalProgress()&&this.ui.terminal.setProgress(!1),this.autoCompactionEscapeHandler&&(this.defaultEditor.onEscape=this.autoCompactionEscapeHandler,this.autoCompactionEscapeHandler=void 0),this.clearStatusIndicator("compaction"),e.aborted)e.reason==="manual"?this.showError("Compaction cancelled"):this.showStatus("Auto-compaction cancelled");else if(e.result){let n=this.sessionManager.buildContextEntries();if(n[0]?.type!=="compaction")throw new Error("Completed compaction is missing from the session context");this.chatContainer.clear(),this.renderSessionEntries(n.slice(1)),this.addMessageToChat(gQ(e.result.summary,e.result.tokensBefore,new Date().toISOString())),e.result.usage&&this.addCompactionCostNotice({type:"compaction_cost",kind:"compaction",usage:e.result.usage}),this.footer.invalidate()}else e.errorMessage&&(e.reason==="manual"?this.showError(e.errorMessage):(this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(Ee.fg("error",e.errorMessage),1,0))));this.flushCompactionQueue({willRetry:e.willRetry}),this.ui.requestRender();break}case"auto_retry_start":{this.retryEscapeHandler=this.defaultEditor.onEscape,this.defaultEditor.onEscape=()=>{this.session.abortRetry()},this.showStatusIndicator(new ace(this.ui,e.attempt,e.maxAttempts,e.delayMs)),this.ui.requestRender();break}case"auto_retry_end":{this.retryEscapeHandler&&(this.defaultEditor.onEscape=this.retryEscapeHandler,this.retryEscapeHandler=void 0),this.clearStatusIndicator("retry"),e.success||this.showError(`Retry failed after ${e.attempt} attempts: ${e.finalError||"Unknown error"}`),this.ui.requestRender();break}case"summarization_retry_scheduled":{this.showError(e.errorMessage),this.showStatusIndicator(new ace(this.ui,e.attempt,e.maxAttempts,e.delayMs)),this.ui.requestRender();break}case"summarization_retry_attempt_start":{this.clearStatusIndicator("retry"),e.source==="branchSummary"?this.showStatusIndicator(new lce(this.ui)):this.showStatusIndicator(new cce(this.ui,e.reason)),this.ui.requestRender();break}case"summarization_retry_finished":{this.clearStatusIndicator("retry"),this.ui.requestRender();break}}}getUserMessageText(e){return e.role!=="user"?"":(typeof e.content=="string"?[{type:"text",text:e.content}]:e.content.filter(r=>r.type==="text")).map(r=>r.text).join("")}showManagedToolStatus(e){this.managedToolStatusStarted||(this.chatContainer.addChild(new Tt(1)),this.managedToolStatusStarted=!0);let n=e.type==="warning"?`Warning: ${e.message}`:e.message,r=e.type==="warning"?"warning":"dim";this.chatContainer.addChild(new Et(Ee.fg(r,n),1,0)),this.lastStatusSpacer=void 0,this.lastStatusText=void 0,this.ui.requestRender()}showStatus(e){let n=this.chatContainer.children,r=n.length>0?n[n.length-1]:void 0,i=n.length>1?n[n.length-2]:void 0;if(r&&i&&r===this.lastStatusText&&i===this.lastStatusSpacer){this.lastStatusText.setText(Ee.fg("dim",e)),this.ui.requestRender();return}let s=new Tt(1),o=new Et(Ee.fg("dim",e),1,0);this.chatContainer.addChild(s),this.chatContainer.addChild(o),this.lastStatusSpacer=s,this.lastStatusText=o,this.ui.requestRender()}addCustomEntryToChat(e){let n=this.session.extensionRunner.getEntryRenderer(e.customType);if(!n)return;let r=new wPe(e,n);if(r.setExpanded(this.toolOutputExpanded),!!r.hasContent()){if(this.streamingComponent){let i=this.chatContainer.children.indexOf(this.streamingComponent);if(i>=0){this.chatContainer.children.splice(i,0,r);return}}this.chatContainer.addChild(r)}}addMessageToChat(e,n){switch(e.role){case"bashExecution":{let r=new Ck(e.command,this.ui,e.excludeFromContext);e.output&&r.appendOutput(e.output),r.setComplete(e.exitCode,e.cancelled,e.truncated?{truncated:!0}:void 0,e.fullOutputPath),this.chatContainer.addChild(r);break}case"custom":{if(e.display){let r=this.session.extensionRunner.getMessageRenderer(e.customType),i=new tM(e,r,this.getMarkdownThemeWithSettings(),this.outputPad);i.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(i)}break}case"compactionSummary":{this.chatContainer.addChild(new Tt(1));let r=new tG(e,this.getMarkdownThemeWithSettings());r.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(r);break}case"branchSummary":{this.chatContainer.addChild(new Tt(1));let r=new eG(e,this.getMarkdownThemeWithSettings());r.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(r);break}case"system":break;case"user":{let r=this.getUserMessageText(e);if(r){this.chatContainer.children.length>0&&this.chatContainer.addChild(new Tt(1));let i=G1e(r);if(i){let s=new pG(i,this.getMarkdownThemeWithSettings());if(s.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(s),i.userMessage){this.chatContainer.addChild(new Tt(1));let o=new Bk(i.userMessage,this.getMarkdownThemeWithSettings(),this.outputPad,this.getMarkdownTransformers());this.chatContainer.addChild(o)}}else{let s=new Bk(r,this.getMarkdownThemeWithSettings(),this.outputPad,this.getMarkdownTransformers());this.chatContainer.addChild(s)}n?.populateHistory&&this.editor.addToHistory?.(r)}break}case"assistant":{let r=new OS(e,this.hideThinkingBlock,this.getMarkdownThemeWithSettings(),this.hiddenThinkingLabel,this.outputPad,this.getMarkdownTransformers());this.chatContainer.addChild(r);break}case"toolResult":break;default:{let r=e}}}renderSessionItems(e,n={}){this.pendingTools.clear();let r=new Map,i=this.settingsManager.getShowCacheMissNotices()?oir(this.sessionManager.getEntries(),this.session.modelRuntime):new Map;n.updateFooter&&(this.footer.invalidate(),this.updateEditorBorderColor());for(let s of e){if(jys(s)){this.addCustomEntryToChat(s);continue}if(Yys(s)){this.addCacheWarmingUsage(s);continue}if(Vys(s)){this.addCompactionCostNotice(s);continue}let o=s;if(o.role==="assistant"){this.addMessageToChat(o);for(let a of o.content)if(a.type==="toolCall"){let c=new QS(a.name,a.id,a.arguments,{showImages:this.settingsManager.getShowImages(),imageWidthCells:this.settingsManager.getImageWidthCells()},this.getRegisteredToolDefinition(a.name),this.ui,this.sessionManager.getCwd());if(c.setExpanded(this.toolOutputExpanded),this.chatContainer.addChild(c),o.stopReason==="aborted"||o.stopReason==="error"){let u;if(o.stopReason==="aborted"){let l=this.session.retryAttempt;u=l>0?`Aborted after ${l} retry attempt${l>1?"s":""}`:"Operation aborted"}else u=o.errorMessage||"Error";c.updateResult({content:[{type:"text",text:u}],isError:!0})}else r.set(a.id,c)}if(o.stopReason!=="aborted"&&o.stopReason!=="error"){let a=i.get(o);a&&this.addCacheMissNotice(a)}}else if(o.role==="toolResult"){let a=r.get(o.toolCallId);a&&(a.updateResult(o),r.delete(o.toolCallId))}else this.addMessageToChat(o,n)}for(let[s,o]of r)this.pendingTools.set(s,o);this.ui.requestRender()}renderSessionEntries(e,n={}){let r=e.flatMap(i=>{if(i.type==="custom"||i.type==="usage"&&i.kind==="cache_warm")return[i];let s=hS(i);return(i.type==="compaction"||i.type==="branch_summary")&&i.usage&&s.length>0?[...s,{type:"compaction_cost",kind:i.type,usage:i.usage}]:s});this.renderSessionItems(r,n)}addCacheWarmingUsage(e){this.settingsManager.getShowCacheMissNotices()&&(this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(Ee.fg("dim",Gnr(e)),1,0)))}addCompactionCostNotice(e){if(!this.settingsManager.getShowCacheMissNotices())return;let{usage:n}=e,r=n.input+n.output+n.cacheRead+n.cacheWrite,i=n.cost.total>=.01?` (~$${n.cost.total.toFixed(2)})`:"",s=e.kind==="compaction"?"Compaction":"Branch summary";this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(Ee.fg("warning",`${s}: ${Xw(r)} tokens billed${i}`),1,0))}static countDroppedThinkingBlocks(e){let n=0;for(let r of e.diagnostics??[]){if(r.type!=="anthropic_input_transformations")continue;let i=r.details?.transformations;Array.isArray(i)&&(n+=i.filter(s=>typeof s=="object"&&s!==null&&s.type==="thinking_dropped").length)}return n}maybeShowThinkingDropNotice(e){if(!this.settingsManager.getShowCacheMissNotices())return;let n=t.countDroppedThinkingBlocks(e);if(n===0)return;let r=0,i=this.sessionManager.getBranch();for(let o=i.length-1;o>=0;o--){let a=i[o];if(a.type==="message"&&a.message.role==="assistant"){r=t.countDroppedThinkingBlocks(a.message);break}}if(n<=r)return;let s=n===1?"thinking block":"thinking blocks";this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(Ee.fg("warning",`Anthropic dropped ${n} ${s} (details in session)`),1,0))}maybeShowCacheMissNotice(e){if(!this.settingsManager.getShowCacheMissNotices())return;let n=air(this.sessionManager.getEntries(),e,this.session.modelRuntime);n&&this.addCacheMissNotice(n)}addCacheMissNotice(e){if(e.missedTokens<2e4&&e.missedCost<.1)return;let n=e.missedCost>=.01?` (~$${e.missedCost.toFixed(2)})`:"",r=`${Xw(e.missedTokens)} tokens re-billed${n}`,i="Cache miss";e.modelChanged?i="Cache miss after model switch":e.idleMs>=3e5&&(i=`Cache miss after ${Math.round(e.idleMs/6e4)}m idle`);let s=Ee.fg("warning",`${i}: ${r}`);this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(s,1,0))}renderInitialMessages(){let e=this.sessionManager.buildContextEntries();this.renderSessionEntries(e,{updateFooter:!0,populateHistory:!0}),this.renderProjectTrustWarningIfNeeded();let r=this.sessionManager.getEntries().filter(i=>i.type==="compaction").length;if(r>0){let i=r===1?"1 time":`${r} times`;this.showStatus(`Session compacted ${i}`)}}renderProjectTrustWarningIfNeeded(){this.settingsManager.isProjectTrusted()||!t_(this.sessionManager.getCwd())||(this.chatContainer.children.length>0&&this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(Ee.fg("warning",`This project is not trusted. Project ${Bi} resources and packages are ignored. Use /trust to save a trust decision, then restart pi.`),1,0)))}async getUserInput(){let e=this.pendingUserInputs.shift();return e!==void 0?e:new Promise(n=>{this.onInputCallback=r=>{this.onInputCallback=void 0,n(r)}})}rebuildChatFromMessages(){this.chatContainer.clear(),this.renderSessionEntries(this.sessionManager.buildContextEntries())}handleCtrlC(){let e=Date.now();e-this.lastSigintTime<500?this.shutdown():(this.clearEditor(),this.lastSigintTime=e)}handleCtrlD(){this.shutdown()}isShuttingDown=!1;async shutdown(e){if(this.isShuttingDown)return;this.isShuttingDown=!0,e?.fromSignal&&(await this.runtimeHost.dispose(),this.themeController.disableAutoSync(),await this.ui.terminal.drainInput(1e3),this.stop(),process.exit(0)),this.themeController.disableAutoSync(),await this.ui.terminal.drainInput(1e3),this.stop(),await this.runtimeHost.dispose();let n=eEs(this.sessionManager);n&&process.stdout.write(`${tn.dim("To resume this session:")} ${n} +`),process.exit(0)}emergencyTerminalExit(){this.isShuttingDown=!0,this.unregisterSignalHandlers(),WD(),process.exit(129)}uncaughtCrash(e){this.isShuttingDown&&process.exit(1),this.isShuttingDown=!0;try{this.unregisterSignalHandlers()}catch{}try{WD()}catch{}try{this.ui.stop()}catch{}console.error(`${hn} exiting due to uncaughtException:`),console.error(e);let n=this.getCrashExtensionHint(e);n&&console.error(` +${n}`),this.recordCrash("uncaught_exception",e)&&console.error(` +${this.crashReportInstructions()}`),process.exit(1)}async checkShutdownRequested(){this.shutdownRequested&&await this.shutdown()}registerSignalHandlers(){this.unregisterSignalHandlers();let e=["SIGTERM"];process.platform!=="win32"&&e.push("SIGHUP");for(let i of e){let s=()=>{WD(),this.shutdown({fromSignal:!0})};process.prependListener(i,s),this.signalCleanupHandlers.push(()=>process.off(i,s))}let n=i=>{throw Kys(i)&&this.emergencyTerminalExit(),i};process.stdout.on("error",n),process.stderr.on("error",n),this.signalCleanupHandlers.push(()=>process.stdout.off("error",n)),this.signalCleanupHandlers.push(()=>process.stderr.off("error",n));let r=i=>this.uncaughtCrash(i);process.prependListener("uncaughtException",r),this.signalCleanupHandlers.push(()=>process.off("uncaughtException",r))}unregisterSignalHandlers(){for(let e of this.signalCleanupHandlers)e();this.signalCleanupHandlers=[]}handleCtrlZ(){if(process.platform==="win32"){this.showStatus("Suspend to background is not supported on Windows");return}let e=setInterval(()=>{},2**30),n=()=>{};process.on("SIGINT",n),process.once("SIGCONT",()=>{clearInterval(e),process.removeListener("SIGINT",n),this.ui.start(),this.ui.requestRender(!0)});try{this.ui.stop(),process.kill(0,"SIGTSTP")}catch(r){throw clearInterval(e),process.removeListener("SIGINT",n),r}}async handleFollowUp(){let e=(this.editor.getExpandedText?.()??this.editor.getText()).trim();if(e){if(this.session.isCompacting){this.isExtensionCommand(e)?(this.editor.addToHistory?.(e),this.editor.setText(""),await this.session.prompt(e)):this.queueCompactionMessage(e,"followUp");return}this.session.isStreaming?(this.editor.addToHistory?.(e),this.editor.setText(""),await this.session.prompt(e,{streamingBehavior:"followUp"}),this.updatePendingMessagesDisplay(),this.ui.requestRender()):this.editor.onSubmit&&(this.editor.setText(""),this.editor.onSubmit(e))}}handleDequeue(){let e=this.restoreQueuedMessagesToEditor();e===0?this.showStatus("No queued messages to restore"):this.showStatus(`Restored ${e} queued message${e>1?"s":""} to editor`)}updateEditorBorderColor(){if(this.isBashMode)this.editor.borderColor=Ee.getBashModeBorderColor();else{let e=this.session.thinkingLevel||"off";this.editor.borderColor=Ee.getThinkingBorderColor(e)}this.activeStatusIndicator?.invalidate(),this.ui.requestRender()}cycleThinkingLevel(){let e=this.session.cycleThinkingLevel();e===void 0?this.showStatus("Current model does not support thinking"):(this.footer.invalidate(),this.updateEditorBorderColor(),this.showStatus(`Thinking level: ${e}`))}async cycleModel(e){try{let n=await this.session.cycleModel(e);if(n===void 0){let r=this.session.scopedModels.length>0?"Only one model in scope":"Only one model available";this.showStatus(r)}else{this.footer.invalidate(),this.updateEditorBorderColor();let r=n.model.reasoning&&n.thinkingLevel!=="off"?` (thinking: ${n.thinkingLevel})`:"";this.showStatus(`Switched to ${n.model.name||n.model.id}${r}`),this.maybeWarnAboutAnthropicSubscriptionAuth(n.model)}}catch(n){this.showError(n instanceof Error?n.message:String(n))}}toggleToolOutputExpansion(){this.setToolsExpanded(!this.toolOutputExpanded)}setToolsExpanded(e){if(e===this.toolOutputExpanded)return;this.toolOutputExpanded=e;let n=this.customHeader??this.builtInHeader;dce(n)&&n.setExpanded(e);for(let r of[this.loadedResourcesContainer,this.chatContainer])for(let i of r.children)dce(i)&&i.setExpanded(e);this.showStatus(`Tool output: ${e?"expanded":"collapsed"}`)}updateThinkingBlockVisibility(){for(let e of this.chatContainer.children)e instanceof OS&&e.setHideThinkingBlock(this.hideThinkingBlock);this.ui.requestRender()}toggleThinkingBlockVisibility(){this.hideThinkingBlock=!this.hideThinkingBlock,this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock),this.updateThinkingBlockVisibility(),this.showStatus(`Thinking blocks: ${this.hideThinkingBlock?"hidden":"visible"}`)}async handleOpenExternalEditor(){let e=this.settingsManager.getExternalEditorCommand(),n=this.editor.getExpandedText?.()??this.editor.getText();this.ui.stop();try{let r=await bPe({command:e,content:n});r.status==="complete"&&this.editor.setText(r.content)}finally{this.ui.start(),this.ui.requestRender(!0)}}clearEditor(){this.editor.setText(""),this.ui.requestRender()}showError(e){this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(Ee.fg("error",`Error: ${e}`),this.outputPad,0)),this.ui.requestRender()}showWarning(e){this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(Ee.fg("warning",`Warning: ${e}`),1,0)),this.ui.requestRender()}showNewVersionNotification(e){let n=Ee.fg("accent",`${hn} update`),r=Ee.fg("muted",`New version ${e.version} is available. Run `)+n,i="https://pi.dev/changelog",s=Dl().hyperlinks?gE(Ee.fg("accent",i),i):Ee.fg("accent",i),o=Ee.fg("muted","Changelog: ")+s,a=e.note?.trim();this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Un(c=>Ee.fg("warning",c))),this.chatContainer.addChild(new Et(`${Ee.bold(Ee.fg("warning","Update Available"))} +${r}`,1,0)),a&&(this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Pl(a,1,0,this.getMarkdownThemeWithSettings(),{color:c=>Ee.fg("muted",c)})),this.chatContainer.addChild(new Tt(1))),this.chatContainer.addChild(new Et(o,1,0)),this.chatContainer.addChild(new Un(c=>Ee.fg("warning",c))),this.ui.requestRender()}showPackageUpdateNotification(e){let n=Ee.fg("accent",`${hn} update --extensions`),r=Ee.fg("muted","Package updates are available. Run ")+n,i=e.map(s=>`- ${s}`).join(` +`);this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Un(s=>Ee.fg("warning",s))),this.chatContainer.addChild(new Et(`${Ee.bold(Ee.fg("warning","Package Updates Available"))} ${r} -${Se.fg("muted","Packages:")} -${s}`,1,0)),this.chatContainer.addChild(new Ln(i=>Se.fg("warning",i))),this.ui.requestRender()}getAllQueuedMessages(){return{steering:[...this.session.getSteeringMessages(),...this.compactionQueuedMessages.filter(e=>e.mode==="steer").map(e=>e.text)],followUp:[...this.session.getFollowUpMessages(),...this.compactionQueuedMessages.filter(e=>e.mode==="followUp").map(e=>e.text)]}}clearAllQueues(){let{steering:e,followUp:n}=this.session.clearQueue(),r=this.compactionQueuedMessages.filter(i=>i.mode==="steer").map(i=>i.text),s=this.compactionQueuedMessages.filter(i=>i.mode==="followUp").map(i=>i.text);return this.compactionQueuedMessages=[],{steering:[...e,...r],followUp:[...n,...s]}}updatePendingMessagesDisplay(){this.pendingMessagesContainer.clear();let{steering:e,followUp:n}=this.getAllQueuedMessages();if(e.length>0||n.length>0){this.pendingMessagesContainer.addChild(new Nt(1));for(let i of e){let o=Se.fg("dim",`Steering: ${i}`);this.pendingMessagesContainer.addChild(new zA(o,1,0))}for(let i of n){let o=Se.fg("dim",`Follow-up: ${i}`);this.pendingMessagesContainer.addChild(new zA(o,1,0))}let r=this.getAppKeyDisplay("app.message.dequeue"),s=Se.fg("dim",`\u21B3 ${r} to edit all queued messages`);this.pendingMessagesContainer.addChild(new zA(s,1,0))}}restoreQueuedMessagesToEditor(e){let{steering:n,followUp:r}=this.clearAllQueues(),s=[...n,...r];if(s.length===0)return this.updatePendingMessagesDisplay(),e?.abort&&this.agent.abort(),0;let i=s.join(` - -`),o=e?.currentText??this.editor.getText(),a=[i,o].filter(c=>c.trim()).join(` - -`);return this.editor.setText(a),this.updatePendingMessagesDisplay(),e?.abort&&this.agent.abort(),s.length}queueCompactionMessage(e,n){this.compactionQueuedMessages.push({text:e,mode:n}),this.editor.addToHistory?.(e),this.editor.setText(""),this.updatePendingMessagesDisplay(),this.showStatus("Queued message for after compaction")}isExtensionCommand(e){if(!e.startsWith("/"))return!1;let n=this.session.extensionRunner,r=e.indexOf(" "),s=r===-1?e.slice(1):e.slice(1,r);return!!n.getCommand(s)}async flushCompactionQueue(e){if(this.compactionQueuedMessages.length===0)return;let n=[...this.compactionQueuedMessages];this.compactionQueuedMessages=[],this.updatePendingMessagesDisplay();let r=s=>{this.session.clearQueue(),this.compactionQueuedMessages=n,this.updatePendingMessagesDisplay(),this.showError(`Failed to send queued message${n.length>1?"s":""}: ${s instanceof Error?s.message:String(s)}`)};try{if(e?.willRetry){for(let u of n)this.isExtensionCommand(u.text)?await this.session.prompt(u.text):u.mode==="followUp"?await this.session.followUp(u.text):await this.session.steer(u.text);this.updatePendingMessagesDisplay();return}let s=n.findIndex(u=>!this.isExtensionCommand(u.text));if(s===-1){for(let u of n)await this.session.prompt(u.text);return}let i=n.slice(0,s),o=n[s],a=n.slice(s+1);for(let u of i)await this.session.prompt(u.text);let c=this.session.prompt(o.text,{streamingBehavior:o.mode}).catch(u=>{r(u)});for(let u of a)this.isExtensionCommand(u.text)?await this.session.prompt(u.text):u.mode==="followUp"?await this.session.followUp(u.text):await this.session.steer(u.text);this.updatePendingMessagesDisplay()}catch(s){r(s)}}flushPendingBashComponents(){for(let e of this.pendingBashComponents)this.pendingMessagesContainer.removeChild(e),this.chatContainer.addChild(e);this.pendingBashComponents=[]}disposeActiveSelector(){let e=this.activeSelectorDispose;this.activeSelectorToken=void 0,this.activeSelectorDispose=void 0,e?.()}showSelector(e){let n={},r,i=e(()=>{r?.(),this.activeSelectorToken===n&&(this.activeSelectorToken=void 0,this.activeSelectorDispose=void 0,this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.ui.setFocus(this.editor))});r=i.dispose,this.disposeActiveSelector(),this.activeSelectorToken=n,this.activeSelectorDispose=r,this.editorContainer.clear(),this.editorContainer.addChild(i.component),this.ui.setFocus(i.focus),this.ui.requestRender()}showSettingsSelector(){this.showSelector(e=>{let n,r=this.settingsManager.getDefaultProvider(),s=this.settingsManager.getDefaultModel(),i=r&&s?`${r}/${s}`:"not set";return n=new $F({autoCompact:this.session.autoCompactionEnabled,defaultModel:i,currentModel:this.session.model,availableDefaultModels:this.session.modelRuntime.getAvailableSnapshot(),showImages:this.settingsManager.getShowImages(),imageWidthCells:this.settingsManager.getImageWidthCells(),autoResizeImages:this.settingsManager.getImageAutoResize(),blockImages:this.settingsManager.getBlockImages(),enableSkillCommands:this.settingsManager.getEnableSkillCommands(),steeringMode:this.session.steeringMode,followUpMode:this.session.followUpMode,transport:this.settingsManager.getTransport(),httpIdleTimeoutMs:this.settingsManager.getHttpIdleTimeoutMs(),thinkingLevel:this.settingsManager.getDefaultThinkingLevel()??th,availableThinkingLevels:[...eSe],modelThinkingLevels:this.settingsManager.getAllModelThinkingLevels(),currentTheme:this.themeController.getThemeSelection()||"dark",terminalTheme:this.themeController.getTerminalTheme(),availableThemes:E_e(),hideThinkingBlock:this.hideThinkingBlock,mermaidRenderingMode:this.settingsManager.getMermaidRenderingMode(),collapseChangelog:this.settingsManager.getCollapseChangelog(),enableInstallTelemetry:this.settingsManager.getEnableInstallTelemetry(),doubleEscapeAction:this.settingsManager.getDoubleEscapeAction(),treeFilterMode:this.settingsManager.getTreeFilterMode(),showHardwareCursor:this.settingsManager.getShowHardwareCursor(),showCacheMissNotices:this.settingsManager.getShowCacheMissNotices(),defaultProjectTrust:this.settingsManager.getDefaultProjectTrust(),editorPaddingX:this.settingsManager.getEditorPaddingX(),outputPad:this.settingsManager.getOutputPad(),autocompleteMaxVisible:this.settingsManager.getAutocompleteMaxVisible(),quietStartup:this.settingsManager.getQuietStartup(),clearOnShrink:this.settingsManager.getClearOnShrink(),showTerminalProgress:this.settingsManager.getShowTerminalProgress(),tuiMode:this.ui.mode,fullscreenExitOutput:this.settingsManager.getFullscreenExitOutput(),fullscreenScrollbar:this.settingsManager.getFullscreenScrollbar(),fullscreenCopyOnSelect:this.settingsManager.getFullscreenCopyOnSelect(),warnings:this.settingsManager.getWarnings()},{onAutoCompactChange:o=>{this.session.setAutoCompactionEnabled(o),this.footer.setAutoCompactEnabled(o)},onShowImagesChange:o=>{this.settingsManager.setShowImages(o);for(let a of this.chatContainer.children)a instanceof G0&&a.setShowImages(o)},onImageWidthCellsChange:o=>{this.settingsManager.setImageWidthCells(o);for(let a of this.chatContainer.children)a instanceof G0&&a.setImageWidthCells(o)},onAutoResizeImagesChange:o=>{this.settingsManager.setImageAutoResize(o)},onBlockImagesChange:o=>{this.settingsManager.setBlockImages(o)},onEnableSkillCommandsChange:o=>{this.settingsManager.setEnableSkillCommands(o),this.setupAutocompleteProvider()},onSteeringModeChange:o=>{this.session.setSteeringMode(o)},onFollowUpModeChange:o=>{this.session.setFollowUpMode(o)},onTransportChange:o=>{this.settingsManager.setTransport(o),this.session.agent.transport=o},onHttpIdleTimeoutMsChange:o=>{this.settingsManager.setHttpIdleTimeoutMs(o),mV(o),this.showStatus(`HTTP idle timeout: ${Gwe(o)}`)},onModelThinkingLevelChange:(o,a,c)=>{this.settingsManager.setModelThinkingLevel(o,a,c);let u=this.session.model;u&&u.provider===o&&u.id===a&&(this.session.setThinkingLevel(c),this.footer.invalidate(),this.updateEditorBorderColor())},onModelThinkingLevelRemove:(o,a)=>{this.settingsManager.removeModelThinkingLevel(o,a);let c=this.session.model;if(c&&c.provider===o&&c.id===a){let u=this.settingsManager.getDefaultThinkingLevel()??th;this.session.setThinkingLevel(u),this.footer.invalidate(),this.updateEditorBorderColor()}},onThemeChange:o=>{this.settingsManager.setTheme(o),this.themeController.setThemeSetting(o)},onThemePreview:o=>this.themeController.preview(o),onHideThinkingBlockChange:o=>{this.hideThinkingBlock=o,this.settingsManager.setHideThinkingBlock(o),this.updateThinkingBlockVisibility()},onMermaidRenderingModeChange:o=>{this.settingsManager.setMermaidRenderingMode(o),this.chatContainer.invalidate(),this.ui.requestRender()},onShowCacheMissNoticesChange:o=>{this.settingsManager.setShowCacheMissNotices(o),this.rebuildChatFromMessages()},onCollapseChangelogChange:o=>{this.settingsManager.setCollapseChangelog(o)},onEnableInstallTelemetryChange:o=>{this.settingsManager.setEnableInstallTelemetry(o)},onQuietStartupChange:o=>{this.settingsManager.setQuietStartup(o)},onDefaultProjectTrustChange:o=>{this.settingsManager.setDefaultProjectTrust(o)},onDoubleEscapeActionChange:o=>{this.settingsManager.setDoubleEscapeAction(o)},onTreeFilterModeChange:o=>{this.settingsManager.setTreeFilterMode(o)},onShowHardwareCursorChange:o=>{this.settingsManager.setShowHardwareCursor(o),this.ui.setShowHardwareCursor(o)},onEditorPaddingXChange:o=>{this.settingsManager.setEditorPaddingX(o),this.defaultEditor.setPaddingX(o),this.editor!==this.defaultEditor&&this.editor.setPaddingX!==void 0&&this.editor.setPaddingX(o)},onOutputPadChange:o=>{if(this.settingsManager.setOutputPad(o),this.outputPad=o,this.streamingComponent||this.session.isStreaming){for(let a of this.chatContainer.children)(a instanceof Q0||a instanceof ZD||a instanceof KT)&&a.setOutputPad(o);this.streamingComponent&&this.streamingComponent.setOutputPad(o),this.ui.requestRender();return}this.rebuildChatFromMessages()},onAutocompleteMaxVisibleChange:o=>{this.settingsManager.setAutocompleteMaxVisible(o),this.defaultEditor.setAutocompleteMaxVisible(o),this.editor!==this.defaultEditor&&this.editor.setAutocompleteMaxVisible!==void 0&&this.editor.setAutocompleteMaxVisible(o)},onClearOnShrinkChange:o=>{this.settingsManager.setClearOnShrink(o),this.ui.setClearOnShrink(o),!o&&!this.activeStatusIndicator&&this.statusContainer.clear()},onShowTerminalProgressChange:o=>{this.settingsManager.setShowTerminalProgress(o)},onTuiModeChange:o=>{if(!this.switchTuiMode(o)){n?.getSettingsList().updateValue("tui-mode",this.ui.mode),this.showStatus("Close active overlays before changing TUI mode");return}this.settingsManager.setTuiMode(o),this.activeStatusIndicator||this.statusContainer.clear(),this.showStatus(`TUI mode: ${o}`)},onFullscreenExitOutputChange:o=>{this.settingsManager.setFullscreenExitOutput(o)},onFullscreenScrollbarChange:o=>{this.settingsManager.setFullscreenScrollbar(o),this.applyFullscreenScrollbarSetting()},onFullscreenCopyOnSelectChange:o=>{this.settingsManager.setFullscreenCopyOnSelect(o),this.renderer instanceof u0&&this.renderer.setCopyOnSelect(o)},onWarningsChange:o=>{this.settingsManager.setWarnings(o)},onCancel:()=>{e(),this.ui.requestRender()}}),{component:n,focus:n.getSettingsList()}})}handleThinkingCommand(e){let n=this.session.getAvailableThinkingLevels();if(!e){this.showThinkingSelector();return}let r=e.trim().toLowerCase(),s=n.find(i=>i.toLowerCase()===r);if(!s){this.showError(`Unknown thinking level "${e}". Available levels: ${n.join(", ")}.`);return}this.selectThinkingLevel(s,!1)}selectThinkingLevel(e,n){try{this.session.setThinkingLevel(e,{persist:n}),this.footer.invalidate(),this.updateEditorBorderColor(),this.showStatus(n?`Default thinking level: ${e}`:`Thinking level: ${e}`)}catch(r){this.showError(r instanceof Error?r.message:String(r))}}showThinkingSelector(){this.showSelector(e=>{let n=(s,i)=>{this.selectThinkingLevel(s,i),e()},r=new WF(this.session.thinkingLevel??th,this.session.getAvailableThinkingLevels(),s=>n(s,!1),()=>{e(),this.ui.requestRender()},s=>n(s,!0),this.settingsManager.getDefaultThinkingLevel()??th);return{component:r,focus:r}})}async handleModelCommand(e){if(!e){this.showModelSelector();return}let n=await this.findExactModelMatch(e);if(n){try{await this.session.setModel(n,{persist:!1}),this.footer.invalidate(),this.updateEditorBorderColor(),this.showStatus(`Model: ${n.id}`),this.maybeWarnAboutAnthropicSubscriptionAuth(n),this.checkDaxnutsEasterEgg(n)}catch(r){this.showError(r instanceof Error?r.message:String(r))}return}this.showModelSelector(e)}async findExactModelMatch(e){let n=this.session.scopedModels.length>0?this.session.scopedModels.map(a=>a.model):[...this.session.modelRuntime.getAvailableSnapshot()],r=kee(e,n);if(r||this.session.scopedModels.length>0)return r;this.showStatus("Refreshing model catalogs\u2026");let s=new AbortController,i=!1,o=setTimeout(()=>{i=!0,s.abort()},15e3);try{let a=await IV(this.session.modelRuntime,s.signal);a.aborted&&i?this.showWarning("Model refresh timed out; searching cached models."):a.errors.size>0&&this.showWarning(`Could not refresh ${[...a.errors.keys()].join(", ")}; searching cached models.`)}catch(a){this.showWarning(i?"Model refresh timed out; searching cached models.":`Could not refresh model catalogs: ${a instanceof Error?a.message:String(a)}`)}finally{clearTimeout(o)}return kee(e,[...this.session.modelRuntime.getAvailableSnapshot()])}updateAvailableProviderCount(){let e=this.session.scopedModels.length>0?this.session.scopedModels.map(r=>r.model):this.session.modelRuntime.getAvailableSnapshot(),n=new Set(e.map(r=>r.provider));this.footerDataProvider.setAvailableProviderCount(n.size)}async maybeWarnAboutAnthropicSubscriptionAuth(e=this.session.model){if(this.settingsManager.getWarnings().anthropicExtraUsage!==!1&&!this.anthropicSubscriptionWarningShown&&!(!e||e.provider!=="anthropic"))try{if((await this.session.modelRuntime.checkAuth("anthropic"))?.type==="oauth"){this.anthropicSubscriptionWarningShown=!0,this.showWarning(jMn);return}let n=(await this.session.modelRuntime.getAuth(e.provider))?.auth.apiKey;if(!qGs(n))return;this.anthropicSubscriptionWarningShown=!0,this.showWarning(jMn)}catch{}}maybeSaveImplicitProjectTrustAfterReload(){let e=this.sessionManager.getCwd();if(this.autoTrustOnReloadCwd!==e||!this.settingsManager.isProjectTrusted()||!fb(e))return!1;let n=new M0(this.runtimeHost.services.agentDir);try{return n.get(e)!==null?(this.autoTrustOnReloadCwd=void 0,!1):(n.set(e,!0),this.autoTrustOnReloadCwd=void 0,!0)}catch(r){return this.showWarning(`Could not save project trust after reload: ${r instanceof Error?r.message:String(r)}`),!1}}showTrustSelector(){let e=this.sessionManager.getCwd(),n=new M0(this.runtimeHost.services.agentDir),r=n.getEntry(e);this.showSelector(s=>{let i=new Ine({cwd:e,savedDecision:r,projectTrusted:this.settingsManager.isProjectTrusted(),onSelect:o=>{n.setMany(o.updates),s(),this.showStatus(`Saved trust decision: ${o.trusted?"trusted":"untrusted"}. Restart ${An} for this to take effect.`)},onCancel:()=>{s(),this.ui.requestRender()}});return{component:i,focus:i}})}showModelSelector(e){this.showSelector(n=>{let r=async(a,c)=>{try{await this.session.setModel(a,{persist:c}),this.updateAvailableProviderCount(),this.footer.invalidate(),this.updateEditorBorderColor(),n(),this.showStatus(c?`Default model: ${a.provider}/${a.id}`:`Model: ${a.id}`),this.maybeWarnAboutAnthropicSubscriptionAuth(a),this.checkDaxnutsEasterEgg(a)}catch(u){n(),this.showError(u instanceof Error?u.message:String(u))}},s=this.settingsManager.getDefaultProvider(),i=this.settingsManager.getDefaultModel(),o=new UF(this.ui,this.session.model,this.session.modelRuntime,this.session.scopedModels,a=>r(a,!1),()=>{n(),this.ui.requestRender()},e,a=>r(a,!0),s&&i?{provider:s,id:i}:void 0);return{component:o,focus:o,dispose:()=>o.dispose()}})}showModelsSelector(){let e=[...this.session.modelRuntime.getAvailableSnapshot()],n=new Set(e.map(u=>`${u.provider}/${u.id}`)),r=this.settingsManager.getEnabledModels(),s=this.session.scopedModels,i=u=>{if(!r?.length)return null;let l=oIe(r,u),d=l.scopedModels.map(h=>`${h.model.provider}/${h.model.id}`);for(let h of l.diagnostics)h.code==="no-match"&&!d.includes(h.pattern)&&d.push(h.pattern);return d},o=s.length>0?s.map(u=>`${u.model.provider}/${u.model.id}`):i(e),a=!1,c=u=>{o=u===null?null:[...u];let l=u?.some(h=>n.has(h))??!1,d=u!==null&&[...n].every(h=>u.includes(h));if(u&&l&&!d){let h=oIe(u,e).scopedModels;this.session.setScopedModels(h.map(m=>({model:m.model,thinkingLevel:m.thinkingLevel})))}else this.session.setScopedModels([]);this.updateAvailableProviderCount(),this.ui.requestRender()};this.showSelector(u=>{let l=!1,d=!1,h=new AbortController,m=setTimeout(()=>{d=!0,h.abort()},15e3),f=new Ene({allModels:e,enabledModelIds:o,refreshStatus:"Refreshing model catalogs\u2026"},{onChange:g=>{a=!0,c(g)},onPersist:g=>{let A=g!==null&&g.length===e.length&&g.every(b=>n.has(b)),y=g===null||A?void 0:g;this.settingsManager.setEnabledModels(y?[...y]:void 0),this.showStatus("Model selection saved to settings")},onCancel:()=>{u(),this.ui.requestRender()}});return IV(this.session.modelRuntime,h.signal).then(g=>{l||(e=[...this.session.modelRuntime.getAvailableSnapshot()],n=new Set(e.map(A=>`${A.provider}/${A.id}`)),!a&&s.length===0?(o=i(e),f.updateModels(e,o)):f.updateModels(e),o!==null&&c(o),g.aborted&&d?f.setRefreshStatus("Model refresh timed out; showing cached models.","warning"):g.errors.size>0?f.setRefreshStatus(`Could not refresh ${[...g.errors.keys()].join(", ")}; showing cached models.`,"warning"):f.setRefreshStatus("Model catalogs refreshed.","success"),this.ui.requestRender())}).catch(g=>{l||(f.setRefreshStatus(d?"Model refresh timed out; showing cached models.":`Could not refresh model catalogs: ${g instanceof Error?g.message:String(g)}`,"warning"),this.ui.requestRender())}).finally(()=>clearTimeout(m)),{component:f,focus:f,dispose:()=>{l=!0,clearTimeout(m),h.abort()}}})}showUserMessageSelector(){let e=this.session.getUserMessagesForForking();if(e.length===0){this.showStatus("No messages to fork from");return}let n=e[e.length-1]?.entryId;this.showSelector(r=>{let s=new HF(e.map(i=>({id:i.entryId,text:i.text})),async i=>{r();try{let o=await this.runtimeHost.fork(i);if(o.cancelled){this.ui.requestRender();return}this.editor.setText(o.selectedText??""),this.showStatus("Forked to new session")}catch(o){this.showError(o instanceof Error?o.message:String(o))}},()=>{r(),this.ui.requestRender()},n);return{component:s,focus:s.getMessageList()}})}async handleCloneCommand(){let e=this.sessionManager.getLeafId();if(!e){this.showStatus("Nothing to clone yet");return}try{if((await this.runtimeHost.fork(e,{position:"at"})).cancelled){this.ui.requestRender();return}this.editor.setText(""),this.showStatus("Cloned to new session")}catch(n){this.showError(n instanceof Error?n.message:String(n))}}showTreeSelector(e){let n=this.sessionManager.getTree(),r=this.sessionManager.getLeafId(),s=this.settingsManager.getTreeFilterMode();if(n.length===0){this.showStatus("No entries in session");return}this.showSelector(i=>{let o=new qF(n,r,this.ui.terminal.rows,async a=>{if(a===this.sessionManager.getLeafId()){i(),this.showStatus("Already at this point");return}i();let c=!1,u;if(!this.settingsManager.getBranchSummarySkipPrompt())for(;;){let h=await this.showExtensionSelector("Summarize branch?",["No summary","Summarize","Summarize with custom prompt"]);if(h===void 0){this.showTreeSelector(a);return}if(c=h!=="No summary",!(h==="Summarize with custom prompt"&&(u=await this.showExtensionEditor("Custom summarization instructions"),u===void 0)))break}this.session.isStreaming&&(this.restoreQueuedMessagesToEditor(),await this.session.abort());let l=!1,d=this.defaultEditor.onEscape;c&&(this.defaultEditor.onEscape=()=>{this.session.abortBranchSummary()},this.chatContainer.addChild(new Nt(1)),this.showStatusIndicator(new Cne(this.ui)),l=!0,this.ui.requestRender());try{let h=await this.session.navigateTree(a,{summarize:c,customInstructions:u});if(h.aborted){this.showStatus("Branch summarization cancelled"),this.showTreeSelector(a);return}if(h.cancelled){this.showStatus("Navigation cancelled");return}this.chatContainer.clear(),this.renderInitialMessages(),h.editorText&&!this.editor.getText().trim()&&this.editor.setText(h.editorText),this.showStatus("Navigated to selected point"),this.flushCompactionQueue({willRetry:!1})}catch(h){this.showError(h instanceof Error?h.message:String(h))}finally{l&&this.clearStatusIndicator("branchSummary"),this.defaultEditor.onEscape=d}},()=>{i(),this.ui.requestRender()},(a,c)=>{this.sessionManager.appendLabelChange(a,c),this.ui.requestRender()},e,s);return o.onCopy=async a=>{if(!a){this.showError("Selected entry has no text to copy");return}try{await TF(a),this.showStatus("Copied selected message to clipboard")}catch(c){this.showError(c instanceof Error?c.message:String(c))}},{component:o,focus:o}})}showSessionSelector(){this.showSelector(e=>{let n=new UT(r=>eo.list(this.sessionManager.getCwd(),this.sessionManager.getSessionDir(),r),r=>this.sessionManager.usesDefaultSessionDir()?eo.listAll(r):eo.listAll(this.sessionManager.getSessionDir(),r),async r=>{e(),await this.handleResumeSession(r)},()=>{e(),this.ui.requestRender()},()=>{this.shutdown()},()=>this.ui.requestRender(),{renameSession:async(r,s)=>{let i=(s??"").trim();if(!i)return;eo.open(r).appendSessionInfo(i)},showRenameHint:!0,keybindings:this.keybindings},this.sessionManager.getSessionFile());return{component:n,focus:n}})}async handleResumeSession(e,n){this.clearStatusIndicator();try{let r=await this.runtimeHost.switchSession(e,{withSession:n?.withSession,projectTrustContextFactory:s=>this.createProjectTrustContext(s)});return r.cancelled||this.showStatus("Resumed session"),r}catch(r){if(r instanceof YD){let s=await this.promptForMissingSessionCwd(r);if(!s)return this.showStatus("Resume cancelled"),{cancelled:!0};let i=await this.runtimeHost.switchSession(e,{cwdOverride:s,withSession:n?.withSession,projectTrustContextFactory:o=>this.createProjectTrustContext(o)});return i.cancelled||this.showStatus("Resumed session in current cwd"),i}return this.handleFatalRuntimeError("Failed to resume session",r)}}getLoginProviderOptions(e){let n=[];for(let r of this.session.modelRuntime.getProviders()){let s=this.session.modelRuntime.getProviderAuthStatus(r.id),i=s.configured?{type:this.session.modelRuntime.isUsingOAuth(r.id)?"oauth":"api_key",source:s.label??s.source}:void 0;(!e||e==="oauth")&&r.auth.oauth&&n.push({id:r.id,name:r.name,authType:"oauth",method:r.auth.oauth,status:i}),(!e||e==="api_key")&&r.auth.apiKey&&n.push({id:r.id,name:r.name,authType:"api_key",method:r.auth.apiKey,status:i})}return n.sort((r,s)=>r.name.localeCompare(s.name))}async getLogoutProviderOptions(){return(await this.session.modelRuntime.listCredentials({signal:AbortSignal.timeout(15e3)})).map(({providerId:e,type:n})=>({id:e,name:this.session.modelRuntime.getProvider(e)?.name??e,authType:n,status:{type:n,source:"stored credential"}})).sort((e,n)=>e.name.localeCompare(n.name))}findLoginProviderOptions(e){let n=e.trim().toLowerCase();return n?this.getLoginProviderOptions().filter(r=>r.id.toLowerCase()===n||r.name.toLowerCase()===n):[]}async handleLoginCommand(e){if(!e){this.showLoginAuthTypeSelector();return}let n=this.findLoginProviderOptions(e);if(n.length===1){await this.startProviderLogin(n[0]);return}if(n.length>1&&new Set(n.map(s=>s.id)).size===1){this.showLoginAuthTypeSelector(n);return}this.showLoginProviderSelector(void 0,e)}async startProviderLogin(e){e.authType==="oauth"?await this.showLoginDialog(e.id,e.name):e.method?.login?await this.showApiKeyLoginDialog(e.id,e.name):this.showAmbientAuthDialog(e)}showLoginAuthTypeSelector(e){let n=e?.find(u=>u.authType==="oauth"),s=(n?.method&&"loginLabel"in n.method?n.method.loginLabel:void 0)??"Sign in with an account",i="Sign in with an API key",o=e?new Set(e.map(u=>u.authType)):new Set(["oauth","api_key"]),a=[];if(o.has("oauth")&&a.push(s),o.has("api_key")&&a.push(i),a.length===0){this.showStatus("No login methods available.");return}if(e&&a.length===1){let u=e[0];u&&this.startProviderLogin(u);return}let c=e?.[0]?`Select authentication method for ${e[0].name}:`:"Select authentication method:";this.showSelector(u=>{let l=new L0(c,a,d=>{u();let h=d===s?"oauth":"api_key";if(e){let m=e.find(f=>f.authType===h);m&&this.startProviderLogin(m);return}this.showLoginProviderSelector(h)},()=>{u(),this.ui.requestRender()});return{component:l,focus:l}})}showLoginProviderSelector(e,n){let r=this.getLoginProviderOptions(e);if(r.length===0){let s=e==="oauth"?"No subscription providers available.":e==="api_key"?"No API key providers available.":"No login providers available.";this.showStatus(s);return}this.showSelector(s=>{let i=new r1("login",r,async(o,a)=>{s();let c=r.find(u=>u.id===o&&u.authType===a);c&&await this.startProviderLogin(c)},()=>{s(),e?this.showLoginAuthTypeSelector():this.ui.requestRender()},n);return{component:i,focus:i}})}async showOAuthSelector(e){if(e==="login"){this.showLoginAuthTypeSelector();return}let n;try{n=await this.getLogoutProviderOptions()}catch(r){this.showError(`Could not read stored credentials: ${r instanceof Error?r.message:String(r)}`);return}if(n.length===0){this.showStatus("No stored credentials to remove. /logout only removes credentials saved by /login; environment variables and models.json config are unchanged.");return}this.showSelector(r=>{let s=new r1(e,n,async i=>{r();let o=n.find(a=>a.id===i);if(o)try{await this.session.modelRuntime.logout(o.id,{signal:AbortSignal.timeout(15e3)}),await this.updateAvailableProviderCount();let a=o.authType==="oauth"?`Logged out of ${o.name}`:`Removed stored API key for ${o.name}. Environment variables and models.json config are unchanged.`;this.showStatus(a)}catch(a){let c=a instanceof Error?a.message:String(a);this.showError(a instanceof I0?`Credentials removed for ${o.name}, but local model state could not be synchronized: ${c}`:`Logout failed: ${c}`)}},()=>{r(),this.ui.requestRender()});return{component:s,focus:s}})}async completeProviderAuthentication(e,n,r,s){let i=r==="oauth"?`Logged in to ${n}`:`Saved API key for ${n}`,o,a;if(HGs(s)){let d=this.session.modelRuntime.getAvailableSnapshot().filter(h=>h.provider===e);if(e==="llama.cpp")a=KGs(i,d.length);else if(!YGs(e))a=`${i}, but no default model is configured for provider "${e}". Use /model to select a model.`;else if(d.length===0)a=`${i}, but no models are available for that provider. Use /model to select a model.`;else{let h=p4[e];if(o=d.find(m=>m.id===h),!o)a=`${i}, but its default model "${h}" is not available. Use /model to select a model.`;else try{await this.session.setModel(o,{persist:!0})}catch(m){o=void 0;let f=m instanceof Error?m.message:String(m);a=`${i}, but selecting its default model failed: ${f}. Use /model to select a model.`}}}await this.updateAvailableProviderCount(),this.footer.invalidate(),this.updateEditorBorderColor(),o?(this.showStatus(`${i}. Selected ${o.id}. Credentials saved to ${B9e()}`),this.maybeWarnAboutAnthropicSubscriptionAuth(o),this.checkDaxnutsEasterEgg(o)):(this.showStatus(`${i}. Credentials saved to ${B9e()}`),a?this.showError(a):this.maybeWarnAboutAnthropicSubscriptionAuth());let c=new AbortController,u=setTimeout(()=>c.abort(),15e3);this.session.modelRuntime.refresh({providers:[e],signal:c.signal}).then(l=>{l.aborted?this.showWarning(`${i}, but its model catalog refresh timed out; using cached models.`):l.errors.size>0&&this.showWarning(`${i}, but its model catalog could not be refreshed; using cached models.`),this.updateAvailableProviderCount(),this.footer.invalidate(),this.ui.requestRender()}).catch(l=>{this.showWarning(`${i}, but its model catalog could not be refreshed: ${l instanceof Error?l.message:String(l)}`)}).finally(()=>clearTimeout(u))}showAmbientAuthDialog(e){let n=()=>{this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.ui.setFocus(this.editor),this.ui.requestRender()},r=new WT(this.ui,e.id,()=>n(),e.name,`${e.name} setup`);r.showInfo(`${e.method?.name??"Authentication"} is configured outside ${An}.`,[],!0),this.editorContainer.clear(),this.editorContainer.addChild(r),this.ui.setFocus(r),this.ui.requestRender()}async showApiKeyLoginDialog(e,n){let r=this.session.model,s=new WT(this.ui,e,(o,a)=>{},n);e==="amazon-bedrock"&&s.showDetails([Se.fg("text","You can also use an AWS profile, IAM keys, or role-based credentials."),Se.fg("muted","See:"),Se.fg("accent",` ${bl.join(Yw(),"providers.md")}`)]),this.editorContainer.clear(),this.editorContainer.addChild(s),this.ui.setFocus(s),this.ui.requestRender();let i=()=>{this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.ui.setFocus(this.editor),this.ui.requestRender()};try{await this.loginProvider(s,e,"api_key"),i(),await this.completeProviderAuthentication(e,n,"api_key",r)}catch(o){i();let a=o instanceof Error?o.message:String(o);o instanceof I0?this.showError(`Saved API key for ${n}, but local model state could not be synchronized: ${a}`):a!=="Login cancelled"&&this.showError(`Failed to save API key for ${n}: ${a}`)}}showAuthSelect(e,n){return new Promise((r,s)=>{let i=()=>{this.editorContainer.clear(),this.editorContainer.addChild(e),this.ui.setFocus(e),this.ui.requestRender()},o=n.options.map(c=>c.label),a=new L0(n.message,o,c=>{i();let u=n.options.find(l=>l.label===c)?.id;u?r(u):s(new Error("Login cancelled"))},()=>{i(),s(new Error("Login cancelled"))});this.editorContainer.clear(),this.editorContainer.addChild(a),this.ui.setFocus(a),this.ui.requestRender()})}async showAuthPrompt(e,n){let r;if(n.type==="select"?r=this.showAuthSelect(e,n):n.type==="manual_code"?r=e.showManualInput(n.message):r=e.showPrompt(n.message,n.placeholder),!n.signal)return r;if(n.signal.aborted)throw new Error("Login cancelled");let s=n.signal,i,o=new Promise((a,c)=>{i=()=>c(new Error("Login cancelled")),s.addEventListener("abort",i,{once:!0})});try{return await Promise.race([r,o])}finally{i&&s.removeEventListener("abort",i)}}notifyAuthDialog(e,n){n.type==="auth_url"?e.showAuth(n.url,n.instructions):n.type==="device_code"?(e.showDeviceCode(n),e.showWaiting("Waiting for authentication...")):n.type==="info"?e.showInfo(n.message,n.links):e.showProgress(n.message)}async loginProvider(e,n,r){await this.session.modelRuntime.login(n,r,{signal:e.signal,prompt:s=>this.showAuthPrompt(e,s),notify:s=>this.notifyAuthDialog(e,s)})}async showLoginDialog(e,n){let r=this.session.model,s=new WT(this.ui,e,(o,a)=>{},n);this.editorContainer.clear(),this.editorContainer.addChild(s),this.ui.setFocus(s),this.ui.requestRender();let i=()=>{this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.ui.setFocus(this.editor),this.ui.requestRender()};try{await this.loginProvider(s,e,"oauth"),i(),await this.completeProviderAuthentication(e,n,"oauth",r)}catch(o){i();let a=o instanceof Error?o.message:String(o);o instanceof I0?this.showError(`Logged in to ${n}, but local model state could not be synchronized: ${a}`):a!=="Login cancelled"&&this.showError(`Failed to login to ${n}: ${a}`)}}async handleReloadCommand(){if(this.session.isStreaming){this.showWarning("Wait for the current response to finish before reloading.");return}if(this.session.isCompacting){this.showWarning("Wait for compaction to finish before reloading.");return}this.resetExtensionUI();let e=new _n,n=c=>Se.fg("border",c);e.addChild(new Ln(n)),e.addChild(new Nt(1)),e.addChild(new yt(Se.fg("muted","Reloading keybindings, extensions, skills, prompts, themes, and context files..."),1,0)),e.addChild(new Nt(1)),e.addChild(new Ln(n));let r=this.editor;this.editorContainer.clear(),this.editorContainer.addChild(e),this.ui.setFocus(e),this.ui.requestRender(!0),await new Promise(c=>process.nextTick(c));let s=c=>{this.editorContainer.clear(),this.editorContainer.addChild(c),this.ui.setFocus(c),this.ui.requestRender()},i=!1,o=!1,a=()=>{i||(this.hideThinkingBlock=this.settingsManager.getHideThinkingBlock(),this.outputPad=this.settingsManager.getOutputPad(),this.rebuildChatFromMessages(),i=!0)};try{await this.session.reload({beforeSessionStart:a}),a(),this.keybindings.reload();let c=this.customHeader??this.builtInHeader;xne(c)&&c.setExpanded(this.toolOutputExpanded),PH(this.session.resourceLoader.getThemes().themes),this.applyRuntimeSettings(),await this.themeController.applyFromSettings(),this.setupAutocompleteProvider();let u=this.session.extensionRunner;this.setupExtensionShortcuts(u),this.showLoadedResources({force:!1,showDiagnosticsWhenQuiet:!0});let l=this.maybeSaveImplicitProjectTrustAfterReload(),d=this.session.modelRuntime.getError();d&&this.showError(`models.json error: ${d}`),this.showStatus(l?"Reloaded keybindings, extensions, skills, prompts, themes, and context files; saved project trust":"Reloaded keybindings, extensions, skills, prompts, themes, and context files"),s(this.editor),o=!0}catch(c){o||s(r),this.showError(`Reload failed: ${c instanceof Error?c.message:String(c)}`)}}async handleExportCommand(e){let n=this.getPathCommandArgument(e,"/export");try{if(n?.endsWith(".jsonl")){let r=this.session.exportToJsonl(n);this.showStatus(`Session exported to: ${r}`)}else{let r=await this.session.exportToHtml(n,{themeName:Se.name});this.showStatus(`Session exported to: ${r}`)}}catch(r){this.showError(`Failed to export session: ${r instanceof Error?r.message:"Unknown error"}`)}}getPathCommandArgument(e,n){if(e===n||!e.startsWith(`${n} `))return;let r=e.slice(n.length+1).trimStart();if(!r)return;let s=r[0];if(s==='"'||s==="'"){let o=r.indexOf(s,1);return o<0?void 0:r.slice(1,o)}let i=r.search(/\s/);return i<0?r:r.slice(0,i)}async handleImportCommand(e){let n=this.getPathCommandArgument(e,"/import");if(!n){this.showError("Usage: /import ");return}if(!await this.showExtensionConfirm("Import session",`Replace current session with ${n}?`)){this.showStatus("Import cancelled");return}try{if(this.clearStatusIndicator(),(await this.runtimeHost.importFromJsonl(n)).cancelled){this.showStatus("Import cancelled");return}this.showStatus(`Session imported from: ${n}`)}catch(s){if(s instanceof YD){let i=await this.promptForMissingSessionCwd(s);if(!i){this.showStatus("Import cancelled");return}if((await this.runtimeHost.importFromJsonl(n,i)).cancelled){this.showStatus("Import cancelled");return}this.showStatus(`Session imported from: ${n}`);return}if(s instanceof Zte){this.showError(`Failed to import session: ${s.message}`);return}await this.handleFatalRuntimeError("Failed to import session",s)}}async handleShareCommand(){await HMn({session:this.session,ui:this.ui,editorContainer:this.editorContainer,editor:this.editor,showStatus:e=>this.showStatus(e),showError:e=>this.showError(e)})}async handleCopyCommand(e={}){if(e.preferSelection&&this.ui instanceof u0&&!this.ui.getCopyOnSelect()&&this.ui.hasActiveSelection()){await this.ui.copyActiveSelectionToClipboard();return}let n=this.session.getLastAssistantText();if(!n){this.showError("No agent messages to copy yet.");return}try{await TF(n),e.flashConfirmation&&this.ui instanceof u0?this.ui.flash("Copied!"):this.showStatus("Copied last agent message to clipboard")}catch(r){this.showError(r instanceof Error?r.message:String(r))}}handleNameCommand(e){let n=e.replace(/^\/name\s*/,"").trim();if(!n){let s=this.sessionManager.getSessionName();s?(this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(Se.fg("dim",`Session name: ${s}`),1,0))):this.showWarning("Usage: /name "),this.ui.requestRender();return}this.session.setSessionName(n);let r=this.sessionManager.getSessionName();r!==n&&this.showWarning(`Session name was normalized from ${JSON.stringify(n)} to ${JSON.stringify(r)}`),this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(Se.fg("dim",`Session name set: ${r??n}`),1,0)),this.ui.requestRender()}handleSessionCommand(){let e=this.session.getSessionStats(),n=this.sessionManager.getSessionName(),r=this.sessionManager.getEntries(),s=AOn(r,this.session.modelRuntime),i=b0n(r),o=`${Se.bold("Session Info")} - -`;n&&(o+=`${Se.fg("dim","Name:")} ${n} -`),o+=`${Se.fg("dim","File:")} ${e.sessionFile??"In-memory"} -`,o+=`${Se.fg("dim","ID:")} ${e.sessionId} - -`,o+=`${Se.bold("Messages")} -`,o+=`${Se.fg("dim","Total:")} ${e.totalMessages} -`,o+=`${Se.fg("dim","User:")} ${e.userMessages} -`,o+=`${Se.fg("dim","Assistant:")} ${e.assistantMessages} -`,o+=`${Se.fg("dim","Tools:")} ${e.toolCalls} calls, ${e.toolResults} results - -`,o+=`${Se.bold("Tokens")} -`;let{input:a,cacheRead:c,cacheWrite:u}=e.tokens,l=a+c+u;if(o+=`${Se.fg("dim","Input:")} ${l.toLocaleString()} -`,l>0&&(c>0||u>0)){let d=Se.fg("dim",`(${(c/l*100).toFixed(1)}%)`);o+=` ${Se.fg("dim","Cached:")} ${c.toLocaleString()} ${d} -`;let h=u>0?` ${Se.fg("dim",`(${u.toLocaleString()} written to cache)`)}`:"";o+=` ${Se.fg("dim","Uncached:")} ${(a+u).toLocaleString()}${h} -`}if(o+=`${Se.fg("dim","Output:")} ${e.tokens.output.toLocaleString()} -`,o+=`${Se.fg("dim","Total:")} ${e.tokens.total.toLocaleString()} -`,e.cost>0||s.missedTokens>0){if(o+=` -${Se.bold("Cost")} -`,o+=`${Se.fg("dim","Total:")} $${e.cost.toFixed(3)}`,i.length>1)for(let d of i)o+=` - ${Se.fg("dim",`${d.key}:`)} $${d.cost.toFixed(3)} ${Se.fg("dim",`(${kI(d.tokens)} tokens)`)}`;if(s.missedTokens>0){let d=s.missCount===1?"1 miss":`${s.missCount} misses`,h=`${s.missedTokens.toLocaleString()} tokens, ${d}`;o+=s.missedCost>=1e-4?` -${Se.fg("dim","Cache Re-billed:")} $${s.missedCost.toFixed(3)} ${Se.fg("dim",`(${h})`)}`:` -${Se.fg("dim","Cache Re-billed:")} ${h}`}}this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(o,1,0)),this.ui.requestRender()}handleChangelogCommand(){let e=mbe(),n=Qot(e),r=n.length>0?n.reverse().map(s=>Fot(s.content,s)).join(` - -`):"No changelog entries found.";this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new Ln),this.chatContainer.addChild(new yt(Se.bold(Se.fg("accent","What's New")),1,0)),this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new Hc(r,1,1,this.getMarkdownThemeWithSettings())),this.chatContainer.addChild(new Ln),this.ui.requestRender()}getAppKeyDisplay(e){return oc(e)}getEditorKeyDisplay(e){return oc(e)}handleHotkeysCommand(){let e=this.getEditorKeyDisplay("tui.editor.cursorUp"),n=this.getEditorKeyDisplay("tui.editor.cursorDown"),r=this.getEditorKeyDisplay("tui.editor.cursorLeft"),s=this.getEditorKeyDisplay("tui.editor.cursorRight"),i=this.getEditorKeyDisplay("tui.editor.cursorWordLeft"),o=this.getEditorKeyDisplay("tui.editor.cursorWordRight"),a=this.getEditorKeyDisplay("tui.editor.cursorLineStart"),c=this.getEditorKeyDisplay("tui.editor.cursorLineEnd"),u=this.getEditorKeyDisplay("tui.editor.jumpForward"),l=this.getEditorKeyDisplay("tui.editor.jumpBackward"),d=this.getEditorKeyDisplay("tui.editor.pageUp"),h=this.getEditorKeyDisplay("tui.editor.pageDown"),m=this.getEditorKeyDisplay("tui.input.submit"),f=this.getEditorKeyDisplay("tui.input.newLine"),g=this.getEditorKeyDisplay("tui.editor.deleteWordBackward"),A=this.getEditorKeyDisplay("tui.editor.deleteWordForward"),y=this.getEditorKeyDisplay("tui.editor.deleteToLineStart"),b=this.getEditorKeyDisplay("tui.editor.deleteToLineEnd"),S=this.getEditorKeyDisplay("tui.editor.yank"),C=this.getEditorKeyDisplay("tui.editor.yankPop"),I=this.getEditorKeyDisplay("tui.editor.undo"),x=this.getEditorKeyDisplay("tui.input.tab"),w=this.getAppKeyDisplay("app.interrupt"),R=this.getAppKeyDisplay("app.clear"),N=this.getAppKeyDisplay("app.exit"),P=this.getAppKeyDisplay("app.suspend"),G=this.getAppKeyDisplay("app.thinking.cycle"),$=this.getAppKeyDisplay("app.model.cycleForward"),Q=this.getAppKeyDisplay("app.model.select"),H=this.getAppKeyDisplay("app.tools.expand"),oe=this.getAppKeyDisplay("app.thinking.toggle"),re=this.getAppKeyDisplay("app.editor.external"),Z=this.getAppKeyDisplay("app.model.cycleBackward"),q=this.getAppKeyDisplay("app.message.copy"),ce=this.getAppKeyDisplay("app.message.followUp"),be=this.getAppKeyDisplay("app.message.dequeue"),Be=this.getAppKeyDisplay("app.clipboard.pasteImage"),Me=` +${Ee.fg("muted","Packages:")} +${i}`,1,0)),this.chatContainer.addChild(new Un(s=>Ee.fg("warning",s))),this.ui.requestRender()}getAllQueuedMessages(){return{steering:[...this.session.getSteeringMessages(),...this.compactionQueuedMessages.filter(e=>e.mode==="steer").map(e=>e.text)],followUp:[...this.session.getFollowUpMessages(),...this.compactionQueuedMessages.filter(e=>e.mode==="followUp").map(e=>e.text)]}}clearAllQueues(){let{steering:e,followUp:n}=this.session.clearQueue(),r=this.compactionQueuedMessages.filter(s=>s.mode==="steer").map(s=>s.text),i=this.compactionQueuedMessages.filter(s=>s.mode==="followUp").map(s=>s.text);return this.compactionQueuedMessages=[],{steering:[...e,...r],followUp:[...n,...i]}}updatePendingMessagesDisplay(){this.pendingMessagesContainer.clear();let{steering:e,followUp:n}=this.getAllQueuedMessages();if(e.length>0||n.length>0){this.pendingMessagesContainer.addChild(new Tt(1));for(let s of e){let o=Ee.fg("dim",`Steering: ${s}`);this.pendingMessagesContainer.addChild(new yE(o,1,0))}for(let s of n){let o=Ee.fg("dim",`Follow-up: ${s}`);this.pendingMessagesContainer.addChild(new yE(o,1,0))}let r=this.getAppKeyDisplay("app.message.dequeue"),i=Ee.fg("dim",`\u21B3 ${r} to edit all queued messages`);this.pendingMessagesContainer.addChild(new yE(i,1,0))}}restoreQueuedMessagesToEditor(e){let{steering:n,followUp:r}=this.clearAllQueues(),i=[...n,...r];if(i.length===0)return this.updatePendingMessagesDisplay(),e?.abort&&this.session.abort(),0;let s=i.join(` + +`),o=e?.currentText??this.editor.getText(),a=[s,o].filter(c=>c.trim()).join(` + +`);return this.editor.setText(a),this.updatePendingMessagesDisplay(),e?.abort&&this.session.abort(),i.length}queueCompactionMessage(e,n){this.compactionQueuedMessages.push({text:e,mode:n}),this.editor.addToHistory?.(e),this.editor.setText(""),this.updatePendingMessagesDisplay(),this.showStatus("Queued message for after compaction")}isExtensionCommand(e){if(!e.startsWith("/"))return!1;let n=this.session.extensionRunner,r=e.indexOf(" "),i=r===-1?e.slice(1):e.slice(1,r);return!!n.getCommand(i)}async flushCompactionQueue(e){if(this.compactionQueuedMessages.length===0)return;let n=[...this.compactionQueuedMessages];this.compactionQueuedMessages=[],this.updatePendingMessagesDisplay();let r=i=>{this.session.clearQueue(),this.compactionQueuedMessages=n,this.updatePendingMessagesDisplay(),this.showError(`Failed to send queued message${n.length>1?"s":""}: ${i instanceof Error?i.message:String(i)}`)};try{if(e?.willRetry){for(let u of n)this.isExtensionCommand(u.text)?await this.session.prompt(u.text):u.mode==="followUp"?await this.session.followUp(u.text):await this.session.steer(u.text);this.updatePendingMessagesDisplay();return}let i=n.findIndex(u=>!this.isExtensionCommand(u.text));if(i===-1){for(let u of n)await this.session.prompt(u.text);return}let s=n.slice(0,i),o=n[i],a=n.slice(i+1);for(let u of s)await this.session.prompt(u.text);let c=this.session.prompt(o.text,{streamingBehavior:o.mode}).catch(u=>{r(u)});for(let u of a)this.isExtensionCommand(u.text)?await this.session.prompt(u.text):u.mode==="followUp"?await this.session.followUp(u.text):await this.session.steer(u.text);this.updatePendingMessagesDisplay()}catch(i){r(i)}}flushPendingBashComponents(){for(let e of this.pendingBashComponents)this.pendingMessagesContainer.removeChild(e),this.chatContainer.addChild(e);this.pendingBashComponents=[]}disposeActiveSelector(){let e=this.activeSelectorDispose;this.activeSelectorToken=void 0,this.activeSelectorDispose=void 0,e?.()}showSelector(e){let n={},r,s=e(()=>{r?.(),this.activeSelectorToken===n&&(this.activeSelectorToken=void 0,this.activeSelectorDispose=void 0,this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.ui.setFocus(this.editor))});r=s.dispose,this.disposeActiveSelector(),this.activeSelectorToken=n,this.activeSelectorDispose=r,this.editorContainer.clear(),this.editorContainer.addChild(s.component),this.ui.setFocus(s.focus),this.ui.requestRender()}showSettingsSelector(){this.showSelector(e=>{let n,r=this.settingsManager.getDefaultProvider(),i=this.settingsManager.getDefaultModel(),s=r&&i?`${r}/${i}`:"not set";return n=new dG({autoCompact:this.session.autoCompactionEnabled,defaultModel:s,currentModel:this.session.model,availableDefaultModels:this.session.modelRuntime.getAvailableSnapshot(),showImages:this.settingsManager.getShowImages(),imageWidthCells:this.settingsManager.getImageWidthCells(),autoResizeImages:this.settingsManager.getImageAutoResize(),blockImages:this.settingsManager.getBlockImages(),enableSkillCommands:this.settingsManager.getEnableSkillCommands(),steeringMode:this.session.steeringMode,followUpMode:this.session.followUpMode,transport:this.settingsManager.getTransport(),httpIdleTimeoutMs:this.settingsManager.getHttpIdleTimeoutMs(),cacheWarmingMode:this.settingsManager.getCacheWarmingMode(),thinkingLevel:this.settingsManager.getDefaultThinkingLevel()??rh,availableThinkingLevels:[...TRe],modelThinkingLevels:this.settingsManager.getAllModelThinkingLevels(),currentTheme:this.themeController.getThemeSelection()||"dark",terminalTheme:this.themeController.getTerminalTheme(),availableThemes:WTe(),hideThinkingBlock:this.hideThinkingBlock,mermaidRenderingMode:this.settingsManager.getMermaidRenderingMode(),collapseChangelog:this.settingsManager.getCollapseChangelog(),enableInstallTelemetry:this.settingsManager.getEnableInstallTelemetry(),doubleEscapeAction:this.settingsManager.getDoubleEscapeAction(),treeFilterMode:this.settingsManager.getTreeFilterMode(),showHardwareCursor:this.settingsManager.getShowHardwareCursor(),showCacheMissNotices:this.settingsManager.getShowCacheMissNotices(),defaultProjectTrust:this.settingsManager.getDefaultProjectTrust(),editorPaddingX:this.settingsManager.getEditorPaddingX(),outputPad:this.settingsManager.getOutputPad(),autocompleteMaxVisible:this.settingsManager.getAutocompleteMaxVisible(),quietStartup:this.settingsManager.getQuietStartup(),clearOnShrink:this.settingsManager.getClearOnShrink(),showTerminalProgress:this.settingsManager.getShowTerminalProgress(),tuiMode:this.ui.mode,fullscreenExitOutput:this.settingsManager.getFullscreenExitOutput(),fullscreenScrollbar:this.settingsManager.getFullscreenScrollbar(),fullscreenCopyOnSelect:this.settingsManager.getFullscreenCopyOnSelect(),warnings:this.settingsManager.getWarnings()},{onAutoCompactChange:o=>{this.session.setAutoCompactionEnabled(o),this.footer.setAutoCompactEnabled(o)},onShowImagesChange:o=>{this.settingsManager.setShowImages(o);for(let a of this.chatContainer.children)a instanceof QS&&a.setShowImages(o)},onImageWidthCellsChange:o=>{this.settingsManager.setImageWidthCells(o);for(let a of this.chatContainer.children)a instanceof QS&&a.setImageWidthCells(o)},onAutoResizeImagesChange:o=>{this.settingsManager.setImageAutoResize(o)},onBlockImagesChange:o=>{this.settingsManager.setBlockImages(o)},onEnableSkillCommandsChange:o=>{this.settingsManager.setEnableSkillCommands(o),this.setupAutocompleteProvider()},onSteeringModeChange:o=>{this.session.setSteeringMode(o)},onFollowUpModeChange:o=>{this.session.setFollowUpMode(o)},onTransportChange:o=>{this.settingsManager.setTransport(o),this.session.agent.transport=o},onHttpIdleTimeoutMsChange:o=>{this.settingsManager.setHttpIdleTimeoutMs(o),u9(o),this.showStatus(`HTTP idle timeout: ${FDe(o)}`)},onCacheWarmingModeChange:o=>{this.session.setCacheWarmingMode(o),this.showStatus(`Cache warming: ${o}`)},onModelThinkingLevelChange:(o,a,c)=>{this.settingsManager.setModelThinkingLevel(o,a,c);let u=this.session.model;u&&u.provider===o&&u.id===a&&(this.session.setThinkingLevel(c),this.footer.invalidate(),this.updateEditorBorderColor())},onModelThinkingLevelRemove:(o,a)=>{this.settingsManager.removeModelThinkingLevel(o,a);let c=this.session.model;if(c&&c.provider===o&&c.id===a){let u=this.settingsManager.getDefaultThinkingLevel()??rh;this.session.setThinkingLevel(u),this.footer.invalidate(),this.updateEditorBorderColor()}},onThemeChange:o=>{this.settingsManager.setTheme(o),this.themeController.setThemeSetting(o)},onThemePreview:o=>this.themeController.preview(o),onHideThinkingBlockChange:o=>{this.hideThinkingBlock=o,this.settingsManager.setHideThinkingBlock(o),this.updateThinkingBlockVisibility()},onMermaidRenderingModeChange:o=>{this.settingsManager.setMermaidRenderingMode(o),this.chatContainer.invalidate(),this.ui.requestRender()},onShowCacheMissNoticesChange:o=>{this.settingsManager.setShowCacheMissNotices(o),this.rebuildChatFromMessages()},onCollapseChangelogChange:o=>{this.settingsManager.setCollapseChangelog(o)},onEnableInstallTelemetryChange:o=>{this.settingsManager.setEnableInstallTelemetry(o)},onQuietStartupChange:o=>{this.settingsManager.setQuietStartup(o)},onDefaultProjectTrustChange:o=>{this.settingsManager.setDefaultProjectTrust(o)},onDoubleEscapeActionChange:o=>{this.settingsManager.setDoubleEscapeAction(o)},onTreeFilterModeChange:o=>{this.settingsManager.setTreeFilterMode(o)},onShowHardwareCursorChange:o=>{this.settingsManager.setShowHardwareCursor(o),this.ui.setShowHardwareCursor(o)},onEditorPaddingXChange:o=>{this.settingsManager.setEditorPaddingX(o),this.defaultEditor.setPaddingX(o),this.editor!==this.defaultEditor&&this.editor.setPaddingX!==void 0&&this.editor.setPaddingX(o)},onOutputPadChange:o=>{if(this.settingsManager.setOutputPad(o),this.outputPad=o,this.streamingComponent||this.session.isStreaming){for(let a of this.chatContainer.children)(a instanceof OS||a instanceof tM||a instanceof Bk)&&a.setOutputPad(o);this.streamingComponent&&this.streamingComponent.setOutputPad(o),this.ui.requestRender();return}this.rebuildChatFromMessages()},onAutocompleteMaxVisibleChange:o=>{this.settingsManager.setAutocompleteMaxVisible(o),this.defaultEditor.setAutocompleteMaxVisible(o),this.editor!==this.defaultEditor&&this.editor.setAutocompleteMaxVisible!==void 0&&this.editor.setAutocompleteMaxVisible(o)},onClearOnShrinkChange:o=>{this.settingsManager.setClearOnShrink(o),this.ui.setClearOnShrink(o),!o&&!this.activeStatusIndicator&&this.statusContainer.clear()},onShowTerminalProgressChange:o=>{this.settingsManager.setShowTerminalProgress(o)},onTuiModeChange:o=>{if(!this.switchTuiMode(o)){n?.getSettingsList().updateValue("tui-mode",this.ui.mode),this.showStatus("Close active overlays before changing TUI mode");return}this.settingsManager.setTuiMode(o),this.activeStatusIndicator||this.statusContainer.clear(),this.showStatus(`TUI mode: ${o}`)},onFullscreenExitOutputChange:o=>{this.settingsManager.setFullscreenExitOutput(o)},onFullscreenScrollbarChange:o=>{this.settingsManager.setFullscreenScrollbar(o),this.applyFullscreenScrollbarSetting()},onFullscreenCopyOnSelectChange:o=>{this.settingsManager.setFullscreenCopyOnSelect(o),this.renderer instanceof lS&&this.renderer.setCopyOnSelect(o)},onWarningsChange:o=>{this.settingsManager.setWarnings(o)},onCancel:()=>{e(),this.ui.requestRender()}}),{component:n,focus:n.getSettingsList()}})}handleThinkingCommand(e){let n=this.session.getAvailableThinkingLevels();if(!e){this.showThinkingSelector();return}let r=e.trim().toLowerCase(),i=n.find(s=>s.toLowerCase()===r);if(!i){this.showError(`Unknown thinking level "${e}". Available levels: ${n.join(", ")}.`);return}this.selectThinkingLevel(i,!1)}selectThinkingLevel(e,n){try{this.session.setThinkingLevel(e,{persist:n}),this.footer.invalidate(),this.updateEditorBorderColor(),this.showStatus(n?`Default thinking level: ${e}`:`Thinking level: ${e}`)}catch(r){this.showError(r instanceof Error?r.message:String(r))}}showThinkingSelector(){this.showSelector(e=>{let n=(i,s)=>{this.selectThinkingLevel(i,s),e()},r=new mG(this.session.thinkingLevel??rh,this.session.getAvailableThinkingLevels(),i=>n(i,!1),()=>{e(),this.ui.requestRender()},i=>n(i,!0),this.settingsManager.getDefaultThinkingLevel()??rh);return{component:r,focus:r}})}async handleModelCommand(e){if(!e){this.showModelSelector();return}let n=await this.findExactModelMatch(e);if(n){try{await this.session.setModel(n,{persist:!1}),this.footer.invalidate(),this.updateEditorBorderColor(),this.showStatus(`Model: ${n.id}`),this.maybeWarnAboutAnthropicSubscriptionAuth(n),this.checkDaxnutsEasterEgg(n)}catch(r){this.showError(r instanceof Error?r.message:String(r))}return}this.showModelSelector(e)}async findExactModelMatch(e){let n=this.session.scopedModels.length>0?this.session.scopedModels.map(a=>a.model):[...this.session.modelRuntime.getAvailableSnapshot()],r=aoe(e,n);if(r||this.session.scopedModels.length>0)return r;this.showStatus("Refreshing model catalogs\u2026");let i=new AbortController,s=!1,o=setTimeout(()=>{s=!0,i.abort()},15e3);try{let a=await I9(this.session.modelRuntime,i.signal);a.aborted&&s?this.showWarning("Model refresh timed out; searching cached models."):a.errors.size>0&&this.showWarning(`Could not refresh ${[...a.errors.keys()].join(", ")}; searching cached models.`)}catch(a){this.showWarning(s?"Model refresh timed out; searching cached models.":`Could not refresh model catalogs: ${a instanceof Error?a.message:String(a)}`)}finally{clearTimeout(o)}return aoe(e,[...this.session.modelRuntime.getAvailableSnapshot()])}updateAvailableProviderCount(){let e=this.session.scopedModels.length>0?this.session.scopedModels.map(r=>r.model):this.session.modelRuntime.getAvailableSnapshot(),n=new Set(e.map(r=>r.provider));this.footerDataProvider.setAvailableProviderCount(n.size)}async maybeWarnAboutAnthropicSubscriptionAuth(e=this.session.model){if(this.settingsManager.getWarnings().anthropicExtraUsage!==!1&&!this.anthropicSubscriptionWarningShown&&!(!e||e.provider!=="anthropic"))try{if((await this.session.modelRuntime.checkAuth("anthropic"))?.type==="oauth"){this.anthropicSubscriptionWarningShown=!0,this.showWarning(mor);return}let n=(await this.session.modelRuntime.getAuth(e.provider))?.auth.apiKey;if(!Xys(n))return;this.anthropicSubscriptionWarningShown=!0,this.showWarning(mor)}catch{}}maybeSaveImplicitProjectTrustAfterReload(){let e=this.sessionManager.getCwd();if(this.autoTrustOnReloadCwd!==e||!this.settingsManager.isProjectTrusted()||!t_(e))return!1;let n=new MS(this.runtimeHost.services.agentDir);try{return n.get(e)!==null?(this.autoTrustOnReloadCwd=void 0,!1):(n.set(e,!0),this.autoTrustOnReloadCwd=void 0,!0)}catch(r){return this.showWarning(`Could not save project trust after reload: ${r instanceof Error?r.message:String(r)}`),!1}}showTrustSelector(){let e=this.sessionManager.getCwd(),n=new MS(this.runtimeHost.services.agentDir),r=n.getEntry(e);this.showSelector(i=>{let s=new uce({cwd:e,savedDecision:r,projectTrusted:this.settingsManager.isProjectTrusted(),onSelect:o=>{n.setMany(o.updates),i(),this.showStatus(`Saved trust decision: ${o.trusted?"trusted":"untrusted"}. Restart ${hn} for this to take effect.`)},onCancel:()=>{i(),this.ui.requestRender()}});return{component:s,focus:s}})}showModelSelector(e){this.showSelector(n=>{let r=async(a,c)=>{try{await this.session.setModel(a,{persist:c}),this.updateAvailableProviderCount(),this.footer.invalidate(),this.updateEditorBorderColor(),n(),this.showStatus(c?`Default model: ${a.provider}/${a.id}`:`Model: ${a.id}`),this.maybeWarnAboutAnthropicSubscriptionAuth(a),this.checkDaxnutsEasterEgg(a)}catch(u){n(),this.showError(u instanceof Error?u.message:String(u))}},i=this.settingsManager.getDefaultProvider(),s=this.settingsManager.getDefaultModel(),o=new uG(this.ui,this.session.model,this.session.modelRuntime,this.session.scopedModels,a=>r(a,!1),()=>{n(),this.ui.requestRender()},e,a=>r(a,!0),i&&s?{provider:i,id:s}:void 0);return{component:o,focus:o,dispose:()=>o.dispose()}})}showModelsSelector(){let e=[...this.session.modelRuntime.getAvailableSnapshot()],n=new Set(e.map(u=>`${u.provider}/${u.id}`)),r=this.settingsManager.getEnabledModels(),i=this.session.scopedModels,s=u=>{if(!r?.length)return null;let l=iBe(r,u),d=l.scopedModels.map(m=>`${m.model.provider}/${m.model.id}`);for(let m of l.diagnostics)m.code==="no-match"&&!d.includes(m.pattern)&&d.push(m.pattern);return d},o=i.length>0?i.map(u=>`${u.model.provider}/${u.model.id}`):s(e),a=!1,c=u=>{o=u===null?null:[...u];let l=u?.some(m=>n.has(m))??!1,d=u!==null&&[...n].every(m=>u.includes(m));if(u&&l&&!d){let m=iBe(u,e).scopedModels;this.session.setScopedModels(m.map(h=>({model:h.model,thinkingLevel:h.thinkingLevel})))}else this.session.setScopedModels([]);this.updateAvailableProviderCount(),this.ui.requestRender()};this.showSelector(u=>{let l=!1,d=!1,m=new AbortController,h=setTimeout(()=>{d=!0,m.abort()},15e3),f=new sce({allModels:e,enabledModelIds:o,refreshStatus:"Refreshing model catalogs\u2026"},{onChange:g=>{a=!0,c(g)},onPersist:g=>{let A=g!==null&&g.length===e.length&&g.every(E=>n.has(E)),y=g===null||A?void 0:g;this.settingsManager.setEnabledModels(y?[...y]:void 0),this.showStatus("Model selection saved to settings")},onCancel:()=>{u(),this.ui.requestRender()}});return I9(this.session.modelRuntime,m.signal).then(g=>{l||(e=[...this.session.modelRuntime.getAvailableSnapshot()],n=new Set(e.map(A=>`${A.provider}/${A.id}`)),!a&&i.length===0?(o=s(e),f.updateModels(e,o)):f.updateModels(e),o!==null&&c(o),g.aborted&&d?f.setRefreshStatus("Model refresh timed out; showing cached models.","warning"):g.errors.size>0?f.setRefreshStatus(`Could not refresh ${[...g.errors.keys()].join(", ")}; showing cached models.`,"warning"):f.setRefreshStatus("Model catalogs refreshed.","success"),this.ui.requestRender())}).catch(g=>{l||(f.setRefreshStatus(d?"Model refresh timed out; showing cached models.":`Could not refresh model catalogs: ${g instanceof Error?g.message:String(g)}`,"warning"),this.ui.requestRender())}).finally(()=>clearTimeout(h)),{component:f,focus:f,dispose:()=>{l=!0,clearTimeout(h),m.abort()}}})}showUserMessageSelector(){let e=this.session.getUserMessagesForForking();if(e.length===0){this.showStatus("No messages to fork from");return}let n=e[e.length-1]?.entryId;this.showSelector(r=>{let i=new fG(e.map(s=>({id:s.entryId,text:s.text})),async s=>{r();try{let o=await this.runtimeHost.fork(s);if(o.cancelled){this.ui.requestRender();return}this.editor.setText(o.selectedText??""),this.showStatus("Forked to new session")}catch(o){this.showError(o instanceof Error?o.message:String(o))}},()=>{r(),this.ui.requestRender()},n);return{component:i,focus:i.getMessageList()}})}async handleCloneCommand(){let e=this.sessionManager.getLeafId();if(!e){this.showStatus("Nothing to clone yet");return}try{if((await this.runtimeHost.fork(e,{position:"at"})).cancelled){this.ui.requestRender();return}this.editor.setText(""),this.showStatus("Cloned to new session")}catch(n){this.showError(n instanceof Error?n.message:String(n))}}showTreeSelector(e){let n=this.sessionManager.getTree(),r=this.sessionManager.getLeafId(),i=this.settingsManager.getTreeFilterMode();if(n.length===0){this.showStatus("No entries in session");return}this.showSelector(s=>{let o=new hG(n,r,this.ui.terminal.rows,async a=>{if(a===this.sessionManager.getLeafId()){s(),this.showStatus("Already at this point");return}s();let c=!1,u;if(!this.settingsManager.getBranchSummarySkipPrompt())for(;;){let m=await this.showExtensionSelector("Summarize branch?",["No summary","Summarize","Summarize with custom prompt"]);if(m===void 0){this.showTreeSelector(a);return}if(c=m!=="No summary",!(m==="Summarize with custom prompt"&&(u=await this.showExtensionEditor("Custom summarization instructions"),u===void 0)))break}if(this.session.isStreaming&&(this.restoreQueuedMessagesToEditor(),await this.session.abort()),this.session.isCompacting){this.showError("Wait for the current compaction or tree navigation to finish before navigating the session tree.");return}let l=!1,d=this.defaultEditor.onEscape;c&&(this.defaultEditor.onEscape=()=>{this.session.abortBranchSummary()},this.chatContainer.addChild(new Tt(1)),this.showStatusIndicator(new lce(this.ui)),l=!0,this.ui.requestRender());try{let m=await this.session.navigateTree(a,{summarize:c,customInstructions:u});if(m.aborted){this.showStatus("Branch summarization cancelled"),this.showTreeSelector(a);return}if(m.cancelled){this.showStatus("Navigation cancelled");return}this.chatContainer.clear(),this.renderInitialMessages(),m.editorText&&!this.editor.getText().trim()&&this.editor.setText(m.editorText),this.showStatus("Navigated to selected point"),this.flushCompactionQueue({willRetry:!1})}catch(m){this.showError(m instanceof Error?m.message:String(m))}finally{l&&this.clearStatusIndicator("branchSummary"),this.defaultEditor.onEscape=d}},()=>{s(),this.ui.requestRender()},(a,c)=>{this.sessionManager.appendLabelChange(a,c),this.ui.requestRender()},e,i);return o.onCopy=async a=>{if(!a){this.showError("Selected entry has no text to copy");return}try{await XU(a),this.showStatus("Copied selected message to clipboard")}catch(c){this.showError(c instanceof Error?c.message:String(c))}},{component:o,focus:o}})}showSessionSelector(){this.showSelector(e=>{let n=new xk((r,i)=>Js.list(this.sessionManager.getCwd(),this.sessionManager.getSessionDir(),r,i),(r,i)=>this.sessionManager.usesDefaultSessionDir()?Js.listAll(r,i):Js.listAll(this.sessionManager.getSessionDir(),r,i),async r=>{e(),await this.handleResumeSession(r)},()=>{e(),this.ui.requestRender()},()=>{this.shutdown()},()=>this.ui.requestRender(),{renameSession:async(r,i)=>{let s=(i??"").trim();if(!s)return;Js.open(r).appendSessionInfo(s)},showRenameHint:!0,keybindings:this.keybindings},this.sessionManager.getSessionFile());return{component:n,focus:n}})}async handleResumeSession(e,n){this.clearStatusIndicator();try{let r=await this.runtimeHost.switchSession(e,{withSession:n?.withSession,projectTrustContextFactory:i=>this.createProjectTrustContext(i)});return r.cancelled||this.showStatus("Resumed session"),r}catch(r){if(r instanceof VP){let i=await this.promptForMissingSessionCwd(r);if(!i)return this.showStatus("Resume cancelled"),{cancelled:!0};let s=await this.runtimeHost.switchSession(e,{cwdOverride:i,withSession:n?.withSession,projectTrustContextFactory:o=>this.createProjectTrustContext(o)});return s.cancelled||this.showStatus("Resumed session in current cwd"),s}return this.handleFatalRuntimeError("Failed to resume session",r)}}getLoginProviderOptions(e){let n=[];for(let r of this.session.modelRuntime.getProviders()){let i=this.session.modelRuntime.getProviderAuthStatus(r.id),s=i.configured?{type:this.session.modelRuntime.isUsingOAuth(r.id)?"oauth":"api_key",source:i.label??i.source}:void 0;(!e||e==="oauth")&&r.auth.oauth&&n.push({id:r.id,name:r.name,authType:"oauth",method:r.auth.oauth,status:s}),(!e||e==="api_key")&&r.auth.apiKey&&n.push({id:r.id,name:r.name,authType:"api_key",method:r.auth.apiKey,status:s})}return n.sort((r,i)=>r.name.localeCompare(i.name))}async getLogoutProviderOptions(){return(await this.session.modelRuntime.listCredentials({signal:AbortSignal.timeout(15e3)})).map(({providerId:e,type:n})=>({id:e,name:this.session.modelRuntime.getProvider(e)?.name??e,authType:n,status:{type:n,source:"stored credential"}})).sort((e,n)=>e.name.localeCompare(n.name))}findLoginProviderOptions(e){let n=e.trim().toLowerCase();return n?this.getLoginProviderOptions().filter(r=>r.id.toLowerCase()===n||r.name.toLowerCase()===n):[]}async handleLoginCommand(e){if(!e){this.showLoginAuthTypeSelector();return}let n=this.findLoginProviderOptions(e);if(n.length===1){await this.startProviderLogin(n[0]);return}if(n.length>1&&new Set(n.map(i=>i.id)).size===1){this.showLoginAuthTypeSelector(n);return}this.showLoginProviderSelector(void 0,e)}async startProviderLogin(e){e.authType==="oauth"?await this.showLoginDialog(e.id,e.name):e.method?.login?await this.showApiKeyLoginDialog(e.id,e.name):this.showAmbientAuthDialog(e)}showLoginAuthTypeSelector(e){let n=e?.find(u=>u.authType==="oauth"),i=(n?.method&&"loginLabel"in n.method?n.method.loginLabel:void 0)??"Sign in with an account",s="Sign in with an API key",o=e?new Set(e.map(u=>u.authType)):new Set(["oauth","api_key"]),a=[];if(o.has("oauth")&&a.push(i),o.has("api_key")&&a.push(s),a.length===0){this.showStatus("No login methods available.");return}if(e&&a.length===1){let u=e[0];u&&this.startProviderLogin(u);return}let c=e?.[0]?`Select authentication method for ${e[0].name}:`:"Select authentication method:";this.showSelector(u=>{let l=new WE(c,a,d=>{u();let m=d===i?"oauth":"api_key";if(e){let h=e.find(f=>f.authType===m);h&&this.startProviderLogin(h);return}this.showLoginProviderSelector(m)},()=>{u(),this.ui.requestRender()});return{component:l,focus:l}})}showLoginProviderSelector(e,n){let r=this.getLoginProviderOptions(e);if(r.length===0){let i=e==="oauth"?"No subscription providers available.":e==="api_key"?"No API key providers available.":"No login providers available.";this.showStatus(i);return}this.showSelector(i=>{let s=new iM("login",r,async(o,a)=>{i();let c=r.find(u=>u.id===o&&u.authType===a);c&&await this.startProviderLogin(c)},()=>{i(),e?this.showLoginAuthTypeSelector():this.ui.requestRender()},n);return{component:s,focus:s}})}async showOAuthSelector(e){if(e==="login"){this.showLoginAuthTypeSelector();return}let n;try{n=await this.getLogoutProviderOptions()}catch(r){this.showError(`Could not read stored credentials: ${r instanceof Error?r.message:String(r)}`);return}if(n.length===0){this.showStatus("No stored credentials to remove. /logout only removes credentials saved by /login; environment variables and models.json config are unchanged.");return}this.showSelector(r=>{let i=new iM(e,n,async s=>{r();let o=n.find(a=>a.id===s);if(o)try{await this.session.modelRuntime.logout(o.id,{signal:AbortSignal.timeout(15e3)}),await this.updateAvailableProviderCount();let a=o.authType==="oauth"?`Logged out of ${o.name}`:`Removed stored API key for ${o.name}. Environment variables and models.json config are unchanged.`;this.showStatus(a)}catch(a){let c=a instanceof Error?a.message:String(a);this.showError(a instanceof SS?`Credentials removed for ${o.name}, but local model state could not be synchronized: ${c}`:`Logout failed: ${c}`)}},()=>{r(),this.ui.requestRender()});return{component:i,focus:i}})}async completeProviderAuthentication(e,n,r,i){let s=r==="oauth"?`Logged in to ${n}`:`Saved API key for ${n}`,o=this.session,a=hor(i)&&gor(e)&&!o.modelRuntime.getAvailableSnapshot().some(d=>d.provider===e&&d.id===ZQ[e]),c=async()=>{let d,m;if(hor(i)){let f=this.session.modelRuntime.getAvailableSnapshot().filter(g=>g.provider===e);if(e==="llama.cpp")m=tEs(s,f.length);else if(!gor(e))m=`${s}, but no default model is configured for provider "${e}". Use /model to select a model.`;else if(f.length===0)m=`${s}, but no models are available for that provider. Use /model to select a model.`;else{let g=ZQ[e];if(d=f.find(A=>A.id===g)??(e==="radius"?f[0]:void 0),!d)m=`${s}, but its default model "${g}" is not available. Use /model to select a model.`;else try{await this.session.setModel(d,{persist:!0})}catch(A){d=void 0;let y=A instanceof Error?A.message:String(A);m=`${s}, but selecting its default model failed: ${y}. Use /model to select a model.`}}}await this.updateAvailableProviderCount(),this.footer.invalidate(),this.updateEditorBorderColor(),d?(this.showStatus(`${s}. Selected ${d.id}. Credentials saved to ${Lwe()}`),this.maybeWarnAboutAnthropicSubscriptionAuth(d),this.checkDaxnutsEasterEgg(d)):(this.showStatus(`${s}. Credentials saved to ${Lwe()}`),m?this.showError(m):this.maybeWarnAboutAnthropicSubscriptionAuth())};a?this.showStatus(`${s}. Credentials saved to ${Lwe()}. Refreshing model catalog\u2026`):await c();let u=new AbortController,l=setTimeout(()=>u.abort(),15e3);o.modelRuntime.refresh({providers:[e],signal:u.signal}).then(async d=>{d.aborted?this.showWarning(`${s}, but its model catalog refresh timed out; using cached models.`):d.errors.size>0&&this.showWarning(`${s}, but its model catalog could not be refreshed; using cached models.`),a&&this.session===o&&o.model===i&&await c(),this.updateAvailableProviderCount(),this.footer.invalidate(),this.ui.requestRender()}).catch(d=>{this.showWarning(`${s}, but its model catalog could not be refreshed: ${d instanceof Error?d.message:String(d)}`)}).finally(()=>clearTimeout(l))}showAmbientAuthDialog(e){let n=()=>{this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.ui.setFocus(this.editor),this.ui.requestRender()},r=new Ik(this.ui,e.id,()=>n(),e.name,`${e.name} setup`);r.showInfo(`${e.method?.name??"Authentication"} is configured outside ${hn}.`,[],!0),this.editorContainer.clear(),this.editorContainer.addChild(r),this.ui.setFocus(r),this.ui.requestRender()}async showApiKeyLoginDialog(e,n){let r=this.session.model,i=new Ik(this.ui,e,(o,a)=>{},n);e==="amazon-bedrock"&&i.showDetails([Ee.fg("text","You can also use an AWS profile, IAM keys, or role-based credentials."),Ee.fg("muted","See:"),Ee.fg("accent",` ${uu.join(IR(),"providers.md")}`)]),this.editorContainer.clear(),this.editorContainer.addChild(i),this.ui.setFocus(i),this.ui.requestRender();let s=()=>{this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.ui.setFocus(this.editor),this.ui.requestRender()};try{await this.loginProvider(i,e,"api_key"),s(),await this.completeProviderAuthentication(e,n,"api_key",r)}catch(o){s();let a=o instanceof Error?o.message:String(o);o instanceof SS?this.showError(`Saved API key for ${n}, but local model state could not be synchronized: ${a}`):a!=="Login cancelled"&&this.showError(`Failed to save API key for ${n}: ${a}`)}}showAuthSelect(e,n){return new Promise((r,i)=>{let s=()=>{this.editorContainer.clear(),this.editorContainer.addChild(e),this.ui.setFocus(e),this.ui.requestRender()},o=n.options.map(c=>c.label),a=new WE(n.message,o,c=>{s();let u=n.options.find(l=>l.label===c)?.id;u?r(u):i(new Error("Login cancelled"))},()=>{s(),i(new Error("Login cancelled"))});this.editorContainer.clear(),this.editorContainer.addChild(a),this.ui.setFocus(a),this.ui.requestRender()})}async showAuthPrompt(e,n){let r;if(n.type==="select"?r=this.showAuthSelect(e,n):n.type==="manual_code"?r=e.showManualInput(n.message):r=e.showPrompt(n.message,n.placeholder),!n.signal)return r;if(n.signal.aborted)throw new Error("Login cancelled");let i=n.signal,s,o=new Promise((a,c)=>{s=()=>c(new Error("Login cancelled")),i.addEventListener("abort",s,{once:!0})});try{return await Promise.race([r,o])}finally{s&&i.removeEventListener("abort",s)}}notifyAuthDialog(e,n){n.type==="auth_url"?e.showAuth(n.url,n.instructions):n.type==="device_code"?(e.showDeviceCode(n),e.showWaiting("Waiting for authentication...")):n.type==="info"?e.showInfo(n.message,n.links):e.showProgress(n.message)}async loginProvider(e,n,r){await this.session.modelRuntime.login(n,r,{signal:e.signal,prompt:i=>this.showAuthPrompt(e,i),notify:i=>this.notifyAuthDialog(e,i)})}async showLoginDialog(e,n){let r=this.session.model,i=new Ik(this.ui,e,(o,a)=>{},n);this.editorContainer.clear(),this.editorContainer.addChild(i),this.ui.setFocus(i),this.ui.requestRender();let s=()=>{this.editorContainer.clear(),this.editorContainer.addChild(this.editor),this.ui.setFocus(this.editor),this.ui.requestRender()};try{await this.loginProvider(i,e,"oauth"),s(),await this.completeProviderAuthentication(e,n,"oauth",r)}catch(o){s();let a=o instanceof Error?o.message:String(o);o instanceof SS?this.showError(`Logged in to ${n}, but local model state could not be synchronized: ${a}`):a!=="Login cancelled"&&this.showError(`Failed to login to ${n}: ${a}`)}}async handleReloadCommand(){if(this.session.isStreaming){this.showWarning("Wait for the current response to finish before reloading.");return}if(this.session.isCompacting){this.showWarning("Wait for compaction to finish before reloading.");return}this.resetExtensionUI();let e=new gn,n=c=>Ee.fg("border",c);e.addChild(new Un(n)),e.addChild(new Tt(1)),e.addChild(new Et(Ee.fg("muted","Reloading keybindings, extensions, skills, prompts, themes, and context files..."),1,0)),e.addChild(new Tt(1)),e.addChild(new Un(n));let r=this.editor;this.editorContainer.clear(),this.editorContainer.addChild(e),this.ui.setFocus(e),this.ui.requestRender(!0),await new Promise(c=>process.nextTick(c));let i=c=>{this.editorContainer.clear(),this.editorContainer.addChild(c),this.ui.setFocus(c),this.ui.requestRender()},s=!1,o=!1,a=()=>{s||(this.hideThinkingBlock=this.settingsManager.getHideThinkingBlock(),this.outputPad=this.settingsManager.getOutputPad(),this.rebuildChatFromMessages(),s=!0)};try{await this.session.reload({beforeSessionStart:a}),a(),this.keybindings.reload();let c=this.customHeader??this.builtInHeader;dce(c)&&c.setExpanded(this.toolOutputExpanded),Sj(this.session.resourceLoader.getThemes().themes),this.applyRuntimeSettings(),await this.themeController.applyFromSettings(),this.setupAutocompleteProvider();let u=this.session.extensionRunner;this.setupExtensionShortcuts(u),this.showLoadedResources({force:!1,showDiagnosticsWhenQuiet:!0});let l=this.maybeSaveImplicitProjectTrustAfterReload(),d=this.session.modelRuntime.getError();d&&this.showError(`models.json error: ${d}`),this.showStatus(l?"Reloaded keybindings, extensions, skills, prompts, themes, and context files; saved project trust":"Reloaded keybindings, extensions, skills, prompts, themes, and context files"),i(this.editor),o=!0}catch(c){o||i(r),this.showError(`Reload failed: ${c instanceof Error?c.message:String(c)}`)}}async handleExportCommand(e){let n=this.getPathCommandArgument(e,"/export");try{if(n?.endsWith(".jsonl")){let r=this.session.exportToJsonl(n);this.showStatus(`Session exported to: ${r}`)}else{let r=await this.session.exportToHtml(n,{themeName:Ee.name});this.showStatus(`Session exported to: ${r}`)}}catch(r){this.showError(`Failed to export session: ${r instanceof Error?r.message:"Unknown error"}`)}}getPathCommandArgument(e,n){if(e===n||!e.startsWith(`${n} `))return;let r=e.slice(n.length+1).trimStart();if(!r)return;let i=r[0];if(i==='"'||i==="'"){let o=r.indexOf(i,1);return o<0?void 0:r.slice(1,o)}let s=r.search(/\s/);return s<0?r:r.slice(0,s)}async handleImportCommand(e){let n=this.getPathCommandArgument(e,"/import");if(!n){this.showError("Usage: /import ");return}if(!await this.showExtensionConfirm("Import session",`Replace current session with ${n}?`)){this.showStatus("Import cancelled");return}try{if(this.clearStatusIndicator(),(await this.runtimeHost.importFromJsonl(n)).cancelled){this.showStatus("Import cancelled");return}this.showStatus(`Session imported from: ${n}`)}catch(i){if(i instanceof VP){let s=await this.promptForMissingSessionCwd(i);if(!s){this.showStatus("Import cancelled");return}if((await this.runtimeHost.importFromJsonl(n,s)).cancelled){this.showStatus("Import cancelled");return}this.showStatus(`Session imported from: ${n}`);return}if(i instanceof Lae){this.showError(`Failed to import session: ${i.message}`);return}await this.handleFatalRuntimeError("Failed to import session",i)}}async handleShareCommand(){await Gir({session:this.session,ui:this.ui,editorContainer:this.editorContainer,editor:this.editor,showStatus:e=>this.showStatus(e),showError:e=>this.showError(e)})}async handleBugCommand(e){await Wir({session:this.session,ui:this.ui,editorContainer:this.editorContainer,editor:this.editor,keybindings:this.keybindings,showStatus:n=>this.showStatus(n),showError:n=>this.showError(n)},e)}async handleCopyCommand(e={}){if(e.preferSelection&&this.ui instanceof lS&&!this.ui.getCopyOnSelect()&&this.ui.hasActiveSelection()){await this.ui.copyActiveSelectionToClipboard();return}let n=this.session.getLastAssistantText();if(!n){this.showError("No agent messages to copy yet.");return}try{await XU(n),e.flashConfirmation&&this.ui instanceof lS?this.ui.flash("Copied!"):this.showStatus("Copied last agent message to clipboard")}catch(r){this.showError(r instanceof Error?r.message:String(r))}}handleNameCommand(e){let n=e.replace(/^\/name\s*/,"").trim();if(!n){let i=this.sessionManager.getSessionName();i?(this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(Ee.fg("dim",`Session name: ${i}`),1,0))):this.showWarning("Usage: /name "),this.ui.requestRender();return}this.session.setSessionName(n);let r=this.sessionManager.getSessionName();r!==n&&this.showWarning(`Session name was normalized from ${JSON.stringify(n)} to ${JSON.stringify(r)}`),this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(Ee.fg("dim",`Session name set: ${r??n}`),1,0)),this.ui.requestRender()}handleSessionCommand(){let e=this.session.getSessionStats(),n=this.sessionManager.getSessionName(),r=this.sessionManager.getEntries(),i=sir(r,this.session.modelRuntime),s=g8n(r),o=`${Ee.bold("Session Info")} + +`;n&&(o+=`${Ee.fg("dim","Name:")} ${n} +`),o+=`${Ee.fg("dim","File:")} ${e.sessionFile??"In-memory"} +`,o+=`${Ee.fg("dim","ID:")} ${e.sessionId} + +`,o+=`${Ee.bold("Messages")} +`,o+=`${Ee.fg("dim","Total:")} ${e.totalMessages} +`,o+=`${Ee.fg("dim","User:")} ${e.userMessages} +`,o+=`${Ee.fg("dim","Assistant:")} ${e.assistantMessages} +`,o+=`${Ee.fg("dim","Tools:")} ${e.toolCalls} calls, ${e.toolResults} results + +`,o+=`${Ee.bold("Tokens")} +`;let{input:a,cacheRead:c,cacheWrite:u}=e.tokens,l=a+c+u;if(o+=`${Ee.fg("dim","Input:")} ${l.toLocaleString()} +`,l>0&&(c>0||u>0)){let h=Ee.fg("dim",`(${(c/l*100).toFixed(1)}%)`);o+=` ${Ee.fg("dim","Cached:")} ${c.toLocaleString()} ${h} +`;let f=u>0?` ${Ee.fg("dim",`(${u.toLocaleString()} written to cache)`)}`:"";o+=` ${Ee.fg("dim","Uncached:")} ${(a+u).toLocaleString()}${f} +`}o+=`${Ee.fg("dim","Output:")} ${e.tokens.output.toLocaleString()} +`,o+=`${Ee.fg("dim","Total:")} ${e.tokens.total.toLocaleString()} +`;let d=this.session.cacheWarmingStatus;o+=` +${Ee.bold("Cache Warming")} +`,o+=`${Ee.fg("dim","Mode:")} ${this.settingsManager.getCacheWarmingMode()} +`,o+=`${Ee.fg("dim","Status:")} ${d?Unr(d):"Inactive (cache warming unavailable)"} +`;let m=d?.decision;if(m?.economicsAvailable&&(o+=`${Ee.fg("dim","Cache miss penalty:")} $${m.missCost.toFixed(3)} +`,o+=`${Ee.fg("dim","Refresh cost:")} $${m.warmCost.toFixed(3)} +`),e.cost>0||i.missedTokens>0){if(o+=` +${Ee.bold("Cost")} +`,o+=`${Ee.fg("dim","Total:")} $${e.cost.toFixed(3)}`,s.length>1)for(let h of s)o+=` + ${Ee.fg("dim",`${h.key}:`)} $${h.cost.toFixed(3)} ${Ee.fg("dim",`(${Xw(h.tokens)} tokens)`)}`;if(i.missedTokens>0){let h=i.missCount===1?"1 miss":`${i.missCount} misses`,f=`${i.missedTokens.toLocaleString()} tokens, ${h}`;o+=i.missedCost>=1e-4?` +${Ee.fg("dim","Cache Re-billed:")} $${i.missedCost.toFixed(3)} ${Ee.fg("dim",`(${f})`)}`:` +${Ee.fg("dim","Cache Re-billed:")} ${f}`}}this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(o,1,0)),this.ui.requestRender()}handleChangelogCommand(){let e=Pwe(),n=j0t(e),r=n.length>0?n.reverse().map(i=>q0t(i.content,i)).join(` + +`):"No changelog entries found.";this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Un),this.chatContainer.addChild(new Et(Ee.bold(Ee.fg("accent","What's New")),1,0)),this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Pl(r,1,1,this.getMarkdownThemeWithSettings())),this.chatContainer.addChild(new Un),this.ui.requestRender()}getAppKeyDisplay(e){return qc(e)}getEditorKeyDisplay(e){return qc(e)}handleHotkeysCommand(){let e=this.getEditorKeyDisplay("tui.editor.cursorUp"),n=this.getEditorKeyDisplay("tui.editor.cursorDown"),r=this.getEditorKeyDisplay("tui.editor.cursorLeft"),i=this.getEditorKeyDisplay("tui.editor.cursorRight"),s=this.getEditorKeyDisplay("tui.editor.cursorWordLeft"),o=this.getEditorKeyDisplay("tui.editor.cursorWordRight"),a=this.getEditorKeyDisplay("tui.editor.cursorLineStart"),c=this.getEditorKeyDisplay("tui.editor.cursorLineEnd"),u=this.getEditorKeyDisplay("tui.editor.jumpForward"),l=this.getEditorKeyDisplay("tui.editor.jumpBackward"),d=this.getEditorKeyDisplay("tui.editor.pageUp"),m=this.getEditorKeyDisplay("tui.editor.pageDown"),h=this.getEditorKeyDisplay("tui.input.submit"),f=this.getEditorKeyDisplay("tui.input.newLine"),g=this.getEditorKeyDisplay("tui.editor.deleteWordBackward"),A=this.getEditorKeyDisplay("tui.editor.deleteWordForward"),y=this.getEditorKeyDisplay("tui.editor.deleteToLineStart"),E=this.getEditorKeyDisplay("tui.editor.deleteToLineEnd"),_=this.getEditorKeyDisplay("tui.editor.yank"),S=this.getEditorKeyDisplay("tui.editor.yankPop"),C=this.getEditorKeyDisplay("tui.editor.undo"),I=this.getEditorKeyDisplay("tui.input.tab"),w=this.getAppKeyDisplay("app.interrupt"),k=this.getAppKeyDisplay("app.clear"),N=this.getAppKeyDisplay("app.exit"),O=this.getAppKeyDisplay("app.suspend"),W=this.getAppKeyDisplay("app.thinking.cycle"),$=this.getAppKeyDisplay("app.model.cycleForward"),G=this.getAppKeyDisplay("app.model.select"),q=this.getAppKeyDisplay("app.tools.expand"),ce=this.getAppKeyDisplay("app.thinking.toggle"),Y=this.getAppKeyDisplay("app.editor.external"),z=this.getAppKeyDisplay("app.model.cycleBackward"),j=this.getAppKeyDisplay("app.message.copy"),se=this.getAppKeyDisplay("app.message.followUp"),Ae=this.getAppKeyDisplay("app.message.dequeue"),De=this.getAppKeyDisplay("app.clipboard.pasteImage"),Pe=` **Navigation** | Key | Action | |-----|--------| -| \`${e}\` / \`${n}\` / \`${r}\` / \`${s}\` | Move cursor / browse history | -| \`${i}\` / \`${o}\` | Move by word | +| \`${e}\` / \`${n}\` / \`${r}\` / \`${i}\` | Move cursor / browse history | +| \`${s}\` / \`${o}\` | Move by word | | \`${a}\` | Start of line | | \`${c}\` | End of line | | \`${u}\` | Jump forward to character | | \`${l}\` | Jump backward to character | -| \`${d}\` / \`${h}\` | Scroll by page | +| \`${d}\` / \`${m}\` | Scroll by page | **Editing** | Key | Action | |-----|--------| -| \`${m}\` | Send message | +| \`${h}\` | Send message | | \`${f}\` | New line${process.platform==="win32"?" (Ctrl+Enter on Windows Terminal)":""} | | \`${g}\` | Delete word backwards | | \`${A}\` | Delete word forwards | | \`${y}\` | Delete to start of line | -| \`${b}\` | Delete to end of line | -| \`${S}\` | Paste the most-recently-deleted text | -| \`${C}\` | Cycle through the deleted text after pasting | -| \`${I}\` | Undo | +| \`${E}\` | Delete to end of line | +| \`${_}\` | Paste the most-recently-deleted text | +| \`${S}\` | Cycle through the deleted text after pasting | +| \`${C}\` | Undo | **Other** | Key | Action | |-----|--------| -| \`${x}\` | Path completion / accept autocomplete | +| \`${I}\` | Path completion / accept autocomplete | | \`${w}\` | Cancel autocomplete / abort streaming | -| \`${R}\` | Clear editor (first) / exit (second) | +| \`${k}\` | Clear editor (first) / exit (second) | | \`${N}\` | Exit (when editor is empty) | -| \`${P}\` | Suspend to background | -| \`${G}\` | Cycle thinking level | -| \`${$}\` / \`${Z}\` | Cycle models | -| \`${Q}\` | Open model selector | -| \`${H}\` | Toggle tool output expansion | -| \`${oe}\` | Toggle thinking block visibility | -| \`${re}\` | Edit message in external editor | -| \`${q}\` | Copy last assistant message | -| \`${ce}\` | Queue follow-up message | -| \`${be}\` | Restore queued messages | -| \`${Be}\` | Paste image or text from clipboard | +| \`${O}\` | Suspend to background | +| \`${W}\` | Cycle thinking level | +| \`${$}\` / \`${z}\` | Cycle models | +| \`${G}\` | Open model selector | +| \`${q}\` | Toggle tool output expansion | +| \`${ce}\` | Toggle thinking block visibility | +| \`${Y}\` | Edit message in external editor | +| \`${j}\` | Copy selection or last assistant message | +| \`${se}\` | Queue follow-up message | +| \`${Ae}\` | Restore queued messages | +| \`${De}\` | Paste image or text from clipboard | | \`/\` | Slash commands | | \`!\` | Run bash command | | \`!!\` | Run bash command (excluded from context) | -`,se=this.session.extensionRunner.getShortcuts(this.keybindings.getEffectiveConfig());if(se.size>0){Me+=` +`,ie=this.session.extensionRunner.getShortcuts(this.keybindings.getEffectiveConfig());if(ie.size>0){Pe+=` **Extensions** | Key | Action | |-----|--------| -`;for(let[ie,ne]of se){let J=ne.description??ne.extensionPath,te=mL(ie,{capitalize:!0});Me+=`| \`${te}\` | ${J} | -`}}this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new Ln),this.chatContainer.addChild(new yt(Se.bold(Se.fg("accent","Keyboard Shortcuts")),1,0)),this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new Hc(Me.trim(),1,1,this.getMarkdownThemeWithSettings())),this.chatContainer.addChild(new Ln),this.ui.requestRender()}async handleClearCommand(){this.clearStatusIndicator();try{if((await this.runtimeHost.newSession()).cancelled)return;this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(`${Se.fg("accent","\u2713 New session started")}`,1,1)),this.ui.requestRender()}catch(e){await this.handleFatalRuntimeError("Failed to create session",e)}}handleDebugCommand(){let e=this.ui.terminal.columns,n=this.ui.terminal.rows,r=this.ui.render(e),s=Arn(),i=[`Debug output at ${new Date().toISOString()}`,`Terminal: ${e}x${n}`,`Total lines: ${r.length}`,"","=== All rendered lines with visible widths ===",...r.map((o,a)=>{let c=nn(o),u=JSON.stringify(o);return`[${a}] (w=${c}) ${u}`}),"","=== Agent messages (JSONL) ===",...this.session.messages.map(o=>JSON.stringify(o)),""].join(` -`);VF.mkdirSync(bl.dirname(s),{recursive:!0}),VF.writeFileSync(s,i),this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new yt(`${Se.fg("accent","\u2713 Debug log written")} -${Se.fg("muted",s)}`,1,1)),this.ui.requestRender()}handleArminSaysHi(){this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new vF(this.ui)),this.ui.requestRender()}handleDementedDelves(){this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new dTe),this.ui.requestRender()}handleDaxnuts(){this.chatContainer.addChild(new Nt(1)),this.chatContainer.addChild(new pne(this.ui)),this.ui.requestRender()}checkDaxnutsEasterEgg(e){e.provider==="opencode"&&e.id.toLowerCase().includes("kimi-k2.5")&&this.handleDaxnuts()}async handleBashCommand(e,n=!1){let s=await this.session.extensionRunner.emitUserBash({type:"user_bash",command:e,excludeFromContext:n,cwd:this.sessionManager.getCwd()});if(s?.result){let o=s.result;this.bashComponent=new GT(e,this.ui,n),this.session.isStreaming?(this.pendingMessagesContainer.addChild(this.bashComponent),this.pendingBashComponents.push(this.bashComponent)):this.chatContainer.addChild(this.bashComponent),o.output&&this.bashComponent.appendOutput(o.output),this.bashComponent.setComplete(o.exitCode,o.cancelled,o.truncated?{truncated:!0,content:o.output}:void 0,o.fullOutputPath),this.session.recordBashResult(e,o,{excludeFromContext:n}),this.bashComponent=void 0,this.ui.requestRender();return}let i=this.session.isStreaming;this.bashComponent=new GT(e,this.ui,n),i?(this.pendingMessagesContainer.addChild(this.bashComponent),this.pendingBashComponents.push(this.bashComponent)):this.chatContainer.addChild(this.bashComponent),this.ui.requestRender();try{let o=await this.session.executeBash(e,a=>{this.bashComponent&&(this.bashComponent.appendOutput(a),this.ui.requestRender())},{excludeFromContext:n,operations:s?.operations});this.bashComponent&&this.bashComponent.setComplete(o.exitCode,o.cancelled,o.truncated?{truncated:!0,content:o.output}:void 0,o.fullOutputPath)}catch(o){this.bashComponent&&this.bashComponent.setComplete(void 0,!1),this.showError(`Bash command failed: ${o instanceof Error?o.message:"Unknown error"}`)}this.bashComponent=void 0,this.ui.requestRender()}async handleCompactCommand(e){this.clearStatusIndicator();try{await this.session.compact(e)}catch{}}stop(e=this.settingsManager.getFullscreenExitOutput()){this.disposeActiveSelector(),this.settingsManager.getShowTerminalProgress()&&this.ui.terminal.setProgress(!1),this.clearStatusIndicator(),this.themeController.disableAutoSync(),this.clearExtensionTerminalInputListeners(),this.footer.dispose(),this.footerDataProvider.dispose(),this.unsubscribe&&this.unsubscribe(),this.isInitialized&&(this.stopInteractiveTui(e),this.isInitialized=!1),this.unregisterSignalHandlers()}};p();p();function ZGs(t){if(t.type==="toolcall_start"){let r=t.partial.content[t.contentIndex];if(r?.type!=="toolCall")throw new Error(`toolcall_start content at index ${t.contentIndex} is not a tool call`);let{partial:s,...i}=t;return{...i,id:r.id,toolName:r.name}}if(!("partial"in t))return t;let{partial:e,...n}=t;return n}function RTe(t){if(t.type!=="message_update")return t;if(t.message.role!=="assistant")throw new Error("message_update message is not an assistant message");return{type:"message_update",usage:t.message.usage,assistantMessageEvent:ZGs(t.assistantMessageEvent)}}async function wne(t,e){let{mode:n,messages:r=[],initialMessage:s,initialImages:i}=e,o=0,a=t.session,c,u,l=!1,d=[],h=async()=>{l||(l=!0,c?.(),u?.(),await t.dispose())};(()=>{let g=["SIGTERM"];process.platform!=="win32"&&g.push("SIGHUP");for(let A of g){let y=()=>{KN(),h().finally(()=>{process.exit(A==="SIGHUP"?129:143)})};process.on(A,y),d.push(()=>process.off(A,y))}})(),t.setRebindSession(async()=>{await f()});let f=async()=>{a=t.session,await a.bindExtensions({mode:n==="json"?"json":"print",commandContextActions:{waitForIdle:()=>a.waitForIdle(),newSession:async g=>t.newSession(g),fork:async(g,A)=>({cancelled:(await t.fork(g,A)).cancelled}),navigateTree:async(g,A)=>({cancelled:(await a.navigateTree(g,{summarize:A?.summarize,customInstructions:A?.customInstructions,replaceInstructions:A?.replaceInstructions,label:A?.label})).cancelled}),switchSession:async(g,A)=>t.switchSession(g,A),reload:async()=>{await a.reload()}},onError:g=>{console.error(`Extension error (${g.extensionPath}): ${g.error}`)}}),c?.(),u?.(),c=a.subscribe(g=>{n==="json"&&g4(`${JSON.stringify(RTe(g))} -`)}),u=n==="json"?a.agent.subscribe(async()=>{await AD()}):void 0};try{if(n==="json"){let g=a.sessionManager.getHeader();g&&g4(`${JSON.stringify(g)} -`)}await f(),s&&await a.prompt(s,{images:i});for(let g of r)await a.prompt(g);if(n==="text"){let g=a.state,A=g.messages[g.messages.length-1];if(A?.role==="assistant"){let y=A;if(y.stopReason==="error"||y.stopReason==="aborted")console.error(y.errorMessage||`Request ${y.stopReason}`),o=1;else for(let b of y.content)b.type==="text"&&g4(`${b.text} -`)}}return o}catch(g){return console.error(g instanceof Error?g.message:String(g)),1}finally{for(let g of d)g();await h(),await wIe()}}p();var XMn=require("node:child_process");p();var JMn=require("node:string_decoder");function kTe(t){return`${JSON.stringify(t)} -`}function NTe(t,e){let n=new JMn.StringDecoder("utf8"),r="",s=a=>{e(a.endsWith("\r")?a.slice(0,-1):a)},i=a=>{for(r+=typeof a=="string"?a:n.write(a);;){let c=r.indexOf(` -`);if(c===-1)return;s(r.slice(0,c)),r=r.slice(c+1)}},o=()=>{r+=n.end(),r.length>0&&(s(r),r="")};return t.on("data",i),t.on("end",o),()=>{t.off("data",i),t.off("end",o)}}var Tne=class{process=null;stopReadingStdout=null;eventListeners=[];pendingRequests=new Map;requestId=0;stderr="";exitError=null;options;constructor(e={}){this.options=e}async start(){if(this.process)throw new Error("Client already started");this.exitError=null;let e=this.options.cliPath??"dist/cli.js",n=["--mode","rpc"];this.options.provider&&n.push("--provider",this.options.provider),this.options.model&&n.push("--model",this.options.model),this.options.args&&n.push(...this.options.args);let r=(0,XMn.spawn)("node",[e,...n],{cwd:this.options.cwd,env:{...process.env,...this.options.env},stdio:["pipe","pipe","pipe"]});if(this.process=r,r.stderr?.on("data",s=>{this.stderr+=s.toString(),process.stderr.write(s)}),r.once("exit",(s,i)=>{if(this.process!==r)return;let o=this.createProcessExitError(s,i);this.exitError=o,this.rejectPendingRequests(o)}),r.once("error",s=>{if(this.process!==r)return;let i=new Error(`Agent process error: ${s.message}. Stderr: ${this.stderr}`);this.exitError=i,this.rejectPendingRequests(i)}),r.stdin?.on("error",s=>{if(this.process!==r)return;let i=this.exitError??new Error(`Agent process stdin error: ${s.message}. Stderr: ${this.stderr}`);this.exitError=i,this.rejectPendingRequests(i)}),this.stopReadingStdout=NTe(r.stdout,s=>{this.handleLine(s)}),await new Promise(s=>setTimeout(s,100)),this.process.exitCode!==null){let s=this.exitError??this.createProcessExitError(this.process.exitCode,this.process.signalCode);throw this.exitError=s,s}}async stop(){this.process&&(this.stopReadingStdout?.(),this.stopReadingStdout=null,this.process.kill("SIGTERM"),await new Promise(e=>{let n=setTimeout(()=>{this.process?.kill("SIGKILL"),e()},1e3);this.process?.on("exit",()=>{clearTimeout(n),e()})}),this.process=null,this.pendingRequests.clear())}onEvent(e){return this.eventListeners.push(e),()=>{let n=this.eventListeners.indexOf(e);n!==-1&&this.eventListeners.splice(n,1)}}getStderr(){return this.stderr}async prompt(e,n){await this.send({type:"prompt",message:e,images:n})}async steer(e,n){await this.send({type:"steer",message:e,images:n})}async followUp(e,n){await this.send({type:"follow_up",message:e,images:n})}async abort(){await this.send({type:"abort"})}async clearQueue(){let e=await this.send({type:"clear_queue"});return this.getData(e)}async newSession(e){let n=await this.send({type:"new_session",parentSession:e});return this.getData(n)}async getState(){let e=await this.send({type:"get_state"});return this.getData(e)}async setModel(e,n){let r=await this.send({type:"set_model",provider:e,modelId:n});return this.getData(r)}async cycleModel(){let e=await this.send({type:"cycle_model"});return this.getData(e)}async getAvailableModels(){let e=await this.send({type:"get_available_models"});return this.getData(e).models}async setThinkingLevel(e){await this.send({type:"set_thinking_level",level:e})}async cycleThinkingLevel(){let e=await this.send({type:"cycle_thinking_level"});return this.getData(e)}async getAvailableThinkingLevels(){let e=await this.send({type:"get_available_thinking_levels"});return this.getData(e).levels}async setSteeringMode(e){await this.send({type:"set_steering_mode",mode:e})}async setFollowUpMode(e){await this.send({type:"set_follow_up_mode",mode:e})}async compact(e){let n=await this.send({type:"compact",customInstructions:e});return this.getData(n)}async setAutoCompaction(e){await this.send({type:"set_auto_compaction",enabled:e})}async setAutoRetry(e){await this.send({type:"set_auto_retry",enabled:e})}async abortRetry(){await this.send({type:"abort_retry"})}async bash(e){let n=await this.send({type:"bash",command:e});return this.getData(n)}async abortBash(){await this.send({type:"abort_bash"})}async getSessionStats(){let e=await this.send({type:"get_session_stats"});return this.getData(e)}async exportHtml(e){let n=await this.send({type:"export_html",outputPath:e});return this.getData(n)}async switchSession(e){let n=await this.send({type:"switch_session",sessionPath:e});return this.getData(n)}async fork(e){let n=await this.send({type:"fork",entryId:e});return this.getData(n)}async clone(){let e=await this.send({type:"clone"});return this.getData(e)}async getForkMessages(){let e=await this.send({type:"get_fork_messages"});return this.getData(e).messages}async getEntries(e){let n=await this.send({type:"get_entries",since:e});return this.getData(n)}async getTree(){let e=await this.send({type:"get_tree"});return this.getData(e)}async getLastAssistantText(){let e=await this.send({type:"get_last_assistant_text"});return this.getData(e).text}async setSessionName(e){await this.send({type:"set_session_name",name:e})}async getMessages(){let e=await this.send({type:"get_messages"});return this.getData(e).messages}async getCommands(){let e=await this.send({type:"get_commands"});return this.getData(e).commands}waitForIdle(e=6e4){return new Promise((n,r)=>{let s=setTimeout(()=>{i(),r(new Error(`Timeout waiting for agent to become idle. Stderr: ${this.stderr}`))},e),i=this.onEvent(o=>{o.type==="agent_settled"&&(clearTimeout(s),i(),n())})})}collectEvents(e=6e4){return new Promise((n,r)=>{let s=[],i=setTimeout(()=>{o(),r(new Error(`Timeout collecting events. Stderr: ${this.stderr}`))},e),o=this.onEvent(a=>{s.push(a),a.type==="agent_settled"&&(clearTimeout(i),o(),n(s))})})}async promptAndWait(e,n,r=6e4){let s=this.collectEvents(r);return await this.prompt(e,n),s}handleLine(e){try{let n=JSON.parse(e);if(n.type==="response"&&n.id&&this.pendingRequests.has(n.id)){let r=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),r.resolve(n);return}for(let r of this.eventListeners)r(n)}catch{}}createProcessExitError(e,n){return new Error(`Agent process exited (code=${e} signal=${n}). Stderr: ${this.stderr}`)}rejectPendingRequests(e){for(let n of this.pendingRequests.values())n.reject(e);this.pendingRequests.clear()}async send(e){let n=this.process,r=n?.stdin;if(!n||!r)throw new Error("Client not started");if(this.exitError)throw this.exitError;if(n.exitCode!==null){let o=this.createProcessExitError(n.exitCode,n.signalCode);throw this.exitError=o,o}if(r.destroyed||!r.writable){let o=new Error(`Agent process stdin is not writable. Stderr: ${this.stderr}`);throw this.exitError=o,o}let s=`req_${++this.requestId}`,i={...e,id:s};return new Promise((o,a)=>{let c=setTimeout(()=>{this.pendingRequests.delete(s),a(new Error(`Timeout waiting for response to ${e.type}. Stderr: ${this.stderr}`))},3e4);this.pendingRequests.set(s,{resolve:u=>{clearTimeout(c),o(u)},reject:u=>{clearTimeout(c),a(u)}});try{r.write(kTe(i))}catch(u){let l=u instanceof Error?u:new Error(String(u)),d=this.pendingRequests.get(s);this.pendingRequests.delete(s),d?.reject(l)}})}getData(e){if(!e.success){let r=e;throw new Error(r.error)}return e.data}};p();var i1=Gt(require("node:crypto"),1);async function vne(t){xIe();let e=t.session,n,r,s=I=>{g4(kTe(I))},i=(I,x,w)=>w===void 0?{id:I,type:"response",command:x,success:!0}:{id:I,type:"response",command:x,success:!0,data:w},o=(I,x,w)=>({id:I,type:"response",command:x,success:!1,error:w}),a=new Map,c=!1,u=!1,l=[];function d(I,x,w,R){if(I?.signal?.aborted)return Promise.resolve(x);let N=i1.randomUUID();return new Promise((P,G)=>{let $,Q=()=>{$&&clearTimeout($),I?.signal?.removeEventListener("abort",H),a.delete(N)},H=()=>{Q(),P(x)};I?.signal?.addEventListener("abort",H,{once:!0}),I?.timeout&&($=setTimeout(()=>{Q(),P(x)},I.timeout)),a.set(N,{resolve:oe=>{Q(),P(R(oe))},reject:G}),s({type:"extension_ui_request",id:N,...w})})}let h=()=>({select:(I,x,w)=>d(w,void 0,{method:"select",title:I,options:x,timeout:w?.timeout},R=>"cancelled"in R&&R.cancelled?void 0:"value"in R?R.value:void 0),confirm:(I,x,w)=>d(w,!1,{method:"confirm",title:I,message:x,timeout:w?.timeout},R=>"cancelled"in R&&R.cancelled?!1:"confirmed"in R?R.confirmed:!1),input:(I,x,w)=>d(w,void 0,{method:"input",title:I,placeholder:x,timeout:w?.timeout},R=>"cancelled"in R&&R.cancelled?void 0:"value"in R?R.value:void 0),notify(I,x){s({type:"extension_ui_request",id:i1.randomUUID(),method:"notify",message:I,notifyType:x})},onTerminalInput(){return()=>{}},setStatus(I,x){s({type:"extension_ui_request",id:i1.randomUUID(),method:"setStatus",statusKey:I,statusText:x})},setWorkingMessage(I){},setWorkingVisible(I){},setWorkingIndicator(I){},setHiddenThinkingLabel(I){},setWidget(I,x,w){(x===void 0||Array.isArray(x))&&s({type:"extension_ui_request",id:i1.randomUUID(),method:"setWidget",widgetKey:I,widgetLines:x,widgetPlacement:w?.placement})},setFooter(I){},setHeader(I){},setTitle(I){s({type:"extension_ui_request",id:i1.randomUUID(),method:"setTitle",title:I})},async custom(){},pasteToEditor(I){this.setEditorText(I)},setEditorText(I){s({type:"extension_ui_request",id:i1.randomUUID(),method:"set_editor_text",text:I})},getEditorText(){return""},async editor(I,x){let w=i1.randomUUID();return new Promise((R,N)=>{a.set(w,{resolve:P=>{"cancelled"in P&&P.cancelled?R(void 0):"value"in P?R(P.value):R(void 0)},reject:N}),s({type:"extension_ui_request",id:w,method:"editor",title:I,prefill:x})})},addAutocompleteProvider(){},setEditorComponent(){},getEditorComponent(){},get theme(){return Se},getAllThemes(){return[]},getTheme(I){},setTheme(I){return{success:!1,error:"Theme switching not supported in RPC mode"}},getToolsExpanded(){return!1},setToolsExpanded(I){}});t.setRebindSession(async()=>{await m()});let m=async()=>{e=t.session,await e.bindExtensions({uiContext:h(),mode:"rpc",commandContextActions:{waitForIdle:()=>e.waitForIdle(),newSession:async I=>t.newSession(I),fork:async(I,x)=>({cancelled:(await t.fork(I,x)).cancelled}),navigateTree:async(I,x)=>({cancelled:(await e.navigateTree(I,{summarize:x?.summarize,customInstructions:x?.customInstructions,replaceInstructions:x?.replaceInstructions,label:x?.label})).cancelled}),switchSession:async(I,x)=>t.switchSession(I,x),reload:async()=>{await e.reload()}},shutdownHandler:()=>{c=!0},onError:I=>{s({type:"extension_error",extensionPath:I.extensionPath,event:I.event,error:I.error})}}),n?.(),r?.(),n=e.subscribe(I=>{s(RTe(I)),I.type==="agent_settled"&&b()}),r=e.agent.subscribe(async()=>{await AD()})},f=()=>{let I=["SIGTERM"];process.platform!=="win32"&&I.push("SIGHUP");for(let x of I){let w=()=>{KN(),y(x==="SIGHUP"?129:143,x)};process.on(x,w),l.push(()=>process.off(x,w))}};await m(),f();let g=async I=>{let x=I.id;switch(I.type){case"prompt":{let w=!1;e.prompt(I.message,{images:I.images,streamingBehavior:I.streamingBehavior,source:"rpc",preflightResult:R=>{R&&(w=!0,s(i(x,"prompt")))}}).catch(R=>{w||s(o(x,"prompt",R.message))});return}case"steer":return await e.steer(I.message,I.images),i(x,"steer");case"follow_up":return await e.followUp(I.message,I.images),i(x,"follow_up");case"abort":return await e.abort(),i(x,"abort");case"clear_queue":return i(x,"clear_queue",e.clearQueue());case"new_session":{let w=I.parentSession?{parentSession:I.parentSession}:void 0,R=await t.newSession(w);return R.cancelled||await m(),i(x,"new_session",R)}case"get_state":{let w={model:e.model,thinkingLevel:e.thinkingLevel,isStreaming:e.isStreaming,isCompacting:e.isCompacting,steeringMode:e.steeringMode,followUpMode:e.followUpMode,sessionFile:e.sessionFile,sessionId:e.sessionId,sessionName:e.sessionName,autoCompactionEnabled:e.autoCompactionEnabled,messageCount:e.messages.length,pendingMessageCount:e.pendingMessageCount};return i(x,"get_state",w)}case"set_model":{let R=e.modelRuntime.getAvailableSnapshot().find(N=>N.provider===I.provider&&N.id===I.modelId);return R?(await e.setModel(R),i(x,"set_model",R)):o(x,"set_model",`Model not found: ${I.provider}/${I.modelId}`)}case"cycle_model":{let w=await e.cycleModel();return w?i(x,"cycle_model",w):i(x,"cycle_model",null)}case"get_available_models":{let w=e.modelRuntime.getAvailableSnapshot();return i(x,"get_available_models",{models:w})}case"set_thinking_level":return e.setThinkingLevel(I.level),i(x,"set_thinking_level");case"cycle_thinking_level":{let w=e.cycleThinkingLevel();return w?i(x,"cycle_thinking_level",{level:w}):i(x,"cycle_thinking_level",null)}case"get_available_thinking_levels":{let w=e.getAvailableThinkingLevels();return i(x,"get_available_thinking_levels",{levels:w})}case"set_steering_mode":return e.setSteeringMode(I.mode),i(x,"set_steering_mode");case"set_follow_up_mode":return e.setFollowUpMode(I.mode),i(x,"set_follow_up_mode");case"compact":{let w=await e.compact(I.customInstructions);return i(x,"compact",w)}case"set_auto_compaction":return e.setAutoCompactionEnabled(I.enabled),i(x,"set_auto_compaction");case"set_auto_retry":return e.setAutoRetryEnabled(I.enabled),i(x,"set_auto_retry");case"abort_retry":return e.abortRetry(),i(x,"abort_retry");case"bash":{let w=await e.extensionRunner.emitUserBash({type:"user_bash",command:I.command,excludeFromContext:I.excludeFromContext??!1,cwd:e.sessionManager.getCwd()});if(w?.result)return e.recordBashResult(I.command,w.result,{excludeFromContext:I.excludeFromContext}),i(x,"bash",w.result);let R=await e.executeBash(I.command,void 0,{excludeFromContext:I.excludeFromContext,id:x,operations:w?.operations});return i(x,"bash",R)}case"abort_bash":return e.abortBash(),i(x,"abort_bash");case"get_session_stats":{let w=e.getSessionStats();return i(x,"get_session_stats",w)}case"export_html":{let w=await e.exportToHtml(I.outputPath);return i(x,"export_html",{path:w})}case"switch_session":{let w=await t.switchSession(I.sessionPath);return w.cancelled||await m(),i(x,"switch_session",w)}case"fork":{let w=await t.fork(I.entryId);return w.cancelled||await m(),i(x,"fork",{text:w.selectedText,cancelled:w.cancelled})}case"clone":{let w=e.sessionManager.getLeafId();if(!w)return o(x,"clone","Cannot clone session: no current entry selected");let R=await t.fork(w,{position:"at"});return R.cancelled||await m(),i(x,"clone",{cancelled:R.cancelled})}case"get_fork_messages":{let w=e.getUserMessagesForForking();return i(x,"get_fork_messages",{messages:w})}case"get_entries":{let w=e.sessionManager,R=w.getEntries();if(I.since!==void 0){let N=R.findIndex(P=>P.id===I.since);if(N===-1)return o(x,"get_entries",`Entry not found: ${I.since}`);R=R.slice(N+1)}return i(x,"get_entries",{entries:R,leafId:w.getLeafId()})}case"get_tree":{let w=e.sessionManager;return i(x,"get_tree",{tree:w.getTree(),leafId:w.getLeafId()})}case"get_last_assistant_text":{let w=e.getLastAssistantText();return i(x,"get_last_assistant_text",{text:w})}case"set_session_name":{let w=I.name.trim();return w?(e.setSessionName(w),i(x,"set_session_name")):o(x,"set_session_name","Session name cannot be empty")}case"get_messages":return i(x,"get_messages",{messages:e.messages});case"get_commands":{let w=[];for(let R of e.extensionRunner.getRegisteredCommands())w.push({name:R.invocationName,description:R.description,source:"extension",sourceInfo:R.sourceInfo});for(let R of e.promptTemplates)w.push({name:R.name,description:R.description,source:"prompt",sourceInfo:R.sourceInfo});for(let R of e.resourceLoader.getSkills().skills)w.push({name:`skill:${R.name}`,description:R.description,source:"skill",sourceInfo:R.sourceInfo});return i(x,"get_commands",{commands:w})}default:{let w=I;return o(x,w.type,`Unknown command: ${w.type}`)}}},A=()=>{};async function y(I=0,x){u&&process.exit(I),u=!0;for(let w of l)w();n?.(),r?.(),await t.dispose(),A(),process.stdin.pause(),x!=="SIGTERM"&&await wIe(),process.exit(I)}async function b(){c&&await y()}let S=async I=>{let x;try{x=JSON.parse(I)}catch(R){s(o(void 0,"parse",`Failed to parse command: ${R instanceof Error?R.message:String(R)}`)),await AD();return}if(typeof x=="object"&&x!==null&&"type"in x&&x.type==="extension_ui_response"){let R=x,N=a.get(R.id);N&&(a.delete(R.id),N.resolve(R));return}let w=x;try{let R=await g(w);R&&(s(R),await AD()),await b()}catch(R){s(o(w.id,w.type,R instanceof Error?R.message:String(R))),await AD()}},C=()=>{y()};return process.stdin.on("end",C),A=(()=>{let I=NTe(process.stdin,x=>{S(x)});return()=>{I(),process.stdin.off("end",C)}})(),new Promise(()=>{})}p();var Br=Oe.Union([Oe.String(),Oe.Integer({minimum:0,maximum:255})]),eWs=Oe.Object({$schema:Oe.Optional(Oe.String()),name:Oe.String(),vars:Oe.Optional(Oe.Record(Oe.String(),Br)),colors:Oe.Object({accent:Br,border:Br,borderAccent:Br,borderMuted:Br,success:Br,error:Br,warning:Br,muted:Br,dim:Br,text:Br,thinkingText:Br,scrollbarTrack:Oe.Optional(Br),scrollbarThumb:Oe.Optional(Br),selectedBg:Br,searchMatchBg:Oe.Optional(Br),searchMatchText:Oe.Optional(Br),userMessageBg:Br,userMessageText:Br,customMessageBg:Br,customMessageText:Br,customMessageLabel:Br,toolPendingBg:Br,toolSuccessBg:Br,toolErrorBg:Br,toolTitle:Br,toolOutput:Br,mdHeading:Br,mdLink:Br,mdLinkUrl:Br,mdCode:Br,mdCodeBlock:Br,mdCodeBlockBorder:Br,mdQuote:Br,mdQuoteBorder:Br,mdHr:Br,mdListBullet:Br,toolDiffAdded:Br,toolDiffRemoved:Br,toolDiffContext:Br,syntaxComment:Br,syntaxKeyword:Br,syntaxFunction:Br,syntaxVariable:Br,syntaxString:Br,syntaxNumber:Br,syntaxType:Br,syntaxOperator:Br,syntaxPunctuation:Br,thinkingOff:Br,thinkingMinimal:Br,thinkingLow:Br,thinkingMedium:Br,thinkingHigh:Br,thinkingXhigh:Br,thinkingMax:Oe.Optional(Br),bashMode:Br}),export:Oe.Optional(Oe.Object({pageBg:Oe.Optional(Br),cardBg:Oe.Optional(Br),infoBg:Oe.Optional(Br)}))}),ZMn=Nw(eWs);function eLn(t,e){if(!ZMn.Check(e)){let r=Array.from(ZMn.Errors(e)),s=new Set,i=[];for(let a of r){if(a.keyword==="required"&&a.instancePath==="/colors"){let u=a.params.requiredProperties;for(let l of u??[])s.add(l);continue}let c=a.instancePath||"/";i.push(` - ${c}: ${a.message}`)}let o=`Invalid theme "${t}": -`;throw s.size>0&&(o+=` +`;for(let[oe,ne]of ie){let Z=ne.description??ne.extensionPath,te=QQ(oe,{capitalize:!0});Pe+=`| \`${te}\` | ${Z} | +`}}this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Un),this.chatContainer.addChild(new Et(Ee.bold(Ee.fg("accent","Keyboard Shortcuts")),1,0)),this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Pl(Pe.trim(),1,1,this.getMarkdownThemeWithSettings())),this.chatContainer.addChild(new Un),this.ui.requestRender()}async handleClearCommand(){this.clearStatusIndicator();try{if((await this.runtimeHost.newSession()).cancelled)return;this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(`${Ee.fg("accent","\u2713 New session started")}`,1,1)),this.ui.requestRender()}catch(e){await this.handleFatalRuntimeError("Failed to create session",e)}}handleDebugCommand(){let e=this.ui.terminal.columns,n=this.ui.terminal.rows,r=this.ui.render(e),i=tkn(),s=[`Debug output at ${new Date().toISOString()}`,`Terminal: ${e}x${n}`,`Total lines: ${r.length}`,"","=== All rendered lines with visible widths ===",...r.map((o,a)=>{let c=rn(o),u=JSON.stringify(o);return`[${a}] (w=${c}) ${u}`}),"","=== Agent messages (JSONL) ===",...this.session.messages.map(o=>JSON.stringify(o)),""].join(` +`);gG.mkdirSync(uu.dirname(i),{recursive:!0}),gG.writeFileSync(i,s),this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Et(`${Ee.fg("accent","\u2713 Debug log written")} +${Ee.fg("muted",i)}`,1,1)),this.ui.requestRender()}handleArminSaysHi(){this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new ZU(this.ui)),this.ui.requestRender()}handleDementedDelves(){this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new vPe),this.ui.requestRender()}handleDaxnuts(){this.chatContainer.addChild(new Tt(1)),this.chatContainer.addChild(new Jae(this.ui)),this.ui.requestRender()}checkDaxnutsEasterEgg(e){e.provider==="opencode"&&e.id.toLowerCase().includes("kimi-k2.5")&&this.handleDaxnuts()}async handleBashCommand(e,n=!1){let r=this.session.extensionRunner,i;try{i=await r.emitUserBash({type:"user_bash",command:e,excludeFromContext:n,cwd:this.sessionManager.getCwd()})}catch{return}if(i?.result){let o=i.result;this.bashComponent=new Ck(e,this.ui,n),this.session.isStreaming?(this.pendingMessagesContainer.addChild(this.bashComponent),this.pendingBashComponents.push(this.bashComponent)):this.chatContainer.addChild(this.bashComponent),o.output&&this.bashComponent.appendOutput(o.output),this.bashComponent.setComplete(o.exitCode,o.cancelled,o.truncated?{truncated:!0,content:o.output}:void 0,o.fullOutputPath),this.session.recordBashResult(e,o,{excludeFromContext:n}),this.bashComponent=void 0,this.ui.requestRender();return}let s=this.session.isStreaming;this.bashComponent=new Ck(e,this.ui,n),s?(this.pendingMessagesContainer.addChild(this.bashComponent),this.pendingBashComponents.push(this.bashComponent)):this.chatContainer.addChild(this.bashComponent),this.ui.requestRender();try{let o=await this.session.executeBash(e,a=>{this.bashComponent&&(this.bashComponent.appendOutput(a),this.ui.requestRender())},{excludeFromContext:n,operations:i?.operations});this.bashComponent&&this.bashComponent.setComplete(o.exitCode,o.cancelled,o.truncated?{truncated:!0,content:o.output}:void 0,o.fullOutputPath)}catch(o){this.bashComponent&&this.bashComponent.setComplete(void 0,!1),this.showError(`Bash command failed: ${o instanceof Error?o.message:"Unknown error"}`)}this.bashComponent=void 0,this.ui.requestRender()}async handleCompactCommand(e){this.clearStatusIndicator();try{await this.session.compact(e)}catch{}}stop(e=this.settingsManager.getFullscreenExitOutput()){this.disposeActiveSelector(),this.settingsManager.getShowTerminalProgress()&&this.ui.terminal.setProgress(!1),this.clearStatusIndicator(),this.themeController.disableAutoSync(),this.clearExtensionTerminalInputListeners(),this.footer.dispose(),this.footerDataProvider.dispose(),this.unsubscribe&&this.unsubscribe(),this.isInitialized&&(this.stopInteractiveTui(e),this.isInitialized=!1),this.unregisterSignalHandlers()}}});function sEs(t){if(t.type==="toolcall_start"){let r=t.partial.content[t.contentIndex];if(r?.type!=="toolCall")throw new Error(`toolcall_start content at index ${t.contentIndex} is not a tool call`);let{partial:i,...s}=t;return{...s,id:r.id,toolName:r.name}}if(!("partial"in t))return t;let{partial:e,...n}=t;return n}function HPe(t){if(t.type!=="message_update")return t;if(t.message.role!=="assistant")throw new Error("message_update message is not an assistant message");return{type:"message_update",usage:t.message.usage,assistantMessageEvent:sEs(t.assistantMessageEvent)}}var d_t=v(()=>{p()});async function pce(t,e){let{mode:n,messages:r=[],initialMessage:i,initialImages:s}=e,o=0,a=t.session,c,u,l=!1,d=[],m=async()=>{l||(l=!0,c?.(),u?.(),await t.dispose())};(()=>{let g=["SIGTERM"];process.platform!=="win32"&&g.push("SIGHUP");for(let A of g){let y=()=>{WD(),m().finally(()=>{process.exit(A==="SIGHUP"?129:143)})};process.on(A,y),d.push(()=>process.off(A,y))}})(),t.setRebindSession(async()=>{await f()});let f=async()=>{a=t.session,await a.bindExtensions({mode:n==="json"?"json":"print",commandContextActions:{waitForIdle:()=>a.waitForIdle(),newSession:async g=>t.newSession(g),fork:async(g,A)=>({cancelled:(await t.fork(g,A)).cancelled}),navigateTree:async(g,A)=>({cancelled:(await a.navigateTree(g,{summarize:A?.summarize,customInstructions:A?.customInstructions,replaceInstructions:A?.replaceInstructions,label:A?.label})).cancelled}),switchSession:async(g,A)=>t.switchSession(g,A),reload:async()=>{await a.reload()}},onError:g=>{console.error(`Extension error (${g.extensionPath}): ${g.error}`)}}),c?.(),u?.(),c=a.subscribe(g=>{n==="json"&&uY(`${JSON.stringify(HPe(g))} +`)}),u=n==="json"?a.agent.subscribe(async()=>{await hP()}):void 0};try{if(n==="json"){let g=a.sessionManager.getHeader();g&&uY(`${JSON.stringify(g)} +`)}await f(),i&&await a.prompt(i,{images:s});for(let g of r)await a.prompt(g);if(n==="text"){let g=a.state,A=g.messages[g.messages.length-1];if(A?.role==="assistant"){let y=A;if(y.stopReason==="error"||y.stopReason==="aborted")console.error(y.errorMessage||`Request ${y.stopReason}`),o=1;else for(let E of y.content)E.type==="text"&&uY(`${E.text} +`)}}return o}catch(g){return console.error(g instanceof Error?g.message:String(g)),1}finally{for(let g of d)g();await m(),await CBe()}}var _or=v(()=>{p();yoe();pw();d_t()});function qPe(t){return`${JSON.stringify(t)} +`}function jPe(t,e){let n=new xor.StringDecoder("utf8"),r="",i=a=>{e(a.endsWith("\r")?a.slice(0,-1):a)},s=a=>{for(r+=typeof a=="string"?a:n.write(a);;){let c=r.indexOf(` +`);if(c===-1)return;i(r.slice(0,c)),r=r.slice(c+1)}},o=()=>{r+=n.end(),r.length>0&&(i(r),r="")};return t.on("data",s),t.on("end",o),()=>{t.off("data",s),t.off("end",o)}}var xor,p_t=v(()=>{p();xor=require("node:string_decoder")});var Sor,mce,Cor=v(()=>{p();Sor=require("node:child_process");p_t();mce=class{process=null;stopReadingStdout=null;eventListeners=[];pendingRequests=new Map;requestId=0;stderr="";exitError=null;options;constructor(e={}){this.options=e}async start(){if(this.process)throw new Error("Client already started");this.exitError=null;let e=this.options.cliPath??"dist/cli.js",n=["--mode","rpc"];this.options.provider&&n.push("--provider",this.options.provider),this.options.model&&n.push("--model",this.options.model),this.options.args&&n.push(...this.options.args);let r=(0,Sor.spawn)("node",[e,...n],{cwd:this.options.cwd,env:{...process.env,...this.options.env},stdio:["pipe","pipe","pipe"]});if(this.process=r,r.stderr?.on("data",i=>{this.stderr+=i.toString(),process.stderr.write(i)}),r.once("exit",(i,s)=>{if(this.process!==r)return;let o=this.createProcessExitError(i,s);this.exitError=o,this.rejectPendingRequests(o)}),r.once("error",i=>{if(this.process!==r)return;let s=new Error(`Agent process error: ${i.message}. Stderr: ${this.stderr}`);this.exitError=s,this.rejectPendingRequests(s)}),r.stdin?.on("error",i=>{if(this.process!==r)return;let s=this.exitError??new Error(`Agent process stdin error: ${i.message}. Stderr: ${this.stderr}`);this.exitError=s,this.rejectPendingRequests(s)}),this.stopReadingStdout=jPe(r.stdout,i=>{this.handleLine(i)}),await new Promise(i=>setTimeout(i,100)),this.process.exitCode!==null){let i=this.exitError??this.createProcessExitError(this.process.exitCode,this.process.signalCode);throw this.exitError=i,i}}async stop(){this.process&&(this.stopReadingStdout?.(),this.stopReadingStdout=null,this.process.kill("SIGTERM"),await new Promise(e=>{let n=setTimeout(()=>{this.process?.kill("SIGKILL"),e()},1e3);this.process?.on("exit",()=>{clearTimeout(n),e()})}),this.process=null,this.pendingRequests.clear())}onEvent(e){return this.eventListeners.push(e),()=>{let n=this.eventListeners.indexOf(e);n!==-1&&this.eventListeners.splice(n,1)}}getStderr(){return this.stderr}async prompt(e,n){await this.send({type:"prompt",message:e,images:n})}async steer(e,n){await this.send({type:"steer",message:e,images:n})}async followUp(e,n){await this.send({type:"follow_up",message:e,images:n})}async abort(){await this.send({type:"abort"})}async clearQueue(){let e=await this.send({type:"clear_queue"});return this.getData(e)}async newSession(e){let n=await this.send({type:"new_session",parentSession:e});return this.getData(n)}async getState(){let e=await this.send({type:"get_state"});return this.getData(e)}async setModel(e,n){let r=await this.send({type:"set_model",provider:e,modelId:n});return this.getData(r)}async cycleModel(){let e=await this.send({type:"cycle_model"});return this.getData(e)}async getAvailableModels(){let e=await this.send({type:"get_available_models"});return this.getData(e).models}async setThinkingLevel(e){await this.send({type:"set_thinking_level",level:e})}async cycleThinkingLevel(){let e=await this.send({type:"cycle_thinking_level"});return this.getData(e)}async getAvailableThinkingLevels(){let e=await this.send({type:"get_available_thinking_levels"});return this.getData(e).levels}async setSteeringMode(e){await this.send({type:"set_steering_mode",mode:e})}async setFollowUpMode(e){await this.send({type:"set_follow_up_mode",mode:e})}async compact(e){let n=await this.send({type:"compact",customInstructions:e});return this.getData(n)}async setAutoCompaction(e){await this.send({type:"set_auto_compaction",enabled:e})}async setAutoRetry(e){await this.send({type:"set_auto_retry",enabled:e})}async abortRetry(){await this.send({type:"abort_retry"})}async bash(e){let n=await this.send({type:"bash",command:e});return this.getData(n)}async abortBash(){await this.send({type:"abort_bash"})}async getSessionStats(){let e=await this.send({type:"get_session_stats"});return this.getData(e)}async exportHtml(e){let n=await this.send({type:"export_html",outputPath:e});return this.getData(n)}async switchSession(e){let n=await this.send({type:"switch_session",sessionPath:e});return this.getData(n)}async fork(e){let n=await this.send({type:"fork",entryId:e});return this.getData(n)}async clone(){let e=await this.send({type:"clone"});return this.getData(e)}async getForkMessages(){let e=await this.send({type:"get_fork_messages"});return this.getData(e).messages}async getEntries(e){let n=await this.send({type:"get_entries",since:e});return this.getData(n)}async getTree(){let e=await this.send({type:"get_tree"});return this.getData(e)}async getLastAssistantText(){let e=await this.send({type:"get_last_assistant_text"});return this.getData(e).text}async setSessionName(e){await this.send({type:"set_session_name",name:e})}async getMessages(){let e=await this.send({type:"get_messages"});return this.getData(e).messages}async getCommands(){let e=await this.send({type:"get_commands"});return this.getData(e).commands}waitForIdle(e=6e4){return new Promise((n,r)=>{let i=setTimeout(()=>{s(),r(new Error(`Timeout waiting for agent to become idle. Stderr: ${this.stderr}`))},e),s=this.onEvent(o=>{o.type==="agent_settled"&&(clearTimeout(i),s(),n())})})}collectEvents(e=6e4){return new Promise((n,r)=>{let i=[],s=setTimeout(()=>{o(),r(new Error(`Timeout collecting events. Stderr: ${this.stderr}`))},e),o=this.onEvent(a=>{i.push(a),a.type==="agent_settled"&&(clearTimeout(s),o(),n(i))})})}async promptAndWait(e,n,r=6e4){let i=this.collectEvents(r);return await this.prompt(e,n),i}handleLine(e){try{let n=JSON.parse(e);if(n.type==="response"&&n.id&&this.pendingRequests.has(n.id)){let r=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),r.resolve(n);return}for(let r of this.eventListeners)r(n)}catch{}}createProcessExitError(e,n){return new Error(`Agent process exited (code=${e} signal=${n}). Stderr: ${this.stderr}`)}rejectPendingRequests(e){for(let n of this.pendingRequests.values())n.reject(e);this.pendingRequests.clear()}async send(e){let n=this.process,r=n?.stdin;if(!n||!r)throw new Error("Client not started");if(this.exitError)throw this.exitError;if(n.exitCode!==null){let o=this.createProcessExitError(n.exitCode,n.signalCode);throw this.exitError=o,o}if(r.destroyed||!r.writable){let o=new Error(`Agent process stdin is not writable. Stderr: ${this.stderr}`);throw this.exitError=o,o}let i=`req_${++this.requestId}`,s={...e,id:i};return new Promise((o,a)=>{let c=setTimeout(()=>{this.pendingRequests.delete(i),a(new Error(`Timeout waiting for response to ${e.type}. Stderr: ${this.stderr}`))},3e4);this.pendingRequests.set(i,{resolve:u=>{clearTimeout(c),o(u)},reject:u=>{clearTimeout(c),a(u)}});try{r.write(qPe(s))}catch(u){let l=u instanceof Error?u:new Error(String(u)),d=this.pendingRequests.get(i);this.pendingRequests.delete(i),d?.reject(l)}})}getData(e){if(!e.success){let r=e;throw new Error(r.error)}return e.data}}});async function hce(t){SBe();let e=t.session,n,r,i=C=>{uY(qPe(C))},s=(C,I,w)=>w===void 0?{id:C,type:"response",command:I,success:!0}:{id:C,type:"response",command:I,success:!0,data:w},o=(C,I,w)=>({id:C,type:"response",command:I,success:!1,error:w}),a=new Map,c=!1,u=!1,l=[];function d(C,I,w,k){if(C?.signal?.aborted)return Promise.resolve(I);let N=sM.randomUUID();return new Promise((O,W)=>{let $,G=()=>{$&&clearTimeout($),C?.signal?.removeEventListener("abort",q),a.delete(N)},q=()=>{G(),O(I)};C?.signal?.addEventListener("abort",q,{once:!0}),C?.timeout&&($=setTimeout(()=>{G(),O(I)},C.timeout)),a.set(N,{resolve:ce=>{G(),O(k(ce))},reject:W}),i({type:"extension_ui_request",id:N,...w})})}let m=()=>({select:(C,I,w)=>d(w,void 0,{method:"select",title:C,options:I,timeout:w?.timeout},k=>"cancelled"in k&&k.cancelled?void 0:"value"in k?k.value:void 0),confirm:(C,I,w)=>d(w,!1,{method:"confirm",title:C,message:I,timeout:w?.timeout},k=>"cancelled"in k&&k.cancelled?!1:"confirmed"in k?k.confirmed:!1),input:(C,I,w)=>d(w,void 0,{method:"input",title:C,placeholder:I,timeout:w?.timeout},k=>"cancelled"in k&&k.cancelled?void 0:"value"in k?k.value:void 0),notify(C,I){i({type:"extension_ui_request",id:sM.randomUUID(),method:"notify",message:C,notifyType:I})},onTerminalInput(){return()=>{}},setStatus(C,I){i({type:"extension_ui_request",id:sM.randomUUID(),method:"setStatus",statusKey:C,statusText:I})},setWorkingMessage(C){},setWorkingVisible(C){},setWorkingIndicator(C){},setHiddenThinkingLabel(C){},setWidget(C,I,w){(I===void 0||Array.isArray(I))&&i({type:"extension_ui_request",id:sM.randomUUID(),method:"setWidget",widgetKey:C,widgetLines:I,widgetPlacement:w?.placement})},setFooter(C){},setHeader(C){},setTitle(C){i({type:"extension_ui_request",id:sM.randomUUID(),method:"setTitle",title:C})},async custom(){},pasteToEditor(C){this.setEditorText(C)},setEditorText(C){i({type:"extension_ui_request",id:sM.randomUUID(),method:"set_editor_text",text:C})},getEditorText(){return""},async editor(C,I){let w=sM.randomUUID();return new Promise((k,N)=>{a.set(w,{resolve:O=>{"cancelled"in O&&O.cancelled?k(void 0):"value"in O?k(O.value):k(void 0)},reject:N}),i({type:"extension_ui_request",id:w,method:"editor",title:C,prefill:I})})},addAutocompleteProvider(){},setEditorComponent(){},getEditorComponent(){},get theme(){return Ee},getAllThemes(){return[]},getTheme(C){},setTheme(C){return{success:!1,error:"Theme switching not supported in RPC mode"}},getToolsExpanded(){return!1},setToolsExpanded(C){}});t.setRebindSession(async()=>{await h()});let h=async()=>{e=t.session,await e.bindExtensions({uiContext:m(),mode:"rpc",commandContextActions:{waitForIdle:()=>e.waitForIdle(),newSession:async C=>t.newSession(C),fork:async(C,I)=>({cancelled:(await t.fork(C,I)).cancelled}),navigateTree:async(C,I)=>({cancelled:(await e.navigateTree(C,{summarize:I?.summarize,customInstructions:I?.customInstructions,replaceInstructions:I?.replaceInstructions,label:I?.label})).cancelled}),switchSession:async(C,I)=>t.switchSession(C,I),reload:async()=>{await e.reload()}},shutdownHandler:()=>{c=!0},onError:C=>{i({type:"extension_error",extensionPath:C.extensionPath,event:C.event,error:C.error})}}),n?.(),r?.(),n=e.subscribe(C=>{i(HPe(C)),C.type==="agent_settled"&&E()}),r=e.agent.subscribe(async()=>{await hP()})},f=()=>{let C=["SIGTERM"];process.platform!=="win32"&&C.push("SIGHUP");for(let I of C){let w=()=>{WD(),y(I==="SIGHUP"?129:143,I)};process.on(I,w),l.push(()=>process.off(I,w))}};await h(),f();let g=async C=>{let I=C.id;switch(C.type){case"prompt":{let w=!1;e.prompt(C.message,{images:C.images,streamingBehavior:C.streamingBehavior,source:"rpc",preflightResult:k=>{k&&(w=!0,i(s(I,"prompt")))}}).catch(k=>{w||i(o(I,"prompt",k.message))});return}case"steer":return await e.steer(C.message,C.images,{source:"rpc"}),s(I,"steer");case"follow_up":return await e.followUp(C.message,C.images,{source:"rpc"}),s(I,"follow_up");case"abort":return await e.abort(),s(I,"abort");case"clear_queue":return s(I,"clear_queue",e.clearQueue());case"new_session":{let w=C.parentSession?{parentSession:C.parentSession}:void 0,k=await t.newSession(w);return k.cancelled||await h(),s(I,"new_session",k)}case"get_state":{let w={model:e.model,thinkingLevel:e.thinkingLevel,isStreaming:e.isStreaming,isCompacting:e.isCompacting,steeringMode:e.steeringMode,followUpMode:e.followUpMode,sessionFile:e.sessionFile,sessionId:e.sessionId,sessionName:e.sessionName,autoCompactionEnabled:e.autoCompactionEnabled,messageCount:e.messages.length,pendingMessageCount:e.pendingMessageCount};return s(I,"get_state",w)}case"set_model":{let k=e.modelRuntime.getAvailableSnapshot().find(N=>N.provider===C.provider&&N.id===C.modelId);return k?(await e.setModel(k),s(I,"set_model",k)):o(I,"set_model",`Model not found: ${C.provider}/${C.modelId}`)}case"cycle_model":{let w=await e.cycleModel();return w?s(I,"cycle_model",w):s(I,"cycle_model",null)}case"get_available_models":{let w=e.modelRuntime.getAvailableSnapshot();return s(I,"get_available_models",{models:w})}case"set_thinking_level":return e.setThinkingLevel(C.level),s(I,"set_thinking_level");case"cycle_thinking_level":{let w=e.cycleThinkingLevel();return w?s(I,"cycle_thinking_level",{level:w}):s(I,"cycle_thinking_level",null)}case"get_available_thinking_levels":{let w=e.getAvailableThinkingLevels();return s(I,"get_available_thinking_levels",{levels:w})}case"set_steering_mode":return e.setSteeringMode(C.mode),s(I,"set_steering_mode");case"set_follow_up_mode":return e.setFollowUpMode(C.mode),s(I,"set_follow_up_mode");case"compact":{let w=await e.compact(C.customInstructions);return s(I,"compact",w)}case"set_auto_compaction":return e.setAutoCompactionEnabled(C.enabled),s(I,"set_auto_compaction");case"set_auto_retry":return e.setAutoRetryEnabled(C.enabled),s(I,"set_auto_retry");case"abort_retry":return e.abortRetry(),s(I,"abort_retry");case"bash":{let w=await e.extensionRunner.emitUserBash({type:"user_bash",command:C.command,excludeFromContext:C.excludeFromContext??!1,cwd:e.sessionManager.getCwd()});if(w?.result)return e.recordBashResult(C.command,w.result,{excludeFromContext:C.excludeFromContext}),s(I,"bash",w.result);let k=await e.executeBash(C.command,void 0,{excludeFromContext:C.excludeFromContext,id:I,operations:w?.operations});return s(I,"bash",k)}case"abort_bash":return e.abortBash(),s(I,"abort_bash");case"get_session_stats":{let w=e.getSessionStats();return s(I,"get_session_stats",w)}case"export_html":{let w=await e.exportToHtml(C.outputPath);return s(I,"export_html",{path:w})}case"switch_session":{let w=await t.switchSession(C.sessionPath);return w.cancelled||await h(),s(I,"switch_session",w)}case"fork":{let w=await t.fork(C.entryId);return w.cancelled||await h(),s(I,"fork",{text:w.selectedText,cancelled:w.cancelled})}case"clone":{let w=e.sessionManager.getLeafId();if(!w)return o(I,"clone","Cannot clone session: no current entry selected");let k=await t.fork(w,{position:"at"});return k.cancelled||await h(),s(I,"clone",{cancelled:k.cancelled})}case"get_fork_messages":{let w=e.getUserMessagesForForking();return s(I,"get_fork_messages",{messages:w})}case"get_entries":{let w=e.sessionManager,k=w.getEntries();if(C.since!==void 0){let N=k.findIndex(O=>O.id===C.since);if(N===-1)return o(I,"get_entries",`Entry not found: ${C.since}`);k=k.slice(N+1)}return s(I,"get_entries",{entries:k,leafId:w.getLeafId()})}case"get_tree":{let w=e.sessionManager;return s(I,"get_tree",{tree:w.getTree(),leafId:w.getLeafId()})}case"get_last_assistant_text":{let w=e.getLastAssistantText();return s(I,"get_last_assistant_text",{text:w})}case"set_session_name":{let w=C.name.trim();return w?(e.setSessionName(w),s(I,"set_session_name")):o(I,"set_session_name","Session name cannot be empty")}case"get_messages":return s(I,"get_messages",{messages:e.messages});case"get_commands":{let w=[];for(let k of e.extensionRunner.getRegisteredCommands())w.push({name:k.invocationName,description:k.description,source:"extension",sourceInfo:k.sourceInfo});for(let k of e.promptTemplates)w.push({name:k.name,description:k.description,source:"prompt",sourceInfo:k.sourceInfo});for(let k of e.resourceLoader.getSkills().skills)w.push({name:`skill:${k.name}`,description:k.description,source:"skill",sourceInfo:k.sourceInfo});return s(I,"get_commands",{commands:w})}default:{let w=C;return o(I,w.type,`Unknown command: ${w.type}`)}}},A=()=>{};async function y(C=0,I){u&&process.exit(C),u=!0;for(let w of l)w();n?.(),r?.(),await t.dispose(),A(),process.stdin.pause(),I!=="SIGTERM"&&await CBe(),process.exit(C)}async function E(){c&&await y()}let _=async C=>{let I;try{I=JSON.parse(C)}catch(k){i(o(void 0,"parse",`Failed to parse command: ${k instanceof Error?k.message:String(k)}`)),await hP();return}if(typeof I=="object"&&I!==null&&"type"in I&&I.type==="extension_ui_response"){let k=I,N=a.get(k.id);N&&(a.delete(k.id),N.resolve(k));return}let w=I;try{let k=await g(w);k&&(i(k),await hP()),await E()}catch(k){i(o(w.id,w.type,k instanceof Error?k.message:String(k))),await hP()}},S=()=>{y()};return process.stdin.on("end",S),A=(()=>{let C=jPe(process.stdin,I=>{_(I)});return()=>{C(),process.stdin.off("end",S)}})(),new Promise(()=>{})}var sM,Ior=v(()=>{p();sM=Ot(require("node:crypto"),1);yoe();pw();pi();d_t();p_t()});var m_t=v(()=>{p();bor();_or();Cor();Ior()});function Tor(t,e){if(!wor.Check(e)){let r=Array.from(wor.Errors(e)),i=new Set,s=[];for(let a of r){if(a.keyword==="required"&&a.instancePath==="/colors"){let u=a.params.requiredProperties;for(let l of u??[])i.add(l);continue}let c=a.instancePath||"/";s.push(` - ${c}: ${a.message}`)}let o=`Invalid theme "${t}": +`;throw i.size>0&&(o+=` Missing required color tokens: -`,o+=Array.from(s).sort().map(a=>` - ${a}`).join(` +`,o+=Array.from(i).sort().map(a=>` - ${a}`).join(` `),o+=` Please add these colors to your theme's "colors" object.`,o+=` -See the built-in themes (dark.json, light.json) for reference values.`),i.length>0&&(o+=` +See the built-in themes (dark.json, light.json) for reference values.`),s.length>0&&(o+=` Other errors: -${i.join(` -`)}`),new Error(o)}let n=e;if(n.name.includes("/"))throw new Error(`Invalid theme name "${n.name}": theme names cannot contain "/" because it is reserved for automatic light/dark theme settings.`);return n}p();var Jl=require("node:fs"),Ju=require("node:path");var Rat=Gt(Iee(),1);p();p();var nLn=require("node:os"),uf=require("node:path");var tWs=["extensions","skills","prompts","themes"],nWs={extensions:"Extensions",skills:"Skills",prompts:"Prompts",themes:"Themes"};function Iat(t){let e=(0,nLn.homedir)(),n;return t===e?n="~":t.startsWith(e)?n=`~${t.slice(e.length).replace(/\\/g,"/")}`:n=t.replace(/\\/g,"/"),n.endsWith("/")?n:`${n}/`}function rWs(t,e){return t.origin==="package"?`${t.source} (${t.scope})`:t.source==="auto"?t.baseDir?t.scope==="user"?`User (${Iat(t.baseDir)})`:`Project (${Iat(t.baseDir)})`:t.scope==="user"?`User (${Iat(e)})`:`Project (${ws}/)`:t.scope==="user"?"User settings":"Project settings"}function tLn(t,e){let n=new Map,r=(o,a)=>{for(let c of o){let{path:u,enabled:l,metadata:d}=c,h=`${d.origin}:${d.scope}:${d.source}:${d.baseDir??""}`;n.has(h)||n.set(h,{key:h,label:rWs(d,e),scope:d.scope,origin:d.origin,source:d.source,subgroups:[]});let m=n.get(h),f=`${h}:${a}`,g=m.subgroups.find(S=>S.type===a);g||(g={type:a,label:nWs[a],items:[]},m.subgroups.push(g));let A=(0,uf.basename)(u),y=(0,uf.basename)((0,uf.dirname)(u)),b;a==="extensions"&&y!=="extensions"?b=`${y}/${A}`:a==="skills"&&A==="SKILL.md"?b=y:b=A,g.items.push({path:u,enabled:l,metadata:d,resourceType:a,displayName:b,groupKey:h,subgroupKey:f})}};r(t.extensions,"extensions"),r(t.skills,"skills"),r(t.prompts,"prompts"),r(t.themes,"themes");let s=Array.from(n.values());s.sort((o,a)=>o.origin!==a.origin?o.origin==="package"?-1:1:o.scope!==a.scope?o.scope==="user"?-1:1:o.source.localeCompare(a.source));let i={extensions:0,skills:1,prompts:2,themes:3};for(let o of s){o.subgroups.sort((a,c)=>i[a.type]-i[c.type]);for(let a of o.subgroups)a.items.sort((c,u)=>c.displayName.localeCompare(u.displayName))}return s}var xat=class{writeScope;projectModeAvailable;constructor(e,n){this.writeScope=e,this.projectModeAvailable=n}setWriteScope(e){this.writeScope=e}invalidate(){}render(e){let n=Se.bold(this.writeScope==="project"?"Project Local Resources":"Global Resources"),r=Se.fg("muted"," \xB7 "),s=this.projectModeAvailable?er("tui.input.tab","switch mode")+r:"",i=this.writeScope==="project"?ml("space","cycle inherit/+/-"):ml("space","toggle"),o=s+i+r+ml("esc","close"),a=Math.max(1,e-nn(n)-nn(o)),c=this.writeScope==="project"?Se.fg("muted",`${ws}/settings.json \xB7 inherited global resources are dimmed`):Se.fg("muted",`~/${ws}/agent/settings.json`);return[pr(`${n}${" ".repeat(a)}${o}`,e,""),pr(c,e,"")]}},wat=class{groupsByScope;flatItems=[];filteredItems=[];selectedIndex=0;searchInput;maxVisible;settingsManager;cwd;agentDir;writeScope;inheritedEnabledByKey;onCancel;onExit;onToggle;onSwitchMode;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}constructor(e,n,r,s,i,o="global"){this.groupsByScope=e,this.settingsManager=n,this.cwd=r,this.agentDir=s,this.writeScope=o,this.inheritedEnabledByKey=this.buildInheritedEnabledMap(e.global),this.searchInput=new jo;let a=8;this.maxVisible=Math.max(5,(i??24)-a),this.buildFlatList(),this.filteredItems=[...this.flatItems]}setWriteScope(e){this.writeScope=e,this.buildFlatList(),this.filterItems(this.searchInput.getValue())}get groups(){return this.groupsByScope[this.writeScope]}buildInheritedEnabledMap(e){let n=new Map;for(let r of e)for(let s of r.subgroups)for(let i of s.items)n.set(this.getResourceItemKey(i),i.enabled);return n}buildFlatList(){this.flatItems=[];for(let e of this.groups){this.flatItems.push({type:"group",group:e});for(let n of e.subgroups){this.flatItems.push({type:"subgroup",subgroup:n,group:e});for(let r of n.items)this.flatItems.push({type:"item",item:r})}}this.selectedIndex=this.flatItems.findIndex(e=>e.type==="item"),this.selectedIndex<0&&(this.selectedIndex=0)}findNextItem(e,n){let r=e+n;for(;r>=0&&rn.type==="item");this.selectedIndex=e>=0?e:0}updateItem(e,n){e.enabled=n;for(let r of this.groups)for(let s of r.subgroups){let i=s.items.find(o=>o.path===e.path&&o.resourceType===e.resourceType);if(i){i.enabled=n;return}}}invalidate(){}render(e){let n=[];if(n.push(...this.searchInput.render(e)),n.push(""),this.filteredItems.length===0)return n.push(Se.fg("muted"," No resources found")),n;let r=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredItems.length-this.maxVisible)),s=Math.min(r+this.maxVisible,this.filteredItems.length);for(let i=r;i ":" ",l=this.isDimmedItem(c),d=a&&!l?Se.bold(c.displayName):c.displayName,h=l?Se.fg("dim",d):d;n.push(pr(`${u} ${this.renderCheckbox(c)} ${h}${this.getItemSuffix(c)}`,e,"..."))}}if(r>0||sa.type==="item").length,o=this.filteredItems.slice(0,this.selectedIndex).filter(a=>a.type==="item").length+1;n.push(Se.fg("dim",` (${o}/${i})`))}return n}handleInput(e){let n=ms();if(n.matches(e,"tui.select.up")){this.selectedIndex=this.findNextItem(this.selectedIndex,-1);return}if(n.matches(e,"tui.select.down")){this.selectedIndex=this.findNextItem(this.selectedIndex,1);return}if(n.matches(e,"tui.select.pageUp")){let r=Math.max(0,this.selectedIndex-this.maxVisible);for(;r=0&&this.filteredItems[r].type!=="item";)r--;r>=0&&(this.selectedIndex=r);return}if(n.matches(e,"tui.select.cancel")){this.onCancel?.();return}if(ip(e,"ctrl+c")){this.onExit?.();return}if(n.matches(e,"tui.input.tab")){this.onSwitchMode?.();return}if(e===" "||n.matches(e,"tui.select.confirm")){let r=this.filteredItems[this.selectedIndex];if(r?.type==="item"&&(this.writeScope==="project"||this.getItemScope(r.item)==="user")){let s=this.toggleResource(r.item);s!==void 0&&(this.updateItem(r.item,s),this.onToggle?.(r.item,s))}return}this.searchInput.handleInput(e),this.filterItems(this.searchInput.getValue())}toggleResource(e){if(this.writeScope==="project"){let r=this.getNextOverrideState(e);return this.setProjectResourceOverride(e,r)?r==="inherit"?this.getInheritedEnabled(e):r==="load":void 0}let n=!e.enabled;return e.metadata.origin==="top-level"?this.toggleTopLevelResource(e,n):this.togglePackageResource(e,n),n}toggleTopLevelResource(e,n){let r=e.metadata.scope,s=r==="project"?this.settingsManager.getProjectSettings():this.settingsManager.getGlobalSettings(),i=e.resourceType,o=s[i]??[],a=this.getResourcePattern(e),c=`-${a}`,u=`+${a}`,l=o.filter(d=>(d.startsWith("!")||d.startsWith("+")||d.startsWith("-")?d.slice(1):d)!==a);n?l.push(u):l.push(c),r==="project"?i==="extensions"?this.settingsManager.setProjectExtensionPaths(l):i==="skills"?this.settingsManager.setProjectSkillPaths(l):i==="prompts"?this.settingsManager.setProjectPromptTemplatePaths(l):i==="themes"&&this.settingsManager.setProjectThemePaths(l):i==="extensions"?this.settingsManager.setExtensionPaths(l):i==="skills"?this.settingsManager.setSkillPaths(l):i==="prompts"?this.settingsManager.setPromptTemplatePaths(l):i==="themes"&&this.settingsManager.setThemePaths(l)}togglePackageResource(e,n){let r=e.metadata.scope,i=[...(r==="project"?this.settingsManager.getProjectSettings():this.settingsManager.getGlobalSettings()).packages??[]],o=i.findIndex(g=>(typeof g=="string"?g:g.source)===e.metadata.source);if(o===-1)return;let a=i[o];typeof a=="string"&&(a={source:a},i[o]=a);let c=e.resourceType,u=a[c]??[],l=this.getPackageResourcePattern(e),d=`-${l}`,h=`+${l}`,m=u.filter(g=>(g.startsWith("!")||g.startsWith("+")||g.startsWith("-")?g.slice(1):g)!==l);n?m.push(h):m.push(d),a[c]=m.length>0?m:void 0,["extensions","skills","prompts","themes"].some(g=>a[g]!==void 0)||(i[o]=a.source),r==="project"?this.settingsManager.setProjectPackages(i):this.settingsManager.setPackages(i)}renderCheckbox(e){if(this.writeScope==="project"){let n=this.getProjectOverrideState(e);return n==="load"?Se.fg("success","[+]"):n==="unload"?Se.fg("warning","[-]"):Se.fg("dim",e.enabled?"[x]":"[ ]")}return e.enabled?Se.fg("success","[x]"):Se.fg("dim","[ ]")}getItemSuffix(e){if(this.writeScope!=="project")return"";let n=this.getProjectOverrideState(e);return n==="load"?Se.fg("muted"," project load"):n==="unload"?Se.fg("muted"," project unload"):this.isInheritedGlobalItem(e)?Se.fg("dim"," inherited global"):""}isDimmedItem(e){return this.writeScope==="project"&&this.isInheritedGlobalItem(e)&&this.getProjectOverrideState(e)==="inherit"}setProjectResourceOverride(e,n){return e.metadata.origin==="top-level"?this.setProjectTopLevelOverride(e,n):this.setProjectPackageOverride(e,n)}setProjectTopLevelOverride(e,n){let r=this.settingsManager.getProjectSettings()[e.resourceType]??[],s=this.isInheritedGlobalItem(e)?e.path:this.getResourcePatternForScope(e,"project"),i=this.getTopLevelOverridePatterns(e,"project"),o=r.filter(a=>{let c=this.getPatternEntryTarget(a);return(a.startsWith("!")||a.startsWith("+")||a.startsWith("-"))&&i.has(c)?!1:!(n==="inherit"&&this.isInheritedGlobalItem(e)&&c===s)});return n!=="inherit"&&(this.isInheritedGlobalItem(e)&&!o.includes(s)&&o.push(s),o.push(`${n==="load"?"+":"-"}${s}`)),this.setProjectTopLevelPaths(e.resourceType,o),!0}setProjectTopLevelPaths(e,n){e==="extensions"?this.settingsManager.setProjectExtensionPaths(n):e==="skills"?this.settingsManager.setProjectSkillPaths(n):e==="prompts"?this.settingsManager.setProjectPromptTemplatePaths(n):this.settingsManager.setProjectThemePaths(n)}setProjectPackageOverride(e,n){let r=[...this.settingsManager.getProjectSettings().packages??[]],s=r.findIndex(c=>this.packageSourceStringMatches(e.metadata.source,this.getItemScope(e),typeof c=="string"?c:c.source,"project"));if(s===-1){if(n==="inherit")return!1;r.push(this.createPackageOverrideSource(e)),s=r.length-1}let i=r[s];if(i===void 0)return!1;typeof i=="string"&&(i={source:i},r[s]=i);let o=this.getPackageResourcePattern(e),a=(i[e.resourceType]??[]).filter(c=>this.getPatternEntryTarget(c)!==o);return n!=="inherit"&&a.push(`${n==="load"?"+":"-"}${o}`),i[e.resourceType]=a.length>0?a:void 0,tWs.some(c=>i[c]!==void 0)||(i.autoload===!1?r.splice(s,1):r[s]=i.source),this.settingsManager.setProjectPackages(r),!0}getNextOverrideState(e){let n=this.getProjectOverrideState(e),r=this.getInheritedEnabled(e);return n==="inherit"?r?"unload":"load":n==="unload"?r?"load":"inherit":r?"inherit":"unload"}getProjectOverrideState(e){if(this.writeScope!=="project")return"inherit";if(e.metadata.origin==="top-level")return this.getOverrideStateFromEntries(this.settingsManager.getProjectSettings()[e.resourceType]??[],this.getTopLevelOverridePatterns(e,"project"),!1);let n=this.findMatchingPackageSource(e,"project");if(typeof n!="object")return"inherit";let r=n[e.resourceType];return r===void 0?"inherit":this.getOverrideStateFromEntries(r,new Set([this.getPackageResourcePattern(e)]),n.autoload!==!1)}getOverrideStateFromEntries(e,n,r){if(e.length===0&&r)return"unload";let s="inherit";for(let i of e)n.has(this.getPatternEntryTarget(i))&&(i.startsWith("!")||i.startsWith("-")?s="unload":s="load");return s}getInheritedEnabled(e){return this.inheritedEnabledByKey.get(this.getResourceItemKey(e))??(this.getItemScope(e)==="user"?e.enabled:!0)}isInheritedGlobalItem(e){return this.getItemScope(e)==="user"||this.inheritedEnabledByKey.has(this.getResourceItemKey(e))}getTopLevelOverridePatterns(e,n){let r=this.getTopLevelBaseDir(n),s=new Set([this.getResourcePatternForScope(e,n),e.path,(0,uf.relative)(r,e.path)]);return e.metadata.baseDir&&s.add((0,uf.relative)(e.metadata.baseDir,e.path)),s}getResourcePatternForScope(e,n){let r=this.getItemScope(e);if(n!==r)return e.path;let s=e.metadata.baseDir??this.getTopLevelBaseDir(r);return(0,uf.relative)(s,e.path)}createPackageOverrideSource(e){let n=e.metadata.source;if(!UE(n))return{source:n,autoload:!1};let r=jn(n,this.getTopLevelBaseDir(this.getItemScope(e)),{trim:!0});return{source:(0,uf.relative)(this.getTopLevelBaseDir("project"),r)||".",autoload:!1}}packageSourceStringMatches(e,n,r,s){if(e===r)return!0;if(!UE(e)||!UE(r))return!1;let i=jn(e,this.getTopLevelBaseDir(n),{trim:!0}),o=jn(r,this.getTopLevelBaseDir(s),{trim:!0});return i===o}findMatchingPackageSource(e,n){return((n==="project"?this.settingsManager.getProjectSettings():this.settingsManager.getGlobalSettings()).packages??[]).find(s=>this.packageSourceStringMatches(e.metadata.source,this.getItemScope(e),typeof s=="string"?s:s.source,n))}getPatternEntryTarget(e){return e.startsWith("!")||e.startsWith("+")||e.startsWith("-")?e.slice(1):e}getResourceItemKey(e){return`${e.resourceType}:${fu(e.path)}`}getItemScope(e){return e.metadata.scope==="project"?"project":"user"}getTopLevelBaseDir(e){return e==="project"?(0,uf.join)(this.cwd,ws):this.agentDir}getResourcePattern(e){let n=e.metadata.scope,r=e.metadata.baseDir??this.getTopLevelBaseDir(n);return(0,uf.relative)(r,e.path)}getPackageResourcePattern(e){let n=e.metadata.baseDir??(0,uf.dirname)(e.path);return(0,uf.relative)(n,e.path)}},DTe=class extends _n{header;resourceList;writeScope;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.resourceList.focused=e}constructor(e,n,r,s,i,o,a,c,u="global",l=!0){super(),this.writeScope=u;let d={global:tLn(e.global,s),project:tLn(e.project,s)};this.addChild(new Nt(1)),this.addChild(new Ln),this.addChild(new Nt(1)),this.header=new xat(this.writeScope,l),this.addChild(this.header),this.addChild(new Nt(1)),this.resourceList=new wat(d,n,r,s,c,this.writeScope),this.resourceList.onCancel=i,this.resourceList.onExit=o,this.resourceList.onToggle=()=>a(),l&&(this.resourceList.onSwitchMode=()=>{this.switchWriteScope(),a()}),this.addChild(this.resourceList),this.addChild(new Nt(1)),this.addChild(new Ln)}switchWriteScope(){this.writeScope=this.writeScope==="global"?"project":"global",this.header.setWriteScope(this.writeScope),this.resourceList.setWriteScope(this.writeScope)}getResourceList(){return this.resourceList}};async function rLn(t){return KC(t.settingsManager.getTheme(),!0),new Promise(e=>{let n=new JA(new YC,t.settingsManager.getShowHardwareCursor(),t.agentDir);n.setClearOnShrink(t.settingsManager.getClearOnShrink());let r=!1,s=new DTe(t.resolvedPaths,t.settingsManager,t.cwd,t.agentDir,()=>{r||(r=!0,n.stop(),d0(),e())},()=>{n.stop(),d0(),process.exit(0)},()=>n.requestRender(),n.terminal.rows,t.writeScope,t.projectModeAvailable);n.addChild(s),n.setFocus(s.getResourceList()),n.start()})}p();var sLn=require("node:crypto"),BI=require("node:fs"),Xh=require("node:path");var sWs=".pi-native-quarantine";function Tat(t){return(0,Xh.toNamespacedPath)((0,Xh.resolve)(t))}function iLn(t){let e=(0,Xh.resolve)(t);for(;;){if((0,Xh.basename)(e).toLowerCase()==="node_modules")return(0,Xh.join)(e,sWs);let n=(0,Xh.dirname)(e);if(n===e)return;e=n}}function iWs(t){let e=process.report.getReport().sharedObjects;if(!Array.isArray(e))return[];let n=Tat(t).toLowerCase(),r=new Set,s=[];for(let i of e){if(typeof i!="string")continue;let o=Tat(i),a=o.toLowerCase();IM(a,n)===void 0||r.has(a)||(r.add(a),s.push(o))}return s}function BTe(t){let e=iLn(t);if(e)try{(0,BI.rmSync)(e,{recursive:!0,force:!0})}catch{}}function oLn(t){let e=Tat(t),n=iLn(e);if(!n)return;let r=iWs(e);if(r.length===0)return;let s=(0,Xh.join)(n,`${Date.now()}-${process.pid}-${(0,sLn.randomUUID)()}`);for(let i of r){if(!(0,BI.existsSync)(i))continue;let o=(0,Xh.join)(s,(0,Xh.relative)(e,i));(0,BI.mkdirSync)((0,Xh.dirname)(o),{recursive:!0}),(0,BI.renameSync)(i,o),(0,BI.copyFileSync)(o,i)}}var oWs="https://pi.dev/api/installer/releases",aWs="managed-install.json",cWs=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;function dLn(){let t=process.env.PI_MANAGED_INSTALL_ROOT?.trim();if(!t)return;let e=(0,Ju.resolve)(t),n=fu((0,Ju.join)(e,"releases"));if(IM(fu(ul()),n)===void 0)return;let r=(0,Ju.join)(e,aWs);try{let s=JSON.parse((0,Jl.readFileSync)(r,"utf8"));if(s.kind!=="pi-managed-install"||s.schemaVersion!==1||s.layout!=="releases-v1")throw new Error}catch{throw new Error(`Managed install marker is missing or invalid: ${r}`)}return e}async function aLn(t,e){let n=await fetch(t,{headers:{"User-Agent":pD(Ad)}});if(!n.ok)throw new Error(`Could not download managed installer ${e} from ${t}: HTTP ${n.status}`);return await n.text()}async function lWs(t){let e=["ci","--ignore-scripts","--min-release-age=0","--omit=dev","--include=optional","--no-fund","--no-audit","--loglevel=error","--progress=false"],n=await q3(W3("npm",e,{cwd:t,stdio:"inherit"}));if(n!==0)throw new Error(`npm ${e.join(" ")} exited with code ${n??"unknown"}`)}function cLn(t,e){let n=(0,Ju.join)(t,"node_modules",".bin",process.platform==="win32"?`${An}.cmd`:An),r=Vw(n,["--version"],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(r.error||r.status!==0){let i=r.error?.message||r.stderr.trim()||`exit code ${r.status??"unknown"}`;throw new Error(`Could not verify managed Pi ${e}: ${i}`)}let s=r.stdout.trim();if(s!==e)throw new Error(`Managed Pi smoke test returned version ${s}; expected ${e}.`)}function lLn(t,e){let n=(0,Ju.join)(t,"current-version"),r=(0,Ju.join)(t,`current-version.tmp.${process.pid}-${Date.now()}`);try{(0,Jl.writeFileSync)(r,`${e} -`),(0,Jl.renameSync)(r,n)}finally{(0,Jl.rmSync)(r,{force:!0})}}function pLn(t){let e=(0,Ju.join)(t,"staging");try{for(let n of(0,Jl.readdirSync)(e))n.startsWith("update-")&&(0,Jl.rmSync)((0,Ju.join)(e,n),{force:!0,recursive:!0})}catch{}}function hLn(){let t;try{t=dLn()}catch{return}if(t)try{let e=Rat.default.lockSync((0,Ju.join)(t,"update"),{realpath:!1});try{pLn(t)}finally{e()}}catch{}}async function uWs(t,e){if(!cWs.test(e))throw new Error(`Invalid managed release version: ${e}`);let n;try{n=await Rat.default.lock((0,Ju.join)(t,"update"),{realpath:!1})}catch(s){throw s instanceof Error&&"code"in s&&s.code==="ELOCKED"?new Error("Another managed Pi update is already running."):s}let r;try{pLn(t);let i=`${(process.env.PI_INSTALLER_API_BASE?.trim()||oWs).replace(/\/+$/,"")}/${encodeURIComponent(e)}`,o=(0,Ju.join)(t,"staging"),a=(0,Ju.join)(t,"releases");(0,Jl.mkdirSync)(a,{recursive:!0});let c=(0,Ju.join)(a,e);if((0,Jl.existsSync)(c)){cLn(c,e),lLn(t,e);return}(0,Jl.mkdirSync)(o,{recursive:!0}),r=(0,Jl.mkdtempSync)((0,Ju.join)(o,"update-"));let[u,l]=await Promise.all([aLn(`${i}/package.json`,"package.json"),aLn(`${i}/package-lock.json`,"package-lock.json")]);(0,Jl.writeFileSync)((0,Ju.join)(r,"package.json"),u),(0,Jl.writeFileSync)((0,Ju.join)(r,"package-lock.json"),l),await lWs(r),cLn(r,e),(0,Jl.renameSync)(r,c),lLn(t,e)}finally{r&&(0,Jl.rmSync)(r,{force:!0,recursive:!0}),await n()}}var dWs={heading:t=>en.bold(en.yellow(t)),link:t=>en.cyan(t),linkUrl:t=>en.dim(t),code:t=>en.yellow(t),codeBlock:t=>en.dim(t),codeBlockBorder:t=>en.dim(t),quote:t=>en.dim(t),quoteBorder:t=>en.dim(t),hr:t=>en.dim(t),listBullet:t=>en.yellow(t),bold:t=>en.bold(t),italic:t=>en.italic(t),strikethrough:t=>en.strikethrough(t),underline:t=>en.underline(t)};function mLn(t,e){let n=t.drainErrors();for(let{scope:r,error:s}of n)console.error(en.yellow(`Warning (${e}, ${r} settings): ${s.message}`)),s.stack&&console.error(en.dim(s.stack))}function zT(t){switch(t){case"install":return`${An} install [-l] [--approve|--no-approve]`;case"remove":return`${An} remove [-l] [--approve|--no-approve]`;case"update":return`${An} update [source|self|pi] [--self|--extensions|--models|--all] [--extension ] [--approve|--no-approve] [--force]`;case"list":return`${An} list [--approve|--no-approve]`}}var vat=`${An} config [-l] [--approve|--no-approve]`;function pWs(){console.log(`${en.bold("Usage:")} - ${vat} +${s.join(` +`)}`),new Error(o)}let n=e;if(n.name.includes("/"))throw new Error(`Invalid theme name "${n.name}": theme names cannot contain "/" because it is reserved for automatic light/dark theme settings.`);return n}var Mr,oEs,wor,vor=v(()=>{p();Vm();nne();Mr=Ne.Union([Ne.String(),Ne.Integer({minimum:0,maximum:255})]),oEs=Ne.Object({$schema:Ne.Optional(Ne.String()),name:Ne.String(),vars:Ne.Optional(Ne.Record(Ne.String(),Mr)),colors:Ne.Object({accent:Mr,border:Mr,borderAccent:Mr,borderMuted:Mr,success:Mr,error:Mr,warning:Mr,muted:Mr,dim:Mr,text:Mr,thinkingText:Mr,scrollbarTrack:Ne.Optional(Mr),scrollbarThumb:Ne.Optional(Mr),selectedBg:Mr,searchMatchBg:Ne.Optional(Mr),searchMatchText:Ne.Optional(Mr),userMessageBg:Mr,userMessageText:Mr,customMessageBg:Mr,customMessageText:Mr,customMessageLabel:Mr,toolPendingBg:Mr,toolSuccessBg:Mr,toolErrorBg:Mr,toolTitle:Mr,toolOutput:Mr,mdHeading:Mr,mdLink:Mr,mdLinkUrl:Mr,mdCode:Mr,mdCodeBlock:Mr,mdCodeBlockBorder:Mr,mdQuote:Mr,mdQuoteBorder:Mr,mdHr:Mr,mdListBullet:Mr,toolDiffAdded:Mr,toolDiffRemoved:Mr,toolDiffContext:Mr,syntaxComment:Mr,syntaxKeyword:Mr,syntaxFunction:Mr,syntaxVariable:Mr,syntaxString:Mr,syntaxNumber:Mr,syntaxType:Mr,syntaxOperator:Mr,syntaxPunctuation:Mr,thinkingOff:Mr,thinkingMinimal:Mr,thinkingLow:Mr,thinkingMedium:Mr,thinkingHigh:Mr,thinkingXhigh:Mr,thinkingMax:Ne.Optional(Mr),bashMode:Mr}),export:Ne.Optional(Ne.Object({pageBg:Ne.Optional(Mr),cardBg:Ne.Optional(Mr),infoBg:Ne.Optional(Mr)}))}),wor=oR(oEs)});function h_t(t){let e=(0,kor.homedir)(),n;return t===e?n="~":t.startsWith(e)?n=`~${t.slice(e.length).replace(/\\/g,"/")}`:n=t.replace(/\\/g,"/"),n.endsWith("/")?n:`${n}/`}function lEs(t,e){return t.origin==="package"?`${t.source} (${t.scope})`:t.source==="auto"?t.baseDir?t.scope==="user"?`User (${h_t(t.baseDir)})`:`Project (${h_t(t.baseDir)})`:t.scope==="user"?`User (${h_t(e)})`:`Project (${Bi}/)`:t.scope==="user"?"User settings":"Project settings"}function Ror(t,e){let n=new Map,r=(o,a)=>{for(let c of o){let{path:u,enabled:l,metadata:d}=c,m=`${d.origin}:${d.scope}:${d.source}:${d.baseDir??""}`;n.has(m)||n.set(m,{key:m,label:lEs(d,e),scope:d.scope,origin:d.origin,source:d.source,subgroups:[]});let h=n.get(m),f=`${m}:${a}`,g=h.subgroups.find(_=>_.type===a);g||(g={type:a,label:cEs[a],items:[]},h.subgroups.push(g));let A=(0,Ng.basename)(u),y=(0,Ng.basename)((0,Ng.dirname)(u)),E;a==="extensions"&&y!=="extensions"?E=`${y}/${A}`:a==="skills"&&A==="SKILL.md"?E=y:E=A,g.items.push({path:u,enabled:l,metadata:d,resourceType:a,displayName:E,groupKey:m,subgroupKey:f})}};r(t.extensions,"extensions"),r(t.skills,"skills"),r(t.prompts,"prompts"),r(t.themes,"themes");let i=Array.from(n.values());i.sort((o,a)=>o.origin!==a.origin?o.origin==="package"?-1:1:o.scope!==a.scope?o.scope==="user"?-1:1:o.source.localeCompare(a.source));let s={extensions:0,skills:1,prompts:2,themes:3};for(let o of i){o.subgroups.sort((a,c)=>s[a.type]-s[c.type]);for(let a of o.subgroups)a.items.sort((c,u)=>c.displayName.localeCompare(u.displayName))}return i}var kor,Ng,aEs,cEs,f_t,g_t,VPe,Bor=v(()=>{p();kor=require("node:os"),Ng=require("node:path");Tr();Qs();fc();pi();Ll();ha();aEs=["extensions","skills","prompts","themes"],cEs={extensions:"Extensions",skills:"Skills",prompts:"Prompts",themes:"Themes"};f_t=class{writeScope;projectModeAvailable;constructor(e,n){this.writeScope=e,this.projectModeAvailable=n}setWriteScope(e){this.writeScope=e}invalidate(){}render(e){let n=Ee.bold(this.writeScope==="project"?"Project Local Resources":"Global Resources"),r=Ee.fg("muted"," \xB7 "),i=this.projectModeAvailable?nr("tui.input.tab","switch mode")+r:"",s=this.writeScope==="project"?iu("space","cycle inherit/+/-"):iu("space","toggle"),o=i+s+r+iu("esc","close"),a=Math.max(1,e-rn(n)-rn(o)),c=this.writeScope==="project"?Ee.fg("muted",`${Bi}/settings.json \xB7 inherited global resources are dimmed`):Ee.fg("muted",`~/${Bi}/agent/settings.json`);return[dr(`${n}${" ".repeat(a)}${o}`,e,""),dr(c,e,"")]}},g_t=class{groupsByScope;flatItems=[];filteredItems=[];selectedIndex=0;searchInput;maxVisible;settingsManager;cwd;agentDir;writeScope;inheritedEnabledByKey;onCancel;onExit;onToggle;onSwitchMode;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.searchInput.focused=e}constructor(e,n,r,i,s,o="global"){this.groupsByScope=e,this.settingsManager=n,this.cwd=r,this.agentDir=i,this.writeScope=o,this.inheritedEnabledByKey=this.buildInheritedEnabledMap(e.global),this.searchInput=new ma;let a=8;this.maxVisible=Math.max(5,(s??24)-a),this.buildFlatList(),this.filteredItems=[...this.flatItems]}setWriteScope(e){this.writeScope=e,this.buildFlatList(),this.filterItems(this.searchInput.getValue())}get groups(){return this.groupsByScope[this.writeScope]}buildInheritedEnabledMap(e){let n=new Map;for(let r of e)for(let i of r.subgroups)for(let s of i.items)n.set(this.getResourceItemKey(s),s.enabled);return n}buildFlatList(){this.flatItems=[];for(let e of this.groups){this.flatItems.push({type:"group",group:e});for(let n of e.subgroups){this.flatItems.push({type:"subgroup",subgroup:n,group:e});for(let r of n.items)this.flatItems.push({type:"item",item:r})}}this.selectedIndex=this.flatItems.findIndex(e=>e.type==="item"),this.selectedIndex<0&&(this.selectedIndex=0)}findNextItem(e,n){let r=e+n;for(;r>=0&&rn.type==="item");this.selectedIndex=e>=0?e:0}updateItem(e,n){e.enabled=n;for(let r of this.groups)for(let i of r.subgroups){let s=i.items.find(o=>o.path===e.path&&o.resourceType===e.resourceType);if(s){s.enabled=n;return}}}invalidate(){}render(e){let n=[];if(n.push(...this.searchInput.render(e)),n.push(""),this.filteredItems.length===0)return n.push(Ee.fg("muted"," No resources found")),n;let r=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredItems.length-this.maxVisible)),i=Math.min(r+this.maxVisible,this.filteredItems.length);for(let s=r;s ":" ",l=this.isDimmedItem(c),d=a&&!l?Ee.bold(c.displayName):c.displayName,m=l?Ee.fg("dim",d):d;n.push(dr(`${u} ${this.renderCheckbox(c)} ${m}${this.getItemSuffix(c)}`,e,"..."))}}if(r>0||ia.type==="item").length,o=this.filteredItems.slice(0,this.selectedIndex).filter(a=>a.type==="item").length+1;n.push(Ee.fg("dim",` (${o}/${s})`))}return n}handleInput(e){let n=Ai();if(n.matches(e,"tui.select.up")){this.selectedIndex=this.findNextItem(this.selectedIndex,-1);return}if(n.matches(e,"tui.select.down")){this.selectedIndex=this.findNextItem(this.selectedIndex,1);return}if(n.matches(e,"tui.select.pageUp")){let r=Math.max(0,this.selectedIndex-this.maxVisible);for(;r=0&&this.filteredItems[r].type!=="item";)r--;r>=0&&(this.selectedIndex=r);return}if(n.matches(e,"tui.select.cancel")){this.onCancel?.();return}if(sm(e,"ctrl+c")){this.onExit?.();return}if(n.matches(e,"tui.input.tab")){this.onSwitchMode?.();return}if(e===" "||n.matches(e,"tui.select.confirm")){let r=this.filteredItems[this.selectedIndex];if(r?.type==="item"&&(this.writeScope==="project"||this.getItemScope(r.item)==="user")){let i=this.toggleResource(r.item);i!==void 0&&(this.updateItem(r.item,i),this.onToggle?.(r.item,i))}return}this.searchInput.handleInput(e),this.filterItems(this.searchInput.getValue())}toggleResource(e){if(this.writeScope==="project"){let r=this.getNextOverrideState(e);return this.setProjectResourceOverride(e,r)?r==="inherit"?this.getInheritedEnabled(e):r==="load":void 0}let n=!e.enabled;return e.metadata.origin==="top-level"?this.toggleTopLevelResource(e,n):this.togglePackageResource(e,n),n}toggleTopLevelResource(e,n){let r=e.metadata.scope,i=r==="project"?this.settingsManager.getProjectSettings():this.settingsManager.getGlobalSettings(),s=e.resourceType,o=i[s]??[],a=this.getResourcePattern(e),c=`-${a}`,u=`+${a}`,l=o.filter(d=>(d.startsWith("!")||d.startsWith("+")||d.startsWith("-")?d.slice(1):d)!==a);n?l.push(u):l.push(c),r==="project"?s==="extensions"?this.settingsManager.setProjectExtensionPaths(l):s==="skills"?this.settingsManager.setProjectSkillPaths(l):s==="prompts"?this.settingsManager.setProjectPromptTemplatePaths(l):s==="themes"&&this.settingsManager.setProjectThemePaths(l):s==="extensions"?this.settingsManager.setExtensionPaths(l):s==="skills"?this.settingsManager.setSkillPaths(l):s==="prompts"?this.settingsManager.setPromptTemplatePaths(l):s==="themes"&&this.settingsManager.setThemePaths(l)}togglePackageResource(e,n){let r=e.metadata.scope,s=[...(r==="project"?this.settingsManager.getProjectSettings():this.settingsManager.getGlobalSettings()).packages??[]],o=s.findIndex(g=>(typeof g=="string"?g:g.source)===e.metadata.source);if(o===-1)return;let a=s[o];typeof a=="string"&&(a={source:a},s[o]=a);let c=e.resourceType,u=a[c]??[],l=this.getPackageResourcePattern(e),d=`-${l}`,m=`+${l}`,h=u.filter(g=>(g.startsWith("!")||g.startsWith("+")||g.startsWith("-")?g.slice(1):g)!==l);n?h.push(m):h.push(d),a[c]=h.length>0?h:void 0,["extensions","skills","prompts","themes"].some(g=>a[g]!==void 0)||(s[o]=a.source),r==="project"?this.settingsManager.setProjectPackages(s):this.settingsManager.setPackages(s)}renderCheckbox(e){if(this.writeScope==="project"){let n=this.getProjectOverrideState(e);return n==="load"?Ee.fg("success","[+]"):n==="unload"?Ee.fg("warning","[-]"):Ee.fg("dim",e.enabled?"[x]":"[ ]")}return e.enabled?Ee.fg("success","[x]"):Ee.fg("dim","[ ]")}getItemSuffix(e){if(this.writeScope!=="project")return"";let n=this.getProjectOverrideState(e);return n==="load"?Ee.fg("muted"," project load"):n==="unload"?Ee.fg("muted"," project unload"):this.isInheritedGlobalItem(e)?Ee.fg("dim"," inherited global"):""}isDimmedItem(e){return this.writeScope==="project"&&this.isInheritedGlobalItem(e)&&this.getProjectOverrideState(e)==="inherit"}setProjectResourceOverride(e,n){return e.metadata.origin==="top-level"?this.setProjectTopLevelOverride(e,n):this.setProjectPackageOverride(e,n)}setProjectTopLevelOverride(e,n){let r=this.settingsManager.getProjectSettings()[e.resourceType]??[],i=this.isInheritedGlobalItem(e)?e.path:this.getResourcePatternForScope(e,"project"),s=this.getTopLevelOverridePatterns(e,"project"),o=r.filter(a=>{let c=this.getPatternEntryTarget(a);return(a.startsWith("!")||a.startsWith("+")||a.startsWith("-"))&&s.has(c)?!1:!(n==="inherit"&&this.isInheritedGlobalItem(e)&&c===i)});return n!=="inherit"&&(this.isInheritedGlobalItem(e)&&!o.includes(i)&&o.push(i),o.push(`${n==="load"?"+":"-"}${i}`)),this.setProjectTopLevelPaths(e.resourceType,o),!0}setProjectTopLevelPaths(e,n){e==="extensions"?this.settingsManager.setProjectExtensionPaths(n):e==="skills"?this.settingsManager.setProjectSkillPaths(n):e==="prompts"?this.settingsManager.setProjectPromptTemplatePaths(n):this.settingsManager.setProjectThemePaths(n)}setProjectPackageOverride(e,n){let r=[...this.settingsManager.getProjectSettings().packages??[]],i=r.findIndex(c=>this.packageSourceStringMatches(e.metadata.source,this.getItemScope(e),typeof c=="string"?c:c.source,"project"));if(i===-1){if(n==="inherit")return!1;r.push(this.createPackageOverrideSource(e)),i=r.length-1}let s=r[i];if(s===void 0)return!1;typeof s=="string"&&(s={source:s},r[i]=s);let o=this.getPackageResourcePattern(e),a=(s[e.resourceType]??[]).filter(c=>this.getPatternEntryTarget(c)!==o);return n!=="inherit"&&a.push(`${n==="load"?"+":"-"}${o}`),s[e.resourceType]=a.length>0?a:void 0,aEs.some(c=>s[c]!==void 0)||(s.autoload===!1?r.splice(i,1):r[i]=s.source),this.settingsManager.setProjectPackages(r),!0}getNextOverrideState(e){let n=this.getProjectOverrideState(e),r=this.getInheritedEnabled(e);return n==="inherit"?r?"unload":"load":n==="unload"?r?"load":"inherit":r?"inherit":"unload"}getProjectOverrideState(e){if(this.writeScope!=="project")return"inherit";if(e.metadata.origin==="top-level")return this.getOverrideStateFromEntries(this.settingsManager.getProjectSettings()[e.resourceType]??[],this.getTopLevelOverridePatterns(e,"project"),!1);let n=this.findMatchingPackageSource(e,"project");if(typeof n!="object")return"inherit";let r=n[e.resourceType];return r===void 0?"inherit":this.getOverrideStateFromEntries(r,new Set([this.getPackageResourcePattern(e)]),n.autoload!==!1)}getOverrideStateFromEntries(e,n,r){if(e.length===0&&r)return"unload";let i="inherit";for(let s of e)n.has(this.getPatternEntryTarget(s))&&(s.startsWith("!")||s.startsWith("-")?i="unload":i="load");return i}getInheritedEnabled(e){return this.inheritedEnabledByKey.get(this.getResourceItemKey(e))??(this.getItemScope(e)==="user"?e.enabled:!0)}isInheritedGlobalItem(e){return this.getItemScope(e)==="user"||this.inheritedEnabledByKey.has(this.getResourceItemKey(e))}getTopLevelOverridePatterns(e,n){let r=this.getTopLevelBaseDir(n),i=new Set([this.getResourcePatternForScope(e,n),e.path,(0,Ng.relative)(r,e.path)]);return e.metadata.baseDir&&i.add((0,Ng.relative)(e.metadata.baseDir,e.path)),i}getResourcePatternForScope(e,n){let r=this.getItemScope(e);if(n!==r)return e.path;let i=e.metadata.baseDir??this.getTopLevelBaseDir(r);return(0,Ng.relative)(i,e.path)}createPackageOverrideSource(e){let n=e.metadata.source;if(!Ab(n))return{source:n,autoload:!1};let r=Vn(n,this.getTopLevelBaseDir(this.getItemScope(e)),{trim:!0});return{source:(0,Ng.relative)(this.getTopLevelBaseDir("project"),r)||".",autoload:!1}}packageSourceStringMatches(e,n,r,i){if(e===r)return!0;if(!Ab(e)||!Ab(r))return!1;let s=Vn(e,this.getTopLevelBaseDir(n),{trim:!0}),o=Vn(r,this.getTopLevelBaseDir(i),{trim:!0});return s===o}findMatchingPackageSource(e,n){return((n==="project"?this.settingsManager.getProjectSettings():this.settingsManager.getGlobalSettings()).packages??[]).find(i=>this.packageSourceStringMatches(e.metadata.source,this.getItemScope(e),typeof i=="string"?i:i.source,n))}getPatternEntryTarget(e){return e.startsWith("!")||e.startsWith("+")||e.startsWith("-")?e.slice(1):e}getResourceItemKey(e){return`${e.resourceType}:${cd(e.path)}`}getItemScope(e){return e.metadata.scope==="project"?"project":"user"}getTopLevelBaseDir(e){return e==="project"?(0,Ng.join)(this.cwd,Bi):this.agentDir}getResourcePattern(e){let n=e.metadata.scope,r=e.metadata.baseDir??this.getTopLevelBaseDir(n);return(0,Ng.relative)(r,e.path)}getPackageResourcePattern(e){let n=e.metadata.baseDir??(0,Ng.dirname)(e.path);return(0,Ng.relative)(n,e.path)}},VPe=class extends gn{header;resourceList;writeScope;_focused=!1;get focused(){return this._focused}set focused(e){this._focused=e,this.resourceList.focused=e}constructor(e,n,r,i,s,o,a,c,u="global",l=!0){super(),this.writeScope=u;let d={global:Ror(e.global,i),project:Ror(e.project,i)};this.addChild(new Tt(1)),this.addChild(new Un),this.addChild(new Tt(1)),this.header=new f_t(this.writeScope,l),this.addChild(this.header),this.addChild(new Tt(1)),this.resourceList=new g_t(d,n,r,i,c,this.writeScope),this.resourceList.onCancel=s,this.resourceList.onExit=o,this.resourceList.onToggle=()=>a(),l&&(this.resourceList.onSwitchMode=()=>{this.switchWriteScope(),a()}),this.addChild(this.resourceList),this.addChild(new Tt(1)),this.addChild(new Un)}switchWriteScope(){this.writeScope=this.writeScope==="global"?"project":"global",this.header.setWriteScope(this.writeScope),this.resourceList.setWriteScope(this.writeScope)}getResourceList(){return this.resourceList}}});async function Nor(t){return lw(t.settingsManager.getTheme(),!0),new Promise(e=>{let n=new EE(new cw,t.settingsManager.getShowHardwareCursor(),t.agentDir);n.setClearOnShrink(t.settingsManager.getClearOnShrink());let r=!1,i=new VPe(t.resolvedPaths,t.settingsManager,t.cwd,t.agentDir,()=>{r||(r=!0,n.stop(),uS(),e())},()=>{n.stop(),uS(),process.exit(0)},()=>n.requestRender(),n.terminal.rows,t.writeScope,t.projectModeAvailable);n.addChild(i),n.setFocus(i.getResourceList()),n.start()})}var Dor=v(()=>{p();Tr();Bor();pi()});function A_t(t){return(0,lf.toNamespacedPath)((0,lf.resolve)(t))}function Mor(t){let e=(0,lf.resolve)(t);for(;;){if((0,lf.basename)(e).toLowerCase()==="node_modules")return(0,lf.join)(e,uEs);let n=(0,lf.dirname)(e);if(n===e)return;e=n}}function dEs(t){let e=process.report.getReport().sharedObjects;if(!Array.isArray(e))return[];let n=A_t(t).toLowerCase(),r=new Set,i=[];for(let s of e){if(typeof s!="string")continue;let o=A_t(s),a=o.toLowerCase();QF(a,n)===void 0||r.has(a)||(r.add(a),i.push(o))}return i}function YPe(t){let e=Mor(t);if(e)try{(0,tT.rmSync)(e,{recursive:!0,force:!0})}catch{}}function Oor(t){let e=A_t(t),n=Mor(e);if(!n)return;let r=dEs(e);if(r.length===0)return;let i=(0,lf.join)(n,`${Date.now()}-${process.pid}-${(0,Por.randomUUID)()}`);for(let s of r){if(!(0,tT.existsSync)(s))continue;let o=(0,lf.join)(i,(0,lf.relative)(e,s));(0,tT.mkdirSync)((0,lf.dirname)(o),{recursive:!0}),(0,tT.renameSync)(s,o),(0,tT.copyFileSync)(o,s)}}var Por,tT,lf,uEs,y_t=v(()=>{p();Por=require("node:crypto"),tT=require("node:fs"),lf=require("node:path");fc();uEs=".pi-native-quarantine"});function Gor(){let t=process.env.PI_MANAGED_INSTALL_ROOT?.trim();if(!t)return;let e=(0,$d.resolve)(t),n=cd((0,$d.join)(e,"releases"));if(QF(cd(eu()),n)===void 0)return;let r=(0,$d.join)(e,mEs);try{let i=JSON.parse((0,Gu.readFileSync)(r,"utf8"));if(i.kind!=="pi-managed-install"||i.schemaVersion!==1||i.layout!=="releases-v1")throw new Error}catch{throw new Error(`Managed install marker is missing or invalid: ${r}`)}return e}async function Lor(t,e){let n=await fetch(t,{headers:{"User-Agent":hw(Nl)}});if(!n.ok)throw new Error(`Could not download managed installer ${e} from ${t}: HTTP ${n.status}`);return await n.text()}async function fEs(t){let e=["ci","--ignore-scripts","--min-release-age=0","--omit=dev","--include=optional","--no-fund","--no-audit","--loglevel=error","--progress=false"],n=await B8(k8("npm",e,{cwd:t,stdio:"inherit"}));if(n!==0)throw new Error(`npm ${e.join(" ")} exited with code ${n??"unknown"}`)}function For(t,e){let n=(0,$d.join)(t,"node_modules",".bin",process.platform==="win32"?`${hn}.cmd`:hn),r=SR(n,["--version"],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(r.error||r.status!==0){let s=r.error?.message||r.stderr.trim()||`exit code ${r.status??"unknown"}`;throw new Error(`Could not verify managed Pi ${e}: ${s}`)}let i=r.stdout.trim();if(i!==e)throw new Error(`Managed Pi smoke test returned version ${i}; expected ${e}.`)}function Qor(t,e){let n=(0,$d.join)(t,"current-version"),r=(0,$d.join)(t,`current-version.tmp.${process.pid}-${Date.now()}`);try{(0,Gu.writeFileSync)(r,`${e} +`),(0,Gu.renameSync)(r,n)}finally{(0,Gu.rmSync)(r,{force:!0})}}function $or(t){let e=(0,$d.join)(t,"staging");try{for(let n of(0,Gu.readdirSync)(e))n.startsWith("update-")&&(0,Gu.rmSync)((0,$d.join)(e,n),{force:!0,recursive:!0})}catch{}}function Wor(){let t;try{t=Gor()}catch{return}if(t)try{let e=b_t.default.lockSync((0,$d.join)(t,"update"),{realpath:!1});try{$or(t)}finally{e()}}catch{}}async function gEs(t,e){if(!hEs.test(e))throw new Error(`Invalid managed release version: ${e}`);let n;try{n=await b_t.default.lock((0,$d.join)(t,"update"),{realpath:!1})}catch(i){throw i instanceof Error&&"code"in i&&i.code==="ELOCKED"?new Error("Another managed Pi update is already running."):i}let r;try{$or(t);let s=`${(process.env.PI_INSTALLER_API_BASE?.trim()||pEs).replace(/\/+$/,"")}/${encodeURIComponent(e)}`,o=(0,$d.join)(t,"staging"),a=(0,$d.join)(t,"releases");(0,Gu.mkdirSync)(a,{recursive:!0});let c=(0,$d.join)(a,e);if((0,Gu.existsSync)(c)){For(c,e),Qor(t,e);return}(0,Gu.mkdirSync)(o,{recursive:!0}),r=(0,Gu.mkdtempSync)((0,$d.join)(o,"update-"));let[u,l]=await Promise.all([Lor(`${s}/package.json`,"package.json"),Lor(`${s}/package-lock.json`,"package-lock.json")]);(0,Gu.writeFileSync)((0,$d.join)(r,"package.json"),u),(0,Gu.writeFileSync)((0,$d.join)(r,"package-lock.json"),l),await fEs(r),For(r,e),(0,Gu.renameSync)(r,c),Qor(t,e)}finally{r&&(0,Gu.rmSync)(r,{force:!0,recursive:!0}),await n()}}function Hor(t,e){let n=t.drainErrors();for(let{scope:r,error:i}of n)console.error(tn.yellow(`Warning (${e}, ${r} settings): ${i.message}`)),i.stack&&console.error(tn.dim(i.stack))}function Nk(t){switch(t){case"install":return`${hn} install [-l] [--approve|--no-approve]`;case"remove":return`${hn} remove [-l] [--approve|--no-approve]`;case"update":return`${hn} update [source|self|pi] [--self|--extensions|--models|--all] [--extension ] [--approve|--no-approve] [--force]`;case"list":return`${hn} list [--approve|--no-approve]`}}function yEs(){console.log(`${tn.bold("Usage:")} + ${E_t} Open the resource configuration TUI to enable or disable package resources. -Without -l, starts in global settings (~/${ws}/agent/settings.json). +Without -l, starts in global settings (~/${Bi}/agent/settings.json). Press Tab in the TUI to switch between global and project-local modes. Options: - -l, --local Edit project overrides (${ws}/settings.json) + -l, --local Edit project overrides (${Bi}/settings.json) -a, --approve Trust project-local files for this command with -l -na, --no-approve Ignore project-local files for this command with -l -`)}function hWs(t){switch(t){case"install":console.log(`${en.bold("Usage:")} - ${zT("install")} +`)}function EEs(t){switch(t){case"install":console.log(`${tn.bold("Usage:")} + ${Nk("install")} Install a package and add it to settings. Options: - -l, --local Install project-locally (${ws}/settings.json) + -l, --local Install project-locally (${Bi}/settings.json) -a, --approve Trust project-local files for this command -na, --no-approve Ignore project-local files for this command Examples: - ${An} install npm:@foo/bar - ${An} install git:github.com/user/repo - ${An} install git:git@github.com:user/repo - ${An} install https://github.com/user/repo - ${An} install ssh://git@github.com/user/repo - ${An} install ./local/path -`);return;case"remove":console.log(`${en.bold("Usage:")} - ${zT("remove")} + ${hn} install npm:@foo/bar + ${hn} install git:github.com/user/repo + ${hn} install git:git@github.com:user/repo + ${hn} install https://github.com/user/repo + ${hn} install ssh://git@github.com/user/repo + ${hn} install ./local/path +`);return;case"remove":console.log(`${tn.bold("Usage:")} + ${Nk("remove")} Remove a package and its source from settings. -Alias: ${An} uninstall [-l] +Alias: ${hn} uninstall [-l] Options: - -l, --local Remove from project settings (${ws}/settings.json) + -l, --local Remove from project settings (${Bi}/settings.json) -a, --approve Trust project-local files for this command -na, --no-approve Ignore project-local files for this command Examples: - ${An} remove npm:@foo/bar - ${An} uninstall npm:@foo/bar -`);return;case"update":console.log(`${en.bold("Usage:")} - ${zT("update")} + ${hn} remove npm:@foo/bar + ${hn} uninstall npm:@foo/bar +`);return;case"update":console.log(`${tn.bold("Usage:")} + ${Nk("update")} Update pi, installed packages, or model catalogs. @@ -2331,85 +2340,108 @@ Options: --force Reinstall pi even if the current version is latest Short forms: - ${An} update Update pi only - ${An} update --all Update pi and all extensions - ${An} update --models Refresh model catalogs only - ${An} update Update one package - ${An} update pi Update pi only (self works as alias to pi) -`);return;case"list":console.log(`${en.bold("Usage:")} - ${zT("list")} + ${hn} update Update pi only + ${hn} update --all Update pi and all extensions + ${hn} update --models Refresh model catalogs only + ${hn} update Update one package + ${hn} update pi Update pi only (self works as alias to pi) +`);return;case"list":console.log(`${tn.bold("Usage:")} + ${Nk("list")} List installed packages from user and project settings. Options: -a, --approve Trust project-local files for this command -na, --no-approve Ignore project-local files for this command -`);return}}function mWs(t){let[e,...n]=t,r;if(e==="uninstall"?r="remove":(e==="install"||e==="remove"||e==="update"||e==="list")&&(r=e),!r)return;let s=!1,i=!1,o,a=!1,c,u,l,d,h,m=!1,f=!1,g=!1,A=!1,y;for(let C=0;Ce.abort(),15e3);try{let s=await(await Hh.create({authPath:(0,Ju.join)(t,"auth.json"),modelsPath:(0,Ju.join)(t,"models.json"),allowModelNetwork:!1,signal:e.signal})).refresh({allowNetwork:!0,force:!0,signal:e.signal});if(s.aborted)throw new Error("Model catalog refresh timed out.");if(s.errors.size>0){let i=Array.from(s.errors,([o,a])=>`${o}: ${a.message}`).join("; ");throw new Error(`Could not refresh model catalogs: ${i}`)}}finally{clearTimeout(n)}console.log(en.green("Model catalogs refreshed"))}function yWs(t,e=TN){console.error(`error: ${An} cannot self-update this installation.`),console.error(urn(TN,t,e));let n=process.argv[1];n&&(console.error(""),console.error(`Location of ${An} executable: ${n}`))}function EWs(t){console.error(en.dim(`If this keeps failing, run this command yourself: ${t.display}`))}function bWs(){console.error(en.yellow("If pnpm reports missing package versions, its cached registry metadata may be stale.")),console.error(en.yellow(`Run \`pnpm store prune\` and retry \`${An} update --self\`.`))}function uLn(t){let e=t.trim();if(e){console.log(),console.log(en.bold(en.yellow("Update note")));try{let n=Math.max(20,process.stdout.columns??80),r=new Hc(e,0,0,dWs).render(n).map(s=>s.trimEnd());console.log(r.join(` -`))}catch{console.log(e)}console.log()}}async function _Ws(t){let e;try{e=await Vot(Ad,{retry:!0})}catch(s){throw new Error(`Could not determine latest ${An} version: ${DOn(s)}`,{cause:s})}if(!e)throw new Error(`Could not determine latest ${An} version.`);let n=e.packageName??TN,r=`${n}@${e.version}`;return t||n!==TN||Hot(e.version,Ad)?{packageName:n,installSpec:r,version:e.version,...e.note?{note:e.note}:{},shouldRun:!0}:(console.log(en.green(`${An} is already up to date (v${Ad})`)),{packageName:n,installSpec:r,version:e.version,shouldRun:!1})}async function SWs(t){console.log(en.dim(`Updating ${An} with ${t.display}...`));for(let e of t.steps??[t])await new Promise((n,r)=>{let s=W3(e.command,e.args,{stdio:"inherit"});s.on("error",i=>{r(i)}),s.on("close",(i,o)=>{i===0?n():r(o?new Error(`${e.display} terminated by signal ${o}`):new Error(`${e.display} exited with code ${i??"unknown"}`))})})}function CWs(){if(process.platform!=="win32")return;let t=ul();BTe(t),oLn(t)}function IWs(){return process.stdin.isTTY&&process.stdout.isTTY?"interactive":"print"}function fLn(t){for(let e of t)console.error(en.yellow(`Warning: ${e}`))}async function gLn(t){let e=El.create(t.cwd,t.agentDir,{projectTrusted:!1}),n=[],r=new M0(t.agentDir);if(t.useSavedProjectTrustOnly){let a=r.get(t.cwd)===!0;return e.setProjectTrusted(t.projectTrustOverride??a),{settingsManager:e,projectTrustWarnings:n}}let s=IWs(),i=t.projectTrustOverride===void 0&&fb(t.cwd)?await new B0({cwd:t.cwd,agentDir:t.agentDir,settingsManager:e,extensionFactories:t.extensionFactories}).loadProjectTrustExtensions():void 0;for(let a of i?.errors??[])n.push(`Failed to load extension "${a.path}": ${a.error}`);let o=await eTe({cwd:t.cwd,trustStore:r,trustOverride:t.projectTrustOverride,defaultProjectTrust:e.getDefaultProjectTrust(),extensionsResult:i,projectTrustContext:Zwe({cwd:t.cwd,mode:s,settingsManager:e,hasUI:s==="interactive"}),onExtensionError:a=>n.push(a)});return e.setProjectTrusted(o),{settingsManager:e,projectTrustWarnings:n}}async function ALn(t,e={}){let[n,...r]=t;if(n!=="config")return!1;if(r.includes("-h")||r.includes("--help"))return pWs(),!0;let s=!1,i;for(let m of r)if(m==="-l"||m==="--local")s=!0;else if(m==="-a"||m==="--approve")i=!0;else if(m==="-na"||m==="--no-approve")i=!1;else return m.startsWith("-")?(console.error(en.red(`Unknown option ${m} for "config".`)),console.error(en.dim(`Use "${An} --help" or "${vat}".`)),process.exitCode=1,!0):(console.error(en.red(`Unexpected argument ${m}.`)),console.error(en.dim(`Usage: ${vat}`)),process.exitCode=1,!0);let o=process.cwd(),a=ls(),{settingsManager:c,projectTrustWarnings:u}=await gLn({cwd:o,agentDir:a,projectTrustOverride:i,extensionFactories:e.extensionFactories});if(fLn(u),s&&!c.isProjectTrusted())return console.error(en.red("Project is not trusted. Use --approve to modify local resource config.")),process.exitCode=1,!0;mLn(c,"config command");let l=El.create(o,a,{projectTrusted:!1}),d=await new jh({cwd:o,agentDir:a,settingsManager:l}).resolve(),h=c.isProjectTrusted()?await new jh({cwd:o,agentDir:a,settingsManager:c}).resolve():d;await rLn({resolvedPaths:{global:d,project:h},settingsManager:c,cwd:o,agentDir:a,writeScope:s?"project":"global",projectModeAvailable:c.isProjectTrusted()}),process.exit(0)}async function yLn(t,e={}){let n=mWs(t);if(!n)return!1;if(n.help)return hWs(n.command),!0;if(n.invalidOption)return console.error(en.red(`Unknown option ${n.invalidOption} for "${n.command}".`)),console.error(en.dim(`Use "${An} --help" or "${zT(n.command)}".`)),process.exitCode=1,!0;if(n.missingOptionValue)return console.error(en.red(`Missing value for ${n.missingOptionValue}.`)),console.error(en.dim(`Usage: ${zT(n.command)}`)),process.exitCode=1,!0;if(n.invalidArgument)return console.error(en.red(`Unexpected argument ${n.invalidArgument}.`)),console.error(en.dim(`Usage: ${zT(n.command)}`)),process.exitCode=1,!0;if(n.conflictingOptions)return console.error(en.red(n.conflictingOptions)),console.error(en.dim(`Usage: ${zT(n.command)}`)),process.exitCode=1,!0;let r=n.source;if((n.command==="install"||n.command==="remove")&&!r)return console.error(en.red(`Missing ${n.command} source.`)),console.error(en.dim(`Usage: ${zT(n.command)}`)),process.exitCode=1,!0;if(n.command==="update"&&n.updateTarget?.type==="models"){try{await AWs(ls())}catch(d){let h=d instanceof Error?d.message:"Unknown model catalog refresh error";console.error(en.red(`Error: ${h}`)),process.exitCode=1}return!0}let s=process.cwd(),i=ls(),o=(n.command==="install"||n.command==="remove")&&n.local,{settingsManager:a,projectTrustWarnings:c}=await gLn({cwd:s,agentDir:i,projectTrustOverride:n.projectTrustOverride,useSavedProjectTrustOnly:n.command==="update",extensionFactories:e.extensionFactories});if(fLn(c),!a.isProjectTrusted()&&o)return console.error(en.red("Project is not trusted. Use --approve to modify local package config.")),process.exitCode=1,!0;mLn(a,"package command");let u=a.getGlobalSettings().npmCommand,l=new jh({cwd:s,agentDir:i,settingsManager:a});l.setProgressCallback(d=>{d.type==="start"&&process.stdout.write(en.dim(`${d.message} -`))});try{switch(n.command){case"install":return await l.installAndPersist(r,{local:n.local}),console.log(en.green(`Installed ${r}`)),!0;case"remove":return await l.removeAndPersist(r,{local:n.local})?(console.log(en.green(`Removed ${r}`)),!0):(console.error(en.red(`No matching package found for ${r}`)),process.exitCode=1,!0);case"list":{let d=l.listConfiguredPackages(),h=d.filter(g=>g.scope==="user"),m=d.filter(g=>g.scope==="project");if(d.length===0)return console.log(en.dim("No packages installed.")),!0;let f=g=>{let A=g.filtered?`${g.source} (filtered)`:g.source;console.log(` ${A}`),g.installedPath&&console.log(en.dim(` ${g.installedPath}`))};if(h.length>0){console.log(en.bold("User packages:"));for(let g of h)f(g)}if(m.length>0){h.length>0&&console.log(),console.log(en.bold("Project packages:"));for(let g of m)f(g)}return!0}case"update":{let d=n.updateTarget??{type:"self"};if(n.showExtensionsSkippedNote&&console.log(en.dim(`Extensions are skipped. Run ${An} update --extensions to update extensions.`)),gWs(d)){let h=d.type==="extensions"?d.source:void 0;await l.update(h),console.log(h?en.green(`Updated ${h}`):en.green("Updated packages"))}if(fWs(d)){let h=dLn();if(h&&n.force)return console.error(en.red(`Managed ${An} installations do not support --force; rerun the installer to repair this installation.`)),process.exitCode=1,!0;let m=await _Ws(n.force);if(!m.shouldRun)return!0;if(h){m.note&&uLn(m.note);try{console.log(en.dim(`Updating managed ${An} installation...`)),await uWs(h,m.version)}catch(y){let b=y instanceof Error?y.message:"Unknown managed update error";return console.error(en.red(`Error: ${b}`)),process.exitCode=1,!0}return console.log(en.green(`Updated ${An} from ${Ad} to ${m.version}`)),!0}let f=pbe();if(process.platform==="win32"&&f!=="npm"&&f!=="pnpm")return console.error(en.red(`${An} self-update on Windows is only supported for npm and pnpm installs.`)),console.error(en.dim(`Detected install method: ${f}. Update ${An} manually.`)),process.exitCode=1,!0;let g={packageName:m.packageName,installSpec:m.installSpec},A=lrn(TN,u,g);if(!A)return yWs(u,g),process.exitCode=1,!0;m.note&&uLn(m.note);try{f==="npm"&&CWs(),await SWs(A)}catch(y){let b=y instanceof Error?y.message:"Unknown package command error";return console.error(en.red(`Error: ${b}`)),f==="pnpm"&&bWs(),EWs(A),process.exitCode=1,!0}console.log(en.green(`Updated ${An} from ${Ad} to ${m.version}`))}return!0}}}catch(d){let h=d instanceof Error?d.message:"Unknown package command error";return console.error(en.red(`Error: ${h}`)),process.exitCode=1,!0}}var xWs=`Hint: Start without extensions using "${An} -ne".`;async function wWs(){if(!process.stdin.isTTY)return new Promise(t=>{let e="";process.stdin.setEncoding("utf8"),process.stdin.on("data",n=>{e+=n}),process.stdin.on("end",()=>{t(e.trim()||void 0)}),process.stdin.resume()})}function kat(t){for(let e of t){let n=e.type==="error"?en.red:e.type==="warning"?en.yellow:en.dim,r=e.type==="error"?"Error: ":e.type==="warning"?"Warning: ":"";console.error(n(`${r}${e.message}`))}}function ELn(t){return t?t==="1"||t.toLowerCase()==="true"||t.toLowerCase()==="yes":!1}function TWs(t,e,n){return t.mode==="rpc"?"rpc":t.mode==="json"?"json":t.print||!e||!n?"print":"interactive"}function vWs(t){return t==="json"?"json":"text"}function RWs(t){return!t.print&&t.mode===void 0&&(t.help===!0||t.listModels!==void 0)}async function kWs(t){if(_Pn(t))return SPn(),!0;let e;try{e=CPn(t)}catch(r){let s=r instanceof xc?r.message:"Failed to parse auth command";return console.error(en.red(`Error: ${s}`)),process.exitCode=1,!0}if(!e)return!1;let n=aX(e.args);if(n.unknownFlags.size>0){let r=n.unknownFlags.keys().next().value;return console.error(en.red(`Unknown option --${r} for "${bot(e.kind)}".`)),console.error(en.dim(`Use "${An} --help" or "${bPn(e.kind)}".`)),process.exitCode=1,!0}try{if(n.diagnostics.length>0)throw new xc(n.diagnostics.map(a=>a.message).join(` -`));if(e.kind!=="check"){let a=AbortSignal.timeout(15e3),c=await Hh.create({allowModelNetwork:!1,signal:a}),u=await TPn(n,c,e.kind,e.minExpiryMs,a);return process.stdout.write(`${u} -`),!0}let r=fV(n,e.kind),s,i;try{let a=e.noRefresh?new sIe:u4.create(),c=await wPn(a);s=await IPn(n,c,{refresh:!e.noRefresh}),e.credentials&&s.status==="ready"&&(i=await xPn(s.provider,c,a,{refresh:!e.noRefresh}),i||(s={status:"not_ready",provider:s.provider,reason:"credential_not_available"}))}catch{s={status:"invalid",provider:r.provider??r.model,reason:"invalid_state"}}let o=e.json?JSON.stringify({...s,...i?{credentials:i}:{}}):i??s.status;process.stdout.write(`${o} -`),process.exitCode=s.status==="ready"?0:s.status==="not_ready"?1:2}catch(r){let s=r instanceof xc?r.message:"Failed to resolve credential";console.error(en.red(`Error: ${s}`)),process.exitCode=e.kind==="check"?2:1}return!0}async function NWs(t,e,n){if(t.fileArgs.length===0)return _ot({parsed:t,stdinContent:n});let{text:r,images:s}=await RPn(t.fileArgs,{autoResizeImages:e});return _ot({parsed:t,fileText:r,fileImages:s,stdinContent:n})}async function bLn(t,e,n){let s=(await eo.list(e,n)).find(i=>i.id===t);return s?{type:"local",path:s.path}:void 0}async function _Ln(t,e,n){if(t.includes("/")||t.includes("\\")||t.endsWith(".jsonl"))return{type:"path",path:jn(t,e)};let r=await eo.list(e,n),s=r.find(a=>a.id===t)??r.find(a=>a.id.startsWith(t));if(s)return{type:"local",path:s.path};let i=await eo.listAll(n),o=i.find(a=>a.id===t)??i.find(a=>a.id.startsWith(t));return o?{type:"global",path:o.path,cwd:o.cwd}:{type:"not_found",arg:t}}async function DWs(t){return new Promise(e=>{let n=(0,CLn.createInterface)({input:process.stdin,output:process.stdout});n.question(`${t} [y/N] `,r=>{n.close(),e(r.toLowerCase()==="y"||r.toLowerCase()==="yes")})})}function BWs(t){if(!t.fork)return;let e=[t.session?"--session":void 0,t.continue?"--continue":void 0,t.resume?"--resume":void 0,t.noSession?"--no-session":void 0].filter(n=>n!==void 0);e.length>0&&(console.error(en.red(`Error: --fork cannot be combined with ${e.join(", ")}`)),process.exit(1))}function PWs(t){if(t.sessionId===void 0)return;let e=[t.session?"--session":void 0,t.continue?"--continue":void 0,t.resume?"--resume":void 0].filter(n=>n!==void 0);e.length>0&&(console.error(en.red(`Error: --session-id cannot be combined with ${e.join(", ")}`)),process.exit(1));try{$0e(t.sessionId)}catch(n){let r=n instanceof Error?n.message:String(n);console.error(en.red(`Error: ${r}`)),process.exit(1)}}function OWs(t,e){try{return eo.open(t,e)}catch(n){let r=n instanceof Error?n.message:String(n);console.error(en.red(`Error: ${r}`)),process.exit(1)}}function SLn(t,e,n,r){try{return eo.forkFrom(t,e,n,{id:r})}catch(s){let i=s instanceof Error?s.message:String(s);console.error(en.red(`Error: ${i}`)),process.exit(1)}}async function MWs(t,e,n,r){if(t.noSession||t.help||t.listModels!==void 0)return eo.inMemory(e,t.sessionId!==void 0?{id:t.sessionId}:void 0);if(t.fork){t.sessionId&&await bLn(t.sessionId,e,n)&&(console.error(en.red(`Session already exists with id '${t.sessionId}'`)),process.exit(1));let s=await _Ln(t.fork,e,n);switch(s.type){case"path":case"local":case"global":return SLn(s.path,e,n,t.sessionId);case"not_found":console.error(en.red(`No session found matching '${s.arg}'`)),process.exit(1)}}if(t.session){let s=await _Ln(t.session,e,n);switch(s.type){case"path":case"local":return OWs(s.path,n);case"global":return console.log(en.yellow(`Session found in different project: ${s.cwd}`)),await DWs("Fork this session into current directory?")||(console.log(en.dim("Aborted.")),process.exit(0)),SLn(s.path,e,n);case"not_found":console.error(en.red(`No session found matching '${s.arg}'`)),process.exit(1)}}if(t.resume)try{let s=await jPn(i=>eo.list(e,n,i),i=>eo.listAll(n,i),r);return s||(console.log(en.dim("No session selected")),process.exit(0)),eo.open(s,n)}finally{d0()}if(t.continue)return eo.continueRecent(e,n);if(t.sessionId){let s=await bLn(t.sessionId,e,n);if(s)return eo.open(s.path,n);console.error(en.yellow(`Warning: No project session found with id '${t.sessionId}'; creating a new session with that id.`))}return eo.create(e,n,{id:t.sessionId})}function LWs(t,e,n,r,s){let i={},o=[],a=!1;if(t.model){let c=uI({cliProvider:t.provider,cliModel:t.model,cliThinking:t.thinking,modelRuntime:r});c.warning&&o.push({type:"warning",message:c.warning}),c.error&&o.push({type:"error",message:c.error}),c.model&&(i.model=c.model,!t.thinking&&c.thinkingLevel&&(i.thinkingLevel=c.thinkingLevel,a=!0))}if(!i.model&&e.length>0&&!n){let c=s.getDefaultProvider(),u=s.getDefaultModel(),l=c&&u?r.getModel(c,u):void 0,d=l?e.find(h=>cd(h.model,l)):void 0;d?(i.model=d.model,!t.thinking&&d.thinkingLevel&&(i.thinkingLevel=d.thinkingLevel)):(i.model=e[0].model,!t.thinking&&e[0].thinkingLevel&&(i.thinkingLevel=e[0].thinkingLevel))}return t.thinking&&(i.thinkingLevel=t.thinking),e.length>0&&(i.scopedModels=e.map(c=>({model:c.model,thinkingLevel:c.thinkingLevel}))),t.noTools?i.noTools="all":t.noBuiltinTools&&(i.noTools="builtin"),t.tools&&(i.tools=[...t.tools]),t.excludeTools&&(i.excludeTools=[...t.excludeTools]),{options:i,cliThinkingFromModel:a,diagnostics:o}}function PTe(t,e){return e?.map(n=>UE(n)?jn(n,t):n)}async function FWs(t,e){return sne(e,Hwe(t),[{label:"Continue",value:t.fallbackCwd},{label:"Cancel",value:void 0}])}async function ILn(t,e){XZ();let n=[...dOn,...e?.extensionFactories??[]],r=t.includes("--offline")||ELn(process.env.PI_OFFLINE);if(r&&(process.env.PI_OFFLINE="1",process.env.PI_SKIP_VERSION_CHECK="1"),await kWs(t))return;process.platform==="win32"&&BTe(ul()),hLn();let s=process.cwd(),i=ls(),o=El.create(s,i,{projectTrusted:!1});if(uot(o.getGlobalSettings().httpProxy),mV(),await yLn(t,{extensionFactories:n})){let ie=process.exitCode??0;if(process.platform==="win32"&&ie===0&&t[0]==="update")return;process.exit(ie);return}if(await ALn(t,{extensionFactories:n}))return;let a=aX(t);if(a.diagnostics.length>0){for(let ie of a.diagnostics){let ne=ie.type==="error"?en.red:en.yellow;console.error(ne(`${ie.type==="error"?"Error":"Warning"}: ${ie.message}`))}a.diagnostics.some(ie=>ie.type==="error")&&process.exit(1)}if(ap("parseArgs"),a.version&&(console.log(Ad),process.exit(0)),a.export){let ie;try{let ne=a.messages.length>0?a.messages[0]:void 0;ie=await DAn(a.export,ne)}catch(ne){let J=ne instanceof Error?ne.message:"Failed to export session";console.error(en.red(`Error: ${J}`)),process.exit(1)}console.log(`Exported to: ${ie}`),process.exit(0)}let c=TWs(a,process.stdin.isTTY,process.stdout.isTTY);c!=="interactive"&&!RWs(a)&&xIe(),a.mode==="rpc"&&a.fileArgs.length>0&&(console.error(en.red("Error: @file arguments are not supported in RPC mode")),process.exit(1)),BWs(a),PWs(a);let{migratedAuthProviders:l,deprecationWarnings:d}=fOn(s);ap("runMigrations");let h=El.create(s,i),m=vot(h);c==="interactive"&&!a.help&&a.listModels===void 0&&MPn()&&(await LPn(h),ap("firstTimeSetup")),c==="interactive"&&a.useTheme!==void 0&&h.applyOverrides({theme:a.useTheme});let f=process.env[fbe],g=(a.sessionDir?Mo(a.sessionDir):void 0)??(f?D9e(f):void 0)??h.getSessionDir(),A=await MWs(a,s,g,h),y=Aot(A,s);if(y)if(c==="interactive"){let ie=await FWs(y,h);ie||process.exit(0),A=eo.open(y.sessionFile,g,ie)}else console.error(en.red(new YD(y).message)),process.exit(1);if(a.name!==void 0){let ie=Ern(a.name);ie===void 0&&(console.error(en.red("Error: --name requires a non-empty value")),process.exit(1)),A.appendSessionInfo(ie)}ap("createSessionManager");let b=new M0(i),S=A.getCwd(),C=a.projectTrustOverride===void 0&&!fb(S)?S:void 0,I=a.help||a.listModels!==void 0?"print":c,x=new Map,w=PTe(s,a.extensions),R=PTe(s,a.skills),N=PTe(s,a.promptTemplates),P=PTe(s,a.themes),G=async({cwd:ie,agentDir:ne,sessionManager:J,sessionStartEvent:te,projectTrustContext:j})=>{let X=te===void 0,ae=[],me=x.get(ie),Ae=fb(ie),ue=a.projectTrustOverride===void 0&&me===void 0&&Ae,ye=ue?!1:me??a.projectTrustOverride??(!Ae||b.get(ie)===!0),Ie=El.create(ie,ne,{projectTrusted:ye}),Ee=await CF({cwd:ie,agentDir:ne,settingsManager:Ie,modelRuntimeSignal:AbortSignal.timeout(15e3),extensionFlagValues:a.unknownFlags,resourceLoaderReloadOptions:ue?{resolveProjectTrust:async({extensionsResult:Mt})=>{let Lt=await eTe({cwd:ie,trustStore:b,trustOverride:a.projectTrustOverride,defaultProjectTrust:h.getDefaultProjectTrust(),extensionsResult:Mt,projectTrustContext:j??Zwe({cwd:ie,mode:X?I:c,settingsManager:h,hasUI:X&&I==="interactive"}),onExtensionError:Pt=>ae.push({type:"warning",message:Pt})});return x.set(ie,Lt),Lt}}:void 0,resourceLoaderOptions:{additionalExtensionPaths:w,additionalSkillPaths:R,additionalPromptTemplatePaths:N,additionalThemePaths:P,noExtensions:a.noExtensions,noSkills:a.noSkills,noPromptTemplates:a.noPromptTemplates,noThemes:a.noThemes,noContextFiles:a.noContextFiles,systemPrompt:a.systemPrompt,appendSystemPrompt:a.appendSystemPrompt,extensionFactories:n}}),{settingsManager:Te,modelRuntime:_e,resourceLoader:z}=Ee,We=[...ae,...Ee.diagnostics,...vot(Te),...z.getExtensions().errors.map(({path:Mt,error:Lt})=>({type:"error",message:`Failed to load extension "${Mt}": ${Lt}`}))],He=a.models??Te.getEnabledModels(),dt=He&&He.length>0?await CSn(He,_e,{signal:AbortSignal.timeout(15e3)}):[],{options:it,cliThinkingFromModel:ze,diagnostics:rt}=LWs(a,dt,J.buildSessionContext().messages.length>0,_e,Te);We.push(...rt),a.apiKey&&(it.model?await _e.setRuntimeApiKey(it.model.provider,a.apiKey):We.push({type:"error",message:"--api-key requires a model to be specified via --model, --provider/--model, or --models"}));let Ct=await IF({services:Ee,sessionManager:J,sessionStartEvent:te,model:it.model,thinkingLevel:it.thinkingLevel,scopedModels:it.scopedModels,tools:it.tools,excludeTools:it.excludeTools,noTools:it.noTools,customTools:it.customTools}),sn=a.thinking!==void 0||ze;return Ct.session.model&&sn&&Ct.session.setThinkingLevel(Ct.session.thinkingLevel),{...Ct,services:Ee,diagnostics:We}};ap("createRuntime");let $=await Ywe(G,{cwd:A.getCwd(),agentDir:i,sessionManager:A});ap("createAgentSessionRuntime");let{services:Q,session:H,modelFallbackMessage:oe}=$,{settingsManager:re,modelRuntime:Z,resourceLoader:q}=Q;if(zw(re.getTerminalCapabilityOverrides()),uot(re.getGlobalSettings().httpProxy),mV(re.getHttpIdleTimeoutMs()),a.help){kat(m);let ie=q.getExtensions().extensions.flatMap(ne=>Array.from(ne.flags.values()));brn(ie),process.exit(0)}if(a.listModels!==void 0){kat(m);let ie=typeof a.listModels=="string"?a.listModels:void 0;await NPn(Z,ie,AbortSignal.timeout(15e3)),process.exit(0)}let ce;c!=="rpc"&&(ce=await wWs(),ce!==void 0&&c==="interactive"&&(c="print")),ap("readPipedStdin");let{initialMessage:be,initialImages:Be}=await NWs(a,re.getImageAutoResize(),ce);ap("prepareInitialMessage"),Ohn(eLn),KC(re.getTheme(),c==="interactive"),ap("initTheme"),c==="interactive"&&d.length>0&&await mOn(d),ap("resolveModelScope");let Me=YPn([...m,...$.diagnostics]),Re=$.diagnostics.some(ie=>ie.type==="error");(c!=="interactive"||Re)&&kat(Me),Re&&($.diagnostics.some(ie=>ie.message.includes("Failed to load extension"))&&console.error(en.yellow(xWs)),process.exit(1)),ap("createAgentSession"),c!=="interactive"&&!H.model&&(console.error(en.red(n5())),process.exit(1));let se=ELn(process.env.PI_STARTUP_BENCHMARK);if(se&&c!=="interactive"&&(console.error(en.red("Error: PI_STARTUP_BENCHMARK only supports interactive mode")),process.exit(1)),!r&&c==="rpc"){let ie=new AbortController,ne=setTimeout(()=>ie.abort(),15e3);Z.refresh({signal:ie.signal}).catch(()=>{}).finally(()=>clearTimeout(ne))}if(c==="rpc")ZZ(),await vne($);else if(c==="interactive"){let ie=new jF($,{migratedProviders:l,startupDiagnostics:Me,modelFallbackMessage:oe,autoTrustOnReloadCwd:C,initialMessage:be,initialImages:Be,initialMessages:a.messages,verbose:a.verbose,tuiMode:a.tuiMode,initialThemeSetting:a.useTheme});if(se){await ie.init(),ap("interactiveMode.init"),await new Promise(ne=>setTimeout(ne,150)),ie.stop(),d0(),ZZ(),process.stdout.writableLength>0&&await new Promise(ne=>process.stdout.once("drain",ne)),process.stderr.writableLength>0&&await new Promise(ne=>process.stderr.once("drain",ne));return}ZZ(),await ie.run()}else{ZZ();let ie=await wne($,{mode:vWs(c),messages:a.messages,initialMessage:be,initialImages:Be});d0(),VIn(),ie!==0&&(process.exitCode=ie);return}}p();p();var QWs={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},Rne=class extends _n{selectList;constructor(e,n,r){super();let s=[{value:"yes",label:"Yes",description:"Show images inline in terminal"},{value:"no",label:"No",description:"Show text placeholder instead"}];this.addChild(new Ln),this.selectList=new Xp(s,5,p0(),QWs),this.selectList.setSelectedIndex(e?0:1),this.selectList.onSelect=i=>{n(i.value==="yes")},this.selectList.onCancel=()=>{r()},this.addChild(this.selectList),this.addChild(new Ln)}getSelectList(){return this.selectList}};p();var UWs={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},kne=class extends _n{selectList;onPreview;constructor(e,n,r,s){super(),this.onPreview=s;let i=E_e(),o=i.map(c=>({value:c,label:c,description:c===e?"(current)":void 0}));this.addChild(new Ln),this.selectList=new Xp(o,10,p0(),UWs);let a=i.indexOf(e);a!==-1&&this.selectList.setSelectedIndex(a),this.selectList.onSelect=c=>{n(c.value)},this.selectList.onCancel=()=>{r()},this.selectList.onSelectionChange=c=>{this.onPreview(c.value)},this.addChild(this.selectList),this.addChild(new Ln)}getSelectList(){return this.selectList}};p();p();var xLn={github:{ciEnvironment:"GitHub Actions CI/CD",productName:"GitHub"},codeberg:{ciEnvironment:"Codeberg CI/CD",productName:"Codeberg"},forgejo:{ciEnvironment:"Forgejo Actions CI/CD",productName:"Forgejo"}};function OTe(t="github"){let{ciEnvironment:e,productName:n}=xLn[t];return`You are a non-interactive assistant running in ${e} environment. You are usually tasked with code reviews and generating code changes. You will not interact with the user directly. The output (or error) you generate will be sent back as comment to the user. Avoid if possible long preambles about what you are going to do to achieve the goal, focus on the final result instead, remember that the user is reading the output as comment in a ${n} PR or issue. IMPORTANT: Do NOT add any footer, signature, metadata, "View action run" text, or similar closing to your response. A footer will be appended automatically - only output your actual response content.`}var $Ws=OTe("github");function PI(t){return xLn[t].productName}var wLn="Create a pull request with title and description. The tool will automatically determine the default base branch, create a new branch, push changes, and create the PR.",TLn=["Always use the create_pull_request tool to create pull requests - do not use git commands or gh CLI directly.","Make sure your changes are made (modified files exist) before calling this tool. The tool will detect changes, create branch, and create PR automatically. Do NOT use unless you have already applied changes and/or added new files.","The tool will automatically generate a branch name in the format: pi/issue{number}-{timestamp}.",'Do NOT provide the "base" parameter unless the user explicitly requests a different target branch than the repository default. The tool will automatically detect the correct default branch.',"Use dryRun=true first to verify the PR configuration, then dryRun=false to create it.","On some platforms (e.g. Forgejo) the PR object cannot always be opened automatically even though the branch is pushed. When this happens the tool returns a compare URL instead of an error \u2014 post that URL so the user can open the PR manually."];function vLn(t="github"){return`Create a new pull request on ${PI(t)}. This tool handles everything: automatically determines the default base branch, creates a new branch, pushes changes, and creates the PR. The branch name is auto-generated following the pi/issue{number}-{timestamp} pattern.`}var RLn="Pull request title (should be descriptive and follow conventional commit format)",kLn='Detailed description of changes in markdown format. If not provided, will auto-generate from issue context (e.g., "Fixes #27")',NLn="EXPERT: Override the default target branch. Only use this if the user explicitly requests a different branch than the repository default. Do NOT guess or assume a branch name - leave this empty unless specifically instructed.",DLn="Set to true to simulate PR creation without actually creating it (for testing). Set to false to create the actual PR.";function BLn(t="github"){return`Get the full comment thread for a ${PI(t)} issue or pull request, including title, description, labels, and all comments. For PRs, also includes inline review comments.`}function PLn(t="github"){return["Use get_issue_or_pr_thread to understand the context of an issue or PR before taking action.",`By default, the tool fetches the current issue/PR from the ${PI(t)} context. Only provide owner/repo/issue_number when you need to fetch a different one.`,"Use max_comments to limit results for very long threads; defaults to 100 comments.","For pull requests, the tool also returns inline review comments (comments on specific lines of the diff)."]}function OLn(t="github"){return`Retrieve the complete comment thread for a ${PI(t)} issue or pull request. Returns the title, description, labels, state, author, timestamps, and all comments. For pull requests, also includes inline review comments with file path and line information, plus branch names and merge status. Does NOT fetch code changes \u2014 use the get_pr_diff tool for that.`}var MLn='Repository owner (e.g., "octocat"). If not provided, uses the current repository from context.',LLn='Repository name (e.g., "hello-world"). If not provided, uses the current repository from context.',FLn="Issue or pull request number. If not provided, uses the current issue/PR from context.",QLn="Maximum number of comments to fetch. Defaults to 100. Use for limiting very long threads.",ULn="Update an existing pull request by pushing new commits to the PR branch and optionally updating the title and/or body.";function $Ln(t="github"){return["Use update_pull_request when working within an existing PR flow to push new commits and/or update PR metadata.","Make sure your changes are made (modified files exist) before calling this tool. The tool will detect changes and create a new commit on the PR branch.",`By default, the tool works with the current PR from the ${PI(t)} context. Only provide pull_number when you need to update a different PR.`,"The tool commits changes with the provided message (or generates a default message) and pushes them to the existing PR branch.","You can update the PR title and/or body using the title and body parameters.","Use dryRun=true first to verify the update configuration, then dryRun=false to apply the changes."]}var GLn="Update an existing pull request by pushing new commits to the PR branch. Optionally updates the PR title and/or description. The tool detects changes in the working tree, creates a new commit on the PR branch, and updates the PR metadata if provided.",WLn="Pull request number. If not provided, uses the current PR from context.",qLn="New pull request title. If not provided, the title is not changed.",HLn="New pull request description in markdown format. If not provided, the description is not changed.",VLn="Commit message for the new commit. If not provided, a descriptive message will be auto-generated based on the changes.",jLn="Set to true to simulate the PR update without actually modifying anything (for testing). Set to false to apply the actual changes.",YLn="Get the diff of a pull request. Use this to understand what code changes a PR introduces.";function KLn(t="github"){return["Use get_pr_diff to fetch the diff of a pull request when you need to understand what changed.",`By default, the tool fetches the diff for the current PR from the ${PI(t)} context. Only provide owner/repo/pull_number when you need to fetch a different PR.`,"The diff is truncated at 1000 lines and 100KB by default. Use max_lines to increase or decrease the line limit.","Use ignore_files to exclude common noisy paths (dist/, package-lock.json, etc.) from the diff."]}function zLn(t="github"){return`Fetch the diff of a ${PI(t)} pull request. Returns the diff as a string, truncated if too large. Useful for understanding what code changes a PR introduces before reviewing or modifying them.`}var JLn='Repository owner (e.g., "octocat"). If not provided, uses the current repository from context.',XLn='Repository name (e.g., "hello-world"). If not provided, uses the current repository from context.',ZLn="Pull request number. If not provided, uses the current PR from context.",eFn="Maximum number of diff lines to return. Defaults to 1000 (or the action-level diff_max_lines input). Use for limiting very large diffs.",Nat='List of file paths to exclude from the diff. Supports exact file paths (e.g. "package-lock.json") and directory prefixes (e.g. "dist/" to exclude everything under dist/). Matching is literal \u2014 glob patterns (e.g. "*.min.js") are NOT supported. Useful for filtering out generated files, build artifacts, or vendored dependencies.',tFn="Create a pull request review with an optional summary and inline comments anchored to specific lines of the diff.",nFn=["Use create_pull_request_review to post inline review comments anchored to specific diff lines. This is much more useful than top-level comments because reviewers can see findings directly in the diff context.","Each comment requires a `path` (file path relative to repo root), `line` (line number in the new/right side of the diff), and `body` (Markdown comment text).",'Use `side: "LEFT"` to comment on the old version of the file (before the change), or omit it / use `side: "RIGHT"` (default) for the new version.',"For multi-line comments, set `start_line` to the first line and `line` to the last line of the range.","The `event` parameter controls the review type: COMMENT (default, neutral feedback), APPROVE (approve the PR), or REQUEST_CHANGES (request changes before merging).","A `body` (summary comment) is optional but recommended \u2014 it provides context for the overall review.","Provide at least one inline comment or a non-empty `body`. A summary-only review may use an empty `comments` array.","Make sure line numbers reference the correct version of the file. Use the `get_pr_diff` tool first to understand the diff and verify line numbers."];function rFn(t="github"){return`Create a pull request review with an optional summary and optional inline comments anchored to specific lines of the diff. Posts a ${PI(t)} Pull Request Review using the \`pulls.createReview\` API. Provide at least one inline comment or a non-empty summary body.`}var sFn="Pull request number. If not provided, uses the current PR from context.",iFn="Summary comment for the review (shown at the top of the review). Optional but recommended.",oFn="Review event type: COMMENT (default, neutral feedback), APPROVE (approve the PR), or REQUEST_CHANGES (request changes before merging).";var aFn='Repository-relative file path (e.g., "src/main.ts").',cFn="Line number in the diff. For multi-line comments, this is the end line. Must be a positive integer.",lFn="Which side of the diff: RIGHT (new file, default) or LEFT (old file).",uFn="Start line for multi-line comments. If set, `line` is treated as the end line.",dFn="Which side `start_line` refers to. Only needed when different from `side`.",pFn="The Markdown body of the inline comment.",hFn="Check the CI/CD status for a pull request or commit ref. Returns check runs and workflow runs with their statuses, conclusions, and URLs.";function mFn(t="github"){return["Use get_ci_status to inspect the CI/CD status of a pull request or commit before or after making changes.",`By default, the tool fetches status for the current PR from the ${PI(t)} context. Only provide owner/repo/pull_number when you need to check a different PR.`,"You can also provide a `ref` (commit SHA or branch name) directly instead of a pull_number.","Filter by `status` (queued, in_progress, completed) or `conclusion` (success, failure, cancelled, timed_out) to narrow results.","For failed workflow runs, use the returned run_id with the `get_workflow_run_logs` tool to fetch detailed job logs and diagnose failures."]}var fFn="Get the CI/CD status for a pull request or commit ref. Returns a list of check runs and workflow runs with their statuses, conclusions, and URLs. Use this to check if CI is passing or failing before or after making changes.",MTe='Repository owner (e.g., "octocat"). If not provided, uses the current repository from context.',LTe='Repository name (e.g., "hello-world"). If not provided, uses the current repository from context.',gFn="Pull request number. If not provided, uses the current PR from context. Alternative to providing a ref.",AFn="Git ref (commit SHA or branch name) to check. If not provided, resolved from pull_number or context.",yFn="Filter by status: queued, in_progress, completed.",EFn="Filter by conclusion: success, failure, cancelled, timed_out, action_required, etc.",bFn="Fetch the job logs for a specific workflow run. Use this to diagnose CI failures by inspecting the actual log output.",_Fn=["Use get_workflow_run_logs when you need to inspect the actual log output of a workflow run to diagnose failures.","First use `get_ci_status` to find the run_id of a failed workflow run, then use this tool to fetch its logs.","Logs are truncated to 50KB by default. Truncation keeps the end of the log (where errors typically appear). Use `max_bytes` to increase or decrease the limit (capped at 1MB).","The tool returns logs for all jobs in the run, with each job clearly labeled. Logs are truncated from the head, preserving the tail where error messages typically appear."];function SFn(t="github"){return`Fetch the job logs for a specific ${PI(t)} Actions workflow run. Returns the log output for each job, truncated if too large. Use this to diagnose CI failures by inspecting the actual error messages and stack traces.`}var CFn="The workflow run ID to fetch logs for. Get this from the get_ci_status tool output.",IFn="Maximum total log bytes to return. Defaults to 51200 (50KB). Capped at 1048576 (1MB). Use for limiting very large log outputs.";p();var Dne="\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";function jc(t){return{level:"info",text:t}}function Dat(t){return{level:"warning",text:t}}function xFn(t,e){let n=[jc("\u{1F4CA} LLM")];return t?(n.push(jc(` Model: ${t.provider}/${t.id}`)),n.push(jc(` Reasoning: ${t.reasoning}`))):n.push(jc(" Model: Not configured")),n.push(jc(` Thinking Level: ${e}`)),n.push(jc(Dne)),n}function wFn(t){if(t.requested.length===0)return[];let e=[jc("\u{1F4E6} Extensions")];if(e.push(jc(` Requested: ${t.requested.join(", ")}`)),t.loaded.length>0){e.push(jc(` Loaded: ${t.loaded.length} extension(s)`));for(let n of t.loaded)e.push(jc(` \u2022 ${n}`))}else e.push(jc(" Loaded: None"));for(let n of t.warnings)e.push(Dat(` \u26A0\uFE0F ${n}`));return e.push(jc(Dne)),e}function TFn(t){if(t.length===0)return[];let e=[jc("\u{1F527} Available Tools")];for(let n of t)n.sourceInfo.source?e.push(jc(` \u2022 [${n.sourceInfo.source}] ${n.name}`)):e.push(jc(` \u2022 ${n.name}`));return e.push(jc(Dne)),e}function vFn(t){let e=[jc("\u{1F4DD} System Prompt")],n=Nne(t,1e3);return e.push(jc(n)),t.length>1e3&&e.push(jc(` -... (${t.length-1e3} more characters)`)),e.push(jc(Dne)),e}function RFn(t,e){let n=[jc("\u{1F464} User Prompt"),jc(Nne(t,500))];return e&&e.length>0&&n.push(jc(` [${e.length} image(s) attached]`)),n}function Bat(t){let e=[],n=t.phase==="before"?"starting":"completed",r=t.willRetry?" \xB7 turn retried":"",s=t.reason==="overflow"&&t.willRetry,i=`\u{1F5DC}\uFE0F Context compaction ${n}`,o=` Reason: ${t.reason}${r}`,a=` Tokens before: ${t.tokensBefore.toLocaleString("en-US")}`,c=s?Dat:jc;return e.push(c(i)),e.push(c(o)),e.push(c(a)),s&&t.phase==="before"&&e.push(Dat(" \u26A0\uFE0F Context window overflowed mid-turn \u2014 the turn was aborted and will be retried after summarization. This typically increases run latency and cost.")),e}function YF(t,e){for(let n of e)n.level==="warning"?t.warning(n.text):t.info(n.text)}var GWs=(t,e,n)=>{t.on("tool_execution_start",async r=>{e.info(""),e.startGroup?.(`\u{1F527} Tool started: ${r.toolName} (${r.toolCallId})`),e.info(` Args: ${Nne(JSON.stringify(r.args,null,2),500)}`),e.endGroup?.()}),t.on("tool_execution_end",async r=>{e.startGroup?.(`\u{1F527} Tool ended: ${r.toolName} (${r.toolCallId})`),r.result?.details?.cancelled===!0?e.warning(" \u26A0\uFE0F execution cancelled"):r.isError?e.info(" \u274C execution failed"):e.info(" \u2705 execution succeeded"),e.endGroup?.()}),t.on("tool_execution_update",async r=>{e.info(""),e.debug(`\u{1F527} Tool ${r.toolName} (${r.toolCallId}) update: ${Nne(JSON.stringify(r.partialResult),200)}`)}),t.on("turn_start",async r=>{e.info(""),e.debug(`\u{1F504} Turn ${r.turnIndex} started`)}),t.on("turn_end",async r=>{let s=r.toolResults.length;e.info(""),e.debug(`\u{1F504} Turn ${r.turnIndex} completed (${s} tool result(s))`)}),t.on("after_provider_response",async r=>{e.info(""),e.debug(`\u{1F4E1} Provider response: status ${r.status}`)}),t.on("session_before_compact",async r=>{YF(e,Bat({phase:"before",reason:r.reason,willRetry:r.willRetry,tokensBefore:r.preparation.tokensBefore}))}),t.on("session_compact",async r=>{YF(e,Bat({phase:"after",reason:r.reason,willRetry:r.willRetry,tokensBefore:r.compactionEntry.tokensBefore}))}),t.on("before_agent_start",async(r,s)=>{e.startGroup?.("\u{1F916} Agent Session settings"),e.info(` Running @earendil-works/pi-coding-agent@${XJ()}`),e.info(Dne),YF(e,xFn(s.model,t.getThinkingLevel())),n&&YF(e,wFn(n)),YF(e,TFn(t.getAllTools())),YF(e,vFn(s.getSystemPrompt())),YF(e,RFn(r.prompt,r.images)),e.endGroup?.(),e.info("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"),e.info("\u{1F680} Starting agent session..."),e.info("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550")}),t.on("agent_settled",async()=>{e.debug("\u2705 Agent session settled (no further automatic actions)")})};function Nne(t,e){if(!t||t.length<=e)return t;let n=t.substring(0,e),r=n.lastIndexOf(" ");return r>e*.8?n.substring(0,r)+"...":n+"..."}function Pat(t,e){return n=>GWs(n,t,e)}p();p();p();p();p();p();p();var St={};Ir(St,{Assign:()=>WWs,Clone:()=>Mne,Create:()=>Kqs,Discard:()=>zqs,Metrics:()=>W0,Update:()=>Jqs});p();p();p();var W0={assign:0,create:0,clone:0,discard:0,update:0};function WWs(t,e){return W0.assign+=1,{...t,...e}}p();p();p();var Ue={};Ir(Ue,{Entries:()=>uqs,EntriesRegExp:()=>lqs,Every:()=>oqs,EveryAll:()=>aqs,GraphemeCount:()=>rqs,HasPropertyKey:()=>cqs,IsArray:()=>Pne,IsBigInt:()=>Bne,IsBoolean:()=>FFn,IsClassInstance:()=>tqs,IsConstructor:()=>KWs,IsDeepEqual:()=>Fat,IsEqual:()=>Vi,IsFunction:()=>QFn,IsGreaterEqualThan:()=>$Fn,IsGreaterThan:()=>XWs,IsInteger:()=>Mat,IsLessEqualThan:()=>UFn,IsLessThan:()=>ZWs,IsMaxLength:()=>sqs,IsMinLength:()=>iqs,IsMultipleOf:()=>eqs,IsNull:()=>UTe,IsNumber:()=>$Te,IsObject:()=>One,IsObjectNotArray:()=>zWs,IsString:()=>GTe,IsSymbol:()=>JWs,IsUndefined:()=>Lat,IsUnsafePropertyKey:()=>GFn,IsValueLike:()=>nqs,Keys:()=>QTe,ShiftLeft:()=>WTe,Symbols:()=>dqs,Values:()=>pqs});p();p();function KF(t,e,n){return t>=e&&t<=n}function qWs(t){return t===8205}function HWs(t){return KF(t,55296,56319)}function kFn(t){return KF(t,127462,127487)}function DFn(t){return KF(t,65024,65039)}function BFn(t){return KF(t,768,879)||KF(t,6832,6911)||KF(t,7616,7679)||KF(t,65056,65071)}function FTe(t){return t>65535?2:1}function NFn(t,e){for(;e=e)return!0;return!1}function jWs(t,e){let n=0,r=0;for(;re)return!1;return!0}function MFn(t,e){if(e===0)return!0;let n=0;for(;n=e)return!0}return!1}function LFn(t,e){let n=0;for(;ne)return!1}return!0}function Pne(t){return Array.isArray(t)}function Bne(t){return Vi(typeof t,"bigint")}function FFn(t){return Vi(typeof t,"boolean")}function KWs(t){if(Lat(t)||!QFn(t))return!1;let e=Function.prototype.toString.call(t);return!!(/^class\s/.test(e)||/\[native code\]/.test(e))}function QFn(t){return Vi(typeof t,"function")}function Mat(t){return Number.isInteger(t)}function UTe(t){return Vi(t,null)}function $Te(t){return Number.isFinite(t)}function zWs(t){return One(t)&&!Pne(t)}function One(t){return Vi(typeof t,"object")&&!UTe(t)}function GTe(t){return Vi(typeof t,"string")}function JWs(t){return Vi(typeof t,"symbol")}function Lat(t){return Vi(t,void 0)}function Vi(t,e){return t===e}function XWs(t,e){return t>e}function ZWs(t,e){return t=e}function eqs(t,e){if(Bne(t)||Bne(e))return BigInt(t)%BigInt(e)===0n;let n=1e-10;if(!$Te(t)||Mat(t)&&1/e%1===0)return!0;let r=t%e;return Math.min(Math.abs(r),Math.abs(r-e),Math.abs(r+e))[new RegExp(`^${e}$`),t[e]])}function uqs(t){return Object.entries(t)}function QTe(t){return Object.getOwnPropertyNames(t)}function dqs(t){return Object.getOwnPropertySymbols(t)}function pqs(t){return Object.values(t)}function hqs(t,e){if(!One(e))return!1;let n=QTe(t);return Vi(n.length,QTe(e).length)&&n.every(r=>Fat(t[r],e[r]))}function mqs(t,e){return Pne(e)&&Vi(t.length,e.length)&&t.every((n,r)=>Fat(t[r],e[r]))}function Fat(t,e){return Pne(t)?mqs(t,e):One(t)?hqs(t,e):Vi(t,e)}var o1={};Ir(o1,{IsBigInt64Array:()=>Rqs,IsBigUint64Array:()=>kqs,IsBoolean:()=>gqs,IsDate:()=>Dqs,IsFloat32Array:()=>Tqs,IsFloat64Array:()=>vqs,IsInt16Array:()=>Cqs,IsInt32Array:()=>xqs,IsInt8Array:()=>bqs,IsMap:()=>Pqs,IsNumber:()=>Aqs,IsRegExp:()=>Nqs,IsSet:()=>Bqs,IsString:()=>yqs,IsTypeArray:()=>Eqs,IsUint16Array:()=>Iqs,IsUint32Array:()=>wqs,IsUint8Array:()=>_qs,IsUint8ClampedArray:()=>Sqs});p();function gqs(t){return t instanceof Boolean}function Aqs(t){return t instanceof Number}function yqs(t){return t instanceof String}function Eqs(t){return globalThis.ArrayBuffer.isView(t)}function bqs(t){return t instanceof globalThis.Int8Array}function _qs(t){return t instanceof globalThis.Uint8Array}function Sqs(t){return t instanceof globalThis.Uint8ClampedArray}function Cqs(t){return t instanceof globalThis.Int16Array}function Iqs(t){return t instanceof globalThis.Uint16Array}function xqs(t){return t instanceof globalThis.Int32Array}function wqs(t){return t instanceof globalThis.Uint32Array}function Tqs(t){return t instanceof globalThis.Float32Array}function vqs(t){return t instanceof globalThis.Float64Array}function Rqs(t){return t instanceof globalThis.BigInt64Array}function kqs(t){return t instanceof globalThis.BigUint64Array}function Nqs(t){return t instanceof globalThis.RegExp}function Dqs(t){return t instanceof globalThis.Date}function Bqs(t){return t instanceof globalThis.Set}function Pqs(t){return t instanceof globalThis.Map}p();function Mqs(t){return Ue.HasPropertyKey(t,"~kind")||Ue.HasPropertyKey(t,"~unsafe")}function Lqs(t){let e={},n=Object.getOwnPropertyDescriptors(t);for(let r of Object.keys(n)){if(Ue.IsUnsafePropertyKey(r))continue;let s=n[r];Ue.HasPropertyKey(s,"value")&&Object.defineProperty(e,r,{...s,value:zF(s.value)})}return e}function Fqs(t){let e={};for(let n of Ue.Keys(t))Ue.IsUnsafePropertyKey(n)||(e[n]=zF(t[n]));for(let n of Ue.Symbols(t))e[n]=zF(t[n]);return e}function Qqs(t){return Ue.IsClassInstance(t)?t:Mqs(t)?Lqs(t):Fqs(t)}function Uqs(t){return t.map(e=>zF(e))}function $qs(t){return t.slice()}function Gqs(t){return new RegExp(t.source,t.flags)}function Wqs(t){return new Map(zF([...t.entries()]))}function qqs(t){return new Set(zF([...t.values()]))}function zF(t){return o1.IsTypeArray(t)?$qs(t):o1.IsRegExp(t)?Gqs(t):o1.IsMap(t)?Wqs(t):o1.IsSet(t)?qqs(t):Ue.IsArray(t)?Uqs(t):Ue.IsObject(t)?Qqs(t):t}function Mne(t){return W0.clone+=1,zF(t)}p();p();var JF={};Ir(JF,{Get:()=>jqs,Reset:()=>Hqs,Set:()=>Vqs});p();var JT={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Hqs(){JT.immutableTypes=!1,JT.maxErrors=8,JT.useAcceleration=!0,JT.exactOptionalPropertyTypes=!1,JT.enumerableKind=!1,JT.correctiveParse=!1,JT.unionPrioritySort=!0}function Vqs(t){for(let e of Ue.Keys(t)){let n=t[e];n!==void 0&&Object.defineProperty(JT,e,{value:n})}}function jqs(){return JT}function Yqs(t,e){for(let n of Object.keys(e))Object.defineProperty(t,n,{configurable:!0,writable:!0,enumerable:!1,value:e[n]});return t}function WFn(t,e){return{...t,...e}}function Kqs(t,e,n={}){W0.create+=1;let r=JF.Get(),s=WFn(e,n),i=r.enumerableKind?WFn(s,t):Yqs(s,t);return r.immutableTypes?Object.freeze(i):i}p();function zqs(t,e){W0.discard+=1;let n={},r=Object.getOwnPropertyDescriptors(Mne(t)),s=new Set(e);for(let i of Object.keys(r))s.has(i)||Object.defineProperty(n,i,r[i]);return n}p();function Jqs(t,e,n){W0.update+=1;let r=JF.Get(),s=Mne(t);for(let i of Object.keys(e))Object.defineProperty(s,i,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:e[i]});for(let i of Object.keys(n))Object.defineProperty(s,i,{configurable:!0,enumerable:!0,writable:!0,value:n[i]});return s}p();function ur(t,e){return Ue.IsObject(t)&&Ue.HasPropertyKey(t,"~kind")&&Ue.IsEqual(t["~kind"],e)}function yu(t){return Ue.IsObject(t)}function br(t,e,n){return St.Create({"~kind":"Deferred"},{type:"deferred",action:t,parameters:e,options:n},{})}function a1(t){return ur(t,"Deferred")}p();p();p();function Xqs(t){return St.Update(t,{"~readonly":!0},{})}function Lne(t,e){return St.Update(Xqs(t),{},e)}function qFn(t,e,n,r){let s=wn(t,e,n);return Lne(s,r)}p();function Zqs(t){return St.Update(t,{"~optional":!0},{})}function Fne(t,e){return St.Update(Zqs(t),{},e)}function HFn(t,e,n,r){let s=wn(t,e,n);return Fne(s,r)}p();function _y(t,e){return St.Create({"~kind":"Array"},{type:"array",items:t},e)}function cc(t){return ur(t,"Array")}function qTe(t){return St.Discard(t,["~kind","type","items"])}p();function OI(t,e,n={}){return St.Create({"~kind":"Constructor"},{type:"constructor",parameters:t,instanceType:e},n)}function Xu(t){return ur(t,"Constructor")}function VFn(t){return St.Discard(t,["~kind","type","parameters","instanceType"])}p();function MI(t,e,n={}){return St.Create({"~kind":"Function"},{type:"function",parameters:t,returnType:e},n)}function Zu(t){return ur(t,"Function")}function jFn(t){return St.Discard(t,["~kind","type","parameters","returnType"])}p();p();p();function XT(t,e){return St.Create({"~kind":"Ref"},{$ref:t},e)}function ed(t){return ur(t,"Ref")}p();function c1(t,e){return St.Create({"~kind":"Generic"},{type:"generic",parameters:t,expression:e})}function kV(t){return ur(t,"Generic")}p();p();p();function NV(t){return St.Create({"~kind":"Any"},{},t)}function Xl(t){return ur(t,"Any")}p();var YFn="(?!)";function Uo(t){return St.Create({"~kind":"Never"},{not:{}},t)}function l1(t){return ur(t,"Never")}p();p();p();p();function LI(t,e={}){return br("AddOptional",[t],e)}function XF(t,e={}){return Fne(t,e)}function KFn(t){return XF(t)}function lh(t){return yu(t)&&Ue.HasPropertyKey(t,"~optional")}function zFn(t){return Ue.Keys(t).filter(e=>!lh(t[e]))}function HTe(t){return Ue.Keys(t)}function VTe(t){return Ue.Values(t)}function vs(t,e={}){let n=zFn(t),r=n.length>0?{required:n}:{};return St.Create({"~kind":"Object"},{type:"object",...r,properties:t},e)}function co(t){return ur(t,"Object")}function JFn(t){return St.Discard(t,["~kind","type","properties","required"])}p();p();function xd(t){return St.Create({"~kind":"Unknown"},{},t)}function Eu(t){return ur(t,"Unknown")}p();p();p();function FI(t,e,n){let r=Ue.Keys(t).reduce((s,i)=>({...s,[i]:St.Update(t[i],{},{$id:i})}),{});return St.Create({"~kind":"Cyclic"},{$defs:r,$ref:e},n)}function mp(t){return ur(t,"Cyclic")}p();function XFn(t){return St.Update(t,{"~unsafe":null},{})}function jTe(t){return Ue.IsObjectNotArray(t)&&Ue.HasPropertyKey(t,"~unsafe")&&Ue.IsNull(t["~unsafe"])}p();p();p();p();var QI={};Ir(QI,{Match:()=>e3s});p();function e3s(t,e){return e[t.length]?.(...t)??(()=>{throw Error("Invalid Arguments")})()}function Qne(...t){let[e,n]=QI.Match(t,{2:(r,s)=>[r,s,s],1:r=>[r,xd(),xd()]});return St.Create({"~kind":"Infer"},{type:"infer",name:e,extends:n},{})}function _l(t){return ur(t,"Infer")}p();p();function ZF(t,e,n,r={}){return St.Create({"~kind":"Dependent"},{if:t,then:e,else:n},r)}function Yc(t){return ur(t,"Dependent")}function ZFn(t){return St.Discard(t,["~kind","if","then","else"])}p();p();function eQn(t){return Ue.IsObjectNotArray(t)}function tQn(t){return Ue.Keys(t).filter(n=>isNaN(n)).reduce((n,r)=>[...n,t[r]],[])}function nQn(t){return Ue.IsString(t)||Ue.IsNumber(t)}function rQn(t,e){let n=eQn(t)?tQn(t):t;return St.Create({"~kind":"Enum"},{enum:n},e)}function Zh(t){return ur(t,"Enum")}p();function uh(t,e={}){return St.Create({"~kind":"Intersect"},{allOf:t},e)}function Ti(t){return ur(t,"Intersect")}function sQn(t){return St.Discard(t,["~kind","allOf"])}p();p();p();p();p();p();p();p();p();function Sl(){throw new Error("Unreachable")}var iQn;(function(t){t[t.Array=0]="Array",t[t.BigInt=1]="BigInt",t[t.Boolean=2]="Boolean",t[t.Date=3]="Date",t[t.Constructor=4]="Constructor",t[t.Function=5]="Function",t[t.Null=6]="Null",t[t.Number=7]="Number",t[t.Object=8]="Object",t[t.RegExp=9]="RegExp",t[t.String=10]="String",t[t.Symbol=11]="Symbol",t[t.TypeArray=12]="TypeArray",t[t.Undefined=13]="Undefined"})(iQn||(iQn={}));var $fc=BigInt("14695981039346656037"),[Gfc,Wfc]=[BigInt("1099511628211"),BigInt("18446744073709551616")],qfc=Array.from({length:256}).map((t,e)=>BigInt(e)),oQn=new Float64Array(1),Hfc=new DataView(oQn.buffer),Vfc=new Uint8Array(oQn.buffer);var jfc=new TextEncoder;p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();var Une=class{constructor(e,n){this.type=e,this.decode=n}Encode(e){let n=this.type,r=YTe(n)?o=>this.decode(n["~codec"].decode(o)):this.decode,s=YTe(n)?o=>n["~codec"].encode(e(o)):e,i={decode:r,encode:s};return St.Update(this.type,{"~codec":i},{})}},$ne=class{constructor(e){this.type=e}Decode(e){return new Une(this.type,e)}};function KTe(t){return new $ne(t)}function cQn(t,e){return KTe(t).Decode(e).Encode(()=>{throw Error("Encode not implemented")})}function lQn(t,e){return KTe(t).Decode(()=>{throw Error("Decode not implemented")}).Encode(e)}function YTe(t){return yu(t)&&Ue.HasPropertyKey(t,"~codec")&&Ue.IsObject(t["~codec"])&&Ue.HasPropertyKey(t["~codec"],"encode")&&Ue.HasPropertyKey(t["~codec"],"decode")}p();function uQn(t){return DV(t)}function eQ(t){return yu(t)&&Ue.HasPropertyKey(t,"~immutable")}p();p();function UI(t,e={}){return br("AddReadonly",[t],e)}function tQ(t,e={}){return Lne(t,e)}function dQn(t){return tQ(t)}function nQ(t){return yu(t)&&Ue.HasPropertyKey(t,"~readonly")}p();function s3s(t,e){let n=Qat(t)?[...t["~refine"],e]:[e];return St.Update(t,{"~refine":n},{})}function pQn(...t){let[e,n,r]=QI.Match(t,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[s,i,()=>"Refine Error"]});return s3s(e,{check:n,error:r})}function i3s(t){return Ue.IsObjectNotArray(t)&&Ue.HasPropertyKey(t,"check")&&Ue.HasPropertyKey(t,"error")&&Ue.IsFunction(t.check)&&Ue.IsFunction(t.error)}function Qat(t){return yu(t)&&Ue.HasPropertyKey(t,"~refine")&&Ue.IsArray(t["~refine"])&&Ue.Every(t["~refine"],0,e=>i3s(e))}p();var hQn="-?(?:0|[1-9][0-9]*)n";function Gne(t){return St.Create({"~kind":"BigInt"},{type:"bigint"},t)}function $I(t){return ur(t,"BigInt")}p();function zTe(t){return St.Create({"~kind":"Boolean"},{type:"boolean"},t)}function yb(t){return ur(t,"Boolean")}p();function Wne(t){return St.Create({"~kind":"Identifier"},{name:t})}function mQn(t){return ur(t,"Identifier")}p();var JTe="-?(?:0|[1-9][0-9]*)";function rQ(t){return St.Create({"~kind":"Integer"},{type:"integer"},t)}function em(t){return ur(t,"Integer")}p();var Uat=class extends Error{constructor(e){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function o3s(t){return Ue.IsBigInt(t)?"bigint":Ue.IsBoolean(t)?"boolean":Ue.IsNumber(t)?"number":Ue.IsString(t)?"string":(()=>{throw new Uat(t)})()}function vi(t,e){return St.Create({"~kind":"Literal"},{type:o3s(t),const:t},e)}function XTe(t){return Ue.IsBigInt(t)||Ue.IsBoolean(t)||Ue.IsNumber(t)||Ue.IsString(t)}function fQn(t){return yo(t)&&Ue.IsNumber(t.const)}function gQn(t){return yo(t)&&Ue.IsString(t.const)}function yo(t){return ur(t,"Literal")}p();function BV(t){return St.Create({"~kind":"Null"},{type:"null"},t)}function PV(t){return ur(t,"Null")}p();var ZTe="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function _g(t){return St.Create({"~kind":"Number"},{type:"number"},t)}function Zl(t){return ur(t,"Number")}p();function OV(t){return St.Create({"~kind":"Symbol"},{type:"symbol"},t)}function u1(t){return ur(t,"Symbol")}p();function sQ(...t){let[e,n,r]=QI.Match(t,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[s,i,i],1:s=>[s,xd(),xd()]});return St.Create({"~kind":"Parameter"},{name:e,extends:n,equals:r},{})}function AQn(t){return ur(t,"Parameter")}p();p();var eve=".*";function Eb(t){return St.Create({"~kind":"String"},{type:"string"},t)}function tm(t){return ur(t,"String")}p();p();function gi(t,e={}){return St.Create({"~kind":"Union"},{anyOf:t},e)}function Er(t){return ur(t,"Union")}function yQn(t){return St.Discard(t,["~kind","anyOf"])}p();function qne(t){let e=EQn(t);return Ue.IsEqual(e.length,2)?e[0]:[]}p();function a3s(t){return!0}function bQn(t){return Ue.ShiftLeft(t,(e,n)=>c3s(e)?bQn(n):!1,()=>!0)}function _Qn(t){return Ue.IsEqual(t.length,0)?!1:bQn(t)}function c3s(t){return Er(t)?_Qn(t.anyOf):yo(t)?a3s(t.const):!1}function tve(t){return _Qn(t)}p();function nve(t){return St.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:t},{})}function SQn(t,e,n=[]){return Ue.ShiftLeft(t,(r,s)=>SQn(s,e,[...n,`${r}${e}`]),()=>n)}function l3s(t,e){return Ue.IsEqual(t.length,0)?[`${e}`]:SQn(t,e)}function CQn(t,e,n=[]){return Ue.ShiftLeft(e,(r,s)=>CQn(t,s,[...n,...IQn(t,r)]),()=>n)}function IQn(t,e){return Er(e)?CQn(t,e.anyOf):yo(e)?l3s(t,e.const):Sl()}function xQn(t,e){return Ue.ShiftLeft(e,(n,r)=>xQn(IQn(t,n),r),()=>t)}function u3s(t){return t.map(e=>vi(e))}function d3s(t){let e=xQn([],t),n=u3s(e);return gi(n)}function p3s(t){return Ue.IsEqual(t.length,0)?Sl():Ue.IsEqual(t.length,1)&&yo(t[0])?t[0]:d3s(t)}function $at(t){let e=qne(t);return Ue.IsEqual(e.length,0)?Eb():tve(e)?p3s(e):nve(t)}function wQn(t){let e=$at(t);return eu(e)?Eb():e}p();function df(t,e){let n="object",r={[t]:e};return St.Create({"~kind":"Record"},{type:n,patternProperties:r})}p();p();p();function TQn(t){return df(q0,t)}p();function vQn(t){return vs({true:t,false:t})}p();p();p();p();function tu(t,e={}){let[n,r,s]=[t,t.length,!1];return St.Create({"~kind":"Tuple"},{type:"array",additionalItems:s,items:n,minItems:r},e)}function ia(t){return ur(t,"Tuple")}function RQn(t){return St.Discard(t,["~kind","type","items","minItems","additionalItems"])}p();p();p();function h3s(t){return St.Discard(t,["~readonly"])}function Gat(t,e){return St.Update(h3s(t),{},e)}function kQn(t,e,n,r){let s=wn(t,e,n);return Gat(s,r)}function NQn(t,e={}){return br("RemoveReadonly",[t],e)}function DQn(t,e={}){return Gat(t,e)}p();p();function m3s(t){return St.Discard(t,["~optional"])}function Wat(t,e){return St.Update(m3s(t),{},e)}function BQn(t,e,n,r){let s=wn(t,e,n);return Wat(s,r)}function PQn(t,e={}){return br("RemoveOptional",[t],e)}function rve(t,e={}){return Wat(t,e)}p();function qat(t){return t.reduceRight((n,r,s)=>({[s]:r,...n}),{})}function OQn(t){let e=qat(t.items);return vs(e)}function f3s(t,e){return nQ(t)?!!nQ(e):!1}function g3s(t,e){return lh(t)?!!lh(e):!1}function A3s(t,e){let n=f3s(t,e),r=g3s(t,e),s=wc([t,e]),i=DQn(rve(s));return n&&r?tQ(XF(i)):n&&!r?tQ(i):!n&&r?XF(i):i}function y3s(t,e,n){return n in t?n in e?A3s(t[n],e[n]):t[n]:n in e?e[n]:Uo()}function E3s(t,e){return[...new Set([...Ue.Keys(e),...Ue.Keys(t)])].reduce((r,s)=>({...r,[s]:y3s(t,e,s)}),{})}function MQn(t){return co(t)?t.properties:ia(t)?qat(t.items):Sl()}function LQn(t,e){let n=MQn(t),r=MQn(e),s=E3s(n,r);return vs(s)}p();function FQn(t,e){let n=MV(t,e);return Ue.IsEqual(n,Vne)?t:Ue.IsEqual(n,jne)||Ue.IsEqual(n,Hne)?e:Uo()}function QQn(t){return co(t)||ia(t)}function b3s(t,e){let n=Er(t),r=Er(e);return n||r}function _3s(t,e){let n=bb(t),r=bb(e),s=b3s(n,r),i=QQn(n),o=QQn(r);return s?wc([n,r]):i&&o?LQn(n,r):i&&!o?n:!i&&o?r:FQn(n,r)}function UQn(t,e,n=[]){return Ue.ShiftLeft(e,(r,s)=>UQn(t,s,[...n,_3s(t,r)]),()=>Ue.IsEqual(n.length,0)?[t]:n)}function $Qn(t,e,n=[]){return Ue.ShiftLeft(t,(r,s)=>$Qn(s,e,[...n,...Yne([r],e)]),()=>n)}function Yne(t,e=[]){return Ue.ShiftLeft(t,(n,r)=>Er(n)?Yne(r,$Qn(n.anyOf,e)):Yne(r,UQn(n,e)),()=>e)}p();function S3s(t,e){let n=fp({},t,e);return gs.IsExtendsTrueLike(n)?[]:[t]}function C3s(t,e){return t.reduce((n,r)=>[...n,...S3s(r,e)],[])}function sve(t,e){let n=bb(t),r=Er(n)?n.anyOf:[n],s=C3s(r,e);return Sg(s)}function H0(t,e,n){let r=uh([t,e]),s=sve(n,t);return Sg([r,s])}function Sy(t){let e=t.map(n=>vi(n));return Sg(e)}function wc(t){let e=Yne(t),n=Hat(e);return ZT(n)}function pf(t){let e=wQn(t);return bb(e)}function Sg(t){let e=Hat(t);return ZT(e)}function bb(t){return Yc(t)?H0(t.if,t.then,t.else):Zh(t)?Sy(t.enum):Ti(t)?wc(t.allOf):eu(t)?pf(t.pattern):Er(t)?Sg(t.anyOf):t}function ZT(t){return Ue.IsEqual(t.length,1)?t[0]:Ue.IsEqual(t.length,0)?Uo():gi(t)}function GQn(t,e){let n=Sy(t);return d1(n,e)}p();function WQn(t,e){return df(p1,e)}p();function qQn(t,e){let n=wc(t);return d1(n,e)}p();function HQn(t,e){return Ue.IsString(t)||Ue.IsNumber(t)?vs({[t]:e}):Ue.IsEqual(t,!1)?vs({false:e}):Ue.IsEqual(t,!0)?vs({true:e}):vs({})}p();function VQn(t,e){return df(LV,e)}p();function jQn(t,e){return Ue.HasPropertyKey(t,"pattern")&&(Ue.IsString(t.pattern)||t.pattern instanceof RegExp)?df(t.pattern.toString(),e):df(q0,e)}p();function YQn(t,e){let n=qne(t);return tve(n)?d1(pf(t),e):df(t,e)}p();p();function I3s(t){return Er(t)?Kne(t.anyOf):[t]}function Kne(t){return t.reduce((e,n)=>[...e,...I3s(n)],[])}function x3s(t){return t.some(e=>tm(e)||Zl(e)||em(e))}function w3s(t,e){return Ue.IsEqual(x3s(t),!0)?df(q0,e):void 0}function T3s(t,e){return t.reduce((n,r)=>yo(r)&&(Ue.IsString(r.const)||Ue.IsNumber(r.const))?{...n,[r.const]:e}:n,{})}function v3s(t,e){let n=T3s(t,e);return vs(n)}function KQn(t,e){let n=Kne(t),r=w3s(n,e);return yu(r)?r:v3s(n,e)}function d1(t,e){return Xl(t)?TQn(e):yb(t)?vQn(e):Zh(t)?GQn(t.enum,e):em(t)?WQn(t,e):Ti(t)?qQn(t.allOf,e):yo(t)?HQn(t.const,e):Zl(t)?VQn(t,e):Er(t)?KQn(t.anyOf,e):tm(t)?jQn(t,e):eu(t)?YQn(t.pattern,e):vs({})}function Vat(t,e,n){return Js([t])?St.Update(d1(t,e),{},n):ive(t,e,n)}function zQn(t,e,n,r,s){let i=wn(t,e,n),o=wn(t,e,r);return Vat(i,o,s)}var p1=`^${JTe}$`,LV=`^${ZTe}$`,q0=`^${eve}$`;function ive(t,e,n={}){return br("Record",[t,e],n)}function ove(t,e,n={}){return Vat(t,e,n)}function JQn(t,e){return df(t,e)}function ave(t){return Ue.IsEqual(t,q0)?Eb():Ue.IsEqual(t,p1)?rQ():Ue.IsEqual(t,LV)?_g():$at(t)}function _b(t){return Ue.Keys(t.patternProperties)[0]}function FV(t){let e=_b(t);return ave(e)}function nm(t){return t.patternProperties[_b(t)]}function gp(t){return ur(t,"Record")}p();function iQ(t){return St.Create({"~kind":"Rest"},{type:"rest",items:t},{})}function h1(t){return ur(t,"Rest")}p();p();function cve(t){return St.Create({"~kind":"This"},{$ref:"#"},t)}function lve(t){return ur(t,"This")}p();function QV(t){return St.Create({"~kind":"Undefined"},{type:"undefined"},t)}function UV(t){return ur(t,"Undefined")}p();function uve(t){return St.Create({"~kind":"Void"},{type:"void"},t)}function GI(t){return ur(t,"Void")}function k3s(t,e){return Ue.IsEqual(t,"Array")?_y(e[0]):Ue.IsEqual(t,"Capitalize")?pve(e[0]):Ue.IsEqual(t,"ConstructorParameters")?Ave(e[0]):Ue.IsEqual(t,"Evaluate")?Z2n(e[0]):Ue.IsEqual(t,"Exclude")?yve(e[0],e[1]):Ue.IsEqual(t,"Extract")?Eve(e[0],e[1]):Ue.IsEqual(t,"Index")?Zne(e[0],e[1]):Ue.IsEqual(t,"InstanceType")?bve(e[0]):Ue.IsEqual(t,"Lowercase")?hve(e[0]):Ue.IsEqual(t,"NonNullable")?_ve(e[0]):Ue.IsEqual(t,"Omit")?Sve(e[0],e[1]):Ue.IsEqual(t,"Parameters")?Cve(e[0]):Ue.IsEqual(t,"Partial")?Ive(e[0]):Ue.IsEqual(t,"Pick")?xve(e[0],e[1]):Ue.IsEqual(t,"Readonly")?wve(e[0]):Ue.IsEqual(t,"KeyOf")?ere(e[0]):Ue.IsEqual(t,"Record")?ive(e[0],e[1]):Ue.IsEqual(t,"Required")?Tve(e[0]):Ue.IsEqual(t,"ReturnType")?vve(e[0]):Ue.IsEqual(t,"Uncapitalize")?mve(e[0]):Ue.IsEqual(t,"Uppercase")?fve(e[0]):Xne(XT(t),e)}function oQ(){throw Error("Unreachable")}var N3s=(t,e=[])=>t.reduce((n,r)=>Ue.IsArray(r)&&Ue.IsEqual(r.length,2)?[...n,r[0]]:[...n,r],[]),ev=t=>{let[e,n]=t;return N3s([...e,...n])};function nUn(t){return sQ(t[0],t[2],t[4])}function rUn(t){return sQ(t[0],t[2],t[2])}function sUn(t){return sQ(t[0],xd(),t[2])}function iUn(t){return sQ(t,xd(),xd())}function oUn(t){return ev(t)}function aUn(t){return t[1]}function cUn(t){return ev(t)}function lUn(t){return t[1]}function uUn(t){return k3s(t[0],t[1])}function dUn(t){return null}function pUn(t){return Eb()}function hUn(t){return _g()}function mUn(t){return zTe()}function fUn(t){return QV()}function gUn(t){return BV()}function AUn(t){return rQ()}function yUn(t){return Gne()}function EUn(t){return xd()}function bUn(t){return NV()}function _Un(t){return vs({})}function SUn(t){return Uo()}function CUn(t){return OV()}function IUn(t){return uve()}function xUn(t){return cve()}function wUn(t){return vi(BigInt(t))}function TUn(t){return vi(Ue.IsEqual(t,"true"))}function vUn(t){return vi(parseFloat(t))}function RUn(t){return vi(t)}function kUn(t){return t[1]}function NUn(t){return vi(t)}function DUn(t){return Ue.IsEqual(t.length,3)?[t[0],t[1],...t[2]]:[t[0]]}function BUn(t){return t[1]}function PUn(t){return dve(t)}function OUn(t){return Ue.IsEqual(t.length,6)?ZF(t[1],t[3],t[5]):ZF(t[1],t[3],xd())}function MUn(t){return t.length>0}function LUn(t){return t.reduce((e,n)=>Ue.IsEqual(n.length,3)?[...e,[n[1]]]:[...e,[]],[])}function FUn(t){return Ue.IsEqual(t.length,6)?[t[1],t[3],t[5]]:[]}function QUn(t){return Ue.IsArray(t)&&Ue.IsEqual(t.length,3)?t[1]:t}function UUn(t){return Ue.IsEqual(t.length,2)?t[1]:[]}function XQn(t,e){return e.reduce((n,r)=>{let s=r;return Ue.IsEqual(s.length,1)?Zne(n,s[0]):Ue.IsEqual(s.length,0)?_y(n):oQ()},t)}function ZQn(t,e){return Ue.IsEqual(e.length,3)?gve(t,e[0],e[1],e[2]):t}function D3s(t,e){return Ue.IsArray(e)&&Ue.IsEqual(e.length,0)?t:Rve(t,e)}function $Un(t){let[e,n,r,s,i]=t;return D3s(ZQn(e?ere(XQn(n,r)):XQn(n,r),s),i)}function jat(t,e){return Ue.IsEqual(e.length,3)?(()=>{let[n,r,s]=e,i=jat(r,s);if(Ue.IsEqual(n,"&"))return Ti(i)?uh([t,...i.allOf]):uh([t,i]);if(Ue.IsEqual(n,"|"))return Er(i)?gi([t,...i.anyOf]):gi([t,i]);oQ()})():t}function GUn(t){let[e,n]=t;return jat(e,n)}function WUn(t){let[e,n]=t;return jat(e,n)}function qUn(t){return X2n(t[1])}function HUn(t){return t[1]}function VUn(t){return c1(t[0],t[2])}function jUn(t){return Ue.IsEqual(t.length,4)?Qne(t[1],t[3]):Ue.IsEqual(t.length,2)?Qne(t[1],xd()):oQ()}function YUn(t){return`${t}`}function KUn(t){return em(t[3])?p1:Zl(t[3])?LV:u1(t[3])?q0:tm(t[3])?q0:oQ()}function zUn(t){return t.length>0}function JUn(t){return t.length>0}function XUn(t){let[e,n,r,s,i]=t;return{[n]:e&&r?UI(LI(i)):e&&!r?UI(i):!e&&r?LI(i):i}}function ZUn(t){return ev(t)}function e2n(t){return t.reduce((e,n)=>Ue.HasPropertyKey(n,p1)||Ue.HasPropertyKey(n,LV)||Ue.HasPropertyKey(n,q0)?[e[0],St.Assign(e[1],n)]:[St.Assign(e[0],n),e[1]],[{},{}])}function t2n(t){return e2n(t[1])}function n2n(t){let[e,n]=t,r=Ue.IsEqual(Ue.Keys(n).length,0)?{}:{patternProperties:n};return vs(e,r)}function r2n(t){return Ue.IsEqual(t.length,5)?UI(LI(t[4])):Ue.IsEqual(t.length,3)?t[2]:Ue.IsEqual(t.length,4)?Ue.IsEqual(t[2],"readonly")?UI(t[3]):LI(t[3]):oQ()}function s2n(t){return UI(LI(t[1]))}function i2n(t){return UI(t[1])}function o2n(t){return LI(t[0])}function a2n(t){return Ue.IsEqual(t.length,2)?iQ(t[1]):Ue.IsEqual(t.length,1)?t[0]:oQ()}function c2n(t){return ev(t)}function l2n(t){return tu(t[1])}function u2n(t){return UI(LI(t[4]))}function d2n(t){return UI(t[3])}function p2n(t){return LI(t[3])}function h2n(t){return t[2]}function m2n(t){return Ue.IsEqual(t.length,2)?iQ(t[1]):Ue.IsEqual(t.length,1)?t[0]:oQ()}function f2n(t){return ev(t)}function g2n(t){return MI(t[1],t[4])}function A2n(t){return OI(t[2],t[5])}function eUn(t,e){return Ue.IsEqual(t,"remove")?NQn(e):Ue.IsEqual(t,"add")?UI(e):e}function y2n(t){return Ue.IsEqual(t.length,2)&&Ue.IsEqual(t[0],"-")?"remove":Ue.IsEqual(t.length,2)&&Ue.IsEqual(t[0],"+")||Ue.IsEqual(t.length,1)?"add":"none"}function tUn(t,e){return Ue.IsEqual(t,"remove")?PQn(e):Ue.IsEqual(t,"add")?LI(e):e}function E2n(t){return Ue.IsEqual(t.length,2)&&Ue.IsEqual(t[0],"-")?"remove":Ue.IsEqual(t.length,2)&&Ue.IsEqual(t[0],"+")||Ue.IsEqual(t.length,1)?"add":"none"}function b2n(t){return Ue.IsEqual(t.length,2)?[t[1]]:[]}function _2n(t){return Ue.IsArray(t[6])&&Ue.IsEqual(t[6].length,1)?zne(Wne(t[3]),t[5],t[6][0],eUn(t[1],tUn(t[8],t[10]))):zne(Wne(t[3]),t[5],XT(t[3]),eUn(t[1],tUn(t[8],t[10])))}function S2n(t){return XT(t)}function C2n(t){return BigInt(t)}function I2n(t){return parseFloat(t)}function x2n(t){return Ue.IsEqual(t,"true")}function w2n(t){return null}function T2n(t){return{[t[0]]:t[2]}}function v2n(t){return ev(t)}function B3s(t){return t.reduce((e,n)=>St.Assign(e,n),{})}function R2n(t){return B3s(t[1])}function k2n(t){return ev(t)}function N2n(t){return t[1]}function D2n(t){return Gne()}function B2n(t){return Eb()}function P2n(t){return _g()}function O2n(t){return rQ()}function M2n(t){return Uo()}function L2n(t){return vi(t)}function F2n(t){return gi(t[1])}function Q2n(t){return t.length===3?[...t[0],...t[2]]:t.length===1?[...t[0]]:[]}function U2n(t){return[t[0],...t[1]]}function $2n(t){return t[1]}function G2n(t){return ev(t)}function W2n(t){return Ue.IsEqual(t.length,2)?t[1]:[]}function q2n(t){let e=t[2],n=t[3],[r,s]=t[4],i=Ue.IsEqual(Ue.Keys(s).length,0)?{}:{patternProperties:s};return{[t[1]]:c1(e,Jne(n,r,i))}}function H2n(t){let e=t[2],[n,r]=t[3],s=Ue.IsEqual(Ue.Keys(r).length,0)?{}:{patternProperties:r};return{[t[1]]:Jne(e,n,s)}}function V2n(t){return{[t[1]]:c1(t[2],t[4])}}function j2n(t){return{[t[1]]:t[3]}}function Y2n(t){return null}function K2n(t){return e2n(ev(t))}function z2n(t){return t[1]}function J2n(t){let e=t[0],n=t[1];return e$n(St.Assign(e,n[0]))}p();p();p();p();function tre(t){return Vi(t.length,2)}function _i(t,e,n){return tre(t)?e(t[0],t[1]):n()}p();function M3s(t,e){return Vi(e.indexOf(t),0)?[t,e.slice(t.length)]:[]}function Tc(t,e){for(let n=0;nString.fromCharCode(t+r))}var t$n=[...Yat(97,122),...Yat(65,90)],Kat="0",zat=Yat(49,57),$V=[Kat,...zat],n$n=" ",GV=` -`;var m1="_",kve=".",r$n="$",Nve="-";var s$n="//",i$n="/*",F3s="*/";function o$n(t){let e=t.indexOf(F3s);return Vi(e,-1)?"":t.slice(e+2)}function a$n(t){let e=t.indexOf(GV);return Vi(e,-1)?"":t.slice(e)}function Q3s(t){return t.replace(/^[ \t\r\f\v]+/,"")}function Dve(t){let e=Q3s(t);return e.startsWith(i$n)?Dve(o$n(e.slice(2))):e.startsWith(s$n)?Dve(a$n(e.slice(2))):e}function wd(t){let e=t.trimStart();return e.startsWith(i$n)?wd(o$n(e.slice(2))):e.startsWith(s$n)?wd(a$n(e.slice(2))):e}p();function Bve(t,e){return _i(Tc([t],e),(n,r)=>[n,r],()=>["",e])}p();p();function U3s(t,e){return t.includes(e)}function WV(t,e,n,r=""){return _i(Tc(t,n),(s,i)=>U3s(e,s)?WV(t,e,i,r):WV(t,e,i,`${r}${s}`),()=>[r,n])}function $3s(t){return Tc(zat,t)}var G3s=[...$V,m1];function W3s(t){return WV(G3s,[m1],t)}function q3s(t){return _i(Tc([Kat],t),(e,n)=>[e,n],()=>_i($3s(t),(e,n)=>_i(W3s(n),(r,s)=>[`${e}${r}`,s],()=>[]),()=>[]))}function Pve(t){return q3s(wd(t))}function H3s(t){return Bve(Nve,t)}function V3s(t){return _i(H3s(t),(e,n)=>_i(Pve(n),(r,s)=>[`${e}${r}`,s],()=>[]),()=>[])}function c$n(t){return V3s(wd(t))}function j3s(t){return _i(c$n(t),(e,n)=>_i(Tc(["n"],n),(r,s)=>[`${e}`,s],()=>[]),()=>[])}function Jat(t){return j3s(t)}p();function Xat(t,e){return Tc([t],e)}function Ht(t,e){return Vi(t,"")?["",e]:t.startsWith(GV)?Xat(t,Dve(e)):t.startsWith(n$n)?Xat(t,e):Xat(t,wd(e))}p();var l$n=[...t$n,m1,r$n];function Y3s(t){return Tc(l$n,t)}var K3s=[...l$n,...$V];function u$n(t,e=""){return _i(Tc(K3s,t),(n,r)=>u$n(r,`${e}${n}`),()=>[e,t])}function z3s(t){return _i(Y3s(t),(e,n)=>_i(u$n(n),(r,s)=>[`${e}${r}`,s],()=>[]),()=>[])}function Kc(t){return z3s(wd(t))}p();p();var J3s=[...$V,m1];function X3s(t){return tre(Tc([kve],t))}function d$n(t){return _i(WV(J3s,[m1],t),(e,n)=>Vi(e,"")?[]:[e,n],()=>[])}function Z3s(t){return _i(Tc([kve],t),(e,n)=>_i(d$n(n),(r,s)=>[`0${e}${r}`,s],()=>[]),()=>[])}function eHs(t){return _i(Pve(t),(e,n)=>_i(Tc([kve],n),(r,s)=>_i(d$n(s),(i,o)=>[`${e}${r}${i}`,o],()=>[`${e}`,s]),()=>[`${e}`,n]),()=>[])}function tHs(t){return X3s(t)?Z3s(t):eHs(t)}function p$n(t){return tHs(wd(t))}function nHs(t){return Bve(Nve,t)}function rHs(t){return _i(nHs(t),(e,n)=>_i(p$n(n),(r,s)=>[`${e}${r}`,s],()=>[]),()=>[])}function Ove(t){return rHs(wd(t))}p();p();p();function sHs(t){return Vi(t,"")?[]:[t.slice(0,1),t.slice(1)]}function h$n(t,e){return WTe(t,(n,r)=>e.startsWith(n)?!0:h$n(r,e),()=>!1)}function f1(t,e,n=""){return _i(sHs(e),(r,s)=>h$n(t,e)?[n,e]:f1(t,s,`${n}${r}`),()=>[])}function iHs(t,e,n){return _i(Tc([t],n),(r,s)=>_i(f1([e],s),(i,o)=>_i(Tc([e],o),(a,c)=>[`${i}`,c],()=>[]),()=>[]),()=>[])}function oHs(t,e,n){return _i(Tc([t],n),(r,s)=>_i(f1([GV,e],s),(i,o)=>_i(Tc([e],o),(a,c)=>[`${i}`,c],()=>[]),()=>[]),()=>[])}function m$n(t,e,n,r){return n?iHs(t,e,wd(r)):oHs(t,e,wd(r))}p();function aHs(t,e){return Tc(t,e)}function cHs(t,e){return m$n(t,t,!1,e)}function lHs(t,e){return _i(aHs(t,e),(n,r)=>cHs(n,`${n}${r}`),()=>[])}function Mve(t,e){return lHs(t,wd(e))}p();function f$n(t,e){return _i(f1(t,e),(n,r)=>Vi(n,"")?[]:[n,r],()=>[])}var ge=(t,e,n=()=>[])=>t.length===2?e(t):n(),dHs=t=>ge(ge(Kc(t),([e,n])=>ge(Ht("extends",n),([r,s])=>ge(Si(s),([i,o])=>ge(Ht("=",o),([a,c])=>ge(Si(c),([u,l])=>[[e,r,i,a,u],l]))))),([e,n])=>[nUn(e),n]),pHs=t=>ge(ge(Kc(t),([e,n])=>ge(Ht("extends",n),([r,s])=>ge(Si(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[rUn(e),n]),hHs=t=>ge(ge(Kc(t),([e,n])=>ge(Ht("=",n),([r,s])=>ge(Si(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[sUn(e),n]),mHs=t=>ge(Kc(t),([e,n])=>[iUn(e),n]),y$n=t=>ge(ge(dHs(t),([e,n])=>[e,n],()=>ge(pHs(t),([e,n])=>[e,n],()=>ge(hHs(t),([e,n])=>[e,n],()=>ge(mHs(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),E$n=(t,e=[])=>ge(ge(y$n(t),([n,r])=>ge(Ht(",",r),([s,i])=>[[n,s],i])),([n,r])=>E$n(r,[...e,n]),()=>[e,t]),fHs=t=>ge(ge(E$n(t),([e,n])=>ge(ge(ge(y$n(n),([r,s])=>[[r],s]),([r,s])=>[r,s],()=>ge([[],n],([r,s])=>[r,s],()=>[])),([r,s])=>[[e,r],s])),([e,n])=>[oUn(e),n]),tct=t=>ge(ge(Ht("<",t),([e,n])=>ge(fHs(n),([r,s])=>ge(Ht(">",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[aUn(e),n]),b$n=(t,e=[])=>ge(ge(Si(t),([n,r])=>ge(Ht(",",r),([s,i])=>[[n,s],i])),([n,r])=>b$n(r,[...e,n]),()=>[e,t]),gHs=t=>ge(ge(b$n(t),([e,n])=>ge(ge(ge(Si(n),([r,s])=>[[r],s]),([r,s])=>[r,s],()=>ge([[],n],([r,s])=>[r,s],()=>[])),([r,s])=>[[e,r],s])),([e,n])=>[cUn(e),n]),AHs=t=>ge(ge(Ht("<",t),([e,n])=>ge(gHs(n),([r,s])=>ge(Ht(">",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[lUn(e),n]),yHs=t=>ge(ge(Kc(t),([e,n])=>ge(AHs(n),([r,s])=>[[e,r],s])),([e,n])=>[uUn(e),n]),_$n=t=>ge(ge(ge(Ht(";",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[dUn(e),n]),S$n=t=>ge(Ht("string",t),([e,n])=>[pUn(e),n]),C$n=t=>ge(Ht("number",t),([e,n])=>[hUn(e),n]),EHs=t=>ge(Ht("boolean",t),([e,n])=>[mUn(e),n]),bHs=t=>ge(Ht("undefined",t),([e,n])=>[fUn(e),n]),_Hs=t=>ge(Ht("null",t),([e,n])=>[gUn(e),n]),I$n=t=>ge(Ht("integer",t),([e,n])=>[AUn(e),n]),SHs=t=>ge(Ht("bigint",t),([e,n])=>[yUn(e),n]),CHs=t=>ge(Ht("unknown",t),([e,n])=>[EUn(e),n]),IHs=t=>ge(Ht("any",t),([e,n])=>[bUn(e),n]),xHs=t=>ge(Ht("object",t),([e,n])=>[_Un(e),n]),wHs=t=>ge(Ht("never",t),([e,n])=>[SUn(e),n]),x$n=t=>ge(Ht("symbol",t),([e,n])=>[CUn(e),n]),THs=t=>ge(Ht("void",t),([e,n])=>[IUn(e),n]),vHs=t=>ge(Ht("this",t),([e,n])=>[xUn(e),n]),RHs=t=>ge(ge(Ht("${",t),([e,n])=>ge(Si(n),([r,s])=>ge(Ht("}",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[kUn(e),n]),Zat=t=>ge(f1(["${","`"],t),([e,n])=>[NUn(e),n]),w$n=t=>ge(ge(ge(Zat(t),([e,n])=>ge(RHs(n),([r,s])=>ge(w$n(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[e,n],()=>ge(ge(Zat(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge(ge(Zat(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[]))),([e,n])=>[DUn(e),n]),nct=t=>ge(ge(Ht("`",t),([e,n])=>ge(w$n(n),([r,s])=>ge(Ht("`",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[BUn(e),n]),kHs=t=>ge(nct(t),([e,n])=>[PUn(e),n]),NHs=t=>ge(ge(ge(Ht("if",t),([e,n])=>ge(Si(n),([r,s])=>ge(Ht("then",s),([i,o])=>ge(Si(o),([a,c])=>ge(Ht("else",c),([u,l])=>ge(Si(l),([d,h])=>[[e,r,i,a,u,d],h])))))),([e,n])=>[e,n],()=>ge(ge(Ht("if",t),([e,n])=>ge(Si(n),([r,s])=>ge(Ht("then",s),([i,o])=>ge(Si(o),([a,c])=>[[e,r,i,a],c])))),([e,n])=>[e,n],()=>[])),([e,n])=>[OUn(e),n]),DHs=t=>ge(Jat(t),([e,n])=>[wUn(e),n]),BHs=t=>ge(ge(Ht("true",t),([e,n])=>[e,n],()=>ge(Ht("false",t),([e,n])=>[e,n],()=>[])),([e,n])=>[TUn(e),n]),PHs=t=>ge(Ove(t),([e,n])=>[vUn(e),n]),OHs=t=>ge(Mve(["'",'"'],t),([e,n])=>[RUn(e),n]),MHs=t=>ge(ge(ge(Ht("keyof",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[MUn(e),n]),T$n=(t,e=[])=>ge(ge(ge(Ht("[",t),([n,r])=>ge(Si(r),([s,i])=>ge(Ht("]",i),([o,a])=>[[n,s,o],a]))),([n,r])=>[n,r],()=>ge(ge(Ht("[",t),([n,r])=>ge(Ht("]",r),([s,i])=>[[n,s],i])),([n,r])=>[n,r],()=>[])),([n,r])=>T$n(r,[...e,n]),()=>[e,t]),LHs=t=>ge(T$n(t),([e,n])=>[LUn(e),n]),FHs=t=>ge(ge(ge(Ht("extends",t),([e,n])=>ge(Si(n),([r,s])=>ge(Ht("?",s),([i,o])=>ge(Si(o),([a,c])=>ge(Ht(":",c),([u,l])=>ge(Si(l),([d,h])=>[[e,r,i,a,u,d],h])))))),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[FUn(e),n]),QHs=t=>ge(ge(ge(Ht("(",t),([e,n])=>ge(Si(n),([r,s])=>ge(Ht(")",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[e,n],()=>ge(S$n(t),([e,n])=>[e,n],()=>ge(C$n(t),([e,n])=>[e,n],()=>ge(EHs(t),([e,n])=>[e,n],()=>ge(bHs(t),([e,n])=>[e,n],()=>ge(_Hs(t),([e,n])=>[e,n],()=>ge(I$n(t),([e,n])=>[e,n],()=>ge(SHs(t),([e,n])=>[e,n],()=>ge(CHs(t),([e,n])=>[e,n],()=>ge(IHs(t),([e,n])=>[e,n],()=>ge(xHs(t),([e,n])=>[e,n],()=>ge(wHs(t),([e,n])=>[e,n],()=>ge(x$n(t),([e,n])=>[e,n],()=>ge(THs(t),([e,n])=>[e,n],()=>ge(vHs(t),([e,n])=>[e,n],()=>ge(DHs(t),([e,n])=>[e,n],()=>ge(BHs(t),([e,n])=>[e,n],()=>ge(PHs(t),([e,n])=>[e,n],()=>ge(OHs(t),([e,n])=>[e,n],()=>ge(kHs(t),([e,n])=>[e,n],()=>ge(NHs(t),([e,n])=>[e,n],()=>ge(XHs(t),([e,n])=>[e,n],()=>ge(s5s(t),([e,n])=>[e,n],()=>ge(u5s(t),([e,n])=>[e,n],()=>ge(l5s(t),([e,n])=>[e,n],()=>ge(m5s(t),([e,n])=>[e,n],()=>ge(yHs(t),([e,n])=>[e,n],()=>ge(f5s(t),([e,n])=>[e,n],()=>[])))))))))))))))))))))))))))),([e,n])=>[QUn(e),n]),UHs=t=>ge(ge(ge(Ht("with",t),([e,n])=>ge(W$n(n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[UUn(e),n]),v$n=t=>ge(ge(MHs(t),([e,n])=>ge(QHs(n),([r,s])=>ge(LHs(s),([i,o])=>ge(FHs(o),([a,c])=>ge(UHs(c),([u,l])=>[[e,r,i,a,u],l]))))),([e,n])=>[$Un(e),n]),R$n=t=>ge(ge(ge(Ht("&",t),([e,n])=>ge(v$n(n),([r,s])=>ge(R$n(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[e,n]),k$n=t=>ge(ge(v$n(t),([e,n])=>ge(R$n(n),([r,s])=>[[e,r],s])),([e,n])=>[GUn(e),n]),N$n=t=>ge(ge(ge(Ht("|",t),([e,n])=>ge(k$n(n),([r,s])=>ge(N$n(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[e,n]),Lve=t=>ge(ge(k$n(t),([e,n])=>ge(N$n(n),([r,s])=>[[e,r],s])),([e,n])=>[WUn(e),n]),$Hs=t=>ge(ge(Ht("readonly",t),([e,n])=>ge(Lve(n),([r,s])=>[[e,r],s])),([e,n])=>[qUn(e),n]),GHs=t=>ge(ge(Ht("|",t),([e,n])=>ge(Lve(n),([r,s])=>[[e,r],s])),([e,n])=>[HUn(e),n]),WHs=t=>ge(ge(tct(t),([e,n])=>ge(Ht("=",n),([r,s])=>ge(Si(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[VUn(e),n]),qHs=t=>ge(ge(ge(Ht("infer",t),([e,n])=>ge(Kc(n),([r,s])=>ge(Ht("extends",s),([i,o])=>ge(Lve(o),([a,c])=>[[e,r,i,a],c])))),([e,n])=>[e,n],()=>ge(ge(Ht("infer",t),([e,n])=>ge(Kc(n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>[])),([e,n])=>[jUn(e),n]),Si=t=>ge(ge(qHs(t),([e,n])=>[e,n],()=>ge(GHs(t),([e,n])=>[e,n],()=>ge($Hs(t),([e,n])=>[e,n],()=>ge(Lve(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),HHs=t=>ge(Ove(t),([e,n])=>[YUn(e),n]),VHs=t=>ge(Kc(t),([e,n])=>[e,n]),jHs=t=>ge(Mve(["'",'"'],t),([e,n])=>[e,n]),YHs=t=>ge(ge(Ht("[",t),([e,n])=>ge(Kc(n),([r,s])=>ge(Ht(":",s),([i,o])=>ge(ge(I$n(o),([a,c])=>[a,c],()=>ge(C$n(o),([a,c])=>[a,c],()=>ge(S$n(o),([a,c])=>[a,c],()=>ge(x$n(o),([a,c])=>[a,c],()=>[])))),([a,c])=>ge(Ht("]",c),([u,l])=>[[e,r,i,a,u],l]))))),([e,n])=>[KUn(e),n]),D$n=t=>ge(ge(HHs(t),([e,n])=>[e,n],()=>ge(VHs(t),([e,n])=>[e,n],()=>ge(jHs(t),([e,n])=>[e,n],()=>ge(YHs(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),KHs=t=>ge(ge(ge(Ht("readonly",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[zUn(e),n]),zHs=t=>ge(ge(ge(Ht("?",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[JUn(e),n]),B$n=t=>ge(ge(KHs(t),([e,n])=>ge(D$n(n),([r,s])=>ge(zHs(s),([i,o])=>ge(Ht(":",o),([a,c])=>ge(Si(c),([u,l])=>[[e,r,i,a,u],l]))))),([e,n])=>[XUn(e),n]),P$n=t=>ge(ge(ge(Ht(",",t),([e,n])=>ge(Ht(` -`,n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge(ge(Ht(";",t),([e,n])=>ge(Ht(` -`,n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge(ge(Ht(",",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge(ge(Ht(";",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge(ge(Ht(` -`,t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[]))))),([e,n])=>[e,n]),O$n=(t,e=[])=>ge(ge(B$n(t),([n,r])=>ge(P$n(r),([s,i])=>[[n,s],i])),([n,r])=>O$n(r,[...e,n]),()=>[e,t]),JHs=t=>ge(ge(O$n(t),([e,n])=>ge(ge(ge(B$n(n),([r,s])=>[[r],s]),([r,s])=>[r,s],()=>ge([[],n],([r,s])=>[r,s],()=>[])),([r,s])=>[[e,r],s])),([e,n])=>[ZUn(e),n]),rct=t=>ge(ge(Ht("{",t),([e,n])=>ge(JHs(n),([r,s])=>ge(Ht("}",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[t2n(e),n]),XHs=t=>ge(rct(t),([e,n])=>[n2n(e),n]),ZHs=t=>ge(ge(ge(Kc(t),([e,n])=>ge(Ht("?",n),([r,s])=>ge(Ht(":",s),([i,o])=>ge(Ht("readonly",o),([a,c])=>ge(Si(c),([u,l])=>[[e,r,i,a,u],l]))))),([e,n])=>[e,n],()=>ge(ge(Kc(t),([e,n])=>ge(Ht(":",n),([r,s])=>ge(Ht("readonly",s),([i,o])=>ge(Si(o),([a,c])=>[[e,r,i,a],c])))),([e,n])=>[e,n],()=>ge(ge(Kc(t),([e,n])=>ge(Ht("?",n),([r,s])=>ge(Ht(":",s),([i,o])=>ge(Si(o),([a,c])=>[[e,r,i,a],c])))),([e,n])=>[e,n],()=>ge(ge(Kc(t),([e,n])=>ge(Ht(":",n),([r,s])=>ge(Si(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[e,n],()=>[])))),([e,n])=>[r2n(e),n]),e5s=t=>ge(ge(Ht("readonly",t),([e,n])=>ge(Si(n),([r,s])=>ge(Ht("?",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[s2n(e),n]),t5s=t=>ge(ge(Ht("readonly",t),([e,n])=>ge(Si(n),([r,s])=>[[e,r],s])),([e,n])=>[i2n(e),n]),n5s=t=>ge(ge(Si(t),([e,n])=>ge(Ht("?",n),([r,s])=>[[e,r],s])),([e,n])=>[o2n(e),n]),g$n=t=>ge(ge(ZHs(t),([e,n])=>[e,n],()=>ge(e5s(t),([e,n])=>[e,n],()=>ge(t5s(t),([e,n])=>[e,n],()=>ge(n5s(t),([e,n])=>[e,n],()=>ge(Si(t),([e,n])=>[e,n],()=>[]))))),([e,n])=>[e,n]),M$n=t=>ge(ge(ge(Ht("...",t),([e,n])=>ge(g$n(n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge(ge(g$n(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[])),([e,n])=>[a2n(e),n]),L$n=(t,e=[])=>ge(ge(M$n(t),([n,r])=>ge(Ht(",",r),([s,i])=>[[n,s],i])),([n,r])=>L$n(r,[...e,n]),()=>[e,t]),r5s=t=>ge(ge(L$n(t),([e,n])=>ge(ge(ge(M$n(n),([r,s])=>[[r],s]),([r,s])=>[r,s],()=>ge([[],n],([r,s])=>[r,s],()=>[])),([r,s])=>[[e,r],s])),([e,n])=>[c2n(e),n]),s5s=t=>ge(ge(Ht("[",t),([e,n])=>ge(r5s(n),([r,s])=>ge(Ht("]",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[l2n(e),n]),i5s=t=>ge(ge(Kc(t),([e,n])=>ge(Ht("?",n),([r,s])=>ge(Ht(":",s),([i,o])=>ge(Ht("readonly",o),([a,c])=>ge(Si(c),([u,l])=>[[e,r,i,a,u],l]))))),([e,n])=>[u2n(e),n]),o5s=t=>ge(ge(Kc(t),([e,n])=>ge(Ht(":",n),([r,s])=>ge(Ht("readonly",s),([i,o])=>ge(Si(o),([a,c])=>[[e,r,i,a],c])))),([e,n])=>[d2n(e),n]),a5s=t=>ge(ge(Kc(t),([e,n])=>ge(Ht("?",n),([r,s])=>ge(Ht(":",s),([i,o])=>ge(Si(o),([a,c])=>[[e,r,i,a],c])))),([e,n])=>[p2n(e),n]),c5s=t=>ge(ge(Kc(t),([e,n])=>ge(Ht(":",n),([r,s])=>ge(Si(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[h2n(e),n]),A$n=t=>ge(ge(i5s(t),([e,n])=>[e,n],()=>ge(o5s(t),([e,n])=>[e,n],()=>ge(a5s(t),([e,n])=>[e,n],()=>ge(c5s(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),F$n=t=>ge(ge(ge(Ht("...",t),([e,n])=>ge(A$n(n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge(ge(A$n(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[])),([e,n])=>[m2n(e),n]),Q$n=(t,e=[])=>ge(ge(F$n(t),([n,r])=>ge(Ht(",",r),([s,i])=>[[n,s],i])),([n,r])=>Q$n(r,[...e,n]),()=>[e,t]),U$n=t=>ge(ge(Q$n(t),([e,n])=>ge(ge(ge(F$n(n),([r,s])=>[[r],s]),([r,s])=>[r,s],()=>ge([[],n],([r,s])=>[r,s],()=>[])),([r,s])=>[[e,r],s])),([e,n])=>[f2n(e),n]),l5s=t=>ge(ge(Ht("(",t),([e,n])=>ge(U$n(n),([r,s])=>ge(Ht(")",s),([i,o])=>ge(Ht("=>",o),([a,c])=>ge(Si(c),([u,l])=>[[e,r,i,a,u],l]))))),([e,n])=>[g2n(e),n]),u5s=t=>ge(ge(Ht("new",t),([e,n])=>ge(Ht("(",n),([r,s])=>ge(U$n(s),([i,o])=>ge(Ht(")",o),([a,c])=>ge(Ht("=>",c),([u,l])=>ge(Si(l),([d,h])=>[[e,r,i,a,u,d],h])))))),([e,n])=>[A2n(e),n]),d5s=t=>ge(ge(ge(Ht("+",t),([e,n])=>ge(Ht("readonly",n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge(ge(Ht("-",t),([e,n])=>ge(Ht("readonly",n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge(ge(Ht("readonly",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])))),([e,n])=>[y2n(e),n]),p5s=t=>ge(ge(ge(Ht("+",t),([e,n])=>ge(Ht("?",n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge(ge(Ht("-",t),([e,n])=>ge(Ht("?",n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge(ge(Ht("?",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])))),([e,n])=>[E2n(e),n]),h5s=t=>ge(ge(ge(Ht("as",t),([e,n])=>ge(Si(n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[b2n(e),n]),m5s=t=>ge(ge(Ht("{",t),([e,n])=>ge(d5s(n),([r,s])=>ge(Ht("[",s),([i,o])=>ge(Kc(o),([a,c])=>ge(Ht("in",c),([u,l])=>ge(Si(l),([d,h])=>ge(h5s(h),([m,f])=>ge(Ht("]",f),([g,A])=>ge(p5s(A),([y,b])=>ge(Ht(":",b),([S,C])=>ge(Si(C),([I,x])=>ge(_$n(x),([w,R])=>ge(Ht("}",R),([N,P])=>[[e,r,i,a,u,d,m,g,y,S,I,w,N],P]))))))))))))),([e,n])=>[_2n(e),n]),f5s=t=>ge(Kc(t),([e,n])=>[S2n(e),n]),g5s=t=>ge(Jat(t),([e,n])=>[C2n(e),n]),A5s=t=>ge(Ove(t),([e,n])=>[I2n(e),n]),y5s=t=>ge(ge(Ht("true",t),([e,n])=>[e,n],()=>ge(Ht("false",t),([e,n])=>[e,n],()=>[])),([e,n])=>[x2n(e),n]),E5s=t=>ge(Mve(['"',"'"],t),([e,n])=>[e,n]),b5s=t=>ge(Ht("null",t),([e,n])=>[w2n(e),n]),_5s=t=>ge(Ht("undefined",t),([e,n])=>[void 0,n]),$$n=t=>ge(ge(D$n(t),([e,n])=>ge(Ht(":",n),([r,s])=>ge(sct(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[T2n(e),n]),G$n=(t,e=[])=>ge(ge($$n(t),([n,r])=>ge(P$n(r),([s,i])=>[[n,s],i])),([n,r])=>G$n(r,[...e,n]),()=>[e,t]),S5s=t=>ge(ge(G$n(t),([e,n])=>ge(ge(ge($$n(n),([r,s])=>[[r],s]),([r,s])=>[r,s],()=>ge([[],n],([r,s])=>[r,s],()=>[])),([r,s])=>[[e,r],s])),([e,n])=>[v2n(e),n]),W$n=t=>ge(ge(Ht("{",t),([e,n])=>ge(S5s(n),([r,s])=>ge(Ht("}",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[R2n(e),n]),q$n=(t,e=[])=>ge(ge(sct(t),([n,r])=>ge(Ht(",",r),([s,i])=>[[n,s],i])),([n,r])=>q$n(r,[...e,n]),()=>[e,t]),C5s=t=>ge(ge(q$n(t),([e,n])=>ge(ge(ge(sct(n),([r,s])=>[[r],s]),([r,s])=>[r,s],()=>ge([[],n],([r,s])=>[r,s],()=>[])),([r,s])=>[[e,r],s])),([e,n])=>[k2n(e),n]),I5s=t=>ge(ge(Ht("[",t),([e,n])=>ge(C5s(n),([r,s])=>ge(Ht("]",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[N2n(e),n]),sct=t=>ge(ge(g5s(t),([e,n])=>[e,n],()=>ge(A5s(t),([e,n])=>[e,n],()=>ge(y5s(t),([e,n])=>[e,n],()=>ge(E5s(t),([e,n])=>[e,n],()=>ge(b5s(t),([e,n])=>[e,n],()=>ge(_5s(t),([e,n])=>[e,n],()=>ge(W$n(t),([e,n])=>[e,n],()=>ge(I5s(t),([e,n])=>[e,n],()=>[])))))))),([e,n])=>[e,n]),x5s=t=>ge(Ht("-?(?:0|[1-9][0-9]*)n",t),([e,n])=>[D2n(e),n]),w5s=t=>ge(Ht(".*",t),([e,n])=>[B2n(e),n]),T5s=t=>ge(Ht("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",t),([e,n])=>[P2n(e),n]),v5s=t=>ge(Ht("-?(?:0|[1-9][0-9]*)",t),([e,n])=>[O2n(e),n]),R5s=t=>ge(Ht("(?!)",t),([e,n])=>[M2n(e),n]),k5s=t=>ge(f$n(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],t),([e,n])=>[L2n(e),n]),N5s=t=>ge(ge(x5s(t),([e,n])=>[e,n],()=>ge(w5s(t),([e,n])=>[e,n],()=>ge(T5s(t),([e,n])=>[e,n],()=>ge(v5s(t),([e,n])=>[e,n],()=>ge(R5s(t),([e,n])=>[e,n],()=>ge(D5s(t),([e,n])=>[e,n],()=>ge(k5s(t),([e,n])=>[e,n],()=>[]))))))),([e,n])=>[e,n]),D5s=t=>ge(ge(Ht("(",t),([e,n])=>ge(ict(n),([r,s])=>ge(Ht(")",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[F2n(e),n]),H$n=t=>ge(ge(ge(ect(t),([e,n])=>ge(Ht("|",n),([r,s])=>ge(H$n(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[e,n],()=>ge(ge(ect(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[]))),([e,n])=>[Q2n(e),n]),ect=t=>ge(ge(N5s(t),([e,n])=>ge(ict(n),([r,s])=>[[e,r],s])),([e,n])=>[U2n(e),n]),ict=t=>ge(ge(H$n(t),([e,n])=>[e,n],()=>ge(ect(t),([e,n])=>[e,n],()=>[])),([e,n])=>[e,n]),EQn=t=>ge(ge(Ht("^",t),([e,n])=>ge(ict(n),([r,s])=>ge(Ht("$",s),([i,o])=>[[e,r,i],o]))),([e,n])=>[$2n(e),n]),V$n=(t,e=[])=>ge(ge(Si(t),([n,r])=>ge(Ht(",",r),([s,i])=>[[n,s],i])),([n,r])=>V$n(r,[...e,n]),()=>[e,t]),B5s=t=>ge(ge(V$n(t),([e,n])=>ge(ge(ge(Si(n),([r,s])=>[[r],s]),([r,s])=>[r,s],()=>ge([[],n],([r,s])=>[r,s],()=>[])),([r,s])=>[[e,r],s])),([e,n])=>[G2n(e),n]),j$n=t=>ge(ge(ge(Ht("extends",t),([e,n])=>ge(B5s(n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[W2n(e),n]),P5s=t=>ge(ge(Ht("interface",t),([e,n])=>ge(Kc(n),([r,s])=>ge(tct(s),([i,o])=>ge(j$n(o),([a,c])=>ge(rct(c),([u,l])=>[[e,r,i,a,u],l]))))),([e,n])=>[q2n(e),n]),O5s=t=>ge(ge(Ht("interface",t),([e,n])=>ge(Kc(n),([r,s])=>ge(j$n(s),([i,o])=>ge(rct(o),([a,c])=>[[e,r,i,a],c])))),([e,n])=>[H2n(e),n]),M5s=t=>ge(ge(Ht("type",t),([e,n])=>ge(Kc(n),([r,s])=>ge(tct(s),([i,o])=>ge(Ht("=",o),([a,c])=>ge(Si(c),([u,l])=>[[e,r,i,a,u],l]))))),([e,n])=>[V2n(e),n]),L5s=t=>ge(ge(Ht("type",t),([e,n])=>ge(Kc(n),([r,s])=>ge(Ht("=",s),([i,o])=>ge(Si(o),([a,c])=>[[e,r,i,a],c])))),([e,n])=>[j2n(e),n]),F5s=t=>ge(ge(ge(Ht("export",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Y2n(e),n]),Q5s=t=>ge(ge(ge(Ht(";",t),([e,n])=>ge(Ht(` -`,n),([r,s])=>[[e,r],s])),([e,n])=>[e,n],()=>ge(ge(Ht(";",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>ge(ge(Ht(` -`,t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[]))),([e,n])=>[e,n]),Y$n=(t,e=[])=>ge(ge(oct(t),([n,r])=>ge(Q5s(r),([s,i])=>[[n,s],i])),([n,r])=>Y$n(r,[...e,n]),()=>[e,t]),U5s=t=>ge(ge(Y$n(t),([e,n])=>ge(ge(ge(oct(n),([r,s])=>[[r],s]),([r,s])=>[r,s],()=>ge([[],n],([r,s])=>[r,s],()=>[])),([r,s])=>[[e,r],s])),([e,n])=>[K2n(e),n]),oct=t=>ge(ge(F5s(t),([e,n])=>ge(ge(P5s(n),([r,s])=>[r,s],()=>ge(O5s(n),([r,s])=>[r,s],()=>ge(M5s(n),([r,s])=>[r,s],()=>ge(L5s(n),([r,s])=>[r,s],()=>[])))),([r,s])=>ge(_$n(s),([i,o])=>[[e,r,i],o]))),([e,n])=>[z2n(e),n]),$5s=t=>ge(ge(oct(t),([e,n])=>ge(U5s(n),([r,s])=>[[e,r],s])),([e,n])=>[J2n(e),n]),K$n=t=>ge(ge($5s(t),([e,n])=>[e,n],()=>ge(WHs(t),([e,n])=>[e,n],()=>ge(Si(t),([e,n])=>[e,n],()=>[]))),([e,n])=>[e,n]);function z$n(t){let e=nct(`\`${t}\``);return Ue.IsEqual(e.length,2)?e[0]:Sl()}p();p();function W5s(t){return t.join("|")}function q5s(t){return t.slice(1,t.length-1)}function H5s(t,e,n){return g1(e,`${n}${t}`)}function V5s(t,e){return g1(t,`${e}${hQn}`)}function j5s(t,e){return g1(t,`${e}${JTe}`)}function Y5s(t,e){return g1(t,`${e}${ZTe}`)}function K5s(t,e){return nre(gi([vi("false"),vi("true")]),t,e)}function z5s(t,e){return g1(t,`${e}${eve}`)}function J5s(t,e,n){return g1(e,`${n}${q5s(t)}`)}function X5s(t,e,n){let r=rre(t,{});return nre(r,e,n)}function Z5s(t,e,n){let r=Sy(t);return nre(r,e,n)}function J$n(t,e,n,r=[]){return Ue.ShiftLeft(t,(s,i)=>J$n(i,e,n,[...r,nre(s,[],"")]),()=>g1(e,`${n}(${W5s(r)})`))}function nre(t,e,n){return Zh(t)?Z5s(t.enum,e,n):em(t)?j5s(e,n):yo(t)?H5s(t.const,e,n):$I(t)?V5s(e,n):yb(t)?K5s(e,n):Zl(t)?Y5s(e,n):tm(t)?z5s(e,n):eu(t)?J5s(t.pattern,e,n):Z$n(t)?X5s(t.parameters[0],e,n):Er(t)?J$n(t.anyOf,e,n):YFn}function g1(t,e){return Ue.ShiftLeft(t,(n,r)=>nre(n,r,e),()=>e)}function e4s(t){return`^${g1(t,"")}$`}function X$n(t){let e=e4s(t);return nve(e)}function rre(t,e){return Js(t)?St.Update(X$n(t),{},e):dve(t,e)}function eGn(t,e,n,r){let s=Cy(t,e,n);return rre(s,r)}function dve(t,e={}){return br("TemplateLiteral",[t],e)}function Z$n(t){return yu(t)&&Ue.HasPropertyKey(t,"action")&&Ue.IsEqual(t.action,"TemplateLiteral")}function tGn(t){return rre(t,{})}function t4s(t){let e=z$n(t);return tGn(e)}function nGn(t,e={}){let n=Ue.IsString(t)?t4s(t):tGn(t);return St.Update(n,{},e)}function eu(t){return ur(t,"TemplateLiteral")}var gs={};Ir(gs,{ExtendsFalse:()=>Ls,ExtendsTrue:()=>Xn,ExtendsUnion:()=>act,IsExtendsFalse:()=>n4s,IsExtendsTrue:()=>sGn,IsExtendsTrueLike:()=>qV,IsExtendsUnion:()=>rGn,Match:()=>Qa});p();function act(t){return St.Create({"~kind":"ExtendsUnion"},{inferred:t})}function rGn(t){return Ue.IsObject(t)&&Ue.HasPropertyKey(t,"~kind")&&Ue.HasPropertyKey(t,"inferred")&&Ue.IsEqual(t["~kind"],"ExtendsUnion")&&Ue.IsObject(t.inferred)}function Xn(t){return St.Create({"~kind":"ExtendsTrue"},{inferred:t})}function sGn(t){return Ue.IsObject(t)&&Ue.HasPropertyKey(t,"~kind")&&Ue.HasPropertyKey(t,"inferred")&&Ue.IsEqual(t["~kind"],"ExtendsTrue")&&Ue.IsObject(t.inferred)}function Ls(){return St.Create({"~kind":"ExtendsFalse"},{})}function n4s(t){return Ue.IsObject(t)&&Ue.HasPropertyKey(t,"~kind")&&Ue.IsEqual(t["~kind"],"ExtendsFalse")}function qV(t){return rGn(t)||sGn(t)}function Qa(t,e,n){return qV(t)?e(t.inferred):n()}function r4s(t,e,n,r){return Qa(Ui(t,n,r),s=>Xn(St.Assign(St.Assign(t,s),{[e]:n})),()=>Ls())}function s4s(t,e){return Xn(t)}function i4s(t,e,n,r,s){return Qa(Ui(t,e,n),i=>Qa(Ui(i,e,r),o=>Xn(o),()=>Ls()),()=>Qa(Ui(t,e,s),i=>Xn(i),()=>Ls()))}function o4s(t,e,n){let r=Sy(n);return Ui(t,e,r)}function iGn(t,e,n){return Ue.ShiftLeft(n,(r,s)=>Qa(Ui(t,e,r),i=>iGn(i,e,s),()=>Ls()),()=>Xn(t))}function a4s(t,e,n){let r=pf(n);return Ui(t,e,r)}function oGn(t,e,n){return Ue.ShiftLeft(n,(r,s)=>Qa(Ui(t,e,r),i=>Xn(i),()=>oGn(t,e,s)),()=>Ls())}function Eo(t,e,n){return Xl(n)?s4s(t,e):Yc(n)?i4s(t,e,n.if,n.then,n.else):Zh(n)?o4s(t,e,n.enum):_l(n)?r4s(t,n.name,e,n.extends):Ti(n)?iGn(t,e,n.allOf):eu(n)?a4s(t,e,n.pattern):Er(n)?oGn(t,e,n.anyOf):Eu(n)?Xn(t):Ls()}function aGn(t,e,n){return _l(n)?Eo(t,e,n):Xl(n)?Xn(t):Eu(n)?Xn(t):act(t)}p();function c4s(t,e){let n=eQ(t),r=eQ(e);return n&&r||!n&&r?!0:!(n&&!r)}function cGn(t,e,n,r){return cc(r)?c4s(e,r)?Ui(t,n,r.items):Ls():Eo(t,e,r)}p();function lGn(t,e,n){return $I(n)?Xn(t):Eo(t,e,n)}p();function uGn(t,e,n){return yb(n)?Xn(t):Eo(t,e,n)}p();p();function l4s(t,e,n,r,s){let i=_l(r)?e:r,o=_l(r)?r:e,a=lh(e),c=lh(r);return!a&&c?Ls():Qa(Ui(t,i,o),u=>sre(u,n,s),()=>Ls())}function u4s(t,e,n,r){return Ue.ShiftLeft(r,(s,i)=>l4s(t,e,n,s,i),()=>lh(e)?Xn(t):Ls())}function d4s(t,e,n){return Ue.ShiftLeft(e,(r,s)=>u4s(t,r,s,n),()=>Xn(t))}function sre(t,e,n){return d4s(t,e,n)}p();function Fve(t,e,n){return GI(n)?Xn(t):Ui(t,e,n)}function dGn(t,e,n,r){return Xl(r)?Xn(t):Eu(r)?Xn(t):Xu(r)?Qa(sre(t,e,r.parameters),s=>Fve(s,n,r.instanceType),()=>Ls()):Ls()}p();function pGn(t,e,n,r,s){return Qa(Ui(t,e,s),()=>Ui(t,n,s),()=>Ui(t,r,s))}p();function hGn(t,e,n){let r=Sy(e);return Ui(t,r,n)}p();function mGn(t,e,n,r){return Xl(r)?Xn(t):Eu(r)?Xn(t):Zu(r)?Qa(sre(t,e,r.parameters),s=>Fve(s,n,r.returnType),()=>Ls()):Ls()}p();function fGn(t,e,n){return em(n)?Xn(t):Zl(n)?Xn(t):Eo(t,e,n)}p();function gGn(t,e,n){let r=wc(e);return Ui(t,r,n)}p();function Qve(t,e,n){return e===n?Xn(t):Ls()}function p4s(t,e,n){return yo(n)?Qve(t,e,n.const):$I(n)?Xn(t):Eo(t,vi(e),n)}function h4s(t,e,n){return yo(n)?Qve(t,e,n.const):yb(n)?Xn(t):Eo(t,vi(e),n)}function m4s(t,e,n){return yo(n)?Qve(t,e,n.const):Zl(n)?Xn(t):Eo(t,vi(e),n)}function f4s(t,e,n){return yo(n)?Qve(t,e,n.const):tm(n)?Xn(t):Eo(t,vi(e),n)}function AGn(t,e,n){return Ue.IsBigInt(e.const)?p4s(t,e.const,n):Ue.IsBoolean(e.const)?h4s(t,e.const,n):Ue.IsNumber(e.const)?m4s(t,e.const,n):Ue.IsString(e.const)?f4s(t,e.const,n):Sl()}p();function yGn(t,e,n){return _l(n)?Eo(t,e,n):Xn(t)}p();function EGn(t,e,n){return PV(n)?Xn(t):Eo(t,e,n)}p();function bGn(t,e,n){return Zl(n)?Xn(t):Eo(t,e,n)}p();function g4s(t,e,n){return lh(e)?lh(n)?Xn(t):Ls():Xn(t)}function A4s(t,e,n){return _l(n)&&l1(n.extends)?Ls():Qa(Ui(t,e,n),r=>g4s(r,e,n),()=>Ls())}function y4s(t,e){return t.reduce((n,r)=>r in e?qV(e[r])?{...n,...e[r].inferred}:Sl():Sl(),{})}function E4s(t,e,n){let r={};for(let o of Ue.Keys(n))r[o]=o in e?A4s({},e[o],n[o]):lh(n[o])?_l(n[o])?Xn(St.Assign(t,{[n[o].name]:n[o].extends})):Xn(t):Ls();let s=Ue.Values(r).every(o=>qV(o)),i=s?y4s(Ue.Keys(r),r):{};return s?Xn(i):Ls()}function b4s(t,e,n){let r=E4s(t,e,n);return qV(r)?Xn(St.Assign(t,r.inferred)):Ls()}function _4s(t,e,n){return b4s(t,e,n)}function S4s(t,e){return Ue.Keys(e).reduce((n,r)=>({...n,[r]:Ue.HasPropertyKey(t,r)?Er(n[r])?gi([...n[r].anyOf,e[r]]):gi([t[r],e[r]]):e[r]}),t)}function _Gn(t,e,n,r){return Ue.ShiftLeft(e,(s,i)=>Qa(Ui({},t[s],n),o=>_Gn(t,i,n,S4s(r,o)),()=>Ls()),()=>Xn(r))}function C4s(t,e,n,r){let s=Ue.Keys(e);return _Gn(e,s,r,t)}function SGn(t,e,n){return gp(n)?C4s(t,e,_b(n),nm(n)):co(n)?_4s(t,e,n.properties):Eo(t,vs(e),n)}p();function I4s(t,e){return Ue.IsEqual(Ue.Keys(e).length,0)?Xn(t):Ls()}function x4s(t,e,n,r,s){return Ui(t,n,s)}function CGn(t,e,n,r){return gp(r)?x4s(t,ave(e),n,ave(_b(r)),nm(r)):co(r)?I4s(t,r.properties):Xl(r)?Xn(t):Eu(r)?Xn(t):Ls()}p();function IGn(t,e,n){return tm(n)?Xn(t):Eo(t,e,n)}p();function xGn(t,e,n){return u1(n)?Xn(t):Eo(t,e,n)}p();function wGn(t,e,n){let r=pf(e);return Ui(t,r,n)}p();p();function cct(t,e){return St.Create({"~kind":"Inferrable"},{name:t,type:e},{})}function ire(t){return Ue.IsObject(t)&&Ue.HasPropertyKey(t,"~kind")&&Ue.HasPropertyKey(t,"name")&&Ue.HasPropertyKey(t,"type")&&Ue.IsEqual(t["~kind"],"Inferrable")&&Ue.IsString(t.name)&&Ue.IsObject(t.type)}function lct(t){return h1(t)?_l(t.items)?cc(t.items.extends)?cct(t.items.name,t.items.extends.items):Eu(t.items.extends)?cct(t.items.name,t.items.extends):void 0:Sl():void 0}function Uve(t){return _l(t)?cct(t.name,t.extends):void 0}function uct(t,e,n=[]){return Ue.ShiftLeft(t,(r,s)=>Qa(Ui({},r,e),()=>uct(s,e,[...n,r]),()=>{}),()=>n)}function TGn(t,e,n,r){let s=uct(n,r);return Ue.IsArray(s)?Xn(St.Assign(t,{[e]:tu(s)})):Ls()}function $ve(t,e,n,r){let s=uct(n,r);return Ue.IsArray(s)?Xn(St.Assign(t,{[e]:gi(s)})):Ls()}function w4s(t){return[...t].reverse()}function dct(t,e){return e?w4s(t):t}function T4s(t){let e=t.length>0?t[0]:void 0,n=yu(e)?lct(e):void 0;return yu(n)}function v4s(t,e,n,r,s,i){return Qa(Ui(t,n,s),o=>vGn(o,e,r,i),()=>Ls())}function R4s(t,e,n,r,s){let i=lct(r);return ire(i)?TGn(t,i.name,dct(n,e),i.type):Ue.ShiftLeft(n,(o,a)=>v4s(t,e,o,a,r,s),()=>Ls())}function k4s(t,e,n,r){return Ue.ShiftLeft(r,(s,i)=>R4s(t,e,n,s,i),()=>Ue.IsEqual(n.length,0)?Xn(t):Ls())}function vGn(t,e,n,r){return k4s(t,e,n,r)}function N4s(t,e,n){let r=A1(t,xa([],[]),n),s=T4s(r);return vGn(t,s,dct(e,s),dct(r,s))}function RGn(t,e,n){let r=Uve(n);return ire(r)?$ve(t,r.name,e,r.type):Ue.ShiftLeft(e,(s,i)=>Qa(Ui(t,s,n),o=>RGn(o,i,n),()=>Ls()),()=>Xn(t))}function kGn(t,e,n){let r=A1(t,xa([],[]),e);return ia(n)?N4s(t,r,n.items):cc(n)?RGn(t,r,n.items):Eo(t,tu(r),n)}p();function NGn(t,e,n){return GI(n)?Xn(t):UV(n)?Xn(t):Eo(t,e,n)}p();function DGn(t,e,n){return Ue.ShiftLeft(n,(r,s)=>Qa(Ui(t,e,r),i=>Xn(i),()=>DGn(t,e,s)),()=>Ls())}function pct(t,e,n){return Ue.ShiftLeft(e,(r,s)=>Qa(DGn(t,r,n),i=>pct(i,s,n),()=>Ls()),()=>Xn(t))}function BGn(t,e,n){let r=Uve(n);return ire(r)?$ve(t,r.name,e,r.type):Er(n)?pct(t,e,n.anyOf):pct(t,e,[n])}p();function PGn(t,e,n){return _l(n)?Eo(t,e,n):Xl(n)?Xn(t):Eu(n)?Xn(t):Ls()}p();function OGn(t,e,n){return GI(n)?Xn(t):Eo(t,e,n)}function Ui(t,e,n){return Xl(e)?aGn(t,e,n):cc(e)?cGn(t,e,e.items,n):$I(e)?lGn(t,e,n):yb(e)?uGn(t,e,n):Xu(e)?dGn(t,e.parameters,e.instanceType,n):Yc(e)?pGn(t,e.if,e.then,e.else,n):Zh(e)?hGn(t,e.enum,n):Zu(e)?mGn(t,e.parameters,e.returnType,n):em(e)?fGn(t,e,n):Ti(e)?gGn(t,e.allOf,n):yo(e)?AGn(t,e,n):l1(e)?yGn(t,e,n):PV(e)?EGn(t,e,n):Zl(e)?bGn(t,e,n):co(e)?SGn(t,e.properties,n):gp(e)?CGn(t,_b(e),nm(e),n):tm(e)?IGn(t,e,n):u1(e)?xGn(t,e,n):eu(e)?wGn(t,e.pattern,n):ia(e)?kGn(t,e.items,n):UV(e)?NGn(t,e,n):Er(e)?BGn(t,e.anyOf,n):Eu(e)?PGn(t,e,n):GI(e)?OGn(t,e,n):Ls()}p();p();p();p();p();function D4s(t,e){return wc([...t,vs(e)])}function hct(t,e,n){return Js(t)?St.Update(D4s(t,e),{},n):Jne(t,e,n)}function MGn(t,e,n,r,s){let i=Cy(t,e,n),o=ore(t,e,r);return hct(i,o,s)}function Jne(t,e,n={}){return br("Interface",[t,e],n)}function HV(t){return yu(t)&&Ue.HasPropertyKey(t,"action")&&Ue.IsEqual(t.action,"Interface")}function LGn(t,e,n={}){return hct(t,e,n)}function B4s(t,e,n){return t.includes(n)?!0:are([...t,n],e,e[n])}function FGn(t,e,n){let r=VTe(n);return aQ(t,e,r)}function aQ(t,e,n){return Ue.ShiftLeft(n,(r,s)=>are(t,e,r)?!0:aQ(t,e,s),()=>!1)}function are(t,e,n){return ed(n)?B4s(t,e,n.$ref):cc(n)?are(t,e,n.items):Xu(n)?aQ(t,e,[...n.parameters,n.instanceType]):Zu(n)?aQ(t,e,[...n.parameters,n.returnType]):HV(n)?FGn(t,e,n.parameters[1]):Ti(n)?aQ(t,e,n.allOf):co(n)?FGn(t,e,n.properties):Er(n)?aQ(t,e,n.anyOf):ia(n)?aQ(t,e,n.items):gp(n)?are(t,e,nm(n)):!1}function QGn(t,e,n){return are(t,e,n)}function P4s(t,e){return e.reduce((n,r)=>QGn([r],t,t[r])?[...n,r]:n,[])}function UGn(t){let e=HTe(t);return P4s(t,e)}p();function O4s(t,e,n){return n.includes(e)?n:e in t?cre(t,t[e],[...n,e]):Sl()}function $Gn(t,e,n){let r=VTe(e);return VV(t,r,n)}function VV(t,e,n){return e.reduce((r,s)=>cre(t,s,r),n)}function cre(t,e,n){return ed(e)?O4s(t,e.$ref,n):cc(e)?cre(t,e.items,n):Xu(e)?VV(t,[...e.parameters,e.instanceType],n):Zu(e)?VV(t,[...e.parameters,e.returnType],n):HV(e)?$Gn(t,e.parameters[1],n):Ti(e)?VV(t,e.allOf,n):co(e)?$Gn(t,e.properties,n):Er(e)?VV(t,e.anyOf,n):ia(e)?VV(t,e.items,n):gp(e)?cre(t,nm(e),n):n}function GGn(t,e,n){return cre(t,n,[e])}p();function M4s(t){return NV()}function L4s(t){return Ue.Keys(t).reduce((e,n)=>({...e,[n]:cQ(t[n])}),{})}function lre(t){return t.reduce((e,n)=>[...e,cQ(n)],[])}function cQ(t){return ed(t)?M4s(t.$ref):cc(t)?_y(cQ(t.items),qTe(t)):Xu(t)?OI(lre(t.parameters),cQ(t.instanceType)):Zu(t)?MI(lre(t.parameters),cQ(t.returnType)):Ti(t)?uh(lre(t.allOf)):co(t)?vs(L4s(t.properties)):gp(t)?ove(FV(t),cQ(nm(t))):Er(t)?gi(lre(t.anyOf)):ia(t)?tu(lre(t.items)):t}function F4s(t,e){return e in t?cQ(t[e]):xd()}function WGn(t){return F4s(t.$defs,t.$ref)}p();function Q4s(t,e,n){let r=Cy(t,xa([],[]),e),s=ore({},xa([],[]),n);return wc([...r,vs(s)])}function U4s(t,e){return Ue.Keys(t).filter(r=>e.includes(r)).reduce((r,s)=>{let i=t[s],o=HV(i)?Q4s(t,i.parameters[0],i.parameters[1]):i;return{...r,[s]:o}},{})}function qGn(t,e,n){let r=GGn(t,e,n),s=U4s(t,r);return FI(s,e)}p();function HGn(t,e){return e in t?ed(t[e])?HGn(t,t[e].$ref):t[e]:Uo()}function WI(t,e){return HGn(t,e)}function VGn(t){return mp(t)?WGn(t):jTe(t)?xd():t}function fp(t,e,n){let r=VGn(e),s=VGn(n);return Ui(t,r,s)}var Hne="equal",$4s="disjoint",Vne="left-inside",jne="right-inside";function MV(t,e){let n=[Eu(t)?gs.ExtendsFalse():fp({},t,e),Eu(t)?gs.ExtendsTrue({}):fp({},e,t)];return gs.IsExtendsTrueLike(n[0])&&gs.IsExtendsTrueLike(n[1])?Hne:gs.IsExtendsTrueLike(n[0])&&gs.IsExtendsFalse(n[1])?Vne:gs.IsExtendsFalse(n[0])&&gs.IsExtendsTrueLike(n[1])?jne:$4s}function G4s(t,e){return e.filter(n=>MV(t,n)!==jne)}function W4s(t,e){let n=e.some(r=>{let s=MV(t,r);return Ue.IsEqual(s,Vne)||Ue.IsEqual(s,Hne)});return Ue.IsEqual(n,!1)}function q4s(t,e){let n=bb(t);return Xl(n)?[n]:W4s(n,e)?[...G4s(n,e),n]:e}function H4s(t){return t.reduce((e,n)=>co(n)?[...e,n]:l1(n)?e:q4s(n,e),[])}function Hat(t){let e=H4s(t);return Kne(e)}p();function mct(t,e){return St.Update(bb(t),{},e)}function jGn(t,e,n,r){let s=wn(t,e,n);return mct(s,r)}p();function ure(t,e=[]){return a1(t)&&Ue.IsEqual(t.action,"Conditional")?ed(t.parameters[0])?ure(t.parameters[2],ure(t.parameters[3],[...e,t.parameters[0].$ref])):ure(t.parameters[2],ure(t.parameters[3],e)):a1(t)&&Ue.IsEqual(t.action,"Mapped")&&a1(t.parameters[1])&&Ue.IsEqual(t.parameters[1].action,"KeyOf")&&ed(t.parameters[1].parameters[0])?[...e,t.parameters[1].parameters[0].$ref]:e}function V4s(t,e){return t.reduce((n,r)=>[...n,e.includes(r.name)],[])}function zGn(t,e,n=[]){return Ue.ShiftLeft(t,(r,s)=>Ue.ShiftLeft(e,(i,o)=>zGn(s,o,[...n,[i,r]]),()=>n),()=>n)}function j4s(t){return Er(t)?[...t.anyOf]:[t]}function Y4s(t,e){return t.reduce((n,r)=>[...n,[...r,e]],[])}function YGn(t,e){return e.reduce((n,r)=>[...n,...Y4s(t,r)],[])}function KGn(t){return t.reduce((e,n)=>Ue.IsEqual(n[0],!0)?YGn(e,j4s(n[1])):YGn(e,[n[1]]),[[]])}function JGn(t,e,n){let r=ure(n),s=V4s(t,r),i=zGn(e,s);return a1(n)&&Ue.IsEqual(n.action,"Conditional")||a1(n)&&Ue.IsEqual(n.action,"Mapped")?KGn(i):[e]}p();function K4s(){return["(not-resolvable)",Uo()]}function z4s(){return["(not-generic)",Uo()]}function J4s(t,e,n){return[t,c1(e,n)]}function X4s(t,e,n){return e in t?XGn(t,e,t[e],n):K4s()}function XGn(t,e,n,r){return kV(n)?J4s(e,n.parameters,n.expression):ed(n)?X4s(t,n.$ref,r):z4s()}function ZGn(t,e,n){return XGn(t,"(anonymous)",e,n)}p();function Z4s(t,e,n){if(_l(e)||jV(e)||gs.IsExtendsTrueLike(fp({},e,n)))return;let r={parameter:t,expect:n,actual:e};throw new Error(`Argument for parameter ${t} does not satisfy constraint`,{cause:r})}function eWn(t,e,n,r,s){let i=wn(t,e,s);return Z4s(n,i,r),St.Assign(t,{[n]:i})}function eVs(t,e,n,r,s){let i=wn(t,e,n.extends),o=wn(t,e,n.equals);return Ue.ShiftLeft(s,(a,c)=>fct(eWn(t,e,n.name,i,a),e,r,c),()=>fct(eWn(t,e,n.name,i,o),e,r,[]))}function fct(t,e,n,r){return Ue.ShiftLeft(n,(s,i)=>eVs(t,e,s,i,r),()=>t)}function tWn(t,e,n,r){return fct(t,e,n,r)}function tVs(t){return Ue.IsGreaterThan(t.callstack.length,0)?t.callstack[t.callstack.length-1]:""}function nVs(t,e){return Ue.IsEqual(tVs(t),e)}function rVs(t,e,n,r,s,i){let o=tWn(t,e,r,i),a=wn(o,xa([...e.callstack,n.$ref],e.visited),s);return wn(o,xa([],[]),a)}function sVs(t,e,n,r,s,i){return i.reduce((o,a)=>[...o,rVs(t,e,n,r,s,a)],[])}function iVs(t,e,n,r,s,i){let o=JGn(r,i,s),a=sVs(t,e,n,r,s,o);return Ue.IsEqual(a.length,1)?a[0]:Sg(a)}function Gve(t,e,n,r){let s=Cy(t,e,r),i=ZGn(t,n,r),o=i[0],a=i[1];return kV(a)?nVs(e,o)?Xne(XT(o),s):iVs(t,e,XT(o),a.parameters,a.expression,s):Xne(n,s)}function Xne(t,e){return St.Create({"~kind":"Call"},{type:"call",target:t,arguments:e},{})}function nWn(t,e){return Gve({},xa([],[]),t,e)}function jV(t){return ur(t,"Call")}p();function oVs(t){return St.Discard(t,["~immutable"])}function rWn(t,e){return St.Update(oVs(t),{},e)}function sWn(t,e,n,r){let s=wn(t,e,n);return rWn(s,r)}p();p();p();p();function iWn(t,e){return t(e)}function oWn(t,e){return Ue.IsString(e)?vi(iWn(t,e)):vi(e)}p();function aWn(t,e){let n=pf(e);return tv(t,n)}p();function cWn(t,e){let n=e.map(r=>tv(t,r));return gi(n)}function tv(t,e){return yo(e)?oWn(t,e.const):eu(e)?aWn(t,e.pattern):Er(e)?cWn(t,e.anyOf):e}p();function pve(t,e={}){return br("Capitalize",[t],e)}function lWn(t,e={}){return gct(t,e)}p();function hve(t,e={}){return br("Lowercase",[t],e)}function uWn(t,e={}){return Act(t,e)}p();function mve(t,e={}){return br("Uncapitalize",[t],e)}function dWn(t,e={}){return yct(t,e)}p();function fve(t,e={}){return br("Uppercase",[t],e)}function pWn(t,e={}){return Ect(t,e)}var aVs=t=>t[0].toUpperCase()+t.slice(1),cVs=t=>t.toLowerCase(),lVs=t=>t[0].toLowerCase()+t.slice(1),uVs=t=>t.toUpperCase();function gct(t,e){return Js([t])?St.Update(tv(aVs,t),{},e):pve(t,e)}function Act(t,e){return Js([t])?St.Update(tv(cVs,t),{},e):hve(t,e)}function yct(t,e){return Js([t])?St.Update(tv(lVs,t),{},e):mve(t,e)}function Ect(t,e){return Js([t])?St.Update(tv(uVs,t),{},e):fve(t,e)}function hWn(t,e,n,r){let s=wn(t,e,n);return gct(s,r)}function mWn(t,e,n,r){let s=wn(t,e,n);return Act(s,r)}function fWn(t,e,n,r){let s=wn(t,e,n);return yct(s,r)}function gWn(t,e,n,r){let s=wn(t,e,n);return Ect(s,r)}p();p();p();function gve(t,e,n,r,s={}){return br("Conditional",[t,e,n,r],s)}function AWn(t,e,n,r,s={}){return bct({},xa([],[]),t,e,n,r,s)}function dVs(t,e,n,r,s,i){let o=fp(t,n,r);return gs.IsExtendsUnion(o)?gi([wn(o.inferred,e,s),wn(t,e,i)]):gs.IsExtendsTrue(o)?wn(o.inferred,e,s):wn(t,e,i)}function bct(t,e,n,r,s,i,o){return Js([n,r])?St.Update(dVs(t,e,n,r,s,i),{},o):gve(n,r,s,i,o)}function yWn(t,e,n,r,s,i,o){let a=wn(t,e,n),c=wn(t,e,r);return bct(t,e,a,c,s,i,o)}p();p();function Ave(t,e={}){return br("ConstructorParameters",[t],e)}function EWn(t,e={}){return _ct(t,e)}function pVs(t){let e=Xu(t)?t.parameters:[],n=A1({},xa([],[]),e);return tu(n)}function _ct(t,e){return Js([t])?St.Update(pVs(t),{},e):Ave(t,e)}function bWn(t,e,n,r){let s=wn(t,e,n);return _ct(s,r)}p();p();function yve(t,e,n={}){return br("Exclude",[t,e],n)}function _Wn(t,e,n={}){return dre(t,e,n)}function dre(t,e,n){return Js([t,e])?St.Update(sve(t,e),{},n):yve(t,e,n)}function SWn(t,e,n,r,s){let i=wn(t,e,n),o=wn(t,e,r);return dre(i,o,s)}p();p();function Eve(t,e,n={}){return br("Extract",[t,e],n)}function CWn(t,e,n={}){return Sct(t,e,n)}p();function hVs(t,e){let n=fp({},t,e);return gs.IsExtendsTrueLike(n)?[t]:[]}function mVs(t,e){return t.reduce((n,r)=>[...n,...hVs(r,e)],[])}function IWn(t,e){let n=bb(t),r=Er(n)?n.anyOf:[n],s=mVs(r,e);return Sg(s)}function Sct(t,e,n){return Js([t,e])?St.Update(IWn(t,e),{},n):Eve(t,e,n)}function xWn(t,e,n,r,s){let i=wn(t,e,n),o=wn(t,e,r);return Sct(i,o,s)}p();p();p();function fVs(t){return t.reduce((e,n)=>XTe(n)?[...e,vi(n)]:e,[])}function YV(t){let e=fVs(t);return gi(e)}function Zne(t,e,n={}){return br("Index",[t,e],n)}function wWn(t,e,n={}){let r=Ue.IsArray(e)?YV(e):e;return Cct(t,r,n)}p();p();p();p();function TWn(t,e){let n=WI(t,e);return Iy(n)}p();function vWn(t,e,n){let r=H0(t,e,n);return Iy(r)}p();function gVs(t,e){let n=Ue.Keys(t).filter(l=>!Ue.HasPropertyKey(e,l)),r=Ue.Keys(e).filter(l=>!Ue.HasPropertyKey(t,l)),s=Ue.Keys(t).filter(l=>Ue.HasPropertyKey(e,l)),i=n.reduce((l,d)=>({...l,[d]:t[d]}),{}),o=r.reduce((l,d)=>({...l,[d]:e[d]}),{}),a=s.reduce((l,d)=>({...l,[d]:wc([t[d],e[d]])}),{}),c=St.Assign(i,o);return St.Assign(c,a)}function RWn(t){return t.reduce((e,n)=>gVs(e,Iy(n)),{})}p();p();function kWn(t){let e=OQn(tu(t));return Iy(e)}p();function AVs(t,e){return Ue.Keys(t).filter(s=>s in e).reduce((s,i)=>({...s,[i]:Sg([t[i],e[i]])}),{})}function NWn(t,e){return Ue.ShiftLeft(t,(n,r)=>NWn(r,AVs(e,Iy(n))),()=>e)}function DWn(t){return Ue.ShiftLeft(t,(e,n)=>NWn(n,Iy(e)),()=>Sl())}function Iy(t){return mp(t)?TWn(t.$defs,t.$ref):Yc(t)?vWn(t.if,t.then,t.else):Ti(t)?RWn(t.allOf):Er(t)?DWn(t.anyOf):ia(t)?kWn(t.items):co(t)?t.properties:{}}function KV(t){let e=Iy(t);return vs(e)}p();p();p();var yVs=new RegExp("^(?:0|[1-9][0-9]*)$");function zV(t){let e=`${t}`;return yVs.test(e)?parseInt(e):t}function EVs(t){return vi(zV(t))}function BWn(t){return t.map(e=>PWn(e))}function PWn(t){return Ti(t)?uh(BWn(t.allOf)):Er(t)?gi(BWn(t.anyOf)):yo(t)?EVs(t.const):t}function OWn(t,e){let n=PWn(e),r=fp({},n,_g());return gs.IsExtendsTrueLike(r)?t:yo(e)&&Ue.IsEqual(e.const,"length")?_g():Uo()}p();p();p();p();function MWn(t,e){let n=WI(t,e);return Cg(n)}p();function LWn(t,e,n){let r=H0(t,e,n);return Cg(r)}p();function FWn(t){let e=Sy(t);return Cg(e)}p();function QWn(t){let e=wc(t);return Cg(e)}p();function UWn(t){return[`${t}`]}p();function $Wn(t){let e=pf(t);return Cg(e)}p();function GWn(t){return t.reduce((e,n)=>[...e,...Cg(n)],[])}function Cg(t){return mp(t)?MWn(t.$defs,t.$ref):Yc(t)?LWn(t.if,t.then,t.else):Zh(t)?FWn(t.enum):Ti(t)?QWn(t.allOf):yo(t)?UWn(t.const):eu(t)?$Wn(t.pattern):Er(t)?GWn(t.anyOf):[]}function JV(t){return Cg(t)}p();function pre(t,e){return e.map(n=>hre(t,n))}function hre(t,e){return cc(e)?_y(hre(t,e.items)):Xu(e)?OI(pre(t,e.parameters),hre(t,e.instanceType)):Zu(e)?MI(pre(t,e.parameters),hre(t,e.returnType)):ia(e)?tu(pre(t,e.items)):Er(e)?gi(pre(t,e.anyOf)):Ti(e)?uh(pre(t,e.allOf)):lve(e)?vs(t):e}function WWn(t,e){return hre(t,e)}function bVs(t,e){let n=e in t?t[e]:Uo();return WWn(t,n)}function qWn(t,e){return e.reduce((n,r)=>[...n,bVs(t,r)],[])}function _Vs(t,e){let n=JV(e),r=qWn(t,n);return Sg(r)}var SVs=new RegExp(p1);function CVs(t){return t.filter(n=>SVs.test(n))}function IVs(t){let e=HTe(t),n=CVs(e),r=qWn(t,n);return Sg(r)}function HWn(t,e){return Zl(e)?IVs(t):_Vs(t,e)}p();p();function xVs(t){return vi(zV(t))}function VWn(t){return t.map(e=>Ict(e))}function Ict(t){return Ti(t)?uh(VWn(t.allOf)):Er(t)?gi(VWn(t.anyOf)):yo(t)?xVs(t.const):t}function wVs(t,e){return t.reduceRight((n,r,s)=>{let i=fp({},vi(s),e);return gs.IsExtendsTrueLike(i)?[r,...n]:n},[])}function TVs(t,e){let n=Ict(e),r=wVs(t,n);return ZT(r)}function vVs(t){return ZT(t)}function jWn(t,e){return yo(e)&&Ue.IsEqual(e.const,"length")?vi(t.length):Zl(e)||em(e)?vVs(t):TVs(t,e)}function YWn(t,e){return cc(t)?OWn(t.items,e):co(t)?HWn(t.properties,e):ia(t)?jWn(t.items,e):Uo()}function RVs(t){return mp(t)||Yc(t)||Ti(t)||Er(t)?KV(t):t}function Cct(t,e,n){return Js([t,e])?St.Update(YWn(RVs(t),e),{},n):Zne(t,e,n)}function KWn(t,e,n,r,s){let i=wn(t,e,n),o=wn(t,e,r);return Cct(i,o,s)}p();p();function bve(t,e={}){return br("InstanceType",[t],e)}function zWn(t,e={}){return xct(t,e)}function kVs(t){return Xu(t)?t.instanceType:Uo()}function xct(t,e){return Js([t])?St.Update(kVs(t),{},e):bve(t,e)}function JWn(t,e,n,r={}){let s=wn(t,e,n);return xct(s,r)}p();p();function ere(t,e={}){return br("KeyOf",[t],e)}function XWn(t,e={}){return wct(t,e)}p();p();function ZWn(){return gi([_g(),Eb(),OV()])}p();function eqn(t){return _g()}p();function NVs(t){return t.reduce((n,r)=>XTe(r)?[...n,vi(zV(r))]:Sl(),[])}function tqn(t){let e=Ue.Keys(t),n=NVs(e);return ZT(n)}p();function nqn(t){return FV(t)}p();function rqn(t){let e=t.map((n,r)=>vi(r));return ZT(e)}function sqn(t){return Xl(t)?ZWn():cc(t)?eqn(t.items):co(t)?tqn(t.properties):gp(t)?nqn(t):ia(t)?rqn(t.items):Uo()}function DVs(t){return mp(t)||Yc(t)||Ti(t)||Er(t)?KV(t):t}function wct(t,e){return Js([t])?St.Update(sqn(DVs(t)),{},e):ere(t,e)}function iqn(t,e,n,r){let s=wn(t,e,n);return wct(s,r)}p();p();function zne(t,e,n,r,s={}){return br("Mapped",[t,e,n,r],s)}function oqn(t,e,n,r,s={}){return Tct({},xa([],[]),t,e,n,r,s)}p();p();function BVs(t){let e=pf(t);return Wve(e)}function PVs(t){return t.reduce((e,n)=>[...e,...Wve(n)],[])}function OVs(t){let e=Sy(t);return Wve(e)}function MVs(t){return Ue.IsNumber(t)?[vi(`${t}`)]:[vi(t)]}function Wve(t){return Zh(t)?OVs(t.enum):yo(t)?MVs(t.const):eu(t)?BVs(t.pattern):Er(t)?PVs(t.anyOf):[t]}function aqn(t){return Wve(t)}function LVs(t){return eu(t)?pf(t.pattern):t}function FVs(t,e,n,r,s,i){let o=St.Assign(t,{[n.name]:r}),a=wn(o,e,s),c=LVs(a),u=wn(o,e,i);return fQn(c)||gQn(c)?{[c.const]:u}:{}}function QVs(t,e,n,r,s,i){return r.reduce((o,a)=>[...o,FVs(t,e,n,a,s,i)],[])}function UVs(t){return t.reduce((e,n)=>[...e,vs(n)],[])}function cqn(t,e,n,r,s,i){let o=aqn(r),a=QVs(t,e,n,o,s,i),c=UVs(a);return wc(c)}function Tct(t,e,n,r,s,i,o){return Js([r])?St.Update(cqn(t,e,n,r,s,i),{},o):zne(n,r,s,i,o)}function lqn(t,e,n,r,s,i,o){let a=wn(t,e,r);return Tct(t,e,n,a,s,i,o)}p();function $Vs(t,e,n){let r=St.Assign(t,e);return Ue.Keys(e).filter(i=>n.includes(i)).reduce((i,o)=>({...i,[o]:qGn(r,o,e[o])}),{})}function GVs(t,e,n){let r=St.Assign(t,e);return Ue.Keys(e).filter(i=>!n.includes(i)).reduce((i,o)=>({...i,[o]:wn(r,xa([],[]),e[o])}),{})}function WVs(t,e,n){let r=UGn(e),s=$Vs(t,e,r),i=GVs(t,e,r),o={...s,...i};return St.Update(o,{},n)}function qve(t,e,n,r){return WVs(t,n,r)}p();p();function _ve(t,e={}){return br("NonNullable",[t],e)}function uqn(t,e={}){return vct(t,e)}function qVs(t){let e=gi([BV(),QV()]);return dre(t,e,{})}function vct(t,e){return Js([t])?St.Update(qVs(t),{},e):_ve(t,e)}function dqn(t,e,n,r){let s=wn(t,e,n);return vct(s,r)}p();p();function Sve(t,e,n={}){return br("Omit",[t,e],n)}function pqn(t,e,n={}){let r=Ue.IsArray(e)?YV(e):e;return Rct(t,r,n)}p();p();function Hve(t){let e=KV(t);return co(e)?e.properties:Sl()}function HVs(t,e){return Ue.Keys(t).reduce((r,s)=>e.includes(s)?r:{...r,[s]:t[s]},{})}function hqn(t,e){let n=Hve(t),r=JV(e),s=HVs(n,r);return vs(s)}function Rct(t,e,n){return Js([t,e])?St.Update(hqn(t,e),{},n):Sve(t,e,n)}function mqn(t,e,n,r,s){let i=wn(t,e,n),o=wn(t,e,r);return Rct(i,o,s)}p();p();function Cve(t,e={}){return br("Parameters",[t],e)}function fqn(t,e={}){return kct(t,e)}function VVs(t){let e=Zu(t)?t.parameters:[],n=A1({},xa([],[]),e);return tu(n)}function kct(t,e){return Js([t])?St.Update(VVs(t),{},e):Cve(t,e)}function gqn(t,e,n,r){let s=wn(t,e,n);return kct(s,r)}p();p();function Ive(t,e={}){return br("Partial",[t],e)}function Aqn(t,e={}){return Nct(t,e)}p();p();function yqn(t,e){let n=WI(t,e),r=qI(n);return FI(St.Assign(t,{[e]:r}),e)}p();function Eqn(t,e,n){let r=H0(t,e,n);return qI(r)}p();function bqn(t){let e=wc(t);return qI(e)}p();function _qn(t){let e=t.map(n=>qI(n));return gi(e)}p();function Sqn(t){let e=Ue.Keys(t).reduce((r,s)=>({...r,[s]:XF(t[s])}),{});return vs(e)}function qI(t){return mp(t)?yqn(t.$defs,t.$ref):Yc(t)?Eqn(t.if,t.then,t.else):Ti(t)?bqn(t.allOf):Er(t)?_qn(t.anyOf):co(t)?Sqn(t.properties):vs({})}function Nct(t,e){return Js([t])?St.Update(qI(t),{},e):Ive(t,e)}function Cqn(t,e,n,r){let s=wn(t,e,n);return Nct(s,r)}p();p();function xve(t,e,n={}){return br("Pick",[t,e],n)}function Iqn(t,e,n={}){let r=Ue.IsArray(e)?YV(e):e;return Dct(t,r,n)}p();function jVs(t,e){return Ue.Keys(t).reduce((r,s)=>e.includes(s)?St.Assign(r,{[s]:t[s]}):r,{})}function xqn(t,e){let n=Hve(t),r=JV(e),s=jVs(n,r);return vs(s)}function Dct(t,e,n){return Js([t,e])?St.Update(xqn(t,e),{},n):xve(t,e,n)}function wqn(t,e,n,r,s){let i=wn(t,e,n),o=wn(t,e,r);return Dct(i,o,s)}p();p();function wve(t,e={}){return br("ReadonlyObject",[t],e)}function Bct(t,e={}){return Pct(t,e)}var Tqn=Bct;p();p();function vqn(t){return DV(_y(t))}p();function Rqn(t,e){let n=WI(t,e),r=HI(n);return FI(St.Assign(t,{[e]:r}),e)}p();function kqn(t,e,n){let r=H0(t,e,n);return HI(r)}p();function Nqn(t){let e=wc(t);return HI(e)}p();function Dqn(t){let e=Ue.Keys(t).reduce((r,s)=>({...r,[s]:tQ(t[s])}),{});return vs(e)}p();function Bqn(t){return DV(tu(t))}p();function Pqn(t){let e=t.map(n=>HI(n));return gi(e)}function HI(t){return cc(t)?vqn(t.items):mp(t)?Rqn(t.$defs,t.$ref):Yc(t)?kqn(t.if,t.then,t.else):Ti(t)?Nqn(t.allOf):co(t)?Dqn(t.properties):ia(t)?Bqn(t.items):Er(t)?Pqn(t.anyOf):t}function Pct(t,e){return Js([t])?St.Update(HI(t),{},e):wve(t)}function Oqn(t,e,n,r){let s=wn(t,e,n);return Pct(s,r)}p();function Mqn(t,e,n,r){return e.visited.includes(r)?n:r in t?wn(t,xa(e.callstack,[...e.visited,r]),t[r]):n}p();p();p();function Lqn(t,e){let n=WI(t,e),r=VI(n);return FI(St.Assign(t,{[e]:r}),e)}p();function Fqn(t,e,n){let r=H0(t,e,n);return VI(r)}p();function Qqn(t){let e=wc(t);return VI(e)}p();function Uqn(t){let e=t.map(n=>VI(n));return gi(e)}p();function $qn(t){let e=Ue.Keys(t).reduce((r,s)=>({...r,[s]:rve(t[s])}),{});return vs(e)}function VI(t){return mp(t)?Lqn(t.$defs,t.$ref):Yc(t)?Fqn(t.if,t.then,t.else):Ti(t)?Qqn(t.allOf):Er(t)?Uqn(t.anyOf):co(t)?$qn(t.properties):vs({})}p();function Tve(t,e={}){return br("Required",[t],e)}function Gqn(t,e={}){return Oct(t,e)}function Oct(t,e){return Js([t])?St.Update(VI(t),{},e):Tve(t,e)}function Wqn(t,e,n,r){let s=wn(t,e,n);return Oct(s,r)}p();p();function vve(t,e={}){return br("ReturnType",[t],e)}function qqn(t,e={}){return Mct(t,e)}function YVs(t){return Zu(t)?t.returnType:Uo()}function Mct(t,e){return Js([t])?St.Update(YVs(t),{},e):vve(t,e)}function Hqn(t,e,n,r={}){let s=wn(t,e,n);return Mct(s,r)}p();p();function Rve(t,e){return br("With",[t,e],{})}function Vqn(t,e){return Lct(t,e)}function Lct(t,e){return Js([t])?St.Update(t,{},e):Rve(t,e)}function jqn(t,e,n,r){let s=wn(t,e,n);return Lct(s,r)}p();p();function KVs(t){return h1(t)?ia(t.items)?Fct(t.items.items):_l(t.items)?[t]:ed(t.items)?[t]:[Uo()]:[t]}function Fct(t){return t.reduce((n,r)=>[...n,...KVs(r)],[])}function xa(t,e){return{callstack:t,visited:e}}function Js(t){return Ue.ShiftLeft(t,(e,n)=>ed(e)?!1:Js(n),()=>!0)}function ore(t,e,n){return Ue.Keys(n).reduce((r,s)=>({...r,[s]:wn(t,e,n[s])}),{})}function A1(t,e,n){let r=Cy(t,e,n);return Fct(r)}function Cy(t,e,n){return n.map(r=>wn(t,e,r))}function zVs(t,e){let n=lh(t)?Fne(e,{}):e,r=nQ(t)?Lne(n,{}):n;return eQ(t)?mre(r,{}):r}function JVs(t,e,n,r,s){return Ue.IsEqual(n,"AddImmutable")?Yqn(t,e,r[0],s):Ue.IsEqual(n,"RemoveImmutable")?sWn(t,e,r[0],s):Ue.IsEqual(n,"AddReadonly")?qFn(t,e,r[0],s):Ue.IsEqual(n,"RemoveReadonly")?kQn(t,e,r[0],s):Ue.IsEqual(n,"AddOptional")?HFn(t,e,r[0],s):Ue.IsEqual(n,"RemoveOptional")?BQn(t,e,r[0],s):Ue.IsEqual(n,"Capitalize")?hWn(t,e,r[0],s):Ue.IsEqual(n,"Conditional")?yWn(t,e,r[0],r[1],r[2],r[3],s):Ue.IsEqual(n,"ConstructorParameters")?bWn(t,e,r[0],s):Ue.IsEqual(n,"Evaluate")?jGn(t,e,r[0],s):Ue.IsEqual(n,"Exclude")?SWn(t,e,r[0],r[1],s):Ue.IsEqual(n,"Extract")?xWn(t,e,r[0],r[1],s):Ue.IsEqual(n,"Index")?KWn(t,e,r[0],r[1],s):Ue.IsEqual(n,"InstanceType")?JWn(t,e,r[0],s):Ue.IsEqual(n,"Interface")?MGn(t,e,r[0],r[1],s):Ue.IsEqual(n,"KeyOf")?iqn(t,e,r[0],s):Ue.IsEqual(n,"Lowercase")?mWn(t,e,r[0],s):Ue.IsEqual(n,"Mapped")?lqn(t,e,r[0],r[1],r[2],r[3],s):Ue.IsEqual(n,"Module")?qve(t,e,r[0],s):Ue.IsEqual(n,"NonNullable")?dqn(t,e,r[0],s):Ue.IsEqual(n,"Pick")?wqn(t,e,r[0],r[1],s):Ue.IsEqual(n,"Parameters")?gqn(t,e,r[0],s):Ue.IsEqual(n,"Partial")?Cqn(t,e,r[0],s):Ue.IsEqual(n,"Omit")?mqn(t,e,r[0],r[1],s):Ue.IsEqual(n,"ReadonlyObject")?Oqn(t,e,r[0],s):Ue.IsEqual(n,"Record")?zQn(t,e,r[0],r[1],s):Ue.IsEqual(n,"Required")?Wqn(t,e,r[0],s):Ue.IsEqual(n,"ReturnType")?Hqn(t,e,r[0],s):Ue.IsEqual(n,"TemplateLiteral")?eGn(t,e,r[0],s):Ue.IsEqual(n,"Uncapitalize")?fWn(t,e,r[0],s):Ue.IsEqual(n,"Uppercase")?gWn(t,e,r[0],s):Ue.IsEqual(n,"With")?jqn(t,e,r[0],r[1]):br(n,r,s)}function XVs(t,e,n){let r=ed(n)?Mqn(t,e,n,n.$ref):cc(n)?_y(wn(t,e,n.items),qTe(n)):jV(n)?Gve(t,e,n.target,n.arguments):Xu(n)?OI(Cy(t,e,n.parameters),wn(t,e,n.instanceType),VFn(n)):Zu(n)?MI(Cy(t,e,n.parameters),wn(t,e,n.returnType),jFn(n)):Yc(n)?ZF(wn(t,e,n.if),wn(t,e,n.then),wn(t,e,n.else),ZFn(n)):Ti(n)?uh(Cy(t,e,n.allOf),sQn(n)):co(n)?vs(ore(t,e,n.properties),JFn(n)):gp(n)?JQn(_b(n),wn(t,e,nm(n))):h1(n)?iQ(wn(t,e,n.items)):ia(n)?tu(A1(t,e,n.items),RQn(n)):Er(n)?gi(Cy(t,e,n.anyOf),yQn(n)):n;return zVs(n,r)}function wn(t,e,n){return a1(n)?JVs(t,e,n.action,n.parameters,n.options):XVs(t,e,n)}function Qct(t,e){return wn(t,xa([],[]),e)}function ZVs(t){return St.Update(t,{"~immutable":!0},{})}function mre(t,e){return St.Update(ZVs(t),{},e)}function Yqn(t,e,n,r){let s=wn(t,e,n);return mre(s,r)}function X2n(t,e={}){return br("AddImmutable",[t],e)}function DV(t,e={}){return mre(t,e)}p();p();function Z2n(t,e={}){return br("Evaluate",[t],e)}function Kqn(t,e={}){return mct(t,e)}p();function e$n(t,e={}){return br("Module",[t],e)}function zqn(t,e={}){return qve({},xa([],[]),t,e)}p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function Jqn(...t){let[e,n,r]=QI.Match(t,{2:(o,a)=>Ue.IsString(o)?[{},o,a]:[o,a,{}],3:(o,a,c)=>[o,a,c],1:o=>[{},o,{}]}),s=K$n(n),i=Ue.IsArray(s)&&Ue.IsEqual(s.length,2)?wn(e,xa([],[]),s[0]):Uo();return St.Update(i,{},r)}var Ar={};Ir(Ar,{Any:()=>NV,Array:()=>_y,BigInt:()=>Gne,Boolean:()=>zTe,Call:()=>nWn,Capitalize:()=>lWn,Codec:()=>KTe,Conditional:()=>AWn,Constructor:()=>OI,ConstructorParameters:()=>EWn,Cyclic:()=>FI,Decode:()=>cQn,DecodeBuilder:()=>$ne,Dependent:()=>ZF,Encode:()=>lQn,EncodeBuilder:()=>Une,Enum:()=>rQn,Evaluate:()=>Kqn,Exclude:()=>_Wn,Extends:()=>fp,ExtendsResult:()=>gs,Extract:()=>CWn,Function:()=>MI,Generic:()=>c1,Identifier:()=>Wne,Immutable:()=>uQn,Index:()=>wWn,Infer:()=>Qne,InstanceType:()=>zWn,Instantiate:()=>Qct,Integer:()=>rQ,Interface:()=>LGn,Intersect:()=>uh,IsAny:()=>Xl,IsArray:()=>cc,IsBigInt:()=>$I,IsBoolean:()=>yb,IsCall:()=>jV,IsCodec:()=>YTe,IsConstructor:()=>Xu,IsCyclic:()=>mp,IsDependent:()=>Yc,IsEnum:()=>Zh,IsEnumValue:()=>nQn,IsFunction:()=>Zu,IsGeneric:()=>kV,IsIdentifier:()=>mQn,IsImmutable:()=>eQ,IsInfer:()=>_l,IsInteger:()=>em,IsIntersect:()=>Ti,IsKind:()=>ur,IsLiteral:()=>yo,IsNever:()=>l1,IsNull:()=>PV,IsNumber:()=>Zl,IsObject:()=>co,IsOptional:()=>lh,IsParameter:()=>AQn,IsReadonly:()=>nQ,IsRecord:()=>gp,IsRef:()=>ed,IsRefine:()=>Qat,IsRest:()=>h1,IsSchema:()=>yu,IsString:()=>tm,IsSymbol:()=>u1,IsTemplateLiteral:()=>eu,IsThis:()=>lve,IsTuple:()=>ia,IsUndefined:()=>UV,IsUnion:()=>Er,IsUnknown:()=>Eu,IsUnsafe:()=>jTe,IsVoid:()=>GI,KeyOf:()=>XWn,Literal:()=>vi,Lowercase:()=>uWn,Mapped:()=>oqn,Module:()=>zqn,Never:()=>Uo,NonNullable:()=>uqn,Null:()=>BV,Number:()=>_g,Object:()=>vs,Omit:()=>pqn,Optional:()=>KFn,Parameter:()=>sQ,Parameters:()=>fqn,Partial:()=>Aqn,Pick:()=>Iqn,Readonly:()=>dQn,ReadonlyObject:()=>Bct,ReadonlyType:()=>Tqn,Record:()=>ove,RecordKey:()=>FV,RecordPattern:()=>_b,RecordValue:()=>nm,Ref:()=>XT,Refine:()=>pQn,Required:()=>Gqn,Rest:()=>iQ,ReturnType:()=>qqn,Script:()=>Jqn,String:()=>Eb,Symbol:()=>OV,TemplateLiteral:()=>nGn,This:()=>cve,Tuple:()=>tu,Uncapitalize:()=>dWn,Undefined:()=>QV,Union:()=>gi,Unknown:()=>xd,Unsafe:()=>XFn,Uppercase:()=>pWn,Void:()=>uve,With:()=>Vqn});p();p();var Xqn="Pull request creation was cancelled",Uct="Thread retrieval was cancelled",Zqn="Pull request update was cancelled",e3n="PR diff retrieval was cancelled",t3n="Review creation was cancelled",n3n="CI status retrieval was cancelled",r3n="Workflow run logs retrieval was cancelled";p();function $i(t){return Ar.Union([t,Ar.Null()])}var Ig={type:"json_schema",strict:"prefer"};p();function Lo(t){return t!=null}function $ct(t,e){return{content:[{type:"text",text:t}],details:{...e,cancelled:!0}}}function rm(t){return async(e,n,r,s,i)=>{if(r?.aborted)return $ct(t.cancellationMessage,t.cancellationDetails);let o=t.prepareParams(n);return t.execute(o)}}var ejs=Ar.Object({title:Ar.String({description:RLn}),body:$i(Ar.String({description:kLn})),base:$i(Ar.String({description:NLn})),dryRun:$i(Ar.Boolean({description:DLn}))},{additionalProperties:!1});function Gct(t){return{name:"create_pull_request",label:"Create Pull Request",description:vLn(t.type),promptSnippet:wLn,promptGuidelines:TLn,parameters:ejs,constrainedSampling:Ig,execute:rm({cancellationMessage:Xqn,cancellationDetails:{pullRequestNumber:0,pullRequestUrl:"",headBranch:"",baseBranch:"",dryRun:!1},prepareParams:e=>{let{title:n,body:r,base:s,dryRun:i}=e,o={title:n};return Lo(r)&&(o.body=r),Lo(s)&&(o.base=s),Lo(i)&&(o.dryRun=i),o},execute:e=>t.createPullRequest(e)})}}p();p();function s3n(t){return[`${t.is_pull_request?"Pull Request":"Issue"} #${t.number}: ${t.title}`,"",`State: ${t.state.toUpperCase()}`,`Author: @${t.author}${t.author_type==="bot"?" (bot)":""}`]}function i3n(t){let e=[];return t.created_at&&e.push(`Created: ${qA.Instant.from(t.created_at).toString()}`),t.updated_at&&e.push(`Updated: ${qA.Instant.from(t.updated_at).toString()}`),t.closed_at&&e.push(`Closed: ${qA.Instant.from(t.closed_at).toString()}`),t.merged_at&&e.push(`Merged: ${qA.Instant.from(t.merged_at).toString()}`),e}function o3n(t){return t.labels.length===0?[]:[`Labels: ${t.labels.map(e=>`"${e}"`).join(", ")}`]}function a3n(t){return t.is_pull_request?[`Head Branch: ${t.head_branch??"unknown"}`,`Base Branch: ${t.base_branch??"unknown"}`,`Head SHA: ${t.head_sha??"unknown"}`]:[]}function c3n(t){return t.body?["","Description:",t.body,""]:[]}function l3n(t){let e=[`Comments (${t.length}):`];return t.forEach((n,r)=>{let s=n.is_triggering_comment?" [\u{1F4CD} triggering comment]":"";e.push(` ${r+1}. @${n.author}${n.author_type==="bot"?" (bot)":""}${s}`,` ${qA.Instant.from(n.created_at).toString()}`,` ${n.body}`)}),e}function u3n(t){if(!t||t.length===0)return[];let e=["",`Review Comments (${t.length}):`];return t.forEach((n,r)=>{let s=n.line!==null?` L${n.line}`:"",i=n.side==="LEFT"?" [old]":"";e.push(` ${r+1}. **${n.path}${s}${i}** (@${n.author}${n.author_type==="bot"?" (bot)":""}):`,` ${n.body}`)}),e}function Wct(t){return[...s3n(t),...i3n(t),...o3n(t),...a3n(t),"",...c3n(t),...l3n(t.comments),...u3n(t.is_pull_request?t.review_comments:void 0)].join(` -`)}var tjs=Ar.Object({owner:$i(Ar.String({description:MLn})),repo:$i(Ar.String({description:LLn})),issue_number:$i(Ar.Integer({description:FLn})),max_comments:$i(Ar.Integer({description:QLn}))},{additionalProperties:!1});function njs(){return{content:[{type:"text",text:"Issue or pull request not found"}],details:{number:0,title:"Not Found",body:"Issue or pull request not found",state:"closed",author:"unknown",author_type:"user",created_at:void 0,updated_at:void 0,closed_at:void 0,merged_at:void 0,labels:[],is_pull_request:!1,head_branch:void 0,base_branch:void 0,head_sha:void 0,comments:[],review_comments:[]}}}function qct(t){return{name:"get_issue_or_pr_thread",label:"Get Issue/PR Thread",description:OLn(t.type),promptSnippet:BLn(t.type),promptGuidelines:PLn(t.type),parameters:tjs,constrainedSampling:Ig,execute:rm({cancellationMessage:Uct,cancellationDetails:{number:0,title:"Cancelled",body:Uct,state:"closed",author:"unknown",author_type:"user",created_at:void 0,updated_at:void 0,closed_at:void 0,merged_at:void 0,labels:[],is_pull_request:!1,head_branch:void 0,base_branch:void 0,head_sha:void 0,comments:[],review_comments:[]},prepareParams:e=>({...Lo(e.owner)?{owner:e.owner}:{},...Lo(e.repo)?{repo:e.repo}:{},...Lo(e.issue_number)?{issue_number:e.issue_number}:{},...Lo(e.max_comments)?{max_comments:e.max_comments}:{}}),execute:async e=>{let n=await t.getIssueOrPRThread(e);return n?{content:[{type:"text",text:Wct(n)}],details:n}:njs()}})}}p();var rjs=Ar.Object({owner:$i(Ar.String({description:JLn})),repo:$i(Ar.String({description:XLn})),pull_number:$i(Ar.Integer({description:ZLn})),max_lines:$i(Ar.Integer({description:eFn})),ignore_files:$i(Ar.Array(Ar.String({description:Nat}),{description:Nat}))},{additionalProperties:!1});function sjs(t,e){let n=[...new Set([...t,...e])];return n.length>0?n:void 0}var ijs=t=>` -... (truncated at ${t} bytes)`;function ojs(t,e){if(Buffer.byteLength(t,"utf8")<=e)return{text:t,truncated:!1};let n=ijs(e),r=Buffer.byteLength(n,"utf8"),s=e-r,i=Buffer.from(t,"utf8"),o=Math.min(s,i.length);for(;o>0&&((i[o]??0)&192)===128;)o--;let a=i.subarray(0,o).toString("utf8"),c=a.lastIndexOf(` -`);return c>0&&(a=a.slice(0,c)),{text:a+n,truncated:!0}}function ajs(t,e){let n=t.split(` +`);return}}function bEs(t){let[e,...n]=t,r;if(e==="uninstall"?r="remove":(e==="install"||e==="remove"||e==="update"||e==="list")&&(r=e),!r)return;let i=!1,s=!1,o,a=!1,c,u,l,d,m,h=!1,f=!1,g=!1,A=!1,y;for(let S=0;Se.abort(),15e3);try{let i=await(await nf.create({authPath:(0,$d.join)(t,"auth.json"),modelsPath:(0,$d.join)(t,"models.json"),allowModelNetwork:!1,signal:e.signal})).refresh({allowNetwork:!0,force:!0,signal:e.signal});if(i.aborted)throw new Error("Model catalog refresh timed out.");if(i.errors.size>0){let s=Array.from(i.errors,([o,a])=>`${o}: ${a.message}`).join("; ");throw new Error(`Could not refresh model catalogs: ${s}`)}}finally{clearTimeout(n)}console.log(tn.green("Model catalogs refreshed"))}function CEs(t,e=ED){console.error(`error: ${hn} cannot self-update this installation.`),console.error(YRn(ED,t,e));let n=process.argv[1];n&&(console.error(""),console.error(`Location of ${hn} executable: ${n}`))}function IEs(t){console.error(tn.dim(`If this keeps failing, run this command yourself: ${t.display}`))}function wEs(){console.error(tn.yellow("If pnpm reports missing package versions, its cached registry metadata may be stale.")),console.error(tn.yellow(`Run \`pnpm store prune\` and retry \`${hn} update --self\`.`))}function Uor(t){let e=t.trim();if(e){console.log(),console.log(tn.bold(tn.yellow("Update note")));try{let n=Math.max(20,process.stdout.columns??80),r=new Pl(e,0,0,AEs).render(n).map(i=>i.trimEnd());console.log(r.join(` +`))}catch{console.log(e)}console.log()}}async function TEs(t){let e;try{e=await X0t(Nl,{retry:!0})}catch(i){throw new Error(`Could not determine latest ${hn} version: ${Dir(i)}`,{cause:i})}if(!e)throw new Error(`Could not determine latest ${hn} version.`);let n=e.packageName??ED,r=`${n}@${e.version}`;return t||n!==ED||J0t(e.version,Nl)?{packageName:n,installSpec:r,version:e.version,...e.note?{note:e.note}:{},shouldRun:!0}:(console.log(tn.green(`${hn} is already up to date (v${Nl})`)),{packageName:n,installSpec:r,version:e.version,shouldRun:!1})}async function vEs(t){console.log(tn.dim(`Updating ${hn} with ${t.display}...`));for(let e of t.steps??[t])await new Promise((n,r)=>{let i=k8(e.command,e.args,{stdio:"inherit"});i.on("error",s=>{r(s)}),i.on("close",(s,o)=>{s===0?n():r(o?new Error(`${e.display} terminated by signal ${o}`):new Error(`${e.display} exited with code ${s??"unknown"}`))})})}function REs(){if(process.platform!=="win32")return;let t=eu();YPe(t),Oor(t)}function kEs(){return process.stdin.isTTY&&process.stdout.isTTY?"interactive":"print"}function qor(t){for(let e of t)console.error(tn.yellow(`Warning: ${e}`))}async function jor(t){let e=lu.create(t.cwd,t.agentDir,{projectTrusted:!1}),n=[],r=new MS(t.agentDir);if(t.useSavedProjectTrustOnly){let a=r.get(t.cwd)===!0;return e.setProjectTrusted(t.projectTrustOverride??a),{settingsManager:e,projectTrustWarnings:n}}let i=kEs(),s=t.projectTrustOverride===void 0&&t_(t.cwd)?await new NS({cwd:t.cwd,agentDir:t.agentDir,settingsManager:e,extensionFactories:t.extensionFactories}).loadProjectTrustExtensions():void 0;for(let a of s?.errors??[])n.push(`Failed to load extension "${a.path}": ${a.error}`);let o=await iPe({cwd:t.cwd,trustStore:r,trustOverride:t.projectTrustOverride,defaultProjectTrust:e.getDefaultProjectTrust(),extensionsResult:s,projectTrustContext:nPe({cwd:t.cwd,mode:i,settingsManager:e,hasUI:i==="interactive"}),onExtensionError:a=>n.push(a)});return e.setProjectTrusted(o),{settingsManager:e,projectTrustWarnings:n}}async function Vor(t,e={}){let[n,...r]=t;if(n!=="config")return!1;if(r.includes("-h")||r.includes("--help"))return yEs(),!0;let i=!1,s;for(let h of r)if(h==="-l"||h==="--local")i=!0;else if(h==="-a"||h==="--approve")s=!0;else if(h==="-na"||h==="--no-approve")s=!1;else return h.startsWith("-")?(console.error(tn.red(`Unknown option ${h} for "config".`)),console.error(tn.dim(`Use "${hn} --help" or "${E_t}".`)),process.exitCode=1,!0):(console.error(tn.red(`Unexpected argument ${h}.`)),console.error(tn.dim(`Usage: ${E_t}`)),process.exitCode=1,!0);let o=process.cwd(),a=ii(),{settingsManager:c,projectTrustWarnings:u}=await jor({cwd:o,agentDir:a,projectTrustOverride:s,extensionFactories:e.extensionFactories});if(qor(u),i&&!c.isProjectTrusted())return console.error(tn.red("Project is not trusted. Use --approve to modify local resource config.")),process.exitCode=1,!0;Hor(c,"config command");let l=lu.create(o,a,{projectTrusted:!1}),d=await new rf({cwd:o,agentDir:a,settingsManager:l}).resolve(),m=c.isProjectTrusted()?await new rf({cwd:o,agentDir:a,settingsManager:c}).resolve():d;await Nor({resolvedPaths:{global:d,project:m},settingsManager:c,cwd:o,agentDir:a,writeScope:i?"project":"global",projectModeAvailable:c.isProjectTrusted()}),process.exit(0)}async function Yor(t,e={}){let n=bEs(t);if(!n)return!1;if(n.help)return EEs(n.command),!0;if(n.invalidOption)return console.error(tn.red(`Unknown option ${n.invalidOption} for "${n.command}".`)),console.error(tn.dim(`Use "${hn} --help" or "${Nk(n.command)}".`)),process.exitCode=1,!0;if(n.missingOptionValue)return console.error(tn.red(`Missing value for ${n.missingOptionValue}.`)),console.error(tn.dim(`Usage: ${Nk(n.command)}`)),process.exitCode=1,!0;if(n.invalidArgument)return console.error(tn.red(`Unexpected argument ${n.invalidArgument}.`)),console.error(tn.dim(`Usage: ${Nk(n.command)}`)),process.exitCode=1,!0;if(n.conflictingOptions)return console.error(tn.red(n.conflictingOptions)),console.error(tn.dim(`Usage: ${Nk(n.command)}`)),process.exitCode=1,!0;let r=n.source;if((n.command==="install"||n.command==="remove")&&!r)return console.error(tn.red(`Missing ${n.command} source.`)),console.error(tn.dim(`Usage: ${Nk(n.command)}`)),process.exitCode=1,!0;if(n.command==="update"&&n.updateTarget?.type==="models"){try{await SEs(ii())}catch(d){let m=d instanceof Error?d.message:"Unknown model catalog refresh error";console.error(tn.red(`Error: ${m}`)),process.exitCode=1}return!0}let i=process.cwd(),s=ii(),o=(n.command==="install"||n.command==="remove")&&n.local,{settingsManager:a,projectTrustWarnings:c}=await jor({cwd:i,agentDir:s,projectTrustOverride:n.projectTrustOverride,useSavedProjectTrustOnly:n.command==="update",extensionFactories:e.extensionFactories});if(qor(c),!a.isProjectTrusted()&&o)return console.error(tn.red("Project is not trusted. Use --approve to modify local package config.")),process.exitCode=1,!0;Hor(a,"package command");let u=a.getGlobalSettings().npmCommand,l=new rf({cwd:i,agentDir:s,settingsManager:a});l.setProgressCallback(d=>{d.type==="start"&&process.stdout.write(tn.dim(`${d.message} +`))});try{switch(n.command){case"install":return await l.installAndPersist(r,{local:n.local}),console.log(tn.green(`Installed ${r}`)),!0;case"remove":return await l.removeAndPersist(r,{local:n.local})?(console.log(tn.green(`Removed ${r}`)),!0):(console.error(tn.red(`No matching package found for ${r}`)),process.exitCode=1,!0);case"list":{let d=l.listConfiguredPackages(),m=d.filter(g=>g.scope==="user"),h=d.filter(g=>g.scope==="project");if(d.length===0)return console.log(tn.dim("No packages installed.")),!0;let f=g=>{let A=g.filtered?`${g.source} (filtered)`:g.source;console.log(` ${A}`),g.installedPath&&console.log(tn.dim(` ${g.installedPath}`))};if(m.length>0){console.log(tn.bold("User packages:"));for(let g of m)f(g)}if(h.length>0){m.length>0&&console.log(),console.log(tn.bold("Project packages:"));for(let g of h)f(g)}return!0}case"update":{let d=n.updateTarget??{type:"self"};if(n.showExtensionsSkippedNote&&console.log(tn.dim(`Extensions are skipped. Run ${hn} update --extensions to update extensions.`)),xEs(d)){let m=d.type==="extensions"?d.source:void 0;await l.update(m),console.log(m?tn.green(`Updated ${m}`):tn.green("Updated packages"))}if(_Es(d)){let m=Gor();if(m&&n.force)return console.error(tn.red(`Managed ${hn} installations do not support --force; rerun the installer to repair this installation.`)),process.exitCode=1,!0;let h=await TEs(n.force);if(!h.shouldRun)return!0;if(m){h.note&&Uor(h.note);try{console.log(tn.dim(`Updating managed ${hn} installation...`)),await gEs(m,h.version)}catch(y){let E=y instanceof Error?y.message:"Unknown managed update error";return console.error(tn.red(`Error: ${E}`)),process.exitCode=1,!0}return console.log(tn.green(`Updated ${hn} from ${Nl} to ${h.version}`)),!0}let f=Nwe();if(process.platform==="win32"&&f!=="npm"&&f!=="pnpm")return console.error(tn.red(`${hn} self-update on Windows is only supported for npm and pnpm installs.`)),console.error(tn.dim(`Detected install method: ${f}. Update ${hn} manually.`)),process.exitCode=1,!0;let g={packageName:h.packageName,installSpec:h.installSpec},A=VRn(ED,u,g);if(!A)return CEs(u,g),process.exitCode=1,!0;h.note&&Uor(h.note);try{f==="npm"&&REs(),await vEs(A)}catch(y){let E=y instanceof Error?y.message:"Unknown package command error";return console.error(tn.red(`Error: ${E}`)),f==="pnpm"&&wEs(),IEs(A),process.exitCode=1,!0}console.log(tn.green(`Updated ${hn} from ${Nl} to ${h.version}`))}return!0}}}catch(d){let m=d instanceof Error?d.message:"Unknown package command error";return console.error(tn.red(`Error: ${m}`)),process.exitCode=1,!0}}var Gu,$d,b_t,pEs,mEs,hEs,AEs,E_t,zor=v(()=>{p();Gu=require("node:fs"),$d=require("node:path");Tr();gb();b_t=Ot(Zse(),1);Dor();w0t();Qs();lP();pY();k0t();Oae();Ek();zU();FF();fc();Yj();Z0t();y_t();pEs="https://pi.dev/api/installer/releases",mEs="managed-install.json",hEs=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;AEs={heading:t=>tn.bold(tn.yellow(t)),link:t=>tn.cyan(t),linkUrl:t=>tn.dim(t),code:t=>tn.yellow(t),codeBlock:t=>tn.dim(t),codeBlockBorder:t=>tn.dim(t),quote:t=>tn.dim(t),quoteBorder:t=>tn.dim(t),hr:t=>tn.dim(t),listBullet:t=>tn.yellow(t),bold:t=>tn.bold(t),italic:t=>tn.italic(t),strikethrough:t=>tn.strikethrough(t),underline:t=>tn.underline(t)};E_t=`${hn} config [-l] [--approve|--no-approve]`});async function NEs(){if(!process.stdin.isTTY)return new Promise(t=>{let e="";process.stdin.setEncoding("utf8"),process.stdin.on("data",n=>{e+=n}),process.stdin.on("end",()=>{t(e.trim()||void 0)}),process.stdin.resume()})}function __t(t){for(let e of t){let n=e.type==="error"?tn.red:e.type==="warning"?tn.yellow:tn.dim,r=e.type==="error"?"Error: ":e.type==="warning"?"Warning: ":"";console.error(n(`${r}${e.message}`))}}function Kor(t){return t?t==="1"||t.toLowerCase()==="true"||t.toLowerCase()==="yes":!1}function DEs(t,e,n){return t.mode==="rpc"?"rpc":t.mode==="json"?"json":t.print||!e||!n?"print":"interactive"}function PEs(t){return t==="json"?"json":"text"}function MEs(t){return!t.print&&t.mode===void 0&&(t.help===!0||t.listModels!==void 0)}async function OEs(t){if(Knr(t))return Jnr(),!0;let e;try{e=Xnr(t)}catch(r){let i=r instanceof hl?r.message:"Failed to parse auth command";return console.error(tn.red(`Error: ${i}`)),process.exitCode=1,!0}if(!e)return!1;let n=fre(e.args);if(n.unknownFlags.size>0){let r=n.unknownFlags.keys().next().value;return console.error(tn.red(`Unknown option --${r} for "${E0t(e.kind)}".`)),console.error(tn.dim(`Use "${hn} --help" or "${znr(e.kind)}".`)),process.exitCode=1,!0}try{if(n.diagnostics.length>0)throw new hl(n.diagnostics.map(a=>a.message).join(` +`));if(e.kind!=="check"){let a=AbortSignal.timeout(15e3),c=await nf.create({allowModelNetwork:!1,signal:a}),u=await rrr(n,c,e.kind,e.minExpiryMs,a);return process.stdout.write(`${u} +`),!0}let r=d9(n,e.kind),i,s;try{let a=e.noRefresh?new tBe:sY.create(),c=await trr(a);i=await Znr(n,c,{refresh:!e.noRefresh}),e.credentials&&i.status==="ready"&&(s=await err(i.provider,c,a,{refresh:!e.noRefresh}),s||(i={status:"not_ready",provider:i.provider,reason:"credential_not_available"}))}catch{i={status:"invalid",provider:r.provider??r.model,reason:"invalid_state"}}let o=e.json?JSON.stringify({...i,...s?{credentials:s}:{}}):s??i.status;process.stdout.write(`${o} +`),process.exitCode=i.status==="ready"?0:i.status==="not_ready"?1:2}catch(r){let i=r instanceof hl?r.message:"Failed to resolve credential";console.error(tn.red(`Error: ${i}`)),process.exitCode=e.kind==="check"?2:1}return!0}async function LEs(t,e){if(t.fileArgs.length===0)return b0t({parsed:t,stdinContent:e});let{text:n,images:r}=await orr(t.fileArgs,{autoResizeImages:!1});return b0t({parsed:t,fileText:n,fileImages:r,stdinContent:e})}function x_t(t,e,n){let r=Js.findById(e,t,n);return r?{type:"local",path:r}:void 0}async function Jor(t,e,n){if(t.includes("/")||t.includes("\\")||t.endsWith(".jsonl"))return{type:"path",path:Vn(t,e)};let r=x_t(t,e,n);if(r)return r;let s=(await Js.list(e,n)).find(c=>c.id.startsWith(t));if(s)return{type:"local",path:s.path};let o=await Js.listAll(n),a=o.find(c=>c.id===t)??o.find(c=>c.id.startsWith(t));return a?{type:"global",path:a.path,cwd:a.cwd}:{type:"not_found",arg:t}}async function FEs(t){return new Promise(e=>{let n=(0,Zor.createInterface)({input:process.stdin,output:process.stdout});n.question(`${t} [y/N] `,r=>{n.close(),e(r.toLowerCase()==="y"||r.toLowerCase()==="yes")})})}function QEs(t){if(!t.fork)return;let e=[t.session?"--session":void 0,t.continue?"--continue":void 0,t.resume?"--resume":void 0,t.noSession?"--no-session":void 0].filter(n=>n!==void 0);e.length>0&&(console.error(tn.red(`Error: --fork cannot be combined with ${e.join(", ")}`)),process.exit(1))}function UEs(t){if(t.sessionId===void 0)return;let e=[t.session?"--session":void 0,t.continue?"--continue":void 0,t.resume?"--resume":void 0].filter(n=>n!==void 0);e.length>0&&(console.error(tn.red(`Error: --session-id cannot be combined with ${e.join(", ")}`)),process.exit(1));try{mRe(t.sessionId)}catch(n){let r=n instanceof Error?n.message:String(n);console.error(tn.red(`Error: ${r}`)),process.exit(1)}}function GEs(t,e){try{return Js.open(t,e)}catch(n){let r=n instanceof Error?n.message:String(n);console.error(tn.red(`Error: ${r}`)),process.exit(1)}}function Xor(t,e,n,r){try{return Js.forkFrom(t,e,n,{id:r})}catch(i){let s=i instanceof Error?i.message:String(i);console.error(tn.red(`Error: ${s}`)),process.exit(1)}}async function $Es(t,e,n,r){if(t.noSession||t.help||t.listModels!==void 0)return Js.inMemory(e,t.sessionId!==void 0?{id:t.sessionId}:void 0);if(t.fork){t.sessionId&&x_t(t.sessionId,e,n)&&(console.error(tn.red(`Session already exists with id '${t.sessionId}'`)),process.exit(1));let i=await Jor(t.fork,e,n);switch(i.type){case"path":case"local":case"global":return Xor(i.path,e,n,t.sessionId);case"not_found":console.error(tn.red(`No session found matching '${i.arg}'`)),process.exit(1)}}if(t.session){let i=await Jor(t.session,e,n);switch(i.type){case"path":case"local":return GEs(i.path,n);case"global":return console.log(tn.yellow(`Session found in different project: ${i.cwd}`)),await FEs("Fork this session into current directory?")||(console.log(tn.dim("Aborted.")),process.exit(0)),Xor(i.path,e,n);case"not_found":console.error(tn.red(`No session found matching '${i.arg}'`)),process.exit(1)}}if(t.resume)try{let i=await vrr((s,o)=>Js.list(e,n,s,o),(s,o)=>Js.listAll(n,s,o),r);return i||(console.log(tn.dim("No session selected")),process.exit(0)),Js.open(i,n)}finally{uS()}if(t.continue)return Js.continueRecent(e,n);if(t.sessionId){let i=x_t(t.sessionId,e,n);if(i)return Js.open(i.path,n);console.error(tn.yellow(`Warning: No project session found with id '${t.sessionId}'; creating a new session with that id.`))}return Js.create(e,n,{id:t.sessionId})}function WEs(t,e,n,r,i){let s={},o=[],a=!1;if(t.model){let c=Rw({cliProvider:t.provider,cliModel:t.model,cliThinking:t.thinking,modelRuntime:r});c.warning&&o.push({type:"warning",message:c.warning}),c.error&&o.push({type:"error",message:c.error}),c.model&&(s.model=c.model,!t.thinking&&c.thinkingLevel&&(s.thinkingLevel=c.thinkingLevel,a=!0))}if(!s.model&&e.length>0&&!n){let c=i.getDefaultProvider(),u=i.getDefaultModel(),l=c&&u?r.getModel(c,u):void 0,d=l?e.find(m=>Zd(m.model,l)):void 0;d?(s.model=d.model,!t.thinking&&d.thinkingLevel&&(s.thinkingLevel=d.thinkingLevel)):(s.model=e[0].model,!t.thinking&&e[0].thinkingLevel&&(s.thinkingLevel=e[0].thinkingLevel))}return t.thinking&&(s.thinkingLevel=t.thinking),e.length>0&&(s.scopedModels=e.map(c=>({model:c.model,thinkingLevel:c.thinkingLevel}))),t.noTools?s.noTools="all":t.noBuiltinTools&&(s.noTools="builtin"),t.tools&&(s.tools=[...t.tools]),t.excludeTools&&(s.excludeTools=[...t.excludeTools]),{options:s,cliThinkingFromModel:a,diagnostics:o}}function zPe(t,e){return e?.map(n=>Ab(n)?Vn(n,t):n)}async function HEs(t,e){return Wae(e,$De(t),[{label:"Continue",value:t.fallbackCwd},{label:"Cancel",value:void 0}])}async function ear(t,e){Hie();let n=[...Jrr,...e?.extensionFactories??[]],r=t.includes("--offline")||Kor(process.env.PI_OFFLINE);if(r&&(process.env.PI_OFFLINE="1",process.env.PI_SKIP_VERSION_CHECK="1"),await OEs(t))return;process.platform==="win32"&&YPe(eu()),Wor();let i=process.cwd(),s=ii(),o=lu.create(i,s,{projectTrusted:!1});if(n0t(o.getGlobalSettings().httpProxy),u9(),await Yor(t,{extensionFactories:n})){let oe=process.exitCode??0;if(process.platform==="win32"&&oe===0&&t[0]==="update")return;process.exit(oe);return}if(await Vor(t,{extensionFactories:n}))return;let a=fre(t);if(a.diagnostics.length>0){for(let oe of a.diagnostics){let ne=oe.type==="error"?tn.red:tn.yellow;console.error(ne(`${oe.type==="error"?"Error":"Warning"}: ${oe.message}`))}a.diagnostics.some(oe=>oe.type==="error")&&process.exit(1)}if(om("parseArgs"),a.version&&(console.log(Nl),process.exit(0)),a.export){let oe;try{let ne=a.messages.length>0?a.messages[0]:void 0;oe=await hWn(a.export,ne)}catch(ne){let Z=ne instanceof Error?ne.message:"Failed to export session";console.error(tn.red(`Error: ${Z}`)),process.exit(1)}console.log(`Exported to: ${oe}`),process.exit(0)}let c=DEs(a,process.stdin.isTTY,process.stdout.isTTY);c!=="interactive"&&!MEs(a)&&SBe(),a.mode==="rpc"&&a.fileArgs.length>0&&(console.error(tn.red("Error: @file arguments are not supported in RPC mode")),process.exit(1)),QEs(a),UEs(a);let{migratedAuthProviders:l,deprecationWarnings:d}=nir(i);om("runMigrations");let m=lu.create(i,s),h=B0t(m);c==="interactive"&&!a.help&&a.listModels===void 0&&grr()&&(await Arr(m),om("firstTimeSetup")),c==="interactive"&&a.useTheme!==void 0&&m.applyOverrides({theme:a.useTheme});let f=process.env[Mwe],g=(a.sessionDir?Vo(a.sessionDir):void 0)??(f?zst(f):void 0)??m.getSessionDir(),A=await $Es(a,i,g,m),y=h0t(A,i);if(y)if(c==="interactive"){let oe=await HEs(y,m);oe||process.exit(0),A=Js.open(y.sessionFile,g,oe)}else console.error(tn.red(new VP(y).message)),process.exit(1);if(a.name!==void 0){let oe=rkn(a.name);oe===void 0&&(console.error(tn.red("Error: --name requires a non-empty value")),process.exit(1)),A.appendSessionInfo(oe)}om("createSessionManager");let E=new MS(s),_=A.getCwd(),S=a.projectTrustOverride===void 0&&!t_(_)?_:void 0,C=a.help||a.listModels!==void 0?"print":c,I=new Map,w=zPe(i,a.extensions),k=zPe(i,a.skills),N=zPe(i,a.promptTemplates),O=zPe(i,a.themes),W=async({cwd:oe,agentDir:ne,sessionManager:Z,sessionStartEvent:te,projectTrustContext:V})=>{let ee=te===void 0,ae=[],me=I.get(oe),ge=t_(oe),ue=a.projectTrustOverride===void 0&&me===void 0&&ge,ye=ue?!1:me??a.projectTrustOverride??(!ge||E.get(oe)===!0),Se=lu.create(oe,ne,{projectTrusted:ye}),be=await VU({cwd:oe,agentDir:ne,settingsManager:Se,modelRuntimeSignal:AbortSignal.timeout(15e3),extensionFlagValues:a.unknownFlags,resourceLoaderReloadOptions:ue?{resolveProjectTrust:async({extensionsResult:Ft})=>{let Qt=await iPe({cwd:oe,trustStore:E,trustOverride:a.projectTrustOverride,defaultProjectTrust:m.getDefaultProjectTrust(),extensionsResult:Ft,projectTrustContext:V??nPe({cwd:oe,mode:ee?C:c,settingsManager:m,hasUI:ee&&C==="interactive"}),onExtensionError:Mt=>ae.push({type:"warning",message:Mt})});return I.set(oe,Qt),Qt}}:void 0,resourceLoaderOptions:{additionalExtensionPaths:w,additionalSkillPaths:k,additionalPromptTemplatePaths:N,additionalThemePaths:O,noExtensions:a.noExtensions,noSkills:a.noSkills,noPromptTemplates:a.noPromptTemplates,noThemes:a.noThemes,noContextFiles:a.noContextFiles,systemPrompt:a.systemPrompt,appendSystemPrompt:a.appendSystemPrompt,extensionFactories:n}}),{settingsManager:Te,modelRuntime:_e,resourceLoader:X}=be,$e=[...ae,...be.diagnostics,...B0t(Te),...X.getExtensions().errors.map(({path:Ft,error:Qt})=>({type:"error",message:`Failed to load extension "${Ft}": ${Qt}`}))],He=a.models??Te.getEnabledModels(),mt=He&&He.length>0?await xjn(He,_e,{signal:AbortSignal.timeout(15e3)}):[],{options:st,cliThinkingFromModel:ze,diagnostics:rt}=WEs(a,mt,Z.buildSessionContext().messages.length>0,_e,Te);$e.push(...rt),a.apiKey&&(st.model?await _e.setRuntimeApiKey(st.model.provider,a.apiKey):$e.push({type:"error",message:"--api-key requires a model to be specified via --model, --provider/--model, or --models"}));let Ct=await YU({services:be,sessionManager:Z,sessionStartEvent:te,model:st.model,thinkingLevel:st.thinkingLevel,scopedModels:st.scopedModels,tools:st.tools,excludeTools:st.excludeTools,noTools:st.noTools,customTools:st.customTools}),on=a.thinking!==void 0||ze;return Ct.session.model&&on&&Ct.session.setThinkingLevel(Ct.session.thinkingLevel),{...Ct,services:be,diagnostics:$e}};om("createRuntime");let $=await jDe(W,{cwd:A.getCwd(),agentDir:s,sessionManager:A});om("createAgentSessionRuntime");let{services:G,session:q,modelFallbackMessage:ce}=$,{settingsManager:Y,modelRuntime:z,resourceLoader:j}=G;if(RR(Y.getTerminalCapabilityOverrides()),n0t(Y.getGlobalSettings().httpProxy),u9(Y.getHttpIdleTimeoutMs()),a.help){__t(h);let oe=j.getExtensions().extensions.flatMap(ne=>Array.from(ne.flags.values()));ikn(oe),process.exit(0)}if(a.listModels!==void 0){__t(h);let oe=typeof a.listModels=="string"?a.listModels:void 0;await urr(z,oe,AbortSignal.timeout(15e3)),process.exit(0)}let se;c!=="rpc"&&(se=await NEs(),se!==void 0&&c==="interactive"&&(c="print")),om("readPipedStdin");let{initialMessage:Ae,initialImages:De}=await LEs(a,se);om("prepareInitialMessage"),zFn(Tor),lw(Y.getTheme(),c==="interactive"),om("initTheme"),c==="interactive"&&d.length>0&&await tir(d),om("resolveModelScope");let Pe=krr([...h,...$.diagnostics]),we=$.diagnostics.some(oe=>oe.type==="error");(c!=="interactive"||we)&&__t(Pe),we&&($.diagnostics.some(oe=>oe.message.includes("Failed to load extension"))&&console.error(tn.yellow(BEs)),process.exit(1)),om("createAgentSession"),c!=="interactive"&&!q.model&&(console.error(tn.red(Hj())),process.exit(1));let ie=Kor(process.env.PI_STARTUP_BENCHMARK);if(ie&&c!=="interactive"&&(console.error(tn.red("Error: PI_STARTUP_BENCHMARK only supports interactive mode")),process.exit(1)),!r&&c==="rpc"){let oe=new AbortController,ne=setTimeout(()=>oe.abort(),15e3);z.refresh({signal:oe.signal}).catch(()=>{}).finally(()=>clearTimeout(ne))}if(c==="rpc")qie(),await hce($);else if(c==="interactive"){let oe=new AG($,{migratedProviders:l,startupDiagnostics:Pe,modelFallbackMessage:ce,autoTrustOnReloadCwd:S,initialMessage:Ae,initialImages:De,initialMessages:a.messages,verbose:a.verbose,tuiMode:a.tuiMode,initialThemeSetting:a.useTheme});if(ie){await oe.init(),om("interactiveMode.init"),await new Promise(ne=>setTimeout(ne,150)),oe.stop(),uS(),qie(),process.stdout.writableLength>0&&await new Promise(ne=>process.stdout.once("drain",ne)),process.stderr.writableLength>0&&await new Promise(ne=>process.stderr.once("drain",ne));return}qie(),await oe.run()}else{qie();let oe=await pce($,{mode:PEs(c),messages:a.messages,initialMessage:Ae,initialImages:De});uS(),XYn(),oe!==0&&(process.exitCode=oe);return}}var Zor,BEs,tar=v(()=>{p();Zor=require("node:readline");qo();Tr();gb();Fwe();nrr();p9();irr();arr();crr();drr();w0t();Rrr();tPe();Qs();VDe();g0t();Rie();noe();Eut();Mae();eU();lP();yoe();k0t();HDe();fw();Brr();Ek();jie();zU();Xrr();rir();m_t();pi();vor();zor();fc();y_t();BEs=`Hint: Start without extensions using "${hn} -ne".`});var qEs,fce,nar=v(()=>{p();Tr();pi();Ll();qEs={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},fce=class extends gn{selectList;constructor(e,n,r){super();let i=[{value:"yes",label:"Yes",description:"Show images inline in terminal"},{value:"no",label:"No",description:"Show text placeholder instead"}];this.addChild(new Un),this.selectList=new eh(i,5,dS(),qEs),this.selectList.setSelectedIndex(e?0:1),this.selectList.onSelect=s=>{n(s.value==="yes")},this.selectList.onCancel=()=>{r()},this.addChild(this.selectList),this.addChild(new Un)}getSelectList(){return this.selectList}}});var jEs,gce,rar=v(()=>{p();Tr();pi();Ll();jEs={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},gce=class extends gn{selectList;onPreview;constructor(e,n,r,i){super(),this.onPreview=i;let s=WTe(),o=s.map(c=>({value:c,label:c,description:c===e?"(current)":void 0}));this.addChild(new Un),this.selectList=new eh(o,10,dS(),jEs);let a=s.indexOf(e);a!==-1&&this.selectList.setSelectedIndex(a),this.selectList.onSelect=c=>{n(c.value)},this.selectList.onCancel=()=>{r()},this.selectList.onSelectionChange=c=>{this.onPreview(c.value)},this.addChild(this.selectList),this.addChild(new Un)}getSelectList(){return this.selectList}}});var iar=v(()=>{p();abt();lbt();ubt();EPe();dbt();pbt();mbt();hbt();Abt();hmt();Ll();_Pe();ZDe();Qae();C0t();ybt();ha();bbt();Gbt();$bt();Hbt();rPe();zbt();nar();Kbt();rar();Jbt();Xbt();r_t();i_t();s_t();a_t();f1e()});var n1e={};br(n1e,{AgentSession:()=>ZV,AgentSessionRuntime:()=>Fae,ArminComponent:()=>ZU,AssistantMessageComponent:()=>OS,BashExecutionComponent:()=>Ck,BorderedLoader:()=>Jw,BranchSummaryMessageComponent:()=>eG,CONFIG_DIR_NAME:()=>Bi,CURRENT_SESSION_VERSION:()=>HD,CompactionSummaryMessageComponent:()=>tG,CredentialSynchronizationError:()=>SS,CustomEditor:()=>nG,CustomMessageComponent:()=>tM,DEFAULT_COMPACTION_SETTINGS:()=>U$n,DEFAULT_MAX_BYTES:()=>Ks,DEFAULT_MAX_LINES:()=>CE,DefaultPackageManager:()=>rf,DefaultResourceLoader:()=>NS,DynamicBorder:()=>Un,ExtensionEditorComponent:()=>Sk,ExtensionInputComponent:()=>_k,ExtensionRunner:()=>FQ,ExtensionSelectorComponent:()=>WE,FooterComponent:()=>rG,InteractiveMode:()=>AG,LoginDialogComponent:()=>Ik,ModelRegistry:()=>NV,ModelRuntime:()=>nf,ModelSelectorComponent:()=>uG,OAuthSelectorComponent:()=>iM,ProjectTrustStore:()=>MS,RpcClient:()=>mce,SessionManager:()=>Js,SessionSelectorComponent:()=>xk,SettingsManager:()=>lu,SettingsSelectorComponent:()=>dG,ShowImagesSelectorComponent:()=>fce,SkillInvocationMessageComponent:()=>pG,Theme:()=>sQ,ThemeSelectorComponent:()=>gce,ThinkingSelectorComponent:()=>mG,ToolExecutionComponent:()=>QS,TreeSelectorComponent:()=>hG,UserMessageComponent:()=>Bk,UserMessageSelectorComponent:()=>fG,VERSION:()=>Nl,buildContextEntries:()=>gRe,buildSessionContext:()=>P$n,buildSessionProjection:()=>Kj,calculateContextTokens:()=>EQ,collectEntriesForBranchSummary:()=>IRe,compact:()=>_Re,convertToLlm:()=>IE,convertToPng:()=>eRe,copyToClipboard:()=>XU,createAgentSession:()=>qDe,createAgentSessionFromServices:()=>YU,createAgentSessionRuntime:()=>jDe,createAgentSessionServices:()=>VU,createBashTool:()=>OV,createBashToolDefinition:()=>MV,createCodingTools:()=>Fmt,createEditTool:()=>GV,createEditToolDefinition:()=>UV,createEventBus:()=>eV,createExtensionRuntime:()=>RV,createFindTool:()=>WV,createFindToolDefinition:()=>$V,createGrepTool:()=>qV,createGrepToolDefinition:()=>HV,createLocalBashOperations:()=>PV,createLocalPowerShellOperations:()=>B1e,createLsTool:()=>VV,createLsToolDefinition:()=>jV,createPowerShellTool:()=>Vse,createPowerShellToolDefinition:()=>YV,createReadOnlyTools:()=>Qmt,createReadTool:()=>qQ,createReadToolDefinition:()=>KV,createSyntheticSourceInfo:()=>ih,createWriteTool:()=>XV,createWriteToolDefinition:()=>JV,defineTool:()=>ES,detectSupportedImageMimeTypeFromFile:()=>zV,discoverAndLoadExtensions:()=>vpt,estimateTokens:()=>NA,findCutPoint:()=>j$n,findTurnStartIndex:()=>put,formatDimensionNote:()=>rRe,formatSize:()=>Ua,formatSkillsForPrompt:()=>o1e,generateBranchSummary:()=>wRe,generateDiffString:()=>Hse,generateSummary:()=>Y$n,generateSummaryWithUsage:()=>Qie,generateUnifiedPatch:()=>y1e,getAgentDir:()=>ii,getDocsPath:()=>IR,getExamplesPath:()=>Dwe,getLanguageFromPath:()=>kD,getLastAssistantUsage:()=>$$n,getLatestCompactionEntry:()=>Oie,getMarkdownTheme:()=>zh,getPackageDir:()=>eu,getPowerShellConfig:()=>cRe,getReadmePath:()=>D8,getSelectListTheme:()=>dS,getSettingsListTheme:()=>Cj,getShellConfig:()=>jj,hasTrustRequiringProjectResources:()=>t_,highlightCode:()=>FR,initTheme:()=>lw,isBashToolResult:()=>Opt,isEditToolResult:()=>Qpt,isFindToolResult:()=>$pt,isGrepToolResult:()=>Gpt,isLsToolResult:()=>Wpt,isPowerShellToolResult:()=>Lpt,isReadToolResult:()=>Fpt,isToolCallEventType:()=>Hpt,isWriteToolResult:()=>Upt,keyHint:()=>nr,keyText:()=>Ca,loadProjectContextFiles:()=>u0t,loadSkills:()=>a1e,loadSkillsFromDir:()=>$3n,main:()=>ear,migrateSessionEntries:()=>B$n,parseArgs:()=>fre,parseFrontmatter:()=>hQ,parseSessionEntries:()=>N$n,parseSkillBlock:()=>G1e,prepareBranchEntries:()=>gut,rawKeyHint:()=>iu,readStoredCredential:()=>X8n,renderDiff:()=>FV,resizeImage:()=>nRe,resolveCliModel:()=>Rw,resolveModelScopeWithDiagnostics:()=>hht,runPrintMode:()=>pce,runRpcMode:()=>hce,serializeConversation:()=>$R,sessionEntryToContextMessages:()=>hS,shouldCompact:()=>Uie,stripFrontmatter:()=>Hve,truncateHead:()=>wb,truncateLine:()=>Vj,truncateTail:()=>mw,truncateToVisualLines:()=>UQ,withFileMutationQueue:()=>iP,wrapRegisteredTool:()=>u1e,wrapRegisteredTools:()=>kV});var Mb=v(()=>{p();Fwe();Qs();$1e();noe();Aut();RRe();qpt();GR();nmt();eU();lP();pY();Oae();A0t();fw();Ek();c1e();_Q();E1e();F1e();zU();tar();m_t();iar();pi();fPe();Tie();tRe();Klt();Yse();pw()});var Jxt=re((hkl,uOe)=>{p();function sgr(t){return Array.isArray(t)?t:[t]}var vIs=void 0,jxt="",rgr=" ",qxt="\\",RIs=/^\s+$/,kIs=/(?:[^\\]|^)\\$/,BIs=/^\\!/,NIs=/^\\#/,DIs=/\r?\n/g,PIs=/^\.{0,2}\/|^\.{1,2}$/,MIs=/\/$/,J9="/",ogr="node-ignore";typeof Symbol<"u"&&(ogr=Symbol.for("node-ignore"));var agr=ogr,X9=(t,e,n)=>(Object.defineProperty(t,e,{value:n}),n),OIs=/([0-z])-([0-z])/g,cgr=()=>!1,LIs=t=>t.replace(OIs,(e,n,r)=>n.charCodeAt(0)<=r.charCodeAt(0)?e:jxt),FIs=t=>t.startsWith("!")||t.startsWith("\\^")?`^${t.slice(t[0]==="!"?1:2)}`:t,QIs=t=>{let{length:e}=t;return t.slice(0,e-e%2)},UIs=[[/^\uFEFF/,()=>jxt],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,n)=>e+(n.indexOf("\\")===0?rgr:jxt)],[/(\\+?)\s/g,(t,e)=>{let{length:n}=e;return e.slice(0,n-n%2)+rgr}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*(?:\\\*\\\*\\\/)+/,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,n)=>e+6{let r=n.replace(/\\\*/g,"[^\\/]*");return e+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>qxt],[/\\\\/g,()=>qxt],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,n,r,i)=>e===qxt?`\\[${n}${QIs(r)}${i}`:i==="]"&&r.length%2===0?`[${FIs(LIs(n))}${r}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],GIs=/(^|\\\/)?\\\*$/,tle="regex",cOe="checkRegex",igr="_",$Is={[tle](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[cOe](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},WIs=t=>UIs.reduce((e,[n,r])=>e.replace(n,r.bind(t)),t),lOe=t=>typeof t=="string",HIs=t=>t&&lOe(t)&&!RIs.test(t)&&!kIs.test(t)&&t.indexOf("#")!==0,qIs=t=>t.split(DIs).filter(Boolean),Vxt=class{constructor(e,n,r,i,s,o){this.pattern=e,this.mark=n,this.negative=s,X9(this,"body",r),X9(this,"ignoreCase",i),X9(this,"regexPrefix",o)}get regex(){let e=igr+tle;return this[e]?this[e]:this._make(tle,e)}get checkRegex(){let e=igr+cOe;return this[e]?this[e]:this._make(cOe,e)}_make(e,n){let r=this.regexPrefix.replace(GIs,$Is[e]),i=this.ignoreCase?new RegExp(r,"i"):new RegExp(r);return X9(this,n,i)}},jIs=({pattern:t,mark:e},n)=>{let r=!1,i=t;i.indexOf("!")===0&&(r=!0,i=i.substr(1)),i=i.replace(BIs,"!").replace(NIs,"#");let s=WIs(i);return new Vxt(t,e,i,n,r,s)},Yxt=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[agr]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(lOe(e)&&(e={pattern:e}),HIs(e.pattern)){let n=jIs(e,this._ignoreCase);this._added=!0,this._rules.push(n)}}add(e){return this._added=!1,sgr(lOe(e)?qIs(e):e).forEach(this._add,this),this._added}test(e,n,r){let i=!1,s=!1,o;this._rules.forEach(c=>{let{negative:u}=c;s===u&&i!==s||u&&!i&&!s&&!n||!c[r].test(e)||(i=!u,s=u,o=u?vIs:c)});let a={ignored:i,unignored:s};return o&&(a.rule=o),a}},VIs=(t,e)=>{throw new e(t)},Fk=(t,e,n)=>lOe(t)?t?Fk.isNotRelative(t)?n(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${e}\``,TypeError),lgr=t=>PIs.test(t);Fk.isNotRelative=lgr;Fk.convert=t=>t;var zxt=class{constructor({ignorecase:e=!0,ignoreCase:n=e,allowRelativePaths:r=!1}={}){X9(this,agr,!0),this._rules=new Yxt(n),this._strictPathCheck=!r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,n,r,i){let s=e&&Fk.convert(e);return Fk(s,e,this._strictPathCheck?VIs:cgr),this._t(s,n,r,i)}checkIgnore(e){if(!MIs.test(e))return this.test(e);let n=e.split(J9).filter(Boolean);if(n.pop(),n.length){let r=this._t(n.join(J9)+J9,this._testCache,!0,n);if(r.ignored)return r}return this._rules.test(e,!1,cOe)}_t(e,n,r,i){if(e in n)return n[e];if(i||(i=e.split(J9).filter(Boolean)),i.pop(),!i.length)return n[e]=this._rules.test(e,r,tle);let s=this._t(i.join(J9)+J9,n,r,i);return n[e]=s.ignored?s:this._rules.test(e,r,tle)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return sgr(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},Kxt=t=>new zxt(t),YIs=t=>Fk(t&&Fk.convert(t),t,cgr),ugr=()=>{let t=n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/");Fk.convert=t;let e=/^[a-z]:\//i;Fk.isNotRelative=n=>e.test(n)||lgr(n)};typeof process<"u"&&process.platform==="win32"&&ugr();uOe.exports=Kxt;Kxt.default=Kxt;uOe.exports.isPathValid=YIs;X9(uOe.exports,Symbol.for("setupWindows"),ugr)});var Bgr=re(KE=>{"use strict";p();var pws=KE&&KE.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(KE,"__esModule",{value:!0});var mws=require("fs"),hws=pws(pB()),e6=hws.default("@kwsites/file-exists");function fws(t,e,n){e6("checking %s",t);try{let r=mws.statSync(t);return r.isFile()&&e?(e6("[OK] path represents a file"),!0):r.isDirectory()&&n?(e6("[OK] path represents a directory"),!0):(e6("[FAIL] path represents something other than a file or directory"),!1)}catch(r){if(r.code==="ENOENT")return e6("[FAIL] path is not accessible: %o",r),!1;throw e6("[FATAL] %o",r),r}}function gws(t,e=KE.READABLE){return fws(t,(e&KE.FILE)>0,(e&KE.FOLDER)>0)}KE.exists=gws;KE.FILE=1;KE.FOLDER=2;KE.READABLE=KE.FILE+KE.FOLDER});var Ngr=re(gOe=>{"use strict";p();function Aws(t){for(var e in t)gOe.hasOwnProperty(e)||(gOe[e]=t[e])}Object.defineProperty(gOe,"__esModule",{value:!0});Aws(Bgr())});var sSt=re(PG=>{"use strict";p();Object.defineProperty(PG,"__esModule",{value:!0});PG.createDeferred=PG.deferred=void 0;function iSt(){let t,e,n="pending";return{promise:new Promise((i,s)=>{t=i,e=s}),done(i){n==="pending"&&(n="resolved",t(i))},fail(i){n==="pending"&&(n="rejected",e(i))},get fulfilled(){return n!=="pending"},get status(){return n}}}PG.deferred=iSt;PG.createDeferred=iSt;PG.default=iSt});var Wks={};br(Wks,{run:()=>p0r});module.exports=wr(Wks);p();var d0r=Ot(require("node:path"),1);p();p();var xCt=Ot(require("os"),1);p();function Jk(t){return t==null?"":typeof t=="string"||t instanceof String?t:JSON.stringify(t)}function $le(t){return Object.keys(t).length?{title:t.title,file:t.file,line:t.startLine,endLine:t.endLine,col:t.startColumn,endColumn:t.endColumn}:{}}function Xk(t,e,n){let r=new ZOe(t,e,n);process.stdout.write(r.toString()+xCt.EOL)}function eLe(t,e=""){Xk(t,{},e)}var _Ct="::",ZOe=class{constructor(e,n,r){e||(e="missing.command"),this.command=e,this.properties=n,this.message=r}toString(){let e=_Ct+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let n=!0;for(let r in this.properties)if(this.properties.hasOwnProperty(r)){let i=this.properties[r];i&&(n?n=!1:e+=",",e+=`${r}=${b0r(i)}`)}}return e+=`${_Ct}${E0r(this.message)}`,e}};function E0r(t){return Jk(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function b0r(t){return Jk(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}p();var SCt=Ot(require("crypto"),1),Hle=Ot(require("fs"),1),Wle=Ot(require("os"),1);function CCt(t,e){let n=process.env[`GITHUB_${t}`];if(!n)throw new Error(`Unable to find environment variable for file command ${t}`);if(!Hle.existsSync(n))throw new Error(`Missing file at path: ${n}`);Hle.appendFileSync(n,`${Jk(e)}${Wle.EOL}`,{encoding:"utf8"})}function ICt(t,e){let n=`ghadelimiter_${SCt.randomUUID()}`,r=Jk(e);if(t.includes(n))throw new Error(`Unexpected input: name should not contain the delimiter "${n}"`);if(r.includes(n))throw new Error(`Unexpected input: value should not contain the delimiter "${n}"`);return`${t}<<${n}${Wle.EOL}${r}${Wle.EOL}${n}`}var NQe=Ot(require("os"),1);p();p();p();var Ude=Ot(rLe(),1),PBr=Ot(Qde(),1);var sC;(function(t){t[t.OK=200]="OK",t[t.MultipleChoices=300]="MultipleChoices",t[t.MovedPermanently=301]="MovedPermanently",t[t.ResourceMoved=302]="ResourceMoved",t[t.SeeOther=303]="SeeOther",t[t.NotModified=304]="NotModified",t[t.UseProxy=305]="UseProxy",t[t.SwitchProxy=306]="SwitchProxy",t[t.TemporaryRedirect=307]="TemporaryRedirect",t[t.PermanentRedirect=308]="PermanentRedirect",t[t.BadRequest=400]="BadRequest",t[t.Unauthorized=401]="Unauthorized",t[t.PaymentRequired=402]="PaymentRequired",t[t.Forbidden=403]="Forbidden",t[t.NotFound=404]="NotFound",t[t.MethodNotAllowed=405]="MethodNotAllowed",t[t.NotAcceptable=406]="NotAcceptable",t[t.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",t[t.RequestTimeout=408]="RequestTimeout",t[t.Conflict=409]="Conflict",t[t.Gone=410]="Gone",t[t.TooManyRequests=429]="TooManyRequests",t[t.InternalServerError=500]="InternalServerError",t[t.NotImplemented=501]="NotImplemented",t[t.BadGateway=502]="BadGateway",t[t.ServiceUnavailable=503]="ServiceUnavailable",t[t.GatewayTimeout=504]="GatewayTimeout"})(sC||(sC={}));var rNt;(function(t){t.Accept="accept",t.ContentType="content-type"})(rNt||(rNt={}));var iNt;(function(t){t.ApplicationJson="application/json"})(iNt||(iNt={}));var HDs=[sC.MovedPermanently,sC.ResourceMoved,sC.SeeOther,sC.TemporaryRedirect,sC.PermanentRedirect],qDs=[sC.BadGateway,sC.ServiceUnavailable,sC.GatewayTimeout];p();p();var oNt=require("os"),_z=require("fs"),TQe=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{u(r.next(l))}catch(d){o(d)}}function c(l){try{u(r.throw(l))}catch(d){o(d)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},{access:MBr,appendFile:OBr,writeFile:LBr}=_z.promises,sNt="GITHUB_STEP_SUMMARY";var vQe=class{constructor(){this._buffer=""}filePath(){return TQe(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let e=process.env[sNt];if(!e)throw new Error(`Unable to find environment variable for $${sNt}. Check if your runtime environment supports job summaries.`);try{yield MBr(e,_z.constants.R_OK|_z.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}return this._filePath=e,this._filePath})}wrap(e,n,r={}){let i=Object.entries(r).map(([s,o])=>` ${s}="${o}"`).join("");return n?`<${e}${i}>${n}`:`<${e}${i}>`}write(e){return TQe(this,void 0,void 0,function*(){let n=!!e?.overwrite,r=yield this.filePath();return yield(n?LBr:OBr)(r,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return TQe(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(e,n=!1){return this._buffer+=e,n?this.addEOL():this}addEOL(){return this.addRaw(oNt.EOL)}addCodeBlock(e,n){let r=Object.assign({},n&&{lang:n}),i=this.wrap("pre",this.wrap("code",e),r);return this.addRaw(i).addEOL()}addList(e,n=!1){let r=n?"ol":"ul",i=e.map(o=>this.wrap("li",o)).join(""),s=this.wrap(r,i);return this.addRaw(s).addEOL()}addTable(e){let n=e.map(i=>{let s=i.map(o=>{if(typeof o=="string")return this.wrap("td",o);let{header:a,data:c,colspan:u,rowspan:l}=o,d=a?"th":"td",m=Object.assign(Object.assign({},u&&{colspan:u}),l&&{rowspan:l});return this.wrap(d,c,m)}).join("");return this.wrap("tr",s)}).join(""),r=this.wrap("table",n);return this.addRaw(r).addEOL()}addDetails(e,n){let r=this.wrap("details",this.wrap("summary",e)+n);return this.addRaw(r).addEOL()}addImage(e,n,r){let{width:i,height:s}=r||{},o=Object.assign(Object.assign({},i&&{width:i}),s&&{height:s}),a=this.wrap("img",null,Object.assign({src:e,alt:n},o));return this.addRaw(a).addEOL()}addHeading(e,n){let r=`h${n}`,i=["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1",s=this.wrap(i,e);return this.addRaw(s).addEOL()}addSeparator(){let e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){let e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,n){let r=Object.assign({},n&&{cite:n}),i=this.wrap("blockquote",e,r);return this.addRaw(i).addEOL()}addLink(e,n){let r=this.wrap("a",e,{href:n});return this.addRaw(r).addEOL()}},FBr=new vQe;var RQe=FBr;p();p();var kQe=Ot(require("os"),1);p();p();p();p();var $de=Ot(require("fs"),1);var{chmod:QBr,copyFile:UBr,lstat:GBr,mkdir:$Br,open:aPs,readdir:WBr,rename:HBr,rm:qBr,rmdir:cPs,stat:jBr,symlink:VBr,unlink:YBr}=$de.promises,zBr=process.platform==="win32";var lPs=$de.constants.O_RDONLY;var gPs=process.platform==="win32";var xPs=kQe.default.platform(),SPs=kQe.default.arch();var BQe;(function(t){t[t.Success=0]="Success",t[t.Failure=1]="Failure"})(BQe||(BQe={}));function Gde(t){Xk("add-mask",{},t)}function Za(t,e){let n=process.env[`INPUT_${t.replace(/ /g,"_").toUpperCase()}`]||"";if(e&&e.required&&!n)throw new Error(`Input required and not supplied: ${t}`);return e&&e.trimWhitespace===!1?n:n.trim()}function Wde(t,e){if(process.env.GITHUB_OUTPUT||"")return CCt("OUTPUT",ICt(t,e));process.stdout.write(NQe.EOL),Xk("set-output",{name:t},Jk(e))}function j$(t){process.exitCode=BQe.Failure,DQe(t)}function bz(t){Xk("debug",{},t)}function DQe(t,e={}){Xk("error",$le(e),t instanceof Error?t.toString():t)}function V$(t,e={}){Xk("warning",$le(e),t instanceof Error?t.toString():t)}function cNt(t,e={}){Xk("notice",$le(e),t instanceof Error?t.toString():t)}function lNt(t){process.stdout.write(t+NQe.EOL)}function uNt(t){eLe("group",t)}function dNt(){eLe("endgroup")}p();p();var qde=require("fs"),pNt=require("os"),Y$=class{constructor(){var e,n,r;if(this.payload={},process.env.GITHUB_EVENT_PATH)if((0,qde.existsSync)(process.env.GITHUB_EVENT_PATH))this.payload=JSON.parse((0,qde.readFileSync)(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"}));else{let i=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${i} does not exist${pNt.EOL}`)}this.eventName=process.env.GITHUB_EVENT_NAME,this.sha=process.env.GITHUB_SHA,this.ref=process.env.GITHUB_REF,this.workflow=process.env.GITHUB_WORKFLOW,this.action=process.env.GITHUB_ACTION,this.actor=process.env.GITHUB_ACTOR,this.job=process.env.GITHUB_JOB,this.runAttempt=parseInt(process.env.GITHUB_RUN_ATTEMPT,10),this.runNumber=parseInt(process.env.GITHUB_RUN_NUMBER,10),this.runId=parseInt(process.env.GITHUB_RUN_ID,10),this.apiUrl=(e=process.env.GITHUB_API_URL)!==null&&e!==void 0?e:"https://api.github.com",this.serverUrl=(n=process.env.GITHUB_SERVER_URL)!==null&&n!==void 0?n:"https://github.com",this.graphqlUrl=(r=process.env.GITHUB_GRAPHQL_URL)!==null&&r!==void 0?r:"https://api.github.com/graphql"}get issue(){let e=this.payload;return Object.assign(Object.assign({},this.repo),{number:(e.issue||e.pull_request||e).number})}get repo(){if(process.env.GITHUB_REPOSITORY){let[e,n]=process.env.GITHUB_REPOSITORY.split("/");return{owner:e,repo:n}}if(this.payload.repository)return{owner:this.payload.repository.owner.login,repo:this.payload.repository.name};throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'")}};p();p();var LQe=Ot(ANt(),1),yNt=Ot(Qde(),1),hNr=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{u(r.next(l))}catch(d){o(d)}}function c(l){try{u(r.throw(l))}catch(d){o(d)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})};function ENt(t,e){if(!t&&!e.auth)throw new Error("Parameter token or opts.auth is required");if(t&&e.auth)throw new Error("Parameters token and opts.auth may not both be specified");return typeof e.auth=="string"?e.auth:`token ${t}`}function bNt(t){return new LQe.HttpClient().getAgent(t)}function fNr(t){return new LQe.HttpClient().getAgentDispatcher(t)}function _Nt(t){let e=fNr(t);return(r,i)=>hNr(this,void 0,void 0,function*(){return(0,yNt.fetch)(r,Object.assign(Object.assign({},i),{dispatcher:e}))})}function xNt(){return process.env.GITHUB_API_URL||"https://api.github.com"}function FQe(t){var e;let n=(e=process.env.ACTIONS_ORCHESTRATION_ID)===null||e===void 0?void 0:e.trim();if(n){let i=`actions_orchestration_id/${n.replace(/[^a-z0-9_.-]/gi,"_")}`;return t?.includes(i)?t:`${t?`${t} `:""}${i}`}return t}p();p();function A1(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}p();p();function Xde(t,e,n,r){if(typeof n!="function")throw new Error("method for before hook must be a function");return r||(r={}),Array.isArray(e)?e.reverse().reduce((i,s)=>Xde.bind(null,t,s,i,r),n)():Promise.resolve().then(()=>t.registry[e]?t.registry[e].reduce((i,s)=>s.hook.bind(null,i,r),n)():n(r))}p();function SNt(t,e,n,r){let i=r;t.registry[n]||(t.registry[n]=[]),e==="before"&&(r=(s,o)=>Promise.resolve().then(i.bind(null,o)).then(s.bind(null,o))),e==="after"&&(r=(s,o)=>{let a;return Promise.resolve().then(s.bind(null,o)).then(c=>(a=c,i(a,o))).then(()=>a)}),e==="error"&&(r=(s,o)=>Promise.resolve().then(s.bind(null,o)).catch(a=>i(a,o))),t.registry[n].push({hook:r,orig:i})}p();function CNt(t,e,n){if(!t.registry[e])return;let r=t.registry[e].map(i=>i.orig).indexOf(n);r!==-1&&t.registry[e].splice(r,1)}var INt=Function.bind,wNt=INt.bind(INt);function TNt(t,e,n){let r=wNt(CNt,null).apply(null,n?[e,n]:[e]);t.api={remove:r},t.remove=r,["before","error","after","wrap"].forEach(i=>{let s=n?[e,i,n]:[e,i];t[i]=t.api[i]=wNt(SNt,null).apply(null,s)})}function ANr(){let t=Symbol("Singular"),e={registry:{}},n=Xde.bind(null,e,t);return TNt(n,e,t),n}function yNr(){let t={registry:{}},e=Xde.bind(null,t);return TNt(e,t),e}var vNt={Singular:ANr,Collection:yNr};p();p();var ENr="0.0.0-development",bNr=`octokit-endpoint.js/${ENr} ${A1()}`,_Nr={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":bNr},mediaType:{format:""}};function xNr(t){return t?Object.keys(t).reduce((e,n)=>(e[n.toLowerCase()]=t[n],e),{}):{}}function SNr(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);if(e===null)return!0;let n=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(t)}function BNt(t,e){let n=Object.assign({},t);return Object.keys(e).forEach(r=>{SNr(e[r])?r in t?n[r]=BNt(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}function RNt(t){for(let e in t)t[e]===void 0&&delete t[e];return t}function UQe(t,e,n){if(typeof e=="string"){let[i,s]=e.split(" ");n=Object.assign(s?{method:i,url:s}:{url:i},n)}else n=Object.assign({},e);n.headers=xNr(n.headers),RNt(n),RNt(n.headers);let r=BNt(t||{},n);return n.url==="/graphql"&&(t&&t.mediaType.previews?.length&&(r.mediaType.previews=t.mediaType.previews.filter(i=>!r.mediaType.previews.includes(i)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(i=>i.replace(/-preview/,""))),r}function CNr(t,e){let n=/\?/.test(t)?"&":"?",r=Object.keys(e);return r.length===0?t:t+n+r.map(i=>i==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${i}=${encodeURIComponent(e[i])}`).join("&")}var INr=/\{[^{}}]+\}/g;function wNr(t){return t.replace(/(?:^\W+)|(?:(?n.concat(r),[]):[]}function kNt(t,e){let n={__proto__:null};for(let r of Object.keys(t))e.indexOf(r)===-1&&(n[r]=t[r]);return n}function NNt(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}function K$(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function Sz(t,e,n){return e=t==="+"||t==="#"?NNt(e):K$(e),n?K$(n)+"="+e:e}function z$(t){return t!=null}function QQe(t){return t===";"||t==="&"||t==="?"}function vNr(t,e,n,r){var i=t[n],s=[];if(z$(i)&&i!=="")if(typeof i=="string"||typeof i=="number"||typeof i=="bigint"||typeof i=="boolean")i=i.toString(),r&&r!=="*"&&(i=i.substring(0,parseInt(r,10))),s.push(Sz(e,i,QQe(e)?n:""));else if(r==="*")Array.isArray(i)?i.filter(z$).forEach(function(o){s.push(Sz(e,o,QQe(e)?n:""))}):Object.keys(i).forEach(function(o){z$(i[o])&&s.push(Sz(e,i[o],o))});else{let o=[];Array.isArray(i)?i.filter(z$).forEach(function(a){o.push(Sz(e,a))}):Object.keys(i).forEach(function(a){z$(i[a])&&(o.push(K$(a)),o.push(Sz(e,i[a].toString())))}),QQe(e)?s.push(K$(n)+"="+o.join(",")):o.length!==0&&s.push(o.join(","))}else e===";"?z$(i)&&s.push(K$(n)):i===""&&(e==="&"||e==="?")?s.push(K$(n)+"="):i===""&&s.push("");return s}function RNr(t){return{expand:kNr.bind(null,t)}}function kNr(t,e){var n=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(r,i,s){if(i){let a="",c=[];if(n.indexOf(i.charAt(0))!==-1&&(a=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(u){var l=/([^:\*]*)(?::(\d+)|(\*))?/.exec(u);c.push(vNr(e,a,l[1],l[2]||l[3]))}),a&&a!=="+"){var o=",";return a==="?"?o="&":a!=="#"&&(o=a),(c.length!==0?a:"")+c.join(o)}else return c.join(",")}else return NNt(s)}),t==="/"?t:t.replace(/\/$/,"")}function DNt(t){let e=t.method.toUpperCase(),n=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),r=Object.assign({},t.headers),i,s=kNt(t,["method","baseUrl","url","headers","request","mediaType"]),o=TNr(n);n=RNr(n).expand(s),/^http/.test(n)||(n=t.baseUrl+n);let a=Object.keys(t).filter(l=>o.includes(l)).concat("baseUrl"),c=kNt(s,a);if(!/application\/octet-stream/i.test(r.accept)&&(t.mediaType.format&&(r.accept=r.accept.split(/,/).map(l=>l.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&t.mediaType.previews?.length)){let l=r.accept.match(/(?{let m=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${m}`}).join(",")}return["GET","HEAD"].includes(e)?n=CNr(n,c):"data"in c?i=c.data:Object.keys(c).length&&(i=c),!r["content-type"]&&typeof i<"u"&&(r["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof i>"u"&&(i=""),Object.assign({method:e,url:n,headers:r},typeof i<"u"?{body:i}:null,t.request?{request:t.request}:null)}function BNr(t,e,n){return DNt(UQe(t,e,n))}function PNt(t,e){let n=UQe(t,e),r=BNr.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:PNt.bind(null,n),merge:UQe.bind(null,n),parse:DNt})}var MNt=PNt(null,_Nr);var ZNt=Ot($Nt(),1);p();var GNr=/^-?\d+$/,tpe=/^-?\d+n+$/,y1=JSON.stringify,HQe=JSON.parse,VNt=/^-?\d+n$/,WNt=/([\[:])?"(-?\d+)n"($|\s*[,\}\]])/g,HNt=/([\[:])?("-?\d+n+)n("$|"\s*[,\}\]])/g,qQe=t=>t===void 0||typeof t=="function"||typeof t=="symbol",jQe=t=>t!==null&&typeof t=="object"&&t.constructor&&t.constructor.name==="RawJSON",$Nr=(t,e,n)=>{let r="";typeof n=="number"?r=" ".repeat(Math.min(10,Math.max(0,Math.floor(n)))):typeof n=="string"&&(r=n.slice(0,10));let i=typeof e=="function",s=Array.isArray(e)?new Set(e.map(String)):null,o=(f,g,A)=>(A!==null&&typeof A=="object"&&typeof A.toJSON=="function"&&(A=A.toJSON(g)),typeof A=="string"&&tpe.test(A)?A+"n":typeof A=="bigint"?"rawJSON"in JSON?JSON.rawJSON(A.toString()):A.toString()+"n":(i&&(A=e.call(f,g,A)),A!==null&&typeof A=="object"&&(A instanceof Number||A instanceof String||A instanceof Boolean)&&(A=A.valueOf()),A)),a=o({"":t},"",t);if(qQe(a))return;let c=a===null||typeof a!="object",u=jQe(a);if(c||u)return y1(a);let l=[],d=0,m=[{parent:{"":a},key:"",val:a,isArray:Array.isArray(a),keys:Array.isArray(a)?null:Object.keys(a),index:0,first:!0}],h=new WeakSet([a]);for(;m.length>0;){let f=m[m.length-1];f.index===0&&(l.push(f.isArray?"[":"{"),d++);let g=!1;if(f.isArray)if(f.index=f.keys.length&&m[m.length-1]===f&&(g=!0)}g&&(d--,!f.first&&r&&l.push(` +`+r.repeat(d)),l.push(f.isArray?"]":"}"),h.delete(f.val),m.pop())}return l.join("")},YNt=(t,e,n)=>{try{return"rawJSON"in JSON?y1(t,(a,c)=>typeof c=="bigint"?JSON.rawJSON(c.toString()):typeof e=="function"?e(a,c):(Array.isArray(e)&&e.includes(a),c),n):t?y1(t,(a,c)=>typeof c=="string"&&tpe.test(c)||typeof c=="bigint"?c.toString()+"n":typeof e=="function"?e(a,c):(Array.isArray(e)&&e.includes(a),c),n).replace(WNt,"$1$2$3").replace(HNt,"$1$2$3"):y1(t,e,n)}catch(r){if(r instanceof RangeError){let i=$Nr(t,e,n);return i===void 0?void 0:"rawJSON"in JSON?i:i.replace(WNt,"$1$2$3").replace(HNt,"$1$2$3")}throw r}},epe=new Map,WNr=()=>{let t=JSON.parse.toString();if(epe.has(t))return epe.get(t);try{let e=JSON.parse("1",(n,r,i)=>!!i?.source&&i.source==="1");return epe.set(t,e),e}catch{return epe.set(t,!1),!1}},HNr=(t,e,n,r)=>typeof e=="string"&&VNt.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&tpe.test(e)?e.slice(0,-1):typeof r=="function"?r(t,e,n):e,qNr=(t,e)=>JSON.parse(t,(n,r,i)=>{let s=typeof r=="number",o=r>Number.MAX_SAFE_INTEGER||r{let n={"":t},r=[{parent:n,key:"",visited:!1}];for(;r.length>0;){let i=r[r.length-1];if(i.visited){let{parent:s,key:o}=i,a=s[o];typeof a=="string"&&(VNt.test(a)?a=BigInt(a.slice(0,-1)):tpe.test(a)&&(a=a.slice(0,-1))),typeof e=="function"&&(a=e.call(s,o,a)),a===void 0?delete s[o]:s[o]=a,r.pop()}else{i.visited=!0;let s=i.parent[i.key];if(s!==null&&typeof s=="object"){let a=Object.keys(s);for(let c=a.length-1;c>=0;c--)r.push({parent:s,key:a[c],visited:!1})}}}return n[""]},jNt=t=>t.replace(jNr,(e,n,r,i)=>{let s=e[0]==='"';if(s&&VNr.test(e))return e.substring(0,e.length-1)+'n"';let a=r||i,c=n&&(n.length{if(!t)return HQe(t,e);try{if(WNr())return qNr(t,e);let n=jNt(t);return HQe(n,(r,i,s)=>HNr(r,i,s,e))}catch(n){if(n instanceof RangeError){let r=jNt(t),i=HQe(r);return YNr(i,e)}throw n}};p();var eO=class extends Error{name;status;request;response;constructor(e,n,r){super(e,{cause:r.cause}),this.name="HttpError",this.status=Number.parseInt(n),Number.isNaN(this.status)&&(this.status=0);"response"in r&&(this.response=r.response);let i=Object.assign({},r.request);r.request.headers.authorization&&(i.headers=Object.assign({},r.request.headers,{authorization:r.request.headers.authorization.replace(/(?"";async function XNt(t){let e=t.request?.fetch||globalThis.fetch;if(!e)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let n=t.request?.log||console,r=t.request?.parseSuccessResponseBody!==!1,i=JNr(t.body)||Array.isArray(t.body)?YNt(t.body):t.body,s=Object.fromEntries(Object.entries(t.headers).map(([d,m])=>[d,String(m)])),o;try{o=await e(t.url,{method:t.method,body:i,redirect:t.request?.redirect,headers:s,signal:t.request?.signal,...t.body&&{duplex:"half"}})}catch(d){let m="Unknown Error";if(d instanceof Error){if(d.name==="AbortError")throw d.status=500,d;m=d.message,d.name==="TypeError"&&"cause"in d&&(d.cause instanceof Error?m=d.cause.message:typeof d.cause=="string"&&(m=d.cause))}let h=new eO(m,500,{request:t});throw h.cause=d,h}let a=o.status,c=o.url,u={};for(let[d,m]of o.headers)u[d]=m;let l={url:c,status:a,headers:u,data:""};if("deprecation"in u){let d=u.link&&u.link.match(/<([^<>]+)>; rel="deprecation"/),m=d&&d.pop();n.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${u.sunset}${m?`. See ${m}`:""}`)}if(a===204||a===205)return l;if(t.method==="HEAD"){if(a<400)return l;throw new eO(o.statusText,a,{response:l,request:t})}if(a===304)throw l.data=await VQe(o),new eO("Not modified",a,{response:l,request:t});if(a>=400)throw l.data=await VQe(o),new eO(ZNr(l.data),a,{response:l,request:t});return l.data=r?await VQe(o):o.body,l}async function VQe(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(JNt);let n=(0,ZNt.parse)(e);if(XNr(n)){let r="";try{return r=await t.text(),KNt(r)}catch{return r}}else return n.type.startsWith("text/")||n.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(JNt):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}function XNr(t){return t.type==="application/json"||t.type==="application/scim+json"}function ZNr(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return"Unknown error";if(typeof t=="object"&&t!==null&&"message"in t){let e=t,n="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(r=>JSON.stringify(r)).join(", ")}${n}`:`${e.message}${n}`}return`Unknown error: ${JSON.stringify(t)}`}function YQe(t,e){let n=t.defaults(e);return Object.assign(function(i,s){let o=n.merge(i,s);if(!o.request||!o.request.hook)return XNt(n.parse(o));let a=(c,u)=>XNt(n.parse(n.merge(c,u)));return Object.assign(a,{endpoint:n,defaults:YQe.bind(null,n)}),o.request.hook(a,o)},{endpoint:n,defaults:YQe.bind(null,n)})}var Cz=YQe(MNt,KNr);p();var eDr="0.0.0-development";function tDr(t){return`Request failed due to following response errors: +`+t.errors.map(e=>` - ${e.message}`).join(` +`)}var nDr=class extends Error{constructor(t,e,n){super(tDr(n)),this.request=t,this.headers=e,this.response=n,this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name="GraphqlResponseError";errors;data},rDr=["method","baseUrl","url","headers","request","query","mediaType","operationName"],iDr=["query","method","url"],eDt=/\/api\/v3\/?$/;function sDr(t,e,n){if(n){if(typeof e=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let o in n)if(iDr.includes(o))return Promise.reject(new Error(`[@octokit/graphql] "${o}" cannot be used as variable name`))}let r=typeof e=="string"?Object.assign({query:e},n):e,i=Object.keys(r).reduce((o,a)=>rDr.includes(a)?(o[a]=r[a],o):(o.variables||(o.variables={}),o.variables[a]=r[a],o),{}),s=r.baseUrl||t.endpoint.DEFAULTS.baseUrl;return eDt.test(s)&&(i.url=s.replace(eDt,"/api/graphql")),t(i).then(o=>{if(o.data.errors){let a={};for(let c of Object.keys(o.headers))a[c]=o.headers[c];throw new nDr(i,a,o.data)}return o.data.data})}function zQe(t,e){let n=t.defaults(e);return Object.assign((i,s)=>sDr(n,i,s),{defaults:zQe.bind(null,n),endpoint:n.endpoint})}var bMs=zQe(Cz,{headers:{"user-agent":`octokit-graphql.js/${eDr} ${A1()}`},method:"POST",url:"/graphql"});function tDt(t){return zQe(t,{method:"POST",url:"/graphql"})}p();var KQe="(?:[a-zA-Z0-9_-]+)",nDt="\\.",rDt=new RegExp(`^${KQe}${nDt}${KQe}${nDt}${KQe}$`),oDr=rDt.test.bind(rDt);async function aDr(t){let e=oDr(t),n=t.startsWith("v1.")||t.startsWith("ghs_"),r=t.startsWith("ghu_");return{type:"token",token:t,tokenType:e?"app":n?"installation":r?"user-to-server":"oauth"}}function cDr(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}async function lDr(t,e,n,r){let i=e.endpoint.merge(n,r);return i.headers.authorization=cDr(t),e(i)}var iDt=function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(aDr.bind(null,e),{hook:lDr.bind(null,e)})};p();var JQe="7.0.6";var sDt=()=>{},uDr=console.warn.bind(console),dDr=console.error.bind(console);function pDr(t={}){return typeof t.debug!="function"&&(t.debug=sDt),typeof t.info!="function"&&(t.info=sDt),typeof t.warn!="function"&&(t.warn=uDr),typeof t.error!="function"&&(t.error=dDr),t}var oDt=`octokit-core.js/${JQe} ${A1()}`,npe=class{static VERSION=JQe;static defaults(e){return class extends this{constructor(...r){let i=r[0]||{};if(typeof e=="function"){super(e(i));return}super(Object.assign({},e,i,i.userAgent&&e.userAgent?{userAgent:`${i.userAgent} ${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let n=this.plugins;return class extends this{static plugins=n.concat(e.filter(i=>!n.includes(i)))}}constructor(e={}){let n=new vNt.Collection,r={baseUrl:Cz.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(r.headers["user-agent"]=e.userAgent?`${e.userAgent} ${oDt}`:oDt,e.baseUrl&&(r.baseUrl=e.baseUrl),e.previews&&(r.mediaType.previews=e.previews),e.timeZone&&(r.headers["time-zone"]=e.timeZone),this.request=Cz.defaults(r),this.graphql=tDt(this.request).defaults(r),this.log=pDr(e.log),this.hook=n,e.authStrategy){let{authStrategy:s,...o}=e,a=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:o},e.auth));n.wrap("request",a.hook),this.auth=a}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{let s=iDt(e.auth);n.wrap("request",s.hook),this.auth=s}let i=this.constructor;for(let s=0;s({async next(){if(!a)return{done:!0};try{let c=await i({method:s,url:a,headers:o}),u=yDr(c);if(a=((u.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!a&&"total_commits"in u.data){let l=new URL(u.url),d=l.searchParams,m=parseInt(d.get("page")||"1",10),h=parseInt(d.get("per_page")||"250",10);m*h{if(i.done)return e;let s=!1;function o(){s=!0}return e=e.concat(r?r(i.value,o):i.value.data),s?e:lDt(t,e,n,r)})}var zMs=Object.assign(cDt,{iterator:tUe});function nUe(t){return{paginate:Object.assign(cDt.bind(null,t),{iterator:tUe.bind(null,t)})}}nUe.VERSION=ADr;var tOs=new Y$,rUe=xNt(),EDr={baseUrl:rUe,request:{agent:bNt(rUe),fetch:_Nt(rUe)}},uDt=npe.plugin(eUe,nUe).defaults(EDr);function dDt(t,e){let n=Object.assign({},e||{}),r=ENt(t,n);r&&(n.auth=r);let i=FQe(n.userAgent);return i&&(n.userAgent=i),n}var k_=new Y$;function pDt(t,e,...n){let r=uDt.plugin(...n);return new r(dDt(t,e))}p();p();var Bo=Ot(WVt(),1),B3e=Ot(Y1(),1);p();var iYt=Ot(require("net"),1),sYt=Ot(require("tls"),1),oYt=Ot(pB(),1),aYt=require("events");p();var tYt=Ot(require("net"),1),nYt=Ot(require("http"),1),rYt=require("https");p();var zC=Symbol("AgentBaseInternalState"),_H=class extends nYt.Agent{constructor(e){super(e),this[zC]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(` +`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let n=new tYt.Socket({writable:!1});return this.sockets[e].push(n),this.totalSocketCount++,n}decrementSockets(e,n){if(!this.sockets[e]||n===null)return;let r=this.sockets[e],i=r.indexOf(n);i!==-1&&(r.splice(i,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?rYt.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,n,r){let i={...n,secureEndpoint:this.isSecureEndpoint(n)},s=this.getName(i),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(a=>{if(this.decrementSockets(s,o),typeof a.addRequest=="function")try{return a.addRequest(e,i)}catch(c){return r(c)}this[zC].currentSocket=a,super.createSocket(e,n,r)},a=>{this.decrementSockets(s,o),r(a)})}createConnection(){let e=this[zC].currentSocket;if(this[zC].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[zC].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[zC]&&(this[zC].defaultPort=e)}get protocol(){return this[zC].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[zC]&&(this[zC].protocol=e)}};var d3e=require("url");p();function nAe(){return async({response:t,scheme:e})=>{if(e.toLowerCase()!=="negotiate")throw new Error(`Expected Negotiate scheme but got "${e}"`);let n;try{n=await import("kerberos")}catch{throw new Error('The "kerberos" package is required for Negotiate proxy authentication. Install it with: npm install kerberos')}let r=t.headers["proxy-authenticate"]||"",i=Array.isArray(r)?r[0]:r,s=typeof i=="string"&&i.includes(" ")?i.split(" ").slice(1).join(" "):void 0,a=await(await n.initializeClient("HTTP@proxy",{mechOID:n.GSS_MECH_OID_SPNEGO})).step(s||"");if(!a)throw new Error("Kerberos client.step() returned no token");return{headers:{"Proxy-Authorization":`Negotiate ${a}`}}}}var xH=(0,oYt.default)("http-proxy-agent"),YK=class extends _H{constructor(e,n){super(n),this.proxy=typeof e=="string"?new d3e.URL(e):e,this.proxyHeaders=n?.headers??{},xH("Creating new HttpProxyAgent instance: %o",this.proxy.href),n?.negotiate?this.onProxyAuth=nAe():n?.onProxyAuth&&(this.onProxyAuth=n.onProxyAuth);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...n?WYr(n,"headers","onProxyAuth","negotiate"):null,host:r,port:i}}addRequest(e,n){e._header=null,this.setRequestProps(e,n),super.addRequest(e,n)}setRequestProps(e,n){let{proxy:r}=this,i=n.secureEndpoint?"https:":"http:",s=e.getHeader("host")||"localhost",o=`${i}//${s}`,a=new d3e.URL(e.path,o);n.port!==80&&(a.port=String(n.port)),e.path=String(a);let c=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let u=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;c["Proxy-Authorization"]=`Basic ${Buffer.from(u).toString("base64")}`}c["Proxy-Connection"]||(c["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let u of Object.keys(c)){let l=c[u];l&&e.setHeader(u,l)}}async connect(e,n){e._header=null,e.path.includes("://")||this.setRequestProps(e,n);let r,i;xH("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(xH("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,i=r.indexOf(`\r +\r +`)+4,e.outputData[0].data=e._header+r.substring(i),xH("Output buffer: %o",e.outputData[0].data));let s;this.proxy.protocol==="https:"?(xH("Creating `tls.Socket`: %o",this.connectOpts),s=sYt.connect(this.connectOpts)):(xH("Creating `net.Socket`: %o",this.connectOpts),s=iYt.connect(this.connectOpts)),await(0,aYt.once)(s,"connect");let o={socket:s};return e.emit("proxyConnect",o),this.emit("proxyConnect",o,e),e.emit("proxy",{proxy:this.proxy.href,socket:s}),s}};YK.protocols=["http","https"];function WYr(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}p();var KC=Ot(require("net"),1),zK=Ot(require("tls"),1),uYt=Ot(require("assert"),1),dYt=Ot(pB(),1);var pYt=require("url");p();var cYt=Ot(pB(),1),rAe=(0,cYt.default)("https-proxy-agent:parse-proxy-response");function p3e(t){return new Promise((e,n)=>{let r=0,i=[];function s(){let l=t.read();l?u(l):t.once("readable",s)}function o(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("readable",s)}function a(){o(),rAe("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(l){o(),rAe("onerror %o",l),n(l)}function u(l){i.push(l),r+=l.length;let d=Buffer.concat(i,r),m=d.indexOf(`\r +\r +`);if(m===-1){rAe("have not received end of HTTP headers yet..."),s();return}let h=d.slice(0,m).toString("ascii").split(`\r +`),f=h.shift();if(!f)return t.destroy(),n(new Error("No header received from proxy CONNECT response"));let g=f.split(" "),A=+g[1],y=g.slice(2).join(" "),E={};for(let _ of h){if(!_)continue;let S=_.indexOf(":");if(S===-1)return t.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${_}"`));let C=_.slice(0,S).toLowerCase(),I=_.slice(S+1).trimStart(),w=E[C];typeof w=="string"?E[C]=[w,I]:Array.isArray(w)?w.push(I):E[C]=I}rAe("got proxy server response: %o %o",f,E),o(),e({connect:{statusCode:A,statusText:y,headers:E},buffered:d})}t.on("error",c),t.on("end",a),s()})}var WO=(0,dYt.default)("https-proxy-agent"),iAe=t=>t.servername===void 0&&t.host&&!KC.isIP(t.host)?{...t,servername:t.host}:t,KK=class extends _H{constructor(e,n){super(n),this.options={path:void 0},this.proxy=typeof e=="string"?new pYt.URL(e):e,this.proxyHeaders=n?.headers??{},WO("Creating new HttpsProxyAgent instance: %o",this.proxy.href),n?.negotiate?this.onProxyAuth=nAe():n?.onProxyAuth&&(this.onProxyAuth=n.onProxyAuth);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?m3e(n,"headers","onProxyAuth","negotiate"):null,host:r,port:i}}async connect(e,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let i;r.protocol==="https:"?(WO("Creating `tls.Socket`: %o",this.connectOpts),i=zK.connect(iAe(this.connectOpts))):(WO("Creating `net.Socket`: %o",this.connectOpts),i=KC.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=KC.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${o}:${n.port} HTTP/1.1\r +`;if(r.username||r.password){let m=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(m).toString("base64")}`}s.Host=`${o}:${n.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let m of Object.keys(s))a+=`${m}: ${s[m]}\r +`;let c=p3e(i);i.write(`${a}\r +`);let{connect:u,buffered:l}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),e.emit("proxy",{proxy:this.proxy.href,socket:i}),u.statusCode===200)return e.once("socket",lYt),n.secureEndpoint?(WO("Upgrading socket connection to TLS"),zK.connect({...m3e(iAe(n),"host","path","port"),socket:i})):i;if(u.statusCode===407&&this.onProxyAuth){WO("Got 407 response, invoking onProxyAuth callback"),i.destroy();let m=u.headers["proxy-authenticate"]||"",h=Array.isArray(m)?m[0].split(/\s/)[0]:m.split(/\s/)[0],f=await this.onProxyAuth({response:u,scheme:h});return this._connectWithAuth(e,n,f.headers)}i.destroy();let d=new KC.Socket({writable:!1});return d.readable=!0,e.once("socket",m=>{WO("Replaying proxy buffer for failed request"),(0,uYt.default)(m.listenerCount("data")>0),m.push(l),m.push(null)}),d}async _connectWithAuth(e,n,r){let{proxy:i}=this,s;i.protocol==="https:"?s=zK.connect(iAe(this.connectOpts)):s=KC.connect(this.connectOpts);let o=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=KC.isIPv6(n.host)?`[${n.host}]`:n.host,c=`CONNECT ${a}:${n.port} HTTP/1.1\r +`;if(i.username||i.password){let d=`${decodeURIComponent(i.username)}:${decodeURIComponent(i.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}Object.assign(o,r),o.Host=`${a}:${n.port}`,o["Proxy-Connection"]||(o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(o))c+=`${d}: ${o[d]}\r +`;let u=p3e(s);s.write(`${c}\r +`);let{connect:l}=await u;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200)return e.once("socket",lYt),n.secureEndpoint?(WO("Upgrading socket connection to TLS"),zK.connect({...m3e(iAe(n),"host","path","port"),socket:s})):s;throw s.destroy(),new Error(`Proxy authentication failed with status ${l.statusCode} after retry`)}};KK.protocols=["http","https"];function lYt(t){setImmediate(()=>{t.resume()})}function m3e(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}ni();qO();ev();eA();T0();tv();w3e();cx();tI();Cy();Nf();nI();rI();jO();var P3e="",DYt="[Reasoning redacted]",CH=(t,e,n={})=>{let r=new Rc,i=ZC(e);return(async()=>{let s={role:"assistant",content:[],api:"bedrock-converse-stream",provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()},o=s.content,a=n.profile||n.env?.AWS_PROFILE,c={profile:a||vi("AWS_PROFILE",n.env)},u=QYt(n),l=!!vi("AWS_PROFILE"),d=UYt(t.baseUrl),m=a6r(t.baseUrl,u,l);m&&(c.endpoint=t.baseUrl);let h=vi("AWS_BEDROCK_SKIP_AUTH",n.env)==="1",f=n.bearerToken||n.apiKey||vi("AWS_BEARER_TOKEN_BEDROCK",n.env)||void 0,g=f!==void 0&&!h;if(typeof process<"u"&&(process.versions?.node||process.versions?.bun)){let y=t.id.match(/^arn:aws(?:-[a-z0-9-]+)?:bedrock:([a-z0-9-]+):/);y?c.region=y[1]:u?c.region=u:d&&m?c.region=d:l||(c.region="us-east-1"),h&&(c.credentials={accessKeyId:"dummy-access-key",secretAccessKey:"dummy-secret-key"});let E=o6r(n.env);!h&&E&&!a&&(c.credentials=E);let _=AAe(t.baseUrl,n.env);_?c.requestHandler=new B3e.NodeHttpHandler({httpAgent:new YK(_),httpsAgent:new KK(_)}):vi("AWS_BEDROCK_FORCE_HTTP1",n.env)==="1"&&(c.requestHandler=new B3e.NodeHttpHandler)}else c.region=u||(d&&m?d:void 0)||"us-east-1";g&&(c.token={token:f},c.authSchemePreference=["httpBearerAuth"]);let A;try{let y=t.compat?.supportsStrictMode??!1,E=new Bo.BedrockRuntimeClient(c),_=!1;n.onResponse&&q9r(E,n.onResponse,t,()=>{_=!0});let S=eI(n.headers);S&&$9r(E,S);let C=X9r(n.cacheRetention,n.env),I=n.maxTokens??(SAe(t)?t.maxTokens:void 0),w=Iy(i.messages),k=w?kc(w):void 0,N={modelId:t.id,messages:r6r(i,t,C,n.env),system:e6r(k,t,C,n.env),inferenceConfig:{...I!==void 0&&{maxTokens:I},...n.temperature!==void 0&&{temperature:n.temperature}},toolConfig:i6r(Nm(i.messages),n.toolChoice,y),additionalModelRequestFields:l6r(t,n),...n.requestMetadata!==void 0&&{requestMetadata:n.requestMetadata}},O=await n?.onPayload?.(N,t);O!==void 0&&(N=O);let W=new Bo.ConverseStreamCommand(N),$=await E.send(W,{abortSignal:n.signal});if(A=M3e($.$metadata.requestId),!_&&$.$metadata.httpStatusCode!==void 0){let G={};$.$metadata.requestId&&(G["x-amzn-requestid"]=$.$metadata.requestId),await n?.onResponse?.({status:$.$metadata.httpStatusCode,headers:G},t)}for await(let G of $.stream)if(G.messageStart){if(G.messageStart.role!==Bo.ConversationRole.ASSISTANT)throw new Error("Unexpected assistant message start but got user message start instead");r.push({type:"start",partial:s})}else if(G.contentBlockStart)j9r(G.contentBlockStart,o,s,r);else if(G.contentBlockDelta)V9r(G.contentBlockDelta,o,s,r);else if(G.contentBlockStop)z9r(G.contentBlockStop,o,s,r);else if(G.messageStop){s.rawStopReason=G.messageStop.stopReason;let{stopReason:q,errorMessage:ce}=s6r(G.messageStop.stopReason);s.stopReason=q,ce&&(s.errorMessage=ce)}else if(G.metadata)Y9r(G.metadata,t,s);else{if(G.internalServerException)throw G.internalServerException;if(G.modelStreamErrorException)throw G.modelStreamErrorException;if(G.validationException)throw G.validationException;if(G.throttlingException)throw G.throttlingException;if(G.serviceUnavailableException)throw G.serviceUnavailableException}if(n.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="pending")throw new Error("Bedrock stream ended without a stop reason");if(s.stopReason==="error"||s.stopReason==="aborted")throw new Error(s.errorMessage||"An unknown error occurred");for(let G of s.content)PYt(G);r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(y){for(let E of s.content)PYt(E);s.stopReason=n.signal?.aborted?"aborted":"error",s.errorMessage=O9r(y),s.stopReason==="error"&&Q9r(s,y,A),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},P9r={InternalServerException:"Internal server error",ModelStreamErrorException:"Model stream error",ValidationException:"Validation error",ThrottlingException:"Throttling error",ServiceUnavailableException:"Service unavailable"},M9r="https://docs.aws.amazon.com/bedrock/latest/userguide/data-retention.html";function O9r(t){let e=Rh(t),n=!e.messageCarriesBody&&e.status!==void 0&&e.body!==void 0?`${e.status}: ${e.body}`:e.message,r=/data retention mode/i.test(n)?` See ${M9r} for supported data retention modes.`:"";return t instanceof Bo.BedrockRuntimeServiceException?`${P9r[t.name]??t.name}: ${n}${r}`:`${n}${r}`}var L9r=200;function M3e(t){if(typeof t!="string")return;let e=t.trim();if(!(e.length===0||e.length>L9r))return e}function F9r(t){if(!(!(t instanceof Error)||!t.name.endsWith("Exception")))return M3e(t.name)}function Q9r(t,e,n){let r=e?.$metadata,i={};typeof r?.httpStatusCode=="number"&&(i.status=r.httpStatusCode);let s=F9r(e);s!==void 0&&(i.errorCode=s);let o=M3e(r?.requestId)??n;o!==void 0&&(i.requestId=o),Object.keys(i).length!==0&&JC(t,{type:"bedrock_response_failure",timestamp:Date.now(),details:i})}var U9r=new Set(["authorization","host"]);function G9r(t){let e=t.toLowerCase();return e.startsWith("x-amz-")||U9r.has(e)}function $9r(t,e){let n=r=>async i=>{let s=i.request;if(s&&typeof s=="object"&&"headers"in s){let o=s.headers;for(let[a,c]of Object.entries(e))G9r(a)||(o[a]=c)}return r(i)};t.middlewareStack.add(n,{step:"build",name:"pi-ai-custom-headers",priority:"low"})}function W9r(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.statusCode=="number"&&!!e.headers&&typeof e.headers=="object"}function H9r(t){if(W9r(t))return{status:t.statusCode,headers:{...t.headers}}}function q9r(t,e,n,r){let i=s=>async o=>{let a=await s(o),c=H9r(a.response);return c&&(r(),await e(c,n)),a};t.middlewareStack.add(i,{step:"deserialize",name:"pi-ai-response-headers"})}var OYt=(t,e,n)=>{let r={...Wp(t,e,n,void 0),toolChoice:n?.toolChoice};if(!n?.reasoning)return CH(t,e,{...r,reasoning:void 0});if(SAe(t)){if(N3e(t.id,t.name))return CH(t,e,{...r,reasoning:n.reasoning,thinkingBudgets:n.thinkingBudgets});let i=_Ae(r.maxTokens,t.maxTokens,n.reasoning,n.thinkingBudgets),s=oJ(t,e,i.maxTokens);return CH(t,e,{...r,maxTokens:s,reasoning:n.reasoning,thinkingBudgets:{...n.thinkingBudgets||{},[v3e(n.reasoning)]:Math.min(i.thinkingBudget,Math.max(0,s-1024))}})}return CH(t,e,{...r,reasoning:n.reasoning,thinkingBudgets:n.thinkingBudgets})};function j9r(t,e,n,r){let i=t.contentBlockIndex,s=t.start;if(s?.toolUse){let o={type:"toolCall",id:s.toolUse.toolUseId||"",name:s.toolUse.name||"",arguments:{},partialJson:"",index:i};n.content.push(o),r.push({type:"toolcall_start",contentIndex:e.length-1,partial:n})}}function V9r(t,e,n,r){let i=t.contentBlockIndex,s=t.delta,o=e.findIndex(c=>c.index===i),a=e[o];if(s?.text!==void 0){if(!a){let c={type:"text",text:"",index:i};n.content.push(c),o=e.length-1,a=e[o],r.push({type:"text_start",contentIndex:o,partial:n})}a.type==="text"&&(a.text+=s.text,r.push({type:"text_delta",contentIndex:o,delta:s.text,partial:n}))}else if(s?.toolUse&&a?.type==="toolCall")a.partialJson=(a.partialJson||"")+(s.toolUse.input||""),a.arguments=ec(a.partialJson),r.push({type:"toolcall_delta",contentIndex:o,delta:s.toolUse.input||"",partial:n});else if(s?.reasoningContent){let c=a,u=o;if(!c){let l={type:"thinking",thinking:"",thinkingSignature:"",index:i};n.content.push(l),u=e.length-1,c=e[u],r.push({type:"thinking_start",contentIndex:u,partial:n})}c?.type==="thinking"&&(s.reasoningContent.text&&(c.thinking+=s.reasoningContent.text,r.push({type:"thinking_delta",contentIndex:u,delta:s.reasoningContent.text,partial:n})),s.reasoningContent.signature&&!c.redacted&&(c.thinkingSignature=(c.thinkingSignature||"")+s.reasoningContent.signature),s.reasoningContent.redactedContent?.length&&(c.redacted||(c.redacted=!0,c.thinkingSignature="",c.thinking+=DYt,r.push({type:"thinking_delta",contentIndex:u,delta:DYt,partial:n})),c.redactedChunks??=[],c.redactedChunks.push(s.reasoningContent.redactedContent)))}}function LYt(t){t.type!=="thinking"||!t.redactedChunks||(t.thinkingSignature=d6r(t.redactedChunks),delete t.redactedChunks)}function PYt(t){delete t.index,delete t.partialJson,LYt(t)}function Y9r(t,e,n){t.usage&&(n.usage.input=t.usage.inputTokens||0,n.usage.output=t.usage.outputTokens||0,n.usage.cacheRead=t.usage.cacheReadInputTokens||0,n.usage.cacheWrite=t.usage.cacheWriteInputTokens||0,n.usage.cacheWrite1h=t.usage.cacheDetails?.reduce((r,i)=>r+(i.ttl===Bo.CacheTTL.ONE_HOUR?i.inputTokens??0:0),0),n.usage.totalTokens=t.usage.totalTokens||n.usage.input+n.usage.output,$p(e,n.usage))}function z9r(t,e,n,r){let i=e.findIndex(o=>o.index===t.contentBlockIndex),s=e[i];if(s)switch(delete s.index,s.type){case"text":r.push({type:"text_end",contentIndex:i,content:s.text,partial:n});break;case"thinking":LYt(s),r.push({type:"thinking_end",contentIndex:i,content:s.thinking,partial:n});break;case"toolCall":s.arguments=ec(s.partialJson),delete s.partialJson,r.push({type:"toolcall_end",contentIndex:i,toolCall:s,partial:n});break}}function O3e(t,e){return(e?[t,e]:[t]).flatMap(r=>{let i=r.toLowerCase();return[i,i.replace(/[\s_.:]+/g,"-")]})}function N3e(t,e){return O3e(t,e).some(r=>r.includes("opus-4-6")||r.includes("opus-4-7")||r.includes("opus-4-8")||r.includes("opus-5")||r.includes("sonnet-4-6")||r.includes("sonnet-5")||r.includes("fable-5"))}function K9r(t){return O3e(t.id,t.name).some(n=>n.includes("opus-4-7")||n.includes("opus-4-8")||n.includes("opus-5")||n.includes("sonnet-5")||n.includes("fable-5"))}function J9r(t,e){if(e==="xhigh"&&K9r(t))return"xhigh";let n=e?t.thinkingLevelMap?.[e]:void 0;if(typeof n=="string")return n;switch(e){case"minimal":case"low":return"low";case"medium":return"medium";case"high":return"high";default:return"high"}}function X9r(t,e){return t||(vi("PI_CACHE_RETENTION",e)==="long"?"long":"short")}function SAe(t){let e=t.id.toLowerCase(),n=t.name?.toLowerCase()??"";return e.includes("anthropic.claude")||e.includes("anthropic/claude")||n.includes("anthropic.claude")||n.includes("anthropic/claude")||n.includes("claude")}function FYt(t,e){let n=O3e(t.id,t.name);return n.some(i=>i.includes("claude"))?!!(n.some(i=>i.includes("fable-5")||i.includes("opus-5")||i.includes("sonnet-5"))||n.some(i=>i.includes("-4-"))||n.some(i=>i.includes("claude-3-7-sonnet"))||n.some(i=>i.includes("claude-3-5-haiku"))):vi("AWS_BEDROCK_FORCE_CACHE",e)==="1"}function Z9r(t){return SAe(t)}function e6r(t,e,n,r){if(!t)return;let i=[{text:ri(t)}];return n!=="none"&&FYt(e,r)&&i.push({cachePoint:{type:Bo.CachePointType.DEFAULT,...n==="long"?{ttl:Bo.CacheTTL.ONE_HOUR}:{}}}),i}function t6r(t){let e=t.replace(/[^a-zA-Z0-9_-]/g,"_");return e.length>64?e.slice(0,64):e}function xAe(t){let e=ri(t);return e.trim().length===0?void 0:{text:e}}function n6r(t){return xAe(t)??{text:P3e}}function D3e(t){return Array.isArray(t)?t.map(D3e):t!==null&&typeof t=="object"?Object.fromEntries(Object.entries(t).filter(([e])=>e.length>0).map(([e,n])=>[e,D3e(n)])):t}function MYt(t){let e=[];for(let n of t)if(n.type==="image")e.push({image:GYt(n.mimeType,n.data)});else{let r=xAe(n.text);r&&e.push(r)}return e.length===0&&e.push({text:P3e}),e}function r6r(t,e,n,r){let i=[],s=k0(tJ(t.messages),e,t6r);for(let o=0;o0){let o=i[i.length-1];o.role===Bo.ConversationRole.USER&&o.content&&o.content.push({cachePoint:{type:Bo.CachePointType.DEFAULT,...n==="long"?{ttl:Bo.CacheTTL.ONE_HOUR}:{}}})}return i}function i6r(t,e,n){if(!t?.length||e==="none")return;let r=t.map(s=>{let o=wy(s,n);return{toolSpec:{name:s.name,description:s.description,inputSchema:{json:v0(s,o)},...o===!0?{strict:!0}:{}}}}),i;switch(e){case"auto":i={auto:{}};break;case"any":i={any:{}};break;default:e?.type==="tool"&&(i={tool:{name:e.name}})}return{tools:r,toolChoice:i}}function s6r(t){switch(t){case Bo.StopReason.END_TURN:case Bo.StopReason.STOP_SEQUENCE:return{stopReason:"stop"};case Bo.StopReason.MAX_TOKENS:case Bo.StopReason.MODEL_CONTEXT_WINDOW_EXCEEDED:return{stopReason:"length"};case Bo.StopReason.TOOL_USE:return{stopReason:"toolUse"};default:return t?{stopReason:"error",errorMessage:`Provider stopped with: ${t}`}:{stopReason:"error"}}}function QYt(t){return t.region||vi("AWS_REGION",t.env)||vi("AWS_DEFAULT_REGION",t.env)||void 0}function o6r(t){let e=vi("AWS_ACCESS_KEY_ID",t),n=vi("AWS_SECRET_ACCESS_KEY",t);if(!e||!n)return;let r=vi("AWS_SESSION_TOKEN",t);return{accessKeyId:e,secretAccessKey:n,...r?{sessionToken:r}:{}}}function UYt(t){if(t)try{let{hostname:e}=new URL(t);return e.toLowerCase().match(/^bedrock-runtime(?:-fips)?\.([a-z0-9-]+)\.amazonaws\.com(?:\.cn)?$/)?.[1]}catch{return}}function a6r(t,e,n){return UYt(t)?!e&&!n:!0}function c6r(t,e){if(QYt(e)?.toLowerCase().startsWith("us-gov-"))return!0;let r=t.id.toLowerCase();return r.startsWith("us-gov.")||r.startsWith("arn:aws-us-gov:")}function l6r(t,e){if(!(!e.reasoning||!t.reasoning)&&SAe(t)){let n=c6r(t,e)?void 0:e.thinkingDisplay??"summarized",r=N3e(t.id,t.name)?{thinking:{type:"adaptive",...n!==void 0?{display:n}:{}},output_config:{effort:J9r(t,e.reasoning)}}:(()=>{let i={minimal:1024,low:2048,medium:8192,high:16384,xhigh:16384,max:16384},s=e.reasoning==="xhigh"||e.reasoning==="max"?"high":e.reasoning;return{thinking:{type:"enabled",budget_tokens:e.thinkingBudgets?.[s]??i[e.reasoning],...n!==void 0?{display:n}:{}}}})();return!N3e(t.id,t.name)&&(e.interleavedThinking??!0)&&(r.anthropic_beta=["interleaved-thinking-2025-05-14"]),r}}function GYt(t,e){let n;switch(t){case"image/jpeg":case"image/jpg":n=Bo.ImageFormat.JPEG;break;case"image/png":n=Bo.ImageFormat.PNG;break;case"image/gif":n=Bo.ImageFormat.GIF;break;case"image/webp":n=Bo.ImageFormat.WEBP;break;default:throw new Error(`Unknown image type: ${t}`)}return{source:{bytes:$Yt(e)},format:n}}function $Yt(t){let e=atob(t),n=new Uint8Array(e.length);for(let r=0;rr in n))}function Le(t,e){let n=rwe(t)?.[e];if(n===void 0)throw new TypeError(`Missing internal slot ${e}`);return n}function Fs(t,e,n){let r=rwe(t);if(r===void 0)throw new TypeError("Missing slots for the given container");if(r[e])throw new TypeError(`${e} already has set`);r[e]=n}var vit={};function xR(t,e){Object.defineProperty(t.prototype,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0});let n=Object.getOwnPropertyNames(t);for(let i=0;i=i)return{div:0*r,mod:r*n};if(e===0)return{div:r*n,mod:0*r};let s=n.toPrecision(i);return{div:r*Number.parseInt(s.slice(0,i-e),10),mod:r*Number.parseInt(s.slice(i-e),10)}}function Eit(t,e,n){let r=t,i=n;if(r===0)return i;let s=Math.sign(r)||Math.sign(i);r=Math.abs(r),i=Math.abs(i);let o=r.toPrecision(Math.trunc(1+Math.log10(r)));if(i===0)return s*Number.parseInt(o+"0".repeat(e),10);let a=o+i.toPrecision(Math.trunc(1+Math.log10(i))).padStart(e,"0");return s*Number.parseInt(a,10)}function iwe(t,e){let n=e==="negative";switch(t){case"ceil":return n?"zero":"infinity";case"floor":return n?"infinity":"zero";case"expand":return"infinity";case"trunc":return"zero";case"halfCeil":return n?"half-zero":"half-infinity";case"halfFloor":return n?"half-infinity":"half-zero";case"halfExpand":return"half-infinity";case"halfTrunc":return"half-zero";case"halfEven":return"half-even"}}function swe(t,e,n,r,i){return i==="zero"?t:i==="infinity"?e:n<0?t:n>0?e:i==="half-zero"?t:i==="half-infinity"?e:r?t:e}var Ka=class t{constructor(e){this.totalNs=uR(e),this.sec=zt.default.toNumber(zt.default.divide(this.totalNs,Ane)),this.subsec=zt.default.toNumber(zt.default.remainder(this.totalNs,Ane))}static validateNew(e,n){if(zt.default.greaterThan(IF(e),t.MAX))throw new RangeError(`${n} of duration time units cannot exceed ${t.MAX} s`);return new t(e)}static fromEpochNsDiff(e,n){let r=zt.default.subtract(uR(e),uR(n));return new t(r)}static fromComponents(e,n,r,i,s,o){let a=zt.default.add(zt.default.add(zt.default.add(zt.default.add(zt.default.add(zt.default.BigInt(o),zt.default.multiply(zt.default.BigInt(s),KRi)),zt.default.multiply(zt.default.BigInt(i),Gne)),zt.default.multiply(zt.default.BigInt(r),Ane)),zt.default.multiply(zt.default.BigInt(n),JRi)),zt.default.multiply(zt.default.BigInt(e),CTn));return t.validateNew(a,"total")}abs(){return new t(IF(this.totalNs))}add(e){return t.validateNew(zt.default.add(this.totalNs,e.totalNs),"sum")}add24HourDays(e){return t.validateNew(zt.default.add(this.totalNs,zt.default.multiply(zt.default.BigInt(e),uD)),"sum")}addToEpochNs(e){return zt.default.add(uR(e),this.totalNs)}cmp(e){return GIe(this.totalNs,e.totalNs)}divmod(e){let{quotient:n,remainder:r}=lne(this.totalNs,zt.default.BigInt(e));return{quotient:zt.default.toNumber(n),remainder:new t(r)}}fdiv(e){let n=uR(e),r=zt.default.BigInt(n),{quotient:i,remainder:s}=lne(this.totalNs,r),o=[],a,c=(zt.default.lessThan(this.totalNs,aE)?-1:1)*Math.sign(zt.default.toNumber(n));for(;!zt.default.equal(s,aE)&&o.length<50;)s=zt.default.multiply(s,VRi),{quotient:a,remainder:s}=lne(s,r),o.push(Math.abs(zt.default.toNumber(a)));return c*+(IF(i).toString()+"."+o.join(""))}isZero(){return zt.default.equal(this.totalNs,aE)}round(e,n){let r=uR(e);if(zt.default.equal(r,Sne))return this;let{quotient:i,remainder:s}=lne(this.totalNs,r),o=zt.default.lessThan(this.totalNs,aE)?"negative":"positive",a=zt.default.multiply(IF(i),r),c=zt.default.add(a,r),u=GIe(IF(zt.default.multiply(s,ust)),r),l=iwe(n,o),d=zt.default.equal(IF(this.totalNs),a)?a:swe(a,c,u,ITn(i),l),m=o==="positive"?d:zt.default.unaryMinus(d);return t.validateNew(m,"rounding")}sign(){return this.cmp(new t(aE))}subtract(e){return t.validateNew(zt.default.subtract(this.totalNs,e.totalNs),"difference")}};Ka.MAX=zt.default.BigInt("9007199254740991999999999"),Ka.ZERO=new Ka(aE);var jwn=/[A-Za-z._][A-Za-z._0-9+-]*/,$ne=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${jwn.source})(?:\\/(?:${jwn.source}))*)`),LTn=/(?:[+-]\d{6}|\d{4})/,$Ie=/(?:0[1-9]|1[0-2])/,kit=/(?:0[1-9]|[12]\d|3[01])/,XRi=new RegExp(`(${LTn.source})(?:-(${$Ie.source})-(${kit.source})|(${$Ie.source})(${kit.source}))`),FTn=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,QTn=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,UTn=new RegExp(`([zZ])|${QTn.source}?`),f8=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,ZRi=new RegExp([`^${XRi.source}`,`(?:(?:[tT]|\\s+)${FTn.source}(?:${UTn.source})?)?`,`(?:\\[!?(${$ne.source})\\])?`,`((?:${f8.source})*)$`].join("")),eki=new RegExp([`^[tT]?${FTn.source}`,`(?:${UTn.source})?`,`(?:\\[!?${$ne.source}\\])?`,`((?:${f8.source})*)$`].join("")),tki=new RegExp(`^(${LTn.source})-?(${$Ie.source})(?:\\[!?${$ne.source}\\])?((?:${f8.source})*)$`),nki=new RegExp(`^(?:--)?(${$Ie.source})-?(${kit.source})(?:\\[!?${$ne.source}\\])?((?:${f8.source})*)$`),bit=/(\d+)(?:[.,](\d{1,9}))?/,rki=new RegExp(`(?:${bit.source}H)?(?:${bit.source}M)?(?:${bit.source}S)?`),iki=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${rki.source})?$`,"i"),dD=864e5,WIe=1e6*dD,ski=6e10,GTn=1e8*dD,g8=iS(GTn),Cne=zt.default.unaryMinus(g8),oki=zt.default.add(zt.default.subtract(Cne,uD),Sne),aki=zt.default.subtract(zt.default.add(g8,uD),Sne),cki=146097*dD,Vwn=-271821,Ywn=275760,yne=Date.UTC(1847,0,1),lki=["iso8601","hebrew","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","islamicc","persian","ethiopic","ethioaa","ethiopic-amete-alem","coptic","chinese","dangi","roc","indian","buddhist","japanese","gregory"],uki=new Set(["ACT","AET","AGT","ART","AST","BET","BST","CAT","CNT","CST","CTT","EAT","ECT","IET","IST","JST","MIT","NET","NST","PLT","PNT","PRT","PST","SST","VST"]);function Zl(t){return typeof t=="object"&&t!==null||typeof t=="function"}function owe(t){if(typeof t=="bigint")throw new TypeError("Cannot convert BigInt to number");return Number(t)}function awe(t){if(typeof t=="symbol")throw new TypeError("Cannot convert a Symbol value to a String");return String(t)}function ds(t){let e=owe(t);if(e===0)return 0;if(Number.isNaN(e)||e===1/0||e===-1/0)throw new RangeError("invalid number value");let n=Math.trunc(e);return n===0?0:n}function zwn(t,e){let n=ds(t);if(n<=0)throw e!==void 0?new RangeError(`property '${e}' cannot be a a number less than one`):new RangeError("Cannot convert a number less than one to a positive integer");return n}function nS(t){let e=owe(t);if(Number.isNaN(e))throw new RangeError("not a number");if(e===1/0||e===-1/0)throw new RangeError("infinity is out of range");if(!(function(n){if(typeof n!="number"||Number.isNaN(n)||n===1/0||n===-1/0)return!1;let r=Math.abs(n);return Math.floor(r)===r})(e))throw new RangeError(`unsupported fractional value ${t}`);return e===0?0:e}function Ine(t,e){return String(t).padStart(e,"0")}function dp(t){if(typeof t!="string")throw new TypeError(`expected a string, not ${String(t)}`);return t}function Bit(t,e){if(Zl(t)){let n=t?.toString();if(typeof n=="string"||typeof n=="number")return n;throw new TypeError("Cannot convert object to primitive value")}return t}var Nit=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],dki={era:awe,eraYear:ds,year:ds,month:zwn,monthCode:function(t){let e=dp(Bit(t));if(e.length<3||e.length>4||e[0]!=="M"||"0123456789".indexOf(e[1])===-1||"0123456789".indexOf(e[2])===-1||e[1]+e[2]==="00"&&e[3]!=="L"||e[3]!=="L"&&e[3]!==void 0)throw new RangeError(`bad month code ${e}; must match M01-M99 or M00L-M99L`);return e},day:zwn,hour:ds,minute:ds,second:ds,millisecond:ds,microsecond:ds,nanosecond:ds,offset:function(t){let e=dp(Bit(t));return I8(e),e},timeZone:mg},pki={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},A8=[["years","year","date"],["months","month","date"],["weeks","week","date"],["days","day","date"],["hours","hour","time"],["minutes","minute","time"],["seconds","second","time"],["milliseconds","millisecond","time"],["microseconds","microsecond","time"],["nanoseconds","nanosecond","time"]],Kwn=Object.fromEntries(A8.map((t=>[t[0],t[1]]))),mki=Object.fromEntries(A8.map((([t,e])=>[e,t]))),Ene=A8.map((([,t])=>t)),y8={day:WIe,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},HIe=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],hki=Intl.DateTimeFormat,Jwn=new Map;function $Tn(t){let e=kne(t),n=Jwn.get(e);return n===void 0&&(n=new hki("en-us",{timeZone:e,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Jwn.set(e,n)),n}function zm(t){return fg(t,Ji)&&!fg(t,pa,vn)}function Kl(t){return fg(t,rg,ig,sg,og,ag,cg,lg,ug,xA)}function Jl(t){return fg(t,wTn)}function Du(t){return fg(t,Xl)}function $c(t){return fg(t,al)}function Km(t){return fg(t,TTn)}function oE(t){return fg(t,vTn)}function Ys(t){return fg(t,Ji,pa,vn)}function nn(t,e){if(!e(t))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function x8(t){if(fg(t,vn)||fg(t,pa))throw new TypeError("with() does not support a calendar or timeZone property");if(Du(t))throw new TypeError("with() does not accept Temporal.PlainTime, use withPlainTime() instead");if(t.calendar!==void 0)throw new TypeError("with() does not support a calendar property");if(t.timeZone!==void 0)throw new TypeError("with() does not support a timeZone property")}function Wne(t,e){return e==="never"||e==="auto"&&t==="iso8601"?"":`[${e==="critical"?"!":""}u-ca=${t}]`}function cwe(t){let e,n,r=!1;for(f8.lastIndex=0;n=f8.exec(t);){let{1:i,2:s,3:o}=n;if(s==="u-ca"){if(e===void 0)e=o,r=i==="!";else if(i==="!"||r)throw new RangeError(`Invalid annotations in ${t}: more than one u-ca present with critical flag`)}else if(i==="!")throw new RangeError(`Unrecognized annotation: !${s}=${o}`)}return e}function iw(t){let e=ZRi.exec(t);if(!e)throw new RangeError(`invalid RFC 9557 string: ${t}`);let n=cwe(e[16]),r=e[1];if(r==="-000000")throw new RangeError(`invalid RFC 9557 string: ${t}`);let i=+r,s=+(e[2]??e[4]??1),o=+(e[3]??e[5]??1),a=e[6]!==void 0,c=+(e[6]??0),u=+(e[7]??e[10]??0),l=+(e[8]??e[11]??0);l===60&&(l=59);let d=(e[9]??e[12]??"")+"000000000",m=+d.slice(0,3),h=+d.slice(3,6),f=+d.slice(6,9),g,A=!1;e[13]?(g=void 0,A=!0):e[14]&&(g=e[14]);let y=e[15];return gst(i,s,o,c,u,l,m,h,f),{year:i,month:s,day:o,time:a?{hour:c,minute:u,second:l,millisecond:m,microsecond:h,nanosecond:f}:"start-of-day",tzAnnotation:y,offset:g,z:A,calendar:n}}function WTn(t){let e=eki.exec(t),n,r,i,s,o,a,c;if(e){c=cwe(e[10]),n=+(e[1]??0),r=+(e[2]??e[5]??0),i=+(e[3]??e[6]??0),i===60&&(i=59);let u=(e[4]??e[7]??"")+"000000000";if(s=+u.slice(0,3),o=+u.slice(3,6),a=+u.slice(6,9),e[8])throw new RangeError("Z designator not supported for PlainTime")}else{let u,l;if({time:u,z:l,calendar:c}=iw(t),u==="start-of-day")throw new RangeError(`time is missing in string: ${t}`);if(l)throw new RangeError("Z designator not supported for PlainTime");({hour:n,minute:r,second:i,millisecond:s,microsecond:o,nanosecond:a}=u)}if(pwe(n,r,i,s,o,a),/[tT ][0-9][0-9]/.test(t))return{hour:n,minute:r,second:i,millisecond:s,microsecond:o,nanosecond:a,calendar:c};try{let{month:u,day:l}=pst(t);kF(1972,u,l)}catch{try{let{year:u,month:l}=dst(t);kF(u,l,1)}catch{return{hour:n,minute:r,second:i,millisecond:s,microsecond:o,nanosecond:a,calendar:c}}}throw new RangeError(`invalid RFC 9557 time-only string ${t}; may need a T prefix`)}function dst(t){let e=tki.exec(t),n,r,i,s;if(e){i=cwe(e[3]);let o=e[1];if(o==="-000000")throw new RangeError(`invalid RFC 9557 string: ${t}`);if(n=+o,r=+e[2],s=1,i!==void 0&&i!=="iso8601")throw new RangeError("YYYY-MM format is only valid with iso8601 calendar")}else{let o;if({year:n,month:r,calendar:i,day:s,z:o}=iw(t),o)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:n,month:r,calendar:i,referenceISODay:s}}function pst(t){let e=nki.exec(t),n,r,i,s;if(e){if(i=cwe(e[3]),n=+e[1],r=+e[2],i!==void 0&&i!=="iso8601")throw new RangeError("MM-DD format is only valid with iso8601 calendar")}else{let o;if({month:n,day:r,calendar:i,year:s,z:o}=iw(t),o)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:n,day:r,calendar:i,referenceISOYear:s}}var HTn=new RegExp(`^${$ne.source}$`,"i"),qTn=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function jTn(t){let e=gki.test(t)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${e}: ${t}`)}function lD(t){return HTn.test(t)||jTn(t),qTn.test(t)?{offsetMinutes:I8(t)/6e10}:{tzName:t}}function bne(t,e,n,r){let i=t,s=e,o=n;switch(r){case"reject":kF(i,s,o);break;case"constrain":({year:i,month:s,day:o}=lvn(i,s,o))}return{year:i,month:s,day:o}}function lwe(t,e,n,r,i,s,o){let a=t,c=e,u=n,l=r,d=i,m=s;switch(o){case"reject":pwe(a,c,u,l,d,m);break;case"constrain":a=dg(a,0,23),c=dg(c,0,59),u=dg(u,0,59),l=dg(l,0,999),d=dg(d,0,999),m=dg(m,0,999)}return{hour:a,minute:c,second:u,millisecond:l,microsecond:d,nanosecond:m}}function VTn(t){if(!Zl(t))throw new TypeError("invalid duration-like");let e={years:void 0,months:void 0,weeks:void 0,days:void 0,hours:void 0,minutes:void 0,seconds:void 0,milliseconds:void 0,microseconds:void 0,nanoseconds:void 0},n=!1;for(let r=0;r1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${e}`);return n}function C8(t,e,n){let r=n?e:e-1;if(t>r)throw new RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${t}`);if(e%t!=0)throw new RangeError(`Rounding increment must divide evenly into ${e}`)}function qne(t){let e=t.fractionalSecondDigits;if(e===void 0)return"auto";if(typeof e!="number"){if(awe(e)!=="auto")throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${e}`);return"auto"}let n=Math.floor(e);if(!Number.isFinite(n)||n<0||n>9)throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${e}`);return n}function jne(t,e){switch(t){case"minute":return{precision:"minute",unit:"minute",increment:1};case"second":return{precision:0,unit:"second",increment:1};case"millisecond":return{precision:3,unit:"millisecond",increment:1};case"microsecond":return{precision:6,unit:"microsecond",increment:1};case"nanosecond":return{precision:9,unit:"nanosecond",increment:1}}switch(e){case"auto":return{precision:e,unit:"nanosecond",increment:1};case 0:return{precision:e,unit:"second",increment:1};case 1:case 2:case 3:return{precision:e,unit:"millisecond",increment:10**(3-e)};case 4:case 5:case 6:return{precision:e,unit:"microsecond",increment:10**(6-e)};case 7:case 8:case 9:return{precision:e,unit:"nanosecond",increment:10**(9-e)};default:throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${e}`)}}var ER=Symbol("~required~");function CA(t,e,n,r,i=[]){let s=[];for(let u=0;uEne.indexOf(e)?e:t}function JI(t){return t==="year"||t==="month"||t==="week"}function pR(t){return JI(t)||t==="day"?"date":"time"}function hD(t){return Xm("%calendarImpl%")(t)}function Vne(t){return Xm("%calendarImpl%")(Le(t,vn))}function hg(t,e,n="date"){let r=Object.create(null),i=hD(t).isoToDate(e,{year:!0,monthCode:!0,day:!0});return r.monthCode=i.monthCode,n!=="month-day"&&n!=="date"||(r.day=i.day),n!=="year-month"&&n!=="date"||(r.year=i.year),r}function dE(t,e,n,r,i){let s=hD(t).extraFields(n),o=n.concat(r,s),a=Object.create(null),c=!1;o.sort();for(let u=0;use<2||j===void 0)))throw new RangeError(`invalid duration: ${g}`);let y=A[1]==="-"?-1:1,E=A[2]===void 0?0:ds(A[2])*y,_=A[3]===void 0?0:ds(A[3])*y,S=A[4]===void 0?0:ds(A[4])*y,C=A[5]===void 0?0:ds(A[5])*y,I=A[6]===void 0?0:ds(A[6])*y,w=A[7],k=A[8],N=A[9],O=A[10],W=A[11],$=0,G=0,q=0;if(w!==void 0){if(k??N??O??W)throw new RangeError("only the smallest unit can be fractional");q=3600*ds((w+"000000000").slice(0,9))*y}else if($=k===void 0?0:ds(k)*y,N!==void 0){if(O??W)throw new RangeError("only the smallest unit can be fractional");q=60*ds((N+"000000000").slice(0,9))*y}else G=O===void 0?0:ds(O)*y,W!==void 0&&(q=ds((W+"000000000").slice(0,9))*y);let ce=q%1e3,Y=Math.trunc(q/1e3)%1e3,z=Math.trunc(q/1e6)%1e3;return G+=Math.trunc(q/1e9)%60,$+=Math.trunc(q/6e10),mwe(E,_,S,C,I,$,G,z,Y,ce),{years:E,months:_,weeks:S,days:C,hours:I,minutes:$,seconds:G,milliseconds:z,microseconds:Y,nanoseconds:ce}})(i);return new(Xm("%Temporal.Duration%"))(s,o,a,c,u,l,d,m,h,f)})(dp(t));let n={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=VTn(t);for(let i=0;it[e]!==void 0))}function RF(t,e,n){let r=Zwn(n),i=hD(t).fieldKeysToIgnore(r),s=Object.create(null),o=Zwn(e);for(let a=0;a{let m=zt.default.subtract(s,zt.default.BigInt(d)),h=(function(f,g){let{epochMilliseconds:A,time:{millisecond:y,microsecond:E,nanosecond:_}}=ovn(g),{year:S,month:C,day:I,hour:w,minute:k,second:N}=avn(f,A);return Rne(S,C,I,w,k,N,y,E,_)})(r,m);if(b8(i,h)===0)return nw(m),m})).filter((d=>d!==void 0))})(t,e)}function sD(t,e){let n=Zo(e,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=Tne(t,n);if(r.length)return r[0];let i=Jm(n),s=zt.default.subtract(i,uD);return nw(s),fst(t,s)}function Xne(t){let e;return e=t<0||t>9999?(t<0?"-":"+")+Ine(Math.abs(t),6):Ine(t,4),e}function uE(t){return Ine(t,2)}function ivn(t,e){let n;if(e==="auto"){if(t===0)return"";n=Ine(t,9).replace(/0+$/,"")}else{if(e===0)return"";n=Ine(t,9).slice(0,e)}return`.${n}`}function uwe(t,e,n,r,i){let s=`${uE(t)}:${uE(e)}`;return i==="minute"||(s+=`:${uE(n)}`,s+=ivn(r,i)),s}function eTn(t,e,n){let r=e;r===void 0&&(r="UTC");let i=Le(t,Ji),s=vne(mb(r,i),"iso8601",n,"never"),o="Z";return e!==void 0&&(o=svn(hR(r,i))),`${s}${o}`}function QIe(t,e){let n=Le(t,rg),r=Le(t,ig),i=Le(t,_A),s=Le(t,sg),o=Le(t,og),a=Le(t,ag),c=zIe(t),u="";n!==0&&(u+=`${Math.abs(n)}Y`),r!==0&&(u+=`${Math.abs(r)}M`),i!==0&&(u+=`${Math.abs(i)}W`),s!==0&&(u+=`${Math.abs(s)}D`);let l="";o!==0&&(l+=`${Math.abs(o)}H`),a!==0&&(l+=`${Math.abs(a)}M`);let d=Ka.fromComponents(0,0,Le(t,cg),Le(t,lg),Le(t,ug),Le(t,xA));d.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(dR(t))&&e==="auto"||(l+=`${Math.abs(d.sec)}${ivn(Math.abs(d.subsec),e)}S`);let m=`${c<0?"-":""}P${u}`;return l&&(m=`${m}T${l}`),m}function tTn(t,e="auto"){let{year:n,month:r,day:i}=Le(t,Xi);return`${Xne(n)}-${uE(r)}-${uE(i)}${Wne(Le(t,vn),e)}`}function nTn({hour:t,minute:e,second:n,millisecond:r,microsecond:i,nanosecond:s},o){return uwe(t,e,n,1e6*r+1e3*i+s,o)}function vne(t,e,n,r="auto"){let{isoDate:{year:i,month:s,day:o},time:{hour:a,minute:c,second:u,millisecond:l,microsecond:d,nanosecond:m}}=t;return`${Xne(i)}-${uE(s)}-${uE(o)}T${uwe(a,c,u,1e6*l+1e3*d+m,n)}${Wne(e,r)}`}function rTn(t,e="auto"){let{year:n,month:r,day:i}=Le(t,Xi),s=`${uE(r)}-${uE(i)}`,o=Le(t,vn);e!=="always"&&e!=="critical"&&o==="iso8601"||(s=`${Xne(n)}-${s}`);let a=Wne(o,e);return a&&(s+=a),s}function iTn(t,e="auto"){let{year:n,month:r,day:i}=Le(t,Xi),s=`${Xne(n)}-${uE(r)}`,o=Le(t,vn);e!=="always"&&e!=="critical"&&o==="iso8601"||(s+=`-${uE(i)}`);let a=Wne(o,e);return a&&(s+=a),s}function sTn(t,e,n="auto",r="auto",i="auto",s=void 0){let o=Le(t,Ji);if(s){let{unit:l,increment:d,roundingMode:m}=s;o=Qit(o,d,l,m)}let a=Le(t,pa),c=hR(a,o),u=vne(mb(a,o),"iso8601",e,"never");return i!=="never"&&(u+=svn(c)),r!=="never"&&(u+=`[${r==="critical"?"!":""}${a}]`),u+=Wne(Le(t,vn),n),u}function oTn(t){return qTn.test(t)}function I8(t){let e=Aki.exec(t);if(!e)throw new RangeError(`invalid time zone offset: ${t}; must match \xB1HH:MM[:SS.SSSSSSSSS]`);return(e[1]==="-"?-1:1)*(1e9*(60*(60*+e[2]+ +(e[3]||0))+ +(e[4]||0))+ +((e[5]||0)+"000000000").slice(0,9))}var one,fki=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function VIe(t){if(one===void 0){let s=Intl.supportedValuesOf?.("timeZone");if(s){one=new Map;for(let o=0;oo===0||fki[e[o-1]]?s.toUpperCase():s)).join("").split("/");if(r.length===1)return e==="gb-eire"?{identifier:"GB-Eire",primaryIdentifier:n}:{identifier:e.length<=3||/[-0-9]/.test(e)?e.toUpperCase():r[0],primaryIdentifier:n};if(r[0]==="Etc")return{identifier:`Etc/${["Zulu","Greenwich","Universal"].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:n};if(r[0]==="Us")return{identifier:`US/${r[1]}`,primaryIdentifier:n};let i=new Map([["Act","ACT"],["Lhi","LHI"],["Nsw","NSW"],["Dar_Es_Salaam","Dar_es_Salaam"],["Port_Of_Spain","Port_of_Spain"],["Port-Au-Prince","Port-au-Prince"],["Isle_Of_Man","Isle_of_Man"],["Comodrivadavia","ComodRivadavia"],["Knox_In","Knox_IN"],["Dumontdurville","DumontDUrville"],["Mcmurdo","McMurdo"],["Denoronha","DeNoronha"],["Easterisland","EasterIsland"],["Bajanorte","BajaNorte"],["Bajasur","BajaSur"]]);return r[1]=i.get(r[1])??r[1],r.length>2&&(r[2]=i.get(r[2])??r[2]),{identifier:r.join("/"),primaryIdentifier:n}}function TF(t,e){let{year:n,month:r,day:i,hour:s,minute:o,second:a}=avn(t,e),c=e%1e3;return c<0&&(c+=1e3),1e6*(hst({isoDate:{year:n,month:r,day:i},time:{hour:s,minute:o,second:a,millisecond:c}})-e)}function Mit(t,e){return TF(t,hb(e,"floor"))}function mst(t){let e=t<0?"-":"+",n=Math.abs(t);return`${e}${uwe(Math.floor(n/60),n%60,0,0,"minute")}`}function svn(t){return mst(cD(t,ski,"halfExpand")/6e10)}function hst({isoDate:{year:t,month:e,day:n},time:{hour:r,minute:i,second:s,millisecond:o}}){let a=t%400,c=(t-a)/400,u=new Date;return u.setUTCHours(r,i,s,o),u.setUTCFullYear(a,e-1,n),u.getTime()+cki*c}function Jm(t){let e=hst(t),n=1e3*t.time.microsecond+t.time.nanosecond;return zt.default.add(iS(e),zt.default.BigInt(n))}function ovn(t){let e=hb(t,"trunc"),n=zt.default.toNumber(zt.default.remainder(t,Gne));n<0&&(n+=1e6,e-=1);let r=Math.floor(n/1e3)%1e3,i=n%1e3,s=new Date(e);return{epochMilliseconds:e,isoDate:{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate()},time:{hour:s.getUTCHours(),minute:s.getUTCMinutes(),second:s.getUTCSeconds(),millisecond:s.getUTCMilliseconds(),microsecond:r,nanosecond:i}}}function fst(t,e){if(t==="UTC")return null;let n=hb(e,"floor");if(nGTn)return null;c=TF(t,a),o===c&&(s=a)}return o===c?null:iS(Avn((u=>TF(t,u)),s,a,o,c))}function Oit(t,e){if(t==="UTC")return null;let n=hb(e,"ceil"),r=Date.now(),i=r+366*dD*3;if(n>i){let u=Oit(t,iS(i));if(u===null||zt.default.lessThan(u,iS(r)))return u}if(t==="Africa/Casablanca"||t==="Africa/El_Aaiun"){let u=Date.UTC(2088,0,1);if(uyne;){if(a=s-2*dD*7,aTF(t,u)),a,s,c,o))}function avn(t,e){return(function(n){let r=n.split(/[^\w]+/);if(r.length!==7)throw new RangeError(`expected 7 parts in "${n}`);let i=+r[0],s=+r[1],o=+r[2],a=r[3];if(a[0]==="b"||a[0]==="B")o=1-o;else if(a[0]!=="a"&&a[0]!=="A")throw new RangeError(`Unknown era ${a} in "${n}`);let c=r[4]==="24"?0:+r[4],u=+r[5],l=+r[6];if(!(Number.isFinite(o)&&Number.isFinite(i)&&Number.isFinite(s)&&Number.isFinite(c)&&Number.isFinite(u)&&Number.isFinite(l)))throw new RangeError(`Invalid number in "${n}`);return{year:o,month:i,day:s,hour:c,minute:u,second:l}})($Tn(t).format(e))}function YIe(t){return t!==void 0&&!(t%4!=0||t%100==0&&t%400!=0)}function vF(t,e){return{standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]}[YIe(t)?"leapyear":"standard"][e-1]}function zIe(t){let e=[Le(t,rg),Le(t,ig),Le(t,_A),Le(t,sg),Le(t,og),Le(t,ag),Le(t,cg),Le(t,lg),Le(t,ug),Le(t,xA)];for(let n=0;no){let u=Math.trunc(s/o);r+=400*u,s-=u*o}let a=0,c=i>2?r:r-1;for(;a=YIe(c)?366:365,s<-a;)r-=1,c-=1,s+=a;for(c+=1;a=YIe(c)?366:365,s>a;)r+=1,c+=1,s-=a;for(;s<1;)({year:r,month:i}=wF(r,i-1)),s+=vF(r,i);for(;s>vF(r,i);)s-=vF(r,i),{year:r,month:i}=wF(r,i+1);return{year:r,month:i,day:s}}function Rne(t,e,n,r,i,s,o,a,c){let u=oD(r,i,s,o,a,c);return Zo(IA(t,e,n+u.deltaDays),u)}function oD(t,e,n,r,i,s){let o,a=t,c=e,u=n,l=r,d=i,m=s;({div:o,mod:m}=d8(m,3)),d+=o,m<0&&(d-=1,m+=1e3),{div:o,mod:d}=d8(d,3),l+=o,d<0&&(l-=1,d+=1e3),u+=Math.trunc(l/1e3),l%=1e3,l<0&&(u-=1,l+=1e3),c+=Math.trunc(u/60),u%=60,u<0&&(c-=1,u+=60),a+=Math.trunc(c/60),c%=60,c<0&&(a-=1,c+=60);let h=Math.trunc(a/24);return a%=24,a<0&&(h-=1,a+=24),h+=0,a+=0,c+=0,u+=0,l+=0,d+=0,m+=0,{deltaDays:h,hour:a,minute:c,second:u,millisecond:l,microsecond:d,nanosecond:m}}function aTn(t,e){let n=jh(t,0);if(dwe(n)===0)return t.days;let r=Le(e,Xi),i=lE(Le(e,vn),r,n,"constrain"),s=NF(r.year,r.month-1,r.day),o=NF(i.year,i.month-1,i.day)-s;return t.days+o}function wA(t){return new(Xm("%Temporal.Duration%"))(-Le(t,rg),-Le(t,ig),-Le(t,_A),-Le(t,sg),-Le(t,og),-Le(t,ag),-Le(t,cg),-Le(t,lg),-Le(t,ug),-Le(t,xA))}function dg(t,e,n){return Math.min(n,Math.max(e,t))}function lvn(t,e,n){let r=dg(e,1,12);return{year:t,month:r,day:dg(n,1,vF(t,r))}}function tm(t,e,n){if(tn)throw new RangeError(`value out of range: ${e} <= ${t} <= ${n}`)}function kF(t,e,n){tm(e,1,12),tm(n,1,vF(t,e))}function LF(t){BF(Zo(t,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function pwe(t,e,n,r,i,s){tm(t,0,23),tm(e,0,59),tm(n,0,59),tm(r,0,999),tm(i,0,999),tm(s,0,999)}function gst(t,e,n,r,i,s,o,a,c){kF(t,e,n),pwe(r,i,s,o,a,c)}function BF(t){let e=Jm(t);(zt.default.lessThan(e,oki)||zt.default.greaterThan(e,aki))&&nw(e)}function Lit(t){Jm(t)}function nw(t){if(zt.default.lessThan(t,Cne)||zt.default.greaterThan(t,g8))throw new RangeError("date/time value is outside of supported range")}function Ast({year:t,month:e}){tm(t,Vwn,Ywn),t===Vwn?tm(e,4,12):t===Ywn&&tm(e,1,9)}function mwe(t,e,n,r,i,s,o,a,c,u){let l=0,d=[t,e,n,r,i,s,o,a,c,u];for(let y=0;y=2**32||Math.abs(e)>=2**32||Math.abs(n)>=2**32)throw new RangeError("years, months, and weeks must be < 2\xB3\xB2");let m=d8(a,3),h=d8(c,6),f=d8(u,9),g=d8(1e6*m.mod+1e3*h.mod+f.mod,9).div,A=86400*r+3600*i+60*s+o+m.div+h.div+f.div+g;if(!Number.isSafeInteger(A))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function u8(t){return{date:{years:Le(t,rg),months:Le(t,ig),weeks:Le(t,_A),days:Le(t,sg)},time:Ka.fromComponents(Le(t,og),Le(t,ag),Le(t,cg),Le(t,lg),Le(t,ug),Le(t,xA))}}function ZI(t){let e=Ka.fromComponents(Le(t,og),Le(t,ag),Le(t,cg),Le(t,lg),Le(t,ug),Le(t,xA)).add24HourDays(Le(t,sg));return{date:{years:Le(t,rg),months:Le(t,ig),weeks:Le(t,_A),days:0},time:e}}function uvn(t){let e=ZI(t),n=Math.trunc(e.time.sec/86400);return mwe(e.date.years,e.date.months,e.date.weeks,n,0,0,0,0,0,0),{...e.date,days:n}}function db(t,e){let n=t.time.sign(),r=t.time.abs().subsec,i=0,s=0,o=t.time.abs().sec,a=0,c=0,u=0;switch(e){case"year":case"month":case"week":case"day":i=Math.trunc(r/1e3),r%=1e3,s=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(s/1e3),s%=1e3,a=Math.trunc(o/60),o%=60,c=Math.trunc(a/60),a%=60,u=Math.trunc(c/24),c%=24;break;case"hour":i=Math.trunc(r/1e3),r%=1e3,s=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(s/1e3),s%=1e3,a=Math.trunc(o/60),o%=60,c=Math.trunc(a/60),a%=60;break;case"minute":i=Math.trunc(r/1e3),r%=1e3,s=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(s/1e3),s%=1e3,a=Math.trunc(o/60),o%=60;break;case"second":i=Math.trunc(r/1e3),r%=1e3,s=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(s/1e3),s%=1e3;break;case"millisecond":i=Math.trunc(r/1e3),r%=1e3,s=Eit(o,3,Math.trunc(i/1e3)),i%=1e3,o=0;break;case"microsecond":i=Eit(o,6,Math.trunc(r/1e3)),r%=1e3,o=0;break;case"nanosecond":r=Eit(o,9,r),o=0}return new(Xm("%Temporal.Duration%"))(t.date.years,t.date.months,t.date.weeks,t.date.days+n*u,n*c,n*a,n*o,n*s,n*i,n*r)}function gR(t,e){return dwe(t),e.sign(),{date:t,time:e}}function NF(t,e,n){return hst({isoDate:{year:t,month:e+1,day:n},time:{hour:0,minute:0,second:0,millisecond:0}})/dD}function h8({year:t,month:e,day:n}){if(Math.abs(NF(t,e-1,n))>1e8)throw new RangeError("date/time value is outside the supported range")}function yst(t,e){let n=e.hour-t.hour,r=e.minute-t.minute,i=e.second-t.second,s=e.millisecond-t.millisecond,o=e.microsecond-t.microsecond,a=e.nanosecond-t.nanosecond;return Ka.fromComponents(n,r,i,s,o,a)}function Est(t,e,n,r,i){let s=Ka.fromEpochNsDiff(e,t);return s=KIe(s,n,r,i),gR({years:0,months:0,weeks:0,days:0},s)}function dvn(t,e,n,r){Lit(t),Lit(e);let i=yst(t.time,e.time),s=i.sign(),o=rw(t.isoDate,e.isoDate),a=e.isoDate;o===s&&(a=IA(a.year,a.month,a.day+s),i=i.add24HourDays(-s));let c=fR("day",r),u=zne(n,t.isoDate,a,c);return r!==c&&(i=i.add24HourDays(u.days),u.days=0),gR(u,i)}function pvn(t,e,n,r,i){let s=zt.default.subtract(e,t);if(zt.default.equal(s,aE))return{date:{years:0,months:0,weeks:0,days:0},time:Ka.ZERO};let o=zt.default.lessThan(s,aE)?-1:1,a=mb(n,t),c=mb(n,e),u,l=0,d=o===1?2:1,m=yst(a.time,c.time);for(m.sign()===-o&&l++;l<=d;l++){u=Zo(IA(c.isoDate.year,c.isoDate.month,c.isoDate.day-l*o),a.time);let f=Vh(n,u,"compatible");if(m=Ka.fromEpochNsDiff(e,f),m.sign()!==-o)break}let h=fR("day",i);return gR(zne(r,a.isoDate,u.isoDate,h),m)}function mvn(t,e,n,r,i,s,o,a,c){let u,l,d,m,h=e;switch(a){case"year":{let $=cD(h.date.years,o,"trunc");u=$,l=$+o*t,d={years:u,months:0,weeks:0,days:0},m={...d,years:l};break}case"month":{let $=cD(h.date.months,o,"trunc");u=$,l=$+o*t,d=jh(h.date,0,0,u),m=jh(h.date,0,0,l);break}case"week":{let $=jh(h.date,0,0),G=lE(s,r.isoDate,$,"constrain"),q=zne(s,G,IA(G.year,G.month,G.day+h.date.days),"week"),ce=cD(h.date.weeks+q.weeks,o,"trunc");u=ce,l=ce+o*t,d=jh(h.date,0,u),m=jh(h.date,0,l);break}case"day":{let $=cD(h.date.days,o,"trunc");u=$,l=$+o*t,d=jh(h.date,u),m=jh(h.date,l);break}}let f=lE(s,r.isoDate,d,"constrain"),g=lE(s,r.isoDate,m,"constrain"),A,y,E=Zo(f,r.time),_=Zo(g,r.time);i?(A=Vh(i,E,"compatible"),y=Vh(i,_,"compatible")):(A=Jm(E),y=Jm(_));let S=Ka.fromEpochNsDiff(n,A),C=Ka.fromEpochNsDiff(y,A),I=iwe(c,t<0?"negative":"positive"),w=S.add(S).abs().subtract(C.abs()).sign(),k=Math.abs(u)/o%2==0,N=S.isZero()?Math.abs(u):S.cmp(C)?swe(Math.abs(u),Math.abs(l),w,k,I):Math.abs(l),O=new Ka(zt.default.add(zt.default.multiply(C.totalNs,zt.default.BigInt(u)),zt.default.multiply(S.totalNs,zt.default.BigInt(o*t)))).fdiv(C.totalNs),W=N===Math.abs(l);return h={date:W?m:d,time:Ka.ZERO},{nudgeResult:{duration:h,nudgedEpochNs:W?y:A,didExpandCalendarUnit:W},total:O}}function hwe(t,e,n,r,i,s,o,a,c){let u=t,l=JI(a)||r&&a==="day",d=cvn(u)<0?-1:1,m;return l?{nudgeResult:m}=mvn(d,u,e,n,r,i,o,a,c):m=r?(function(h,f,g,A,y,E,_,S){let C=f,I=lE(y,g.isoDate,C.date,"constrain"),w=Zo(I,g.time),k=Zo(IA(I.year,I.month,I.day+h),g.time),N=Vh(A,w,"compatible"),O=Vh(A,k,"compatible"),W=Ka.fromEpochNsDiff(O,N);if(W.sign()!==h)throw new RangeError("time zone returned inconsistent Instants");let $=zt.default.BigInt(y8[_]*E),G=C.time.round($,S),q=G.subtract(W),ce=q.sign()!==-h,Y,z;return ce?(Y=h,G=q.round($,S),z=G.addToEpochNs(O)):(Y=0,z=G.addToEpochNs(N)),{duration:gR(jh(C.date,C.date.days+Y),G),nudgedEpochNs:z,didExpandCalendarUnit:ce}})(d,u,n,r,i,o,a,c):(function(h,f,g,A,y,E){let _=h,S=_.time.add24HourDays(_.date.days),C=S.round(zt.default.BigInt(A*y8[y]),E),I=C.subtract(S),{quotient:w}=S.divmod(WIe),{quotient:k}=C.divmod(WIe),N=Math.sign(k-w)===S.sign(),O=I.addToEpochNs(f),W=0,$=C;return pR(g)==="date"&&(W=k,$=C.add(Ka.fromComponents(24*-k,0,0,0,0,0))),{duration:{date:jh(_.date,W),time:$},nudgedEpochNs:O,didExpandCalendarUnit:N}})(u,e,s,o,a,c),u=m.duration,m.didExpandCalendarUnit&&a!=="week"&&(u=(function(h,f,g,A,y,E,_,S){let C=f;if(S===_)return C;let I=Ene.indexOf(_);for(let w=Ene.indexOf(S)-1;w>=I;w--){let k=Ene[w];if(k==="week"&&_!=="week")continue;let N;switch(k){case"year":N={years:C.date.years+h,months:0,weeks:0,days:0};break;case"month":{let $=C.date.months+h;N=jh(C.date,0,0,$);break}case"week":{let $=C.date.weeks+h;N=jh(C.date,0,$);break}}let O=Zo(lE(E,A.isoDate,N,"constrain"),A.time),W;if(W=y?Vh(y,O,"compatible"):Jm(O),GIe(g,W)===-h)break;C={date:N,time:Ka.ZERO}}return C})(d,u,m.nudgedEpochNs,n,r,i,s,fR(a,"day"))),u}function cTn(t,e,n,r,i,s){return JI(s)||r&&s==="day"?mvn(cvn(t)<0?-1:1,t,e,n,r,i,1,s,"trunc").total:xne(t.time.add24HourDays(t.date.days),s)}function hvn(t,e,n,r,i,s,o){if(b8(t,e)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Ka.ZERO};BF(t),BF(e);let a=dvn(t,e,n,r);return s==="nanosecond"&&i===1?a:hwe(a,Jm(e),t,null,n,r,i,s,o)}function fvn(t,e,n,r,i,s,o,a){if(pR(i)==="time")return Est(t,e,s,o,a);let c=pvn(t,e,n,r,i);return o==="nanosecond"&&s===1?c:hwe(c,e,mb(n,t),n,r,i,s,o,a)}function w8(t,e,n,r,i,s){let o=A8.reduce(((h,f)=>{let g=f[0],A=f[1],y=f[2];return n!=="datetime"&&y!==n||r.includes(A)||h.push(A,g),h}),[]),a=CA(e,"largestUnit",n,"auto");if(r.includes(a))throw new RangeError(`largestUnit must be one of ${o.join(", ")}, not ${a}`);let c=S8(e),u=sS(e,"trunc");t==="since"&&(u=(function(h){switch(h){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return h}})(u));let l=CA(e,"smallestUnit",n,i);if(r.includes(l))throw new RangeError(`smallestUnit must be one of ${o.join(", ")}, not ${l}`);let d=fR(s,l);if(a==="auto"&&(a=d),fR(a,l)!==a)throw new RangeError(`largestUnit ${a} cannot be smaller than smallestUnit ${l}`);let m={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[l];return m!==void 0&&C8(c,m,!1),{largestUnit:a,roundingIncrement:c,roundingMode:u,smallestUnit:l}}function lTn(t,e,n,r){let i=mne(n),s=w8(t,Gr(r),"time",[],"nanosecond","second"),o=db(Est(Le(e,Ji),Le(i,Ji),s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return t==="since"&&(o=wA(o)),o}function uTn(t,e,n,r){let i=dne(n),s=Le(e,vn),o=Le(i,vn);if(!tw(s,o))throw new RangeError(`cannot compute difference between dates of ${s} and ${o} calendars`);let a=w8(t,Gr(r),"date",[],"day","day"),c=Xm("%Temporal.Duration%"),u=Le(e,Xi),l=Le(i,Xi);if(rw(u,l)===0)return new c;let d={date:zne(s,u,l,a.largestUnit),time:Ka.ZERO};if(a.smallestUnit!=="day"||a.roundingIncrement!==1){let h=Zo(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});d=hwe(d,Jm(Zo(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),h,null,s,a.largestUnit,a.roundingIncrement,a.smallestUnit,a.roundingMode)}let m=db(d,"day");return t==="since"&&(m=wA(m)),m}function dTn(t,e,n,r){let i=pne(n),s=Le(e,vn),o=Le(i,vn);if(!tw(s,o))throw new RangeError(`cannot compute difference between dates of ${s} and ${o} calendars`);let a=w8(t,Gr(r),"datetime",[],"nanosecond","day"),c=Xm("%Temporal.Duration%"),u=Le(e,al),l=Le(i,al);if(b8(u,l)===0)return new c;let d=db(hvn(u,l,s,a.largestUnit,a.roundingIncrement,a.smallestUnit,a.roundingMode),a.largestUnit);return t==="since"&&(d=wA(d)),d}function pTn(t,e,n,r){let i=aD(n),s=w8(t,Gr(r),"time",[],"nanosecond","hour"),o=yst(Le(e,Xl),Le(i,Xl));o=KIe(o,s.roundingIncrement,s.smallestUnit,s.roundingMode);let a=db(gR({years:0,months:0,weeks:0,days:0},o),s.largestUnit);return t==="since"&&(a=wA(a)),a}function mTn(t,e,n,r){let i=hne(n),s=Le(e,vn),o=Le(i,vn);if(!tw(s,o))throw new RangeError(`cannot compute difference between months of ${s} and ${o} calendars`);let a=w8(t,Gr(r),"date",["week","day"],"month","year"),c=Xm("%Temporal.Duration%");if(rw(Le(e,Xi),Le(i,Xi))==0)return new c;let u=hg(s,Le(e,Xi),"year-month");u.day=1;let l=pD(s,u,"constrain"),d=hg(s,Le(i,Xi),"year-month");d.day=1;let m=pD(s,d,"constrain"),h={date:jh(zne(s,l,m,a.largestUnit),0,0),time:Ka.ZERO};if(a.smallestUnit!=="month"||a.roundingIncrement!==1){let g=Zo(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});h=hwe(h,Jm(Zo(m,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),g,null,s,a.largestUnit,a.roundingIncrement,a.smallestUnit,a.roundingMode)}let f=db(h,"day");return t==="since"&&(f=wA(f)),f}function hTn(t,e,n,r){let i=fne(n),s=Le(e,vn),o=Le(i,vn);if(!tw(s,o))throw new RangeError(`cannot compute difference between dates of ${s} and ${o} calendars`);let a=w8(t,Gr(r),"datetime",[],"nanosecond","hour"),c=Le(e,Ji),u=Le(i,Ji),l=Xm("%Temporal.Duration%"),d;if(pR(a.largestUnit)!=="date")d=db(Est(c,u,a.roundingIncrement,a.smallestUnit,a.roundingMode),a.largestUnit);else{let m=Le(e,pa);if(!nvn(m,Le(i,pa)))throw new RangeError("When calculating difference between time zones, largestUnit must be 'hours' or smaller because day lengths can vary between time zones due to DST or time zone offset changes.");if(zt.default.equal(c,u))return new l;d=db(fvn(c,u,m,s,a.largestUnit,a.roundingIncrement,a.smallestUnit,a.roundingMode),"hour")}return t==="since"&&(d=wA(d)),d}function E8({hour:t,minute:e,second:n,millisecond:r,microsecond:i,nanosecond:s},o){let a=n,c=s;return a+=o.sec,c+=o.subsec,oD(t,e,a,r,i,c)}function Fit(t,e){let n=e.addToEpochNs(t);return nw(n),n}function gne(t,e,n,r,i="constrain"){if(dwe(r.date)===0)return Fit(t,r.time);let s=mb(e,t);return Fit(Vh(e,Zo(lE(n,s.isoDate,r.date,i),s.time),"compatible"),r.time)}function fTn(t,e,n){let r=pb(n);t==="subtract"&&(r=wA(r));let i=fR(dR(e),dR(r));if(JI(i))throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");let s=ZI(e),o=ZI(r);return db(gR({years:0,months:0,weeks:0,days:0},s.time.add(o.time)),i)}function gTn(t,e,n){let r=pb(n);t==="subtract"&&(r=wA(r));let i=dR(r);if(pR(i)==="date")throw new RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let s=ZI(r);return rS(Fit(Le(e,Ji),s.time))}function ATn(t,e,n,r){let i=Le(e,vn),s=pb(n);t==="subtract"&&(s=wA(s));let o=uvn(s),a=jo(Gr(r));return pg(lE(i,Le(e,Xi),o,a),i)}function yTn(t,e,n,r){let i=pb(n);t==="subtract"&&(i=wA(i));let s=jo(Gr(r)),o=Le(e,vn),a=ZI(i),c=Le(e,al),u=E8(c.time,a.time),l=jh(a.date,u.deltaDays);return mwe(l.years,l.months,l.weeks,l.days,0,0,0,0,0,0),ub(Zo(lE(o,c.isoDate,l,s),u),o)}function ETn(t,e,n){let r=pb(n);t==="subtract"&&(r=wA(r));let i=ZI(r),{hour:s,minute:o,second:a,millisecond:c,microsecond:u,nanosecond:l}=E8(Le(e,Xl),i.time);return mR(lwe(s,o,a,c,u,l,"reject"))}function bTn(t,e,n,r){let i=pb(n);t==="subtract"&&(i=wA(i));let s=jo(Gr(r)),o=zIe(i),a=Le(e,vn),c=hg(a,Le(e,Xi),"year-month");c.day=1;let u=pD(a,c,"constrain");if(o<0){let d=lE(a,u,{months:1},"constrain");u=IA(d.year,d.month,d.day-1)}let l=uvn(i);return LF(u),m8(wne(a,hg(a,lE(a,u,l,s),"year-month"),s),a)}function _Tn(t,e,n,r){let i=pb(n);t==="subtract"&&(i=wA(i));let s=jo(Gr(r)),o=Le(e,pa),a=Le(e,vn),c=u8(i);return qh(gne(Le(e,Ji),o,a,c,s),o,a)}function cD(t,e,n){let r=Math.trunc(t/e),i=t%e,s=t<0?"negative":"positive",o=Math.abs(r),a=o+1,c=SA(Math.abs(2*i)-e),u=o%2==0,l=iwe(n,s),d=i===0?o:swe(o,a,c,u,l);return e*(s==="positive"?d:-d)}function Qit(t,e,n,r){let i=y8[n]*e;return(function(s,o,a){let c=uR(s),u=uR(o),l=zt.default.divide(c,u),d=zt.default.remainder(c,u),m=iwe(a,"positive"),h,f;zt.default.lessThan(c,aE)?(h=zt.default.subtract(l,Sne),f=l):(h=l,f=zt.default.add(l,Sne));let g=GIe(IF(zt.default.multiply(d,ust)),u)*(zt.default.lessThan(c,aE)?-1:1)+0,A=zt.default.equal(d,aE)?l:swe(h,f,g,ITn(h),m);return zt.default.multiply(A,u)})(t,zt.default.BigInt(i),r)}function Uit(t,e,n,r){Lit(t);let{year:i,month:s,day:o}=t.isoDate,a=Git(t.time,e,n,r);return Zo(IA(i,s,o+a.deltaDays),a)}function Git({hour:t,minute:e,second:n,millisecond:r,microsecond:i,nanosecond:s},o,a,c){let u;switch(a){case"day":case"hour":u=1e3*(1e3*(1e3*(60*(60*t+e)+n)+r)+i)+s;break;case"minute":u=1e3*(1e3*(1e3*(60*e+n)+r)+i)+s;break;case"second":u=1e3*(1e3*(1e3*n+r)+i)+s;break;case"millisecond":u=1e3*(1e3*r+i)+s;break;case"microsecond":u=1e3*i+s;break;case"nanosecond":u=s}let l=y8[a],d=cD(u,l*o,c)/l;switch(a){case"day":return{deltaDays:d,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case"hour":return oD(d,0,0,0,0,0);case"minute":return oD(t,d,0,0,0,0);case"second":return oD(t,e,d,0,0,0);case"millisecond":return oD(t,e,n,d,0,0);case"microsecond":return oD(t,e,n,r,d,0);case"nanosecond":return oD(t,e,n,r,i,d);default:throw new Error(`Invalid unit ${a}`)}}function KIe(t,e,n,r){let i=y8[n];return t.round(zt.default.BigInt(i*e),r)}function xne(t,e){let n=y8[e];return t.fdiv(zt.default.BigInt(n))}function rw(t,e){return t.year!==e.year?SA(t.year-e.year):t.month!==e.month?SA(t.month-e.month):t.day!==e.day?SA(t.day-e.day):0}function $it(t,e){return t.hour!==e.hour?SA(t.hour-e.hour):t.minute!==e.minute?SA(t.minute-e.minute):t.second!==e.second?SA(t.second-e.second):t.millisecond!==e.millisecond?SA(t.millisecond-e.millisecond):t.microsecond!==e.microsecond?SA(t.microsecond-e.microsecond):t.nanosecond!==e.nanosecond?SA(t.nanosecond-e.nanosecond):0}function b8(t,e){let n=rw(t.isoDate,e.isoDate);return n!==0?n:$it(t.time,e.time)}function gvn(t){let e=JIe(t);return globalThis.BigInt!==void 0?globalThis.BigInt(e.toString(10)):e}function hb(t,e){let n=uR(t),{quotient:r,remainder:i}=lne(n,Gne),s=zt.default.toNumber(r);return e==="floor"&&zt.default.toNumber(i)<0&&(s-=1),e==="ceil"&&zt.default.toNumber(i)>0&&(s+=1),s}function iS(t){if(!Number.isInteger(t))throw new RangeError("epoch milliseconds must be an integer");return zt.default.multiply(zt.default.BigInt(t),Gne)}function JIe(t){let e=t;if(typeof t=="object"){let n=t[Symbol.toPrimitive];n&&typeof n=="function"&&(e=n.call(t,"number"))}if(typeof e=="number")throw new TypeError("cannot convert number to bigint");return typeof e=="bigint"?zt.default.BigInt(e.toString(10)):zt.default.BigInt(e)}var Wit=(()=>{let t=zt.default.BigInt(Date.now()%1e6);return()=>{let e=Date.now(),n=zt.default.BigInt(e),r=zt.default.add(iS(e),t);return t=zt.default.remainder(n,Gne),zt.default.greaterThan(r,g8)?g8:zt.default.lessThan(r,Cne)?Cne:r}})();function ane(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function SA(t){return t<0?-1:t>0?1:t}function Gr(t){if(t===void 0)return Object.create(null);if(Zl(t)&&t!==null)return t;throw new TypeError("Options parameter must be an object, not "+(t===null?"null":typeof t))}function DF(t,e){let n=Object.create(null);return n[t]=e,n}function AR(t,e,n,r){let i=t[e];if(i!==void 0){if(i=awe(i),!n.includes(i))throw new RangeError(`${e} must be one of ${n.join(", ")}, not ${i}`);return i}if(r===ER)throw new RangeError(`${e} option is required`);return r}function gg(t){let e=kne(t);if(!lki.includes(kne(e)))throw new RangeError(`invalid calendar identifier ${e}`);switch(e){case"ethiopic-amete-alem":return"ethioaa";case"islamicc":return"islamic-civil"}return e}function kne(t){let e="";for(let n=0;n=65&&r<=90?String.fromCharCode(r+32):String.fromCharCode(r)}return e}function fD(t){throw new TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${t==="PlainMonthDay"?"Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))":`Temporal.${t}.compare(obj1, obj2)`}, not obj1 > obj2. When coercing to strings, use \`\${obj}\` or String(obj), not '' + obj. When coercing to numbers, use properties or methods of the object, not \`+obj\`. When concatenating with strings, use \`\${str}\${obj}\` or str.concat(obj), not str + obj. In React, coerce to a string before rendering a Temporal object.`)}var gki=new RegExp(`^${QTn.source}$`),Aki=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function Avn(t,e,n,r=t(e),i=t(n)){let s=e,o=n,a=r,c=i;for(;o-s>1;){let u=Math.trunc((s+o)/2),l=t(u);l===a?(s=u,a=l):l===c&&(o=u,c=l)}return o}function yvn(t){return[...t]}function Evn(t,e){if(t!=="gregory"&&t!=="iso8601")return;let n=Zne[t],r=e.year,{dayOfWeek:i,dayOfYear:s,daysInYear:o}=n.isoToDate(e,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),a=n.getFirstDayOfWeek(),c=n.getMinimalDaysInFirstWeek(),u=(i+7-a)%7,l=(i-s+7001-a)%7,d=Math.floor((s-1+l)/7);if(7-l>=c&&++d,d==0)d=(function(m,h,f,g){let A=(g-m-f+1)%7;A<0&&(A+=7);let y=Math.floor((f+A-1)/7);return 7-A>=h&&++y,y})(a,c,s+n.isoToDate(n.dateAdd(e,{years:-1},"constrain"),{daysInYear:!0}).daysInYear,i),r--;else if(s>=o-5){let m=(u+o-s)%7;m<0&&(m+=7),6-m>=c&&s+7-u>o&&(d=1,r++)}return{week:d,year:r}}function xTn(t,e,n,r,i){if(e!==i.year){if(t*(e-i.year)>0)return!0}else if(n!==i.month){if(t*(n-i.month)>0)return!0}else if(r!==i.day&&t*(r-i.day)>0)return!0;return!1}var Zne={};function PF(t){if(!t.startsWith("M"))throw new RangeError(`Invalid month code: ${t}. Month codes must start with M.`);let e=+t.slice(1);if(Number.isNaN(e))throw new RangeError(`Invalid month code: ${t}`);return e}function ew(t,e=!1){return`M${`${t}`.padStart(2,"0")}${e?"L":""}`}function bst(t,e=void 0,n=12){let{month:r,monthCode:i}=t;if(i===void 0){if(r===void 0)throw new TypeError("Either month or monthCode are required");e==="reject"&&tm(r,1,n),e==="constrain"&&(r=dg(r,1,n)),i=ew(r)}else{let s=PF(i);if(i!==ew(s))throw new RangeError(`Invalid month code: ${i}`);if(r!==void 0&&r!==s)throw new RangeError(`monthCode ${i} and month ${r} must match if both are present`);if(r=s,r<1||r>n)throw new RangeError(`Invalid monthCode: ${i}`)}return{...t,month:r,monthCode:i}}Zne.iso8601={resolveFields(t,e){if((e==="date"||e==="year-month")&&t.year===void 0)throw new TypeError("year is required");if((e==="date"||e==="month-day")&&t.day===void 0)throw new TypeError("day is required");Object.assign(t,bst(t))},dateToISO:(t,e)=>bne(t.year,t.month,t.day,e),monthDayToISOReferenceDate(t,e){let{month:n,day:r}=bne(t.year??1972,t.month,t.day,e);return{month:n,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(t){let e=new Set;for(let n=0;n0;o--)s+=vF(t,o);i.dayOfYear=s}return r.weekOfYear&&(i.weekOfYear=Evn("iso8601",{year:t,month:e,day:n})),r.daysInMonth&&(i.daysInMonth=vF(t,e)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=YIe(t),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var sE=class t{constructor(e){if(this.map=new Map,this.calls=0,this.hits=0,this.misses=0,e!==void 0){let n=0;for(let r of e.map.entries()){if(++n>t.MAX_CACHE_ENTRIES)break;this.map.set(...r)}}}get(e){let n=this.map.get(e);return n&&(this.hits++,this.report()),this.calls++,n}set(e,n){this.map.set(e,n),this.misses++,this.report()}report(){}setObject(e){if(t.objectMap.get(e))throw new RangeError("object already cached");t.objectMap.set(e,this),this.report()}static getCacheForObject(e){let n=t.objectMap.get(e);return n||(n=new t,t.objectMap.set(e,n)),n}};function bvn({isoYear:t,isoMonth:e,isoDay:n}){return`${Xne(t)}-${uE(e)}-${uE(n)}T00:00Z`}function xit(t,e){return{years:t.year-e.year,months:t.month-e.month,days:t.day-e.day}}sE.objectMap=new WeakMap,sE.MAX_CACHE_ENTRIES=1e3;var bR=class{constructor(){this.eras=[],this.hasEra=!1,this.erasBeginMidYear=!1}getFormatter(){return this.formatter===void 0&&(this.formatter=new Intl.DateTimeFormat(`en-US-u-ca-${this.id}`,{day:"numeric",month:"numeric",year:"numeric",era:"short",timeZone:"UTC"})),this.formatter}getCalendarParts(e){let n=this.getFormatter(),r=new Date(e);if(e==="-271821-04-19T00:00Z"){let i=n.resolvedOptions();n=new Intl.DateTimeFormat(i.locale,{...i,timeZone:"Etc/GMT+1"}),r=new Date("-271821-04-20T00:00Z")}try{return n.formatToParts(r)}catch{throw new RangeError(`Invalid ISO date: ${e}`)}}isoToCalendarDate(e,n){let{year:r,month:i,day:s}=e,o=JSON.stringify({func:"isoToCalendarDate",isoYear:r,isoMonth:i,isoDay:s,id:this.id}),a=n.get(o);if(a)return a;let c=bvn({isoYear:r,isoMonth:i,isoDay:s}),u=this.getCalendarParts(c),l={};for(let m=0;m13)throw new RangeError(`Invalid month ${f} from ${c}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);g[2]&&(l.monthExtra=g[2])}h==="day"&&(l.day=+f),this.hasEra&&h==="era"&&f!=null&&f!==""&&(l.era=f.split(" (")[0].normalize("NFD").replace(/[^-0-9 \p{L}]/gu,"").replace(/ /g,"-").toLowerCase())}if(this.hasEra&&l.eraYear===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);if(this.hasEra){let m=this.eras.find((h=>l.era===h.genericName));m&&(l.era=m.code)}if(this.reviseIntlEra){let{era:m,eraYear:h}=this.reviseIntlEra(l,e);l.era=m,l.eraYear=h}this.checkIcuBugs&&this.checkIcuBugs(e);let d=this.adjustCalendarDate(l,n,"constrain",!0);if(d.year===void 0)throw new RangeError(`Missing year converting ${JSON.stringify(e)}`);if(d.month===void 0)throw new RangeError(`Missing month converting ${JSON.stringify(e)}`);if(d.day===void 0)throw new RangeError(`Missing day converting ${JSON.stringify(e)}`);return n.set(o,d),["constrain","reject"].forEach((m=>{let h=JSON.stringify({func:"calendarToIsoDate",year:d.year,month:d.month,day:d.day,overflow:m,id:this.id});n.set(h,e)})),d}validateCalendarDate(e){let{month:n,year:r,day:i,eraYear:s,monthCode:o,monthExtra:a}=e;if(a!==void 0)throw new RangeError("Unexpected `monthExtra` value");if(r===void 0&&s===void 0)throw new TypeError("year or eraYear is required");if(n===void 0&&o===void 0)throw new TypeError("month or monthCode is required");if(i===void 0)throw new RangeError("Missing day");if(o!==void 0){if(typeof o!="string")throw new RangeError("monthCode must be a string, not "+typeof o);if(!/^M([01]?\d)(L?)$/.test(o))throw new RangeError(`Invalid monthCode: ${o}`)}if(this.hasEra&&e.era===void 0!=(e.eraYear===void 0))throw new TypeError("properties era and eraYear must be provided together")}adjustCalendarDate(e,n=void 0,r="constrain",i=!1){if(this.calendarType==="lunisolar")throw new RangeError("Override required for lunisolar calendars");let s=e;this.validateCalendarDate(s);let o=this.monthsInYear(s,n),{month:a,monthCode:c}=s;return{month:a,monthCode:c}=bst(s,r,o),{...s,month:a,monthCode:c}}regulateMonthDayNaive(e,n,r){let i=this.monthsInYear(e,r),{month:s,day:o}=e;return n==="reject"?(tm(s,1,i),tm(o,1,this.maximumMonthLength(e))):(s=dg(s,1,i),o=dg(o,1,this.maximumMonthLength({...e,month:s}))),{...e,month:s,day:o}}calendarToIsoDate(e,n="constrain",r){let i=e,s=this.adjustCalendarDate(e,r,n,!1);s=this.regulateMonthDayNaive(s,n,r);let{year:o,month:a,day:c}=s,u=JSON.stringify({func:"calendarToIsoDate",year:o,month:a,day:c,overflow:n,id:this.id}),l,d=r.get(u);if(d||i.year!==void 0&&i.month!==void 0&&i.day!==void 0&&(i.year!==s.year||i.month!==s.month||i.day!==s.day)&&(l=JSON.stringify({func:"calendarToIsoDate",year:i.year,month:i.month,day:i.day,overflow:n,id:this.id}),d=r.get(l),d))return d;let m=this.estimateIsoDate({year:o,month:a,day:c}),h=E=>{let _=this.addDaysIso(m,E);if(s.day>this.minimumMonthLength(s)){let S=this.isoToCalendarDate(_,r);for(;S.month!==a||S.year!==o;){if(n==="reject")throw new RangeError(`day ${c} does not exist in month ${a} of year ${o}`);_=this.addDaysIso(_,-1),S=this.isoToCalendarDate(_,r)}}return _},f=0,g=this.isoToCalendarDate(m,r),A=xit(s,g);if(A.years!==0||A.months!==0||A.days!==0){let E=365*A.years+30*A.months+A.days;m=this.addDaysIso(m,E),g=this.isoToCalendarDate(m,r),A=xit(s,g),A.years===0&&A.months===0?m=h(A.days):f=this.compareCalendarDates(s,g)}let y=8;for(;f;){m=this.addDaysIso(m,f*y);let E=g;g=this.isoToCalendarDate(m,r);let _=f;if(f=this.compareCalendarDates(s,g),f){if(A=xit(s,g),A.years===0&&A.months===0)m=h(A.days),f=0;else if(_&&f!==_)if(y>1)y/=2;else{if(n==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(g,E)>0&&(m=this.addDaysIso(m,-1)),f=0}}}if(r.set(u,m),l&&r.set(l,m),s.year===void 0||s.month===void 0||s.day===void 0||s.monthCode===void 0||this.hasEra&&(s.era===void 0||s.eraYear===void 0))throw new RangeError("Unexpected missing property");return m}compareCalendarDates(e,n){return e.year!==n.year?SA(e.year-n.year):e.month!==n.month?SA(e.month-n.month):e.day!==n.day?SA(e.day-n.day):0}regulateDate(e,n="constrain",r){let i=this.calendarToIsoDate(e,n,r);return this.isoToCalendarDate(i,r)}addDaysIso(e,n){return IA(e.year,e.month,e.day+n)}addDaysCalendar(e,n,r){let i=this.calendarToIsoDate(e,"constrain",r),s=this.addDaysIso(i,n);return this.isoToCalendarDate(s,r)}addMonthsCalendar(e,n,r,i){let s=e,{day:o}=s;for(let a=0,c=Math.abs(n);a0){let f=this.monthsInYear(l,i);for(;s.month-1!=u%f;)h=this.addDaysIso(h,-1),s=this.isoToCalendarDate(h,i)}s.day!==o&&(s=this.regulateDate({...s,day:o},"constrain",i))}if(r==="reject"&&s.day!==o)throw new RangeError(`Day ${o} does not exist in resulting calendar month`);return s}addCalendar(e,{years:n=0,months:r=0,weeks:i=0,days:s=0},o,a){let{year:c,day:u,monthCode:l}=e,d=this.adjustCalendarDate({year:c+n,monthCode:l,day:u},a),m=this.addMonthsCalendar(d,r,o,a),h=s+7*i;return this.addDaysCalendar(m,h,a)}untilCalendar(e,n,r,i){let s=0,o=0,a=0,c=0;switch(r){case"day":s=this.calendarDaysUntil(e,n,i);break;case"week":{let u=this.calendarDaysUntil(e,n,i);s=u%7,o=(u-s)/7;break}case"month":case"year":{let u=this.compareCalendarDates(n,e);if(!u)return{years:0,months:0,weeks:0,days:0};let l=n.year-e.year,d=n.day-e.day;if(r==="year"&&l){let f=0;n.monthCode>e.monthCode&&(f=1),n.monthCode=0);a-=u,s=this.calendarDaysUntil(m,n,i);break}}return{years:c,months:a,weeks:o,days:s}}daysInMonth(e,n){let{day:r}=e,i=this.maximumMonthLength(e),s=this.minimumMonthLength(e);if(s===i)return s;let o=r<=i-s?i:s,a=this.calendarToIsoDate(e,"constrain",n),c=this.addDaysIso(a,o),u=this.isoToCalendarDate(c,n),l=this.addDaysIso(c,-u.day);return this.isoToCalendarDate(l,n).day}daysInPreviousMonth(e,n){let{day:r,month:i,year:s}=e,o={year:i>1?s:s-1,month:i,day:1},a=i>1?i-1:this.monthsInYear(o,n);o={...o,month:a};let c=this.minimumMonthLength(o),u=this.maximumMonthLength(o);if(c===u)return u;let l=this.calendarToIsoDate(e,"constrain",n),d=this.addDaysIso(l,-r);return this.isoToCalendarDate(d,n).day}startOfCalendarYear(e){return{year:e.year,month:1,monthCode:"M01",day:1}}startOfCalendarMonth(e){return{year:e.year,month:e.month,day:1}}calendarDaysUntil(e,n,r){let i=this.calendarToIsoDate(e,"constrain",r),s=this.calendarToIsoDate(n,"constrain",r);return NF(s.year,s.month-1,s.day)-NF(i.year,i.month-1,i.day)}monthDaySearchStartYear(e,n){return 1972}monthDayFromFields(e,n,r){let i,s,o,a,c,{era:u,eraYear:l,year:d,month:m,monthCode:h,day:f}=e;if(m!==void 0&&d===void 0&&(!this.hasEra||u===void 0||l===void 0))throw new TypeError("when month is present, year (or era and eraYear) are required");(h===void 0||d!==void 0||this.hasEra&&l!==void 0)&&({monthCode:h,day:f}=this.isoToCalendarDate(this.calendarToIsoDate(e,n,r),r));let g={year:this.monthDaySearchStartYear(h,f),month:12,day:31},A=this.isoToCalendarDate(g,r),y=A.monthCode>h||A.monthCode===h&&A.day>=f?A.year:A.year-1;for(let E=0;E<20;E++){let _=this.adjustCalendarDate({day:f,monthCode:h,year:y-E},r),S=this.calendarToIsoDate(_,"constrain",r),C=this.isoToCalendarDate(S,r);if({year:i,month:s,day:o}=S,C.monthCode===h&&C.day===f)return{month:s,day:o,year:i};if(n==="constrain"){let I=this.maxLengthOfMonthCodeInAnyYear(C.monthCode);if(C.monthCode===h&&C.day===I&&f>I)return{month:s,day:o,year:i};(a===void 0||C.monthCode===a.monthCode&&C.day>a.day)&&(a=C,c=S)}}if(n==="constrain"&&c!==void 0)return c;throw new RangeError(`No recent ${this.id} year with monthCode ${h} and day ${f}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},Hit=class extends bR{constructor(){super(...arguments),this.id="hebrew",this.calendarType="lunisolar",this.months={Tishri:{leap:1,regular:1,monthCode:"M01",days:30},Heshvan:{leap:2,regular:2,monthCode:"M02",days:{min:29,max:30}},Kislev:{leap:3,regular:3,monthCode:"M03",days:{min:29,max:30}},Tevet:{leap:4,regular:4,monthCode:"M04",days:29},Shevat:{leap:5,regular:5,monthCode:"M05",days:30},Adar:{leap:void 0,regular:6,monthCode:"M06",days:29},"Adar I":{leap:6,regular:void 0,monthCode:"M05L",days:30},"Adar II":{leap:7,regular:void 0,monthCode:"M06",days:29},Nisan:{leap:8,regular:7,monthCode:"M07",days:30},Iyar:{leap:9,regular:8,monthCode:"M08",days:29},Sivan:{leap:10,regular:9,monthCode:"M09",days:30},Tamuz:{leap:11,regular:10,monthCode:"M10",days:29},Av:{leap:12,regular:11,monthCode:"M11",days:30},Elul:{leap:13,regular:12,monthCode:"M12",days:29}}}inLeapYear(e){let{year:n}=e;return(7*n+1)%19<7}monthsInYear(e){return this.inLeapYear(e)?13:12}minimumMonthLength(e){return this.minMaxMonthLength(e,"min")}maximumMonthLength(e){return this.minMaxMonthLength(e,"max")}minMaxMonthLength(e,n){let{month:r,year:i}=e,s=this.getMonthCode(i,r),o=Object.entries(this.months).find((c=>c[1].monthCode===s));if(o===void 0)throw new RangeError(`unmatched Hebrew month: ${r}`);let a=o[1].days;return typeof a=="number"?a:a[n]}maxLengthOfMonthCodeInAnyYear(e){return["M04","M06","M08","M10","M12"].includes(e)?29:30}estimateIsoDate(e){let{year:n}=e;return{year:n-3760,month:1,day:1}}getMonthCode(e,n){return this.inLeapYear({year:e})?n===6?ew(5,!0):ew(n<6?n:n-1):ew(n)}adjustCalendarDate(e,n,r="constrain",i=!1){let{year:s,month:o,monthCode:a,day:c,monthExtra:u}=e;if(s===void 0)throw new TypeError("Missing property: year");if(i){if(u){let l=this.months[u];if(!l)throw new RangeError(`Unrecognized month from formatToParts: ${u}`);o=this.inLeapYear({year:s})?l.leap:l.regular}return a=this.getMonthCode(s,o),{year:s,month:o,day:c,monthCode:a}}if(this.validateCalendarDate(e),o===void 0)if(a.endsWith("L")){if(a!=="M05L")throw new RangeError(`Hebrew leap month must have monthCode M05L, not ${a}`);if(o=6,!this.inLeapYear({year:s})){if(r==="reject")throw new RangeError(`Hebrew monthCode M05L is invalid in year ${s} which is not a leap year`);o=6,a="M06"}}else{o=PF(a),this.inLeapYear({year:s})&&o>=6&&o++;let l=this.monthsInYear({year:s});if(o<1||o>l)throw new RangeError(`Invalid monthCode: ${a}`)}else if(r==="reject"?(tm(o,1,this.monthsInYear({year:s})),tm(c,1,this.maximumMonthLength({year:s,month:o}))):(o=dg(o,1,this.monthsInYear({year:s})),c=dg(c,1,this.maximumMonthLength({year:s,month:o}))),a===void 0)a=this.getMonthCode(s,o);else if(this.getMonthCode(s,o)!==a)throw new RangeError(`monthCode ${a} doesn't correspond to month ${o} in Hebrew year ${s}`);return{...e,day:c,month:o,monthCode:a,year:s}}},mD=class extends bR{constructor(){super(...arguments),this.calendarType="lunar",this.DAYS_PER_ISLAMIC_YEAR=354+11/30,this.DAYS_PER_ISO_YEAR=365.2425}inLeapYear(e,n){let r={year:e.year,month:1,monthCode:"M01",day:1},i={year:e.year+1,month:1,monthCode:"M01",day:1};return this.calendarDaysUntil(r,i,n)===355}monthsInYear(){return 12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(){return 30}estimateIsoDate(e){let{year:n}=this.adjustCalendarDate(e);return{year:Math.floor(n*this.DAYS_PER_ISLAMIC_YEAR/this.DAYS_PER_ISO_YEAR)+622,month:1,day:1}}},qit=class extends mD{constructor(){super(...arguments),this.id="islamic"}},jit=class extends mD{constructor(){super(...arguments),this.id="islamic-umalqura"}},Vit=class extends mD{constructor(){super(...arguments),this.id="islamic-tbla"}},Yit=class extends mD{constructor(){super(...arguments),this.id="islamic-civil"}},zit=class extends mD{constructor(){super(...arguments),this.id="islamic-rgsa"}},Kit=class extends mD{constructor(){super(...arguments),this.id="islamicc"}},Jit=class extends bR{constructor(){super(...arguments),this.id="persian",this.calendarType="solar"}inLeapYear(e,n){return this.daysInMonth({year:e.year,month:12,day:1},n)===30}monthsInYear(){return 12}minimumMonthLength(e){let{month:n}=e;return n===12?29:n<=6?31:30}maximumMonthLength(e){let{month:n}=e;return n===12?30:n<=6?31:30}maxLengthOfMonthCodeInAnyYear(e){return PF(e)<=6?31:30}estimateIsoDate(e){let{year:n}=this.adjustCalendarDate(e);return{year:n+621,month:1,day:1}}},Xit=class extends bR{constructor(){super(...arguments),this.id="indian",this.calendarType="solar",this.months={1:{length:30,month:3,day:22,leap:{length:31,month:3,day:21}},2:{length:31,month:4,day:21},3:{length:31,month:5,day:22},4:{length:31,month:6,day:22},5:{length:31,month:7,day:23},6:{length:31,month:8,day:23},7:{length:30,month:9,day:23},8:{length:30,month:10,day:23},9:{length:30,month:11,day:22},10:{length:30,month:12,day:22},11:{length:30,month:1,nextYear:!0,day:21},12:{length:30,month:2,nextYear:!0,day:20}},this.vulnerableToBceBug=new Date("0000-01-01T00:00Z").toLocaleDateString("en-US-u-ca-indian",{timeZone:"UTC"})!=="10/11/-79 Saka"}inLeapYear(e){return _st(e.year+78)}monthsInYear(){return 12}minimumMonthLength(e){return this.getMonthInfo(e).length}maximumMonthLength(e){return this.getMonthInfo(e).length}maxLengthOfMonthCodeInAnyYear(e){let n=PF(e),r=this.months[n];return r=r.leap??r,r.length}getMonthInfo(e){let{month:n}=e,r=this.months[n];if(r===void 0)throw new RangeError(`Invalid month: ${n}`);return this.inLeapYear(e)&&r.leap&&(r=r.leap),r}estimateIsoDate(e){let n=this.adjustCalendarDate(e),r=this.getMonthInfo(n);return IA(n.year+78+(r.nextYear?1:0),r.month,r.day+n.day-1)}checkIcuBugs(e){if(this.vulnerableToBceBug&&e.year<1)throw new RangeError(`calendar '${this.id}' is broken for ISO dates before 0001-01-01 (see https://bugs.chromium.org/p/v8/issues/detail?id=10529)`)}};function _st(t){return t%4==0&&(t%100!=0||t%400==0)}var XIe=class extends bR{constructor(e,n){super(),this.calendarType="solar",this.id=e,this.isoEpoch=n}inLeapYear(e){let{year:n}=this.estimateIsoDate({month:1,day:1,year:e.year});return _st(n)}monthsInYear(){return 12}minimumMonthLength(e){let{month:n}=e;return n===2?this.inLeapYear(e)?29:28:[4,6,9,11].indexOf(n)>=0?30:31}maximumMonthLength(e){return this.minimumMonthLength(e)}maxLengthOfMonthCodeInAnyYear(e){return[31,29,31,30,31,30,31,31,30,31,30,31][PF(e)-1]}estimateIsoDate(e){let n=this.adjustCalendarDate(e);return bne(n.year+this.isoEpoch.year,n.month+this.isoEpoch.month,n.day+this.isoEpoch.day,"constrain")}},ZIe=class extends bR{constructor(e,n){super(),this.hasEra=!0,this.calendarType="solar",this.id=e;let{eras:r,anchorEra:i}=(function(s){let o,a=s;if(a.length===0)throw new RangeError("Invalid era data: eras are required");if(a.length===1&&a[0].reverseOf)throw new RangeError("Invalid era data: anchor era cannot count years backwards");if(a.length===1&&!a[0].code)throw new RangeError("Invalid era data: at least one named era is required");if(a.filter((u=>u.reverseOf!=null)).length>1)throw new RangeError("Invalid era data: only one era can count years backwards");a.forEach((u=>{if(u.isAnchor||!u.anchorEpoch&&!u.reverseOf){if(o)throw new RangeError("Invalid era data: cannot have multiple anchor eras");o=u,u.anchorEpoch={year:u.hasYearZero?0:1}}else if(!u.code)throw new RangeError("If era name is blank, it must be the anchor era")})),a=a.filter((u=>u.code)),a.forEach((u=>{let{reverseOf:l}=u;if(l){let d=a.find((m=>m.code===l));if(d===void 0)throw new RangeError(`Invalid era data: unmatched reverseOf era: ${l}`);u.reverseOf=d,u.anchorEpoch=d.anchorEpoch,u.isoEpoch=d.isoEpoch}u.anchorEpoch.month===void 0&&(u.anchorEpoch.month=1),u.anchorEpoch.day===void 0&&(u.anchorEpoch.day=1)})),a.sort(((u,l)=>{if(u.reverseOf)return 1;if(l.reverseOf)return-1;if(!u.isoEpoch||!l.isoEpoch)throw new RangeError("Invalid era data: missing ISO epoch");return l.isoEpoch.year-u.isoEpoch.year}));let c=a[a.length-1].reverseOf;if(c&&c!==a[a.length-2])throw new RangeError("Invalid era data: invalid reverse-sign era");return a.forEach(((u,l)=>{u.genericName="era"+(a.length-1-l)})),{eras:a,anchorEra:o||a[0]}})(n);this.anchorEra=i,this.eras=r}inLeapYear(e){let{year:n}=this.estimateIsoDate({month:1,day:1,year:e.year});return _st(n)}monthsInYear(){return 12}minimumMonthLength(e){let{month:n}=e;return n===2?this.inLeapYear(e)?29:28:[4,6,9,11].indexOf(n)>=0?30:31}maximumMonthLength(e){return this.minimumMonthLength(e)}maxLengthOfMonthCodeInAnyYear(e){return[31,29,31,30,31,30,31,31,30,31,30,31][PF(e)-1]}completeEraYear(e){let n=(a,c,u)=>{let l=e[a];if(l!=null&&l!=c&&!(u||[]).includes(l)){let d=u?.[0];throw new RangeError(`Input ${a} ${l} doesn't match calculated value ${d?`${c} (also called ${d})`:c}`)}},r=a=>{let c,u={...e,year:a},l=this.eras.find(((d,m)=>{if(m===this.eras.length-1){if(d.reverseOf){if(a>0)throw new RangeError(`Signed year ${a} is invalid for era ${d.code}`);return c=d.anchorEpoch.year-a,!0}return c=a-d.anchorEpoch.year+(d.hasYearZero?0:1),!0}return this.compareCalendarDates(u,d.anchorEpoch)>=0&&(c=a-d.anchorEpoch.year+(d.hasYearZero?0:1),!0)}));if(!l)throw new RangeError(`Year ${a} was not matched by any era`);return{eraYear:c,era:l.code,eraNames:l.names}},{year:i,eraYear:s,era:o}=e;if(i!=null){let a=r(i);({eraYear:s,era:o}=a),n("era",o,a?.eraNames),n("eraYear",s)}else{if(s==null)throw new RangeError("Either year or eraYear and era are required");{if(o===void 0)throw new RangeError("era and eraYear must be provided together");let a=this.eras.find((({code:c,names:u=[]})=>c===o||u.includes(o)));if(!a)throw new RangeError(`Era ${o} (ISO year ${s}) was not matched by any era`);i=a.reverseOf?a.anchorEpoch.year-s:s+a.anchorEpoch.year-(a.hasYearZero?0:1),n("year",i),{eraYear:s,era:o}=r(i)}}return{...e,year:i,eraYear:s,era:o}}adjustCalendarDate(e,n,r="constrain"){let i=e,{month:s,monthCode:o}=i;return s===void 0&&(i={...i,month:PF(o)}),this.validateCalendarDate(i),i=this.completeEraYear(i),super.adjustCalendarDate(i,n,r)}estimateIsoDate(e){let n=this.adjustCalendarDate(e),{year:r,month:i,day:s}=n,{anchorEra:o}=this;return bne(r+o.isoEpoch.year-(o.hasYearZero?0:1),i,s,"constrain")}},Bne=class extends ZIe{constructor(e,n){super(e,n)}isoToCalendarDate(e){let{year:n,month:r,day:i}=e,s=ew(r),o=n-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:o,month:r,monthCode:s,day:i})}},XI={inLeapYear(t){let{year:e}=t;return(e+1)%4==0},monthsInYear:()=>13,minimumMonthLength(t){let{month:e}=t;return e===13?this.inLeapYear(t)?6:5:30},maximumMonthLength(t){return this.minimumMonthLength(t)},maxLengthOfMonthCodeInAnyYear:t=>t==="M13"?6:30},Zit=class extends XIe{constructor(e,n){super(e,n),this.inLeapYear=XI.inLeapYear,this.monthsInYear=XI.monthsInYear,this.minimumMonthLength=XI.minimumMonthLength,this.maximumMonthLength=XI.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=XI.maxLengthOfMonthCodeInAnyYear}},ewe=class extends ZIe{constructor(e,n){super(e,n),this.inLeapYear=XI.inLeapYear,this.monthsInYear=XI.monthsInYear,this.minimumMonthLength=XI.minimumMonthLength,this.maximumMonthLength=XI.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=XI.maxLengthOfMonthCodeInAnyYear}},est=class extends Zit{constructor(){super("ethioaa",{year:-5492,month:7,day:17})}},tst=class extends ewe{constructor(){super("coptic",[{code:"coptic",isoEpoch:{year:284,month:8,day:29}},{code:"coptic-inverse",reverseOf:"coptic"}])}},nst=class extends ewe{constructor(){super("ethiopic",[{code:"ethioaa",names:["ethiopic-amete-alem","mundi"],isoEpoch:{year:-5492,month:7,day:17}},{code:"ethiopic",names:["incar"],isoEpoch:{year:8,month:8,day:27},anchorEpoch:{year:5501}}])}},rst=class extends Bne{constructor(){super("roc",[{code:"roc",names:["minguo"],isoEpoch:{year:1912,month:1,day:1}},{code:"roc-inverse",names:["before-roc"],reverseOf:"roc"}])}},ist=class extends XIe{constructor(){super("buddhist",{year:-543,month:1,day:1})}},sst=class extends Bne{constructor(){super("gregory",[{code:"gregory",names:["ad","ce"],isoEpoch:{year:1,month:1,day:1}},{code:"gregory-inverse",names:["be","bce"],reverseOf:"gregory"}])}reviseIntlEra(e){let{era:n,eraYear:r}=e;return n==="b"&&(n="gregory-inverse"),n==="a"&&(n="gregory"),{era:n,eraYear:r}}getFirstDayOfWeek(){return 1}getMinimalDaysInFirstWeek(){return 1}},ost=class extends Bne{constructor(){super("japanese",[{code:"reiwa",isoEpoch:{year:2019,month:5,day:1},anchorEpoch:{year:2019,month:5,day:1}},{code:"heisei",isoEpoch:{year:1989,month:1,day:8},anchorEpoch:{year:1989,month:1,day:8}},{code:"showa",isoEpoch:{year:1926,month:12,day:25},anchorEpoch:{year:1926,month:12,day:25}},{code:"taisho",isoEpoch:{year:1912,month:7,day:30},anchorEpoch:{year:1912,month:7,day:30}},{code:"meiji",isoEpoch:{year:1868,month:9,day:8},anchorEpoch:{year:1868,month:9,day:8}},{code:"japanese",names:["japanese","gregory","ad","ce"],isoEpoch:{year:1,month:1,day:1}},{code:"japanese-inverse",names:["japanese-inverse","gregory-inverse","bc","bce"],reverseOf:"japanese"}]),this.erasBeginMidYear=!0}reviseIntlEra(e,n){let{era:r,eraYear:i}=e,{year:s}=n;return this.eras.find((o=>o.code===r))?{era:r,eraYear:i}:s<1?{era:"japanese-inverse",eraYear:1-s}:{era:"japanese",eraYear:s}}},twe=class extends bR{constructor(){super(...arguments),this.calendarType="lunisolar"}inLeapYear(e,n){let r=this.getMonthList(e.year,n);return Object.entries(r).length===13}monthsInYear(e,n){return this.inLeapYear(e,n)?13:12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(e){return["M01L","M09L","M10L","M11L","M12L"].includes(e)?29:30}monthDaySearchStartYear(e,n){let r={M01L:[1651,1651],M02L:[1947,1765],M03L:[1966,1955],M04L:[1963,1944],M05L:[1971,1952],M06L:[1960,1941],M07L:[1968,1938],M08L:[1957,1718],M09L:[1832,1832],M10L:[1870,1870],M11L:[1814,1814],M12L:[1890,1890]}[e]??[1972,1972];return n<30?r[0]:r[1]}getMonthList(e,n){if(e===void 0)throw new TypeError("Missing year");let r=JSON.stringify({func:"getMonthList",calendarYear:e,id:this.id}),i=n.get(r);if(i)return i;let s=this.getFormatter(),o=(A,y)=>{let E=bvn({isoYear:A,isoMonth:2,isoDay:1}),_=new Date(E);_.setUTCDate(y+1);let S=s.formatToParts(_),C=S.find((N=>N.type==="month")).value,I=+S.find((N=>N.type==="day")).value,w=S.find((N=>N.type==="relatedYear")),k;if(w===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return k=+w.value,{calendarMonthString:C,calendarDay:I,calendarYearToVerify:k}},a=17,{calendarMonthString:c,calendarDay:u,calendarYearToVerify:l}=o(e,a);c!=="1"&&(a+=29,{calendarMonthString:c,calendarDay:u}=o(e,a)),a-=u-5;let d={},m,h,f=1,g=!1;do({calendarMonthString:c,calendarDay:u,calendarYearToVerify:l}=o(e,a)),m&&(d[h].daysInMonth=m+30-u),l!==e?g=!0:(d[c]={monthIndex:f++},a+=30),m=u,h=c;while(!g);return d[h].daysInMonth=m+30-u,n.set(r,d),d}estimateIsoDate(e){let{year:n,month:r}=e;return{year:n,month:r>=12?12:r+1,day:1}}adjustCalendarDate(e,n,r="constrain",i=!1){let{year:s,month:o,monthExtra:a,day:c,monthCode:u}=e;if(s===void 0)throw new TypeError("Missing property: year");if(i){if(a&&a!=="bis")throw new RangeError(`Unexpected leap month suffix: ${a}`);let l=ew(o,a!==void 0),d=`${o}${a||""}`,m=this.getMonthList(s,n)[d];if(m===void 0)throw new RangeError(`Unmatched month ${d} in Chinese year ${s}`);return o=m.monthIndex,{year:s,month:o,day:c,monthCode:l}}if(this.validateCalendarDate(e),o===void 0){let l=this.getMonthList(s,n),d=u.replace(/^M|L$/g,(h=>h==="L"?"bis":""));d[0]==="0"&&(d=d.slice(1));let m=l[d];if(o=m&&m.monthIndex,o===void 0&&u.endsWith("L")&&u!="M13L"&&r==="constrain"){let h=+u.replace(/^M0?|L$/g,"");m=l[h],m&&(o=m.monthIndex,u=ew(h))}if(o===void 0)throw new RangeError(`Unmatched month ${u} in Chinese year ${s}`)}else if(u===void 0){let l=this.getMonthList(s,n),d=Object.entries(l),m=d.length;r==="reject"?(tm(o,1,m),tm(c,1,this.maximumMonthLength())):(o=dg(o,1,m),c=dg(c,1,this.maximumMonthLength()));let h=d.find((f=>f[1].monthIndex===o));if(h===void 0)throw new RangeError(`Invalid month ${o} in Chinese year ${s}`);u=ew(+h[0].replace("bis",""),h[0].indexOf("bis")!==-1)}else{let l=this.getMonthList(s,n),d=u.replace(/^M|L$/g,(h=>h==="L"?"bis":""));d[0]==="0"&&(d=d.slice(1));let m=l[d];if(!m)throw new RangeError(`Unmatched monthCode ${u} in Chinese year ${s}`);if(o!==m.monthIndex)throw new RangeError(`monthCode ${u} doesn't correspond to month ${o} in Chinese year ${s}`)}return{...e,year:s,month:o,monthCode:u,day:c}}},ast=class extends twe{constructor(){super(...arguments),this.id="chinese"}},cst=class extends twe{constructor(){super(...arguments),this.id="dangi"}},lst=class{constructor(e){this.helper=e}extraFields(e){return this.helper.hasEra&&e.includes("year")?["era","eraYear"]:[]}resolveFields(e){if(this.helper.calendarType!=="lunisolar"){let n=new sE;bst(e,void 0,this.helper.monthsInYear({year:e.year??1972},n))}}dateToISO(e,n){let r=new sE,i=this.helper.calendarToIsoDate(e,n,r);return r.setObject(i),i}monthDayToISOReferenceDate(e,n){let r=new sE,i=this.helper.monthDayFromFields(e,n,r);return r.setObject(i),i}fieldKeysToIgnore(e){let n=new Set;for(let r=0;r1&&pR(u)==="date"&&i!==u)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(o){let g=u8(this),A=Le(o,pa),y=Le(o,vn),E=Le(o,Ji);return g=fvn(E,gne(E,A,y,g),A,y,i,a,u,c),pR(i)==="date"&&(i="hour"),db(g,i)}if(s){let g=ZI(this),A=E8({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},g.time),y=Le(s,Xi),E=Le(s,vn),_=lE(E,y,jh(g.date,A.deltaDays),"constrain");return g=hvn(Zo(y,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Zo(_,A),E,i,a,u,c),db(g,i)}if(JI(n))throw new RangeError(`a starting point is required for ${n}s balancing`);if(JI(i))throw new RangeError(`a starting point is required for ${i}s balancing`);let f=ZI(this);if(u==="day"){let{quotient:g,remainder:A}=f.time.divmod(WIe),y=f.date.days+g+xne(A,"day");y=cD(y,a,c),f=gR({years:0,months:0,weeks:0,days:y},Ka.ZERO)}else f=gR({years:0,months:0,weeks:0,days:0},KIe(f.time,a,u,c));return db(f,i)}total(e){if(nn(this,Kl),e===void 0)throw new TypeError("options argument is required");let n=typeof e=="string"?DF("unit",e):Gr(e),{plainRelativeTo:r,zonedRelativeTo:i}=_it(n),s=CA(n,"unit","datetime",ER);if(i){let a=u8(this),c=Le(i,pa),u=Le(i,vn),l=Le(i,Ji);return(function(d,m,h,f,g){return pR(g)==="time"?xne(Ka.fromEpochNsDiff(m,d),g):cTn(pvn(d,m,h,f,g),m,mb(h,d),h,f,g)})(l,gne(l,c,u,a),c,u,s)}if(r){let a=ZI(this),c=E8({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},a.time),u=Le(r,Xi),l=Le(r,vn),d=lE(l,u,jh(a.date,c.deltaDays),"constrain");return(function(m,h,f,g){if(b8(m,h)==0)return 0;BF(m),BF(h);let A=dvn(m,h,f,g);return g==="nanosecond"?zt.default.toNumber(A.time.totalNs):cTn(A,Jm(h),m,null,f,g)})(Zo(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Zo(d,c),l,s)}let o=dR(this);if(JI(o))throw new RangeError(`a starting point is required for ${o}s total`);if(JI(s))throw new RangeError(`a starting point is required for ${s}s total`);return xne(ZI(this).time,s)}toString(e=void 0){nn(this,Kl);let n=Gr(e),r=qne(n),i=sS(n,"trunc"),s=CA(n,"smallestUnit","time",void 0);if(s==="hour"||s==="minute")throw new RangeError('smallestUnit must be a time unit other than "hours" or "minutes"');let{precision:o,unit:a,increment:c}=jne(s,r);if(a==="nanosecond"&&c===1)return QIe(this,o);let u=dR(this),l=u8(this),d=KIe(l.time,c,a,i);return l=gR(l.date,d),QIe(db(l,fR(u,"second")),o)}toJSON(){return nn(this,Kl),QIe(this,"auto")}toLocaleString(e=void 0,n=void 0){if(nn(this,Kl),typeof Intl.DurationFormat=="function"){let r=new Intl.DurationFormat(e,n);return xst.call(r,this)}return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."),QIe(this,"auto")}valueOf(){fD("Duration")}static from(e){return pb(e)}static compare(e,n,r=void 0){let i=pb(e),s=pb(n),o=Gr(r),{plainRelativeTo:a,zonedRelativeTo:c}=_it(o);if(Le(i,rg)===Le(s,rg)&&Le(i,ig)===Le(s,ig)&&Le(i,_A)===Le(s,_A)&&Le(i,sg)===Le(s,sg)&&Le(i,og)===Le(s,og)&&Le(i,ag)===Le(s,ag)&&Le(i,cg)===Le(s,cg)&&Le(i,lg)===Le(s,lg)&&Le(i,ug)===Le(s,ug)&&Le(i,xA)===Le(s,xA))return 0;let u=dR(i),l=dR(s),d=u8(i),m=u8(s);if(c&&(pR(u)==="date"||pR(l)==="date")){let y=Le(c,pa),E=Le(c,vn),_=Le(c,Ji),S=gne(_,y,E,d),C=gne(_,y,E,m);return SA(zt.default.toNumber(zt.default.subtract(S,C)))}let h=d.date.days,f=m.date.days;if(JI(u)||JI(l)){if(!a)throw new RangeError("A starting point is required for years, months, or weeks comparison");h=aTn(d.date,a),f=aTn(m.date,a)}let g=d.time.add24HourDays(h),A=m.time.add24HourDays(f);return g.cmp(A)}};xR(One,"Temporal.Duration");var Lne=class{constructor(e,n,r="iso8601",i=1972){let s=ds(e),o=ds(n),a=gg(r===void 0?"iso8601":dp(r)),c=ds(i);kF(c,s,o),JTn(this,{year:c,month:s,day:o},a)}get monthCode(){return STn(this,"monthCode")}get day(){return STn(this,"day")}get calendarId(){return nn(this,oE),Le(this,vn)}with(e,n=void 0){if(nn(this,oE),!Zl(e))throw new TypeError("invalid argument");x8(e);let r=Le(this,vn),i=hg(r,Le(this,Xi),"month-day");return i=RF(r,i,dE(r,e,["year","month","monthCode","day"],[],"partial")),p8(jIe(r,i,jo(Gr(n))),r)}equals(e){nn(this,oE);let n=Xwn(e);return rw(Le(this,Xi),Le(n,Xi))===0&&tw(Le(this,vn),Le(n,vn))}toString(e=void 0){return nn(this,oE),rTn(this,Hne(Gr(e)))}toJSON(){return nn(this,oE),rTn(this)}toLocaleString(e=void 0,n=void 0){return nn(this,oE),new cE(e,n).format(this)}valueOf(){fD("PlainMonthDay")}toPlainDate(e){if(nn(this,oE),!Zl(e))throw new TypeError("argument should be an object");let n=Le(this,vn);return pg(pD(n,RF(n,hg(n,Le(this,Xi),"month-day"),dE(n,e,["year"],[],[])),"constrain"),n)}static from(e,n=void 0){return Xwn(e,n)}};function STn(t,e){nn(t,oE);let n=Le(t,Xi);return Vne(t).isoToDate(n,{[e]:!0})[e]}function Sit(t){return mb(t,Wit())}xR(Lne,"Temporal.PlainMonthDay");var Svn={instant:()=>rS(Wit()),plainDateTimeISO:(t=ane())=>ub(Sit(mg(t)),"iso8601"),plainDateISO:(t=ane())=>pg(Sit(mg(t)).isoDate,"iso8601"),plainTimeISO:(t=ane())=>mR(Sit(mg(t)).time),timeZoneId:()=>ane(),zonedDateTimeISO:(t=ane())=>{let e=mg(t);return qh(Wit(),e,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(Svn,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Fne=class t{constructor(e=0,n=0,r=0,i=0,s=0,o=0){let a=e===void 0?0:ds(e),c=n===void 0?0:ds(n),u=r===void 0?0:ds(r),l=i===void 0?0:ds(i),d=s===void 0?0:ds(s),m=o===void 0?0:ds(o);pwe(a,c,u,l,d,m),XTn(this,{hour:a,minute:c,second:u,millisecond:l,microsecond:d,nanosecond:m})}get hour(){return nn(this,Du),Le(this,Xl).hour}get minute(){return nn(this,Du),Le(this,Xl).minute}get second(){return nn(this,Du),Le(this,Xl).second}get millisecond(){return nn(this,Du),Le(this,Xl).millisecond}get microsecond(){return nn(this,Du),Le(this,Xl).microsecond}get nanosecond(){return nn(this,Du),Le(this,Xl).nanosecond}with(e,n=void 0){if(nn(this,Du),!Zl(e))throw new TypeError("invalid argument");x8(e);let r=Dit(e,"partial"),i=Dit(this),{hour:s,minute:o,second:a,millisecond:c,microsecond:u,nanosecond:l}=Object.assign(i,r),d=jo(Gr(n));return{hour:s,minute:o,second:a,millisecond:c,microsecond:u,nanosecond:l}=lwe(s,o,a,c,u,l,d),new t(s,o,a,c,u,l)}add(e){return nn(this,Du),ETn("add",this,e)}subtract(e){return nn(this,Du),ETn("subtract",this,e)}until(e,n=void 0){return nn(this,Du),pTn("until",this,e,n)}since(e,n=void 0){return nn(this,Du),pTn("since",this,e,n)}round(e){if(nn(this,Du),e===void 0)throw new TypeError("options parameter is required");let n=typeof e=="string"?DF("smallestUnit",e):Gr(e),r=S8(n),i=sS(n,"halfExpand"),s=CA(n,"smallestUnit","time",ER);return C8(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[s],!1),mR(Git(Le(this,Xl),r,s,i))}equals(e){nn(this,Du);let n=aD(e);return $it(Le(this,Xl),Le(n,Xl))===0}toString(e=void 0){nn(this,Du);let n=Gr(e),r=qne(n),i=sS(n,"trunc"),s=CA(n,"smallestUnit","time",void 0);if(s==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:o,unit:a,increment:c}=jne(s,r);return nTn(Git(Le(this,Xl),c,a,i),o)}toJSON(){return nn(this,Du),nTn(Le(this,Xl),"auto")}toLocaleString(e=void 0,n=void 0){return nn(this,Du),new cE(e,n).format(this)}valueOf(){fD("PlainTime")}static from(e,n=void 0){return aD(e,n)}static compare(e,n){let r=aD(e),i=aD(n);return $it(Le(r,Xl),Le(i,Xl))}};xR(Fne,"Temporal.PlainTime");var Qne=class{constructor(e,n,r="iso8601",i=1){let s=ds(e),o=ds(n),a=gg(r===void 0?"iso8601":dp(r)),c=ds(i);kF(s,o,c),ZTn(this,{year:s,month:o,day:c},a)}get year(){return lR(this,"year")}get month(){return lR(this,"month")}get monthCode(){return lR(this,"monthCode")}get calendarId(){return nn(this,Km),Le(this,vn)}get era(){return lR(this,"era")}get eraYear(){return lR(this,"eraYear")}get daysInMonth(){return lR(this,"daysInMonth")}get daysInYear(){return lR(this,"daysInYear")}get monthsInYear(){return lR(this,"monthsInYear")}get inLeapYear(){return lR(this,"inLeapYear")}with(e,n=void 0){if(nn(this,Km),!Zl(e))throw new TypeError("invalid argument");x8(e);let r=Le(this,vn),i=hg(r,Le(this,Xi),"year-month");return i=RF(r,i,dE(r,e,["year","month","monthCode"],[],"partial")),m8(wne(r,i,jo(Gr(n))),r)}add(e,n=void 0){return nn(this,Km),bTn("add",this,e,n)}subtract(e,n=void 0){return nn(this,Km),bTn("subtract",this,e,n)}until(e,n=void 0){return nn(this,Km),mTn("until",this,e,n)}since(e,n=void 0){return nn(this,Km),mTn("since",this,e,n)}equals(e){nn(this,Km);let n=hne(e);return rw(Le(this,Xi),Le(n,Xi))===0&&tw(Le(this,vn),Le(n,vn))}toString(e=void 0){return nn(this,Km),iTn(this,Hne(Gr(e)))}toJSON(){return nn(this,Km),iTn(this)}toLocaleString(e=void 0,n=void 0){return nn(this,Km),new cE(e,n).format(this)}valueOf(){fD("PlainYearMonth")}toPlainDate(e){if(nn(this,Km),!Zl(e))throw new TypeError("argument should be an object");let n=Le(this,vn);return pg(pD(n,RF(n,hg(n,Le(this,Xi),"year-month"),dE(n,e,["day"],[],[])),"constrain"),n)}static from(e,n=void 0){return hne(e,n)}static compare(e,n){let r=hne(e),i=hne(n);return rw(Le(r,Xi),Le(i,Xi))}};function lR(t,e){nn(t,Km);let n=Le(t,Xi);return Vne(t).isoToDate(n,{[e]:!0})[e]}xR(Qne,"Temporal.PlainYearMonth");var Bki=cE.prototype.resolvedOptions,Une=class{constructor(e,n,r="iso8601"){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");let i=JIe(e),s=dp(n),{tzName:o,offsetMinutes:a}=lD(s);if(a===void 0){let c=VIe(o);if(!c)throw new RangeError(`unknown time zone ${o}`);s=c.identifier}else s=mst(a);tvn(this,i,s,gg(r===void 0?"iso8601":dp(r)))}get calendarId(){return nn(this,Ys),Le(this,vn)}get timeZoneId(){return nn(this,Ys),Le(this,pa)}get year(){return ng(this,"year")}get month(){return ng(this,"month")}get monthCode(){return ng(this,"monthCode")}get day(){return ng(this,"day")}get hour(){return c8(this,"hour")}get minute(){return c8(this,"minute")}get second(){return c8(this,"second")}get millisecond(){return c8(this,"millisecond")}get microsecond(){return c8(this,"microsecond")}get nanosecond(){return c8(this,"nanosecond")}get era(){return ng(this,"era")}get eraYear(){return ng(this,"eraYear")}get epochMilliseconds(){return nn(this,Ys),hb(Le(this,Ji),"floor")}get epochNanoseconds(){return nn(this,Ys),gvn(Le(this,Ji))}get dayOfWeek(){return ng(this,"dayOfWeek")}get dayOfYear(){return ng(this,"dayOfYear")}get weekOfYear(){return ng(this,"weekOfYear")?.week}get yearOfWeek(){return ng(this,"weekOfYear")?.year}get hoursInDay(){nn(this,Ys);let e=Le(this,pa),n=KI(this).isoDate,r=IA(n.year,n.month,n.day+1),i=sD(e,n),s=sD(e,r);return xne(Ka.fromEpochNsDiff(s,i),"hour")}get daysInWeek(){return ng(this,"daysInWeek")}get daysInMonth(){return ng(this,"daysInMonth")}get daysInYear(){return ng(this,"daysInYear")}get monthsInYear(){return ng(this,"monthsInYear")}get inLeapYear(){return ng(this,"inLeapYear")}get offset(){return nn(this,Ys),Pit(hR(Le(this,pa),Le(this,Ji)))}get offsetNanoseconds(){return nn(this,Ys),hR(Le(this,pa),Le(this,Ji))}with(e,n=void 0){if(nn(this,Ys),!Zl(e))throw new TypeError("invalid zoned-date-time-like");x8(e);let r=Le(this,vn),i=Le(this,pa),s=hR(i,Le(this,Ji)),o=KI(this),a={...hg(r,o.isoDate),...o.time,offset:Pit(s)};a=RF(r,a,dE(r,e,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let c=Gr(n),u=_ne(c),l=UIe(c,"prefer"),d=Yne(r,a,jo(c)),m=I8(a.offset);return qh(qIe(d.isoDate,d.time,"option",m,i,u,l,!1),i,r)}withPlainTime(e=void 0){nn(this,Ys);let n=Le(this,pa),r=Le(this,vn),i=KI(this).isoDate,s;return s=e===void 0?sD(n,i):Vh(n,Zo(i,Le(aD(e),Xl)),"compatible"),qh(s,n,r)}withTimeZone(e){nn(this,Ys);let n=mg(e);return qh(Le(this,Ji),n,Le(this,vn))}withCalendar(e){nn(this,Ys);let n=Kne(e);return qh(Le(this,Ji),Le(this,pa),n)}add(e,n=void 0){return nn(this,Ys),_Tn("add",this,e,n)}subtract(e,n=void 0){return nn(this,Ys),_Tn("subtract",this,e,n)}until(e,n=void 0){return nn(this,Ys),hTn("until",this,e,n)}since(e,n=void 0){return nn(this,Ys),hTn("since",this,e,n)}round(e){if(nn(this,Ys),e===void 0)throw new TypeError("options parameter is required");let n=typeof e=="string"?DF("smallestUnit",e):Gr(e),r=S8(n),i=sS(n,"halfExpand"),s=CA(n,"smallestUnit","time",ER,["day"]),o={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[s];if(C8(r,o,o===1),s==="nanosecond"&&r===1)return qh(Le(this,Ji),Le(this,pa),Le(this,vn));let a=Le(this,pa),c=Le(this,Ji),u=KI(this),l;if(s==="day"){let d=u.isoDate,m=IA(d.year,d.month,d.day+1),h=sD(a,d),f=sD(a,m),g=zt.default.subtract(f,h);l=Ka.fromEpochNsDiff(c,h).round(g,i).addToEpochNs(h)}else{let d=Uit(u,r,s,i),m=hR(a,c);l=qIe(d.isoDate,d.time,"option",m,a,"compatible","prefer",!1)}return qh(l,a,Le(this,vn))}equals(e){nn(this,Ys);let n=fne(e),r=Le(this,Ji),i=Le(n,Ji);return!!zt.default.equal(zt.default.BigInt(r),zt.default.BigInt(i))&&!!nvn(Le(this,pa),Le(n,pa))&&tw(Le(this,vn),Le(n,vn))}toString(e=void 0){nn(this,Ys);let n=Gr(e),r=Hne(n),i=qne(n),s=(function(m){return AR(m,"offset",["auto","never"],"auto")})(n),o=sS(n,"trunc"),a=CA(n,"smallestUnit","time",void 0);if(a==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let c=(function(m){return AR(m,"timeZoneName",["auto","never","critical"],"auto")})(n),{precision:u,unit:l,increment:d}=jne(a,i);return sTn(this,u,r,c,s,{unit:l,increment:d,roundingMode:o})}toLocaleString(e=void 0,n=void 0){nn(this,Ys);let r=Gr(n),i=Object.create(null);if((function(c,u,l,d){if(u==null)return;let m=Reflect.ownKeys(u);for(let h=0;hObject.is(g,f)))&&Object.prototype.propertyIsEnumerable.call(u,f)){let g=u[f];c[f]=g}}})(i,r,["timeZone"]),r.timeZone!==void 0)throw new TypeError("ZonedDateTime toLocaleString does not accept a timeZone option");if(i.year===void 0&&i.month===void 0&&i.day===void 0&&i.era===void 0&&i.weekday===void 0&&i.dateStyle===void 0&&i.hour===void 0&&i.minute===void 0&&i.second===void 0&&i.fractionalSecondDigits===void 0&&i.timeStyle===void 0&&i.dayPeriod===void 0&&i.timeZoneName===void 0&&(i.timeZoneName="short"),i.timeZone=Le(this,pa),oTn(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let s=new cE(e,i),o=Bki.call(s).calendar,a=Le(this,vn);if(a!=="iso8601"&&o!=="iso8601"&&!tw(o,a))throw new RangeError(`cannot format ZonedDateTime with calendar ${a} in locale with calendar ${o}`);return s.format(rS(Le(this,Ji)))}toJSON(){return nn(this,Ys),sTn(this,"auto")}valueOf(){fD("ZonedDateTime")}startOfDay(){nn(this,Ys);let e=Le(this,pa);return qh(sD(e,KI(this).isoDate),e,Le(this,vn))}getTimeZoneTransition(e){nn(this,Ys);let n=Le(this,pa);if(e===void 0)throw new TypeError("options parameter is required");let r=AR(typeof e=="string"?DF("direction",e):Gr(e),"direction",["next","previous"],ER);if(r===void 0)throw new TypeError("direction option is required");if(oTn(n)||n==="UTC")return null;let i=Le(this,Ji),s=r==="next"?fst(n,i):Oit(n,i);return s===null?null:qh(s,n,Le(this,vn))}toInstant(){return nn(this,Ys),rS(Le(this,Ji))}toPlainDate(){return nn(this,Ys),pg(KI(this).isoDate,Le(this,vn))}toPlainTime(){return nn(this,Ys),mR(KI(this).time)}toPlainDateTime(){return nn(this,Ys),ub(KI(this),Le(this,vn))}static from(e,n=void 0){return fne(e,n)}static compare(e,n){let r=fne(e),i=fne(n),s=Le(r,Ji),o=Le(i,Ji);return zt.default.lessThan(zt.default.BigInt(s),zt.default.BigInt(o))?-1:zt.default.greaterThan(zt.default.BigInt(s),zt.default.BigInt(o))?1:0}};function KI(t){return mb(Le(t,pa),Le(t,Ji))}function ng(t,e){nn(t,Ys);let n=KI(t).isoDate;return Vne(t).isoToDate(n,{[e]:!0})[e]}function c8(t,e){return nn(t,Ys),KI(t).time[e]}xR(Une,"Temporal.ZonedDateTime");var pE=Object.freeze({__proto__:null,Duration:One,Instant:Dne,Now:Svn,PlainDate:Pne,PlainDateTime:Mne,PlainMonthDay:Lne,PlainTime:Fne,PlainYearMonth:Qne,ZonedDateTime:Une}),PZa=class{toTemporalInstant(){return rS(iS(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,Nki=[Dne,Pne,Mne,One,Lne,Fne,Qne,Une];for(let t of Nki){let e=Object.getOwnPropertyDescriptor(t,"prototype");(e.configurable||e.enumerable||e.writable)&&(e.configurable=!1,e.enumerable=!1,e.writable=!1,Object.defineProperty(t,"prototype",e))}var gD=Ot(require("node:fs"),1),xwe=Ot(require("node:path"),1);p();function nre(t,e){let n=Math.abs(t).toFixed(e);return Number(n)>0?n:void 0}p();var UZa=process.cwd(),Sst,Cst;function Awe(){if(Sst!==void 0)return Sst;let t="unknown";return t="2.29.1-unknown.unknown",Sst=t,t}function Dki(t){if(t==="unknown")return{version:"unknown",isDev:!1,branch:void 0,sha:void 0,fullVersion:"unknown"};let e=t.indexOf("-");if(e===-1)return{version:t,isDev:!1,branch:void 0,sha:void 0,fullVersion:t};let n=t.slice(0,e),r=t.slice(e+1),i=r.lastIndexOf("."),s=i===-1?r:r.slice(0,i),o=i===-1?void 0:r.slice(i+1);return{version:n,isDev:!0,branch:s,sha:o,fullVersion:t}}function rre(t){let e=Dki(t??Awe());return!e.isDev||!e.branch||!e.sha?e.version:`${e.version}-${e.branch} (${e.branch} @ ${e.sha})`}function ire(){if(Cst!==void 0)return Cst;let t="unknown";return t="0.87.1",Cst=t,t}p();var ywe="https://pi.dev/session/",Cvn=process.env.PI_SHARE_VIEWER_URL||ywe;function Ist(){return process.env.PI_SHARE_VIEWER_URL||ywe}var Ivn="https://api.github.com/gists",T8=10*1024*1024,sre=15e3;async function Ewe(t,e,n=sre){let r=new AbortController,i=setTimeout(()=>r.abort(),n);try{return await fetch(t,{...e,signal:r.signal})}catch(s){throw s instanceof Error&&s.name==="AbortError"?new Error(`gist create timed out after ${n}ms`):s}finally{clearTimeout(i)}}async function wst(t){if(!t.ok){let e=await t.text().catch(()=>"");throw new Error(`gist create failed: ${t.status} ${t.statusText}${e?` \u2014 ${e}`:""}`)}}function Tst(t){if(!t.id||!t.html_url)throw new Error(`gist create returned unexpected response (no id/html_url): ${JSON.stringify(t).slice(0,200)}`)}async function wvn(t,e=Cvn){let{token:n,content:r,filename:i="session.html",description:s="Pi agent session",public:o=!1,apiUrl:a=Ivn}=t,c=await Ewe(a,{method:"POST",headers:{Authorization:`Bearer ${n}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28","Content-Type":"application/json","User-Agent":"pi-coding-agent-action"},body:JSON.stringify({description:s,public:o,files:{[i]:{content:r}}})},sre);await wst(c);let u=await c.json();Tst(u);let l=u.files?.[i];return{id:u.id,gistUrl:u.html_url,rawUrl:l?.raw_url??"",shareUrl:`${e}#${u.id}`}}var vst={name:"github",create:t=>wvn(t,Ist())};p();p();var Tvn="/api/gists",bwe=["never","1hour","12hours","1day","7days","15days"],_we="7days";async function vvn(t){let{token:e,content:n,filename:r="session.html",description:i="Pi agent session",public:s=!1,apiUrl:o,expire:a=_we}=t;if(!o)throw new Error(`opengist provider requires an API URL (e.g. https://gist.l3x.in${Tvn}); set share_gist_api_url`);let c=s?"public":"unlisted",u=await Ewe(o,{method:"POST",headers:{Authorization:`Bearer ${e}`,Accept:"application/json","Content-Type":"application/json","User-Agent":"pi-coding-agent-action"},body:JSON.stringify({title:i,visibility:c,expire:a,files:{[r]:{content:n}}})},sre);await wst(u);let l=await u.json();Tst(l);let d=l.html_url.replace(/\/$/,""),m=`${d}/raw/HEAD/${encodeURIComponent(r)}`,h=Ist(),f=!1;try{f=new URL(h).hostname===new URL(ywe).hostname}catch{}let g=f?m:`${h}#${d}`;return{id:l.id,gistUrl:l.html_url,rawUrl:m,shareUrl:g}}var Rst={name:"opengist",create:vvn};function kst(t){return t.shareGistProvider==="opengist"?Rst:vst}function Bst(t){if(t.shareGistProvider==="opengist")return t.shareGistToken||void 0;let e=t.githubToken,n=t.shareGistToken;return e||n}function Rvn(t){return t||"\u2705 Agent session completed"}function kvn(t,e){return t?`${t} + +--- + +\u274C Agent session ended with error: ${e}`:`\u274C Agent session ended with error: ${e}`}var ore=class{constructor(e,n,r,i,s,o){this.config=e;this.logger=n;this.outputSink=r;this.git=i;this.piAgentFactory=s;this.platformProvider=o}config;logger;outputSink;git;piAgentFactory;platformProvider;exportPaths={};shareUrls={};async execute(){this.logger.info(`running action v${rre()}`);let e=this.git.getStartTime()??pE.Now.instant(),n,r,i;try{if(r=await this.git.getPrompt(this.config.promptInput),!r)throw new Error("No prompt found - cannot proceed");n=await this.addReactionBestEffort(),i=this.piAgentFactory(this.config,this.logger,this.platformProvider);let{result:s,sessionStats:o,error:a}=await i.run(r);if(await this.runSessionExports(i),await this.runSessionShare(),a){await this.handleSessionError(a,s,e,n,o);return}this.logSessionBanner("\u2705 Agent session completed");let c=Rvn(s);await this.finalize(c,this.config,e,n,o,!0)}catch(s){throw await this.handleUncaughtError(s,e,n,i),s}finally{this.disposeAgentBestEffort(i)}}disposeAgentBestEffort(e){if(e)try{e.dispose()}catch(n){let r=n instanceof Error?n.message:String(n);this.logger.notice(`failed to dispose Pi agent session: ${r}`)}}async addReactionBestEffort(){try{return await this.git.addReaction()}catch(e){let n=e instanceof Error?e.message:String(e);this.logger.notice(`failed to add reaction: ${n}`);return}}async runSessionExports(e){let n=[];this.config.exportSessionHtml||this.config.shareSession?n.push(this.exportSessionOutput(e,"html")):this.logger.debug("[session-html] export disabled by configuration"),this.config.exportSessionJsonl?n.push(this.exportSessionOutput(e,"jsonl")):this.logger.debug("[session-jsonl] export disabled by configuration"),await Promise.all(n)}async handleSessionError(e,n,r,i,s){this.logSessionBanner(`\u274C Agent session ended with error: ${e}`);let o=kvn(n,e);await this.finalize(o,this.config,r,i,s,!1),this.outputSink.setFailed(new Error(e))}async handleUncaughtError(e,n,r,i){let s=e instanceof Error?e.message:String(e),o;if(i)try{o=i.getSessionStats()}catch{}try{await this.finalize(s,this.config,n,r,o,!1)}catch(a){let c=a instanceof Error?a.message:String(a);this.logger.notice(`failed to finalize after error: ${c}`)}this.outputSink.setFailed(e instanceof Error?e:new Error(String(e)))}logSessionBanner(e){let n="\u2550\u2550\u2550\u2550".repeat(16);this.logger.info(""),this.logger.info(n),this.logger.info(e)}logExportPaths(){this.exportPaths.html&&this.config.exportSessionHtml&&this.logger.info(`\u{1F4C4} exported session HTML to ${this.exportPaths.html}`),this.exportPaths.jsonl&&this.config.exportSessionJsonl&&this.logger.info(`\u{1F4C4} exported session JSONL to ${this.exportPaths.jsonl}`)}logShareUrls(){this.shareUrls.shareUrl&&this.logger.info(`\u{1F517} Session shared: ${this.shareUrls.shareUrl}`),this.shareUrls.gistUrl&&this.logger.info(`\u{1F517} Session gist: ${this.shareUrls.gistUrl}`)}logTokenUsageReport(e){let n=[`input ${e.inputTokens.toLocaleString("en-US")}`,`output ${e.outputTokens.toLocaleString("en-US")}`,`total ${e.totalTokens.toLocaleString("en-US")}`],r=nre(e.cost,4);r&&n.push(`cost $${r}`),this.logger.info(`\u{1F4CA} Token usage: ${n.join(" \xB7 ")}`)}async runSessionShare(){if(!this.config.shareSession){this.logger.debug("[session-share] sharing disabled by configuration");return}let e="session-share",n=Bst(this.config);if(!n){let o=this.config.shareGistProvider==="opengist"?"provide an Opengist access token (og_\u2026) via share_gist_token":"provide a PAT/App token with gist scope via github_token (or share_gist_token)";this.logger.notice(`[${e}] skipped: no share token configured (${o})`);return}let r=kst(this.config);if(r.name==="opengist"&&!this.config.shareGistApiUrl){this.logger.notice(`[${e}] skipped: opengist provider requires share_gist_api_url (e.g. https://gist.l3x.in/api/gists)`);return}let i=this.sessionExportPath("html"),s=this.readShareContent(i,e);s!==void 0&&await this.createAndSurfaceGist(r,n,s,e)}readShareContent(e,n){if(!gD.existsSync(e)){this.logger.notice(`[${n}] skipped: session HTML export not found at ${e}`);return}try{let r=gD.statSync(e).size;if(r>T8){this.logger.notice(`[${n}] skipped: session HTML is ${r} bytes, exceeds ${T8}-byte gist limit`);return}let i=gD.readFileSync(e,"utf8"),s=Buffer.byteLength(i,"utf8");if(s>T8){this.logger.notice(`[${n}] skipped: session HTML is ${s} bytes, exceeds ${T8}-byte gist limit`);return}return i}catch(r){let i=r instanceof Error?r.message:String(r);this.logger.notice(`[${n}] skipped: failed to read session HTML: ${i}`);return}}async createAndSurfaceGist(e,n,r,i){let s=this.buildShareDescription(),o;try{o=await e.create({token:n,content:r,description:s,...this.config.shareGistApiUrl?{apiUrl:this.config.shareGistApiUrl}:{},...this.config.shareGistExpiration?{expire:this.config.shareGistExpiration}:{}})}catch(a){let c=a instanceof Error?a.message:String(a);this.logger.notice(`[${i}] failed to share session: ${c}`);return}this.logger.debug(`[${i}] shared session as gist ${o.id}: ${o.gistUrl}`),this.logger.debug(`[${i}] view session: ${o.shareUrl}`),this.shareUrls={shareUrl:o.shareUrl,gistUrl:o.gistUrl},this.outputSink.setOutput("share_url",o.shareUrl),this.outputSink.setOutput("gist_url",o.gistUrl),this.outputSink.setOutput("gist_id",o.id);try{await this.outputSink.appendSummary?.(`\u{1F517} **Session:** ${o.shareUrl} +\u{1F517} **Gist:** ${o.gistUrl} +`)}catch(a){let c=a instanceof Error?a.message:String(a);this.logger.debug(`[${i}] job summary write skipped: ${c}`)}}buildShareDescription(){try{let e=this.platformProvider.getContext(),n=`${e.repo.owner}/${e.repo.repo}#${e.issue.number}`,r=e.runId?` (run ${e.runId})`:"";return`Pi session \u2014 ${n}${r}`}catch{return"Pi agent session"}}sessionExportPath(e){return xwe.join(this.outputSink.getExportDirectory(e),`session.${e}`)}async exportSessionOutput(e,n){let r=`session-${n}`,i=n.toUpperCase(),s=this.sessionExportPath(n);try{gD.mkdirSync(xwe.dirname(s),{recursive:!0}),await(n==="html"?e.exportSessionHtml:e.exportSessionJsonl).call(e,s),this.logger.debug(`[${r}] exported session ${i} to ${s}`),this.exportPaths[n]=s,this.outputSink.setOutput(`session_${n}_path`,s)}catch(o){let a=o instanceof Error?o.message:String(o);this.logger.notice(`[${r}] failed to export ${i}: ${a}`)}}async finalize(e,n,r,i,s,o){try{i&&await this.git.deleteReaction(i)}catch(u){let l=u instanceof Error?u.message:String(u);this.logger.notice(`failed to delete reaction: ${l}`)}this.outputSink.setOutput("response",e),this.outputSink.setOutput("success",o),s!==void 0&&(this.outputSink.setOutput("input_tokens",s.inputTokens),this.outputSink.setOutput("output_tokens",s.outputTokens),this.outputSink.setOutput("cost",s.cost),this.logTokenUsageReport(s)),this.logShareUrls(),this.logExportPaths();let a=r.until(pE.Now.instant());this.outputSink.setOutput("duration_seconds",a.total("seconds"));let c={actionVersion:Awe(),provider:n.provider,model:n.model,thinkingLevel:n.thinkingLevel,executionDuration:a};s!==void 0&&(c.sessionStats=s),await this.git.createFinalComment(e,c)}};p();p();Mb();qo();p();Mb();p();var sar={github:{ciEnvironment:"GitHub Actions CI/CD",productName:"GitHub"},codeberg:{ciEnvironment:"Codeberg CI/CD",productName:"Codeberg"},forgejo:{ciEnvironment:"Forgejo Actions CI/CD",productName:"Forgejo"}};function KPe(t="github"){let{ciEnvironment:e,productName:n}=sar[t];return`You are a non-interactive assistant running in ${e} environment. You are usually tasked with code reviews and generating code changes. You will not interact with the user directly. The output (or error) you generate will be sent back as comment to the user. Avoid if possible long preambles about what you are going to do to achieve the goal, focus on the final result instead, remember that the user is reading the output as comment in a ${n} PR or issue. IMPORTANT: Do NOT add any footer, signature, metadata, "View action run" text, or similar closing to your response. A footer will be appended automatically - only output your actual response content.`}var VEs=KPe("github");function nT(t){return sar[t].productName}var oar="Create a pull request with title and description. The tool will automatically determine the default base branch, create a new branch, push changes, and create the PR.",aar=["Always use the create_pull_request tool to create pull requests - do not use git commands or gh CLI directly.","Make sure your changes are made (modified files exist) before calling this tool. The tool will detect changes, create branch, and create PR automatically. Do NOT use unless you have already applied changes and/or added new files.","The tool will automatically generate a branch name in the format: pi/issue{number}-{timestamp}.","If the tool fails to push to the repository because of insufficient permissions, it will open a PR from a fork: create a fork (if it doesn't exist); push the PR branch to fork; create a PR from the branch in the fork.",'Do NOT provide the "base" parameter unless the user explicitly requests a different target branch than the repository default. The tool will automatically detect the correct default branch.',"Use dryRun=true first to verify the PR configuration, then dryRun=false to create it.","On some platforms (e.g. Forgejo) the PR object cannot always be opened automatically even though the branch is pushed. When this happens the tool returns a compare URL instead of an error \u2014 post that URL so the user can open the PR manually.","If the tool fails with an error about creating a fork, the configured token cannot own forks (e.g. the default GITHUB_TOKEN authenticates as a bot). Report that a personal access token with repository access is required for fork-based pull requests."];function car(t="github"){return`Create a new pull request on ${nT(t)}. This tool handles everything: automatically determines the default base branch, creates a new branch, pushes changes, and creates the PR. The branch name is auto-generated following the pi/issue{number}-{timestamp} pattern.`}var lar="Pull request title (should be descriptive and follow conventional commit format)",uar='Detailed description of changes in markdown format. If not provided, will auto-generate from issue context (e.g., "Fixes #27")',dar="EXPERT: Override the default target branch. Only use this if the user explicitly requests a different branch than the repository default. Do NOT guess or assume a branch name - leave this empty unless specifically instructed.",par="Set to true to simulate PR creation without actually creating it (for testing). Set to false to create the actual PR.";function mar(t="github"){return`Get the full comment thread for a ${nT(t)} issue or pull request, including title, description, labels, and all comments. For PRs, also includes inline review comments.`}function har(t="github"){return["Use get_issue_or_pr_thread to understand the context of an issue or PR before taking action.",`By default, the tool fetches the current issue/PR from the ${nT(t)} context. Only provide owner/repo/issue_number when you need to fetch a different one.`,"Use max_comments to limit results for very long threads; defaults to 100 comments.","For pull requests, the tool also returns inline review comments (comments on specific lines of the diff)."]}function far(t="github"){return`Retrieve the complete comment thread for a ${nT(t)} issue or pull request. Returns the title, description, labels, state, author, timestamps, and all comments. For pull requests, also includes inline review comments with file path and line information, plus branch names and merge status. Does NOT fetch code changes \u2014 use the get_pr_diff tool for that.`}var gar='Repository owner (e.g., "octocat"). If not provided, uses the current repository from context.',Aar='Repository name (e.g., "hello-world"). If not provided, uses the current repository from context.',yar="Issue or pull request number. If not provided, uses the current issue/PR from context.",Ear="Maximum number of comments to fetch. Defaults to 100. Use for limiting very long threads.",bar="Update an existing pull request by pushing new commits to the PR branch and optionally updating the title and/or body.";function _ar(t="github"){return["Use update_pull_request when working within an existing PR flow to push new commits and/or update PR metadata.","Make sure your changes are made (modified files exist) before calling this tool. The tool will detect changes and create a new commit on the PR branch.",`By default, the tool works with the current PR from the ${nT(t)} context. Only provide pull_number when you need to update a different PR.`,"The tool commits changes with the provided message (or generates a default message) and pushes them to the existing PR branch.","You can update the PR title and/or body using the title and body parameters.","Use dryRun=true first to verify the update configuration, then dryRun=false to apply the changes."]}var xar="Update an existing pull request by pushing new commits to the PR branch. Optionally updates the PR title and/or description. The tool detects changes in the working tree, creates a new commit on the PR branch, and updates the PR metadata if provided.",Sar="Pull request number. If not provided, uses the current PR from context.",Car="New pull request title. If not provided, the title is not changed.",Iar="New pull request description in markdown format. If not provided, the description is not changed.",war="Commit message for the new commit. If not provided, a descriptive message will be auto-generated based on the changes.",Tar="Set to true to simulate the PR update without actually modifying anything (for testing). Set to false to apply the actual changes.",Rar="Get the diff of a pull request. Use this to understand what code changes a PR introduces.";function kar(t="github"){return["Use get_pr_diff to fetch the diff of a pull request when you need to understand what changed.",`By default, the tool fetches the diff for the current PR from the ${nT(t)} context. Only provide owner/repo/pull_number when you need to fetch a different PR.`,"The diff is truncated at 1000 lines and 100KB by default. Use max_lines to increase or decrease the line limit.","Use ignore_files to exclude common noisy paths (dist/, package-lock.json, etc.) from the diff."]}function Bar(t="github"){return`Fetch the diff of a ${nT(t)} pull request. Returns the diff as a string, truncated if too large. Useful for understanding what code changes a PR introduces before reviewing or modifying them.`}var Nar='Repository owner (e.g., "octocat"). If not provided, uses the current repository from context.',Dar='Repository name (e.g., "hello-world"). If not provided, uses the current repository from context.',Par="Pull request number. If not provided, uses the current PR from context.",Mar="Maximum number of diff lines to return. Defaults to 1000 (or the action-level diff_max_lines input). Use for limiting very large diffs.",S_t='List of file paths to exclude from the diff. Supports exact file paths (e.g. "package-lock.json") and directory prefixes (e.g. "dist/" to exclude everything under dist/). Matching is literal \u2014 glob patterns (e.g. "*.min.js") are NOT supported. Useful for filtering out generated files, build artifacts, or vendored dependencies.',Oar="Create a pull request review with an optional summary and inline comments anchored to specific lines of the diff.",Lar=["Use create_pull_request_review to post inline review comments anchored to specific diff lines. This is much more useful than top-level comments because reviewers can see findings directly in the diff context.","Each comment requires a `path` (file path relative to repo root), `line` (line number in the new/right side of the diff), and `body` (Markdown comment text).",'Use `side: "LEFT"` to comment on the old version of the file (before the change), or omit it / use `side: "RIGHT"` (default) for the new version.',"For multi-line comments, set `start_line` to the first line and `line` to the last line of the range.","The `event` parameter controls the review type: COMMENT (default, neutral feedback), APPROVE (approve the PR), or REQUEST_CHANGES (request changes before merging).","A `body` (summary comment) is optional but recommended \u2014 it provides context for the overall review.","Provide at least one inline comment or a non-empty `body`. A summary-only review may use an empty `comments` array.","Make sure line numbers reference the correct version of the file. Use the `get_pr_diff` tool first to understand the diff and verify line numbers."];function Far(t="github"){return`Create a pull request review with an optional summary and optional inline comments anchored to specific lines of the diff. Posts a ${nT(t)} Pull Request Review using the \`pulls.createReview\` API. Provide at least one inline comment or a non-empty summary body.`}var Qar="Pull request number. If not provided, uses the current PR from context.",Uar="Summary comment for the review (shown at the top of the review). Optional but recommended.",Gar="Review event type: COMMENT (default, neutral feedback), APPROVE (approve the PR), or REQUEST_CHANGES (request changes before merging).";var $ar='Repository-relative file path (e.g., "src/main.ts").',War="Line number in the diff. For multi-line comments, this is the end line. Must be a positive integer.",Har="Which side of the diff: RIGHT (new file, default) or LEFT (old file).",qar="Start line for multi-line comments. If set, `line` is treated as the end line.",jar="Which side `start_line` refers to. Only needed when different from `side`.",Var="The Markdown body of the inline comment.",Yar="Check the CI/CD status for a pull request or commit ref. Returns check runs and workflow runs with their statuses, conclusions, and URLs.";function zar(t="github"){return["Use get_ci_status to inspect the CI/CD status of a pull request or commit before or after making changes.",`By default, the tool fetches status for the head commit of the current PR from the ${nT(t)} context. Outside a PR, it uses the commit that triggered the run. Only provide owner/repo/pull_number when you need to check a different PR.`,"You can also provide a `ref` (commit SHA or branch name) directly instead of a pull_number.","Filter by `status` (queued, in_progress, completed) or `conclusion` (success, failure, cancelled, timed_out) to narrow results.","For failed workflow runs, use the returned run_id with the `get_workflow_run_logs` tool to fetch detailed job logs and diagnose failures."]}var Kar="Get the CI/CD status for a pull request or commit ref. Returns a list of check runs and workflow runs with their statuses, conclusions, and URLs. Use this to check if CI is passing or failing before or after making changes.",JPe='Repository owner (e.g., "octocat"). If not provided, uses the current repository from context.',XPe='Repository name (e.g., "hello-world"). If not provided, uses the current repository from context.',Jar="Pull request number. If not provided, uses the current PR from context. Alternative to providing a ref.",Xar="Git ref (commit SHA or branch name) to check. If not provided, resolved from pull_number or context.",Zar="Filter by status: queued, in_progress, completed.",ecr="Filter by conclusion: success, failure, cancelled, timed_out, action_required, etc.",tcr="Fetch the job logs for a specific workflow run. Use this to diagnose CI failures by inspecting the actual log output.",ncr=["Use get_workflow_run_logs when you need to inspect the actual log output of a workflow run to diagnose failures.","First use `get_ci_status` to find the run_id of a failed workflow run, then use this tool to fetch its logs.","Logs are truncated to 50KB by default. Truncation keeps the end of the log (where errors typically appear). Use `max_bytes` to increase or decrease the limit (capped at 1MB).","The tool returns logs for all jobs in the run, with each job clearly labeled. Logs are truncated from the head, preserving the tail where error messages typically appear."];function rcr(t="github"){return`Fetch the job logs for a specific ${nT(t)} Actions workflow run. Returns the log output for each job, truncated if too large. Use this to diagnose CI failures by inspecting the actual error messages and stack traces.`}var icr="The workflow run ID to fetch logs for. Get this from the get_ci_status tool output.",scr="Maximum total log bytes to return. Defaults to 51200 (50KB). Capped at 1048576 (1MB). Use for limiting very large log outputs.",ocr="Summarize long text with a separate LLM call, keeping the full text out of your own context. Use it to condense very long inputs (CI logs, big threads, large file dumps) before analyzing them.",acr=["Use summarize_text when a text is too long to read in full (e.g. workflow logs, large comment threads) and you only need the key points.",'Pass the raw text via `text` and optionally narrow the result with `focus` (e.g. "errors and their root causes") and `max_words`.',"The summary is produced by a separate one-shot LLM call using the current session model; it does not consume your context window beyond the returned summary."],ccr="Summarize a long text with a separate one-shot LLM call (using the current session model) and return only the summary. Use this to condense very large inputs \u2014 CI logs, long threads, file dumps \u2014 without loading them fully into the conversation.",lcr="The raw text to summarize. Can be very long; it is sent to the sub-call, not kept in your context.",ucr='Optional instruction for what the summary should focus on (e.g. "errors, root causes, and failed steps").',dcr="Approximate maximum length of the summary in words. Defaults to 300.";p();var yce="\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";function Fl(t){return{level:"info",text:t}}function C_t(t){return{level:"warning",text:t}}function pcr(t,e){let n=[Fl("\u{1F4CA} LLM")];return t?(n.push(Fl(` Model: ${t.provider}/${t.id}`)),n.push(Fl(` Reasoning: ${t.reasoning}`))):n.push(Fl(" Model: Not configured")),n.push(Fl(` Thinking Level: ${e}`)),n.push(Fl(yce)),n}function mcr(t){if(t.requested.length===0)return[];let e=[Fl("\u{1F4E6} Extensions")];if(e.push(Fl(` Requested: ${t.requested.join(", ")}`)),t.loaded.length>0){e.push(Fl(` Loaded: ${t.loaded.length} extension(s)`));for(let n of t.loaded)e.push(Fl(` \u2022 ${n}`))}else e.push(Fl(" Loaded: None"));for(let n of t.warnings)e.push(C_t(` \u26A0\uFE0F ${n}`));return e.push(Fl(yce)),e}function hcr(t){if(t.length===0)return[];let e=[Fl("\u{1F527} Available Tools")];for(let n of t)n.sourceInfo.source?e.push(Fl(` \u2022 [${n.sourceInfo.source}] ${n.name}`)):e.push(Fl(` \u2022 ${n.name}`));return e.push(Fl(yce)),e}function fcr(t){let e=[Fl("\u{1F4DD} System Prompt")],n=Ace(t,1e3);return e.push(Fl(n)),t.length>1e3&&e.push(Fl(` +... (${t.length-1e3} more characters)`)),e.push(Fl(yce)),e}function gcr(t,e){let n=[Fl("\u{1F464} User Prompt"),Fl(Ace(t,500))];return e&&e.length>0&&n.push(Fl(` [${e.length} image(s) attached]`)),n}function I_t(t){let e=[],n=t.phase==="before"?"starting":"completed",r=t.willRetry?" \xB7 turn retried":"",i=t.reason==="overflow"&&t.willRetry,s=`\u{1F5DC}\uFE0F Context compaction ${n}`,o=` Reason: ${t.reason}${r}`,a=` Tokens before: ${t.tokensBefore.toLocaleString("en-US")}`,c=i?C_t:Fl;return e.push(c(s)),e.push(c(o)),e.push(c(a)),i&&t.phase==="before"&&e.push(C_t(" \u26A0\uFE0F Context window overflowed mid-turn \u2014 the turn was aborted and will be retried after summarization. This typically increases run latency and cost.")),e}function yG(t,e){for(let n of e)n.level==="warning"?t.warning(n.text):t.info(n.text)}var YEs=(t,e,n)=>{t.on("tool_execution_start",async r=>{e.info(""),e.startGroup?.(`\u{1F527} Tool started: ${r.toolName} (${r.toolCallId})`),e.info(` Args: ${Ace(JSON.stringify(r.args,null,2),500)}`),e.endGroup?.()}),t.on("tool_execution_end",async r=>{e.startGroup?.(`\u{1F527} Tool ended: ${r.toolName} (${r.toolCallId})`),r.result?.details?.cancelled===!0?e.warning(" \u26A0\uFE0F execution cancelled"):r.isError?e.info(" \u274C execution failed"):e.info(" \u2705 execution succeeded"),e.endGroup?.()}),t.on("tool_execution_update",async r=>{e.info(""),e.debug(`\u{1F527} Tool ${r.toolName} (${r.toolCallId}) update: ${Ace(JSON.stringify(r.partialResult),200)}`)}),t.on("turn_start",async r=>{e.info(""),e.debug(`\u{1F504} Turn ${r.turnIndex} started`)}),t.on("turn_end",async r=>{let i=r.toolResults.length;e.info(""),e.debug(`\u{1F504} Turn ${r.turnIndex} completed (${i} tool result(s))`)}),t.on("after_provider_response",async r=>{e.info(""),e.debug(`\u{1F4E1} Provider response: status ${r.status}`)}),t.on("session_before_compact",async r=>{yG(e,I_t({phase:"before",reason:r.reason,willRetry:r.willRetry,tokensBefore:r.preparation.tokensBefore}))}),t.on("session_compact",async r=>{yG(e,I_t({phase:"after",reason:r.reason,willRetry:r.willRetry,tokensBefore:r.compactionEntry.tokensBefore}))}),t.on("before_agent_start",async(r,i)=>{e.startGroup?.("\u{1F916} Agent Session settings"),e.info(` Running @earendil-works/pi-coding-agent@${ire()}`),e.info(yce),yG(e,pcr(i.model,t.getThinkingLevel())),n&&yG(e,mcr(n)),yG(e,hcr(t.getAllTools())),yG(e,fcr(i.getSystemPrompt())),yG(e,gcr(r.prompt,r.images)),e.endGroup?.(),e.info("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"),e.info("\u{1F680} Starting agent session..."),e.info("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550")}),t.on("agent_settled",async()=>{e.debug("\u2705 Agent session settled (no further automatic actions)")})};function Ace(t,e){if(!t||t.length<=e)return t;let n=t.substring(0,e),r=n.lastIndexOf(" ");return r>e*.8?n.substring(0,r)+"...":n+"..."}function w_t(t,e){return n=>YEs(n,t,e)}p();p();p();p();p();p();p();var St={};br(St,{Assign:()=>zEs,Clone:()=>xce,Create:()=>tbs,Discard:()=>nbs,Metrics:()=>US,Update:()=>rbs});p();p();p();var US={assign:0,create:0,clone:0,discard:0,update:0};function zEs(t,e){return US.assign+=1,{...t,...e}}p();p();p();var Qe={};br(Qe,{Entries:()=>g0s,EntriesRegExp:()=>f0s,Every:()=>p0s,EveryAll:()=>m0s,GraphemeCount:()=>l0s,HasPropertyKey:()=>h0s,IsArray:()=>bce,IsBigInt:()=>Ece,IsBoolean:()=>Icr,IsClassInstance:()=>a0s,IsConstructor:()=>t0s,IsDeepEqual:()=>k_t,IsEqual:()=>so,IsFunction:()=>wcr,IsGreaterEqualThan:()=>vcr,IsGreaterThan:()=>i0s,IsInteger:()=>v_t,IsLessEqualThan:()=>Tcr,IsLessThan:()=>s0s,IsMaxLength:()=>u0s,IsMinLength:()=>d0s,IsMultipleOf:()=>o0s,IsNull:()=>tMe,IsNumber:()=>nMe,IsObject:()=>_ce,IsObjectNotArray:()=>n0s,IsString:()=>rMe,IsSymbol:()=>r0s,IsUndefined:()=>R_t,IsUnsafePropertyKey:()=>Rcr,IsValueLike:()=>c0s,Keys:()=>eMe,ShiftLeft:()=>iMe,Symbols:()=>A0s,Values:()=>y0s});p();p();function EG(t,e,n){return t>=e&&t<=n}function KEs(t){return t===8205}function JEs(t){return EG(t,55296,56319)}function Acr(t){return EG(t,127462,127487)}function Ecr(t){return EG(t,65024,65039)}function bcr(t){return EG(t,768,879)||EG(t,6832,6911)||EG(t,7616,7679)||EG(t,65056,65071)}function ZPe(t){return t>65535?2:1}function ycr(t,e){for(;e=e)return!0;return!1}function ZEs(t,e){let n=0,r=0;for(;re)return!1;return!0}function Scr(t,e){if(e===0)return!0;let n=0;for(;n=e)return!0}return!1}function Ccr(t,e){let n=0;for(;ne)return!1}return!0}function bce(t){return Array.isArray(t)}function Ece(t){return so(typeof t,"bigint")}function Icr(t){return so(typeof t,"boolean")}function t0s(t){if(R_t(t)||!wcr(t))return!1;let e=Function.prototype.toString.call(t);return!!(/^class\s/.test(e)||/\[native code\]/.test(e))}function wcr(t){return so(typeof t,"function")}function v_t(t){return Number.isInteger(t)}function tMe(t){return so(t,null)}function nMe(t){return Number.isFinite(t)}function n0s(t){return _ce(t)&&!bce(t)}function _ce(t){return so(typeof t,"object")&&!tMe(t)}function rMe(t){return so(typeof t,"string")}function r0s(t){return so(typeof t,"symbol")}function R_t(t){return so(t,void 0)}function so(t,e){return t===e}function i0s(t,e){return t>e}function s0s(t,e){return t=e}function o0s(t,e){if(Ece(t)||Ece(e))return BigInt(t)%BigInt(e)===0n;let n=1e-10;if(!nMe(t)||v_t(t)&&1/e%1===0)return!0;let r=t%e;return Math.min(Math.abs(r),Math.abs(r-e),Math.abs(r+e))[new RegExp(`^${e}$`),t[e]])}function g0s(t){return Object.entries(t)}function eMe(t){return Object.getOwnPropertyNames(t)}function A0s(t){return Object.getOwnPropertySymbols(t)}function y0s(t){return Object.values(t)}function E0s(t,e){if(!_ce(e))return!1;let n=eMe(t);return so(n.length,eMe(e).length)&&n.every(r=>k_t(t[r],e[r]))}function b0s(t,e){return bce(e)&&so(t.length,e.length)&&t.every((n,r)=>k_t(t[r],e[r]))}function k_t(t,e){return bce(t)?b0s(t,e):_ce(t)?E0s(t,e):so(t,e)}var oM={};br(oM,{IsBigInt64Array:()=>M0s,IsBigUint64Array:()=>O0s,IsBoolean:()=>x0s,IsDate:()=>F0s,IsFloat32Array:()=>D0s,IsFloat64Array:()=>P0s,IsInt16Array:()=>R0s,IsInt32Array:()=>B0s,IsInt8Array:()=>w0s,IsMap:()=>U0s,IsNumber:()=>S0s,IsRegExp:()=>L0s,IsSet:()=>Q0s,IsString:()=>C0s,IsTypeArray:()=>I0s,IsUint16Array:()=>k0s,IsUint32Array:()=>N0s,IsUint8Array:()=>T0s,IsUint8ClampedArray:()=>v0s});p();function x0s(t){return t instanceof Boolean}function S0s(t){return t instanceof Number}function C0s(t){return t instanceof String}function I0s(t){return globalThis.ArrayBuffer.isView(t)}function w0s(t){return t instanceof globalThis.Int8Array}function T0s(t){return t instanceof globalThis.Uint8Array}function v0s(t){return t instanceof globalThis.Uint8ClampedArray}function R0s(t){return t instanceof globalThis.Int16Array}function k0s(t){return t instanceof globalThis.Uint16Array}function B0s(t){return t instanceof globalThis.Int32Array}function N0s(t){return t instanceof globalThis.Uint32Array}function D0s(t){return t instanceof globalThis.Float32Array}function P0s(t){return t instanceof globalThis.Float64Array}function M0s(t){return t instanceof globalThis.BigInt64Array}function O0s(t){return t instanceof globalThis.BigUint64Array}function L0s(t){return t instanceof globalThis.RegExp}function F0s(t){return t instanceof globalThis.Date}function Q0s(t){return t instanceof globalThis.Set}function U0s(t){return t instanceof globalThis.Map}p();function $0s(t){return Qe.HasPropertyKey(t,"~kind")||Qe.HasPropertyKey(t,"~unsafe")}function W0s(t){let e={},n=Object.getOwnPropertyDescriptors(t);for(let r of Object.keys(n)){if(Qe.IsUnsafePropertyKey(r))continue;let i=n[r];Qe.HasPropertyKey(i,"value")&&Object.defineProperty(e,r,{...i,value:bG(i.value)})}return e}function H0s(t){let e={};for(let n of Qe.Keys(t))Qe.IsUnsafePropertyKey(n)||(e[n]=bG(t[n]));for(let n of Qe.Symbols(t))e[n]=bG(t[n]);return e}function q0s(t){return Qe.IsClassInstance(t)?t:$0s(t)?W0s(t):H0s(t)}function j0s(t){return t.map(e=>bG(e))}function V0s(t){return t.slice()}function Y0s(t){return new RegExp(t.source,t.flags)}function z0s(t){return new Map(bG([...t.entries()]))}function K0s(t){return new Set(bG([...t.values()]))}function bG(t){return oM.IsTypeArray(t)?V0s(t):oM.IsRegExp(t)?Y0s(t):oM.IsMap(t)?z0s(t):oM.IsSet(t)?K0s(t):Qe.IsArray(t)?j0s(t):Qe.IsObject(t)?q0s(t):t}function xce(t){return US.clone+=1,bG(t)}p();p();var _G={};br(_G,{Get:()=>Z0s,Reset:()=>J0s,Set:()=>X0s});p();var Dk={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function J0s(){Dk.immutableTypes=!1,Dk.maxErrors=8,Dk.useAcceleration=!0,Dk.exactOptionalPropertyTypes=!1,Dk.enumerableKind=!1,Dk.correctiveParse=!1,Dk.unionPrioritySort=!0}function X0s(t){for(let e of Qe.Keys(t)){let n=t[e];n!==void 0&&Object.defineProperty(Dk,e,{value:n})}}function Z0s(){return Dk}function ebs(t,e){for(let n of Object.keys(e))Object.defineProperty(t,n,{configurable:!0,writable:!0,enumerable:!1,value:e[n]});return t}function kcr(t,e){return{...t,...e}}function tbs(t,e,n={}){US.create+=1;let r=_G.Get(),i=kcr(e,n),s=r.enumerableKind?kcr(i,t):ebs(i,t);return r.immutableTypes?Object.freeze(s):s}p();function nbs(t,e){US.discard+=1;let n={},r=Object.getOwnPropertyDescriptors(xce(t)),i=new Set(e);for(let s of Object.keys(r))i.has(s)||Object.defineProperty(n,s,r[s]);return n}p();function rbs(t,e,n){US.update+=1;let r=_G.Get(),i=xce(t);for(let s of Object.keys(e))Object.defineProperty(i,s,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:e[s]});for(let s of Object.keys(n))Object.defineProperty(i,s,{configurable:!0,enumerable:!0,writable:!0,value:n[s]});return i}p();function mr(t,e){return Qe.IsObject(t)&&Qe.HasPropertyKey(t,"~kind")&&Qe.IsEqual(t["~kind"],e)}function pd(t){return Qe.IsObject(t)}function xr(t,e,n){return St.Create({"~kind":"Deferred"},{type:"deferred",action:t,parameters:e,options:n},{})}function aM(t){return mr(t,"Deferred")}p();p();p();function ibs(t){return St.Update(t,{"~readonly":!0},{})}function Sce(t,e){return St.Update(ibs(t),{},e)}function Bcr(t,e,n,r){let i=Tn(t,e,n);return Sce(i,r)}p();function sbs(t){return St.Update(t,{"~optional":!0},{})}function Cce(t,e){return St.Update(sbs(t),{},e)}function Ncr(t,e,n,r){let i=Tn(t,e,n);return Cce(i,r)}p();function jE(t,e){return St.Create({"~kind":"Array"},{type:"array",items:t},e)}function Vc(t){return mr(t,"Array")}function sMe(t){return St.Discard(t,["~kind","type","items"])}p();function rT(t,e,n={}){return St.Create({"~kind":"Constructor"},{type:"constructor",parameters:t,instanceType:e},n)}function Wd(t){return mr(t,"Constructor")}function Dcr(t){return St.Discard(t,["~kind","type","parameters","instanceType"])}p();function iT(t,e,n={}){return St.Create({"~kind":"Function"},{type:"function",parameters:t,returnType:e},n)}function Hd(t){return mr(t,"Function")}function Pcr(t){return St.Discard(t,["~kind","type","parameters","returnType"])}p();p();p();function Pk(t,e){return St.Create({"~kind":"Ref"},{$ref:t},e)}function qd(t){return mr(t,"Ref")}p();function cM(t,e){return St.Create({"~kind":"Generic"},{type:"generic",parameters:t,expression:e})}function v9(t){return mr(t,"Generic")}p();p();p();function R9(t){return St.Create({"~kind":"Any"},{},t)}function $u(t){return mr(t,"Any")}p();var Mcr="(?!)";function ia(t){return St.Create({"~kind":"Never"},{not:{}},t)}function lM(t){return mr(t,"Never")}p();p();p();p();function sT(t,e={}){return xr("AddOptional",[t],e)}function xG(t,e={}){return Cce(t,e)}function Ocr(t){return xG(t)}function ph(t){return pd(t)&&Qe.HasPropertyKey(t,"~optional")}function Lcr(t){return Qe.Keys(t).filter(e=>!ph(t[e]))}function oMe(t){return Qe.Keys(t)}function aMe(t){return Qe.Values(t)}function Di(t,e={}){let n=Lcr(t),r=n.length>0?{required:n}:{};return St.Create({"~kind":"Object"},{type:"object",...r,properties:t},e)}function Io(t){return mr(t,"Object")}function Fcr(t){return St.Discard(t,["~kind","type","properties","required"])}p();p();function _p(t){return St.Create({"~kind":"Unknown"},{},t)}function md(t){return mr(t,"Unknown")}p();p();p();function oT(t,e,n){let r=Qe.Keys(t).reduce((i,s)=>({...i,[s]:St.Update(t[s],{},{$id:s})}),{});return St.Create({"~kind":"Cyclic"},{$defs:r,$ref:e},n)}function hm(t){return mr(t,"Cyclic")}p();function Qcr(t){return St.Update(t,{"~unsafe":null},{})}function cMe(t){return Qe.IsObjectNotArray(t)&&Qe.HasPropertyKey(t,"~unsafe")&&Qe.IsNull(t["~unsafe"])}p();p();p();p();var aT={};br(aT,{Match:()=>obs});p();function obs(t,e){return e[t.length]?.(...t)??(()=>{throw Error("Invalid Arguments")})()}function Ice(...t){let[e,n]=aT.Match(t,{2:(r,i)=>[r,i,i],1:r=>[r,_p(),_p()]});return St.Create({"~kind":"Infer"},{type:"infer",name:e,extends:n},{})}function du(t){return mr(t,"Infer")}p();p();function SG(t,e,n,r={}){return St.Create({"~kind":"Dependent"},{if:t,then:e,else:n},r)}function Ql(t){return mr(t,"Dependent")}function Ucr(t){return St.Discard(t,["~kind","if","then","else"])}p();p();function Gcr(t){return Qe.IsObjectNotArray(t)}function $cr(t){return Qe.Keys(t).filter(n=>isNaN(n)).reduce((n,r)=>[...n,t[r]],[])}function Wcr(t){return Qe.IsString(t)||Qe.IsNumber(t)}function Hcr(t,e){let n=Gcr(t)?$cr(t):t;return St.Create({"~kind":"Enum"},{enum:n},e)}function uf(t){return mr(t,"Enum")}p();function mh(t,e={}){return St.Create({"~kind":"Intersect"},{allOf:t},e)}function Us(t){return mr(t,"Intersect")}function qcr(t){return St.Discard(t,["~kind","allOf"])}p();p();p();p();p();p();p();p();p();function pu(){throw new Error("Unreachable")}var jcr;(function(t){t[t.Array=0]="Array",t[t.BigInt=1]="BigInt",t[t.Boolean=2]="Boolean",t[t.Date=3]="Date",t[t.Constructor=4]="Constructor",t[t.Function=5]="Function",t[t.Null=6]="Null",t[t.Number=7]="Number",t[t.Object=8]="Object",t[t.RegExp=9]="RegExp",t[t.String=10]="String",t[t.Symbol=11]="Symbol",t[t.TypeArray=12]="TypeArray",t[t.Undefined=13]="Undefined"})(jcr||(jcr={}));var k9c=BigInt("14695981039346656037"),[B9c,N9c]=[BigInt("1099511628211"),BigInt("18446744073709551616")],D9c=Array.from({length:256}).map((t,e)=>BigInt(e)),Vcr=new Float64Array(1),P9c=new DataView(Vcr.buffer),M9c=new Uint8Array(Vcr.buffer);var O9c=new TextEncoder;p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();var wce=class{constructor(e,n){this.type=e,this.decode=n}Encode(e){let n=this.type,r=lMe(n)?o=>this.decode(n["~codec"].decode(o)):this.decode,i=lMe(n)?o=>n["~codec"].encode(e(o)):e,s={decode:r,encode:i};return St.Update(this.type,{"~codec":s},{})}},Tce=class{constructor(e){this.type=e}Decode(e){return new wce(this.type,e)}};function uMe(t){return new Tce(t)}function zcr(t,e){return uMe(t).Decode(e).Encode(()=>{throw Error("Encode not implemented")})}function Kcr(t,e){return uMe(t).Decode(()=>{throw Error("Decode not implemented")}).Encode(e)}function lMe(t){return pd(t)&&Qe.HasPropertyKey(t,"~codec")&&Qe.IsObject(t["~codec"])&&Qe.HasPropertyKey(t["~codec"],"encode")&&Qe.HasPropertyKey(t["~codec"],"decode")}p();function Jcr(t){return k9(t)}function CG(t){return pd(t)&&Qe.HasPropertyKey(t,"~immutable")}p();p();function cT(t,e={}){return xr("AddReadonly",[t],e)}function IG(t,e={}){return Sce(t,e)}function Xcr(t){return IG(t)}function wG(t){return pd(t)&&Qe.HasPropertyKey(t,"~readonly")}p();function ubs(t,e){let n=B_t(t)?[...t["~refine"],e]:[e];return St.Update(t,{"~refine":n},{})}function Zcr(...t){let[e,n,r]=aT.Match(t,{3:(i,s,o)=>[i,s,o],2:(i,s)=>[i,s,()=>"Refine Error"]});return ubs(e,{check:n,error:r})}function dbs(t){return Qe.IsObjectNotArray(t)&&Qe.HasPropertyKey(t,"check")&&Qe.HasPropertyKey(t,"error")&&Qe.IsFunction(t.check)&&Qe.IsFunction(t.error)}function B_t(t){return pd(t)&&Qe.HasPropertyKey(t,"~refine")&&Qe.IsArray(t["~refine"])&&Qe.Every(t["~refine"],0,e=>dbs(e))}p();var elr="-?(?:0|[1-9][0-9]*)n";function vce(t){return St.Create({"~kind":"BigInt"},{type:"bigint"},t)}function lT(t){return mr(t,"BigInt")}p();function dMe(t){return St.Create({"~kind":"Boolean"},{type:"boolean"},t)}function s_(t){return mr(t,"Boolean")}p();function Rce(t){return St.Create({"~kind":"Identifier"},{name:t})}function tlr(t){return mr(t,"Identifier")}p();var pMe="-?(?:0|[1-9][0-9]*)";function TG(t){return St.Create({"~kind":"Integer"},{type:"integer"},t)}function df(t){return mr(t,"Integer")}p();var N_t=class extends Error{constructor(e){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function pbs(t){return Qe.IsBigInt(t)?"bigint":Qe.IsBoolean(t)?"boolean":Qe.IsNumber(t)?"number":Qe.IsString(t)?"string":(()=>{throw new N_t(t)})()}function Gs(t,e){return St.Create({"~kind":"Literal"},{type:pbs(t),const:t},e)}function mMe(t){return Qe.IsBigInt(t)||Qe.IsBoolean(t)||Qe.IsNumber(t)||Qe.IsString(t)}function nlr(t){return Fo(t)&&Qe.IsNumber(t.const)}function rlr(t){return Fo(t)&&Qe.IsString(t.const)}function Fo(t){return mr(t,"Literal")}p();function B9(t){return St.Create({"~kind":"Null"},{type:"null"},t)}function N9(t){return mr(t,"Null")}p();var hMe="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function WA(t){return St.Create({"~kind":"Number"},{type:"number"},t)}function Wu(t){return mr(t,"Number")}p();function D9(t){return St.Create({"~kind":"Symbol"},{type:"symbol"},t)}function uM(t){return mr(t,"Symbol")}p();function vG(...t){let[e,n,r]=aT.Match(t,{3:(i,s,o)=>[i,s,o],2:(i,s)=>[i,s,s],1:i=>[i,_p(),_p()]});return St.Create({"~kind":"Parameter"},{name:e,extends:n,equals:r},{})}function ilr(t){return mr(t,"Parameter")}p();p();var fMe=".*";function o_(t){return St.Create({"~kind":"String"},{type:"string"},t)}function pf(t){return mr(t,"String")}p();p();function Cs(t,e={}){return St.Create({"~kind":"Union"},{anyOf:t},e)}function _r(t){return mr(t,"Union")}function slr(t){return St.Discard(t,["~kind","anyOf"])}p();function kce(t){let e=olr(t);return Qe.IsEqual(e.length,2)?e[0]:[]}p();function mbs(t){return!0}function alr(t){return Qe.ShiftLeft(t,(e,n)=>hbs(e)?alr(n):!1,()=>!0)}function clr(t){return Qe.IsEqual(t.length,0)?!1:alr(t)}function hbs(t){return _r(t)?clr(t.anyOf):Fo(t)?mbs(t.const):!1}function gMe(t){return clr(t)}p();function AMe(t){return St.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:t},{})}function llr(t,e,n=[]){return Qe.ShiftLeft(t,(r,i)=>llr(i,e,[...n,`${r}${e}`]),()=>n)}function fbs(t,e){return Qe.IsEqual(t.length,0)?[`${e}`]:llr(t,e)}function ulr(t,e,n=[]){return Qe.ShiftLeft(e,(r,i)=>ulr(t,i,[...n,...dlr(t,r)]),()=>n)}function dlr(t,e){return _r(e)?ulr(t,e.anyOf):Fo(e)?fbs(t,e.const):pu()}function plr(t,e){return Qe.ShiftLeft(e,(n,r)=>plr(dlr(t,n),r),()=>t)}function gbs(t){return t.map(e=>Gs(e))}function Abs(t){let e=plr([],t),n=gbs(e);return Cs(n)}function ybs(t){return Qe.IsEqual(t.length,0)?pu():Qe.IsEqual(t.length,1)&&Fo(t[0])?t[0]:Abs(t)}function D_t(t){let e=kce(t);return Qe.IsEqual(e.length,0)?o_():gMe(e)?ybs(e):AMe(t)}function mlr(t){let e=D_t(t);return Hu(e)?o_():e}p();function Dg(t,e){let n="object",r={[t]:e};return St.Create({"~kind":"Record"},{type:n,patternProperties:r})}p();p();p();function hlr(t){return Dg(GS,t)}p();function flr(t){return Di({true:t,false:t})}p();p();p();p();function qu(t,e={}){let[n,r,i]=[t,t.length,!1];return St.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:n,minItems:r},e)}function Ta(t){return mr(t,"Tuple")}function glr(t){return St.Discard(t,["~kind","type","items","minItems","additionalItems"])}p();p();p();function Ebs(t){return St.Discard(t,["~readonly"])}function P_t(t,e){return St.Update(Ebs(t),{},e)}function Alr(t,e,n,r){let i=Tn(t,e,n);return P_t(i,r)}function ylr(t,e={}){return xr("RemoveReadonly",[t],e)}function Elr(t,e={}){return P_t(t,e)}p();p();function bbs(t){return St.Discard(t,["~optional"])}function M_t(t,e){return St.Update(bbs(t),{},e)}function blr(t,e,n,r){let i=Tn(t,e,n);return M_t(i,r)}function _lr(t,e={}){return xr("RemoveOptional",[t],e)}function yMe(t,e={}){return M_t(t,e)}p();function O_t(t){return t.reduceRight((n,r,i)=>({[i]:r,...n}),{})}function xlr(t){let e=O_t(t.items);return Di(e)}function _bs(t,e){return wG(t)?!!wG(e):!1}function xbs(t,e){return ph(t)?!!ph(e):!1}function Sbs(t,e){let n=_bs(t,e),r=xbs(t,e),i=fl([t,e]),s=Elr(yMe(i));return n&&r?IG(xG(s)):n&&!r?IG(s):!n&&r?xG(s):s}function Cbs(t,e,n){return n in t?n in e?Sbs(t[n],e[n]):t[n]:n in e?e[n]:ia()}function Ibs(t,e){return[...new Set([...Qe.Keys(e),...Qe.Keys(t)])].reduce((r,i)=>({...r,[i]:Cbs(t,e,i)}),{})}function Slr(t){return Io(t)?t.properties:Ta(t)?O_t(t.items):pu()}function Clr(t,e){let n=Slr(t),r=Slr(e),i=Ibs(n,r);return Di(i)}p();function Ilr(t,e){let n=P9(t,e);return Qe.IsEqual(n,Nce)?t:Qe.IsEqual(n,Dce)||Qe.IsEqual(n,Bce)?e:ia()}function wlr(t){return Io(t)||Ta(t)}function wbs(t,e){let n=_r(t),r=_r(e);return n||r}function Tbs(t,e){let n=a_(t),r=a_(e),i=wbs(n,r),s=wlr(n),o=wlr(r);return i?fl([n,r]):s&&o?Clr(n,r):s&&!o?n:!s&&o?r:Ilr(n,r)}function Tlr(t,e,n=[]){return Qe.ShiftLeft(e,(r,i)=>Tlr(t,i,[...n,Tbs(t,r)]),()=>Qe.IsEqual(n.length,0)?[t]:n)}function vlr(t,e,n=[]){return Qe.ShiftLeft(t,(r,i)=>vlr(i,e,[...n,...Pce([r],e)]),()=>n)}function Pce(t,e=[]){return Qe.ShiftLeft(t,(n,r)=>_r(n)?Pce(r,vlr(n.anyOf,e)):Pce(r,Tlr(n,e)),()=>e)}p();function vbs(t,e){let n=fm({},t,e);return Ei.IsExtendsTrueLike(n)?[]:[t]}function Rbs(t,e){return t.reduce((n,r)=>[...n,...vbs(r,e)],[])}function EMe(t,e){let n=a_(t),r=_r(n)?n.anyOf:[n],i=Rbs(r,e);return HA(i)}function $S(t,e,n){let r=mh([t,e]),i=EMe(n,t);return HA([r,i])}function VE(t){let e=t.map(n=>Gs(n));return HA(e)}function fl(t){let e=Pce(t),n=L_t(e);return Mk(n)}function Pg(t){let e=mlr(t);return a_(e)}function HA(t){let e=L_t(t);return Mk(e)}function a_(t){return Ql(t)?$S(t.if,t.then,t.else):uf(t)?VE(t.enum):Us(t)?fl(t.allOf):Hu(t)?Pg(t.pattern):_r(t)?HA(t.anyOf):t}function Mk(t){return Qe.IsEqual(t.length,1)?t[0]:Qe.IsEqual(t.length,0)?ia():Cs(t)}function Rlr(t,e){let n=VE(t);return dM(n,e)}p();function klr(t,e){return Dg(pM,e)}p();function Blr(t,e){let n=fl(t);return dM(n,e)}p();function Nlr(t,e){return Qe.IsString(t)||Qe.IsNumber(t)?Di({[t]:e}):Qe.IsEqual(t,!1)?Di({false:e}):Qe.IsEqual(t,!0)?Di({true:e}):Di({})}p();function Dlr(t,e){return Dg(M9,e)}p();function Plr(t,e){return Qe.HasPropertyKey(t,"pattern")&&(Qe.IsString(t.pattern)||t.pattern instanceof RegExp)?Dg(t.pattern.toString(),e):Dg(GS,e)}p();function Mlr(t,e){let n=kce(t);return gMe(n)?dM(Pg(t),e):Dg(t,e)}p();p();function kbs(t){return _r(t)?Mce(t.anyOf):[t]}function Mce(t){return t.reduce((e,n)=>[...e,...kbs(n)],[])}function Bbs(t){return t.some(e=>pf(e)||Wu(e)||df(e))}function Nbs(t,e){return Qe.IsEqual(Bbs(t),!0)?Dg(GS,e):void 0}function Dbs(t,e){return t.reduce((n,r)=>Fo(r)&&(Qe.IsString(r.const)||Qe.IsNumber(r.const))?{...n,[r.const]:e}:n,{})}function Pbs(t,e){let n=Dbs(t,e);return Di(n)}function Olr(t,e){let n=Mce(t),r=Nbs(n,e);return pd(r)?r:Pbs(n,e)}function dM(t,e){return $u(t)?hlr(e):s_(t)?flr(e):uf(t)?Rlr(t.enum,e):df(t)?klr(t,e):Us(t)?Blr(t.allOf,e):Fo(t)?Nlr(t.const,e):Wu(t)?Dlr(t,e):_r(t)?Olr(t.anyOf,e):pf(t)?Plr(t,e):Hu(t)?Mlr(t.pattern,e):Di({})}function F_t(t,e,n){return ss([t])?St.Update(dM(t,e),{},n):bMe(t,e,n)}function Llr(t,e,n,r,i){let s=Tn(t,e,n),o=Tn(t,e,r);return F_t(s,o,i)}var pM=`^${pMe}$`,M9=`^${hMe}$`,GS=`^${fMe}$`;function bMe(t,e,n={}){return xr("Record",[t,e],n)}function _Me(t,e,n={}){return F_t(t,e,n)}function Flr(t,e){return Dg(t,e)}function xMe(t){return Qe.IsEqual(t,GS)?o_():Qe.IsEqual(t,pM)?TG():Qe.IsEqual(t,M9)?WA():D_t(t)}function c_(t){return Qe.Keys(t.patternProperties)[0]}function O9(t){let e=c_(t);return xMe(e)}function mf(t){return t.patternProperties[c_(t)]}function gm(t){return mr(t,"Record")}p();function RG(t){return St.Create({"~kind":"Rest"},{type:"rest",items:t},{})}function mM(t){return mr(t,"Rest")}p();p();function SMe(t){return St.Create({"~kind":"This"},{$ref:"#"},t)}function CMe(t){return mr(t,"This")}p();function L9(t){return St.Create({"~kind":"Undefined"},{type:"undefined"},t)}function F9(t){return mr(t,"Undefined")}p();function IMe(t){return St.Create({"~kind":"Void"},{type:"void"},t)}function uT(t){return mr(t,"Void")}function Obs(t,e){return Qe.IsEqual(t,"Array")?jE(e[0]):Qe.IsEqual(t,"Capitalize")?TMe(e[0]):Qe.IsEqual(t,"ConstructorParameters")?NMe(e[0]):Qe.IsEqual(t,"Evaluate")?Udr(e[0]):Qe.IsEqual(t,"Exclude")?DMe(e[0],e[1]):Qe.IsEqual(t,"Extract")?PMe(e[0],e[1]):Qe.IsEqual(t,"Index")?Qce(e[0],e[1]):Qe.IsEqual(t,"InstanceType")?MMe(e[0]):Qe.IsEqual(t,"Lowercase")?vMe(e[0]):Qe.IsEqual(t,"NonNullable")?OMe(e[0]):Qe.IsEqual(t,"Omit")?LMe(e[0],e[1]):Qe.IsEqual(t,"Parameters")?FMe(e[0]):Qe.IsEqual(t,"Partial")?QMe(e[0]):Qe.IsEqual(t,"Pick")?UMe(e[0],e[1]):Qe.IsEqual(t,"Readonly")?GMe(e[0]):Qe.IsEqual(t,"KeyOf")?Uce(e[0]):Qe.IsEqual(t,"Record")?bMe(e[0],e[1]):Qe.IsEqual(t,"Required")?$Me(e[0]):Qe.IsEqual(t,"ReturnType")?WMe(e[0]):Qe.IsEqual(t,"Uncapitalize")?RMe(e[0]):Qe.IsEqual(t,"Uppercase")?kMe(e[0]):Fce(Pk(t),e)}function kG(){throw Error("Unreachable")}var Lbs=(t,e=[])=>t.reduce((n,r)=>Qe.IsArray(r)&&Qe.IsEqual(r.length,2)?[...n,r[0]]:[...n,r],[]),Ok=t=>{let[e,n]=t;return Lbs([...e,...n])};function Wlr(t){return vG(t[0],t[2],t[4])}function Hlr(t){return vG(t[0],t[2],t[2])}function qlr(t){return vG(t[0],_p(),t[2])}function jlr(t){return vG(t,_p(),_p())}function Vlr(t){return Ok(t)}function Ylr(t){return t[1]}function zlr(t){return Ok(t)}function Klr(t){return t[1]}function Jlr(t){return Obs(t[0],t[1])}function Xlr(t){return null}function Zlr(t){return o_()}function eur(t){return WA()}function tur(t){return dMe()}function nur(t){return L9()}function rur(t){return B9()}function iur(t){return TG()}function sur(t){return vce()}function our(t){return _p()}function aur(t){return R9()}function cur(t){return Di({})}function lur(t){return ia()}function uur(t){return D9()}function dur(t){return IMe()}function pur(t){return SMe()}function mur(t){return Gs(BigInt(t))}function hur(t){return Gs(Qe.IsEqual(t,"true"))}function fur(t){return Gs(parseFloat(t))}function gur(t){return Gs(t)}function Aur(t){return t[1]}function yur(t){return Gs(t)}function Eur(t){return Qe.IsEqual(t.length,3)?[t[0],t[1],...t[2]]:[t[0]]}function bur(t){return t[1]}function _ur(t){return wMe(t)}function xur(t){return Qe.IsEqual(t.length,6)?SG(t[1],t[3],t[5]):SG(t[1],t[3],_p())}function Sur(t){return t.length>0}function Cur(t){return t.reduce((e,n)=>Qe.IsEqual(n.length,3)?[...e,[n[1]]]:[...e,[]],[])}function Iur(t){return Qe.IsEqual(t.length,6)?[t[1],t[3],t[5]]:[]}function wur(t){return Qe.IsArray(t)&&Qe.IsEqual(t.length,3)?t[1]:t}function Tur(t){return Qe.IsEqual(t.length,2)?t[1]:[]}function Qlr(t,e){return e.reduce((n,r)=>{let i=r;return Qe.IsEqual(i.length,1)?Qce(n,i[0]):Qe.IsEqual(i.length,0)?jE(n):kG()},t)}function Ulr(t,e){return Qe.IsEqual(e.length,3)?BMe(t,e[0],e[1],e[2]):t}function Fbs(t,e){return Qe.IsArray(e)&&Qe.IsEqual(e.length,0)?t:HMe(t,e)}function vur(t){let[e,n,r,i,s]=t;return Fbs(Ulr(e?Uce(Qlr(n,r)):Qlr(n,r),i),s)}function Q_t(t,e){return Qe.IsEqual(e.length,3)?(()=>{let[n,r,i]=e,s=Q_t(r,i);if(Qe.IsEqual(n,"&"))return Us(s)?mh([t,...s.allOf]):mh([t,s]);if(Qe.IsEqual(n,"|"))return _r(s)?Cs([t,...s.anyOf]):Cs([t,s]);kG()})():t}function Rur(t){let[e,n]=t;return Q_t(e,n)}function kur(t){let[e,n]=t;return Q_t(e,n)}function Bur(t){return Qdr(t[1])}function Nur(t){return t[1]}function Dur(t){return cM(t[0],t[2])}function Pur(t){return Qe.IsEqual(t.length,4)?Ice(t[1],t[3]):Qe.IsEqual(t.length,2)?Ice(t[1],_p()):kG()}function Mur(t){return`${t}`}function Our(t){return df(t[3])?pM:Wu(t[3])?M9:uM(t[3])?GS:pf(t[3])?GS:kG()}function Lur(t){return t.length>0}function Fur(t){return t.length>0}function Qur(t){let[e,n,r,i,s]=t;return{[n]:e&&r?cT(sT(s)):e&&!r?cT(s):!e&&r?sT(s):s}}function Uur(t){return Ok(t)}function Gur(t){return t.reduce((e,n)=>Qe.HasPropertyKey(n,pM)||Qe.HasPropertyKey(n,M9)||Qe.HasPropertyKey(n,GS)?[e[0],St.Assign(e[1],n)]:[St.Assign(e[0],n),e[1]],[{},{}])}function $ur(t){return Gur(t[1])}function Wur(t){let[e,n]=t,r=Qe.IsEqual(Qe.Keys(n).length,0)?{}:{patternProperties:n};return Di(e,r)}function Hur(t){return Qe.IsEqual(t.length,5)?cT(sT(t[4])):Qe.IsEqual(t.length,3)?t[2]:Qe.IsEqual(t.length,4)?Qe.IsEqual(t[2],"readonly")?cT(t[3]):sT(t[3]):kG()}function qur(t){return cT(sT(t[1]))}function jur(t){return cT(t[1])}function Vur(t){return sT(t[0])}function Yur(t){return Qe.IsEqual(t.length,2)?RG(t[1]):Qe.IsEqual(t.length,1)?t[0]:kG()}function zur(t){return Ok(t)}function Kur(t){return qu(t[1])}function Jur(t){return cT(sT(t[4]))}function Xur(t){return cT(t[3])}function Zur(t){return sT(t[3])}function edr(t){return t[2]}function tdr(t){return Qe.IsEqual(t.length,2)?RG(t[1]):Qe.IsEqual(t.length,1)?t[0]:kG()}function ndr(t){return Ok(t)}function rdr(t){return iT(t[1],t[4])}function idr(t){return rT(t[2],t[5])}function Glr(t,e){return Qe.IsEqual(t,"remove")?ylr(e):Qe.IsEqual(t,"add")?cT(e):e}function sdr(t){return Qe.IsEqual(t.length,2)&&Qe.IsEqual(t[0],"-")?"remove":Qe.IsEqual(t.length,2)&&Qe.IsEqual(t[0],"+")||Qe.IsEqual(t.length,1)?"add":"none"}function $lr(t,e){return Qe.IsEqual(t,"remove")?_lr(e):Qe.IsEqual(t,"add")?sT(e):e}function odr(t){return Qe.IsEqual(t.length,2)&&Qe.IsEqual(t[0],"-")?"remove":Qe.IsEqual(t.length,2)&&Qe.IsEqual(t[0],"+")||Qe.IsEqual(t.length,1)?"add":"none"}function adr(t){return Qe.IsEqual(t.length,2)?[t[1]]:[]}function cdr(t){return Qe.IsArray(t[6])&&Qe.IsEqual(t[6].length,1)?Oce(Rce(t[3]),t[5],t[6][0],Glr(t[1],$lr(t[8],t[10]))):Oce(Rce(t[3]),t[5],Pk(t[3]),Glr(t[1],$lr(t[8],t[10])))}function ldr(t){return Pk(t)}function udr(t){return BigInt(t)}function ddr(t){return parseFloat(t)}function pdr(t){return Qe.IsEqual(t,"true")}function mdr(t){return null}function hdr(t){return{[t[0]]:t[2]}}function fdr(t){return Ok(t)}function Qbs(t){return t.reduce((e,n)=>St.Assign(e,n),{})}function gdr(t){return Qbs(t[1])}function Adr(t){return Ok(t)}function ydr(t){return t[1]}function Edr(t){return vce()}function bdr(t){return o_()}function _dr(t){return WA()}function xdr(t){return TG()}function Sdr(t){return ia()}function Cdr(t){return Gs(t)}function Idr(t){return Cs(t[1])}function wdr(t){return t.length===3?[...t[0],...t[2]]:t.length===1?[...t[0]]:[]}function Tdr(t){return[t[0],...t[1]]}function vdr(t){return t[1]}function Rdr(t){return Ok(t)}function kdr(t){return Qe.IsEqual(t.length,2)?t[1]:[]}function Bdr(t){let e=t[2],n=t[3],[r,i]=t[4],s=Qe.IsEqual(Qe.Keys(i).length,0)?{}:{patternProperties:i};return{[t[1]]:cM(e,Lce(n,r,s))}}function Ndr(t){let e=t[2],[n,r]=t[3],i=Qe.IsEqual(Qe.Keys(r).length,0)?{}:{patternProperties:r};return{[t[1]]:Lce(e,n,i)}}function Ddr(t){return{[t[1]]:cM(t[2],t[4])}}function Pdr(t){return{[t[1]]:t[3]}}function Mdr(t){return null}function Odr(t){return Gur(Ok(t))}function Ldr(t){return t[1]}function Fdr(t){let e=t[0],n=t[1];return Gdr(St.Assign(e,n[0]))}p();p();p();p();function Gce(t){return so(t.length,2)}function Ns(t,e,n){return Gce(t)?e(t[0],t[1]):n()}p();function $bs(t,e){return so(e.indexOf(t),0)?[t,e.slice(t.length)]:[]}function gl(t,e){for(let n=0;nString.fromCharCode(t+r))}var $dr=[...U_t(97,122),...U_t(65,90)],G_t="0",$_t=U_t(49,57),Q9=[G_t,...$_t],Wdr=" ",U9=` +`;var hM="_",qMe=".",Hdr="$",jMe="-";var qdr="//",jdr="/*",Hbs="*/";function Vdr(t){let e=t.indexOf(Hbs);return so(e,-1)?"":t.slice(e+2)}function Ydr(t){let e=t.indexOf(U9);return so(e,-1)?"":t.slice(e)}function qbs(t){return t.replace(/^[ \t\r\f\v]+/,"")}function VMe(t){let e=qbs(t);return e.startsWith(jdr)?VMe(Vdr(e.slice(2))):e.startsWith(qdr)?VMe(Ydr(e.slice(2))):e}function xp(t){let e=t.trimStart();return e.startsWith(jdr)?xp(Vdr(e.slice(2))):e.startsWith(qdr)?xp(Ydr(e.slice(2))):e}p();function YMe(t,e){return Ns(gl([t],e),(n,r)=>[n,r],()=>["",e])}p();p();function jbs(t,e){return t.includes(e)}function G9(t,e,n,r=""){return Ns(gl(t,n),(i,s)=>jbs(e,i)?G9(t,e,s,r):G9(t,e,s,`${r}${i}`),()=>[r,n])}function Vbs(t){return gl($_t,t)}var Ybs=[...Q9,hM];function zbs(t){return G9(Ybs,[hM],t)}function Kbs(t){return Ns(gl([G_t],t),(e,n)=>[e,n],()=>Ns(Vbs(t),(e,n)=>Ns(zbs(n),(r,i)=>[`${e}${r}`,i],()=>[]),()=>[]))}function zMe(t){return Kbs(xp(t))}function Jbs(t){return YMe(jMe,t)}function Xbs(t){return Ns(Jbs(t),(e,n)=>Ns(zMe(n),(r,i)=>[`${e}${r}`,i],()=>[]),()=>[])}function zdr(t){return Xbs(xp(t))}function Zbs(t){return Ns(zdr(t),(e,n)=>Ns(gl(["n"],n),(r,i)=>[`${e}`,i],()=>[]),()=>[])}function W_t(t){return Zbs(t)}p();function H_t(t,e){return gl([t],e)}function jt(t,e){return so(t,"")?["",e]:t.startsWith(U9)?H_t(t,VMe(e)):t.startsWith(Wdr)?H_t(t,e):H_t(t,xp(e))}p();var Kdr=[...$dr,hM,Hdr];function e_s(t){return gl(Kdr,t)}var t_s=[...Kdr,...Q9];function Jdr(t,e=""){return Ns(gl(t_s,t),(n,r)=>Jdr(r,`${e}${n}`),()=>[e,t])}function n_s(t){return Ns(e_s(t),(e,n)=>Ns(Jdr(n),(r,i)=>[`${e}${r}`,i],()=>[]),()=>[])}function Ul(t){return n_s(xp(t))}p();p();var r_s=[...Q9,hM];function i_s(t){return Gce(gl([qMe],t))}function Xdr(t){return Ns(G9(r_s,[hM],t),(e,n)=>so(e,"")?[]:[e,n],()=>[])}function s_s(t){return Ns(gl([qMe],t),(e,n)=>Ns(Xdr(n),(r,i)=>[`0${e}${r}`,i],()=>[]),()=>[])}function o_s(t){return Ns(zMe(t),(e,n)=>Ns(gl([qMe],n),(r,i)=>Ns(Xdr(i),(s,o)=>[`${e}${r}${s}`,o],()=>[`${e}`,i]),()=>[`${e}`,n]),()=>[])}function a_s(t){return i_s(t)?s_s(t):o_s(t)}function Zdr(t){return a_s(xp(t))}function c_s(t){return YMe(jMe,t)}function l_s(t){return Ns(c_s(t),(e,n)=>Ns(Zdr(n),(r,i)=>[`${e}${r}`,i],()=>[]),()=>[])}function KMe(t){return l_s(xp(t))}p();p();p();function u_s(t){return so(t,"")?[]:[t.slice(0,1),t.slice(1)]}function epr(t,e){return iMe(t,(n,r)=>e.startsWith(n)?!0:epr(r,e),()=>!1)}function fM(t,e,n=""){return Ns(u_s(e),(r,i)=>epr(t,e)?[n,e]:fM(t,i,`${n}${r}`),()=>[])}function d_s(t,e,n){return Ns(gl([t],n),(r,i)=>Ns(fM([e],i),(s,o)=>Ns(gl([e],o),(a,c)=>[`${s}`,c],()=>[]),()=>[]),()=>[])}function p_s(t,e,n){return Ns(gl([t],n),(r,i)=>Ns(fM([U9,e],i),(s,o)=>Ns(gl([e],o),(a,c)=>[`${s}`,c],()=>[]),()=>[]),()=>[])}function tpr(t,e,n,r){return n?d_s(t,e,xp(r)):p_s(t,e,xp(r))}p();function m_s(t,e){return gl(t,e)}function h_s(t,e){return tpr(t,t,!1,e)}function f_s(t,e){return Ns(m_s(t,e),(n,r)=>h_s(n,`${n}${r}`),()=>[])}function JMe(t,e){return f_s(t,xp(e))}p();function npr(t,e){return Ns(fM(t,e),(n,r)=>so(n,"")?[]:[n,r],()=>[])}var he=(t,e,n=()=>[])=>t.length===2?e(t):n(),A_s=t=>he(he(Ul(t),([e,n])=>he(jt("extends",n),([r,i])=>he(Ds(i),([s,o])=>he(jt("=",o),([a,c])=>he(Ds(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Wlr(e),n]),y_s=t=>he(he(Ul(t),([e,n])=>he(jt("extends",n),([r,i])=>he(Ds(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Hlr(e),n]),E_s=t=>he(he(Ul(t),([e,n])=>he(jt("=",n),([r,i])=>he(Ds(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[qlr(e),n]),b_s=t=>he(Ul(t),([e,n])=>[jlr(e),n]),spr=t=>he(he(A_s(t),([e,n])=>[e,n],()=>he(y_s(t),([e,n])=>[e,n],()=>he(E_s(t),([e,n])=>[e,n],()=>he(b_s(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),opr=(t,e=[])=>he(he(spr(t),([n,r])=>he(jt(",",r),([i,s])=>[[n,i],s])),([n,r])=>opr(r,[...e,n]),()=>[e,t]),__s=t=>he(he(opr(t),([e,n])=>he(he(he(spr(n),([r,i])=>[[r],i]),([r,i])=>[r,i],()=>he([[],n],([r,i])=>[r,i],()=>[])),([r,i])=>[[e,r],i])),([e,n])=>[Vlr(e),n]),V_t=t=>he(he(jt("<",t),([e,n])=>he(__s(n),([r,i])=>he(jt(">",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Ylr(e),n]),apr=(t,e=[])=>he(he(Ds(t),([n,r])=>he(jt(",",r),([i,s])=>[[n,i],s])),([n,r])=>apr(r,[...e,n]),()=>[e,t]),x_s=t=>he(he(apr(t),([e,n])=>he(he(he(Ds(n),([r,i])=>[[r],i]),([r,i])=>[r,i],()=>he([[],n],([r,i])=>[r,i],()=>[])),([r,i])=>[[e,r],i])),([e,n])=>[zlr(e),n]),S_s=t=>he(he(jt("<",t),([e,n])=>he(x_s(n),([r,i])=>he(jt(">",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Klr(e),n]),C_s=t=>he(he(Ul(t),([e,n])=>he(S_s(n),([r,i])=>[[e,r],i])),([e,n])=>[Jlr(e),n]),cpr=t=>he(he(he(jt(";",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Xlr(e),n]),lpr=t=>he(jt("string",t),([e,n])=>[Zlr(e),n]),upr=t=>he(jt("number",t),([e,n])=>[eur(e),n]),I_s=t=>he(jt("boolean",t),([e,n])=>[tur(e),n]),w_s=t=>he(jt("undefined",t),([e,n])=>[nur(e),n]),T_s=t=>he(jt("null",t),([e,n])=>[rur(e),n]),dpr=t=>he(jt("integer",t),([e,n])=>[iur(e),n]),v_s=t=>he(jt("bigint",t),([e,n])=>[sur(e),n]),R_s=t=>he(jt("unknown",t),([e,n])=>[our(e),n]),k_s=t=>he(jt("any",t),([e,n])=>[aur(e),n]),B_s=t=>he(jt("object",t),([e,n])=>[cur(e),n]),N_s=t=>he(jt("never",t),([e,n])=>[lur(e),n]),ppr=t=>he(jt("symbol",t),([e,n])=>[uur(e),n]),D_s=t=>he(jt("void",t),([e,n])=>[dur(e),n]),P_s=t=>he(jt("this",t),([e,n])=>[pur(e),n]),M_s=t=>he(he(jt("${",t),([e,n])=>he(Ds(n),([r,i])=>he(jt("}",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Aur(e),n]),q_t=t=>he(fM(["${","`"],t),([e,n])=>[yur(e),n]),mpr=t=>he(he(he(q_t(t),([e,n])=>he(M_s(n),([r,i])=>he(mpr(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>he(he(q_t(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he(he(q_t(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[]))),([e,n])=>[Eur(e),n]),Y_t=t=>he(he(jt("`",t),([e,n])=>he(mpr(n),([r,i])=>he(jt("`",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[bur(e),n]),O_s=t=>he(Y_t(t),([e,n])=>[_ur(e),n]),L_s=t=>he(he(he(jt("if",t),([e,n])=>he(Ds(n),([r,i])=>he(jt("then",i),([s,o])=>he(Ds(o),([a,c])=>he(jt("else",c),([u,l])=>he(Ds(l),([d,m])=>[[e,r,s,a,u,d],m])))))),([e,n])=>[e,n],()=>he(he(jt("if",t),([e,n])=>he(Ds(n),([r,i])=>he(jt("then",i),([s,o])=>he(Ds(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[e,n],()=>[])),([e,n])=>[xur(e),n]),F_s=t=>he(W_t(t),([e,n])=>[mur(e),n]),Q_s=t=>he(he(jt("true",t),([e,n])=>[e,n],()=>he(jt("false",t),([e,n])=>[e,n],()=>[])),([e,n])=>[hur(e),n]),U_s=t=>he(KMe(t),([e,n])=>[fur(e),n]),G_s=t=>he(JMe(["'",'"'],t),([e,n])=>[gur(e),n]),$_s=t=>he(he(he(jt("keyof",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Sur(e),n]),hpr=(t,e=[])=>he(he(he(jt("[",t),([n,r])=>he(Ds(r),([i,s])=>he(jt("]",s),([o,a])=>[[n,i,o],a]))),([n,r])=>[n,r],()=>he(he(jt("[",t),([n,r])=>he(jt("]",r),([i,s])=>[[n,i],s])),([n,r])=>[n,r],()=>[])),([n,r])=>hpr(r,[...e,n]),()=>[e,t]),W_s=t=>he(hpr(t),([e,n])=>[Cur(e),n]),H_s=t=>he(he(he(jt("extends",t),([e,n])=>he(Ds(n),([r,i])=>he(jt("?",i),([s,o])=>he(Ds(o),([a,c])=>he(jt(":",c),([u,l])=>he(Ds(l),([d,m])=>[[e,r,s,a,u,d],m])))))),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Iur(e),n]),q_s=t=>he(he(he(jt("(",t),([e,n])=>he(Ds(n),([r,i])=>he(jt(")",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>he(lpr(t),([e,n])=>[e,n],()=>he(upr(t),([e,n])=>[e,n],()=>he(I_s(t),([e,n])=>[e,n],()=>he(w_s(t),([e,n])=>[e,n],()=>he(T_s(t),([e,n])=>[e,n],()=>he(dpr(t),([e,n])=>[e,n],()=>he(v_s(t),([e,n])=>[e,n],()=>he(R_s(t),([e,n])=>[e,n],()=>he(k_s(t),([e,n])=>[e,n],()=>he(B_s(t),([e,n])=>[e,n],()=>he(N_s(t),([e,n])=>[e,n],()=>he(ppr(t),([e,n])=>[e,n],()=>he(D_s(t),([e,n])=>[e,n],()=>he(P_s(t),([e,n])=>[e,n],()=>he(F_s(t),([e,n])=>[e,n],()=>he(Q_s(t),([e,n])=>[e,n],()=>he(U_s(t),([e,n])=>[e,n],()=>he(G_s(t),([e,n])=>[e,n],()=>he(O_s(t),([e,n])=>[e,n],()=>he(L_s(t),([e,n])=>[e,n],()=>he(ixs(t),([e,n])=>[e,n],()=>he(uxs(t),([e,n])=>[e,n],()=>he(gxs(t),([e,n])=>[e,n],()=>he(fxs(t),([e,n])=>[e,n],()=>he(bxs(t),([e,n])=>[e,n],()=>he(C_s(t),([e,n])=>[e,n],()=>he(_xs(t),([e,n])=>[e,n],()=>[])))))))))))))))))))))))))))),([e,n])=>[wur(e),n]),j_s=t=>he(he(he(jt("with",t),([e,n])=>he(kpr(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Tur(e),n]),fpr=t=>he(he($_s(t),([e,n])=>he(q_s(n),([r,i])=>he(W_s(i),([s,o])=>he(H_s(o),([a,c])=>he(j_s(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[vur(e),n]),gpr=t=>he(he(he(jt("&",t),([e,n])=>he(fpr(n),([r,i])=>he(gpr(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[e,n]),Apr=t=>he(he(fpr(t),([e,n])=>he(gpr(n),([r,i])=>[[e,r],i])),([e,n])=>[Rur(e),n]),ypr=t=>he(he(he(jt("|",t),([e,n])=>he(Apr(n),([r,i])=>he(ypr(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[e,n]),XMe=t=>he(he(Apr(t),([e,n])=>he(ypr(n),([r,i])=>[[e,r],i])),([e,n])=>[kur(e),n]),V_s=t=>he(he(jt("readonly",t),([e,n])=>he(XMe(n),([r,i])=>[[e,r],i])),([e,n])=>[Bur(e),n]),Y_s=t=>he(he(jt("|",t),([e,n])=>he(XMe(n),([r,i])=>[[e,r],i])),([e,n])=>[Nur(e),n]),z_s=t=>he(he(V_t(t),([e,n])=>he(jt("=",n),([r,i])=>he(Ds(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Dur(e),n]),K_s=t=>he(he(he(jt("infer",t),([e,n])=>he(Ul(n),([r,i])=>he(jt("extends",i),([s,o])=>he(XMe(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[e,n],()=>he(he(jt("infer",t),([e,n])=>he(Ul(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>[])),([e,n])=>[Pur(e),n]),Ds=t=>he(he(K_s(t),([e,n])=>[e,n],()=>he(Y_s(t),([e,n])=>[e,n],()=>he(V_s(t),([e,n])=>[e,n],()=>he(XMe(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),J_s=t=>he(KMe(t),([e,n])=>[Mur(e),n]),X_s=t=>he(Ul(t),([e,n])=>[e,n]),Z_s=t=>he(JMe(["'",'"'],t),([e,n])=>[e,n]),exs=t=>he(he(jt("[",t),([e,n])=>he(Ul(n),([r,i])=>he(jt(":",i),([s,o])=>he(he(dpr(o),([a,c])=>[a,c],()=>he(upr(o),([a,c])=>[a,c],()=>he(lpr(o),([a,c])=>[a,c],()=>he(ppr(o),([a,c])=>[a,c],()=>[])))),([a,c])=>he(jt("]",c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Our(e),n]),Epr=t=>he(he(J_s(t),([e,n])=>[e,n],()=>he(X_s(t),([e,n])=>[e,n],()=>he(Z_s(t),([e,n])=>[e,n],()=>he(exs(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),txs=t=>he(he(he(jt("readonly",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Lur(e),n]),nxs=t=>he(he(he(jt("?",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Fur(e),n]),bpr=t=>he(he(txs(t),([e,n])=>he(Epr(n),([r,i])=>he(nxs(i),([s,o])=>he(jt(":",o),([a,c])=>he(Ds(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Qur(e),n]),_pr=t=>he(he(he(jt(",",t),([e,n])=>he(jt(` +`,n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he(he(jt(";",t),([e,n])=>he(jt(` +`,n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he(he(jt(",",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he(he(jt(";",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he(he(jt(` +`,t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[]))))),([e,n])=>[e,n]),xpr=(t,e=[])=>he(he(bpr(t),([n,r])=>he(_pr(r),([i,s])=>[[n,i],s])),([n,r])=>xpr(r,[...e,n]),()=>[e,t]),rxs=t=>he(he(xpr(t),([e,n])=>he(he(he(bpr(n),([r,i])=>[[r],i]),([r,i])=>[r,i],()=>he([[],n],([r,i])=>[r,i],()=>[])),([r,i])=>[[e,r],i])),([e,n])=>[Uur(e),n]),z_t=t=>he(he(jt("{",t),([e,n])=>he(rxs(n),([r,i])=>he(jt("}",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[$ur(e),n]),ixs=t=>he(z_t(t),([e,n])=>[Wur(e),n]),sxs=t=>he(he(he(Ul(t),([e,n])=>he(jt("?",n),([r,i])=>he(jt(":",i),([s,o])=>he(jt("readonly",o),([a,c])=>he(Ds(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[e,n],()=>he(he(Ul(t),([e,n])=>he(jt(":",n),([r,i])=>he(jt("readonly",i),([s,o])=>he(Ds(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[e,n],()=>he(he(Ul(t),([e,n])=>he(jt("?",n),([r,i])=>he(jt(":",i),([s,o])=>he(Ds(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[e,n],()=>he(he(Ul(t),([e,n])=>he(jt(":",n),([r,i])=>he(Ds(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>[])))),([e,n])=>[Hur(e),n]),oxs=t=>he(he(jt("readonly",t),([e,n])=>he(Ds(n),([r,i])=>he(jt("?",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[qur(e),n]),axs=t=>he(he(jt("readonly",t),([e,n])=>he(Ds(n),([r,i])=>[[e,r],i])),([e,n])=>[jur(e),n]),cxs=t=>he(he(Ds(t),([e,n])=>he(jt("?",n),([r,i])=>[[e,r],i])),([e,n])=>[Vur(e),n]),rpr=t=>he(he(sxs(t),([e,n])=>[e,n],()=>he(oxs(t),([e,n])=>[e,n],()=>he(axs(t),([e,n])=>[e,n],()=>he(cxs(t),([e,n])=>[e,n],()=>he(Ds(t),([e,n])=>[e,n],()=>[]))))),([e,n])=>[e,n]),Spr=t=>he(he(he(jt("...",t),([e,n])=>he(rpr(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he(he(rpr(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[])),([e,n])=>[Yur(e),n]),Cpr=(t,e=[])=>he(he(Spr(t),([n,r])=>he(jt(",",r),([i,s])=>[[n,i],s])),([n,r])=>Cpr(r,[...e,n]),()=>[e,t]),lxs=t=>he(he(Cpr(t),([e,n])=>he(he(he(Spr(n),([r,i])=>[[r],i]),([r,i])=>[r,i],()=>he([[],n],([r,i])=>[r,i],()=>[])),([r,i])=>[[e,r],i])),([e,n])=>[zur(e),n]),uxs=t=>he(he(jt("[",t),([e,n])=>he(lxs(n),([r,i])=>he(jt("]",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Kur(e),n]),dxs=t=>he(he(Ul(t),([e,n])=>he(jt("?",n),([r,i])=>he(jt(":",i),([s,o])=>he(jt("readonly",o),([a,c])=>he(Ds(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Jur(e),n]),pxs=t=>he(he(Ul(t),([e,n])=>he(jt(":",n),([r,i])=>he(jt("readonly",i),([s,o])=>he(Ds(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[Xur(e),n]),mxs=t=>he(he(Ul(t),([e,n])=>he(jt("?",n),([r,i])=>he(jt(":",i),([s,o])=>he(Ds(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[Zur(e),n]),hxs=t=>he(he(Ul(t),([e,n])=>he(jt(":",n),([r,i])=>he(Ds(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[edr(e),n]),ipr=t=>he(he(dxs(t),([e,n])=>[e,n],()=>he(pxs(t),([e,n])=>[e,n],()=>he(mxs(t),([e,n])=>[e,n],()=>he(hxs(t),([e,n])=>[e,n],()=>[])))),([e,n])=>[e,n]),Ipr=t=>he(he(he(jt("...",t),([e,n])=>he(ipr(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he(he(ipr(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[])),([e,n])=>[tdr(e),n]),wpr=(t,e=[])=>he(he(Ipr(t),([n,r])=>he(jt(",",r),([i,s])=>[[n,i],s])),([n,r])=>wpr(r,[...e,n]),()=>[e,t]),Tpr=t=>he(he(wpr(t),([e,n])=>he(he(he(Ipr(n),([r,i])=>[[r],i]),([r,i])=>[r,i],()=>he([[],n],([r,i])=>[r,i],()=>[])),([r,i])=>[[e,r],i])),([e,n])=>[ndr(e),n]),fxs=t=>he(he(jt("(",t),([e,n])=>he(Tpr(n),([r,i])=>he(jt(")",i),([s,o])=>he(jt("=>",o),([a,c])=>he(Ds(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[rdr(e),n]),gxs=t=>he(he(jt("new",t),([e,n])=>he(jt("(",n),([r,i])=>he(Tpr(i),([s,o])=>he(jt(")",o),([a,c])=>he(jt("=>",c),([u,l])=>he(Ds(l),([d,m])=>[[e,r,s,a,u,d],m])))))),([e,n])=>[idr(e),n]),Axs=t=>he(he(he(jt("+",t),([e,n])=>he(jt("readonly",n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he(he(jt("-",t),([e,n])=>he(jt("readonly",n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he(he(jt("readonly",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])))),([e,n])=>[sdr(e),n]),yxs=t=>he(he(he(jt("+",t),([e,n])=>he(jt("?",n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he(he(jt("-",t),([e,n])=>he(jt("?",n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he(he(jt("?",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])))),([e,n])=>[odr(e),n]),Exs=t=>he(he(he(jt("as",t),([e,n])=>he(Ds(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[adr(e),n]),bxs=t=>he(he(jt("{",t),([e,n])=>he(Axs(n),([r,i])=>he(jt("[",i),([s,o])=>he(Ul(o),([a,c])=>he(jt("in",c),([u,l])=>he(Ds(l),([d,m])=>he(Exs(m),([h,f])=>he(jt("]",f),([g,A])=>he(yxs(A),([y,E])=>he(jt(":",E),([_,S])=>he(Ds(S),([C,I])=>he(cpr(I),([w,k])=>he(jt("}",k),([N,O])=>[[e,r,s,a,u,d,h,g,y,_,C,w,N],O]))))))))))))),([e,n])=>[cdr(e),n]),_xs=t=>he(Ul(t),([e,n])=>[ldr(e),n]),xxs=t=>he(W_t(t),([e,n])=>[udr(e),n]),Sxs=t=>he(KMe(t),([e,n])=>[ddr(e),n]),Cxs=t=>he(he(jt("true",t),([e,n])=>[e,n],()=>he(jt("false",t),([e,n])=>[e,n],()=>[])),([e,n])=>[pdr(e),n]),Ixs=t=>he(JMe(['"',"'"],t),([e,n])=>[e,n]),wxs=t=>he(jt("null",t),([e,n])=>[mdr(e),n]),Txs=t=>he(jt("undefined",t),([e,n])=>[void 0,n]),vpr=t=>he(he(Epr(t),([e,n])=>he(jt(":",n),([r,i])=>he(K_t(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[hdr(e),n]),Rpr=(t,e=[])=>he(he(vpr(t),([n,r])=>he(_pr(r),([i,s])=>[[n,i],s])),([n,r])=>Rpr(r,[...e,n]),()=>[e,t]),vxs=t=>he(he(Rpr(t),([e,n])=>he(he(he(vpr(n),([r,i])=>[[r],i]),([r,i])=>[r,i],()=>he([[],n],([r,i])=>[r,i],()=>[])),([r,i])=>[[e,r],i])),([e,n])=>[fdr(e),n]),kpr=t=>he(he(jt("{",t),([e,n])=>he(vxs(n),([r,i])=>he(jt("}",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[gdr(e),n]),Bpr=(t,e=[])=>he(he(K_t(t),([n,r])=>he(jt(",",r),([i,s])=>[[n,i],s])),([n,r])=>Bpr(r,[...e,n]),()=>[e,t]),Rxs=t=>he(he(Bpr(t),([e,n])=>he(he(he(K_t(n),([r,i])=>[[r],i]),([r,i])=>[r,i],()=>he([[],n],([r,i])=>[r,i],()=>[])),([r,i])=>[[e,r],i])),([e,n])=>[Adr(e),n]),kxs=t=>he(he(jt("[",t),([e,n])=>he(Rxs(n),([r,i])=>he(jt("]",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[ydr(e),n]),K_t=t=>he(he(xxs(t),([e,n])=>[e,n],()=>he(Sxs(t),([e,n])=>[e,n],()=>he(Cxs(t),([e,n])=>[e,n],()=>he(Ixs(t),([e,n])=>[e,n],()=>he(wxs(t),([e,n])=>[e,n],()=>he(Txs(t),([e,n])=>[e,n],()=>he(kpr(t),([e,n])=>[e,n],()=>he(kxs(t),([e,n])=>[e,n],()=>[])))))))),([e,n])=>[e,n]),Bxs=t=>he(jt("-?(?:0|[1-9][0-9]*)n",t),([e,n])=>[Edr(e),n]),Nxs=t=>he(jt(".*",t),([e,n])=>[bdr(e),n]),Dxs=t=>he(jt("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",t),([e,n])=>[_dr(e),n]),Pxs=t=>he(jt("-?(?:0|[1-9][0-9]*)",t),([e,n])=>[xdr(e),n]),Mxs=t=>he(jt("(?!)",t),([e,n])=>[Sdr(e),n]),Oxs=t=>he(npr(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],t),([e,n])=>[Cdr(e),n]),Lxs=t=>he(he(Bxs(t),([e,n])=>[e,n],()=>he(Nxs(t),([e,n])=>[e,n],()=>he(Dxs(t),([e,n])=>[e,n],()=>he(Pxs(t),([e,n])=>[e,n],()=>he(Mxs(t),([e,n])=>[e,n],()=>he(Fxs(t),([e,n])=>[e,n],()=>he(Oxs(t),([e,n])=>[e,n],()=>[]))))))),([e,n])=>[e,n]),Fxs=t=>he(he(jt("(",t),([e,n])=>he(J_t(n),([r,i])=>he(jt(")",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Idr(e),n]),Npr=t=>he(he(he(j_t(t),([e,n])=>he(jt("|",n),([r,i])=>he(Npr(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[e,n],()=>he(he(j_t(t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[]))),([e,n])=>[wdr(e),n]),j_t=t=>he(he(Lxs(t),([e,n])=>he(J_t(n),([r,i])=>[[e,r],i])),([e,n])=>[Tdr(e),n]),J_t=t=>he(he(Npr(t),([e,n])=>[e,n],()=>he(j_t(t),([e,n])=>[e,n],()=>[])),([e,n])=>[e,n]),olr=t=>he(he(jt("^",t),([e,n])=>he(J_t(n),([r,i])=>he(jt("$",i),([s,o])=>[[e,r,s],o]))),([e,n])=>[vdr(e),n]),Dpr=(t,e=[])=>he(he(Ds(t),([n,r])=>he(jt(",",r),([i,s])=>[[n,i],s])),([n,r])=>Dpr(r,[...e,n]),()=>[e,t]),Qxs=t=>he(he(Dpr(t),([e,n])=>he(he(he(Ds(n),([r,i])=>[[r],i]),([r,i])=>[r,i],()=>he([[],n],([r,i])=>[r,i],()=>[])),([r,i])=>[[e,r],i])),([e,n])=>[Rdr(e),n]),Ppr=t=>he(he(he(jt("extends",t),([e,n])=>he(Qxs(n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[kdr(e),n]),Uxs=t=>he(he(jt("interface",t),([e,n])=>he(Ul(n),([r,i])=>he(V_t(i),([s,o])=>he(Ppr(o),([a,c])=>he(z_t(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Bdr(e),n]),Gxs=t=>he(he(jt("interface",t),([e,n])=>he(Ul(n),([r,i])=>he(Ppr(i),([s,o])=>he(z_t(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[Ndr(e),n]),$xs=t=>he(he(jt("type",t),([e,n])=>he(Ul(n),([r,i])=>he(V_t(i),([s,o])=>he(jt("=",o),([a,c])=>he(Ds(c),([u,l])=>[[e,r,s,a,u],l]))))),([e,n])=>[Ddr(e),n]),Wxs=t=>he(he(jt("type",t),([e,n])=>he(Ul(n),([r,i])=>he(jt("=",i),([s,o])=>he(Ds(o),([a,c])=>[[e,r,s,a],c])))),([e,n])=>[Pdr(e),n]),Hxs=t=>he(he(he(jt("export",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he([[],t],([e,n])=>[e,n],()=>[])),([e,n])=>[Mdr(e),n]),qxs=t=>he(he(he(jt(";",t),([e,n])=>he(jt(` +`,n),([r,i])=>[[e,r],i])),([e,n])=>[e,n],()=>he(he(jt(";",t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>he(he(jt(` +`,t),([e,n])=>[[e],n]),([e,n])=>[e,n],()=>[]))),([e,n])=>[e,n]),Mpr=(t,e=[])=>he(he(X_t(t),([n,r])=>he(qxs(r),([i,s])=>[[n,i],s])),([n,r])=>Mpr(r,[...e,n]),()=>[e,t]),jxs=t=>he(he(Mpr(t),([e,n])=>he(he(he(X_t(n),([r,i])=>[[r],i]),([r,i])=>[r,i],()=>he([[],n],([r,i])=>[r,i],()=>[])),([r,i])=>[[e,r],i])),([e,n])=>[Odr(e),n]),X_t=t=>he(he(Hxs(t),([e,n])=>he(he(Uxs(n),([r,i])=>[r,i],()=>he(Gxs(n),([r,i])=>[r,i],()=>he($xs(n),([r,i])=>[r,i],()=>he(Wxs(n),([r,i])=>[r,i],()=>[])))),([r,i])=>he(cpr(i),([s,o])=>[[e,r,s],o]))),([e,n])=>[Ldr(e),n]),Vxs=t=>he(he(X_t(t),([e,n])=>he(jxs(n),([r,i])=>[[e,r],i])),([e,n])=>[Fdr(e),n]),Opr=t=>he(he(Vxs(t),([e,n])=>[e,n],()=>he(z_s(t),([e,n])=>[e,n],()=>he(Ds(t),([e,n])=>[e,n],()=>[]))),([e,n])=>[e,n]);function Lpr(t){let e=Y_t(`\`${t}\``);return Qe.IsEqual(e.length,2)?e[0]:pu()}p();p();function zxs(t){return t.join("|")}function Kxs(t){return t.slice(1,t.length-1)}function Jxs(t,e,n){return gM(e,`${n}${t}`)}function Xxs(t,e){return gM(t,`${e}${elr}`)}function Zxs(t,e){return gM(t,`${e}${pMe}`)}function eSs(t,e){return gM(t,`${e}${hMe}`)}function tSs(t,e){return $ce(Cs([Gs("false"),Gs("true")]),t,e)}function nSs(t,e){return gM(t,`${e}${fMe}`)}function rSs(t,e,n){return gM(e,`${n}${Kxs(t)}`)}function iSs(t,e,n){let r=Wce(t,{});return $ce(r,e,n)}function sSs(t,e,n){let r=VE(t);return $ce(r,e,n)}function Fpr(t,e,n,r=[]){return Qe.ShiftLeft(t,(i,s)=>Fpr(s,e,n,[...r,$ce(i,[],"")]),()=>gM(e,`${n}(${zxs(r)})`))}function $ce(t,e,n){return uf(t)?sSs(t.enum,e,n):df(t)?Zxs(e,n):Fo(t)?Jxs(t.const,e,n):lT(t)?Xxs(e,n):s_(t)?tSs(e,n):Wu(t)?eSs(e,n):pf(t)?nSs(e,n):Hu(t)?rSs(t.pattern,e,n):Upr(t)?iSs(t.parameters[0],e,n):_r(t)?Fpr(t.anyOf,e,n):Mcr}function gM(t,e){return Qe.ShiftLeft(t,(n,r)=>$ce(n,r,e),()=>e)}function oSs(t){return`^${gM(t,"")}$`}function Qpr(t){let e=oSs(t);return AMe(e)}function Wce(t,e){return ss(t)?St.Update(Qpr(t),{},e):wMe(t,e)}function Gpr(t,e,n,r){let i=YE(t,e,n);return Wce(i,r)}function wMe(t,e={}){return xr("TemplateLiteral",[t],e)}function Upr(t){return pd(t)&&Qe.HasPropertyKey(t,"action")&&Qe.IsEqual(t.action,"TemplateLiteral")}function $pr(t){return Wce(t,{})}function aSs(t){let e=Lpr(t);return $pr(e)}function Wpr(t,e={}){let n=Qe.IsString(t)?aSs(t):$pr(t);return St.Update(n,{},e)}function Hu(t){return mr(t,"TemplateLiteral")}var Ei={};br(Ei,{ExtendsFalse:()=>Hi,ExtendsTrue:()=>Zn,ExtendsUnion:()=>Z_t,IsExtendsFalse:()=>cSs,IsExtendsTrue:()=>qpr,IsExtendsTrueLike:()=>$9,IsExtendsUnion:()=>Hpr,Match:()=>bc});p();function Z_t(t){return St.Create({"~kind":"ExtendsUnion"},{inferred:t})}function Hpr(t){return Qe.IsObject(t)&&Qe.HasPropertyKey(t,"~kind")&&Qe.HasPropertyKey(t,"inferred")&&Qe.IsEqual(t["~kind"],"ExtendsUnion")&&Qe.IsObject(t.inferred)}function Zn(t){return St.Create({"~kind":"ExtendsTrue"},{inferred:t})}function qpr(t){return Qe.IsObject(t)&&Qe.HasPropertyKey(t,"~kind")&&Qe.HasPropertyKey(t,"inferred")&&Qe.IsEqual(t["~kind"],"ExtendsTrue")&&Qe.IsObject(t.inferred)}function Hi(){return St.Create({"~kind":"ExtendsFalse"},{})}function cSs(t){return Qe.IsObject(t)&&Qe.HasPropertyKey(t,"~kind")&&Qe.IsEqual(t["~kind"],"ExtendsFalse")}function $9(t){return Hpr(t)||qpr(t)}function bc(t,e,n){return $9(t)?e(t.inferred):n()}function lSs(t,e,n,r){return bc(Zs(t,n,r),i=>Zn(St.Assign(St.Assign(t,i),{[e]:n})),()=>Hi())}function uSs(t,e){return Zn(t)}function dSs(t,e,n,r,i){return bc(Zs(t,e,n),s=>bc(Zs(s,e,r),o=>Zn(o),()=>Hi()),()=>bc(Zs(t,e,i),s=>Zn(s),()=>Hi()))}function pSs(t,e,n){let r=VE(n);return Zs(t,e,r)}function jpr(t,e,n){return Qe.ShiftLeft(n,(r,i)=>bc(Zs(t,e,r),s=>jpr(s,e,i),()=>Hi()),()=>Zn(t))}function mSs(t,e,n){let r=Pg(n);return Zs(t,e,r)}function Vpr(t,e,n){return Qe.ShiftLeft(n,(r,i)=>bc(Zs(t,e,r),s=>Zn(s),()=>Vpr(t,e,i)),()=>Hi())}function Qo(t,e,n){return $u(n)?uSs(t,e):Ql(n)?dSs(t,e,n.if,n.then,n.else):uf(n)?pSs(t,e,n.enum):du(n)?lSs(t,n.name,e,n.extends):Us(n)?jpr(t,e,n.allOf):Hu(n)?mSs(t,e,n.pattern):_r(n)?Vpr(t,e,n.anyOf):md(n)?Zn(t):Hi()}function Ypr(t,e,n){return du(n)?Qo(t,e,n):$u(n)?Zn(t):md(n)?Zn(t):Z_t(t)}p();function hSs(t,e){let n=CG(t),r=CG(e);return n&&r||!n&&r?!0:!(n&&!r)}function zpr(t,e,n,r){return Vc(r)?hSs(e,r)?Zs(t,n,r.items):Hi():Qo(t,e,r)}p();function Kpr(t,e,n){return lT(n)?Zn(t):Qo(t,e,n)}p();function Jpr(t,e,n){return s_(n)?Zn(t):Qo(t,e,n)}p();p();function fSs(t,e,n,r,i){let s=du(r)?e:r,o=du(r)?r:e,a=ph(e),c=ph(r);return!a&&c?Hi():bc(Zs(t,s,o),u=>Hce(u,n,i),()=>Hi())}function gSs(t,e,n,r){return Qe.ShiftLeft(r,(i,s)=>fSs(t,e,n,i,s),()=>ph(e)?Zn(t):Hi())}function ASs(t,e,n){return Qe.ShiftLeft(e,(r,i)=>gSs(t,r,i,n),()=>Zn(t))}function Hce(t,e,n){return ASs(t,e,n)}p();function ZMe(t,e,n){return uT(n)?Zn(t):Zs(t,e,n)}function Xpr(t,e,n,r){return $u(r)?Zn(t):md(r)?Zn(t):Wd(r)?bc(Hce(t,e,r.parameters),i=>ZMe(i,n,r.instanceType),()=>Hi()):Hi()}p();function Zpr(t,e,n,r,i){return bc(Zs(t,e,i),()=>Zs(t,n,i),()=>Zs(t,r,i))}p();function emr(t,e,n){let r=VE(e);return Zs(t,r,n)}p();function tmr(t,e,n,r){return $u(r)?Zn(t):md(r)?Zn(t):Hd(r)?bc(Hce(t,e,r.parameters),i=>ZMe(i,n,r.returnType),()=>Hi()):Hi()}p();function nmr(t,e,n){return df(n)?Zn(t):Wu(n)?Zn(t):Qo(t,e,n)}p();function rmr(t,e,n){let r=fl(e);return Zs(t,r,n)}p();function eOe(t,e,n){return e===n?Zn(t):Hi()}function ySs(t,e,n){return Fo(n)?eOe(t,e,n.const):lT(n)?Zn(t):Qo(t,Gs(e),n)}function ESs(t,e,n){return Fo(n)?eOe(t,e,n.const):s_(n)?Zn(t):Qo(t,Gs(e),n)}function bSs(t,e,n){return Fo(n)?eOe(t,e,n.const):Wu(n)?Zn(t):Qo(t,Gs(e),n)}function _Ss(t,e,n){return Fo(n)?eOe(t,e,n.const):pf(n)?Zn(t):Qo(t,Gs(e),n)}function imr(t,e,n){return Qe.IsBigInt(e.const)?ySs(t,e.const,n):Qe.IsBoolean(e.const)?ESs(t,e.const,n):Qe.IsNumber(e.const)?bSs(t,e.const,n):Qe.IsString(e.const)?_Ss(t,e.const,n):pu()}p();function smr(t,e,n){return du(n)?Qo(t,e,n):Zn(t)}p();function omr(t,e,n){return N9(n)?Zn(t):Qo(t,e,n)}p();function amr(t,e,n){return Wu(n)?Zn(t):Qo(t,e,n)}p();function xSs(t,e,n){return ph(e)?ph(n)?Zn(t):Hi():Zn(t)}function SSs(t,e,n){return du(n)&&lM(n.extends)?Hi():bc(Zs(t,e,n),r=>xSs(r,e,n),()=>Hi())}function CSs(t,e){return t.reduce((n,r)=>r in e?$9(e[r])?{...n,...e[r].inferred}:pu():pu(),{})}function ISs(t,e,n){let r={};for(let o of Qe.Keys(n))r[o]=o in e?SSs({},e[o],n[o]):ph(n[o])?du(n[o])?Zn(St.Assign(t,{[n[o].name]:n[o].extends})):Zn(t):Hi();let i=Qe.Values(r).every(o=>$9(o)),s=i?CSs(Qe.Keys(r),r):{};return i?Zn(s):Hi()}function wSs(t,e,n){let r=ISs(t,e,n);return $9(r)?Zn(St.Assign(t,r.inferred)):Hi()}function TSs(t,e,n){return wSs(t,e,n)}function vSs(t,e){return Qe.Keys(e).reduce((n,r)=>({...n,[r]:Qe.HasPropertyKey(t,r)?_r(n[r])?Cs([...n[r].anyOf,e[r]]):Cs([t[r],e[r]]):e[r]}),t)}function cmr(t,e,n,r){return Qe.ShiftLeft(e,(i,s)=>bc(Zs({},t[i],n),o=>cmr(t,s,n,vSs(r,o)),()=>Hi()),()=>Zn(r))}function RSs(t,e,n,r){let i=Qe.Keys(e);return cmr(e,i,r,t)}function lmr(t,e,n){return gm(n)?RSs(t,e,c_(n),mf(n)):Io(n)?TSs(t,e,n.properties):Qo(t,Di(e),n)}p();function kSs(t,e){return Qe.IsEqual(Qe.Keys(e).length,0)?Zn(t):Hi()}function BSs(t,e,n,r,i){return Zs(t,n,i)}function umr(t,e,n,r){return gm(r)?BSs(t,xMe(e),n,xMe(c_(r)),mf(r)):Io(r)?kSs(t,r.properties):$u(r)?Zn(t):md(r)?Zn(t):Hi()}p();function dmr(t,e,n){return pf(n)?Zn(t):Qo(t,e,n)}p();function pmr(t,e,n){return uM(n)?Zn(t):Qo(t,e,n)}p();function mmr(t,e,n){let r=Pg(e);return Zs(t,r,n)}p();p();function ext(t,e){return St.Create({"~kind":"Inferrable"},{name:t,type:e},{})}function qce(t){return Qe.IsObject(t)&&Qe.HasPropertyKey(t,"~kind")&&Qe.HasPropertyKey(t,"name")&&Qe.HasPropertyKey(t,"type")&&Qe.IsEqual(t["~kind"],"Inferrable")&&Qe.IsString(t.name)&&Qe.IsObject(t.type)}function txt(t){return mM(t)?du(t.items)?Vc(t.items.extends)?ext(t.items.name,t.items.extends.items):md(t.items.extends)?ext(t.items.name,t.items.extends):void 0:pu():void 0}function tOe(t){return du(t)?ext(t.name,t.extends):void 0}function nxt(t,e,n=[]){return Qe.ShiftLeft(t,(r,i)=>bc(Zs({},r,e),()=>nxt(i,e,[...n,r]),()=>{}),()=>n)}function hmr(t,e,n,r){let i=nxt(n,r);return Qe.IsArray(i)?Zn(St.Assign(t,{[e]:qu(i)})):Hi()}function nOe(t,e,n,r){let i=nxt(n,r);return Qe.IsArray(i)?Zn(St.Assign(t,{[e]:Cs(i)})):Hi()}function NSs(t){return[...t].reverse()}function rxt(t,e){return e?NSs(t):t}function DSs(t){let e=t.length>0?t[0]:void 0,n=pd(e)?txt(e):void 0;return pd(n)}function PSs(t,e,n,r,i,s){return bc(Zs(t,n,i),o=>fmr(o,e,r,s),()=>Hi())}function MSs(t,e,n,r,i){let s=txt(r);return qce(s)?hmr(t,s.name,rxt(n,e),s.type):Qe.ShiftLeft(n,(o,a)=>PSs(t,e,o,a,r,i),()=>Hi())}function OSs(t,e,n,r){return Qe.ShiftLeft(r,(i,s)=>MSs(t,e,n,i,s),()=>Qe.IsEqual(n.length,0)?Zn(t):Hi())}function fmr(t,e,n,r){return OSs(t,e,n,r)}function LSs(t,e,n){let r=AM(t,Ja([],[]),n),i=DSs(r);return fmr(t,i,rxt(e,i),rxt(r,i))}function gmr(t,e,n){let r=tOe(n);return qce(r)?nOe(t,r.name,e,r.type):Qe.ShiftLeft(e,(i,s)=>bc(Zs(t,i,n),o=>gmr(o,s,n),()=>Hi()),()=>Zn(t))}function Amr(t,e,n){let r=AM(t,Ja([],[]),e);return Ta(n)?LSs(t,r,n.items):Vc(n)?gmr(t,r,n.items):Qo(t,qu(r),n)}p();function ymr(t,e,n){return uT(n)?Zn(t):F9(n)?Zn(t):Qo(t,e,n)}p();function Emr(t,e,n){return Qe.ShiftLeft(n,(r,i)=>bc(Zs(t,e,r),s=>Zn(s),()=>Emr(t,e,i)),()=>Hi())}function ixt(t,e,n){return Qe.ShiftLeft(e,(r,i)=>bc(Emr(t,r,n),s=>ixt(s,i,n),()=>Hi()),()=>Zn(t))}function bmr(t,e,n){let r=tOe(n);return qce(r)?nOe(t,r.name,e,r.type):_r(n)?ixt(t,e,n.anyOf):ixt(t,e,[n])}p();function _mr(t,e,n){return du(n)?Qo(t,e,n):$u(n)?Zn(t):md(n)?Zn(t):Hi()}p();function xmr(t,e,n){return uT(n)?Zn(t):Qo(t,e,n)}function Zs(t,e,n){return $u(e)?Ypr(t,e,n):Vc(e)?zpr(t,e,e.items,n):lT(e)?Kpr(t,e,n):s_(e)?Jpr(t,e,n):Wd(e)?Xpr(t,e.parameters,e.instanceType,n):Ql(e)?Zpr(t,e.if,e.then,e.else,n):uf(e)?emr(t,e.enum,n):Hd(e)?tmr(t,e.parameters,e.returnType,n):df(e)?nmr(t,e,n):Us(e)?rmr(t,e.allOf,n):Fo(e)?imr(t,e,n):lM(e)?smr(t,e,n):N9(e)?omr(t,e,n):Wu(e)?amr(t,e,n):Io(e)?lmr(t,e.properties,n):gm(e)?umr(t,c_(e),mf(e),n):pf(e)?dmr(t,e,n):uM(e)?pmr(t,e,n):Hu(e)?mmr(t,e.pattern,n):Ta(e)?Amr(t,e.items,n):F9(e)?ymr(t,e,n):_r(e)?bmr(t,e.anyOf,n):md(e)?_mr(t,e,n):uT(e)?xmr(t,e,n):Hi()}p();p();p();p();p();function FSs(t,e){return fl([...t,Di(e)])}function sxt(t,e,n){return ss(t)?St.Update(FSs(t,e),{},n):Lce(t,e,n)}function Smr(t,e,n,r,i){let s=YE(t,e,n),o=jce(t,e,r);return sxt(s,o,i)}function Lce(t,e,n={}){return xr("Interface",[t,e],n)}function W9(t){return pd(t)&&Qe.HasPropertyKey(t,"action")&&Qe.IsEqual(t.action,"Interface")}function Cmr(t,e,n={}){return sxt(t,e,n)}function QSs(t,e,n){return t.includes(n)?!0:Vce([...t,n],e,e[n])}function Imr(t,e,n){let r=aMe(n);return BG(t,e,r)}function BG(t,e,n){return Qe.ShiftLeft(n,(r,i)=>Vce(t,e,r)?!0:BG(t,e,i),()=>!1)}function Vce(t,e,n){return qd(n)?QSs(t,e,n.$ref):Vc(n)?Vce(t,e,n.items):Wd(n)?BG(t,e,[...n.parameters,n.instanceType]):Hd(n)?BG(t,e,[...n.parameters,n.returnType]):W9(n)?Imr(t,e,n.parameters[1]):Us(n)?BG(t,e,n.allOf):Io(n)?Imr(t,e,n.properties):_r(n)?BG(t,e,n.anyOf):Ta(n)?BG(t,e,n.items):gm(n)?Vce(t,e,mf(n)):!1}function wmr(t,e,n){return Vce(t,e,n)}function USs(t,e){return e.reduce((n,r)=>wmr([r],t,t[r])?[...n,r]:n,[])}function Tmr(t){let e=oMe(t);return USs(t,e)}p();function GSs(t,e,n){return n.includes(e)?n:e in t?Yce(t,t[e],[...n,e]):pu()}function vmr(t,e,n){let r=aMe(e);return H9(t,r,n)}function H9(t,e,n){return e.reduce((r,i)=>Yce(t,i,r),n)}function Yce(t,e,n){return qd(e)?GSs(t,e.$ref,n):Vc(e)?Yce(t,e.items,n):Wd(e)?H9(t,[...e.parameters,e.instanceType],n):Hd(e)?H9(t,[...e.parameters,e.returnType],n):W9(e)?vmr(t,e.parameters[1],n):Us(e)?H9(t,e.allOf,n):Io(e)?vmr(t,e.properties,n):_r(e)?H9(t,e.anyOf,n):Ta(e)?H9(t,e.items,n):gm(e)?Yce(t,mf(e),n):n}function Rmr(t,e,n){return Yce(t,n,[e])}p();function $Ss(t){return R9()}function WSs(t){return Qe.Keys(t).reduce((e,n)=>({...e,[n]:NG(t[n])}),{})}function zce(t){return t.reduce((e,n)=>[...e,NG(n)],[])}function NG(t){return qd(t)?$Ss(t.$ref):Vc(t)?jE(NG(t.items),sMe(t)):Wd(t)?rT(zce(t.parameters),NG(t.instanceType)):Hd(t)?iT(zce(t.parameters),NG(t.returnType)):Us(t)?mh(zce(t.allOf)):Io(t)?Di(WSs(t.properties)):gm(t)?_Me(O9(t),NG(mf(t))):_r(t)?Cs(zce(t.anyOf)):Ta(t)?qu(zce(t.items)):t}function HSs(t,e){return e in t?NG(t[e]):_p()}function kmr(t){return HSs(t.$defs,t.$ref)}p();function qSs(t,e,n){let r=YE(t,Ja([],[]),e),i=jce({},Ja([],[]),n);return fl([...r,Di(i)])}function jSs(t,e){return Qe.Keys(t).filter(r=>e.includes(r)).reduce((r,i)=>{let s=t[i],o=W9(s)?qSs(t,s.parameters[0],s.parameters[1]):s;return{...r,[i]:o}},{})}function Bmr(t,e,n){let r=Rmr(t,e,n),i=jSs(t,r);return oT(i,e)}p();function Nmr(t,e){return e in t?qd(t[e])?Nmr(t,t[e].$ref):t[e]:ia()}function dT(t,e){return Nmr(t,e)}function Dmr(t){return hm(t)?kmr(t):cMe(t)?_p():t}function fm(t,e,n){let r=Dmr(e),i=Dmr(n);return Zs(t,r,i)}var Bce="equal",VSs="disjoint",Nce="left-inside",Dce="right-inside";function P9(t,e){let n=[md(t)?Ei.ExtendsFalse():fm({},t,e),md(t)?Ei.ExtendsTrue({}):fm({},e,t)];return Ei.IsExtendsTrueLike(n[0])&&Ei.IsExtendsTrueLike(n[1])?Bce:Ei.IsExtendsTrueLike(n[0])&&Ei.IsExtendsFalse(n[1])?Nce:Ei.IsExtendsFalse(n[0])&&Ei.IsExtendsTrueLike(n[1])?Dce:VSs}function YSs(t,e){return e.filter(n=>P9(t,n)!==Dce)}function zSs(t,e){let n=e.some(r=>{let i=P9(t,r);return Qe.IsEqual(i,Nce)||Qe.IsEqual(i,Bce)});return Qe.IsEqual(n,!1)}function KSs(t,e){let n=a_(t);return $u(n)?[n]:zSs(n,e)?[...YSs(n,e),n]:e}function JSs(t){return t.reduce((e,n)=>Io(n)?[...e,n]:lM(n)?e:KSs(n,e),[])}function L_t(t){let e=JSs(t);return Mce(e)}p();function oxt(t,e){return St.Update(a_(t),{},e)}function Pmr(t,e,n,r){let i=Tn(t,e,n);return oxt(i,r)}p();function Kce(t,e=[]){return aM(t)&&Qe.IsEqual(t.action,"Conditional")?qd(t.parameters[0])?Kce(t.parameters[2],Kce(t.parameters[3],[...e,t.parameters[0].$ref])):Kce(t.parameters[2],Kce(t.parameters[3],e)):aM(t)&&Qe.IsEqual(t.action,"Mapped")&&aM(t.parameters[1])&&Qe.IsEqual(t.parameters[1].action,"KeyOf")&&qd(t.parameters[1].parameters[0])?[...e,t.parameters[1].parameters[0].$ref]:e}function XSs(t,e){return t.reduce((n,r)=>[...n,e.includes(r.name)],[])}function Lmr(t,e,n=[]){return Qe.ShiftLeft(t,(r,i)=>Qe.ShiftLeft(e,(s,o)=>Lmr(i,o,[...n,[s,r]]),()=>n),()=>n)}function ZSs(t){return _r(t)?[...t.anyOf]:[t]}function eCs(t,e){return t.reduce((n,r)=>[...n,[...r,e]],[])}function Mmr(t,e){return e.reduce((n,r)=>[...n,...eCs(t,r)],[])}function Omr(t){return t.reduce((e,n)=>Qe.IsEqual(n[0],!0)?Mmr(e,ZSs(n[1])):Mmr(e,[n[1]]),[[]])}function Fmr(t,e,n){let r=Kce(n),i=XSs(t,r),s=Lmr(e,i);return aM(n)&&Qe.IsEqual(n.action,"Conditional")||aM(n)&&Qe.IsEqual(n.action,"Mapped")?Omr(s):[e]}p();function tCs(){return["(not-resolvable)",ia()]}function nCs(){return["(not-generic)",ia()]}function rCs(t,e,n){return[t,cM(e,n)]}function iCs(t,e,n){return e in t?Qmr(t,e,t[e],n):tCs()}function Qmr(t,e,n,r){return v9(n)?rCs(e,n.parameters,n.expression):qd(n)?iCs(t,n.$ref,r):nCs()}function Umr(t,e,n){return Qmr(t,"(anonymous)",e,n)}p();function sCs(t,e,n){if(du(e)||q9(e)||Ei.IsExtendsTrueLike(fm({},e,n)))return;let r={parameter:t,expect:n,actual:e};throw new Error(`Argument for parameter ${t} does not satisfy constraint`,{cause:r})}function Gmr(t,e,n,r,i){let s=Tn(t,e,i);return sCs(n,s,r),St.Assign(t,{[n]:s})}function oCs(t,e,n,r,i){let s=Tn(t,e,n.extends),o=Tn(t,e,n.equals);return Qe.ShiftLeft(i,(a,c)=>axt(Gmr(t,e,n.name,s,a),e,r,c),()=>axt(Gmr(t,e,n.name,s,o),e,r,[]))}function axt(t,e,n,r){return Qe.ShiftLeft(n,(i,s)=>oCs(t,e,i,s,r),()=>t)}function $mr(t,e,n,r){return axt(t,e,n,r)}function aCs(t){return Qe.IsGreaterThan(t.callstack.length,0)?t.callstack[t.callstack.length-1]:""}function cCs(t,e){return Qe.IsEqual(aCs(t),e)}function lCs(t,e,n,r,i,s){let o=$mr(t,e,r,s),a=Tn(o,Ja([...e.callstack,n.$ref],e.visited),i);return Tn(o,Ja([],[]),a)}function uCs(t,e,n,r,i,s){return s.reduce((o,a)=>[...o,lCs(t,e,n,r,i,a)],[])}function dCs(t,e,n,r,i,s){let o=Fmr(r,s,i),a=uCs(t,e,n,r,i,o);return Qe.IsEqual(a.length,1)?a[0]:HA(a)}function rOe(t,e,n,r){let i=YE(t,e,r),s=Umr(t,n,r),o=s[0],a=s[1];return v9(a)?cCs(e,o)?Fce(Pk(o),i):dCs(t,e,Pk(o),a.parameters,a.expression,i):Fce(n,i)}function Fce(t,e){return St.Create({"~kind":"Call"},{type:"call",target:t,arguments:e},{})}function Wmr(t,e){return rOe({},Ja([],[]),t,e)}function q9(t){return mr(t,"Call")}p();function pCs(t){return St.Discard(t,["~immutable"])}function Hmr(t,e){return St.Update(pCs(t),{},e)}function qmr(t,e,n,r){let i=Tn(t,e,n);return Hmr(i,r)}p();p();p();p();function jmr(t,e){return t(e)}function Vmr(t,e){return Qe.IsString(e)?Gs(jmr(t,e)):Gs(e)}p();function Ymr(t,e){let n=Pg(e);return Lk(t,n)}p();function zmr(t,e){let n=e.map(r=>Lk(t,r));return Cs(n)}function Lk(t,e){return Fo(e)?Vmr(t,e.const):Hu(e)?Ymr(t,e.pattern):_r(e)?zmr(t,e.anyOf):e}p();function TMe(t,e={}){return xr("Capitalize",[t],e)}function Kmr(t,e={}){return cxt(t,e)}p();function vMe(t,e={}){return xr("Lowercase",[t],e)}function Jmr(t,e={}){return lxt(t,e)}p();function RMe(t,e={}){return xr("Uncapitalize",[t],e)}function Xmr(t,e={}){return uxt(t,e)}p();function kMe(t,e={}){return xr("Uppercase",[t],e)}function Zmr(t,e={}){return dxt(t,e)}var mCs=t=>t[0].toUpperCase()+t.slice(1),hCs=t=>t.toLowerCase(),fCs=t=>t[0].toLowerCase()+t.slice(1),gCs=t=>t.toUpperCase();function cxt(t,e){return ss([t])?St.Update(Lk(mCs,t),{},e):TMe(t,e)}function lxt(t,e){return ss([t])?St.Update(Lk(hCs,t),{},e):vMe(t,e)}function uxt(t,e){return ss([t])?St.Update(Lk(fCs,t),{},e):RMe(t,e)}function dxt(t,e){return ss([t])?St.Update(Lk(gCs,t),{},e):kMe(t,e)}function ehr(t,e,n,r){let i=Tn(t,e,n);return cxt(i,r)}function thr(t,e,n,r){let i=Tn(t,e,n);return lxt(i,r)}function nhr(t,e,n,r){let i=Tn(t,e,n);return uxt(i,r)}function rhr(t,e,n,r){let i=Tn(t,e,n);return dxt(i,r)}p();p();p();function BMe(t,e,n,r,i={}){return xr("Conditional",[t,e,n,r],i)}function ihr(t,e,n,r,i={}){return pxt({},Ja([],[]),t,e,n,r,i)}function ACs(t,e,n,r,i,s){let o=fm(t,n,r);return Ei.IsExtendsUnion(o)?Cs([Tn(o.inferred,e,i),Tn(t,e,s)]):Ei.IsExtendsTrue(o)?Tn(o.inferred,e,i):Tn(t,e,s)}function pxt(t,e,n,r,i,s,o){return ss([n,r])?St.Update(ACs(t,e,n,r,i,s),{},o):BMe(n,r,i,s,o)}function shr(t,e,n,r,i,s,o){let a=Tn(t,e,n),c=Tn(t,e,r);return pxt(t,e,a,c,i,s,o)}p();p();function NMe(t,e={}){return xr("ConstructorParameters",[t],e)}function ohr(t,e={}){return mxt(t,e)}function yCs(t){let e=Wd(t)?t.parameters:[],n=AM({},Ja([],[]),e);return qu(n)}function mxt(t,e){return ss([t])?St.Update(yCs(t),{},e):NMe(t,e)}function ahr(t,e,n,r){let i=Tn(t,e,n);return mxt(i,r)}p();p();function DMe(t,e,n={}){return xr("Exclude",[t,e],n)}function chr(t,e,n={}){return Jce(t,e,n)}function Jce(t,e,n){return ss([t,e])?St.Update(EMe(t,e),{},n):DMe(t,e,n)}function lhr(t,e,n,r,i){let s=Tn(t,e,n),o=Tn(t,e,r);return Jce(s,o,i)}p();p();function PMe(t,e,n={}){return xr("Extract",[t,e],n)}function uhr(t,e,n={}){return hxt(t,e,n)}p();function ECs(t,e){let n=fm({},t,e);return Ei.IsExtendsTrueLike(n)?[t]:[]}function bCs(t,e){return t.reduce((n,r)=>[...n,...ECs(r,e)],[])}function dhr(t,e){let n=a_(t),r=_r(n)?n.anyOf:[n],i=bCs(r,e);return HA(i)}function hxt(t,e,n){return ss([t,e])?St.Update(dhr(t,e),{},n):PMe(t,e,n)}function phr(t,e,n,r,i){let s=Tn(t,e,n),o=Tn(t,e,r);return hxt(s,o,i)}p();p();p();function _Cs(t){return t.reduce((e,n)=>mMe(n)?[...e,Gs(n)]:e,[])}function j9(t){let e=_Cs(t);return Cs(e)}function Qce(t,e,n={}){return xr("Index",[t,e],n)}function mhr(t,e,n={}){let r=Qe.IsArray(e)?j9(e):e;return fxt(t,r,n)}p();p();p();p();function hhr(t,e){let n=dT(t,e);return zE(n)}p();function fhr(t,e,n){let r=$S(t,e,n);return zE(r)}p();function xCs(t,e){let n=Qe.Keys(t).filter(l=>!Qe.HasPropertyKey(e,l)),r=Qe.Keys(e).filter(l=>!Qe.HasPropertyKey(t,l)),i=Qe.Keys(t).filter(l=>Qe.HasPropertyKey(e,l)),s=n.reduce((l,d)=>({...l,[d]:t[d]}),{}),o=r.reduce((l,d)=>({...l,[d]:e[d]}),{}),a=i.reduce((l,d)=>({...l,[d]:fl([t[d],e[d]])}),{}),c=St.Assign(s,o);return St.Assign(c,a)}function ghr(t){return t.reduce((e,n)=>xCs(e,zE(n)),{})}p();p();function Ahr(t){let e=xlr(qu(t));return zE(e)}p();function SCs(t,e){return Qe.Keys(t).filter(i=>i in e).reduce((i,s)=>({...i,[s]:HA([t[s],e[s]])}),{})}function yhr(t,e){return Qe.ShiftLeft(t,(n,r)=>yhr(r,SCs(e,zE(n))),()=>e)}function Ehr(t){return Qe.ShiftLeft(t,(e,n)=>yhr(n,zE(e)),()=>pu())}function zE(t){return hm(t)?hhr(t.$defs,t.$ref):Ql(t)?fhr(t.if,t.then,t.else):Us(t)?ghr(t.allOf):_r(t)?Ehr(t.anyOf):Ta(t)?Ahr(t.items):Io(t)?t.properties:{}}function V9(t){let e=zE(t);return Di(e)}p();p();p();var CCs=new RegExp("^(?:0|[1-9][0-9]*)$");function Y9(t){let e=`${t}`;return CCs.test(e)?parseInt(e):t}function ICs(t){return Gs(Y9(t))}function bhr(t){return t.map(e=>_hr(e))}function _hr(t){return Us(t)?mh(bhr(t.allOf)):_r(t)?Cs(bhr(t.anyOf)):Fo(t)?ICs(t.const):t}function xhr(t,e){let n=_hr(e),r=fm({},n,WA());return Ei.IsExtendsTrueLike(r)?t:Fo(e)&&Qe.IsEqual(e.const,"length")?WA():ia()}p();p();p();p();function Shr(t,e){let n=dT(t,e);return qA(n)}p();function Chr(t,e,n){let r=$S(t,e,n);return qA(r)}p();function Ihr(t){let e=VE(t);return qA(e)}p();function whr(t){let e=fl(t);return qA(e)}p();function Thr(t){return[`${t}`]}p();function vhr(t){let e=Pg(t);return qA(e)}p();function Rhr(t){return t.reduce((e,n)=>[...e,...qA(n)],[])}function qA(t){return hm(t)?Shr(t.$defs,t.$ref):Ql(t)?Chr(t.if,t.then,t.else):uf(t)?Ihr(t.enum):Us(t)?whr(t.allOf):Fo(t)?Thr(t.const):Hu(t)?vhr(t.pattern):_r(t)?Rhr(t.anyOf):[]}function z9(t){return qA(t)}p();function Xce(t,e){return e.map(n=>Zce(t,n))}function Zce(t,e){return Vc(e)?jE(Zce(t,e.items)):Wd(e)?rT(Xce(t,e.parameters),Zce(t,e.instanceType)):Hd(e)?iT(Xce(t,e.parameters),Zce(t,e.returnType)):Ta(e)?qu(Xce(t,e.items)):_r(e)?Cs(Xce(t,e.anyOf)):Us(e)?mh(Xce(t,e.allOf)):CMe(e)?Di(t):e}function khr(t,e){return Zce(t,e)}function wCs(t,e){let n=e in t?t[e]:ia();return khr(t,n)}function Bhr(t,e){return e.reduce((n,r)=>[...n,wCs(t,r)],[])}function TCs(t,e){let n=z9(e),r=Bhr(t,n);return HA(r)}var vCs=new RegExp(pM);function RCs(t){return t.filter(n=>vCs.test(n))}function kCs(t){let e=oMe(t),n=RCs(e),r=Bhr(t,n);return HA(r)}function Nhr(t,e){return Wu(e)?kCs(t):TCs(t,e)}p();p();function BCs(t){return Gs(Y9(t))}function Dhr(t){return t.map(e=>gxt(e))}function gxt(t){return Us(t)?mh(Dhr(t.allOf)):_r(t)?Cs(Dhr(t.anyOf)):Fo(t)?BCs(t.const):t}function NCs(t,e){return t.reduceRight((n,r,i)=>{let s=fm({},Gs(i),e);return Ei.IsExtendsTrueLike(s)?[r,...n]:n},[])}function DCs(t,e){let n=gxt(e),r=NCs(t,n);return Mk(r)}function PCs(t){return Mk(t)}function Phr(t,e){return Fo(e)&&Qe.IsEqual(e.const,"length")?Gs(t.length):Wu(e)||df(e)?PCs(t):DCs(t,e)}function Mhr(t,e){return Vc(t)?xhr(t.items,e):Io(t)?Nhr(t.properties,e):Ta(t)?Phr(t.items,e):ia()}function MCs(t){return hm(t)||Ql(t)||Us(t)||_r(t)?V9(t):t}function fxt(t,e,n){return ss([t,e])?St.Update(Mhr(MCs(t),e),{},n):Qce(t,e,n)}function Ohr(t,e,n,r,i){let s=Tn(t,e,n),o=Tn(t,e,r);return fxt(s,o,i)}p();p();function MMe(t,e={}){return xr("InstanceType",[t],e)}function Lhr(t,e={}){return Axt(t,e)}function OCs(t){return Wd(t)?t.instanceType:ia()}function Axt(t,e){return ss([t])?St.Update(OCs(t),{},e):MMe(t,e)}function Fhr(t,e,n,r={}){let i=Tn(t,e,n);return Axt(i,r)}p();p();function Uce(t,e={}){return xr("KeyOf",[t],e)}function Qhr(t,e={}){return yxt(t,e)}p();p();function Uhr(){return Cs([WA(),o_(),D9()])}p();function Ghr(t){return WA()}p();function LCs(t){return t.reduce((n,r)=>mMe(r)?[...n,Gs(Y9(r))]:pu(),[])}function $hr(t){let e=Qe.Keys(t),n=LCs(e);return Mk(n)}p();function Whr(t){return O9(t)}p();function Hhr(t){let e=t.map((n,r)=>Gs(r));return Mk(e)}function qhr(t){return $u(t)?Uhr():Vc(t)?Ghr(t.items):Io(t)?$hr(t.properties):gm(t)?Whr(t):Ta(t)?Hhr(t.items):ia()}function FCs(t){return hm(t)||Ql(t)||Us(t)||_r(t)?V9(t):t}function yxt(t,e){return ss([t])?St.Update(qhr(FCs(t)),{},e):Uce(t,e)}function jhr(t,e,n,r){let i=Tn(t,e,n);return yxt(i,r)}p();p();function Oce(t,e,n,r,i={}){return xr("Mapped",[t,e,n,r],i)}function Vhr(t,e,n,r,i={}){return Ext({},Ja([],[]),t,e,n,r,i)}p();p();function QCs(t){let e=Pg(t);return iOe(e)}function UCs(t){return t.reduce((e,n)=>[...e,...iOe(n)],[])}function GCs(t){let e=VE(t);return iOe(e)}function $Cs(t){return Qe.IsNumber(t)?[Gs(`${t}`)]:[Gs(t)]}function iOe(t){return uf(t)?GCs(t.enum):Fo(t)?$Cs(t.const):Hu(t)?QCs(t.pattern):_r(t)?UCs(t.anyOf):[t]}function Yhr(t){return iOe(t)}function WCs(t){return Hu(t)?Pg(t.pattern):t}function HCs(t,e,n,r,i,s){let o=St.Assign(t,{[n.name]:r}),a=Tn(o,e,i),c=WCs(a),u=Tn(o,e,s);return nlr(c)||rlr(c)?{[c.const]:u}:{}}function qCs(t,e,n,r,i,s){return r.reduce((o,a)=>[...o,HCs(t,e,n,a,i,s)],[])}function jCs(t){return t.reduce((e,n)=>[...e,Di(n)],[])}function zhr(t,e,n,r,i,s){let o=Yhr(r),a=qCs(t,e,n,o,i,s),c=jCs(a);return fl(c)}function Ext(t,e,n,r,i,s,o){return ss([r])?St.Update(zhr(t,e,n,r,i,s),{},o):Oce(n,r,i,s,o)}function Khr(t,e,n,r,i,s,o){let a=Tn(t,e,r);return Ext(t,e,n,a,i,s,o)}p();function VCs(t,e,n){let r=St.Assign(t,e);return Qe.Keys(e).filter(s=>n.includes(s)).reduce((s,o)=>({...s,[o]:Bmr(r,o,e[o])}),{})}function YCs(t,e,n){let r=St.Assign(t,e);return Qe.Keys(e).filter(s=>!n.includes(s)).reduce((s,o)=>({...s,[o]:Tn(r,Ja([],[]),e[o])}),{})}function zCs(t,e,n){let r=Tmr(e),i=VCs(t,e,r),s=YCs(t,e,r),o={...i,...s};return St.Update(o,{},n)}function sOe(t,e,n,r){return zCs(t,n,r)}p();p();function OMe(t,e={}){return xr("NonNullable",[t],e)}function Jhr(t,e={}){return bxt(t,e)}function KCs(t){let e=Cs([B9(),L9()]);return Jce(t,e,{})}function bxt(t,e){return ss([t])?St.Update(KCs(t),{},e):OMe(t,e)}function Xhr(t,e,n,r){let i=Tn(t,e,n);return bxt(i,r)}p();p();function LMe(t,e,n={}){return xr("Omit",[t,e],n)}function Zhr(t,e,n={}){let r=Qe.IsArray(e)?j9(e):e;return _xt(t,r,n)}p();p();function oOe(t){let e=V9(t);return Io(e)?e.properties:pu()}function JCs(t,e){return Qe.Keys(t).reduce((r,i)=>e.includes(i)?r:{...r,[i]:t[i]},{})}function efr(t,e){let n=oOe(t),r=z9(e),i=JCs(n,r);return Di(i)}function _xt(t,e,n){return ss([t,e])?St.Update(efr(t,e),{},n):LMe(t,e,n)}function tfr(t,e,n,r,i){let s=Tn(t,e,n),o=Tn(t,e,r);return _xt(s,o,i)}p();p();function FMe(t,e={}){return xr("Parameters",[t],e)}function nfr(t,e={}){return xxt(t,e)}function XCs(t){let e=Hd(t)?t.parameters:[],n=AM({},Ja([],[]),e);return qu(n)}function xxt(t,e){return ss([t])?St.Update(XCs(t),{},e):FMe(t,e)}function rfr(t,e,n,r){let i=Tn(t,e,n);return xxt(i,r)}p();p();function QMe(t,e={}){return xr("Partial",[t],e)}function ifr(t,e={}){return Sxt(t,e)}p();p();function sfr(t,e){let n=dT(t,e),r=pT(n);return oT(St.Assign(t,{[e]:r}),e)}p();function ofr(t,e,n){let r=$S(t,e,n);return pT(r)}p();function afr(t){let e=fl(t);return pT(e)}p();function cfr(t){let e=t.map(n=>pT(n));return Cs(e)}p();function lfr(t){let e=Qe.Keys(t).reduce((r,i)=>({...r,[i]:xG(t[i])}),{});return Di(e)}function pT(t){return hm(t)?sfr(t.$defs,t.$ref):Ql(t)?ofr(t.if,t.then,t.else):Us(t)?afr(t.allOf):_r(t)?cfr(t.anyOf):Io(t)?lfr(t.properties):Di({})}function Sxt(t,e){return ss([t])?St.Update(pT(t),{},e):QMe(t,e)}function ufr(t,e,n,r){let i=Tn(t,e,n);return Sxt(i,r)}p();p();function UMe(t,e,n={}){return xr("Pick",[t,e],n)}function dfr(t,e,n={}){let r=Qe.IsArray(e)?j9(e):e;return Cxt(t,r,n)}p();function ZCs(t,e){return Qe.Keys(t).reduce((r,i)=>e.includes(i)?St.Assign(r,{[i]:t[i]}):r,{})}function pfr(t,e){let n=oOe(t),r=z9(e),i=ZCs(n,r);return Di(i)}function Cxt(t,e,n){return ss([t,e])?St.Update(pfr(t,e),{},n):UMe(t,e,n)}function mfr(t,e,n,r,i){let s=Tn(t,e,n),o=Tn(t,e,r);return Cxt(s,o,i)}p();p();function GMe(t,e={}){return xr("ReadonlyObject",[t],e)}function Ixt(t,e={}){return wxt(t,e)}var hfr=Ixt;p();p();function ffr(t){return k9(jE(t))}p();function gfr(t,e){let n=dT(t,e),r=mT(n);return oT(St.Assign(t,{[e]:r}),e)}p();function Afr(t,e,n){let r=$S(t,e,n);return mT(r)}p();function yfr(t){let e=fl(t);return mT(e)}p();function Efr(t){let e=Qe.Keys(t).reduce((r,i)=>({...r,[i]:IG(t[i])}),{});return Di(e)}p();function bfr(t){return k9(qu(t))}p();function _fr(t){let e=t.map(n=>mT(n));return Cs(e)}function mT(t){return Vc(t)?ffr(t.items):hm(t)?gfr(t.$defs,t.$ref):Ql(t)?Afr(t.if,t.then,t.else):Us(t)?yfr(t.allOf):Io(t)?Efr(t.properties):Ta(t)?bfr(t.items):_r(t)?_fr(t.anyOf):t}function wxt(t,e){return ss([t])?St.Update(mT(t),{},e):GMe(t)}function xfr(t,e,n,r){let i=Tn(t,e,n);return wxt(i,r)}p();function Sfr(t,e,n,r){return e.visited.includes(r)?n:r in t?Tn(t,Ja(e.callstack,[...e.visited,r]),t[r]):n}p();p();p();function Cfr(t,e){let n=dT(t,e),r=hT(n);return oT(St.Assign(t,{[e]:r}),e)}p();function Ifr(t,e,n){let r=$S(t,e,n);return hT(r)}p();function wfr(t){let e=fl(t);return hT(e)}p();function Tfr(t){let e=t.map(n=>hT(n));return Cs(e)}p();function vfr(t){let e=Qe.Keys(t).reduce((r,i)=>({...r,[i]:yMe(t[i])}),{});return Di(e)}function hT(t){return hm(t)?Cfr(t.$defs,t.$ref):Ql(t)?Ifr(t.if,t.then,t.else):Us(t)?wfr(t.allOf):_r(t)?Tfr(t.anyOf):Io(t)?vfr(t.properties):Di({})}p();function $Me(t,e={}){return xr("Required",[t],e)}function Rfr(t,e={}){return Txt(t,e)}function Txt(t,e){return ss([t])?St.Update(hT(t),{},e):$Me(t,e)}function kfr(t,e,n,r){let i=Tn(t,e,n);return Txt(i,r)}p();p();function WMe(t,e={}){return xr("ReturnType",[t],e)}function Bfr(t,e={}){return vxt(t,e)}function eIs(t){return Hd(t)?t.returnType:ia()}function vxt(t,e){return ss([t])?St.Update(eIs(t),{},e):WMe(t,e)}function Nfr(t,e,n,r={}){let i=Tn(t,e,n);return vxt(i,r)}p();p();function HMe(t,e){return xr("With",[t,e],{})}function Dfr(t,e){return Rxt(t,e)}function Rxt(t,e){return ss([t])?St.Update(t,{},e):HMe(t,e)}function Pfr(t,e,n,r){let i=Tn(t,e,n);return Rxt(i,r)}p();p();function tIs(t){return mM(t)?Ta(t.items)?kxt(t.items.items):du(t.items)?[t]:qd(t.items)?[t]:[ia()]:[t]}function kxt(t){return t.reduce((n,r)=>[...n,...tIs(r)],[])}function Ja(t,e){return{callstack:t,visited:e}}function ss(t){return Qe.ShiftLeft(t,(e,n)=>qd(e)?!1:ss(n),()=>!0)}function jce(t,e,n){return Qe.Keys(n).reduce((r,i)=>({...r,[i]:Tn(t,e,n[i])}),{})}function AM(t,e,n){let r=YE(t,e,n);return kxt(r)}function YE(t,e,n){return n.map(r=>Tn(t,e,r))}function nIs(t,e){let n=ph(t)?Cce(e,{}):e,r=wG(t)?Sce(n,{}):n;return CG(t)?ele(r,{}):r}function rIs(t,e,n,r,i){return Qe.IsEqual(n,"AddImmutable")?Mfr(t,e,r[0],i):Qe.IsEqual(n,"RemoveImmutable")?qmr(t,e,r[0],i):Qe.IsEqual(n,"AddReadonly")?Bcr(t,e,r[0],i):Qe.IsEqual(n,"RemoveReadonly")?Alr(t,e,r[0],i):Qe.IsEqual(n,"AddOptional")?Ncr(t,e,r[0],i):Qe.IsEqual(n,"RemoveOptional")?blr(t,e,r[0],i):Qe.IsEqual(n,"Capitalize")?ehr(t,e,r[0],i):Qe.IsEqual(n,"Conditional")?shr(t,e,r[0],r[1],r[2],r[3],i):Qe.IsEqual(n,"ConstructorParameters")?ahr(t,e,r[0],i):Qe.IsEqual(n,"Evaluate")?Pmr(t,e,r[0],i):Qe.IsEqual(n,"Exclude")?lhr(t,e,r[0],r[1],i):Qe.IsEqual(n,"Extract")?phr(t,e,r[0],r[1],i):Qe.IsEqual(n,"Index")?Ohr(t,e,r[0],r[1],i):Qe.IsEqual(n,"InstanceType")?Fhr(t,e,r[0],i):Qe.IsEqual(n,"Interface")?Smr(t,e,r[0],r[1],i):Qe.IsEqual(n,"KeyOf")?jhr(t,e,r[0],i):Qe.IsEqual(n,"Lowercase")?thr(t,e,r[0],i):Qe.IsEqual(n,"Mapped")?Khr(t,e,r[0],r[1],r[2],r[3],i):Qe.IsEqual(n,"Module")?sOe(t,e,r[0],i):Qe.IsEqual(n,"NonNullable")?Xhr(t,e,r[0],i):Qe.IsEqual(n,"Pick")?mfr(t,e,r[0],r[1],i):Qe.IsEqual(n,"Parameters")?rfr(t,e,r[0],i):Qe.IsEqual(n,"Partial")?ufr(t,e,r[0],i):Qe.IsEqual(n,"Omit")?tfr(t,e,r[0],r[1],i):Qe.IsEqual(n,"ReadonlyObject")?xfr(t,e,r[0],i):Qe.IsEqual(n,"Record")?Llr(t,e,r[0],r[1],i):Qe.IsEqual(n,"Required")?kfr(t,e,r[0],i):Qe.IsEqual(n,"ReturnType")?Nfr(t,e,r[0],i):Qe.IsEqual(n,"TemplateLiteral")?Gpr(t,e,r[0],i):Qe.IsEqual(n,"Uncapitalize")?nhr(t,e,r[0],i):Qe.IsEqual(n,"Uppercase")?rhr(t,e,r[0],i):Qe.IsEqual(n,"With")?Pfr(t,e,r[0],r[1]):xr(n,r,i)}function iIs(t,e,n){let r=qd(n)?Sfr(t,e,n,n.$ref):Vc(n)?jE(Tn(t,e,n.items),sMe(n)):q9(n)?rOe(t,e,n.target,n.arguments):Wd(n)?rT(YE(t,e,n.parameters),Tn(t,e,n.instanceType),Dcr(n)):Hd(n)?iT(YE(t,e,n.parameters),Tn(t,e,n.returnType),Pcr(n)):Ql(n)?SG(Tn(t,e,n.if),Tn(t,e,n.then),Tn(t,e,n.else),Ucr(n)):Us(n)?mh(YE(t,e,n.allOf),qcr(n)):Io(n)?Di(jce(t,e,n.properties),Fcr(n)):gm(n)?Flr(c_(n),Tn(t,e,mf(n))):mM(n)?RG(Tn(t,e,n.items)):Ta(n)?qu(AM(t,e,n.items),glr(n)):_r(n)?Cs(YE(t,e,n.anyOf),slr(n)):n;return nIs(n,r)}function Tn(t,e,n){return aM(n)?rIs(t,e,n.action,n.parameters,n.options):iIs(t,e,n)}function Bxt(t,e){return Tn(t,Ja([],[]),e)}function sIs(t){return St.Update(t,{"~immutable":!0},{})}function ele(t,e){return St.Update(sIs(t),{},e)}function Mfr(t,e,n,r){let i=Tn(t,e,n);return ele(i,r)}function Qdr(t,e={}){return xr("AddImmutable",[t],e)}function k9(t,e={}){return ele(t,e)}p();p();function Udr(t,e={}){return xr("Evaluate",[t],e)}function Ofr(t,e={}){return oxt(t,e)}p();function Gdr(t,e={}){return xr("Module",[t],e)}function Lfr(t,e={}){return sOe({},Ja([],[]),t,e)}p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function Ffr(...t){let[e,n,r]=aT.Match(t,{2:(o,a)=>Qe.IsString(o)?[{},o,a]:[o,a,{}],3:(o,a,c)=>[o,a,c],1:o=>[{},o,{}]}),i=Opr(n),s=Qe.IsArray(i)&&Qe.IsEqual(i.length,2)?Tn(e,Ja([],[]),i[0]):ia();return St.Update(s,{},r)}var rr={};br(rr,{Any:()=>R9,Array:()=>jE,BigInt:()=>vce,Boolean:()=>dMe,Call:()=>Wmr,Capitalize:()=>Kmr,Codec:()=>uMe,Conditional:()=>ihr,Constructor:()=>rT,ConstructorParameters:()=>ohr,Cyclic:()=>oT,Decode:()=>zcr,DecodeBuilder:()=>Tce,Dependent:()=>SG,Encode:()=>Kcr,EncodeBuilder:()=>wce,Enum:()=>Hcr,Evaluate:()=>Ofr,Exclude:()=>chr,Extends:()=>fm,ExtendsResult:()=>Ei,Extract:()=>uhr,Function:()=>iT,Generic:()=>cM,Identifier:()=>Rce,Immutable:()=>Jcr,Index:()=>mhr,Infer:()=>Ice,InstanceType:()=>Lhr,Instantiate:()=>Bxt,Integer:()=>TG,Interface:()=>Cmr,Intersect:()=>mh,IsAny:()=>$u,IsArray:()=>Vc,IsBigInt:()=>lT,IsBoolean:()=>s_,IsCall:()=>q9,IsCodec:()=>lMe,IsConstructor:()=>Wd,IsCyclic:()=>hm,IsDependent:()=>Ql,IsEnum:()=>uf,IsEnumValue:()=>Wcr,IsFunction:()=>Hd,IsGeneric:()=>v9,IsIdentifier:()=>tlr,IsImmutable:()=>CG,IsInfer:()=>du,IsInteger:()=>df,IsIntersect:()=>Us,IsKind:()=>mr,IsLiteral:()=>Fo,IsNever:()=>lM,IsNull:()=>N9,IsNumber:()=>Wu,IsObject:()=>Io,IsOptional:()=>ph,IsParameter:()=>ilr,IsReadonly:()=>wG,IsRecord:()=>gm,IsRef:()=>qd,IsRefine:()=>B_t,IsRest:()=>mM,IsSchema:()=>pd,IsString:()=>pf,IsSymbol:()=>uM,IsTemplateLiteral:()=>Hu,IsThis:()=>CMe,IsTuple:()=>Ta,IsUndefined:()=>F9,IsUnion:()=>_r,IsUnknown:()=>md,IsUnsafe:()=>cMe,IsVoid:()=>uT,KeyOf:()=>Qhr,Literal:()=>Gs,Lowercase:()=>Jmr,Mapped:()=>Vhr,Module:()=>Lfr,Never:()=>ia,NonNullable:()=>Jhr,Null:()=>B9,Number:()=>WA,Object:()=>Di,Omit:()=>Zhr,Optional:()=>Ocr,Parameter:()=>vG,Parameters:()=>nfr,Partial:()=>ifr,Pick:()=>dfr,Readonly:()=>Xcr,ReadonlyObject:()=>Ixt,ReadonlyType:()=>hfr,Record:()=>_Me,RecordKey:()=>O9,RecordPattern:()=>c_,RecordValue:()=>mf,Ref:()=>Pk,Refine:()=>Zcr,Required:()=>Rfr,Rest:()=>RG,ReturnType:()=>Bfr,Script:()=>Ffr,String:()=>o_,Symbol:()=>D9,TemplateLiteral:()=>Wpr,This:()=>SMe,Tuple:()=>qu,Uncapitalize:()=>Xmr,Undefined:()=>L9,Union:()=>Cs,Unknown:()=>_p,Unsafe:()=>Qcr,Uppercase:()=>Zmr,Void:()=>IMe,With:()=>Dfr});p();Mb();p();var Qfr="Pull request creation was cancelled",Nxt="Thread retrieval was cancelled",Ufr="Pull request update was cancelled",Gfr="PR diff retrieval was cancelled",$fr="Review creation was cancelled",Wfr="CI status retrieval was cancelled",Hfr="Workflow run logs retrieval was cancelled",qfr="Text summarization was cancelled";p();function vs(t){return rr.Union([t,rr.Null()])}var hf={type:"json_schema",strict:"prefer"};p();function wo(t){return t!=null}function Dxt(t,e){return{content:[{type:"text",text:t}],details:{...e,cancelled:!0}}}function ff(t){return async(e,n,r,i,s)=>{if(r?.aborted)return Dxt(t.cancellationMessage,t.cancellationDetails);let o=t.prepareParams(n);return t.execute(o)}}var oIs=rr.Object({title:rr.String({description:lar}),body:vs(rr.String({description:uar})),base:vs(rr.String({description:dar})),dryRun:vs(rr.Boolean({description:par}))},{additionalProperties:!1});function Pxt(t){return{name:"create_pull_request",label:"Create Pull Request",description:car(t.type),promptSnippet:oar,promptGuidelines:aar,parameters:oIs,constrainedSampling:hf,execute:ff({cancellationMessage:Qfr,cancellationDetails:{pullRequestNumber:0,pullRequestUrl:"",headBranch:"",baseBranch:"",dryRun:!1},prepareParams:e=>{let{title:n,body:r,base:i,dryRun:s}=e,o={title:n};return wo(r)&&(o.body=r),wo(i)&&(o.base=i),wo(s)&&(o.dryRun=s),o},execute:e=>t.createPullRequest(e)})}}p();Mb();p();function jfr(t){return[`${t.is_pull_request?"Pull Request":"Issue"} #${t.number}: ${t.title}`,"",`State: ${t.state.toUpperCase()}`,`Author: @${t.author}${t.author_type==="bot"?" (bot)":""}`]}function Vfr(t){let e=[];return t.created_at&&e.push(`Created: ${pE.Instant.from(t.created_at).toString()}`),t.updated_at&&e.push(`Updated: ${pE.Instant.from(t.updated_at).toString()}`),t.closed_at&&e.push(`Closed: ${pE.Instant.from(t.closed_at).toString()}`),t.merged_at&&e.push(`Merged: ${pE.Instant.from(t.merged_at).toString()}`),e}function Yfr(t){return t.labels.length===0?[]:[`Labels: ${t.labels.map(e=>`"${e}"`).join(", ")}`]}function zfr(t){return t.is_pull_request?[`Head Branch: ${t.head_branch??"unknown"}`,`Base Branch: ${t.base_branch??"unknown"}`,`Head SHA: ${t.head_sha??"unknown"}`]:[]}function Kfr(t){return t.body?["","Description:",t.body,""]:[]}function Jfr(t){let e=[`Comments (${t.length}):`];return t.forEach((n,r)=>{let i=n.is_triggering_comment?" [\u{1F4CD} triggering comment]":"";e.push(` ${r+1}. @${n.author}${n.author_type==="bot"?" (bot)":""}${i}`,` ${pE.Instant.from(n.created_at).toString()}`,` ${n.body}`)}),e}function Xfr(t){if(!t||t.length===0)return[];let e=["",`Review Comments (${t.length}):`];return t.forEach((n,r)=>{let i=n.line!==null?` L${n.line}`:"",s=n.side==="LEFT"?" [old]":"";e.push(` ${r+1}. **${n.path}${i}${s}** (@${n.author}${n.author_type==="bot"?" (bot)":""}):`,` ${n.body}`)}),e}function Mxt(t){return[...jfr(t),...Vfr(t),...Yfr(t),...zfr(t),"",...Kfr(t),...Jfr(t.comments),...Xfr(t.is_pull_request?t.review_comments:void 0)].join(` +`)}var aIs=rr.Object({owner:vs(rr.String({description:gar})),repo:vs(rr.String({description:Aar})),issue_number:vs(rr.Integer({description:yar})),max_comments:vs(rr.Integer({description:Ear}))},{additionalProperties:!1});function cIs(){return{content:[{type:"text",text:"Issue or pull request not found"}],details:{number:0,title:"Not Found",body:"Issue or pull request not found",state:"closed",author:"unknown",author_type:"user",created_at:void 0,updated_at:void 0,closed_at:void 0,merged_at:void 0,labels:[],is_pull_request:!1,head_branch:void 0,base_branch:void 0,head_sha:void 0,comments:[],review_comments:[]}}}function Oxt(t){return{name:"get_issue_or_pr_thread",label:"Get Issue/PR Thread",description:far(t.type),promptSnippet:mar(t.type),promptGuidelines:har(t.type),parameters:aIs,constrainedSampling:hf,execute:ff({cancellationMessage:Nxt,cancellationDetails:{number:0,title:"Cancelled",body:Nxt,state:"closed",author:"unknown",author_type:"user",created_at:void 0,updated_at:void 0,closed_at:void 0,merged_at:void 0,labels:[],is_pull_request:!1,head_branch:void 0,base_branch:void 0,head_sha:void 0,comments:[],review_comments:[]},prepareParams:e=>({...wo(e.owner)?{owner:e.owner}:{},...wo(e.repo)?{repo:e.repo}:{},...wo(e.issue_number)?{issue_number:e.issue_number}:{},...wo(e.max_comments)?{max_comments:e.max_comments}:{}}),execute:async e=>{let n=await t.getIssueOrPRThread(e);return n?{content:[{type:"text",text:Mxt(n)}],details:n}:cIs()}})}}p();Mb();var lIs=rr.Object({owner:vs(rr.String({description:Nar})),repo:vs(rr.String({description:Dar})),pull_number:vs(rr.Integer({description:Par})),max_lines:vs(rr.Integer({description:Mar})),ignore_files:vs(rr.Array(rr.String({description:S_t}),{description:S_t}))},{additionalProperties:!1});function uIs(t,e){let n=[...new Set([...t,...e])];return n.length>0?n:void 0}var dIs=t=>` +... (truncated at ${t} bytes)`;function pIs(t,e){if(Buffer.byteLength(t,"utf8")<=e)return{text:t,truncated:!1};let n=dIs(e),r=Buffer.byteLength(n,"utf8"),i=e-r,s=Buffer.from(t,"utf8"),o=Math.min(i,s.length);for(;o>0&&((s[o]??0)&192)===128;)o--;let a=s.subarray(0,o).toString("utf8"),c=a.lastIndexOf(` +`);return c>0&&(a=a.slice(0,c)),{text:a+n,truncated:!0}}function mIs(t,e){let n=t.split(` `);if(n.length<=e)return{text:t,truncated:!1};let r=n.length-e;return{text:n.slice(0,e).join(` `)+` -... (truncated at ${e} lines, ${r} more)`,truncated:!0}}function cjs(t,e,n){let r=ojs(t,n);if(r.truncated)return{text:r.text,truncated:!0,truncatedReason:"bytes"};let s=ajs(t,e);return s.truncated?{text:s.text,truncated:!0,truncatedReason:"lines"}:{text:t,truncated:!1}}function ljs(t,e){let n=e.getContext(),r=t.owner??n.repo.owner,s=t.repo??n.repo.repo,i=t.pull_number??n.issue.number;if(!(!r||!s||!i))return{owner:r,repo:s,pullNumber:i}}function Hct(t,e){return{content:[{type:"text",text:t}],details:e}}async function d3n(t,e,n){let r=ljs(t,e);if(!r)return Hct("Could not resolve PR: owner, repo, or pull_number missing and no PR context available.",{pull_number:0,lines:0,truncated:!1});let{owner:s,repo:i,pullNumber:o}=r,a=sjs(n?.diffIgnorePatterns??[],t.ignore_files??[]),c=await e.getPRDiff(s,i,o,a);if(!c)return Hct(`No diff available for PR #${o}. This may not be a pull request, or the diff is empty.`,{pull_number:o,lines:0,truncated:!1});let u=t.max_lines??n?.diffMaxLines??1e3,l=n?.diffMaxBytes??102400,d=cjs(c,u,l),h={pull_number:o,lines:d.text.split(` -`).length,truncated:d.truncated,...d.truncatedReason?{truncated_reason:d.truncatedReason}:{}};return a&&(h.ignored_files=a),Hct(`PR #${o} Diff: +... (truncated at ${e} lines, ${r} more)`,truncated:!0}}function hIs(t,e,n){let r=pIs(t,n);if(r.truncated)return{text:r.text,truncated:!0,truncatedReason:"bytes"};let i=mIs(t,e);return i.truncated?{text:i.text,truncated:!0,truncatedReason:"lines"}:{text:t,truncated:!1}}function fIs(t,e){let n=e.getContext(),r=t.owner??n.repo.owner,i=t.repo??n.repo.repo,s=t.pull_number??n.issue.number;if(!(!r||!i||!s))return{owner:r,repo:i,pullNumber:s}}function Lxt(t,e){return{content:[{type:"text",text:t}],details:e}}async function Zfr(t,e,n){let r=fIs(t,e);if(!r)return Lxt("Could not resolve PR: owner, repo, or pull_number missing and no PR context available.",{pull_number:0,lines:0,truncated:!1});let{owner:i,repo:s,pullNumber:o}=r,a=uIs(n?.diffIgnorePatterns??[],t.ignore_files??[]),c=await e.getPRDiff(i,s,o,a);if(!c)return Lxt(`No diff available for PR #${o}. This may not be a pull request, or the diff is empty.`,{pull_number:o,lines:0,truncated:!1});let u=t.max_lines??n?.diffMaxLines??1e3,l=n?.diffMaxBytes??102400,d=hIs(c,u,l),m={pull_number:o,lines:d.text.split(` +`).length,truncated:d.truncated,...d.truncatedReason?{truncated_reason:d.truncatedReason}:{}};return a&&(m.ignored_files=a),Lxt(`PR #${o} Diff: \`\`\`diff ${d.text} -\`\`\``,h)}function Vct(t,e){return{name:"get_pr_diff",label:"Get PR Diff",description:zLn(t.type),promptSnippet:YLn,promptGuidelines:KLn(t.type),parameters:rjs,constrainedSampling:Ig,execute:rm({cancellationMessage:e3n,cancellationDetails:{pull_number:0,lines:0,truncated:!1},prepareParams:n=>n,execute:n=>d3n(n,t,e)})}}p();var ujs=Ar.Object({pull_number:$i(Ar.Integer({description:WLn})),title:$i(Ar.String({description:qLn})),body:$i(Ar.String({description:HLn})),message:$i(Ar.String({description:VLn})),dryRun:$i(Ar.Boolean({description:jLn}))},{additionalProperties:!1});function jct(t){return{name:"update_pull_request",label:"Update Pull Request",description:GLn,promptSnippet:ULn,promptGuidelines:$Ln(t.type),parameters:ujs,constrainedSampling:Ig,execute:rm({cancellationMessage:Zqn,cancellationDetails:{pullRequestNumber:0,pullRequestUrl:"",headBranch:"",baseBranch:"",dryRun:!1},prepareParams:e=>{let{pull_number:n,title:r,body:s,message:i,dryRun:o}=e,a={};return Lo(n)&&(a.pull_number=n),Lo(r)&&(a.title=r),Lo(s)&&(a.body=s),Lo(i)&&(a.message=i),Lo(o)&&(a.dryRun=o),a},execute:e=>t.updatePullRequest(e)})}}p();var djs=Ar.Object({path:Ar.String({description:aFn}),line:Ar.Integer({description:cFn}),side:$i(Ar.Union([Ar.Literal("LEFT"),Ar.Literal("RIGHT")],{description:lFn})),start_line:$i(Ar.Integer({description:uFn})),start_side:$i(Ar.Union([Ar.Literal("LEFT"),Ar.Literal("RIGHT")],{description:dFn})),body:Ar.String({description:pFn})},{additionalProperties:!1}),pjs=Ar.Object({pull_number:$i(Ar.Integer({description:sFn})),body:$i(Ar.String({description:iFn})),event:$i(Ar.Union([Ar.Literal("COMMENT"),Ar.Literal("APPROVE"),Ar.Literal("REQUEST_CHANGES")],{description:oFn})),comments:Ar.Array(djs,{description:"Array of inline comments anchored to diff lines. May be empty when body is non-empty. Each comment requires path, line, and body."})},{additionalProperties:!1});function Yct(t){return{name:"create_pull_request_review",label:"Create Pull Request Review",description:rFn(t.type),promptSnippet:tFn,promptGuidelines:nFn,parameters:pjs,constrainedSampling:Ig,execute:rm({cancellationMessage:t3n,cancellationDetails:{reviewId:0,reviewUrl:"",pullRequestNumber:0,event:"COMMENT",commentCount:0},prepareParams:e=>{let n={comments:e.comments.map(r=>({path:r.path,line:r.line,body:r.body,...Lo(r.side)?{side:r.side}:{},...Lo(r.start_line)?{start_line:r.start_line}:{},...Lo(r.start_side)?{start_side:r.start_side}:{}}))};return Lo(e.pull_number)&&(n.pull_number=e.pull_number),Lo(e.body)&&(n.body=e.body),Lo(e.event)&&(n.event=e.event),n},execute:e=>t.createReview(e)})}}p();var hjs=Ar.Object({owner:$i(Ar.String({description:MTe})),repo:$i(Ar.String({description:LTe})),pull_number:$i(Ar.Integer({description:gFn})),ref:$i(Ar.String({description:AFn})),status:$i(Ar.String({description:yFn})),conclusion:$i(Ar.String({description:EFn}))},{additionalProperties:!1});function Kct(t){return{name:"get_ci_status",label:"Get CI Status",description:fFn,promptSnippet:hFn,promptGuidelines:mFn(t.type),parameters:hjs,constrainedSampling:Ig,execute:rm({cancellationMessage:n3n,cancellationDetails:{ref:"",check_runs:[],workflow_runs:[]},prepareParams:e=>({...Lo(e.owner)?{owner:e.owner}:{},...Lo(e.repo)?{repo:e.repo}:{},...Lo(e.pull_number)?{pull_number:e.pull_number}:{},...Lo(e.ref)?{ref:e.ref}:{},...Lo(e.status)?{status:e.status}:{},...Lo(e.conclusion)?{conclusion:e.conclusion}:{}}),execute:async e=>t.getCIStatus(e)})}}p();var mjs=Ar.Object({owner:$i(Ar.String({description:MTe})),repo:$i(Ar.String({description:LTe})),run_id:Ar.Integer({description:CFn}),max_bytes:$i(Ar.Integer({description:IFn}))},{additionalProperties:!1});function zct(t){return{name:"get_workflow_run_logs",label:"Get Workflow Run Logs",description:SFn(t.type),promptSnippet:bFn,promptGuidelines:_Fn,parameters:mjs,constrainedSampling:Ig,execute:rm({cancellationMessage:r3n,cancellationDetails:{run_id:0,jobs:[],total_bytes:0,truncated:!1},prepareParams:e=>({...Lo(e.owner)?{owner:e.owner}:{},...Lo(e.repo)?{repo:e.repo}:{},run_id:e.run_id,...Lo(e.max_bytes)?{max_bytes:e.max_bytes}:{}}),execute:async e=>t.getWorkflowRunLogs(e)})}}function Jct(t,e){return n=>{[Gct(t),jct(t),qct(t),Vct(t,e),Yct(t),Kct(t),zct(t)].forEach(s=>{n.registerTool(s)})}}function gjs(t,e){let n=new Set(e.map(r=>r.path));t.loaded=[...new Set(t.loaded.filter(r=>n.has(r)))]}async function p3n(t,e){let n=[],r={requested:t??[],loaded:[],warnings:[]};if(!t?.length)return{paths:n,info:r};let s=El.inMemory(),i=e??process.cwd(),a=await new jh({cwd:i,agentDir:ls(),settingsManager:s}).resolveExtensionSources(t,{local:!0,temporary:!0});for(let c of a.extensions)c.enabled&&(r.loaded.push(c.path),n.push(c.path));return a.extensions.length===0&&t.length>0&&r.warnings.push(`No extensions resolved from: ${t.join(", ")}`),{paths:n,info:r}}async function h3n(t,e,n){let r=n?.extensions,s=n?.loadBuiltinExtensions??!0,{paths:i,info:o}=await p3n(r,n?.cwd),a=[Pat(t,o)];return s&&a.unshift(Jct(e,n)),{extensionFactories:a,additionalExtensionPaths:i,extensionsOverride:c=>(gjs(o,c.extensions),c),systemPromptOverride:()=>n?.systemPrompt??OTe(e.type),appendSystemPromptOverride:c=>c.length===0?[]:c,noThemes:!0}}var Ajs=15e3,XV=class{model;modelRuntime;session;thinkingLevel;outputChunks=[];logger;platformProvider;config;events;lastAgentError;sessionEventHandler;constructor(e,n,r,s){this.logger=e,this.platformProvider=n,this.config=r,this.events=s??{},this.thinkingLevel=r.thinkingLevel??"off"}async ready(){let e=this.config,n=await h3n(this.logger,this.platformProvider,e),r=this.config.cwd??process.cwd(),s=El.create(r);this.modelRuntime=await Hh.create(),this.config.token&&(this.logger.debug(`[auth] Setting api_key token for ${this.config.provider} provider`),await this.applyRuntimeApiKey(this.config.token)),this.config.baseUrl&&(this.logger.debug(`[provider] Overriding base URL for ${this.config.provider}: ${this.config.baseUrl}`),this.modelRuntime.registerProvider(this.config.provider,{baseUrl:this.config.baseUrl}));let i=await CF({cwd:r,modelRuntime:this.modelRuntime,settingsManager:s,resourceLoaderOptions:n});for(let f of i.diagnostics)f.type==="error"?this.logger.error(`[services] ${f.message}`):f.type==="warning"&&this.logger.warning(`[services] ${f.message}`);let o=i.resourceLoader.getExtensions().errors;for(let f of o)this.logger.error(`[extension] ${f.path}: ${f.error}`);let a=this.modelRuntime.getModel(this.config.provider,this.config.model);if(a)this.model=a;else throw new Error(`Model not found: ${this.config.provider}/${this.config.model}. Please check that the \`provider\` and \`model\` inputs are correct and that the provider is supported. See https://github.com/shaftoe/pi-coding-agent-action#usage for details.`);let c=this.thinkingLevel,u=uu(this.model,c);if(u!==c){let f=NR(this.model);this.logger.warning(`[thinking] Requested level "${c}" is not supported by ${this.model.provider}/${this.model.id}; clamping to "${u}" (supported: ${f.join(", ")})`),this.thinkingLevel=u,this.config.thinkingLevel=u}let l=this.config.loadedTools,h=this.config.exportSessionHtml||this.config.exportSessionJsonl||this.config.shareSession?eo.create(i.cwd):eo.inMemory(i.cwd),{session:m}=await IF({services:i,sessionManager:h,model:this.model,thinkingLevel:this.thinkingLevel,...l?{tools:l}:{}});if(this.session=m,this.config.autoCompaction&&(m.setAutoCompactionEnabled(!0),this.logger.info("[auto-compaction] enabled")),l){let f=m.getAllTools().map(b=>b.name),g=new Set(f),A=l.filter(b=>!g.has(b));if(A.length>0){let b=`loaded_tools: unknown tool name(s): ${A.join(", ")}. Available tools: ${f.sort().join(", ")}`;throw this.logger.info(`[loaded_tools] \u274C ${b}`),new Error(b)}let y=f.filter(b=>!l.includes(b));y.length>0&&this.logger.info(`[loaded_tools] Keeping ${l.length} tool(s): ${l.join(", ")} -[loaded_tools] Removing ${y.length} tool(s): ${y.sort().join(", ")}`)}return this.sessionEventHandler=f=>{if(f.type.includes("retry")){this.handleRetryEvent(f);return}switch(f.type){case"message_update":this.handleMessageUpdate(f.assistantMessageEvent);break;case"agent_end":this.handleAgentEnd(f.messages);break;case"agent_settled":this.events.onPromptComplete?.();break;default:break}},this.session.subscribe(this.sessionEventHandler),this}async applyRuntimeApiKey(e){try{await this.modelRuntime.setRuntimeApiKey(this.config.provider,e)}catch(n){if(!(n instanceof I0))throw n;let r=n.providerId;this.logger.warning(`[auth] API key for "${r}" was saved, but the model state could not be synchronized \u2014 attempting a catalog refresh to recover`);let s=typeof AbortSignal.timeout=="function"?AbortSignal.timeout(Ajs):void 0,{aborted:i,errors:o}=await this.modelRuntime.refresh({providers:[r],allowNetwork:!0,force:!0,...s?{signal:s}:void 0}),a=o.get(r);if(i||a)throw new Error(`Could not synchronize model state for provider "${r}" after setting its API key. The key was saved, but the model catalog could not be refreshed (${a?a.message:"refresh aborted"}). Check that the \`provider\`, \`model\`, and \`base_url\` inputs are valid for this provider.`,{cause:n})}}async run(e){if(!e)throw new Error("no text, skipping prompt");this.lastAgentError=void 0,await this.session.prompt(e);let n=this.outputChunks.join(""),r=this.collectSessionStats(),s=this.lastAgentError;return{result:n,sessionStats:r,error:s}}getSessionStats(){return this.collectSessionStats()}async exportSessionHtml(e){return this.session.exportToHtml(e)}async exportSessionJsonl(e){return this.session.exportToJsonl(e)}dispose(){this.session?.dispose()}handleMessageUpdate(e){switch(e.type){case"text_delta":this.outputChunks.push(e.delta);break;case"thinking_delta":this.events.onThinkingDelta?.(e.delta);break;case"thinking_end":this.events.onThinkingComplete?.();break;default:break}}handleAgentEnd(e){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r&&r.role==="assistant"){let s=r;this.lastAgentError=s.stopReason==="error"?s.errorMessage:void 0;break}}}handleRetryEvent(e){switch(e.type){case"auto_retry_start":this.handleAutoRetryStart(e);break;case"auto_retry_end":this.handleAutoRetryEnd(e);break;case"summarization_retry_scheduled":this.handleSummarizationRetryScheduled(e);break;case"summarization_retry_attempt_start":this.handleSummarizationRetryAttemptStart(e);break;case"summarization_retry_finished":this.handleSummarizationRetryFinished();break;default:break}}handleAutoRetryStart(e){this.logger.info(`[auto-retry] \u{1F504} provider call retrying \u2014 attempt ${e.attempt}/${e.maxAttempts} after ${e.delayMs}ms (last error: ${e.errorMessage})`)}handleAutoRetryEnd(e){if(e.success)this.logger.info(`[auto-retry] \u2705 recovered on attempt ${e.attempt}`);else{let n=e.finalError?`: ${e.finalError}`:"";this.logger.warning(`[auto-retry] \u274C exhausted after attempt ${e.attempt}${n}`)}}handleSummarizationRetryScheduled(e){this.logger.info(`[summarization-retry] \u{1F504} summary generation retrying \u2014 attempt ${e.attempt}/${e.maxAttempts} after ${e.delayMs}ms (last error: ${e.errorMessage})`)}handleSummarizationRetryAttemptStart(e){let n=e.source==="compaction"?`compaction (${e.reason})`:"branchSummary";this.logger.debug(`[summarization-retry] \u25B6\uFE0F starting ${n} summary attempt`)}handleSummarizationRetryFinished(){this.logger.info("[summarization-retry] \u2022 summary retry loop finished")}collectSessionStats(){if(this.session)try{let e=this.session.getSessionStats();return{inputTokens:e.tokens.input,outputTokens:e.tokens.output,totalTokens:e.tokens.total,cost:e.cost,version:XJ()}}catch{this.logger.notice("Failed to get session stats, continuing without stats");return}}};function Vve(t){return{async run(e){return await t.ready(),t.run(e)},getSessionStats(){return t.getSessionStats()},async exportSessionHtml(e){return t.exportSessionHtml(e)},async exportSessionJsonl(e){return t.exportSessionJsonl(e)},dispose(){t.dispose()}}}p();p();p();var Ujs=Gt(slt(),1);p();var zve=class{debug(e){_Y(e)}info(e){mEt(e)}warning(e){toe(e)}notice(e){hEt(e)}error(e){p1e(e)}startGroup(e){fEt(e)}endGroup(){gEt()}getInput(e){return Pc(e)}setFailed(e){CU(e)}setOutput(e,n){eoe(e,n)}};p();p();p();p();var olt="eyes",tj=255,I3n="pi/issue",x3n=[".github/workflows/pi.yml"],w3n="/pi ",alt=100,clt=50;p();function rv(t){return t==null?"":t.replace(//g,"").replace(/[\u200B-\u200F\u2028-\u202F\u2060-\u206F\uFEFF]/g,"").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,"")}p();function Xve(t){if(!(typeof t!="object"||t===null||Array.isArray(t)))return t}function lQ(t){if(!(typeof t!="string"||t.trim()===""))return t.trim()}function Jve(t){if(!(typeof t!="number"||!Number.isSafeInteger(t)||t<=0))return t}function Wjs(t){let e=Xve(t.repository);if(!e)return{};let n=lQ(e.full_name);if(n){let o=n.split("/");if(o.length===2){let a=lQ(o[0]),c=lQ(o[1]);if(a&&c)return{owner:a,repo:c}}}let r=Xve(e.owner),s=lQ(r?.login),i=lQ(e.name);return{...s?{owner:s}:{},...i?{repo:i}:{}}}function qjs(t){let e=Xve(t.pull_request),n=Xve(t.issue);return Jve(e?.number)??Jve(n?.number)??Jve(t.number)}function T3n(t){let e=Wjs(t.payload),n=lQ(t.repo.owner)??e.owner??"",r=lQ(t.repo.repo)??e.repo??"",s=Jve(t.issue.number)??qjs(t.payload)??0;return n===t.repo.owner&&r===t.repo.repo&&s===t.issue.number?t:{...t,repo:{owner:n,repo:r},issue:{number:s}}}function llt(t){let{eventName:e,payload:n}=t.context;return e==="pull_request"||n.pull_request!==void 0}function gre(t){if(llt(t))return"pull_request";if(t.context.eventName==="issue_comment"||t.context.eventName==="issues")return"issue"}function v3n(t){return t.trigger??w3n}var Hjs={issue_comment:t=>t.comment?.created_at,pull_request_review_comment:t=>t.comment?.created_at,pull_request_review:t=>t.review?.submitted_at,issues:t=>t.issue?.updated_at,pull_request:t=>t.pull_request?.updated_at};function Are(t){let{eventName:e,payload:n}=t.context,r=Hjs[e];if(!r){t.logger.debug(`[getStartTimeFromContext] No timestamp source for event type: ${e}`);return}let s=r(n);if(s)return qA.Instant.from(s)}var Vjs={issue:t=>{let e=t.issue;if(!(!e?.title||e.number===void 0))return{title:e.title,number:e.number,...e.body!==null&&e.body!==void 0?{body:rv(e.body)}:{}}},pull_request:t=>{let e=t.pull_request;if(!(!e?.title||e.number===void 0))return{title:e.title,number:e.number,...e.body!==null&&e.body!==void 0?{body:rv(e.body)}:{}}}};function R3n(t){let e=gre(t);if(!e)return;let n=Vjs[e];if(n)return n(t.context.payload)}async function ult(t,e,n){let r=R3n(t);if(!r&&t.context.issue?.number&&(r=await jjs(t,t.context.issue.number)),r){let{title:s,body:i,number:o}=r,a=[`Issue/PR #${o}: ${s}`];return i&&a.push(` +\`\`\``,m)}function Fxt(t,e){return{name:"get_pr_diff",label:"Get PR Diff",description:Bar(t.type),promptSnippet:Rar,promptGuidelines:kar(t.type),parameters:lIs,constrainedSampling:hf,execute:ff({cancellationMessage:Gfr,cancellationDetails:{pull_number:0,lines:0,truncated:!1},prepareParams:n=>n,execute:n=>Zfr(n,t,e)})}}p();Mb();var gIs=rr.Object({pull_number:vs(rr.Integer({description:Sar})),title:vs(rr.String({description:Car})),body:vs(rr.String({description:Iar})),message:vs(rr.String({description:war})),dryRun:vs(rr.Boolean({description:Tar}))},{additionalProperties:!1});function Qxt(t){return{name:"update_pull_request",label:"Update Pull Request",description:xar,promptSnippet:bar,promptGuidelines:_ar(t.type),parameters:gIs,constrainedSampling:hf,execute:ff({cancellationMessage:Ufr,cancellationDetails:{pullRequestNumber:0,pullRequestUrl:"",headBranch:"",baseBranch:"",dryRun:!1},prepareParams:e=>{let{pull_number:n,title:r,body:i,message:s,dryRun:o}=e,a={};return wo(n)&&(a.pull_number=n),wo(r)&&(a.title=r),wo(i)&&(a.body=i),wo(s)&&(a.message=s),wo(o)&&(a.dryRun=o),a},execute:e=>t.updatePullRequest(e)})}}p();Mb();var AIs=rr.Object({path:rr.String({description:$ar}),line:rr.Integer({description:War}),side:vs(rr.Union([rr.Literal("LEFT"),rr.Literal("RIGHT")],{description:Har})),start_line:vs(rr.Integer({description:qar})),start_side:vs(rr.Union([rr.Literal("LEFT"),rr.Literal("RIGHT")],{description:jar})),body:rr.String({description:Var})},{additionalProperties:!1}),yIs=rr.Object({pull_number:vs(rr.Integer({description:Qar})),body:vs(rr.String({description:Uar})),event:vs(rr.Union([rr.Literal("COMMENT"),rr.Literal("APPROVE"),rr.Literal("REQUEST_CHANGES")],{description:Gar})),comments:rr.Array(AIs,{description:"Array of inline comments anchored to diff lines. May be empty when body is non-empty. Each comment requires path, line, and body."})},{additionalProperties:!1});function Uxt(t){return{name:"create_pull_request_review",label:"Create Pull Request Review",description:Far(t.type),promptSnippet:Oar,promptGuidelines:Lar,parameters:yIs,constrainedSampling:hf,execute:ff({cancellationMessage:$fr,cancellationDetails:{reviewId:0,reviewUrl:"",pullRequestNumber:0,event:"COMMENT",commentCount:0},prepareParams:e=>{let n={comments:e.comments.map(r=>({path:r.path,line:r.line,body:r.body,...wo(r.side)?{side:r.side}:{},...wo(r.start_line)?{start_line:r.start_line}:{},...wo(r.start_side)?{start_side:r.start_side}:{}}))};return wo(e.pull_number)&&(n.pull_number=e.pull_number),wo(e.body)&&(n.body=e.body),wo(e.event)&&(n.event=e.event),n},execute:e=>t.createReview(e)})}}p();Mb();var EIs=rr.Object({owner:vs(rr.String({description:JPe})),repo:vs(rr.String({description:XPe})),pull_number:vs(rr.Integer({description:Jar})),ref:vs(rr.String({description:Xar})),status:vs(rr.String({description:Zar})),conclusion:vs(rr.String({description:ecr}))},{additionalProperties:!1});function Gxt(t){return{name:"get_ci_status",label:"Get CI Status",description:Kar,promptSnippet:Yar,promptGuidelines:zar(t.type),parameters:EIs,constrainedSampling:hf,execute:ff({cancellationMessage:Wfr,cancellationDetails:{ref:"",check_runs:[],workflow_runs:[]},prepareParams:e=>({...wo(e.owner)?{owner:e.owner}:{},...wo(e.repo)?{repo:e.repo}:{},...wo(e.pull_number)?{pull_number:e.pull_number}:{},...wo(e.ref)?{ref:e.ref}:{},...wo(e.status)?{status:e.status}:{},...wo(e.conclusion)?{conclusion:e.conclusion}:{}}),execute:async e=>t.getCIStatus(e)})}}p();Mb();var bIs=rr.Object({owner:vs(rr.String({description:JPe})),repo:vs(rr.String({description:XPe})),run_id:rr.Integer({description:icr}),max_bytes:vs(rr.Integer({description:scr}))},{additionalProperties:!1});function $xt(t){return{name:"get_workflow_run_logs",label:"Get Workflow Run Logs",description:rcr(t.type),promptSnippet:tcr,promptGuidelines:ncr,parameters:bIs,constrainedSampling:hf,execute:ff({cancellationMessage:Hfr,cancellationDetails:{run_id:0,jobs:[],total_bytes:0,truncated:!1},prepareParams:e=>({...wo(e.owner)?{owner:e.owner}:{},...wo(e.repo)?{repo:e.repo}:{},run_id:e.run_id,...wo(e.max_bytes)?{max_bytes:e.max_bytes}:{}}),execute:async e=>t.getWorkflowRunLogs(e)})}}p();Mb();var _Is=1024,xIs=300,SIs=rr.Object({text:rr.String({description:lcr}),focus:vs(rr.String({description:ucr})),max_words:vs(rr.Integer({description:dcr}))},{additionalProperties:!1});function CIs(t,e){let n=["You are a summarization assistant. Summarize the user-provided text factually and completely, preserving concrete details (error messages, names, numbers, paths) that matter for debugging or review."];return t&&n.push(`Focus the summary on: ${t}`),n.push(`Keep the summary under ${e} words. Respond with the summary text only.`),n.join(" ")}function IIs(t){return t.content.filter(e=>e.type==="text").map(e=>e.text??"").join("").trim()}function Wxt(){return{name:"summarize_text",label:"Summarize Text",description:ccr,promptSnippet:ocr,promptGuidelines:acr,parameters:SIs,constrainedSampling:hf,execute:async(t,e,n,r,i)=>{let s=i.model,o={summary:"",model:s?.id??"",input_chars:e.text.length};if(n?.aborted)return{content:[{type:"text",text:qfr}],details:{...o,cancelled:!0}};if(!s)return{content:[{type:"text",text:"No model available for the summarization sub-call"}],details:{...o,error:"no model available"}};let a=wo(e.max_words)?e.max_words:xIs,c=wo(e.focus)?e.focus:void 0;try{let u=await i.modelRegistry.complete(s,{systemPrompt:CIs(c,a),messages:[{role:"user",content:e.text,timestamp:Date.now()}]},{maxTokens:_Is,...n?{signal:n}:{}});if(u.stopReason==="error"){let d=u.errorMessage??"unknown sub-call error";return{content:[{type:"text",text:`Summarization failed: ${d}`}],details:{...o,error:d}}}let l=IIs(u);return l?{content:[{type:"text",text:l}],details:{...o,summary:l}}:{content:[{type:"text",text:"Summarization returned no text content"}],details:{...o,error:"empty summary"}}}catch(u){let l=u instanceof Error?u.message:String(u);return{content:[{type:"text",text:`Summarization failed: ${l}`}],details:{...o,error:l}}}}}}function Hxt(t,e){return n=>{[Pxt(t),Qxt(t),Oxt(t),Fxt(t,e),Uxt(t),Gxt(t),$xt(t),Wxt()].forEach(i=>{n.registerTool(i)})}}function TIs(t,e){let n=new Set(e.map(r=>r.path));t.loaded=[...new Set(t.loaded.filter(r=>n.has(r)))]}async function egr(t,e){let n=[],r={requested:t??[],loaded:[],warnings:[]};if(!t?.length)return{paths:n,info:r};let i=lu.inMemory(),s=e??process.cwd(),a=await new rf({cwd:s,agentDir:ii(),settingsManager:i}).resolveExtensionSources(t,{local:!0,temporary:!0});for(let c of a.extensions)c.enabled&&(r.loaded.push(c.path),n.push(c.path));return a.extensions.length===0&&t.length>0&&r.warnings.push(`No extensions resolved from: ${t.join(", ")}`),{paths:n,info:r}}async function tgr(t,e,n){let r=n?.extensions,i=n?.loadBuiltinExtensions??!0,{paths:s,info:o}=await egr(r,n?.cwd),a=[w_t(t,o)];return i&&a.unshift(Hxt(e,n)),{extensionFactories:a,additionalExtensionPaths:s,extensionsOverride:c=>(TIs(o,c.extensions),c),systemPromptOverride:()=>n?.systemPrompt??KPe(e.type),appendSystemPromptOverride:c=>c.length===0?[]:c,noThemes:!0}}var ngr=15e3,K9=class{model;modelRuntime;session;thinkingLevel;outputChunks=[];logger;platformProvider;config;events;lastAgentError;sessionEventHandler;constructor(e,n,r,i){this.logger=e,this.platformProvider=n,this.config=r,this.events=i??{},this.thinkingLevel=r.thinkingLevel??"off"}async ready(){let e=this.config,n=await tgr(this.logger,this.platformProvider,e),r=this.config.cwd??process.cwd(),i=lu.create(r);if(this.modelRuntime=await nf.create(),this.config.token&&(this.logger.debug(`[auth] Setting api_key token for ${this.config.provider} provider`),await this.applyRuntimeApiKey(this.config.token)),this.config.baseUrl&&(this.logger.debug(`[provider] Overriding base URL for ${this.config.provider}: ${this.config.baseUrl}`),this.modelRuntime.registerProvider(this.config.provider,{baseUrl:this.config.baseUrl})),this.config.refreshModelCatalog===!1)this.logger.debug("[models] Skipping model catalog refresh (refresh_model_catalog=false)");else{let{errors:f}=await this.modelRuntime.refresh({providers:[this.config.provider],signal:AbortSignal.timeout(ngr)}),g=f.get(this.config.provider);g&&this.logger.warning(`[models] Could not refresh the model catalog: ${g.message}`)}let s=await VU({cwd:r,modelRuntime:this.modelRuntime,settingsManager:i,resourceLoaderOptions:n});for(let f of s.diagnostics)f.type==="error"?this.logger.error(`[services] ${f.message}`):f.type==="warning"&&this.logger.warning(`[services] ${f.message}`);let o=s.resourceLoader.getExtensions().errors;for(let f of o)this.logger.error(`[extension] ${f.path}: ${f.error}`);let a=this.modelRuntime.getModel(this.config.provider,this.config.model);if(a)this.model=a;else throw new Error(`Model not found: ${this.config.provider}/${this.config.model}. Please check that the \`provider\` and \`model\` inputs are correct and that the provider is supported. See https://github.com/shaftoe/pi-coding-agent-action#usage for details.`);let c=this.thinkingLevel,u=Wl(this.model,c);if(u!==c){let f=gB(this.model);this.logger.warning(`[thinking] Requested level "${c}" is not supported by ${this.model.provider}/${this.model.id}; clamping to "${u}" (supported: ${f.join(", ")})`),this.thinkingLevel=u,this.config.thinkingLevel=u}let l=this.config.loadedTools,m=this.config.exportSessionHtml||this.config.exportSessionJsonl||this.config.shareSession?Js.create(s.cwd):Js.inMemory(s.cwd),{session:h}=await YU({services:s,sessionManager:m,model:this.model,thinkingLevel:this.thinkingLevel,...l?{tools:l}:{}});if(this.session=h,this.config.autoCompaction&&(h.setAutoCompactionEnabled(!0),this.logger.info("[auto-compaction] enabled")),this.config.cacheWarming&&(h.setCacheWarmingMode(this.config.cacheWarming),this.logger.info(`[cache-warming] mode set to "${this.config.cacheWarming}"`)),l){let f=h.getAllTools().map(E=>E.name),g=new Set(f),A=l.filter(E=>!g.has(E));if(A.length>0){let E=`loaded_tools: unknown tool name(s): ${A.join(", ")}. Available tools: ${f.sort().join(", ")}`;throw this.logger.info(`[loaded_tools] \u274C ${E}`),new Error(E)}let y=f.filter(E=>!l.includes(E));y.length>0&&this.logger.info(`[loaded_tools] Keeping ${l.length} tool(s): ${l.join(", ")} +[loaded_tools] Removing ${y.length} tool(s): ${y.sort().join(", ")}`)}return this.sessionEventHandler=f=>{if(f.type.includes("retry")){this.handleRetryEvent(f);return}switch(f.type){case"message_update":this.handleMessageUpdate(f.assistantMessageEvent);break;case"agent_end":this.handleAgentEnd(f.messages);break;case"agent_settled":this.events.onPromptComplete?.();break;default:break}},this.session.subscribe(this.sessionEventHandler),this}async applyRuntimeApiKey(e){try{await this.modelRuntime.setRuntimeApiKey(this.config.provider,e)}catch(n){if(!(n instanceof SS))throw n;let r=n.providerId;this.logger.warning(`[auth] API key for "${r}" was saved, but the model state could not be synchronized \u2014 attempting a catalog refresh to recover`);let i=typeof AbortSignal.timeout=="function"?AbortSignal.timeout(ngr):void 0,{aborted:s,errors:o}=await this.modelRuntime.refresh({providers:[r],allowNetwork:!0,force:!0,...i?{signal:i}:void 0}),a=o.get(r);if(s||a)throw new Error(`Could not synchronize model state for provider "${r}" after setting its API key. The key was saved, but the model catalog could not be refreshed (${a?a.message:"refresh aborted"}). Check that the \`provider\`, \`model\`, and \`base_url\` inputs are valid for this provider.`,{cause:n})}}async run(e){if(!e)throw new Error("no text, skipping prompt");this.lastAgentError=void 0,await this.session.prompt(e);let n=this.outputChunks.join(""),r=this.collectSessionStats(),i=this.lastAgentError;return{result:n,sessionStats:r,error:i}}getSessionStats(){return this.collectSessionStats()}async exportSessionHtml(e){return this.session.exportToHtml(e)}async exportSessionJsonl(e){return this.session.exportToJsonl(e)}dispose(){this.session?.dispose()}handleMessageUpdate(e){switch(e.type){case"text_delta":this.outputChunks.push(e.delta);break;case"thinking_delta":this.events.onThinkingDelta?.(e.delta);break;case"thinking_end":this.events.onThinkingComplete?.();break;default:break}}handleAgentEnd(e){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r&&r.role==="assistant"){let i=r;this.lastAgentError=i.stopReason==="error"?i.errorMessage:void 0;break}}}handleRetryEvent(e){switch(e.type){case"auto_retry_start":this.handleAutoRetryStart(e);break;case"auto_retry_end":this.handleAutoRetryEnd(e);break;case"summarization_retry_scheduled":this.handleSummarizationRetryScheduled(e);break;case"summarization_retry_attempt_start":this.handleSummarizationRetryAttemptStart(e);break;case"summarization_retry_finished":this.handleSummarizationRetryFinished();break;default:break}}handleAutoRetryStart(e){this.logger.info(`[auto-retry] \u{1F504} provider call retrying \u2014 attempt ${e.attempt}/${e.maxAttempts} after ${e.delayMs}ms (last error: ${e.errorMessage})`)}handleAutoRetryEnd(e){if(e.success)this.logger.info(`[auto-retry] \u2705 recovered on attempt ${e.attempt}`);else{let n=e.finalError?`: ${e.finalError}`:"";this.logger.warning(`[auto-retry] \u274C exhausted after attempt ${e.attempt}${n}`)}}handleSummarizationRetryScheduled(e){this.logger.info(`[summarization-retry] \u{1F504} summary generation retrying \u2014 attempt ${e.attempt}/${e.maxAttempts} after ${e.delayMs}ms (last error: ${e.errorMessage})`)}handleSummarizationRetryAttemptStart(e){let n=e.source==="compaction"?`compaction (${e.reason})`:"branchSummary";this.logger.debug(`[summarization-retry] \u25B6\uFE0F starting ${n} summary attempt`)}handleSummarizationRetryFinished(){this.logger.info("[summarization-retry] \u2022 summary retry loop finished")}collectSessionStats(){if(this.session)try{let e=this.session.getSessionStats();return{inputTokens:e.tokens.input,outputTokens:e.tokens.output,totalTokens:e.tokens.total,cost:e.cost,version:ire()}}catch{this.logger.notice("Failed to get session stats, continuing without stats");return}}};function aOe(t){return{async run(e){return await t.ready(),t.run(e)},getSessionStats(){return t.getSessionStats()},async exportSessionHtml(e){return t.exportSessionHtml(e)},async exportSessionJsonl(e){return t.exportSessionJsonl(e)},dispose(){t.dispose()}}}p();p();p();var KIs=Ot(Jxt(),1);p();var dOe=class{debug(e){bz(e)}info(e){lNt(e)}warning(e){V$(e)}notice(e){cNt(e)}error(e){DQe(e)}startGroup(e){uNt(e)}endGroup(){dNt()}getInput(e){return Za(e)}setFailed(e){j$(e)}setOutput(e,n){Wde(e,n)}};p();p();p();p();var Zxt="eyes",Z9=255,mgr="pi/issue",pOe="pi-fork",hgr=[".github/workflows/pi.yml"],fgr="/pi ",eSt=100,tSt=50;p();function Qk(t){return t==null?"":t.replace(//g,"").replace(/[\u200B-\u200F\u2028-\u202F\u2060-\u206F\uFEFF]/g,"").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,"")}p();function hOe(t){if(!(typeof t!="object"||t===null||Array.isArray(t)))return t}function DG(t){if(!(typeof t!="string"||t.trim()===""))return t.trim()}function mOe(t){if(!(typeof t!="number"||!Number.isSafeInteger(t)||t<=0))return t}function ZIs(t){let e=hOe(t.repository);if(!e)return{};let n=DG(e.full_name);if(n){let o=n.split("/");if(o.length===2){let a=DG(o[0]),c=DG(o[1]);if(a&&c)return{owner:a,repo:c}}}let r=hOe(e.owner),i=DG(r?.login),s=DG(e.name);return{...i?{owner:i}:{},...s?{repo:s}:{}}}function ews(t){let e=hOe(t.pull_request),n=hOe(t.issue);return mOe(e?.number)??mOe(n?.number)??mOe(t.number)}function ggr(t){let e=ZIs(t.payload),n=DG(t.repo.owner)??e.owner??"",r=DG(t.repo.repo)??e.repo??"",i=mOe(t.issue.number)??ews(t.payload)??0;return n===t.repo.owner&&r===t.repo.repo&&i===t.issue.number?t:{...t,repo:{owner:n,repo:r},issue:{number:i}}}function nle(t){let{eventName:e,payload:n}=t.context;return e==="pull_request"||n.pull_request!==void 0}function rle(t){if(nle(t))return"pull_request";if(t.context.eventName==="issue_comment"||t.context.eventName==="issues")return"issue"}function Agr(t){return t.trigger??fgr}var tws={issue_comment:t=>t.comment?.created_at,pull_request_review_comment:t=>t.comment?.created_at,pull_request_review:t=>t.review?.submitted_at,issues:t=>t.issue?.updated_at,pull_request:t=>t.pull_request?.updated_at};function ile(t){let{eventName:e,payload:n}=t.context,r=tws[e];if(!r){t.logger.debug(`[getStartTimeFromContext] No timestamp source for event type: ${e}`);return}let i=r(n);if(i)return pE.Instant.from(i)}var nws={issue:t=>{let e=t.issue;if(!(!e?.title||e.number===void 0))return{title:e.title,number:e.number,...e.body!==null&&e.body!==void 0?{body:Qk(e.body)}:{}}},pull_request:t=>{let e=t.pull_request;if(!(!e?.title||e.number===void 0))return{title:e.title,number:e.number,...e.body!==null&&e.body!==void 0?{body:Qk(e.body)}:{}}}};function ygr(t){let e=rle(t);if(!e)return;let n=nws[e];if(n)return n(t.context.payload)}async function nSt(t,e,n){let r=ygr(t);if(!r&&t.context.issue?.number&&(r=await rws(t,t.context.issue.number)),r){let{title:i,body:s,number:o}=r,a=[`Issue/PR #${o}: ${i}`];return s&&a.push(` Description: -${i}`),a.push(` +${s}`),a.push(` ${n}: -${e}`),a.join("")}return e}async function jjs(t,e){try{let{owner:n,repo:r}=t.context.repo,i=(await t.octokit.rest.issues.get({owner:n,repo:r,issue_number:e})).data;return{title:i.title,number:i.number,...i.body!==void 0&&i.body!==null?{body:i.body}:{}}}catch(n){let r=n instanceof Error?n.message:String(n);t.logger.debug(`[fetchIssueContextFromAPI] Failed to fetch issue/PR #${e}: ${r}`);return}}async function yre(t,e){if(e){let s=e.trim();if(!s){t.logger.notice("prompt input is empty, skipping");return}return ult(t,s,"Instruction")}let n=await Yjs(t);if(!n){if(t.context.eventName==="workflow_dispatch"&&t.context.issue?.number){let i="Review this pull request and provide feedback";return t.logger.info(`[getPrompt] No comment found; using default instruction for PR #${t.context.issue.number}`),ult(t,i,"Instruction")}t.logger.notice("no comment found in context, skipping");return}let r=n.body;if(!r){t.logger.notice("no prompt found in comment, skipping");return}return ult(t,r,"Comment/Instruction")}async function Yjs(t){let{payload:e}=t.context,n=e.comment,r=e.review;if(!n&&r){if(!r.body||r.id===void 0)return;let i=rv(r.body.replace(v3n(t),"").trim());return{id:r.id,body:i}}if(n?.id===void 0)return;let s=rv((n.body??"").replace(v3n(t),"").trim());return{id:n.id,body:s}}p();function k3n(t){return t.context.payload.comment?.pull_request_review_id!==void 0}async function Ere(t){let e=t.context.payload.comment;if(e?.id===void 0){t.logger.debug("[reactions] no comment found, skipping reaction");return}let n=t.octokit,r=k3n(t),{owner:s,repo:i}=t.context.repo;return r?(t.logger.debug("[reactions] adding reaction to PR review comment"),await n.rest.reactions.createForPullRequestReviewComment({owner:s,repo:i,comment_id:e.id,content:olt})):(t.logger.debug("[reactions] adding reaction to issue comment"),await n.rest.reactions.createForIssueComment({owner:s,repo:i,comment_id:e.id,content:olt}))}async function bre(t,e){if(!e)return;let n=t.context.payload.comment;if(n?.id===void 0)return;let r=t.octokit,s=k3n(t),{owner:i,repo:o}=t.context.repo;return s?(t.logger.debug("[reactions] deleting reaction from PR review comment"),r.rest.reactions.deleteForPullRequestComment({owner:i,repo:o,comment_id:n.id,reaction_id:e.data.id})):(t.logger.debug("[reactions] deleting reaction from issue comment"),r.rest.reactions.deleteForIssueComment({owner:i,repo:o,comment_id:n.id,reaction_id:e.data.id}))}p();function Kjs(t){let e=t.context.serverUrl||"https://github.com",{owner:n,repo:r}=t.context.repo,s=t.context.runId;if(!n||!r||!s)return;let i=`${e}/${n}/${r}/actions/runs/${s}`;if(t.platformType==="forgejo"||t.platformType==="codeberg"){let a=t.context.runNumber;return a?`${e}/${n}/${r}/actions/runs/${a}`:i}return i}function zjs(t){if(!t.provider||!t.model)return;let e=`Model: ${t.provider}/${t.model}`;return t.thinkingLevel&&t.thinkingLevel!=="off"&&(e=`${e} (thinking: ${t.thinkingLevel})`),e}function Jjs(t){let e=t.sessionStats;if(!e)return[];let n=[];n.push(`Tokens: ${B3n(e.totalTokens)}`);let r=zJ(e.cost,2);return r&&n.push(`Cost: $${r}`),e.version&&n.push(`Pi SDK v${e.version}`),n}function Xjs(t,e){let n=Kjs(t);if(!n)return;let r=[`[View action run](${n})`];if(e){let s=zjs(e);s&&r.push(s),e.executionDuration!==void 0&&r.push(`Time: ${D3n(e.executionDuration)}`),r.push(...Jjs(e)),e.actionVersion&&r.push(`Action v${JJ(e.actionVersion)}`)}return r.join(" | ")}function N3n(t){return t.context.payload.comment?.pull_request_review_id!==void 0}async function Zjs(t,e){if(!e)return;let n=t.context.issue.number;if(!n){t.logger.debug("[comments] no issue/PR number in context, skipping comment creation");return}let r=t.octokit,{owner:s,repo:i}=t.context.repo;if(N3n(t)){let o=t.context.payload.comment;if(o?.id===void 0){t.logger.debug("[comments] no comment found for review reply");return}return t.logger.debug("[comments] creating reply to PR review comment"),r.rest.pulls.createReplyForReviewComment({owner:s,repo:i,pull_number:n,comment_id:o.id,body:e})}else return t.logger.debug("[comments] creating top-level issue/PR comment"),r.rest.issues.createComment({owner:s,repo:i,issue_number:n,body:e})}function D3n(t){let e=t.round({largestUnit:"hour",smallestUnit:"second"}),n=[],r=e.hours,s=e.minutes,i=e.seconds;return r>0&&n.push(`${r}h`),s>0&&n.push(`${s}m`),(i>0||n.length===0)&&n.push(`${i}s`),n.join(" ")}function B3n(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:String(t)}var P3n="",O3n=5,Zve=100,M3n="";function L3n(t){let e=t.body;return!e||t.user?.type!=="Bot"?!1:e.startsWith(P3n)||e.startsWith(M3n)}async function eYs(t,e,n,r){let s=[],i=1;for(;i<=O3n;){let o=await t.octokit.rest.issues.listComments({owner:e,repo:n,issue_number:r,per_page:Zve,page:i});if(s.push(...o.data),o.data.lengthL3n(a));if(i.length===0)return;let o=i.reduce((a,c)=>c.id>a.id?c:a,i[0]);return{id:o.id,body:o.body??""}}async function Q3n(t,e,n){if(!n)return;let{owner:r,repo:s}=t.context.repo;return t.octokit.rest.issues.updateComment({owner:r,repo:s,comment_id:e,body:n})}async function U3n(t){let e=t.context.issue.number;if(!e)return;let n=t.context.payload.comment?.id;if(n===void 0)return;let{owner:r,repo:s}=t.context.repo,o=(await tYs(t,r,s,e)).find(a=>a.in_reply_to_id===n&&L3n(a));if(o)return{id:o.id,body:o.body??""}}async function $3n(t,e,n){if(!n)return;let{owner:r,repo:s}=t.context.repo;return t.octokit.rest.pulls.updateReviewComment({owner:r,repo:s,comment_id:e,body:n})}async function _re(t,e,n){if(!e)return;let r=Xjs(t,n),s=r?`${e} +${e}`),a.join("")}return e}async function rws(t,e){try{let{owner:n,repo:r}=t.context.repo,s=(await t.octokit.rest.issues.get({owner:n,repo:r,issue_number:e})).data;return{title:s.title,number:s.number,...s.body!==void 0&&s.body!==null?{body:s.body}:{}}}catch(n){let r=n instanceof Error?n.message:String(n);t.logger.debug(`[fetchIssueContextFromAPI] Failed to fetch issue/PR #${e}: ${r}`);return}}async function sle(t,e){if(e){let i=e.trim();if(!i){t.logger.notice("prompt input is empty, skipping");return}return nSt(t,i,"Instruction")}let n=await iws(t);if(!n){if(t.context.eventName==="workflow_dispatch"&&t.context.issue?.number){let s="Review this pull request and provide feedback";return t.logger.info(`[getPrompt] No comment found; using default instruction for PR #${t.context.issue.number}`),nSt(t,s,"Instruction")}t.logger.notice("no comment found in context, skipping");return}let r=n.body;if(!r){t.logger.notice("no prompt found in comment, skipping");return}return nSt(t,r,"Comment/Instruction")}async function iws(t){let{payload:e}=t.context,n=e.comment,r=e.review;if(!n&&r){if(!r.body||r.id===void 0)return;let s=Qk(r.body.replace(Agr(t),"").trim());return{id:r.id,body:s}}if(n?.id===void 0)return;let i=Qk((n.body??"").replace(Agr(t),"").trim());return{id:n.id,body:i}}p();function Egr(t){return t.context.payload.comment?.pull_request_review_id!==void 0}async function ole(t){let e=t.context.payload.comment;if(e?.id===void 0){t.logger.debug("[reactions] no comment found, skipping reaction");return}let n=t.octokit,r=Egr(t),{owner:i,repo:s}=t.context.repo;return r?(t.logger.debug("[reactions] adding reaction to PR review comment"),await n.rest.reactions.createForPullRequestReviewComment({owner:i,repo:s,comment_id:e.id,content:Zxt})):(t.logger.debug("[reactions] adding reaction to issue comment"),await n.rest.reactions.createForIssueComment({owner:i,repo:s,comment_id:e.id,content:Zxt}))}async function ale(t,e){if(!e)return;let n=t.context.payload.comment;if(n?.id===void 0)return;let r=t.octokit,i=Egr(t),{owner:s,repo:o}=t.context.repo;return i?(t.logger.debug("[reactions] deleting reaction from PR review comment"),r.rest.reactions.deleteForPullRequestComment({owner:s,repo:o,comment_id:n.id,reaction_id:e.data.id})):(t.logger.debug("[reactions] deleting reaction from issue comment"),r.rest.reactions.deleteForIssueComment({owner:s,repo:o,comment_id:n.id,reaction_id:e.data.id}))}p();function sws(t){let e=t.context.serverUrl||"https://github.com",{owner:n,repo:r}=t.context.repo,i=t.context.runId;if(!n||!r||!i)return;let s=`${e}/${n}/${r}/actions/runs/${i}`;if(t.platformType==="forgejo"||t.platformType==="codeberg"){let a=t.context.runNumber;return a?`${e}/${n}/${r}/actions/runs/${a}`:s}return s}function ows(t){if(!t.provider||!t.model)return;let e=`Model: ${t.provider}/${t.model}`;return t.thinkingLevel&&t.thinkingLevel!=="off"&&(e=`${e} (thinking: ${t.thinkingLevel})`),e}function aws(t){let e=t.sessionStats;if(!e)return[];let n=[];n.push(`Tokens: ${xgr(e.totalTokens)}`);let r=nre(e.cost,2);return r&&n.push(`Cost: $${r}`),e.version&&n.push(`Pi SDK v${e.version}`),n}function cws(t,e){let n=sws(t);if(!n)return;let r=[`[View action run](${n})`];if(e){let i=ows(e);i&&r.push(i),e.executionDuration!==void 0&&r.push(`Time: ${_gr(e.executionDuration)}`),r.push(...aws(e)),e.actionVersion&&r.push(`Action v${rre(e.actionVersion)}`)}return r.join(" | ")}function bgr(t){return t.context.payload.comment?.pull_request_review_id!==void 0}async function lws(t,e){if(!e)return;let n=t.context.issue.number;if(!n){t.logger.debug("[comments] no issue/PR number in context, skipping comment creation");return}let r=t.octokit,{owner:i,repo:s}=t.context.repo;if(bgr(t)){let o=t.context.payload.comment;if(o?.id===void 0){t.logger.debug("[comments] no comment found for review reply");return}return t.logger.debug("[comments] creating reply to PR review comment"),r.rest.pulls.createReplyForReviewComment({owner:i,repo:s,pull_number:n,comment_id:o.id,body:e})}else return t.logger.debug("[comments] creating top-level issue/PR comment"),r.rest.issues.createComment({owner:i,repo:s,issue_number:n,body:e})}function _gr(t){let e=t.round({largestUnit:"hour",smallestUnit:"second"}),n=[],r=e.hours,i=e.minutes,s=e.seconds;return r>0&&n.push(`${r}h`),i>0&&n.push(`${i}m`),(s>0||n.length===0)&&n.push(`${s}s`),n.join(" ")}function xgr(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:String(t)}var Sgr="",Cgr=5,fOe=100,Igr="";function wgr(t){let e=t.body;return!e||t.user?.type!=="Bot"?!1:e.startsWith(Sgr)||e.startsWith(Igr)}async function uws(t,e,n,r){let i=[],s=1;for(;s<=Cgr;){let o=await t.octokit.rest.issues.listComments({owner:e,repo:n,issue_number:r,per_page:fOe,page:s});if(i.push(...o.data),o.data.lengthwgr(a));if(s.length===0)return;let o=s.reduce((a,c)=>c.id>a.id?c:a,s[0]);return{id:o.id,body:o.body??""}}async function vgr(t,e,n){if(!n)return;let{owner:r,repo:i}=t.context.repo;return t.octokit.rest.issues.updateComment({owner:r,repo:i,comment_id:e,body:n})}async function Rgr(t){let e=t.context.issue.number;if(!e)return;let n=t.context.payload.comment?.id;if(n===void 0)return;let{owner:r,repo:i}=t.context.repo,o=(await dws(t,r,i,e)).find(a=>a.in_reply_to_id===n&&wgr(a));if(o)return{id:o.id,body:o.body??""}}async function kgr(t,e,n){if(!n)return;let{owner:r,repo:i}=t.context.repo;return t.octokit.rest.pulls.updateReviewComment({owner:r,repo:i,comment_id:e,body:n})}async function cle(t,e,n){if(!e)return;let r=cws(t,n),i=r?`${e} --- -${r}`:e,i=N3n(t),o=i?M3n:P3n;if(t.updateComment)if(i){let c=await U3n(t);if(c){t.logger.debug(`[comments] updating previous bot review comment ${c.id}`);let u=`${o} -${s}`;try{await $3n(t,c.id,u);return}catch(l){t.logger.warning(`[comments] failed to update bot review comment ${c.id}, falling back to create: ${l instanceof Error?l.message:String(l)}`)}}}else{let c=await F3n(t);if(c){t.logger.debug(`[comments] updating previous bot comment ${c.id}`);let u=`${o} -${s}`;try{await Q3n(t,c.id,u);return}catch(l){t.logger.warning(`[comments] failed to update bot comment ${c.id}, falling back to create: ${l instanceof Error?l.message:String(l)}`)}}}let a=`${o} -${s}`;return Zjs(t,a)}p();p();p();function V0(t,e="\u{1F500}"){return{debug:n=>t.logger.debug(`${e} ${n}`),info:n=>t.logger.info(`${e} ${n}`),warning:n=>t.logger.warning(`${e} ${n}`),notice:n=>t.logger.notice(`${e} ${n}`),error:n=>t.logger.error(`${e} ${n}`)}}p();p();var uRe=Gt(W3n(),1);p();var dlt=new WeakMap;function rj(...t){let e=new String(t);return dlt.set(e,t),e}function Sb(t){return t instanceof String&&dlt.has(t)}function sj(t){return dlt.get(t)??[]}var cRe=Gt(e$(),1),E5n=require("child_process");var r4n=Gt(hlt(),1),m4n=require("node:path");p();function*q3n(t,e){let n=e==="global";for(let r of t)r.isGlobal===n&&(yield r)}var cYs=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),lYs=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),uYs=new Set(["edit","remove-section","rename-section","set","unset"]),dYs=new Set(["get","get-color","get-colorbool","list"]);function pYs(t,e){for(let{name:r}of q3n(t,"task")){if(cYs.has(r))return ij(!0,e);if(lYs.has(r))return ij(!1,e)}let n=e.at(0)?.toLowerCase();return n===void 0?null:uYs.has(n)?ij(!0,e.slice(1)):dYs.has(n)?ij(!1,e.slice(1)):e.length===1?ij(!1,e):ij(!0,e)}function ij(t=!1,e=[]){let n=e.at(0)?.toLowerCase();return n===void 0?null:{isWrite:t,isRead:!t,key:n,value:e.at(1)}}function hYs(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}function mYs(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}function fYs(t){for(let{name:e}of q3n(t,"task"))switch(e){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function gYs({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}function*AYs(t){for(let e of t){let n=gYs(e),r=n&&mYs(e.value);r&&(yield{...r,scope:n})}}function yYs(t,e,n){let r={read:[],write:[...AYs(e)]};return t==="config"&&EYs(r,fYs(e),pYs(e,n)),r}function EYs(t,e,n){if(n===null)return;let r=hYs(e,n);n.isWrite?t.write.push(r):t.read.push(r)}var H3n={short:new Map([["c",!0]])},bYs={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...H3n.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},_Ys={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},SYs={short:new Map,long:new Set};function CYs(t){let e=_Ys[t??""]??SYs;return{short:new Map([...H3n.short.entries(),...e.short.entries()]),long:e.long}}function V3n(t,e=bYs){if(t.startsWith("--")){let n=t.indexOf("=");if(n>2)return[{name:t.slice(0,n),value:t.slice(n+1),needsNext:!1}];let r=t.slice(2);return[{name:t,needsNext:e.long.has(r)}]}if(t.length===2){let n=t.charAt(1),r=e.short.get(n);return[{name:t,needsNext:r===!0}]}return IYs(t,e.short)}function IYs(t,e){let n=t.slice(1).split(""),r=[];for(let s=0;se.has(c)))return r.push({name:`-${i}`,value:a,needsNext:!1}),r}r.push({name:`-${i}`,needsNext:o})}return r}function xYs(t,e=[]){let n=0;for(;nfunction(){return t&&(e=(0,t[Mlt(t)[0]])(t=0)),e},UYs=(t,e)=>function(){return e||(0,t[Mlt(t)[0]])((e={exports:{}}).exports,e),e.exports},td=(t,e)=>{for(var n in e)Olt(t,n,{get:e[n],enumerable:!0})},$Ys=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Mlt(e))!QYs.call(t,s)&&s!==n&&Olt(t,s,{get:()=>e[s],enumerable:!(r=FYs(e,s))||r.enumerable});return t},bu=t=>$Ys(Olt({},"__esModule",{value:!0}),t),sv,E1=Yn({"src/lib/errors/git-error.ts"(){"use strict";sv=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),wre,lj=Yn({"src/lib/errors/git-response-error.ts"(){"use strict";E1(),wre=class extends sv{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),vHn,RHn=Yn({"src/lib/errors/task-configuration-error.ts"(){"use strict";E1(),vHn=class extends sv{constructor(t){super(void 0,t)}}}});function kHn(t){return typeof t!="function"?hQ:t}function NHn(t){return typeof t=="function"&&t!==hQ}function DHn(t,e){let n=t.indexOf(e);return n<=0?[t,""]:[t.substr(0,n),t.substr(n+1)]}function BHn(t,e=0){return PHn(t)&&t.length>e?t[e]:void 0}function pQ(t,e=0){if(PHn(t)&&t.length>e)return t[t.length-1-e]}function PHn(t){return mRe(t)}function Tre(t="",e=!0,n=` -`){return t.split(n).reduce((r,s)=>{let i=e?s.trim():s;return i&&r.push(i),r},[])}function Llt(t,e){return Tre(t,!0).map(n=>e(n))}function Flt(t){return(0,uRe.exists)(t,uRe.FOLDER)}function xb(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function OHn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function dRe(t,e){if(Array.isArray(t)){let n=t.indexOf(e);n>=0&&t.splice(n,1)}else t.delete(e);return e}function jI(t){return Array.isArray(t)?t:[t]}function MHn(t){return t.replace(/[\s-]+(.)/g,(e,n)=>n.toUpperCase())}function uj(t){return jI(t).map(e=>e instanceof String?e:String(e))}function lc(t,e=0){if(t==null)return e;let n=parseInt(t,10);return Number.isNaN(n)?e:n}function Ire(t,e){let n=[];for(let r=0,s=t.length;r{t[r]!==void 0&&(n[r]=t[r])}),n}function blt(t=0){return new Promise(e=>setTimeout(e,t))}function _lt(t){if(t!==!1)return t}var aj,hQ,vre,pRe=Yn({"src/lib/utils/util.ts"(){"use strict";Qlt(),aj="\0",hQ=()=>{},vre=Object.prototype.toString.call.bind(Object.prototype.toString)}});function sm(t,e,n){return e(t)?t:arguments.length>2?n:void 0}function Slt(t,e){let n=Sb(t)?"string":typeof t;return/number|string|boolean/.test(n)&&(!e||!e.includes(n))}function hRe(t){return!!t&&vre(t)==="[object Object]"}function FHn(t){return typeof t=="function"}var Rre,QHn,nu,oRe,mRe,Qlt=Yn({"src/lib/utils/argument-filters.ts"(){"use strict";pRe(),Rre=t=>Array.isArray(t),QHn=t=>typeof t=="number",nu=t=>typeof t=="string"||Sb(t),oRe=t=>nu(t)||Array.isArray(t)&&t.every(nu),mRe=t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number"}}),Clt,GYs=Yn({"src/lib/utils/exit-codes.ts"(){"use strict";Clt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(Clt||{})}}),aRe,WYs=Yn({"src/lib/utils/git-output-streams.ts"(){"use strict";aRe=class UHn{constructor(e,n){this.stdOut=e,this.stdErr=n}asStrings(){return new UHn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function qYs(){throw new Error("LineParser:useMatches not implemented")}var li,y1,HYs=Yn({"src/lib/utils/line-parser.ts"(){"use strict";li=class{constructor(t,e){this.matches=[],this.useMatches=qYs,this.parse=(n,r)=>(this.resetMatches(),this._regExp.every((s,i)=>this.addMatch(s,i,n(i)))?this.useMatches(r,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,n){let r=n&&t.exec(n);return r&&this.pushMatch(e,r),!!r}pushMatch(t,e){this.matches.push(...e.slice(1))}},y1=class extends li{addMatch(t,e,n){return/^remote:\s/.test(String(n))&&super.addMatch(t,e,n)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function $Hn(...t){let e=process.cwd(),n=Object.assign({baseDir:e,...GHn},...t.filter(r=>typeof r=="object"&&r));return n.baseDir=n.baseDir||e,n.trimmed=n.trimmed===!0,n}var GHn,VYs=Yn({"src/lib/utils/simple-git-options.ts"(){"use strict";GHn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Ult(t,e=[]){return hRe(t)?Object.keys(t).reduce((n,r)=>{let s=t[r];if(Sb(s))n.push(s);else if(Slt(s,["boolean"]))n.push(r+"="+s);else if(Array.isArray(s))for(let i of s)Slt(i,["string","number"])||n.push(r+"="+i);else n.push(r);return n},e):e}function hf(t,e=0,n=!1){let r=[];for(let s=0,i=e<0?t.length:e;s{for(let i=Tre(s,r),o=0,a=i.length;o{if(!(o+u>=a))return i[o+u]};e.some(({parse:u})=>u(c,t))}}),t}var KYs=Yn({"src/lib/utils/task-parser.ts"(){"use strict";pRe()}}),WHn={};td(WHn,{ExitCodes:()=>Clt,GitOutputStreams:()=>aRe,LineParser:()=>li,NOOP:()=>hQ,NULL:()=>aj,RemoteLineParser:()=>y1,append:()=>xb,appendTaskOptions:()=>Ult,asArray:()=>jI,asCamelCase:()=>MHn,asFunction:()=>kHn,asNumber:()=>lc,asStringArray:()=>uj,bufferToString:()=>xre,callTaskParser:()=>Ilt,createInstanceConfig:()=>$Hn,delay:()=>blt,filterArray:()=>Rre,filterFunction:()=>FHn,filterHasLength:()=>mRe,filterNumber:()=>QHn,filterPlainObject:()=>hRe,filterPrimitives:()=>Slt,filterString:()=>nu,filterStringOrStringArray:()=>oRe,filterType:()=>sm,first:()=>BHn,folderExists:()=>Flt,forEachLineWithContent:()=>Llt,getTrailingOptions:()=>hf,including:()=>OHn,isUserFunction:()=>NHn,last:()=>pQ,objectToString:()=>vre,orVoid:()=>_lt,parseStringResponse:()=>wg,pick:()=>LHn,prefixedArray:()=>Ire,remove:()=>dRe,splitOn:()=>DHn,toLinesWithContent:()=>Tre,trailingFunctionArgument:()=>zc,trailingOptionsArgument:()=>$lt});var Vs=Yn({"src/lib/utils/index.ts"(){"use strict";Qlt(),GYs(),WYs(),HYs(),VYs(),YYs(),KYs(),pRe()}}),qHn={};td(qHn,{CheckRepoActions:()=>xlt,checkIsBareRepoTask:()=>VHn,checkIsRepoRootTask:()=>HHn,checkIsRepoTask:()=>zYs});function zYs(t){switch(t){case"bare":return VHn();case"root":return HHn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:fRe,parser:Glt}}function HHn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:fRe,parser(e){return/^\.(git)?$/.test(e.trim())}}}function VHn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:fRe,parser:Glt}}function JYs(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var xlt,fRe,Glt,jHn=Yn({"src/lib/tasks/check-is-repo.ts"(){"use strict";Vs(),xlt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(xlt||{}),fRe=({exitCode:t},e,n,r)=>{if(t===128&&JYs(e))return n(Buffer.from("false"));r(e)},Glt=t=>t.trim()==="true"}});function XYs(t,e){let n=new YHn(t),r=t?zHn:KHn;return Tre(e).forEach(s=>{let i=s.replace(r,"");n.paths.push(i),(JHn.test(i)?n.folders:n.files).push(i)}),n}var YHn,KHn,zHn,JHn,ZYs=Yn({"src/lib/responses/CleanSummary.ts"(){"use strict";Vs(),YHn=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},KHn=/^[a-z]+\s*/i,zHn=/^[a-z]+\s+[a-z]+\s*/i,JHn=/\/$/}}),wlt={};td(wlt,{EMPTY_COMMANDS:()=>gRe,adhocExecTask:()=>XHn,configurationErrorTask:()=>xg,isBufferTask:()=>e5n,isEmptyTask:()=>t5n,straightThroughBufferTask:()=>ZHn,straightThroughStringTask:()=>mf});function XHn(t){return{commands:gRe,format:"empty",parser:t}}function xg(t){return{commands:gRe,format:"empty",parser(){throw typeof t=="string"?new vHn(t):t}}}function mf(t,e=!1){return{commands:t,format:"utf-8",parser(n){return e?String(n).trim():n}}}function ZHn(t){return{commands:t,format:"buffer",parser(e){return e}}}function e5n(t){return t.format==="buffer"}function t5n(t){return t.format==="empty"||!t.commands.length}var gRe,_u=Yn({"src/lib/tasks/task.ts"(){"use strict";RHn(),gRe=[]}}),n5n={};td(n5n,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Wlt,CONFIG_ERROR_MODE_REQUIRED:()=>qlt,CONFIG_ERROR_UNKNOWN_OPTION:()=>Hlt,CleanOptions:()=>nRe,cleanTask:()=>r5n,cleanWithOptionsTask:()=>e6s,isCleanOptionsArray:()=>t6s});function e6s(t,e){let{cleanMode:n,options:r,valid:s}=n6s(t);return n?s.options?(r.push(...e),r.some(i6s)?xg(Wlt):r5n(n,r)):xg(Hlt+JSON.stringify(t)):xg(qlt)}function r5n(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(r){return XYs(t==="n",r)}}}function t6s(t){return Array.isArray(t)&&t.every(e=>Vlt.has(e))}function n6s(t){let e,n=[],r={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(s=>{r6s(s)?(e=s,r.cleanMode=!0):r.options=r.options&&s6s(n[n.length]=`-${s}`)}),{cleanMode:e,options:n,valid:r}}function r6s(t){return t==="f"||t==="n"}function s6s(t){return/^-[a-z]$/i.test(t)&&Vlt.has(t.charAt(1))}function i6s(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}var Wlt,qlt,Hlt,nRe,Vlt,s5n=Yn({"src/lib/tasks/clean.ts"(){"use strict";ZYs(),Vs(),_u(),Wlt="Git clean interactive mode is not supported",qlt='Git clean mode parameter ("n" or "f") is required',Hlt="Git clean unknown option found in: ",nRe=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(nRe||{}),Vlt=new Set(["i",...uj(Object.values(nRe))])}});function o6s(t){let e=new o5n;for(let n of i5n(t))e.addValue(n.file,String(n.key),n.value);return e}function a6s(t,e){let n=null,r=[],s=new Map;for(let i of i5n(t,e))i.key===e&&(r.push(n=i.value),s.has(i.file)||s.set(i.file,[]),s.get(i.file).push(n));return{key:e,paths:Array.from(s.keys()),scopes:s,value:n,values:r}}function c6s(t){return t.replace(/^(file):/,"")}function*i5n(t,e=null){let n=t.split("\0");for(let r=0,s=n.length-1;rObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=pQ(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,n){let r=this.addFile(t);Object.hasOwn(r,e)?Array.isArray(r[e])?r[e].push(n):r[e]=[r[e],n]:r[e]=n,this._all=void 0}}}});function mlt(t,e){return typeof t=="string"&&Object.hasOwn(Tlt,t)?t:e}function u6s(t,e,n,r){let s=["config",`--${r}`];return n&&s.push("--add"),s.push(t,e),{commands:s,format:"utf-8",parser(i){return i}}}function d6s(t,e){let n=["config","--null","--show-origin","--get-all",t];return e&&n.splice(1,0,`--${e}`),{commands:n,format:"utf-8",parser(r){return a6s(r,t)}}}function p6s(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(n){return o6s(n)}}}function h6s(){return{addConfig(t,e,...n){return this._runTask(u6s(t,e,n[0]===!0,mlt(n[1],"local")),zc(arguments))},getConfig(t,e){return this._runTask(d6s(t,mlt(e,void 0)),zc(arguments))},listConfig(...t){return this._runTask(p6s(mlt(t[0],void 0)),zc(arguments))}}}var Tlt,a5n=Yn({"src/lib/tasks/config.ts"(){"use strict";l6s(),Vs(),Tlt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(Tlt||{})}});function m6s(t){return c5n.has(t)}var flt,c5n,l5n=Yn({"src/lib/tasks/diff-name-status.ts"(){"use strict";flt=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(flt||{}),c5n=new Set(Object.values(flt))}});function f6s(...t){return new d5n().param(...t)}function g6s(t){let e=new Set,n={};return Llt(t,r=>{let[s,i,o]=r.split(aj);e.add(s),(n[s]=n[s]||[]).push({line:lc(i),path:s,preview:o})}),{paths:e,results:n}}function A6s(){return{grep(t){let e=zc(arguments),n=hf(arguments);for(let s of u5n)if(n.includes(s))return this._runTask(xg(`git.grep: use of "${s}" is not supported.`),e);typeof t=="string"&&(t=f6s().param(t));let r=["grep","--null","-n","--full-name",...n,...t];return this._runTask({commands:r,format:"utf-8",parser(s){return g6s(s)}},e)}}}var u5n,Cre,J3n,d5n,p5n=Yn({"src/lib/tasks/grep.ts"(){"use strict";Vs(),_u(),u5n=["-h"],Cre=Symbol("grepQuery"),d5n=class{constructor(){this[J3n]=[]}*[(J3n=Cre,Symbol.iterator)](){for(let t of this[Cre])yield t}and(...t){return t.length&&this[Cre].push("--and","(",...Ire(t,"-e"),")"),this}param(...t){return this[Cre].push(...Ire(t,"-e")),this}}}}),h5n={};td(h5n,{ResetMode:()=>rRe,getResetMode:()=>E6s,resetTask:()=>y6s});function y6s(t,e){let n=["reset"];return m5n(t)&&n.push(`--${t}`),n.push(...e),mf(n)}function E6s(t){if(m5n(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function m5n(t){return typeof t=="string"&&f5n.includes(t)}var rRe,f5n,g5n=Yn({"src/lib/tasks/reset.ts"(){"use strict";Vs(),_u(),rRe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(rRe||{}),f5n=uj(Object.values(rRe))}});function b6s(){return(0,cRe.default)("simple-git")}function X3n(t,e,n){return!e||!String(e).replace(/\s*/,"")?n?(r,...s)=>{t(r,...s),n(r,...s)}:t:(r,...s)=>{t(`%s ${r}`,e,...s),n&&n(r,...s)}}function _6s(t,e,{namespace:n}){if(typeof t=="string")return t;let r=e&&e.namespace||"";return r.startsWith(n)?r.substr(n.length+1):r||n}function jlt(t,e,n,r=b6s()){let s=t&&`[${t}]`||"",i=[],o=typeof e=="string"?r.extend(e):e,a=_6s(sm(e,nu),o,r);return u(n);function c(l,d){return xb(i,jlt(t,a.replace(/^[^:]+/,l),d,r))}function u(l){let d=l&&`[${l}]`||"",h=o&&X3n(o,d)||hQ,m=X3n(r,`${s} ${d}`,h);return Object.assign(o?h:m,{label:t,sibling:c,info:m,step:u})}}var A5n=Yn({"src/lib/git-logger.ts"(){"use strict";Vs(),cRe.default.formatters.L=t=>String(mRe(t)?t.length:"-"),cRe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):vre(t)}}),y5n,S6s=Yn({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";E1(),A5n(),y5n=class vlt{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let n=vlt.getName(e.commands[0]),r=jlt(this.logLabel,n);return{task:e,logger:r,name:n}}push(e){let n=this.createProgress(e);return n.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,n),n}fatal(e){for(let[n,{logger:r}]of Array.from(this._queue.entries()))n===e.task?(r.info("Failed %o",e),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(n);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let n=this.withProgress(e);if(!n)throw new sv(void 0,"TasksPendingQueue: attempt called for an unknown task");return n.logger("Starting task"),n}static getName(e="empty"){return`task:${e}:${++vlt.counter}`}static{this.counter=0}}}});function dQ(t,e){return{method:BHn(t.commands)||"",commands:e}}function C6s(t,e){return n=>{e("[ERROR] child process exception %o",n),t.push(Buffer.from(String(n.stack),"ascii"))}}function Z3n(t,e,n,r){return s=>{n("%s received %L bytes",e,s),r("%B",s),t.push(s)}}var Rlt,I6s=Yn({"src/lib/runners/git-executor-chain.ts"(){"use strict";E1(),_u(),Vs(),S6s(),Rlt=class{constructor(t,e,n){this._executor=t,this._scheduler=e,this._plugins=n,this._chain=Promise.resolve(),this._queue=new y5n}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),n=()=>this._queue.complete(t);try{let{logger:r}=this._queue.attempt(t);return await(t5n(t)?this.attemptEmptyTask(t,r):this.attemptRemoteTask(t,r))}catch(r){throw this.onFatalException(t,r)}finally{n(),e()}}onFatalException(t,e){let n=e instanceof sv?Object.assign(e,{task:t}):new sv(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(t,e){let n=this._plugins.exec("spawn.binary","",dQ(t,t.commands)),r=this._plugins.exec("spawn.args",[...t.commands],{...dQ(t,t.commands),env:{...this.env}}),s=await this.gitResponse(t,n,r,this.outputHandler,e.step("SPAWN")),i=await this.handleTaskData(t,r,s,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),e5n(t)?Ilt(t.parser,i):Ilt(t.parser,i.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,n,r){let{exitCode:s,rejection:i,stdOut:o,stdErr:a}=n;return new Promise((c,u)=>{r("Preparing to handle process response exitCode=%d stdOut=",s);let{error:l}=this._plugins.exec("task.error",{error:i},{...dQ(t,e),...n});if(l&&t.onError)return r.info("exitCode=%s handling with custom error handler"),t.onError(n,l,d=>{r.info("custom error handler treated as success"),r("custom error returned a %s",vre(d)),c(new aRe(Array.isArray(d)?Buffer.concat(d):d,Buffer.concat(a)))},u);if(l)return r.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,i),u(l);r.info("retrieving task output complete"),c(new aRe(Buffer.concat(o),Buffer.concat(a)))})}async gitResponse(t,e,n,r,s){let i=s.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},dQ(t,t.commands));return new Promise(a=>{let c=[],u=[];s.info("%s %o",e,n),s("%O",o);let l=this._beforeSpawn(t,n);if(l)return a({stdOut:c,stdErr:u,exitCode:9901,rejection:l});this._plugins.exec("spawn.before",void 0,{...dQ(t,n),kill(h){l=h||l}});let d=(0,E5n.spawn)(e,n,o);d.stdout.on("data",Z3n(c,"stdOut",s,i.step("stdOut"))),d.stderr.on("data",Z3n(u,"stdErr",s,i.step("stdErr"))),d.on("error",C6s(u,s)),r&&(s("Passing child process stdOut/stdErr to custom outputHandler"),r(e,d.stdout,d.stderr,[...n])),this._plugins.exec("spawn.after",void 0,{...dQ(t,n),spawned:d,close(h,m){a({stdOut:c,stdErr:u,exitCode:h,rejection:l||m})},kill(h){d.killed||(l=h,d.kill("SIGINT"))}})})}_beforeSpawn(t,e){let n;return this._plugins.exec("spawn.before",void 0,{...dQ(t,e),kill(r){n=r||n}}),n}}}}),b5n={};td(b5n,{GitExecutor:()=>_5n});var _5n,x6s=Yn({"src/lib/runners/git-executor.ts"(){"use strict";I6s(),_5n=class{constructor(t,e,n){this.cwd=t,this._scheduler=e,this._plugins=n,this._chain=new Rlt(this,this._scheduler,this._plugins)}chain(){return new Rlt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function w6s(t,e,n=hQ){let r=i=>{n(null,i)},s=i=>{i?.task===t&&n(i instanceof wre?T6s(i):i,void 0)};e.then(r,s)}function T6s(t){let e=r=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${r} should be GitResponseError.git.${r}, this will no longer be available in version 3`),e=hQ};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(n,{}));function n(r,s){return s in t||(r[s]={enumerable:!1,configurable:!1,get(){return e(s),t.git[s]}}),r}}var v6s=Yn({"src/lib/task-callback.ts"(){"use strict";lj(),Vs()}});function eHn(t,e){return XHn(n=>{if(!Flt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||n).cwd=t})}var R6s=Yn({"src/lib/tasks/change-working-directory.ts"(){"use strict";Vs(),_u()}});function glt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=dRe(e,"-B")),mf(e)}function k6s(){return{checkout(){return this._runTask(glt(hf(arguments,1)),zc(arguments))},checkoutBranch(t,e){return this._runTask(glt(["-b",t,e,...hf(arguments)]),zc(arguments))},checkoutLocalBranch(t){return this._runTask(glt(["-b",t,...hf(arguments)]),zc(arguments))}}}var N6s=Yn({"src/lib/tasks/checkout.ts"(){"use strict";Vs(),_u()}});function D6s(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function B6s(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return wg(D6s(),[S5n],t)}})}}}var S5n,P6s=Yn({"src/lib/tasks/count-objects.ts"(){"use strict";Vs(),S5n=new li(/([a-z-]+): (\d+)$/,(t,[e,n])=>{let r=MHn(e);Object.hasOwn(t,r)&&(t[r]=lc(n))})}});function O6s(t){return wg({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},C5n,t)}var C5n,M6s=Yn({"src/lib/parsers/parse-commit.ts"(){"use strict";Vs(),C5n=[new li(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,n,r])=>{t.branch=e,t.commit=r,t.root=!!n}),new li(/\s*Author:\s(.+)/i,(t,[e])=>{let n=e.split("<"),r=n.pop();!r||!r.includes("@")||(t.author={email:r.substr(0,r.length-1),name:n.join("<").trim()})}),new li(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,n,r])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(n,10)||0,t.summary.deletions=parseInt(r,10)||0}),new li(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,n,r])=>{t.summary.changes=parseInt(e,10)||0;let s=parseInt(n,10)||0;r==="-"?t.summary.deletions=s:r==="+"&&(t.summary.insertions=s)})]}});function L6s(t,e,n){return{commands:["-c","core.abbrev=40","commit",...Ire(t,"-m"),...e,...n],format:"utf-8",parser:O6s}}function F6s(){return{commit(e,...n){let r=zc(arguments),s=t(e)||L6s(jI(e),jI(sm(n[0],oRe,[])),[...uj(sm(n[1],Rre,[])),...hf(arguments,0,!0)]);return this._runTask(s,r)}};function t(e){return!oRe(e)&&xg("git.commit: requires the commit message to be supplied as a string/string[]")}}var Q6s=Yn({"src/lib/tasks/commit.ts"(){"use strict";M6s(),Vs(),_u()}});function U6s(){return{firstCommit(){return this._runTask(mf(["rev-list","--max-parents=0","HEAD"],!0),zc(arguments))}}}var $6s=Yn({"src/lib/tasks/first-commit.ts"(){"use strict";Vs(),_u()}});function G6s(t,e){let n=["hash-object",t];return e&&n.push("-w"),mf(n,!0)}var W6s=Yn({"src/lib/tasks/hash-object.ts"(){"use strict";_u()}});function q6s(t,e,n){let r=String(n).trim(),s;if(s=I5n.exec(r))return new sRe(t,e,!1,s[1]);if(s=x5n.exec(r))return new sRe(t,e,!0,s[1]);let i="",o=r.split(" ");for(;o.length;)if(o.shift()==="in"){i=o.join(" ");break}return new sRe(t,e,/^re/i.test(r),i)}var sRe,I5n,x5n,H6s=Yn({"src/lib/responses/InitSummary.ts"(){"use strict";sRe=class{constructor(t,e,n,r){this.bare=t,this.path=e,this.existing=n,this.gitDir=r}},I5n=/^Init.+ repository in (.+)$/,x5n=/^Rein.+ in (.+)$/}});function V6s(t){return t.includes(Ylt)}function j6s(t=!1,e,n){let r=["init",...n];return t&&!V6s(r)&&r.splice(1,0,Ylt),{commands:r,format:"utf-8",parser(s){return q6s(r.includes("--bare"),e,s)}}}var Ylt,Y6s=Yn({"src/lib/tasks/init.ts"(){"use strict";H6s(),Ylt="--bare"}});function Klt(t){for(let e=0;ewg(new w5n,e,n,!1)}var Alt,tHn,nHn,rHn,v5n,R5n=Yn({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";kre(),z6s(),l5n(),Vs(),Alt=[new li(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,n,r=""])=>{t.files.push({file:e.trim(),changes:lc(n),insertions:r.replace(/[^+]/g,"").length,deletions:r.replace(/[^-]/g,"").length,binary:!1})}),new li(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,n,r])=>{t.files.push({file:e.trim(),before:lc(n),after:lc(r),binary:!0})}),new li(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,n])=>{let r=/(\d+) i/.exec(n),s=/(\d+) d/.exec(n);t.changed=lc(e),t.insertions=lc(r?.[1]),t.deletions=lc(s?.[1])})],tHn=[new li(/(\d+)\t(\d+)\t(.+)$/,(t,[e,n,r])=>{let s=lc(e),i=lc(n);t.changed++,t.insertions+=s,t.deletions+=i,t.files.push({file:r,changes:s+i,insertions:s,deletions:i,binary:!1})}),new li(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],nHn=[new li(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],rHn=[new li(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,n,r,s,i])=>{t.changed++,t.files.push({file:i??r,changes:0,insertions:0,deletions:0,binary:!1,status:_lt(m6s(e)&&e),from:_lt(!!i&&r!==i&&r),similarity:lc(n)})})],v5n={"":Alt,"--stat":Alt,"--numstat":tHn,"--name-status":rHn,"--name-only":nHn}}});function J6s(t,e){return e.reduce((n,r,s)=>(n[r]=t[s]||"",n),Object.create({diff:null}))}function k5n(t=Zlt,e=N5n,n=""){let r=T5n(n);return function(s){let i=Tre(s.trim(),!1,Jlt).map(function(o){let a=o.split(Xlt),c=J6s(a[0].split(t),e);return a.length>1&&a[1].trim()&&(c.diff=r(a[1])),c});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var Jlt,Xlt,Zlt,N5n,D5n=Yn({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";Vs(),R5n(),kre(),Jlt="\xF2\xF2\xF2\xF2\xF2\xF2 ",Xlt=" \xF2\xF2",Zlt=" \xF2 ",N5n=["hash","date","message","refs","author_name","author_email"]}}),B5n={};td(B5n,{diffSummaryTask:()=>X6s,validateLogFormatConfig:()=>ARe});function X6s(t){let e=Klt(t),n=["diff"];return e===""&&(e="--stat",n.push("--stat=4096")),n.push(...t),ARe(n)||{commands:n,format:"utf-8",parser:T5n(e)}}function ARe(t){let e=t.filter(K6s);if(e.length>1)return xg(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return xg(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}var eut=Yn({"src/lib/tasks/diff.ts"(){"use strict";kre(),R5n(),_u()}});function Z6s(t,e){let n=[],r=[];return Object.keys(t).forEach(s=>{n.push(s),r.push(String(t[s]))}),[n,r.join(e)]}function e8s(t){return Object.keys(t).reduce((e,n)=>(n in klt||(e[n]=t[n]),e),{})}function P5n(t={},e=[]){let n=sm(t.splitter,nu,Zlt),r=hRe(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[s,i]=Z6s(r,n),o=[],a=[`--pretty=format:${Jlt}${i}${Xlt}`,...e],c=t.n||t["max-count"]||t.maxCount;if(c&&a.push(`--max-count=${c}`),t.from||t.to){let u=t.symmetric!==!1?"...":"..";o.push(`${t.from||""}${u}${t.to||""}`)}return nu(t.file)&&a.push("--follow",rj(t.file)),Ult(e8s(t),a),{fields:s,splitter:n,commands:[...a,...o]}}function t8s(t,e,n){let r=k5n(t,e,Klt(n));return{commands:["log",...n],format:"utf-8",parser:r}}function n8s(){return{log(...n){let r=zc(arguments),s=P5n($lt(arguments),uj(sm(arguments[0],Rre,[]))),i=e(...n)||ARe(s.commands)||t(s);return this._runTask(i,r)}};function t(n){return t8s(n.splitter,n.fields,n.commands)}function e(n,r){return nu(n)&&nu(r)&&xg("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var klt,O5n=Yn({"src/lib/tasks/log.ts"(){"use strict";kre(),D5n(),Vs(),_u(),eut(),klt=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(klt||{})}}),iRe,M5n,r8s=Yn({"src/lib/responses/MergeSummary.ts"(){"use strict";iRe=class{constructor(t,e=null,n){this.reason=t,this.file=e,this.meta=n}toString(){return`${this.file}:${this.reason}`}},M5n=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Nlt,L5n,s8s=Yn({"src/lib/responses/PullSummary.ts"(){"use strict";Nlt=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},L5n=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function ylt(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function sHn(t){let e=/^\s*(\d+)/.exec(t),n=/delta (\d+)/i.exec(t);return{count:lc(e&&e[1]||"0"),delta:lc(n&&n[1]||"0")}}var F5n,i8s=Yn({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";Vs(),F5n=[new y1(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,n])=>{let r=e.toLowerCase(),s=ylt(t.remoteMessages);Object.assign(s,{[r]:lc(n)})}),new y1(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,n])=>{let r=e.toLowerCase(),s=ylt(t.remoteMessages);Object.assign(s,{[r]:lc(n)})}),new y1(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,n,r])=>{let s=ylt(t.remoteMessages);s.total=sHn(e),s.reused=sHn(n),s.packReused=lc(r)})]}});function Q5n(t,e){return wg({remoteMessages:new $5n},U5n,e)}var U5n,$5n,G5n=Yn({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";Vs(),i8s(),U5n=[new y1(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...F5n,new y1([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new y1([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,n,r])=>{t.remoteMessages.vulnerabilities={count:lc(e),summary:n,url:r}})],$5n=class{constructor(){this.all=[]}}}});function o8s(t,e){let n=wg(new L5n,W5n,[t,e]);return n.message&&n}var iHn,oHn,aHn,cHn,W5n,lHn,tut,q5n=Yn({"src/lib/parsers/parse-pull.ts"(){"use strict";s8s(),Vs(),G5n(),iHn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,oHn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,aHn=/^(create|delete) mode \d+ (.+)/,cHn=[new li(iHn,(t,[e,n,r])=>{t.files.push(e),n&&(t.insertions[e]=n.length),r&&(t.deletions[e]=r.length)}),new li(oHn,(t,[e,,n,,r])=>n!==void 0||r!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+n||0,t.summary.deletions=+r||0,!0):!1),new li(aHn,(t,[e,n])=>{xb(t.files,n),xb(e==="create"?t.created:t.deleted,n)})],W5n=[new li(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new li(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new li(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,n,r,s])=>{t.branch.local=r,t.hash.local=e,t.branch.remote=s,t.hash.remote=n})],lHn=(t,e)=>wg(new Nlt,cHn,[t,e]),tut=(t,e)=>Object.assign(new Nlt,lHn(t,e),Q5n(t,e))}}),uHn,H5n,dHn,a8s=Yn({"src/lib/parsers/parse-merge.ts"(){"use strict";r8s(),Vs(),q5n(),uHn=[new li(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new li(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,n])=>{t.conflicts.push(new iRe(e,n))}),new li(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,n,r])=>{t.conflicts.push(new iRe(e,n,{deleteRef:r}))}),new li(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new iRe(e,null))}),new li(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],H5n=(t,e)=>Object.assign(dHn(t,e),tut(t,e)),dHn=t=>wg(new M5n,uHn,t)}});function pHn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,n){let r=H5n(e,n);if(r.failed)throw new wre(r);return r}}:xg("Git.merge requires at least one option")}var c8s=Yn({"src/lib/tasks/merge.ts"(){"use strict";lj(),a8s(),_u()}});function l8s(t,e,n){let r=n.includes("deleted"),s=n.includes("tag")||/^refs\/tags/.test(t),i=!n.includes("new");return{deleted:r,tag:s,branch:!s,new:!i,alreadyUpdated:i,local:t,remote:e}}var hHn,V5n,mHn,u8s=Yn({"src/lib/parsers/parse-push.ts"(){"use strict";Vs(),G5n(),hHn=[new li(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new li(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new li(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,n,r])=>{t.pushed.push(l8s(e,n,r))}),new li(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,n,r])=>{t.branch={...t.branch||{},local:e,remote:n,remoteName:r}}),new li(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,n,r,s])=>{t.update={head:{local:e,remote:n},hash:{from:r,to:s}}})],V5n=(t,e)=>{let n=mHn(t,e),r=Q5n(t,e);return{...n,...r}},mHn=(t,e)=>wg({pushed:[]},hHn,[t,e])}}),j5n={};td(j5n,{pushTagsTask:()=>d8s,pushTask:()=>nut});function d8s(t={},e){return xb(e,"--tags"),nut(t,e)}function nut(t={},e){let n=["push",...e];return t.branch&&n.splice(1,0,t.branch),t.remote&&n.splice(1,0,t.remote),dRe(n,"-v"),xb(n,"--verbose"),xb(n,"--porcelain"),{commands:n,format:"utf-8",parser:V5n}}var Y5n=Yn({"src/lib/tasks/push.ts"(){"use strict";u8s(),Vs()}});function p8s(){return{showBuffer(){let t=["show",...hf(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(ZHn(t),zc(arguments))},show(){let t=["show",...hf(arguments,1)];return this._runTask(mf(t),zc(arguments))}}}var h8s=Yn({"src/lib/tasks/show.ts"(){"use strict";Vs(),_u()}}),fHn,K5n,m8s=Yn({"src/lib/responses/FileStatusSummary.ts"(){"use strict";fHn=/^(.+)\0(.+)$/,K5n=class{constructor(t,e,n){if(this.path=t,this.index=e,this.working_dir=n,e==="R"||n==="R"){let r=fHn.exec(t)||[null,t,t];this.from=r[2]||"",this.path=r[1]||""}}}}});function gHn(t){let[e,n]=t.split(aj);return{from:n||e,to:e}}function wy(t,e,n){return[`${t}${e}`,n]}function Elt(t,...e){return e.map(n=>wy(t,n,(r,s)=>r.conflicted.push(s)))}function f8s(t,e){let n=e.trim();switch(" "){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.slice(3));case n.charAt(1):return r(" ",n.charAt(0),n.slice(2));default:return}function r(s,i,o){let a=`${s}${i}`,c=z5n.get(a);c&&c(t,o),a!=="##"&&a!=="!!"&&t.files.push(new K5n(o,s,i))}}var AHn,z5n,J5n,g8s=Yn({"src/lib/responses/StatusSummary.ts"(){"use strict";Vs(),m8s(),AHn=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},z5n=new Map([wy(" ","A",(t,e)=>t.created.push(e)),wy(" ","D",(t,e)=>t.deleted.push(e)),wy(" ","M",(t,e)=>t.modified.push(e)),wy("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),wy("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),wy("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),wy("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),wy("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),wy("R"," ",(t,e)=>{t.renamed.push(gHn(e))}),wy("R","M",(t,e)=>{let n=gHn(e);t.renamed.push(n),t.modified.push(n.to)}),wy("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),wy("?","?",(t,e)=>t.not_added.push(e)),...Elt("A","A","U"),...Elt("D","D","U"),...Elt("U","A","D","U"),["##",(t,e)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,i=/\.{3}(\S*)/,o=/\son\s(\S+?)(?=\.{3}|$)/,a=n.exec(e);t.ahead=a&&+a[1]||0,a=r.exec(e),t.behind=a&&+a[1]||0,a=s.exec(e),t.current=sm(a?.[1],nu,null),a=i.exec(e),t.tracking=sm(a?.[1],nu,null),a=o.exec(e),a&&(t.current=sm(a?.[1],nu,t.current)),t.detached=/\(no branch\)/.test(e)}]]),J5n=function(t){let e=t.split(aj),n=new AHn;for(let r=0,s=e.length;r!X5n.includes(n))],parser(n){return J5n(n)}}}var X5n,y8s=Yn({"src/lib/tasks/status.ts"(){"use strict";g8s(),X5n=["--null","-z"]}});function lRe(t=0,e=0,n=0,r="",s=!0){return Object.defineProperty({major:t,minor:e,patch:n,agent:r,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function E8s(){return lRe(0,0,0,"",!1)}function b8s(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:_8s,onError(t,e,n,r){if(t.exitCode===-2)return n(Buffer.from(rut));r(e)}})}}}function _8s(t){return t===rut?E8s():wg(lRe(0,0,0,t),Z5n,t)}var rut,Z5n,S8s=Yn({"src/lib/tasks/version.ts"(){"use strict";Vs(),rut="installed=false",Z5n=[new li(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,n,r,s=""])=>{Object.assign(t,lRe(lc(e),lc(n),lc(r),s))}),new li(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,n,r,s=""])=>{Object.assign(t,lRe(lc(e),lc(n),r,s))})]}});function yHn(t,e,n,...r){return nu(n)?e(n,sm(r[0],nu),hf(arguments)):xg(`git.${t}() requires a string 'repoPath'`)}function C8s(){return{clone(t,...e){return this._runTask(yHn("clone",Dlt,sm(t,nu),...e),zc(arguments))},mirror(t,...e){return this._runTask(yHn("mirror",e4n,sm(t,nu),...e),zc(arguments))}}}var Dlt,e4n,I8s=Yn({"src/lib/tasks/clone.ts"(){"use strict";_u(),Vs(),Dlt=(t,e,n)=>{let r=["clone",...n];return nu(t)&&r.push(rj(t)),nu(e)&&r.push(rj(e)),mf(r)},e4n=(t,e,n)=>(xb(n,"--mirror"),Dlt(t,e,n))}}),t4n={};td(t4n,{SimpleGitApi:()=>Blt});var Blt,x8s=Yn({"src/lib/simple-git-api.ts"(){"use strict";v6s(),R6s(),N6s(),P6s(),Q6s(),a5n(),$6s(),p5n(),W6s(),Y6s(),O5n(),c8s(),Y5n(),h8s(),y8s(),_u(),S8s(),Vs(),I8s(),Blt=class{constructor(t){this._executor=t}_runTask(t,e){let n=this._executor.chain(),r=n.push(t);return e&&w6s(t,r,e),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(t){return this._runTask(mf(["add",...jI(t)]),zc(arguments))}cwd(t){let e=zc(arguments);return typeof t=="string"?this._runTask(eHn(t,this._executor),e):typeof t?.path=="string"?this._runTask(eHn(t.path,t.root&&this._executor||void 0),e):this._runTask(xg("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(G6s(t,e===!0),zc(arguments))}init(t){return this._runTask(j6s(t===!0,this._executor.cwd,hf(arguments)),zc(arguments))}merge(){return this._runTask(pHn(hf(arguments)),zc(arguments))}mergeFromTo(t,e){return nu(t)&&nu(e)?this._runTask(pHn([t,e,...hf(arguments)]),zc(arguments,!1)):this._runTask(xg("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=nut({remote:sm(arguments[0],nu),branch:sm(arguments[1],nu)},hf(arguments));return this._runTask(t,zc(arguments))}stash(){return this._runTask(mf(["stash",...hf(arguments)]),zc(arguments))}status(){return this._runTask(A8s(hf(arguments)),zc(arguments))}},Object.assign(Blt.prototype,k6s(),C8s(),F6s(),h6s(),B6s(),U6s(),A6s(),n8s(),p8s(),b8s())}}),n4n={};td(n4n,{Scheduler:()=>s4n});var EHn,s4n,w8s=Yn({"src/lib/runners/scheduler.ts"(){"use strict";Vs(),A5n(),EHn=(()=>{let t=0;return()=>{t++;let{promise:e,done:n}=(0,r4n.createDeferred)();return{promise:e,done:n,id:t}}})(),s4n=class{constructor(t=2){this.concurrency=t,this.logger=jlt("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=xb(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),dRe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=xb(this.pending,EHn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),i4n={};td(i4n,{applyPatchTask:()=>T8s});function T8s(t,e){return mf(["apply",...e,...t])}var v8s=Yn({"src/lib/tasks/apply-patch.ts"(){"use strict";_u()}});function R8s(t,e){return{branch:t,hash:e,success:!0}}function k8s(t){return{branch:t,hash:null,success:!1}}var o4n,N8s=Yn({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";o4n=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function a4n(t,e){return e===1&&Plt.test(t)}var bHn,Plt,_Hn,yRe,D8s=Yn({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";N8s(),Vs(),bHn=/(\S+)\s+\(\S+\s([^)]+)\)/,Plt=/^error[^']+'([^']+)'/m,_Hn=[new li(bHn,(t,[e,n])=>{let r=R8s(e,n);t.all.push(r),t.branches[e]=r}),new li(Plt,(t,[e])=>{let n=k8s(e);t.errors.push(n),t.all.push(n),t.branches[e]=n})],yRe=(t,e)=>wg(new o4n,_Hn,[t,e])}}),c4n,B8s=Yn({"src/lib/responses/BranchSummary.ts"(){"use strict";c4n=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,n,r,s){t==="*"&&(this.detached=e,this.current=n),this.all.push(n),this.branches[n]={current:t==="*",linkedWorkTree:t==="+",name:n,commit:r,label:s}}}}});function SHn(t){return t?t.charAt(0):""}function l4n(t,e=!1){return wg(new c4n,e?[d4n]:u4n,t)}var u4n,d4n,P8s=Yn({"src/lib/parsers/parse-branch.ts"(){"use strict";B8s(),Vs(),u4n=[new li(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,n,r,s])=>{t.push(SHn(e),!0,n,r,s)}),new li(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,n,r,s])=>{t.push(SHn(e),!1,n,r,s)})],d4n=new li(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),p4n={};td(p4n,{branchLocalTask:()=>M8s,branchTask:()=>O8s,containsDeleteBranchCommand:()=>h4n,deleteBranchTask:()=>F8s,deleteBranchesTask:()=>L8s});function h4n(t){let e=["-d","-D","--delete"];return t.some(n=>e.includes(n))}function O8s(t){let e=h4n(t),n=t.includes("--show-current"),r=["branch",...t];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(s,i){return e?yRe(s,i).all[0]:l4n(s,n)}}}function M8s(){return{format:"utf-8",commands:["branch","-v"],parser(t){return l4n(t)}}}function L8s(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(n,r){return yRe(n,r)},onError({exitCode:n,stdOut:r},s,i,o){if(!a4n(String(s),n))return o(s);i(r)}}}function F8s(t,e=!1){let n={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(r,s){return yRe(r,s).branches[t]},onError({exitCode:r,stdErr:s,stdOut:i},o,a,c){if(!a4n(String(o),r))return c(o);throw new wre(n.parser(xre(i),xre(s)),String(o))}};return n}var Q8s=Yn({"src/lib/tasks/branch.ts"(){"use strict";lj(),D8s(),P8s(),Vs()}});function U8s(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,m4n.normalize)(e)}var f4n,$8s=Yn({"src/lib/responses/CheckIgnore.ts"(){"use strict";f4n=t=>t.split(/\n/g).map(U8s).filter(Boolean)}}),g4n={};td(g4n,{checkIgnoreTask:()=>G8s});function G8s(t){return{commands:["check-ignore",...t],format:"utf-8",parser:f4n}}var W8s=Yn({"src/lib/tasks/check-ignore.ts"(){"use strict";$8s()}});function q8s(t,e){return wg({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},A4n,[t,e])}var A4n,H8s=Yn({"src/lib/parsers/parse-fetch.ts"(){"use strict";Vs(),A4n=[new li(/From (.+)$/,(t,[e])=>{t.remote=e}),new li(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,n])=>{t.branches.push({name:e,tracking:n})}),new li(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,n])=>{t.tags.push({name:e,tracking:n})}),new li(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new li(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,n,r,s])=>{t.updated.push({name:r,tracking:s,to:n,from:e})})]}}),y4n={};td(y4n,{fetchTask:()=>j8s});function V8s(t){return/^--upload-pack(=|$)/.test(t)}function j8s(t,e,n){let r=["fetch",...n];return t&&e&&r.push(t,e),r.find(V8s)?xg("git.fetch: potential exploit argument blocked."):{commands:r,format:"utf-8",parser:q8s}}var Y8s=Yn({"src/lib/tasks/fetch.ts"(){"use strict";H8s(),_u()}});function K8s(t){return wg({moves:[]},E4n,t)}var E4n,z8s=Yn({"src/lib/parsers/parse-move.ts"(){"use strict";Vs(),E4n=[new li(/^Renaming (.+) to (.+)$/,(t,[e,n])=>{t.moves.push({from:e,to:n})})]}}),b4n={};td(b4n,{moveTask:()=>J8s});function J8s(t,e){return{commands:["mv","-v",...jI(t),e],format:"utf-8",parser:K8s}}var X8s=Yn({"src/lib/tasks/move.ts"(){"use strict";z8s(),Vs()}}),_4n={};td(_4n,{pullTask:()=>Z8s});function Z8s(t,e,n){let r=["pull",...n];return t&&e&&r.splice(1,0,t,e),{commands:r,format:"utf-8",parser(s,i){return tut(s,i)},onError(s,i,o,a){let c=o8s(xre(s.stdOut),xre(s.stdErr));if(c)return a(new wre(c));a(i)}}}var e9s=Yn({"src/lib/tasks/pull.ts"(){"use strict";lj(),q5n(),Vs()}});function t9s(t){let e={};return S4n(t,([n])=>e[n]={name:n}),Object.values(e)}function n9s(t){let e={};return S4n(t,([n,r,s])=>{Object.hasOwn(e,n)||(e[n]={name:n,refs:{fetch:"",push:""}}),s&&r&&(e[n].refs[s.replace(/[^a-z]/g,"")]=r)}),Object.values(e)}function S4n(t,e){Llt(t,n=>e(n.split(/\s+/)))}var r9s=Yn({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";Vs()}}),C4n={};td(C4n,{addRemoteTask:()=>s9s,getRemotesTask:()=>i9s,listRemotesTask:()=>o9s,remoteTask:()=>a9s,removeRemoteTask:()=>c9s});function s9s(t,e,n){return mf(["remote","add",...n,t,e])}function i9s(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?n9s:t9s}}function o9s(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),mf(e)}function a9s(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),mf(e)}function c9s(t){return mf(["remote","remove",t])}var l9s=Yn({"src/lib/tasks/remote.ts"(){"use strict";r9s(),_u()}}),I4n={};td(I4n,{stashListTask:()=>u9s});function u9s(t={},e){let n=P5n(t),r=["stash","list",...n.commands,...e],s=k5n(n.splitter,n.fields,Klt(r));return ARe(r)||{commands:r,format:"utf-8",parser:s}}var d9s=Yn({"src/lib/tasks/stash-list.ts"(){"use strict";kre(),D5n(),eut(),O5n()}}),x4n={};td(x4n,{addSubModuleTask:()=>p9s,initSubModuleTask:()=>h9s,subModuleTask:()=>ERe,updateSubModuleTask:()=>m9s});function p9s(t,e){return ERe(["add",t,e])}function h9s(t){return ERe(["init",...t])}function ERe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),mf(e)}function m9s(t){return ERe(["update",...t])}var f9s=Yn({"src/lib/tasks/sub-module.ts"(){"use strict";_u()}});function g9s(t,e){let n=Number.isNaN(t),r=Number.isNaN(e);return n!==r?n?1:-1:n?w4n(t,e):0}function w4n(t,e){return t===e?0:t>e?1:-1}function A9s(t){return t.trim()}function tRe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}var CHn,T4n,y9s=Yn({"src/lib/responses/TagList.ts"(){"use strict";CHn=class{constructor(t,e){this.all=t,this.latest=e}},T4n=function(t,e=!1){let n=t.split(` -`).map(A9s).filter(Boolean);e||n.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return g9s(tRe(o[0]),tRe(a[0]));for(let c=0,u=Math.max(o.length,a.length);cs.indexOf(".")>=0);return new CHn(n,r)}}}),v4n={};td(v4n,{addAnnotatedTagTask:()=>_9s,addTagTask:()=>b9s,tagListTask:()=>E9s});function E9s(t=[]){let e=t.some(n=>/^--sort=/.test(n));return{format:"utf-8",commands:["tag","-l",...t],parser(n){return T4n(n,e)}}}function b9s(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function _9s(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var S9s=Yn({"src/lib/tasks/tag.ts"(){"use strict";y9s()}}),C9s=UYs({"src/git.js"(t,e){"use strict";var{GitExecutor:n}=(x6s(),bu(b5n)),{SimpleGitApi:r}=(x8s(),bu(t4n)),{Scheduler:s}=(w8s(),bu(n4n)),{adhocExecTask:i,configurationErrorTask:o}=(_u(),bu(wlt)),{asArray:a,filterArray:c,filterPrimitives:u,filterString:l,filterStringOrStringArray:d,filterType:h,getTrailingOptions:m,trailingFunctionArgument:f,trailingOptionsArgument:g}=(Vs(),bu(WHn)),{applyPatchTask:A}=(v8s(),bu(i4n)),{branchTask:y,branchLocalTask:b,deleteBranchesTask:S,deleteBranchTask:C}=(Q8s(),bu(p4n)),{checkIgnoreTask:I}=(W8s(),bu(g4n)),{checkIsRepoTask:x}=(jHn(),bu(qHn)),{cleanWithOptionsTask:w,isCleanOptionsArray:R}=(s5n(),bu(n5n)),{diffSummaryTask:N}=(eut(),bu(B5n)),{fetchTask:P}=(Y8s(),bu(y4n)),{moveTask:G}=(X8s(),bu(b4n)),{pullTask:$}=(e9s(),bu(_4n)),{pushTagsTask:Q}=(Y5n(),bu(j5n)),{addRemoteTask:H,getRemotesTask:oe,listRemotesTask:re,remoteTask:Z,removeRemoteTask:q}=(l9s(),bu(C4n)),{getResetMode:ce,resetTask:be}=(g5n(),bu(h5n)),{stashListTask:Be}=(d9s(),bu(I4n)),{addSubModuleTask:Me,initSubModuleTask:Re,subModuleTask:se,updateSubModuleTask:ie}=(f9s(),bu(x4n)),{addAnnotatedTagTask:ne,addTagTask:J,tagListTask:te}=(S9s(),bu(v4n)),{straightThroughBufferTask:j,straightThroughStringTask:X}=(_u(),bu(wlt));function ae(me,Ae){this._plugins=Ae,this._executor=new n(me.baseDir,new s(me.maxConcurrentProcesses),Ae),this._trimmed=me.trimmed}(ae.prototype=Object.create(r.prototype)).constructor=ae,ae.prototype.customBinary=function(me){return this._plugins.reconfigure("binary",me),this},ae.prototype.env=function(me,Ae){return arguments.length===1&&typeof me=="object"?this._executor.env=me:(this._executor.env=this._executor.env||{})[me]=Ae,this},ae.prototype.stashList=function(me){return this._runTask(Be(g(arguments)||{},c(me)&&me||[]),f(arguments))},ae.prototype.mv=function(me,Ae){return this._runTask(G(me,Ae),f(arguments))},ae.prototype.checkoutLatestTag=function(me){var Ae=this;return this.pull(function(){Ae.tags(function(ue,ye){Ae.checkout(ye.latest,me)})})},ae.prototype.pull=function(me,Ae,ue,ye){return this._runTask($(h(me,l),h(Ae,l),m(arguments)),f(arguments))},ae.prototype.fetch=function(me,Ae){return this._runTask(P(h(me,l),h(Ae,l),m(arguments)),f(arguments))},ae.prototype.silent=function(me){return this._runTask(i(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},ae.prototype.tags=function(me,Ae){return this._runTask(te(m(arguments)),f(arguments))},ae.prototype.rebase=function(){return this._runTask(X(["rebase",...m(arguments)]),f(arguments))},ae.prototype.reset=function(me){return this._runTask(be(ce(me),m(arguments)),f(arguments))},ae.prototype.revert=function(me){let Ae=f(arguments);return typeof me!="string"?this._runTask(o("Commit must be a string"),Ae):this._runTask(X(["revert",...m(arguments,0,!0),me]),Ae)},ae.prototype.addTag=function(me){let Ae=typeof me=="string"?J(me):o("Git.addTag requires a tag name");return this._runTask(Ae,f(arguments))},ae.prototype.addAnnotatedTag=function(me,Ae){return this._runTask(ne(me,Ae),f(arguments))},ae.prototype.deleteLocalBranch=function(me,Ae,ue){return this._runTask(C(me,typeof Ae=="boolean"?Ae:!1),f(arguments))},ae.prototype.deleteLocalBranches=function(me,Ae,ue){return this._runTask(S(me,typeof Ae=="boolean"?Ae:!1),f(arguments))},ae.prototype.branch=function(me,Ae){return this._runTask(y(m(arguments)),f(arguments))},ae.prototype.branchLocal=function(me){return this._runTask(b(),f(arguments))},ae.prototype.raw=function(me){let Ae=!Array.isArray(me),ue=[].slice.call(Ae?arguments:me,0);for(let Ie=0;Ieconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},ae.prototype.checkIgnore=function(me,Ae){return this._runTask(I(a(h(me,d,[]))),f(arguments))},ae.prototype.checkIsRepo=function(me,Ae){return this._runTask(x(h(me,l)),f(arguments))},e.exports=ae}});E1();var I9s=class extends sv{constructor(t,e){super(void 0,e),this.config=t}};E1();E1();var cj=class extends sv{constructor(t,e,n){super(t,n),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};lj();RHn();jHn();s5n();a5n();l5n();p5n();g5n();function x9s(t){return t?[{type:"spawn.before",action(r,s){t.aborted&&s.kill(new cj(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(r,s){function i(){s.kill(new cj(void 0,"abort","Abort signal received"))}t.addEventListener("abort",i),s.spawned.on("close",()=>t.removeEventListener("abort",i))}}]:void 0}function w9s(t={}){return{type:"spawn.args",action(e,{env:n}){for(let r of z3n(e,n))if(t[r.category]!==!0)throw new cj(void 0,"unsafe",r.message);return e}}}Vs();function T9s(t){let e=Ire(t,"-c");return{type:"spawn.args",action(n){return[...e,...n]}}}Vs();var IHn=(0,oj.deferred)().promise;function v9s({onClose:t=!0,onExit:e=50}={}){function n(){let s=-1,i={close:(0,oj.deferred)(),closeTimeout:(0,oj.deferred)(),exit:(0,oj.deferred)(),exitTimeout:(0,oj.deferred)()},o=Promise.race([t===!1?IHn:i.closeTimeout.promise,e===!1?IHn:i.exitTimeout.promise]);return r(t,i.close,i.closeTimeout),r(e,i.exit,i.exitTimeout),{close(a){s=a,i.close.done()},exit(a){s=a,i.exit.done()},get exitCode(){return s},result:o}}function r(s,i,o){s!==!1&&(s===!0?i.promise:i.promise.then(()=>blt(s))).then(o.done)}return{type:"spawn.after",async action(s,{spawned:i,close:o}){let a=n(),c=!0,u=()=>{c=!1};i.stdout?.on("data",u),i.stderr?.on("data",u),i.on("error",u),i.on("close",l=>a.close(l)),i.on("exit",l=>a.exit(l));try{await a.result,c&&await blt(50),o(a.exitCode)}catch(l){o(a.exitCode,l)}}}}Vs();var R9s="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",xHn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function k9s(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}function wHn(t,e){if(t.length<1||t.length>2)throw new cj(void 0,"binary",R9s);if(t.some(k9s))if(e)console.warn(xHn);else throw new cj(void 0,"binary",xHn);let[r,s]=t;return{binary:r,prefix:s}}function N9s(t,e=["git"],n=!1){let r=wHn(jI(e),n);t.on("binary",s=>{r=wHn(jI(s),n)}),t.append("spawn.binary",()=>r.binary),t.append("spawn.args",s=>r.prefix?[r.prefix,...s]:s)}E1();function D9s(t){return!!(t.exitCode&&t.stdErr.length)}function B9s(t){return Buffer.concat([...t.stdOut,...t.stdErr])}function P9s(t=!1,e=D9s,n=B9s){return(r,s)=>!t&&r||!e(s)?r:n(s)}function THn(t){return{type:"task.error",action(e,n){let r=t(e.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new sv(void 0,r.toString("utf-8"))}:{error:r}}}}Vs();var O9s=class{constructor(){this.plugins=new Set,this.events=new R4n.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let n=xb(this.plugins,{type:t,action:e});return()=>this.plugins.delete(n)}add(t){let e=[];return jI(t).forEach(n=>n&&this.plugins.add(xb(e,n))),()=>{e.forEach(n=>this.plugins.delete(n))}}exec(t,e,n){let r=e,s=Object.freeze(Object.create(n));for(let i of this.plugins)i.type===t&&(r=i.action(r,s));return r}};Vs();function M9s(t){let e="--progress",n=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(i,o){return n.includes(o.method)?OHn(i,e):i}},{type:"spawn.after",action(i,o){o.commands.includes(e)&&o.spawned.stderr?.on("data",a=>{let c=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(a.toString("utf8"));c&&t({method:o.method,stage:L9s(c[1]),progress:lc(c[2]),processed:lc(c[3]),total:lc(c[4])})})}}]}function L9s(t){return String(t.toLowerCase().split(" ",1))||"unknown"}Vs();function F9s(t){let e=LHn(t,["uid","gid"]);return{type:"spawn.options",action(n){return{...e,...n}}}}function Q9s({block:t,stdErr:e=!0,stdOut:n=!0}){if(t>0)return{type:"spawn.after",action(r,s){let i;function o(){i&&clearTimeout(i),i=setTimeout(c,t)}function a(){s.spawned.stdout?.off("data",o),s.spawned.stderr?.off("data",o),s.spawned.off("exit",a),s.spawned.off("close",a),i&&clearTimeout(i)}function c(){a(),s.kill(new cj(void 0,"timeout","block timeout reached"))}n&&s.spawned.stdout?.on("data",o),e&&s.spawned.stderr?.on("data",o),s.spawned.on("exit",a),s.spawned.on("close",a),o()}}}function U9s(){return{type:"spawn.args",action(t){let e=[],n;function r(s){(n=n||[]).push(...s)}for(let s=0;sSb(o)&&sj(o)||o));break}e.push(i)}return n?[...e,"--",...n.map(String)]:e}}}Vs();var $9s=C9s();function G9s(t,e){let n=new O9s,r=$Hn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!Flt(r.baseDir))throw new I9s(r,"Cannot use simple-git on a directory that does not exist");return Array.isArray(r.config)&&n.add(T9s(r.config)),n.add(w9s(r.unsafe)),n.add(v9s(r.completion)),r.abort&&n.add(x9s(r.abort)),r.progress&&n.add(M9s(r.progress)),r.timeout&&n.add(Q9s(r.timeout)),r.spawnOptions&&n.add(F9s(r.spawnOptions)),n.add(U9s()),n.add(THn(P9s(!0))),r.errors&&n.add(THn(r.errors)),N9s(n,r.binary,r.unsafe?.allowUnsafeCustomBinary),new $9s(r,n)}lj();var sut=G9s;var k4n=Gt(slt(),1);var W9s="Pi",q9s="pi@noreply.pi.local";function H9s(t){if(!t)return"noreply.local";try{return new URL(t).hostname}catch{return"noreply.local"}}function bRe(t,e){if(t)switch(e?.platformType){case"forgejo":return`${t}@${H9s(e?.serverUrl)}`;case"codeberg":return`${t}@noreply.codeberg.org`;default:return`${t}@users.noreply.github.com`}}function dj(t,e){let n=t.context.actor;if(!n)return e;let r=bRe(n,{platformType:t.platformType,serverUrl:t.context.serverUrl});return r?`${e} +${r}`:e,s=bgr(t),o=s?Igr:Sgr;if(t.updateComment)if(s){let c=await Rgr(t);if(c){t.logger.debug(`[comments] updating previous bot review comment ${c.id}`);let u=`${o} +${i}`;try{await kgr(t,c.id,u);return}catch(l){t.logger.warning(`[comments] failed to update bot review comment ${c.id}, falling back to create: ${l instanceof Error?l.message:String(l)}`)}}}else{let c=await Tgr(t);if(c){t.logger.debug(`[comments] updating previous bot comment ${c.id}`);let u=`${o} +${i}`;try{await vgr(t,c.id,u);return}catch(l){t.logger.warning(`[comments] failed to update bot comment ${c.id}, falling back to create: ${l instanceof Error?l.message:String(l)}`)}}}let a=`${o} +${i}`;return lws(t,a)}p();p();p();function hh(t,e="\u{1F500}"){return{debug:n=>t.logger.debug(`${e} ${n}`),info:n=>t.logger.info(`${e} ${n}`),warning:n=>t.logger.warning(`${e} ${n}`),notice:n=>t.logger.notice(`${e} ${n}`),error:n=>t.logger.error(`${e} ${n}`)}}p();p();var wOe=Ot(Ngr(),1);p();var rSt=new WeakMap;function t6(...t){let e=new String(t);return rSt.set(e,t),e}function l_(t){return t instanceof String&&rSt.has(t)}function n6(t){return rSt.get(t)??[]}var COe=Ot(pB(),1),cyr=require("child_process");var jyr=Ot(sSt(),1),rEr=require("node:path");p();function*Dgr(t,e){let n=e==="global";for(let r of t)r.isGlobal===n&&(yield r)}var yws=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),Ews=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),bws=new Set(["edit","remove-section","rename-section","set","unset"]),_ws=new Set(["get","get-color","get-colorbool","list"]);function xws(t,e){for(let{name:r}of Dgr(t,"task")){if(yws.has(r))return r6(!0,e);if(Ews.has(r))return r6(!1,e)}let n=e.at(0)?.toLowerCase();return n===void 0?null:bws.has(n)?r6(!0,e.slice(1)):_ws.has(n)?r6(!1,e.slice(1)):e.length===1?r6(!1,e):r6(!0,e)}function r6(t=!1,e=[]){let n=e.at(0)?.toLowerCase();return n===void 0?null:{isWrite:t,isRead:!t,key:n,value:e.at(1)}}function Sws(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}function Cws(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}function Iws(t){for(let{name:e}of Dgr(t,"task"))switch(e){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function wws({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}function*Tws(t){for(let e of t){let n=wws(e),r=n&&Cws(e.value);r&&(yield{...r,scope:n})}}function vws(t,e,n){let r={read:[],write:[...Tws(e)]};return t==="config"&&Rws(r,Iws(e),xws(e,n)),r}function Rws(t,e,n){if(n===null)return;let r=Sws(e,n);n.isWrite?t.write.push(r):t.read.push(r)}var Pgr={short:new Map([["c",!0]])},kws={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...Pgr.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},Bws={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},Nws={short:new Map,long:new Set};function Dws(t){let e=Bws[t??""]??Nws;return{short:new Map([...Pgr.short.entries(),...e.short.entries()]),long:e.long}}function Mgr(t,e=kws){if(t.startsWith("--")){let n=t.indexOf("=");if(n>2)return[{name:t.slice(0,n),value:t.slice(n+1),needsNext:!1}];let r=t.slice(2);return[{name:t,needsNext:e.long.has(r)}]}if(t.length===2){let n=t.charAt(1),r=e.short.get(n);return[{name:t,needsNext:r===!0}]}return Pws(t,e.short)}function Pws(t,e){let n=t.slice(1).split(""),r=[];for(let i=0;ie.has(c)))return r.push({name:`-${s}`,value:a,needsNext:!1}),r}r.push({name:`-${s}`,needsNext:o})}return r}function Mws(t,e=[]){let n=0;for(;nfunction(){return t&&(e=(0,t[vSt(t)[0]])(t=0)),e},Kws=(t,e)=>function(){return e||(0,t[vSt(t)[0]])((e={exports:{}}).exports,e),e.exports},jd=(t,e)=>{for(var n in e)TSt(t,n,{get:e[n],enumerable:!0})},Jws=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vSt(e))!zws.call(t,i)&&i!==n&&TSt(t,i,{get:()=>e[i],enumerable:!(r=Yws(e,i))||r.enumerable});return t},hd=t=>Jws(TSt({},"__esModule",{value:!0}),t),Uk,EM=zn({"src/lib/errors/git-error.ts"(){"use strict";Uk=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),mle,a6=zn({"src/lib/errors/git-response-error.ts"(){"use strict";EM(),mle=class extends Uk{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),AAr,yAr=zn({"src/lib/errors/task-configuration-error.ts"(){"use strict";EM(),AAr=class extends Uk{constructor(t){super(void 0,t)}}}});function EAr(t){return typeof t!="function"?LG:t}function bAr(t){return typeof t=="function"&&t!==LG}function _Ar(t,e){let n=t.indexOf(e);return n<=0?[t,""]:[t.substr(0,n),t.substr(n+1)]}function xAr(t,e=0){return SAr(t)&&t.length>e?t[e]:void 0}function OG(t,e=0){if(SAr(t)&&t.length>e)return t[t.length-1-e]}function SAr(t){return kOe(t)}function hle(t="",e=!0,n=` +`){return t.split(n).reduce((r,i)=>{let s=e?i.trim():i;return s&&r.push(s),r},[])}function RSt(t,e){return hle(t,!0).map(n=>e(n))}function kSt(t){return(0,wOe.exists)(t,wOe.FOLDER)}function p_(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function CAr(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function TOe(t,e){if(Array.isArray(t)){let n=t.indexOf(e);n>=0&&t.splice(n,1)}else t.delete(e);return e}function fT(t){return Array.isArray(t)?t:[t]}function IAr(t){return t.replace(/[\s-]+(.)/g,(e,n)=>n.toUpperCase())}function c6(t){return fT(t).map(e=>e instanceof String?e:String(e))}function Yc(t,e=0){if(t==null)return e;let n=parseInt(t,10);return Number.isNaN(n)?e:n}function dle(t,e){let n=[];for(let r=0,i=t.length;r{t[r]!==void 0&&(n[r]=t[r])}),n}function pSt(t=0){return new Promise(e=>setTimeout(e,t))}function mSt(t){if(t!==!1)return t}var s6,LG,fle,vOe=zn({"src/lib/utils/util.ts"(){"use strict";BSt(),s6="\0",LG=()=>{},fle=Object.prototype.toString.call.bind(Object.prototype.toString)}});function gf(t,e,n){return e(t)?t:arguments.length>2?n:void 0}function hSt(t,e){let n=l_(t)?"string":typeof t;return/number|string|boolean/.test(n)&&(!e||!e.includes(n))}function ROe(t){return!!t&&fle(t)==="[object Object]"}function TAr(t){return typeof t=="function"}var gle,vAr,ju,xOe,kOe,BSt=zn({"src/lib/utils/argument-filters.ts"(){"use strict";vOe(),gle=t=>Array.isArray(t),vAr=t=>typeof t=="number",ju=t=>typeof t=="string"||l_(t),xOe=t=>ju(t)||Array.isArray(t)&&t.every(ju),kOe=t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number"}}),fSt,Xws=zn({"src/lib/utils/exit-codes.ts"(){"use strict";fSt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(fSt||{})}}),SOe,Zws=zn({"src/lib/utils/git-output-streams.ts"(){"use strict";SOe=class RAr{constructor(e,n){this.stdOut=e,this.stdErr=n}asStrings(){return new RAr(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function eTs(){throw new Error("LineParser:useMatches not implemented")}var ys,yM,tTs=zn({"src/lib/utils/line-parser.ts"(){"use strict";ys=class{constructor(t,e){this.matches=[],this.useMatches=eTs,this.parse=(n,r)=>(this.resetMatches(),this._regExp.every((i,s)=>this.addMatch(i,s,n(s)))?this.useMatches(r,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,n){let r=n&&t.exec(n);return r&&this.pushMatch(e,r),!!r}pushMatch(t,e){this.matches.push(...e.slice(1))}},yM=class extends ys{addMatch(t,e,n){return/^remote:\s/.test(String(n))&&super.addMatch(t,e,n)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function kAr(...t){let e=process.cwd(),n=Object.assign({baseDir:e,...BAr},...t.filter(r=>typeof r=="object"&&r));return n.baseDir=n.baseDir||e,n.trimmed=n.trimmed===!0,n}var BAr,nTs=zn({"src/lib/utils/simple-git-options.ts"(){"use strict";BAr={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function NSt(t,e=[]){return ROe(t)?Object.keys(t).reduce((n,r)=>{let i=t[r];if(l_(i))n.push(i);else if(hSt(i,["boolean"]))n.push(r+"="+i);else if(Array.isArray(i))for(let s of i)hSt(s,["string","number"])||n.push(r+"="+s);else n.push(r);return n},e):e}function Mg(t,e=0,n=!1){let r=[];for(let i=0,s=e<0?t.length:e;i{for(let s=hle(i,r),o=0,a=s.length;o{if(!(o+u>=a))return s[o+u]};e.some(({parse:u})=>u(c,t))}}),t}var sTs=zn({"src/lib/utils/task-parser.ts"(){"use strict";vOe()}}),NAr={};jd(NAr,{ExitCodes:()=>fSt,GitOutputStreams:()=>SOe,LineParser:()=>ys,NOOP:()=>LG,NULL:()=>s6,RemoteLineParser:()=>yM,append:()=>p_,appendTaskOptions:()=>NSt,asArray:()=>fT,asCamelCase:()=>IAr,asFunction:()=>EAr,asNumber:()=>Yc,asStringArray:()=>c6,bufferToString:()=>ple,callTaskParser:()=>gSt,createInstanceConfig:()=>kAr,delay:()=>pSt,filterArray:()=>gle,filterFunction:()=>TAr,filterHasLength:()=>kOe,filterNumber:()=>vAr,filterPlainObject:()=>ROe,filterPrimitives:()=>hSt,filterString:()=>ju,filterStringOrStringArray:()=>xOe,filterType:()=>gf,first:()=>xAr,folderExists:()=>kSt,forEachLineWithContent:()=>RSt,getTrailingOptions:()=>Mg,including:()=>CAr,isUserFunction:()=>bAr,last:()=>OG,objectToString:()=>fle,orVoid:()=>mSt,parseStringResponse:()=>VA,pick:()=>wAr,prefixedArray:()=>dle,remove:()=>TOe,splitOn:()=>_Ar,toLinesWithContent:()=>hle,trailingFunctionArgument:()=>Gl,trailingOptionsArgument:()=>DSt});var es=zn({"src/lib/utils/index.ts"(){"use strict";BSt(),Xws(),Zws(),tTs(),nTs(),iTs(),sTs(),vOe()}}),DAr={};jd(DAr,{CheckRepoActions:()=>ASt,checkIsBareRepoTask:()=>MAr,checkIsRepoRootTask:()=>PAr,checkIsRepoTask:()=>oTs});function oTs(t){switch(t){case"bare":return MAr();case"root":return PAr()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:BOe,parser:PSt}}function PAr(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:BOe,parser(e){return/^\.(git)?$/.test(e.trim())}}}function MAr(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:BOe,parser:PSt}}function aTs(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var ASt,BOe,PSt,OAr=zn({"src/lib/tasks/check-is-repo.ts"(){"use strict";es(),ASt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(ASt||{}),BOe=({exitCode:t},e,n,r)=>{if(t===128&&aTs(e))return n(Buffer.from("false"));r(e)},PSt=t=>t.trim()==="true"}});function cTs(t,e){let n=new LAr(t),r=t?QAr:FAr;return hle(e).forEach(i=>{let s=i.replace(r,"");n.paths.push(s),(UAr.test(s)?n.folders:n.files).push(s)}),n}var LAr,FAr,QAr,UAr,lTs=zn({"src/lib/responses/CleanSummary.ts"(){"use strict";es(),LAr=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},FAr=/^[a-z]+\s*/i,QAr=/^[a-z]+\s+[a-z]+\s*/i,UAr=/\/$/}}),ySt={};jd(ySt,{EMPTY_COMMANDS:()=>NOe,adhocExecTask:()=>GAr,configurationErrorTask:()=>jA,isBufferTask:()=>WAr,isEmptyTask:()=>HAr,straightThroughBufferTask:()=>$Ar,straightThroughStringTask:()=>Og});function GAr(t){return{commands:NOe,format:"empty",parser:t}}function jA(t){return{commands:NOe,format:"empty",parser(){throw typeof t=="string"?new AAr(t):t}}}function Og(t,e=!1){return{commands:t,format:"utf-8",parser(n){return e?String(n).trim():n}}}function $Ar(t){return{commands:t,format:"buffer",parser(e){return e}}}function WAr(t){return t.format==="buffer"}function HAr(t){return t.format==="empty"||!t.commands.length}var NOe,fd=zn({"src/lib/tasks/task.ts"(){"use strict";yAr(),NOe=[]}}),qAr={};jd(qAr,{CONFIG_ERROR_INTERACTIVE_MODE:()=>MSt,CONFIG_ERROR_MODE_REQUIRED:()=>OSt,CONFIG_ERROR_UNKNOWN_OPTION:()=>LSt,CleanOptions:()=>yOe,cleanTask:()=>jAr,cleanWithOptionsTask:()=>uTs,isCleanOptionsArray:()=>dTs});function uTs(t,e){let{cleanMode:n,options:r,valid:i}=pTs(t);return n?i.options?(r.push(...e),r.some(fTs)?jA(MSt):jAr(n,r)):jA(LSt+JSON.stringify(t)):jA(OSt)}function jAr(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(r){return cTs(t==="n",r)}}}function dTs(t){return Array.isArray(t)&&t.every(e=>FSt.has(e))}function pTs(t){let e,n=[],r={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(i=>{mTs(i)?(e=i,r.cleanMode=!0):r.options=r.options&&hTs(n[n.length]=`-${i}`)}),{cleanMode:e,options:n,valid:r}}function mTs(t){return t==="f"||t==="n"}function hTs(t){return/^-[a-z]$/i.test(t)&&FSt.has(t.charAt(1))}function fTs(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}var MSt,OSt,LSt,yOe,FSt,VAr=zn({"src/lib/tasks/clean.ts"(){"use strict";lTs(),es(),fd(),MSt="Git clean interactive mode is not supported",OSt='Git clean mode parameter ("n" or "f") is required',LSt="Git clean unknown option found in: ",yOe=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(yOe||{}),FSt=new Set(["i",...c6(Object.values(yOe))])}});function gTs(t){let e=new zAr;for(let n of YAr(t))e.addValue(n.file,String(n.key),n.value);return e}function ATs(t,e){let n=null,r=[],i=new Map;for(let s of YAr(t,e))s.key===e&&(r.push(n=s.value),i.has(s.file)||i.set(s.file,[]),i.get(s.file).push(n));return{key:e,paths:Array.from(i.keys()),scopes:i,value:n,values:r}}function yTs(t){return t.replace(/^(file):/,"")}function*YAr(t,e=null){let n=t.split("\0");for(let r=0,i=n.length-1;rObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=OG(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,n){let r=this.addFile(t);Object.hasOwn(r,e)?Array.isArray(r[e])?r[e].push(n):r[e]=[r[e],n]:r[e]=n,this._all=void 0}}}});function oSt(t,e){return typeof t=="string"&&Object.hasOwn(ESt,t)?t:e}function bTs(t,e,n,r){let i=["config",`--${r}`];return n&&i.push("--add"),i.push(t,e),{commands:i,format:"utf-8",parser(s){return s}}}function _Ts(t,e){let n=["config","--null","--show-origin","--get-all",t];return e&&n.splice(1,0,`--${e}`),{commands:n,format:"utf-8",parser(r){return ATs(r,t)}}}function xTs(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(n){return gTs(n)}}}function STs(){return{addConfig(t,e,...n){return this._runTask(bTs(t,e,n[0]===!0,oSt(n[1],"local")),Gl(arguments))},getConfig(t,e){return this._runTask(_Ts(t,oSt(e,void 0)),Gl(arguments))},listConfig(...t){return this._runTask(xTs(oSt(t[0],void 0)),Gl(arguments))}}}var ESt,KAr=zn({"src/lib/tasks/config.ts"(){"use strict";ETs(),es(),ESt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(ESt||{})}});function CTs(t){return JAr.has(t)}var aSt,JAr,XAr=zn({"src/lib/tasks/diff-name-status.ts"(){"use strict";aSt=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(aSt||{}),JAr=new Set(Object.values(aSt))}});function ITs(...t){return new eyr().param(...t)}function wTs(t){let e=new Set,n={};return RSt(t,r=>{let[i,s,o]=r.split(s6);e.add(i),(n[i]=n[i]||[]).push({line:Yc(s),path:i,preview:o})}),{paths:e,results:n}}function TTs(){return{grep(t){let e=Gl(arguments),n=Mg(arguments);for(let i of ZAr)if(n.includes(i))return this._runTask(jA(`git.grep: use of "${i}" is not supported.`),e);typeof t=="string"&&(t=ITs().param(t));let r=["grep","--null","-n","--full-name",...n,...t];return this._runTask({commands:r,format:"utf-8",parser(i){return wTs(i)}},e)}}}var ZAr,ule,Ugr,eyr,tyr=zn({"src/lib/tasks/grep.ts"(){"use strict";es(),fd(),ZAr=["-h"],ule=Symbol("grepQuery"),eyr=class{constructor(){this[Ugr]=[]}*[(Ugr=ule,Symbol.iterator)](){for(let t of this[ule])yield t}and(...t){return t.length&&this[ule].push("--and","(",...dle(t,"-e"),")"),this}param(...t){return this[ule].push(...dle(t,"-e")),this}}}}),nyr={};jd(nyr,{ResetMode:()=>EOe,getResetMode:()=>RTs,resetTask:()=>vTs});function vTs(t,e){let n=["reset"];return ryr(t)&&n.push(`--${t}`),n.push(...e),Og(n)}function RTs(t){if(ryr(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function ryr(t){return typeof t=="string"&&iyr.includes(t)}var EOe,iyr,syr=zn({"src/lib/tasks/reset.ts"(){"use strict";es(),fd(),EOe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(EOe||{}),iyr=c6(Object.values(EOe))}});function kTs(){return(0,COe.default)("simple-git")}function Ggr(t,e,n){return!e||!String(e).replace(/\s*/,"")?n?(r,...i)=>{t(r,...i),n(r,...i)}:t:(r,...i)=>{t(`%s ${r}`,e,...i),n&&n(r,...i)}}function BTs(t,e,{namespace:n}){if(typeof t=="string")return t;let r=e&&e.namespace||"";return r.startsWith(n)?r.substr(n.length+1):r||n}function QSt(t,e,n,r=kTs()){let i=t&&`[${t}]`||"",s=[],o=typeof e=="string"?r.extend(e):e,a=BTs(gf(e,ju),o,r);return u(n);function c(l,d){return p_(s,QSt(t,a.replace(/^[^:]+/,l),d,r))}function u(l){let d=l&&`[${l}]`||"",m=o&&Ggr(o,d)||LG,h=Ggr(r,`${i} ${d}`,m);return Object.assign(o?m:h,{label:t,sibling:c,info:h,step:u})}}var oyr=zn({"src/lib/git-logger.ts"(){"use strict";es(),COe.default.formatters.L=t=>String(kOe(t)?t.length:"-"),COe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):fle(t)}}),ayr,NTs=zn({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";EM(),oyr(),ayr=class bSt{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let n=bSt.getName(e.commands[0]),r=QSt(this.logLabel,n);return{task:e,logger:r,name:n}}push(e){let n=this.createProgress(e);return n.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,n),n}fatal(e){for(let[n,{logger:r}]of Array.from(this._queue.entries()))n===e.task?(r.info("Failed %o",e),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(n);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let n=this.withProgress(e);if(!n)throw new Uk(void 0,"TasksPendingQueue: attempt called for an unknown task");return n.logger("Starting task"),n}static getName(e="empty"){return`task:${e}:${++bSt.counter}`}static{this.counter=0}}}});function MG(t,e){return{method:xAr(t.commands)||"",commands:e}}function DTs(t,e){return n=>{e("[ERROR] child process exception %o",n),t.push(Buffer.from(String(n.stack),"ascii"))}}function $gr(t,e,n,r){return i=>{n("%s received %L bytes",e,i),r("%B",i),t.push(i)}}var _St,PTs=zn({"src/lib/runners/git-executor-chain.ts"(){"use strict";EM(),fd(),es(),NTs(),_St=class{constructor(t,e,n){this._executor=t,this._scheduler=e,this._plugins=n,this._chain=Promise.resolve(),this._queue=new ayr}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),n=()=>this._queue.complete(t);try{let{logger:r}=this._queue.attempt(t);return await(HAr(t)?this.attemptEmptyTask(t,r):this.attemptRemoteTask(t,r))}catch(r){throw this.onFatalException(t,r)}finally{n(),e()}}onFatalException(t,e){let n=e instanceof Uk?Object.assign(e,{task:t}):new Uk(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(t,e){let n=this._plugins.exec("spawn.binary","",MG(t,t.commands)),r=this._plugins.exec("spawn.args",[...t.commands],{...MG(t,t.commands),env:{...this.env}}),i=await this.gitResponse(t,n,r,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,r,i,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),WAr(t)?gSt(t.parser,s):gSt(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,n,r){let{exitCode:i,rejection:s,stdOut:o,stdErr:a}=n;return new Promise((c,u)=>{r("Preparing to handle process response exitCode=%d stdOut=",i);let{error:l}=this._plugins.exec("task.error",{error:s},{...MG(t,e),...n});if(l&&t.onError)return r.info("exitCode=%s handling with custom error handler"),t.onError(n,l,d=>{r.info("custom error handler treated as success"),r("custom error returned a %s",fle(d)),c(new SOe(Array.isArray(d)?Buffer.concat(d):d,Buffer.concat(a)))},u);if(l)return r.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,a.length,s),u(l);r.info("retrieving task output complete"),c(new SOe(Buffer.concat(o),Buffer.concat(a)))})}async gitResponse(t,e,n,r,i){let s=i.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},MG(t,t.commands));return new Promise(a=>{let c=[],u=[];i.info("%s %o",e,n),i("%O",o);let l=this._beforeSpawn(t,n);if(l)return a({stdOut:c,stdErr:u,exitCode:9901,rejection:l});this._plugins.exec("spawn.before",void 0,{...MG(t,n),kill(m){l=m||l}});let d=(0,cyr.spawn)(e,n,o);d.stdout.on("data",$gr(c,"stdOut",i,s.step("stdOut"))),d.stderr.on("data",$gr(u,"stdErr",i,s.step("stdErr"))),d.on("error",DTs(u,i)),r&&(i("Passing child process stdOut/stdErr to custom outputHandler"),r(e,d.stdout,d.stderr,[...n])),this._plugins.exec("spawn.after",void 0,{...MG(t,n),spawned:d,close(m,h){a({stdOut:c,stdErr:u,exitCode:m,rejection:l||h})},kill(m){d.killed||(l=m,d.kill("SIGINT"))}})})}_beforeSpawn(t,e){let n;return this._plugins.exec("spawn.before",void 0,{...MG(t,e),kill(r){n=r||n}}),n}}}}),lyr={};jd(lyr,{GitExecutor:()=>uyr});var uyr,MTs=zn({"src/lib/runners/git-executor.ts"(){"use strict";PTs(),uyr=class{constructor(t,e,n){this.cwd=t,this._scheduler=e,this._plugins=n,this._chain=new _St(this,this._scheduler,this._plugins)}chain(){return new _St(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function OTs(t,e,n=LG){let r=s=>{n(null,s)},i=s=>{s?.task===t&&n(s instanceof mle?LTs(s):s,void 0)};e.then(r,i)}function LTs(t){let e=r=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${r} should be GitResponseError.git.${r}, this will no longer be available in version 3`),e=LG};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(n,{}));function n(r,i){return i in t||(r[i]={enumerable:!1,configurable:!1,get(){return e(i),t.git[i]}}),r}}var FTs=zn({"src/lib/task-callback.ts"(){"use strict";a6(),es()}});function Wgr(t,e){return GAr(n=>{if(!kSt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||n).cwd=t})}var QTs=zn({"src/lib/tasks/change-working-directory.ts"(){"use strict";es(),fd()}});function cSt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=TOe(e,"-B")),Og(e)}function UTs(){return{checkout(){return this._runTask(cSt(Mg(arguments,1)),Gl(arguments))},checkoutBranch(t,e){return this._runTask(cSt(["-b",t,e,...Mg(arguments)]),Gl(arguments))},checkoutLocalBranch(t){return this._runTask(cSt(["-b",t,...Mg(arguments)]),Gl(arguments))}}}var GTs=zn({"src/lib/tasks/checkout.ts"(){"use strict";es(),fd()}});function $Ts(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function WTs(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return VA($Ts(),[dyr],t)}})}}}var dyr,HTs=zn({"src/lib/tasks/count-objects.ts"(){"use strict";es(),dyr=new ys(/([a-z-]+): (\d+)$/,(t,[e,n])=>{let r=IAr(e);Object.hasOwn(t,r)&&(t[r]=Yc(n))})}});function qTs(t){return VA({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},pyr,t)}var pyr,jTs=zn({"src/lib/parsers/parse-commit.ts"(){"use strict";es(),pyr=[new ys(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,n,r])=>{t.branch=e,t.commit=r,t.root=!!n}),new ys(/\s*Author:\s(.+)/i,(t,[e])=>{let n=e.split("<"),r=n.pop();!r||!r.includes("@")||(t.author={email:r.substr(0,r.length-1),name:n.join("<").trim()})}),new ys(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,n,r])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(n,10)||0,t.summary.deletions=parseInt(r,10)||0}),new ys(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,n,r])=>{t.summary.changes=parseInt(e,10)||0;let i=parseInt(n,10)||0;r==="-"?t.summary.deletions=i:r==="+"&&(t.summary.insertions=i)})]}});function VTs(t,e,n){return{commands:["-c","core.abbrev=40","commit",...dle(t,"-m"),...e,...n],format:"utf-8",parser:qTs}}function YTs(){return{commit(e,...n){let r=Gl(arguments),i=t(e)||VTs(fT(e),fT(gf(n[0],xOe,[])),[...c6(gf(n[1],gle,[])),...Mg(arguments,0,!0)]);return this._runTask(i,r)}};function t(e){return!xOe(e)&&jA("git.commit: requires the commit message to be supplied as a string/string[]")}}var zTs=zn({"src/lib/tasks/commit.ts"(){"use strict";jTs(),es(),fd()}});function KTs(){return{firstCommit(){return this._runTask(Og(["rev-list","--max-parents=0","HEAD"],!0),Gl(arguments))}}}var JTs=zn({"src/lib/tasks/first-commit.ts"(){"use strict";es(),fd()}});function XTs(t,e){let n=["hash-object",t];return e&&n.push("-w"),Og(n,!0)}var ZTs=zn({"src/lib/tasks/hash-object.ts"(){"use strict";fd()}});function evs(t,e,n){let r=String(n).trim(),i;if(i=myr.exec(r))return new bOe(t,e,!1,i[1]);if(i=hyr.exec(r))return new bOe(t,e,!0,i[1]);let s="",o=r.split(" ");for(;o.length;)if(o.shift()==="in"){s=o.join(" ");break}return new bOe(t,e,/^re/i.test(r),s)}var bOe,myr,hyr,tvs=zn({"src/lib/responses/InitSummary.ts"(){"use strict";bOe=class{constructor(t,e,n,r){this.bare=t,this.path=e,this.existing=n,this.gitDir=r}},myr=/^Init.+ repository in (.+)$/,hyr=/^Rein.+ in (.+)$/}});function nvs(t){return t.includes(USt)}function rvs(t=!1,e,n){let r=["init",...n];return t&&!nvs(r)&&r.splice(1,0,USt),{commands:r,format:"utf-8",parser(i){return evs(r.includes("--bare"),e,i)}}}var USt,ivs=zn({"src/lib/tasks/init.ts"(){"use strict";tvs(),USt="--bare"}});function GSt(t){for(let e=0;eVA(new fyr,e,n,!1)}var lSt,Hgr,qgr,jgr,Ayr,yyr=zn({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Ale(),ovs(),XAr(),es(),lSt=[new ys(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,n,r=""])=>{t.files.push({file:e.trim(),changes:Yc(n),insertions:r.replace(/[^+]/g,"").length,deletions:r.replace(/[^-]/g,"").length,binary:!1})}),new ys(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,n,r])=>{t.files.push({file:e.trim(),before:Yc(n),after:Yc(r),binary:!0})}),new ys(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);t.changed=Yc(e),t.insertions=Yc(r?.[1]),t.deletions=Yc(i?.[1])})],Hgr=[new ys(/(\d+)\t(\d+)\t(.+)$/,(t,[e,n,r])=>{let i=Yc(e),s=Yc(n);t.changed++,t.insertions+=i,t.deletions+=s,t.files.push({file:r,changes:i+s,insertions:i,deletions:s,binary:!1})}),new ys(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],qgr=[new ys(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],jgr=[new ys(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,n,r,i,s])=>{t.changed++,t.files.push({file:s??r,changes:0,insertions:0,deletions:0,binary:!1,status:mSt(CTs(e)&&e),from:mSt(!!s&&r!==s&&r),similarity:Yc(n)})})],Ayr={"":lSt,"--stat":lSt,"--numstat":Hgr,"--name-status":jgr,"--name-only":qgr}}});function avs(t,e){return e.reduce((n,r,i)=>(n[r]=t[i]||"",n),Object.create({diff:null}))}function Eyr(t=qSt,e=byr,n=""){let r=gyr(n);return function(i){let s=hle(i.trim(),!1,WSt).map(function(o){let a=o.split(HSt),c=avs(a[0].split(t),e);return a.length>1&&a[1].trim()&&(c.diff=r(a[1])),c});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var WSt,HSt,qSt,byr,_yr=zn({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";es(),yyr(),Ale(),WSt="\xF2\xF2\xF2\xF2\xF2\xF2 ",HSt=" \xF2\xF2",qSt=" \xF2 ",byr=["hash","date","message","refs","author_name","author_email"]}}),xyr={};jd(xyr,{diffSummaryTask:()=>cvs,validateLogFormatConfig:()=>DOe});function cvs(t){let e=GSt(t),n=["diff"];return e===""&&(e="--stat",n.push("--stat=4096")),n.push(...t),DOe(n)||{commands:n,format:"utf-8",parser:gyr(e)}}function DOe(t){let e=t.filter(svs);if(e.length>1)return jA(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return jA(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}var jSt=zn({"src/lib/tasks/diff.ts"(){"use strict";Ale(),yyr(),fd()}});function lvs(t,e){let n=[],r=[];return Object.keys(t).forEach(i=>{n.push(i),r.push(String(t[i]))}),[n,r.join(e)]}function uvs(t){return Object.keys(t).reduce((e,n)=>(n in xSt||(e[n]=t[n]),e),{})}function Syr(t={},e=[]){let n=gf(t.splitter,ju,qSt),r=ROe(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[i,s]=lvs(r,n),o=[],a=[`--pretty=format:${WSt}${s}${HSt}`,...e],c=t.n||t["max-count"]||t.maxCount;if(c&&a.push(`--max-count=${c}`),t.from||t.to){let u=t.symmetric!==!1?"...":"..";o.push(`${t.from||""}${u}${t.to||""}`)}return ju(t.file)&&a.push("--follow",t6(t.file)),NSt(uvs(t),a),{fields:i,splitter:n,commands:[...a,...o]}}function dvs(t,e,n){let r=Eyr(t,e,GSt(n));return{commands:["log",...n],format:"utf-8",parser:r}}function pvs(){return{log(...n){let r=Gl(arguments),i=Syr(DSt(arguments),c6(gf(arguments[0],gle,[]))),s=e(...n)||DOe(i.commands)||t(i);return this._runTask(s,r)}};function t(n){return dvs(n.splitter,n.fields,n.commands)}function e(n,r){return ju(n)&&ju(r)&&jA("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var xSt,Cyr=zn({"src/lib/tasks/log.ts"(){"use strict";Ale(),_yr(),es(),fd(),jSt(),xSt=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(xSt||{})}}),_Oe,Iyr,mvs=zn({"src/lib/responses/MergeSummary.ts"(){"use strict";_Oe=class{constructor(t,e=null,n){this.reason=t,this.file=e,this.meta=n}toString(){return`${this.file}:${this.reason}`}},Iyr=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),SSt,wyr,hvs=zn({"src/lib/responses/PullSummary.ts"(){"use strict";SSt=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},wyr=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function uSt(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Vgr(t){let e=/^\s*(\d+)/.exec(t),n=/delta (\d+)/i.exec(t);return{count:Yc(e&&e[1]||"0"),delta:Yc(n&&n[1]||"0")}}var Tyr,fvs=zn({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";es(),Tyr=[new yM(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,n])=>{let r=e.toLowerCase(),i=uSt(t.remoteMessages);Object.assign(i,{[r]:Yc(n)})}),new yM(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,n])=>{let r=e.toLowerCase(),i=uSt(t.remoteMessages);Object.assign(i,{[r]:Yc(n)})}),new yM(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,n,r])=>{let i=uSt(t.remoteMessages);i.total=Vgr(e),i.reused=Vgr(n),i.packReused=Yc(r)})]}});function vyr(t,e){return VA({remoteMessages:new kyr},Ryr,e)}var Ryr,kyr,Byr=zn({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";es(),fvs(),Ryr=[new yM(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...Tyr,new yM([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new yM([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,n,r])=>{t.remoteMessages.vulnerabilities={count:Yc(e),summary:n,url:r}})],kyr=class{constructor(){this.all=[]}}}});function gvs(t,e){let n=VA(new wyr,Nyr,[t,e]);return n.message&&n}var Ygr,zgr,Kgr,Jgr,Nyr,Xgr,VSt,Dyr=zn({"src/lib/parsers/parse-pull.ts"(){"use strict";hvs(),es(),Byr(),Ygr=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,zgr=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Kgr=/^(create|delete) mode \d+ (.+)/,Jgr=[new ys(Ygr,(t,[e,n,r])=>{t.files.push(e),n&&(t.insertions[e]=n.length),r&&(t.deletions[e]=r.length)}),new ys(zgr,(t,[e,,n,,r])=>n!==void 0||r!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+n||0,t.summary.deletions=+r||0,!0):!1),new ys(Kgr,(t,[e,n])=>{p_(t.files,n),p_(e==="create"?t.created:t.deleted,n)})],Nyr=[new ys(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new ys(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new ys(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,n,r,i])=>{t.branch.local=r,t.hash.local=e,t.branch.remote=i,t.hash.remote=n})],Xgr=(t,e)=>VA(new SSt,Jgr,[t,e]),VSt=(t,e)=>Object.assign(new SSt,Xgr(t,e),vyr(t,e))}}),Zgr,Pyr,eAr,Avs=zn({"src/lib/parsers/parse-merge.ts"(){"use strict";mvs(),es(),Dyr(),Zgr=[new ys(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new ys(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,n])=>{t.conflicts.push(new _Oe(e,n))}),new ys(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,n,r])=>{t.conflicts.push(new _Oe(e,n,{deleteRef:r}))}),new ys(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new _Oe(e,null))}),new ys(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],Pyr=(t,e)=>Object.assign(eAr(t,e),VSt(t,e)),eAr=t=>VA(new Iyr,Zgr,t)}});function tAr(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,n){let r=Pyr(e,n);if(r.failed)throw new mle(r);return r}}:jA("Git.merge requires at least one option")}var yvs=zn({"src/lib/tasks/merge.ts"(){"use strict";a6(),Avs(),fd()}});function Evs(t,e,n){let r=n.includes("deleted"),i=n.includes("tag")||/^refs\/tags/.test(t),s=!n.includes("new");return{deleted:r,tag:i,branch:!i,new:!s,alreadyUpdated:s,local:t,remote:e}}var nAr,Myr,rAr,bvs=zn({"src/lib/parsers/parse-push.ts"(){"use strict";es(),Byr(),nAr=[new ys(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new ys(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new ys(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,n,r])=>{t.pushed.push(Evs(e,n,r))}),new ys(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,n,r])=>{t.branch={...t.branch||{},local:e,remote:n,remoteName:r}}),new ys(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,n,r,i])=>{t.update={head:{local:e,remote:n},hash:{from:r,to:i}}})],Myr=(t,e)=>{let n=rAr(t,e),r=vyr(t,e);return{...n,...r}},rAr=(t,e)=>VA({pushed:[]},nAr,[t,e])}}),Oyr={};jd(Oyr,{pushTagsTask:()=>_vs,pushTask:()=>YSt});function _vs(t={},e){return p_(e,"--tags"),YSt(t,e)}function YSt(t={},e){let n=["push",...e];return t.branch&&n.splice(1,0,t.branch),t.remote&&n.splice(1,0,t.remote),TOe(n,"-v"),p_(n,"--verbose"),p_(n,"--porcelain"),{commands:n,format:"utf-8",parser:Myr}}var Lyr=zn({"src/lib/tasks/push.ts"(){"use strict";bvs(),es()}});function xvs(){return{showBuffer(){let t=["show",...Mg(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask($Ar(t),Gl(arguments))},show(){let t=["show",...Mg(arguments,1)];return this._runTask(Og(t),Gl(arguments))}}}var Svs=zn({"src/lib/tasks/show.ts"(){"use strict";es(),fd()}}),iAr,Fyr,Cvs=zn({"src/lib/responses/FileStatusSummary.ts"(){"use strict";iAr=/^(.+)\0(.+)$/,Fyr=class{constructor(t,e,n){if(this.path=t,this.index=e,this.working_dir=n,e==="R"||n==="R"){let r=iAr.exec(t)||[null,t,t];this.from=r[2]||"",this.path=r[1]||""}}}}});function sAr(t){let[e,n]=t.split(s6);return{from:n||e,to:e}}function JE(t,e,n){return[`${t}${e}`,n]}function dSt(t,...e){return e.map(n=>JE(t,n,(r,i)=>r.conflicted.push(i)))}function Ivs(t,e){let n=e.trim();switch(" "){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.slice(3));case n.charAt(1):return r(" ",n.charAt(0),n.slice(2));default:return}function r(i,s,o){let a=`${i}${s}`,c=Qyr.get(a);c&&c(t,o),a!=="##"&&a!=="!!"&&t.files.push(new Fyr(o,i,s))}}var oAr,Qyr,Uyr,wvs=zn({"src/lib/responses/StatusSummary.ts"(){"use strict";es(),Cvs(),oAr=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Qyr=new Map([JE(" ","A",(t,e)=>t.created.push(e)),JE(" ","D",(t,e)=>t.deleted.push(e)),JE(" ","M",(t,e)=>t.modified.push(e)),JE("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),JE("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),JE("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),JE("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),JE("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),JE("R"," ",(t,e)=>{t.renamed.push(sAr(e))}),JE("R","M",(t,e)=>{let n=sAr(e);t.renamed.push(n),t.modified.push(n.to)}),JE("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),JE("?","?",(t,e)=>t.not_added.push(e)),...dSt("A","A","U"),...dSt("D","D","U"),...dSt("U","A","D","U"),["##",(t,e)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,o=/\son\s(\S+?)(?=\.{3}|$)/,a=n.exec(e);t.ahead=a&&+a[1]||0,a=r.exec(e),t.behind=a&&+a[1]||0,a=i.exec(e),t.current=gf(a?.[1],ju,null),a=s.exec(e),t.tracking=gf(a?.[1],ju,null),a=o.exec(e),a&&(t.current=gf(a?.[1],ju,t.current)),t.detached=/\(no branch\)/.test(e)}]]),Uyr=function(t){let e=t.split(s6),n=new oAr;for(let r=0,i=e.length;r!Gyr.includes(n))],parser(n){return Uyr(n)}}}var Gyr,vvs=zn({"src/lib/tasks/status.ts"(){"use strict";wvs(),Gyr=["--null","-z"]}});function IOe(t=0,e=0,n=0,r="",i=!0){return Object.defineProperty({major:t,minor:e,patch:n,agent:r,installed:i},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function Rvs(){return IOe(0,0,0,"",!1)}function kvs(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:Bvs,onError(t,e,n,r){if(t.exitCode===-2)return n(Buffer.from(zSt));r(e)}})}}}function Bvs(t){return t===zSt?Rvs():VA(IOe(0,0,0,t),$yr,t)}var zSt,$yr,Nvs=zn({"src/lib/tasks/version.ts"(){"use strict";es(),zSt="installed=false",$yr=[new ys(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,n,r,i=""])=>{Object.assign(t,IOe(Yc(e),Yc(n),Yc(r),i))}),new ys(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,n,r,i=""])=>{Object.assign(t,IOe(Yc(e),Yc(n),r,i))})]}});function aAr(t,e,n,...r){return ju(n)?e(n,gf(r[0],ju),Mg(arguments)):jA(`git.${t}() requires a string 'repoPath'`)}function Dvs(){return{clone(t,...e){return this._runTask(aAr("clone",CSt,gf(t,ju),...e),Gl(arguments))},mirror(t,...e){return this._runTask(aAr("mirror",Wyr,gf(t,ju),...e),Gl(arguments))}}}var CSt,Wyr,Pvs=zn({"src/lib/tasks/clone.ts"(){"use strict";fd(),es(),CSt=(t,e,n)=>{let r=["clone",...n];return ju(t)&&r.push(t6(t)),ju(e)&&r.push(t6(e)),Og(r)},Wyr=(t,e,n)=>(p_(n,"--mirror"),CSt(t,e,n))}}),Hyr={};jd(Hyr,{SimpleGitApi:()=>ISt});var ISt,Mvs=zn({"src/lib/simple-git-api.ts"(){"use strict";FTs(),QTs(),GTs(),HTs(),zTs(),KAr(),JTs(),tyr(),ZTs(),ivs(),Cyr(),yvs(),Lyr(),Svs(),vvs(),fd(),Nvs(),es(),Pvs(),ISt=class{constructor(t){this._executor=t}_runTask(t,e){let n=this._executor.chain(),r=n.push(t);return e&&OTs(t,r,e),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(t){return this._runTask(Og(["add",...fT(t)]),Gl(arguments))}cwd(t){let e=Gl(arguments);return typeof t=="string"?this._runTask(Wgr(t,this._executor),e):typeof t?.path=="string"?this._runTask(Wgr(t.path,t.root&&this._executor||void 0),e):this._runTask(jA("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(XTs(t,e===!0),Gl(arguments))}init(t){return this._runTask(rvs(t===!0,this._executor.cwd,Mg(arguments)),Gl(arguments))}merge(){return this._runTask(tAr(Mg(arguments)),Gl(arguments))}mergeFromTo(t,e){return ju(t)&&ju(e)?this._runTask(tAr([t,e,...Mg(arguments)]),Gl(arguments,!1)):this._runTask(jA("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=YSt({remote:gf(arguments[0],ju),branch:gf(arguments[1],ju)},Mg(arguments));return this._runTask(t,Gl(arguments))}stash(){return this._runTask(Og(["stash",...Mg(arguments)]),Gl(arguments))}status(){return this._runTask(Tvs(Mg(arguments)),Gl(arguments))}},Object.assign(ISt.prototype,UTs(),Dvs(),YTs(),STs(),WTs(),KTs(),TTs(),pvs(),xvs(),kvs())}}),qyr={};jd(qyr,{Scheduler:()=>Vyr});var cAr,Vyr,Ovs=zn({"src/lib/runners/scheduler.ts"(){"use strict";es(),oyr(),cAr=(()=>{let t=0;return()=>{t++;let{promise:e,done:n}=(0,jyr.createDeferred)();return{promise:e,done:n,id:t}}})(),Vyr=class{constructor(t=2){this.concurrency=t,this.logger=QSt("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=p_(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),TOe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=p_(this.pending,cAr());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),Yyr={};jd(Yyr,{applyPatchTask:()=>Lvs});function Lvs(t,e){return Og(["apply",...e,...t])}var Fvs=zn({"src/lib/tasks/apply-patch.ts"(){"use strict";fd()}});function Qvs(t,e){return{branch:t,hash:e,success:!0}}function Uvs(t){return{branch:t,hash:null,success:!1}}var zyr,Gvs=zn({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";zyr=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Kyr(t,e){return e===1&&wSt.test(t)}var lAr,wSt,uAr,POe,$vs=zn({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";Gvs(),es(),lAr=/(\S+)\s+\(\S+\s([^)]+)\)/,wSt=/^error[^']+'([^']+)'/m,uAr=[new ys(lAr,(t,[e,n])=>{let r=Qvs(e,n);t.all.push(r),t.branches[e]=r}),new ys(wSt,(t,[e])=>{let n=Uvs(e);t.errors.push(n),t.all.push(n),t.branches[e]=n})],POe=(t,e)=>VA(new zyr,uAr,[t,e])}}),Jyr,Wvs=zn({"src/lib/responses/BranchSummary.ts"(){"use strict";Jyr=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,n,r,i){t==="*"&&(this.detached=e,this.current=n),this.all.push(n),this.branches[n]={current:t==="*",linkedWorkTree:t==="+",name:n,commit:r,label:i}}}}});function dAr(t){return t?t.charAt(0):""}function Xyr(t,e=!1){return VA(new Jyr,e?[eEr]:Zyr,t)}var Zyr,eEr,Hvs=zn({"src/lib/parsers/parse-branch.ts"(){"use strict";Wvs(),es(),Zyr=[new ys(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,n,r,i])=>{t.push(dAr(e),!0,n,r,i)}),new ys(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,n,r,i])=>{t.push(dAr(e),!1,n,r,i)})],eEr=new ys(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),tEr={};jd(tEr,{branchLocalTask:()=>jvs,branchTask:()=>qvs,containsDeleteBranchCommand:()=>nEr,deleteBranchTask:()=>Yvs,deleteBranchesTask:()=>Vvs});function nEr(t){let e=["-d","-D","--delete"];return t.some(n=>e.includes(n))}function qvs(t){let e=nEr(t),n=t.includes("--show-current"),r=["branch",...t];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(i,s){return e?POe(i,s).all[0]:Xyr(i,n)}}}function jvs(){return{format:"utf-8",commands:["branch","-v"],parser(t){return Xyr(t)}}}function Vvs(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(n,r){return POe(n,r)},onError({exitCode:n,stdOut:r},i,s,o){if(!Kyr(String(i),n))return o(i);s(r)}}}function Yvs(t,e=!1){let n={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(r,i){return POe(r,i).branches[t]},onError({exitCode:r,stdErr:i,stdOut:s},o,a,c){if(!Kyr(String(o),r))return c(o);throw new mle(n.parser(ple(s),ple(i)),String(o))}};return n}var zvs=zn({"src/lib/tasks/branch.ts"(){"use strict";a6(),$vs(),Hvs(),es()}});function Kvs(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,rEr.normalize)(e)}var iEr,Jvs=zn({"src/lib/responses/CheckIgnore.ts"(){"use strict";iEr=t=>t.split(/\n/g).map(Kvs).filter(Boolean)}}),sEr={};jd(sEr,{checkIgnoreTask:()=>Xvs});function Xvs(t){return{commands:["check-ignore",...t],format:"utf-8",parser:iEr}}var Zvs=zn({"src/lib/tasks/check-ignore.ts"(){"use strict";Jvs()}});function eRs(t,e){return VA({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},oEr,[t,e])}var oEr,tRs=zn({"src/lib/parsers/parse-fetch.ts"(){"use strict";es(),oEr=[new ys(/From (.+)$/,(t,[e])=>{t.remote=e}),new ys(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,n])=>{t.branches.push({name:e,tracking:n})}),new ys(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,n])=>{t.tags.push({name:e,tracking:n})}),new ys(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new ys(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,n,r,i])=>{t.updated.push({name:r,tracking:i,to:n,from:e})})]}}),aEr={};jd(aEr,{fetchTask:()=>rRs});function nRs(t){return/^--upload-pack(=|$)/.test(t)}function rRs(t,e,n){let r=["fetch",...n];return t&&e&&r.push(t,e),r.find(nRs)?jA("git.fetch: potential exploit argument blocked."):{commands:r,format:"utf-8",parser:eRs}}var iRs=zn({"src/lib/tasks/fetch.ts"(){"use strict";tRs(),fd()}});function sRs(t){return VA({moves:[]},cEr,t)}var cEr,oRs=zn({"src/lib/parsers/parse-move.ts"(){"use strict";es(),cEr=[new ys(/^Renaming (.+) to (.+)$/,(t,[e,n])=>{t.moves.push({from:e,to:n})})]}}),lEr={};jd(lEr,{moveTask:()=>aRs});function aRs(t,e){return{commands:["mv","-v",...fT(t),e],format:"utf-8",parser:sRs}}var cRs=zn({"src/lib/tasks/move.ts"(){"use strict";oRs(),es()}}),uEr={};jd(uEr,{pullTask:()=>lRs});function lRs(t,e,n){let r=["pull",...n];return t&&e&&r.splice(1,0,t,e),{commands:r,format:"utf-8",parser(i,s){return VSt(i,s)},onError(i,s,o,a){let c=gvs(ple(i.stdOut),ple(i.stdErr));if(c)return a(new mle(c));a(s)}}}var uRs=zn({"src/lib/tasks/pull.ts"(){"use strict";a6(),Dyr(),es()}});function dRs(t){let e={};return dEr(t,([n])=>e[n]={name:n}),Object.values(e)}function pRs(t){let e={};return dEr(t,([n,r,i])=>{Object.hasOwn(e,n)||(e[n]={name:n,refs:{fetch:"",push:""}}),i&&r&&(e[n].refs[i.replace(/[^a-z]/g,"")]=r)}),Object.values(e)}function dEr(t,e){RSt(t,n=>e(n.split(/\s+/)))}var mRs=zn({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";es()}}),pEr={};jd(pEr,{addRemoteTask:()=>hRs,getRemotesTask:()=>fRs,listRemotesTask:()=>gRs,remoteTask:()=>ARs,removeRemoteTask:()=>yRs});function hRs(t,e,n){return Og(["remote","add",...n,t,e])}function fRs(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?pRs:dRs}}function gRs(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),Og(e)}function ARs(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),Og(e)}function yRs(t){return Og(["remote","remove",t])}var ERs=zn({"src/lib/tasks/remote.ts"(){"use strict";mRs(),fd()}}),mEr={};jd(mEr,{stashListTask:()=>bRs});function bRs(t={},e){let n=Syr(t),r=["stash","list",...n.commands,...e],i=Eyr(n.splitter,n.fields,GSt(r));return DOe(r)||{commands:r,format:"utf-8",parser:i}}var _Rs=zn({"src/lib/tasks/stash-list.ts"(){"use strict";Ale(),_yr(),jSt(),Cyr()}}),hEr={};jd(hEr,{addSubModuleTask:()=>xRs,initSubModuleTask:()=>SRs,subModuleTask:()=>MOe,updateSubModuleTask:()=>CRs});function xRs(t,e){return MOe(["add",t,e])}function SRs(t){return MOe(["init",...t])}function MOe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),Og(e)}function CRs(t){return MOe(["update",...t])}var IRs=zn({"src/lib/tasks/sub-module.ts"(){"use strict";fd()}});function wRs(t,e){let n=Number.isNaN(t),r=Number.isNaN(e);return n!==r?n?1:-1:n?fEr(t,e):0}function fEr(t,e){return t===e?0:t>e?1:-1}function TRs(t){return t.trim()}function AOe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}var pAr,gEr,vRs=zn({"src/lib/responses/TagList.ts"(){"use strict";pAr=class{constructor(t,e){this.all=t,this.latest=e}},gEr=function(t,e=!1){let n=t.split(` +`).map(TRs).filter(Boolean);e||n.sort(function(i,s){let o=i.split("."),a=s.split(".");if(o.length===1||a.length===1)return wRs(AOe(o[0]),AOe(a[0]));for(let c=0,u=Math.max(o.length,a.length);ci.indexOf(".")>=0);return new pAr(n,r)}}}),AEr={};jd(AEr,{addAnnotatedTagTask:()=>BRs,addTagTask:()=>kRs,tagListTask:()=>RRs});function RRs(t=[]){let e=t.some(n=>/^--sort=/.test(n));return{format:"utf-8",commands:["tag","-l",...t],parser(n){return gEr(n,e)}}}function kRs(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function BRs(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var NRs=zn({"src/lib/tasks/tag.ts"(){"use strict";vRs()}}),DRs=Kws({"src/git.js"(t,e){"use strict";var{GitExecutor:n}=(MTs(),hd(lyr)),{SimpleGitApi:r}=(Mvs(),hd(Hyr)),{Scheduler:i}=(Ovs(),hd(qyr)),{adhocExecTask:s,configurationErrorTask:o}=(fd(),hd(ySt)),{asArray:a,filterArray:c,filterPrimitives:u,filterString:l,filterStringOrStringArray:d,filterType:m,getTrailingOptions:h,trailingFunctionArgument:f,trailingOptionsArgument:g}=(es(),hd(NAr)),{applyPatchTask:A}=(Fvs(),hd(Yyr)),{branchTask:y,branchLocalTask:E,deleteBranchesTask:_,deleteBranchTask:S}=(zvs(),hd(tEr)),{checkIgnoreTask:C}=(Zvs(),hd(sEr)),{checkIsRepoTask:I}=(OAr(),hd(DAr)),{cleanWithOptionsTask:w,isCleanOptionsArray:k}=(VAr(),hd(qAr)),{diffSummaryTask:N}=(jSt(),hd(xyr)),{fetchTask:O}=(iRs(),hd(aEr)),{moveTask:W}=(cRs(),hd(lEr)),{pullTask:$}=(uRs(),hd(uEr)),{pushTagsTask:G}=(Lyr(),hd(Oyr)),{addRemoteTask:q,getRemotesTask:ce,listRemotesTask:Y,remoteTask:z,removeRemoteTask:j}=(ERs(),hd(pEr)),{getResetMode:se,resetTask:Ae}=(syr(),hd(nyr)),{stashListTask:De}=(_Rs(),hd(mEr)),{addSubModuleTask:Pe,initSubModuleTask:we,subModuleTask:ie,updateSubModuleTask:oe}=(IRs(),hd(hEr)),{addAnnotatedTagTask:ne,addTagTask:Z,tagListTask:te}=(NRs(),hd(AEr)),{straightThroughBufferTask:V,straightThroughStringTask:ee}=(fd(),hd(ySt));function ae(me,ge){this._plugins=ge,this._executor=new n(me.baseDir,new i(me.maxConcurrentProcesses),ge),this._trimmed=me.trimmed}(ae.prototype=Object.create(r.prototype)).constructor=ae,ae.prototype.customBinary=function(me){return this._plugins.reconfigure("binary",me),this},ae.prototype.env=function(me,ge){return arguments.length===1&&typeof me=="object"?this._executor.env=me:(this._executor.env=this._executor.env||{})[me]=ge,this},ae.prototype.stashList=function(me){return this._runTask(De(g(arguments)||{},c(me)&&me||[]),f(arguments))},ae.prototype.mv=function(me,ge){return this._runTask(W(me,ge),f(arguments))},ae.prototype.checkoutLatestTag=function(me){var ge=this;return this.pull(function(){ge.tags(function(ue,ye){ge.checkout(ye.latest,me)})})},ae.prototype.pull=function(me,ge,ue,ye){return this._runTask($(m(me,l),m(ge,l),h(arguments)),f(arguments))},ae.prototype.fetch=function(me,ge){return this._runTask(O(m(me,l),m(ge,l),h(arguments)),f(arguments))},ae.prototype.silent=function(me){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},ae.prototype.tags=function(me,ge){return this._runTask(te(h(arguments)),f(arguments))},ae.prototype.rebase=function(){return this._runTask(ee(["rebase",...h(arguments)]),f(arguments))},ae.prototype.reset=function(me){return this._runTask(Ae(se(me),h(arguments)),f(arguments))},ae.prototype.revert=function(me){let ge=f(arguments);return typeof me!="string"?this._runTask(o("Commit must be a string"),ge):this._runTask(ee(["revert",...h(arguments,0,!0),me]),ge)},ae.prototype.addTag=function(me){let ge=typeof me=="string"?Z(me):o("Git.addTag requires a tag name");return this._runTask(ge,f(arguments))},ae.prototype.addAnnotatedTag=function(me,ge){return this._runTask(ne(me,ge),f(arguments))},ae.prototype.deleteLocalBranch=function(me,ge,ue){return this._runTask(S(me,typeof ge=="boolean"?ge:!1),f(arguments))},ae.prototype.deleteLocalBranches=function(me,ge,ue){return this._runTask(_(me,typeof ge=="boolean"?ge:!1),f(arguments))},ae.prototype.branch=function(me,ge){return this._runTask(y(h(arguments)),f(arguments))},ae.prototype.branchLocal=function(me){return this._runTask(E(),f(arguments))},ae.prototype.raw=function(me){let ge=!Array.isArray(me),ue=[].slice.call(ge?arguments:me,0);for(let Se=0;Seconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},ae.prototype.checkIgnore=function(me,ge){return this._runTask(C(a(m(me,d,[]))),f(arguments))},ae.prototype.checkIsRepo=function(me,ge){return this._runTask(I(m(me,l)),f(arguments))},e.exports=ae}});EM();var PRs=class extends Uk{constructor(t,e){super(void 0,e),this.config=t}};EM();EM();var o6=class extends Uk{constructor(t,e,n){super(t,n),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};a6();yAr();OAr();VAr();KAr();XAr();tyr();syr();function MRs(t){return t?[{type:"spawn.before",action(r,i){t.aborted&&i.kill(new o6(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(r,i){function s(){i.kill(new o6(void 0,"abort","Abort signal received"))}t.addEventListener("abort",s),i.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}function ORs(t={}){return{type:"spawn.args",action(e,{env:n}){for(let r of Qgr(e,n))if(t[r.category]!==!0)throw new o6(void 0,"unsafe",r.message);return e}}}es();function LRs(t){let e=dle(t,"-c");return{type:"spawn.args",action(n){return[...e,...n]}}}es();var mAr=(0,i6.deferred)().promise;function FRs({onClose:t=!0,onExit:e=50}={}){function n(){let i=-1,s={close:(0,i6.deferred)(),closeTimeout:(0,i6.deferred)(),exit:(0,i6.deferred)(),exitTimeout:(0,i6.deferred)()},o=Promise.race([t===!1?mAr:s.closeTimeout.promise,e===!1?mAr:s.exitTimeout.promise]);return r(t,s.close,s.closeTimeout),r(e,s.exit,s.exitTimeout),{close(a){i=a,s.close.done()},exit(a){i=a,s.exit.done()},get exitCode(){return i},result:o}}function r(i,s,o){i!==!1&&(i===!0?s.promise:s.promise.then(()=>pSt(i))).then(o.done)}return{type:"spawn.after",async action(i,{spawned:s,close:o}){let a=n(),c=!0,u=()=>{c=!1};s.stdout?.on("data",u),s.stderr?.on("data",u),s.on("error",u),s.on("close",l=>a.close(l)),s.on("exit",l=>a.exit(l));try{await a.result,c&&await pSt(50),o(a.exitCode)}catch(l){o(a.exitCode,l)}}}}es();var QRs="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",hAr="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function URs(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}function fAr(t,e){if(t.length<1||t.length>2)throw new o6(void 0,"binary",QRs);if(t.some(URs))if(e)console.warn(hAr);else throw new o6(void 0,"binary",hAr);let[r,i]=t;return{binary:r,prefix:i}}function GRs(t,e=["git"],n=!1){let r=fAr(fT(e),n);t.on("binary",i=>{r=fAr(fT(i),n)}),t.append("spawn.binary",()=>r.binary),t.append("spawn.args",i=>r.prefix?[r.prefix,...i]:i)}EM();function $Rs(t){return!!(t.exitCode&&t.stdErr.length)}function WRs(t){return Buffer.concat([...t.stdOut,...t.stdErr])}function HRs(t=!1,e=$Rs,n=WRs){return(r,i)=>!t&&r||!e(i)?r:n(i)}function gAr(t){return{type:"task.error",action(e,n){let r=t(e.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new Uk(void 0,r.toString("utf-8"))}:{error:r}}}}es();var qRs=class{constructor(){this.plugins=new Set,this.events=new yEr.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let n=p_(this.plugins,{type:t,action:e});return()=>this.plugins.delete(n)}add(t){let e=[];return fT(t).forEach(n=>n&&this.plugins.add(p_(e,n))),()=>{e.forEach(n=>this.plugins.delete(n))}}exec(t,e,n){let r=e,i=Object.freeze(Object.create(n));for(let s of this.plugins)s.type===t&&(r=s.action(r,i));return r}};es();function jRs(t){let e="--progress",n=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,o){return n.includes(o.method)?CAr(s,e):s}},{type:"spawn.after",action(s,o){o.commands.includes(e)&&o.spawned.stderr?.on("data",a=>{let c=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(a.toString("utf8"));c&&t({method:o.method,stage:VRs(c[1]),progress:Yc(c[2]),processed:Yc(c[3]),total:Yc(c[4])})})}}]}function VRs(t){return String(t.toLowerCase().split(" ",1))||"unknown"}es();function YRs(t){let e=wAr(t,["uid","gid"]);return{type:"spawn.options",action(n){return{...e,...n}}}}function zRs({block:t,stdErr:e=!0,stdOut:n=!0}){if(t>0)return{type:"spawn.after",action(r,i){let s;function o(){s&&clearTimeout(s),s=setTimeout(c,t)}function a(){i.spawned.stdout?.off("data",o),i.spawned.stderr?.off("data",o),i.spawned.off("exit",a),i.spawned.off("close",a),s&&clearTimeout(s)}function c(){a(),i.kill(new o6(void 0,"timeout","block timeout reached"))}n&&i.spawned.stdout?.on("data",o),e&&i.spawned.stderr?.on("data",o),i.spawned.on("exit",a),i.spawned.on("close",a),o()}}}function KRs(){return{type:"spawn.args",action(t){let e=[],n;function r(i){(n=n||[]).push(...i)}for(let i=0;il_(o)&&n6(o)||o));break}e.push(s)}return n?[...e,"--",...n.map(String)]:e}}}es();var JRs=DRs();function XRs(t,e){let n=new qRs,r=kAr(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!kSt(r.baseDir))throw new PRs(r,"Cannot use simple-git on a directory that does not exist");return Array.isArray(r.config)&&n.add(LRs(r.config)),n.add(ORs(r.unsafe)),n.add(FRs(r.completion)),r.abort&&n.add(MRs(r.abort)),r.progress&&n.add(jRs(r.progress)),r.timeout&&n.add(zRs(r.timeout)),r.spawnOptions&&n.add(YRs(r.spawnOptions)),n.add(KRs()),n.add(gAr(HRs(!0))),r.errors&&n.add(gAr(r.errors)),GRs(n,r.binary,r.unsafe?.allowUnsafeCustomBinary),new JRs(r,n)}a6();var yle=XRs;var EEr=Ot(Jxt(),1);var ZRs="Pi",eks="pi@noreply.pi.local";function tks(t){if(!t)return"noreply.local";try{return new URL(t).hostname}catch{return"noreply.local"}}function OOe(t,e){if(t)switch(e?.platformType){case"forgejo":return`${t}@${tks(e?.serverUrl)}`;case"codeberg":return`${t}@noreply.codeberg.org`;default:return`${t}@users.noreply.github.com`}}function l6(t,e){let n=t.context.actor;if(!n)return e;let r=OOe(n,{platformType:t.platformType,serverUrl:t.context.serverUrl});return r?`${e} -Co-authored-by: ${n} <${r}>`:e}async function iut(t,e,n,r){let s=e??W9s,i=bRe(e,r)??q9s,o,a;try{o=(await t.getConfig("user.name")).value??void 0,a=(await t.getConfig("user.email")).value??void 0}catch{}o?.trim()||(await t.addConfig("user.name",s,!1,"local"),n?.debug(`Configured git user.name: ${s}`)),a?.trim()||(await t.addConfig("user.email",i,!1,"local"),n?.debug(`Configured git user.email: ${i}`))}async function out(t){return!(await t.status()).isClean()}async function pj(t){let n=await sut(t).raw(["status","--porcelain","-uall"]),r=(0,k4n.default)().add([...x3n]),s=[],i=[];if(!n.trim())return{changed:s,deleted:i};for(let o of n.split(` -`)){if(!o)continue;let a=o[0],c=o[1],u=o.substring(3),l=u.indexOf(" -> ");l!==-1&&(u=u.substring(l+4)),u.startsWith('"')&&u.endsWith('"')&&(u=u.slice(1,-1)),!r.ignores(u)&&(a==="D"||c==="D"?i.push(u):s.push(u))}return{changed:s,deleted:i}}async function aut(t,e,n){let r=await out(t);r&&(n.debug("Stashing working-tree changes before checkout\u2026"),await t.stash(["push","--include-untracked","-m","pi-agent-changes"])),await t.fetch("origin",e);try{await t.checkoutBranch(e,`origin/${e}`)}catch{await t.checkout(e),await t.raw(["reset","--hard",`origin/${e}`])}if(r){n.debug("Restoring stashed changes\u2026");try{await t.stash(["pop"])}catch(s){let i=s instanceof Error?s.message:String(s);throw n.warning(`Failed to restore stashed changes: ${i}`),new Error(`Could not cleanly apply working-tree changes onto branch "${e}". This usually means the branch has diverged from the base in files the agent modified. Original error: ${i}`)}}}async function hj(t){let{cwd:e,branchName:n,message:r,isNewBranch:s,actor:i,log:o}=t,a=sut(e);if(await iut(a,i,o,t.gitIdentityOptions),s?(o.debug(`Creating new branch "${n}" from current HEAD\u2026`),await a.checkoutLocalBranch(n)):(o.debug(`Checking out existing branch "${n}"\u2026`),await aut(a,n,o)),t.paths.length===0)throw new Error("commitAndPushBranch requires at least one path to stage. Callers must pass filtered paths from getWorkspaceChangePaths().");o.debug(`Staging ${t.paths.length} path(s)\u2026`),await a.add(t.paths),o.debug("Committing\u2026"),await a.commit(r),o.debug(`Pushing to origin/${n}\u2026`),s?await a.push("origin",n,{"--set-upstream":null}):await a.push("origin",n);let c=(await a.revparse("HEAD")).trim();return o.debug(`Committed ${c} and pushed to ${n}`),c}function N4n(t,e=50){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,e).replace(/-+$/,"")}var j9s=`${I3n}{number}-{timestamp}`;function D4n(t,e,n){let r=n||j9s,s=t.context.issue?.number??"unknown",i=qA.Now.instant().epochMilliseconds;return r.replace(/\{number\}/g,String(s)).replace(/\{timestamp\}/g,String(i)).replace(/\{title\}/g,N4n(e))}var Y9s=["..","~","^",":","\\"," ","?","*","[","@{","\0"];function K9s(){return[{message:()=>"Branch name cannot be empty",check:t=>!t},{message:t=>`Invalid branch name "${t}": branch name cannot start or end with a dot (.)`,check:t=>t.startsWith(".")||t.endsWith(".")},{message:t=>`Invalid branch name "${t}": branch name cannot start with a dash (-)`,check:t=>t.startsWith("-")},{message:t=>`Invalid branch name "${t}": branch name cannot start or end with a slash (/)`,check:t=>t.startsWith("/")||t.endsWith("/")},{message:t=>`Invalid branch name "${t}": branch name cannot end with ".lock"`,check:t=>t.endsWith(".lock")},{message:t=>`Invalid branch name "${t}": branch name cannot contain consecutive slashes (//)`,check:t=>t.includes("//")},{message:t=>`Invalid branch name "${t}": component cannot end with a dot (.)`,check:t=>/(?:^|\/)[^.]*\.(?:\/|$)/.test(t)},{message:t=>`Invalid branch name "${t}": contains control characters`,check:t=>/[\x00-\x1f\x7f]/.test(t)}]}var z9s=K9s();function B4n(t){for(let e of Y9s)if(typeof e=="string"){if(t.includes(e))return`Invalid branch name "${t}": contains forbidden pattern "${e}"`}else if(e.test(t))return`Invalid branch name "${t}": contains forbidden pattern ${e}`;return null}function P4n(t){for(let n of z9s)if(n.check(t))throw new Error(n.message(t));let e=B4n(t);if(e)throw new Error(e)}async function O4n(t,e){let n=V0(t),r;if(e)return r=e,n.debug(`Using provided base branch: ${r}`),r;let s=t.context.payload.repository;if(s?.default_branch)return r=s.default_branch,n.debug(`Using default branch from context: ${r}`),r;n.debug("Fetching repository default branch from GitHub API...");let i=t.context.repo.owner,o=t.context.repo.repo;return r=(await t.octokit.rest.repos.get({owner:i,repo:o})).data.default_branch,n.debug(`Fetched default branch: ${r}`),r}function M4n(t,e){let n=V0(t),r=e??"";if(!r&&t.context.issue?.number){let s=gre(t),i=t.context.issue?.number;s==="issue"?r=`Fixes #${i} +Co-authored-by: ${n} <${r}>`:e}async function KSt(t,e,n,r){let i=e??ZRs,s=OOe(e,r)??eks,o,a;try{o=(await t.getConfig("user.name")).value??void 0,a=(await t.getConfig("user.email")).value??void 0}catch{}o?.trim()||(await t.addConfig("user.name",i,!1,"local"),n?.debug(`Configured git user.name: ${i}`)),a?.trim()||(await t.addConfig("user.email",s,!1,"local"),n?.debug(`Configured git user.email: ${s}`))}async function JSt(t){return!(await t.status()).isClean()}async function u6(t){let n=await yle(t).raw(["status","--porcelain","-uall"]),r=(0,EEr.default)().add([...hgr]),i=[],s=[];if(!n.trim())return{changed:i,deleted:s};for(let o of n.split(` +`)){if(!o)continue;let a=o[0],c=o[1],u=o.substring(3),l=u.indexOf(" -> ");l!==-1&&(u=u.substring(l+4)),u.startsWith('"')&&u.endsWith('"')&&(u=u.slice(1,-1)),!r.ignores(u)&&(a==="D"||c==="D"?s.push(u):i.push(u))}return{changed:i,deleted:s}}async function XSt(t,e,n,r){let i;try{i=(await t.raw(["remote","get-url",e])).trim()||void 0}catch{}i!==n&&(i!==void 0?await t.raw(["remote","set-url",e,n]):await t.raw(["remote","add",e,n]),r?.debug(`Configured git remote "${e}" \u2192 ${n}`))}async function ZSt(t,e,n,r="origin"){let i=await JSt(t);i&&(n.debug("Stashing working-tree changes before checkout\u2026"),await t.stash(["push","--include-untracked","-m","pi-agent-changes"])),await t.fetch(r,e);try{await t.checkoutBranch(e,`${r}/${e}`)}catch{await t.checkout(e),await t.raw(["reset","--hard",`${r}/${e}`])}if(i){n.debug("Restoring stashed changes\u2026");try{await t.stash(["pop"])}catch(s){let o=s instanceof Error?s.message:String(s);throw n.warning(`Failed to restore stashed changes: ${o}`),new Error(`Could not cleanly apply working-tree changes onto branch "${e}". This usually means the branch has diverged from the base in files the agent modified. Original error: ${o}`)}}}async function d6(t){let{cwd:e,branchName:n,message:r,isNewBranch:i,actor:s,log:o}=t,a=yle(e);await KSt(a,s,o,t.gitIdentityOptions);let c=t.remote?.name??"origin";if(t.remote&&await XSt(a,t.remote.name,t.remote.url,o),i?(o.debug(`Creating new branch "${n}" from current HEAD\u2026`),await a.checkoutLocalBranch(n)):(o.debug(`Checking out existing branch "${n}"\u2026`),await ZSt(a,n,o,c)),t.paths.length===0)throw new Error("commitAndPushBranch requires at least one path to stage. Callers must pass filtered paths from getWorkspaceChangePaths().");o.debug(`Staging ${t.paths.length} path(s)\u2026`),await a.add(t.paths),o.debug("Committing\u2026"),await a.commit(r),o.debug(`Pushing to ${c}/${n}\u2026`);try{let l=await a.push(c,n,i?{"--set-upstream":null}:void 0);o.debug(`Push result: ${JSON.stringify(l)}`)}catch(l){throw o.debug(`Push failed with exception ${l}`),l}let u=(await a.revparse("HEAD")).trim();return o.debug(`Committed ${u} and pushed to ${n}`),u}p();function eCt(t){if(typeof t=="object"&&t!==null&&"status"in t){let e=t.status;if(typeof e=="number")return e}}function Ele(t){return t instanceof Error?t.message:String(t)}function LOe(t){let e=eCt(t);return e===void 0?"unknown":String(e)}async function FOe(t){let e=hh(t,"\u{1F374}");e.debug("Resolving the authenticated user for the fork\u2026");try{let r=(await t.octokit.rest.users.getAuthenticated()).data.login;if(!r)throw new Error("the API response did not include a login");return e.debug(`Authenticated as "${r}"`),r}catch(n){throw new Error(`Failed to resolve the authenticated user (HTTP ${LOe(n)}): ${Ele(n)}. Fork-based pull requests require a token that can create forks (e.g. a personal access token) \u2014 the default GITHUB_TOKEN authenticates as a bot user that cannot own forks.`)}}async function QOe(t){let e=hh(t,"\u{1F374}"),{owner:n,repo:r}=t.context.repo;try{let s=(await t.octokit.rest.repos.get({owner:n,repo:r})).data.permissions?.push===!0;return e.debug(s?`The token can push to "${n}/${r}" \u2014 no fork is needed.`:`The token cannot push to "${n}/${r}" \u2014 a fork is needed to open a pull request.`),s}catch(i){return e.debug(`Could not determine push permission for "${n}/${r}" (${Ele(i)}) \u2014 assuming push is not possible; a fork will be used.`),!1}}async function UOe(t,e){let n=hh(t,"\u{1F374}"),{owner:r,repo:i}=t.context.repo,s=`${r}/${i}`;try{let a=(await t.octokit.rest.repos.get({owner:e,repo:i})).data;if(a.fork&&a.parent?.full_name===s&&a.name)return n.debug(`Reusing existing fork "${e}/${a.name}" of "${s}"`),{owner:e,repo:a.name,created:!1};n.debug(`"${e}/${i}" exists but is not a fork of "${s}" \u2014 attempting to create a fork anyway`)}catch(o){if(eCt(o)!==404)throw new Error(`Failed to check for an existing fork at "${e}/${i}" (HTTP ${LOe(o)}): ${Ele(o)}.`)}n.debug(`Creating fork of "${s}" for "${e}"\u2026`);try{let a=(await t.octokit.rest.repos.createFork({owner:r,repo:i})).data.name??i;return n.info(`Created fork "${e}/${a}" of "${s}"`),{owner:e,repo:a,created:!0}}catch(o){throw new Error(`Failed to create a fork of "${s}" for "${e}" (HTTP ${LOe(o)}): ${Ele(o)}. Fork-based pull requests require a token that can create forks \u2014 e.g. a personal access token with repository access. The default GITHUB_TOKEN authenticates as a bot user that cannot own repositories.`)}}var nks=10,rks=1e3;function iks(t){return new Promise(e=>setTimeout(e,t))}async function GOe(t,e,n,r){let i=hh(t,"\u{1F374}"),s=r?.attempts??nks,o=r?.delayMs??rks,a=r?.sleep??iks;for(let c=1;c<=s;c++)try{return await t.octokit.rest.repos.getBranch({owner:e.owner,repo:e.repo,branch:n}),c>1&&i.debug(`Fork "${e.owner}/${e.repo}" is ready (default branch visible).`),!0}catch(u){if(eCt(u)!==404)return i.warning(`Readiness check for fork "${e.owner}/${e.repo}" failed with HTTP ${LOe(u)}: ${Ele(u)} \u2014 proceeding.`),!1;c"Branch name cannot be empty",check:t=>!t},{message:t=>`Invalid branch name "${t}": branch name cannot start or end with a dot (.)`,check:t=>t.startsWith(".")||t.endsWith(".")},{message:t=>`Invalid branch name "${t}": branch name cannot start with a dash (-)`,check:t=>t.startsWith("-")},{message:t=>`Invalid branch name "${t}": branch name cannot start or end with a slash (/)`,check:t=>t.startsWith("/")||t.endsWith("/")},{message:t=>`Invalid branch name "${t}": branch name cannot end with ".lock"`,check:t=>t.endsWith(".lock")},{message:t=>`Invalid branch name "${t}": branch name cannot contain consecutive slashes (//)`,check:t=>t.includes("//")},{message:t=>`Invalid branch name "${t}": component cannot end with a dot (.)`,check:t=>/(?:^|\/)[^.]*\.(?:\/|$)/.test(t)},{message:t=>`Invalid branch name "${t}": contains control characters`,check:t=>/[\x00-\x1f\x7f]/.test(t)}]}var lks=cks();function xEr(t){for(let e of aks)if(typeof e=="string"){if(t.includes(e))return`Invalid branch name "${t}": contains forbidden pattern "${e}"`}else if(e.test(t))return`Invalid branch name "${t}": contains forbidden pattern ${e}`;return null}function SEr(t){for(let n of lks)if(n.check(t))throw new Error(n.message(t));let e=xEr(t);if(e)throw new Error(e)}async function nCt(t,e){let n=hh(t),r;if(e)return r=e,n.debug(`Using provided base branch: ${r}`),r;let i=t.context.payload.repository;if(i?.default_branch)return r=i.default_branch,n.debug(`Using default branch from context: ${r}`),r;n.debug("Fetching repository default branch from GitHub API...");let s=t.context.repo.owner,o=t.context.repo.repo;return r=(await t.octokit.rest.repos.get({owner:s,repo:o})).data.default_branch,n.debug(`Fetched default branch: ${r}`),r}function CEr(t,e){let n=hh(t),r=e??"";if(!r&&t.context.issue?.number){let i=rle(t),s=t.context.issue?.number;i==="issue"?r=`Fixes #${s} -Created by pi coding agent.`:s==="pull_request"&&(r=`Related to #${i} +Created by pi coding agent.`:i==="pull_request"&&(r=`Related to #${s} -Created by pi coding agent.`),n.debug(`Auto-generated body from issue #${i}`)}return r}function L4n(t){if(!t.title||t.title.trim()==="")throw new Error("Pull request title is required and cannot be empty");if(t.title.length>tj)throw new Error(`Pull request title exceeds maximum length of ${tj} characters (got ${t.title.length})`)}function F4n(t,e,n,r){return`[DRY RUN] Would create pull request: +Created by pi coding agent.`),n.debug(`Auto-generated body from issue #${s}`)}return r}function IEr(t){if(!t.title||t.title.trim()==="")throw new Error("Pull request title is required and cannot be empty");if(t.title.length>Z9)throw new Error(`Pull request title exceeds maximum length of ${Z9} characters (got ${t.title.length})`)}function wEr(t,e,n,r){return`[DRY RUN] Would create pull request: - Title: ${t} - Body: ${e||"(empty)"} - Base: ${n} -- Head: ${r}`}function Q4n(t,e,n){return{content:[{type:"text",text:t}],details:{pullRequestNumber:0,pullRequestUrl:"",headBranch:e,baseBranch:n,dryRun:!0}}}function cut(t){return`Pull request #${t.number} created: ${t.url}`}function U4n(t){return{content:[{type:"text",text:cut(t)}],details:{pullRequestNumber:t.number,pullRequestUrl:t.url,headBranch:t.headRef,baseBranch:t.baseRef,dryRun:!1,prCreated:!0}}}function $4n(t){return`[pull-request] Failed to create pull request: ${t instanceof Error?t.message:String(t)}`}function G4n(t){if(typeof t=="object"&&t!==null&&"status"in t){let e=t.status;if(typeof e=="number")return e}}function W4n(t,e,n){let{owner:r,repo:s}=t.context.repo;return`${(t.context.serverUrl||"https://github.com").replace(/\/$/,"")}/${r}/${s}/compare/${e}...${n}`}function q4n(t,e,n,r){return`Branch "${e}" was created and pushed successfully, but the pull request could not be opened automatically: ${r} +- Head: ${r}`}function TEr(t,e,n){return{content:[{type:"text",text:t}],details:{pullRequestNumber:0,pullRequestUrl:"",headBranch:e,baseBranch:n,dryRun:!0}}}function rCt(t){return`Pull request #${t.number} created: ${t.url}`}function vEr(t,e){return{content:[{type:"text",text:rCt(t)}],details:{pullRequestNumber:t.number,pullRequestUrl:t.url,headBranch:t.headRef,baseBranch:t.baseRef,dryRun:!1,prCreated:!0,...e?{forkOwner:e.owner,forkRepo:e.repo}:{}}}}function REr(t){return`[pull-request] Failed to create pull request: ${t instanceof Error?t.message:String(t)}`}function kEr(t){if(typeof t=="object"&&t!==null&&"status"in t){let e=t.status;if(typeof e=="number")return e}}function BEr(t,e,n){let{owner:r,repo:i}=t.context.repo;return`${(t.context.serverUrl||"https://github.com").replace(/\/$/,"")}/${r}/${i}/compare/${e}...${n}`}function NEr(t,e,n,r){return`Branch "${e}" was created and pushed successfully, but the pull request could not be opened automatically: ${r} You can open the PR manually here: -${n}`}function H4n(t,e,n,r){return{content:[{type:"text",text:t}],details:{pullRequestNumber:0,pullRequestUrl:"",headBranch:e,baseBranch:n,dryRun:!1,prCreated:!1,compareUrl:r}}}async function J9s(t,e,n,r,s,i){let o=t.context.workspace;i.debug(`Checking for changes in workspace "${o}"...`);let{changed:a,deleted:c}=await pj(o);if(a.length===0&&c.length===0)throw new Error("No changes detected. Please add new files and/or make your changes before creating a pull request.");let u=dj(t,r);i.debug(`Creating branch "${n}", committing, and pushing via git CLI...`),await hj({cwd:o,branchName:n,message:u,isNewBranch:!0,paths:[...a,...c],actor:t.context.actor,gitIdentityOptions:{platformType:t.platformType,serverUrl:t.context.serverUrl},log:i}),i.debug(`Branch "${n}" created and pushed successfully`);try{return{pr:await X9s(t,r,s,e,n)}}catch(l){let d=G4n(l),h=l instanceof Error?l.message:String(l);if(d!==401&&d!==403&&d!==404)throw i.debug(`PR creation failed with HTTP ${d??"unknown"} (not a permission error) \u2014 re-throwing after branch "${n}" was pushed.`),l;return i.warning(`PR creation failed after branch "${n}" was pushed (HTTP ${d}): ${h}. The branch is ready \u2014 a compare URL will be provided.`),{prError:{status:d,message:h}}}}async function X9s(t,e,n,r,s){let i=t.context.repo.owner,o=t.context.repo.repo;V0(t).debug("Creating pull request...");let c=await t.octokit.rest.pulls.create({owner:i,repo:o,title:e,body:n,base:r,head:s});return{number:c.data.number,url:c.data.html_url,headRef:c.data.head.ref,baseRef:c.data.base.ref}}async function lut(t,e){let{title:n,body:r,base:s,dryRun:i}=e,o=V0(t);L4n(e);let a=t.branchNameTemplate??"",c=D4n(t,n,a);P4n(c),o.debug(`Title: ${n}`),o.debug(`Auto-generated branch: ${c}`),o.debug(`Base: ${s??"default"}`),o.debug(`DryRun: ${i??!1}`);let u=await O4n(t,s),l=M4n(t,r);if(i){let d=F4n(n,l,u,c);return o.debug(d),Q4n(d,c,u)}o.debug("Preparing branch and changes via git CLI...");try{let d=await J9s(t,u,c,n,l,o);if(d.pr){let h=cut(d.pr);return o.info(`SUCCESS: ${h}`),U4n(d.pr)}if(d.prError){let h=W4n(t,u,c),m=q4n(u,c,h,d.prError.message);return o.info(`PARTIAL SUCCESS: ${m}`),H4n(m,c,u,h)}throw new Error("prepareBranchAndCreatePR returned neither pr nor prError")}catch(d){throw new Error($4n(d))}}p();async function Z9s(t,e,n){let r=t.context.repo.owner,s=t.context.repo.repo,i=V0(t),o={};return n.title!==void 0&&(o.title=n.title),n.body!==void 0&&(o.body=n.body),Object.keys(o).length===0?{titleUpdated:!1,bodyUpdated:!1}:(i.debug(`Updating PR #${e} metadata...`),await t.octokit.rest.pulls.update({owner:r,repo:s,pull_number:e,...o}),{titleUpdated:n.title!==void 0,bodyUpdated:n.body!==void 0})}function V4n(t){if(t.title!==void 0&&t.title.length>tj)throw new Error(`Pull request title exceeds maximum length of ${tj} characters (got ${t.title.length})`);let{title:e,body:n,message:r,pull_number:s}=t;if(!(e!==void 0||n!==void 0||r!==void 0)&&!(s!==void 0))throw new Error("At least one update parameter (title, body, message, or pull_number) must be provided")}function j4n(t,e){let n=e??t.context.issue?.number;if(!n)throw new Error("Pull request number not provided and not available in context. Please provide pull_number parameter or run this action in the context of a pull request.");return n}async function Y4n(t,e){let n=t.context.repo.owner,r=t.context.repo.repo;V0(t).debug(`Fetching PR #${e}...`);let i=await t.octokit.rest.pulls.get({owner:n,repo:r,pull_number:e});if(i.status!==200||!i.data)throw new Error(`Could not fetch pull request #${e}. Please verify the pull request number is correct and that you have access to this repository.`);return{headBranch:i.data.head.ref,baseBranch:i.data.base.ref,headSha:i.data.head.sha,prUrl:i.data.html_url}}function K4n(t){let{pullNumber:e,title:n,body:r,headBranch:s,baseBranch:i,prUrl:o,changedFiles:a,deletedFiles:c}=t,u=[`[DRY RUN] Would update pull request #${e}:`];return n!==void 0&&u.push(`- Title: ${n}`),r!==void 0&&u.push(`- Body: ${r}`),u.push(`- Head branch: ${s}`),u.push(`- Base branch: ${i}`),u.push(...z4n(a,c)),{content:[{type:"text",text:u.join(` -`)}],details:{pullRequestNumber:e,pullRequestUrl:o,headBranch:s,baseBranch:i,dryRun:!0}}}function z4n(t,e){if(t.length===0&&e.length===0)return["- No code changes detected"];let n=["- Code changes:"];return t.length>0&&n.push(` - ${t.length} modified/new file(s)`),e.length>0&&n.push(` - ${e.length} deleted file(s)`),n}function J4n(t,e,n,r){if(t)return t;let s=[];return e.length>0&&s.push(`${e.length} modified/new file(s)`),n.length>0&&s.push(`${n.length} deleted file(s)`),`Update PR #${r}: ${s.join(", ")}`}function X4n(t){let{pullNumber:e,prUrl:n,commitSha:r,titleUpdated:s,bodyUpdated:i}=t,o=[`Pull request #${e} updated: ${n}`];return r&&o.push(`- New commit: ${r}`),s&&o.push("- Title updated"),i&&o.push("- Description updated"),{content:[{type:"text",text:o.join(` -`)}],details:Z4n(t)}}function Z4n(t){let{pullNumber:e,prUrl:n,headBranch:r,baseBranch:s,commitSha:i,titleUpdated:o,bodyUpdated:a}=t,c={pullRequestNumber:e,pullRequestUrl:n,headBranch:r,baseBranch:s,dryRun:!1};return i!==void 0&&(c.commitSha=i),o&&(c.titleUpdated=o),a&&(c.bodyUpdated=a),c}async function eVn(t,e){let{changedPaths:n,deletedPaths:r,headBranch:s,message:i,pullNumber:o,log:a}=e;if(n.length===0&&r.length===0){a.info("No code changes detected, only updating PR metadata if provided");return}let c=dj(t,J4n(i,n,r,o)),u=await hj({cwd:t.context.workspace,branchName:s,message:c,isNewBranch:!1,paths:[...n,...r],actor:t.context.actor,gitIdentityOptions:{platformType:t.platformType,serverUrl:t.context.serverUrl},log:a});return a.info(`Created new commit ${u} on branch ${s}`),u}function tVn(t,e,n){let{title:r,body:s,dryRun:i}=e;t.debug(`PR Number: ${n}`),t.debug(`Title: ${r??"(no change)"}`),t.debug(`Body: ${s?"(provided)":"(no change)"}`),t.debug(`DryRun: ${i??!1}`)}function nVn(t,e){t.debug(`PR found: ${e.prUrl}`),t.debug(`Head branch: ${e.headBranch}`),t.debug(`Base branch: ${e.baseBranch}`),t.debug(`Head SHA: ${e.headSha}`)}async function rVn(t,e,n,r,s){if(n===void 0&&r===void 0)return{titleUpdated:!1,bodyUpdated:!1};let i={};n!==void 0&&(i.title=n),r!==void 0&&(i.body=r);let o=await Z9s(t,e,i);return o.titleUpdated&&s.info(`Updated PR title to: ${n}`),o.bodyUpdated&&s.info("Updated PR description"),o}async function uut(t,e){let{title:n,body:r,message:s,dryRun:i}=e,o=V0(t);V4n(e);let a=j4n(t,e.pull_number);tVn(o,e,a);let{headBranch:c,baseBranch:u,headSha:l,prUrl:d}=await Y4n(t,a);nVn(o,{prUrl:d,headBranch:c,baseBranch:u,headSha:l});let{changed:h,deleted:m}=await pj(t.context.workspace);if(i){let b=K4n({pullNumber:a,title:n,body:r,headBranch:c,baseBranch:u,prUrl:d,changedFiles:h,deletedFiles:m});return o.debug(b.content[0].text),b}let f=await eVn(t,{changedPaths:h,deletedPaths:m,headBranch:c,message:s,pullNumber:a,log:o}),{titleUpdated:g,bodyUpdated:A}=await rVn(t,a,n,r,o),y=X4n({pullNumber:a,prUrl:d,headBranch:c,baseBranch:u,commitSha:f,titleUpdated:g,bodyUpdated:A});return o.info(`SUCCESS: ${y.content[0].text}`),y}p();var eKs=new Set(["COMMENT","APPROVE","REQUEST_CHANGES"]);function sVn(t,e){if(!t.path||t.path.trim()==="")throw new Error(`Comment at index ${e}: "path" is required and cannot be empty`);if(!t.body||t.body.trim()==="")throw new Error(`Comment at index ${e}: "body" is required and cannot be empty`);if(typeof t.line!="number"||!Number.isInteger(t.line)||t.line<1)throw new Error(`Comment at index ${e}: "line" must be a positive integer`);if(t.start_line!==void 0){if(!Number.isInteger(t.start_line)||t.start_line<1)throw new Error(`Comment at index ${e}: "start_line" must be a positive integer`);if(t.start_line>t.line)throw new Error(`Comment at index ${e}: "start_line" (${t.start_line}) must be <= "line" (${t.line})`)}}function iVn(t){if(t&&!eKs.has(t))throw new Error(`Invalid event "${t}". Must be one of: COMMENT, APPROVE, REQUEST_CHANGES`)}function oVn(t){let e=t.comments.length>0,n=typeof t.body=="string"&&t.body.trim()!=="";if(!e&&!n)throw new Error("At least one inline comment or a non-empty review body is required to create a review");t.comments.forEach((r,s)=>sVn(r,s)),iVn(t.event)}function aVn(t){let e={path:t.path,line:t.line,side:t.side??"RIGHT",body:t.body};return t.start_line!==void 0&&(e.start_line=t.start_line,e.start_side=t.start_side??t.side??"RIGHT"),e}async function dut(t,e){oVn(e);let n=e.pull_number??t.context.issue.number;if(!n)throw new Error("Pull request number not provided and not available in context. Please provide pull_number parameter or run this action in the context of a pull request.");let r=t.context.repo.owner,s=t.context.repo.repo,i=e.event??"COMMENT",o=e.body??"";t.logger.debug(`Creating review on PR #${n} with ${e.comments.length} comment(s), event=${i}`);let a=e.comments.map(aVn),c=await t.octokit.rest.pulls.createReview({owner:r,repo:s,pull_number:n,body:o,event:i,comments:a}),u=c.data.id,l=c.data.html_url,d=e.comments.length,h=[`Review created on PR #${n}: ${l}`,`- Event: ${i}`,`- Inline comments: ${d}`].join(` -`);return t.logger.debug(`SUCCESS: ${h}`),{content:[{type:"text",text:h}],details:{reviewId:u,reviewUrl:l,pullRequestNumber:n,event:i,commentCount:d}}}p();function tKs(t,e){let{owner:n,repo:r,issue_number:s,max_comments:i=alt}=e??{},o=n??t.context.repo.owner,a=r??t.context.repo.repo,c=s??t.context.issue.number;if(!o||!a||!c){t.logger.debug("[getIssueOrPRThread] Missing owner, repo, or issue_number");return}return{owner:o,repo:a,issueNumber:c,maxComments:i}}async function nKs(t,e,n,r){let i=(await t.octokit.rest.issues.get({owner:e,repo:n,issue_number:r})).data,o=i.pull_request!==void 0;return{issue:i,isPullRequest:o}}async function rKs(t,e,n,r){try{return(await t.octokit.rest.pulls.get({owner:e,repo:n,pull_number:r})).data}catch{t.logger.debug("[getIssueOrPRThread] Failed to fetch PR data, continuing");return}}function sKs(t,e){let n=t.context.payload.comment?.id??t.context.payload.review?.id,r={id:e.id,author:e.user?.login??"unknown",author_type:e.user?.type==="Bot"?"bot":"user",created_at:e.created_at,body:rv(e.body??""),is_triggering_comment:e.id===n};return e.updated_at!==null&&(r.updated_at=e.updated_at),r}async function cVn(t,e,n,r,s){let i=[],o=1,a=Math.min(s,alt);for(;i.length=s)break;i.push(sKs(t,u))}if(c.data.length=s)break;i.push(lVn(u))}if(c.data.lengthtypeof i=="string"?i:i.name??""),is_pull_request:e,head_branch:n?.head.ref,base_branch:n?.base.ref,head_sha:n?.head.sha,comments:r??[],review_comments:s??[]}}async function put(t,e){let n=tKs(t,e);if(!n)return;let{owner:r,repo:s,issueNumber:i,maxComments:o}=n;try{let{issue:a,isPullRequest:c}=await nKs(t,r,s,i),u=c?await rKs(t,r,s,i):void 0,l=[],d;if(c){let[h,m]=await Promise.all([cVn(t,r,s,i,o),iKs(t,r,s,i)]);d=h,l=m}else d=await cVn(t,r,s,i,o);return aKs(a,c,u,d,l)}catch(a){if(a instanceof Error&&"status"in a&&a.status===404){t.logger.debug(`[getIssueOrPRThread] Issue/PR #${i} not found`);return}throw a}}p();function uVn(t,e){let n=t.replace(/^[ab]\//,"");return e.some(r=>r.endsWith("/")?n.startsWith(r):n===r||n.startsWith(r+"/"))}function dVn(t,e,n){if(!n||n.length===0)return e;let r="diff --git ",s=e.split(r),i=s[0],o=s.slice(1),a=[];for(let u of o){let l=u.indexOf(` -`),d=l===-1?u:u.slice(0,l),m=d.match(/^(a\/.+?)\s+b\//)?.[1]??d;uVn(m,n)||a.push(r+u)}let c=i+a.join("");return c!==e&&t.logger.debug(`[filterDiffByIgnoreFiles] Filtered diff: ${e.length} -> ${c.length} bytes`),c}async function hut(t,e,n,r,s){let o=(await t.octokit.rest.pulls.get({owner:e,repo:n,pull_number:r,mediaType:{format:"diff"}})).data;return o?(s&&s.length>0&&(o=dVn(t,o,s)),o):""}p();p();function mj(t,e){if(t==="completed")switch(e){case"success":return"\u2705";case"failure":return"\u274C";case"cancelled":return"\u26D4";default:return"\u26A0\uFE0F"}return t==="in_progress"?"\u{1F504}":"\u23F3"}var cKs=50,lKs=50;async function uKs(t,e,n,r){return r.ref?r.ref:r.pull_number?(await t.octokit.rest.pulls.get({owner:e,repo:n,pull_number:r.pull_number})).data.head.sha:t.context.sha??void 0}async function dKs(t,e,n,r,s,i){let a=(await t.octokit.rest.checks.listForRef({owner:e,repo:n,ref:r,per_page:cKs,...s?{status:s}:{},...i?{filter:"all"}:{}})).data.check_runs.map(c=>({id:c.id,name:c.name,status:c.status,conclusion:c.conclusion??null,started_at:c.started_at??null,completed_at:c.completed_at??null,html_url:c.html_url,details_url:c.details_url??null}));return i&&(a=a.filter(c=>c.conclusion===i)),a}async function pKs(t,e,n,r,s,i){let a=(await t.octokit.rest.actions.listWorkflowRunsForRepo({owner:e,repo:n,head_sha:r,per_page:lKs,...s?{status:s}:{}})).data.workflow_runs.map(c=>({id:c.id,name:c.name??c.path?.split("/").pop()??"unknown",status:c.status??"unknown",conclusion:c.conclusion??null,started_at:c.run_started_at??c.created_at??null,html_url:c.html_url,head_branch:c.head_branch??"",head_sha:c.head_sha??"",event:c.event}));return i&&(a=a.filter(c=>c.conclusion===i)),a}function pVn(t,e,n){let r=[`CI Status for ${t}:`,""];if(e.length>0){r.push(`Check Runs (${e.length}):`);for(let s of e){let i=mj(s.status,s.conclusion);r.push(` ${i} ${s.name}: ${s.status}${s.conclusion?` (${s.conclusion})`:""}`),s.details_url&&r.push(` ${s.details_url}`)}r.push("")}if(n.length>0){r.push(`Workflow Runs (${n.length}):`);for(let s of n){let i=mj(s.status,s.conclusion);r.push(` ${i} ${s.name} [${s.event}]: ${s.status}${s.conclusion?` (${s.conclusion})`:""}`),r.push(` Run ID: ${s.id} \xB7 ${s.html_url}`)}r.push("")}return e.length===0&&n.length===0&&r.push("No check runs or workflow runs found for this ref."),r}async function mut(t,e){let n=e.owner??t.context.repo.owner,r=e.repo??t.context.repo.repo,s=await uKs(t,n,r,e);if(!s)return{content:[{type:"text",text:"Could not resolve ref: provide a pull_number, ref, or run in a PR context."}],details:{ref:"",check_runs:[],workflow_runs:[]}};t.logger.debug(`[getCIStatus] Fetching CI status for ref: ${s}`);let[i,o]=await Promise.all([dKs(t,n,r,s,e.status,e.conclusion),pKs(t,n,r,s,e.status,e.conclusion)]),a=s.length>8?s.substring(0,8):s;return{content:[{type:"text",text:pVn(a,i,o).join(` -`)}],details:{ref:s,check_runs:i,workflow_runs:o}}}p();var mVn=51200,fVn=1048576,hVn=`... (truncated) -`,hKs="(log unavailable: ",mKs="(log truncated \u2014 byte budget exhausted)";function fKs(t){return t.map(e=>({id:e.id,name:e.name,status:e.status??"unknown",conclusion:e.conclusion??null,started_at:e.started_at??null,completed_at:e.completed_at??null,log:"",truncated:!1}))}function gKs(t,e){let n=Math.min(e??mVn,fVn);return t<=0?n:Math.floor(n/t)}function AKs(t,e){if(Buffer.byteLength(t,"utf8")<=e)return{text:t,truncated:!1};let r=Buffer.byteLength(hVn,"utf8"),s=Math.max(e-r,0),i=Buffer.from(t,"utf8"),o=Math.max(i.length-s,0);for(;o0&&(a=a.slice(c+1)),{text:hVn+a,truncated:!0}}function yKs(t,e){let n=[`Workflow Run #${t} \u2014 Job Logs:`,""];for(let r of e){let s=mj(r.conclusion?"completed":r.status,r.conclusion);n.push(`--- ${s} Job: ${r.name} (${r.conclusion??r.status}) ---`),r.log&&n.push(r.log),n.push("")}return n.join(` -`)}async function EKs(t,e,n,r,s){if(s<=0)return{log:mKs,truncated:!0};let i;try{let c=await t.octokit.rest.actions.downloadJobLogsForWorkflowRun({owner:e,repo:n,job_id:r.id});i=typeof c.data=="string"?c.data:JSON.stringify(c.data)}catch(c){return{log:`${hKs}${c instanceof Error?c.message:"unknown error"})`,truncated:!1}}let{text:o,truncated:a}=AKs(i,s);return{log:o,truncated:a}}async function fut(t,e){let n=e.owner??t.context.repo.owner,r=e.repo??t.context.repo.repo,s=Math.min(e.max_bytes??mVn,fVn);t.logger.debug(`[getWorkflowRunLogs] Fetching logs for run ${e.run_id}`);let i=await t.octokit.rest.actions.listJobsForWorkflowRun({owner:n,repo:r,run_id:e.run_id,per_page:100}),o=fKs(i.data.jobs);if(o.length===0)return{content:[{type:"text",text:`No jobs found for workflow run ${e.run_id}.`}],details:{run_id:e.run_id,jobs:[],total_bytes:0,truncated:!1}};let a=gKs(o.length,e.max_bytes),c=0,u=!1;for(let d of o){let h=s-c,m=Math.max(Math.min(a,h),0),f=await EKs(t,n,r,d,m);d.log=f.log,d.truncated=f.truncated,c+=Buffer.byteLength(f.log,"utf8"),f.truncated&&(u=!0)}return{content:[{type:"text",text:yKs(e.run_id,o)}],details:{run_id:e.run_id,jobs:o,total_bytes:c,truncated:u}}}p();p();function gut(t,e){let n=(t??"").trim().toLowerCase();return n===""||n==="github"?"github":n==="forgejo"||n==="gitea"?"forgejo":n==="codeberg"?"codeberg":(e&&e(t??""),"github")}function Aut(t,e){if(!t)throw new Error("apiBaseUrlFromServerUrl requires a server URL, got an empty string.");let n=t.replace(/\/$/,"");if(e==="forgejo"||e==="codeberg")return`${n}/api/v1`;if(n!=="https://github.com"&&!n.endsWith(".github.com"))return n.includes("codeberg")||n.includes("forgejo")||n.includes("gitea")?`${n}/api/v1`:`${n}/api/v3`}function yut(t){let e=t.platformType,n=T3n(t.context),r=t.logger,s=t.octokit;n!==t.context&&r.debug(`[createGitHubPlatformProvider] Recovered missing context from event payload: ${n.repo.owner}/${n.repo.repo}#${n.issue.number}`);let i=t?.trigger,o={octokit:s,context:n,logger:r,platformType:e,...i!==void 0?{trigger:i}:{},...t.branchNameTemplate!==void 0?{branchNameTemplate:t.branchNameTemplate}:{},...t.updateComment!==void 0?{updateComment:t.updateComment}:{}};return{type:e,getContext(){return n},async addReaction(){return Ere(o)},async deleteReaction(a){await bre(o,a)},async createFinalComment(a,c){await _re(o,a,c)},async getPrompt(a){return yre(o,a)},getStartTime(){return Are(o)},async createPullRequest(a){return lut(o,a)},async updatePullRequest(a){return uut(o,a)},async getIssueOrPRThread(a){return put(o,a)},async getPRDiff(a,c,u,l){return hut(o,a,c,u,l)},async createReview(a){return dut(o,a)},async getCIStatus(a){return mut(o,a)},async getWorkflowRunLogs(a){return fut(o,a)}}}var _Re=class{constructor(e,n,r,s,i){this.core=e;this.deps={octokit:n,context:r,logger:e,...s!==void 0?{platformType:s}:{},...i!==void 0?{updateComment:i}:{}}}core;deps;async addReaction(){return Ere(this.deps)}async deleteReaction(e){await bre(this.deps,e)}async createFinalComment(e,n){await _re(this.deps,e,n)}async getPrompt(e){return yre(this.deps,e)}getStartTime(){return Are(this.deps)}};p();var gVn=(t,e,n)=>{let r={onThinkingDelta:i=>process.stdout.write(i),onThinkingComplete:()=>process.stdout.write(` +${n}`}function DEr(t,e,n,r,i){return{content:[{type:"text",text:t}],details:{pullRequestNumber:0,pullRequestUrl:"",headBranch:e,baseBranch:n,dryRun:!1,prCreated:!1,compareUrl:r,...i?{forkOwner:i.owner,forkRepo:i.repo}:{}}}}async function uks(t){let e=hh(t),{owner:n,repo:r}=t.context.repo,i=await FOe(t);if(i===n){e.debug(`Authenticated user "${i}" owns "${n}/${r}" \u2014 a user cannot fork their own repository, so the branch will be pushed to the repository itself.`);return}if(await QOe(t)){e.debug(`Authenticated user "${i}" can push to "${n}/${r}" \u2014 no fork needed; the branch will be pushed to the repository itself.`);return}let s=await UOe(t,i);if(s.created){let o=await nCt(t,void 0);await GOe(t,s,o)||e.warning(`Fork "${s.owner}/${s.repo}" did not report a default branch in time \u2014 attempting the push anyway.`)}return e.debug(`Opening the pull request from fork "${s.owner}/${s.repo}".`),s}async function dks(t,e,n,r,i,s,o){let a=t.context.workspace;o.debug(`Checking for changes in workspace "${a}"...`);let{changed:c,deleted:u}=await u6(a);if(c.length===0&&u.length===0)throw new Error("No changes detected. Please add new files and/or make your changes before creating a pull request.");let l=r?{name:pOe,url:await p6(a,r,t.context.serverUrl)}:void 0,d=l6(t,i);o.debug(`Creating branch "${n}", committing, and pushing via git CLI...`),l&&o.debug(`Using remote ${l.name} pointing to ${l.url}`),await d6({cwd:a,branchName:n,message:d,isNewBranch:!0,paths:[...c,...u],actor:t.context.actor,gitIdentityOptions:{platformType:t.platformType,serverUrl:t.context.serverUrl},log:o,...l?{remote:l}:{}});let m=l?`${l.name}/${n}`:`origin/${n}`;o.debug(`Branch "${n}" created and pushed to ${m} successfully`);try{return{pr:await pks(t,i,s,e,n,r),...r?{fork:r}:{}}}catch(h){let f=kEr(h),g=h instanceof Error?h.message:String(h);if(f!==401&&f!==403&&f!==404)throw o.debug(`PR creation failed with HTTP ${f??"unknown"} (not a permission error) \u2014 re-throwing after branch "${n}" was pushed.`),h;return o.warning(`PR creation failed after branch "${n}" was pushed (HTTP ${f}): ${g}. The branch is ready \u2014 a compare URL will be provided.`),{prError:{status:f,message:g},...r?{fork:r}:{}}}}async function pks(t,e,n,r,i,s){let o=t.context.repo.owner,a=t.context.repo.repo,c=hh(t),u=s?`${s.owner}:${i}`:i;c.debug(`Creating pull request (head: ${u})...`);let l=await t.octokit.rest.pulls.create({owner:o,repo:a,title:e,body:n,base:r,head:u});return{number:l.data.number,url:l.data.html_url,headRef:l.data.head.ref,baseRef:l.data.base.ref}}async function iCt(t,e){let{title:n,body:r,base:i,dryRun:s}=e,o=hh(t);IEr(e);let a=t.branchNameTemplate??"",c=_Er(t,n,a);SEr(c),o.debug(`Title: ${n}`),o.debug(`Auto-generated branch: ${c}`),o.debug(`Base: ${i??"default"}`),o.debug(`DryRun: ${s??!1}`);let u=await nCt(t,i),l=CEr(t,r);if(s){let m=wEr(n,l,u,c);return o.debug(m),TEr(m,c,u)}let d=await uks(t);o.debug("Preparing branch and changes via git CLI...");try{let m=await dks(t,u,c,d,n,l,o);if(m.pr){let h=rCt(m.pr);return o.info(`SUCCESS: ${h}`),vEr(m.pr,d)}if(m.prError){let h=d?`${d.owner}:${c}`:c,f=BEr(t,u,h),g=NEr(u,c,f,m.prError.message);return o.info(`PARTIAL SUCCESS: ${g}`),DEr(g,c,u,f,d)}throw new Error("prepareBranchAndCreatePR returned neither pr nor prError")}catch(m){throw new Error(REr(m))}}p();async function mks(t,e,n){let r=t.context.repo.owner,i=t.context.repo.repo,s=hh(t),o={};return n.title!==void 0&&(o.title=n.title),n.body!==void 0&&(o.body=n.body),Object.keys(o).length===0?{titleUpdated:!1,bodyUpdated:!1}:(s.debug(`Updating PR #${e} metadata...`),await t.octokit.rest.pulls.update({owner:r,repo:i,pull_number:e,...o}),{titleUpdated:n.title!==void 0,bodyUpdated:n.body!==void 0})}function PEr(t){if(t.title!==void 0&&t.title.length>Z9)throw new Error(`Pull request title exceeds maximum length of ${Z9} characters (got ${t.title.length})`);let{title:e,body:n,message:r,pull_number:i}=t;if(!(e!==void 0||n!==void 0||r!==void 0)&&!(i!==void 0))throw new Error("At least one update parameter (title, body, message, or pull_number) must be provided")}function MEr(t,e){let n=e??t.context.issue?.number;if(!n)throw new Error("Pull request number not provided and not available in context. Please provide pull_number parameter or run this action in the context of a pull request.");return n}async function OEr(t,e){let n=t.context.repo.owner,r=t.context.repo.repo;hh(t).debug(`Fetching PR #${e}...`);let s=await t.octokit.rest.pulls.get({owner:n,repo:r,pull_number:e});if(s.status!==200||!s.data)throw new Error(`Could not fetch pull request #${e}. Please verify the pull request number is correct and that you have access to this repository.`);let o=s.data.head.repo,a=o?.owner?.login&&o?.name?{owner:o.owner.login,repo:o.name}:void 0;return{headBranch:s.data.head.ref,baseBranch:s.data.base.ref,headSha:s.data.head.sha,prUrl:s.data.html_url,...a?{headRepo:a}:{}}}function LEr(t){let{pullNumber:e,title:n,body:r,headBranch:i,baseBranch:s,prUrl:o,changedFiles:a,deletedFiles:c}=t,u=[`[DRY RUN] Would update pull request #${e}:`];return n!==void 0&&u.push(`- Title: ${n}`),r!==void 0&&u.push(`- Body: ${r}`),u.push(`- Head branch: ${i}`),u.push(`- Base branch: ${s}`),u.push(...FEr(a,c)),{content:[{type:"text",text:u.join(` +`)}],details:{pullRequestNumber:e,pullRequestUrl:o,headBranch:i,baseBranch:s,dryRun:!0}}}function FEr(t,e){if(t.length===0&&e.length===0)return["- No code changes detected"];let n=["- Code changes:"];return t.length>0&&n.push(` - ${t.length} modified/new file(s)`),e.length>0&&n.push(` - ${e.length} deleted file(s)`),n}function QEr(t,e,n,r){if(t)return t;let i=[];return e.length>0&&i.push(`${e.length} modified/new file(s)`),n.length>0&&i.push(`${n.length} deleted file(s)`),`Update PR #${r}: ${i.join(", ")}`}function UEr(t){let{pullNumber:e,prUrl:n,commitSha:r,titleUpdated:i,bodyUpdated:s}=t,o=[`Pull request #${e} updated: ${n}`];return r&&o.push(`- New commit: ${r}`),i&&o.push("- Title updated"),s&&o.push("- Description updated"),{content:[{type:"text",text:o.join(` +`)}],details:GEr(t)}}function GEr(t){let{pullNumber:e,prUrl:n,headBranch:r,baseBranch:i,commitSha:s,titleUpdated:o,bodyUpdated:a}=t,c={pullRequestNumber:e,pullRequestUrl:n,headBranch:r,baseBranch:i,dryRun:!1};return s!==void 0&&(c.commitSha=s),o&&(c.titleUpdated=o),a&&(c.bodyUpdated=a),c}async function $Er(t,e){let{changedPaths:n,deletedPaths:r,headBranch:i,message:s,pullNumber:o,log:a,remote:c}=e;if(n.length===0&&r.length===0){a.info("No code changes detected, only updating PR metadata if provided");return}let u=l6(t,QEr(s,n,r,o)),l=await d6({cwd:t.context.workspace,branchName:i,message:u,isNewBranch:!1,paths:[...n,...r],actor:t.context.actor,gitIdentityOptions:{platformType:t.platformType,serverUrl:t.context.serverUrl},log:a,...c?{remote:c}:{}});return a.info(`Created new commit ${l} on branch ${i}`),l}function WEr(t,e,n){let{title:r,body:i,dryRun:s}=e;t.debug(`PR Number: ${n}`),t.debug(`Title: ${r??"(no change)"}`),t.debug(`Body: ${i?"(provided)":"(no change)"}`),t.debug(`DryRun: ${s??!1}`)}function HEr(t,e){t.debug(`PR found: ${e.prUrl}`),t.debug(`Head branch: ${e.headBranch}`),t.debug(`Base branch: ${e.baseBranch}`),t.debug(`Head SHA: ${e.headSha}`)}async function qEr(t,e,n,r,i){if(n===void 0&&r===void 0)return{titleUpdated:!1,bodyUpdated:!1};let s={};n!==void 0&&(s.title=n),r!==void 0&&(s.body=r);let o=await mks(t,e,s);return o.titleUpdated&&i.info(`Updated PR title to: ${n}`),o.bodyUpdated&&i.info("Updated PR description"),o}async function sCt(t,e){let{title:n,body:r,message:i,dryRun:s}=e,o=hh(t);PEr(e);let a=MEr(t,e.pull_number);WEr(o,e,a);let{headBranch:c,baseBranch:u,headSha:l,prUrl:d,headRepo:m}=await OEr(t,a);HEr(o,{prUrl:d,headBranch:c,baseBranch:u,headSha:l});let{changed:h,deleted:f}=await u6(t.context.workspace);if(s){let C=LEr({pullNumber:a,title:n,body:r,headBranch:c,baseBranch:u,prUrl:d,changedFiles:h,deletedFiles:f});return o.debug(C.content[0].text),C}let g;m!==void 0&&(m.owner!==t.context.repo.owner||m.repo!==t.context.repo.repo)&&m&&(g={name:pOe,url:await p6(t.context.workspace,m,t.context.serverUrl)},o.debug(`PR #${a} head branch "${c}" lives in fork "${m.owner}/${m.repo}" \u2014 pushing updates to ${g.name}.`));let y=await $Er(t,{changedPaths:h,deletedPaths:f,headBranch:c,message:i,pullNumber:a,log:o,...g?{remote:g}:{}}),{titleUpdated:E,bodyUpdated:_}=await qEr(t,a,n,r,o),S=UEr({pullNumber:a,prUrl:d,headBranch:c,baseBranch:u,commitSha:y,titleUpdated:E,bodyUpdated:_});return o.info(`SUCCESS: ${S.content[0].text}`),S}p();var hks=new Set(["COMMENT","APPROVE","REQUEST_CHANGES"]);function jEr(t,e){if(!t.path||t.path.trim()==="")throw new Error(`Comment at index ${e}: "path" is required and cannot be empty`);if(!t.body||t.body.trim()==="")throw new Error(`Comment at index ${e}: "body" is required and cannot be empty`);if(typeof t.line!="number"||!Number.isInteger(t.line)||t.line<1)throw new Error(`Comment at index ${e}: "line" must be a positive integer`);if(t.start_line!==void 0){if(!Number.isInteger(t.start_line)||t.start_line<1)throw new Error(`Comment at index ${e}: "start_line" must be a positive integer`);if(t.start_line>t.line)throw new Error(`Comment at index ${e}: "start_line" (${t.start_line}) must be <= "line" (${t.line})`)}}function VEr(t){if(t&&!hks.has(t))throw new Error(`Invalid event "${t}". Must be one of: COMMENT, APPROVE, REQUEST_CHANGES`)}function YEr(t){let e=t.comments.length>0,n=typeof t.body=="string"&&t.body.trim()!=="";if(!e&&!n)throw new Error("At least one inline comment or a non-empty review body is required to create a review");t.comments.forEach((r,i)=>jEr(r,i)),VEr(t.event)}function zEr(t){let e={path:t.path,line:t.line,side:t.side??"RIGHT",body:t.body};return t.start_line!==void 0&&(e.start_line=t.start_line,e.start_side=t.start_side??t.side??"RIGHT"),e}async function oCt(t,e){YEr(e);let n=e.pull_number??t.context.issue.number;if(!n)throw new Error("Pull request number not provided and not available in context. Please provide pull_number parameter or run this action in the context of a pull request.");let r=t.context.repo.owner,i=t.context.repo.repo,s=e.event??"COMMENT",o=e.body??"";t.logger.debug(`Creating review on PR #${n} with ${e.comments.length} comment(s), event=${s}`);let a=e.comments.map(zEr),c=await t.octokit.rest.pulls.createReview({owner:r,repo:i,pull_number:n,body:o,event:s,comments:a}),u=c.data.id,l=c.data.html_url,d=e.comments.length,m=[`Review created on PR #${n}: ${l}`,`- Event: ${s}`,`- Inline comments: ${d}`].join(` +`);return t.logger.debug(`SUCCESS: ${m}`),{content:[{type:"text",text:m}],details:{reviewId:u,reviewUrl:l,pullRequestNumber:n,event:s,commentCount:d}}}p();function fks(t,e){let{owner:n,repo:r,issue_number:i,max_comments:s=eSt}=e??{},o=n??t.context.repo.owner,a=r??t.context.repo.repo,c=i??t.context.issue.number;if(!o||!a||!c){t.logger.debug("[getIssueOrPRThread] Missing owner, repo, or issue_number");return}return{owner:o,repo:a,issueNumber:c,maxComments:s}}async function gks(t,e,n,r){let s=(await t.octokit.rest.issues.get({owner:e,repo:n,issue_number:r})).data,o=s.pull_request!==void 0;return{issue:s,isPullRequest:o}}async function Aks(t,e,n,r){try{return(await t.octokit.rest.pulls.get({owner:e,repo:n,pull_number:r})).data}catch{t.logger.debug("[getIssueOrPRThread] Failed to fetch PR data, continuing");return}}function yks(t,e){let n=t.context.payload.comment?.id??t.context.payload.review?.id,r={id:e.id,author:e.user?.login??"unknown",author_type:e.user?.type==="Bot"?"bot":"user",created_at:e.created_at,body:Qk(e.body??""),is_triggering_comment:e.id===n};return e.updated_at!==null&&(r.updated_at=e.updated_at),r}async function KEr(t,e,n,r,i){let s=[],o=1,a=Math.min(i,eSt);for(;s.length=i)break;s.push(yks(t,u))}if(c.data.length=i)break;s.push(JEr(u))}if(c.data.lengthtypeof s=="string"?s:s.name??""),is_pull_request:e,head_branch:n?.head.ref,base_branch:n?.base.ref,head_sha:n?.head.sha,comments:r??[],review_comments:i??[]}}async function aCt(t,e){let n=fks(t,e);if(!n)return;let{owner:r,repo:i,issueNumber:s,maxComments:o}=n;try{let{issue:a,isPullRequest:c}=await gks(t,r,i,s),u=c?await Aks(t,r,i,s):void 0,l=[],d;if(c){let[m,h]=await Promise.all([KEr(t,r,i,s,o),Eks(t,r,i,s)]);d=m,l=h}else d=await KEr(t,r,i,s,o);return _ks(a,c,u,d,l)}catch(a){if(a instanceof Error&&"status"in a&&a.status===404){t.logger.debug(`[getIssueOrPRThread] Issue/PR #${s} not found`);return}throw a}}p();function XEr(t,e){let n=t.replace(/^[ab]\//,"");return e.some(r=>r.endsWith("/")?n.startsWith(r):n===r||n.startsWith(r+"/"))}function ZEr(t,e,n){if(!n||n.length===0)return e;let r="diff --git ",i=e.split(r),s=i[0],o=i.slice(1),a=[];for(let u of o){let l=u.indexOf(` +`),d=l===-1?u:u.slice(0,l),h=d.match(/^(a\/.+?)\s+b\//)?.[1]??d;XEr(h,n)||a.push(r+u)}let c=s+a.join("");return c!==e&&t.logger.debug(`[filterDiffByIgnoreFiles] Filtered diff: ${e.length} -> ${c.length} bytes`),c}async function cCt(t,e,n,r,i){let o=(await t.octokit.rest.pulls.get({owner:e,repo:n,pull_number:r,mediaType:{format:"diff"}})).data;return o?(i&&i.length>0&&(o=ZEr(t,o,i)),o):""}p();p();function m6(t,e){if(t==="completed")switch(e){case"success":return"\u2705";case"failure":return"\u274C";case"cancelled":return"\u26D4";default:return"\u26A0\uFE0F"}return t==="in_progress"?"\u{1F504}":"\u23F3"}var xks=50,Sks=50;async function Cks(t,e,n,r){if(r.ref)return r.ref;let s=t.context.payload.issue?.pull_request!==void 0,o=r.pull_number;return!o&&(nle(t)||s)&&(o=t.context.issue.number),o?(await t.octokit.rest.pulls.get({owner:e,repo:n,pull_number:o})).data.head.sha:t.context.sha??void 0}async function Iks(t,e,n,r,i,s){let a=(await t.octokit.rest.checks.listForRef({owner:e,repo:n,ref:r,per_page:xks,...i?{status:i}:{},...s?{filter:"all"}:{}})).data.check_runs.map(c=>({id:c.id,name:c.name,status:c.status,conclusion:c.conclusion??null,started_at:c.started_at??null,completed_at:c.completed_at??null,html_url:c.html_url,details_url:c.details_url??null}));return s&&(a=a.filter(c=>c.conclusion===s)),a}async function wks(t,e,n,r,i,s){let a=(await t.octokit.rest.actions.listWorkflowRunsForRepo({owner:e,repo:n,head_sha:r,per_page:Sks,...i?{status:i}:{}})).data.workflow_runs.map(c=>({id:c.id,name:c.name??c.path?.split("/").pop()??"unknown",status:c.status??"unknown",conclusion:c.conclusion??null,started_at:c.run_started_at??c.created_at??null,html_url:c.html_url,head_branch:c.head_branch??"",head_sha:c.head_sha??"",event:c.event}));return s&&(a=a.filter(c=>c.conclusion===s)),a}function e0r(t,e,n){let r=[`CI Status for ${t}:`,""];if(e.length>0){r.push(`Check Runs (${e.length}):`);for(let i of e){let s=m6(i.status,i.conclusion);r.push(` ${s} ${i.name}: ${i.status}${i.conclusion?` (${i.conclusion})`:""}`),i.details_url&&r.push(` ${i.details_url}`)}r.push("")}if(n.length>0){r.push(`Workflow Runs (${n.length}):`);for(let i of n){let s=m6(i.status,i.conclusion);r.push(` ${s} ${i.name} [${i.event}]: ${i.status}${i.conclusion?` (${i.conclusion})`:""}`),r.push(` Run ID: ${i.id} \xB7 ${i.html_url}`)}r.push("")}return e.length===0&&n.length===0&&r.push("No check runs or workflow runs found for this ref."),r}async function lCt(t,e){let n=e.owner??t.context.repo.owner,r=e.repo??t.context.repo.repo,i=await Cks(t,n,r,e);if(!i)return{content:[{type:"text",text:"Could not resolve ref: provide a pull_number, ref, or run in a PR context."}],details:{ref:"",check_runs:[],workflow_runs:[]}};t.logger.debug(`[getCIStatus] Fetching CI status for ref: ${i}`);let[s,o]=await Promise.all([Iks(t,n,r,i,e.status,e.conclusion),wks(t,n,r,i,e.status,e.conclusion)]),a=i.length>8?i.substring(0,8):i;return{content:[{type:"text",text:e0r(a,s,o).join(` +`)}],details:{ref:i,check_runs:s,workflow_runs:o}}}p();var n0r=51200,r0r=1048576,t0r=`... (truncated) +`,Tks="(log unavailable: ",vks="(log truncated \u2014 byte budget exhausted)";function Rks(t){return t.map(e=>({id:e.id,name:e.name,status:e.status??"unknown",conclusion:e.conclusion??null,started_at:e.started_at??null,completed_at:e.completed_at??null,log:"",truncated:!1}))}function kks(t,e){let n=Math.min(e??n0r,r0r);return t<=0?n:Math.floor(n/t)}function Bks(t,e){if(Buffer.byteLength(t,"utf8")<=e)return{text:t,truncated:!1};let r=Buffer.byteLength(t0r,"utf8"),i=Math.max(e-r,0),s=Buffer.from(t,"utf8"),o=Math.max(s.length-i,0);for(;o0&&(a=a.slice(c+1)),{text:t0r+a,truncated:!0}}function Nks(t,e){let n=[`Workflow Run #${t} \u2014 Job Logs:`,""];for(let r of e){let i=m6(r.conclusion?"completed":r.status,r.conclusion);n.push(`--- ${i} Job: ${r.name} (${r.conclusion??r.status}) ---`),r.log&&n.push(r.log),n.push("")}return n.join(` +`)}async function Dks(t,e,n,r,i){if(i<=0)return{log:vks,truncated:!0};let s;try{let c=await t.octokit.rest.actions.downloadJobLogsForWorkflowRun({owner:e,repo:n,job_id:r.id});s=typeof c.data=="string"?c.data:JSON.stringify(c.data)}catch(c){return{log:`${Tks}${c instanceof Error?c.message:"unknown error"})`,truncated:!1}}let{text:o,truncated:a}=Bks(s,i);return{log:o,truncated:a}}async function uCt(t,e){let n=e.owner??t.context.repo.owner,r=e.repo??t.context.repo.repo,i=Math.min(e.max_bytes??n0r,r0r);t.logger.debug(`[getWorkflowRunLogs] Fetching logs for run ${e.run_id}`);let s=await t.octokit.rest.actions.listJobsForWorkflowRun({owner:n,repo:r,run_id:e.run_id,per_page:100}),o=Rks(s.data.jobs);if(o.length===0)return{content:[{type:"text",text:`No jobs found for workflow run ${e.run_id}.`}],details:{run_id:e.run_id,jobs:[],total_bytes:0,truncated:!1}};let a=kks(o.length,e.max_bytes),c=0,u=!1;for(let d of o){let m=i-c,h=Math.max(Math.min(a,m),0),f=await Dks(t,n,r,d,h);d.log=f.log,d.truncated=f.truncated,c+=Buffer.byteLength(f.log,"utf8"),f.truncated&&(u=!0)}return{content:[{type:"text",text:Nks(e.run_id,o)}],details:{run_id:e.run_id,jobs:o,total_bytes:c,truncated:u}}}p();p();function dCt(t,e){let n=(t??"").trim().toLowerCase();return n===""||n==="github"?"github":n==="forgejo"||n==="gitea"?"forgejo":n==="codeberg"?"codeberg":(e&&e(t??""),"github")}function pCt(t,e){if(!t)throw new Error("apiBaseUrlFromServerUrl requires a server URL, got an empty string.");let n=t.replace(/\/$/,"");if(e==="forgejo"||e==="codeberg")return`${n}/api/v1`;if(n!=="https://github.com"&&!n.endsWith(".github.com"))return n.includes("codeberg")||n.includes("forgejo")||n.includes("gitea")?`${n}/api/v1`:`${n}/api/v3`}function mCt(t){let e=t.platformType,n=ggr(t.context),r=t.logger,i=t.octokit;n!==t.context&&r.debug(`[createGitHubPlatformProvider] Recovered missing context from event payload: ${n.repo.owner}/${n.repo.repo}#${n.issue.number}`);let s=t?.trigger,o={octokit:i,context:n,logger:r,platformType:e,...s!==void 0?{trigger:s}:{},...t.branchNameTemplate!==void 0?{branchNameTemplate:t.branchNameTemplate}:{},...t.updateComment!==void 0?{updateComment:t.updateComment}:{}};return{type:e,getContext(){return n},async addReaction(){return ole(o)},async deleteReaction(a){await ale(o,a)},async createFinalComment(a,c){await cle(o,a,c)},async getPrompt(a){return sle(o,a)},getStartTime(){return ile(o)},async createPullRequest(a){return iCt(o,a)},async updatePullRequest(a){return sCt(o,a)},async getIssueOrPRThread(a){return aCt(o,a)},async getPRDiff(a,c,u,l){return cCt(o,a,c,u,l)},async createReview(a){return oCt(o,a)},async getCIStatus(a){return lCt(o,a)},async getWorkflowRunLogs(a){return uCt(o,a)}}}var $Oe=class{constructor(e,n,r,i,s){this.core=e;this.deps={octokit:n,context:r,logger:e,...i!==void 0?{platformType:i}:{},...s!==void 0?{updateComment:s}:{}}}core;deps;async addReaction(){return ole(this.deps)}async deleteReaction(e){await ale(this.deps,e)}async createFinalComment(e,n){await cle(this.deps,e,n)}async getPrompt(e){return sle(this.deps,e)}getStartTime(){return ile(this.deps)}};p();var i0r=(t,e,n)=>{let r={onThinkingDelta:s=>process.stdout.write(s),onThinkingComplete:()=>process.stdout.write(` `),onPromptComplete:()=>process.stdout.write(` -`)},s=new XV(e,n,t,r);return Vve(s)};p();var bKs='Missing required input: `provider`. Set it to your LLM provider (e.g. "anthropic", "openai", "google"). See https://github.com/shaftoe/pi-coding-agent-action#usage for details.',_Ks='Missing required input: `model`. Set it to the desired model (e.g. "claude-sonnet-4-5", "gpt-4o"). See https://github.com/shaftoe/pi-coding-agent-action#usage for details.';function mQ(t,e){return t?t.toLowerCase()==="true":e}function Eut(t){if(!t)return;let e=parseInt(t,10);return e>0?e:void 0}function AVn(t,e){if(!t)return;let n=t.split(e).map(r=>r.trim()).filter(Boolean);return n.length>0?n:void 0}function SKs(t){let e=t?.trim();if(!e||e.toLowerCase()==="all")return;let n=e.split(` -`).map(r=>r.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:void 0}function CKs(t,e){if(!t)throw new Error(bKs);if(!e)throw new Error(_Ks)}function yVn(){let t=Pc("provider"),e=Pc("model"),n=Pc("token");CKs(t,e),n||_Y("[config] No token provided \u2014 relying on provider-side auth (e.g. ADC)");let r=Pc("prompt"),s=Pc("thinking_level")??"off",i=Pc("base_url")||void 0,o=AVn(Pc("extensions"),` -`),a=AVn(Pc("diff_ignore_patterns"),/\s+/),c=SKs(Pc("loaded_tools")),u=mQ(Pc("load_builtin_extensions"),!0),l=mQ(Pc("export_session_html"),!0),d=mQ(Pc("export_session_jsonl"),!1),h=mQ(Pc("auto_compaction"),!1),m=mQ(Pc("share_session"),!1),f=Pc("share_gist_provider").trim().toLowerCase(),g=f==="opengist"?"opengist":f==="github"?"github":void 0;f&&!g&&toe(`Unknown share_gist_provider "${f}"; falling back to github. Valid values are "github" and "opengist".`);let A=Pc("share_gist_api_url").trim()||void 0,y=Pc("share_gist_token").trim()||void 0;y&&Xie(y);let b=Eut(Pc("diff_max_lines")),S=Eut(Pc("diff_max_bytes")),C=Eut(Pc("pr_number")),I=Pc("github_token")||void 0;return I&&Xie(I),{provider:t,model:e,token:n,thinkingLevel:s,promptInput:r,...o?.length?{extensions:o}:{},loadBuiltinExtensions:u,...c?{loadedTools:c}:{},...i?{baseUrl:i}:{},exportSessionHtml:l,exportSessionJsonl:d,autoCompaction:h,shareSession:m,...g?{shareGistProvider:g}:{},...A?{shareGistApiUrl:A}:{},...y?{shareGistToken:y}:{},...I?{githubToken:I}:{},...b?{diffMaxLines:b}:{},...S?{diffMaxBytes:S}:{},...a?.length?{diffIgnorePatterns:a}:{},...C?{prNumber:C}:{}}}p();var EVn=Gt(require("node:os"),1),bVn=Gt(require("node:path"),1),SRe=class{setOutput(e,n){eoe(e,n)}setFailed(e){CU(e)}getExportDirectory(e){return bVn.join(process.env.RUNNER_TEMP??EVn.tmpdir(),`pi-session-${e}-${process.env.GITHUB_RUN_ID??"local"}`)}async appendSummary(e){await c1e.addRaw(e).write()}};p();var IKs="https://github.com";function _Vn(t){return t.replace(/\/+$/,"")}function CRe(t,e){let n=_Vn(t?.trim()??"");if(n)return n;let r=_Vn(e?.trim()??"");return r||IKs}function xKs(){process.env.PI_PACKAGE_DIR=SVn.join(__dirname,"pi-sdk")}function wKs(){Lqe(EMt)}async function CVn(){xKs(),wKs();let t=new zve,e=yVn(),n=new SRe,r=gut(t.getInput("platform"),I=>t.warning(`Unknown platform "${I}"; falling back to github. Valid values are github, codeberg, forgejo (or gitea).`)),s=CRe(void 0,Wb.serverUrl),i=r==="forgejo"||r==="codeberg"?Aut(s,r):void 0,o=Abt(t.getInput("github_token"),i?{baseUrl:i}:{}),a=Wb,c=e.prNumber,u=c??Wb.issue.number,l={...Wb.payload};c&&(l.pull_request=l.pull_request??{number:c});let d=t.getInput("server_url"),h=CRe(d,Wb.serverUrl),m=CRe(void 0,Wb.serverUrl);h!==m&&t.info(`[run] server_url override active: using ${h} (runner advertises ${m})`);let f={repo:Wb.repo,issue:{number:u},eventName:Wb.eventName,payload:l,serverUrl:h,runId:Wb.runId,runNumber:Wb.runNumber,workspace:process.env.GITHUB_WORKSPACE??process.cwd(),...a.actor!==void 0?{actor:a.actor}:{},...a.sha!==void 0?{sha:a.sha}:{}},g=t.getInput("trigger"),A=t.getInput("branch_name_template"),y=mQ(t.getInput("update_comment"),!1),b=yut({octokit:o,context:f,logger:t,platformType:r,...g?{trigger:g}:{},...A?{branchNameTemplate:A}:{},...y?{updateComment:y}:{}}),S=new _Re(t,o,f,r,y);await new eX(e,t,n,S,gVn,b).execute()}CVn().catch(t=>{console.error("Unhandled error in run():",t),CU(`Unhandled error: ${t instanceof Error?t.message:String(t)}`)});0&&(module.exports={run}); +`)},i=new K9(e,n,t,r);return aOe(i)};p();var o0r=["off","streaming","idle"],Pks='Missing required input: `provider`. Set it to your LLM provider (e.g. "anthropic", "openai", "google"). See https://github.com/shaftoe/pi-coding-agent-action#usage for details.',Mks='Missing required input: `model`. Set it to the desired model (e.g. "claude-sonnet-4-5", "gpt-4o"). See https://github.com/shaftoe/pi-coding-agent-action#usage for details.';function bM(t,e){return t?t.toLowerCase()==="true":e}function hCt(t){if(!t)return;let e=parseInt(t,10);return e>0?e:void 0}function s0r(t,e){if(!t)return;let n=t.split(e).map(r=>r.trim()).filter(Boolean);return n.length>0?n:void 0}function Oks(t){let e=t?.trim();if(!e||e.toLowerCase()==="all")return;let n=e.split(` +`).map(r=>r.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:void 0}function Lks(t){let e=t.trim().toLowerCase();return bwe.includes(e)?e:void 0}function Fks(t){let e=t.trim().toLowerCase();return o0r.includes(e)?e:void 0}function Qks(t,e){if(!t)throw new Error(Pks);if(!e)throw new Error(Mks)}function a0r(){let t=Za("provider"),e=Za("model"),n=Za("token");Qks(t,e),n||bz("[config] No token provided \u2014 relying on provider-side auth (e.g. ADC)");let r=Za("prompt"),i=Za("thinking_level")??"off",s=Za("base_url")||void 0,o=s0r(Za("extensions"),` +`),a=s0r(Za("diff_ignore_patterns"),/\s+/),c=Oks(Za("loaded_tools")),u=bM(Za("load_builtin_extensions"),!0),l=bM(Za("export_session_html"),!0),d=bM(Za("export_session_jsonl"),!1),m=bM(Za("auto_compaction"),!1),h=bM(Za("share_session"),!1),f=bM(Za("refresh_model_catalog"),!0),g=Za("cache_warming"),A=Fks(g);g.trim()&&!A&&V$(`Unknown cache_warming "${g.trim()}". Valid values are: ${o0r.join(", ")}. Falling back to the SDK default ("streaming").`);let y=Za("share_gist_provider").trim().toLowerCase(),E=y==="opengist"?"opengist":y==="github"?"github":void 0;y&&!E&&V$(`Unknown share_gist_provider "${y}"; falling back to github. Valid values are "github" and "opengist".`);let _=Za("share_gist_api_url").trim()||void 0,S=Za("share_gist_token").trim()||void 0;S&&Gde(S);let C=Za("share_gist_expiration"),I=Lks(C);C.trim()&&!I&&V$(`Unknown share_gist_expiration "${C.trim()}"; defaulting to ${_we}. Valid values are: ${bwe.join(", ")}.`);let w=hCt(Za("diff_max_lines")),k=hCt(Za("diff_max_bytes")),N=hCt(Za("pr_number")),O=Za("github_token")||void 0;return O&&Gde(O),{provider:t,model:e,token:n,thinkingLevel:i,promptInput:r,...o?.length?{extensions:o}:{},loadBuiltinExtensions:u,...c?{loadedTools:c}:{},...s?{baseUrl:s}:{},exportSessionHtml:l,exportSessionJsonl:d,autoCompaction:m,...A?{cacheWarming:A}:{},refreshModelCatalog:f,shareSession:h,...E?{shareGistProvider:E}:{},..._?{shareGistApiUrl:_}:{},...S?{shareGistToken:S}:{},...I?{shareGistExpiration:I}:{},...O?{githubToken:O}:{},...w?{diffMaxLines:w}:{},...k?{diffMaxBytes:k}:{},...a?.length?{diffIgnorePatterns:a}:{},...N?{prNumber:N}:{}}}p();var c0r=Ot(require("node:os"),1),l0r=Ot(require("node:path"),1),WOe=class{setOutput(e,n){Wde(e,n)}setFailed(e){j$(e)}getExportDirectory(e){return l0r.join(process.env.RUNNER_TEMP??c0r.tmpdir(),`pi-session-${e}-${process.env.GITHUB_RUN_ID??"local"}`)}async appendSummary(e){await RQe.addRaw(e).write()}};p();var Uks="https://github.com";function u0r(t){return t.replace(/\/+$/,"")}function HOe(t,e){let n=u0r(t?.trim()??"");if(n)return n;let r=u0r(e?.trim()??"");return r||Uks}function Gks(){process.env.PI_PACKAGE_DIR=d0r.join(__dirname,"pi-sdk")}function $ks(){o9e(WYt)}async function p0r(){Gks(),$ks();let t=new dOe,e=a0r(),n=new WOe,r=dCt(t.getInput("platform"),C=>t.warning(`Unknown platform "${C}"; falling back to github. Valid values are github, codeberg, forgejo (or gitea).`)),i=HOe(void 0,k_.serverUrl),s=r==="forgejo"||r==="codeberg"?pCt(i,r):void 0,o=pDt(t.getInput("github_token"),s?{baseUrl:s}:{}),a=k_,c=e.prNumber,u=c??k_.issue.number,l={...k_.payload};c&&(l.pull_request=l.pull_request??{number:c});let d=t.getInput("server_url"),m=HOe(d,k_.serverUrl),h=HOe(void 0,k_.serverUrl);m!==h&&t.info(`[run] server_url override active: using ${m} (runner advertises ${h})`);let f={repo:k_.repo,issue:{number:u},eventName:k_.eventName,payload:l,serverUrl:m,runId:k_.runId,runNumber:k_.runNumber,workspace:process.env.GITHUB_WORKSPACE??process.cwd(),...a.actor!==void 0?{actor:a.actor}:{},...a.sha!==void 0?{sha:a.sha}:{}},g=t.getInput("trigger"),A=t.getInput("branch_name_template"),y=bM(t.getInput("update_comment"),!1),E=mCt({octokit:o,context:f,logger:t,platformType:r,...g?{trigger:g}:{},...A?{branchNameTemplate:A}:{},...y?{updateComment:y}:{}}),_=new $Oe(t,o,f,r,y);await new ore(e,t,n,_,i0r,E).execute()}p0r().catch(t=>{console.error("Unhandled error in run():",t),j$(`Unhandled error: ${t instanceof Error?t.message:String(t)}`)});0&&(module.exports={run}); /*! Bundled license information: undici/lib/web/fetch/body.js: @@ -2452,6 +2484,13 @@ safe-buffer/index.js: * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 *) + (** + * @license + * Copyright 2026 Google LLC + * SPDX-License-Identifier: Apache-2.0 + * + * g3-prettier-ignore-file + *) @octokit/request-error/dist-src/index.js: (* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist *) diff --git a/dist/pi-sdk/dist/core/export-html/template.js b/dist/pi-sdk/dist/core/export-html/template.js index cfdd1612..e4578bfc 100644 --- a/dist/pi-sdk/dist/core/export-html/template.js +++ b/dist/pi-sdk/dist/core/export-html/template.js @@ -357,6 +357,9 @@ case 'thinking_level_change': parts.push('thinking', entry.thinkingLevel); break; + case 'context_edit': + parts.push('context edit', entry.replacement === null ? 'omit' : 'replace', entry.targetId); + break; } return parts.join(' ').toLowerCase(); @@ -385,7 +388,7 @@ } // Apply filter mode - const isSettingsEntry = ['label', 'custom', 'model_change', 'thinking_level_change'].includes(entry.type); + const isSettingsEntry = ['label', 'custom', 'context_edit', 'model_change', 'thinking_level_change'].includes(entry.type); let passesFilter = true; switch (filterMode) { @@ -696,6 +699,8 @@ return labelHtml + `[model: ${escapeHtml(entry.modelId)}]`; case 'thinking_level_change': return labelHtml + `[thinking: ${escapeHtml(entry.thinkingLevel)}]`; + case 'context_edit': + return labelHtml + `[context ${entry.replacement === null ? 'omit' : 'replace'}: ${escapeHtml(entry.targetId)}]`; default: return labelHtml + `[${escapeHtml(entry.type)}]`; } diff --git a/package.json b/package.json index 6c2b2456..f6a1ce80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pi-coding-agent-action", - "version": "2.28.0", + "version": "2.29.1", "private": true, "description": "CI/CD Action to integrate Pi coding agent in workflows", "scripts": { @@ -42,9 +42,9 @@ "dependencies": { "@alexanderfortin/pi-orchestrator": "workspace:*", "@alexanderfortin/pi-platform-github": "workspace:*", - "@earendil-works/pi-agent-core": "^0.85.1", - "@earendil-works/pi-ai": "^0.85.1", - "@earendil-works/pi-coding-agent": "^0.85.1" + "@earendil-works/pi-agent-core": "^0.87.1", + "@earendil-works/pi-ai": "^0.87.1", + "@earendil-works/pi-coding-agent": "^0.87.1" }, "devDependencies": { "@actions/github": "^9.1.1", @@ -65,6 +65,7 @@ "semantic-release": "^25.0.8", "tsx": "^4.20.3", "typescript": "~6.0.3", - "vitest": "^4.1.11" + "vitest": "^4.1.11", + "yaml": "^2.4.0" } } diff --git a/packages/pi-action-bridge/package.json b/packages/pi-action-bridge/package.json index f2704db6..32513b30 100644 --- a/packages/pi-action-bridge/package.json +++ b/packages/pi-action-bridge/package.json @@ -1,7 +1,7 @@ { "name": "@alexanderfortin/pi-action-bridge", "private": true, - "version": "2.28.0", + "version": "2.29.1", "type": "module", "keywords": [ "pi-package" @@ -14,7 +14,7 @@ "simple-git": "^3.36.0" }, "devDependencies": { - "@earendil-works/pi-coding-agent": "^0.85.1", + "@earendil-works/pi-coding-agent": "^0.87.1", "typebox": "^1.3.6" }, "pi": { diff --git a/packages/pi-action/package.json b/packages/pi-action/package.json index 3cdf9587..251d910b 100644 --- a/packages/pi-action/package.json +++ b/packages/pi-action/package.json @@ -1,6 +1,6 @@ { "name": "@alexanderfortin/pi-action", - "version": "2.28.0", + "version": "2.29.1", "private": true, "type": "module", "main": "dist/index.js", @@ -14,9 +14,9 @@ "@actions/github": "^9.1.1", "@alexanderfortin/pi-orchestrator": "workspace:*", "@alexanderfortin/pi-platform-github": "workspace:*", - "@earendil-works/pi-agent-core": "^0.85.1", - "@earendil-works/pi-ai": "^0.85.1", - "@earendil-works/pi-coding-agent": "^0.85.1", + "@earendil-works/pi-agent-core": "^0.87.1", + "@earendil-works/pi-ai": "^0.87.1", + "@earendil-works/pi-coding-agent": "^0.87.1", "@js-temporal/polyfill": "^0.5.1" }, "devDependencies": { diff --git a/packages/pi-action/scripts/package.ts b/packages/pi-action/scripts/package.ts index 8ff33763..2d46bb42 100644 --- a/packages/pi-action/scripts/package.ts +++ b/packages/pi-action/scripts/package.ts @@ -1,5 +1,5 @@ -import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync } from 'node:fs'; -import { build, type Plugin } from 'esbuild'; +import { copyFileSync, existsSync, mkdirSync, rmSync } from 'node:fs'; +import { build } from 'esbuild'; import { join, dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; import { resolvePiSdkPackagePath } from './pi-sdk'; @@ -45,33 +45,14 @@ export { * This patch can be removed once the SDK uses virtual modules for bundled Node * by default. */ -const SDK_LOADER_NODE_BRANCH = /: \{ alias: getAliases\(\) \}\),/; - -/** Apply the bundled Node extension-loader patch to SDK source. */ -export function patchSDKLoaderSource(source: string): string { - const patched = source.replace( - SDK_LOADER_NODE_BRANCH, - ': { virtualModules: VIRTUAL_MODULES, tryNative: false }),' - ); - if (patched === source) { - throw new Error( - '[patch-sdk-loader] Bundled Node extension loader pattern not matched; the SDK may have changed.' - ); - } - return patched; -} - -function patchSDKLoaderPlugin(): Plugin { - return { - name: 'patch-sdk-loader', - setup(build) { - build.onLoad({ filter: /extensions\/loader\.js$/ }, async args => ({ - contents: patchSDKLoaderSource(readFileSync(args.path, 'utf-8')), - loader: 'js', - })); - }, - }; -} +/** + * Since pi-coding-agent 0.86.0 the SDK natively uses virtual modules (and + * `tryNative: false`) for bundled Node builds when the build-time + * `PI_BUNDLED_NODE` define is set — the same mechanism it already used for + * Bun binaries. Defining it here keeps jiti resolving npm extensions' Pi peer + * dependencies against the bundled host runtime instead of the temporary + * installation directory. (Replaces the former source patch of loader.js.) + */ /** * Pi SDK runtime assets that must be copied to `dist/pi-sdk/` because they're @@ -92,11 +73,7 @@ const SDK_ASSETS: ReadonlyArray = [ * Copy a single SDK asset directory, creating the destination as needed and * silently skipping missing source files. Exported for unit testing. */ -export function copySdkAssetDir( - srcDir: string, - destDir: string, - files: readonly string[] -): void { +export function copySdkAssetDir(srcDir: string, destDir: string, files: readonly string[]): void { if (!existsSync(srcDir)) return; mkdirSync(destDir, { recursive: true }); for (const file of files) { @@ -139,11 +116,12 @@ export async function buildDist(cwd: string = process.cwd()): Promise { outfile: join(cwd, 'dist/index.js'), format: 'cjs', minify: true, - plugins: [patchSDKLoaderPlugin()], + plugins: [], define: { 'import.meta.url': 'importMetaUrl', __PI_CODING_AGENT_VERSION__: JSON.stringify(piVersion), __VERSION__: JSON.stringify(version), + PI_BUNDLED_NODE: 'true', }, inject: [join(cwd, 'packages/pi-action/src/import-meta-url.js')], }); diff --git a/packages/pi-action/src/adapters/config.ts b/packages/pi-action/src/adapters/config.ts index a14ae287..cc07284c 100644 --- a/packages/pi-action/src/adapters/config.ts +++ b/packages/pi-action/src/adapters/config.ts @@ -18,7 +18,14 @@ */ import * as core from '@actions/core'; -import type { PiConfig } from '@alexanderfortin/pi-orchestrator'; +import type { OpengistExpiration, PiConfig } from '@alexanderfortin/pi-orchestrator'; +import { + DEFAULT_OPENGIST_EXPIRATION, + OPENGIST_EXPIRATIONS, +} from '@alexanderfortin/pi-orchestrator'; + +/** Valid values for the `cache_warming` input (mirrors the SDK's modes). */ +export const CACHE_WARMING_MODES = ['off', 'streaming', 'idle'] as const; // --------------------------------------------------------------------------- // Error message constants — keep stable; they are part of the public @@ -106,6 +113,35 @@ export function parseLoadedTools(input: string): string[] | undefined { return tools.length > 0 ? [...new Set(tools)] : undefined; } +/** + * Parse the `share_gist_expiration` input into an Opengist TTL preset. + * + * Returns `undefined` for empty input (the provider then applies its 7-day + * default) and for unrecognised values (a warning is emitted by the caller so + * a typo doesn't silently change the TTL). Matching is case-insensitive and + * whitespace-trimmed. + */ +export function parseGistExpiration(raw: string): OpengistExpiration | undefined { + const normalized = raw.trim().toLowerCase(); + return (OPENGIST_EXPIRATIONS as readonly string[]).includes(normalized) + ? (normalized as OpengistExpiration) + : undefined; +} + +/** + * Parse the `cache_warming` input into a prompt cache-warming mode. + * + * Returns `undefined` for empty input (the SDK then applies its default, + * `"streaming"`) and for unrecognised values (a warning is emitted by the + * caller so a typo doesn't silently change behavior). Case-insensitive. + */ +export function parseCacheWarmingMode(raw: string): PiConfig['cacheWarming'] { + const normalized = raw.trim().toLowerCase(); + return (CACHE_WARMING_MODES as readonly string[]).includes(normalized) + ? (normalized as PiConfig['cacheWarming']) + : undefined; +} + // --------------------------------------------------------------------------- // Validation // --------------------------------------------------------------------------- @@ -168,6 +204,18 @@ export function gatherActionsConfig(): PiConfig { const exportSessionJsonl = parseBooleanInput(core.getInput('export_session_jsonl'), false); const autoCompaction = parseBooleanInput(core.getInput('auto_compaction'), false); const shareSession = parseBooleanInput(core.getInput('share_session'), false); + const refreshModelCatalog = parseBooleanInput(core.getInput('refresh_model_catalog'), true); + + // --- Prompt cache warming ----------------------------------------------- + const cacheWarmingRaw = core.getInput('cache_warming'); + const cacheWarming = parseCacheWarmingMode(cacheWarmingRaw); + if (cacheWarmingRaw.trim() && !cacheWarming) { + core.warning( + `Unknown cache_warming "${cacheWarmingRaw.trim()}". ` + + `Valid values are: ${CACHE_WARMING_MODES.join(', ')}. ` + + 'Falling back to the SDK default ("streaming").' + ); + } // --- Session sharing storage backend inputs --------------------------- const shareGistProviderRaw = core.getInput('share_gist_provider').trim().toLowerCase(); @@ -192,6 +240,18 @@ export function gatherActionsConfig(): PiConfig { if (shareGistToken) { core.setSecret(shareGistToken); } + // TTL preset for shared Opengist gists. Unset → undefined so the provider's + // 7-day default applies; an unrecognised value warns and also falls back to + // that default rather than sending a value the server would reject. + const shareGistExpirationRaw = core.getInput('share_gist_expiration'); + const shareGistExpiration = parseGistExpiration(shareGistExpirationRaw); + if (shareGistExpirationRaw.trim() && !shareGistExpiration) { + core.warning( + `Unknown share_gist_expiration "${shareGistExpirationRaw.trim()}"; ` + + `defaulting to ${DEFAULT_OPENGIST_EXPIRATION}. ` + + `Valid values are: ${OPENGIST_EXPIRATIONS.join(', ')}.` + ); + } // --- Optional positive-integer inputs ---------------------------------- const diffMaxLines = parsePositiveIntInput(core.getInput('diff_max_lines')); @@ -220,10 +280,13 @@ export function gatherActionsConfig(): PiConfig { exportSessionHtml, exportSessionJsonl, autoCompaction, + ...(cacheWarming ? { cacheWarming } : {}), + refreshModelCatalog, shareSession, ...(shareGistProvider ? { shareGistProvider } : {}), ...(shareGistApiUrl ? { shareGistApiUrl } : {}), ...(shareGistToken ? { shareGistToken } : {}), + ...(shareGistExpiration ? { shareGistExpiration } : {}), ...(githubToken ? { githubToken } : {}), ...(diffMaxLines ? { diffMaxLines } : {}), ...(diffMaxBytes ? { diffMaxBytes } : {}), diff --git a/packages/pi-action/tests/adapters/config.spec.ts b/packages/pi-action/tests/adapters/config.spec.ts index d15f45c7..89fa47ad 100644 --- a/packages/pi-action/tests/adapters/config.spec.ts +++ b/packages/pi-action/tests/adapters/config.spec.ts @@ -20,7 +20,7 @@ import { coreMock } from '../../../pi-orchestrator/tests/helpers/core-mock'; // object — same object registerCoreMock() uses, so order doesn't matter. vi.mock('@actions/core', () => coreMock); -import { gatherActionsConfig } from '../../src/adapters/config'; +import { gatherActionsConfig, parseGistExpiration } from '../../src/adapters/config'; // --------------------------------------------------------------------------- // Helpers @@ -97,6 +97,30 @@ describe('gatherActionsConfig', () => { const config = gatherActionsConfig(); expect(config.autoCompaction).toBe(false); }); + + test('cacheWarming defaults to undefined (SDK default "streaming")', () => { + const config = gatherActionsConfig(); + expect(config.cacheWarming).toBeUndefined(); + }); + }); + + describe('cache_warming parsing', () => { + test('parses cache_warming idle', () => { + mockCore({ cache_warming: 'idle' }); + expect(gatherActionsConfig().cacheWarming).toBe('idle'); + }); + + test('parses cache_warming case-insensitively and trims whitespace', () => { + mockCore({ cache_warming: ' OFF ' }); + expect(gatherActionsConfig().cacheWarming).toBe('off'); + }); + + test('warns and falls back to undefined on unknown value', () => { + mockCore({ cache_warming: 'aggressive' }); + const config = gatherActionsConfig(); + expect(config.cacheWarming).toBeUndefined(); + expect(coreMock.warning).toHaveBeenCalledWith(expect.stringContaining('cache_warming')); + }); }); describe('boolean input parsing', () => { @@ -294,5 +318,40 @@ describe('gatherActionsConfig', () => { expect(config.shareGistToken).toBe('og_secret'); expect(coreMock.setSecret).toHaveBeenCalledWith('og_secret'); }); + + test('share_gist_expiration defaults to undefined (provider applies 7days)', () => { + expect(gatherActionsConfig().shareGistExpiration).toBeUndefined(); + }); + + test('parses share_gist_expiration (case-insensitive, trimmed)', () => { + mockCore({ share_gist_expiration: ' 1DAY ' }); + expect(gatherActionsConfig().shareGistExpiration).toBe('1day'); + }); + + test('accepts the never preset', () => { + mockCore({ share_gist_expiration: 'never' }); + expect(gatherActionsConfig().shareGistExpiration).toBe('never'); + }); + + test('drops an unknown share_gist_expiration and warns', () => { + mockCore({ share_gist_expiration: '2weeks' }); + expect(gatherActionsConfig().shareGistExpiration).toBeUndefined(); + expect(coreMock.warning).toHaveBeenCalledWith( + expect.stringMatching(/Unknown share_gist_expiration "2weeks".*7days/) + ); + }); + + test('does not warn for a recognised share_gist_expiration', () => { + mockCore({ share_gist_expiration: '15days' }); + gatherActionsConfig(); + expect(coreMock.warning).not.toHaveBeenCalled(); + }); + + test('parseGistExpiration returns undefined for empty/unknown input', () => { + expect(parseGistExpiration('')).toBeUndefined(); + expect(parseGistExpiration(' ')).toBeUndefined(); + expect(parseGistExpiration('nope')).toBeUndefined(); + expect(parseGistExpiration('7days')).toBe('7days'); + }); }); }); diff --git a/packages/pi-cli/package.json b/packages/pi-cli/package.json index 82b59e18..63c85a8d 100644 --- a/packages/pi-cli/package.json +++ b/packages/pi-cli/package.json @@ -1,6 +1,6 @@ { "name": "@alexanderfortin/pi-cli", - "version": "2.28.0", + "version": "2.29.1", "private": true, "description": "Terminal frontend for the Pi orchestrator — runs the same agent + tools as the GitHub Action, from a local shell.", "type": "module", @@ -20,9 +20,9 @@ "dependencies": { "@alexanderfortin/pi-orchestrator": "workspace:*", "@alexanderfortin/pi-platform-github": "workspace:*", - "@earendil-works/pi-agent-core": "^0.85.1", - "@earendil-works/pi-ai": "^0.85.1", - "@earendil-works/pi-coding-agent": "^0.85.1", + "@earendil-works/pi-agent-core": "^0.87.1", + "@earendil-works/pi-ai": "^0.87.1", + "@earendil-works/pi-coding-agent": "^0.87.1", "@js-temporal/polyfill": "^0.5.1", "@octokit/core": "^7.0.6", "@octokit/plugin-rest-endpoint-methods": "^17.0.0", diff --git a/packages/pi-orchestrator/package.json b/packages/pi-orchestrator/package.json index c3aee636..afcebd95 100644 --- a/packages/pi-orchestrator/package.json +++ b/packages/pi-orchestrator/package.json @@ -1,6 +1,6 @@ { "name": "@alexanderfortin/pi-orchestrator", - "version": "2.28.0", + "version": "2.29.1", "type": "module", "main": "src/index.ts", "types": "src/index.ts", @@ -10,9 +10,9 @@ "./pi/tools/*": "./src/pi/tools/*.ts" }, "peerDependencies": { - "@earendil-works/pi-coding-agent": "^0.85.1", - "@earendil-works/pi-ai": "^0.85.1", - "@earendil-works/pi-agent-core": "^0.85.1" + "@earendil-works/pi-coding-agent": "^0.87.1", + "@earendil-works/pi-ai": "^0.87.1", + "@earendil-works/pi-agent-core": "^0.87.1" }, "dependencies": { "@js-temporal/polyfill": "^0.5.1", diff --git a/packages/pi-orchestrator/src/index.ts b/packages/pi-orchestrator/src/index.ts index 1b4a615a..4f780dfa 100644 --- a/packages/pi-orchestrator/src/index.ts +++ b/packages/pi-orchestrator/src/index.ts @@ -50,6 +50,8 @@ export { getPRDiffToolFactory, executeGetPRDiff } from './pi/tools/get-pr-diff'; export { getIssueOrPRThreadToolFactory } from './pi/tools/get-thread'; export { getWorkflowRunLogsToolFactory } from './pi/tools/get-workflow-run-logs'; export { updatePullRequestToolFactory } from './pi/tools/update-pr'; +export { createSummarizeToolFactory } from './pi/tools/summarize'; +export type { SummarizeTextDetails } from './pi/tools/summarize'; // Version export { getActionVersion, getPiVersion, formatActionVersion } from './version'; @@ -70,7 +72,10 @@ export { createOpengistGist, opengistGistProvider, DEFAULT_OPENGIST_API_PATH, + DEFAULT_OPENGIST_EXPIRATION, + OPENGIST_EXPIRATIONS, } from './share/opengist'; +export type { OpengistExpiration } from './share/opengist'; export { resolveGistProvider, resolveShareToken } from './share/provider'; export type { ShareProviderConfig } from './share/provider'; diff --git a/packages/pi-orchestrator/src/orchestrator.ts b/packages/pi-orchestrator/src/orchestrator.ts index 92ddcac2..3258bc40 100644 --- a/packages/pi-orchestrator/src/orchestrator.ts +++ b/packages/pi-orchestrator/src/orchestrator.ts @@ -451,6 +451,7 @@ export class ActionOrchestrator { content, description, ...(this.config.shareGistApiUrl ? { apiUrl: this.config.shareGistApiUrl } : {}), + ...(this.config.shareGistExpiration ? { expire: this.config.shareGistExpiration } : {}), }); } catch (e) { const msg = e instanceof Error ? e.message : String(e); diff --git a/packages/pi-orchestrator/src/pi/agent.ts b/packages/pi-orchestrator/src/pi/agent.ts index f0b6d369..a1a5da10 100644 --- a/packages/pi-orchestrator/src/pi/agent.ts +++ b/packages/pi-orchestrator/src/pi/agent.ts @@ -167,6 +167,24 @@ export class Agent { this.modelRuntime.registerProvider(this.config.provider, { baseUrl: this.config.baseUrl }); } + // Fetch the latest model catalog from pi.dev so models newer than the bundled SDK resolve. + // Must run after the API key is set: the SDK only fetches catalogs for providers that have a credential. + // The SDK skips the network when PI_OFFLINE is set. + if (this.config.refreshModelCatalog === false) { + this.logger.debug('[models] Skipping model catalog refresh (refresh_model_catalog=false)'); + } else { + const { errors } = await this.modelRuntime.refresh({ + providers: [this.config.provider], + signal: AbortSignal.timeout(MODEL_REFRESH_TIMEOUT_MS), + }); + const refreshError = errors.get(this.config.provider); + if (refreshError) { + this.logger.warning( + `[models] Could not refresh the model catalog: ${refreshError.message}` + ); + } + } + // Phase 1: Create services (loads extensions, registers providers). const services = await createAgentSessionServices({ cwd, @@ -263,6 +281,16 @@ export class Agent { this.logger.info('[auto-compaction] enabled'); } + // Apply the prompt cache-warming mode when explicitly configured. The + // SDK already defaults to "streaming" (protect prefixes during long + // tool runs); "off" disables it and "idle" also refreshes between + // prompts. Refreshes are billed as a cache read + one output token and + // only fire when the expected savings clear the SDK's cost threshold. + if (this.config.cacheWarming) { + session.setCacheWarmingMode(this.config.cacheWarming); + this.logger.info(`[cache-warming] mode set to "${this.config.cacheWarming}"`); + } + // Validate that all requested tool names actually exist after extensions // are loaded. This provides early, actionable errors instead of silently // dropping unknown names. diff --git a/packages/pi-orchestrator/src/pi/prompt.ts b/packages/pi-orchestrator/src/pi/prompt.ts index 055ec760..d8104643 100644 --- a/packages/pi-orchestrator/src/pi/prompt.ts +++ b/packages/pi-orchestrator/src/pi/prompt.ts @@ -88,9 +88,11 @@ export const CREATE_PULL_REQUEST_PROMPT_GUIDELINES = [ 'Always use the create_pull_request tool to create pull requests - do not use git commands or gh CLI directly.', 'Make sure your changes are made (modified files exist) before calling this tool. The tool will detect changes, create branch, and create PR automatically. Do NOT use unless you have already applied changes and/or added new files.', 'The tool will automatically generate a branch name in the format: pi/issue{number}-{timestamp}.', + "If the tool fails to push to the repository because of insufficient permissions, it will open a PR from a fork: create a fork (if it doesn't exist); push the PR branch to fork; create a PR from the branch in the fork.", 'Do NOT provide the "base" parameter unless the user explicitly requests a different target branch than the repository default. The tool will automatically detect the correct default branch.', 'Use dryRun=true first to verify the PR configuration, then dryRun=false to create it.', 'On some platforms (e.g. Forgejo) the PR object cannot always be opened automatically even though the branch is pushed. When this happens the tool returns a compare URL instead of an error — post that URL so the user can open the PR manually.', + 'If the tool fails with an error about creating a fork, the configured token cannot own forks (e.g. the default GITHUB_TOKEN authenticates as a bot). Report that a personal access token with repository access is required for fork-based pull requests.', ]; /** @@ -328,7 +330,7 @@ export function GET_CI_STATUS_PROMPT_GUIDELINES(platform: PlatformType = 'github const product = productNameOf(platform); return [ 'Use get_ci_status to inspect the CI/CD status of a pull request or commit before or after making changes.', - `By default, the tool fetches status for the current PR from the ${product} context. Only provide owner/repo/pull_number when you need to check a different PR.`, + `By default, the tool fetches status for the head commit of the current PR from the ${product} context. Outside a PR, it uses the commit that triggered the run. Only provide owner/repo/pull_number when you need to check a different PR.`, 'You can also provide a `ref` (commit SHA or branch name) directly instead of a pull_number.', 'Filter by `status` (queued, in_progress, completed) or `conclusion` (success, failure, cancelled, timed_out) to narrow results.', 'For failed workflow runs, use the returned run_id with the `get_workflow_run_logs` tool to fetch detailed job logs and diagnose failures.', @@ -388,3 +390,27 @@ export const GET_WORKFLOW_RUN_LOGS_PARAM_RUN_ID_DESCRIPTION = export const GET_WORKFLOW_RUN_LOGS_PARAM_MAX_BYTES_DESCRIPTION = 'Maximum total log bytes to return. Defaults to 51200 (50KB). Capped at 1048576 (1MB). Use for limiting very large log outputs.'; + +// +// Summarize Text +// +export const SUMMARIZE_TEXT_PROMPT_SNIPPET = + 'Summarize long text with a separate LLM call, keeping the full text out of your own context. Use it to condense very long inputs (CI logs, big threads, large file dumps) before analyzing them.'; + +export const SUMMARIZE_TEXT_PROMPT_GUIDELINES = [ + 'Use summarize_text when a text is too long to read in full (e.g. workflow logs, large comment threads) and you only need the key points.', + 'Pass the raw text via `text` and optionally narrow the result with `focus` (e.g. "errors and their root causes") and `max_words`.', + 'The summary is produced by a separate one-shot LLM call using the current session model; it does not consume your context window beyond the returned summary.', +]; + +export const SUMMARIZE_TEXT_DESCRIPTION = + 'Summarize a long text with a separate one-shot LLM call (using the current session model) and return only the summary. Use this to condense very large inputs — CI logs, long threads, file dumps — without loading them fully into the conversation.'; + +export const SUMMARIZE_TEXT_PARAM_TEXT_DESCRIPTION = + 'The raw text to summarize. Can be very long; it is sent to the sub-call, not kept in your context.'; + +export const SUMMARIZE_TEXT_PARAM_FOCUS_DESCRIPTION = + 'Optional instruction for what the summary should focus on (e.g. "errors, root causes, and failed steps").'; + +export const SUMMARIZE_TEXT_PARAM_MAX_WORDS_DESCRIPTION = + 'Approximate maximum length of the summary in words. Defaults to 300.'; diff --git a/packages/pi-orchestrator/src/pi/tools/constants.ts b/packages/pi-orchestrator/src/pi/tools/constants.ts index f7d1c045..c42dc58a 100644 --- a/packages/pi-orchestrator/src/pi/tools/constants.ts +++ b/packages/pi-orchestrator/src/pi/tools/constants.ts @@ -15,3 +15,4 @@ export const CANCELLATION_MESSAGE_CREATE_REVIEW = 'Review creation was cancelled export const CANCELLATION_MESSAGE_GET_CI_STATUS = 'CI status retrieval was cancelled'; export const CANCELLATION_MESSAGE_GET_WORKFLOW_RUN_LOGS = 'Workflow run logs retrieval was cancelled'; +export const CANCELLATION_MESSAGE_SUMMARIZE = 'Text summarization was cancelled'; diff --git a/packages/pi-orchestrator/src/pi/tools/index.ts b/packages/pi-orchestrator/src/pi/tools/index.ts index f1a39cad..3743e98f 100644 --- a/packages/pi-orchestrator/src/pi/tools/index.ts +++ b/packages/pi-orchestrator/src/pi/tools/index.ts @@ -16,6 +16,9 @@ * runs for a pull request or commit ref. * - **`get_workflow_run_logs`** – fetches job logs for a specific workflow run * to diagnose CI failures. + * - **`summarize_text`** – summarizes very long text with a separate one-shot + * LLM call (via `ctx.modelRegistry`), keeping the raw text out of the + * agent's own context. * * The exported {@link toolsFactory} function is passed to the Pi SDK resource * loader so that the tools are available during agent sessions. @@ -28,6 +31,7 @@ import { updatePullRequestToolFactory } from './update-pr'; import { createReviewToolFactory } from './create-review'; import { getCIStatusToolFactory } from './get-ci-status'; import { getWorkflowRunLogsToolFactory } from './get-workflow-run-logs'; +import { createSummarizeToolFactory } from './summarize'; import type { ExtensionAPI } from '@earendil-works/pi-coding-agent'; import type { PlatformProvider } from '../../platform'; import type { DiffConfig } from '../../types'; @@ -65,6 +69,9 @@ export function createToolsFactory( createReviewToolFactory(provider), getCIStatusToolFactory(provider), getWorkflowRunLogsToolFactory(provider), + // Platform-agnostic: uses the SDK's extension model-call API + // (ctx.modelRegistry) rather than the platform provider. + createSummarizeToolFactory(), ]; tools.forEach(tool => { pi.registerTool(tool); diff --git a/packages/pi-orchestrator/src/pi/tools/summarize.ts b/packages/pi-orchestrator/src/pi/tools/summarize.ts new file mode 100644 index 00000000..16eb6664 --- /dev/null +++ b/packages/pi-orchestrator/src/pi/tools/summarize.ts @@ -0,0 +1,191 @@ +/** + * @file summarize_text tool definition. + * + * A platform-agnostic tool that delegates summarization of very long text to + * a separate one-shot LLM call via the SDK's extension model-call API + * (`ctx.modelRegistry.complete()`, new in pi-coding-agent 0.86.0). The raw + * text is sent to the sub-call with request-time authentication resolved by + * the registry, and only the summary enters the agent's own context — + * keeping huge inputs (CI logs, long threads, file dumps) out of the main + * transcript entirely. + */ + +import { Type, Static } from 'typebox'; +import { defineTool } from '@earendil-works/pi-coding-agent'; +import { + SUMMARIZE_TEXT_PROMPT_SNIPPET, + SUMMARIZE_TEXT_PROMPT_GUIDELINES, + SUMMARIZE_TEXT_DESCRIPTION, + SUMMARIZE_TEXT_PARAM_TEXT_DESCRIPTION, + SUMMARIZE_TEXT_PARAM_FOCUS_DESCRIPTION, + SUMMARIZE_TEXT_PARAM_MAX_WORDS_DESCRIPTION, +} from '../prompt'; +import { CANCELLATION_MESSAGE_SUMMARIZE } from './constants'; +import { nullable, PREFER_STRICT_JSON_SCHEMA } from './schema'; +import { isPresent } from './tool-execution'; +import type { AgentToolResult, ExtensionContext } from '@earendil-works/pi-coding-agent'; + +/** Details returned with each summarize_text tool result. */ +export interface SummarizeTextDetails { + /** The generated summary (empty on cancellation/failure). */ + summary: string; + /** Model id used for the sub-call. */ + model: string; + /** Length of the raw input in characters. */ + input_chars: number; + /** Set when the tool was cancelled via the abort signal. */ + cancelled?: boolean; + /** Set when the sub-call failed; carries the error message. */ + error?: string; +} + +/** Default maxTokens for the one-shot sub-call (roughly fits max_words=300). */ +const DEFAULT_SUB_CALL_MAX_TOKENS = 1024; + +/** Default target summary length communicated to the sub-call. */ +const DEFAULT_MAX_WORDS = 300; + +/** + * Schema for the summarize_text tool. + */ +const summarizeTextSchema = Type.Object( + { + text: Type.String({ + description: SUMMARIZE_TEXT_PARAM_TEXT_DESCRIPTION, + }), + focus: nullable( + Type.String({ + description: SUMMARIZE_TEXT_PARAM_FOCUS_DESCRIPTION, + }) + ), + max_words: nullable( + Type.Integer({ + description: SUMMARIZE_TEXT_PARAM_MAX_WORDS_DESCRIPTION, + }) + ), + }, + { additionalProperties: false } +); + +type SummarizeTextToolParams = Static; + +/** + * Build the sub-call system prompt from the focus/max_words parameters. + */ +function buildSubCallPrompt(focus: string | undefined, maxWords: number): string { + const parts = [ + 'You are a summarization assistant. Summarize the user-provided text factually and completely, preserving concrete details (error messages, names, numbers, paths) that matter for debugging or review.', + ]; + if (focus) { + parts.push(`Focus the summary on: ${focus}`); + } + parts.push(`Keep the summary under ${maxWords} words. Respond with the summary text only.`); + return parts.join(' '); +} + +/** + * Extract the text content from an assistant message. + */ +function extractAssistantText(message: { content: { type: string; text?: string }[] }): string { + return message.content + .filter(block => block.type === 'text') + .map(block => block.text ?? '') + .join('') + .trim(); +} + +/** + * Create the summarize_text tool definition. + * + * Uses `ctx.modelRegistry.complete()` (the 0.86.0 extension model-call API) + * so the sub-call resolves authentication and provider configuration through + * the same runtime as the session — no API keys or provider wiring needed in + * the tool itself. + * + * @returns The tool definition. + */ +export function createSummarizeToolFactory() { + return defineTool({ + name: 'summarize_text', + label: 'Summarize Text', + description: SUMMARIZE_TEXT_DESCRIPTION, + promptSnippet: SUMMARIZE_TEXT_PROMPT_SNIPPET, + promptGuidelines: SUMMARIZE_TEXT_PROMPT_GUIDELINES, + parameters: summarizeTextSchema, + constrainedSampling: PREFER_STRICT_JSON_SCHEMA, + execute: async ( + _toolCallId: string, + params: SummarizeTextToolParams, + signal: AbortSignal | undefined, + _onUpdate: unknown, + ctx: ExtensionContext + ): Promise> => { + const model = ctx.model; + const baseDetails = { + summary: '', + model: model?.id ?? '', + input_chars: params.text.length, + }; + + if (signal?.aborted) { + return { + content: [{ type: 'text' as const, text: CANCELLATION_MESSAGE_SUMMARIZE }], + details: { ...baseDetails, cancelled: true }, + }; + } + + if (!model) { + return { + content: [ + { type: 'text' as const, text: 'No model available for the summarization sub-call' }, + ], + details: { ...baseDetails, error: 'no model available' }, + }; + } + + const maxWords = isPresent(params.max_words) ? params.max_words : DEFAULT_MAX_WORDS; + const focus = isPresent(params.focus) ? params.focus : undefined; + + try { + const message = await ctx.modelRegistry.complete( + model, + { + systemPrompt: buildSubCallPrompt(focus, maxWords), + messages: [{ role: 'user', content: params.text, timestamp: Date.now() }], + }, + { + maxTokens: DEFAULT_SUB_CALL_MAX_TOKENS, + ...(signal ? { signal } : {}), + } + ); + + if (message.stopReason === 'error') { + const errorMessage = message.errorMessage ?? 'unknown sub-call error'; + return { + content: [{ type: 'text' as const, text: `Summarization failed: ${errorMessage}` }], + details: { ...baseDetails, error: errorMessage }, + }; + } + + const summary = extractAssistantText(message); + if (!summary) { + return { + content: [{ type: 'text' as const, text: 'Summarization returned no text content' }], + details: { ...baseDetails, error: 'empty summary' }, + }; + } + + return { + content: [{ type: 'text' as const, text: summary }], + details: { ...baseDetails, summary }, + }; + } catch (error) { + const errorMessage = error instanceof Error ? error.message : String(error); + return { + content: [{ type: 'text' as const, text: `Summarization failed: ${errorMessage}` }], + details: { ...baseDetails, error: errorMessage }, + }; + } + }, + }); +} diff --git a/packages/pi-orchestrator/src/platform/types.ts b/packages/pi-orchestrator/src/platform/types.ts index 2df0d305..85b6c6a1 100644 --- a/packages/pi-orchestrator/src/platform/types.ts +++ b/packages/pi-orchestrator/src/platform/types.ts @@ -177,6 +177,17 @@ export interface CreatePullRequestDetails { * Present only when {@link prCreated} is `false`. */ compareUrl?: string; + /** + * Owner of the fork the PR head branch was pushed to. Present only when + * the PR was opened from the agent's fork of the target repository. + */ + forkOwner?: string; + /** + * Repository name of the fork the PR head branch was pushed to. Present + * only when the PR was opened from the agent's fork of the target + * repository. + */ + forkRepo?: string; } export interface UpdatePullRequestParams { diff --git a/packages/pi-orchestrator/src/share/gist.ts b/packages/pi-orchestrator/src/share/gist.ts index bf401cc0..84dbcab1 100644 --- a/packages/pi-orchestrator/src/share/gist.ts +++ b/packages/pi-orchestrator/src/share/gist.ts @@ -195,6 +195,13 @@ export interface CreateGistInput { * Defaults to {@link DEFAULT_GITHUB_GIST_API}. */ apiUrl?: string; + /** + * Opengist-only: gist time-to-live preset (server-side expiry). One of + * `never`, `1hour`, `12hours`, `1day`, `7days`, `15days`. The Opengist + * provider defaults this to `7days` when unset; GitHub Gists have no + * equivalent, so {@link createSessionGist} ignores it. + */ + expire?: string; } /** Result of a successful gist creation. */ diff --git a/packages/pi-orchestrator/src/share/opengist.ts b/packages/pi-orchestrator/src/share/opengist.ts index c497743a..4a2bd7bd 100644 --- a/packages/pi-orchestrator/src/share/opengist.ts +++ b/packages/pi-orchestrator/src/share/opengist.ts @@ -50,9 +50,44 @@ import { */ export const DEFAULT_OPENGIST_API_PATH = '/api/gists'; +/** + * Fixed-duration gist expiration presets supported by Opengist's create API + * (`expire` field). Mirrors `db.ExpirationType` in the server + * (`internal/db/gist_expiration.go`); `custom` is intentionally omitted since + * we only offer the presets (a custom absolute date would need a UI to pick + * it). + */ +export type OpengistExpiration = 'never' | '1hour' | '12hours' | '1day' | '7days' | '15days'; + +/** + * All valid {@link OpengistExpiration} values, in ascending duration order. + * Exported so frontends (e.g. the Action config adapter) can validate user + * input against the same list the provider accepts. + */ +export const OPENGIST_EXPIRATIONS: readonly OpengistExpiration[] = [ + 'never', + '1hour', + '12hours', + '1day', + '7days', + '15days', +]; + +/** + * Default gist time-to-live applied by the Opengist provider: 7 days. + * + * Shared sessions are ephemeral CI artifacts, so we expire them unless the + * operator opts into a different TTL (or `never`). GitHub Gists have no TTL, + * so this only affects the Opengist backend. + */ +export const DEFAULT_OPENGIST_EXPIRATION: OpengistExpiration = '7days'; + /** * Create a gist on an Opengist instance and return a self-rendering share link. * + * The gist expires after {@link DEFAULT_OPENGIST_EXPIRATION} (7 days) unless + * `input.expire` overrides it; pass `'never'` to disable expiry. + * * @param input - Gist creation parameters. `apiUrl` **must** be set to the * instance's create endpoint (e.g. `https://gist.l3x.in/api/gists`); there is * no sensible default since Opengist is self-hosted. @@ -67,6 +102,7 @@ export async function createOpengistGist(input: CreateGistInput): Promise { const body = JSON.parse(init.body); expect(body.visibility).toBe('unlisted'); expect(body.title).toBe('Pi session — test-owner/test-repo#1 (run 123)'); + // Default TTL is 7 days (shareGistExpiration unset). + expect(body.expire).toBe('7days'); expect(init.headers.Authorization).toBe('Bearer og_opengist-token'); // Outputs carry the raw-HTML link (renders standalone), not pi.dev. @@ -1770,6 +1772,30 @@ describe('ActionOrchestrator', () => { ); }); + test('forwards shareGistExpiration to the Opengist create request', async () => { + globalThis.fetch = vi.fn(async () => ({ + ok: true, + status: 201, + json: async () => ({ + id: 'og-uuid-123', + html_url: 'https://gist.l3x.in/bot/my-session', + }), + text: async () => '', + })) as unknown as typeof fetch; + + const orchestrator = createOrchestrator({ + shareSession: true, + shareGistProvider: 'opengist', + shareGistApiUrl: 'https://gist.l3x.in/api/gists', + shareGistToken: 'og_opengist-token', + shareGistExpiration: 'never', + }); + await orchestrator.execute(); + + const body = JSON.parse((globalThis.fetch as any).mock.calls[0][1].body); + expect(body.expire).toBe('never'); + }); + test('Opengist share_url uses a custom viewer link when PI_SHARE_VIEWER_URL is set', async () => { // With a non-pi.dev viewer configured, the Opengist share_url becomes // # instead of the self-rendering raw link. diff --git a/packages/pi-orchestrator/tests/pi/agent-logic.spec.ts b/packages/pi-orchestrator/tests/pi/agent-logic.spec.ts index 265aa775..44b9bf40 100644 --- a/packages/pi-orchestrator/tests/pi/agent-logic.spec.ts +++ b/packages/pi-orchestrator/tests/pi/agent-logic.spec.ts @@ -189,6 +189,62 @@ describe('Agent', () => { expect(result).toBe(agent); }); + test('refreshes the model catalog at startup by default', async () => { + const refreshSpy = vi + .spyOn(ModelRuntime.prototype, 'refresh') + .mockResolvedValue({ aborted: false, errors: new Map() }); + + const agent = createRealAgent(); + await agent.ready(); + + expect(refreshSpy).toHaveBeenCalledWith( + expect.objectContaining({ providers: ['anthropic'] }) + ); + refreshSpy.mockRestore(); + }); + + test('warns and continues when the startup catalog refresh fails', async () => { + const refreshSpy = vi.spyOn(ModelRuntime.prototype, 'refresh').mockResolvedValue({ + aborted: false, + errors: new Map([['anthropic', new Error('catalog endpoint unreachable')]]), + }); + + const { core, messages } = createCoreWithWarningCapture(); + const agent = new Agent(core as any, mockPlatformProvider, { ...defaultAgentConfig }); + + // A failed startup refresh is non-fatal: fall back to the built-in model list. + await expect(agent.ready()).resolves.toBe(agent); + expect(refreshSpy).toHaveBeenCalledWith( + expect.objectContaining({ + providers: ['anthropic'], + signal: expect.any(AbortSignal), + }) + ); + expect(messages.some(m => m.includes('Could not refresh the model catalog'))).toBe(true); + expect(messages.some(m => m.includes('catalog endpoint unreachable'))).toBe(true); + refreshSpy.mockRestore(); + }); + + test('skips the startup catalog refresh when refreshModelCatalog is false', async () => { + const refreshSpy = vi + .spyOn(ModelRuntime.prototype, 'refresh') + .mockResolvedValue({ aborted: false, errors: new Map() }); + + const agent = new Agent(mockCoreAdapter as any, mockPlatformProvider, { + ...defaultAgentConfig, + refreshModelCatalog: false, + }); + await expect(agent.ready()).resolves.toBe(agent); + + // No provider-scoped startup refresh (the SDK's internal allowNetwork:false + // catalog load at create() time still happens, but no network refresh). + const startupRefresh = refreshSpy.mock.calls.find( + c => Array.isArray(c[0]?.providers) && c[0].providers.includes('anthropic') + ); + expect(startupRefresh).toBeUndefined(); + refreshSpy.mockRestore(); + }); + test('subscribes to message_update events', async () => { const agent = createRealAgent(); @@ -246,42 +302,6 @@ describe('Agent', () => { expect(messages.some(m => m.includes('could not be synchronized'))).toBe(true); }); - test('omits the timeout signal when AbortSignal.timeout is unavailable', async () => { - rejectWithSyncError(); - const refreshSpy = vi - .spyOn(ModelRuntime.prototype, 'refresh') - .mockResolvedValue({ aborted: false, errors: new Map() }); - restore.push(() => refreshSpy.mockRestore()); - - // Simulate a runtime without AbortSignal.timeout (Node < 17.3) so the - // feature-detection guard takes the fallback and leaves the signal - // unset rather than throwing. Restored in afterEach. - const originalTimeout = AbortSignal.timeout; - Object.defineProperty(AbortSignal, 'timeout', { value: undefined, configurable: true }); - restore.push(() => - Object.defineProperty(AbortSignal, 'timeout', { - value: originalTimeout, - configurable: true, - writable: true, - }) - ); - - const agent = new Agent(mockCoreAdapter as any, mockPlatformProvider, { - ...defaultAgentConfig, - }); - - // Recovery still succeeds — the refresh simply runs without a bound timeout. - await expect(agent.ready()).resolves.toBe(agent); - // Find the provider-scoped recovery call (create() also calls refresh with - // allowNetwork:false) and confirm it carries no `signal` property — the - // guard omitted it entirely because AbortSignal.timeout was unavailable. - const recoveryCall = refreshSpy.mock.calls.find( - c => c[0]?.providers?.includes('anthropic') && c[0]?.allowNetwork === true - ); - expect(recoveryCall).toBeDefined(); - expect(recoveryCall![0]).not.toHaveProperty('signal'); - }); - test('throws an actionable error naming the provider when recovery fails', async () => { rejectWithSyncError(); const refreshSpy = vi.spyOn(ModelRuntime.prototype, 'refresh').mockResolvedValue({ @@ -1196,6 +1216,31 @@ describe('Agent', () => { }); }); + describe('cacheWarming', () => { + test('applies cache-warming mode when config.cacheWarming is set', async () => { + const { core: testCore, messages: infoMessages } = createCoreWithInfoCapture(); + + const agent = new Agent(testCore as any, mockPlatformProvider, { + ...defaultAgentConfig, + cacheWarming: 'idle', + }); + + await agent.ready(); + + expect(infoMessages).toContain('[cache-warming] mode set to "idle"'); + }); + + test('does not set cache-warming mode when config.cacheWarming is undefined', async () => { + const { core: testCore, messages: infoMessages } = createCoreWithInfoCapture(); + + const agent = new Agent(testCore as any, mockPlatformProvider, defaultAgentConfig); + + await agent.ready(); + + expect(infoMessages.some(msg => msg.includes('[cache-warming]'))).toBe(false); + }); + }); + describe('session manager selection', () => { /** * Access the session manager's file path from a ready agent. diff --git a/packages/pi-orchestrator/tests/pi/package-patch.spec.ts b/packages/pi-orchestrator/tests/pi/package-patch.spec.ts index d29def13..e32be43a 100644 --- a/packages/pi-orchestrator/tests/pi/package-patch.spec.ts +++ b/packages/pi-orchestrator/tests/pi/package-patch.spec.ts @@ -1,35 +1,33 @@ /** - * Regression tests for the build-time SDK loader patch (patchSDKLoaderPlugin). + * Tests for the bundled-Node extension loading mechanism. * * The deployed GitHub Action has no runtime `node_modules` — Pi and its runtime * dependencies are bundled into `dist/index.js`. Npm extensions are installed * in a temporary directory, so their Pi peer dependencies cannot be resolved - * from that directory. The patch makes jiti use the SDK's bundled VIRTUAL_MODULES - * map instead, preserving the host runtime's module identity. + * from that directory. Since pi-coding-agent 0.86.0, the SDK's loader uses the + * bundled VIRTUAL_MODULES map (with `tryNative: false`) natively when the + * build-time `PI_BUNDLED_NODE` define is set (set in package.ts). * * These tests verify that: - * 1. The SDK's bundled Node loader branch still matches the patch pattern - * 2. The patch replaces it with virtual-module resolution and fails closed when it changes - * 3. A temporary extension can import the Pi peer packages from the host runtime + * 1. The SDK loader still contains the embedded-modules virtual-module branch + * 2. A temporary extension can import the Pi peer packages from the host runtime * - * If these tests fail after a Pi SDK upgrade, the loader patch or its test paths - * need to be updated to match the new SDK layout and loading behavior. + * If these fail after a Pi SDK upgrade, the loader's embedded-modules path or + * its test paths need to be updated to match the new SDK layout/behavior. */ import { describe, expect, test } from 'vitest'; import { existsSync, mkdtempSync, - readFileSync, realpathSync, + readFileSync, rmSync, writeFileSync, } from 'node:fs'; import { dirname, join } from 'node:path'; import { tmpdir } from 'node:os'; import { pathToFileURL } from 'node:url'; -import { patchSDKLoaderSource } from '../../../pi-action/scripts/package'; - function getLoaderPath(): string { return join( process.cwd(), @@ -37,6 +35,10 @@ function getLoaderPath(): string { ); } +function getConfigPath(): string { + return join(process.cwd(), 'node_modules/@earendil-works/pi-coding-agent/dist/config.js'); +} + function getSdkPackagePath(): string { const loaderPath = realpathSync(getLoaderPath()); return dirname(dirname(dirname(dirname(loaderPath)))); @@ -47,21 +49,16 @@ describe('SDK bundled extension loader patch', () => { expect(existsSync(getLoaderPath())).toBe(true); }); - test('replaces the bundled Node branch with host virtual modules', () => { + test('loader.js uses the embedded-modules virtual-module branch for bundled Node', () => { const source = readFileSync(getLoaderPath(), 'utf-8'); - const patched = patchSDKLoaderSource(source); - - expect(patched).toContain('{ virtualModules: VIRTUAL_MODULES, tryNative: false })'); - expect(patched).not.toContain(': { alias: getAliases() }),'); - }); - - test('fails when the SDK loader pattern changes', () => { - const source = readFileSync(getLoaderPath(), 'utf-8').replace( - 'alias: getAliases()', - 'alias: changed()' - ); - expect(() => patchSDKLoaderSource(source)).toThrow('loader pattern not matched'); + // Guard the 0.86.0 loader shape: PI_BUNDLED_NODE gates `usesEmbeddedModules`, + // which selects virtualModules + tryNative:false (and tsconfigPaths for TS + // source runtimes) over dist aliases. + expect(source).toContain('isBunBinary || isNodeSeaBinary || isBundledNode'); + expect(source).toContain('from "../../config.js"'); + expect(readFileSync(getConfigPath(), 'utf-8')).toContain('PI_BUNDLED_NODE'); + expect(source).toContain('{ virtualModules: await getVirtualModules(), tryNative: false }'); }); test('loads peer imports from the host runtime through virtual modules', async () => { diff --git a/packages/pi-orchestrator/tests/pi/tools.spec.ts b/packages/pi-orchestrator/tests/pi/tools.spec.ts index f797dac0..942c3d80 100644 --- a/packages/pi-orchestrator/tests/pi/tools.spec.ts +++ b/packages/pi-orchestrator/tests/pi/tools.spec.ts @@ -111,6 +111,7 @@ describe('extFactory', () => { let createReviewTool: TestTool; let getCIStatusTool: TestTool; let getWorkflowRunLogsTool: TestTool; + let summarizeTextTool: TestTool; beforeEach(() => { tools = captureRegisteredTools(); @@ -121,10 +122,16 @@ describe('extFactory', () => { createReviewTool = getToolByName(tools, 'create_pull_request_review')!; getCIStatusTool = getToolByName(tools, 'get_ci_status')!; getWorkflowRunLogsTool = getToolByName(tools, 'get_workflow_run_logs')!; + summarizeTextTool = getToolByName(tools, 'summarize_text')!; }); - test('registers seven tools', () => { - expect(tools.length).toBe(7); + test('registers eight tools', () => { + expect(tools.length).toBe(8); + }); + + test('registers a tool named summarize_text', () => { + expect(summarizeTextTool).toBeDefined(); + expect(summarizeTextTool.name).toBe('summarize_text'); }); test('registers a tool named create_pull_request', () => { diff --git a/packages/pi-orchestrator/tests/pi/tools/summarize-execution.spec.ts b/packages/pi-orchestrator/tests/pi/tools/summarize-execution.spec.ts new file mode 100644 index 00000000..87be06aa --- /dev/null +++ b/packages/pi-orchestrator/tests/pi/tools/summarize-execution.spec.ts @@ -0,0 +1,168 @@ +/** + * @file Tests for the summarize_text tool (execution behavior). + * + * The tool delegates to `ctx.modelRegistry.complete()` — the pi-coding-agent + * 0.86.0 extension model-call API. Tests mock the extension context's + * `modelRegistry` and `model` to verify parameter plumbing, summary + * extraction, error handling, and cancellation. + */ + +import { describe, expect, test, vi } from 'vitest'; +import { createSummarizeToolFactory } from '@alexanderfortin/pi-orchestrator'; + +/** Build a mock assistant message for `complete()` responses. */ +function assistantMessage(overrides: Record = {}) { + return { + role: 'assistant', + content: [{ type: 'text', text: 'The build failed due to a missing dependency.' }], + api: 'anthropic-messages', + provider: 'anthropic', + model: 'claude-sonnet-4-5', + usage: { input: 10, output: 5, total: 15, cost: { total: 0 } }, + stopReason: 'stop', + timestamp: Date.now(), + ...overrides, + }; +} + +/** Build a mock ExtensionContext with a controllable model registry. */ +function makeCtx(overrides: Record = {}) { + const complete = vi.fn(async () => assistantMessage()); + return { + ctx: { + model: { id: 'claude-sonnet-4-5', provider: 'anthropic' }, + modelRegistry: { complete }, + ...overrides, + } as never, + complete, + }; +} + +/** Narrow the first content block of a tool result to its text. */ +function firstText(result: { content: { type: string; text?: string }[] }): string { + return result.content[0]?.text ?? ''; +} + +describe('summarize_text tool', () => { + test('has correct tool name and label', () => { + const tool = createSummarizeToolFactory(); + expect(tool.name).toBe('summarize_text'); + expect(tool.label).toBe('Summarize Text'); + }); + + test('execute returns the summary from the sub-call', async () => { + const tool = createSummarizeToolFactory(); + const { ctx, complete } = makeCtx(); + + const result = await tool.execute( + 'call-1', + { text: 'a'.repeat(500) }, + undefined, + undefined, + ctx + ); + + expect(complete).toHaveBeenCalledTimes(1); + const [model, context, options] = complete.mock.calls[0] as never as [ + { id: string }, + { systemPrompt: string; messages: unknown[] }, + { maxTokens: number }, + ]; + expect(model.id).toBe('claude-sonnet-4-5'); + expect(context.messages).toHaveLength(1); + expect(context.messages[0]).toMatchObject({ role: 'user', content: 'a'.repeat(500) }); + expect(options.maxTokens).toBeGreaterThan(0); + expect(context.systemPrompt).toContain('under 300 words'); + + expect(result.content[0]?.type).toBe('text'); + expect(firstText(result)).toContain('missing dependency'); + expect(result.details).toMatchObject({ + summary: 'The build failed due to a missing dependency.', + model: 'claude-sonnet-4-5', + input_chars: 500, + }); + expect(result.details.cancelled).toBeUndefined(); + expect(result.details.error).toBeUndefined(); + }); + + test('execute honors focus and max_words parameters', async () => { + const tool = createSummarizeToolFactory(); + const { ctx, complete } = makeCtx(); + + await tool.execute( + 'call-1', + { text: 'log output', focus: 'errors and root causes', max_words: 50 }, + undefined, + undefined, + ctx + ); + + const [, context] = complete.mock.calls[0] as never as [unknown, { systemPrompt: string }]; + expect(context.systemPrompt).toContain('errors and root causes'); + expect(context.systemPrompt).toContain('under 50 words'); + }); + + test('execute returns cancellation result when signal is aborted', async () => { + const tool = createSummarizeToolFactory(); + const { ctx, complete } = makeCtx(); + const controller = new AbortController(); + controller.abort(); + + const result = await tool.execute( + 'call-1', + { text: 'text' }, + controller.signal, + undefined, + ctx + ); + + expect(complete).not.toHaveBeenCalled(); + expect(result.details).toMatchObject({ cancelled: true }); + }); + + test('execute reports an error result when no model is available', async () => { + const tool = createSummarizeToolFactory(); + const { ctx, complete } = makeCtx({ model: undefined }); + + const result = await tool.execute('call-1', { text: 'text' }, undefined, undefined, ctx); + + expect(complete).not.toHaveBeenCalled(); + expect(firstText(result)).toContain('No model available'); + expect(result.details.error).toBe('no model available'); + }); + + test('execute surfaces sub-call stopReason errors', async () => { + const tool = createSummarizeToolFactory(); + const { ctx, complete } = makeCtx(); + complete.mockResolvedValueOnce( + assistantMessage({ stopReason: 'error', errorMessage: '429 rate limited' }) + ); + + const result = await tool.execute('call-1', { text: 'text' }, undefined, undefined, ctx); + + expect(firstText(result)).toContain('429 rate limited'); + expect(result.details.error).toBe('429 rate limited'); + }); + + test('execute surfaces thrown sub-call exceptions', async () => { + const tool = createSummarizeToolFactory(); + const { ctx, complete } = makeCtx(); + complete.mockRejectedValueOnce(new Error('auth missing for provider')); + + const result = await tool.execute('call-1', { text: 'text' }, undefined, undefined, ctx); + + expect(firstText(result)).toContain('auth missing for provider'); + expect(result.details.error).toBe('auth missing for provider'); + }); + + test('execute reports empty summaries distinctly', async () => { + const tool = createSummarizeToolFactory(); + const { ctx, complete } = makeCtx(); + complete.mockResolvedValueOnce(assistantMessage({ content: [] })); + + const result = await tool.execute('call-1', { text: 'text' }, undefined, undefined, ctx); + + expect(firstText(result)).toContain('no text content'); + expect(result.details.error).toBe('empty summary'); + }); +}); diff --git a/packages/pi-orchestrator/tests/share/opengist.spec.ts b/packages/pi-orchestrator/tests/share/opengist.spec.ts index c6e4e3d6..908683d5 100644 --- a/packages/pi-orchestrator/tests/share/opengist.spec.ts +++ b/packages/pi-orchestrator/tests/share/opengist.spec.ts @@ -67,6 +67,17 @@ describe('createOpengistGist', () => { expect(body.title).toBe('Pi agent session'); // The files map shape matches GitHub's ({ name: { content } }). expect(body.files['session.html'].content).toBe('session'); + // Default time-to-live: 7 days (the server converts this preset into an + // absolute expires_at and purges the gist afterwards). + expect(body.expire).toBe('7days'); + }); + + test('honours an explicit expire preset (and never)', async () => { + await createOpengistGist({ token: 'og_token', content: 'x', apiUrl, expire: '1day' }); + expect(JSON.parse((globalThis.fetch as any).mock.calls[0][1].body).expire).toBe('1day'); + + await createOpengistGist({ token: 'og_token', content: 'x', apiUrl, expire: 'never' }); + expect(JSON.parse((globalThis.fetch as any).mock.calls[1][1].body).expire).toBe('never'); }); test('maps the public flag to the visibility enum', async () => { diff --git a/packages/pi-platform-github/package.json b/packages/pi-platform-github/package.json index 4ae5c145..41db9758 100644 --- a/packages/pi-platform-github/package.json +++ b/packages/pi-platform-github/package.json @@ -1,6 +1,6 @@ { "name": "@alexanderfortin/pi-platform-github", - "version": "2.28.0", + "version": "2.29.1", "type": "module", "main": "src/index.ts", "types": "src/index.ts", diff --git a/packages/pi-platform-github/src/constants.ts b/packages/pi-platform-github/src/constants.ts index f0b9df85..964e559e 100644 --- a/packages/pi-platform-github/src/constants.ts +++ b/packages/pi-platform-github/src/constants.ts @@ -20,6 +20,15 @@ export const MAX_TITLE_LENGTH = 255; // Branch naming patterns export const BRANCH_PREFIX = 'pi/issue' as const; +/** + * Name of the git remote that points at the agent's fork of the repository. + * + * Pull requests are opened from the agent's own fork: branches are pushed + * to this remote instead of `origin`. It is added to the workspace checkout + * on first use and reused (URL updated) on subsequent runs. + */ +export const FORK_REMOTE_NAME = 'pi-fork'; + // GitHub-specific ignore patterns (appended to the universal defaults) export const GITHUB_IGNORE_PATTERNS = [ // Don't include the workflow that runs this action. Note: gitignore `*` diff --git a/packages/pi-platform-github/src/git/fork.ts b/packages/pi-platform-github/src/git/fork.ts new file mode 100644 index 00000000..443c0aa5 --- /dev/null +++ b/packages/pi-platform-github/src/git/fork.ts @@ -0,0 +1,364 @@ +/** + * @file Fork management for fork-based pull requests. + * + * Pull requests created by the agent are opened **from a fork** of the target + * repository: the branch is pushed to the token owner's fork and the PR head + * is `forkOwner:branch`. This module implements the fork half of that flow: + * + * - resolving the token's authenticated user, + * - get-or-create of that user's fork of the target repository, + * - a bounded readiness wait for freshly created forks (GitHub creates them + * asynchronously — the repo object exists before its branches do), + * - deriving an authenticated push URL for the fork from the workspace's + * `origin` remote, preserving any embedded credentials and host-scoped + * `http..*` config set up by `actions/checkout`. + */ + +import { simpleGit } from 'simple-git'; +import type { GitHubModuleDeps } from '../types'; +import { createLogger } from './types'; + +/** + * The fork repository to open a pull request from. + */ +export interface ForkInfo { + /** Owner of the fork (the token's authenticated login). */ + readonly owner: string; + /** + * Repository name of the fork. Usually identical to the parent repository + * name, but may carry a suffix when the login already owns an unrelated + * repository with the same name (e.g. Forgejo appends `-1`). + */ + readonly repo: string; + /** `true` when the fork was created by this call, `false` when reused. */ + readonly created: boolean; +} + +/** + * Extract the HTTP status code from an Octokit-style error object. + * + * Local variant of the helper in `tools/pull-request.ts` — kept private here + * to avoid a circular import between the git layer and the tool layer. + */ +function errorStatus(error: unknown): number | undefined { + if (typeof error === 'object' && error !== null && 'status' in error) { + const status = error.status; + if (typeof status === 'number') { + return status; + } + } + return undefined; +} + +/** Extract an Error message from an unknown throwable. */ +function errorMessage(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} + +/** + * Format the HTTP status of an Octokit-style error for error messages. + * + * Falls back to `"unknown"` when the error carries no numeric status + * (network failures, non-Error rejections, …). + */ +function statusLabel(error: unknown): string { + const status = errorStatus(error); + if (status === undefined) { + return 'unknown'; + } + return String(status); +} + +/** + * Resolve the login of the user (or bot) the current token authenticates as. + * + * @param deps - Module dependencies. + * @returns The authenticated login (e.g. `octocat` or `my-app[bot]`). + * @throws {Error} With an actionable message when the token cannot be + * introspected — fork-based PR creation requires a token that can. + */ +export async function getAuthenticatedLogin(deps: GitHubModuleDeps): Promise { + const log = createLogger(deps, '🍴'); + log.debug('Resolving the authenticated user for the fork…'); + try { + const result = await deps.octokit.rest.users.getAuthenticated(); + const login = result.data.login; + if (!login) { + throw new Error('the API response did not include a login'); + } + log.debug(`Authenticated as "${login}"`); + return login; + } catch (error) { + throw new Error( + `Failed to resolve the authenticated user (HTTP ${statusLabel(error)}): ` + + `${errorMessage(error)}. Fork-based pull requests require a token that can ` + + `create forks (e.g. a personal access token) — the default GITHUB_TOKEN ` + + `authenticates as a bot user that cannot own forks.` + ); + } +} + +/** + * Check whether the current token can push to the target repository. + * + * Deliberately conservative: when the API call fails (older Forgejo/Gitea + * instances, network errors, scope gaps) or the `permissions` field is + * absent, returns `false` so callers fall back to the fork flow. + * + * @param deps - Module dependencies. + * @returns `true` when the token can push to the repository. + */ +export async function canPushToRepository(deps: GitHubModuleDeps): Promise { + const log = createLogger(deps, '🍴'); + const { owner, repo } = deps.context.repo; + try { + const response = await deps.octokit.rest.repos.get({ owner, repo }); + const canPush = response.data.permissions?.push === true; + log.debug( + canPush + ? `The token can push to "${owner}/${repo}" — no fork is needed.` + : `The token cannot push to "${owner}/${repo}" — a fork is needed to open a pull request.` + ); + return canPush; + } catch (error) { + log.debug( + `Could not determine push permission for "${owner}/${repo}" ` + + `(${errorMessage(error)}) — assuming push is not possible; a fork will be used.` + ); + return false; + } +} + +/** + * Get or create the token owner's fork of the target repository. + * + * When `{login}/{repo}` already exists and is a fork of the target repository + * it is reused as-is (the agent keeps its fork between runs). Otherwise a + * fork is created via `repos.createFork`. The platform decides the fork's + * actual name — on name collisions Forgejo/Gitea create a suffixed fork + * (e.g. `repo-1`) — so the returned name is authoritative. + * + * @param deps - Module dependencies. + * @param login - The token's authenticated login (the prospective fork owner). + * @returns The fork to push to. `created` is `true` when it was just created. + * @throws {Error} With an actionable message when the fork cannot be checked + * or created. + */ +// fallow-ignore-next-line complexity +export async function ensureFork(deps: GitHubModuleDeps, login: string): Promise { + const log = createLogger(deps, '🍴'); + const { owner, repo } = deps.context.repo; + const target = `${owner}/${repo}`; + + // 1. Reuse an existing fork of this repository. + try { + const existing = await deps.octokit.rest.repos.get({ owner: login, repo }); + const data = existing.data as { + name?: string; + fork?: boolean; + parent?: { full_name?: string } | null; + }; + if (data.fork && data.parent?.full_name === target && data.name) { + log.debug(`Reusing existing fork "${login}/${data.name}" of "${target}"`); + return { owner: login, repo: data.name, created: false }; + } + // The repository exists under the login's account but is not a fork of + // the target (a name collision). Fall through and let the platform's + // create-fork endpoint decide: GitHub fails with 422, Forgejo creates a + // suffixed fork. + log.debug( + `"${login}/${repo}" exists but is not a fork of "${target}" — attempting to create a fork anyway` + ); + } catch (error) { + const status = errorStatus(error); + if (status !== 404) { + throw new Error( + `Failed to check for an existing fork at "${login}/${repo}" ` + + `(HTTP ${statusLabel(error)}): ${errorMessage(error)}.` + ); + } + // 404 — no fork yet, create one below. + } + + // 2. Create the fork. + log.debug(`Creating fork of "${target}" for "${login}"…`); + try { + const created = await deps.octokit.rest.repos.createFork({ owner, repo }); + const forkRepo = created.data.name ?? repo; + log.info(`Created fork "${login}/${forkRepo}" of "${target}"`); + return { owner: login, repo: forkRepo, created: true }; + } catch (error) { + throw new Error( + `Failed to create a fork of "${target}" for "${login}" ` + + `(HTTP ${statusLabel(error)}): ${errorMessage(error)}. Fork-based pull ` + + `requests require a token that can create forks — e.g. a personal access ` + + `token with repository access. The default GITHUB_TOKEN authenticates as ` + + `a bot user that cannot own repositories.` + ); + } +} + +/** Default polling budget for {@link waitForForkReady}. */ +const DEFAULT_READINESS_ATTEMPTS = 10; +/** Default delay between {@link waitForForkReady} polls, in milliseconds. */ +const DEFAULT_READINESS_DELAY_MS = 1000; + +/** Default sleep implementation for {@link waitForForkReady} (real timers). */ +function defaultSleep(ms: number): Promise { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +/** + * Options for {@link waitForForkReady}. All fields are injectable so tests + * can drive retry loops without real timers. + */ +export interface WaitForForkReadyOptions { + /** Maximum number of polls (default 10). */ + attempts?: number; + /** Delay between polls in milliseconds (default 1000). */ + delayMs?: number; + /** Sleep implementation — injectable for tests. */ + sleep?: (ms: number) => Promise; +} + +/** + * Wait until a freshly created fork is ready to accept pushes. + * + * GitHub creates forks asynchronously: the repository object (and the 202 + * response of `repos.createFork`) exists before the default branch does, so + * an immediate push can race a half-created fork. This polls + * `repos.getBranch` on the fork until the default branch is visible. + * + * Best-effort: when the branch never appears within the attempt budget, + * `false` is returned and the caller logs a warning and proceeds anyway + * (the push then surfaces the real error, if any). + * + * @param deps - Module dependencies. + * @param fork - The fork to wait for. + * @param defaultBranch - The branch expected to exist in the fork (the + * parent repository's default branch). + * @param options - Polling budget and injectable sleep. + * @returns `true` when the branch became visible, `false` on timeout. + */ +export async function waitForForkReady( + deps: GitHubModuleDeps, + fork: ForkInfo, + defaultBranch: string, + options?: WaitForForkReadyOptions +): Promise { + const log = createLogger(deps, '🍴'); + const attempts = options?.attempts ?? DEFAULT_READINESS_ATTEMPTS; + const delayMs = options?.delayMs ?? DEFAULT_READINESS_DELAY_MS; + const sleep = options?.sleep ?? defaultSleep; + + for (let attempt = 1; attempt <= attempts; attempt++) { + try { + await deps.octokit.rest.repos.getBranch({ + owner: fork.owner, + repo: fork.repo, + branch: defaultBranch, + }); + if (attempt > 1) { + log.debug(`Fork "${fork.owner}/${fork.repo}" is ready (default branch visible).`); + } + return true; + } catch (error) { + const status = errorStatus(error); + if (status !== 404) { + // Real error (403, 5xx, …) — don't spin the full budget on it, but + // also don't hard-fail: the subsequent push may still succeed. + log.warning( + `Readiness check for fork "${fork.owner}/${fork.repo}" failed with ` + + `HTTP ${statusLabel(error)}: ${errorMessage(error)} — proceeding.` + ); + return false; + } + if (attempt < attempts) { + log.debug( + `Fork "${fork.owner}/${fork.repo}" not ready yet (attempt ${attempt}/${attempts}) — retrying…` + ); + await sleep(delayMs); + } + } + } + return false; +} + +/** + * Derive the fork's remote URL from the `origin` remote URL. + * + * Replaces the trailing `{owner}/{repo}` path segments of `origin` with the + * fork's owner/repo while preserving everything else — scheme, embedded + * credentials, host, port, `.git` suffix, and any URL-prefix path (e.g. + * Forgejo instances served under a subpath). This keeps the derived URL + * authenticated and runner-reachable, because it inherits whatever + * credentials `actions/checkout` configured for `origin`: + * + * - Embedded credentials: `https://x-access-token:***@host/owner/repo.git` + * - Host-scoped extraheader: `http..extraheader` applies to any + * repository on the same host, so the fork URL needs no credentials. + * + * Handles the common remote URL forms: + * - HTTPS: `https://github.com/owner/repo(.git)` + * - HTTPS with credentials: `https://user:token@host/owner/repo.git` + * - SCP-like SSH: `git@github.com:owner/repo.git` + * - SSH URL: `ssh://git@host/owner/repo.git` + * + * @param originUrl - The workspace's `origin` remote URL. + * @param fork - The fork repository (owner + name). + * @param fallbackServerUrl - Server URL used when `originUrl` has no + * recognizable `{owner}/{repo}` suffix (e.g. a bare local path). + * @returns The fork's remote URL. + * @internal Exported for testing purposes. + */ +export function buildForkRemoteUrl( + originUrl: string, + fork: { owner: string; repo: string }, + fallbackServerUrl?: string +): string { + const trimmed = originUrl.trim(); + const hasGitSuffix = /\.git$/i.test(trimmed); + const base = hasGitSuffix ? trimmed.slice(0, -4) : trimmed; + + // Match "<:|/>/" at the end of the URL. The prefix is + // greedy, so the separator immediately before the final two path segments + // is used — this is correct for both `/`-separated URLs and the `:` + // separator of SCP-like SSH URLs, and ignores ports (`host:3000`) because + // they are followed by more than two path segments. + const match = base.match(/^(.*)([:/])([^/:]+)\/([^/:]+)$/); + if (match) { + const [, prefix, separator] = match; + return `${prefix}${separator}${fork.owner}/${fork.repo}${hasGitSuffix ? '.git' : ''}`; + } + + // Unrecognized origin URL shape — fall back to a canonical HTTPS URL. + const server = (fallbackServerUrl ?? 'https://github.com').replace(/\/$/, ''); + return `${server}/${fork.owner}/${fork.repo}.git`; +} + +/** + * Resolve the fork's push URL for the workspace checkout. + * + * Reads the workspace's `origin` remote URL and rewrites its owner/repo + * segments to point at the fork (see {@link buildForkRemoteUrl}). When no + * `origin` remote is configured, falls back to a canonical HTTPS URL built + * from the platform's server URL. + * + * @param workspace - The workspace (checkout) directory. + * @param fork - The fork repository (owner + name). + * @param fallbackServerUrl - Server URL used when `origin` cannot be read. + * @returns The fork's remote URL. + */ +export async function resolveForkRemoteUrl( + workspace: string, + fork: { owner: string; repo: string }, + fallbackServerUrl?: string +): Promise { + let originUrl: string | undefined; + try { + originUrl = (await simpleGit(workspace).raw(['remote', 'get-url', 'origin'])).trim(); + } catch { + // No `origin` remote configured (or not a git worktree) — use the fallback. + } + return buildForkRemoteUrl(originUrl ?? '', fork, fallbackServerUrl); +} diff --git a/packages/pi-platform-github/src/git/git-cli.ts b/packages/pi-platform-github/src/git/git-cli.ts index 221d7fd7..209b5fa5 100644 --- a/packages/pi-platform-github/src/git/git-cli.ts +++ b/packages/pi-platform-github/src/git/git-cli.ts @@ -264,6 +264,43 @@ export async function getWorkspaceChangePaths(cwd: string): Promise void } +): Promise { + let existing: string | undefined; + try { + existing = (await git.raw(['remote', 'get-url', name])).trim() || undefined; + } catch { + // `git remote get-url` exits non-zero when the remote doesn't exist. + } + + if (existing === url) { + return; + } + + if (existing !== undefined) { + await git.raw(['remote', 'set-url', name, url]); + } else { + await git.raw(['remote', 'add', name, url]); + } + log?.debug(`Configured git remote "${name}" → ${url}`); +} + /** * Checkout an existing remote branch locally, preserving working-tree changes. * @@ -272,12 +309,19 @@ export async function getWorkspaceChangePaths(cwd: string): Promise void; warning: (msg: string) => void } + log: { debug: (msg: string) => void; warning: (msg: string) => void }, + remoteName = 'origin' ): Promise { const hasChanges = await hasLocalChanges(git); @@ -286,19 +330,19 @@ export async function checkoutExistingBranch( await git.stash(['push', '--include-untracked', '-m', 'pi-agent-changes']); } - // Fetch the branch from origin so we have the latest tip - await git.fetch('origin', branchName); + // Fetch the branch from the remote so we have the latest tip + await git.fetch(remoteName, branchName); // Create or reset the local branch to match the remote try { - await git.checkoutBranch(branchName, `origin/${branchName}`); + await git.checkoutBranch(branchName, `${remoteName}/${branchName}`); } catch { // Branch already exists locally — reset to remote tip. // Destructive but safe: this is an ephemeral CI checkout, and we just // fetched the authoritative remote tip. Any local-only commits would // be from a previous, failed run and should be discarded. await git.checkout(branchName); - await git.raw(['reset', '--hard', `origin/${branchName}`]); + await git.raw(['reset', '--hard', `${remoteName}/${branchName}`]); } if (hasChanges) { @@ -350,6 +394,13 @@ export interface CommitAndPushOptions { paths: string[]; /** Logger for debug/warning output. */ log: { debug: (msg: string) => void; warning: (msg: string) => void }; + /** + * Optional remote to push to instead of `origin`. Used by the fork-based + * PR flow: PR head branches live in the agent's fork, so the branch is + * pushed to (and, for updates, fetched from) this remote. The remote is + * created or updated idempotently via {@link ensureRemote}. + */ + remote?: { name: string; url: string }; } /** @@ -362,6 +413,11 @@ export interface CommitAndPushOptions { * For **existing branches** (`isNewBranch: false`): checks out the remote * branch (preserving working-tree changes via stash), commits, and pushes. * + * Pushes to `origin` unless `options.remote` is provided, in which case the + * remote is ensured to exist (idempotent) and both the checkout (for + * existing branches) and the push target it — the fork-based PR flow uses + * this to keep PR head branches in the agent's fork. + * * @throws when `paths` is empty — callers must always pass filtered paths * from {@link getWorkspaceChangePaths} to respect platform ignore patterns. * @returns The SHA of the created commit. @@ -374,12 +430,19 @@ export async function commitAndPushBranch(options: CommitAndPushOptions): Promis // Ensure git identity is configured (Forgejo runners have none) await ensureGitIdentity(git, actor, log, options.gitIdentityOptions); + // Resolve the push/fetch remote: the agent's fork when provided, origin + // otherwise. Fork remotes are (re)configured idempotently. + const remoteName = options.remote?.name ?? 'origin'; + if (options.remote) { + await ensureRemote(git, options.remote.name, options.remote.url, log); + } + if (isNewBranch) { log.debug(`Creating new branch "${branchName}" from current HEAD…`); await git.checkoutLocalBranch(branchName); } else { log.debug(`Checking out existing branch "${branchName}"…`); - await checkoutExistingBranch(git, branchName, log); + await checkoutExistingBranch(git, branchName, log, remoteName); } // Stage only the specified paths. This enforces the invariant that @@ -400,11 +463,17 @@ export async function commitAndPushBranch(options: CommitAndPushOptions): Promis await git.commit(message); // Push - log.debug(`Pushing to origin/${branchName}…`); - if (isNewBranch) { - await git.push('origin', branchName, { '--set-upstream': null }); - } else { - await git.push('origin', branchName); + log.debug(`Pushing to ${remoteName}/${branchName}…`); + try { + const pushResult = await git.push( + remoteName, + branchName, + isNewBranch ? { '--set-upstream': null } : undefined + ); + log.debug(`Push result: ${JSON.stringify(pushResult)}`); + } catch (error) { + log.debug(`Push failed with exception ${error}`); + throw error; } // Get the commit SHA diff --git a/packages/pi-platform-github/src/git/index.ts b/packages/pi-platform-github/src/git/index.ts index 65609811..25a1c000 100644 --- a/packages/pi-platform-github/src/git/index.ts +++ b/packages/pi-platform-github/src/git/index.ts @@ -1,7 +1,8 @@ /** * @file Git utilities barrel export for the GitHub platform. * - * Re-exports the logger factory and git-CLI helpers for branch/commit/push. + * Re-exports the logger factory, git-CLI helpers for branch/commit/push, + * and the fork-management helpers used by the fork-based PR flow. */ // Logger factory @@ -17,5 +18,17 @@ export { workspaceHasChanges, getWorkspaceChangePaths, checkoutExistingBranch, + ensureRemote, commitAndPushBranch, } from './git-cli'; + +// Fork management (fork-based pull requests) +export type { ForkInfo, WaitForForkReadyOptions } from './fork'; +export { + buildForkRemoteUrl, + canPushToRepository, + ensureFork, + getAuthenticatedLogin, + resolveForkRemoteUrl, + waitForForkReady, +} from './fork'; diff --git a/packages/pi-platform-github/src/index.ts b/packages/pi-platform-github/src/index.ts index 45db64ea..00122ac9 100644 --- a/packages/pi-platform-github/src/index.ts +++ b/packages/pi-platform-github/src/index.ts @@ -128,10 +128,24 @@ export { ensureGitIdentity, getWorkspaceChangePaths, checkoutExistingBranch, + ensureRemote, createLogger, + // Fork management (fork-based pull requests) + buildForkRemoteUrl, + canPushToRepository, + ensureFork, + getAuthenticatedLogin, + resolveForkRemoteUrl, + waitForForkReady, } from './git'; -export type { CommitAndPushOptions, WorkspaceChangePaths, GitIdentityOptions } from './git'; +export type { + CommitAndPushOptions, + WorkspaceChangePaths, + GitIdentityOptions, + ForkInfo, + WaitForForkReadyOptions, +} from './git'; // GitHub API token resolution (used by pi-cli + pi-action-bridge) export { resolveGitHubToken } from './auth'; diff --git a/packages/pi-platform-github/src/tools/get-ci-status.ts b/packages/pi-platform-github/src/tools/get-ci-status.ts index d492883b..c4eff791 100644 --- a/packages/pi-platform-github/src/tools/get-ci-status.ts +++ b/packages/pi-platform-github/src/tools/get-ci-status.ts @@ -13,6 +13,7 @@ import type { WorkflowRunResult, } from '../types'; import { getStatusIcon } from './ci-utils'; +import { isPR } from '../context-utils'; /** Status types for check runs */ type CheckRunStatus = 'queued' | 'in_progress' | 'completed'; @@ -46,7 +47,8 @@ const MAX_WORKFLOW_RUNS = 50; * Resolve the head SHA from the given parameters. * * If `ref` is provided, use it directly. If `pull_number` is provided, - * fetch the PR to get its head SHA. Otherwise fall back to the context SHA. + * fetch the PR to get its head SHA. Otherwise use the head SHA of the + * current PR, or the context SHA when the context is not a PR. */ async function resolveHeadSha( deps: GitHubModuleDeps, @@ -59,17 +61,28 @@ async function resolveHeadSha( return params.ref; } - // Fetch PR head SHA if pull_number provided - if (params.pull_number) { + // A comment on a PR (issue_comment) sets payload.issue.pull_request, which isPR() misses + const issue = deps.context.payload.issue as { pull_request?: unknown } | undefined; + const isPRComment = issue?.pull_request !== undefined; + + // Use the given PR, else the current PR. + // Not the context SHA: on PR events it is the temporary merge commit, which has no CI runs. + let pullNumber = params.pull_number; + if (!pullNumber && (isPR(deps) || isPRComment)) { + pullNumber = deps.context.issue.number; + } + + // Fetch PR head SHA if a PR number is known + if (pullNumber) { const pr = await deps.octokit.rest.pulls.get({ owner, repo, - pull_number: params.pull_number, + pull_number: pullNumber, }); return pr.data.head.sha; } - // Fall back to context SHA + // Not a PR: use the commit that triggered the run return deps.context.sha ?? undefined; } diff --git a/packages/pi-platform-github/src/tools/pull-request-update.ts b/packages/pi-platform-github/src/tools/pull-request-update.ts index 0803fd58..413ea904 100644 --- a/packages/pi-platform-github/src/tools/pull-request-update.ts +++ b/packages/pi-platform-github/src/tools/pull-request-update.ts @@ -3,19 +3,21 @@ * * Implements the server-side logic for the `update_pull_request` custom tool: * detecting changed files in the working tree, creating a commit via the - * `git` CLI, and pushing the new commit to an existing PR branch. - * Supports updating the PR title and body as well. Supports dry-run mode for - * testing without side effects. + * `git` CLI, and pushing the new commit to an existing PR branch — in the + * fork repository for fork-based PRs (whose head branch lives in the agent's + * fork), in `origin` for same-repository PRs. Supports updating the PR title + * and body as well. Supports dry-run mode for testing without side effects. */ import type { GitHubModuleDeps, UpdatePullRequestParams, UpdatePullRequestDetails } from '../types'; import type { Logger } from '@alexanderfortin/pi-orchestrator'; -import { MAX_TITLE_LENGTH } from '../constants'; +import { FORK_REMOTE_NAME, MAX_TITLE_LENGTH } from '../constants'; import { createLogger, getWorkspaceChangePaths, commitAndPushBranch, appendCoAuthoredBy, + resolveForkRemoteUrl, } from '../git/index'; export interface UpdatePullRequestResult { @@ -126,11 +128,18 @@ interface PullRequestBranchInfo { baseBranch: string; headSha: string; prUrl: string; + /** + * The repository owning the head branch, when the API reports one. + * Present and different from the context repository for fork PRs (the + * agent opens PRs from its own fork); `undefined` for same-repository + * PRs or when the head repository was deleted. + */ + headRepo?: { owner: string; repo: string }; } /** * Fetch a pull request via the GitHub REST API and extract the fields needed - * to update its branch (head/base ref, head SHA, HTML URL). + * to update its branch (head/base ref, head SHA, HTML URL, head repository). * * @param deps - Module dependencies. * @param pullNumber - PR number to fetch. @@ -138,6 +147,7 @@ interface PullRequestBranchInfo { * @throws {Error} If the API call returns a non-200 status or no data. * @internal Exported for testing purposes. */ +// fallow-ignore-next-line complexity export async function fetchPullRequestData( deps: GitHubModuleDeps, pullNumber: number @@ -160,11 +170,24 @@ export async function fetchPullRequestData( ); } + // The head repository is only reported when it still exists — forks that + // were deleted after the PR was opened report `head.repo: null`. + const headRepoData = ( + prData.data.head as { + repo?: { owner?: { login?: string }; name?: string } | null; + } + ).repo; + const headRepo: { owner: string; repo: string } | undefined = + headRepoData?.owner?.login && headRepoData?.name + ? { owner: headRepoData.owner.login, repo: headRepoData.name } + : undefined; + return { headBranch: prData.data.head.ref, baseBranch: prData.data.base.ref, headSha: prData.data.head.sha, prUrl: prData.data.html_url, + ...(headRepo ? { headRepo } : {}), }; } @@ -355,6 +378,8 @@ export function buildSuccessDetails(input: { * Wrapper around {@link generateCommitMessage} + {@link commitAndPushBranch}. * Returns `undefined` when there are no file changes to apply. * + * @param args.remote - Optional remote to push to instead of `origin`. Used + * for fork PRs, whose head branch lives in the fork repository. * @returns The new commit SHA, or `undefined` when no changes were applied. * @internal Exported for testing purposes. */ @@ -367,9 +392,10 @@ export async function applyCommit( message: string | undefined; pullNumber: number; log: Logger; + remote?: { name: string; url: string }; } ): Promise { - const { changedPaths, deletedPaths, headBranch, message, pullNumber, log } = args; + const { changedPaths, deletedPaths, headBranch, message, pullNumber, log, remote } = args; if (changedPaths.length === 0 && deletedPaths.length === 0) { log.info(`No code changes detected, only updating PR metadata if provided`); @@ -393,6 +419,7 @@ export async function applyCommit( serverUrl: deps.context.serverUrl, }, log, + ...(remote ? { remote } : {}), }); log.info(`Created new commit ${commitSha} on branch ${headBranch}`); return commitSha; @@ -497,7 +524,7 @@ export async function updatePullRequest( logUpdateDebugStart(log, params, resolvedPullNumber); - const { headBranch, baseBranch, headSha, prUrl } = await fetchPullRequestData( + const { headBranch, baseBranch, headSha, prUrl, headRepo } = await fetchPullRequestData( deps, resolvedPullNumber ); @@ -527,6 +554,26 @@ export async function updatePullRequest( return result; } + // Fork PRs keep their head branch in the fork repository, not in `origin`. + // Push updates there via the `pi-fork` remote (its URL is derived from the + // workspace's `origin` URL, inheriting the checkout's credentials). + // Same-repository PRs (and PRs whose head repository is gone) push to + // `origin` as before. + let pushRemote: { name: string; url: string } | undefined; + const headRepoDiffers = + headRepo !== undefined && + (headRepo.owner !== deps.context.repo.owner || headRepo.repo !== deps.context.repo.repo); + if (headRepoDiffers && headRepo) { + pushRemote = { + name: FORK_REMOTE_NAME, + url: await resolveForkRemoteUrl(deps.context.workspace, headRepo, deps.context.serverUrl), + }; + log.debug( + `PR #${resolvedPullNumber} head branch "${headBranch}" lives in fork ` + + `"${headRepo.owner}/${headRepo.repo}" — pushing updates to ${pushRemote.name}.` + ); + } + const commitSha = await applyCommit(deps, { changedPaths, deletedPaths, @@ -534,6 +581,7 @@ export async function updatePullRequest( message, pullNumber: resolvedPullNumber, log, + ...(pushRemote ? { remote: pushRemote } : {}), }); const { titleUpdated, bodyUpdated } = await applyMetadataUpdate( diff --git a/packages/pi-platform-github/src/tools/pull-request.ts b/packages/pi-platform-github/src/tools/pull-request.ts index 9358a217..8dd58ec0 100644 --- a/packages/pi-platform-github/src/tools/pull-request.ts +++ b/packages/pi-platform-github/src/tools/pull-request.ts @@ -10,14 +10,20 @@ */ import { Temporal } from '@js-temporal/polyfill'; -import { BRANCH_PREFIX, MAX_TITLE_LENGTH } from '../constants'; +import { BRANCH_PREFIX, FORK_REMOTE_NAME, MAX_TITLE_LENGTH } from '../constants'; import { getContextType } from '../context-utils'; import { createLogger, getWorkspaceChangePaths, commitAndPushBranch, appendCoAuthoredBy, + canPushToRepository, + ensureFork, + getAuthenticatedLogin, + resolveForkRemoteUrl, + waitForForkReady, } from '../git/index'; +import type { ForkInfo } from '../git/index'; import type { GitHubModuleDeps, CreatePullRequestParams, CreatePullRequestDetails } from '../types'; /** @@ -360,8 +366,16 @@ export function buildCreateSuccessMessage(pr: GitHubPullRequestResult): string { /** * Build the structured result for a successful PR creation. Exported for * unit testing. + * + * @param pr - The created PR (number, URL, refs). + * @param fork - The fork the PR was opened from, when applicable. Recorded + * in the details (`forkOwner`/`forkRepo`) so consumers can tell + * fork-based PRs from same-repository ones. */ -export function buildCreateSuccessResult(pr: GitHubPullRequestResult): CreatePullRequestResult { +export function buildCreateSuccessResult( + pr: GitHubPullRequestResult, + fork?: ForkInfo +): CreatePullRequestResult { return { content: [{ type: 'text', text: buildCreateSuccessMessage(pr) }], details: { @@ -371,6 +385,7 @@ export function buildCreateSuccessResult(pr: GitHubPullRequestResult): CreatePul baseBranch: pr.baseRef, dryRun: false, prCreated: true, + ...(fork ? { forkOwner: fork.owner, forkRepo: fork.repo } : {}), }, }; } @@ -447,12 +462,15 @@ export function buildCreateFallbackMessage( /** * Build the structured result for a fallback (branch created, PR not opened). * Exported for unit testing. + * + * @param fork - The fork the branch was pushed to, when applicable. */ export function buildCreateFallbackResult( message: string, headBranch: string, baseBranch: string, - compareUrl: string + compareUrl: string, + fork?: ForkInfo ): CreatePullRequestResult { return { content: [{ type: 'text', text: message }], @@ -464,6 +482,7 @@ export function buildCreateFallbackResult( dryRun: false, prCreated: false, compareUrl, + ...(fork ? { forkOwner: fork.owner, forkRepo: fork.repo } : {}), }, }; } @@ -475,12 +494,82 @@ export function buildCreateFallbackResult( * present the branch was created and pushed but the PR object could not be * opened (e.g. the token has push access but lacks `pull-requests: write` * on Forgejo). The caller should provide a compare-URL fallback in that case. + * + * `fork` echoes the fork the branch was pushed to (if any) so the caller can + * include it in the structured details. */ interface PrepareBranchAndPRResult { /** The PR object when creation succeeded. */ pr?: GitHubPullRequestResult; /** Error details when PR creation failed (branch was still created). */ prError?: { status: number | undefined; message: string }; + /** The fork the branch was pushed to, when the PR is fork-based. */ + fork?: ForkInfo; +} + +/** + * Resolve the fork to open the pull request from. + * + * Pull requests are opened from the agent's own fork of the repository: the + * branch is pushed to the fork and the PR head is `forkOwner:branch`. The + * fork is created on first use and reused on subsequent runs. + * + * Returns `undefined` when no fork is needed: either the token's owner + * already owns the repository (a user cannot fork their own repository) or + * the token can push to it directly — a collaborator, an org/team member, + * or an app installation token such as the default `GITHUB_TOKEN` with + * `contents: write`. In both cases the branch is pushed to `origin` and a + * same-repository PR is opened instead. + * + * @param deps - Module dependencies. + * @returns The fork to push to, or `undefined` when forking is not needed. + * @throws {Error} With an actionable message when the authenticated user + * cannot be resolved or the fork cannot be created (e.g. the default + * GITHUB_TOKEN authenticates as a bot that cannot own forks — a + * personal access token is required for fork-based PRs). + */ +async function resolveForkForPR(deps: GitHubModuleDeps): Promise { + const log = createLogger(deps); + const { owner, repo } = deps.context.repo; + + // Identify the account the token authenticates as — the prospective fork owner. + const login = await getAuthenticatedLogin(deps); + + if (login === owner) { + log.debug( + `Authenticated user "${login}" owns "${owner}/${repo}" — a user cannot fork ` + + `their own repository, so the branch will be pushed to the repository itself.` + ); + return undefined; + } + + if (await canPushToRepository(deps)) { + log.debug( + `Authenticated user "${login}" can push to "${owner}/${repo}" — no fork ` + + `needed; the branch will be pushed to the repository itself.` + ); + return undefined; + } + + const fork = await ensureFork(deps, login); + + if (fork.created) { + // GitHub creates forks asynchronously: the repository object (and the + // 202 response of `repos.createFork`) exists before its branches do, so + // an immediate push can race a half-created fork. Wait (bounded) for + // the default branch to become visible before pushing. + const defaultBranch = await determineBaseBranch(deps, undefined); + const ready = await waitForForkReady(deps, fork, defaultBranch); + if (!ready) { + log.warning( + `Fork "${fork.owner}/${fork.repo}" did not report a default branch in time — ` + + `attempting the push anyway.` + ); + } + } + + log.debug(`Opening the pull request from fork "${fork.owner}/${fork.repo}".`); + return fork; } /** @@ -490,6 +579,12 @@ interface PrepareBranchAndPRResult { * Wraps the sequence `hasLocalChanges → commitAndPushBranch (checkout -b, add, * commit, push) → createPullRequestOnGitHub` into a single step. * + * When `fork` is provided the branch is pushed to the fork (via the + * `pi-fork` git remote, derived from the workspace's `origin` URL so it + * inherits the checkout's credentials) and the PR head is the + * cross-repository `forkOwner:branch` form. Otherwise the branch is pushed + * to `origin` with a plain branch head. + * * The git CLI operations and the `pulls.create` call are intentionally * separated: git push can succeed with push-only tokens, while `pulls.create` * requires `pull-requests: write`. On Forgejo the ephemeral Actions token @@ -510,6 +605,7 @@ async function prepareBranchAndCreatePR( deps: GitHubModuleDeps, baseBranch: string, head: string, + fork: ForkInfo | undefined, title: string, bodyText: string, log: ReturnType @@ -540,8 +636,21 @@ async function prepareBranchAndCreatePR( // The commit message includes a Co-authored-by trailer when an actor is // available. The branch name includes a timestamp so collisions are // effectively impossible. + // + // When the PR is fork-based, the branch is pushed to the agent's fork via + // the `pi-fork` remote (its URL is derived from `origin`, so it inherits + // the credentials actions/checkout configured) instead of `origin`. + const pushRemote = fork + ? { + name: FORK_REMOTE_NAME, + url: await resolveForkRemoteUrl(workspace, fork, deps.context.serverUrl), + } + : undefined; const commitMessage = appendCoAuthoredBy(deps, title); log.debug(`Creating branch "${head}", committing, and pushing via git CLI...`); + if (pushRemote) { + log.debug(`Using remote ${pushRemote.name} pointing to ${pushRemote.url}`); + } await commitAndPushBranch({ cwd: workspace, branchName: head, @@ -554,8 +663,10 @@ async function prepareBranchAndCreatePR( serverUrl: deps.context.serverUrl, }, log, + ...(pushRemote ? { remote: pushRemote } : {}), }); - log.debug(`Branch "${head}" created and pushed successfully`); + const pushTarget = pushRemote ? `${pushRemote.name}/${head}` : `origin/${head}`; + log.debug(`Branch "${head}" created and pushed to ${pushTarget} successfully`); // Open the PR — this can fail independently of branch creation (e.g. // the token has push access but lacks pull-requests: write on Forgejo). @@ -577,8 +688,8 @@ async function prepareBranchAndCreatePR( // - 5xx / transient network errors → the agent should be able to // retry or report the real failure. try { - const pr = await createPullRequestOnGitHub(deps, title, bodyText, baseBranch, head); - return { pr }; + const pr = await createPullRequestOnGitHub(deps, title, bodyText, baseBranch, head, fork); + return { pr, ...(fork ? { fork } : {}) }; } catch (error) { const status = getErrorStatus(error); const message = error instanceof Error ? error.message : String(error); @@ -594,7 +705,7 @@ async function prepareBranchAndCreatePR( `(HTTP ${status}): ${message}. ` + `The branch is ready — a compare URL will be provided.` ); - return { prError: { status, message } }; + return { prError: { status, message }, ...(fork ? { fork } : {}) }; } } @@ -603,13 +714,18 @@ async function createPullRequestOnGitHub( title: string, body: string, baseBranch: string, - headBranch: string + headBranch: string, + fork: ForkInfo | undefined ): Promise { const owner = deps.context.repo.owner; const repo = deps.context.repo.repo; const log = createLogger(deps); - log.debug(`Creating pull request...`); + // Cross-repository PR head: GitHub/Forgejo identify the fork with the + // "owner:branch" form. Same-repository PRs use the plain branch name. + const head = fork ? `${fork.owner}:${headBranch}` : headBranch; + + log.debug(`Creating pull request (head: ${head})...`); const result = await deps.octokit.rest.pulls.create({ owner, @@ -617,7 +733,7 @@ async function createPullRequestOnGitHub( title, body, base: baseBranch, - head: headBranch, + head, }); return { @@ -631,15 +747,21 @@ async function createPullRequestOnGitHub( /** * Create a pull request end-to-end. * - * Orchestrates the full flow: determines the base branch, checks for working-tree - * changes, creates a branch + commit + push via the `git` CLI, and opens the PR. - * When `dryRun` is `true` the operation is simulated and no resources are created. + * Orchestrates the full flow: determines the base branch, resolves (or + * creates) the agent's fork of the repository, checks for working-tree + * changes, creates a branch + commit and pushes it to the fork (or `origin` + * when the token's owner already owns the repository), and opens the PR + * with the cross-repository `forkOwner:branch` head. When `dryRun` is + * `true` the operation is simulated and no resources are created. * * @param deps - Module dependencies. * @param params - Parameters controlling title, body, base branch, and dry-run. * @returns The tool result containing a human-readable message and structured * details about the created PR (or dry-run output). - * @throws {Error} If no changed files are detected or the GitHub API call fails. + * @throws {Error} If no changed files are detected, the fork cannot be + * created (fork-based PRs need a PAT — the default + * GITHUB_TOKEN authenticates as a bot that cannot own + * forks), or the GitHub API call fails. */ // fallow-ignore-next-line complexity export async function createPullRequest( @@ -673,24 +795,38 @@ export async function createPullRequest( return buildCreateDryRunResult(message, head, baseBranch); } + // Resolve the agent's fork of the repository — created on first use, + // reused afterwards. Skipped (returns undefined) when no fork is needed. + const fork = await resolveForkForPR(deps); + // Create and push the new branch via git CLI log.debug(`Preparing branch and changes via git CLI...`); try { - const result = await prepareBranchAndCreatePR(deps, baseBranch, head, title, bodyText, log); + const result = await prepareBranchAndCreatePR( + deps, + baseBranch, + head, + fork, + title, + bodyText, + log + ); // PR was created successfully if (result.pr) { const successMessage = buildCreateSuccessMessage(result.pr); log.info(`SUCCESS: ${successMessage}`); - return buildCreateSuccessResult(result.pr); + return buildCreateSuccessResult(result.pr, fork); } // Branch was created and pushed but the PR object could not be opened // (e.g. token lacks pull-requests:write on Forgejo). Provide a compare - // URL so the user or agent can open the PR manually. + // URL so the user or agent can open the PR manually. Fork-based PRs use + // the cross-repository "forkOwner:branch" head form in the compare URL. if (result.prError) { - const compareUrl = buildCompareUrl(deps, baseBranch, head); + const compareHead = fork ? `${fork.owner}:${head}` : head; + const compareUrl = buildCompareUrl(deps, baseBranch, compareHead); const message = buildCreateFallbackMessage( baseBranch, head, @@ -698,7 +834,7 @@ export async function createPullRequest( result.prError.message ); log.info(`PARTIAL SUCCESS: ${message}`); - return buildCreateFallbackResult(message, head, baseBranch, compareUrl); + return buildCreateFallbackResult(message, head, baseBranch, compareUrl, fork); } // Defensive — should never reach here diff --git a/packages/pi-platform-github/tests/get-ci-status.spec.ts b/packages/pi-platform-github/tests/get-ci-status.spec.ts index 6cf4d790..6990e863 100644 --- a/packages/pi-platform-github/tests/get-ci-status.spec.ts +++ b/packages/pi-platform-github/tests/get-ci-status.spec.ts @@ -109,10 +109,50 @@ describe('getCIStatus - platform implementation', () => { expect(result.details.ref).toBe('explicit-ref'); }); - test('falls back to context SHA when no ref or pull_number', async () => { + test('uses the current PR head SHA on a pull_request event', async () => { const fn = await getModule(); const result = await fn(createTestDeps(mockOctokit), {}); + expect(mockPullsGet).toHaveBeenCalledWith({ + owner: 'test-owner', + repo: 'test-repo', + pull_number: 42, + }); + expect(result.details.ref).toBe('pr-head-sha-abcdef'); + }); + + test('uses the current PR head SHA on a comment on a PR', async () => { + const fn = await getModule(); + const result = await fn( + createTestDeps(mockOctokit, { + eventName: 'issue_comment', + payload: { issue: { number: 42, pull_request: {} } }, + }), + {} + ); + + expect(mockPullsGet).toHaveBeenCalledWith(expect.objectContaining({ pull_number: 42 })); + expect(result.details.ref).toBe('pr-head-sha-abcdef'); + }); + + test('falls back to context SHA on a comment on an issue', async () => { + const fn = await getModule(); + const result = await fn( + createTestDeps(mockOctokit, { + eventName: 'issue_comment', + payload: { issue: { number: 42 } }, + }), + {} + ); + + expect(mockPullsGet).not.toHaveBeenCalled(); + expect(result.details.ref).toBe('context-sha-12345678'); + }); + + test('falls back to context SHA when the context is not a PR', async () => { + const fn = await getModule(); + const result = await fn(createTestDeps(mockOctokit, { eventName: 'push' }), {}); + expect(mockPullsGet).not.toHaveBeenCalled(); expect(result.details.ref).toBe('context-sha-12345678'); }); @@ -120,7 +160,10 @@ describe('getCIStatus - platform implementation', () => { test('returns error message when context SHA is empty', async () => { const fn = await getModule(); - const result = await fn(createTestDeps(mockOctokit, { withSha: false }), {}); + const result = await fn( + createTestDeps(mockOctokit, { eventName: 'push', withSha: false }), + {} + ); expect(result.content[0].text).toContain('Could not resolve ref'); expect(result.details.ref).toBe(''); diff --git a/packages/pi-platform-github/tests/git/fork.spec.ts b/packages/pi-platform-github/tests/git/fork.spec.ts new file mode 100644 index 00000000..e7c39008 --- /dev/null +++ b/packages/pi-platform-github/tests/git/fork.spec.ts @@ -0,0 +1,512 @@ +/** + * @file Tests for the fork-management helpers in `git/fork.ts`. + * + * Covers the pure remote-URL derivation (`buildForkRemoteUrl`), the + * get-or-create fork logic (`ensureFork`), authenticated-user resolution, + * the fork readiness wait, and the workspace-origin-based URL resolution. + * + * The PR-level integration (push + PR creation from the fork) lives in + * `tests/pull-request-fork.spec.ts`. + */ + +import { describe, expect, test, vi, beforeEach, afterEach } from 'vitest'; +import * as fs from 'node:fs'; +import * as os from 'node:os'; +import * as path from 'node:path'; +import { execSync } from 'node:child_process'; +import { + buildForkRemoteUrl, + canPushToRepository, + ensureFork, + getAuthenticatedLogin, + resolveForkRemoteUrl, + waitForForkReady, +} from '@alexanderfortin/pi-platform-github'; +import type { GitHubModuleDeps } from '@alexanderfortin/pi-platform-github'; +import { setupForkGitRepo, cleanupGitRepo, isolateGitConfig } from '../helpers/git-repo'; + +// Isolate git ops from the host's global/system git config (see isolateGitConfig). +isolateGitConfig(); + +const noop = (): void => {}; + +/** Build minimal deps with an octokit mock. */ +function createDeps(octokit: unknown): GitHubModuleDeps { + return { + octokit: octokit as any, + context: { + repo: { owner: 'test-owner', repo: 'test-repo' }, + issue: { number: 42 }, + eventName: 'issue_comment', + payload: { repository: { default_branch: 'main' } }, + serverUrl: 'https://github.com', + runId: 1, + workspace: '/tmp', + }, + logger: { + debug: noop, + info: noop, + warning: noop, + notice: noop, + error: noop, + }, + } as GitHubModuleDeps; +} + +/** Octokit-style error with a status code. */ +function httpError(status: number, message: string): Error { + return Object.assign(new Error(message), { status }); +} + +// --------------------------------------------------------------------------- +// buildForkRemoteUrl +// --------------------------------------------------------------------------- + +describe('buildForkRemoteUrl', () => { + const fork = { owner: 'pi-bot', repo: 'test-repo' }; + + test('rewrites the owner/repo segments of an HTTPS URL', () => { + expect(buildForkRemoteUrl('https://github.com/test-owner/test-repo', fork)).toBe( + 'https://github.com/pi-bot/test-repo' + ); + }); + + test('preserves a trailing .git suffix', () => { + expect(buildForkRemoteUrl('https://github.com/test-owner/test-repo.git', fork)).toBe( + 'https://github.com/pi-bot/test-repo.git' + ); + }); + + test('preserves embedded credentials', () => { + expect( + buildForkRemoteUrl( + 'https://x-access-token:ghp_secret@github.com/test-owner/test-repo.git', + fork + ) + ).toBe('https://x-access-token:ghp_secret@github.com/pi-bot/test-repo.git'); + }); + + test('rewrites SCP-like SSH URLs', () => { + expect(buildForkRemoteUrl('git@github.com:test-owner/test-repo.git', fork)).toBe( + 'git@github.com:pi-bot/test-repo.git' + ); + }); + + test('rewrites ssh:// URLs', () => { + expect(buildForkRemoteUrl('ssh://git@github.com/test-owner/test-repo.git', fork)).toBe( + 'ssh://git@github.com/pi-bot/test-repo.git' + ); + }); + + test('preserves host ports (not confused with the path separator)', () => { + expect( + buildForkRemoteUrl('https://forge.example.com:3000/test-owner/test-repo.git', fork) + ).toBe('https://forge.example.com:3000/pi-bot/test-repo.git'); + }); + + test('preserves URL-prefix paths (Forgejo under a subpath)', () => { + expect(buildForkRemoteUrl('https://forge.example.com/git/test-owner/test-repo.git', fork)).toBe( + 'https://forge.example.com/git/pi-bot/test-repo.git' + ); + }); + + test('uses the fork repo name when it differs from the parent', () => { + expect( + buildForkRemoteUrl('https://github.com/test-owner/test-repo.git', { + owner: 'pi-bot', + repo: 'test-repo-1', + }) + ).toBe('https://github.com/pi-bot/test-repo-1.git'); + }); + + test('rewrites local filesystem paths (two trailing segments)', () => { + expect(buildForkRemoteUrl('/tmp/remotes/test-owner/test-repo.git', fork)).toBe( + '/tmp/remotes/pi-bot/test-repo.git' + ); + }); + + test('falls back to a server URL when the origin has no owner/repo segments', () => { + expect(buildForkRemoteUrl('foobar', fork, 'https://github.com')).toBe( + 'https://github.com/pi-bot/test-repo.git' + ); + }); + + test('falls back to github.com when no server URL is given', () => { + expect(buildForkRemoteUrl('weird-remote', fork)).toBe( + 'https://github.com/pi-bot/test-repo.git' + ); + }); + + test('strips a trailing slash from the fallback server URL', () => { + expect(buildForkRemoteUrl('weird-remote', fork, 'https://forge.example.com/')).toBe( + 'https://forge.example.com/pi-bot/test-repo.git' + ); + }); + + test('trims surrounding whitespace from the origin URL', () => { + expect(buildForkRemoteUrl(' https://github.com/test-owner/test-repo.git ', fork)).toBe( + 'https://github.com/pi-bot/test-repo.git' + ); + }); +}); + +// --------------------------------------------------------------------------- +// getAuthenticatedLogin +// --------------------------------------------------------------------------- + +describe('getAuthenticatedLogin', () => { + test('returns the login of the token user', async () => { + const getAuthenticated = vi.fn(() => Promise.resolve({ data: { login: 'octocat' } })); + const login = await getAuthenticatedLogin( + createDeps({ rest: { users: { getAuthenticated } } }) + ); + expect(login).toBe('octocat'); + expect(getAuthenticated).toHaveBeenCalled(); + }); + + test('wraps API failures with an actionable message', async () => { + const getAuthenticated = vi.fn(() => Promise.reject(httpError(401, 'Bad credentials'))); + await expect( + getAuthenticatedLogin(createDeps({ rest: { users: { getAuthenticated } } })) + ).rejects.toThrow(/Failed to resolve the authenticated user.*personal access token/s); + }); + + test('fails when the response has no login', async () => { + const getAuthenticated = vi.fn(() => Promise.resolve({ data: {} })); + await expect( + getAuthenticatedLogin(createDeps({ rest: { users: { getAuthenticated } } })) + ).rejects.toThrow(/did not include a login/); + }); + + test('handles rejections that are not Error instances', async () => { + // Non-Error throwables (plain objects without a numeric status, strings) + // must still produce the actionable message instead of crashing. + const getAuthenticated = vi.fn(() => Promise.reject({ status: 'nope' })); + await expect( + getAuthenticatedLogin(createDeps({ rest: { users: { getAuthenticated } } })) + ).rejects.toThrow(/Failed to resolve the authenticated user.*HTTP unknown/s); + }); +}); + +// --------------------------------------------------------------------------- +// ensureFork +// --------------------------------------------------------------------------- + +describe('ensureFork', () => { + test('reuses an existing fork of the target repository', async () => { + const reposGet = vi.fn(() => + Promise.resolve({ + data: { + name: 'test-repo', + fork: true, + parent: { full_name: 'test-owner/test-repo' }, + }, + }) + ); + const createFork = vi.fn(); + const deps = createDeps({ rest: { repos: { get: reposGet, createFork } } }); + + const fork = await ensureFork(deps, 'pi-bot'); + + expect(fork).toEqual({ owner: 'pi-bot', repo: 'test-repo', created: false }); + expect(reposGet).toHaveBeenCalledWith({ owner: 'pi-bot', repo: 'test-repo' }); + expect(createFork).not.toHaveBeenCalled(); + }); + + test('creates the fork when none exists (404)', async () => { + const reposGet = vi.fn(() => Promise.reject(httpError(404, 'Not Found'))); + const createFork = vi.fn(() => Promise.resolve({ data: { name: 'test-repo' } })); + const deps = createDeps({ rest: { repos: { get: reposGet, createFork } } }); + + const fork = await ensureFork(deps, 'pi-bot'); + + expect(fork).toEqual({ owner: 'pi-bot', repo: 'test-repo', created: true }); + expect(createFork).toHaveBeenCalledWith({ owner: 'test-owner', repo: 'test-repo' }); + }); + + test('uses the platform-provided fork name (Forgejo name collisions)', async () => { + const reposGet = vi.fn(() => Promise.reject(httpError(404, 'Not Found'))); + const createFork = vi.fn(() => Promise.resolve({ data: { name: 'test-repo-1' } })); + const deps = createDeps({ rest: { repos: { get: reposGet, createFork } } }); + + const fork = await ensureFork(deps, 'pi-bot'); + + expect(fork).toEqual({ owner: 'pi-bot', repo: 'test-repo-1', created: true }); + }); + + test('falls back to the target repo name when the create response has none', async () => { + const reposGet = vi.fn(() => Promise.reject(httpError(404, 'Not Found'))); + const createFork = vi.fn(() => Promise.resolve({ status: 202, data: {} })); + const deps = createDeps({ rest: { repos: { get: reposGet, createFork } } }); + + const fork = await ensureFork(deps, 'pi-bot'); + + expect(fork).toEqual({ owner: 'pi-bot', repo: 'test-repo', created: true }); + }); + + test('falls through to createFork when a same-named non-fork repo exists', async () => { + // A repo named test-repo exists under pi-bot's account, but it is not a + // fork of the target. The platform's create-fork endpoint decides what + // happens (GitHub: 422; Forgejo: suffixed fork). + const reposGet = vi.fn(() => + Promise.resolve({ + data: { name: 'test-repo', fork: false, parent: null }, + }) + ); + const createFork = vi.fn(() => Promise.resolve({ data: { name: 'test-repo-1' } })); + const deps = createDeps({ rest: { repos: { get: reposGet, createFork } } }); + + const fork = await ensureFork(deps, 'pi-bot'); + + expect(fork).toEqual({ owner: 'pi-bot', repo: 'test-repo-1', created: true }); + expect(createFork).toHaveBeenCalled(); + }); + + test('does not reuse an existing fork of a different repository', async () => { + const reposGet = vi.fn(() => + Promise.resolve({ + data: { name: 'test-repo', fork: true, parent: { full_name: 'other/other-repo' } }, + }) + ); + const createFork = vi.fn(() => Promise.resolve({ data: { name: 'test-repo' } })); + const deps = createDeps({ rest: { repos: { get: reposGet, createFork } } }); + + const fork = await ensureFork(deps, 'pi-bot'); + expect(fork.created).toBe(true); + expect(createFork).toHaveBeenCalled(); + }); + + test('propagates fork-existence check failures (non-404)', async () => { + const reposGet = vi.fn(() => Promise.reject(httpError(403, 'Forbidden'))); + const deps = createDeps({ rest: { repos: { get: reposGet } } }); + + await expect(ensureFork(deps, 'pi-bot')).rejects.toThrow( + /Failed to check for an existing fork at "pi-bot\/test-repo".*Forbidden/s + ); + }); + + test('reports an unknown HTTP status when the check fails without one', async () => { + // Network errors and non-Error rejections carry no numeric status — + // the message must stay actionable instead of printing "undefined". + const reposGet = vi.fn(() => Promise.reject(new Error('socket hang up'))); + const deps = createDeps({ rest: { repos: { get: reposGet } } }); + + await expect(ensureFork(deps, 'pi-bot')).rejects.toThrow( + /Failed to check for an existing fork at "pi-bot\/test-repo".*HTTP unknown.*socket hang up/s + ); + }); + + test('wraps fork-creation failures with an actionable PAT hint', async () => { + const reposGet = vi.fn(() => Promise.reject(httpError(404, 'Not Found'))); + const createFork = vi.fn(() => + Promise.reject(httpError(403, 'Resource not accessible by integration')) + ); + const deps = createDeps({ rest: { repos: { get: reposGet, createFork } } }); + + await expect(ensureFork(deps, 'pi-bot')).rejects.toThrow( + /Failed to create a fork of "test-owner\/test-repo" for "pi-bot".*personal access token.*GITHUB_TOKEN/s + ); + }); + + test('reports an unknown HTTP status when fork creation fails without one', async () => { + const reposGet = vi.fn(() => Promise.reject(httpError(404, 'Not Found'))); + const createFork = vi.fn(() => Promise.reject('createFork exploded')); + const deps = createDeps({ rest: { repos: { get: reposGet, createFork } } }); + + await expect(ensureFork(deps, 'pi-bot')).rejects.toThrow( + /Failed to create a fork of "test-owner\/test-repo" for "pi-bot".*HTTP unknown/s + ); + }); +}); + +// --------------------------------------------------------------------------- +// canPushToRepository +// --------------------------------------------------------------------------- + +describe('canPushToRepository', () => { + test('returns false when the permission lookup fails', async () => { + // Older Forgejo/Gitea instances, scope gaps, network errors — the + // conservative answer is "assume no push access; use the fork flow". + const reposGet = vi.fn(() => Promise.reject(httpError(403, 'Forbidden'))); + const deps = createDeps({ rest: { repos: { get: reposGet } } }); + + await expect(canPushToRepository(deps)).resolves.toBe(false); + }); +}); + +// --------------------------------------------------------------------------- +// waitForForkReady +// --------------------------------------------------------------------------- + +describe('waitForForkReady', () => { + const fork = { owner: 'pi-bot', repo: 'test-repo', created: true }; + + function depsWith(getBranch: ReturnType): GitHubModuleDeps { + return createDeps({ rest: { repos: { getBranch } } }); + } + + test('returns true immediately when the default branch is visible', async () => { + const getBranch = vi.fn(() => Promise.resolve({ data: { name: 'main' } })); + const sleep = vi.fn(() => Promise.resolve()); + + const ready = await waitForForkReady(depsWith(getBranch), fork, 'main', { sleep }); + + expect(ready).toBe(true); + expect(getBranch).toHaveBeenCalledWith({ + owner: 'pi-bot', + repo: 'test-repo', + branch: 'main', + }); + expect(sleep).not.toHaveBeenCalled(); + }); + + test('retries while the branch is not yet visible (404)', async () => { + const getBranch = vi + .fn() + .mockRejectedValueOnce(httpError(404, 'Not Found')) + .mockResolvedValueOnce({ data: { name: 'main' } }); + const sleep = vi.fn(() => Promise.resolve()); + + const ready = await waitForForkReady(depsWith(getBranch), fork, 'main', { + sleep, + attempts: 3, + delayMs: 10, + }); + + expect(ready).toBe(true); + expect(getBranch).toHaveBeenCalledTimes(2); + expect(sleep).toHaveBeenCalledTimes(1); + expect(sleep).toHaveBeenCalledWith(10); + }); + + test('gives up after the attempt budget and returns false', async () => { + const getBranch = vi.fn(() => Promise.reject(httpError(404, 'Not Found'))); + const sleep = vi.fn(() => Promise.resolve()); + + const ready = await waitForForkReady(depsWith(getBranch), fork, 'main', { + sleep, + attempts: 3, + delayMs: 1, + }); + + expect(ready).toBe(false); + expect(getBranch).toHaveBeenCalledTimes(3); + expect(sleep).toHaveBeenCalledTimes(2); // no sleep after the final attempt + }); + + test('works without options (default budget, default sleep)', async () => { + // The default sleep is created but never awaited when the branch is + // visible on the first attempt — exercises the non-injected code path. + const getBranch = vi.fn(() => Promise.resolve({ data: { name: 'main' } })); + + const ready = await waitForForkReady(depsWith(getBranch), fork, 'main'); + + expect(ready).toBe(true); + }); + + test('uses the default sleep when options omit it', async () => { + const getBranch = vi.fn(() => Promise.resolve({ data: { name: 'main' } })); + + const ready = await waitForForkReady(depsWith(getBranch), fork, 'main', { attempts: 2 }); + + expect(ready).toBe(true); + expect(getBranch).toHaveBeenCalledTimes(1); + }); + + test('awaits the real default sleep when retrying without injected sleep', async () => { + // Exercises the default (real-timer) sleep implementation itself — + // one 404 followed by success means exactly one default-sleep await. + const getBranch = vi + .fn() + .mockRejectedValueOnce(httpError(404, 'Not Found')) + .mockResolvedValueOnce({ data: { name: 'main' } }); + + const ready = await waitForForkReady(depsWith(getBranch), fork, 'main'); + + expect(ready).toBe(true); + expect(getBranch).toHaveBeenCalledTimes(2); + }); + + test('stops retrying on non-404 errors and returns false', async () => { + const getBranch = vi.fn(() => Promise.reject(httpError(403, 'Forbidden'))); + const sleep = vi.fn(() => Promise.resolve()); + + const ready = await waitForForkReady(depsWith(getBranch), fork, 'main', { + sleep, + attempts: 5, + delayMs: 1, + }); + + expect(ready).toBe(false); + expect(getBranch).toHaveBeenCalledTimes(1); + expect(sleep).not.toHaveBeenCalled(); + }); + + test('reports an unknown HTTP status when the readiness check fails without one', async () => { + const getBranch = vi.fn(() => Promise.reject(new Error('socket hang up'))); + const sleep = vi.fn(() => Promise.resolve()); + + const ready = await waitForForkReady(depsWith(getBranch), fork, 'main', { + sleep, + attempts: 5, + delayMs: 1, + }); + + expect(ready).toBe(false); + expect(getBranch).toHaveBeenCalledTimes(1); + }); +}); + +// --------------------------------------------------------------------------- +// resolveForkRemoteUrl +// --------------------------------------------------------------------------- + +describe('resolveForkRemoteUrl', () => { + let repo: ReturnType; + + beforeEach(() => { + repo = setupForkGitRepo({ + upstreamOwner: 'test-owner', + upstreamRepo: 'test-repo', + forkOwner: 'pi-bot', + forkRepo: 'test-repo', + }); + }); + + afterEach(() => { + if (repo) { + cleanupGitRepo(repo.workspace); + } + }); + + test('derives the fork URL from the origin remote URL', async () => { + if (!repo) { + return; + } + const url = await resolveForkRemoteUrl( + repo.workspace, + { owner: 'pi-bot', repo: 'test-repo' }, + 'https://github.com' + ); + expect(url).toBe(repo.forkDir); + }); + + test('falls back to the server URL when no origin remote exists', async () => { + if (!repo) { + return; + } + // A plain git repo without any remote configured. + const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'pi-fork-noremote-')); + try { + execSync('git init', { cwd: tmpDir, stdio: 'pipe' }); + const url = await resolveForkRemoteUrl( + tmpDir, + { owner: 'pi-bot', repo: 'test-repo' }, + 'https://forge.example.com' + ); + expect(url).toBe('https://forge.example.com/pi-bot/test-repo.git'); + } finally { + fs.rmSync(tmpDir, { recursive: true, force: true }); + } + }); +}); diff --git a/packages/pi-platform-github/tests/git/git-cli.spec.ts b/packages/pi-platform-github/tests/git/git-cli.spec.ts index 952432f8..1587a580 100644 --- a/packages/pi-platform-github/tests/git/git-cli.spec.ts +++ b/packages/pi-platform-github/tests/git/git-cli.spec.ts @@ -5,7 +5,7 @@ * the `simple-git` based helpers behave correctly end-to-end. */ -import { describe, expect, test, beforeEach, afterEach } from 'vitest'; +import { describe, expect, test, beforeEach, afterEach, vi } from 'vitest'; import * as fs from 'node:fs'; import * as path from 'node:path'; import * as os from 'node:os'; @@ -19,11 +19,17 @@ import { getWorkspaceChangePaths, checkoutExistingBranch, commitAndPushBranch, + ensureRemote, } from '@alexanderfortin/pi-platform-github'; import type { GitHubModuleDeps } from '@alexanderfortin/pi-platform-github'; import type { SimpleGit } from 'simple-git'; import { simpleGit } from 'simple-git'; -import { setupGitRepo, cleanupGitRepo, isolateGitConfig } from '../helpers/git-repo'; +import { + setupGitRepo, + setupForkGitRepo, + cleanupGitRepo, + isolateGitConfig, +} from '../helpers/git-repo'; /** Create a logger that captures messages for assertions. */ function captureLogger() { @@ -795,3 +801,234 @@ describe('commitAndPushBranch', () => { expect(treeOutput).not.toContain('excluded.ts'); }); }); + +// --------------------------------------------------------------------------- +// ensureRemote +// --------------------------------------------------------------------------- + +describe('ensureRemote', () => { + let repo: ReturnType; + + beforeEach(() => { + repo = setupGitRepo(); + }); + + afterEach(() => { + if (repo) { + cleanupGitRepo(repo.workspace); + } + }); + + test('adds a remote when it is missing', async () => { + if (!repo) { + return; + } + const git = simpleGit(repo.workspace); + const { log } = captureLogger(); + + await ensureRemote(git, 'pi-fork', '/some/fork.git', log); + + const url = (await git.raw(['remote', 'get-url', 'pi-fork'])).trim(); + expect(url).toBe('/some/fork.git'); + }); + + test('updates the URL when the remote exists with a different URL', async () => { + if (!repo) { + return; + } + const git = simpleGit(repo.workspace); + const { log } = captureLogger(); + + await ensureRemote(git, 'pi-fork', '/old/fork.git', log); + await ensureRemote(git, 'pi-fork', '/new/fork.git', log); + + const url = (await git.raw(['remote', 'get-url', 'pi-fork'])).trim(); + expect(url).toBe('/new/fork.git'); + }); + + test('is a no-op when the remote already points at the URL', async () => { + if (!repo) { + return; + } + const git = simpleGit(repo.workspace); + const { log, messages } = captureLogger(); + + await ensureRemote(git, 'origin', repo.remoteDir, log); + + // No reconfiguration log line — the remote already matched. + expect(messages.some(m => m.includes('Configured git remote'))).toBe(false); + const url = (await git.raw(['remote', 'get-url', 'origin'])).trim(); + expect(url).toBe(repo.remoteDir); + }); + + test('treats an empty remote URL as missing and adds the remote', async () => { + // `git remote get-url` returning an empty string must not be mistaken + // for a configured remote — the remote is (re)added instead. + const fakeGit = { + raw: vi.fn(async (args: string[]) => (args[1] === 'get-url' ? ' ' : '')), + } as unknown as SimpleGit; + + await ensureRemote(fakeGit, 'pi-fork', '/some/fork.git'); + + expect(fakeGit.raw).toHaveBeenCalledWith(['remote', 'add', 'pi-fork', '/some/fork.git']); + }); +}); + +// --------------------------------------------------------------------------- +// commitAndPushBranch (remote option — fork-based PR flow) +// --------------------------------------------------------------------------- + +describe('commitAndPushBranch — remote option', () => { + let repo: ReturnType; + + beforeEach(() => { + repo = setupForkGitRepo({ + upstreamOwner: 'test-owner', + upstreamRepo: 'test-repo', + forkOwner: 'pi-bot', + forkRepo: 'test-repo', + }); + }); + + afterEach(() => { + if (repo) { + cleanupGitRepo(repo.workspace); + } + }); + + test('pushes a new branch to the fork remote instead of origin', async () => { + if (!repo) { + return; + } + const { workspace } = repo; + + fs.writeFileSync(path.join(workspace, 'feature.txt'), 'new feature'); + + const { log } = captureLogger(); + await commitAndPushBranch({ + cwd: workspace, + branchName: 'feature-branch', + message: 'Add feature', + isNewBranch: true, + paths: ['feature.txt'], + log, + remote: { name: 'pi-fork', url: repo.forkDir }, + }); + + // The branch exists on the fork remote, not on origin. + const forkBranches = execSync('git branch', { cwd: repo.forkDir, encoding: 'utf-8' }); + expect(forkBranches).toContain('feature-branch'); + const upstreamBranches = execSync('git branch', { + cwd: repo.upstreamDir, + encoding: 'utf-8', + }); + expect(upstreamBranches).not.toContain('feature-branch'); + + // The pi-fork remote was configured in the workspace. + const remotes = execSync('git remote -v', { cwd: workspace, encoding: 'utf-8' }); + expect(remotes).toContain('pi-fork'); + }); + + test('checks out and pushes updates on an existing fork branch', async () => { + if (!repo) { + return; + } + const { workspace } = repo; + + // Create the branch on the fork remote first. + fs.writeFileSync(path.join(workspace, 'v1.txt'), 'v1'); + await commitAndPushBranch({ + cwd: workspace, + branchName: 'update-branch', + message: 'Initial', + isNewBranch: true, + paths: ['v1.txt'], + log: captureLogger().log, + remote: { name: 'pi-fork', url: repo.forkDir }, + }); + + // Back on main, make another change and push it to the fork branch. + const git = simpleGit(workspace); + await git.checkout('main'); + fs.writeFileSync(path.join(workspace, 'v2.txt'), 'v2'); + + const { log } = captureLogger(); + await commitAndPushBranch({ + cwd: workspace, + branchName: 'update-branch', + message: 'Update', + isNewBranch: false, + paths: ['v2.txt'], + log, + remote: { name: 'pi-fork', url: repo.forkDir }, + }); + + // The fork branch now has both commits; origin never saw them. + const forkLog = execSync('git log --oneline update-branch', { + cwd: repo.forkDir, + encoding: 'utf-8', + }); + expect(forkLog.trim().split('\n').length).toBe(3); + const upstreamBranches = execSync('git branch', { + cwd: repo.upstreamDir, + encoding: 'utf-8', + }); + expect(upstreamBranches).not.toContain('update-branch'); + }); + + test('rethrows push failures after logging them', async () => { + if (!repo) { + return; + } + const { workspace } = repo; + + // Point origin at a nonexistent repository so the push fails. + const git = simpleGit(workspace); + await git.raw(['remote', 'set-url', 'origin', '/nonexistent/repo.git']); + + fs.writeFileSync(path.join(workspace, 'feature.txt'), 'new feature'); + const { log, messages } = captureLogger(); + await expect( + commitAndPushBranch({ + cwd: workspace, + branchName: 'doomed-branch', + message: 'Add feature', + isNewBranch: true, + paths: ['feature.txt'], + log, + }) + ).rejects.toThrow(); + + expect(messages.some(m => m.includes('Push failed with exception'))).toBe(true); + }); + + test('reuses an existing pi-fork remote with a changed URL', async () => { + if (!repo) { + return; + } + const { workspace } = repo; + + // Pre-configure pi-fork pointing somewhere stale. + const git = simpleGit(workspace); + await git.raw(['remote', 'add', 'pi-fork', '/stale/fork.git']); + + fs.writeFileSync(path.join(workspace, 'feature.txt'), 'new feature'); + const { log, messages } = captureLogger(); + await commitAndPushBranch({ + cwd: workspace, + branchName: 'feature-branch', + message: 'Add feature', + isNewBranch: true, + paths: ['feature.txt'], + log, + remote: { name: 'pi-fork', url: repo.forkDir }, + }); + + // The stale URL was replaced. + const url = (await git.raw(['remote', 'get-url', 'pi-fork'])).trim(); + expect(url).toBe(repo.forkDir); + expect(messages.some(m => m.includes('Configured git remote'))).toBe(true); + const forkBranches = execSync('git branch', { cwd: repo.forkDir, encoding: 'utf-8' }); + expect(forkBranches).toContain('feature-branch'); + }); +}); diff --git a/packages/pi-platform-github/tests/helpers/git-repo.ts b/packages/pi-platform-github/tests/helpers/git-repo.ts index 520c4584..82903054 100644 --- a/packages/pi-platform-github/tests/helpers/git-repo.ts +++ b/packages/pi-platform-github/tests/helpers/git-repo.ts @@ -100,3 +100,73 @@ export function cleanupGitRepo(workspace: string): void { const tmpRoot = path.dirname(workspace); fs.rmSync(tmpRoot, { recursive: true, force: true }); } + +/** + * A git environment simulating fork-based PR flows. + * + * `upstreamDir` plays the target repository (`origin`), `forkDir` plays the + * agent's fork (`pi-fork`): both are bare repositories laid out under + * `/remotes//.git` so that + * `buildForkRemoteUrl` — which rewrites the trailing `owner/repo` segments + * of the `origin` URL — derives exactly the fork path. + */ +export interface ForkGitRepo { + /** Cloned workspace whose `origin` points at the upstream bare repo. */ + workspace: string; + /** Bare repo acting as the target repository (`origin`). */ + upstreamDir: string; + /** Bare repo acting as the agent's fork (initially empty). */ + forkDir: string; +} + +/** + * Set up a workspace plus two bare remotes laid out as + * `remotes/{owner}/{repo}.git` — one for the target repository and one for + * the fork — so fork remote URLs can be derived from `origin` by swapping + * the owner/repo path segments (mirroring what `buildForkRemoteUrl` does). + * + * The workspace starts with a single initial commit on `main` pushed to the + * upstream remote; the fork remote is empty (forks start without the agent's + * branches). + */ +export function setupForkGitRepo(options: { + upstreamOwner: string; + upstreamRepo: string; + forkOwner: string; + forkRepo: string; +}): ForkGitRepo | undefined { + const { upstreamOwner, upstreamRepo, forkOwner, forkRepo } = options; + const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'pi-test-fork-')); + const remotesRoot = path.join(tmpRoot, 'remotes'); + const upstreamDir = path.join(remotesRoot, upstreamOwner, `${upstreamRepo}.git`); + const forkDir = path.join(remotesRoot, forkOwner, `${forkRepo}.git`); + const workspace = path.join(tmpRoot, 'workspace'); + + try { + fs.mkdirSync(upstreamDir, { recursive: true }); + fs.mkdirSync(forkDir, { recursive: true }); + fs.mkdirSync(workspace, { recursive: true }); + + // Bare remotes: upstream gets the initial commit, the fork starts empty + // (a freshly created fork has no agent branches yet — pushes to an + // empty bare repo work fine). + execSync('git init --bare --initial-branch=main', { cwd: upstreamDir, stdio: 'pipe' }); + execSync('git init --bare --initial-branch=main', { cwd: forkDir, stdio: 'pipe' }); + + // Working clone pointed at the upstream remote + execSync('git init --initial-branch=main', { cwd: workspace, stdio: 'pipe' }); + execSync(`git config user.name "${TEST_GIT_NAME}"`, { cwd: workspace, stdio: 'pipe' }); + execSync(`git config user.email "${TEST_GIT_EMAIL}"`, { cwd: workspace, stdio: 'pipe' }); + execSync(`git remote add origin ${upstreamDir}`, { cwd: workspace, stdio: 'pipe' }); + + fs.writeFileSync(path.join(workspace, 'README.md'), '# test'); + execSync('git add -A', { cwd: workspace, stdio: 'pipe' }); + execSync('git commit -m "init"', { cwd: workspace, stdio: 'pipe' }); + execSync('git push -u origin main', { cwd: workspace, stdio: 'pipe' }); + + return { workspace, upstreamDir, forkDir }; + } catch { + fs.rmSync(tmpRoot, { recursive: true, force: true }); + return undefined; + } +} diff --git a/packages/pi-platform-github/tests/pull-request-deps.spec.ts b/packages/pi-platform-github/tests/pull-request-deps.spec.ts index 72b12484..f81e7389 100644 --- a/packages/pi-platform-github/tests/pull-request-deps.spec.ts +++ b/packages/pi-platform-github/tests/pull-request-deps.spec.ts @@ -23,6 +23,11 @@ function createPRDeps(): GitHubModuleDeps { return { octokit: { rest: { + // The token authenticates as the repository owner — no fork is + // created in these legacy scenarios (same-repository PRs). + users: { + getAuthenticated: vi.fn(() => Promise.resolve({ data: { login: 'test-owner' } })), + }, pulls: { create: vi.fn(() => Promise.resolve({ @@ -220,6 +225,11 @@ describe('createPullRequest — fallback when pulls.create fails', () => { return { octokit: { rest: { + // Token authenticates as the repository owner (alex) — no fork, + // preserving the same-repository semantics these tests assert. + users: { + getAuthenticated: vi.fn(() => Promise.resolve({ data: { login: 'alex' } })), + }, pulls: { create: pullsCreateImpl ?? @@ -330,6 +340,11 @@ describe('createPullRequest — non-permission errors are re-thrown', () => { return { octokit: { rest: { + // Token authenticates as the repository owner (alex) — no fork, + // preserving the same-repository semantics these tests assert. + users: { + getAuthenticated: vi.fn(() => Promise.resolve({ data: { login: 'alex' } })), + }, pulls: { create: pullsCreateImpl }, }, } as any, @@ -455,3 +470,196 @@ describe('createPullRequest — non-permission errors are re-thrown', () => { expect(result.content[0]!.text).toContain("Can't read pulls"); }); }); + +describe('createPullRequest — push-capable non-owner token needs no fork', () => { + // The token authenticates as a non-owner (sam) who CAN push (collaborator + // or app installation token with contents:write). resolveForkForPR must + // detect the push permission and skip forking entirely: the branch is + // pushed to `origin` and a same-repository PR is opened with a plain + // (non cross-repository) head. + function createPushCapableDeps(workspace: string) { + return { + octokit: { + rest: { + users: { + getAuthenticated: vi.fn(() => Promise.resolve({ data: { login: 'sam' } })), + }, + pulls: { + create: vi.fn(() => + Promise.resolve({ + data: { + number: 77, + html_url: 'https://github.com/alex/ansible/pull/77', + head: { ref: 'pi/issue18-1234567890' }, + base: { ref: 'master' }, + }, + }) + ), + }, + repos: { + // Permission lookup for the context repository: sam can push. + get: vi.fn(() => + Promise.resolve({ + data: { + default_branch: 'master', + permissions: { + admin: false, + maintain: false, + push: true, + pull: true, + triage: false, + }, + }, + }) + ), + createFork: vi.fn(), + }, + }, + } as any, + context: { + repo: { owner: 'alex', repo: 'ansible' }, + issue: { number: 18 }, + eventName: 'issue_comment', + payload: { repository: { default_branch: 'master' } }, + serverUrl: 'https://github.com', + runId: 1, + runNumber: 1, + workspace, + }, + logger: { + debug: vi.fn(() => {}), + info: vi.fn(() => {}), + warning: vi.fn(() => {}), + notice: vi.fn(() => {}), + error: vi.fn(() => {}), + }, + } as unknown as GitHubModuleDeps; + } + + let repo: ReturnType; + + beforeEach(() => { + repo = setupGitRepo(); + if (repo) { + fs.writeFileSync(path.join(repo.workspace, 'new-file.txt'), 'hello world'); + } + }); + + afterEach(() => { + if (repo) { + cleanupGitRepo(repo.workspace); + } + }); + + test('opens a same-repository PR without creating a fork', async () => { + if (!repo) { + return; + } + const deps = createPushCapableDeps(repo.workspace); + const result = await createPullRequest(deps, { title: 'Fix podman prune' }); + + // PR was created against the context repository + expect(result.details.prCreated).toBe(true); + expect(result.details.pullRequestNumber).toBe(77); + expect(result.details.pullRequestUrl).toContain('alex/ansible/pull/77'); + + // No fork involved: fork details stay unset + expect(result.details.forkOwner).toBeUndefined(); + expect(result.details.forkRepo).toBeUndefined(); + expect(deps.octokit.rest.repos.createFork).not.toHaveBeenCalled(); + + // Same-repository head: plain branch name, not "sam:branch" + expect(deps.octokit.rest.pulls.create).toHaveBeenCalledWith( + expect.objectContaining({ + owner: 'alex', + repo: 'ansible', + head: expect.stringMatching(/^pi\/issue18-/), + }) + ); + }); + + test('pushes the branch to the repository itself (origin)', async () => { + if (!repo) { + return; + } + const deps = createPushCapableDeps(repo.workspace); + await createPullRequest(deps, { title: 'Fix bug' }); + + // The branch landed on the origin remote, not a fork remote + const { execSync } = await import('node:child_process'); + const branches = execSync('git branch', { cwd: repo.remoteDir, encoding: 'utf-8' }); + expect(branches).toContain('pi/issue18-'); + }); +}); + +describe('createPullRequest — token without push access falls back to fork', () => { + // The token authenticates as a non-owner (sam) who CANNOT push. The fork + // path is entered; when fork creation also fails (the bot/PAT cannot own + // forks) the actionable error surfaces. No git operations happen before + // the fork is resolved, so no git fixture is needed. + function createNoPushDeps() { + return { + octokit: { + rest: { + users: { + getAuthenticated: vi.fn(() => Promise.resolve({ data: { login: 'sam' } })), + }, + repos: { + // Permission lookup for alex/ansible says "no push"; the fork + // existence check for sam/ansible 404s (no fork yet). + get: vi.fn(({ owner }: { owner: string }) => + owner === 'sam' + ? Promise.reject(Object.assign(new Error('Not Found'), { status: 404 })) + : Promise.resolve({ + data: { + default_branch: 'master', + permissions: { + admin: false, + maintain: false, + push: false, + pull: true, + triage: false, + }, + }, + }) + ), + createFork: vi.fn(() => + Promise.reject(Object.assign(new Error('Forbidden'), { status: 403 })) + ), + }, + }, + } as any, + context: { + repo: { owner: 'alex', repo: 'ansible' }, + issue: { number: 18 }, + eventName: 'issue_comment', + payload: { repository: { default_branch: 'master' } }, + serverUrl: 'https://github.com', + runId: 1, + runNumber: 1, + workspace: '/tmp', + }, + logger: { + debug: vi.fn(() => {}), + info: vi.fn(() => {}), + warning: vi.fn(() => {}), + notice: vi.fn(() => {}), + error: vi.fn(() => {}), + }, + } as unknown as GitHubModuleDeps; + } + + test('attempts to create a fork and surfaces the actionable error', async () => { + const deps = createNoPushDeps(); + // resolveForkForPR runs before the formatCreateError try/catch in + // createPullRequest, so the fork error propagates as-is (it is already + // self-descriptive and actionable). + await expect(createPullRequest(deps, { title: 'Fix bug' })).rejects.toThrow( + /Failed to create a fork of "alex\/ansible".*Fork-based pull requests require a token that can create forks/s + ); + expect(deps.octokit.rest.repos.createFork).toHaveBeenCalledWith({ + owner: 'alex', + repo: 'ansible', + }); + }); +}); diff --git a/packages/pi-platform-github/tests/pull-request-fork.spec.ts b/packages/pi-platform-github/tests/pull-request-fork.spec.ts new file mode 100644 index 00000000..eada1165 --- /dev/null +++ b/packages/pi-platform-github/tests/pull-request-fork.spec.ts @@ -0,0 +1,463 @@ +/** + * @file Integration tests for fork-based pull request flows. + * + * Covers the `create_pull_request` / `update_pull_request` paths where the + * token cannot push to the target repository and the agent's own fork is + * used instead: fork get-or-create, the readiness wait for freshly created + * forks, pushing the branch to the fork remote (`pi-fork`), cross-repository + * PR heads (`forkOwner:branch`), and the compare-URL fallback. + * + * Fork-helper unit tests live in `tests/git/fork.spec.ts`; the git plumbing + * (remote option, push failure) in `tests/git/git-cli.spec.ts`. + */ + +import { describe, expect, test, vi, beforeEach, afterEach } from 'vitest'; +import * as fs from 'node:fs'; +import * as path from 'node:path'; +import { execSync } from 'node:child_process'; +import { createPullRequest, updatePullRequest } from '@alexanderfortin/pi-platform-github'; +import type { GitHubModuleDeps } from '@alexanderfortin/pi-platform-github'; +import { setupForkGitRepo, cleanupGitRepo, isolateGitConfig } from './helpers/git-repo'; + +// Isolate git ops from the host's global/system config (see isolateGitConfig). +isolateGitConfig(); + +/** Octokit-style error with a status code. */ +function httpError(status: number, message: string): Error { + return Object.assign(new Error(message), { status }); +} + +const noop = (): void => {}; + +/** Mock responses for the fork flow: sam cannot push to alex/ansible. */ +interface ForkFlowMocks { + getAuthenticated: ReturnType; + reposGet: ReturnType; + createFork: ReturnType; + getBranch: ReturnType; + pullsCreate: ReturnType; +} + +function forkFlowMocks(): ForkFlowMocks { + const mocks: ForkFlowMocks = { + // Permission lookup for the target repository (alex): no push access. + // The fork-existence check (sam) is configured per-test. + getAuthenticated: vi.fn(() => Promise.resolve({ data: { login: 'sam' } })), + reposGet: vi.fn(({ owner }: { owner: string }) => + owner === 'sam' + ? Promise.reject(httpError(404, 'Not Found')) + : Promise.resolve({ + data: { + default_branch: 'master', + permissions: { + admin: false, + maintain: false, + push: false, + pull: true, + triage: false, + }, + }, + }) + ), + createFork: vi.fn(() => Promise.resolve({ status: 202, data: { name: 'ansible' } })), + getBranch: vi.fn(() => Promise.resolve({ data: { commit: { sha: 'fork-sha' } } })), + pullsCreate: vi.fn(() => + Promise.resolve({ + data: { + number: 77, + html_url: 'https://github.com/alex/ansible/pull/77', + head: { ref: 'pi/issue18-1234567890' }, + base: { ref: 'master' }, + }, + }) + ), + }; + return mocks; +} + +function createForkDeps(workspace: string, mocks: ForkFlowMocks): GitHubModuleDeps { + return { + octokit: { + rest: { + users: { getAuthenticated: mocks.getAuthenticated }, + pulls: { create: mocks.pullsCreate }, + repos: { + get: mocks.reposGet, + createFork: mocks.createFork, + getBranch: mocks.getBranch, + }, + }, + } as any, + context: { + repo: { owner: 'alex', repo: 'ansible' }, + issue: { number: 18 }, + eventName: 'issue_comment', + payload: { repository: { default_branch: 'master' } }, + serverUrl: 'https://github.com', + runId: 1, + runNumber: 1, + workspace, + }, + logger: { + debug: noop, + info: noop, + warning: noop, + notice: noop, + error: noop, + }, + } as unknown as GitHubModuleDeps; +} + +describe('createPullRequest — fork-based flow', () => { + let repo: ReturnType; + let mocks: ForkFlowMocks; + + beforeEach(() => { + repo = setupForkGitRepo({ + upstreamOwner: 'alex', + upstreamRepo: 'ansible', + forkOwner: 'sam', + forkRepo: 'ansible', + }); + if (repo) { + fs.writeFileSync(path.join(repo.workspace, 'new-file.txt'), 'hello world'); + } + mocks = forkFlowMocks(); + }); + + afterEach(() => { + if (repo) { + cleanupGitRepo(repo.workspace); + } + }); + + test('creates the fork, pushes the branch to it, and opens a fork-based PR', async () => { + if (!repo) { + return; + } + const deps = createForkDeps(repo.workspace, mocks); + const result = await createPullRequest(deps, { title: 'Fix bug' }); + + // The fork was created via the API + expect(mocks.createFork).toHaveBeenCalledWith({ owner: 'alex', repo: 'ansible' }); + + // Readiness wait ran for the freshly created fork + expect(mocks.getBranch).toHaveBeenCalledWith({ + owner: 'sam', + repo: 'ansible', + branch: 'master', + }); + + // PR opened with the cross-repository "fork:branch" head + expect(mocks.pullsCreate).toHaveBeenCalledWith( + expect.objectContaining({ + owner: 'alex', + repo: 'ansible', + base: 'master', + head: expect.stringMatching(/^sam:pi\/issue18-/), + }) + ); + + // Details record the fork so consumers can tell fork-based PRs apart + expect(result.details.prCreated).toBe(true); + expect(result.details.forkOwner).toBe('sam'); + expect(result.details.forkRepo).toBe('ansible'); + + // The branch landed on the fork remote, not on origin + const forkBranches = execSync('git branch', { + cwd: repo.forkDir, + encoding: 'utf-8', + }); + expect(forkBranches).toContain('pi/issue18-'); + const upstreamBranches = execSync('git branch', { + cwd: repo.upstreamDir, + encoding: 'utf-8', + }); + expect(upstreamBranches).not.toContain('pi/issue18-'); + }); + + test('reuses an existing fork and skips the readiness wait', async () => { + if (!repo) { + return; + } + // sam/ansible already exists and is a fork of the target repository. + mocks.reposGet.mockImplementation(({ owner }: { owner: string }) => + owner === 'sam' + ? Promise.resolve({ + data: { name: 'ansible', fork: true, parent: { full_name: 'alex/ansible' } }, + }) + : Promise.resolve({ + data: { + default_branch: 'master', + permissions: { push: false, pull: true }, + }, + }) + ); + + const deps = createForkDeps(repo.workspace, mocks); + const result = await createPullRequest(deps, { title: 'Fix bug' }); + + // No fork creation, no readiness polling for a reused fork + expect(mocks.createFork).not.toHaveBeenCalled(); + expect(mocks.getBranch).not.toHaveBeenCalled(); + + // PR still opened from the fork + expect(mocks.pullsCreate).toHaveBeenCalledWith( + expect.objectContaining({ head: expect.stringMatching(/^sam:pi\/issue18-/) }) + ); + expect(result.details.prCreated).toBe(true); + expect(result.details.forkOwner).toBe('sam'); + }); + + test('warns and pushes anyway when the fork is not ready', async () => { + if (!repo) { + return; + } + // A freshly created fork may not report its default branch in time. + // A non-404 readiness error aborts the wait immediately (bounded + // best-effort), and the flow proceeds to push regardless. + mocks.getBranch.mockRejectedValue(httpError(403, 'Forbidden')); + + const deps = createForkDeps(repo.workspace, mocks); + const result = await createPullRequest(deps, { title: 'Fix bug' }); + + // The readiness check ran exactly once (no retry loop on non-404s)… + expect(mocks.getBranch).toHaveBeenCalledTimes(1); + + // …but the push and PR creation were still attempted. + expect(mocks.pullsCreate).toHaveBeenCalledWith( + expect.objectContaining({ head: expect.stringMatching(/^sam:pi\/issue18-/) }) + ); + expect(result.details.prCreated).toBe(true); + const forkBranches = execSync('git branch', { + cwd: repo.forkDir, + encoding: 'utf-8', + }); + expect(forkBranches).toContain('pi/issue18-'); + }); + + test('falls back to a fork compare URL when pulls.create lacks permission', async () => { + if (!repo) { + return; + } + // Reuse an existing fork so only the PR-creation step fails. + mocks.reposGet.mockImplementation(({ owner }: { owner: string }) => + owner === 'sam' + ? Promise.resolve({ + data: { name: 'ansible', fork: true, parent: { full_name: 'alex/ansible' } }, + }) + : Promise.resolve({ + data: { + default_branch: 'master', + permissions: { push: false, pull: true }, + }, + }) + ); + mocks.pullsCreate.mockRejectedValue(httpError(403, 'Resource not accessible by integration')); + + const deps = createForkDeps(repo.workspace, mocks); + const result = await createPullRequest(deps, { title: 'Fix bug' }); + + expect(result.details.prCreated).toBe(false); + expect(result.details.forkOwner).toBe('sam'); + expect(result.details.forkRepo).toBe('ansible'); + + // The compare URL uses the cross-repository "fork:branch" head form + expect(result.details.compareUrl).toContain( + 'https://github.com/alex/ansible/compare/master...sam:pi/issue18-' + ); + expect(result.content[0]!.text).toContain(result.details.compareUrl!); + + // The branch was still pushed to the fork + const forkBranches = execSync('git branch', { + cwd: repo.forkDir, + encoding: 'utf-8', + }); + expect(forkBranches).toContain('pi/issue18-'); + }); +}); + +describe('updatePullRequest — fork-based PR', () => { + let repo: ReturnType; + + beforeEach(() => { + repo = setupForkGitRepo({ + upstreamOwner: 'alex', + upstreamRepo: 'ansible', + forkOwner: 'sam', + forkRepo: 'ansible', + }); + if (repo) { + // The PR's head branch lives in the fork: publish it there. + execSync(`git push ${repo.forkDir} main:refs/heads/feature-branch`, { + cwd: repo.workspace, + stdio: 'pipe', + }); + } + }); + + afterEach(() => { + if (repo) { + cleanupGitRepo(repo.workspace); + } + }); + + test('pushes follow-up commits to the fork remote', async () => { + if (!repo) { + return; + } + const pullsUpdate = vi.fn(() => + Promise.resolve({ + data: { number: 77, html_url: 'https://github.com/alex/ansible/pull/77' }, + }) + ); + const deps = { + octokit: { + rest: { + pulls: { + // The PR head repository is the fork (sam/ansible), not the + // target repository (alex/ansible) the action runs on. + get: vi.fn(() => + Promise.resolve({ + status: 200, + data: { + number: 77, + html_url: 'https://github.com/alex/ansible/pull/77', + head: { + ref: 'feature-branch', + sha: 'head-sha-123', + repo: { owner: { login: 'sam' }, name: 'ansible' }, + }, + base: { ref: 'master' }, + }, + }) + ), + update: pullsUpdate, + }, + }, + } as any, + context: { + repo: { owner: 'alex', repo: 'ansible' }, + issue: { number: 18 }, + eventName: 'issue_comment', + payload: {}, + serverUrl: 'https://github.com', + runId: 1, + runNumber: 1, + workspace: repo.workspace, + }, + logger: { + debug: noop, + info: noop, + warning: noop, + notice: noop, + error: noop, + }, + } as unknown as GitHubModuleDeps; + + fs.writeFileSync(path.join(repo.workspace, 'follow-up.txt'), 'follow up'); + + const result = await updatePullRequest(deps, { + pull_number: 77, + message: 'Add follow-up', + }); + + // A new commit was created and reported + expect(result.details.commitSha).toMatch(/^[0-9a-f]{7,40}$/); + expect(result.details.headBranch).toBe('feature-branch'); + + // The follow-up landed on the fork's head branch, not on origin + const forkLog = execSync('git log --oneline feature-branch', { + cwd: repo.forkDir, + encoding: 'utf-8', + }); + expect(forkLog).toContain('Add follow-up'); + const upstreamLog = execSync('git log --oneline --all', { + cwd: repo.upstreamDir, + encoding: 'utf-8', + }); + expect(upstreamLog).not.toContain('Add follow-up'); + + // No title/body given — metadata untouched + expect(pullsUpdate).not.toHaveBeenCalled(); + }); + + test('pushes to a same-owner fork whose repo name differs', async () => { + if (!repo) { + return; + } + // Edge case: the head repository belongs to the context owner but has a + // different name (e.g. a renamed fork). The branch still lives outside + // the context repository, so updates must go to the fork remote. + const forkRepo = setupForkGitRepo({ + upstreamOwner: 'alex', + upstreamRepo: 'ansible', + forkOwner: 'alex', + forkRepo: 'ansible-fork', + }); + if (!forkRepo) { + return; + } + try { + execSync(`git push ${forkRepo.forkDir} main:refs/heads/feature-branch`, { + cwd: forkRepo.workspace, + stdio: 'pipe', + }); + + const deps = { + octokit: { + rest: { + pulls: { + get: vi.fn(() => + Promise.resolve({ + status: 200, + data: { + number: 78, + html_url: 'https://github.com/alex/ansible/pull/78', + head: { + ref: 'feature-branch', + sha: 'head-sha-456', + repo: { owner: { login: 'alex' }, name: 'ansible-fork' }, + }, + base: { ref: 'master' }, + }, + }) + ), + update: vi.fn(), + }, + }, + } as any, + context: { + repo: { owner: 'alex', repo: 'ansible' }, + issue: { number: 18 }, + eventName: 'issue_comment', + payload: {}, + serverUrl: 'https://github.com', + runId: 1, + runNumber: 1, + workspace: forkRepo.workspace, + }, + logger: { + debug: noop, + info: noop, + warning: noop, + notice: noop, + error: noop, + }, + } as unknown as GitHubModuleDeps; + + fs.writeFileSync(path.join(forkRepo.workspace, 'follow-up.txt'), 'follow up'); + + const result = await updatePullRequest(deps, { pull_number: 78, message: 'Edge update' }); + + expect(result.details.commitSha).toMatch(/^[0-9a-f]{7,40}$/); + const forkLog = execSync('git log --oneline feature-branch', { + cwd: forkRepo.forkDir, + encoding: 'utf-8', + }); + expect(forkLog).toContain('Edge update'); + } finally { + cleanupGitRepo(forkRepo.workspace); + } + }); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e57ef7ca..91bc5570 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,14 +15,14 @@ importers: specifier: workspace:* version: link:packages/pi-platform-github '@earendil-works/pi-agent-core': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@earendil-works/pi-ai': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@earendil-works/pi-coding-agent': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) devDependencies: '@actions/github': specifier: ^9.1.1 @@ -80,7 +80,10 @@ importers: version: 6.0.3 vitest: specifier: ^4.1.11 - version: 4.1.11(@opentelemetry/api@1.9.0)(@types/node@26.1.1)(@vitest/coverage-v8@4.1.10)(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)) + version: 4.1.11(@opentelemetry/api@1.9.0)(@types/node@26.1.1)(@vitest/coverage-v8@4.1.10)(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)) + yaml: + specifier: ^2.4.0 + version: 2.9.0 packages/pi-action: dependencies: @@ -97,14 +100,14 @@ importers: specifier: workspace:* version: link:../pi-platform-github '@earendil-works/pi-agent-core': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@earendil-works/pi-ai': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@earendil-works/pi-coding-agent': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@js-temporal/polyfill': specifier: ^0.5.1 version: 0.5.1 @@ -132,8 +135,8 @@ importers: version: 3.36.0(supports-color@7.2.0) devDependencies: '@earendil-works/pi-coding-agent': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) typebox: specifier: ^1.3.6 version: 1.3.6 @@ -147,14 +150,14 @@ importers: specifier: workspace:* version: link:../pi-platform-github '@earendil-works/pi-agent-core': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@earendil-works/pi-ai': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@earendil-works/pi-coding-agent': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@js-temporal/polyfill': specifier: ^0.5.1 version: 0.5.1 @@ -171,14 +174,14 @@ importers: packages/pi-orchestrator: dependencies: '@earendil-works/pi-agent-core': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@earendil-works/pi-ai': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@earendil-works/pi-coding-agent': - specifier: ^0.85.1 - version: 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + specifier: ^0.87.1 + version: 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@js-temporal/polyfill': specifier: ^0.5.1 version: 0.5.1 @@ -243,8 +246,8 @@ packages: peerDependencies: semantic-release: '>=24.0.0' - '@anthropic-ai/sdk@0.123.0': - resolution: {integrity: sha512-Y9oX9mPNGZClHQOFqrWRk43Srcu/UHuPq3rfxxOq7JgW0gi+lJA2MAOK4Ul3k/+AUrwRWFJvd0tK3oC0Pw25dw==} + '@anthropic-ai/sdk@0.124.0': + resolution: {integrity: sha512-cN5O8i9UVxHeOQAzj/XjshWXG8KiibJDw9OGpH2Z/eR3n/RBxdoLxDJOcfqAJWvjaMDFfHTBADU04hWRJVkDyA==} hasBin: true peerDependencies: zod: ^3.25.0 || ^4.0.0 @@ -252,57 +255,44 @@ packages: zod: optional: true - '@aws-crypto/sha256-browser@5.2.0': - resolution: {integrity: sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==} - - '@aws-crypto/sha256-js@5.2.0': - resolution: {integrity: sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==} - engines: {node: '>=16.0.0'} - - '@aws-crypto/supports-web-crypto@5.2.0': - resolution: {integrity: sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==} - - '@aws-crypto/util@5.2.0': - resolution: {integrity: sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==} - - '@aws-sdk/client-bedrock-runtime@3.1048.0': - resolution: {integrity: sha512-u+NT61JZEkRFtpL0CAw1N1dwxnaLgwVXQl/zjJxTGgLyS/jTIdg2SdoEoCTHxgDyCnqa1HEi9QOoE9/pYRNpOQ==} + '@aws-sdk/client-bedrock-runtime@3.1127.0': + resolution: {integrity: sha512-IDl/lrPb90aH+pZFHGNDmgH9nAUQj5PlZH1sJ3w7RikctyjHSnY3oNjZhrLoaBoQn/rNK0zsP6OHEqEhj2tdLA==} engines: {node: '>=20.0.0'} - '@aws-sdk/core@3.977.9': - resolution: {integrity: sha512-reqPFEQrZxDZpeGj4PFMepBeR5LGYHRqq/L0motTzgFkCRBA4rFdaVXDSLYyGHhxVz7sT2PDnPN9CluGSfgyJA==} + '@aws-sdk/core@3.978.0': + resolution: {integrity: sha512-2yX9LUmxPklVjSGTb8dfnWRJSiFQ3TeH2nn7G1mdKHTfnabzF0+gfrS8rYfLWmZrQ8A3mEcxMJjRc51dL5KWaA==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-env@3.972.70': - resolution: {integrity: sha512-H404B7dJl2mCrBqahDEYsanB0xhdDp6tXnXcTUnXmmpy2Q3J0Ho0bUajZ2jr/RdwzCyS59Gi8xXIFwPLGBl6Uw==} + '@aws-sdk/credential-provider-env@3.972.71': + resolution: {integrity: sha512-JN+JHruYZw3GUZB8YGAlDk4wTDPOEAEEdEzj5nS0xodWR4smzHsN7PnK2j6IeOsDIj2aqua5DSbhXl9Gtf90FQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-http@3.972.72': - resolution: {integrity: sha512-X98zYOrVOeuosCX+6ktf29FC2N2GHPLia7qv6mzPzTc+RPAuHWCDS++Z6JK7eGYqb/v6uaW7bAXaOvDBfol+0w==} + '@aws-sdk/credential-provider-http@3.972.73': + resolution: {integrity: sha512-uyYYnJOnlis8uQzaYGPd7N1JoioCoNpXgnkXYixsWJXHXgXyYi8WXJSDfofxJeWfQIGWLe2Nwyq60Uc7MZdVOg==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-ini@3.973.15': - resolution: {integrity: sha512-Rykg6s5ceBuynMOGWgoowO4N+27JfnqXAnVaSunZl0hOO1XodSrxGNz6sCEbnmS0lAfQZDKyb3fbr46gSuv6Sg==} + '@aws-sdk/credential-provider-ini@3.973.16': + resolution: {integrity: sha512-i++ly+0Uxa+u3ebSSyr0S/3CFhFJDxCXT3+Zj+mW2bXenEx5bKGCdTIKFu39SgXBNhWDjex/8cXUx9MUTMCrTw==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-login@3.972.77': - resolution: {integrity: sha512-Jb59xfEISoN5mmbnA+HYqdtrSX3CgCtJoof+V5D8/TgUI56W63GEEd5Y58WijU3Ou6+WEgaLD1feVzaRXV5IDQ==} + '@aws-sdk/credential-provider-login@3.972.78': + resolution: {integrity: sha512-eUtswnXu0+Ii9ieRK+0L7aPFV3Z/dnW2VntJzjBP9xs8s+8p5nBNuymIXtXwZ+5r5+XJP3e32nMkuZ/r0HozEA==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-node@3.972.81': - resolution: {integrity: sha512-Rml+WitoFvXmv6JZ18U/xGdGDGGvB/mOin0ya0lTnTrdC0Z1lrVxTYh7iNklZBcvcRMrs4DoEf6xy1KWyrLQQw==} + '@aws-sdk/credential-provider-node@3.972.83': + resolution: {integrity: sha512-jdso7ejzfRnatxMUZK4S/U6KbaDPCvfIV4XL+IQAPFDBt5rj5Fq595euqlK8Le4lNCMFR9oUpt+1l0aMgaayOQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-process@3.972.70': - resolution: {integrity: sha512-2ry03fGRJr4sV3jI+ocjj5JqALnFD6ymM5KiNCDZMvq8bX2GSbE0vji4aM43TVCl2nXqqLRZaUxdq/KeWRAY4Q==} + '@aws-sdk/credential-provider-process@3.972.71': + resolution: {integrity: sha512-lYmXJa4gvq4xN1lrT5NiP5vIYYKcGWAdj8y+8o6dlcateB5eF3Dn8DtmjjHKfMBrTPAMr2pebIiX/UOj8c1/UA==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-sso@3.973.14': - resolution: {integrity: sha512-jkhg/8ocAAoc0RFyLMhCw+/zZh7gystQgd4F4hznNa8P4Cc501PQmxd+jGLiMHodPJ+7Zv/3znM62gZojyasmA==} + '@aws-sdk/credential-provider-sso@3.973.15': + resolution: {integrity: sha512-6Jhcf4v0pSFdjk1EW2kvzuEBKD+UZ2uNcHUIglKKLndD20YhvkL2kdmDOV5/j4mYuWWwe/a1FQ1aomU86/Cg5Q==} engines: {node: '>=20.0.0'} - '@aws-sdk/credential-provider-web-identity@3.972.76': - resolution: {integrity: sha512-d3AGyVu759PGr35mEB2s22xxlNEA5rpdxtSPJthfPFJvoQ8dt357iVPECqWfUxXp1toJAvKmbtcIYVGigaGsCA==} + '@aws-sdk/credential-provider-web-identity@3.972.77': + resolution: {integrity: sha512-uylIQSUWpfLuH2LovxEEfwzJGM/SabLOfLMg6YXu/E8jJEKUdpdILCVCQCdFvHyu/7dLJOHPMfrSwduxO56NkQ==} engines: {node: '>=20.0.0'} '@aws-sdk/eventstream-handler-node@3.972.34': @@ -313,34 +303,30 @@ packages: resolution: {integrity: sha512-dlRzHCgyB8W6hLuDC5pcT5q+ziPt00n4QGgGBE17ucLVU4zMa6lsbuUdQ2Pm75Z5VA8GF+R/+SgrRcaTdIzSIQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/middleware-websocket@3.972.52': - resolution: {integrity: sha512-vsPPM+nMbKJlUCFU+eoGZbdxdxDIAX9LbpjSXaR5Ufpmqgp8TdYQnoExhLu4T3umW/JIIPny1ydbhWidZZYokQ==} + '@aws-sdk/middleware-websocket@3.972.53': + resolution: {integrity: sha512-bIrDaMENQmYRBHntOiOheqkiw5+fhKW4Lqb+mS1uqF0VwvdWI22fW2HFgWrng66CmYd+4k8ePlpj38sEfTuMLQ==} engines: {node: '>= 14.0.0'} - '@aws-sdk/nested-clients@3.997.44': - resolution: {integrity: sha512-NhEgryjlBF9w38ZXqGymQV28IhkYa1mKhlbYnqIis57AYwWGVYfUPgg/qC2rLRqOUfblxx++irvju10kVTa8Vw==} + '@aws-sdk/nested-clients@3.997.45': + resolution: {integrity: sha512-mooq9Q+jLa18VoM7HouczmslZU60iiB0aKc/Ztnq/luIL1ud0z4DnYprLR/ZO1gp331S9tJctM1HZr7u6YKBXQ==} engines: {node: '>=20.0.0'} '@aws-sdk/signature-v4-multi-region@3.996.46': resolution: {integrity: sha512-L+2xZTye/2T96f3lwCws0Zw6GG2JHZW9e8FpVgGBeeExSKyeoZ6CWRpBml/7DNiK/O26jrgPM9F+Ay8VkgzUWQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/token-providers@3.1048.0': - resolution: {integrity: sha512-k0y/GcuesuSfWyUM0WamrGyeZmltRYaPbHO82UDA6mZ/doB+FOHKutikPAtSXMn/hDz970cF+iRuuiYO9VEbAA==} + '@aws-sdk/token-providers@3.1127.0': + resolution: {integrity: sha512-Dv2TMWBshJ+tF6ahs2Sy5bh4Iabsd4GAQqVvE9XZmYmnoaVbpS2QKIKE/HRacc7bTtbjEEvP+laGzHvHlf1CiQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/token-providers@3.1116.0': - resolution: {integrity: sha512-ygIivKqh8aHzNkucOCXHyIBgBpLPfrSI0mCqXF+vLBsPTUKqj0VSqAY0GFPe7lQl4HntjOcQ+KSyS7oUV2C54Q==} + '@aws-sdk/token-providers@3.1129.0': + resolution: {integrity: sha512-Sbl3rpzQdsG4ZK2zh0JWUYyZPKKorJlVOddA2T0DVbKJFrsW8J6wgnslxxUH04+WaBMr4A1HzJZvZX0xUvkniA==} engines: {node: '>=20.0.0'} '@aws-sdk/types@3.974.5': resolution: {integrity: sha512-LkwLL2BLbC6wNNm4JaH9mbEqBMdOZCct6VAYqhdN4U1xrWM+fUJQEfbHwQgDypapOWTRtlk25akb5afM0P8CIQ==} engines: {node: '>=20.0.0'} - '@aws-sdk/util-locate-window@3.965.10': - resolution: {integrity: sha512-ycwH6Zd2GhuSqdXX9ihbCjeGTB6xOJs+O3+Jb8/zDG9978XU80qs75dfkPJRMNKe5MvBZPuNeFpd4JZKPoUF4g==} - engines: {node: '>=20.0.0'} - '@aws-sdk/xml-builder@3.972.40': resolution: {integrity: sha512-wlFmCIGUlwF4zx/kncw+bmxTQh1HeSJq4mYV/V5cZUSJadDP3kXvGW8Rn21cimj/7y9ju+47oYWXi97vF7czaA==} engines: {node: '>=20.0.0'} @@ -386,30 +372,30 @@ packages: resolution: {integrity: sha512-TzlTVpKPjaqW6qOYjQcYUDuGsLCNsvFHVBXkYGTAnf5V37jCWrE5haKNXzz0WZUtVHjrpV76L1buANjwXMfT8w==} engines: {node: '>=22'} - '@earendil-works/chord@0.85.1': - resolution: {integrity: sha512-VDlkEC3dhCzQ5fcyH1OhG19dq+6jCn+rqc/iXFivwDYGR5anwo2RCiXij9PpHhqNR5GuhhE+Er69Zi1Sn4eY6w==} + '@earendil-works/chord@0.87.1': + resolution: {integrity: sha512-bg7IkJGFcEaMqqYgOGUiq5Ky9RghpRfrlZ8I/v/1b4bBZ02A7t3E+6uhPRbadwWb/kWsnVFbZsqOKRN4a3LLCg==} engines: {node: '>=22.19.0'} - '@earendil-works/pi-agent-core@0.85.1': - resolution: {integrity: sha512-hIXIP3eAWueAYiAl8aMvWCvvZ8Q5gT3Dip5bE5uJyIGh4+YlWRjtMLI4BaeoXoSs93zndjue61u1B/vhefLnuA==} + '@earendil-works/pi-agent-core@0.87.1': + resolution: {integrity: sha512-Zev3B0HK7YS5A4EZQ2XnEqiJuirx6QBiltJ+LpmjV5a/+2IU0cfKtIfnkNkORK707XOvKBY2WRtk7cAwHpbh2Q==} engines: {node: '>=22.19.0'} - '@earendil-works/pi-ai@0.85.1': - resolution: {integrity: sha512-+VgVIJDkDO2efYJKEEqvPTH4zmnIaXdAppGbO+vKFA9qy5PdhFiAenuFAkU+oiCSfOC4dMHDyrjdQeL4ZoC5CQ==} + '@earendil-works/pi-ai@0.87.1': + resolution: {integrity: sha512-X/3PfQBnnoeVdO9Cv8zHghUMglzlgNZYGNzoPnbRoGnHl3Rw3TlA2UKSUB7BRHUOxMryHXYa8dnjWZlbRheDZA==} engines: {node: '>=22.19.0'} hasBin: true - '@earendil-works/pi-coding-agent@0.85.1': - resolution: {integrity: sha512-FGRN+OHbWaefBPGaTggAdLjrIHW+s2PzLyglz/5dfLzb9of7uuXMXYC0fJIeZTw+shS32o2cuQ9jF7YSDuL/oQ==} + '@earendil-works/pi-coding-agent@0.87.1': + resolution: {integrity: sha512-m8ArJUtVcQMSe1lLE/Ei7vX/JV7O39sWmWBsXV2NOU70F0qCp8GubA24pT3LnwTmM6LL2xV80/h6sQg85n69ew==} engines: {node: '>=22.19.0'} hasBin: true - '@earendil-works/pi-telemetry@0.85.1': - resolution: {integrity: sha512-Bg/YN6kA7Swja/NQxka8xFdecb4E/auIEGF2G5A25EaQXhRnPj300/7/KpgsDDMYUzHTDAv4RyUxaQPJKW81Rw==} + '@earendil-works/pi-telemetry@0.87.1': + resolution: {integrity: sha512-MC6TRQH5lgMXpcN+Vku2WMI2T8BsiUPzMQHGo81uqFZD3/9O79WWJAysEDGuzduP6R4tvtgwMLwmqIxynM10JQ==} engines: {node: '>=22.19.0'} - '@earendil-works/pi-tui@0.85.1': - resolution: {integrity: sha512-OIzw9efInmO4WOBnD4TxcTdBjmzvYJpzslkgoUro946nEGoYWg5rwv1p4fDt3/JvMx9QybryUCUwlm7j8Dreig==} + '@earendil-works/pi-tui@0.87.1': + resolution: {integrity: sha512-YEH2vRyOeiO7hhN6j6AE6YwKSq2Kz2f3XR8bj1TbR+aGE/JsnY1hLPMI2pvaZfRM1n9Y00tejxFQ4zbzvF7nkQ==} engines: {node: '>=22.19.0'} '@emnapi/core@1.11.1': @@ -427,156 +413,312 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/aix-ppc64@0.28.2': + resolution: {integrity: sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/android-arm64@0.28.1': resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==} engines: {node: '>=18'} cpu: [arm64] os: [android] + '@esbuild/android-arm64@0.28.2': + resolution: {integrity: sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm@0.28.1': resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==} engines: {node: '>=18'} cpu: [arm] os: [android] + '@esbuild/android-arm@0.28.2': + resolution: {integrity: sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-x64@0.28.1': resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==} engines: {node: '>=18'} cpu: [x64] os: [android] + '@esbuild/android-x64@0.28.2': + resolution: {integrity: sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/darwin-arm64@0.28.1': resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] + '@esbuild/darwin-arm64@0.28.2': + resolution: {integrity: sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-x64@0.28.1': resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==} engines: {node: '>=18'} cpu: [x64] os: [darwin] + '@esbuild/darwin-x64@0.28.2': + resolution: {integrity: sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/freebsd-arm64@0.28.1': resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-arm64@0.28.2': + resolution: {integrity: sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-x64@0.28.1': resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] + '@esbuild/freebsd-x64@0.28.2': + resolution: {integrity: sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/linux-arm64@0.28.1': resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==} engines: {node: '>=18'} cpu: [arm64] os: [linux] + '@esbuild/linux-arm64@0.28.2': + resolution: {integrity: sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm@0.28.1': resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==} engines: {node: '>=18'} cpu: [arm] os: [linux] + '@esbuild/linux-arm@0.28.2': + resolution: {integrity: sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-ia32@0.28.1': resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==} engines: {node: '>=18'} cpu: [ia32] os: [linux] + '@esbuild/linux-ia32@0.28.2': + resolution: {integrity: sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-loong64@0.28.1': resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==} engines: {node: '>=18'} cpu: [loong64] os: [linux] + '@esbuild/linux-loong64@0.28.2': + resolution: {integrity: sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-mips64el@0.28.1': resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] + '@esbuild/linux-mips64el@0.28.2': + resolution: {integrity: sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-ppc64@0.28.1': resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] + '@esbuild/linux-ppc64@0.28.2': + resolution: {integrity: sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-riscv64@0.28.1': resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] + '@esbuild/linux-riscv64@0.28.2': + resolution: {integrity: sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-s390x@0.28.1': resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==} engines: {node: '>=18'} cpu: [s390x] os: [linux] + '@esbuild/linux-s390x@0.28.2': + resolution: {integrity: sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-x64@0.28.1': resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==} engines: {node: '>=18'} cpu: [x64] os: [linux] + '@esbuild/linux-x64@0.28.2': + resolution: {integrity: sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + '@esbuild/netbsd-arm64@0.28.1': resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] + '@esbuild/netbsd-arm64@0.28.2': + resolution: {integrity: sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + '@esbuild/netbsd-x64@0.28.1': resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.28.2': + resolution: {integrity: sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + '@esbuild/openbsd-arm64@0.28.1': resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-arm64@0.28.2': + resolution: {integrity: sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-x64@0.28.1': resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] + '@esbuild/openbsd-x64@0.28.2': + resolution: {integrity: sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/openharmony-arm64@0.28.1': resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] + '@esbuild/openharmony-arm64@0.28.2': + resolution: {integrity: sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + '@esbuild/sunos-x64@0.28.1': resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==} engines: {node: '>=18'} cpu: [x64] os: [sunos] + '@esbuild/sunos-x64@0.28.2': + resolution: {integrity: sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/win32-arm64@0.28.1': resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==} engines: {node: '>=18'} cpu: [arm64] os: [win32] + '@esbuild/win32-arm64@0.28.2': + resolution: {integrity: sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-ia32@0.28.1': resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==} engines: {node: '>=18'} cpu: [ia32] os: [win32] + '@esbuild/win32-ia32@0.28.2': + resolution: {integrity: sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-x64@0.28.1': resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==} engines: {node: '>=18'} cpu: [x64] os: [win32] + '@esbuild/win32-x64@0.28.2': + resolution: {integrity: sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@eslint-community/eslint-utils@4.9.1': resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -647,8 +789,8 @@ packages: cpu: [x64] os: [win32] - '@google/genai@1.52.0': - resolution: {integrity: sha512-gwSvbpiN/17O9TbsqSsE/OzZcpv5Fo4RQjdngGgogtuB9RsyJ8ZHhX5KjHj1bp5N9snN2eK8LDGXSaWW2hof8Q==} + '@google/genai@2.21.0': + resolution: {integrity: sha512-+PDtco2/Z0ONdzCGekCoCT+O1VJS9xJQNN4XzQpXG/t3El/SWWMkCWlFRO1KmivOHPa4Q0VjUYu1HBKCZ/v33Q==} engines: {node: '>=20.0.0'} peerDependencies: '@modelcontextprotocol/sdk': ^1.25.2 @@ -696,74 +838,6 @@ packages: '@kwsites/promise-deferred@1.1.1': resolution: {integrity: sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==} - '@mariozechner/clipboard-darwin-arm64@0.3.9': - resolution: {integrity: sha512-BfgV7vCEWZwJwZJw03r6bP5+tf0iI/ANuQYCxi9RNn7FrWB3yzGuMKCrNLRl6V761vXRdL8+OqZ0wd4TqlsNOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@mariozechner/clipboard-darwin-universal@0.3.9': - resolution: {integrity: sha512-BGGR4iA9Z2shAjI65eI5xtyb3LYNlDW9X3gxKxDbqtbnREohsrqznov6zpKoIrsRWpzlYVEdKphS7ksJ0/ndSQ==} - engines: {node: '>= 10'} - os: [darwin] - - '@mariozechner/clipboard-darwin-x64@0.3.9': - resolution: {integrity: sha512-4kURmCbS6nt8uYhtmWpUcJWyPHfmAr5dTpXD1nO3pIfa+TSQ9DbrGOYCKH+aEFW47XhQ4Vp8ZTszie+wfFvDKg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@mariozechner/clipboard-linux-arm64-gnu@0.3.9': - resolution: {integrity: sha512-g59OkUGP2DDfCOIKypHeYgv2M55u/cKvXa5dSxFbEJ34XvIQMdcVmpKCkGUro3ZgefXiGVdwguvTMQGpHWzIXw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@mariozechner/clipboard-linux-arm64-musl@0.3.9': - resolution: {integrity: sha512-AGuJdgKsmJdm4Pych7kv3sqe591ERRaAHW3xjLooiFzn8J+PxUyof++7YZrB5Y5tpnTO+K18Og3taj2NpluCRQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@mariozechner/clipboard-linux-riscv64-gnu@0.3.9': - resolution: {integrity: sha512-DXBEAiuMpk7dhS1a9NzNxVAFi1vaKoPu7rQNgY8LIDLGrK3lnIp3nT10DUum+PKVJoJppIP+NAA8IZe4DMNDPw==} - engines: {node: '>= 10'} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@mariozechner/clipboard-linux-x64-gnu@0.3.9': - resolution: {integrity: sha512-WORrMLd6EpElEME7JRKfSaY34nW1P5LbdgK5YNCS1ncG2LqmITsSMEJ8nh2mpvxb3TxqbOOKgY7k9eMJYlW9Mw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@mariozechner/clipboard-linux-x64-musl@0.3.9': - resolution: {integrity: sha512-/DHn+1DrfL6oRaPPWXaOKvonFFrni666fxd+zFqiQEfvBH0tsHVWjq9iqBk0oDp0qaPA72lIMy5BptxISBEhZQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - libc: [musl] - - '@mariozechner/clipboard-win32-arm64-msvc@0.3.9': - resolution: {integrity: sha512-O5FHD3ErkMwMhNzAfu3ggy0ug4z7btZuoQgwwxlzPrwV2bxlD6WDpqBY4NCgICAgZdDKdp+loUEKVAVt8aYnhQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@mariozechner/clipboard-win32-x64-msvc@0.3.9': - resolution: {integrity: sha512-ihQC3EufqEY81vhXBgVBtK4prL+wc62zJsSvxrgz7K1hsdt6OObz6v9p3Rn1OG3GJksTTKMJF0u/guMISHPhSA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@mariozechner/clipboard@0.3.9': - resolution: {integrity: sha512-ABnA53mdfkGZwOFUdZNv2S0CWGO/EIuPj8Vv9xmBFmSYg/qFc7ihO6q5FcQjvoE67kZpWkEc4AhD6B/os04yuA==} - engines: {node: '>= 10'} - '@napi-rs/wasm-runtime@1.1.6': resolution: {integrity: sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==} peerDependencies: @@ -1036,46 +1110,30 @@ packages: resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} engines: {node: '>=18'} - '@smithy/core@3.33.3': - resolution: {integrity: sha512-CsOeKq/9kA3y6VJHt+/+VTCtBaxJ4OTFpgrjIUhPpDIKxBci1k2bJaQASF2h/ELWrulGp+t97DZ0mevfAD8idg==} + '@smithy/core@3.34.1': + resolution: {integrity: sha512-dLcOUxz8YCv1RZUMKq6GbyUf95pLbrqh34bPvpCZ1+CByFF31BEAFewZjsGCnVsZTKdThNENfGyAgk2TJqVwSw==} engines: {node: '>=18.0.0'} '@smithy/credential-provider-imds@4.5.2': resolution: {integrity: sha512-A9uSdn72ozbRUSit0eib0TW7nXuNPlaeM0zcGkJ+nE6tFcSDbnmtwoxbTCFBukVQcszDAyvsd7+rTduPTXpygg==} engines: {node: '>=18.0.0'} - '@smithy/fetch-http-handler@5.7.2': - resolution: {integrity: sha512-nZyWTmSpJEXl6VtWVMBJve/7x12DZu6sIX1z1a+ZMaHlQQRs9Zpu6NbTe/gmxYXVRpkjxyDYpZ5gx2IM6f/Wkw==} + '@smithy/fetch-http-handler@5.8.0': + resolution: {integrity: sha512-ycSJu3tFAQ4v04CBB0agqFMVsSQ1iG3yw+SpgxRqKfaURpQD4CZ8Wn0zPMmSnOuTpTh65Vz+EA0rMrw089wvkA==} engines: {node: '>=18.0.0'} - '@smithy/is-array-buffer@2.2.0': - resolution: {integrity: sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==} - engines: {node: '>=14.0.0'} - - '@smithy/node-http-handler@4.11.3': - resolution: {integrity: sha512-2jY1tSpERfPfWqyBV2pH+iGFaghVsIJszJNsT7hxtQYhVJpWDyc0LqOWI+nXOxOAHaEfZ4PXXtp1wW1TGpHhkA==} - engines: {node: '>=18.0.0'} - - '@smithy/node-http-handler@4.7.3': - resolution: {integrity: sha512-/jPhevcTFPMVl6KNjbaI47iOg1zxC7IsnX4PQDGVZKMFceOXtB8IEYaB7a9VvkP/3oC60WzTeKocvSI7vLT0vA==} + '@smithy/node-http-handler@4.12.1': + resolution: {integrity: sha512-ThMkboGeONWXAelq9FvGsuJC4rOi+qyC4/zhUF58xYpxUg5sQKx2VXZYJmtNjr4dSuBJ1HeJXETQILCz3wOHvw==} engines: {node: '>=18.0.0'} '@smithy/signature-v4@5.7.3': resolution: {integrity: sha512-7ImGm+FkHRLcBaRttIAMZ6bzJZWb2cJGoYjq46F2UjycujWzrL9GEN9h4w7eQyXJYnltrUhxbbieBAIRrdqpow==} engines: {node: '>=18.0.0'} - '@smithy/types@4.17.2': - resolution: {integrity: sha512-FOKpVZob9MPTn2znRzGrnsMHv7BOsKVw3XiP/cOyYLDVZ9qKp4nifIiSCuUU/fIj5Vu0UOAxCFr+qRAtG0NUkA==} + '@smithy/types@4.18.0': + resolution: {integrity: sha512-CgB6HHWer/vrKps24ulRIbpcpb7K4xAU7SkZ7YHzBPlwHsvsrCJFEXK421s+cJzX+ZrqtA/TuU5w1HzI7k9N8A==} engines: {node: '>=18.0.0'} - '@smithy/util-buffer-from@2.2.0': - resolution: {integrity: sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==} - engines: {node: '>=14.0.0'} - - '@smithy/util-utf8@2.3.0': - resolution: {integrity: sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==} - engines: {node: '>=14.0.0'} - '@stablelib/base64@1.0.1': resolution: {integrity: sha512-1bnPQqSxSuc3Ii6MhBysoWCg58j97aUjuCSZrGSmDxNqtytIi0k8utUenAwTZN4V5mXXYGsVUI9zeBqy+jBOSQ==} @@ -1103,8 +1161,8 @@ packages: '@types/node@26.1.1': resolution: {integrity: sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==} - '@types/node@26.3.0': - resolution: {integrity: sha512-L3fgrnchriRC2ExBflb8j4uZZURHZfQsmQeyVzhjcHW4kkwVyo8/0h1B2MVzMTrYUJYu6G7EWs14hW/L9putqw==} + '@types/node@26.6.2': + resolution: {integrity: sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -1310,6 +1368,10 @@ packages: bowser@2.14.1: resolution: {integrity: sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==} + brace-expansion@5.0.12: + resolution: {integrity: sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==} + engines: {node: 20 || >=22} + brace-expansion@5.0.9: resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==} engines: {node: 20 || >=22} @@ -1341,6 +1403,10 @@ packages: resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + chalk@6.0.0: + resolution: {integrity: sha512-2uNTXIuTTxk7ciZgAU1BQcgnchcG0xXnrs6jzkQfj9SsRa9M2s5zE8WT96hS6KmG4MzWHSrvH43DF1m4XRkrFg==} + engines: {node: '>=22'} + char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} @@ -1529,6 +1595,11 @@ packages: engines: {node: '>=18'} hasBin: true + esbuild@0.28.2: + resolution: {integrity: sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==} + engines: {node: '>=18'} + hasBin: true + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -1744,8 +1815,8 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - grok-mermaid@0.2.2: - resolution: {integrity: sha512-XcJEP5dDC8liHBh52mlLjU18fNvu1ckFsu0QpIG3+APZ270fsj9wxpiA6cOURmbUEuoMVgjbC2+UYgTdCqqgzA==} + grok-mermaid@0.2.3: + resolution: {integrity: sha512-/4KopAbsjvuRP9MdPtlDjOHUmUVEohOX73JNcsWpzAtFxh+bq5+Dhb6gzvRieLDwIPQIR3/vy8V1NNTuz4Zsmg==} engines: {node: '>=18'} handlebars@4.7.9: @@ -1779,10 +1850,6 @@ packages: html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - http-proxy-agent@7.0.2: - resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} - engines: {node: '>= 14'} - http-proxy-agent@9.1.0: resolution: {integrity: sha512-2NxoveTT58mjYT4n3RPTEfCZGLMbidoO8XEieXfpSYxu+PQJ1qpx4ypwH6N+uF9twBPIvRRgvkvW5HUTYWENig==} engines: {node: '>= 20'} @@ -1807,14 +1874,14 @@ packages: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} - ignore@7.0.5: - resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} - engines: {node: '>= 4'} - ignore@7.0.6: resolution: {integrity: sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==} engines: {node: '>= 4'} + ignore@7.0.8: + resolution: {integrity: sha512-YYNsSlXBjMk92SKnkwvB5LOVSa6OznlFUGcsvrFgNJbJCd0M1XKeFVRc8ZByeCqz32FivYNHJVooLmdqrmvp/Q==} + engines: {node: '>= 4'} + import-fresh@3.3.1: resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} engines: {node: '>=6'} @@ -2088,8 +2155,8 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@11.5.2: - resolution: {integrity: sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==} + lru-cache@11.5.3: + resolution: {integrity: sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==} engines: {node: 20 || >=22} magic-string@0.30.21: @@ -2117,8 +2184,8 @@ packages: engines: {node: '>= 18'} hasBin: true - marked@18.0.5: - resolution: {integrity: sha512-S6GcvALHg6K4ohtu4E7x0a1AqhAjp6cV8KhLSyN9qVapnzJkusVBxZRcIU9AeYsbe6P1hKDusSbEOzGyyuce6w==} + marked@18.0.11: + resolution: {integrity: sha512-HnslJfsZkRPBDJRHvVtAaWlZHEpSu7u8LgQuJCELjRKuWR+hpq4A7sLq3p8HaI9ypVoXDXxV34CsQJEe1+J5Aw==} engines: {node: '>= 20'} hasBin: true @@ -2146,6 +2213,10 @@ packages: resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} engines: {node: 18 || 20 || >=22} + minimatch@10.2.6: + resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==} + engines: {node: 18 || 20 || >=22} + minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -2456,8 +2527,8 @@ packages: proto-list@1.2.4: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} - protobufjs@7.6.5: - resolution: {integrity: sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==} + protobufjs@7.6.6: + resolution: {integrity: sha512-dYDWdjSl5RNb7SgPxGQcRU+GtvP7s2fpkrY0r432PcOIaZ0/rBcxEZnQN67iJhFuQiVw754JDoPruPCNdGsbjg==} engines: {node: '>=12.0.0'} proxy-agent-negotiate@1.1.0: @@ -2540,11 +2611,6 @@ packages: resolution: {integrity: sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==} engines: {node: '>=12'} - semver@7.8.0: - resolution: {integrity: sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==} - engines: {node: '>=10'} - hasBin: true - semver@7.8.5: resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} engines: {node: '>=10'} @@ -2771,12 +2837,12 @@ packages: resolution: {integrity: sha512-YGYEVz3Fm5iy/AybuA0oyNFq7H4CgQNfRp/qfe8nurE1kuCeNm3/vfm9X4Mtl+qLyaKJUh5xrFZwogr41SMjYA==} engines: {node: '>=20'} + typebox@1.3.27: + resolution: {integrity: sha512-zu+jc1pcy4UiNThxikUr36f0Rybk9PEeCg/NE6adeWr/SKsdNO4EzZHYRDlv2YCVAfj3Odq3dESSo/jNyoBXzA==} + typebox@1.3.6: resolution: {integrity: sha512-Sc8RA0NCMEFmApHNU9ZMzqcpQj46She44J8ffpLM/bdhLNUZKq7DJumcLcsFx1gRmDfQPgCgOmFFJ7rcnfWNyA==} - typebox@1.3.7: - resolution: {integrity: sha512-meKuifc33Pccx0O6PdIzYMq3Og8zvP4TIi/a+Bw3AEMZMxOD0+RHGQvpglEe6Zdy3wZ8nqn/j95h8LUZLk/6Hg==} - typescript@6.0.3: resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} engines: {node: '>=14.17'} @@ -2790,6 +2856,9 @@ packages: undici-types@8.3.0: resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==} + undici-types@8.9.0: + resolution: {integrity: sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==} + undici@6.27.0: resolution: {integrity: sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==} engines: {node: '>=18.17'} @@ -2798,8 +2867,8 @@ packages: resolution: {integrity: sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==} engines: {node: '>=20.18.1'} - undici@8.9.0: - resolution: {integrity: sha512-aWZpUj7XoGonMClx4gdDRfgBjqeA+F473aDmROQQbM9n6PRfK/u1q/a0X4wMTgcHfT8H6fpbt98PFuDUwFg2YA==} + undici@8.10.2: + resolution: {integrity: sha512-/y4/bH9YNU5hi9NIrpOuvGXFcxrj3CMrV+/AYpowAYTpHn8gX/XPFjNy766FPoYY0miQhdW977JFWKGNhBdwyQ==} engines: {node: '>=22.19.0'} unicode-emoji-modifier-base@1.0.0: @@ -3054,223 +3123,191 @@ snapshots: semantic-release: 25.0.8(supports-color@7.2.0)(typescript@6.0.3) temporal-polyfill: 1.0.1 - '@anthropic-ai/sdk@0.123.0(zod@4.4.3)': + '@anthropic-ai/sdk@0.124.0(zod@4.4.3)': dependencies: json-schema-to-ts: 3.1.1 standardwebhooks: 1.1.1 optionalDependencies: zod: 4.4.3 - '@aws-crypto/sha256-browser@5.2.0': - dependencies: - '@aws-crypto/sha256-js': 5.2.0 - '@aws-crypto/supports-web-crypto': 5.2.0 - '@aws-crypto/util': 5.2.0 - '@aws-sdk/types': 3.974.5 - '@aws-sdk/util-locate-window': 3.965.10 - '@smithy/util-utf8': 2.3.0 - tslib: 2.8.1 - - '@aws-crypto/sha256-js@5.2.0': - dependencies: - '@aws-crypto/util': 5.2.0 - '@aws-sdk/types': 3.974.5 - tslib: 2.8.1 - - '@aws-crypto/supports-web-crypto@5.2.0': - dependencies: - tslib: 2.8.1 - - '@aws-crypto/util@5.2.0': + '@aws-sdk/client-bedrock-runtime@3.1127.0': dependencies: - '@aws-sdk/types': 3.974.5 - '@smithy/util-utf8': 2.3.0 - tslib: 2.8.1 - - '@aws-sdk/client-bedrock-runtime@3.1048.0': - dependencies: - '@aws-crypto/sha256-browser': 5.2.0 - '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/core': 3.977.9 - '@aws-sdk/credential-provider-node': 3.972.81 + '@aws-sdk/core': 3.978.0 + '@aws-sdk/credential-provider-node': 3.972.83 '@aws-sdk/eventstream-handler-node': 3.972.34 '@aws-sdk/middleware-eventstream': 3.972.29 - '@aws-sdk/middleware-websocket': 3.972.52 - '@aws-sdk/token-providers': 3.1048.0 + '@aws-sdk/middleware-websocket': 3.972.53 + '@aws-sdk/token-providers': 3.1127.0 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/fetch-http-handler': 5.7.2 - '@smithy/node-http-handler': 4.11.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/fetch-http-handler': 5.8.0 + '@smithy/node-http-handler': 4.12.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/core@3.977.9': + '@aws-sdk/core@3.978.0': dependencies: '@aws-sdk/types': 3.974.5 '@aws-sdk/xml-builder': 3.972.40 '@aws/lambda-invoke-store': 0.3.0 - '@smithy/core': 3.33.3 + '@smithy/core': 3.34.1 '@smithy/signature-v4': 5.7.3 - '@smithy/types': 4.17.2 + '@smithy/types': 4.18.0 bowser: 2.14.1 tslib: 2.8.1 - '@aws-sdk/credential-provider-env@3.972.70': + '@aws-sdk/credential-provider-env@3.972.71': dependencies: - '@aws-sdk/core': 3.977.9 + '@aws-sdk/core': 3.978.0 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/credential-provider-http@3.972.72': + '@aws-sdk/credential-provider-http@3.972.73': dependencies: - '@aws-sdk/core': 3.977.9 + '@aws-sdk/core': 3.978.0 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/fetch-http-handler': 5.7.2 - '@smithy/node-http-handler': 4.11.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/fetch-http-handler': 5.8.0 + '@smithy/node-http-handler': 4.12.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/credential-provider-ini@3.973.15': + '@aws-sdk/credential-provider-ini@3.973.16': dependencies: - '@aws-sdk/core': 3.977.9 - '@aws-sdk/credential-provider-env': 3.972.70 - '@aws-sdk/credential-provider-http': 3.972.72 - '@aws-sdk/credential-provider-login': 3.972.77 - '@aws-sdk/credential-provider-process': 3.972.70 - '@aws-sdk/credential-provider-sso': 3.973.14 - '@aws-sdk/credential-provider-web-identity': 3.972.76 - '@aws-sdk/nested-clients': 3.997.44 + '@aws-sdk/core': 3.978.0 + '@aws-sdk/credential-provider-env': 3.972.71 + '@aws-sdk/credential-provider-http': 3.972.73 + '@aws-sdk/credential-provider-login': 3.972.78 + '@aws-sdk/credential-provider-process': 3.972.71 + '@aws-sdk/credential-provider-sso': 3.973.15 + '@aws-sdk/credential-provider-web-identity': 3.972.77 + '@aws-sdk/nested-clients': 3.997.45 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 + '@smithy/core': 3.34.1 '@smithy/credential-provider-imds': 4.5.2 - '@smithy/types': 4.17.2 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/credential-provider-login@3.972.77': + '@aws-sdk/credential-provider-login@3.972.78': dependencies: - '@aws-sdk/core': 3.977.9 - '@aws-sdk/nested-clients': 3.997.44 + '@aws-sdk/core': 3.978.0 + '@aws-sdk/nested-clients': 3.997.45 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/credential-provider-node@3.972.81': + '@aws-sdk/credential-provider-node@3.972.83': dependencies: - '@aws-sdk/credential-provider-env': 3.972.70 - '@aws-sdk/credential-provider-http': 3.972.72 - '@aws-sdk/credential-provider-ini': 3.973.15 - '@aws-sdk/credential-provider-process': 3.972.70 - '@aws-sdk/credential-provider-sso': 3.973.14 - '@aws-sdk/credential-provider-web-identity': 3.972.76 + '@aws-sdk/credential-provider-env': 3.972.71 + '@aws-sdk/credential-provider-http': 3.972.73 + '@aws-sdk/credential-provider-ini': 3.973.16 + '@aws-sdk/credential-provider-process': 3.972.71 + '@aws-sdk/credential-provider-sso': 3.973.15 + '@aws-sdk/credential-provider-web-identity': 3.972.77 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 + '@smithy/core': 3.34.1 '@smithy/credential-provider-imds': 4.5.2 - '@smithy/types': 4.17.2 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/credential-provider-process@3.972.70': + '@aws-sdk/credential-provider-process@3.972.71': dependencies: - '@aws-sdk/core': 3.977.9 + '@aws-sdk/core': 3.978.0 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/credential-provider-sso@3.973.14': + '@aws-sdk/credential-provider-sso@3.973.15': dependencies: - '@aws-sdk/core': 3.977.9 - '@aws-sdk/nested-clients': 3.997.44 - '@aws-sdk/token-providers': 3.1116.0 + '@aws-sdk/core': 3.978.0 + '@aws-sdk/nested-clients': 3.997.45 + '@aws-sdk/token-providers': 3.1129.0 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/credential-provider-web-identity@3.972.76': + '@aws-sdk/credential-provider-web-identity@3.972.77': dependencies: - '@aws-sdk/core': 3.977.9 - '@aws-sdk/nested-clients': 3.997.44 + '@aws-sdk/core': 3.978.0 + '@aws-sdk/nested-clients': 3.997.45 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 '@aws-sdk/eventstream-handler-node@3.972.34': dependencies: '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 '@aws-sdk/middleware-eventstream@3.972.29': dependencies: '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/middleware-websocket@3.972.52': + '@aws-sdk/middleware-websocket@3.972.53': dependencies: - '@aws-sdk/core': 3.977.9 + '@aws-sdk/core': 3.978.0 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/fetch-http-handler': 5.7.2 + '@smithy/core': 3.34.1 + '@smithy/fetch-http-handler': 5.8.0 '@smithy/signature-v4': 5.7.3 - '@smithy/types': 4.17.2 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/nested-clients@3.997.44': + '@aws-sdk/nested-clients@3.997.45': dependencies: - '@aws-sdk/core': 3.977.9 + '@aws-sdk/core': 3.978.0 '@aws-sdk/signature-v4-multi-region': 3.996.46 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/fetch-http-handler': 5.7.2 - '@smithy/node-http-handler': 4.11.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/fetch-http-handler': 5.8.0 + '@smithy/node-http-handler': 4.12.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 '@aws-sdk/signature-v4-multi-region@3.996.46': dependencies: '@aws-sdk/types': 3.974.5 '@smithy/signature-v4': 5.7.3 - '@smithy/types': 4.17.2 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/token-providers@3.1048.0': + '@aws-sdk/token-providers@3.1127.0': dependencies: - '@aws-sdk/core': 3.977.9 - '@aws-sdk/nested-clients': 3.997.44 + '@aws-sdk/core': 3.978.0 + '@aws-sdk/nested-clients': 3.997.45 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@aws-sdk/token-providers@3.1116.0': + '@aws-sdk/token-providers@3.1129.0': dependencies: - '@aws-sdk/core': 3.977.9 - '@aws-sdk/nested-clients': 3.997.44 + '@aws-sdk/core': 3.978.0 + '@aws-sdk/nested-clients': 3.997.45 '@aws-sdk/types': 3.974.5 - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 '@aws-sdk/types@3.974.5': dependencies: - '@smithy/types': 4.17.2 - tslib: 2.8.1 - - '@aws-sdk/util-locate-window@3.965.10': - dependencies: + '@smithy/types': 4.18.0 tslib: 2.8.1 '@aws-sdk/xml-builder@3.972.40': dependencies: - '@smithy/types': 4.17.2 + '@smithy/types': 4.18.0 tslib: 2.8.1 '@aws/lambda-invoke-store@0.3.0': {} @@ -3303,84 +3340,85 @@ snapshots: '@conventional-changelog/template@1.2.1': {} - '@earendil-works/chord@0.85.1': + '@earendil-works/chord@0.87.1': dependencies: - esbuild: 0.28.1 + esbuild: 0.28.2 - '@earendil-works/pi-agent-core@0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3)': + '@earendil-works/pi-agent-core@0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3)': dependencies: - '@earendil-works/chord': 0.85.1 - '@earendil-works/pi-ai': 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) - '@earendil-works/pi-telemetry': 0.85.1 + '@earendil-works/chord': 0.87.1 + '@earendil-works/pi-ai': 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + '@earendil-works/pi-telemetry': 0.87.1 diff: 8.0.4 - ignore: 7.0.5 - typebox: 1.3.7 + ignore: 7.0.8 + typebox: 1.3.27 yaml: 2.9.0 transitivePeerDependencies: - '@modelcontextprotocol/sdk' - bufferutil + - kerberos - supports-color - utf-8-validate - ws - zod - '@earendil-works/pi-ai@0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3)': + '@earendil-works/pi-ai@0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3)': dependencies: - '@anthropic-ai/sdk': 0.123.0(zod@4.4.3) - '@aws-sdk/client-bedrock-runtime': 3.1048.0 - '@earendil-works/pi-telemetry': 0.85.1 - '@google/genai': 1.52.0(supports-color@7.2.0) - '@smithy/node-http-handler': 4.7.3 - http-proxy-agent: 7.0.2(supports-color@7.2.0) - https-proxy-agent: 7.0.6(supports-color@7.2.0) + '@anthropic-ai/sdk': 0.124.0(zod@4.4.3) + '@aws-sdk/client-bedrock-runtime': 3.1127.0 + '@earendil-works/pi-telemetry': 0.87.1 + '@google/genai': 2.21.0(supports-color@7.2.0) + '@smithy/node-http-handler': 4.12.1 + http-proxy-agent: 9.1.0(supports-color@7.2.0) + https-proxy-agent: 9.1.0(supports-color@7.2.0) openai: 6.40.0(ws@8.21.3)(zod@4.4.3) partial-json: 0.1.7 - typebox: 1.3.7 + typebox: 1.3.27 transitivePeerDependencies: - '@modelcontextprotocol/sdk' - bufferutil + - kerberos - supports-color - utf-8-validate - ws - zod - '@earendil-works/pi-coding-agent@0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3)': + '@earendil-works/pi-coding-agent@0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3)': dependencies: - '@earendil-works/chord': 0.85.1 - '@earendil-works/pi-agent-core': 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) - '@earendil-works/pi-ai': 0.85.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) - '@earendil-works/pi-tui': 0.85.1 + '@earendil-works/chord': 0.87.1 + '@earendil-works/pi-agent-core': 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + '@earendil-works/pi-ai': 0.87.1(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + '@earendil-works/pi-tui': 0.87.1 '@silvia-odwyer/photon-node': 0.3.4 - chalk: 5.6.2 + chalk: 6.0.0 cross-spawn: 7.0.6 diff: 8.0.4 - grok-mermaid: 0.2.2 + grok-mermaid: 0.2.3 highlight.js: 10.7.3 hosted-git-info: 9.0.3 - ignore: 7.0.5 + ignore: 7.0.8 jiti: 2.7.0 - minimatch: 10.2.5 + minimatch: 10.2.6 proper-lockfile: 4.1.2 - semver: 7.8.0 - typebox: 1.3.7 - undici: 8.9.0 + semver: 7.8.5 + typebox: 1.3.27 + undici: 8.10.2 yaml: 2.9.0 - optionalDependencies: - '@mariozechner/clipboard': 0.3.9 transitivePeerDependencies: - '@modelcontextprotocol/sdk' - bufferutil + - kerberos - supports-color - utf-8-validate - ws - zod - '@earendil-works/pi-telemetry@0.85.1': {} + '@earendil-works/pi-telemetry@0.87.1': {} - '@earendil-works/pi-tui@0.85.1': + '@earendil-works/pi-tui@0.87.1': dependencies: get-east-asian-width: 1.6.0 - marked: 18.0.5 + marked: 18.0.11 '@emnapi/core@1.11.1': dependencies: @@ -3401,81 +3439,159 @@ snapshots: '@esbuild/aix-ppc64@0.28.1': optional: true + '@esbuild/aix-ppc64@0.28.2': + optional: true + '@esbuild/android-arm64@0.28.1': optional: true + '@esbuild/android-arm64@0.28.2': + optional: true + '@esbuild/android-arm@0.28.1': optional: true + '@esbuild/android-arm@0.28.2': + optional: true + '@esbuild/android-x64@0.28.1': optional: true + '@esbuild/android-x64@0.28.2': + optional: true + '@esbuild/darwin-arm64@0.28.1': optional: true + '@esbuild/darwin-arm64@0.28.2': + optional: true + '@esbuild/darwin-x64@0.28.1': optional: true + '@esbuild/darwin-x64@0.28.2': + optional: true + '@esbuild/freebsd-arm64@0.28.1': optional: true + '@esbuild/freebsd-arm64@0.28.2': + optional: true + '@esbuild/freebsd-x64@0.28.1': optional: true + '@esbuild/freebsd-x64@0.28.2': + optional: true + '@esbuild/linux-arm64@0.28.1': optional: true + '@esbuild/linux-arm64@0.28.2': + optional: true + '@esbuild/linux-arm@0.28.1': optional: true + '@esbuild/linux-arm@0.28.2': + optional: true + '@esbuild/linux-ia32@0.28.1': optional: true + '@esbuild/linux-ia32@0.28.2': + optional: true + '@esbuild/linux-loong64@0.28.1': optional: true + '@esbuild/linux-loong64@0.28.2': + optional: true + '@esbuild/linux-mips64el@0.28.1': optional: true + '@esbuild/linux-mips64el@0.28.2': + optional: true + '@esbuild/linux-ppc64@0.28.1': optional: true + '@esbuild/linux-ppc64@0.28.2': + optional: true + '@esbuild/linux-riscv64@0.28.1': optional: true + '@esbuild/linux-riscv64@0.28.2': + optional: true + '@esbuild/linux-s390x@0.28.1': optional: true + '@esbuild/linux-s390x@0.28.2': + optional: true + '@esbuild/linux-x64@0.28.1': optional: true + '@esbuild/linux-x64@0.28.2': + optional: true + '@esbuild/netbsd-arm64@0.28.1': optional: true + '@esbuild/netbsd-arm64@0.28.2': + optional: true + '@esbuild/netbsd-x64@0.28.1': optional: true + '@esbuild/netbsd-x64@0.28.2': + optional: true + '@esbuild/openbsd-arm64@0.28.1': optional: true + '@esbuild/openbsd-arm64@0.28.2': + optional: true + '@esbuild/openbsd-x64@0.28.1': optional: true + '@esbuild/openbsd-x64@0.28.2': + optional: true + '@esbuild/openharmony-arm64@0.28.1': optional: true + '@esbuild/openharmony-arm64@0.28.2': + optional: true + '@esbuild/sunos-x64@0.28.1': optional: true + '@esbuild/sunos-x64@0.28.2': + optional: true + '@esbuild/win32-arm64@0.28.1': optional: true + '@esbuild/win32-arm64@0.28.2': + optional: true + '@esbuild/win32-ia32@0.28.1': optional: true + '@esbuild/win32-ia32@0.28.2': + optional: true + '@esbuild/win32-x64@0.28.1': optional: true + '@esbuild/win32-x64@0.28.2': + optional: true + '@eslint-community/eslint-utils@4.9.1(eslint@10.7.0(jiti@2.7.0)(supports-color@7.2.0))': dependencies: eslint: 10.7.0(jiti@2.7.0)(supports-color@7.2.0) @@ -3530,11 +3646,11 @@ snapshots: '@fallow-cli/win32-x64-msvc@3.7.1': optional: true - '@google/genai@1.52.0(supports-color@7.2.0)': + '@google/genai@2.21.0(supports-color@7.2.0)': dependencies: google-auth-library: 10.9.1(supports-color@7.2.0) p-retry: 4.6.2 - protobufjs: 7.6.5 + protobufjs: 7.6.6 ws: 8.21.3 transitivePeerDependencies: - bufferutil @@ -3578,50 +3694,6 @@ snapshots: '@kwsites/promise-deferred@1.1.1': {} - '@mariozechner/clipboard-darwin-arm64@0.3.9': - optional: true - - '@mariozechner/clipboard-darwin-universal@0.3.9': - optional: true - - '@mariozechner/clipboard-darwin-x64@0.3.9': - optional: true - - '@mariozechner/clipboard-linux-arm64-gnu@0.3.9': - optional: true - - '@mariozechner/clipboard-linux-arm64-musl@0.3.9': - optional: true - - '@mariozechner/clipboard-linux-riscv64-gnu@0.3.9': - optional: true - - '@mariozechner/clipboard-linux-x64-gnu@0.3.9': - optional: true - - '@mariozechner/clipboard-linux-x64-musl@0.3.9': - optional: true - - '@mariozechner/clipboard-win32-arm64-msvc@0.3.9': - optional: true - - '@mariozechner/clipboard-win32-x64-msvc@0.3.9': - optional: true - - '@mariozechner/clipboard@0.3.9': - optionalDependencies: - '@mariozechner/clipboard-darwin-arm64': 0.3.9 - '@mariozechner/clipboard-darwin-universal': 0.3.9 - '@mariozechner/clipboard-darwin-x64': 0.3.9 - '@mariozechner/clipboard-linux-arm64-gnu': 0.3.9 - '@mariozechner/clipboard-linux-arm64-musl': 0.3.9 - '@mariozechner/clipboard-linux-riscv64-gnu': 0.3.9 - '@mariozechner/clipboard-linux-x64-gnu': 0.3.9 - '@mariozechner/clipboard-linux-x64-musl': 0.3.9 - '@mariozechner/clipboard-win32-arm64-msvc': 0.3.9 - '@mariozechner/clipboard-win32-x64-msvc': 0.3.9 - optional: true - '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)': dependencies: '@emnapi/core': 1.11.1 @@ -3899,57 +3971,37 @@ snapshots: '@sindresorhus/merge-streams@4.0.0': {} - '@smithy/core@3.33.3': + '@smithy/core@3.34.1': dependencies: - '@smithy/types': 4.17.2 + '@smithy/types': 4.18.0 tslib: 2.8.1 '@smithy/credential-provider-imds@4.5.2': dependencies: - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 - tslib: 2.8.1 - - '@smithy/fetch-http-handler@5.7.2': - dependencies: - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 - tslib: 2.8.1 - - '@smithy/is-array-buffer@2.2.0': - dependencies: + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@smithy/node-http-handler@4.11.3': + '@smithy/fetch-http-handler@5.8.0': dependencies: - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@smithy/node-http-handler@4.7.3': + '@smithy/node-http-handler@4.12.1': dependencies: - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 '@smithy/signature-v4@5.7.3': dependencies: - '@smithy/core': 3.33.3 - '@smithy/types': 4.17.2 - tslib: 2.8.1 - - '@smithy/types@4.17.2': - dependencies: - tslib: 2.8.1 - - '@smithy/util-buffer-from@2.2.0': - dependencies: - '@smithy/is-array-buffer': 2.2.0 + '@smithy/core': 3.34.1 + '@smithy/types': 4.18.0 tslib: 2.8.1 - '@smithy/util-utf8@2.3.0': + '@smithy/types@4.18.0': dependencies: - '@smithy/util-buffer-from': 2.2.0 tslib: 2.8.1 '@stablelib/base64@1.0.1': {} @@ -3978,9 +4030,9 @@ snapshots: dependencies: undici-types: 8.3.0 - '@types/node@26.3.0': + '@types/node@26.6.2': dependencies: - undici-types: 8.3.0 + undici-types: 8.9.0 '@types/normalize-package-data@2.4.4': {} @@ -4089,7 +4141,7 @@ snapshots: obug: 2.1.4 std-env: 4.2.0 tinyrainbow: 3.1.0 - vitest: 4.1.11(@opentelemetry/api@1.9.0)(@types/node@26.1.1)(@vitest/coverage-v8@4.1.10)(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)) + vitest: 4.1.11(@opentelemetry/api@1.9.0)(@types/node@26.1.1)(@vitest/coverage-v8@4.1.10)(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)) '@vitest/expect@4.1.11': dependencies: @@ -4100,13 +4152,13 @@ snapshots: chai: 6.2.2 tinyrainbow: 3.1.1 - '@vitest/mocker@4.1.11(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0))': + '@vitest/mocker@4.1.11(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0))': dependencies: '@vitest/spy': 4.1.11 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 8.1.5(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0) + vite: 8.1.5(@types/node@26.1.1)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0) '@vitest/pretty-format@4.1.10': dependencies: @@ -4217,6 +4269,10 @@ snapshots: bowser@2.14.1: {} + brace-expansion@5.0.12: + dependencies: + balanced-match: 4.0.4 + brace-expansion@5.0.9: dependencies: balanced-match: 4.0.4 @@ -4244,6 +4300,8 @@ snapshots: chalk@5.6.2: {} + chalk@6.0.0: {} + char-regex@1.0.2: {} clean-stack@2.2.0: {} @@ -4446,6 +4504,35 @@ snapshots: '@esbuild/win32-ia32': 0.28.1 '@esbuild/win32-x64': 0.28.1 + esbuild@0.28.2: + optionalDependencies: + '@esbuild/aix-ppc64': 0.28.2 + '@esbuild/android-arm': 0.28.2 + '@esbuild/android-arm64': 0.28.2 + '@esbuild/android-x64': 0.28.2 + '@esbuild/darwin-arm64': 0.28.2 + '@esbuild/darwin-x64': 0.28.2 + '@esbuild/freebsd-arm64': 0.28.2 + '@esbuild/freebsd-x64': 0.28.2 + '@esbuild/linux-arm': 0.28.2 + '@esbuild/linux-arm64': 0.28.2 + '@esbuild/linux-ia32': 0.28.2 + '@esbuild/linux-loong64': 0.28.2 + '@esbuild/linux-mips64el': 0.28.2 + '@esbuild/linux-ppc64': 0.28.2 + '@esbuild/linux-riscv64': 0.28.2 + '@esbuild/linux-s390x': 0.28.2 + '@esbuild/linux-x64': 0.28.2 + '@esbuild/netbsd-arm64': 0.28.2 + '@esbuild/netbsd-x64': 0.28.2 + '@esbuild/openbsd-arm64': 0.28.2 + '@esbuild/openbsd-x64': 0.28.2 + '@esbuild/openharmony-arm64': 0.28.2 + '@esbuild/sunos-x64': 0.28.2 + '@esbuild/win32-arm64': 0.28.2 + '@esbuild/win32-ia32': 0.28.2 + '@esbuild/win32-x64': 0.28.2 + escalade@3.2.0: {} escape-string-regexp@1.0.5: {} @@ -4700,7 +4787,7 @@ snapshots: graceful-fs@4.2.11: {} - grok-mermaid@0.2.2: {} + grok-mermaid@0.2.3: {} handlebars@4.7.9: dependencies: @@ -4725,17 +4812,10 @@ snapshots: hosted-git-info@9.0.3: dependencies: - lru-cache: 11.5.2 + lru-cache: 11.5.3 html-escaper@2.0.2: {} - http-proxy-agent@7.0.2(supports-color@7.2.0): - dependencies: - agent-base: 7.1.4 - debug: 4.4.3(supports-color@7.2.0) - transitivePeerDependencies: - - supports-color - http-proxy-agent@9.1.0(supports-color@7.2.0): dependencies: agent-base: 9.0.0 @@ -4767,10 +4847,10 @@ snapshots: ignore@5.3.2: {} - ignore@7.0.5: {} - ignore@7.0.6: {} + ignore@7.0.8: {} + import-fresh@3.3.1: dependencies: parent-module: 1.0.1 @@ -4990,7 +5070,7 @@ snapshots: lru-cache@10.4.3: {} - lru-cache@11.5.2: {} + lru-cache@11.5.3: {} magic-string@0.30.21: dependencies: @@ -5025,7 +5105,7 @@ snapshots: marked@15.0.12: {} - marked@18.0.5: {} + marked@18.0.11: {} meow@13.2.0: {} @@ -5044,6 +5124,10 @@ snapshots: dependencies: brace-expansion: 5.0.9 + minimatch@10.2.6: + dependencies: + brace-expansion: 5.0.12 + minimist@1.2.8: {} ms@2.1.3: {} @@ -5250,7 +5334,7 @@ snapshots: proto-list@1.2.4: {} - protobufjs@7.6.5: + protobufjs@7.6.6: dependencies: '@protobufjs/aspromise': 1.1.2 '@protobufjs/base64': 1.1.2 @@ -5261,7 +5345,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.2 - '@types/node': 26.3.0 + '@types/node': 26.6.2 long: 5.3.2 proxy-agent-negotiate@1.1.0: {} @@ -5389,8 +5473,6 @@ snapshots: semver-regex@4.0.5: {} - semver@7.8.0: {} - semver@7.8.5: {} shebang-command@2.0.0: @@ -5600,9 +5682,9 @@ snapshots: dependencies: tagged-tag: 1.0.0 - typebox@1.3.6: {} + typebox@1.3.27: {} - typebox@1.3.7: {} + typebox@1.3.6: {} typescript@6.0.3: {} @@ -5611,11 +5693,13 @@ snapshots: undici-types@8.3.0: {} + undici-types@8.9.0: {} + undici@6.27.0: {} undici@7.28.0: {} - undici@8.9.0: {} + undici@8.10.2: {} unicode-emoji-modifier-base@1.0.0: {} @@ -5646,7 +5730,7 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0): + vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0): dependencies: lightningcss: 1.33.0 picomatch: 4.0.7 @@ -5655,16 +5739,16 @@ snapshots: tinyglobby: 0.2.17 optionalDependencies: '@types/node': 26.1.1 - esbuild: 0.28.1 + esbuild: 0.28.2 fsevents: 2.3.3 jiti: 2.7.0 tsx: 4.23.1 yaml: 2.9.0 - vitest@4.1.11(@opentelemetry/api@1.9.0)(@types/node@26.1.1)(@vitest/coverage-v8@4.1.10)(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)): + vitest@4.1.11(@opentelemetry/api@1.9.0)(@types/node@26.1.1)(@vitest/coverage-v8@4.1.10)(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)): dependencies: '@vitest/expect': 4.1.11 - '@vitest/mocker': 4.1.11(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)) + '@vitest/mocker': 4.1.11(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)) '@vitest/pretty-format': 4.1.11 '@vitest/runner': 4.1.11 '@vitest/snapshot': 4.1.11 @@ -5681,7 +5765,7 @@ snapshots: tinyexec: 1.3.1 tinyglobby: 0.2.17 tinyrainbow: 3.1.1 - vite: 8.1.5(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0) + vite: 8.1.5(@types/node@26.1.1)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0) why-is-node-running: 2.3.0 optionalDependencies: '@opentelemetry/api': 1.9.0 diff --git a/renovate.json b/renovate.json index f4ba17ea..3c8d5a7b 100644 --- a/renovate.json +++ b/renovate.json @@ -1,13 +1,47 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["config:recommended"], - "schedule": ["before 6am"], + "extends": [ + "config:recommended", + ":semanticCommits", + ":semanticCommitTypeAll(chore)", + "helpers:pinGitHubActionDigests" + ], + "timezone": "Europe/Zurich", + "schedule": ["* 5 * * 1"], "labels": ["dependencies", "automated"], + "gitAuthor": "Alexander Fortin ", + "rangeStrategy": "update-lockfile", + "lockFileMaintenance": { + "enabled": true, + "schedule": ["* 5 * * 1"] + }, "packageRules": [ + { + "description": "Group all non-breaking devDependency updates into one PR", + "matchDepTypes": ["devDependencies"], + "matchUpdateTypes": ["minor", "patch"], + "groupName": "devDependencies (minor & patch)" + }, { "description": "Group @earendil-works Pi SDK packages — they share a version scheme and should move together", "groupName": "Pi SDK", - "matchPackagePatterns": ["^@earendil-works/"] + "matchPackageNames": ["/^@earendil-works//"] + }, + { + "description": "Group GitHub Actions updates", + "matchManagers": ["github-actions"], + "groupName": "GitHub Actions" + }, + { + "description": "Separate PR for major updates of runtime-critical tooling", + "matchPackageNames": ["typescript", "eslint", "vitest", "esbuild"], + "matchUpdateTypes": ["major"], + "groupName": null } - ] + ], + "vulnerabilityAlerts": { + "enabled": true, + "labels": ["security"] + }, + "osvVulnerabilityAlerts": true } diff --git a/tests/action-manifest.spec.ts b/tests/action-manifest.spec.ts new file mode 100644 index 00000000..ec409f64 --- /dev/null +++ b/tests/action-manifest.spec.ts @@ -0,0 +1,55 @@ +import { readFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { parse, YAMLParseError } from 'yaml'; +import { describe, expect, it } from 'vitest'; + +/** + * Validates the GitHub Action manifest (`action.yml`). + * + * The GitHub Actions runner uses a strict YAML parser to load the action + * manifest; a single malformed scalar (e.g. an unescaped `'` inside a + * single-quoted string) breaks the whole action before it ever runs. + * This test catches such regressions in CI and in the pre-commit hook. + */ +describe('action.yml manifest', () => { + const manifestPath = join(__dirname, '..', 'action.yml'); + let manifest: Record; + + it('is valid YAML', () => { + expect(() => { + manifest = parse(readFileSync(manifestPath, 'utf8')) as Record; + }).not.toThrow(YAMLParseError); + expect(manifest).toBeDefined(); + }); + + it('has the required top-level sections as mappings', () => { + for (const key of ['name', 'description', 'runs']) { + expect(manifest[key], `missing top-level key: ${key}`).toBeDefined(); + } + expect(manifest.runs).toBeTypeOf('object'); + }); + + it('declares a node24 main entry point', () => { + const runs = manifest.runs as Record; + expect(runs.using).toBe('node24'); + expect(runs.main).toBeTypeOf('string'); + expect(runs.main).toMatch(/dist[\\/]index\.js$/); + }); + + it('declares every input with a description', () => { + const inputs = manifest.inputs as Record | undefined; + expect(inputs).toBeTypeOf('object'); + for (const [name, input] of Object.entries(inputs ?? {})) { + expect(input?.description, `input "${name}" has no description`).toBeTypeOf('string'); + expect(input?.description?.length).toBeGreaterThan(0); + } + }); + + it('declares every output with a description', () => { + const outputs = manifest.outputs as + Record | undefined; + for (const [name, output] of Object.entries(outputs ?? {})) { + expect(output?.description, `output "${name}" has no description`).toBeTypeOf('string'); + } + }); +}); diff --git a/vitest.config.ts b/vitest.config.ts index 10456798..c217951c 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -10,7 +10,7 @@ import { defineConfig } from 'vitest/config'; */ export default defineConfig({ test: { - include: ['packages/*/tests/**/*.spec.ts', 'tests/e2e/**/*.spec.ts'], + include: ['packages/*/tests/**/*.spec.ts', 'tests/*.spec.ts', 'tests/e2e/**/*.spec.ts'], exclude: ['node_modules/**', 'dist/**'], // Tests that exercise the real Pi agent (`agent-logic.spec.ts`) call // `Agent.ready()`, which dynamically imports and initialises the full Pi